summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/BootSectImage29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/BuildEnv5
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc5
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/EfiLdrImage29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/EfiRom29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/GenCrc3229
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/GenDepex3
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/GenFds5
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/GenFfs29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/GenFv29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/GenFw29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/GenPage29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/GenSec29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/GenVtf29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/GnuGenBootSector29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaCompress29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaF86Compress22
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/RunBinToolFromBuildDir29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/RunToolFromSource5
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/Split29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/TargetTool5
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/TianoCompress29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/Trim5
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/VfrCompile29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/VolInfo29
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py93
-rwxr-xr-xBaseTools/Bin/CYGWIN_NT-5.1-i686/build5
-rw-r--r--BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE31/CompilerIntrinsicsLib.libbin36072 -> 0 bytes
-rw-r--r--BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE32/CompilerIntrinsicsLib.libbin36072 -> 0 bytes
-rw-r--r--BaseTools/Bin/Darwin-i386/Arm/RELEASE_XCODE31/CompilerIntrinsicsLib.libbin11504 -> 0 bytes
-rw-r--r--BaseTools/Bin/Darwin-i386/Arm/RELEASE_XCODE32/CompilerIntrinsicsLib.libbin11504 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/Arm/DEBUG_RVCT31/CompilerIntrinsicsLib.libbin7240 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/Arm/RELEASE_RVCT31/CompilerIntrinsicsLib.libbin7252 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/BPDG.exebin1042268 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/BootSectImage.exebin434176 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/Common.PyUtility.pydbin6144 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/EfiCompressor.pydbin11264 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/EfiLdrImage.exebin421888 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/EfiRom.exebin446464 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/Eot.EfiCompressor.pydbin11264 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/Eot.LzmaCompressor.pydbin14848 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenBootSector.exebin425984 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenCrc32.exebin425984 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenDepex.exebin1066588 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenFds.exebin1385686 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenFfs.exebin430080 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenFv.exebin479232 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenFw.exebin499712 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenPage.exebin425984 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenPatchPcdTable.exebin1064073 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenSec.exebin446464 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenVtf.exebin446464 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/ImportTool.bat53
-rwxr-xr-xBaseTools/Bin/Win32/LzmaCompress.exebin397312 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/LzmaF86Compress.bat29
-rwxr-xr-xBaseTools/Bin/Win32/PatchPcdValue.exebin1036121 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/Split.exebin425984 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/TargetTool.exebin1044356 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/TianoCompress.exebin434176 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/Trim.exebin1103433 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/UPT.exebin1680092 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/VfrCompile.exebin1282048 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/VolInfo.exebin471040 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/_ctypes.pydbin106496 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/_hashlib.pydbin287232 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/_socket.pydbin38400 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/_sqlite3.pydbin57344 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/_ssl.pydbin720896 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/build.exebin1785834 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/msvcr71.dllbin348160 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/pyexpat.pydbin152576 -> 0 bytes
-rw-r--r--BaseTools/Bin/Win32/python27.dllbin2303488 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/select.pydbin11776 -> 0 bytes
-rwxr-xr-xBaseTools/Bin/Win32/sqlite3.dllbin635392 -> 0 bytes
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/BPDG5
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/BootSectImage29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/Ecc5
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/EfiLdrImage29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/EfiRom29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenCrc3229
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenDepex3
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenFds5
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenFfs29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenFv29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenFw29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenPage29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenPatchPcdTable5
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenSec29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GenVtf29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/GnuGenBootSector29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/LzmaCompress29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/LzmaF86Compress22
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/PatchPcdValue5
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/Split29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/TargetTool5
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/TianoCompress29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/Trim5
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/UPT5
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/VfrCompile29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/VolInfo29
-rwxr-xr-xBaseTools/BinWrappers/PosixLike/build5
-rwxr-xr-xBaseTools/BuildEnv251
-rw-r--r--BaseTools/BuildNotes.txt84
-rw-r--r--BaseTools/Conf/Empty_Package_Information_Data_File.ini9
-rw-r--r--BaseTools/Conf/FrameworkDatabase.template28
-rw-r--r--BaseTools/Conf/ReadMe.txt9
-rw-r--r--BaseTools/Conf/XMLSchema/DistributionPackage.xsd2717
-rw-r--r--BaseTools/Conf/build_rule.template542
-rw-r--r--BaseTools/Conf/target.template72
-rw-r--r--BaseTools/Conf/tools_def.template5764
-rw-r--r--BaseTools/Contributions.txt188
-rw-r--r--BaseTools/GNUmakefile35
-rw-r--r--BaseTools/License.txt25
-rw-r--r--BaseTools/Makefile34
-rw-r--r--BaseTools/ReadMe.txt46
-rw-r--r--BaseTools/Scripts/gcc4.4-ld-script44
-rw-r--r--BaseTools/Source/C/BootSectImage/GNUmakefile22
-rw-r--r--BaseTools/Source/C/BootSectImage/Makefile22
-rw-r--r--BaseTools/Source/C/BootSectImage/bootsectimage.c950
-rw-r--r--BaseTools/Source/C/BootSectImage/fat.h152
-rw-r--r--BaseTools/Source/C/BootSectImage/mbr.h58
-rw-r--r--BaseTools/Source/C/Common/BasePeCoff.c1461
-rw-r--r--BaseTools/Source/C/Common/BinderFuncs.c87
-rw-r--r--BaseTools/Source/C/Common/BinderFuncs.h75
-rw-r--r--BaseTools/Source/C/Common/CommonLib.c584
-rw-r--r--BaseTools/Source/C/Common/CommonLib.h173
-rw-r--r--BaseTools/Source/C/Common/Compress.h95
-rw-r--r--BaseTools/Source/C/Common/Crc32.c326
-rw-r--r--BaseTools/Source/C/Common/Crc32.h54
-rw-r--r--BaseTools/Source/C/Common/Decompress.c982
-rw-r--r--BaseTools/Source/C/Common/Decompress.h172
-rw-r--r--BaseTools/Source/C/Common/EfiCompress.c1598
-rw-r--r--BaseTools/Source/C/Common/EfiUtilityMsgs.c914
-rw-r--r--BaseTools/Source/C/Common/EfiUtilityMsgs.h177
-rw-r--r--BaseTools/Source/C/Common/FirmwareVolumeBuffer.c1667
-rw-r--r--BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h166
-rw-r--r--BaseTools/Source/C/Common/FvLib.c851
-rw-r--r--BaseTools/Source/C/Common/FvLib.h178
-rw-r--r--BaseTools/Source/C/Common/GNUmakefile40
-rw-r--r--BaseTools/Source/C/Common/Makefile42
-rw-r--r--BaseTools/Source/C/Common/MemoryFile.c260
-rw-r--r--BaseTools/Source/C/Common/MemoryFile.h122
-rw-r--r--BaseTools/Source/C/Common/MyAlloc.c516
-rw-r--r--BaseTools/Source/C/Common/MyAlloc.h222
-rw-r--r--BaseTools/Source/C/Common/OsPath.c307
-rw-r--r--BaseTools/Source/C/Common/OsPath.h146
-rw-r--r--BaseTools/Source/C/Common/ParseGuidedSectionTools.c211
-rw-r--r--BaseTools/Source/C/Common/ParseGuidedSectionTools.h133
-rw-r--r--BaseTools/Source/C/Common/ParseInf.c689
-rw-r--r--BaseTools/Source/C/Common/ParseInf.h237
-rw-r--r--BaseTools/Source/C/Common/PeCoffLib.h212
-rw-r--r--BaseTools/Source/C/Common/PeCoffLoaderEx.c516
-rw-r--r--BaseTools/Source/C/Common/SimpleFileParsing.c1443
-rw-r--r--BaseTools/Source/C/Common/SimpleFileParsing.h117
-rw-r--r--BaseTools/Source/C/Common/StringFuncs.c426
-rw-r--r--BaseTools/Source/C/Common/StringFuncs.h257
-rw-r--r--BaseTools/Source/C/Common/TianoCompress.c1753
-rw-r--r--BaseTools/Source/C/Common/WinNtInclude.h73
-rw-r--r--BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c327
-rw-r--r--BaseTools/Source/C/EfiLdrImage/GNUmakefile22
-rw-r--r--BaseTools/Source/C/EfiLdrImage/Makefile22
-rw-r--r--BaseTools/Source/C/EfiRom/EfiRom.c1547
-rw-r--r--BaseTools/Source/C/EfiRom/EfiRom.h366
-rw-r--r--BaseTools/Source/C/EfiRom/GNUmakefile22
-rw-r--r--BaseTools/Source/C/EfiRom/Makefile22
-rw-r--r--BaseTools/Source/C/GNUmakefile87
-rw-r--r--BaseTools/Source/C/GenBootSector/FatFormat.h152
-rw-r--r--BaseTools/Source/C/GenBootSector/GenBootSector.c805
-rw-r--r--BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c73
-rw-r--r--BaseTools/Source/C/GenBootSector/Makefile22
-rw-r--r--BaseTools/Source/C/GenCrc32/GNUmakefile22
-rw-r--r--BaseTools/Source/C/GenCrc32/GenCrc32.c368
-rw-r--r--BaseTools/Source/C/GenCrc32/Makefile22
-rw-r--r--BaseTools/Source/C/GenFfs/GNUmakefile23
-rw-r--r--BaseTools/Source/C/GenFfs/GenFfs.c909
-rw-r--r--BaseTools/Source/C/GenFfs/Makefile22
-rw-r--r--BaseTools/Source/C/GenFv/GNUmakefile30
-rw-r--r--BaseTools/Source/C/GenFv/GenFv.c683
-rw-r--r--BaseTools/Source/C/GenFv/GenFvInternalLib.c3756
-rw-r--r--BaseTools/Source/C/GenFv/GenFvInternalLib.h421
-rw-r--r--BaseTools/Source/C/GenFv/Makefile22
-rw-r--r--BaseTools/Source/C/GenFw/Elf32Convert.c1029
-rw-r--r--BaseTools/Source/C/GenFw/Elf32Convert.h24
-rw-r--r--BaseTools/Source/C/GenFw/Elf64Convert.c916
-rw-r--r--BaseTools/Source/C/GenFw/Elf64Convert.h24
-rw-r--r--BaseTools/Source/C/GenFw/ElfConvert.c233
-rw-r--r--BaseTools/Source/C/GenFw/ElfConvert.h83
-rw-r--r--BaseTools/Source/C/GenFw/GNUmakefile30
-rw-r--r--BaseTools/Source/C/GenFw/GenFw.c3200
-rw-r--r--BaseTools/Source/C/GenFw/GenFw.h55
-rw-r--r--BaseTools/Source/C/GenFw/Makefile24
-rw-r--r--BaseTools/Source/C/GenFw/elf32.h258
-rw-r--r--BaseTools/Source/C/GenFw/elf64.h260
-rw-r--r--BaseTools/Source/C/GenFw/elf_common.h1057
-rw-r--r--BaseTools/Source/C/GenPage/GNUmakefile22
-rw-r--r--BaseTools/Source/C/GenPage/GenPage.c435
-rw-r--r--BaseTools/Source/C/GenPage/Makefile22
-rw-r--r--BaseTools/Source/C/GenPage/VirtualMemory.h127
-rw-r--r--BaseTools/Source/C/GenSec/GNUmakefile30
-rw-r--r--BaseTools/Source/C/GenSec/GenSec.c1500
-rw-r--r--BaseTools/Source/C/GenSec/Makefile24
-rw-r--r--BaseTools/Source/C/GenVtf/GNUmakefile22
-rw-r--r--BaseTools/Source/C/GenVtf/GenVtf.c2729
-rw-r--r--BaseTools/Source/C/GenVtf/GenVtf.h335
-rw-r--r--BaseTools/Source/C/GenVtf/Makefile22
-rw-r--r--BaseTools/Source/C/GnuGenBootSector/FatFormat.h152
-rw-r--r--BaseTools/Source/C/GnuGenBootSector/GNUmakefile22
-rw-r--r--BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c461
-rw-r--r--BaseTools/Source/C/Include/AArch64/ProcessorBind.h159
-rw-r--r--BaseTools/Source/C/Include/Arm/ProcessorBind.h158
-rw-r--r--BaseTools/Source/C/Include/Common/BaseTypes.h288
-rw-r--r--BaseTools/Source/C/Include/Common/BuildVersion.h17
-rw-r--r--BaseTools/Source/C/Include/Common/MdeModuleHii.h223
-rw-r--r--BaseTools/Source/C/Include/Common/PiFirmwareFile.h272
-rw-r--r--BaseTools/Source/C/Include/Common/PiFirmwareVolume.h158
-rw-r--r--BaseTools/Source/C/Include/Common/UefiBaseTypes.h177
-rw-r--r--BaseTools/Source/C/Include/Common/UefiCapsule.h35
-rw-r--r--BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h1657
-rw-r--r--BaseTools/Source/C/Include/Common/UefiMultiPhase.h231
-rw-r--r--BaseTools/Source/C/Include/Common/VariableFormat.h52
-rw-r--r--BaseTools/Source/C/Include/Common/WorkingBlockHeader.h43
-rw-r--r--BaseTools/Source/C/Include/Guid/PcAnsi.h61
-rw-r--r--BaseTools/Source/C/Include/Guid/PiFirmwareFileSystem.h41
-rw-r--r--BaseTools/Source/C/Include/Ia32/ProcessorBind.h168
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/Acpi.h125
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/Acpi1_0.h293
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/Acpi2_0.h528
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/Acpi3_0.h676
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/EfiPci.h59
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h47
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/PeImage.h771
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/pci22.h544
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/pci23.h26
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/pci30.h46
-rw-r--r--BaseTools/Source/C/Include/Protocol/GraphicsOutput.h195
-rw-r--r--BaseTools/Source/C/Include/Protocol/GuidedSectionExtraction.h153
-rw-r--r--BaseTools/Source/C/Include/Protocol/HiiFramework.h952
-rw-r--r--BaseTools/Source/C/Include/Protocol/UgaDraw.h169
-rw-r--r--BaseTools/Source/C/Include/X64/ProcessorBind.h196
-rw-r--r--BaseTools/Source/C/LzmaCompress/GNUmakefile31
-rw-r--r--BaseTools/Source/C/LzmaCompress/LZMA-SDK-README.txt3
-rw-r--r--BaseTools/Source/C/LzmaCompress/LzmaCompress.c382
-rw-r--r--BaseTools/Source/C/LzmaCompress/LzmaF86Compress.bat31
-rw-r--r--BaseTools/Source/C/LzmaCompress/Makefile41
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/7zFile.c263
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/7zFile.h74
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/7zStream.c169
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/7zVersion.h7
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/Alloc.c127
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/Alloc.h32
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/Bra.h60
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/Bra86.c85
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/CpuArch.h69
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/LzFind.c751
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/LzFind.h107
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/LzFindMt.c793
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/LzFindMt.h97
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/LzHash.h54
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c1007
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.h223
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c2296
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.h72
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/Threads.c109
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/Threads.h68
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/C/Types.h208
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/history.txt236
-rw-r--r--BaseTools/Source/C/LzmaCompress/Sdk/lzma.txt594
-rw-r--r--BaseTools/Source/C/Makefile74
-rw-r--r--BaseTools/Source/C/Makefiles/NmakeSubdirs.bat40
-rw-r--r--BaseTools/Source/C/Makefiles/app.makefile27
-rw-r--r--BaseTools/Source/C/Makefiles/footer.makefile34
-rw-r--r--BaseTools/Source/C/Makefiles/header.makefile72
-rw-r--r--BaseTools/Source/C/Makefiles/lib.makefile18
-rw-r--r--BaseTools/Source/C/Makefiles/ms.app34
-rw-r--r--BaseTools/Source/C/Makefiles/ms.common60
-rw-r--r--BaseTools/Source/C/Makefiles/ms.lib31
-rw-r--r--BaseTools/Source/C/Makefiles/ms.rule24
-rw-r--r--BaseTools/Source/C/PyEfiCompressor/EfiCompressor.c211
-rw-r--r--BaseTools/Source/C/PyEfiCompressor/Makefile23
-rw-r--r--BaseTools/Source/C/PyEfiCompressor/setup.py43
-rw-r--r--BaseTools/Source/C/PyUtility/Makefile23
-rw-r--r--BaseTools/Source/C/PyUtility/PyUtility.c105
-rw-r--r--BaseTools/Source/C/PyUtility/setup.py42
-rw-r--r--BaseTools/Source/C/Split/GNUmakefile24
-rw-r--r--BaseTools/Source/C/Split/Makefile22
-rw-r--r--BaseTools/Source/C/Split/Split.c446
-rw-r--r--BaseTools/Source/C/TianoCompress/GNUmakefile22
-rw-r--r--BaseTools/Source/C/TianoCompress/Makefile22
-rw-r--r--BaseTools/Source/C/TianoCompress/TianoCompress.c2718
-rw-r--r--BaseTools/Source/C/TianoCompress/TianoCompress.h439
-rw-r--r--BaseTools/Source/C/VfrCompile/EfiVfr.h58
-rw-r--r--BaseTools/Source/C/VfrCompile/GNUmakefile79
-rw-r--r--BaseTools/Source/C/VfrCompile/Makefile56
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_131.txt522
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_133.txt2448
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_133_BEFORE_MR13.txt3666
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/CHANGES_SUMMARY.txt2049
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/KNOWN_PROBLEMS.txt241
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/MPW_Read_Me21
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/Makefile15
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/NOTES.bcc184
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/NOTES.msvc189
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/README159
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/RIGHTS26
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak233
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak238
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrPPC.mak101
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/README19
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.1209
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.c3564
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.g2586
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.r787
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr1.txt264
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/bits.c1025
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c813
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c67
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpnode.c423
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/egman.c328
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/err.c538
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/fcache.c123
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/fset.c1555
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c2250
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c4797
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/generic.h286
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/globals.c484
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/hash.c221
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/hash.h73
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c878
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c1747
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile218
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile.cygwin219
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile196
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/misc.c1864
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/mode.h12
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c3030
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/parser.dlg1387
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/pred.c821
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/proto.h852
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/scan.c5735
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/stdpccts.h31
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/syn.h390
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/tokens.h246
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgDDK.mak121
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgMS.mak125
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgPPC.mak84
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/automata.c353
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.179
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.h250
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.r275
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg1.txt132
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_a.c1414
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c959
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.g614
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/err.c99
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/main.c281
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile156
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile.cygwin157
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile163
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/mode.h4
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/output.c850
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/parser.dlg398
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/relabel.c217
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/stdpccts.h26
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/support.c240
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/dlg/tokens.h133
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp871
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h376
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/ASTBase.cpp256
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/ASTBase.h122
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtr.h88
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtrImpl.h88
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h325
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/ATokenBuffer.cpp374
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/ATokenBuffer.h109
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/ATokenStream.h51
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/BufFileInput.cpp100
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/BufFileInput.h53
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/DLG_stream_input.h98
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h191
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.cpp302
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.h198
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/PBlackBox.h134
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.cpp684
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.h143
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/SList.h72
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/antlr.h807
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/ast.c345
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/ast.h121
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/charbuf.h46
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/charptr.c58
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/charptr.h48
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/config.h1
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/dlgauto.h504
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/dlgdef.h128
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/err.h1170
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/int.h37
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/pccts_assert.h10
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/pccts_iostream.h10
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/pccts_istream.h10
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/pccts_setjmp.h10
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdarg.h10
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdio.h10
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdlib.h10
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/pccts_string.h10
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/pcctscfg.h359
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/pcnames.bat11
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/h/slist.cpp116
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/history.ps473
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/history.txt186
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/makefile.old66
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk.c1063
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk_old.c762
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/genmk/makefile29
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/makefile19
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/rexpr.c586
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/rexpr.h30
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/test.c19
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/set/set.c816
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/set/set.h121
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/sym/sym.c402
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/support/sym/template.h41
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrCompiler.cpp838
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrCompiler.h113
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrError.cpp298
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrError.h101
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp1770
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrFormPkg.h2808
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrSyntax.g4928
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp3606
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrUtilityLib.h464
-rw-r--r--BaseTools/Source/C/VolInfo/GNUmakefile24
-rw-r--r--BaseTools/Source/C/VolInfo/Makefile22
-rw-r--r--BaseTools/Source/C/VolInfo/VolInfo.c1826
-rw-r--r--BaseTools/Source/C/VolInfo/VolInfo.h41
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py2916
-rw-r--r--BaseTools/Source/Python/AutoGen/BuildEngine.py627
-rw-r--r--BaseTools/Source/Python/AutoGen/GenC.py2127
-rw-r--r--BaseTools/Source/Python/AutoGen/GenDepex.py448
-rw-r--r--BaseTools/Source/Python/AutoGen/GenMake.py1411
-rw-r--r--BaseTools/Source/Python/AutoGen/StrGather.py655
-rw-r--r--BaseTools/Source/Python/AutoGen/UniClassObject.py612
-rw-r--r--BaseTools/Source/Python/AutoGen/__init__.py17
-rw-r--r--BaseTools/Source/Python/BPDG/BPDG.py159
-rw-r--r--BaseTools/Source/Python/BPDG/GenVpd.py662
-rw-r--r--BaseTools/Source/Python/BPDG/StringTable.py78
-rw-r--r--BaseTools/Source/Python/BPDG/__init__.py15
-rw-r--r--BaseTools/Source/Python/Common/BuildToolError.py154
-rw-r--r--BaseTools/Source/Python/Common/BuildVersion.py16
-rw-r--r--BaseTools/Source/Python/Common/DataType.py497
-rw-r--r--BaseTools/Source/Python/Common/Database.py120
-rw-r--r--BaseTools/Source/Python/Common/DecClassObject.py563
-rw-r--r--BaseTools/Source/Python/Common/Dictionary.py75
-rw-r--r--BaseTools/Source/Python/Common/DscClassObject.py1439
-rw-r--r--BaseTools/Source/Python/Common/EdkIIWorkspace.py318
-rw-r--r--BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py1670
-rw-r--r--BaseTools/Source/Python/Common/EdkLogger.py269
-rw-r--r--BaseTools/Source/Python/Common/Expression.py630
-rw-r--r--BaseTools/Source/Python/Common/FdfClassObject.py116
-rw-r--r--BaseTools/Source/Python/Common/FdfParserLite.py3665
-rw-r--r--BaseTools/Source/Python/Common/GlobalData.py52
-rw-r--r--BaseTools/Source/Python/Common/Identification.py58
-rw-r--r--BaseTools/Source/Python/Common/InfClassObject.py1115
-rw-r--r--BaseTools/Source/Python/Common/MigrationUtilities.py567
-rw-r--r--BaseTools/Source/Python/Common/Misc.py1690
-rw-r--r--BaseTools/Source/Python/Common/Parsing.py879
-rw-r--r--BaseTools/Source/Python/Common/PyUtility.pydbin6144 -> 0 bytes
-rw-r--r--BaseTools/Source/Python/Common/String.py856
-rw-r--r--BaseTools/Source/Python/Common/TargetTxtClassObject.py167
-rw-r--r--BaseTools/Source/Python/Common/ToolDefClassObject.py219
-rw-r--r--BaseTools/Source/Python/Common/VpdInfoFile.py256
-rw-r--r--BaseTools/Source/Python/Common/__init__.py15
-rw-r--r--BaseTools/Source/Python/CommonDataClass/CommonClass.py473
-rw-r--r--BaseTools/Source/Python/CommonDataClass/DataClass.py361
-rw-r--r--BaseTools/Source/Python/CommonDataClass/Exceptions.py29
-rw-r--r--BaseTools/Source/Python/CommonDataClass/FdfClass.py409
-rw-r--r--BaseTools/Source/Python/CommonDataClass/ModuleClass.py485
-rw-r--r--BaseTools/Source/Python/CommonDataClass/PackageClass.py127
-rw-r--r--BaseTools/Source/Python/CommonDataClass/PlatformClass.py432
-rw-r--r--BaseTools/Source/Python/CommonDataClass/__init__.py15
-rw-r--r--BaseTools/Source/Python/Ecc/C.g679
-rw-r--r--BaseTools/Source/Python/Ecc/CLexer.py4947
-rw-r--r--BaseTools/Source/Python/Ecc/CParser.py18844
-rw-r--r--BaseTools/Source/Python/Ecc/Check.py1090
-rw-r--r--BaseTools/Source/Python/Ecc/CodeFragment.py165
-rw-r--r--BaseTools/Source/Python/Ecc/CodeFragmentCollector.py624
-rw-r--r--BaseTools/Source/Python/Ecc/Configuration.py281
-rw-r--r--BaseTools/Source/Python/Ecc/Database.py345
-rw-r--r--BaseTools/Source/Python/Ecc/Ecc.py395
-rw-r--r--BaseTools/Source/Python/Ecc/EccGlobalData.py26
-rw-r--r--BaseTools/Source/Python/Ecc/EccToolError.py188
-rw-r--r--BaseTools/Source/Python/Ecc/Exception.py87
-rw-r--r--BaseTools/Source/Python/Ecc/FileProfile.py57
-rw-r--r--BaseTools/Source/Python/Ecc/MetaDataParser.py264
-rw-r--r--BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py218
-rw-r--r--BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py1852
-rw-r--r--BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py332
-rw-r--r--BaseTools/Source/Python/Ecc/MetaFileWorkspace/__init__.py15
-rw-r--r--BaseTools/Source/Python/Ecc/ParserWarning.py30
-rw-r--r--BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py228
-rw-r--r--BaseTools/Source/Python/Ecc/Xml/__init__.py20
-rw-r--r--BaseTools/Source/Python/Ecc/__init__.py15
-rw-r--r--BaseTools/Source/Python/Ecc/c.py2614
-rw-r--r--BaseTools/Source/Python/Ecc/config.ini257
-rw-r--r--BaseTools/Source/Python/Ecc/exception.xml319
-rw-r--r--BaseTools/Source/Python/Eot/CLexer.py4947
-rw-r--r--BaseTools/Source/Python/Eot/CParser.py18844
-rw-r--r--BaseTools/Source/Python/Eot/CodeFragment.py185
-rw-r--r--BaseTools/Source/Python/Eot/CodeFragmentCollector.py467
-rw-r--r--BaseTools/Source/Python/Eot/Database.py255
-rw-r--r--BaseTools/Source/Python/Eot/EfiCompressor.pydbin11264 -> 0 bytes
-rw-r--r--BaseTools/Source/Python/Eot/Eot.py648
-rw-r--r--BaseTools/Source/Python/Eot/EotGlobalData.py138
-rw-r--r--BaseTools/Source/Python/Eot/EotToolError.py21
-rw-r--r--BaseTools/Source/Python/Eot/FileProfile.py58
-rw-r--r--BaseTools/Source/Python/Eot/FvImage.py1453
-rw-r--r--BaseTools/Source/Python/Eot/InfParserLite.py171
-rw-r--r--BaseTools/Source/Python/Eot/LzmaCompressor.pydbin14848 -> 0 bytes
-rw-r--r--BaseTools/Source/Python/Eot/Parser.py848
-rw-r--r--BaseTools/Source/Python/Eot/ParserWarning.py26
-rw-r--r--BaseTools/Source/Python/Eot/Report.py472
-rw-r--r--BaseTools/Source/Python/Eot/__init__.py15
-rw-r--r--BaseTools/Source/Python/Eot/c.py387
-rw-r--r--BaseTools/Source/Python/GNUmakefile18
-rw-r--r--BaseTools/Source/Python/GenFds/AprioriSection.py118
-rw-r--r--BaseTools/Source/Python/GenFds/Attribute.py28
-rw-r--r--BaseTools/Source/Python/GenFds/Capsule.py104
-rw-r--r--BaseTools/Source/Python/GenFds/CapsuleData.py137
-rw-r--r--BaseTools/Source/Python/GenFds/ComponentStatement.py29
-rw-r--r--BaseTools/Source/Python/GenFds/CompressSection.py87
-rw-r--r--BaseTools/Source/Python/GenFds/DataSection.py118
-rw-r--r--BaseTools/Source/Python/GenFds/DepexSection.py112
-rw-r--r--BaseTools/Source/Python/GenFds/EfiSection.py274
-rw-r--r--BaseTools/Source/Python/GenFds/Fd.py199
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py4407
-rw-r--r--BaseTools/Source/Python/GenFds/Ffs.py80
-rw-r--r--BaseTools/Source/Python/GenFds/FfsFileStatement.py137
-rw-r--r--BaseTools/Source/Python/GenFds/FfsInfStatement.py917
-rw-r--r--BaseTools/Source/Python/GenFds/Fv.py358
-rw-r--r--BaseTools/Source/Python/GenFds/FvImageSection.py96
-rw-r--r--BaseTools/Source/Python/GenFds/GenFds.py538
-rw-r--r--BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py705
-rw-r--r--BaseTools/Source/Python/GenFds/GuidSection.py290
-rw-r--r--BaseTools/Source/Python/GenFds/OptRomFileStatement.py50
-rw-r--r--BaseTools/Source/Python/GenFds/OptRomInfStatement.py155
-rw-r--r--BaseTools/Source/Python/GenFds/OptionRom.py140
-rw-r--r--BaseTools/Source/Python/GenFds/Region.py354
-rw-r--r--BaseTools/Source/Python/GenFds/Rule.py29
-rw-r--r--BaseTools/Source/Python/GenFds/RuleComplexFile.py30
-rw-r--r--BaseTools/Source/Python/GenFds/RuleSimpleFile.py30
-rw-r--r--BaseTools/Source/Python/GenFds/Section.py152
-rw-r--r--BaseTools/Source/Python/GenFds/UiSection.py77
-rw-r--r--BaseTools/Source/Python/GenFds/VerSection.py82
-rw-r--r--BaseTools/Source/Python/GenFds/Vtf.py196
-rw-r--r--BaseTools/Source/Python/GenFds/__init__.py15
-rw-r--r--BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py190
-rw-r--r--BaseTools/Source/Python/GenPatchPcdTable/__init__.py15
-rw-r--r--BaseTools/Source/Python/Makefile108
-rw-r--r--BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py288
-rw-r--r--BaseTools/Source/Python/PatchPcdValue/__init__.py15
-rw-r--r--BaseTools/Source/Python/Table/Table.py120
-rw-r--r--BaseTools/Source/Python/Table/TableDataModel.py95
-rw-r--r--BaseTools/Source/Python/Table/TableDec.py108
-rw-r--r--BaseTools/Source/Python/Table/TableDsc.py108
-rw-r--r--BaseTools/Source/Python/Table/TableEotReport.py76
-rw-r--r--BaseTools/Source/Python/Table/TableFdf.py109
-rw-r--r--BaseTools/Source/Python/Table/TableFile.py104
-rw-r--r--BaseTools/Source/Python/Table/TableFunction.py95
-rw-r--r--BaseTools/Source/Python/Table/TableIdentifier.py90
-rw-r--r--BaseTools/Source/Python/Table/TableInf.py114
-rw-r--r--BaseTools/Source/Python/Table/TablePcd.py90
-rw-r--r--BaseTools/Source/Python/Table/TableQuery.py68
-rw-r--r--BaseTools/Source/Python/Table/TableReport.py124
-rw-r--r--BaseTools/Source/Python/Table/__init__.py15
-rw-r--r--BaseTools/Source/Python/TargetTool/TargetTool.py257
-rw-r--r--BaseTools/Source/Python/TargetTool/__init__.py15
-rw-r--r--BaseTools/Source/Python/Trim/Trim.py609
-rw-r--r--BaseTools/Source/Python/UPT/BuildVersion.py20
-rw-r--r--BaseTools/Source/Python/UPT/Core/DependencyRules.py293
-rw-r--r--BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py230
-rw-r--r--BaseTools/Source/Python/UPT/Core/IpiDb.py887
-rw-r--r--BaseTools/Source/Python/UPT/Core/PackageFile.py249
-rw-r--r--BaseTools/Source/Python/UPT/Core/__init__.py20
-rw-r--r--BaseTools/Source/Python/UPT/Dll/sqlite3.dllbin260096 -> 0 bytes
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py367
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py988
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py155
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py18
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/__init__.py20
-rw-r--r--BaseTools/Source/Python/UPT/InstallPkg.py770
-rw-r--r--BaseTools/Source/Python/UPT/Library/CommentGenerating.py217
-rw-r--r--BaseTools/Source/Python/UPT/Library/CommentParsing.py451
-rw-r--r--BaseTools/Source/Python/UPT/Library/DataType.py940
-rw-r--r--BaseTools/Source/Python/UPT/Library/ExpressionValidate.py489
-rw-r--r--BaseTools/Source/Python/UPT/Library/GlobalData.py99
-rw-r--r--BaseTools/Source/Python/UPT/Library/Misc.py974
-rw-r--r--BaseTools/Source/Python/UPT/Library/ParserValidate.py723
-rw-r--r--BaseTools/Source/Python/UPT/Library/Parsing.py993
-rw-r--r--BaseTools/Source/Python/UPT/Library/String.py939
-rw-r--r--BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py228
-rw-r--r--BaseTools/Source/Python/UPT/Library/Xml/__init__.py20
-rw-r--r--BaseTools/Source/Python/UPT/Library/__init__.py20
-rw-r--r--BaseTools/Source/Python/UPT/Logger/Log.py325
-rw-r--r--BaseTools/Source/Python/UPT/Logger/StringTable.py770
-rw-r--r--BaseTools/Source/Python/UPT/Logger/ToolError.py177
-rw-r--r--BaseTools/Source/Python/UPT/Logger/__init__.py20
-rw-r--r--BaseTools/Source/Python/UPT/Makefile41
-rw-r--r--BaseTools/Source/Python/UPT/MkPkg.py281
-rw-r--r--BaseTools/Source/Python/UPT/Object/POM/CommonObject.py789
-rw-r--r--BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py645
-rw-r--r--BaseTools/Source/Python/UPT/Object/POM/PackageObject.py190
-rw-r--r--BaseTools/Source/Python/UPT/Object/POM/__init__.py20
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/DecObject.py611
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py621
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfBuildOptionObject.py93
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py162
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfDefineCommonObject.py89
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py995
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py166
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py350
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py119
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.py252
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfMisc.py148
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py187
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py640
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py343
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py311
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py240
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py133
-rw-r--r--BaseTools/Source/Python/UPT/Object/Parser/__init__.py20
-rw-r--r--BaseTools/Source/Python/UPT/Object/__init__.py20
-rw-r--r--BaseTools/Source/Python/UPT/Parser/DecParser.py989
-rw-r--r--BaseTools/Source/Python/UPT/Parser/DecParserMisc.py371
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py300
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py217
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py218
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py197
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py104
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py382
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py210
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py140
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfParser.py630
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfParserMisc.py218
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfPcdSectionParser.py184
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfSectionParser.py490
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py145
-rw-r--r--BaseTools/Source/Python/UPT/Parser/__init__.py20
-rw-r--r--BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py607
-rw-r--r--BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py971
-rw-r--r--BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py221
-rw-r--r--BaseTools/Source/Python/UPT/PomAdapter/__init__.py20
-rw-r--r--BaseTools/Source/Python/UPT/RmPkg.py246
-rw-r--r--BaseTools/Source/Python/UPT/UPT.py239
-rw-r--r--BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py1419
-rw-r--r--BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py923
-rw-r--r--BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py284
-rw-r--r--BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py534
-rw-r--r--BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py386
-rw-r--r--BaseTools/Source/Python/UPT/Xml/CommonXml.py879
-rw-r--r--BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py284
-rw-r--r--BaseTools/Source/Python/UPT/Xml/IniToXml.py503
-rw-r--r--BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py997
-rw-r--r--BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py398
-rw-r--r--BaseTools/Source/Python/UPT/Xml/PcdXml.py403
-rw-r--r--BaseTools/Source/Python/UPT/Xml/XmlParser.py926
-rw-r--r--BaseTools/Source/Python/UPT/Xml/XmlParserMisc.py89
-rw-r--r--BaseTools/Source/Python/UPT/Xml/__init__.py20
-rw-r--r--BaseTools/Source/Python/Workspace/BuildClassObject.py366
-rw-r--r--BaseTools/Source/Python/Workspace/MetaDataTable.py338
-rw-r--r--BaseTools/Source/Python/Workspace/MetaFileParser.py1825
-rw-r--r--BaseTools/Source/Python/Workspace/MetaFileTable.py351
-rw-r--r--BaseTools/Source/Python/Workspace/WorkspaceCommon.py237
-rw-r--r--BaseTools/Source/Python/Workspace/WorkspaceDatabase.py2550
-rw-r--r--BaseTools/Source/Python/Workspace/__init__.py15
-rw-r--r--BaseTools/Source/Python/build/BuildReport.py1576
-rw-r--r--BaseTools/Source/Python/build/__init__.py15
-rw-r--r--BaseTools/Source/Python/build/build.py1906
-rw-r--r--BaseTools/Source/Python/sitecustomize.py19
-rw-r--r--BaseTools/Tests/CToolsTests.py35
-rw-r--r--BaseTools/Tests/CheckPythonSyntax.py74
-rw-r--r--BaseTools/Tests/GNUmakefile21
-rw-r--r--BaseTools/Tests/PythonToolsTests.py32
-rw-r--r--BaseTools/Tests/RunTests.py40
-rw-r--r--BaseTools/Tests/TestTools.py179
-rw-r--r--BaseTools/Tests/TianoCompress.py74
-rw-r--r--BaseTools/UserManuals/BootSectImage_Utility_Man_Page.rtf307
-rw-r--r--BaseTools/UserManuals/Build_Utility_Man_Page.rtf443
-rw-r--r--BaseTools/UserManuals/EfiLdrImage_Utility_Man_Page.rtf284
-rw-r--r--BaseTools/UserManuals/EfiRom_Utility_Man_Page.rtf272
-rw-r--r--BaseTools/UserManuals/Fpd2Dsc_Utility_Man_Page.rtf286
-rw-r--r--BaseTools/UserManuals/GenBootSector_Utility_Man_Page.rtf281
-rw-r--r--BaseTools/UserManuals/GenCrc32_Utility_Man_Page.rtf297
-rw-r--r--BaseTools/UserManuals/GenDepex_Utility_Man_Page.rtf327
-rw-r--r--BaseTools/UserManuals/GenFds_Utility_Man_Page.rtf413
-rw-r--r--BaseTools/UserManuals/GenFfs_Utility_Man_Page.rtf313
-rw-r--r--BaseTools/UserManuals/GenFv_Utility_Man_Page.rtf404
-rw-r--r--BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf359
-rw-r--r--BaseTools/UserManuals/GenPage_Utility_Man_Page.rtf107
-rw-r--r--BaseTools/UserManuals/GenPatchPcdTable_Utility_Man_Page.rtf254
-rw-r--r--BaseTools/UserManuals/GenSec_Utility_Man_Page.rtf382
-rw-r--r--BaseTools/UserManuals/GenVtf_Utility_Man_Page.rtf308
-rw-r--r--BaseTools/UserManuals/Intel_UEFI_Packaging_Tool_Man_Page.rtf558
-rw-r--r--BaseTools/UserManuals/LzmaCompress_Utility_Man_Page.rtf357
-rw-r--r--BaseTools/UserManuals/Msa2Inf_Utility_Man_Page.rtf274
-rw-r--r--BaseTools/UserManuals/PatchPcdValue_Utility_Man_Page.rtfbin5104 -> 0 bytes
-rw-r--r--BaseTools/UserManuals/Spd2Dec_Utility_Man_Page.rtf270
-rw-r--r--BaseTools/UserManuals/SplitFile_Utility_Man_Page.rtf318
-rw-r--r--BaseTools/UserManuals/TargetTool_Utility_Man_Page.rtf322
-rw-r--r--BaseTools/UserManuals/TianoCompress_Utility_Man_Page.rtf295
-rw-r--r--BaseTools/UserManuals/Trim_Utility_Man_Page.rtf343
-rw-r--r--BaseTools/UserManuals/UtilityManPage_template.rtfbin2626 -> 0 bytes
-rw-r--r--BaseTools/UserManuals/VfrCompiler_Utility_Man_Page.rtf326
-rw-r--r--BaseTools/UserManuals/VolInfo_Utility_Man_Page.rtf287
-rw-r--r--BaseTools/building-gcc.txt15
-rw-r--r--BaseTools/gcc/README.txt71
-rwxr-xr-xBaseTools/gcc/mingw-gcc-build.py564
-rwxr-xr-xBaseTools/toolsetup.bat374
-rw-r--r--ShellBinPkg/MinUefiShell/Ia32/Shell.efibin305184 -> 0 bytes
-rw-r--r--ShellBinPkg/MinUefiShell/Ia32/profiles.txt1
-rw-r--r--ShellBinPkg/MinUefiShell/MinUefiShell.inf29
-rw-r--r--ShellBinPkg/MinUefiShell/X64/Shell.efibin344512 -> 0 bytes
-rw-r--r--ShellBinPkg/MinUefiShell/X64/profiles.txt1
-rw-r--r--ShellBinPkg/ReadMe.txt45
-rw-r--r--ShellBinPkg/ShellBinPkg.dec21
-rw-r--r--ShellBinPkg/UefiShell/Ia32/Shell.efibin760992 -> 0 bytes
-rw-r--r--ShellBinPkg/UefiShell/Ia32/profiles.txt6
-rw-r--r--ShellBinPkg/UefiShell/UefiShell.inf29
-rw-r--r--ShellBinPkg/UefiShell/X64/Shell.efibin847232 -> 0 bytes
-rw-r--r--ShellBinPkg/UefiShell/X64/profiles.txt6
-rw-r--r--ShellPkg/Application/Shell/ConsoleLogger.c1197
-rw-r--r--ShellPkg/Application/Shell/ConsoleLogger.h341
-rw-r--r--ShellPkg/Application/Shell/ConsoleWrappers.c477
-rw-r--r--ShellPkg/Application/Shell/ConsoleWrappers.h81
-rw-r--r--ShellPkg/Application/Shell/FileHandleInternal.h68
-rw-r--r--ShellPkg/Application/Shell/FileHandleWrappers.c1798
-rw-r--r--ShellPkg/Application/Shell/FileHandleWrappers.h95
-rw-r--r--ShellPkg/Application/Shell/Shell.c1945
-rw-r--r--ShellPkg/Application/Shell/Shell.h303
-rw-r--r--ShellPkg/Application/Shell/Shell.inf109
-rw-r--r--ShellPkg/Application/Shell/Shell.unibin4612 -> 0 bytes
-rw-r--r--ShellPkg/Application/Shell/ShellEnvVar.c347
-rw-r--r--ShellPkg/Application/Shell/ShellEnvVar.h210
-rw-r--r--ShellPkg/Application/Shell/ShellManParser.c644
-rw-r--r--ShellPkg/Application/Shell/ShellManParser.h86
-rw-r--r--ShellPkg/Application/Shell/ShellParametersProtocol.c1284
-rw-r--r--ShellPkg/Application/Shell/ShellParametersProtocol.h223
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.c3416
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.h976
-rw-r--r--ShellPkg/Application/ShellCTestApp/ShellCTestApp.c50
-rw-r--r--ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf39
-rw-r--r--ShellPkg/Application/ShellExecTestApp/SA.c38
-rw-r--r--ShellPkg/Application/ShellExecTestApp/SA.inf41
-rw-r--r--ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c83
-rw-r--r--ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf41
-rw-r--r--ShellPkg/Include/Guid/ShellAliasGuid.h25
-rw-r--r--ShellPkg/Include/Guid/ShellEnvironment2Ext.h25
-rw-r--r--ShellPkg/Include/Guid/ShellLibHiiGuid.h67
-rw-r--r--ShellPkg/Include/Guid/ShellMapGuid.h25
-rw-r--r--ShellPkg/Include/Guid/ShellPkgTokenSpace.h25
-rw-r--r--ShellPkg/Include/Guid/ShellVariableGuid.h25
-rw-r--r--ShellPkg/Include/Library/FileHandleLib.h498
-rw-r--r--ShellPkg/Include/Library/HandleParsingLib.h343
-rw-r--r--ShellPkg/Include/Library/PathLib.h56
-rw-r--r--ShellPkg/Include/Library/ShellCEntryLib.h40
-rw-r--r--ShellPkg/Include/Library/ShellCommandLib.h676
-rw-r--r--ShellPkg/Include/Library/ShellLib.h1331
-rw-r--r--ShellPkg/Include/Library/SortLib.h114
-rw-r--r--ShellPkg/Include/Protocol/EfiShell.h1005
-rw-r--r--ShellPkg/Include/Protocol/EfiShellEnvironment2.h975
-rw-r--r--ShellPkg/Include/Protocol/EfiShellInterface.h94
-rw-r--r--ShellPkg/Include/Protocol/EfiShellParameters.h60
-rw-r--r--ShellPkg/Include/ShellBase.h157
-rw-r--r--ShellPkg/Library/BasePathLib/BasePathLib.c122
-rw-r--r--ShellPkg/Library/BasePathLib/BasePathLib.inf38
-rw-r--r--ShellPkg/Library/BaseSortLib/BaseSortLib.c239
-rw-r--r--ShellPkg/Library/BaseSortLib/BaseSortLib.inf41
-rw-r--r--ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c1165
-rw-r--r--ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf50
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c1721
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h172
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf190
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.unibin24050 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c99
-rw-r--r--ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf44
-rw-r--r--ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c1393
-rw-r--r--ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c1327
-rw-r--r--ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.h68
-rw-r--r--ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf60
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c1431
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c265
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c1416
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h40
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c200
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c227
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c260
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c161
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c3358
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h263
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c1935
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.h77
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.c92
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.h52
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.unibin11484 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditor.h32
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditorTypes.h102
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c330
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.h91
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c196
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h125
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c236
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h109
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c206
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.h77
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c157
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c175
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c2507
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h277
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c112
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h69
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c433
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h95
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c403
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h83
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c282
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditor.h41
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h126
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.unibin13022 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c2323
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h76
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c351
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h92
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c262
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h93
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c469
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c265
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c628
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c127
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c4709
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h462
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c363
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c109
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c259
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c412
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h117
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c224
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h108
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c3109
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h411
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c4377
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h782
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c543
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h89
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.unibin96884 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c651
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h436
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf136
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.unibin152932 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c378
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c267
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c255
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c996
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c188
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c291
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c1395
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c487
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/OpenInfo.c216
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Reconnect.c42
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.c104
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h206
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf73
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.unibin69948 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c213
-rw-r--r--ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c1431
-rw-r--r--ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c89
-rw-r--r--ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h59
-rw-r--r--ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf53
-rw-r--r--ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.unibin15858 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/Exit.c96
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/For.c732
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c104
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/If.c1104
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/Shift.c63
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/Stall.c83
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c305
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h211
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf59
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.unibin38174 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c271
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c242
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c661
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c282
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c595
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c1279
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c128
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c570
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c207
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c131
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c349
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c169
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c865
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c309
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h317
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf85
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.unibin111482 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c310
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c165
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c135
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c120
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c101
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c188
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c105
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c289
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c252
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c98
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h162
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf69
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.unibin42500 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c145
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c4059
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.h76
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.inf69
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c1762
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c1579
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.c90
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h81
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf67
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.unibin18172 -> 0 bytes
-rw-r--r--ShellPkg/Library/UefiSortLib/UefiSortLib.c316
-rw-r--r--ShellPkg/Library/UefiSortLib/UefiSortLib.inf46
-rw-r--r--ShellPkg/Readme.txt29
-rw-r--r--ShellPkg/ShellPkg.dec121
-rw-r--r--ShellPkg/ShellPkg.dsc88
931 files changed, 0 insertions, 405739 deletions
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/BootSectImage b/BaseTools/Bin/CYGWIN_NT-5.1-i686/BootSectImage
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/BootSectImage
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/BuildEnv b/BaseTools/Bin/CYGWIN_NT-5.1-i686/BuildEnv
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/BuildEnv
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc b/BaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/Ecc
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/EfiLdrImage b/BaseTools/Bin/CYGWIN_NT-5.1-i686/EfiLdrImage
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/EfiLdrImage
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/EfiRom b/BaseTools/Bin/CYGWIN_NT-5.1-i686/EfiRom
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/EfiRom
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenCrc32 b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenCrc32
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenCrc32
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenDepex b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenDepex
deleted file mode 100755
index bd3141a758..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenDepex
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env bash
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/AutoGen/`basename $0`.py $*
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFds b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFds
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFds
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFfs b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFfs
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFfs
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFv b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFv
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFv
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFw b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFw
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenFw
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenPage b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenPage
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenPage
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenSec b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenSec
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenSec
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenVtf b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenVtf
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GenVtf
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GnuGenBootSector b/BaseTools/Bin/CYGWIN_NT-5.1-i686/GnuGenBootSector
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/GnuGenBootSector
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaCompress b/BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaCompress
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaCompress
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaF86Compress b/BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaF86Compress
deleted file mode 100755
index c3e49cf29d..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/LzmaF86Compress
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env bash
-#
-# This script will exec LzmaCompress tool with --f86 option that enables converter for x86 code.
-#
-# Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-for arg in $*; do
- if [ "arg" = "-e" -o "arg" = "-d" ]; then
- FLAG=--f86
- break;
- fi
-done
-
-LzmaCompress $* $FLAG
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/RunBinToolFromBuildDir b/BaseTools/Bin/CYGWIN_NT-5.1-i686/RunBinToolFromBuildDir
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/RunBinToolFromBuildDir
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/RunToolFromSource b/BaseTools/Bin/CYGWIN_NT-5.1-i686/RunToolFromSource
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/RunToolFromSource
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/Split b/BaseTools/Bin/CYGWIN_NT-5.1-i686/Split
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/Split
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/TargetTool b/BaseTools/Bin/CYGWIN_NT-5.1-i686/TargetTool
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/TargetTool
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/TianoCompress b/BaseTools/Bin/CYGWIN_NT-5.1-i686/TianoCompress
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/TianoCompress
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/Trim b/BaseTools/Bin/CYGWIN_NT-5.1-i686/Trim
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/Trim
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/VfrCompile b/BaseTools/Bin/CYGWIN_NT-5.1-i686/VfrCompile
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/VfrCompile
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/VolInfo b/BaseTools/Bin/CYGWIN_NT-5.1-i686/VolInfo
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/VolInfo
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py b/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
deleted file mode 100755
index 69fd2d5441..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-#
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-#
-# ARMCC tools do not support cygwin paths. Ths script converts cygwin paths to DOS paths
-# in any arguments.
-#
-# armcc_wrapper.py ToolToExec [command line to convert]
-#
-# anthing with the / will be converted via cygpath cygwin call or manually.
-# -I/cygpath/c/example is a special case as you can not pass -I to cygpath
-#
-# ExceptionList if a tool takes an argument with a / add it to the exception list
-#
-import sys
-import os
-import subprocess
-import pipes
-
-#
-# Convert using cygpath command line tool
-# Currently not used, but just in case we need it in the future
-#
-def ConvertCygPathToDosViacygpath(CygPath):
- p = subprocess.Popen("cygpath -m " + pipes.quote(CygPath), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
- return p.stdout.read().strip()
-
-#
-#
-#
-def ConvertCygPathToDos(CygPath):
- if CygPath.find("/cygdrive/") == 0:
- # convert /cygdrive/c/Xyz to c:/Xyz
- DosPath = CygPath[10] + ':' + CygPath[11:]
- else:
- DosPath = CygPath
-
- # pipes.quote will add the extra \\ for us.
- return DosPath.replace('/','\\')
-
-
-# we receive our options as a list, but we will be passing them to the shell as a line
-# this means we have to requote things as they will get one round of unquoting.
-# we can't set "shell=False" because we are running commands from the PATH and
-# if you don't use the shell you don't get a PATH search.
-def main(argv):
-
- # use 1st argument as name of tool to call
- Command = pipes.quote(sys.argv[1]);
-
- ExceptionList = ["/interwork"]
-
- for arg in argv:
- if arg.find('/') == -1:
- # if we don't need to convert just add to the command line
- Command = Command + ' ' + pipes.quote(arg)
- elif arg in ExceptionList:
- # if it is in the list, then don't do a cygpath
- # assembler stuff after --apcs has the /.
- Command = Command + ' ' + pipes.quote(arg)
- else:
- if ((arg[0] == '-') and (arg[1] == 'I' or arg[1] == 'i')):
- CygPath = arg[0] + arg[1] + ConvertCygPathToDos(arg[2:])
- else:
- CygPath = ConvertCygPathToDos(arg)
-
- Command = Command + ' ' + pipes.quote(CygPath)
-
- # call the real tool with the converted paths
- return subprocess.call(Command, shell=True)
-
-
-if __name__ == "__main__":
- try:
- ret = main(sys.argv[2:])
-
- except:
- print "exiting: exception from " + sys.argv[0]
- ret = 2
-
- sys.exit(ret)
-
diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/build b/BaseTools/Bin/CYGWIN_NT-5.1-i686/build
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/build
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE31/CompilerIntrinsicsLib.lib b/BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE31/CompilerIntrinsicsLib.lib
deleted file mode 100644
index 79964fe1b6..0000000000
--- a/BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE31/CompilerIntrinsicsLib.lib
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE32/CompilerIntrinsicsLib.lib b/BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE32/CompilerIntrinsicsLib.lib
deleted file mode 100644
index 79964fe1b6..0000000000
--- a/BaseTools/Bin/Darwin-i386/Arm/DEBUG_XCODE32/CompilerIntrinsicsLib.lib
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Darwin-i386/Arm/RELEASE_XCODE31/CompilerIntrinsicsLib.lib b/BaseTools/Bin/Darwin-i386/Arm/RELEASE_XCODE31/CompilerIntrinsicsLib.lib
deleted file mode 100644
index c82c915b8e..0000000000
--- a/BaseTools/Bin/Darwin-i386/Arm/RELEASE_XCODE31/CompilerIntrinsicsLib.lib
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Darwin-i386/Arm/RELEASE_XCODE32/CompilerIntrinsicsLib.lib b/BaseTools/Bin/Darwin-i386/Arm/RELEASE_XCODE32/CompilerIntrinsicsLib.lib
deleted file mode 100644
index c82c915b8e..0000000000
--- a/BaseTools/Bin/Darwin-i386/Arm/RELEASE_XCODE32/CompilerIntrinsicsLib.lib
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/Arm/DEBUG_RVCT31/CompilerIntrinsicsLib.lib b/BaseTools/Bin/Win32/Arm/DEBUG_RVCT31/CompilerIntrinsicsLib.lib
deleted file mode 100644
index 90dd1193b7..0000000000
--- a/BaseTools/Bin/Win32/Arm/DEBUG_RVCT31/CompilerIntrinsicsLib.lib
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/Arm/RELEASE_RVCT31/CompilerIntrinsicsLib.lib b/BaseTools/Bin/Win32/Arm/RELEASE_RVCT31/CompilerIntrinsicsLib.lib
deleted file mode 100644
index fbce5c0e70..0000000000
--- a/BaseTools/Bin/Win32/Arm/RELEASE_RVCT31/CompilerIntrinsicsLib.lib
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/BPDG.exe b/BaseTools/Bin/Win32/BPDG.exe
deleted file mode 100644
index 09137b6037..0000000000
--- a/BaseTools/Bin/Win32/BPDG.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/BootSectImage.exe b/BaseTools/Bin/Win32/BootSectImage.exe
deleted file mode 100755
index a37e779ae7..0000000000
--- a/BaseTools/Bin/Win32/BootSectImage.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/Common.PyUtility.pyd b/BaseTools/Bin/Win32/Common.PyUtility.pyd
deleted file mode 100644
index 856b508e4e..0000000000
--- a/BaseTools/Bin/Win32/Common.PyUtility.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/EfiCompressor.pyd b/BaseTools/Bin/Win32/EfiCompressor.pyd
deleted file mode 100755
index 9de9beb402..0000000000
--- a/BaseTools/Bin/Win32/EfiCompressor.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/EfiLdrImage.exe b/BaseTools/Bin/Win32/EfiLdrImage.exe
deleted file mode 100755
index 29db3e2f41..0000000000
--- a/BaseTools/Bin/Win32/EfiLdrImage.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/EfiRom.exe b/BaseTools/Bin/Win32/EfiRom.exe
deleted file mode 100755
index 6aefa0d41a..0000000000
--- a/BaseTools/Bin/Win32/EfiRom.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/Eot.EfiCompressor.pyd b/BaseTools/Bin/Win32/Eot.EfiCompressor.pyd
deleted file mode 100644
index 9de9beb402..0000000000
--- a/BaseTools/Bin/Win32/Eot.EfiCompressor.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/Eot.LzmaCompressor.pyd b/BaseTools/Bin/Win32/Eot.LzmaCompressor.pyd
deleted file mode 100644
index 337c055e20..0000000000
--- a/BaseTools/Bin/Win32/Eot.LzmaCompressor.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenBootSector.exe b/BaseTools/Bin/Win32/GenBootSector.exe
deleted file mode 100755
index 8bb35ac835..0000000000
--- a/BaseTools/Bin/Win32/GenBootSector.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenCrc32.exe b/BaseTools/Bin/Win32/GenCrc32.exe
deleted file mode 100755
index a6009cd72a..0000000000
--- a/BaseTools/Bin/Win32/GenCrc32.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenDepex.exe b/BaseTools/Bin/Win32/GenDepex.exe
deleted file mode 100755
index 3d05e76136..0000000000
--- a/BaseTools/Bin/Win32/GenDepex.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenFds.exe b/BaseTools/Bin/Win32/GenFds.exe
deleted file mode 100755
index 9bc45a846a..0000000000
--- a/BaseTools/Bin/Win32/GenFds.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenFfs.exe b/BaseTools/Bin/Win32/GenFfs.exe
deleted file mode 100755
index 632f7f3bb3..0000000000
--- a/BaseTools/Bin/Win32/GenFfs.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenFv.exe b/BaseTools/Bin/Win32/GenFv.exe
deleted file mode 100755
index b87331335e..0000000000
--- a/BaseTools/Bin/Win32/GenFv.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenFw.exe b/BaseTools/Bin/Win32/GenFw.exe
deleted file mode 100755
index d47991f919..0000000000
--- a/BaseTools/Bin/Win32/GenFw.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenPage.exe b/BaseTools/Bin/Win32/GenPage.exe
deleted file mode 100755
index 50806487c9..0000000000
--- a/BaseTools/Bin/Win32/GenPage.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenPatchPcdTable.exe b/BaseTools/Bin/Win32/GenPatchPcdTable.exe
deleted file mode 100755
index a3ce036d43..0000000000
--- a/BaseTools/Bin/Win32/GenPatchPcdTable.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenSec.exe b/BaseTools/Bin/Win32/GenSec.exe
deleted file mode 100755
index a79833599d..0000000000
--- a/BaseTools/Bin/Win32/GenSec.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenVtf.exe b/BaseTools/Bin/Win32/GenVtf.exe
deleted file mode 100755
index a248c31f7a..0000000000
--- a/BaseTools/Bin/Win32/GenVtf.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/ImportTool.bat b/BaseTools/Bin/Win32/ImportTool.bat
deleted file mode 100755
index d896216c4c..0000000000
--- a/BaseTools/Bin/Win32/ImportTool.bat
+++ /dev/null
@@ -1,53 +0,0 @@
-@REM
-@REM Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-@REM This program and the accompanying materials
-@REM are licensed and made available under the terms and conditions of the BSD License
-@REM which accompanies this distribution. The full text of the license may be found at
-@REM http://opensource.org/licenses/bsd-license.php
-@REM
-@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-@REM
-
-@echo off
-@if /I "%1"=="-h" goto Usage
-@if /I "%1"=="-help" goto Usage
-@if /I "%1"=="--help" goto Usage
-@if /I "%1"=="/h" goto Usage
-@if /I "%1"=="/help" goto Usage
-@if /I "%1"=="/?" goto Usage
-
-set IMPORT_TOOL=%~dp0Trim.exe
-if NOT exist %IMPORT_TOOL% (
- echo.
- echo !!! Trim.exe was not found. Please make sure that it is in the same directory as this script!
- echo.
- goto End
-)
-
-if '%*'=='' (
- set FILE_LIST=*.c
-) else (
- set FILE_LIST=%*
-)
-
-for /r %%i in (%FILE_LIST%) do (
- echo Converting ... %%i
- %IMPORT_TOOL% -8 -o %%i %%i
-)
-goto End
-
-:Usage
- echo.
- echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [files]"
- echo.
- echo files File list or file pattern with wildcard, like "*.c *.h",
- echo seperated by space. If not specified, defaul to *.c.
-echo.
-
-:End
-set FILE_LIST=
-set IMPORT_TOOL=
-
-@echo on
-
diff --git a/BaseTools/Bin/Win32/LzmaCompress.exe b/BaseTools/Bin/Win32/LzmaCompress.exe
deleted file mode 100755
index 456d673268..0000000000
--- a/BaseTools/Bin/Win32/LzmaCompress.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/LzmaF86Compress.bat b/BaseTools/Bin/Win32/LzmaF86Compress.bat
deleted file mode 100644
index 215472163d..0000000000
--- a/BaseTools/Bin/Win32/LzmaF86Compress.bat
+++ /dev/null
@@ -1,29 +0,0 @@
-@REM
-@REM Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
-@REM This program and the accompanying materials
-@REM are licensed and made available under the terms and conditions of the BSD License
-@REM which accompanies this distribution. The full text of the license may be found at
-@REM http://opensource.org/licenses/bsd-license.php
-@REM
-@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-@REM
-
-@echo off
-@setlocal
-
-:Begin
-if "%1"=="" goto End
-if "%1"=="-e" (
- set FLAG=--f86
-)
-if "%1"=="-d" (
- set FLAG=--f86
-)
-set ARGS=%ARGS% %1
-shift
-goto Begin
-
-:End
-LzmaCompress %ARGS% %FLAG%
-@echo on \ No newline at end of file
diff --git a/BaseTools/Bin/Win32/PatchPcdValue.exe b/BaseTools/Bin/Win32/PatchPcdValue.exe
deleted file mode 100755
index 48b24e22cb..0000000000
--- a/BaseTools/Bin/Win32/PatchPcdValue.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/Split.exe b/BaseTools/Bin/Win32/Split.exe
deleted file mode 100755
index 00000ac739..0000000000
--- a/BaseTools/Bin/Win32/Split.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/TargetTool.exe b/BaseTools/Bin/Win32/TargetTool.exe
deleted file mode 100755
index bdaaf07260..0000000000
--- a/BaseTools/Bin/Win32/TargetTool.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/TianoCompress.exe b/BaseTools/Bin/Win32/TianoCompress.exe
deleted file mode 100755
index a65ba046b5..0000000000
--- a/BaseTools/Bin/Win32/TianoCompress.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/Trim.exe b/BaseTools/Bin/Win32/Trim.exe
deleted file mode 100755
index 44edbab30d..0000000000
--- a/BaseTools/Bin/Win32/Trim.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/UPT.exe b/BaseTools/Bin/Win32/UPT.exe
deleted file mode 100644
index a7060c7447..0000000000
--- a/BaseTools/Bin/Win32/UPT.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/VfrCompile.exe b/BaseTools/Bin/Win32/VfrCompile.exe
deleted file mode 100755
index 20e1b43c93..0000000000
--- a/BaseTools/Bin/Win32/VfrCompile.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/VolInfo.exe b/BaseTools/Bin/Win32/VolInfo.exe
deleted file mode 100755
index 593784de3a..0000000000
--- a/BaseTools/Bin/Win32/VolInfo.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/_ctypes.pyd b/BaseTools/Bin/Win32/_ctypes.pyd
deleted file mode 100644
index ae456be806..0000000000
--- a/BaseTools/Bin/Win32/_ctypes.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/_hashlib.pyd b/BaseTools/Bin/Win32/_hashlib.pyd
deleted file mode 100755
index 5efea4ac73..0000000000
--- a/BaseTools/Bin/Win32/_hashlib.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/_socket.pyd b/BaseTools/Bin/Win32/_socket.pyd
deleted file mode 100755
index b4b3b1fe60..0000000000
--- a/BaseTools/Bin/Win32/_socket.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/_sqlite3.pyd b/BaseTools/Bin/Win32/_sqlite3.pyd
deleted file mode 100755
index b86f5527a4..0000000000
--- a/BaseTools/Bin/Win32/_sqlite3.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/_ssl.pyd b/BaseTools/Bin/Win32/_ssl.pyd
deleted file mode 100755
index c054f240d6..0000000000
--- a/BaseTools/Bin/Win32/_ssl.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/build.exe b/BaseTools/Bin/Win32/build.exe
deleted file mode 100755
index 2b74c9948f..0000000000
--- a/BaseTools/Bin/Win32/build.exe
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/msvcr71.dll b/BaseTools/Bin/Win32/msvcr71.dll
deleted file mode 100644
index 9d9e0286c4..0000000000
--- a/BaseTools/Bin/Win32/msvcr71.dll
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/pyexpat.pyd b/BaseTools/Bin/Win32/pyexpat.pyd
deleted file mode 100755
index 03c607001c..0000000000
--- a/BaseTools/Bin/Win32/pyexpat.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/python27.dll b/BaseTools/Bin/Win32/python27.dll
deleted file mode 100644
index 436f8d2033..0000000000
--- a/BaseTools/Bin/Win32/python27.dll
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/select.pyd b/BaseTools/Bin/Win32/select.pyd
deleted file mode 100755
index e1b0ec2c49..0000000000
--- a/BaseTools/Bin/Win32/select.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Bin/Win32/sqlite3.dll b/BaseTools/Bin/Win32/sqlite3.dll
deleted file mode 100755
index 189ca345cd..0000000000
--- a/BaseTools/Bin/Win32/sqlite3.dll
+++ /dev/null
Binary files differ
diff --git a/BaseTools/BinWrappers/PosixLike/BPDG b/BaseTools/BinWrappers/PosixLike/BPDG
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/BinWrappers/PosixLike/BPDG
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/BinWrappers/PosixLike/BootSectImage b/BaseTools/BinWrappers/PosixLike/BootSectImage
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/BootSectImage
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/Ecc b/BaseTools/BinWrappers/PosixLike/Ecc
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/BinWrappers/PosixLike/Ecc
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/BinWrappers/PosixLike/EfiLdrImage b/BaseTools/BinWrappers/PosixLike/EfiLdrImage
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/EfiLdrImage
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/EfiRom b/BaseTools/BinWrappers/PosixLike/EfiRom
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/EfiRom
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/GenCrc32 b/BaseTools/BinWrappers/PosixLike/GenCrc32
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GenCrc32
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/GenDepex b/BaseTools/BinWrappers/PosixLike/GenDepex
deleted file mode 100755
index bd3141a758..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GenDepex
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env bash
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/AutoGen/`basename $0`.py $*
diff --git a/BaseTools/BinWrappers/PosixLike/GenFds b/BaseTools/BinWrappers/PosixLike/GenFds
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GenFds
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/BinWrappers/PosixLike/GenFfs b/BaseTools/BinWrappers/PosixLike/GenFfs
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GenFfs
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/GenFv b/BaseTools/BinWrappers/PosixLike/GenFv
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GenFv
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/GenFw b/BaseTools/BinWrappers/PosixLike/GenFw
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GenFw
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/GenPage b/BaseTools/BinWrappers/PosixLike/GenPage
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GenPage
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable b/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/BinWrappers/PosixLike/GenSec b/BaseTools/BinWrappers/PosixLike/GenSec
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GenSec
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/GenVtf b/BaseTools/BinWrappers/PosixLike/GenVtf
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GenVtf
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/GnuGenBootSector b/BaseTools/BinWrappers/PosixLike/GnuGenBootSector
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/GnuGenBootSector
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/LzmaCompress b/BaseTools/BinWrappers/PosixLike/LzmaCompress
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/LzmaCompress
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/LzmaF86Compress b/BaseTools/BinWrappers/PosixLike/LzmaF86Compress
deleted file mode 100755
index c3e49cf29d..0000000000
--- a/BaseTools/BinWrappers/PosixLike/LzmaF86Compress
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env bash
-#
-# This script will exec LzmaCompress tool with --f86 option that enables converter for x86 code.
-#
-# Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-for arg in $*; do
- if [ "arg" = "-e" -o "arg" = "-d" ]; then
- FLAG=--f86
- break;
- fi
-done
-
-LzmaCompress $* $FLAG
diff --git a/BaseTools/BinWrappers/PosixLike/PatchPcdValue b/BaseTools/BinWrappers/PosixLike/PatchPcdValue
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/BinWrappers/PosixLike/PatchPcdValue
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/BinWrappers/PosixLike/Split b/BaseTools/BinWrappers/PosixLike/Split
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/Split
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/TargetTool b/BaseTools/BinWrappers/PosixLike/TargetTool
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/BinWrappers/PosixLike/TargetTool
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/BinWrappers/PosixLike/TianoCompress b/BaseTools/BinWrappers/PosixLike/TianoCompress
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/TianoCompress
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/Trim b/BaseTools/BinWrappers/PosixLike/Trim
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/BinWrappers/PosixLike/Trim
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/BinWrappers/PosixLike/UPT b/BaseTools/BinWrappers/PosixLike/UPT
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/BinWrappers/PosixLike/UPT
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/BinWrappers/PosixLike/VfrCompile b/BaseTools/BinWrappers/PosixLike/VfrCompile
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/VfrCompile
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/VolInfo b/BaseTools/BinWrappers/PosixLike/VolInfo
deleted file mode 100755
index 4821d24fa7..0000000000
--- a/BaseTools/BinWrappers/PosixLike/VolInfo
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-#exec `dirname $0`/../../../../C/bin/`basename $0` $*
-
-TOOL_BASENAME=`basename $0`
-
-if [ -n "$WORKSPACE" -a -e $WORKSPACE/Conf/BaseToolsCBinaries ]
-then
- exec $WORKSPACE/Conf/BaseToolsCBinaries/$TOOL_BASENAME
-elif [ -n "$WORKSPACE" -a -e $EDK_TOOLS_PATH/Source/C ]
-then
- if [ ! -e $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME ]
- then
- echo BaseTools C Tool binary was not found \($TOOL_BASENAME\)
- echo You may need to run:
- echo " make -C $EDK_TOOLS_PATH/Source/C"
- else
- exec $EDK_TOOLS_PATH/Source/C/bin/$TOOL_BASENAME $*
- fi
-elif [ -e `dirname $0`/../../Source/C/bin/$TOOL_BASENAME ]
-then
- exec `dirname $0`/../../Source/C/bin/$TOOL_BASENAME $*
-else
- echo Unable to find the real \'$TOOL_BASENAME\' to run
- echo This message was printed by
- echo " $0"
- exit -1
-fi
-
diff --git a/BaseTools/BinWrappers/PosixLike/build b/BaseTools/BinWrappers/PosixLike/build
deleted file mode 100755
index 2cb8b86a99..0000000000
--- a/BaseTools/BinWrappers/PosixLike/build
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-#python `dirname $0`/RunToolFromSource.py `basename $0` $*
-PYTHONPATH="`dirname $0`/../../Source/Python" \
- python "`dirname $0`/../../Source/Python"/`basename $0`/`basename $0`.py $*
-
diff --git a/BaseTools/BuildEnv b/BaseTools/BuildEnv
deleted file mode 100755
index 79f916a9d5..0000000000
--- a/BaseTools/BuildEnv
+++ /dev/null
@@ -1,251 +0,0 @@
-#
-# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-#
-# Setup the environment for unix-like systems running a bash-like shell.
-# This file must be "sourced" not merely executed. For example: ". edksetup.sh"
-#
-
-SetWorkspace() {
-
- #
- # If WORKSPACE is already set, then we can return right now
- #
- if [ -n "$WORKSPACE" ]
- then
- return 0
- fi
-
- if [ ! ${BASH_SOURCE[0]} -ef ./BaseTools/BuildEnv ]
- then
- echo Run this script from the base of your tree. For example:
- echo " cd /Path/To/Edk/Root"
- echo " . BaseTools/BuildEnv"
- return 1
- fi
-
- #
- # Set $WORKSPACE
- #
- export WORKSPACE=`pwd`
-
- return 0
-
-}
-
-RestorePreviousConfiguration() {
- #
- # Restore previous configuration
- #
- PREVIOUS_CONF_FILE=Conf/BuildEnv.sh
- if [ -e $PREVIOUS_CONF_FILE ]
- then
- echo Loading previous configuration from \$WORKSPACE/$PREVIOUS_CONF_FILE
- . $WORKSPACE/$PREVIOUS_CONF_FILE
- fi
-}
-
-GenerateShellCodeToSetVariable() {
- VARIABLE=$1
- OUTPUT_FILE=$2
- VAR_VALUE="echo \${${VARIABLE}}"
- VAR_VALUE=`eval $VAR_VALUE`
- echo "if [ -z \"\$${VARIABLE}\" ]" >> $OUTPUT_FILE
- echo "then" >> $OUTPUT_FILE
- echo " export ${VARIABLE}=${VAR_VALUE}" >> $OUTPUT_FILE
- echo "fi" >> $OUTPUT_FILE
-}
-
-GenerateShellCodeToUpdatePath() {
- OUTPUT_FILE=$1
- echo "if [ -e $EDK_TOOLS_PATH_BIN ]" >> $OUTPUT_FILE
- echo "then" >> $OUTPUT_FILE
- echo " if [ "\${PATH/$EDK_TOOLS_PATH_BIN/}" == "\$PATH" ]" >> $OUTPUT_FILE
- echo " then" >> $OUTPUT_FILE
- echo " export PATH=$EDK_TOOLS_PATH_BIN:\$PATH" >> $OUTPUT_FILE
- echo " fi" >> $OUTPUT_FILE
- echo "fi" >> $OUTPUT_FILE
-}
-
-StoreCurrentConfiguration() {
- #
- # Write configuration to a shell script to allow for configuration to be
- # easily reloaded.
- #
- OUTPUT_FILE=Conf/BuildEnv.sh
- #echo Storing current configuration into \$WORKSPACE/$OUTPUT_FILE
- OUTPUT_FILE=$WORKSPACE/$OUTPUT_FILE
- echo "# Auto-generated by ${BASH_SOURCE[0]}" > $OUTPUT_FILE
- GenerateShellCodeToSetVariable WORKSPACE $OUTPUT_FILE
- GenerateShellCodeToSetVariable EDK_TOOLS_PATH $OUTPUT_FILE
- GenerateShellCodeToUpdatePath $OUTPUT_FILE
-}
-
-SetEdkToolsPath() {
-
- #
- # If EDK_TOOLS_PATH is already set, then we can return right now
- #
- if [ -n "$EDK_TOOLS_PATH" ]
- then
- return 0
- fi
-
- #
- # Try $WORKSPACE/Conf/EdkTools
- #
- if [ -e $WORKSPACE/Conf/EdkTools ]
- then
- export EDK_TOOLS_PATH=$WORKSPACE/Conf/EdkTools
- return 0
- fi
-
- #
- # Try $WORKSPACE/Conf/BaseToolsSource
- #
- if [ -e $WORKSPACE/Conf/BaseToolsSource ]
- then
- export EDK_TOOLS_PATH=$WORKSPACE/Conf/BaseToolsSource
- return 0
- fi
-
- #
- # Try $WORKSPACE/BaseTools
- #
- if [ -e $WORKSPACE/BaseTools ]
- then
- export EDK_TOOLS_PATH=$WORKSPACE/BaseTools
- return 0
- fi
-
- echo "Unable to determine EDK_TOOLS_PATH"
- echo
- echo "You may need to download the 'BaseTools' from buildtools.tianocore.org."
- echo "After downloading, either create a symbolic link to the source at"
- echo "\$WORKSPACE/Conf/BaseToolsSource, or set the EDK_TOOLS_PATH environment"
- echo "variable."
-
-}
-
-GetBaseToolsBinSubDir() {
- #
- # Figure out a uniq directory name from the uname command
- #
- UNAME_DIRNAME=`uname -sm`
- UNAME_DIRNAME=${UNAME_DIRNAME// /-}
- UNAME_DIRNAME=${UNAME_DIRNAME//\//-}
- echo $UNAME_DIRNAME
-}
-
-GetEdkToolsPathBinDirectory() {
- #
- # Figure out a uniq directory name from the uname command
- #
- BIN_SUB_DIR=`GetBaseToolsBinSubDir`
-
- if [ -e $EDK_TOOLS_PATH/BinWrappers/$BIN_SUB_DIR ]
- then
- EDK_TOOLS_PATH_BIN=$EDK_TOOLS_PATH/BinWrappers/$BIN_SUB_DIR
- else
- EDK_TOOLS_PATH_BIN=$EDK_TOOLS_PATH/Bin/$BIN_SUB_DIR
- fi
-
- echo $EDK_TOOLS_PATH_BIN
-}
-
-AddDirToStartOfPath() {
- DIRNAME=$1
- PATH=$DIRNAME:$DIRNAME:$DIRNAME:$PATH
- PATH=${PATH//$DIRNAME:/}
- PATH=$DIRNAME:$PATH
- export PATH
-}
-
-AddEdkToolsToPath() {
-
- #
- # If EDK_TOOLS_PATH is not set, then we cannot update PATH
- #
- if [ -z "$EDK_TOOLS_PATH" ]
- then
- return 1
- fi
-
- EDK_TOOLS_PATH_BIN=`GetEdkToolsPathBinDirectory`
-
- AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike
- AddDirToStartOfPath $EDK_TOOLS_PATH_BIN
-
-}
-
-CopySingleTemplateFile() {
-
- SRC_FILENAME=Conf/$1.template
- DST_FILENAME=Conf/$1.txt
-
- if [ -e $WORKSPACE/$DST_FILENAME ]
- then
- return
- fi
-
- echo "Copying \$EDK_TOOLS_PATH/$SRC_FILENAME"
- echo " to \$WORKSPACE/$DST_FILENAME"
- SRC_FILENAME=$EDK_TOOLS_PATH/$SRC_FILENAME
- DST_FILENAME=$WORKSPACE/$DST_FILENAME
- cp $SRC_FILENAME $DST_FILENAME
-
-}
-
-CopyTemplateFiles() {
-
- CopySingleTemplateFile build_rule
- CopySingleTemplateFile tools_def
- CopySingleTemplateFile target
-
-}
-
-ScriptMain() {
-
- SetWorkspace
- if [ -z $WORKSPACE ]
- then
- echo "Failure setting WORKSPACE"
- return 1
- fi
-
- RestorePreviousConfiguration
-
- SetEdkToolsPath
- if [ -z $EDK_TOOLS_PATH ]
- then
- return 1
- fi
-
- AddEdkToolsToPath
- if [ $? -ne 0 ]
- then
- echo "Failure adding EDK Tools into PATH!"
- return 1
- fi
-
- StoreCurrentConfiguration
-
- echo WORKSPACE: $WORKSPACE
- echo EDK_TOOLS_PATH: $EDK_TOOLS_PATH
-
- CopyTemplateFiles
-
-}
-
-#
-# Run the main function
-#
-ScriptMain
-
diff --git a/BaseTools/BuildNotes.txt b/BaseTools/BuildNotes.txt
deleted file mode 100644
index 045e8fcf87..0000000000
--- a/BaseTools/BuildNotes.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-Intel(R) Platform Innovation Framework for EFI
-BuildTools Project, BaseTools Sub-Project
-Root Package 1.00
-2007-08-31
-
-Intel is a trademark or registered trademark of Intel Corporation or its
-subsidiaries in the United States and other countries.
-* Other names and brands may be claimed as the property of others.
-Copyright (c) 2007, Intel Corporation. All rights reserved.
-
--------------------------------------------------------------------------------
-Quick Start
------------
-
-Windows:
- a) Set the PYTHON_FREEZER_PATH to the cx_Freeze installation directory
- b) Go to the <buildtools_project>/BaseTools and run "toolsetup" script
-
-Unix-like:
- a) make -C <buildtools_project>/BaseTools
- b) Look over https://edk2.tianocore.org/step-by-step-instructions.html
- for a helpful step-by-step guide for building 'Hello World' on
- various operating systems with edk2.
-
-Supported build targets (toolsetup)
------------------------------------
-
-build(or none) - Incremental Build of all C based tools. This is the default target
-rebuild - Clean all generated files and directories during build, and rebuild all tools
-
--------------------------------------------------------------------------------
-Tools in Python
----------------
-* Convert Python source to exe file
-
- The tools written in Python can be converted into executable program which can
- be executed without installing a Python interpreter. (Generally it is easier
- to run the scripts from their source on operating systems other than Windows.)
-
- For Windows and Linux, the conversion tool package is called cx_Freeze, its
- home page is:
-
- http://sourceforge.net/projects/cx-freeze/
-
- If you have installed cx_Freeze at c:\cx_Freeze-3.0.3. Use following command
- lines to convert MyBuild.py to MyBuild.exe (note this is an example, there is
- no MyBuild Python project in the BaseTools\Python tree.
-
- set PYTHONPATH=<BaseToolsDirPath>\Source\Python
- c:\cx_Freeze-3.0.3\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_16_le,encodings.utf_8 --install-dir=.\mybuild MyBuild.py
-
- The generated .exe (and .dll) files are put in "mybuild" subdirectory.
-
- The following is a real example with the BuildTools/trunk/BaseTools project
- installed in: C:\Work\BaseTools
-
-
- C:\Work\BaseTools\Source\Python> set PYTHONPATH=C:\Work\BaseTools\Source\Python
- C:\Work\BaseTools\Source\Python> c:\cx_Freeze-3.0.3\FreezePython.exe --include-modules=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_16_le,encodings.utf_8 --install-dir=C:\Work\BaseTools\Bin\Win32 build\build.py
-
----------------
-* Execute tools written in Python without conversion
-
-Unix-like systems:
-
-The edk2/edksetup.sh script will setup everything which is needed to
-run the scripts from their source.
-
-Windows:
-
- The tools written in Python can be executed directly from its source directory
-as long as the Python interpreter (Python 2.5) has been installed. Before the execution,
-please make sure the environment variable PYTHONPATH is set to
-
- <buildtools_project>/BaseTools/Source/Python
-
- There're five tools written in Python. The entrance file of each tool is listed
-below.
-
- build <buildtools_project>/BaseTools/Source/Python/build/build.py
- GenFds <buildtools_project>/BaseTools/Source/Python/GenFds/GenFds.py
- Trim <buildtools_project>/BaseTools/Source/Python/Trim/Trim.py
- MigrationMsa2Inf <buildtools_project>/BaseTools/Source/Python/MigrationMsa2Inf/MigrationMsa2Inf.py
- UPT <buildtools_project>/BaseTools/Source/Python/UPT/UPT.py
diff --git a/BaseTools/Conf/Empty_Package_Information_Data_File.ini b/BaseTools/Conf/Empty_Package_Information_Data_File.ini
deleted file mode 100644
index fe162568c4..0000000000
--- a/BaseTools/Conf/Empty_Package_Information_Data_File.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[DistributionHeader]
-Name =
-GUID =
-Version =
-Vendor =
-Copyright =
-License =
-Abstract =
-XmlSpecification = 1.1
diff --git a/BaseTools/Conf/FrameworkDatabase.template b/BaseTools/Conf/FrameworkDatabase.template
deleted file mode 100644
index 6d88349d26..0000000000
--- a/BaseTools/Conf/FrameworkDatabase.template
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<FrameworkDatabase xmlns="http://www.TianoCore.org/2006/Edk2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <FdbHeader>
- <DatabaseName>FrameworkDatabase</DatabaseName>
- <GuidValue>DD6913E0-3E4E-4B83-8838-57EE7FB71DD1</GuidValue>
- <Version>0.3</Version>
- <Abstract>The Framework Module Development Packaging System Database</Abstract>
- <Description>
- This Database tracks all packages and archives installed in this workspace.
- </Description>
- <Copyright>Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.</Copyright>
- <License>
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
- WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- </License>
- <Specification>FRAMEWORK_PACKAGING_SPECIFICATION 0x00090000</Specification>
- </FdbHeader>
- <PackageList>
- <Filename>MdePkg/MdePkg.dec</Filename>
- <Filename>MdeModulePkg/MdeModulePkg.dec</Filename>
- <Filename>IntelFrameworkPkg/IntelFrameworkPkg.dec</Filename>
- <Filename>IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec</Filename>
- </PackageList>
-</FrameworkDatabase>
diff --git a/BaseTools/Conf/ReadMe.txt b/BaseTools/Conf/ReadMe.txt
deleted file mode 100644
index 0e5e39d36b..0000000000
--- a/BaseTools/Conf/ReadMe.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-This directory contains the template files for the next generation of the
-EDK II Build infrastructure. These files will be copied into the WORKSPACE's
-Conf directory if and only if the target files do not exist.
-
-These files may be updated frequently.
-
-The XMLSchema directory contains the EDK II Packaging XML definitions. The
-schema may change in the future. It differs somewhat from the early versions
-of the XML Schema. \ No newline at end of file
diff --git a/BaseTools/Conf/XMLSchema/DistributionPackage.xsd b/BaseTools/Conf/XMLSchema/DistributionPackage.xsd
deleted file mode 100644
index 5ae85f2bc3..0000000000
--- a/BaseTools/Conf/XMLSchema/DistributionPackage.xsd
+++ /dev/null
@@ -1,2717 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Filename: DistributionPackage.xsd
-
-Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
-
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which may be found at
- http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
- targetNamespace="http://www.uefi.org/2012/1.0" xmlns="http://www.uefi.org/2012/1.0">
- <xs:element name="DistributionPackage">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This schema defines the UEFI/PI Distribution Package description (PKG)
- file. It describes the content of:</xs:documentation>
- <xs:documentation xml:lang="en-us"> 1) Package descriptions with definitions and headers.</xs:documentation>
- <xs:documentation xml:lang="en-us"> 2) Modules in either source or binary format. (Note that Binary format
- is for FFS leaf section file types only, complete FFS files cannot be distributed using this
- distribution format.) </xs:documentation>
- <xs:documentation xml:lang="en-us"> 3) The distribution of custom tools used to modify the binary images to
- create UEFI/PI compliant images. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 4) Finally, it can be used to distribute other miscellaneous content
- that is not specific to UEFI/PI images. </xs:documentation>
- <xs:documentation xml:lang="en-us"> The Package Surface Area describes the content of packages, while the
- Module Surface Area provides information relevant to source and/or binary distributions.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="DistributionHeader" minOccurs="1" maxOccurs="1">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This header contains (legal) information usually required
- for distributing both binary and/or source code. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element ref="PackageSurfaceArea" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The list of packages in this distribution. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Packages are groups of files and/or modules that are similar
- in nature.</xs:documentation>
- <xs:documentation xml:lang="en-us"> Packages are uniquely identified by a package GUID and a
- package version. </xs:documentation>
- <xs:documentation xml:lang="en-us"> A package can declare public mappings of C names to GUID
- values. </xs:documentation>
- <xs:documentation xml:lang="en-us"> A package can provide header files for library classes
- and/or other industry standard definitions. </xs:documentation>
- <xs:documentation xml:lang="en-us"> A package can also declare public mappings of platform
- configuration database (PCD) &quot;knobs&quot; to control features and operation of modules
- within a platform. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Finally, a package lists the library instances and/or
- modules that are provided in a distribution package. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element ref="ModuleSurfaceArea" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The listing of UEFI/PI compliant modules in this
- distribution that are NOT part of a Package. Every module that is provided as part of a
- package needs to be described in a PackageSurfaceArea.Modules section. </xs:documentation>
- <xs:documentation xml:lang="en-us"> The ModuleSurfaceArea section describes how each module in a
- distribution is coded, or, in the case of a binary module distribution, how it was built. </xs:documentation>
- <xs:documentation xml:lang="en-us"> UEFI/PI compliant libraries and modules are uniquely
- identified by the Module's GUID and version number. </xs:documentation>
- <xs:documentation xml:lang="en-us"> This section will typically be used for modules that don't
- require any additional files that would be included in a package. For example, the Enhanced
- FAT driver binary does not need to have a package description, as no additional files are
- provided. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element ref="Tools" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section is for distributing vendor specific executable
- tools, tool source code and/or configuration files. These tools are primarily for
- manipulating code and/or binary images. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Tools in this section can:</xs:documentation>
- <xs:documentation xml:lang="en-us"> 1) Parse build meta-data files to create source code files
- and build scripts. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 2) Modify image files to conform to UEFI/PI specifications. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 3) Generate binary files from certain types of text/unicode
- files. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 4) Generate PCI Option Roms or Firmware Device images. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 5) Implement external encoding/decoding/signature/GUIDed
- tools. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 6) Distribution Package create/install/remove tools.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element ref="MiscellaneousFiles" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The list of miscellaneous files in this distribution. Any
- files that are not listed in either the Package, Module or Tools sections can be listed
- here. This section can be used to distribute specifications for packages and modules that
- are not &quot;industry standards&quot; such as a specification for a chipset or a video
- device. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element ref="UserExtensions" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The UserExtensions section is used to disseminate processing
- instructions that may be custom to the content provided by the distribution. This section
- contains information that is common to all aspects of this disribution. </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
-
- </xs:complexType>
- </xs:element>
- <!-- End of the DistributionPackage Description -->
-
- <xs:element name="DistributionHeader">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section defines the content of the UEIF/PI compliant Distribution
- Package Header. This is the only required element of a UEFI/PI compliant distribution package.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="Name">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the User Interface Name for this Distribution
- Package. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Each Distribution Package is uniquely identified by it's
- GUID and Version number. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:normalizedString">
- <xs:attribute name="BaseName" type="xs:NMTOKEN" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The reference name of the Distribution
- Package file. This single word name can be used by tools as a keyword or for
- directory and/or file creation. </xs:documentation>
- <xs:documentation xml:lang="en-us"> White space and special characters (dash and
- underscore characters may be used) are not permitted in this name.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="GUID">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This 128-bit GUID and the Version attribute uniquely
- identify this Distribution Package. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Backward compatible releases of a distribution package need
- only change the version number, while non-backward compatible changes require the GUID to
- change (resetting the version number to 1.0 is optional.) </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This value, along with the GUID, is used to
- uniquely identify this object. The higher the number, the more recent the
- content. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="Vendor" type="xs:normalizedString">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A string identifying who created this distribution package.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="Date" type="xs:dateTime">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The date and time this distribution was created. The format
- is: YYYY-MM-DDThh:mm:ss, for example: 2001-01-31T13:30:00 (note the T character separator
- between the calendar date and the time. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Copyright">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The copyright for this file that is generated by the creator
- of the distribution. If a derivative work is generated from an existing distribution, then
- the existing copyright must be maintained, and additional copyrights may be appended to the
- end of this element. It may also be the primary copyright for all code provided in the
- Distribution Package. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="License">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A license that describes any restrictions on the use of this
- distribution. If a derivative work is allowed by the original license and a derivative work
- is generated from an existing distribution, then the existing license must be maintained,
- and additional licenses may be appended to the end of this element. It may also be the
- primary license for all code provided in the distribution file. Alternatively, this may
- point to a filename that contains the License. The file (included in the content zip file)
- will be stored in the same location as the distribution package's .pkg file.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Abstract">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A one line description of the Distribution Package.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:normalizedString">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A complete description of the Distribution Package. This
- description may include the release name of the file, the version of the file, and a
- complete description of the file contents and/or features including a description of the
- updates since the previous file release. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Signature" type="Md5Sum">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The packaging utilities will use this MD5 sum value of the
- included ZIP file containing files and/or code. If this element is not present, then
- installation tools should assume that the content is correct, or that other methods may be
- needed to verify content. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="XmlSpecification" type="xs:decimal" default="1.1">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This version of this XML Schema is 1.1 </xs:documentation>
- <xs:documentation xml:lang="en-us"> Changes to 1.1 from 1.0 </xs:documentation>
- <xs:documentation xml:lang="en-us"> #1 Updated to present date and new version which is
- important to reflect the present state of the matter</xs:documentation>
- <xs:documentation xml:lang="en-us"> #2 Added definition/enumeration of UNDEFIND type 2 is
- important since there is a large body of legacy code for which the GUID’s and other
- code/data objects were not decorated with their usage. This document will allow for
- importing today’s source artifacts and producing decorations using the ‘Undefined’ versus
- having an error</xs:documentation>
- <xs:documentation xml:lang="en-us">#3 Allow for inclusion of ARM and future architecture
- types</xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="ReadOnly" type="xs:boolean" default="false" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> If set to true, all content within this Distribution Package
- should NOT be modified. The default permits modification of all content. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="RePackage" type="xs:boolean" default="false" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> If set to true, then the content can be repackaged into another
- distribution package. The default prohibits repackaging the Distribution content.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- <!-- End of the DistributionHeader element. -->
-
- <xs:element name="PackageSurfaceArea">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A package is a collection of related objects - Includes, Libraries and
- Modules. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Each package is uniquely identified by it's GUID and Version number.
- Backward compatible releases of a package need only change the version number, while non-backward
- compatible changes require the GUID to change (resetting the version number to 1.0 is optional.)
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
-
- <xs:element minOccurs="1" maxOccurs="1" name="Header">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="Name">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the User Interface Name for this
- package. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:normalizedString">
- <xs:attribute name="BaseName" type="xs:NMTOKEN" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is a single word BaseName
- of the package. This BaseName can be used by tools as a keyword
- and for directory/file creation. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="GUID">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely
- identify a given package. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This value, along with the GUID,
- is used to uniquely identify this object. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Backward compatible changes must
- make sure this number is incremented from the most recent
- version. Non-backward compatible changes require a new GUID, and
- the version can be reset. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Copyright">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> If the package requires a different copyright
- than the distribution package, this element can list one or more copyright
- lines. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="License">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> If the package requires licenses that are
- different from the distribution package license, this element can contain one or
- more license text paragraphs (or license filenames.) </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Abstract">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A one line description of this package.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:normalizedString">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A complete description of a package. This
- description may include the release name of the package, the version of the
- package, and a complete description of the package contents and/or features
- including a description of the updates since the previous package’s release.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="PackagePath" type="xs:anyURI">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This element is the location (in the ZIP file)
- for the root directory of a package. </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea Header element. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="ClonedFrom">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The term cloned is used here to indicate that this package
- as been copied and modified to a completely different package. An example might be for a new
- generation of chipsets that have few or no elements in common with the original.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="GUID">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely
- identify the Package that this Package was copied from. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This value, along with the GUID,
- is used to uniquely identify the package that this package was
- cloned from. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea ClonedFrom element. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="LibraryClassDeclarations">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Library Classes are public interfaces that can be used by
- modules. One or more library instances can implement a library class, however only one
- library instance can be linked to an individual module. This provides the platform
- integrator with the flexibility of choosing one library instance's implementation over a
- different library instance. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="LibraryClass">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile" type="xs:anyURI">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The header file provides definitions
- and function prototypes for a library class. Modules can be coded
- against these functions, using the definitions in this header,
- without concerning themselves about the libraries' implementation
- details. This is a PackagePath relative path and filename for the
- include file. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="RecommendedInstance">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="GUID">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and the
- Version attribute uniquely identify the Recommended Library
- Instance. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal"
- use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This value, along with
- the GUID, is used to uniquely identify this object. If this
- value is not specified, then any version of the library
- instance is recommended. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="Keyword" type="xs:NCName" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The single word name of the Library
- Class that module developers will use to identify a library class
- dependency. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attributeGroup ref="SupportedArchMod"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea LibraryClassDeclarations element. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="IndustryStandardIncludes">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section is used to list header files for industry
- standards not under the auspices of UEFI.org. For example, headers that contain definitions
- and data structures for the USB specifications. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="IndustryStandardHeader">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile" type="xs:anyURI">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The package relative path and
- filename (in the content zip file) of the industry standard include
- file. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea IndustryStdIncludes element. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="PackageIncludes">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> All top level header files that are included by a package
- that are not listed above. They cannot be:</xs:documentation>
- <xs:documentation xml:lang="en-us"> 1) Local to a module (module specific.) </xs:documentation>
- <xs:documentation xml:lang="en-us"> 2) An industry standard header. </xs:documentation>
- <xs:documentation xml:lang="en-us"> 3) A library class header. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="PackageHeader">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the Package relative path
- and filename location within the content ZIP file.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:anyURI">
- <xs:attributeGroup ref="SupportedArchMod"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea PackageIncluces element. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="Modules">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="ModuleSurfaceArea" minOccurs="1" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section lists the Module Surface Area for
- all modules provided with this package. </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea Modules element. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="GuidDeclarations">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section defines the mapping of GUID C names to GUID
- values as a Registry Format GUID. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Modules that use these GUIDs must specify their dependency
- on this package. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Entry">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Individual GUID Declarations </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
- <xs:element minOccurs="1" maxOccurs="1" name="GuidValue"
- type="RegistryFormatGuid"/>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="UiName" type="xs:normalizedString" use="optional"/>
- <xs:attribute name="GuidTypes" type="GuidListType" use="optional"/>
- <xs:attributeGroup ref="SupportedArchMod"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea GuidDeclarations element. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="ProtocolDeclarations">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section defines the mapping of Protocol C names to GUID
- values as a Registry Format GUID. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Modules that use these Protocols must specify their
- dependency on this package. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Entry">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Individual Protocol Declarations
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
- <xs:element minOccurs="1" maxOccurs="1" name="GuidValue"
- type="RegistryFormatGuid"/>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="UiName" type="xs:normalizedString" use="optional"/>
- <xs:attributeGroup ref="SupportedArchMod"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea ProtocolDeclarations element. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="PpiDeclarations">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section defines the mapping of Ppi C names to GUID
- values as a Registry Format GUID. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Modules that use these Ppis must specify their dependency on
- this package. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Entry">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Individual PPI Declarations </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
- <xs:element minOccurs="1" maxOccurs="1" name="GuidValue"
- type="RegistryFormatGuid"/>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="UiName" type="xs:normalizedString" use="optional"/>
- <xs:attributeGroup ref="SupportedArchMod"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea PpiDeclarations element. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="PcdDeclarations">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section is used to declare platform configuration knobs
- that are defined by this package. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Modules that use these PCD values must specify their
- dependency on this package. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="PcdEntry">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="TokenSpaceGuidCname"
- type="xs:NCName">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Specifies the C name of the Token
- Space GUID of which this PCD Entry is a member. This C name should
- also be listed in the GUIDs section, (specified above,) where the C
- name is assigned to a GUID value. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="Token">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Specifies the 32-bit token value for
- this PCD Entry. The Token number must be unique to the Token Space
- that declares the PCD. </xs:documentation>
- <xs:documentation xml:lang="en-us"> The minLength of 3 is required to
- handle the "0x" prefix to the hex number. </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="HexNumber">
- <xs:minLength value="3"/>
- <xs:maxLength value="10"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
- <xs:element minOccurs="1" maxOccurs="1" name="DatumType" type="PcdDatumTypes">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A string that contains the data type
- of this PCD Entry. PCD data types are restricted to the following
- set:UINT8, UINT16, UINT32, UINT64, VOID*, BOOLEAN.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="ValidUsage" type="PcdItemListType">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A string that contains one or more
- PCD Item types separated by spaces. The PCD Item types are
- restricted to FeaturePcd, FixedPcd, PatchPcd, Pcd and/or PcdEx.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="DefaultValue"
- type="xs:normalizedString"/>
- <xs:element minOccurs="0" maxOccurs="1" name="MaxDatumSize">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is a recommended maximum data
- size for VOID* data types, the actual value should be defined by the
- Platform Integrator. It is not required for the other data types. </xs:documentation>
- <xs:documentation xml:lang="en-us"> The minLength of 3 is required to
- handle the "0x" prefix to the hex number. </xs:documentation>
-
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="HexNumber">
- <xs:minLength value="3"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Prompt">
- <xs:annotation>
- <xs:documentation xml:lang="en-US"> This entry contains prompt
- information, that may used by tools to assist platform integrators
- with choosing the correct values </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us"
- use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="PcdError">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Valid Error messages that may be
- implemented in a module for the PCD Entry. Only One Error Number per
- PcdError, (multiple ErrorMessage entries are permitted) and multiple
- PcdError elements are permitted. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:choice minOccurs="1" maxOccurs="1">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> One of the following
- types of comparisons, which must be able to evaluate to
- either true or false. </xs:documentation>
- </xs:annotation>
- <xs:element minOccurs="0" maxOccurs="1" name="ValidValueList">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The PCD Value must be
- space separated list of values. Values are restricted to the
- data type of this PCD. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:normalizedString">
- <xs:attribute name="Lang" type="xs:language" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="ValidValueRange"
- type="xs:normalizedString">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The PCD must be within a
- specifed range of numeric values. Restricted to C style
- Relational, Equality and Logicial Operators and parenthesis
- are valid. Only the CName for this PCD is permitted in the
- ValidValueRange expression. All other values must be
- numeric.</xs:documentation>
- <xs:documentation xml:lang="en-us"> LValue (op RValue)+
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Expression"
- type="xs:normalizedString">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A in-fix logical
- expression using C style logical operators.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- <xs:element minOccurs="1" maxOccurs="1" name="ErrorNumber">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A hexadecimal value for
- the error message as defined by specifications. </xs:documentation>
- <xs:documentation xml:lang="en-us"> The minLength of 3 is
- required to handle the "0x" prefix to the hex number. </xs:documentation>
-
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="HexNumber">
- <xs:minLength value="3"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="ErrorMessage">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This string should be
- defined by specifications. There are pre-defined error
- number ranges in the UEFI/PI specificaiton.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us"
- use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attributeGroup ref="SupportedArchMod"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea PcdDeclarations element. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="PcdRelationshipChecks">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section is used to describe any PCD interdependencies
- or relationships. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="PcdCheck" type="xs:normalizedString">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This entry must used
- TokenSpaceGuidCName.PcdCname for every named PCD. Restricted to Relational,
- Equality and Logical Operators (NOT, AND, OR, GT, GE, EQ, LE, LT and XOR) and
- parenthesis are valid. Only the TokenSpaceGuidCName.PcdCname us permitted to
- name PCDs in the expression. All other values must be numeric. </xs:documentation>
- <xs:documentation xml:lang="en-us"> LValue (op RValue)+ </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="MiscellaneousFiles">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section contains files that are not part of the code
- distributed with this package. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="1" name="Copyright" type="xs:string">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Only required if different from the Package
- Copyright. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="License" type="xs:string">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Only required if different from the Package
- License. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Abstract" type="xs:string">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A one line description of this section's
- content. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Description" type="xs:string">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A complete description of the files in this
- section. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Filename">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the PackagePath relative path and
- filename location within the ZIP file. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:anyURI">
- <xs:attribute name="Executable" type="xs:boolean" default="false"
- use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> If true, used by installation
- tools to ensure that a file that must be executable has the
- correct properties to permit execution. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
-
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea Misc element. -->
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="UserExtensions">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section is used for any processing instructions that
- may be custom to the content provided by this package that are common to this package.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:sequence>
- <xs:any processContents="lax" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- <xs:attribute name="UserId" type="xs:NCName" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is a single word identifier for grouping
- similar content that does not fit into previously defined sections or other sections
- of the Distribution. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="Identifier" type="xs:string" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This can be used to differentiate multiple sections
- with a grouping. </xs:documentation>
- <xs:documentation xml:lang="en-us"> For example, a PRE_PROCESS Identifier might indicate
- specific steps and tools required before processing module content, while a
- different UserExtensions section with a POST_PROCESS Identifier might describe steps
- that need to be executed after operations on the modules in this package.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:anyAttribute processContents="lax"/>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageSurfaceArea UserExtensions element. -->
-
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of the PackageSurfaceArea element. -->
-
- <xs:element name="ModuleSurfaceArea">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Each module is uniquely identified by it's GUID and Version number.
- Backward compatible releases of a module need only change the version number, while non-backward
- compatible changes require the GUID to change (resetting the version number to 1.0 is optional.)
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
-
- <xs:element minOccurs="1" maxOccurs="1" name="Header">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="Name">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the User Interface Name for this Module.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:normalizedString">
- <xs:attribute name="BaseName" type="xs:NMTOKEN" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is a single word BaseName
- that will be used to create a module meta-data file. </xs:documentation>
- <xs:documentation xml:lang="en-us"> This name should also be used to
- create output file names and directories. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="GUID">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely
- identify a given Module. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This value, along with the GUID,
- is used to uniquely identify this object. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Backward compatible changes must
- make sure this number is incremented from the most recent
- version. Non-backward compatible changes require a new GUID, and
- the version can be reset. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Copyright">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is only required if the Copyright is
- different from either the Package or Distribution copyright. Multiple copyright
- lines are permitted within this section. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="License">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is only required if the license is
- different from either the Package or Distribution license. Multiple licenses are
- permitted within this section. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Abstract">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A brief text description of the module.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:normalizedString">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A complete description of the module contents
- and/or features including a description of the updates since the previous module
- release. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of Module Surface Area Header Section -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="ModuleProperties">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> List general information about a module, including the
- Supported Architectures, this module's type, specifications the module is coded against, and
- other informational content. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="ModuleType" type="ModuleTypes">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> One of the Enumerated module types that limit
- the use of a module. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="Path" type="xs:anyURI">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> For stand-alone modules that are NOT part of any
- package, this is the path to the root of the module as listed in the ZIP file.
- For modules included in a package, this is the location, relative to the root of
- the package (PackagePath) this module belongs to. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="PcdIsDriver">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This element is only required for the PEIM that
- produces the PCD PPI or the DXE Driver that produces the PCD Protocol.
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="PEI_PCD_DRIVER"/>
- <xs:enumeration value="DXE_PCD_DRIVER"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
-
- <xs:element minOccurs="0" maxOccurs="1" name="UefiSpecificationVersion" type="xs:decimal"/>
-
- <xs:element minOccurs="0" maxOccurs="1" name="PiSpecificationVersion" type="xs:decimal"/>
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Specification">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is a list of other specifications that this
- module is written against. These entries can be used in #define statements
- (depending on the build system implementation, they may be autogenerated.)
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:NCName">
- <xs:attribute name="Version" type="xs:decimal" use="required"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="BootMode">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Different firmware execution paths may be taken
- based on a given state of the hardware, firmware, or through feature settings. A
- BootMode may be declared (PRODUCES) or discovered (CONSUMES) based on these
- states and feature settings. If the usage is UNDEFINE, it implies that a Boot
- Mode is used, but the package creator does not know how it is used. The
- supported boot modes map to the PI specification Boot Modes. The boot modes
- listed with Recovery are to indicate that the BootMode is valid during a
- recovery boot. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence minOccurs="0">
- <xs:element minOccurs="1" maxOccurs="1" name="SupportedBootModes">
- <xs:simpleType>
- <xs:list>
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="FULL"/>
- <xs:enumeration value="MINIMAL"/>
- <xs:enumeration value="NO_CHANGE"/>
- <xs:enumeration value="DIAGNOSTICS"/>
- <xs:enumeration value="DEFAULT"/>
- <xs:enumeration value="S2_RESUME"/>
- <xs:enumeration value="S3_RESUME"/>
- <xs:enumeration value="S4_RESUME"/>
- <xs:enumeration value="S5_RESUME"/>
- <xs:enumeration value="FLASH_UPDATE"/>
- <xs:enumeration value="RECOVERY_FULL"/>
- <xs:enumeration value="RECOVERY_MINIMAL"/>
- <xs:enumeration value="RECOVERY_NO_CHANGE"/>
- <xs:enumeration value="RECOVERY_DIAGNOSTICS"/>
- <xs:enumeration value="RECOVERY_DEFAULT"/>
- <xs:enumeration value="RECOVERY_S2_RESUME"/>
- <xs:enumeration value="RECOVERY_S3_RESUME"/>
- <xs:enumeration value="RECOVERY_S4_RESUME"/>
- <xs:enumeration value="RECOVERY_S5_RESUME"/>
- <xs:enumeration value="RECOVERY_FLASH_UPDATE"/>
- <xs:enumeration value="UNDEFINED"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:list>
- </xs:simpleType>
- </xs:element>
-
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="Usage" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="CONSUMES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The module always supports
- the given boot modes. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SOMETIMES_CONSUMES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The module may support a
- given mode on some execution paths. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="PRODUCES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The module will change the
- boot mode. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SOMETIME_PRODUCES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The module will change the
- boot mode on some exection paths. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="UNDEFINED">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The package creator does not
- know how the boot mode is used. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Event" nillable="true">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The functions that make up the Event, Timer, and
- Task Priority Services are used during preboot to create, close, signal, and
- wait for events; to set timers; and to raise and restore task priority levels as
- defined in the UEFI specification. GUIDed events should be listed in the Guids
- section. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="Usage" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="CONSUMES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The module will register a
- notification function and calls the function when it is
- signaled. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SOMETIMES_CONSUMES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The module will register a
- notification function and calls the function when it is
- signaled on some execution paths. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="PRODUCES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The module will signal all
- events in an event group. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SOMETIMES_PRODUCES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The module will signal all
- events in an event group under some execution paths.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="UNDEFINED">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The package creator does not
- know how an event is used. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="EventType" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="EVENT_TYPE_PERIODIC_TIMER"/>
- <xs:enumeration value="EVENT_TYPE_RELATIVE_TIMER"/>
- <xs:enumeration value="UNDEFINED"/>
- </xs:restriction>
- </xs:simpleType>
-
-
- </xs:attribute>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="HOB" nillable="false">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is a list of non-GUIDed Hand Off Blocks
- (HOBs) produced or consumed by this module. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="HobType" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="PHIT"/>
- <xs:enumeration value="MEMORY_ALLOCATION"/>
- <xs:enumeration value="RESOURCE_DESCRIPTOR"/>
- <xs:enumeration value="FIRMWARE_VOLUME"/>
- <xs:enumeration value="LOAD_PEIM"/>
- <xs:enumeration value="UNDEFINED"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="Usage" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="CONSUMES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A HOB must be present in the
- system. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SOMETIMES_CONSUMES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> If present, the HOB will be
- used. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="PRODUCES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The HOB is always produced
- by the module. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SOMETIMES_PRODUCES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The HOB may be produced by
- the module under some execution paths. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="UNDEFINED">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The package creator knows
- that a HOB is used, but does not know how it is used.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
-
- </xs:sequence>
- <xs:attributeGroup ref="SupportedArchMod"/>
- </xs:complexType>
- </xs:element>
- <!-- End of ModuleProperties Section -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="ClonedFrom">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section may be included for Modules that are copied
- from a different module. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="GUID">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely
- identify the Module that this Module was copied from. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This value, along with the GUID,
- is used to uniquely identify this object. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of ClonedFrom Section. -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="LibraryClassDefinitions">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A list of the different Library Classes consumed by a
- driver, core and/or application module, or produced by a Library module. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="LibraryClass">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="Keyword" type="xs:NCName">
- <xs:annotation>
- <xs:documentation xml:lang="en-us "> Used by tools to identify different
- instances of libraries that provide the library class. This keyword
- identifies the library class this module needs to be linked against.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="RecommendedInstance">
- <xs:complexType>
- <xs:all>
- <xs:element minOccurs="1" maxOccurs="1" name="GUID">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and the
- Version attribute uniquely identify the recommended Library
- Instance for this module . </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal"
- use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This value, along with
- the GUID, is used to uniquely identify this object.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:all>
- </xs:complexType>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="Usage" use="required">
- <xs:simpleType>
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Library instances can provide code
- for a library class, or may require other library instances
- themselves. Since different execution paths in a library (or module)
- may need different library classes based on some setting, library
- classes may not alway be required. </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="PRODUCES"/>
- <xs:enumeration value="CONSUMES"/>
- <xs:enumeration value="SOMETIMES_CONSUMES"/>
- <xs:enumeration value="UNDEFINED"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
-
- <xs:attributeGroup ref="SupportedArchMod"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A FeatureFlag attribute must evaluate to
- either true or false - it may be a fixed value of true or false, a C
- name or an in-fix expression. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of LibraryClassDefinitions Section -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="SourceFiles">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Filename">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the module relative
- (ModuleProperties.Path) path and filename location within the ZIP file.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:anyURI">
- <xs:attribute name="Family" type="FamilyTypes" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The Family attribute is used to
- restrict usage to a given family of compilers, such as GCC or
- MSFT. Since not all code processing tools use the same syntax,
- especially for assembly, this field can be used to identify
- different syntax. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of SourceFiles Section -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="BinaryFiles">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="BinaryFile">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Filename">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the module relative
- (ModuleProperties.Path) path and filename location within the ZIP
- file. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:anyURI">
- <xs:attribute name="FileType" use="optional">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Binary file distribution
- is limited to UEFI/PI FFS leaf section file types.
- </xs:documentation>
- </xs:annotation>
- <xs:enumeration value="GUID"/>
- <xs:enumeration value="FREEFORM"/>
- <xs:enumeration value="UEFI_IMAGE"/>
- <xs:enumeration value="PE32">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A UEFI/PI FFS Leaf
- section file type, not a raw PE32 file. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="PIC"/>
- <xs:enumeration value="PEI_DEPEX"/>
- <xs:enumeration value="DXE_DEPEX"/>
- <xs:enumeration value="SMM_DEPEX"/>
- <xs:enumeration value="COMPAT16"/>
- <xs:enumeration value="DISPOSABLE"/>
- <xs:enumeration value="TE"/>
- <xs:enumeration value="VER"/>
- <xs:enumeration value="UI"/>
- <xs:enumeration value="BIN"/>
- <xs:enumeration value="FV"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="GUID" use="optional"
- type="RegistryFormatGuid"/>
- <xs:attribute name="SupArchList" type="ArchListType"
- use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType"
- use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString"
- use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="AsBuilt">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section contains information
- about how the module was coded, such as Compiler Tools, Flags, PCDs
- (only PatchPcd and/or PcdEx) and Library Class Instances used to
- build the binary. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="PatchPcdValue">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The element is the
- Patchable PCD Value that was used during the build.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1"
- name="TokenSpaceGuidValue" type="RegistryFormatGuid"/>
- <xs:element minOccurs="1" maxOccurs="1" name="PcdCName"
- type="xs:NCName"/>
- <xs:element minOccurs="1" maxOccurs="1" name="Token">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The minLength of 3 is
- required to handle the "0x" prefix to the hex number.
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="HexNumber">
- <xs:minLength value="3"/>
- <xs:maxLength value="10"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="DatumType"
- type="PcdDatumTypes"/>
- <xs:element minOccurs="0" maxOccurs="1" name="MaxDatumSize">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This field is required
- if the Pcd Datum Type is VOID* </xs:documentation>
- <xs:documentation xml:lang="en-us"> The minLength of 3 is
- required to handle the "0x" prefix to the hex number.
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="HexNumber">
- <xs:minLength value="3"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="Value"
- type="xs:normalizedString"/>
- <xs:element minOccurs="1" maxOccurs="1" name="Offset">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The minLength of 3 is
- required to handle the "0x" prefix to the hex number.
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="HexNumber">
- <xs:minLength value="3"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0"
- maxOccurs="unbounded"/>
- <xs:element minOccurs="0" maxOccurs="unbounded"
- name="PcdError">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Error information
- implemented by the module. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="ErrorNumber">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The minLength of 3 is
- required to handle the "0x" prefix to the hex number.
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="HexNumber">
- <xs:minLength value="3"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded"
- name="ErrorMessage">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us"
- use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="PcdExValue">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The element is the
- DynamicEx PCD Value that was used during the build.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1"
- name="TokenSpaceGuidValue" type="RegistryFormatGuid"/>
- <xs:element minOccurs="1" maxOccurs="1" name="Token">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The minLength of 3 is
- required to handle the "0x" prefix to the hex number.
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="HexNumber">
- <xs:minLength value="3"/>
- <xs:maxLength value="10"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="DatumType"
- type="PcdDatumTypes"/>
- <xs:element minOccurs="0" maxOccurs="1" name="MaxDatumSize">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This field is required
- if the Pcd Datum Type is VOID* </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="HexNumber">
- <xs:minLength value="3"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="Value"
- type="xs:normalizedString"/>
- <xs:element ref="HelpText" minOccurs="0"
- maxOccurs="unbounded"/>
- <xs:element minOccurs="0" maxOccurs="unbounded"
- name="PcdError">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Error information
- implemented by the module. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="ErrorNumber">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The minLength of 3 is
- required to handle the "0x" prefix to the hex number.
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="HexNumber">
- <xs:minLength value="3"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded"
- name="ErrorMessage">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us"
- use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element minOccurs="0" maxOccurs="1" name="LibraryInstances">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the actual
- library instance that was used to link against the module.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="GUID">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and the
- Version attribute uniquely identify the actual Library
- Instance linked in this module. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal"
- use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This value, along with
- the GUID, is used to uniquely identify this object.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="BuildFlags">
- <xs:complexType mixed="true">
- <xs:simpleContent>
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Any description of OS,
- Tool, and flags for the individual tool can go in this
- section. </xs:documentation>
- </xs:annotation>
- <xs:extension base="xs:string">
- <xs:anyAttribute processContents="lax"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of AsBuilt -->
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of BinaryFiles Section -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="PackageDependencies">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Package">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us"
- use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="GUID">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This GUID and the Version attribute
- uniquely identify Package that this Module depends on.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="RegistryFormatGuid">
- <xs:attribute name="Version" type="xs:decimal" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This value, along with
- the GUID, is used to uniquely identify this object. If the
- version attribute is not specified, the most recent version
- of the package can be used. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PackageDependencies -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="Guids">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="GuidCName">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
- <xs:element minOccurs="0" maxOccurs="1" name="VariableName"
- type="xs:normalizedString">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Only valid for Variable GUID types. </xs:documentation>
- <xs:documentation> This can be either a Hex Array or C string in unicode
- format: L"string" Data. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="Usage" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="CONSUMES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us">The module does not install
- the GUID, and the GUID must be present for the module to
- execute. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SOMETIMES_CONSUMES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The module does not install
- the GUID, however, the GUID will be used if it is present.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="PRODUCES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The module always installs
- the GUID. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SOMETIMES_PRODUCES">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The Module will install the
- GUID under certain execution paths. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="UNDEFINED">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The package creator knows
- that a GUID is used, but does not know how it is used.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="GuidType" type="GuidListType" use="required"/>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of Guids Section -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="Protocols">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A listing of protocols required or produced by this module.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Protocol" nillable="true">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="Usage" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="PRODUCES"/>
- <xs:enumeration value="SOMETIMES_PRODUCES"/>
- <xs:enumeration value="CONSUMES"/>
- <xs:enumeration value="SOMETIMES_CONSUMES"/>
- <xs:enumeration value="TO_START"/>
- <xs:enumeration value="BY_START"/>
- <xs:enumeration value="UNDEFINED"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="Notify" type="xs:boolean" use="optional"/>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of Protocols Section -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="PPIs">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A listing of PPIs required or produced by this module.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Ppi" nillable="true">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="Usage" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="PRODUCES"/>
- <xs:enumeration value="SOMETIMES_PRODUCES"/>
- <xs:enumeration value="CONSUMES"/>
- <xs:enumeration value="SOMETIMES_CONSUMES"/>
- <xs:enumeration value="UNDEFINED"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="Notify" type="xs:boolean" use="optional"/>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PPIs Section -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="Externs">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> These elements specify additional information about the
- module. This area may be used by tools to generate code. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Extern">
- <xs:complexType>
- <xs:sequence>
- <xs:choice minOccurs="1">
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="1" name="EntryPoint"
- type="xs:NCName"/>
- <xs:element minOccurs="0" maxOccurs="1" name="UnloadImage"
- type="xs:NCName"/>
- </xs:sequence>
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="1" name="Constructor"
- type="xs:NCName"/>
- <xs:element minOccurs="0" maxOccurs="1" name="Destructor"
- type="xs:NCName"/>
- </xs:sequence>
- </xs:choice>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of Externs Section -->
-
- <xs:element minOccurs="0" maxOccurs="1" name="PcdCoded">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section describes how a platform is coded with respect
- to the platform configuration knobs. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="PcdEntry">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
- <xs:element minOccurs="1" maxOccurs="1" name="TokenSpaceGuidCName"
- type="xs:NCName"/>
- <xs:element minOccurs="0" maxOccurs="1" name="DefaultValue"
- type="xs:normalizedString"/>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="PcdItemType" type="PcdItemTypes" use="required"/>
- <xs:attribute name="PcdUsage" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="PRODUCES"/>
- <xs:enumeration value="SOMETIMES_PRODUCES"/>
- <xs:enumeration value="CONSUMES"/>
- <xs:enumeration value="SOMETIMES_CONSUMES"/>
- <xs:enumeration value="UNDEFINED"/>
- </xs:restriction>
- </xs:simpleType>
-
-
- </xs:attribute>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of PcdCoded Section -->
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="PeiDepex">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the PEI dependency expression for a Dependency
- Section. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="Expression" type="xs:string" minOccurs="1" maxOccurs="1">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> An in-fix expression, of C identifiers and TRUE,
- FALSE, AND, OR, NOT, BEFORE, and AFTER as well as parenthesis () in the in-fix
- notation. The operators are restricted to grammar defined in the PI
- specification. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
- <!-- End of PeiDepex Section -->
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="DxeDepex">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the DXE dependency expression for a Dependency
- Section. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="Expression" type=" xs:string " minOccurs="1" maxOccurs="1">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> An in-fix expression, of C identifiers and TRUE,
- FALSE, AND, OR, NOT, BEFORE, and AFTER as well as parenthesis () in the in-fix
- notation. The operators are restricted to grammar defined in the PI
- specification. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
- <!-- End of DxeDepex Section -->
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="SmmDepex">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the SMM dependency expression for a Dependency
- Section. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="Expression" type=" xs:string " minOccurs="1" maxOccurs="1">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> An in-fix expression, of C identifiers and TRUE,
- FALSE, AND, OR, NOT, BEFORE, and AFTER as well as parenthesis () in the in-fix
- notation. The operators are restricted to grammar defined in the PI
- specification. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element ref="HelpText" minOccurs="0" maxOccurs="1"/>
- </xs:sequence>
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- <xs:attribute name="FeatureFlag" type="xs:normalizedString" use="optional"/>
- </xs:complexType>
- </xs:element>
- <!-- End of SmmDepex Section -->
-
-
- <xs:element minOccurs="0" maxOccurs="1" name="MiscellaneousFiles">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section is used to provide comments and/or list
- auxiliary files, such as pdb or map files. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Filename">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the path and filename location within
- the ZIP file. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:anyURI">
- <xs:attribute name="Executable" type="xs:boolean" default="false"
- use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> If true, used by installation
- tools to ensure that a file that must be executable has the
- correct properties to permit execution. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of Module Surface Area Misc Section -->
-
- <xs:element minOccurs="0" maxOccurs="unbounded" name="UserExtensions">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section is used for any processing instructions that
- may be custom to the content provided by the distribution that are common to module. </xs:documentation>
- <xs:documentation xml:lang="en-us"> The content is vendor specific. </xs:documentation>
- <xs:documentation xml:lang="en-us"> The content can be plain text as well as any user-defined,
- properly formatted XML structure. </xs:documentation>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:attribute name="UserId" type="xs:NCName" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is a single word identifier for grouping
- similar content. For example, ReferenceBuild might be used to identify non-PI
- compliant build steps, with two different UserExtensions sections, one with an
- Identifier of Prebuild, and another of PostBuild. Both UserExtensions sections would
- use the same UserId. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="Identifier" type="xs:string" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This can be any string used to differentiate or
- identify this section from other UserExtensions sections. </xs:documentation>
- <xs:documentation xml:lang="en-us"> For example, a PRE_PROCESS Identifier might indicate
- specific steps and tools required before processing module content, while a
- different UserExtensions section with a POST_PROCESS Identifier might describe steps
- that need to be executed after operations on this module. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:anyAttribute processContents="lax"/>
- </xs:complexType>
- </xs:element>
- <!-- End of Module Surface Area UserExtensions Section -->
-
- </xs:sequence>
- <xs:attribute name="BinaryModule" type="xs:boolean" default="false" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This attribute is used when the binaries are distributed for
- this module and no code generation from source files is required. If set, then the BinaryFiles
- section should be used, and any files listed in the SourceFiles section do not have to be built.
- Additionally, the AsBuilt section for each binary file must be included. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
-
- </xs:element>
- <!-- End of the ModuleSurfaceArea element. -->
-
- <xs:element name="Tools">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="1" name="Header">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="1" maxOccurs="1" name="Name" type="xs:normalizedString">
- <xs:annotation>
- <xs:documentation xml:lang="en-us">This is the User Interface Name for this Tools
- Distribution.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Copyright" type="xs:string">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is only required if the Copyright is
- different from the Distribution Package copyright. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="License" type="xs:string">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is only required if the License is
- different from the Distribution Package license. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Abstract" type="xs:normalizedString">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is only required if the Abstract is
- different from the Distribution Package Abstract. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Description" type="xs:string">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is only required if the Description is
- different from the Distribution Package Description. </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="1" maxOccurs="unbounded" name="Filename">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the path and filename location within the ZIP file.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:anyURI">
- <xs:attribute name="OS" type="SupportedOs" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is required for tools that execute; it
- should not be used for configuration files. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="Executable" type="xs:boolean" default="false" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> If true, used by installation tools to
- ensure that a file that must be executable has the correct properties to
- permit execution. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of the Tools element. -->
-
- <xs:element name="MiscellaneousFiles">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This section contains a list of files that are not part of the code
- distributed with modules, packages or tools. </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="1" name="Header">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="1" name="Name" type="xs:normalizedString">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The User interface name for this content.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Copyright" type="xs:string">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is only required if the Copyright is
- different from the Distribution Package Copyright. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="License" type="xs:string">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is only required if the License is
- different from the Distribution Package License. </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Abstract" type="xs:normalizedString"/>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Description">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"
- />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element minOccurs="0" maxOccurs="unbounded" name="Filename">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is the path and filename location within the ZIP file.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:anyURI">
- <xs:attribute name="Executable" type="xs:boolean" default="false" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> If true, used by installation tools to
- ensure that a file that must be executable has the correct properties to
- permit execution. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <!-- End of the Misc element. -->
-
- <xs:element name="UserExtensions">
- <xs:complexType mixed="true">
- <xs:sequence>
- <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="UserId" type="xs:NCName" use="required">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This is a single word identifier for grouping similar content.
- For example, ReferenceBuild might be used to identify non-PI compliant build steps, with two
- different UserExtensions sections, one with an Identifier of Prebuild, and another of PostBuild.
- Both UserExtensions sections would use the same UserId. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="Identifier" type="xs:string" use="optional">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This can be any string used to differentiate or identify this
- section from other UserExtensions sections. </xs:documentation>
- <xs:documentation xml:lang="en-us"> For example, a PRE_PROCESS Identifier might indicate specific
- steps and tools required before processing distribution package content, while a different
- UserExtensions section with a POST_PROCESS Identifier might describe steps that need to be
- executed after operations on this content. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:anyAttribute processContents="lax"/>
- </xs:complexType>
- </xs:element>
- <!-- The following elsements are common definitions used with the ref attribute for elements. -->
-
- <xs:element name="HelpText">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
-
- <!-- The following attribute groups are used in various elements above. -->
-
- <xs:attributeGroup name="SupportedArchMod">
- <xs:attribute name="SupArchList" type="ArchListType" use="optional"/>
- <xs:attribute name="SupModList" type="ModuleListType" use="optional"/>
- </xs:attributeGroup>
-
- <!-- The following data types are used to restrict content. -->
-
- <xs:simpleType name="ArchListType">
- <xs:list itemType="ArchTypes"/>
- </xs:simpleType>
-
- <xs:simpleType name="ArchTypes">
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="IA32"/>
- <xs:enumeration value="X64"/>
- <xs:enumeration value="IPF"/>
- <xs:enumeration value="EBC"/>
- <xs:enumeration value="ARM"/>
- <xs:pattern value="([A-Z])([a-zA-Z0-9])*">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Any processor architecture not listed above. The Architecture
- must be a target architecture of one or more compiler tool chains. </xs:documentation>
- </xs:annotation>
- </xs:pattern>
- </xs:restriction>
- </xs:simpleType>
-
-
- <xs:simpleType name="FamilyTypes">
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="MSFT"/>
- <xs:enumeration value="GCC"/>
- <xs:pattern value="[A-Z][a-zA-Z0-9]*">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Any other family of build utilities for which compiler tools
- exist. </xs:documentation>
- </xs:annotation>
- </xs:pattern>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="GuidListType">
- <xs:list itemType="GuidTypes"/>
- </xs:simpleType>
-
- <xs:simpleType name="GuidTypes">
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="Event"/>
- <xs:enumeration value="File"/>
- <xs:enumeration value="FV"/>
- <xs:enumeration value="GUID"/>
- <xs:enumeration value="Hii"/>
- <xs:enumeration value="HOB"/>
- <xs:enumeration value="SystemTable"/>
- <xs:enumeration value="TokenSpaceGuid"/>
- <xs:enumeration value="Variable"/>
- <xs:enumeration value="UNDEFINED"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="HexNumber">
- <xs:restriction base="xs:hexBinary">
- <xs:pattern value="0x([a-fA-F0-9])+"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="Md5Sum">
- <xs:restriction base="xs:normalizedString">
- <xs:pattern value="[a-zA-Z0-9]{32}"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="ModuleListType">
- <xs:list itemType="ModuleTypes"/>
- </xs:simpleType>
-
- <xs:simpleType name="ModuleTypes">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The following module types are defined by specifications. </xs:documentation>
- <xs:documentation xml:lang="en-us"> Module types for components and libraries defined for this distribution
- mechanism. </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="BASE ">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Use of this module is not restricted. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="DXE_CORE">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only applicable to the DXE core.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="DXE_DRIVER">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only applicable to a DXE driver.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="DXE_RUNTIME_DRIVER">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only applicable to a DXE runtime driver.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="DXE_SAL_DRIVER">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only applicable to an IPF DXE runtime driver.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="DXE_SMM_DRIVER">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only applicable to a DXE SMM driver.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="PEI_CORE">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only applicable to the PEI core.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="PEIM">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only valid for PEI modules. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SEC">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only applicable to Security phase.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="UEFI_DRIVER">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only valid for UEFI drivers. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="UEFI_RUNTIME_DRIVER">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only valid for UEFI runtime
- drivers.</xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="UEFI_APPLICATION">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only valid for UEFI applications.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="SMM_CORE">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This module is only applicable to the SMM
- core.</xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="USER_DEFINED">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This content is restricted to a specific implementation.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="UNDEFINED">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This enumeration is for use in a list that where the package
- creator does not know the what module types are supported by a module. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:pattern value="([A-Z])([a-zA-Z0-9])*">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This pattern has been added for use in a module lists - for
- future expansion. </xs:documentation>
- </xs:annotation>
- </xs:pattern>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="PcdDatumTypes">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The following data types are defined by the PCD specification (or PCD
- section of the UEFI/PI specifications.) </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:normalizedString">
- <xs:enumeration value="UINT8"/>
- <xs:enumeration value="UINT16"/>
- <xs:enumeration value="UINT32"/>
- <xs:enumeration value="UINT64"/>
- <xs:enumeration value="BOOLEAN"/>
- <xs:enumeration value="VOID*"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="PcdItemListType">
- <xs:list itemType="PcdItemTypes"/>
- </xs:simpleType>
-
- <xs:simpleType name="PcdItemTypes">
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="FeaturePcd">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The Feature PCD is a binary, evaluating to either true or false.
- This is used during build to include/exclude content. It can also be used during execution to
- force execution paths within drivers, or to enable/disable features within a driver for a given
- platform. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="FixedPcd">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The Fixed PCD is a #define value that is set at build time.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="PatchPcd">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The Patch PCD is a #define that is set at build time, and that
- can be modified within a binary file. Additional information, such as the offset location of the
- value, along with it's length may need to be provided.</xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="Pcd">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> This PCD type has an overloaded definition. Prior to build, the
- platform integrator may choose to implement a PCD as Fixed, Patchable or a Dynamic PCD. If the
- platform integrator choose to use the PCD as dynamic, then a PCD driver is required in the
- platform (PEI/DXE/both) to track the PCD in some sort of 'database' of these items. For Dynamic
- PCDs, the PcdGet* must pass in the token space guid and the token number to retrieve data
- (PcdSet* also needs these values.) </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="PcdEx">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The PCD can only be used as Dynamic, and the platform firmware
- must contain a driver to maintain a 'database' of these items. For Dynamic PCDs, the PcdGet*
- must pass in the token space guid and the token number to retrieve data (PcdSet* also needs
- these values.) </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="RegistryFormatGuid">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> A GUID must contain five different Hexadecimal character sets that are
- separated by a dash (-) character. </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:string">
- <xs:pattern value="\s*[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\s*"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="SupportedOs">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> The EDK II build system supports workstations running one of the
- following supported operating systems. This is the OS for the developer's workstation, not the target
- platform. </xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:string">
- <xs:enumeration value="Win32">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> For Windows 2003, Windows XP and Windows Vista.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="Win64">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> For Windows 2003, Windows XP and Windows Vista.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="Linux32"/>
- <xs:enumeration value="Linux64"/>
- <xs:enumeration value="OS/X32"/>
- <xs:enumeration value="OS/X64"/>
- <xs:enumeration value="GenericWin">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Typically, this is used for Windows Batch files.
- </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:enumeration value="GenericNix">
- <xs:annotation>
- <xs:documentation xml:lang="en-us"> Typically use for shell scripts - valid for any Linux and Mac
- OS/X. </xs:documentation>
- </xs:annotation>
- </xs:enumeration>
- <xs:pattern value="[a-zA-Z]([a-zA-Z0-9])*"/>
- </xs:restriction>
- </xs:simpleType>
-
-</xs:schema>
diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template
deleted file mode 100644
index 4a21aba854..0000000000
--- a/BaseTools/Conf/build_rule.template
+++ /dev/null
@@ -1,542 +0,0 @@
-#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
-# Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-## Syntax
-#
-# "*" is used to indicate that the source files will be processed at the same time.
-# "?" is used to indicate that the source files will be processed one by one.
-#
-# "[" <File-Type>[.<Build-Type>][.<Arch>][, <File-Type>[.<Build-Type>][.<Arch>]] "]" <EOL>
-# <InputFile[.<ToolChainFamily>]> <EOL>
-# (?|*).<File-Extension> [(\n|,) (?|*).<File-Extension>]
-#
-# <OutputFile[.<ToolChainFamily>]> <EOL>
-# <FileFullPath>
-#
-# <ExtraDependency>
-# <FileFullPath>
-#
-# <Command[.<ToolChainFamily>]> <EOL>
-# <Command1>
-# [<Command2>]
-#
-# <Build-Type> is the MODULE_TYPE in EDK2 or COMPONENT_TYPE in EDK.
-# Missing <InputFile> will cause an exception and break build.
-# Missing <Command> will cause that related build target won't be generated but
-# won't break build.
-#
-
-## Placeholders for string substitution
-#
-# ${src} Source file(s) to be built (full path)
-# ${s_path} Source file directory (absolute path)
-# ${s_dir} Source file relative directory within a module
-# (Note: ${s_dir} is always equals to "." if source file is given in absolute path.)
-# ${s_name} Source file name without path
-# ${s_base} Source file name without extension and path
-# ${s_ext} Source file extension
-#
-# ${dst} Destination file(s) built from ${src} (full path)
-# ${d_path} Destination file directory (absolute path)
-# ${d_name} Destination file name without path
-# ${d_base} Destination file name without extension and path
-# ${d_ext} Destination file extension
-#
-# (+) Directory separator
-#
-
-## Macro
-# $(WORKSPACE) Workspace directory
-# $(OUTPUT_DIR) Directory for intermediate files for building a module
-# $(DEBUG_DIR) Directory for files used to debug a module
-# $(BUILD_DIR) All files for building a platform will be put in this directory
-# $(BIN_DIR) Common directory for executable files
-# $(FV_DIR) Directory to store flash image files
-# $(INC) Search path of current module
-# $(INC_LIST) A file containing search pathes of current module
-# $(LIBS) Static library files of current module
-# $(<tool>_FLAGS) Tools flags of current module
-# $(MODULE_NAME) Current module name
-# $(MODULE_TYPE) Current module type
-# $(MODULE_GUID) Current module guid
-# $(ARCH) Architecture of current module
-# $(TOOLCHAIN) Toolchain used to build current module
-# $(TARGET) Target of current module (DEBUG/RELEASE)
-# $(<tool>) Path of tool
-# $(EDK_TOOLS_PATH) Path of build tools
-# $(<FILE_TYPES>) File list of each file type
-# (Note: The macro name is derived from file type name. For example,
-# C-Code-File will have C_CODE_FILES macro.)
-# $(<FILE_TYPES_LIST>) Macro point to a file containing list of files of a file type
-# (
-# Note: The macro and file name are derived from file type name.
-# For example, C-Code-File will have C_CODE_FILES_LIST macro pointing
-# to $(OUTPUT_DIR)/c_code_files.lst. The list file and macro name
-# will be generated only when this macro is used in command line.
-# This is intended to get over the long command line limitation.
-# )
-#
-# $(CP) copy command
-# $(MV) move command
-# $(RM) delete command
-# $(MD) create dir command
-# $(RD) remove dir command
-#
-
-## Reserved File-Type
-#
-# Don't change following names of file types and their associated files,
-# which are also used in tools' code
-#
-# C-Code-File
-# C-Header-File
-# Dynamic-Library-File
-# Static-Library-File
-# Visual-Form-Representation-File
-# Unicode-Text-File
-#
-
-## Build Rule Version Number
-# build_rule_version=0.1
-#
-
-[C-Code-File]
- <InputFile>
- ?.c
- ?.C
- ?.cc
- ?.CC
- ?.cpp
- ?.Cpp
- ?.CPP
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <OutputFile>
- $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
-
- <Command.MSFT, Command.INTEL>
- "$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src}
-
- <Command.GCC, Command.RVCT>
- # For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues
- "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src}
- "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst}
-
- <Command.ARMGCC, Command.ARMLINUXGCC>
- "$(CC)" $(CC_FLAGS) -o ${dst} $(INC) ${src}
-
-
-[C-Header-File]
- <InputFile>
- *.h, *.H
-
- <OutputFile>
-
- <Command>
-
-
-[Assembly-Code-File.COMMON.COMMON]
- <InputFile.MSFT, InputFile.INTEL, InputFile.RVCT>
- ?.asm, ?.Asm, ?.ASM
-
- <InputFile.GCC>
- ?.S, ?.s
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <OutputFile>
- $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
-
- <Command.MSFT, Command.INTEL>
- "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
- Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
- "$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iii
-
- <Command.GCC, Command.RVCT>
- "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
- Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
- # For RVCTCYGWIN ASM_FLAGS must be first to work around pathing issues
- "$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iii
-
-[Assembly-Code-File.COMMON.IPF]
- <InputFile>
- ?.s
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <OutputFile>
- $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
-
- <Command.MSFT, Command.INTEL>
- "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
- Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
- # For RVCTCYGWIN ASM_FLAGS must be first to work around pathing issues
- "$(ASM)" $(ASM_FLAGS) -o ${dst} ${d_path}(+)${s_base}.iii
-
-[Visual-Form-Representation-File]
- <InputFile>
- ?.vfr
- ?.Vfr
- ?.VFR
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <OutputFile>
- $(DEBUG_DIR)(+)${s_dir}(+)${s_base}.c
-
- <Command>
- "$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_base}.i
- "$(VFR)" $(VFR_FLAGS) --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_base}.i
-
-[Object-File]
- <InputFile>
- *.obj
- *.o
-
- <OutputFile>
- $(OUTPUT_DIR)(+)$(MODULE_NAME).lib
-
- <Command.MSFT, Command.INTEL>
- "$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} @$(OBJECT_FILES_LIST)
-
- <Command.GCC>
- "$(SLINK)" -cr ${dst} $(SLINK_FLAGS) @$(OBJECT_FILES_LIST)
-
- <Command.RVCT>
- "$(SLINK)" $(SLINK_FLAGS) ${dst} --via $(OBJECT_FILES_LIST)
-
- <Command.RVCTCYGWIN, Command.ARMGCC, Command.ARMLINUXGCC>
- # $(OBJECT_FILES_LIST) has wrong paths for cygwin
- "$(SLINK)" $(SLINK_FLAGS) ${dst} $(OBJECT_FILES)
-
- <Command.XCODE>
- "$(SLINK)" $(SLINK_FLAGS) ${dst} -filelist $(OBJECT_FILES_LIST)
-
-[Static-Library-File]
- <InputFile>
- *.lib
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <OutputFile>
- $(DEBUG_DIR)(+)$(MODULE_NAME).dll
-
- <Command.MSFT, Command.INTEL>
- "$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST)
-
- <Command.GCC>
- "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) -\) $(DLINK2_FLAGS)
- "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst}
-
- <Command.ARMGCC, Command.ARMLINUXGCC>
- "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) -\) $(DLINK2_FLAGS)
-
- <Command.RVCT>
- "$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) --via $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)
-
- <Command.RVCTCYGWIN>
- #$(STATIC_LIBRARY_FILES_LIST) has wrong paths for cygwin
- "$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) $(DLINK2_FLAGS)
-
- <Command.XCODE>
- "$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) -filelist $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)
-
-
-[Static-Library-File.USER_DEFINED]
- <InputFile>
- *.lib
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <OutputFile>
- $(DEBUG_DIR)(+)$(MODULE_NAME)
-
- <Command.MSFT, Command.INTEL>
- "$(DLINK)" $(DLINK_FLAGS) $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST)
-
- <Command.GCC>
- "$(DLINK)" $(DLINK_FLAGS) -\( $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) -\) $(DLINK2_FLAGS)
-
- <Command.ARMGCC, Command.ARMLINUXGCC>
- "$(DLINK)" $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) -\) $(DLINK2_FLAGS)
-
- <Command.RVCT>
- "$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) --via $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)
-
- <Command.RVCTCYGWIN>
- #$(STATIC_LIBRARY_FILES_LIST) has the wrong paths for cygwin
- "$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) $(DLINK2_FLAGS)
-
- <Command.XCODE>
- "$(DLINK)" -o ${dst} $(DLINK_FLAGS) $(DLINK_SPATH) -filelist $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)
-
-
-[Dynamic-Library-File]
- <InputFile>
- ?.dll
-
- <OutputFile>
- $(DEBUG_DIR)(+)$(MODULE_NAME).efi
-
- <Command.MSFT, Command.INTEL, Command.RVCT, Command.ARMGCC, Command.ARMLINUXGCC>
- "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
- $(CP) ${dst} $(OUTPUT_DIR)
- $(CP) ${dst} $(BIN_DIR)
- -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
-
- <Command.GCC>
- $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug
- $(OBJCOPY) --strip-unneeded -R .eh_frame ${src}
-
- #
- #The below 2 lines are only needed for UNIXGCC tool chain, which genereates PE image directly
- #
- -$(OBJCOPY) $(OBJCOPY_ADDDEBUGFLAG) ${src}
- -$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).debug $(BIN_DIR)
-
- "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
- $(CP) ${dst} $(OUTPUT_DIR)
- $(CP) ${dst} $(BIN_DIR)
- -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
-
- <Command.XCODE>
- # tool to convert Mach-O to PE/COFF
- "$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff
- # create symbol file for GDB debug
- -$(DSYMUTIL) ${src}
- "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff $(GENFW_FLAGS)
- $(CP) ${dst} $(OUTPUT_DIR)
- $(CP) ${dst} $(BIN_DIR)
- -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
-
-[Dependency-Expression-File]
- <InputFile>
- ?.dxs, ?.Dxs, ?.DXS
-
- <OutputFile>
- $(OUTPUT_DIR)(+)$(MODULE_NAME).depex
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <Command>
- "$(PP)" $(APP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
- Trim --source-code -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
- GenDepex -t $(MODULE_TYPE) -o ${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
-
-[Acpi-Source-Language-File]
- <InputFile>
- ?.asl, ?.Asl, ?.ASL
-
- <OutputFile>
- $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.aml
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <Command.MSFT, Command.INTEL>
- Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i -i $(INC_LIST) ${src}
- "$(ASLPP)" $(ASLPP_FLAGS) $(INC) /I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
- Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
- "$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii
-
- <Command.GCC>
- Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i -i $(INC_LIST) ${src}
- "$(ASLPP)" $(ASLPP_FLAGS) $(INC) -I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
- "$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
-
-[C-Code-File.AcpiTable]
- <InputFile>
- ?.c
-
- <OutputFile>
- $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.acpi
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <Command.MSFT, Command.INTEL>
- "$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASLCC_FLAGS) $(INC) ${src}
- "$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
- "$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
-
- <Command.GCC>
- "$(ASLCC)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
- "$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
- "$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
-
-[Acpi-Table-Code-File]
- <InputFile>
- ?.aslc, ?.act
-
- <OutputFile>
- $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.acpi
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <Command.MSFT, Command.INTEL>
- "$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASLCC_FLAGS) $(INC) ${src}
- "$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
- "$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
-
- <Command.GCC>
- "$(ASLCC)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
- "$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
- "$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
-
- <Command.XCODE>
- "$(ASLCC)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASLCC_FLAGS) $(INC) ${src}
- "$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
- "$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.efi
- "$(GENFW)" -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.efi $(GENFW_FLAGS)
-
-
-[Masm16-Code-File]
- <InputFile>
- ?.asm16, ?.Asm16, ?.ASM16
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <OutputFile>
- $(OUTPUT_DIR)(+)${s_base}.com
-
- <Command.MSFT, Command.INTEL>
- "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
- Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
- cd $(OUTPUT_DIR)(+)${s_dir}
- "$(ASM16)" /nologo /c /omf $(INC) /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${d_path}(+)${s_base}.iii
- "$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,
-
- <Command.GCC>
- "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
- Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
- "$(ASM)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii
- "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj -\)
-
- <Command.XCODE>
- "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
- Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
- "$(ASM)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii
- "$(SLINK)" $(SLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.slib $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
- otool -t $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.slib | hex2bin.py ${dst}
-
-
-[Microcode-File.USER_DEFINED, Microcode-File.Microcode]
- <InputFile>
- ?.txt, ?.TXT, ?.Txt, ?.mut, ?.inc
-
- <OutputFile>
- $(OUTPUT_DIR)(+)${s_base}.mcb
-
- <Command>
- "$(GENFW)" -o ${dst} -m ${src} $(GENFW_FLAGS)
-
-[Microcode-Binary-File]
- <InputFile>
- *.mcb
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <OutputFile>
- $(OUTPUT_DIR)(+)$(MODULE_NAME).bin
-
- <Command>
- "$(GENFW)" -o ${dst} -j $(MICROCODE_BINARY_FILES) $(GENFW_FLAGS)
- -$(CP) ${dst} $(BIN_DIR)
-
-[EFI-Image-File]
- <InputFile>
- ?.efi, ?.Efi, ?.EFI
-
- <OutputFile>
-
- <Command>
-
-[Unicode-Text-File]
- <InputFile>
- *.uni, *.Uni, *.UNI
-
- <OutputFile>
- $(DEBUG_DIR)(+)AutoGen.c
- $(DEBUG_DIR)(+)$(MODULE_NAME)StrDefs.h
- $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk
-
- <Command>
-
-[Efi-Image.UEFI_OPTIONROM]
- <InputFile>
- ?.efi, ?.EFI, ?.Efi
-
- <OutputFile>
- $(BIN_DIR)(+)$(MODULE_NAME).rom
-
- <Command>
- $(OPTROM) -i $(PCI_DEVICE_ID) -f $(PCI_VENDOR_ID) -l $(PCI_CLASS_CODE) -r $(PCI_REVISION) -o $dst $(OPTROM_FLAGS) $src
-
-[Unicode-Text-File.UEFI_HII]
- <InputFile>
- *.uni, *.Uni, *.UNI
-
- <OutputFile>
- $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk
- $(DEBUG_DIR)(+)$(MODULE_NAME)StrDefs.h
-
- <Command>
-
-[Visual-Form-Representation-File.UEFI_HII]
- <InputFile>
- ?.vfr
- ?.Vfr
- ?.VFR
-
- <ExtraDependency>
- $(MAKE_FILE)
-
- <OutputFile>
- $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.hpk
-
- <Command>
- "$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
- "$(VFR)" $(VFR_FLAGS) --create-ifr-package --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory $(OUTPUT_DIR)(+)${s_dir} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
-
-[Hii-Binary-Package.UEFI_HII]
- <InputFile>
- *.hpk
-
- <OutputFile.MSFT, OutputFile.INTEL, OutputFile.GCC>
- $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.lib
-
- <OutputFile.XCODE, OutputFile.RVCT, OutputFile.ARMGCC>
- $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc
-
- <Command.MSFT, Command.INTEL>
- "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiipackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS)
- "$(RC)" /Fo${dst} $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc
-
- <Command.GCC>
- "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS)
- "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc ${dst}
-
- <Command.XCODE, Command.RVCT, Command.ARMGCC, Command.ARMLINUXGCC>
- GenFw -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES)
-
-
diff --git a/BaseTools/Conf/target.template b/BaseTools/Conf/target.template
deleted file mode 100644
index 787fc64fb1..0000000000
--- a/BaseTools/Conf/target.template
+++ /dev/null
@@ -1,72 +0,0 @@
-#
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-# ALL Paths are Relative to WORKSPACE
-
-# Separate multiple LIST entries with a SINGLE SPACE character, do not use comma characters.
-# Un-set an option by either commenting out the line, or not setting a value.
-
-#
-# PROPERTY Type Use Description
-# ---------------- -------- -------- -----------------------------------------------------------
-# ACTIVE_PLATFORM Filename Recommended Specify the WORKSPACE relative Path and Filename
-# of the platform description file that will be used for the
-# build. This line is required if and only if the current
-# working directory does not contain one or more description
-# files.
-ACTIVE_PLATFORM = Nt32Pkg/Nt32Pkg.dsc
-
-# TARGET List Optional Zero or more of the following: DEBUG, RELEASE, NOOPT
-# UserDefined; separated by a space character.
-# If the line is missing or no value is specified, all
-# valid targets specified in the platform description file
-# will attempt to be built. The following line will build
-# DEBUG platform target.
-TARGET = DEBUG
-
-# TARGET_ARCH List Optional What kind of architecture is the binary being target for.
-# One, or more, of the following, IA32, IPF, X64, EBC, ARM
-# or AArch64.
-# Multiple values can be specified on a single line, using
-# space charaters to separate the values. These are used
-# during the parsing of a platform description file,
-# restricting the build output target(s.)
-# The Build Target ARCH is determined by (precedence high to low):
-# Command-line: -a ARCH option
-# target.txt: TARGET_ARCH values
-# DSC file: [Defines] SUPPORTED_ARCHITECTURES tag
-# If not specified, then all valid architectures specified
-# in the platform file, for which tools are available, will be
-# built.
-TARGET_ARCH = IA32
-
-# TOOL_DEFINITION_FILE Filename Optional Specify the name of the filename to use for specifying
-# the tools to use for the build. If not specified,
-# WORKSPACE/Conf/tools_def.txt will be used for the build.
-TOOL_CHAIN_CONF = Conf/tools_def.txt
-
-# TAGNAME List Optional Specify the name(s) of the tools_def.txt TagName to use.
-# If not specified, all applicable TagName tools will be
-# used for the build. The list uses space character separation.
-TOOL_CHAIN_TAG = MYTOOLS
-
-# MAX_CONCURRENT_THREAD_NUMBER NUMBER Optional The number of concurrent threads. Recommend to set this
-# value to one more than the number of your compurter
-# cores or CPUs. Less than 2 means disable multithread build.
-MAX_CONCURRENT_THREAD_NUMBER = 1
-
-
-# BUILD_RULE_CONF Filename Optional Specify the file name to use for the build rules that are followed
-# when generating Makefiles. If not specified, the file:
-# WORKSPACE/Conf/build_rule.txt will be used
-BUILD_RULE_CONF = Conf/build_rule.txt
-
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
deleted file mode 100644
index 06e7d6596a..0000000000
--- a/BaseTools/Conf/tools_def.template
+++ /dev/null
@@ -1,5764 +0,0 @@
-#
-# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-IDENTIFIER = Default TOOL_CHAIN_CONF
-
-# common path macros
-DEFINE VS2003_BIN = C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin
-DEFINE VS2003_DLL = C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE
-
-DEFINE VS2005_BIN = C:\Program Files\Microsoft Visual Studio 8\Vc\bin
-DEFINE VS2005_DLL = C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;DEF(VS2005_BIN)
-DEFINE VS2005_BINX64 = C:\Program Files\Microsoft Visual Studio 8\Vc\bin\x86_amd64
-DEFINE VS2005_BIN64 = C:\Program Files\Microsoft Visual Studio 8\Vc\bin\x86_ia64
-
-DEFINE VS2005x86_BIN = C:\Program Files (x86)\Microsoft Visual Studio 8\Vc\bin
-DEFINE VS2005x86_DLL = C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE;DEF(VS2005x86_BIN)
-DEFINE VS2005x86_BINX64 = DEF(VS2005x86_BIN)\x86_amd64
-DEFINE VS2005x86_BIN64 = DEF(VS2005x86_BIN)\x86_ia64
-
-DEFINE VS2008_BIN = C:\Program Files\Microsoft Visual Studio 9.0\Vc\bin
-DEFINE VS2008_DLL = C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;DEF(VS2008_BIN)
-DEFINE VS2008_BINX64 = DEF(VS2008_BIN)\x86_amd64
-DEFINE VS2008_BIN64 = DEF(VS2008_BIN)\x86_ia64
-
-DEFINE VS2008x86_BIN = C:\Program Files (x86)\Microsoft Visual Studio 9.0\Vc\bin
-DEFINE VS2008x86_DLL = C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;DEF(VS2008x86_BIN)
-DEFINE VS2008x86_BINX64 = DEF(VS2008x86_BIN)\x86_amd64
-DEFINE VS2008x86_BIN64 = DEF(VS2008x86_BIN)\x86_ia64
-
-DEFINE VS2010_BIN = C:\Program Files\Microsoft Visual Studio 10.0\Vc\bin
-DEFINE VS2010_DLL = C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE;DEF(VS2010_BIN)
-DEFINE VS2010_BINX64 = DEF(VS2010_BIN)\x86_amd64
-DEFINE VS2010_BIN64 = DEF(VS2010_BIN)\x86_ia64
-
-DEFINE VS2010x86_BIN = C:\Program Files (x86)\Microsoft Visual Studio 10.0\Vc\bin
-DEFINE VS2010x86_DLL = C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;DEF(VS2010x86_BIN)
-DEFINE VS2010x86_BINX64 = DEF(VS2010x86_BIN)\x86_amd64
-DEFINE VS2010x86_BIN64 = DEF(VS2010x86_BIN)\x86_ia64
-
-DEFINE VS2012_BIN = C:\Program Files\Microsoft Visual Studio 11.0\Vc\bin
-DEFINE VS2012_DLL = C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE;DEF(VS2012_BIN)
-DEFINE VS2012_BINX64 = DEF(VS2012_BIN)\x86_amd64
-
-DEFINE VS2012x86_BIN = C:\Program Files (x86)\Microsoft Visual Studio 11.0\Vc\bin
-DEFINE VS2012x86_DLL = C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE;DEF(VS2012x86_BIN)
-DEFINE VS2012x86_BINX64 = DEF(VS2012x86_BIN)\x86_amd64
-
-DEFINE WINSDK_VERSION = v6.0A
-DEFINE WINSDK_BIN = c:\Program Files\Microsoft SDKs\Windows\DEF(WINSDK_VERSION)\bin
-DEFINE WINSDKx86_BIN = c:\Program Files (x86)\Microsoft SDKs\Windows\DEF(WINSDK_VERSION)\bin
-
-# These defines are needed for certain Microsoft Visual Studio tools that
-# are used by other toolchains. An example is that ICC on Windows normally
-# uses Microsoft's nmake.exe.
-
-# Some MS_VS_BIN options: DEF(VS2003_BIN), DEF(VS2005_BIN), DEF(VS2005x86_BIN), DEF(VS2008_BIN), DEF(VS2008x86_BIN)
-DEFINE MS_VS_BIN = DEF(VS2005_BIN)
-# Some MS_VS_DLL options: DEF(VS2003_DLL), DEF(VS2005_DLL), DEF(VS2005x86_DLL), DEF(VS2008_DLL), DEF(VS2008x86_DLL)
-DEFINE MS_VS_DLL = DEF(VS2005_DLL)
-
-DEFINE WINDDK_BIN16 = C:\WINDDK\3790.1830\bin\bin16
-DEFINE WINDDK_BIN32 = C:\WINDDK\3790.1830\bin\x86
-DEFINE WINDDK_BINX64 = C:\WINDDK\3790.1830\bin\win64\x86\amd64
-DEFINE WINDDK_BIN64 = C:\WINDDK\3790.1830\bin\win64\x86
-
-# NOTE: The Intel C++ Compiler for Windows requires one of the Microsoft C compiler
-# tool chains for the linker and nmake commands.
-# This configuration assumes a Windows 2003 Server DDK installation.
-DEFINE ICC_VERSION = 9.1
-#DEFINE ICC_VERSION = 10.1.021
-DEFINE ICC_BIN32 = C:\Program Files\Intel\Compiler\C++\DEF(ICC_VERSION)\IA32\Bin
-DEFINE ICC_ASM32 = C:\Program Files\Intel\Compiler\C++\DEF(ICC_VERSION)\IA32\Bin
-DEFINE ICC_BIN32x86 = C:\Program Files (x86)\Intel\Compiler\C++\DEF(ICC_VERSION)\IA32\Bin
-DEFINE ICC_ASM32x86 = C:\Program Files (x86)\Intel\Compiler\C++\DEF(ICC_VERSION)\IA32\Bin
-
-DEFINE ICC_BINX64 = C:\Program Files\Intel\Compiler\C++\DEF(ICC_VERSION)\EM64T\Bin
-DEFINE ICC_ASMX64 = C:\Program Files\Intel\Compiler\C++\DEF(ICC_VERSION)\EM64T\Bin
-DEFINE ICC_BINX64x86 = C:\Program Files (x86)\Intel\Compiler\C++\DEF(ICC_VERSION)\EM64T\Bin
-DEFINE ICC_ASMX64x86 = C:\Program Files (x86)\Intel\Compiler\C++\DEF(ICC_VERSION)\EM64T\Bin
-
-DEFINE ICC_BIN64 = C:\Program Files\Intel\Compiler\C++\DEF(ICC_VERSION)\Itanium\Bin
-DEFINE ICC_BIN64x86 = C:\Program Files (x86)\Intel\Compiler\C++\DEF(ICC_VERSION)\Itanium\Bin
-
-
-# Note: The Intel C++ Compiler 11.1 uses different installation path from previous versions
-# We use "ICC11" tag for ICC 11.1 while "ICC" tag is dedicated for eariler versions
-#
-DEFINE ICC11_VERSION = 11.1
-DEFINE ICC11_BUILD = 072
-DEFINE ICC11_BIN32 = C:\Program Files\Intel\Compiler\DEF(ICC11_VERSION)\DEF(ICC11_BUILD)\bin\ia32
-DEFINE ICC11_ASM32 = C:\Program Files\Intel\Compiler\DEF(ICC11_VERSION)\DEF(ICC11_BUILD)\bin\ia32
-DEFINE ICC11_BIN32x86 = C:\Program Files (x86)\Intel\Compiler\DEF(ICC11_VERSION)\DEF(ICC11_BUILD)\bin\ia32
-DEFINE ICC11_ASM32x86 = C:\Program Files (x86)\Intel\Compiler\DEF(ICC11_VERSION)\DEF(ICC11_BUILD)\bin\ia32
-
-DEFINE ICC11_BINX64 = C:\Program Files\Intel\Compiler\DEF(ICC11_VERSION)\DEF(ICC11_BUILD)\bin\ia32_intel64
-DEFINE ICC11_ASMX64 = C:\Program Files\Intel\Compiler\DEF(ICC11_VERSION)\DEF(ICC11_BUILD)\bin\ia32_intel64
-DEFINE ICC11_BINX64x86 = C:\Program Files (x86)\Intel\Compiler\DEF(ICC11_VERSION)\DEF(ICC11_BUILD)\bin\intel64
-DEFINE ICC11_ASMX64x86 = C:\Program Files (x86)\Intel\Compiler\DEF(ICC11_VERSION)\DEF(ICC11_BUILD)\bin\intel64
-
-DEFINE ICC11_BIN64 = C:\Program Files\Intel\Compiler\DEF(ICC11_VERSION)\DEF(ICC11_BUILD)\bin\ia32_ia64
-DEFINE ICC11_BIN64x86 = C:\Program Files (x86)\Intel\Compiler\DEF(ICC11_VERSION)\DEF(ICC11_BUILD)\bin\ia32_ia64
-
-DEFINE EBC_BIN = C:\Program Files\Intel\EBC\Bin
-DEFINE EBC_BINx86 = C:\Program Files (x86)\Intel\EBC\Bin
-
-DEFINE ELFGCC_BIN = /usr/bin
-
-#
-# Option 1: Hard coded full path to compiler suite
-DEFINE UNIXGCC_IA32_PETOOLS_PREFIX = /opt/tiano/i386-tiano-pe/i386-tiano-pe/bin/
-DEFINE UNIXGCC_X64_PETOOLS_PREFIX = /opt/tiano/x86_64-pc-mingw64/x86_64-pc-mingw64/bin/
-DEFINE UNIXGCC_IPF_PETOOLS_PREFIX = /opt/tiano/ia64-pc-elf/ia64-pc-elf/bin/
-#
-# Option 2: Use an environment variable
-#DEFINE UNIXGCC_IA32_PETOOLS_PREFIX = ENV(IA32_PETOOLS_PREFIX)
-#DEFINE UNIXGCC_X64_PETOOLS_PREFIX = ENV(X64_PETOOLS_PREFIX)
-#
-# Option 3: Install the compiler suite into your default paths
-#DEFINE UNIXGCC_IA32_PETOOLS_PREFIX = i386-pc-mingw32-
-#DEFINE UNIXGCC_X64_PETOOLS_PREFIX = x86_64-pc-mingw32-
-#
-# Option 4: Create links under the BaseTools/Bin/gcc/ARCH directory
-# Links needed: gcc, ar & ld
-#DEFINE UNIXGCC_IA32_PETOOLS_PREFIX = ENV(WORKSPACE)/BaseTools/Bin/gcc/Ia32/
-#DEFINE UNIXGCC_X64_PETOOLS_PREFIX = ENV(WORKSPACE)/BaseTools/Bin/gcc/X64/
-#
-# Option 5: Install programs under user's home directory
-#DEFINE UNIXGCC_IA32_PETOOLS_PREFIX = ENV(HOME)/programs/gcc/ia32/bin/i686-pc-mingw32-
-#DEFINE UNIXGCC_X64_PETOOLS_PREFIX = ENV(HOME)/programs/gcc/x64/bin/x86_64-pc-mingw32-
-#
-
-DEFINE CYGWIN_BIN = c:/cygwin/bin
-DEFINE CYGWIN_BINIA32 = c:/cygwin/opt/tiano/i386-tiano-pe/i386-tiano-pe/bin/
-DEFINE CYGWIN_BINX64 = c:/cygwin/opt/tiano/x86_64-pc-mingw64/x86_64-pc-mingw64/bin/
-DEFINE CYGWIN_BINIPF = c:/cygwin/opt/tiano/gcc/ipf/bin/ia64-pc-elf-
-
-DEFINE GCC44_IA32_PREFIX = /usr/bin/
-#DEFINE GCC44_IA32_PREFIX = ENV(HOME)/programs/gcc/4.4/ia32/
-DEFINE GCC44_X64_PREFIX = /usr/bin/
-#DEFINE GCC44_X64_PREFIX = ENV(HOME)/programs/gcc/4.4/x64/
-
-DEFINE GCC45_IA32_PREFIX = /usr/bin/
-DEFINE GCC45_X64_PREFIX = /usr/bin/
-
-DEFINE GCC46_IA32_PREFIX = /usr/bin/
-DEFINE GCC46_X64_PREFIX = /usr/bin/
-
-DEFINE GCC47_IA32_PREFIX = /usr/bin/
-DEFINE GCC47_X64_PREFIX = /usr/bin/
-
-DEFINE UNIX_IASL_BIN = /usr/bin/iasl
-#DEFINE UNIX_IASL_BIN = $(HOME)/programs/iasl
-DEFINE WIN_ASL_BIN_DIR = C:\ASL
-DEFINE WIN_IASL_BIN = DEF(WIN_ASL_BIN_DIR)\iasl.exe
-DEFINE WIN_ASL_BIN = DEF(WIN_ASL_BIN_DIR)\asl.exe
-
-DEFINE IASL_FLAGS =
-DEFINE IASL_OUTFLAGS = -p
-DEFINE MS_ASL_OUTFLAGS = /Fo=
-DEFINE MS_ASL_FLAGS =
-
-DEFINE DEFAULT_WIN_ASL_BIN = DEF(WIN_IASL_BIN)
-DEFINE DEFAULT_WIN_ASL_FLAGS = DEF(IASL_FLAGS)
-DEFINE DEFAULT_WIN_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-#DEFINE DEFAULT_WIN_ASL_BIN = DEF(WIN_ASL_BIN)
-#DEFINE DEFAULT_WIN_ASL_FLAGS = DEF(MS_ASL_FLAGS)
-#DEFINE DEFAULT_WIN_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-
-DEFINE MSFT_ASLPP_FLAGS = /nologo /E /C /FIAutoGen.h
-DEFINE MSFT_ASLCC_FLAGS = /nologo /c /FIAutoGen.h /TC /Dmain=ReferenceAcpiTable
-DEFINE MSFT_ASLDLINK_FLAGS = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE
-
-DEFINE ICC_WIN_ASLPP_FLAGS = /nologo /E /C /FIAutoGen.h
-DEFINE ICC_WIN_ASLCC_FLAGS = /nologo /c /FIAutoGen.h /TC /Dmain=ReferenceAcpiTable
-DEFINE ICC_WIN_ASLDLINK_FLAGS = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libmmt /NODEFAULTLIB:libirc
-
-DEFINE IPHONE_TOOLS = /Developer/Platforms/iPhoneOS.platform/Developer
-
-DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G++ Lite/bin
-
-#
-# Change to the location clang was built
-#
-DEFINE CLANG_BIN = /usr/bin/
-
-####################################################################################
-#
-# format: TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE = <string>
-# priority:
-# TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE (Highest)
-# ******_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE
-# TARGET_*********_ARCH_COMMANDTYPE_ATTRIBUTE
-# ******_*********_ARCH_COMMANDTYPE_ATTRIBUTE
-# TARGET_TOOLCHAIN_****_COMMANDTYPE_ATTRIBUTE
-# ******_TOOLCHAIN_****_COMMANDTYPE_ATTRIBUTE
-# TARGET_*********_****_COMMANDTYPE_ATTRIBUTE
-# ******_*********_****_COMMANDTYPE_ATTRIBUTE
-# TARGET_TOOLCHAIN_ARCH_***********_ATTRIBUTE
-# ******_TOOLCHAIN_ARCH_***********_ATTRIBUTE
-# TARGET_*********_ARCH_***********_ATTRIBUTE
-# ******_*********_ARCH_***********_ATTRIBUTE
-# TARGET_TOOLCHAIN_****_***********_ATTRIBUTE
-# ******_TOOLCHAIN_****_***********_ATTRIBUTE
-# TARGET_*********_****_***********_ATTRIBUTE
-# ******_*********_****_***********_ATTRIBUTE (Lowest)
-#
-####################################################################################
-####################################################################################
-#
-# Supported Tool Chains
-# =====================
-# VS2003 -win32- Requires:
-# Microsoft Visual Studio .NET 2003
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# VS2005 -win32- Requires:
-# Microsoft Visual Studio 2005 Team Suite Edition
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# VS2008 -win32- Requires:
-# Microsoft Visual Studio 2008 Team Suite Edition
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# VS2010 -win32- Requires:
-# Microsoft Visual Studio 2010 Premium Edition
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# VS2012 -win32- Requires:
-# Microsoft Visual Studio 2012 Professional Edition
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# DDK3790 -win32- Requires:
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# UNIXGCC -UNIX- Requires:
-# GCC 4.3.0
-# binutils 2.20.51.0.5
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# GCC44 -Linux- Requires:
-# GCC 4.4 (Native)
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# GCC45 -Linux- Requires:
-# GCC 4.5 (Native)
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# GCC46 -Linux- Requires:
-# GCC 4.6 (Native)
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# GCC47 -Linux- Requires:
-# GCC 4.7 (Native)
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# ELFGCC -Linux- Requires:
-# GCC(this tool chain uses whatever version of gcc and binutils that is installed in /usr/bin)
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# CYGGCC -win32- Requires:
-# CygWin, GCC 4.3.0, binutils 2.20.51.0.5
-# Microsoft Visual Studio 2005 or 2008
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# ICC -win32- Requires:
-# Intel C Compiler V9.1
-# Dependencies:
-# Microsoft Visual Studio 2003 or 2005
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK)
-# version 3790.1830 for X64 target architectures
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# ICC11 -win32- Requires:
-# Intel C Compiler V11.1
-# Dependencies:
-# Microsoft Visual Studio 2005 or 2008
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK)
-# version 3790.1830 for X64 target architectures
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# MYTOOLS -win32- Requires:
-# Microsoft Visual Studio 2008 for IA32/X64
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830 for IPF
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# VS2003xASL -win32- Requires:
-# Microsoft Visual Studio .NET 2003
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# VS2005xASL -win32- Requires:
-# Microsoft Visual Studio 2005 Team Suite Edition
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# VS2008xASL -win32- Requires:
-# Microsoft Visual Studio 2008 Team Suite
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# VS2010xASL -win32- Requires:
-# Microsoft Visual Studio 2010 Premium Edition
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# VS2012xASL -win32- Requires:
-# Microsoft Visual Studio 2012 Professional Edition
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# DDK3790xASL -win32- Requires:
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# CYGGCCxASL -win32- Requires:
-# CygWin, GCC 4.3.0, binutils 2.20.51.0.5
-# Microsoft Visual Studio 2005 or 2008
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# ICCxASL -win32- Requires:
-# Intel C Compiler V9.1
-# Dependencies:
-# Microsoft Visual Studio 2003 or 2005
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK)
-# version 3790.1830 for X64 target architectures
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# ICC11xASL -win32- Requires:
-# Intel C Compiler V11.1
-# Dependencies:
-# Microsoft Visual Studio 2005 or 2008
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK)
-# version 3790.1830 for X64 target architectures
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# VS2005x86 -win64- Requires:
-# Microsoft Visual Studio 2005 Team Suite Edition (x86)
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# VS2008x86 -win64- Requires:
-# Microsoft Visual Studio 2008 (x86)
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# VS2010x86 -win64- Requires:
-# Microsoft Visual Studio 2010 (x86) Premium Edition
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# VS2012x86 -win64- Requires:
-# Microsoft Visual Studio 2012 (x86) Professional Edition
-# Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# ICCx86 -win64- Requires:
-# Intel C Compiler V9.1(x86)
-# Dependencies:
-# Microsoft Visual Studio 2003 or 2005
-# Microsoft Windows Server 2003 Driver Development Kit
-# (Microsoft WINDDK) version 3790.1830 for X64 target architectures
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# ICC11x86 -win64- Requires:
-# Intel C Compiler V11.1(x86)
-# Dependencies:
-# Microsoft Visual Studio 2005 or 2008
-# Microsoft Windows Server 2003 Driver Development Kit
-# (Microsoft WINDDK) version 3790.1830 for X64 target architectures
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# VS2005x86xASL -win64- Requires:
-# Microsoft Visual Studio 2005 Team Suite Edition (x86)
-# Microsoft Windows Server 2003 Driver Development Kit(Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# VS2008x86xASL -win64- Requires:
-# Microsoft Visual Studio 2008 (x86)
-# Microsoft Windows Server 2003 Driver Development Kit(Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# VS2010x86xASL -win64- Requires:
-# Microsoft Visual Studio 2010 (x86) Premium Edition
-# Microsoft Windows Server 2003 Driver Development Kit(Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# VS2012x86xASL -win64- Requires:
-# Microsoft Visual Studio 2012 (x86) Professional Edition
-# Microsoft Windows Server 2003 Driver Development Kit(Microsoft WINDDK) version 3790.1830
-# Optional:
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# ICCx86xASL -win64- Requires:
-# Intel C Compiler V9.1 (x86)
-# Dependencies:
-# Microsoft Visual Studio 2003 or 2005
-# Microsoft Windows Server 2003 Driver Development Kit
-# (Microsoft WINDDK) version 3790.1830 for X64 target architectures
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# ICC11x86xASL -win64- Requires:
-# Intel C Compiler V11.1 (x86)
-# Dependencies:
-# Microsoft Visual Studio 2005 or 2008
-# Microsoft Windows Server 2003 Driver Development Kit
-# (Microsoft WINDDK) version 3790.1830 for X64 target architectures
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# CYGGCCx86 -win64- Requires:
-# CygWin, GCC 4.3.0, binutils 2.20.51.0.5
-# Microsoft Visual Studio 2005 or 2008
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler (iasl.exe) v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# CYGGCCx86xASL -win64- Requires:
-# CygWin, GCC 4.3.0, binutils 2.20.51.0.5
-# Microsoft Visual Studio 2005 or 2008
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# ARMGCC -unix- Requires:
-# ARM None EABI GCC 4.6.0
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# ARMLINUXGCC -unix- Requires:
-# ARM Linux GNU EABI GCC 4.6.0
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# RVCT -win- Requires:
-# ARM C/C++ Compiler, 5.00
-# Optional:
-# Required to build EBC drivers:
-# Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
-# Required to build platforms or ACPI tables:
-# Microsoft ASL ACPI Compiler (asl.exe) v4.0.0 from
-# http://download.microsoft.com/download/2/c/1/2c16c7e0-96c1-40f5-81fc-3e4bf7b65496/microsoft_asl_compiler-v4-0-0.msi
-# RVCTLINUX -unix- Requires:
-# ARM C/C++ Compiler, 5.00
-# Optional:
-# Required to build platforms or ACPI tables:
-# Intel(r) ACPI Compiler v20101013 from
-# http://www.acpica.org/downloads/previous_releases.php
-# * Commented out - All versions of VS2005 use the same standard install directory
-#
-####################################################################################
-####################################################################################
-#
-# Supported Tool Chain Family
-# ===========================
-# MSFT - Microsoft
-# GCC - GNU GCC
-# INTEL - INTEL
-# RVCT - ARM RealView Toolchain
-####################################################################################
-####################################################################################
-#
-# Intel EFI Byte Code Compiler (Template)
-#
-####################################################################################
-# *_*_EBC_*_FAMILY = INTEL
-#
-# *_*_EBC_PP_PATH = C:\Program Files\Intel\EBC\Bin\iec.exe
-# *_*_EBC_CC_PATH = C:\Program Files\Intel\EBC\Bin\iec.exe
-# *_*_EBC_SLINK_PATH = C:\Program Files\Intel\EBC\Bin\link.exe
-#
-# *_*_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-# *_*_EBC_PP_FLAGS = /nologo /E /TC /FI$(DEST_DIR_DEBUG)/AutoGen.h
-# *_*_EBC_CC_FLAGS = /nologo /FAcs /c /W3 /WX /FI$(DEST_DIR_DEBUG)/AutoGen.h
-# *_*_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /MACHINE:EBC /OPT:REF /NODEFAULTLIB /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /ALIGN:32 /DRIVER
-#
-####################################################################################
-#
-# Intel ACPI Source Language Compiler (Template)
-#
-####################################################################################
-# *_*_*_ASL_FAMILY = INTEL
-#
-# *_*_*_ASL_PATH = C:\ASL\iasl.exe
-#
-####################################################################################
-#
-# Microsoft ACPI Source Language Compiler (Template)
-#
-####################################################################################
-# *_*_*_ASL_FAMILY = MSFT
-#
-# *_*_*_ASL_PATH = C:\ASL\asl.exe
-#
-####################################################################################
-
-
-####################################################################################
-#
-# Microsoft Visual Studio .NET 2003 (IA-32 only, with Link Time Code Generation)
-# And Intel ACPI Compiler
-#
-####################################################################################
-# VS2003 - Microsoft Visual Studio .NET 2003 and Intel ACPI Source Language Compiler (iasl.exe)
-*_VS2003_*_*_FAMILY = MSFT
-
-##################
-# ASL definitions
-##################
-*_VS2003_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_VS2003_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_VS2003_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_VS2003_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2003_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2003_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2003_IA32_*_DLL = DEF(VS2003_DLL)
-
-*_VS2003_IA32_MAKE_PATH = DEF(VS2003_BIN)\nmake.exe
-*_VS2003_IA32_CC_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003_IA32_VFRPP_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003_IA32_SLINK_PATH = DEF(VS2003_BIN)\lib.exe
-*_VS2003_IA32_DLINK_PATH = DEF(VS2003_BIN)\link.exe
-*_VS2003_IA32_APP_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003_IA32_PP_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003_IA32_ASM_PATH = DEF(VS2003_BIN)\ml.exe
-*_VS2003_IA32_ASM16_PATH = DEF(VS2003_BIN)\ml.exe
-*_VS2003_IA32_ASLCC_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003_IA32_ASLPP_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003_IA32_ASLDLINK_PATH = DEF(VS2003_BIN)\link.exe
-*_VS2003_IA32_RC_PATH = DEF(VS2003_BIN)\rc.exe
-
- *_VS2003_IA32_MAKE_FLAGS = /nologo
- *_VS2003_IA32_APP_FLAGS = /nologo /E /TC
- *_VS2003_IA32_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
- *_VS2003_IA32_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
- DEBUG_VS2003_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm
-RELEASE_VS2003_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /GX-
-NOOPT_VS2003_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm /Od
-
- DEBUG_VS2003_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd /Zi
-RELEASE_VS2003_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd
-NOOPT_VS2003_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd /Zi
-
- *_VS2003_IA32_SLINK_FLAGS = /nologo /LTCG
- DEBUG_VS2003_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2003_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4078 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2003_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2003_EBC_*_FAMILY = INTEL
-
-*_VS2003_EBC_MAKE_PATH = DEF(VS2003_BIN)\nmake.exe
-*_VS2003_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2003_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2003_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2003_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_VS2003_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-*_VS2003_EBC_RC_PATH = DEF(VS2003_BIN)\rc.exe
-
-*_VS2003_EBC_MAKE_FLAGS = /nologo
-*_VS2003_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2003_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2003_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2003_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2003_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-####################################################################################
-#
-# Microsoft Visual Studio .NET 2003 and Microsoft ACPI compiler
-#
-####################################################################################
-# VS2003xASL - Microsoft Visual Studio .NET 2003 and Microsoft ACPI Source Language Compiler (asl.exe)
-*_VS2003xASL_*_*_FAMILY = MSFT
-
-##################
-# ASL definitions
-##################
-*_VS2003xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_VS2003xASL_*_ASL_FLAGS =
-*_VS2003xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_VS2003xASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2003xASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2003xASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2003xASL_IA32_*_DLL = DEF(VS2003_DLL)
-
-*_VS2003xASL_IA32_MAKE_PATH = DEF(VS2003_BIN)\nmake.exe
-*_VS2003xASL_IA32_CC_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003xASL_IA32_VFRPP_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003xASL_IA32_SLINK_PATH = DEF(VS2003_BIN)\lib.exe
-*_VS2003xASL_IA32_DLINK_PATH = DEF(VS2003_BIN)\link.exe
-*_VS2003xASL_IA32_APP_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003xASL_IA32_PP_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003xASL_IA32_ASM_PATH = DEF(VS2003_BIN)\ml.exe
-*_VS2003xASL_IA32_ASLCC_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003xASL_IA32_ASLPP_PATH = DEF(VS2003_BIN)\cl.exe
-*_VS2003xASL_IA32_ASLDLINK_PATH = DEF(VS2003_BIN)\link.exe
-*_VS2003xASL_IA32_RC_PATH = DEF(VS2003_BIN)\rc.exe
-
-
- *_VS2003xASL_IA32_MAKE_FLAGS = /nologo
- *_VS2003xASL_IA32_APP_FLAGS = /nologo /E /TC
- *_VS2003xASL_IA32_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
- *_VS2003xASL_IA32_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
- DEBUG_VS2003xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm
-RELEASE_VS2003xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /GX-
-NOOPT_VS2003xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm /Od
-
- DEBUG_VS2003xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd /Zi
-RELEASE_VS2003xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd
-NOOPT_VS2003xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd /Zi
-
- *_VS2003xASL_IA32_SLINK_FLAGS = /nologo /LTCG
- DEBUG_VS2003xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2003xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4078 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2003xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2003xASL_EBC_*_FAMILY = INTEL
-
-*_VS2003xASL_EBC_MAKE_PATH = DEF(VS2003_BIN)\nmake.exe
-*_VS2003xASL_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2003xASL_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2003xASL_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2003xASL_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_VS2003xASL_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-*_VS2003xASL_EBC_RC_PATH = DEF(VS2003_BIN)\rc.exe
-
-*_VS2003xASL_EBC_MAKE_FLAGS = /nologo
-*_VS2003xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2003xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2003xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2003xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2003xASL_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-####################################################################################
-# Microsoft Visual Studio 2005
-#
-# VS2005 - Microsoft Visual Studio 2005 All Edition, including Standard, Professional, Express, TeamSuite
-# ASL - Intel ACPI Source Language Compiler
-####################################################################################
-# VS2005 - Microsoft Visual Studio 2005 ALL Edition, including Standard, Professional, Express, TeamSuite
-*_VS2005_*_*_FAMILY = MSFT
-
-*_VS2005_*_MAKE_PATH = DEF(VS2005_BIN)\nmake.exe
-*_VS2005_*_MAKE_FLAGS = /nologo
-*_VS2005_*_RC_PATH = DEF(VS2005_BIN)\rc.exe
-
-*_VS2005_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2005_*_APP_FLAGS = /nologo /E /TC
-*_VS2005_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2005_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2005_*_ASM16_PATH = DEF(VS2005_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2005_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_VS2005_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_VS2005_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_VS2005_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2005_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2005_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2005_IA32_*_DLL = DEF(VS2005_DLL)
-
-*_VS2005_IA32_MAKE_PATH = DEF(VS2005_BIN)\nmake.exe
-*_VS2005_IA32_CC_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005_IA32_VFRPP_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005_IA32_SLINK_PATH = DEF(VS2005_BIN)\lib.exe
-*_VS2005_IA32_DLINK_PATH = DEF(VS2005_BIN)\link.exe
-*_VS2005_IA32_APP_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005_IA32_PP_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005_IA32_ASM_PATH = DEF(VS2005_BIN)\ml.exe
-*_VS2005_IA32_ASLCC_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005_IA32_ASLPP_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005_IA32_ASLDLINK_PATH = DEF(VS2005_BIN)\link.exe
-
- *_VS2005_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2005_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2005_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2005_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2005_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2005_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2005_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2005_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2005_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2005_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2005_X64_*_DLL = DEF(VS2005_DLL)
-
-*_VS2005_X64_CC_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005_X64_PP_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005_X64_APP_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005_X64_VFRPP_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005_X64_ASM_PATH = DEF(VS2005_BINX64)\ml64.exe
-*_VS2005_X64_SLINK_PATH = DEF(VS2005_BINX64)\lib.exe
-*_VS2005_X64_DLINK_PATH = DEF(VS2005_BINX64)\link.exe
-*_VS2005_X64_ASLCC_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005_X64_ASLPP_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005_X64_ASLDLINK_PATH = DEF(VS2005_BINX64)\link.exe
-
- DEBUG_VS2005_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2005_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2005_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2005_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2005_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2005_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2005_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2005_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2005_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2005_IPF_*_DLL = DEF(VS2005_DLL)
-
-*_VS2005_IPF_PP_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005_IPF_APP_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005_IPF_VFRPP_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005_IPF_CC_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005_IPF_ASM_PATH = DEF(VS2005_BIN64)\ias.exe
-*_VS2005_IPF_SLINK_PATH = DEF(VS2005_BIN64)\lib.exe
-*_VS2005_IPF_DLINK_PATH = DEF(VS2005_BIN64)\link.exe
-*_VS2005_IPF_ASLCC_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005_IPF_ASLPP_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005_IPF_ASLDLINK_PATH = DEF(VS2005_BIN64)\link.exe
-
- DEBUG_VS2005_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2005_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2005_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2005_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2005_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2005_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2005_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2005_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2005_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2005_EBC_*_FAMILY = INTEL
-
-*_VS2005_EBC_MAKE_PATH = DEF(VS2005_BIN)\nmake.exe
-*_VS2005_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2005_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2005_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2005_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_VS2005_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-
-*_VS2005_EBC_MAKE_FLAGS = /nologo
-*_VS2005_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2005_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2005_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2005_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2005_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-####################################################################################
-#
-# Microsoft Visual Studio 2005
-#
-# VS2005 - Microsoft Visual Studio 2005 All Edition, including Standard, Professional, Express, TeamSuite
-# ASL - Microsoft ACPI Source Language Compiler (asl.exe)
-####################################################################################
-# VS2005xASL - Microsoft Visual Studio 2005 ALL Edition, including Standard, Professional, Express, TeamSuite
-*_VS2005xASL_*_*_FAMILY = MSFT
-
-*_VS2005xASL_*_MAKE_PATH = DEF(VS2005_BIN)\nmake.exe
-*_VS2005xASL_*_MAKE_FLAG = /nologo
-*_VS2005xASL_*_RC_PATH = DEF(VS2005_BIN)\rc.exe
-
-*_VS2005xASL_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2005xASL_*_APP_FLAGS = /nologo /E /TC
-*_VS2005xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2005xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2005xASL_*_ASM16_PATH = DEF(VS2005_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2005xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_VS2005xASL_*_ASL_FLAGS =
-*_VS2005xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_VS2005xASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2005xASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2005xASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2005xASL_IA32_*_DLL = DEF(VS2005_DLL)
-
-*_VS2005xASL_IA32_MAKE_PATH = DEF(VS2005_BIN)\nmake.exe
-*_VS2005xASL_IA32_CC_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005xASL_IA32_VFRPP_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005xASL_IA32_SLINK_PATH = DEF(VS2005_BIN)\lib.exe
-*_VS2005xASL_IA32_DLINK_PATH = DEF(VS2005_BIN)\link.exe
-*_VS2005xASL_IA32_APP_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005xASL_IA32_PP_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005xASL_IA32_ASM_PATH = DEF(VS2005_BIN)\ml.exe
-*_VS2005xASL_IA32_ASLCC_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005xASL_IA32_ASLPP_PATH = DEF(VS2005_BIN)\cl.exe
-*_VS2005xASL_IA32_ASLDLINK_PATH = DEF(VS2005_BIN)\link.exe
-
- *_VS2005xASL_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2005xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2005xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2005xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2005xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2005xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2005xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2005xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2005xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2005xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2005xASL_X64_*_DLL = DEF(VS2005_DLL)
-
-*_VS2005xASL_X64_CC_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005xASL_X64_PP_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005xASL_X64_APP_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005xASL_X64_VFRPP_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005xASL_X64_ASM_PATH = DEF(VS2005_BINX64)\ml64.exe
-*_VS2005xASL_X64_SLINK_PATH = DEF(VS2005_BINX64)\lib.exe
-*_VS2005xASL_X64_DLINK_PATH = DEF(VS2005_BINX64)\link.exe
-*_VS2005xASL_X64_ASLCC_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005xASL_X64_ASLPP_PATH = DEF(VS2005_BINX64)\cl.exe
-*_VS2005xASL_X64_ASLDLINK_PATH = DEF(VS2005_BINX64)\link.exe
-
- DEBUG_VS2005xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2005xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2005xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2005xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2005xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2005xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2005xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2005xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2005xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2005xASL_IPF_*_DLL = DEF(VS2005_DLL)
-
-*_VS2005xASL_IPF_PP_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005xASL_IPF_APP_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005xASL_IPF_VFRPP_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005xASL_IPF_CC_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005xASL_IPF_ASM_PATH = DEF(VS2005_BIN64)\ias.exe
-*_VS2005xASL_IPF_SLINK_PATH = DEF(VS2005_BIN64)\lib.exe
-*_VS2005xASL_IPF_DLINK_PATH = DEF(VS2005_BIN64)\link.exe
-*_VS2005xASL_IPF_ASLCC_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005xASL_IPF_ASLPP_PATH = DEF(VS2005_BIN64)\cl.exe
-*_VS2005xASL_IPF_ASLDLINK_PATH = DEF(VS2005_BIN64)\link.exe
-
- DEBUG_VS2005xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2005xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2005xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2005xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2005xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2005xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2005xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2005xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2005xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2005xASL_EBC_*_FAMILY = INTEL
-
-*_VS2005xASL_EBC_MAKE_PATH = DEF(VS2005_BIN)\nmake.exe
-*_VS2005xASL_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2005xASL_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2005xASL_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2005xASL_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_VS2005xASL_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-
-*_VS2005xASL_EBC_MAKE_FLAGS = /nologo
-*_VS2005xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2005xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2005xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2005xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2005xASL_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-####################################################################################
-#
-# Microsoft Visual Studio 2005 (x86)
-#
-# VS2005 - Microsoft Visual Studio 2005 All Edition, including Standard, Professional, Express, TeamSuite
-# ASL - Intel ACPI Source Language Compiler
-####################################################################################
-# VS2005x86 - Microsoft Visual Studio 2005 ALL Edition, including Standard, Professional, Express, TeamSuite
-*_VS2005x86_*_*_FAMILY = MSFT
-
-*_VS2005x86_*_MAKE_PATH = DEF(VS2005x86_BIN)\nmake.exe
-*_VS2005x86_*_MAKE_FLAGS = /nologo
-*_VS2005x86_*_RC_PATH = DEF(VS2005x86_BIN)\rc.exe
-
-*_VS2005x86_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2005x86_*_APP_FLAGS = /nologo /E /TC
-*_VS2005x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2005x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2005x86_*_ASM16_PATH = DEF(VS2005x86_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2005x86_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_VS2005x86_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_VS2005x86_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_VS2005x86_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2005x86_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2005x86_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2005x86_IA32_*_DLL = DEF(VS2005x86_DLL)
-
-*_VS2005x86_IA32_MAKE_PATH = DEF(VS2005x86_BIN)\nmake.exe
-*_VS2005x86_IA32_CC_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86_IA32_VFRPP_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86_IA32_SLINK_PATH = DEF(VS2005x86_BIN)\lib.exe
-*_VS2005x86_IA32_DLINK_PATH = DEF(VS2005x86_BIN)\link.exe
-*_VS2005x86_IA32_APP_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86_IA32_PP_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86_IA32_ASM_PATH = DEF(VS2005x86_BIN)\ml.exe
-*_VS2005x86_IA32_ASLCC_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86_IA32_ASLPP_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86_IA32_ASLDLINK_PATH = DEF(VS2005x86_BIN)\link.exe
-
- *_VS2005x86_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2005x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2005x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2005x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2005x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2005x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2005x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2005x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2005x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2005x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2005x86_X64_*_DLL = DEF(VS2005x86_DLL)
-
-*_VS2005x86_X64_CC_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86_X64_PP_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86_X64_APP_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86_X64_VFRPP_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86_X64_ASM_PATH = DEF(VS2005x86_BINX64)\ml64.exe
-*_VS2005x86_X64_SLINK_PATH = DEF(VS2005x86_BINX64)\lib.exe
-*_VS2005x86_X64_DLINK_PATH = DEF(VS2005x86_BINX64)\link.exe
-*_VS2005x86_X64_ASLCC_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86_X64_ASLPP_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86_X64_ASLDLINK_PATH = DEF(VS2005x86_BINX64)\link.exe
-
- DEBUG_VS2005x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2005x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2005x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2005x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2005x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2005x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2005x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2005x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2005x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2005x86_IPF_*_DLL = DEF(VS2005x86_DLL)
-
-*_VS2005x86_IPF_PP_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86_IPF_APP_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86_IPF_VFRPP_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86_IPF_CC_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86_IPF_ASM_PATH = DEF(VS2005x86_BIN64)\ias.exe
-*_VS2005x86_IPF_SLINK_PATH = DEF(VS2005x86_BIN64)\lib.exe
-*_VS2005x86_IPF_DLINK_PATH = DEF(VS2005x86_BIN64)\link.exe
-*_VS2005x86_IPF_ASLCC_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86_IPF_ASLPP_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86_IPF_ASLDLINK_PATH = DEF(VS2005x86_BIN64)\link.exe
-
- DEBUG_VS2005x86_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2005x86_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2005x86_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2005x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2005x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2005x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2005x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2005x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2005x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2005x86_EBC_*_FAMILY = INTEL
-
-*_VS2005x86_EBC_MAKE_PATH = DEF(VS2005x86_BIN)\nmake.exe
-*_VS2005x86_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2005x86_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2005x86_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2005x86_EBC_SLINK_PATH = DEF(EBC_BINx86)\link.exe
-*_VS2005x86_EBC_DLINK_PATH = DEF(EBC_BINx86)\link.exe
-
-*_VS2005x86_EBC_MAKE_FLAGS = /nologo
-*_VS2005x86_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2005x86_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2005x86_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2005x86_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2005x86_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-####################################################################################
-#
-# Microsoft Visual Studio 2005 (x86)
-#
-# VS2005 - Microsoft Visual Studio 2005 All Edition, including Standard, Professional, Express, TeamSuite
-# ASL - Microsoft ACPI Source Language Compiler
-####################################################################################
-# VS2005x86xASL - Microsoft Visual Studio 2005 ALL Edition, including Standard, Professional, Express, TeamSuite
-*_VS2005x86xASL_*_*_FAMILY = MSFT
-
-*_VS2005x86xASL_*_MAKE_PATH = DEF(VS2005x86_BIN)\nmake.exe
-*_VS2005x86xASL_*_MAKE_FLAGS = /nologo
-*_VS2005x86xASL_*_RC_PATH = DEF(VS2005x86_BIN)\rc.exe
-
-*_VS2005x86xASL_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2005x86xASL_*_APP_FLAGS = /nologo /E /TC
-*_VS2005x86xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2005x86xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2005x86xASL_*_ASM16_PATH = DEF(VS2005x86_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2005x86xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_VS2005x86xASL_*_ASL_FLAGS =
-*_VS2005x86xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_VS2005x86xASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2005x86xASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2005x86xASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2005x86xASL_IA32_*_DLL = DEF(VS2005x86_DLL)
-
-*_VS2005x86xASL_IA32_MAKE_PATH = DEF(VS2005x86_BIN)\nmake.exe
-*_VS2005x86xASL_IA32_CC_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86xASL_IA32_VFRPP_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86xASL_IA32_SLINK_PATH = DEF(VS2005x86_BIN)\lib.exe
-*_VS2005x86xASL_IA32_DLINK_PATH = DEF(VS2005x86_BIN)\link.exe
-*_VS2005x86xASL_IA32_APP_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86xASL_IA32_PP_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86xASL_IA32_ASM_PATH = DEF(VS2005x86_BIN)\ml.exe
-*_VS2005x86xASL_IA32_ASLCC_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86xASL_IA32_ASLPP_PATH = DEF(VS2005x86_BIN)\cl.exe
-*_VS2005x86xASL_IA32_ASLDLINK_PATH = DEF(VS2005x86_BIN)\link.exe
-
- *_VS2005x86xASL_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2005x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2005x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2005x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2005x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2005x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2005x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2005x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2005x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2005x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2005x86xASL_X64_*_DLL = DEF(VS2005x86_DLL)
-
-*_VS2005x86xASL_X64_CC_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86xASL_X64_PP_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86xASL_X64_APP_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86xASL_X64_VFRPP_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86xASL_X64_ASM_PATH = DEF(VS2005x86_BINX64)\ml64.exe
-*_VS2005x86xASL_X64_SLINK_PATH = DEF(VS2005x86_BINX64)\lib.exe
-*_VS2005x86xASL_X64_DLINK_PATH = DEF(VS2005x86_BINX64)\link.exe
-*_VS2005x86xASL_X64_ASLCC_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86xASL_X64_ASLPP_PATH = DEF(VS2005x86_BINX64)\cl.exe
-*_VS2005x86xASL_X64_ASLDLINK_PATH = DEF(VS2005x86_BINX64)\link.exe
-
- DEBUG_VS2005x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2005x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2005x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2005x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2005x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2005x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2005x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2005x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2005x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2005x86xASL_IPF_*_DLL = DEF(VS2005x86_DLL)
-
-*_VS2005x86xASL_IPF_PP_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86xASL_IPF_APP_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86xASL_IPF_VFRPP_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86xASL_IPF_CC_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86xASL_IPF_ASM_PATH = DEF(VS2005x86_BIN64)\ias.exe
-*_VS2005x86xASL_IPF_SLINK_PATH = DEF(VS2005x86_BIN64)\lib.exe
-*_VS2005x86xASL_IPF_DLINK_PATH = DEF(VS2005x86_BIN64)\link.exe
-*_VS2005x86xASL_IPF_ASLCC_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86xASL_IPF_ASLPP_PATH = DEF(VS2005x86_BIN64)\cl.exe
-*_VS2005x86xASL_IPF_ASLDLINK_PATH = DEF(VS2005x86_BIN64)\link.exe
-
- DEBUG_VS2005x86xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2005x86xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2005x86xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2005x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2005x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2005x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2005x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2005x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2005x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2005x86xASL_EBC_*_FAMILY = INTEL
-
-*_VS2005x86xASL_EBC_MAKE_PATH = DEF(VS2005x86_BIN)\nmake.exe
-*_VS2005x86xASL_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2005x86xASL_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2005x86xASL_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2005x86xASL_EBC_SLINK_PATH = DEF(EBC_BINx86)\link.exe
-*_VS2005x86xASL_EBC_DLINK_PATH = DEF(EBC_BINx86)\link.exe
-
-*_VS2005x86xASL_EBC_MAKE_FLAGS = /nologo
-*_VS2005x86xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2005x86xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2005x86xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2005x86xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2005x86xASL_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Microsoft Visual Studio 2008
-#
-# VS2008 - Microsoft Visual Studio 2005 All Edition, including Standard, Professional, Express, TeamSuite
-# ASL - Intel ACPI Source Language Compiler
-####################################################################################
-# VS2008 - Microsoft Visual Studio 2008 ALL Edition, including Standard, Professional, Express, TeamSuite
-*_VS2008_*_*_FAMILY = MSFT
-
-*_VS2008_*_MAKE_PATH = DEF(VS2008_BIN)\nmake.exe
-*_VS2008_*_MAKE_FLAGS = /nologo
-*_VS2008_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2008_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2008_*_APP_FLAGS = /nologo /E /TC
-*_VS2008_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2008_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2008_*_ASM16_PATH = DEF(VS2008_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2008_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_VS2008_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_VS2008_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_VS2008_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2008_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2008_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2008_IA32_*_DLL = DEF(VS2008_DLL)
-
-*_VS2008_IA32_MAKE_PATH = DEF(VS2008_BIN)\nmake.exe
-*_VS2008_IA32_CC_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008_IA32_VFRPP_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008_IA32_SLINK_PATH = DEF(VS2008_BIN)\lib.exe
-*_VS2008_IA32_DLINK_PATH = DEF(VS2008_BIN)\link.exe
-*_VS2008_IA32_APP_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008_IA32_PP_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008_IA32_ASM_PATH = DEF(VS2008_BIN)\ml.exe
-*_VS2008_IA32_ASLCC_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008_IA32_ASLPP_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008_IA32_ASLDLINK_PATH = DEF(VS2008_BIN)\link.exe
-
- *_VS2008_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2008_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2008_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2008_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2008_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2008_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2008_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2008_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2008_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2008_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2008_X64_*_DLL = DEF(VS2008_DLL)
-
-*_VS2008_X64_CC_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008_X64_PP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008_X64_APP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008_X64_VFRPP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008_X64_ASM_PATH = DEF(VS2008_BINX64)\ml64.exe
-*_VS2008_X64_SLINK_PATH = DEF(VS2008_BINX64)\lib.exe
-*_VS2008_X64_DLINK_PATH = DEF(VS2008_BINX64)\link.exe
-*_VS2008_X64_ASLCC_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008_X64_ASLPP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008_X64_ASLDLINK_PATH = DEF(VS2008_BINX64)\link.exe
-
- DEBUG_VS2008_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2008_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2008_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2008_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2008_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2008_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2008_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2008_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2008_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2008_IPF_*_DLL = DEF(VS2008_DLL)
-
-*_VS2008_IPF_PP_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008_IPF_APP_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008_IPF_VFRPP_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008_IPF_CC_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008_IPF_ASM_PATH = DEF(VS2008_BIN64)\ias.exe
-*_VS2008_IPF_SLINK_PATH = DEF(VS2008_BIN64)\lib.exe
-*_VS2008_IPF_DLINK_PATH = DEF(VS2008_BIN64)\link.exe
-*_VS2008_IPF_ASLCC_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008_IPF_ASLPP_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008_IPF_ASLDLINK_PATH = DEF(VS2008_BIN64)\link.exe
-
- DEBUG_VS2008_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2008_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2008_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2008_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2008_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2008_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2008_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2008_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2008_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2008_EBC_*_FAMILY = INTEL
-*_VS2008_EBC_*_DLL = DEF(VS2008_DLL)
-
-*_VS2008_EBC_MAKE_PATH = DEF(VS2008_BIN)\nmake.exe
-*_VS2008_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2008_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2008_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2008_EBC_SLINK_PATH = DEF(VS2008_BIN)\link.exe
-*_VS2008_EBC_DLINK_PATH = DEF(VS2008_BIN)\link.exe
-
-*_VS2008_EBC_MAKE_FLAGS = /nologo
-*_VS2008_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2008_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2008_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2008_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2008_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Microsoft Visual Studio 2008
-#
-# VS2008 - Microsoft Visual Studio 2008 All Edition, including Standard, Professional, Express, TeamSuite
-# ASL - Microsoft ACPI Source Language Compiler (asl.exe)
-####################################################################################
-# VS2008xASL - Microsoft Visual Studio 2008 ALL Edition, including Standard, Professional, Express, TeamSuite
-*_VS2008xASL_*_*_FAMILY = MSFT
-
-*_VS2008xASL_*_MAKE_PATH = DEF(VS2008_BIN)\nmake.exe
-*_VS2008xASL_*_MAKE_FLAG = /nologo
-*_VS2008xASL_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2008xASL_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2008xASL_*_APP_FLAGS = /nologo /E /TC
-*_VS2008xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2008xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2008xASL_*_ASM16_PATH = DEF(VS2008_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2008xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_VS2008xASL_*_ASL_FLAGS =
-*_VS2008xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_VS2008xASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2008xASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2008xASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2008xASL_IA32_*_DLL = DEF(VS2008_DLL)
-
-*_VS2008xASL_IA32_MAKE_PATH = DEF(VS2008_BIN)\nmake.exe
-*_VS2008xASL_IA32_CC_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008xASL_IA32_VFRPP_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008xASL_IA32_SLINK_PATH = DEF(VS2008_BIN)\lib.exe
-*_VS2008xASL_IA32_DLINK_PATH = DEF(VS2008_BIN)\link.exe
-*_VS2008xASL_IA32_APP_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008xASL_IA32_PP_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008xASL_IA32_ASM_PATH = DEF(VS2008_BIN)\ml.exe
-*_VS2008xASL_IA32_ASLCC_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008xASL_IA32_ASLPP_PATH = DEF(VS2008_BIN)\cl.exe
-*_VS2008xASL_IA32_ASLDLINK_PATH = DEF(VS2008_BIN)\link.exe
-
- *_VS2008xASL_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2008xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2008xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2008xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2008xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2008xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2008xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2008xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2008xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2008xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2008xASL_X64_*_DLL = DEF(VS2008_DLL)
-
-*_VS2008xASL_X64_CC_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008xASL_X64_PP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008xASL_X64_APP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008xASL_X64_VFRPP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008xASL_X64_ASM_PATH = DEF(VS2008_BINX64)\ml64.exe
-*_VS2008xASL_X64_SLINK_PATH = DEF(VS2008_BINX64)\lib.exe
-*_VS2008xASL_X64_DLINK_PATH = DEF(VS2008_BINX64)\link.exe
-*_VS2008xASL_X64_ASLCC_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008xASL_X64_ASLPP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_VS2008xASL_X64_ASLDLINK_PATH = DEF(VS2008_BINX64)\link.exe
-
- DEBUG_VS2008xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2008xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2008xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2008xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2008xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2008xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2008xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2008xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2008xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2008xASL_IPF_*_DLL = DEF(VS2008_DLL)
-
-*_VS2008xASL_IPF_PP_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008xASL_IPF_APP_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008xASL_IPF_VFRPP_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008xASL_IPF_CC_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008xASL_IPF_ASM_PATH = DEF(VS2008_BIN64)\ias.exe
-*_VS2008xASL_IPF_SLINK_PATH = DEF(VS2008_BIN64)\lib.exe
-*_VS2008xASL_IPF_DLINK_PATH = DEF(VS2008_BIN64)\link.exe
-*_VS2008xASL_IPF_ASLCC_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008xASL_IPF_ASLPP_PATH = DEF(VS2008_BIN64)\cl.exe
-*_VS2008xASL_IPF_ASLDLINK_PATH = DEF(VS2008_BIN64)\link.exe
-
- DEBUG_VS2008xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2008xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2008xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2008xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2008xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2008xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2008xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2008xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2008xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2008xASL_EBC_*_FAMILY = INTEL
-*_VS2008xASL_EBC_*_DLL = DEF(VS2008_DLL)
-
-*_VS2008xASL_EBC_MAKE_PATH = DEF(VS2008_BIN)\nmake.exe
-*_VS2008xASL_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2008xASL_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2008xASL_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2008xASL_EBC_SLINK_PATH = DEF(VS2008_BIN)\link.exe
-*_VS2008xASL_EBC_DLINK_PATH = DEF(VS2008_BIN)\link.exe
-
-*_VS2008xASL_EBC_MAKE_FLAGS = /nologo
-*_VS2008xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2008xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2008xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2008xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2008xASL_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-# VS2008x86 - Microsoft Visual Studio 2008 (x86) with Intel ASL
-# ASL - Intel ACPI Source Language Compiler (iasl.exe)
-####################################################################################
-# VS2008x86 - Microsoft Visual Studio 2008 (x86) ALL Edition with Intel ASL
-*_VS2008x86_*_*_FAMILY = MSFT
-
-*_VS2008x86_*_MAKE_PATH = DEF(VS2008x86_BIN)\nmake.exe
-*_VS2008x86_*_MAKE_FLAG = /nologo
-*_VS2008x86_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2008x86_*_MAKE_FLAGS = /nologo
-*_VS2008x86_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2008x86_*_APP_FLAGS = /nologo /E /TC
-*_VS2008x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2008x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2008x86_*_ASM16_PATH = DEF(VS2008x86_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2008x86_*_ASL_PATH = DEF(WIN_IASL_BIN)
-*_VS2008x86_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_VS2008x86_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_VS2008x86_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2008x86_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2008x86_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2008x86_IA32_*_DLL = DEF(VS2008x86_DLL)
-
-*_VS2008x86_IA32_MAKE_PATH = DEF(VS2008x86_BIN)\nmake.exe
-*_VS2008x86_IA32_CC_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86_IA32_VFRPP_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86_IA32_ASLCC_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86_IA32_ASLPP_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86_IA32_SLINK_PATH = DEF(VS2008x86_BIN)\lib.exe
-*_VS2008x86_IA32_DLINK_PATH = DEF(VS2008x86_BIN)\link.exe
-*_VS2008x86_IA32_ASLDLINK_PATH= DEF(VS2008x86_BIN)\link.exe
-*_VS2008x86_IA32_APP_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86_IA32_PP_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86_IA32_ASM_PATH = DEF(VS2008x86_BIN)\ml.exe
-
- *_VS2008x86_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2008x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2008x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2008x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2008x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2008x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2008x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2008x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2008x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2008x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2008x86_X64_*_DLL = DEF(VS2008x86_DLL)
-
-*_VS2008x86_X64_CC_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86_X64_PP_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86_X64_APP_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86_X64_VFRPP_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86_X64_ASLCC_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86_X64_ASLPP_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86_X64_ASM_PATH = DEF(VS2008x86_BINX64)\ml64.exe
-*_VS2008x86_X64_SLINK_PATH = DEF(VS2008x86_BINX64)\lib.exe
-*_VS2008x86_X64_DLINK_PATH = DEF(VS2008x86_BINX64)\link.exe
-*_VS2008x86_X64_ASLDLINK_PATH = DEF(VS2008x86_BINX64)\link.exe
-
- DEBUG_VS2008x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2008x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2008x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2008x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2008x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2008x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2008x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2008x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2008x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2008x86_IPF_*_DLL = DEF(VS2008x86_DLL)
-
-*_VS2008x86_IPF_PP_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86_IPF_APP_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86_IPF_VFRPP_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86_IPF_ASLCC_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86_IPF_ASLPP_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86_IPF_CC_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86_IPF_ASM_PATH = DEF(VS2008x86_BIN64)\ias.exe
-*_VS2008x86_IPF_SLINK_PATH = DEF(VS2008x86_BIN64)\lib.exe
-*_VS2008x86_IPF_DLINK_PATH = DEF(VS2008x86_BIN64)\link.exe
-*_VS2008x86_IPF_ASLDLINK_PATH = DEF(VS2008x86_BIN64)\link.exe
-
- DEBUG_VS2008x86_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2008x86_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2008x86_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2008x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2008x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2008x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2008x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2008x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2008x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2008x86_EBC_*_FAMILY = INTEL
-*_VS2008x86_EBC_*_DLL = DEF(VS2008x86_DLL)
-
-*_VS2008x86_EBC_MAKE_PATH = DEF(VS2008x86_BIN)\nmake.exe
-*_VS2008x86_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2008x86_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2008x86_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2008x86_EBC_SLINK_PATH = DEF(VS2008x86_BIN)\link.exe
-*_VS2008x86_EBC_DLINK_PATH = DEF(VS2008x86_BIN)\link.exe
-
-*_VS2008x86_EBC_MAKE_FLAGS = /nologo
-*_VS2008x86_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2008x86_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2008x86_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2008x86_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2008x86_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-# VS2008x86xASL - Microsoft Visual Studio 2008 with Microsoft ASL
-# ASL - Microsoft ACPI Source Language Compiler (asl.exe)
-####################################################################################
-*_VS2008x86xASL_*_*_FAMILY = MSFT
-
-*_VS2008x86xASL_*_MAKE_PATH = DEF(VS2008x86_BIN)\nmake.exe
-*_VS2008x86xASL_*_MAKE_FLAG = /nologo
-*_VS2008x86xASL_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2008x86xASL_*_MAKE_FLAGS = /nologo
-*_VS2008x86xASL_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2008x86xASL_*_APP_FLAGS = /nologo /E /TC
-*_VS2008x86xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2008x86xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2008x86xASL_*_ASM16_PATH = DEF(VS2008x86_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2008x86xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_VS2008x86xASL_*_ASL_FLAGS = DEF(MS_ASL_FLAGS)
-*_VS2008x86xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_VS2008x86xASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2008x86xASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2008x86xASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2008x86xASL_IA32_*_DLL = DEF(VS2008x86_DLL)
-
-*_VS2008x86xASL_IA32_MAKE_PATH = DEF(VS2008x86_BIN)\nmake.exe
-*_VS2008x86xASL_IA32_CC_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86xASL_IA32_VFRPP_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86xASL_IA32_ASLCC_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86xASL_IA32_ASLPP_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86xASL_IA32_SLINK_PATH = DEF(VS2008x86_BIN)\lib.exe
-*_VS2008x86xASL_IA32_DLINK_PATH = DEF(VS2008x86_BIN)\link.exe
-*_VS2008x86xASL_IA32_ASLDLINK_PATH= DEF(VS2008x86_BIN)\link.exe
-*_VS2008x86xASL_IA32_APP_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86xASL_IA32_PP_PATH = DEF(VS2008x86_BIN)\cl.exe
-*_VS2008x86xASL_IA32_ASM_PATH = DEF(VS2008x86_BIN)\ml.exe
-
- *_VS2008x86xASL_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2008x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2008x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2008x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2008x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2008x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2008x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2008x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2008x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2008x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2008x86xASL_X64_*_DLL = DEF(VS2008x86_DLL)
-
-*_VS2008x86xASL_X64_CC_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86xASL_X64_PP_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86xASL_X64_APP_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86xASL_X64_VFRPP_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86xASL_X64_ASLCC_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86xASL_X64_ASLPP_PATH = DEF(VS2008x86_BINX64)\cl.exe
-*_VS2008x86xASL_X64_ASM_PATH = DEF(VS2008x86_BINX64)\ml64.exe
-*_VS2008x86xASL_X64_SLINK_PATH = DEF(VS2008x86_BINX64)\lib.exe
-*_VS2008x86xASL_X64_DLINK_PATH = DEF(VS2008x86_BINX64)\link.exe
-*_VS2008x86xASL_X64_ASLDLINK_PATH = DEF(VS2008x86_BINX64)\link.exe
-
- DEBUG_VS2008x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2008x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2008x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2008x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2008x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2008x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2008x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2008x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2008x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2008x86xASL_IPF_*_DLL = DEF(VS2008x86_DLL)
-
-*_VS2008x86xASL_IPF_PP_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86xASL_IPF_APP_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86xASL_IPF_VFRPP_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86xASL_IPF_ASLCC_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86xASL_IPF_ASLPP_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86xASL_IPF_CC_PATH = DEF(VS2008x86_BIN64)\cl.exe
-*_VS2008x86xASL_IPF_ASM_PATH = DEF(VS2008x86_BIN64)\ias.exe
-*_VS2008x86xASL_IPF_SLINK_PATH = DEF(VS2008x86_BIN64)\lib.exe
-*_VS2008x86xASL_IPF_DLINK_PATH = DEF(VS2008x86_BIN64)\link.exe
-*_VS2008x86xASL_IPF_ASLDLINK_PATH = DEF(VS2008x86_BIN64)\link.exe
-
- DEBUG_VS2008x86xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2008x86xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2008x86xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2008x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2008x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2008x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2008x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2008x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2008x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2008x86xASL_EBC_*_FAMILY = INTEL
-*_VS2008x86xASL_EBC_*_DLL = DEF(VS2008x86_DLL)
-
-*_VS2008x86xASL_EBC_MAKE_PATH = DEF(VS2008x86_BIN)\nmake.exe
-*_VS2008x86xASL_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2008x86xASL_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2008x86xASL_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2008x86xASL_EBC_SLINK_PATH = DEF(VS2008x86_BIN)\link.exe
-*_VS2008x86xASL_EBC_DLINK_PATH = DEF(VS2008x86_BIN)\link.exe
-
-*_VS2008x86xASL_EBC_MAKE_FLAGS = /nologo
-*_VS2008x86xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2008x86xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2008x86xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2008x86xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2008x86xASL_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Microsoft Visual Studio 2010
-#
-# VS2010 - Microsoft Visual Studio 2010 Premium Edition with Intel ASL
-# ASL - Intel ACPI Source Language Compiler
-####################################################################################
-# VS2010 - Microsoft Visual Studio 2010 Premium Edition
-*_VS2010_*_*_FAMILY = MSFT
-
-*_VS2010_*_MAKE_PATH = DEF(VS2010_BIN)\nmake.exe
-*_VS2010_*_MAKE_FLAGS = /nologo
-*_VS2010_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2010_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2010_*_APP_FLAGS = /nologo /E /TC
-*_VS2010_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2010_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2010_*_ASM16_PATH = DEF(VS2010_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2010_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_VS2010_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_VS2010_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_VS2010_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2010_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2010_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2010_IA32_*_DLL = DEF(VS2010_DLL)
-
-*_VS2010_IA32_MAKE_PATH = DEF(VS2010_BIN)\nmake.exe
-*_VS2010_IA32_CC_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010_IA32_VFRPP_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010_IA32_SLINK_PATH = DEF(VS2010_BIN)\lib.exe
-*_VS2010_IA32_DLINK_PATH = DEF(VS2010_BIN)\link.exe
-*_VS2010_IA32_APP_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010_IA32_PP_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010_IA32_ASM_PATH = DEF(VS2010_BIN)\ml.exe
-*_VS2010_IA32_ASLCC_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010_IA32_ASLPP_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010_IA32_ASLDLINK_PATH = DEF(VS2010_BIN)\link.exe
-
- *_VS2010_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2010_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2010_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2010_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2010_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2010_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2010_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2010_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2010_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2010_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2010_X64_*_DLL = DEF(VS2010_DLL)
-
-*_VS2010_X64_CC_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010_X64_PP_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010_X64_APP_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010_X64_VFRPP_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010_X64_ASM_PATH = DEF(VS2010_BINX64)\ml64.exe
-*_VS2010_X64_SLINK_PATH = DEF(VS2010_BINX64)\lib.exe
-*_VS2010_X64_DLINK_PATH = DEF(VS2010_BINX64)\link.exe
-*_VS2010_X64_ASLCC_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010_X64_ASLPP_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010_X64_ASLDLINK_PATH = DEF(VS2010_BINX64)\link.exe
-
- DEBUG_VS2010_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2010_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2010_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2010_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2010_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2010_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2010_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2010_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2010_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2010_IPF_*_DLL = DEF(VS2010_DLL)
-
-*_VS2010_IPF_PP_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010_IPF_APP_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010_IPF_VFRPP_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010_IPF_CC_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010_IPF_ASM_PATH = DEF(VS2010_BIN64)\ias.exe
-*_VS2010_IPF_SLINK_PATH = DEF(VS2010_BIN64)\lib.exe
-*_VS2010_IPF_DLINK_PATH = DEF(VS2010_BIN64)\link.exe
-*_VS2010_IPF_ASLCC_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010_IPF_ASLPP_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010_IPF_ASLDLINK_PATH = DEF(VS2010_BIN64)\link.exe
-
- DEBUG_VS2010_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2010_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2010_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2010_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2010_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2010_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2010_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2010_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2010_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2010_EBC_*_FAMILY = INTEL
-*_VS2010_EBC_*_DLL = DEF(VS2010_DLL)
-
-*_VS2010_EBC_MAKE_PATH = DEF(VS2010_BIN)\nmake.exe
-*_VS2010_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2010_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2010_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2010_EBC_SLINK_PATH = DEF(VS2010_BIN)\link.exe
-*_VS2010_EBC_DLINK_PATH = DEF(VS2010_BIN)\link.exe
-
-*_VS2010_EBC_MAKE_FLAGS = /nologo
-*_VS2010_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2010_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2010_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2010_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2010_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Microsoft Visual Studio 2010
-#
-# VS2010xASL - Microsoft Visual Studio 2010 Premium Edition with Microsoft ASL
-# ASL - Microsoft ACPI Source Language Compiler (asl.exe)
-####################################################################################
-# VS2010xASL - Microsoft Visual Studio 2010 Premium Edition
-*_VS2010xASL_*_*_FAMILY = MSFT
-
-*_VS2010xASL_*_MAKE_PATH = DEF(VS2010_BIN)\nmake.exe
-*_VS2010xASL_*_MAKE_FLAG = /nologo
-*_VS2010xASL_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2010xASL_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2010xASL_*_APP_FLAGS = /nologo /E /TC
-*_VS2010xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2010xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2010xASL_*_ASM16_PATH = DEF(VS2010_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2010xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_VS2010xASL_*_ASL_FLAGS =
-*_VS2010xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_VS2010xASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2010xASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2010xASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2010xASL_IA32_*_DLL = DEF(VS2010_DLL)
-
-*_VS2010xASL_IA32_MAKE_PATH = DEF(VS2010_BIN)\nmake.exe
-*_VS2010xASL_IA32_CC_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010xASL_IA32_VFRPP_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010xASL_IA32_SLINK_PATH = DEF(VS2010_BIN)\lib.exe
-*_VS2010xASL_IA32_DLINK_PATH = DEF(VS2010_BIN)\link.exe
-*_VS2010xASL_IA32_APP_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010xASL_IA32_PP_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010xASL_IA32_ASM_PATH = DEF(VS2010_BIN)\ml.exe
-*_VS2010xASL_IA32_ASLCC_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010xASL_IA32_ASLPP_PATH = DEF(VS2010_BIN)\cl.exe
-*_VS2010xASL_IA32_ASLDLINK_PATH = DEF(VS2010_BIN)\link.exe
-
- *_VS2010xASL_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2010xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2010xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2010xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2010xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2010xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2010xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2010xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2010xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2010xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2010xASL_X64_*_DLL = DEF(VS2010_DLL)
-
-*_VS2010xASL_X64_CC_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010xASL_X64_PP_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010xASL_X64_APP_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010xASL_X64_VFRPP_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010xASL_X64_ASM_PATH = DEF(VS2010_BINX64)\ml64.exe
-*_VS2010xASL_X64_SLINK_PATH = DEF(VS2010_BINX64)\lib.exe
-*_VS2010xASL_X64_DLINK_PATH = DEF(VS2010_BINX64)\link.exe
-*_VS2010xASL_X64_ASLCC_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010xASL_X64_ASLPP_PATH = DEF(VS2010_BINX64)\cl.exe
-*_VS2010xASL_X64_ASLDLINK_PATH = DEF(VS2010_BINX64)\link.exe
-
- DEBUG_VS2010xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2010xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2010xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2010xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2010xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2010xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2010xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2010xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2010xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2010xASL_IPF_*_DLL = DEF(VS2010_DLL)
-
-*_VS2010xASL_IPF_PP_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010xASL_IPF_APP_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010xASL_IPF_VFRPP_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010xASL_IPF_CC_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010xASL_IPF_ASM_PATH = DEF(VS2010_BIN64)\ias.exe
-*_VS2010xASL_IPF_SLINK_PATH = DEF(VS2010_BIN64)\lib.exe
-*_VS2010xASL_IPF_DLINK_PATH = DEF(VS2010_BIN64)\link.exe
-*_VS2010xASL_IPF_ASLCC_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010xASL_IPF_ASLPP_PATH = DEF(VS2010_BIN64)\cl.exe
-*_VS2010xASL_IPF_ASLDLINK_PATH = DEF(VS2010_BIN64)\link.exe
-
- DEBUG_VS2010xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2010xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2010xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2010xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2010xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2010xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2010xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2010xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2010xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2010xASL_EBC_*_FAMILY = INTEL
-*_VS2010xASL_EBC_*_DLL = DEF(VS2010_DLL)
-
-*_VS2010xASL_EBC_MAKE_PATH = DEF(VS2010_BIN)\nmake.exe
-*_VS2010xASL_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2010xASL_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2010xASL_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2010xASL_EBC_SLINK_PATH = DEF(VS2010_BIN)\link.exe
-*_VS2010xASL_EBC_DLINK_PATH = DEF(VS2010_BIN)\link.exe
-
-*_VS2010xASL_EBC_MAKE_FLAGS = /nologo
-*_VS2010xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2010xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2010xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2010xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2010xASL_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-# VS2010x86 - Microsoft Visual Studio 2010 (x86) with Intel ASL
-# ASL - Intel ACPI Source Language Compiler (iasl.exe)
-####################################################################################
-# VS2010x86 - Microsoft Visual Studio 2010 (x86) ALL Edition with Intel ASL
-*_VS2010x86_*_*_FAMILY = MSFT
-
-*_VS2010x86_*_MAKE_PATH = DEF(VS2010x86_BIN)\nmake.exe
-*_VS2010x86_*_MAKE_FLAG = /nologo
-*_VS2010x86_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2010x86_*_MAKE_FLAGS = /nologo
-*_VS2010x86_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2010x86_*_APP_FLAGS = /nologo /E /TC
-*_VS2010x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2010x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2010x86_*_ASM16_PATH = DEF(VS2010x86_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2010x86_*_ASL_PATH = DEF(WIN_IASL_BIN)
-*_VS2010x86_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_VS2010x86_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_VS2010x86_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2010x86_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2010x86_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2010x86_IA32_*_DLL = DEF(VS2010x86_DLL)
-
-*_VS2010x86_IA32_MAKE_PATH = DEF(VS2010x86_BIN)\nmake.exe
-*_VS2010x86_IA32_CC_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86_IA32_VFRPP_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86_IA32_ASLCC_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86_IA32_ASLPP_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86_IA32_SLINK_PATH = DEF(VS2010x86_BIN)\lib.exe
-*_VS2010x86_IA32_DLINK_PATH = DEF(VS2010x86_BIN)\link.exe
-*_VS2010x86_IA32_ASLDLINK_PATH= DEF(VS2010x86_BIN)\link.exe
-*_VS2010x86_IA32_APP_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86_IA32_PP_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86_IA32_ASM_PATH = DEF(VS2010x86_BIN)\ml.exe
-
- *_VS2010x86_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2010x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2010x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2010x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2010x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2010x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2010x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2010x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2010x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2010x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2010x86_X64_*_DLL = DEF(VS2010x86_DLL)
-
-*_VS2010x86_X64_CC_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86_X64_PP_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86_X64_APP_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86_X64_VFRPP_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86_X64_ASLCC_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86_X64_ASLPP_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86_X64_ASM_PATH = DEF(VS2010x86_BINX64)\ml64.exe
-*_VS2010x86_X64_SLINK_PATH = DEF(VS2010x86_BINX64)\lib.exe
-*_VS2010x86_X64_DLINK_PATH = DEF(VS2010x86_BINX64)\link.exe
-*_VS2010x86_X64_ASLDLINK_PATH = DEF(VS2010x86_BINX64)\link.exe
-
- DEBUG_VS2010x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2010x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2010x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2010x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2010x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2010x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2010x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2010x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2010x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2010x86_IPF_*_DLL = DEF(VS2010x86_DLL)
-
-*_VS2010x86_IPF_PP_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86_IPF_APP_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86_IPF_VFRPP_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86_IPF_ASLCC_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86_IPF_ASLPP_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86_IPF_CC_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86_IPF_ASM_PATH = DEF(VS2010x86_BIN64)\ias.exe
-*_VS2010x86_IPF_SLINK_PATH = DEF(VS2010x86_BIN64)\lib.exe
-*_VS2010x86_IPF_DLINK_PATH = DEF(VS2010x86_BIN64)\link.exe
-*_VS2010x86_IPF_ASLDLINK_PATH = DEF(VS2010x86_BIN64)\link.exe
-
- DEBUG_VS2010x86_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2010x86_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2010x86_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2010x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2010x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2010x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2010x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2010x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2010x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2010x86_EBC_*_FAMILY = INTEL
-*_VS2010x86_EBC_*_DLL = DEF(VS2010x86_DLL)
-
-*_VS2010x86_EBC_MAKE_PATH = DEF(VS2010x86_BIN)\nmake.exe
-*_VS2010x86_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2010x86_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2010x86_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2010x86_EBC_SLINK_PATH = DEF(VS2010x86_BIN)\link.exe
-*_VS2010x86_EBC_DLINK_PATH = DEF(VS2010x86_BIN)\link.exe
-
-*_VS2010x86_EBC_MAKE_FLAGS = /nologo
-*_VS2010x86_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2010x86_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2010x86_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2010x86_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2010x86_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-# VS2010x86xASL - Microsoft Visual Studio 2010 with Microsoft ASL
-# ASL - Microsoft ACPI Source Language Compiler (asl.exe)
-####################################################################################
-*_VS2010x86xASL_*_*_FAMILY = MSFT
-
-*_VS2010x86xASL_*_MAKE_PATH = DEF(VS2010x86_BIN)\nmake.exe
-*_VS2010x86xASL_*_MAKE_FLAG = /nologo
-*_VS2010x86xASL_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2010x86xASL_*_MAKE_FLAGS = /nologo
-*_VS2010x86xASL_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2010x86xASL_*_APP_FLAGS = /nologo /E /TC
-*_VS2010x86xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2010x86xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2010x86xASL_*_ASM16_PATH = DEF(VS2010x86_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2010x86xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_VS2010x86xASL_*_ASL_FLAGS = DEF(MS_ASL_FLAGS)
-*_VS2010x86xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_VS2010x86xASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2010x86xASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2010x86xASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2010x86xASL_IA32_*_DLL = DEF(VS2010x86_DLL)
-
-*_VS2010x86xASL_IA32_MAKE_PATH = DEF(VS2010x86_BIN)\nmake.exe
-*_VS2010x86xASL_IA32_CC_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86xASL_IA32_VFRPP_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86xASL_IA32_ASLCC_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86xASL_IA32_ASLPP_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86xASL_IA32_SLINK_PATH = DEF(VS2010x86_BIN)\lib.exe
-*_VS2010x86xASL_IA32_DLINK_PATH = DEF(VS2010x86_BIN)\link.exe
-*_VS2010x86xASL_IA32_ASLDLINK_PATH= DEF(VS2010x86_BIN)\link.exe
-*_VS2010x86xASL_IA32_APP_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86xASL_IA32_PP_PATH = DEF(VS2010x86_BIN)\cl.exe
-*_VS2010x86xASL_IA32_ASM_PATH = DEF(VS2010x86_BIN)\ml.exe
-
- *_VS2010x86xASL_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2010x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2010x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2010x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2010x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2010x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2010x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2010x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2010x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2010x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2010x86xASL_X64_*_DLL = DEF(VS2010x86_DLL)
-
-*_VS2010x86xASL_X64_CC_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86xASL_X64_PP_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86xASL_X64_APP_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86xASL_X64_VFRPP_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86xASL_X64_ASLCC_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86xASL_X64_ASLPP_PATH = DEF(VS2010x86_BINX64)\cl.exe
-*_VS2010x86xASL_X64_ASM_PATH = DEF(VS2010x86_BINX64)\ml64.exe
-*_VS2010x86xASL_X64_SLINK_PATH = DEF(VS2010x86_BINX64)\lib.exe
-*_VS2010x86xASL_X64_DLINK_PATH = DEF(VS2010x86_BINX64)\link.exe
-*_VS2010x86xASL_X64_ASLDLINK_PATH = DEF(VS2010x86_BINX64)\link.exe
-
- DEBUG_VS2010x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2010x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2010x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2010x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2010x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2010x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2010x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2010x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2010x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_VS2010x86xASL_IPF_*_DLL = DEF(VS2010x86_DLL)
-
-*_VS2010x86xASL_IPF_PP_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86xASL_IPF_APP_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86xASL_IPF_VFRPP_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86xASL_IPF_ASLCC_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86xASL_IPF_ASLPP_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86xASL_IPF_CC_PATH = DEF(VS2010x86_BIN64)\cl.exe
-*_VS2010x86xASL_IPF_ASM_PATH = DEF(VS2010x86_BIN64)\ias.exe
-*_VS2010x86xASL_IPF_SLINK_PATH = DEF(VS2010x86_BIN64)\lib.exe
-*_VS2010x86xASL_IPF_DLINK_PATH = DEF(VS2010x86_BIN64)\link.exe
-*_VS2010x86xASL_IPF_ASLDLINK_PATH = DEF(VS2010x86_BIN64)\link.exe
-
- DEBUG_VS2010x86xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_VS2010x86xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_VS2010x86xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_VS2010x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_VS2010x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_VS2010x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_VS2010x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_VS2010x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_VS2010x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEBUG_DIR)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2010x86xASL_EBC_*_FAMILY = INTEL
-*_VS2010x86xASL_EBC_*_DLL = DEF(VS2010x86_DLL)
-
-*_VS2010x86xASL_EBC_MAKE_PATH = DEF(VS2010x86_BIN)\nmake.exe
-*_VS2010x86xASL_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2010x86xASL_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2010x86xASL_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2010x86xASL_EBC_SLINK_PATH = DEF(VS2010x86_BIN)\link.exe
-*_VS2010x86xASL_EBC_DLINK_PATH = DEF(VS2010x86_BIN)\link.exe
-
-*_VS2010x86xASL_EBC_MAKE_FLAGS = /nologo
-*_VS2010x86xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2010x86xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2010x86xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2010x86xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2010x86xASL_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Microsoft Visual Studio 2012
-#
-# VS2012 - Microsoft Visual Studio 2012 Professional Edition with Intel ASL
-# ASL - Intel ACPI Source Language Compiler
-####################################################################################
-# VS2012 - Microsoft Visual Studio 2012 Premium Edition
-*_VS2012_*_*_FAMILY = MSFT
-
-*_VS2012_*_MAKE_PATH = DEF(VS2012_BIN)\nmake.exe
-*_VS2012_*_MAKE_FLAGS = /nologo
-*_VS2012_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2012_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2012_*_APP_FLAGS = /nologo /E /TC
-*_VS2012_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2012_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2012_*_ASM16_PATH = DEF(VS2012_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2012_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_VS2012_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_VS2012_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_VS2012_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2012_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2012_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2012_IA32_*_DLL = DEF(VS2012_DLL)
-
-*_VS2012_IA32_MAKE_PATH = DEF(VS2012_BIN)\nmake.exe
-*_VS2012_IA32_CC_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012_IA32_VFRPP_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012_IA32_SLINK_PATH = DEF(VS2012_BIN)\lib.exe
-*_VS2012_IA32_DLINK_PATH = DEF(VS2012_BIN)\link.exe
-*_VS2012_IA32_APP_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012_IA32_PP_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012_IA32_ASM_PATH = DEF(VS2012_BIN)\ml.exe
-*_VS2012_IA32_ASLCC_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012_IA32_ASLPP_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012_IA32_ASLDLINK_PATH = DEF(VS2012_BIN)\link.exe
-
- *_VS2012_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2012_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2012_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2012_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2012_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2012_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2012_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2012_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2012_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2012_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2012_X64_*_DLL = DEF(VS2012_DLL)
-
-*_VS2012_X64_CC_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012_X64_PP_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012_X64_APP_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012_X64_VFRPP_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012_X64_ASM_PATH = DEF(VS2012_BINX64)\ml64.exe
-*_VS2012_X64_SLINK_PATH = DEF(VS2012_BINX64)\lib.exe
-*_VS2012_X64_DLINK_PATH = DEF(VS2012_BINX64)\link.exe
-*_VS2012_X64_ASLCC_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012_X64_ASLPP_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012_X64_ASLDLINK_PATH = DEF(VS2012_BINX64)\link.exe
-
- DEBUG_VS2012_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2012_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2012_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2012_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2012_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2012_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2012_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2012_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2012_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2012_EBC_*_FAMILY = INTEL
-*_VS2012_EBC_*_DLL = DEF(VS2012_DLL)
-
-*_VS2012_EBC_MAKE_PATH = DEF(VS2012_BIN)\nmake.exe
-*_VS2012_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2012_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2012_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2012_EBC_SLINK_PATH = DEF(VS2012_BIN)\link.exe
-*_VS2012_EBC_DLINK_PATH = DEF(VS2012_BIN)\link.exe
-
-*_VS2012_EBC_MAKE_FLAGS = /nologo
-*_VS2012_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2012_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2012_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2012_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2012_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Microsoft Visual Studio 2012
-#
-# VS2012 - Microsoft Visual Studio 2012 Professional Edition with Microsoft ASL
-# ASL - Microsoft ACPI Source Language Compiler (asl.exe)
-####################################################################################
-# VS2012xASL - Microsoft Visual Studio 2012 Premium Edition
-*_VS2012xASL_*_*_FAMILY = MSFT
-
-*_VS2012xASL_*_MAKE_PATH = DEF(VS2012_BIN)\nmake.exe
-*_VS2012xASL_*_MAKE_FLAG = /nologo
-*_VS2012xASL_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2012xASL_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2012xASL_*_APP_FLAGS = /nologo /E /TC
-*_VS2012xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2012xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2012xASL_*_ASM16_PATH = DEF(VS2012_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2012xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_VS2012xASL_*_ASL_FLAGS =
-*_VS2012xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_VS2012xASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2012xASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2012xASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2012xASL_IA32_*_DLL = DEF(VS2012_DLL)
-
-*_VS2012xASL_IA32_MAKE_PATH = DEF(VS2012_BIN)\nmake.exe
-*_VS2012xASL_IA32_CC_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012xASL_IA32_VFRPP_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012xASL_IA32_SLINK_PATH = DEF(VS2012_BIN)\lib.exe
-*_VS2012xASL_IA32_DLINK_PATH = DEF(VS2012_BIN)\link.exe
-*_VS2012xASL_IA32_APP_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012xASL_IA32_PP_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012xASL_IA32_ASM_PATH = DEF(VS2012_BIN)\ml.exe
-*_VS2012xASL_IA32_ASLCC_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012xASL_IA32_ASLPP_PATH = DEF(VS2012_BIN)\cl.exe
-*_VS2012xASL_IA32_ASLDLINK_PATH = DEF(VS2012_BIN)\link.exe
-
- *_VS2012xASL_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2012xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2012xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2012xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2012xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2012xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2012xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2012xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2012xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2012xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2012xASL_X64_*_DLL = DEF(VS2012_DLL)
-
-*_VS2012xASL_X64_CC_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012xASL_X64_PP_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012xASL_X64_APP_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012xASL_X64_VFRPP_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012xASL_X64_ASM_PATH = DEF(VS2012_BINX64)\ml64.exe
-*_VS2012xASL_X64_SLINK_PATH = DEF(VS2012_BINX64)\lib.exe
-*_VS2012xASL_X64_DLINK_PATH = DEF(VS2012_BINX64)\link.exe
-*_VS2012xASL_X64_ASLCC_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012xASL_X64_ASLPP_PATH = DEF(VS2012_BINX64)\cl.exe
-*_VS2012xASL_X64_ASLDLINK_PATH = DEF(VS2012_BINX64)\link.exe
-
- DEBUG_VS2012xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2012xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2012xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2012xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2012xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2012xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2012xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2012xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2012xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2012xASL_EBC_*_FAMILY = INTEL
-*_VS2012xASL_EBC_*_DLL = DEF(VS2012_DLL)
-
-*_VS2012xASL_EBC_MAKE_PATH = DEF(VS2012_BIN)\nmake.exe
-*_VS2012xASL_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2012xASL_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2012xASL_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_VS2012xASL_EBC_SLINK_PATH = DEF(VS2012_BIN)\link.exe
-*_VS2012xASL_EBC_DLINK_PATH = DEF(VS2012_BIN)\link.exe
-
-*_VS2012xASL_EBC_MAKE_FLAGS = /nologo
-*_VS2012xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2012xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2012xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2012xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2012xASL_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-# VS2012x86 - Microsoft Visual Studio 2012 (x86) professional with Intel ASL
-# ASL - Intel ACPI Source Language Compiler (iasl.exe)
-####################################################################################
-# VS2012x86 - Microsoft Visual Studio 2012 (x86) professional Edition with Intel ASL
-*_VS2012x86_*_*_FAMILY = MSFT
-
-*_VS2012x86_*_MAKE_PATH = DEF(VS2012x86_BIN)\nmake.exe
-*_VS2012x86_*_MAKE_FLAG = /nologo
-*_VS2012x86_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2012x86_*_MAKE_FLAGS = /nologo
-*_VS2012x86_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2012x86_*_APP_FLAGS = /nologo /E /TC
-*_VS2012x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2012x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2012x86_*_ASM16_PATH = DEF(VS2012x86_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2012x86_*_ASL_PATH = DEF(WIN_IASL_BIN)
-*_VS2012x86_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_VS2012x86_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_VS2012x86_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2012x86_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2012x86_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2012x86_IA32_*_DLL = DEF(VS2012x86_DLL)
-
-*_VS2012x86_IA32_MAKE_PATH = DEF(VS2012x86_BIN)\nmake.exe
-*_VS2012x86_IA32_CC_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86_IA32_VFRPP_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86_IA32_ASLCC_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86_IA32_ASLPP_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86_IA32_SLINK_PATH = DEF(VS2012x86_BIN)\lib.exe
-*_VS2012x86_IA32_DLINK_PATH = DEF(VS2012x86_BIN)\link.exe
-*_VS2012x86_IA32_ASLDLINK_PATH= DEF(VS2012x86_BIN)\link.exe
-*_VS2012x86_IA32_APP_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86_IA32_PP_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86_IA32_ASM_PATH = DEF(VS2012x86_BIN)\ml.exe
-
- *_VS2012x86_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2012x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2012x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2012x86_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2012x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2012x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2012x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2012x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2012x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2012x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2012x86_X64_*_DLL = DEF(VS2012x86_DLL)
-
-*_VS2012x86_X64_CC_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86_X64_PP_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86_X64_APP_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86_X64_VFRPP_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86_X64_ASLCC_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86_X64_ASLPP_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86_X64_ASM_PATH = DEF(VS2012x86_BINX64)\ml64.exe
-*_VS2012x86_X64_SLINK_PATH = DEF(VS2012x86_BINX64)\lib.exe
-*_VS2012x86_X64_DLINK_PATH = DEF(VS2012x86_BINX64)\link.exe
-*_VS2012x86_X64_ASLDLINK_PATH = DEF(VS2012x86_BINX64)\link.exe
-
- DEBUG_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2012x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2012x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2012x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2012x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2012x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2012x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2012x86_EBC_*_FAMILY = INTEL
-*_VS2012x86_EBC_*_DLL = DEF(VS2012x86_DLL)
-
-*_VS2012x86_EBC_MAKE_PATH = DEF(VS2012x86_BIN)\nmake.exe
-*_VS2012x86_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2012x86_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2012x86_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2012x86_EBC_SLINK_PATH = DEF(VS2012x86_BIN)\link.exe
-*_VS2012x86_EBC_DLINK_PATH = DEF(VS2012x86_BIN)\link.exe
-
-*_VS2012x86_EBC_MAKE_FLAGS = /nologo
-*_VS2012x86_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2012x86_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2012x86_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2012x86_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2012x86_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-# VS2012x86xASL - Microsoft Visual Studio 2012 (x86) professional with Microsoft ASL
-# ASL - Microsoft ACPI Source Language Compiler (asl.exe)
-####################################################################################
-*_VS2012x86xASL_*_*_FAMILY = MSFT
-
-*_VS2012x86xASL_*_MAKE_PATH = DEF(VS2012x86_BIN)\nmake.exe
-*_VS2012x86xASL_*_MAKE_FLAG = /nologo
-*_VS2012x86xASL_*_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
-*_VS2012x86xASL_*_MAKE_FLAGS = /nologo
-*_VS2012x86xASL_*_SLINK_FLAGS = /NOLOGO /LTCG
-*_VS2012x86xASL_*_APP_FLAGS = /nologo /E /TC
-*_VS2012x86xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2012x86xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_VS2012x86xASL_*_ASM16_PATH = DEF(VS2012x86_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_VS2012x86xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_VS2012x86xASL_*_ASL_FLAGS = DEF(MS_ASL_FLAGS)
-*_VS2012x86xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_VS2012x86xASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_VS2012x86xASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_VS2012x86xASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_VS2012x86xASL_IA32_*_DLL = DEF(VS2012x86_DLL)
-
-*_VS2012x86xASL_IA32_MAKE_PATH = DEF(VS2012x86_BIN)\nmake.exe
-*_VS2012x86xASL_IA32_CC_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86xASL_IA32_VFRPP_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86xASL_IA32_ASLCC_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86xASL_IA32_ASLPP_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86xASL_IA32_SLINK_PATH = DEF(VS2012x86_BIN)\lib.exe
-*_VS2012x86xASL_IA32_DLINK_PATH = DEF(VS2012x86_BIN)\link.exe
-*_VS2012x86xASL_IA32_ASLDLINK_PATH= DEF(VS2012x86_BIN)\link.exe
-*_VS2012x86xASL_IA32_APP_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86xASL_IA32_PP_PATH = DEF(VS2012x86_BIN)\cl.exe
-*_VS2012x86xASL_IA32_ASM_PATH = DEF(VS2012x86_BIN)\ml.exe
-
- *_VS2012x86xASL_IA32_MAKE_FLAGS = /nologo
- DEBUG_VS2012x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
-RELEASE_VS2012x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2012x86xASL_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
-
- DEBUG_VS2012x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-RELEASE_VS2012x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd
-NOOPT_VS2012x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
-
- DEBUG_VS2012x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2012x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2012x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_VS2012x86xASL_X64_*_DLL = DEF(VS2012x86_DLL)
-
-*_VS2012x86xASL_X64_CC_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86xASL_X64_PP_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86xASL_X64_APP_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86xASL_X64_VFRPP_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86xASL_X64_ASLCC_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86xASL_X64_ASLPP_PATH = DEF(VS2012x86_BINX64)\cl.exe
-*_VS2012x86xASL_X64_ASM_PATH = DEF(VS2012x86_BINX64)\ml64.exe
-*_VS2012x86xASL_X64_SLINK_PATH = DEF(VS2012x86_BINX64)\lib.exe
-*_VS2012x86xASL_X64_DLINK_PATH = DEF(VS2012x86_BINX64)\link.exe
-*_VS2012x86xASL_X64_ASLDLINK_PATH = DEF(VS2012x86_BINX64)\link.exe
-
- DEBUG_VS2012x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_VS2012x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_VS2012x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_VS2012x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_VS2012x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_VS2012x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_VS2012x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_VS2012x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_VS2012x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# EBC definitions
-##################
-*_VS2012x86xASL_EBC_*_FAMILY = INTEL
-*_VS2012x86xASL_EBC_*_DLL = DEF(VS2012x86_DLL)
-
-*_VS2012x86xASL_EBC_MAKE_PATH = DEF(VS2012x86_BIN)\nmake.exe
-*_VS2012x86xASL_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2012x86xASL_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2012x86xASL_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_VS2012x86xASL_EBC_SLINK_PATH = DEF(VS2012x86_BIN)\link.exe
-*_VS2012x86xASL_EBC_DLINK_PATH = DEF(VS2012x86_BIN)\link.exe
-
-*_VS2012x86xASL_EBC_MAKE_FLAGS = /nologo
-*_VS2012x86xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_VS2012x86xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_VS2012x86xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_VS2012x86xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_VS2012x86xASL_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Microsoft Device Driver Kit 3790.1830 (IA-32, X64, Itanium, with Link Time Code Generation)
-# And Intel ACPI Compiler
-#
-####################################################################################
-# DDK3790 - Microsoft Windows DDK 3790.1830
-# ASL - Intel ACPI Source Language Compiler (iasl.exe)
-*_DDK3790_*_*_FAMILY = MSFT
-
-*_DDK3790_*_MAKE_PATH = DEF(WINDDK_BIN32)\nmake.exe
-*_DDK3790_*_MAKE_FLAGS = /nologo
-*_DDK3790_*_RC_PATH = DEF(WINDDK_BIN32)\rc.exe
-
-*_DDK3790_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_DDK3790_*_APP_FLAGS = /nologo /E /TC
-*_DDK3790_*_SLINK_FLAGS = /nologo /LTCG
-*_DDK3790_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_DDK3790_*_ASM16_PATH = DEF(WINDDK_BIN32)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_DDK3790_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_DDK3790_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_DDK3790_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_DDK3790_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_DDK3790_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_DDK3790_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_DDK3790_IA32_CC_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790_IA32_SLINK_PATH = DEF(WINDDK_BIN32)\lib.exe
-*_DDK3790_IA32_DLINK_PATH = DEF(WINDDK_BIN32)\link.exe
-*_DDK3790_IA32_PP_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790_IA32_VFRPP_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790_IA32_APP_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790_IA32_ASM_PATH = DEF(WINDDK_BIN32)\ml.exe
-*_DDK3790_IA32_ASLCC_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790_IA32_ASLPP_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790_IA32_ASLDLINK_PATH = DEF(WINDDK_BIN32)\link.exe
-
- DEBUG_DDK3790_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_DDK3790_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_DDK3790_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_DDK3790_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd /Zi
-RELEASE_DDK3790_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd
-NOOPT_DDK3790_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd /Zi
-
- DEBUG_DDK3790_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_DDK3790_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4078 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_DDK3790_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# x64 definitions
-##################
-*_DDK3790_X64_CC_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790_X64_SLINK_PATH = DEF(WINDDK_BINX64)\lib.exe
-*_DDK3790_X64_DLINK_PATH = DEF(WINDDK_BINX64)\link.exe
-*_DDK3790_X64_PP_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790_X64_VFRPP_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790_X64_APP_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790_X64_ASM_PATH = DEF(WINDDK_BINX64)\ml64.exe
-*_DDK3790_X64_ASLCC_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790_X64_ASLPP_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790_X64_ASLDLINK_PATH = DEF(WINDDK_BINX64)\link.exe
-
- DEBUG_DDK3790_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_DDK3790_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_DDK3790_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_DDK3790_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_DDK3790_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_DDK3790_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_DDK3790_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:AMD64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_DDK3790_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4078 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:AMD64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_DDK3790_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:AMD64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_DDK3790_IPF_CC_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790_IPF_SLINK_PATH = DEF(WINDDK_BIN64)\lib.exe
-*_DDK3790_IPF_DLINK_PATH = DEF(WINDDK_BIN64)\link.exe
-*_DDK3790_IPF_PP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790_IPF_VFRPP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790_IPF_APP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790_IPF_ASM_PATH = DEF(WINDDK_BIN64)\ias.exe
-*_DDK3790_IPF_ASLCC_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790_IPF_ASLPP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790_IPF_ASLDLINK_PATH = DEF(WINDDK_BIN64)\link.exe
-
-
- DEBUG_DDK3790_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_DDK3790_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_DDK3790_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_DDK3790_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_DDK3790_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_DDK3790_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_DDK3790_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-RELEASE_DDK3790_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
-NOOPT_DDK3790_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_DDK3790_EBC_*_FAMILY = INTEL
-
-*_DDK3790_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_DDK3790_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_DDK3790_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-*_DDK3790_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_DDK3790_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-
-*_DDK3790_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_DDK3790_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_DDK3790_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /ALIGN:32 /DRIVER
-
-####################################################################################
-#
-# Microsoft Device Driver Kit 3790.1830 (IA-32, X64, Itanium, with Link Time Code Generation)
-# And Microsoft ACPI Compiler
-#
-####################################################################################
-# DDK3790xASL - Microsoft Windows DDK 3790.1830
-# ASL - Microsoft ACPI Source Language Compiler (asl.exe)
-*_DDK3790xASL_*_*_FAMILY = MSFT
-
-*_DDK3790xASL_*_MAKE_PATH = DEF(WINDDK_BIN32)\nmake.exe
-*_DDK3790xASL_*_MAKE_FLAGS = /nologo
-*_DDK3790xASL_*_RC_PATH = DEF(WINDDK_BIN32)\rc.exe
-
-*_DDK3790xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_DDK3790xASL_*_APP_FLAGS = /nologo /E /TC
-*_DDK3790xASL_*_SLINK_FLAGS = /nologo /LTCG
-*_DDK3790xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-
-*_DDK3790xASL_*_ASM16_PATH = DEF(WINDDK_BIN32)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_DDK3790xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_DDK3790xASL_*_ASL_FLAGS =
-*_DDK3790xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_DDK3790xASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_DDK3790xASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_DDK3790xASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_DDK3790xASL_IA32_CC_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790xASL_IA32_SLINK_PATH = DEF(WINDDK_BIN32)\lib.exe
-*_DDK3790xASL_IA32_DLINK_PATH = DEF(WINDDK_BIN32)\link.exe
-*_DDK3790xASL_IA32_PP_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790xASL_IA32_VFRPP_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790xASL_IA32_APP_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790xASL_IA32_ASM_PATH = DEF(WINDDK_BIN32)\ml.exe
-*_DDK3790xASL_IA32_ASLCC_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790xASL_IA32_ASLPP_PATH = DEF(WINDDK_BIN32)\cl.exe
-*_DDK3790xASL_IA32_ASLDLINK_PATH = DEF(WINDDK_BIN32)\link.exe
-
- DEBUG_DDK3790xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_DDK3790xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_DDK3790xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_DDK3790xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd /Zi
-RELEASE_DDK3790xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd
-NOOPT_DDK3790xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd /Zi
-
- DEBUG_DDK3790xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_DDK3790xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4078 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_DDK3790xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# x64 definitions
-##################
-*_DDK3790xASL_X64_CC_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790xASL_X64_SLINK_PATH = DEF(WINDDK_BINX64)\lib.exe
-*_DDK3790xASL_X64_DLINK_PATH = DEF(WINDDK_BINX64)\link.exe
-*_DDK3790xASL_X64_PP_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790xASL_X64_VFRPP_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790xASL_X64_APP_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790xASL_X64_ASM_PATH = DEF(WINDDK_BINX64)\ml64.exe
-*_DDK3790xASL_X64_ASLCC_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790xASL_X64_ASLPP_PATH = DEF(WINDDK_BINX64)\cl.exe
-*_DDK3790xASL_X64_ASLDLINK_PATH = DEF(WINDDK_BINX64)\link.exe
-
- DEBUG_DDK3790xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_DDK3790xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_DDK3790xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
-
- DEBUG_DDK3790xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_DDK3790xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_DDK3790xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_DDK3790xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:AMD64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_DDK3790xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4078 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:AMD64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_DDK3790xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:AMD64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_DDK3790xASL_IPF_CC_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790xASL_IPF_SLINK_PATH = DEF(WINDDK_BIN64)\lib.exe
-*_DDK3790xASL_IPF_DLINK_PATH = DEF(WINDDK_BIN64)\link.exe
-*_DDK3790xASL_IPF_PP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790xASL_IPF_VFRPP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790xASL_IPF_APP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790xASL_IPF_ASM_PATH = DEF(WINDDK_BIN64)\ias.exe
-*_DDK3790xASL_IPF_ASLCC_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790xASL_IPF_ASLPP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_DDK3790xASL_IPF_ASLDLINK_PATH = DEF(WINDDK_BIN64)\link.exe
-
-
- DEBUG_DDK3790xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32 /Zi
-RELEASE_DDK3790xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /Os /GL /FIAutoGen.h /QIPF_fr32
-NOOPT_DDK3790xASL_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /EHs-c- /GR- /Gy /FIAutoGen.h /QIPF_fr32 /Zi /Od
-
- DEBUG_DDK3790xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_DDK3790xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_DDK3790xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-
- DEBUG_DDK3790xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-RELEASE_DDK3790xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
-NOOPT_DDK3790xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-
-##################
-# EBC definitions
-##################
-*_DDK3790xASL_EBC_*_FAMILY = INTEL
-
-*_DDK3790xASL_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_DDK3790xASL_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_DDK3790xASL_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-*_DDK3790xASL_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_DDK3790xASL_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-
-*_DDK3790xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_DDK3790xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_DDK3790xASL_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /ALIGN:32 /DRIVER
-
-
-####################################################################################
-# GCC Common
-####################################################################################
-
-*_*_*_OBJCOPY_PATH = echo
-*_*_*_OBJCOPY_FLAGS = objcopy not needed for
-*_*_*_SYMRENAME_PATH = echo
-*_*_*_SYMRENAME_FLAGS = Symbol renaming not needed for
-DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)\$(MODULE_NAME).debug
-RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG =
-
-DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-array-bounds -c -include AutoGen.h
-DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
-DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
-DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
-DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address
-DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mcmodel=large -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address
-DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie
-DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
-DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Ttext=0x0 --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)
-DEFINE GCC_IA32_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-DEFINE GCC_IPF_DLINK_FLAGS = -nostdlib -O2 --gc-sections --dll -static --entry $(IMAGE_ENTRY_POINT) --undefined $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-DEFINE GCC_IPF_OBJCOPY_FLAGS = -I elf64-ia64-little -O efi-bsdrv-ia64
-DEFINE GCC_IPF_SYMRENAME_FLAGS = --redefine-sym memcpy=CopyMem
-DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
-DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-DEFINE GCC_ASLPP_FLAGS = -x c -E -P
-DEFINE GCC_ASLCC_FLAGS = -x c
-DEFINE GCC_WINDRES_FLAGS = -J rc -O coff
-DEFINE GCC_IA32_RC_FLAGS = -I binary -O elf32-i386 -B i386 --rename-section .data=.hii
-DEFINE GCC_X64_RC_FLAGS = -I binary -O elf64-x86-64 -B i386 --rename-section .data=.hii
-DEFINE GCC_IPF_RC_FLAGS = -I binary -O elf64-ia64-little -B ia64 --rename-section .data=.hii
-DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii
-DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
-
-DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-stack-protector -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
-DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -malign-double -D EFI32
-DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=large
-DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -n -q --gc-sections --script=$(EDK_TOOLS_PATH)/Scripts/gcc4.4-ld-script
-DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) --entry ReferenceAcpiTable -u ReferenceAcpiTable
-DEFINE GCC44_IA32_X64_DLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-DEFINE GCC44_X64_DLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_FLAGS) -melf_x86_64 --oformat=elf64-x86-64
-DEFINE GCC44_ASM_FLAGS = DEF(GCC_ASM_FLAGS)
-
-DEFINE GCC45_IA32_CC_FLAGS = DEF(GCC44_IA32_CC_FLAGS)
-DEFINE GCC45_X64_CC_FLAGS = DEF(GCC44_X64_CC_FLAGS)
-DEFINE GCC45_IA32_X64_DLINK_COMMON = DEF(GCC44_IA32_X64_DLINK_COMMON)
-DEFINE GCC45_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_ASLDLINK_FLAGS)
-DEFINE GCC45_IA32_X64_DLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_FLAGS)
-DEFINE GCC45_X64_DLINK_FLAGS = DEF(GCC44_X64_DLINK_FLAGS)
-DEFINE GCC45_ASM_FLAGS = DEF(GCC44_ASM_FLAGS)
-
-DEFINE GCC46_IA32_CC_FLAGS = DEF(GCC45_IA32_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable
-DEFINE GCC46_X64_CC_FLAGS = DEF(GCC45_X64_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable
-DEFINE GCC46_IA32_X64_DLINK_COMMON = DEF(GCC45_IA32_X64_DLINK_COMMON)
-DEFINE GCC46_IA32_X64_ASLDLINK_FLAGS = DEF(GCC45_IA32_X64_ASLDLINK_FLAGS)
-DEFINE GCC46_IA32_X64_DLINK_FLAGS = DEF(GCC45_IA32_X64_DLINK_FLAGS)
-DEFINE GCC46_X64_DLINK_FLAGS = DEF(GCC45_X64_DLINK_FLAGS)
-DEFINE GCC46_ASM_FLAGS = DEF(GCC45_ASM_FLAGS)
-DEFINE GCC46_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian
-DEFINE GCC46_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC44_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -mno-unaligned-access -Wno-address -fomit-frame-pointer
-DEFINE GCC46_ARM_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf32-littlearm
-
-DEFINE GCC47_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS)
-DEFINE GCC47_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS)
-DEFINE GCC47_IA32_X64_DLINK_COMMON = DEF(GCC46_IA32_X64_DLINK_COMMON)
-DEFINE GCC47_IA32_X64_ASLDLINK_FLAGS = DEF(GCC46_IA32_X64_ASLDLINK_FLAGS)
-DEFINE GCC47_IA32_X64_DLINK_FLAGS = DEF(GCC46_IA32_X64_DLINK_FLAGS)
-DEFINE GCC47_X64_DLINK_FLAGS = DEF(GCC46_X64_DLINK_FLAGS)
-DEFINE GCC47_ASM_FLAGS = DEF(GCC46_ASM_FLAGS)
-DEFINE GCC47_ARM_ASM_FLAGS = DEF(GCC46_ARM_ASM_FLAGS)
-DEFINE GCC47_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian
-DEFINE GCC47_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS)
-DEFINE GCC47_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC44_ALL_CC_FLAGS) -mcmodel=large -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address
-DEFINE GCC47_ARM_DLINK_FLAGS = DEF(GCC46_ARM_DLINK_FLAGS)
-DEFINE GCC47_AARCH64_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON)
-
-####################################################################################
-#
-# Unix GCC And Intel Linux ACPI Compiler
-#
-####################################################################################
-# UNIXGCC - UNIX GCC
-# ASL - Intel Linux ACPI Source Language Compiler (iasl)
-*_UNIXGCC_*_*_FAMILY = GCC
-
-*_UNIXGCC_*_MAKE_PATH = make
-*_UNIXGCC_*_ASL_PATH = DEF(UNIX_IASL_BIN)
-
-*_UNIXGCC_IA32_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_FLAGS) --image-base=0
-*_UNIXGCC_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_FLAGS) --image-base=0
-*_UNIXGCC_IA32_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_ASLDLINK_FLAGS)
-*_UNIXGCC_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_ASLDLINK_FLAGS)
-*_UNIXGCC_*_ASM_FLAGS = DEF(GCC_ASM_FLAGS)
-*_UNIXGCC_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
-*_UNIXGCC_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
-*_UNIXGCC_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
-*_UNIXGCC_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
-*_UNIXGCC_*_APP_FLAGS =
-*_UNIXGCC_*_ASL_FLAGS = DEF(IASL_FLAGS)
-*_UNIXGCC_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-
-##################
-# IA32 definitions
-##################
-*_UNIXGCC_IA32_OBJCOPY_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)objcopy
-*_UNIXGCC_IA32_PP_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IA32_CC_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IA32_SLINK_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)ar
-*_UNIXGCC_IA32_DLINK_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)ld
-*_UNIXGCC_IA32_ASLPP_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IA32_ASLCC_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IA32_ASLDLINK_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)ld
-*_UNIXGCC_IA32_ASM_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IA32_VFRPP_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IA32_RC_PATH = DEF(UNIXGCC_IA32_PETOOLS_PREFIX)objcopy
-
-*_UNIXGCC_IA32_CC_FLAGS = DEF(GCC_IA32_CC_FLAGS)
-*_UNIXGCC_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
-*_UNIXGCC_IA32_OBJCOPY_FLAGS =
-
-##################
-# X64 definitions
-##################
-*_UNIXGCC_X64_CC_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)gcc
-*_UNIXGCC_X64_ASLCC_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)gcc
-*_UNIXGCC_X64_SLINK_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)ar
-*_UNIXGCC_X64_DLINK_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)ld
-*_UNIXGCC_X64_ASLDLINK_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)ld
-*_UNIXGCC_X64_ASM_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)gcc
-*_UNIXGCC_X64_PP_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)gcc
-*_UNIXGCC_X64_ASLPP_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)gcc
-*_UNIXGCC_X64_VFRPP_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)gcc
-*_UNIXGCC_X64_RC_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)objcopy
-*_UNIXGCC_X64_OBJCOPY_PATH = DEF(UNIXGCC_X64_PETOOLS_PREFIX)objcopy
-
-*_UNIXGCC_X64_CC_FLAGS = DEF(GCC_X64_CC_FLAGS)
-*_UNIXGCC_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
-*_UNIXGCC_X64_OBJCOPY_FLAGS =
-
-##################
-# IPF definitions
-##################
-*_UNIXGCC_IPF_CC_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IPF_ASLCC_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IPF_SLINK_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)ar
-*_UNIXGCC_IPF_DLINK_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)ld
-*_UNIXGCC_IPF_ASLDLINK_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)ld
-*_UNIXGCC_IPF_ASM_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IPF_PP_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IPF_ASLPP_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IPF_VFRPP_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)gcc
-*_UNIXGCC_IPF_OBJCOPY_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)objcopy
-*_UNIXGCC_IPF_SYMRENAME_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)objcopy
-*_UNIXGCC_IPF_RC_PATH = DEF(UNIXGCC_IPF_PETOOLS_PREFIX)objcopy
-
-*_UNIXGCC_IPF_CC_FLAGS = DEF(GCC_IPF_CC_FLAGS)
-*_UNIXGCC_IPF_DLINK_FLAGS = DEF(GCC_IPF_DLINK_FLAGS)
-*_UNIXGCC_IPF_OBJCOPY_FLAGS = DEF(GCC_IPF_OBJCOPY_FLAGS)
-*_UNIXGCC_IPF_SYMRENAME_FLAGS = DEF(GCC_IPF_SYMRENAME_FLAGS)
-*_UNIXGCC_IPF_RC_FLAGS = DEF(GCC_IPF_RC_FLAGS)
-
-
-####################################################################################
-#
-# GCC 4.4 - This configuration is used to compile under Linux to produce
-# PE/COFF binaries using GCC 4.4.
-#
-####################################################################################
-*_GCC44_*_*_FAMILY = GCC
-
-*_GCC44_*_MAKE_PATH = make
-*_GCC44_*_ASL_PATH = DEF(UNIX_IASL_BIN)
-
-*_GCC44_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
-*_GCC44_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
-*_GCC44_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
-*_GCC44_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
-*_GCC44_*_APP_FLAGS =
-*_GCC44_*_ASL_FLAGS = DEF(IASL_FLAGS)
-*_GCC44_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-
-##################
-# GCC44 IA32 definitions
-##################
-*_GCC44_IA32_OBJCOPY_PATH = DEF(GCC44_IA32_PREFIX)objcopy
-*_GCC44_IA32_CC_PATH = DEF(GCC44_IA32_PREFIX)gcc
-*_GCC44_IA32_SLINK_PATH = DEF(GCC44_IA32_PREFIX)ar
-*_GCC44_IA32_DLINK_PATH = DEF(GCC44_IA32_PREFIX)ld
-*_GCC44_IA32_ASLDLINK_PATH = DEF(GCC44_IA32_PREFIX)ld
-*_GCC44_IA32_ASM_PATH = DEF(GCC44_IA32_PREFIX)gcc
-*_GCC44_IA32_PP_PATH = DEF(GCC44_IA32_PREFIX)gcc
-*_GCC44_IA32_VFRPP_PATH = DEF(GCC44_IA32_PREFIX)gcc
-*_GCC44_IA32_ASLCC_PATH = DEF(GCC44_IA32_PREFIX)gcc
-*_GCC44_IA32_ASLPP_PATH = DEF(GCC44_IA32_PREFIX)gcc
-*_GCC44_IA32_RC_PATH = DEF(GCC44_IA32_PREFIX)objcopy
-
-*_GCC44_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32
-*_GCC44_IA32_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_ASLDLINK_FLAGS) -m elf_i386
-*_GCC44_IA32_ASM_FLAGS = DEF(GCC44_ASM_FLAGS) -m32 --32 -march=i386
-*_GCC44_IA32_CC_FLAGS = DEF(GCC44_IA32_CC_FLAGS) -Os
-*_GCC44_IA32_DLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386
-*_GCC44_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
-*_GCC44_IA32_OBJCOPY_FLAGS =
-
-##################
-# GCC44 X64 definitions
-##################
-*_GCC44_X64_OBJCOPY_PATH = DEF(GCC44_X64_PREFIX)objcopy
-*_GCC44_X64_CC_PATH = DEF(GCC44_X64_PREFIX)gcc
-*_GCC44_X64_SLINK_PATH = DEF(GCC44_X64_PREFIX)ar
-*_GCC44_X64_DLINK_PATH = DEF(GCC44_X64_PREFIX)ld
-*_GCC44_X64_ASLDLINK_PATH = DEF(GCC44_X64_PREFIX)ld
-*_GCC44_X64_ASM_PATH = DEF(GCC44_X64_PREFIX)gcc
-*_GCC44_X64_PP_PATH = DEF(GCC44_X64_PREFIX)gcc
-*_GCC44_X64_VFRPP_PATH = DEF(GCC44_X64_PREFIX)gcc
-*_GCC44_X64_ASLCC_PATH = DEF(GCC44_X64_PREFIX)gcc
-*_GCC44_X64_ASLPP_PATH = DEF(GCC44_X64_PREFIX)gcc
-*_GCC44_X64_RC_PATH = DEF(GCC44_X64_PREFIX)objcopy
-
-*_GCC44_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64
-*_GCC44_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_ASLDLINK_FLAGS) -m elf_x86_64
-*_GCC44_X64_ASM_FLAGS = DEF(GCC44_ASM_FLAGS) -m64 --64 -melf_x86_64
-*_GCC44_X64_CC_FLAGS = DEF(GCC44_X64_CC_FLAGS)
-*_GCC44_X64_DLINK_FLAGS = DEF(GCC44_X64_DLINK_FLAGS)
-*_GCC44_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
-*_GCC44_X64_OBJCOPY_FLAGS =
-
-####################################################################################
-#
-# GCC 4.5 - This configuration is used to compile under Linux to produce
-# PE/COFF binaries using GCC 4.5.
-#
-####################################################################################
-*_GCC45_*_*_FAMILY = GCC
-
-*_GCC45_*_MAKE_PATH = make
-*_GCC45_*_ASL_PATH = DEF(UNIX_IASL_BIN)
-
-*_GCC45_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
-*_GCC45_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
-*_GCC45_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
-*_GCC45_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
-*_GCC45_*_APP_FLAGS =
-*_GCC45_*_ASL_FLAGS = DEF(IASL_FLAGS)
-*_GCC45_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-
-##################
-# GCC45 IA32 definitions
-##################
-*_GCC45_IA32_OBJCOPY_PATH = DEF(GCC45_IA32_PREFIX)objcopy
-*_GCC45_IA32_CC_PATH = DEF(GCC45_IA32_PREFIX)gcc
-*_GCC45_IA32_SLINK_PATH = DEF(GCC45_IA32_PREFIX)ar
-*_GCC45_IA32_DLINK_PATH = DEF(GCC45_IA32_PREFIX)ld
-*_GCC45_IA32_ASLDLINK_PATH = DEF(GCC45_IA32_PREFIX)ld
-*_GCC45_IA32_ASM_PATH = DEF(GCC45_IA32_PREFIX)gcc
-*_GCC45_IA32_PP_PATH = DEF(GCC45_IA32_PREFIX)gcc
-*_GCC45_IA32_VFRPP_PATH = DEF(GCC45_IA32_PREFIX)gcc
-*_GCC45_IA32_ASLCC_PATH = DEF(GCC45_IA32_PREFIX)gcc
-*_GCC45_IA32_ASLPP_PATH = DEF(GCC45_IA32_PREFIX)gcc
-*_GCC45_IA32_RC_PATH = DEF(GCC45_IA32_PREFIX)objcopy
-
-*_GCC45_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32
-*_GCC45_IA32_ASLDLINK_FLAGS = DEF(GCC45_IA32_X64_ASLDLINK_FLAGS) -m elf_i386
-*_GCC45_IA32_ASM_FLAGS = DEF(GCC45_ASM_FLAGS) -m32 --32 -march=i386
-*_GCC45_IA32_CC_FLAGS = DEF(GCC45_IA32_CC_FLAGS) -Os
-*_GCC45_IA32_DLINK_FLAGS = DEF(GCC45_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386
-*_GCC45_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
-*_GCC45_IA32_OBJCOPY_FLAGS =
-
-##################
-# GCC45 X64 definitions
-##################
-*_GCC45_X64_OBJCOPY_PATH = DEF(GCC45_X64_PREFIX)objcopy
-*_GCC45_X64_CC_PATH = DEF(GCC45_X64_PREFIX)gcc
-*_GCC45_X64_SLINK_PATH = DEF(GCC45_X64_PREFIX)ar
-*_GCC45_X64_DLINK_PATH = DEF(GCC45_X64_PREFIX)ld
-*_GCC45_X64_ASLDLINK_PATH = DEF(GCC45_X64_PREFIX)ld
-*_GCC45_X64_ASM_PATH = DEF(GCC45_X64_PREFIX)gcc
-*_GCC45_X64_PP_PATH = DEF(GCC45_X64_PREFIX)gcc
-*_GCC45_X64_VFRPP_PATH = DEF(GCC45_X64_PREFIX)gcc
-*_GCC45_X64_ASLCC_PATH = DEF(GCC45_X64_PREFIX)gcc
-*_GCC45_X64_ASLPP_PATH = DEF(GCC45_X64_PREFIX)gcc
-*_GCC45_X64_RC_PATH = DEF(GCC45_X64_PREFIX)objcopy
-
-*_GCC45_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64
-*_GCC45_X64_ASLDLINK_FLAGS = DEF(GCC45_IA32_X64_ASLDLINK_FLAGS) -m elf_x86_64
-*_GCC45_X64_ASM_FLAGS = DEF(GCC45_ASM_FLAGS) -m64 --64 -melf_x86_64
-*_GCC45_X64_CC_FLAGS = DEF(GCC45_X64_CC_FLAGS)
-*_GCC45_X64_DLINK_FLAGS = DEF(GCC45_X64_DLINK_FLAGS)
-*_GCC45_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
-*_GCC45_X64_OBJCOPY_FLAGS =
-
-####################################################################################
-#
-# GCC 4.6 - This configuration is used to compile under Linux to produce
-# PE/COFF binaries using GCC 4.6.
-#
-####################################################################################
-*_GCC46_*_*_FAMILY = GCC
-
-*_GCC46_*_MAKE_PATH = make
-*_GCC46_*_ASL_PATH = DEF(UNIX_IASL_BIN)
-
-*_GCC46_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
-*_GCC46_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
-*_GCC46_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
-*_GCC46_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
-*_GCC46_*_APP_FLAGS =
-*_GCC46_*_ASL_FLAGS = DEF(IASL_FLAGS)
-*_GCC46_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-
-##################
-# GCC46 IA32 definitions
-##################
-*_GCC46_IA32_OBJCOPY_PATH = DEF(GCC46_IA32_PREFIX)objcopy
-*_GCC46_IA32_CC_PATH = DEF(GCC46_IA32_PREFIX)gcc
-*_GCC46_IA32_SLINK_PATH = DEF(GCC46_IA32_PREFIX)ar
-*_GCC46_IA32_DLINK_PATH = DEF(GCC46_IA32_PREFIX)ld
-*_GCC46_IA32_ASLDLINK_PATH = DEF(GCC46_IA32_PREFIX)ld
-*_GCC46_IA32_ASM_PATH = DEF(GCC46_IA32_PREFIX)gcc
-*_GCC46_IA32_PP_PATH = DEF(GCC46_IA32_PREFIX)gcc
-*_GCC46_IA32_VFRPP_PATH = DEF(GCC46_IA32_PREFIX)gcc
-*_GCC46_IA32_ASLCC_PATH = DEF(GCC46_IA32_PREFIX)gcc
-*_GCC46_IA32_ASLPP_PATH = DEF(GCC46_IA32_PREFIX)gcc
-*_GCC46_IA32_RC_PATH = DEF(GCC46_IA32_PREFIX)objcopy
-
-*_GCC46_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32
-*_GCC46_IA32_ASLDLINK_FLAGS = DEF(GCC46_IA32_X64_ASLDLINK_FLAGS) -m elf_i386
-*_GCC46_IA32_ASM_FLAGS = DEF(GCC46_ASM_FLAGS) -m32 -march=i386
-*_GCC46_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS) -Os
-*_GCC46_IA32_DLINK_FLAGS = DEF(GCC46_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386
-*_GCC46_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
-*_GCC46_IA32_OBJCOPY_FLAGS =
-
-##################
-# GCC46 X64 definitions
-##################
-*_GCC46_X64_OBJCOPY_PATH = DEF(GCC46_X64_PREFIX)objcopy
-*_GCC46_X64_CC_PATH = DEF(GCC46_X64_PREFIX)gcc
-*_GCC46_X64_SLINK_PATH = DEF(GCC46_X64_PREFIX)ar
-*_GCC46_X64_DLINK_PATH = DEF(GCC46_X64_PREFIX)ld
-*_GCC46_X64_ASLDLINK_PATH = DEF(GCC46_X64_PREFIX)ld
-*_GCC46_X64_ASM_PATH = DEF(GCC46_X64_PREFIX)gcc
-*_GCC46_X64_PP_PATH = DEF(GCC46_X64_PREFIX)gcc
-*_GCC46_X64_VFRPP_PATH = DEF(GCC46_X64_PREFIX)gcc
-*_GCC46_X64_ASLCC_PATH = DEF(GCC46_X64_PREFIX)gcc
-*_GCC46_X64_ASLPP_PATH = DEF(GCC46_X64_PREFIX)gcc
-*_GCC46_X64_RC_PATH = DEF(GCC46_X64_PREFIX)objcopy
-
-*_GCC46_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64
-*_GCC46_X64_ASLDLINK_FLAGS = DEF(GCC46_IA32_X64_ASLDLINK_FLAGS) -m elf_x86_64
-*_GCC46_X64_ASM_FLAGS = DEF(GCC46_ASM_FLAGS) -m64 -melf_x86_64
-*_GCC46_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS)
-*_GCC46_X64_DLINK_FLAGS = DEF(GCC46_X64_DLINK_FLAGS)
-*_GCC46_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
-*_GCC46_X64_OBJCOPY_FLAGS =
-
-##################
-# GCC46 ARM definitions
-##################
-*_GCC46_ARM_OBJCOPY_PATH = echo
-*_GCC46_ARM_CC_PATH = ENV(GCC46_ARM_PREFIX)gcc
-*_GCC46_ARM_SLINK_PATH = ENV(GCC46_ARM_PREFIX)ar
-*_GCC46_ARM_DLINK_PATH = ENV(GCC46_ARM_PREFIX)ld
-*_GCC46_ARM_ASLDLINK_PATH = ENV(GCC46_ARM_PREFIX)ld
-*_GCC46_ARM_ASM_PATH = ENV(GCC46_ARM_PREFIX)gcc
-*_GCC46_ARM_PP_PATH = ENV(GCC46_ARM_PREFIX)gcc
-*_GCC46_ARM_VFRPP_PATH = ENV(GCC46_ARM_PREFIX)gcc
-*_GCC46_ARM_ASLCC_PATH = ENV(GCC46_ARM_PREFIX)gcc
-*_GCC46_ARM_ASLPP_PATH = ENV(GCC46_ARM_PREFIX)gcc
-*_GCC46_ARM_RC_PATH = ENV(GCC46_ARM_PREFIX)objcopy
-
-*_GCC46_ARM_ARCHCC_FLAGS = -mthumb
-*_GCC46_ARM_PLATFORM_FLAGS = -march=armv7-a
-
-*_GCC46_ARM_ASM_FLAGS = DEF(GCC46_ARM_ASM_FLAGS)
-*_GCC46_ARM_DLINK_FLAGS = DEF(GCC46_ARM_DLINK_FLAGS)
-*_GCC46_ARM_PLATFORM_FLAGS = -march=armv7-a
-*_GCC46_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
-*_GCC46_ARM_RC_FLAGS = DEF(GCC_ARM_RC_FLAGS)
-*_GCC46_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
-
- DEBUG_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -O0
-RELEASE_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -Wno-unused-but-set-variable
-
-####################################################################################
-#
-# GCC 4.7 - This configuration is used to compile under Linux to produce
-# PE/COFF binaries using GCC 4.7.
-#
-####################################################################################
-*_GCC47_*_*_FAMILY = GCC
-
-*_GCC47_*_MAKE_PATH = make
-*_GCC47_*_ASL_PATH = DEF(UNIX_IASL_BIN)
-
-*_GCC47_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
-*_GCC47_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
-*_GCC47_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
-*_GCC47_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
-*_GCC47_*_APP_FLAGS =
-*_GCC47_*_ASL_FLAGS = DEF(IASL_FLAGS)
-*_GCC47_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-
-##################
-# GCC47 IA32 definitions
-##################
-*_GCC47_IA32_OBJCOPY_PATH = DEF(GCC47_IA32_PREFIX)objcopy
-*_GCC47_IA32_CC_PATH = DEF(GCC47_IA32_PREFIX)gcc
-*_GCC47_IA32_SLINK_PATH = DEF(GCC47_IA32_PREFIX)ar
-*_GCC47_IA32_DLINK_PATH = DEF(GCC47_IA32_PREFIX)ld
-*_GCC47_IA32_ASLDLINK_PATH = DEF(GCC47_IA32_PREFIX)ld
-*_GCC47_IA32_ASM_PATH = DEF(GCC47_IA32_PREFIX)gcc
-*_GCC47_IA32_PP_PATH = DEF(GCC47_IA32_PREFIX)gcc
-*_GCC47_IA32_VFRPP_PATH = DEF(GCC47_IA32_PREFIX)gcc
-*_GCC47_IA32_ASLCC_PATH = DEF(GCC47_IA32_PREFIX)gcc
-*_GCC47_IA32_ASLPP_PATH = DEF(GCC47_IA32_PREFIX)gcc
-*_GCC47_IA32_RC_PATH = DEF(GCC47_IA32_PREFIX)objcopy
-
-*_GCC47_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32
-*_GCC47_IA32_ASLDLINK_FLAGS = DEF(GCC47_IA32_X64_ASLDLINK_FLAGS) -m elf_i386
-*_GCC47_IA32_ASM_FLAGS = DEF(GCC47_ASM_FLAGS) -m32 -march=i386
-*_GCC47_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS) -Os
-*_GCC47_IA32_DLINK_FLAGS = DEF(GCC47_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386
-*_GCC47_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
-*_GCC47_IA32_OBJCOPY_FLAGS =
-
-##################
-# GCC47 X64 definitions
-##################
-*_GCC47_X64_OBJCOPY_PATH = DEF(GCC47_X64_PREFIX)objcopy
-*_GCC47_X64_CC_PATH = DEF(GCC47_X64_PREFIX)gcc
-*_GCC47_X64_SLINK_PATH = DEF(GCC47_X64_PREFIX)ar
-*_GCC47_X64_DLINK_PATH = DEF(GCC47_X64_PREFIX)ld
-*_GCC47_X64_ASLDLINK_PATH = DEF(GCC47_X64_PREFIX)ld
-*_GCC47_X64_ASM_PATH = DEF(GCC47_X64_PREFIX)gcc
-*_GCC47_X64_PP_PATH = DEF(GCC47_X64_PREFIX)gcc
-*_GCC47_X64_VFRPP_PATH = DEF(GCC47_X64_PREFIX)gcc
-*_GCC47_X64_ASLCC_PATH = DEF(GCC47_X64_PREFIX)gcc
-*_GCC47_X64_ASLPP_PATH = DEF(GCC47_X64_PREFIX)gcc
-*_GCC47_X64_RC_PATH = DEF(GCC47_X64_PREFIX)objcopy
-
-*_GCC47_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64
-*_GCC47_X64_ASLDLINK_FLAGS = DEF(GCC47_IA32_X64_ASLDLINK_FLAGS) -m elf_x86_64
-*_GCC47_X64_ASM_FLAGS = DEF(GCC47_ASM_FLAGS) -m64
-*_GCC47_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS)
-*_GCC47_X64_DLINK_FLAGS = DEF(GCC47_X64_DLINK_FLAGS)
-*_GCC47_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
-*_GCC47_X64_OBJCOPY_FLAGS =
-
-##################
-# GCC47 ARM definitions
-##################
-*_GCC47_ARM_CC_PATH = ENV(GCC47_ARM_PREFIX)gcc
-*_GCC47_ARM_SLINK_PATH = ENV(GCC47_ARM_PREFIX)ar
-*_GCC47_ARM_DLINK_PATH = ENV(GCC47_ARM_PREFIX)ld
-*_GCC47_ARM_ASLDLINK_PATH = ENV(GCC47_ARM_PREFIX)ld
-*_GCC47_ARM_ASM_PATH = ENV(GCC47_ARM_PREFIX)gcc
-*_GCC47_ARM_PP_PATH = ENV(GCC47_ARM_PREFIX)gcc
-*_GCC47_ARM_VFRPP_PATH = ENV(GCC47_ARM_PREFIX)gcc
-*_GCC47_ARM_ASLCC_PATH = ENV(GCC47_ARM_PREFIX)gcc
-*_GCC47_ARM_ASLPP_PATH = ENV(GCC47_ARM_PREFIX)gcc
-*_GCC47_ARM_RC_PATH = ENV(GCC47_ARM_PREFIX)objcopy
-
-*_GCC46_ARM_ARCHCC_FLAGS = -mthumb
-*_GCC46_ARM_PLATFORM_FLAGS = -march=armv7-a
-
-*_GCC47_ARM_ASM_FLAGS = DEF(GCC47_ARM_ASM_FLAGS)
-*_GCC47_ARM_DLINK_FLAGS = DEF(GCC47_ARM_DLINK_FLAGS)
-*_GCC47_ARM_PLATFORM_FLAGS = -march=armv7-a
-*_GCC47_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
-*_GCC47_ARM_RC_FLAGS = DEF(GCC_ARM_RC_FLAGS)
-*_GCC47_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
-
- DEBUG_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -O0
-RELEASE_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -Wno-unused-but-set-variable
-
-##################
-# GCC47 AARCH64 definitions
-##################
-*_GCC47_AARCH64_CC_PATH = ENV(GCC47_AARCH64_PREFIX)gcc
-*_GCC47_AARCH64_SLINK_PATH = ENV(GCC47_AARCH64_PREFIX)ar
-*_GCC47_AARCH64_DLINK_PATH = ENV(GCC47_AARCH64_PREFIX)ld
-*_GCC47_AARCH64_ASLDLINK_PATH = ENV(GCC47_AARCH64_PREFIX)ld
-*_GCC47_AARCH64_ASM_PATH = ENV(GCC47_AARCH64_PREFIX)gcc
-*_GCC47_AARCH64_PP_PATH = ENV(GCC47_AARCH64_PREFIX)gcc
-*_GCC47_AARCH64_VFRPP_PATH = ENV(GCC47_AARCH64_PREFIX)gcc
-*_GCC47_AARCH64_ASLCC_PATH = ENV(GCC47_AARCH64_PREFIX)gcc
-*_GCC47_AARCH64_ASLPP_PATH = ENV(GCC47_AARCH64_PREFIX)gcc
-*_GCC47_AARCH64_RC_PATH = ENV(GCC47_AARCH64_PREFIX)objcopy
-
-*_GCC47_AARCH64_ASM_FLAGS = DEF(GCC47_AARCH64_ASM_FLAGS)
-*_GCC47_AARCH64_DLINK_FLAGS = DEF(GCC47_AARCH64_DLINK_FLAGS)
-*_GCC47_AARCH64_PLATFORM_FLAGS =
-*_GCC47_AARCH64_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
-*_GCC47_AARCH64_RC_FLAGS = DEF(GCC_AARCH64_RC_FLAGS)
-*_GCC47_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
-
- DEBUG_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -O0
-RELEASE_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable
-
-####################################################################################
-#
-# Cygwin GCC And Intel ACPI Compiler
-#
-####################################################################################
-# CYGGCC - CygWin GCC
-# ASL - Intel ACPI Source Language Compiler (iasl.exe)
-*_CYGGCC_*_*_FAMILY = GCC
-
-*_CYGGCC_*_*_DLL = DEF(CYGWIN_BIN)
-*_CYGGCC_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_CYGGCC_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-
-*_CYGGCC_IA32_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_FLAGS) --image-base=0
-*_CYGGCC_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_FLAGS) --image-base=0
-*_CYGGCC_IA32_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_ASLDLINK_FLAGS)
-*_CYGGCC_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_ASLDLINK_FLAGS)
-*_CYGGCC_*_MAKE_FLAGS = /nologo
-*_CYGGCC_*_ASM_FLAGS = DEF(GCC_ASM_FLAGS)
-*_CYGGCC_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
-*_CYGGCC_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
-*_CYGGCC_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
-*_CYGGCC_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
-*_CYGGCC_*_APP_FLAGS =
-*_CYGGCC_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_CYGGCC_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-
-##################
-# IA32 definitions
-##################
-*_CYGGCC_IA32_CC_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCC_IA32_SLINK_PATH = DEF(CYGWIN_BINIA32)ar
-*_CYGGCC_IA32_DLINK_PATH = DEF(CYGWIN_BINIA32)ld
-*_CYGGCC_IA32_ASM_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCC_IA32_PP_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCC_IA32_APP_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCC_IA32_VFRPP_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCC_IA32_ASLCC_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCC_IA32_ASLPP_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCC_IA32_ASLDLINK_PATH = DEF(CYGWIN_BINIA32)ld
-*_CYGGCC_IA32_RC_PATH = DEF(CYGWIN_BINIA32)objcopy
-*_CYGGCC_IA32_OBJCOPY_PATH = DEF(CYGWIN_BINIA32)objcopy
-
-*_CYGGCC_IA32_CC_FLAGS = DEF(GCC_IA32_CC_FLAGS)
-*_CYGGCC_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
-*_CYGGCC_IA32_OBJCOPY_FLAGS =
-
-##################
-# X64 definitions
-##################
-*_CYGGCC_X64_CC_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCC_X64_SLINK_PATH = DEF(CYGWIN_BINX64)ar
-*_CYGGCC_X64_DLINK_PATH = DEF(CYGWIN_BINX64)ld
-*_CYGGCC_X64_ASM_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCC_X64_PP_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCC_X64_APP_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCC_X64_VFRPP_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCC_X64_ASLCC_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCC_X64_ASLPP_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCC_X64_ASLDLINK_PATH = DEF(CYGWIN_BINX64)ld
-*_CYGGCC_X64_RC_PATH = DEF(CYGWIN_BINX64)objcopy
-*_CYGGCC_X64_OBJCOPY_PATH = DEF(CYGWIN_BINX64)objcopy
-
-*_CYGGCC_X64_CC_FLAGS = DEF(GCC_X64_CC_FLAGS)
-*_CYGGCC_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
-*_CYGGCC_X64_OBJCOPY_FLAGS =
-
-##################
-# IPF definitions
-##################
-*_CYGGCC_IPF_CC_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCC_IPF_SLINK_PATH = DEF(CYGWIN_BINIPF)ar
-*_CYGGCC_IPF_DLINK_PATH = DEF(CYGWIN_BINIPF)ld
-*_CYGGCC_IPF_ASLDLINK_PATH = DEF(CYGWIN_BINIPF)ld
-*_CYGGCC_IPF_ASM_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCC_IPF_PP_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCC_IPF_VFRPP_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCC_IPF_ASLCC_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCC_IPF_ASLPP_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCC_IPF_OBJCOPY_PATH = DEF(CYGWIN_BINIPF)objcopy
-*_CYGGCC_IPF_SYMRENAME_PATH = DEF(CYGWIN_BINIPF)objcopy
-*_CYGGCC_IPF_RC_PATH = DEF(CYGWIN_BINIPF)objcopy
-
-*_CYGGCC_IPF_CC_FLAGS = DEF(GCC_IPF_CC_FLAGS)
-*_CYGGCC_IPF_DLINK_FLAGS = DEF(GCC_IPF_DLINK_FLAGS)
-*_CYGGCC_IPF_OBJCOPY_FLAGS = DEF(GCC_IPF_OBJCOPY_FLAGS)
-*_CYGGCC_IPF_SYMRENAME_FLAGS = DEF(GCC_IPF_SYMRENAME_FLAGS)
-*_CYGGCC_IPF_RC_FLAGS = DEF(GCC_IPF_RC_FLAGS)
-
-##################
-# EBC definitions
-##################
-*_CYGGCC_EBC_*_FAMILY = INTEL
-
-*_CYGGCC_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_CYGGCC_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_CYGGCC_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-*_CYGGCC_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_CYGGCC_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_CYGGCC_EBC_RC_PATH = DEF(MS_VS_BIN)\rc.exe
-
-*_CYGGCC_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_CYGGCC_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_CYGGCC_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /ALIGN:32 /DRIVER
-
-####################################################################################
-#
-# Cygwin GCC And Microsoft ACPI Compiler
-#
-####################################################################################
-# CYGGCCxASL - CygWin GCC
-# ASL - Microsoft ACPI Source Language Compiler (asl.exe)
-*_CYGGCCxASL_*_*_FAMILY = GCC
-
-*_CYGGCCxASL_*_*_DLL = DEF(CYGWIN_BIN)
-*_CYGGCCxASL_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-
-*_CYGGCCxASL_*_MAKE_FLAGS = /nologo
-*_CYGGCCxASL_*_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h
-*_CYGGCCxASL_*_DLINK_FLAGS = -nostdlib -O2 --gc-sections --dll --export-all-symbols --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20
-*_CYGGCCxASL_*_ASM_FLAGS = -c -x assembler -imacros AutoGen.h
-*_CYGGCCxASL_*_APP_FLAGS = -E -x assembler
-*_CYGGCCxASL_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h
-
-##################
-# ASL definitions
-##################
-*_CYGGCCxASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_CYGGCCxASL_*_ASL_FLAGS =
-*_CYGGCCxASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_CYGGCCxASL_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_CYGGCCxASL_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_CYGGCCxASL_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_CYGGCCxASL_IA32_CC_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCCxASL_IA32_SLINK_PATH = DEF(CYGWIN_BINIA32)ar
-*_CYGGCCxASL_IA32_DLINK_PATH = DEF(CYGWIN_BINIA32)ld
-*_CYGGCCxASL_IA32_ASM_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCCxASL_IA32_PP_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCCxASL_IA32_APP_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCCxASL_IA32_VFRPP_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCCxASL_IA32_ASLCC_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCCxASL_IA32_ASLPP_PATH = DEF(CYGWIN_BINIA32)gcc
-*_CYGGCCxASL_IA32_ASLDLINK_PATH = DEF(CYGWIN_BINIA32)ld
-*_CYGGCCxASL_IA32_RC_PATH = DEF(CYGWIN_BINIA32)objcopy
-
-*_CYGGCCxASL_IA32_CC_FLAGS = DEF(GCC_IA32_CC_FLAGS)
-*_CYGGCCxASL_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
-
-##################
-# X64 definitions
-##################
-*_CYGGCCxASL_X64_CC_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCCxASL_X64_SLINK_PATH = DEF(CYGWIN_BINX64)ar
-*_CYGGCCxASL_X64_DLINK_PATH = DEF(CYGWIN_BINX64)ld
-*_CYGGCCxASL_X64_ASM_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCCxASL_X64_PP_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCCxASL_X64_APP_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCCxASL_X64_VFRPP_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCCxASL_X64_ASLCC_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCCxASL_X64_ASLPP_PATH = DEF(CYGWIN_BINX64)gcc
-*_CYGGCCxASL_X64_ASLDLINK_PATH = DEF(CYGWIN_BINX64)ld
-*_CYGGCCxASL_X64_RC_PATH = DEF(CYGWIN_BINX64)objcopy
-
-*_CYGGCCxASL_X64_CC_FLAGS = DEF(GCC_X64_CC_FLAGS)
-*_CYGGCCxASL_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
-
-##################
-# IPF definitions
-##################
-*_CYGGCCxASL_IPF_CC_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCCxASL_IPF_SLINK_PATH = DEF(CYGWIN_BINIPF)ar
-*_CYGGCCxASL_IPF_DLINK_PATH = DEF(CYGWIN_BINIPF)ld
-*_CYGGCCxASL_IPF_ASLDLINK_PATH = DEF(CYGWIN_BINIPF)ld
-*_CYGGCCxASL_IPF_ASM_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCCxASL_IPF_PP_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCCxASL_IPF_VFRPP_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCCxASL_IPF_ASLCC_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCCxASL_IPF_ASLPP_PATH = DEF(CYGWIN_BINIPF)gcc
-*_CYGGCCxASL_IPF_OBJCOPY_PATH = DEF(CYGWIN_BINIPF)objcopy
-*_CYGGCCxASL_IPF_SYMRENAME_PATH = DEF(CYGWIN_BINIPF)objcopy
-*_CYGGCCxASL_IPF_RC_PATH = DEF(CYGWIN_BINIPF)objcopy
-
-*_CYGGCCxASL_IPF_CC_FLAGS = DEF(GCC_IPF_CC_FLAGS)
-*_CYGGCCxASL_IPF_DLINK_FLAGS = DEF(GCC_IPF_DLINK_FLAGS)
-*_CYGGCCxASL_IPF_OBJCOPY_FLAGS = DEF(GCC_IPF_OBJCOPY_FLAGS)
-*_CYGGCCxASL_IPF_SYMRENAME_FLAGS = DEF(GCC_IPF_SYMRENAME_FLAGS)
-*_CYGGCCxASL_IPF_RC_FLAGS = DEF(GCC_IPF_RC_FLAGS)
-
-##################
-# EBC definitions
-##################
-*_CYGGCCxASL_EBC_*_FAMILY = INTEL
-
-*_CYGGCCxASL_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_CYGGCCxASL_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_CYGGCCxASL_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-*_CYGGCCxASL_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_CYGGCCxASL_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_CYGGCCxASL_EBC_RC_PATH = DEF(MS_VS_BIN)\rc.exe
-
-*_CYGGCCxASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_CYGGCCxASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_CYGGCCxASL_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /ALIGN:32 /DRIVER
-
-####################################################################################
-#
-# Elf GCC - This configuration is used to compile on Linux boxes to produce elf
-# binaries.
-#
-####################################################################################
-# ELFGCC - Linux ELF GCC
-*_ELFGCC_*_*_FAMILY = GCC
-*_ELFGCC_*_MAKE_PATH = make
-
-*_ELFGCC_*_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h
-*_ELFGCC_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h
-
-##################
-# ASL definitions
-##################
-*_ELFGCC_*_ASL_PATH = DEF(UNIX_IASL_BIN)
-*_ELFGCC_*_ASL_FLAGS = DEF(IASL_FLAGS)
-*_ELFGCC_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-*_ELFGCC_*_ASLPP_FLAGS = -x c -E -P
-*_ELFGCC_*_ASLCC_FLAGS = -x c
-*_ELFGCC_*_ASLDLINK_FLAGS = DEF(GCC_DLINK_FLAGS_COMMON) --entry _ReferenceAcpiTable
-
-##################
-# IA32 definitions
-##################
-*_ELFGCC_IA32_OBJCOPY_PATH = DEF(ELFGCC_BIN)/objcopy
-*_ELFGCC_IA32_CC_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IA32_SLINK_PATH = DEF(ELFGCC_BIN)/ar
-*_ELFGCC_IA32_DLINK_PATH = DEF(ELFGCC_BIN)/ld
-*_ELFGCC_IA32_ASM_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IA32_PP_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IA32_VFRPP_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IA32_ASLCC_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IA32_ASLPP_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IA32_ASLDLINK_PATH = DEF(ELFGCC_BIN)/ld
-*_ELFGCC_IA32_RC_PATH = DEF(ELFGCC_BIN)/objcopy
-
-*_ELFGCC_IA32_CC_FLAGS = -m32 -g -fshort-wchar -fno-strict-aliasing -Wall -malign-double -c -include $(DEST_DIR_DEBUG)/AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
-*_ELFGCC_IA32_SLINK_FLAGS =
-*_ELFGCC_IA32_DLINK_FLAGS = -melf_i386 -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-#*_ELFGCC_IA32_DLINK_FLAGS = -melf_i386 -nostdlib -n -q -Ttext 0x220 --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT)
-*_ELFGCC_IA32_ASM_FLAGS = -m32 -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
-*_ELFGCC_IA32_PP_FLAGS = -m32 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_ELFGCC_IA32_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-*_ELFGCC_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
-*_ELFGCC_IA32_OBJCOPY_FLAGS =
-
-##################
-# X64 definitions
-##################
-*_ELFGCC_X64_CC_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_X64_ASLCC_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_X64_SLINK_PATH = DEF(ELFGCC_BIN)/ar
-*_ELFGCC_X64_DLINK_PATH = DEF(ELFGCC_BIN)/ld
-*_ELFGCC_X64_ASLDLINK_PATH = DEF(ELFGCC_BIN)/ld
-*_ELFGCC_X64_ASM_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_X64_PP_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_X64_ASLPP_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_X64_VFRPP_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_X64_RC_PATH = DEF(ELFGCC_BIN)/objcopy
-
-*_ELFGCC_X64_CC_FLAGS = -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-address -Wno-array-bounds -c -include AutoGen.h -D_EFI_P64
-*_ELFGCC_X64_DLINK_FLAGS = -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-*_ELFGCC_X64_SLINK_FLAGS =
-*_ELFGCC_X64_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
-*_ELFGCC_X64_PP_FLAGS = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_ELFGCC_X64_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-*_ELFGCC_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
-
-##################
-# IPF definitions
-##################
-*_ELFGCC_IPF_CC_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IPF_ASLCC_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IPF_SLINK_PATH = DEF(ELFGCC_BIN)/ar
-*_ELFGCC_IPF_DLINK_PATH = DEF(ELFGCC_BIN)/ld
-*_ELFGCC_IPF_ASLDLINK_PATH = DEF(ELFGCC_BIN)/ld
-*_ELFGCC_IPF_ASM_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IPF_PP_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IPF_ASLPP_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IPF_VFRPP_PATH = DEF(ELFGCC_BIN)/gcc
-*_ELFGCC_IPF_RC_PATH = DEF(ELFGCC_BIN)/objcopy
-
-*_ELFGCC_IPF_CC_FLAGS = -Os -fshort-wchar -Wall -Werror -c -include AutoGen.h -D_EFI_P64
-*_ELFGCC_IPF_DLINK_FLAGS = -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-*_ELFGCC_IPF_SLINK_FLAGS =
-*_ELFGCC_IPF_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
-*_ELFGCC_IPF_PP_FLAGS = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_ELFGCC_IPF_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-*_ELFGCC_IPF_RC_FLAGS = DEF(GCC_IPF_RC_FLAGS)
-
-####################################################################################
-#
-# Intel(R) C++ Compiler Version 9.1
-#
-# IPF - Intel(R) C++ Compiler for Itanium(R)Version 9.1 Build 20060928 Package ID: W_CC_C_9.1.032
-# ASL - Intel ACPI Source Language Compiler
-#
-####################################################################################
-# ICC - Intel C Compiler V9.1
-*_ICC_*_*_FAMILY = INTEL
-
-*_ICC_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICC_*_RC_PATH = DEF(MS_VS_BIN)\rc.exe
-
-*_ICC_*_MAKE_FLAGS = /nologo
-*_ICC_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICC_*_APP_FLAGS = /nologo /E /TC
-*_ICC_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-
-*_ICC_*_ASM16_PATH = DEF(MS_VS_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_ICC_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_ICC_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_ICC_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_ICC_*_ASLCC_FLAGS = DEF(ICC_WIN_ASLCC_FLAGS)
-*_ICC_*_ASLPP_FLAGS = DEF(ICC_WIN_ASLPP_FLAGS)
-*_ICC_*_ASLDLINK_FLAGS = DEF(ICC_WIN_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_ICC_IA32_CC_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICC_IA32_SLINK_PATH = DEF(ICC_BIN32)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC_IA32_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICC_IA32_DLINK_PATH = DEF(ICC_BIN32)\xilink.exe
-*_ICC_IA32_PP_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICC_IA32_VFRPP_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICC_IA32_APP_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICC_IA32_ASM_PATH = DEF(MS_VS_BIN)\ml.exe
-*_ICC_IA32_ASM_DLL = DEF(MS_VS_DLL)
-*_ICC_IA32_ASLCC_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICC_IA32_ASLPP_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICC_IA32_ASLDLINK_PATH = DEF(ICC_BIN32)\xilink.exe
-
- DEBUG_ICC_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm
-RELEASE_ICC_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF
-NOOPT_ICC_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm /Od
-
- DEBUG_ICC_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-RELEASE_ICC_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd
-NOOPT_ICC_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-
- *_ICC_IA32_SLINK_FLAGS = /nologo
- DEBUG_ICC_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICC_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICC_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_ICC_X64_CC_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICC_X64_SLINK_PATH = DEF(ICC_BINX64)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC_X64_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICC_X64_DLINK_PATH = DEF(ICC_BINX64)\xilink.exe
-*_ICC_X64_PP_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICC_X64_VFRPP_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICC_X64_APP_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICC_X64_ASM_PATH = DEF(WINDDK_BINX64)\ml64.exe
-*_ICC_X64_ASM_DLL = DEF(MS_VS_DLL)
-*_ICC_X64_ASLCC_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICC_X64_ASLPP_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICC_X64_ASLDLINK_PATH = DEF(ICC_BINX64)\xilink.exe
-
- DEBUG_ICC_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF
-RELEASE_ICC_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF
-NOOPT_ICC_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF /Od
-
- DEBUG_ICC_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_ICC_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_ICC_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_ICC_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICC_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICC_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
- *_ICC_X64_SLINK_FLAGS = /nologo /LTCG
-
-
-##################
-# IPF definitions
-##################
-*_ICC_IPF_CC_PATH = DEF(ICC_BIN64)\icl.exe
-# icl.exe needs cl.exe from Visual Studio
-*_ICC_IPF_CC_DLL = DEF(MS_VS_BIN)
-*_ICC_IPF_SLINK_PATH = DEF(ICC_BIN64)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC_IPF_SLINK_DLL = DEF(MS_VS_BIN);DEF(MS_VS_DLL)
-*_ICC_IPF_DLINK_PATH = DEF(ICC_BIN64)\xilink.exe
-*_ICC_IPF_PP_PATH = DEF(ICC_BIN64)\icl.exe
-*_ICC_IPF_VFRPP_PATH = DEF(ICC_BIN64)\icl.exe
-*_ICC_IPF_APP_PATH = DEF(ICC_BIN64)\icl.exe
-*_ICC_IPF_ASM_PATH = DEF(ICC_BIN64)\ias.exe
-*_ICC_IPF_ASLCC_PATH = DEF(ICC_BIN64)\icl.exe
-*_ICC_IPF_ASLPP_PATH = DEF(ICC_BIN64)\icl.exe
-*_ICC_IPF_ASLDLINK_PATH = DEF(ICC_BIN64)\xilink.exe
-
- DEBUG_ICC_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Zi
-RELEASE_ICC_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF
-NOOPT_ICC_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Zi
-
- DEBUG_ICC_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-RELEASE_ICC_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -F COFF32
-NOOPT_ICC_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-
- DEBUG_ICC_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-RELEASE_ICC_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
-NOOPT_ICC_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-
- *_ICC_IPF_SLINK_FLAGS = /nologo
-
-##################
-# EBC definitions
-##################
-*_ICC_EBC_*_FAMILY = INTEL
-
-*_ICC_EBC_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICC_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_ICC_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_ICC_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_ICC_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_ICC_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-
-*_ICC_EBC_MAKE_FLAGS = /nologo
-*_ICC_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_ICC_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_ICC_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICC_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_ICC_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-####################################################################################
-#
-# Intel(R) C++ Compiler Version 9.1
-#
-# IPF - Intel(R) C++ Compiler for Itanium(R)Version 9.1 Build 20060928 Package ID: W_CC_C_9.1.032
-# ASL - Microsoft ACPI Source Language Compiler
-#
-####################################################################################
-# ICCxASL - Intel C Compiler V9.1
-*_ICCxASL_*_*_FAMILY = INTEL
-
-*_ICCxASL_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICCxASL_*_RC_PATH = DEF(MS_VS_BIN)\rc.exe
-
-*_ICCxASL_*_MAKE_FLAGS = /nologo
-*_ICCxASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICCxASL_*_APP_FLAGS = /nologo /E /TC
-*_ICCxASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-
-*_ICCxASL_*_ASM16_PATH = DEF(MS_VS_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_ICCxASL_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_ICCxASL_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_ICCxASL_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_ICCxASL_*_ASLCC_FLAGS = DEF(ICC_WIN_ASLCC_FLAGS)
-*_ICCxASL_*_ASLPP_FLAGS = DEF(ICC_WIN_ASLPP_FLAGS)
-*_ICCxASL_*_ASLDLINK_FLAGS = DEF(ICC_WIN_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_ICCxASL_IA32_CC_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICCxASL_IA32_SLINK_PATH = DEF(ICC_BIN32)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICCxASL_IA32_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICCxASL_IA32_DLINK_PATH = DEF(ICC_BIN32)\xilink.exe
-*_ICCxASL_IA32_PP_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICCxASL_IA32_VFRPP_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICCxASL_IA32_APP_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICCxASL_IA32_ASM_PATH = DEF(MS_VS_BIN)\ml.exe
-*_ICCxASL_IA32_ASM_DLL = DEF(MS_VS_DLL)
-*_ICCxASL_IA32_ASLCC_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICCxASL_IA32_ASLPP_PATH = DEF(ICC_BIN32)\icl.exe
-*_ICCxASL_IA32_ASLDLINK_PATH = DEF(ICC_BIN32)\xilink.exe
-
- DEBUG_ICCxASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm
-RELEASE_ICCxASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF
-NOOPT_ICCxASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm /Od
-
- DEBUG_ICCxASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-RELEASE_ICCxASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd
-NOOPT_ICCxASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-
- *_ICCxASL_IA32_SLINK_FLAGS = /nologo
- DEBUG_ICCxASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICCxASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICCxASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_ICCxASL_X64_CC_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICCxASL_X64_SLINK_PATH = DEF(ICC_BINX64)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICCxASL_X64_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICCxASL_X64_DLINK_PATH = DEF(ICC_BINX64)\xilink.exe
-*_ICCxASL_X64_PP_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICCxASL_X64_VFRPP_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICCxASL_X64_APP_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICCxASL_X64_ASM_PATH = DEF(WINDDK_BINX64)\ml64.exe
-*_ICCxASL_X64_ASM_DLL = DEF(MS_VS_DLL)
-*_ICCxASL_X64_ASLCC_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICCxASL_X64_ASLPP_PATH = DEF(ICC_BINX64)\icl.exe
-*_ICCxASL_X64_ASLDLINK_PATH = DEF(ICC_BINX64)\xilink.exe
-
- DEBUG_ICCxASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF
-RELEASE_ICCxASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF
-NOOPT_ICCxASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF /Od
-
- DEBUG_ICCxASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_ICCxASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_ICCxASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_ICCxASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICCxASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICCxASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
- *_ICCxASL_X64_SLINK_FLAGS = /nologo /LTCG
-
-
-##################
-# IPF definitions
-##################
-*_ICCxASL_IPF_CC_PATH = DEF(ICC_BIN64)\icl.exe
-# icl.exe needs cl.exe from Visual Studio
-*_ICCxASL_IPF_CC_DLL = DEF(MS_VS_BIN)
-*_ICCxASL_IPF_SLINK_PATH = DEF(ICC_BIN64)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICCxASL_IPF_SLINK_DLL = DEF(MS_VS_BIN);DEF(MS_VS_DLL)
-*_ICCxASL_IPF_DLINK_PATH = DEF(ICC_BIN64)\xilink.exe
-*_ICCxASL_IPF_PP_PATH = DEF(ICC_BIN64)\icl.exe
-*_ICCxASL_IPF_VFRPP_PATH = DEF(ICC_BIN64)\icl.exe
-*_ICCxASL_IPF_APP_PATH = DEF(ICC_BIN64)\icl.exe
-*_ICCxASL_IPF_ASM_PATH = DEF(ICC_BIN64)\ias.exe
-*_ICCxASL_IPF_ASLCC_PATH = DEF(ICC_BIN64)\icl.exe
-*_ICCxASL_IPF_ASLPP_PATH = DEF(ICC_BIN64)\icl.exe
-*_ICCxASL_IPF_ASLDLINK_PATH = DEF(ICC_BIN64)\xilink.exe
-
- DEBUG_ICCxASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Zi
-RELEASE_ICCxASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF
-NOOPT_ICCxASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Zi
-
- DEBUG_ICCxASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-RELEASE_ICCxASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -F COFF32
-NOOPT_ICCxASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-
- DEBUG_ICCxASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-RELEASE_ICCxASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
-NOOPT_ICCxASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-
- *_ICCxASL_IPF_SLINK_FLAGS = /nologo
-
-##################
-# EBC definitions
-##################
-*_ICCxASL_EBC_*_FAMILY = INTEL
-
-*_ICCxASL_EBC_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICCxASL_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_ICCxASL_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_ICCxASL_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_ICCxASL_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_ICCxASL_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-
-*_ICCxASL_EBC_MAKE_FLAGS = /nologo
-*_ICCxASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_ICCxASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_ICCxASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICCxASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_ICCxASL_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Intel(R) C++ Compiler Version 9.1 x86 (32-bit on 64-bit OS)
-#
-# ICCx86 - Intel(R) C++ Compiler for Itanium(R)Version 9.1 Build 20060928 Package ID: W_CC_C_9.1.032
-# ASL - Intel ACPI Source Language Compiler
-#
-####################################################################################
-# ICCx86 - Intel C Compiler V9.1
-*_ICCx86_*_*_FAMILY = INTEL
-
-*_ICCx86_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICCx86_*_RC_PATH = DEF(MS_VS_BIN)\rc.exe
-
-*_ICCx86_*_MAKE_FLAGS = /nologo
-*_ICCx86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICCx86_*_APP_FLAGS = /nologo /E /TC
-*_ICCx86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-
-*_ICCx86_*_ASM16_PATH = DEF(MS_VS_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_ICCx86_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_ICCx86_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_ICCx86_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_ICCx86_*_ASLCC_FLAGS = DEF(ICC_WIN_ASLCC_FLAGS)
-*_ICCx86_*_ASLPP_FLAGS = DEF(ICC_WIN_ASLPP_FLAGS)
-*_ICCx86_*_ASLDLINK_FLAGS = DEF(ICC_WIN_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_ICCx86_IA32_CC_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86_IA32_SLINK_PATH = DEF(ICC_BIN32x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICCx86_IA32_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICCx86_IA32_DLINK_PATH = DEF(ICC_BIN32x86)\xilink.exe
-*_ICCx86_IA32_PP_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86_IA32_VFRPP_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86_IA32_APP_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86_IA32_ASM_PATH = DEF(MS_VS_BIN)\ml.exe
-*_ICCx86_IA32_ASM_DLL = DEF(MS_VS_DLL)
-*_ICCx86_IA32_ASLCC_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86_IA32_ASLPP_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86_IA32_ASLDLINK_PATH = DEF(ICC_BIN32x86)\xilink.exe
-
- DEBUG_ICCx86_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm
-RELEASE_ICCx86_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF
-NOOPT_ICCx86_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm /Od
-
- DEBUG_ICCx86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-RELEASE_ICCx86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd
-NOOPT_ICCx86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-
- *_ICCx86_IA32_SLINK_FLAGS = /nologo
- DEBUG_ICCx86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICCx86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICCx86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_ICCx86_X64_CC_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86_X64_SLINK_PATH = DEF(ICC_BINX64x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICCx86_X64_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICCx86_X64_DLINK_PATH = DEF(ICC_BINX64x86)\xilink.exe
-*_ICCx86_X64_PP_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86_X64_VFRPP_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86_X64_APP_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86_X64_ASM_PATH = DEF(WINDDK_BINX64)\ml64.exe
-*_ICCx86_X64_ASM_DLL = DEF(MS_VS_DLL)
-*_ICCx86_X64_ASLCC_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86_X64_ASLPP_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86_X64_ASLDLINK_PATH = DEF(ICC_BINX64x86)\xilink.exe
-
- DEBUG_ICCx86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF
-RELEASE_ICCx86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF
-NOOPT_ICCx86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF /Od
-
- DEBUG_ICCx86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_ICCx86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_ICCx86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_ICCx86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICCx86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICCx86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
- *_ICCx86_X64_SLINK_FLAGS = /nologo /LTCG
-
-
-##################
-# IPF definitions
-##################
-*_ICCx86_IPF_CC_PATH = DEF(ICC_BIN64x86)\icl.exe
-# icl.exe needs cl.exe from Visual Studio
-*_ICCx86_IPF_CC_DLL = DEF(MS_VS_BIN)
-*_ICCx86_IPF_SLINK_PATH = DEF(ICC_BIN64x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICCx86_IPF_SLINK_DLL = DEF(MS_VS_BIN);DEF(MS_VS_DLL)
-*_ICCx86_IPF_DLINK_PATH = DEF(ICC_BIN64x86)\xilink.exe
-*_ICCx86_IPF_PP_PATH = DEF(ICC_BIN64x86)\icl.exe
-*_ICCx86_IPF_VFRPP_PATH = DEF(ICC_BIN64x86)\icl.exe
-*_ICCx86_IPF_APP_PATH = DEF(ICC_BIN64x86)\icl.exe
-*_ICCx86_IPF_ASM_PATH = DEF(ICC_BIN64x86)\ias.exe
-*_ICCx86_IPF_ASLCC_PATH = DEF(ICC_BIN64x86)\icl.exe
-*_ICCx86_IPF_ASLPP_PATH = DEF(ICC_BIN64x86)\icl.exe
-*_ICCx86_IPF_ASLDLINK_PATH = DEF(ICC_BIN64x86)\xilink.exe
-
- DEBUG_ICCx86_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Zi
-RELEASE_ICCx86_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF
-NOOPT_ICCx86_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Zi
-
- DEBUG_ICCx86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-RELEASE_ICCx86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -F COFF32
-NOOPT_ICCx86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-
- DEBUG_ICCx86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-RELEASE_ICCx86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
-NOOPT_ICCx86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-
- *_ICCx86_IPF_SLINK_FLAGS = /nologo
-
-##################
-# EBC definitions
-##################
-*_ICCx86_EBC_*_FAMILY = INTEL
-
-*_ICCx86_EBC_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICCx86_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICCx86_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICCx86_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICCx86_EBC_SLINK_PATH = DEF(EBC_BINx86)\link.exe
-*_ICCx86_EBC_DLINK_PATH = DEF(EBC_BINx86)\link.exe
-
-*_ICCx86_EBC_MAKE_FLAGS = /nologo
-*_ICCx86_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_ICCx86_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_ICCx86_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICCx86_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_ICCx86_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Intel(R) C++ Compiler Version 9.1 x86 (32-bit on 64-bit OS)
-#
-# ICCx86xASL - Intel(R) C++ Compiler for Itanium(R)Version 9.1 Build 20060928 Package ID: W_CC_C_9.1.032
-# ASL - Microsoft ACPI Source Language Compiler
-#
-####################################################################################
-# ICCx86xASL - Intel C Compiler V9.1
-*_ICCx86xASL_*_*_FAMILY = INTEL
-
-*_ICCx86xASL_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICCx86xASL_*_RC_PATH = DEF(MS_VS_BIN)\rc.exe
-
-*_ICCx86xASL_*_MAKE_FLAGS = /nologo
-*_ICCx86xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICCx86xASL_*_APP_FLAGS = /nologo /E /TC
-*_ICCx86xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-
-*_ICCx86ASL_*_ASM16_PATH = DEF(MS_VS_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_ICCx86xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_ICCx86xASL_*_ASL_FLAGS =
-*_ICCx86xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_ICCx86xASL_*_ASLCC_FLAGS = DEF(ICC_WIN_ASLCC_FLAGS)
-*_ICCx86xASL_*_ASLPP_FLAGS = DEF(ICC_WIN_ASLPP_FLAGS)
-*_ICCx86xASL_*_ASLDLINK_FLAGS = DEF(ICC_WIN_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_ICCx86xASL_IA32_CC_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86xASL_IA32_SLINK_PATH = DEF(ICC_BIN32x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICCx86xASL_IA32_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICCx86xASL_IA32_DLINK_PATH = DEF(ICC_BIN32x86)\xilink.exe
-*_ICCx86xASL_IA32_PP_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86xASL_IA32_VFRPP_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86xASL_IA32_APP_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86xASL_IA32_ASM_PATH = DEF(MS_VS_BIN)\ml.exe
-*_ICCx86xASL_IA32_ASM_DLL = DEF(MS_VS_DLL)
-*_ICCx86xASL_IA32_ASLCC_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86xASL_IA32_ASLPP_PATH = DEF(ICC_BIN32x86)\icl.exe
-*_ICCx86xASL_IA32_ASLDLINK_PATH = DEF(ICC_BIN32x86)\xilink.exe
-
- DEBUG_ICCx86xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm
-RELEASE_ICCx86xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF
-NOOPT_ICCx86xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm /Od
-
- DEBUG_ICCx86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-RELEASE_ICCx86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd
-NOOPT_ICCx86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-
- *_ICCx86xASL_IA32_SLINK_FLAGS = /nologo
- DEBUG_ICCx86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICCx86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICCx86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_ICCx86xASL_X64_CC_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86xASL_X64_SLINK_PATH = DEF(ICC_BINX64x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICCx86xASL_X64_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICCx86xASL_X64_DLINK_PATH = DEF(ICC_BINX64x86)\xilink.exe
-*_ICCx86xASL_X64_PP_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86xASL_X64_VFRPP_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86xASL_X64_APP_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86xASL_X64_ASM_PATH = DEF(WINDDK_BINX64)\ml64.exe
-*_ICCx86xASL_X64_ASM_DLL = DEF(MS_VS_DLL)
-*_ICCx86xASL_X64_ASLCC_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86xASL_X64_ASLPP_PATH = DEF(ICC_BINX64x86)\icl.exe
-*_ICCx86xASL_X64_ASLDLINK_PATH = DEF(ICC_BINX64x86)\xilink.exe
-
- DEBUG_ICCx86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF
-RELEASE_ICCx86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF
-NOOPT_ICCx86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF /Od
-
- DEBUG_ICCx86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_ICCx86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_ICCx86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-
- DEBUG_ICCx86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICCx86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICCx86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
- *_ICCx86xASL_X64_SLINK_FLAGS = /nologo /LTCG
-
-
-##################
-# IPF definitions
-##################
-*_ICCx86xASL_IPF_CC_PATH = DEF(ICC_BIN64x86)\icl.exe
-# icl.exe needs cl.exe from Visual Studio
-*_ICCx86xASL_IPF_CC_DLL = DEF(MS_VS_BIN)
-*_ICCx86xASL_IPF_SLINK_PATH = DEF(ICC_BIN64x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICCx86xASL_IPF_SLINK_DLL = DEF(MS_VS_BIN);DEF(MS_VS_DLL)
-*_ICCx86xASL_IPF_DLINK_PATH = DEF(ICC_BIN64x86)\xilink.exe
-*_ICCx86xASL_IPF_PP_PATH = DEF(ICC_BIN64x86)\icl.exe
-*_ICCx86xASL_IPF_VFRPP_PATH = DEF(ICC_BIN64x86)\icl.exe
-*_ICCx86xASL_IPF_APP_PATH = DEF(ICC_BIN64x86)\icl.exe
-*_ICCx86xASL_IPF_ASM_PATH = DEF(ICC_BIN64x86)\ias.exe
-*_ICCx86xASL_IPF_ASLCC_PATH = DEF(ICC_BIN64x86)\icl.exe
-*_ICCx86xASL_IPF_ASLPP_PATH = DEF(ICC_BIN64x86)\icl.exe
-*_ICCx86xASL_IPF_ASLDLINK_PATH = DEF(ICC_BIN64x86)\xilink.exe
-
- DEBUG_ICCx86xASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Zi
-RELEASE_ICCx86xASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF
-NOOPT_ICCx86xASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Zi
-
- DEBUG_ICCx86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-RELEASE_ICCx86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -F COFF32
-NOOPT_ICCx86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-
- DEBUG_ICCx86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-RELEASE_ICCx86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
-NOOPT_ICCx86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-
- *_ICCx86xASL_IPF_SLINK_FLAGS = /nologo
-
-##################
-# EBC definitions
-##################
-*_ICCx86xASL_EBC_*_FAMILY = INTEL
-
-*_ICCx86xASL_EBC_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICCx86xASL_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICCx86xASL_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICCx86xASL_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICCx86xASL_EBC_SLINK_PATH = DEF(EBC_BINx86)\link.exe
-*_ICCx86xASL_EBC_DLINK_PATH = DEF(EBC_BINx86)\link.exe
-
-*_ICCx86xASL_EBC_MAKE_FLAGS = /nologo
-*_ICCx86xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_ICCx86xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_ICCx86xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICCx86xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_ICCx86xASL_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Intel(R) C++ Compiler Version 11.1
-# IA32 - Intel(R) C++ Compiler for applications running on IA32 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_ia32)
-# X64 - Intel(R) C++ Compiler for applications running on Intel(R) 64 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_intel64)
-# IPF - Intel(R) C++ Compiler for applications running on IA-64 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_ia64)
-# ASL - Intel ACPI Source Language Compiler
-#
-####################################################################################
-# ICC11 - Intel C Compiler V11.1
-*_ICC11_*_*_FAMILY = INTEL
-
-*_ICC11_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICC11_*_RC_PATH = DEF(MS_VS_BIN)\rc.exe
-
-*_ICC11_*_MAKE_FLAGS = /nologo
-*_ICC11_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICC11_*_APP_FLAGS = /nologo /E /TC
-*_ICC11_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-
-*_ICC11_*_ASM16_PATH = DEF(MS_VS_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_ICC11_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_ICC11_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_ICC11_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_ICC11_*_ASLCC_FLAGS = DEF(ICC_WIN_ASLCC_FLAGS)
-*_ICC11_*_ASLPP_FLAGS = DEF(ICC_WIN_ASLPP_FLAGS)
-*_ICC11_*_ASLDLINK_FLAGS = DEF(ICC_WIN_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_ICC11_IA32_CC_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11_IA32_SLINK_PATH = DEF(ICC11_BIN32)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11_IA32_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICC11_IA32_DLINK_PATH = DEF(ICC11_BIN32)\xilink.exe
-*_ICC11_IA32_PP_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11_IA32_VFRPP_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11_IA32_APP_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11_IA32_ASM_PATH = DEF(MS_VS_BIN)\ml.exe
-*_ICC11_IA32_ASM_DLL = DEF(MS_VS_DLL)
-*_ICC11_IA32_ASLCC_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11_IA32_ASLPP_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11_IA32_ASLDLINK_PATH = DEF(ICC11_BIN32)\xilink.exe
-
- DEBUG_ICC11_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm
-RELEASE_ICC11_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF
-NOOPT_ICC11_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm /Od
-
- DEBUG_ICC11_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-RELEASE_ICC11_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd
-NOOPT_ICC11_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
- *_ICC11_IA32_SLINK_FLAGS = /nologo
- DEBUG_ICC11_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICC11_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICC11_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_ICC11_X64_CC_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11_X64_SLINK_PATH = DEF(ICC11_BINX64)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11_X64_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICC11_X64_DLINK_PATH = DEF(ICC11_BINX64)\xilink.exe
-*_ICC11_X64_PP_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11_X64_VFRPP_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11_X64_APP_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11_X64_ASM_PATH = DEF(WINDDK_BINX64)\ml64.exe
-*_ICC11_X64_ASM_DLL = DEF(MS_VS_DLL)
-*_ICC11_X64_ASLCC_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11_X64_ASLPP_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11_X64_ASLDLINK_PATH = DEF(ICC11_BINX64)\xilink.exe
-
- DEBUG_ICC11_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF
-RELEASE_ICC11_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF
-NOOPT_ICC11_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF /Od
-
- DEBUG_ICC11_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_ICC11_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_ICC11_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
- DEBUG_ICC11_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICC11_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICC11_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
- *_ICC11_X64_SLINK_FLAGS = /nologo /LTCG
-
-
-##################
-# IPF definitions
-##################
-*_ICC11_IPF_CC_PATH = DEF(ICC11_BIN64)\icl.exe
-# icl.exe needs cl.exe from Visual Studio
-*_ICC11_IPF_CC_DLL = DEF(MS_VS_BIN)
-*_ICC11_IPF_SLINK_PATH = DEF(ICC11_BIN64)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11_IPF_SLINK_DLL = DEF(MS_VS_BIN);DEF(MS_VS_DLL)
-*_ICC11_IPF_DLINK_PATH = DEF(ICC11_BIN64)\xilink.exe
-*_ICC11_IPF_PP_PATH = DEF(ICC11_BIN64)\icl.exe
-*_ICC11_IPF_VFRPP_PATH = DEF(ICC11_BIN64)\icl.exe
-*_ICC11_IPF_APP_PATH = DEF(ICC11_BIN64)\icl.exe
-*_ICC11_IPF_ASM_PATH = DEF(ICC11_BIN64)\ias.exe
-*_ICC11_IPF_ASLCC_PATH = DEF(ICC11_BIN64)\icl.exe
-*_ICC11_IPF_ASLPP_PATH = DEF(ICC11_BIN64)\icl.exe
-*_ICC11_IPF_ASLDLINK_PATH = DEF(ICC11_BIN64)\xilink.exe
-
- DEBUG_ICC11_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding /Zi
-RELEASE_ICC11_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding
-NOOPT_ICC11_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding /Zi
-
- DEBUG_ICC11_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-RELEASE_ICC11_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -F COFF32
-NOOPT_ICC11_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
- DEBUG_ICC11_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-RELEASE_ICC11_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
-NOOPT_ICC11_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-
- *_ICC11_IPF_SLINK_FLAGS = /nologo
-
-##################
-# EBC definitions
-##################
-*_ICC11_EBC_*_FAMILY = INTEL
-
-*_ICC11_EBC_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICC11_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_ICC11_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_ICC11_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_ICC11_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_ICC11_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-
-*_ICC11_EBC_MAKE_FLAGS = /nologo
-*_ICC11_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_ICC11_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_ICC11_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICC11_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_ICC11_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-####################################################################################
-#
-# Intel(R) C++ Compiler Version 11.1
-#
-# IA32 - Intel(R) C++ Compiler for applications running on IA32 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_ia32)
-# X64 - Intel(R) C++ Compiler for applications running on Intel(R) 64 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_intel64)
-# IPF - Intel(R) C++ Compiler for applications running on IA-64 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_ia64)
-# ASL - Microsoft ACPI Source Language Compiler
-#
-####################################################################################
-# ICC11xASL - Intel C Compiler V11.1
-*_ICC11xASL_*_*_FAMILY = INTEL
-
-*_ICC11xASL_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICC11xASL_*_RC_PATH = DEF(MS_VS_BIN)\rc.exe
-
-*_ICC11xASL_*_MAKE_FLAGS = /nologo
-*_ICC11xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICC11xASL_*_APP_FLAGS = /nologo /E /TC
-*_ICC11xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-
-*_ICC11xASL_*_ASM16_PATH = DEF(MS_VS_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_ICC11xASL_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_ICC11xASL_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_ICC11xASL_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_ICC11xASL_*_ASLCC_FLAGS = DEF(ICC_WIN_ASLCC_FLAGS)
-*_ICC11xASL_*_ASLPP_FLAGS = DEF(ICC_WIN_ASLPP_FLAGS)
-*_ICC11xASL_*_ASLDLINK_FLAGS = DEF(ICC_WIN_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_ICC11xASL_IA32_CC_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11xASL_IA32_SLINK_PATH = DEF(ICC11_BIN32)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11xASL_IA32_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICC11xASL_IA32_DLINK_PATH = DEF(ICC11_BIN32)\xilink.exe
-*_ICC11xASL_IA32_PP_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11xASL_IA32_VFRPP_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11xASL_IA32_APP_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11xASL_IA32_ASM_PATH = DEF(MS_VS_BIN)\ml.exe
-*_ICC11xASL_IA32_ASM_DLL = DEF(MS_VS_DLL)
-*_ICC11xASL_IA32_ASLCC_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11xASL_IA32_ASLPP_PATH = DEF(ICC11_BIN32)\icl.exe
-*_ICC11xASL_IA32_ASLDLINK_PATH = DEF(ICC11_BIN32)\xilink.exe
-
- DEBUG_ICC11xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm
-RELEASE_ICC11xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF
-NOOPT_ICC11xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm /Od
-
- DEBUG_ICC11xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-RELEASE_ICC11xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd
-NOOPT_ICC11xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
- *_ICC11xASL_IA32_SLINK_FLAGS = /nologo
- DEBUG_ICC11xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICC11xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICC11xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_ICC11xASL_X64_CC_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11xASL_X64_SLINK_PATH = DEF(ICC11_BINX64)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11xASL_X64_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICC11xASL_X64_DLINK_PATH = DEF(ICC11_BINX64)\xilink.exe
-*_ICC11xASL_X64_PP_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11xASL_X64_VFRPP_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11xASL_X64_APP_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11xASL_X64_ASM_PATH = DEF(WINDDK_BINX64)\ml64.exe
-*_ICC11xASL_X64_ASM_DLL = DEF(MS_VS_DLL)
-*_ICC11xASL_X64_ASLCC_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11xASL_X64_ASLPP_PATH = DEF(ICC11_BINX64)\icl.exe
-*_ICC11xASL_X64_ASLDLINK_PATH = DEF(ICC11_BINX64)\xilink.exe
-
- DEBUG_ICC11xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF
-RELEASE_ICC11xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF
-NOOPT_ICC11xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF /Od
-
- DEBUG_ICC11xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_ICC11xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_ICC11xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
- DEBUG_ICC11xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICC11xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICC11xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
- *_ICC11xASL_X64_SLINK_FLAGS = /nologo /LTCG
-
-
-##################
-# IPF definitions
-##################
-*_ICC11xASL_IPF_CC_PATH = DEF(ICC11_BIN64)\icl.exe
-# icl.exe needs cl.exe from Visual Studio
-*_ICC11xASL_IPF_CC_DLL = DEF(MS_VS_BIN)
-*_ICC11xASL_IPF_SLINK_PATH = DEF(ICC11_BIN64)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11xASL_IPF_SLINK_DLL = DEF(MS_VS_BIN);DEF(MS_VS_DLL)
-*_ICC11xASL_IPF_DLINK_PATH = DEF(ICC11_BIN64)\xilink.exe
-*_ICC11xASL_IPF_PP_PATH = DEF(ICC11_BIN64)\icl.exe
-*_ICC11xASL_IPF_VFRPP_PATH = DEF(ICC11_BIN64)\icl.exe
-*_ICC11xASL_IPF_APP_PATH = DEF(ICC11_BIN64)\icl.exe
-*_ICC11xASL_IPF_ASM_PATH = DEF(ICC11_BIN64)\ias.exe
-*_ICC11xASL_IPF_ASLCC_PATH = DEF(ICC11_BIN64)\icl.exe
-*_ICC11xASL_IPF_ASLPP_PATH = DEF(ICC11_BIN64)\icl.exe
-*_ICC11xASL_IPF_ASLDLINK_PATH = DEF(ICC11_BIN64)\xilink.exe
-
- DEBUG_ICC11xASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding /Zi
-RELEASE_ICC11xASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding
-NOOPT_ICC11xASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding /Zi
-
- DEBUG_ICC11xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-RELEASE_ICC11xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -F COFF32
-NOOPT_ICC11xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-
- DEBUG_ICC11xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-RELEASE_ICC11xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
-NOOPT_ICC11xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-
- *_ICC11xASL_IPF_SLINK_FLAGS = /nologo
-
-##################
-# EBC definitions
-##################
-*_ICC11xASL_EBC_*_FAMILY = INTEL
-
-*_ICC11xASL_EBC_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICC11xASL_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_ICC11xASL_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_ICC11xASL_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_ICC11xASL_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_ICC11xASL_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-
-*_ICC11xASL_EBC_MAKE_FLAGS = /nologo
-*_ICC11xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_ICC11xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_ICC11xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICC11xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_ICC11xASL_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Intel(R) C++ Compiler Version 11.1 x86 (32-bit on 64-bit OS)
-#
-# IA32 - Intel(R) C++ Compiler for applications running on IA32 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_ia32)
-# X64 - Intel(R) C++ Compiler for applications running on Intel(R) 64 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_intel64)
-# IPF - Intel(R) C++ Compiler for applications running on IA-64 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_ia64)
-# ASL - Intel ACPI Source Language Compiler
-#
-####################################################################################
-# ICC11x86 - Intel C Compiler V11.1
-*_ICC11x86_*_*_FAMILY = INTEL
-
-*_ICC11x86_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICC11x86_*_RC_PATH = DEF(MS_VS_BIN)\rc.exe
-
-*_ICC11x86_*_MAKE_FLAGS = /nologo
-*_ICC11x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICC11x86_*_APP_FLAGS = /nologo /E /TC
-*_ICC11x86_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-
-*_ICC11x86_*_ASM16_PATH = DEF(MS_VS_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_ICC11x86_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_ICC11x86_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_ICC11x86_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_ICC11x86_*_ASLCC_FLAGS = DEF(ICC_WIN_ASLCC_FLAGS)
-*_ICC11x86_*_ASLPP_FLAGS = DEF(ICC_WIN_ASLPP_FLAGS)
-*_ICC11x86_*_ASLDLINK_FLAGS = DEF(ICC_WIN_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_ICC11x86_IA32_CC_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86_IA32_SLINK_PATH = DEF(ICC11_BIN32x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11x86_IA32_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICC11x86_IA32_DLINK_PATH = DEF(ICC11_BIN32x86)\xilink.exe
-*_ICC11x86_IA32_PP_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86_IA32_VFRPP_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86_IA32_APP_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86_IA32_ASM_PATH = DEF(MS_VS_BIN)\ml.exe
-*_ICC11x86_IA32_ASM_DLL = DEF(MS_VS_DLL)
-*_ICC11x86_IA32_ASLCC_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86_IA32_ASLPP_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86_IA32_ASLDLINK_PATH = DEF(ICC11_BIN32x86)\xilink.exe
-
- DEBUG_ICC11x86_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm
-RELEASE_ICC11x86_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF
-NOOPT_ICC11x86_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm /Od
- DEBUG_ICC11x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-RELEASE_ICC11x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd
-NOOPT_ICC11x86_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
- *_ICC11x86_IA32_SLINK_FLAGS = /nologo
- DEBUG_ICC11x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICC11x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICC11x86_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_ICC11x86_X64_CC_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86_X64_SLINK_PATH = DEF(ICC11_BINX64x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11x86_X64_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICC11x86_X64_DLINK_PATH = DEF(ICC11_BINX64x86)\xilink.exe
-*_ICC11x86_X64_PP_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86_X64_VFRPP_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86_X64_APP_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86_X64_ASM_PATH = DEF(WINDDK_BINX64)\ml64.exe
-*_ICC11x86_X64_ASM_DLL = DEF(MS_VS_DLL)
-*_ICC11x86_X64_ASLCC_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86_X64_ASLPP_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86_X64_ASLDLINK_PATH = DEF(ICC11_BINX64x86)\xilink.exe
-
- DEBUG_ICC11x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF
-RELEASE_ICC11x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF
-NOOPT_ICC11x86_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF /Od
- DEBUG_ICC11x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_ICC11x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_ICC11x86_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
- DEBUG_ICC11x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICC11x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICC11x86_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
- *_ICC11x86_X64_SLINK_FLAGS = /nologo /LTCG
-
-
-##################
-# IPF definitions
-##################
-*_ICC11x86_IPF_CC_PATH = DEF(ICC11_BIN64x86)\icl.exe
-# icl.exe needs cl.exe from Visual Studio
-*_ICC11x86_IPF_CC_DLL = DEF(MS_VS_BIN)
-*_ICC11x86_IPF_SLINK_PATH = DEF(ICC11_BIN64x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11x86_IPF_SLINK_DLL = DEF(MS_VS_BIN);DEF(MS_VS_DLL)
-*_ICC11x86_IPF_DLINK_PATH = DEF(ICC11_BIN64x86)\xilink.exe
-*_ICC11x86_IPF_PP_PATH = DEF(ICC11_BIN64x86)\icl.exe
-*_ICC11x86_IPF_VFRPP_PATH = DEF(ICC11_BIN64x86)\icl.exe
-*_ICC11x86_IPF_APP_PATH = DEF(ICC11_BIN64x86)\icl.exe
-*_ICC11x86_IPF_ASM_PATH = DEF(ICC11_BIN64x86)\ias.exe
-*_ICC11x86_IPF_ASLCC_PATH = DEF(ICC11_BIN64x86)\icl.exe
-*_ICC11x86_IPF_ASLPP_PATH = DEF(ICC11_BIN64x86)\icl.exe
-*_ICC11x86_IPF_ASLDLINK_PATH = DEF(ICC11_BIN64x86)\xilink.exe
-
- DEBUG_ICC11x86_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding /Zi
-RELEASE_ICC11x86_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding
-NOOPT_ICC11x86_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding /Zi
-
- DEBUG_ICC11x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-RELEASE_ICC11x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -F COFF32
-NOOPT_ICC11x86_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
- DEBUG_ICC11x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-RELEASE_ICC11x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
-NOOPT_ICC11x86_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-
- *_ICC11x86_IPF_SLINK_FLAGS = /nologo
-
-##################
-# EBC definitions
-##################
-*_ICC11x86_EBC_*_FAMILY = INTEL
-
-*_ICC11x86_EBC_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICC11x86_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICC11x86_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICC11x86_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICC11x86_EBC_SLINK_PATH = DEF(EBC_BINx86)\link.exe
-*_ICC11x86_EBC_DLINK_PATH = DEF(EBC_BINx86)\link.exe
-
-*_ICC11x86_EBC_MAKE_FLAGS = /nologo
-*_ICC11x86_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_ICC11x86_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_ICC11x86_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICC11x86_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_ICC11x86_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Intel(R) C++ Compiler Version 11.1 x86 (32-bit on 64-bit OS)
-#
-# IA32 - Intel(R) C++ Compiler for applications running on IA32 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_ia32)
-# X64 - Intel(R) C++ Compiler for applications running on Intel(R) 64 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_intel64)
-# IPF - Intel(R) C++ Compiler for applications running on IA-64 (Version 11.1 Build 072 Package ID: w_cproc_p_11.1.072_ia64)
-# ASL - Microsoft ACPI Source Language Compiler
-#
-####################################################################################
-# ICC11x86xASL - Intel C Compiler V11.1
-*_ICC11x86xASL_*_*_FAMILY = INTEL
-
-*_ICC11x86xASL_*_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICC11x86xASL_*_RC_PATH = DEF(MS_VS_BIN)\rc.exe
-
-*_ICC11x86xASL_*_MAKE_FLAGS = /nologo
-*_ICC11x86xASL_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICC11x86xASL_*_APP_FLAGS = /nologo /E /TC
-*_ICC11x86xASL_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-
-*_ICC11x86xASL_*_ASM16_PATH = DEF(MS_VS_BIN)\ml.exe
-
-##################
-# ASL definitions
-##################
-*_ICC11x86xASL_*_ASL_PATH = DEF(WIN_ASL_BIN)
-*_ICC11x86xASL_*_ASL_FLAGS =
-*_ICC11x86xASL_*_ASL_OUTFLAGS = DEF(MS_ASL_OUTFLAGS)
-*_ICC11x86xASL_*_ASLCC_FLAGS = DEF(ICC_WIN_ASLCC_FLAGS)
-*_ICC11x86xASL_*_ASLPP_FLAGS = DEF(ICC_WIN_ASLPP_FLAGS)
-*_ICC11x86xASL_*_ASLDLINK_FLAGS = DEF(ICC_WIN_ASLDLINK_FLAGS)
-
-##################
-# IA32 definitions
-##################
-*_ICC11x86xASL_IA32_CC_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86xASL_IA32_SLINK_PATH = DEF(ICC11_BIN32x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11x86xASL_IA32_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICC11x86xASL_IA32_DLINK_PATH = DEF(ICC11_BIN32x86)\xilink.exe
-*_ICC11x86xASL_IA32_PP_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86xASL_IA32_VFRPP_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86xASL_IA32_APP_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86xASL_IA32_ASM_PATH = DEF(MS_VS_BIN)\ml.exe
-*_ICC11x86xASL_IA32_ASM_DLL = DEF(MS_VS_DLL)
-*_ICC11x86xASL_IA32_ASLCC_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86xASL_IA32_ASLPP_PATH = DEF(ICC11_BIN32x86)\icl.exe
-*_ICC11x86xASL_IA32_ASLDLINK_PATH = DEF(ICC11_BIN32x86)\xilink.exe
-
- DEBUG_ICC11x86xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm
-RELEASE_ICC11x86xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /O1ib2 /GL /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF
-NOOPT_ICC11x86xASL_IA32_CC_FLAGS = /nologo /c /WX /W4 /Gy /Gs32768 /D UNICODE /DEFI_FIRMWARE_VENDOR=L\"INTEL\" /FIAutoGen.h /EHs-c- /GF /Zi /Gm /Od
-
- DEBUG_ICC11x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
-RELEASE_ICC11x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd
-NOOPT_ICC11x86xASL_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Zd /Zi
- *_ICC11x86xASL_IA32_SLINK_FLAGS = /nologo
- DEBUG_ICC11x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICC11x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICC11x86xASL_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# X64 definitions
-##################
-*_ICC11x86xASL_X64_CC_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86xASL_X64_SLINK_PATH = DEF(ICC11_BINX64x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11x86xASL_X64_SLINK_DLL = DEF(MS_VS_BIN)
-*_ICC11x86xASL_X64_DLINK_PATH = DEF(ICC11_BINX64x86)\xilink.exe
-*_ICC11x86xASL_X64_PP_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86xASL_X64_VFRPP_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86xASL_X64_APP_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86xASL_X64_ASM_PATH = DEF(WINDDK_BINX64)\ml64.exe
-*_ICC11x86xASL_X64_ASM_DLL = DEF(MS_VS_DLL)
-*_ICC11x86xASL_X64_ASLCC_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86xASL_X64_ASLPP_PATH = DEF(ICC11_BINX64x86)\icl.exe
-*_ICC11x86xASL_X64_ASLDLINK_PATH = DEF(ICC11_BINX64x86)\xilink.exe
-
- DEBUG_ICC11x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF
-RELEASE_ICC11x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF
-NOOPT_ICC11x86xASL_X64_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /Gy /FI$(DEST_DIR_DEBUG)/AutoGen.h /Zi /Gm /EHs-c- /GF /Od
-
- DEBUG_ICC11x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_ICC11x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_ICC11x86xASL_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
- DEBUG_ICC11x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_ICC11x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_ICC11x86xASL_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:CONSOLE /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
- *_ICC11x86xASL_X64_SLINK_FLAGS = /nologo /LTCG
-
-
-##################
-# IPF definitions
-##################
-*_ICC11x86xASL_IPF_CC_PATH = DEF(ICC11_BIN64x86)\icl.exe
-# icl.exe needs cl.exe from Visual Studio
-*_ICC11x86xASL_IPF_CC_DLL = DEF(MS_VS_BIN)
-*_ICC11x86xASL_IPF_SLINK_PATH = DEF(ICC11_BIN64x86)\xilib.exe
-# xilib.exe needs lib.exe from Visual Studio
-*_ICC11x86xASL_IPF_SLINK_DLL = DEF(MS_VS_BIN);DEF(MS_VS_DLL)
-*_ICC11x86xASL_IPF_DLINK_PATH = DEF(ICC11_BIN64x86)\xilink.exe
-*_ICC11x86xASL_IPF_PP_PATH = DEF(ICC11_BIN64x86)\icl.exe
-*_ICC11x86xASL_IPF_VFRPP_PATH = DEF(ICC11_BIN64x86)\icl.exe
-*_ICC11x86xASL_IPF_APP_PATH = DEF(ICC11_BIN64x86)\icl.exe
-*_ICC11x86xASL_IPF_ASM_PATH = DEF(ICC11_BIN64x86)\ias.exe
-*_ICC11x86xASL_IPF_ASLCC_PATH = DEF(ICC11_BIN64x86)\icl.exe
-*_ICC11x86xASL_IPF_ASLPP_PATH = DEF(ICC11_BIN64x86)\icl.exe
-*_ICC11x86xASL_IPF_ASLDLINK_PATH = DEF(ICC11_BIN64x86)\xilink.exe
-
- DEBUG_ICC11x86xASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding /Zi
-RELEASE_ICC11x86xASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding
-NOOPT_ICC11x86xASL_IPF_CC_FLAGS = /nologo /c /WX /W4 /GX /Gy /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /QIA64_fr32 /GF /Qfreestanding /Zi
- DEBUG_ICC11x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
-RELEASE_ICC11x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -F COFF32
-NOOPT_ICC11x86xASL_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W3 -d debug -F COFF32
- DEBUG_ICC11x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
-RELEASE_ICC11x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
-NOOPT_ICC11x86xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF,ICF /IGNORE:4001 /MAP /ALIGN:64 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEST_DIR_DEBUG)/$(BASE_NAME).pdb /DEBUG
- *_ICC11x86xASL_IPF_SLINK_FLAGS = /nologo
-
-##################
-# EBC definitions
-##################
-*_ICC11x86xASL_EBC_*_FAMILY = INTEL
-
-*_ICC11x86xASL_EBC_MAKE_PATH = DEF(MS_VS_BIN)\nmake.exe
-*_ICC11x86xASL_EBC_PP_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICC11x86xASL_EBC_VFRPP_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICC11x86xASL_EBC_CC_PATH = DEF(EBC_BINx86)\iec.exe
-*_ICC11x86xASL_EBC_SLINK_PATH = DEF(EBC_BINx86)\link.exe
-*_ICC11x86xASL_EBC_DLINK_PATH = DEF(EBC_BINx86)\link.exe
-
-*_ICC11x86xASL_EBC_MAKE_FLAGS = /nologo
-*_ICC11x86xASL_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_ICC11x86xASL_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_ICC11x86xASL_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_ICC11x86xASL_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_ICC11x86xASL_EBC_DLINK_FLAGS = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# MYTOOLS
-# IA32 - Microsoft Visual Studio 2008 Team Suite
-# X64 - Microsoft Visual Studio 2008 Team Suite
-# IPF - Microsoft Windows DDK 3790.1830
-# EBC - Intel EFI Byte Code Compiler
-#
-####################################################################################
-# MYTOOLS - Settings compatible with previous versions of tools_def.template
-*_MYTOOLS_*_*_FAMILY = MSFT
-
-##################
-# ASL definitions
-##################
-*_MYTOOLS_*_ASL_PATH = DEF(DEFAULT_WIN_ASL_BIN)
-*_MYTOOLS_*_ASL_FLAGS = DEF(DEFAULT_WIN_ASL_FLAGS)
-*_MYTOOLS_*_ASL_OUTFLAGS = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
-*_MYTOOLS_*_ASLCC_FLAGS = DEF(MSFT_ASLCC_FLAGS)
-*_MYTOOLS_*_ASLPP_FLAGS = DEF(MSFT_ASLPP_FLAGS)
-*_MYTOOLS_*_ASLDLINK_FLAGS = DEF(MSFT_ASLDLINK_FLAGS)
-
-
-*_MYTOOLS_*_MAKE_FLAGS = /nologo
-*_MYTOOLS_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_MYTOOLS_*_APP_FLAGS = /nologo /E /TC
-*_MYTOOLS_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_MYTOOLS_*_SLINK_FLAGS = /nologo /LTCG
-
-*_MYTOOLS_*_ASM16_PATH = DEF(VS2008_BIN)\ml.exe
-
-##################
-# IA32 definitions
-##################
-*_MYTOOLS_IA32_*_DLL = DEF(VS2008_DLL)
-
-*_MYTOOLS_IA32_MAKE_PATH = DEF(VS2008_BIN)\nmake.exe
-*_MYTOOLS_IA32_CC_PATH = DEF(VS2008_BIN)\cl.exe
-*_MYTOOLS_IA32_SLINK_PATH = DEF(VS2008_BIN)\lib.exe
-*_MYTOOLS_IA32_DLINK_PATH = DEF(VS2008_BIN)\link.exe
-*_MYTOOLS_IA32_PP_PATH = DEF(VS2008_BIN)\cl.exe
-*_MYTOOLS_IA32_VFRPP_PATH = DEF(VS2008_BIN)\cl.exe
-*_MYTOOLS_IA32_APP_PATH = DEF(VS2008_BIN)\cl.exe
-*_MYTOOLS_IA32_ASM_PATH = DEF(VS2008_BIN)\ml.exe
-*_MYTOOLS_IA32_ASLCC_PATH = DEF(VS2008_BIN)\cl.exe
-*_MYTOOLS_IA32_ASLPP_PATH = DEF(VS2008_BIN)\cl.exe
-*_MYTOOLS_IA32_ASLDLINK_PATH = DEF(VS2008_BIN)\link.exe
-*_MYTOOLS_IA32_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
- DEBUG_MYTOOLS_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_MYTOOLS_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_MYTOOLS_IA32_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /Gy /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
- DEBUG_MYTOOLS_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd /Zi
-RELEASE_MYTOOLS_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd
-NOOPT_MYTOOLS_IA32_ASM_FLAGS = /nologo /c /WX /W3 /coff /Cx /Zd /Zi
- DEBUG_MYTOOLS_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-RELEASE_MYTOOLS_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_MYTOOLS_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-
-##################
-# x64 definitions
-##################
-*_MYTOOLS_X64_*_DLL = DEF(VS2008_DLL)
-
-*_MYTOOLS_X64_MAKE_PATH = DEF(VS2008_BIN)\nmake.exe
-*_MYTOOLS_X64_CC_PATH = DEF(VS2008_BINX64)\cl.exe
-*_MYTOOLS_X64_SLINK_PATH = DEF(VS2008_BINX64)\lib.exe
-*_MYTOOLS_X64_DLINK_PATH = DEF(VS2008_BINX64)\link.exe
-*_MYTOOLS_X64_PP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_MYTOOLS_X64_VFRPP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_MYTOOLS_X64_APP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_MYTOOLS_X64_ASM_PATH = DEF(VS2008_BINX64)\ml64.exe
-*_MYTOOLS_X64_ASLCC_PATH = DEF(VS2008_BINX64)\cl.exe
-*_MYTOOLS_X64_ASLPP_PATH = DEF(VS2008_BINX64)\cl.exe
-*_MYTOOLS_X64_ASLDLINK_PATH = DEF(VS2008_BINX64)\link.exe
-*_MYTOOLS_X64_RC_PATH = DEF(WINSDK_BIN)\rc.exe
-
- DEBUG_MYTOOLS_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
-RELEASE_MYTOOLS_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /Gy /D UNICODE /O1ib2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
-NOOPT_MYTOOLS_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768 /Gy /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
- DEBUG_MYTOOLS_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
-RELEASE_MYTOOLS_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd
-NOOPT_MYTOOLS_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi
- DEBUG_MYTOOLS_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-RELEASE_MYTOOLS_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.data=.text /MERGE:.rdata=.text
-NOOPT_MYTOOLS_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
-
-##################
-# IPF definitions
-##################
-*_MYTOOLS_IPF_MAKE_PATH = DEF(WINDDK_BIN32)\nmake.exe
-*_MYTOOLS_IPF_CC_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_MYTOOLS_IPF_SLINK_PATH = DEF(WINDDK_BIN64)\lib.exe
-*_MYTOOLS_IPF_DLINK_PATH = DEF(WINDDK_BIN64)\link.exe
-*_MYTOOLS_IPF_PP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_MYTOOLS_IPF_VFRPP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_MYTOOLS_IPF_APP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_MYTOOLS_IPF_ASM_PATH = DEF(WINDDK_BIN64)\ias.exe
-*_MYTOOLS_IPF_ASLCC_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_MYTOOLS_IPF_ASLPP_PATH = DEF(WINDDK_BIN64)\cl.exe
-*_MYTOOLS_IPF_ASLDLINK_PATH = DEF(WINDDK_BIN64)\link.exe
-*_MYTOOLS_IPF_RC_PATH = DEF(WINDDK_BIN32)\rc.exe
-
- *_MYTOOLS_IPF_ASM_OUTPUT = "-o "
- DEBUG_MYTOOLS_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gy /Ox /GL /FIAutoGen.h /EHs-c- /GR- /GF /Zx /QIPF_fr32 /Zi
-RELEASE_MYTOOLS_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gy /Ox /GL /FIAutoGen.h /EHs-c- /GR- /GF /Zx /QIPF_fr32
-NOOPT_MYTOOLS_IPF_CC_FLAGS = /nologo /c /WX /GS- /X /W4 /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zx /QIPF_fr32 /Zi /Od
- DEBUG_MYTOOLS_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
-RELEASE_MYTOOLS_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4
-NOOPT_MYTOOLS_IPF_ASM_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -d debug
- DEBUG_MYTOOLS_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF /OPT:ICF=10 /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
-RELEASE_MYTOOLS_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF /OPT:ICF=10 /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb
-NOOPT_MYTOOLS_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF /OPT:ICF=10 /IGNORE:4001 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:IA64 /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MAP:$(DEST_DIR_DEBUG)/$(BASE_NAME).map /PDB:$(DEBUG_DIR)/$(BASE_NAME).pdb /DEBUG
- *_MYTOOLS_IPF_SLINK_FLAGS = /nologo /LTCG
-
-##################
-# EBC definitions
-##################
-*_MYTOOLS_EBC_*_FAMILY = INTEL
-
-*_MYTOOLS_EBC_MAKE_PATH = DEF(VS2005_BIN)\nmake.exe
-*_MYTOOLS_EBC_PP_PATH = DEF(EBC_BIN)\iec.exe
-*_MYTOOLS_EBC_VFRPP_PATH = DEF(EBC_BIN)\iec.exe
-*_MYTOOLS_EBC_CC_PATH = DEF(EBC_BIN)\iec.exe
-*_MYTOOLS_EBC_SLINK_PATH = DEF(EBC_BIN)\link.exe
-*_MYTOOLS_EBC_DLINK_PATH = DEF(EBC_BIN)\link.exe
-*_MYTOOLS_EBC_RC_PATH = DEF(VS2005_BIN)\rc.exe
-
-*_MYTOOLS_EBC_MAKE_FLAGS = /nologo
-*_MYTOOLS_EBC_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
-*_MYTOOLS_EBC_CC_FLAGS = /nologo /c /WX /W3 /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
-*_MYTOOLS_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
-*_MYTOOLS_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC
-*_MYTOOLS_EBC_DLINK_FLAGS = "C:\Program Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
-
-
-####################################################################################
-#
-# Xcode Support for building on Mac OS X (Snow Leopard)
-#
-####################################################################################
-# XCODE32 - Xcode 3.2 Tools (Snow Leopard)
-*_XCODE32_*_*_FAMILY = GCC
-*_XCODE32_*_*_BUILDRULEFAMILY = XCODE
-
-
-*_XCODE32_*_ASL_PATH = /usr/bin/iasl
-
-*_XCODE32_*_MAKE_PATH = make
-
-*_XCODE32_*_DSYMUTIL_PATH = /usr/bin/dsymutil
-
-# This tool needs to be installed seperatly from Xcode 3.2
-*_XCODE32_*_MTOC_PATH = /usr/local/bin/mtoc
-
- DEBUG_XCODE32_*_MTOC_FLAGS = -align 0x20 -d $(DEBUG_DIR)/$(MODULE_NAME).dll
-RELEASE_XCODE32_*_MTOC_FLAGS = -align 0x20
-
-##################
-# IA32 definitions
-##################
-*_XCODE32_IA32_CC_PATH = gcc
-*_XCODE32_IA32_SLINK_PATH = libtool
-*_XCODE32_IA32_DLINK_PATH = ld
-*_XCODE32_IA32_ASM_PATH = as
-*_XCODE32_IA32_PP_PATH = gcc
-*_XCODE32_IA32_VFRPP_PATH = gcc
-*_XCODE32_IA32_ASL_PATH = iasl
-*_XCODE32_IA32_ASLCC_PATH = gcc
-*_XCODE32_IA32_ASLPP_PATH = gcc
-*_XCODE32_IA32_ASLDLINK_PATH = ld
-
- DEBUG_XCODE32_IA32_DLINK_FLAGS = -arch i386 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_strip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-RELEASE_XCODE32_IA32_DLINK_FLAGS = -arch i386 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_strip -seg1addr 0x220 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-*_XCODE32_IA32_SLINK_FLAGS = -static -o
- DEBUG_XCODE32_IA32_ASM_FLAGS = -arch i386 -g
-RELEASE_XCODE32_IA32_ASM_FLAGS = -arch i386
-*_XCODE32_IA32_PP_FLAGS = -arch i386 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_XCODE32_IA32_VFRPP_FLAGS = -arch i386 -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
- DEBUG_XCODE32_IA32_CC_FLAGS = -arch i386 -save-temps -g -O0 -combine -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic -fno-stack-protector
-RELEASE_XCODE32_IA32_CC_FLAGS = -arch i386 -Oz -combine -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h -mdynamic-no-pic -fno-stack-protector
-
-*_XCODE32_IA32_ASLCC_FLAGS = -arch i386 -x c -save-temps -g -O0 -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic
-*_XCODE32_IA32_ASLDLINK_FLAGS = -arch i386 -e _main -preload -segalign 0x20 -pie -seg1addr 0x220 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-*_XCODE32_IA32_ASLPP_FLAGS = -arch i386 -x c -E
-*_XCODE32_IA32_ASL_FLAGS =
-
-##################
-# X64 definitions - still a work in progress. This tool chain does not produce
-# the correct ABI, it is just used to compile the code....
-##################
-*_XCODE32_X64_CC_PATH = gcc
-*_XCODE32_X64_SLINK_PATH = libtool
-*_XCODE32_X64_DLINK_PATH = ld
-*_XCODE32_X64_ASM_PATH = as
-*_XCODE32_X64_PP_PATH = gcc
-*_XCODE32_X64_VFRPP_PATH = gcc
-*_XCODE32_X64_ASL_PATH = iasl
-*_XCODE32_X64_ASLCC_PATH = gcc
-*_XCODE32_X64_ASLPP_PATH = gcc
-*_XCODE32_X64_ASLDLINK_PATH = ld
-
-*_XCODE32_X64_DLINK_FLAGS = -arch x86_64 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-*_XCODE32_X64_SLINK_FLAGS = -static -o
-
- DEBUG_XCODE32_X64_ASM_FLAGS = -arch x86_64 -g
-RELEASE_XCODE32_X64_ASM_FLAGS = -arch x86_64
-*_XCODE32_X64_PP_FLAGS = -arch x86_64 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_XCODE32_X64_VFRPP_FLAGS = -arch x86_64 -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-
- DEBUG_XCODE32_X64_CC_FLAGS = -arch x86_64 -save-temps -g -O0 -combine -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-address -fomit-frame-pointer -static -c -include AutoGen.h -fno-stack-protector
-RELEASE_XCODE32_X64_CC_FLAGS = -arch x86_64 -Oz -combine -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-address -fomit-frame-pointer -static -c -include AutoGen.h -fno-stack-protector
-
-##################
-# ARM definitions - (Assumes iPhone SDK installed on Snow Leopard)
-##################
-
-*_XCODE32_ARM_ARCHCC_FLAGS = -arch armv7 -march=armv7 -mthumb
-*_XCODE32_ARM_ARCHASM_FLAGS = -arch armv7
-*_XCODE32_ARM_ARCHDLINK_FLAGS = -arch armv7
-*_XCODE32_ARM_PLATFORM_FLAGS =
-
-*_XCODE32_ARM_CC_PATH = DEF(IPHONE_TOOLS)/usr/bin/gcc
-*_XCODE32_ARM_SLINK_PATH = DEF(IPHONE_TOOLS)/usr/bin/libtool
-*_XCODE32_ARM_DLINK_PATH = ld
-*_XCODE32_ARM_ASM_PATH = DEF(IPHONE_TOOLS)/usr/bin/as
-*_XCODE32_ARM_PP_PATH = DEF(IPHONE_TOOLS)/usr/bin/gcc
-*_XCODE32_ARM_VFRPP_PATH = DEF(IPHONE_TOOLS)/usr/bin/gcc
-
- DEBUG_XCODE32_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_strip -seg1addr 0x220 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-RELEASE_XCODE32_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_strip -seg1addr 0x220 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-
-*_XCODE32_ARM_SLINK_FLAGS = -static -o
-
- DEBUG_XCODE32_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) -g
-RELEASE_XCODE32_ARM_ASM_FLAGS = $(ARCHASM_FLAGS)
-*_XCODE32_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_XCODE32_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-
- DEBUG_XCODE32_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mthumb-interwork -g -Oz -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h -fno-stack-protector
-RELEASE_XCODE32_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mthumb-interwork -Oz -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h -fno-stack-protector
-
-
-####################################################################################
-#
-# Clang Support for building on Mac OS X
-#
-####################################################################################
-# CLANG - clang that produce Mach-O with EFI x86_64 ABI
-*_XCLANG_*_*_FAMILY = GCC
-*_XCLANG_*_*_BUILDRULEFAMILY = XCODE
-
-*_XCLANG_*_ASL_PATH = /usr/bin/iasl
-
-*_XCLANG_*_MAKE_PATH = make
-*_XCLANG_*_DSYMUTIL_PATH = /usr/bin/dsymutil
-
- *_*_*_MTOC_PATH = /usr/local/bin/mtoc
-
- DEBUG_XCLANG_*_MTOC_FLAGS = -align 0x20 -d $(DEBUG_DIR)/$(MODULE_NAME).dll
-RELEASE_XCLANG_*_MTOC_FLAGS = -align 0x20
-
-
-*_XCLANG_*_CC_PATH = DEF(CLANG_BIN)clang
-*_XCLANG_*_SLINK_PATH = libtool
-*_XCLANG_*_DLINK_PATH = ld
-*_XCLANG_*_ASM_PATH = as
-*_XCLANG_*_PP_PATH = DEF(CLANG_BIN)clang
-*_XCLANG_*_VFRPP_PATH = DEF(CLANG_BIN)clang
-*_XCLANG_*_ASL_PATH = iasl
-*_XCLANG_*_ASLCC_PATH = DEF(CLANG_BIN)clang
-*_XCLANG_*_ASLPP_PATH = DEF(CLANG_BIN)clang
-*_XCLANG_*_ASLDLINK_PATH = ld
-
-####################
-# IA-32 definitions
-####################
- DEBUG_XCLANG_IA32_DLINK_FLAGS = -arch i386 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_strip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-RELEASE_XCLANG_IA32_DLINK_FLAGS = -arch i386 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_strip -seg1addr 0x220 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-*_XCLANG_IA32_SLINK_FLAGS = -static -o
- DEBUG_XCLANG_IA32_ASM_FLAGS = -arch i386 -g
-RELEASE_XCLANG_IA32_ASM_FLAGS = -arch i386
-
-
- DEBUG_XCLANG_IA32_CC_FLAGS = -arch i386 -c -g -O0 -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -fasm-blocks -mms-bitfields -msoft-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang
-RELEASE_XCLANG_IA32_CC_FLAGS = -arch i386 -c -Os -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -fasm-blocks -mms-bitfields -msoft-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang
-
-
-##################
-# X64 definitions
-##################
- DEBUG_XCLANG_X64_DLINK_FLAGS = -arch x86_64 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_strip -seg1addr 0x240 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-RELEASE_XCLANG_X64_DLINK_FLAGS = -arch x86_64 -u _$(IMAGE_ENTRY_POINT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_strip -seg1addr 0x220 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-*_XCLANG_X64_SLINK_FLAGS = -static -o
- DEBUG_XCLANG_X64_ASM_FLAGS = -arch x86_64 -g
-RELEASE_XCLANG_X64_ASM_FLAGS = -arch x86_64
-*_XCLANG_*_PP_FLAGS = -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_XCLANG_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-
-
- DEBUG_XCLANG_X64_CC_FLAGS = -ccc-host-triple x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang
-RELEASE_XCLANG_X64_CC_FLAGS = -ccc-host-triple x86_64-pc-win32-macho -c -Os -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang
-*_XCLANG_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic
-*_XCLANG_*_ASLDLINK_FLAGS = -e _main -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-*_XCLANG_*_ASLPP_FLAGS = -x c -E
-*_XCLANG_*_ASL_FLAGS =
-
-####################################################################################
-#
-# RVCT Common
-#
-####################################################################################
-
-DEFINE RVCT_ALL_ASM_FLAGS = --diag_suppress=1786 --diag_error=warning --apcs /interwork
-DEFINE RVCT_ALL_CC_FLAGS = --c90 -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_suppress=186 --diag_warning 167 --diag_error=warning --diag_style=ide
-DEFINE RVCT_ALL_DLINK_FLAGS = --ro-base 0 --no_scanlib --reloc --no_exceptions --datacompressor off --strict --symbols --diag_style=ide
-
-####################################################################################
-#
-# ARM RealView Tools - Windows
-#
-####################################################################################
-# RVCT - Tools from ARM
-
-*_RVCT_*_*_FAMILY = RVCT
-
-#
-# Use default values, or override in DSC file
-#
-*_RVCT_ARM_ARCHCC_FLAGS = --thumb
-*_RVCT_ARM_ARCHASM_FLAGS =
-*_RVCT_ARM_ARCHDLINK_FLAGS =
-*_RVCT_ARM_PLATFORM_FLAGS = --cpu 7-A
-
- DEBUG_RVCT_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-RELEASE_RVCT_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-
-
-*_RVCT_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_ASM_FLAGS)
-*_RVCT_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E
-*_RVCT_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-*_RVCT_ARM_MAKE_PATH = nmake /NOLOGO
-*_RVCT_ARM_SLINK_FLAGS = --partial -o
- DEBUG_RVCT_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g
-RELEASE_RVCT_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --diag_suppress=550 DEF(RVCT_ALL_CC_FLAGS) -O2
-
-##################
-# ARM definitions
-##################
-*_RVCT_ARM_CC_PATH = ENV(RVCT_TOOLS_PATH)armcc
-*_RVCT_ARM_SLINK_PATH = ENV(RVCT_TOOLS_PATH)armlink
-*_RVCT_ARM_DLINK_PATH = ENV(RVCT_TOOLS_PATH)armlink
-*_RVCT_ARM_ASM_PATH = ENV(RVCT_TOOLS_PATH)armasm
-*_RVCT_ARM_PP_PATH = ENV(RVCT_TOOLS_PATH)armcc
-*_RVCT_ARM_VFRPP_PATH = ENV(RVCT_TOOLS_PATH)armcc
-*_RVCT_ARM_FROMELF_PATH = ENV(RVCT_TOOLS_PATH)fromelf
-
-####################################################################################
-#
-# ARM RealView Tools - Linux
-#
-####################################################################################
-# RVCTLINUX - Tools from ARM in a Cygwin environment
-*_RVCTLINUX_*_*_FAMILY = RVCT
-*_RVCTLINUX_*_*_BUILDRULEFAMILY = RVCTLINUX
-
-*_RVCTLINUX_*_MAKE_PATH = make
-
-#
-# Use default values, or override in DSC file
-#
-*_RVCTLINUX_ARM_ARCHCC_FLAGS = --thumb
-*_RVCTLINUX_ARM_ARCHASM_FLAGS =
-*_RVCTLINUX_ARM_ARCHDLINK_FLAGS =
-*_RVCTLINUX_ARM_PLATFORM_FLAGS = --cpu 7-A
-
-DEBUG_RVCTLINUX_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-RELEASE_RVCTLINUX_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-
-*_RVCTLINUX_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_ASM_FLAGS)
-*_RVCTLINUX_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E
-*_RVCTLINUX_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-*_RVCTLINUX_ARM_SLINK_FLAGS = --partial -o
- DEBUG_RVCTLINUX_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g
-RELEASE_RVCTLINUX_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --diag_suppress=550 DEF(RVCT_ALL_CC_FLAGS) -O2
-
-##################
-# ARM definitions
-##################
-*_RVCTLINUX_ARM_CC_PATH = ENV(RVCT_TOOLS_PATH)armcc
-*_RVCTLINUX_ARM_SLINK_PATH = ENV(RVCT_TOOLS_PATH)armlink
-*_RVCTLINUX_ARM_DLINK_PATH = ENV(RVCT_TOOLS_PATH)armlink
-*_RVCTLINUX_ARM_ASM_PATH = ENV(RVCT_TOOLS_PATH)armasm
-*_RVCTLINUX_ARM_PP_PATH = ENV(RVCT_TOOLS_PATH)armcc
-*_RVCTLINUX_ARM_VFRPP_PATH = ENV(RVCT_TOOLS_PATH)armcc
-*_RVCTLINUX_ARM_FROMELF_PATH = ENV(RVCT_TOOLS_PATH)fromelf
-
-####################################################################################
-#
-# ARM RealView Tools - Cygwin
-#
-####################################################################################
-# ARMCYGWIN - Tools from ARM in a Cygwin environment
-
-*_RVCTCYGWIN_*_*_FAMILY = RVCT
-*_RVCTCYGWIN_*_*_BUILDRULEFAMILY = RVCTCYGWIN
-
-*_RVCTCYGWIN_ARM_CCPATH_FLAG = ENV(RVCT_TOOLS_PATH)armcc
-*_RVCTCYGWIN_ARM_SLINKPATH_FLAG = ENV(RVCT_TOOLS_PATH)armlink
-*_RVCTCYGWIN_ARM_DLINKPATH_FLAG = ENV(RVCT_TOOLS_PATH)armlink
-*_RVCTCYGWIN_ARM_ASMPATH_FLAG = ENV(RVCT_TOOLS_PATH)armasm
-*_RVCTCYGWIN_ARM_PPPATH_FLAG = ENV(RVCT_TOOLS_PATH)armcc
-*_RVCTCYGWIN_ARM_VFRPPPATH_FLAG = ENV(RVCT_TOOLS_PATH)armcc
-*_RVCTCYGWIN_ARM_FROMELFPATH_FLAG = ENV(RVCT_TOOLS_PATH)fromelf
-
-#
-# Use default values, or override in DSC file
-#
-*_RVCTCYGWIN_ARM_ARCHCC_FLAGS = --thumb
-*_RVCTCYGWIN_ARM_ARCHASM_FLAGS =
-*_RVCTCYGWIN_ARM_ARCHDLINK_FLAGS =
-*_RVCTCYGWIN_ARM_PLATFORM_FLAGS = --cpu 7-A
-
- DEBUG_RVCTCYGWIN_ARM_DLINK_FLAGS = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list `cygpath -m $(DEST_DIR_DEBUG)/$(BASE_NAME).map`
-RELEASE_RVCTCYGWIN_ARM_DLINK_FLAGS = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS) DEF(RVCT_ALL_DLINK_FLAGS) --entry $(IMAGE_ENTRY_POINT) --map --list `cygpath -m $(DEST_DIR_DEBUG)/$(BASE_NAME).map`
-
-*_RVCTCYGWIN_ARM_ASM_FLAGS = "$(ASMPATH_FLAG)" $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_ASM_FLAGS)
-*_RVCTCYGWIN_ARM_PP_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E
-*_RVCTCYGWIN_ARM_VFRPP_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude `cygpath -m $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h`
-*_RVCTCYGWIN_ARM_MAKE_PATH = make
-*_RVCTCYGWIN_ARM_SLINK_FLAGS = "$(SLINKPATH_FLAG)" --partial -o
- DEBUG_RVCTCYGWIN_ARM_CC_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(RVCT_ALL_CC_FLAGS) -O1 -g
-RELEASE_RVCTCYGWIN_ARM_CC_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --diag_suppress=550 DEF(RVCT_ALL_CC_FLAGS) -O2
-
-##################
-# ARM definitions
-##################
-*_RVCTCYGWIN_ARM_CC_PATH = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
-*_RVCTCYGWIN_ARM_SLINK_PATH = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
-*_RVCTCYGWIN_ARM_DLINK_PATH = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
-*_RVCTCYGWIN_ARM_ASM_PATH = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
-*_RVCTCYGWIN_ARM_PP_PATH = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
-*_RVCTCYGWIN_ARM_VFRPP_PATH = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
-*_RVCTCYGWIN_ARM_FROMELF_PATH = ENV(WORKSPACE)/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py
-
-####################################################################################
-#
-# ARM EABI GCC (www.codesourcery.com)
-#
-####################################################################################
-# ARMGCC - ARM version of the GCC cross compiler
-
-*_ARMGCC_*_*_FAMILY = GCC
-*_ARMGCC_*_*_BUILDRULEFAMILY = ARMGCC
-
-*_ARMGCC_*_MAKE_PATH = make
-*_ARMGCC_*_MAKE_FLAGS = --no-print-directory
-
-##################
-# ASL definitions
-##################
-*_ARMGCC_*_ASL_PATH = DEF(UNIX_IASL_BIN)
-*_ARMGCC_*_ASL_FLAGS = DEF(IASL_FLAGS)
-*_ARMGCC_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-*_ARMGCC_*_ASLPP_FLAGS = -x c -E -P
-*_ARMGCC_*_ASLCC_FLAGS = -x c
-*_ARMGCC_*_ASLDLINK_FLAGS = DEF(GCC_DLINK_FLAGS_COMMON) --entry _ReferenceAcpiTable
-
-##################
-# ARM definitions
-##################
-
-*_ARMGCC_ARM_ASLCC_PATH = ENV(CROSS_COMPILE)gcc
-*_ARMGCC_ARM_ASLDLINK_PATH = ENV(CROSS_COMPILE)ld
-*_ARMGCC_ARM_ASLPP_PATH = ENV(CROSS_COMPILE)gcc
-
-*_ARMGCC_ARM_CC_PATH = ENV(CROSS_COMPILE)gcc
-*_ARMGCC_ARM_SLINK_PATH = ENV(CROSS_COMPILE)ar
-*_ARMGCC_ARM_DLINK_PATH = ENV(CROSS_COMPILE)ld
-*_ARMGCC_ARM_ASM_PATH = ENV(CROSS_COMPILE)as
-*_ARMGCC_ARM_PP_PATH = ENV(CROSS_COMPILE)gcc
-*_ARMGCC_ARM_VFRPP_PATH = ENV(CROSS_COMPILE)gcc
-
-#
-# Use default values, or override in DSC file
-#
-*_ARMGCC_ARM_ARCHCC_FLAGS = -mthumb
-*_ARMGCC_ARM_ARCHASM_FLAGS =
-*_ARMGCC_ARM_ARCHDLINK_FLAGS =
-*_ARMGCC_ARM_PLATFORM_FLAGS = -march=armv7-a
-
- DEBUG_ARMGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -g
-RELEASE_ARMGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian
-
-*_ARMGCC_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_ARMGCC_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-
-*_ARMGCC_ARM_SLINK_FLAGS = -rc
-*_ARMGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-
- DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -O0
-RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -Wno-unused
-
-######################
-# AArch64 definitions
-######################
-# AARCH64 64bit ARM Bare-metal GCC (ARM Architecture 64)
-
-*_ARMGCC_AARCH64_ASLCC_PATH = ENV(CROSS_COMPILE)gcc
-*_ARMGCC_AARCH64_ASLDLINK_PATH = ENV(CROSS_COMPILE)ld
-*_ARMGCC_AARCH64_ASLPP_PATH = ENV(CROSS_COMPILE)gcc
-
-*_ARMGCC_AARCH64_CC_PATH = ENV(CROSS_COMPILE)gcc
-*_ARMGCC_AARCH64_SLINK_PATH = ENV(CROSS_COMPILE)ar
-*_ARMGCC_AARCH64_DLINK_PATH = ENV(CROSS_COMPILE)ld
-*_ARMGCC_AARCH64_ASM_PATH = ENV(CROSS_COMPILE)as
-*_ARMGCC_AARCH64_PP_PATH = ENV(CROSS_COMPILE)gcc
-*_ARMGCC_AARCH64_VFRPP_PATH = ENV(CROSS_COMPILE)gcc
-
-#
-# Use default values, or override in DSC file
-#
-*_ARMGCC_AARCH64_ARCHCC_FLAGS =
-*_ARMGCC_AARCH64_ARCHASM_FLAGS =
-*_ARMGCC_AARCH64_ARCHDLINK_FLAGS =
-*_ARMGCC_AARCH64_PLATFORM_FLAGS =
-
- DEBUG_ARMGCC_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -g
-RELEASE_ARMGCC_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS)
-
-*_ARMGCC_AARCH64_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_ARMGCC_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-
-*_ARMGCC_AARCH64_SLINK_FLAGS = -rc
-*_ARMGCC_AARCH64_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-
- DEBUG_ARMGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -O0
-RELEASE_ARMGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable
-
-####################################################################################
-#
-# ARM GNU/Linux GCC
-#
-####################################################################################
-# ARMLINUXGCC - ARM version of the GCC cross compiler
-
-*_ARMLINUXGCC_*_*_FAMILY = GCC
-*_ARMLINUXGCC_*_*_BUILDRULEFAMILY = ARMLINUXGCC
-
-*_ARMLINUXGCC_*_MAKE_PATH = make
-*_ARMLINUXGCC_*_MAKE_FLAGS = --no-print-directory
-
-##################
-# ASL definitions
-##################
-*_ARMLINUXGCC_*_ASL_PATH = DEF(UNIX_IASL_BIN)
-*_ARMLINUXGCC_*_ASL_FLAGS = DEF(IASL_FLAGS)
-*_ARMLINUXGCC_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-*_ARMLINUXGCC_*_ASLPP_FLAGS = -x c -E -P
-*_ARMLINUXGCC_*_ASLCC_FLAGS = -x c
-*_ARMLINUXGCC_*_ASLDLINK_FLAGS = DEF(GCC_DLINK_FLAGS_COMMON) --entry _ReferenceAcpiTable
-
-##################
-# ARM definitions
-##################
-
-*_ARMLINUXGCC_ARM_ASLCC_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-gcc
-*_ARMLINUXGCC_ARM_ASLDLINK_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-ld
-*_ARMLINUXGCC_ARM_ASLPP_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-gcc
-
-*_ARMLINUXGCC_ARM_CC_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-gcc
-*_ARMLINUXGCC_ARM_SLINK_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-ar
-*_ARMLINUXGCC_ARM_DLINK_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-ld
-*_ARMLINUXGCC_ARM_ASM_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-as
-*_ARMLINUXGCC_ARM_PP_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-gcc
-*_ARMLINUXGCC_ARM_VFRPP_PATH = ENV(ARMLINUXGCC_TOOLS_PATH)arm-linux-gnueabi-gcc
-
-#
-# Use default values, or override in DSC file
-#
-*_ARMLINUXGCC_ARM_ARCHCC_FLAGS = -mthumb
-*_ARMLINUXGCC_ARM_ARCHASM_FLAGS =
-*_ARMLINUXGCC_ARM_ARCHDLINK_FLAGS =
-*_ARMLINUXGCC_ARM_PLATFORM_FLAGS = -march=armv7-a
-
- DEBUG_ARMLINUXGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian -g
-RELEASE_ARMLINUXGCC_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -mlittle-endian
-
-*_ARMLINUXGCC_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_ARMLINUXGCC_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-
-*_ARMLINUXGCC_ARM_SLINK_FLAGS = -rc
-*_ARMLINUXGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-
- DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fno-stack-protector -mno-unaligned-access -O0
-RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fno-stack-protector -mno-unaligned-access -Wno-unused-but-set-variable
-
-######################
-# AArch64 definitions
-######################
-# AARCH64 64bit ARM GNU/Linux GCC (ARM Architecture 64)
-
-*_ARMLINUXGCC_AARCH64_ASLCC_PATH = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-gcc
-*_ARMLINUXGCC_AARCH64_ASLDLINK_PATH = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-ld
-*_ARMLINUXGCC_AARCH64_ASLPP_PATH = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-gcc
-
-*_ARMLINUXGCC_AARCH64_CC_PATH = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-gcc
-*_ARMLINUXGCC_AARCH64_SLINK_PATH = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-ar
-*_ARMLINUXGCC_AARCH64_DLINK_PATH = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-ld
-*_ARMLINUXGCC_AARCH64_ASM_PATH = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-as
-*_ARMLINUXGCC_AARCH64_PP_PATH = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-gcc
-*_ARMLINUXGCC_AARCH64_VFRPP_PATH = ENV(AARCH64LINUXGCC_TOOLS_PATH)aarch64-linux-gnu-gcc
-
-#
-# Use default values, or override in DSC file
-#
-*_ARMLINUXGCC_AARCH64_ARCHCC_FLAGS =
-*_ARMLINUXGCC_AARCH64_ARCHASM_FLAGS =
-*_ARMLINUXGCC_AARCH64_ARCHDLINK_FLAGS =
-*_ARMLINUXGCC_AARCH64_PLATFORM_FLAGS =
-
- DEBUG_ARMLINUXGCC_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) -g
-RELEASE_ARMLINUXGCC_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS)
-
-*_ARMLINUXGCC_AARCH64_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
-*_ARMLINUXGCC_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
-
-*_ARMLINUXGCC_AARCH64_SLINK_FLAGS = -rc
-*_ARMLINUXGCC_AARCH64_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-
- DEBUG_ARMLINUXGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -O0
-RELEASE_ARMLINUXGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable
-
-#################
-# ASM 16 linker defintions
-#################
-*_*_*_ASMLINK_PATH = DEF(WINDDK_BIN16)\link16.exe
-*_*_*_ASMLINK_FLAGS = /nologo /tiny
-
-##################
-# VfrCompiler definitions
-##################
-*_*_*_VFR_PATH = VfrCompile
-*_*_*_VFR_FLAGS = -l -n
-
-##################
-# OptionRom tool definitions
-##################
-*_*_*_OPTROM_PATH = EfiRom
-*_*_*_OPTROM_FLAGS = -e
-
-##################
-# GenFw tool definitions
-##################
-*_*_*_GENFW_PATH = GenFw
-*_*_*_GENFW_FLAGS =
-
-##################
-# Asl Compiler definitions
-##################
-*_*_*_ASLCC_FLAGS = /nologo /c /FIAutoGen.h /TC /Dmain=ReferenceAcpiTable
-*_*_*_ASLDLINK_FLAGS = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE
-*_*_*_ASLPP_FLAGS = /nologo /EP /C
-*_*_*_ASL_FLAGS =
-
-##################
-# GenCrc32 tool definitions
-##################
-*_*_*_CRC32_PATH = GenCrc32
-*_*_*_CRC32_GUID = FC1BCDB0-7D31-49AA-936A-A4600D9DD083
-
-##################
-# LzmaCompress tool definitions
-##################
-*_*_*_LZMA_PATH = LzmaCompress
-*_*_*_LZMA_GUID = EE4E5898-3914-4259-9D6E-DC7BD79403CF
-
-##################
-# LzmaF86Compress tool definitions with converter for x86 code.
-# It can improve the compression ratio if the input file is IA32 or X64 PE image.
-# Notes: If X64 PE image is built based on GCC44, it may not get the better compression.
-##################
-*_*_*_LZMAF86_PATH = LzmaF86Compress
-*_*_*_LZMAF86_GUID = D42AE6BD-1352-4bfb-909A-CA72A6EAE889
-
-##################
-# TianoCompress tool definitions
-##################
-*_*_*_TIANO_PATH = TianoCompress
-*_*_*_TIANO_GUID = A31280AD-481E-41B6-95E8-127F4C984779
-
-##################
-# BPDG tool definitions
-##################
-*_*_*_VPDTOOL_PATH = BPDG
-*_*_*_VPDTOOL_GUID = 8C3D856A-9BE6-468E-850A-24F7A8D38E08
diff --git a/BaseTools/Contributions.txt b/BaseTools/Contributions.txt
deleted file mode 100644
index 667ca1035c..0000000000
--- a/BaseTools/Contributions.txt
+++ /dev/null
@@ -1,188 +0,0 @@
-
-======================
-= Code Contributions =
-======================
-
-To make a contribution to a TianoCore project, follow these steps.
-1. Create a change description in the format specified below to
- use in the source control commit log.
-2. Your commit message must include your "Signed-off-by" signature,
- and "Contributed-under" message.
-3. Your "Contributed-under" message explicitly states that the
- contribution is made under the terms of the specified
- contribution agreement. Your "Contributed-under" message
- must include the name of contribution agreement and version.
- For example: Contributed-under: TianoCore Contribution Agreement 1.0
- The "TianoCore Contribution Agreement" is included below in
- this document.
-4. Submit your code to the TianoCore project using the process
- that the project documents on its web page. If the process is
- not documented, then submit the code on development email list
- for the project.
-
-=======================================
-= Change Description / Commit Message =
-=======================================
-
-Your change description should use the standard format for a
-commit message, and must include your "Signed-off-by" signature
-and the "Contributed-under" message.
-
-== Sample Change Description / Commit Message =
-
-=== Definitions for sample change description ===
-
-* "CodeModule" is a short idenfier for the affected code. For
- example MdePkg, or MdeModulePkg UsbBusDxe.
-* "Brief-single-line-summary" is a short summary of the change.
-* The entire first line should be less than ~70 characters.
-* "Full-commit-message" a verbose multiple line comment describing
- the change. Each line should be less than ~70 characters.
-* "Contributed-under" explicitely states that the contribution is
- made under the terms of the contribtion agreement. This
- agreement is included below in this document.
-* "Signed-off-by" is the contributor's signature identifying them
- by their real/legal name and their email address.
-
-=== Start of sample change description / commit message ===
-CodeModule: Brief-single-line-summary
-
-Full-commit-message
-
-Contributed-under: TianoCore Contribution Agreement 1.0
-Signed-off-by: Contributor Name <contributor@email.server>
-=== End of sample change description / commit message ===
-
-========================================
-= TianoCore Contribution Agreement 1.0 =
-========================================
-
-INTEL CORPORATION ("INTEL") MAKES AVAILABLE SOFTWARE, DOCUMENTATION,
-INFORMATION AND/OR OTHER MATERIALS FOR USE IN THE TIANOCORE OPEN SOURCE
-PROJECT (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE
-TERMS AND CONDITIONS OF THIS AGREEMENT BETWEEN YOU AND INTEL AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR
-REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE
-CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS
-AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT
-USE THE CONTENT.
-
-Unless otherwise indicated, all Content made available on the TianoCore
-site is provided to you under the terms and conditions of the BSD
-License ("BSD"). A copy of the BSD License is available at
-http://opensource.org/licenses/bsd-license.php
-or when applicable, in the associated License.txt file.
-
-Certain other content may be made available under other licenses as
-indicated in or with such Content. (For example, in a License.txt file.)
-
-You accept and agree to the following terms and conditions for Your
-present and future Contributions submitted to TianoCore site. Except
-for the license granted to Intel hereunder, You reserve all right,
-title, and interest in and to Your Contributions.
-
-== SECTION 1: Definitions ==
-* "You" or "Contributor" shall mean the copyright owner or legal
- entity authorized by the copyright owner that is making a
- Contribution hereunder. All other entities that control, are
- controlled by, or are under common control with that entity are
- considered to be a single Contributor. For the purposes of this
- definition, "control" means (i) the power, direct or indirect, to
- cause the direction or management of such entity, whether by
- contract or otherwise, or (ii) ownership of fifty percent (50%)
- or more of the outstanding shares, or (iii) beneficial ownership
- of such entity.
-* "Contribution" shall mean any original work of authorship,
- including any modifications or additions to an existing work,
- that is intentionally submitted by You to the TinaoCore site for
- inclusion in, or documentation of, any of the Content. For the
- purposes of this definition, "submitted" means any form of
- electronic, verbal, or written communication sent to the
- TianoCore site or its representatives, including but not limited
- to communication on electronic mailing lists, source code
- control systems, and issue tracking systems that are managed by,
- or on behalf of, the TianoCore site for the purpose of
- discussing and improving the Content, but excluding
- communication that is conspicuously marked or otherwise
- designated in writing by You as "Not a Contribution."
-
-== SECTION 2: License for Contributions ==
-* Contributor hereby agrees that redistribution and use of the
- Contribution in source and binary forms, with or without
- modification, are permitted provided that the following
- conditions are met:
-** Redistributions of source code must retain the Contributor's
- copyright notice, this list of conditions and the following
- disclaimer.
-** Redistributions in binary form must reproduce the Contributor's
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-* Disclaimer. None of the names of Contributor, Intel, or the names
- of their respective contributors may be used to endorse or
- promote products derived from this software without specific
- prior written permission.
-* Contributor grants a license (with the right to sublicense) under
- claims of Contributor's patents that Contributor can license that
- are infringed by the Contribution (as delivered by Contributor) to
- make, use, distribute, sell, offer for sale, and import the
- Contribution and derivative works thereof solely to the minimum
- extent necessary for licensee to exercise the granted copyright
- license; this patent license applies solely to those portions of
- the Contribution that are unmodified. No hardware per se is
- licensed.
-* EXCEPT AS EXPRESSLY SET FORTH IN SECTION 3 BELOW, THE
- CONTRIBUTION IS PROVIDED BY THE CONTRIBUTOR "AS IS" AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- CONTRIBUTOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
- CONTRIBUTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGE.
-
-== SECTION 3: Representations ==
-* You represent that You are legally entitled to grant the above
- license. If your employer(s) has rights to intellectual property
- that You create that includes Your Contributions, You represent
- that You have received permission to make Contributions on behalf
- of that employer, that Your employer has waived such rights for
- Your Contributions.
-* You represent that each of Your Contributions is Your original
- creation (see Section 4 for submissions on behalf of others).
- You represent that Your Contribution submissions include complete
- details of any third-party license or other restriction
- (including, but not limited to, related patents and trademarks)
- of which You are personally aware and which are associated with
- any part of Your Contributions.
-
-== SECTION 4: Third Party Contributions ==
-* Should You wish to submit work that is not Your original creation,
- You may submit it to TianoCore site separately from any
- Contribution, identifying the complete details of its source
- and of any license or other restriction (including, but not
- limited to, related patents, trademarks, and license agreements)
- of which You are personally aware, and conspicuously marking the
- work as "Submitted on behalf of a third-party: [named here]".
-
-== SECTION 5: Miscellaneous ==
-* Applicable Laws. Any claims arising under or relating to this
- Agreement shall be governed by the internal substantive laws of
- the State of Delaware or federal courts located in Delaware,
- without regard to principles of conflict of laws.
-* Language. This Agreement is in the English language only, which
- language shall be controlling in all respects, and all versions
- of this Agreement in any other language shall be for accommodation
- only and shall not be binding. All communications and notices made
- or given pursuant to this Agreement, and all documentation and
- support to be provided, unless otherwise noted, shall be in the
- English language.
-
diff --git a/BaseTools/GNUmakefile b/BaseTools/GNUmakefile
deleted file mode 100644
index 790d33a2f3..0000000000
--- a/BaseTools/GNUmakefile
+++ /dev/null
@@ -1,35 +0,0 @@
-## @file
-# GNU/Linux makefile for Base Tools project build.
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-all: subdirs
-
-LANGUAGES = C Python
-
-SOURCE_SUBDIRS := $(patsubst %,Source/%,$(sort $(LANGUAGES)))
-SUBDIRS := $(SOURCE_SUBDIRS) Tests
-CLEAN_SUBDIRS := $(patsubst %,%-clean,$(sort $(SUBDIRS)))
-
-.PHONY: subdirs $(SUBDIRS)
-subdirs: $(SUBDIRS)
-$(SUBDIRS):
- $(MAKE) -C $@
-
-.PHONY: $(CLEAN_SUBDIRS)
-$(CLEAN_SUBDIRS):
- -$(MAKE) -C $(@:-clean=) clean
-
-clean: $(CLEAN_SUBDIRS)
-
-test:
- @$(MAKE) -C Tests
-
diff --git a/BaseTools/License.txt b/BaseTools/License.txt
deleted file mode 100644
index 160be01d2a..0000000000
--- a/BaseTools/License.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-Copyright (c) 2013, Intel Corporation. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
diff --git a/BaseTools/Makefile b/BaseTools/Makefile
deleted file mode 100644
index 294c532732..0000000000
--- a/BaseTools/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-## @file
-# Windows makefile for Base Tools project build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-SUBDIRS = Source\C Source\Python
-
-all: c python
-
-c :
- @Source\C\Makefiles\NmakeSubdirs.bat all Source\C
-
-python:
- @Source\C\Makefiles\NmakeSubdirs.bat all Source\Python
-
-subdirs: $(SUBDIRS)
- @Source\C\Makefiles\NmakeSubdirs.bat all $**
-
-.PHONY: clean
-clean:
- @Source\C\Makefiles\NmakeSubdirs.bat clean $(SUBDIRS)
-
-.PHONY: cleanall
-cleanall:
- @Source\C\Makefiles\NmakeSubdirs.bat cleanall $(SUBDIRS)
-
diff --git a/BaseTools/ReadMe.txt b/BaseTools/ReadMe.txt
deleted file mode 100644
index 858b124db8..0000000000
--- a/BaseTools/ReadMe.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-This directory contains the next generation of EDK II build tools and template files.
-Templates are located in the Conf directory, while the tools executables for
-Microsoft Windows 32-bit Operating Systems are located in the Bin\Win32 directory, other
-directory contatins tools source.
-
-1. Build step to generate the binary tools.
-
-=== Windows/Visual Studio Notes ===
-
-To build the BaseTools, you should run the standard vsvars32.bat script.
-
-In addition to this, you should set the following environment variables:
-
- * EDK_TOOLS_PATH - Path to the BaseTools sub directory under the edk2 tree
- * BASE_TOOLS_PATH - The directory where the BaseTools source is located.
- (It is the same directory where this README.txt is located.)
- * PYTHON_FREEZER_PATH - Path to where the python freezer tool is installed
-
-After this, you can run the toolsetup.bat file, which is in the same
-directory as this file. It should setup the remainder of the environment,
-and build the tools if necessary.
-
-Please also refer to the 'BuildNotes.txt' file for more information on
-building under Windows.
-
-=== Unix-like operating systems ===
-
-To build on Unix-like operating systems, you only need to type 'make' in
-the base directory of the project.
-
-=== Ubuntu Notes ===
-
-On Ubuntu, the following command should install all the necessary build
-packages to build all the C BaseTools:
-
- sudo apt-get install build-essential uuid-dev
-
-=== Python sqlite3 module ===
-On Windows, the cx_freeze will not copy the sqlite3.dll to the frozen
-binary directory (the same directory as build.exe and GenFds.exe).
-Please copy it manually from <PythonHome>\DLLs.
-
-The Python distributed with most recent Linux will have sqlite3 module
-built in. If not, please install sqlit3 package separately.
-
-26-OCT-2011
diff --git a/BaseTools/Scripts/gcc4.4-ld-script b/BaseTools/Scripts/gcc4.4-ld-script
deleted file mode 100644
index 68b2767590..0000000000
--- a/BaseTools/Scripts/gcc4.4-ld-script
+++ /dev/null
@@ -1,44 +0,0 @@
-/* OUTPUT_FORMAT(efi-bsdrv-x86_64) */
-SECTIONS
-{
- /* . = 0 + SIZEOF_HEADERS; */
- . = 0x280;
- .text ALIGN(0x20) :
- {
- *(.text .stub .text.* .gnu.linkonce.t.*)
- . = ALIGN(0x20);
- } =0x90909090
- .data ALIGN(0x20) :
- {
- *(
- .rodata .rodata.* .gnu.linkonce.r.*
- .data .data.* .gnu.linkonce.d.*
- .bss .bss.*
- *COM*
- )
- . = ALIGN(0x20);
- }
- .eh_frame ALIGN(0x20) :
- {
- KEEP (*(.eh_frame))
- }
- .got ALIGN(0x20) :
- {
- *(.got .got.*)
- . = ALIGN(0x20);
- }
- .rela ALIGN(0x20) :
- {
- *(.rela .rela.*)
- }
- /DISCARD/ : {
- *(.note.GNU-stack) *(.gnu_debuglink)
- *(.interp)
- *(.dynsym)
- *(.dynstr)
- *(.dynamic)
- *(.hash)
- *(.comment)
- }
-}
-
diff --git a/BaseTools/Source/C/BootSectImage/GNUmakefile b/BaseTools/Source/C/BootSectImage/GNUmakefile
deleted file mode 100644
index 5f7cb98461..0000000000
--- a/BaseTools/Source/C/BootSectImage/GNUmakefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# GNU/Linux makefile for 'BootSectImage' module build.
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = BootSectImage
-
-LIBS = -lCommon
-
-OBJECTS = bootsectimage.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
diff --git a/BaseTools/Source/C/BootSectImage/Makefile b/BaseTools/Source/C/BootSectImage/Makefile
deleted file mode 100644
index 5e27af5a87..0000000000
--- a/BaseTools/Source/C/BootSectImage/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'BootSectImage' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = BootSectImage
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = BootSectImage.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/BootSectImage/bootsectimage.c b/BaseTools/Source/C/BootSectImage/bootsectimage.c
deleted file mode 100644
index 36e896e5c4..0000000000
--- a/BaseTools/Source/C/BootSectImage/bootsectimage.c
+++ /dev/null
@@ -1,950 +0,0 @@
-/** @file
-
-Abstract:
- Patch the BPB information in boot sector image file.
- Patch the MBR code in MBR image file.
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <stdio.h>
-#include <string.h>
-#include "fat.h"
-#include "mbr.h"
-#include "EfiUtilityMsgs.h"
-#include "ParseInf.h"
-
-#define DEBUG_WARN 0x1
-#define DEBUG_ERROR 0x2
-
-//
-// Utility Name
-//
-#define UTILITY_NAME "BootSectImage"
-
-//
-// Utility version information
-//
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-void
-Version (
- void
- )
-/*++
-
-Routine Description:
-
- Displays the standard utility information to SDTOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- printf ("%s v%d.%d %s - Utility to break a file into two pieces at the specified offset.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
- printf ("Copyright (c) 1999-2010 Intel Corporation. All rights reserved.\n");
-}
-
-void
-Usage (
- void
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
-
-Returns:
-
- GC_TODO: add return values
-
---*/
-{
- Version();
- printf ("\nUsage: \n\
- BootSectImage\n\
- [-f, --force force patch even if the FAT type of SrcImage and DstImage mismatch]\n\
- [-m, --mbr process MBR instead of boot sector]\n\
- [-p, --parse parse SrcImageFile]\n\
- [-o, --output DstImage]\n\
- [-g, --patch patch DstImage using data from SrcImageFile]\n\
- [-v, --verbose]\n\
- [--version]\n\
- [-q, --quiet disable all messages except fatal errors]\n\
- [-d, --debug[#]\n\
- [-h, --help]\n\
- [SrcImageFile]\n");
-}
-
-int WriteToFile (
- void *BootSector,
- char *FileName
- )
-/*++
-Routine Description:
- Write 512 bytes boot sector to file.
-
-Arguments:
- BootSector - point to a buffer containing 512 bytes boot sector to write
- FileName - file to write to
-
-Return:
- int - number of bytes wrote,
- 512 indicates write successful
- 0 indicates write failure
---*/
-{
- FILE *FileHandle;
- int result;
-
- FileHandle = fopen (FileName, "r+b");
- if (FileHandle == NULL) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "Open file: %s", FileName);
- return 0;
- }
- fseek (FileHandle, 0, SEEK_SET);
-
- result = fwrite (BootSector, 1, 512, FileHandle);
- if (result != 512) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "Write file: %s", FileName);
- result = 0;
- }
-
- fclose (FileHandle);
- return result;
-}
-
-int ReadFromFile (
- void *BootSector,
- char *FileName
- )
-/*++
-Routine Description:
- Read first 512 bytes from file.
-
-Arguments:
- BootSector - point to a buffer receiving the first 512 bytes data from file
- FileName - file to read from
-
-Return:
- int - number of bytes read,
- 512 indicates read successful
- 0 indicates read failure
---*/
-{
- FILE *FileHandle;
- int result;
-
- FileHandle = fopen (FileName, "rb");
- if (FileHandle == NULL) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E0001: Error opening file: %s", FileName);
- return 0;
- }
-
- result = fread (BootSector, 1, 512, FileHandle);
- if (result != 512) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E0004: Error reading file: %s", FileName);
- result = 0;
- }
-
- fclose (FileHandle);
- return result;
-}
-
-char *
-FatTypeToString (
- IN FAT_TYPE FatType
- )
-/*++
-Routine Description:
- Convert enum type of FatType to string
---*/
-{
- switch (FatType) {
- case FatTypeFat12:
- return "FAT12";
- case FatTypeFat16:
- return "FAT16";
- case FatTypeFat32:
- return "FAT32";
- default:
- break;
- }
- return "FAT Unknown";
-}
-
-FAT_TYPE
-GetFatType (
- IN FAT_BPB_STRUCT *FatBpb
- )
-/*++
-Routine Description:
- Determine the FAT type according to BIOS Paramater Block (BPB) data
-
-Arguments:
- FatBpb - BIOS Parameter Block (BPB) data, 512 Bytes
-
-Return:
- FatTypeUnknown - Cannot determine the FAT type
- FatTypeFat12 - FAT12
- FatTypeFat16 - FAT16
- FatTypeFat32 - FAT32
---*/
-{
- FAT_TYPE FatType;
- UINTN RootDirSectors;
- UINTN FATSz;
- UINTN TotSec;
- UINTN DataSec;
- UINTN CountOfClusters;
- CHAR8 FilSysType[9];
-
- FatType = FatTypeUnknown;
-
- //
- // Simple check
- //
- if (FatBpb->Fat12_16.Signature != FAT_BS_SIGNATURE) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT - Signature Invalid - %04x, expected: %04x",
- FatBpb->Fat12_16.Signature, FAT_BS_SIGNATURE);
- return FatTypeUnknown;
- }
-
- //
- // Check according to FAT spec
- //
- if ((FatBpb->Fat12_16.BS_jmpBoot[0] != FAT_BS_JMP1) &&
- (FatBpb->Fat12_16.BS_jmpBoot[0] != FAT_BS_JMP2)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT - BS_jmpBoot - %02x, expected: %02x or %02x",
- FatBpb->Fat12_16.BS_jmpBoot[0], FAT_BS_JMP1, FAT_BS_JMP2);
- return FatTypeUnknown;
- }
-
- if ((FatBpb->Fat12_16.BPB_BytsPerSec != 512) &&
- (FatBpb->Fat12_16.BPB_BytsPerSec != 1024) &&
- (FatBpb->Fat12_16.BPB_BytsPerSec != 2048) &&
- (FatBpb->Fat12_16.BPB_BytsPerSec != 4096)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT - BPB_BytsPerSec - %04x, expected: %04x, %04x, %04x, or %04x",
- FatBpb->Fat12_16.BPB_BytsPerSec, 512, 1024, 2048, 4096);
- return FatTypeUnknown;
- }
- if (FatBpb->Fat12_16.BPB_BytsPerSec != 512) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT - BPB_BytsPerSec - %04x, expected: %04x",
- FatBpb->Fat12_16.BPB_BytsPerSec, 512);
- }
- if ((FatBpb->Fat12_16.BPB_SecPerClus != 1) &&
- (FatBpb->Fat12_16.BPB_SecPerClus != 2) &&
- (FatBpb->Fat12_16.BPB_SecPerClus != 4) &&
- (FatBpb->Fat12_16.BPB_SecPerClus != 8) &&
- (FatBpb->Fat12_16.BPB_SecPerClus != 16) &&
- (FatBpb->Fat12_16.BPB_SecPerClus != 32) &&
- (FatBpb->Fat12_16.BPB_SecPerClus != 64) &&
- (FatBpb->Fat12_16.BPB_SecPerClus != 128)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT - BPB_SecPerClus - %02x, expected: %02x, %02x, %02x, %02x, %02x, %02x, %02x, or %02x",
- FatBpb->Fat12_16.BPB_BytsPerSec, 1, 2, 4, 8, 16, 32, 64, 128);
- return FatTypeUnknown;
- }
- if (FatBpb->Fat12_16.BPB_BytsPerSec * FatBpb->Fat12_16.BPB_SecPerClus > 32 * 1024) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT - BPB_BytsPerSec * BPB_SecPerClus - %08x, expected: <= %08x",
- FatBpb->Fat12_16.BPB_BytsPerSec * FatBpb->Fat12_16.BPB_SecPerClus, 32 * 1024);
- return FatTypeUnknown;
- }
- if (FatBpb->Fat12_16.BPB_RsvdSecCnt == 0) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT - BPB_RsvdSecCnt - %04x, expected: Non-Zero Value",
- FatBpb->Fat12_16.BPB_RsvdSecCnt);
- return FatTypeUnknown;
- }
- if (FatBpb->Fat12_16.BPB_NumFATs != 2) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT - BPB_NumFATs - %02x, expected: %02x",
- FatBpb->Fat12_16.BPB_NumFATs, 2);
- }
- if ((FatBpb->Fat12_16.BPB_Media != 0xF0) &&
- (FatBpb->Fat12_16.BPB_Media != 0xF8) &&
- (FatBpb->Fat12_16.BPB_Media != 0xF9) &&
- (FatBpb->Fat12_16.BPB_Media != 0xFA) &&
- (FatBpb->Fat12_16.BPB_Media != 0xFB) &&
- (FatBpb->Fat12_16.BPB_Media != 0xFC) &&
- (FatBpb->Fat12_16.BPB_Media != 0xFD) &&
- (FatBpb->Fat12_16.BPB_Media != 0xFE) &&
- (FatBpb->Fat12_16.BPB_Media != 0xFF)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT - BPB_Media - %02x, expected: %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x, or %02x",
- FatBpb->Fat12_16.BPB_Media, 0xF0, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF);
- return FatTypeUnknown;
- }
-
- //
- // Algo in FAT spec
- //
- RootDirSectors = ((FatBpb->Fat12_16.BPB_RootEntCnt * sizeof(FAT_DIRECTORY_ENTRY)) +
- (FatBpb->Fat12_16.BPB_BytsPerSec - 1)) /
- FatBpb->Fat12_16.BPB_BytsPerSec;
-
- if (FatBpb->Fat12_16.BPB_FATSz16 != 0) {
- FATSz = FatBpb->Fat12_16.BPB_FATSz16;
- } else {
- FATSz = FatBpb->Fat32.BPB_FATSz32;
- }
- if (FATSz == 0) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT - BPB_FATSz16, BPB_FATSz32 - 0, expected: Non-Zero Value");
- return FatTypeUnknown;
- }
-
- if (FatBpb->Fat12_16.BPB_TotSec16 != 0) {
- TotSec = FatBpb->Fat12_16.BPB_TotSec16;
- } else {
- TotSec = FatBpb->Fat12_16.BPB_TotSec32;
- }
- if (TotSec == 0) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT - BPB_TotSec16, BPB_TotSec32 - 0, expected: Non-Zero Value");
- return FatTypeUnknown;
- }
-
- DataSec = TotSec - (
- FatBpb->Fat12_16.BPB_RsvdSecCnt +
- FatBpb->Fat12_16.BPB_NumFATs * FATSz +
- RootDirSectors
- );
-
- CountOfClusters = DataSec / FatBpb->Fat12_16.BPB_SecPerClus;
-
- if (CountOfClusters < FAT_MAX_FAT12_CLUSTER) {
- FatType = FatTypeFat12;
- } else if (CountOfClusters < FAT_MAX_FAT16_CLUSTER) {
- FatType = FatTypeFat16;
- } else {
- FatType = FatTypeFat32;
- }
- //
- // Check according to FAT spec
- //
- if (((FatType == FatTypeFat12) || (FatType == FatTypeFat16)) &&
- (FatBpb->Fat12_16.BPB_RsvdSecCnt != 1)) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT12_16 - BPB_RsvdSecCnt - %04x, expected: %04x",
- FatBpb->Fat12_16.BPB_RsvdSecCnt, 1);
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat12_16.BPB_RsvdSecCnt != 32)) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT32 - BPB_RsvdSecCnt - %04x, expected: %04x",
- FatBpb->Fat12_16.BPB_RsvdSecCnt, 32);
- }
- if ((FatType == FatTypeFat16) &&
- (FatBpb->Fat12_16.BPB_RootEntCnt != 512)) {
- printf ("WARNING: FAT16: BPB_RootEntCnt - %04x, expected - %04x\n",
- FatBpb->Fat12_16.BPB_RootEntCnt, 512);
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat12_16.BPB_RootEntCnt != 0)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT32 - BPB_RootEntCnt - %04x, expected: %04x",
- FatBpb->Fat12_16.BPB_RootEntCnt, 0);
- return FatTypeUnknown;
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat12_16.BPB_TotSec16 != 0)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT32 - BPB_TotSec16 - %04x, expected: %04x",
- FatBpb->Fat12_16.BPB_TotSec16, 0);
- return FatTypeUnknown;
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat12_16.BPB_FATSz16 != 0)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT32 - BPB_FATSz16 - %04x, expected: %04x",
- FatBpb->Fat12_16.BPB_FATSz16, 0);
- return FatTypeUnknown;
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat12_16.BPB_TotSec32 == 0)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT32 - BPB_TotSec32 - %04x, expected: Non-Zero",
- (unsigned) FatBpb->Fat12_16.BPB_TotSec32);
- return FatTypeUnknown;
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat32.BPB_FATSz32 == 0)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT32 - BPB_FATSz32 - %08x, expected: Non-Zero",
- (unsigned) FatBpb->Fat32.BPB_FATSz32);
- return FatTypeUnknown;
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat32.BPB_FSVer != 0)) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT32 - BPB_FSVer - %08x, expected: %04x",
- FatBpb->Fat32.BPB_FSVer, 0);
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat32.BPB_RootClus != 2)) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT32 - BPB_RootClus - %08x, expected: %04x",
- (unsigned) FatBpb->Fat32.BPB_RootClus, 2);
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat32.BPB_FSInfo != 1)) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT32 - BPB_FSInfo - %08x, expected: %04x",
- FatBpb->Fat32.BPB_FSInfo, 1);
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat32.BPB_BkBootSec != 6)) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT32 - BPB_BkBootSec - %08x, expected: %04x",
- FatBpb->Fat32.BPB_BkBootSec, 6);
- }
- if ((FatType == FatTypeFat32) &&
- ((*(UINT32 *)FatBpb->Fat32.BPB_Reserved != 0) ||
- (*((UINT32 *)FatBpb->Fat32.BPB_Reserved + 1) != 0) ||
- (*((UINT32 *)FatBpb->Fat32.BPB_Reserved + 2) != 0))) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT32 - BPB_Reserved - %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x, expected: 0",
- FatBpb->Fat32.BPB_Reserved[0],
- FatBpb->Fat32.BPB_Reserved[1],
- FatBpb->Fat32.BPB_Reserved[2],
- FatBpb->Fat32.BPB_Reserved[3],
- FatBpb->Fat32.BPB_Reserved[4],
- FatBpb->Fat32.BPB_Reserved[5],
- FatBpb->Fat32.BPB_Reserved[6],
- FatBpb->Fat32.BPB_Reserved[7],
- FatBpb->Fat32.BPB_Reserved[8],
- FatBpb->Fat32.BPB_Reserved[9],
- FatBpb->Fat32.BPB_Reserved[10],
- FatBpb->Fat32.BPB_Reserved[11]);
- return FatTypeUnknown;
- }
- if (((FatType == FatTypeFat12) || (FatType == FatTypeFat16)) &&
- (FatBpb->Fat12_16.BS_Reserved1 != 0)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT12_16 - BS_Reserved1 - %02x, expected: 0\n",
- FatBpb->Fat12_16.BS_Reserved1);
- return FatTypeUnknown;
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat32.BS_Reserved1 != 0)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT32 - BS_Reserved1 - %02x, expected: 0\n",
- FatBpb->Fat32.BS_Reserved1);
- return FatTypeUnknown;
- }
- if (((FatType == FatTypeFat12) || (FatType == FatTypeFat16)) &&
- (FatBpb->Fat12_16.BS_BootSig != FAT_BS_BOOTSIG)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT12_16 - BS_BootSig - %02x, expected: %02x\n",
- FatBpb->Fat12_16.BS_BootSig, FAT_BS_BOOTSIG);
- return FatTypeUnknown;
- }
- if ((FatType == FatTypeFat32) &&
- (FatBpb->Fat32.BS_BootSig != FAT_BS_BOOTSIG)) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3003: FAT32 - BS_BootSig - %02x, expected: %02x\n",
- FatBpb->Fat32.BS_BootSig, FAT_BS_BOOTSIG);
- return FatTypeUnknown;
- }
-
- if ((FatType == FatTypeFat12) || (FatType == FatTypeFat16)) {
- memcpy (FilSysType, FatBpb->Fat12_16.BS_FilSysType, 8);
- FilSysType[8] = 0;
- if ((FatType == FatTypeFat12) &&
- (strcmp (FilSysType, FAT12_FILSYSTYPE) != 0) &&
- (strcmp (FilSysType, FAT_FILSYSTYPE) != 0)) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT12 - BS_FilSysType - %s, expected: %s, or %s\n",
- FilSysType, FAT12_FILSYSTYPE, FAT_FILSYSTYPE);
- }
- if ((FatType == FatTypeFat16) &&
- (strcmp (FilSysType, FAT16_FILSYSTYPE) != 0) &&
- (strcmp (FilSysType, FAT_FILSYSTYPE) != 0)) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT16 - BS_FilSysType - %s, expected: %s, or %s\n",
- FilSysType, FAT16_FILSYSTYPE, FAT_FILSYSTYPE);
- }
- }
- if (FatType == FatTypeFat32) {
- memcpy (FilSysType, FatBpb->Fat32.BS_FilSysType, 8);
- FilSysType[8] = 0;
- if (strcmp (FilSysType, FAT32_FILSYSTYPE) != 0) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3003: FAT32 - BS_FilSysType - %s, expected: %s\n",
- FilSysType, FAT32_FILSYSTYPE);
- }
- }
-
- //
- // pass all check, get FAT type
- //
- return FatType;
-}
-
-
-void
-ParseBootSector (
- char *FileName
- )
-{
- FAT_BPB_STRUCT FatBpb;
- FAT_TYPE FatType;
-
- if (ReadFromFile ((void *)&FatBpb, FileName) == 0) {
- return ;
- }
-
- FatType = GetFatType (&FatBpb);
- if (FatType <= FatTypeUnknown || FatType >= FatTypeMax) {
- printf ("ERROR: E3002: Unknown FAT Type!\n");
- return;
- }
-
- printf ("\nBoot Sector %s:\n", FatTypeToString (FatType));
- printf ("\n");
- printf (" Offset Title Data\n");
- printf ("==================================================================\n");
- printf (" 0 JMP instruction %02x %02x %02x\n",
- FatBpb.Fat12_16.BS_jmpBoot[0],
- FatBpb.Fat12_16.BS_jmpBoot[1],
- FatBpb.Fat12_16.BS_jmpBoot[2]);
- printf (" 3 OEM %c%c%c%c%c%c%c%c\n",
- FatBpb.Fat12_16.BS_OEMName[0],
- FatBpb.Fat12_16.BS_OEMName[1],
- FatBpb.Fat12_16.BS_OEMName[2],
- FatBpb.Fat12_16.BS_OEMName[3],
- FatBpb.Fat12_16.BS_OEMName[4],
- FatBpb.Fat12_16.BS_OEMName[5],
- FatBpb.Fat12_16.BS_OEMName[6],
- FatBpb.Fat12_16.BS_OEMName[7]);
- printf ("\n");
- printf ("BIOS Parameter Block\n");
- printf (" B Bytes per sector %04x\n", FatBpb.Fat12_16.BPB_BytsPerSec);
- printf (" D Sectors per cluster %02x\n", FatBpb.Fat12_16.BPB_SecPerClus);
- printf (" E Reserved sectors %04x\n", FatBpb.Fat12_16.BPB_RsvdSecCnt);
- printf (" 10 Number of FATs %02x\n", FatBpb.Fat12_16.BPB_NumFATs);
- printf (" 11 Root entries %04x\n", FatBpb.Fat12_16.BPB_RootEntCnt);
- printf (" 13 Sectors (under 32MB) %04x\n", FatBpb.Fat12_16.BPB_TotSec16);
- printf (" 15 Media descriptor %02x\n", FatBpb.Fat12_16.BPB_Media);
- printf (" 16 Sectors per FAT (small vol.) %04x\n", FatBpb.Fat12_16.BPB_FATSz16);
- printf (" 18 Sectors per track %04x\n", FatBpb.Fat12_16.BPB_SecPerTrk);
- printf (" 1A Heads %04x\n", FatBpb.Fat12_16.BPB_NumHeads);
- printf (" 1C Hidden sectors %08x\n", (unsigned) FatBpb.Fat12_16.BPB_HiddSec);
- printf (" 20 Sectors (over 32MB) %08x\n", (unsigned) FatBpb.Fat12_16.BPB_TotSec32);
- printf ("\n");
- if (FatType != FatTypeFat32) {
- printf (" 24 BIOS drive %02x\n", FatBpb.Fat12_16.BS_DrvNum);
- printf (" 25 (Unused) %02x\n", FatBpb.Fat12_16.BS_Reserved1);
- printf (" 26 Ext. boot signature %02x\n", FatBpb.Fat12_16.BS_BootSig);
- printf (" 27 Volume serial number %08x\n", (unsigned) FatBpb.Fat12_16.BS_VolID);
- printf (" 2B Volume lable %c%c%c%c%c%c%c%c%c%c%c\n",
- FatBpb.Fat12_16.BS_VolLab[0],
- FatBpb.Fat12_16.BS_VolLab[1],
- FatBpb.Fat12_16.BS_VolLab[2],
- FatBpb.Fat12_16.BS_VolLab[3],
- FatBpb.Fat12_16.BS_VolLab[4],
- FatBpb.Fat12_16.BS_VolLab[5],
- FatBpb.Fat12_16.BS_VolLab[6],
- FatBpb.Fat12_16.BS_VolLab[7],
- FatBpb.Fat12_16.BS_VolLab[8],
- FatBpb.Fat12_16.BS_VolLab[9],
- FatBpb.Fat12_16.BS_VolLab[10]);
- printf (" 36 File system %c%c%c%c%c%c%c%c\n",
- FatBpb.Fat12_16.BS_FilSysType[0],
- FatBpb.Fat12_16.BS_FilSysType[1],
- FatBpb.Fat12_16.BS_FilSysType[2],
- FatBpb.Fat12_16.BS_FilSysType[3],
- FatBpb.Fat12_16.BS_FilSysType[4],
- FatBpb.Fat12_16.BS_FilSysType[5],
- FatBpb.Fat12_16.BS_FilSysType[6],
- FatBpb.Fat12_16.BS_FilSysType[7]);
- printf ("\n");
- } else {
- printf ("FAT32 Section\n");
- printf (" 24 Sectors per FAT (large vol.) %08x\n", (unsigned) FatBpb.Fat32.BPB_FATSz32);
- printf (" 28 Flags %04x\n", FatBpb.Fat32.BPB_ExtFlags);
- printf (" 2A Version %04x\n", FatBpb.Fat32.BPB_FSVer);
- printf (" 2C Root dir 1st cluster %08x\n", (unsigned) FatBpb.Fat32.BPB_RootClus);
- printf (" 30 FSInfo sector %04x\n", FatBpb.Fat32.BPB_FSInfo);
- printf (" 32 Backup boot sector %04x\n", FatBpb.Fat32.BPB_BkBootSec);
- printf (" 34 (Reserved) %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
- FatBpb.Fat32.BPB_Reserved[0],
- FatBpb.Fat32.BPB_Reserved[1],
- FatBpb.Fat32.BPB_Reserved[2],
- FatBpb.Fat32.BPB_Reserved[3],
- FatBpb.Fat32.BPB_Reserved[4],
- FatBpb.Fat32.BPB_Reserved[5],
- FatBpb.Fat32.BPB_Reserved[6],
- FatBpb.Fat32.BPB_Reserved[7],
- FatBpb.Fat32.BPB_Reserved[8],
- FatBpb.Fat32.BPB_Reserved[9],
- FatBpb.Fat32.BPB_Reserved[10],
- FatBpb.Fat32.BPB_Reserved[11]);
- printf ("\n");
- printf (" 40 BIOS drive %02x\n", FatBpb.Fat32.BS_DrvNum);
- printf (" 41 (Unused) %02x\n", FatBpb.Fat32.BS_Reserved1);
- printf (" 42 Ext. boot signature %02x\n", FatBpb.Fat32.BS_BootSig);
- printf (" 43 Volume serial number %08x\n", (unsigned) FatBpb.Fat32.BS_VolID);
- printf (" 47 Volume lable %c%c%c%c%c%c%c%c%c%c%c\n",
- FatBpb.Fat32.BS_VolLab[0],
- FatBpb.Fat32.BS_VolLab[1],
- FatBpb.Fat32.BS_VolLab[2],
- FatBpb.Fat32.BS_VolLab[3],
- FatBpb.Fat32.BS_VolLab[4],
- FatBpb.Fat32.BS_VolLab[5],
- FatBpb.Fat32.BS_VolLab[6],
- FatBpb.Fat32.BS_VolLab[7],
- FatBpb.Fat32.BS_VolLab[8],
- FatBpb.Fat32.BS_VolLab[9],
- FatBpb.Fat32.BS_VolLab[10]);
- printf (" 52 File system %c%c%c%c%c%c%c%c\n",
- FatBpb.Fat32.BS_FilSysType[0],
- FatBpb.Fat32.BS_FilSysType[1],
- FatBpb.Fat32.BS_FilSysType[2],
- FatBpb.Fat32.BS_FilSysType[3],
- FatBpb.Fat32.BS_FilSysType[4],
- FatBpb.Fat32.BS_FilSysType[5],
- FatBpb.Fat32.BS_FilSysType[6],
- FatBpb.Fat32.BS_FilSysType[7]);
- printf ("\n");
- }
- printf (" 1FE Signature %04x\n", FatBpb.Fat12_16.Signature);
- printf ("\n");
-
-
- return ;
-}
-
-void
-PatchBootSector (
- char *DestFileName,
- char *SourceFileName,
- BOOLEAN ForcePatch
- )
-/*++
-Routine Description:
- Patch destination file according to the information from source file.
- Only patch BPB data but leave boot code un-touched.
-
-Arguments:
- DestFileName - Destination file to patch
- SourceFileName - Source file where patch from
---*/
-{
- FAT_BPB_STRUCT DestFatBpb;
- FAT_BPB_STRUCT SourceFatBpb;
- FAT_TYPE DestFatType;
- FAT_TYPE SourceFatType;
- CHAR8 VolLab[11];
- CHAR8 FilSysType[8];
-
- if (ReadFromFile ((void *)&DestFatBpb, DestFileName) == 0) {
- return ;
- }
- if (ReadFromFile ((void *)&SourceFatBpb, SourceFileName) == 0) {
- return ;
- }
-
- DestFatType = GetFatType (&DestFatBpb);
- SourceFatType = GetFatType (&SourceFatBpb);
-
- if (DestFatType != SourceFatType) {
- //
- // FAT type mismatch
- //
- if (ForcePatch) {
- DebugMsg (NULL, 0, DEBUG_WARN, NULL, "ERROR: E3004: FAT type mismatch: Source - %s, Dest - %s",
- FatTypeToString(SourceFatType), FatTypeToString(DestFatType));
- } else {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3004: FAT type mismatch: Source - %s, Dest - %s",
- FatTypeToString(SourceFatType), FatTypeToString(DestFatType));
- return ;
- }
- }
-
- if (SourceFatType <= FatTypeUnknown || SourceFatType >= FatTypeMax) {
- DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E3002: Unknown FAT Type!\n");
- return;
- }
-
- //
- // Copy BPB/boot data (excluding BS_jmpBoot, BS_OEMName, BootCode and Signature) from SourceFatBpb to DestFatBpb
- //
- printf ("Patching %s BPB: ", FatTypeToString (SourceFatType));
- if (SourceFatType != FatTypeFat32) {
- memcpy (
- &DestFatBpb.Fat12_16.BPB_BytsPerSec,
- &SourceFatBpb.Fat12_16.BPB_BytsPerSec,
- ((UINTN)&DestFatBpb.Fat12_16.Reserved - (UINTN)&DestFatBpb.Fat12_16.BPB_BytsPerSec)
- );
- } else {
- memcpy (
- &DestFatBpb.Fat32.BPB_BytsPerSec,
- &SourceFatBpb.Fat32.BPB_BytsPerSec,
- ((UINTN)&DestFatBpb.Fat32.Reserved - (UINTN)&DestFatBpb.Fat32.BPB_BytsPerSec)
- );
- }
-
- //
- // Set BS_VolLab and BS_FilSysType of DestFatBpb
- //
- // BS_VolLab BS_FilSysType
- // FAT12: EFI FAT12 FAT12
- // FAT16: EFI FAT16 FAT16
- // FAT32: EFI FAT32 FAT32
- //
- if (SourceFatType == FatTypeFat32) {
- memcpy (VolLab, "EFI FAT32 ", sizeof(VolLab));
- memcpy (FilSysType, FAT32_FILSYSTYPE, sizeof(FilSysType));
- } else if (SourceFatType == FatTypeFat16) {
- memcpy (VolLab, "EFI FAT16 ", sizeof(VolLab));
- memcpy (FilSysType, FAT16_FILSYSTYPE, sizeof(FilSysType));
- } else {
- memcpy (VolLab, "EFI FAT12 ", sizeof(VolLab));
- memcpy (FilSysType, FAT12_FILSYSTYPE, sizeof(FilSysType));
- }
- if (SourceFatType != FatTypeFat32) {
- memcpy (DestFatBpb.Fat12_16.BS_VolLab, VolLab, sizeof(VolLab));
- memcpy (DestFatBpb.Fat12_16.BS_FilSysType, FilSysType, sizeof(FilSysType));
- } else {
- memcpy (DestFatBpb.Fat32.BS_VolLab, VolLab, sizeof(VolLab));
- memcpy (DestFatBpb.Fat32.BS_FilSysType, FilSysType, sizeof(FilSysType));
- }
-
- //
- // Set Signature of DestFatBpb to 55AA
- //
- DestFatBpb.Fat12_16.Signature = FAT_BS_SIGNATURE;
-
- //
- // Write DestFatBpb
- //
- if (WriteToFile ((void *)&DestFatBpb, DestFileName)) {
- printf ("successful!\n");
- } else {
- printf ("failed!\n");
- }
-
- return ;
-}
-
-void
-ParseMbr (
- char *FileName
- )
-{
- MASTER_BOOT_RECORD Mbr;
-
- if (ReadFromFile ((void *)&Mbr, FileName) == 0) {
- return ;
- }
-
- printf ("\nMaster Boot Record:\n");
- printf ("\n");
- printf (" Offset Title Value\n");
- printf ("==================================================================\n");
- printf (" 0 Master bootstrap loader code (not list)\n");
- printf (" 1B8 Windows disk signature %08x\n", (unsigned) Mbr.UniqueMbrSignature);
- printf ("\n");
- printf ("Partition Table Entry #1\n");
- printf (" 1BE 80 = active partition %02x\n", Mbr.PartitionRecord[0].BootIndicator);
- printf (" 1BF Start head %02x\n", Mbr.PartitionRecord[0].StartHead);
- printf (" 1C0 Start sector %02x\n", Mbr.PartitionRecord[0].StartSector);
- printf (" 1C1 Start cylinder %02x\n", Mbr.PartitionRecord[0].StartTrack);
- printf (" 1C2 Partition type indicator %02x\n", Mbr.PartitionRecord[0].OSType);
- printf (" 1C3 End head %02x\n", Mbr.PartitionRecord[0].EndHead);
- printf (" 1C4 End sector %02x\n", Mbr.PartitionRecord[0].EndSector);
- printf (" 1C5 End cylinder %02x\n", Mbr.PartitionRecord[0].EndTrack);
- printf (" 1C6 Sectors preceding partition %08x\n", (unsigned) Mbr.PartitionRecord[0].StartingLBA);
- printf (" 1CA Sectors in partition %08x\n", (unsigned) Mbr.PartitionRecord[0].SizeInLBA);
- printf ("\n");
- printf ("Partition Table Entry #2\n");
- printf (" 1CE 80 = active partition %02x\n", Mbr.PartitionRecord[1].BootIndicator);
- printf (" 1CF Start head %02x\n", Mbr.PartitionRecord[1].StartHead);
- printf (" 1D0 Start sector %02x\n", Mbr.PartitionRecord[1].StartSector);
- printf (" 1D1 Start cylinder %02x\n", Mbr.PartitionRecord[1].StartTrack);
- printf (" 1D2 Partition type indicator %02x\n", Mbr.PartitionRecord[1].OSType);
- printf (" 1D3 End head %02x\n", Mbr.PartitionRecord[1].EndHead);
- printf (" 1D4 End sector %02x\n", Mbr.PartitionRecord[1].EndSector);
- printf (" 1D5 End cylinder %02x\n", Mbr.PartitionRecord[1].EndTrack);
- printf (" 1D6 Sectors preceding partition %08x\n", (unsigned) Mbr.PartitionRecord[1].StartingLBA);
- printf (" 1DA Sectors in partition %08x\n", (unsigned) Mbr.PartitionRecord[1].SizeInLBA);
- printf ("\n");
- printf ("Partition Table Entry #3\n");
- printf (" 1DE 80 = active partition %02x\n", Mbr.PartitionRecord[2].BootIndicator);
- printf (" 1DF Start head %02x\n", Mbr.PartitionRecord[2].StartHead);
- printf (" 1E0 Start sector %02x\n", Mbr.PartitionRecord[2].StartSector);
- printf (" 1E1 Start cylinder %02x\n", Mbr.PartitionRecord[2].StartTrack);
- printf (" 1E2 Partition type indicator %02x\n", Mbr.PartitionRecord[2].OSType);
- printf (" 1E3 End head %02x\n", Mbr.PartitionRecord[2].EndHead);
- printf (" 1E4 End sector %02x\n", Mbr.PartitionRecord[2].EndSector);
- printf (" 1E5 End cylinder %02x\n", Mbr.PartitionRecord[2].EndTrack);
- printf (" 1E6 Sectors preceding partition %08x\n", (unsigned) Mbr.PartitionRecord[2].StartingLBA);
- printf (" 1EA Sectors in partition %08x\n", (unsigned) Mbr.PartitionRecord[2].SizeInLBA);
- printf ("\n");
- printf ("Partition Table Entry #4\n");
- printf (" 1EE 80 = active partition %02x\n", Mbr.PartitionRecord[3].BootIndicator);
- printf (" 1EF Start head %02x\n", Mbr.PartitionRecord[3].StartHead);
- printf (" 1F0 Start sector %02x\n", Mbr.PartitionRecord[3].StartSector);
- printf (" 1F1 Start cylinder %02x\n", Mbr.PartitionRecord[3].StartTrack);
- printf (" 1F2 Partition type indicator %02x\n", Mbr.PartitionRecord[3].OSType);
- printf (" 1F3 End head %02x\n", Mbr.PartitionRecord[3].EndHead);
- printf (" 1F4 End sector %02x\n", Mbr.PartitionRecord[3].EndSector);
- printf (" 1F5 End cylinder %02x\n", Mbr.PartitionRecord[3].EndTrack);
- printf (" 1F6 Sectors preceding partition %08x\n", (unsigned) Mbr.PartitionRecord[3].StartingLBA);
- printf (" 1FA Sectors in partition %08x\n", (unsigned) Mbr.PartitionRecord[3].SizeInLBA);
- printf ("\n");
- printf (" 1FE Signature %04x\n", Mbr.Signature);
- printf ("\n");
-
- return ;
-}
-
-void
-PatchMbr (
- char *DestFileName,
- char *SourceFileName
- )
-{
- MASTER_BOOT_RECORD DestMbr;
- MASTER_BOOT_RECORD SourceMbr;
-
- if (ReadFromFile ((void *)&DestMbr, DestFileName) == 0) {
- return ;
- }
- if (ReadFromFile ((void *)&SourceMbr, SourceFileName) == 0) {
- return ;
- }
-
- if (SourceMbr.Signature != MBR_SIGNATURE) {
- printf ("ERROR: E3000: Invalid MBR!\n");
- return;
- }
-
- printf ("Patching MBR:\n");
- memcpy (
- &DestMbr.PartitionRecord[0],
- &SourceMbr.PartitionRecord[0],
- sizeof(DestMbr.PartitionRecord)
- );
-
- DestMbr.Signature = MBR_SIGNATURE;
-
-
- if (WriteToFile ((void *)&DestMbr, DestFileName)) {
- printf ("\tsuccessful!\n");
- }
-
- return ;
-}
-
-
-int
-main (
- int argc,
- char *argv[]
- )
-{
- char *SrcImage;
- char *DstImage;
- BOOLEAN ForcePatch; // -f
- BOOLEAN ProcessMbr; // -m
- BOOLEAN DoParse; // -p SrcImage or -g SrcImage DstImage
- BOOLEAN Verbose; // -v
- UINT64 LogLevel;
- EFI_STATUS EfiStatus;
-
- SrcImage = DstImage = NULL;
- ForcePatch = FALSE;
- ProcessMbr = FALSE;
- DoParse = TRUE;
- Verbose = FALSE;
-
- SetUtilityName ("bootsectimage");
-
- argc--; argv++;
-
- if (argc == 0) {
- Usage ();
- return -1;
- }
-
- while (argc != 0) {
- if (strcmp (*argv, "-f") == 0 || strcmp (*argv, "--force") == 0) {
- ForcePatch = TRUE;
- } else if (strcmp (*argv, "-p") == 0 || strcmp (*argv, "--parse") == 0) {
- DoParse = TRUE;
- argc--; argv++;
- if (argc < 1) {
- Usage ();
- return -1;
- }
- SrcImage = *argv;
- } else if (strcmp (*argv, "-g") == 0 || strcmp (*argv, "--patch") == 0) {
- DoParse = FALSE;
- argc--; argv++;
- if (argc < 2) {
- Usage ();
- return -1;
- }
- SrcImage = *argv;
- argc--; argv++;
- DstImage = *argv;
- } else if (strcmp (*argv, "-m") == 0 || strcmp (*argv, "--mbr") == 0) {
- ProcessMbr = TRUE;
- } else if (strcmp (*argv, "-v") == 0 || strcmp (*argv, "--verbose") == 0) {
- Verbose = TRUE;
- } else if ((stricmp (*argv, "-d") == 0) || (stricmp (*argv, "--debug") == 0)) {
- argc--; argv++;
- if (argc < 1) {
- Usage ();
- return -1;
- }
- EfiStatus = AsciiStringToUint64 (*argv, FALSE, &LogLevel);
- if (EFI_ERROR (EfiStatus)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", "--debug", *argv);
- return 1;
- }
- if (LogLevel > 9) {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, currnt input level is %d", (int) LogLevel);
- return 1;
- }
- SetPrintLevel (LogLevel);
- DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", *argv);
- } else {
- Usage ();
- return -1;
- }
-
- argc--; argv++;
- }
-
- if (ForcePatch && DoParse) {
- printf ("ERROR: E1002: Conflicting options: -f, -p. Cannot apply force(-f) to parse(-p)!\n");
- Usage ();
- return -1;
- }
- if (ForcePatch && !DoParse && ProcessMbr) {
- printf ("ERROR: E1002: Conflicting options: -f, -g -m. Cannot apply force(-f) to processing MBR (-g -m)!\n");
- Usage ();
- return -1;
- }
-
- if (Verbose) {
- SetPrintLevel (VERBOSE_LOG_LEVEL);
- } else {
- SetPrintLevel (KEY_LOG_LEVEL);
- }
-
- if (DoParse) {
- if (ProcessMbr) {
- ParseMbr (SrcImage);
- } else {
- ParseBootSector (SrcImage);
- }
- } else {
- if (ProcessMbr) {
- PatchMbr (DstImage, SrcImage);
- } else {
- PatchBootSector (DstImage, SrcImage, ForcePatch);
- }
- }
-
- return 0;
-}
-
diff --git a/BaseTools/Source/C/BootSectImage/fat.h b/BaseTools/Source/C/BootSectImage/fat.h
deleted file mode 100644
index 5827d18bb2..0000000000
--- a/BaseTools/Source/C/BootSectImage/fat.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/** @file
-
- Fat file system structure and definition.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _FAT_BPB_H_
-#define _FAT_BPB_H_
-
-#include "CommonLib.h"
-
-#pragma pack(1)
-
-typedef struct {
- //
- // Fat common field
- //
- UINT8 BS_jmpBoot[3];
- CHAR8 BS_OEMName[8];
- UINT16 BPB_BytsPerSec;
- UINT8 BPB_SecPerClus;
- UINT16 BPB_RsvdSecCnt;
- UINT8 BPB_NumFATs;
- UINT16 BPB_RootEntCnt;
- UINT16 BPB_TotSec16;
- UINT8 BPB_Media;
- UINT16 BPB_FATSz16;
- UINT16 BPB_SecPerTrk;
- UINT16 BPB_NumHeads;
- UINT32 BPB_HiddSec;
- UINT32 BPB_TotSec32;
-
- //
- // Fat12/16 specific field
- //
- UINT8 BS_DrvNum;
- UINT8 BS_Reserved1;
- UINT8 BS_BootSig;
- UINT32 BS_VolID;
- CHAR8 BS_VolLab[11];
- CHAR8 BS_FilSysType[8];
-
- //
- // Boot Code and Data
- //
- UINT8 Reserved[448];
-
- //
- // Fat common signature - 0xAA55
- //
- UINT16 Signature;
-} FAT12_16_BPB_STRUCT;
-
-typedef struct {
- //
- // Fat common field
- //
- UINT8 BS_jmpBoot[3];
- CHAR8 BS_OEMName[8];
- UINT16 BPB_BytsPerSec;
- UINT8 BPB_SecPerClus;
- UINT16 BPB_RsvdSecCnt;
- UINT8 BPB_NumFATs;
- UINT16 BPB_RootEntCnt;
- UINT16 BPB_TotSec16;
- UINT8 BPB_Media;
- UINT16 BPB_FATSz16;
- UINT16 BPB_SecPerTrk;
- UINT16 BPB_NumHeads;
- UINT32 BPB_HiddSec;
- UINT32 BPB_TotSec32;
-
- //
- // Fat32 specific field
- //
- UINT32 BPB_FATSz32;
- UINT16 BPB_ExtFlags;
- UINT16 BPB_FSVer;
- UINT32 BPB_RootClus;
- UINT16 BPB_FSInfo;
- UINT16 BPB_BkBootSec;
- UINT8 BPB_Reserved[12];
- UINT8 BS_DrvNum;
- UINT8 BS_Reserved1;
- UINT8 BS_BootSig;
- UINT32 BS_VolID;
- CHAR8 BS_VolLab[11];
- CHAR8 BS_FilSysType[8];
-
- //
- // Boot Code and Data
- //
- UINT8 Reserved[420];
-
- //
- // Fat common signature - 0xAA55
- //
- UINT16 Signature;
-} FAT32_BPB_STRUCT;
-
-typedef union {
- FAT12_16_BPB_STRUCT Fat12_16;
- FAT32_BPB_STRUCT Fat32;
-} FAT_BPB_STRUCT;
-
-typedef enum {
- FatTypeUnknown,
- FatTypeFat12,
- FatTypeFat16,
- FatTypeFat32,
- FatTypeMax
-} FAT_TYPE;
-
-typedef struct {
- CHAR8 DIR_Name[11];
- UINT8 DIR_Attr;
- UINT8 DIR_NTRes;
- UINT8 DIR_CrtTimeTenth;
- UINT16 DIR_CrtTime;
- UINT16 DIR_CrtDate;
- UINT16 DIR_LstAccDate;
- UINT16 DIR_FstClusHI;
- UINT16 DIR_WrtTime;
- UINT16 DIR_WrtDate;
- UINT16 DIR_FstClusLO;
- UINT32 DIR_FileSize;
-} FAT_DIRECTORY_ENTRY;
-
-#pragma pack()
-
-#define FAT_MAX_FAT12_CLUSTER 0xFF5
-#define FAT_MAX_FAT16_CLUSTER 0xFFF5
-
-#define FAT_BS_SIGNATURE 0xAA55
-#define FAT_BS_BOOTSIG 0x29
-#define FAT_BS_JMP1 0xEB
-#define FAT_BS_JMP2 0xE9
-#define FAT_FILSYSTYPE "FAT "
-#define FAT12_FILSYSTYPE "FAT12 "
-#define FAT16_FILSYSTYPE "FAT16 "
-#define FAT32_FILSYSTYPE "FAT32 "
-
-#endif
diff --git a/BaseTools/Source/C/BootSectImage/mbr.h b/BaseTools/Source/C/BootSectImage/mbr.h
deleted file mode 100644
index 36d157da24..0000000000
--- a/BaseTools/Source/C/BootSectImage/mbr.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/** @file
-
- MBR Partition Entry and Table structure defintions.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _MBR_H_
-#define _MBR_H_
-
-#include "CommonLib.h"
-
-#pragma pack(1)
-
-#define MAX_MBR_PARTITIONS 4
-
-//
-// MBR Partition Entry
-//
-typedef struct {
- UINT8 BootIndicator;
- UINT8 StartHead;
- UINT8 StartSector;
- UINT8 StartTrack;
- UINT8 OSType;
- UINT8 EndHead;
- UINT8 EndSector;
- UINT8 EndTrack;
- UINT32 StartingLBA;
- UINT32 SizeInLBA;
-} MBR_PARTITION_RECORD;
-
-//
-// MBR Partition table
-//
-typedef struct {
- UINT8 BootCode[440];
- UINT32 UniqueMbrSignature;
- UINT16 Unknown;
- MBR_PARTITION_RECORD PartitionRecord[MAX_MBR_PARTITIONS];
- UINT16 Signature;
-} MASTER_BOOT_RECORD;
-
-#pragma pack()
-
-#define MBR_SIGNATURE 0xAA55
-#define EXTENDED_DOS_PARTITION 0x05
-#define EXTENDED_WINDOWS_PARTITION 0x0F
-
-#endif
diff --git a/BaseTools/Source/C/Common/BasePeCoff.c b/BaseTools/Source/C/Common/BasePeCoff.c
deleted file mode 100644
index afb45df40b..0000000000
--- a/BaseTools/Source/C/Common/BasePeCoff.c
+++ /dev/null
@@ -1,1461 +0,0 @@
-/** @file
-
- Functions to get info and load PE/COFF image.
-
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
-Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Common/UefiBaseTypes.h>
-#include <CommonLib.h>
-#include <IndustryStandard/PeImage.h>
-#include "PeCoffLib.h"
-
-typedef union {
- VOID *Header;
- EFI_IMAGE_OPTIONAL_HEADER32 *Optional32;
- EFI_IMAGE_OPTIONAL_HEADER64 *Optional64;
-} EFI_IMAGE_OPTIONAL_HEADER_POINTER;
-
-STATIC
-RETURN_STATUS
-PeCoffLoaderGetPeHeader (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- OUT EFI_IMAGE_OPTIONAL_HEADER_UNION **PeHdr,
- OUT EFI_TE_IMAGE_HEADER **TeHdr
- );
-
-STATIC
-RETURN_STATUS
-PeCoffLoaderCheckImageType (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN EFI_IMAGE_OPTIONAL_HEADER_UNION *PeHdr,
- IN EFI_TE_IMAGE_HEADER *TeHdr
- );
-
-STATIC
-VOID *
-PeCoffLoaderImageAddress (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN UINTN Address
- );
-
-RETURN_STATUS
-PeCoffLoaderRelocateIa32Image (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- );
-
-RETURN_STATUS
-PeCoffLoaderRelocateX64Image (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- );
-
-RETURN_STATUS
-PeCoffLoaderRelocateIpfImage (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- );
-
-RETURN_STATUS
-PeCoffLoaderRelocateArmImage (
- IN UINT16 **Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- );
-
-RETURN_STATUS
-PeCoffLoaderRelocateAArch64Image (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- );
-
-STATIC
-RETURN_STATUS
-PeCoffLoaderGetPeHeader (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- OUT EFI_IMAGE_OPTIONAL_HEADER_UNION **PeHdr,
- OUT EFI_TE_IMAGE_HEADER **TeHdr
- )
-/*++
-
-Routine Description:
-
- Retrieves the PE or TE Header from a PE/COFF or TE image
-
-Arguments:
-
- ImageContext - The context of the image being loaded
-
- PeHdr - The buffer in which to return the PE header
-
- TeHdr - The buffer in which to return the TE header
-
-Returns:
-
- RETURN_SUCCESS if the PE or TE Header is read,
- Otherwise, the error status from reading the PE/COFF or TE image using the ImageRead function.
-
---*/
-{
- RETURN_STATUS Status;
- EFI_IMAGE_DOS_HEADER DosHdr;
- UINTN Size;
-
- ImageContext->IsTeImage = FALSE;
- //
- // Read the DOS image headers
- //
- Size = sizeof (EFI_IMAGE_DOS_HEADER);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- 0,
- &Size,
- &DosHdr
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- ImageContext->PeCoffHeaderOffset = 0;
- if (DosHdr.e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image header
- //
- ImageContext->PeCoffHeaderOffset = DosHdr.e_lfanew;
- }
- //
- // Get the PE/COFF Header pointer
- //
- *PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *) ((UINTN)ImageContext->Handle + ImageContext->PeCoffHeaderOffset);
- if ((*PeHdr)->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) {
- //
- // Check the PE/COFF Header Signature. If not, then try to get a TE header
- //
- *TeHdr = (EFI_TE_IMAGE_HEADER *)*PeHdr;
- if ((*TeHdr)->Signature != EFI_TE_IMAGE_HEADER_SIGNATURE) {
- return RETURN_UNSUPPORTED;
- }
- ImageContext->IsTeImage = TRUE;
- }
-
- return RETURN_SUCCESS;
-}
-
-STATIC
-RETURN_STATUS
-PeCoffLoaderCheckImageType (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN EFI_IMAGE_OPTIONAL_HEADER_UNION *PeHdr,
- IN EFI_TE_IMAGE_HEADER *TeHdr
- )
-/*++
-
-Routine Description:
-
- Checks the PE or TE header of a PE/COFF or TE image to determine if it supported
-
-Arguments:
-
- ImageContext - The context of the image being loaded
-
- PeHdr - The buffer in which to return the PE header
-
- TeHdr - The buffer in which to return the TE header
-
-Returns:
-
- RETURN_SUCCESS if the PE/COFF or TE image is supported
- RETURN_UNSUPPORTED of the PE/COFF or TE image is not supported.
-
---*/
-{
- //
- // See if the machine type is supported.
- // We support a native machine type (IA-32/Itanium-based)
- //
- if (ImageContext->IsTeImage == FALSE) {
- ImageContext->Machine = PeHdr->Pe32.FileHeader.Machine;
- } else {
- ImageContext->Machine = TeHdr->Machine;
- }
-
- if (ImageContext->Machine != EFI_IMAGE_MACHINE_IA32 && \
- ImageContext->Machine != EFI_IMAGE_MACHINE_IA64 && \
- ImageContext->Machine != EFI_IMAGE_MACHINE_X64 && \
- ImageContext->Machine != EFI_IMAGE_MACHINE_ARMT && \
- ImageContext->Machine != EFI_IMAGE_MACHINE_EBC && \
- ImageContext->Machine != EFI_IMAGE_MACHINE_AARCH64) {
- if (ImageContext->Machine == IMAGE_FILE_MACHINE_ARM) {
- //
- // There are two types of ARM images. Pure ARM and ARM/Thumb.
- // If we see the ARM say it is the ARM/Thumb so there is only
- // a single machine type we need to check for ARM.
- //
- ImageContext->Machine = EFI_IMAGE_MACHINE_ARMT;
- if (ImageContext->IsTeImage == FALSE) {
- PeHdr->Pe32.FileHeader.Machine = ImageContext->Machine;
- } else {
- TeHdr->Machine = ImageContext->Machine;
- }
-
- } else {
- //
- // unsupported PeImage machine type
- //
- return RETURN_UNSUPPORTED;
- }
- }
-
- //
- // See if the image type is supported. We support EFI Applications,
- // EFI Boot Service Drivers, EFI Runtime Drivers and EFI SAL Drivers.
- //
- if (ImageContext->IsTeImage == FALSE) {
- ImageContext->ImageType = PeHdr->Pe32.OptionalHeader.Subsystem;
- } else {
- ImageContext->ImageType = (UINT16) (TeHdr->Subsystem);
- }
-
- if (ImageContext->ImageType != EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION && \
- ImageContext->ImageType != EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER && \
- ImageContext->ImageType != EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER && \
- ImageContext->ImageType != EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER) {
- //
- // upsupported PeImage subsystem type
- //
- return RETURN_UNSUPPORTED;
- }
-
- return RETURN_SUCCESS;
-}
-
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderGetImageInfo (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-/*++
-
-Routine Description:
-
- Retrieves information on a PE/COFF image
-
-Arguments:
-
- This - Calling context
- ImageContext - The context of the image being loaded
-
-Returns:
-
- RETURN_SUCCESS - The information on the PE/COFF image was collected.
- RETURN_INVALID_PARAMETER - ImageContext is NULL.
- RETURN_UNSUPPORTED - The PE/COFF image is not supported.
- Otherwise - The error status from reading the PE/COFF image using the
- ImageContext->ImageRead() function
-
---*/
-{
- RETURN_STATUS Status;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *PeHdr;
- EFI_TE_IMAGE_HEADER *TeHdr;
- EFI_IMAGE_DATA_DIRECTORY *DebugDirectoryEntry;
- UINTN Size;
- UINTN Index;
- UINTN DebugDirectoryEntryRva;
- UINTN DebugDirectoryEntryFileOffset;
- UINTN SectionHeaderOffset;
- EFI_IMAGE_SECTION_HEADER SectionHeader;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY DebugEntry;
- EFI_IMAGE_OPTIONAL_HEADER_POINTER OptionHeader;
-
- PeHdr = NULL;
- TeHdr = NULL;
- DebugDirectoryEntry = NULL;
- DebugDirectoryEntryRva = 0;
-
- if (NULL == ImageContext) {
- return RETURN_INVALID_PARAMETER;
- }
- //
- // Assume success
- //
- ImageContext->ImageError = IMAGE_ERROR_SUCCESS;
-
- Status = PeCoffLoaderGetPeHeader (ImageContext, &PeHdr, &TeHdr);
- if (RETURN_ERROR (Status)) {
- return Status;
- }
-
- //
- // Verify machine type
- //
- Status = PeCoffLoaderCheckImageType (ImageContext, PeHdr, TeHdr);
- if (RETURN_ERROR (Status)) {
- return Status;
- }
- OptionHeader.Header = (VOID *) &(PeHdr->Pe32.OptionalHeader);
-
- //
- // Retrieve the base address of the image
- //
- if (!(ImageContext->IsTeImage)) {
- if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- ImageContext->ImageAddress = (PHYSICAL_ADDRESS) OptionHeader.Optional32->ImageBase;
- } else {
- ImageContext->ImageAddress = (PHYSICAL_ADDRESS) OptionHeader.Optional64->ImageBase;
- }
- } else {
- ImageContext->ImageAddress = (PHYSICAL_ADDRESS) (TeHdr->ImageBase + TeHdr->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER));
- }
- //
- // Initialize the alternate destination address to 0 indicating that it
- // should not be used.
- //
- ImageContext->DestinationAddress = 0;
-
- //
- // Initialize the codeview pointer.
- //
- ImageContext->CodeView = NULL;
- ImageContext->PdbPointer = NULL;
-
- //
- // Three cases with regards to relocations:
- // - Image has base relocs, RELOCS_STRIPPED==0 => image is relocatable
- // - Image has no base relocs, RELOCS_STRIPPED==1 => Image is not relocatable
- // - Image has no base relocs, RELOCS_STRIPPED==0 => Image is relocatable but
- // has no base relocs to apply
- // Obviously having base relocations with RELOCS_STRIPPED==1 is invalid.
- //
- // Look at the file header to determine if relocations have been stripped, and
- // save this info in the image context for later use.
- //
- if ((!(ImageContext->IsTeImage)) && ((PeHdr->Pe32.FileHeader.Characteristics & EFI_IMAGE_FILE_RELOCS_STRIPPED) != 0)) {
- ImageContext->RelocationsStripped = TRUE;
- } else if ((ImageContext->IsTeImage) && (TeHdr->DataDirectory[0].Size == 0)) {
- ImageContext->RelocationsStripped = TRUE;
- } else {
- ImageContext->RelocationsStripped = FALSE;
- }
-
- if (!(ImageContext->IsTeImage)) {
-
- if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- ImageContext->ImageSize = (UINT64) OptionHeader.Optional32->SizeOfImage;
- ImageContext->SectionAlignment = OptionHeader.Optional32->SectionAlignment;
- ImageContext->SizeOfHeaders = OptionHeader.Optional32->SizeOfHeaders;
-
- //
- // Modify ImageSize to contain .PDB file name if required and initialize
- // PdbRVA field...
- //
- if (OptionHeader.Optional32->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
- DebugDirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(OptionHeader.Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- DebugDirectoryEntryRva = DebugDirectoryEntry->VirtualAddress;
- }
- } else {
- ImageContext->ImageSize = (UINT64) OptionHeader.Optional64->SizeOfImage;
- ImageContext->SectionAlignment = OptionHeader.Optional64->SectionAlignment;
- ImageContext->SizeOfHeaders = OptionHeader.Optional64->SizeOfHeaders;
-
- //
- // Modify ImageSize to contain .PDB file name if required and initialize
- // PdbRVA field...
- //
- if (OptionHeader.Optional64->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
- DebugDirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(OptionHeader.Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- DebugDirectoryEntryRva = DebugDirectoryEntry->VirtualAddress;
- }
- }
-
- if (DebugDirectoryEntryRva != 0) {
- //
- // Determine the file offset of the debug directory... This means we walk
- // the sections to find which section contains the RVA of the debug
- // directory
- //
- DebugDirectoryEntryFileOffset = 0;
-
- SectionHeaderOffset = (UINTN)(
- ImageContext->PeCoffHeaderOffset +
- sizeof (UINT32) +
- sizeof (EFI_IMAGE_FILE_HEADER) +
- PeHdr->Pe32.FileHeader.SizeOfOptionalHeader
- );
-
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index++) {
- //
- // Read section header from file
- //
- Size = sizeof (EFI_IMAGE_SECTION_HEADER);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- SectionHeaderOffset,
- &Size,
- &SectionHeader
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugDirectoryEntryRva >= SectionHeader.VirtualAddress &&
- DebugDirectoryEntryRva < SectionHeader.VirtualAddress + SectionHeader.Misc.VirtualSize) {
- DebugDirectoryEntryFileOffset =
- DebugDirectoryEntryRva - SectionHeader.VirtualAddress + SectionHeader.PointerToRawData;
- break;
- }
-
- SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
- }
-
- if (DebugDirectoryEntryFileOffset != 0) {
- for (Index = 0; Index < DebugDirectoryEntry->Size; Index += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) {
- //
- // Read next debug directory entry
- //
- Size = sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugDirectoryEntryFileOffset + Index,
- &Size,
- &DebugEntry
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugEntry.Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- ImageContext->DebugDirectoryEntryRva = (UINT32) (DebugDirectoryEntryRva + Index);
- if (DebugEntry.RVA == 0 && DebugEntry.FileOffset != 0) {
- ImageContext->ImageSize += DebugEntry.SizeOfData;
- }
-
- return RETURN_SUCCESS;
- }
- }
- }
- }
- } else {
- ImageContext->ImageSize = 0;
- ImageContext->SectionAlignment = 4096;
- ImageContext->SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN) TeHdr->BaseOfCode - (UINTN) TeHdr->StrippedSize;
-
- DebugDirectoryEntry = &TeHdr->DataDirectory[1];
- DebugDirectoryEntryRva = DebugDirectoryEntry->VirtualAddress;
- SectionHeaderOffset = (UINTN) (sizeof (EFI_TE_IMAGE_HEADER));
-
- DebugDirectoryEntryFileOffset = 0;
-
- for (Index = 0; Index < TeHdr->NumberOfSections;) {
- //
- // Read section header from file
- //
- Size = sizeof (EFI_IMAGE_SECTION_HEADER);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- SectionHeaderOffset,
- &Size,
- &SectionHeader
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugDirectoryEntryRva >= SectionHeader.VirtualAddress &&
- DebugDirectoryEntryRva < SectionHeader.VirtualAddress + SectionHeader.Misc.VirtualSize) {
- DebugDirectoryEntryFileOffset = DebugDirectoryEntryRva -
- SectionHeader.VirtualAddress +
- SectionHeader.PointerToRawData +
- sizeof (EFI_TE_IMAGE_HEADER) -
- TeHdr->StrippedSize;
-
- //
- // File offset of the debug directory was found, if this is not the last
- // section, then skip to the last section for calculating the image size.
- //
- if (Index < (UINTN) TeHdr->NumberOfSections - 1) {
- SectionHeaderOffset += (TeHdr->NumberOfSections - 1 - Index) * sizeof (EFI_IMAGE_SECTION_HEADER);
- Index = TeHdr->NumberOfSections - 1;
- continue;
- }
- }
-
- //
- // In Te image header there is not a field to describe the ImageSize.
- // Actually, the ImageSize equals the RVA plus the VirtualSize of
- // the last section mapped into memory (Must be rounded up to
- // a mulitple of Section Alignment). Per the PE/COFF specification, the
- // section headers in the Section Table must appear in order of the RVA
- // values for the corresponding sections. So the ImageSize can be determined
- // by the RVA and the VirtualSize of the last section header in the
- // Section Table.
- //
- if ((++Index) == (UINTN) TeHdr->NumberOfSections) {
- ImageContext->ImageSize = (SectionHeader.VirtualAddress + SectionHeader.Misc.VirtualSize +
- ImageContext->SectionAlignment - 1) & ~(ImageContext->SectionAlignment - 1);
- }
-
- SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
- }
-
- if (DebugDirectoryEntryFileOffset != 0) {
- for (Index = 0; Index < DebugDirectoryEntry->Size; Index += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) {
- //
- // Read next debug directory entry
- //
- Size = sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugDirectoryEntryFileOffset,
- &Size,
- &DebugEntry
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugEntry.Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- ImageContext->DebugDirectoryEntryRva = (UINT32) (DebugDirectoryEntryRva + Index);
- return RETURN_SUCCESS;
- }
- }
- }
- }
-
- return RETURN_SUCCESS;
-}
-
-STATIC
-VOID *
-PeCoffLoaderImageAddress (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN UINTN Address
- )
-/*++
-
-Routine Description:
-
- Converts an image address to the loaded address
-
-Arguments:
-
- ImageContext - The context of the image being loaded
-
- Address - The address to be converted to the loaded address
-
-Returns:
-
- NULL if the address can not be converted, otherwise, the converted address
-
---*/
-{
- if (Address >= ImageContext->ImageSize) {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_IMAGE_ADDRESS;
- return NULL;
- }
-
- return (UINT8 *) ((UINTN) ImageContext->ImageAddress + Address);
-}
-
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderRelocateImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-/*++
-
-Routine Description:
-
- Relocates a PE/COFF image in memory
-
-Arguments:
-
- This - Calling context
-
- ImageContext - Contains information on the loaded image to relocate
-
-Returns:
-
- RETURN_SUCCESS if the PE/COFF image was relocated
- RETURN_LOAD_ERROR if the image is not a valid PE/COFF image
- RETURN_UNSUPPORTED not support
-
---*/
-{
- RETURN_STATUS Status;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *PeHdr;
- EFI_TE_IMAGE_HEADER *TeHdr;
- EFI_IMAGE_DATA_DIRECTORY *RelocDir;
- UINT64 Adjust;
- EFI_IMAGE_BASE_RELOCATION *RelocBase;
- EFI_IMAGE_BASE_RELOCATION *RelocBaseEnd;
- UINT16 *Reloc;
- UINT16 *RelocEnd;
- CHAR8 *Fixup;
- CHAR8 *FixupBase;
- UINT16 *F16;
- UINT32 *F32;
- CHAR8 *FixupData;
- PHYSICAL_ADDRESS BaseAddress;
- UINT16 MachineType;
- EFI_IMAGE_OPTIONAL_HEADER_POINTER OptionHeader;
-
- PeHdr = NULL;
- TeHdr = NULL;
- //
- // Assume success
- //
- ImageContext->ImageError = IMAGE_ERROR_SUCCESS;
-
- //
- // If there are no relocation entries, then we are done
- //
- if (ImageContext->RelocationsStripped) {
- return RETURN_SUCCESS;
- }
-
- //
- // Use DestinationAddress field of ImageContext as the relocation address even if it is 0.
- //
- BaseAddress = ImageContext->DestinationAddress;
-
- if (!(ImageContext->IsTeImage)) {
- PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)((UINTN)ImageContext->ImageAddress +
- ImageContext->PeCoffHeaderOffset);
- OptionHeader.Header = (VOID *) &(PeHdr->Pe32.OptionalHeader);
- if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- Adjust = (UINT64) BaseAddress - OptionHeader.Optional32->ImageBase;
- OptionHeader.Optional32->ImageBase = (UINT32) BaseAddress;
- MachineType = ImageContext->Machine;
- //
- // Find the relocation block
- //
- // Per the PE/COFF spec, you can't assume that a given data directory
- // is present in the image. You have to check the NumberOfRvaAndSizes in
- // the optional header to verify a desired directory entry is there.
- //
- if (OptionHeader.Optional32->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- RelocDir = &OptionHeader.Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- RelocBase = PeCoffLoaderImageAddress (ImageContext, RelocDir->VirtualAddress);
- RelocBaseEnd = PeCoffLoaderImageAddress (
- ImageContext,
- RelocDir->VirtualAddress + RelocDir->Size - 1
- );
- } else {
- //
- // Set base and end to bypass processing below.
- //
- RelocBase = RelocBaseEnd = 0;
- }
- } else {
- Adjust = (UINT64) BaseAddress - OptionHeader.Optional64->ImageBase;
- OptionHeader.Optional64->ImageBase = BaseAddress;
- MachineType = ImageContext->Machine;
- //
- // Find the relocation block
- //
- // Per the PE/COFF spec, you can't assume that a given data directory
- // is present in the image. You have to check the NumberOfRvaAndSizes in
- // the optional header to verify a desired directory entry is there.
- //
- if (OptionHeader.Optional64->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- RelocDir = &OptionHeader.Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- RelocBase = PeCoffLoaderImageAddress (ImageContext, RelocDir->VirtualAddress);
- RelocBaseEnd = PeCoffLoaderImageAddress (
- ImageContext,
- RelocDir->VirtualAddress + RelocDir->Size - 1
- );
- } else {
- //
- // Set base and end to bypass processing below.
- //
- RelocBase = RelocBaseEnd = 0;
- }
- }
- } else {
- TeHdr = (EFI_TE_IMAGE_HEADER *) (UINTN) (ImageContext->ImageAddress);
- Adjust = (UINT64) (BaseAddress - TeHdr->ImageBase);
- TeHdr->ImageBase = (UINT64) (BaseAddress);
- MachineType = TeHdr->Machine;
-
- //
- // Find the relocation block
- //
- RelocDir = &TeHdr->DataDirectory[0];
- RelocBase = (EFI_IMAGE_BASE_RELOCATION *)(UINTN)(
- ImageContext->ImageAddress +
- RelocDir->VirtualAddress +
- sizeof(EFI_TE_IMAGE_HEADER) -
- TeHdr->StrippedSize
- );
- RelocBaseEnd = (EFI_IMAGE_BASE_RELOCATION *) ((UINTN) RelocBase + (UINTN) RelocDir->Size - 1);
- }
-
- //
- // Run the relocation information and apply the fixups
- //
- FixupData = ImageContext->FixupData;
- while (RelocBase < RelocBaseEnd) {
-
- Reloc = (UINT16 *) ((CHAR8 *) RelocBase + sizeof (EFI_IMAGE_BASE_RELOCATION));
- RelocEnd = (UINT16 *) ((CHAR8 *) RelocBase + RelocBase->SizeOfBlock);
- if (!(ImageContext->IsTeImage)) {
- FixupBase = PeCoffLoaderImageAddress (ImageContext, RelocBase->VirtualAddress);
- } else {
- FixupBase = (CHAR8 *)(UINTN)(ImageContext->ImageAddress +
- RelocBase->VirtualAddress +
- sizeof(EFI_TE_IMAGE_HEADER) -
- TeHdr->StrippedSize
- );
- }
-
- if ((CHAR8 *) RelocEnd < (CHAR8 *) ((UINTN) ImageContext->ImageAddress) ||
- (CHAR8 *) RelocEnd > (CHAR8 *)((UINTN)ImageContext->ImageAddress +
- (UINTN)ImageContext->ImageSize)) {
- ImageContext->ImageError = IMAGE_ERROR_FAILED_RELOCATION;
- return RETURN_LOAD_ERROR;
- }
-
- //
- // Run this relocation record
- //
- while (Reloc < RelocEnd) {
-
- Fixup = FixupBase + (*Reloc & 0xFFF);
- switch ((*Reloc) >> 12) {
- case EFI_IMAGE_REL_BASED_ABSOLUTE:
- break;
-
- case EFI_IMAGE_REL_BASED_HIGH:
- F16 = (UINT16 *) Fixup;
- *F16 = (UINT16) (*F16 + ((UINT16) ((UINT32) Adjust >> 16)));
- if (FixupData != NULL) {
- *(UINT16 *) FixupData = *F16;
- FixupData = FixupData + sizeof (UINT16);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_LOW:
- F16 = (UINT16 *) Fixup;
- *F16 = (UINT16) (*F16 + (UINT16) Adjust);
- if (FixupData != NULL) {
- *(UINT16 *) FixupData = *F16;
- FixupData = FixupData + sizeof (UINT16);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_HIGHLOW:
- F32 = (UINT32 *) Fixup;
- *F32 = *F32 + (UINT32) Adjust;
- if (FixupData != NULL) {
- FixupData = ALIGN_POINTER (FixupData, sizeof (UINT32));
- *(UINT32 *) FixupData = *F32;
- FixupData = FixupData + sizeof (UINT32);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_HIGHADJ:
- //
- // Return the same EFI_UNSUPPORTED return code as
- // PeCoffLoaderRelocateImageEx() returns if it does not recognize
- // the relocation type.
- //
- ImageContext->ImageError = IMAGE_ERROR_FAILED_RELOCATION;
- return RETURN_UNSUPPORTED;
-
- default:
- switch (MachineType) {
- case EFI_IMAGE_MACHINE_IA32:
- Status = PeCoffLoaderRelocateIa32Image (Reloc, Fixup, &FixupData, Adjust);
- break;
- case EFI_IMAGE_MACHINE_ARMT:
- Status = PeCoffLoaderRelocateArmImage (&Reloc, Fixup, &FixupData, Adjust);
- break;
- case EFI_IMAGE_MACHINE_X64:
- Status = PeCoffLoaderRelocateX64Image (Reloc, Fixup, &FixupData, Adjust);
- break;
- case EFI_IMAGE_MACHINE_IA64:
- Status = PeCoffLoaderRelocateIpfImage (Reloc, Fixup, &FixupData, Adjust);
- break;
- case EFI_IMAGE_MACHINE_AARCH64:
- Status = PeCoffLoaderRelocateAArch64Image (Reloc, Fixup, &FixupData, Adjust);
- break;
- default:
- Status = RETURN_UNSUPPORTED;
- break;
- }
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_FAILED_RELOCATION;
- return Status;
- }
- }
-
- //
- // Next relocation record
- //
- Reloc += 1;
- }
-
- //
- // Next reloc block
- //
- RelocBase = (EFI_IMAGE_BASE_RELOCATION *) RelocEnd;
- }
-
- return RETURN_SUCCESS;
-}
-
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderLoadImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-/*++
-
-Routine Description:
-
- Loads a PE/COFF image into memory
-
-Arguments:
-
- This - Calling context
-
- ImageContext - Contains information on image to load into memory
-
-Returns:
-
- RETURN_SUCCESS if the PE/COFF image was loaded
- RETURN_BUFFER_TOO_SMALL if the caller did not provide a large enough buffer
- RETURN_LOAD_ERROR if the image is a runtime driver with no relocations
- RETURN_INVALID_PARAMETER if the image address is invalid
-
---*/
-{
- RETURN_STATUS Status;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *PeHdr;
- EFI_TE_IMAGE_HEADER *TeHdr;
- PE_COFF_LOADER_IMAGE_CONTEXT CheckContext;
- EFI_IMAGE_SECTION_HEADER *FirstSection;
- EFI_IMAGE_SECTION_HEADER *Section;
- UINTN NumberOfSections;
- UINTN Index;
- CHAR8 *Base;
- CHAR8 *End;
- CHAR8 *MaxEnd;
- EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
- UINTN Size;
- UINT32 TempDebugEntryRva;
- EFI_IMAGE_OPTIONAL_HEADER_POINTER OptionHeader;
-
- PeHdr = NULL;
- TeHdr = NULL;
- OptionHeader.Header = NULL;
- //
- // Assume success
- //
- ImageContext->ImageError = IMAGE_ERROR_SUCCESS;
-
- //
- // Copy the provided context info into our local version, get what we
- // can from the original image, and then use that to make sure everything
- // is legit.
- //
- CopyMem (&CheckContext, ImageContext, sizeof (PE_COFF_LOADER_IMAGE_CONTEXT));
-
- Status = PeCoffLoaderGetImageInfo (&CheckContext);
- if (RETURN_ERROR (Status)) {
- return Status;
- }
-
- //
- // Make sure there is enough allocated space for the image being loaded
- //
- if (ImageContext->ImageSize < CheckContext.ImageSize) {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_IMAGE_SIZE;
- return RETURN_BUFFER_TOO_SMALL;
- }
-
- //
- // If there's no relocations, then make sure it's not a runtime driver,
- // and that it's being loaded at the linked address.
- //
- if (CheckContext.RelocationsStripped) {
- //
- // If the image does not contain relocations and it is a runtime driver
- // then return an error.
- //
- if (CheckContext.ImageType == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_SUBSYSTEM;
- return RETURN_LOAD_ERROR;
- }
- //
- // If the image does not contain relocations, and the requested load address
- // is not the linked address, then return an error.
- //
- if (CheckContext.ImageAddress != ImageContext->ImageAddress) {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_IMAGE_ADDRESS;
- return RETURN_INVALID_PARAMETER;
- }
- }
- //
- // Make sure the allocated space has the proper section alignment
- //
- if (!(ImageContext->IsTeImage)) {
- if ((ImageContext->ImageAddress & (CheckContext.SectionAlignment - 1)) != 0) {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_SECTION_ALIGNMENT;
- return RETURN_INVALID_PARAMETER;
- }
- }
- //
- // Read the entire PE/COFF or TE header into memory
- //
- if (!(ImageContext->IsTeImage)) {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- 0,
- &ImageContext->SizeOfHeaders,
- (VOID *) (UINTN) ImageContext->ImageAddress
- );
-
- PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)
- ((UINTN)ImageContext->ImageAddress + ImageContext->PeCoffHeaderOffset);
-
- OptionHeader.Header = (VOID *) &(PeHdr->Pe32.OptionalHeader);
-
- FirstSection = (EFI_IMAGE_SECTION_HEADER *) (
- (UINTN)ImageContext->ImageAddress +
- ImageContext->PeCoffHeaderOffset +
- sizeof(UINT32) +
- sizeof(EFI_IMAGE_FILE_HEADER) +
- PeHdr->Pe32.FileHeader.SizeOfOptionalHeader
- );
- NumberOfSections = (UINTN) (PeHdr->Pe32.FileHeader.NumberOfSections);
- } else {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- 0,
- &ImageContext->SizeOfHeaders,
- (VOID *) (UINTN) ImageContext->ImageAddress
- );
-
- TeHdr = (EFI_TE_IMAGE_HEADER *) (UINTN) (ImageContext->ImageAddress);
-
- FirstSection = (EFI_IMAGE_SECTION_HEADER *) (
- (UINTN)ImageContext->ImageAddress +
- sizeof(EFI_TE_IMAGE_HEADER)
- );
- NumberOfSections = (UINTN) (TeHdr->NumberOfSections);
-
- }
-
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return RETURN_LOAD_ERROR;
- }
-
- //
- // Load each section of the image
- //
- Section = FirstSection;
- for (Index = 0, MaxEnd = NULL; Index < NumberOfSections; Index++) {
-
- //
- // Compute sections address
- //
- Base = PeCoffLoaderImageAddress (ImageContext, Section->VirtualAddress);
- End = PeCoffLoaderImageAddress (
- ImageContext,
- Section->VirtualAddress + Section->Misc.VirtualSize - 1
- );
-
- //
- // If the base start or end address resolved to 0, then fail.
- //
- if ((Base == NULL) || (End == NULL)) {
- ImageContext->ImageError = IMAGE_ERROR_SECTION_NOT_LOADED;
- return RETURN_LOAD_ERROR;
- }
-
-
- if (ImageContext->IsTeImage) {
- Base = (CHAR8 *) ((UINTN) Base + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize);
- End = (CHAR8 *) ((UINTN) End + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize);
- }
-
- if (End > MaxEnd) {
- MaxEnd = End;
- }
-
- //
- // Read the section
- //
- Size = (UINTN) Section->Misc.VirtualSize;
- if ((Size == 0) || (Size > Section->SizeOfRawData)) {
- Size = (UINTN) Section->SizeOfRawData;
- }
-
- if (Section->SizeOfRawData) {
- if (!(ImageContext->IsTeImage)) {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- Section->PointerToRawData,
- &Size,
- Base
- );
- } else {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- Section->PointerToRawData + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize,
- &Size,
- Base
- );
- }
-
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
- }
-
- //
- // If raw size is less then virt size, zero fill the remaining
- //
-
- if (Size < Section->Misc.VirtualSize) {
- ZeroMem (Base + Size, Section->Misc.VirtualSize - Size);
- }
-
- //
- // Next Section
- //
- Section += 1;
- }
-
- //
- // Get image's entry point
- //
- if (!(ImageContext->IsTeImage)) {
- ImageContext->EntryPoint = (PHYSICAL_ADDRESS) (UINTN) PeCoffLoaderImageAddress (
- ImageContext,
- PeHdr->Pe32.OptionalHeader.AddressOfEntryPoint
- );
- } else {
- ImageContext->EntryPoint = (PHYSICAL_ADDRESS) (
- (UINTN)ImageContext->ImageAddress +
- (UINTN)TeHdr->AddressOfEntryPoint +
- (UINTN)sizeof(EFI_TE_IMAGE_HEADER) -
- (UINTN) TeHdr->StrippedSize
- );
- }
-
- //
- // Determine the size of the fixup data
- //
- // Per the PE/COFF spec, you can't assume that a given data directory
- // is present in the image. You have to check the NumberOfRvaAndSizes in
- // the optional header to verify a desired directory entry is there.
- //
- if (!(ImageContext->IsTeImage)) {
- if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- if (OptionHeader.Optional32->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)
- &OptionHeader.Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- ImageContext->FixupDataSize = DirectoryEntry->Size / sizeof (UINT16) * sizeof (UINTN);
- } else {
- ImageContext->FixupDataSize = 0;
- }
- } else {
- if (OptionHeader.Optional64->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)
- &OptionHeader.Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- ImageContext->FixupDataSize = DirectoryEntry->Size / sizeof (UINT16) * sizeof (UINTN);
- } else {
- ImageContext->FixupDataSize = 0;
- }
- }
- } else {
- DirectoryEntry = &TeHdr->DataDirectory[0];
- ImageContext->FixupDataSize = DirectoryEntry->Size / sizeof (UINT16) * sizeof (UINTN);
- }
- //
- // Consumer must allocate a buffer for the relocation fixup log.
- // Only used for runtime drivers.
- //
- ImageContext->FixupData = NULL;
-
- //
- // Load the Codeview info if present
- //
- if (ImageContext->DebugDirectoryEntryRva != 0) {
- if (!(ImageContext->IsTeImage)) {
- DebugEntry = PeCoffLoaderImageAddress (
- ImageContext,
- ImageContext->DebugDirectoryEntryRva
- );
- } else {
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)(UINTN)(
- ImageContext->ImageAddress +
- ImageContext->DebugDirectoryEntryRva +
- sizeof(EFI_TE_IMAGE_HEADER) -
- TeHdr->StrippedSize
- );
- }
-
- if (DebugEntry != NULL) {
- TempDebugEntryRva = DebugEntry->RVA;
- if (DebugEntry->RVA == 0 && DebugEntry->FileOffset != 0) {
- Section--;
- if ((UINTN) Section->SizeOfRawData < Section->Misc.VirtualSize) {
- TempDebugEntryRva = Section->VirtualAddress + Section->Misc.VirtualSize;
- } else {
- TempDebugEntryRva = Section->VirtualAddress + Section->SizeOfRawData;
- }
- }
-
- if (TempDebugEntryRva != 0) {
- if (!(ImageContext->IsTeImage)) {
- ImageContext->CodeView = PeCoffLoaderImageAddress (ImageContext, TempDebugEntryRva);
- } else {
- ImageContext->CodeView = (VOID *)(
- (UINTN)ImageContext->ImageAddress +
- (UINTN)TempDebugEntryRva +
- (UINTN)sizeof(EFI_TE_IMAGE_HEADER) -
- (UINTN) TeHdr->StrippedSize
- );
- }
-
- if (ImageContext->CodeView == NULL) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return RETURN_LOAD_ERROR;
- }
-
- if (DebugEntry->RVA == 0) {
- Size = DebugEntry->SizeOfData;
- if (!(ImageContext->IsTeImage)) {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugEntry->FileOffset,
- &Size,
- ImageContext->CodeView
- );
- } else {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugEntry->FileOffset + sizeof (EFI_TE_IMAGE_HEADER) - TeHdr->StrippedSize,
- &Size,
- ImageContext->CodeView
- );
- //
- // Should we apply fix up to this field according to the size difference between PE and TE?
- // Because now we maintain TE header fields unfixed, this field will also remain as they are
- // in original PE image.
- //
- }
-
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return RETURN_LOAD_ERROR;
- }
-
- DebugEntry->RVA = TempDebugEntryRva;
- }
-
- switch (*(UINT32 *) ImageContext->CodeView) {
- case CODEVIEW_SIGNATURE_NB10:
- ImageContext->PdbPointer = (CHAR8 *) ImageContext->CodeView + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY);
- break;
-
- case CODEVIEW_SIGNATURE_RSDS:
- ImageContext->PdbPointer = (CHAR8 *) ImageContext->CodeView + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY);
- break;
-
- case CODEVIEW_SIGNATURE_MTOC:
- ImageContext->PdbPointer = (CHAR8 *) ImageContext->CodeView + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY);
-
- default:
- break;
- }
- }
- }
- }
-
- return Status;
-}
-
-/**
- Returns a pointer to the PDB file name for a raw PE/COFF image that is not
- loaded into system memory with the PE/COFF Loader Library functions.
-
- Returns the PDB file name for the PE/COFF image specified by Pe32Data. If
- the PE/COFF image specified by Pe32Data is not a valid, then NULL is
- returned. If the PE/COFF image specified by Pe32Data does not contain a
- debug directory entry, then NULL is returned. If the debug directory entry
- in the PE/COFF image specified by Pe32Data does not contain a PDB file name,
- then NULL is returned.
- If Pe32Data is NULL, then return NULL.
-
- @param Pe32Data Pointer to the PE/COFF image that is loaded in system
- memory.
-
- @return The PDB file name for the PE/COFF image specified by Pe32Data or NULL
- if it cannot be retrieved.
-
-**/
-VOID *
-EFIAPI
-PeCoffLoaderGetPdbPointer (
- IN VOID *Pe32Data
- )
-{
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
- UINTN DirCount;
- VOID *CodeViewEntryPointer;
- INTN TEImageAdjust;
- UINT32 NumberOfRvaAndSizes;
- UINT16 Magic;
- EFI_IMAGE_SECTION_HEADER *SectionHeader;
- UINT32 Index, Index1;
-
- if (Pe32Data == NULL) {
- return NULL;
- }
-
- TEImageAdjust = 0;
- DirectoryEntry = NULL;
- DebugEntry = NULL;
- NumberOfRvaAndSizes = 0;
- Index = 0;
- Index1 = 0;
- SectionHeader = NULL;
-
- DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
- if (EFI_IMAGE_DOS_SIGNATURE == DosHdr->e_magic) {
- //
- // DOS image header is present, so read the PE header after the DOS image header.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));
- } else {
- //
- // DOS image header is not present, so PE header is at the image base.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
- }
-
- if (EFI_TE_IMAGE_HEADER_SIGNATURE == Hdr.Te->Signature) {
- if (Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {
- DirectoryEntry = &Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];
- TEImageAdjust = sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize;
-
- //
- // Get the DebugEntry offset in the raw data image.
- //
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (Hdr.Te + 1);
- Index = Hdr.Te->NumberOfSections;
- for (Index1 = 0; Index1 < Index; Index1 ++) {
- if ((DirectoryEntry->VirtualAddress >= SectionHeader[Index1].VirtualAddress) &&
- (DirectoryEntry->VirtualAddress < (SectionHeader[Index1].VirtualAddress + SectionHeader[Index1].Misc.VirtualSize))) {
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)((UINTN) Hdr.Te +
- DirectoryEntry->VirtualAddress -
- SectionHeader [Index1].VirtualAddress +
- SectionHeader [Index1].PointerToRawData +
- TEImageAdjust);
- break;
- }
- }
- }
- } else if (EFI_IMAGE_NT_SIGNATURE == Hdr.Pe32->Signature) {
- //
- // NOTE: We use Machine field to identify PE32/PE32+, instead of Magic.
- // It is due to backward-compatibility, for some system might
- // generate PE32+ image with PE32 Magic.
- //
- switch (Hdr.Pe32->FileHeader.Machine) {
- case EFI_IMAGE_MACHINE_IA32:
- case EFI_IMAGE_MACHINE_ARMT:
- //
- // Assume PE32 image with IA32 Machine field.
- //
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- break;
- case EFI_IMAGE_MACHINE_X64:
- case EFI_IMAGE_MACHINE_IPF:
- //
- // Assume PE32+ image with X64 or IPF Machine field
- //
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- break;
- default:
- //
- // For unknow Machine field, use Magic in optional Header
- //
- Magic = Hdr.Pe32->OptionalHeader.Magic;
- }
-
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (
- (UINT8 *) Hdr.Pe32 +
- sizeof (UINT32) +
- sizeof (EFI_IMAGE_FILE_HEADER) +
- Hdr.Pe32->FileHeader.SizeOfOptionalHeader
- );
- Index = Hdr.Pe32->FileHeader.NumberOfSections;
-
- if (EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC == Magic) {
- //
- // Use PE32 offset get Debug Directory Entry
- //
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- } else if (Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- //
- // Use PE32+ offset get Debug Directory Entry
- //
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- }
-
- if (NumberOfRvaAndSizes <= EFI_IMAGE_DIRECTORY_ENTRY_DEBUG || DirectoryEntry->VirtualAddress == 0) {
- DirectoryEntry = NULL;
- DebugEntry = NULL;
- } else {
- //
- // Get the DebugEntry offset in the raw data image.
- //
- for (Index1 = 0; Index1 < Index; Index1 ++) {
- if ((DirectoryEntry->VirtualAddress >= SectionHeader[Index1].VirtualAddress) &&
- (DirectoryEntry->VirtualAddress < (SectionHeader[Index1].VirtualAddress + SectionHeader[Index1].Misc.VirtualSize))) {
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) (
- (UINTN) Pe32Data +
- DirectoryEntry->VirtualAddress -
- SectionHeader[Index1].VirtualAddress +
- SectionHeader[Index1].PointerToRawData);
- break;
- }
- }
- }
- } else {
- return NULL;
- }
-
- if (NULL == DebugEntry || NULL == DirectoryEntry) {
- return NULL;
- }
-
- //
- // Scan the directory to find the debug entry.
- //
- for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY), DebugEntry++) {
- if (EFI_IMAGE_DEBUG_TYPE_CODEVIEW == DebugEntry->Type) {
- if (DebugEntry->SizeOfData > 0) {
- //
- // Get the DebugEntry offset in the raw data image.
- //
- CodeViewEntryPointer = NULL;
- for (Index1 = 0; Index1 < Index; Index1 ++) {
- if ((DebugEntry->RVA >= SectionHeader[Index1].VirtualAddress) &&
- (DebugEntry->RVA < (SectionHeader[Index1].VirtualAddress + SectionHeader[Index1].Misc.VirtualSize))) {
- CodeViewEntryPointer = (VOID *) (
- ((UINTN)Pe32Data) +
- (UINTN) DebugEntry->RVA -
- SectionHeader[Index1].VirtualAddress +
- SectionHeader[Index1].PointerToRawData +
- (UINTN)TEImageAdjust);
- break;
- }
- }
- if (Index1 >= Index) {
- //
- // Can't find CodeViewEntryPointer in raw PE/COFF image.
- //
- continue;
- }
- switch (* (UINT32 *) CodeViewEntryPointer) {
- case CODEVIEW_SIGNATURE_NB10:
- return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY));
- case CODEVIEW_SIGNATURE_RSDS:
- return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY));
- case CODEVIEW_SIGNATURE_MTOC:
- return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY));
- default:
- break;
- }
- }
- }
- }
-
- return NULL;
-}
-
-
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderGetEntryPoint (
- IN VOID *Pe32Data,
- OUT VOID **EntryPoint,
- OUT VOID **BaseOfImage
- )
-{
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
-
- DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
- if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image header.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));
- } else {
- //
- // DOS image header is not present, so PE header is at the image base.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
- }
-
- //
- // Calculate the entry point relative to the start of the image.
- // AddressOfEntryPoint is common for PE32 & PE32+
- //
- if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- *BaseOfImage = (VOID *)(UINTN)(Hdr.Te->ImageBase + Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER));
- *EntryPoint = (VOID *)((UINTN)*BaseOfImage + (Hdr.Te->AddressOfEntryPoint & 0x0ffffffff) + sizeof(EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize);
- return RETURN_SUCCESS;
- } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
- *EntryPoint = (VOID *)(UINTN)Hdr.Pe32->OptionalHeader.AddressOfEntryPoint;
- if (Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- *BaseOfImage = (VOID *)(UINTN)Hdr.Pe32->OptionalHeader.ImageBase;
- } else {
- *BaseOfImage = (VOID *)(UINTN)Hdr.Pe32Plus->OptionalHeader.ImageBase;
- }
- *EntryPoint = (VOID *)(UINTN)((UINTN)*EntryPoint + (UINTN)*BaseOfImage);
- return RETURN_SUCCESS;
- }
-
- return RETURN_UNSUPPORTED;
-}
diff --git a/BaseTools/Source/C/Common/BinderFuncs.c b/BaseTools/Source/C/Common/BinderFuncs.c
deleted file mode 100644
index 5ee55480bd..0000000000
--- a/BaseTools/Source/C/Common/BinderFuncs.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/** @file
-
-Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- BinderFuncs.c
-
-Abstract:
-
- Binder function implementations for ANSI C libraries.
-
-**/
-
-#include "BinderFuncs.h"
-#include "CommonLib.h"
-#include <stdlib.h>
-#include <string.h>
-
-//
-// Binder Function Implementations
-//
-
-VOID *
-CommonLibBinderAllocate (
- IN UINTN Size
- )
-{
- return (VOID *) malloc (Size);
-}
-
-VOID
-CommonLibBinderFree (
- IN VOID *Pointer
- )
-{
- free (Pointer);
-}
-
-VOID
-CommonLibBinderCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-{
- memmove (Destination, Source, Length);
-}
-
-VOID
-CommonLibBinderSetMem (
- IN VOID *Destination,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- memset (Destination, Value, Length);
-}
-
-INTN
-CommonLibBinderCompareMem (
- IN VOID *MemOne,
- IN VOID *MemTwo,
- IN UINTN Length
- )
-{
- return memcmp (MemOne, MemTwo, Length);
-}
-
-BOOLEAN
-CommonLibBinderCompareGuid (
- IN EFI_GUID *Guid1,
- IN EFI_GUID *Guid2
- )
-{
- return CompareGuid (Guid1, Guid2) ? FALSE : TRUE;
-}
-
-
-
diff --git a/BaseTools/Source/C/Common/BinderFuncs.h b/BaseTools/Source/C/Common/BinderFuncs.h
deleted file mode 100644
index 48dc82eb70..0000000000
--- a/BaseTools/Source/C/Common/BinderFuncs.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/** @file
-
-Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- BinderFuncs.h
-
-Abstract:
-
- Prototypes for binder functions that allow common code to be
- written which then links to implementation of these functions
- which is appropriate for the specific environment that they
- are running under.
-
-**/
-
-#ifndef BinderFuncs_h_INCLUDED
-#define BinderFuncs_h_INCLUDED
-
-#include "Common/UefiBaseTypes.h"
-
-//
-// Binder Function Prototypes
-//
-// These binding functions must be implemented externally as appropriate for
-// the environment that the code will be running under.
-//
-
-VOID *
-CommonLibBinderAllocate (
- IN UINTN Size
- );
-
-VOID
-CommonLibBinderFree (
- IN VOID *Pointer
- );
-
-VOID
-CommonLibBinderCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- );
-
-VOID
-CommonLibBinderSetMem (
- IN VOID *Destination,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-INTN
-CommonLibBinderCompareMem (
- IN VOID *MemOne,
- IN VOID *MemTwo,
- IN UINTN Length
- );
-
-BOOLEAN
-CommonLibBinderCompareGuid (
- IN EFI_GUID *Guid1,
- IN EFI_GUID *Guid2
- );
-
-#endif // #ifndef CommonLibs_h_INCLUDED
-
diff --git a/BaseTools/Source/C/Common/CommonLib.c b/BaseTools/Source/C/Common/CommonLib.c
deleted file mode 100644
index cb72e2723f..0000000000
--- a/BaseTools/Source/C/Common/CommonLib.c
+++ /dev/null
@@ -1,584 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- CommonLib.c
-
-Abstract:
-
- Common basic Library Functions
-
-**/
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include "CommonLib.h"
-#include "EfiUtilityMsgs.h"
-
-VOID
-PeiZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description:
-
- Set Buffer to zero for Size bytes.
-
-Arguments:
-
- Buffer - Memory to set.
-
- Size - Number of bytes to set
-
-Returns:
-
- None
-
---*/
-{
- INT8 *Ptr;
-
- Ptr = Buffer;
- while (Size--) {
- *(Ptr++) = 0;
- }
-}
-
-VOID
-PeiCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-{
- CHAR8 *Destination8;
- CHAR8 *Source8;
-
- Destination8 = Destination;
- Source8 = Source;
- while (Length--) {
- *(Destination8++) = *(Source8++);
- }
-}
-
-VOID
-ZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-{
- PeiZeroMem (Buffer, Size);
-}
-
-VOID
-CopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-{
- PeiCopyMem (Destination, Source, Length);
-}
-
-INTN
-CompareGuid (
- IN EFI_GUID *Guid1,
- IN EFI_GUID *Guid2
- )
-/*++
-
-Routine Description:
-
- Compares to GUIDs
-
-Arguments:
-
- Guid1 - guid to compare
- Guid2 - guid to compare
-
-Returns:
- = 0 if Guid1 == Guid2
- != 0 if Guid1 != Guid2
-
---*/
-{
- INT32 *g1;
- INT32 *g2;
- INT32 r;
-
- //
- // Compare 32 bits at a time
- //
- g1 = (INT32 *) Guid1;
- g2 = (INT32 *) Guid2;
-
- r = g1[0] - g2[0];
- r |= g1[1] - g2[1];
- r |= g1[2] - g2[2];
- r |= g1[3] - g2[3];
-
- return r;
-}
-
-
-EFI_STATUS
-GetFileImage (
- IN CHAR8 *InputFileName,
- OUT CHAR8 **InputFileImage,
- OUT UINT32 *BytesRead
- )
-/*++
-
-Routine Description:
-
- This function opens a file and reads it into a memory buffer. The function
- will allocate the memory buffer and returns the size of the buffer.
-
-Arguments:
-
- InputFileName The name of the file to read.
- InputFileImage A pointer to the memory buffer.
- BytesRead The size of the memory buffer.
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_INVALID_PARAMETER One of the input parameters was invalid.
- EFI_ABORTED An error occurred.
- EFI_OUT_OF_RESOURCES No resource to complete operations.
-
---*/
-{
- FILE *InputFile;
- UINT32 FileSize;
-
- //
- // Verify input parameters.
- //
- if (InputFileName == NULL || strlen (InputFileName) == 0 || InputFileImage == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Open the file and copy contents into a memory buffer.
- //
- //
- // Open the file
- //
- InputFile = fopen (InputFileName, "rb");
- if (InputFile == NULL) {
- Error (NULL, 0, 0001, "Error opening the input file", InputFileName);
- return EFI_ABORTED;
- }
- //
- // Go to the end so that we can determine the file size
- //
- if (fseek (InputFile, 0, SEEK_END)) {
- Error (NULL, 0, 0004, "Error reading the input file", InputFileName);
- fclose (InputFile);
- return EFI_ABORTED;
- }
- //
- // Get the file size
- //
- FileSize = ftell (InputFile);
- if (FileSize == -1) {
- Error (NULL, 0, 0003, "Error parsing the input file", InputFileName);
- fclose (InputFile);
- return EFI_ABORTED;
- }
- //
- // Allocate a buffer
- //
- *InputFileImage = malloc (FileSize);
- if (*InputFileImage == NULL) {
- fclose (InputFile);
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // Reset to the beginning of the file
- //
- if (fseek (InputFile, 0, SEEK_SET)) {
- Error (NULL, 0, 0004, "Error reading the input file", InputFileName);
- fclose (InputFile);
- free (*InputFileImage);
- *InputFileImage = NULL;
- return EFI_ABORTED;
- }
- //
- // Read all of the file contents.
- //
- *BytesRead = fread (*InputFileImage, sizeof (UINT8), FileSize, InputFile);
- if (*BytesRead != sizeof (UINT8) * FileSize) {
- Error (NULL, 0, 0004, "Error reading the input file", InputFileName);
- fclose (InputFile);
- free (*InputFileImage);
- *InputFileImage = NULL;
- return EFI_ABORTED;
- }
- //
- // Close the file
- //
- fclose (InputFile);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-PutFileImage (
- IN CHAR8 *OutputFileName,
- IN CHAR8 *OutputFileImage,
- IN UINT32 BytesToWrite
- )
-/*++
-
-Routine Description:
-
- This function opens a file and writes OutputFileImage into the file.
-
-Arguments:
-
- OutputFileName The name of the file to write.
- OutputFileImage A pointer to the memory buffer.
- BytesToWrite The size of the memory buffer.
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_INVALID_PARAMETER One of the input parameters was invalid.
- EFI_ABORTED An error occurred.
- EFI_OUT_OF_RESOURCES No resource to complete operations.
-
---*/
-{
- FILE *OutputFile;
- UINT32 BytesWrote;
-
- //
- // Verify input parameters.
- //
- if (OutputFileName == NULL || strlen (OutputFileName) == 0 || OutputFileImage == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Open the file and copy contents into a memory buffer.
- //
- //
- // Open the file
- //
- OutputFile = fopen (OutputFileName, "wb");
- if (OutputFile == NULL) {
- Error (NULL, 0, 0001, "Error opening the output file", OutputFileName);
- return EFI_ABORTED;
- }
-
- //
- // Write all of the file contents.
- //
- BytesWrote = fwrite (OutputFileImage, sizeof (UINT8), BytesToWrite, OutputFile);
- if (BytesWrote != sizeof (UINT8) * BytesToWrite) {
- Error (NULL, 0, 0002, "Error writing the output file", OutputFileName);
- fclose (OutputFile);
- return EFI_ABORTED;
- }
- //
- // Close the file
- //
- fclose (OutputFile);
-
- return EFI_SUCCESS;
-}
-
-UINT8
-CalculateChecksum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description:
-
- This function calculates the value needed for a valid UINT8 checksum
-
-Arguments:
-
- Buffer Pointer to buffer containing byte data of component.
- Size Size of the buffer
-
-Returns:
-
- The 8 bit checksum value needed.
-
---*/
-{
- return (UINT8) (0x100 - CalculateSum8 (Buffer, Size));
-}
-
-UINT8
-CalculateSum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description::
-
- This function calculates the UINT8 sum for the requested region.
-
-Arguments:
-
- Buffer Pointer to buffer containing byte data of component.
- Size Size of the buffer
-
-Returns:
-
- The 8 bit checksum value needed.
-
---*/
-{
- UINTN Index;
- UINT8 Sum;
-
- Sum = 0;
-
- //
- // Perform the byte sum for buffer
- //
- for (Index = 0; Index < Size; Index++) {
- Sum = (UINT8) (Sum + Buffer[Index]);
- }
-
- return Sum;
-}
-
-UINT16
-CalculateChecksum16 (
- IN UINT16 *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description::
-
- This function calculates the value needed for a valid UINT16 checksum
-
-Arguments:
-
- Buffer Pointer to buffer containing byte data of component.
- Size Size of the buffer
-
-Returns:
-
- The 16 bit checksum value needed.
-
---*/
-{
- return (UINT16) (0x10000 - CalculateSum16 (Buffer, Size));
-}
-
-UINT16
-CalculateSum16 (
- IN UINT16 *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description:
-
- This function calculates the UINT16 sum for the requested region.
-
-Arguments:
-
- Buffer Pointer to buffer containing byte data of component.
- Size Size of the buffer
-
-Returns:
-
- The 16 bit checksum
-
---*/
-{
- UINTN Index;
- UINT16 Sum;
-
- Sum = 0;
-
- //
- // Perform the word sum for buffer
- //
- for (Index = 0; Index < Size; Index++) {
- Sum = (UINT16) (Sum + Buffer[Index]);
- }
-
- return (UINT16) Sum;
-}
-
-EFI_STATUS
-PrintGuid (
- IN EFI_GUID *Guid
- )
-/*++
-
-Routine Description:
-
- This function prints a GUID to STDOUT.
-
-Arguments:
-
- Guid Pointer to a GUID to print.
-
-Returns:
-
- EFI_SUCCESS The GUID was printed.
- EFI_INVALID_PARAMETER The input was NULL.
-
---*/
-{
- if (Guid == NULL) {
- Error (NULL, 0, 2000, "Invalid parameter", "PrintGuidToBuffer() called with a NULL value");
- return EFI_INVALID_PARAMETER;
- }
-
- printf (
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
- (unsigned) Guid->Data1,
- Guid->Data2,
- Guid->Data3,
- Guid->Data4[0],
- Guid->Data4[1],
- Guid->Data4[2],
- Guid->Data4[3],
- Guid->Data4[4],
- Guid->Data4[5],
- Guid->Data4[6],
- Guid->Data4[7]
- );
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-PrintGuidToBuffer (
- IN EFI_GUID *Guid,
- IN OUT UINT8 *Buffer,
- IN UINT32 BufferLen,
- IN BOOLEAN Uppercase
- )
-/*++
-
-Routine Description:
-
- This function prints a GUID to a buffer
-
-Arguments:
-
- Guid - Pointer to a GUID to print.
- Buffer - Pointer to a user-provided buffer to print to
- BufferLen - Size of the Buffer
- Uppercase - If use upper case.
-
-Returns:
-
- EFI_SUCCESS The GUID was printed.
- EFI_INVALID_PARAMETER The input was NULL.
- EFI_BUFFER_TOO_SMALL The input buffer was not big enough
-
---*/
-{
- if (Guid == NULL) {
- Error (NULL, 0, 2000, "Invalid parameter", "PrintGuidToBuffer() called with a NULL value");
- return EFI_INVALID_PARAMETER;
- }
-
- if (BufferLen < PRINTED_GUID_BUFFER_SIZE) {
- Error (NULL, 0, 2000, "Invalid parameter", "PrintGuidToBuffer() called with invalid buffer size");
- return EFI_BUFFER_TOO_SMALL;
- }
-
- if (Uppercase) {
- sprintf (
- (CHAR8 *)Buffer,
- "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
- (unsigned) Guid->Data1,
- Guid->Data2,
- Guid->Data3,
- Guid->Data4[0],
- Guid->Data4[1],
- Guid->Data4[2],
- Guid->Data4[3],
- Guid->Data4[4],
- Guid->Data4[5],
- Guid->Data4[6],
- Guid->Data4[7]
- );
- } else {
- sprintf (
- (CHAR8 *)Buffer,
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- (unsigned) Guid->Data1,
- Guid->Data2,
- Guid->Data3,
- Guid->Data4[0],
- Guid->Data4[1],
- Guid->Data4[2],
- Guid->Data4[3],
- Guid->Data4[4],
- Guid->Data4[5],
- Guid->Data4[6],
- Guid->Data4[7]
- );
- }
-
- return EFI_SUCCESS;
-}
-
-#ifdef __GNUC__
-
-size_t _filelength(int fd)
-{
- struct stat stat_buf;
- fstat(fd, &stat_buf);
- return stat_buf.st_size;
-}
-
-#ifndef __CYGWIN__
-char *strlwr(char *s)
-{
- char *p = s;
- for(;*s;s++) {
- *s = tolower(*s);
- }
- return p;
-}
-#endif
-#endif
diff --git a/BaseTools/Source/C/Common/CommonLib.h b/BaseTools/Source/C/Common/CommonLib.h
deleted file mode 100644
index 0610b21ed0..0000000000
--- a/BaseTools/Source/C/Common/CommonLib.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- CommonLib.h
-
-Abstract:
-
- Common library assistance routines.
-
-**/
-
-#ifndef _EFI_COMMON_LIB_H
-#define _EFI_COMMON_LIB_H
-
-#include <Common/UefiBaseTypes.h>
-#include <Common/BuildVersion.h>
-#define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination
-//
-// Function declarations
-//
-VOID
-PeiZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-;
-
-VOID
-PeiCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-;
-
-VOID
-ZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-;
-
-VOID
-CopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-;
-
-INTN
-CompareGuid (
- IN EFI_GUID *Guid1,
- IN EFI_GUID *Guid2
- )
-;
-
-EFI_STATUS
-GetFileImage (
- IN CHAR8 *InputFileName,
- OUT CHAR8 **InputFileImage,
- OUT UINT32 *BytesRead
- )
-;
-
-EFI_STATUS
-PutFileImage (
- IN CHAR8 *OutputFileName,
- IN CHAR8 *OutputFileImage,
- IN UINT32 BytesToWrite
- )
-;
-/*++
-
-Routine Description:
-
- This function opens a file and writes OutputFileImage into the file.
-
-Arguments:
-
- OutputFileName The name of the file to write.
- OutputFileImage A pointer to the memory buffer.
- BytesToWrite The size of the memory buffer.
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_INVALID_PARAMETER One of the input parameters was invalid.
- EFI_ABORTED An error occurred.
- EFI_OUT_OF_RESOURCES No resource to complete operations.
-
-**/
-
-UINT8
-CalculateChecksum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-;
-
-UINT8
-CalculateSum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-;
-
-UINT16
-CalculateChecksum16 (
- IN UINT16 *Buffer,
- IN UINTN Size
- )
-;
-
-UINT16
-CalculateSum16 (
- IN UINT16 *Buffer,
- IN UINTN Size
- )
-;
-
-EFI_STATUS
-PrintGuid (
- IN EFI_GUID *Guid
- )
-;
-
-#define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination
-EFI_STATUS
-PrintGuidToBuffer (
- IN EFI_GUID *Guid,
- IN OUT UINT8 *Buffer,
- IN UINT32 BufferLen,
- IN BOOLEAN Uppercase
- )
-;
-
-#define ASSERT(x) assert(x)
-
-#ifdef __GNUC__
-#include <stdio.h>
-#include <sys/stat.h>
-#define stricmp strcasecmp
-#define _stricmp strcasecmp
-#define strnicmp strncasecmp
-#define strcmpi strcasecmp
-size_t _filelength(int fd);
-#ifndef __CYGWIN__
-char *strlwr(char *s);
-#endif
-#endif
-
-//
-// On windows, mkdir only has one parameter.
-// On unix, it has two parameters
-//
-#if defined(__GNUC__)
-#define mkdir(dir, perm) mkdir(dir, perm)
-#else
-#define mkdir(dir, perm) mkdir(dir)
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/Common/Compress.h b/BaseTools/Source/C/Common/Compress.h
deleted file mode 100644
index 11245b1178..0000000000
--- a/BaseTools/Source/C/Common/Compress.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- Compress.h
-
-Abstract:
-
- Header file for compression routine.
- Providing both EFI and Tiano Compress algorithms.
-
-**/
-
-#ifndef _COMPRESS_H_
-#define _COMPRESS_H_
-
-#include <string.h>
-#include <stdlib.h>
-
-#include "CommonLib.h"
-#include <Common/UefiBaseTypes.h>
-/*++
-
-Routine Description:
-
- Tiano compression routine.
-
---*/
-EFI_STATUS
-TianoCompress (
- IN UINT8 *SrcBuffer,
- IN UINT32 SrcSize,
- IN UINT8 *DstBuffer,
- IN OUT UINT32 *DstSize
- )
-;
-
-/*++
-
-Routine Description:
-
- Efi compression routine.
-
---*/
-EFI_STATUS
-EfiCompress (
- IN UINT8 *SrcBuffer,
- IN UINT32 SrcSize,
- IN UINT8 *DstBuffer,
- IN OUT UINT32 *DstSize
- )
-;
-
-/*++
-
-Routine Description:
-
- The compression routine.
-
-Arguments:
-
- SrcBuffer - The buffer storing the source data
- SrcSize - The size of source data
- DstBuffer - The buffer to store the compressed data
- DstSize - On input, the size of DstBuffer; On output,
- the size of the actual compressed data.
-
-Returns:
-
- EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. In this case,
- DstSize contains the size needed.
- EFI_SUCCESS - Compression is successful.
- EFI_OUT_OF_RESOURCES - No resource to complete function.
- EFI_INVALID_PARAMETER - Parameter supplied is wrong.
-
---*/
-typedef
-EFI_STATUS
-(*COMPRESS_FUNCTION) (
- IN UINT8 *SrcBuffer,
- IN UINT32 SrcSize,
- IN UINT8 *DstBuffer,
- IN OUT UINT32 *DstSize
- );
-
-#endif
diff --git a/BaseTools/Source/C/Common/Crc32.c b/BaseTools/Source/C/Common/Crc32.c
deleted file mode 100644
index 8e5915dd0e..0000000000
--- a/BaseTools/Source/C/Common/Crc32.c
+++ /dev/null
@@ -1,326 +0,0 @@
-/** @file
-
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- crc32.c
-
-Abstract:
-
- CalcuateCrc32 routine.
-
-**/
-
-#include <stdlib.h>
-#include "Crc32.h"
-
-UINT32 mCrcTable[256] = {
- 0x00000000,
- 0x77073096,
- 0xEE0E612C,
- 0x990951BA,
- 0x076DC419,
- 0x706AF48F,
- 0xE963A535,
- 0x9E6495A3,
- 0x0EDB8832,
- 0x79DCB8A4,
- 0xE0D5E91E,
- 0x97D2D988,
- 0x09B64C2B,
- 0x7EB17CBD,
- 0xE7B82D07,
- 0x90BF1D91,
- 0x1DB71064,
- 0x6AB020F2,
- 0xF3B97148,
- 0x84BE41DE,
- 0x1ADAD47D,
- 0x6DDDE4EB,
- 0xF4D4B551,
- 0x83D385C7,
- 0x136C9856,
- 0x646BA8C0,
- 0xFD62F97A,
- 0x8A65C9EC,
- 0x14015C4F,
- 0x63066CD9,
- 0xFA0F3D63,
- 0x8D080DF5,
- 0x3B6E20C8,
- 0x4C69105E,
- 0xD56041E4,
- 0xA2677172,
- 0x3C03E4D1,
- 0x4B04D447,
- 0xD20D85FD,
- 0xA50AB56B,
- 0x35B5A8FA,
- 0x42B2986C,
- 0xDBBBC9D6,
- 0xACBCF940,
- 0x32D86CE3,
- 0x45DF5C75,
- 0xDCD60DCF,
- 0xABD13D59,
- 0x26D930AC,
- 0x51DE003A,
- 0xC8D75180,
- 0xBFD06116,
- 0x21B4F4B5,
- 0x56B3C423,
- 0xCFBA9599,
- 0xB8BDA50F,
- 0x2802B89E,
- 0x5F058808,
- 0xC60CD9B2,
- 0xB10BE924,
- 0x2F6F7C87,
- 0x58684C11,
- 0xC1611DAB,
- 0xB6662D3D,
- 0x76DC4190,
- 0x01DB7106,
- 0x98D220BC,
- 0xEFD5102A,
- 0x71B18589,
- 0x06B6B51F,
- 0x9FBFE4A5,
- 0xE8B8D433,
- 0x7807C9A2,
- 0x0F00F934,
- 0x9609A88E,
- 0xE10E9818,
- 0x7F6A0DBB,
- 0x086D3D2D,
- 0x91646C97,
- 0xE6635C01,
- 0x6B6B51F4,
- 0x1C6C6162,
- 0x856530D8,
- 0xF262004E,
- 0x6C0695ED,
- 0x1B01A57B,
- 0x8208F4C1,
- 0xF50FC457,
- 0x65B0D9C6,
- 0x12B7E950,
- 0x8BBEB8EA,
- 0xFCB9887C,
- 0x62DD1DDF,
- 0x15DA2D49,
- 0x8CD37CF3,
- 0xFBD44C65,
- 0x4DB26158,
- 0x3AB551CE,
- 0xA3BC0074,
- 0xD4BB30E2,
- 0x4ADFA541,
- 0x3DD895D7,
- 0xA4D1C46D,
- 0xD3D6F4FB,
- 0x4369E96A,
- 0x346ED9FC,
- 0xAD678846,
- 0xDA60B8D0,
- 0x44042D73,
- 0x33031DE5,
- 0xAA0A4C5F,
- 0xDD0D7CC9,
- 0x5005713C,
- 0x270241AA,
- 0xBE0B1010,
- 0xC90C2086,
- 0x5768B525,
- 0x206F85B3,
- 0xB966D409,
- 0xCE61E49F,
- 0x5EDEF90E,
- 0x29D9C998,
- 0xB0D09822,
- 0xC7D7A8B4,
- 0x59B33D17,
- 0x2EB40D81,
- 0xB7BD5C3B,
- 0xC0BA6CAD,
- 0xEDB88320,
- 0x9ABFB3B6,
- 0x03B6E20C,
- 0x74B1D29A,
- 0xEAD54739,
- 0x9DD277AF,
- 0x04DB2615,
- 0x73DC1683,
- 0xE3630B12,
- 0x94643B84,
- 0x0D6D6A3E,
- 0x7A6A5AA8,
- 0xE40ECF0B,
- 0x9309FF9D,
- 0x0A00AE27,
- 0x7D079EB1,
- 0xF00F9344,
- 0x8708A3D2,
- 0x1E01F268,
- 0x6906C2FE,
- 0xF762575D,
- 0x806567CB,
- 0x196C3671,
- 0x6E6B06E7,
- 0xFED41B76,
- 0x89D32BE0,
- 0x10DA7A5A,
- 0x67DD4ACC,
- 0xF9B9DF6F,
- 0x8EBEEFF9,
- 0x17B7BE43,
- 0x60B08ED5,
- 0xD6D6A3E8,
- 0xA1D1937E,
- 0x38D8C2C4,
- 0x4FDFF252,
- 0xD1BB67F1,
- 0xA6BC5767,
- 0x3FB506DD,
- 0x48B2364B,
- 0xD80D2BDA,
- 0xAF0A1B4C,
- 0x36034AF6,
- 0x41047A60,
- 0xDF60EFC3,
- 0xA867DF55,
- 0x316E8EEF,
- 0x4669BE79,
- 0xCB61B38C,
- 0xBC66831A,
- 0x256FD2A0,
- 0x5268E236,
- 0xCC0C7795,
- 0xBB0B4703,
- 0x220216B9,
- 0x5505262F,
- 0xC5BA3BBE,
- 0xB2BD0B28,
- 0x2BB45A92,
- 0x5CB36A04,
- 0xC2D7FFA7,
- 0xB5D0CF31,
- 0x2CD99E8B,
- 0x5BDEAE1D,
- 0x9B64C2B0,
- 0xEC63F226,
- 0x756AA39C,
- 0x026D930A,
- 0x9C0906A9,
- 0xEB0E363F,
- 0x72076785,
- 0x05005713,
- 0x95BF4A82,
- 0xE2B87A14,
- 0x7BB12BAE,
- 0x0CB61B38,
- 0x92D28E9B,
- 0xE5D5BE0D,
- 0x7CDCEFB7,
- 0x0BDBDF21,
- 0x86D3D2D4,
- 0xF1D4E242,
- 0x68DDB3F8,
- 0x1FDA836E,
- 0x81BE16CD,
- 0xF6B9265B,
- 0x6FB077E1,
- 0x18B74777,
- 0x88085AE6,
- 0xFF0F6A70,
- 0x66063BCA,
- 0x11010B5C,
- 0x8F659EFF,
- 0xF862AE69,
- 0x616BFFD3,
- 0x166CCF45,
- 0xA00AE278,
- 0xD70DD2EE,
- 0x4E048354,
- 0x3903B3C2,
- 0xA7672661,
- 0xD06016F7,
- 0x4969474D,
- 0x3E6E77DB,
- 0xAED16A4A,
- 0xD9D65ADC,
- 0x40DF0B66,
- 0x37D83BF0,
- 0xA9BCAE53,
- 0xDEBB9EC5,
- 0x47B2CF7F,
- 0x30B5FFE9,
- 0xBDBDF21C,
- 0xCABAC28A,
- 0x53B39330,
- 0x24B4A3A6,
- 0xBAD03605,
- 0xCDD70693,
- 0x54DE5729,
- 0x23D967BF,
- 0xB3667A2E,
- 0xC4614AB8,
- 0x5D681B02,
- 0x2A6F2B94,
- 0xB40BBE37,
- 0xC30C8EA1,
- 0x5A05DF1B,
- 0x2D02EF8D
-};
-
-EFI_STATUS
-CalculateCrc32 (
- IN UINT8 *Data,
- IN UINTN DataSize,
- IN OUT UINT32 *CrcOut
- )
-/*++
-
-Routine Description:
-
- The CalculateCrc32 routine.
-
-Arguments:
-
- Data - The buffer contaning the data to be processed
- DataSize - The size of data to be processed
- CrcOut - A pointer to the caller allocated UINT32 that on
- contains the CRC32 checksum of Data
-
-Returns:
-
- EFI_SUCCESS - Calculation is successful.
- EFI_INVALID_PARAMETER - Data / CrcOut = NULL, or DataSize = 0
-
---*/
-{
- UINT32 Crc;
- UINTN Index;
- UINT8 *Ptr;
-
- if ((DataSize == 0) || (Data == NULL) || (CrcOut == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Crc = 0xffffffff;
- for (Index = 0, Ptr = Data; Index < DataSize; Index++, Ptr++) {
- Crc = (Crc >> 8) ^ mCrcTable[(UINT8) Crc ^ *Ptr];
- }
-
- *CrcOut = Crc ^ 0xffffffff;
-
- return EFI_SUCCESS;
-}
diff --git a/BaseTools/Source/C/Common/Crc32.h b/BaseTools/Source/C/Common/Crc32.h
deleted file mode 100644
index 760327f99c..0000000000
--- a/BaseTools/Source/C/Common/Crc32.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- Crc32.h
-
-Abstract:
-
- Header file for CalcuateCrc32 routine
-
-**/
-
-#ifndef _CRC32_H
-#define _CRC32_H
-
-#include <Common/UefiBaseTypes.h>
-
-EFI_STATUS
-CalculateCrc32 (
- IN UINT8 *Data,
- IN UINTN DataSize,
- IN OUT UINT32 *CrcOut
- )
-/*++
-
-Routine Description:
-
- The CalculateCrc32 routine.
-
-Arguments:
-
- Data - The buffer contaning the data to be processed
- DataSize - The size of data to be processed
- CrcOut - A pointer to the caller allocated UINT32 that on
- contains the CRC32 checksum of Data
-
-Returns:
-
- EFI_SUCCESS - Calculation is successful.
- EFI_INVALID_PARAMETER - Data / CrcOut = NULL, or DataSize = 0
-
---*/
-;
-
-#endif
diff --git a/BaseTools/Source/C/Common/Decompress.c b/BaseTools/Source/C/Common/Decompress.c
deleted file mode 100644
index a12fc595a7..0000000000
--- a/BaseTools/Source/C/Common/Decompress.c
+++ /dev/null
@@ -1,982 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- Decompress.c
-
-Abstract:
-
- Decompressor. Algorithm Ported from OPSD code (Decomp.asm)
- for Efi and Tiano compress algorithm.
-
---*/
-
-#include <stdlib.h>
-#include <string.h>
-#include "Decompress.h"
-
-//
-// Decompression algorithm begins here
-//
-#define BITBUFSIZ 32
-#define MAXMATCH 256
-#define THRESHOLD 3
-#define CODE_BIT 16
-#define BAD_TABLE - 1
-
-//
-// C: Char&Len Set; P: Position Set; T: exTra Set
-//
-#define NC (0xff + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define EFIPBIT 4
-#define MAXPBIT 5
-#define TBIT 5
-#define MAXNP ((1U << MAXPBIT) - 1)
-#define NT (CODE_BIT + 3)
-#if NT > MAXNP
-#define NPT NT
-#else
-#define NPT MAXNP
-#endif
-
-typedef struct {
- UINT8 *mSrcBase; // Starting address of compressed data
- UINT8 *mDstBase; // Starting address of decompressed data
- UINT32 mOutBuf;
- UINT32 mInBuf;
-
- UINT16 mBitCount;
- UINT32 mBitBuf;
- UINT32 mSubBitBuf;
- UINT16 mBlockSize;
- UINT32 mCompSize;
- UINT32 mOrigSize;
-
- UINT16 mBadTableFlag;
-
- UINT16 mLeft[2 * NC - 1];
- UINT16 mRight[2 * NC - 1];
- UINT8 mCLen[NC];
- UINT8 mPTLen[NPT];
- UINT16 mCTable[4096];
- UINT16 mPTTable[256];
-} SCRATCH_DATA;
-
-STATIC UINT16 mPbit = EFIPBIT;
-
-STATIC
-VOID
-FillBuf (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- )
-/*++
-
-Routine Description:
-
- Shift mBitBuf NumOfBits left. Read in NumOfBits of bits from source.
-
-Arguments:
-
- Sd - The global scratch data
- NumOfBit - The number of bits to shift and read.
-
-Returns: (VOID)
-
---*/
-{
- Sd->mBitBuf = (UINT32) (Sd->mBitBuf << NumOfBits);
-
- while (NumOfBits > Sd->mBitCount) {
-
- Sd->mBitBuf |= (UINT32) (Sd->mSubBitBuf << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
-
- if (Sd->mCompSize > 0) {
- //
- // Get 1 byte into SubBitBuf
- //
- Sd->mCompSize--;
- Sd->mSubBitBuf = 0;
- Sd->mSubBitBuf = Sd->mSrcBase[Sd->mInBuf++];
- Sd->mBitCount = 8;
-
- } else {
- //
- // No more bits from the source, just pad zero bit.
- //
- Sd->mSubBitBuf = 0;
- Sd->mBitCount = 8;
-
- }
- }
-
- Sd->mBitCount = (UINT16) (Sd->mBitCount - NumOfBits);
- Sd->mBitBuf |= Sd->mSubBitBuf >> Sd->mBitCount;
-}
-
-STATIC
-UINT32
-GetBits (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- )
-/*++
-
-Routine Description:
-
- Get NumOfBits of bits out from mBitBuf. Fill mBitBuf with subsequent
- NumOfBits of bits from source. Returns NumOfBits of bits that are
- popped out.
-
-Arguments:
-
- Sd - The global scratch data.
- NumOfBits - The number of bits to pop and read.
-
-Returns:
-
- The bits that are popped out.
-
---*/
-{
- UINT32 OutBits;
-
- OutBits = (UINT32) (Sd->mBitBuf >> (BITBUFSIZ - NumOfBits));
-
- FillBuf (Sd, NumOfBits);
-
- return OutBits;
-}
-
-STATIC
-UINT16
-MakeTable (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfChar,
- IN UINT8 *BitLen,
- IN UINT16 TableBits,
- OUT UINT16 *Table
- )
-/*++
-
-Routine Description:
-
- Creates Huffman Code mapping table according to code length array.
-
-Arguments:
-
- Sd - The global scratch data
- NumOfChar - Number of symbols in the symbol set
- BitLen - Code length array
- TableBits - The width of the mapping table
- Table - The table
-
-Returns:
-
- 0 - OK.
- BAD_TABLE - The table is corrupted.
-
---*/
-{
- UINT16 Count[17];
- UINT16 Weight[17];
- UINT16 Start[18];
- UINT16 *Pointer;
- UINT16 Index3;
- UINT16 Index;
- UINT16 Len;
- UINT16 Char;
- UINT16 JuBits;
- UINT16 Avail;
- UINT16 NextCode;
- UINT16 Mask;
-
- for (Index = 1; Index <= 16; Index++) {
- Count[Index] = 0;
- }
-
- for (Index = 0; Index < NumOfChar; Index++) {
- Count[BitLen[Index]]++;
- }
-
- Start[1] = 0;
-
- for (Index = 1; Index <= 16; Index++) {
- Start[Index + 1] = (UINT16) (Start[Index] + (Count[Index] << (16 - Index)));
- }
-
- if (Start[17] != 0) {
- /*(1U << 16)*/
- return (UINT16) BAD_TABLE;
- }
-
- JuBits = (UINT16) (16 - TableBits);
-
- for (Index = 1; Index <= TableBits; Index++) {
- Start[Index] >>= JuBits;
- Weight[Index] = (UINT16) (1U << (TableBits - Index));
- }
-
- while (Index <= 16) {
- Weight[Index] = (UINT16) (1U << (16 - Index));
- Index++;
- }
-
- Index = (UINT16) (Start[TableBits + 1] >> JuBits);
-
- if (Index != 0) {
- Index3 = (UINT16) (1U << TableBits);
- while (Index != Index3) {
- Table[Index++] = 0;
- }
- }
-
- Avail = NumOfChar;
- Mask = (UINT16) (1U << (15 - TableBits));
-
- for (Char = 0; Char < NumOfChar; Char++) {
-
- Len = BitLen[Char];
- if (Len == 0) {
- continue;
- }
-
- NextCode = (UINT16) (Start[Len] + Weight[Len]);
-
- if (Len <= TableBits) {
-
- for (Index = Start[Len]; Index < NextCode; Index++) {
- Table[Index] = Char;
- }
-
- } else {
-
- Index3 = Start[Len];
- Pointer = &Table[Index3 >> JuBits];
- Index = (UINT16) (Len - TableBits);
-
- while (Index != 0) {
- if (*Pointer == 0) {
- Sd->mRight[Avail] = Sd->mLeft[Avail] = 0;
- *Pointer = Avail++;
- }
-
- if (Index3 & Mask) {
- Pointer = &Sd->mRight[*Pointer];
- } else {
- Pointer = &Sd->mLeft[*Pointer];
- }
-
- Index3 <<= 1;
- Index--;
- }
-
- *Pointer = Char;
-
- }
-
- Start[Len] = NextCode;
- }
- //
- // Succeeds
- //
- return 0;
-}
-
-STATIC
-UINT32
-DecodeP (
- IN SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Decodes a position value.
-
-Arguments:
-
- Sd - the global scratch data
-
-Returns:
-
- The position value decoded.
-
---*/
-{
- UINT16 Val;
- UINT32 Mask;
- UINT32 Pos;
-
- Val = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
-
- if (Val >= MAXNP) {
- Mask = 1U << (BITBUFSIZ - 1 - 8);
-
- do {
-
- if (Sd->mBitBuf & Mask) {
- Val = Sd->mRight[Val];
- } else {
- Val = Sd->mLeft[Val];
- }
-
- Mask >>= 1;
- } while (Val >= MAXNP);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mPTLen[Val]);
-
- Pos = Val;
- if (Val > 1) {
- Pos = (UINT32) ((1U << (Val - 1)) + GetBits (Sd, (UINT16) (Val - 1)));
- }
-
- return Pos;
-}
-
-STATIC
-UINT16
-ReadPTLen (
- IN SCRATCH_DATA *Sd,
- IN UINT16 nn,
- IN UINT16 nbit,
- IN UINT16 Special
- )
-/*++
-
-Routine Description:
-
- Reads code lengths for the Extra Set or the Position Set
-
-Arguments:
-
- Sd - The global scratch data
- nn - Number of symbols
- nbit - Number of bits needed to represent nn
- Special - The special symbol that needs to be taken care of
-
-Returns:
-
- 0 - OK.
- BAD_TABLE - Table is corrupted.
-
---*/
-{
- UINT16 Number;
- UINT16 CharC;
- UINT16 Index;
- UINT32 Mask;
-
- Number = (UINT16) GetBits (Sd, nbit);
-
- if (Number == 0) {
- CharC = (UINT16) GetBits (Sd, nbit);
-
- for (Index = 0; Index < 256; Index++) {
- Sd->mPTTable[Index] = CharC;
- }
-
- for (Index = 0; Index < nn; Index++) {
- Sd->mPTLen[Index] = 0;
- }
-
- return 0;
- }
-
- Index = 0;
-
- while (Index < Number) {
-
- CharC = (UINT16) (Sd->mBitBuf >> (BITBUFSIZ - 3));
-
- if (CharC == 7) {
- Mask = 1U << (BITBUFSIZ - 1 - 3);
- while (Mask & Sd->mBitBuf) {
- Mask >>= 1;
- CharC += 1;
- }
- }
-
- FillBuf (Sd, (UINT16) ((CharC < 7) ? 3 : CharC - 3));
-
- Sd->mPTLen[Index++] = (UINT8) CharC;
-
- if (Index == Special) {
- CharC = (UINT16) GetBits (Sd, 2);
- CharC--;
- while ((INT16) (CharC) >= 0) {
- Sd->mPTLen[Index++] = 0;
- CharC--;
- }
- }
- }
-
- while (Index < nn) {
- Sd->mPTLen[Index++] = 0;
- }
-
- return MakeTable (Sd, nn, Sd->mPTLen, 8, Sd->mPTTable);
-}
-
-STATIC
-VOID
-ReadCLen (
- SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Reads code lengths for Char&Len Set.
-
-Arguments:
-
- Sd - the global scratch data
-
-Returns: (VOID)
-
---*/
-{
- UINT16 Number;
- UINT16 CharC;
- UINT16 Index;
- UINT32 Mask;
-
- Number = (UINT16) GetBits (Sd, CBIT);
-
- if (Number == 0) {
- CharC = (UINT16) GetBits (Sd, CBIT);
-
- for (Index = 0; Index < NC; Index++) {
- Sd->mCLen[Index] = 0;
- }
-
- for (Index = 0; Index < 4096; Index++) {
- Sd->mCTable[Index] = CharC;
- }
-
- return ;
- }
-
- Index = 0;
- while (Index < Number) {
-
- CharC = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
- if (CharC >= NT) {
- Mask = 1U << (BITBUFSIZ - 1 - 8);
-
- do {
-
- if (Mask & Sd->mBitBuf) {
- CharC = Sd->mRight[CharC];
- } else {
- CharC = Sd->mLeft[CharC];
- }
-
- Mask >>= 1;
-
- } while (CharC >= NT);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mPTLen[CharC]);
-
- if (CharC <= 2) {
-
- if (CharC == 0) {
- CharC = 1;
- } else if (CharC == 1) {
- CharC = (UINT16) (GetBits (Sd, 4) + 3);
- } else if (CharC == 2) {
- CharC = (UINT16) (GetBits (Sd, CBIT) + 20);
- }
-
- CharC--;
- while ((INT16) (CharC) >= 0) {
- Sd->mCLen[Index++] = 0;
- CharC--;
- }
-
- } else {
-
- Sd->mCLen[Index++] = (UINT8) (CharC - 2);
-
- }
- }
-
- while (Index < NC) {
- Sd->mCLen[Index++] = 0;
- }
-
- MakeTable (Sd, NC, Sd->mCLen, 12, Sd->mCTable);
-
- return ;
-}
-
-STATIC
-UINT16
-DecodeC (
- SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Decode a character/length value.
-
-Arguments:
-
- Sd - The global scratch data.
-
-Returns:
-
- The value decoded.
-
---*/
-{
- UINT16 Index2;
- UINT32 Mask;
-
- if (Sd->mBlockSize == 0) {
- //
- // Starting a new block
- //
- Sd->mBlockSize = (UINT16) GetBits (Sd, 16);
- Sd->mBadTableFlag = ReadPTLen (Sd, NT, TBIT, 3);
- if (Sd->mBadTableFlag != 0) {
- return 0;
- }
-
- ReadCLen (Sd);
-
- Sd->mBadTableFlag = ReadPTLen (Sd, MAXNP, mPbit, (UINT16) (-1));
- if (Sd->mBadTableFlag != 0) {
- return 0;
- }
- }
-
- Sd->mBlockSize--;
- Index2 = Sd->mCTable[Sd->mBitBuf >> (BITBUFSIZ - 12)];
-
- if (Index2 >= NC) {
- Mask = 1U << (BITBUFSIZ - 1 - 12);
-
- do {
- if (Sd->mBitBuf & Mask) {
- Index2 = Sd->mRight[Index2];
- } else {
- Index2 = Sd->mLeft[Index2];
- }
-
- Mask >>= 1;
- } while (Index2 >= NC);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mCLen[Index2]);
-
- return Index2;
-}
-
-STATIC
-VOID
-Decode (
- SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Decode the source data and put the resulting data into the destination buffer.
-
-Arguments:
-
- Sd - The global scratch data
-
-Returns: (VOID)
-
- --*/
-{
- UINT16 BytesRemain;
- UINT32 DataIdx;
- UINT16 CharC;
-
- BytesRemain = (UINT16) (-1);
-
- DataIdx = 0;
-
- for (;;) {
- CharC = DecodeC (Sd);
- if (Sd->mBadTableFlag != 0) {
- return ;
- }
-
- if (CharC < 256) {
- //
- // Process an Original character
- //
- Sd->mDstBase[Sd->mOutBuf++] = (UINT8) CharC;
- if (Sd->mOutBuf >= Sd->mOrigSize) {
- return ;
- }
-
- } else {
- //
- // Process a Pointer
- //
- CharC = (UINT16) (CharC - (UINT8_MAX + 1 - THRESHOLD));
-
- BytesRemain = CharC;
-
- DataIdx = Sd->mOutBuf - DecodeP (Sd) - 1;
-
- BytesRemain--;
- while ((INT16) (BytesRemain) >= 0) {
- Sd->mDstBase[Sd->mOutBuf++] = Sd->mDstBase[DataIdx++];
- if (Sd->mOutBuf >= Sd->mOrigSize) {
- return ;
- }
-
- BytesRemain--;
- }
- }
- }
-
- return ;
-}
-
-EFI_STATUS
-GetInfo (
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of EFI_DECOMPRESS_PROTOCOL.GetInfo().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- DstSize - The size of destination buffer.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- UINT8 *Src;
-
- *ScratchSize = sizeof (SCRATCH_DATA);
-
- Src = Source;
- if (SrcSize < 8) {
- return EFI_INVALID_PARAMETER;
- }
-
- *DstSize = Src[4] + (Src[5] << 8) + (Src[6] << 16) + (Src[7] << 24);
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-Decompress (
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation Efi and Tiano Decompress().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- Destination - The destination buffer to store the decompressed data
- DstSize - The size of destination buffer.
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- UINT32 Index;
- UINT32 CompSize;
- UINT32 OrigSize;
- EFI_STATUS Status;
- SCRATCH_DATA *Sd;
- UINT8 *Src;
- UINT8 *Dst;
-
- Status = EFI_SUCCESS;
- Src = Source;
- Dst = Destination;
-
- if (ScratchSize < sizeof (SCRATCH_DATA)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Sd = (SCRATCH_DATA *) Scratch;
-
- if (SrcSize < 8) {
- return EFI_INVALID_PARAMETER;
- }
-
- CompSize = Src[0] + (Src[1] << 8) + (Src[2] << 16) + (Src[3] << 24);
- OrigSize = Src[4] + (Src[5] << 8) + (Src[6] << 16) + (Src[7] << 24);
-
- if (SrcSize < CompSize + 8) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (DstSize != OrigSize) {
- return EFI_INVALID_PARAMETER;
- }
-
- Src = Src + 8;
-
- for (Index = 0; Index < sizeof (SCRATCH_DATA); Index++) {
- ((UINT8 *) Sd)[Index] = 0;
- }
-
- Sd->mSrcBase = Src;
- Sd->mDstBase = Dst;
- Sd->mCompSize = CompSize;
- Sd->mOrigSize = OrigSize;
-
- //
- // Fill the first BITBUFSIZ bits
- //
- FillBuf (Sd, BITBUFSIZ);
-
- //
- // Decompress it
- //
- Decode (Sd);
-
- if (Sd->mBadTableFlag != 0) {
- //
- // Something wrong with the source
- //
- Status = EFI_INVALID_PARAMETER;
- }
-
- return Status;
-}
-
-EFI_STATUS
-EfiGetInfo (
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation Efi Decompress GetInfo().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- DstSize - The size of destination buffer.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- return GetInfo (Source, SrcSize, DstSize, ScratchSize);
-}
-
-EFI_STATUS
-TianoGetInfo (
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation Tiano Decompress GetInfo().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- DstSize - The size of destination buffer.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- return GetInfo (Source, SrcSize, DstSize, ScratchSize);
-}
-
-EFI_STATUS
-EfiDecompress (
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of Efi Decompress().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- Destination - The destination buffer to store the decompressed data
- DstSize - The size of destination buffer.
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- mPbit = EFIPBIT;
- return Decompress (Source, SrcSize, Destination, DstSize, Scratch, ScratchSize);
-}
-
-EFI_STATUS
-TianoDecompress (
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of Tiano Decompress().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- Destination - The destination buffer to store the decompressed data
- DstSize - The size of destination buffer.
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- mPbit = MAXPBIT;
- return Decompress (Source, SrcSize, Destination, DstSize, Scratch, ScratchSize);
-}
-
-EFI_STATUS
-Extract (
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT VOID **Destination,
- OUT UINT32 *DstSize,
- IN UINTN Algorithm
- )
-{
- VOID *Scratch;
- UINT32 ScratchSize;
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
- switch (Algorithm) {
- case 0:
- *Destination = (VOID *)malloc(SrcSize);
- if (*Destination != NULL) {
- memcpy(*Destination, Source, SrcSize);
- } else {
- Status = EFI_OUT_OF_RESOURCES;
- }
- break;
- case 1:
- Status = EfiGetInfo(Source, SrcSize, DstSize, &ScratchSize);
- if (Status == EFI_SUCCESS) {
- Scratch = (VOID *)malloc(ScratchSize);
- *Destination = (VOID *)malloc(*DstSize);
- if (Scratch != NULL && *Destination != NULL) {
- Status = EfiDecompress(Source, SrcSize, *Destination, *DstSize, Scratch, ScratchSize);
- } else {
- Status = EFI_OUT_OF_RESOURCES;
- }
- }
- break;
- case 2:
- Status = TianoGetInfo(Source, SrcSize, DstSize, &ScratchSize);
- if (Status == EFI_SUCCESS) {
- Scratch = (VOID *)malloc(ScratchSize);
- *Destination = (VOID *)malloc(*DstSize);
- if (Scratch != NULL && *Destination != NULL) {
- Status = TianoDecompress(Source, SrcSize, *Destination, *DstSize, Scratch, ScratchSize);
- } else {
- Status = EFI_OUT_OF_RESOURCES;
- }
- }
- break;
- default:
- Status = EFI_INVALID_PARAMETER;
- }
-
- return Status;
-}
-
-
diff --git a/BaseTools/Source/C/Common/Decompress.h b/BaseTools/Source/C/Common/Decompress.h
deleted file mode 100644
index b5c978855c..0000000000
--- a/BaseTools/Source/C/Common/Decompress.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- Decompress.h
-
-Abstract:
-
- Header file for compression routine
-
-**/
-
-#ifndef _EFI_DECOMPRESS_H
-#define _EFI_DECOMPRESS_H
-
-#include <Common/UefiBaseTypes.h>
-
-EFI_STATUS
-EfiGetInfo (
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- );
-/**
-
-Routine Description:
-
- The implementation Efi Decompress GetInfo().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- DstSize - The size of destination buffer.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
-
-**/
-
-EFI_STATUS
-EfiDecompress (
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- );
-/**
-
-Routine Description:
-
- The implementation of Efi Decompress().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- Destination - The destination buffer to store the decompressed data
- DstSize - The size of destination buffer.
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
-
-**/
-
-EFI_STATUS
-TianoGetInfo (
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- );
-/**
-
-Routine Description:
-
- The implementation Tiano Decompress GetInfo().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- DstSize - The size of destination buffer.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
-
-**/
-
-EFI_STATUS
-TianoDecompress (
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- );
-/**
-
-Routine Description:
-
- The implementation of Tiano Decompress().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- Destination - The destination buffer to store the decompressed data
- DstSize - The size of destination buffer.
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
-
-**/
-
-typedef
-EFI_STATUS
-(*GETINFO_FUNCTION) (
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- );
-
-typedef
-EFI_STATUS
-(*DECOMPRESS_FUNCTION) (
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- );
-
-EFI_STATUS
-Extract (
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT VOID **Destination,
- OUT UINT32 *DstSize,
- IN UINTN Algorithm
- );
-
-#endif
diff --git a/BaseTools/Source/C/Common/EfiCompress.c b/BaseTools/Source/C/Common/EfiCompress.c
deleted file mode 100644
index ed491ae36d..0000000000
--- a/BaseTools/Source/C/Common/EfiCompress.c
+++ /dev/null
@@ -1,1598 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- EfiCompress.c
-
-Abstract:
-
- Compression routine. The compression algorithm is a mixture of
- LZ77 and Huffman coding. LZ77 transforms the source data into a
- sequence of Original Characters and Pointers to repeated strings.
- This sequence is further divided into Blocks and Huffman codings
- are applied to each Block.
-
-**/
-
-#include "Compress.h"
-
-
-//
-// Macro Definitions
-//
-
-#undef UINT8_MAX
-typedef INT16 NODE;
-#define UINT8_MAX 0xff
-#define UINT8_BIT 8
-#define THRESHOLD 3
-#define INIT_CRC 0
-#define WNDBIT 13
-#define WNDSIZ (1U << WNDBIT)
-#define MAXMATCH 256
-#define PERC_FLAG 0x8000U
-#define CODE_BIT 16
-#define NIL 0
-#define MAX_HASH_VAL (3 * WNDSIZ + (WNDSIZ / 512 + 1) * UINT8_MAX)
-#define HASH(p, c) ((p) + ((c) << (WNDBIT - 9)) + WNDSIZ * 2)
-#define CRCPOLY 0xA001
-#define UPDATE_CRC(c) mCrc = mCrcTable[(mCrc ^ (c)) & 0xFF] ^ (mCrc >> UINT8_BIT)
-
-//
-// C: the Char&Len Set; P: the Position Set; T: the exTra Set
-//
-
-#define NC (UINT8_MAX + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define NP (WNDBIT + 1)
-#define PBIT 4
-#define NT (CODE_BIT + 3)
-#define TBIT 5
-#if NT > NP
- #define NPT NT
-#else
- #define NPT NP
-#endif
-
-//
-// Function Prototypes
-//
-
-STATIC
-VOID
-PutDword(
- IN UINT32 Data
- );
-
-STATIC
-EFI_STATUS
-AllocateMemory (
- );
-
-STATIC
-VOID
-FreeMemory (
- );
-
-STATIC
-VOID
-InitSlide (
- );
-
-STATIC
-NODE
-Child (
- IN NODE q,
- IN UINT8 c
- );
-
-STATIC
-VOID
-MakeChild (
- IN NODE q,
- IN UINT8 c,
- IN NODE r
- );
-
-STATIC
-VOID
-Split (
- IN NODE Old
- );
-
-STATIC
-VOID
-InsertNode (
- );
-
-STATIC
-VOID
-DeleteNode (
- );
-
-STATIC
-VOID
-GetNextMatch (
- );
-
-STATIC
-EFI_STATUS
-Encode (
- );
-
-STATIC
-VOID
-CountTFreq (
- );
-
-STATIC
-VOID
-WritePTLen (
- IN INT32 n,
- IN INT32 nbit,
- IN INT32 Special
- );
-
-STATIC
-VOID
-WriteCLen (
- );
-
-STATIC
-VOID
-EncodeC (
- IN INT32 c
- );
-
-STATIC
-VOID
-EncodeP (
- IN UINT32 p
- );
-
-STATIC
-VOID
-SendBlock (
- );
-
-STATIC
-VOID
-Output (
- IN UINT32 c,
- IN UINT32 p
- );
-
-STATIC
-VOID
-HufEncodeStart (
- );
-
-STATIC
-VOID
-HufEncodeEnd (
- );
-
-STATIC
-VOID
-MakeCrcTable (
- );
-
-STATIC
-VOID
-PutBits (
- IN INT32 n,
- IN UINT32 x
- );
-
-STATIC
-INT32
-FreadCrc (
- OUT UINT8 *p,
- IN INT32 n
- );
-
-STATIC
-VOID
-InitPutBits (
- );
-
-STATIC
-VOID
-CountLen (
- IN INT32 i
- );
-
-STATIC
-VOID
-MakeLen (
- IN INT32 Root
- );
-
-STATIC
-VOID
-DownHeap (
- IN INT32 i
- );
-
-STATIC
-VOID
-MakeCode (
- IN INT32 n,
- IN UINT8 Len[],
- OUT UINT16 Code[]
- );
-
-STATIC
-INT32
-MakeTree (
- IN INT32 NParm,
- IN UINT16 FreqParm[],
- OUT UINT8 LenParm[],
- OUT UINT16 CodeParm[]
- );
-
-
-//
-// Global Variables
-//
-
-STATIC UINT8 *mSrc, *mDst, *mSrcUpperLimit, *mDstUpperLimit;
-
-STATIC UINT8 *mLevel, *mText, *mChildCount, *mBuf, mCLen[NC], mPTLen[NPT], *mLen;
-STATIC INT16 mHeap[NC + 1];
-STATIC INT32 mRemainder, mMatchLen, mBitCount, mHeapSize, mN;
-STATIC UINT32 mBufSiz = 0, mOutputPos, mOutputMask, mSubBitBuf, mCrc;
-STATIC UINT32 mCompSize, mOrigSize;
-
-STATIC UINT16 *mFreq, *mSortPtr, mLenCnt[17], mLeft[2 * NC - 1], mRight[2 * NC - 1],
- mCrcTable[UINT8_MAX + 1], mCFreq[2 * NC - 1],mCCode[NC],
- mPFreq[2 * NP - 1], mPTCode[NPT], mTFreq[2 * NT - 1];
-
-STATIC NODE mPos, mMatchPos, mAvail, *mPosition, *mParent, *mPrev, *mNext = NULL;
-
-
-//
-// functions
-//
-
-EFI_STATUS
-EfiCompress (
- IN UINT8 *SrcBuffer,
- IN UINT32 SrcSize,
- IN UINT8 *DstBuffer,
- IN OUT UINT32 *DstSize
- )
-/*++
-
-Routine Description:
-
- The main compression routine.
-
-Arguments:
-
- SrcBuffer - The buffer storing the source data
- SrcSize - The size of source data
- DstBuffer - The buffer to store the compressed data
- DstSize - On input, the size of DstBuffer; On output,
- the size of the actual compressed data.
-
-Returns:
-
- EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. In this case,
- DstSize contains the size needed.
- EFI_SUCCESS - Compression is successful.
-
---*/
-{
- EFI_STATUS Status = EFI_SUCCESS;
-
- //
- // Initializations
- //
- mBufSiz = 0;
- mBuf = NULL;
- mText = NULL;
- mLevel = NULL;
- mChildCount = NULL;
- mPosition = NULL;
- mParent = NULL;
- mPrev = NULL;
- mNext = NULL;
-
-
- mSrc = SrcBuffer;
- mSrcUpperLimit = mSrc + SrcSize;
- mDst = DstBuffer;
- mDstUpperLimit = mDst + *DstSize;
-
- PutDword(0L);
- PutDword(0L);
-
- MakeCrcTable ();
-
- mOrigSize = mCompSize = 0;
- mCrc = INIT_CRC;
-
- //
- // Compress it
- //
-
- Status = Encode();
- if (EFI_ERROR (Status)) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Null terminate the compressed data
- //
- if (mDst < mDstUpperLimit) {
- *mDst++ = 0;
- }
-
- //
- // Fill in compressed size and original size
- //
- mDst = DstBuffer;
- PutDword(mCompSize+1);
- PutDword(mOrigSize);
-
- //
- // Return
- //
-
- if (mCompSize + 1 + 8 > *DstSize) {
- *DstSize = mCompSize + 1 + 8;
- return EFI_BUFFER_TOO_SMALL;
- } else {
- *DstSize = mCompSize + 1 + 8;
- return EFI_SUCCESS;
- }
-
-}
-
-STATIC
-VOID
-PutDword(
- IN UINT32 Data
- )
-/*++
-
-Routine Description:
-
- Put a dword to output stream
-
-Arguments:
-
- Data - the dword to put
-
-Returns: (VOID)
-
---*/
-{
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8)(((UINT8)(Data )) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8)(((UINT8)(Data >> 0x08)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8)(((UINT8)(Data >> 0x10)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8)(((UINT8)(Data >> 0x18)) & 0xff);
- }
-}
-
-STATIC
-EFI_STATUS
-AllocateMemory ()
-/*++
-
-Routine Description:
-
- Allocate memory spaces for data structures used in compression process
-
-Argements: (VOID)
-
-Returns:
-
- EFI_SUCCESS - Memory is allocated successfully
- EFI_OUT_OF_RESOURCES - Allocation fails
-
---*/
-{
- UINT32 i;
-
- mText = malloc (WNDSIZ * 2 + MAXMATCH);
- for (i = 0 ; i < WNDSIZ * 2 + MAXMATCH; i ++) {
- mText[i] = 0;
- }
-
- mLevel = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof(*mLevel));
- mChildCount = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof(*mChildCount));
- mPosition = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof(*mPosition));
- mParent = malloc (WNDSIZ * 2 * sizeof(*mParent));
- mPrev = malloc (WNDSIZ * 2 * sizeof(*mPrev));
- mNext = malloc ((MAX_HASH_VAL + 1) * sizeof(*mNext));
-
- mBufSiz = 16 * 1024U;
- while ((mBuf = malloc(mBufSiz)) == NULL) {
- mBufSiz = (mBufSiz / 10U) * 9U;
- if (mBufSiz < 4 * 1024U) {
- return EFI_OUT_OF_RESOURCES;
- }
- }
- mBuf[0] = 0;
-
- return EFI_SUCCESS;
-}
-
-VOID
-FreeMemory ()
-/*++
-
-Routine Description:
-
- Called when compression is completed to free memory previously allocated.
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- if (mText) {
- free (mText);
- }
-
- if (mLevel) {
- free (mLevel);
- }
-
- if (mChildCount) {
- free (mChildCount);
- }
-
- if (mPosition) {
- free (mPosition);
- }
-
- if (mParent) {
- free (mParent);
- }
-
- if (mPrev) {
- free (mPrev);
- }
-
- if (mNext) {
- free (mNext);
- }
-
- if (mBuf) {
- free (mBuf);
- }
-
- return;
-}
-
-
-STATIC
-VOID
-InitSlide ()
-/*++
-
-Routine Description:
-
- Initialize String Info Log data structures
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- NODE i;
-
- for (i = WNDSIZ; i <= WNDSIZ + UINT8_MAX; i++) {
- mLevel[i] = 1;
- mPosition[i] = NIL; /* sentinel */
- }
- for (i = WNDSIZ; i < WNDSIZ * 2; i++) {
- mParent[i] = NIL;
- }
- mAvail = 1;
- for (i = 1; i < WNDSIZ - 1; i++) {
- mNext[i] = (NODE)(i + 1);
- }
-
- mNext[WNDSIZ - 1] = NIL;
- for (i = WNDSIZ * 2; i <= MAX_HASH_VAL; i++) {
- mNext[i] = NIL;
- }
-}
-
-
-STATIC
-NODE
-Child (
- IN NODE q,
- IN UINT8 c
- )
-/*++
-
-Routine Description:
-
- Find child node given the parent node and the edge character
-
-Arguments:
-
- q - the parent node
- c - the edge character
-
-Returns:
-
- The child node (NIL if not found)
-
---*/
-{
- NODE r;
-
- r = mNext[HASH(q, c)];
- mParent[NIL] = q; /* sentinel */
- while (mParent[r] != q) {
- r = mNext[r];
- }
-
- return r;
-}
-
-STATIC
-VOID
-MakeChild (
- IN NODE q,
- IN UINT8 c,
- IN NODE r
- )
-/*++
-
-Routine Description:
-
- Create a new child for a given parent node.
-
-Arguments:
-
- q - the parent node
- c - the edge character
- r - the child node
-
-Returns: (VOID)
-
---*/
-{
- NODE h, t;
-
- h = (NODE)HASH(q, c);
- t = mNext[h];
- mNext[h] = r;
- mNext[r] = t;
- mPrev[t] = r;
- mPrev[r] = h;
- mParent[r] = q;
- mChildCount[q]++;
-}
-
-STATIC
-VOID
-Split (
- NODE Old
- )
-/*++
-
-Routine Description:
-
- Split a node.
-
-Arguments:
-
- Old - the node to split
-
-Returns: (VOID)
-
---*/
-{
- NODE New, t;
-
- New = mAvail;
- mAvail = mNext[New];
- mChildCount[New] = 0;
- t = mPrev[Old];
- mPrev[New] = t;
- mNext[t] = New;
- t = mNext[Old];
- mNext[New] = t;
- mPrev[t] = New;
- mParent[New] = mParent[Old];
- mLevel[New] = (UINT8)mMatchLen;
- mPosition[New] = mPos;
- MakeChild(New, mText[mMatchPos + mMatchLen], Old);
- MakeChild(New, mText[mPos + mMatchLen], mPos);
-}
-
-STATIC
-VOID
-InsertNode ()
-/*++
-
-Routine Description:
-
- Insert string info for current position into the String Info Log
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- NODE q, r, j, t;
- UINT8 c, *t1, *t2;
-
- if (mMatchLen >= 4) {
-
- //
- // We have just got a long match, the target tree
- // can be located by MatchPos + 1. Travese the tree
- // from bottom up to get to a proper starting point.
- // The usage of PERC_FLAG ensures proper node deletion
- // in DeleteNode() later.
- //
-
- mMatchLen--;
- r = (INT16)((mMatchPos + 1) | WNDSIZ);
- while ((q = mParent[r]) == NIL) {
- r = mNext[r];
- }
- while (mLevel[q] >= mMatchLen) {
- r = q; q = mParent[q];
- }
- t = q;
- while (mPosition[t] < 0) {
- mPosition[t] = mPos;
- t = mParent[t];
- }
- if (t < WNDSIZ) {
- mPosition[t] = (NODE)(mPos | PERC_FLAG);
- }
- } else {
-
- //
- // Locate the target tree
- //
-
- q = (INT16)(mText[mPos] + WNDSIZ);
- c = mText[mPos + 1];
- if ((r = Child(q, c)) == NIL) {
- MakeChild(q, c, mPos);
- mMatchLen = 1;
- return;
- }
- mMatchLen = 2;
- }
-
- //
- // Traverse down the tree to find a match.
- // Update Position value along the route.
- // Node split or creation is involved.
- //
-
- for ( ; ; ) {
- if (r >= WNDSIZ) {
- j = MAXMATCH;
- mMatchPos = r;
- } else {
- j = mLevel[r];
- mMatchPos = (NODE)(mPosition[r] & ~PERC_FLAG);
- }
- if (mMatchPos >= mPos) {
- mMatchPos -= WNDSIZ;
- }
- t1 = &mText[mPos + mMatchLen];
- t2 = &mText[mMatchPos + mMatchLen];
- while (mMatchLen < j) {
- if (*t1 != *t2) {
- Split(r);
- return;
- }
- mMatchLen++;
- t1++;
- t2++;
- }
- if (mMatchLen >= MAXMATCH) {
- break;
- }
- mPosition[r] = mPos;
- q = r;
- if ((r = Child(q, *t1)) == NIL) {
- MakeChild(q, *t1, mPos);
- return;
- }
- mMatchLen++;
- }
- t = mPrev[r];
- mPrev[mPos] = t;
- mNext[t] = mPos;
- t = mNext[r];
- mNext[mPos] = t;
- mPrev[t] = mPos;
- mParent[mPos] = q;
- mParent[r] = NIL;
-
- //
- // Special usage of 'next'
- //
- mNext[r] = mPos;
-
-}
-
-STATIC
-VOID
-DeleteNode ()
-/*++
-
-Routine Description:
-
- Delete outdated string info. (The Usage of PERC_FLAG
- ensures a clean deletion)
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- NODE q, r, s, t, u;
-
- if (mParent[mPos] == NIL) {
- return;
- }
-
- r = mPrev[mPos];
- s = mNext[mPos];
- mNext[r] = s;
- mPrev[s] = r;
- r = mParent[mPos];
- mParent[mPos] = NIL;
- if (r >= WNDSIZ || --mChildCount[r] > 1) {
- return;
- }
- t = (NODE)(mPosition[r] & ~PERC_FLAG);
- if (t >= mPos) {
- t -= WNDSIZ;
- }
- s = t;
- q = mParent[r];
- while ((u = mPosition[q]) & PERC_FLAG) {
- u &= ~PERC_FLAG;
- if (u >= mPos) {
- u -= WNDSIZ;
- }
- if (u > s) {
- s = u;
- }
- mPosition[q] = (INT16)(s | WNDSIZ);
- q = mParent[q];
- }
- if (q < WNDSIZ) {
- if (u >= mPos) {
- u -= WNDSIZ;
- }
- if (u > s) {
- s = u;
- }
- mPosition[q] = (INT16)(s | WNDSIZ | PERC_FLAG);
- }
- s = Child(r, mText[t + mLevel[r]]);
- t = mPrev[s];
- u = mNext[s];
- mNext[t] = u;
- mPrev[u] = t;
- t = mPrev[r];
- mNext[t] = s;
- mPrev[s] = t;
- t = mNext[r];
- mPrev[t] = s;
- mNext[s] = t;
- mParent[s] = mParent[r];
- mParent[r] = NIL;
- mNext[r] = mAvail;
- mAvail = r;
-}
-
-STATIC
-VOID
-GetNextMatch ()
-/*++
-
-Routine Description:
-
- Advance the current position (read in new data if needed).
- Delete outdated string info. Find a match string for current position.
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- INT32 n;
-
- mRemainder--;
- if (++mPos == WNDSIZ * 2) {
- memmove(&mText[0], &mText[WNDSIZ], WNDSIZ + MAXMATCH);
- n = FreadCrc(&mText[WNDSIZ + MAXMATCH], WNDSIZ);
- mRemainder += n;
- mPos = WNDSIZ;
- }
- DeleteNode();
- InsertNode();
-}
-
-STATIC
-EFI_STATUS
-Encode ()
-/*++
-
-Routine Description:
-
- The main controlling routine for compression process.
-
-Arguments: (VOID)
-
-Returns:
-
- EFI_SUCCESS - The compression is successful
- EFI_OUT_0F_RESOURCES - Not enough memory for compression process
-
---*/
-{
- EFI_STATUS Status;
- INT32 LastMatchLen;
- NODE LastMatchPos;
-
- Status = AllocateMemory();
- if (EFI_ERROR(Status)) {
- FreeMemory();
- return Status;
- }
-
- InitSlide();
-
- HufEncodeStart();
-
- mRemainder = FreadCrc(&mText[WNDSIZ], WNDSIZ + MAXMATCH);
-
- mMatchLen = 0;
- mPos = WNDSIZ;
- InsertNode();
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
- while (mRemainder > 0) {
- LastMatchLen = mMatchLen;
- LastMatchPos = mMatchPos;
- GetNextMatch();
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
-
- if (mMatchLen > LastMatchLen || LastMatchLen < THRESHOLD) {
-
- //
- // Not enough benefits are gained by outputting a pointer,
- // so just output the original character
- //
-
- Output(mText[mPos - 1], 0);
- } else {
-
- //
- // Outputting a pointer is beneficial enough, do it.
- //
-
- Output(LastMatchLen + (UINT8_MAX + 1 - THRESHOLD),
- (mPos - LastMatchPos - 2) & (WNDSIZ - 1));
- while (--LastMatchLen > 0) {
- GetNextMatch();
- }
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
- }
- }
-
- HufEncodeEnd();
- FreeMemory();
- return EFI_SUCCESS;
-}
-
-STATIC
-VOID
-CountTFreq ()
-/*++
-
-Routine Description:
-
- Count the frequencies for the Extra Set
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- INT32 i, k, n, Count;
-
- for (i = 0; i < NT; i++) {
- mTFreq[i] = 0;
- }
- n = NC;
- while (n > 0 && mCLen[n - 1] == 0) {
- n--;
- }
- i = 0;
- while (i < n) {
- k = mCLen[i++];
- if (k == 0) {
- Count = 1;
- while (i < n && mCLen[i] == 0) {
- i++;
- Count++;
- }
- if (Count <= 2) {
- mTFreq[0] = (UINT16)(mTFreq[0] + Count);
- } else if (Count <= 18) {
- mTFreq[1]++;
- } else if (Count == 19) {
- mTFreq[0]++;
- mTFreq[1]++;
- } else {
- mTFreq[2]++;
- }
- } else {
- mTFreq[k + 2]++;
- }
- }
-}
-
-STATIC
-VOID
-WritePTLen (
- IN INT32 n,
- IN INT32 nbit,
- IN INT32 Special
- )
-/*++
-
-Routine Description:
-
- Outputs the code length array for the Extra Set or the Position Set.
-
-Arguments:
-
- n - the number of symbols
- nbit - the number of bits needed to represent 'n'
- Special - the special symbol that needs to be take care of
-
-Returns: (VOID)
-
---*/
-{
- INT32 i, k;
-
- while (n > 0 && mPTLen[n - 1] == 0) {
- n--;
- }
- PutBits(nbit, n);
- i = 0;
- while (i < n) {
- k = mPTLen[i++];
- if (k <= 6) {
- PutBits(3, k);
- } else {
- PutBits(k - 3, (1U << (k - 3)) - 2);
- }
- if (i == Special) {
- while (i < 6 && mPTLen[i] == 0) {
- i++;
- }
- PutBits(2, (i - 3) & 3);
- }
- }
-}
-
-STATIC
-VOID
-WriteCLen ()
-/*++
-
-Routine Description:
-
- Outputs the code length array for Char&Length Set
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- INT32 i, k, n, Count;
-
- n = NC;
- while (n > 0 && mCLen[n - 1] == 0) {
- n--;
- }
- PutBits(CBIT, n);
- i = 0;
- while (i < n) {
- k = mCLen[i++];
- if (k == 0) {
- Count = 1;
- while (i < n && mCLen[i] == 0) {
- i++;
- Count++;
- }
- if (Count <= 2) {
- for (k = 0; k < Count; k++) {
- PutBits(mPTLen[0], mPTCode[0]);
- }
- } else if (Count <= 18) {
- PutBits(mPTLen[1], mPTCode[1]);
- PutBits(4, Count - 3);
- } else if (Count == 19) {
- PutBits(mPTLen[0], mPTCode[0]);
- PutBits(mPTLen[1], mPTCode[1]);
- PutBits(4, 15);
- } else {
- PutBits(mPTLen[2], mPTCode[2]);
- PutBits(CBIT, Count - 20);
- }
- } else {
- PutBits(mPTLen[k + 2], mPTCode[k + 2]);
- }
- }
-}
-
-STATIC
-VOID
-EncodeC (
- IN INT32 c
- )
-{
- PutBits(mCLen[c], mCCode[c]);
-}
-
-STATIC
-VOID
-EncodeP (
- IN UINT32 p
- )
-{
- UINT32 c, q;
-
- c = 0;
- q = p;
- while (q) {
- q >>= 1;
- c++;
- }
- PutBits(mPTLen[c], mPTCode[c]);
- if (c > 1) {
- PutBits(c - 1, p & (0xFFFFU >> (17 - c)));
- }
-}
-
-STATIC
-VOID
-SendBlock ()
-/*++
-
-Routine Description:
-
- Huffman code the block and output it.
-
-Argument: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- UINT32 i, k, Flags, Root, Pos, Size;
- Flags = 0;
-
- Root = MakeTree(NC, mCFreq, mCLen, mCCode);
- Size = mCFreq[Root];
- PutBits(16, Size);
- if (Root >= NC) {
- CountTFreq();
- Root = MakeTree(NT, mTFreq, mPTLen, mPTCode);
- if (Root >= NT) {
- WritePTLen(NT, TBIT, 3);
- } else {
- PutBits(TBIT, 0);
- PutBits(TBIT, Root);
- }
- WriteCLen();
- } else {
- PutBits(TBIT, 0);
- PutBits(TBIT, 0);
- PutBits(CBIT, 0);
- PutBits(CBIT, Root);
- }
- Root = MakeTree(NP, mPFreq, mPTLen, mPTCode);
- if (Root >= NP) {
- WritePTLen(NP, PBIT, -1);
- } else {
- PutBits(PBIT, 0);
- PutBits(PBIT, Root);
- }
- Pos = 0;
- for (i = 0; i < Size; i++) {
- if (i % UINT8_BIT == 0) {
- Flags = mBuf[Pos++];
- } else {
- Flags <<= 1;
- }
- if (Flags & (1U << (UINT8_BIT - 1))) {
- EncodeC(mBuf[Pos++] + (1U << UINT8_BIT));
- k = mBuf[Pos++] << UINT8_BIT;
- k += mBuf[Pos++];
- EncodeP(k);
- } else {
- EncodeC(mBuf[Pos++]);
- }
- }
- for (i = 0; i < NC; i++) {
- mCFreq[i] = 0;
- }
- for (i = 0; i < NP; i++) {
- mPFreq[i] = 0;
- }
-}
-
-
-STATIC
-VOID
-Output (
- IN UINT32 c,
- IN UINT32 p
- )
-/*++
-
-Routine Description:
-
- Outputs an Original Character or a Pointer
-
-Arguments:
-
- c - The original character or the 'String Length' element of a Pointer
- p - The 'Position' field of a Pointer
-
-Returns: (VOID)
-
---*/
-{
- STATIC UINT32 CPos;
-
- if ((mOutputMask >>= 1) == 0) {
- mOutputMask = 1U << (UINT8_BIT - 1);
- if (mOutputPos >= mBufSiz - 3 * UINT8_BIT) {
- SendBlock();
- mOutputPos = 0;
- }
- CPos = mOutputPos++;
- mBuf[CPos] = 0;
- }
- mBuf[mOutputPos++] = (UINT8) c;
- mCFreq[c]++;
- if (c >= (1U << UINT8_BIT)) {
- mBuf[CPos] |= mOutputMask;
- mBuf[mOutputPos++] = (UINT8)(p >> UINT8_BIT);
- mBuf[mOutputPos++] = (UINT8) p;
- c = 0;
- while (p) {
- p >>= 1;
- c++;
- }
- mPFreq[c]++;
- }
-}
-
-STATIC
-VOID
-HufEncodeStart ()
-{
- INT32 i;
-
- for (i = 0; i < NC; i++) {
- mCFreq[i] = 0;
- }
- for (i = 0; i < NP; i++) {
- mPFreq[i] = 0;
- }
- mOutputPos = mOutputMask = 0;
- InitPutBits();
- return;
-}
-
-STATIC
-VOID
-HufEncodeEnd ()
-{
- SendBlock();
-
- //
- // Flush remaining bits
- //
- PutBits(UINT8_BIT - 1, 0);
-
- return;
-}
-
-
-STATIC
-VOID
-MakeCrcTable ()
-{
- UINT32 i, j, r;
-
- for (i = 0; i <= UINT8_MAX; i++) {
- r = i;
- for (j = 0; j < UINT8_BIT; j++) {
- if (r & 1) {
- r = (r >> 1) ^ CRCPOLY;
- } else {
- r >>= 1;
- }
- }
- mCrcTable[i] = (UINT16)r;
- }
-}
-
-STATIC
-VOID
-PutBits (
- IN INT32 n,
- IN UINT32 x
- )
-/*++
-
-Routine Description:
-
- Outputs rightmost n bits of x
-
-Argments:
-
- n - the rightmost n bits of the data is used
- x - the data
-
-Returns: (VOID)
-
---*/
-{
- UINT8 Temp;
-
- if (n < mBitCount) {
- mSubBitBuf |= x << (mBitCount -= n);
- } else {
-
- Temp = (UINT8)(mSubBitBuf | (x >> (n -= mBitCount)));
- if (mDst < mDstUpperLimit) {
- *mDst++ = Temp;
- }
- mCompSize++;
-
- if (n < UINT8_BIT) {
- mSubBitBuf = x << (mBitCount = UINT8_BIT - n);
- } else {
-
- Temp = (UINT8)(x >> (n - UINT8_BIT));
- if (mDst < mDstUpperLimit) {
- *mDst++ = Temp;
- }
- mCompSize++;
-
- mSubBitBuf = x << (mBitCount = 2 * UINT8_BIT - n);
- }
- }
-}
-
-STATIC
-INT32
-FreadCrc (
- OUT UINT8 *p,
- IN INT32 n
- )
-/*++
-
-Routine Description:
-
- Read in source data
-
-Arguments:
-
- p - the buffer to hold the data
- n - number of bytes to read
-
-Returns:
-
- number of bytes actually read
-
---*/
-{
- INT32 i;
-
- for (i = 0; mSrc < mSrcUpperLimit && i < n; i++) {
- *p++ = *mSrc++;
- }
- n = i;
-
- p -= n;
- mOrigSize += n;
- while (--i >= 0) {
- UPDATE_CRC(*p++);
- }
- return n;
-}
-
-
-STATIC
-VOID
-InitPutBits ()
-{
- mBitCount = UINT8_BIT;
- mSubBitBuf = 0;
-}
-
-STATIC
-VOID
-CountLen (
- IN INT32 i
- )
-/*++
-
-Routine Description:
-
- Count the number of each code length for a Huffman tree.
-
-Arguments:
-
- i - the top node
-
-Returns: (VOID)
-
---*/
-{
- STATIC INT32 Depth = 0;
-
- if (i < mN) {
- mLenCnt[(Depth < 16) ? Depth : 16]++;
- } else {
- Depth++;
- CountLen(mLeft [i]);
- CountLen(mRight[i]);
- Depth--;
- }
-}
-
-STATIC
-VOID
-MakeLen (
- IN INT32 Root
- )
-/*++
-
-Routine Description:
-
- Create code length array for a Huffman tree
-
-Arguments:
-
- Root - the root of the tree
-
---*/
-{
- INT32 i, k;
- UINT32 Cum;
-
- for (i = 0; i <= 16; i++) {
- mLenCnt[i] = 0;
- }
- CountLen(Root);
-
- //
- // Adjust the length count array so that
- // no code will be generated longer than its designated length
- //
-
- Cum = 0;
- for (i = 16; i > 0; i--) {
- Cum += mLenCnt[i] << (16 - i);
- }
- while (Cum != (1U << 16)) {
- mLenCnt[16]--;
- for (i = 15; i > 0; i--) {
- if (mLenCnt[i] != 0) {
- mLenCnt[i]--;
- mLenCnt[i+1] += 2;
- break;
- }
- }
- Cum--;
- }
- for (i = 16; i > 0; i--) {
- k = mLenCnt[i];
- while (--k >= 0) {
- mLen[*mSortPtr++] = (UINT8)i;
- }
- }
-}
-
-STATIC
-VOID
-DownHeap (
- IN INT32 i
- )
-{
- INT32 j, k;
-
- //
- // priority queue: send i-th entry down heap
- //
-
- k = mHeap[i];
- while ((j = 2 * i) <= mHeapSize) {
- if (j < mHeapSize && mFreq[mHeap[j]] > mFreq[mHeap[j + 1]]) {
- j++;
- }
- if (mFreq[k] <= mFreq[mHeap[j]]) {
- break;
- }
- mHeap[i] = mHeap[j];
- i = j;
- }
- mHeap[i] = (INT16)k;
-}
-
-STATIC
-VOID
-MakeCode (
- IN INT32 n,
- IN UINT8 Len[],
- OUT UINT16 Code[]
- )
-/*++
-
-Routine Description:
-
- Assign code to each symbol based on the code length array
-
-Arguments:
-
- n - number of symbols
- Len - the code length array
- Code - stores codes for each symbol
-
-Returns: (VOID)
-
---*/
-{
- INT32 i;
- UINT16 Start[18];
-
- Start[1] = 0;
- for (i = 1; i <= 16; i++) {
- Start[i + 1] = (UINT16)((Start[i] + mLenCnt[i]) << 1);
- }
- for (i = 0; i < n; i++) {
- Code[i] = Start[Len[i]]++;
- }
-}
-
-STATIC
-INT32
-MakeTree (
- IN INT32 NParm,
- IN UINT16 FreqParm[],
- OUT UINT8 LenParm[],
- OUT UINT16 CodeParm[]
- )
-/*++
-
-Routine Description:
-
- Generates Huffman codes given a frequency distribution of symbols
-
-Arguments:
-
- NParm - number of symbols
- FreqParm - frequency of each symbol
- LenParm - code length for each symbol
- CodeParm - code for each symbol
-
-Returns:
-
- Root of the Huffman tree.
-
---*/
-{
- INT32 i, j, k, Avail;
-
- //
- // make tree, calculate len[], return root
- //
-
- mN = NParm;
- mFreq = FreqParm;
- mLen = LenParm;
- Avail = mN;
- mHeapSize = 0;
- mHeap[1] = 0;
- for (i = 0; i < mN; i++) {
- mLen[i] = 0;
- if (mFreq[i]) {
- mHeap[++mHeapSize] = (INT16)i;
- }
- }
- if (mHeapSize < 2) {
- CodeParm[mHeap[1]] = 0;
- return mHeap[1];
- }
- for (i = mHeapSize / 2; i >= 1; i--) {
-
- //
- // make priority queue
- //
- DownHeap(i);
- }
- mSortPtr = CodeParm;
- do {
- i = mHeap[1];
- if (i < mN) {
- *mSortPtr++ = (UINT16)i;
- }
- mHeap[1] = mHeap[mHeapSize--];
- DownHeap(1);
- j = mHeap[1];
- if (j < mN) {
- *mSortPtr++ = (UINT16)j;
- }
- k = Avail++;
- mFreq[k] = (UINT16)(mFreq[i] + mFreq[j]);
- mHeap[1] = (INT16)k;
- DownHeap(1);
- mLeft[k] = (UINT16)i;
- mRight[k] = (UINT16)j;
- } while (mHeapSize > 1);
-
- mSortPtr = CodeParm;
- MakeLen(k);
- MakeCode(NParm, LenParm, CodeParm);
-
- //
- // return root
- //
- return k;
-}
-
diff --git a/BaseTools/Source/C/Common/EfiUtilityMsgs.c b/BaseTools/Source/C/Common/EfiUtilityMsgs.c
deleted file mode 100644
index dc9b0ffaa2..0000000000
--- a/BaseTools/Source/C/Common/EfiUtilityMsgs.c
+++ /dev/null
@@ -1,914 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- EfiUtilityMsgs.c
-
-Abstract:
-
- EFI tools utility functions to display warning, error, and informational
- messages.
-
---*/
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <time.h>
-
-#include "EfiUtilityMsgs.h"
-
-//
-// Declare module globals for keeping track of the the utility's
-// name and other settings.
-//
-STATIC STATUS mStatus = STATUS_SUCCESS;
-STATIC CHAR8 mUtilityName[50] = { 0 };
-STATIC UINT64 mPrintLogLevel = INFO_LOG_LEVEL;
-STATIC CHAR8 *mSourceFileName = NULL;
-STATIC UINT32 mSourceFileLineNum = 0;
-STATIC UINT32 mErrorCount = 0;
-STATIC UINT32 mWarningCount = 0;
-STATIC UINT32 mMaxErrors = 0;
-STATIC UINT32 mMaxWarnings = 0;
-STATIC UINT32 mMaxWarningsPlusErrors = 0;
-STATIC INT8 mPrintLimitsSet = 0;
-
-STATIC
-VOID
-PrintLimitExceeded (
- VOID
- );
-
-VOID
-Error (
- CHAR8 *FileName,
- UINT32 LineNumber,
- UINT32 MessageCode,
- CHAR8 *Text,
- CHAR8 *MsgFmt,
- ...
- )
-/*++
-
-Routine Description:
- Prints an error message.
-
-Arguments:
- All arguments are optional, though the printed message may be useless if
- at least something valid is not specified.
-
- FileName - name of the file or application. If not specified, then the
- utilty name (as set by the utility calling SetUtilityName()
- earlier) is used. Otherwise "Unknown utility" is used.
-
- LineNumber - the line number of error, typically used by parsers. If the
- utility is not a parser, then 0 should be specified. Otherwise
- the FileName and LineNumber info can be used to cause
- MS Visual Studio to jump to the error.
-
- MessageCode - an application-specific error code that can be referenced in
- other documentation.
-
- Text - the text in question, typically used by parsers.
-
- MsgFmt - the format string for the error message. Can contain formatting
- controls for use with the varargs.
-
-Returns:
- None.
-
-Notes:
- We print the following (similar to the Warn() and Debug()
- W
- Typical error/warning message format:
-
- bin\VfrCompile.cpp(330) : error C2660: 'AddVfrDataStructField' : function does not take 2 parameters
-
- BUGBUG -- these three utility functions are almost identical, and
- should be modified to share code.
-
- Visual Studio does not find error messages with:
-
- " error :"
- " error 1:"
- " error c1:"
- " error 1000:"
- " error c100:"
-
- It does find:
- " error c1000:"
---*/
-{
- va_list List;
- //
- // If limits have been set, then check that we have not exceeded them
- //
- if (mPrintLimitsSet) {
- //
- // See if we've exceeded our total count
- //
- if (mMaxWarningsPlusErrors != 0) {
- if (mErrorCount + mWarningCount > mMaxWarningsPlusErrors) {
- PrintLimitExceeded ();
- return ;
- }
- }
- //
- // See if we've exceeded our error count
- //
- if (mMaxErrors != 0) {
- if (mErrorCount > mMaxErrors) {
- PrintLimitExceeded ();
- return ;
- }
- }
- }
-
- mErrorCount++;
- va_start (List, MsgFmt);
- PrintMessage ("ERROR", FileName, LineNumber, MessageCode, Text, MsgFmt, List);
- va_end (List);
-}
-
-VOID
-ParserError (
- UINT32 MessageCode,
- CHAR8 *Text,
- CHAR8 *MsgFmt,
- ...
- )
-/*++
-
-Routine Description:
- Print a parser error, using the source file name and line number
- set by a previous call to SetParserPosition().
-
-Arguments:
- MessageCode - application-specific error code
- Text - text to print in the error message
- MsgFmt - format string to print at the end of the error message
-
-Returns:
- NA
-
---*/
-{
- va_list List;
- //
- // If limits have been set, then check them
- //
- if (mPrintLimitsSet) {
- //
- // See if we've exceeded our total count
- //
- if (mMaxWarningsPlusErrors != 0) {
- if (mErrorCount + mWarningCount > mMaxWarningsPlusErrors) {
- PrintLimitExceeded ();
- return ;
- }
- }
- //
- // See if we've exceeded our error count
- //
- if (mMaxErrors != 0) {
- if (mErrorCount > mMaxErrors) {
- PrintLimitExceeded ();
- return ;
- }
- }
- }
-
- mErrorCount++;
- va_start (List, MsgFmt);
- PrintMessage ("ERROR", mSourceFileName, mSourceFileLineNum, MessageCode, Text, MsgFmt, List);
- va_end (List);
-}
-
-VOID
-ParserWarning (
- UINT32 ErrorCode,
- CHAR8 *OffendingText,
- CHAR8 *MsgFmt,
- ...
- )
-/*++
-
-Routine Description:
- Print a parser warning, using the source file name and line number
- set by a previous call to SetParserPosition().
-
-Arguments:
- ErrorCode - application-specific error code
- OffendingText - text to print in the warning message
- MsgFmt - format string to print at the end of the warning message
-
-Returns:
- NA
-
---*/
-{
- va_list List;
- //
- // If limits have been set, then check them
- //
- if (mPrintLimitsSet) {
- //
- // See if we've exceeded our total count
- //
- if (mMaxWarningsPlusErrors != 0) {
- if (mErrorCount + mWarningCount > mMaxWarningsPlusErrors) {
- PrintLimitExceeded ();
- return ;
- }
- }
- //
- // See if we've exceeded our warning count
- //
- if (mMaxWarnings != 0) {
- if (mWarningCount > mMaxWarnings) {
- PrintLimitExceeded ();
- return ;
- }
- }
- }
-
- mWarningCount++;
- va_start (List, MsgFmt);
- PrintMessage ("WARNING", mSourceFileName, mSourceFileLineNum, ErrorCode, OffendingText, MsgFmt, List);
- va_end (List);
- //
- // Don't set warning status accordingly
- //
- // if (mStatus < STATUS_WARNING) {
- // mStatus = STATUS_WARNING;
- // }
-}
-
-VOID
-Warning (
- CHAR8 *FileName,
- UINT32 LineNumber,
- UINT32 MessageCode,
- CHAR8 *Text,
- CHAR8 *MsgFmt,
- ...
- )
-/*++
-
-Routine Description:
- Print a warning message.
-
-Arguments:
- FileName - name of the file where the warning was detected, or the name
- of the application that detected the warning
-
- LineNumber - the line number where the warning was detected (parsers).
- 0 should be specified if the utility is not a parser.
-
- MessageCode - an application-specific warning code that can be referenced in
- other documentation.
-
- Text - the text in question (parsers)
-
- MsgFmt - the format string for the warning message. Can contain formatting
- controls for use with varargs.
-
-Returns:
- None.
-
---*/
-{
- va_list List;
-
- //
- // Current Print Level not output warning information.
- //
- if (WARNING_LOG_LEVEL < mPrintLogLevel) {
- return;
- }
- //
- // If limits have been set, then check them
- //
- if (mPrintLimitsSet) {
- //
- // See if we've exceeded our total count
- //
- if (mMaxWarningsPlusErrors != 0) {
- if (mErrorCount + mWarningCount > mMaxWarningsPlusErrors) {
- PrintLimitExceeded ();
- return ;
- }
- }
- //
- // See if we've exceeded our warning count
- //
- if (mMaxWarnings != 0) {
- if (mWarningCount > mMaxWarnings) {
- PrintLimitExceeded ();
- return ;
- }
- }
- }
-
- mWarningCount++;
- va_start (List, MsgFmt);
- PrintMessage ("WARNING", FileName, LineNumber, MessageCode, Text, MsgFmt, List);
- va_end (List);
-}
-
-VOID
-DebugMsg (
- CHAR8 *FileName,
- UINT32 LineNumber,
- UINT64 MsgLevel,
- CHAR8 *Text,
- CHAR8 *MsgFmt,
- ...
- )
-/*++
-
-Routine Description:
- Print a Debug message.
-
-Arguments:
- FileName - typically the name of the utility printing the debug message, but
- can be the name of a file being parsed.
-
- LineNumber - the line number in FileName (parsers)
-
- MsgLevel - Debug message print level (0~9)
-
- Text - the text in question (parsers)
-
- MsgFmt - the format string for the debug message. Can contain formatting
- controls for use with varargs.
-
-Returns:
- None.
-
---*/
-{
- va_list List;
- //
- // If the debug level is less than current print level, then do nothing.
- //
- if (MsgLevel < mPrintLogLevel) {
- return ;
- }
-
- va_start (List, MsgFmt);
- PrintMessage ("DEBUG", FileName, LineNumber, 0, Text, MsgFmt, List);
- va_end (List);
-}
-
-VOID
-PrintMessage (
- CHAR8 *Type,
- CHAR8 *FileName,
- UINT32 LineNumber,
- UINT32 MessageCode,
- CHAR8 *Text,
- CHAR8 *MsgFmt,
- va_list List
- )
-/*++
-
-Routine Description:
- Worker routine for all the utility printing services. Prints the message in
- a format that Visual Studio will find when scanning build outputs for
- errors or warnings.
-
-Arguments:
- Type - "warning" or "error" string to insert into the message to be
- printed. The first character of this string (converted to uppercase)
- is used to preceed the MessageCode value in the output string.
-
- FileName - name of the file where the warning was detected, or the name
- of the application that detected the warning
-
- LineNumber - the line number where the warning was detected (parsers).
- 0 should be specified if the utility is not a parser.
-
- MessageCode - an application-specific warning code that can be referenced in
- other documentation.
-
- Text - part of the message to print
-
- MsgFmt - the format string for the message. Can contain formatting
- controls for use with varargs.
- List - the variable list.
-
-Returns:
- None.
-
-Notes:
- If FileName == NULL then this utility will use the string passed into SetUtilityName().
-
- LineNumber is only used if the caller is a parser, in which case FileName refers to the
- file being parsed.
-
- Text and MsgFmt are both optional, though it would be of little use calling this function with
- them both NULL.
-
- Output will typically be of the form:
- <FileName>(<LineNumber>) : <Type> <Type[0]><MessageCode>: <Text> : <MsgFmt>
-
- Parser (LineNumber != 0)
- VfrCompile.cpp(330) : error E2660: AddVfrDataStructField : function does not take 2 parameters
- Generic utility (LineNumber == 0)
- UtilityName : error E1234 : Text string : MsgFmt string and args
-
---*/
-{
- CHAR8 Line[MAX_LINE_LEN];
- CHAR8 Line2[MAX_LINE_LEN];
- CHAR8 *Cptr;
- struct tm *NewTime;
- time_t CurrentTime;
-
- //
- // init local variable
- //
- Line[0] = '\0';
- Line2[0] = '\0';
-
- //
- // If given a filename, then add it (and the line number) to the string.
- // If there's no filename, then use the program name if provided.
- //
- if (FileName != NULL) {
- Cptr = FileName;
- } else {
- Cptr = NULL;
- }
-
- if (strcmp (Type, "DEBUG") == 0) {
- //
- // Debug Message requires current time.
- //
- time (&CurrentTime);
- NewTime = localtime (&CurrentTime);
- fprintf (stdout, "%04d-%02d-%02d %02d:%02d:%02d",
- NewTime->tm_year + 1900,
- NewTime->tm_mon + 1,
- NewTime->tm_mday,
- NewTime->tm_hour,
- NewTime->tm_min,
- NewTime->tm_sec
- );
- if (Cptr != NULL) {
- sprintf (Line, ": %s", Cptr);
- if (LineNumber != 0) {
- sprintf (Line2, "(%u)", (unsigned) LineNumber);
- strcat (Line, Line2);
- }
- }
- } else {
- //
- // Error and Warning Information.
- //
- if (Cptr != NULL) {
- if (mUtilityName[0] != '\0') {
- fprintf (stdout, "%s...\n", mUtilityName);
- }
- sprintf (Line, "%s", Cptr);
- if (LineNumber != 0) {
- sprintf (Line2, "(%u)", (unsigned) LineNumber);
- strcat (Line, Line2);
- }
- } else {
- if (mUtilityName[0] != '\0') {
- sprintf (Line, "%s", mUtilityName);
- }
- }
-
- if (strcmp (Type, "ERROR") == 0) {
- //
- // Set status accordingly for ERROR information.
- //
- if (mStatus < STATUS_ERROR) {
- mStatus = STATUS_ERROR;
- }
- }
- }
-
- //
- // Have to print an error code or Visual Studio won't find the
- // message for you. It has to be decimal digits too.
- //
- if (MessageCode != 0) {
- sprintf (Line2, ": %s %04u", Type, (unsigned) MessageCode);
- } else {
- sprintf (Line2, ": %s", Type);
- }
- strcat (Line, Line2);
- fprintf (stdout, "%s", Line);
- //
- // If offending text was provided, then print it
- //
- if (Text != NULL) {
- fprintf (stdout, ": %s", Text);
- }
- fprintf (stdout, "\n");
-
- //
- // Print formatted message if provided
- //
- if (MsgFmt != NULL) {
- vsprintf (Line2, MsgFmt, List);
- fprintf (stdout, " %s\n", Line2);
- }
-
-}
-
-STATIC
-VOID
-PrintSimpleMessage (
- CHAR8 *MsgFmt,
- va_list List
- )
-/*++
-Routine Description:
- Print message into stdout.
-
-Arguments:
- MsgFmt - the format string for the message. Can contain formatting
- controls for use with varargs.
- List - the variable list.
-
-Returns:
- None.
---*/
-{
- CHAR8 Line[MAX_LINE_LEN];
- //
- // Print formatted message if provided
- //
- if (MsgFmt != NULL) {
- vsprintf (Line, MsgFmt, List);
- fprintf (stdout, "%s\n", Line);
- }
-}
-
-VOID
-ParserSetPosition (
- CHAR8 *SourceFileName,
- UINT32 LineNum
- )
-/*++
-
-Routine Description:
- Set the position in a file being parsed. This can be used to
- print error messages deeper down in a parser.
-
-Arguments:
- SourceFileName - name of the source file being parsed
- LineNum - line number of the source file being parsed
-
-Returns:
- NA
-
---*/
-{
- mSourceFileName = SourceFileName;
- mSourceFileLineNum = LineNum;
-}
-
-VOID
-SetUtilityName (
- CHAR8 *UtilityName
- )
-/*++
-
-Routine Description:
- All printed error/warning/debug messages follow the same format, and
- typically will print a filename or utility name followed by the error
- text. However if a filename is not passed to the print routines, then
- they'll print the utility name if you call this function early in your
- app to set the utility name.
-
-Arguments:
- UtilityName - name of the utility, which will be printed with all
- error/warning/debug messags.
-
-Returns:
- NA
-
---*/
-{
- //
- // Save the name of the utility in our local variable. Make sure its
- // length does not exceed our buffer.
- //
- if (UtilityName != NULL) {
- if (strlen (UtilityName) >= sizeof (mUtilityName)) {
- Error (UtilityName, 0, 0, "application error", "utility name length exceeds internal buffer size");
- strncpy (mUtilityName, UtilityName, sizeof (mUtilityName) - 1);
- mUtilityName[sizeof (mUtilityName) - 1] = 0;
- return ;
- } else {
- strcpy (mUtilityName, UtilityName);
- }
- } else {
- Error (NULL, 0, 0, "application error", "SetUtilityName() called with NULL utility name");
- }
-}
-
-STATUS
-GetUtilityStatus (
- VOID
- )
-/*++
-
-Routine Description:
- When you call Error() or Warning(), this module keeps track of it and
- sets a local mStatus to STATUS_ERROR or STATUS_WARNING. When the utility
- exits, it can call this function to get the status and use it as a return
- value.
-
-Arguments:
- None.
-
-Returns:
- Worst-case status reported, as defined by which print function was called.
-
---*/
-{
- return mStatus;
-}
-
-VOID
-SetPrintLevel (
- UINT64 LogLevel
- )
-/*++
-
-Routine Description:
- Set the printing message Level. This is used by the PrintMsg() function
- to determine when/if a message should be printed.
-
-Arguments:
- LogLevel - 0~50 to specify the different level message.
-
-Returns:
- NA
-
---*/
-{
- mPrintLogLevel = LogLevel;
-}
-
-VOID
-VerboseMsg (
- CHAR8 *MsgFmt,
- ...
- )
-/*++
-
-Routine Description:
- Print a verbose level message.
-
-Arguments:
- MsgFmt - the format string for the message. Can contain formatting
- controls for use with varargs.
- List - the variable list.
-
-Returns:
- NA
-
---*/
-{
- va_list List;
- //
- // If the debug level is less than current print level, then do nothing.
- //
- if (VERBOSE_LOG_LEVEL < mPrintLogLevel) {
- return ;
- }
-
- va_start (List, MsgFmt);
- PrintSimpleMessage (MsgFmt, List);
- va_end (List);
-}
-
-VOID
-NormalMsg (
- CHAR8 *MsgFmt,
- ...
- )
-/*++
-
-Routine Description:
- Print a default level message.
-
-Arguments:
- MsgFmt - the format string for the message. Can contain formatting
- controls for use with varargs.
- List - the variable list.
-
-Returns:
- NA
-
---*/
-{
- va_list List;
- //
- // If the debug level is less than current print level, then do nothing.
- //
- if (INFO_LOG_LEVEL < mPrintLogLevel) {
- return ;
- }
-
- va_start (List, MsgFmt);
- PrintSimpleMessage (MsgFmt, List);
- va_end (List);
-}
-
-VOID
-KeyMsg (
- CHAR8 *MsgFmt,
- ...
- )
-/*++
-
-Routine Description:
- Print a key level message.
-
-Arguments:
- MsgFmt - the format string for the message. Can contain formatting
- controls for use with varargs.
- List - the variable list.
-
-Returns:
- NA
-
---*/
-{
- va_list List;
- //
- // If the debug level is less than current print level, then do nothing.
- //
- if (KEY_LOG_LEVEL < mPrintLogLevel) {
- return ;
- }
-
- va_start (List, MsgFmt);
- PrintSimpleMessage (MsgFmt, List);
- va_end (List);
-}
-
-VOID
-SetPrintLimits (
- UINT32 MaxErrors,
- UINT32 MaxWarnings,
- UINT32 MaxWarningsPlusErrors
- )
-/*++
-
-Routine Description:
- Set the limits of how many errors, warnings, and errors+warnings
- we will print.
-
-Arguments:
- MaxErrors - maximum number of error messages to print
- MaxWarnings - maximum number of warning messages to print
- MaxWarningsPlusErrors
- - maximum number of errors+warnings to print
-
-Returns:
- NA
-
---*/
-{
- mMaxErrors = MaxErrors;
- mMaxWarnings = MaxWarnings;
- mMaxWarningsPlusErrors = MaxWarningsPlusErrors;
- mPrintLimitsSet = 1;
-}
-
-STATIC
-VOID
-PrintLimitExceeded (
- VOID
- )
-{
- STATIC INT8 mPrintLimitExceeded = 0;
- //
- // If we've already printed the message, do nothing. Otherwise
- // temporarily increase our print limits so we can pass one
- // more message through.
- //
- if (mPrintLimitExceeded == 0) {
- mPrintLimitExceeded++;
- mMaxErrors++;
- mMaxWarnings++;
- mMaxWarningsPlusErrors++;
- Error (NULL, 0, 0, "error/warning print limit exceeded", NULL);
- mMaxErrors--;
- mMaxWarnings--;
- mMaxWarningsPlusErrors--;
- }
-}
-
-#if 0
-VOID
-TestUtilityMessages (
- VOID
- )
-{
- CHAR8 *ArgStr = "ArgString";
- int ArgInt;
-
- ArgInt = 0x12345678;
- //
- // Test without setting utility name
- //
- fprintf (stdout, "* Testing without setting utility name\n");
- fprintf (stdout, "** Test debug message not printed\n");
- DebugMsg (NULL, 0, 0x00000001, NULL, NULL);
- fprintf (stdout, "** Test warning with two strings and two args\n");
- Warning (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);
- fprintf (stdout, "** Test error with two strings and two args\n");
- Warning (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);
- fprintf (stdout, "** Test parser warning with nothing\n");
- ParserWarning (0, NULL, NULL);
- fprintf (stdout, "** Test parser error with nothing\n");
- ParserError (0, NULL, NULL);
- //
- // Test with utility name set now
- //
- fprintf (stdout, "** Testingin with utility name set\n");
- SetUtilityName ("MyUtilityName");
- //
- // Test debug prints
- //
- SetDebugMsgMask (2);
- fprintf (stdout, "** Test debug message with one string\n");
- DebugMsg (NULL, 0, 0x00000002, "Text1", NULL);
- fprintf (stdout, "** Test debug message with one string\n");
- DebugMsg (NULL, 0, 0x00000002, NULL, "Text2");
- fprintf (stdout, "** Test debug message with two strings\n");
- DebugMsg (NULL, 0, 0x00000002, "Text1", "Text2");
- fprintf (stdout, "** Test debug message with two strings and two args\n");
- DebugMsg (NULL, 0, 0x00000002, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);
- //
- // Test warning prints
- //
- fprintf (stdout, "** Test warning with no strings\n");
- Warning (NULL, 0, 1234, NULL, NULL);
- fprintf (stdout, "** Test warning with one string\n");
- Warning (NULL, 0, 1234, "Text1", NULL);
- fprintf (stdout, "** Test warning with one string\n");
- Warning (NULL, 0, 1234, NULL, "Text2");
- fprintf (stdout, "** Test warning with two strings and two args\n");
- Warning (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);
- //
- // Test error prints
- //
- fprintf (stdout, "** Test error with no strings\n");
- Error (NULL, 0, 1234, NULL, NULL);
- fprintf (stdout, "** Test error with one string\n");
- Error (NULL, 0, 1234, "Text1", NULL);
- fprintf (stdout, "** Test error with one string\n");
- Error (NULL, 0, 1234, NULL, "Text2");
- fprintf (stdout, "** Test error with two strings and two args\n");
- Error (NULL, 0, 1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);
- //
- // Test parser prints
- //
- fprintf (stdout, "** Test parser errors\n");
- ParserSetPosition (__FILE__, __LINE__ + 1);
- ParserError (1234, NULL, NULL);
- ParserSetPosition (__FILE__, __LINE__ + 1);
- ParserError (1234, "Text1", NULL);
- ParserSetPosition (__FILE__, __LINE__ + 1);
- ParserError (1234, NULL, "Text2");
- ParserSetPosition (__FILE__, __LINE__ + 1);
- ParserError (1234, "Text1", "Text2");
- ParserSetPosition (__FILE__, __LINE__ + 1);
- ParserError (1234, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);
-
- fprintf (stdout, "** Test parser warnings\n");
- ParserSetPosition (__FILE__, __LINE__ + 1);
- ParserWarning (4321, NULL, NULL);
- ParserSetPosition (__FILE__, __LINE__ + 1);
- ParserWarning (4321, "Text1", NULL);
- ParserSetPosition (__FILE__, __LINE__ + 1);
- ParserWarning (4321, NULL, "Text2");
- ParserSetPosition (__FILE__, __LINE__ + 1);
- ParserWarning (4321, "Text1", "Text2");
- ParserSetPosition (__FILE__, __LINE__ + 1);
- ParserWarning (4321, "Text1", "Text2 %s 0x%X", ArgStr, ArgInt);
-}
-#endif
diff --git a/BaseTools/Source/C/Common/EfiUtilityMsgs.h b/BaseTools/Source/C/Common/EfiUtilityMsgs.h
deleted file mode 100644
index 35cb1802fe..0000000000
--- a/BaseTools/Source/C/Common/EfiUtilityMsgs.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- EfiUtilityMsgs.h
-
-Abstract:
-
- Defines and prototypes for common EFI utility error and debug messages.
-
-**/
-
-#ifndef _EFI_UTILITY_MSGS_H_
-#define _EFI_UTILITY_MSGS_H_
-
-#include <Common/UefiBaseTypes.h>
-
-//
-// Log message print Level
-//
-#define VERBOSE_LOG_LEVEL 15
-#define WARNING_LOG_LEVEL 15
-#define INFO_LOG_LEVEL 20
-#define KEY_LOG_LEVEL 40
-#define ERROR_LOG_LEVLE 50
-
-//
-// Status codes returned by EFI utility programs and functions
-//
-#define STATUS_SUCCESS 0
-#define STATUS_WARNING 1
-#define STATUS_ERROR 2
-#define VOID void
-
-typedef int STATUS;
-
-#define MAX_LINE_LEN 0x200
-#define MAXIMUM_INPUT_FILE_NUM 10
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-//
-// When we call Error() or Warning(), the module keeps track of the worst
-// case reported. GetUtilityStatus() will get the worst-case results, which
-// can be used as the return value from the app.
-//
-STATUS
-GetUtilityStatus (
- VOID
- );
-
-//
-// If someone prints an error message and didn't specify a source file name,
-// then we print the utility name instead. However they must tell us the
-// utility name early on via this function.
-//
-VOID
-SetUtilityName (
- CHAR8 *ProgramName
- )
-;
-
-VOID
-PrintMessage (
- CHAR8 *Type,
- CHAR8 *FileName,
- UINT32 LineNumber,
- UINT32 MessageCode,
- CHAR8 *Text,
- CHAR8 *MsgFmt,
- va_list List
- );
-
-VOID
-Error (
- CHAR8 *FileName,
- UINT32 LineNumber,
- UINT32 ErrorCode,
- CHAR8 *OffendingText,
- CHAR8 *MsgFmt,
- ...
- )
-;
-
-VOID
-Warning (
- CHAR8 *FileName,
- UINT32 LineNumber,
- UINT32 WarningCode,
- CHAR8 *OffendingText,
- CHAR8 *MsgFmt,
- ...
- )
-;
-
-VOID
-DebugMsg (
- CHAR8 *FileName,
- UINT32 LineNumber,
- UINT64 MsgLevel,
- CHAR8 *OffendingText,
- CHAR8 *MsgFmt,
- ...
- )
-;
-
-VOID
-VerboseMsg (
- CHAR8 *MsgFmt,
- ...
- );
-
-VOID
-NormalMsg (
- CHAR8 *MsgFmt,
- ...
- );
-
-VOID
-KeyMsg (
- CHAR8 *MsgFmt,
- ...
- );
-
-VOID
-SetPrintLevel (
- UINT64 LogLevel
- );
-
-VOID
-ParserSetPosition (
- CHAR8 *SourceFileName,
- UINT32 LineNum
- )
-;
-
-VOID
-ParserError (
- UINT32 ErrorCode,
- CHAR8 *OffendingText,
- CHAR8 *MsgFmt,
- ...
- )
-;
-
-VOID
-ParserWarning (
- UINT32 ErrorCode,
- CHAR8 *OffendingText,
- CHAR8 *MsgFmt,
- ...
- )
-;
-
-VOID
-SetPrintLimits (
- UINT32 NumErrors,
- UINT32 NumWarnings,
- UINT32 NumWarningsPlusErrors
- )
-;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // #ifndef _EFI_UTILITY_MSGS_H_
diff --git a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
deleted file mode 100644
index 92060e2ca1..0000000000
--- a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
+++ /dev/null
@@ -1,1667 +0,0 @@
-/** @file
-
-Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- FirmwareVolumeBuffer.c
-
-Abstract:
-
- EFI Firmware Volume routines which work on a Fv image in buffers.
-
-**/
-
-#include "FirmwareVolumeBufferLib.h"
-#include "BinderFuncs.h"
-
-//
-// Local macros
-//
-#define EFI_TEST_FFS_ATTRIBUTES_BIT(FvbAttributes, TestAttributes, Bit) \
- ( \
- (BOOLEAN) ( \
- (FvbAttributes & EFI_FVB2_ERASE_POLARITY) ? (((~TestAttributes) & Bit) == Bit) : ((TestAttributes & Bit) == Bit) \
- ) \
- )
-
-
-//
-// Local prototypes
-//
-
-STATIC
-UINT16
-FvBufCalculateChecksum16 (
- IN UINT16 *Buffer,
- IN UINTN Size
- );
-
-STATIC
-UINT8
-FvBufCalculateChecksum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- );
-
-//
-// Procedures start
-//
-
-EFI_STATUS
-FvBufRemoveFileNew (
- IN OUT VOID *Fv,
- IN EFI_GUID *Name
- )
-/*++
-
-Routine Description:
-
- Clears out all files from the Fv buffer in memory
-
-Arguments:
-
- SourceFv - Address of the Fv in memory, this firmware volume volume will
- be modified, if SourceFfsFile exists
- SourceFfsFile - Input FFS file to replace
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
-
---*/
-{
- EFI_STATUS Status;
- EFI_FFS_FILE_HEADER* FileToRm;
- UINTN FileToRmLength;
-
- Status = FvBufFindFileByName(
- Fv,
- Name,
- (VOID **)&FileToRm
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- FileToRmLength = FvBufExpand3ByteSize (FileToRm->Size);
-
- CommonLibBinderSetMem (
- FileToRm,
- FileToRmLength,
- (((EFI_FIRMWARE_VOLUME_HEADER*)Fv)->Attributes & EFI_FVB2_ERASE_POLARITY)
- ? 0xFF : 0
- );
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-FvBufRemoveFile (
- IN OUT VOID *Fv,
- IN EFI_GUID *Name
- )
-/*++
-
-Routine Description:
-
- Clears out all files from the Fv buffer in memory
-
-Arguments:
-
- SourceFv - Address of the Fv in memory, this firmware volume volume will
- be modified, if SourceFfsFile exists
- SourceFfsFile - Input FFS file to replace
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
-
---*/
-{
- EFI_STATUS Status;
- EFI_FFS_FILE_HEADER *NextFile;
- EFI_FIRMWARE_VOLUME_HEADER *TempFv;
- UINTN FileKey;
- UINTN FvLength;
-
- Status = FvBufFindFileByName(
- Fv,
- Name,
- NULL
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = FvBufGetSize (Fv, &FvLength);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- TempFv = NULL;
- Status = FvBufDuplicate (Fv, (VOID **)&TempFv);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = FvBufClearAllFiles (TempFv);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- // TempFv has been allocated. It must now be freed
- // before returning.
-
- FileKey = 0;
- while (TRUE) {
-
- Status = FvBufFindNextFile (Fv, &FileKey, (VOID **)&NextFile);
- if (Status == EFI_NOT_FOUND) {
- break;
- } else if (EFI_ERROR (Status)) {
- CommonLibBinderFree (TempFv);
- return Status;
- }
-
- if (CommonLibBinderCompareGuid (Name, &NextFile->Name)) {
- continue;
- }
- else {
- Status = FvBufAddFile (TempFv, NextFile);
- if (EFI_ERROR (Status)) {
- CommonLibBinderFree (TempFv);
- return Status;
- }
- }
- }
-
- CommonLibBinderCopyMem (Fv, TempFv, FvLength);
- CommonLibBinderFree (TempFv);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-FvBufChecksumFile (
- IN OUT VOID *FfsFile
- )
-/*++
-
-Routine Description:
-
- Clears out all files from the Fv buffer in memory
-
-Arguments:
-
- SourceFfsFile - Input FFS file to update the checksum for
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
-
---*/
-{
- EFI_FFS_FILE_HEADER* File = (EFI_FFS_FILE_HEADER*)FfsFile;
- EFI_FFS_FILE_STATE StateBackup;
- UINT32 FileSize;
-
- FileSize = FvBufExpand3ByteSize (File->Size);
-
- //
- // Fill in checksums and state, they must be 0 for checksumming.
- //
- File->IntegrityCheck.Checksum.Header = 0;
- File->IntegrityCheck.Checksum.File = 0;
- StateBackup = File->State;
- File->State = 0;
-
- File->IntegrityCheck.Checksum.Header =
- FvBufCalculateChecksum8 (
- (UINT8 *) File,
- sizeof (EFI_FFS_FILE_HEADER)
- );
-
- if (File->Attributes & FFS_ATTRIB_CHECKSUM) {
- File->IntegrityCheck.Checksum.File = FvBufCalculateChecksum8 (
- (VOID*)(File + 1),
- FileSize - sizeof (EFI_FFS_FILE_HEADER)
- );
- } else {
- File->IntegrityCheck.Checksum.File = FFS_FIXED_CHECKSUM;
- }
-
- File->State = StateBackup;
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-FvBufChecksumHeader (
- IN OUT VOID *Fv
- )
-/*++
-
-Routine Description:
-
- Clears out all files from the Fv buffer in memory
-
-Arguments:
-
- SourceFv - Address of the Fv in memory, this firmware volume volume will
- be modified, if SourceFfsFile exists
- SourceFfsFile - Input FFS file to replace
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
-
---*/
-{
- EFI_FIRMWARE_VOLUME_HEADER* FvHeader = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
-
- FvHeader->Checksum = 0;
- FvHeader->Checksum =
- FvBufCalculateChecksum16 (
- (UINT16*) FvHeader,
- FvHeader->HeaderLength / sizeof (UINT16)
- );
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-FvBufDuplicate (
- IN VOID *SourceFv,
- IN OUT VOID **DestinationFv
- )
-/*++
-
-Routine Description:
-
- Clears out all files from the Fv buffer in memory
-
-Arguments:
-
- SourceFv - Address of the Fv in memory
- DestinationFv - Output for destination Fv
- DestinationFv == NULL - invalid parameter
- *DestinationFv == NULL - memory will be allocated
- *DestinationFv != NULL - this address will be the destination
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- EFI_STATUS Status;
- UINTN size;
-
- if (DestinationFv == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = FvBufGetSize (SourceFv, &size);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if (*DestinationFv == NULL) {
- *DestinationFv = CommonLibBinderAllocate (size);
- }
-
- CommonLibBinderCopyMem (*DestinationFv, SourceFv, size);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-FvBufExtend (
- IN VOID **Fv,
- IN UINTN Size
- )
-/*++
-
-Routine Description:
-
- Extends a firmware volume by the given number of bytes.
-
- BUGBUG: Does not handle the case where the firmware volume has a
- VTF (Volume Top File). The VTF will not be moved to the
- end of the extended FV.
-
-Arguments:
-
- Fv - Source and destination firmware volume.
- Note: The original firmware volume buffer is freed!
-
- Size - The minimum size that the firmware volume is to be extended by.
- The FV may be extended more than this size.
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- EFI_STATUS Status;
- UINTN OldSize;
- UINTN NewSize;
- UINTN BlockCount;
- VOID* NewFv;
-
- EFI_FIRMWARE_VOLUME_HEADER* hdr;
- EFI_FV_BLOCK_MAP_ENTRY* blk;
-
- Status = FvBufGetSize (*Fv, &OldSize);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Locate the block map in the fv header
- //
- hdr = (EFI_FIRMWARE_VOLUME_HEADER*)*Fv;
- blk = hdr->BlockMap;
-
- //
- // Calculate the number of blocks needed to achieve the requested
- // size extension
- //
- BlockCount = ((Size + (blk->Length - 1)) / blk->Length);
-
- //
- // Calculate the new size from the number of blocks that will be added
- //
- NewSize = OldSize + (BlockCount * blk->Length);
-
- NewFv = CommonLibBinderAllocate (NewSize);
- if (NewFv == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Copy the old data
- //
- CommonLibBinderCopyMem (NewFv, *Fv, OldSize);
-
- //
- // Free the old fv buffer
- //
- CommonLibBinderFree (*Fv);
-
- //
- // Locate the block map in the new fv header
- //
- hdr = (EFI_FIRMWARE_VOLUME_HEADER*)NewFv;
- hdr->FvLength = NewSize;
- blk = hdr->BlockMap;
-
- //
- // Update the block map for the new fv
- //
- blk->NumBlocks += (UINT32)BlockCount;
-
- //
- // Update the FV header checksum
- //
- FvBufChecksumHeader (NewFv);
-
- //
- // Clear out the new area of the FV
- //
- CommonLibBinderSetMem (
- (UINT8*)NewFv + OldSize,
- (NewSize - OldSize),
- (hdr->Attributes & EFI_FVB2_ERASE_POLARITY) ? 0xFF : 0
- );
-
- //
- // Set output with new fv that was created
- //
- *Fv = NewFv;
-
- return EFI_SUCCESS;
-
-}
-
-
-EFI_STATUS
-FvBufClearAllFiles (
- IN OUT VOID *Fv
- )
-/*++
-
-Routine Description:
-
- Clears out all files from the Fv buffer in memory
-
-Arguments:
-
- Fv - Address of the Fv in memory
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-
-{
- EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
- EFI_STATUS Status;
- UINTN size = 0;
-
- Status = FvBufGetSize (Fv, &size);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- CommonLibBinderSetMem(
- (UINT8*)hdr + hdr->HeaderLength,
- size - hdr->HeaderLength,
- (hdr->Attributes & EFI_FVB2_ERASE_POLARITY) ? 0xFF : 0
- );
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-FvBufGetSize (
- IN VOID *Fv,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
-
- Clears out all files from the Fv buffer in memory
-
-Arguments:
-
- Fv - Address of the Fv in memory
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-
-{
- EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
- EFI_FV_BLOCK_MAP_ENTRY *blk = hdr->BlockMap;
-
- *Size = 0;
-
- while (blk->Length != 0 || blk->NumBlocks != 0) {
- *Size = *Size + (blk->Length * blk->NumBlocks);
- if (*Size >= 0x40000000) {
- // If size is greater than 1GB, then assume it is corrupted
- return EFI_VOLUME_CORRUPTED;
- }
- blk++;
- }
-
- if (*Size == 0) {
- // If size is 0, then assume the volume is corrupted
- return EFI_VOLUME_CORRUPTED;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-FvBufAddFile (
- IN OUT VOID *Fv,
- IN VOID *File
- )
-/*++
-
-Routine Description:
-
- Adds a new FFS file
-
-Arguments:
-
- Fv - Address of the Fv in memory
- File - FFS file to add to Fv
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
-
- EFI_FFS_FILE_HEADER *fhdr = NULL;
- EFI_FVB_ATTRIBUTES_2 FvbAttributes;
- UINTN offset;
- UINTN fsize;
- UINTN newSize;
- UINTN clearLoop;
-
- EFI_STATUS Status;
- UINTN fvSize;
-
- Status = FvBufGetSize (Fv, &fvSize);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- FvbAttributes = hdr->Attributes;
- newSize = FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)File)->Size);
-
- for(
- offset = (UINTN)ALIGN_POINTER (hdr->HeaderLength, 8);
- offset + newSize <= fvSize;
- offset = (UINTN)ALIGN_POINTER (offset, 8)
- ) {
-
- fhdr = (EFI_FFS_FILE_HEADER*) ((UINT8*)hdr + offset);
-
- if (EFI_TEST_FFS_ATTRIBUTES_BIT(
- FvbAttributes,
- fhdr->State,
- EFI_FILE_HEADER_VALID
- )
- ) {
- // BUGBUG: Need to make sure that the new file does not already
- // exist.
-
- fsize = FvBufExpand3ByteSize (fhdr->Size);
- if (fsize == 0 || (offset + fsize > fvSize)) {
- return EFI_VOLUME_CORRUPTED;
- }
-
- offset = offset + fsize;
- continue;
- }
-
- clearLoop = 0;
- while ((clearLoop < newSize) &&
- (((UINT8*)fhdr)[clearLoop] ==
- (UINT8)((hdr->Attributes & EFI_FVB2_ERASE_POLARITY) ? 0xFF : 0)
- )
- ) {
- clearLoop++;
- }
-
- //
- // We found a place in the FV which is empty and big enough for
- // the new file
- //
- if (clearLoop >= newSize) {
- break;
- }
-
- offset = offset + 1; // Make some forward progress
- }
-
- if (offset + newSize > fvSize) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- CommonLibBinderCopyMem (fhdr, File, newSize);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-FvBufAddFileWithExtend (
- IN OUT VOID **Fv,
- IN VOID *File
- )
-/*++
-
-Routine Description:
-
- Adds a new FFS file. Extends the firmware volume if needed.
-
-Arguments:
-
- Fv - Source and destination firmware volume.
- Note: If the FV is extended, then the original firmware volume
- buffer is freed!
-
- Size - The minimum size that the firmware volume is to be extended by.
- The FV may be extended more than this size.
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- EFI_STATUS Status;
- EFI_FFS_FILE_HEADER* NewFile;
-
- NewFile = (EFI_FFS_FILE_HEADER*)File;
-
- //
- // Try to add to the capsule volume
- //
- Status = FvBufAddFile (*Fv, NewFile);
- if (Status == EFI_OUT_OF_RESOURCES) {
- //
- // Try to extend the capsule volume by the size of the file
- //
- Status = FvBufExtend (Fv, FvBufExpand3ByteSize (NewFile->Size));
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Now, try to add the file again
- //
- Status = FvBufAddFile (*Fv, NewFile);
- }
-
- return Status;
-}
-
-
-EFI_STATUS
-FvBufAddVtfFile (
- IN OUT VOID *Fv,
- IN VOID *File
- )
-/*++
-
-Routine Description:
-
- Adds a new FFS VFT (Volume Top File) file. In other words, adds the
- file to the end of the firmware volume.
-
-Arguments:
-
- Fv - Address of the Fv in memory
- File - FFS file to add to Fv
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- EFI_STATUS Status;
-
- EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
-
- EFI_FFS_FILE_HEADER* NewFile;
- UINTN NewFileSize;
-
- UINT8 erasedUint8;
- UINTN clearLoop;
-
- EFI_FFS_FILE_HEADER *LastFile;
- UINTN LastFileSize;
-
- UINTN fvSize;
- UINTN Key;
-
- Status = FvBufGetSize (Fv, &fvSize);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- erasedUint8 = (UINT8)((hdr->Attributes & EFI_FVB2_ERASE_POLARITY) ? 0xFF : 0);
- NewFileSize = FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)File)->Size);
-
- if (NewFileSize != (UINTN)ALIGN_POINTER (NewFileSize, 8)) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Find the last file in the FV
- //
- Key = 0;
- LastFile = NULL;
- LastFileSize = 0;
- do {
- Status = FvBufFindNextFile (Fv, &Key, (VOID **)&LastFile);
- LastFileSize = FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)File)->Size);
- } while (!EFI_ERROR (Status));
-
- //
- // If no files were found, then we start at the beginning of the FV
- //
- if (LastFile == NULL) {
- LastFile = (EFI_FFS_FILE_HEADER*)((UINT8*)hdr + hdr->HeaderLength);
- }
-
- //
- // We want to put the new file (VTF) at the end of the FV
- //
- NewFile = (EFI_FFS_FILE_HEADER*)((UINT8*)hdr + (fvSize - NewFileSize));
-
- //
- // Check to see if there is enough room for the VTF after the last file
- // found in the FV
- //
- if ((UINT8*)NewFile < ((UINT8*)LastFile + LastFileSize)) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Loop to determine if the end of the FV is empty
- //
- clearLoop = 0;
- while ((clearLoop < NewFileSize) &&
- (((UINT8*)NewFile)[clearLoop] == erasedUint8)
- ) {
- clearLoop++;
- }
-
- //
- // Check to see if there was not enough room for the file
- //
- if (clearLoop < NewFileSize) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- CommonLibBinderCopyMem (NewFile, File, NewFileSize);
-
- return EFI_SUCCESS;
-}
-
-
-VOID
-FvBufCompact3ByteSize (
- OUT VOID* SizeDest,
- IN UINT32 Size
- )
-/*++
-
-Routine Description:
-
- Expands the 3 byte size commonly used in Firmware Volume data structures
-
-Arguments:
-
- Size - Address of the 3 byte array representing the size
-
-Returns:
-
- UINT32
-
---*/
-{
- ((UINT8*)SizeDest)[0] = (UINT8)Size;
- ((UINT8*)SizeDest)[1] = (UINT8)(Size >> 8);
- ((UINT8*)SizeDest)[2] = (UINT8)(Size >> 16);
-}
-
-UINT32
-FvBufExpand3ByteSize (
- IN VOID* Size
- )
-/*++
-
-Routine Description:
-
- Expands the 3 byte size commonly used in Firmware Volume data structures
-
-Arguments:
-
- Size - Address of the 3 byte array representing the size
-
-Returns:
-
- UINT32
-
---*/
-{
- return (((UINT8*)Size)[2] << 16) +
- (((UINT8*)Size)[1] << 8) +
- ((UINT8*)Size)[0];
-}
-
-EFI_STATUS
-FvBufFindNextFile (
- IN VOID *Fv,
- IN OUT UINTN *Key,
- OUT VOID **File
- )
-/*++
-
-Routine Description:
-
- Iterates through the files contained within the firmware volume
-
-Arguments:
-
- Fv - Address of the Fv in memory
- Key - Should be 0 to get the first file. After that, it should be
- passed back in without modifying it's contents to retrieve
- subsequent files.
- File - Output file pointer
- File == NULL - invalid parameter
- otherwise - *File will be update to the location of the file
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
- EFI_VOLUME_CORRUPTED
-
---*/
-{
- EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
-
- EFI_FFS_FILE_HEADER *fhdr = NULL;
- EFI_FVB_ATTRIBUTES_2 FvbAttributes;
- UINTN fsize;
-
- EFI_STATUS Status;
- UINTN fvSize;
-
- if (Fv == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = FvBufGetSize (Fv, &fvSize);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if (*Key == 0) {
- *Key = hdr->HeaderLength;
- }
-
- FvbAttributes = hdr->Attributes;
-
- for(
- *Key = (UINTN)ALIGN_POINTER (*Key, 8);
- (*Key + sizeof (*fhdr)) < fvSize;
- *Key = (UINTN)ALIGN_POINTER (*Key, 8)
- ) {
-
- fhdr = (EFI_FFS_FILE_HEADER*) ((UINT8*)hdr + *Key);
- fsize = FvBufExpand3ByteSize (fhdr->Size);
-
- if (!EFI_TEST_FFS_ATTRIBUTES_BIT(
- FvbAttributes,
- fhdr->State,
- EFI_FILE_HEADER_VALID
- ) ||
- EFI_TEST_FFS_ATTRIBUTES_BIT(
- FvbAttributes,
- fhdr->State,
- EFI_FILE_HEADER_INVALID
- )
- ) {
- *Key = *Key + 1; // Make some forward progress
- continue;
- } else if(
- EFI_TEST_FFS_ATTRIBUTES_BIT(
- FvbAttributes,
- fhdr->State,
- EFI_FILE_MARKED_FOR_UPDATE
- ) ||
- EFI_TEST_FFS_ATTRIBUTES_BIT(
- FvbAttributes,
- fhdr->State,
- EFI_FILE_DELETED
- )
- ) {
- *Key = *Key + fsize;
- continue;
- } else if (EFI_TEST_FFS_ATTRIBUTES_BIT(
- FvbAttributes,
- fhdr->State,
- EFI_FILE_DATA_VALID
- )
- ) {
- *File = (UINT8*)hdr + *Key;
- *Key = *Key + fsize;
- return EFI_SUCCESS;
- }
-
- *Key = *Key + 1; // Make some forward progress
- }
-
- return EFI_NOT_FOUND;
-}
-
-
-EFI_STATUS
-FvBufFindFileByName (
- IN VOID *Fv,
- IN EFI_GUID *Name,
- OUT VOID **File
- )
-/*++
-
-Routine Description:
-
- Searches the Fv for a file by its name
-
-Arguments:
-
- Fv - Address of the Fv in memory
- Name - Guid filename to search for in the firmware volume
- File - Output file pointer
- File == NULL - Only determine if the file exists, based on return
- value from the function call.
- otherwise - *File will be update to the location of the file
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
- EFI_VOLUME_CORRUPTED
-
---*/
-{
- EFI_STATUS Status;
- UINTN Key;
- EFI_FFS_FILE_HEADER *NextFile;
-
- Key = 0;
- while (TRUE) {
- Status = FvBufFindNextFile (Fv, &Key, (VOID **)&NextFile);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if (CommonLibBinderCompareGuid (Name, &NextFile->Name)) {
- if (File != NULL) {
- *File = NextFile;
- }
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-
-EFI_STATUS
-FvBufFindFileByType (
- IN VOID *Fv,
- IN EFI_FV_FILETYPE Type,
- OUT VOID **File
- )
-/*++
-
-Routine Description:
-
- Searches the Fv for a file by its type
-
-Arguments:
-
- Fv - Address of the Fv in memory
- Type - FFS FILE type to search for
- File - Output file pointer
- (File == NULL) -> Only determine if the file exists, based on return
- value from the function call.
- otherwise -> *File will be update to the location of the file
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
- EFI_VOLUME_CORRUPTED
-
---*/
-{
- EFI_STATUS Status;
- UINTN Key;
- EFI_FFS_FILE_HEADER *NextFile;
-
- Key = 0;
- while (TRUE) {
- Status = FvBufFindNextFile (Fv, &Key, (VOID **)&NextFile);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if (Type == NextFile->Type) {
- if (File != NULL) {
- *File = NextFile;
- }
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-
-EFI_STATUS
-FvBufGetFileRawData (
- IN VOID* FfsFile,
- OUT VOID** RawData,
- OUT UINTN* RawDataSize
- )
-/*++
-
-Routine Description:
-
- Searches the requested file for raw data.
-
- This routine either returns all the payload of a EFI_FV_FILETYPE_RAW file,
- or finds the EFI_SECTION_RAW section within the file and returns its data.
-
-Arguments:
-
- FfsFile - Address of the FFS file in memory
- RawData - Pointer to the raw data within the file
- (This is NOT allocated. It is within the file.)
- RawDataSize - Size of the raw data within the file
-
-Returns:
-
- EFI_STATUS
-
---*/
-{
- EFI_STATUS Status;
- EFI_FFS_FILE_HEADER* File;
- EFI_RAW_SECTION* Section;
-
- File = (EFI_FFS_FILE_HEADER*)FfsFile;
-
- //
- // Is the file type == EFI_FV_FILETYPE_RAW?
- //
- if (File->Type == EFI_FV_FILETYPE_RAW) {
- //
- // Raw filetypes don't have sections, so we just return the raw data
- //
- *RawData = (VOID*)(File + 1);
- *RawDataSize = FvBufExpand3ByteSize (File->Size) - sizeof (*File);
- return EFI_SUCCESS;
- }
-
- //
- // Within the file, we now need to find the EFI_SECTION_RAW section.
- //
- Status = FvBufFindSectionByType (File, EFI_SECTION_RAW, (VOID **)&Section);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- *RawData = (VOID*)(Section + 1);
- *RawDataSize =
- FvBufExpand3ByteSize (Section->Size) - sizeof (*Section);
-
- return EFI_SUCCESS;
-
-}
-
-
-EFI_STATUS
-FvBufPackageFreeformRawFile (
- IN EFI_GUID* Filename,
- IN VOID* RawData,
- IN UINTN RawDataSize,
- OUT VOID** FfsFile
- )
-/*++
-
-Routine Description:
-
- Packages up a FFS file containing the input raw data.
-
- The file created will have a type of EFI_FV_FILETYPE_FREEFORM, and will
- contain one EFI_FV_FILETYPE_RAW section.
-
-Arguments:
-
- RawData - Pointer to the raw data to be packed
- RawDataSize - Size of the raw data to be packed
- FfsFile - Address of the packaged FFS file.
- Note: The called must deallocate this memory!
-
-Returns:
-
- EFI_STATUS
-
---*/
-{
- EFI_FFS_FILE_HEADER* NewFile;
- UINT32 NewFileSize;
- EFI_RAW_SECTION* NewSection;
- UINT32 NewSectionSize;
-
- //
- // The section size is the DataSize + the size of the section header
- //
- NewSectionSize = (UINT32)sizeof (EFI_RAW_SECTION) + (UINT32)RawDataSize;
-
- //
- // The file size is the size of the file header + the section size
- //
- NewFileSize = sizeof (EFI_FFS_FILE_HEADER) + NewSectionSize;
-
- //
- // Try to allocate a buffer to build the new FFS file in
- //
- NewFile = CommonLibBinderAllocate (NewFileSize);
- if (NewFile == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- CommonLibBinderSetMem (NewFile, NewFileSize, 0);
-
- //
- // The NewSection follow right after the FFS file header
- //
- NewSection = (EFI_RAW_SECTION*)(NewFile + 1);
- FvBufCompact3ByteSize (NewSection->Size, NewSectionSize);
- NewSection->Type = EFI_SECTION_RAW;
-
- //
- // Copy the actual file data into the buffer
- //
- CommonLibBinderCopyMem (NewSection + 1, RawData, RawDataSize);
-
- //
- // Initialize the FFS file header
- //
- CommonLibBinderCopyMem (&NewFile->Name, Filename, sizeof (EFI_GUID));
- FvBufCompact3ByteSize (NewFile->Size, NewFileSize);
- NewFile->Type = EFI_FV_FILETYPE_FREEFORM;
- NewFile->Attributes = 0;
- NewFile->IntegrityCheck.Checksum.Header =
- FvBufCalculateChecksum8 ((UINT8*)NewFile, sizeof (*NewFile));
- NewFile->IntegrityCheck.Checksum.File = FFS_FIXED_CHECKSUM;
- NewFile->State = (UINT8)~( EFI_FILE_HEADER_CONSTRUCTION |
- EFI_FILE_HEADER_VALID |
- EFI_FILE_DATA_VALID
- );
-
- *FfsFile = NewFile;
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-FvBufFindNextSection (
- IN VOID *SectionsStart,
- IN UINTN TotalSectionsSize,
- IN OUT UINTN *Key,
- OUT VOID **Section
- )
-/*++
-
-Routine Description:
-
- Iterates through the sections contained within a given array of sections
-
-Arguments:
-
- SectionsStart - Address of the start of the FFS sections array
- TotalSectionsSize - Total size of all the sections
- Key - Should be 0 to get the first section. After that, it should be
- passed back in without modifying it's contents to retrieve
- subsequent files.
- Section - Output section pointer
- (Section == NULL) -> invalid parameter
- otherwise -> *Section will be update to the location of the file
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
- EFI_VOLUME_CORRUPTED
-
---*/
-{
- EFI_COMMON_SECTION_HEADER *sectionHdr;
- UINTN sectionSize;
-
- *Key = (UINTN)ALIGN_POINTER (*Key, 4); // Sections are DWORD aligned
-
- if ((*Key + sizeof (*sectionHdr)) > TotalSectionsSize) {
- return EFI_NOT_FOUND;
- }
-
- sectionHdr = (EFI_COMMON_SECTION_HEADER*)((UINT8*)SectionsStart + *Key);
- sectionSize = FvBufExpand3ByteSize (sectionHdr->Size);
-
- if (sectionSize < sizeof (EFI_COMMON_SECTION_HEADER)) {
- return EFI_NOT_FOUND;
- }
-
- if ((*Key + sectionSize) > TotalSectionsSize) {
- return EFI_NOT_FOUND;
- }
-
- *Section = (UINT8*)sectionHdr;
- *Key = *Key + sectionSize;
- return EFI_SUCCESS;
-
-}
-
-
-EFI_STATUS
-FvBufCountSections (
- IN VOID* FfsFile,
- IN UINTN* Count
- )
-/*++
-
-Routine Description:
-
- Searches the FFS file and counts the number of sections found.
- The sections are NOT recursed.
-
-Arguments:
-
- FfsFile - Address of the FFS file in memory
- Count - The location to store the section count in
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
- EFI_VOLUME_CORRUPTED
-
---*/
-{
- EFI_STATUS Status;
- UINTN Key;
- VOID* SectionStart;
- UINTN TotalSectionsSize;
- EFI_COMMON_SECTION_HEADER* NextSection;
-
- SectionStart = (VOID*)((UINTN)FfsFile + sizeof (EFI_FFS_FILE_HEADER));
- TotalSectionsSize =
- FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)FfsFile)->Size) -
- sizeof (EFI_FFS_FILE_HEADER);
- Key = 0;
- *Count = 0;
- while (TRUE) {
- Status = FvBufFindNextSection (
- SectionStart,
- TotalSectionsSize,
- &Key,
- (VOID **)&NextSection
- );
- if (Status == EFI_NOT_FOUND) {
- return EFI_SUCCESS;
- } else if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Increment the section counter
- //
- *Count += 1;
-
- }
-
- return EFI_NOT_FOUND;
-}
-
-
-EFI_STATUS
-FvBufFindSectionByType (
- IN VOID *FfsFile,
- IN UINT8 Type,
- OUT VOID **Section
- )
-/*++
-
-Routine Description:
-
- Searches the FFS file for a section by its type
-
-Arguments:
-
- FfsFile - Address of the FFS file in memory
- Type - FFS FILE section type to search for
- Section - Output section pointer
- (Section == NULL) -> Only determine if the section exists, based on return
- value from the function call.
- otherwise -> *Section will be update to the location of the file
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
- EFI_VOLUME_CORRUPTED
-
---*/
-{
- EFI_STATUS Status;
- UINTN Key;
- VOID* SectionStart;
- UINTN TotalSectionsSize;
- EFI_COMMON_SECTION_HEADER* NextSection;
-
- SectionStart = (VOID*)((UINTN)FfsFile + sizeof (EFI_FFS_FILE_HEADER));
- TotalSectionsSize =
- FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)FfsFile)->Size) -
- sizeof (EFI_FFS_FILE_HEADER);
- Key = 0;
- while (TRUE) {
- Status = FvBufFindNextSection (
- SectionStart,
- TotalSectionsSize,
- &Key,
- (VOID **)&NextSection
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if (Type == NextSection->Type) {
- if (Section != NULL) {
- *Section = NextSection;
- }
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-
-EFI_STATUS
-FvBufShrinkWrap (
- IN VOID *Fv
- )
-/*++
-
-Routine Description:
-
- Shrinks a firmware volume (in place) to provide a minimal FV.
-
- BUGBUG: Does not handle the case where the firmware volume has a
- VTF (Volume Top File). The VTF will not be moved to the
- end of the extended FV.
-
-Arguments:
-
- Fv - Firmware volume.
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- EFI_STATUS Status;
- UINTN OldSize;
- UINT32 BlockCount;
- UINT32 NewBlockSize = 128;
- UINTN Key;
- EFI_FFS_FILE_HEADER* FileIt;
- VOID* EndOfLastFile;
-
- EFI_FIRMWARE_VOLUME_HEADER* FvHdr;
-
- Status = FvBufGetSize (Fv, &OldSize);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = FvBufUnifyBlockSizes (Fv, NewBlockSize);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Locate the block map in the fv header
- //
- FvHdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
-
- //
- // Find the end of the last file
- //
- Key = 0;
- EndOfLastFile = (UINT8*)FvHdr + FvHdr->FvLength;
- while (!EFI_ERROR (FvBufFindNextFile (Fv, &Key, (VOID **)&FileIt))) {
- EndOfLastFile =
- (VOID*)((UINT8*)FileIt + FvBufExpand3ByteSize (FileIt->Size));
- }
-
- //
- // Set the BlockCount to have the minimal number of blocks for the Fv.
- //
- BlockCount = (UINT32)((UINTN)EndOfLastFile - (UINTN)Fv);
- BlockCount = BlockCount + NewBlockSize - 1;
- BlockCount = BlockCount / NewBlockSize;
-
- //
- // Adjust the block count to shrink the Fv in place.
- //
- FvHdr->BlockMap[0].NumBlocks = BlockCount;
- FvHdr->FvLength = BlockCount * NewBlockSize;
-
- //
- // Update the FV header checksum
- //
- FvBufChecksumHeader (Fv);
-
- return EFI_SUCCESS;
-
-}
-
-
-EFI_STATUS
-FvBufUnifyBlockSizes (
- IN OUT VOID *Fv,
- IN UINTN BlockSize
- )
-/*++
-
-Routine Description:
-
- Searches the FFS file for a section by its type
-
-Arguments:
-
- Fv - Address of the Fv in memory
- BlockSize - The size of the blocks to convert the Fv to. If the total size
- of the Fv is not evenly divisible by this size, then
- EFI_INVALID_PARAMETER will be returned.
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_FOUND
- EFI_VOLUME_CORRUPTED
-
---*/
-{
- EFI_FIRMWARE_VOLUME_HEADER *hdr = (EFI_FIRMWARE_VOLUME_HEADER*)Fv;
- EFI_FV_BLOCK_MAP_ENTRY *blk = hdr->BlockMap;
- UINT32 Size;
-
- Size = 0;
-
- //
- // Scan through the block map list, performing error checking, and adding
- // up the total Fv size.
- //
- while( blk->Length != 0 ||
- blk->NumBlocks != 0
- ) {
- Size = Size + (blk->Length * blk->NumBlocks);
- blk++;
- if ((UINT8*)blk > ((UINT8*)hdr + hdr->HeaderLength)) {
- return EFI_VOLUME_CORRUPTED;
- }
- }
-
- //
- // Make sure that the Fv size is a multiple of the new block size.
- //
- if ((Size % BlockSize) != 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Zero out the entire block map.
- //
- CommonLibBinderSetMem (
- &hdr->BlockMap,
- (UINTN)blk - (UINTN)&hdr->BlockMap,
- 0
- );
-
- //
- // Write out the single block map entry.
- //
- hdr->BlockMap[0].Length = (UINT32)BlockSize;
- hdr->BlockMap[0].NumBlocks = Size / (UINT32)BlockSize;
-
- return EFI_SUCCESS;
-}
-
-STATIC
-UINT16
-FvBufCalculateSum16 (
- IN UINT16 *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description:
-
- This function calculates the UINT16 sum for the requested region.
-
-Arguments:
-
- Buffer Pointer to buffer containing byte data of component.
- Size Size of the buffer
-
-Returns:
-
- The 16 bit checksum
-
---*/
-{
- UINTN Index;
- UINT16 Sum;
-
- Sum = 0;
-
- //
- // Perform the word sum for buffer
- //
- for (Index = 0; Index < Size; Index++) {
- Sum = (UINT16) (Sum + Buffer[Index]);
- }
-
- return (UINT16) Sum;
-}
-
-
-STATIC
-UINT16
-FvBufCalculateChecksum16 (
- IN UINT16 *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description::
-
- This function calculates the value needed for a valid UINT16 checksum
-
-Arguments:
-
- Buffer Pointer to buffer containing byte data of component.
- Size Size of the buffer
-
-Returns:
-
- The 16 bit checksum value needed.
-
---*/
-{
- return (UINT16)(0x10000 - FvBufCalculateSum16 (Buffer, Size));
-}
-
-
-STATIC
-UINT8
-FvBufCalculateSum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-/*++
-
-Description:
-
- This function calculates the UINT8 sum for the requested region.
-
-Input:
-
- Buffer Pointer to buffer containing byte data of component.
- Size Size of the buffer
-
-Return:
-
- The 8 bit checksum value needed.
-
---*/
-{
- UINTN Index;
- UINT8 Sum;
-
- Sum = 0;
-
- //
- // Perform the byte sum for buffer
- //
- for (Index = 0; Index < Size; Index++) {
- Sum = (UINT8) (Sum + Buffer[Index]);
- }
-
- return Sum;
-}
-
-
-STATIC
-UINT8
-FvBufCalculateChecksum8 (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-/*++
-
-Description:
-
- This function calculates the value needed for a valid UINT8 checksum
-
-Input:
-
- Buffer Pointer to buffer containing byte data of component.
- Size Size of the buffer
-
-Return:
-
- The 8 bit checksum value needed.
-
---*/
-{
- return (UINT8)(0x100 - FvBufCalculateSum8 (Buffer, Size));
-}
-
-
diff --git a/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h b/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h
deleted file mode 100644
index 12c64f6172..0000000000
--- a/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/** @file
-
-Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- FirmwareVolumeBufferLib.h
-
-Abstract:
-
- EFI Firmware Volume routines which work on a Fv image in buffers.
-
-**/
-
-#ifndef FirmwareVolumeBuffer_h_INCLUDED
-#define FirmwareVolumeBuffer_h_INCLUDED
-
-#include "Common/UefiBaseTypes.h"
-#include "Common/PiFirmwareFile.h"
-#include "Common/PiFirmwareVolume.h"
-
-EFI_STATUS
-FvBufAddFile (
- IN OUT VOID *Fv,
- IN VOID *File
- );
-
-EFI_STATUS
-FvBufAddFileWithExtend (
- IN OUT VOID **Fv,
- IN VOID *File
- );
-
-EFI_STATUS
-FvBufAddVtfFile (
- IN OUT VOID *Fv,
- IN VOID *File
- );
-
-EFI_STATUS
-FvBufChecksumFile (
- IN OUT VOID *FfsFile
- );
-
-EFI_STATUS
-FvBufChecksumHeader (
- IN OUT VOID *Fv
- );
-
-EFI_STATUS
-FvBufClearAllFiles (
- IN OUT VOID *Fv
- );
-
-VOID
-FvBufCompact3ByteSize (
- OUT VOID* SizeDest,
- IN UINT32 Size
- );
-
-EFI_STATUS
-FvBufCountSections (
- IN VOID* FfsFile,
- IN UINTN* Count
- );
-
-EFI_STATUS
-FvBufDuplicate (
- IN VOID *SourceFv,
- IN OUT VOID **DestinationFv
- );
-
-UINT32
-FvBufExpand3ByteSize (
- IN VOID* Size
- );
-
-EFI_STATUS
-FvBufExtend (
- IN VOID **Fv,
- IN UINTN Size
- );
-
-EFI_STATUS
-FvBufFindFileByName (
- IN VOID *Fv,
- IN EFI_GUID *Name,
- OUT VOID **File
- );
-
-EFI_STATUS
-FvBufFindFileByType (
- IN VOID *Fv,
- IN EFI_FV_FILETYPE Type,
- OUT VOID **File
- );
-
-EFI_STATUS
-FvBufFindNextFile (
- IN VOID *Fv,
- IN OUT UINTN *Key,
- OUT VOID **File
- );
-
-EFI_STATUS
-FvBufFindNextSection (
- IN VOID *SectionsStart,
- IN UINTN TotalSectionsSize,
- IN OUT UINTN *Key,
- OUT VOID **Section
- );
-
-EFI_STATUS
-FvBufFindSectionByType (
- IN VOID *FfsFile,
- IN UINT8 Type,
- OUT VOID **Section
- );
-
-EFI_STATUS
-FvBufGetFileRawData (
- IN VOID* FfsFile,
- OUT VOID** RawData,
- OUT UINTN* RawDataSize
- );
-
-EFI_STATUS
-FvBufGetSize (
- IN VOID *Fv,
- OUT UINTN *Size
- );
-
-EFI_STATUS
-FvBufPackageFreeformRawFile (
- IN EFI_GUID* Filename,
- IN VOID* RawData,
- IN UINTN RawDataSize,
- OUT VOID** FfsFile
- );
-
-EFI_STATUS
-FvBufRemoveFile (
- IN OUT VOID *Fv,
- IN EFI_GUID *Name
- );
-
-EFI_STATUS
-FvBufUnifyBlockSizes (
- IN OUT VOID *Fv,
- IN UINTN BlockSize
- );
-
-EFI_STATUS
-FvBufShrinkWrap (
- IN VOID *Fv
- );
-
-#endif // #ifndef FirmwareVolumeBuffer_h_INCLUDED
-
diff --git a/BaseTools/Source/C/Common/FvLib.c b/BaseTools/Source/C/Common/FvLib.c
deleted file mode 100644
index 1b289d83cd..0000000000
--- a/BaseTools/Source/C/Common/FvLib.c
+++ /dev/null
@@ -1,851 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- FvLib.c
-
-Abstract:
-
- These functions assist in parsing and manipulating a Firmware Volume.
-
-**/
-
-//
-// Include files
-//
-#include "FvLib.h"
-#include "CommonLib.h"
-#include "EfiUtilityMsgs.h"
-
-//
-// Module global variables
-//
-EFI_FIRMWARE_VOLUME_HEADER *mFvHeader = NULL;
-UINT32 mFvLength = 0;
-
-//
-// External function implementations
-//
-EFI_STATUS
-InitializeFvLib (
- IN VOID *Fv,
- IN UINT32 FvLength
- )
-/*++
-
-Routine Description:
-
- This initializes the FV lib with a pointer to the FV and length. It does not
- verify the FV in any way.
-
-Arguments:
-
- Fv Buffer containing the FV.
- FvLength Length of the FV
-
-Returns:
-
- EFI_SUCCESS Function Completed successfully.
- EFI_INVALID_PARAMETER A required parameter was NULL.
-
---*/
-{
- //
- // Verify input arguments
- //
- if (Fv == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- mFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) Fv;
- mFvLength = FvLength;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetFvHeader (
- OUT EFI_FIRMWARE_VOLUME_HEADER **FvHeader,
- OUT UINT32 *FvLength
- )
-/*++
-
-Routine Description:
-
- This function returns a pointer to the current FV and the size.
-
-Arguments:
-
- FvHeader Pointer to the FV buffer.
- FvLength Length of the FV
-
-Returns:
-
- EFI_SUCCESS Function Completed successfully.
- EFI_INVALID_PARAMETER A required parameter was NULL.
- EFI_ABORTED The library needs to be initialized.
-
---*/
-{
- //
- // Verify library has been initialized.
- //
- if (mFvHeader == NULL || mFvLength == 0) {
- return EFI_ABORTED;
- }
- //
- // Verify input arguments
- //
- if (FvHeader == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- *FvHeader = mFvHeader;
- *FvLength = mFvLength;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetNextFile (
- IN EFI_FFS_FILE_HEADER *CurrentFile,
- OUT EFI_FFS_FILE_HEADER **NextFile
- )
-/*++
-
-Routine Description:
-
- This function returns the next file. If the current file is NULL, it returns
- the first file in the FV. If the function returns EFI_SUCCESS and the file
- pointer is NULL, then there are no more files in the FV.
-
-Arguments:
-
- CurrentFile Pointer to the current file, must be within the current FV.
- NextFile Pointer to the next file in the FV.
-
-Returns:
-
- EFI_SUCCESS Function completed successfully.
- EFI_INVALID_PARAMETER A required parameter was NULL or is out of range.
- EFI_ABORTED The library needs to be initialized.
-
---*/
-{
- EFI_STATUS Status;
-
- //
- // Verify library has been initialized.
- //
- if (mFvHeader == NULL || mFvLength == 0) {
- return EFI_ABORTED;
- }
- //
- // Verify input arguments
- //
- if (NextFile == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Verify FV header
- //
- Status = VerifyFv (mFvHeader);
- if (EFI_ERROR (Status)) {
- return EFI_ABORTED;
- }
- //
- // Get first file
- //
- if (CurrentFile == NULL) {
- CurrentFile = (EFI_FFS_FILE_HEADER *) ((UINTN) mFvHeader + mFvHeader->HeaderLength);
-
- //
- // Verify file is valid
- //
- Status = VerifyFfsFile (CurrentFile);
- if (EFI_ERROR (Status)) {
- //
- // no files in this FV
- //
- *NextFile = NULL;
- return EFI_SUCCESS;
- } else {
- //
- // Verify file is in this FV.
- //
- if ((UINTN) CurrentFile + GetLength (CurrentFile->Size) > (UINTN) mFvHeader + mFvLength) {
- *NextFile = NULL;
- return EFI_SUCCESS;
- }
-
- *NextFile = CurrentFile;
- return EFI_SUCCESS;
- }
- }
- //
- // Verify current file is in range
- //
- if (((UINTN) CurrentFile < (UINTN) mFvHeader + mFvHeader->HeaderLength) ||
- ((UINTN) CurrentFile + GetLength (CurrentFile->Size) > (UINTN) mFvHeader + mFvLength)
- ) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Get next file, compensate for 8 byte alignment if necessary.
- //
- *NextFile = (EFI_FFS_FILE_HEADER *) ((((UINTN) CurrentFile - (UINTN) mFvHeader + GetLength (CurrentFile->Size) + 0x07) & (-1 << 3)) + (UINT8 *) mFvHeader);
-
- //
- // Verify file is in this FV.
- //
- if (((UINTN) *NextFile + sizeof (EFI_FFS_FILE_HEADER) >= (UINTN) mFvHeader + mFvLength) ||
- ((UINTN) *NextFile + GetLength ((*NextFile)->Size) > (UINTN) mFvHeader + mFvLength)
- ) {
- *NextFile = NULL;
- return EFI_SUCCESS;
- }
- //
- // Verify file is valid
- //
- Status = VerifyFfsFile (*NextFile);
- if (EFI_ERROR (Status)) {
- //
- // no more files in this FV
- //
- *NextFile = NULL;
- return EFI_SUCCESS;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetFileByName (
- IN EFI_GUID *FileName,
- OUT EFI_FFS_FILE_HEADER **File
- )
-/*++
-
-Routine Description:
-
- Find a file by name. The function will return NULL if the file is not found.
-
-Arguments:
-
- FileName The GUID file name of the file to search for.
- File Return pointer. In the case of an error, contents are undefined.
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_ABORTED An error was encountered.
- EFI_INVALID_PARAMETER One of the parameters was NULL.
-
---*/
-{
- EFI_FFS_FILE_HEADER *CurrentFile;
- EFI_STATUS Status;
- CHAR8 FileGuidString[80];
-
- //
- // Verify library has been initialized.
- //
- if (mFvHeader == NULL || mFvLength == 0) {
- return EFI_ABORTED;
- }
- //
- // Verify input parameters
- //
- if (FileName == NULL || File == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // File Guid String Name
- //
- PrintGuidToBuffer (FileName, (UINT8 *)FileGuidString, sizeof (FileGuidString), TRUE);
- //
- // Verify FV header
- //
- Status = VerifyFv (mFvHeader);
- if (EFI_ERROR (Status)) {
- return EFI_ABORTED;
- }
- //
- // Get the first file
- //
- Status = GetNextFile (NULL, &CurrentFile);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "error parsing FV image", "FFS file with Guid %s can't be found", FileGuidString);
- return EFI_ABORTED;
- }
- //
- // Loop as long as we have a valid file
- //
- while (CurrentFile) {
- if (!CompareGuid (&CurrentFile->Name, FileName)) {
- *File = CurrentFile;
- return EFI_SUCCESS;
- }
-
- Status = GetNextFile (CurrentFile, &CurrentFile);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "error parsing FV image", "FFS file with Guid %s can't be found", FileGuidString);
- return EFI_ABORTED;
- }
- }
- //
- // File not found in this FV.
- //
- *File = NULL;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetFileByType (
- IN EFI_FV_FILETYPE FileType,
- IN UINTN Instance,
- OUT EFI_FFS_FILE_HEADER **File
- )
-/*++
-
-Routine Description:
-
- Find a file by type and instance. An instance of 1 is the first instance.
- The function will return NULL if a matching file cannot be found.
- File type EFI_FV_FILETYPE_ALL means any file type is valid.
-
-Arguments:
-
- FileType Type of file to search for.
- Instance Instace of the file type to return.
- File Return pointer. In the case of an error, contents are undefined.
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_ABORTED An error was encountered.
- EFI_INVALID_PARAMETER One of the parameters was NULL.
-
---*/
-{
- EFI_FFS_FILE_HEADER *CurrentFile;
- EFI_STATUS Status;
- UINTN FileCount;
-
- //
- // Verify library has been initialized.
- //
- if (mFvHeader == NULL || mFvLength == 0) {
- return EFI_ABORTED;
- }
- //
- // Verify input parameters
- //
- if (File == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Verify FV header
- //
- Status = VerifyFv (mFvHeader);
- if (EFI_ERROR (Status)) {
- return EFI_ABORTED;
- }
- //
- // Initialize the number of matching files found.
- //
- FileCount = 0;
-
- //
- // Get the first file
- //
- Status = GetNextFile (NULL, &CurrentFile);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "error parsing FV image", "FFS file with FileType 0x%x can't be found", FileType);
- return EFI_ABORTED;
- }
- //
- // Loop as long as we have a valid file
- //
- while (CurrentFile) {
- if (FileType == EFI_FV_FILETYPE_ALL || CurrentFile->Type == FileType) {
- FileCount++;
- }
-
- if (FileCount == Instance) {
- *File = CurrentFile;
- return EFI_SUCCESS;
- }
-
- Status = GetNextFile (CurrentFile, &CurrentFile);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "error parsing FV image", "FFS file with FileType 0x%x can't be found", FileType);
- return EFI_ABORTED;
- }
- }
-
- *File = NULL;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-SearchSectionByType (
- IN EFI_FILE_SECTION_POINTER FirstSection,
- IN UINT8 *SearchEnd,
- IN EFI_SECTION_TYPE SectionType,
- IN OUT UINTN *StartIndex,
- IN UINTN Instance,
- OUT EFI_FILE_SECTION_POINTER *Section
- )
-/*++
-
-Routine Description:
-
- Helper function to search a sequence of sections from the section pointed
- by FirstSection to SearchEnd for the Instance-th section of type SectionType.
- The current counter is saved in StartIndex and when the section is found, it's
- saved in Section. GUID-defined sections, if special processing is not required,
- are searched recursively in a depth-first manner.
-
-Arguments:
-
- FirstSection The first section to start searching from.
- SearchEnd The end address to stop search.
- SectionType The type of section to search.
- StartIndex The current counter is saved.
- Instance The requested n-th section number.
- Section The found section returned.
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_NOT_FOUND The section is not found.
---*/
-{
- EFI_FILE_SECTION_POINTER CurrentSection;
- EFI_FILE_SECTION_POINTER InnerSection;
- EFI_STATUS Status;
- UINTN SectionSize;
-
- CurrentSection = FirstSection;
-
- while ((UINTN) CurrentSection.CommonHeader < (UINTN) SearchEnd) {
- if (CurrentSection.CommonHeader->Type == SectionType) {
- (*StartIndex)++;
- }
-
- if (*StartIndex == Instance) {
- *Section = CurrentSection;
- return EFI_SUCCESS;
- }
- //
- // If the requesting section is not GUID-defined and
- // we find a GUID-defined section that doesn't need
- // special processing, go ahead to search the requesting
- // section inside the GUID-defined section.
- //
- if (SectionType != EFI_SECTION_GUID_DEFINED &&
- CurrentSection.CommonHeader->Type == EFI_SECTION_GUID_DEFINED &&
- !(CurrentSection.GuidDefinedSection->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED)) {
- InnerSection.CommonHeader = (EFI_COMMON_SECTION_HEADER *)
- ((UINTN) CurrentSection.CommonHeader + CurrentSection.GuidDefinedSection->DataOffset);
- SectionSize = CurrentSection.CommonHeader->Size[0] +
- (CurrentSection.CommonHeader->Size[1] << 8) +
- (CurrentSection.CommonHeader->Size[2] << 16);
- Status = SearchSectionByType (
- InnerSection,
- (UINT8 *) ((UINTN) CurrentSection.CommonHeader + SectionSize),
- SectionType,
- StartIndex,
- Instance,
- Section
- );
- if (!EFI_ERROR (Status)) {
- return EFI_SUCCESS;
- }
- }
- //
- // Find next section (including compensating for alignment issues.
- //
- CurrentSection.CommonHeader = (EFI_COMMON_SECTION_HEADER *) ((((UINTN) CurrentSection.CommonHeader) + GetLength (CurrentSection.CommonHeader->Size) + 0x03) & (-1 << 2));
- }
-
- return EFI_NOT_FOUND;
-}
-
-EFI_STATUS
-GetSectionByType (
- IN EFI_FFS_FILE_HEADER *File,
- IN EFI_SECTION_TYPE SectionType,
- IN UINTN Instance,
- OUT EFI_FILE_SECTION_POINTER *Section
- )
-/*++
-
-Routine Description:
-
- Find a section in a file by type and instance. An instance of 1 is the first
- instance. The function will return NULL if a matching section cannot be found.
- GUID-defined sections, if special processing is not needed, are handled in a
- depth-first manner.
-
-Arguments:
-
- File The file to search.
- SectionType Type of file to search for.
- Instance Instace of the section to return.
- Section Return pointer. In the case of an error, contents are undefined.
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_ABORTED An error was encountered.
- EFI_INVALID_PARAMETER One of the parameters was NULL.
- EFI_NOT_FOUND No found.
---*/
-{
- EFI_FILE_SECTION_POINTER CurrentSection;
- EFI_STATUS Status;
- UINTN SectionCount;
-
- //
- // Verify input parameters
- //
- if (File == NULL || Instance == 0) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Verify FFS header
- //
- Status = VerifyFfsFile (File);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0006, "invalid FFS file", NULL);
- return EFI_ABORTED;
- }
- //
- // Initialize the number of matching sections found.
- //
- SectionCount = 0;
-
- //
- // Get the first section
- //
- CurrentSection.CommonHeader = (EFI_COMMON_SECTION_HEADER *) ((UINTN) File + sizeof (EFI_FFS_FILE_HEADER));
-
- //
- // Depth-first manner to find section file.
- //
- Status = SearchSectionByType (
- CurrentSection,
- (UINT8 *) ((UINTN) File + GetLength (File->Size)),
- SectionType,
- &SectionCount,
- Instance,
- Section
- );
-
- if (!EFI_ERROR (Status)) {
- return EFI_SUCCESS;
- } else {
- //
- // Section not found
- //
- (*Section).Code16Section = NULL;
- return EFI_NOT_FOUND;
- }
-}
-//
-// will not parse compressed sections
-//
-EFI_STATUS
-VerifyFv (
- IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader
- )
-/*++
-
-Routine Description:
-
- Verify the current pointer points to a valid FV header.
-
-Arguments:
-
- FvHeader Pointer to an alleged FV file.
-
-Returns:
-
- EFI_SUCCESS The FV header is valid.
- EFI_VOLUME_CORRUPTED The FV header is not valid.
- EFI_INVALID_PARAMETER A required parameter was NULL.
- EFI_ABORTED Operation aborted.
-
---*/
-{
- UINT16 Checksum;
-
- //
- // Verify input parameters
- //
- if (FvHeader == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (FvHeader->Signature != EFI_FVH_SIGNATURE) {
- Error (NULL, 0, 0006, "invalid FV header signature", NULL);
- return EFI_VOLUME_CORRUPTED;
- }
- //
- // Verify header checksum
- //
- Checksum = CalculateSum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
-
- if (Checksum != 0) {
- Error (NULL, 0, 0006, "invalid FV header checksum", NULL);
- return EFI_ABORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-VerifyFfsFile (
- IN EFI_FFS_FILE_HEADER *FfsHeader
- )
-/*++
-
-Routine Description:
-
- Verify the current pointer points to a FFS file header.
-
-Arguments:
-
- FfsHeader Pointer to an alleged FFS file.
-
-Returns:
-
- EFI_SUCCESS The Ffs header is valid.
- EFI_NOT_FOUND This "file" is the beginning of free space.
- EFI_VOLUME_CORRUPTED The Ffs header is not valid.
- EFI_ABORTED The erase polarity is not known.
-
---*/
-{
- BOOLEAN ErasePolarity;
- EFI_STATUS Status;
- EFI_FFS_FILE_HEADER BlankHeader;
- UINT8 Checksum;
- UINT32 FileLength;
- UINT8 SavedChecksum;
- UINT8 SavedState;
- UINT8 FileGuidString[80];
- //
- // Verify library has been initialized.
- //
- if (mFvHeader == NULL || mFvLength == 0) {
- return EFI_ABORTED;
- }
- //
- // Verify FV header
- //
- Status = VerifyFv (mFvHeader);
- if (EFI_ERROR (Status)) {
- return EFI_ABORTED;
- }
- //
- // Get the erase polarity.
- //
- Status = GetErasePolarity (&ErasePolarity);
- if (EFI_ERROR (Status)) {
- return EFI_ABORTED;
- }
- //
- // Check if we have free space
- //
- if (ErasePolarity) {
- memset (&BlankHeader, -1, sizeof (EFI_FFS_FILE_HEADER));
- } else {
- memset (&BlankHeader, 0, sizeof (EFI_FFS_FILE_HEADER));
- }
-
- if (memcmp (&BlankHeader, FfsHeader, sizeof (EFI_FFS_FILE_HEADER)) == 0) {
- return EFI_NOT_FOUND;
- }
- //
- // Convert the GUID to a string so we can at least report which file
- // if we find an error.
- //
- PrintGuidToBuffer (&FfsHeader->Name, FileGuidString, sizeof (FileGuidString), TRUE);
- //
- // Verify file header checksum
- //
- SavedState = FfsHeader->State;
- FfsHeader->State = 0;
- SavedChecksum = FfsHeader->IntegrityCheck.Checksum.File;
- FfsHeader->IntegrityCheck.Checksum.File = 0;
- Checksum = CalculateSum8 ((UINT8 *) FfsHeader, sizeof (EFI_FFS_FILE_HEADER));
- FfsHeader->State = SavedState;
- FfsHeader->IntegrityCheck.Checksum.File = SavedChecksum;
- if (Checksum != 0) {
- Error (NULL, 0, 0006, "invalid FFS file header checksum", "Ffs file with Guid %s", FileGuidString);
- return EFI_ABORTED;
- }
- //
- // Verify file checksum
- //
- if (FfsHeader->Attributes & FFS_ATTRIB_CHECKSUM) {
- //
- // Verify file data checksum
- //
- FileLength = GetLength (FfsHeader->Size);
- Checksum = CalculateSum8 ((UINT8 *) (FfsHeader + 1), FileLength - sizeof (EFI_FFS_FILE_HEADER));
- Checksum = Checksum + FfsHeader->IntegrityCheck.Checksum.File;
- if (Checksum != 0) {
- Error (NULL, 0, 0006, "invalid FFS file checksum", "Ffs file with Guid %s", FileGuidString);
- return EFI_ABORTED;
- }
- } else {
- //
- // File does not have a checksum
- // Verify contents are 0xAA as spec'd
- //
- if (FfsHeader->IntegrityCheck.Checksum.File != FFS_FIXED_CHECKSUM) {
- Error (NULL, 0, 0006, "invalid fixed FFS file header checksum", "Ffs file with Guid %s", FileGuidString);
- return EFI_ABORTED;
- }
- }
-
- return EFI_SUCCESS;
-}
-
-UINT32
-GetLength (
- UINT8 *ThreeByteLength
- )
-/*++
-
-Routine Description:
-
- Converts a three byte length value into a UINT32.
-
-Arguments:
-
- ThreeByteLength Pointer to the first of the 3 byte length.
-
-Returns:
-
- UINT32 Size of the section
-
---*/
-{
- UINT32 Length;
-
- if (ThreeByteLength == NULL) {
- return 0;
- }
-
- Length = *((UINT32 *) ThreeByteLength);
- Length = Length & 0x00FFFFFF;
-
- return Length;
-}
-
-EFI_STATUS
-GetErasePolarity (
- OUT BOOLEAN *ErasePolarity
- )
-/*++
-
-Routine Description:
-
- This function returns with the FV erase polarity. If the erase polarity
- for a bit is 1, the function return TRUE.
-
-Arguments:
-
- ErasePolarity A pointer to the erase polarity.
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_INVALID_PARAMETER One of the input parameters was invalid.
- EFI_ABORTED Operation aborted.
-
---*/
-{
- EFI_STATUS Status;
-
- //
- // Verify library has been initialized.
- //
- if (mFvHeader == NULL || mFvLength == 0) {
- return EFI_ABORTED;
- }
- //
- // Verify FV header
- //
- Status = VerifyFv (mFvHeader);
- if (EFI_ERROR (Status)) {
- return EFI_ABORTED;
- }
- //
- // Verify input parameters.
- //
- if (ErasePolarity == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (mFvHeader->Attributes & EFI_FVB2_ERASE_POLARITY) {
- *ErasePolarity = TRUE;
- } else {
- *ErasePolarity = FALSE;
- }
-
- return EFI_SUCCESS;
-}
-
-UINT8
-GetFileState (
- IN BOOLEAN ErasePolarity,
- IN EFI_FFS_FILE_HEADER *FfsHeader
- )
-/*++
-
-Routine Description:
-
- This function returns a the highest state bit in the FFS that is set.
- It in no way validate the FFS file.
-
-Arguments:
-
- ErasePolarity The erase polarity for the file state bits.
- FfsHeader Pointer to a FFS file.
-
-Returns:
-
- UINT8 The hightest set state of the file.
-
---*/
-{
- UINT8 FileState;
- UINT8 HighestBit;
-
- FileState = FfsHeader->State;
-
- if (ErasePolarity) {
- FileState = (UINT8)~FileState;
- }
-
- HighestBit = 0x80;
- while (HighestBit != 0 && (HighestBit & FileState) == 0) {
- HighestBit >>= 1;
- }
-
- return HighestBit;
-}
diff --git a/BaseTools/Source/C/Common/FvLib.h b/BaseTools/Source/C/Common/FvLib.h
deleted file mode 100644
index 7815baae3f..0000000000
--- a/BaseTools/Source/C/Common/FvLib.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- FvLib.h
-
-Abstract:
-
- These functions assist in parsing and manipulating a Firmware Volume.
-
-**/
-
-#ifndef _EFI_FV_LIB_H
-#define _EFI_FV_LIB_H
-
-//
-// Include files
-//
-#include <string.h>
-
-#include <Common/UefiBaseTypes.h>
-#include <Common/PiFirmwareFile.h>
-#include <Common/PiFirmwareVolume.h>
-
-EFI_STATUS
-InitializeFvLib (
- IN VOID *Fv,
- IN UINT32 FvLength
- )
-;
-
-EFI_STATUS
-GetFvHeader (
- OUT EFI_FIRMWARE_VOLUME_HEADER **FvHeader,
- OUT UINT32 *FvLength
- )
-;
-
-EFI_STATUS
-GetNextFile (
- IN EFI_FFS_FILE_HEADER *CurrentFile,
- OUT EFI_FFS_FILE_HEADER **NextFile
- )
-;
-
-EFI_STATUS
-GetFileByName (
- IN EFI_GUID *FileName,
- OUT EFI_FFS_FILE_HEADER **File
- )
-;
-
-EFI_STATUS
-GetFileByType (
- IN EFI_FV_FILETYPE FileType,
- IN UINTN Instance,
- OUT EFI_FFS_FILE_HEADER **File
- )
-;
-
-EFI_STATUS
-GetSectionByType (
- IN EFI_FFS_FILE_HEADER *File,
- IN EFI_SECTION_TYPE SectionType,
- IN UINTN Instance,
- OUT EFI_FILE_SECTION_POINTER *Section
- )
-;
-//
-// will not parse compressed sections
-//
-EFI_STATUS
-VerifyFv (
- IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader
- )
-;
-
-EFI_STATUS
-VerifyFfsFile (
- IN EFI_FFS_FILE_HEADER *FfsHeader
- )
-;
-
-/*++
-
-Routine Description:
-
- Verify the current pointer points to a FFS file header.
-
-Arguments:
-
- FfsHeader Pointer to an alleged FFS file.
-
-Returns:
-
- EFI_SUCCESS The Ffs header is valid.
- EFI_NOT_FOUND This "file" is the beginning of free space.
- EFI_VOLUME_CORRUPTED The Ffs header is not valid.
-
---*/
-UINT32
-GetLength (
- UINT8 *ThreeByteLength
- )
-;
-
-/*++
-
-Routine Description:
-
- Converts a three byte length value into a UINT32.
-
-Arguments:
-
- ThreeByteLength Pointer to the first of the 3 byte length.
-
-Returns:
-
- UINT32 Size of the section
-
---*/
-EFI_STATUS
-GetErasePolarity (
- OUT BOOLEAN *ErasePolarity
- )
-;
-
-/*++
-
-Routine Description:
-
- This function returns with the FV erase polarity. If the erase polarity
- for a bit is 1, the function return TRUE.
-
-Arguments:
-
- ErasePolarity A pointer to the erase polarity.
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_INVALID_PARAMETER One of the input parameters was invalid.
-
---*/
-UINT8
-GetFileState (
- IN BOOLEAN ErasePolarity,
- IN EFI_FFS_FILE_HEADER *FfsHeader
- )
-;
-
-/*++
-
-Routine Description:
-
- This function returns a the highest state bit in the FFS that is set.
- It in no way validate the FFS file.
-
-Arguments:
-
- ErasePolarity The erase polarity for the file state bits.
- FfsHeader Pointer to a FFS file.
-
-Returns:
-
- UINT8 The hightest set state of the file.
-
---*/
-#endif
diff --git a/BaseTools/Source/C/Common/GNUmakefile b/BaseTools/Source/C/Common/GNUmakefile
deleted file mode 100644
index a193557817..0000000000
--- a/BaseTools/Source/C/Common/GNUmakefile
+++ /dev/null
@@ -1,40 +0,0 @@
-## @file
-# GNU/Linux makefile for 'Common' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-# VPATH = ..
-
-LIBNAME = Common
-
-OBJECTS = \
- BasePeCoff.o \
- BinderFuncs.o \
- CommonLib.o \
- Crc32.o \
- Decompress.o \
- EfiCompress.o \
- EfiUtilityMsgs.o \
- FirmwareVolumeBuffer.o \
- FvLib.o \
- MemoryFile.o \
- MyAlloc.o \
- OsPath.o \
- ParseGuidedSectionTools.o \
- ParseInf.o \
- PeCoffLoaderEx.o \
- SimpleFileParsing.o \
- StringFuncs.o \
- TianoCompress.o
-
-include $(MAKEROOT)/Makefiles/lib.makefile
diff --git a/BaseTools/Source/C/Common/Makefile b/BaseTools/Source/C/Common/Makefile
deleted file mode 100644
index 41119b11ab..0000000000
--- a/BaseTools/Source/C/Common/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-## @file
-# Windows makefile for 'Common' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-# VPATH = ..
-
-LIBNAME = Common
-
-OBJECTS = \
- BasePeCoff.obj \
- BinderFuncs.obj \
- CommonLib.obj \
- Crc32.obj \
- Decompress.obj \
- EfiCompress.obj \
- EfiUtilityMsgs.obj \
- FirmwareVolumeBuffer.obj \
- FvLib.obj \
- MemoryFile.obj \
- MyAlloc.obj \
- OsPath.obj \
- ParseGuidedSectionTools.obj \
- ParseInf.obj \
- PeCoffLoaderEx.obj \
- SimpleFileParsing.obj \
- StringFuncs.obj \
- TianoCompress.obj
-
-!INCLUDE ..\Makefiles\ms.lib
-
-
-
diff --git a/BaseTools/Source/C/Common/MemoryFile.c b/BaseTools/Source/C/Common/MemoryFile.c
deleted file mode 100644
index a93a505788..0000000000
--- a/BaseTools/Source/C/Common/MemoryFile.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- MemoryFile.c
-
-Abstract:
-
- This contains some useful functions for accessing files.
-
-**/
-
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include "CommonLib.h"
-#include "MemoryFile.h"
-
-
-//
-// Local (static) function prototypes
-//
-STATIC
-VOID
-CheckMemoryFileState (
- IN EFI_HANDLE InputMemoryFile
- );
-
-//
-// Function implementations
-//
-
-EFI_STATUS
-GetMemoryFile (
- IN CHAR8 *InputFileName,
- OUT EFI_HANDLE *OutputMemoryFile
- )
-/*++
-
-Routine Description:
-
- This opens a file, reads it into memory and returns a memory file
- object.
-
-Arguments:
-
- InputFile Memory file image.
- OutputMemoryFile Handle to memory file
-
-Returns:
-
- EFI_STATUS
- OutputMemoryFile is valid if !EFI_ERROR
-
---*/
-{
- EFI_STATUS Status;
- CHAR8 *InputFileImage;
- UINT32 BytesRead;
- MEMORY_FILE *NewMemoryFile;
-
- Status = GetFileImage (InputFileName, &InputFileImage, &BytesRead);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- NewMemoryFile = malloc (sizeof (*NewMemoryFile));
- if (NewMemoryFile == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- NewMemoryFile->FileImage = InputFileImage;
- NewMemoryFile->CurrentFilePointer = InputFileImage;
- NewMemoryFile->Eof = InputFileImage + BytesRead;
-
- *OutputMemoryFile = (EFI_HANDLE)NewMemoryFile;
-
- CheckMemoryFileState (*OutputMemoryFile);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-FreeMemoryFile (
- IN EFI_HANDLE InputMemoryFile
- )
-/*++
-
-Routine Description:
-
- Frees all memory associated with the input memory file.
-
-Arguments:
-
- InputMemoryFile Handle to memory file
-
-Returns:
-
- EFI_STATUS
-
---*/
-{
- MEMORY_FILE *MemoryFile;
-
- CheckMemoryFileState (InputMemoryFile);
-
- MemoryFile = (MEMORY_FILE*)InputMemoryFile;
-
- free (MemoryFile->FileImage);
-
- //
- // Invalidate state of MEMORY_FILE structure to catch invalid usage.
- //
- memset (MemoryFile, 0xcc, sizeof (*MemoryFile));
- MemoryFile->Eof -= 1;
-
- free (MemoryFile);
-
- return EFI_SUCCESS;
-}
-
-
-CHAR8 *
-ReadMemoryFileLine (
- IN EFI_HANDLE InputMemoryFile
- )
-/*++
-
-Routine Description:
-
- This function reads a line from the memory file. The newline characters
- are stripped and a null terminated string is returned.
-
- If the string pointer returned is non-NULL, then the caller must free the
- memory associated with this string.
-
-Arguments:
-
- InputMemoryFile Handle to memory file
-
-Returns:
-
- NULL if error or EOF
- NULL character termincated string otherwise (MUST BE FREED BY CALLER)
-
---*/
-{
- CHAR8 *EndOfLine;
- UINTN CharsToCopy;
- MEMORY_FILE *InputFile;
- UINTN BytesToEof;
- CHAR8 *OutputString;
-
- //
- // Verify input parameters are not null
- //
- CheckMemoryFileState (InputMemoryFile);
-
- InputFile = (MEMORY_FILE*)InputMemoryFile;
-
- //
- // Check for end of file condition
- //
- if (InputFile->CurrentFilePointer >= InputFile->Eof) {
- return NULL;
- }
-
- //
- // Determine the number of bytes remaining until the EOF
- //
- BytesToEof = InputFile->Eof - InputFile->CurrentFilePointer;
-
- //
- // Find the next newline char
- //
- EndOfLine = memchr (InputFile->CurrentFilePointer, '\n', BytesToEof);
-
- //
- // Determine the number of characters to copy.
- //
- if (EndOfLine == 0) {
- //
- // If no newline found, copy to the end of the file.
- //
- CharsToCopy = InputFile->Eof - InputFile->CurrentFilePointer;
- } else {
- //
- // Newline found in the file.
- //
- CharsToCopy = EndOfLine - InputFile->CurrentFilePointer;
- }
-
- OutputString = malloc (CharsToCopy);
- if (OutputString == NULL) {
- return NULL;
- }
-
- //
- // Copy the line.
- //
- memcpy (OutputString, InputFile->CurrentFilePointer, CharsToCopy);
-
- //
- // Add the null termination over the 0x0D
- //
- if (OutputString[CharsToCopy - 1] == '\r') {
-
- OutputString[CharsToCopy - 1] = '\0';
-
- } else {
-
- OutputString[CharsToCopy] = '\0';
-
- }
-
- //
- // Increment the current file pointer (include the 0x0A)
- //
- InputFile->CurrentFilePointer += CharsToCopy + 1;
- CheckMemoryFileState (InputMemoryFile);
-
- //
- // Return the string
- //
- return OutputString;
-}
-
-
-STATIC
-VOID
-CheckMemoryFileState (
- IN EFI_HANDLE InputMemoryFile
- )
-{
- MEMORY_FILE *MemoryFile;
-
- assert (InputMemoryFile != NULL);
-
- MemoryFile = (MEMORY_FILE*)InputMemoryFile;
-
- assert (MemoryFile->FileImage != NULL);
- assert (MemoryFile->CurrentFilePointer != NULL);
- assert (MemoryFile->Eof != NULL);
- assert (MemoryFile->Eof >= MemoryFile->FileImage);
- assert (MemoryFile->CurrentFilePointer >= MemoryFile->FileImage);
- assert (MemoryFile->CurrentFilePointer <= MemoryFile->Eof);
-}
-
-
diff --git a/BaseTools/Source/C/Common/MemoryFile.h b/BaseTools/Source/C/Common/MemoryFile.h
deleted file mode 100644
index baab40baa2..0000000000
--- a/BaseTools/Source/C/Common/MemoryFile.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- MemoryFile.h
-
-Abstract:
-
- Header file for helper functions useful for accessing files.
-
-**/
-
-#ifndef _EFI_MEMORY_FILE_H
-#define _EFI_MEMORY_FILE_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <Common/UefiBaseTypes.h>
-
-#ifndef _MAX_PATH
-#define _MAX_PATH 500
-#endif
-
-//
-// Common data structures
-//
-typedef struct {
- CHAR8 *FileImage;
- CHAR8 *Eof;
- CHAR8 *CurrentFilePointer;
-} MEMORY_FILE;
-
-
-//
-// Functions declarations
-//
-
-EFI_STATUS
-GetMemoryFile (
- IN CHAR8 *InputFileName,
- OUT EFI_HANDLE *OutputMemoryFile
- )
-;
-/**
-
-Routine Description:
-
- This opens a file, reads it into memory and returns a memory file
- object.
-
-Arguments:
-
- InputFile Memory file image.
- OutputMemoryFile Handle to memory file
-
-Returns:
-
- EFI_STATUS
- OutputMemoryFile is valid if !EFI_ERROR
-
-**/
-
-
-EFI_STATUS
-FreeMemoryFile (
- IN EFI_HANDLE InputMemoryFile
- )
-;
-/**
-
-Routine Description:
-
- Frees all memory associated with the input memory file.
-
-Arguments:
-
- InputMemoryFile Handle to memory file
-
-Returns:
-
- EFI_STATUS
-
-**/
-
-
-CHAR8 *
-ReadMemoryFileLine (
- IN EFI_HANDLE InputMemoryFile
- )
-;
-/**
-
-Routine Description:
-
- This function reads a line from the memory file. The newline characters
- are stripped and a null terminated string is returned.
-
- If the string pointer returned is non-NULL, then the caller must free the
- memory associated with this string.
-
-Arguments:
-
- InputMemoryFile Handle to memory file
-
-Returns:
-
- NULL if error or EOF
- NULL character termincated string otherwise (MUST BE FREED BY CALLER)
-
-**/
-
-
-#endif
diff --git a/BaseTools/Source/C/Common/MyAlloc.c b/BaseTools/Source/C/Common/MyAlloc.c
deleted file mode 100644
index 7b0493aaa0..0000000000
--- a/BaseTools/Source/C/Common/MyAlloc.c
+++ /dev/null
@@ -1,516 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- MyAlloc.c
-
-Abstract:
-
- File for memory allocation tracking functions.
-
-**/
-
-#include "MyAlloc.h"
-
-#if USE_MYALLOC
-//
-// Get back to original alloc/free calls.
-//
-#undef malloc
-#undef calloc
-#undef realloc
-#undef free
-//
-// Start of allocation list.
-//
-STATIC MY_ALLOC_STRUCT *MyAllocData = NULL;
-
-//
-//
-//
-STATIC UINT32 MyAllocHeadMagik = MYALLOC_HEAD_MAGIK;
-STATIC UINT32 MyAllocTailMagik = MYALLOC_TAIL_MAGIK;
-
-//
-// ////////////////////////////////////////////////////////////////////////////
-//
-//
-VOID
-MyCheck (
- BOOLEAN Final,
- UINT8 File[],
- UINTN Line
- )
-// *++
-// Description:
-//
-// Check for corruptions in the allocated memory chain. If a corruption
-// is detection program operation stops w/ an exit(1) call.
-//
-// Parameters:
-//
-// Final := When FALSE, MyCheck() returns if the allocated memory chain
-// has not been corrupted. When TRUE, MyCheck() returns if there
-// are no un-freed allocations. If there are un-freed allocations,
-// they are displayed and exit(1) is called.
-//
-//
-// File := Set to __FILE__ by macro expansion.
-//
-// Line := Set to __LINE__ by macro expansion.
-//
-// Returns:
-//
-// n/a
-//
-// --*/
-//
-{
- MY_ALLOC_STRUCT *Tmp;
-
- //
- // Check parameters.
- //
- if (File == NULL || Line == 0) {
- printf (
- "\nMyCheck(Final=%u, File=%s, Line=%u)"
- "Invalid parameter(s).\n",
- Final,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
-
- if (strlen ((CHAR8 *)File) == 0) {
- printf (
- "\nMyCheck(Final=%u, File=%s, Line=%u)"
- "Invalid parameter.\n",
- Final,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
- //
- // Check structure contents.
- //
- for (Tmp = MyAllocData; Tmp != NULL; Tmp = Tmp->Next) {
- if (memcmp(Tmp->Buffer, &MyAllocHeadMagik, sizeof MyAllocHeadMagik) ||
- memcmp(&Tmp->Buffer[Tmp->Size + sizeof(UINT32)], &MyAllocTailMagik, sizeof MyAllocTailMagik)) {
- break;
- }
- }
- //
- // If Tmp is not NULL, the structure is corrupt.
- //
- if (Tmp != NULL) {
- printf (
- "\nMyCheck(Final=%u, File=%s, Line=%u)""\nStructure corrupted!"
- "\nFile=%s, Line=%u, nSize=%u, Head=%xh, Tail=%xh\n",
- Final,
- File,
- (unsigned)Line,
- Tmp->File,
- (unsigned) Tmp->Line,
- (unsigned) Tmp->Size,
- (unsigned) *(UINT32 *) (Tmp->Buffer),
- (unsigned) *(UINT32 *) (&Tmp->Buffer[Tmp->Size + sizeof (UINT32)])
- );
-
- exit (1);
- }
- //
- // If Final is TRUE, display the state of the structure chain.
- //
- if (Final) {
- if (MyAllocData != NULL) {
- printf (
- "\nMyCheck(Final=%u, File=%s, Line=%u)"
- "\nSome allocated items have not been freed.\n",
- Final,
- File,
- (unsigned)Line
- );
-
- for (Tmp = MyAllocData; Tmp != NULL; Tmp = Tmp->Next) {
- printf (
- "File=%s, Line=%u, nSize=%u, Head=%xh, Tail=%xh\n",
- Tmp->File,
- (unsigned) Tmp->Line,
- (unsigned) Tmp->Size,
- (unsigned) *(UINT32 *) (Tmp->Buffer),
- (unsigned) *(UINT32 *) (&Tmp->Buffer[Tmp->Size + sizeof (UINT32)])
- );
- }
- }
- }
-}
-//
-// ////////////////////////////////////////////////////////////////////////////
-//
-//
-VOID *
-MyAlloc (
- UINTN Size,
- UINT8 File[],
- UINTN Line
- )
-// *++
-// Description:
-//
-// Allocate a new link in the allocation chain along with enough storage
-// for the File[] string, requested Size and alignment overhead. If
-// memory cannot be allocated or the allocation chain has been corrupted,
-// exit(1) will be called.
-//
-// Parameters:
-//
-// Size := Number of bytes (UINT8) requested by the called.
-// Size cannot be zero.
-//
-// File := Set to __FILE__ by macro expansion.
-//
-// Line := Set to __LINE__ by macro expansion.
-//
-// Returns:
-//
-// Pointer to the caller's buffer.
-//
-// --*/
-//
-{
- MY_ALLOC_STRUCT *Tmp;
- UINTN Len;
-
- //
- // Check for invalid parameters.
- //
- if (Size == 0 || File == NULL || Line == 0) {
- printf (
- "\nMyAlloc(Size=%u, File=%s, Line=%u)"
- "\nInvalid parameter(s).\n",
- (unsigned)Size,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
-
- Len = strlen ((CHAR8 *)File);
- if (Len == 0) {
- printf (
- "\nMyAlloc(Size=%u, File=%s, Line=%u)"
- "\nInvalid parameter.\n",
- (unsigned)Size,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
- //
- // Check the allocation list for corruption.
- //
- MyCheck (0, (UINT8 *)__FILE__, __LINE__);
-
- //
- // Allocate a new entry.
- //
- Tmp = calloc (
- 1,
- sizeof (MY_ALLOC_STRUCT) + Len + 1 + sizeof (UINT64) + Size + (sizeof MyAllocHeadMagik) + (sizeof MyAllocTailMagik)
- );
-
- if (Tmp == NULL) {
- printf (
- "\nMyAlloc(Size=%u, File=%s, Line=%u)"
- "\nOut of memory.\n",
- (unsigned)Size,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
- //
- // Fill in the new entry.
- //
- Tmp->File = ((UINT8 *) Tmp) + sizeof (MY_ALLOC_STRUCT);
- strcpy ((CHAR8 *)Tmp->File, (CHAR8 *)File);
- Tmp->Line = Line;
- Tmp->Size = Size;
- Tmp->Buffer = (UINT8 *) (((UINTN) Tmp + Len + 9) &~7);
-
- memcpy (Tmp->Buffer, &MyAllocHeadMagik, sizeof MyAllocHeadMagik);
-
- memcpy (
- &Tmp->Buffer[Size + sizeof (UINT32)],
- &MyAllocTailMagik,
- sizeof MyAllocTailMagik
- );
-
- Tmp->Next = MyAllocData;
- Tmp->Cksum = (UINTN) Tmp + (UINTN) (Tmp->Next) + Tmp->Line + Tmp->Size + (UINTN) (Tmp->File) + (UINTN) (Tmp->Buffer);
-
- MyAllocData = Tmp;
-
- return Tmp->Buffer + sizeof (UINT32);
-}
-//
-// ////////////////////////////////////////////////////////////////////////////
-//
-//
-VOID *
-MyRealloc (
- VOID *Ptr,
- UINTN Size,
- UINT8 File[],
- UINTN Line
- )
-// *++
-// Description:
-//
-// This does a MyAlloc(), memcpy() and MyFree(). There is no optimization
-// for shrinking or expanding buffers. An invalid parameter will cause
-// MyRealloc() to fail with a call to exit(1).
-//
-// Parameters:
-//
-// Ptr := Pointer to the caller's buffer to be re-allocated.
-//
-// Size := Size of new buffer. Size cannot be zero.
-//
-// File := Set to __FILE__ by macro expansion.
-//
-// Line := Set to __LINE__ by macro expansion.
-//
-// Returns:
-//
-// Pointer to new caller's buffer.
-//
-// --*/
-//
-{
- MY_ALLOC_STRUCT *Tmp;
- VOID *Buffer;
-
- //
- // Check for invalid parameter(s).
- //
- if (Size == 0 || File == NULL || Line == 0) {
- printf (
- "\nMyRealloc(Ptr=%p, Size=%u, File=%s, Line=%u)"
- "\nInvalid parameter(s).\n",
- Ptr,
- (unsigned)Size,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
-
- if (strlen ((CHAR8 *)File) == 0) {
- printf (
- "\nMyRealloc(Ptr=%p, Size=%u, File=%s, Line=%u)"
- "\nInvalid parameter.\n",
- Ptr,
- (unsigned)Size,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
- //
- // Find existing buffer in allocation list.
- //
- if (Ptr == NULL) {
- Tmp = NULL;
- } else if (&MyAllocData->Buffer[sizeof (UINT32)] == Ptr) {
- Tmp = MyAllocData;
- } else {
- for (Tmp = MyAllocData;; Tmp = Tmp->Next) {
- if (Tmp->Next == NULL) {
- printf (
- "\nMyRealloc(Ptr=%p, Size=%u, File=%s, Line=%u)"
- "\nCould not find buffer.\n",
- Ptr,
- (unsigned)Size,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
-
- Tmp = Tmp->Next;
- }
- }
- //
- // Allocate new buffer, copy old data, free old buffer.
- //
- Buffer = MyAlloc (Size, File, Line);
-
- if (Buffer != NULL && Tmp != NULL) {
- memcpy (
- Buffer,
- &Tmp->Buffer[sizeof (UINT32)],
- ((Size <= Tmp->Size) ? Size : Tmp->Size)
- );
-
- MyFree (Ptr, (UINT8 *)__FILE__, __LINE__);
- }
-
- return Buffer;
-}
-//
-// ////////////////////////////////////////////////////////////////////////////
-//
-//
-VOID
-MyFree (
- VOID *Ptr,
- UINT8 File[],
- UINTN Line
- )
-// *++
-// Description:
-//
-// Release a previously allocated buffer. Invalid parameters will cause
-// MyFree() to fail with an exit(1) call.
-//
-// Parameters:
-//
-// Ptr := Pointer to the caller's buffer to be freed.
-// A NULL pointer will be ignored.
-//
-// File := Set to __FILE__ by macro expansion.
-//
-// Line := Set to __LINE__ by macro expansion.
-//
-// Returns:
-//
-// n/a
-//
-// --*/
-//
-{
- MY_ALLOC_STRUCT *Tmp;
- MY_ALLOC_STRUCT *Tmp2;
-
- //
- // Check for invalid parameter(s).
- //
- if (File == NULL || Line == 0) {
- printf (
- "\nMyFree(Ptr=%p, File=%s, Line=%u)"
- "\nInvalid parameter(s).\n",
- Ptr,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
-
- if (strlen ((CHAR8 *)File) == 0) {
- printf (
- "\nMyFree(Ptr=%p, File=%s, Line=%u)"
- "\nInvalid parameter.\n",
- Ptr,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
- //
- // Freeing NULL is always valid.
- //
- if (Ptr == NULL) {
- return ;
- }
- //
- // Fail if nothing is allocated.
- //
- if (MyAllocData == NULL) {
- printf (
- "\nMyFree(Ptr=%p, File=%s, Line=%u)"
- "\nCalled before memory allocated.\n",
- Ptr,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
- //
- // Check for corrupted allocation list.
- //
- MyCheck (0, (UINT8 *)__FILE__, __LINE__);
-
- //
- // Need special check for first item in list.
- //
- if (&MyAllocData->Buffer[sizeof (UINT32)] == Ptr) {
- //
- // Unlink first item in list.
- //
- Tmp = MyAllocData;
- MyAllocData = MyAllocData->Next;
- } else {
- //
- // Walk list looking for matching item.
- //
- for (Tmp = MyAllocData;; Tmp = Tmp->Next) {
- //
- // Fail if end of list is reached.
- //
- if (Tmp->Next == NULL) {
- printf (
- "\nMyFree(Ptr=%p, File=%s, Line=%u)\n"
- "\nNot found.\n",
- Ptr,
- File,
- (unsigned)Line
- );
-
- exit (1);
- }
- //
- // Leave loop when match is found.
- //
- if (&Tmp->Next->Buffer[sizeof (UINT32)] == Ptr) {
- break;
- }
- }
- //
- // Unlink item from list.
- //
- Tmp2 = Tmp->Next;
- Tmp->Next = Tmp->Next->Next;
- Tmp = Tmp2;
- }
- //
- // Release item.
- //
- free (Tmp);
-}
-
-#endif /* USE_MYALLOC */
-
-/* eof - MyAlloc.c */
diff --git a/BaseTools/Source/C/Common/MyAlloc.h b/BaseTools/Source/C/Common/MyAlloc.h
deleted file mode 100644
index 217beb1484..0000000000
--- a/BaseTools/Source/C/Common/MyAlloc.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- MyAlloc.h
-
-Abstract:
-
- Header file for memory allocation tracking functions.
-
-**/
-
-#ifndef _MYALLOC_H_
-#define _MYALLOC_H_
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <Common/BaseTypes.h>
-
-//
-// Default operation is to use the memory allocation tracking functions.
-// To over-ride add "#define USE_MYALLOC 0" to your program header and/or
-// source files as needed. Or, just do not include this header file in
-// your project.
-//
-#ifndef USE_MYALLOC
-#define USE_MYALLOC 1
-#endif
-
-#if USE_MYALLOC
-//
-// Replace C library allocation routines with MyAlloc routines.
-//
-#define malloc(size) MyAlloc ((size), __FILE__, __LINE__)
-#define calloc(count, size) MyAlloc ((count) * (size), __FILE__, __LINE__)
-#define realloc(ptr, size) MyRealloc ((ptr), (size), __FILE__, __LINE__)
-#define free(ptr) MyFree ((ptr), __FILE__, __LINE__)
-#define alloc_check(final) MyCheck ((final), __FILE__, __LINE__)
-
-//
-// Structure for checking/tracking memory allocations.
-//
-typedef struct MyAllocStruct {
- UINTN Cksum;
- struct MyAllocStruct *Next;
- UINTN Line;
- UINTN Size;
- UINT8 *File;
- UINT8 *Buffer;
-} MY_ALLOC_STRUCT;
-//
-// Cksum := (UINTN)This + (UINTN)Next + Line + Size + (UINTN)File +
-// (UINTN)Buffer;
-//
-// Next := Pointer to next allocation structure in the list.
-//
-// Line := __LINE__
-//
-// Size := Size of allocation request.
-//
-// File := Pointer to __FILE__ string stored immediately following
-// MY_ALLOC_STRUCT in memory.
-//
-// Buffer := Pointer to UINT32 aligned storage immediately following
-// the NULL terminated __FILE__ string. This is UINT32
-// aligned because the underflow signature is 32-bits and
-// this will place the first caller address on a 64-bit
-// boundary.
-//
-//
-// Signatures used to check for buffer overflow/underflow conditions.
-//
-#define MYALLOC_HEAD_MAGIK 0xBADFACED
-#define MYALLOC_TAIL_MAGIK 0xDEADBEEF
-
-VOID
-MyCheck (
- BOOLEAN Final,
- UINT8 File[],
- UINTN Line
- )
-;
-//
-// *++
-// Description:
-//
-// Check for corruptions in the allocated memory chain. If a corruption
-// is detection program operation stops w/ an exit(1) call.
-//
-// Parameters:
-//
-// Final := When FALSE, MyCheck() returns if the allocated memory chain
-// has not been corrupted. When TRUE, MyCheck() returns if there
-// are no un-freed allocations. If there are un-freed allocations,
-// they are displayed and exit(1) is called.
-//
-//
-// File := Set to __FILE__ by macro expansion.
-//
-// Line := Set to __LINE__ by macro expansion.
-//
-// Returns:
-//
-// n/a
-//
-// --*/
-//
-VOID *
-MyAlloc (
- UINTN Size,
- UINT8 File[],
- UINTN Line
- )
-;
-//
-// *++
-// Description:
-//
-// Allocate a new link in the allocation chain along with enough storage
-// for the File[] string, requested Size and alignment overhead. If
-// memory cannot be allocated or the allocation chain has been corrupted,
-// exit(1) will be called.
-//
-// Parameters:
-//
-// Size := Number of bytes (UINT8) requested by the called.
-// Size cannot be zero.
-//
-// File := Set to __FILE__ by macro expansion.
-//
-// Line := Set to __LINE__ by macro expansion.
-//
-// Returns:
-//
-// Pointer to the caller's buffer.
-//
-// --*/
-//
-VOID *
-MyRealloc (
- VOID *Ptr,
- UINTN Size,
- UINT8 File[],
- UINTN Line
- )
-;
-//
-// *++
-// Description:
-//
-// This does a MyAlloc(), memcpy() and MyFree(). There is no optimization
-// for shrinking or expanding buffers. An invalid parameter will cause
-// MyRealloc() to fail with a call to exit(1).
-//
-// Parameters:
-//
-// Ptr := Pointer to the caller's buffer to be re-allocated.
-// Ptr cannot be NULL.
-//
-// Size := Size of new buffer. Size cannot be zero.
-//
-// File := Set to __FILE__ by macro expansion.
-//
-// Line := Set to __LINE__ by macro expansion.
-//
-// Returns:
-//
-// Pointer to new caller's buffer.
-//
-// --*/
-//
-VOID
-MyFree (
- VOID *Ptr,
- UINT8 File[],
- UINTN Line
- )
-;
-//
-// *++
-// Description:
-//
-// Release a previously allocated buffer. Invalid parameters will cause
-// MyFree() to fail with an exit(1) call.
-//
-// Parameters:
-//
-// Ptr := Pointer to the caller's buffer to be freed.
-// A NULL pointer will be ignored.
-//
-// File := Set to __FILE__ by macro expansion.
-//
-// Line := Set to __LINE__ by macro expansion.
-//
-// Returns:
-//
-// n/a
-//
-// --*/
-//
-#else /* USE_MYALLOC */
-
-//
-// Nothing to do when USE_MYALLOC is zero.
-//
-#define alloc_check(final)
-
-#endif /* USE_MYALLOC */
-#endif /* _MYALLOC_H_ */
-
-/* eof - MyAlloc.h */
diff --git a/BaseTools/Source/C/Common/OsPath.c b/BaseTools/Source/C/Common/OsPath.c
deleted file mode 100644
index 419c8f8b8c..0000000000
--- a/BaseTools/Source/C/Common/OsPath.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/** @file
-
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- StringFuncs.c
-
-Abstract:
-
- Functions useful to operate file directories by parsing file path.
-
-**/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "OsPath.h"
-
-//
-// Functions implementations
-//
-
-#if 0
- //
- // BUGBUG: Not fully implemented yet.
- //
-CHAR8*
-OsPathDirName (
- IN CHAR8 *FilePath
- )
-/*++
-
-Routine Description:
-
- This function returns the directory path which contains the particular path.
- Some examples:
- "a/b/c" -> "a/b"
- "a/b/c/" -> "a/b"
- "a" -> "."
- "." -> ".."
- "/" -> NULL
-
- This function does not check for the existence of the file.
-
- The caller must free the string returned.
-
-Arguments:
-
- FilePath Path name of file to get the parent directory for.
-
-Returns:
-
- NULL if error
-
---*/
-{
- CHAR8 *Return;
- CHAR8 *Pos;
- CHAR8 Char;
- UINTN Length;
- INTN Offset;
-
- Length = strlen (FilePath);
-
- if (Length == 0) {
- return NULL;
- }
-
- //
- // Check for the root directory case
- //
- if (
- (Length == 3 && isalpha (FilePath[0]) && (strcmp(FilePath + 1, ":\\") == 0)) ||
- (strcmp(FilePath, "/") == 0)
- ) {
- return NULL;
- }
-
- //
- // If the path ends with a path separator, then just append ".."
- //
- Char = FilePath[Length - 1];
- if (Char == '/' || Char == '\\') {
- return OsPathJoin (FilePath, "..");
- }
-
- //
- //
- //
- for (Offset = Length; Offset > 0; Offset--) {
- if ((Return[Offset] == '/') || (Return[Offset] == '\\')) {
- Return[Offset] = '\0';
- return Return;
- }
- }
-}
-#endif
-
-
-#if 0
- //
- // BUGBUG: Not fully implemented yet.
- //
-VOID
-OsPathNormPathInPlace (
- IN CHAR8 *Path
- )
-/*++
-
-Routine Description:
-
- This function returns the directory path which contains the particular path.
- Some examples:
- "a/b/../c" -> "a/c"
- "a/b//c" -> "a/b/c"
- "a/./b" -> "a/b"
-
- This function does not check for the existence of the file.
-
-Arguments:
-
- Path Path name of file to normalize
-
-Returns:
-
- The string is altered in place.
-
---*/
-{
- CHAR8 *Pos;
- INTN Offset;
- BOOLEAN TryAgain;
- UINTN Length;
- UINTN Remaining;
- UINTN SubLength;
-
- do {
- TryAgain = FALSE;
- Length = strlen (Path);
-
- for (Offset = 0; Offset < Length; Offset++) {
- Remaining = Length - Offset;
-
- //
- // Collapse '//' -> '/'
- //
- if (
- (Remaining >= 2) &&
- ((Offset > 0) || (Path[0] != '\\')) &&
- IsDirSep (Path[Offset]) && IsDirSep (Path[Offset + 1])
- ) {
- memmove (&Path[Offset], &Path[Offset + 1], Remaining);
- TryAgain = TRUE;
- break;
- }
-
- //
- // Collapse '/./' -> '/'
- //
- if ((Remaining >= 3) && IsDirSep (Path[Offset]) &&
- (Path[Offset + 1] == '.') && IsDirSep (Path[Offset + 2])
- ) {
- memmove (&Path[Offset], &Path[Offset + 1], Remaining);
- TryAgain = TRUE;
- break;
- }
-
- //
- // Collapse 'a/../b' -> 'b'
- //
- // BUGBUG: Not implemented yet
-
- }
-
- } while (TryAgain);
-
- Return = CloneString (FilePath);
- if (Return == NULL) {
- return NULL;
- }
-
- Length = strlen (Return);
-
- //
- // Check for the root directory case
- //
- if (
- (Length == 3 && isalpha (Return[0]) && (strcmp(Return + 1, ":\\") == 0)) ||
- (strcmp(Return, "/") == 0)
- ) {
- free (Return);
- return NULL;
- }
-
- //
- //
- //
- for (Offset = Length; Offset > 0; Offset--) {
- if ((Return[Offset] == '/') || (Return[Offset] == '\\')) {
- Return[Offset] = '\0';
- return Return;
- }
- }
-}
-#endif
-
-
-CHAR8*
-OsPathPeerFilePath (
- IN CHAR8 *OldPath,
- IN CHAR8 *Peer
- )
-/*++
-
-Routine Description:
-
- This function replaces the final portion of a path with an alternative
- 'peer' filename. For example:
- "a/b/../c", "peer" -> "a/b/../peer"
- "a/b/", "peer" -> "a/b/peer"
- "/a", "peer" -> "/peer"
- "a", "peer" -> "peer"
-
- This function does not check for the existence of the file.
-
-Arguments:
-
- OldPath Path name of replace the final segment
- Peer The new path name to concatinate to become the peer path
-
-Returns:
-
- A CHAR8* string, which must be freed by the caller
-
---*/
-{
- CHAR8 *Result;
- INTN Offset;
-
- Result = (CHAR8 *) malloc (strlen (OldPath) + strlen (Peer) + 1);
- if (Result == NULL) {
- return NULL;
- }
-
- strcpy (Result, OldPath);
-
- //
- // Search for the last '/' or '\' in the string. If found, replace
- // everything following it with Peer
- //
- for (Offset = strlen (Result); Offset >= 0; Offset--) {
- if ((Result[Offset] == '/') || (Result[Offset] == '\\')) {
- Result[Offset + 1] = '\0';
- strcat (Result, Peer);
- return Result;
- }
- }
-
- //
- // Neither a '/' nor a '\' was found. Therefore, we simply return Peer.
- //
- strcpy (Result, Peer);
- return Result;
-}
-
-
-BOOLEAN
-OsPathExists (
- IN CHAR8 *InputFileName
- )
-/*++
-
-Routine Description:
-
- Checks if a file exists
-
-Arguments:
-
- InputFileName The name of the file to check for existence
-
-Returns:
-
- TRUE The file exists
- FALSE The file does not exist
-
---*/
-{
- FILE *InputFile;
- InputFile = fopen (InputFileName, "rb");
- if (InputFile == NULL) {
- return FALSE;
- } else {
- fclose (InputFile);
- return TRUE;
- }
-}
-
-
-
diff --git a/BaseTools/Source/C/Common/OsPath.h b/BaseTools/Source/C/Common/OsPath.h
deleted file mode 100644
index 9e7df070c5..0000000000
--- a/BaseTools/Source/C/Common/OsPath.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/** @file
-
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- OsPath.h
-
-Abstract:
-
- Header file for helper functions useful to operate file directories
- by parsing file path.
-
-**/
-
-#ifndef _EFI_OS_PATH_H
-#define _EFI_OS_PATH_H
-
-#include <Common/UefiBaseTypes.h>
-
-//
-// Functions declarations
-//
-
-CHAR8*
-OsPathDirName (
- IN CHAR8 *FilePath
- )
-;
-/**
-
-Routine Description:
-
- This function returns the directory path which contains the particular path.
- Some examples:
- "a/b/c" -> "a/b"
- "a/b/c/" -> "a/b"
- "a" -> "."
- "." -> ".."
- "/" -> NULL
-
- This function does not check for the existence of the file.
-
- The caller must free the string returned.
-
-Arguments:
-
- FilePath Path name of file to get the parent directory for.
-
-Returns:
-
- NULL if error
-
-**/
-
-
-VOID
-OsPathNormPathInPlace (
- IN CHAR8 *Path
- )
-;
-/**
-
-Routine Description:
-
- This function returns the directory path which contains the particular path.
- Some examples:
- "a/b/../c" -> "a/c"
- "a/b//c" -> "a/b/c"
- "a/./b" -> "a/b"
-
- This function does not check for the existence of the file.
-
-Arguments:
-
- Path Path name of file to normalize
-
-Returns:
-
- The string is altered in place.
-
-**/
-
-
-CHAR8*
-OsPathPeerFilePath (
- IN CHAR8 *OldPath,
- IN CHAR8 *Peer
- )
-;
-/**
-
-Routine Description:
-
- This function replaces the final portion of a path with an alternative
- 'peer' filename. For example:
- "a/b/../c", "peer" -> "a/b/../peer"
- "a/b/", "peer" -> "a/b/peer"
- "/a", "peer" -> "/peer"
- "a", "peer" -> "peer"
-
- This function does not check for the existence of the file.
-
-Arguments:
-
- OldPath Path name of replace the final segment
- Peer The new path name to concatinate to become the peer path
-
-Returns:
-
- A CHAR8* string, which must be freed by the caller
-
-**/
-
-
-BOOLEAN
-OsPathExists (
- IN CHAR8 *InputFileName
- )
-;
-/**
-
-Routine Description:
-
- Checks if a file exists
-
-Arguments:
-
- InputFileName The name of the file to check for existence
-
-Returns:
-
- TRUE The file exists
- FALSE The file does not exist
-
-**/
-
-
-#endif
diff --git a/BaseTools/Source/C/Common/ParseGuidedSectionTools.c b/BaseTools/Source/C/Common/ParseGuidedSectionTools.c
deleted file mode 100644
index 8ddfd00b7e..0000000000
--- a/BaseTools/Source/C/Common/ParseGuidedSectionTools.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/** @file
-
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- ParseGuidedSectionTools.c
-
-Abstract:
-
- Helper functions for parsing GuidedSectionTools.txt
-
-**/
-
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include "MemoryFile.h"
-#include "CommonLib.h"
-#include "EfiUtilityMsgs.h"
-#include "ParseInf.h"
-#include "ParseGuidedSectionTools.h"
-#include "StringFuncs.h"
-
-
-//
-// Local types / structures
-//
-
-typedef struct _GUID_SEC_TOOL_ENTRY {
- EFI_GUID Guid;
- CHAR8* Name;
- CHAR8* Path;
- struct _GUID_SEC_TOOL_ENTRY *Next;
-} GUID_SEC_TOOL_ENTRY;
-
-//
-// Functin Implementation
-//
-
-EFI_HANDLE
-ParseGuidedSectionToolsFile (
- IN CHAR8 *InputFile
- )
-/*++
-
-Routine Description:
-
- This function parses the tools_def.txt file. It returns a
- EFI_HANDLE object which can be used for the other library
- functions and should be passed to FreeParsedGuidedSectionToolsHandle
- to free resources when the tools_def.txt information is no
- longer needed.
-
-Arguments:
-
- InputFile Path name of file to read
-
-Returns:
-
- NULL if error parsing
- A non-NULL EFI_HANDLE otherwise
-
---*/
-{
- EFI_STATUS Status;
- EFI_HANDLE MemoryFile;
- EFI_HANDLE ParsedGuidedSectionTools;
-
- Status = GetMemoryFile (InputFile, &MemoryFile);
- if (EFI_ERROR (Status)) {
- return NULL;
- }
-
- ParsedGuidedSectionTools = ParseGuidedSectionToolsMemoryFile (MemoryFile);
-
- FreeMemoryFile (MemoryFile);
-
- return ParsedGuidedSectionTools;
-}
-
-
-EFI_HANDLE
-ParseGuidedSectionToolsMemoryFile (
- IN EFI_HANDLE InputFile
- )
-/*++
-
-Routine Description:
-
- This function parses the tools_def.txt file. It returns a
- EFI_HANDLE object which can be used for the other library
- functions and should be passed to FreeParsedGuidedSectionToolsHandle
- to free resources when the tools_def.txt information is no
- longer needed.
-
-Arguments:
-
- InputFile Memory file image.
-
-Returns:
-
- NULL if error or EOF
- InputBuffer otherwise
-
---*/
-{
- EFI_STATUS Status;
- CHAR8 *NextLine;
- STRING_LIST *Tool;
- EFI_GUID Guid;
- GUID_SEC_TOOL_ENTRY *FirstGuidTool;
- GUID_SEC_TOOL_ENTRY *LastGuidTool;
- GUID_SEC_TOOL_ENTRY *NewGuidTool;
-
- FirstGuidTool = NULL;
- LastGuidTool = NULL;
-
- while (TRUE) {
- NextLine = ReadMemoryFileLine (InputFile);
- if (NextLine == NULL) {
- break;
- }
-
- Status = StripInfDscStringInPlace (NextLine);
- if (EFI_ERROR (Status)) {
- break;
- }
-
- if (NextLine[0] == '\0') {
- continue;
- }
-
- Tool = SplitStringByWhitespace (NextLine);
- if ((Tool != NULL) &&
- (Tool->Count == 3)
- ) {
- Status = StringToGuid (Tool->Strings[0], &Guid);
- if (!EFI_ERROR (Status)) {
- NewGuidTool = malloc (sizeof (GUID_SEC_TOOL_ENTRY));
- if (NewGuidTool != NULL) {
- memcpy (&(NewGuidTool->Guid), &Guid, sizeof (Guid));
- NewGuidTool->Name = CloneString(Tool->Strings[1]);
- NewGuidTool->Path = CloneString(Tool->Strings[2]);
- NewGuidTool->Next = NULL;
- }
- if (FirstGuidTool == NULL) {
- FirstGuidTool = NewGuidTool;
- } else {
- LastGuidTool->Next = NewGuidTool;
- }
- LastGuidTool = NewGuidTool;
- }
- FreeStringList (Tool);
- }
- }
-
- return FirstGuidTool;
-}
-
-
-CHAR8*
-LookupGuidedSectionToolPath (
- IN EFI_HANDLE ParsedGuidedSectionToolsHandle,
- IN EFI_GUID *SectionGuid
- )
-/*++
-
-Routine Description:
-
- This function looks up the appropriate tool to use for extracting
- a GUID defined FV section.
-
-Arguments:
-
- ParsedGuidedSectionToolsHandle A parsed GUID section tools handle.
- SectionGuid The GUID for the section.
-
-Returns:
-
- NULL - if no tool is found or there is another error
- Non-NULL - The tool to use to access the section contents. (The caller
- must free the memory associated with this string.)
-
---*/
-{
- GUID_SEC_TOOL_ENTRY *GuidTool;
-
- GuidTool = (GUID_SEC_TOOL_ENTRY*)ParsedGuidedSectionToolsHandle;
- if (GuidTool == NULL) {
- return NULL;
- }
-
- for ( ; GuidTool != NULL; GuidTool = GuidTool->Next) {
- if (CompareGuid (&(GuidTool->Guid), SectionGuid) == 0) {
- return CloneString (GuidTool->Path);
- }
- }
-
- return NULL;
-}
-
-
diff --git a/BaseTools/Source/C/Common/ParseGuidedSectionTools.h b/BaseTools/Source/C/Common/ParseGuidedSectionTools.h
deleted file mode 100644
index b4c55974e3..0000000000
--- a/BaseTools/Source/C/Common/ParseGuidedSectionTools.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/** @file
-
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- ParseGuidedSectionTools.h
-
-Abstract:
-
- Header file for helper functions for parsing GuidedSectionTools.txt
-
-**/
-
-#ifndef _EFI_PARSE_GUIDED_SECTION_TOOLS_H
-#define _EFI_PARSE_GUIDED_SECTION_TOOLS_H
-
-#include <Common/UefiBaseTypes.h>
-
-//
-// Functions declarations
-//
-
-EFI_HANDLE
-ParseGuidedSectionToolsFile (
- IN CHAR8 *InputFile
- )
-;
-/**
-
-Routine Description:
-
- This function parses the tools_def.txt file. It returns a
- EFI_HANDLE object which can be used for the other library
- functions and should be passed to FreeParsedToolsDefHandle
- to free resources when the tools_def.txt information is no
- longer needed.
-
-Arguments:
-
- InputFile Path name of file to read
-
-Returns:
-
- NULL if error parsing
- A non-NULL EFI_HANDLE otherwise
-
-**/
-
-
-EFI_HANDLE
-ParseGuidedSectionToolsMemoryFile (
- IN EFI_HANDLE InputFile
- )
-;
-/**
-
-Routine Description:
-
- This function parses the tools_def.txt file. It returns a
- EFI_HANDLE object which can be used for the other library
- functions and should be passed to FreeParsedToolsDefHandle
- to free resources when the tools_def.txt information is no
- longer needed.
-
-Arguments:
-
- InputFile Memory file image.
-
-Returns:
-
- NULL if error parsing
- A non-NULL EFI_HANDLE otherwise
-
-**/
-
-CHAR8*
-LookupGuidedSectionToolPath (
- IN EFI_HANDLE ParsedGuidedSectionToolsHandle,
- IN EFI_GUID *SectionGuid
- )
-;
-/**
-
-Routine Description:
-
- This function looks up the appropriate tool to use for extracting
- a GUID defined FV section.
-
-Arguments:
-
- ParsedGuidedSectionToolsHandle A parsed GUID section tools handle.
- SectionGuid The GUID for the section.
-
-Returns:
-
- NULL - if no tool is found or there is another error
- Non-NULL - The tool to use to access the section contents. (The caller
- must free the memory associated with this string.)
-
-**/
-
-EFI_STATUS
-FreeParsedGuidedSectionToolsHandle (
- IN EFI_HANDLE ParsedGuidedSectionToolsHandle
- )
-;
-/**
-
-Routine Description:
-
- Frees resources that were allocated by ParseGuidedSectionToolsFile.
- After freeing these resources, the information that was parsed
- is no longer accessible.
-
-Arguments:
-
- ParsedToolDefHandle Handle returned from ParseGuidedSectionToolsFile
-
-Returns:
-
- EFI_STATUS
-
-**/
-
-#endif
diff --git a/BaseTools/Source/C/Common/ParseInf.c b/BaseTools/Source/C/Common/ParseInf.c
deleted file mode 100644
index bbccb61732..0000000000
--- a/BaseTools/Source/C/Common/ParseInf.c
+++ /dev/null
@@ -1,689 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- ParseInf.c
-
-Abstract:
-
- This contains some useful functions for parsing INF files.
-
---*/
-
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include "EfiUtilityMsgs.h"
-#include "ParseInf.h"
-
-CHAR8 *
-ReadLine (
- IN MEMORY_FILE *InputFile,
- IN OUT CHAR8 *InputBuffer,
- IN UINTN MaxLength
- )
-/*++
-
-Routine Description:
-
- This function reads a line, stripping any comments.
- The function reads a string from the input stream argument and stores it in
- the input string. ReadLine reads characters from the current file position
- to and including the first newline character, to the end of the stream, or
- until the number of characters read is equal to MaxLength - 1, whichever
- comes first. The newline character, if read, is replaced with a \0.
-
-Arguments:
-
- InputFile Memory file image.
- InputBuffer Buffer to read into, must be _MAX_PATH size.
- MaxLength The maximum size of the input buffer.
-
-Returns:
-
- NULL if error or EOF
- InputBuffer otherwise
-
---*/
-{
- CHAR8 *CharPtr;
- CHAR8 *EndOfLine;
- UINTN CharsToCopy;
-
- //
- // Verify input parameters are not null
- //
- assert (InputBuffer);
- assert (InputFile->FileImage);
- assert (InputFile->Eof);
- assert (InputFile->CurrentFilePointer);
-
- //
- // Check for end of file condition
- //
- if (InputFile->CurrentFilePointer >= InputFile->Eof) {
- return NULL;
- }
- //
- // Find the next newline char
- //
- EndOfLine = strchr (InputFile->CurrentFilePointer, '\n');
-
- //
- // Determine the number of characters to copy.
- //
- if (EndOfLine == 0) {
- //
- // If no newline found, copy to the end of the file.
- //
- CharsToCopy = InputFile->Eof - InputFile->CurrentFilePointer;
- } else if (EndOfLine >= InputFile->Eof) {
- //
- // If the newline found was beyond the end of file, copy to the eof.
- //
- CharsToCopy = InputFile->Eof - InputFile->CurrentFilePointer;
- } else {
- //
- // Newline found in the file.
- //
- CharsToCopy = EndOfLine - InputFile->CurrentFilePointer;
- }
- //
- // If the end of line is too big for the current buffer, set it to the max
- // size of the buffer (leaving room for the \0.
- //
- if (CharsToCopy > MaxLength - 1) {
- CharsToCopy = MaxLength - 1;
- }
- //
- // Copy the line.
- //
- memcpy (InputBuffer, InputFile->CurrentFilePointer, CharsToCopy);
-
- //
- // Add the null termination over the 0x0D
- //
- if (InputBuffer[CharsToCopy - 1] == '\r') {
-
- InputBuffer[CharsToCopy - 1] = '\0';
-
- } else {
-
- InputBuffer[CharsToCopy] = '\0';
-
- }
-
- //
- // Increment the current file pointer (include the 0x0A)
- //
- InputFile->CurrentFilePointer += CharsToCopy + 1;
-
- //
- // Strip any comments
- //
- CharPtr = strstr (InputBuffer, "//");
- if (CharPtr != 0) {
- CharPtr[0] = 0;
- }
- //
- // Return the string
- //
- return InputBuffer;
-}
-
-BOOLEAN
-FindSection (
- IN MEMORY_FILE *InputFile,
- IN CHAR8 *Section
- )
-/*++
-
-Routine Description:
-
- This function parses a file from the beginning to find a section.
- The section string may be anywhere within a line.
-
-Arguments:
-
- InputFile Memory file image.
- Section Section to search for
-
-Returns:
-
- FALSE if error or EOF
- TRUE if section found
-
---*/
-{
- CHAR8 InputBuffer[_MAX_PATH];
- CHAR8 *CurrentToken;
-
- //
- // Verify input is not NULL
- //
- assert (InputFile->FileImage);
- assert (InputFile->Eof);
- assert (InputFile->CurrentFilePointer);
- assert (Section);
-
- //
- // Rewind to beginning of file
- //
- InputFile->CurrentFilePointer = InputFile->FileImage;
-
- //
- // Read lines until the section is found
- //
- while (InputFile->CurrentFilePointer < InputFile->Eof) {
- //
- // Read a line
- //
- ReadLine (InputFile, InputBuffer, _MAX_PATH);
-
- //
- // Check if the section is found
- //
- CurrentToken = strstr (InputBuffer, Section);
- if (CurrentToken != NULL) {
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-EFI_STATUS
-FindToken (
- IN MEMORY_FILE *InputFile,
- IN CHAR8 *Section,
- IN CHAR8 *Token,
- IN UINTN Instance,
- OUT CHAR8 *Value
- )
-/*++
-
-Routine Description:
-
- Finds a token value given the section and token to search for.
-
-Arguments:
-
- InputFile Memory file image.
- Section The section to search for, a string within [].
- Token The token to search for, e.g. EFI_PEIM_RECOVERY, followed by an = in the INF file.
- Instance The instance of the token to search for. Zero is the first instance.
- Value The string that holds the value following the =. Must be _MAX_PATH in size.
-
-Returns:
-
- EFI_SUCCESS Value found.
- EFI_ABORTED Format error detected in INF file.
- EFI_INVALID_PARAMETER Input argument was null.
- EFI_LOAD_ERROR Error reading from the file.
- EFI_NOT_FOUND Section/Token/Value not found.
-
---*/
-{
- CHAR8 InputBuffer[_MAX_PATH];
- CHAR8 *CurrentToken;
- BOOLEAN ParseError;
- BOOLEAN ReadError;
- UINTN Occurrance;
-
- //
- // Check input parameters
- //
- if (InputFile->FileImage == NULL ||
- InputFile->Eof == NULL ||
- InputFile->CurrentFilePointer == NULL ||
- Section == NULL ||
- strlen (Section) == 0 ||
- Token == NULL ||
- strlen (Token) == 0 ||
- Value == NULL
- ) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Initialize error codes
- //
- ParseError = FALSE;
- ReadError = FALSE;
-
- //
- // Initialize our instance counter for the search token
- //
- Occurrance = 0;
-
- if (FindSection (InputFile, Section)) {
- //
- // Found the desired section, find and read the desired token
- //
- do {
- //
- // Read a line from the file
- //
- if (ReadLine (InputFile, InputBuffer, _MAX_PATH) == NULL) {
- //
- // Error reading from input file
- //
- ReadError = TRUE;
- break;
- }
- //
- // Get the first non-whitespace string
- //
- CurrentToken = strtok (InputBuffer, " \t\n");
- if (CurrentToken == NULL) {
- //
- // Whitespace line found (or comment) so continue
- //
- CurrentToken = InputBuffer;
- continue;
- }
- //
- // Make sure we have not reached the end of the current section
- //
- if (CurrentToken[0] == '[') {
- break;
- }
- //
- // Compare the current token with the desired token
- //
- if (strcmp (CurrentToken, Token) == 0) {
- //
- // Found it
- //
- //
- // Check if it is the correct instance
- //
- if (Instance == Occurrance) {
- //
- // Copy the contents following the =
- //
- CurrentToken = strtok (NULL, "= \t\n");
- if (CurrentToken == NULL) {
- //
- // Nothing found, parsing error
- //
- ParseError = TRUE;
- } else {
- //
- // Copy the current token to the output value
- //
- strcpy (Value, CurrentToken);
- return EFI_SUCCESS;
- }
- } else {
- //
- // Increment the occurrance found
- //
- Occurrance++;
- }
- }
- } while (
- !ParseError &&
- !ReadError &&
- InputFile->CurrentFilePointer < InputFile->Eof &&
- CurrentToken[0] != '[' &&
- Occurrance <= Instance
- );
- }
- //
- // Distinguish between read errors and INF file format errors.
- //
- if (ReadError) {
- return EFI_LOAD_ERROR;
- }
-
- if (ParseError) {
- return EFI_ABORTED;
- }
-
- return EFI_NOT_FOUND;
-}
-
-EFI_STATUS
-StringToGuid (
- IN CHAR8 *AsciiGuidBuffer,
- OUT EFI_GUID *GuidBuffer
- )
-/*++
-
-Routine Description:
-
- Converts a string to an EFI_GUID. The string must be in the
- xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format.
-
-Arguments:
-
- AsciiGuidBuffer - pointer to ascii string
- GuidBuffer - pointer to destination Guid
-
-Returns:
-
- EFI_ABORTED Could not convert the string
- EFI_SUCCESS The string was successfully converted
- EFI_INVALID_PARAMETER Input parameter is invalid.
-
---*/
-{
- INT32 Index;
- unsigned Data1;
- unsigned Data2;
- unsigned Data3;
- unsigned Data4[8];
-
- if (AsciiGuidBuffer == NULL || GuidBuffer == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Check Guid Format strictly xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- //
- for (Index = 0; AsciiGuidBuffer[Index] != '\0' && Index < 37; Index ++) {
- if (Index == 8 || Index == 13 || Index == 18 || Index == 23) {
- if (AsciiGuidBuffer[Index] != '-') {
- break;
- }
- } else {
- if (((AsciiGuidBuffer[Index] >= '0') && (AsciiGuidBuffer[Index] <= '9')) ||
- ((AsciiGuidBuffer[Index] >= 'a') && (AsciiGuidBuffer[Index] <= 'f')) ||
- ((AsciiGuidBuffer[Index] >= 'A') && (AsciiGuidBuffer[Index] <= 'F'))) {
- continue;
- } else {
- break;
- }
- }
- }
-
- if (Index < 36 || AsciiGuidBuffer[36] != '\0') {
- Error (NULL, 0, 1003, "Invalid option value", "Incorrect GUID \"%s\"\n Correct Format \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"", AsciiGuidBuffer);
- return EFI_ABORTED;
- }
-
- //
- // Scan the guid string into the buffer
- //
- Index = sscanf (
- AsciiGuidBuffer,
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- &Data1,
- &Data2,
- &Data3,
- &Data4[0],
- &Data4[1],
- &Data4[2],
- &Data4[3],
- &Data4[4],
- &Data4[5],
- &Data4[6],
- &Data4[7]
- );
-
- //
- // Verify the correct number of items were scanned.
- //
- if (Index != 11) {
- Error (NULL, 0, 1003, "Invalid option value", "Incorrect GUID \"%s\"\n Correct Format \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"", AsciiGuidBuffer);
- return EFI_ABORTED;
- }
- //
- // Copy the data into our GUID.
- //
- GuidBuffer->Data1 = (UINT32) Data1;
- GuidBuffer->Data2 = (UINT16) Data2;
- GuidBuffer->Data3 = (UINT16) Data3;
- GuidBuffer->Data4[0] = (UINT8) Data4[0];
- GuidBuffer->Data4[1] = (UINT8) Data4[1];
- GuidBuffer->Data4[2] = (UINT8) Data4[2];
- GuidBuffer->Data4[3] = (UINT8) Data4[3];
- GuidBuffer->Data4[4] = (UINT8) Data4[4];
- GuidBuffer->Data4[5] = (UINT8) Data4[5];
- GuidBuffer->Data4[6] = (UINT8) Data4[6];
- GuidBuffer->Data4[7] = (UINT8) Data4[7];
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-AsciiStringToUint64 (
- IN CONST CHAR8 *AsciiString,
- IN BOOLEAN IsHex,
- OUT UINT64 *ReturnValue
- )
-/*++
-
-Routine Description:
-
- Converts a null terminated ascii string that represents a number into a
- UINT64 value. A hex number may be preceeded by a 0x, but may not be
- succeeded by an h. A number without 0x or 0X is considered to be base 10
- unless the IsHex input is true.
-
-Arguments:
-
- AsciiString The string to convert.
- IsHex Force the string to be treated as a hex number.
- ReturnValue The return value.
-
-Returns:
-
- EFI_SUCCESS Number successfully converted.
- EFI_ABORTED Invalid character encountered.
-
---*/
-{
- UINT8 Index;
- UINT64 Value;
- CHAR8 CurrentChar;
-
- //
- // Initialize the result
- //
- Value = 0;
- Index = 0;
-
- //
- // Check input paramter
- //
- if (AsciiString == NULL || ReturnValue == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- while (AsciiString[Index] == ' ') {
- Index ++;
- }
-
- //
- // Add each character to the result
- //
-
- //
- // Skip first two chars only if the string starts with '0x' or '0X'
- //
- if (AsciiString[Index] == '0' && (AsciiString[Index + 1] == 'x' || AsciiString[Index + 1] == 'X')) {
- IsHex = TRUE;
- Index += 2;
- }
- if (IsHex) {
- //
- // Convert the hex string.
- //
- for (; AsciiString[Index] != '\0'; Index++) {
- CurrentChar = AsciiString[Index];
- if (CurrentChar == ' ') {
- break;
- }
- //
- // Verify Hex string
- //
- if (isxdigit ((int)CurrentChar) == 0) {
- return EFI_ABORTED;
- }
- //
- // Add hex value
- //
- Value *= 16;
- if (CurrentChar >= '0' && CurrentChar <= '9') {
- Value += CurrentChar - '0';
- } else if (CurrentChar >= 'a' && CurrentChar <= 'f') {
- Value += CurrentChar - 'a' + 10;
- } else if (CurrentChar >= 'A' && CurrentChar <= 'F') {
- Value += CurrentChar - 'A' + 10;
- }
- }
-
- *ReturnValue = Value;
- } else {
- //
- // Convert dec string is a number
- //
- for (; Index < strlen (AsciiString); Index++) {
- CurrentChar = AsciiString[Index];
- if (CurrentChar == ' ') {
- break;
- }
- //
- // Verify Dec string
- //
- if (isdigit ((int)CurrentChar) == 0) {
- return EFI_ABORTED;
- }
- //
- // Add dec value
- //
- Value = Value * 10;
- Value += CurrentChar - '0';
- }
-
- *ReturnValue = Value;
- }
-
- return EFI_SUCCESS;
-}
-
-CHAR8 *
-ReadLineInStream (
- IN FILE *InputFile,
- IN OUT CHAR8 *InputBuffer
- )
-/*++
-
-Routine Description:
-
- This function reads a line, stripping any comments.
- // BUGBUG: This is obsolete once genmake goes away...
-
-Arguments:
-
- InputFile Stream pointer.
- InputBuffer Buffer to read into, must be _MAX_PATH size.
-
-Returns:
-
- NULL if error or EOF
- InputBuffer otherwise
-
---*/
-{
- CHAR8 *CharPtr;
-
- //
- // Verify input parameters are not null
- //
- assert (InputFile);
- assert (InputBuffer);
-
- //
- // Read a line
- //
- if (fgets (InputBuffer, _MAX_PATH, InputFile) == NULL) {
- return NULL;
- }
- //
- // Strip any comments
- //
- CharPtr = strstr (InputBuffer, "//");
- if (CharPtr != 0) {
- CharPtr[0] = 0;
- }
-
- CharPtr = strstr (InputBuffer, "#");
- if (CharPtr != 0) {
- CharPtr[0] = 0;
- }
- //
- // Return the string
- //
- return InputBuffer;
-}
-
-BOOLEAN
-FindSectionInStream (
- IN FILE *InputFile,
- IN CHAR8 *Section
- )
-/*++
-
-Routine Description:
-
- This function parses a stream file from the beginning to find a section.
- The section string may be anywhere within a line.
- // BUGBUG: This is obsolete once genmake goes away...
-
-Arguments:
-
- InputFile Stream pointer.
- Section Section to search for
-
-Returns:
-
- FALSE if error or EOF
- TRUE if section found
-
---*/
-{
- CHAR8 InputBuffer[_MAX_PATH];
- CHAR8 *CurrentToken;
-
- //
- // Verify input is not NULL
- //
- assert (InputFile);
- assert (Section);
-
- //
- // Rewind to beginning of file
- //
- if (fseek (InputFile, 0, SEEK_SET) != 0) {
- return FALSE;
- }
- //
- // Read lines until the section is found
- //
- while (feof (InputFile) == 0) {
- //
- // Read a line
- //
- ReadLineInStream (InputFile, InputBuffer);
-
- //
- // Check if the section is found
- //
- CurrentToken = strstr (InputBuffer, Section);
- if (CurrentToken != NULL) {
- return TRUE;
- }
- }
-
- return FALSE;
-}
diff --git a/BaseTools/Source/C/Common/ParseInf.h b/BaseTools/Source/C/Common/ParseInf.h
deleted file mode 100644
index dfd180db74..0000000000
--- a/BaseTools/Source/C/Common/ParseInf.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- ParseInf.h
-
-Abstract:
-
- Header file for helper functions useful for parsing INF files.
-
-**/
-
-#ifndef _EFI_PARSE_INF_H
-#define _EFI_PARSE_INF_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <Common/UefiBaseTypes.h>
-#include <MemoryFile.h>
-
-#ifndef _MAX_PATH
-#define _MAX_PATH 500
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-//
-// Functions declarations
-//
-CHAR8 *
-ReadLine (
- IN MEMORY_FILE *InputFile,
- IN OUT CHAR8 *InputBuffer,
- IN UINTN MaxLength
- )
-;
-
-/*++
-
-Routine Description:
-
- This function reads a line, stripping any comments.
- The function reads a string from the input stream argument and stores it in
- the input string. ReadLine reads characters from the current file position
- to and including the first newline character, to the end of the stream, or
- until the number of characters read is equal to MaxLength - 1, whichever
- comes first. The newline character, if read, is replaced with a \0.
-
-Arguments:
-
- InputFile Memory file image.
- InputBuffer Buffer to read into, must be _MAX_PATH size.
- MaxLength The maximum size of the input buffer.
-
-Returns:
-
- NULL if error or EOF
- InputBuffer otherwise
-
---*/
-BOOLEAN
-FindSection (
- IN MEMORY_FILE *InputFile,
- IN CHAR8 *Section
- )
-;
-
-/*++
-
-Routine Description:
-
- This function parses a file from the beginning to find a section.
- The section string may be anywhere within a line.
-
-Arguments:
-
- InputFile Memory file image.
- Section Section to search for
-
-Returns:
-
- FALSE if error or EOF
- TRUE if section found
-
---*/
-EFI_STATUS
-FindToken (
- IN MEMORY_FILE *InputFile,
- IN CHAR8 *Section,
- IN CHAR8 *Token,
- IN UINTN Instance,
- OUT CHAR8 *Value
- )
-;
-
-/*++
-
-Routine Description:
-
- Finds a token value given the section and token to search for.
-
-Arguments:
-
- InputFile Memory file image.
- Section The section to search for, a string within [].
- Token The token to search for, e.g. EFI_PEIM_RECOVERY, followed by an = in the INF file.
- Instance The instance of the token to search for. Zero is the first instance.
- Value The string that holds the value following the =. Must be _MAX_PATH in size.
-
-Returns:
-
- EFI_SUCCESS Value found.
- EFI_ABORTED Format error detected in INF file.
- EFI_INVALID_PARAMETER Input argument was null.
- EFI_LOAD_ERROR Error reading from the file.
- EFI_NOT_FOUND Section/Token/Value not found.
-
---*/
-EFI_STATUS
-StringToGuid (
- IN CHAR8 *AsciiGuidBuffer,
- OUT EFI_GUID *GuidBuffer
- )
-;
-
-/*++
-
-Routine Description:
-
- Converts a string to an EFI_GUID. The string must be in the
- xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format.
-
-Arguments:
-
- GuidBuffer - pointer to destination Guid
- AsciiGuidBuffer - pointer to ascii string
-
-Returns:
-
- EFI_ABORTED Could not convert the string
- EFI_SUCCESS The string was successfully converted
-
---*/
-EFI_STATUS
-AsciiStringToUint64 (
- IN CONST CHAR8 *AsciiString,
- IN BOOLEAN IsHex,
- OUT UINT64 *ReturnValue
- )
-;
-
-/*++
-
-Routine Description:
-
- Converts a null terminated ascii string that represents a number into a
- UINT64 value. A hex number may be preceeded by a 0x, but may not be
- succeeded by an h. A number without 0x or 0X is considered to be base 10
- unless the IsHex input is true.
-
-Arguments:
-
- AsciiString The string to convert.
- IsHex Force the string to be treated as a hex number.
- ReturnValue The return value.
-
-Returns:
-
- EFI_SUCCESS Number successfully converted.
- EFI_ABORTED Invalid character encountered.
-
---*/
-CHAR8 *
-ReadLineInStream (
- IN FILE *InputFile,
- IN OUT CHAR8 *InputBuffer
- )
-;
-
-/*++
-
-Routine Description:
-
- This function reads a line, stripping any comments.
-
-Arguments:
-
- InputFile Stream pointer.
- InputBuffer Buffer to read into, must be _MAX_PATH size.
-
-Returns:
-
- NULL if error or EOF
- InputBuffer otherwise
-
---*/
-BOOLEAN
-FindSectionInStream (
- IN FILE *InputFile,
- IN CHAR8 *Section
- )
-;
-
-/*++
-
-Routine Description:
-
- This function parses a stream file from the beginning to find a section.
- The section string may be anywhere within a line.
-
-Arguments:
-
- InputFile Stream pointer.
- Section Section to search for
-
-Returns:
-
- FALSE if error or EOF
- TRUE if section found
-
---*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/Common/PeCoffLib.h b/BaseTools/Source/C/Common/PeCoffLib.h
deleted file mode 100644
index fe6b29251b..0000000000
--- a/BaseTools/Source/C/Common/PeCoffLib.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/** @file
- Function prototypes and defines on Memory Only PE COFF loader
-
- Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- Module Name: PeCoffLib.h
-
-**/
-
-#ifndef __BASE_PE_COFF_LIB_H__
-#define __BASE_PE_COFF_LIB_H__
-
-//
-// Return status codes from the PE/COFF Loader services
-// BUGBUG: Find where used and see if can be replaced by RETURN_STATUS codes
-//
-#define IMAGE_ERROR_SUCCESS 0
-#define IMAGE_ERROR_IMAGE_READ 1
-#define IMAGE_ERROR_INVALID_PE_HEADER_SIGNATURE 2
-#define IMAGE_ERROR_INVALID_MACHINE_TYPE 3
-#define IMAGE_ERROR_INVALID_SUBSYSTEM 4
-#define IMAGE_ERROR_INVALID_IMAGE_ADDRESS 5
-#define IMAGE_ERROR_INVALID_IMAGE_SIZE 6
-#define IMAGE_ERROR_INVALID_SECTION_ALIGNMENT 7
-#define IMAGE_ERROR_SECTION_NOT_LOADED 8
-#define IMAGE_ERROR_FAILED_RELOCATION 9
-#define IMAGE_ERROR_FAILED_ICACHE_FLUSH 10
-
-
-//
-// PE/COFF Loader Read Function passed in by caller
-//
-typedef
-RETURN_STATUS
-(EFIAPI *PE_COFF_LOADER_READ_FILE) (
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
- );
-
-//
-// Context structure used while PE/COFF image is being loaded and relocated
-//
-typedef struct {
- PHYSICAL_ADDRESS ImageAddress;
- UINT64 ImageSize;
- PHYSICAL_ADDRESS DestinationAddress;
- PHYSICAL_ADDRESS EntryPoint;
- PE_COFF_LOADER_READ_FILE ImageRead;
- VOID *Handle;
- VOID *FixupData;
- UINT32 SectionAlignment;
- UINT32 PeCoffHeaderOffset;
- UINT32 DebugDirectoryEntryRva;
- VOID *CodeView;
- CHAR8 *PdbPointer;
- UINTN SizeOfHeaders;
- UINT32 ImageCodeMemoryType;
- UINT32 ImageDataMemoryType;
- UINT32 ImageError;
- UINTN FixupDataSize;
- UINT16 Machine;
- UINT16 ImageType;
- BOOLEAN RelocationsStripped;
- BOOLEAN IsTeImage;
-} PE_COFF_LOADER_IMAGE_CONTEXT;
-
-
-/**
- Retrieves information on a PE/COFF image
-
- @param ImageContext The context of the image being loaded
-
- @retval EFI_SUCCESS The information on the PE/COFF image was collected.
- @retval EFI_INVALID_PARAMETER ImageContext is NULL.
- @retval EFI_UNSUPPORTED The PE/COFF image is not supported.
- @retval Otherwise The error status from reading the PE/COFF image using the
- ImageContext->ImageRead() function
-
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderGetImageInfo (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-;
-
-/**
- Relocates a PE/COFF image in memory
-
- @param ImageContext Contains information on the loaded image to relocate
-
- @retval EFI_SUCCESS if the PE/COFF image was relocated
- @retval EFI_LOAD_ERROR if the image is not a valid PE/COFF image
- @retval EFI_UNSUPPORTED not support
-
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderRelocateImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-;
-
-/**
- Loads a PE/COFF image into memory
-
- @param ImageContext Contains information on image to load into memory
-
- @retval EFI_SUCCESS if the PE/COFF image was loaded
- @retval EFI_BUFFER_TOO_SMALL if the caller did not provide a large enough buffer
- @retval EFI_LOAD_ERROR if the image is a runtime driver with no relocations
- @retval EFI_INVALID_PARAMETER if the image address is invalid
-
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderLoadImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-;
-
-VOID *
-EFIAPI
-PeCoffLoaderGetPdbPointer (
- IN VOID *Pe32Data
- )
-;
-
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderGetEntryPoint (
- IN VOID *Pe32Data,
- OUT VOID **EntryPoint,
- OUT VOID **BaseOfImage
- )
-;
-
-//
-// These functions are used by the ARM PE/COFF relocation code and by
-// the ELF to PE/COFF converter so that is why they are public
-//
-
-/**
- Pass in a pointer to an ARM MOVT or MOVW immediate instruciton and
- return the immediate data encoded in the instruction
-
- @param Instruction Pointer to ARM MOVT or MOVW immediate instruction
-
- @return Immediate address encoded in the instruction
-
-**/
-UINT16
-EFIAPI
-ThumbMovtImmediateAddress (
- IN UINT16 *Instruction
- );
-
-/**
- Update an ARM MOVT or MOVW immediate instruction immediate data.
-
- @param Instruction Pointer to ARM MOVT or MOVW immediate instruction
- @param Address New addres to patch into the instruction
-
-**/
-VOID
-EFIAPI
-ThumbMovtImmediatePatch (
- IN OUT UINT16 *Instruction,
- IN UINT16 Address
- );
-
-
-/**
- Pass in a pointer to an ARM MOVW/MOVT instruciton pair and
- return the immediate data encoded in the two` instruction
-
- @param Instructions Pointer to ARM MOVW/MOVT insturction pair
-
- @return Immediate address encoded in the instructions
-
-**/
-UINT32
-EFIAPI
-ThumbMovwMovtImmediateAddress (
- IN UINT16 *Instructions
- );
-
-/**
- Update an ARM MOVW/MOVT immediate instruction instruction pair.
-
- @param Instructions Pointer to ARM MOVW/MOVT instruction pair
- @param Address New addres to patch into the instructions
-**/
-VOID
-EFIAPI
-ThumbMovwMovtImmediatePatch (
- IN OUT UINT16 *Instructions,
- IN UINT32 Address
- );
-
-
-
-#endif
diff --git a/BaseTools/Source/C/Common/PeCoffLoaderEx.c b/BaseTools/Source/C/Common/PeCoffLoaderEx.c
deleted file mode 100644
index 8d6b3961f5..0000000000
--- a/BaseTools/Source/C/Common/PeCoffLoaderEx.c
+++ /dev/null
@@ -1,516 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- PeCoffLoaderEx.c
-
-Abstract:
-
- IA32, X64, IPF, ARM and AArch64 Specific relocation fixups
-
-Revision History
-
---*/
-
-#include <Common/UefiBaseTypes.h>
-#include <IndustryStandard/PeImage.h>
-#include "PeCoffLib.h"
-#include "CommonLib.h"
-#include "EfiUtilityMsgs.h"
-
-
-#define EXT_IMM64(Value, Address, Size, InstPos, ValPos) \
- Value |= (((UINT64)((*(Address) >> InstPos) & (((UINT64)1 << Size) - 1))) << ValPos)
-
-#define INS_IMM64(Value, Address, Size, InstPos, ValPos) \
- *(UINT32*)Address = (*(UINT32*)Address & ~(((1 << Size) - 1) << InstPos)) | \
- ((UINT32)((((UINT64)Value >> ValPos) & (((UINT64)1 << Size) - 1))) << InstPos)
-
-#define IMM64_IMM7B_INST_WORD_X 3
-#define IMM64_IMM7B_SIZE_X 7
-#define IMM64_IMM7B_INST_WORD_POS_X 4
-#define IMM64_IMM7B_VAL_POS_X 0
-
-#define IMM64_IMM9D_INST_WORD_X 3
-#define IMM64_IMM9D_SIZE_X 9
-#define IMM64_IMM9D_INST_WORD_POS_X 18
-#define IMM64_IMM9D_VAL_POS_X 7
-
-#define IMM64_IMM5C_INST_WORD_X 3
-#define IMM64_IMM5C_SIZE_X 5
-#define IMM64_IMM5C_INST_WORD_POS_X 13
-#define IMM64_IMM5C_VAL_POS_X 16
-
-#define IMM64_IC_INST_WORD_X 3
-#define IMM64_IC_SIZE_X 1
-#define IMM64_IC_INST_WORD_POS_X 12
-#define IMM64_IC_VAL_POS_X 21
-
-#define IMM64_IMM41a_INST_WORD_X 1
-#define IMM64_IMM41a_SIZE_X 10
-#define IMM64_IMM41a_INST_WORD_POS_X 14
-#define IMM64_IMM41a_VAL_POS_X 22
-
-#define IMM64_IMM41b_INST_WORD_X 1
-#define IMM64_IMM41b_SIZE_X 8
-#define IMM64_IMM41b_INST_WORD_POS_X 24
-#define IMM64_IMM41b_VAL_POS_X 32
-
-#define IMM64_IMM41c_INST_WORD_X 2
-#define IMM64_IMM41c_SIZE_X 23
-#define IMM64_IMM41c_INST_WORD_POS_X 0
-#define IMM64_IMM41c_VAL_POS_X 40
-
-#define IMM64_SIGN_INST_WORD_X 3
-#define IMM64_SIGN_SIZE_X 1
-#define IMM64_SIGN_INST_WORD_POS_X 27
-#define IMM64_SIGN_VAL_POS_X 63
-
-RETURN_STATUS
-PeCoffLoaderRelocateIa32Image (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-/*++
-
-Routine Description:
-
- Performs an IA-32 specific relocation fixup
-
-Arguments:
-
- Reloc - Pointer to the relocation record
-
- Fixup - Pointer to the address to fix up
-
- FixupData - Pointer to a buffer to log the fixups
-
- Adjust - The offset to adjust the fixup
-
-Returns:
-
- EFI_UNSUPPORTED - Unsupported now
-
---*/
-{
- return RETURN_UNSUPPORTED;
-}
-
-RETURN_STATUS
-PeCoffLoaderRelocateIpfImage (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-/*++
-
-Routine Description:
-
- Performs an Itanium-based specific relocation fixup
-
-Arguments:
-
- Reloc - Pointer to the relocation record
-
- Fixup - Pointer to the address to fix up
-
- FixupData - Pointer to a buffer to log the fixups
-
- Adjust - The offset to adjust the fixup
-
-Returns:
-
- Status code
-
---*/
-{
- UINT64 *F64;
- UINT64 FixupVal;
-
- switch ((*Reloc) >> 12) {
-
- case EFI_IMAGE_REL_BASED_DIR64:
- F64 = (UINT64 *) Fixup;
- *F64 = *F64 + (UINT64) Adjust;
- if (*FixupData != NULL) {
- *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
- *(UINT64 *)(*FixupData) = *F64;
- *FixupData = *FixupData + sizeof(UINT64);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_IA64_IMM64:
-
- //
- // Align it to bundle address before fixing up the
- // 64-bit immediate value of the movl instruction.
- //
-
- Fixup = (CHAR8 *)((UINTN) Fixup & (UINTN) ~(15));
- FixupVal = (UINT64)0;
-
- //
- // Extract the lower 32 bits of IMM64 from bundle
- //
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM7B_INST_WORD_X,
- IMM64_IMM7B_SIZE_X,
- IMM64_IMM7B_INST_WORD_POS_X,
- IMM64_IMM7B_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM9D_INST_WORD_X,
- IMM64_IMM9D_SIZE_X,
- IMM64_IMM9D_INST_WORD_POS_X,
- IMM64_IMM9D_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM5C_INST_WORD_X,
- IMM64_IMM5C_SIZE_X,
- IMM64_IMM5C_INST_WORD_POS_X,
- IMM64_IMM5C_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IC_INST_WORD_X,
- IMM64_IC_SIZE_X,
- IMM64_IC_INST_WORD_POS_X,
- IMM64_IC_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM41a_INST_WORD_X,
- IMM64_IMM41a_SIZE_X,
- IMM64_IMM41a_INST_WORD_POS_X,
- IMM64_IMM41a_VAL_POS_X
- );
-
- //
- // Update 64-bit address
- //
- FixupVal += Adjust;
-
- //
- // Insert IMM64 into bundle
- //
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM7B_INST_WORD_X),
- IMM64_IMM7B_SIZE_X,
- IMM64_IMM7B_INST_WORD_POS_X,
- IMM64_IMM7B_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM9D_INST_WORD_X),
- IMM64_IMM9D_SIZE_X,
- IMM64_IMM9D_INST_WORD_POS_X,
- IMM64_IMM9D_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM5C_INST_WORD_X),
- IMM64_IMM5C_SIZE_X,
- IMM64_IMM5C_INST_WORD_POS_X,
- IMM64_IMM5C_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IC_INST_WORD_X),
- IMM64_IC_SIZE_X,
- IMM64_IC_INST_WORD_POS_X,
- IMM64_IC_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM41a_INST_WORD_X),
- IMM64_IMM41a_SIZE_X,
- IMM64_IMM41a_INST_WORD_POS_X,
- IMM64_IMM41a_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM41b_INST_WORD_X),
- IMM64_IMM41b_SIZE_X,
- IMM64_IMM41b_INST_WORD_POS_X,
- IMM64_IMM41b_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM41c_INST_WORD_X),
- IMM64_IMM41c_SIZE_X,
- IMM64_IMM41c_INST_WORD_POS_X,
- IMM64_IMM41c_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_SIGN_INST_WORD_X),
- IMM64_SIGN_SIZE_X,
- IMM64_SIGN_INST_WORD_POS_X,
- IMM64_SIGN_VAL_POS_X
- );
-
- F64 = (UINT64 *) Fixup;
- if (*FixupData != NULL) {
- *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
- *(UINT64 *)(*FixupData) = *F64;
- *FixupData = *FixupData + sizeof(UINT64);
- }
- break;
-
- default:
- return RETURN_UNSUPPORTED;
- }
-
- return RETURN_SUCCESS;
-}
-
-RETURN_STATUS
-PeCoffLoaderRelocateX64Image (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-/**
- Performs an x64 specific relocation fixup
-
- @param Reloc Pointer to the relocation record
- @param Fixup Pointer to the address to fix up
- @param FixupData Pointer to a buffer to log the fixups
- @param Adjust The offset to adjust the fixup
-
- @retval RETURN_SUCCESS Success to perform relocation
- @retval RETURN_UNSUPPORTED Unsupported.
-**/
-{
- UINT64 *F64;
-
- switch ((*Reloc) >> 12) {
-
- case EFI_IMAGE_REL_BASED_DIR64:
- F64 = (UINT64 *) Fixup;
- *F64 = *F64 + (UINT64) Adjust;
- if (*FixupData != NULL) {
- *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
- *(UINT64 *)(*FixupData) = *F64;
- *FixupData = *FixupData + sizeof(UINT64);
- }
- break;
-
- default:
- return RETURN_UNSUPPORTED;
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Pass in a pointer to an ARM MOVT or MOVW immediate instruciton and
- return the immediate data encoded in the instruction
-
- @param Instruction Pointer to ARM MOVT or MOVW immediate instruction
-
- @return Immediate address encoded in the instruction
-
-**/
-UINT16
-ThumbMovtImmediateAddress (
- IN UINT16 *Instruction
- )
-{
- UINT32 Movt;
- UINT16 Address;
-
- // Thumb2 is two 16-bit instructions working together. Not a single 32-bit instruction
- // Example MOVT R0, #0 is 0x0000f2c0 or 0xf2c0 0x0000
- Movt = (*Instruction << 16) | (*(Instruction + 1));
-
- // imm16 = imm4:i:imm3:imm8
- // imm4 -> Bit19:Bit16
- // i -> Bit26
- // imm3 -> Bit14:Bit12
- // imm8 -> Bit7:Bit0
- Address = (UINT16)(Movt & 0x000000ff); // imm8
- Address |= (UINT16)((Movt >> 4) & 0x0000f700); // imm4 imm3
- Address |= (((Movt & BIT26) != 0) ? BIT11 : 0); // i
- return Address;
-}
-
-
-/**
- Update an ARM MOVT or MOVW immediate instruction immediate data.
-
- @param Instruction Pointer to ARM MOVT or MOVW immediate instruction
- @param Address New addres to patch into the instruction
-**/
-VOID
-ThumbMovtImmediatePatch (
- IN OUT UINT16 *Instruction,
- IN UINT16 Address
- )
-{
- UINT16 Patch;
-
- // First 16-bit chunk of instruciton
- Patch = ((Address >> 12) & 0x000f); // imm4
- Patch |= (((Address & BIT11) != 0) ? BIT10 : 0); // i
- *Instruction = (*Instruction & ~0x040f) | Patch;
-
- // Second 16-bit chunk of instruction
- Patch = Address & 0x000000ff; // imm8
- Patch |= ((Address << 4) & 0x00007000); // imm3
- Instruction++;
- *Instruction = (*Instruction & ~0x70ff) | Patch;
-}
-
-/**
- Pass in a pointer to an ARM MOVW/MOVT instruciton pair and
- return the immediate data encoded in the two` instruction
-
- @param Instructions Pointer to ARM MOVW/MOVT insturction pair
-
- @return Immediate address encoded in the instructions
-
-**/
-UINT32
-EFIAPI
-ThumbMovwMovtImmediateAddress (
- IN UINT16 *Instructions
- )
-{
- UINT16 *Word;
- UINT16 *Top;
-
- Word = Instructions; // MOVW
- Top = Word + 2; // MOVT
-
- return (ThumbMovtImmediateAddress (Top) << 16) + ThumbMovtImmediateAddress (Word);
-}
-
-
-/**
- Update an ARM MOVW/MOVT immediate instruction instruction pair.
-
- @param Instructions Pointer to ARM MOVW/MOVT instruction pair
- @param Address New addres to patch into the instructions
-**/
-VOID
-EFIAPI
-ThumbMovwMovtImmediatePatch (
- IN OUT UINT16 *Instructions,
- IN UINT32 Address
- )
-{
- UINT16 *Word;
- UINT16 *Top;
-
- Word = (UINT16 *)Instructions; // MOVW
- Top = Word + 2; // MOVT
-
- ThumbMovtImmediatePatch (Word, (UINT16)(Address & 0xffff));
- ThumbMovtImmediatePatch (Top, (UINT16)(Address >> 16));
-}
-
-
-/**
- Performs an ARM-based specific relocation fixup and is a no-op on other
- instruction sets.
-
- @param Reloc Pointer to the relocation record.
- @param Fixup Pointer to the address to fix up.
- @param FixupData Pointer to a buffer to log the fixups.
- @param Adjust The offset to adjust the fixup.
-
- @return Status code.
-
-**/
-RETURN_STATUS
-PeCoffLoaderRelocateArmImage (
- IN UINT16 **Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-{
- UINT16 *Fixup16;
- UINT32 FixupVal;
-
- Fixup16 = (UINT16 *) Fixup;
-
- switch ((**Reloc) >> 12) {
-
- case EFI_IMAGE_REL_BASED_ARM_MOV32T:
- FixupVal = ThumbMovwMovtImmediateAddress (Fixup16) + (UINT32)Adjust;
- ThumbMovwMovtImmediatePatch (Fixup16, FixupVal);
-
-
- if (*FixupData != NULL) {
- *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
- *(UINT64 *)(*FixupData) = *Fixup16;
- CopyMem (*FixupData, Fixup16, sizeof (UINT64));
- }
- break;
-
- case EFI_IMAGE_REL_BASED_ARM_MOV32A:
- // break omitted - ARM instruction encoding not implemented
- default:
- return RETURN_UNSUPPORTED;
- }
-
- return RETURN_SUCCESS;
-}
-
-RETURN_STATUS
-PeCoffLoaderRelocateAArch64Image (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-/**
- Performs an AArch64 specific relocation fixup
-
- @param Reloc Pointer to the relocation record
- @param Fixup Pointer to the address to fix up
- @param FixupData Pointer to a buffer to log the fixups
- @param Adjust The offset to adjust the fixup
-
- @retval RETURN_SUCCESS Success to perform relocation
- @retval RETURN_UNSUPPORTED Unsupported.
-**/
-{
- UINT64 *F64;
-
- switch ((*Reloc) >> 12) {
-
- case EFI_IMAGE_REL_BASED_DIR64:
- F64 = (UINT64 *) Fixup;
- *F64 = *F64 + (UINT64) Adjust;
- if (*FixupData != NULL) {
- *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
- *(UINT64 *)(*FixupData) = *F64;
- *FixupData = *FixupData + sizeof(UINT64);
- }
- break;
-
- default:
- return RETURN_UNSUPPORTED;
- }
-
- return RETURN_SUCCESS;
-}
diff --git a/BaseTools/Source/C/Common/SimpleFileParsing.c b/BaseTools/Source/C/Common/SimpleFileParsing.c
deleted file mode 100644
index 0f6151819c..0000000000
--- a/BaseTools/Source/C/Common/SimpleFileParsing.c
+++ /dev/null
@@ -1,1443 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- SimpleFileParsing.c
-
-Abstract:
-
- Generic but simple file parsing routines.
-
---*/
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "EfiUtilityMsgs.h"
-#include "SimpleFileParsing.h"
-
-#ifndef MAX_PATH
-#define MAX_PATH 255
-#endif
-//
-// just in case we get in an endless loop.
-//
-#define MAX_NEST_DEPTH 20
-//
-// number of wchars
-//
-#define MAX_STRING_IDENTIFIER_NAME 100
-
-#define T_CHAR_SPACE ' '
-#define T_CHAR_NULL 0
-#define T_CHAR_CR '\r'
-#define T_CHAR_TAB '\t'
-#define T_CHAR_LF '\n'
-#define T_CHAR_SLASH '/'
-#define T_CHAR_BACKSLASH '\\'
-#define T_CHAR_DOUBLE_QUOTE '"'
-#define T_CHAR_LC_X 'x'
-#define T_CHAR_0 '0'
-#define T_CHAR_STAR '*'
-
-//
-// We keep a linked list of these for the source files we process
-//
-typedef struct _SOURCE_FILE {
- FILE *Fptr;
- CHAR8 *FileBuffer;
- CHAR8 *FileBufferPtr;
- UINTN FileSize;
- CHAR8 FileName[MAX_PATH];
- UINTN LineNum;
- BOOLEAN EndOfFile;
- BOOLEAN SkipToHash;
- struct _SOURCE_FILE *Previous;
- struct _SOURCE_FILE *Next;
- CHAR8 ControlCharacter;
-} SOURCE_FILE;
-
-typedef struct {
- CHAR8 *FileBufferPtr;
-} FILE_POSITION;
-
-//
-// Keep all our module globals in this structure
-//
-STATIC struct {
- SOURCE_FILE SourceFile;
- BOOLEAN VerboseFile;
- BOOLEAN VerboseToken;
-} mGlobals;
-
-STATIC
-UINTN
-t_strcmp (
- CHAR8 *Buffer,
- CHAR8 *Str
- );
-
-STATIC
-UINTN
-t_strncmp (
- CHAR8 *Str1,
- CHAR8 *Str2,
- INTN Len
- );
-
-STATIC
-UINTN
-t_strlen (
- CHAR8 *Str
- );
-
-STATIC
-VOID
-RewindFile (
- SOURCE_FILE *SourceFile
- );
-
-STATIC
-BOOLEAN
-IsWhiteSpace (
- SOURCE_FILE *SourceFile
- );
-
-STATIC
-UINTN
-SkipWhiteSpace (
- SOURCE_FILE *SourceFile
- );
-
-STATIC
-BOOLEAN
-EndOfFile (
- SOURCE_FILE *SourceFile
- );
-
-STATIC
-VOID
-PreprocessFile (
- SOURCE_FILE *SourceFile
- );
-
-STATIC
-CHAR8 *
-t_strcpy (
- CHAR8 *Dest,
- CHAR8 *Src
- );
-
-STATIC
-STATUS
-ProcessIncludeFile (
- SOURCE_FILE *SourceFile,
- SOURCE_FILE *ParentSourceFile
- );
-
-STATIC
-STATUS
-ProcessFile (
- SOURCE_FILE *SourceFile
- );
-
-STATIC
-STATUS
-GetFilePosition (
- FILE_POSITION *Fpos
- );
-
-STATIC
-STATUS
-SetFilePosition (
- FILE_POSITION *Fpos
- );
-
-STATUS
-SFPInit (
- VOID
- )
-/*++
-
-Routine Description:
-
-Arguments:
- None.
-
-Returns:
- STATUS_SUCCESS always
-
---*/
-{
- memset ((VOID *) &mGlobals, 0, sizeof (mGlobals));
- return STATUS_SUCCESS;
-}
-
-UINTN
-SFPGetLineNumber (
- VOID
- )
-/*++
-
-Routine Description:
- Return the line number of the file we're parsing. Used
- for error reporting purposes.
-
-Arguments:
- None.
-
-Returns:
- The line number, or 0 if no file is being processed
-
---*/
-{
- return mGlobals.SourceFile.LineNum;
-}
-
-CHAR8 *
-SFPGetFileName (
- VOID
- )
-/*++
-
-Routine Description:
- Return the name of the file we're parsing. Used
- for error reporting purposes.
-
-Arguments:
- None.
-
-Returns:
- A pointer to the file name. Null if no file is being
- processed.
-
---*/
-{
- if (mGlobals.SourceFile.FileName[0]) {
- return mGlobals.SourceFile.FileName;
- }
-
- return NULL;
-}
-
-STATUS
-SFPOpenFile (
- CHAR8 *FileName
- )
-/*++
-
-Routine Description:
- Open a file for parsing.
-
-Arguments:
- FileName - name of the file to parse
-
-Returns:
-
-
---*/
-{
- STATUS Status;
- t_strcpy (mGlobals.SourceFile.FileName, FileName);
- Status = ProcessIncludeFile (&mGlobals.SourceFile, NULL);
- return Status;
-}
-
-BOOLEAN
-SFPIsToken (
- CHAR8 *Str
- )
-/*++
-
-Routine Description:
- Check to see if the specified token is found at
- the current position in the input file.
-
-Arguments:
- Str - the token to look for
-
-Returns:
- TRUE - the token is next
- FALSE - the token is not next
-
-Notes:
- We do a simple string comparison on this function. It is
- the responsibility of the caller to ensure that the token
- is not a subset of some other token.
-
- The file pointer is advanced past the token in the input file.
-
---*/
-{
- UINTN Len;
- SkipWhiteSpace (&mGlobals.SourceFile);
- if (EndOfFile (&mGlobals.SourceFile)) {
- return FALSE;
- }
-
- if ((Len = t_strcmp (mGlobals.SourceFile.FileBufferPtr, Str)) > 0) {
- mGlobals.SourceFile.FileBufferPtr += Len;
- if (mGlobals.VerboseToken) {
- printf ("Token: '%s'\n", Str);
- }
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-BOOLEAN
-SFPIsKeyword (
- CHAR8 *Str
- )
-/*++
-
-Routine Description:
- Check to see if the specified keyword is found at
- the current position in the input file.
-
-Arguments:
- Str - keyword to look for
-
-Returns:
- TRUE - the keyword is next
- FALSE - the keyword is not next
-
-Notes:
- A keyword is defined as a "special" string that has a non-alphanumeric
- character following it.
-
---*/
-{
- UINTN Len;
- SkipWhiteSpace (&mGlobals.SourceFile);
- if (EndOfFile (&mGlobals.SourceFile)) {
- return FALSE;
- }
-
- if ((Len = t_strcmp (mGlobals.SourceFile.FileBufferPtr, Str)) > 0) {
- if (isalnum ((int)mGlobals.SourceFile.FileBufferPtr[Len])) {
- return FALSE;
- }
-
- mGlobals.SourceFile.FileBufferPtr += Len;
- if (mGlobals.VerboseToken) {
- printf ("Token: '%s'\n", Str);
- }
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-BOOLEAN
-SFPGetNextToken (
- CHAR8 *Str,
- UINTN Len
- )
-/*++
-
-Routine Description:
- Get the next token from the input stream.
-
-Arguments:
- Str - pointer to a copy of the next token
- Len - size of buffer pointed to by Str
-
-Returns:
- TRUE - next token successfully returned
- FALSE - otherwise
-
-Notes:
- Preceeding white space is ignored.
- The parser's buffer pointer is advanced past the end of the
- token.
-
---*/
-{
- UINTN Index;
- CHAR8 TempChar;
-
- SkipWhiteSpace (&mGlobals.SourceFile);
- if (EndOfFile (&mGlobals.SourceFile)) {
- return FALSE;
- }
- //
- // Have to have enough string for at least one char and a null-terminator
- //
- if (Len < 2) {
- return FALSE;
- }
- //
- // Look at the first character. If it's an identifier, then treat it
- // as such
- //
- TempChar = mGlobals.SourceFile.FileBufferPtr[0];
- if (((TempChar >= 'a') && (TempChar <= 'z')) || ((TempChar >= 'A') && (TempChar <= 'Z')) || (TempChar == '_')) {
- Str[0] = TempChar;
- mGlobals.SourceFile.FileBufferPtr++;
- Index = 1;
- while (!EndOfFile (&mGlobals.SourceFile) && (Index < Len)) {
- TempChar = mGlobals.SourceFile.FileBufferPtr[0];
- if (((TempChar >= 'a') && (TempChar <= 'z')) ||
- ((TempChar >= 'A') && (TempChar <= 'Z')) ||
- ((TempChar >= '0') && (TempChar <= '9')) ||
- (TempChar == '_')
- ) {
- Str[Index] = mGlobals.SourceFile.FileBufferPtr[0];
- mGlobals.SourceFile.FileBufferPtr++;
- Index++;
- } else {
- //
- // Invalid character for symbol name, so break out
- //
- break;
- }
- }
- //
- // Null terminate and return success
- //
- Str[Index] = 0;
- return TRUE;
- } else if ((TempChar == ')') || (TempChar == '(') || (TempChar == '*')) {
- Str[0] = mGlobals.SourceFile.FileBufferPtr[0];
- mGlobals.SourceFile.FileBufferPtr++;
- Str[1] = 0;
- return TRUE;
- } else {
- //
- // Everything else is white-space (or EOF) separated
- //
- Index = 0;
- while (!EndOfFile (&mGlobals.SourceFile) && (Index < Len)) {
- if (IsWhiteSpace (&mGlobals.SourceFile)) {
- if (Index > 0) {
- Str[Index] = 0;
- return TRUE;
- }
-
- return FALSE;
- } else {
- Str[Index] = mGlobals.SourceFile.FileBufferPtr[0];
- mGlobals.SourceFile.FileBufferPtr++;
- Index++;
- }
- }
- //
- // See if we just ran out of file contents, but did find a token
- //
- if ((Index > 0) && EndOfFile (&mGlobals.SourceFile)) {
- Str[Index] = 0;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-BOOLEAN
-SFPGetGuidToken (
- CHAR8 *Str,
- UINT32 Len
- )
-/*++
-
-Routine Description:
- Parse a GUID from the input stream. Stop when you discover white space.
-
-Arguments:
- Str - pointer to a copy of the next token
- Len - size of buffer pointed to by Str
-
-Returns:
- TRUE - GUID string returned successfully
- FALSE - otherwise
-
---*/
-{
- UINT32 Index;
- SkipWhiteSpace (&mGlobals.SourceFile);
- if (EndOfFile (&mGlobals.SourceFile)) {
- return FALSE;
- }
-
- Index = 0;
- while (!EndOfFile (&mGlobals.SourceFile) && (Index < Len)) {
- if (IsWhiteSpace (&mGlobals.SourceFile)) {
- if (Index > 0) {
- Str[Index] = 0;
- return TRUE;
- }
-
- return FALSE;
- } else {
- Str[Index] = mGlobals.SourceFile.FileBufferPtr[0];
- mGlobals.SourceFile.FileBufferPtr++;
- Index++;
- }
- }
-
- return FALSE;
-}
-
-BOOLEAN
-SFPSkipToToken (
- CHAR8 *Str
- )
-{
- UINTN Len;
- CHAR8 *SavePos;
- Len = t_strlen (Str);
- SavePos = mGlobals.SourceFile.FileBufferPtr;
- SkipWhiteSpace (&mGlobals.SourceFile);
- while (!EndOfFile (&mGlobals.SourceFile)) {
- if (t_strncmp (Str, mGlobals.SourceFile.FileBufferPtr, Len) == 0) {
- mGlobals.SourceFile.FileBufferPtr += Len;
- return TRUE;
- }
-
- mGlobals.SourceFile.FileBufferPtr++;
- SkipWhiteSpace (&mGlobals.SourceFile);
- }
-
- mGlobals.SourceFile.FileBufferPtr = SavePos;
- return FALSE;
-}
-
-BOOLEAN
-SFPGetNumber (
- UINTN *Value
- )
-/*++
-
-Routine Description:
- Check the token at the current file position for a numeric value.
- May be either decimal or hex.
-
-Arguments:
- Value - pointer where to store the value
-
-Returns:
- FALSE - current token is not a number
- TRUE - current token is a number
-
---*/
-{
- unsigned Val;
-
- SkipWhiteSpace (&mGlobals.SourceFile);
- if (EndOfFile (&mGlobals.SourceFile)) {
- return FALSE;
- }
-
- if (isdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {
- //
- // Check for hex value
- //
- if ((mGlobals.SourceFile.FileBufferPtr[0] == T_CHAR_0) && (mGlobals.SourceFile.FileBufferPtr[1] == T_CHAR_LC_X)) {
- if (!isxdigit ((int)mGlobals.SourceFile.FileBufferPtr[2])) {
- return FALSE;
- }
-
- mGlobals.SourceFile.FileBufferPtr += 2;
- sscanf (mGlobals.SourceFile.FileBufferPtr, "%x", &Val);
- *Value = (UINT32) Val;
- while (isxdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {
- mGlobals.SourceFile.FileBufferPtr++;
- }
-
- return TRUE;
- } else {
- *Value = atoi (mGlobals.SourceFile.FileBufferPtr);
- while (isdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {
- mGlobals.SourceFile.FileBufferPtr++;
- }
-
- return TRUE;
- }
- } else {
- return FALSE;
- }
-}
-
-STATUS
-SFPCloseFile (
- VOID
- )
-/*++
-
-Routine Description:
- Close the file being parsed.
-
-Arguments:
- None.
-
-Returns:
- STATUS_SUCCESS - the file was closed
- STATUS_ERROR - no file is currently open
-
---*/
-{
- if (mGlobals.SourceFile.FileBuffer != NULL) {
- free (mGlobals.SourceFile.FileBuffer);
- memset (&mGlobals.SourceFile, 0, sizeof (mGlobals.SourceFile));
- return STATUS_SUCCESS;
- }
-
- return STATUS_ERROR;
-}
-
-STATIC
-STATUS
-ProcessIncludeFile (
- SOURCE_FILE *SourceFile,
- SOURCE_FILE *ParentSourceFile
- )
-/*++
-
-Routine Description:
-
- Given a source file, open the file and parse it
-
-Arguments:
-
- SourceFile - name of file to parse
- ParentSourceFile - for error reporting purposes, the file that #included SourceFile.
-
-Returns:
-
- Standard status.
-
---*/
-{
- STATIC UINTN NestDepth = 0;
- CHAR8 FoundFileName[MAX_PATH];
- STATUS Status;
-
- Status = STATUS_SUCCESS;
- NestDepth++;
- //
- // Print the file being processed. Indent so you can tell the include nesting
- // depth.
- //
- if (mGlobals.VerboseFile) {
- fprintf (stdout, "%*cProcessing file '%s'\n", (int)NestDepth * 2, ' ', SourceFile->FileName);
- fprintf (stdout, "Parent source file = '%s'\n", ParentSourceFile->FileName);
- }
-
- //
- // Make sure we didn't exceed our maximum nesting depth
- //
- if (NestDepth > MAX_NEST_DEPTH) {
- Error (NULL, 0, 3001, "Not Supported", "%s exceeeds max nesting depth (%u)", SourceFile->FileName, (unsigned) NestDepth);
- Status = STATUS_ERROR;
- goto Finish;
- }
- //
- // Try to open the file locally, and if that fails try along our include paths.
- //
- strcpy (FoundFileName, SourceFile->FileName);
- if ((SourceFile->Fptr = fopen (FoundFileName, "rb")) == NULL) {
- return STATUS_ERROR;
- }
- //
- // Process the file found
- //
- ProcessFile (SourceFile);
-Finish:
- //
- // Close open files and return status
- //
- if (SourceFile->Fptr != NULL) {
- fclose (SourceFile->Fptr);
- SourceFile->Fptr = NULL;
- }
-
- return Status;
-}
-
-STATIC
-STATUS
-ProcessFile (
- SOURCE_FILE *SourceFile
- )
-/*++
-
-Routine Description:
-
- Given a source file that's been opened, read the contents into an internal
- buffer and pre-process it to remove comments.
-
-Arguments:
-
- SourceFile - structure containing info on the file to process
-
-Returns:
-
- Standard status.
-
---*/
-{
- //
- // Get the file size, and then read the entire thing into memory.
- // Allocate extra space for a terminator character.
- //
- fseek (SourceFile->Fptr, 0, SEEK_END);
- SourceFile->FileSize = ftell (SourceFile->Fptr);
- if (mGlobals.VerboseFile) {
- printf ("FileSize = %u (0x%X)\n", (unsigned) SourceFile->FileSize, (unsigned) SourceFile->FileSize);
- }
-
- fseek (SourceFile->Fptr, 0, SEEK_SET);
- SourceFile->FileBuffer = (CHAR8 *) malloc (SourceFile->FileSize + sizeof (CHAR8 ));
- if (SourceFile->FileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource: memory cannot be allocated", NULL);
- return STATUS_ERROR;
- }
-
- fread ((VOID *) SourceFile->FileBuffer, SourceFile->FileSize, 1, SourceFile->Fptr);
- SourceFile->FileBuffer[(SourceFile->FileSize / sizeof (CHAR8 ))] = T_CHAR_NULL;
- //
- // Pre-process the file to replace comments with spaces
- //
- PreprocessFile (SourceFile);
- SourceFile->LineNum = 1;
- return STATUS_SUCCESS;
-}
-
-STATIC
-VOID
-PreprocessFile (
- SOURCE_FILE *SourceFile
- )
-/*++
-
-Routine Description:
- Preprocess a file to replace all carriage returns with NULLs so
- we can print lines (as part of error messages) from the file to the screen.
-
-Arguments:
- SourceFile - structure that we use to keep track of an input file.
-
-Returns:
- Nothing.
-
---*/
-{
- BOOLEAN InComment;
- BOOLEAN SlashSlashComment;
- int LineNum;
-
- RewindFile (SourceFile);
- InComment = FALSE;
- SlashSlashComment = FALSE;
- while (!EndOfFile (SourceFile)) {
- //
- // If a line-feed, then no longer in a comment if we're in a // comment
- //
- if (SourceFile->FileBufferPtr[0] == T_CHAR_LF) {
- SourceFile->FileBufferPtr++;
- SourceFile->LineNum++;
- if (InComment && SlashSlashComment) {
- InComment = FALSE;
- SlashSlashComment = FALSE;
- }
- } else if (SourceFile->FileBufferPtr[0] == T_CHAR_CR) {
- //
- // Replace all carriage returns with a NULL so we can print stuff
- //
- SourceFile->FileBufferPtr[0] = 0;
- SourceFile->FileBufferPtr++;
- //
- // Check for */ comment end
- //
- } else if (InComment &&
- !SlashSlashComment &&
- (SourceFile->FileBufferPtr[0] == T_CHAR_STAR) &&
- (SourceFile->FileBufferPtr[1] == T_CHAR_SLASH)
- ) {
- SourceFile->FileBufferPtr[0] = T_CHAR_SPACE;
- SourceFile->FileBufferPtr++;
- SourceFile->FileBufferPtr[0] = T_CHAR_SPACE;
- SourceFile->FileBufferPtr++;
- InComment = FALSE;
- } else if (InComment) {
- SourceFile->FileBufferPtr[0] = T_CHAR_SPACE;
- SourceFile->FileBufferPtr++;
- //
- // Check for // comments
- //
- } else if ((SourceFile->FileBufferPtr[0] == T_CHAR_SLASH) && (SourceFile->FileBufferPtr[1] == T_CHAR_SLASH)) {
- InComment = TRUE;
- SlashSlashComment = TRUE;
- //
- // Check for /* comment start
- //
- } else if ((SourceFile->FileBufferPtr[0] == T_CHAR_SLASH) && (SourceFile->FileBufferPtr[1] == T_CHAR_STAR)) {
- SourceFile->FileBufferPtr[0] = T_CHAR_SPACE;
- SourceFile->FileBufferPtr++;
- SourceFile->FileBufferPtr[0] = T_CHAR_SPACE;
- SourceFile->FileBufferPtr++;
- SlashSlashComment = FALSE;
- InComment = TRUE;
- } else {
- SourceFile->FileBufferPtr++;
- }
- }
- //
- // Could check for end-of-file and still in a comment, but
- // should not be necessary. So just restore the file pointers.
- //
- RewindFile (SourceFile);
- //
- // Dump the reformatted file if verbose mode
- //
- if (mGlobals.VerboseFile) {
- LineNum = 1;
- printf ("%04d: ", LineNum);
- while (!EndOfFile (SourceFile)) {
- if (SourceFile->FileBufferPtr[0] == T_CHAR_LF) {
- printf ("'\n%04d: '", ++LineNum);
- } else {
- printf ("%c", SourceFile->FileBufferPtr[0]);
- }
-
- SourceFile->FileBufferPtr++;
- }
-
- printf ("'\n");
- printf ("FileSize = %u (0x%X)\n", (unsigned)SourceFile->FileSize, (unsigned)SourceFile->FileSize);
- RewindFile (SourceFile);
- }
-}
-
-BOOLEAN
-SFPGetQuotedString (
- CHAR8 *Str,
- INTN Length
- )
-/*++
-
-Routine Description:
- Retrieve a quoted-string from the input file.
-
-Arguments:
- Str - pointer to a copy of the quoted string parsed
- Length - size of buffer pointed to by Str
-
-Returns:
- TRUE - next token in input stream was a quoted string, and
- the string value was returned in Str
- FALSE - otherwise
-
---*/
-{
- SkipWhiteSpace (&mGlobals.SourceFile);
- if (EndOfFile (&mGlobals.SourceFile)) {
- return FALSE;
- }
-
- if (mGlobals.SourceFile.FileBufferPtr[0] == T_CHAR_DOUBLE_QUOTE) {
- mGlobals.SourceFile.FileBufferPtr++;
- while (Length > 0) {
- if (EndOfFile (&mGlobals.SourceFile)) {
- return FALSE;
- }
- //
- // Check for closing quote
- //
- if (mGlobals.SourceFile.FileBufferPtr[0] == T_CHAR_DOUBLE_QUOTE) {
- mGlobals.SourceFile.FileBufferPtr++;
- *Str = 0;
- return TRUE;
- }
-
- *Str = mGlobals.SourceFile.FileBufferPtr[0];
- Str++;
- Length--;
- mGlobals.SourceFile.FileBufferPtr++;
- }
- }
- //
- // First character was not a quote, or the input string length was
- // insufficient to contain the quoted string, so return failure code.
- //
- return FALSE;
-}
-
-BOOLEAN
-SFPIsEOF (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE of FALSE to indicate whether or not we've reached the end of the
- file we're parsing.
-
-Arguments:
- NA
-
-Returns:
- TRUE - EOF reached
- FALSE - otherwise
-
---*/
-{
- SkipWhiteSpace (&mGlobals.SourceFile);
- return EndOfFile (&mGlobals.SourceFile);
-}
-
-#if 0
-STATIC
-CHAR8 *
-GetQuotedString (
- SOURCE_FILE *SourceFile,
- BOOLEAN Optional
- )
-{
- CHAR8 *String;
- CHAR8 *Start;
- CHAR8 *Ptr;
- UINTN Len;
- BOOLEAN PreviousBackslash;
-
- if (SourceFile->FileBufferPtr[0] != T_CHAR_DOUBLE_QUOTE) {
- if (Optional == FALSE) {
- Error (SourceFile->FileName, SourceFile->LineNum, 0, "expected quoted string", "%S", SourceFile->FileBufferPtr);
- }
-
- return NULL;
- }
-
- Len = 0;
- SourceFile->FileBufferPtr++;
- Start = Ptr = SourceFile->FileBufferPtr;
- PreviousBackslash = FALSE;
- while (!EndOfFile (SourceFile)) {
- if ((SourceFile->FileBufferPtr[0] == T_CHAR_DOUBLE_QUOTE) && (PreviousBackslash == FALSE)) {
- break;
- } else if (SourceFile->FileBufferPtr[0] == T_CHAR_CR) {
- Warning (SourceFile->FileName, SourceFile->LineNum, 0, "carriage return found in quoted string", "%S", Start);
- PreviousBackslash = FALSE;
- } else if (SourceFile->FileBufferPtr[0] == T_CHAR_BACKSLASH) {
- PreviousBackslash = TRUE;
- } else {
- PreviousBackslash = FALSE;
- }
-
- SourceFile->FileBufferPtr++;
- Len++;
- }
-
- if (SourceFile->FileBufferPtr[0] != T_CHAR_DOUBLE_QUOTE) {
- Warning (SourceFile->FileName, SourceFile->LineNum, 0, "missing closing quote on string", "%S", Start);
- } else {
- SourceFile->FileBufferPtr++;
- }
- //
- // Now allocate memory for the string and save it off
- //
- String = (CHAR8 *) malloc ((Len + 1) * sizeof (CHAR8 ));
- if (String == NULL) {
- Error (NULL, 0, 4001, "Resource: memory cannot be allocated", NULL);
- return NULL;
- }
- //
- // Copy the string from the file buffer to the local copy.
- // We do no reformatting of it whatsoever at this point.
- //
- Ptr = String;
- while (Len > 0) {
- *Ptr = *Start;
- Start++;
- Ptr++;
- Len--;
- }
-
- *Ptr = 0;
- return String;
-}
-#endif
-STATIC
-BOOLEAN
-EndOfFile (
- SOURCE_FILE *SourceFile
- )
-{
- //
- // The file buffer pointer will typically get updated before the End-of-file flag in the
- // source file structure, so check it first.
- //
- if (SourceFile->FileBufferPtr >= SourceFile->FileBuffer + SourceFile->FileSize / sizeof (CHAR8 )) {
- SourceFile->EndOfFile = TRUE;
- return TRUE;
- }
-
- if (SourceFile->EndOfFile) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-#if 0
-STATIC
-VOID
-ProcessTokenInclude (
- SOURCE_FILE *SourceFile
- )
-{
- CHAR8 IncludeFileName[MAX_PATH];
- CHAR8 *To;
- UINTN Len;
- BOOLEAN ReportedError;
- SOURCE_FILE IncludedSourceFile;
-
- ReportedError = FALSE;
- if (SkipWhiteSpace (SourceFile) == 0) {
- Warning (SourceFile->FileName, SourceFile->LineNum, 0, "expected whitespace following #include keyword", NULL);
- }
- //
- // Should be quoted file name
- //
- if (SourceFile->FileBufferPtr[0] != T_CHAR_DOUBLE_QUOTE) {
- Error (SourceFile->FileName, SourceFile->LineNum, 0, "expected quoted include file name", NULL);
- goto FailDone;
- }
-
- SourceFile->FileBufferPtr++;
- //
- // Copy the filename as ascii to our local string
- //
- To = IncludeFileName;
- Len = 0;
- while (!EndOfFile (SourceFile)) {
- if ((SourceFile->FileBufferPtr[0] == T_CHAR_CR) || (SourceFile->FileBufferPtr[0] == T_CHAR_LF)) {
- Error (SourceFile->FileName, SourceFile->LineNum, 0, "end-of-line found in quoted include file name", NULL);
- goto FailDone;
- }
-
- if (SourceFile->FileBufferPtr[0] == T_CHAR_DOUBLE_QUOTE) {
- SourceFile->FileBufferPtr++;
- break;
- }
- //
- // If too long, then report the error once and process until the closing quote
- //
- Len++;
- if (!ReportedError && (Len >= sizeof (IncludeFileName))) {
- Error (SourceFile->FileName, SourceFile->LineNum, 0, "length of include file name exceeds limit", NULL);
- ReportedError = TRUE;
- }
-
- if (!ReportedError) {
- *To = (CHAR8 ) SourceFile->FileBufferPtr[0];
- To++;
- }
-
- SourceFile->FileBufferPtr++;
- }
-
- if (!ReportedError) {
- *To = 0;
- memset ((CHAR8 *) &IncludedSourceFile, 0, sizeof (SOURCE_FILE));
- strcpy (IncludedSourceFile.FileName, IncludeFileName);
- ProcessIncludeFile (&IncludedSourceFile, SourceFile);
- }
-
- return ;
-FailDone:
- //
- // Error recovery -- skip to next #
- //
- SourceFile->SkipToHash = TRUE;
-}
-#endif
-STATIC
-BOOLEAN
-IsWhiteSpace (
- SOURCE_FILE *SourceFile
- )
-{
- switch (*SourceFile->FileBufferPtr) {
- case T_CHAR_NULL:
- case T_CHAR_CR:
- case T_CHAR_SPACE:
- case T_CHAR_TAB:
- case T_CHAR_LF:
- return TRUE;
-
- default:
- return FALSE;
- }
-}
-
-UINTN
-SkipWhiteSpace (
- SOURCE_FILE *SourceFile
- )
-{
- UINTN Count;
-
- Count = 0;
- while (!EndOfFile (SourceFile)) {
- Count++;
- switch (*SourceFile->FileBufferPtr) {
- case T_CHAR_NULL:
- case T_CHAR_CR:
- case T_CHAR_SPACE:
- case T_CHAR_TAB:
- SourceFile->FileBufferPtr++;
- break;
-
- case T_CHAR_LF:
- SourceFile->FileBufferPtr++;
- SourceFile->LineNum++;
- break;
-
- default:
- return Count - 1;
- }
- }
- //
- // Some tokens require trailing whitespace. If we're at the end of the
- // file, then we count that as well.
- //
- if ((Count == 0) && (EndOfFile (SourceFile))) {
- Count++;
- }
-
- return Count;
-}
-
-STATIC
-UINTN
-t_strcmp (
- CHAR8 *Buffer,
- CHAR8 *Str
- )
-/*++
-
-Routine Description:
- Compare two strings for equality. The string pointed to by 'Buffer' may or may not be null-terminated,
- so only compare up to the length of Str.
-
-Arguments:
- Buffer - pointer to first (possibly not null-terminated) string
- Str - pointer to null-terminated string to compare to Buffer
-
-Returns:
- Number of bytes matched if exact match
- 0 if Buffer does not start with Str
-
---*/
-{
- UINTN Len;
-
- Len = 0;
- while (*Str && (*Str == *Buffer)) {
- Buffer++;
- Str++;
- Len++;
- }
-
- if (*Str) {
- return 0;
- }
-
- return Len;
-}
-
-STATIC
-UINTN
-t_strlen (
- CHAR8 *Str
- )
-{
- UINTN Len;
- Len = 0;
- while (*Str) {
- Len++;
- Str++;
- }
-
- return Len;
-}
-
-STATIC
-UINTN
-t_strncmp (
- CHAR8 *Str1,
- CHAR8 *Str2,
- INTN Len
- )
-{
- while (Len > 0) {
- if (*Str1 != *Str2) {
- return Len;
- }
-
- Len--;
- Str1++;
- Str2++;
- }
-
- return 0;
-}
-
-STATIC
-CHAR8 *
-t_strcpy (
- CHAR8 *Dest,
- CHAR8 *Src
- )
-{
- CHAR8 *SaveDest;
- SaveDest = Dest;
- while (*Src) {
- *Dest = *Src;
- Dest++;
- Src++;
- }
-
- *Dest = 0;
- return SaveDest;
-}
-
-STATIC
-VOID
-RewindFile (
- SOURCE_FILE *SourceFile
- )
-{
- SourceFile->LineNum = 1;
- SourceFile->FileBufferPtr = SourceFile->FileBuffer;
- SourceFile->EndOfFile = 0;
-}
-
-STATIC
-UINT32
-GetHexChars (
- CHAR8 *Buffer,
- UINT32 BufferLen
- )
-{
- UINT32 Len;
- Len = 0;
- while (!EndOfFile (&mGlobals.SourceFile) && (BufferLen > 0)) {
- if (isxdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {
- *Buffer = mGlobals.SourceFile.FileBufferPtr[0];
- Buffer++;
- Len++;
- BufferLen--;
- mGlobals.SourceFile.FileBufferPtr++;
- } else {
- break;
- }
- }
- //
- // Null terminate if we can
- //
- if ((Len > 0) && (BufferLen > 0)) {
- *Buffer = 0;
- }
-
- return Len;
-}
-
-BOOLEAN
-SFPGetGuid (
- INTN GuidStyle,
- EFI_GUID *Value
- )
-/*++
-
-Routine Description:
- Parse a GUID from the input stream. Stop when you discover white space.
-
-Arguments:
- GuidStyle - Style of the following GUID token
- Value - pointer to EFI_GUID struct for output
-
-Returns:
- TRUE - GUID string parsed successfully
- FALSE - otherwise
-
- GUID styles
- Style[0] 12345678-1234-5678-AAAA-BBBBCCCCDDDD
-
---*/
-{
- unsigned Value32;
- UINT32 Index;
- FILE_POSITION FPos;
- CHAR8 TempString[20];
- CHAR8 TempString2[3];
- CHAR8 *From;
- CHAR8 *To;
- UINT32 Len;
- BOOLEAN Status;
-
- Status = FALSE;
- //
- // Skip white space, then start parsing
- //
- SkipWhiteSpace (&mGlobals.SourceFile);
- GetFilePosition (&FPos);
- if (EndOfFile (&mGlobals.SourceFile)) {
- return FALSE;
- }
-
- if (GuidStyle == PARSE_GUID_STYLE_5_FIELDS) {
- //
- // Style[0] 12345678-1234-5678-AAAA-BBBBCCCCDDDD
- //
- Len = GetHexChars (TempString, sizeof (TempString));
- if ((Len == 0) || (Len > 8)) {
- goto Done;
- }
-
- sscanf (TempString, "%x", &Value32);
- Value->Data1 = Value32;
- //
- // Next two UINT16 fields
- //
- if (mGlobals.SourceFile.FileBufferPtr[0] != '-') {
- goto Done;
- }
-
- mGlobals.SourceFile.FileBufferPtr++;
- Len = GetHexChars (TempString, sizeof (TempString));
- if ((Len == 0) || (Len > 4)) {
- goto Done;
- }
-
- sscanf (TempString, "%x", &Value32);
- Value->Data2 = (UINT16) Value32;
-
- if (mGlobals.SourceFile.FileBufferPtr[0] != '-') {
- goto Done;
- }
-
- mGlobals.SourceFile.FileBufferPtr++;
- Len = GetHexChars (TempString, sizeof (TempString));
- if ((Len == 0) || (Len > 4)) {
- goto Done;
- }
-
- sscanf (TempString, "%x", &Value32);
- Value->Data3 = (UINT16) Value32;
- //
- // Parse the "AAAA" as two bytes
- //
- if (mGlobals.SourceFile.FileBufferPtr[0] != '-') {
- goto Done;
- }
-
- mGlobals.SourceFile.FileBufferPtr++;
- Len = GetHexChars (TempString, sizeof (TempString));
- if ((Len == 0) || (Len > 4)) {
- goto Done;
- }
-
- sscanf (TempString, "%x", &Value32);
- Value->Data4[0] = (UINT8) (Value32 >> 8);
- Value->Data4[1] = (UINT8) Value32;
- if (mGlobals.SourceFile.FileBufferPtr[0] != '-') {
- goto Done;
- }
-
- mGlobals.SourceFile.FileBufferPtr++;
- //
- // Read the last 6 bytes of the GUID
- //
- //
- Len = GetHexChars (TempString, sizeof (TempString));
- if ((Len == 0) || (Len > 12)) {
- goto Done;
- }
- //
- // Insert leading 0's to make life easier
- //
- if (Len != 12) {
- From = TempString + Len - 1;
- To = TempString + 11;
- TempString[12] = 0;
- while (From >= TempString) {
- *To = *From;
- To--;
- From--;
- }
-
- while (To >= TempString) {
- *To = '0';
- To--;
- }
- }
- //
- // Now parse each byte
- //
- TempString2[2] = 0;
- for (Index = 0; Index < 6; Index++) {
- //
- // Copy the two characters from the input string to something
- // we can parse.
- //
- TempString2[0] = TempString[Index * 2];
- TempString2[1] = TempString[Index * 2 + 1];
- sscanf (TempString2, "%x", &Value32);
- Value->Data4[Index + 2] = (UINT8) Value32;
- }
-
- Status = TRUE;
- } else {
- //
- // Unsupported GUID style
- //
- return FALSE;
- }
-
-Done:
- if (Status == FALSE) {
- SetFilePosition (&FPos);
- }
-
- return Status;
-}
-
-STATIC
-STATUS
-GetFilePosition (
- FILE_POSITION *Fpos
- )
-{
- Fpos->FileBufferPtr = mGlobals.SourceFile.FileBufferPtr;
- return STATUS_SUCCESS;
-}
-
-STATIC
-STATUS
-SetFilePosition (
- FILE_POSITION *Fpos
- )
-{
- //
- // Should check range of pointer
- //
- mGlobals.SourceFile.FileBufferPtr = Fpos->FileBufferPtr;
- return STATUS_SUCCESS;
-}
diff --git a/BaseTools/Source/C/Common/SimpleFileParsing.h b/BaseTools/Source/C/Common/SimpleFileParsing.h
deleted file mode 100644
index d871eb7fe3..0000000000
--- a/BaseTools/Source/C/Common/SimpleFileParsing.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- SimpleFileParsing.h
-
-Abstract:
-
- Function prototypes and defines for the simple file parsing routines.
-
-**/
-
-#ifndef _SIMPLE_FILE_PARSING_H_
-#define _SIMPLE_FILE_PARSING_H_
-
-#include <Common/UefiBaseTypes.h>
-
-STATUS
-SFPInit (
- VOID
- )
-;
-
-STATUS
-SFPOpenFile (
- CHAR8 *FileName
- )
-;
-
-BOOLEAN
-SFPIsKeyword (
- CHAR8 *Str
- )
-;
-
-BOOLEAN
-SFPIsToken (
- CHAR8 *Str
- )
-;
-
-BOOLEAN
-SFPGetNextToken (
- CHAR8 *Str,
- UINTN Len
- )
-;
-
-BOOLEAN
-SFPGetGuidToken (
- CHAR8 *Str,
- UINT32 Len
- )
-;
-
-#define PARSE_GUID_STYLE_5_FIELDS 0
-
-BOOLEAN
-SFPGetGuid (
- INTN GuidStyle,
- EFI_GUID *Value
- )
-;
-
-BOOLEAN
-SFPSkipToToken (
- CHAR8 *Str
- )
-;
-
-BOOLEAN
-SFPGetNumber (
- UINTN *Value
- )
-;
-
-BOOLEAN
-SFPGetQuotedString (
- CHAR8 *Str,
- INTN Length
- )
-;
-
-BOOLEAN
-SFPIsEOF (
- VOID
- )
-;
-
-STATUS
-SFPCloseFile (
- VOID
- )
-;
-
-UINTN
-SFPGetLineNumber (
- VOID
- )
-;
-
-CHAR8 *
-SFPGetFileName (
- VOID
- )
-;
-
-#endif // #ifndef _SIMPLE_FILE_PARSING_H_
diff --git a/BaseTools/Source/C/Common/StringFuncs.c b/BaseTools/Source/C/Common/StringFuncs.c
deleted file mode 100644
index bccb0b2d34..0000000000
--- a/BaseTools/Source/C/Common/StringFuncs.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/** @file
-
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- StringFuncs.c
-
-Abstract:
-
- Function prototypes and defines for string routines.
-
-**/
-
-#include <string.h>
-#include <ctype.h>
-#include "StringFuncs.h"
-
-//
-// Functions implementations
-//
-
-CHAR8*
-CloneString (
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
-
- Allocates a new string and copies 'String' to clone it
-
-Arguments:
-
- String The string to clone
-
-Returns:
-
- CHAR8* - NULL if there are not enough resources
-
---*/
-{
- CHAR8* NewString;
-
- NewString = malloc (strlen (String) + 1);
- if (NewString != NULL) {
- strcpy (NewString, String);
- }
-
- return NewString;
-}
-
-
-EFI_STATUS
-StripInfDscStringInPlace (
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
-
- Remove all comments, leading and trailing whitespace from the string.
-
-Arguments:
-
- String The string to 'strip'
-
-Returns:
-
- EFI_STATUS
-
---*/
-{
- CHAR8 *Pos;
-
- if (String == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Remove leading whitespace
- //
- for (Pos = String; isspace ((int)*Pos); Pos++) {
- }
- if (Pos != String) {
- memmove (String, Pos, strlen (Pos) + 1);
- }
-
- //
- // Comment BUGBUGs!
- //
- // What about strings? Comment characters are okay in strings.
- // What about multiline comments?
- //
-
- Pos = (CHAR8 *) strstr (String, "//");
- if (Pos != NULL) {
- *Pos = '\0';
- }
-
- Pos = (CHAR8 *) strchr (String, '#');
- if (Pos != NULL) {
- *Pos = '\0';
- }
-
- //
- // Remove trailing whitespace
- //
- for (Pos = String + strlen (String);
- ((Pos - 1) >= String) && (isspace ((int)*(Pos - 1)));
- Pos--
- ) {
- }
- *Pos = '\0';
-
- return EFI_SUCCESS;
-}
-
-
-STRING_LIST*
-SplitStringByWhitespace (
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
-
- Creates and returns a 'split' STRING_LIST by splitting the string
- on whitespace boundaries.
-
-Arguments:
-
- String The string to 'split'
-
-Returns:
-
- EFI_STATUS
-
---*/
-{
- CHAR8 *Pos;
- CHAR8 *EndOfSubString;
- CHAR8 *EndOfString;
- STRING_LIST *Output;
- UINTN Item;
-
- String = CloneString (String);
- if (String == NULL) {
- return NULL;
- }
- EndOfString = String + strlen (String);
-
- Output = NewStringList ();
-
- for (Pos = String, Item = 0; Pos < EndOfString; Item++) {
- while (isspace ((int)*Pos)) {
- Pos++;
- }
-
- for (EndOfSubString=Pos;
- (*EndOfSubString != '\0') && !isspace ((int)*EndOfSubString);
- EndOfSubString++
- ) {
- }
-
- if (EndOfSubString == Pos) {
- break;
- }
-
- *EndOfSubString = '\0';
-
- AppendCopyOfStringToList (&Output, Pos);
-
- Pos = EndOfSubString + 1;
- }
-
- free (String);
- return Output;
-}
-
-
-STRING_LIST*
-NewStringList (
- )
-/*++
-
-Routine Description:
-
- Creates a new STRING_LIST with 0 strings.
-
-Returns:
-
- STRING_LIST* - Null if there is not enough resources to create the object.
-
---*/
-{
- STRING_LIST *NewList;
- NewList = AllocateStringListStruct (0);
- if (NewList != NULL) {
- NewList->Count = 0;
- }
- return NewList;
-}
-
-
-EFI_STATUS
-AppendCopyOfStringToList (
- IN OUT STRING_LIST **StringList,
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
-
- Adds String to StringList. A new copy of String is made before it is
- added to StringList.
-
-Returns:
-
- EFI_STATUS
-
---*/
-{
- STRING_LIST *OldList;
- STRING_LIST *NewList;
- CHAR8 *NewString;
-
- OldList = *StringList;
- NewList = AllocateStringListStruct (OldList->Count + 1);
- if (NewList == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- NewString = CloneString (String);
- if (NewString == NULL) {
- free (NewList);
- return EFI_OUT_OF_RESOURCES;
- }
-
- memcpy (
- NewList->Strings,
- OldList->Strings,
- sizeof (OldList->Strings[0]) * OldList->Count
- );
- NewList->Count = OldList->Count + 1;
- NewList->Strings[OldList->Count] = NewString;
-
- *StringList = NewList;
- free (OldList);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-RemoveLastStringFromList (
- IN STRING_LIST *StringList
- )
-/*++
-
-Routine Description:
-
- Removes the last string from StringList and frees the memory associated
- with it.
-
-Arguments:
-
- StringList The string list to remove the string from
-
-Returns:
-
- EFI_STATUS
-
---*/
-{
- if (StringList->Count == 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- free (StringList->Strings[StringList->Count - 1]);
- StringList->Count--;
- return EFI_SUCCESS;
-}
-
-
-STRING_LIST*
-AllocateStringListStruct (
- IN UINTN StringCount
- )
-/*++
-
-Routine Description:
-
- Allocates a STRING_LIST structure that can store StringCount strings.
-
-Arguments:
-
- StringCount The number of strings that need to be stored
-
-Returns:
-
- EFI_STATUS
-
---*/
-{
- return malloc (OFFSET_OF(STRING_LIST, Strings[StringCount + 1]));
-}
-
-
-VOID
-FreeStringList (
- IN STRING_LIST *StringList
- )
-/*++
-
-Routine Description:
-
- Frees all memory associated with StringList.
-
-Arguments:
-
- StringList The string list to free
-
-Returns:
-
- VOID
---*/
-{
- while (StringList->Count > 0) {
- RemoveLastStringFromList (StringList);
- }
-
- free (StringList);
-}
-
-
-CHAR8*
-StringListToString (
- IN STRING_LIST *StringList
- )
-/*++
-
-Routine Description:
-
- Generates a string that represents the STRING_LIST
-
-Arguments:
-
- StringList The string list to convert to a string
-
-Returns:
-
- CHAR8* - The string list represented with a single string. The returned
- string must be freed by the caller.
-
---*/
-{
- UINTN Count;
- UINTN Length;
- CHAR8 *NewString;
-
- Length = 2;
- for (Count = 0; Count < StringList->Count; Count++) {
- if (Count > 0) {
- Length += 2;
- }
- Length += strlen (StringList->Strings[Count]) + 2;
- }
-
- NewString = malloc (Length + 1);
- if (NewString == NULL) {
- return NewString;
- }
- NewString[0] = '\0';
-
- strcat (NewString, "[");
- for (Count = 0; Count < StringList->Count; Count++) {
- if (Count > 0) {
- strcat (NewString, ", ");
- }
- strcat (NewString, "\"");
- strcat (NewString, StringList->Strings[Count]);
- strcat (NewString, "\"");
- }
- strcat (NewString, "]");
-
- return NewString;
-}
-
-
-VOID
-PrintStringList (
- IN STRING_LIST *StringList
- )
-/*++
-
-Routine Description:
-
- Prints out the string list
-
-Arguments:
-
- StringList The string list to print
-
-Returns:
-
- EFI_STATUS
-
---*/
-{
- CHAR8* String;
- String = StringListToString (StringList);
- if (String != NULL) {
- printf ("%s", String);
- free (String);
- }
-}
-
-
diff --git a/BaseTools/Source/C/Common/StringFuncs.h b/BaseTools/Source/C/Common/StringFuncs.h
deleted file mode 100644
index 2c764115e5..0000000000
--- a/BaseTools/Source/C/Common/StringFuncs.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/**
-
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- StringFuncs.h
-
-Abstract:
-
- String routines implementation.
-
-**/
-
-#ifndef _EFI_STRING_FUNCS_H
-#define _EFI_STRING_FUNCS_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <Common/UefiBaseTypes.h>
-
-//
-// Common data structures
-//
-typedef struct {
- UINTN Count;
- //
- // Actually this array can be 0 or more items (based on Count)
- //
- CHAR8* Strings[1];
-} STRING_LIST;
-
-
-//
-// Functions declarations
-//
-
-CHAR8*
-CloneString (
- IN CHAR8 *String
- )
-;
-/**
-
-Routine Description:
-
- Allocates a new string and copies 'String' to clone it
-
-Arguments:
-
- String The string to clone
-
-Returns:
-
- CHAR8* - NULL if there are not enough resources
-
-**/
-
-
-EFI_STATUS
-StripInfDscStringInPlace (
- IN CHAR8 *String
- )
-;
-/**
-
-Routine Description:
-
- Remove all comments, leading and trailing whitespace from the string.
-
-Arguments:
-
- Strin The string to 'strip'
-
-Returns:
-
- EFI_STATUS
-
-**/
-
-
-STRING_LIST*
-SplitStringByWhitespace (
- IN CHAR8 *String
- )
-;
-/**
-
-Routine Description:
-
- Creates and returns a 'split' STRING_LIST by splitting the string
- on whitespace boundaries.
-
-Arguments:
-
- String The string to 'split'
-
-Returns:
-
- EFI_STATUS
-
-**/
-
-
-STRING_LIST*
-NewStringList (
- )
-;
-/**
-
-Routine Description:
-
- Creates a new STRING_LIST with 0 strings.
-
-Returns:
-
- STRING_LIST* - Null if there is not enough resources to create the object.
-
-**/
-
-
-EFI_STATUS
-AppendCopyOfStringToList (
- IN OUT STRING_LIST **StringList,
- IN CHAR8 *String
- )
-;
-/**
-
-Routine Description:
-
- Adds String to StringList. A new copy of String is made before it is
- added to StringList.
-
-Returns:
-
- EFI_STATUS
-
-**/
-
-
-EFI_STATUS
-RemoveLastStringFromList (
- IN STRING_LIST *StringList
- )
-;
-/**
-
-Routine Description:
-
- Removes the last string from StringList and frees the memory associated
- with it.
-
-Arguments:
-
- StringList The string list to remove the string from
-
-Returns:
-
- EFI_STATUS
-
-**/
-
-
-STRING_LIST*
-AllocateStringListStruct (
- IN UINTN StringCount
- )
-;
-/**
-
-Routine Description:
-
- Allocates a STRING_LIST structure that can store StringCount strings.
-
-Arguments:
-
- StringCount The number of strings that need to be stored
-
-Returns:
-
- EFI_STATUS
-
-**/
-
-
-VOID
-FreeStringList (
- IN STRING_LIST *StringList
- )
-;
-/**
-
-Routine Description:
-
- Frees all memory associated with StringList.
-
-Arguments:
-
- StringList The string list to free
-
-Returns:
-
- EFI_STATUS
-
-**/
-
-
-CHAR8*
-StringListToString (
- IN STRING_LIST *StringList
- )
-;
-/**
-
-Routine Description:
-
- Generates a string that represents the STRING_LIST
-
-Arguments:
-
- StringList The string list to convert to a string
-
-Returns:
-
- CHAR8* - The string list represented with a single string. The returned
- string must be freed by the caller.
-
-**/
-
-
-VOID
-PrintStringList (
- IN STRING_LIST *StringList
- )
-;
-/**
-
-Routine Description:
-
- Prints out the string list
-
-Arguments:
-
- StringList The string list to print
-
-**/
-
-
-#endif
diff --git a/BaseTools/Source/C/Common/TianoCompress.c b/BaseTools/Source/C/Common/TianoCompress.c
deleted file mode 100644
index a34f1d2a7d..0000000000
--- a/BaseTools/Source/C/Common/TianoCompress.c
+++ /dev/null
@@ -1,1753 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- TianoCompress.c
-
-Abstract:
-
- Compression routine. The compression algorithm is a mixture of
- LZ77 and Huffman coding. LZ77 transforms the source data into a
- sequence of Original Characters and Pointers to repeated strings.
- This sequence is further divided into Blocks and Huffman codings
- are applied to each Block.
-
-**/
-
-#include "Compress.h"
-
-//
-// Macro Definitions
-//
-#undef UINT8_MAX
-typedef INT32 NODE;
-#define UINT8_MAX 0xff
-#define UINT8_BIT 8
-#define THRESHOLD 3
-#define INIT_CRC 0
-#define WNDBIT 19
-#define WNDSIZ (1U << WNDBIT)
-#define MAXMATCH 256
-#define BLKSIZ (1U << 14) // 16 * 1024U
-#define PERC_FLAG 0x80000000U
-#define CODE_BIT 16
-#define NIL 0
-#define MAX_HASH_VAL (3 * WNDSIZ + (WNDSIZ / 512 + 1) * UINT8_MAX)
-#define HASH(p, c) ((p) + ((c) << (WNDBIT - 9)) + WNDSIZ * 2)
-#define CRCPOLY 0xA001
-#define UPDATE_CRC(c) mCrc = mCrcTable[(mCrc ^ (c)) & 0xFF] ^ (mCrc >> UINT8_BIT)
-
-//
-// C: the Char&Len Set; P: the Position Set; T: the exTra Set
-//
-#define NC (UINT8_MAX + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define NP (WNDBIT + 1)
-#define PBIT 5
-#define NT (CODE_BIT + 3)
-#define TBIT 5
-#if NT > NP
-#define NPT NT
-#else
-#define NPT NP
-#endif
-//
-// Function Prototypes
-//
-
-STATIC
-VOID
-PutDword(
- IN UINT32 Data
- );
-
-STATIC
-EFI_STATUS
-AllocateMemory (
- VOID
- );
-
-STATIC
-VOID
-FreeMemory (
- VOID
- );
-
-STATIC
-VOID
-InitSlide (
- VOID
- );
-
-STATIC
-NODE
-Child (
- IN NODE NodeQ,
- IN UINT8 CharC
- );
-
-STATIC
-VOID
-MakeChild (
- IN NODE NodeQ,
- IN UINT8 CharC,
- IN NODE NodeR
- );
-
-STATIC
-VOID
-Split (
- IN NODE Old
- );
-
-STATIC
-VOID
-InsertNode (
- VOID
- );
-
-STATIC
-VOID
-DeleteNode (
- VOID
- );
-
-STATIC
-VOID
-GetNextMatch (
- VOID
- );
-
-STATIC
-EFI_STATUS
-Encode (
- VOID
- );
-
-STATIC
-VOID
-CountTFreq (
- VOID
- );
-
-STATIC
-VOID
-WritePTLen (
- IN INT32 Number,
- IN INT32 nbit,
- IN INT32 Special
- );
-
-STATIC
-VOID
-WriteCLen (
- VOID
- );
-
-STATIC
-VOID
-EncodeC (
- IN INT32 Value
- );
-
-STATIC
-VOID
-EncodeP (
- IN UINT32 Value
- );
-
-STATIC
-VOID
-SendBlock (
- VOID
- );
-
-STATIC
-VOID
-Output (
- IN UINT32 c,
- IN UINT32 p
- );
-
-STATIC
-VOID
-HufEncodeStart (
- VOID
- );
-
-STATIC
-VOID
-HufEncodeEnd (
- VOID
- );
-
-STATIC
-VOID
-MakeCrcTable (
- VOID
- );
-
-STATIC
-VOID
-PutBits (
- IN INT32 Number,
- IN UINT32 Value
- );
-
-STATIC
-INT32
-FreadCrc (
- OUT UINT8 *Pointer,
- IN INT32 Number
- );
-
-STATIC
-VOID
-InitPutBits (
- VOID
- );
-
-STATIC
-VOID
-CountLen (
- IN INT32 Index
- );
-
-STATIC
-VOID
-MakeLen (
- IN INT32 Root
- );
-
-STATIC
-VOID
-DownHeap (
- IN INT32 Index
- );
-
-STATIC
-VOID
-MakeCode (
- IN INT32 Number,
- IN UINT8 Len[ ],
- OUT UINT16 Code[]
- );
-
-STATIC
-INT32
-MakeTree (
- IN INT32 NParm,
- IN UINT16 FreqParm[],
- OUT UINT8 LenParm[ ],
- OUT UINT16 CodeParm[]
- );
-
-//
-// Global Variables
-//
-STATIC UINT8 *mSrc, *mDst, *mSrcUpperLimit, *mDstUpperLimit;
-
-STATIC UINT8 *mLevel, *mText, *mChildCount, *mBuf, mCLen[NC], mPTLen[NPT], *mLen;
-STATIC INT16 mHeap[NC + 1];
-STATIC INT32 mRemainder, mMatchLen, mBitCount, mHeapSize, mN;
-STATIC UINT32 mBufSiz = 0, mOutputPos, mOutputMask, mSubBitBuf, mCrc;
-STATIC UINT32 mCompSize, mOrigSize;
-
-STATIC UINT16 *mFreq, *mSortPtr, mLenCnt[17], mLeft[2 * NC - 1], mRight[2 * NC - 1], mCrcTable[UINT8_MAX + 1],
- mCFreq[2 * NC - 1], mCCode[NC], mPFreq[2 * NP - 1], mPTCode[NPT], mTFreq[2 * NT - 1];
-
-STATIC NODE mPos, mMatchPos, mAvail, *mPosition, *mParent, *mPrev, *mNext = NULL;
-
-//
-// functions
-//
-EFI_STATUS
-TianoCompress (
- IN UINT8 *SrcBuffer,
- IN UINT32 SrcSize,
- IN UINT8 *DstBuffer,
- IN OUT UINT32 *DstSize
- )
-/*++
-
-Routine Description:
-
- The internal implementation of [Efi/Tiano]Compress().
-
-Arguments:
-
- SrcBuffer - The buffer storing the source data
- SrcSize - The size of source data
- DstBuffer - The buffer to store the compressed data
- DstSize - On input, the size of DstBuffer; On output,
- the size of the actual compressed data.
- Version - The version of de/compression algorithm.
- Version 1 for UEFI 2.0 de/compression algorithm.
- Version 2 for Tiano de/compression algorithm.
-
-Returns:
-
- EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. In this case,
- DstSize contains the size needed.
- EFI_SUCCESS - Compression is successful.
- EFI_OUT_OF_RESOURCES - No resource to complete function.
- EFI_INVALID_PARAMETER - Parameter supplied is wrong.
-
---*/
-{
- EFI_STATUS Status;
-
- //
- // Initializations
- //
- mBufSiz = 0;
- mBuf = NULL;
- mText = NULL;
- mLevel = NULL;
- mChildCount = NULL;
- mPosition = NULL;
- mParent = NULL;
- mPrev = NULL;
- mNext = NULL;
-
- mSrc = SrcBuffer;
- mSrcUpperLimit = mSrc + SrcSize;
- mDst = DstBuffer;
- mDstUpperLimit = mDst +*DstSize;
-
- PutDword (0L);
- PutDword (0L);
-
- MakeCrcTable ();
-
- mOrigSize = mCompSize = 0;
- mCrc = INIT_CRC;
-
- //
- // Compress it
- //
- Status = Encode ();
- if (EFI_ERROR (Status)) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // Null terminate the compressed data
- //
- if (mDst < mDstUpperLimit) {
- *mDst++ = 0;
- }
- //
- // Fill in compressed size and original size
- //
- mDst = DstBuffer;
- PutDword (mCompSize + 1);
- PutDword (mOrigSize);
-
- //
- // Return
- //
- if (mCompSize + 1 + 8 > *DstSize) {
- *DstSize = mCompSize + 1 + 8;
- return EFI_BUFFER_TOO_SMALL;
- } else {
- *DstSize = mCompSize + 1 + 8;
- return EFI_SUCCESS;
- }
-
-}
-
-STATIC
-VOID
-PutDword (
- IN UINT32 Data
- )
-/*++
-
-Routine Description:
-
- Put a dword to output stream
-
-Arguments:
-
- Data - the dword to put
-
-Returns: (VOID)
-
---*/
-{
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x08)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x10)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x18)) & 0xff);
- }
-}
-
-STATIC
-EFI_STATUS
-AllocateMemory (
- VOID
- )
-/*++
-
-Routine Description:
-
- Allocate memory spaces for data structures used in compression process
-
-Argements:
- VOID
-
-Returns:
-
- EFI_SUCCESS - Memory is allocated successfully
- EFI_OUT_OF_RESOURCES - Allocation fails
-
---*/
-{
- UINT32 Index;
-
- mText = malloc (WNDSIZ * 2 + MAXMATCH);
- for (Index = 0; Index < WNDSIZ * 2 + MAXMATCH; Index++) {
- mText[Index] = 0;
- }
-
- mLevel = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mLevel));
- mChildCount = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mChildCount));
- mPosition = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mPosition));
- mParent = malloc (WNDSIZ * 2 * sizeof (*mParent));
- mPrev = malloc (WNDSIZ * 2 * sizeof (*mPrev));
- mNext = malloc ((MAX_HASH_VAL + 1) * sizeof (*mNext));
-
- mBufSiz = BLKSIZ;
- mBuf = malloc (mBufSiz);
- while (mBuf == NULL) {
- mBufSiz = (mBufSiz / 10U) * 9U;
- if (mBufSiz < 4 * 1024U) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- mBuf = malloc (mBufSiz);
- }
-
- mBuf[0] = 0;
-
- return EFI_SUCCESS;
-}
-
-VOID
-FreeMemory (
- VOID
- )
-/*++
-
-Routine Description:
-
- Called when compression is completed to free memory previously allocated.
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- if (mText != NULL) {
- free (mText);
- }
-
- if (mLevel != NULL) {
- free (mLevel);
- }
-
- if (mChildCount != NULL) {
- free (mChildCount);
- }
-
- if (mPosition != NULL) {
- free (mPosition);
- }
-
- if (mParent != NULL) {
- free (mParent);
- }
-
- if (mPrev != NULL) {
- free (mPrev);
- }
-
- if (mNext != NULL) {
- free (mNext);
- }
-
- if (mBuf != NULL) {
- free (mBuf);
- }
-
- return ;
-}
-
-STATIC
-VOID
-InitSlide (
- VOID
- )
-/*++
-
-Routine Description:
-
- Initialize String Info Log data structures
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- NODE Index;
-
- for (Index = WNDSIZ; Index <= WNDSIZ + UINT8_MAX; Index++) {
- mLevel[Index] = 1;
- mPosition[Index] = NIL; /* sentinel */
- }
-
- for (Index = WNDSIZ; Index < WNDSIZ * 2; Index++) {
- mParent[Index] = NIL;
- }
-
- mAvail = 1;
- for (Index = 1; Index < WNDSIZ - 1; Index++) {
- mNext[Index] = (NODE) (Index + 1);
- }
-
- mNext[WNDSIZ - 1] = NIL;
- for (Index = WNDSIZ * 2; Index <= MAX_HASH_VAL; Index++) {
- mNext[Index] = NIL;
- }
-}
-
-STATIC
-NODE
-Child (
- IN NODE NodeQ,
- IN UINT8 CharC
- )
-/*++
-
-Routine Description:
-
- Find child node given the parent node and the edge character
-
-Arguments:
-
- NodeQ - the parent node
- CharC - the edge character
-
-Returns:
-
- The child node (NIL if not found)
-
---*/
-{
- NODE NodeR;
-
- NodeR = mNext[HASH (NodeQ, CharC)];
- //
- // sentinel
- //
- mParent[NIL] = NodeQ;
- while (mParent[NodeR] != NodeQ) {
- NodeR = mNext[NodeR];
- }
-
- return NodeR;
-}
-
-STATIC
-VOID
-MakeChild (
- IN NODE Parent,
- IN UINT8 CharC,
- IN NODE Child
- )
-/*++
-
-Routine Description:
-
- Create a new child for a given parent node.
-
-Arguments:
-
- Parent - the parent node
- CharC - the edge character
- Child - the child node
-
-Returns: (VOID)
-
---*/
-{
- NODE Node1;
- NODE Node2;
-
- Node1 = (NODE) HASH (Parent, CharC);
- Node2 = mNext[Node1];
- mNext[Node1] = Child;
- mNext[Child] = Node2;
- mPrev[Node2] = Child;
- mPrev[Child] = Node1;
- mParent[Child] = Parent;
- mChildCount[Parent]++;
-}
-
-STATIC
-VOID
-Split (
- NODE Old
- )
-/*++
-
-Routine Description:
-
- Split a node.
-
-Arguments:
-
- Old - the node to split
-
-Returns: (VOID)
-
---*/
-{
- NODE New;
- NODE TempNode;
-
- New = mAvail;
- mAvail = mNext[New];
- mChildCount[New] = 0;
- TempNode = mPrev[Old];
- mPrev[New] = TempNode;
- mNext[TempNode] = New;
- TempNode = mNext[Old];
- mNext[New] = TempNode;
- mPrev[TempNode] = New;
- mParent[New] = mParent[Old];
- mLevel[New] = (UINT8) mMatchLen;
- mPosition[New] = mPos;
- MakeChild (New, mText[mMatchPos + mMatchLen], Old);
- MakeChild (New, mText[mPos + mMatchLen], mPos);
-}
-
-STATIC
-VOID
-InsertNode (
- VOID
- )
-/*++
-
-Routine Description:
-
- Insert string info for current position into the String Info Log
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- NODE NodeQ;
- NODE NodeR;
- NODE Index2;
- NODE NodeT;
- UINT8 CharC;
- UINT8 *t1;
- UINT8 *t2;
-
- if (mMatchLen >= 4) {
- //
- // We have just got a long match, the target tree
- // can be located by MatchPos + 1. Travese the tree
- // from bottom up to get to a proper starting point.
- // The usage of PERC_FLAG ensures proper node deletion
- // in DeleteNode() later.
- //
- mMatchLen--;
- NodeR = (NODE) ((mMatchPos + 1) | WNDSIZ);
- NodeQ = mParent[NodeR];
- while (NodeQ == NIL) {
- NodeR = mNext[NodeR];
- NodeQ = mParent[NodeR];
- }
-
- while (mLevel[NodeQ] >= mMatchLen) {
- NodeR = NodeQ;
- NodeQ = mParent[NodeQ];
- }
-
- NodeT = NodeQ;
- while (mPosition[NodeT] < 0) {
- mPosition[NodeT] = mPos;
- NodeT = mParent[NodeT];
- }
-
- if (NodeT < WNDSIZ) {
- mPosition[NodeT] = (NODE) (mPos | (UINT32) PERC_FLAG);
- }
- } else {
- //
- // Locate the target tree
- //
- NodeQ = (NODE) (mText[mPos] + WNDSIZ);
- CharC = mText[mPos + 1];
- NodeR = Child (NodeQ, CharC);
- if (NodeR == NIL) {
- MakeChild (NodeQ, CharC, mPos);
- mMatchLen = 1;
- return ;
- }
-
- mMatchLen = 2;
- }
- //
- // Traverse down the tree to find a match.
- // Update Position value along the route.
- // Node split or creation is involved.
- //
- for (;;) {
- if (NodeR >= WNDSIZ) {
- Index2 = MAXMATCH;
- mMatchPos = NodeR;
- } else {
- Index2 = mLevel[NodeR];
- mMatchPos = (NODE) (mPosition[NodeR] & (UINT32)~PERC_FLAG);
- }
-
- if (mMatchPos >= mPos) {
- mMatchPos -= WNDSIZ;
- }
-
- t1 = &mText[mPos + mMatchLen];
- t2 = &mText[mMatchPos + mMatchLen];
- while (mMatchLen < Index2) {
- if (*t1 != *t2) {
- Split (NodeR);
- return ;
- }
-
- mMatchLen++;
- t1++;
- t2++;
- }
-
- if (mMatchLen >= MAXMATCH) {
- break;
- }
-
- mPosition[NodeR] = mPos;
- NodeQ = NodeR;
- NodeR = Child (NodeQ, *t1);
- if (NodeR == NIL) {
- MakeChild (NodeQ, *t1, mPos);
- return ;
- }
-
- mMatchLen++;
- }
-
- NodeT = mPrev[NodeR];
- mPrev[mPos] = NodeT;
- mNext[NodeT] = mPos;
- NodeT = mNext[NodeR];
- mNext[mPos] = NodeT;
- mPrev[NodeT] = mPos;
- mParent[mPos] = NodeQ;
- mParent[NodeR] = NIL;
-
- //
- // Special usage of 'next'
- //
- mNext[NodeR] = mPos;
-
-}
-
-STATIC
-VOID
-DeleteNode (
- VOID
- )
-/*++
-
-Routine Description:
-
- Delete outdated string info. (The Usage of PERC_FLAG
- ensures a clean deletion)
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- NODE NodeQ;
- NODE NodeR;
- NODE NodeS;
- NODE NodeT;
- NODE NodeU;
-
- if (mParent[mPos] == NIL) {
- return ;
- }
-
- NodeR = mPrev[mPos];
- NodeS = mNext[mPos];
- mNext[NodeR] = NodeS;
- mPrev[NodeS] = NodeR;
- NodeR = mParent[mPos];
- mParent[mPos] = NIL;
- if (NodeR >= WNDSIZ) {
- return ;
- }
-
- mChildCount[NodeR]--;
- if (mChildCount[NodeR] > 1) {
- return ;
- }
-
- NodeT = (NODE) (mPosition[NodeR] & (UINT32)~PERC_FLAG);
- if (NodeT >= mPos) {
- NodeT -= WNDSIZ;
- }
-
- NodeS = NodeT;
- NodeQ = mParent[NodeR];
- NodeU = mPosition[NodeQ];
- while (NodeU & (UINT32) PERC_FLAG) {
- NodeU &= (UINT32)~PERC_FLAG;
- if (NodeU >= mPos) {
- NodeU -= WNDSIZ;
- }
-
- if (NodeU > NodeS) {
- NodeS = NodeU;
- }
-
- mPosition[NodeQ] = (NODE) (NodeS | WNDSIZ);
- NodeQ = mParent[NodeQ];
- NodeU = mPosition[NodeQ];
- }
-
- if (NodeQ < WNDSIZ) {
- if (NodeU >= mPos) {
- NodeU -= WNDSIZ;
- }
-
- if (NodeU > NodeS) {
- NodeS = NodeU;
- }
-
- mPosition[NodeQ] = (NODE) (NodeS | WNDSIZ | (UINT32) PERC_FLAG);
- }
-
- NodeS = Child (NodeR, mText[NodeT + mLevel[NodeR]]);
- NodeT = mPrev[NodeS];
- NodeU = mNext[NodeS];
- mNext[NodeT] = NodeU;
- mPrev[NodeU] = NodeT;
- NodeT = mPrev[NodeR];
- mNext[NodeT] = NodeS;
- mPrev[NodeS] = NodeT;
- NodeT = mNext[NodeR];
- mPrev[NodeT] = NodeS;
- mNext[NodeS] = NodeT;
- mParent[NodeS] = mParent[NodeR];
- mParent[NodeR] = NIL;
- mNext[NodeR] = mAvail;
- mAvail = NodeR;
-}
-
-STATIC
-VOID
-GetNextMatch (
- VOID
- )
-/*++
-
-Routine Description:
-
- Advance the current position (read in new data if needed).
- Delete outdated string info. Find a match string for current position.
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- INT32 Number;
-
- mRemainder--;
- mPos++;
- if (mPos == WNDSIZ * 2) {
- memmove (&mText[0], &mText[WNDSIZ], WNDSIZ + MAXMATCH);
- Number = FreadCrc (&mText[WNDSIZ + MAXMATCH], WNDSIZ);
- mRemainder += Number;
- mPos = WNDSIZ;
- }
-
- DeleteNode ();
- InsertNode ();
-}
-
-STATIC
-EFI_STATUS
-Encode (
- VOID
- )
-/*++
-
-Routine Description:
-
- The main controlling routine for compression process.
-
-Arguments: (VOID)
-
-Returns:
-
- EFI_SUCCESS - The compression is successful
- EFI_OUT_0F_RESOURCES - Not enough memory for compression process
-
---*/
-{
- EFI_STATUS Status;
- INT32 LastMatchLen;
- NODE LastMatchPos;
-
- Status = AllocateMemory ();
- if (EFI_ERROR (Status)) {
- FreeMemory ();
- return Status;
- }
-
- InitSlide ();
-
- HufEncodeStart ();
-
- mRemainder = FreadCrc (&mText[WNDSIZ], WNDSIZ + MAXMATCH);
-
- mMatchLen = 0;
- mPos = WNDSIZ;
- InsertNode ();
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
-
- while (mRemainder > 0) {
- LastMatchLen = mMatchLen;
- LastMatchPos = mMatchPos;
- GetNextMatch ();
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
-
- if (mMatchLen > LastMatchLen || LastMatchLen < THRESHOLD) {
- //
- // Not enough benefits are gained by outputting a pointer,
- // so just output the original character
- //
- Output (mText[mPos - 1], 0);
-
- } else {
-
- if (LastMatchLen == THRESHOLD) {
- if (((mPos - LastMatchPos - 2) & (WNDSIZ - 1)) > (1U << 11)) {
- Output (mText[mPos - 1], 0);
- continue;
- }
- }
- //
- // Outputting a pointer is beneficial enough, do it.
- //
- Output (
- LastMatchLen + (UINT8_MAX + 1 - THRESHOLD),
- (mPos - LastMatchPos - 2) & (WNDSIZ - 1)
- );
- LastMatchLen--;
- while (LastMatchLen > 0) {
- GetNextMatch ();
- LastMatchLen--;
- }
-
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
- }
- }
-
- HufEncodeEnd ();
- FreeMemory ();
- return EFI_SUCCESS;
-}
-
-STATIC
-VOID
-CountTFreq (
- VOID
- )
-/*++
-
-Routine Description:
-
- Count the frequencies for the Extra Set
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- INT32 Index;
- INT32 Index3;
- INT32 Number;
- INT32 Count;
-
- for (Index = 0; Index < NT; Index++) {
- mTFreq[Index] = 0;
- }
-
- Number = NC;
- while (Number > 0 && mCLen[Number - 1] == 0) {
- Number--;
- }
-
- Index = 0;
- while (Index < Number) {
- Index3 = mCLen[Index++];
- if (Index3 == 0) {
- Count = 1;
- while (Index < Number && mCLen[Index] == 0) {
- Index++;
- Count++;
- }
-
- if (Count <= 2) {
- mTFreq[0] = (UINT16) (mTFreq[0] + Count);
- } else if (Count <= 18) {
- mTFreq[1]++;
- } else if (Count == 19) {
- mTFreq[0]++;
- mTFreq[1]++;
- } else {
- mTFreq[2]++;
- }
- } else {
- mTFreq[Index3 + 2]++;
- }
- }
-}
-
-STATIC
-VOID
-WritePTLen (
- IN INT32 Number,
- IN INT32 nbit,
- IN INT32 Special
- )
-/*++
-
-Routine Description:
-
- Outputs the code length array for the Extra Set or the Position Set.
-
-Arguments:
-
- Number - the number of symbols
- nbit - the number of bits needed to represent 'n'
- Special - the special symbol that needs to be take care of
-
-Returns: (VOID)
-
---*/
-{
- INT32 Index;
- INT32 Index3;
-
- while (Number > 0 && mPTLen[Number - 1] == 0) {
- Number--;
- }
-
- PutBits (nbit, Number);
- Index = 0;
- while (Index < Number) {
- Index3 = mPTLen[Index++];
- if (Index3 <= 6) {
- PutBits (3, Index3);
- } else {
- PutBits (Index3 - 3, (1U << (Index3 - 3)) - 2);
- }
-
- if (Index == Special) {
- while (Index < 6 && mPTLen[Index] == 0) {
- Index++;
- }
-
- PutBits (2, (Index - 3) & 3);
- }
- }
-}
-
-STATIC
-VOID
-WriteCLen (
- VOID
- )
-/*++
-
-Routine Description:
-
- Outputs the code length array for Char&Length Set
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- INT32 Index;
- INT32 Index3;
- INT32 Number;
- INT32 Count;
-
- Number = NC;
- while (Number > 0 && mCLen[Number - 1] == 0) {
- Number--;
- }
-
- PutBits (CBIT, Number);
- Index = 0;
- while (Index < Number) {
- Index3 = mCLen[Index++];
- if (Index3 == 0) {
- Count = 1;
- while (Index < Number && mCLen[Index] == 0) {
- Index++;
- Count++;
- }
-
- if (Count <= 2) {
- for (Index3 = 0; Index3 < Count; Index3++) {
- PutBits (mPTLen[0], mPTCode[0]);
- }
- } else if (Count <= 18) {
- PutBits (mPTLen[1], mPTCode[1]);
- PutBits (4, Count - 3);
- } else if (Count == 19) {
- PutBits (mPTLen[0], mPTCode[0]);
- PutBits (mPTLen[1], mPTCode[1]);
- PutBits (4, 15);
- } else {
- PutBits (mPTLen[2], mPTCode[2]);
- PutBits (CBIT, Count - 20);
- }
- } else {
- PutBits (mPTLen[Index3 + 2], mPTCode[Index3 + 2]);
- }
- }
-}
-
-STATIC
-VOID
-EncodeC (
- IN INT32 Value
- )
-{
- PutBits (mCLen[Value], mCCode[Value]);
-}
-
-STATIC
-VOID
-EncodeP (
- IN UINT32 Value
- )
-{
- UINT32 Index;
- UINT32 NodeQ;
-
- Index = 0;
- NodeQ = Value;
- while (NodeQ) {
- NodeQ >>= 1;
- Index++;
- }
-
- PutBits (mPTLen[Index], mPTCode[Index]);
- if (Index > 1) {
- PutBits (Index - 1, Value & (0xFFFFFFFFU >> (32 - Index + 1)));
- }
-}
-
-STATIC
-VOID
-SendBlock (
- VOID
- )
-/*++
-
-Routine Description:
-
- Huffman code the block and output it.
-
-Arguments:
- (VOID)
-
-Returns:
- (VOID)
-
---*/
-{
- UINT32 Index;
- UINT32 Index2;
- UINT32 Index3;
- UINT32 Flags;
- UINT32 Root;
- UINT32 Pos;
- UINT32 Size;
- Flags = 0;
-
- Root = MakeTree (NC, mCFreq, mCLen, mCCode);
- Size = mCFreq[Root];
- PutBits (16, Size);
- if (Root >= NC) {
- CountTFreq ();
- Root = MakeTree (NT, mTFreq, mPTLen, mPTCode);
- if (Root >= NT) {
- WritePTLen (NT, TBIT, 3);
- } else {
- PutBits (TBIT, 0);
- PutBits (TBIT, Root);
- }
-
- WriteCLen ();
- } else {
- PutBits (TBIT, 0);
- PutBits (TBIT, 0);
- PutBits (CBIT, 0);
- PutBits (CBIT, Root);
- }
-
- Root = MakeTree (NP, mPFreq, mPTLen, mPTCode);
- if (Root >= NP) {
- WritePTLen (NP, PBIT, -1);
- } else {
- PutBits (PBIT, 0);
- PutBits (PBIT, Root);
- }
-
- Pos = 0;
- for (Index = 0; Index < Size; Index++) {
- if (Index % UINT8_BIT == 0) {
- Flags = mBuf[Pos++];
- } else {
- Flags <<= 1;
- }
-
- if (Flags & (1U << (UINT8_BIT - 1))) {
- EncodeC (mBuf[Pos++] + (1U << UINT8_BIT));
- Index3 = mBuf[Pos++];
- for (Index2 = 0; Index2 < 3; Index2++) {
- Index3 <<= UINT8_BIT;
- Index3 += mBuf[Pos++];
- }
-
- EncodeP (Index3);
- } else {
- EncodeC (mBuf[Pos++]);
- }
- }
-
- for (Index = 0; Index < NC; Index++) {
- mCFreq[Index] = 0;
- }
-
- for (Index = 0; Index < NP; Index++) {
- mPFreq[Index] = 0;
- }
-}
-
-STATIC
-VOID
-Output (
- IN UINT32 CharC,
- IN UINT32 Pos
- )
-/*++
-
-Routine Description:
-
- Outputs an Original Character or a Pointer
-
-Arguments:
-
- CharC - The original character or the 'String Length' element of a Pointer
- Pos - The 'Position' field of a Pointer
-
-Returns: (VOID)
-
---*/
-{
- STATIC UINT32 CPos;
-
- if ((mOutputMask >>= 1) == 0) {
- mOutputMask = 1U << (UINT8_BIT - 1);
- //
- // Check the buffer overflow per outputing UINT8_BIT symbols
- // which is an Original Character or a Pointer. The biggest
- // symbol is a Pointer which occupies 5 bytes.
- //
- if (mOutputPos >= mBufSiz - 5 * UINT8_BIT) {
- SendBlock ();
- mOutputPos = 0;
- }
-
- CPos = mOutputPos++;
- mBuf[CPos] = 0;
- }
-
- mBuf[mOutputPos++] = (UINT8) CharC;
- mCFreq[CharC]++;
- if (CharC >= (1U << UINT8_BIT)) {
- mBuf[CPos] |= mOutputMask;
- mBuf[mOutputPos++] = (UINT8) (Pos >> 24);
- mBuf[mOutputPos++] = (UINT8) (Pos >> 16);
- mBuf[mOutputPos++] = (UINT8) (Pos >> (UINT8_BIT));
- mBuf[mOutputPos++] = (UINT8) Pos;
- CharC = 0;
- while (Pos) {
- Pos >>= 1;
- CharC++;
- }
-
- mPFreq[CharC]++;
- }
-}
-
-STATIC
-VOID
-HufEncodeStart (
- VOID
- )
-{
- INT32 Index;
-
- for (Index = 0; Index < NC; Index++) {
- mCFreq[Index] = 0;
- }
-
- for (Index = 0; Index < NP; Index++) {
- mPFreq[Index] = 0;
- }
-
- mOutputPos = mOutputMask = 0;
- InitPutBits ();
- return ;
-}
-
-STATIC
-VOID
-HufEncodeEnd (
- VOID
- )
-{
- SendBlock ();
-
- //
- // Flush remaining bits
- //
- PutBits (UINT8_BIT - 1, 0);
-
- return ;
-}
-
-STATIC
-VOID
-MakeCrcTable (
- VOID
- )
-{
- UINT32 Index;
- UINT32 Index2;
- UINT32 Temp;
-
- for (Index = 0; Index <= UINT8_MAX; Index++) {
- Temp = Index;
- for (Index2 = 0; Index2 < UINT8_BIT; Index2++) {
- if (Temp & 1) {
- Temp = (Temp >> 1) ^ CRCPOLY;
- } else {
- Temp >>= 1;
- }
- }
-
- mCrcTable[Index] = (UINT16) Temp;
- }
-}
-
-STATIC
-VOID
-PutBits (
- IN INT32 Number,
- IN UINT32 Value
- )
-/*++
-
-Routine Description:
-
- Outputs rightmost n bits of x
-
-Arguments:
-
- Number - the rightmost n bits of the data is used
- x - the data
-
-Returns: (VOID)
-
---*/
-{
- UINT8 Temp;
-
- while (Number >= mBitCount) {
- //
- // Number -= mBitCount should never equal to 32
- //
- Temp = (UINT8) (mSubBitBuf | (Value >> (Number -= mBitCount)));
- if (mDst < mDstUpperLimit) {
- *mDst++ = Temp;
- }
-
- mCompSize++;
- mSubBitBuf = 0;
- mBitCount = UINT8_BIT;
- }
-
- mSubBitBuf |= Value << (mBitCount -= Number);
-}
-
-STATIC
-INT32
-FreadCrc (
- OUT UINT8 *Pointer,
- IN INT32 Number
- )
-/*++
-
-Routine Description:
-
- Read in source data
-
-Arguments:
-
- Pointer - the buffer to hold the data
- Number - number of bytes to read
-
-Returns:
-
- number of bytes actually read
-
---*/
-{
- INT32 Index;
-
- for (Index = 0; mSrc < mSrcUpperLimit && Index < Number; Index++) {
- *Pointer++ = *mSrc++;
- }
-
- Number = Index;
-
- Pointer -= Number;
- mOrigSize += Number;
- Index--;
- while (Index >= 0) {
- UPDATE_CRC (*Pointer++);
- Index--;
- }
-
- return Number;
-}
-
-STATIC
-VOID
-InitPutBits (
- VOID
- )
-{
- mBitCount = UINT8_BIT;
- mSubBitBuf = 0;
-}
-
-STATIC
-VOID
-CountLen (
- IN INT32 Index
- )
-/*++
-
-Routine Description:
-
- Count the number of each code length for a Huffman tree.
-
-Arguments:
-
- Index - the top node
-
-Returns: (VOID)
-
---*/
-{
- STATIC INT32 Depth = 0;
-
- if (Index < mN) {
- mLenCnt[(Depth < 16) ? Depth : 16]++;
- } else {
- Depth++;
- CountLen (mLeft[Index]);
- CountLen (mRight[Index]);
- Depth--;
- }
-}
-
-STATIC
-VOID
-MakeLen (
- IN INT32 Root
- )
-/*++
-
-Routine Description:
-
- Create code length array for a Huffman tree
-
-Arguments:
-
- Root - the root of the tree
-
-Returns:
-
- VOID
-
---*/
-{
- INT32 Index;
- INT32 Index3;
- UINT32 Cum;
-
- for (Index = 0; Index <= 16; Index++) {
- mLenCnt[Index] = 0;
- }
-
- CountLen (Root);
-
- //
- // Adjust the length count array so that
- // no code will be generated longer than its designated length
- //
- Cum = 0;
- for (Index = 16; Index > 0; Index--) {
- Cum += mLenCnt[Index] << (16 - Index);
- }
-
- while (Cum != (1U << 16)) {
- mLenCnt[16]--;
- for (Index = 15; Index > 0; Index--) {
- if (mLenCnt[Index] != 0) {
- mLenCnt[Index]--;
- mLenCnt[Index + 1] += 2;
- break;
- }
- }
-
- Cum--;
- }
-
- for (Index = 16; Index > 0; Index--) {
- Index3 = mLenCnt[Index];
- Index3--;
- while (Index3 >= 0) {
- mLen[*mSortPtr++] = (UINT8) Index;
- Index3--;
- }
- }
-}
-
-STATIC
-VOID
-DownHeap (
- IN INT32 Index
- )
-{
- INT32 Index2;
- INT32 Index3;
-
- //
- // priority queue: send Index-th entry down heap
- //
- Index3 = mHeap[Index];
- Index2 = 2 * Index;
- while (Index2 <= mHeapSize) {
- if (Index2 < mHeapSize && mFreq[mHeap[Index2]] > mFreq[mHeap[Index2 + 1]]) {
- Index2++;
- }
-
- if (mFreq[Index3] <= mFreq[mHeap[Index2]]) {
- break;
- }
-
- mHeap[Index] = mHeap[Index2];
- Index = Index2;
- Index2 = 2 * Index;
- }
-
- mHeap[Index] = (INT16) Index3;
-}
-
-STATIC
-VOID
-MakeCode (
- IN INT32 Number,
- IN UINT8 Len[ ],
- OUT UINT16 Code[]
- )
-/*++
-
-Routine Description:
-
- Assign code to each symbol based on the code length array
-
-Arguments:
-
- Number - number of symbols
- Len - the code length array
- Code - stores codes for each symbol
-
-Returns: (VOID)
-
---*/
-{
- INT32 Index;
- UINT16 Start[18];
-
- Start[1] = 0;
- for (Index = 1; Index <= 16; Index++) {
- Start[Index + 1] = (UINT16) ((Start[Index] + mLenCnt[Index]) << 1);
- }
-
- for (Index = 0; Index < Number; Index++) {
- Code[Index] = Start[Len[Index]]++;
- }
-}
-
-STATIC
-INT32
-MakeTree (
- IN INT32 NParm,
- IN UINT16 FreqParm[],
- OUT UINT8 LenParm[ ],
- OUT UINT16 CodeParm[]
- )
-/*++
-
-Routine Description:
-
- Generates Huffman codes given a frequency distribution of symbols
-
-Arguments:
-
- NParm - number of symbols
- FreqParm - frequency of each symbol
- LenParm - code length for each symbol
- CodeParm - code for each symbol
-
-Returns:
-
- Root of the Huffman tree.
-
---*/
-{
- INT32 Index;
- INT32 Index2;
- INT32 Index3;
- INT32 Avail;
-
- //
- // make tree, calculate len[], return root
- //
- mN = NParm;
- mFreq = FreqParm;
- mLen = LenParm;
- Avail = mN;
- mHeapSize = 0;
- mHeap[1] = 0;
- for (Index = 0; Index < mN; Index++) {
- mLen[Index] = 0;
- if (mFreq[Index]) {
- mHeapSize++;
- mHeap[mHeapSize] = (INT16) Index;
- }
- }
-
- if (mHeapSize < 2) {
- CodeParm[mHeap[1]] = 0;
- return mHeap[1];
- }
-
- for (Index = mHeapSize / 2; Index >= 1; Index--) {
- //
- // make priority queue
- //
- DownHeap (Index);
- }
-
- mSortPtr = CodeParm;
- do {
- Index = mHeap[1];
- if (Index < mN) {
- *mSortPtr++ = (UINT16) Index;
- }
-
- mHeap[1] = mHeap[mHeapSize--];
- DownHeap (1);
- Index2 = mHeap[1];
- if (Index2 < mN) {
- *mSortPtr++ = (UINT16) Index2;
- }
-
- Index3 = Avail++;
- mFreq[Index3] = (UINT16) (mFreq[Index] + mFreq[Index2]);
- mHeap[1] = (INT16) Index3;
- DownHeap (1);
- mLeft[Index3] = (UINT16) Index;
- mRight[Index3] = (UINT16) Index2;
- } while (mHeapSize > 1);
-
- mSortPtr = CodeParm;
- MakeLen (Index3);
- MakeCode (NParm, LenParm, CodeParm);
-
- //
- // return root
- //
- return Index3;
-}
diff --git a/BaseTools/Source/C/Common/WinNtInclude.h b/BaseTools/Source/C/Common/WinNtInclude.h
deleted file mode 100644
index bd33e3dd2a..0000000000
--- a/BaseTools/Source/C/Common/WinNtInclude.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
- WinNtInclude.h
-
-Abstract:
- Include file for the WinNt Library
-
-**/
-
-#ifndef __WIN_NT_INCLUDE_H__
-#define __WIN_NT_INCLUDE_H__
-
-#define GUID _WINNT_DUP_GUID_____
-#define _LIST_ENTRY _WINNT_DUP_LIST_ENTRY_FORWARD
-#define LIST_ENTRY _WINNT_DUP_LIST_ENTRY
-#define InterlockedIncrement _WINNT_DUP_InterlockedIncrement
-#define InterlockedDecrement _WINNT_DUP_InterlockedDecrement
-#define InterlockedCompareExchange64 _WINNT_DUP_InterlockedCompareExchange64
-#undef UNALIGNED
-#undef CONST
-#undef VOID
-
-#ifndef __GNUC__
-#include "windows.h"
-
-//
-// Win32 include files do not compile clean with /W4, so we use the warning
-// pragma to suppress the warnings for Win32 only. This way our code can stil
-// compile at /W4 (highest warning level) with /WX (warnings cause build
-// errors).
-//
-#pragma warning(disable : 4115)
-#pragma warning(disable : 4201)
-#pragma warning(disable : 4214)
-#pragma warning(disable : 4028)
-#pragma warning(disable : 4133)
-
-//
-// Set the warnings back on as the EFI code must be /W4.
-//
-#pragma warning(default : 4115)
-#pragma warning(default : 4201)
-#pragma warning(default : 4214)
-
-#endif
-
-#undef GUID
-#undef _LIST_ENTRY
-#undef LIST_ENTRY
-#undef InterlockedIncrement
-#undef InterlockedDecrement
-#undef InterlockedCompareExchange64
-#undef InterlockedCompareExchangePointer
-
-#define VOID void
-
-//
-// Prevent collisions with Windows API name macros that deal with Unicode/Not issues
-//
-#undef LoadImage
-#undef CreateEvent
-
-#endif
diff --git a/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c b/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
deleted file mode 100644
index f83c532b25..0000000000
--- a/BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- efildrimage.c
-
-Abstract:
-
- Creates and EFILDR image.
- This tool combines several PE Image files together using following format denoted as EBNF:
- FILE := EFILDR_HEADER
- EFILDR_IMAGE +
- <PeImageFileContent> +
- The order of EFILDR_IMAGE is same as the order of placing PeImageFileContent.
-
-Revision History
-
-**/
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "ParseInf.h"
-#include "CommonLib.h"
-#include "EfiUtilityMsgs.h"
-
-#define MAX_PE_IMAGES 63
-#define FILE_TYPE_FIXED_LOADER 0
-#define FILE_TYPE_RELOCATABLE_PE_IMAGE 1
-
-typedef struct {
- UINT32 CheckSum;
- UINT32 Offset;
- UINT32 Length;
- UINT8 FileName[52];
-} EFILDR_IMAGE;
-
-typedef struct {
- UINT32 Signature;
- UINT32 HeaderCheckSum;
- UINT32 FileLength;
- UINT32 NumberOfImages;
-} EFILDR_HEADER;
-
-//
-// Utility Name
-//
-#define UTILITY_NAME "EfiLdrImage"
-
-//
-// Utility version information
-//
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-void
-Version (
- void
- )
-/*++
-
-Routine Description:
-
- Displays the standard utility information to SDTOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- printf ("%s v%d.%d %s -Utility to break a file into two pieces at the request offset.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
- printf ("Copyright (c) 1999-2010 Intel Corporation. All rights reserved.\n");
-}
-
-VOID
-Usage (
- VOID
- )
-{
- printf ("Usage: EfiLdrImage -o OutImage LoaderImage PeImage1 PeImage2 ... PeImageN\n");
- exit (1);
-}
-
-EFI_STATUS
-CountVerboseLevel (
- IN CONST CHAR8* VerboseLevelString,
- IN CONST UINT64 Length,
- OUT UINT64 *ReturnValue
-)
-{
- UINT64 i = 0;
- for (;i < Length; ++i) {
- if (VerboseLevelString[i] != 'v' && VerboseLevelString[i] != 'V') {
- return EFI_ABORTED;
- }
- ++(*ReturnValue);
- }
-
- return EFI_SUCCESS;
-}
-
-UINT64
-FCopyFile (
- FILE *in,
- FILE *out
- )
-/*++
-Routine Description:
- Write all the content of input file to output file.
-
-Arguments:
- in - input file pointer
- out - output file pointer
-
-Return:
- UINT64 : file size of input file
---*/
-{
- UINT32 filesize, offset, length;
- CHAR8 Buffer[8*1024];
-
- fseek (in, 0, SEEK_END);
- filesize = ftell(in);
-
- fseek (in, 0, SEEK_SET);
-
- offset = 0;
- while (offset < filesize) {
- length = sizeof(Buffer);
- if (filesize-offset < length) {
- length = filesize-offset;
- }
-
- fread (Buffer, length, 1, in);
- fwrite (Buffer, length, 1, out);
- offset += length;
- }
-
- return filesize;
-}
-
-
-int
-main (
- int argc,
- char *argv[]
- )
-/*++
-
-Routine Description:
-
-
-Arguments:
-
-
-Returns:
-
-
---*/
-{
- UINT64 i;
- UINT64 filesize;
- FILE *fpIn, *fpOut;
- EFILDR_HEADER EfiLdrHeader;
- EFILDR_IMAGE EfiLdrImage[MAX_PE_IMAGES];
- CHAR8* OutputFileName = NULL;
- CHAR8* InputFileNames[MAX_PE_IMAGES + 1];
- UINT8 InputFileCount = 0;
- UINT64 DebugLevel = 0;
- UINT64 VerboseLevel = 0;
- EFI_STATUS Status = EFI_SUCCESS;
-
- SetUtilityName (UTILITY_NAME);
-
- if (argc == 1) {
- Usage();
- return STATUS_ERROR;
- }
-
- argc --;
- argv ++;
-
- if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
- Usage();
- return STATUS_SUCCESS;
- }
-
- if (stricmp (argv[0], "--version") == 0) {
- Version();
- return STATUS_SUCCESS;
- }
-
- while (argc > 0) {
-
- if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--output") == 0)) {
- OutputFileName = argv[1];
- if (OutputFileName == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Output file can't be null");
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- argc --;
- argv ++;
- continue;
- }
-
- if ((strlen(argv[0]) >= 2 && argv[0][0] == '-' && (argv[0][1] == 'v' || argv[0][1] == 'V')) || (stricmp (argv[0], "--verbose") == 0)) {
- VerboseLevel = 1;
- if (strlen(argv[0]) > 2) {
- Status = CountVerboseLevel (&argv[0][2], strlen(argv[0]) - 2, &VerboseLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", argv[0]);
- return STATUS_ERROR;
- }
- }
-
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--debug") == 0)) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &DebugLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
- //
- // Don't recognize the parameter, should be regarded as the input file name.
- //
- InputFileNames[InputFileCount] = argv[0];
- InputFileCount++;
- argc--;
- argv++;
- }
-
- if (InputFileCount == 0) {
- Error (NULL, 0, 1001, "Missing option", "No input file");
- return STATUS_ERROR;
- }
- //
- // Open output file for write
- //
- if (OutputFileName == NULL) {
- Error (NULL, 0, 1001, "Missing option", "No output file");
- return STATUS_ERROR;
- }
-
- fpOut = fopen(OutputFileName, "w+b");
- if (!fpOut) {
- Error (NULL, 0, 0001, "Could not open output file", OutputFileName);
- return STATUS_ERROR;
- }
-
- memset (&EfiLdrHeader, 0, sizeof (EfiLdrHeader));
- memset (&EfiLdrImage, 0, sizeof (EFILDR_IMAGE) * (InputFileCount));
-
- memcpy (&EfiLdrHeader.Signature, "EFIL", 4);
- EfiLdrHeader.FileLength = sizeof(EFILDR_HEADER) + sizeof(EFILDR_IMAGE)*(InputFileCount);
-
- //
- // Skip the file header first
- //
- fseek (fpOut, EfiLdrHeader.FileLength, SEEK_SET);
-
- //
- // copy all the input files to the output file
- //
- for(i=0;i<InputFileCount;i++) {
- //
- // Copy the content of PeImage file to output file
- //
- fpIn = fopen (InputFileNames[i], "rb");
- if (!fpIn) {
- Error (NULL, 0, 0001, "Could not open input file", InputFileNames[i]);
- fclose (fpOut);
- return STATUS_ERROR;
- }
- filesize = FCopyFile (fpIn, fpOut);
- fclose(fpIn);
-
- //
- // And in the same time update the EfiLdrHeader and EfiLdrImage array
- //
- EfiLdrImage[i].Offset = EfiLdrHeader.FileLength;
- EfiLdrImage[i].Length = (UINT32) filesize;
- strncpy ((CHAR8*) EfiLdrImage[i].FileName, InputFileNames[i], sizeof (EfiLdrImage[i].FileName) - 1);
- EfiLdrHeader.FileLength += (UINT32) filesize;
- EfiLdrHeader.NumberOfImages++;
- }
-
- //
- // Write the image header to the output file finally
- //
- fseek (fpOut, 0, SEEK_SET);
- fwrite (&EfiLdrHeader, sizeof(EFILDR_HEADER) , 1, fpOut);
- fwrite (&EfiLdrImage , sizeof(EFILDR_IMAGE)*(InputFileCount), 1, fpOut);
-
- fclose (fpOut);
- printf ("Created %s\n", OutputFileName);
- return 0;
-}
-
diff --git a/BaseTools/Source/C/EfiLdrImage/GNUmakefile b/BaseTools/Source/C/EfiLdrImage/GNUmakefile
deleted file mode 100644
index 99f786f370..0000000000
--- a/BaseTools/Source/C/EfiLdrImage/GNUmakefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# GNU/Linux makefile for 'EfiLdrImage' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = EfiLdrImage
-
-LIBS = -lCommon
-
-OBJECTS = EfiLdrImage.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
diff --git a/BaseTools/Source/C/EfiLdrImage/Makefile b/BaseTools/Source/C/EfiLdrImage/Makefile
deleted file mode 100644
index a3c9ef1f0a..0000000000
--- a/BaseTools/Source/C/EfiLdrImage/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'EfiLdrImage' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = EfiLdrImage
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = EfiLdrImage.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/EfiRom/EfiRom.c b/BaseTools/Source/C/EfiRom/EfiRom.c
deleted file mode 100644
index 5152f38ba0..0000000000
--- a/BaseTools/Source/C/EfiRom/EfiRom.c
+++ /dev/null
@@ -1,1547 +0,0 @@
-/** @file
-
-Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- EfiRom.c
-
-Abstract:
-
- Utility program to create an EFI option ROM image from binary and
- EFI PE32 files.
-
-**/
-
-#include "EfiUtilityMsgs.h"
-#include "ParseInf.h"
-#include "EfiRom.h"
-
-UINT64 DebugLevel = 0;
-
-int
-main (
- int Argc,
- char *Argv[]
- )
-/*++
-
-Routine Description:
-
- Given an EFI image filename, create a ROM-able image by creating an option
- ROM header and PCI data structure, filling them in, and then writing the
- option ROM header + PCI data structure + EFI image out to the output file.
-
-Arguments:
-
- Argc - standard C main() argument count
-
- Argv - standard C main() argument list
-
-Returns:
-
- 0 success
- non-zero otherwise
-
---*/
-{
- CHAR8 *Ext;
- FILE *FptrOut;
- UINT32 Status;
- FILE_LIST *FList;
- UINT32 TotalSize;
- UINT32 Size;
- CHAR8 *Ptr0;
-
- SetUtilityName(UTILITY_NAME);
-
- Status = STATUS_SUCCESS;
- FptrOut = NULL;
-
- //
- // Parse the command line arguments
- //
- if (ParseCommandLine (Argc, Argv, &mOptions)) {
- return STATUS_ERROR;
- }
-
- if (mOptions.Quiet) {
- SetPrintLevel(40);
- } else if (mOptions.Verbose) {
- SetPrintLevel(15);
- } else if (mOptions.Debug) {
- SetPrintLevel(DebugLevel);
- }
-
- if (mOptions.Verbose) {
- VerboseMsg("%s tool start.\n", UTILITY_NAME);
- }
-
- //
- // If dumping an image, then do that and quit
- //
- if (mOptions.DumpOption == 1) {
- if (mOptions.FileList != NULL) {
- if ((Ptr0 = strstr ((CONST CHAR8 *) mOptions.FileList->FileName, DEFAULT_OUTPUT_EXTENSION)) != NULL) {
- DumpImage (mOptions.FileList);
- goto BailOut;
- } else {
- Error (NULL, 0, 1002, "No PciRom input file", "No *.rom input file");
- goto BailOut;
- }
- }
- }
- //
- // Determine the output filename. Either what they specified on
- // the command line, or the first input filename with a different extension.
- //
- if (!mOptions.OutFileName[0]) {
- strcpy (mOptions.OutFileName, mOptions.FileList->FileName);
- //
- // Find the last . on the line and replace the filename extension with
- // the default
- //
- for (Ext = mOptions.OutFileName + strlen (mOptions.OutFileName) - 1;
- (Ext >= mOptions.OutFileName) && (*Ext != '.') && (*Ext != '\\');
- Ext--
- )
- ;
- //
- // If dot here, then insert extension here, otherwise append
- //
- if (*Ext != '.') {
- Ext = mOptions.OutFileName + strlen (mOptions.OutFileName);
- }
-
- strcpy (Ext, DEFAULT_OUTPUT_EXTENSION);
- }
- //
- // Make sure we don't have the same filename for input and output files
- //
- for (FList = mOptions.FileList; FList != NULL; FList = FList->Next) {
- if (stricmp (mOptions.OutFileName, FList->FileName) == 0) {
- Status = STATUS_ERROR;
- Error (NULL, 0, 1002, "Invalid input paramter", "Input and output file names must be different - %s = %s.", FList->FileName, mOptions.OutFileName);
- goto BailOut;
- }
- }
- //
- // Now open our output file
- //
- if ((FptrOut = fopen (mOptions.OutFileName, "wb")) == NULL) {
- Error (NULL, 0, 0001, "Error opening file", "Error opening file %s", mOptions.OutFileName);
- goto BailOut;
- }
- //
- // Process all our files
- //
- TotalSize = 0;
- for (FList = mOptions.FileList; FList != NULL; FList = FList->Next) {
- Size = 0;
- if ((FList->FileFlags & FILE_FLAG_EFI) != 0) {
- if (mOptions.Verbose) {
- VerboseMsg("Processing EFI file %s\n", FList->FileName);
- }
-
- Status = ProcessEfiFile (FptrOut, FList, mOptions.VendId, mOptions.DevId, &Size);
- } else if ((FList->FileFlags & FILE_FLAG_BINARY) !=0 ) {
- if (mOptions.Verbose) {
- VerboseMsg("Processing binary file %s\n", FList->FileName);
- }
-
- Status = ProcessBinFile (FptrOut, FList, &Size);
- } else {
- Error (NULL, 0, 2000, "Invalid parameter", "File type not specified, it must be either an EFI or binary file: %s.", FList->FileName);
- Status = STATUS_ERROR;
- }
-
- if (mOptions.Verbose) {
- VerboseMsg(" Output size = 0x%X\n", (unsigned) Size);
- }
-
- if (Status != STATUS_SUCCESS) {
- break;
- }
-
- TotalSize += Size;
- }
- //
- // Check total size
- //
- if (TotalSize > MAX_OPTION_ROM_SIZE) {
- Error (NULL, 0, 2000, "Invalid paramter", "Option ROM image size exceeds limit of 0x%X bytes.", MAX_OPTION_ROM_SIZE);
- Status = STATUS_ERROR;
- }
-
-BailOut:
- if (Status == STATUS_SUCCESS) {
- if (FptrOut != NULL) {
- fclose (FptrOut);
- }
- //
- // Clean up our file list
- //
- while (mOptions.FileList != NULL) {
- FList = mOptions.FileList->Next;
- free (mOptions.FileList);
- mOptions.FileList = FList;
- }
- }
-
- if (mOptions.Verbose) {
- VerboseMsg("%s tool done with return code is 0x%x.\n", UTILITY_NAME, GetUtilityStatus ());
- }
-
- return GetUtilityStatus ();
-}
-
-static
-int
-ProcessBinFile (
- FILE *OutFptr,
- FILE_LIST *InFile,
- UINT32 *Size
- )
-/*++
-
-Routine Description:
-
- Process a binary input file.
-
-Arguments:
-
- OutFptr - file pointer to output binary ROM image file we're creating
- InFile - structure contains information on the binary file to process
- Size - pointer to where to return the size added to the output file
-
-Returns:
-
- 0 - successful
-
---*/
-{
- FILE *InFptr;
- UINT32 TotalSize;
- UINT32 FileSize;
- UINT8 *Buffer;
- UINT32 Status;
- PCI_EXPANSION_ROM_HEADER *RomHdr;
- PCI_DATA_STRUCTURE *PciDs23;
- PCI_3_0_DATA_STRUCTURE *PciDs30;
- UINT32 Index;
- UINT8 ByteCheckSum;
-
- PciDs23 = NULL;
- PciDs30 = NULL;
- Status = STATUS_SUCCESS;
-
- //
- // Try to open the input file
- //
- if ((InFptr = fopen (InFile->FileName, "rb")) == NULL) {
- Error (NULL, 0, 0001, "Error opening file", InFile->FileName);
- return STATUS_ERROR;
- }
- //
- // Seek to the end of the input file and get the file size. Then allocate
- // a buffer to read it in to.
- //
- fseek (InFptr, 0, SEEK_END);
- FileSize = ftell (InFptr);
- if (mOptions.Verbose) {
- VerboseMsg(" File size = 0x%X\n", (unsigned) FileSize);
- }
-
- fseek (InFptr, 0, SEEK_SET);
- Buffer = (UINT8 *) malloc (FileSize);
- if (Buffer == NULL) {
- Error (NULL, 0, 4003, "Resource", "memory cannot be allocated!");
- Status = STATUS_ERROR;
- goto BailOut;
- }
-
- if (fread (Buffer, FileSize, 1, InFptr) != 1) {
- Error (NULL, 0, 2000, "Invalid", "Failed to read all bytes from input file.");
- Status = STATUS_ERROR;
- goto BailOut;
- }
- //
- // Total size must be an even multiple of 512 bytes, and can't exceed
- // the option ROM image size.
- //
- TotalSize = FileSize;
- if (TotalSize & 0x1FF) {
- TotalSize = (TotalSize + 0x200) &~0x1ff;
- }
-
- if (TotalSize > MAX_OPTION_ROM_SIZE) {
- Error (NULL, 0, 3001, "Invalid", "Option ROM image %s size exceeds limit of 0x%X bytes.", InFile->FileName, MAX_OPTION_ROM_SIZE);
- Status = STATUS_ERROR;
- goto BailOut;
- }
- //
- // Return the size to the caller so they can keep track of the running total.
- //
- *Size = TotalSize;
-
- //
- // Crude check to make sure it's a legitimate ROM image
- //
- RomHdr = (PCI_EXPANSION_ROM_HEADER *) Buffer;
- if (RomHdr->Signature != PCI_EXPANSION_ROM_HEADER_SIGNATURE) {
- Error (NULL, 0, 2000, "Invalid parameter", "ROM image file has an invalid ROM signature.");
- Status = STATUS_ERROR;
- goto BailOut;
- }
- //
- // Make sure the pointer to the PCI data structure is within the size of the image.
- // Then check it for valid signature.
- //
- if ((RomHdr->PcirOffset > FileSize) || (RomHdr->PcirOffset == 0)) {
- Error (NULL, 0, 2000, "Invalid parameter", "Invalid PCI data structure offset.");
- Status = STATUS_ERROR;
- goto BailOut;
- }
-
- //
- // Check the header is conform to PCI2.3 or PCI3.0
- //
- if (mOptions.Pci23 == 1) {
- PciDs23 = (PCI_DATA_STRUCTURE *) (Buffer + RomHdr->PcirOffset);
- if (PciDs23->Signature != PCI_DATA_STRUCTURE_SIGNATURE) {
- Error (NULL, 0, 2000, "Invalid parameter", "PCI data structure has an invalid signature.");
- Status = STATUS_ERROR;
- goto BailOut;
- }
- } else {
- //
- // Default setting is PCI3.0 header
- //
- PciDs30 = (PCI_3_0_DATA_STRUCTURE *)(Buffer + RomHdr->PcirOffset);
- if (PciDs30->Signature != PCI_DATA_STRUCTURE_SIGNATURE) {
- Error (NULL, 0, 2000, "Invalid parameter", "PCI data structure has an invalid signature.");
- Status = STATUS_ERROR;
- goto BailOut;
- }
- }
-
- //
- // ReSet Option Rom size
- //
- if (mOptions.Pci23 == 1) {
- PciDs23->ImageLength = (UINT16) (TotalSize / 512);
- } else {
- PciDs30->ImageLength = (UINT16) (TotalSize / 512);
- }
-
- //
- // If this is the last image, then set the LAST bit unless requested not
- // to via the command-line -n argument. Otherwise, make sure you clear it.
- //
- if ((InFile->Next == NULL) && (mOptions.NoLast == 0)) {
- if (mOptions.Pci23 == 1) {
- PciDs23->Indicator = INDICATOR_LAST;
- } else {
- PciDs30->Indicator = INDICATOR_LAST;
- }
- } else {
- if (mOptions.Pci23 == 1) {
- PciDs23->Indicator = 0;
- } else {
- PciDs30->Indicator = 0;
- }
- }
-
- ByteCheckSum = 0;
- for (Index = 0; Index < FileSize - 1; Index++) {
- ByteCheckSum = (UINT8) (ByteCheckSum + Buffer[Index]);
- }
-
- Buffer[FileSize - 1] = (UINT8) ((~ByteCheckSum) + 1);
- if (mOptions.Verbose) {
- VerboseMsg(" Checksum = %02x\n\n", Buffer[FileSize - 1]);
- }
-
- //
- // Now copy the input file contents out to the output file
- //
- if (fwrite (Buffer, FileSize, 1, OutFptr) != 1) {
- Error (NULL, 0, 0005, "Failed to write all file bytes to output file.", NULL);
- Status = STATUS_ERROR;
- goto BailOut;
- }
-
- TotalSize -= FileSize;
- //
- // Pad the rest of the image to make it a multiple of 512 bytes
- //
- while (TotalSize > 0) {
- putc (~0, OutFptr);
- TotalSize--;
- }
-
-BailOut:
- if (InFptr != NULL) {
- fclose (InFptr);
- }
-
- if (Buffer != NULL) {
- free (Buffer);
- }
- //
- // Print the file name if errors occurred
- //
- if (Status != STATUS_SUCCESS) {
- Error (NULL, 0, 0003, "Error", "Error parsing file: %s", InFile->FileName);
- }
-
- return Status;
-}
-
-static
-int
-ProcessEfiFile (
- FILE *OutFptr,
- FILE_LIST *InFile,
- UINT16 VendId,
- UINT16 DevId,
- UINT32 *Size
- )
-/*++
-
-Routine Description:
-
- Process a PE32 EFI file.
-
-Arguments:
-
- OutFptr - file pointer to output binary ROM image file we're creating
- InFile - structure contains information on the PE32 file to process
- VendId - vendor ID as required in the option ROM header
- DevId - device ID as required in the option ROM header
- Size - pointer to where to return the size added to the output file
-
-Returns:
-
- 0 - successful
-
---*/
-{
- UINT32 Status;
- FILE *InFptr;
- EFI_PCI_EXPANSION_ROM_HEADER RomHdr;
- PCI_DATA_STRUCTURE PciDs23;
- PCI_3_0_DATA_STRUCTURE PciDs30;
- UINT32 FileSize;
- UINT32 CompressedFileSize;
- UINT8 *Buffer;
- UINT8 *CompressedBuffer;
- UINT8 *TempBufferPtr;
- UINT32 TotalSize;
- UINT32 HeaderSize;
- UINT16 MachineType;
- UINT16 SubSystem;
- UINT32 HeaderPadBytes;
-
- //
- // Try to open the input file
- //
- if ((InFptr = fopen (InFile->FileName, "rb")) == NULL) {
- Error (NULL, 0, 0001, "Open file error", "Error opening file: %s", InFile->FileName);
- return STATUS_ERROR;
- }
- //
- // Initialize our buffer pointers to null.
- //
- Buffer = NULL;
- CompressedBuffer = NULL;
-
- //
- // Double-check the file to make sure it's what we expect it to be
- //
- Status = CheckPE32File (InFptr, &MachineType, &SubSystem);
- if (Status != STATUS_SUCCESS) {
- goto BailOut;
- }
- //
- // Seek to the end of the input file and get the file size
- //
- fseek (InFptr, 0, SEEK_END);
- FileSize = ftell (InFptr);
-
- //
- // Get the size of the headers we're going to put in front of the image. The
- // EFI header must be aligned on a 4-byte boundary, so pad accordingly.
- //
- if (sizeof (RomHdr) & 0x03) {
- HeaderPadBytes = 4 - (sizeof (RomHdr) & 0x03);
- } else {
- HeaderPadBytes = 0;
- }
-
- //
- // For Pci3.0 to use the different data structure.
- //
- if (mOptions.Pci23 == 1) {
- HeaderSize = sizeof (PCI_DATA_STRUCTURE) + HeaderPadBytes + sizeof (EFI_PCI_EXPANSION_ROM_HEADER);
- } else {
- HeaderSize = sizeof (PCI_3_0_DATA_STRUCTURE) + HeaderPadBytes + sizeof (EFI_PCI_EXPANSION_ROM_HEADER);
- }
-
- if (mOptions.Verbose) {
- VerboseMsg(" File size = 0x%X\n", (unsigned) FileSize);
- }
- //
- // Allocate memory for the entire file (in case we have to compress), then
- // seek back to the beginning of the file and read it into our buffer.
- //
- Buffer = (UINT8 *) malloc (FileSize);
- if (Buffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- Status = STATUS_ERROR;
- goto BailOut;
- }
-
- fseek (InFptr, 0, SEEK_SET);
- if (fread (Buffer, FileSize, 1, InFptr) != 1) {
- Error (NULL, 0, 0004, "Error reading file", "File %s", InFile->FileName);
- Status = STATUS_ERROR;
- goto BailOut;
- }
- //
- // Now determine the size of the final output file. It's either the header size
- // plus the file's size, or the header size plus the compressed file size.
- //
- if ((InFile->FileFlags & FILE_FLAG_COMPRESS) != 0) {
- //
- // Allocate a buffer into which we can compress the image, compress it,
- // and use that size as the new size.
- //
- CompressedBuffer = (UINT8 *) malloc (FileSize);
- if (CompressedBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- Status = STATUS_ERROR;
- goto BailOut;
- }
-
- CompressedFileSize = FileSize;
- Status = EfiCompress (Buffer, FileSize, CompressedBuffer, &CompressedFileSize);
- if (Status != STATUS_SUCCESS) {
- Error (NULL, 0, 0007, "Error compressing file!", NULL);
- goto BailOut;
- }
- //
- // Now compute the size, then swap buffer pointers.
- //
- if (mOptions.Verbose) {
- VerboseMsg(" Comp size = 0x%X\n", (unsigned) CompressedFileSize);
- }
-
- TotalSize = CompressedFileSize + HeaderSize;
- FileSize = CompressedFileSize;
- TempBufferPtr = Buffer;
- Buffer = CompressedBuffer;
- CompressedBuffer = TempBufferPtr;
- } else {
- TotalSize = FileSize + HeaderSize;
- }
- //
- // Total size must be an even multiple of 512 bytes
- //
- if (TotalSize & 0x1FF) {
- TotalSize = (TotalSize + 0x200) &~0x1ff;
- }
- //
- // Check size
- //
- if (TotalSize > MAX_OPTION_ROM_SIZE) {
- Error (NULL, 0, 2000, "Invalid", "Option ROM image %s size exceeds limit of 0x%X bytes.", InFile->FileName, MAX_OPTION_ROM_SIZE);
- Status = STATUS_ERROR;
- goto BailOut;
- }
- //
- // Return the size to the caller so they can keep track of the running total.
- //
- *Size = TotalSize;
-
- //
- // Now fill in the ROM header. These values come from chapter 18 of the
- // EFI 1.02 specification.
- //
- memset (&RomHdr, 0, sizeof (RomHdr));
- RomHdr.Signature = PCI_EXPANSION_ROM_HEADER_SIGNATURE;
- RomHdr.InitializationSize = (UINT16) (TotalSize / 512);
- RomHdr.EfiSignature = EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE;
- RomHdr.EfiSubsystem = SubSystem;
- RomHdr.EfiMachineType = MachineType;
- RomHdr.EfiImageHeaderOffset = (UINT16) HeaderSize;
- RomHdr.PcirOffset = (UINT16) (sizeof (RomHdr) + HeaderPadBytes);
- //
- // Set image as compressed or not
- //
- if (InFile->FileFlags & FILE_FLAG_COMPRESS) {
- RomHdr.CompressionType = EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED;
- }
- //
- // Fill in the PCI data structure
- //
- if (mOptions.Pci23 == 1) {
- memset (&PciDs23, 0, sizeof (PCI_DATA_STRUCTURE));
- } else {
- memset (&PciDs30, 0, sizeof (PCI_3_0_DATA_STRUCTURE));
- }
-
- if (mOptions.Pci23 == 1) {
- PciDs23.Signature = PCI_DATA_STRUCTURE_SIGNATURE;
- PciDs23.VendorId = VendId;
- PciDs23.DeviceId = DevId;
- PciDs23.Length = (UINT16) sizeof (PCI_DATA_STRUCTURE);
- PciDs23.Revision = 0;
- //
- // Class code and code revision from the command line (optional)
- //
- PciDs23.ClassCode[0] = (UINT8) InFile->ClassCode;
- PciDs23.ClassCode[1] = (UINT8) (InFile->ClassCode >> 8);
- PciDs23.ClassCode[2] = (UINT8) (InFile->ClassCode >> 16);
- PciDs23.ImageLength = RomHdr.InitializationSize;
- PciDs23.CodeRevision = InFile->CodeRevision;
- PciDs23.CodeType = PCI_CODE_TYPE_EFI_IMAGE;
- } else {
- PciDs30.Signature = PCI_DATA_STRUCTURE_SIGNATURE;
- PciDs30.VendorId = VendId;
- PciDs30.DeviceId = DevId;
- PciDs30.DeviceListOffset = 0; // to be fixed
- PciDs30.Length = (UINT16) sizeof (PCI_3_0_DATA_STRUCTURE);
- PciDs30.Revision = 0x3;
- //
- // Class code and code revision from the command line (optional)
- //
- PciDs30.ClassCode[0] = (UINT8) InFile->ClassCode;
- PciDs30.ClassCode[1] = (UINT8) (InFile->ClassCode >> 8);
- PciDs30.ClassCode[2] = (UINT8) (InFile->ClassCode >> 16);
- PciDs30.ImageLength = RomHdr.InitializationSize;
- PciDs30.CodeRevision = InFile->CodeRevision;
- PciDs30.CodeType = PCI_CODE_TYPE_EFI_IMAGE;
- PciDs30.MaxRuntimeImageLength = 0; // to be fixed
- PciDs30.ConfigUtilityCodeHeaderOffset = 0; // to be fixed
- PciDs30.DMTFCLPEntryPointOffset = 0; // to be fixed
- }
- //
- // If this is the last image, then set the LAST bit unless requested not
- // to via the command-line -n argument.
- //
- if ((InFile->Next == NULL) && (mOptions.NoLast == 0)) {
- if (mOptions.Pci23 == 1) {
- PciDs23.Indicator = INDICATOR_LAST;
- } else {
- PciDs30.Indicator = INDICATOR_LAST;}
- } else {
- if (mOptions.Pci23 == 1) {
- PciDs23.Indicator = 0;
- } else {
- PciDs30.Indicator = 0;
- }
- }
- //
- // Write the ROM header to the output file
- //
- if (fwrite (&RomHdr, sizeof (RomHdr), 1, OutFptr) != 1) {
- Error (NULL, 0, 0002, "Failed to write ROM header to output file!", NULL);
- Status = STATUS_ERROR;
- goto BailOut;
- }
-
- //
- // Write pad bytes to align the PciDs
- //
- while (HeaderPadBytes > 0) {
- if (putc (0, OutFptr) == EOF) {
- Error (NULL, 0, 0002, "Failed to write ROM header pad bytes to output file!", NULL);
- Status = STATUS_ERROR;
- goto BailOut;
- }
-
- HeaderPadBytes--;
- }
- //
- // Write the PCI data structure header to the output file
- //
- if (mOptions.Pci23 == 1) {
- if (fwrite (&PciDs23, sizeof (PciDs23), 1, OutFptr) != 1) {
- Error (NULL, 0, 0002, "Failed to write PCI ROM header to output file!", NULL);
- Status = STATUS_ERROR;
- goto BailOut;
- }
- } else {
- if (fwrite (&PciDs30, sizeof (PciDs30), 1, OutFptr) != 1) {
- Error (NULL, 0, 0002, "Failed to write PCI ROM header to output file!", NULL);
- Status = STATUS_ERROR;
- goto BailOut;
- }
- }
- //
- // Keep track of how many bytes left to write
- //
- TotalSize -= HeaderSize;
-
- //
- // Now dump the input file's contents to the output file
- //
- if (fwrite (Buffer, FileSize, 1, OutFptr) != 1) {
- Error (NULL, 0, 0002, "Failed to write all file bytes to output file!", NULL);
- Status = STATUS_ERROR;
- goto BailOut;
- }
-
- TotalSize -= FileSize;
- //
- // Pad the rest of the image to make it a multiple of 512 bytes
- //
- while (TotalSize > 0) {
- if (putc (~0, OutFptr) == EOF) {
- Error (NULL, 0, 2000, "Failed to write trailing pad bytes output file!", NULL);
- Status = STATUS_ERROR;
- goto BailOut;
- }
-
- TotalSize--;
- }
-
-BailOut:
- if (InFptr != NULL) {
- fclose (InFptr);
- }
- //
- // Free up our buffers
- //
- if (Buffer != NULL) {
- free (Buffer);
- }
-
- if (CompressedBuffer != NULL) {
- free (CompressedBuffer);
- }
- //
- // Print the file name if errors occurred
- //
- if (Status != STATUS_SUCCESS) {
- Error (NULL, 0, 0003, "Error parsing", "Error parsing file: %s", InFile->FileName);
- }
-
- return Status;
-}
-
-static
-int
-CheckPE32File (
- FILE *Fptr,
- UINT16 *MachineType,
- UINT16 *SubSystem
- )
-/*++
-
-Routine Description:
-
- Given a file pointer to a supposed PE32 image file, verify that it is indeed a
- PE32 image file, and then return the machine type in the supplied pointer.
-
-Arguments:
-
- Fptr File pointer to the already-opened PE32 file
- MachineType Location to stuff the machine type of the PE32 file. This is needed
- because the image may be Itanium-based, IA32, or EBC.
-
-Returns:
-
- 0 success
- non-zero otherwise
-
---*/
-{
- EFI_IMAGE_DOS_HEADER DosHeader;
- EFI_IMAGE_OPTIONAL_HEADER_UNION PeHdr;
-
- //
- // Position to the start of the file
- //
- fseek (Fptr, 0, SEEK_SET);
-
- //
- // Read the DOS header
- //
- if (fread (&DosHeader, sizeof (DosHeader), 1, Fptr) != 1) {
- Error (NULL, 0, 0004, "Failed to read the DOS stub from the input file!", NULL);
- return STATUS_ERROR;
- }
- //
- // Check the magic number (0x5A4D)
- //
- if (DosHeader.e_magic != EFI_IMAGE_DOS_SIGNATURE) {
- Error (NULL, 0, 2000, "Invalid parameter", "Input file does not appear to be a PE32 image (magic number)!");
- return STATUS_ERROR;
- }
- //
- // Position into the file and check the PE signature
- //
- fseek (Fptr, (long) DosHeader.e_lfanew, SEEK_SET);
-
- //
- // Read PE headers
- //
- if (fread (&PeHdr, sizeof (PeHdr), 1, Fptr) != 1) {
- Error (NULL, 0, 0004, "Failed to read PE/COFF headers from input file!", NULL);
- return STATUS_ERROR;
- }
-
-
- //
- // Check the PE signature in the header "PE\0\0"
- //
- if (PeHdr.Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) {
- Error (NULL, 0, 2000, "Invalid parameter", "Input file does not appear to be a PE32 image (signature)!");
- return STATUS_ERROR;
- }
-
- memcpy ((char *) MachineType, &PeHdr.Pe32.FileHeader.Machine, 2);
-
- if (PeHdr.Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- *SubSystem = PeHdr.Pe32.OptionalHeader.Subsystem;
- } else if (PeHdr.Pe32Plus.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- *SubSystem = PeHdr.Pe32Plus.OptionalHeader.Subsystem;
- } else {
- Error (NULL, 0, 2000, "Invalid parameter", "Unable to find subsystem type!");
- return STATUS_ERROR;
- }
-
- if (mOptions.Verbose) {
- VerboseMsg(" Got subsystem = 0x%X from image\n", *SubSystem);
- }
-
- //
- // File was successfully identified as a PE32
- //
- return STATUS_SUCCESS;
-}
-
-static
-int
-ParseCommandLine (
- int Argc,
- char *Argv[],
- OPTIONS *Options
- )
-/*++
-
-Routine Description:
-
- Given the Argc/Argv program arguments, and a pointer to an options structure,
- parse the command-line options and check their validity.
-
-
-Arguments:
-
- Argc - standard C main() argument count
- Argv[] - standard C main() argument list
- Options - pointer to a structure to store the options in
-
-Returns:
-
- STATUS_SUCCESS success
- non-zero otherwise
-
---*/
-{
- FILE_LIST *FileList;
- FILE_LIST *PrevFileList;
- UINT32 FileFlags;
- UINT32 ClassCode;
- UINT32 CodeRevision;
- EFI_STATUS Status;
- BOOLEAN EfiRomFlag;
- UINT64 TempValue;
-
- FileFlags = 0;
- EfiRomFlag = FALSE;
-
- //
- // Clear out the options
- //
- memset ((char *) Options, 0, sizeof (OPTIONS));
-
- //
- // To avoid compile warnings
- //
- FileList = PrevFileList = NULL;
-
- ClassCode = 0;
- CodeRevision = 0;
- //
- // Skip over the program name
- //
- Argc--;
- Argv++;
-
- //
- // If no arguments, assume they want usage info
- //
- if (Argc == 0) {
- Usage ();
- return STATUS_ERROR;
- }
-
- if ((stricmp(Argv[0], "-h") == 0) || (stricmp(Argv[0], "--help") == 0)) {
- Usage();
- return STATUS_ERROR;
- }
-
- if ((stricmp(Argv[0], "--version") == 0)) {
- Version();
- return STATUS_ERROR;
- }
-
- //
- // Process until no more arguments
- //
- while (Argc > 0) {
- if (Argv[0][0] == '-') {
- //
- // Vendor ID specified with -f
- //
- if (stricmp (Argv[0], "-f") == 0) {
- //
- // Make sure there's another parameter
- //
- Status = AsciiStringToUint64(Argv[1], FALSE, &TempValue);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid option value", "%s = %s", Argv[0], Argv[1]);
- return 1;
- }
- if (TempValue >= 0x10000) {
- Error (NULL, 0, 2000, "Invalid option value", "Vendor Id %s out of range!", Argv[1]);
- return 1;
- }
- Options->VendId = (UINT16) TempValue;
- Options->VendIdValid = 1;
-
- Argv++;
- Argc--;
- } else if (stricmp (Argv[0], "-i") == 0) {
- //
- // Device ID specified with -i
- // Make sure there's another parameter
- //
- Status = AsciiStringToUint64(Argv[1], FALSE, &TempValue);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid option value", "%s = %s", Argv[0], Argv[1]);
- return 1;
- }
- if (TempValue >= 0x10000) {
- Error (NULL, 0, 2000, "Invalid option value", "Device Id %s out of range!", Argv[1]);
- return 1;
- }
- Options->DevId = (UINT16) TempValue;
- Options->DevIdValid = 1;
-
- Argv++;
- Argc--;
- } else if ((stricmp (Argv[0], "-o") == 0) || (stricmp (Argv[0], "--output") == 0)) {
- //
- // Output filename specified with -o
- // Make sure there's another parameter
- //
- if (Argv[1] == NULL || Argv[1][0] == '-') {
- Error (NULL, 0, 2000, "Invalid parameter", "Missing output file name with %s option!", Argv[0]);
- return STATUS_ERROR;
- }
- strcpy (Options->OutFileName, Argv[1]);
-
- Argv++;
- Argc--;
- } else if ((stricmp (Argv[0], "-h") == 0) || (stricmp (Argv[0], "--help") == 0)) {
- //
- // Help option
- //
- Usage ();
- return STATUS_ERROR;
- } else if (stricmp (Argv[0], "-b") == 0) {
- //
- // Specify binary files with -b
- //
- FileFlags = FILE_FLAG_BINARY;
- } else if ((stricmp (Argv[0], "-e") == 0) || (stricmp (Argv[0], "-ec") == 0)) {
- //
- // Specify EFI files with -e. Specify EFI-compressed with -c.
- //
- FileFlags = FILE_FLAG_EFI;
- if ((Argv[0][2] == 'c') || (Argv[0][2] == 'C')) {
- FileFlags |= FILE_FLAG_COMPRESS;
- }
- //
- // Specify not to set the LAST bit in the last file with -n
- //
- } else if (stricmp (Argv[0], "-n") == 0) {
- Options->NoLast = 1;
- } else if (((stricmp (Argv[0], "-v") == 0)) || ((stricmp (Argv[0], "--verbose") == 0))) {
- //
- // -v for verbose
- //
- Options->Verbose = 1;
- } else if (stricmp (Argv[0], "--debug") == 0) {
- Status = AsciiStringToUint64(Argv[1], FALSE, &DebugLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid option value", "%s = %s", Argv[0], Argv[1]);
- return 1;
- }
- if (DebugLevel > 9) {
- Error (NULL, 0, 2000, "Invalid option value", "Debug Level range is 0-9, current input level is %d", Argv[1]);
- return 1;
- }
- if (DebugLevel>=5 && DebugLevel<=9) {
- Options->Debug = TRUE;
- } else {
- Options->Debug = FALSE;
- }
- Argv++;
- Argc--;
- } else if ((stricmp (Argv[0], "--quiet") == 0) || (stricmp (Argv[0], "-q") == 0)) {
- Options->Quiet = TRUE;
- } else if ((stricmp (Argv[0], "--dump") == 0) || (stricmp (Argv[0], "-d") == 0)) {
- //
- // -dump for dumping a ROM image. In this case, say that the device id
- // and vendor id are valid so we don't have to specify bogus ones on the
- // command line.
- //
- Options->DumpOption = 1;
-
- Options->VendIdValid = 1;
- Options->DevIdValid = 1;
- FileFlags = FILE_FLAG_BINARY;
- } else if ((stricmp (Argv[0], "-l") == 0) || (stricmp (Argv[0], "--class-code") == 0)) {
- //
- // Class code value for the next file in the list.
- // Make sure there's another parameter
- //
- Status = AsciiStringToUint64(Argv[1], FALSE, &TempValue);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid option value", "%s = %s", Argv[0], Argv[1]);
- return 1;
- }
- ClassCode = (UINT32) TempValue;
- if (ClassCode & 0xFF000000) {
- Error (NULL, 0, 2000, "Invalid parameter", "Class code %s out of range!", Argv[1]);
- return STATUS_ERROR;
- }
- if (FileList != NULL && FileList->ClassCode == 0) {
- FileList->ClassCode = ClassCode;
- }
- Argv++;
- Argc--;
- } else if ((stricmp (Argv[0], "-r") == 0) || (stricmp (Argv[0], "--Revision") == 0)) {
- //
- // Code revision in the PCI data structure. The value is for the next
- // file in the list.
- // Make sure there's another parameter
- //
- Status = AsciiStringToUint64(Argv[1], FALSE, &TempValue);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid option value", "%s = %s", Argv[0], Argv[1]);
- return 1;
- }
- CodeRevision = (UINT32) TempValue;
- if (CodeRevision & 0xFFFF0000) {
- Error (NULL, 0, 2000, "Invalid parameter", "Code revision %s out of range!", Argv[1]);
- return STATUS_ERROR;
- }
- if (FileList != NULL && FileList->CodeRevision == 0) {
- FileList->CodeRevision = (UINT16) CodeRevision;
- }
- Argv++;
- Argc--;
- } else if ((stricmp (Argv[0], "-p") == 0) || (stricmp (Argv[0], "--pci23") == 0)) {
- //
- // Default layout meets PCI 3.0 specifications, specifying this flag will for a PCI 2.3 layout.
- //
- mOptions.Pci23 = 1;
- } else {
- Error (NULL, 0, 2000, "Invalid parameter", "Invalid option specified: %s", Argv[0]);
- return STATUS_ERROR;
- }
- } else {
- //
- // Not a slash-option argument. Must be a file name. Make sure they've specified
- // -e or -b already.
- //
- if ((FileFlags & (FILE_FLAG_BINARY | FILE_FLAG_EFI)) == 0) {
- Error (NULL, 0, 2000, "Invalid parameter", "Missing -e or -b with input file %s!", Argv[0]);
- return STATUS_ERROR;
- }
- //
- // Check Efi Option RomImage
- //
- if ((FileFlags & FILE_FLAG_EFI) == FILE_FLAG_EFI) {
- EfiRomFlag = TRUE;
- }
- //
- // Create a new file structure
- //
- FileList = (FILE_LIST *) malloc (sizeof (FILE_LIST));
- if (FileList == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!", NULL);
- return STATUS_ERROR;
- }
-
- //
- // set flag and class code for this image.
- //
- memset ((char *) FileList, 0, sizeof (FILE_LIST));
- FileList->FileName = Argv[0];
- FileList->FileFlags = FileFlags;
- FileList->ClassCode = ClassCode;
- FileList->CodeRevision = (UINT16) CodeRevision;
- ClassCode = 0;
- CodeRevision = 0;
-
- if (Options->FileList == NULL) {
- Options->FileList = FileList;
- } else {
- if (PrevFileList == NULL) {
- PrevFileList = FileList;
- } else {
- PrevFileList->Next = FileList;
- }
- }
-
- PrevFileList = FileList;
- }
- //
- // Next argument
- //
- Argv++;
- Argc--;
- }
-
- //
- // Must have specified some files
- //
- if (Options->FileList == NULL) {
- Error (NULL, 0, 2000, "Invalid parameter", "Missing input file name!");
- return STATUS_ERROR;
- }
-
- //
- // For EFI OptionRom image, Make sure a device ID and vendor ID are both specified.
- //
- if (EfiRomFlag) {
- if (!Options->VendIdValid) {
- Error (NULL, 0, 2000, "Missing Vendor ID in command line", NULL);
- return STATUS_ERROR;
- }
-
- if (!Options->DevIdValid) {
- Error (NULL, 0, 2000, "Missing Device ID in command line", NULL);
- return STATUS_ERROR;
- }
- }
-
- return 0;
-}
-
-static
-void
-Version (
- VOID
- )
-/*++
-
-Routine Description:
-
- Print version information for this utility.
-
-Arguments:
-
- None.
-
-Returns:
-
- Nothing.
---*/
-{
- fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-static
-void
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- Print usage information for this utility.
-
-Arguments:
-
- None.
-
-Returns:
-
- Nothing.
-
---*/
-{
- //
- // Summary usage
- //
- fprintf (stdout, "Usage: %s -f VendorId -i DeviceId [options] [file name<s>] \n\n", UTILITY_NAME);
-
- //
- // Copyright declaration
- //
- fprintf (stdout, "Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.\n\n");
-
- //
- // Details Option
- //
- fprintf (stdout, "Options:\n");
- fprintf (stdout, " -o FileName, --output FileName\n\
- File will be created to store the output content.\n");
- fprintf (stdout, " -e EfiFileName\n\
- EFI PE32 image files.\n");
- fprintf (stdout, " -ec EfiFileName\n\
- EFI PE32 image files and will be compressed.\n");
- fprintf (stdout, " -b BinFileName\n\
- Legacy binary files.\n");
- fprintf (stdout, " -l ClassCode\n\
- Hex ClassCode in the PCI data structure header.\n");
- fprintf (stdout, " -r Rev Hex Revision in the PCI data structure header.\n");
- fprintf (stdout, " -n Not to automatically set the LAST bit in the last file.\n");
- fprintf (stdout, " -f VendorId\n\
- Hex PCI Vendor ID for the device OpROM, must be specified\n");
- fprintf (stdout, " -i DeviceId\n\
- Hex PCI Device ID for the device OpROM, must be specified\n");
- fprintf (stdout, " -p, --pci23\n\
- Default layout meets PCI 3.0 specifications\n\
- specifying this flag will for a PCI 2.3 layout.\n");
- fprintf (stdout, " -d, --dump\n\
- Dump the headers of an existing option ROM image.\n");
- fprintf (stdout, " -v, --verbose\n\
- Turn on verbose output with informational messages.\n");
- fprintf (stdout, " --version Show program's version number and exit.\n");
- fprintf (stdout, " -h, --help\n\
- Show this help message and exit.\n");
- fprintf (stdout, " -q, --quiet\n\
- Disable all messages except FATAL ERRORS.\n");
- fprintf (stdout, " --debug [#,0-9]\n\
- Enable debug messages at level #.\n");
-}
-
-static
-void
-DumpImage (
- FILE_LIST *InFile
- )
-/*++
-
-Routine Description:
-
- Dump the headers of an existing option ROM image
-
-Arguments:
-
- InFile - the file name of an existing option ROM image
-
-Returns:
-
- none
-
---*/
-{
- PCI_EXPANSION_ROM_HEADER PciRomHdr;
- FILE *InFptr;
- UINT32 ImageStart;
- UINT32 ImageCount;
- EFI_PCI_EXPANSION_ROM_HEADER EfiRomHdr;
- PCI_DATA_STRUCTURE PciDs23;
- PCI_3_0_DATA_STRUCTURE PciDs30;
-
- //
- // Open the input file
- //
- if ((InFptr = fopen (InFile->FileName, "rb")) == NULL) {
- Error (NULL, 0, 0001, "Error opening file", InFile->FileName);
- return ;
- }
- //
- // Go through the image and dump the header stuff for each
- //
- ImageCount = 0;
- for (;;) {
- //
- // Save our postition in the file, since offsets in the headers
- // are relative to the particular image.
- //
- ImageStart = ftell (InFptr);
- ImageCount++;
-
- //
- // Read the option ROM header. Have to assume a raw binary image for now.
- //
- if (fread (&PciRomHdr, sizeof (PciRomHdr), 1, InFptr) != 1) {
- Error (NULL, 0, 3001, "Not supported", "Failed to read PCI ROM header from file!");
- goto BailOut;
- }
-
- //
- // Dump the contents of the header
- //
- fprintf (stdout, "Image %u -- Offset 0x%X\n", (unsigned) ImageCount, (unsigned) ImageStart);
- fprintf (stdout, " ROM header contents\n");
- fprintf (stdout, " Signature 0x%04X\n", PciRomHdr.Signature);
- fprintf (stdout, " PCIR offset 0x%04X\n", PciRomHdr.PcirOffset);
- //
- // Find PCI data structure
- //
- if (fseek (InFptr, ImageStart + PciRomHdr.PcirOffset, SEEK_SET)) {
- Error (NULL, 0, 3001, "Not supported", "Failed to seek to PCI data structure!");
- goto BailOut;
- }
- //
- // Read and dump the PCI data structure
- //
- memset (&PciDs23, 0, sizeof (PciDs23));
- memset (&PciDs30, 0, sizeof (PciDs30));
- if (mOptions.Pci23 == 1) {
- if (fread (&PciDs23, sizeof (PciDs23), 1, InFptr) != 1) {
- Error (NULL, 0, 3001, "Not supported", "Failed to read PCI data structure from file %s!", InFile->FileName);
- goto BailOut;
- }
- } else {
- if (fread (&PciDs30, sizeof (PciDs30), 1, InFptr) != 1) {
- Error (NULL, 0, 3001, "Not supported", "Failed to read PCI data structure from file %s!", InFile->FileName);
- goto BailOut;
- }
- }
- if (mOptions.Verbose) {
- VerboseMsg("Read PCI data structure from file %s", InFile->FileName);
- }
-
- //fprintf (stdout, " PCI Data Structure\n");
- if (mOptions.Pci23 == 1) {
- fprintf (
- stdout,
- " Signature %c%c%c%c\n",
- (char) PciDs23.Signature,
- (char) (PciDs23.Signature >> 8),
- (char) (PciDs23.Signature >> 16),
- (char) (PciDs23.Signature >> 24)
- );
- fprintf (stdout, " Vendor ID 0x%04X\n", PciDs23.VendorId);
- fprintf (stdout, " Device ID 0x%04X\n", PciDs23.DeviceId);
- fprintf (stdout, " Length 0x%04X\n", PciDs23.Length);
- fprintf (stdout, " Revision 0x%04X\n", PciDs23.Revision);
- fprintf (
- stdout,
- " Class Code 0x%06X\n",
- (unsigned) (PciDs23.ClassCode[0] | (PciDs23.ClassCode[1] << 8) | (PciDs23.ClassCode[2] << 16))
- );
- fprintf (stdout, " Image size 0x%X\n", (unsigned) PciDs23.ImageLength * 512);
- fprintf (stdout, " Code revision: 0x%04X\n", PciDs23.CodeRevision);
- fprintf (stdout, " Indicator 0x%02X", PciDs23.Indicator);
- } else {
- fprintf (
- stdout,
- " Signature %c%c%c%c\n",
- (char) PciDs30.Signature,
- (char) (PciDs30.Signature >> 8),
- (char) (PciDs30.Signature >> 16),
- (char) (PciDs30.Signature >> 24)
- );
- fprintf (stdout, " Vendor ID 0x%04X\n", PciDs30.VendorId);
- fprintf (stdout, " Device ID 0x%04X\n", PciDs30.DeviceId);
- fprintf (stdout, " Length 0x%04X\n", PciDs30.Length);
- fprintf (stdout, " Revision 0x%04X\n", PciDs30.Revision);
- fprintf (stdout, " DeviceListOffset 0x%02X\n", PciDs30.DeviceListOffset);
- fprintf (
- stdout,
- " Class Code 0x%06X\n",
- (unsigned) (PciDs30.ClassCode[0] | (PciDs30.ClassCode[1] << 8) | (PciDs30.ClassCode[2] << 16))
- );
- fprintf (stdout, " Image size 0x%X\n", (unsigned) PciDs30.ImageLength * 512);
- fprintf (stdout, " Code revision: 0x%04X\n", PciDs30.CodeRevision);
- fprintf (stdout, " MaxRuntimeImageLength 0x%02X\n", PciDs30.MaxRuntimeImageLength);
- fprintf (stdout, " ConfigUtilityCodeHeaderOffset 0x%02X\n", PciDs30.ConfigUtilityCodeHeaderOffset);
- fprintf (stdout, " DMTFCLPEntryPointOffset 0x%02X\n", PciDs30.DMTFCLPEntryPointOffset);
- fprintf (stdout, " Indicator 0x%02X", PciDs30.Indicator);
- }
- //
- // Print the indicator, used to flag the last image
- //
- if (PciDs23.Indicator == INDICATOR_LAST || PciDs30.Indicator == INDICATOR_LAST) {
- fprintf (stdout, " (last image)\n");
- } else {
- fprintf (stdout, "\n");
- }
- //
- // Print the code type. If EFI code, then we can provide more info.
- //
- if (mOptions.Pci23 == 1) {
- fprintf (stdout, " Code type 0x%02X", PciDs23.CodeType);
- } else {
- fprintf (stdout, " Code type 0x%02X", PciDs30.CodeType);
- }
- if (PciDs23.CodeType == PCI_CODE_TYPE_EFI_IMAGE || PciDs30.CodeType == PCI_CODE_TYPE_EFI_IMAGE) {
- fprintf (stdout, " (EFI image)\n");
- //
- // Re-read the header as an EFI ROM header, then dump more info
- //
- fprintf (stdout, " EFI ROM header contents\n");
- if (fseek (InFptr, ImageStart, SEEK_SET)) {
- Error (NULL, 0, 5001, "Failed to re-seek to ROM header structure!", NULL);
- goto BailOut;
- }
-
- if (fread (&EfiRomHdr, sizeof (EfiRomHdr), 1, InFptr) != 1) {
- Error (NULL, 0, 5001, "Failed to read EFI PCI ROM header from file!", NULL);
- goto BailOut;
- }
- //
- // Now dump more info
- //
- fprintf (stdout, " EFI Signature 0x%04X\n", (unsigned) EfiRomHdr.EfiSignature);
- fprintf (
- stdout,
- " Compression Type 0x%04X ",
- EfiRomHdr.CompressionType
- );
- if (EfiRomHdr.CompressionType == EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED) {
- fprintf (stdout, "(compressed)\n");
- } else {
- fprintf (stdout, "(not compressed)\n");
- }
-
- fprintf (
- stdout,
- " Machine type 0x%04X (%s)\n",
- EfiRomHdr.EfiMachineType,
- GetMachineTypeStr (EfiRomHdr.EfiMachineType)
- );
- fprintf (
- stdout,
- " Subsystem 0x%04X (%s)\n",
- EfiRomHdr.EfiSubsystem,
- GetSubsystemTypeStr (EfiRomHdr.EfiSubsystem)
- );
- fprintf (
- stdout,
- " EFI image offset 0x%04X (@0x%X)\n",
- EfiRomHdr.EfiImageHeaderOffset,
- EfiRomHdr.EfiImageHeaderOffset + (unsigned) ImageStart
- );
-
- } else {
- //
- // Not an EFI image
- //
- fprintf (stdout, "\n");
- }
- //
- // If code type is EFI image, then dump it as well?
- //
- // if (PciDs.CodeType == PCI_CODE_TYPE_EFI_IMAGE) {
- // }
- //
- // If last image, then we're done
- //
- if (PciDs23.Indicator == INDICATOR_LAST || PciDs30.Indicator == INDICATOR_LAST) {
- goto BailOut;
- }
- //
- // Seek to the start of the next image
- //
- if (mOptions.Pci23 == 1) {
- if (fseek (InFptr, ImageStart + (PciDs23.ImageLength * 512), SEEK_SET)) {
- Error (NULL, 0, 3001, "Not supported", "Failed to seek to next image!");
- goto BailOut;
- }
- } else {
- if (fseek (InFptr, ImageStart + (PciDs30.ImageLength * 512), SEEK_SET)) {
- Error (NULL, 0, 3001, "Not supported", "Failed to seek to next image!");
- goto BailOut;
- }
- }
- }
-
-BailOut:
- fclose (InFptr);
-}
-
-char *
-GetMachineTypeStr (
- UINT16 MachineType
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- MachineType - GC_TODO: add argument description
-
-Returns:
-
- GC_TODO: add return values
-
---*/
-{
- int Index;
-
- for (Index = 0; mMachineTypes[Index].Name != NULL; Index++) {
- if (mMachineTypes[Index].Value == MachineType) {
- return mMachineTypes[Index].Name;
- }
- }
-
- return "unknown";
-}
-
-static
-char *
-GetSubsystemTypeStr (
- UINT16 SubsystemType
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- SubsystemType - GC_TODO: add argument description
-
-Returns:
-
- GC_TODO: add return values
-
---*/
-{
- int Index;
-
- for (Index = 0; mSubsystemTypes[Index].Name != NULL; Index++) {
- if (mSubsystemTypes[Index].Value == SubsystemType) {
- return mSubsystemTypes[Index].Name;
- }
- }
-
- return "unknown";
-}
diff --git a/BaseTools/Source/C/EfiRom/EfiRom.h b/BaseTools/Source/C/EfiRom/EfiRom.h
deleted file mode 100644
index d87c4c61b7..0000000000
--- a/BaseTools/Source/C/EfiRom/EfiRom.h
+++ /dev/null
@@ -1,366 +0,0 @@
-/** @file
-
-Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
-Module Name:
-
- EfiRom.h
-
-Abstract:
-
- This file contains the relevant declarations required
- to generate Option Rom File
-
-**/
-
-#ifndef __EFI_ROM_H__
-#define __EFI_ROM_H__
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <Common/UefiBaseTypes.h>
-#include <IndustryStandard/PeImage.h> // for PE32 structure definitions
-
-#include <IndustryStandard/pci22.h> // for option ROM header structures
-#include <IndustryStandard/pci30.h>
-
-#include "Compress.h"
-#include "CommonLib.h"
-
-//
-// Version of this utility
-//
-#define UTILITY_NAME "EfiRom"
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-//
-// Define the max length of a filename
-//
-#define MAX_PATH 200
-
-//
-// Define the default file extension name
-//
-#define DEFAULT_OUTPUT_EXTENSION ".rom"
-
-//
-// Max size for an option ROM image
-//
-#define MAX_OPTION_ROM_SIZE (1024 * 1024 * 16) // 16MB
-
-//
-// Values for the indicator field in the PCI data structure
-//
-#define INDICATOR_LAST 0x80 // last file in series of files
-
-//
-// Masks for the FILE_LIST.FileFlags field
-//
-#define FILE_FLAG_BINARY 0x01
-#define FILE_FLAG_EFI 0x02
-#define FILE_FLAG_COMPRESS 0x04
-
-//
-// Use this linked list structure to keep track of all the filenames
-// specified on the command line.
-//
-typedef struct _FILE_LIST {
- struct _FILE_LIST *Next;
- CHAR8 *FileName;
- UINT32 FileFlags;
- UINT32 ClassCode;
- UINT16 CodeRevision;
-} FILE_LIST;
-
-//
-// Use this to track our command-line options
-//
-typedef struct {
- CHAR8 OutFileName[MAX_PATH];
- INT8 NoLast;
- UINT16 ClassCode;
- UINT16 PciRevision;
- UINT16 VendId;
- UINT16 DevId;
- UINT8 VendIdValid;
- UINT8 DevIdValid;
- INT8 Verbose;
- INT8 Quiet;
- INT8 Debug;
- INT8 Pci23;
- INT8 Pci30;
- INT8 DumpOption;
-// INT8 Help;
-// INT8 Version;
- FILE_LIST *FileList;
-} OPTIONS;
-
-//
-// Make a global structure to keep track of command-line options
-//
-static OPTIONS mOptions;
-
-//
-// Use these to convert from machine type value to a named type
-//
-typedef struct {
- UINT16 Value;
- CHAR8 *Name;
-} STRING_LOOKUP;
-
-//
-// Machine Types
-//
-static STRING_LOOKUP mMachineTypes[] = {
- { EFI_IMAGE_MACHINE_IA32, "IA32" },
- { EFI_IMAGE_MACHINE_IA64, "IA64" },
- { EFI_IMAGE_MACHINE_EBC, "EBC" },
- { 0, NULL }
-};
-
-//
-// Subsystem Types
-//
-static STRING_LOOKUP mSubsystemTypes[] = {
- { EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION, "EFI application" },
- { EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER, "EFI boot service driver" },
- { EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER, "EFI runtime driver" },
- { 0, NULL }
-};
-
-//
-// Function prototypes
-//
-static
-void
-Version (
- VOID
- )
-/*++
-
-Routine Description:
-
- Displays the utility version to STDOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-;
-
-static
-void
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- Displays the utility usage syntax to STDOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-;
-
-static
-int
-ParseCommandLine (
- int Argc,
- char *Argv[],
- OPTIONS *Options
- )
-/*++
-
-Routine Description:
-
- Given the Argc/Argv program arguments, and a pointer to an options structure,
- parse the command-line options and check their validity.
-
-Arguments:
-
- Argc - standard C main() argument count
- Argv[] - standard C main() argument list
- Options - pointer to a structure to store the options in
-
-Returns:
-
- STATUS_SUCCESS success
- non-zero otherwise
-
---*/
-;
-
-static
-int
-CheckPE32File (
- FILE *Fptr,
- UINT16 *MachineType,
- UINT16 *SubSystem
- )
-/*++
-
-Routine Description:
-
- Given the Argc/Argv program arguments, and a pointer to an options structure,
- parse the command-line options and check their validity.
-
-Arguments:
-
- Argc - standard C main() argument count
- Argv[] - standard C main() argument list
- Options - pointer to a structure to store the options in
-
-Returns:
-
- STATUS_SUCCESS success
- non-zero otherwise
-
---*/
-;
-
-static
-int
-ProcessEfiFile (
- FILE *OutFptr,
- FILE_LIST *InFile,
- UINT16 VendId,
- UINT16 DevId,
- UINT32 *Size
- )
-/*++
-
-Routine Description:
-
- Process a PE32 EFI file.
-
-Arguments:
-
- OutFptr - file pointer to output binary ROM image file we're creating
- InFile - structure contains information on the PE32 file to process
- VendId - vendor ID as required in the option ROM header
- DevId - device ID as required in the option ROM header
- Size - pointer to where to return the size added to the output file
-
-Returns:
-
- 0 - successful
-
---*/
-;
-
-static
-int
-ProcessBinFile (
- FILE *OutFptr,
- FILE_LIST *InFile,
- UINT32 *Size
- )
-/*++
-
-Routine Description:
-
- Process a binary input file.
-
-Arguments:
-
- OutFptr - file pointer to output binary ROM image file we're creating
- InFile - structure contains information on the binary file to process
- Size - pointer to where to return the size added to the output file
-
-Returns:
-
- 0 - successful
-
---*/
-;
-
-static
-void
-DumpImage (
- FILE_LIST *InFile
- )
-/*++
-
-Routine Description:
-
- Dump the headers of an existing option ROM image
-
-Arguments:
-
- InFile - the file name of an existing option ROM image
-
-Returns:
-
- none
-
---*/
-;
-
-char *
-GetMachineTypeStr (
- UINT16 MachineType
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- MachineType - GC_TODO: add argument description
-
-Returns:
-
- GC_TODO: add return values
-
---*/
-;
-
-static
-char *
-GetSubsystemTypeStr (
- UINT16 SubsystemType
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- SubsystemType - GC_TODO: add argument description
-
-Returns:
-
- GC_TODO: add return values
-
---*/
-;
-
-#endif
diff --git a/BaseTools/Source/C/EfiRom/GNUmakefile b/BaseTools/Source/C/EfiRom/GNUmakefile
deleted file mode 100644
index 433c126cf2..0000000000
--- a/BaseTools/Source/C/EfiRom/GNUmakefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# GNU/Linux makefile for 'EfiRom' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = EfiRom
-
-LIBS = -lCommon
-
-OBJECTS = EfiRom.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
diff --git a/BaseTools/Source/C/EfiRom/Makefile b/BaseTools/Source/C/EfiRom/Makefile
deleted file mode 100644
index 67a9f2521b..0000000000
--- a/BaseTools/Source/C/EfiRom/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'EfiRom' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = EfiRom
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = EfiRom.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/GNUmakefile b/BaseTools/Source/C/GNUmakefile
deleted file mode 100644
index ae07509496..0000000000
--- a/BaseTools/Source/C/GNUmakefile
+++ /dev/null
@@ -1,87 +0,0 @@
-## @file
-# GNU/Linux makefile for C tools build.
-#
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-ifndef ARCH
- #
- # If ARCH is not defined, then we use 'uname -m' to attempt
- # try to figure out the appropriate ARCH.
- #
- uname_m = $(shell uname -m)
- $(info Attempting to detect ARCH from 'uname -m': $(uname_m))
- ifeq ($(uname_m),x86_64)
- ARCH=X64
- endif
- ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)
- ARCH=IA32
- endif
- ifndef ARCH
- $(info Could not detected ARCH from uname results)
- $(error ARCH is not defined!)
- endif
- $(info Detected ARCH of $(ARCH) using uname.)
-endif
-
-export ARCH
-
-MAKEROOT = .
-
-include Makefiles/header.makefile
-
-all: makerootdir subdirs $(MAKEROOT)/libs
- @echo Finished building BaseTools C Tools with ARCH=$(ARCH)
-
-LIBRARIES = Common
-# NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage
-APPLICATIONS = \
- GnuGenBootSector \
- BootSectImage \
- EfiLdrImage \
- EfiRom \
- GenFfs \
- GenFv \
- GenFw \
- GenPage \
- GenSec \
- GenCrc32 \
- GenVtf \
- LzmaCompress \
- Split \
- TianoCompress \
- VolInfo \
- VfrCompile
-
-SUBDIRS := $(LIBRARIES) $(APPLICATIONS)
-
-.PHONY: outputdirs
-makerootdir:
- -mkdir -p $(MAKEROOT)
-
-.PHONY: subdirs $(SUBDIRS)
-subdirs: $(SUBDIRS)
-$(SUBDIRS):
- $(MAKE) -C $@
-
-.PHONY: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
-$(patsubst %,%-clean,$(sort $(SUBDIRS))):
- -$(MAKE) -C $(@:-clean=) clean
-
-clean: $(patsubst %,%-clean,$(sort $(SUBDIRS)))
-
-clean: localClean
-
-localClean:
- rm -f $(MAKEROOT)/bin/*
- -rmdir $(MAKEROOT)/libs $(MAKEROOT)/bin
-
-include Makefiles/footer.makefile
diff --git a/BaseTools/Source/C/GenBootSector/FatFormat.h b/BaseTools/Source/C/GenBootSector/FatFormat.h
deleted file mode 100644
index 1f77e879b3..0000000000
--- a/BaseTools/Source/C/GenBootSector/FatFormat.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/** @file
-
- Fat file system structure and definition.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
---*/
-
-#ifndef _FAT_BPB_H_
-#define _FAT_BPB_H_
-
-#include "CommonLib.h"
-
-#pragma pack(1)
-
-typedef struct {
- //
- // Fat common field
- //
- UINT8 BS_jmpBoot[3];
- CHAR8 BS_OEMName[8];
- UINT16 BPB_BytsPerSec;
- UINT8 BPB_SecPerClus;
- UINT16 BPB_RsvdSecCnt;
- UINT8 BPB_NumFATs;
- UINT16 BPB_RootEntCnt;
- UINT16 BPB_TotSec16;
- UINT8 BPB_Media;
- UINT16 BPB_FATSz16;
- UINT16 BPB_SecPerTrk;
- UINT16 BPB_NumHeads;
- UINT32 BPB_HiddSec;
- UINT32 BPB_TotSec32;
-
- //
- // Fat12/16 specific field
- //
- UINT8 BS_DrvNum;
- UINT8 BS_Reserved1;
- UINT8 BS_BootSig;
- UINT32 BS_VolID;
- CHAR8 BS_VolLab[11];
- CHAR8 BS_FilSysType[8];
-
- //
- // Boot Code and Data
- //
- UINT8 Reserved[448];
-
- //
- // Fat common signature - 0xAA55
- //
- UINT16 Signature;
-} FAT12_16_BPB_STRUCT;
-
-typedef struct {
- //
- // Fat common field
- //
- UINT8 BS_jmpBoot[3];
- CHAR8 BS_OEMName[8];
- UINT16 BPB_BytsPerSec;
- UINT8 BPB_SecPerClus;
- UINT16 BPB_RsvdSecCnt;
- UINT8 BPB_NumFATs;
- UINT16 BPB_RootEntCnt;
- UINT16 BPB_TotSec16;
- UINT8 BPB_Media;
- UINT16 BPB_FATSz16;
- UINT16 BPB_SecPerTrk;
- UINT16 BPB_NumHeads;
- UINT32 BPB_HiddSec;
- UINT32 BPB_TotSec32;
-
- //
- // Fat32 specific field
- //
- UINT32 BPB_FATSz32;
- UINT16 BPB_ExtFlags;
- UINT16 BPB_FSVer;
- UINT32 BPB_RootClus;
- UINT16 BPB_FSInfo;
- UINT16 BPB_BkBootSec;
- UINT8 BPB_Reserved[12];
- UINT8 BS_DrvNum;
- UINT8 BS_Reserved1;
- UINT8 BS_BootSig;
- UINT32 BS_VolID;
- CHAR8 BS_VolLab[11];
- CHAR8 BS_FilSysType[8];
-
- //
- // Boot Code and Data
- //
- UINT8 Reserved[420];
-
- //
- // Fat common signature - 0xAA55
- //
- UINT16 Signature;
-} FAT32_BPB_STRUCT;
-
-typedef union {
- FAT12_16_BPB_STRUCT Fat12_16;
- FAT32_BPB_STRUCT Fat32;
-} FAT_BPB_STRUCT;
-
-typedef enum {
- FatTypeUnknown,
- FatTypeFat12,
- FatTypeFat16,
- FatTypeFat32,
- FatTypeMax
-} FAT_TYPE;
-
-typedef struct {
- CHAR8 DIR_Name[11];
- UINT8 DIR_Attr;
- UINT8 DIR_NTRes;
- UINT8 DIR_CrtTimeTenth;
- UINT16 DIR_CrtTime;
- UINT16 DIR_CrtDate;
- UINT16 DIR_LstAccDate;
- UINT16 DIR_FstClusHI;
- UINT16 DIR_WrtTime;
- UINT16 DIR_WrtDate;
- UINT16 DIR_FstClusLO;
- UINT32 DIR_FileSize;
-} FAT_DIRECTORY_ENTRY;
-
-#pragma pack()
-
-#define FAT_MAX_FAT12_CLUSTER 0xFF5
-#define FAT_MAX_FAT16_CLUSTER 0xFFF5
-
-#define FAT_BS_SIGNATURE 0xAA55
-#define FAT_BS_BOOTSIG 0x29
-#define FAT_BS_JMP1 0xEB
-#define FAT_BS_JMP2 0xE9
-#define FAT_FILSYSTYPE "FAT "
-#define FAT12_FILSYSTYPE "FAT12 "
-#define FAT16_FILSYSTYPE "FAT16 "
-#define FAT32_FILSYSTYPE "FAT32 "
-
-#endif
diff --git a/BaseTools/Source/C/GenBootSector/GenBootSector.c b/BaseTools/Source/C/GenBootSector/GenBootSector.c
deleted file mode 100644
index f102ee139a..0000000000
--- a/BaseTools/Source/C/GenBootSector/GenBootSector.c
+++ /dev/null
@@ -1,805 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- genbootsector.c
-
-Abstract:
- Reading/writing MBR/DBR.
- NOTE:
- If we write MBR to disk, we just update the MBR code and the partition table wouldn't be over written.
- If we process DBR, we will patch MBR to set first partition active if no active partition exists.
-
-**/
-
-#include <windows.h>
-#include <stdio.h>
-#include <string.h>
-#include <Common/UefiBaseTypes.h>
-
-#include "ParseInf.h"
-#include "EfiUtilityMsgs.h"
-#include "CommonLib.h"
-
-//
-// Utility Name
-//
-#define UTILITY_NAME "GenBootSector"
-
-//
-// Utility version information
-//
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-#define MAX_DRIVE 26
-#define PARTITION_TABLE_OFFSET 0x1BE
-
-#define SIZE_OF_PARTITION_ENTRY 0x10
-
-#define PARTITION_ENTRY_STARTLBA_OFFSET 8
-
-#define PARTITION_ENTRY_NUM 4
-
-INT
-GetDrvNumOffset (
- IN VOID *BootSector
- );
-
-typedef enum {
- PatchTypeUnknown,
- PatchTypeFloppy,
- PatchTypeIde,
- PatchTypeUsb,
- PatchTypeFileImage // input and output are all file image, patching action is same as PatchTypeFloppy
-} PATCH_TYPE;
-
-typedef enum {
- PathUnknown,
- PathFile,
- PathFloppy,
- PathUsb,
- PathIde
-} PATH_TYPE;
-
-typedef enum {
- ErrorSuccess,
- ErrorFileCreate,
- ErrorFileReadWrite,
- ErrorNoMbr,
- ErrorFatType,
- ErrorPath,
-} ERROR_STATUS;
-
-CHAR *ErrorStatusDesc[] = {
- "Success",
- "Failed to create files",
- "Failed to read/write files",
- "No MBR exists",
- "Failed to detect Fat type",
- "Inavlid path"
-};
-
-typedef struct _DRIVE_TYPE_DESC {
- UINT Type;
- CHAR *Description;
-} DRIVE_TYPE_DESC;
-
-#define DRIVE_TYPE_ITEM(x) {x, #x}
-DRIVE_TYPE_DESC DriveTypeDesc[] = {
- DRIVE_TYPE_ITEM (DRIVE_UNKNOWN),
- DRIVE_TYPE_ITEM (DRIVE_NO_ROOT_DIR),
- DRIVE_TYPE_ITEM (DRIVE_REMOVABLE),
- DRIVE_TYPE_ITEM (DRIVE_FIXED),
- DRIVE_TYPE_ITEM (DRIVE_REMOTE),
- DRIVE_TYPE_ITEM (DRIVE_CDROM),
- DRIVE_TYPE_ITEM (DRIVE_RAMDISK),
- (UINT) -1, NULL
-};
-
-typedef struct _DRIVE_INFO {
- CHAR VolumeLetter;
- DRIVE_TYPE_DESC *DriveType;
- UINT DiskNumber;
-} DRIVE_INFO;
-
-typedef struct _PATH_INFO {
- CHAR *Path;
- CHAR PhysicalPath[260];
- PATH_TYPE Type;
- BOOL Input;
-} PATH_INFO;
-
-#define BOOT_SECTOR_LBA_OFFSET 0x1FA
-
-#define IsLetter(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z'))
-
-BOOL
-GetDriveInfo (
- CHAR VolumeLetter,
- DRIVE_INFO *DriveInfo
- )
-/*++
-Routine Description:
- Get drive information including disk number and drive type,
- where disknumber is useful for reading/writing disk raw data.
- NOTE: Floppy disk doesn't have disk number but it doesn't matter because
- we can reading/writing floppy disk without disk number.
-
-Arguments:
- VolumeLetter : volume letter, e.g.: C for C:, A for A:
- DriveInfo : pointer to DRIVE_INFO structure receiving drive information.
-
-Return:
- TRUE : successful
- FALSE : failed
---*/
-{
- HANDLE VolumeHandle;
- STORAGE_DEVICE_NUMBER StorageDeviceNumber;
- DWORD BytesReturned;
- BOOL Success;
- UINT DriveType;
- UINT Index;
-
- CHAR RootPath[] = "X:\\"; // "X:\" -> for GetDriveType
- CHAR VolumeAccessPath[] = "\\\\.\\X:"; // "\\.\X:" -> to open the volume
-
- RootPath[0] = VolumeAccessPath[4] = VolumeLetter;
- DriveType = GetDriveType(RootPath);
- if (DriveType != DRIVE_REMOVABLE && DriveType != DRIVE_FIXED) {
- return FALSE;
- }
-
- DriveInfo->VolumeLetter = VolumeLetter;
- VolumeHandle = CreateFile (
- VolumeAccessPath,
- 0,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL,
- OPEN_EXISTING,
- 0,
- NULL
- );
- if (VolumeHandle == INVALID_HANDLE_VALUE) {
- fprintf (
- stderr,
- "error E0005: CreateFile failed: Volume = %s, LastError = 0x%x\n",
- VolumeAccessPath,
- GetLastError ()
- );
- return FALSE;
- }
-
- //
- // Get Disk Number. It should fail when operating on floppy. That's ok
- // because Disk Number is only needed when operating on Hard or USB disk.
- //
- // To direct write to disk:
- // for USB and HD: use path = \\.\PHYSICALDRIVEx, where x is Disk Number
- // for floppy: use path = \\.\X:, where X can be A or B
- //
- Success = DeviceIoControl(
- VolumeHandle,
- IOCTL_STORAGE_GET_DEVICE_NUMBER,
- NULL,
- 0,
- &StorageDeviceNumber,
- sizeof(StorageDeviceNumber),
- &BytesReturned,
- NULL
- );
- //
- // DeviceIoControl should fail if Volume is floppy or network drive.
- //
- if (!Success) {
- DriveInfo->DiskNumber = (UINT) -1;
- } else if (StorageDeviceNumber.DeviceType != FILE_DEVICE_DISK) {
- //
- // Only care about the disk.
- //
- return FALSE;
- } else{
- DriveInfo->DiskNumber = StorageDeviceNumber.DeviceNumber;
- }
- CloseHandle(VolumeHandle);
-
- //
- // Fill in the type string
- //
- DriveInfo->DriveType = NULL;
- for (Index = 0; DriveTypeDesc[Index].Description != NULL; Index ++) {
- if (DriveType == DriveTypeDesc[Index].Type) {
- DriveInfo->DriveType = &DriveTypeDesc[Index];
- break;
- }
- }
-
- if (DriveInfo->DriveType == NULL) {
- //
- // Should have a type.
- //
- fprintf (stderr, "error E3005: Fatal Error!!!\n");
- return FALSE;
- }
- return TRUE;
-}
-
-VOID
-ListDrive (
- VOID
- )
-/*++
-Routine Description:
- List every drive in current system and their information.
-
---*/
-{
- UINT Index;
- DRIVE_INFO DriveInfo;
-
- UINT Mask = GetLogicalDrives();
-
- for (Index = 0; Index < MAX_DRIVE; Index++) {
- if (((Mask >> Index) & 0x1) == 1) {
- if (GetDriveInfo ('A' + (CHAR) Index, &DriveInfo)) {
- if (Index < 2) {
- // Floppy will occupy 'A' and 'B'
- fprintf (
- stdout,
- "%c: - Type: %s\n",
- DriveInfo.VolumeLetter,
- DriveInfo.DriveType->Description
- );
- } else {
- fprintf (
- stdout,
- "%c: - DiskNum: %u, Type: %s\n",
- DriveInfo.VolumeLetter,
- (unsigned) DriveInfo.DiskNumber,
- DriveInfo.DriveType->Description
- );
- }
- }
- }
- }
-
-}
-
-INT
-GetBootSectorOffset (
- HANDLE DiskHandle,
- PATH_INFO *PathInfo
- )
-/*++
-Description:
- Get the offset of boot sector.
- For non-MBR disk, offset is just 0
- for disk with MBR, offset needs to be caculated by parsing MBR
-
- NOTE: if no one is active, we will patch MBR to select first partition as active.
-
-Arguments:
- DiskHandle : HANDLE of disk
- PathInfo : PATH_INFO structure.
- WriteToDisk : TRUE indicates writing
-
-Return:
- -1 : failed
- o.w. : Offset to boot sector
---*/
-{
- BYTE DiskPartition[0x200];
- DWORD BytesReturn;
- DWORD DbrOffset;
- DWORD Index;
- BOOL HasMbr;
-
- DbrOffset = 0;
- HasMbr = FALSE;
-
- SetFilePointer(DiskHandle, 0, NULL, FILE_BEGIN);
- if (!ReadFile (DiskHandle, DiskPartition, 0x200, &BytesReturn, NULL)) {
- return -1;
- }
-
- //
- // Check Signature, Jmp, and Boot Indicator.
- // if all pass, we assume MBR found.
- //
-
- // Check Signature: 55AA
- if ((DiskPartition[0x1FE] == 0x55) && (DiskPartition[0x1FF] == 0xAA)) {
- // Check Jmp: (EB ?? 90) or (E9 ?? ??)
- if (((DiskPartition[0] != 0xEB) || (DiskPartition[2] != 0x90)) &&
- (DiskPartition[0] != 0xE9)) {
- // Check Boot Indicator: 0x00 or 0x80
- // Boot Indicator is the first byte of Partition Entry
- HasMbr = TRUE;
- for (Index = 0; Index < PARTITION_ENTRY_NUM; ++Index) {
- if ((DiskPartition[PARTITION_TABLE_OFFSET + Index * SIZE_OF_PARTITION_ENTRY] & 0x7F) != 0) {
- HasMbr = FALSE;
- break;
- }
- }
- }
- }
-
- if (HasMbr) {
- //
- // Skip MBR
- //
- for (Index = 0; Index < PARTITION_ENTRY_NUM; Index++) {
- //
- // Found Boot Indicator.
- //
- if (DiskPartition[PARTITION_TABLE_OFFSET + (Index * SIZE_OF_PARTITION_ENTRY)] == 0x80) {
- DbrOffset = *(DWORD *)&DiskPartition[PARTITION_TABLE_OFFSET + (Index * SIZE_OF_PARTITION_ENTRY) + PARTITION_ENTRY_STARTLBA_OFFSET];
- break;
- }
- }
- //
- // If no boot indicator, we manually select 1st partition, and patch MBR.
- //
- if (Index == PARTITION_ENTRY_NUM) {
- DbrOffset = *(DWORD *)&DiskPartition[PARTITION_TABLE_OFFSET + PARTITION_ENTRY_STARTLBA_OFFSET];
- if (!PathInfo->Input && (PathInfo->Type == PathUsb)) {
- SetFilePointer(DiskHandle, 0, NULL, FILE_BEGIN);
- DiskPartition[PARTITION_TABLE_OFFSET] = 0x80;
- WriteFile (DiskHandle, DiskPartition, 0x200, &BytesReturn, NULL);
- }
- }
- }
-
- return DbrOffset;
-}
-
-/**
- * Get window file handle for input/ouput disk/file.
- *
- * @param PathInfo
- * @param ProcessMbr
- * @param FileHandle
- *
- * @return ERROR_STATUS
- */
-ERROR_STATUS
-GetFileHandle (
- PATH_INFO *PathInfo,
- BOOL ProcessMbr,
- HANDLE *FileHandle,
- DWORD *DbrOffset
- )
-{
- DWORD OpenFlag;
-
- OpenFlag = OPEN_ALWAYS;
- if (PathInfo->Input || PathInfo->Type != PathFile) {
- OpenFlag = OPEN_EXISTING;
- }
-
- *FileHandle = CreateFile(
- PathInfo->PhysicalPath,
- GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ,
- NULL,
- OpenFlag,
- FILE_ATTRIBUTE_NORMAL,
- NULL
- );
- if (*FileHandle == INVALID_HANDLE_VALUE) {
- return ErrorFileCreate;
- }
-
- if ((PathInfo->Type == PathIde) || (PathInfo->Type == PathUsb)){
- *DbrOffset = GetBootSectorOffset (*FileHandle, PathInfo);
- if (!ProcessMbr) {
- //
- // 1. Process boot sector, set file pointer to the beginning of boot sector
- //
- SetFilePointer (*FileHandle, *DbrOffset * 0x200, NULL, FILE_BEGIN);
- } else if(*DbrOffset == 0) {
- //
- // If user want to process Mbr, but no Mbr exists, simply return FALSE
- //
- return ErrorNoMbr;
- } else {
- //
- // 2. Process MBR, set file pointer to 0
- //
- SetFilePointer (*FileHandle, 0, NULL, FILE_BEGIN);
- }
- }
-
- return ErrorSuccess;
-}
-
-/**
- Writing or reading boot sector or MBR according to the argument.
-
- @param InputInfo PATH_INFO instance for input path
- @param OutputInfo PATH_INFO instance for output path
- @param ProcessMbr TRUE is to process MBR, otherwise, processing boot sector
-
- @return ERROR_STATUS
- **/
-ERROR_STATUS
-ProcessBsOrMbr (
- PATH_INFO *InputInfo,
- PATH_INFO *OutputInfo,
- BOOL ProcessMbr
- )
-{
- BYTE DiskPartition[0x200] = {0};
- BYTE DiskPartitionBackup[0x200] = {0};
- DWORD BytesReturn;
- INT DrvNumOffset;
- HANDLE InputHandle;
- HANDLE OutputHandle;
- ERROR_STATUS Status;
- DWORD InputDbrOffset;
- DWORD OutputDbrOffset;
-
- //
- // Create file Handle and move file Pointer is pointed to beginning of Mbr or Dbr
- //
- Status = GetFileHandle(InputInfo, ProcessMbr, &InputHandle, &InputDbrOffset);
- if (Status != ErrorSuccess) {
- return Status;
- }
-
- //
- // Create file Handle and move file Pointer is pointed to beginning of Mbr or Dbr
- //
- Status = GetFileHandle(OutputInfo, ProcessMbr, &OutputHandle, &OutputDbrOffset);
- if (Status != ErrorSuccess) {
- return Status;
- }
-
- //
- // Read boot sector from source disk/file
- //
- if (!ReadFile (InputHandle, DiskPartition, 0x200, &BytesReturn, NULL)) {
- return ErrorFileReadWrite;
- }
-
- if (InputInfo->Type == PathUsb) {
- // Manually set BS_DrvNum to 0x80 as window's format.exe has a bug which will clear this field discarding USB disk's MBR.
- // offset of BS_DrvNum is 0x24 for FAT12/16
- // 0x40 for FAT32
- //
- DrvNumOffset = GetDrvNumOffset (DiskPartition);
- if (DrvNumOffset == -1) {
- return ErrorFatType;
- }
- //
- // Some legacy BIOS require 0x80 discarding MBR.
- // Question left here: is it needed to check Mbr before set 0x80?
- //
- DiskPartition[DrvNumOffset] = ((InputDbrOffset > 0) ? 0x80 : 0);
- }
-
- if (InputInfo->Type == PathIde) {
- //
- // Patch LBAOffsetForBootSector
- //
- *(DWORD *)&DiskPartition [BOOT_SECTOR_LBA_OFFSET] = InputDbrOffset;
- }
-
- if (OutputInfo->Type != PathFile) {
- if (ProcessMbr) {
- //
- // Use original partition table
- //
- if (!ReadFile (OutputHandle, DiskPartitionBackup, 0x200, &BytesReturn, NULL)) {
- return ErrorFileReadWrite;
- }
- memcpy (DiskPartition + 0x1BE, DiskPartitionBackup + 0x1BE, 0x40);
- SetFilePointer (OutputHandle, 0, NULL, FILE_BEGIN);
-
- }
- }
-
- //
- // Write boot sector to taget disk/file
- //
- if (!WriteFile (OutputHandle, DiskPartition, 0x200, &BytesReturn, NULL)) {
- return ErrorFileReadWrite;
- }
-
- CloseHandle (InputHandle);
- CloseHandle (OutputHandle);
-
- return ErrorSuccess;
-}
-
-void
-Version (
- void
- )
-/*++
-
-Routine Description:
-
- Displays the standard utility information to SDTOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- printf ("%s Version %d.%d Build%s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-VOID
-PrintUsage (
- void
- )
-{
- printf ("Usage: GenBootSector [options] --cfg-file CFG_FILE\n\n\
-Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.\n\n\
- Utility to retrieve and update the boot sector or MBR.\n\n\
-optional arguments:\n\
- -h, --help Show this help message and exit\n\
- --version Show program's version number and exit\n\
- -d [DEBUG], --debug [DEBUG]\n\
- Output DEBUG statements, where DEBUG_LEVEL is 0 (min)\n\
- - 9 (max)\n\
- -v, --verbose Print informational statements\n\
- -q, --quiet Returns the exit code, error messages will be\n\
- displayed\n\
- -s, --silent Returns only the exit code; informational and error\n\
- messages are not displayed\n\
- -l, --list List disk drives\n\
- -i INPUT_FILENAME, --input INPUT_FILENAME\n\
- Input file name\n\
- -o OUTPUT_FILENAME, --output OUTPUT_FILENAME\n\
- Output file name\n\
- -m, --mbr Also process the MBR\n\
- --sfo Reserved for future use\n");
-
-}
-
-/**
- Get path information, including physical path for windows platform.
-
- @param PathInfo Point to PATH_INFO structure.
-
- @return whether path is valid.
-**/
-ERROR_STATUS
-GetPathInfo (
- PATH_INFO *PathInfo
- )
-{
- DRIVE_INFO DriveInfo;
- CHAR VolumeLetter;
- CHAR DiskPathTemplate[] = "\\\\.\\PHYSICALDRIVE%u";
- CHAR FloppyPathTemplate[] = "\\\\.\\%c:";
- FILE *f;
-
- //
- // If path is disk path
- //
- if (IsLetter(PathInfo->Path[0]) && (PathInfo->Path[1] == ':') && (PathInfo->Path[2] == '\0')) {
- VolumeLetter = PathInfo->Path[0];
- if ((VolumeLetter == 'A') || (VolumeLetter == 'a') ||
- (VolumeLetter == 'B') || (VolumeLetter == 'b')) {
- PathInfo->Type = PathFloppy;
- sprintf (PathInfo->PhysicalPath, FloppyPathTemplate, VolumeLetter);
- return ErrorSuccess;
- }
-
- if (!GetDriveInfo(VolumeLetter, &DriveInfo)) {
- fprintf (stderr, "ERROR: GetDriveInfo - 0x%x\n", GetLastError ());
- return ErrorPath;
- }
-
- if (!PathInfo->Input && (DriveInfo.DriveType->Type == DRIVE_FIXED)) {
- fprintf (stderr, "ERROR: Could patch own IDE disk!\n");
- return ErrorPath;
- }
-
- sprintf(PathInfo->PhysicalPath, DiskPathTemplate, DriveInfo.DiskNumber);
- if (DriveInfo.DriveType->Type == DRIVE_REMOVABLE) {
- PathInfo->Type = PathUsb;
- } else if (DriveInfo.DriveType->Type == DRIVE_FIXED) {
- PathInfo->Type = PathIde;
- } else {
- fprintf (stderr, "ERROR, Invalid disk path - %s", PathInfo->Path);
- return ErrorPath;
- }
-
- return ErrorSuccess;
- }
-
- PathInfo->Type = PathFile;
- if (PathInfo->Input) {
- //
- // If path is file path, check whether file is valid.
- //
- f = fopen (PathInfo->Path, "r");
- if (f == NULL) {
- fprintf (stderr, "error E2003: File was not provided!\n");
- return ErrorPath;
- }
- }
- PathInfo->Type = PathFile;
- strcpy(PathInfo->PhysicalPath, PathInfo->Path);
-
- return ErrorSuccess;
-}
-
-INT
-main (
- INT argc,
- CHAR *argv[]
- )
-{
- CHAR8 *AppName;
- INTN Index;
- BOOLEAN ProcessMbr;
- ERROR_STATUS Status;
- EFI_STATUS EfiStatus;
- PATH_INFO InputPathInfo = {0};
- PATH_INFO OutputPathInfo = {0};
- UINT64 LogLevel;
-
- SetUtilityName (UTILITY_NAME);
-
- AppName = *argv;
- argv ++;
- argc --;
-
- ProcessMbr = FALSE;
-
- if (argc == 0) {
- PrintUsage();
- return 0;
- }
-
- //
- // Parse command line
- //
- for (Index = 0; Index < argc; Index ++) {
- if ((stricmp (argv[Index], "-l") == 0) || (stricmp (argv[Index], "--list") == 0)) {
- ListDrive ();
- return 0;
- }
-
- if ((stricmp (argv[Index], "-m") == 0) || (stricmp (argv[Index], "--mbr") == 0)) {
- ProcessMbr = TRUE;
- continue;
- }
-
- if ((stricmp (argv[Index], "-i") == 0) || (stricmp (argv[Index], "--input") == 0)) {
- InputPathInfo.Path = argv[Index + 1];
- InputPathInfo.Input = TRUE;
- if (InputPathInfo.Path == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Input file name can't be NULL");
- return 1;
- }
- if (InputPathInfo.Path[0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Input file is missing");
- return 1;
- }
- ++Index;
- continue;
- }
-
- if ((stricmp (argv[Index], "-o") == 0) || (stricmp (argv[Index], "--output") == 0)) {
- OutputPathInfo.Path = argv[Index + 1];
- OutputPathInfo.Input = FALSE;
- if (OutputPathInfo.Path == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Output file name can't be NULL");
- return 1;
- }
- if (OutputPathInfo.Path[0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Output file is missing");
- return 1;
- }
- ++Index;
- continue;
- }
-
- if ((stricmp (argv[Index], "-h") == 0) || (stricmp (argv[Index], "--help") == 0)) {
- PrintUsage ();
- return 0;
- }
-
- if (stricmp (argv[Index], "--version") == 0) {
- Version ();
- return 0;
- }
-
- if ((stricmp (argv[Index], "-v") == 0) || (stricmp (argv[Index], "--verbose") == 0)) {
- continue;
- }
-
- if ((stricmp (argv[Index], "-q") == 0) || (stricmp (argv[Index], "--quiet") == 0)) {
- continue;
- }
-
- if ((stricmp (argv[Index], "-d") == 0) || (stricmp (argv[Index], "--debug") == 0)) {
- EfiStatus = AsciiStringToUint64 (argv[Index + 1], FALSE, &LogLevel);
- if (EFI_ERROR (EfiStatus)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[Index], argv[Index + 1]);
- return 1;
- }
- if (LogLevel > 9) {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, currnt input level is %d", (int) LogLevel);
- return 1;
- }
- SetPrintLevel (LogLevel);
- DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", argv[Index + 1]);
- ++Index;
- continue;
- }
-
- //
- // Don't recognize the parameter.
- //
- Error (NULL, 0, 1000, "Unknown option", "%s", argv[Index]);
- return 1;
- }
-
- if (InputPathInfo.Path == NULL) {
- Error (NULL, 0, 1001, "Missing options", "Input file is missing");
- return 1;
- }
-
- if (OutputPathInfo.Path == NULL) {
- Error (NULL, 0, 1001, "Missing options", "Output file is missing");
- return 1;
- }
-
- if (GetPathInfo(&InputPathInfo) != ErrorSuccess) {
- Error (NULL, 0, 1003, "Invalid option value", "Input file can't be found.");
- return 1;
- }
-
- if (GetPathInfo(&OutputPathInfo) != ErrorSuccess) {
- Error (NULL, 0, 1003, "Invalid option value", "Output file can't be found.");
- return 1;
- }
-
- //
- // Process DBR (Patch or Read)
- //
- Status = ProcessBsOrMbr (&InputPathInfo, &OutputPathInfo, ProcessMbr);
-
- if (Status == ErrorSuccess) {
- fprintf (
- stdout,
- "%s %s: successful!\n",
- (OutputPathInfo.Type != PathFile) ? "Write" : "Read",
- ProcessMbr ? "MBR" : "DBR"
- );
- return 0;
- } else {
- fprintf (
- stderr,
- "%s: %s %s: failed - %s (LastError: 0x%x)!\n",
- (Status == ErrorNoMbr) ? "WARNING" : "ERROR",
- (OutputPathInfo.Type != PathFile) ? "Write" : "Read",
- ProcessMbr ? "MBR" : "DBR",
- ErrorStatusDesc[Status],
- GetLastError ()
- );
- return 1;
- }
-}
diff --git a/BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c b/BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c
deleted file mode 100644
index 065833b79f..0000000000
--- a/BaseTools/Source/C/GenBootSector/GetDrvNumOffset.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/** @file
-
- Get Drv Num offset from Fat file system.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <stdio.h>
-#include "FatFormat.h"
-
-INTN
-GetDrvNumOffset (
- IN VOID *BootSector
- )
-{
- FAT_BPB_STRUCT *FatBpb;
- UINTN RootDirSectors;
- UINTN FATSz;
- UINTN TotSec;
- UINTN DataSec;
- UINTN CountOfClusters;
-
- FatBpb = (FAT_BPB_STRUCT *) BootSector;
-
- //
- // Check FAT type algorithm from FAT spec
- //
- RootDirSectors = ((FatBpb->Fat12_16.BPB_RootEntCnt * sizeof(FAT_DIRECTORY_ENTRY)) +
- (FatBpb->Fat12_16.BPB_BytsPerSec - 1)) / FatBpb->Fat12_16.BPB_BytsPerSec;
-
- if (FatBpb->Fat12_16.BPB_FATSz16 != 0) {
- FATSz = FatBpb->Fat12_16.BPB_FATSz16;
- } else {
- FATSz = FatBpb->Fat32.BPB_FATSz32;
- }
- if (FATSz == 0) {
- fprintf (stderr, "error E3003: FAT - BPB_FATSz16, BPB_FATSz32 - 0, expected: Non-Zero number\n");
- return -1;
- }
-
- if (FatBpb->Fat12_16.BPB_TotSec16 != 0) {
- TotSec = FatBpb->Fat12_16.BPB_TotSec16;
- } else {
- TotSec = FatBpb->Fat12_16.BPB_TotSec32;
- }
- if (TotSec == 0) {
- fprintf (stderr, "error E3003: FAT - BPB_TotSec16, BPB_TotSec32 - 0, expected: Non-Zero number\n");
- return -1;
- }
-
- DataSec = TotSec - (
- FatBpb->Fat12_16.BPB_RsvdSecCnt +
- FatBpb->Fat12_16.BPB_NumFATs * FATSz +
- RootDirSectors
- );
-
- CountOfClusters = DataSec / FatBpb->Fat12_16.BPB_SecPerClus;
-
- if (CountOfClusters < FAT_MAX_FAT16_CLUSTER) {
- return (INTN) ((UINTN) &FatBpb->Fat12_16.BS_DrvNum - (UINTN) FatBpb);
- } else {
- return (INTN) ((UINTN) &FatBpb->Fat32.BS_DrvNum - (UINTN) FatBpb);
- }
-}
-
diff --git a/BaseTools/Source/C/GenBootSector/Makefile b/BaseTools/Source/C/GenBootSector/Makefile
deleted file mode 100644
index 6ba39db166..0000000000
--- a/BaseTools/Source/C/GenBootSector/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'GenBootSector' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = GenBootSector
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = GenBootSector.obj GetDrvNumOffset.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/GenCrc32/GNUmakefile b/BaseTools/Source/C/GenCrc32/GNUmakefile
deleted file mode 100644
index 15b4dad4b5..0000000000
--- a/BaseTools/Source/C/GenCrc32/GNUmakefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# GNU/Linux makefile for 'GenCrc32' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = GenCrc32
-
-LIBS = -lCommon
-
-OBJECTS = GenCrc32.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
diff --git a/BaseTools/Source/C/GenCrc32/GenCrc32.c b/BaseTools/Source/C/GenCrc32/GenCrc32.c
deleted file mode 100644
index 8ece9a8412..0000000000
--- a/BaseTools/Source/C/GenCrc32/GenCrc32.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/** @file
-
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- GenCrc32.c
-
-Abstract:
- Calculate Crc32 value and Verify Crc32 value for input data.
-
-**/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "ParseInf.h"
-#include "EfiUtilityMsgs.h"
-#include "CommonLib.h"
-#include "Crc32.h"
-
-#define UTILITY_NAME "GenCrc32"
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-#define CRC32_NULL 0
-#define CRC32_ENCODE 1
-#define CRC32_DECODE 2
-
-VOID
-Version (
- VOID
- )
-/*++
-
-Routine Description:
-
- Displays the standard utility information to SDTOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- fprintf (stdout, "%s Version %d.%d Build %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-VOID
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- Displays the utility usage syntax to STDOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- //
- // Summary usage
- //
- fprintf (stdout, "Usage: GenCrc32 -e|-d [options] <input_file>\n\n");
-
- //
- // Copyright declaration
- //
- fprintf (stdout, "Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.\n\n");
-
- //
- // Details Option
- //
- fprintf (stdout, "optional arguments:\n");
- fprintf (stdout, " -h, --help Show this help message and exit\n");
- fprintf (stdout, " --version Show program's version number and exit\n");
- fprintf (stdout, " --debug [DEBUG] Output DEBUG statements, where DEBUG_LEVEL is 0 (min)\n\
- - 9 (max)\n");
- fprintf (stdout, " -v, --verbose Print informational statements\n");
- fprintf (stdout, " -q, --quiet Returns the exit code, error messages will be\n\
- displayed\n");
- fprintf (stdout, " -s, --silent Returns only the exit code; informational and error\n\
- messages are not displayed\n");
- fprintf (stdout, " -e, --encode Calculate CRC32 value for the input file\n");
- fprintf (stdout, " -d, --decode Verify CRC32 value for the input file\n");
- fprintf (stdout, " -o OUTPUT_FILENAME, --output OUTPUT_FILENAME\n\
- Output file name\n");
- fprintf (stdout, " --sfo Reserved for future use\n");
-
-}
-
-int
-main (
- int argc,
- CHAR8 *argv[]
- )
-/*++
-
-Routine Description:
-
- Main function.
-
-Arguments:
-
- argc - Number of command line parameters.
- argv - Array of pointers to parameter strings.
-
-Returns:
- STATUS_SUCCESS - Utility exits successfully.
- STATUS_ERROR - Some error occurred during execution.
-
---*/
-{
- EFI_STATUS Status;
- CHAR8 *OutputFileName;
- CHAR8 *InputFileName;
- UINT8 *FileBuffer;
- UINT32 FileSize;
- UINT64 LogLevel;
- UINT8 FileAction;
- UINT32 Crc32Value;
- FILE *InFile;
- FILE *OutFile;
-
- //
- // Init local variables
- //
- LogLevel = 0;
- Status = EFI_SUCCESS;
- InputFileName = NULL;
- OutputFileName = NULL;
- FileAction = CRC32_NULL;
- InFile = NULL;
- OutFile = NULL;
- Crc32Value = 0;
- FileBuffer = NULL;
-
- SetUtilityName (UTILITY_NAME);
-
- if (argc == 1) {
- Error (NULL, 0, 1001, "Missing options", "no options input");
- Usage ();
- return STATUS_ERROR;
- }
-
- //
- // Parse command line
- //
- argc --;
- argv ++;
-
- if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
- Usage ();
- return STATUS_SUCCESS;
- }
-
- if (stricmp (argv[0], "--version") == 0) {
- Version ();
- return STATUS_SUCCESS;
- }
-
- while (argc > 0) {
- if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--output") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Output File name is missing for -o option");
- goto Finish;
- }
- OutputFileName = argv[1];
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-e") == 0) || (stricmp (argv[0], "--encode") == 0)) {
- FileAction = CRC32_ENCODE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--decode") == 0)) {
- FileAction = CRC32_DECODE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-v") == 0) || (stricmp (argv[0], "--verbose") == 0)) {
- SetPrintLevel (VERBOSE_LOG_LEVEL);
- VerboseMsg ("Verbose output Mode Set!");
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- SetPrintLevel (KEY_LOG_LEVEL);
- KeyMsg ("Quiet output Mode Set!");
- argc --;
- argv ++;
- continue;
- }
-
- if (stricmp (argv[0], "--debug") == 0) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &LogLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- if (LogLevel > 9) {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, current input level is %d", (int) LogLevel);
- goto Finish;
- }
- SetPrintLevel (LogLevel);
- DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", argv[1]);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if (argv[0][0] == '-') {
- Error (NULL, 0, 1000, "Unknown option", argv[0]);
- goto Finish;
- }
-
- //
- // Get Input file file name.
- //
- InputFileName = argv[0];
- argc --;
- argv ++;
- }
-
- VerboseMsg ("%s tool start.", UTILITY_NAME);
-
- //
- // Check Input paramters
- //
- if (FileAction == CRC32_NULL) {
- Error (NULL, 0, 1001, "Missing option", "either the encode or the decode option must be specified!");
- return STATUS_ERROR;
- } else if (FileAction == CRC32_ENCODE) {
- VerboseMsg ("File will be encoded by Crc32");
- } else if (FileAction == CRC32_DECODE) {
- VerboseMsg ("File will be decoded by Crc32");
- }
-
- if (InputFileName == NULL) {
- Error (NULL, 0, 1001, "Missing option", "Input files are not specified");
- goto Finish;
- } else {
- VerboseMsg ("Input file name is %s", InputFileName);
- }
-
- if (OutputFileName == NULL) {
- Error (NULL, 0, 1001, "Missing option", "Output file are not specified");
- goto Finish;
- } else {
- VerboseMsg ("Output file name is %s", OutputFileName);
- }
-
- //
- // Open Input file and read file data.
- //
- InFile = fopen (InputFileName, "rb");
- if (InFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", InputFileName);
- return STATUS_ERROR;
- }
-
- fseek (InFile, 0, SEEK_END);
- FileSize = ftell (InFile);
- fseek (InFile, 0, SEEK_SET);
-
- FileBuffer = (UINT8 *) malloc (FileSize);
- if (FileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated!");
- goto Finish;
- }
-
- fread (FileBuffer, 1, FileSize, InFile);
- fclose (InFile);
- VerboseMsg ("the size of the input file is %u bytes", (unsigned) FileSize);
-
- //
- // Open output file
- //
- OutFile = fopen (OutputFileName, "wb");
- if (OutFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", OutputFileName);
- goto Finish;
- }
-
- //
- // Calculate Crc32 value
- //
- if (FileAction == CRC32_ENCODE) {
- Status = CalculateCrc32 (FileBuffer, FileSize, &Crc32Value);
- if (Status != EFI_SUCCESS) {
- Error (NULL, 0, 3000, "Invalid", "Calculate CRC32 value failed!");
- goto Finish;
- }
- //
- // Done, write output file.
- //
- fwrite (&Crc32Value, 1, sizeof (Crc32Value), OutFile);
- VerboseMsg ("The calculated CRC32 value is 0x%08x", (unsigned) Crc32Value);
- fwrite (FileBuffer, 1, FileSize, OutFile);
- VerboseMsg ("the size of the encoded file is %u bytes", (unsigned) FileSize + sizeof (UINT32));
- } else {
- //
- // Verify Crc32 Value
- //
- Status = CalculateCrc32 (FileBuffer + sizeof (UINT32), FileSize - sizeof (UINT32), &Crc32Value);
- if (Status != EFI_SUCCESS) {
- Error (NULL, 0, 3000, "Invalid", "Calculate CRC32 value failed!");
- goto Finish;
- }
- VerboseMsg ("The calculated CRC32 value is 0x%08x and File Crc32 value is 0x%08x", (unsigned) Crc32Value, (unsigned) (*(UINT32 *)FileBuffer));
- if (Crc32Value != *(UINT32 *)FileBuffer) {
- Error (NULL, 0, 3000, "Invalid", "CRC32 value of input file is not correct!");
- Status = STATUS_ERROR;
- goto Finish;
- }
- //
- // Done, write output file.
- //
- fwrite (FileBuffer + sizeof (UINT32), 1, FileSize - sizeof (UINT32), OutFile);
- VerboseMsg ("the size of the decoded file is %u bytes", (unsigned) FileSize - sizeof (UINT32));
- }
-
-Finish:
- if (FileBuffer != NULL) {
- free (FileBuffer);
- }
-
- if (OutFile != NULL) {
- fclose (OutFile);
- }
-
- VerboseMsg ("%s tool done with return code is 0x%x.", UTILITY_NAME, GetUtilityStatus ());
-
- return GetUtilityStatus ();
-}
-
-
-
-
diff --git a/BaseTools/Source/C/GenCrc32/Makefile b/BaseTools/Source/C/GenCrc32/Makefile
deleted file mode 100644
index e0049a4abd..0000000000
--- a/BaseTools/Source/C/GenCrc32/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'GenCrc32' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = GenCrc32
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = GenCrc32.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/GenFfs/GNUmakefile b/BaseTools/Source/C/GenFfs/GNUmakefile
deleted file mode 100644
index 04f5bb83f9..0000000000
--- a/BaseTools/Source/C/GenFfs/GNUmakefile
+++ /dev/null
@@ -1,23 +0,0 @@
-## @file
-# GNU/Linux makefile for 'GenFfs' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = GenFfs
-
-OBJECTS = GenFfs.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
-
-LIBS = -lCommon
-
diff --git a/BaseTools/Source/C/GenFfs/GenFfs.c b/BaseTools/Source/C/GenFfs/GenFfs.c
deleted file mode 100644
index 24081ebfc4..0000000000
--- a/BaseTools/Source/C/GenFfs/GenFfs.c
+++ /dev/null
@@ -1,909 +0,0 @@
-/**
-
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- GenFfs.c
-
-Abstract:
-
- This file contains functions required to generate a Firmware File System
- file.
-
-**/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <Common/UefiBaseTypes.h>
-#include <Common/PiFirmwareFile.h>
-#include <IndustryStandard/PeImage.h>
-
-#include "CommonLib.h"
-#include "ParseInf.h"
-#include "EfiUtilityMsgs.h"
-
-#define UTILITY_NAME "GenFfs"
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-STATIC CHAR8 *mFfsFileType[] = {
- NULL, // 0x00
- "EFI_FV_FILETYPE_RAW", // 0x01
- "EFI_FV_FILETYPE_FREEFORM", // 0x02
- "EFI_FV_FILETYPE_SECURITY_CORE", // 0x03
- "EFI_FV_FILETYPE_PEI_CORE", // 0x04
- "EFI_FV_FILETYPE_DXE_CORE", // 0x05
- "EFI_FV_FILETYPE_PEIM", // 0x06
- "EFI_FV_FILETYPE_DRIVER", // 0x07
- "EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER", // 0x08
- "EFI_FV_FILETYPE_APPLICATION", // 0x09
- "EFI_FV_FILETYPE_SMM", // 0x0A
- "EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE",// 0x0B
- "EFI_FV_FILETYPE_COMBINED_SMM_DXE", // 0x0C
- "EFI_FV_FILETYPE_SMM_CORE" // 0x0D
- };
-
-STATIC CHAR8 *mAlignName[] = {
- "1", "2", "4", "8", "16", "32", "64", "128", "256", "512",
- "1K", "2K", "4K", "8K", "16K", "32K", "64K"
- };
-
-STATIC CHAR8 *mFfsValidAlignName[] = {
- "8", "16", "128", "512", "1K", "4K", "32K", "64K"
- };
-
-STATIC UINT32 mFfsValidAlign[] = {0, 8, 16, 128, 512, 1024, 4096, 32768, 65536};
-
-STATIC EFI_GUID mZeroGuid = {0};
-
-STATIC
-VOID
-Version (
- VOID
- )
-/*++
-
-Routine Description:
-
- Print out version information for this utility.
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-STATIC
-VOID
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- Print Error / Help message.
-
-Arguments:
-
- VOID
-
-Returns:
-
- None
-
---*/
-{
- //
- // Summary usage
- //
- fprintf (stdout, "\nUsage: %s [options]\n\n", UTILITY_NAME);
-
- //
- // Copyright declaration
- //
- fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
-
- //
- // Details Option
- //
- fprintf (stdout, "Options:\n");
- fprintf (stdout, " -o FileName, --outputfile FileName\n\
- File is FFS file to be created.\n");
- fprintf (stdout, " -t Type, --filetype Type\n\
- Type is one FV file type defined in PI spec, which is\n\
- EFI_FV_FILETYPE_RAW, EFI_FV_FILETYPE_FREEFORM,\n\
- EFI_FV_FILETYPE_SECURITY_CORE, EFI_FV_FILETYPE_PEIM,\n\
- EFI_FV_FILETYPE_PEI_CORE, EFI_FV_FILETYPE_DXE_CORE,\n\
- EFI_FV_FILETYPE_DRIVER, EFI_FV_FILETYPE_APPLICATION,\n\
- EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER,\n\
- EFI_FV_FILETYPE_SMM, EFI_FV_FILETYPE_SMM_CORE,\n\
- EFI_FV_FILETYPE_COMBINED_SMM_DXE, \n\
- EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE.\n");
- fprintf (stdout, " -g FileGuid, --fileguid FileGuid\n\
- FileGuid is one module guid.\n\
- Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n");
- fprintf (stdout, " -x, --fixed Indicates that the file may not be moved\n\
- from its present location.\n");
- fprintf (stdout, " -s, --checksum Indicates to calculate file checksum.\n");
- fprintf (stdout, " -a FileAlign, --align FileAlign\n\
- FileAlign points to file alignment, which only support\n\
- the following align: 1,2,4,8,16,128,512,1K,4K,32K,64K\n");
- fprintf (stdout, " -i SectionFile, --sectionfile SectionFile\n\
- Section file will be contained in this FFS file.\n");
- fprintf (stdout, " -n SectionAlign, --sectionalign SectionAlign\n\
- SectionAlign points to section alignment, which support\n\
- the alignment scope 1~64K. It is specified together\n\
- with sectionfile to point its alignment in FFS file.\n");
- fprintf (stdout, " -v, --verbose Turn on verbose output with informational messages.\n");
- fprintf (stdout, " -q, --quiet Disable all messages except key message and fatal error\n");
- fprintf (stdout, " -d, --debug level Enable debug messages, at input debug level.\n");
- fprintf (stdout, " --version Show program's version number and exit.\n");
- fprintf (stdout, " -h, --help Show this help message and exit.\n");
-}
-
-STATIC
-EFI_STATUS
-StringtoAlignment (
- IN CHAR8 *AlignBuffer,
- OUT UINT32 *AlignNumber
- )
-/*++
-
-Routine Description:
-
- Converts Align String to align value (1~64K).
-
-Arguments:
-
- AlignBuffer - Pointer to Align string.
- AlignNumber - Pointer to Align value.
-
-Returns:
-
- EFI_SUCCESS Successfully convert align string to align value.
- EFI_INVALID_PARAMETER Align string is invalid or align value is not in scope.
-
---*/
-{
- UINT32 Index = 0;
- //
- // Check AlignBuffer
- //
- if (AlignBuffer == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- for (Index = 0; Index < sizeof (mAlignName) / sizeof (CHAR8 *); Index ++) {
- if (stricmp (AlignBuffer, mAlignName [Index]) == 0) {
- *AlignNumber = 1 << Index;
- return EFI_SUCCESS;
- }
- }
- return EFI_INVALID_PARAMETER;
-}
-
-STATIC
-UINT8
-StringToType (
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
-
- Converts File Type String to value. EFI_FV_FILETYPE_ALL indicates that an
- unrecognized file type was specified.
-
-Arguments:
-
- String - File type string
-
-Returns:
-
- File Type Value
-
---*/
-{
- UINT8 Index = 0;
-
- if (String == NULL) {
- return EFI_FV_FILETYPE_ALL;
- }
-
- for (Index = 0; Index < sizeof (mFfsFileType) / sizeof (CHAR8 *); Index ++) {
- if (mFfsFileType [Index] != NULL && (stricmp (String, mFfsFileType [Index]) == 0)) {
- return Index;
- }
- }
- return EFI_FV_FILETYPE_ALL;
-}
-
-STATIC
-EFI_STATUS
-GetSectionContents (
- IN CHAR8 **InputFileName,
- IN UINT32 *InputFileAlign,
- IN UINT32 InputFileNum,
- OUT UINT8 *FileBuffer,
- OUT UINT32 *BufferLength,
- OUT UINT32 *MaxAlignment,
- OUT UINT8 *PESectionNum
- )
-/*++
-
-Routine Description:
-
- Get the contents of all section files specified in InputFileName
- into FileBuffer.
-
-Arguments:
-
- InputFileName - Name of the input file.
-
- InputFileAlign - Alignment required by the input file data.
-
- InputFileNum - Number of input files. Should be at least 1.
-
- FileBuffer - Output buffer to contain data
-
- BufferLength - On input, this is size of the FileBuffer.
- On output, this is the actual length of the data.
-
- MaxAlignment - The max alignment required by all the input file datas.
-
- PeSectionNum - Calculate the number of Pe/Te Section in this FFS file.
-
-Returns:
-
- EFI_SUCCESS on successful return
- EFI_INVALID_PARAMETER if InputFileNum is less than 1 or BufferLength point is NULL.
- EFI_ABORTED if unable to open input file.
- EFI_BUFFER_TOO_SMALL FileBuffer is not enough to contain all file data.
---*/
-{
- UINT32 Size;
- UINT32 Offset;
- UINT32 FileSize;
- UINT32 Index;
- FILE *InFile;
- EFI_COMMON_SECTION_HEADER *SectHeader;
- EFI_COMMON_SECTION_HEADER TempSectHeader;
- EFI_TE_IMAGE_HEADER TeHeader;
- UINT32 TeOffset;
- EFI_GUID_DEFINED_SECTION GuidSectHeader;
- UINT32 HeaderSize;
-
- Size = 0;
- Offset = 0;
- TeOffset = 0;
-
- //
- // Go through our array of file names and copy their contents
- // to the output buffer.
- //
- for (Index = 0; Index < InputFileNum; Index++) {
- //
- // make sure section ends on a DWORD boundary
- //
- while ((Size & 0x03) != 0) {
- Size++;
- }
-
- //
- // Get the Max alignment of all input file datas
- //
- if (*MaxAlignment < InputFileAlign [Index]) {
- *MaxAlignment = InputFileAlign [Index];
- }
-
- //
- // Open file and read contents
- //
- InFile = fopen (InputFileName[Index], "rb");
- if (InFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", InputFileName[Index]);
- return EFI_ABORTED;
- }
-
- fseek (InFile, 0, SEEK_END);
- FileSize = ftell (InFile);
- fseek (InFile, 0, SEEK_SET);
- DebugMsg (NULL, 0, 9, "Input section files",
- "the input section name is %s and the size is %u bytes", InputFileName[Index], (unsigned) FileSize);
-
- //
- // Check this section is Te/Pe section, and Calculate the numbers of Te/Pe section.
- //
- TeOffset = 0;
- HeaderSize = sizeof (EFI_COMMON_SECTION_HEADER);
- fread (&TempSectHeader, 1, sizeof (TempSectHeader), InFile);
- if (TempSectHeader.Type == EFI_SECTION_TE) {
- (*PESectionNum) ++;
- fread (&TeHeader, 1, sizeof (TeHeader), InFile);
- if (TeHeader.Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- TeOffset = TeHeader.StrippedSize - sizeof (TeHeader);
- }
- } else if (TempSectHeader.Type == EFI_SECTION_PE32) {
- (*PESectionNum) ++;
- } else if (TempSectHeader.Type == EFI_SECTION_GUID_DEFINED) {
- fseek (InFile, 0, SEEK_SET);
- fread (&GuidSectHeader, 1, sizeof (GuidSectHeader), InFile);
- if ((GuidSectHeader.Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) == 0) {
- HeaderSize = GuidSectHeader.DataOffset;
- }
- (*PESectionNum) ++;
- } else if (TempSectHeader.Type == EFI_SECTION_COMPRESSION ||
- TempSectHeader.Type == EFI_SECTION_FIRMWARE_VOLUME_IMAGE) {
- //
- // for the encapsulated section, assume it contains Pe/Te section
- //
- (*PESectionNum) ++;
- }
-
- fseek (InFile, 0, SEEK_SET);
-
- //
- // Revert TeOffset to the converse value relative to Alignment
- // This is to assure the original PeImage Header at Alignment.
- //
- if ((TeOffset != 0) && (InputFileAlign [Index] != 0)) {
- TeOffset = InputFileAlign [Index] - (TeOffset % InputFileAlign [Index]);
- TeOffset = TeOffset % InputFileAlign [Index];
- }
-
- //
- // make sure section data meet its alignment requirement by adding one raw pad section.
- // But the different sections have the different section header. Necessary or not?
- // Based on section type to adjust offset? Todo
- //
- if ((InputFileAlign [Index] != 0) && (((Size + HeaderSize + TeOffset) % InputFileAlign [Index]) != 0)) {
- Offset = (Size + sizeof (EFI_COMMON_SECTION_HEADER) + HeaderSize + TeOffset + InputFileAlign [Index] - 1) & ~(InputFileAlign [Index] - 1);
- Offset = Offset - Size - HeaderSize - TeOffset;
-
- if (FileBuffer != NULL && ((Size + Offset) < *BufferLength)) {
- memset (FileBuffer + Size, 0, Offset);
- SectHeader = (EFI_COMMON_SECTION_HEADER *) (FileBuffer + Size);
- SectHeader->Type = EFI_SECTION_RAW;
- SectHeader->Size[0] = (UINT8) (Offset & 0xff);
- SectHeader->Size[1] = (UINT8) ((Offset & 0xff00) >> 8);
- SectHeader->Size[2] = (UINT8) ((Offset & 0xff0000) >> 16);
- }
- DebugMsg (NULL, 0, 9, "Pad raw section for section data alignment",
- "Pad Raw section size is %u", (unsigned) Offset);
-
- Size = Size + Offset;
- }
-
- //
- // Now read the contents of the file into the buffer
- // Buffer must be enough to contain the file content.
- //
- if ((FileSize > 0) && (FileBuffer != NULL) && ((Size + FileSize) <= *BufferLength)) {
- if (fread (FileBuffer + Size, (size_t) FileSize, 1, InFile) != 1) {
- Error (NULL, 0, 0004, "Error reading file", InputFileName[Index]);
- fclose (InFile);
- return EFI_ABORTED;
- }
- }
-
- fclose (InFile);
- Size += FileSize;
- }
-
- //
- // Set the actual length of the data.
- //
- if (Size > *BufferLength) {
- *BufferLength = Size;
- return EFI_BUFFER_TOO_SMALL;
- } else {
- *BufferLength = Size;
- return EFI_SUCCESS;
- }
-}
-
-int
-main (
- int argc,
- CHAR8 *argv[]
- )
-/*++
-
-Routine Description:
-
- Main function.
-
-Arguments:
-
- argc - Number of command line parameters.
- argv - Array of pointers to parameter strings.
-
-Returns:
- STATUS_SUCCESS - Utility exits successfully.
- STATUS_ERROR - Some error occurred during execution.
-
---*/
-{
- EFI_STATUS Status;
- EFI_FFS_FILE_ATTRIBUTES FfsAttrib;
- UINT32 FfsAlign;
- EFI_FV_FILETYPE FfsFiletype;
- CHAR8 *OutputFileName;
- EFI_GUID FileGuid = {0};
- UINT32 InputFileNum;
- UINT32 *InputFileAlign;
- CHAR8 **InputFileName;
- UINT8 *FileBuffer;
- UINT32 FileSize;
- UINT32 MaxAlignment;
- EFI_FFS_FILE_HEADER FfsFileHeader;
- FILE *FfsFile;
- UINT32 Index;
- UINT64 LogLevel;
- UINT8 PeSectionNum;
-
- //
- // Init local variables
- //
- LogLevel = 0;
- Index = 0;
- FfsAttrib = 0;
- FfsAlign = 0;
- FfsFiletype = EFI_FV_FILETYPE_ALL;
- OutputFileName = NULL;
- InputFileNum = 0;
- InputFileName = NULL;
- InputFileAlign = NULL;
- FileBuffer = NULL;
- FileSize = 0;
- MaxAlignment = 1;
- FfsFile = NULL;
- Status = EFI_SUCCESS;
- PeSectionNum = 0;
-
- SetUtilityName (UTILITY_NAME);
-
- if (argc == 1) {
- Error (NULL, 0, 1001, "Missing options", "no options input");
- Usage ();
- return STATUS_ERROR;
- }
-
- //
- // Parse command line
- //
- argc --;
- argv ++;
-
- if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
- Version ();
- Usage ();
- return STATUS_SUCCESS;
- }
-
- if (stricmp (argv[0], "--version") == 0) {
- Version ();
- return STATUS_SUCCESS;
- }
-
- while (argc > 0) {
- if ((stricmp (argv[0], "-t") == 0) || (stricmp (argv[0], "--filetype") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "file type is missing for -t option");
- goto Finish;
- }
- FfsFiletype = StringToType (argv[1]);
- if (FfsFiletype == EFI_FV_FILETYPE_ALL) {
- Error (NULL, 0, 1003, "Invalid option value", "%s is not a valid file type", argv[1]);
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--outputfile") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Output file is missing for -o option");
- goto Finish;
- }
- OutputFileName = argv[1];
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-g") == 0) || (stricmp (argv[0], "--fileguid") == 0)) {
- Status = StringToGuid (argv[1], &FileGuid);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-x") == 0) || (stricmp (argv[0], "--fixed") == 0)) {
- FfsAttrib |= FFS_ATTRIB_FIXED;
- argc -= 1;
- argv += 1;
- continue;
- }
-
- if ((stricmp (argv[0], "-s") == 0) || (stricmp (argv[0], "--checksum") == 0)) {
- FfsAttrib |= FFS_ATTRIB_CHECKSUM;
- argc -= 1;
- argv += 1;
- continue;
- }
-
- if ((stricmp (argv[0], "-a") == 0) || (stricmp (argv[0], "--align") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Align value is missing for -a option");
- goto Finish;
- }
- for (Index = 0; Index < sizeof (mFfsValidAlignName) / sizeof (CHAR8 *); Index ++) {
- if (stricmp (argv[1], mFfsValidAlignName[Index]) == 0) {
- break;
- }
- }
- if (Index == sizeof (mFfsValidAlignName) / sizeof (CHAR8 *)) {
- if ((stricmp (argv[1], "1") == 0) || (stricmp (argv[1], "2") == 0) || (stricmp (argv[1], "4") == 0)) {
- //
- // 1, 2, 4 byte alignment same to 8 byte alignment
- //
- Index = 0;
- } else {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- }
- FfsAlign = Index;
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-i") == 0) || (stricmp (argv[0], "--sectionfile") == 0)) {
- //
- // Get Input file name and its alignment
- //
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "input section file is missing for -i option");
- goto Finish;
- }
-
- //
- // Allocate Input file name buffer and its alignment buffer.
- //
- if ((InputFileNum == 0) && (InputFileName == NULL)) {
- InputFileName = (CHAR8 **) malloc (MAXIMUM_INPUT_FILE_NUM * sizeof (CHAR8 *));
- if (InputFileName == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- return STATUS_ERROR;
- }
- memset (InputFileName, 0, (MAXIMUM_INPUT_FILE_NUM * sizeof (CHAR8 *)));
-
- InputFileAlign = (UINT32 *) malloc (MAXIMUM_INPUT_FILE_NUM * sizeof (UINT32));
- if (InputFileAlign == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- free (InputFileName);
- return STATUS_ERROR;
- }
- memset (InputFileAlign, 0, MAXIMUM_INPUT_FILE_NUM * sizeof (UINT32));
- } else if (InputFileNum % MAXIMUM_INPUT_FILE_NUM == 0) {
- //
- // InputFileName and alignment buffer too small, need to realloc
- //
- InputFileName = (CHAR8 **) realloc (
- InputFileName,
- (InputFileNum + MAXIMUM_INPUT_FILE_NUM) * sizeof (CHAR8 *)
- );
-
- if (InputFileName == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- free (InputFileAlign);
- return STATUS_ERROR;
- }
- memset (&(InputFileName[InputFileNum]), 0, (MAXIMUM_INPUT_FILE_NUM * sizeof (CHAR8 *)));
-
- InputFileAlign = (UINT32 *) realloc (
- InputFileAlign,
- (InputFileNum + MAXIMUM_INPUT_FILE_NUM) * sizeof (UINT32)
- );
-
- if (InputFileAlign == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- free (InputFileName);
- return STATUS_ERROR;
- }
- memset (&(InputFileAlign[InputFileNum]), 0, (MAXIMUM_INPUT_FILE_NUM * sizeof (UINT32)));
- }
-
- InputFileName[InputFileNum] = argv[1];
- argc -= 2;
- argv += 2;
-
- if (argc <= 0) {
- InputFileNum ++;
- break;
- }
-
- //
- // Section File alignment requirement
- //
- if ((stricmp (argv[0], "-n") == 0) || (stricmp (argv[0], "--sectionalign") == 0)) {
- Status = StringtoAlignment (argv[1], &(InputFileAlign[InputFileNum]));
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- }
- InputFileNum ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-n") == 0) || (stricmp (argv[0], "--sectionalign") == 0)) {
- Error (NULL, 0, 1000, "Unknown option", "SectionAlign option must be specified with section file.");
- goto Finish;
- }
-
- if ((stricmp (argv[0], "-v") == 0) || (stricmp (argv[0], "--verbose") == 0)) {
- SetPrintLevel (VERBOSE_LOG_LEVEL);
- VerboseMsg ("Verbose output Mode Set!");
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- SetPrintLevel (KEY_LOG_LEVEL);
- KeyMsg ("Quiet output Mode Set!");
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--debug") == 0)) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &LogLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- if (LogLevel > 9) {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, current input level is %d", (int) LogLevel);
- goto Finish;
- }
- SetPrintLevel (LogLevel);
- DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", argv[1]);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- Error (NULL, 0, 1000, "Unknown option", argv[0]);
- goto Finish;
- }
-
- VerboseMsg ("%s tool start.", UTILITY_NAME);
-
- //
- // Check the complete input paramters.
- //
- if (FfsFiletype == EFI_FV_FILETYPE_ALL) {
- Error (NULL, 0, 1001, "Missing option", "filetype");
- goto Finish;
- }
-
- if (CompareGuid (&FileGuid, &mZeroGuid) == 0) {
- Error (NULL, 0, 1001, "Missing option", "fileguid");
- goto Finish;
- }
-
- if (InputFileNum == 0) {
- Error (NULL, 0, 1001, "Missing option", "Input files");
- goto Finish;
- }
-
- //
- // Output input parameter information
- //
- VerboseMsg ("Fv File type is %s", mFfsFileType [FfsFiletype]);
- VerboseMsg ("Output file name is %s", OutputFileName);
- VerboseMsg ("FFS File Guid is %08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
- (unsigned) FileGuid.Data1,
- FileGuid.Data2,
- FileGuid.Data3,
- FileGuid.Data4[0],
- FileGuid.Data4[1],
- FileGuid.Data4[2],
- FileGuid.Data4[3],
- FileGuid.Data4[4],
- FileGuid.Data4[5],
- FileGuid.Data4[6],
- FileGuid.Data4[7]);
- if ((FfsAttrib & FFS_ATTRIB_FIXED) != 0) {
- VerboseMsg ("FFS File has the fixed file attribute");
- }
- if ((FfsAttrib & FFS_ATTRIB_CHECKSUM) != 0) {
- VerboseMsg ("FFS File requires the checksum of the whole file");
- }
- VerboseMsg ("FFS file alignment is %s", mFfsValidAlignName[FfsAlign]);
- for (Index = 0; Index < InputFileNum; Index ++) {
- if (InputFileAlign[Index] == 0) {
- //
- // Minimum alignment is 1 byte.
- //
- InputFileAlign[Index] = 1;
- }
- VerboseMsg ("the %dth input section name is %s and section alignment is %u", Index, InputFileName[Index], (unsigned) InputFileAlign[Index]);
- }
-
- //
- // Calculate the size of all input section files.
- //
- Status = GetSectionContents (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- FileBuffer,
- &FileSize,
- &MaxAlignment,
- &PeSectionNum
- );
-
- if ((FfsFiletype == EFI_FV_FILETYPE_SECURITY_CORE ||
- FfsFiletype == EFI_FV_FILETYPE_PEI_CORE ||
- FfsFiletype == EFI_FV_FILETYPE_DXE_CORE) && (PeSectionNum != 1)) {
- Error (NULL, 0, 2000, "Invalid parameter", "Fv File type %s must have one and only one Pe or Te section, but %u Pe/Te section are input", mFfsFileType [FfsFiletype], PeSectionNum);
- goto Finish;
- }
-
- if ((FfsFiletype == EFI_FV_FILETYPE_PEIM ||
- FfsFiletype == EFI_FV_FILETYPE_DRIVER ||
- FfsFiletype == EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER ||
- FfsFiletype == EFI_FV_FILETYPE_APPLICATION) && (PeSectionNum < 1)) {
- Error (NULL, 0, 2000, "Invalid parameter", "Fv File type %s must have at least one Pe or Te section, but no Pe/Te section is input", mFfsFileType [FfsFiletype]);
- goto Finish;
- }
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- FileBuffer = (UINT8 *) malloc (FileSize);
- if (FileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- goto Finish;
- }
- memset (FileBuffer, 0, FileSize);
-
- //
- // read all input file contents into a buffer
- //
- Status = GetSectionContents (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- FileBuffer,
- &FileSize,
- &MaxAlignment,
- &PeSectionNum
- );
- }
-
- if (EFI_ERROR (Status)) {
- goto Finish;
- }
-
- //
- // Create Ffs file header.
- //
- memset (&FfsFileHeader, 0, sizeof (EFI_FFS_FILE_HEADER));
- memcpy (&FfsFileHeader.Name, &FileGuid, sizeof (EFI_GUID));
- FfsFileHeader.Type = FfsFiletype;
- //
- // Update FFS Alignment based on the max alignment required by input section files
- //
- VerboseMsg ("the max alignment of all input sections is %u", (unsigned) MaxAlignment);
- for (Index = 0; Index < sizeof (mFfsValidAlign) / sizeof (UINT32) - 1; Index ++) {
- if ((MaxAlignment > mFfsValidAlign [Index]) && (MaxAlignment <= mFfsValidAlign [Index + 1])) {
- break;
- }
- }
- if (FfsAlign < Index) {
- FfsAlign = Index;
- }
- VerboseMsg ("the alignment of the generated FFS file is %u", (unsigned) mFfsValidAlign [FfsAlign + 1]);
- FfsFileHeader.Attributes = (EFI_FFS_FILE_ATTRIBUTES) (FfsAttrib | (FfsAlign << 3));
-
- //
- // Now FileSize includes the EFI_FFS_FILE_HEADER
- //
- FileSize += sizeof (EFI_FFS_FILE_HEADER);
- VerboseMsg ("the size of the generated FFS file is %u bytes", (unsigned) FileSize);
- FfsFileHeader.Size[0] = (UINT8) (FileSize & 0xFF);
- FfsFileHeader.Size[1] = (UINT8) ((FileSize & 0xFF00) >> 8);
- FfsFileHeader.Size[2] = (UINT8) ((FileSize & 0xFF0000) >> 16);
- //
- // Fill in checksums and state, these must be zero for checksumming
- //
- // FileHeader.IntegrityCheck.Checksum.Header = 0;
- // FileHeader.IntegrityCheck.Checksum.File = 0;
- // FileHeader.State = 0;
- //
- FfsFileHeader.IntegrityCheck.Checksum.Header = CalculateChecksum8 (
- (UINT8 *) &FfsFileHeader,
- sizeof (EFI_FFS_FILE_HEADER)
- );
-
- if (FfsFileHeader.Attributes & FFS_ATTRIB_CHECKSUM) {
- //
- // Ffs header checksum = zero, so only need to calculate ffs body.
- //
- FfsFileHeader.IntegrityCheck.Checksum.File = CalculateChecksum8 (
- FileBuffer,
- FileSize - sizeof (EFI_FFS_FILE_HEADER)
- );
- } else {
- FfsFileHeader.IntegrityCheck.Checksum.File = FFS_FIXED_CHECKSUM;
- }
-
- FfsFileHeader.State = EFI_FILE_HEADER_CONSTRUCTION | EFI_FILE_HEADER_VALID | EFI_FILE_DATA_VALID;
-
- //
- // Open output file to write ffs data.
- //
- remove(OutputFileName);
- FfsFile = fopen (OutputFileName, "wb");
- if (FfsFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", OutputFileName);
- goto Finish;
- }
- //
- // write header
- //
- fwrite (&FfsFileHeader, 1, sizeof (FfsFileHeader), FfsFile);
- //
- // write data
- //
- fwrite (FileBuffer, 1, FileSize - sizeof (EFI_FFS_FILE_HEADER), FfsFile);
-
- fclose (FfsFile);
-
-Finish:
- if (InputFileName != NULL) {
- free (InputFileName);
- }
- if (InputFileAlign != NULL) {
- free (InputFileAlign);
- }
- if (FileBuffer != NULL) {
- free (FileBuffer);
- }
- //
- // If any errors were reported via the standard error reporting
- // routines, then the status has been saved. Get the value and
- // return it to the caller.
- //
- VerboseMsg ("%s tool done with return code is 0x%x.", UTILITY_NAME, GetUtilityStatus ());
-
- return GetUtilityStatus ();
-}
diff --git a/BaseTools/Source/C/GenFfs/Makefile b/BaseTools/Source/C/GenFfs/Makefile
deleted file mode 100644
index d063278c19..0000000000
--- a/BaseTools/Source/C/GenFfs/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'GenFfs' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = GenFfs
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = GenFfs.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/GenFv/GNUmakefile b/BaseTools/Source/C/GenFv/GNUmakefile
deleted file mode 100644
index 58ad16ce61..0000000000
--- a/BaseTools/Source/C/GenFv/GNUmakefile
+++ /dev/null
@@ -1,30 +0,0 @@
-## @file
-# GNU/Linux makefile for 'GenFv' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = GenFv
-
-OBJECTS = GenFv.o GenFvInternalLib.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
-
-LIBS = -lCommon
-ifeq ($(CYGWIN), CYGWIN)
- LIBS += -L/lib/e2fsprogs -luuid
-endif
-
-ifeq ($(LINUX), Linux)
- LIBS += -luuid
-endif
-
diff --git a/BaseTools/Source/C/GenFv/GenFv.c b/BaseTools/Source/C/GenFv/GenFv.c
deleted file mode 100644
index fa86d009da..0000000000
--- a/BaseTools/Source/C/GenFv/GenFv.c
+++ /dev/null
@@ -1,683 +0,0 @@
-/** @file
-
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- GenFv.c
-
-Abstract:
-
- This contains all code necessary to build the GenFvImage.exe utility.
- This utility relies heavily on the GenFvImage Lib. Definitions for both
- can be found in the Tiano Firmware Volume Generation Utility
- Specification, review draft.
-
-**/
-
-//
-// File included in build
-//
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include "GenFvInternalLib.h"
-
-//
-// Utility Name
-//
-#define UTILITY_NAME "GenFv"
-
-//
-// Utility version information
-//
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-EFI_GUID mEfiFirmwareFileSystem2Guid = EFI_FIRMWARE_FILE_SYSTEM2_GUID;
-
-STATIC
-VOID
-Version (
- VOID
-)
-/*++
-
-Routine Description:
-
- Displays the standard utility information to SDTOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-STATIC
-VOID
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- Displays the utility usage syntax to STDOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- //
- // Summary usage
- //
- fprintf (stdout, "\nUsage: %s [options]\n\n", UTILITY_NAME);
-
- //
- // Copyright declaration
- //
- fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
-
- //
- // Details Option
- //
- fprintf (stdout, "Options:\n");
- fprintf (stdout, " -o FileName, --outputfile FileName\n\
- File is the FvImage or CapImage to be created.\n");
- fprintf (stdout, " -i FileName, --inputfile FileName\n\
- File is the input FV.inf or Cap.inf to specify\n\
- how to construct FvImage or CapImage.\n");
- fprintf (stdout, " -b BlockSize, --blocksize BlockSize\n\
- BlockSize is one HEX or DEC format value\n\
- BlockSize is required by Fv Image.\n");
- fprintf (stdout, " -n NumberBlock, --numberblock NumberBlock\n\
- NumberBlock is one HEX or DEC format value\n\
- NumberBlock is one optional parameter.\n");
- fprintf (stdout, " -f FfsFile, --ffsfile FfsFile\n\
- FfsFile is placed into Fv Image\n\
- multi files can input one by one\n");
- fprintf (stdout, " -s FileTakenSize, --filetakensize FileTakenSize\n\
- FileTakenSize specifies the size of the required\n\
- space that the input file is placed in Fvimage.\n\
- It is specified together with the input file.\n");
- fprintf (stdout, " -r Address, --baseaddr Address\n\
- Address is the rebase start address for drivers that\n\
- run in Flash. It supports DEC or HEX digital format.\n\
- If it is set to zero, no rebase action will be taken\n");
- fprintf (stdout, " -F ForceRebase, --force-rebase ForceRebase\n\
- If value is TRUE, will always take rebase action\n\
- If value is FALSE, will always not take reabse action\n\
- If not specified, will take rebase action if rebase address greater than zero, \n\
- will not take rebase action if rebase address is zero.\n");
- fprintf (stdout, " -a AddressFile, --addrfile AddressFile\n\
- AddressFile is one file used to record the child\n\
- FV base address when current FV base address is set.\n");
- fprintf (stdout, " -m logfile, --map logfile\n\
- Logfile is the output fv map file name. if it is not\n\
- given, the FvName.map will be the default map file name\n");
- fprintf (stdout, " -g Guid, --guid Guid\n\
- GuidValue is one specific capsule guid value\n\
- or fv file system guid value.\n\
- Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n");
- fprintf (stdout, " --FvNameGuid Guid Guid is used to specify Fv Name.\n\
- Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n");
- fprintf (stdout, " --capflag CapFlag Capsule Reset Flag can be PersistAcrossReset,\n\
- or PopulateSystemTable or InitiateReset or not set\n");
- fprintf (stdout, " --capheadsize HeadSize\n\
- HeadSize is one HEX or DEC format value\n\
- HeadSize is required by Capsule Image.\n");
- fprintf (stdout, " -c, --capsule Create Capsule Image.\n");
- fprintf (stdout, " -p, --dump Dump Capsule Image header.\n");
- fprintf (stdout, " -v, --verbose Turn on verbose output with informational messages.\n");
- fprintf (stdout, " -q, --quiet Disable all messages except key message and fatal error\n");
- fprintf (stdout, " -d, --debug level Enable debug messages, at input debug level.\n");
- fprintf (stdout, " --version Show program's version number and exit.\n");
- fprintf (stdout, " -h, --help Show this help message and exit.\n");
-}
-
-UINT32 mFvTotalSize;
-UINT32 mFvTakenSize;
-
-int
-main (
- IN int argc,
- IN char **argv
- )
-/*++
-
-Routine Description:
-
- This utility uses GenFvImage.Lib to build a firmware volume image.
-
-Arguments:
-
- FvInfFileName The name of an FV image description file or Capsule Image.
-
- Arguments come in pair in any order.
- -I FvInfFileName
-
-Returns:
-
- EFI_SUCCESS No error conditions detected.
- EFI_INVALID_PARAMETER One or more of the input parameters is invalid.
- EFI_OUT_OF_RESOURCES A resource required by the utility was unavailable.
- Most commonly this will be memory allocation
- or file creation.
- EFI_LOAD_ERROR GenFvImage.lib could not be loaded.
- EFI_ABORTED Error executing the GenFvImage lib.
-
---*/
-{
- EFI_STATUS Status;
- CHAR8 *InfFileName;
- CHAR8 *AddrFileName;
- CHAR8 *MapFileName;
- CHAR8 *InfFileImage;
- UINT32 InfFileSize;
- CHAR8 *OutFileName;
- BOOLEAN CapsuleFlag;
- BOOLEAN DumpCapsule;
- FILE *FpFile;
- EFI_CAPSULE_HEADER *CapsuleHeader;
- UINT64 LogLevel, TempNumber;
- UINT32 Index;
-
- InfFileName = NULL;
- AddrFileName = NULL;
- InfFileImage = NULL;
- OutFileName = NULL;
- MapFileName = NULL;
- InfFileSize = 0;
- CapsuleFlag = FALSE;
- DumpCapsule = FALSE;
- FpFile = NULL;
- CapsuleHeader = NULL;
- LogLevel = 0;
- TempNumber = 0;
- Index = 0;
- mFvTotalSize = 0;
- mFvTakenSize = 0;
- Status = EFI_SUCCESS;
-
- SetUtilityName (UTILITY_NAME);
-
- if (argc == 1) {
- Error (NULL, 0, 1001, "Missing options", "No input options specified.");
- Usage ();
- return STATUS_ERROR;
- }
-
- //
- // Init global data to Zero
- //
- memset (&mFvDataInfo, 0, sizeof (FV_INFO));
- memset (&mCapDataInfo, 0, sizeof (CAP_INFO));
- //
- // Set the default FvGuid
- //
- memcpy (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid, sizeof (EFI_GUID));
- mFvDataInfo.ForceRebase = -1;
-
- //
- // Parse command line
- //
- argc --;
- argv ++;
-
- if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
- Version ();
- Usage ();
- return STATUS_SUCCESS;
- }
-
- if (stricmp (argv[0], "--version") == 0) {
- Version ();
- return STATUS_SUCCESS;
- }
-
- while (argc > 0) {
- if ((stricmp (argv[0], "-i") == 0) || (stricmp (argv[0], "--inputfile") == 0)) {
- InfFileName = argv[1];
- if (InfFileName == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Input file can't be null");
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-a") == 0) || (stricmp (argv[0], "--addrfile") == 0)) {
- AddrFileName = argv[1];
- if (AddrFileName == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Address file can't be null");
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--outputfile") == 0)) {
- OutFileName = argv[1];
- if (OutFileName == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Output file can't be null");
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-r") == 0) || (stricmp (argv[0], "--baseaddr") == 0)) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &TempNumber);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- return STATUS_ERROR;
- }
- mFvDataInfo.BaseAddress = TempNumber;
- mFvDataInfo.BaseAddressSet = TRUE;
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-b") == 0) || (stricmp (argv[0], "--blocksize") == 0)) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &TempNumber);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- return STATUS_ERROR;
- }
- if (TempNumber == 0) {
- Error (NULL, 0, 1003, "Invalid option value", "Fv block size can't be be set to zero");
- return STATUS_ERROR;
- }
- mFvDataInfo.FvBlocks[0].Length = (UINT32) TempNumber;
- DebugMsg (NULL, 0, 9, "FV Block Size", "%s = 0x%llx", EFI_BLOCK_SIZE_STRING, (unsigned long long) TempNumber);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-n") == 0) || (stricmp (argv[0], "--numberblock") == 0)) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &TempNumber);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- return STATUS_ERROR;
- }
- if (TempNumber == 0) {
- Error (NULL, 0, 1003, "Invalid option value", "Fv block number can't be set to zero");
- return STATUS_ERROR;
- }
- mFvDataInfo.FvBlocks[0].NumBlocks = (UINT32) TempNumber;
- DebugMsg (NULL, 0, 9, "FV Number Block", "%s = 0x%llx", EFI_NUM_BLOCKS_STRING, (unsigned long long) TempNumber);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((strcmp (argv[0], "-f") == 0) || (stricmp (argv[0], "--ffsfile") == 0)) {
- if (argv[1] == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Input Ffsfile can't be null");
- return STATUS_ERROR;
- }
- strcpy (mFvDataInfo.FvFiles[Index], argv[1]);
- DebugMsg (NULL, 0, 9, "FV component file", "the %uth name is %s", (unsigned) Index + 1, argv[1]);
- argc -= 2;
- argv += 2;
-
- if (argc > 0) {
- if ((stricmp (argv[0], "-s") == 0) || (stricmp (argv[0], "--filetakensize") == 0)) {
- if (argv[1] == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Ffsfile Size can't be null");
- return STATUS_ERROR;
- }
- Status = AsciiStringToUint64 (argv[1], FALSE, &TempNumber);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- return STATUS_ERROR;
- }
- mFvDataInfo.SizeofFvFiles[Index] = (UINT32) TempNumber;
- DebugMsg (NULL, 0, 9, "FV component file size", "the %uth size is %s", (unsigned) Index + 1, argv[1]);
- argc -= 2;
- argv += 2;
- }
- }
- Index ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-s") == 0) || (stricmp (argv[0], "--filetakensize") == 0)) {
- Error (NULL, 0, 1003, "Invalid option", "It must be specified together with -f option to specify the file size.");
- return STATUS_ERROR;
- }
-
- if ((stricmp (argv[0], "-c") == 0) || (stricmp (argv[0], "--capsule") == 0)) {
- CapsuleFlag = TRUE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((strcmp (argv[0], "-F") == 0) || (stricmp (argv[0], "--force-rebase") == 0)) {
- if (argv[1] == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Froce rebase flag can't be null");
- return STATUS_ERROR;
- }
-
- if (stricmp (argv[1], "TRUE") == 0) {
- mFvDataInfo.ForceRebase = 1;
- } else if (stricmp (argv[1], "FALSE") == 0) {
- mFvDataInfo.ForceRebase = 0;
- } else {
- Error (NULL, 0, 1003, "Invalid option value", "froce rebase flag value must be \"TRUE\" or \"FALSE\"");
- return STATUS_ERROR;
- }
-
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if (stricmp (argv[0], "--capheadsize") == 0) {
- //
- // Get Capsule Image Header Size
- //
- Status = AsciiStringToUint64 (argv[1], FALSE, &TempNumber);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- return STATUS_ERROR;
- }
- mCapDataInfo.HeaderSize = (UINT32) TempNumber;
- DebugMsg (NULL, 0, 9, "Capsule Header size", "%s = 0x%llx", EFI_CAPSULE_HEADER_SIZE_STRING, (unsigned long long) TempNumber);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if (stricmp (argv[0], "--capflag") == 0) {
- //
- // Get Capsule Header
- //
- if (argv[1] == NULL) {
- Error (NULL, 0, 1003, "Option value is not set", "%s = %s", argv[0], argv[1]);
- return STATUS_ERROR;
- }
- if (strcmp (argv[1], "PopulateSystemTable") == 0) {
- mCapDataInfo.Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE;
- } else if (strcmp (argv[1], "PersistAcrossReset") == 0) {
- mCapDataInfo.Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET;
- } else if (strcmp (argv[1], "InitiateReset") == 0) {
- mCapDataInfo.Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET;
- } else {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- return STATUS_ERROR;
- }
- DebugMsg (NULL, 0, 9, "Capsule Flag", argv[1]);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if (stricmp (argv[0], "--capguid") == 0) {
- //
- // Get the Capsule Guid
- //
- Status = StringToGuid (argv[1], &mCapDataInfo.CapGuid);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", EFI_CAPSULE_GUID_STRING, argv[1]);
- return STATUS_ERROR;
- }
- DebugMsg (NULL, 0, 9, "Capsule Guid", "%s = %s", EFI_CAPSULE_GUID_STRING, argv[1]);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-g") == 0) || (stricmp (argv[0], "--guid") == 0)) {
- //
- // Get the Capsule or Fv Guid
- //
- Status = StringToGuid (argv[1], &mCapDataInfo.CapGuid);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", EFI_GUID_STRING, argv[1]);
- return STATUS_ERROR;
- }
- memcpy (&mFvDataInfo.FvFileSystemGuid, &mCapDataInfo.CapGuid, sizeof (EFI_GUID));
- mFvDataInfo.FvFileSystemGuidSet = TRUE;
- DebugMsg (NULL, 0, 9, "Capsule Guid", "%s = %s", EFI_CAPSULE_GUID_STRING, argv[1]);
- DebugMsg (NULL, 0, 9, "FV Guid", "%s = %s", EFI_FV_FILESYSTEMGUID_STRING, argv[1]);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if (stricmp (argv[0], "--FvNameGuid") == 0) {
- //
- // Get Fv Name Guid
- //
- Status = StringToGuid (argv[1], &mFvDataInfo.FvNameGuid);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", EFI_GUID_STRING, argv[1]);
- return STATUS_ERROR;
- }
- mFvDataInfo.FvNameGuidSet = TRUE;
- DebugMsg (NULL, 0, 9, "FV Name Guid", "%s = %s", EFI_FV_NAMEGUID_STRING, argv[1]);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-p") == 0) || (stricmp (argv[0], "--dump") == 0)) {
- DumpCapsule = TRUE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-m") == 0) || (stricmp (argv[0], "--map") == 0)) {
- MapFileName = argv[1];
- if (MapFileName == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Map file can't be null");
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-v") == 0) || (stricmp (argv[0], "--verbose") == 0)) {
- SetPrintLevel (VERBOSE_LOG_LEVEL);
- VerboseMsg ("Verbose output Mode Set!");
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- SetPrintLevel (KEY_LOG_LEVEL);
- KeyMsg ("Quiet output Mode Set!");
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--debug") == 0)) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &LogLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- return STATUS_ERROR;
- }
- if (LogLevel > 9) {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, current input level is %d", (int) LogLevel);
- return STATUS_ERROR;
- }
- SetPrintLevel (LogLevel);
- DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", argv[1]);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- //
- // Don't recognize the parameter.
- //
- Error (NULL, 0, 1000, "Unknown option", "%s", argv[0]);
- return STATUS_ERROR;
- }
-
- VerboseMsg ("%s tool start.", UTILITY_NAME);
-
- //
- // check input parameter, InfFileName can be NULL
- //
- if (InfFileName == NULL && DumpCapsule) {
- Error (NULL, 0, 1001, "Missing option", "Input Capsule Image");
- return STATUS_ERROR;
- }
- VerboseMsg ("the input FvInf or CapInf file name is %s", InfFileName);
-
- if (!DumpCapsule && OutFileName == NULL) {
- Error (NULL, 0, 1001, "Missing option", "Output File");
- return STATUS_ERROR;
- }
- if (OutFileName != NULL) {
- VerboseMsg ("the output file name is %s", OutFileName);
- }
-
- //
- // Read the INF file image
- //
- if (InfFileName != NULL) {
- Status = GetFileImage (InfFileName, &InfFileImage, &InfFileSize);
- if (EFI_ERROR (Status)) {
- return STATUS_ERROR;
- }
- }
-
- if (DumpCapsule) {
- VerboseMsg ("Dump the capsule header information for the input capsule image %s", InfFileName);
- //
- // Dump Capsule Image Header Information
- //
- CapsuleHeader = (EFI_CAPSULE_HEADER *) InfFileImage;
- if (OutFileName == NULL) {
- FpFile = stdout;
- } else {
- FpFile = fopen (OutFileName, "w");
- if (FpFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", OutFileName);
- return STATUS_ERROR;
- }
- }
- fprintf (FpFile, "Capsule %s Image Header Information\n", InfFileName);
- fprintf (FpFile, " GUID %08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X\n",
- (unsigned) CapsuleHeader->CapsuleGuid.Data1,
- (unsigned) CapsuleHeader->CapsuleGuid.Data2,
- (unsigned) CapsuleHeader->CapsuleGuid.Data3,
- (unsigned) CapsuleHeader->CapsuleGuid.Data4[0],
- (unsigned) CapsuleHeader->CapsuleGuid.Data4[1],
- (unsigned) CapsuleHeader->CapsuleGuid.Data4[2],
- (unsigned) CapsuleHeader->CapsuleGuid.Data4[3],
- (unsigned) CapsuleHeader->CapsuleGuid.Data4[4],
- (unsigned) CapsuleHeader->CapsuleGuid.Data4[5],
- (unsigned) CapsuleHeader->CapsuleGuid.Data4[6],
- (unsigned) CapsuleHeader->CapsuleGuid.Data4[7]);
- fprintf (FpFile, " Header size 0x%08X\n", (unsigned) CapsuleHeader->HeaderSize);
- fprintf (FpFile, " Flags 0x%08X\n", (unsigned) CapsuleHeader->Flags);
- fprintf (FpFile, " Capsule image size 0x%08X\n", (unsigned) CapsuleHeader->CapsuleImageSize);
- fclose (FpFile);
- } else if (CapsuleFlag) {
- VerboseMsg ("Create capsule image");
- //
- // Call the GenerateCapImage to generate Capsule Image
- //
- for (Index = 0; mFvDataInfo.FvFiles[Index][0] != '\0'; Index ++) {
- strcpy (mCapDataInfo.CapFiles[Index], mFvDataInfo.FvFiles[Index]);
- }
-
- Status = GenerateCapImage (
- InfFileImage,
- InfFileSize,
- OutFileName
- );
- } else {
- VerboseMsg ("Create Fv image and its map file");
- //
- // Will take rebase action at below situation:
- // 1. ForceRebase Flag specified to TRUE;
- // 2. ForceRebase Flag not specified, BaseAddress greater than zero.
- //
- if (((mFvDataInfo.BaseAddress > 0) && (mFvDataInfo.ForceRebase == -1)) || (mFvDataInfo.ForceRebase == 1)) {
- VerboseMsg ("FvImage Rebase Address is 0x%llX", (unsigned long long) mFvDataInfo.BaseAddress);
- }
- //
- // Call the GenerateFvImage to generate Fv Image
- //
- Status = GenerateFvImage (
- InfFileImage,
- InfFileSize,
- OutFileName,
- MapFileName
- );
- }
-
- //
- // free InfFileImage memory
- //
- if (InfFileImage != NULL) {
- free (InfFileImage);
- }
-
- //
- // update boot driver address and runtime driver address in address file
- //
- if (Status == EFI_SUCCESS && AddrFileName != NULL && mFvBaseAddressNumber > 0) {
- FpFile = fopen (AddrFileName, "w");
- if (FpFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", AddrFileName);
- return STATUS_ERROR;
- }
- fprintf (FpFile, FV_BASE_ADDRESS_STRING);
- fprintf (FpFile, "\n");
- for (Index = 0; Index < mFvBaseAddressNumber; Index ++) {
- fprintf (
- FpFile,
- "0x%llx\n",
- (unsigned long long)mFvBaseAddress[Index]
- );
- }
- fflush (FpFile);
- fclose (FpFile);
- }
-
- if (Status == EFI_SUCCESS) {
- DebugMsg (NULL, 0, 9, "The Total Fv Size", "%s = 0x%x", EFI_FV_TOTAL_SIZE_STRING, (unsigned) mFvTotalSize);
- DebugMsg (NULL, 0, 9, "The used Fv Size", "%s = 0x%x", EFI_FV_TAKEN_SIZE_STRING, (unsigned) mFvTakenSize);
- DebugMsg (NULL, 0, 9, "The space Fv size", "%s = 0x%x", EFI_FV_SPACE_SIZE_STRING, (unsigned) (mFvTotalSize - mFvTakenSize));
- }
-
- VerboseMsg ("%s tool done with return code is 0x%x.", UTILITY_NAME, GetUtilityStatus ());
-
- return GetUtilityStatus ();
-}
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
deleted file mode 100644
index dd0e9ec3be..0000000000
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
+++ /dev/null
@@ -1,3756 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
-Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- GenFvInternalLib.c
-
-Abstract:
-
- This file contains the internal functions required to generate a Firmware Volume.
-
-**/
-
-//
-// Include files
-//
-#ifdef __GNUC__
-#include <uuid/uuid.h>
-#include <sys/stat.h>
-#endif
-#include <string.h>
-#ifndef __GNUC__
-#include <io.h>
-#endif
-#include <assert.h>
-
-#include "GenFvInternalLib.h"
-#include "FvLib.h"
-#include "PeCoffLib.h"
-#include "WinNtInclude.h"
-
-BOOLEAN mArm = FALSE;
-STATIC UINT32 MaxFfsAlignment = 0;
-
-EFI_GUID mEfiFirmwareVolumeTopFileGuid = EFI_FFS_VOLUME_TOP_FILE_GUID;
-EFI_GUID mFileGuidArray [MAX_NUMBER_OF_FILES_IN_FV];
-EFI_GUID mZeroGuid = {0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
-EFI_GUID mDefaultCapsuleGuid = {0x3B6686BD, 0x0D76, 0x4030, { 0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 }};
-
-CHAR8 *mFvbAttributeName[] = {
- EFI_FVB2_READ_DISABLED_CAP_STRING,
- EFI_FVB2_READ_ENABLED_CAP_STRING,
- EFI_FVB2_READ_STATUS_STRING,
- EFI_FVB2_WRITE_DISABLED_CAP_STRING,
- EFI_FVB2_WRITE_ENABLED_CAP_STRING,
- EFI_FVB2_WRITE_STATUS_STRING,
- EFI_FVB2_LOCK_CAP_STRING,
- EFI_FVB2_LOCK_STATUS_STRING,
- NULL,
- EFI_FVB2_STICKY_WRITE_STRING,
- EFI_FVB2_MEMORY_MAPPED_STRING,
- EFI_FVB2_ERASE_POLARITY_STRING,
- EFI_FVB2_READ_LOCK_CAP_STRING,
- EFI_FVB2_READ_LOCK_STATUS_STRING,
- EFI_FVB2_WRITE_LOCK_CAP_STRING,
- EFI_FVB2_WRITE_LOCK_STATUS_STRING
-};
-
-CHAR8 *mFvbAlignmentName[] = {
- EFI_FVB2_ALIGNMENT_1_STRING,
- EFI_FVB2_ALIGNMENT_2_STRING,
- EFI_FVB2_ALIGNMENT_4_STRING,
- EFI_FVB2_ALIGNMENT_8_STRING,
- EFI_FVB2_ALIGNMENT_16_STRING,
- EFI_FVB2_ALIGNMENT_32_STRING,
- EFI_FVB2_ALIGNMENT_64_STRING,
- EFI_FVB2_ALIGNMENT_128_STRING,
- EFI_FVB2_ALIGNMENT_256_STRING,
- EFI_FVB2_ALIGNMENT_512_STRING,
- EFI_FVB2_ALIGNMENT_1K_STRING,
- EFI_FVB2_ALIGNMENT_2K_STRING,
- EFI_FVB2_ALIGNMENT_4K_STRING,
- EFI_FVB2_ALIGNMENT_8K_STRING,
- EFI_FVB2_ALIGNMENT_16K_STRING,
- EFI_FVB2_ALIGNMENT_32K_STRING,
- EFI_FVB2_ALIGNMENT_64K_STRING,
- EFI_FVB2_ALIGNMENT_128K_STRING,
- EFI_FVB2_ALIGNMENT_256K_STRING,
- EFI_FVB2_ALIGNMENT_512K_STRING,
- EFI_FVB2_ALIGNMENT_1M_STRING,
- EFI_FVB2_ALIGNMENT_2M_STRING,
- EFI_FVB2_ALIGNMENT_4M_STRING,
- EFI_FVB2_ALIGNMENT_8M_STRING,
- EFI_FVB2_ALIGNMENT_16M_STRING,
- EFI_FVB2_ALIGNMENT_32M_STRING,
- EFI_FVB2_ALIGNMENT_64M_STRING,
- EFI_FVB2_ALIGNMENT_128M_STRING,
- EFI_FVB2_ALIGNMENT_256M_STRING,
- EFI_FVB2_ALIGNMENT_512M_STRING,
- EFI_FVB2_ALIGNMENT_1G_STRING,
- EFI_FVB2_ALIGNMENT_2G_STRING
-};
-
-//
-// This data array will be located at the base of the Firmware Volume Header (FVH)
-// in the boot block. It must not exceed 14 bytes of code. The last 2 bytes
-// will be used to keep the FVH checksum consistent.
-// This code will be run in response to a starutp IPI for HT-enabled systems.
-//
-#define SIZEOF_STARTUP_DATA_ARRAY 0x10
-
-UINT8 m128kRecoveryStartupApDataArray[SIZEOF_STARTUP_DATA_ARRAY] = {
- //
- // EA D0 FF 00 F0 ; far jmp F000:FFD0
- // 0, 0, 0, 0, 0, 0, 0, 0, 0, ; Reserved bytes
- // 0, 0 ; Checksum Padding
- //
- 0xEA,
- 0xD0,
- 0xFF,
- 0x0,
- 0xF0,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
-};
-
-UINT8 m64kRecoveryStartupApDataArray[SIZEOF_STARTUP_DATA_ARRAY] = {
- //
- // EB CE ; jmp short ($-0x30)
- // ; (from offset 0x0 to offset 0xFFD0)
- // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ; Reserved bytes
- // 0, 0 ; Checksum Padding
- //
- 0xEB,
- 0xCE,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00,
- 0x00
-};
-
-FV_INFO mFvDataInfo;
-CAP_INFO mCapDataInfo;
-
-EFI_PHYSICAL_ADDRESS mFvBaseAddress[0x10];
-UINT32 mFvBaseAddressNumber = 0;
-
-EFI_STATUS
-ParseFvInf (
- IN MEMORY_FILE *InfFile,
- OUT FV_INFO *FvInfo
- )
-/*++
-
-Routine Description:
-
- This function parses a FV.INF file and copies info into a FV_INFO structure.
-
-Arguments:
-
- InfFile Memory file image.
- FvInfo Information read from INF file.
-
-Returns:
-
- EFI_SUCCESS INF file information successfully retrieved.
- EFI_ABORTED INF file has an invalid format.
- EFI_NOT_FOUND A required string was not found in the INF file.
---*/
-{
- CHAR8 Value[_MAX_PATH];
- UINT64 Value64;
- UINTN Index;
- UINTN Number;
- EFI_STATUS Status;
- EFI_GUID GuidValue;
-
- //
- // Read the FV base address
- //
- if (!mFvDataInfo.BaseAddressSet) {
- Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_FV_BASE_ADDRESS_STRING, 0, Value);
- if (Status == EFI_SUCCESS) {
- //
- // Get the base address
- //
- Status = AsciiStringToUint64 (Value, FALSE, &Value64);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid parameter", "%s = %s", EFI_FV_BASE_ADDRESS_STRING, Value);
- return EFI_ABORTED;
- }
- DebugMsg (NULL, 0, 9, "rebase address", "%s = %s", EFI_FV_BASE_ADDRESS_STRING, Value);
-
- FvInfo->BaseAddress = Value64;
- FvInfo->BaseAddressSet = TRUE;
- }
- }
-
- //
- // Read the FV File System Guid
- //
- if (!FvInfo->FvFileSystemGuidSet) {
- Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_FV_FILESYSTEMGUID_STRING, 0, Value);
- if (Status == EFI_SUCCESS) {
- //
- // Get the guid value
- //
- Status = StringToGuid (Value, &GuidValue);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid parameter", "%s = %s", EFI_FV_FILESYSTEMGUID_STRING, Value);
- return EFI_ABORTED;
- }
- memcpy (&FvInfo->FvFileSystemGuid, &GuidValue, sizeof (EFI_GUID));
- FvInfo->FvFileSystemGuidSet = TRUE;
- }
- }
-
- //
- // Read the FV Extension Header File Name
- //
- Status = FindToken (InfFile, ATTRIBUTES_SECTION_STRING, EFI_FV_EXT_HEADER_FILE_NAME, 0, Value);
- if (Status == EFI_SUCCESS) {
- strcpy (FvInfo->FvExtHeaderFile, Value);
- }
-
- //
- // Read the FV file name
- //
- Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_FV_FILE_NAME_STRING, 0, Value);
- if (Status == EFI_SUCCESS) {
- //
- // copy the file name
- //
- strcpy (FvInfo->FvName, Value);
- }
-
- //
- // Read Fv Attribute
- //
- for (Index = 0; Index < sizeof (mFvbAttributeName)/sizeof (CHAR8 *); Index ++) {
- if ((mFvbAttributeName [Index] != NULL) && \
- (FindToken (InfFile, ATTRIBUTES_SECTION_STRING, mFvbAttributeName [Index], 0, Value) == EFI_SUCCESS)) {
- if ((strcmp (Value, TRUE_STRING) == 0) || (strcmp (Value, ONE_STRING) == 0)) {
- FvInfo->FvAttributes |= 1 << Index;
- } else if ((strcmp (Value, FALSE_STRING) != 0) && (strcmp (Value, ZERO_STRING) != 0)) {
- Error (NULL, 0, 2000, "Invalid parameter", "%s expected %s | %s", mFvbAttributeName [Index], TRUE_STRING, FALSE_STRING);
- return EFI_ABORTED;
- }
- }
- }
-
- //
- // Read Fv Alignment
- //
- for (Index = 0; Index < sizeof (mFvbAlignmentName)/sizeof (CHAR8 *); Index ++) {
- if (FindToken (InfFile, ATTRIBUTES_SECTION_STRING, mFvbAlignmentName [Index], 0, Value) == EFI_SUCCESS) {
- if (strcmp (Value, TRUE_STRING) == 0) {
- FvInfo->FvAttributes |= Index << 16;
- DebugMsg (NULL, 0, 9, "FV file alignment", "Align = %s", mFvbAlignmentName [Index]);
- break;
- }
- }
- }
-
- //
- // Read block maps
- //
- for (Index = 0; Index < MAX_NUMBER_OF_FV_BLOCKS; Index++) {
- if (FvInfo->FvBlocks[Index].Length == 0) {
- //
- // Read block size
- //
- Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_BLOCK_SIZE_STRING, Index, Value);
-
- if (Status == EFI_SUCCESS) {
- //
- // Update the size of block
- //
- Status = AsciiStringToUint64 (Value, FALSE, &Value64);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid parameter", "%s = %s", EFI_BLOCK_SIZE_STRING, Value);
- return EFI_ABORTED;
- }
-
- FvInfo->FvBlocks[Index].Length = (UINT32) Value64;
- DebugMsg (NULL, 0, 9, "FV Block Size", "%s = %s", EFI_BLOCK_SIZE_STRING, Value);
- } else {
- //
- // If there is no blocks size, but there is the number of block, then we have a mismatched pair
- // and should return an error.
- //
- Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_NUM_BLOCKS_STRING, Index, Value);
- if (!EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid parameter", "both %s and %s must be specified.", EFI_NUM_BLOCKS_STRING, EFI_BLOCK_SIZE_STRING);
- return EFI_ABORTED;
- } else {
- //
- // We are done
- //
- break;
- }
- }
-
- //
- // Read blocks number
- //
- Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_NUM_BLOCKS_STRING, Index, Value);
-
- if (Status == EFI_SUCCESS) {
- //
- // Update the number of blocks
- //
- Status = AsciiStringToUint64 (Value, FALSE, &Value64);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid parameter", "%s = %s", EFI_NUM_BLOCKS_STRING, Value);
- return EFI_ABORTED;
- }
-
- FvInfo->FvBlocks[Index].NumBlocks = (UINT32) Value64;
- DebugMsg (NULL, 0, 9, "FV Block Number", "%s = %s", EFI_NUM_BLOCKS_STRING, Value);
- }
- }
- }
-
- if (Index == 0) {
- Error (NULL, 0, 2001, "Missing required argument", "block size.");
- return EFI_ABORTED;
- }
-
- //
- // Read files
- //
- Number = 0;
- for (Number = 0; Number < MAX_NUMBER_OF_FILES_IN_FV; Number ++) {
- if (FvInfo->FvFiles[Number][0] == '\0') {
- break;
- }
- }
-
- for (Index = 0; Index < MAX_NUMBER_OF_FILES_IN_FV; Index++) {
- //
- // Read the FFS file list
- //
- Status = FindToken (InfFile, FILES_SECTION_STRING, EFI_FILE_NAME_STRING, Index, Value);
-
- if (Status == EFI_SUCCESS) {
- //
- // Add the file
- //
- strcpy (FvInfo->FvFiles[Number + Index], Value);
- DebugMsg (NULL, 0, 9, "FV component file", "the %uth name is %s", (unsigned) Index, Value);
- } else {
- break;
- }
- }
-
- if ((Index + Number) == 0) {
- Warning (NULL, 0, 0, "FV components are not specified.", NULL);
- }
-
- return EFI_SUCCESS;
-}
-
-VOID
-UpdateFfsFileState (
- IN EFI_FFS_FILE_HEADER *FfsFile,
- IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader
- )
-/*++
-
-Routine Description:
-
- This function changes the FFS file attributes based on the erase polarity
- of the FV. Update the reserved bits of State to EFI_FVB2_ERASE_POLARITY.
-
-Arguments:
-
- FfsFile File header.
- FvHeader FV header.
-
-Returns:
-
- None
-
---*/
-{
- if (FvHeader->Attributes & EFI_FVB2_ERASE_POLARITY) {
- FfsFile->State = (UINT8)~(FfsFile->State);
- // FfsFile->State |= ~(UINT8) EFI_FILE_ALL_STATE_BITS;
- }
-}
-
-EFI_STATUS
-ReadFfsAlignment (
- IN EFI_FFS_FILE_HEADER *FfsFile,
- IN OUT UINT32 *Alignment
- )
-/*++
-
-Routine Description:
-
- This function determines the alignment of the FFS input file from the file
- attributes.
-
-Arguments:
-
- FfsFile FFS file to parse
- Alignment The minimum required alignment offset of the FFS file
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_INVALID_PARAMETER One of the input parameters was invalid.
- EFI_ABORTED An error occurred.
-
---*/
-{
- //
- // Verify input parameters.
- //
- if (FfsFile == NULL || Alignment == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- switch ((FfsFile->Attributes >> 3) & 0x07) {
-
- case 0:
- //
- // 8 byte alignment, mini alignment requirement for FFS file.
- //
- *Alignment = 3;
- break;
-
- case 1:
- //
- // 16 byte alignment
- //
- *Alignment = 4;
- break;
-
- case 2:
- //
- // 128 byte alignment
- //
- *Alignment = 7;
- break;
-
- case 3:
- //
- // 512 byte alignment
- //
- *Alignment = 9;
- break;
-
- case 4:
- //
- // 1K byte alignment
- //
- *Alignment = 10;
- break;
-
- case 5:
- //
- // 4K byte alignment
- //
- *Alignment = 12;
- break;
-
- case 6:
- //
- // 32K byte alignment
- //
- *Alignment = 15;
- break;
-
- case 7:
- //
- // 64K byte alignment
- //
- *Alignment = 16;
- break;
-
- default:
- break;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-AddPadFile (
- IN OUT MEMORY_FILE *FvImage,
- IN UINT32 DataAlignment,
- IN VOID *FvEnd,
- IN EFI_FIRMWARE_VOLUME_EXT_HEADER *ExtHeader
- )
-/*++
-
-Routine Description:
-
- This function adds a pad file to the FV image if it required to align the
- data of the next file.
-
-Arguments:
-
- FvImage The memory image of the FV to add it to.
- The current offset must be valid.
- DataAlignment The data alignment of the next FFS file.
- FvEnd End of the empty data in FvImage.
- ExtHeader PI FvExtHeader Optional
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_INVALID_PARAMETER One of the input parameters was invalid.
- EFI_OUT_OF_RESOURCES Insufficient resources exist in the FV to complete
- the pad file add.
-
---*/
-{
- EFI_FFS_FILE_HEADER *PadFile;
- UINTN PadFileSize;
-
- //
- // Verify input parameters.
- //
- if (FvImage == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Check if a pad file is necessary
- //
- if ((ExtHeader == NULL) && (((UINTN) FvImage->CurrentFilePointer - (UINTN) FvImage->FileImage + sizeof (EFI_FFS_FILE_HEADER)) % DataAlignment == 0)) {
- return EFI_SUCCESS;
- }
-
- //
- // Calculate the pad file size
- //
- //
- // This is the earliest possible valid offset (current plus pad file header
- // plus the next file header)
- //
- PadFileSize = (UINTN) FvImage->CurrentFilePointer - (UINTN) FvImage->FileImage + (sizeof (EFI_FFS_FILE_HEADER) * 2);
-
- //
- // Add whatever it takes to get to the next aligned address
- //
- while ((PadFileSize % DataAlignment) != 0) {
- PadFileSize++;
- }
- //
- // Subtract the next file header size
- //
- PadFileSize -= sizeof (EFI_FFS_FILE_HEADER);
-
- //
- // Subtract the starting offset to get size
- //
- PadFileSize -= (UINTN) FvImage->CurrentFilePointer - (UINTN) FvImage->FileImage;
-
- //
- // Append extension header size
- //
- if (ExtHeader != NULL) {
- PadFileSize = PadFileSize + ExtHeader->ExtHeaderSize;
- }
-
- //
- // Verify that we have enough space for the file header
- //
- if (((UINTN) FvImage->CurrentFilePointer + PadFileSize) > (UINTN) FvEnd) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Write pad file header
- //
- PadFile = (EFI_FFS_FILE_HEADER *) FvImage->CurrentFilePointer;
-
- //
- // Write PadFile FFS header with PadType, don't need to set PAD file guid in its header.
- //
- PadFile->Type = EFI_FV_FILETYPE_FFS_PAD;
- PadFile->Attributes = 0;
-
- //
- // Write pad file size (calculated size minus next file header size)
- //
- PadFile->Size[0] = (UINT8) (PadFileSize & 0xFF);
- PadFile->Size[1] = (UINT8) ((PadFileSize >> 8) & 0xFF);
- PadFile->Size[2] = (UINT8) ((PadFileSize >> 16) & 0xFF);
-
- //
- // Fill in checksums and state, they must be 0 for checksumming.
- //
- PadFile->IntegrityCheck.Checksum.Header = 0;
- PadFile->IntegrityCheck.Checksum.File = 0;
- PadFile->State = 0;
- PadFile->IntegrityCheck.Checksum.Header = CalculateChecksum8 ((UINT8 *) PadFile, sizeof (EFI_FFS_FILE_HEADER));
- PadFile->IntegrityCheck.Checksum.File = FFS_FIXED_CHECKSUM;
-
- PadFile->State = EFI_FILE_HEADER_CONSTRUCTION | EFI_FILE_HEADER_VALID | EFI_FILE_DATA_VALID;
- UpdateFfsFileState (
- (EFI_FFS_FILE_HEADER *) PadFile,
- (EFI_FIRMWARE_VOLUME_HEADER *) FvImage->FileImage
- );
-
- //
- // Update the current FV pointer
- //
- FvImage->CurrentFilePointer += PadFileSize;
-
- if (ExtHeader != NULL) {
- //
- // Copy Fv Extension Header and Set Fv Extension header offset
- //
- memcpy (PadFile + 1, ExtHeader, ExtHeader->ExtHeaderSize);
- ((EFI_FIRMWARE_VOLUME_HEADER *) FvImage->FileImage)->ExtHeaderOffset = (UINT16) ((UINTN) (PadFile + 1) - (UINTN) FvImage->FileImage);
- //
- // Make next file start at QWord Boundry
- //
- while (((UINTN) FvImage->CurrentFilePointer & (EFI_FFS_FILE_HEADER_ALIGNMENT - 1)) != 0) {
- FvImage->CurrentFilePointer++;
- }
- }
-
- return EFI_SUCCESS;
-}
-
-BOOLEAN
-IsVtfFile (
- IN EFI_FFS_FILE_HEADER *FileBuffer
- )
-/*++
-
-Routine Description:
-
- This function checks the header to validate if it is a VTF file
-
-Arguments:
-
- FileBuffer Buffer in which content of a file has been read.
-
-Returns:
-
- TRUE If this is a VTF file
- FALSE If this is not a VTF file
-
---*/
-{
- if (!memcmp (&FileBuffer->Name, &mEfiFirmwareVolumeTopFileGuid, sizeof (EFI_GUID))) {
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-EFI_STATUS
-WriteMapFile (
- IN OUT FILE *FvMapFile,
- IN CHAR8 *FileName,
- IN EFI_FFS_FILE_HEADER *FfsFile,
- IN EFI_PHYSICAL_ADDRESS ImageBaseAddress,
- IN PE_COFF_LOADER_IMAGE_CONTEXT *pImageContext
- )
-/*++
-
-Routine Description:
-
- This function gets the basic debug information (entrypoint, baseaddress, .text, .data section base address)
- from PE/COFF image and abstracts Pe Map file information and add them into FvMap file for Debug.
-
-Arguments:
-
- FvMapFile A pointer to FvMap File
- FileName Ffs File PathName
- FfsFile A pointer to Ffs file image.
- ImageBaseAddress PeImage Base Address.
- pImageContext Image Context Information.
-
-Returns:
-
- EFI_SUCCESS Added required map information.
-
---*/
-{
- CHAR8 PeMapFileName [_MAX_PATH];
- CHAR8 *Cptr, *Cptr2;
- CHAR8 FileGuidName [MAX_LINE_LEN];
- FILE *PeMapFile;
- CHAR8 Line [MAX_LINE_LEN];
- CHAR8 KeyWord [MAX_LINE_LEN];
- CHAR8 FunctionName [MAX_LINE_LEN];
- EFI_PHYSICAL_ADDRESS FunctionAddress;
- UINT32 FunctionType;
- CHAR8 FunctionTypeName [MAX_LINE_LEN];
- UINT32 Index;
- UINT32 AddressOfEntryPoint;
- UINT32 Offset;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *ImgHdr;
- EFI_TE_IMAGE_HEADER *TEImageHeader;
- EFI_IMAGE_SECTION_HEADER *SectionHeader;
- unsigned long long TempLongAddress;
- UINT32 TextVirtualAddress;
- UINT32 DataVirtualAddress;
- EFI_PHYSICAL_ADDRESS LinkTimeBaseAddress;
-
- //
- // Init local variable
- //
- FunctionType = 0;
- //
- // Print FileGuid to string buffer.
- //
- PrintGuidToBuffer (&FfsFile->Name, (UINT8 *)FileGuidName, MAX_LINE_LEN, TRUE);
-
- //
- // Construct Map file Name
- //
- strcpy (PeMapFileName, FileName);
-
- //
- // Change '\\' to '/', unified path format.
- //
- Cptr = PeMapFileName;
- while (*Cptr != '\0') {
- if (*Cptr == '\\') {
- *Cptr = FILE_SEP_CHAR;
- }
- Cptr ++;
- }
-
- //
- // Get Map file
- //
- Cptr = PeMapFileName + strlen (PeMapFileName);
- while ((*Cptr != '.') && (Cptr >= PeMapFileName)) {
- Cptr --;
- }
- if (Cptr < PeMapFileName) {
- return EFI_NOT_FOUND;
- } else {
- *(Cptr + 1) = 'm';
- *(Cptr + 2) = 'a';
- *(Cptr + 3) = 'p';
- *(Cptr + 4) = '\0';
- }
-
- //
- // Get module Name
- //
- Cptr2 = Cptr;
- while ((*Cptr != FILE_SEP_CHAR) && (Cptr >= PeMapFileName)) {
- Cptr --;
- }
- *Cptr2 = '\0';
- strcpy (KeyWord, Cptr + 1);
- *Cptr2 = '.';
-
- //
- // AddressOfEntryPoint and Offset in Image
- //
- if (!pImageContext->IsTeImage) {
- ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *) ((UINT8 *) pImageContext->Handle + pImageContext->PeCoffHeaderOffset);
- AddressOfEntryPoint = ImgHdr->Pe32.OptionalHeader.AddressOfEntryPoint;
- Offset = 0;
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (
- (UINT8 *) ImgHdr +
- sizeof (UINT32) +
- sizeof (EFI_IMAGE_FILE_HEADER) +
- ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader
- );
- Index = ImgHdr->Pe32.FileHeader.NumberOfSections;
- } else {
- TEImageHeader = (EFI_TE_IMAGE_HEADER *) pImageContext->Handle;
- AddressOfEntryPoint = TEImageHeader->AddressOfEntryPoint;
- Offset = TEImageHeader->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER);
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (TEImageHeader + 1);
- Index = TEImageHeader->NumberOfSections;
- }
-
- //
- // module information output
- //
- if (ImageBaseAddress == 0) {
- fprintf (FvMapFile, "%s (dummy) (", KeyWord);
- fprintf (FvMapFile, "BaseAddress=%010llx, ", (unsigned long long) ImageBaseAddress);
- } else {
- fprintf (FvMapFile, "%s (Fixed Flash Address, ", KeyWord);
- fprintf (FvMapFile, "BaseAddress=0x%010llx, ", (unsigned long long) (ImageBaseAddress + Offset));
- }
-
- if (FfsFile->Type != EFI_FV_FILETYPE_SECURITY_CORE && pImageContext->Machine == EFI_IMAGE_MACHINE_IA64) {
- //
- // Process IPF PLABEL to get the real address after the image has been rebased.
- // PLABEL structure is got by AddressOfEntryPoint offset to ImageBuffer stored in pImageContext->Handle.
- //
- fprintf (FvMapFile, "EntryPoint=0x%010llx", (unsigned long long) (*(UINT64 *)((UINTN) pImageContext->Handle + (UINTN) AddressOfEntryPoint)));
- } else {
- fprintf (FvMapFile, "EntryPoint=0x%010llx", (unsigned long long) (ImageBaseAddress + AddressOfEntryPoint));
- }
- fprintf (FvMapFile, ")\n");
-
- fprintf (FvMapFile, "(GUID=%s", FileGuidName);
- TextVirtualAddress = 0;
- DataVirtualAddress = 0;
- for (; Index > 0; Index --, SectionHeader ++) {
- if (stricmp ((CHAR8 *)SectionHeader->Name, ".text") == 0) {
- TextVirtualAddress = SectionHeader->VirtualAddress;
- } else if (stricmp ((CHAR8 *)SectionHeader->Name, ".data") == 0) {
- DataVirtualAddress = SectionHeader->VirtualAddress;
- } else if (stricmp ((CHAR8 *)SectionHeader->Name, ".sdata") == 0) {
- DataVirtualAddress = SectionHeader->VirtualAddress;
- }
- }
- fprintf (FvMapFile, " .textbaseaddress=0x%010llx", (unsigned long long) (ImageBaseAddress + TextVirtualAddress));
- fprintf (FvMapFile, " .databaseaddress=0x%010llx", (unsigned long long) (ImageBaseAddress + DataVirtualAddress));
- fprintf (FvMapFile, ")\n\n");
-
- //
- // Open PeMapFile
- //
- PeMapFile = fopen (PeMapFileName, "r");
- if (PeMapFile == NULL) {
- // fprintf (stdout, "can't open %s file to reading\n", PeMapFileName);
- return EFI_ABORTED;
- }
- VerboseMsg ("The map file is %s", PeMapFileName);
-
- //
- // Output Functions information into Fv Map file
- //
- LinkTimeBaseAddress = 0;
- while (fgets (Line, MAX_LINE_LEN, PeMapFile) != NULL) {
- //
- // Skip blank line
- //
- if (Line[0] == 0x0a) {
- FunctionType = 0;
- continue;
- }
- //
- // By Address and Static keyword
- //
- if (FunctionType == 0) {
- sscanf (Line, "%s", KeyWord);
- if (stricmp (KeyWord, "Address") == 0) {
- //
- // function list
- //
- FunctionType = 1;
- fgets (Line, MAX_LINE_LEN, PeMapFile);
- } else if (stricmp (KeyWord, "Static") == 0) {
- //
- // static function list
- //
- FunctionType = 2;
- fgets (Line, MAX_LINE_LEN, PeMapFile);
- } else if (stricmp (KeyWord, "Preferred") ==0) {
- sscanf (Line + strlen (" Preferred load address is"), "%llx", &TempLongAddress);
- LinkTimeBaseAddress = (UINT64) TempLongAddress;
- }
- continue;
- }
- //
- // Printf Function Information
- //
- if (FunctionType == 1) {
- sscanf (Line, "%s %s %llx %s", KeyWord, FunctionName, &TempLongAddress, FunctionTypeName);
- FunctionAddress = (UINT64) TempLongAddress;
- if (FunctionTypeName [1] == '\0' && (FunctionTypeName [0] == 'f' || FunctionTypeName [0] == 'F')) {
- fprintf (FvMapFile, " 0x%010llx ", (unsigned long long) (ImageBaseAddress + FunctionAddress - LinkTimeBaseAddress));
- fprintf (FvMapFile, "%s\n", FunctionName);
- }
- } else if (FunctionType == 2) {
- sscanf (Line, "%s %s %llx %s", KeyWord, FunctionName, &TempLongAddress, FunctionTypeName);
- FunctionAddress = (UINT64) TempLongAddress;
- if (FunctionTypeName [1] == '\0' && (FunctionTypeName [0] == 'f' || FunctionTypeName [0] == 'F')) {
- fprintf (FvMapFile, " 0x%010llx ", (unsigned long long) (ImageBaseAddress + FunctionAddress - LinkTimeBaseAddress));
- fprintf (FvMapFile, "%s\n", FunctionName);
- }
- }
- }
- //
- // Close PeMap file
- //
- fprintf (FvMapFile, "\n\n");
- fclose (PeMapFile);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-AddFile (
- IN OUT MEMORY_FILE *FvImage,
- IN FV_INFO *FvInfo,
- IN UINTN Index,
- IN OUT EFI_FFS_FILE_HEADER **VtfFileImage,
- IN FILE *FvMapFile,
- IN FILE *FvReportFile
- )
-/*++
-
-Routine Description:
-
- This function adds a file to the FV image. The file will pad to the
- appropriate alignment if required.
-
-Arguments:
-
- FvImage The memory image of the FV to add it to. The current offset
- must be valid.
- FvInfo Pointer to information about the FV.
- Index The file in the FvInfo file list to add.
- VtfFileImage A pointer to the VTF file within the FvImage. If this is equal
- to the end of the FvImage then no VTF previously found.
- FvMapFile Pointer to FvMap File
- FvReportFile Pointer to FvReport File
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
- EFI_INVALID_PARAMETER One of the input parameters was invalid.
- EFI_ABORTED An error occurred.
- EFI_OUT_OF_RESOURCES Insufficient resources exist to complete the add.
-
---*/
-{
- FILE *NewFile;
- UINTN FileSize;
- UINT8 *FileBuffer;
- UINTN NumBytesRead;
- UINT32 CurrentFileAlignment;
- EFI_STATUS Status;
- UINTN Index1;
- UINT8 FileGuidString[PRINTED_GUID_BUFFER_SIZE];
-
- Index1 = 0;
- //
- // Verify input parameters.
- //
- if (FvImage == NULL || FvInfo == NULL || FvInfo->FvFiles[Index][0] == 0 || VtfFileImage == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Read the file to add
- //
- NewFile = fopen (FvInfo->FvFiles[Index], "rb");
-
- if (NewFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", FvInfo->FvFiles[Index]);
- return EFI_ABORTED;
- }
-
- //
- // Get the file size
- //
- FileSize = _filelength (fileno (NewFile));
-
- //
- // Read the file into a buffer
- //
- FileBuffer = malloc (FileSize);
- if (FileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resouce", "memory cannot be allocated!");
- return EFI_OUT_OF_RESOURCES;
- }
-
- NumBytesRead = fread (FileBuffer, sizeof (UINT8), FileSize, NewFile);
-
- //
- // Done with the file, from this point on we will just use the buffer read.
- //
- fclose (NewFile);
-
- //
- // Verify read successful
- //
- if (NumBytesRead != sizeof (UINT8) * FileSize) {
- free (FileBuffer);
- Error (NULL, 0, 0004, "Error reading file", FvInfo->FvFiles[Index]);
- return EFI_ABORTED;
- }
-
- //
- // For None PI Ffs file, directly add them into FvImage.
- //
- if (!FvInfo->IsPiFvImage) {
- memcpy (FvImage->CurrentFilePointer, FileBuffer, FileSize);
- if (FvInfo->SizeofFvFiles[Index] > FileSize) {
- FvImage->CurrentFilePointer += FvInfo->SizeofFvFiles[Index];
- } else {
- FvImage->CurrentFilePointer += FileSize;
- }
- goto Done;
- }
-
- //
- // Verify Ffs file
- //
- Status = VerifyFfsFile ((EFI_FFS_FILE_HEADER *)FileBuffer);
- if (EFI_ERROR (Status)) {
- free (FileBuffer);
- Error (NULL, 0, 3000, "Invalid", "%s is not a valid FFS file.", FvInfo->FvFiles[Index]);
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Verify space exists to add the file
- //
- if (FileSize > (UINTN) ((UINTN) *VtfFileImage - (UINTN) FvImage->CurrentFilePointer)) {
- free (FileBuffer);
- Error (NULL, 0, 4002, "Resource", "FV space is full, not enough room to add file %s.", FvInfo->FvFiles[Index]);
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Verify the input file is the duplicated file in this Fv image
- //
- for (Index1 = 0; Index1 < Index; Index1 ++) {
- if (CompareGuid ((EFI_GUID *) FileBuffer, &mFileGuidArray [Index1]) == 0) {
- Error (NULL, 0, 2000, "Invalid parameter", "the %dth file and %uth file have the same file GUID.", (unsigned) Index1 + 1, (unsigned) Index + 1);
- PrintGuid ((EFI_GUID *) FileBuffer);
- return EFI_INVALID_PARAMETER;
- }
- }
- CopyMem (&mFileGuidArray [Index], FileBuffer, sizeof (EFI_GUID));
-
- //
- // Update the file state based on polarity of the FV.
- //
- UpdateFfsFileState (
- (EFI_FFS_FILE_HEADER *) FileBuffer,
- (EFI_FIRMWARE_VOLUME_HEADER *) FvImage->FileImage
- );
-
- //
- // Check if alignment is required
- //
- ReadFfsAlignment ((EFI_FFS_FILE_HEADER *) FileBuffer, &CurrentFileAlignment);
-
- //
- // Find the largest alignment of all the FFS files in the FV
- //
- if (CurrentFileAlignment > MaxFfsAlignment) {
- MaxFfsAlignment = CurrentFileAlignment;
- }
- //
- // If we have a VTF file, add it at the top.
- //
- if (IsVtfFile ((EFI_FFS_FILE_HEADER *) FileBuffer)) {
- if ((UINTN) *VtfFileImage == (UINTN) FvImage->Eof) {
- //
- // No previous VTF, add this one.
- //
- *VtfFileImage = (EFI_FFS_FILE_HEADER *) (UINTN) ((UINTN) FvImage->FileImage + FvInfo->Size - FileSize);
- //
- // Sanity check. The file MUST align appropriately
- //
- if (((UINTN) *VtfFileImage + sizeof (EFI_FFS_FILE_HEADER) - (UINTN) FvImage->FileImage) % (1 << CurrentFileAlignment)) {
- Error (NULL, 0, 3000, "Invalid", "VTF file cannot be aligned on a %u-byte boundary.", (unsigned) (1 << CurrentFileAlignment));
- free (FileBuffer);
- return EFI_ABORTED;
- }
- //
- // Rebase the PE or TE image in FileBuffer of FFS file for XIP
- // Rebase for the debug genfvmap tool
- //
- Status = FfsRebase (FvInfo, FvInfo->FvFiles[Index], (EFI_FFS_FILE_HEADER *) FileBuffer, (UINTN) *VtfFileImage - (UINTN) FvImage->FileImage, FvMapFile);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "Could not rebase %s.", FvInfo->FvFiles[Index]);
- return Status;
- }
- //
- // copy VTF File
- //
- memcpy (*VtfFileImage, FileBuffer, FileSize);
-
- PrintGuidToBuffer ((EFI_GUID *) FileBuffer, FileGuidString, sizeof (FileGuidString), TRUE);
- fprintf (FvReportFile, "0x%08X %s\n", (unsigned)(UINTN) (((UINT8 *)*VtfFileImage) - (UINTN)FvImage->FileImage), FileGuidString);
-
- free (FileBuffer);
- DebugMsg (NULL, 0, 9, "Add VTF FFS file in FV image", NULL);
- return EFI_SUCCESS;
- } else {
- //
- // Already found a VTF file.
- //
- Error (NULL, 0, 3000, "Invalid", "multiple VTF files are not permitted within a single FV.");
- free (FileBuffer);
- return EFI_ABORTED;
- }
- }
-
- //
- // Add pad file if necessary
- //
- Status = AddPadFile (FvImage, 1 << CurrentFileAlignment, *VtfFileImage, NULL);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 4002, "Resource", "FV space is full, could not add pad file for data alignment property.");
- free (FileBuffer);
- return EFI_ABORTED;
- }
- //
- // Add file
- //
- if ((UINTN) (FvImage->CurrentFilePointer + FileSize) <= (UINTN) (*VtfFileImage)) {
- //
- // Rebase the PE or TE image in FileBuffer of FFS file for XIP.
- // Rebase Bs and Rt drivers for the debug genfvmap tool.
- //
- Status = FfsRebase (FvInfo, FvInfo->FvFiles[Index], (EFI_FFS_FILE_HEADER *) FileBuffer, (UINTN) FvImage->CurrentFilePointer - (UINTN) FvImage->FileImage, FvMapFile);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "Could not rebase %s.", FvInfo->FvFiles[Index]);
- return Status;
- }
- //
- // Copy the file
- //
- memcpy (FvImage->CurrentFilePointer, FileBuffer, FileSize);
- PrintGuidToBuffer ((EFI_GUID *) FileBuffer, FileGuidString, sizeof (FileGuidString), TRUE);
- fprintf (FvReportFile, "0x%08X %s\n", (unsigned) (FvImage->CurrentFilePointer - FvImage->FileImage), FileGuidString);
- FvImage->CurrentFilePointer += FileSize;
- } else {
- Error (NULL, 0, 4002, "Resource", "FV space is full, cannot add file %s.", FvInfo->FvFiles[Index]);
- free (FileBuffer);
- return EFI_ABORTED;
- }
- //
- // Make next file start at QWord Boundry
- //
- while (((UINTN) FvImage->CurrentFilePointer & (EFI_FFS_FILE_HEADER_ALIGNMENT - 1)) != 0) {
- FvImage->CurrentFilePointer++;
- }
-
-Done:
- //
- // Free allocated memory.
- //
- free (FileBuffer);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-PadFvImage (
- IN MEMORY_FILE *FvImage,
- IN EFI_FFS_FILE_HEADER *VtfFileImage
- )
-/*++
-
-Routine Description:
-
- This function places a pad file between the last file in the FV and the VTF
- file if the VTF file exists.
-
-Arguments:
-
- FvImage Memory file for the FV memory image
- VtfFileImage The address of the VTF file. If this is the end of the FV
- image, no VTF exists and no pad file is needed.
-
-Returns:
-
- EFI_SUCCESS Completed successfully.
- EFI_INVALID_PARAMETER One of the input parameters was NULL.
-
---*/
-{
- EFI_FFS_FILE_HEADER *PadFile;
- UINTN FileSize;
-
- //
- // If there is no VTF or the VTF naturally follows the previous file without a
- // pad file, then there's nothing to do
- //
- if ((UINTN) VtfFileImage == (UINTN) FvImage->Eof || \
- ((UINTN) VtfFileImage == (UINTN) FvImage->CurrentFilePointer)) {
- return EFI_SUCCESS;
- }
-
- if ((UINTN) VtfFileImage < (UINTN) FvImage->CurrentFilePointer) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Pad file starts at beginning of free space
- //
- PadFile = (EFI_FFS_FILE_HEADER *) FvImage->CurrentFilePointer;
-
- //
- // write PadFile FFS header with PadType, don't need to set PAD file guid in its header.
- //
- PadFile->Type = EFI_FV_FILETYPE_FFS_PAD;
- PadFile->Attributes = 0;
-
- //
- // FileSize includes the EFI_FFS_FILE_HEADER
- //
- FileSize = (UINTN) VtfFileImage - (UINTN) FvImage->CurrentFilePointer;
- PadFile->Size[0] = (UINT8) (FileSize & 0x000000FF);
- PadFile->Size[1] = (UINT8) ((FileSize & 0x0000FF00) >> 8);
- PadFile->Size[2] = (UINT8) ((FileSize & 0x00FF0000) >> 16);
-
- //
- // Fill in checksums and state, must be zero during checksum calculation.
- //
- PadFile->IntegrityCheck.Checksum.Header = 0;
- PadFile->IntegrityCheck.Checksum.File = 0;
- PadFile->State = 0;
- PadFile->IntegrityCheck.Checksum.Header = CalculateChecksum8 ((UINT8 *) PadFile, sizeof (EFI_FFS_FILE_HEADER));
- PadFile->IntegrityCheck.Checksum.File = FFS_FIXED_CHECKSUM;
-
- PadFile->State = EFI_FILE_HEADER_CONSTRUCTION | EFI_FILE_HEADER_VALID | EFI_FILE_DATA_VALID;
-
- UpdateFfsFileState (
- (EFI_FFS_FILE_HEADER *) PadFile,
- (EFI_FIRMWARE_VOLUME_HEADER *) FvImage->FileImage
- );
- //
- // Update the current FV pointer
- //
- FvImage->CurrentFilePointer = FvImage->Eof;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-UpdateResetVector (
- IN MEMORY_FILE *FvImage,
- IN FV_INFO *FvInfo,
- IN EFI_FFS_FILE_HEADER *VtfFile
- )
-/*++
-
-Routine Description:
-
- This parses the FV looking for the PEI core and then plugs the address into
- the SALE_ENTRY point of the BSF/VTF for IPF and does BUGBUG TBD action to
- complete an IA32 Bootstrap FV.
-
-Arguments:
-
- FvImage Memory file for the FV memory image
- FvInfo Information read from INF file.
- VtfFile Pointer to the VTF file in the FV image.
-
-Returns:
-
- EFI_SUCCESS Function Completed successfully.
- EFI_ABORTED Error encountered.
- EFI_INVALID_PARAMETER A required parameter was NULL.
- EFI_NOT_FOUND PEI Core file not found.
-
---*/
-{
- EFI_FFS_FILE_HEADER *PeiCoreFile;
- EFI_FFS_FILE_HEADER *SecCoreFile;
- EFI_STATUS Status;
- EFI_FILE_SECTION_POINTER Pe32Section;
- UINT32 EntryPoint;
- UINT32 BaseOfCode;
- UINT16 MachineType;
- EFI_PHYSICAL_ADDRESS PeiCorePhysicalAddress;
- EFI_PHYSICAL_ADDRESS SecCorePhysicalAddress;
- EFI_PHYSICAL_ADDRESS *SecCoreEntryAddressPtr;
- INT32 Ia32SecEntryOffset;
- UINT32 *Ia32ResetAddressPtr;
- UINT8 *BytePointer;
- UINT8 *BytePointer2;
- UINT16 *WordPointer;
- UINT16 CheckSum;
- UINT32 IpiVector;
- UINTN Index;
- EFI_FFS_FILE_STATE SavedState;
- UINT64 FitAddress;
- FIT_TABLE *FitTablePtr;
- BOOLEAN Vtf0Detected;
-
- //
- // Verify input parameters
- //
- if (FvImage == NULL || FvInfo == NULL || VtfFile == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Initialize FV library
- //
- InitializeFvLib (FvImage->FileImage, FvInfo->Size);
-
- //
- // Verify VTF file
- //
- Status = VerifyFfsFile (VtfFile);
- if (EFI_ERROR (Status)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (
- (((UINTN)FvImage->Eof - (UINTN)FvImage->FileImage) >=
- IA32_X64_VTF_SIGNATURE_OFFSET) &&
- (*(UINT32 *)(VOID*)((UINTN) FvImage->Eof -
- IA32_X64_VTF_SIGNATURE_OFFSET) ==
- IA32_X64_VTF0_SIGNATURE)
- ) {
- Vtf0Detected = TRUE;
- } else {
- Vtf0Detected = FALSE;
- }
-
- //
- // Find the Sec Core
- //
- Status = GetFileByType (EFI_FV_FILETYPE_SECURITY_CORE, 1, &SecCoreFile);
- if (EFI_ERROR (Status) || SecCoreFile == NULL) {
- if (Vtf0Detected) {
- //
- // If the SEC core file is not found, but the VTF-0 signature
- // is found, we'll treat it as a VTF-0 'Volume Top File'.
- // This means no modifications are required to the VTF.
- //
- return EFI_SUCCESS;
- }
-
- Error (NULL, 0, 3000, "Invalid", "could not find the SEC core file in the FV.");
- return EFI_ABORTED;
- }
- //
- // Sec Core found, now find PE32 section
- //
- Status = GetSectionByType (SecCoreFile, EFI_SECTION_PE32, 1, &Pe32Section);
- if (Status == EFI_NOT_FOUND) {
- Status = GetSectionByType (SecCoreFile, EFI_SECTION_TE, 1, &Pe32Section);
- }
-
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "could not find a PE32 section in the SEC core file.");
- return EFI_ABORTED;
- }
-
- Status = GetPe32Info (
- (VOID *) ((UINTN) Pe32Section.Pe32Section + sizeof (EFI_SECTION_PE32)),
- &EntryPoint,
- &BaseOfCode,
- &MachineType
- );
-
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "could not get the PE32 entry point for the SEC core.");
- return EFI_ABORTED;
- }
-
- if (
- Vtf0Detected &&
- (MachineType == EFI_IMAGE_MACHINE_IA32 ||
- MachineType == EFI_IMAGE_MACHINE_X64)
- ) {
- //
- // If the SEC core code is IA32 or X64 and the VTF-0 signature
- // is found, we'll treat it as a VTF-0 'Volume Top File'.
- // This means no modifications are required to the VTF.
- //
- return EFI_SUCCESS;
- }
-
- //
- // Physical address is FV base + offset of PE32 + offset of the entry point
- //
- SecCorePhysicalAddress = FvInfo->BaseAddress;
- SecCorePhysicalAddress += (UINTN) Pe32Section.Pe32Section + sizeof (EFI_SECTION_PE32) - (UINTN) FvImage->FileImage;
- SecCorePhysicalAddress += EntryPoint;
- DebugMsg (NULL, 0, 9, "SecCore physical entry point address", "Address = 0x%llX", (unsigned long long) SecCorePhysicalAddress);
-
- //
- // Find the PEI Core
- //
- Status = GetFileByType (EFI_FV_FILETYPE_PEI_CORE, 1, &PeiCoreFile);
- if (EFI_ERROR (Status) || PeiCoreFile == NULL) {
- Error (NULL, 0, 3000, "Invalid", "could not find the PEI core in the FV.");
- return EFI_ABORTED;
- }
- //
- // PEI Core found, now find PE32 or TE section
- //
- Status = GetSectionByType (PeiCoreFile, EFI_SECTION_PE32, 1, &Pe32Section);
- if (Status == EFI_NOT_FOUND) {
- Status = GetSectionByType (PeiCoreFile, EFI_SECTION_TE, 1, &Pe32Section);
- }
-
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "could not find either a PE32 or a TE section in PEI core file.");
- return EFI_ABORTED;
- }
-
- Status = GetPe32Info (
- (VOID *) ((UINTN) Pe32Section.Pe32Section + sizeof (EFI_SECTION_PE32)),
- &EntryPoint,
- &BaseOfCode,
- &MachineType
- );
-
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "could not get the PE32 entry point for the PEI core.");
- return EFI_ABORTED;
- }
- //
- // Physical address is FV base + offset of PE32 + offset of the entry point
- //
- PeiCorePhysicalAddress = FvInfo->BaseAddress;
- PeiCorePhysicalAddress += (UINTN) Pe32Section.Pe32Section + sizeof (EFI_SECTION_PE32) - (UINTN) FvImage->FileImage;
- PeiCorePhysicalAddress += EntryPoint;
- DebugMsg (NULL, 0, 9, "PeiCore physical entry point address", "Address = 0x%llX", (unsigned long long) PeiCorePhysicalAddress);
-
- if (MachineType == EFI_IMAGE_MACHINE_IA64) {
- //
- // Update PEI_CORE address
- //
- //
- // Set the uncached attribute bit in the physical address
- //
- PeiCorePhysicalAddress |= 0x8000000000000000ULL;
-
- //
- // Check if address is aligned on a 16 byte boundary
- //
- if (PeiCorePhysicalAddress & 0xF) {
- Error (NULL, 0, 3000, "Invalid",
- "PEI_CORE entry point is not aligned on a 16 byte boundary, address specified is %llXh.",
- (unsigned long long) PeiCorePhysicalAddress
- );
- return EFI_ABORTED;
- }
- //
- // First Get the FIT table address
- //
- FitAddress = (*(UINT64 *) (FvImage->Eof - IPF_FIT_ADDRESS_OFFSET)) & 0xFFFFFFFF;
-
- FitTablePtr = (FIT_TABLE *) (FvImage->FileImage + (FitAddress - FvInfo->BaseAddress));
-
- Status = UpdatePeiCoreEntryInFit (FitTablePtr, PeiCorePhysicalAddress);
-
- if (!EFI_ERROR (Status)) {
- UpdateFitCheckSum (FitTablePtr);
- }
-
- //
- // Update SEC_CORE address
- //
- //
- // Set the uncached attribute bit in the physical address
- //
- SecCorePhysicalAddress |= 0x8000000000000000ULL;
- //
- // Check if address is aligned on a 16 byte boundary
- //
- if (SecCorePhysicalAddress & 0xF) {
- Error (NULL, 0, 3000, "Invalid",
- "SALE_ENTRY entry point is not aligned on a 16 byte boundary, address specified is %llXh.",
- (unsigned long long) SecCorePhysicalAddress
- );
- return EFI_ABORTED;
- }
- //
- // Update the address
- //
- SecCoreEntryAddressPtr = (EFI_PHYSICAL_ADDRESS *) ((UINTN) FvImage->Eof - IPF_SALE_ENTRY_ADDRESS_OFFSET);
- *SecCoreEntryAddressPtr = SecCorePhysicalAddress;
-
- } else if (MachineType == EFI_IMAGE_MACHINE_IA32 || MachineType == EFI_IMAGE_MACHINE_X64) {
- //
- // Get the location to update
- //
- Ia32ResetAddressPtr = (UINT32 *) ((UINTN) FvImage->Eof - IA32_PEI_CORE_ENTRY_OFFSET);
-
- //
- // Write lower 32 bits of physical address for Pei Core entry
- //
- *Ia32ResetAddressPtr = (UINT32) PeiCorePhysicalAddress;
-
- //
- // Write SecCore Entry point relative address into the jmp instruction in reset vector.
- //
- Ia32ResetAddressPtr = (UINT32 *) ((UINTN) FvImage->Eof - IA32_SEC_CORE_ENTRY_OFFSET);
-
- Ia32SecEntryOffset = (INT32) (SecCorePhysicalAddress - (FV_IMAGES_TOP_ADDRESS - IA32_SEC_CORE_ENTRY_OFFSET + 2));
- if (Ia32SecEntryOffset <= -65536) {
- Error (NULL, 0, 3000, "Invalid", "The SEC EXE file size is too large, it must be less than 64K.");
- return STATUS_ERROR;
- }
-
- *(UINT16 *) Ia32ResetAddressPtr = (UINT16) Ia32SecEntryOffset;
-
- //
- // Update the BFV base address
- //
- Ia32ResetAddressPtr = (UINT32 *) ((UINTN) FvImage->Eof - 4);
- *Ia32ResetAddressPtr = (UINT32) (FvInfo->BaseAddress);
- DebugMsg (NULL, 0, 9, "update BFV base address in the top FV image", "BFV base address = 0x%llX.", (unsigned long long) FvInfo->BaseAddress);
-
- //
- // Update the Startup AP in the FVH header block ZeroVector region.
- //
- BytePointer = (UINT8 *) ((UINTN) FvImage->FileImage);
- if (FvInfo->Size <= 0x10000) {
- BytePointer2 = m64kRecoveryStartupApDataArray;
- } else if (FvInfo->Size <= 0x20000) {
- BytePointer2 = m128kRecoveryStartupApDataArray;
- } else {
- BytePointer2 = m128kRecoveryStartupApDataArray;
- //
- // Find the position to place Ap reset vector, the offset
- // between the position and the end of Fvrecovery.fv file
- // should not exceed 128kB to prevent Ap reset vector from
- // outside legacy E and F segment
- //
- Status = FindApResetVectorPosition (FvImage, &BytePointer);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "FV image does not have enough space to place AP reset vector. The FV image needs to reserve at least 4KB of unused space.");
- return EFI_ABORTED;
- }
- }
-
- for (Index = 0; Index < SIZEOF_STARTUP_DATA_ARRAY; Index++) {
- BytePointer[Index] = BytePointer2[Index];
- }
- //
- // Calculate the checksum
- //
- CheckSum = 0x0000;
- WordPointer = (UINT16 *) (BytePointer);
- for (Index = 0; Index < SIZEOF_STARTUP_DATA_ARRAY / 2; Index++) {
- CheckSum = (UINT16) (CheckSum + ((UINT16) *WordPointer));
- WordPointer++;
- }
- //
- // Update the checksum field
- //
- WordPointer = (UINT16 *) (BytePointer + SIZEOF_STARTUP_DATA_ARRAY - 2);
- *WordPointer = (UINT16) (0x10000 - (UINT32) CheckSum);
-
- //
- // IpiVector at the 4k aligned address in the top 2 blocks in the PEI FV.
- //
- IpiVector = (UINT32) (FV_IMAGES_TOP_ADDRESS - ((UINTN) FvImage->Eof - (UINTN) BytePointer));
- DebugMsg (NULL, 0, 9, "Startup AP Vector address", "IpiVector at 0x%X", (unsigned) IpiVector);
- if ((IpiVector & 0xFFF) != 0) {
- Error (NULL, 0, 3000, "Invalid", "Startup AP Vector address are not 4K aligned, because the FV size is not 4K aligned");
- return EFI_ABORTED;
- }
- IpiVector = IpiVector >> 12;
- IpiVector = IpiVector & 0xFF;
-
- //
- // Write IPI Vector at Offset FvrecoveryFileSize - 8
- //
- Ia32ResetAddressPtr = (UINT32 *) ((UINTN) FvImage->Eof - 8);
- *Ia32ResetAddressPtr = IpiVector;
- } else if (MachineType == EFI_IMAGE_MACHINE_ARMT) {
- //
- // Since the ARM reset vector is in the FV Header you really don't need a
- // Volume Top File, but if you have one for some reason don't crash...
- //
- } else if (MachineType == EFI_IMAGE_MACHINE_AARCH64) {
- //
- // Since the AArch64 reset vector is in the FV Header you really don't need a
- // Volume Top File, but if you have one for some reason don't crash...
- //
- } else {
- Error (NULL, 0, 3000, "Invalid", "machine type=0x%X in PEI core.", MachineType);
- return EFI_ABORTED;
- }
-
- //
- // Now update file checksum
- //
- SavedState = VtfFile->State;
- VtfFile->IntegrityCheck.Checksum.File = 0;
- VtfFile->State = 0;
- if (VtfFile->Attributes & FFS_ATTRIB_CHECKSUM) {
- VtfFile->IntegrityCheck.Checksum.File = CalculateChecksum8 (
- (UINT8 *) (VtfFile + 1),
- GetLength (VtfFile->Size) - sizeof (EFI_FFS_FILE_HEADER)
- );
- } else {
- VtfFile->IntegrityCheck.Checksum.File = FFS_FIXED_CHECKSUM;
- }
-
- VtfFile->State = SavedState;
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-UpdateArmResetVectorIfNeeded (
- IN MEMORY_FILE *FvImage,
- IN FV_INFO *FvInfo
- )
-/*++
-
-Routine Description:
- This parses the FV looking for SEC and patches that address into the
- beginning of the FV header.
-
- For ARM32 the reset vector is at 0x00000000 or 0xFFFF0000.
- For AArch64 the reset vector is at 0x00000000.
-
- This would commonly map to the first entry in the ROM.
- ARM32 Exceptions:
- Reset +0
- Undefined +4
- SWI +8
- Prefetch Abort +12
- Data Abort +16
- IRQ +20
- FIQ +24
-
- We support two schemes on ARM.
- 1) Beginning of the FV is the reset vector
- 2) Reset vector is data bytes FDF file and that code branches to reset vector
- in the beginning of the FV (fixed size offset).
-
- Need to have the jump for the reset vector at location zero.
- We also need to store the address or PEI (if it exists).
- We stub out a return from interrupt in case the debugger
- is using SWI (not done for AArch64, not enough space in struct).
- The optional entry to the common exception handler is
- to support full featured exception handling from ROM and is currently
- not support by this tool.
-
-Arguments:
- FvImage Memory file for the FV memory image
- FvInfo Information read from INF file.
-
-Returns:
-
- EFI_SUCCESS Function Completed successfully.
- EFI_ABORTED Error encountered.
- EFI_INVALID_PARAMETER A required parameter was NULL.
- EFI_NOT_FOUND PEI Core file not found.
-
---*/
-{
- EFI_FFS_FILE_HEADER *PeiCoreFile;
- EFI_FFS_FILE_HEADER *SecCoreFile;
- EFI_STATUS Status;
- EFI_FILE_SECTION_POINTER Pe32Section;
- UINT32 EntryPoint;
- UINT32 BaseOfCode;
- UINT16 MachineType;
- EFI_PHYSICAL_ADDRESS PeiCorePhysicalAddress;
- EFI_PHYSICAL_ADDRESS SecCorePhysicalAddress;
- INT32 ResetVector[4]; // ARM32:
- // 0 - is branch relative to SEC entry point
- // 1 - PEI Entry Point
- // 2 - movs pc,lr for a SWI handler
- // 3 - Place holder for Common Exception Handler
- // AArch64: Used as UINT64 ResetVector[2]
- // 0 - is branch relative to SEC entry point
- // 1 - PEI Entry Point
-
- //
- // Verify input parameters
- //
- if (FvImage == NULL || FvInfo == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Initialize FV library
- //
- InitializeFvLib (FvImage->FileImage, FvInfo->Size);
-
- //
- // Find the Sec Core
- //
- Status = GetFileByType (EFI_FV_FILETYPE_SECURITY_CORE, 1, &SecCoreFile);
- if (EFI_ERROR (Status) || SecCoreFile == NULL) {
- //
- // Maybe hardware does SEC job and we only have PEI Core?
- //
-
- //
- // Find the PEI Core. It may not exist if SEC loads DXE core directly
- //
- PeiCorePhysicalAddress = 0;
- Status = GetFileByType (EFI_FV_FILETYPE_PEI_CORE, 1, &PeiCoreFile);
- if (!EFI_ERROR (Status) && PeiCoreFile != NULL) {
- //
- // PEI Core found, now find PE32 or TE section
- //
- Status = GetSectionByType (PeiCoreFile, EFI_SECTION_PE32, 1, &Pe32Section);
- if (Status == EFI_NOT_FOUND) {
- Status = GetSectionByType (PeiCoreFile, EFI_SECTION_TE, 1, &Pe32Section);
- }
-
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "could not find either a PE32 or a TE section in PEI core file!");
- return EFI_ABORTED;
- }
-
- Status = GetPe32Info (
- (VOID *) ((UINTN) Pe32Section.Pe32Section + sizeof (EFI_SECTION_PE32)),
- &EntryPoint,
- &BaseOfCode,
- &MachineType
- );
-
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "could not get the PE32 entry point for the PEI core!");
- return EFI_ABORTED;
- }
- //
- // Physical address is FV base + offset of PE32 + offset of the entry point
- //
- PeiCorePhysicalAddress = FvInfo->BaseAddress;
- PeiCorePhysicalAddress += (UINTN) Pe32Section.Pe32Section + sizeof (EFI_SECTION_PE32) - (UINTN) FvImage->FileImage;
- PeiCorePhysicalAddress += EntryPoint;
- DebugMsg (NULL, 0, 9, "PeiCore physical entry point address", "Address = 0x%llX", (unsigned long long) PeiCorePhysicalAddress);
-
- if (MachineType == EFI_IMAGE_MACHINE_ARMT || MachineType == EFI_IMAGE_MACHINE_AARCH64) {
- memset (ResetVector, 0, sizeof (ResetVector));
- // Address of PEI Core, if we have one
- ResetVector[1] = (UINT32)PeiCorePhysicalAddress;
- }
-
- //
- // Copy to the beginning of the FV
- //
- memcpy ((UINT8 *) ((UINTN) FvImage->FileImage), ResetVector, sizeof (ResetVector));
-
- }
-
- return EFI_SUCCESS;
- }
-
- //
- // Sec Core found, now find PE32 section
- //
- Status = GetSectionByType (SecCoreFile, EFI_SECTION_PE32, 1, &Pe32Section);
- if (Status == EFI_NOT_FOUND) {
- Status = GetSectionByType (SecCoreFile, EFI_SECTION_TE, 1, &Pe32Section);
- }
-
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "could not find a PE32 section in the SEC core file.");
- return EFI_ABORTED;
- }
-
- Status = GetPe32Info (
- (VOID *) ((UINTN) Pe32Section.Pe32Section + sizeof (EFI_SECTION_PE32)),
- &EntryPoint,
- &BaseOfCode,
- &MachineType
- );
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "could not get the PE32 entry point for the SEC core.");
- return EFI_ABORTED;
- }
-
- if ((MachineType != EFI_IMAGE_MACHINE_ARMT) && (MachineType != EFI_IMAGE_MACHINE_AARCH64)) {
- //
- // If SEC is not ARM we have nothing to do
- //
- return EFI_SUCCESS;
- }
-
- //
- // Physical address is FV base + offset of PE32 + offset of the entry point
- //
- SecCorePhysicalAddress = FvInfo->BaseAddress;
- SecCorePhysicalAddress += (UINTN) Pe32Section.Pe32Section + sizeof (EFI_SECTION_PE32) - (UINTN) FvImage->FileImage;
- SecCorePhysicalAddress += EntryPoint;
- DebugMsg (NULL, 0, 9, "SecCore physical entry point address", "Address = 0x%llX", (unsigned long long) SecCorePhysicalAddress);
-
- //
- // Find the PEI Core. It may not exist if SEC loads DXE core directly
- //
- PeiCorePhysicalAddress = 0;
- Status = GetFileByType (EFI_FV_FILETYPE_PEI_CORE, 1, &PeiCoreFile);
- if (!EFI_ERROR (Status) && PeiCoreFile != NULL) {
- //
- // PEI Core found, now find PE32 or TE section
- //
- Status = GetSectionByType (PeiCoreFile, EFI_SECTION_PE32, 1, &Pe32Section);
- if (Status == EFI_NOT_FOUND) {
- Status = GetSectionByType (PeiCoreFile, EFI_SECTION_TE, 1, &Pe32Section);
- }
-
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "could not find either a PE32 or a TE section in PEI core file!");
- return EFI_ABORTED;
- }
-
- Status = GetPe32Info (
- (VOID *) ((UINTN) Pe32Section.Pe32Section + sizeof (EFI_SECTION_PE32)),
- &EntryPoint,
- &BaseOfCode,
- &MachineType
- );
-
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "could not get the PE32 entry point for the PEI core!");
- return EFI_ABORTED;
- }
- //
- // Physical address is FV base + offset of PE32 + offset of the entry point
- //
- PeiCorePhysicalAddress = FvInfo->BaseAddress;
- PeiCorePhysicalAddress += (UINTN) Pe32Section.Pe32Section + sizeof (EFI_SECTION_PE32) - (UINTN) FvImage->FileImage;
- PeiCorePhysicalAddress += EntryPoint;
- DebugMsg (NULL, 0, 9, "PeiCore physical entry point address", "Address = 0x%llX", (unsigned long long) PeiCorePhysicalAddress);
- }
-
- if (MachineType == EFI_IMAGE_MACHINE_ARMT) {
- // B SecEntryPoint - signed_immed_24 part +/-32MB offset
- // on ARM, the PC is always 8 ahead, so we're not really jumping from the base address, but from base address + 8
- ResetVector[0] = (INT32)(SecCorePhysicalAddress - FvInfo->BaseAddress - 8) >> 2;
-
- if (ResetVector[0] > 0x00FFFFFF) {
- Error (NULL, 0, 3000, "Invalid", "SEC Entry point must be within 32MB of the start of the FV");
- return EFI_ABORTED;
- }
-
- // Add opcode for an uncondional branch with no link. AKA B SecEntryPoint
- ResetVector[0] |= 0xEB000000;
-
-
- // Address of PEI Core, if we have one
- ResetVector[1] = (UINT32)PeiCorePhysicalAddress;
-
- // SWI handler movs pc,lr. Just in case a debugger uses SWI
- ResetVector[2] = 0xE1B0F07E;
-
- // Place holder to support a common interrupt handler from ROM.
- // Currently not suppprted. For this to be used the reset vector would not be in this FV
- // and the exception vectors would be hard coded in the ROM and just through this address
- // to find a common handler in the a module in the FV.
- ResetVector[3] = 0;
- } else if (MachineType == EFI_IMAGE_MACHINE_AARCH64) {
-
- /* NOTE:
- ARMT above has an entry in ResetVector[2] for SWI. The way we are using the ResetVector
- array at the moment, for AArch64, does not allow us space for this as the header only
- allows for a fixed amount of bytes at the start. If we are sure that UEFI will live
- within the first 4GB of addressable RAM we could potensioally adopt the same ResetVector
- layout as above. But for the moment we replace the four 32bit vectors with two 64bit
- vectors in the same area of the Image heasder. This allows UEFI to start from a 64bit
- base.
- */
-
- ((UINT64*)ResetVector)[0] = (UINT64)(SecCorePhysicalAddress - FvInfo->BaseAddress) >> 2;
-
- // B SecEntryPoint - signed_immed_26 part +/-128MB offset
- if ( ((UINT64*)ResetVector)[0] > 0x03FFFFFF) {
- Error (NULL, 0, 3000, "Invalid", "SEC Entry point must be within 128MB of the start of the FV");
- return EFI_ABORTED;
- }
- // Add opcode for an uncondional branch with no link. AKA B SecEntryPoint
- ((UINT64*)ResetVector)[0] |= 0x14000000;
-
- // Address of PEI Core, if we have one
- ((UINT64*)ResetVector)[1] = (UINT64)PeiCorePhysicalAddress;
-
- } else {
- Error (NULL, 0, 3000, "Invalid", "Unknown ARM machine type");
- return EFI_ABORTED;
- }
-
- //
- // Copy to the beginning of the FV
- //
- memcpy ((UINT8 *) ((UINTN) FvImage->FileImage), ResetVector, sizeof (ResetVector));
-
- DebugMsg (NULL, 0, 9, "Update Reset vector in FV Header", NULL);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetPe32Info (
- IN UINT8 *Pe32,
- OUT UINT32 *EntryPoint,
- OUT UINT32 *BaseOfCode,
- OUT UINT16 *MachineType
- )
-/*++
-
-Routine Description:
-
- Retrieves the PE32 entry point offset and machine type from PE image or TeImage.
- See EfiImage.h for machine types. The entry point offset is from the beginning
- of the PE32 buffer passed in.
-
-Arguments:
-
- Pe32 Beginning of the PE32.
- EntryPoint Offset from the beginning of the PE32 to the image entry point.
- BaseOfCode Base address of code.
- MachineType Magic number for the machine type.
-
-Returns:
-
- EFI_SUCCESS Function completed successfully.
- EFI_ABORTED Error encountered.
- EFI_INVALID_PARAMETER A required parameter was NULL.
- EFI_UNSUPPORTED The operation is unsupported.
-
---*/
-{
- EFI_IMAGE_DOS_HEADER *DosHeader;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *ImgHdr;
- EFI_TE_IMAGE_HEADER *TeHeader;
-
- //
- // Verify input parameters
- //
- if (Pe32 == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // First check whether it is one TE Image.
- //
- TeHeader = (EFI_TE_IMAGE_HEADER *) Pe32;
- if (TeHeader->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- //
- // By TeImage Header to get output
- //
- *EntryPoint = TeHeader->AddressOfEntryPoint + sizeof (EFI_TE_IMAGE_HEADER) - TeHeader->StrippedSize;
- *BaseOfCode = TeHeader->BaseOfCode + sizeof (EFI_TE_IMAGE_HEADER) - TeHeader->StrippedSize;
- *MachineType = TeHeader->Machine;
- } else {
-
- //
- // Then check whether
- // First is the DOS header
- //
- DosHeader = (EFI_IMAGE_DOS_HEADER *) Pe32;
-
- //
- // Verify DOS header is expected
- //
- if (DosHeader->e_magic != EFI_IMAGE_DOS_SIGNATURE) {
- Error (NULL, 0, 3000, "Invalid", "Unknown magic number in the DOS header, 0x%04X.", DosHeader->e_magic);
- return EFI_UNSUPPORTED;
- }
- //
- // Immediately following is the NT header.
- //
- ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *) ((UINTN) Pe32 + DosHeader->e_lfanew);
-
- //
- // Verify NT header is expected
- //
- if (ImgHdr->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) {
- Error (NULL, 0, 3000, "Invalid", "Unrecognized image signature 0x%08X.", (unsigned) ImgHdr->Pe32.Signature);
- return EFI_UNSUPPORTED;
- }
- //
- // Get output
- //
- *EntryPoint = ImgHdr->Pe32.OptionalHeader.AddressOfEntryPoint;
- *BaseOfCode = ImgHdr->Pe32.OptionalHeader.BaseOfCode;
- *MachineType = ImgHdr->Pe32.FileHeader.Machine;
- }
-
- //
- // Verify machine type is supported
- //
- if ((*MachineType != EFI_IMAGE_MACHINE_IA32) && (*MachineType != EFI_IMAGE_MACHINE_IA64) && (*MachineType != EFI_IMAGE_MACHINE_X64) && (*MachineType != EFI_IMAGE_MACHINE_EBC) &&
- (*MachineType != EFI_IMAGE_MACHINE_ARMT) && (*MachineType != EFI_IMAGE_MACHINE_AARCH64)) {
- Error (NULL, 0, 3000, "Invalid", "Unrecognized machine type in the PE32 file.");
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GenerateFvImage (
- IN CHAR8 *InfFileImage,
- IN UINTN InfFileSize,
- IN CHAR8 *FvFileName,
- IN CHAR8 *MapFileName
- )
-/*++
-
-Routine Description:
-
- This is the main function which will be called from application.
-
-Arguments:
-
- InfFileImage Buffer containing the INF file contents.
- InfFileSize Size of the contents of the InfFileImage buffer.
- FvFileName Requested name for the FV file.
- MapFileName Fv map file to log fv driver information.
-
-Returns:
-
- EFI_SUCCESS Function completed successfully.
- EFI_OUT_OF_RESOURCES Could not allocate required resources.
- EFI_ABORTED Error encountered.
- EFI_INVALID_PARAMETER A required parameter was NULL.
-
---*/
-{
- EFI_STATUS Status;
- MEMORY_FILE InfMemoryFile;
- MEMORY_FILE FvImageMemoryFile;
- UINTN Index;
- EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
- EFI_FFS_FILE_HEADER *VtfFileImage;
- UINT8 *FvBufferHeader; // to make sure fvimage header 8 type alignment.
- UINT8 *FvImage;
- UINTN FvImageSize;
- FILE *FvFile;
- CHAR8 FvMapName [_MAX_PATH];
- FILE *FvMapFile;
- EFI_FIRMWARE_VOLUME_EXT_HEADER *FvExtHeader;
- FILE *FvExtHeaderFile;
- UINTN FileSize;
- CHAR8 FvReportName[_MAX_PATH];
- FILE *FvReportFile;
-
- FvBufferHeader = NULL;
- FvFile = NULL;
- FvMapFile = NULL;
- FvReportFile = NULL;
-
- if (InfFileImage != NULL) {
- //
- // Initialize file structures
- //
- InfMemoryFile.FileImage = InfFileImage;
- InfMemoryFile.CurrentFilePointer = InfFileImage;
- InfMemoryFile.Eof = InfFileImage + InfFileSize;
-
- //
- // Parse the FV inf file for header information
- //
- Status = ParseFvInf (&InfMemoryFile, &mFvDataInfo);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "Error parsing file", "the input FV INF file.");
- return Status;
- }
- }
-
- //
- // Update the file name return values
- //
- if (FvFileName == NULL && mFvDataInfo.FvName[0] != '\0') {
- FvFileName = mFvDataInfo.FvName;
- }
-
- if (FvFileName == NULL) {
- Error (NULL, 0, 1001, "Missing option", "Output file name");
- return EFI_ABORTED;
- }
-
- if (mFvDataInfo.FvBlocks[0].Length == 0) {
- Error (NULL, 0, 1001, "Missing required argument", "Block Size");
- return EFI_ABORTED;
- }
-
- //
- // Debug message Fv File System Guid
- //
- if (mFvDataInfo.FvFileSystemGuidSet) {
- DebugMsg (NULL, 0, 9, "FV File System Guid", "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
- (unsigned) mFvDataInfo.FvFileSystemGuid.Data1,
- mFvDataInfo.FvFileSystemGuid.Data2,
- mFvDataInfo.FvFileSystemGuid.Data3,
- mFvDataInfo.FvFileSystemGuid.Data4[0],
- mFvDataInfo.FvFileSystemGuid.Data4[1],
- mFvDataInfo.FvFileSystemGuid.Data4[2],
- mFvDataInfo.FvFileSystemGuid.Data4[3],
- mFvDataInfo.FvFileSystemGuid.Data4[4],
- mFvDataInfo.FvFileSystemGuid.Data4[5],
- mFvDataInfo.FvFileSystemGuid.Data4[6],
- mFvDataInfo.FvFileSystemGuid.Data4[7]);
- }
-
- //
- // Add PI FV extension header
- //
- FvExtHeader = NULL;
- FvExtHeaderFile = NULL;
- if (mFvDataInfo.FvExtHeaderFile[0] != 0) {
- //
- // Open the FV Extension Header file
- //
- FvExtHeaderFile = fopen (mFvDataInfo.FvExtHeaderFile, "rb");
-
- //
- // Get the file size
- //
- FileSize = _filelength (fileno (FvExtHeaderFile));
-
- //
- // Allocate a buffer for the FV Extension Header
- //
- FvExtHeader = malloc(FileSize);
- if (FvExtHeader == NULL) {
- fclose (FvExtHeaderFile);
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Read the FV Extension Header
- //
- fread (FvExtHeader, sizeof (UINT8), FileSize, FvExtHeaderFile);
- fclose (FvExtHeaderFile);
-
- //
- // See if there is an override for the FV Name GUID
- //
- if (mFvDataInfo.FvNameGuidSet) {
- memcpy (&FvExtHeader->FvName, &mFvDataInfo.FvNameGuid, sizeof (EFI_GUID));
- }
- memcpy (&mFvDataInfo.FvNameGuid, &FvExtHeader->FvName, sizeof (EFI_GUID));
- mFvDataInfo.FvNameGuidSet = TRUE;
- } else if (mFvDataInfo.FvNameGuidSet) {
- //
- // Allocate a buffer for the FV Extension Header
- //
- FvExtHeader = malloc(sizeof (EFI_FIRMWARE_VOLUME_EXT_HEADER));
- if (FvExtHeader == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- memcpy (&FvExtHeader->FvName, &mFvDataInfo.FvNameGuid, sizeof (EFI_GUID));
- FvExtHeader->ExtHeaderSize = sizeof (EFI_FIRMWARE_VOLUME_EXT_HEADER);
- }
-
- //
- // Debug message Fv Name Guid
- //
- if (mFvDataInfo.FvNameGuidSet) {
- DebugMsg (NULL, 0, 9, "FV Name Guid", "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
- (unsigned) mFvDataInfo.FvNameGuid.Data1,
- mFvDataInfo.FvNameGuid.Data2,
- mFvDataInfo.FvNameGuid.Data3,
- mFvDataInfo.FvNameGuid.Data4[0],
- mFvDataInfo.FvNameGuid.Data4[1],
- mFvDataInfo.FvNameGuid.Data4[2],
- mFvDataInfo.FvNameGuid.Data4[3],
- mFvDataInfo.FvNameGuid.Data4[4],
- mFvDataInfo.FvNameGuid.Data4[5],
- mFvDataInfo.FvNameGuid.Data4[6],
- mFvDataInfo.FvNameGuid.Data4[7]);
- }
-
- if (CompareGuid (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid) == 0) {
- mFvDataInfo.IsPiFvImage = TRUE;
- }
-
- //
- // FvMap file to log the function address of all modules in one Fvimage
- //
- if (MapFileName != NULL) {
- strcpy (FvMapName, MapFileName);
- } else {
- strcpy (FvMapName, FvFileName);
- strcat (FvMapName, ".map");
- }
- VerboseMsg ("FV Map file name is %s", FvMapName);
-
- //
- // FvReport file to log the FV information in one Fvimage
- //
- strcpy (FvReportName, FvFileName);
- strcat (FvReportName, ".txt");
-
- //
- // Calculate the FV size and Update Fv Size based on the actual FFS files.
- // And Update mFvDataInfo data.
- //
- Status = CalculateFvSize (&mFvDataInfo);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- VerboseMsg ("the generated FV image size is %u bytes", (unsigned) mFvDataInfo.Size);
-
- //
- // support fv image and empty fv image
- //
- FvImageSize = mFvDataInfo.Size;
-
- //
- // Allocate the FV, assure FvImage Header 8 byte alignment
- //
- FvBufferHeader = malloc (FvImageSize + sizeof (UINT64));
- if (FvBufferHeader == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- FvImage = (UINT8 *) (((UINTN) FvBufferHeader + 7) & ~7);
-
- //
- // Initialize the FV to the erase polarity
- //
- if (mFvDataInfo.FvAttributes == 0) {
- //
- // Set Default Fv Attribute
- //
- mFvDataInfo.FvAttributes = FV_DEFAULT_ATTRIBUTE;
- }
- if (mFvDataInfo.FvAttributes & EFI_FVB2_ERASE_POLARITY) {
- memset (FvImage, -1, FvImageSize);
- } else {
- memset (FvImage, 0, FvImageSize);
- }
-
- //
- // Initialize FV header
- //
- FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) FvImage;
-
- //
- // Initialize the zero vector to all zeros.
- //
- memset (FvHeader->ZeroVector, 0, 16);
-
- //
- // Copy the Fv file system GUID
- //
- memcpy (&FvHeader->FileSystemGuid, &mFvDataInfo.FvFileSystemGuid, sizeof (EFI_GUID));
-
- FvHeader->FvLength = FvImageSize;
- FvHeader->Signature = EFI_FVH_SIGNATURE;
- FvHeader->Attributes = mFvDataInfo.FvAttributes;
- FvHeader->Revision = EFI_FVH_REVISION;
- FvHeader->ExtHeaderOffset = 0;
- FvHeader->Reserved[0] = 0;
-
- //
- // Copy firmware block map
- //
- for (Index = 0; mFvDataInfo.FvBlocks[Index].Length != 0; Index++) {
- FvHeader->BlockMap[Index].NumBlocks = mFvDataInfo.FvBlocks[Index].NumBlocks;
- FvHeader->BlockMap[Index].Length = mFvDataInfo.FvBlocks[Index].Length;
- }
-
- //
- // Add block map terminator
- //
- FvHeader->BlockMap[Index].NumBlocks = 0;
- FvHeader->BlockMap[Index].Length = 0;
-
- //
- // Complete the header
- //
- FvHeader->HeaderLength = (UINT16) (((UINTN) &(FvHeader->BlockMap[Index + 1])) - (UINTN) FvImage);
- FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
-
- //
- // If there is no FFS file, generate one empty FV
- //
- if (mFvDataInfo.FvFiles[0][0] == 0 && !mFvDataInfo.FvNameGuidSet) {
- goto WriteFile;
- }
-
- //
- // Initialize our "file" view of the buffer
- //
- FvImageMemoryFile.FileImage = (CHAR8 *)FvImage;
- FvImageMemoryFile.CurrentFilePointer = (CHAR8 *)FvImage + FvHeader->HeaderLength;
- FvImageMemoryFile.Eof = (CHAR8 *)FvImage + FvImageSize;
-
- //
- // Initialize the FV library.
- //
- InitializeFvLib (FvImageMemoryFile.FileImage, FvImageSize);
-
- //
- // Initialize the VTF file address.
- //
- VtfFileImage = (EFI_FFS_FILE_HEADER *) FvImageMemoryFile.Eof;
-
- //
- // Open FvMap file
- //
- FvMapFile = fopen (FvMapName, "w");
- if (FvMapFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", FvMapName);
- return EFI_ABORTED;
- }
-
- //
- // Open FvReport file
- //
- FvReportFile = fopen(FvReportName, "w");
- if (FvReportFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", FvReportName);
- return EFI_ABORTED;
- }
- //
- // record FV size information into FvMap file.
- //
- if (mFvTotalSize != 0) {
- fprintf (FvMapFile, EFI_FV_TOTAL_SIZE_STRING);
- fprintf (FvMapFile, " = 0x%x\n", (unsigned) mFvTotalSize);
- }
- if (mFvTakenSize != 0) {
- fprintf (FvMapFile, EFI_FV_TAKEN_SIZE_STRING);
- fprintf (FvMapFile, " = 0x%x\n", (unsigned) mFvTakenSize);
- }
- if (mFvTotalSize != 0 && mFvTakenSize != 0) {
- fprintf (FvMapFile, EFI_FV_SPACE_SIZE_STRING);
- fprintf (FvMapFile, " = 0x%x\n\n", (unsigned) (mFvTotalSize - mFvTakenSize));
- }
-
- //
- // record FV size information to FvReportFile.
- //
- fprintf (FvReportFile, "%s = 0x%x\n", EFI_FV_TOTAL_SIZE_STRING, (unsigned) mFvTotalSize);
- fprintf (FvReportFile, "%s = 0x%x\n", EFI_FV_TAKEN_SIZE_STRING, (unsigned) mFvTakenSize);
-
- //
- // Add PI FV extension header
- //
- if (FvExtHeader != NULL) {
- //
- // Add FV Extended Header contents to the FV as a PAD file
- //
- AddPadFile (&FvImageMemoryFile, 4, VtfFileImage, FvExtHeader);
-
- //
- // Fv Extension header change update Fv Header Check sum
- //
- FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
- }
-
- //
- // Add files to FV
- //
- for (Index = 0; mFvDataInfo.FvFiles[Index][0] != 0; Index++) {
- //
- // Add the file
- //
- Status = AddFile (&FvImageMemoryFile, &mFvDataInfo, Index, &VtfFileImage, FvMapFile, FvReportFile);
-
- //
- // Exit if error detected while adding the file
- //
- if (EFI_ERROR (Status)) {
- goto Finish;
- }
- }
-
- //
- // If there is a VTF file, some special actions need to occur.
- //
- if ((UINTN) VtfFileImage != (UINTN) FvImageMemoryFile.Eof) {
- //
- // Pad from the end of the last file to the beginning of the VTF file.
- // If the left space is less than sizeof (EFI_FFS_FILE_HEADER)?
- //
- Status = PadFvImage (&FvImageMemoryFile, VtfFileImage);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 4002, "Resource", "FV space is full, cannot add pad file between the last file and the VTF file.");
- goto Finish;
- }
- if (!mArm) {
- //
- // Update reset vector (SALE_ENTRY for IPF)
- // Now for IA32 and IA64 platform, the fv which has bsf file must have the
- // EndAddress of 0xFFFFFFFF. Thus, only this type fv needs to update the
- // reset vector. If the PEI Core is found, the VTF file will probably get
- // corrupted by updating the entry point.
- //
- if ((mFvDataInfo.BaseAddress + mFvDataInfo.Size) == FV_IMAGES_TOP_ADDRESS) {
- Status = UpdateResetVector (&FvImageMemoryFile, &mFvDataInfo, VtfFileImage);
- if (EFI_ERROR(Status)) {
- Error (NULL, 0, 3000, "Invalid", "Could not update the reset vector.");
- goto Finish;
- }
- DebugMsg (NULL, 0, 9, "Update Reset vector in VTF file", NULL);
- }
- }
- }
-
- if (mArm) {
- Status = UpdateArmResetVectorIfNeeded (&FvImageMemoryFile, &mFvDataInfo);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "Could not update the reset vector.");
- goto Finish;
- }
-
- //
- // Update Checksum for FvHeader
- //
- FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
- }
-
- //
- // Update FV Alignment attribute to the largest alignment of all the FFS files in the FV
- //
- if ((((FvHeader->Attributes & EFI_FVB2_ALIGNMENT) >> 16)) < MaxFfsAlignment) {
- FvHeader->Attributes = ((MaxFfsAlignment << 16) | (FvHeader->Attributes & 0xFFFF));
- //
- // Update Checksum for FvHeader
- //
- FvHeader->Checksum = 0;
- FvHeader->Checksum = CalculateChecksum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
- }
-
-WriteFile:
- //
- // Write fv file
- //
- FvFile = fopen (FvFileName, "wb");
- if (FvFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", FvFileName);
- Status = EFI_ABORTED;
- goto Finish;
- }
-
- if (fwrite (FvImage, 1, FvImageSize, FvFile) != FvImageSize) {
- Error (NULL, 0, 0002, "Error writing file", FvFileName);
- Status = EFI_ABORTED;
- goto Finish;
- }
-
-Finish:
- if (FvBufferHeader != NULL) {
- free (FvBufferHeader);
- }
-
- if (FvExtHeader != NULL) {
- free (FvExtHeader);
- }
-
- if (FvFile != NULL) {
- fflush (FvFile);
- fclose (FvFile);
- }
-
- if (FvMapFile != NULL) {
- fflush (FvMapFile);
- fclose (FvMapFile);
- }
-
- if (FvReportFile != NULL) {
- fflush (FvReportFile);
- fclose (FvReportFile);
- }
- return Status;
-}
-
-EFI_STATUS
-UpdatePeiCoreEntryInFit (
- IN FIT_TABLE *FitTablePtr,
- IN UINT64 PeiCorePhysicalAddress
- )
-/*++
-
-Routine Description:
-
- This function is used to update the Pei Core address in FIT, this can be used by Sec core to pass control from
- Sec to Pei Core
-
-Arguments:
-
- FitTablePtr - The pointer of FIT_TABLE.
- PeiCorePhysicalAddress - The address of Pei Core entry.
-
-Returns:
-
- EFI_SUCCESS - The PEI_CORE FIT entry was updated successfully.
- EFI_NOT_FOUND - Not found the PEI_CORE FIT entry.
-
---*/
-{
- FIT_TABLE *TmpFitPtr;
- UINTN Index;
- UINTN NumFitComponents;
-
- TmpFitPtr = FitTablePtr;
- NumFitComponents = TmpFitPtr->CompSize;
-
- for (Index = 0; Index < NumFitComponents; Index++) {
- if ((TmpFitPtr->CvAndType & FIT_TYPE_MASK) == COMP_TYPE_FIT_PEICORE) {
- TmpFitPtr->CompAddress = PeiCorePhysicalAddress;
- return EFI_SUCCESS;
- }
-
- TmpFitPtr++;
- }
-
- return EFI_NOT_FOUND;
-}
-
-VOID
-UpdateFitCheckSum (
- IN FIT_TABLE *FitTablePtr
- )
-/*++
-
-Routine Description:
-
- This function is used to update the checksum for FIT.
-
-
-Arguments:
-
- FitTablePtr - The pointer of FIT_TABLE.
-
-Returns:
-
- None.
-
---*/
-{
- if ((FitTablePtr->CvAndType & CHECKSUM_BIT_MASK) >> 7) {
- FitTablePtr->CheckSum = 0;
- FitTablePtr->CheckSum = CalculateChecksum8 ((UINT8 *) FitTablePtr, FitTablePtr->CompSize * 16);
- }
-}
-
-EFI_STATUS
-CalculateFvSize (
- FV_INFO *FvInfoPtr
- )
-/*++
-Routine Description:
- Calculate the FV size and Update Fv Size based on the actual FFS files.
- And Update FvInfo data.
-
-Arguments:
- FvInfoPtr - The pointer to FV_INFO structure.
-
-Returns:
- EFI_ABORTED - Ffs Image Error
- EFI_SUCCESS - Successfully update FvSize
---*/
-{
- UINTN CurrentOffset;
- UINTN Index;
- FILE *fpin;
- UINTN FfsFileSize;
- UINTN FvExtendHeaderSize;
- UINT32 FfsAlignment;
- EFI_FFS_FILE_HEADER FfsHeader;
- BOOLEAN VtfFileFlag;
- UINTN VtfFileSize;
-
- FvExtendHeaderSize = 0;
- VtfFileSize = 0;
- VtfFileFlag = FALSE;
- fpin = NULL;
- Index = 0;
-
- //
- // Compute size for easy access later
- //
- FvInfoPtr->Size = 0;
- for (Index = 0; FvInfoPtr->FvBlocks[Index].NumBlocks > 0 && FvInfoPtr->FvBlocks[Index].Length > 0; Index++) {
- FvInfoPtr->Size += FvInfoPtr->FvBlocks[Index].NumBlocks * FvInfoPtr->FvBlocks[Index].Length;
- }
-
- //
- // Caculate the required sizes for all FFS files.
- //
- CurrentOffset = sizeof (EFI_FIRMWARE_VOLUME_HEADER);
-
- for (Index = 1;; Index ++) {
- CurrentOffset += sizeof (EFI_FV_BLOCK_MAP_ENTRY);
- if (FvInfoPtr->FvBlocks[Index].NumBlocks == 0 || FvInfoPtr->FvBlocks[Index].Length == 0) {
- break;
- }
- }
-
- //
- // Calculate PI extension header
- //
- if (mFvDataInfo.FvExtHeaderFile[0] != '\0') {
- fpin = fopen (mFvDataInfo.FvExtHeaderFile, "rb");
- if (fpin == NULL) {
- Error (NULL, 0, 0001, "Error opening file", mFvDataInfo.FvExtHeaderFile);
- return EFI_ABORTED;
- }
- FvExtendHeaderSize = _filelength (fileno (fpin));
- fclose (fpin);
- CurrentOffset += sizeof (EFI_FFS_FILE_HEADER) + FvExtendHeaderSize;
- CurrentOffset = (CurrentOffset + 7) & (~7);
- } else if (mFvDataInfo.FvNameGuidSet) {
- CurrentOffset += sizeof (EFI_FFS_FILE_HEADER) + sizeof (EFI_FIRMWARE_VOLUME_EXT_HEADER);
- CurrentOffset = (CurrentOffset + 7) & (~7);
- }
-
- //
- // Accumlate every FFS file size.
- //
- for (Index = 0; FvInfoPtr->FvFiles[Index][0] != 0; Index++) {
- //
- // Open FFS file
- //
- fpin = NULL;
- fpin = fopen (FvInfoPtr->FvFiles[Index], "rb");
- if (fpin == NULL) {
- Error (NULL, 0, 0001, "Error opening file", FvInfoPtr->FvFiles[Index]);
- return EFI_ABORTED;
- }
- //
- // Get the file size
- //
- FfsFileSize = _filelength (fileno (fpin));
- //
- // Read Ffs File header
- //
- fread (&FfsHeader, sizeof (UINT8), sizeof (EFI_FFS_FILE_HEADER), fpin);
- //
- // close file
- //
- fclose (fpin);
-
- if (FvInfoPtr->IsPiFvImage) {
- //
- // Check whether this ffs file is vtf file
- //
- if (IsVtfFile (&FfsHeader)) {
- if (VtfFileFlag) {
- //
- // One Fv image can't have two vtf files.
- //
- return EFI_ABORTED;
- }
- VtfFileFlag = TRUE;
- VtfFileSize = FfsFileSize;
- continue;
- }
-
- //
- // Get the alignment of FFS file
- //
- ReadFfsAlignment (&FfsHeader, &FfsAlignment);
- FfsAlignment = 1 << FfsAlignment;
- //
- // Add Pad file
- //
- if (((CurrentOffset + sizeof (EFI_FFS_FILE_HEADER)) % FfsAlignment) != 0) {
- CurrentOffset = (CurrentOffset + sizeof (EFI_FFS_FILE_HEADER) * 2 + FfsAlignment - 1) & ~(FfsAlignment - 1);
- CurrentOffset -= sizeof (EFI_FFS_FILE_HEADER);
- }
- }
-
- //
- // Add ffs file size
- //
- if (FvInfoPtr->SizeofFvFiles[Index] > FfsFileSize) {
- CurrentOffset += FvInfoPtr->SizeofFvFiles[Index];
- } else {
- CurrentOffset += FfsFileSize;
- }
-
- //
- // Make next ffs file start at QWord Boundry
- //
- if (FvInfoPtr->IsPiFvImage) {
- CurrentOffset = (CurrentOffset + EFI_FFS_FILE_HEADER_ALIGNMENT - 1) & ~(EFI_FFS_FILE_HEADER_ALIGNMENT - 1);
- }
- }
- CurrentOffset += VtfFileSize;
- DebugMsg (NULL, 0, 9, "FvImage size", "The caculated fv image size is 0x%x and the current set fv image size is 0x%x", (unsigned) CurrentOffset, (unsigned) FvInfoPtr->Size);
-
- if (FvInfoPtr->Size == 0) {
- //
- // Update FvInfo data
- //
- FvInfoPtr->FvBlocks[0].NumBlocks = CurrentOffset / FvInfoPtr->FvBlocks[0].Length + ((CurrentOffset % FvInfoPtr->FvBlocks[0].Length)?1:0);
- FvInfoPtr->Size = FvInfoPtr->FvBlocks[0].NumBlocks * FvInfoPtr->FvBlocks[0].Length;
- FvInfoPtr->FvBlocks[1].NumBlocks = 0;
- FvInfoPtr->FvBlocks[1].Length = 0;
- } else if (FvInfoPtr->Size < CurrentOffset) {
- //
- // Not invalid
- //
- Error (NULL, 0, 3000, "Invalid", "the required fv image size 0x%x exceeds the set fv image size 0x%x", (unsigned) CurrentOffset, (unsigned) FvInfoPtr->Size);
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Set Fv Size Information
- //
- mFvTotalSize = FvInfoPtr->Size;
- mFvTakenSize = CurrentOffset;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-FfsRebaseImageRead (
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINT32 *ReadSize,
- OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file
-
-Arguments:
-
- FileHandle - The handle to the PE/COFF file
-
- FileOffset - The offset, in bytes, into the file to read
-
- ReadSize - The number of bytes to read from the file starting at FileOffset
-
- Buffer - A pointer to the buffer to read the data into.
-
-Returns:
-
- EFI_SUCCESS - ReadSize bytes of data were read into Buffer from the PE/COFF file starting at FileOffset
-
---*/
-{
- CHAR8 *Destination8;
- CHAR8 *Source8;
- UINT32 Length;
-
- Destination8 = Buffer;
- Source8 = (CHAR8 *) ((UINTN) FileHandle + FileOffset);
- Length = *ReadSize;
- while (Length--) {
- *(Destination8++) = *(Source8++);
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetChildFvFromFfs (
- IN FV_INFO *FvInfo,
- IN EFI_FFS_FILE_HEADER *FfsFile,
- IN UINTN XipOffset
- )
-/*++
-
-Routine Description:
-
- This function gets all child FvImages in the input FfsFile, and records
- their base address to the parent image.
-
-Arguments:
- FvInfo A pointer to FV_INFO struture.
- FfsFile A pointer to Ffs file image that may contain FvImage.
- XipOffset The offset address to the parent FvImage base.
-
-Returns:
-
- EFI_SUCCESS Base address of child Fv image is recorded.
---*/
-{
- EFI_STATUS Status;
- UINTN Index;
- EFI_FILE_SECTION_POINTER SubFvSection;
- EFI_FIRMWARE_VOLUME_HEADER *SubFvImageHeader;
- EFI_PHYSICAL_ADDRESS SubFvBaseAddress;
-
- for (Index = 1;; Index++) {
- //
- // Find FV section
- //
- Status = GetSectionByType (FfsFile, EFI_SECTION_FIRMWARE_VOLUME_IMAGE, Index, &SubFvSection);
- if (EFI_ERROR (Status)) {
- break;
- }
- SubFvImageHeader = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINT8 *) SubFvSection.FVImageSection + sizeof (EFI_FIRMWARE_VOLUME_IMAGE_SECTION));
- //
- // Rebase on Flash
- //
- SubFvBaseAddress = FvInfo->BaseAddress + (UINTN) SubFvImageHeader - (UINTN) FfsFile + XipOffset;
- mFvBaseAddress[mFvBaseAddressNumber ++ ] = SubFvBaseAddress;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-FfsRebase (
- IN OUT FV_INFO *FvInfo,
- IN CHAR8 *FileName,
- IN OUT EFI_FFS_FILE_HEADER *FfsFile,
- IN UINTN XipOffset,
- IN FILE *FvMapFile
- )
-/*++
-
-Routine Description:
-
- This function determines if a file is XIP and should be rebased. It will
- rebase any PE32 sections found in the file using the base address.
-
-Arguments:
-
- FvInfo A pointer to FV_INFO struture.
- FileName Ffs File PathName
- FfsFile A pointer to Ffs file image.
- XipOffset The offset address to use for rebasing the XIP file image.
- FvMapFile FvMapFile to record the function address in one Fvimage
-
-Returns:
-
- EFI_SUCCESS The image was properly rebased.
- EFI_INVALID_PARAMETER An input parameter is invalid.
- EFI_ABORTED An error occurred while rebasing the input file image.
- EFI_OUT_OF_RESOURCES Could not allocate a required resource.
- EFI_NOT_FOUND No compressed sections could be found.
-
---*/
-{
- EFI_STATUS Status;
- PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
- PE_COFF_LOADER_IMAGE_CONTEXT OrigImageContext;
- EFI_PHYSICAL_ADDRESS XipBase;
- EFI_PHYSICAL_ADDRESS NewPe32BaseAddress;
- UINTN Index;
- EFI_FILE_SECTION_POINTER CurrentPe32Section;
- EFI_FFS_FILE_STATE SavedState;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *ImgHdr;
- EFI_TE_IMAGE_HEADER *TEImageHeader;
- UINT8 *MemoryImagePointer;
- EFI_IMAGE_SECTION_HEADER *SectionHeader;
- CHAR8 PeFileName [_MAX_PATH];
- CHAR8 *Cptr;
- FILE *PeFile;
- UINT8 *PeFileBuffer;
- UINT32 PeFileSize;
- CHAR8 *PdbPointer;
-
- Index = 0;
- MemoryImagePointer = NULL;
- TEImageHeader = NULL;
- ImgHdr = NULL;
- SectionHeader = NULL;
- Cptr = NULL;
- PeFile = NULL;
- PeFileBuffer = NULL;
-
- //
- // Don't need to relocate image when BaseAddress is zero and no ForceRebase Flag specified.
- //
- if ((FvInfo->BaseAddress == 0) && (FvInfo->ForceRebase == -1)) {
- return EFI_SUCCESS;
- }
-
- //
- // If ForceRebase Flag specified to FALSE, will always not take rebase action.
- //
- if (FvInfo->ForceRebase == 0) {
- return EFI_SUCCESS;
- }
-
-
- XipBase = FvInfo->BaseAddress + XipOffset;
-
- //
- // We only process files potentially containing PE32 sections.
- //
- switch (FfsFile->Type) {
- case EFI_FV_FILETYPE_SECURITY_CORE:
- case EFI_FV_FILETYPE_PEI_CORE:
- case EFI_FV_FILETYPE_PEIM:
- case EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER:
- case EFI_FV_FILETYPE_DRIVER:
- case EFI_FV_FILETYPE_DXE_CORE:
- break;
- case EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE:
- //
- // Rebase the inside FvImage.
- //
- GetChildFvFromFfs (FvInfo, FfsFile, XipOffset);
-
- //
- // Search PE/TE section in FV sectin.
- //
- break;
- default:
- return EFI_SUCCESS;
- }
- //
- // Rebase each PE32 section
- //
- Status = EFI_SUCCESS;
- for (Index = 1;; Index++) {
- //
- // Init Value
- //
- NewPe32BaseAddress = 0;
-
- //
- // Find Pe Image
- //
- Status = GetSectionByType (FfsFile, EFI_SECTION_PE32, Index, &CurrentPe32Section);
- if (EFI_ERROR (Status)) {
- break;
- }
-
- //
- // Initialize context
- //
- memset (&ImageContext, 0, sizeof (ImageContext));
- ImageContext.Handle = (VOID *) ((UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION));
- ImageContext.ImageRead = (PE_COFF_LOADER_READ_FILE) FfsRebaseImageRead;
- Status = PeCoffLoaderGetImageInfo (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid PeImage", "The input file is %s and the return status is %x", FileName, (int) Status);
- return Status;
- }
-
- if ( (ImageContext.Machine == EFI_IMAGE_MACHINE_ARMT) ||
- (ImageContext.Machine == EFI_IMAGE_MACHINE_AARCH64) ) {
- mArm = TRUE;
- }
-
- //
- // Keep Image Context for PE image in FV
- //
- memcpy (&OrigImageContext, &ImageContext, sizeof (ImageContext));
-
- //
- // Get File PdbPointer
- //
- PdbPointer = PeCoffLoaderGetPdbPointer (ImageContext.Handle);
-
- //
- // Get PeHeader pointer
- //
- ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)((UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION) + ImageContext.PeCoffHeaderOffset);
-
- //
- // Calculate the PE32 base address, based on file type
- //
- switch (FfsFile->Type) {
- case EFI_FV_FILETYPE_SECURITY_CORE:
- case EFI_FV_FILETYPE_PEI_CORE:
- case EFI_FV_FILETYPE_PEIM:
- case EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER:
- //
- // Check if section-alignment and file-alignment match or not
- //
- if ((ImgHdr->Pe32.OptionalHeader.SectionAlignment != ImgHdr->Pe32.OptionalHeader.FileAlignment)) {
- //
- // Xip module has the same section alignment and file alignment.
- //
- Error (NULL, 0, 3000, "Invalid", "Section-Alignment and File-Alignment do not match : %s.", FileName);
- return EFI_ABORTED;
- }
- //
- // PeImage has no reloc section. It will try to get reloc data from the original EFI image.
- //
- if (ImageContext.RelocationsStripped) {
- //
- // Construct the original efi file Name
- //
- strcpy (PeFileName, FileName);
- Cptr = PeFileName + strlen (PeFileName);
- while (*Cptr != '.') {
- Cptr --;
- }
- if (*Cptr != '.') {
- Error (NULL, 0, 3000, "Invalid", "The file %s has no .reloc section.", FileName);
- return EFI_ABORTED;
- } else {
- *(Cptr + 1) = 'e';
- *(Cptr + 2) = 'f';
- *(Cptr + 3) = 'i';
- *(Cptr + 4) = '\0';
- }
- PeFile = fopen (PeFileName, "rb");
- if (PeFile == NULL) {
- Warning (NULL, 0, 0, "Invalid", "The file %s has no .reloc section.", FileName);
- //Error (NULL, 0, 3000, "Invalid", "The file %s has no .reloc section.", FileName);
- //return EFI_ABORTED;
- break;
- }
- //
- // Get the file size
- //
- PeFileSize = _filelength (fileno (PeFile));
- PeFileBuffer = (UINT8 *) malloc (PeFileSize);
- if (PeFileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated on rebase of %s", FileName);
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // Read Pe File
- //
- fread (PeFileBuffer, sizeof (UINT8), PeFileSize, PeFile);
- //
- // close file
- //
- fclose (PeFile);
- //
- // Handle pointer to the original efi image.
- //
- ImageContext.Handle = PeFileBuffer;
- Status = PeCoffLoaderGetImageInfo (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid PeImage", "The input file is %s and the return status is %x", FileName, (int) Status);
- return Status;
- }
- ImageContext.RelocationsStripped = FALSE;
- }
-
- NewPe32BaseAddress = XipBase + (UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION) - (UINTN)FfsFile;
- break;
-
- case EFI_FV_FILETYPE_DRIVER:
- case EFI_FV_FILETYPE_DXE_CORE:
- //
- // Check if section-alignment and file-alignment match or not
- //
- if ((ImgHdr->Pe32.OptionalHeader.SectionAlignment != ImgHdr->Pe32.OptionalHeader.FileAlignment)) {
- //
- // Xip module has the same section alignment and file alignment.
- //
- Error (NULL, 0, 3000, "Invalid", "Section-Alignment and File-Alignment do not match : %s.", FileName);
- return EFI_ABORTED;
- }
- NewPe32BaseAddress = XipBase + (UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION) - (UINTN)FfsFile;
- break;
-
- default:
- //
- // Not supported file type
- //
- return EFI_SUCCESS;
- }
-
- //
- // Relocation doesn't exist
- //
- if (ImageContext.RelocationsStripped) {
- Warning (NULL, 0, 0, "Invalid", "The file %s has no .reloc section.", FileName);
- continue;
- }
-
- //
- // Relocation exist and rebase
- //
- //
- // Load and Relocate Image Data
- //
- MemoryImagePointer = (UINT8 *) malloc ((UINTN) ImageContext.ImageSize + ImageContext.SectionAlignment);
- if (MemoryImagePointer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated on rebase of %s", FileName);
- return EFI_OUT_OF_RESOURCES;
- }
- memset ((VOID *) MemoryImagePointer, 0, (UINTN) ImageContext.ImageSize + ImageContext.SectionAlignment);
- ImageContext.ImageAddress = ((UINTN) MemoryImagePointer + ImageContext.SectionAlignment - 1) & (~((UINTN) ImageContext.SectionAlignment - 1));
-
- Status = PeCoffLoaderLoadImage (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "LocateImage() call failed on rebase of %s", FileName);
- free ((VOID *) MemoryImagePointer);
- return Status;
- }
-
- ImageContext.DestinationAddress = NewPe32BaseAddress;
- Status = PeCoffLoaderRelocateImage (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "RelocateImage() call failed on rebase of %s", FileName);
- free ((VOID *) MemoryImagePointer);
- return Status;
- }
-
- //
- // Copy Relocated data to raw image file.
- //
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (
- (UINTN) ImgHdr +
- sizeof (UINT32) +
- sizeof (EFI_IMAGE_FILE_HEADER) +
- ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader
- );
-
- for (Index = 0; Index < ImgHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) {
- CopyMem (
- (UINT8 *) CurrentPe32Section.Pe32Section + sizeof (EFI_COMMON_SECTION_HEADER) + SectionHeader->PointerToRawData,
- (VOID*) (UINTN) (ImageContext.ImageAddress + SectionHeader->VirtualAddress),
- SectionHeader->SizeOfRawData
- );
- }
-
- free ((VOID *) MemoryImagePointer);
- MemoryImagePointer = NULL;
- if (PeFileBuffer != NULL) {
- free (PeFileBuffer);
- PeFileBuffer = NULL;
- }
-
- //
- // Update Image Base Address
- //
- if (ImgHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- ImgHdr->Pe32.OptionalHeader.ImageBase = (UINT32) NewPe32BaseAddress;
- } else if (ImgHdr->Pe32Plus.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- ImgHdr->Pe32Plus.OptionalHeader.ImageBase = NewPe32BaseAddress;
- } else {
- Error (NULL, 0, 3000, "Invalid", "unknown PE magic signature %X in PE32 image %s",
- ImgHdr->Pe32.OptionalHeader.Magic,
- FileName
- );
- return EFI_ABORTED;
- }
-
- //
- // Now update file checksum
- //
- if (FfsFile->Attributes & FFS_ATTRIB_CHECKSUM) {
- SavedState = FfsFile->State;
- FfsFile->IntegrityCheck.Checksum.File = 0;
- FfsFile->State = 0;
- FfsFile->IntegrityCheck.Checksum.File = CalculateChecksum8 (
- (UINT8 *) (FfsFile + 1),
- GetLength (FfsFile->Size) - sizeof (EFI_FFS_FILE_HEADER)
- );
- FfsFile->State = SavedState;
- }
-
- //
- // Get this module function address from ModulePeMapFile and add them into FvMap file
- //
-
- //
- // Default use FileName as map file path
- //
- if (PdbPointer == NULL) {
- PdbPointer = FileName;
- }
-
- WriteMapFile (FvMapFile, PdbPointer, FfsFile, NewPe32BaseAddress, &OrigImageContext);
- }
-
- if (FfsFile->Type != EFI_FV_FILETYPE_SECURITY_CORE &&
- FfsFile->Type != EFI_FV_FILETYPE_PEI_CORE &&
- FfsFile->Type != EFI_FV_FILETYPE_PEIM &&
- FfsFile->Type != EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER &&
- FfsFile->Type != EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
- ) {
- //
- // Only Peim code may have a TE section
- //
- return EFI_SUCCESS;
- }
-
- //
- // Now process TE sections
- //
- for (Index = 1;; Index++) {
- NewPe32BaseAddress = 0;
-
- //
- // Find Te Image
- //
- Status = GetSectionByType (FfsFile, EFI_SECTION_TE, Index, &CurrentPe32Section);
- if (EFI_ERROR (Status)) {
- break;
- }
-
- //
- // Calculate the TE base address, the FFS file base plus the offset of the TE section less the size stripped off
- // by GenTEImage
- //
- TEImageHeader = (EFI_TE_IMAGE_HEADER *) ((UINT8 *) CurrentPe32Section.Pe32Section + sizeof (EFI_COMMON_SECTION_HEADER));
-
- //
- // Initialize context, load image info.
- //
- memset (&ImageContext, 0, sizeof (ImageContext));
- ImageContext.Handle = (VOID *) TEImageHeader;
- ImageContext.ImageRead = (PE_COFF_LOADER_READ_FILE) FfsRebaseImageRead;
- Status = PeCoffLoaderGetImageInfo (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid TeImage", "The input file is %s and the return status is %x", FileName, (int) Status);
- return Status;
- }
-
- if ( (ImageContext.Machine == EFI_IMAGE_MACHINE_ARMT) ||
- (ImageContext.Machine == EFI_IMAGE_MACHINE_AARCH64) ) {
- mArm = TRUE;
- }
-
- //
- // Keep Image Context for TE image in FV
- //
- memcpy (&OrigImageContext, &ImageContext, sizeof (ImageContext));
-
- //
- // Get File PdbPointer
- //
- PdbPointer = PeCoffLoaderGetPdbPointer (ImageContext.Handle);
-
- //
- // Set new rebased address.
- //
- NewPe32BaseAddress = XipBase + (UINTN) TEImageHeader + sizeof (EFI_TE_IMAGE_HEADER) \
- - TEImageHeader->StrippedSize - (UINTN) FfsFile;
-
- //
- // if reloc is stripped, try to get the original efi image to get reloc info.
- //
- if (ImageContext.RelocationsStripped) {
- //
- // Construct the original efi file name
- //
- strcpy (PeFileName, FileName);
- Cptr = PeFileName + strlen (PeFileName);
- while (*Cptr != '.') {
- Cptr --;
- }
-
- if (*Cptr != '.') {
- Error (NULL, 0, 3000, "Invalid", "The file %s has no .reloc section.", FileName);
- return EFI_ABORTED;
- } else {
- *(Cptr + 1) = 'e';
- *(Cptr + 2) = 'f';
- *(Cptr + 3) = 'i';
- *(Cptr + 4) = '\0';
- }
-
- PeFile = fopen (PeFileName, "rb");
- if (PeFile == NULL) {
- Warning (NULL, 0, 0, "Invalid", "The file %s has no .reloc section.", FileName);
- //Error (NULL, 0, 3000, "Invalid", "The file %s has no .reloc section.", FileName);
- //return EFI_ABORTED;
- } else {
- //
- // Get the file size
- //
- PeFileSize = _filelength (fileno (PeFile));
- PeFileBuffer = (UINT8 *) malloc (PeFileSize);
- if (PeFileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated on rebase of %s", FileName);
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // Read Pe File
- //
- fread (PeFileBuffer, sizeof (UINT8), PeFileSize, PeFile);
- //
- // close file
- //
- fclose (PeFile);
- //
- // Append reloc section into TeImage
- //
- ImageContext.Handle = PeFileBuffer;
- Status = PeCoffLoaderGetImageInfo (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid TeImage", "The input file is %s and the return status is %x", FileName, (int) Status);
- return Status;
- }
- ImageContext.RelocationsStripped = FALSE;
- }
- }
- //
- // Relocation doesn't exist
- //
- if (ImageContext.RelocationsStripped) {
- Warning (NULL, 0, 0, "Invalid", "The file %s has no .reloc section.", FileName);
- continue;
- }
-
- //
- // Relocation exist and rebase
- //
- //
- // Load and Relocate Image Data
- //
- MemoryImagePointer = (UINT8 *) malloc ((UINTN) ImageContext.ImageSize + ImageContext.SectionAlignment);
- if (MemoryImagePointer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated on rebase of %s", FileName);
- return EFI_OUT_OF_RESOURCES;
- }
- memset ((VOID *) MemoryImagePointer, 0, (UINTN) ImageContext.ImageSize + ImageContext.SectionAlignment);
- ImageContext.ImageAddress = ((UINTN) MemoryImagePointer + ImageContext.SectionAlignment - 1) & (~((UINTN) ImageContext.SectionAlignment - 1));
-
- Status = PeCoffLoaderLoadImage (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "LocateImage() call failed on rebase of %s", FileName);
- free ((VOID *) MemoryImagePointer);
- return Status;
- }
- //
- // Reloacate TeImage
- //
- ImageContext.DestinationAddress = NewPe32BaseAddress;
- Status = PeCoffLoaderRelocateImage (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "RelocateImage() call failed on rebase of TE image %s", FileName);
- free ((VOID *) MemoryImagePointer);
- return Status;
- }
-
- //
- // Copy the relocated image into raw image file.
- //
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (TEImageHeader + 1);
- for (Index = 0; Index < TEImageHeader->NumberOfSections; Index ++, SectionHeader ++) {
- if (!ImageContext.IsTeImage) {
- CopyMem (
- (UINT8 *) TEImageHeader + sizeof (EFI_TE_IMAGE_HEADER) - TEImageHeader->StrippedSize + SectionHeader->PointerToRawData,
- (VOID*) (UINTN) (ImageContext.ImageAddress + SectionHeader->VirtualAddress),
- SectionHeader->SizeOfRawData
- );
- } else {
- CopyMem (
- (UINT8 *) TEImageHeader + sizeof (EFI_TE_IMAGE_HEADER) - TEImageHeader->StrippedSize + SectionHeader->PointerToRawData,
- (VOID*) (UINTN) (ImageContext.ImageAddress + sizeof (EFI_TE_IMAGE_HEADER) - TEImageHeader->StrippedSize + SectionHeader->VirtualAddress),
- SectionHeader->SizeOfRawData
- );
- }
- }
-
- //
- // Free the allocated memory resource
- //
- free ((VOID *) MemoryImagePointer);
- MemoryImagePointer = NULL;
- if (PeFileBuffer != NULL) {
- free (PeFileBuffer);
- PeFileBuffer = NULL;
- }
-
- //
- // Update Image Base Address
- //
- TEImageHeader->ImageBase = NewPe32BaseAddress;
-
- //
- // Now update file checksum
- //
- if (FfsFile->Attributes & FFS_ATTRIB_CHECKSUM) {
- SavedState = FfsFile->State;
- FfsFile->IntegrityCheck.Checksum.File = 0;
- FfsFile->State = 0;
- FfsFile->IntegrityCheck.Checksum.File = CalculateChecksum8 (
- (UINT8 *)(FfsFile + 1),
- GetLength (FfsFile->Size) - sizeof (EFI_FFS_FILE_HEADER)
- );
- FfsFile->State = SavedState;
- }
- //
- // Get this module function address from ModulePeMapFile and add them into FvMap file
- //
-
- //
- // Default use FileName as map file path
- //
- if (PdbPointer == NULL) {
- PdbPointer = FileName;
- }
-
- WriteMapFile (
- FvMapFile,
- PdbPointer,
- FfsFile,
- NewPe32BaseAddress,
- &OrigImageContext
- );
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-FindApResetVectorPosition (
- IN MEMORY_FILE *FvImage,
- OUT UINT8 **Pointer
- )
-/*++
-
-Routine Description:
-
- Find the position in this FvImage to place Ap reset vector.
-
-Arguments:
-
- FvImage Memory file for the FV memory image.
- Pointer Pointer to pointer to position.
-
-Returns:
-
- EFI_NOT_FOUND - No satisfied position is found.
- EFI_SUCCESS - The suitable position is return.
-
---*/
-{
- EFI_FFS_FILE_HEADER *PadFile;
- UINT32 Index;
- EFI_STATUS Status;
- UINT8 *FixPoint;
- UINT32 FileLength;
-
- for (Index = 1; ;Index ++) {
- //
- // Find Pad File to add ApResetVector info
- //
- Status = GetFileByType (EFI_FV_FILETYPE_FFS_PAD, Index, &PadFile);
- if (EFI_ERROR (Status) || (PadFile == NULL)) {
- //
- // No Pad file to be found.
- //
- break;
- }
- //
- // Get Pad file size.
- //
- FileLength = (*(UINT32 *)(PadFile->Size)) & 0x00FFFFFF;
- FileLength = (FileLength + EFI_FFS_FILE_HEADER_ALIGNMENT - 1) & ~(EFI_FFS_FILE_HEADER_ALIGNMENT - 1);
- //
- // FixPoint must be align on 0x1000 relative to FvImage Header
- //
- FixPoint = (UINT8*) PadFile + sizeof (EFI_FFS_FILE_HEADER);
- FixPoint = FixPoint + 0x1000 - (((UINTN) FixPoint - (UINTN) FvImage->FileImage) & 0xFFF);
- //
- // FixPoint be larger at the last place of one fv image.
- //
- while (((UINTN) FixPoint + SIZEOF_STARTUP_DATA_ARRAY - (UINTN) PadFile) <= FileLength) {
- FixPoint += 0x1000;
- }
- FixPoint -= 0x1000;
-
- if ((UINTN) FixPoint < ((UINTN) PadFile + sizeof (EFI_FFS_FILE_HEADER))) {
- //
- // No alignment FixPoint in this Pad File.
- //
- continue;
- }
-
- if ((UINTN) FvImage->Eof - (UINTN)FixPoint <= 0x20000) {
- //
- // Find the position to place ApResetVector
- //
- *Pointer = FixPoint;
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-EFI_STATUS
-ParseCapInf (
- IN MEMORY_FILE *InfFile,
- OUT CAP_INFO *CapInfo
- )
-/*++
-
-Routine Description:
-
- This function parses a Cap.INF file and copies info into a CAP_INFO structure.
-
-Arguments:
-
- InfFile Memory file image.
- CapInfo Information read from INF file.
-
-Returns:
-
- EFI_SUCCESS INF file information successfully retrieved.
- EFI_ABORTED INF file has an invalid format.
- EFI_NOT_FOUND A required string was not found in the INF file.
---*/
-{
- CHAR8 Value[_MAX_PATH];
- UINT64 Value64;
- UINTN Index, Number;
- EFI_STATUS Status;
-
- //
- // Initialize Cap info
- //
- // memset (CapInfo, 0, sizeof (CAP_INFO));
- //
-
- //
- // Read the Capsule Guid
- //
- Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_CAPSULE_GUID_STRING, 0, Value);
- if (Status == EFI_SUCCESS) {
- //
- // Get the Capsule Guid
- //
- Status = StringToGuid (Value, &CapInfo->CapGuid);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid parameter", "%s = %s", EFI_CAPSULE_GUID_STRING, Value);
- return EFI_ABORTED;
- }
- DebugMsg (NULL, 0, 9, "Capsule Guid", "%s = %s", EFI_CAPSULE_GUID_STRING, Value);
- }
-
- //
- // Read the Capsule Header Size
- //
- Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_CAPSULE_HEADER_SIZE_STRING, 0, Value);
- if (Status == EFI_SUCCESS) {
- Status = AsciiStringToUint64 (Value, FALSE, &Value64);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 2000, "Invalid parameter", "%s = %s", EFI_CAPSULE_HEADER_SIZE_STRING, Value);
- return EFI_ABORTED;
- }
- CapInfo->HeaderSize = (UINT32) Value64;
- DebugMsg (NULL, 0, 9, "Capsule Header size", "%s = %s", EFI_CAPSULE_HEADER_SIZE_STRING, Value);
- }
-
- //
- // Read the Capsule Flag
- //
- Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_CAPSULE_FLAGS_STRING, 0, Value);
- if (Status == EFI_SUCCESS) {
- if (strstr (Value, "PopulateSystemTable") != NULL) {
- CapInfo->Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE;
- if (strstr (Value, "InitiateReset") != NULL) {
- CapInfo->Flags |= CAPSULE_FLAGS_INITIATE_RESET;
- }
- } else if (strstr (Value, "PersistAcrossReset") != NULL) {
- CapInfo->Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET;
- if (strstr (Value, "InitiateReset") != NULL) {
- CapInfo->Flags |= CAPSULE_FLAGS_INITIATE_RESET;
- }
- } else {
- Error (NULL, 0, 2000, "Invalid parameter", "invalid Flag setting for %s.", EFI_CAPSULE_FLAGS_STRING);
- return EFI_ABORTED;
- }
- DebugMsg (NULL, 0, 9, "Capsule Flag", Value);
- }
-
- //
- // Read Capsule File name
- //
- Status = FindToken (InfFile, OPTIONS_SECTION_STRING, EFI_FILE_NAME_STRING, 0, Value);
- if (Status == EFI_SUCCESS) {
- //
- // Get output file name
- //
- strcpy (CapInfo->CapName, Value);
- }
-
- //
- // Read the Capsule FileImage
- //
- Number = 0;
- for (Index = 0; Index < MAX_NUMBER_OF_FILES_IN_CAP; Index++) {
- if (CapInfo->CapFiles[Index][0] != '\0') {
- continue;
- }
- //
- // Read the capsule file name
- //
- Status = FindToken (InfFile, FILES_SECTION_STRING, EFI_FILE_NAME_STRING, Number++, Value);
-
- if (Status == EFI_SUCCESS) {
- //
- // Add the file
- //
- strcpy (CapInfo->CapFiles[Index], Value);
- DebugMsg (NULL, 0, 9, "Capsule component file", "the %uth file name is %s", (unsigned) Index, CapInfo->CapFiles[Index]);
- } else {
- break;
- }
- }
-
- if (Index == 0) {
- Warning (NULL, 0, 0, "Capsule components are not specified.", NULL);
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GenerateCapImage (
- IN CHAR8 *InfFileImage,
- IN UINTN InfFileSize,
- IN CHAR8 *CapFileName
- )
-/*++
-
-Routine Description:
-
- This is the main function which will be called from application to create UEFI Capsule image.
-
-Arguments:
-
- InfFileImage Buffer containing the INF file contents.
- InfFileSize Size of the contents of the InfFileImage buffer.
- CapFileName Requested name for the Cap file.
-
-Returns:
-
- EFI_SUCCESS Function completed successfully.
- EFI_OUT_OF_RESOURCES Could not allocate required resources.
- EFI_ABORTED Error encountered.
- EFI_INVALID_PARAMETER A required parameter was NULL.
-
---*/
-{
- UINT32 CapSize;
- UINT8 *CapBuffer;
- EFI_CAPSULE_HEADER *CapsuleHeader;
- MEMORY_FILE InfMemoryFile;
- UINT32 FileSize;
- UINT32 Index;
- FILE *fpin, *fpout;
- EFI_STATUS Status;
-
- if (InfFileImage != NULL) {
- //
- // Initialize file structures
- //
- InfMemoryFile.FileImage = InfFileImage;
- InfMemoryFile.CurrentFilePointer = InfFileImage;
- InfMemoryFile.Eof = InfFileImage + InfFileSize;
-
- //
- // Parse the Cap inf file for header information
- //
- Status = ParseCapInf (&InfMemoryFile, &mCapDataInfo);
- if (Status != EFI_SUCCESS) {
- return Status;
- }
- }
-
- if (mCapDataInfo.HeaderSize == 0) {
- //
- // make header size align 16 bytes.
- //
- mCapDataInfo.HeaderSize = sizeof (EFI_CAPSULE_HEADER);
- mCapDataInfo.HeaderSize = (mCapDataInfo.HeaderSize + 0xF) & ~0xF;
- }
-
- if (mCapDataInfo.HeaderSize < sizeof (EFI_CAPSULE_HEADER)) {
- Error (NULL, 0, 2000, "Invalid parameter", "The specified HeaderSize cannot be less than the size of EFI_CAPSULE_HEADER.");
- return EFI_INVALID_PARAMETER;
- }
-
- if (CapFileName == NULL && mCapDataInfo.CapName[0] != '\0') {
- CapFileName = mCapDataInfo.CapName;
- }
-
- if (CapFileName == NULL) {
- Error (NULL, 0, 2001, "Missing required argument", "Output Capsule file name");
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Set Default Capsule Guid value
- //
- if (CompareGuid (&mCapDataInfo.CapGuid, &mZeroGuid) == 0) {
- memcpy (&mCapDataInfo.CapGuid, &mDefaultCapsuleGuid, sizeof (EFI_GUID));
- }
- //
- // Calculate the size of capsule image.
- //
- Index = 0;
- FileSize = 0;
- CapSize = mCapDataInfo.HeaderSize;
- while (mCapDataInfo.CapFiles [Index][0] != '\0') {
- fpin = fopen (mCapDataInfo.CapFiles[Index], "rb");
- if (fpin == NULL) {
- Error (NULL, 0, 0001, "Error opening file", mCapDataInfo.CapFiles[Index]);
- return EFI_ABORTED;
- }
- FileSize = _filelength (fileno (fpin));
- CapSize += FileSize;
- fclose (fpin);
- Index ++;
- }
-
- //
- // Allocate buffer for capsule image.
- //
- CapBuffer = (UINT8 *) malloc (CapSize);
- if (CapBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated for creating the capsule.");
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Initialize the capsule header to zero
- //
- memset (CapBuffer, 0, mCapDataInfo.HeaderSize);
-
- //
- // create capsule header and get capsule body
- //
- CapsuleHeader = (EFI_CAPSULE_HEADER *) CapBuffer;
- memcpy (&CapsuleHeader->CapsuleGuid, &mCapDataInfo.CapGuid, sizeof (EFI_GUID));
- CapsuleHeader->HeaderSize = mCapDataInfo.HeaderSize;
- CapsuleHeader->Flags = mCapDataInfo.Flags;
- CapsuleHeader->CapsuleImageSize = CapSize;
-
- Index = 0;
- FileSize = 0;
- CapSize = CapsuleHeader->HeaderSize;
- while (mCapDataInfo.CapFiles [Index][0] != '\0') {
- fpin = fopen (mCapDataInfo.CapFiles[Index], "rb");
- if (fpin == NULL) {
- Error (NULL, 0, 0001, "Error opening file", mCapDataInfo.CapFiles[Index]);
- free (CapBuffer);
- return EFI_ABORTED;
- }
- FileSize = _filelength (fileno (fpin));
- fread (CapBuffer + CapSize, 1, FileSize, fpin);
- fclose (fpin);
- Index ++;
- CapSize += FileSize;
- }
-
- //
- // write capsule data into the output file
- //
- fpout = fopen (CapFileName, "wb");
- if (fpout == NULL) {
- Error (NULL, 0, 0001, "Error opening file", CapFileName);
- free (CapBuffer);
- return EFI_ABORTED;
- }
-
- fwrite (CapBuffer, 1, CapSize, fpout);
- fclose (fpout);
-
- VerboseMsg ("The size of the generated capsule image is %u bytes", (unsigned) CapSize);
-
- return EFI_SUCCESS;
-}
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.h b/BaseTools/Source/C/GenFv/GenFvInternalLib.h
deleted file mode 100644
index 40c23600ab..0000000000
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- GenFvInternalLib.h
-
-Abstract:
-
- This file contains describes the public interfaces to the GenFvImage Library.
- The basic purpose of the library is to create Firmware Volume images.
-
-**/
-
-#ifndef _EFI_GEN_FV_INTERNAL_LIB_H
-#define _EFI_GEN_FV_INTERNAL_LIB_H
-
-//
-// Include files
-//
-#include <stdlib.h>
-
-#include <Common/UefiBaseTypes.h>
-#include <Common/UefiCapsule.h>
-
-#include <Common/PiFirmwareFile.h>
-#include <Common/PiFirmwareVolume.h>
-#include <Guid/PiFirmwareFileSystem.h>
-#include <IndustryStandard/PeImage.h>
-
-#include "CommonLib.h"
-#include "ParseInf.h"
-#include "EfiUtilityMsgs.h"
-
-//
-// Different file separater for Linux and Windows
-//
-#define FILE_SEP_CHAR '/'
-
-//
-// The maximum number of Pad file guid entries.
-//
-#define MAX_NUMBER_OF_PAD_FILE_GUIDS 1024
-
-//
-// The maximum number of block map entries supported by the library
-//
-#define MAX_NUMBER_OF_FV_BLOCKS 100
-
-//
-// The maximum number of files in the FV supported by the library
-//
-#define MAX_NUMBER_OF_FILES_IN_FV 1000
-#define MAX_NUMBER_OF_FILES_IN_CAP 1000
-#define EFI_FFS_FILE_HEADER_ALIGNMENT 8
-//
-// INF file strings
-//
-#define OPTIONS_SECTION_STRING "[options]"
-#define ATTRIBUTES_SECTION_STRING "[attributes]"
-#define FILES_SECTION_STRING "[files]"
-#define FV_BASE_ADDRESS_STRING "[FV_BASE_ADDRESS]"
-
-//
-// Options section
-//
-#define EFI_FV_BASE_ADDRESS_STRING "EFI_BASE_ADDRESS"
-#define EFI_FV_FILE_NAME_STRING "EFI_FILE_NAME"
-#define EFI_NUM_BLOCKS_STRING "EFI_NUM_BLOCKS"
-#define EFI_BLOCK_SIZE_STRING "EFI_BLOCK_SIZE"
-#define EFI_GUID_STRING "EFI_GUID"
-#define EFI_FV_FILESYSTEMGUID_STRING "EFI_FV_GUID"
-#define EFI_FV_NAMEGUID_STRING "EFI_FVNAME_GUID"
-#define EFI_CAPSULE_GUID_STRING "EFI_CAPSULE_GUID"
-#define EFI_CAPSULE_HEADER_SIZE_STRING "EFI_CAPSULE_HEADER_SIZE"
-#define EFI_CAPSULE_FLAGS_STRING "EFI_CAPSULE_FLAGS"
-#define EFI_CAPSULE_VERSION_STRING "EFI_CAPSULE_VERSION"
-
-#define EFI_FV_TOTAL_SIZE_STRING "EFI_FV_TOTAL_SIZE"
-#define EFI_FV_TAKEN_SIZE_STRING "EFI_FV_TAKEN_SIZE"
-#define EFI_FV_SPACE_SIZE_STRING "EFI_FV_SPACE_SIZE"
-
-//
-// Attributes section
-//
-#define EFI_FVB2_READ_DISABLED_CAP_STRING "EFI_READ_DISABLED_CAP"
-#define EFI_FVB2_READ_ENABLED_CAP_STRING "EFI_READ_ENABLED_CAP"
-#define EFI_FVB2_READ_STATUS_STRING "EFI_READ_STATUS"
-
-#define EFI_FVB2_WRITE_DISABLED_CAP_STRING "EFI_WRITE_DISABLED_CAP"
-#define EFI_FVB2_WRITE_ENABLED_CAP_STRING "EFI_WRITE_ENABLED_CAP"
-#define EFI_FVB2_WRITE_STATUS_STRING "EFI_WRITE_STATUS"
-
-#define EFI_FVB2_LOCK_CAP_STRING "EFI_LOCK_CAP"
-#define EFI_FVB2_LOCK_STATUS_STRING "EFI_LOCK_STATUS"
-
-#define EFI_FVB2_STICKY_WRITE_STRING "EFI_STICKY_WRITE"
-#define EFI_FVB2_MEMORY_MAPPED_STRING "EFI_MEMORY_MAPPED"
-#define EFI_FVB2_ERASE_POLARITY_STRING "EFI_ERASE_POLARITY"
-
-#define EFI_FVB2_READ_LOCK_CAP_STRING "EFI_READ_LOCK_CAP"
-#define EFI_FVB2_READ_LOCK_STATUS_STRING "EFI_READ_LOCK_STATUS"
-#define EFI_FVB2_WRITE_LOCK_CAP_STRING "EFI_WRITE_LOCK_CAP"
-#define EFI_FVB2_WRITE_LOCK_STATUS_STRING "EFI_WRITE_LOCK_STATUS"
-
-#define EFI_FVB2_ALIGNMENT_1_STRING "EFI_FVB2_ALIGNMENT_1"
-#define EFI_FVB2_ALIGNMENT_2_STRING "EFI_FVB2_ALIGNMENT_2"
-#define EFI_FVB2_ALIGNMENT_4_STRING "EFI_FVB2_ALIGNMENT_4"
-#define EFI_FVB2_ALIGNMENT_8_STRING "EFI_FVB2_ALIGNMENT_8"
-#define EFI_FVB2_ALIGNMENT_16_STRING "EFI_FVB2_ALIGNMENT_16"
-#define EFI_FVB2_ALIGNMENT_32_STRING "EFI_FVB2_ALIGNMENT_32"
-#define EFI_FVB2_ALIGNMENT_64_STRING "EFI_FVB2_ALIGNMENT_64"
-#define EFI_FVB2_ALIGNMENT_128_STRING "EFI_FVB2_ALIGNMENT_128"
-#define EFI_FVB2_ALIGNMENT_256_STRING "EFI_FVB2_ALIGNMENT_256"
-#define EFI_FVB2_ALIGNMENT_512_STRING "EFI_FVB2_ALIGNMENT_512"
-#define EFI_FVB2_ALIGNMENT_1K_STRING "EFI_FVB2_ALIGNMENT_1K"
-#define EFI_FVB2_ALIGNMENT_2K_STRING "EFI_FVB2_ALIGNMENT_2K"
-#define EFI_FVB2_ALIGNMENT_4K_STRING "EFI_FVB2_ALIGNMENT_4K"
-#define EFI_FVB2_ALIGNMENT_8K_STRING "EFI_FVB2_ALIGNMENT_8K"
-#define EFI_FVB2_ALIGNMENT_16K_STRING "EFI_FVB2_ALIGNMENT_16K"
-#define EFI_FVB2_ALIGNMENT_32K_STRING "EFI_FVB2_ALIGNMENT_32K"
-#define EFI_FVB2_ALIGNMENT_64K_STRING "EFI_FVB2_ALIGNMENT_64K"
-#define EFI_FVB2_ALIGNMENT_128K_STRING "EFI_FVB2_ALIGNMENT_128K"
-#define EFI_FVB2_ALIGNMENT_256K_STRING "EFI_FVB2_ALIGNMENT_256K"
-#define EFI_FVB2_ALIGNMENT_512K_STRING "EFI_FVB2_ALIGNMENT_512K"
-#define EFI_FVB2_ALIGNMENT_1M_STRING "EFI_FVB2_ALIGNMENT_1M"
-#define EFI_FVB2_ALIGNMENT_2M_STRING "EFI_FVB2_ALIGNMENT_2M"
-#define EFI_FVB2_ALIGNMENT_4M_STRING "EFI_FVB2_ALIGNMENT_4M"
-#define EFI_FVB2_ALIGNMENT_8M_STRING "EFI_FVB2_ALIGNMENT_8M"
-#define EFI_FVB2_ALIGNMENT_16M_STRING "EFI_FVB2_ALIGNMENT_16M"
-#define EFI_FVB2_ALIGNMENT_32M_STRING "EFI_FVB2_ALIGNMENT_32M"
-#define EFI_FVB2_ALIGNMENT_64M_STRING "EFI_FVB2_ALIGNMENT_64M"
-#define EFI_FVB2_ALIGNMENT_128M_STRING "EFI_FVB2_ALIGNMENT_128M"
-#define EFI_FVB2_ALIGNMENT_256M_STRING "EFI_FVB2_ALIGNMENT_256M"
-#define EFI_FVB2_ALIGNMENT_512M_STRING "EFI_FVB2_ALIGNMENT_512M"
-#define EFI_FVB2_ALIGNMENT_1G_STRING "EFI_FVB2_ALIGNMENT_1G"
-#define EFI_FVB2_ALIGNMENT_2G_STRING "EFI_FVB2_ALIGNMENT_2G"
-
-//
-// File sections
-//
-#define EFI_FILE_NAME_STRING "EFI_FILE_NAME"
-
-#define ONE_STRING "1"
-#define ZERO_STRING "0"
-#define TRUE_STRING "TRUE"
-#define FALSE_STRING "FALSE"
-#define NULL_STRING "NULL"
-
-//
-//
-//
-#define EFI_FV_EXT_HEADER_FILE_NAME "EFI_FV_EXT_HEADER_FILE_NAME"
-
-
-//
-// VTF (Firmware Volume Top File) signatures
-//
-#define IA32_X64_VTF_SIGNATURE_OFFSET 0x14
-#define IA32_X64_VTF0_SIGNATURE EFI_SIGNATURE_32('V','T','F',0)
-
-//
-// Defines to calculate the offset for PEI CORE entry points
-//
-#define IA32_PEI_CORE_ENTRY_OFFSET 0x20
-
-//
-// Defines to calculate the offset for IA32 SEC CORE entry point
-//
-#define IA32_SEC_CORE_ENTRY_OFFSET 0xD
-
-//
-// Defines to calculate the FIT table
-//
-#define IPF_FIT_ADDRESS_OFFSET 0x20
-
-//
-// Defines to calculate the offset for SALE_ENTRY
-//
-#define IPF_SALE_ENTRY_ADDRESS_OFFSET 0x18
-
-//
-// Symbol file definitions, current max size if 512K
-//
-#define SYMBOL_FILE_SIZE 0x80000
-
-#define FV_IMAGES_TOP_ADDRESS 0x100000000ULL
-
-//
-// Following definition is used for FIT in IPF
-//
-#define COMP_TYPE_FIT_PEICORE 0x10
-#define COMP_TYPE_FIT_UNUSED 0x7F
-
-#define FIT_TYPE_MASK 0x7F
-#define CHECKSUM_BIT_MASK 0x80
-
-//
-// Private data types
-//
-//
-// Component information
-//
-typedef struct {
- UINTN Size;
- CHAR8 ComponentName[_MAX_PATH];
-} COMPONENT_INFO;
-
-//
-// FV and capsule information holder
-//
-typedef struct {
- BOOLEAN BaseAddressSet;
- EFI_PHYSICAL_ADDRESS BaseAddress;
- EFI_GUID FvFileSystemGuid;
- BOOLEAN FvFileSystemGuidSet;
- EFI_GUID FvNameGuid;
- BOOLEAN FvNameGuidSet;
- CHAR8 FvExtHeaderFile[_MAX_PATH];
- UINTN Size;
- EFI_FVB_ATTRIBUTES_2 FvAttributes;
- CHAR8 FvName[_MAX_PATH];
- EFI_FV_BLOCK_MAP_ENTRY FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];
- CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];
- UINT32 SizeofFvFiles[MAX_NUMBER_OF_FILES_IN_FV];
- BOOLEAN IsPiFvImage;
- INT8 ForceRebase;
-} FV_INFO;
-
-typedef struct {
- EFI_GUID CapGuid;
- UINT32 HeaderSize;
- UINT32 Flags;
- CHAR8 CapName[_MAX_PATH];
- CHAR8 CapFiles[MAX_NUMBER_OF_FILES_IN_CAP][_MAX_PATH];
-} CAP_INFO;
-
-#pragma pack(1)
-
-typedef struct {
- UINT64 CompAddress;
- UINT32 CompSize;
- UINT16 CompVersion;
- UINT8 CvAndType;
- UINT8 CheckSum;
-} FIT_TABLE;
-
-#pragma pack()
-
-#define FV_DEFAULT_ATTRIBUTE 0x0004FEFF
-extern FV_INFO mFvDataInfo;
-extern CAP_INFO mCapDataInfo;
-extern EFI_GUID mEfiFirmwareFileSystem2Guid;
-extern UINT32 mFvTotalSize;
-extern UINT32 mFvTakenSize;
-
-extern EFI_PHYSICAL_ADDRESS mFvBaseAddress[];
-extern UINT32 mFvBaseAddressNumber;
-//
-// Local function prototypes
-//
-EFI_STATUS
-ParseFvInf (
- IN MEMORY_FILE *InfFile,
- OUT FV_INFO *FvInfo
- )
-;
-
-EFI_STATUS
-UpdatePeiCoreEntryInFit (
- IN FIT_TABLE *FitTablePtr,
- IN UINT64 PeiCorePhysicalAddress
- )
-/*++
-
-Routine Description:
-
- This function is used to update the Pei Core address in FIT, this can be used by Sec core to pass control from
- Sec to Pei Core
-
-Arguments:
-
- FitTablePtr - The pointer of FIT_TABLE.
- PeiCorePhysicalAddress - The address of Pei Core entry.
-
-Returns:
-
- EFI_SUCCESS - The PEI_CORE FIT entry was updated successfully.
- EFI_NOT_FOUND - Not found the PEI_CORE FIT entry.
-
---*/
-;
-
-VOID
-UpdateFitCheckSum (
- IN FIT_TABLE *FitTablePtr
- )
-/*++
-
-Routine Description:
-
- This function is used to update the checksum for FIT.
-
-
-Arguments:
-
- FitTablePtr - The pointer of FIT_TABLE.
-
-Returns:
-
- None.
-
---*/
-;
-
-EFI_STATUS
-GetPe32Info (
- IN UINT8 *Pe32,
- OUT UINT32 *EntryPoint,
- OUT UINT32 *BaseOfCode,
- OUT UINT16 *MachineType
- );
-
-EFI_STATUS
-ParseCapInf (
- IN MEMORY_FILE *InfFile,
- OUT CAP_INFO *CapInfo
- );
-
-EFI_STATUS
-FindApResetVectorPosition (
- IN MEMORY_FILE *FvImage,
- OUT UINT8 **Pointer
- );
-
-EFI_STATUS
-CalculateFvSize (
- FV_INFO *FvInfoPtr
- );
-
-EFI_STATUS
-FfsRebase (
- IN OUT FV_INFO *FvInfo,
- IN CHAR8 *FileName,
- IN OUT EFI_FFS_FILE_HEADER *FfsFile,
- IN UINTN XipOffset,
- IN FILE *FvMapFile
- );
-
-//
-// Exported function prototypes
-//
-EFI_STATUS
-GenerateCapImage (
- IN CHAR8 *InfFileImage,
- IN UINTN InfFileSize,
- IN CHAR8 *CapFileName
- )
-/*++
-
-Routine Description:
-
- This is the main function which will be called from application to
- generate UEFI Capsule image.
-
-Arguments:
-
- InfFileImage Buffer containing the INF file contents.
- InfFileSize Size of the contents of the InfFileImage buffer.
- CapFileName Requested name for the Cap file.
-
-Returns:
-
- EFI_SUCCESS Function completed successfully.
- EFI_OUT_OF_RESOURCES Could not allocate required resources.
- EFI_ABORTED Error encountered.
- EFI_INVALID_PARAMETER A required parameter was NULL.
-
---*/
-;
-
-EFI_STATUS
-GenerateFvImage (
- IN CHAR8 *InfFileImage,
- IN UINTN InfFileSize,
- IN CHAR8 *FvFileName,
- IN CHAR8 *MapFileName
- )
-/*++
-
-Routine Description:
-
- This is the main function which will be called from application to
- generate Firmware Image conforms to PI spec.
-
-Arguments:
-
- InfFileImage Buffer containing the INF file contents.
- InfFileSize Size of the contents of the InfFileImage buffer.
- FvFileName Requested name for the FV file.
- MapFileName Fv map file to log fv driver information.
-
-Returns:
-
- EFI_SUCCESS Function completed successfully.
- EFI_OUT_OF_RESOURCES Could not allocate required resources.
- EFI_ABORTED Error encountered.
- EFI_INVALID_PARAMETER A required parameter was NULL.
-
---*/
-;
-
-#endif
diff --git a/BaseTools/Source/C/GenFv/Makefile b/BaseTools/Source/C/GenFv/Makefile
deleted file mode 100644
index 5442174893..0000000000
--- a/BaseTools/Source/C/GenFv/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'GenFv' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = GenFv
-
-LIBS = $(LIB_PATH)\Common.lib RpcRT4.lib
-
-OBJECTS = GenFv.obj GenFvInternalLib.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c b/BaseTools/Source/C/GenFw/Elf32Convert.c
deleted file mode 100644
index ddb45acc86..0000000000
--- a/BaseTools/Source/C/GenFw/Elf32Convert.c
+++ /dev/null
@@ -1,1029 +0,0 @@
-/** @file
-
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
-
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "WinNtInclude.h"
-
-#ifndef __GNUC__
-#include <windows.h>
-#include <io.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-
-#include <Common/UefiBaseTypes.h>
-#include <IndustryStandard/PeImage.h>
-
-#include "PeCoffLib.h"
-#include "EfiUtilityMsgs.h"
-
-#include "GenFw.h"
-#include "ElfConvert.h"
-#include "Elf32Convert.h"
-
-STATIC
-VOID
-ScanSections32 (
- VOID
- );
-
-STATIC
-BOOLEAN
-WriteSections32 (
- SECTION_FILTER_TYPES FilterType
- );
-
-STATIC
-VOID
-WriteRelocations32 (
- VOID
- );
-
-STATIC
-VOID
-WriteDebug32 (
- VOID
- );
-
-STATIC
-VOID
-SetImageSize32 (
- VOID
- );
-
-STATIC
-VOID
-CleanUp32 (
- VOID
- );
-
-//
-// Rename ELF32 strucutres to common names to help when porting to ELF64.
-//
-typedef Elf32_Shdr Elf_Shdr;
-typedef Elf32_Ehdr Elf_Ehdr;
-typedef Elf32_Rel Elf_Rel;
-typedef Elf32_Sym Elf_Sym;
-typedef Elf32_Phdr Elf_Phdr;
-typedef Elf32_Dyn Elf_Dyn;
-#define ELFCLASS ELFCLASS32
-#define ELF_R_TYPE(r) ELF32_R_TYPE(r)
-#define ELF_R_SYM(r) ELF32_R_SYM(r)
-
-//
-// Well known ELF structures.
-//
-STATIC Elf_Ehdr *mEhdr;
-STATIC Elf_Shdr *mShdrBase;
-STATIC Elf_Phdr *mPhdrBase;
-
-//
-// Coff information
-//
-STATIC const UINT32 mCoffAlignment = 0x20;
-
-//
-// PE section alignment.
-//
-STATIC const UINT16 mCoffNbrSections = 5;
-
-//
-// ELF sections to offset in Coff file.
-//
-STATIC UINT32 *mCoffSectionsOffset = NULL;
-
-//
-// Offsets in COFF file
-//
-STATIC UINT32 mNtHdrOffset;
-STATIC UINT32 mTextOffset;
-STATIC UINT32 mDataOffset;
-STATIC UINT32 mHiiRsrcOffset;
-STATIC UINT32 mRelocOffset;
-
-//
-// Initialization Function
-//
-BOOLEAN
-InitializeElf32 (
- UINT8 *FileBuffer,
- ELF_FUNCTION_TABLE *ElfFunctions
- )
-{
- //
- // Initialize data pointer and structures.
- //
- mEhdr = (Elf_Ehdr*) FileBuffer;
-
- //
- // Check the ELF32 specific header information.
- //
- if (mEhdr->e_ident[EI_CLASS] != ELFCLASS32) {
- Error (NULL, 0, 3000, "Unsupported", "ELF EI_DATA not ELFCLASS32");
- return FALSE;
- }
- if (mEhdr->e_ident[EI_DATA] != ELFDATA2LSB) {
- Error (NULL, 0, 3000, "Unsupported", "ELF EI_DATA not ELFDATA2LSB");
- return FALSE;
- }
- if ((mEhdr->e_type != ET_EXEC) && (mEhdr->e_type != ET_DYN)) {
- Error (NULL, 0, 3000, "Unsupported", "ELF e_type not ET_EXEC or ET_DYN");
- return FALSE;
- }
- if (!((mEhdr->e_machine == EM_386) || (mEhdr->e_machine == EM_ARM))) {
- Error (NULL, 0, 3000, "Unsupported", "ELF e_machine not EM_386 or EM_ARM");
- return FALSE;
- }
- if (mEhdr->e_version != EV_CURRENT) {
- Error (NULL, 0, 3000, "Unsupported", "ELF e_version (%u) not EV_CURRENT (%d)", (unsigned) mEhdr->e_version, EV_CURRENT);
- return FALSE;
- }
-
- //
- // Update section header pointers
- //
- mShdrBase = (Elf_Shdr *)((UINT8 *)mEhdr + mEhdr->e_shoff);
- mPhdrBase = (Elf_Phdr *)((UINT8 *)mEhdr + mEhdr->e_phoff);
-
- //
- // Create COFF Section offset buffer and zero.
- //
- mCoffSectionsOffset = (UINT32 *)malloc(mEhdr->e_shnum * sizeof (UINT32));
- memset(mCoffSectionsOffset, 0, mEhdr->e_shnum * sizeof(UINT32));
-
- //
- // Fill in function pointers.
- //
- ElfFunctions->ScanSections = ScanSections32;
- ElfFunctions->WriteSections = WriteSections32;
- ElfFunctions->WriteRelocations = WriteRelocations32;
- ElfFunctions->WriteDebug = WriteDebug32;
- ElfFunctions->SetImageSize = SetImageSize32;
- ElfFunctions->CleanUp = CleanUp32;
-
- return TRUE;
-}
-
-
-//
-// Header by Index functions
-//
-STATIC
-Elf_Shdr*
-GetShdrByIndex (
- UINT32 Num
- )
-{
- if (Num >= mEhdr->e_shnum)
- return NULL;
- return (Elf_Shdr*)((UINT8*)mShdrBase + Num * mEhdr->e_shentsize);
-}
-
-STATIC
-Elf_Phdr*
-GetPhdrByIndex (
- UINT32 num
- )
-{
- if (num >= mEhdr->e_phnum) {
- return NULL;
- }
-
- return (Elf_Phdr *)((UINT8*)mPhdrBase + num * mEhdr->e_phentsize);
-}
-
-STATIC
-UINT32
-CoffAlign (
- UINT32 Offset
- )
-{
- return (Offset + mCoffAlignment - 1) & ~(mCoffAlignment - 1);
-}
-
-//
-// filter functions
-//
-STATIC
-BOOLEAN
-IsTextShdr (
- Elf_Shdr *Shdr
- )
-{
- return (BOOLEAN) ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == SHF_ALLOC);
-}
-
-STATIC
-BOOLEAN
-IsHiiRsrcShdr (
- Elf_Shdr *Shdr
- )
-{
- Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
-
- return (BOOLEAN) (strcmp((CHAR8*)mEhdr + Namedr->sh_offset + Shdr->sh_name, ELF_HII_SECTION_NAME) == 0);
-}
-
-STATIC
-BOOLEAN
-IsDataShdr (
- Elf_Shdr *Shdr
- )
-{
- if (IsHiiRsrcShdr(Shdr)) {
- return FALSE;
- }
- return (BOOLEAN) (Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == (SHF_ALLOC | SHF_WRITE);
-}
-
-//
-// Elf functions interface implementation
-//
-
-STATIC
-VOID
-ScanSections32 (
- VOID
- )
-{
- UINT32 i;
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
- UINT32 CoffEntry;
- UINT32 SectionCount;
-
- CoffEntry = 0;
- mCoffOffset = 0;
-
- //
- // Coff file start with a DOS header.
- //
- mCoffOffset = sizeof(EFI_IMAGE_DOS_HEADER) + 0x40;
- mNtHdrOffset = mCoffOffset;
- switch (mEhdr->e_machine) {
- case EM_386:
- case EM_ARM:
- mCoffOffset += sizeof (EFI_IMAGE_NT_HEADERS32);
- break;
- default:
- VerboseMsg ("%s unknown e_machine type. Assume IA-32", (UINTN)mEhdr->e_machine);
- mCoffOffset += sizeof (EFI_IMAGE_NT_HEADERS32);
- break;
- }
-
- mTableOffset = mCoffOffset;
- mCoffOffset += mCoffNbrSections * sizeof(EFI_IMAGE_SECTION_HEADER);
-
- //
- // First text sections.
- //
- mCoffOffset = CoffAlign(mCoffOffset);
- mTextOffset = mCoffOffset;
- SectionCount = 0;
- for (i = 0; i < mEhdr->e_shnum; i++) {
- Elf_Shdr *shdr = GetShdrByIndex(i);
- if (IsTextShdr(shdr)) {
- if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
- // the alignment field is valid
- if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
- // if the section address is aligned we must align PE/COFF
- mCoffOffset = (mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1);
- } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % shdr->sh_addralign)) {
- // ARM RVCT tools have behavior outside of the ELF specification to try
- // and make images smaller. If sh_addr is not aligned to sh_addralign
- // then the section needs to preserve sh_addr MOD sh_addralign.
- // Normally doing nothing here works great.
- Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
- }
- }
-
- /* Relocate entry. */
- if ((mEhdr->e_entry >= shdr->sh_addr) &&
- (mEhdr->e_entry < shdr->sh_addr + shdr->sh_size)) {
- CoffEntry = mCoffOffset + mEhdr->e_entry - shdr->sh_addr;
- }
- mCoffSectionsOffset[i] = mCoffOffset;
- mCoffOffset += shdr->sh_size;
- SectionCount ++;
- }
- }
-
- if (mEhdr->e_machine != EM_ARM) {
- mCoffOffset = CoffAlign(mCoffOffset);
- }
-
- if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
- Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 text section. Source level debug might not work correctly.", mInImageName);
- }
-
- //
- // Then data sections.
- //
- mDataOffset = mCoffOffset;
- SectionCount = 0;
- for (i = 0; i < mEhdr->e_shnum; i++) {
- Elf_Shdr *shdr = GetShdrByIndex(i);
- if (IsDataShdr(shdr)) {
- if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
- // the alignment field is valid
- if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
- // if the section address is aligned we must align PE/COFF
- mCoffOffset = (mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1);
- } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % shdr->sh_addralign)) {
- // ARM RVCT tools have behavior outside of the ELF specification to try
- // and make images smaller. If sh_addr is not aligned to sh_addralign
- // then the section needs to preserve sh_addr MOD sh_addralign.
- // Normally doing nothing here works great.
- Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
- }
- }
- mCoffSectionsOffset[i] = mCoffOffset;
- mCoffOffset += shdr->sh_size;
- SectionCount ++;
- }
- }
- mCoffOffset = CoffAlign(mCoffOffset);
-
- if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
- Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 data section. Source level debug might not work correctly.", mInImageName);
- }
-
- //
- // The HII resource sections.
- //
- mHiiRsrcOffset = mCoffOffset;
- for (i = 0; i < mEhdr->e_shnum; i++) {
- Elf_Shdr *shdr = GetShdrByIndex(i);
- if (IsHiiRsrcShdr(shdr)) {
- if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
- // the alignment field is valid
- if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
- // if the section address is aligned we must align PE/COFF
- mCoffOffset = (mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1);
- } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % shdr->sh_addralign)) {
- // ARM RVCT tools have behavior outside of the ELF specification to try
- // and make images smaller. If sh_addr is not aligned to sh_addralign
- // then the section needs to preserve sh_addr MOD sh_addralign.
- // Normally doing nothing here works great.
- Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
- }
- }
- if (shdr->sh_size != 0) {
- mCoffSectionsOffset[i] = mCoffOffset;
- mCoffOffset += shdr->sh_size;
- mCoffOffset = CoffAlign(mCoffOffset);
- SetHiiResourceHeader ((UINT8*) mEhdr + shdr->sh_offset, mHiiRsrcOffset);
- }
- break;
- }
- }
-
- mRelocOffset = mCoffOffset;
-
- //
- // Allocate base Coff file. Will be expanded later for relocations.
- //
- mCoffFile = (UINT8 *)malloc(mCoffOffset);
- memset(mCoffFile, 0, mCoffOffset);
-
- //
- // Fill headers.
- //
- DosHdr = (EFI_IMAGE_DOS_HEADER *)mCoffFile;
- DosHdr->e_magic = EFI_IMAGE_DOS_SIGNATURE;
- DosHdr->e_lfanew = mNtHdrOffset;
-
- NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION*)(mCoffFile + mNtHdrOffset);
-
- NtHdr->Pe32.Signature = EFI_IMAGE_NT_SIGNATURE;
-
- switch (mEhdr->e_machine) {
- case EM_386:
- NtHdr->Pe32.FileHeader.Machine = EFI_IMAGE_MACHINE_IA32;
- NtHdr->Pe32.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- break;
- case EM_ARM:
- NtHdr->Pe32.FileHeader.Machine = EFI_IMAGE_MACHINE_ARMT;
- NtHdr->Pe32.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- break;
- default:
- VerboseMsg ("%s unknown e_machine type. Assume IA-32", (UINTN)mEhdr->e_machine);
- NtHdr->Pe32.FileHeader.Machine = EFI_IMAGE_MACHINE_IA32;
- NtHdr->Pe32.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- }
-
- NtHdr->Pe32.FileHeader.NumberOfSections = mCoffNbrSections;
- NtHdr->Pe32.FileHeader.TimeDateStamp = (UINT32) time(NULL);
- mImageTimeStamp = NtHdr->Pe32.FileHeader.TimeDateStamp;
- NtHdr->Pe32.FileHeader.PointerToSymbolTable = 0;
- NtHdr->Pe32.FileHeader.NumberOfSymbols = 0;
- NtHdr->Pe32.FileHeader.SizeOfOptionalHeader = sizeof(NtHdr->Pe32.OptionalHeader);
- NtHdr->Pe32.FileHeader.Characteristics = EFI_IMAGE_FILE_EXECUTABLE_IMAGE
- | EFI_IMAGE_FILE_LINE_NUMS_STRIPPED
- | EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED
- | EFI_IMAGE_FILE_32BIT_MACHINE;
-
- NtHdr->Pe32.OptionalHeader.SizeOfCode = mDataOffset - mTextOffset;
- NtHdr->Pe32.OptionalHeader.SizeOfInitializedData = mRelocOffset - mDataOffset;
- NtHdr->Pe32.OptionalHeader.SizeOfUninitializedData = 0;
- NtHdr->Pe32.OptionalHeader.AddressOfEntryPoint = CoffEntry;
-
- NtHdr->Pe32.OptionalHeader.BaseOfCode = mTextOffset;
-
- NtHdr->Pe32.OptionalHeader.BaseOfData = mDataOffset;
- NtHdr->Pe32.OptionalHeader.ImageBase = 0;
- NtHdr->Pe32.OptionalHeader.SectionAlignment = mCoffAlignment;
- NtHdr->Pe32.OptionalHeader.FileAlignment = mCoffAlignment;
- NtHdr->Pe32.OptionalHeader.SizeOfImage = 0;
-
- NtHdr->Pe32.OptionalHeader.SizeOfHeaders = mTextOffset;
- NtHdr->Pe32.OptionalHeader.NumberOfRvaAndSizes = EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES;
-
- //
- // Section headers.
- //
- if ((mDataOffset - mTextOffset) > 0) {
- CreateSectionHeader (".text", mTextOffset, mDataOffset - mTextOffset,
- EFI_IMAGE_SCN_CNT_CODE
- | EFI_IMAGE_SCN_MEM_EXECUTE
- | EFI_IMAGE_SCN_MEM_READ);
- } else {
- // Don't make a section of size 0.
- NtHdr->Pe32.FileHeader.NumberOfSections--;
- }
-
- if ((mHiiRsrcOffset - mDataOffset) > 0) {
- CreateSectionHeader (".data", mDataOffset, mHiiRsrcOffset - mDataOffset,
- EFI_IMAGE_SCN_CNT_INITIALIZED_DATA
- | EFI_IMAGE_SCN_MEM_WRITE
- | EFI_IMAGE_SCN_MEM_READ);
- } else {
- // Don't make a section of size 0.
- NtHdr->Pe32.FileHeader.NumberOfSections--;
- }
-
- if ((mRelocOffset - mHiiRsrcOffset) > 0) {
- CreateSectionHeader (".rsrc", mHiiRsrcOffset, mRelocOffset - mHiiRsrcOffset,
- EFI_IMAGE_SCN_CNT_INITIALIZED_DATA
- | EFI_IMAGE_SCN_MEM_READ);
-
- NtHdr->Pe32.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].Size = mRelocOffset - mHiiRsrcOffset;
- NtHdr->Pe32.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress = mHiiRsrcOffset;
- } else {
- // Don't make a section of size 0.
- NtHdr->Pe32.FileHeader.NumberOfSections--;
- }
-
-}
-
-STATIC
-BOOLEAN
-WriteSections32 (
- SECTION_FILTER_TYPES FilterType
- )
-{
- UINT32 Idx;
- Elf_Shdr *SecShdr;
- UINT32 SecOffset;
- BOOLEAN (*Filter)(Elf_Shdr *);
-
- //
- // Initialize filter pointer
- //
- switch (FilterType) {
- case SECTION_TEXT:
- Filter = IsTextShdr;
- break;
- case SECTION_HII:
- Filter = IsHiiRsrcShdr;
- break;
- case SECTION_DATA:
- Filter = IsDataShdr;
- break;
- default:
- return FALSE;
- }
-
- //
- // First: copy sections.
- //
- for (Idx = 0; Idx < mEhdr->e_shnum; Idx++) {
- Elf_Shdr *Shdr = GetShdrByIndex(Idx);
- if ((*Filter)(Shdr)) {
- switch (Shdr->sh_type) {
- case SHT_PROGBITS:
- /* Copy. */
- memcpy(mCoffFile + mCoffSectionsOffset[Idx],
- (UINT8*)mEhdr + Shdr->sh_offset,
- Shdr->sh_size);
- break;
-
- case SHT_NOBITS:
- memset(mCoffFile + mCoffSectionsOffset[Idx], 0, Shdr->sh_size);
- break;
-
- default:
- //
- // Ignore for unkown section type.
- //
- VerboseMsg ("%s unknown section type %x. We directly copy this section into Coff file", mInImageName, (unsigned)Shdr->sh_type);
- break;
- }
- }
- }
-
- //
- // Second: apply relocations.
- //
- for (Idx = 0; Idx < mEhdr->e_shnum; Idx++) {
- //
- // Determine if this is a relocation section.
- //
- Elf_Shdr *RelShdr = GetShdrByIndex(Idx);
- if ((RelShdr->sh_type != SHT_REL) && (RelShdr->sh_type != SHT_RELA)) {
- continue;
- }
-
- //
- // Relocation section found. Now extract section information that the relocations
- // apply to in the ELF data and the new COFF data.
- //
- SecShdr = GetShdrByIndex(RelShdr->sh_info);
- SecOffset = mCoffSectionsOffset[RelShdr->sh_info];
-
- //
- // Only process relocations for the current filter type.
- //
- if (RelShdr->sh_type == SHT_REL && (*Filter)(SecShdr)) {
- UINT32 RelOffset;
-
- //
- // Determine the symbol table referenced by the relocation data.
- //
- Elf_Shdr *SymtabShdr = GetShdrByIndex(RelShdr->sh_link);
- UINT8 *Symtab = (UINT8*)mEhdr + SymtabShdr->sh_offset;
-
- //
- // Process all relocation entries for this section.
- //
- for (RelOffset = 0; RelOffset < RelShdr->sh_size; RelOffset += RelShdr->sh_entsize) {
- //
- // Set pointer to relocation entry
- //
- Elf_Rel *Rel = (Elf_Rel *)((UINT8*)mEhdr + RelShdr->sh_offset + RelOffset);
-
- //
- // Set pointer to symbol table entry associated with the relocation entry.
- //
- Elf_Sym *Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
-
- Elf_Shdr *SymShdr;
- UINT8 *Targ;
- UINT16 Address;
-
- //
- // Check section header index found in symbol table and get the section
- // header location.
- //
- if (Sym->st_shndx == SHN_UNDEF
- || Sym->st_shndx == SHN_ABS
- || Sym->st_shndx > mEhdr->e_shnum) {
- Error (NULL, 0, 3000, "Invalid", "%s bad symbol definition.", mInImageName);
- }
- SymShdr = GetShdrByIndex(Sym->st_shndx);
-
- //
- // Convert the relocation data to a pointer into the coff file.
- //
- // Note:
- // r_offset is the virtual address of the storage unit to be relocated.
- // sh_addr is the virtual address for the base of the section.
- //
- Targ = mCoffFile + SecOffset + (Rel->r_offset - SecShdr->sh_addr);
-
- //
- // Determine how to handle each relocation type based on the machine type.
- //
- if (mEhdr->e_machine == EM_386) {
- switch (ELF_R_TYPE(Rel->r_info)) {
- case R_386_NONE:
- break;
- case R_386_32:
- //
- // Absolute relocation.
- // Converts Targ from a absolute virtual address to the absolute
- // COFF address.
- //
- *(UINT32 *)Targ = *(UINT32 *)Targ - SymShdr->sh_addr
- + mCoffSectionsOffset[Sym->st_shndx];
- break;
- case R_386_PC32:
- //
- // Relative relocation: Symbol - Ip + Addend
- //
- *(UINT32 *)Targ = *(UINT32 *)Targ
- + (mCoffSectionsOffset[Sym->st_shndx] - SymShdr->sh_addr)
- - (SecOffset - SecShdr->sh_addr);
- break;
- default:
- Error (NULL, 0, 3000, "Invalid", "%s unsupported ELF EM_386 relocation 0x%x.", mInImageName, (unsigned) ELF_R_TYPE(Rel->r_info));
- }
- } else if (mEhdr->e_machine == EM_ARM) {
- switch (ELF32_R_TYPE(Rel->r_info)) {
- case R_ARM_RBASE:
- // No relocation - no action required
- // break skipped
-
- case R_ARM_PC24:
- case R_ARM_XPC25:
- case R_ARM_THM_PC22:
- case R_ARM_THM_JUMP19:
- case R_ARM_CALL:
- case R_ARM_JMP24:
- case R_ARM_THM_JUMP24:
- case R_ARM_PREL31:
- case R_ARM_MOVW_PREL_NC:
- case R_ARM_MOVT_PREL:
- case R_ARM_THM_MOVW_PREL_NC:
- case R_ARM_THM_MOVT_PREL:
- case R_ARM_THM_JMP6:
- case R_ARM_THM_ALU_PREL_11_0:
- case R_ARM_THM_PC12:
- case R_ARM_REL32_NOI:
- case R_ARM_ALU_PC_G0_NC:
- case R_ARM_ALU_PC_G0:
- case R_ARM_ALU_PC_G1_NC:
- case R_ARM_ALU_PC_G1:
- case R_ARM_ALU_PC_G2:
- case R_ARM_LDR_PC_G1:
- case R_ARM_LDR_PC_G2:
- case R_ARM_LDRS_PC_G0:
- case R_ARM_LDRS_PC_G1:
- case R_ARM_LDRS_PC_G2:
- case R_ARM_LDC_PC_G0:
- case R_ARM_LDC_PC_G1:
- case R_ARM_LDC_PC_G2:
- case R_ARM_GOT_PREL:
- case R_ARM_THM_JUMP11:
- case R_ARM_THM_JUMP8:
- case R_ARM_TLS_GD32:
- case R_ARM_TLS_LDM32:
- case R_ARM_TLS_IE32:
- // Thease are all PC-relative relocations and don't require modification
- // GCC does not seem to have the concept of a application that just needs to get relocated.
- break;
-
- case R_ARM_THM_MOVW_ABS_NC:
- // MOVW is only lower 16-bits of the addres
- Address = (UINT16)(Sym->st_value - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]);
- ThumbMovtImmediatePatch ((UINT16 *)Targ, Address);
- break;
-
- case R_ARM_THM_MOVT_ABS:
- // MOVT is only upper 16-bits of the addres
- Address = (UINT16)((Sym->st_value - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]) >> 16);
- ThumbMovtImmediatePatch ((UINT16 *)Targ, Address);
- break;
-
- case R_ARM_ABS32:
- case R_ARM_RABS32:
- //
- // Absolute relocation.
- //
- *(UINT32 *)Targ = *(UINT32 *)Targ - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx];
- break;
-
- default:
- Error (NULL, 0, 3000, "Invalid", "WriteSections (): %s unsupported ELF EM_ARM relocation 0x%x.", mInImageName, (unsigned) ELF32_R_TYPE(Rel->r_info));
- }
- }
- }
- }
- }
-
- return TRUE;
-}
-
-UINTN gMovwOffset = 0;
-
-STATIC
-VOID
-WriteRelocations32 (
- VOID
- )
-{
- UINT32 Index;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
- EFI_IMAGE_DATA_DIRECTORY *Dir;
- BOOLEAN FoundRelocations;
- Elf_Dyn *Dyn;
- Elf_Rel *Rel;
- UINTN RelElementSize;
- UINTN RelSize;
- UINTN RelOffset;
- UINTN K;
- UINT8 *Targ;
- Elf32_Phdr *DynamicSegment;
- Elf32_Phdr *TargetSegment;
-
- for (Index = 0, FoundRelocations = FALSE; Index < mEhdr->e_shnum; Index++) {
- Elf_Shdr *RelShdr = GetShdrByIndex(Index);
- if ((RelShdr->sh_type == SHT_REL) || (RelShdr->sh_type == SHT_RELA)) {
- Elf_Shdr *SecShdr = GetShdrByIndex (RelShdr->sh_info);
- if (IsTextShdr(SecShdr) || IsDataShdr(SecShdr)) {
- UINT32 RelIdx;
-
- FoundRelocations = TRUE;
- for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {
- Elf_Rel *Rel = (Elf_Rel *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);
-
- if (mEhdr->e_machine == EM_386) {
- switch (ELF_R_TYPE(Rel->r_info)) {
- case R_386_NONE:
- case R_386_PC32:
- //
- // No fixup entry required.
- //
- break;
- case R_386_32:
- //
- // Creates a relative relocation entry from the absolute entry.
- //
- CoffAddFixup(mCoffSectionsOffset[RelShdr->sh_info]
- + (Rel->r_offset - SecShdr->sh_addr),
- EFI_IMAGE_REL_BASED_HIGHLOW);
- break;
- default:
- Error (NULL, 0, 3000, "Invalid", "%s unsupported ELF EM_386 relocation 0x%x.", mInImageName, (unsigned) ELF_R_TYPE(Rel->r_info));
- }
- } else if (mEhdr->e_machine == EM_ARM) {
- switch (ELF32_R_TYPE(Rel->r_info)) {
- case R_ARM_RBASE:
- // No relocation - no action required
- // break skipped
-
- case R_ARM_PC24:
- case R_ARM_XPC25:
- case R_ARM_THM_PC22:
- case R_ARM_THM_JUMP19:
- case R_ARM_CALL:
- case R_ARM_JMP24:
- case R_ARM_THM_JUMP24:
- case R_ARM_PREL31:
- case R_ARM_MOVW_PREL_NC:
- case R_ARM_MOVT_PREL:
- case R_ARM_THM_MOVW_PREL_NC:
- case R_ARM_THM_MOVT_PREL:
- case R_ARM_THM_JMP6:
- case R_ARM_THM_ALU_PREL_11_0:
- case R_ARM_THM_PC12:
- case R_ARM_REL32_NOI:
- case R_ARM_ALU_PC_G0_NC:
- case R_ARM_ALU_PC_G0:
- case R_ARM_ALU_PC_G1_NC:
- case R_ARM_ALU_PC_G1:
- case R_ARM_ALU_PC_G2:
- case R_ARM_LDR_PC_G1:
- case R_ARM_LDR_PC_G2:
- case R_ARM_LDRS_PC_G0:
- case R_ARM_LDRS_PC_G1:
- case R_ARM_LDRS_PC_G2:
- case R_ARM_LDC_PC_G0:
- case R_ARM_LDC_PC_G1:
- case R_ARM_LDC_PC_G2:
- case R_ARM_GOT_PREL:
- case R_ARM_THM_JUMP11:
- case R_ARM_THM_JUMP8:
- case R_ARM_TLS_GD32:
- case R_ARM_TLS_LDM32:
- case R_ARM_TLS_IE32:
- // Thease are all PC-relative relocations and don't require modification
- break;
-
- case R_ARM_THM_MOVW_ABS_NC:
- CoffAddFixup (
- mCoffSectionsOffset[RelShdr->sh_info]
- + (Rel->r_offset - SecShdr->sh_addr),
- EFI_IMAGE_REL_BASED_ARM_MOV32T
- );
-
- // PE/COFF treats MOVW/MOVT relocation as single 64-bit instruction
- // Track this address so we can log an error for unsupported sequence of MOVW/MOVT
- gMovwOffset = mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr);
- break;
-
- case R_ARM_THM_MOVT_ABS:
- if ((gMovwOffset + 4) != (mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr))) {
- Error (NULL, 0, 3000, "Not Supported", "PE/COFF requires MOVW+MOVT instruction sequence %x +4 != %x.", gMovwOffset, mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr));
- }
- break;
-
- case R_ARM_ABS32:
- case R_ARM_RABS32:
- CoffAddFixup (
- mCoffSectionsOffset[RelShdr->sh_info]
- + (Rel->r_offset - SecShdr->sh_addr),
- EFI_IMAGE_REL_BASED_HIGHLOW
- );
- break;
-
- default:
- Error (NULL, 0, 3000, "Invalid", "WriteRelocations(): %s unsupported ELF EM_ARM relocation 0x%x.", mInImageName, (unsigned) ELF32_R_TYPE(Rel->r_info));
- }
- } else {
- Error (NULL, 0, 3000, "Not Supported", "This tool does not support relocations for ELF with e_machine %u (processor type).", (unsigned) mEhdr->e_machine);
- }
- }
- }
- }
- }
-
- if (!FoundRelocations && (mEhdr->e_machine == EM_ARM)) {
- /* Try again, but look for PT_DYNAMIC instead of SHT_REL */
-
- for (Index = 0; Index < mEhdr->e_phnum; Index++) {
- RelElementSize = 0;
- RelSize = 0;
- RelOffset = 0;
-
- DynamicSegment = GetPhdrByIndex (Index);
-
- if (DynamicSegment->p_type == PT_DYNAMIC) {
- Dyn = (Elf32_Dyn *) ((UINT8 *)mEhdr + DynamicSegment->p_offset);
-
- while (Dyn->d_tag != DT_NULL) {
- switch (Dyn->d_tag) {
- case DT_REL:
- RelOffset = Dyn->d_un.d_val;
- break;
-
- case DT_RELSZ:
- RelSize = Dyn->d_un.d_val;
- break;
-
- case DT_RELENT:
- RelElementSize = Dyn->d_un.d_val;
- break;
-
- default:
- break;
- }
- Dyn++;
- }
- if (( RelOffset == 0 ) || ( RelSize == 0 ) || ( RelElementSize == 0 )) {
- Error (NULL, 0, 3000, "Invalid", "%s bad ARM dynamic relocations.", mInImageName);
- }
-
- for (K = 0; K < RelSize; K += RelElementSize) {
-
- if (DynamicSegment->p_paddr == 0) {
- // Older versions of the ARM ELF (SWS ESPC 0003 B-02) specification define DT_REL
- // as an offset in the dynamic segment. p_paddr is defined to be zero for ARM tools
- Rel = (Elf32_Rel *) ((UINT8 *) mEhdr + DynamicSegment->p_offset + RelOffset + K);
- } else {
- // This is how it reads in the generic ELF specification
- Rel = (Elf32_Rel *) ((UINT8 *) mEhdr + RelOffset + K);
- }
-
- switch (ELF32_R_TYPE (Rel->r_info)) {
- case R_ARM_RBASE:
- break;
-
- case R_ARM_RABS32:
- TargetSegment = GetPhdrByIndex (ELF32_R_SYM (Rel->r_info) - 1);
-
- // Note: r_offset in a memory address. Convert it to a pointer in the coff file.
- Targ = mCoffFile + mCoffSectionsOffset[ ELF32_R_SYM( Rel->r_info ) ] + Rel->r_offset - TargetSegment->p_vaddr;
-
- *(UINT32 *)Targ = *(UINT32 *)Targ + mCoffSectionsOffset [ELF32_R_SYM( Rel->r_info )];
-
- CoffAddFixup (mCoffSectionsOffset[ELF32_R_SYM (Rel->r_info)] + (Rel->r_offset - TargetSegment->p_vaddr), EFI_IMAGE_REL_BASED_HIGHLOW);
- break;
-
- default:
- Error (NULL, 0, 3000, "Invalid", "%s bad ARM dynamic relocations, unkown type %d.", mInImageName, ELF32_R_TYPE (Rel->r_info));
- break;
- }
- }
- break;
- }
- }
- }
-
- //
- // Pad by adding empty entries.
- //
- while (mCoffOffset & (mCoffAlignment - 1)) {
- CoffAddFixupEntry(0);
- }
-
- NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);
- Dir = &NtHdr->Pe32.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- Dir->Size = mCoffOffset - mRelocOffset;
- if (Dir->Size == 0) {
- // If no relocations, null out the directory entry and don't add the .reloc section
- Dir->VirtualAddress = 0;
- NtHdr->Pe32.FileHeader.NumberOfSections--;
- } else {
- Dir->VirtualAddress = mRelocOffset;
- CreateSectionHeader (".reloc", mRelocOffset, mCoffOffset - mRelocOffset,
- EFI_IMAGE_SCN_CNT_INITIALIZED_DATA
- | EFI_IMAGE_SCN_MEM_DISCARDABLE
- | EFI_IMAGE_SCN_MEM_READ);
- }
-
-}
-
-STATIC
-VOID
-WriteDebug32 (
- VOID
- )
-{
- UINT32 Len;
- UINT32 DebugOffset;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
- EFI_IMAGE_DATA_DIRECTORY *DataDir;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *Dir;
- EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY *Nb10;
-
- Len = strlen(mInImageName) + 1;
- DebugOffset = mCoffOffset;
-
- mCoffOffset += sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)
- + sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY)
- + Len;
- mCoffOffset = CoffAlign(mCoffOffset);
-
- mCoffFile = realloc(mCoffFile, mCoffOffset);
- memset(mCoffFile + DebugOffset, 0, mCoffOffset - DebugOffset);
-
- Dir = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY*)(mCoffFile + DebugOffset);
- Dir->Type = EFI_IMAGE_DEBUG_TYPE_CODEVIEW;
- Dir->SizeOfData = sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) + Len;
- Dir->RVA = DebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY);
- Dir->FileOffset = DebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY);
-
- Nb10 = (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY*)(Dir + 1);
- Nb10->Signature = CODEVIEW_SIGNATURE_NB10;
- strcpy ((char *)(Nb10 + 1), mInImageName);
-
-
- NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);
- DataDir = &NtHdr->Pe32.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG];
- DataDir->VirtualAddress = DebugOffset;
- DataDir->Size = mCoffOffset - DebugOffset;
- if (DataDir->Size == 0) {
- // If no debug, null out the directory entry and don't add the .debug section
- DataDir->VirtualAddress = 0;
- NtHdr->Pe32.FileHeader.NumberOfSections--;
- } else {
- DataDir->VirtualAddress = DebugOffset;
- CreateSectionHeader (".debug", DebugOffset, mCoffOffset - DebugOffset,
- EFI_IMAGE_SCN_CNT_INITIALIZED_DATA
- | EFI_IMAGE_SCN_MEM_DISCARDABLE
- | EFI_IMAGE_SCN_MEM_READ);
-
- }
-}
-
-STATIC
-VOID
-SetImageSize32 (
- VOID
- )
-{
- EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
-
- //
- // Set image size
- //
- NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);
- NtHdr->Pe32.OptionalHeader.SizeOfImage = mCoffOffset;
-}
-
-STATIC
-VOID
-CleanUp32 (
- VOID
- )
-{
- if (mCoffSectionsOffset != NULL) {
- free (mCoffSectionsOffset);
- }
-}
-
-
diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.h b/BaseTools/Source/C/GenFw/Elf32Convert.h
deleted file mode 100644
index 2eafbec258..0000000000
--- a/BaseTools/Source/C/GenFw/Elf32Convert.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @file
-
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _ELF_32_CONVERT_
-#define _ELF_32_CONVERT_
-
-BOOLEAN
-InitializeElf32 (
- UINT8 *FileBuffer,
- ELF_FUNCTION_TABLE *ElfFunctions
- );
-
-#endif
diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c
deleted file mode 100644
index 72d6cd16d7..0000000000
--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
+++ /dev/null
@@ -1,916 +0,0 @@
-/** @file
-
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
-
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "WinNtInclude.h"
-
-#ifndef __GNUC__
-#include <windows.h>
-#include <io.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-
-#include <Common/UefiBaseTypes.h>
-#include <IndustryStandard/PeImage.h>
-
-#include "PeCoffLib.h"
-#include "EfiUtilityMsgs.h"
-
-#include "GenFw.h"
-#include "ElfConvert.h"
-#include "Elf64Convert.h"
-
-STATIC
-VOID
-ScanSections64 (
- VOID
- );
-
-STATIC
-BOOLEAN
-WriteSections64 (
- SECTION_FILTER_TYPES FilterType
- );
-
-STATIC
-VOID
-WriteRelocations64 (
- VOID
- );
-
-STATIC
-VOID
-WriteDebug64 (
- VOID
- );
-
-STATIC
-VOID
-SetImageSize64 (
- VOID
- );
-
-STATIC
-VOID
-CleanUp64 (
- VOID
- );
-
-//
-// Rename ELF32 strucutres to common names to help when porting to ELF64.
-//
-typedef Elf64_Shdr Elf_Shdr;
-typedef Elf64_Ehdr Elf_Ehdr;
-typedef Elf64_Rel Elf_Rel;
-typedef Elf64_Rela Elf_Rela;
-typedef Elf64_Sym Elf_Sym;
-typedef Elf64_Phdr Elf_Phdr;
-typedef Elf64_Dyn Elf_Dyn;
-#define ELFCLASS ELFCLASS64
-#define ELF_R_TYPE(r) ELF64_R_TYPE(r)
-#define ELF_R_SYM(r) ELF64_R_SYM(r)
-
-//
-// Well known ELF structures.
-//
-STATIC Elf_Ehdr *mEhdr;
-STATIC Elf_Shdr *mShdrBase;
-STATIC Elf_Phdr *mPhdrBase;
-
-//
-// Coff information
-//
-STATIC const UINT32 mCoffAlignment = 0x20;
-
-//
-// PE section alignment.
-//
-STATIC const UINT16 mCoffNbrSections = 5;
-
-//
-// ELF sections to offset in Coff file.
-//
-STATIC UINT32 *mCoffSectionsOffset = NULL;
-
-//
-// Offsets in COFF file
-//
-STATIC UINT32 mNtHdrOffset;
-STATIC UINT32 mTextOffset;
-STATIC UINT32 mDataOffset;
-STATIC UINT32 mHiiRsrcOffset;
-STATIC UINT32 mRelocOffset;
-
-//
-// Initialization Function
-//
-BOOLEAN
-InitializeElf64 (
- UINT8 *FileBuffer,
- ELF_FUNCTION_TABLE *ElfFunctions
- )
-{
- //
- // Initialize data pointer and structures.
- //
- VerboseMsg ("Set EHDR");
- mEhdr = (Elf_Ehdr*) FileBuffer;
-
- //
- // Check the ELF64 specific header information.
- //
- VerboseMsg ("Check ELF64 Header Information");
- if (mEhdr->e_ident[EI_CLASS] != ELFCLASS64) {
- Error (NULL, 0, 3000, "Unsupported", "ELF EI_DATA not ELFCLASS64");
- return FALSE;
- }
- if (mEhdr->e_ident[EI_DATA] != ELFDATA2LSB) {
- Error (NULL, 0, 3000, "Unsupported", "ELF EI_DATA not ELFDATA2LSB");
- return FALSE;
- }
- if ((mEhdr->e_type != ET_EXEC) && (mEhdr->e_type != ET_DYN)) {
- Error (NULL, 0, 3000, "Unsupported", "ELF e_type not ET_EXEC or ET_DYN");
- return FALSE;
- }
- if (!((mEhdr->e_machine == EM_X86_64) || (mEhdr->e_machine == EM_AARCH64))) {
- Error (NULL, 0, 3000, "Unsupported", "ELF e_machine not EM_X86_64 or EM_AARCH64");
- return FALSE;
- }
- if (mEhdr->e_version != EV_CURRENT) {
- Error (NULL, 0, 3000, "Unsupported", "ELF e_version (%u) not EV_CURRENT (%d)", (unsigned) mEhdr->e_version, EV_CURRENT);
- return FALSE;
- }
-
- //
- // Update section header pointers
- //
- VerboseMsg ("Update Header Pointers");
- mShdrBase = (Elf_Shdr *)((UINT8 *)mEhdr + mEhdr->e_shoff);
- mPhdrBase = (Elf_Phdr *)((UINT8 *)mEhdr + mEhdr->e_phoff);
-
- //
- // Create COFF Section offset buffer and zero.
- //
- VerboseMsg ("Create COFF Section Offset Buffer");
- mCoffSectionsOffset = (UINT32 *)malloc(mEhdr->e_shnum * sizeof (UINT32));
- memset(mCoffSectionsOffset, 0, mEhdr->e_shnum * sizeof(UINT32));
-
- //
- // Fill in function pointers.
- //
- VerboseMsg ("Fill in Function Pointers");
- ElfFunctions->ScanSections = ScanSections64;
- ElfFunctions->WriteSections = WriteSections64;
- ElfFunctions->WriteRelocations = WriteRelocations64;
- ElfFunctions->WriteDebug = WriteDebug64;
- ElfFunctions->SetImageSize = SetImageSize64;
- ElfFunctions->CleanUp = CleanUp64;
-
- return TRUE;
-}
-
-
-//
-// Header by Index functions
-//
-STATIC
-Elf_Shdr*
-GetShdrByIndex (
- UINT32 Num
- )
-{
- if (Num >= mEhdr->e_shnum)
- return NULL;
- return (Elf_Shdr*)((UINT8*)mShdrBase + Num * mEhdr->e_shentsize);
-}
-
-STATIC
-UINT32
-CoffAlign (
- UINT32 Offset
- )
-{
- return (Offset + mCoffAlignment - 1) & ~(mCoffAlignment - 1);
-}
-
-//
-// filter functions
-//
-STATIC
-BOOLEAN
-IsTextShdr (
- Elf_Shdr *Shdr
- )
-{
- return (BOOLEAN) ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == SHF_ALLOC);
-}
-
-STATIC
-BOOLEAN
-IsHiiRsrcShdr (
- Elf_Shdr *Shdr
- )
-{
- Elf_Shdr *Namedr = GetShdrByIndex(mEhdr->e_shstrndx);
-
- return (BOOLEAN) (strcmp((CHAR8*)mEhdr + Namedr->sh_offset + Shdr->sh_name, ELF_HII_SECTION_NAME) == 0);
-}
-
-STATIC
-BOOLEAN
-IsDataShdr (
- Elf_Shdr *Shdr
- )
-{
- if (IsHiiRsrcShdr(Shdr)) {
- return FALSE;
- }
- return (BOOLEAN) (Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == (SHF_ALLOC | SHF_WRITE);
-}
-
-//
-// Elf functions interface implementation
-//
-
-STATIC
-VOID
-ScanSections64 (
- VOID
- )
-{
- UINT32 i;
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
- UINT32 CoffEntry;
- UINT32 SectionCount;
-
- CoffEntry = 0;
- mCoffOffset = 0;
-
- //
- // Coff file start with a DOS header.
- //
- mCoffOffset = sizeof(EFI_IMAGE_DOS_HEADER) + 0x40;
- mNtHdrOffset = mCoffOffset;
- switch (mEhdr->e_machine) {
- case EM_X86_64:
- case EM_IA_64:
- case EM_AARCH64:
- mCoffOffset += sizeof (EFI_IMAGE_NT_HEADERS64);
- break;
- default:
- VerboseMsg ("%s unknown e_machine type. Assume X64", (UINTN)mEhdr->e_machine);
- mCoffOffset += sizeof (EFI_IMAGE_NT_HEADERS64);
- break;
- }
-
- mTableOffset = mCoffOffset;
- mCoffOffset += mCoffNbrSections * sizeof(EFI_IMAGE_SECTION_HEADER);
-
- //
- // First text sections.
- //
- mCoffOffset = CoffAlign(mCoffOffset);
- mTextOffset = mCoffOffset;
- SectionCount = 0;
- for (i = 0; i < mEhdr->e_shnum; i++) {
- Elf_Shdr *shdr = GetShdrByIndex(i);
- if (IsTextShdr(shdr)) {
- if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
- // the alignment field is valid
- if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
- // if the section address is aligned we must align PE/COFF
- mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
- } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % shdr->sh_addralign)) {
- // ARM RVCT tools have behavior outside of the ELF specification to try
- // and make images smaller. If sh_addr is not aligned to sh_addralign
- // then the section needs to preserve sh_addr MOD sh_addralign.
- // Normally doing nothing here works great.
- Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
- }
- }
-
- /* Relocate entry. */
- if ((mEhdr->e_entry >= shdr->sh_addr) &&
- (mEhdr->e_entry < shdr->sh_addr + shdr->sh_size)) {
- CoffEntry = (UINT32) (mCoffOffset + mEhdr->e_entry - shdr->sh_addr);
- }
- mCoffSectionsOffset[i] = mCoffOffset;
- mCoffOffset += (UINT32) shdr->sh_size;
- SectionCount ++;
- }
- }
-
- if (mEhdr->e_machine != EM_ARM) {
- mCoffOffset = CoffAlign(mCoffOffset);
- }
-
- if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
- Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 text section. Source level debug might not work correctly.", mInImageName);
- }
-
- //
- // Then data sections.
- //
- mDataOffset = mCoffOffset;
- SectionCount = 0;
- for (i = 0; i < mEhdr->e_shnum; i++) {
- Elf_Shdr *shdr = GetShdrByIndex(i);
- if (IsDataShdr(shdr)) {
- if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
- // the alignment field is valid
- if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
- // if the section address is aligned we must align PE/COFF
- mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
- } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % shdr->sh_addralign)) {
- // ARM RVCT tools have behavior outside of the ELF specification to try
- // and make images smaller. If sh_addr is not aligned to sh_addralign
- // then the section needs to preserve sh_addr MOD sh_addralign.
- // Normally doing nothing here works great.
- Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
- }
- }
- mCoffSectionsOffset[i] = mCoffOffset;
- mCoffOffset += (UINT32) shdr->sh_size;
- SectionCount ++;
- }
- }
- mCoffOffset = CoffAlign(mCoffOffset);
-
- if (SectionCount > 1 && mOutImageType == FW_EFI_IMAGE) {
- Warning (NULL, 0, 0, NULL, "Mulitple sections in %s are merged into 1 data section. Source level debug might not work correctly.", mInImageName);
- }
-
- //
- // The HII resource sections.
- //
- mHiiRsrcOffset = mCoffOffset;
- for (i = 0; i < mEhdr->e_shnum; i++) {
- Elf_Shdr *shdr = GetShdrByIndex(i);
- if (IsHiiRsrcShdr(shdr)) {
- if ((shdr->sh_addralign != 0) && (shdr->sh_addralign != 1)) {
- // the alignment field is valid
- if ((shdr->sh_addr & (shdr->sh_addralign - 1)) == 0) {
- // if the section address is aligned we must align PE/COFF
- mCoffOffset = (UINT32) ((mCoffOffset + shdr->sh_addralign - 1) & ~(shdr->sh_addralign - 1));
- } else if ((shdr->sh_addr % shdr->sh_addralign) != (mCoffOffset % shdr->sh_addralign)) {
- // ARM RVCT tools have behavior outside of the ELF specification to try
- // and make images smaller. If sh_addr is not aligned to sh_addralign
- // then the section needs to preserve sh_addr MOD sh_addralign.
- // Normally doing nothing here works great.
- Error (NULL, 0, 3000, "Invalid", "Unsupported section alignment.");
- }
- }
- if (shdr->sh_size != 0) {
- mCoffSectionsOffset[i] = mCoffOffset;
- mCoffOffset += (UINT32) shdr->sh_size;
- mCoffOffset = CoffAlign(mCoffOffset);
- SetHiiResourceHeader ((UINT8*) mEhdr + shdr->sh_offset, mHiiRsrcOffset);
- }
- break;
- }
- }
-
- mRelocOffset = mCoffOffset;
-
- //
- // Allocate base Coff file. Will be expanded later for relocations.
- //
- mCoffFile = (UINT8 *)malloc(mCoffOffset);
- memset(mCoffFile, 0, mCoffOffset);
-
- //
- // Fill headers.
- //
- DosHdr = (EFI_IMAGE_DOS_HEADER *)mCoffFile;
- DosHdr->e_magic = EFI_IMAGE_DOS_SIGNATURE;
- DosHdr->e_lfanew = mNtHdrOffset;
-
- NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION*)(mCoffFile + mNtHdrOffset);
-
- NtHdr->Pe32Plus.Signature = EFI_IMAGE_NT_SIGNATURE;
-
- switch (mEhdr->e_machine) {
- case EM_X86_64:
- NtHdr->Pe32Plus.FileHeader.Machine = EFI_IMAGE_MACHINE_X64;
- NtHdr->Pe32Plus.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- break;
- case EM_IA_64:
- NtHdr->Pe32Plus.FileHeader.Machine = EFI_IMAGE_MACHINE_IPF;
- NtHdr->Pe32Plus.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- break;
- case EM_AARCH64:
- NtHdr->Pe32Plus.FileHeader.Machine = EFI_IMAGE_MACHINE_AARCH64;
- NtHdr->Pe32Plus.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- break;
- default:
- VerboseMsg ("%s unknown e_machine type. Assume X64", (UINTN)mEhdr->e_machine);
- NtHdr->Pe32Plus.FileHeader.Machine = EFI_IMAGE_MACHINE_X64;
- NtHdr->Pe32Plus.OptionalHeader.Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- }
-
- NtHdr->Pe32Plus.FileHeader.NumberOfSections = mCoffNbrSections;
- NtHdr->Pe32Plus.FileHeader.TimeDateStamp = (UINT32) time(NULL);
- mImageTimeStamp = NtHdr->Pe32Plus.FileHeader.TimeDateStamp;
- NtHdr->Pe32Plus.FileHeader.PointerToSymbolTable = 0;
- NtHdr->Pe32Plus.FileHeader.NumberOfSymbols = 0;
- NtHdr->Pe32Plus.FileHeader.SizeOfOptionalHeader = sizeof(NtHdr->Pe32Plus.OptionalHeader);
- NtHdr->Pe32Plus.FileHeader.Characteristics = EFI_IMAGE_FILE_EXECUTABLE_IMAGE
- | EFI_IMAGE_FILE_LINE_NUMS_STRIPPED
- | EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED
- | EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE;
-
- NtHdr->Pe32Plus.OptionalHeader.SizeOfCode = mDataOffset - mTextOffset;
- NtHdr->Pe32Plus.OptionalHeader.SizeOfInitializedData = mRelocOffset - mDataOffset;
- NtHdr->Pe32Plus.OptionalHeader.SizeOfUninitializedData = 0;
- NtHdr->Pe32Plus.OptionalHeader.AddressOfEntryPoint = CoffEntry;
-
- NtHdr->Pe32Plus.OptionalHeader.BaseOfCode = mTextOffset;
-
- NtHdr->Pe32Plus.OptionalHeader.ImageBase = 0;
- NtHdr->Pe32Plus.OptionalHeader.SectionAlignment = mCoffAlignment;
- NtHdr->Pe32Plus.OptionalHeader.FileAlignment = mCoffAlignment;
- NtHdr->Pe32Plus.OptionalHeader.SizeOfImage = 0;
-
- NtHdr->Pe32Plus.OptionalHeader.SizeOfHeaders = mTextOffset;
- NtHdr->Pe32Plus.OptionalHeader.NumberOfRvaAndSizes = EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES;
-
- //
- // Section headers.
- //
- if ((mDataOffset - mTextOffset) > 0) {
- CreateSectionHeader (".text", mTextOffset, mDataOffset - mTextOffset,
- EFI_IMAGE_SCN_CNT_CODE
- | EFI_IMAGE_SCN_MEM_EXECUTE
- | EFI_IMAGE_SCN_MEM_READ);
- } else {
- // Don't make a section of size 0.
- NtHdr->Pe32Plus.FileHeader.NumberOfSections--;
- }
-
- if ((mHiiRsrcOffset - mDataOffset) > 0) {
- CreateSectionHeader (".data", mDataOffset, mHiiRsrcOffset - mDataOffset,
- EFI_IMAGE_SCN_CNT_INITIALIZED_DATA
- | EFI_IMAGE_SCN_MEM_WRITE
- | EFI_IMAGE_SCN_MEM_READ);
- } else {
- // Don't make a section of size 0.
- NtHdr->Pe32Plus.FileHeader.NumberOfSections--;
- }
-
- if ((mRelocOffset - mHiiRsrcOffset) > 0) {
- CreateSectionHeader (".rsrc", mHiiRsrcOffset, mRelocOffset - mHiiRsrcOffset,
- EFI_IMAGE_SCN_CNT_INITIALIZED_DATA
- | EFI_IMAGE_SCN_MEM_READ);
-
- NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].Size = mRelocOffset - mHiiRsrcOffset;
- NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress = mHiiRsrcOffset;
- } else {
- // Don't make a section of size 0.
- NtHdr->Pe32Plus.FileHeader.NumberOfSections--;
- }
-
-}
-
-STATIC
-BOOLEAN
-WriteSections64 (
- SECTION_FILTER_TYPES FilterType
- )
-{
- UINT32 Idx;
- Elf_Shdr *SecShdr;
- UINT32 SecOffset;
- BOOLEAN (*Filter)(Elf_Shdr *);
-
- //
- // Initialize filter pointer
- //
- switch (FilterType) {
- case SECTION_TEXT:
- Filter = IsTextShdr;
- break;
- case SECTION_HII:
- Filter = IsHiiRsrcShdr;
- break;
- case SECTION_DATA:
- Filter = IsDataShdr;
- break;
- default:
- return FALSE;
- }
-
- //
- // First: copy sections.
- //
- for (Idx = 0; Idx < mEhdr->e_shnum; Idx++) {
- Elf_Shdr *Shdr = GetShdrByIndex(Idx);
- if ((*Filter)(Shdr)) {
- switch (Shdr->sh_type) {
- case SHT_PROGBITS:
- /* Copy. */
- memcpy(mCoffFile + mCoffSectionsOffset[Idx],
- (UINT8*)mEhdr + Shdr->sh_offset,
- (size_t) Shdr->sh_size);
- break;
-
- case SHT_NOBITS:
- memset(mCoffFile + mCoffSectionsOffset[Idx], 0, (size_t) Shdr->sh_size);
- break;
-
- default:
- //
- // Ignore for unkown section type.
- //
- VerboseMsg ("%s unknown section type %x. We directly copy this section into Coff file", mInImageName, (unsigned)Shdr->sh_type);
- break;
- }
- }
- }
-
- //
- // Second: apply relocations.
- //
- VerboseMsg ("Applying Relocations...");
- for (Idx = 0; Idx < mEhdr->e_shnum; Idx++) {
- //
- // Determine if this is a relocation section.
- //
- Elf_Shdr *RelShdr = GetShdrByIndex(Idx);
- if ((RelShdr->sh_type != SHT_REL) && (RelShdr->sh_type != SHT_RELA)) {
- continue;
- }
-
- //
- // Relocation section found. Now extract section information that the relocations
- // apply to in the ELF data and the new COFF data.
- //
- SecShdr = GetShdrByIndex(RelShdr->sh_info);
- SecOffset = mCoffSectionsOffset[RelShdr->sh_info];
-
- //
- // Only process relocations for the current filter type.
- //
- if (RelShdr->sh_type == SHT_RELA && (*Filter)(SecShdr)) {
- UINT64 RelIdx;
-
- //
- // Determine the symbol table referenced by the relocation data.
- //
- Elf_Shdr *SymtabShdr = GetShdrByIndex(RelShdr->sh_link);
- UINT8 *Symtab = (UINT8*)mEhdr + SymtabShdr->sh_offset;
-
- //
- // Process all relocation entries for this section.
- //
- for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += (UINT32) RelShdr->sh_entsize) {
-
- //
- // Set pointer to relocation entry
- //
- Elf_Rela *Rel = (Elf_Rela *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);
-
- //
- // Set pointer to symbol table entry associated with the relocation entry.
- //
- Elf_Sym *Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);
-
- Elf_Shdr *SymShdr;
- UINT8 *Targ;
-
- //
- // Check section header index found in symbol table and get the section
- // header location.
- //
- if (Sym->st_shndx == SHN_UNDEF
- || Sym->st_shndx == SHN_ABS
- || Sym->st_shndx > mEhdr->e_shnum) {
- Error (NULL, 0, 3000, "Invalid", "%s bad symbol definition.", mInImageName);
- }
- SymShdr = GetShdrByIndex(Sym->st_shndx);
-
- //
- // Convert the relocation data to a pointer into the coff file.
- //
- // Note:
- // r_offset is the virtual address of the storage unit to be relocated.
- // sh_addr is the virtual address for the base of the section.
- //
- // r_offset in a memory address.
- // Convert it to a pointer in the coff file.
- //
- Targ = mCoffFile + SecOffset + (Rel->r_offset - SecShdr->sh_addr);
-
- //
- // Determine how to handle each relocation type based on the machine type.
- //
- if (mEhdr->e_machine == EM_X86_64) {
- switch (ELF_R_TYPE(Rel->r_info)) {
- case R_X86_64_NONE:
- break;
- case R_X86_64_64:
- //
- // Absolute relocation.
- //
- VerboseMsg ("R_X86_64_64");
- VerboseMsg ("Offset: 0x%08X, Addend: 0x%016LX",
- (UINT32)(SecOffset + (Rel->r_offset - SecShdr->sh_addr)),
- *(UINT64 *)Targ);
- *(UINT64 *)Targ = *(UINT64 *)Targ - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx];
- VerboseMsg ("Relocation: 0x%016LX", *(UINT64*)Targ);
- break;
- case R_X86_64_32:
- VerboseMsg ("R_X86_64_32");
- VerboseMsg ("Offset: 0x%08X, Addend: 0x%08X",
- (UINT32)(SecOffset + (Rel->r_offset - SecShdr->sh_addr)),
- *(UINT32 *)Targ);
- *(UINT32 *)Targ = (UINT32)((UINT64)(*(UINT32 *)Targ) - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]);
- VerboseMsg ("Relocation: 0x%08X", *(UINT32*)Targ);
- break;
- case R_X86_64_32S:
- VerboseMsg ("R_X86_64_32S");
- VerboseMsg ("Offset: 0x%08X, Addend: 0x%08X",
- (UINT32)(SecOffset + (Rel->r_offset - SecShdr->sh_addr)),
- *(UINT32 *)Targ);
- *(INT32 *)Targ = (INT32)((INT64)(*(INT32 *)Targ) - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]);
- VerboseMsg ("Relocation: 0x%08X", *(UINT32*)Targ);
- break;
- case R_X86_64_PC32:
- //
- // Relative relocation: Symbol - Ip + Addend
- //
- VerboseMsg ("R_X86_64_PC32");
- VerboseMsg ("Offset: 0x%08X, Addend: 0x%08X",
- (UINT32)(SecOffset + (Rel->r_offset - SecShdr->sh_addr)),
- *(UINT32 *)Targ);
- *(UINT32 *)Targ = (UINT32) (*(UINT32 *)Targ
- + (mCoffSectionsOffset[Sym->st_shndx] - SymShdr->sh_addr)
- - (SecOffset - SecShdr->sh_addr));
- VerboseMsg ("Relocation: 0x%08X", *(UINT32 *)Targ);
- break;
- default:
- Error (NULL, 0, 3000, "Invalid", "%s unsupported ELF EM_X86_64 relocation 0x%x.", mInImageName, (unsigned) ELF_R_TYPE(Rel->r_info));
- }
- } else if (mEhdr->e_machine == EM_AARCH64) {
-
- // AARCH64 GCC uses RELA relocation, so all relocations have to be fixed up.
- // As opposed to ARM32 using REL.
-
- switch (ELF_R_TYPE(Rel->r_info)) {
-
- case R_AARCH64_LD_PREL_LO19:
- if (Rel->r_addend != 0 ) { /* TODO */
- Error (NULL, 0, 3000, "Invalid", "AArch64: R_AARCH64_LD_PREL_LO19 Need to fixup with addend!.");
- }
- break;
-
- case R_AARCH64_CALL26:
- if (Rel->r_addend != 0 ) { /* TODO */
- Error (NULL, 0, 3000, "Invalid", "AArch64: R_AARCH64_CALL26 Need to fixup with addend!.");
- }
- break;
-
- case R_AARCH64_JUMP26:
- if (Rel->r_addend != 0 ) { /* TODO : AArch64 '-O2' optimisation. */
- Error (NULL, 0, 3000, "Invalid", "AArch64: R_AARCH64_JUMP26 Need to fixup with addend!.");
- }
- break;
-
- case R_AARCH64_ADR_PREL_PG_HI21:
- // TODO : AArch64 'small' memory model.
- Error (NULL, 0, 3000, "Invalid", "WriteSections64(): %s unsupported ELF EM_AARCH64 relocation R_AARCH64_ADR_PREL_PG_HI21.", mInImageName);
- break;
-
- case R_AARCH64_ADD_ABS_LO12_NC:
- // TODO : AArch64 'small' memory model.
- Error (NULL, 0, 3000, "Invalid", "WriteSections64(): %s unsupported ELF EM_AARCH64 relocation R_AARCH64_ADD_ABS_LO12_NC.", mInImageName);
- break;
-
- // Absolute relocations.
- case R_AARCH64_ABS64:
- *(UINT64 *)Targ = *(UINT64 *)Targ - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx];
- break;
-
- default:
- Error (NULL, 0, 3000, "Invalid", "WriteSections64(): %s unsupported ELF EM_AARCH64 relocation 0x%x.", mInImageName, (unsigned) ELF_R_TYPE(Rel->r_info));
- }
- } else {
- Error (NULL, 0, 3000, "Invalid", "Not a supported machine type");
- }
- }
- }
- }
-
- return TRUE;
-}
-
-STATIC
-VOID
-WriteRelocations64 (
- VOID
- )
-{
- UINT32 Index;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
- EFI_IMAGE_DATA_DIRECTORY *Dir;
-
- for (Index = 0; Index < mEhdr->e_shnum; Index++) {
- Elf_Shdr *RelShdr = GetShdrByIndex(Index);
- if ((RelShdr->sh_type == SHT_REL) || (RelShdr->sh_type == SHT_RELA)) {
- Elf_Shdr *SecShdr = GetShdrByIndex (RelShdr->sh_info);
- if (IsTextShdr(SecShdr) || IsDataShdr(SecShdr)) {
- UINT64 RelIdx;
-
- for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {
- Elf_Rela *Rel = (Elf_Rela *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);
-
- if (mEhdr->e_machine == EM_X86_64) {
- switch (ELF_R_TYPE(Rel->r_info)) {
- case R_X86_64_NONE:
- case R_X86_64_PC32:
- break;
- case R_X86_64_64:
- VerboseMsg ("EFI_IMAGE_REL_BASED_DIR64 Offset: 0x%08X",
- mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr));
- CoffAddFixup(
- (UINT32) ((UINT64) mCoffSectionsOffset[RelShdr->sh_info]
- + (Rel->r_offset - SecShdr->sh_addr)),
- EFI_IMAGE_REL_BASED_DIR64);
- break;
- case R_X86_64_32S:
- case R_X86_64_32:
- VerboseMsg ("EFI_IMAGE_REL_BASED_HIGHLOW Offset: 0x%08X",
- mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr));
- CoffAddFixup(
- (UINT32) ((UINT64) mCoffSectionsOffset[RelShdr->sh_info]
- + (Rel->r_offset - SecShdr->sh_addr)),
- EFI_IMAGE_REL_BASED_HIGHLOW);
- break;
- default:
- Error (NULL, 0, 3000, "Invalid", "%s unsupported ELF EM_X86_64 relocation 0x%x.", mInImageName, (unsigned) ELF_R_TYPE(Rel->r_info));
- }
- } else if (mEhdr->e_machine == EM_AARCH64) {
- // AArch64 GCC uses RELA relocation, so all relocations has to be fixed up. ARM32 uses REL.
- switch (ELF_R_TYPE(Rel->r_info)) {
- case R_AARCH64_LD_PREL_LO19:
- break;
-
- case R_AARCH64_CALL26:
- break;
-
- case R_AARCH64_JUMP26:
- break;
-
- case R_AARCH64_ADR_PREL_PG_HI21:
- // TODO : AArch64 'small' memory model.
- Error (NULL, 0, 3000, "Invalid", "WriteRelocations64(): %s unsupported ELF EM_AARCH64 relocation R_AARCH64_ADR_PREL_PG_HI21.", mInImageName);
- break;
-
- case R_AARCH64_ADD_ABS_LO12_NC:
- // TODO : AArch64 'small' memory model.
- Error (NULL, 0, 3000, "Invalid", "WriteRelocations64(): %s unsupported ELF EM_AARCH64 relocation R_AARCH64_ADD_ABS_LO12_NC.", mInImageName);
- break;
-
- case R_AARCH64_ABS64:
- CoffAddFixup(
- (UINT32) ((UINT64) mCoffSectionsOffset[RelShdr->sh_info]
- + (Rel->r_offset - SecShdr->sh_addr)),
- EFI_IMAGE_REL_BASED_DIR64);
- break;
-
- case R_AARCH64_ABS32:
- CoffAddFixup(
- (UINT32) ((UINT64) mCoffSectionsOffset[RelShdr->sh_info]
- + (Rel->r_offset - SecShdr->sh_addr)),
- EFI_IMAGE_REL_BASED_HIGHLOW);
- break;
-
- default:
- Error (NULL, 0, 3000, "Invalid", "WriteRelocations64(): %s unsupported ELF EM_AARCH64 relocation 0x%x.", mInImageName, (unsigned) ELF_R_TYPE(Rel->r_info));
- }
- } else {
- Error (NULL, 0, 3000, "Not Supported", "This tool does not support relocations for ELF with e_machine %u (processor type).", (unsigned) mEhdr->e_machine);
- }
- }
- }
- }
- }
-
- //
- // Pad by adding empty entries.
- //
- while (mCoffOffset & (mCoffAlignment - 1)) {
- CoffAddFixupEntry(0);
- }
-
- NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);
- Dir = &NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- Dir->Size = mCoffOffset - mRelocOffset;
- if (Dir->Size == 0) {
- // If no relocations, null out the directory entry and don't add the .reloc section
- Dir->VirtualAddress = 0;
- NtHdr->Pe32Plus.FileHeader.NumberOfSections--;
- } else {
- Dir->VirtualAddress = mRelocOffset;
- CreateSectionHeader (".reloc", mRelocOffset, mCoffOffset - mRelocOffset,
- EFI_IMAGE_SCN_CNT_INITIALIZED_DATA
- | EFI_IMAGE_SCN_MEM_DISCARDABLE
- | EFI_IMAGE_SCN_MEM_READ);
- }
-}
-
-STATIC
-VOID
-WriteDebug64 (
- VOID
- )
-{
- UINT32 Len;
- UINT32 DebugOffset;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
- EFI_IMAGE_DATA_DIRECTORY *DataDir;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *Dir;
- EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY *Nb10;
-
- Len = strlen(mInImageName) + 1;
- DebugOffset = mCoffOffset;
-
- mCoffOffset += sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)
- + sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY)
- + Len;
- mCoffOffset = CoffAlign(mCoffOffset);
-
- mCoffFile = realloc(mCoffFile, mCoffOffset);
- memset(mCoffFile + DebugOffset, 0, mCoffOffset - DebugOffset);
-
- Dir = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY*)(mCoffFile + DebugOffset);
- Dir->Type = EFI_IMAGE_DEBUG_TYPE_CODEVIEW;
- Dir->SizeOfData = sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) + Len;
- Dir->RVA = DebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY);
- Dir->FileOffset = DebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY);
-
- Nb10 = (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY*)(Dir + 1);
- Nb10->Signature = CODEVIEW_SIGNATURE_NB10;
- strcpy ((char *)(Nb10 + 1), mInImageName);
-
-
- NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);
- DataDir = &NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG];
- DataDir->VirtualAddress = DebugOffset;
- DataDir->Size = mCoffOffset - DebugOffset;
- if (DataDir->Size == 0) {
- // If no debug, null out the directory entry and don't add the .debug section
- DataDir->VirtualAddress = 0;
- NtHdr->Pe32Plus.FileHeader.NumberOfSections--;
- } else {
- DataDir->VirtualAddress = DebugOffset;
- CreateSectionHeader (".debug", DebugOffset, mCoffOffset - DebugOffset,
- EFI_IMAGE_SCN_CNT_INITIALIZED_DATA
- | EFI_IMAGE_SCN_MEM_DISCARDABLE
- | EFI_IMAGE_SCN_MEM_READ);
-
- }
-}
-
-STATIC
-VOID
-SetImageSize64 (
- VOID
- )
-{
- EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;
-
- //
- // Set image size
- //
- NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);
- NtHdr->Pe32Plus.OptionalHeader.SizeOfImage = mCoffOffset;
-}
-
-STATIC
-VOID
-CleanUp64 (
- VOID
- )
-{
- if (mCoffSectionsOffset != NULL) {
- free (mCoffSectionsOffset);
- }
-}
-
-
diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.h b/BaseTools/Source/C/GenFw/Elf64Convert.h
deleted file mode 100644
index 1fb95a8e42..0000000000
--- a/BaseTools/Source/C/GenFw/Elf64Convert.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @file
-
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _ELF_64_CONVERT_
-#define _ELF_64_CONVERT_
-
-BOOLEAN
-InitializeElf64 (
- UINT8 *FileBuffer,
- ELF_FUNCTION_TABLE *ElfFunctions
- );
-
-#endif
diff --git a/BaseTools/Source/C/GenFw/ElfConvert.c b/BaseTools/Source/C/GenFw/ElfConvert.c
deleted file mode 100644
index e573554d03..0000000000
--- a/BaseTools/Source/C/GenFw/ElfConvert.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/** @file
-
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
-
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "WinNtInclude.h"
-
-#ifndef __GNUC__
-#include <windows.h>
-#include <io.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-
-#include <Common/UefiBaseTypes.h>
-#include <IndustryStandard/PeImage.h>
-
-#include "EfiUtilityMsgs.h"
-
-#include "GenFw.h"
-#include "ElfConvert.h"
-#include "Elf32Convert.h"
-#include "Elf64Convert.h"
-
-//
-// Result Coff file in memory.
-//
-UINT8 *mCoffFile = NULL;
-
-//
-// COFF relocation data
-//
-EFI_IMAGE_BASE_RELOCATION *mCoffBaseRel;
-UINT16 *mCoffEntryRel;
-
-//
-// Current offset in coff file.
-//
-UINT32 mCoffOffset;
-
-//
-// Offset in Coff file of headers and sections.
-//
-UINT32 mTableOffset;
-
-//
-//*****************************************************************************
-// Common ELF Functions
-//*****************************************************************************
-//
-
-VOID
-CoffAddFixupEntry(
- UINT16 Val
- )
-{
- *mCoffEntryRel = Val;
- mCoffEntryRel++;
- mCoffBaseRel->SizeOfBlock += 2;
- mCoffOffset += 2;
-}
-
-VOID
-CoffAddFixup(
- UINT32 Offset,
- UINT8 Type
- )
-{
- if (mCoffBaseRel == NULL
- || mCoffBaseRel->VirtualAddress != (Offset & ~0xfff)) {
- if (mCoffBaseRel != NULL) {
- //
- // Add a null entry (is it required ?)
- //
- CoffAddFixupEntry (0);
-
- //
- // Pad for alignment.
- //
- if (mCoffOffset % 4 != 0)
- CoffAddFixupEntry (0);
- }
-
- mCoffFile = realloc (
- mCoffFile,
- mCoffOffset + sizeof(EFI_IMAGE_BASE_RELOCATION) + 2*0x1000
- );
- memset (
- mCoffFile + mCoffOffset, 0,
- sizeof(EFI_IMAGE_BASE_RELOCATION) + 2*0x1000
- );
-
- mCoffBaseRel = (EFI_IMAGE_BASE_RELOCATION*)(mCoffFile + mCoffOffset);
- mCoffBaseRel->VirtualAddress = Offset & ~0xfff;
- mCoffBaseRel->SizeOfBlock = sizeof(EFI_IMAGE_BASE_RELOCATION);
-
- mCoffEntryRel = (UINT16 *)(mCoffBaseRel + 1);
- mCoffOffset += sizeof(EFI_IMAGE_BASE_RELOCATION);
- }
-
- //
- // Fill the entry.
- //
- CoffAddFixupEntry((UINT16) ((Type << 12) | (Offset & 0xfff)));
-}
-
-VOID
-CreateSectionHeader (
- const CHAR8 *Name,
- UINT32 Offset,
- UINT32 Size,
- UINT32 Flags
- )
-{
- EFI_IMAGE_SECTION_HEADER *Hdr;
- Hdr = (EFI_IMAGE_SECTION_HEADER*)(mCoffFile + mTableOffset);
-
- strcpy((char *)Hdr->Name, Name);
- Hdr->Misc.VirtualSize = Size;
- Hdr->VirtualAddress = Offset;
- Hdr->SizeOfRawData = Size;
- Hdr->PointerToRawData = Offset;
- Hdr->PointerToRelocations = 0;
- Hdr->PointerToLinenumbers = 0;
- Hdr->NumberOfRelocations = 0;
- Hdr->NumberOfLinenumbers = 0;
- Hdr->Characteristics = Flags;
-
- mTableOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
-}
-
-//
-//*****************************************************************************
-// Functions called from GenFw main code.
-//*****************************************************************************
-//
-
-INTN
-IsElfHeader (
- UINT8 *FileBuffer
-)
-{
- return (FileBuffer[EI_MAG0] == ELFMAG0 &&
- FileBuffer[EI_MAG1] == ELFMAG1 &&
- FileBuffer[EI_MAG2] == ELFMAG2 &&
- FileBuffer[EI_MAG3] == ELFMAG3);
-}
-
-BOOLEAN
-ConvertElf (
- UINT8 **FileBuffer,
- UINT32 *FileLength
- )
-{
- ELF_FUNCTION_TABLE ElfFunctions;
- UINT8 EiClass;
-
- //
- // Determine ELF type and set function table pointer correctly.
- //
- VerboseMsg ("Check Elf Image Header");
- EiClass = (*FileBuffer)[EI_CLASS];
- if (EiClass == ELFCLASS32) {
- if (!InitializeElf32 (*FileBuffer, &ElfFunctions)) {
- return FALSE;
- }
- } else if (EiClass == ELFCLASS64) {
- if (!InitializeElf64 (*FileBuffer, &ElfFunctions)) {
- return FALSE;
- }
- } else {
- Error (NULL, 0, 3000, "Unsupported", "ELF EI_CLASS not supported.");
- return FALSE;
- }
-
- //
- // Compute sections new address.
- //
- VerboseMsg ("Compute sections new address.");
- ElfFunctions.ScanSections ();
-
- //
- // Write and relocate sections.
- //
- VerboseMsg ("Write and relocate sections.");
- ElfFunctions.WriteSections (SECTION_TEXT);
- ElfFunctions.WriteSections (SECTION_DATA);
- ElfFunctions.WriteSections (SECTION_HII);
-
- //
- // Translate and write relocations.
- //
- VerboseMsg ("Translate and write relocations.");
- ElfFunctions.WriteRelocations ();
-
- //
- // Write debug info.
- //
- VerboseMsg ("Write debug info.");
- ElfFunctions.WriteDebug ();
-
- //
- // Make sure image size is correct before returning the new image.
- //
- VerboseMsg ("Set image size.");
- ElfFunctions.SetImageSize ();
-
- //
- // Replace.
- //
- free (*FileBuffer);
- *FileBuffer = mCoffFile;
- *FileLength = mCoffOffset;
-
- //
- // Free resources used by ELF functions.
- //
- ElfFunctions.CleanUp ();
-
- return TRUE;
-}
diff --git a/BaseTools/Source/C/GenFw/ElfConvert.h b/BaseTools/Source/C/GenFw/ElfConvert.h
deleted file mode 100644
index 185dbb759c..0000000000
--- a/BaseTools/Source/C/GenFw/ElfConvert.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/** @file
-
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
-
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _ELF_CONVERT_H_
-#define _ELF_CONVERT_H_
-
-#include "elf_common.h"
-#include "elf32.h"
-#include "elf64.h"
-
-//
-// Externally defined variables
-//
-extern UINT32 mCoffOffset;
-extern CHAR8 *mInImageName;
-extern UINT32 mImageTimeStamp;
-extern UINT8 *mCoffFile;
-extern UINT32 mTableOffset;
-extern UINT32 mOutImageType;
-
-//
-// Common EFI specific data.
-//
-#define ELF_HII_SECTION_NAME ".hii"
-
-//
-// Filter Types
-//
-typedef enum {
- SECTION_TEXT,
- SECTION_HII,
- SECTION_DATA
-
-} SECTION_FILTER_TYPES;
-
-//
-// FunctionTalbe
-//
-typedef struct {
- VOID (*ScanSections) ();
- BOOLEAN (*WriteSections) (SECTION_FILTER_TYPES FilterType);
- VOID (*WriteRelocations) ();
- VOID (*WriteDebug) ();
- VOID (*SetImageSize) ();
- VOID (*CleanUp) ();
-
-} ELF_FUNCTION_TABLE;
-
-//
-// Common functions
-//
-VOID
-CoffAddFixup (
- UINT32 Offset,
- UINT8 Type
- );
-
-VOID
-CoffAddFixupEntry (
- UINT16 Val
- );
-
-
-VOID
-CreateSectionHeader (
- const CHAR8 *Name,
- UINT32 Offset,
- UINT32 Size,
- UINT32 Flags
- );
-
-#endif
diff --git a/BaseTools/Source/C/GenFw/GNUmakefile b/BaseTools/Source/C/GenFw/GNUmakefile
deleted file mode 100644
index ec5b87265f..0000000000
--- a/BaseTools/Source/C/GenFw/GNUmakefile
+++ /dev/null
@@ -1,30 +0,0 @@
-## @file
-# GNU/Linux makefile for 'GenFw' module build.
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = GenFw
-
-OBJECTS = GenFw.o ElfConvert.o Elf32Convert.o Elf64Convert.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
-
-LIBS = -lCommon
-ifeq ($(CYGWIN), CYGWIN)
- LIBS += -L/lib/e2fsprogs -luuid
-endif
-
-ifeq ($(LINUX), Linux)
- LIBS += -luuid
-endif
-
diff --git a/BaseTools/Source/C/GenFw/GenFw.c b/BaseTools/Source/C/GenFw/GenFw.c
deleted file mode 100644
index d511834fc0..0000000000
--- a/BaseTools/Source/C/GenFw/GenFw.c
+++ /dev/null
@@ -1,3200 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- GenFw.c
-
-Abstract:
-
- Converts a pe32+ image to an FW, Te image type, or other specific image.
-
-**/
-
-#include "WinNtInclude.h"
-
-#ifndef __GNUC__
-#include <windows.h>
-#include <io.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-
-#include <Common/UefiBaseTypes.h>
-#include <IndustryStandard/PeImage.h>
-#include <Common/UefiInternalFormRepresentation.h>
-
-//
-// Acpi Table definition
-//
-#include <IndustryStandard/Acpi.h>
-#include <IndustryStandard/Acpi1_0.h>
-#include <IndustryStandard/Acpi2_0.h>
-#include <IndustryStandard/Acpi3_0.h>
-#include <IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h>
-
-#include "CommonLib.h"
-#include "PeCoffLib.h"
-#include "ParseInf.h"
-#include "EfiUtilityMsgs.h"
-
-#include "GenFw.h"
-
-//
-// Version of this utility
-//
-#define UTILITY_NAME "GenFw"
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 2
-
-#define HII_RESOURCE_SECTION_INDEX 1
-#define HII_RESOURCE_SECTION_NAME "HII"
-
-#define DEFAULT_MC_PAD_BYTE_VALUE 0xFF
-#define DEFAULT_MC_ALIGNMENT 16
-
-#ifndef _MAX_PATH
-#define _MAX_PATH 500
-#endif
-
-#define STATUS_IGNORE 0xA
-//
-// Structure definition for a microcode header
-//
-typedef struct {
- UINT32 HeaderVersion;
- UINT32 PatchId;
- UINT32 Date;
- UINT32 CpuId;
- UINT32 Checksum;
- UINT32 LoaderVersion;
- UINT32 PlatformId;
- UINT32 DataSize; // if 0, then TotalSize = 2048, and TotalSize field is invalid
- UINT32 TotalSize; // number of bytes
- UINT32 Reserved[3];
-} MICROCODE_IMAGE_HEADER;
-
-static EFI_GUID mZeroGuid = {0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
-
-static const char *gHiiPackageRCFileHeader[] = {
- "//",
- "// DO NOT EDIT -- auto-generated file",
- "//",
- NULL
-};
-
-//
-// Module image information
-//
-CHAR8 *mInImageName;
-UINT32 mImageTimeStamp = 0;
-UINT32 mImageSize = 0;
-UINT32 mOutImageType = FW_DUMMY_IMAGE;
-
-
-STATIC
-EFI_STATUS
-ZeroDebugData (
- IN OUT UINT8 *FileBuffer,
- BOOLEAN ZeroDebug
- );
-
-STATIC
-EFI_STATUS
-SetStamp (
- IN OUT UINT8 *FileBuffer,
- IN CHAR8 *TimeStamp
- );
-
-STATIC
-STATUS
-MicrocodeReadData (
- FILE *InFptr,
- UINT32 *Data
- );
-
-STATIC
-VOID
-Version (
- VOID
- )
-/*++
-
-Routine Description:
-
- Print out version information for this utility.
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-STATIC
-VOID
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- Print Help message.
-
-Arguments:
-
- VOID
-
-Returns:
-
- None
-
---*/
-{
- //
- // Summary usage
- //
- fprintf (stdout, "\nUsage: %s [options] <input_file>\n\n", UTILITY_NAME);
-
- //
- // Copyright declaration
- //
- fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
-
- //
- // Details Option
- //
- fprintf (stdout, "Options:\n");
- fprintf (stdout, " -o FileName, --outputfile FileName\n\
- File will be created to store the ouput content.\n");
- fprintf (stdout, " -e EFI_FILETYPE, --efiImage EFI_FILETYPE\n\
- Create Efi Image. EFI_FILETYPE is one of BASE,SMM_CORE,\n\
- PEI_CORE, PEIM, DXE_CORE, DXE_DRIVER, UEFI_APPLICATION,\n\
- SEC, DXE_SAL_DRIVER, UEFI_DRIVER, DXE_RUNTIME_DRIVER,\n\
- DXE_SMM_DRIVER, SECURITY_CORE, COMBINED_PEIM_DRIVER,\n\
- PIC_PEIM, RELOCATABLE_PEIM, BS_DRIVER, RT_DRIVER,\n\
- APPLICATION, SAL_RT_DRIVER to support all module types\n\
- It can only be used together with --keepexceptiontable,\n\
- --keepzeropending, -r, -o option.It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " -c, --acpi Create Acpi table.\n\
- It can't be combined with other action options\n\
- except for -o, -r option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " -t, --terse Create Te Image.\n\
- It can only be used together with --keepexceptiontable,\n\
- --keepzeropending, -r, -o option.It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " -u, --dump Dump TeImage Header.\n\
- It can't be combined with other action options\n\
- except for -o, -r option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " -z, --zero Zero the Debug Data Fields in the PE input image file.\n\
- It also zeros the time stamp fields.\n\
- This option can be used to compare the binary efi image.\n\
- It can't be combined with other action options\n\
- except for -o, -r option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " -b, --exe2bin Convert the input EXE to the output BIN file.\n\
- It can't be combined with other action options\n\
- except for -o, -r option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");;
- fprintf (stdout, " -l, --stripped Strip off the relocation info from PE or TE image.\n\
- It can't be combined with other action options\n\
- except for -o, -r option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " -s timedate, --stamp timedate\n\
- timedate format is \"yyyy-mm-dd 00:00:00\". if timedata \n\
- is set to NOW, current system time is used. The support\n\
- date scope is 1970-01-01 00+timezone:00:00\n\
- ~ 2038-01-19 03+timezone:14:07\n\
- The scope is adjusted according to the different zones.\n\
- It can't be combined with other action options\n\
- except for -o, -r option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " -m, --mcifile Convert input microcode txt file to microcode bin file.\n\
- It can't be combined with other action options\n\
- except for -o option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " -j, --join Combine multi microcode bin files to one file.\n\
- It can be specified with -a, -p, -o option.\n\
- No other options can be combined with it.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " -a NUM, --align NUM NUM is one HEX or DEC format alignment value.\n\
- This option is only used together with -j option.\n");
- fprintf (stdout, " -p NUM, --pad NUM NUM is one HEX or DEC format padding value.\n\
- This option is only used together with -j option.\n");
- fprintf (stdout, " --keepexceptiontable Don't clear exception table.\n\
- This option can be used together with -e or -t.\n\
- It doesn't work for other options.\n");
- fprintf (stdout, " --keepzeropending Don't strip zero pending of .reloc.\n\
- This option can be used together with -e or -t.\n\
- It doesn't work for other options.\n");
- fprintf (stdout, " -r, --replace Overwrite the input file with the output content.\n\
- If more input files are specified,\n\
- the last input file will be as the output file.\n");
- fprintf (stdout, " -g HiiPackageListGuid, --hiiguid HiiPackageListGuid\n\
- Guid is used to specify hii package list guid.\n\
- Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n\
- If not specified, the first Form FormSet guid is used.\n");
- fprintf (stdout, " --hiipackage Combine all input binary hii pacakges into \n\
- a single package list as the text resource data(RC).\n\
- It can't be combined with other action options\n\
- except for -o option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " --hiibinpackage Combine all input binary hii pacakges into \n\
- a single package list as the binary resource section.\n\
- It can't be combined with other action options\n\
- except for -o option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " --rebase NewAddress Rebase image to new base address. New address \n\
- is also set to the first none code section header.\n\
- It can't be combined with other action options\n\
- except for -o or -r option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " --address NewAddress Set new address into the first none code \n\
- section header of the input image.\n\
- It can't be combined with other action options\n\
- except for -o or -r option. It is a action option.\n\
- If it is combined with other action options, the later\n\
- input action option will override the previous one.\n");
- fprintf (stdout, " -v, --verbose Turn on verbose output with informational messages.\n");
- fprintf (stdout, " -q, --quiet Disable all messages except key message and fatal error\n");
- fprintf (stdout, " -d, --debug level Enable debug messages, at input debug level.\n");
- fprintf (stdout, " --version Show program's version number and exit\n");
- fprintf (stdout, " -h, --help Show this help message and exit\n");
-}
-
-STATIC
-STATUS
-CheckAcpiTable (
- VOID *AcpiTable,
- UINT32 Length
- )
-/*++
-
-Routine Description:
-
- Check Acpi Table
-
-Arguments:
-
- AcpiTable Buffer for AcpiSection
- Length AcpiSection Length
-
-Returns:
-
- 0 success
- non-zero otherwise
-
---*/
-{
- EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader;
- EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs;
- UINT32 ExpectedLength;
-
- AcpiHeader = (EFI_ACPI_DESCRIPTION_HEADER *)AcpiTable;
-
- //
- // Generic check for AcpiTable length.
- //
- if (AcpiHeader->Length > Length) {
- Error (NULL, 0, 3000, "Invalid", "AcpiTable length check failed.", NULL);
- return STATUS_ERROR;
- }
-
- //
- // Currently, we only check must-have tables: FADT, FACS, DSDT,
- // and some important tables: MADT, MCFG.
- //
- switch (AcpiHeader->Signature) {
-
- //
- // "FACP" Fixed ACPI Description Table
- //
- case EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE:
- switch (AcpiHeader->Revision) {
- case EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION:
- ExpectedLength = sizeof(EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE);
- break;
- case EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION:
- ExpectedLength = sizeof(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE);
- break;
- case EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION:
- ExpectedLength = sizeof(EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE);
- break;
- default:
- if (AcpiHeader->Revision > EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION) {
- ExpectedLength = AcpiHeader->Length;
- break;
- }
- Error (NULL, 0, 3000, "Invalid", "FACP revision check failed.");
- return STATUS_ERROR;
- }
- if (ExpectedLength != AcpiHeader->Length) {
- Error (NULL, 0, 3000, "Invalid", "FACP length check failed.");
- return STATUS_ERROR;
- }
- break;
-
- //
- // "FACS" Firmware ACPI Control Structure
- //
- case EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE:
- Facs = (EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)AcpiTable;
- if (Facs->Version > EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION) {
- break;
- }
- if ((Facs->Version != EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION) &&
- (Facs->Version != EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION) &&
- (Facs->Version != EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION)){
- Error (NULL, 0, 3000, "Invalid", "FACS version check failed.");
- return STATUS_ERROR;
- }
- if ((Facs->Length != sizeof(EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE)) &&
- (Facs->Length != sizeof(EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE)) &&
- (Facs->Length != sizeof(EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE))) {
- Error (NULL, 0, 3000, "Invalid", "FACS length check failed.");
- return STATUS_ERROR;
- }
- break;
-
- //
- // "DSDT" Differentiated System Description Table
- //
- case EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE:
- if (AcpiHeader->Revision > EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION) {
- break;
- }
- if (AcpiHeader->Length <= sizeof(EFI_ACPI_DESCRIPTION_HEADER)) {
- Error (NULL, 0, 3000, "Invalid", "DSDT length check failed.");
- return STATUS_ERROR;
- }
- break;
-
- //
- // "APIC" Multiple APIC Description Table
- //
- case EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE:
- if (AcpiHeader->Revision > EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) {
- break;
- }
- if ((AcpiHeader->Revision != EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) &&
- (AcpiHeader->Revision != EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) &&
- (AcpiHeader->Revision != EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION)) {
- Error (NULL, 0, 3000, "Invalid", "APIC revision check failed.");
- return STATUS_ERROR;
- }
- if (AcpiHeader->Length <= sizeof(EFI_ACPI_DESCRIPTION_HEADER) + sizeof(UINT32) + sizeof(UINT32)) {
- Error (NULL, 0, 3000, "Invalid", "APIC length check failed.");
- return STATUS_ERROR;
- }
- break;
-
- //
- // "MCFG" PCI Express Memory Mapped Configuration Space Base Address Description Table
- //
- case EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE:
- if (AcpiHeader->Revision > EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION) {
- break;
- }
- if (AcpiHeader->Revision != EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION) {
- Error (NULL, 0, 3000, "Invalid", "MCFG revision check failed.");
- return STATUS_ERROR;
- }
- if (AcpiHeader->Length <= sizeof(EFI_ACPI_DESCRIPTION_HEADER) + sizeof(UINT64)) {
- Error (NULL, 0, 3000, "Invalid", "MCFG length check failed.");
- return STATUS_ERROR;
- }
- break;
-
- //
- // Other table pass check
- //
- default:
- break;
- }
-
- return STATUS_SUCCESS;
-}
-
-VOID
-SetHiiResourceHeader (
- UINT8 *HiiBinData,
- UINT32 OffsetToFile
- )
-{
- UINT32 Index;
- EFI_IMAGE_RESOURCE_DIRECTORY *ResourceDirectory;
- EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *ResourceDirectoryEntry;
- EFI_IMAGE_RESOURCE_DIRECTORY_STRING *ResourceDirectoryString;
- EFI_IMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry;
-
- //
- // Fill Resource section entry
- //
- ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (HiiBinData);
- ResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (ResourceDirectory + 1);
- for (Index = 0; Index < ResourceDirectory->NumberOfNamedEntries; Index ++) {
- if (ResourceDirectoryEntry->u1.s.NameIsString) {
- ResourceDirectoryString = (EFI_IMAGE_RESOURCE_DIRECTORY_STRING *) (HiiBinData + ResourceDirectoryEntry->u1.s.NameOffset);
-
- if (ResourceDirectoryString->Length == 3 &&
- ResourceDirectoryString->String[0] == L'H' &&
- ResourceDirectoryString->String[1] == L'I' &&
- ResourceDirectoryString->String[2] == L'I') {
- //
- // Resource Type "HII" found
- //
- if (ResourceDirectoryEntry->u2.s.DataIsDirectory) {
- //
- // Move to next level - resource Name
- //
- ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (HiiBinData + ResourceDirectoryEntry->u2.s.OffsetToDirectory);
- ResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (ResourceDirectory + 1);
-
- if (ResourceDirectoryEntry->u2.s.DataIsDirectory) {
- //
- // Move to next level - resource Language
- //
- ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (HiiBinData + ResourceDirectoryEntry->u2.s.OffsetToDirectory);
- ResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (ResourceDirectory + 1);
- }
- }
-
- //
- // Now it ought to be resource Data and update its OffsetToData value
- //
- if (!ResourceDirectoryEntry->u2.s.DataIsDirectory) {
- ResourceDataEntry = (EFI_IMAGE_RESOURCE_DATA_ENTRY *) (HiiBinData + ResourceDirectoryEntry->u2.OffsetToData);
- ResourceDataEntry->OffsetToData = ResourceDataEntry->OffsetToData + OffsetToFile;
- break;
- }
- }
- }
- ResourceDirectoryEntry++;
- }
-
- return;
-}
-
-EFI_IMAGE_OPTIONAL_HEADER_UNION *
-GetPeCoffHeader (
- void *Data
- )
-{
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *PeHdr;
-
- //
- // Read the dos & pe hdrs of the image
- //
- DosHdr = (EFI_IMAGE_DOS_HEADER *)Data;
- if (DosHdr->e_magic != EFI_IMAGE_DOS_SIGNATURE) {
- // NO DOS header, check for PE/COFF header
- PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(Data);
- if (PeHdr->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) {
- return NULL;
- }
- } else {
-
- PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(((UINT8 *)Data) + DosHdr->e_lfanew);
- if (PeHdr->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) {
- return NULL;
- }
- }
-
- return PeHdr;
-}
-
-void
-PeCoffConvertImageToXip (
- UINT8 **FileBuffer,
- UINT32 *FileLength
- )
-{
- EFI_IMAGE_OPTIONAL_HEADER_UNION *PeHdr;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *NewPeHdr;
- EFI_IMAGE_SECTION_HEADER *SectionHeader;
- UINTN TotalNecessaryFileSize;
- UINTN SectionSize;
- UINT8 *XipFile;
- UINT32 XipLength;
- UINTN Index;
- UINTN FirstSectionOffset;
- BOOLEAN ConversionNeeded;
-
- PeHdr = GetPeCoffHeader ((void *) *FileBuffer);
- if (PeHdr == NULL) {
- return;
- }
-
- if (PeHdr->Pe32.OptionalHeader.SectionAlignment != PeHdr->Pe32.OptionalHeader.FileAlignment) {
- //
- // The only reason to expand zero fill sections is to make them compatible with XIP images.
- // If SectionAlignment is not equal to FileAlginment then it is not an XIP type image.
- //
- return;
- }
-
- //
- // Calculate size of XIP file, and determine if the conversion is needed.
- //
- ConversionNeeded = FALSE;
- XipLength = 0;
- FirstSectionOffset = *FileLength;
- TotalNecessaryFileSize = 0;
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) {
- SectionSize = MAX (SectionHeader->Misc.VirtualSize, SectionHeader->SizeOfRawData);
- TotalNecessaryFileSize += SectionSize;
- if (SectionSize > 0) {
- FirstSectionOffset = MIN (FirstSectionOffset, SectionHeader->VirtualAddress);
- XipLength = MAX (XipLength, SectionHeader->VirtualAddress + SectionSize);
- if (SectionHeader->VirtualAddress != SectionHeader->PointerToRawData) {
- ConversionNeeded = TRUE;
- }
- }
- if (SectionHeader->Misc.VirtualSize > SectionHeader->SizeOfRawData) {
- ConversionNeeded = TRUE;
- }
- }
-
- if (FirstSectionOffset < PeHdr->Pe32.OptionalHeader.SizeOfHeaders) {
- //
- // If one of the sections should be loaded to an offset overlapping with
- // the executable header, then it cannot be made into an XIP image.
- //
- VerboseMsg ("PE/COFF conversion to XIP is impossible due to overlap");
- VerboseMsg ("of section data with the executable header.");
- return;
- }
-
- if (FirstSectionOffset == *FileLength) {
- //
- // If we never found a section with a non-zero size, then we
- // skip the conversion.
- //
- return;
- }
-
- TotalNecessaryFileSize += FirstSectionOffset;
-
- if (!ConversionNeeded) {
- return;
- }
-
- if (XipLength > (2 * TotalNecessaryFileSize)) {
- VerboseMsg ("PE/COFF conversion to XIP appears to be larger than necessary.");
- VerboseMsg ("The image linking process may have left unused memory ranges.");
- }
-
- if (PeHdr->Pe32.FileHeader.PointerToSymbolTable != 0) {
- //
- // This field is obsolete and should be zero
- //
- PeHdr->Pe32.FileHeader.PointerToSymbolTable = 0;
- }
-
- //
- // Allocate the extra space that we need to grow the image
- //
- XipFile = malloc (XipLength);
- memset (XipFile, 0, XipLength);
-
- //
- // Copy the file headers
- //
- memcpy (XipFile, *FileBuffer, PeHdr->Pe32.OptionalHeader.SizeOfHeaders);
-
- NewPeHdr = GetPeCoffHeader ((void *)XipFile);
- if (NewPeHdr == NULL) {
- free (XipFile);
- return;
- }
-
- //
- // Copy the section data over to the appropriate XIP offsets
- //
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(NewPeHdr->Pe32.OptionalHeader) + NewPeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) {
- if (SectionHeader->SizeOfRawData > 0) {
- memcpy (
- XipFile + SectionHeader->VirtualAddress,
- *FileBuffer + SectionHeader->PointerToRawData,
- SectionHeader->SizeOfRawData
- );
- }
- //
- // Make the size of raw data in section header alignment.
- //
- SectionHeader->SizeOfRawData = (SectionHeader->Misc.VirtualSize + PeHdr->Pe32.OptionalHeader.FileAlignment - 1) & (~(PeHdr->Pe32.OptionalHeader.FileAlignment - 1));
- SectionHeader->PointerToRawData = SectionHeader->VirtualAddress;
- }
-
- free (*FileBuffer);
- *FileLength = XipLength;
- *FileBuffer = XipFile;
-}
-
-UINT8 *
-CreateHiiResouceSectionHeader (
- UINT32 *pSectionHeaderSize,
- UINT32 HiiDataSize
- )
-/*++
-
-Routine Description:
-
- Create COFF resource section header
-
-Arguments:
-
- pSectionHeaderSize - Pointer to section header size.
- HiiDataSize - Size of the total HII data in section.
-
-Returns:
- The created section header buffer.
-
---*/
-{
- UINT32 HiiSectionHeaderSize;
- UINT32 HiiSectionOffset;
- UINT8 *HiiSectionHeader;
- EFI_IMAGE_RESOURCE_DIRECTORY *ResourceDirectory;
- EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *TypeResourceDirectoryEntry;
- EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *NameResourceDirectoryEntry;
- EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *LanguageResourceDirectoryEntry;
- EFI_IMAGE_RESOURCE_DIRECTORY_STRING *ResourceDirectoryString;
- EFI_IMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry;
-
- //
- // Calculate the total size for the resource header (include Type, Name and Language)
- // then allocate memory for the resource header.
- //
- HiiSectionHeaderSize = 3 * (sizeof (EFI_IMAGE_RESOURCE_DIRECTORY) + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY))
- + 3 * (sizeof (UINT16) + 3 * sizeof (CHAR16))
- + sizeof (EFI_IMAGE_RESOURCE_DATA_ENTRY);
- HiiSectionHeader = malloc (HiiSectionHeaderSize);
- memset (HiiSectionHeader, 0, HiiSectionHeaderSize);
-
- HiiSectionOffset = 0;
- //
- // Create Type entry
- //
- ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (HiiSectionHeader + HiiSectionOffset);
- HiiSectionOffset += sizeof (EFI_IMAGE_RESOURCE_DIRECTORY);
- ResourceDirectory->NumberOfNamedEntries = 1;
- TypeResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (HiiSectionHeader + HiiSectionOffset);
- HiiSectionOffset += sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY);
- TypeResourceDirectoryEntry->u1.s.NameIsString = 1;
- TypeResourceDirectoryEntry->u2.s.DataIsDirectory = 1;
- TypeResourceDirectoryEntry->u2.s.OffsetToDirectory = HiiSectionOffset;
- //
- // Create Name entry
- //
- ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (HiiSectionHeader + HiiSectionOffset);
- HiiSectionOffset += sizeof (EFI_IMAGE_RESOURCE_DIRECTORY);
- ResourceDirectory->NumberOfNamedEntries = 1;
- NameResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (HiiSectionHeader + HiiSectionOffset);
- HiiSectionOffset += sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY);
- NameResourceDirectoryEntry->u1.s.NameIsString = 1;
- NameResourceDirectoryEntry->u2.s.DataIsDirectory = 1;
- NameResourceDirectoryEntry->u2.s.OffsetToDirectory = HiiSectionOffset;
- //
- // Create Language entry
- //
- ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (HiiSectionHeader + HiiSectionOffset);
- HiiSectionOffset += sizeof (EFI_IMAGE_RESOURCE_DIRECTORY);
- ResourceDirectory->NumberOfNamedEntries = 1;
- LanguageResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (HiiSectionHeader + HiiSectionOffset);
- HiiSectionOffset += sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY);
- LanguageResourceDirectoryEntry->u1.s.NameIsString = 1;
- //
- // Create string entry for Type
- //
- TypeResourceDirectoryEntry->u1.s.NameOffset = HiiSectionOffset;
- ResourceDirectoryString = (EFI_IMAGE_RESOURCE_DIRECTORY_STRING *) (HiiSectionHeader + HiiSectionOffset);
- ResourceDirectoryString->Length = 3;
- ResourceDirectoryString->String[0] = L'H';
- ResourceDirectoryString->String[1] = L'I';
- ResourceDirectoryString->String[2] = L'I';
- HiiSectionOffset = HiiSectionOffset + sizeof (ResourceDirectoryString->Length) + ResourceDirectoryString->Length * sizeof (ResourceDirectoryString->String[0]);
- //
- // Create string entry for Name
- //
- NameResourceDirectoryEntry->u1.s.NameOffset = HiiSectionOffset;
- ResourceDirectoryString = (EFI_IMAGE_RESOURCE_DIRECTORY_STRING *) (HiiSectionHeader + HiiSectionOffset);
- ResourceDirectoryString->Length = 3;
- ResourceDirectoryString->String[0] = L'E';
- ResourceDirectoryString->String[1] = L'F';
- ResourceDirectoryString->String[2] = L'I';
- HiiSectionOffset = HiiSectionOffset + sizeof (ResourceDirectoryString->Length) + ResourceDirectoryString->Length * sizeof (ResourceDirectoryString->String[0]);
- //
- // Create string entry for Language
- //
- LanguageResourceDirectoryEntry->u1.s.NameOffset = HiiSectionOffset;
- ResourceDirectoryString = (EFI_IMAGE_RESOURCE_DIRECTORY_STRING *) (HiiSectionHeader + HiiSectionOffset);
- ResourceDirectoryString->Length = 3;
- ResourceDirectoryString->String[0] = L'B';
- ResourceDirectoryString->String[1] = L'I';
- ResourceDirectoryString->String[2] = L'N';
- HiiSectionOffset = HiiSectionOffset + sizeof (ResourceDirectoryString->Length) + ResourceDirectoryString->Length * sizeof (ResourceDirectoryString->String[0]);
- //
- // Create Leaf data
- //
- LanguageResourceDirectoryEntry->u2.OffsetToData = HiiSectionOffset;
- ResourceDataEntry = (EFI_IMAGE_RESOURCE_DATA_ENTRY *) (HiiSectionHeader + HiiSectionOffset);
- HiiSectionOffset += sizeof (EFI_IMAGE_RESOURCE_DATA_ENTRY);
- ResourceDataEntry->OffsetToData = HiiSectionOffset;
- ResourceDataEntry->Size = HiiDataSize;
-
- *pSectionHeaderSize = HiiSectionHeaderSize;
- return HiiSectionHeader;
-}
-
-EFI_STATUS
-RebaseImageRead (
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINT32 *ReadSize,
- OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file
-
-Arguments:
-
- FileHandle - The handle to the PE/COFF file
-
- FileOffset - The offset, in bytes, into the file to read
-
- ReadSize - The number of bytes to read from the file starting at FileOffset
-
- Buffer - A pointer to the buffer to read the data into.
-
-Returns:
-
- EFI_SUCCESS - ReadSize bytes of data were read into Buffer from the PE/COFF file starting at FileOffset
-
---*/
-{
- CHAR8 *Destination8;
- CHAR8 *Source8;
- UINT32 Length;
-
- Destination8 = Buffer;
- Source8 = (CHAR8 *) ((UINTN) FileHandle + FileOffset);
- Length = *ReadSize;
- while (Length--) {
- *(Destination8++) = *(Source8++);
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-SetAddressToSectionHeader (
- IN CHAR8 *FileName,
- IN OUT UINT8 *FileBuffer,
- IN UINT64 NewPe32BaseAddress
- )
-/*++
-
-Routine Description:
-
- Set new base address into the section header of PeImage
-
-Arguments:
-
- FileName - Name of file
- FileBuffer - Pointer to PeImage.
- NewPe32BaseAddress - New Base Address for PE image.
-
-Returns:
-
- EFI_SUCCESS Set new base address into this image successfully.
-
---*/
-{
- EFI_STATUS Status;
- PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
- UINTN Index;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *ImgHdr;
- EFI_IMAGE_SECTION_HEADER *SectionHeader;
-
- //
- // Initialize context
- //
- memset (&ImageContext, 0, sizeof (ImageContext));
- ImageContext.Handle = (VOID *) FileBuffer;
- ImageContext.ImageRead = (PE_COFF_LOADER_READ_FILE) RebaseImageRead;
- Status = PeCoffLoaderGetImageInfo (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "The input PeImage %s is not valid", FileName);
- return Status;
- }
-
- if (ImageContext.RelocationsStripped) {
- Error (NULL, 0, 3000, "Invalid", "The input PeImage %s has no relocation to be fixed up", FileName);
- return Status;
- }
-
- //
- // Get PeHeader pointer
- //
- ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(FileBuffer + ImageContext.PeCoffHeaderOffset);
-
- //
- // Get section header list
- //
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (
- (UINTN) ImgHdr +
- sizeof (UINT32) +
- sizeof (EFI_IMAGE_FILE_HEADER) +
- ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader
- );
-
- //
- // Set base address into the first section header that doesn't point to code section.
- //
- for (Index = 0; Index < ImgHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) {
- if ((SectionHeader->Characteristics & EFI_IMAGE_SCN_CNT_CODE) == 0) {
- *(UINT64 *) &SectionHeader->PointerToRelocations = NewPe32BaseAddress;
- break;
- }
- }
-
- //
- // No available section header is found.
- //
- if (Index == ImgHdr->Pe32.FileHeader.NumberOfSections) {
- return EFI_NOT_FOUND;
- }
-
- //
- // BaseAddress is set to section header.
- //
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-RebaseImage (
- IN CHAR8 *FileName,
- IN OUT UINT8 *FileBuffer,
- IN UINT64 NewPe32BaseAddress
- )
-/*++
-
-Routine Description:
-
- Set new base address into PeImage, and fix up PeImage based on new address.
-
-Arguments:
-
- FileName - Name of file
- FileBuffer - Pointer to PeImage.
- NewPe32BaseAddress - New Base Address for PE image.
-
-Returns:
-
- EFI_INVALID_PARAMETER - BaseAddress is not valid.
- EFI_SUCCESS - Update PeImage is correctly.
-
---*/
-{
- EFI_STATUS Status;
- PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
- UINTN Index;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *ImgHdr;
- UINT8 *MemoryImagePointer;
- EFI_IMAGE_SECTION_HEADER *SectionHeader;
-
- //
- // Initialize context
- //
- memset (&ImageContext, 0, sizeof (ImageContext));
- ImageContext.Handle = (VOID *) FileBuffer;
- ImageContext.ImageRead = (PE_COFF_LOADER_READ_FILE) RebaseImageRead;
- Status = PeCoffLoaderGetImageInfo (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "The input PeImage %s is not valid", FileName);
- return Status;
- }
-
- if (ImageContext.RelocationsStripped) {
- Error (NULL, 0, 3000, "Invalid", "The input PeImage %s has no relocation to be fixed up", FileName);
- return Status;
- }
-
- //
- // Get PeHeader pointer
- //
- ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(FileBuffer + ImageContext.PeCoffHeaderOffset);
-
- //
- // Load and Relocate Image Data
- //
- MemoryImagePointer = (UINT8 *) malloc ((UINTN) ImageContext.ImageSize + ImageContext.SectionAlignment);
- if (MemoryImagePointer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated on rebase of %s", FileName);
- return EFI_OUT_OF_RESOURCES;
- }
- memset ((VOID *) MemoryImagePointer, 0, (UINTN) ImageContext.ImageSize + ImageContext.SectionAlignment);
- ImageContext.ImageAddress = ((UINTN) MemoryImagePointer + ImageContext.SectionAlignment - 1) & (~((INT64)ImageContext.SectionAlignment - 1));
-
- Status = PeCoffLoaderLoadImage (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "LocateImage() call failed on rebase of %s", FileName);
- free ((VOID *) MemoryImagePointer);
- return Status;
- }
-
- ImageContext.DestinationAddress = NewPe32BaseAddress;
- Status = PeCoffLoaderRelocateImage (&ImageContext);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "RelocateImage() call failed on rebase of %s", FileName);
- free ((VOID *) MemoryImagePointer);
- return Status;
- }
-
- //
- // Copy Relocated data to raw image file.
- //
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (
- (UINTN) ImgHdr +
- sizeof (UINT32) +
- sizeof (EFI_IMAGE_FILE_HEADER) +
- ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader
- );
-
- for (Index = 0; Index < ImgHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) {
- CopyMem (
- FileBuffer + SectionHeader->PointerToRawData,
- (VOID*) (UINTN) (ImageContext.ImageAddress + SectionHeader->VirtualAddress),
- SectionHeader->SizeOfRawData
- );
- }
-
- free ((VOID *) MemoryImagePointer);
-
- //
- // Update Image Base Address
- //
- if ((ImgHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) && (ImgHdr->Pe32.FileHeader.Machine != IMAGE_FILE_MACHINE_IA64)) {
- ImgHdr->Pe32.OptionalHeader.ImageBase = (UINT32) NewPe32BaseAddress;
- } else if (ImgHdr->Pe32Plus.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- ImgHdr->Pe32Plus.OptionalHeader.ImageBase = NewPe32BaseAddress;
- } else {
- Error (NULL, 0, 3000, "Invalid", "unknown PE magic signature %X in PE32 image %s",
- ImgHdr->Pe32.OptionalHeader.Magic,
- FileName
- );
- return EFI_ABORTED;
- }
-
- //
- // Set new base address into section header
- //
- Status = SetAddressToSectionHeader (FileName, FileBuffer, NewPe32BaseAddress);
-
- return Status;
-}
-
-int
-main (
- int argc,
- char *argv[]
- )
-/*++
-
-Routine Description:
-
- Main function.
-
-Arguments:
-
- argc - Number of command line parameters.
- argv - Array of pointers to command line parameter strings.
-
-Returns:
- STATUS_SUCCESS - Utility exits successfully.
- STATUS_ERROR - Some error occurred during execution.
-
---*/
-{
- UINT32 Type;
- UINT32 InputFileNum;
- CHAR8 **InputFileName;
- char *OutImageName;
- char *ModuleType;
- CHAR8 *TimeStamp;
- FILE *fpIn;
- FILE *fpOut;
- FILE *fpInOut;
- UINT32 Data;
- UINT32 *DataPointer;
- UINT32 *OldDataPointer;
- UINT32 CheckSum;
- UINT32 Index;
- UINT32 Index1;
- UINT32 Index2;
- UINT64 Temp64;
- UINT32 MciAlignment;
- UINT8 MciPadValue;
- UINT32 AllignedRelocSize;
- UINT8 *FileBuffer;
- UINT32 FileLength;
- UINT8 *OutputFileBuffer;
- UINT32 OutputFileLength;
- UINT8 *InputFileBuffer;
- UINT32 InputFileLength;
- RUNTIME_FUNCTION *RuntimeFunction;
- UNWIND_INFO *UnwindInfo;
- STATUS Status;
- BOOLEAN ReplaceFlag;
- BOOLEAN KeepExceptionTableFlag;
- BOOLEAN KeepZeroPendingFlag;
- UINT64 LogLevel;
- EFI_TE_IMAGE_HEADER TEImageHeader;
- EFI_TE_IMAGE_HEADER *TeHdr;
- EFI_IMAGE_SECTION_HEADER *SectionHeader;
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *PeHdr;
- EFI_IMAGE_OPTIONAL_HEADER32 *Optional32;
- EFI_IMAGE_OPTIONAL_HEADER64 *Optional64;
- EFI_IMAGE_DOS_HEADER BackupDosHdr;
- MICROCODE_IMAGE_HEADER *MciHeader;
- UINT8 *HiiPackageListBuffer;
- UINT8 *HiiPackageDataPointer;
- EFI_GUID HiiPackageListGuid;
- EFI_HII_PACKAGE_LIST_HEADER HiiPackageListHeader;
- EFI_HII_PACKAGE_HEADER HiiPackageHeader;
- EFI_IFR_FORM_SET IfrFormSet;
- UINT8 NumberOfFormPacakge;
- EFI_HII_PACKAGE_HEADER EndPackage;
- UINT32 HiiSectionHeaderSize;
- UINT8 *HiiSectionHeader;
- UINT64 NewBaseAddress;
- BOOLEAN NegativeAddr;
- FILE *ReportFile;
- CHAR8 *ReportFileName;
- UINTN FileLen;
- time_t InputFileTime;
- time_t OutputFileTime;
- struct stat Stat_Buf;
-
- SetUtilityName (UTILITY_NAME);
-
- //
- // Assign to fix compile warning
- //
- FileLen = 0;
- InputFileNum = 0;
- InputFileName = NULL;
- mInImageName = NULL;
- OutImageName = NULL;
- ModuleType = NULL;
- Type = 0;
- Status = STATUS_SUCCESS;
- FileBuffer = NULL;
- fpIn = NULL;
- fpOut = NULL;
- fpInOut = NULL;
- TimeStamp = NULL;
- MciAlignment = DEFAULT_MC_ALIGNMENT;
- MciPadValue = DEFAULT_MC_PAD_BYTE_VALUE;
- FileLength = 0;
- MciHeader = NULL;
- CheckSum = 0;
- ReplaceFlag = FALSE;
- LogLevel = 0;
- OutputFileBuffer = NULL;
- OutputFileLength = 0;
- InputFileBuffer = NULL;
- InputFileLength = 0;
- Optional32 = NULL;
- Optional64 = NULL;
- KeepExceptionTableFlag = FALSE;
- KeepZeroPendingFlag = FALSE;
- NumberOfFormPacakge = 0;
- HiiPackageListBuffer = NULL;
- HiiPackageDataPointer = NULL;
- EndPackage.Length = sizeof (EFI_HII_PACKAGE_HEADER);
- EndPackage.Type = EFI_HII_PACKAGE_END;
- memset (&HiiPackageListGuid, 0, sizeof (HiiPackageListGuid));
- HiiSectionHeaderSize = 0;
- HiiSectionHeader = NULL;
- NewBaseAddress = 0;
- NegativeAddr = FALSE;
- InputFileTime = 0;
- OutputFileTime = 0;
-
- if (argc == 1) {
- Error (NULL, 0, 1001, "Missing options", "No input options.");
- Usage ();
- return STATUS_ERROR;
- }
-
- argc --;
- argv ++;
-
- if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
- Version ();
- Usage ();
- return STATUS_SUCCESS;
- }
-
- if (stricmp (argv[0], "--version") == 0) {
- Version ();
- return STATUS_SUCCESS;
- }
-
- while (argc > 0) {
- if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--outputfile") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Output file name is missing for -o option");
- goto Finish;
- }
- OutImageName = argv[1];
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-e") == 0) || (stricmp (argv[0], "--efiImage") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Module Type is missing for -o option");
- goto Finish;
- }
- ModuleType = argv[1];
- if (mOutImageType != FW_TE_IMAGE) {
- mOutImageType = FW_EFI_IMAGE;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-l") == 0) || (stricmp (argv[0], "--stripped") == 0)) {
- mOutImageType = FW_RELOC_STRIPEED_IMAGE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-c") == 0) || (stricmp (argv[0], "--acpi") == 0)) {
- mOutImageType = FW_ACPI_IMAGE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-t") == 0) || (stricmp (argv[0], "--terse") == 0)) {
- mOutImageType = FW_TE_IMAGE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-u") == 0) || (stricmp (argv[0], "--dump") == 0)) {
- mOutImageType = DUMP_TE_HEADER;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-b") == 0) || (stricmp (argv[0], "--exe2bin") == 0)) {
- mOutImageType = FW_BIN_IMAGE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-z") == 0) || (stricmp (argv[0], "--zero") == 0)) {
- mOutImageType = FW_ZERO_DEBUG_IMAGE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-s") == 0) || (stricmp (argv[0], "--stamp") == 0)) {
- mOutImageType = FW_SET_STAMP_IMAGE;
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "time stamp is missing for -s option");
- goto Finish;
- }
- TimeStamp = argv[1];
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-r") == 0) || (stricmp (argv[0], "--replace") == 0)) {
- ReplaceFlag = TRUE;
- argc --;
- argv ++;
- continue;
- }
-
- if (stricmp (argv[0], "--keepexceptiontable") == 0) {
- KeepExceptionTableFlag = TRUE;
- argc --;
- argv ++;
- continue;
- }
-
- if (stricmp (argv[0], "--keepzeropending") == 0) {
- KeepZeroPendingFlag = TRUE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-m") == 0) || (stricmp (argv[0], "--mcifile") == 0)) {
- mOutImageType = FW_MCI_IMAGE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-j") == 0) || (stricmp (argv[0], "--join") == 0)) {
- mOutImageType = FW_MERGE_IMAGE;
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-a") == 0) || (stricmp (argv[0], "--align") == 0)) {
- if (AsciiStringToUint64 (argv[1], FALSE, &Temp64) != EFI_SUCCESS) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- MciAlignment = (UINT32) Temp64;
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "--rebase") == 0)) {
- if (argv[1][0] == '-') {
- NegativeAddr = TRUE;
- Status = AsciiStringToUint64 (argv[1] + 1, FALSE, &Temp64);
- } else {
- NegativeAddr = FALSE;
- Status = AsciiStringToUint64 (argv[1], FALSE, &Temp64);
- }
- if (Status != EFI_SUCCESS) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- mOutImageType = FW_REBASE_IMAGE;
- NewBaseAddress = (UINT64) Temp64;
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "--address") == 0)) {
- if (argv[1][0] == '-') {
- NegativeAddr = TRUE;
- Status = AsciiStringToUint64 (argv[1] + 1, FALSE, &Temp64);
- } else {
- NegativeAddr = FALSE;
- Status = AsciiStringToUint64 (argv[1], FALSE, &Temp64);
- }
- if (Status != EFI_SUCCESS) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- mOutImageType = FW_SET_ADDRESS_IMAGE;
- NewBaseAddress = (UINT64) Temp64;
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-p") == 0) || (stricmp (argv[0], "--pad") == 0)) {
- if (AsciiStringToUint64 (argv[1], FALSE, &Temp64) != EFI_SUCCESS) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- MciPadValue = (UINT8) Temp64;
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-v") == 0) || (stricmp (argv[0], "--verbose") == 0)) {
- SetPrintLevel (VERBOSE_LOG_LEVEL);
- VerboseMsg ("Verbose output Mode Set!");
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- SetPrintLevel (KEY_LOG_LEVEL);
- KeyMsg ("Quiet output Mode Set!");
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--debug") == 0)) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &LogLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- if (LogLevel > 9) {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, currnt input level is %d", (int) LogLevel);
- goto Finish;
- }
- SetPrintLevel (LogLevel);
- DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", argv[1]);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-g") == 0) || (stricmp (argv[0], "--hiiguid") == 0)) {
- Status = StringToGuid (argv[1], &HiiPackageListGuid);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if (stricmp (argv[0], "--hiipackage") == 0) {
- mOutImageType = FW_HII_PACKAGE_LIST_RCIMAGE;
- argc --;
- argv ++;
- continue;
- }
-
- if (stricmp (argv[0], "--hiibinpackage") == 0) {
- mOutImageType = FW_HII_PACKAGE_LIST_BINIMAGE;
- argc --;
- argv ++;
- continue;
- }
-
- if (argv[0][0] == '-') {
- Error (NULL, 0, 1000, "Unknown option", argv[0]);
- goto Finish;
- }
- //
- // Get Input file name
- //
- if ((InputFileNum == 0) && (InputFileName == NULL)) {
- InputFileName = (CHAR8 **) malloc (MAXIMUM_INPUT_FILE_NUM * sizeof (CHAR8 *));
- if (InputFileName == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- goto Finish;
- }
-
- memset (InputFileName, 0, (MAXIMUM_INPUT_FILE_NUM * sizeof (CHAR8 *)));
- } else if (InputFileNum % MAXIMUM_INPUT_FILE_NUM == 0) {
- //
- // InputFileName buffer too small, need to realloc
- //
- InputFileName = (CHAR8 **) realloc (
- InputFileName,
- (InputFileNum + MAXIMUM_INPUT_FILE_NUM) * sizeof (CHAR8 *)
- );
-
- if (InputFileName == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- goto Finish;
- }
-
- memset (&(InputFileName[InputFileNum]), 0, (MAXIMUM_INPUT_FILE_NUM * sizeof (CHAR8 *)));
- }
-
- InputFileName [InputFileNum ++] = argv[0];
- argc --;
- argv ++;
- }
-
- VerboseMsg ("%s tool start.", UTILITY_NAME);
-
- if (mOutImageType == FW_DUMMY_IMAGE) {
- Error (NULL, 0, 1001, "Missing option", "No create file action specified; pls specify -e, -c or -t option to create efi image, or acpi table or TeImage!");
- if (ReplaceFlag) {
- Error (NULL, 0, 1001, "Missing option", "-r option is not supported as the independent option. It can be used together with other create file option specified at the above.");
- }
- goto Finish;
- }
-
- //
- // check input files
- //
- if (InputFileNum == 0) {
- Error (NULL, 0, 1001, "Missing option", "Input files");
- goto Finish;
- }
-
- //
- // Combine MciBinary files to one file
- //
- if ((mOutImageType == FW_MERGE_IMAGE) && ReplaceFlag) {
- Error (NULL, 0, 1002, "Conflicting option", "-r replace option cannot be used with -j merge files option.");
- goto Finish;
- }
-
- //
- // Combine HiiBinary packages to a single package list
- //
- if ((mOutImageType == FW_HII_PACKAGE_LIST_RCIMAGE) && ReplaceFlag) {
- Error (NULL, 0, 1002, "Conflicting option", "-r replace option cannot be used with --hiipackage merge files option.");
- goto Finish;
- }
-
- if ((mOutImageType == FW_HII_PACKAGE_LIST_BINIMAGE) && ReplaceFlag) {
- Error (NULL, 0, 1002, "Conflicting option", "-r replace option cannot be used with --hiibinpackage merge files option.");
- goto Finish;
- }
-
- //
- // Input image file
- //
- mInImageName = InputFileName [InputFileNum - 1];
- VerboseMsg ("the input file name is %s", mInImageName);
-
- //
- // Action will be taken for the input file.
- //
- switch (mOutImageType) {
- case FW_EFI_IMAGE:
- VerboseMsg ("Create efi image on module type %s based on the input PE image.", ModuleType);
- break;
- case FW_TE_IMAGE:
- VerboseMsg ("Create Te Image based on the input PE image.");
- break;
- case FW_ACPI_IMAGE:
- VerboseMsg ("Get acpi table data from the input PE image.");
- break;
- case FW_RELOC_STRIPEED_IMAGE:
- VerboseMsg ("Remove relocation section from Pe or Te image.");
- break;
- case FW_BIN_IMAGE:
- VerboseMsg ("Convert the input EXE to the output BIN file.");
- break;
- case FW_ZERO_DEBUG_IMAGE:
- VerboseMsg ("Zero the Debug Data Fields and Time Stamp in input PE image.");
- break;
- case FW_SET_STAMP_IMAGE:
- VerboseMsg ("Set new time stamp %s in the input PE image.", TimeStamp);
- break;
- case DUMP_TE_HEADER:
- VerboseMsg ("Dump the TE header information of the input TE image.");
- break;
- case FW_MCI_IMAGE:
- VerboseMsg ("Conver input MicroCode.txt file to MicroCode.bin file.");
- break;
- case FW_MERGE_IMAGE:
- VerboseMsg ("Combine the input multi microcode bin files to one bin file.");
- break;
- case FW_HII_PACKAGE_LIST_RCIMAGE:
- VerboseMsg ("Combine the input multi hii bin packages to one text pacakge list RC file.");
- break;
- case FW_HII_PACKAGE_LIST_BINIMAGE:
- VerboseMsg ("Combine the input multi hii bin packages to one binary pacakge list file.");
- break;
- case FW_REBASE_IMAGE:
- VerboseMsg ("Rebase the input image to new base address.");
- break;
- case FW_SET_ADDRESS_IMAGE:
- VerboseMsg ("Set the preferred address into the section header of the input image");
- break;
- default:
- break;
- }
-
- if (ReplaceFlag) {
- VerboseMsg ("Overwrite the input file with the output content.");
- }
-
- //
- // Open output file and Write image into the output file.
- //
- if (OutImageName != NULL) {
- fpOut = fopen (OutImageName, "rb");
- if (fpOut != NULL) {
- //
- // Get Output file time stamp
- //
- fstat(fileno (fpOut), &Stat_Buf);
- OutputFileTime = Stat_Buf.st_mtime;
- //
- // Get Output file data
- //
- OutputFileLength = _filelength (fileno (fpOut));
- OutputFileBuffer = malloc (OutputFileLength);
- if (OutputFileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- fclose (fpOut);
- fpOut = NULL;
- goto Finish;
- }
- fread (OutputFileBuffer, 1, OutputFileLength, fpOut);
- fclose (fpOut);
- fpOut = NULL;
- }
- VerboseMsg ("Output file name is %s", OutImageName);
- } else if (!ReplaceFlag && mOutImageType != DUMP_TE_HEADER) {
- Error (NULL, 0, 1001, "Missing option", "output file");
- goto Finish;
- }
-
- //
- // Open input file and read file data into file buffer.
- //
- fpIn = fopen (mInImageName, "rb");
- if (fpIn == NULL) {
- Error (NULL, 0, 0001, "Error opening file", mInImageName);
- goto Finish;
- }
- //
- // Get Iutput file time stamp
- //
- fstat(fileno (fpIn), &Stat_Buf);
- InputFileTime = Stat_Buf.st_mtime;
- //
- // Get Input file data
- //
- InputFileLength = _filelength (fileno (fpIn));
- InputFileBuffer = malloc (InputFileLength);
- if (InputFileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- fclose (fpIn);
- goto Finish;
- }
- fread (InputFileBuffer, 1, InputFileLength, fpIn);
- fclose (fpIn);
- DebugMsg (NULL, 0, 9, "input file info", "the input file size is %u bytes", (unsigned) InputFileLength);
-
- //
- // Combine multi binary HII package files.
- //
- if (mOutImageType == FW_HII_PACKAGE_LIST_RCIMAGE || mOutImageType == FW_HII_PACKAGE_LIST_BINIMAGE) {
- //
- // Open output file handle.
- //
- fpOut = fopen (OutImageName, "wb");
- if (!fpOut) {
- Error (NULL, 0, 0001, "Error opening output file", OutImageName);
- goto Finish;
- }
- //
- // Get hii package list lenght
- //
- HiiPackageListHeader.PackageLength = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
- for (Index = 0; Index < InputFileNum; Index ++) {
- fpIn = fopen (InputFileName [Index], "rb");
- if (fpIn == NULL) {
- Error (NULL, 0, 0001, "Error opening file", InputFileName [Index]);
- goto Finish;
- }
- FileLength = _filelength (fileno (fpIn));
- fread (&HiiPackageHeader, 1, sizeof (HiiPackageHeader), fpIn);
- if (HiiPackageHeader.Type == EFI_HII_PACKAGE_FORM) {
- if (HiiPackageHeader.Length != FileLength) {
- Error (NULL, 0, 3000, "Invalid", "The wrong package size is in HII package file %s", InputFileName [Index]);
- fclose (fpIn);
- goto Finish;
- }
- if (memcmp (&HiiPackageListGuid, &mZeroGuid, sizeof (EFI_GUID)) == 0) {
- fread (&IfrFormSet, 1, sizeof (IfrFormSet), fpIn);
- memcpy (&HiiPackageListGuid, &IfrFormSet.Guid, sizeof (EFI_GUID));
- }
- NumberOfFormPacakge ++;
- }
- HiiPackageListHeader.PackageLength += FileLength;
- fclose (fpIn);
- }
- HiiPackageListHeader.PackageLength += sizeof (EndPackage);
- //
- // Check whether hii packages are valid
- //
- if (NumberOfFormPacakge > 1) {
- Error (NULL, 0, 3000, "Invalid", "The input hii packages contains more than one hii form package");
- goto Finish;
- }
- if (memcmp (&HiiPackageListGuid, &mZeroGuid, sizeof (EFI_GUID)) == 0) {
- Error (NULL, 0, 3000, "Invalid", "HII pacakge list guid is not specified!");
- goto Finish;
- }
- memcpy (&HiiPackageListHeader.PackageListGuid, &HiiPackageListGuid, sizeof (EFI_GUID));
- //
- // read hii packages
- //
- HiiPackageListBuffer = malloc (HiiPackageListHeader.PackageLength);
- if (HiiPackageListBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- goto Finish;
- }
- memcpy (HiiPackageListBuffer, &HiiPackageListHeader, sizeof (HiiPackageListHeader));
- HiiPackageDataPointer = HiiPackageListBuffer + sizeof (HiiPackageListHeader);
- for (Index = 0; Index < InputFileNum; Index ++) {
- fpIn = fopen (InputFileName [Index], "rb");
- if (fpIn == NULL) {
- Error (NULL, 0, 0001, "Error opening file", InputFileName [Index]);
- free (HiiPackageListBuffer);
- goto Finish;
- }
-
- FileLength = _filelength (fileno (fpIn));
- fread (HiiPackageDataPointer, 1, FileLength, fpIn);
- fclose (fpIn);
- HiiPackageDataPointer = HiiPackageDataPointer + FileLength;
- }
- memcpy (HiiPackageDataPointer, &EndPackage, sizeof (EndPackage));
-
- //
- // write the hii package into the binary package list file with the resource section header
- //
- if (mOutImageType == FW_HII_PACKAGE_LIST_BINIMAGE) {
- //
- // Create the resource section header
- //
- HiiSectionHeader = CreateHiiResouceSectionHeader (&HiiSectionHeaderSize, HiiPackageListHeader.PackageLength);
- //
- // Wrtie section header and HiiData into File.
- //
- fwrite (HiiSectionHeader, 1, HiiSectionHeaderSize, fpOut);
- fwrite (HiiPackageListBuffer, 1, HiiPackageListHeader.PackageLength, fpOut);
- //
- // Free allocated resources.
- //
- free (HiiSectionHeader);
- free (HiiPackageListBuffer);
- //
- // Done successfully
- //
- goto Finish;
- }
-
- //
- // write the hii package into the text package list rc file.
- //
- if (mOutImageType == FW_HII_PACKAGE_LIST_RCIMAGE) {
- for (Index = 0; gHiiPackageRCFileHeader[Index] != NULL; Index++) {
- fprintf (fpOut, "%s\n", gHiiPackageRCFileHeader[Index]);
- }
- fprintf (fpOut, "\n%d %s\n{", HII_RESOURCE_SECTION_INDEX, HII_RESOURCE_SECTION_NAME);
-
- HiiPackageDataPointer = HiiPackageListBuffer;
- for (Index = 0; Index + 2 < HiiPackageListHeader.PackageLength; Index += 2) {
- if (Index % 16 == 0) {
- fprintf (fpOut, "\n ");
- }
- fprintf (fpOut, " 0x%04X,", *(UINT16 *) HiiPackageDataPointer);
- HiiPackageDataPointer += 2;
- }
-
- if (Index % 16 == 0) {
- fprintf (fpOut, "\n ");
- }
- if ((Index + 2) == HiiPackageListHeader.PackageLength) {
- fprintf (fpOut, " 0x%04X\n}\n", *(UINT16 *) HiiPackageDataPointer);
- }
- if ((Index + 1) == HiiPackageListHeader.PackageLength) {
- fprintf (fpOut, " 0x%04X\n}\n", *(UINT8 *) HiiPackageDataPointer);
- }
- free (HiiPackageListBuffer);
- //
- // Done successfully
- //
- goto Finish;
- }
- }
-
- //
- // Combine MciBinary files to one file
- //
- if (mOutImageType == FW_MERGE_IMAGE) {
- //
- // Open output file handle.
- //
- fpOut = fopen (OutImageName, "wb");
- if (!fpOut) {
- Error (NULL, 0, 0001, "Error opening output file", OutImageName);
- goto Finish;
- }
- for (Index = 0; Index < InputFileNum; Index ++) {
- fpIn = fopen (InputFileName [Index], "rb");
- if (!fpIn) {
- Error (NULL, 0, 0001, "Error opening file", InputFileName [Index]);
- goto Finish;
- }
-
- FileLength = _filelength (fileno (fpIn));
- FileBuffer = malloc (FileLength);
- if (FileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- fclose (fpIn);
- goto Finish;
- }
-
- fread (FileBuffer, 1, FileLength, fpIn);
- fclose (fpIn);
- //
- // write input file to out file
- //
- fwrite (FileBuffer, 1, FileLength, fpOut);
- //
- // write pad value to out file.
- //
- while (FileLength ++ % MciAlignment != 0) {
- fwrite (&MciPadValue, 1, 1, fpOut);
- }
- //
- // free allocated memory space
- //
- free (FileBuffer);
- FileBuffer = NULL;
- }
- //
- // Done successfully
- //
- goto Finish;
- }
-
- //
- // Convert MicroCode.txt file to MicroCode.bin file
- //
- if (mOutImageType == FW_MCI_IMAGE) {
- fpIn = fopen (mInImageName, "r");
- if (fpIn == NULL) {
- Error (NULL, 0, 0001, "Error opening file", mInImageName);
- goto Finish;
- }
-
- //
- // The first pass is to determine
- // how much data is in the file so we can allocate a working buffer.
- //
- FileLength = 0;
- do {
- Status = MicrocodeReadData (fpIn, &Data);
- if (Status == STATUS_SUCCESS) {
- FileLength += sizeof (Data);
- }
- if (Status == STATUS_IGNORE) {
- Status = STATUS_SUCCESS;
- }
- } while (Status == STATUS_SUCCESS);
- //
- // Error if no data.
- //
- if (FileLength == 0) {
- Error (NULL, 0, 3000, "Invalid", "no parseable data found in file %s", mInImageName);
- goto Finish;
- }
- if (FileLength < sizeof (MICROCODE_IMAGE_HEADER)) {
- Error (NULL, 0, 3000, "Invalid", "amount of parseable data in %s is insufficient to contain a microcode header", mInImageName);
- goto Finish;
- }
-
- //
- // Allocate a buffer for the data
- //
- FileBuffer = malloc (FileLength);
- if (FileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- goto Finish;
- }
- //
- // Re-read the file, storing the data into our buffer
- //
- fseek (fpIn, 0, SEEK_SET);
- DataPointer = (UINT32 *) FileBuffer;
- OldDataPointer = DataPointer;
- do {
- OldDataPointer = DataPointer;
- Status = MicrocodeReadData (fpIn, DataPointer++);
- if (Status == STATUS_IGNORE) {
- DataPointer = OldDataPointer;
- Status = STATUS_SUCCESS;
- }
- } while (Status == STATUS_SUCCESS);
- //
- // close input file after read data
- //
- fclose (fpIn);
-
- //
- // Can't do much checking on the header because, per the spec, the
- // DataSize field may be 0, which means DataSize = 2000 and TotalSize = 2K,
- // and the TotalSize field is invalid (actually missing). Thus we can't
- // even verify the Reserved fields are 0.
- //
- MciHeader = (MICROCODE_IMAGE_HEADER *) FileBuffer;
- if (MciHeader->DataSize == 0) {
- Index = 2048;
- } else {
- Index = MciHeader->TotalSize;
- }
-
- if (Index != FileLength) {
- Error (NULL, 0, 3000, "Invalid", "file length of %s (0x%x) does not equal expected TotalSize: 0x%04X.", mInImageName, (unsigned) FileLength, (unsigned) Index);
- goto Finish;
- }
-
- //
- // Checksum the contents
- //
- DataPointer = (UINT32 *) FileBuffer;
- CheckSum = 0;
- Index = 0;
- while (Index < FileLength) {
- CheckSum += *DataPointer;
- DataPointer ++;
- Index += sizeof (*DataPointer);
- }
- if (CheckSum != 0) {
- Error (NULL, 0, 3000, "Invalid", "checksum (0x%x) failed on file %s.", (unsigned) CheckSum, mInImageName);
- goto Finish;
- }
- //
- // Open the output file and write the buffer contents
- //
- VerboseMsg ("the size of output file is %u bytes", (unsigned) FileLength);
- goto WriteFile;
- }
-
- //
- // Open input file and read file data into file buffer.
- //
- FileLength = InputFileLength;
- FileBuffer = malloc (FileLength);
- if (FileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- goto Finish;
- }
- memcpy (FileBuffer, InputFileBuffer, InputFileLength);
-
- //
- // Dump TeImage Header into output file.
- //
- if (mOutImageType == DUMP_TE_HEADER) {
- memcpy (&TEImageHeader, FileBuffer, sizeof (TEImageHeader));
- if (TEImageHeader.Signature != EFI_TE_IMAGE_HEADER_SIGNATURE) {
- Error (NULL, 0, 3000, "Invalid", "TE header signature of file %s is not correct.", mInImageName);
- goto Finish;
- }
- //
- // Open the output file handle.
- //
- if (ReplaceFlag) {
- fpInOut = fopen (mInImageName, "wb");
- if (fpInOut == NULL) {
- Error (NULL, 0, 0001, "Error opening file", mInImageName);
- goto Finish;
- }
- } else {
- if (OutImageName != NULL) {
- fpOut = fopen (OutImageName, "wb");
- } else {
- fpOut = stdout;
- }
- if (fpOut == NULL) {
- Error (NULL, 0, 0001, "Error opening output file", OutImageName);
- goto Finish;
- }
- }
- if (fpInOut != NULL) {
- fprintf (fpInOut, "Dump of file %s\n\n", mInImageName);
- fprintf (fpInOut, "TE IMAGE HEADER VALUES\n");
- fprintf (fpInOut, "%17X machine\n", TEImageHeader.Machine);
- fprintf (fpInOut, "%17X number of sections\n", TEImageHeader.NumberOfSections);
- fprintf (fpInOut, "%17X subsystems\n", TEImageHeader.Subsystem);
- fprintf (fpInOut, "%17X stripped size\n", TEImageHeader.StrippedSize);
- fprintf (fpInOut, "%17X entry point\n", (unsigned) TEImageHeader.AddressOfEntryPoint);
- fprintf (fpInOut, "%17X base of code\n", (unsigned) TEImageHeader.BaseOfCode);
- fprintf (fpInOut, "%17llX image base\n", (unsigned long long)TEImageHeader.ImageBase);
- fprintf (fpInOut, "%17X [%8X] RVA [size] of Base Relocation Directory\n", (unsigned) TEImageHeader.DataDirectory[0].VirtualAddress, (unsigned) TEImageHeader.DataDirectory[0].Size);
- fprintf (fpInOut, "%17X [%8X] RVA [size] of Debug Directory\n", (unsigned) TEImageHeader.DataDirectory[1].VirtualAddress, (unsigned) TEImageHeader.DataDirectory[1].Size);
- }
- if (fpOut != NULL) {
- fprintf (fpOut, "Dump of file %s\n\n", mInImageName);
- fprintf (fpOut, "TE IMAGE HEADER VALUES\n");
- fprintf (fpOut, "%17X machine\n", TEImageHeader.Machine);
- fprintf (fpOut, "%17X number of sections\n", TEImageHeader.NumberOfSections);
- fprintf (fpOut, "%17X subsystems\n", TEImageHeader.Subsystem);
- fprintf (fpOut, "%17X stripped size\n", TEImageHeader.StrippedSize);
- fprintf (fpOut, "%17X entry point\n", (unsigned) TEImageHeader.AddressOfEntryPoint);
- fprintf (fpOut, "%17X base of code\n", (unsigned) TEImageHeader.BaseOfCode);
- fprintf (fpOut, "%17llX image base\n", (unsigned long long)TEImageHeader.ImageBase);
- fprintf (fpOut, "%17X [%8X] RVA [size] of Base Relocation Directory\n", (unsigned) TEImageHeader.DataDirectory[0].VirtualAddress, (unsigned) TEImageHeader.DataDirectory[0].Size);
- fprintf (fpOut, "%17X [%8X] RVA [size] of Debug Directory\n", (unsigned) TEImageHeader.DataDirectory[1].VirtualAddress, (unsigned) TEImageHeader.DataDirectory[1].Size);
- }
- goto Finish;
- }
-
- //
- // Following code to convert dll to efi image or te image.
- // Get new image type
- //
- if ((mOutImageType == FW_EFI_IMAGE) || (mOutImageType == FW_TE_IMAGE)) {
- if (ModuleType == NULL) {
- if (mOutImageType == FW_EFI_IMAGE) {
- Error (NULL, 0, 1001, "Missing option", "EFI_FILETYPE");
- goto Finish;
- } else if (mOutImageType == FW_TE_IMAGE) {
- //
- // Default TE Image Type is Boot service driver
- //
- Type = EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER;
- VerboseMsg ("Efi Image subsystem type is efi boot service driver.");
- }
- } else {
- if (stricmp (ModuleType, "BASE") == 0 ||
- stricmp (ModuleType, "SEC") == 0 ||
- stricmp (ModuleType, "SECURITY_CORE") == 0 ||
- stricmp (ModuleType, "PEI_CORE") == 0 ||
- stricmp (ModuleType, "PEIM") == 0 ||
- stricmp (ModuleType, "COMBINED_PEIM_DRIVER") == 0 ||
- stricmp (ModuleType, "PIC_PEIM") == 0 ||
- stricmp (ModuleType, "RELOCATABLE_PEIM") == 0 ||
- stricmp (ModuleType, "DXE_CORE") == 0 ||
- stricmp (ModuleType, "BS_DRIVER") == 0 ||
- stricmp (ModuleType, "DXE_DRIVER") == 0 ||
- stricmp (ModuleType, "DXE_SMM_DRIVER") == 0 ||
- stricmp (ModuleType, "UEFI_DRIVER") == 0 ||
- stricmp (ModuleType, "SMM_CORE") == 0) {
- Type = EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER;
- VerboseMsg ("Efi Image subsystem type is efi boot service driver.");
-
- } else if (stricmp (ModuleType, "UEFI_APPLICATION") == 0 ||
- stricmp (ModuleType, "APPLICATION") == 0) {
- Type = EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION;
- VerboseMsg ("Efi Image subsystem type is efi application.");
-
- } else if (stricmp (ModuleType, "DXE_RUNTIME_DRIVER") == 0 ||
- stricmp (ModuleType, "RT_DRIVER") == 0) {
- Type = EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER;
- VerboseMsg ("Efi Image subsystem type is efi runtime driver.");
-
- } else if (stricmp (ModuleType, "DXE_SAL_DRIVER") == 0 ||
- stricmp (ModuleType, "SAL_RT_DRIVER") == 0) {
- Type = EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER;
- VerboseMsg ("Efi Image subsystem type is efi sal runtime driver.");
-
- } else {
- Error (NULL, 0, 1003, "Invalid option value", "EFI_FILETYPE = %s", ModuleType);
- goto Finish;
- }
- }
- }
-
- //
- // Convert ELF image to PeImage
- //
- if (IsElfHeader(FileBuffer)) {
- VerboseMsg ("Convert %s from ELF to PE/COFF.", mInImageName);
- if (!ConvertElf(&FileBuffer, &FileLength)) {
- Error (NULL, 0, 3000, "Invalid", "Unable to convert %s from ELF to PE/COFF.", mInImageName);
- goto Finish;
- }
- }
-
- //
- // Make sure File Offsets and Virtual Offsets are the same in the image so it is XIP
- // XIP == eXecute In Place
- //
- PeCoffConvertImageToXip (&FileBuffer, &FileLength);
-
- //
- // Remove reloc section from PE or TE image
- //
- if (mOutImageType == FW_RELOC_STRIPEED_IMAGE) {
- //
- // Check TeImage
- //
- TeHdr = (EFI_TE_IMAGE_HEADER *) FileBuffer;
- if (TeHdr->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (TeHdr + 1);
- for (Index = 0; Index < TeHdr->NumberOfSections; Index ++, SectionHeader ++) {
- if (strcmp ((char *)SectionHeader->Name, ".reloc") == 0) {
- //
- // Check the reloc section is in the end of image.
- //
- if ((SectionHeader->PointerToRawData + SectionHeader->SizeOfRawData) ==
- (FileLength + TeHdr->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER))) {
- //
- // Remove .reloc section and update TeImage Header
- //
- FileLength = FileLength - SectionHeader->SizeOfRawData;
- SectionHeader->SizeOfRawData = 0;
- SectionHeader->Misc.VirtualSize = 0;
- TeHdr->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = 0;
- TeHdr->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = 0;
- break;
- }
- }
- }
- } else {
- //
- // Check PE Image
- //
- DosHdr = (EFI_IMAGE_DOS_HEADER *) FileBuffer;
- if (DosHdr->e_magic != EFI_IMAGE_DOS_SIGNATURE) {
- PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(FileBuffer);
- if (PeHdr->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) {
- Error (NULL, 0, 3000, "Invalid", "TE and DOS header signatures were not found in %s image.", mInImageName);
- goto Finish;
- }
- DosHdr = NULL;
- } else {
- PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(FileBuffer + DosHdr->e_lfanew);
- if (PeHdr->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) {
- Error (NULL, 0, 3000, "Invalid", "PE header signature was not found in %s image.", mInImageName);
- goto Finish;
- }
- }
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) {
- if (strcmp ((char *)SectionHeader->Name, ".reloc") == 0) {
- //
- // Check the reloc section is in the end of image.
- //
- if ((SectionHeader->PointerToRawData + SectionHeader->SizeOfRawData) == FileLength) {
- //
- // Remove .reloc section and update PeImage Header
- //
- FileLength = FileLength - SectionHeader->SizeOfRawData;
-
- PeHdr->Pe32.FileHeader.Characteristics |= EFI_IMAGE_FILE_RELOCS_STRIPPED;
- if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- Optional32 = (EFI_IMAGE_OPTIONAL_HEADER32 *)&PeHdr->Pe32.OptionalHeader;
- Optional32->SizeOfImage -= SectionHeader->SizeOfRawData;
- Optional32->SizeOfInitializedData -= SectionHeader->SizeOfRawData;
- if (Optional32->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = 0;
- Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = 0;
- }
- }
- if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- Optional64 = (EFI_IMAGE_OPTIONAL_HEADER64 *)&PeHdr->Pe32.OptionalHeader;
- Optional64->SizeOfImage -= SectionHeader->SizeOfRawData;
- Optional64->SizeOfInitializedData -= SectionHeader->SizeOfRawData;
- if (Optional64->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = 0;
- Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = 0;
- }
- }
- SectionHeader->Misc.VirtualSize = 0;
- SectionHeader->SizeOfRawData = 0;
- break;
- }
- }
- }
- }
- //
- // Write file
- //
- goto WriteFile;
- }
- //
- // Read the dos & pe hdrs of the image
- //
- DosHdr = (EFI_IMAGE_DOS_HEADER *)FileBuffer;
- if (DosHdr->e_magic != EFI_IMAGE_DOS_SIGNATURE) {
- // NO DOS header, check for PE/COFF header
- PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(FileBuffer);
- if (PeHdr->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) {
- Error (NULL, 0, 3000, "Invalid", "DOS header signature was not found in %s image.", mInImageName);
- goto Finish;
- }
- DosHdr = NULL;
- } else {
-
- PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(FileBuffer + DosHdr->e_lfanew);
- if (PeHdr->Pe32.Signature != EFI_IMAGE_NT_SIGNATURE) {
- Error (NULL, 0, 3000, "Invalid", "PE header signature was not found in %s image.", mInImageName);
- goto Finish;
- }
- }
-
- if (PeHdr->Pe32.FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) {
- // Some tools kick out IMAGE_FILE_MACHINE_ARM (0x1c0) vs IMAGE_FILE_MACHINE_ARMT (0x1c2)
- // so patch back to the offical UEFI value.
- PeHdr->Pe32.FileHeader.Machine = IMAGE_FILE_MACHINE_ARMT;
- }
-
- //
- // Set new base address into image
- //
- if (mOutImageType == FW_REBASE_IMAGE || mOutImageType == FW_SET_ADDRESS_IMAGE) {
- if ((PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) && (PeHdr->Pe32.FileHeader.Machine != IMAGE_FILE_MACHINE_IA64)) {
- if (NewBaseAddress >= 0x100000000ULL) {
- Error (NULL, 0, 3000, "Invalid", "New base address is larger than 4G for 32bit PE image");
- goto Finish;
- }
- }
-
- if (NegativeAddr) {
- //
- // Set Base Address to a negative value.
- //
- NewBaseAddress = (UINT64) (0 - NewBaseAddress);
- }
- if (mOutImageType == FW_REBASE_IMAGE) {
- Status = RebaseImage (mInImageName, FileBuffer, NewBaseAddress);
- } else {
- Status = SetAddressToSectionHeader (mInImageName, FileBuffer, NewBaseAddress);
- }
- if (EFI_ERROR (Status)) {
- if (NegativeAddr) {
- Error (NULL, 0, 3000, "Invalid", "Rebase/Set Image %s to Base address -0x%llx can't success", mInImageName, 0 - NewBaseAddress);
- } else {
- Error (NULL, 0, 3000, "Invalid", "Rebase/Set Image %s to Base address 0x%llx can't success", mInImageName, NewBaseAddress);
- }
- goto Finish;
- }
-
- //
- // Write file
- //
- goto WriteFile;
- }
-
- //
- // Extract bin data from Pe image.
- //
- if (mOutImageType == FW_BIN_IMAGE) {
- if (FileLength < PeHdr->Pe32.OptionalHeader.SizeOfHeaders) {
- Error (NULL, 0, 3000, "Invalid", "FileSize of %s is not a legal size.", mInImageName);
- goto Finish;
- }
- //
- // Output bin data from exe file
- //
- FileLength = FileLength - PeHdr->Pe32.OptionalHeader.SizeOfHeaders;
- memmove (FileBuffer, FileBuffer + PeHdr->Pe32.OptionalHeader.SizeOfHeaders, FileLength);
- VerboseMsg ("the size of output file is %u bytes", (unsigned) FileLength);
- goto WriteFile;
- }
-
- //
- // Zero Debug Information of Pe Image
- //
- if (mOutImageType == FW_ZERO_DEBUG_IMAGE) {
- Status = ZeroDebugData (FileBuffer, TRUE);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 3000, "Invalid", "Zero DebugData Error status is 0x%x", (int) Status);
- goto Finish;
- }
-
- //
- // Write the updated Image
- //
- VerboseMsg ("the size of output file is %u bytes", (unsigned) FileLength);
- goto WriteFile;
- }
-
- //
- // Set Time Stamp of Pe Image
- //
- if (mOutImageType == FW_SET_STAMP_IMAGE) {
- Status = SetStamp (FileBuffer, TimeStamp);
- if (EFI_ERROR (Status)) {
- goto Finish;
- }
-
- //
- // Write the updated Image
- //
- VerboseMsg ("the size of output file is %u bytes", (unsigned) FileLength);
- goto WriteFile;
- }
-
- //
- // Extract acpi data from pe image.
- //
- if (mOutImageType == FW_ACPI_IMAGE) {
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) {
- if (strcmp ((char *)SectionHeader->Name, ".data") == 0 || strcmp ((char *)SectionHeader->Name, ".sdata") == 0) {
- //
- // Check Acpi Table
- //
- if (SectionHeader->Misc.VirtualSize < SectionHeader->SizeOfRawData) {
- FileLength = SectionHeader->Misc.VirtualSize;
- } else {
- FileLength = SectionHeader->SizeOfRawData;
- }
-
- if (CheckAcpiTable (FileBuffer + SectionHeader->PointerToRawData, FileLength) != STATUS_SUCCESS) {
- Error (NULL, 0, 3000, "Invalid", "ACPI table check failed in %s.", mInImageName);
- goto Finish;
- }
-
- //
- // Output Apci data to file
- //
- memmove (FileBuffer, FileBuffer + SectionHeader->PointerToRawData, FileLength);
- VerboseMsg ("the size of output file is %u bytes", (unsigned) FileLength);
- goto WriteFile;
- }
- }
- Error (NULL, 0, 3000, "Invalid", "failed to get ACPI table from %s.", mInImageName);
- goto Finish;
- }
- //
- // Zero all unused fields of the DOS header
- //
- if (DosHdr != NULL) {
- memcpy (&BackupDosHdr, DosHdr, sizeof (EFI_IMAGE_DOS_HEADER));
- memset (DosHdr, 0, sizeof (EFI_IMAGE_DOS_HEADER));
- DosHdr->e_magic = BackupDosHdr.e_magic;
- DosHdr->e_lfanew = BackupDosHdr.e_lfanew;
-
- for (Index = sizeof (EFI_IMAGE_DOS_HEADER); Index < (UINT32 ) DosHdr->e_lfanew; Index++) {
- FileBuffer[Index] = (UINT8) DosHdr->e_cp;
- }
- }
-
- //
- // Initialize TeImage Header
- //
- memset (&TEImageHeader, 0, sizeof (EFI_TE_IMAGE_HEADER));
- TEImageHeader.Signature = EFI_TE_IMAGE_HEADER_SIGNATURE;
- TEImageHeader.Machine = PeHdr->Pe32.FileHeader.Machine;
- TEImageHeader.NumberOfSections = (UINT8) PeHdr->Pe32.FileHeader.NumberOfSections;
- TEImageHeader.StrippedSize = (UINT16) ((UINTN) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader) - (UINTN) FileBuffer);
- TEImageHeader.Subsystem = (UINT8) Type;
-
- //
- // Patch the PE header
- //
- PeHdr->Pe32.OptionalHeader.Subsystem = (UINT16) Type;
-
- if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- Optional32 = (EFI_IMAGE_OPTIONAL_HEADER32 *)&PeHdr->Pe32.OptionalHeader;
- Optional32->MajorOperatingSystemVersion = 0;
- Optional32->MinorOperatingSystemVersion = 0;
- Optional32->MajorImageVersion = 0;
- Optional32->MinorImageVersion = 0;
- Optional32->MajorSubsystemVersion = 0;
- Optional32->MinorSubsystemVersion = 0;
- Optional32->Win32VersionValue = 0;
- Optional32->CheckSum = 0;
- Optional32->SizeOfStackReserve = 0;
- Optional32->SizeOfStackCommit = 0;
- Optional32->SizeOfHeapReserve = 0;
- Optional32->SizeOfHeapCommit = 0;
-
- TEImageHeader.AddressOfEntryPoint = Optional32->AddressOfEntryPoint;
- TEImageHeader.BaseOfCode = Optional32->BaseOfCode;
- TEImageHeader.ImageBase = (UINT64) (Optional32->ImageBase);
-
- if (Optional32->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress;
- TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size;
- }
-
- if (Optional32->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
- TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress = Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress;
- TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].Size = Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].Size;
- }
-
- //
- // Zero .pdata section data.
- //
- if (!KeepExceptionTableFlag && Optional32->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION &&
- Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress != 0 &&
- Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size != 0) {
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index++, SectionHeader++) {
- if (SectionHeader->VirtualAddress == Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress) {
- //
- // Zero .pdata Section data
- //
- memset (FileBuffer + SectionHeader->PointerToRawData, 0, SectionHeader->SizeOfRawData);
- //
- // Zero .pdata Section header name
- //
- memset (SectionHeader->Name, 0, sizeof (SectionHeader->Name));
- //
- // Zero Execption Table
- //
- Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress = 0;
- Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size = 0;
- DebugMsg (NULL, 0, 9, "Zero the .pdata section for PE image", NULL);
- break;
- }
- }
- }
-
- //
- // Strip zero padding at the end of the .reloc section
- //
- if (!KeepZeroPendingFlag && Optional32->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- if (Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size != 0) {
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index++, SectionHeader++) {
- //
- // Look for the Section Header that starts as the same virtual address as the Base Relocation Data Directory
- //
- if (SectionHeader->VirtualAddress == Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress) {
- SectionHeader->Misc.VirtualSize = Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size;
- AllignedRelocSize = (Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size + Optional32->FileAlignment - 1) & (~(Optional32->FileAlignment - 1));
- //
- // Check to see if there is zero padding at the end of the base relocations
- //
- if (AllignedRelocSize < SectionHeader->SizeOfRawData) {
- //
- // Check to see if the base relocations are at the end of the file
- //
- if (SectionHeader->PointerToRawData + SectionHeader->SizeOfRawData == Optional32->SizeOfImage) {
- //
- // All the required conditions are met to strip the zero padding of the end of the base relocations section
- //
- Optional32->SizeOfImage -= (SectionHeader->SizeOfRawData - AllignedRelocSize);
- Optional32->SizeOfInitializedData -= (SectionHeader->SizeOfRawData - AllignedRelocSize);
- SectionHeader->SizeOfRawData = AllignedRelocSize;
- FileLength = Optional32->SizeOfImage;
- DebugMsg (NULL, 0, 9, "Remove the zero padding bytes at the end of the base relocations", "The size of padding bytes is %u", (unsigned) (SectionHeader->SizeOfRawData - AllignedRelocSize));
- }
- }
- }
- }
- }
- }
- } else if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- Optional64 = (EFI_IMAGE_OPTIONAL_HEADER64 *)&PeHdr->Pe32.OptionalHeader;
- Optional64->MajorOperatingSystemVersion = 0;
- Optional64->MinorOperatingSystemVersion = 0;
- Optional64->MajorImageVersion = 0;
- Optional64->MinorImageVersion = 0;
- Optional64->MajorSubsystemVersion = 0;
- Optional64->MinorSubsystemVersion = 0;
- Optional64->Win32VersionValue = 0;
- Optional64->CheckSum = 0;
- Optional64->SizeOfStackReserve = 0;
- Optional64->SizeOfStackCommit = 0;
- Optional64->SizeOfHeapReserve = 0;
- Optional64->SizeOfHeapCommit = 0;
-
- TEImageHeader.AddressOfEntryPoint = Optional64->AddressOfEntryPoint;
- TEImageHeader.BaseOfCode = Optional64->BaseOfCode;
- TEImageHeader.ImageBase = (UINT64) (Optional64->ImageBase);
-
- if (Optional64->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress;
- TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size;
- }
-
- if (Optional64->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
- TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress = Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress;
- TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].Size = Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].Size;
- }
-
- //
- // Zero the .pdata section for X64 machine and don't check the Debug Directory is empty
- // For Itaninum and X64 Image, remove .pdata section.
- //
- if ((!KeepExceptionTableFlag && PeHdr->Pe32.FileHeader.Machine == IMAGE_FILE_MACHINE_X64) || PeHdr->Pe32.FileHeader.Machine == IMAGE_FILE_MACHINE_IA64) {
- if (Optional64->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION &&
- Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress != 0 &&
- Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size != 0) {
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index++, SectionHeader++) {
- if (SectionHeader->VirtualAddress == Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress) {
- //
- // Zero .pdata Section header name
- //
- memset (SectionHeader->Name, 0, sizeof (SectionHeader->Name));
-
- RuntimeFunction = (RUNTIME_FUNCTION *)(FileBuffer + SectionHeader->PointerToRawData);
- for (Index1 = 0; Index1 < Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size / sizeof (RUNTIME_FUNCTION); Index1++, RuntimeFunction++) {
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index2 = 0; Index2 < PeHdr->Pe32.FileHeader.NumberOfSections; Index2++, SectionHeader++) {
- if (RuntimeFunction->UnwindInfoAddress >= SectionHeader->VirtualAddress && RuntimeFunction->UnwindInfoAddress < (SectionHeader->VirtualAddress + SectionHeader->SizeOfRawData)) {
- UnwindInfo = (UNWIND_INFO *)(FileBuffer + SectionHeader->PointerToRawData + (RuntimeFunction->UnwindInfoAddress - SectionHeader->VirtualAddress));
- if (UnwindInfo->Version == 1) {
- memset (UnwindInfo + 1, 0, UnwindInfo->CountOfUnwindCodes * sizeof (UINT16));
- memset (UnwindInfo, 0, sizeof (UNWIND_INFO));
- }
- break;
- }
- }
- memset (RuntimeFunction, 0, sizeof (RUNTIME_FUNCTION));
- }
- //
- // Zero Execption Table
- //
- Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size = 0;
- Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress = 0;
- DebugMsg (NULL, 0, 9, "Zero the .pdata section if the machine type is X64 for PE32+ image", NULL);
- break;
- }
- }
- }
- }
-
- //
- // Strip zero padding at the end of the .reloc section
- //
- if (!KeepZeroPendingFlag && Optional64->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
- if (Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size != 0) {
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index++, SectionHeader++) {
- //
- // Look for the Section Header that starts as the same virtual address as the Base Relocation Data Directory
- //
- if (SectionHeader->VirtualAddress == Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress) {
- SectionHeader->Misc.VirtualSize = Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size;
- AllignedRelocSize = (Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size + Optional64->FileAlignment - 1) & (~(Optional64->FileAlignment - 1));
- //
- // Check to see if there is zero padding at the end of the base relocations
- //
- if (AllignedRelocSize < SectionHeader->SizeOfRawData) {
- //
- // Check to see if the base relocations are at the end of the file
- //
- if (SectionHeader->PointerToRawData + SectionHeader->SizeOfRawData == Optional64->SizeOfImage) {
- //
- // All the required conditions are met to strip the zero padding of the end of the base relocations section
- //
- Optional64->SizeOfImage -= (SectionHeader->SizeOfRawData - AllignedRelocSize);
- Optional64->SizeOfInitializedData -= (SectionHeader->SizeOfRawData - AllignedRelocSize);
- SectionHeader->SizeOfRawData = AllignedRelocSize;
- FileLength = Optional64->SizeOfImage;
- DebugMsg (NULL, 0, 9, "Remove the zero padding bytes at the end of the base relocations", "The size of padding bytes is %u", (unsigned) (SectionHeader->SizeOfRawData - AllignedRelocSize));
- }
- }
- }
- }
- }
- }
- } else {
- Error (NULL, 0, 3000, "Invalid", "Magic 0x%x of PeImage %s is unknown.", PeHdr->Pe32.OptionalHeader.Magic, mInImageName);
- goto Finish;
- }
-
- if (((PeHdr->Pe32.FileHeader.Characteristics & EFI_IMAGE_FILE_RELOCS_STRIPPED) == 0) && \
- (TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress == 0) && \
- (TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size == 0)) {
- //
- // PeImage can be loaded into memory, but it has no relocation section.
- // Fix TeImage Header to set VA of relocation data directory to not zero, the size is still zero.
- //
- if (Optional32 != NULL) {
- TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = Optional32->SizeOfImage - sizeof (EFI_IMAGE_BASE_RELOCATION);
- } else if (Optional64 != NULL) {
- TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = Optional64->SizeOfImage - sizeof (EFI_IMAGE_BASE_RELOCATION);
- }
- }
-
- //
- // Fill HII section data
- //
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index++) {
- if (stricmp ((char *)SectionHeader[Index].Name, ".hii") == 0) {
- //
- // Update resource section header offset
- //
- SetHiiResourceHeader ((UINT8*) FileBuffer + SectionHeader[Index].PointerToRawData, SectionHeader[Index].VirtualAddress);
- //
- // Update resource section name
- //
- strcpy((char *) SectionHeader[Index].Name, ".rsrc");
- //
- // Update resource data directory.
- //
- if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- Optional32 = (EFI_IMAGE_OPTIONAL_HEADER32 *)&PeHdr->Pe32.OptionalHeader;
- Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress = SectionHeader[Index].VirtualAddress;
- Optional32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].Size = SectionHeader[Index].Misc.VirtualSize;
- } else if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- Optional64 = (EFI_IMAGE_OPTIONAL_HEADER64 *)&PeHdr->Pe32.OptionalHeader;
- Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress = SectionHeader[Index].VirtualAddress;
- Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].Size = SectionHeader[Index].Misc.VirtualSize;
- }
- break;
- }
- }
-
- //
- // Zero ExceptionTable Xdata
- //
- if (!KeepExceptionTableFlag) {
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) &(PeHdr->Pe32.OptionalHeader) + PeHdr->Pe32.FileHeader.SizeOfOptionalHeader);
- for (Index = 0; Index < PeHdr->Pe32.FileHeader.NumberOfSections; Index++) {
- if (stricmp ((char *)SectionHeader[Index].Name, ".xdata") == 0) {
- //
- // zero .xdata section
- //
- memset (FileBuffer + SectionHeader[Index].PointerToRawData, 0, SectionHeader[Index].SizeOfRawData);
- DebugMsg (NULL, 0, 9, NULL, "Zero the .xdata section for PE image at Offset 0x%x and Length 0x%x", (unsigned) SectionHeader[Index].PointerToRawData, (unsigned) SectionHeader[Index].SizeOfRawData);
- break;
- }
- }
- }
-
- //
- // Zero Time/Data field
- //
- ZeroDebugData (FileBuffer, FALSE);
-
- if (mOutImageType == FW_TE_IMAGE) {
- if ((PeHdr->Pe32.FileHeader.NumberOfSections &~0xFF) || (Type &~0xFF)) {
- //
- // Pack the subsystem and NumberOfSections into 1 byte. Make sure they fit both.
- //
- Error (NULL, 0, 3000, "Invalid", "Image's subsystem or NumberOfSections of PeImage %s cannot be packed into 1 byte.", mInImageName);
- goto Finish;
- }
-
- if ((PeHdr->Pe32.OptionalHeader.SectionAlignment != PeHdr->Pe32.OptionalHeader.FileAlignment)) {
- //
- // TeImage has the same section alignment and file alignment.
- //
- Error (NULL, 0, 3000, "Invalid", "Section-Alignment and File-Alignment of PeImage %s do not match, they must be equal for a TeImage.", mInImageName);
- goto Finish;
- }
-
- DebugMsg (NULL, 0, 9, "TeImage Header Info", "Machine type is %X, Number of sections is %X, Stripped size is %X, EntryPoint is %X, BaseOfCode is %X, ImageBase is %llX",
- TEImageHeader.Machine, TEImageHeader.NumberOfSections, TEImageHeader.StrippedSize, (unsigned) TEImageHeader.AddressOfEntryPoint, (unsigned) TEImageHeader.BaseOfCode, (unsigned long long) TEImageHeader.ImageBase);
- //
- // Update Image to TeImage
- //
- FileLength = FileLength - TEImageHeader.StrippedSize;
- memmove (FileBuffer + sizeof (EFI_TE_IMAGE_HEADER), FileBuffer + TEImageHeader.StrippedSize, FileLength);
- FileLength = FileLength + sizeof (EFI_TE_IMAGE_HEADER);
- memcpy (FileBuffer, &TEImageHeader, sizeof (EFI_TE_IMAGE_HEADER));
- VerboseMsg ("the size of output file is %u bytes", (unsigned) (FileLength));
- } else {
-
- //
- // Following codes are to fix the objcopy's issue:
- // objcopy in binutil 2.50.18 will set PE image's charactices to "RELOC_STRIPPED" if image has no ".reloc" section
- // It cause issue for EFI image which has no ".reloc" sections.
- // Following codes will be removed when objcopy in binutil fix this problem for PE image.
- //
- if ((PeHdr->Pe32.FileHeader.Characteristics & EFI_IMAGE_FILE_RELOCS_STRIPPED) != 0) {
- if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- Optional32 = (EFI_IMAGE_OPTIONAL_HEADER32 *)&PeHdr->Pe32.OptionalHeader;
- if (Optional32->ImageBase == 0) {
- PeHdr->Pe32.FileHeader.Characteristics &= ~EFI_IMAGE_FILE_RELOCS_STRIPPED;
- }
- } else if (PeHdr->Pe32.OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- Optional64 = (EFI_IMAGE_OPTIONAL_HEADER64 *)&PeHdr->Pe32.OptionalHeader;
- if (Optional64->ImageBase == 0) {
- PeHdr->Pe32.FileHeader.Characteristics &= ~EFI_IMAGE_FILE_RELOCS_STRIPPED;
- }
- }
- }
- }
-
-WriteFile:
- //
- // Update Image to EfiImage or TE image
- //
- if (ReplaceFlag) {
- if ((FileLength != InputFileLength) || (memcmp (FileBuffer, InputFileBuffer, FileLength) != 0)) {
- //
- // Update File when File is changed.
- //
- fpInOut = fopen (mInImageName, "wb");
- if (fpInOut == NULL) {
- Error (NULL, 0, 0001, "Error opening file", mInImageName);
- goto Finish;
- }
- fwrite (FileBuffer, 1, FileLength, fpInOut);
- VerboseMsg ("the size of output file is %u bytes", (unsigned) FileLength);
- }
- } else {
- if ((OutputFileTime < InputFileTime) || (FileLength != OutputFileLength) || (memcmp (FileBuffer, OutputFileBuffer, FileLength) != 0)) {
- //
- // Update File when File is changed or File is old.
- //
- fpOut = fopen (OutImageName, "wb");
- if (fpOut == NULL) {
- Error (NULL, 0, 0001, "Error opening output file", OutImageName);
- goto Finish;
- }
- fwrite (FileBuffer, 1, FileLength, fpOut);
- VerboseMsg ("the size of output file is %u bytes", (unsigned) FileLength);
- }
- }
- mImageSize = FileLength;
-
-Finish:
- if (fpInOut != NULL) {
- if (GetUtilityStatus () != STATUS_SUCCESS) {
- //
- // when file updates failed, original file is still recovered.
- //
- fwrite (InputFileBuffer, 1, InputFileLength, fpInOut);
- }
- //
- // Write converted data into fpInOut file and close input file.
- //
- fclose (fpInOut);
- }
-
- if (FileBuffer != NULL) {
- free (FileBuffer);
- }
-
- if (InputFileName != NULL) {
- free (InputFileName);
- }
-
- if (fpOut != NULL) {
- //
- // Write converted data into fpOut file and close output file.
- //
- fclose (fpOut);
- if (GetUtilityStatus () != STATUS_SUCCESS) {
- if (OutputFileBuffer == NULL) {
- remove (OutImageName);
- } else {
- fpOut = fopen (OutImageName, "wb");
- fwrite (OutputFileBuffer, 1, OutputFileLength, fpOut);
- fclose (fpOut);
- }
- }
- }
-
- if (InputFileBuffer != NULL) {
- free (InputFileBuffer);
- }
-
- if (OutputFileBuffer != NULL) {
- free (OutputFileBuffer);
- }
-
- //
- // Write module size and time stamp to report file.
- //
- if (OutImageName != NULL) {
- FileLen = strlen (OutImageName);
- }
- if (FileLen >= 4 && strcmp (OutImageName + (FileLen - 4), ".efi") == 0) {
- ReportFileName = (CHAR8 *) malloc (FileLen + 1);
- if (ReportFileName != NULL) {
- strcpy (ReportFileName, OutImageName);
- strcpy (ReportFileName + (FileLen - 4), ".txt");
- ReportFile = fopen (ReportFileName, "w+");
- if (ReportFile != NULL) {
- fprintf (ReportFile, "MODULE_SIZE = %u\n", (unsigned) mImageSize);
- fprintf (ReportFile, "TIME_STAMP = %u\n", (unsigned) mImageTimeStamp);
- fclose(ReportFile);
- }
- free (ReportFileName);
- }
- }
- VerboseMsg ("%s tool done with return code is 0x%x.", UTILITY_NAME, GetUtilityStatus ());
-
- return GetUtilityStatus ();
-}
-
-STATIC
-EFI_STATUS
-ZeroDebugData (
- IN OUT UINT8 *FileBuffer,
- BOOLEAN ZeroDebugFlag
- )
-/*++
-
-Routine Description:
-
- Zero debug information in PeImage.
-
-Arguments:
-
- FileBuffer - Pointer to PeImage.
- ZeroDebugFlag - TRUE to zero Debug information, FALSE to only zero time/stamp
-
-Returns:
-
- EFI_ABORTED - PeImage is invalid.
- EFI_SUCCESS - Zero debug data successfully.
-
---*/
-{
- UINT32 Index;
- UINT32 DebugDirectoryEntryRva;
- UINT32 DebugDirectoryEntryFileOffset;
- UINT32 ExportDirectoryEntryRva;
- UINT32 ExportDirectoryEntryFileOffset;
- UINT32 ResourceDirectoryEntryRva;
- UINT32 ResourceDirectoryEntryFileOffset;
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_FILE_HEADER *FileHdr;
- EFI_IMAGE_OPTIONAL_HEADER32 *Optional32Hdr;
- EFI_IMAGE_OPTIONAL_HEADER64 *Optional64Hdr;
- EFI_IMAGE_SECTION_HEADER *SectionHeader;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
- UINT32 *NewTimeStamp;
-
- //
- // Init variable.
- //
- DebugDirectoryEntryRva = 0;
- ExportDirectoryEntryRva = 0;
- ResourceDirectoryEntryRva = 0;
- DebugDirectoryEntryFileOffset = 0;
- ExportDirectoryEntryFileOffset = 0;
- ResourceDirectoryEntryFileOffset = 0;
- DosHdr = (EFI_IMAGE_DOS_HEADER *) FileBuffer;
- FileHdr = (EFI_IMAGE_FILE_HEADER *) (FileBuffer + DosHdr->e_lfanew + sizeof (UINT32));
-
-
- DosHdr = (EFI_IMAGE_DOS_HEADER *)FileBuffer;
- if (DosHdr->e_magic != EFI_IMAGE_DOS_SIGNATURE) {
- // NO DOS header, must start with PE/COFF header
- FileHdr = (EFI_IMAGE_FILE_HEADER *)(FileBuffer + sizeof (UINT32));
- } else {
- FileHdr = (EFI_IMAGE_FILE_HEADER *)(FileBuffer + DosHdr->e_lfanew + sizeof (UINT32));
- }
-
- //
- // Get Debug, Export and Resource EntryTable RVA address.
- // Resource Directory entry need to review.
- //
- if (FileHdr->Machine == EFI_IMAGE_MACHINE_IA32) {
- Optional32Hdr = (EFI_IMAGE_OPTIONAL_HEADER32 *) ((UINT8*) FileHdr + sizeof (EFI_IMAGE_FILE_HEADER));
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) Optional32Hdr + FileHdr->SizeOfOptionalHeader);
- if (Optional32Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_EXPORT && \
- Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].Size != 0) {
- ExportDirectoryEntryRva = Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
- }
- if (Optional32Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE && \
- Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].Size != 0) {
- ResourceDirectoryEntryRva = Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress;
- }
- if (Optional32Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG && \
- Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].Size != 0) {
- DebugDirectoryEntryRva = Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress;
- if (ZeroDebugFlag) {
- Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].Size = 0;
- Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress = 0;
- }
- }
- } else {
- Optional64Hdr = (EFI_IMAGE_OPTIONAL_HEADER64 *) ((UINT8*) FileHdr + sizeof (EFI_IMAGE_FILE_HEADER));
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) Optional64Hdr + FileHdr->SizeOfOptionalHeader);
- if (Optional64Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_EXPORT && \
- Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].Size != 0) {
- ExportDirectoryEntryRva = Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
- }
- if (Optional64Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE && \
- Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].Size != 0) {
- ResourceDirectoryEntryRva = Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress;
- }
- if (Optional64Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG && \
- Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].Size != 0) {
- DebugDirectoryEntryRva = Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress;
- if (ZeroDebugFlag) {
- Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].Size = 0;
- Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress = 0;
- }
- }
- }
-
- //
- // Get DirectoryEntryTable file offset.
- //
- for (Index = 0; Index < FileHdr->NumberOfSections; Index ++, SectionHeader ++) {
- if (DebugDirectoryEntryRva >= SectionHeader->VirtualAddress &&
- DebugDirectoryEntryRva < SectionHeader->VirtualAddress + SectionHeader->Misc.VirtualSize) {
- DebugDirectoryEntryFileOffset =
- DebugDirectoryEntryRva - SectionHeader->VirtualAddress + SectionHeader->PointerToRawData;
- }
- if (ExportDirectoryEntryRva >= SectionHeader->VirtualAddress &&
- ExportDirectoryEntryRva < SectionHeader->VirtualAddress + SectionHeader->Misc.VirtualSize) {
- ExportDirectoryEntryFileOffset =
- ExportDirectoryEntryRva - SectionHeader->VirtualAddress + SectionHeader->PointerToRawData;
- }
- if (ResourceDirectoryEntryRva >= SectionHeader->VirtualAddress &&
- ResourceDirectoryEntryRva < SectionHeader->VirtualAddress + SectionHeader->Misc.VirtualSize) {
- ResourceDirectoryEntryFileOffset =
- ResourceDirectoryEntryRva - SectionHeader->VirtualAddress + SectionHeader->PointerToRawData;
- }
- }
-
- //
- //Zero Debug Data and TimeStamp
- //
- FileHdr->TimeDateStamp = 0;
- mImageTimeStamp = 0;
- if (ExportDirectoryEntryFileOffset != 0) {
- NewTimeStamp = (UINT32 *) (FileBuffer + ExportDirectoryEntryFileOffset + sizeof (UINT32));
- *NewTimeStamp = 0;
- }
-
- if (ResourceDirectoryEntryFileOffset != 0) {
- NewTimeStamp = (UINT32 *) (FileBuffer + ResourceDirectoryEntryFileOffset + sizeof (UINT32));
- *NewTimeStamp = 0;
- }
-
- if (DebugDirectoryEntryFileOffset != 0) {
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) (FileBuffer + DebugDirectoryEntryFileOffset);
- DebugEntry->TimeDateStamp = 0;
- mImageTimeStamp = 0;
- if (ZeroDebugFlag) {
- memset (FileBuffer + DebugEntry->FileOffset, 0, DebugEntry->SizeOfData);
- memset (DebugEntry, 0, sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY));
- }
- }
-
- return EFI_SUCCESS;
-}
-
-STATIC
-EFI_STATUS
-SetStamp (
- IN OUT UINT8 *FileBuffer,
- IN CHAR8 *TimeStamp
- )
-/*++
-
-Routine Description:
-
- Set new time stamp into PeImage FileHdr and Directory table:
- Debug, Export and Resource.
-
-Arguments:
-
- FileBuffer - Pointer to PeImage.
- TimeStamp - Time stamp string.
-
-Returns:
-
- EFI_INVALID_PARAMETER - TimeStamp format is not recognized.
- EFI_SUCCESS - Set new time stamp in this image successfully.
-
---*/
-{
- struct tm stime;
- struct tm *ptime;
- time_t newtime;
- UINT32 Index;
- UINT32 DebugDirectoryEntryRva;
- UINT32 DebugDirectoryEntryFileOffset;
- UINT32 ExportDirectoryEntryRva;
- UINT32 ExportDirectoryEntryFileOffset;
- UINT32 ResourceDirectoryEntryRva;
- UINT32 ResourceDirectoryEntryFileOffset;
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_FILE_HEADER *FileHdr;
- EFI_IMAGE_OPTIONAL_HEADER32 *Optional32Hdr;
- EFI_IMAGE_OPTIONAL_HEADER64 *Optional64Hdr;
- EFI_IMAGE_SECTION_HEADER *SectionHeader;
- UINT32 *NewTimeStamp;
-
- //
- // Init variable.
- //
- DebugDirectoryEntryRva = 0;
- DebugDirectoryEntryFileOffset = 0;
- ExportDirectoryEntryRva = 0;
- ExportDirectoryEntryFileOffset = 0;
- ResourceDirectoryEntryRva = 0;
- ResourceDirectoryEntryFileOffset = 0;
- //
- // Get time and date that will be set.
- //
- if (TimeStamp == NULL) {
- Error (NULL, 0, 3000, "Invalid", "TimeStamp cannot be NULL.");
- return EFI_INVALID_PARAMETER;
- }
- //
- // compare the value with "NOW", if yes, current system time is set.
- //
- if (stricmp (TimeStamp, "NOW") == 0) {
- //
- // get system current time and date
- //
- time (&newtime);
- } else {
- //
- // Check Time Format strictly yyyy-mm-dd 00:00:00
- //
- for (Index = 0; TimeStamp[Index] != '\0' && Index < 20; Index ++) {
- if (Index == 4 || Index == 7) {
- if (TimeStamp[Index] == '-') {
- continue;
- }
- } else if (Index == 13 || Index == 16) {
- if (TimeStamp[Index] == ':') {
- continue;
- }
- } else if (Index == 10 && TimeStamp[Index] == ' ') {
- continue;
- } else if ((TimeStamp[Index] < '0') || (TimeStamp[Index] > '9')) {
- break;
- }
- }
-
- if (Index < 19 || TimeStamp[19] != '\0') {
- Error (NULL, 0, 1003, "Invalid option value", "Incorrect Time \"%s\"\n Correct Format \"yyyy-mm-dd 00:00:00\"", TimeStamp);
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // get the date and time from TimeStamp
- //
- if (sscanf (TimeStamp, "%d-%d-%d %d:%d:%d",
- &stime.tm_year,
- &stime.tm_mon,
- &stime.tm_mday,
- &stime.tm_hour,
- &stime.tm_min,
- &stime.tm_sec
- ) != 6) {
- Error (NULL, 0, 1003, "Invalid option value", "Incorrect Tiem \"%s\"\n Correct Format \"yyyy-mm-dd 00:00:00\"", TimeStamp);
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // in struct, Month (0 - 11; Jan = 0). So decrease 1 from it
- //
- if (stime.tm_mon <= 0 || stime.tm_mday <=0) {
- Error (NULL, 0, 3000, "Invalid", "%s Invalid date!", TimeStamp);
- return EFI_INVALID_PARAMETER;
- }
- stime.tm_mon -= 1;
-
- //
- // in struct, Year (current year minus 1900)
- // and only the dates can be handled from Jan 1, 1970 to Jan 18, 2038
- //
- //
- // convert 0 -> 100 (2000), 1 -> 101 (2001), ..., 38 -> 138 (2038)
- //
- if (stime.tm_year >= 1970 && stime.tm_year <= 2038) {
- //
- // convert 1970 -> 70, 2000 -> 100, ...
- //
- stime.tm_year -= 1900;
- } else {
- Error (NULL, 0, 3000, "Invalid", "%s Invalid or unsupported datetime!", TimeStamp);
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // convert the date and time to time_t format
- //
- newtime = mktime (&stime);
- if (newtime == (time_t) - 1) {
- Error (NULL, 0, 3000, "Invalid", "%s Invalid or unsupported datetime!", TimeStamp);
- return EFI_INVALID_PARAMETER;
- }
- }
-
- ptime = localtime (&newtime);
- DebugMsg (NULL, 0, 9, "New Image Time Stamp", "%04d-%02d-%02d %02d:%02d:%02d",
- ptime->tm_year + 1900, ptime->tm_mon + 1, ptime->tm_mday, ptime->tm_hour, ptime->tm_min, ptime->tm_sec);
- //
- // Set new time and data into PeImage.
- //
- DosHdr = (EFI_IMAGE_DOS_HEADER *)FileBuffer;
- if (DosHdr->e_magic != EFI_IMAGE_DOS_SIGNATURE) {
- // NO DOS header, must start with PE/COFF header
- FileHdr = (EFI_IMAGE_FILE_HEADER *)(FileBuffer + sizeof (UINT32));
- } else {
- FileHdr = (EFI_IMAGE_FILE_HEADER *)(FileBuffer + DosHdr->e_lfanew + sizeof (UINT32));
- }
-
- //
- // Get Debug, Export and Resource EntryTable RVA address.
- // Resource Directory entry need to review.
- //
- if (FileHdr->Machine == EFI_IMAGE_MACHINE_IA32) {
- Optional32Hdr = (EFI_IMAGE_OPTIONAL_HEADER32 *) ((UINT8*) FileHdr + sizeof (EFI_IMAGE_FILE_HEADER));
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) Optional32Hdr + FileHdr->SizeOfOptionalHeader);
- if (Optional32Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_EXPORT && \
- Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].Size != 0) {
- ExportDirectoryEntryRva = Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
- }
- if (Optional32Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE && \
- Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].Size != 0) {
- ResourceDirectoryEntryRva = Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress;
- }
- if (Optional32Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG && \
- Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].Size != 0) {
- DebugDirectoryEntryRva = Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress;
- }
- } else {
- Optional64Hdr = (EFI_IMAGE_OPTIONAL_HEADER64 *) ((UINT8*) FileHdr + sizeof (EFI_IMAGE_FILE_HEADER));
- SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) Optional64Hdr + FileHdr->SizeOfOptionalHeader);
- if (Optional64Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_EXPORT && \
- Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].Size != 0) {
- ExportDirectoryEntryRva = Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
- }
- if (Optional64Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE && \
- Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].Size != 0) {
- ResourceDirectoryEntryRva = Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress;
- }
- if (Optional64Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG && \
- Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].Size != 0) {
- DebugDirectoryEntryRva = Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress;
- }
- }
-
- //
- // Get DirectoryEntryTable file offset.
- //
- for (Index = 0; Index < FileHdr->NumberOfSections; Index ++, SectionHeader ++) {
- if (DebugDirectoryEntryRva >= SectionHeader->VirtualAddress &&
- DebugDirectoryEntryRva < SectionHeader->VirtualAddress + SectionHeader->Misc.VirtualSize) {
- DebugDirectoryEntryFileOffset =
- DebugDirectoryEntryRva - SectionHeader->VirtualAddress + SectionHeader->PointerToRawData;
- }
- if (ExportDirectoryEntryRva >= SectionHeader->VirtualAddress &&
- ExportDirectoryEntryRva < SectionHeader->VirtualAddress + SectionHeader->Misc.VirtualSize) {
- ExportDirectoryEntryFileOffset =
- ExportDirectoryEntryRva - SectionHeader->VirtualAddress + SectionHeader->PointerToRawData;
- }
- if (ResourceDirectoryEntryRva >= SectionHeader->VirtualAddress &&
- ResourceDirectoryEntryRva < SectionHeader->VirtualAddress + SectionHeader->Misc.VirtualSize) {
- ResourceDirectoryEntryFileOffset =
- ResourceDirectoryEntryRva - SectionHeader->VirtualAddress + SectionHeader->PointerToRawData;
- }
- }
-
- //
- // Set new stamp
- //
- FileHdr->TimeDateStamp = (UINT32) newtime;
- mImageTimeStamp = (UINT32) newtime;
- if (ExportDirectoryEntryRva != 0) {
- NewTimeStamp = (UINT32 *) (FileBuffer + ExportDirectoryEntryFileOffset + sizeof (UINT32));
- *NewTimeStamp = (UINT32) newtime;
- }
-
- if (ResourceDirectoryEntryRva != 0) {
- NewTimeStamp = (UINT32 *) (FileBuffer + ResourceDirectoryEntryFileOffset + sizeof (UINT32));
- *NewTimeStamp = (UINT32) newtime;
- }
-
- if (DebugDirectoryEntryRva != 0) {
- NewTimeStamp = (UINT32 *) (FileBuffer + DebugDirectoryEntryFileOffset + sizeof (UINT32));
- *NewTimeStamp = (UINT32) newtime;
- }
-
- return EFI_SUCCESS;
-}
-
-STATIC
-STATUS
-MicrocodeReadData (
- FILE *InFptr,
- UINT32 *Data
- )
-/*++
-
-Routine Description:
- Read a 32-bit microcode data value from a text file and convert to raw binary form.
-
-Arguments:
- InFptr - file pointer to input text file
- Data - pointer to where to return the data parsed
-
-Returns:
- STATUS_SUCCESS - no errors or warnings, Data contains valid information
- STATUS_ERROR - errors were encountered
-
---*/
-{
- CHAR8 Line[MAX_LINE_LEN];
- CHAR8 *cptr;
- unsigned ScannedData = 0;
-
- Line[MAX_LINE_LEN - 1] = 0;
- while (1) {
- if (fgets (Line, MAX_LINE_LEN, InFptr) == NULL) {
- return STATUS_ERROR;
- }
- //
- // If it was a binary file, then it may have overwritten our null terminator
- //
- if (Line[MAX_LINE_LEN - 1] != 0) {
- return STATUS_ERROR;
- }
-
- //
- // strip space
- //
- for (cptr = Line; *cptr && isspace((int)*cptr); cptr++) {
- }
-
- // Skip Blank Lines and Comment Lines
- if ((strlen(cptr) != 0) && (*cptr != ';')) {
- break;
- }
- }
-
- // Look for
- // dd 000000001h ; comment
- // dd XXXXXXXX
- // DD XXXXXXXXX
- // DD XXXXXXXXX
- //
- if ((tolower((int)cptr[0]) == 'd') && (tolower((int)cptr[1]) == 'd') && isspace ((int)cptr[2])) {
- //
- // Skip blanks and look for a hex digit
- //
- cptr += 3;
- for (; *cptr && isspace((int)*cptr); cptr++) {
- }
- if (isxdigit ((int)*cptr)) {
- if (sscanf (cptr, "%X", &ScannedData) != 1) {
- return STATUS_ERROR;
- }
- }
- *Data = (UINT32) ScannedData;
- return STATUS_SUCCESS;
- }
-
- return STATUS_ERROR;
-}
diff --git a/BaseTools/Source/C/GenFw/GenFw.h b/BaseTools/Source/C/GenFw/GenFw.h
deleted file mode 100644
index e36dc085ff..0000000000
--- a/BaseTools/Source/C/GenFw/GenFw.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/** @file
-
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
-
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _GEN_FW_H_
-#define _GEN_FW_H_
-
-//
-// Action for this tool.
-//
-#define FW_DUMMY_IMAGE 0
-#define FW_EFI_IMAGE 1
-#define FW_TE_IMAGE 2
-#define FW_ACPI_IMAGE 3
-#define FW_BIN_IMAGE 4
-#define FW_ZERO_DEBUG_IMAGE 5
-#define FW_SET_STAMP_IMAGE 6
-#define FW_MCI_IMAGE 7
-#define FW_MERGE_IMAGE 8
-#define FW_RELOC_STRIPEED_IMAGE 9
-#define FW_HII_PACKAGE_LIST_RCIMAGE 10
-#define FW_HII_PACKAGE_LIST_BINIMAGE 11
-#define FW_REBASE_IMAGE 12
-#define FW_SET_ADDRESS_IMAGE 13
-
-#define DUMP_TE_HEADER 0x11
-
-VOID
-SetHiiResourceHeader (
- UINT8 *HiiBinData,
- UINT32 OffsetToFile
- );
-
-INTN
-IsElfHeader (
- UINT8 *FileBuffer
- );
-
-BOOLEAN
-ConvertElf (
- UINT8 **FileBuffer,
- UINT32 *FileLength
- );
-
-#endif
diff --git a/BaseTools/Source/C/GenFw/Makefile b/BaseTools/Source/C/GenFw/Makefile
deleted file mode 100644
index e7952b9a5b..0000000000
--- a/BaseTools/Source/C/GenFw/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-## @file
-# Windows makefile for 'GenFw' module build.
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = GenFw
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = GenFw.obj ElfConvert.obj Elf32Convert.obj Elf64Convert.obj
-
-#CFLAGS = $(CFLAGS) /nodefaultlib:libc.lib
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/GenFw/elf32.h b/BaseTools/Source/C/GenFw/elf32.h
deleted file mode 100644
index 63946aad84..0000000000
--- a/BaseTools/Source/C/GenFw/elf32.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/** @file
-Ported ELF include files from FreeBSD
-
-Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
-**/
-/*-
- * Copyright (c) 1996-1998 John D. Polstra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.2 2007/12/03 21:30:36 marius Exp $
- */
-
-#ifndef _SYS_ELF32_H_
-#define _SYS_ELF32_H_ 1
-
-
-/*
- * ELF definitions common to all 32-bit architectures.
- */
-
-typedef UINT32 Elf32_Addr;
-typedef UINT16 Elf32_Half;
-typedef UINT32 Elf32_Off;
-typedef INT32 Elf32_Sword;
-typedef UINT32 Elf32_Word;
-typedef UINT64 Elf32_Lword;
-
-typedef Elf32_Word Elf32_Hashelt;
-
-/* Non-standard class-dependent datatype used for abstraction. */
-typedef Elf32_Word Elf32_Size;
-typedef Elf32_Sword Elf32_Ssize;
-
-/*
- * ELF header.
- */
-
-typedef struct {
- unsigned char e_ident[EI_NIDENT]; /* File identification. */
- Elf32_Half e_type; /* File type. */
- Elf32_Half e_machine; /* Machine architecture. */
- Elf32_Word e_version; /* ELF format version. */
- Elf32_Addr e_entry; /* Entry point. */
- Elf32_Off e_phoff; /* Program header file offset. */
- Elf32_Off e_shoff; /* Section header file offset. */
- Elf32_Word e_flags; /* Architecture-specific flags. */
- Elf32_Half e_ehsize; /* Size of ELF header in bytes. */
- Elf32_Half e_phentsize; /* Size of program header entry. */
- Elf32_Half e_phnum; /* Number of program header entries. */
- Elf32_Half e_shentsize; /* Size of section header entry. */
- Elf32_Half e_shnum; /* Number of section header entries. */
- Elf32_Half e_shstrndx; /* Section name strings section. */
-} Elf32_Ehdr;
-
-/*
- * Section header.
- */
-
-typedef struct {
- Elf32_Word sh_name; /* Section name (index into the
- section header string table). */
- Elf32_Word sh_type; /* Section type. */
- Elf32_Word sh_flags; /* Section flags. */
- Elf32_Addr sh_addr; /* Address in memory image. */
- Elf32_Off sh_offset; /* Offset in file. */
- Elf32_Word sh_size; /* Size in bytes. */
- Elf32_Word sh_link; /* Index of a related section. */
- Elf32_Word sh_info; /* Depends on section type. */
- Elf32_Word sh_addralign; /* Alignment in bytes. */
- Elf32_Word sh_entsize; /* Size of each entry in section. */
-} Elf32_Shdr;
-
-/*
- * Program header.
- */
-
-typedef struct {
- Elf32_Word p_type; /* Entry type. */
- Elf32_Off p_offset; /* File offset of contents. */
- Elf32_Addr p_vaddr; /* Virtual address in memory image. */
- Elf32_Addr p_paddr; /* Physical address (not used). */
- Elf32_Word p_filesz; /* Size of contents in file. */
- Elf32_Word p_memsz; /* Size of contents in memory. */
- Elf32_Word p_flags; /* Access permission flags. */
- Elf32_Word p_align; /* Alignment in memory and file. */
-} Elf32_Phdr;
-
-/*
- * Dynamic structure. The ".dynamic" section contains an array of them.
- */
-
-typedef struct {
- Elf32_Sword d_tag; /* Entry type. */
- union {
- Elf32_Word d_val; /* Integer value. */
- Elf32_Addr d_ptr; /* Address value. */
- } d_un;
-} Elf32_Dyn;
-
-/*
- * Relocation entries.
- */
-
-/* Relocations that don't need an addend field. */
-typedef struct {
- Elf32_Addr r_offset; /* Location to be relocated. */
- Elf32_Word r_info; /* Relocation type and symbol index. */
-} Elf32_Rel;
-
-/* Relocations that need an addend field. */
-typedef struct {
- Elf32_Addr r_offset; /* Location to be relocated. */
- Elf32_Word r_info; /* Relocation type and symbol index. */
- Elf32_Sword r_addend; /* Addend. */
-} Elf32_Rela;
-
-/* Macros for accessing the fields of r_info. */
-#define ELF32_R_SYM(info) ((info) >> 8)
-#define ELF32_R_TYPE(info) ((unsigned char)(info))
-
-/* Macro for constructing r_info from field values. */
-#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type))
-
-/*
- * Note entry header
- */
-typedef Elf_Note Elf32_Nhdr;
-
-/*
- * Move entry
- */
-typedef struct {
- Elf32_Lword m_value; /* symbol value */
- Elf32_Word m_info; /* size + index */
- Elf32_Word m_poffset; /* symbol offset */
- Elf32_Half m_repeat; /* repeat count */
- Elf32_Half m_stride; /* stride info */
-} Elf32_Move;
-
-/*
- * The macros compose and decompose values for Move.r_info
- *
- * sym = ELF32_M_SYM(M.m_info)
- * size = ELF32_M_SIZE(M.m_info)
- * M.m_info = ELF32_M_INFO(sym, size)
- */
-#define ELF32_M_SYM(info) ((info)>>8)
-#define ELF32_M_SIZE(info) ((unsigned char)(info))
-#define ELF32_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size))
-
-/*
- * Hardware/Software capabilities entry
- */
-typedef struct {
- Elf32_Word c_tag; /* how to interpret value */
- union {
- Elf32_Word c_val;
- Elf32_Addr c_ptr;
- } c_un;
-} Elf32_Cap;
-
-/*
- * Symbol table entries.
- */
-
-typedef struct {
- Elf32_Word st_name; /* String table index of name. */
- Elf32_Addr st_value; /* Symbol value. */
- Elf32_Word st_size; /* Size of associated object. */
- unsigned char st_info; /* Type and binding information. */
- unsigned char st_other; /* Reserved (not used). */
- Elf32_Half st_shndx; /* Section index of symbol. */
-} Elf32_Sym;
-
-/* Macros for accessing the fields of st_info. */
-#define ELF32_ST_BIND(info) ((info) >> 4)
-#define ELF32_ST_TYPE(info) ((info) & 0xf)
-
-/* Macro for constructing st_info from field values. */
-#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
-
-/* Macro for accessing the fields of st_other. */
-#define ELF32_ST_VISIBILITY(oth) ((oth) & 0x3)
-
-/* Structures used by Sun & GNU symbol versioning. */
-typedef struct
-{
- Elf32_Half vd_version;
- Elf32_Half vd_flags;
- Elf32_Half vd_ndx;
- Elf32_Half vd_cnt;
- Elf32_Word vd_hash;
- Elf32_Word vd_aux;
- Elf32_Word vd_next;
-} Elf32_Verdef;
-
-typedef struct
-{
- Elf32_Word vda_name;
- Elf32_Word vda_next;
-} Elf32_Verdaux;
-
-typedef struct
-{
- Elf32_Half vn_version;
- Elf32_Half vn_cnt;
- Elf32_Word vn_file;
- Elf32_Word vn_aux;
- Elf32_Word vn_next;
-} Elf32_Verneed;
-
-typedef struct
-{
- Elf32_Word vna_hash;
- Elf32_Half vna_flags;
- Elf32_Half vna_other;
- Elf32_Word vna_name;
- Elf32_Word vna_next;
-} Elf32_Vernaux;
-
-typedef Elf32_Half Elf32_Versym;
-
-typedef struct {
- Elf32_Half si_boundto; /* direct bindings - symbol bound to */
- Elf32_Half si_flags; /* per symbol flags */
-} Elf32_Syminfo;
-
-#endif /* !_SYS_ELF32_H_ */
diff --git a/BaseTools/Source/C/GenFw/elf64.h b/BaseTools/Source/C/GenFw/elf64.h
deleted file mode 100644
index 6c87207ede..0000000000
--- a/BaseTools/Source/C/GenFw/elf64.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/** @file
-Ported ELF include files from FreeBSD
-
-Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-/*-
- * Copyright (c) 1996-1998 John D. Polstra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.2 2007/12/03 21:30:36 marius Exp $
- */
-
-#ifndef _SYS_ELF64_H_
-#define _SYS_ELF64_H_ 1
-
-
-/*
- * ELF definitions common to all 64-bit architectures.
- */
-
-typedef UINT64 Elf64_Addr;
-typedef UINT16 Elf64_Half;
-typedef UINT64 Elf64_Off;
-typedef INT32 Elf64_Sword;
-typedef INT64 Elf64_Sxword;
-typedef UINT32 Elf64_Word;
-typedef UINT64 Elf64_Lword;
-typedef UINT64 Elf64_Xword;
-
-/*
- * Types of dynamic symbol hash table bucket and chain elements.
- *
- * This is inconsistent among 64 bit architectures, so a machine dependent
- * typedef is required.
- */
-
-typedef Elf64_Word Elf64_Hashelt;
-
-/* Non-standard class-dependent datatype used for abstraction. */
-typedef Elf64_Xword Elf64_Size;
-typedef Elf64_Sxword Elf64_Ssize;
-
-/*
- * ELF header.
- */
-
-typedef struct {
- unsigned char e_ident[EI_NIDENT]; /* File identification. */
- Elf64_Half e_type; /* File type. */
- Elf64_Half e_machine; /* Machine architecture. */
- Elf64_Word e_version; /* ELF format version. */
- Elf64_Addr e_entry; /* Entry point. */
- Elf64_Off e_phoff; /* Program header file offset. */
- Elf64_Off e_shoff; /* Section header file offset. */
- Elf64_Word e_flags; /* Architecture-specific flags. */
- Elf64_Half e_ehsize; /* Size of ELF header in bytes. */
- Elf64_Half e_phentsize; /* Size of program header entry. */
- Elf64_Half e_phnum; /* Number of program header entries. */
- Elf64_Half e_shentsize; /* Size of section header entry. */
- Elf64_Half e_shnum; /* Number of section header entries. */
- Elf64_Half e_shstrndx; /* Section name strings section. */
-} Elf64_Ehdr;
-
-/*
- * Section header.
- */
-
-typedef struct {
- Elf64_Word sh_name; /* Section name (index into the
- section header string table). */
- Elf64_Word sh_type; /* Section type. */
- Elf64_Xword sh_flags; /* Section flags. */
- Elf64_Addr sh_addr; /* Address in memory image. */
- Elf64_Off sh_offset; /* Offset in file. */
- Elf64_Xword sh_size; /* Size in bytes. */
- Elf64_Word sh_link; /* Index of a related section. */
- Elf64_Word sh_info; /* Depends on section type. */
- Elf64_Xword sh_addralign; /* Alignment in bytes. */
- Elf64_Xword sh_entsize; /* Size of each entry in section. */
-} Elf64_Shdr;
-
-/*
- * Program header.
- */
-
-typedef struct {
- Elf64_Word p_type; /* Entry type. */
- Elf64_Word p_flags; /* Access permission flags. */
- Elf64_Off p_offset; /* File offset of contents. */
- Elf64_Addr p_vaddr; /* Virtual address in memory image. */
- Elf64_Addr p_paddr; /* Physical address (not used). */
- Elf64_Xword p_filesz; /* Size of contents in file. */
- Elf64_Xword p_memsz; /* Size of contents in memory. */
- Elf64_Xword p_align; /* Alignment in memory and file. */
-} Elf64_Phdr;
-
-/*
- * Dynamic structure. The ".dynamic" section contains an array of them.
- */
-
-typedef struct {
- Elf64_Sxword d_tag; /* Entry type. */
- union {
- Elf64_Xword d_val; /* Integer value. */
- Elf64_Addr d_ptr; /* Address value. */
- } d_un;
-} Elf64_Dyn;
-
-/*
- * Relocation entries.
- */
-
-/* Relocations that don't need an addend field. */
-typedef struct {
- Elf64_Addr r_offset; /* Location to be relocated. */
- Elf64_Xword r_info; /* Relocation type and symbol index. */
-} Elf64_Rel;
-
-/* Relocations that need an addend field. */
-typedef struct {
- Elf64_Addr r_offset; /* Location to be relocated. */
- Elf64_Xword r_info; /* Relocation type and symbol index. */
- Elf64_Sxword r_addend; /* Addend. */
-} Elf64_Rela;
-
-/* Macros for accessing the fields of r_info. */
-#define ELF64_R_SYM(info) ((info) >> 32)
-#define ELF64_R_TYPE(info) ((info) & 0xffffffffL)
-
-/* Macro for constructing r_info from field values. */
-#define ELF64_R_INFO(sym, type) (((sym) << 32) + ((type) & 0xffffffffL))
-
-#define ELF64_R_TYPE_DATA(info) (((Elf64_Xword)(info)<<32)>>40)
-#define ELF64_R_TYPE_ID(info) (((Elf64_Xword)(info)<<56)>>56)
-#define ELF64_R_TYPE_INFO(data, type) \
- (((Elf64_Xword)(data)<<8)+(Elf64_Xword)(type))
-
-/*
- * Note entry header
- */
-typedef Elf_Note Elf64_Nhdr;
-
-/*
- * Move entry
- */
-typedef struct {
- Elf64_Lword m_value; /* symbol value */
- Elf64_Xword m_info; /* size + index */
- Elf64_Xword m_poffset; /* symbol offset */
- Elf64_Half m_repeat; /* repeat count */
- Elf64_Half m_stride; /* stride info */
-} Elf64_Move;
-
-#define ELF64_M_SYM(info) ((info)>>8)
-#define ELF64_M_SIZE(info) ((unsigned char)(info))
-#define ELF64_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size))
-
-/*
- * Hardware/Software capabilities entry
- */
-typedef struct {
- Elf64_Xword c_tag; /* how to interpret value */
- union {
- Elf64_Xword c_val;
- Elf64_Addr c_ptr;
- } c_un;
-} Elf64_Cap;
-
-/*
- * Symbol table entries.
- */
-
-typedef struct {
- Elf64_Word st_name; /* String table index of name. */
- unsigned char st_info; /* Type and binding information. */
- unsigned char st_other; /* Reserved (not used). */
- Elf64_Half st_shndx; /* Section index of symbol. */
- Elf64_Addr st_value; /* Symbol value. */
- Elf64_Xword st_size; /* Size of associated object. */
-} Elf64_Sym;
-
-/* Macros for accessing the fields of st_info. */
-#define ELF64_ST_BIND(info) ((info) >> 4)
-#define ELF64_ST_TYPE(info) ((info) & 0xf)
-
-/* Macro for constructing st_info from field values. */
-#define ELF64_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
-
-/* Macro for accessing the fields of st_other. */
-#define ELF64_ST_VISIBILITY(oth) ((oth) & 0x3)
-
-/* Structures used by Sun & GNU-style symbol versioning. */
-typedef struct {
- Elf64_Half vd_version;
- Elf64_Half vd_flags;
- Elf64_Half vd_ndx;
- Elf64_Half vd_cnt;
- Elf64_Word vd_hash;
- Elf64_Word vd_aux;
- Elf64_Word vd_next;
-} Elf64_Verdef;
-
-typedef struct {
- Elf64_Word vda_name;
- Elf64_Word vda_next;
-} Elf64_Verdaux;
-
-typedef struct {
- Elf64_Half vn_version;
- Elf64_Half vn_cnt;
- Elf64_Word vn_file;
- Elf64_Word vn_aux;
- Elf64_Word vn_next;
-} Elf64_Verneed;
-
-typedef struct {
- Elf64_Word vna_hash;
- Elf64_Half vna_flags;
- Elf64_Half vna_other;
- Elf64_Word vna_name;
- Elf64_Word vna_next;
-} Elf64_Vernaux;
-
-typedef Elf64_Half Elf64_Versym;
-
-typedef struct {
- Elf64_Half si_boundto; /* direct bindings - symbol bound to */
- Elf64_Half si_flags; /* per symbol flags */
-} Elf64_Syminfo;
-
-#endif /* !_SYS_ELF64_H_ */
diff --git a/BaseTools/Source/C/GenFw/elf_common.h b/BaseTools/Source/C/GenFw/elf_common.h
deleted file mode 100644
index df22472dc2..0000000000
--- a/BaseTools/Source/C/GenFw/elf_common.h
+++ /dev/null
@@ -1,1057 +0,0 @@
-/** @file
-Ported ELF include files from FreeBSD
-
-Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
-Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
-**/
-/*-
- * Copyright (c) 1998 John D. Polstra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/sys/elf_common.h,v 1.15.8.2 2007/12/03 21:30:36 marius Exp $
- */
-
-#ifndef _SYS_ELF_COMMON_H_
-#define _SYS_ELF_COMMON_H_ 1
-
-/*
- * ELF definitions that are independent of architecture or word size.
- */
-
-/*
- * Note header. The ".note" section contains an array of notes. Each
- * begins with this header, aligned to a word boundary. Immediately
- * following the note header is n_namesz bytes of name, padded to the
- * next word boundary. Then comes n_descsz bytes of descriptor, again
- * padded to a word boundary. The values of n_namesz and n_descsz do
- * not include the padding.
- */
-
-typedef struct {
- UINT32 n_namesz; /* Length of name. */
- UINT32 n_descsz; /* Length of descriptor. */
- UINT32 n_type; /* Type of this note. */
-} Elf_Note;
-
-/* Indexes into the e_ident array. Keep synced with
- http://www.sco.com/developers/gabi/latest/ch4.eheader.html */
-#define EI_MAG0 0 /* Magic number, byte 0. */
-#define EI_MAG1 1 /* Magic number, byte 1. */
-#define EI_MAG2 2 /* Magic number, byte 2. */
-#define EI_MAG3 3 /* Magic number, byte 3. */
-#define EI_CLASS 4 /* Class of machine. */
-#define EI_DATA 5 /* Data format. */
-#define EI_VERSION 6 /* ELF format version. */
-#define EI_OSABI 7 /* Operating system / ABI identification */
-#define EI_ABIVERSION 8 /* ABI version */
-#define OLD_EI_BRAND 8 /* Start of architecture identification. */
-#define EI_PAD 9 /* Start of padding (per SVR4 ABI). */
-#define EI_NIDENT 16 /* Size of e_ident array. */
-
-/* Values for the magic number bytes. */
-#define ELFMAG0 0x7f
-#define ELFMAG1 'E'
-#define ELFMAG2 'L'
-#define ELFMAG3 'F'
-#define ELFMAG "\177ELF" /* magic string */
-#define SELFMAG 4 /* magic string size */
-
-/* Values for e_ident[EI_VERSION] and e_version. */
-#define EV_NONE 0
-#define EV_CURRENT 1
-
-/* Values for e_ident[EI_CLASS]. */
-#define ELFCLASSNONE 0 /* Unknown class. */
-#define ELFCLASS32 1 /* 32-bit architecture. */
-#define ELFCLASS64 2 /* 64-bit architecture. */
-
-/* Values for e_ident[EI_DATA]. */
-#define ELFDATANONE 0 /* Unknown data format. */
-#define ELFDATA2LSB 1 /* 2's complement little-endian. */
-#define ELFDATA2MSB 2 /* 2's complement big-endian. */
-
-/* Values for e_ident[EI_OSABI]. */
-#define ELFOSABI_NONE 0 /* UNIX System V ABI */
-#define ELFOSABI_HPUX 1 /* HP-UX operating system */
-#define ELFOSABI_NETBSD 2 /* NetBSD */
-#define ELFOSABI_LINUX 3 /* GNU/Linux */
-#define ELFOSABI_HURD 4 /* GNU/Hurd */
-#define ELFOSABI_86OPEN 5 /* 86Open common IA32 ABI */
-#define ELFOSABI_SOLARIS 6 /* Solaris */
-#define ELFOSABI_AIX 7 /* AIX */
-#define ELFOSABI_IRIX 8 /* IRIX */
-#define ELFOSABI_FREEBSD 9 /* FreeBSD */
-#define ELFOSABI_TRU64 10 /* TRU64 UNIX */
-#define ELFOSABI_MODESTO 11 /* Novell Modesto */
-#define ELFOSABI_OPENBSD 12 /* OpenBSD */
-#define ELFOSABI_OPENVMS 13 /* Open VMS */
-#define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */
-#define ELFOSABI_ARM 97 /* ARM */
-#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
-
-#define ELFOSABI_SYSV ELFOSABI_NONE /* symbol used in old spec */
-#define ELFOSABI_MONTEREY ELFOSABI_AIX /* Monterey */
-
-/* e_ident */
-#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
- (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
- (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
- (ehdr).e_ident[EI_MAG3] == ELFMAG3)
-
-/* Values for e_type. */
-#define ET_NONE 0 /* Unknown type. */
-#define ET_REL 1 /* Relocatable. */
-#define ET_EXEC 2 /* Executable. */
-#define ET_DYN 3 /* Shared object. */
-#define ET_CORE 4 /* Core file. */
-#define ET_LOOS 0xfe00 /* First operating system specific. */
-#define ET_HIOS 0xfeff /* Last operating system-specific. */
-#define ET_LOPROC 0xff00 /* First processor-specific. */
-#define ET_HIPROC 0xffff /* Last processor-specific. */
-
-/* Values for e_machine. */
-#define EM_NONE 0 /* Unknown machine. */
-#define EM_M32 1 /* AT&T WE32100. */
-#define EM_SPARC 2 /* Sun SPARC. */
-#define EM_386 3 /* Intel i386. */
-#define EM_68K 4 /* Motorola 68000. */
-#define EM_88K 5 /* Motorola 88000. */
-#define EM_860 7 /* Intel i860. */
-#define EM_MIPS 8 /* MIPS R3000 Big-Endian only. */
-#define EM_S370 9 /* IBM System/370. */
-#define EM_MIPS_RS3_LE 10 /* MIPS R3000 Little-Endian. */
-#define EM_PARISC 15 /* HP PA-RISC. */
-#define EM_VPP500 17 /* Fujitsu VPP500. */
-#define EM_SPARC32PLUS 18 /* SPARC v8plus. */
-#define EM_960 19 /* Intel 80960. */
-#define EM_PPC 20 /* PowerPC 32-bit. */
-#define EM_PPC64 21 /* PowerPC 64-bit. */
-#define EM_S390 22 /* IBM System/390. */
-#define EM_V800 36 /* NEC V800. */
-#define EM_FR20 37 /* Fujitsu FR20. */
-#define EM_RH32 38 /* TRW RH-32. */
-#define EM_RCE 39 /* Motorola RCE. */
-#define EM_ARM 40 /* ARM. */
-#define EM_SH 42 /* Hitachi SH. */
-#define EM_SPARCV9 43 /* SPARC v9 64-bit. */
-#define EM_TRICORE 44 /* Siemens TriCore embedded processor. */
-#define EM_ARC 45 /* Argonaut RISC Core. */
-#define EM_H8_300 46 /* Hitachi H8/300. */
-#define EM_H8_300H 47 /* Hitachi H8/300H. */
-#define EM_H8S 48 /* Hitachi H8S. */
-#define EM_H8_500 49 /* Hitachi H8/500. */
-#define EM_IA_64 50 /* Intel IA-64 Processor. */
-#define EM_MIPS_X 51 /* Stanford MIPS-X. */
-#define EM_COLDFIRE 52 /* Motorola ColdFire. */
-#define EM_68HC12 53 /* Motorola M68HC12. */
-#define EM_MMA 54 /* Fujitsu MMA. */
-#define EM_PCP 55 /* Siemens PCP. */
-#define EM_NCPU 56 /* Sony nCPU. */
-#define EM_NDR1 57 /* Denso NDR1 microprocessor. */
-#define EM_STARCORE 58 /* Motorola Star*Core processor. */
-#define EM_ME16 59 /* Toyota ME16 processor. */
-#define EM_ST100 60 /* STMicroelectronics ST100 processor. */
-#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ processor. */
-#define EM_X86_64 62 /* Advanced Micro Devices x86-64 */
-#define EM_AMD64 EM_X86_64 /* Advanced Micro Devices x86-64 (compat) */
-#define EM_AARCH64 183 /* ARM 64bit Architecture */
-
-/* Non-standard or deprecated. */
-#define EM_486 6 /* Intel i486. */
-#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */
-#define EM_ALPHA_STD 41 /* Digital Alpha (standard value). */
-#define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI) */
-
-/* Special section indexes. */
-#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */
-#define SHN_LORESERVE 0xff00 /* First of reserved range. */
-#define SHN_LOPROC 0xff00 /* First processor-specific. */
-#define SHN_HIPROC 0xff1f /* Last processor-specific. */
-#define SHN_LOOS 0xff20 /* First operating system-specific. */
-#define SHN_HIOS 0xff3f /* Last operating system-specific. */
-#define SHN_ABS 0xfff1 /* Absolute values. */
-#define SHN_COMMON 0xfff2 /* Common data. */
-#define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere. */
-#define SHN_HIRESERVE 0xffff /* Last of reserved range. */
-
-/* sh_type */
-#define SHT_NULL 0 /* inactive */
-#define SHT_PROGBITS 1 /* program defined information */
-#define SHT_SYMTAB 2 /* symbol table section */
-#define SHT_STRTAB 3 /* string table section */
-#define SHT_RELA 4 /* relocation section with addends */
-#define SHT_HASH 5 /* symbol hash table section */
-#define SHT_DYNAMIC 6 /* dynamic section */
-#define SHT_NOTE 7 /* note section */
-#define SHT_NOBITS 8 /* no space section */
-#define SHT_REL 9 /* relocation section - no addends */
-#define SHT_SHLIB 10 /* reserved - purpose unknown */
-#define SHT_DYNSYM 11 /* dynamic symbol table section */
-#define SHT_INIT_ARRAY 14 /* Initialization function pointers. */
-#define SHT_FINI_ARRAY 15 /* Termination function pointers. */
-#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs. */
-#define SHT_GROUP 17 /* Section group. */
-#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX). */
-#define SHT_LOOS 0x60000000 /* First of OS specific semantics */
-#define SHT_LOSUNW 0x6ffffff4
-#define SHT_SUNW_dof 0x6ffffff4
-#define SHT_SUNW_cap 0x6ffffff5
-#define SHT_SUNW_SIGNATURE 0x6ffffff6
-#define SHT_SUNW_ANNOTATE 0x6ffffff7
-#define SHT_SUNW_DEBUGSTR 0x6ffffff8
-#define SHT_SUNW_DEBUG 0x6ffffff9
-#define SHT_SUNW_move 0x6ffffffa
-#define SHT_SUNW_COMDAT 0x6ffffffb
-#define SHT_SUNW_syminfo 0x6ffffffc
-#define SHT_SUNW_verdef 0x6ffffffd
-#define SHT_GNU_verdef 0x6ffffffd /* Symbol versions provided */
-#define SHT_SUNW_verneed 0x6ffffffe
-#define SHT_GNU_verneed 0x6ffffffe /* Symbol versions required */
-#define SHT_SUNW_versym 0x6fffffff
-#define SHT_GNU_versym 0x6fffffff /* Symbol version table */
-#define SHT_HISUNW 0x6fffffff
-#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */
-#define SHT_LOPROC 0x70000000 /* reserved range for processor */
-#define SHT_AMD64_UNWIND 0x70000001 /* unwind information */
-#define SHT_HIPROC 0x7fffffff /* specific section header types */
-#define SHT_LOUSER 0x80000000 /* reserved range for application */
-#define SHT_HIUSER 0xffffffff /* specific indexes */
-
-/* Flags for sh_flags. */
-#define SHF_WRITE 0x1 /* Section contains writable data. */
-#define SHF_ALLOC 0x2 /* Section occupies memory. */
-#define SHF_EXECINSTR 0x4 /* Section contains instructions. */
-#define SHF_MERGE 0x10 /* Section may be merged. */
-#define SHF_STRINGS 0x20 /* Section contains strings. */
-#define SHF_INFO_LINK 0x40 /* sh_info holds section index. */
-#define SHF_LINK_ORDER 0x80 /* Special ordering requirements. */
-#define SHF_OS_NONCONFORMING 0x100 /* OS-specific processing required. */
-#define SHF_GROUP 0x200 /* Member of section group. */
-#define SHF_TLS 0x400 /* Section contains TLS data. */
-#define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */
-#define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */
-
-/* Values for p_type. */
-#define PT_NULL 0 /* Unused entry. */
-#define PT_LOAD 1 /* Loadable segment. */
-#define PT_DYNAMIC 2 /* Dynamic linking information segment. */
-#define PT_INTERP 3 /* Pathname of interpreter. */
-#define PT_NOTE 4 /* Auxiliary information. */
-#define PT_SHLIB 5 /* Reserved (not used). */
-#define PT_PHDR 6 /* Location of program header itself. */
-#define PT_TLS 7 /* Thread local storage segment */
-#define PT_LOOS 0x60000000 /* First OS-specific. */
-#define PT_SUNW_UNWIND 0x6464e550 /* amd64 UNWIND program header */
-#define PT_GNU_EH_FRAME 0x6474e550
-#define PT_LOSUNW 0x6ffffffa
-#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
-#define PT_SUNWSTACK 0x6ffffffb /* describes the stack segment */
-#define PT_SUNWDTRACE 0x6ffffffc /* private */
-#define PT_SUNWCAP 0x6ffffffd /* hard/soft capabilities segment */
-#define PT_HISUNW 0x6fffffff
-#define PT_HIOS 0x6fffffff /* Last OS-specific. */
-#define PT_LOPROC 0x70000000 /* First processor-specific type. */
-#define PT_HIPROC 0x7fffffff /* Last processor-specific type. */
-
-/* Values for p_flags. */
-#define PF_X 0x1 /* Executable. */
-#define PF_W 0x2 /* Writable. */
-#define PF_R 0x4 /* Readable. */
-#define PF_MASKOS 0x0ff00000 /* Operating system-specific. */
-#define PF_MASKPROC 0xf0000000 /* Processor-specific. */
-
-/* Extended program header index. */
-#define PN_XNUM 0xffff
-
-/* Values for d_tag. */
-#define DT_NULL 0 /* Terminating entry. */
-#define DT_NEEDED 1 /* String table offset of a needed shared
- library. */
-#define DT_PLTRELSZ 2 /* Total size in bytes of PLT relocations. */
-#define DT_PLTGOT 3 /* Processor-dependent address. */
-#define DT_HASH 4 /* Address of symbol hash table. */
-#define DT_STRTAB 5 /* Address of string table. */
-#define DT_SYMTAB 6 /* Address of symbol table. */
-#define DT_RELA 7 /* Address of ElfNN_Rela relocations. */
-#define DT_RELASZ 8 /* Total size of ElfNN_Rela relocations. */
-#define DT_RELAENT 9 /* Size of each ElfNN_Rela relocation entry. */
-#define DT_STRSZ 10 /* Size of string table. */
-#define DT_SYMENT 11 /* Size of each symbol table entry. */
-#define DT_INIT 12 /* Address of initialization function. */
-#define DT_FINI 13 /* Address of finalization function. */
-#define DT_SONAME 14 /* String table offset of shared object
- name. */
-#define DT_RPATH 15 /* String table offset of library path. [sup] */
-#define DT_SYMBOLIC 16 /* Indicates "symbolic" linking. [sup] */
-#define DT_REL 17 /* Address of ElfNN_Rel relocations. */
-#define DT_RELSZ 18 /* Total size of ElfNN_Rel relocations. */
-#define DT_RELENT 19 /* Size of each ElfNN_Rel relocation. */
-#define DT_PLTREL 20 /* Type of relocation used for PLT. */
-#define DT_DEBUG 21 /* Reserved (not used). */
-#define DT_TEXTREL 22 /* Indicates there may be relocations in
- non-writable segments. [sup] */
-#define DT_JMPREL 23 /* Address of PLT relocations. */
-#define DT_BIND_NOW 24 /* [sup] */
-#define DT_INIT_ARRAY 25 /* Address of the array of pointers to
- initialization functions */
-#define DT_FINI_ARRAY 26 /* Address of the array of pointers to
- termination functions */
-#define DT_INIT_ARRAYSZ 27 /* Size in bytes of the array of
- initialization functions. */
-#define DT_FINI_ARRAYSZ 28 /* Size in bytes of the array of
- terminationfunctions. */
-#define DT_RUNPATH 29 /* String table offset of a null-terminated
- library search path string. */
-#define DT_FLAGS 30 /* Object specific flag values. */
-#define DT_ENCODING 32 /* Values greater than or equal to DT_ENCODING
- and less than DT_LOOS follow the rules for
- the interpretation of the d_un union
- as follows: even == 'd_ptr', even == 'd_val'
- or none */
-#define DT_PREINIT_ARRAY 32 /* Address of the array of pointers to
- pre-initialization functions. */
-#define DT_PREINIT_ARRAYSZ 33 /* Size in bytes of the array of
- pre-initialization functions. */
-#define DT_MAXPOSTAGS 34 /* number of positive tags */
-#define DT_LOOS 0x6000000d /* First OS-specific */
-#define DT_SUNW_AUXILIARY 0x6000000d /* symbol auxiliary name */
-#define DT_SUNW_RTLDINF 0x6000000e /* ld.so.1 info (private) */
-#define DT_SUNW_FILTER 0x6000000f /* symbol filter name */
-#define DT_SUNW_CAP 0x60000010 /* hardware/software */
-#define DT_HIOS 0x6ffff000 /* Last OS-specific */
-
-/*
- * DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
- * Dyn.d_un.d_val field of the Elf*_Dyn structure.
- */
-#define DT_VALRNGLO 0x6ffffd00
-#define DT_CHECKSUM 0x6ffffdf8 /* elf checksum */
-#define DT_PLTPADSZ 0x6ffffdf9 /* pltpadding size */
-#define DT_MOVEENT 0x6ffffdfa /* move table entry size */
-#define DT_MOVESZ 0x6ffffdfb /* move table size */
-#define DT_FEATURE_1 0x6ffffdfc /* feature holder */
-#define DT_POSFLAG_1 0x6ffffdfd /* flags for DT_* entries, effecting */
- /* the following DT_* entry. */
- /* See DF_P1_* definitions */
-#define DT_SYMINSZ 0x6ffffdfe /* syminfo table size (in bytes) */
-#define DT_SYMINENT 0x6ffffdff /* syminfo entry size (in bytes) */
-#define DT_VALRNGHI 0x6ffffdff
-
-/*
- * DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
- * Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
- *
- * If any adjustment is made to the ELF object after it has been
- * built, these entries will need to be adjusted.
- */
-#define DT_ADDRRNGLO 0x6ffffe00
-#define DT_CONFIG 0x6ffffefa /* configuration information */
-#define DT_DEPAUDIT 0x6ffffefb /* dependency auditing */
-#define DT_AUDIT 0x6ffffefc /* object auditing */
-#define DT_PLTPAD 0x6ffffefd /* pltpadding (sparcv9) */
-#define DT_MOVETAB 0x6ffffefe /* move table */
-#define DT_SYMINFO 0x6ffffeff /* syminfo table */
-#define DT_ADDRRNGHI 0x6ffffeff
-
-#define DT_VERSYM 0x6ffffff0 /* Address of versym section. */
-#define DT_RELACOUNT 0x6ffffff9 /* number of RELATIVE relocations */
-#define DT_RELCOUNT 0x6ffffffa /* number of RELATIVE relocations */
-#define DT_FLAGS_1 0x6ffffffb /* state flags - see DF_1_* defs */
-#define DT_VERDEF 0x6ffffffc /* Address of verdef section. */
-#define DT_VERDEFNUM 0x6ffffffd /* Number of elems in verdef section */
-#define DT_VERNEED 0x6ffffffe /* Address of verneed section. */
-#define DT_VERNEEDNUM 0x6fffffff /* Number of elems in verneed section */
-
-#define DT_LOPROC 0x70000000 /* First processor-specific type. */
-#define DT_DEPRECATED_SPARC_REGISTER 0x7000001
-#define DT_AUXILIARY 0x7ffffffd /* shared library auxiliary name */
-#define DT_USED 0x7ffffffe /* ignored - same as needed */
-#define DT_FILTER 0x7fffffff /* shared library filter name */
-#define DT_HIPROC 0x7fffffff /* Last processor-specific type. */
-
-/* Values for DT_FLAGS */
-#define DF_ORIGIN 0x0001 /* Indicates that the object being loaded may
- make reference to the $ORIGIN substitution
- string */
-#define DF_SYMBOLIC 0x0002 /* Indicates "symbolic" linking. */
-#define DF_TEXTREL 0x0004 /* Indicates there may be relocations in
- non-writable segments. */
-#define DF_BIND_NOW 0x0008 /* Indicates that the dynamic linker should
- process all relocations for the object
- containing this entry before transferring
- control to the program. */
-#define DF_STATIC_TLS 0x0010 /* Indicates that the shared object or
- executable contains code using a static
- thread-local storage scheme. */
-
-/* Values for n_type. Used in core files. */
-#define NT_PRSTATUS 1 /* Process status. */
-#define NT_FPREGSET 2 /* Floating point registers. */
-#define NT_PRPSINFO 3 /* Process state info. */
-
-/* Symbol Binding - ELFNN_ST_BIND - st_info */
-#define STB_LOCAL 0 /* Local symbol */
-#define STB_GLOBAL 1 /* Global symbol */
-#define STB_WEAK 2 /* like global - lower precedence */
-#define STB_LOOS 10 /* Reserved range for operating system */
-#define STB_HIOS 12 /* specific semantics. */
-#define STB_LOPROC 13 /* reserved range for processor */
-#define STB_HIPROC 15 /* specific semantics. */
-
-/* Symbol type - ELFNN_ST_TYPE - st_info */
-#define STT_NOTYPE 0 /* Unspecified type. */
-#define STT_OBJECT 1 /* Data object. */
-#define STT_FUNC 2 /* Function. */
-#define STT_SECTION 3 /* Section. */
-#define STT_FILE 4 /* Source file. */
-#define STT_COMMON 5 /* Uninitialized common block. */
-#define STT_TLS 6 /* TLS object. */
-#define STT_NUM 7
-#define STT_LOOS 10 /* Reserved range for operating system */
-#define STT_HIOS 12 /* specific semantics. */
-#define STT_LOPROC 13 /* reserved range for processor */
-#define STT_HIPROC 15 /* specific semantics. */
-
-/* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */
-#define STV_DEFAULT 0x0 /* Default visibility (see binding). */
-#define STV_INTERNAL 0x1 /* Special meaning in relocatable objects. */
-#define STV_HIDDEN 0x2 /* Not visible. */
-#define STV_PROTECTED 0x3 /* Visible but not preemptible. */
-
-/* Special symbol table indexes. */
-#define STN_UNDEF 0 /* Undefined symbol index. */
-
-/* Symbol versioning flags. */
-#define VER_DEF_CURRENT 1
-#define VER_DEF_IDX(x) VER_NDX(x)
-
-#define VER_FLG_BASE 0x01
-#define VER_FLG_WEAK 0x02
-
-#define VER_NEED_CURRENT 1
-#define VER_NEED_WEAK (1u << 15)
-#define VER_NEED_HIDDEN VER_NDX_HIDDEN
-#define VER_NEED_IDX(x) VER_NDX(x)
-
-#define VER_NDX_LOCAL 0
-#define VER_NDX_GLOBAL 1
-#define VER_NDX_GIVEN 2
-
-#define VER_NDX_HIDDEN (1u << 15)
-#define VER_NDX(x) ((x) & ~(1u << 15))
-
-#define CA_SUNW_NULL 0
-#define CA_SUNW_HW_1 1 /* first hardware capabilities entry */
-#define CA_SUNW_SF_1 2 /* first software capabilities entry */
-
-/*
- * Syminfo flag values
- */
-#define SYMINFO_FLG_DIRECT 0x0001 /* symbol ref has direct association */
- /* to object containing defn. */
-#define SYMINFO_FLG_PASSTHRU 0x0002 /* ignored - see SYMINFO_FLG_FILTER */
-#define SYMINFO_FLG_COPY 0x0004 /* symbol is a copy-reloc */
-#define SYMINFO_FLG_LAZYLOAD 0x0008 /* object containing defn should be */
- /* lazily-loaded */
-#define SYMINFO_FLG_DIRECTBIND 0x0010 /* ref should be bound directly to */
- /* object containing defn. */
-#define SYMINFO_FLG_NOEXTDIRECT 0x0020 /* don't let an external reference */
- /* directly bind to this symbol */
-#define SYMINFO_FLG_FILTER 0x0002 /* symbol ref is associated to a */
-#define SYMINFO_FLG_AUXILIARY 0x0040 /* standard or auxiliary filter */
-
-/*
- * Syminfo.si_boundto values.
- */
-#define SYMINFO_BT_SELF 0xffff /* symbol bound to self */
-#define SYMINFO_BT_PARENT 0xfffe /* symbol bound to parent */
-#define SYMINFO_BT_NONE 0xfffd /* no special symbol binding */
-#define SYMINFO_BT_EXTERN 0xfffc /* symbol defined as external */
-#define SYMINFO_BT_LOWRESERVE 0xff00 /* beginning of reserved entries */
-
-/*
- * Syminfo version values.
- */
-#define SYMINFO_NONE 0 /* Syminfo version */
-#define SYMINFO_CURRENT 1
-#define SYMINFO_NUM 2
-
-/*
- * Relocation types.
- *
- * All machine architectures are defined here to allow tools on one to
- * handle others.
- */
-
-#define R_386_NONE 0 /* No relocation. */
-#define R_386_32 1 /* Add symbol value. */
-#define R_386_PC32 2 /* Add PC-relative symbol value. */
-#define R_386_GOT32 3 /* Add PC-relative GOT offset. */
-#define R_386_PLT32 4 /* Add PC-relative PLT offset. */
-#define R_386_COPY 5 /* Copy data from shared object. */
-#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */
-#define R_386_JMP_SLOT 7 /* Set GOT entry to code address. */
-#define R_386_RELATIVE 8 /* Add load address of shared object. */
-#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */
-#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */
-#define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */
-#define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */
-#define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */
-#define R_386_TLS_LE 17 /* Negative offset relative to static TLS */
-#define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */
-#define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */
-#define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */
-#define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */
-#define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */
-#define R_386_TLS_GD_POP 27 /* popl instruction for Sun ABI GD sequence */
-#define R_386_TLS_LDM_32 28 /* 32 bit offset to GOT (index,zero) pair */
-#define R_386_TLS_LDM_PUSH 29 /* pushl instruction for Sun ABI LD sequence */
-#define R_386_TLS_LDM_CALL 30 /* call instruction for Sun ABI LD sequence */
-#define R_386_TLS_LDM_POP 31 /* popl instruction for Sun ABI LD sequence */
-#define R_386_TLS_LDO_32 32 /* 32 bit offset from start of TLS block */
-#define R_386_TLS_IE_32 33 /* 32 bit offset to GOT static TLS offset entry */
-#define R_386_TLS_LE_32 34 /* 32 bit offset within static TLS block */
-#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */
-#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */
-#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */
-
-/* Null relocation */
-#define R_AARCH64_NONE 256 /* No relocation */
-/* Static AArch64 relocations */
- /* Static data relocations */
-#define R_AARCH64_ABS64 257 /* S + A */
-#define R_AARCH64_ABS32 258 /* S + A */
-#define R_AARCH64_ABS16 259 /* S + A */
-#define R_AARCH64_PREL64 260 /* S + A - P */
-#define R_AARCH64_PREL32 261 /* S + A - P */
-#define R_AARCH64_PREL16 262 /* S + A - P */
- /* Group relocations to create a 16, 32, 48, or 64 bit unsigned data value or address inline */
-#define R_AARCH64_MOVW_UABS_G0 263 /* S + A */
-#define R_AARCH64_MOVW_UABS_G0_NC 264 /* S + A */
-#define R_AARCH64_MOVW_UABS_G1 265 /* S + A */
-#define R_AARCH64_MOVW_UABS_G1_NC 266 /* S + A */
-#define R_AARCH64_MOVW_UABS_G2 267 /* S + A */
-#define R_AARCH64_MOVW_UABS_G2_NC 268 /* S + A */
-#define R_AARCH64_MOVW_UABS_G3 269 /* S + A */
- /* Group relocations to create a 16, 32, 48, or 64 bit signed data or offset value inline */
-#define R_AARCH64_MOVW_SABS_G0 270 /* S + A */
-#define R_AARCH64_MOVW_SABS_G1 271 /* S + A */
-#define R_AARCH64_MOVW_SABS_G2 272 /* S + A */
- /* Relocations to generate 19, 21 and 33 bit PC-relative addresses */
-#define R_AARCH64_LD_PREL_LO19 273 /* S + A - P */
-#define R_AARCH64_ADR_PREL_LO21 274 /* S + A - P */
-#define R_AARCH64_ADR_PREL_PG_HI21 275 /* Page(S+A) - Page(P) */
-#define R_AARCH64_ADR_PREL_PG_HI21_NC 276 /* Page(S+A) - Page(P) */
-#define R_AARCH64_ADD_ABS_LO12_NC 277 /* S + A */
-#define R_AARCH64_LDST8_ABS_LO12_NC 278 /* S + A */
-#define R_AARCH64_LDST16_ABS_LO12_NC 284 /* S + A */
-#define R_AARCH64_LDST32_ABS_LO12_NC 285 /* S + A */
-#define R_AARCH64_LDST64_ABS_LO12_NC 286 /* S + A */
-#define R_AARCH64_LDST128_ABS_LO12_NC 299 /* S + A */
- /* Relocations for control-flow instructions - all offsets are a multiple of 4 */
-#define R_AARCH64_TSTBR14 279 /* S+A-P */
-#define R_AARCH64_CONDBR19 280 /* S+A-P */
-#define R_AARCH64_JUMP26 282 /* S+A-P */
-#define R_AARCH64_CALL26 283 /* S+A-P */
- /* Group relocations to create a 16, 32, 48, or 64 bit PC-relative offset inline */
-#define R_AARCH64_MOVW_PREL_G0 287 /* S+A-P */
-#define R_AARCH64_MOVW_PREL_G0_NC 288 /* S+A-P */
-#define R_AARCH64_MOVW_PREL_G1 289 /* S+A-P */
-#define R_AARCH64_MOVW_PREL_G1_NC 290 /* S+A-P */
-#define R_AARCH64_MOVW_PREL_G2 291 /* S+A-P */
-#define R_AARCH64_MOVW_PREL_G2_NC 292 /* S+A-P */
-#define R_AARCH64_MOVW_PREL_G3 293 /* S+A-P */
- /* Group relocations to create a 16, 32, 48, or 64 bit GOT-relative offsets inline */
-#define R_AARCH64_MOVW_GOTOFF_G0 300 /* G(S)-GOT */
-#define R_AARCH64_MOVW_GOTOFF_G0_NC 301 /* G(S)-GOT */
-#define R_AARCH64_MOVW_GOTOFF_G1 302 /* G(S)-GOT */
-#define R_AARCH64_MOVW_GOTOFF_G1_NC 303 /* G(S)-GOT */
-#define R_AARCH64_MOVW_GOTOFF_G2 304 /* G(S)-GOT */
-#define R_AARCH64_MOVW_GOTOFF_G2_NC 305 /* G(S)-GOT */
-#define R_AARCH64_MOVW_GOTOFF_G3 306 /* G(S)-GOT */
- /* GOT-relative data relocations */
-#define R_AARCH64_GOTREL64 307 /* S+A-GOT */
-#define R_AARCH64_GOTREL32 308 /* S+A-GOT */
- /* GOT-relative instruction relocations */
-#define R_AARCH64_GOT_LD_PREL19 309 /* G(S)-P */
-#define R_AARCH64_LD64_GOTOFF_LO15 310 /* G(S)-GOT */
-#define R_AARCH64_ADR_GOT_PAGE 311 /* Page(G(S))-Page(P) */
-#define R_AARCH64_LD64_GOT_LO12_NC 312 /* G(S) */
-#define R_AARCH64_LD64_GOTPAGE_LO15 313 /* G(S)-Page(GOT) */
-/* Relocations for thread-local storage */
- /* General Dynamic TLS relocations */
-#define R_AARCH64_TLSGD_ADR_PREL21 512 /* G(TLSIDX(S+A)) - P */
-#define R_AARCH64_TLSGD_ADR_PAGE21 513 /* Page(G(TLSIDX(S+A))) - Page(P) */
-#define R_AARCH64_TLSGD_ADD_LO12_NC 514 /* G(TLSIDX(S+A)) */
-#define R_AARCH64_TLSGD_MOVW_G1 515 /* G(TLSIDX(S+A)) - GOT */
-#define R_AARCH64_TLSGD_MOVW_G0_NC 516 /* G(TLSIDX(S+A)) - GOT */
- /* Local Dynamic TLS relocations */
-#define R_AARCH64_TLSLD_ADR_PREL21 517 /* G(LDM(S))) - P */
-#define R_AARCH64_TLSLD_ADR_PAGE21 518 /* Page(G(LDM(S)))-Page(P) */
-#define R_AARCH64_TLSLD_ADD_LO12_NC 519 /* G(LDM(S)) */
-#define R_AARCH64_TLSLD_MOVW_G1 520 /* G(LDM(S)) - GOT */
-#define R_AARCH64_TLSLD_MOVW_G0_NC 521 /* G(LDM(S)) - GOT */
-#define R_AARCH64_TLSLD_LD_PREL19 522 /* G(LDM(S)) - P */
-#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537 /* DTPREL(S+A) */
-#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538 /* DTPREL(S+A) */
- /* Initial Exec TLS relocations */
-#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539 /* G(TPREL(S+A)) - GOT */
-#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540 /* G(TPREL(S+A)) - GOT */
-#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541 /* Page(G(TPREL(S+A))) - Page(P) */
-#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542 /* G(TPREL(S+A)) */
-#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543 /* G(TPREL(S+A)) - P */
- /* Local Exec TLS relocations */
-#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558 /* TPREL(S+A) */
-#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559 /* TPREL(S+A) */
-/* Dynamic relocations */
- /* Dynamic relocations */
-#define R_AARCH64_COPY 1024
-#define R_AARCH64_GLOB_DAT 1025 /* S + A */
-#define R_AARCH64_JUMP_SLOT 1026 /* S + A */
-#define R_AARCH64_RELATIVE 1027 /* Delta(S) + A , Delta(P) + A */
-#define R_AARCH64_TLS_DTPREL64 1028 /* DTPREL(S+A) */
-#define R_AARCH64_TLS_DTPMOD64 1029 /* LDM(S) */
-#define R_AARCH64_TLS_TPREL64 1030 /* TPREL(S+A) */
-#define R_AARCH64_TLS_DTPREL32 1031 /* DTPREL(S+A) */
-#define R_AARCH64_TLS_DTPMOD32 1032 /* LDM(S) */
-#define R_AARCH64_TLS_TPREL32 1033 /* DTPREL(S+A) */
-
-#define R_ALPHA_NONE 0 /* No reloc */
-#define R_ALPHA_REFLONG 1 /* Direct 32 bit */
-#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */
-#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */
-#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */
-#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */
-#define R_ALPHA_GPDISP 6 /* Add displacement to GP */
-#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */
-#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */
-#define R_ALPHA_SREL16 9 /* PC relative 16 bit */
-#define R_ALPHA_SREL32 10 /* PC relative 32 bit */
-#define R_ALPHA_SREL64 11 /* PC relative 64 bit */
-#define R_ALPHA_OP_PUSH 12 /* OP stack push */
-#define R_ALPHA_OP_STORE 13 /* OP stack pop and store */
-#define R_ALPHA_OP_PSUB 14 /* OP stack subtract */
-#define R_ALPHA_OP_PRSHIFT 15 /* OP stack right shift */
-#define R_ALPHA_GPVALUE 16
-#define R_ALPHA_GPRELHIGH 17
-#define R_ALPHA_GPRELLOW 18
-#define R_ALPHA_IMMED_GP_16 19
-#define R_ALPHA_IMMED_GP_HI32 20
-#define R_ALPHA_IMMED_SCN_HI32 21
-#define R_ALPHA_IMMED_BR_HI32 22
-#define R_ALPHA_IMMED_LO32 23
-#define R_ALPHA_COPY 24 /* Copy symbol at runtime */
-#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */
-#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
-#define R_ALPHA_RELATIVE 27 /* Adjust by program base */
-
-#define R_ARM_NONE 0 /* No relocation. */
-#define R_ARM_PC24 1
-#define R_ARM_ABS32 2
-#define R_ARM_REL32 3
-#define R_ARM_PC13 4
-#define R_ARM_ABS16 5
-#define R_ARM_ABS12 6
-#define R_ARM_THM_ABS5 7
-#define R_ARM_ABS8 8
-#define R_ARM_SBREL32 9
-#define R_ARM_THM_PC22 10
-#define R_ARM_THM_PC8 11
-#define R_ARM_AMP_VCALL9 12
-#define R_ARM_SWI24 13
-#define R_ARM_THM_SWI8 14
-#define R_ARM_XPC25 15
-#define R_ARM_THM_XPC22 16
-#define R_ARM_COPY 20 /* Copy data from shared object. */
-#define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */
-#define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */
-#define R_ARM_RELATIVE 23 /* Add load address of shared object. */
-#define R_ARM_GOTOFF 24 /* Add GOT-relative symbol address. */
-#define R_ARM_GOTPC 25 /* Add PC-relative GOT table address. */
-#define R_ARM_GOT32 26 /* Add PC-relative GOT offset. */
-#define R_ARM_PLT32 27 /* Add PC-relative PLT offset. */
-#define R_ARM_CALL 28
-#define R_ARM_JMP24 29
-#define R_ARM_THM_MOVW_ABS_NC 47
-#define R_ARM_THM_MOVT_ABS 48
-
-// Block of PC-relative relocations added to work around gcc putting
-// object relocations in static executables.
-#define R_ARM_THM_JUMP24 30
-#define R_ARM_PREL31 42
-#define R_ARM_MOVW_PREL_NC 45
-#define R_ARM_MOVT_PREL 46
-#define R_ARM_THM_MOVW_PREL_NC 49
-#define R_ARM_THM_MOVT_PREL 50
-#define R_ARM_THM_JMP6 52
-#define R_ARM_THM_ALU_PREL_11_0 53
-#define R_ARM_THM_PC12 54
-#define R_ARM_REL32_NOI 56
-#define R_ARM_ALU_PC_G0_NC 57
-#define R_ARM_ALU_PC_G0 58
-#define R_ARM_ALU_PC_G1_NC 59
-#define R_ARM_ALU_PC_G1 60
-#define R_ARM_ALU_PC_G2 61
-#define R_ARM_LDR_PC_G1 62
-#define R_ARM_LDR_PC_G2 63
-#define R_ARM_LDRS_PC_G0 64
-#define R_ARM_LDRS_PC_G1 65
-#define R_ARM_LDRS_PC_G2 66
-#define R_ARM_LDC_PC_G0 67
-#define R_ARM_LDC_PC_G1 68
-#define R_ARM_LDC_PC_G2 69
-#define R_ARM_GOT_PREL 96
-#define R_ARM_THM_JUMP11 102
-#define R_ARM_THM_JUMP8 103
-#define R_ARM_TLS_GD32 104
-#define R_ARM_TLS_LDM32 105
-#define R_ARM_TLS_IE32 107
-
-#define R_ARM_THM_JUMP19 51
-#define R_ARM_GNU_VTENTRY 100
-#define R_ARM_GNU_VTINHERIT 101
-#define R_ARM_RSBREL32 250
-#define R_ARM_THM_RPC22 251
-#define R_ARM_RREL32 252
-#define R_ARM_RABS32 253
-#define R_ARM_RPC24 254
-#define R_ARM_RBASE 255
-
-
-
-/* Name Value Field Calculation */
-#define R_IA_64_NONE 0 /* None */
-#define R_IA_64_IMM14 0x21 /* immediate14 S + A */
-#define R_IA_64_IMM22 0x22 /* immediate22 S + A */
-#define R_IA_64_IMM64 0x23 /* immediate64 S + A */
-#define R_IA_64_DIR32MSB 0x24 /* word32 MSB S + A */
-#define R_IA_64_DIR32LSB 0x25 /* word32 LSB S + A */
-#define R_IA_64_DIR64MSB 0x26 /* word64 MSB S + A */
-#define R_IA_64_DIR64LSB 0x27 /* word64 LSB S + A */
-#define R_IA_64_GPREL22 0x2a /* immediate22 @gprel(S + A) */
-#define R_IA_64_GPREL64I 0x2b /* immediate64 @gprel(S + A) */
-#define R_IA_64_GPREL32MSB 0x2c /* word32 MSB @gprel(S + A) */
-#define R_IA_64_GPREL32LSB 0x2d /* word32 LSB @gprel(S + A) */
-#define R_IA_64_GPREL64MSB 0x2e /* word64 MSB @gprel(S + A) */
-#define R_IA_64_GPREL64LSB 0x2f /* word64 LSB @gprel(S + A) */
-#define R_IA_64_LTOFF22 0x32 /* immediate22 @ltoff(S + A) */
-#define R_IA_64_LTOFF64I 0x33 /* immediate64 @ltoff(S + A) */
-#define R_IA_64_PLTOFF22 0x3a /* immediate22 @pltoff(S + A) */
-#define R_IA_64_PLTOFF64I 0x3b /* immediate64 @pltoff(S + A) */
-#define R_IA_64_PLTOFF64MSB 0x3e /* word64 MSB @pltoff(S + A) */
-#define R_IA_64_PLTOFF64LSB 0x3f /* word64 LSB @pltoff(S + A) */
-#define R_IA_64_FPTR64I 0x43 /* immediate64 @fptr(S + A) */
-#define R_IA_64_FPTR32MSB 0x44 /* word32 MSB @fptr(S + A) */
-#define R_IA_64_FPTR32LSB 0x45 /* word32 LSB @fptr(S + A) */
-#define R_IA_64_FPTR64MSB 0x46 /* word64 MSB @fptr(S + A) */
-#define R_IA_64_FPTR64LSB 0x47 /* word64 LSB @fptr(S + A) */
-#define R_IA_64_PCREL60B 0x48 /* immediate60 form1 S + A - P */
-#define R_IA_64_PCREL21B 0x49 /* immediate21 form1 S + A - P */
-#define R_IA_64_PCREL21M 0x4a /* immediate21 form2 S + A - P */
-#define R_IA_64_PCREL21F 0x4b /* immediate21 form3 S + A - P */
-#define R_IA_64_PCREL32MSB 0x4c /* word32 MSB S + A - P */
-#define R_IA_64_PCREL32LSB 0x4d /* word32 LSB S + A - P */
-#define R_IA_64_PCREL64MSB 0x4e /* word64 MSB S + A - P */
-#define R_IA_64_PCREL64LSB 0x4f /* word64 LSB S + A - P */
-#define R_IA_64_LTOFF_FPTR22 0x52 /* immediate22 @ltoff(@fptr(S + A)) */
-#define R_IA_64_LTOFF_FPTR64I 0x53 /* immediate64 @ltoff(@fptr(S + A)) */
-#define R_IA_64_LTOFF_FPTR32MSB 0x54 /* word32 MSB @ltoff(@fptr(S + A)) */
-#define R_IA_64_LTOFF_FPTR32LSB 0x55 /* word32 LSB @ltoff(@fptr(S + A)) */
-#define R_IA_64_LTOFF_FPTR64MSB 0x56 /* word64 MSB @ltoff(@fptr(S + A)) */
-#define R_IA_64_LTOFF_FPTR64LSB 0x57 /* word64 LSB @ltoff(@fptr(S + A)) */
-#define R_IA_64_SEGREL32MSB 0x5c /* word32 MSB @segrel(S + A) */
-#define R_IA_64_SEGREL32LSB 0x5d /* word32 LSB @segrel(S + A) */
-#define R_IA_64_SEGREL64MSB 0x5e /* word64 MSB @segrel(S + A) */
-#define R_IA_64_SEGREL64LSB 0x5f /* word64 LSB @segrel(S + A) */
-#define R_IA_64_SECREL32MSB 0x64 /* word32 MSB @secrel(S + A) */
-#define R_IA_64_SECREL32LSB 0x65 /* word32 LSB @secrel(S + A) */
-#define R_IA_64_SECREL64MSB 0x66 /* word64 MSB @secrel(S + A) */
-#define R_IA_64_SECREL64LSB 0x67 /* word64 LSB @secrel(S + A) */
-#define R_IA_64_REL32MSB 0x6c /* word32 MSB BD + A */
-#define R_IA_64_REL32LSB 0x6d /* word32 LSB BD + A */
-#define R_IA_64_REL64MSB 0x6e /* word64 MSB BD + A */
-#define R_IA_64_REL64LSB 0x6f /* word64 LSB BD + A */
-#define R_IA_64_LTV32MSB 0x74 /* word32 MSB S + A */
-#define R_IA_64_LTV32LSB 0x75 /* word32 LSB S + A */
-#define R_IA_64_LTV64MSB 0x76 /* word64 MSB S + A */
-#define R_IA_64_LTV64LSB 0x77 /* word64 LSB S + A */
-#define R_IA_64_PCREL21BI 0x79 /* immediate21 form1 S + A - P */
-#define R_IA_64_PCREL22 0x7a /* immediate22 S + A - P */
-#define R_IA_64_PCREL64I 0x7b /* immediate64 S + A - P */
-#define R_IA_64_IPLTMSB 0x80 /* function descriptor MSB special */
-#define R_IA_64_IPLTLSB 0x81 /* function descriptor LSB speciaal */
-#define R_IA_64_SUB 0x85 /* immediate64 A - S */
-#define R_IA_64_LTOFF22X 0x86 /* immediate22 special */
-#define R_IA_64_LDXMOV 0x87 /* immediate22 special */
-#define R_IA_64_TPREL14 0x91 /* imm14 @tprel(S + A) */
-#define R_IA_64_TPREL22 0x92 /* imm22 @tprel(S + A) */
-#define R_IA_64_TPREL64I 0x93 /* imm64 @tprel(S + A) */
-#define R_IA_64_TPREL64MSB 0x96 /* word64 MSB @tprel(S + A) */
-#define R_IA_64_TPREL64LSB 0x97 /* word64 LSB @tprel(S + A) */
-#define R_IA_64_LTOFF_TPREL22 0x9a /* imm22 @ltoff(@tprel(S+A)) */
-#define R_IA_64_DTPMOD64MSB 0xa6 /* word64 MSB @dtpmod(S + A) */
-#define R_IA_64_DTPMOD64LSB 0xa7 /* word64 LSB @dtpmod(S + A) */
-#define R_IA_64_LTOFF_DTPMOD22 0xaa /* imm22 @ltoff(@dtpmod(S+A)) */
-#define R_IA_64_DTPREL14 0xb1 /* imm14 @dtprel(S + A) */
-#define R_IA_64_DTPREL22 0xb2 /* imm22 @dtprel(S + A) */
-#define R_IA_64_DTPREL64I 0xb3 /* imm64 @dtprel(S + A) */
-#define R_IA_64_DTPREL32MSB 0xb4 /* word32 MSB @dtprel(S + A) */
-#define R_IA_64_DTPREL32LSB 0xb5 /* word32 LSB @dtprel(S + A) */
-#define R_IA_64_DTPREL64MSB 0xb6 /* word64 MSB @dtprel(S + A) */
-#define R_IA_64_DTPREL64LSB 0xb7 /* word64 LSB @dtprel(S + A) */
-#define R_IA_64_LTOFF_DTPREL22 0xba /* imm22 @ltoff(@dtprel(S+A)) */
-
-#define R_PPC_NONE 0 /* No relocation. */
-#define R_PPC_ADDR32 1
-#define R_PPC_ADDR24 2
-#define R_PPC_ADDR16 3
-#define R_PPC_ADDR16_LO 4
-#define R_PPC_ADDR16_HI 5
-#define R_PPC_ADDR16_HA 6
-#define R_PPC_ADDR14 7
-#define R_PPC_ADDR14_BRTAKEN 8
-#define R_PPC_ADDR14_BRNTAKEN 9
-#define R_PPC_REL24 10
-#define R_PPC_REL14 11
-#define R_PPC_REL14_BRTAKEN 12
-#define R_PPC_REL14_BRNTAKEN 13
-#define R_PPC_GOT16 14
-#define R_PPC_GOT16_LO 15
-#define R_PPC_GOT16_HI 16
-#define R_PPC_GOT16_HA 17
-#define R_PPC_PLTREL24 18
-#define R_PPC_COPY 19
-#define R_PPC_GLOB_DAT 20
-#define R_PPC_JMP_SLOT 21
-#define R_PPC_RELATIVE 22
-#define R_PPC_LOCAL24PC 23
-#define R_PPC_UADDR32 24
-#define R_PPC_UADDR16 25
-#define R_PPC_REL32 26
-#define R_PPC_PLT32 27
-#define R_PPC_PLTREL32 28
-#define R_PPC_PLT16_LO 29
-#define R_PPC_PLT16_HI 30
-#define R_PPC_PLT16_HA 31
-#define R_PPC_SDAREL16 32
-#define R_PPC_SECTOFF 33
-#define R_PPC_SECTOFF_LO 34
-#define R_PPC_SECTOFF_HI 35
-#define R_PPC_SECTOFF_HA 36
-
-/*
- * TLS relocations
- */
-#define R_PPC_TLS 67
-#define R_PPC_DTPMOD32 68
-#define R_PPC_TPREL16 69
-#define R_PPC_TPREL16_LO 70
-#define R_PPC_TPREL16_HI 71
-#define R_PPC_TPREL16_HA 72
-#define R_PPC_TPREL32 73
-#define R_PPC_DTPREL16 74
-#define R_PPC_DTPREL16_LO 75
-#define R_PPC_DTPREL16_HI 76
-#define R_PPC_DTPREL16_HA 77
-#define R_PPC_DTPREL32 78
-#define R_PPC_GOT_TLSGD16 79
-#define R_PPC_GOT_TLSGD16_LO 80
-#define R_PPC_GOT_TLSGD16_HI 81
-#define R_PPC_GOT_TLSGD16_HA 82
-#define R_PPC_GOT_TLSLD16 83
-#define R_PPC_GOT_TLSLD16_LO 84
-#define R_PPC_GOT_TLSLD16_HI 85
-#define R_PPC_GOT_TLSLD16_HA 86
-#define R_PPC_GOT_TPREL16 87
-#define R_PPC_GOT_TPREL16_LO 88
-#define R_PPC_GOT_TPREL16_HI 89
-#define R_PPC_GOT_TPREL16_HA 90
-
-/*
- * The remaining relocs are from the Embedded ELF ABI, and are not in the
- * SVR4 ELF ABI.
- */
-
-#define R_PPC_EMB_NADDR32 101
-#define R_PPC_EMB_NADDR16 102
-#define R_PPC_EMB_NADDR16_LO 103
-#define R_PPC_EMB_NADDR16_HI 104
-#define R_PPC_EMB_NADDR16_HA 105
-#define R_PPC_EMB_SDAI16 106
-#define R_PPC_EMB_SDA2I16 107
-#define R_PPC_EMB_SDA2REL 108
-#define R_PPC_EMB_SDA21 109
-#define R_PPC_EMB_MRKREF 110
-#define R_PPC_EMB_RELSEC16 111
-#define R_PPC_EMB_RELST_LO 112
-#define R_PPC_EMB_RELST_HI 113
-#define R_PPC_EMB_RELST_HA 114
-#define R_PPC_EMB_BIT_FLD 115
-#define R_PPC_EMB_RELSDA 116
-
-#define R_SPARC_NONE 0
-#define R_SPARC_8 1
-#define R_SPARC_16 2
-#define R_SPARC_32 3
-#define R_SPARC_DISP8 4
-#define R_SPARC_DISP16 5
-#define R_SPARC_DISP32 6
-#define R_SPARC_WDISP30 7
-#define R_SPARC_WDISP22 8
-#define R_SPARC_HI22 9
-#define R_SPARC_22 10
-#define R_SPARC_13 11
-#define R_SPARC_LO10 12
-#define R_SPARC_GOT10 13
-#define R_SPARC_GOT13 14
-#define R_SPARC_GOT22 15
-#define R_SPARC_PC10 16
-#define R_SPARC_PC22 17
-#define R_SPARC_WPLT30 18
-#define R_SPARC_COPY 19
-#define R_SPARC_GLOB_DAT 20
-#define R_SPARC_JMP_SLOT 21
-#define R_SPARC_RELATIVE 22
-#define R_SPARC_UA32 23
-#define R_SPARC_PLT32 24
-#define R_SPARC_HIPLT22 25
-#define R_SPARC_LOPLT10 26
-#define R_SPARC_PCPLT32 27
-#define R_SPARC_PCPLT22 28
-#define R_SPARC_PCPLT10 29
-#define R_SPARC_10 30
-#define R_SPARC_11 31
-#define R_SPARC_64 32
-#define R_SPARC_OLO10 33
-#define R_SPARC_HH22 34
-#define R_SPARC_HM10 35
-#define R_SPARC_LM22 36
-#define R_SPARC_PC_HH22 37
-#define R_SPARC_PC_HM10 38
-#define R_SPARC_PC_LM22 39
-#define R_SPARC_WDISP16 40
-#define R_SPARC_WDISP19 41
-#define R_SPARC_GLOB_JMP 42
-#define R_SPARC_7 43
-#define R_SPARC_5 44
-#define R_SPARC_6 45
-#define R_SPARC_DISP64 46
-#define R_SPARC_PLT64 47
-#define R_SPARC_HIX22 48
-#define R_SPARC_LOX10 49
-#define R_SPARC_H44 50
-#define R_SPARC_M44 51
-#define R_SPARC_L44 52
-#define R_SPARC_REGISTER 53
-#define R_SPARC_UA64 54
-#define R_SPARC_UA16 55
-#define R_SPARC_TLS_GD_HI22 56
-#define R_SPARC_TLS_GD_LO10 57
-#define R_SPARC_TLS_GD_ADD 58
-#define R_SPARC_TLS_GD_CALL 59
-#define R_SPARC_TLS_LDM_HI22 60
-#define R_SPARC_TLS_LDM_LO10 61
-#define R_SPARC_TLS_LDM_ADD 62
-#define R_SPARC_TLS_LDM_CALL 63
-#define R_SPARC_TLS_LDO_HIX22 64
-#define R_SPARC_TLS_LDO_LOX10 65
-#define R_SPARC_TLS_LDO_ADD 66
-#define R_SPARC_TLS_IE_HI22 67
-#define R_SPARC_TLS_IE_LO10 68
-#define R_SPARC_TLS_IE_LD 69
-#define R_SPARC_TLS_IE_LDX 70
-#define R_SPARC_TLS_IE_ADD 71
-#define R_SPARC_TLS_LE_HIX22 72
-#define R_SPARC_TLS_LE_LOX10 73
-#define R_SPARC_TLS_DTPMOD32 74
-#define R_SPARC_TLS_DTPMOD64 75
-#define R_SPARC_TLS_DTPOFF32 76
-#define R_SPARC_TLS_DTPOFF64 77
-#define R_SPARC_TLS_TPOFF32 78
-#define R_SPARC_TLS_TPOFF64 79
-
-#define R_X86_64_NONE 0 /* No relocation. */
-#define R_X86_64_64 1 /* Add 64 bit symbol value. */
-#define R_X86_64_PC32 2 /* PC-relative 32 bit signed sym value. */
-#define R_X86_64_GOT32 3 /* PC-relative 32 bit GOT offset. */
-#define R_X86_64_PLT32 4 /* PC-relative 32 bit PLT offset. */
-#define R_X86_64_COPY 5 /* Copy data from shared object. */
-#define R_X86_64_GLOB_DAT 6 /* Set GOT entry to data address. */
-#define R_X86_64_JMP_SLOT 7 /* Set GOT entry to code address. */
-#define R_X86_64_RELATIVE 8 /* Add load address of shared object. */
-#define R_X86_64_GOTPCREL 9 /* Add 32 bit signed pcrel offset to GOT. */
-#define R_X86_64_32 10 /* Add 32 bit zero extended symbol value */
-#define R_X86_64_32S 11 /* Add 32 bit sign extended symbol value */
-#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */
-#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */
-#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */
-#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */
-#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */
-#define R_X86_64_DTPOFF64 17 /* Offset in TLS block */
-#define R_X86_64_TPOFF64 18 /* Offset in static TLS block */
-#define R_X86_64_TLSGD 19 /* PC relative offset to GD GOT entry */
-#define R_X86_64_TLSLD 20 /* PC relative offset to LD GOT entry */
-#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */
-#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */
-#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */
-
-
-#endif /* !_SYS_ELF_COMMON_H_ */
diff --git a/BaseTools/Source/C/GenPage/GNUmakefile b/BaseTools/Source/C/GenPage/GNUmakefile
deleted file mode 100644
index e1eab8747c..0000000000
--- a/BaseTools/Source/C/GenPage/GNUmakefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# GNU/Linux makefile for 'GenPage' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = GenPage
-
-LIBS = -lCommon
-
-OBJECTS = GenPage.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
diff --git a/BaseTools/Source/C/GenPage/GenPage.c b/BaseTools/Source/C/GenPage/GenPage.c
deleted file mode 100644
index 78047ba9be..0000000000
--- a/BaseTools/Source/C/GenPage/GenPage.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
- GenPage.c
-
-Abstract:
- Pre-Create a 4G page table (2M pages).
- It's used in DUET x64 build needed to enter LongMode.
-
- Create 4G page table (2M pages)
-
- Linear Address
- 63 48 47 39 38 30 29 21 20 0
- +--------+-------+---------------+-----------+-----------------------------+
- PML4 Directory-Ptr Directory Offset
-
- Paging-Structures :=
- PML4
- (
- Directory-Ptr Directory {512}
- ) {4}
-**/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "VirtualMemory.h"
-#include "EfiUtilityMsgs.h"
-#include "ParseInf.h"
-
-#define EFI_PAGE_BASE_OFFSET_IN_LDR 0x70000
-#define EFI_PAGE_BASE_ADDRESS (EFI_PAGE_BASE_OFFSET_IN_LDR + 0x20000)
-
-UINT32 gPageTableBaseAddress = EFI_PAGE_BASE_ADDRESS;
-UINT32 gPageTableOffsetInFile = EFI_PAGE_BASE_OFFSET_IN_LDR;
-
-#define EFI_MAX_ENTRY_NUM 512
-
-#define EFI_PML4_ENTRY_NUM 1
-#define EFI_PDPTE_ENTRY_NUM 4
-#define EFI_PDE_ENTRY_NUM EFI_MAX_ENTRY_NUM
-
-#define EFI_PML4_PAGE_NUM 1
-#define EFI_PDPTE_PAGE_NUM EFI_PML4_ENTRY_NUM
-#define EFI_PDE_PAGE_NUM (EFI_PML4_ENTRY_NUM * EFI_PDPTE_ENTRY_NUM)
-
-#define EFI_PAGE_NUMBER (EFI_PML4_PAGE_NUM + EFI_PDPTE_PAGE_NUM + EFI_PDE_PAGE_NUM)
-
-#define EFI_SIZE_OF_PAGE 0x1000
-#define EFI_PAGE_SIZE_2M 0x200000
-
-#define CONVERT_BIN_PAGE_ADDRESS(a) ((UINT8 *) a - PageTable + gPageTableBaseAddress)
-
-//
-// Utility Name
-//
-#define UTILITY_NAME "GenPage"
-
-//
-// Utility version information
-//
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-void
-Version (
- void
- )
-/*++
-
-Routine Description:
-
- Displays the standard utility information to SDTOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- printf ("%s Version %d.%d Build %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-VOID
-Usage (
- void
- )
-{
- printf ("Usage: GenPage.exe [options] EfiLoaderImageName \n\n\
-Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.\n\n\
- Utility to generate the EfiLoader image containing a page table.\n\n\
-optional arguments:\n\
- -h, --help Show this help message and exit\n\
- --version Show program's version number and exit\n\
- -d [DEBUG], --debug [DEBUG]\n\
- Output DEBUG statements, where DEBUG_LEVEL is 0 (min)\n\
- - 9 (max)\n\
- -v, --verbose Print informational statements\n\
- -q, --quiet Returns the exit code, error messages will be\n\
- displayed\n\
- -s, --silent Returns only the exit code; informational and error\n\
- messages are not displayed\n\
- -o OUTPUT_FILENAME, --output OUTPUT_FILENAME\n\
- Output file contain both the non-page table part and\n\
- the page table\n\
- -b BASE_ADDRESS, --baseaddr BASE_ADDRESS\n\
- The page table location\n\
- -f OFFSET, --offset OFFSET\n\
- The position that the page table will appear in the\n\
- output file\n\
- --sfo Reserved for future use\n");
-
-}
-
-void *
-CreateIdentityMappingPageTables (
- void
- )
-/*++
-
-Routine Description:
- To create 4G PAE 2M pagetable
-
-Return:
- void * - buffer containing created pagetable
-
---*/
-{
- UINT64 PageAddress;
- UINT8 *PageTable;
- UINT8 *PageTablePtr;
- int PML4Index;
- int PDPTEIndex;
- int PDEIndex;
- X64_PAGE_MAP_AND_DIRECTORY_POINTER_2MB_4K *PageMapLevel4Entry;
- X64_PAGE_MAP_AND_DIRECTORY_POINTER_2MB_4K *PageDirectoryPointerEntry;
- X64_PAGE_TABLE_ENTRY_2M *PageDirectoryEntry2MB;
-
- PageTable = (void *)malloc (EFI_PAGE_NUMBER * EFI_SIZE_OF_PAGE);
- memset (PageTable, 0, (EFI_PAGE_NUMBER * EFI_SIZE_OF_PAGE));
- PageTablePtr = PageTable;
-
- PageAddress = 0;
-
- //
- // Page Table structure 3 level 2MB.
- //
- // Page-Map-Level-4-Table : bits 47-39
- // Page-Directory-Pointer-Table : bits 38-30
- //
- // Page Table 2MB : Page-Directory(2M) : bits 29-21
- //
- //
-
- PageMapLevel4Entry = (X64_PAGE_MAP_AND_DIRECTORY_POINTER_2MB_4K *)PageTablePtr;
-
- for (PML4Index = 0; PML4Index < EFI_PML4_ENTRY_NUM; PML4Index++, PageMapLevel4Entry++) {
- //
- // Each Page-Map-Level-4-Table Entry points to the base address of a Page-Directory-Pointer-Table Entry
- //
- PageTablePtr += EFI_SIZE_OF_PAGE;
- PageDirectoryPointerEntry = (X64_PAGE_MAP_AND_DIRECTORY_POINTER_2MB_4K *)PageTablePtr;
-
- //
- // Make a Page-Map-Level-4-Table Entry
- //
- PageMapLevel4Entry->Uint64 = (UINT64)(UINT32)(CONVERT_BIN_PAGE_ADDRESS (PageDirectoryPointerEntry));
- PageMapLevel4Entry->Bits.ReadWrite = 1;
- PageMapLevel4Entry->Bits.Present = 1;
-
- for (PDPTEIndex = 0; PDPTEIndex < EFI_PDPTE_ENTRY_NUM; PDPTEIndex++, PageDirectoryPointerEntry++) {
- //
- // Each Page-Directory-Pointer-Table Entry points to the base address of a Page-Directory Entry
- //
- PageTablePtr += EFI_SIZE_OF_PAGE;
- PageDirectoryEntry2MB = (X64_PAGE_TABLE_ENTRY_2M *)PageTablePtr;
-
- //
- // Make a Page-Directory-Pointer-Table Entry
- //
- PageDirectoryPointerEntry->Uint64 = (UINT64)(UINT32)(CONVERT_BIN_PAGE_ADDRESS (PageDirectoryEntry2MB));
- PageDirectoryPointerEntry->Bits.ReadWrite = 1;
- PageDirectoryPointerEntry->Bits.Present = 1;
-
- for (PDEIndex = 0; PDEIndex < EFI_PDE_ENTRY_NUM; PDEIndex++, PageDirectoryEntry2MB++) {
- //
- // Make a Page-Directory Entry
- //
- PageDirectoryEntry2MB->Uint64 = (UINT64)PageAddress;
- PageDirectoryEntry2MB->Bits.ReadWrite = 1;
- PageDirectoryEntry2MB->Bits.Present = 1;
- PageDirectoryEntry2MB->Bits.MustBe1 = 1;
-
- PageAddress += EFI_PAGE_SIZE_2M;
- }
- }
- }
-
- return PageTable;
-}
-
-INT32
-GenBinPage (
- void *BaseMemory,
- char *NoPageFileName,
- char *PageFileName
- )
-/*++
-
-Routine Description:
- Write the buffer containing page table to file at a specified offset.
- Here the offset is defined as EFI_PAGE_BASE_OFFSET_IN_LDR.
-
-Arguments:
- BaseMemory - buffer containing page table
- NoPageFileName - file to write page table
- PageFileName - file save to after writing
-
-return:
- 0 : successful
- -1 : failed
-
---*/
-{
- FILE *PageFile;
- FILE *NoPageFile;
- UINT8 Data;
- unsigned long FileSize;
-
- //
- // Open files
- //
- PageFile = fopen (PageFileName, "w+b");
- if (PageFile == NULL) {
- Error (NoPageFileName, 0, 0x4002, "Invalid parameter option", "Output File %s open failure", PageFileName);
- return -1;
- }
-
- NoPageFile = fopen (NoPageFileName, "r+b");
- if (NoPageFile == NULL) {
- Error (NoPageFileName, 0, 0x4002, "Invalid parameter option", "Input File %s open failure", NoPageFileName);
- fclose (PageFile);
- return -1;
- }
-
- //
- // Check size - should not be great than EFI_PAGE_BASE_OFFSET_IN_LDR
- //
- fseek (NoPageFile, 0, SEEK_END);
- FileSize = ftell (NoPageFile);
- fseek (NoPageFile, 0, SEEK_SET);
- if (FileSize > gPageTableOffsetInFile) {
- Error (NoPageFileName, 0, 0x4002, "Invalid parameter option", "Input file size (0x%lx) exceeds the Page Table Offset (0x%x)", FileSize, (unsigned) gPageTableOffsetInFile);
- fclose (PageFile);
- fclose (NoPageFile);
- return -1;
- }
-
- //
- // Write data
- //
- while (fread (&Data, sizeof(UINT8), 1, NoPageFile)) {
- fwrite (&Data, sizeof(UINT8), 1, PageFile);
- }
-
- //
- // Write PageTable
- //
- fseek (PageFile, gPageTableOffsetInFile, SEEK_SET);
- fwrite (BaseMemory, (EFI_PAGE_NUMBER * EFI_SIZE_OF_PAGE), 1, PageFile);
-
- //
- // Close files
- //
- fclose (PageFile);
- fclose (NoPageFile);
-
- return 0;
-}
-
-int
-main (
- int argc,
- char **argv
- )
-{
- VOID *BaseMemory;
- INTN result;
- CHAR8 *OutputFile = NULL;
- CHAR8 *InputFile = NULL;
- EFI_STATUS Status;
- UINT64 TempValue;
-
- SetUtilityName("GenPage");
-
- if (argc == 1) {
- Usage();
- return STATUS_ERROR;
- }
-
- argc --;
- argv ++;
-
- if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
- Usage();
- return 0;
- }
-
- if (stricmp (argv[0], "--version") == 0) {
- Version();
- return 0;
- }
-
- while (argc > 0) {
- if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--output") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Output file is missing for -o option");
- return STATUS_ERROR;
- }
- OutputFile = argv[1];
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-b") == 0) || (stricmp (argv[0], "--baseaddr") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Base address is missing for -b option");
- return STATUS_ERROR;
- }
- Status = AsciiStringToUint64 (argv[1], FALSE, &TempValue);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "Base address is not valid intergrator");
- return STATUS_ERROR;
- }
- gPageTableBaseAddress = (UINT32) TempValue;
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-f") == 0) || (stricmp (argv[0], "--offset") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Offset is missing for -f option");
- return STATUS_ERROR;
- }
- Status = AsciiStringToUint64 (argv[1], FALSE, &TempValue);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "Offset is not valid intergrator");
- return STATUS_ERROR;
- }
- gPageTableOffsetInFile = (UINT32) TempValue;
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-v") ==0) || (stricmp (argv[0], "--verbose") == 0)) {
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--debug") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level is not specified.");
- return STATUS_ERROR;
- }
- Status = AsciiStringToUint64 (argv[1], FALSE, &TempValue);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level is not valid intergrator.");
- return STATUS_ERROR;
- }
- if (TempValue > 9) {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, currnt input level is %d", (int) TempValue);
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if (argv[0][0] == '-') {
- Error (NULL, 0, 1000, "Unknown option", argv[0]);
- return STATUS_ERROR;
- }
-
- //
- // Don't recognize the paramter.
- //
- InputFile = argv[0];
- argc--;
- argv++;
- }
-
- if (InputFile == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Input file is not specified");
- return STATUS_ERROR;
- }
-
- //
- // Create X64 page table
- //
- BaseMemory = CreateIdentityMappingPageTables ();
-
- //
- // Add page table to binary file
- //
- result = GenBinPage (BaseMemory, InputFile, OutputFile);
- if (result < 0) {
- return STATUS_ERROR;
- }
-
- return 0;
-}
-
diff --git a/BaseTools/Source/C/GenPage/Makefile b/BaseTools/Source/C/GenPage/Makefile
deleted file mode 100644
index bc0369aadd..0000000000
--- a/BaseTools/Source/C/GenPage/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'GenPage' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = GenPage
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = GenPage.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/GenPage/VirtualMemory.h b/BaseTools/Source/C/GenPage/VirtualMemory.h
deleted file mode 100644
index 3cfebd6c69..0000000000
--- a/BaseTools/Source/C/GenPage/VirtualMemory.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
- VirtualMemory.h
-
-Abstract:
-
- x64 Long Mode Virtual Memory Management Definitions
-
- References:
- 1) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 1:Basic Architecture, Intel
- 2) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 2:Instruction Set Reference, Intel
- 3) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 3:System Programmer's Guide, Intel
- 4) AMD64 Architecture Programmer's Manual Volume 2: System Programming
-**/
-
-#ifndef _VIRTUAL_MEMORY_H_
-#define _VIRTUAL_MEMORY_H_
-
-#include "CommonLib.h"
-
-#pragma pack(1)
-
-//
-// Page-Map Level-4 Offset (PML4) and
-// Page-Directory-Pointer Offset (PDPE) entries 4K & 2MB
-//
-
-typedef union {
- struct {
- UINT64 Present:1; // 0 = Not present in memory, 1 = Present in memory
- UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write
- UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User
- UINT64 WriteThrough:1; // 0 = Write-Back caching, 1=Write-Through caching
- UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached
- UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)
- UINT64 Reserved:1; // Reserved
- UINT64 MustBeZero:2; // Must Be Zero
- UINT64 Available:3; // Available for use by system software
- UINT64 PageTableBaseAddress:40; // Page Table Base Address
- UINT64 AvabilableHigh:11; // Available for use by system software
- UINT64 Nx:1; // No Execute bit
- } Bits;
- UINT64 Uint64;
-} X64_PAGE_MAP_AND_DIRECTORY_POINTER_2MB_4K;
-
-//
-// Page-Directory Offset 4K
-//
-typedef union {
- struct {
- UINT64 Present:1; // 0 = Not present in memory, 1 = Present in memory
- UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write
- UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User
- UINT64 WriteThrough:1; // 0 = Write-Back caching, 1=Write-Through caching
- UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached
- UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)
- UINT64 Reserved:1; // Reserved
- UINT64 MustBeZero:1; // Must Be Zero
- UINT64 Reserved2:1; // Reserved
- UINT64 Available:3; // Available for use by system software
- UINT64 PageTableBaseAddress:40; // Page Table Base Address
- UINT64 AvabilableHigh:11; // Available for use by system software
- UINT64 Nx:1; // No Execute bit
- } Bits;
- UINT64 Uint64;
-} X64_PAGE_DIRECTORY_ENTRY_4K;
-
-//
-// Page Table Entry 4K
-//
-typedef union {
- struct {
- UINT64 Present:1; // 0 = Not present in memory, 1 = Present in memory
- UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write
- UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User
- UINT64 WriteThrough:1; // 0 = Write-Back caching, 1=Write-Through caching
- UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached
- UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)
- UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page
- UINT64 PAT:1; // 0 = Ignore Page Attribute Table
- UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write
- UINT64 Available:3; // Available for use by system software
- UINT64 PageTableBaseAddress:40; // Page Table Base Address
- UINT64 AvabilableHigh:11; // Available for use by system software
- UINT64 Nx:1; // 0 = Execute Code, 1 = No Code Execution
- } Bits;
- UINT64 Uint64;
-} X64_PAGE_TABLE_ENTRY_4K;
-
-
-//
-// Page Table Entry 2MB
-//
-typedef union {
- struct {
- UINT64 Present:1; // 0 = Not present in memory, 1 = Present in memory
- UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write
- UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User
- UINT64 WriteThrough:1; // 0 = Write-Back caching, 1=Write-Through caching
- UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached
- UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU)
- UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page
- UINT64 MustBe1:1; // Must be 1
- UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write
- UINT64 Available:3; // Available for use by system software
- UINT64 PAT:1; //
- UINT64 MustBeZero:8; // Must be zero;
- UINT64 PageTableBaseAddress:31; // Page Table Base Address
- UINT64 AvabilableHigh:11; // Available for use by system software
- UINT64 Nx:1; // 0 = Execute Code, 1 = No Code Execution
- } Bits;
- UINT64 Uint64;
-} X64_PAGE_TABLE_ENTRY_2M;
-
-#pragma pack()
-
-#endif
diff --git a/BaseTools/Source/C/GenSec/GNUmakefile b/BaseTools/Source/C/GenSec/GNUmakefile
deleted file mode 100644
index c2d289cd20..0000000000
--- a/BaseTools/Source/C/GenSec/GNUmakefile
+++ /dev/null
@@ -1,30 +0,0 @@
-## @file
-# GNU/Linux makefile for 'GenSec' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = GenSec
-
-OBJECTS = GenSec.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
-
-LIBS = -lCommon
-ifeq ($(CYGWIN), CYGWIN)
- LIBS += -L/lib/e2fsprogs -luuid
-endif
-
-ifeq ($(LINUX), Linux)
- LIBS += -luuid
-endif
-
diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
deleted file mode 100644
index d6b22aee86..0000000000
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ /dev/null
@@ -1,1500 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- GenSection.c
-
-Abstract:
-
- Creates output file that is a properly formed section per the PI spec.
-
-**/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <Common/UefiBaseTypes.h>
-#include <Common/PiFirmwareFile.h>
-#include <Protocol/GuidedSectionExtraction.h>
-#include <IndustryStandard/PeImage.h>
-
-#include "CommonLib.h"
-#include "Compress.h"
-#include "Crc32.h"
-#include "EfiUtilityMsgs.h"
-#include "ParseInf.h"
-
-//
-// GenSec Tool Information
-//
-#define UTILITY_NAME "GenSec"
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-#define MAX_SECTION_SIZE 0x1000000
-
-STATIC CHAR8 *mSectionTypeName[] = {
- NULL, // 0x00 - reserved
- "EFI_SECTION_COMPRESSION", // 0x01
- "EFI_SECTION_GUID_DEFINED", // 0x02
- NULL, // 0x03 - reserved
- NULL, // 0x04 - reserved
- NULL, // 0x05 - reserved
- NULL, // 0x06 - reserved
- NULL, // 0x07 - reserved
- NULL, // 0x08 - reserved
- NULL, // 0x09 - reserved
- NULL, // 0x0A - reserved
- NULL, // 0x0B - reserved
- NULL, // 0x0C - reserved
- NULL, // 0x0D - reserved
- NULL, // 0x0E - reserved
- NULL, // 0x0F - reserved
- "EFI_SECTION_PE32", // 0x10
- "EFI_SECTION_PIC", // 0x11
- "EFI_SECTION_TE", // 0x12
- "EFI_SECTION_DXE_DEPEX", // 0x13
- "EFI_SECTION_VERSION", // 0x14
- "EFI_SECTION_USER_INTERFACE", // 0x15
- "EFI_SECTION_COMPATIBILITY16", // 0x16
- "EFI_SECTION_FIRMWARE_VOLUME_IMAGE", // 0x17
- "EFI_SECTION_FREEFORM_SUBTYPE_GUID", // 0x18
- "EFI_SECTION_RAW", // 0x19
- NULL, // 0x1A
- "EFI_SECTION_PEI_DEPEX", // 0x1B
- "EFI_SECTION_SMM_DEPEX" // 0x1C
-};
-
-STATIC CHAR8 *mCompressionTypeName[] = { "PI_NONE", "PI_STD" };
-
-#define EFI_GUIDED_SECTION_NONE 0x80
-STATIC CHAR8 *mGUIDedSectionAttribue[] = { "NONE", "PROCESSING_REQUIRED", "AUTH_STATUS_VALID"};
-
-STATIC CHAR8 *mAlignName[] = {
- "1", "2", "4", "8", "16", "32", "64", "128", "256", "512",
- "1K", "2K", "4K", "8K", "16K", "32K", "64K"
-};
-
-//
-// Crc32 GUID section related definitions.
-//
-typedef struct {
- EFI_GUID_DEFINED_SECTION GuidSectionHeader;
- UINT32 CRC32Checksum;
-} CRC32_SECTION_HEADER;
-
-STATIC EFI_GUID mZeroGuid = {0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
-STATIC EFI_GUID mEfiCrc32SectionGuid = EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;
-
-STATIC
-VOID
-Version (
- VOID
- )
-/*++
-
-Routine Description:
-
- Print out version information for this utility.
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-STATIC
-VOID
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- Print Help message.
-
-Arguments:
-
- VOID
-
-Returns:
-
- None
-
---*/
-{
- //
- // Summary usage
- //
- fprintf (stdout, "\nUsage: %s [options] [input_file]\n\n", UTILITY_NAME);
-
- //
- // Copyright declaration
- //
- fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
-
- //
- // Details Option
- //
- fprintf (stdout, "Options:\n");
- fprintf (stdout, " -o FileName, --outputfile FileName\n\
- File is the SectionFile to be created.\n");
- fprintf (stdout, " -s [SectionType], --sectiontype [SectionType]\n\
- SectionType defined in PI spec is one type of\n\
- EFI_SECTION_COMPRESSION, EFI_SECTION_GUID_DEFINED,\n\
- EFI_SECTION_PE32, EFI_SECTION_PIC, EFI_SECTION_TE,\n\
- EFI_SECTION_DXE_DEPEX, EFI_SECTION_COMPATIBILITY16,\n\
- EFI_SECTION_USER_INTERFACE, EFI_SECTION_VERSION,\n\
- EFI_SECTION_FIRMWARE_VOLUME_IMAGE, EFI_SECTION_RAW,\n\
- EFI_SECTION_FREEFORM_SUBTYPE_GUID,\n\
- EFI_SECTION_PEI_DEPEX, EFI_SECTION_SMM_DEPEX.\n\
- if -s option is not given, \n\
- EFI_SECTION_ALL is default section type.\n");
- fprintf (stdout, " -c [Type], --compress [Type]\n\
- Compress method type can be PI_NONE or PI_STD.\n\
- if -c option is not given, PI_STD is default type.\n");
- fprintf (stdout, " -g GuidValue, --vendor GuidValue\n\
- GuidValue is one specific vendor guid value.\n\
- Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n");
- fprintf (stdout, " -l GuidHeaderLength, --HeaderLength GuidHeaderLength\n\
- GuidHeaderLength is the size of header of guided data\n");
- fprintf (stdout, " -r GuidAttr, --attributes GuidAttr\n\
- GuidAttr is guid section atttributes, which may be\n\
- PROCESSING_REQUIRED, AUTH_STATUS_VALID and NONE. \n\
- if -r option is not given, default PROCESSING_REQUIRED\n");
- fprintf (stdout, " -n String, --name String\n\
- String is a NULL terminated string used in Ui section.\n");
- fprintf (stdout, " -j Number, --buildnumber Number\n\
- Number is an integer value between 0000 and 9999\n\
- used in Ver section.\n");
- fprintf (stdout, " --sectionalign SectionAlign\n\
- SectionAlign points to section alignment, which support\n\
- the alignment scope 1~64K. It is specified in same\n\
- order that the section file is input.\n");
- fprintf (stdout, " -v, --verbose Turn on verbose output with informational messages.\n");
- fprintf (stdout, " -q, --quiet Disable all messages except key message and fatal error\n");
- fprintf (stdout, " -d, --debug level Enable debug messages, at input debug level.\n");
- fprintf (stdout, " --version Show program's version number and exit.\n");
- fprintf (stdout, " -h, --help Show this help message and exit.\n");
-}
-
-VOID
-Ascii2UnicodeString (
- CHAR8 *String,
- CHAR16 *UniString
- )
-/*++
-
-Routine Description:
-
- Write ascii string as unicode string format to FILE
-
-Arguments:
-
- String - Pointer to string that is written to FILE.
- UniString - Pointer to unicode string
-
-Returns:
-
- NULL
-
---*/
-{
- while (*String != '\0') {
- *(UniString++) = (CHAR16) *(String++);
- }
- //
- // End the UniString with a NULL.
- //
- *UniString = '\0';
-}
-
-STATUS
-GenSectionCommonLeafSection (
- CHAR8 **InputFileName,
- UINT32 InputFileNum,
- UINT8 SectionType,
- UINT8 **OutFileBuffer
- )
-/*++
-
-Routine Description:
-
- Generate a leaf section of type other than EFI_SECTION_VERSION
- and EFI_SECTION_USER_INTERFACE. Input file must be well formed.
- The function won't validate the input file's contents. For
- common leaf sections, the input file may be a binary file.
- The utility will add section header to the file.
-
-Arguments:
-
- InputFileName - Name of the input file.
-
- InputFileNum - Number of input files. Should be 1 for leaf section.
-
- SectionType - A valid section type string
-
- OutFileBuffer - Buffer pointer to Output file contents
-
-Returns:
-
- STATUS_ERROR - can't continue
- STATUS_SUCCESS - successful return
-
---*/
-{
- UINT32 InputFileLength;
- FILE *InFile;
- UINT8 *Buffer;
- UINT32 TotalLength;
- EFI_COMMON_SECTION_HEADER *CommonSect;
- STATUS Status;
-
- if (InputFileNum > 1) {
- Error (NULL, 0, 2000, "Invalid paramter", "more than one input file specified");
- return STATUS_ERROR;
- } else if (InputFileNum < 1) {
- Error (NULL, 0, 2000, "Invalid paramter", "no input file specified");
- return STATUS_ERROR;
- }
- //
- // Open the input file
- //
- InFile = fopen (InputFileName[0], "rb");
- if (InFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", InputFileName[0]);
- return STATUS_ERROR;
- }
-
- Status = STATUS_ERROR;
- Buffer = NULL;
- //
- // Seek to the end of the input file so we can determine its size
- //
- fseek (InFile, 0, SEEK_END);
- InputFileLength = ftell (InFile);
- fseek (InFile, 0, SEEK_SET);
- DebugMsg (NULL, 0, 9, "Input file", "File name is %s and File size is %u bytes", InputFileName[0], (unsigned) InputFileLength);
- TotalLength = sizeof (EFI_COMMON_SECTION_HEADER) + InputFileLength;
- //
- // Size must fit in 3 bytes
- //
- if (TotalLength >= MAX_SECTION_SIZE) {
- Error (NULL, 0, 2000, "Invalid paramter", "%s file size (0x%X) exceeds section size limit(%uM).", InputFileName[0], (unsigned) TotalLength, MAX_SECTION_SIZE>>20);
- goto Done;
- }
- VerboseMsg ("the size of the created section file is %u bytes", (unsigned) TotalLength);
- //
- // Fill in the fields in the local section header structure
- //
- Buffer = (UINT8 *) malloc ((size_t) TotalLength);
- if (Buffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");
- goto Done;
- }
- CommonSect = (EFI_COMMON_SECTION_HEADER *) Buffer;
- CommonSect->Type = SectionType;
- CommonSect->Size[0] = (UINT8) (TotalLength & 0xff);
- CommonSect->Size[1] = (UINT8) ((TotalLength & 0xff00) >> 8);
- CommonSect->Size[2] = (UINT8) ((TotalLength & 0xff0000) >> 16);
-
- //
- // read data from the input file.
- //
- if (InputFileLength != 0) {
- if (fread (Buffer + sizeof (EFI_COMMON_SECTION_HEADER), (size_t) InputFileLength, 1, InFile) != 1) {
- Error (NULL, 0, 0004, "Error reading file", InputFileName[0]);
- goto Done;
- }
- }
-
- //
- // Set OutFileBuffer
- //
- *OutFileBuffer = Buffer;
- Status = STATUS_SUCCESS;
-
-Done:
- fclose (InFile);
-
- return Status;
-}
-
-STATIC
-EFI_STATUS
-StringtoAlignment (
- IN CHAR8 *AlignBuffer,
- OUT UINT32 *AlignNumber
- )
-/*++
-
-Routine Description:
-
- Converts Align String to align value (1~64K).
-
-Arguments:
-
- AlignBuffer - Pointer to Align string.
- AlignNumber - Pointer to Align value.
-
-Returns:
-
- EFI_SUCCESS Successfully convert align string to align value.
- EFI_INVALID_PARAMETER Align string is invalid or align value is not in scope.
-
---*/
-{
- UINT32 Index = 0;
- //
- // Check AlignBuffer
- //
- if (AlignBuffer == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- for (Index = 0; Index < sizeof (mAlignName) / sizeof (CHAR8 *); Index ++) {
- if (stricmp (AlignBuffer, mAlignName [Index]) == 0) {
- *AlignNumber = 1 << Index;
- return EFI_SUCCESS;
- }
- }
- return EFI_INVALID_PARAMETER;
-}
-
-EFI_STATUS
-GetSectionContents (
- CHAR8 **InputFileName,
- UINT32 *InputFileAlign,
- UINT32 InputFileNum,
- UINT8 *FileBuffer,
- UINT32 *BufferLength
- )
-/*++
-
-Routine Description:
-
- Get the contents of all section files specified in InputFileName
- into FileBuffer.
-
-Arguments:
-
- InputFileName - Name of the input file.
-
- InputFileAlign - Alignment required by the input file data.
-
- InputFileNum - Number of input files. Should be at least 1.
-
- FileBuffer - Output buffer to contain data
-
- BufferLength - On input, this is size of the FileBuffer.
- On output, this is the actual length of the data.
-
-Returns:
-
- EFI_SUCCESS on successful return
- EFI_INVALID_PARAMETER if InputFileNum is less than 1 or BufferLength point is NULL.
- EFI_ABORTED if unable to open input file.
- EFI_BUFFER_TOO_SMALL FileBuffer is not enough to contain all file data.
---*/
-{
- UINT32 Size;
- UINT32 Offset;
- UINT32 FileSize;
- UINT32 Index;
- FILE *InFile;
- EFI_COMMON_SECTION_HEADER *SectHeader;
- EFI_COMMON_SECTION_HEADER TempSectHeader;
- EFI_TE_IMAGE_HEADER TeHeader;
- UINT32 TeOffset;
- EFI_GUID_DEFINED_SECTION GuidSectHeader;
- UINT32 HeaderSize;
-
- if (InputFileNum < 1) {
- Error (NULL, 0, 2000, "Invalid paramter", "must specify at least one input file");
- return EFI_INVALID_PARAMETER;
- }
-
- if (BufferLength == NULL) {
- Error (NULL, 0, 2000, "Invalid paramter", "BufferLength can't be NULL");
- return EFI_INVALID_PARAMETER;
- }
-
- Size = 0;
- Offset = 0;
- TeOffset = 0;
- //
- // Go through our array of file names and copy their contents
- // to the output buffer.
- //
- for (Index = 0; Index < InputFileNum; Index++) {
- //
- // make sure section ends on a DWORD boundary
- //
- while ((Size & 0x03) != 0) {
- if (FileBuffer != NULL && Size < *BufferLength) {
- FileBuffer[Size] = 0;
- }
- Size++;
- }
-
- //
- // Open file and read contents
- //
- InFile = fopen (InputFileName[Index], "rb");
- if (InFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file", InputFileName[Index]);
- return EFI_ABORTED;
- }
-
- fseek (InFile, 0, SEEK_END);
- FileSize = ftell (InFile);
- fseek (InFile, 0, SEEK_SET);
- DebugMsg (NULL, 0, 9, "Input files", "the input file name is %s and the size is %u bytes", InputFileName[Index], (unsigned) FileSize);
- //
- // Adjust section buffer when section alignment is required.
- //
- if (InputFileAlign != NULL) {
- //
- // Check this section is Te/Pe section, and Calculate the numbers of Te/Pe section.
- //
- TeOffset = 0;
- HeaderSize = sizeof (EFI_COMMON_SECTION_HEADER);
- fread (&TempSectHeader, 1, sizeof (TempSectHeader), InFile);
- if (TempSectHeader.Type == EFI_SECTION_TE) {
- fread (&TeHeader, 1, sizeof (TeHeader), InFile);
- if (TeHeader.Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- TeOffset = TeHeader.StrippedSize - sizeof (TeHeader);
- }
- } else if (TempSectHeader.Type == EFI_SECTION_GUID_DEFINED) {
- fseek (InFile, 0, SEEK_SET);
- fread (&GuidSectHeader, 1, sizeof (GuidSectHeader), InFile);
- if ((GuidSectHeader.Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) == 0) {
- HeaderSize = GuidSectHeader.DataOffset;
- }
- }
-
- fseek (InFile, 0, SEEK_SET);
-
- //
- // Revert TeOffset to the converse value relative to Alignment
- // This is to assure the original PeImage Header at Alignment.
- //
- if (TeOffset != 0) {
- TeOffset = InputFileAlign [Index] - (TeOffset % InputFileAlign [Index]);
- TeOffset = TeOffset % InputFileAlign [Index];
- }
-
- //
- // make sure section data meet its alignment requirement by adding one raw pad section.
- //
- if ((InputFileAlign [Index] != 0) && (((Size + HeaderSize + TeOffset) % InputFileAlign [Index]) != 0)) {
- Offset = (Size + sizeof (EFI_COMMON_SECTION_HEADER) + HeaderSize + TeOffset + InputFileAlign [Index] - 1) & ~(InputFileAlign [Index] - 1);
- Offset = Offset - Size - HeaderSize - TeOffset;
-
- if (FileBuffer != NULL && ((Size + Offset) < *BufferLength)) {
- memset (FileBuffer + Size, 0, Offset);
- SectHeader = (EFI_COMMON_SECTION_HEADER *) (FileBuffer + Size);
- SectHeader->Type = EFI_SECTION_RAW;
- SectHeader->Size[0] = (UINT8) (Offset & 0xff);
- SectHeader->Size[1] = (UINT8) ((Offset & 0xff00) >> 8);
- SectHeader->Size[2] = (UINT8) ((Offset & 0xff0000) >> 16);
- }
- DebugMsg (NULL, 0, 9, "Pad raw section for section data alignment", "Pad Raw section size is %u", (unsigned) Offset);
-
- Size = Size + Offset;
- }
- }
-
- //
- // Now read the contents of the file into the buffer
- // Buffer must be enough to contain the file content.
- //
- if ((FileSize > 0) && (FileBuffer != NULL) && ((Size + FileSize) <= *BufferLength)) {
- if (fread (FileBuffer + Size, (size_t) FileSize, 1, InFile) != 1) {
- Error (NULL, 0, 0004, "Error reading file", InputFileName[Index]);
- fclose (InFile);
- return EFI_ABORTED;
- }
- }
-
- fclose (InFile);
- Size += FileSize;
- }
-
- //
- // Set the real required buffer size.
- //
- if (Size > *BufferLength) {
- *BufferLength = Size;
- return EFI_BUFFER_TOO_SMALL;
- } else {
- *BufferLength = Size;
- return EFI_SUCCESS;
- }
-}
-
-EFI_STATUS
-GenSectionCompressionSection (
- CHAR8 **InputFileName,
- UINT32 *InputFileAlign,
- UINT32 InputFileNum,
- UINT8 SectCompSubType,
- UINT8 **OutFileBuffer
- )
-/*++
-
-Routine Description:
-
- Generate an encapsulating section of type EFI_SECTION_COMPRESSION
- Input file must be already sectioned. The function won't validate
- the input files' contents. Caller should hand in files already
- with section header.
-
-Arguments:
-
- InputFileName - Name of the input file.
-
- InputFileAlign - Alignment required by the input file data.
-
- InputFileNum - Number of input files. Should be at least 1.
-
- SectCompSubType - Specify the compression algorithm requested.
-
- OutFileBuffer - Buffer pointer to Output file contents
-
-Returns:
-
- EFI_SUCCESS on successful return
- EFI_INVALID_PARAMETER if InputFileNum is less than 1
- EFI_ABORTED if unable to open input file.
- EFI_OUT_OF_RESOURCES No resource to complete the operation.
---*/
-{
- UINT32 TotalLength;
- UINT32 InputLength;
- UINT32 CompressedLength;
- UINT8 *FileBuffer;
- UINT8 *OutputBuffer;
- EFI_STATUS Status;
- EFI_COMPRESSION_SECTION *CompressionSect;
- COMPRESS_FUNCTION CompressFunction;
-
- InputLength = 0;
- FileBuffer = NULL;
- OutputBuffer = NULL;
- CompressedLength = 0;
- //
- // read all input file contents into a buffer
- // first get the size of all file contents
- //
- Status = GetSectionContents (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- FileBuffer,
- &InputLength
- );
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- FileBuffer = (UINT8 *) malloc (InputLength);
- if (FileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // read all input file contents into a buffer
- //
- Status = GetSectionContents (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- FileBuffer,
- &InputLength
- );
- }
-
- if (EFI_ERROR (Status)) {
- if (FileBuffer != NULL) {
- free (FileBuffer);
- }
- return Status;
- }
-
- CompressFunction = NULL;
-
- //
- // Now data is in FileBuffer, compress the data
- //
- switch (SectCompSubType) {
- case EFI_NOT_COMPRESSED:
- CompressedLength = InputLength;
- //
- // Copy file buffer to the none compressed data.
- //
- OutputBuffer = malloc (CompressedLength + sizeof (EFI_COMPRESSION_SECTION));
- if (OutputBuffer == NULL) {
- free (FileBuffer);
- return EFI_OUT_OF_RESOURCES;
- }
- memcpy (OutputBuffer + sizeof (EFI_COMPRESSION_SECTION), FileBuffer, CompressedLength);
- FileBuffer = OutputBuffer;
- break;
-
- case EFI_STANDARD_COMPRESSION:
- CompressFunction = (COMPRESS_FUNCTION) EfiCompress;
- break;
-
- default:
- Error (NULL, 0, 2000, "Invalid paramter", "unknown compression type");
- free (FileBuffer);
- return EFI_ABORTED;
- }
-
- if (CompressFunction != NULL) {
-
- Status = CompressFunction (FileBuffer, InputLength, OutputBuffer, &CompressedLength);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- OutputBuffer = malloc (CompressedLength + sizeof (EFI_COMPRESSION_SECTION));
- if (!OutputBuffer) {
- free (FileBuffer);
- return EFI_OUT_OF_RESOURCES;
- }
-
- Status = CompressFunction (FileBuffer, InputLength, OutputBuffer + sizeof (EFI_COMPRESSION_SECTION), &CompressedLength);
- }
-
- free (FileBuffer);
- FileBuffer = OutputBuffer;
-
- if (EFI_ERROR (Status)) {
- if (FileBuffer != NULL) {
- free (FileBuffer);
- }
-
- return Status;
- }
- }
-
- DebugMsg (NULL, 0, 9, "comprss file size",
- "the original section size is %d bytes and the compressed section size is %u bytes", (unsigned) InputLength, (unsigned) CompressedLength);
- TotalLength = CompressedLength + sizeof (EFI_COMPRESSION_SECTION);
- if (TotalLength >= MAX_SECTION_SIZE) {
- Error (NULL, 0, 2000, "Invalid paramter", "The size of all files exceeds section size limit(%uM).", MAX_SECTION_SIZE>>20);
- if (FileBuffer != NULL) {
- free (FileBuffer);
- }
- if (OutputBuffer != NULL) {
- free (OutputBuffer);
- }
- return STATUS_ERROR;
- }
- VerboseMsg ("the size of the created section file is %u bytes", (unsigned) TotalLength);
-
- //
- // Add the section header for the compressed data
- //
- CompressionSect = (EFI_COMPRESSION_SECTION *) FileBuffer;
-
- CompressionSect->CommonHeader.Type = EFI_SECTION_COMPRESSION;
- CompressionSect->CommonHeader.Size[0] = (UINT8) (TotalLength & 0xff);
- CompressionSect->CommonHeader.Size[1] = (UINT8) ((TotalLength & 0xff00) >> 8);
- CompressionSect->CommonHeader.Size[2] = (UINT8) ((TotalLength & 0xff0000) >> 16);
- CompressionSect->CompressionType = SectCompSubType;
- CompressionSect->UncompressedLength = InputLength;
-
- //
- // Set OutFileBuffer
- //
- *OutFileBuffer = FileBuffer;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GenSectionGuidDefinedSection (
- CHAR8 **InputFileName,
- UINT32 *InputFileAlign,
- UINT32 InputFileNum,
- EFI_GUID *VendorGuid,
- UINT16 DataAttribute,
- UINT32 DataHeaderSize,
- UINT8 **OutFileBuffer
- )
-/*++
-
-Routine Description:
-
- Generate an encapsulating section of type EFI_SECTION_GUID_DEFINED
- Input file must be already sectioned. The function won't validate
- the input files' contents. Caller should hand in files already
- with section header.
-
-Arguments:
-
- InputFileName - Name of the input file.
-
- InputFileAlign - Alignment required by the input file data.
-
- InputFileNum - Number of input files. Should be at least 1.
-
- VendorGuid - Specify vendor guid value.
-
- DataAttribute - Specify attribute for the vendor guid data.
-
- DataHeaderSize- Guided Data Header Size
-
- OutFileBuffer - Buffer pointer to Output file contents
-
-Returns:
-
- EFI_SUCCESS on successful return
- EFI_INVALID_PARAMETER if InputFileNum is less than 1
- EFI_ABORTED if unable to open input file.
- EFI_OUT_OF_RESOURCES No resource to complete the operation.
-
---*/
-{
- UINT32 TotalLength;
- UINT32 InputLength;
- UINT32 Offset;
- UINT8 *FileBuffer;
- UINT32 Crc32Checksum;
- EFI_STATUS Status;
- CRC32_SECTION_HEADER *Crc32GuidSect;
- EFI_GUID_DEFINED_SECTION *VendorGuidSect;
-
- InputLength = 0;
- Offset = 0;
- FileBuffer = NULL;
-
- if (CompareGuid (VendorGuid, &mZeroGuid) == 0) {
- Offset = sizeof (CRC32_SECTION_HEADER);
- } else {
- Offset = sizeof (EFI_GUID_DEFINED_SECTION);
- }
-
- //
- // read all input file contents into a buffer
- // first get the size of all file contents
- //
- Status = GetSectionContents (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- FileBuffer,
- &InputLength
- );
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- FileBuffer = (UINT8 *) malloc (InputLength + Offset);
- if (FileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // read all input file contents into a buffer
- //
- Status = GetSectionContents (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- FileBuffer + Offset,
- &InputLength
- );
- }
-
- if (EFI_ERROR (Status)) {
- if (FileBuffer != NULL) {
- free (FileBuffer);
- }
- Error (NULL, 0, 0001, "Error opening file for reading", InputFileName[0]);
- return Status;
- }
-
- if (InputLength == 0) {
- Error (NULL, 0, 2000, "Invalid parameter", "the size of input file %s can't be zero", InputFileName);
- return EFI_NOT_FOUND;
- }
-
- //
- // Now data is in FileBuffer + Offset
- //
- if (CompareGuid (VendorGuid, &mZeroGuid) == 0) {
- //
- // Default Guid section is CRC32.
- //
- Crc32Checksum = 0;
- CalculateCrc32 (FileBuffer + Offset, InputLength, &Crc32Checksum);
-
- TotalLength = InputLength + sizeof (CRC32_SECTION_HEADER);
- if (TotalLength >= MAX_SECTION_SIZE) {
- Error (NULL, 0, 2000, "Invalid paramter", "The size of all files exceeds section size limit(%uM).", MAX_SECTION_SIZE>>20);
- free (FileBuffer);
- return STATUS_ERROR;
- }
-
- Crc32GuidSect = (CRC32_SECTION_HEADER *) FileBuffer;
- Crc32GuidSect->GuidSectionHeader.CommonHeader.Type = EFI_SECTION_GUID_DEFINED;
- Crc32GuidSect->GuidSectionHeader.CommonHeader.Size[0] = (UINT8) (TotalLength & 0xff);
- Crc32GuidSect->GuidSectionHeader.CommonHeader.Size[1] = (UINT8) ((TotalLength & 0xff00) >> 8);
- Crc32GuidSect->GuidSectionHeader.CommonHeader.Size[2] = (UINT8) ((TotalLength & 0xff0000) >> 16);
- memcpy (&(Crc32GuidSect->GuidSectionHeader.SectionDefinitionGuid), &mEfiCrc32SectionGuid, sizeof (EFI_GUID));
- Crc32GuidSect->GuidSectionHeader.Attributes = EFI_GUIDED_SECTION_AUTH_STATUS_VALID;
- Crc32GuidSect->GuidSectionHeader.DataOffset = sizeof (CRC32_SECTION_HEADER);
- Crc32GuidSect->CRC32Checksum = Crc32Checksum;
- DebugMsg (NULL, 0, 9, "Guided section", "Data offset is %u", Crc32GuidSect->GuidSectionHeader.DataOffset);
-
- } else {
- TotalLength = InputLength + sizeof (EFI_GUID_DEFINED_SECTION);
- if (TotalLength >= MAX_SECTION_SIZE) {
- Error (NULL, 0, 2000, "Invalid paramter", "The size of all files exceeds section size limit(%uM).", MAX_SECTION_SIZE>>20);
- free (FileBuffer);
- return STATUS_ERROR;
- }
-
- VendorGuidSect = (EFI_GUID_DEFINED_SECTION *) FileBuffer;
- VendorGuidSect->CommonHeader.Type = EFI_SECTION_GUID_DEFINED;
- VendorGuidSect->CommonHeader.Size[0] = (UINT8) (TotalLength & 0xff);
- VendorGuidSect->CommonHeader.Size[1] = (UINT8) ((TotalLength & 0xff00) >> 8);
- VendorGuidSect->CommonHeader.Size[2] = (UINT8) ((TotalLength & 0xff0000) >> 16);
- memcpy (&(VendorGuidSect->SectionDefinitionGuid), VendorGuid, sizeof (EFI_GUID));
- VendorGuidSect->Attributes = DataAttribute;
- VendorGuidSect->DataOffset = (UINT16) (sizeof (EFI_GUID_DEFINED_SECTION) + DataHeaderSize);
- DebugMsg (NULL, 0, 9, "Guided section", "Data offset is %u", VendorGuidSect->DataOffset);
- }
- VerboseMsg ("the size of the created section file is %u bytes", (unsigned) TotalLength);
-
- //
- // Set OutFileBuffer
- //
- *OutFileBuffer = FileBuffer;
-
- return EFI_SUCCESS;
-}
-
-int
-main (
- int argc,
- char *argv[]
- )
-/*++
-
-Routine Description:
-
- Main
-
-Arguments:
-
- command line parameters
-
-Returns:
-
- EFI_SUCCESS Section header successfully generated and section concatenated.
- EFI_ABORTED Could not generate the section
- EFI_OUT_OF_RESOURCES No resource to complete the operation.
-
---*/
-{
- UINT32 Index;
- UINT32 InputFileNum;
- FILE *OutFile;
- CHAR8 **InputFileName;
- CHAR8 *OutputFileName;
- CHAR8 *SectionName;
- CHAR8 *CompressionName;
- CHAR8 *StringBuffer;
- EFI_GUID VendorGuid = mZeroGuid;
- int VersionNumber;
- UINT8 SectType;
- UINT8 SectCompSubType;
- UINT16 SectGuidAttribute;
- UINT64 SectGuidHeaderLength;
- EFI_VERSION_SECTION *VersionSect;
- EFI_USER_INTERFACE_SECTION *UiSect;
- UINT32 InputLength;
- UINT8 *OutFileBuffer;
- EFI_STATUS Status;
- UINT64 LogLevel;
- UINT32 *InputFileAlign;
- UINT32 InputFileAlignNum;
-
- InputFileAlign = NULL;
- InputFileAlignNum = 0;
- InputFileName = NULL;
- OutputFileName = NULL;
- SectionName = NULL;
- CompressionName = NULL;
- StringBuffer = "";
- OutFile = NULL;
- VersionNumber = 0;
- InputFileNum = 0;
- SectType = EFI_SECTION_ALL;
- SectCompSubType = 0;
- SectGuidAttribute = EFI_GUIDED_SECTION_NONE;
- OutFileBuffer = NULL;
- InputLength = 0;
- Status = STATUS_SUCCESS;
- LogLevel = 0;
- SectGuidHeaderLength = 0;
- VersionSect = NULL;
- UiSect = NULL;
-
- SetUtilityName (UTILITY_NAME);
-
- if (argc == 1) {
- Error (NULL, 0, 1001, "Missing options", "No options input");
- Usage ();
- return STATUS_ERROR;
- }
-
- //
- // Parse command line
- //
- argc --;
- argv ++;
-
- if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
- Version ();
- Usage ();
- return STATUS_SUCCESS;
- }
-
- if (stricmp (argv[0], "--version") == 0) {
- Version ();
- return STATUS_SUCCESS;
- }
-
- while (argc > 0) {
- if ((stricmp (argv[0], "-s") == 0) || (stricmp (argv[0], "--SectionType") == 0)) {
- SectionName = argv[1];
- if (SectionName == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Section Type can't be NULL");
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--outputfile") == 0)) {
- OutputFileName = argv[1];
- if (OutputFileName == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Output file can't be NULL");
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-c") == 0) || (stricmp (argv[0], "--compress") == 0)) {
- CompressionName = argv[1];
- if (CompressionName == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Compression Type can't be NULL");
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-g") == 0) || (stricmp (argv[0], "--vendor") == 0)) {
- Status = StringToGuid (argv[1], &VendorGuid);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-r") == 0) || (stricmp (argv[0], "--attributes") == 0)) {
- if (stricmp (argv[1], mGUIDedSectionAttribue[EFI_GUIDED_SECTION_PROCESSING_REQUIRED]) == 0) {
- SectGuidAttribute |= EFI_GUIDED_SECTION_PROCESSING_REQUIRED;
- } else if (stricmp (argv[1], mGUIDedSectionAttribue[EFI_GUIDED_SECTION_AUTH_STATUS_VALID]) == 0) {
- SectGuidAttribute |= EFI_GUIDED_SECTION_AUTH_STATUS_VALID;
- } else if (stricmp (argv[1], mGUIDedSectionAttribue[0]) == 0) {
- //
- // NONE attribute
- //
- SectGuidAttribute |= EFI_GUIDED_SECTION_NONE;
- } else {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-l") == 0) || (stricmp (argv[0], "--HeaderLength") == 0)) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &SectGuidHeaderLength);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value for GuidHeaderLength", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-n") == 0) || (stricmp (argv[0], "--name") == 0)) {
- StringBuffer = argv[1];
- if (StringBuffer == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Name can't be NULL");
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-j") == 0) || (stricmp (argv[0], "--buildnumber") == 0)) {
- if (argv[1] == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "build number can't be NULL");
- goto Finish;
- }
- //
- // Verify string is a integrator number
- //
- for (Index = 0; Index < strlen (argv[1]); Index++) {
- if ((argv[1][Index] != '-') && (isdigit ((int)argv[1][Index]) == 0)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- }
-
- sscanf (argv[1], "%d", &VersionNumber);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-v") == 0) || (stricmp (argv[0], "--verbose") == 0)) {
- SetPrintLevel (VERBOSE_LOG_LEVEL);
- VerboseMsg ("Verbose output Mode Set!");
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- SetPrintLevel (KEY_LOG_LEVEL);
- KeyMsg ("Quiet output Mode Set!");
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--debug") == 0)) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &LogLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- if (LogLevel > 9) {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0~9, currnt input level is %d", (int) LogLevel);
- goto Finish;
- }
- SetPrintLevel (LogLevel);
- DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", argv[1]);
- argc -= 2;
- argv += 2;
- continue;
- }
-
- //
- // Section File alignment requirement
- //
- if (stricmp (argv[0], "--sectionalign") == 0) {
- if (InputFileAlignNum == 0) {
- InputFileAlign = (UINT32 *) malloc (MAXIMUM_INPUT_FILE_NUM * sizeof (UINT32));
- if (InputFileAlign == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- return 1;
- }
- memset (InputFileAlign, 1, MAXIMUM_INPUT_FILE_NUM * sizeof (UINT32));
- } else if (InputFileAlignNum % MAXIMUM_INPUT_FILE_NUM == 0) {
- InputFileAlign = (UINT32 *) realloc (
- InputFileAlign,
- (InputFileNum + MAXIMUM_INPUT_FILE_NUM) * sizeof (UINT32)
- );
-
- if (InputFileAlign == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!");
- return 1;
- }
- memset (&(InputFileAlign[InputFileNum]), 1, (MAXIMUM_INPUT_FILE_NUM * sizeof (UINT32)));
- }
-
- Status = StringtoAlignment (argv[1], &(InputFileAlign[InputFileAlignNum]));
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
- goto Finish;
- }
- argc -= 2;
- argv += 2;
- InputFileAlignNum ++;
- continue;
- }
-
- //
- // Get Input file name
- //
- if ((InputFileNum == 0) && (InputFileName == NULL)) {
- InputFileName = (CHAR8 **) malloc (MAXIMUM_INPUT_FILE_NUM * sizeof (CHAR8 *));
- if (InputFileName == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");
- return 1;
- }
- memset (InputFileName, 0, (MAXIMUM_INPUT_FILE_NUM * sizeof (CHAR8 *)));
- } else if (InputFileNum % MAXIMUM_INPUT_FILE_NUM == 0) {
- //
- // InputFileName buffer too small, need to realloc
- //
- InputFileName = (CHAR8 **) realloc (
- InputFileName,
- (InputFileNum + MAXIMUM_INPUT_FILE_NUM) * sizeof (CHAR8 *)
- );
-
- if (InputFileName == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");
- return 1;
- }
- memset (&(InputFileName[InputFileNum]), 0, (MAXIMUM_INPUT_FILE_NUM * sizeof (CHAR8 *)));
- }
-
- InputFileName[InputFileNum++] = argv[0];
- argc --;
- argv ++;
- }
-
- if (InputFileAlignNum > 0 && InputFileAlignNum != InputFileNum) {
- Error (NULL, 0, 1003, "Invalid option", "section alignment must be set for each section");
- goto Finish;
- }
-
- VerboseMsg ("%s tool start.", UTILITY_NAME);
-
- //
- // Parse all command line parameters to get the corresponding section type.
- //
- VerboseMsg ("Section type is %s", SectionName);
- if (SectionName == NULL) {
- //
- // No specified Section type, default is SECTION_ALL.
- //
- SectType = EFI_SECTION_ALL;
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_COMPRESSION]) == 0) {
- SectType = EFI_SECTION_COMPRESSION;
- if (CompressionName == NULL) {
- //
- // Default is PI_STD compression algorithm.
- //
- SectCompSubType = EFI_STANDARD_COMPRESSION;
- } else if (stricmp (CompressionName, mCompressionTypeName[EFI_NOT_COMPRESSED]) == 0) {
- SectCompSubType = EFI_NOT_COMPRESSED;
- } else if (stricmp (CompressionName, mCompressionTypeName[EFI_STANDARD_COMPRESSION]) == 0) {
- SectCompSubType = EFI_STANDARD_COMPRESSION;
- } else {
- Error (NULL, 0, 1003, "Invalid option value", "--compress = %s", CompressionName);
- goto Finish;
- }
- VerboseMsg ("Compress method is %s", mCompressionTypeName [SectCompSubType]);
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_GUID_DEFINED]) == 0) {
- SectType = EFI_SECTION_GUID_DEFINED;
-
- if ((SectGuidAttribute & EFI_GUIDED_SECTION_NONE) != 0) {
- //
- // NONE attribute, clear attribute value.
- //
- SectGuidAttribute = SectGuidAttribute & ~EFI_GUIDED_SECTION_NONE;
- }
- VerboseMsg ("Vendor Guid is %08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
- (unsigned) VendorGuid.Data1,
- VendorGuid.Data2,
- VendorGuid.Data3,
- VendorGuid.Data4[0],
- VendorGuid.Data4[1],
- VendorGuid.Data4[2],
- VendorGuid.Data4[3],
- VendorGuid.Data4[4],
- VendorGuid.Data4[5],
- VendorGuid.Data4[6],
- VendorGuid.Data4[7]);
- if ((SectGuidAttribute & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) {
- VerboseMsg ("Guid Attribute is %s", mGUIDedSectionAttribue[EFI_GUIDED_SECTION_PROCESSING_REQUIRED]);
- }
- if ((SectGuidAttribute & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) != 0) {
- VerboseMsg ("Guid Attribute is %s", mGUIDedSectionAttribue[EFI_GUIDED_SECTION_AUTH_STATUS_VALID]);
- }
- if (SectGuidHeaderLength != 0) {
- VerboseMsg ("Guid Data Header size is 0x%llx", (unsigned long long) SectGuidHeaderLength);
- }
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_PE32]) == 0) {
- SectType = EFI_SECTION_PE32;
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_PIC]) == 0) {
- SectType = EFI_SECTION_PIC;
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_TE]) == 0) {
- SectType = EFI_SECTION_TE;
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_DXE_DEPEX]) == 0) {
- SectType = EFI_SECTION_DXE_DEPEX;
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_SMM_DEPEX]) == 0) {
- SectType = EFI_SECTION_SMM_DEPEX;
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_VERSION]) == 0) {
- SectType = EFI_SECTION_VERSION;
- if (VersionNumber < 0 || VersionNumber > 9999) {
- Error (NULL, 0, 1003, "Invalid option value", "%d is not in 0~9999", VersionNumber);
- goto Finish;
- }
- VerboseMsg ("Version section number is %d", VersionNumber);
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_USER_INTERFACE]) == 0) {
- SectType = EFI_SECTION_USER_INTERFACE;
- if (StringBuffer[0] == '\0') {
- Error (NULL, 0, 1001, "Missing option", "user interface string");
- goto Finish;
- }
- VerboseMsg ("UI section string name is %s", StringBuffer);
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_COMPATIBILITY16]) == 0) {
- SectType = EFI_SECTION_COMPATIBILITY16;
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_FIRMWARE_VOLUME_IMAGE]) == 0) {
- SectType = EFI_SECTION_FIRMWARE_VOLUME_IMAGE;
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_FREEFORM_SUBTYPE_GUID]) == 0) {
- SectType = EFI_SECTION_FREEFORM_SUBTYPE_GUID;
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_RAW]) == 0) {
- SectType = EFI_SECTION_RAW;
- } else if (stricmp (SectionName, mSectionTypeName[EFI_SECTION_PEI_DEPEX]) == 0) {
- SectType = EFI_SECTION_PEI_DEPEX;
- } else {
- Error (NULL, 0, 1003, "Invalid option value", "SectionType = %s", SectionName);
- goto Finish;
- }
-
- //
- // GuidValue is only required by Guided section.
- //
- if ((SectType != EFI_SECTION_GUID_DEFINED) && (CompareGuid (&VendorGuid, &mZeroGuid) != 0)) {
- fprintf (stdout, "Warning: the input guid value is not required for this section type %s\n", SectionName);
- }
-
- //
- // Check whether there is input file
- //
- if ((SectType != EFI_SECTION_VERSION) && (SectType != EFI_SECTION_USER_INTERFACE)) {
- //
- // The input file are required for other section type.
- //
- if (InputFileNum == 0) {
- Error (NULL, 0, 1001, "Missing options", "Input files");
- goto Finish;
- }
- }
- //
- // Check whether there is output file
- //
- for (Index = 0; Index < InputFileNum; Index ++) {
- VerboseMsg ("the %uth input file name is %s", (unsigned) Index, InputFileName[Index]);
- }
- if (OutputFileName == NULL) {
- Error (NULL, 0, 1001, "Missing options", "Output file");
- goto Finish;
- // OutFile = stdout;
- }
- VerboseMsg ("Output file name is %s", OutputFileName);
-
- //
- // At this point, we've fully validated the command line, and opened appropriate
- // files, so let's go and do what we've been asked to do...
- //
- //
- // Within this switch, build and write out the section header including any
- // section type specific pieces. If there's an input file, it's tacked on later
- //
- switch (SectType) {
- case EFI_SECTION_COMPRESSION:
- if (InputFileAlign != NULL) {
- free (InputFileAlign);
- InputFileAlign = NULL;
- }
- Status = GenSectionCompressionSection (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- SectCompSubType,
- &OutFileBuffer
- );
- break;
-
- case EFI_SECTION_GUID_DEFINED:
- if (InputFileAlign != NULL && (CompareGuid (&VendorGuid, &mZeroGuid) != 0)) {
- //
- // Only process alignment for the default known CRC32 guided section.
- // For the unknown guided section, the alignment is processed when the dummy all section (EFI_SECTION_ALL) is generated.
- //
- free (InputFileAlign);
- InputFileAlign = NULL;
- }
- Status = GenSectionGuidDefinedSection (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- &VendorGuid,
- SectGuidAttribute,
- (UINT32) SectGuidHeaderLength,
- &OutFileBuffer
- );
- break;
-
- case EFI_SECTION_VERSION:
- Index = sizeof (EFI_COMMON_SECTION_HEADER);
- //
- // 2 bytes for the build number UINT16
- //
- Index += 2;
- //
- // StringBuffer is ascii.. unicode is 2X + 2 bytes for terminating unicode null.
- //
- Index += (strlen (StringBuffer) * 2) + 2;
- OutFileBuffer = (UINT8 *) malloc (Index);
- if (OutFileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");
- goto Finish;
- }
- VersionSect = (EFI_VERSION_SECTION *) OutFileBuffer;
- VersionSect->CommonHeader.Type = SectType;
- VersionSect->CommonHeader.Size[0] = (UINT8) (Index & 0xff);
- VersionSect->CommonHeader.Size[1] = (UINT8) ((Index & 0xff00) >> 8);
- VersionSect->CommonHeader.Size[2] = (UINT8) ((Index & 0xff0000) >> 16);
- VersionSect->BuildNumber = (UINT16) VersionNumber;
- Ascii2UnicodeString (StringBuffer, VersionSect->VersionString);
- VerboseMsg ("the size of the created section file is %u bytes", (unsigned) Index);
- break;
-
- case EFI_SECTION_USER_INTERFACE:
- Index = sizeof (EFI_COMMON_SECTION_HEADER);
- //
- // StringBuffer is ascii.. unicode is 2X + 2 bytes for terminating unicode null.
- //
- Index += (strlen (StringBuffer) * 2) + 2;
- OutFileBuffer = (UINT8 *) malloc (Index);
- if (OutFileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");
- goto Finish;
- }
- UiSect = (EFI_USER_INTERFACE_SECTION *) OutFileBuffer;
- UiSect->CommonHeader.Type = SectType;
- UiSect->CommonHeader.Size[0] = (UINT8) (Index & 0xff);
- UiSect->CommonHeader.Size[1] = (UINT8) ((Index & 0xff00) >> 8);
- UiSect->CommonHeader.Size[2] = (UINT8) ((Index & 0xff0000) >> 16);
- Ascii2UnicodeString (StringBuffer, UiSect->FileNameString);
- VerboseMsg ("the size of the created section file is %u bytes", (unsigned) Index);
- break;
-
- case EFI_SECTION_ALL:
- //
- // read all input file contents into a buffer
- // first get the size of all file contents
- //
- Status = GetSectionContents (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- OutFileBuffer,
- &InputLength
- );
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- OutFileBuffer = (UINT8 *) malloc (InputLength);
- if (OutFileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated");
- goto Finish;
- }
- //
- // read all input file contents into a buffer
- //
- Status = GetSectionContents (
- InputFileName,
- InputFileAlign,
- InputFileNum,
- OutFileBuffer,
- &InputLength
- );
- }
- VerboseMsg ("the size of the created section file is %u bytes", (unsigned) InputLength);
- break;
- default:
- //
- // All other section types are caught by default (they're all the same)
- //
- Status = GenSectionCommonLeafSection (
- InputFileName,
- InputFileNum,
- SectType,
- &OutFileBuffer
- );
- break;
- }
-
- if (Status != EFI_SUCCESS || OutFileBuffer == NULL) {
- Error (NULL, 0, 2000, "Status is not successful", "Status value is 0x%X", (int) Status);
- goto Finish;
- }
-
- //
- // Get output file length
- //
- if (SectType != EFI_SECTION_ALL) {
- InputLength = SECTION_SIZE (OutFileBuffer);
- }
-
- //
- // Write the output file
- //
- OutFile = fopen (OutputFileName, "wb");
- if (OutFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file for writing", OutputFileName);
- goto Finish;
- }
-
- fwrite (OutFileBuffer, InputLength, 1, OutFile);
-
-Finish:
- if (InputFileName != NULL) {
- free (InputFileName);
- }
-
- if (InputFileAlign != NULL) {
- free (InputFileAlign);
- }
-
- if (OutFileBuffer != NULL) {
- free (OutFileBuffer);
- }
-
- if (OutFile != NULL) {
- fclose (OutFile);
- }
-
- VerboseMsg ("%s tool done with return code is 0x%x.", UTILITY_NAME, GetUtilityStatus ());
-
- return GetUtilityStatus ();
-}
diff --git a/BaseTools/Source/C/GenSec/Makefile b/BaseTools/Source/C/GenSec/Makefile
deleted file mode 100644
index fdd2a4b160..0000000000
--- a/BaseTools/Source/C/GenSec/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-## @file
-# Windows makefile for 'GenSec' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = GenSec
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = GenSec.obj
-
-#CFLAGS = $(CFLAGS) /nodefaultlib:libc.lib
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/GenVtf/GNUmakefile b/BaseTools/Source/C/GenVtf/GNUmakefile
deleted file mode 100644
index ff6599f1c9..0000000000
--- a/BaseTools/Source/C/GenVtf/GNUmakefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# GNU/Linux makefile for 'GenVtf' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = GenVtf
-
-LIBS = -lCommon
-
-OBJECTS = GenVtf.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
diff --git a/BaseTools/Source/C/GenVtf/GenVtf.c b/BaseTools/Source/C/GenVtf/GenVtf.c
deleted file mode 100644
index eaf2f56fed..0000000000
--- a/BaseTools/Source/C/GenVtf/GenVtf.c
+++ /dev/null
@@ -1,2729 +0,0 @@
-/**
-
-Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
-Module Name:
-
- GenVtf.c
-
-Abstract:
-
- This file contains functions required to generate a boot strap file (BSF)
- also known as the Volume Top File (VTF)
-
-**/
-
-//
-//
-//
-#include <FvLib.h>
-#include <Common/UefiBaseTypes.h>
-#include "GenVtf.h"
-#include <Guid/PiFirmwareFileSystem.h>
-#include "CommonLib.h"
-#include "EfiUtilityMsgs.h"
-
-//
-// Global variables
-//
-UINTN SectionOptionFlag = 0;
-UINTN SectionCompFlag = 0;
-
-UINT64 DebugLevel;
-BOOLEAN DebugMode;
-
-BOOLEAN QuietMode = FALSE;
-
-BOOLEAN VTF_OUTPUT = FALSE;
-CHAR8 *OutFileName1;
-CHAR8 *OutFileName2;
-CHAR8 *SymFileName;
-
-CHAR8 **TokenStr;
-CHAR8 **OrgStrTokPtr;
-
-PARSED_VTF_INFO *FileListPtr;
-PARSED_VTF_INFO *FileListHeadPtr;
-
-VOID *Vtf1Buffer;
-VOID *Vtf1EndBuffer;
-VOID *Vtf2Buffer;
-VOID *Vtf2EndBuffer;
-
-UINTN ValidLineNum = 0;
-UINTN ValidFFDFileListNum = 0;
-
-//
-// Section Description and their number of occurences in *.INF file
-//
-UINTN NumFvFiles = 0;
-UINTN SectionOptionNum = 0;
-
-//
-// Global flag which will check for VTF Present, if yes then will be used
-// to decide about adding FFS header to pad data
-//
-BOOLEAN VTFPresent = FALSE;
-BOOLEAN SecondVTF = FALSE;
-
-//
-// Address related information
-//
-UINT64 Fv1BaseAddress = 0;
-UINT64 Fv2BaseAddress = 0;
-UINT64 Fv1EndAddress = 0;
-UINT64 Fv2EndAddress = 0;
-UINT32 Vtf1TotalSize = SIZE_TO_OFFSET_PAL_A_END;
-UINT64 Vtf1LastStartAddress = 0;
-UINT32 Vtf2TotalSize = 0;
-UINT64 Vtf2LastStartAddress = 0;
-
-UINT32 BufferToTop = 0;
-
-//
-// IA32 Reset Vector Bin name
-//
-CHAR8 IA32BinFile[FILE_NAME_SIZE];
-
-//
-// Function Implementations
-//
-EFI_STATUS
-ConvertVersionInfo (
- IN CHAR8 *Str,
- IN OUT UINT8 *MajorVer,
- IN OUT UINT8 *MinorVer
- )
-/*++
-Routine Description:
-
- This function split version to major version and minor version
-
-Arguments:
-
- Str - String representing in form XX.XX
- MajorVer - The major version
- MinorVer - The minor version
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully.
-
---*/
-{
- CHAR8 TemStr[5] = "0000";
- unsigned Major;
- unsigned Minor;
- UINTN Length;
-
- Major = 0;
- Minor = 0;
-
- if (strstr (Str, ".") != NULL) {
- sscanf (
- Str,
- "%02x.%02x",
- &Major,
- &Minor
- );
- } else {
- Length = strlen(Str);
- if (Length < 4) {
- strncpy (TemStr + 4 - Length, Str, Length);
- } else {
- strncpy (TemStr, Str + Length - 4, 4);
- }
-
- sscanf (
- TemStr,
- "%02x%02x",
- &Major,
- &Minor
- );
- }
-
- *MajorVer = (UINT8) Major;
- *MinorVer = (UINT8) Minor;
- return EFI_SUCCESS;
-}
-
-VOID
-TrimLine (
- IN CHAR8 *Line
- )
-/*++
-Routine Description:
-
- This function cleans up the line by removing all whitespace and
- comments
-
-Arguments:
-
- Line - The pointer of the string
-
-Returns:
-
- None
-
---*/
-{
- CHAR8 TmpLine[FILE_NAME_SIZE];
- CHAR8 Char;
- CHAR8 *Ptr0;
- UINTN Index;
- UINTN Index2;
-
- //
- // Change '#' to '//' for Comment style
- //
- if (((Ptr0 = strchr (Line, '#')) != NULL) || ((Ptr0 = strstr (Line, "//")) != NULL)) {
- Line[Ptr0 - Line] = 0;
- }
-
- //
- // Initialize counters
- //
- Index = 0;
- Index2 = 0;
-
- while ((Char = Line[Index]) != 0) {
- if ((Char != ' ') && (Char != '\t') && (Char != '\n') && (Char != '\r')) {
- TmpLine[Index2++] = Char;
- }
- Index++;
- }
-
- TmpLine[Index2] = 0;
- strcpy (Line, TmpLine);
-}
-
-VOID
-ValidLineCount (
- IN FILE *Fp
- )
-/*++
-
-Routine Description:
-
- This function calculated number of valid lines in a input file.
-
-Arguments:
-
- Fp - Pointer to a file handle which has been opened.
-
-Returns:
-
- None
-
---*/
-{
- CHAR8 Buff[FILE_NAME_SIZE];
- while (fgets(Buff, sizeof (Buff), Fp)) {
- TrimLine (Buff);
- if (Buff[0] == 0) {
- continue;
- }
- ValidLineNum++;
- }
-}
-
-EFI_STATUS
-ParseInputFile (
- IN FILE *Fp
- )
-/*++
-
-Routine Description:
-
- This function parses the input file and tokenize the string
-
-Arguments:
-
- Fp - Pointer to a file handle which has been opened.
-
-Returns:
-
- None
-
---*/
-{
- CHAR8 *Token;
- CHAR8 Buff[FILE_NAME_SIZE + 1];
- CHAR8 Delimit[] = "=";
-
- Buff [FILE_NAME_SIZE] = '\0';
- Token = NULL;
-
- while (fgets (Buff, FILE_NAME_SIZE, Fp) != NULL) {
- TrimLine (Buff);
- if (Buff[0] == 0) {
- continue;
- }
- Token = strtok (Buff, Delimit);
- while (Token != NULL) {
- strcpy (*TokenStr, Token);
- TokenStr ++;
- Token = strtok (NULL, Delimit);
- }
- }
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-InitializeComps (
- VOID
- )
-/*++
-
-Routine Description:
-
- This function initializes the relevant global variable which is being
- used to store the information retrieved from INF file. This also initializes
- the VTF symbol file.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully
- EFI_OUT_OF_RESOURCES - Malloc failed.
-
---*/
-{
-
- FileListPtr = malloc (sizeof (PARSED_VTF_INFO));
-
- if (FileListPtr == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- FileListHeadPtr = FileListPtr;
- memset (FileListPtr, 0, sizeof (PARSED_VTF_INFO));
- FileListPtr->NextVtfInfo = NULL;
-
- remove (SymFileName);
- return EFI_SUCCESS;
-}
-
-VOID
-ParseAndUpdateComponents (
- IN PARSED_VTF_INFO *VtfInfo
- )
-/*++
-
-Routine Description:
-
- This function initializes the relevant global variable which is being
- used to store the information retrieved from INF file.
-
-Arguments:
-
- VtfInfo - A pointer to the VTF Info Structure
-
-
-Returns:
-
- None
-
---*/
-{
- UINT64 StringValue;
-
- while (*TokenStr != NULL && (strnicmp (*TokenStr, "COMP_NAME", 9) != 0)) {
-
- if (strnicmp (*TokenStr, "COMP_LOC", 8) == 0) {
- TokenStr++;
- if (strnicmp (*TokenStr, "F", 1) == 0) {
- VtfInfo->LocationType = FIRST_VTF;
- } else if (strnicmp (*TokenStr, "S", 1) == 0) {
- VtfInfo->LocationType = SECOND_VTF;
- } else {
- VtfInfo->LocationType = NONE;
- }
- } else if (strnicmp (*TokenStr, "COMP_TYPE", 9) == 0) {
- TokenStr++;
- if (AsciiStringToUint64 (*TokenStr, FALSE, &StringValue) != EFI_SUCCESS) {
- Error (NULL, 0, 5001, "Cannot get: \"0x%s\".", *TokenStr);
- return ;
- }
-
- VtfInfo->CompType = (UINT8) StringValue;
- } else if (strnicmp (*TokenStr, "COMP_VER", 8) == 0) {
- TokenStr++;
- if (strnicmp (*TokenStr, "-", 1) == 0) {
- VtfInfo->VersionPresent = FALSE;
- VtfInfo->MajorVer = 0;
- VtfInfo->MinorVer = 0;
- } else {
- VtfInfo->VersionPresent = TRUE;
- ConvertVersionInfo (*TokenStr, &VtfInfo->MajorVer, &VtfInfo->MinorVer);
- }
- } else if (strnicmp (*TokenStr, "COMP_BIN", 8) == 0) {
- TokenStr++;
- strcpy (VtfInfo->CompBinName, *TokenStr);
- } else if (strnicmp (*TokenStr, "COMP_SYM", 8) == 0) {
- TokenStr++;
- strcpy (VtfInfo->CompSymName, *TokenStr);
- } else if (strnicmp (*TokenStr, "COMP_SIZE", 9) == 0) {
- TokenStr++;
- if (strnicmp (*TokenStr, "-", 1) == 0) {
- VtfInfo->PreferredSize = FALSE;
- VtfInfo->CompSize = 0;
- } else {
- VtfInfo->PreferredSize = TRUE;
- if (AsciiStringToUint64 (*TokenStr, FALSE, &StringValue) != EFI_SUCCESS) {
- Error (NULL, 0, 5001, "Parse error", "Cannot get: %s.", TokenStr);
- return ;
- }
-
- VtfInfo->CompSize = (UINTN) StringValue;
- }
-
- } else if (strnicmp (*TokenStr, "COMP_CS", 7) == 0) {
- TokenStr++;
- if (strnicmp (*TokenStr, "1", 1) == 0) {
- VtfInfo->CheckSumRequired = 1;
- } else if (strnicmp (*TokenStr, "0", 1) == 0) {
- VtfInfo->CheckSumRequired = 0;
- } else {
- Error (NULL, 0, 3000, "Invaild", "Bad value in INF file required field: Checksum, the value must be '0' or '1'.");
- }
- }
-
- TokenStr++;
- if (*TokenStr == NULL) {
- break;
- }
- }
-}
-
-VOID
-InitializeInFileInfo (
- VOID
- )
-/*++
-
-Routine Description:
-
- This function intializes the relevant global variable which is being
- used to store the information retrieved from INF file.
-
-Arguments:
-
- NONE
-
-Returns:
-
- NONE
-
---*/
-{
-
- SectionOptionFlag = 0;
- SectionCompFlag = 0;
- TokenStr = OrgStrTokPtr;
-
- while (*TokenStr != NULL) {
- if (strnicmp (*TokenStr, "[OPTIONS]", 9) == 0) {
- SectionOptionFlag = 1;
- SectionCompFlag = 0;
- }
-
- if (strnicmp (*TokenStr, "[COMPONENTS]", 12) == 0) {
- if (FileListPtr == NULL) {
- FileListPtr = FileListHeadPtr;
- }
-
- SectionCompFlag = 1;
- SectionOptionFlag = 0;
- TokenStr++;
- }
-
- if (SectionOptionFlag) {
- if (stricmp (*TokenStr, "IA32_RST_BIN") == 0) {
- TokenStr++;
- strcpy (IA32BinFile, *TokenStr);
- }
- }
-
- if (SectionCompFlag) {
- if (stricmp (*TokenStr, "COMP_NAME") == 0) {
- TokenStr++;
- strcpy (FileListPtr->CompName, *TokenStr);
- TokenStr++;
- ParseAndUpdateComponents (FileListPtr);
- }
-
- if (*TokenStr != NULL) {
- FileListPtr->NextVtfInfo = malloc (sizeof (PARSED_VTF_INFO));
- if (FileListPtr->NextVtfInfo == NULL) {
- Error (NULL, 0, 4003, "Resource", "Out of memory resources.", NULL);
- break;
- }
- FileListPtr = FileListPtr->NextVtfInfo;
- memset (FileListPtr, 0, sizeof (PARSED_VTF_INFO));
- FileListPtr->NextVtfInfo = NULL;
- continue;
- } else {
- break;
- }
- }
-
- TokenStr++;
- }
-}
-
-EFI_STATUS
-GetVtfRelatedInfoFromInfFile (
- IN FILE *FilePointer
- )
-/*++
-
-Routine Description:
-
- This function reads the input file, parse it and create a list of tokens
- which is parsed and used, to intialize the data related to VTF
-
-Arguments:
-
- FileName - FileName which needed to be read to parse data
-
-Returns:
-
- EFI_ABORTED - Error in opening file
- EFI_INVALID_PARAMETER - File doesn't contain any valid information
- EFI_OUT_OF_RESOURCES - Malloc Failed
- EFI_SUCCESS - The function completed successfully
-
---*/
-{
- FILE *Fp;
- UINTN Index;
- UINTN Index1;
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
- Fp = FilePointer;
- if (Fp == NULL) {
- Error (NULL, 0, 2000, "Invalid parameter", "BSF INF file is invalid!");
- return EFI_ABORTED;
- }
-
- ValidLineCount (Fp);
-
- if (ValidLineNum == 0) {
- Error (NULL, 0, 2000, "Invalid parameter", "File does not contain any valid information!");
- return EFI_INVALID_PARAMETER;
- }
-
- TokenStr = (CHAR8 **) malloc (sizeof (UINTN) * (2 * ValidLineNum + 1));
-
- if (TokenStr == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- memset (TokenStr, 0, (sizeof (UINTN) * (2 * ValidLineNum + 1)));
- OrgStrTokPtr = TokenStr;
-
- for (Index = 0; Index < (2 * ValidLineNum); Index++) {
- *TokenStr = (CHAR8*)malloc (sizeof (CHAR8) * FILE_NAME_SIZE);
-
- if (*TokenStr == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto ParseFileError;
- }
-
- memset (*TokenStr, 0, FILE_NAME_SIZE);
- TokenStr++;
- }
-
- TokenStr = OrgStrTokPtr;
- fseek (Fp, 0L, SEEK_SET);
-
- Status = InitializeComps ();
-
- if (Status != EFI_SUCCESS) {
- goto ParseFileError;
- }
-
- Status = ParseInputFile (Fp);
- if (Status != EFI_SUCCESS) {
- goto ParseFileError;
- }
-
- InitializeInFileInfo ();
-
-ParseFileError:
-
- for (Index1 = 0; Index1 < Index; Index1 ++) {
- free (OrgStrTokPtr[Index1]);
- }
-
- free (OrgStrTokPtr);
-
- return Status;
-}
-
-VOID
-GetRelativeAddressInVtfBuffer (
- IN UINT64 Address,
- IN OUT UINTN *RelativeAddress,
- IN LOC_TYPE LocType
- )
-/*++
-
-Routine Description:
-
- This function checks for the address alignmnet for specified data boundary. In
- case the address is not aligned, it returns FALSE and the amount of data in
- terms of byte needed to adjust to get the boundary alignmnet. If data is
- aligned, TRUE will be returned.
-
-Arguments:
-
- Address - The address of the flash map space
- RelativeAddress - The relative address of the Buffer
- LocType - The type of the VTF
-
-
-Returns:
-
-
---*/
-{
- UINT64 TempAddress;
- UINT8 *LocalBuff;
-
- if (LocType == FIRST_VTF) {
- LocalBuff = (UINT8 *) Vtf1EndBuffer;
- TempAddress = Fv1EndAddress - Address;
- *RelativeAddress = (UINTN) LocalBuff - (UINTN) TempAddress;
- } else {
- LocalBuff = (UINT8 *) Vtf2EndBuffer;
- TempAddress = Fv2EndAddress - Address;
- *RelativeAddress = (UINTN) LocalBuff - (UINTN) TempAddress;
- }
-}
-
-EFI_STATUS
-GetComponentVersionInfo (
- IN OUT PARSED_VTF_INFO *VtfInfo,
- IN UINT8 *Buffer
- )
-/*++
-Routine Description:
-
- This function will extract the version information from File
-
-Arguments:
-
- VtfInfo - A Pointer to the VTF Info Structure
- Buffer - A Pointer to type UINT8
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully
- EFI_INVALID_PARAMETER - The parameter is invalid
-
---*/
-{
- UINT16 VersionInfo;
- EFI_STATUS Status;
-
- switch (VtfInfo->CompType) {
-
- case COMP_TYPE_FIT_PAL_A:
- case COMP_TYPE_FIT_PAL_B:
- memcpy (&VersionInfo, (Buffer + 8), sizeof (UINT16));
- VtfInfo->MajorVer = (UINT8) ((VersionInfo & 0xFF00) >> 8);
- VtfInfo->MinorVer = (UINT8) (VersionInfo & 0x00FF);
- Status = EFI_SUCCESS;
- break;
-
- default:
- Status = EFI_INVALID_PARAMETER;
- break;
- }
-
- return Status;
-}
-
-BOOLEAN
-CheckAddressAlignment (
- IN UINT64 Address,
- IN UINT64 AlignmentData,
- IN OUT UINT64 *AlignAdjustByte
- )
-/*++
-
-Routine Description:
-
- This function checks for the address alignmnet for specified data boundary. In
- case the address is not aligned, it returns FALSE and the amount of data in
- terms of byte needed to adjust to get the boundary alignmnet. If data is
- aligned, TRUE will be returned.
-
-Arguments:
-
- Address - Pointer to buffer containing byte data of component.
- AlignmentData - DataSize for which address needed to be aligned
- AlignAdjustByte - Number of bytes needed to adjust alignment.
-
-Returns:
-
- TRUE - Address is aligned to specific data size boundary
- FALSE - Address in not aligned to specified data size boundary
- - Add/Subtract AlignAdjustByte to aling the address.
-
---*/
-{
- //
- // Check if the assigned address is on address boundary. If not, it will
- // return the remaining byte required to adjust the address for specified
- // address boundary
- //
- *AlignAdjustByte = (Address % AlignmentData);
-
- if (*AlignAdjustByte == 0) {
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-EFI_STATUS
-GetFitTableStartAddress (
- IN OUT FIT_TABLE **FitTable
- )
-/*++
-
-Routine Description:
-
- Get the FIT table start address in VTF Buffer
-
-Arguments:
-
- FitTable - Pointer to available fit table where new component can be added
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully
-
---*/
-{
- UINT64 FitTableAdd;
- UINT64 FitTableAddOffset;
- UINTN RelativeAddress;
-
- //
- // Read the Fit Table address from Itanium-based address map.
- //
- FitTableAddOffset = Fv1EndAddress - (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT + SIZE_FIT_TABLE_ADD);
-
- //
- // Translate this Itanium-based address in terms of local buffer address which
- // contains the image for Boot Strapped File. The relative address will be
- // the address of fit table VTF buffer.
- //
- GetRelativeAddressInVtfBuffer (FitTableAddOffset, &RelativeAddress, FIRST_VTF);
- FitTableAdd = *(UINTN *) RelativeAddress;
-
- //
- // The FitTableAdd is the extracted Itanium based address pointing to FIT
- // table. The relative address will return its actual location in VTF
- // Buffer.
- //
- GetRelativeAddressInVtfBuffer (FitTableAdd, &RelativeAddress, FIRST_VTF);
-
- *FitTable = (FIT_TABLE *) RelativeAddress;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetNextAvailableFitPtr (
- IN FIT_TABLE **FitPtr
- )
-/*++
-
-Routine Description:
-
- Get the FIT table address and locate the free space in fit where we can add
- new component. In this process, this function locates the fit table using
- Fit pointer in Itanium-based address map (as per Intel?Itanium(TM) SAL spec)
- and locate the available location in FIT table to be used by new components.
- If there are any Fit table which areg not being used contains ComponentType
- field as 0x7F. If needed we can change this and spec this out.
-
-Arguments:
-
- FitPtr - Pointer to available fit table where new component can be added
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully
-
---*/
-{
- FIT_TABLE *TmpFitPtr;
- UINT64 FitTableAdd;
- UINT64 FitTableAddOffset;
- UINTN Index;
- UINTN NumFitComponents;
- UINTN RelativeAddress;
-
- //
- // Read the Fit Table address from Itanium-based address map.
- //
- FitTableAddOffset = Fv1EndAddress - (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT + SIZE_FIT_TABLE_ADD);
-
- //
- // Translate this Itanium-based address in terms of local buffer address which
- // contains the image for Boot Strapped File. The relative address will be
- // the address of fit table VTF buffer.
- //
- GetRelativeAddressInVtfBuffer (FitTableAddOffset, &RelativeAddress, FIRST_VTF);
- FitTableAdd = *(UINTN *) RelativeAddress;
-
- //
- // The FitTableAdd is the extracted Itanium based address pointing to FIT
- // table. The relative address will return its actual location in VTF
- // Buffer.
- //
- GetRelativeAddressInVtfBuffer (FitTableAdd, &RelativeAddress, FIRST_VTF);
-
- TmpFitPtr = (FIT_TABLE *) RelativeAddress;
- NumFitComponents = TmpFitPtr->CompSize;
-
- for (Index = 0; Index < NumFitComponents; Index++) {
- if ((TmpFitPtr->CvAndType & FIT_TYPE_MASK) == COMP_TYPE_FIT_UNUSED) {
- *FitPtr = TmpFitPtr;
- break;
- }
-
- TmpFitPtr++;
- }
-
- return EFI_SUCCESS;
-}
-
-int
-CompareItems (
- IN const VOID *Arg1,
- IN const VOID *Arg2
- )
-/*++
-
-Routine Description:
-
- This function is used by qsort to sort the FIT table based upon Component
- Type in their incresing order.
-
-Arguments:
-
- Arg1 - Pointer to Arg1
- Arg2 - Pointer to Arg2
-
-Returns:
-
- None
-
---*/
-{
- if ((((FIT_TABLE *) Arg1)->CvAndType & FIT_TYPE_MASK) > (((FIT_TABLE *) Arg2)->CvAndType & FIT_TYPE_MASK)) {
- return 1;
- } else if ((((FIT_TABLE *) Arg1)->CvAndType & FIT_TYPE_MASK) < (((FIT_TABLE *) Arg2)->CvAndType & FIT_TYPE_MASK)) {
- return -1;
- } else {
- return 0;
- }
-}
-
-VOID
-SortFitTable (
- IN VOID
- )
-/*++
-
-Routine Description:
-
- This function is used by qsort to sort the FIT table based upon Component
- Type in their incresing order.
-
-Arguments:
-
- VOID
-
-Returns:
-
- None
-
---*/
-{
- FIT_TABLE *FitTable;
- FIT_TABLE *TmpFitPtr;
- UINTN NumFitComponents;
- UINTN Index;
-
- GetFitTableStartAddress (&FitTable);
- TmpFitPtr = FitTable;
- NumFitComponents = 0;
- for (Index = 0; Index < FitTable->CompSize; Index++) {
- if ((TmpFitPtr->CvAndType & FIT_TYPE_MASK) != COMP_TYPE_FIT_UNUSED) {
- NumFitComponents += 1;
- }
- TmpFitPtr++;
- }
- qsort ((VOID *) FitTable, NumFitComponents, sizeof (FIT_TABLE), CompareItems);
-}
-
-VOID
-UpdateFitEntryForFwVolume (
- IN UINT64 Size
- )
-/*++
-
-Routine Description:
-
- This function updates the information about Firmware Volume in FIT TABLE.
- This FIT table has to be immediately below the PAL_A Start and it contains
- component type and address information. Other information can't be
- created this time so we would need to fix it up..
-
-
-Arguments:
-
- Size - Firmware Volume Size
-
-Returns:
-
- VOID
-
---*/
-{
- FIT_TABLE *CompFitPtr;
- UINTN RelativeAddress;
-
- //
- // FV Fit table will be located at PAL_A Startaddress - 16 byte location
- //
- Vtf1LastStartAddress -= 0x10;
- Vtf1TotalSize += 0x10;
-
- GetRelativeAddressInVtfBuffer (Vtf1LastStartAddress, &RelativeAddress, FIRST_VTF);
-
- CompFitPtr = (FIT_TABLE *) RelativeAddress;
- CompFitPtr->CompAddress = Fv1BaseAddress;
-
- //
- // Since we don't have any information about its location in Firmware Volume,
- // initialize address to 0. This will be updated once Firmware Volume is
- // being build and its current address will be fixed in FIT table. Currently
- // we haven't implemented it so far and working on architectural clarafication
- //
- //
- // Firmware Volume Size in 16 byte block
- //
- CompFitPtr->CompSize = ((UINT32) Size) / 16;
-
- //
- // Since Firmware Volume does not exist by the time we create this FIT info
- // this should be fixedup from Firmware Volume creation tool. We haven't
- // worked out a method so far.
- //
- CompFitPtr->CompVersion = MAKE_VERSION (0, 0);
-
- //
- // Since we don't have any info about this file, we are making sure that
- // checksum is not needed.
- //
- CompFitPtr->CvAndType = CV_N_TYPE (0, COMP_TYPE_FIT_FV_BOOT);
-
- //
- // Since non VTF component will reside outside the VTF, we will not have its
- // binary image while creating VTF, hence we will not perform checksum at
- // this time. Once Firmware Volume is being created which will contain this
- // VTF, it will fix the FIT table for all the non VTF component and hence
- // checksum
- //
- CompFitPtr->CheckSum = 0;
-}
-
-EFI_STATUS
-UpdateFitEntryForNonVTFComp (
- IN PARSED_VTF_INFO *VtfInfo
- )
-/*++
-
-Routine Description:
-
- This function updates the information about non VTF component in FIT TABLE.
- Since non VTF componets binaries are not part of VTF binary, we would still
- be required to update its location information in Firmware Volume, inside
- FIT table.
-
-Arguments:
-
- VtfInfo - Pointer to VTF Info Structure
-
-Returns:
-
- EFI_ABORTED - The function fails to update the component in FIT
- EFI_SUCCESS - The function completed successfully
-
---*/
-{
- FIT_TABLE *CompFitPtr;
-
- //
- // Scan the FIT table for available space
- //
- GetNextAvailableFitPtr (&CompFitPtr);
- if (CompFitPtr == NULL) {
- Error (NULL, 0, 5003, "Invalid", "Can't update this component in FIT");
- return EFI_ABORTED;
- }
-
- //
- // Since we don't have any information about its location in Firmware Volume,
- // initialize address to 0. This will be updated once Firmware Volume is
- // being build and its current address will be fixed in FIT table
- //
- CompFitPtr->CompAddress = 0;
- CompFitPtr->CompSize = VtfInfo->CompSize;
- CompFitPtr->CompVersion = MAKE_VERSION (VtfInfo->MajorVer, VtfInfo->MinorVer);
- CompFitPtr->CvAndType = CV_N_TYPE (VtfInfo->CheckSumRequired, VtfInfo->CompType);
-
- //
- // Since non VTF component will reside outside the VTF, we will not have its
- // binary image while creating VTF, hence we will not perform checksum at
- // this time. Once Firmware Volume is being created which will contain this
- // VTF, it will fix the FIT table for all the non VTF component and hence
- // checksum
- //
- CompFitPtr->CheckSum = 0;
-
- //
- // Fit Type is FV_BOOT which means Firmware Volume, we initialize this to base
- // address of Firmware Volume in which this VTF will be attached.
- //
- if ((CompFitPtr->CvAndType & 0x7F) == COMP_TYPE_FIT_FV_BOOT) {
- CompFitPtr->CompAddress = Fv1BaseAddress;
- }
-
- return EFI_SUCCESS;
-}
-
-//
-// !!!WARNING
-// This function is updating the SALE_ENTRY in Itanium address space as per SAL
-// spec. SALE_ENTRY is being read from SYM file of PEICORE. Once the PEI
-// CORE moves in Firmware Volume, we would need to modify this function to be
-// used with a API which will detect PEICORE component while building Firmware
-// Volume and update its entry in FIT table as well as in Itanium address space
-// as per Intel?Itanium(TM) SAL address space
-//
-EFI_STATUS
-UpdateEntryPoint (
- IN PARSED_VTF_INFO *VtfInfo,
- IN UINT64 *CompStartAddress
- )
-/*++
-
-Routine Description:
-
- This function updated the architectural entry point in IPF, SALE_ENTRY.
-
-Arguments:
-
- VtfInfo - Pointer to VTF Info Structure
- CompStartAddress - Pointer to Component Start Address
-
-Returns:
-
- EFI_INVALID_PARAMETER - The parameter is invalid
- EFI_SUCCESS - The function completed successfully
-
---*/
-{
- UINTN RelativeAddress;
- UINT64 SalEntryAdd;
- FILE *Fp;
- UINTN Offset;
-
- CHAR8 Buff[FILE_NAME_SIZE];
- CHAR8 Buff1[10];
- CHAR8 Buff2[10];
- CHAR8 OffsetStr[30];
- CHAR8 Buff3[10];
- CHAR8 Buff4[10];
- CHAR8 Buff5[10];
- CHAR8 Token[50];
-
- Fp = fopen (VtfInfo->CompSymName, "rb");
-
- if (Fp == NULL) {
- Error (NULL, 0, 0001, "Error opening file", VtfInfo->CompSymName);
- return EFI_INVALID_PARAMETER;
- }
-
- while (fgets (Buff, sizeof (Buff), Fp) != NULL) {
- fscanf (
- Fp,
- "%s %s %s %s %s %s %s",
- Buff1,
- Buff2,
- OffsetStr,
- Buff3,
- Buff4,
- Buff5,
- Token
- );
- if (strnicmp (Token, "SALE_ENTRY", 10) == 0) {
- break;
- }
- }
-
- Offset = strtoul (OffsetStr, NULL, 16);
-
- *CompStartAddress += Offset;
- SalEntryAdd = Fv1EndAddress - (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT);
-
- GetRelativeAddressInVtfBuffer (SalEntryAdd, &RelativeAddress, FIRST_VTF);
-
- memcpy ((VOID *) RelativeAddress, (VOID *) CompStartAddress, sizeof (UINT64));
-
- if (Fp != NULL) {
- fclose (Fp);
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateAndUpdateComponent (
- IN PARSED_VTF_INFO *VtfInfo
- )
-/*++
-
-Routine Description:
-
- This function reads the binary file for each components and update them
- in VTF Buffer as well as in FIT table. If the component is located in non
- VTF area, only the FIT table address will be updated
-
-Arguments:
-
- VtfInfo - Pointer to Parsed Info
-
-Returns:
-
- EFI_SUCCESS - The function completed successful
- EFI_ABORTED - Aborted due to one of the many reasons like:
- (a) Component Size greater than the specified size.
- (b) Error opening files.
-
- EFI_INVALID_PARAMETER Value returned from call to UpdateEntryPoint()
- EFI_OUT_OF_RESOURCES Memory allocation failure.
-
---*/
-{
- EFI_STATUS Status;
- UINT64 CompStartAddress;
- UINT64 FileSize;
- UINT64 NumAdjustByte;
- UINT8 *Buffer;
- FILE *Fp;
- FIT_TABLE *CompFitPtr;
- BOOLEAN Aligncheck;
-
- if (VtfInfo->LocationType == NONE) {
- UpdateFitEntryForNonVTFComp (VtfInfo);
- return EFI_SUCCESS;
- }
-
- Fp = fopen (VtfInfo->CompBinName, "rb");
-
- if (Fp == NULL) {
- Error (NULL, 0, 0001, "Error opening file", VtfInfo->CompBinName);
- return EFI_ABORTED;
- }
-
- FileSize = _filelength (fileno (Fp));
- if ((VtfInfo->CompType == COMP_TYPE_FIT_PAL_B) || (VtfInfo->CompType == COMP_TYPE_FIT_PAL_A_SPECIFIC)) {
-
- //
- // BUGBUG: Satish to correct
- //
- FileSize -= SIZE_OF_PAL_HEADER;
- }
-
- if (VtfInfo->PreferredSize) {
- if (FileSize > VtfInfo->CompSize) {
- Error (NULL, 0, 2000, "Invalid parameter", "The component size is more than specified size.");
- return EFI_ABORTED;
- }
-
- FileSize = VtfInfo->CompSize;
- }
-
- Buffer = malloc ((UINTN) FileSize);
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- memset (Buffer, 0, (UINTN) FileSize);
-
- if ((VtfInfo->CompType == COMP_TYPE_FIT_PAL_B) || (VtfInfo->CompType == COMP_TYPE_FIT_PAL_A_SPECIFIC)) {
-
- //
- // Read first 64 bytes of PAL header and use it to find version info
- //
- fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
-
- //
- // PAL header contains the version info. Currently, we will use the header
- // to read version info and then discard.
- //
- if (!VtfInfo->VersionPresent) {
- GetComponentVersionInfo (VtfInfo, Buffer);
- }
- }
-
- fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
- fclose (Fp);
-
- //
- // If it is non PAL_B component, pass the entire buffer to get the version
- // info and implement any specific case inside GetComponentVersionInfo.
- //
- if (VtfInfo->CompType != COMP_TYPE_FIT_PAL_B) {
- if (!VtfInfo->VersionPresent) {
- GetComponentVersionInfo (VtfInfo, Buffer);
- }
- }
-
- if (VtfInfo->LocationType == SECOND_VTF) {
-
- CompStartAddress = (Vtf2LastStartAddress - FileSize);
- } else {
- CompStartAddress = (Vtf1LastStartAddress - FileSize);
- }
-
- if (VtfInfo->CompType == COMP_TYPE_FIT_PAL_B) {
- Aligncheck = CheckAddressAlignment (CompStartAddress, 32 * 1024, &NumAdjustByte);
- } else {
- Aligncheck = CheckAddressAlignment (CompStartAddress, 8, &NumAdjustByte);
- }
-
- if (!Aligncheck) {
- CompStartAddress -= NumAdjustByte;
- }
-
- if (VtfInfo->LocationType == SECOND_VTF && SecondVTF == TRUE) {
- Vtf2LastStartAddress = CompStartAddress;
- Vtf2TotalSize += (UINT32) (FileSize + NumAdjustByte);
- Status = UpdateVtfBuffer (CompStartAddress, Buffer, FileSize, SECOND_VTF);
- } else if (VtfInfo->LocationType == FIRST_VTF) {
- Vtf1LastStartAddress = CompStartAddress;
- Vtf1TotalSize += (UINT32) (FileSize + NumAdjustByte);
- Status = UpdateVtfBuffer (CompStartAddress, Buffer, FileSize, FIRST_VTF);
- } else {
- Error (NULL, 0, 2000,"Invalid Parameter", "There's component in second VTF so second BaseAddress and Size must be specified!");
- return EFI_INVALID_PARAMETER;
- }
-
- if (EFI_ERROR (Status)) {
- return EFI_ABORTED;
- }
-
- GetNextAvailableFitPtr (&CompFitPtr);
-
- CompFitPtr->CompAddress = CompStartAddress | IPF_CACHE_BIT;
- if ((FileSize % 16) != 0) {
- Error (NULL, 0, 2000, "Invalid parameter", "Binary FileSize must be a multiple of 16.");
- return EFI_INVALID_PARAMETER;
- }
- //assert ((FileSize % 16) == 0);
- CompFitPtr->CompSize = (UINT32) (FileSize / 16);
- CompFitPtr->CompVersion = MAKE_VERSION (VtfInfo->MajorVer, VtfInfo->MinorVer);
- CompFitPtr->CvAndType = CV_N_TYPE (VtfInfo->CheckSumRequired, VtfInfo->CompType);
- if (VtfInfo->CheckSumRequired) {
- CompFitPtr->CheckSum = 0;
- CompFitPtr->CheckSum = CalculateChecksum8 (Buffer, (UINTN) FileSize);
- }
-
- //
- // Free the buffer
- //
- if (Buffer) {
- free (Buffer);
- }
-
- //
- // Update the SYM file for this component based on it's start address.
- //
- Status = UpdateSymFile (CompStartAddress, SymFileName, VtfInfo->CompSymName, FileSize);
- if (EFI_ERROR (Status)) {
-
- //
- // At this time, SYM files are not required, so continue on error.
- //
- }
-
- // !!!!!!!!!!!!!!!!!!!!!
- // BUGBUG:
- // This part of the code is a temporary line since PEICORE is going to be inside
- // VTF till we work out how to determine the SALE_ENTRY through it. We will need
- // to clarify so many related questions
- // !!!!!!!!!!!!!!!!!!!!!!!
-
- if (VtfInfo->CompType == COMP_TYPE_FIT_PEICORE) {
- Status = UpdateEntryPoint (VtfInfo, &CompStartAddress);
- }
-
- return Status;
-}
-
-EFI_STATUS
-CreateAndUpdatePAL_A (
- IN PARSED_VTF_INFO *VtfInfo
- )
-/*++
-
-Routine Description:
-
- This function reads the binary file for each components and update them
- in VTF Buffer as well as FIT table
-
-Arguments:
-
- VtfInfo - Pointer to Parsed Info
-
-Returns:
-
- EFI_ABORTED - Due to one of the following reasons:
- (a)Error Opening File
- (b)The PAL_A Size is more than specified size status
- One of the values mentioned below returned from
- call to UpdateSymFile
- EFI_SUCCESS - The function completed successfully.
- EFI_INVALID_PARAMETER - One of the input parameters was invalid.
- EFI_ABORTED - An error occurred.UpdateSymFile
- EFI_OUT_OF_RESOURCES - Memory allocation failed.
-
---*/
-{
- EFI_STATUS Status;
- UINT64 PalStartAddress;
- UINT64 AbsAddress;
- UINTN RelativeAddress;
- UINT64 FileSize;
- UINT8 *Buffer;
- FILE *Fp;
- FIT_TABLE *PalFitPtr;
-
- Fp = fopen (VtfInfo->CompBinName, "rb");
-
- if (Fp == NULL) {
- Error (NULL, 0, 0001, "Error opening file", VtfInfo->CompBinName);
- return EFI_ABORTED;
- }
-
- FileSize = _filelength (fileno (Fp));
- if (FileSize < 64) {
- Error (NULL, 0, 2000, "Invalid parameter", "PAL_A bin header is 64 bytes, so the Bin size must be larger than 64 bytes!");
- return EFI_INVALID_PARAMETER;
- }
- FileSize -= SIZE_OF_PAL_HEADER;
-
-
- if (VtfInfo->PreferredSize) {
- if (FileSize > VtfInfo->CompSize) {
- Error (NULL, 0, 2000, "Invalid parameter", "The PAL_A Size is more than the specified size.");
- return EFI_ABORTED;
- }
-
- FileSize = VtfInfo->CompSize;
- }
-
- Buffer = malloc ((UINTN) FileSize);
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- memset (Buffer, 0, (UINTN) FileSize);
-
- //
- // Read, Get version Info and discard the PAL header.
- //
- fread (Buffer, sizeof (UINT8), SIZE_OF_PAL_HEADER, Fp);
-
- //
- // Extract the version info from header of PAL_A. Once done, discrad this buffer
- //
- if (!VtfInfo->VersionPresent) {
- GetComponentVersionInfo (VtfInfo, Buffer);
- }
-
- //
- // Read PAL_A file in a buffer
- //
- fread (Buffer, sizeof (UINT8), (UINTN) FileSize, Fp);
- fclose (Fp);
-
- PalStartAddress = Fv1EndAddress - (SIZE_TO_OFFSET_PAL_A_END + FileSize);
- Vtf1LastStartAddress = PalStartAddress;
- Vtf1TotalSize += (UINT32) FileSize;
- Status = UpdateVtfBuffer (PalStartAddress, Buffer, FileSize, FIRST_VTF);
-
- AbsAddress = Fv1EndAddress - SIZE_TO_PAL_A_FIT;
- GetRelativeAddressInVtfBuffer (AbsAddress, &RelativeAddress, FIRST_VTF);
- PalFitPtr = (FIT_TABLE *) RelativeAddress;
- PalFitPtr->CompAddress = PalStartAddress | IPF_CACHE_BIT;
- //assert ((FileSize % 16) == 0);
- if ((FileSize % 16) != 0) {
- Error (NULL, 0, 2000, "Invalid parameter", "Binary FileSize must be a multiple of 16.");
- return EFI_INVALID_PARAMETER;
- }
-
- PalFitPtr->CompSize = (UINT32) (FileSize / 16);
- PalFitPtr->CompVersion = MAKE_VERSION (VtfInfo->MajorVer, VtfInfo->MinorVer);
- PalFitPtr->CvAndType = CV_N_TYPE (VtfInfo->CheckSumRequired, VtfInfo->CompType);
- if (VtfInfo->CheckSumRequired) {
- PalFitPtr->CheckSum = 0;
- PalFitPtr->CheckSum = CalculateChecksum8 (Buffer, (UINTN) FileSize);
- }
-
- if (Buffer) {
- free (Buffer);
- }
-
- //
- // Update the SYM file for this component based on it's start address.
- //
- Status = UpdateSymFile (PalStartAddress, SymFileName, VtfInfo->CompSymName, FileSize);
- if (EFI_ERROR (Status)) {
-
- //
- // At this time, SYM files are not required, so continue on error.
- //
- }
-
- return Status;
-}
-
-EFI_STATUS
-CreateFitTableAndInitialize (
- IN PARSED_VTF_INFO *VtfInfo
- )
-/*++
-
-Routine Description:
-
- This function creates and intializes FIT table which would be used to
- add component info inside this
-
-Arguments:
-
- VtfInfo - Pointer to Parsed Info
-
-Returns:
-
- EFI_ABORTED - Aborted due to no size information
- EFI_SUCCESS - The function completed successfully
-
---*/
-{
- UINT64 PalFitTableAdd;
- UINT64 FitTableAdd;
- UINT64 FitTableAddressOffset;
- FIT_TABLE *PalFitPtr;
- FIT_TABLE *FitStartPtr;
- UINTN NumFitComp;
- UINTN RelativeAddress;
- UINTN Index;
-
- if (!VtfInfo->PreferredSize) {
- Error (NULL, 0, 2000, "Invalid parameter", "FIT could not be allocated because there is no size information.");
- return EFI_ABORTED;
- }
-
- if ((VtfInfo->CompSize % 16) != 0) {
- Error (NULL, 0, 2000, "Invalid parameter", "Invalid FIT Table Size, it is not a multiple of 16 bytes. Please correct the size.");
- }
-
- PalFitTableAdd = Fv1EndAddress - SIZE_TO_PAL_A_FIT;
- GetRelativeAddressInVtfBuffer (PalFitTableAdd, &RelativeAddress, FIRST_VTF);
- PalFitPtr = (FIT_TABLE *) RelativeAddress;
- PalFitTableAdd = (PalFitPtr->CompAddress - VtfInfo->CompSize);
-
- FitTableAdd = (PalFitPtr->CompAddress - 0x10) - VtfInfo->CompSize;
- FitTableAddressOffset = Fv1EndAddress - (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT + SIZE_FIT_TABLE_ADD);
- GetRelativeAddressInVtfBuffer (FitTableAddressOffset, &RelativeAddress, FIRST_VTF);
- *(UINT64 *) RelativeAddress = FitTableAdd;
-
- GetRelativeAddressInVtfBuffer (FitTableAdd, &RelativeAddress, FIRST_VTF);
-
- //
- // Update Fit Table with FIT Signature and FIT info in first 16 bytes.
- //
- FitStartPtr = (FIT_TABLE *) RelativeAddress;
-
- strncpy ((CHAR8 *) &FitStartPtr->CompAddress, FIT_SIGNATURE, 8); // "_FIT_ "
- assert (((VtfInfo->CompSize & 0x00FFFFFF) % 16) == 0);
- FitStartPtr->CompSize = (VtfInfo->CompSize & 0x00FFFFFF) / 16;
- FitStartPtr->CompVersion = MAKE_VERSION (VtfInfo->MajorVer, VtfInfo->MinorVer);
-
- //
- // BUGBUG: If a checksum is required, add code to checksum the FIT table. Also
- // determine what to do for things like the FV component that aren't easily checksummed.
- // The checksum will be done once we are done with all the componet update in the FIT
- // table
- //
- FitStartPtr->CvAndType = CV_N_TYPE (VtfInfo->CheckSumRequired, VtfInfo->CompType);
-
- NumFitComp = FitStartPtr->CompSize;
-
- FitStartPtr++;
-
- //
- // Intialize remaining FIT table space to UNUSED fit component type
- // so that when we need to create a FIT entry for a component, we can
- // locate a free one and use it.
- //
- for (Index = 0; Index < (NumFitComp - 1); Index++) {
- FitStartPtr->CvAndType = 0x7F; // Initialize all with UNUSED
- FitStartPtr++;
- }
-
- Vtf1TotalSize += VtfInfo->CompSize;
- Vtf1LastStartAddress -= VtfInfo->CompSize;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-WriteVtfBinary (
- IN CHAR8 *FileName,
- IN UINT32 VtfSize,
- IN LOC_TYPE LocType
- )
-/*++
-
-Routine Description:
-
- Write Firmware Volume from memory to a file.
-
-Arguments:
-
- FileName - Output File Name which needed to be created/
- VtfSize - FileSize
- LocType - The type of the VTF
-
-Returns:
-
- EFI_ABORTED - Returned due to one of the following resons:
- (a) Error Opening File
- (b) Failing to copy buffers
- EFI_SUCCESS - The fuction completes successfully
-
---*/
-{
- FILE *Fp;
- UINTN NumByte;
- VOID *VtfBuffer;
- UINTN RelativeAddress;
-
- if (LocType == FIRST_VTF) {
- GetRelativeAddressInVtfBuffer (Vtf1LastStartAddress, &RelativeAddress, FIRST_VTF);
- VtfBuffer = (VOID *) RelativeAddress;
- } else {
- GetRelativeAddressInVtfBuffer (Vtf2LastStartAddress, &RelativeAddress, SECOND_VTF);
- VtfBuffer = (VOID *) RelativeAddress;
- }
-
- Fp = fopen (FileName, "wb");
- if (Fp == NULL) {
- Error (NULL, 0, 0001, "Error opening file", FileName);
- return EFI_ABORTED;
- }
-
- NumByte = fwrite (VtfBuffer, sizeof (UINT8), (UINTN) VtfSize, Fp);
-
- if (Fp) {
- fclose (Fp);
- }
-
- if (NumByte != (sizeof (UINT8) * VtfSize)) {
- Error (NULL, 0, 0002, "Error writing file", FileName);
- return EFI_ABORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-UpdateVtfBuffer (
- IN UINT64 StartAddress,
- IN UINT8 *Buffer,
- IN UINT64 DataSize,
- IN LOC_TYPE LocType
- )
-/*++
-
-Routine Description:
-
- Update the Firmware Volume Buffer with requested buffer data
-
-Arguments:
-
- StartAddress - StartAddress in buffer. This number will automatically
- point to right address in buffer where data needed
- to be updated.
- Buffer - Buffer pointer from data will be copied to memory mapped buffer.
- DataSize - Size of the data needed to be copied.
- LocType - The type of the VTF: First or Second
-
-Returns:
-
- EFI_ABORTED - The input parameter is error
- EFI_SUCCESS - The function completed successfully
-
---*/
-{
- UINT8 *LocalBufferPtrToWrite;
-
- if (LocType == FIRST_VTF) {
- if ((StartAddress | IPF_CACHE_BIT) < (Vtf1LastStartAddress | IPF_CACHE_BIT)) {
- Error (NULL, 0, 2000, "Invalid parameter", "Start Address is less than the VTF start address.");
- return EFI_ABORTED;
- }
-
- LocalBufferPtrToWrite = (UINT8 *) Vtf1EndBuffer;
-
- LocalBufferPtrToWrite -= (Fv1EndAddress - StartAddress);
-
- } else {
-
- if ((StartAddress | IPF_CACHE_BIT) < (Vtf2LastStartAddress | IPF_CACHE_BIT)) {
- Error (NULL, 0, 2000, "Invalid parameter", "Error StartAddress");
- return EFI_ABORTED;
- }
- LocalBufferPtrToWrite = (UINT8 *) Vtf2EndBuffer;
- LocalBufferPtrToWrite -= (Fv2EndAddress - StartAddress);
- }
-
- memcpy (LocalBufferPtrToWrite, Buffer, (UINTN) DataSize);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-UpdateFfsHeader (
- IN UINT32 TotalVtfSize,
- IN LOC_TYPE LocType
- )
-/*++
-
-Routine Description:
-
- Update the Firmware Volume Buffer with requested buffer data
-
-Arguments:
-
- TotalVtfSize - Size of the VTF
- Fileoffset - The start of the file relative to the start of the FV.
- LocType - The type of the VTF
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully
- EFI_INVALID_PARAMETER - The Ffs File Header Pointer is NULL
-
---*/
-{
- EFI_FFS_FILE_HEADER *FileHeader;
- UINTN RelativeAddress;
- EFI_GUID EfiFirmwareVolumeTopFileGuid = EFI_FFS_VOLUME_TOP_FILE_GUID;
-
- //
- // Find the VTF file header location
- //
- if (LocType == FIRST_VTF) {
- GetRelativeAddressInVtfBuffer (Vtf1LastStartAddress, &RelativeAddress, FIRST_VTF);
- FileHeader = (EFI_FFS_FILE_HEADER *) RelativeAddress;
- } else {
- GetRelativeAddressInVtfBuffer (Vtf2LastStartAddress, &RelativeAddress, SECOND_VTF);
- FileHeader = (EFI_FFS_FILE_HEADER *) RelativeAddress;
- }
-
- if (FileHeader == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // write header
- //
- memset (FileHeader, 0, sizeof (EFI_FFS_FILE_HEADER));
- memcpy (&FileHeader->Name, &EfiFirmwareVolumeTopFileGuid, sizeof (EFI_GUID));
- FileHeader->Type = EFI_FV_FILETYPE_RAW;
- FileHeader->Attributes = FFS_ATTRIB_CHECKSUM;
-
- //
- // Now FileSize includes the EFI_FFS_FILE_HEADER
- //
- FileHeader->Size[0] = (UINT8) (TotalVtfSize & 0x000000FF);
- FileHeader->Size[1] = (UINT8) ((TotalVtfSize & 0x0000FF00) >> 8);
- FileHeader->Size[2] = (UINT8) ((TotalVtfSize & 0x00FF0000) >> 16);
-
- //
- // Fill in checksums and state, all three must be zero for the checksums.
- //
- FileHeader->IntegrityCheck.Checksum.Header = 0;
- FileHeader->IntegrityCheck.Checksum.File = 0;
- FileHeader->State = 0;
- FileHeader->IntegrityCheck.Checksum.Header = CalculateChecksum8 ((UINT8 *) FileHeader, sizeof (EFI_FFS_FILE_HEADER));
- FileHeader->IntegrityCheck.Checksum.File = CalculateChecksum8 ((UINT8 *) (FileHeader + 1), TotalVtfSize - sizeof (EFI_FFS_FILE_HEADER));
- FileHeader->State = EFI_FILE_HEADER_CONSTRUCTION | EFI_FILE_HEADER_VALID | EFI_FILE_DATA_VALID;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-ValidateAddressAndSize (
- IN UINT64 BaseAddress,
- IN UINT64 FwVolSize
- )
-/*++
-
-Routine Description:
-
- Update the Firmware Volume Buffer with requested buffer data
-
-Arguments:
-
- BaseAddress - Base address for the Fw Volume.
-
- FwVolSize - Total Size of the FwVolume to which VTF will be attached..
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully
- EFI_UNSUPPORTED - The input parameter is error
-
---*/
-{
- if ((BaseAddress >= 0) && (FwVolSize > 0x40) && ((BaseAddress + FwVolSize) % 8 == 0)) {
- return EFI_SUCCESS;
- }
-
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-UpdateIA32ResetVector (
- IN CHAR8 *FileName,
- IN UINT64 FirstFwVSize
- )
-/*++
-
-Routine Description:
-
- Update the 16 byte IA32 Reset vector to maintain the compatibility
-
-Arguments:
-
- FileName - Binary file name which contains the IA32 Reset vector info..
- FirstFwVSize - Total Size of the FwVolume to which VTF will be attached..
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully
- EFI_ABORTED - Invalid File Size
- EFI_INVALID_PARAMETER - Bad File Name
- EFI_OUT_OF_RESOURCES - Memory allocation failed.
-
---*/
-{
- UINT8 *Buffer;
- UINT8 *LocalVtfBuffer;
- UINTN FileSize;
- FILE *Fp;
-
- if (!strcmp (FileName, "")) {
- return EFI_INVALID_PARAMETER;
- }
-
- Fp = fopen (FileName, "rb");
-
- if (Fp == NULL) {
- Error (NULL, 0, 0001, "Error opening file", FileName);
- return EFI_ABORTED;
- }
-
- FileSize = _filelength (fileno (Fp));
-
- if (FileSize > 16) {
- return EFI_ABORTED;
- }
-
- Buffer = malloc (FileSize);
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- fread (Buffer, sizeof (UINT8), FileSize, Fp);
-
- LocalVtfBuffer = (UINT8 *) Vtf1EndBuffer - SIZE_IA32_RESET_VECT;
- memcpy (LocalVtfBuffer, Buffer, FileSize);
-
- if (Buffer) {
- free (Buffer);
- }
-
- if (Fp != NULL) {
- fclose (Fp);
- }
- return EFI_SUCCESS;
-}
-
-VOID
-CleanUpMemory (
- VOID
- )
-/*++
-
-Routine Description:
-
- This function cleans up any allocated buffer
-
-Arguments:
-
- NONE
-
-Returns:
-
- NONE
-
---*/
-{
- PARSED_VTF_INFO *TempFileListPtr;
-
- if (Vtf1Buffer) {
- free (Vtf1Buffer);
- }
-
- if (Vtf2Buffer) {
- free (Vtf2Buffer);
- }
-
- //
- // Cleanup the buffer which was allocated to read the file names from FV.INF
- //
- FileListPtr = FileListHeadPtr;
- while (FileListPtr != NULL) {
- TempFileListPtr = FileListPtr->NextVtfInfo;
- free (FileListPtr);
- FileListPtr = TempFileListPtr;
- }
-}
-
-EFI_STATUS
-ProcessAndCreateVtf (
- IN UINT64 Size
- )
-/*++
-
-Routine Description:
-
- This function process the link list created during INF file parsing
- and create component in VTF and updates its info in FIT table
-
-Arguments:
-
- Size - Size of the Firmware Volume of which, this VTF belongs to.
-
-Returns:
-
- EFI_UNSUPPORTED - Unknown FIT type
- EFI_SUCCESS - The function completed successfully
-
---*/
-{
- EFI_STATUS Status;
- PARSED_VTF_INFO *ParsedInfoPtr;
-
- Status = EFI_SUCCESS;
-
- ParsedInfoPtr = FileListHeadPtr;
-
- while (ParsedInfoPtr != NULL) {
-
- switch (ParsedInfoPtr->CompType) {
- //
- // COMP_TYPE_FIT_HEADER is a special case, hence handle it here
- //
- case COMP_TYPE_FIT_HEADER:
- //COMP_TYPE_FIT_HEADER 0x00
- Status = CreateFitTableAndInitialize (ParsedInfoPtr);
- break;
-
- //
- // COMP_TYPE_FIT_PAL_A is a special case, hence handle it here
- //
- case COMP_TYPE_FIT_PAL_A:
- //COMP_TYPE_FIT_PAL_A 0x0F
- Status = CreateAndUpdatePAL_A (ParsedInfoPtr);
-
- //
- // Based on VTF specification, once the PAL_A component has been written,
- // update the Firmware Volume info as FIT table. This will be utilized
- // to extract the Firmware Volume Start address where this VTF will be
- // of part.
- //
- if (Status == EFI_SUCCESS) {
- UpdateFitEntryForFwVolume (Size);
- }
- break;
-
- case COMP_TYPE_FIT_FV_BOOT:
- //COMP_TYPE_FIT_FV_BOOT 0x7E
- //
- // Since FIT entry for Firmware Volume has been created and it is
- // located at (PAL_A start - 16 byte). So we will not process any
- // Firmware Volume related entry from INF file
- //
- Status = EFI_SUCCESS;
- break;
-
- default:
- //
- // Any other component type should be handled here. This will create the
- // image in specified VTF and create appropriate entry about this
- // component in FIT Entry.
- //
- Status = CreateAndUpdateComponent (ParsedInfoPtr);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0002, "Error updating component", ParsedInfoPtr->CompName);
- return EFI_ABORTED;
- } else {
- break;}
- }
-
- ParsedInfoPtr = ParsedInfoPtr->NextVtfInfo;
- }
- return Status;
-}
-
-EFI_STATUS
-GenerateVtfImage (
- IN UINT64 StartAddress1,
- IN UINT64 Size1,
- IN UINT64 StartAddress2,
- IN UINT64 Size2,
- IN FILE *fp
- )
-/*++
-
-Routine Description:
-
- This is the main function which will be called from application.
-
-Arguments:
-
- StartAddress1 - The start address of the first VTF
- Size1 - The size of the first VTF
- StartAddress2 - The start address of the second VTF
- Size2 - The size of the second VTF
- fp - The pointer to BSF inf file
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - Can not allocate memory
- The return value can be any of the values
- returned by the calls to following functions:
- GetVtfRelatedInfoFromInfFile
- ProcessAndCreateVtf
- UpdateIA32ResetVector
- UpdateFfsHeader
- WriteVtfBinary
-
---*/
-{
- EFI_STATUS Status;
- FILE *VtfFP;
-
- Status = EFI_UNSUPPORTED;
- VtfFP = fp;
-
- if (StartAddress2 == 0) {
- SecondVTF = FALSE;
- } else {
- SecondVTF = TRUE;
- }
-
- Fv1BaseAddress = StartAddress1;
- Fv1EndAddress = Fv1BaseAddress + Size1;
- if (Fv1EndAddress != 0x100000000ULL || Size1 < 0x100000) {
- Error (NULL, 0, 2000, "Invalid parameter", "Error BaseAddress and Size parameters!");
- if (Size1 < 0x100000) {
- Error (NULL, 0, 2000, "Invalid parameter", "The FwVolumeSize must be larger than 1M!");
- } else if (SecondVTF != TRUE) {
- Error (NULL, 0, 2000, "Invalid parameter", "BaseAddress + FwVolumeSize must equal 0x100000000!");
- }
- Usage();
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // The image buffer for the First VTF
- //
- Vtf1Buffer = malloc ((UINTN) Size1);
- if (Vtf1Buffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "Not enough resources available to create memory mapped file for the Boot Strap File!");
- return EFI_OUT_OF_RESOURCES;
- }
- memset (Vtf1Buffer, 0x00, (UINTN) Size1);
- Vtf1EndBuffer = (UINT8 *) Vtf1Buffer + Size1;
- Vtf1LastStartAddress = Fv1EndAddress | IPF_CACHE_BIT;
-
- if (SecondVTF) {
- Fv2BaseAddress = StartAddress2;
- Fv2EndAddress = Fv2BaseAddress + Size2;
- if (Fv2EndAddress != StartAddress1) {
- Error (NULL, 0, 2000, "Invalid parameter", "Error BaseAddress and Size parameters!");
- if (SecondVTF == TRUE) {
- Error (NULL, 0, 2000, "Invalid parameter", "FirstBaseAddress + FirstFwVolumeSize must equal 0x100000000!");
- Error (NULL, 0, 2000, "Invalid parameter", "SecondBaseAddress + SecondFwVolumeSize must equal FirstBaseAddress!");
- }
- Usage();
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // The image buffer for the second VTF
- //
- Vtf2Buffer = malloc ((UINTN) Size2);
- if (Vtf2Buffer == NULL) {
- Error (NULL, 0, 4001, "Resource", "Not enough resources available to create memory mapped file for the Boot Strap File!");
- return EFI_OUT_OF_RESOURCES;
- }
- memset (Vtf2Buffer, 0x00, (UINTN) Size2);
- Vtf2EndBuffer = (UINT8 *) Vtf2Buffer + Size2;
- Vtf2LastStartAddress = Fv2EndAddress | IPF_CACHE_BIT;
- }
-
- Status = GetVtfRelatedInfoFromInfFile (VtfFP);
-
- if (Status != EFI_SUCCESS) {
- Error (NULL, 0, 0003, "Error parsing file", "the input file.");
- CleanUpMemory ();
- return Status;
- }
-
- Status = ProcessAndCreateVtf (Size1);
- if (Status != EFI_SUCCESS) {
- CleanUpMemory ();
- return Status;
- }
-
- if (SectionOptionFlag) {
- Status = UpdateIA32ResetVector (IA32BinFile, Vtf1TotalSize);
- if (Status != EFI_SUCCESS) {
- CleanUpMemory ();
- return Status;
- }
- }
-
- //
- // Re arrange the FIT Table for Ascending order of their FIT Type..
- //
- SortFitTable ();
-
- //
- // All components have been updated in FIT table. Now perform the FIT table
- // checksum. The following function will check if Checksum is required,
- // if yes, then it will perform the checksum otherwise not.
- //
- CalculateFitTableChecksum ();
-
- //
- // Write the FFS header
- //
- Vtf1TotalSize += sizeof (EFI_FFS_FILE_HEADER);
- Vtf1LastStartAddress -= sizeof (EFI_FFS_FILE_HEADER);
-
- Status = UpdateFfsHeader (Vtf1TotalSize, FIRST_VTF);
- if (Status != EFI_SUCCESS) {
- CleanUpMemory ();
- return Status;
- }
- //
- // Update the VTF buffer into specified VTF binary file
- //
- Status = WriteVtfBinary (OutFileName1, Vtf1TotalSize, FIRST_VTF);
-
- if (SecondVTF) {
- Vtf2TotalSize += sizeof (EFI_FFS_FILE_HEADER);
- Vtf2LastStartAddress -= sizeof (EFI_FFS_FILE_HEADER);
- Status = UpdateFfsHeader (Vtf2TotalSize, SECOND_VTF);
- if (Status != EFI_SUCCESS) {
- CleanUpMemory ();
- return Status;
- }
-
- //
- // Update the VTF buffer into specified VTF binary file
- //
- Status = WriteVtfBinary (OutFileName2, Vtf2TotalSize, SECOND_VTF);
- }
-
- CleanUpMemory ();
-
- return Status;
-}
-
-EFI_STATUS
-PeimFixupInFitTable (
- IN UINT64 StartAddress
- )
-/*++
-
-Routine Description:
-
- This function is an entry point to fixup SAL-E entry point.
-
-Arguments:
-
- StartAddress - StartAddress for PEIM.....
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully
- EFI_ABORTED - Error Opening File
- EFI_OUT_OF_RESOURCES - System out of resources for memory allocation.
-
---*/
-{
- EFI_STATUS Status;
- FILE *Fp;
- UINT64 *StartAddressPtr;
- UINTN FirstFwVSize;
-
- StartAddressPtr = malloc (sizeof (UINT64));
- if (StartAddressPtr == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- *StartAddressPtr = StartAddress;
-
- Fp = fopen (OutFileName1, "rb");
-
- if (Fp == NULL) {
- Error (NULL, 0, 0001, "Error opening file", OutFileName1);
- if (StartAddressPtr) {
- free (StartAddressPtr);
- }
- return EFI_ABORTED;
- }
-
- FirstFwVSize = _filelength (fileno (Fp));
- fseek (Fp, (long) (FirstFwVSize - (UINTN) (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT)), SEEK_SET);
- fwrite ((VOID *) StartAddressPtr, sizeof (UINT64), 1, Fp);
-
- if (Fp) {
- fclose (Fp);
- }
-
- if (StartAddressPtr) {
- free (StartAddressPtr);
- }
-
- Status = EFI_SUCCESS;
- return Status;
-}
-
-EFI_STATUS
-UpdateSymFile (
- IN UINT64 BaseAddress,
- IN CHAR8 *DestFileName,
- IN CHAR8 *SourceFileName,
- IN UINT64 FileSize
-
- )
-/*++
-
-Routine Description:
-
- This function adds the SYM tokens in the source file to the destination file.
- The SYM tokens are updated to reflect the base address.
-
-Arguments:
-
- BaseAddress - The base address for the new SYM tokens.
- DestFileName - The destination file.
- SourceFileName - The source file.
- FileSize - Size of bin file.
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully.
- EFI_INVALID_PARAMETER - One of the input parameters was invalid.
- EFI_ABORTED - An error occurred.
-
---*/
-{
- FILE *SourceFile;
- FILE *DestFile;
- CHAR8 Buffer[_MAX_PATH];
- CHAR8 Type[_MAX_PATH];
- CHAR8 Address[_MAX_PATH];
- CHAR8 Section[_MAX_PATH];
- CHAR8 Token[_MAX_PATH];
- CHAR8 BaseToken[_MAX_PATH];
- UINT64 TokenAddress;
- long StartLocation;
-
- //
- // Verify input parameters.
- //
- if (BaseAddress == 0 || DestFileName == NULL || SourceFileName == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Open the source file
- //
- SourceFile = fopen (SourceFileName, "r");
- if (SourceFile == NULL) {
-
- //
- // SYM files are not required.
- //
- return EFI_SUCCESS;
- }
-
- //
- // Use the file name minus extension as the base for tokens
- //
- strcpy (BaseToken, SourceFileName);
- strtok (BaseToken, ". \t\n");
- strcat (BaseToken, "__");
-
- //
- // Open the destination file
- //
- DestFile = fopen (DestFileName, "a+");
- if (DestFile == NULL) {
- fclose (SourceFile);
- Error (NULL, 0, 0001, "Error opening file", DestFileName);
- return EFI_ABORTED;
- }
-
- //
- // If this is the beginning of the output file, write the symbol format info.
- //
- if (fseek (DestFile, 0, SEEK_END) != 0) {
- fclose (SourceFile);
- fclose (DestFile);
- Error (NULL, 0, 2000, "Invalid parameter", "not at the beginning of the output file.");
- return EFI_ABORTED;
- }
-
- StartLocation = ftell (DestFile);
-
- if (StartLocation == 0) {
- fprintf (DestFile, "TEXTSYM format | V1.0\n");
- } else if (StartLocation == -1) {
- fclose (SourceFile);
- fclose (DestFile);
- Error (NULL, 0, 2000, "Invalid parameter", "StartLocation error");
- return EFI_ABORTED;
- }
-
- //
- // Read the first line
- //
- if (fgets (Buffer, _MAX_PATH, SourceFile) == NULL) {
- Buffer[0] = 0;
- }
-
- //
- // Make sure it matches the expected sym format
- //
- if (strcmp (Buffer, "TEXTSYM format | V1.0\n")) {
- fclose (SourceFile);
- fclose (DestFile);
- Error (NULL, 0, 2000, "Invalid parameter", "The symbol file does not match the expected TEXTSYM format (V1.0.)");
- return EFI_ABORTED;
- }
-
- //
- // Read in the file
- //
- while (feof (SourceFile) == 0) {
-
- //
- // Read a line
- //
- if (fscanf (SourceFile, "%s | %s | %s | %s\n", Type, Address, Section, Token) == 4) {
-
- //
- // Get the token address
- //
- AsciiStringToUint64 (Address, TRUE, &TokenAddress);
- if (TokenAddress > FileSize) {
- //
- // Symbol offset larger than FileSize. This Symbol can't be in Bin file. Don't print them.
- //
- break;
- }
-
- //
- // Add the base address, the size of the FFS file header and the size of the peim header.
- //
- TokenAddress += BaseAddress &~IPF_CACHE_BIT;
-
- fprintf (DestFile, "%s | %016llX | ", Type, (unsigned long long) TokenAddress);
- fprintf (DestFile, "%s | %s\n %s\n", Section, Token, BaseToken);
- }
- }
-
- fclose (SourceFile);
- fclose (DestFile);
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CalculateFitTableChecksum (
- VOID
- )
-/*++
-
-Routine Description:
-
- This function will perform byte checksum on the FIT table, if the the checksum required
- field is set to CheckSum required. If the checksum is not required then checksum byte
- will have value as 0;.
-
-Arguments:
-
- NONE
-
-Returns:
-
- Status - Value returned by call to CalculateChecksum8 ()
- EFI_SUCCESS - The function completed successfully
-
---*/
-{
- FIT_TABLE *TmpFitPtr;
- UINT64 FitTableAdd;
- UINT64 FitTableAddOffset;
- UINTN RelativeAddress;
- UINTN Size;
-
- //
- // Read the Fit Table address from Itanium-based address map.
- //
- FitTableAddOffset = Fv1EndAddress - (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT + SIZE_FIT_TABLE_ADD);
-
- //
- // Translate this Itanium-based address in terms of local buffer address which
- // contains the image for Boot Strapped File
- //
- GetRelativeAddressInVtfBuffer (FitTableAddOffset, &RelativeAddress, FIRST_VTF);
- FitTableAdd = *(UINTN *) RelativeAddress;
-
- GetRelativeAddressInVtfBuffer (FitTableAdd, &RelativeAddress, FIRST_VTF);
-
- TmpFitPtr = (FIT_TABLE *) RelativeAddress;
-
- Size = TmpFitPtr->CompSize * 16;
-
- if ((TmpFitPtr->CvAndType & CHECKSUM_BIT_MASK) >> 7) {
- TmpFitPtr->CheckSum = 0;
- TmpFitPtr->CheckSum = CalculateChecksum8 ((UINT8 *) TmpFitPtr, Size);
- } else {
- TmpFitPtr->CheckSum = 0;
- }
-
- return EFI_SUCCESS;
-}
-
-VOID
-Version (
- VOID
- )
-/*++
-
-Routine Description:
-
- Displays the standard utility information to SDTOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-VOID
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- Displays the utility usage syntax to STDOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- //
- // Summary usage
- //
- fprintf (stdout, "Usage: %s [options] <-f input_file> <-r BaseAddress> <-s FwVolumeSize>\n\n", UTILITY_NAME);
-
- //
- // Copyright declaration
- //
- fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
- //
- // Details Option
- //
- fprintf (stdout, "Options:\n");
- fprintf (stdout, " -f Input_file, --filename Input_file\n\
- Input_file is name of the BS Image INF file\n");
- fprintf (stdout, " -r BaseAddress, --baseaddr BaseAddress\n\
- BaseAddress is the starting address of Firmware Volume\n\
- where Boot Strapped Image will reside.\n");
- fprintf (stdout, " -s FwVolumeSize, --size FwVolumeSize\n\
- FwVolumeSize is the size of Firmware Volume.\n");
- fprintf (stdout, " -o FileName, --output FileName\n\
- File will be created to store the ouput content.\n");
- fprintf (stdout, " -v, --verbose Turn on verbose output with informational messages.\n");
- fprintf (stdout, " --version Show program's version number and exit.\n");
- fprintf (stdout, " -h, --help Show this help message and exit.\n");
- fprintf (stdout, " -q, --quiet Disable all messages except FATAL ERRORS.\n");
- fprintf (stdout, " -d, --debug [#, 0-9] Enable debug messages at level #.\n");
-}
-
-int
-main (
- IN int argc,
- IN char **argv
- )
-/*++
-
-Routine Description:
-
- This utility uses GenVtf.dll to build a Boot Strap File Image which will be
- part of firmware volume image.
-
-Arguments:
-
- argc - The count of the parameters
- argv - The parameters
-
-
-Returns:
-
- 0 - No error conditions detected.
- 1 - One or more of the input parameters is invalid.
- 2 - A resource required by the utility was unavailable.
- - Most commonly this will be memory allocation or file creation.
- 3 - GenFvImage.dll could not be loaded.
- 4 - Error executing the GenFvImage dll.
- 5 - Now this tool does not support the IA32 platform
-
---*/
-{
- UINT8 Index;
- UINT64 StartAddress1;
- UINT64 StartAddress2;
- UINT64 FwVolSize1;
- UINT64 FwVolSize2;
- BOOLEAN FirstRoundO;
- BOOLEAN FirstRoundB;
- BOOLEAN FirstRoundS;
- EFI_STATUS Status;
- FILE *VtfFP;
- CHAR8 *VtfFileName;
-
- SetUtilityName (UTILITY_NAME);
-
- //
- // Initialize variables
- //
- StartAddress1 = 0;
- StartAddress2 = 0;
- FwVolSize1 = 0;
- FwVolSize2 = 0;
- FirstRoundB = TRUE;
- FirstRoundS = TRUE;
- FirstRoundO = TRUE;
- DebugMode = FALSE;
- OutFileName1 = NULL;
- OutFileName2 = NULL;
- VtfFP = NULL;
- DebugLevel = 0;
-
- //
- // Verify the correct number of arguments
- //
- if (argc == 1) {
- Usage();
- return 0;
- }
-
- if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0)) {
- Usage();
- return 0;
- }
-
- if ((strcmp(argv[1], "--version") == 0)) {
- Version();
- return 0;
- }
-
- //
- // Parse the command line arguments
- //
- for (Index = 1; Index < argc; Index += 2) {
- if ((stricmp (argv[Index], "-o") == 0) || (stricmp (argv[Index], "--output") == 0)) {
- if (argv[Index + 1] == NULL || argv[Index + 1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Output file is missing for -o option");
- goto ERROR;
- }
- //
- // Get the output file name
- //
- VTF_OUTPUT = TRUE;
- if (FirstRoundO) {
- //
- // It's the first output file name
- //
- OutFileName1 = (CHAR8 *)argv[Index+1];
- FirstRoundO = FALSE;
- } else {
- //
- //It's the second output file name
- //
- OutFileName2 = (CHAR8 *)argv[Index+1];
- }
- continue;
- }
-
- if ((stricmp (argv[Index], "-f") == 0) || (stricmp (argv[Index], "--filename") == 0)) {
- if (argv[Index + 1] == NULL || argv[Index + 1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "BS Image INF file is missing for -f option");
- goto ERROR;
- }
- //
- // Get the input VTF file name
- //
- VtfFileName = argv[Index+1];
- VtfFP = fopen(VtfFileName, "rb");
- if (VtfFP == NULL) {
- Error (NULL, 0, 0001, "Error opening file", VtfFileName);
- goto ERROR;
- }
- continue;
- }
-
- if ((stricmp (argv[Index], "-r") == 0) || (stricmp (argv[Index], "--baseaddr") == 0)) {
- if (FirstRoundB) {
- Status = AsciiStringToUint64 (argv[Index + 1], FALSE, &StartAddress1);
- FirstRoundB = FALSE;
- } else {
- Status = AsciiStringToUint64 (argv[Index + 1], FALSE, &StartAddress2);
- }
- if (Status != EFI_SUCCESS) {
- Error (NULL, 0, 2000, "Invalid option value", "%s is Bad FV start address.", argv[Index + 1]);
- goto ERROR;
- }
- continue;
- }
-
- if ((stricmp (argv[Index], "-s") == 0) || (stricmp (argv[Index], "--size") == 0)) {
- if (FirstRoundS) {
- Status = AsciiStringToUint64 (argv[Index + 1], FALSE, &FwVolSize1);
- FirstRoundS = FALSE;
- } else {
- Status = AsciiStringToUint64 (argv[Index + 1], FALSE, &FwVolSize2);
- SecondVTF = TRUE;
- }
-
- if (Status != EFI_SUCCESS) {
- Error (NULL, 0, 2000, "Invalid option value", "%s is Bad FV size.", argv[Index + 1]);
- goto ERROR;
- }
- continue;
- }
-
- if ((stricmp (argv[Index], "-v") == 0) || (stricmp (argv[Index], "--verbose") == 0)) {
- VerboseMode = TRUE;
- Index--;
- continue;
- }
-
- if ((stricmp (argv[Index], "-q") == 0) || (stricmp (argv[Index], "--quiet") == 0)) {
- QuietMode = TRUE;
- Index--;
- continue;
- }
-
- if ((stricmp (argv[Index], "-d") == 0) || (stricmp (argv[Index], "--debug") == 0)) {
- //
- // debug level specified
- //
- Status = AsciiStringToUint64(argv[Index + 1], FALSE, &DebugLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[Index], argv[Index + 1]);
- goto ERROR;
- }
- if (DebugLevel > 9) {
- Error (NULL, 0, 2000, "Invalid option value", "Unrecognized argument %s.", argv[Index + 1]);
- goto ERROR;
- }
- if((DebugLevel <= 9) &&(DebugLevel >= 5)) {
- DebugMode = TRUE;
- } else {
- DebugMode = FALSE;
- }
- continue;
- }
-
- Error (NULL, 0, 2000, "Invalid parameter", "Unrecognized argument %s.", argv[Index]);
- goto ERROR;
- }
-
- if (VtfFP == NULL) {
- Error (NULL, 0, 2000, "Invalid parameter", "No BS Image INF file is specified");
- goto ERROR;
- }
-
- if (FirstRoundB) {
- Error (NULL, 0, 2000, "Invalid parameter", "No FV base address is specified");
- goto ERROR;
- }
-
- if (FirstRoundS) {
- Error (NULL, 0, 2000, "Invalid parameter", "No FV Size is specified");
- goto ERROR;
- }
- //
- // All Parameters has been parsed, now set the message print level
- //
- if (QuietMode) {
- SetPrintLevel(40);
- } else if (VerboseMode) {
- SetPrintLevel(15);
- } else if (DebugMode) {
- SetPrintLevel(DebugLevel);
- }
-
- if (VerboseMode) {
- VerboseMsg("%s tool start.\n", UTILITY_NAME);
- }
-
- if (VTF_OUTPUT == FALSE) {
- if (SecondVTF == TRUE) {
- OutFileName1 = VTF_OUTPUT_FILE1;
- OutFileName2 = VTF_OUTPUT_FILE2;
- } else {
- OutFileName1 = VTF_OUTPUT_FILE1;
- }
- SymFileName = VTF_SYM_FILE;
- } else {
- INTN OutFileNameLen = strlen(OutFileName1);
- INTN Index;
-
- for (Index = OutFileNameLen; Index > 0; --Index) {
- if (OutFileName1[Index] == '/' || OutFileName1[Index] == '\\') {
- break;
- }
- }
- if (Index == 0) {
- SymFileName = VTF_SYM_FILE;
- } else {
- INTN SymFileNameLen = Index + 1 + strlen(VTF_SYM_FILE);
- SymFileName = malloc(SymFileNameLen + 1);
- memcpy(SymFileName, OutFileName1, Index + 1);
- memcpy(SymFileName + Index + 1, VTF_SYM_FILE, strlen(VTF_SYM_FILE));
- SymFileName[SymFileNameLen] = '\0';
- }
- if (DebugMode) {
- DebugMsg(UTILITY_NAME, 0, DebugLevel, SymFileName, NULL);
- }
- }
-
- //
- // Call the GenVtfImage
- //
- if (DebugMode) {
- DebugMsg(UTILITY_NAME, 0, DebugLevel, "Start to generate the VTF image\n", NULL);
- }
- Status = GenerateVtfImage (StartAddress1, FwVolSize1, StartAddress2, FwVolSize2, VtfFP);
-
- if (EFI_ERROR (Status)) {
- switch (Status) {
-
- case EFI_INVALID_PARAMETER:
- Error (NULL, 0, 2000, "Invalid parameter", "Invalid parameter passed to GenVtf function.");
- break;
-
- case EFI_ABORTED:
- Error (NULL, 0, 3000, "Invalid", "Error detected while creating the file image.");
- break;
-
- case EFI_OUT_OF_RESOURCES:
- Error (NULL, 0, 4002, "Resource", "GenVtfImage function could not allocate required resources.");
- break;
-
- case EFI_VOLUME_CORRUPTED:
- Error (NULL, 0, 3000, "Invalid", "No base address was specified.");
- break;
-
- default:
- Error (NULL, 0, 3000, "Invalid", "GenVtfImage function returned unknown status %x.", (int) Status );
- break;
- }
- }
-ERROR:
- if (VtfFP != NULL) {
- fclose (VtfFP);
- }
-
- if (DebugMode) {
- DebugMsg(UTILITY_NAME, 0, DebugLevel, "VTF image generated successful\n", NULL);
- }
-
- if (VerboseMode) {
- VerboseMsg("%s tool done with return code is 0x%x.\n", UTILITY_NAME, GetUtilityStatus ());
- }
- return GetUtilityStatus();
-}
diff --git a/BaseTools/Source/C/GenVtf/GenVtf.h b/BaseTools/Source/C/GenVtf/GenVtf.h
deleted file mode 100644
index 8ebc8d25f3..0000000000
--- a/BaseTools/Source/C/GenVtf/GenVtf.h
+++ /dev/null
@@ -1,335 +0,0 @@
-/** @file
-
-Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
-Module Name:
-
- GenVtf.h
-
-Abstract:
-
- This file contains the relevant declarations required
- to generate Boot Strap File
-
-**/
-
-//
-// Module Coded to EFI 2.0 Coding Conventions
-//
-#ifndef __GEN_VTF_H__
-#define __GEN_VTF_H__
-
-//
-// External Files Referenced
-//
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifndef __GNUC__
-#include <io.h>
-#endif
-#include "assert.h"
-#include <Common/PiFirmwareFile.h>
-#include "ParseInf.h"
-
-//
-// Internal Constants
-//
-#define CV_N_TYPE(a,b) (UINT8)(((UINT8)a << 7) + (UINT8)b) // Keeps the CV and Type in same byte field
-#define MAKE_VERSION(a,b) (UINT16)(((UINT16)a << 8) + (UINT16)b)
-
-#define FILE_NAME_SIZE 256
-#define COMPONENT_NAME_SIZE 128
-#define VTF_INPUT_FILE "VTF.INF"
-#define VTF_OUTPUT_FILE1 "VTF1.RAW"
-#define VTF_OUTPUT_FILE2 "VTF2.RAW"
-#define VTF_SYM_FILE "Vtf.SYM"
-#define FIT_SIGNATURE "_FIT_ "
-
-//
-//Fit Type Definition
-//
-#define COMP_TYPE_FIT_HEADER 0x00
-#define COMP_TYPE_FIT_PAL_B 0x01
-
-//
-// This is generic PAL_A
-//
-#define COMP_TYPE_FIT_PAL_A 0x0F
-#define COMP_TYPE_FIT_PEICORE 0x10
-#define COMP_TYPE_FIT_AUTOSCAN 0x30
-#define COMP_TYPE_FIT_FV_BOOT 0x7E
-
-//
-//This is processor Specific PAL_A
-//
-#define COMP_TYPE_FIT_PAL_A_SPECIFIC 0x0E
-#define COMP_TYPE_FIT_UNUSED 0x7F
-
-#define FIT_TYPE_MASK 0x7F
-#define CHECKSUM_BIT_MASK 0x80
-
-//
-// IPF processor address is cached bit
-//
-#define IPF_CACHE_BIT 0x8000000000000000ULL
-
-//
-// Size definition to calculate the location from top of address for
-// each component
-//
-#define SIZE_IA32_RESET_VECT 0x10 // 16 Bytes
-#define SIZE_SALE_ENTRY_POINT 0x08 // 8 Byte
-#define SIZE_FIT_TABLE_ADD 0x08 // 8 Byte
-#define SIZE_FIT_TABLE_PAL_A 0x10
-#define SIZE_RESERVED 0x10
-
-
-#define SIZE_TO_OFFSET_PAL_A_END (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT + \
- SIZE_FIT_TABLE_ADD + SIZE_FIT_TABLE_PAL_A + \
- SIZE_RESERVED)
-#define SIZE_TO_PAL_A_FIT (SIZE_IA32_RESET_VECT + SIZE_SALE_ENTRY_POINT + \
- SIZE_FIT_TABLE_ADD + SIZE_FIT_TABLE_PAL_A)
-
-#define SIZE_OF_PAL_HEADER 0x40 //PAL has 64 byte header
-
-//
-// Utility Name
-//
-#define UTILITY_NAME "GenVtf"
-
-//
-// Utility version information
-//
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-#define UTILITY_DATE __DATE__
-
-//
-// The maximum number of arguments accepted from the command line.
-//
-#define ONE_VTF_ARGS 10
-#define TWO_VTF_ARGS 12
-#define THREE_VTF_ARGS 16
-
-static BOOLEAN VerboseMode = FALSE;
-
-//
-// Internal Data Structure
-//
-typedef enum _LOC_TYPE
-{
- NONE, // In case there is - INF file
- FIRST_VTF, // First VTF
- SECOND_VTF, // Outside VTF
-} LOC_TYPE;
-
-typedef struct _PARSED_VTF_INFO {
- CHAR8 CompName[COMPONENT_NAME_SIZE];
- LOC_TYPE LocationType;
- UINT8 CompType;
- UINT8 MajorVer;
- UINT8 MinorVer;
- UINT8 CheckSumRequired;
- BOOLEAN VersionPresent; // If it is TRUE, then, Version is in INF file
- BOOLEAN PreferredSize;
- BOOLEAN PreferredAddress;
- CHAR8 CompBinName[FILE_NAME_SIZE];
- CHAR8 CompSymName[FILE_NAME_SIZE];
- UINTN CompSize;
- UINT64 CompPreferredAddress;
- UINT32 Align;
-
- //
- // Fixed - warning C4133: '=' : incompatible types - from 'struct _ParsedVtfInfo *' to 'struct _PARSED_VTF_INFO *'
- // Fixed - warning C4133: '=' : incompatible types - from 'struct _ParsedVtfInfo *' to 'struct _PARSED_VTF_INFO *'
- // Fixed - warning C4133: '=' : incompatible types - from 'struct _ParsedVtfInfo *' to 'struct _PARSED_VTF_INFO *'
- // Fixed - warning C4133: '=' : incompatible types - from 'struct _ParsedVtfInfo *' to 'struct _PARSED_VTF_INFO *'
- //
- struct _PARSED_VTF_INFO *NextVtfInfo;
-} PARSED_VTF_INFO;
-
-#pragma pack (1)
-typedef struct {
- UINT64 CompAddress;
- UINT32 CompSize;
- UINT16 CompVersion;
- UINT8 CvAndType;
- UINT8 CheckSum;
-} FIT_TABLE;
-#pragma pack ()
-
-//
-// Function Prototype Declarations
-//
-
-EFI_STATUS
-UpdateVtfBuffer(
- IN UINT64 StartAddress,
- IN UINT8 *Buffer,
- IN UINT64 DataSize,
- IN LOC_TYPE LocType
- )
-/*++
-
-Routine Description:
-
- Update the Firmware Volume Buffer with requested buffer data
-
-Arguments:
-
- StartAddress - StartAddress in buffer. This number will automatically
- point to right address in buffer where data needed
- to be updated.
- Buffer - Buffer pointer from data will be copied to memory mapped buffer.
- DataSize - Size of the data needed to be copied.
- LocType - The type of the VTF
-
-Returns:
-
- EFI_ABORTED - The input parameter is error
- EFI_SUCCESS - The function completed successfully
-
---*/
-;
-
-EFI_STATUS
-UpdateSymFile (
- IN UINT64 BaseAddress,
- IN CHAR8 *DestFileName,
- IN CHAR8 *SourceFileName,
- IN UINT64 FileSize
- )
-/*++
-
-Routine Description:
-
- This function adds the SYM tokens in the source file to the destination file.
- The SYM tokens are updated to reflect the base address.
-
-Arguments:
-
- BaseAddress - The base address for the new SYM tokens.
- DestFileName - The destination file.
- SourceFileName - The source file.
- FileSize - Size of bin file.
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully.
- EFI_INVALID_PARAMETER - One of the input parameters was invalid.
- EFI_ABORTED - An error occurred.
-
---*/
-;
-
-EFI_STATUS
-CalculateFitTableChecksum (
- VOID
- )
-/*++
-
-Routine Description:
-
- This function will perform byte checksum on the FIT table, if the the checksum required
- field is set to CheckSum required. If the checksum is not required then checksum byte
- will have value as 0;.
-
-Arguments:
-
- NONE
-
-Returns:
-
- Status - Value returned by call to CalculateChecksum8 ()
- EFI_SUCCESS - The function completed successfully
-
---*/
-;
-
-EFI_STATUS
-GenerateVtfImage (
- IN UINT64 StartAddress1,
- IN UINT64 Size1,
- IN UINT64 StartAddress2,
- IN UINT64 Size2,
- IN FILE *fp
- )
-/*++
-
-Routine Description:
-
- This is the main function which will be called from application.
-
-Arguments:
-
- StartAddress1 - The start address of the first VTF
- Size1 - The size of the first VTF
- StartAddress2 - The start address of the second VTF
- Size2 - The size of the second VTF
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - Can not allocate memory
- The return value can be any of the values
- returned by the calls to following functions:
- GetVtfRelatedInfoFromInfFile
- ProcessAndCreateVtf
- UpdateIA32ResetVector
- UpdateFfsHeader
- WriteVtfBinary
-
---*/
-;
-
-EFI_STATUS
-PeimFixupInFitTable (
- IN UINT64 StartAddress
- )
-/*++
-
-Routine Description:
-
- This function is an entry point to fixup SAL-E entry point.
-
-Arguments:
-
- StartAddress - StartAddress for PEIM.....
-
-Returns:
-
- EFI_SUCCESS - The function completed successfully
- EFI_ABORTED - Error Opening File
-
---*/
-;
-
-VOID
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- Displays the utility usage syntax to STDOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-;
-#endif
diff --git a/BaseTools/Source/C/GenVtf/Makefile b/BaseTools/Source/C/GenVtf/Makefile
deleted file mode 100644
index 957f25bd16..0000000000
--- a/BaseTools/Source/C/GenVtf/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'GenVtf' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = GenVtf
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = GenVtf.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/GnuGenBootSector/FatFormat.h b/BaseTools/Source/C/GnuGenBootSector/FatFormat.h
deleted file mode 100644
index 1f77e879b3..0000000000
--- a/BaseTools/Source/C/GnuGenBootSector/FatFormat.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/** @file
-
- Fat file system structure and definition.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
---*/
-
-#ifndef _FAT_BPB_H_
-#define _FAT_BPB_H_
-
-#include "CommonLib.h"
-
-#pragma pack(1)
-
-typedef struct {
- //
- // Fat common field
- //
- UINT8 BS_jmpBoot[3];
- CHAR8 BS_OEMName[8];
- UINT16 BPB_BytsPerSec;
- UINT8 BPB_SecPerClus;
- UINT16 BPB_RsvdSecCnt;
- UINT8 BPB_NumFATs;
- UINT16 BPB_RootEntCnt;
- UINT16 BPB_TotSec16;
- UINT8 BPB_Media;
- UINT16 BPB_FATSz16;
- UINT16 BPB_SecPerTrk;
- UINT16 BPB_NumHeads;
- UINT32 BPB_HiddSec;
- UINT32 BPB_TotSec32;
-
- //
- // Fat12/16 specific field
- //
- UINT8 BS_DrvNum;
- UINT8 BS_Reserved1;
- UINT8 BS_BootSig;
- UINT32 BS_VolID;
- CHAR8 BS_VolLab[11];
- CHAR8 BS_FilSysType[8];
-
- //
- // Boot Code and Data
- //
- UINT8 Reserved[448];
-
- //
- // Fat common signature - 0xAA55
- //
- UINT16 Signature;
-} FAT12_16_BPB_STRUCT;
-
-typedef struct {
- //
- // Fat common field
- //
- UINT8 BS_jmpBoot[3];
- CHAR8 BS_OEMName[8];
- UINT16 BPB_BytsPerSec;
- UINT8 BPB_SecPerClus;
- UINT16 BPB_RsvdSecCnt;
- UINT8 BPB_NumFATs;
- UINT16 BPB_RootEntCnt;
- UINT16 BPB_TotSec16;
- UINT8 BPB_Media;
- UINT16 BPB_FATSz16;
- UINT16 BPB_SecPerTrk;
- UINT16 BPB_NumHeads;
- UINT32 BPB_HiddSec;
- UINT32 BPB_TotSec32;
-
- //
- // Fat32 specific field
- //
- UINT32 BPB_FATSz32;
- UINT16 BPB_ExtFlags;
- UINT16 BPB_FSVer;
- UINT32 BPB_RootClus;
- UINT16 BPB_FSInfo;
- UINT16 BPB_BkBootSec;
- UINT8 BPB_Reserved[12];
- UINT8 BS_DrvNum;
- UINT8 BS_Reserved1;
- UINT8 BS_BootSig;
- UINT32 BS_VolID;
- CHAR8 BS_VolLab[11];
- CHAR8 BS_FilSysType[8];
-
- //
- // Boot Code and Data
- //
- UINT8 Reserved[420];
-
- //
- // Fat common signature - 0xAA55
- //
- UINT16 Signature;
-} FAT32_BPB_STRUCT;
-
-typedef union {
- FAT12_16_BPB_STRUCT Fat12_16;
- FAT32_BPB_STRUCT Fat32;
-} FAT_BPB_STRUCT;
-
-typedef enum {
- FatTypeUnknown,
- FatTypeFat12,
- FatTypeFat16,
- FatTypeFat32,
- FatTypeMax
-} FAT_TYPE;
-
-typedef struct {
- CHAR8 DIR_Name[11];
- UINT8 DIR_Attr;
- UINT8 DIR_NTRes;
- UINT8 DIR_CrtTimeTenth;
- UINT16 DIR_CrtTime;
- UINT16 DIR_CrtDate;
- UINT16 DIR_LstAccDate;
- UINT16 DIR_FstClusHI;
- UINT16 DIR_WrtTime;
- UINT16 DIR_WrtDate;
- UINT16 DIR_FstClusLO;
- UINT32 DIR_FileSize;
-} FAT_DIRECTORY_ENTRY;
-
-#pragma pack()
-
-#define FAT_MAX_FAT12_CLUSTER 0xFF5
-#define FAT_MAX_FAT16_CLUSTER 0xFFF5
-
-#define FAT_BS_SIGNATURE 0xAA55
-#define FAT_BS_BOOTSIG 0x29
-#define FAT_BS_JMP1 0xEB
-#define FAT_BS_JMP2 0xE9
-#define FAT_FILSYSTYPE "FAT "
-#define FAT12_FILSYSTYPE "FAT12 "
-#define FAT16_FILSYSTYPE "FAT16 "
-#define FAT32_FILSYSTYPE "FAT32 "
-
-#endif
diff --git a/BaseTools/Source/C/GnuGenBootSector/GNUmakefile b/BaseTools/Source/C/GnuGenBootSector/GNUmakefile
deleted file mode 100644
index e9d32f8195..0000000000
--- a/BaseTools/Source/C/GnuGenBootSector/GNUmakefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# GNU/Linux makefile for 'GnuGenBootSector' module build.
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = GnuGenBootSector
-
-LIBS = -lCommon
-
-OBJECTS = GnuGenBootSector.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
diff --git a/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c b/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
deleted file mode 100644
index b0ec271b05..0000000000
--- a/BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- GnuGenBootSector.c
-
-Abstract:
- Reading/writing MBR/DBR.
- NOTE:
- If we write MBR to disk, we just update the MBR code and the partition table wouldn't be over written.
- If we process DBR, we will patch MBR to set first partition active if no active partition exists.
-
-**/
-
-#include "CommonLib.h"
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <Common/UefiBaseTypes.h>
-
-#include "ParseInf.h"
-#include "EfiUtilityMsgs.h"
-
-//
-// Utility Name
-//
-#define UTILITY_NAME "GnuGenBootSector"
-
-//
-// Utility version information
-//
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-#define MAX_DRIVE 26
-#define PARTITION_TABLE_OFFSET 0x1BE
-
-#define SIZE_OF_PARTITION_ENTRY 0x10
-
-#define PARTITION_ENTRY_STARTLBA_OFFSET 8
-
-#define PARTITION_ENTRY_NUM 4
-
-#define DRIVE_UNKNOWN 0
-#define DRIVE_NO_ROOT_DIR 1
-#define DRIVE_REMOVABLE 2
-#define DRIVE_FIXED 3
-#define DRIVE_REMOTE 4
-#define DRIVE_CDROM 5
-#define DRIVE_RAMDISK 6
-
-typedef struct _DRIVE_TYPE_DESC {
- UINTN Type;
- CHAR8 *Description;
-} DRIVE_TYPE_DESC;
-
-#define DRIVE_TYPE_ITEM(x) {x, #x}
-
-DRIVE_TYPE_DESC DriveTypeDesc[] = {
- DRIVE_TYPE_ITEM (DRIVE_UNKNOWN),
- DRIVE_TYPE_ITEM (DRIVE_NO_ROOT_DIR),
- DRIVE_TYPE_ITEM (DRIVE_REMOVABLE),
- DRIVE_TYPE_ITEM (DRIVE_FIXED),
- DRIVE_TYPE_ITEM (DRIVE_REMOTE),
- DRIVE_TYPE_ITEM (DRIVE_CDROM),
- DRIVE_TYPE_ITEM (DRIVE_RAMDISK),
- {(UINTN) -1, NULL}
-};
-
-typedef struct _DRIVE_INFO {
- CHAR8 VolumeLetter;
- DRIVE_TYPE_DESC *DriveType;
- UINTN DiskNumber;
-} DRIVE_INFO;
-
-typedef enum {
- PathUnknown,
- PathFile,
- PathFloppy,
- PathUsb,
- PathIde
-} PATH_TYPE;
-
-typedef struct _PATH_INFO {
- CHAR8 *Path;
- CHAR8 PhysicalPath[260];
- PATH_TYPE Type;
- BOOLEAN Input;
-} PATH_INFO;
-
-typedef enum {
- ErrorSuccess,
- ErrorFileCreate,
- ErrorFileReadWrite,
- ErrorNoMbr,
- ErrorFatType,
- ErrorPath,
-} ERROR_STATUS;
-
-CHAR8 *ErrorStatusDesc[] = {
- "Success",
- "Failed to create files",
- "Failed to read/write files",
- "No MBR exists",
- "Failed to detect Fat type",
- "Inavlid path"
-};
-
-
-//UnSupported Windows API functions.
-UINTN GetLogicalDrives(void) { return 1; }
-
-
-
-/**
- Get path information, including physical path for Linux platform.
-
- @param PathInfo Point to PATH_INFO structure.
-
- @return whether path is valid.
-**/
-ERROR_STATUS
-GetPathInfo (
- PATH_INFO *PathInfo
- )
-{
- FILE *f;
-
- if (strncmp(PathInfo->Path, "/dev/", 5) == 0) {
- //
- // Process disk path here.
- //
-
- // Process floppy disk
- if (PathInfo->Path[5] == 'f' && PathInfo->Path[6] == 'd' && PathInfo->Path[8] == '\0') {
- PathInfo->Type = PathFloppy;
- strcpy (PathInfo->PhysicalPath, PathInfo->Path);
-
- return ErrorSuccess;
- } else {
- // Other disk types is not supported yet.
- fprintf (stderr, "ERROR: It's not a floppy disk!\n");
- return ErrorPath;
- }
-
- // Try to open the device.
- f = fopen(PathInfo->Path,"r");
- if (f == NULL) {
- printf ("error :open device failed!\n");
- return ErrorPath;
- }
- fclose (f);
- return ErrorSuccess;
- }
-
- // Process file path here.
- PathInfo->Type = PathFile;
- if (PathInfo->Input) {
- // If path is file path, check whether file is valid.
- printf("Path = %s\n",PathInfo->Path);
- f = fopen (PathInfo->Path, "r");
- if (f == NULL) {
- fprintf (stderr, "Test error E2003: File was not provided!\n");
- return ErrorPath;
- }
- fclose (f);
- }
-
- strcpy(PathInfo->PhysicalPath, PathInfo->Path);
- return ErrorSuccess;
-
-}
-
-VOID
-ListDrive (
- VOID
- )
-{
- printf("-l or -list not supported!\n");
-}
-
-/**
- Writing or reading boot sector or MBR according to the argument.
-
- @param InputInfo PATH_INFO instance for input path
- @param OutputInfo PATH_INFO instance for output path
- @param ProcessMbr TRUE is to process MBR, otherwise, processing boot sector
-
- @return ERROR_STATUS
- **/
-ERROR_STATUS
-ProcessBsOrMbr (
- PATH_INFO *InputInfo,
- PATH_INFO *OutputInfo,
- BOOLEAN ProcessMbr
- )
-{
- CHAR8 FirstSector[0x200] = {0};
- CHAR8 FirstSectorBackup[0x200] = {0};
-
- FILE *InputFile;
- FILE *OutputFile;
-
-
- InputFile = fopen(InputInfo->PhysicalPath, "r");
- if (InputFile == NULL) {
- return ErrorFileReadWrite;
- }
-
- if (0x200 != fread(FirstSector, 1, 0x200, InputFile)) {
- fclose(InputFile);
- return ErrorFileReadWrite;
- }
-
- fclose(InputFile);
-
- //Not support USB and IDE.
- if (InputInfo->Type == PathUsb) {
- printf("USB has not been supported yet!");
- return ErrorSuccess;
- }
-
- if (InputInfo->Type == PathIde) {
- printf("IDE has not been supported yet!");
- return ErrorSuccess;
- }
-
- //Process Floppy Disk
- OutputFile = fopen(OutputInfo->PhysicalPath, "r+");
- if (OutputFile == NULL) {
- OutputFile = fopen(OutputInfo->PhysicalPath, "w");
- if (OutputFile == NULL) {
- return ErrorFileReadWrite;
- }
- }
-
- if (OutputInfo->Type != PathFile) {
- if (ProcessMbr) {
- //
- // Use original partition table
- //
- if (0x200 != fread (FirstSectorBackup, 1, 0x200, OutputFile)) {
- fclose(OutputFile);
- return ErrorFileReadWrite;
- }
- memcpy (FirstSector + 0x1BE, FirstSectorBackup + 0x1BE, 0x40);
- }
- }
- if(0x200 != fwrite(FirstSector, 1, 0x200, OutputFile)) {
- fclose(OutputFile);
- return ErrorFileReadWrite;
- }
-
- fclose(OutputFile);
- return ErrorSuccess;
-}
-
-
-/**
-
- Displays the standard utility information to SDTOUT
-
-**/
-VOID
-Version (
- VOID
- )
-{
- printf ("%s v%d.%d %s-Utility to retrieve and update the boot sector or MBR.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
- printf ("Copyright (c) 2007-2010 Intel Corporation. All rights reserved.\n");
-}
-
-
-VOID
-PrintUsage (
- VOID
- )
-{
- Version();
- printf ("\nUsage: \n\
- GenBootSector\n\
- [-l, --list list disks]\n\
- [-i, --input Filename]\n\
- [-o, --output Filename]\n\
- [-m, --mbr process the MBR also]\n\
- [-v, --verbose]\n\
- [--version]\n\
- [-q, --quiet disable all messages except fatal errors]\n\
- [-d, --debug[#]\n\
- [-h, --help]\n");
-}
-
-int
-main (
- int argc,
- char *argv[]
- )
-{
- INTN Index;
- BOOLEAN ProcessMbr;
- ERROR_STATUS Status;
- EFI_STATUS EfiStatus;
- PATH_INFO InputPathInfo;
- PATH_INFO OutputPathInfo;
- UINT64 LogLevel;
-
- SetUtilityName (UTILITY_NAME);
-
- ZeroMem(&InputPathInfo, sizeof(PATH_INFO));
- ZeroMem(&OutputPathInfo, sizeof(PATH_INFO));
-
- argv ++;
- argc --;
-
- ProcessMbr = FALSE;
-
- if (argc == 0) {
- PrintUsage();
- return 0;
- }
-
- //
- // Parse command line
- //
- for (Index = 0; Index < argc; Index ++) {
- if ((stricmp (argv[Index], "-l") == 0) || (stricmp (argv[Index], "--list") == 0)) {
- ListDrive ();
- return 0;
- }
-
- if ((stricmp (argv[Index], "-m") == 0) || (stricmp (argv[Index], "--mbr") == 0)) {
- ProcessMbr = TRUE;
- continue;
- }
-
- if ((stricmp (argv[Index], "-i") == 0) || (stricmp (argv[Index], "--input") == 0)) {
- InputPathInfo.Path = argv[Index + 1];
- InputPathInfo.Input = TRUE;
- if (InputPathInfo.Path == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Input file name can't be NULL");
- return 1;
- }
- if (InputPathInfo.Path[0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Input file is missing");
- return 1;
- }
- ++Index;
- continue;
- }
-
- if ((stricmp (argv[Index], "-o") == 0) || (stricmp (argv[Index], "--output") == 0)) {
- OutputPathInfo.Path = argv[Index + 1];
- OutputPathInfo.Input = FALSE;
- if (OutputPathInfo.Path == NULL) {
- Error (NULL, 0, 1003, "Invalid option value", "Output file name can't be NULL");
- return 1;
- }
- if (OutputPathInfo.Path[0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Output file is missing");
- return 1;
- }
- ++Index;
- continue;
- }
-
- if ((stricmp (argv[Index], "-h") == 0) || (stricmp (argv[Index], "--help") == 0)) {
- PrintUsage ();
- return 0;
- }
-
- if (stricmp (argv[Index], "--version") == 0) {
- Version ();
- return 0;
- }
-
- if ((stricmp (argv[Index], "-v") == 0) || (stricmp (argv[Index], "--verbose") == 0)) {
- continue;
- }
-
- if ((stricmp (argv[Index], "-q") == 0) || (stricmp (argv[Index], "--quiet") == 0)) {
- continue;
- }
-
- if ((stricmp (argv[Index], "-d") == 0) || (stricmp (argv[Index], "--debug") == 0)) {
- EfiStatus = AsciiStringToUint64 (argv[Index + 1], FALSE, &LogLevel);
- if (EFI_ERROR (EfiStatus)) {
- Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[Index], argv[Index + 1]);
- return 1;
- }
- if (LogLevel > 9) {
- Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, currnt input level is %d", (int) LogLevel);
- return 1;
- }
- SetPrintLevel (LogLevel);
- DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", argv[Index + 1]);
- ++Index;
- continue;
- }
-
- //
- // Don't recognize the parameter.
- //
- Error (NULL, 0, 1000, "Unknown option", "%s", argv[Index]);
- return 1;
- }
-
- if (InputPathInfo.Path == NULL) {
- Error (NULL, 0, 1001, "Missing options", "Input file is missing");
- return 1;
- }
-
- if (OutputPathInfo.Path == NULL) {
- Error (NULL, 0, 1001, "Missing options", "Output file is missing");
- return 1;
- }
-
- if (GetPathInfo(&InputPathInfo) != ErrorSuccess) {
- Error (NULL, 0, 1003, "Invalid option value", "Input file can't be found.");
- return 1;
- }
-
- if (GetPathInfo(&OutputPathInfo) != ErrorSuccess) {
- Error (NULL, 0, 1003, "Invalid option value", "Output file can't be found.");
- return 1;
- }
-
- //
- // Process DBR (Patch or Read)
- //
- Status = ProcessBsOrMbr (&InputPathInfo, &OutputPathInfo, ProcessMbr);
-
- if (Status == ErrorSuccess) {
- fprintf (
- stdout,
- "%s %s: successful!\n",
- (OutputPathInfo.Type != PathFile) ? "Write" : "Read",
- ProcessMbr ? "MBR" : "DBR"
- );
- return 0;
- } else {
- fprintf (
- stderr,
- "%s: %s %s: failed - %s (LastError: 0x%x)!\n",
- (Status == ErrorNoMbr) ? "WARNING" : "ERROR",
- (OutputPathInfo.Type != PathFile) ? "Write" : "Read",
- ProcessMbr ? "MBR" : "DBR",
- ErrorStatusDesc[Status],
- errno
- );
- return 1;
- }
-}
diff --git a/BaseTools/Source/C/Include/AArch64/ProcessorBind.h b/BaseTools/Source/C/Include/AArch64/ProcessorBind.h
deleted file mode 100644
index 4d184c4c41..0000000000
--- a/BaseTools/Source/C/Include/AArch64/ProcessorBind.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/** @file
- Processor or Compiler specific defines and types for AArch64.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
- Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PROCESSOR_BIND_H__
-#define __PROCESSOR_BIND_H__
-
-///
-/// Define the processor type so other code can make processor based choices
-///
-#define MDE_CPU_AARCH64
-
-//
-// Make sure we are using the correct packing rules per EFI specification
-//
-#ifndef __GNUC__
-#pragma pack()
-#endif
-
-#if _MSC_EXTENSIONS
- //
- // use Microsoft* C complier dependent integer width types
- //
- typedef unsigned __int64 UINT64;
- typedef __int64 INT64;
- typedef unsigned __int32 UINT32;
- typedef __int32 INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef signed char INT8;
-#else
- //
- // Assume standard AARCH64 alignment.
- //
- typedef unsigned long long UINT64;
- typedef long long INT64;
- typedef unsigned int UINT32;
- typedef int INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef signed char INT8;
-
- #define UINT8_MAX 0xff
-#endif
-
-///
-/// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
-/// 8 bytes on supported 64-bit processor instructions)
-///
-typedef UINT64 UINTN;
-
-///
-/// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
-/// 8 bytes on supported 64-bit processor instructions)
-///
-typedef INT64 INTN;
-
-//
-// Processor specific defines
-//
-
-///
-/// A value of native width with the highest bit set.
-///
-#define MAX_BIT 0x8000000000000000
-
-///
-/// A value of native width with the two highest bits set.
-///
-#define MAX_2_BITS 0xC000000000000000
-
-///
-/// Maximum legal AARCH64 address
-///
-#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
-
-///
-/// The stack alignment required for AARCH64
-///
-#define CPU_STACK_ALIGNMENT 16
-
-//
-// Modifier to ensure that all protocol member functions and EFI intrinsics
-// use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify their member functions with EFIAPI.
-//
-#define EFIAPI
-
-#if defined(__GNUC__)
- ///
- /// For GNU assembly code, .global or .globl can declare global symbols.
- /// Define this macro to unify the usage.
- ///
- #define ASM_GLOBAL .globl
-
- #if !defined(__APPLE__)
- ///
- /// ARM EABI defines that the linker should not manipulate call relocations
- /// (do bl/blx conversion) unless the target symbol has function type.
- /// CodeSourcery 2010.09 started requiring the .type to function properly
- ///
- #define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function
-
- #define GCC_ASM_EXPORT(func__) \
- .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
- .type ASM_PFX(func__), %function
-
- #define GCC_ASM_IMPORT(func__) \
- .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
-
- #else
- //
- // .type not supported by Apple Xcode tools
- //
- #define INTERWORK_FUNC(func__)
-
- #define GCC_ASM_EXPORT(func__) \
- .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
-
- #define GCC_ASM_IMPORT(name)
-
- #endif
-#endif
-
-/**
- Return the pointer to the first instruction of a function given a function pointer.
- On ARM CPU architectures, these two pointer values are the same,
- so the implementation of this macro is very simple.
-
- @param FunctionPointer A pointer to a function.
-
- @return The pointer to the first instruction of a function given a function pointer.
-
-**/
-#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
-
-#endif
-
diff --git a/BaseTools/Source/C/Include/Arm/ProcessorBind.h b/BaseTools/Source/C/Include/Arm/ProcessorBind.h
deleted file mode 100644
index 1ca26ab6f3..0000000000
--- a/BaseTools/Source/C/Include/Arm/ProcessorBind.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/** @file
- Processor or Compiler specific defines and types for ARM.
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PROCESSOR_BIND_H__
-#define __PROCESSOR_BIND_H__
-
-///
-/// Define the processor type so other code can make processor based choices
-///
-#define MDE_CPU_ARM
-
-//
-// Make sure we are using the correct packing rules per EFI specification
-//
-#ifndef __GNUC__
-#pragma pack()
-#endif
-
-#if _MSC_EXTENSIONS
- //
- // use Microsoft* C complier dependent integer width types
- //
- typedef unsigned __int64 UINT64;
- typedef __int64 INT64;
- typedef unsigned __int32 UINT32;
- typedef __int32 INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef signed char INT8;
-#else
- //
- // Assume standard ARM alignment.
- //
- typedef unsigned long long UINT64;
- typedef long long INT64;
- typedef unsigned int UINT32;
- typedef int INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef signed char INT8;
-
- #define UINT8_MAX 0xff
-#endif
-
-///
-/// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
-/// 8 bytes on supported 64-bit processor instructions)
-///
-typedef UINT32 UINTN;
-
-///
-/// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
-/// 8 bytes on supported 64-bit processor instructions)
-///
-typedef INT32 INTN;
-
-//
-// Processor specific defines
-//
-
-///
-/// A value of native width with the highest bit set.
-///
-#define MAX_BIT 0x80000000
-
-///
-/// A value of native width with the two highest bits set.
-///
-#define MAX_2_BITS 0xC0000000
-
-///
-/// Maximum legal ARM address
-///
-#define MAX_ADDRESS 0xFFFFFFFF
-
-///
-/// The stack alignment required for ARM
-///
-#define CPU_STACK_ALIGNMENT sizeof(UINT64)
-
-//
-// Modifier to ensure that all protocol member functions and EFI intrinsics
-// use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify their member functions with EFIAPI.
-//
-#define EFIAPI
-
-#if defined(__GNUC__)
- ///
- /// For GNU assembly code, .global or .globl can declare global symbols.
- /// Define this macro to unify the usage.
- ///
- #define ASM_GLOBAL .globl
-
- #if !defined(__APPLE__)
- ///
- /// ARM EABI defines that the linker should not manipulate call relocations
- /// (do bl/blx conversion) unless the target symbol has function type.
- /// CodeSourcery 2010.09 started requiring the .type to function properly
- ///
- #define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function
-
- #define GCC_ASM_EXPORT(func__) \
- .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
- .type ASM_PFX(func__), %function
-
- #define GCC_ASM_IMPORT(func__) \
- .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
-
- #else
- //
- // .type not supported by Apple Xcode tools
- //
- #define INTERWORK_FUNC(func__)
-
- #define GCC_ASM_EXPORT(func__) \
- .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
-
- #define GCC_ASM_IMPORT(name)
-
- #endif
-#endif
-
-/**
- Return the pointer to the first instruction of a function given a function pointer.
- On ARM CPU architectures, these two pointer values are the same,
- so the implementation of this macro is very simple.
-
- @param FunctionPointer A pointer to a function.
-
- @return The pointer to the first instruction of a function given a function pointer.
-
-**/
-#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
-
-#endif
-
-
diff --git a/BaseTools/Source/C/Include/Common/BaseTypes.h b/BaseTools/Source/C/Include/Common/BaseTypes.h
deleted file mode 100644
index 27934375ce..0000000000
--- a/BaseTools/Source/C/Include/Common/BaseTypes.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/** @file
- Processor or Compiler specific defines for all supported processors.
-
- This file is stand alone self consistent set of definitions.
-
- Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: BaseTypes.h
-
-**/
-
-#ifndef __BASE_TYPES_H__
-#define __BASE_TYPES_H__
-
-//
-// Include processor specific binding
-//
-#include <ProcessorBind.h>
-#include <stdarg.h>
-
-//
-// Modifiers to abstract standard types to aid in debug of problems
-//
-#define CONST const
-#define STATIC static
-#define VOID void
-
-//
-// Modifiers for Data Types used to self document code.
-// This concept is borrowed for UEFI specification.
-//
-#ifndef IN
-//
-// Some other environments use this construct, so #ifndef to prevent
-// multiple definition.
-//
-#define IN
-#define OUT
-#define OPTIONAL
-#endif
-
-//
-// Constants. They may exist in other build structures, so #ifndef them.
-//
-#ifndef TRUE
-//
-// BugBug: UEFI specification claims 1 and 0. We are concerned about the
-// complier portability so we did it this way.
-//
-#define TRUE ((BOOLEAN)(1==1))
-#endif
-
-#ifndef FALSE
-#define FALSE ((BOOLEAN)(0==1))
-#endif
-
-#ifndef NULL
-#define NULL ((VOID *) 0)
-#endif
-
-//
-// Support for variable length argument lists using the ANSI standard.
-//
-// Since we are using the ANSI standard we used the standard naming and
-// did not follow the coding convention
-//
-// VA_LIST - typedef for argument list.
-// VA_START (VA_LIST Marker, argument before the ...) - Init Marker for use.
-// VA_END (VA_LIST Marker) - Clear Marker
-// VA_ARG (VA_LIST Marker, var arg size) - Use Marker to get an argument from
-// the ... list. You must know the size and pass it in this macro.
-//
-// example:
-//
-// UINTN
-// ExampleVarArg (
-// IN UINTN NumberOfArgs,
-// ...
-// )
-// {
-// VA_LIST Marker;
-// UINTN Index;
-// UINTN Result;
-//
-// //
-// // Initialize the Marker
-// //
-// VA_START (Marker, NumberOfArgs);
-// for (Index = 0, Result = 0; Index < NumberOfArgs; Index++) {
-// //
-// // The ... list is a series of UINTN values, so average them up.
-// //
-// Result += VA_ARG (Marker, UINTN);
-// }
-//
-// VA_END (Marker);
-// return Result
-// }
-//
-
-#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))
-
-//
-// Also support coding convention rules for var arg macros
-//
-#ifndef VA_START
-
-// typedef CHAR8 *VA_LIST;
-// #define VA_START(ap, v) (ap = (VA_LIST) & (v) + _INT_SIZE_OF (v))
-// #define VA_ARG(ap, t) (*(t *) ((ap += _INT_SIZE_OF (t)) - _INT_SIZE_OF (t)))
-// #define VA_END(ap) (ap = (VA_LIST) 0)
-// Use the native arguments for tools.
-#define VA_START va_start
-#define VA_ARG va_arg
-#define VA_END va_end
-#define VA_LIST va_list
-
-#endif
-
-//
-// Macro that returns the byte offset of a field in a data structure.
-//
-#define OFFSET_OF(TYPE, Field) ((UINTN) &(((TYPE *)0)->Field))
-
-///
-/// _CR - returns a pointer to the structure
-/// from one of it's elements.
-///
-#define _CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field)))
-
-///
-/// ALIGN_POINTER - aligns a pointer to the lowest boundary
-///
-#define ALIGN_POINTER(p, s) ((VOID *) ((UINTN)(p) + (((s) - ((UINTN) (p))) & ((s) - 1))))
-
-///
-/// ALIGN_VARIABLE - aligns a variable up to the next natural boundary for int size of a processor
-///
-#define ALIGN_VARIABLE(Value, Adjustment) \
- Adjustment = 0U; \
- if ((UINTN) (Value) % sizeof (UINTN)) { \
- (Adjustment) = (UINTN)(sizeof (UINTN) - ((UINTN) (Value) % sizeof (UINTN))); \
- } \
- (Value) = (UINTN)((UINTN) (Value) + (UINTN) (Adjustment))
-
-//
-// Return the maximum of two operands.
-// This macro returns the maximum of two operand specified by a and b.
-// Both a and b must be the same numerical types, signed or unsigned.
-//
-#define MAX(a, b) \
- (((a) > (b)) ? (a) : (b))
-
-
-//
-// Return the minimum of two operands.
-// This macro returns the minimal of two operand specified by a and b.
-// Both a and b must be the same numerical types, signed or unsigned.
-//
-#define MIN(a, b) \
- (((a) < (b)) ? (a) : (b))
-
-
-//
-// EFI Error Codes common to all execution phases
-//
-
-typedef INTN RETURN_STATUS;
-
-///
-/// Set the upper bit to indicate EFI Error.
-///
-#define ENCODE_ERROR(a) (MAX_BIT | (a))
-
-#define ENCODE_WARNING(a) (a)
-#define RETURN_ERROR(a) ((a) < 0)
-
-#define RETURN_SUCCESS 0
-#define RETURN_LOAD_ERROR ENCODE_ERROR (1)
-#define RETURN_INVALID_PARAMETER ENCODE_ERROR (2)
-#define RETURN_UNSUPPORTED ENCODE_ERROR (3)
-#define RETURN_BAD_BUFFER_SIZE ENCODE_ERROR (4)
-#define RETURN_BUFFER_TOO_SMALL ENCODE_ERROR (5)
-#define RETURN_NOT_READY ENCODE_ERROR (6)
-#define RETURN_DEVICE_ERROR ENCODE_ERROR (7)
-#define RETURN_WRITE_PROTECTED ENCODE_ERROR (8)
-#define RETURN_OUT_OF_RESOURCES ENCODE_ERROR (9)
-#define RETURN_VOLUME_CORRUPTED ENCODE_ERROR (10)
-#define RETURN_VOLUME_FULL ENCODE_ERROR (11)
-#define RETURN_NO_MEDIA ENCODE_ERROR (12)
-#define RETURN_MEDIA_CHANGED ENCODE_ERROR (13)
-#define RETURN_NOT_FOUND ENCODE_ERROR (14)
-#define RETURN_ACCESS_DENIED ENCODE_ERROR (15)
-#define RETURN_NO_RESPONSE ENCODE_ERROR (16)
-#define RETURN_NO_MAPPING ENCODE_ERROR (17)
-#define RETURN_TIMEOUT ENCODE_ERROR (18)
-#define RETURN_NOT_STARTED ENCODE_ERROR (19)
-#define RETURN_ALREADY_STARTED ENCODE_ERROR (20)
-#define RETURN_ABORTED ENCODE_ERROR (21)
-#define RETURN_ICMP_ERROR ENCODE_ERROR (22)
-#define RETURN_TFTP_ERROR ENCODE_ERROR (23)
-#define RETURN_PROTOCOL_ERROR ENCODE_ERROR (24)
-#define RETURN_INCOMPATIBLE_VERSION ENCODE_ERROR (25)
-#define RETURN_SECURITY_VIOLATION ENCODE_ERROR (26)
-#define RETURN_CRC_ERROR ENCODE_ERROR (27)
-#define RETURN_END_OF_MEDIA ENCODE_ERROR (28)
-#define RETURN_END_OF_FILE ENCODE_ERROR (31)
-
-#define RETURN_WARN_UNKNOWN_GLYPH ENCODE_WARNING (1)
-#define RETURN_WARN_DELETE_FAILURE ENCODE_WARNING (2)
-#define RETURN_WARN_WRITE_FAILURE ENCODE_WARNING (3)
-#define RETURN_WARN_BUFFER_TOO_SMALL ENCODE_WARNING (4)
-
-typedef UINT64 PHYSICAL_ADDRESS;
-
-#define BIT0 0x00000001
-#define BIT1 0x00000002
-#define BIT2 0x00000004
-#define BIT3 0x00000008
-#define BIT4 0x00000010
-#define BIT5 0x00000020
-#define BIT6 0x00000040
-#define BIT7 0x00000080
-#define BIT8 0x00000100
-#define BIT9 0x00000200
-#define BIT10 0x00000400
-#define BIT11 0x00000800
-#define BIT12 0x00001000
-#define BIT13 0x00002000
-#define BIT14 0x00004000
-#define BIT15 0x00008000
-#define BIT16 0x00010000
-#define BIT17 0x00020000
-#define BIT18 0x00040000
-#define BIT19 0x00080000
-#define BIT20 0x00100000
-#define BIT21 0x00200000
-#define BIT22 0x00400000
-#define BIT23 0x00800000
-#define BIT24 0x01000000
-#define BIT25 0x02000000
-#define BIT26 0x04000000
-#define BIT27 0x08000000
-#define BIT28 0x10000000
-#define BIT29 0x20000000
-#define BIT30 0x40000000
-#define BIT31 0x80000000
-#define BIT32 0x0000000100000000ULL
-#define BIT33 0x0000000200000000ULL
-#define BIT34 0x0000000400000000ULL
-#define BIT35 0x0000000800000000ULL
-#define BIT36 0x0000001000000000ULL
-#define BIT37 0x0000002000000000ULL
-#define BIT38 0x0000004000000000ULL
-#define BIT39 0x0000008000000000ULL
-#define BIT40 0x0000010000000000ULL
-#define BIT41 0x0000020000000000ULL
-#define BIT42 0x0000040000000000ULL
-#define BIT43 0x0000080000000000ULL
-#define BIT44 0x0000100000000000ULL
-#define BIT45 0x0000200000000000ULL
-#define BIT46 0x0000400000000000ULL
-#define BIT47 0x0000800000000000ULL
-#define BIT48 0x0001000000000000ULL
-#define BIT49 0x0002000000000000ULL
-#define BIT50 0x0004000000000000ULL
-#define BIT51 0x0008000000000000ULL
-#define BIT52 0x0010000000000000ULL
-#define BIT53 0x0020000000000000ULL
-#define BIT54 0x0040000000000000ULL
-#define BIT55 0x0080000000000000ULL
-#define BIT56 0x0100000000000000ULL
-#define BIT57 0x0200000000000000ULL
-#define BIT58 0x0400000000000000ULL
-#define BIT59 0x0800000000000000ULL
-#define BIT60 0x1000000000000000ULL
-#define BIT61 0x2000000000000000ULL
-#define BIT62 0x4000000000000000ULL
-#define BIT63 0x8000000000000000ULL
-
-#endif
diff --git a/BaseTools/Source/C/Include/Common/BuildVersion.h b/BaseTools/Source/C/Include/Common/BuildVersion.h
deleted file mode 100644
index 764bebfa93..0000000000
--- a/BaseTools/Source/C/Include/Common/BuildVersion.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/** @file
- This file is for build version number auto generation
-
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: BuildVersion.h
-
-**/
-
-#define __BUILD_VERSION ""
diff --git a/BaseTools/Source/C/Include/Common/MdeModuleHii.h b/BaseTools/Source/C/Include/Common/MdeModuleHii.h
deleted file mode 100644
index b756fef2c3..0000000000
--- a/BaseTools/Source/C/Include/Common/MdeModuleHii.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/** @file
- EDK II specific HII relative definition.
-
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: MdeModuleHii.h
-
-**/
-
-#ifndef _MDEMODULE_HII_H
-#define _MDEMODULE_HII_H
-
-#define NARROW_CHAR 0xFFF0
-#define WIDE_CHAR 0xFFF1
-#define NON_BREAKING_CHAR 0xFFF2
-
-///
-/// State defined for password statemachine .
-///
-#define BROWSER_STATE_VALIDATE_PASSWORD 0
-#define BROWSER_STATE_SET_PASSWORD 1
-
-///
-/// GUIDed opcodes defined for EDKII implementation.
-///
-#define EFI_IFR_TIANO_GUID \
- { 0xf0b1735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce} }
-
-#pragma pack(1)
-
-///
-/// EDKII implementation extension opcodes, new extension can be added here later.
-///
-#define EFI_IFR_EXTEND_OP_LABEL 0x0
-#define EFI_IFR_EXTEND_OP_BANNER 0x1
-#define EFI_IFR_EXTEND_OP_TIMEOUT 0x2
-#define EFI_IFR_EXTEND_OP_CLASS 0x3
-#define EFI_IFR_EXTEND_OP_SUBCLASS 0x4
-
-///
-/// Label opcode.
-///
-typedef struct _EFI_IFR_GUID_LABEL {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_TIANO_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_LABEL.
- ///
- UINT8 ExtendOpCode;
- ///
- /// Label Number.
- ///
- UINT16 Number;
-} EFI_IFR_GUID_LABEL;
-
-#define EFI_IFR_BANNER_ALIGN_LEFT 0
-#define EFI_IFR_BANNER_ALIGN_CENTER 1
-#define EFI_IFR_BANNER_ALIGN_RIGHT 2
-
-///
-/// Banner opcode.
-///
-typedef struct _EFI_IFR_GUID_BANNER {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_TIANO_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_BANNER
- ///
- UINT8 ExtendOpCode;
- EFI_STRING_ID Title; ///< The string token for the banner title.
- UINT16 LineNumber; ///< 1-based line number.
- UINT8 Alignment; ///< left, center, or right-aligned.
-} EFI_IFR_GUID_BANNER;
-
-///
-/// Timeout opcode.
-///
-typedef struct _EFI_IFR_GUID_TIMEOUT {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_TIANO_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_TIMEOUT.
- ///
- UINT8 ExtendOpCode;
- UINT16 TimeOut; ///< TimeOut Value.
-} EFI_IFR_GUID_TIMEOUT;
-
-#define EFI_NON_DEVICE_CLASS 0x00
-#define EFI_DISK_DEVICE_CLASS 0x01
-#define EFI_VIDEO_DEVICE_CLASS 0x02
-#define EFI_NETWORK_DEVICE_CLASS 0x04
-#define EFI_INPUT_DEVICE_CLASS 0x08
-#define EFI_ON_BOARD_DEVICE_CLASS 0x10
-#define EFI_OTHER_DEVICE_CLASS 0x20
-
-///
-/// Device Class opcode.
-///
-typedef struct _EFI_IFR_GUID_CLASS {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_TIANO_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_CLASS.
- ///
- UINT8 ExtendOpCode;
- UINT16 Class; ///< Device Class from the above.
-} EFI_IFR_GUID_CLASS;
-
-#define EFI_SETUP_APPLICATION_SUBCLASS 0x00
-#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
-#define EFI_FRONT_PAGE_SUBCLASS 0x02
-#define EFI_SINGLE_USE_SUBCLASS 0x03
-
-///
-/// SubClass opcode
-///
-typedef struct _EFI_IFR_GUID_SUBCLASS {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_TIANO_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_SUBCLASS.
- ///
- UINT8 ExtendOpCode;
- UINT16 SubClass; ///< Sub Class type from the above.
-} EFI_IFR_GUID_SUBCLASS;
-
-///
-/// GUIDed opcodes support for framework vfr.
-///
-#define EFI_IFR_FRAMEWORK_GUID \
- { 0x31ca5d1a, 0xd511, 0x4931, { 0xb7, 0x82, 0xae, 0x6b, 0x2b, 0x17, 0x8c, 0xd7 } }
-
-///
-/// Two extended opcodes are added, and new extensions can be added here later.
-/// One is for framework OneOf question Option Key value;
-/// another is for framework vareqval.
-///
-#define EFI_IFR_EXTEND_OP_OPTIONKEY 0x0
-#define EFI_IFR_EXTEND_OP_VAREQNAME 0x1
-
-///
-/// Store the framework vfr option key value.
-///
-typedef struct _EFI_IFR_GUID_OPTIONKEY {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_FRAMEWORK_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_OPTIONKEY.
- ///
- UINT8 ExtendOpCode;
- ///
- /// OneOf Questiond ID binded by OneOf Option.
- ///
- EFI_QUESTION_ID QuestionId;
- ///
- /// The OneOf Option Value.
- ///
- EFI_IFR_TYPE_VALUE OptionValue;
- ///
- /// The Framework OneOf Option Key Value.
- ///
- UINT16 KeyValue;
-} EFI_IFR_GUID_OPTIONKEY;
-
-///
-/// Store the framework vfr vareqval name number.
-///
-typedef struct _EFI_IFR_GUID_VAREQNAME {
- EFI_IFR_OP_HEADER Header;
- ///
- /// EFI_IFR_FRAMEWORK_GUID.
- ///
- EFI_GUID Guid;
- ///
- /// EFI_IFR_EXTEND_OP_VAREQNAME.
- ///
- UINT8 ExtendOpCode;
- ///
- /// Question ID of the Numeric Opcode created.
- ///
- EFI_QUESTION_ID QuestionId;
- ///
- /// For vareqval (0x100), NameId is 0x100.
- /// This value will convert to a Unicode String following this rule;
- /// sprintf(StringBuffer, "%d", NameId) .
- /// The the Unicode String will be used as a EFI Variable Name.
- ///
- UINT16 NameId;
-} EFI_IFR_GUID_VAREQNAME;
-
-#pragma pack()
-
-extern EFI_GUID gEfiIfrTianoGuid;
-extern EFI_GUID gEfiIfrFrameworkGuid;
-
-#endif
-
diff --git a/BaseTools/Source/C/Include/Common/PiFirmwareFile.h b/BaseTools/Source/C/Include/Common/PiFirmwareFile.h
deleted file mode 100644
index e66f40ca43..0000000000
--- a/BaseTools/Source/C/Include/Common/PiFirmwareFile.h
+++ /dev/null
@@ -1,272 +0,0 @@
-/** @file
- The firmware file related definitions in PI.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: PiFirmwareFile.h
-
- @par Revision Reference:
- Version 1.0.
-
-**/
-
-#ifndef __PI_FIRMWARE_FILE_H__
-#define __PI_FIRMWARE_FILE_H__
-
-#pragma pack(1)
-//
-// Used to verify the integrity of the file.
-//
-typedef union {
- struct {
- UINT8 Header;
- UINT8 File;
- } Checksum;
- UINT16 Checksum16;
-} EFI_FFS_INTEGRITY_CHECK;
-
-typedef UINT8 EFI_FV_FILETYPE;
-typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;
-typedef UINT8 EFI_FFS_FILE_STATE;
-
-//
-// File Types Definitions
-//
-#define EFI_FV_FILETYPE_ALL 0x00
-#define EFI_FV_FILETYPE_RAW 0x01
-#define EFI_FV_FILETYPE_FREEFORM 0x02
-#define EFI_FV_FILETYPE_SECURITY_CORE 0x03
-#define EFI_FV_FILETYPE_PEI_CORE 0x04
-#define EFI_FV_FILETYPE_DXE_CORE 0x05
-#define EFI_FV_FILETYPE_PEIM 0x06
-#define EFI_FV_FILETYPE_DRIVER 0x07
-#define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08
-#define EFI_FV_FILETYPE_APPLICATION 0x09
-#define EFI_FV_FILETYPE_SMM 0x0A
-#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
-#define EFI_FV_FILETYPE_COMBINED_SMM_DXE 0x0C
-#define EFI_FV_FILETYPE_SMM_CORE 0x0D
-#define EFI_FV_FILETYPE_OEM_MIN 0xc0
-#define EFI_FV_FILETYPE_OEM_MAX 0xdf
-#define EFI_FV_FILETYPE_DEBUG_MIN 0xe0
-#define EFI_FV_FILETYPE_DEBUG_MAX 0xef
-#define EFI_FV_FILETYPE_FFS_MIN 0xf0
-#define EFI_FV_FILETYPE_FFS_MAX 0xff
-#define EFI_FV_FILETYPE_FFS_PAD 0xf0
-//
-// FFS File Attributes.
-//
-#define FFS_ATTRIB_FIXED 0x04
-#define FFS_ATTRIB_DATA_ALIGNMENT 0x38
-#define FFS_ATTRIB_CHECKSUM 0x40
-//
-// FFS_FIXED_CHECKSUM is the checksum value used when the
-// FFS_ATTRIB_CHECKSUM attribute bit is clear
-//
-#define FFS_FIXED_CHECKSUM 0xAA
-
-//
-// FFS File State Bits.
-//
-#define EFI_FILE_HEADER_CONSTRUCTION 0x01
-#define EFI_FILE_HEADER_VALID 0x02
-#define EFI_FILE_DATA_VALID 0x04
-#define EFI_FILE_MARKED_FOR_UPDATE 0x08
-#define EFI_FILE_DELETED 0x10
-#define EFI_FILE_HEADER_INVALID 0x20
-
-#define EFI_FILE_ALL_STATE_BITS (EFI_FILE_HEADER_CONSTRUCTION | \
- EFI_FILE_HEADER_VALID | \
- EFI_FILE_DATA_VALID | \
- EFI_FILE_MARKED_FOR_UPDATE | \
- EFI_FILE_DELETED | \
- EFI_FILE_HEADER_INVALID \
- )
-
-//
-// Each file begins with the header that describe the
-// contents and state of the files.
-//
-typedef struct {
- EFI_GUID Name;
- EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
- EFI_FV_FILETYPE Type;
- EFI_FFS_FILE_ATTRIBUTES Attributes;
- UINT8 Size[3];
- EFI_FFS_FILE_STATE State;
-} EFI_FFS_FILE_HEADER;
-
-
-typedef UINT8 EFI_SECTION_TYPE;
-
-//
-// Pseudo type. It is
-// used as a wild card when retrieving sections. The section
-// type EFI_SECTION_ALL matches all section types.
-//
-#define EFI_SECTION_ALL 0x00
-
-//
-// Encapsulation section Type values
-//
-#define EFI_SECTION_COMPRESSION 0x01
-
-#define EFI_SECTION_GUID_DEFINED 0x02
-
-//
-// Leaf section Type values
-//
-#define EFI_SECTION_PE32 0x10
-#define EFI_SECTION_PIC 0x11
-#define EFI_SECTION_TE 0x12
-#define EFI_SECTION_DXE_DEPEX 0x13
-#define EFI_SECTION_VERSION 0x14
-#define EFI_SECTION_USER_INTERFACE 0x15
-#define EFI_SECTION_COMPATIBILITY16 0x16
-#define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17
-#define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18
-#define EFI_SECTION_RAW 0x19
-#define EFI_SECTION_PEI_DEPEX 0x1B
-#define EFI_SECTION_SMM_DEPEX 0x1C
-
-typedef struct {
- UINT8 Size[3];
- EFI_SECTION_TYPE Type;
-} EFI_COMMON_SECTION_HEADER;
-
-//
-// Leaf section type that contains an
-// IA-32 16-bit executable image.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;
-
-//
-// CompressionType of EFI_COMPRESSION_SECTION.
-//
-#define EFI_NOT_COMPRESSED 0x00
-#define EFI_STANDARD_COMPRESSION 0x01
-//
-// An encapsulation section type in which the
-// section data is compressed.
-//
-typedef struct {
- EFI_COMMON_SECTION_HEADER CommonHeader;
- UINT32 UncompressedLength;
- UINT8 CompressionType;
-} EFI_COMPRESSION_SECTION;
-
-//
-// Leaf section which could be used to determine the dispatch order of DXEs.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;
-
-//
-// Leaf section witch contains a PI FV.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;
-
-//
-// Leaf section which contains a single GUID.
-//
-typedef struct {
- EFI_COMMON_SECTION_HEADER CommonHeader;
- EFI_GUID SubTypeGuid;
-} EFI_FREEFORM_SUBTYPE_GUID_SECTION;
-
-//
-// Attributes of EFI_GUID_DEFINED_SECTION
-//
-#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01
-#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02
-//
-// Leaf section which is encapsulation defined by specific GUID
-//
-typedef struct {
- EFI_COMMON_SECTION_HEADER CommonHeader;
- EFI_GUID SectionDefinitionGuid;
- UINT16 DataOffset;
- UINT16 Attributes;
-} EFI_GUID_DEFINED_SECTION;
-
-//
-// Leaf section which contains PE32+ image.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;
-
-//
-// Leaf section which contains PIC image.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_PIC_SECTION;
-
-//
-// Leaf section which used to determine the dispatch order of PEIMs.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;
-
-//
-// Leaf section which constains the position-independent-code image.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;
-
-//
-// Leaf section which contains an array of zero or more bytes.
-//
-typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;
-
-//
-// Leaf section which contains a unicode string that
-// is human readable file name.
-//
-typedef struct {
- EFI_COMMON_SECTION_HEADER CommonHeader;
-
- //
- // Array of unicode string.
- //
- CHAR16 FileNameString[1];
-} EFI_USER_INTERFACE_SECTION;
-
-
-//
-// Leaf section which contains a numeric build number and
-// an optional unicode string that represent the file revision.
-//
-typedef struct {
- EFI_COMMON_SECTION_HEADER CommonHeader;
- UINT16 BuildNumber;
- CHAR16 VersionString[1];
-} EFI_VERSION_SECTION;
-
-
-#define SECTION_SIZE(SectionHeaderPtr) \
- ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))
-
-#pragma pack()
-
-typedef union {
- EFI_COMMON_SECTION_HEADER *CommonHeader;
- EFI_COMPRESSION_SECTION *CompressionSection;
- EFI_GUID_DEFINED_SECTION *GuidDefinedSection;
- EFI_PE32_SECTION *Pe32Section;
- EFI_PIC_SECTION *PicSection;
- EFI_TE_SECTION *TeSection;
- EFI_PEI_DEPEX_SECTION *PeimHeaderSection;
- EFI_DXE_DEPEX_SECTION *DependencySection;
- EFI_VERSION_SECTION *VersionSection;
- EFI_USER_INTERFACE_SECTION *UISection;
- EFI_COMPATIBILITY16_SECTION *Code16Section;
- EFI_FIRMWARE_VOLUME_IMAGE_SECTION *FVImageSection;
- EFI_FREEFORM_SUBTYPE_GUID_SECTION *FreeformSubtypeSection;
- EFI_RAW_SECTION *RawSection;
-} EFI_FILE_SECTION_POINTER;
-
-#endif
-
diff --git a/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h b/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
deleted file mode 100644
index 0c8e29e1ce..0000000000
--- a/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/** @file
- The firmware volume related definitions in PI.
-
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: PiFirmwareVolume.h
-
- @par Revision Reference:
- Version 1.2C
-
-**/
-
-#ifndef __PI_FIRMWAREVOLUME_H__
-#define __PI_FIRMWAREVOLUME_H__
-
-//
-// EFI_FV_FILE_ATTRIBUTES
-//
-typedef UINT32 EFI_FV_FILE_ATTRIBUTES;
-
-//
-// Value of EFI_FV_FILE_ATTRIBUTES.
-//
-#define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F
-#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100
-#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200
-
-typedef UINT32 EFI_FVB_ATTRIBUTES_2;
-
-//
-// Attributes bit definitions
-//
-#define EFI_FVB2_READ_DISABLED_CAP 0x00000001
-#define EFI_FVB2_READ_ENABLED_CAP 0x00000002
-#define EFI_FVB2_READ_STATUS 0x00000004
-#define EFI_FVB2_WRITE_DISABLED_CAP 0x00000008
-#define EFI_FVB2_WRITE_ENABLED_CAP 0x00000010
-#define EFI_FVB2_WRITE_STATUS 0x00000020
-#define EFI_FVB2_LOCK_CAP 0x00000040
-#define EFI_FVB2_LOCK_STATUS 0x00000080
-#define EFI_FVB2_STICKY_WRITE 0x00000200
-#define EFI_FVB2_MEMORY_MAPPED 0x00000400
-#define EFI_FVB2_ERASE_POLARITY 0x00000800
-#define EFI_FVB2_READ_LOCK_CAP 0x00001000
-#define EFI_FVB2_READ_LOCK_STATUS 0x00002000
-#define EFI_FVB2_WRITE_LOCK_CAP 0x00004000
-#define EFI_FVB2_WRITE_LOCK_STATUS 0x00008000
-#define EFI_FVB2_ALIGNMENT 0x001F0000
-#define EFI_FVB2_ALIGNMENT_1 0x00000000
-#define EFI_FVB2_ALIGNMENT_2 0x00010000
-#define EFI_FVB2_ALIGNMENT_4 0x00020000
-#define EFI_FVB2_ALIGNMENT_8 0x00030000
-#define EFI_FVB2_ALIGNMENT_16 0x00040000
-#define EFI_FVB2_ALIGNMENT_32 0x00050000
-#define EFI_FVB2_ALIGNMENT_64 0x00060000
-#define EFI_FVB2_ALIGNMENT_128 0x00070000
-#define EFI_FVB2_ALIGNMENT_256 0x00080000
-#define EFI_FVB2_ALIGNMENT_512 0x00090000
-#define EFI_FVB2_ALIGNMENT_1K 0x000A0000
-#define EFI_FVB2_ALIGNMENT_2K 0x000B0000
-#define EFI_FVB2_ALIGNMENT_4K 0x000C0000
-#define EFI_FVB2_ALIGNMENT_8K 0x000D0000
-#define EFI_FVB2_ALIGNMENT_16K 0x000E0000
-#define EFI_FVB2_ALIGNMENT_32K 0x000F0000
-#define EFI_FVB2_ALIGNMENT_64K 0x00100000
-#define EFI_FVB2_ALIGNMENT_128K 0x00110000
-#define EFI_FVB2_ALIGNMENT_256K 0x00120000
-#define EFI_FVB2_ALIGNMENT_512K 0x00130000
-#define EFI_FVB2_ALIGNMENT_1M 0x00140000
-#define EFI_FVB2_ALIGNMENT_2M 0x00150000
-#define EFI_FVB2_ALIGNMENT_4M 0x00160000
-#define EFI_FVB2_ALIGNMENT_8M 0x00170000
-#define EFI_FVB2_ALIGNMENT_16M 0x00180000
-#define EFI_FVB2_ALIGNMENT_32M 0x00190000
-#define EFI_FVB2_ALIGNMENT_64M 0x001A0000
-#define EFI_FVB2_ALIGNMENT_128M 0x001B0000
-#define EFI_FVB2_ALIGNMENT_256M 0x001C0000
-#define EFI_FVB2_ALIGNMENT_512M 0x001D0000
-#define EFI_FVB2_ALIGNMENT_1G 0x001E0000
-#define EFI_FVB2_ALIGNMENT_2G 0x001F0000
-
-
-typedef struct {
- UINT32 NumBlocks;
- UINT32 Length;
-} EFI_FV_BLOCK_MAP_ENTRY;
-
-//
-// Describes the features and layout of the firmware volume.
-//
-typedef struct {
- UINT8 ZeroVector[16];
- EFI_GUID FileSystemGuid;
- UINT64 FvLength;
- UINT32 Signature;
- EFI_FVB_ATTRIBUTES_2 Attributes;
- UINT16 HeaderLength;
- UINT16 Checksum;
- UINT16 ExtHeaderOffset;
- UINT8 Reserved[1];
- UINT8 Revision;
- EFI_FV_BLOCK_MAP_ENTRY BlockMap[1];
-} EFI_FIRMWARE_VOLUME_HEADER;
-
-#define EFI_FVH_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', 'H')
-
-///
-/// Firmware Volume Header Revision definition
-///
-#define EFI_FVH_REVISION 0x02
-
-//
-// Extension header pointed by ExtHeaderOffset of volume header.
-//
-typedef struct {
- EFI_GUID FvName;
- UINT32 ExtHeaderSize;
-} EFI_FIRMWARE_VOLUME_EXT_HEADER;
-
-typedef struct {
- UINT16 ExtEntrySize;
- UINT16 ExtEntryType;
-} EFI_FIRMWARE_VOLUME_EXT_ENTRY;
-
-#define EFI_FV_EXT_TYPE_OEM_TYPE 0x01
-typedef struct {
- EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
- UINT32 TypeMask;
-
- //
- // Array of GUIDs.
- // Each GUID represents an OEM file type.
- //
- // EFI_GUID Types[1];
- //
-} EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE;
-
-#define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002
-typedef struct {
- EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
- EFI_GUID FormatType;
-
- //
- // An arry of bytes of length Length.
- //
- // UINT8 Data[1];
- //
-} EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Common/UefiBaseTypes.h b/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
deleted file mode 100644
index 43f585491c..0000000000
--- a/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/** @file
- Defines data types and constants introduced in UEFI.
-
- Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: UefiBaseTypes.h
-
-**/
-
-#ifndef __UEFI_BASETYPE_H__
-#define __UEFI_BASETYPE_H__
-
-#include <Common/BaseTypes.h>
-
-//
-// Basical data type definitions introduced in UEFI.
-//
-typedef struct {
- UINT32 Data1;
- UINT16 Data2;
- UINT16 Data3;
- UINT8 Data4[8];
-} EFI_GUID;
-
-typedef RETURN_STATUS EFI_STATUS;
-typedef VOID *EFI_HANDLE;
-
-typedef VOID *EFI_EVENT;
-
-typedef UINTN EFI_TPL;
-
-
-typedef UINT64 EFI_LBA;
-
-
-typedef UINT16 STRING_REF;
-
-typedef UINT64 EFI_PHYSICAL_ADDRESS;
-typedef UINT64 EFI_VIRTUAL_ADDRESS;
-
-//
-// EFI Time Abstraction:
-// Year: 2000 - 20XX
-// Month: 1 - 12
-// Day: 1 - 31
-// Hour: 0 - 23
-// Minute: 0 - 59
-// Second: 0 - 59
-// Nanosecond: 0 - 999,999,999
-// TimeZone: -1440 to 1440 or 2047
-//
-typedef struct {
- UINT16 Year;
- UINT8 Month;
- UINT8 Day;
- UINT8 Hour;
- UINT8 Minute;
- UINT8 Second;
- UINT8 Pad1;
- UINT32 Nanosecond;
- INT16 TimeZone;
- UINT8 Daylight;
- UINT8 Pad2;
-} EFI_TIME;
-
-
-//
-// Networking Definitions
-//
-typedef struct {
- UINT8 Addr[4];
-} EFI_IPv4_ADDRESS;
-
-typedef struct {
- UINT8 Addr[16];
-} EFI_IPv6_ADDRESS;
-
-typedef struct {
- UINT8 Addr[32];
-} EFI_MAC_ADDRESS;
-
-typedef union {
- UINT32 Addr[4];
- EFI_IPv4_ADDRESS v4;
- EFI_IPv6_ADDRESS v6;
-} EFI_IP_ADDRESS;
-
-
-//
-// Enumeration of EFI_STATUS.
-//
-#define EFI_SUCCESS RETURN_SUCCESS
-#define EFI_LOAD_ERROR RETURN_LOAD_ERROR
-#define EFI_INVALID_PARAMETER RETURN_INVALID_PARAMETER
-#define EFI_UNSUPPORTED RETURN_UNSUPPORTED
-#define EFI_BAD_BUFFER_SIZE RETURN_BAD_BUFFER_SIZE
-#define EFI_BUFFER_TOO_SMALL RETURN_BUFFER_TOO_SMALL
-#define EFI_NOT_READY RETURN_NOT_READY
-#define EFI_DEVICE_ERROR RETURN_DEVICE_ERROR
-#define EFI_WRITE_PROTECTED RETURN_WRITE_PROTECTED
-#define EFI_OUT_OF_RESOURCES RETURN_OUT_OF_RESOURCES
-#define EFI_VOLUME_CORRUPTED RETURN_VOLUME_CORRUPTED
-#define EFI_VOLUME_FULL RETURN_VOLUME_FULL
-#define EFI_NO_MEDIA RETURN_NO_MEDIA
-#define EFI_MEDIA_CHANGED RETURN_MEDIA_CHANGED
-#define EFI_NOT_FOUND RETURN_NOT_FOUND
-#define EFI_ACCESS_DENIED RETURN_ACCESS_DENIED
-#define EFI_NO_RESPONSE RETURN_NO_RESPONSE
-#define EFI_NO_MAPPING RETURN_NO_MAPPING
-#define EFI_TIMEOUT RETURN_TIMEOUT
-#define EFI_NOT_STARTED RETURN_NOT_STARTED
-#define EFI_ALREADY_STARTED RETURN_ALREADY_STARTED
-#define EFI_ABORTED RETURN_ABORTED
-#define EFI_ICMP_ERROR RETURN_ICMP_ERROR
-#define EFI_TFTP_ERROR RETURN_TFTP_ERROR
-#define EFI_PROTOCOL_ERROR RETURN_PROTOCOL_ERROR
-#define EFI_INCOMPATIBLE_VERSION RETURN_INCOMPATIBLE_VERSION
-#define EFI_SECURITY_VIOLATION RETURN_SECURITY_VIOLATION
-#define EFI_CRC_ERROR RETURN_CRC_ERROR
-#define EFI_END_OF_MEDIA RETURN_END_OF_MEDIA
-#define EFI_END_OF_FILE RETURN_END_OF_FILE
-
-#define EFI_WARN_UNKNOWN_GLYPH RETURN_WARN_UNKNOWN_GLYPH
-#define EFI_WARN_DELETE_FAILURE RETURN_WARN_DELETE_FAILURE
-#define EFI_WARN_WRITE_FAILURE RETURN_WARN_WRITE_FAILURE
-#define EFI_WARN_BUFFER_TOO_SMALL RETURN_WARN_BUFFER_TOO_SMALL
-
-
-#define NULL_HANDLE ((VOID *) 0)
-
-//
-// Define macro to encode the status code.
-//
-#define EFIERR(_a) ENCODE_ERROR(_a)
-
-#define EFI_ERROR(A) RETURN_ERROR(A)
-
-//
-// Define macros to build data structure signatures from characters.
-//
-#define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
-#define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
-#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \
- (EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32))
-
-
-//
-// Returns the byte offset to a field within a structure
-//
-#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field)))
-
-//
-// The EFI memory allocation functions work in units of EFI_PAGEs that are
-// 4K. This should in no way be confused with the page size of the processor.
-// An EFI_PAGE is just the quanta of memory in EFI.
-//
-#define EFI_PAGE_SIZE 0x1000
-#define EFI_PAGE_MASK 0xFFF
-#define EFI_PAGE_SHIFT 12
-
-#define EFI_SIZE_TO_PAGES(a) (((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0))
-
-#define EFI_PAGES_TO_SIZE(a) ( (a) << EFI_PAGE_SHIFT)
-
-
-#define EFI_MAX_BIT MAX_BIT
-#define EFI_MAX_ADDRESS MAX_ADDRESS
-
-#endif
diff --git a/BaseTools/Source/C/Include/Common/UefiCapsule.h b/BaseTools/Source/C/Include/Common/UefiCapsule.h
deleted file mode 100644
index a0f6c6af08..0000000000
--- a/BaseTools/Source/C/Include/Common/UefiCapsule.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file
- Defines for the EFI Capsule functionality.
-
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: Capsule.h
-
- @par Revision Reference:
- These definitions are from Uefi Spec.
-
-**/
-
-#ifndef _EFI_CAPSULE_H_
-#define _EFI_CAPSULE_H_
-
-typedef struct {
- EFI_GUID CapsuleGuid;
- UINT32 HeaderSize;
- UINT32 Flags;
- UINT32 CapsuleImageSize;
-} EFI_CAPSULE_HEADER;
-
-#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000
-#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000
-#define CAPSULE_FLAGS_INITIATE_RESET 0x00040000
-
-#endif // #ifndef _EFI_CAPSULE_H_
diff --git a/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h b/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
deleted file mode 100644
index 3cd22d1347..0000000000
--- a/BaseTools/Source/C/Include/Common/UefiInternalFormRepresentation.h
+++ /dev/null
@@ -1,1657 +0,0 @@
-/** @file
- This file defines the encoding for the VFR (Visual Form Representation) language.
- IFR is primarily consumed by the EFI presentation engine, and produced by EFI
- internal application and drivers as well as all add-in card option-ROM drivers
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: UefiInternalFormRepresentation.h
-
- @par Revision Reference:
- These definitions are from UEFI2.1.
-
-**/
-
-#ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__
-#define __UEFI_INTERNAL_FORMREPRESENTATION_H__
-
-
-#define EFI_HII_PLATFORM_SETUP_FORMSET_GUID \
- { 0x93039971, 0x8545, 0x4b04, { 0xb4, 0x5e, 0x32, 0xeb, 0x83, 0x26, 0x4, 0xe } }
-
-//
-// The following types are currently defined:
-//
-typedef UINT32 RELOFST;
-
-typedef VOID* EFI_HII_HANDLE;
-typedef CHAR16* EFI_STRING;
-typedef UINT16 EFI_IMAGE_ID;
-typedef UINT16 EFI_QUESTION_ID;
-typedef UINT16 EFI_STRING_ID;
-typedef UINT16 EFI_FORM_ID;
-typedef UINT16 EFI_VARSTORE_ID;
-typedef UINT16 EFI_DEFAULT_ID;
-typedef UINT32 EFI_HII_FONT_STYLE;
-
-
-
-#pragma pack(1)
-
-
-//
-// HII package list
-//
-typedef struct {
- EFI_GUID PackageListGuid;
- UINT32 PackageLength;
-} EFI_HII_PACKAGE_LIST_HEADER;
-
-/**
-
- Each package starts with a header, as defined above, which
- indicates the size and type of the package. When added to a
- pointer pointing to the start of the header, Length points at
- the next package. The package lists form a package list when
- concatenated together and terminated with an
- EFI_HII_PACKAGE_HEADER with a Type of EFI_HII_PACKAGE_END. The
- type EFI_HII_PACKAGE_TYPE_GUID is used for vendor-defined HII
- packages, whose contents are determined by the Guid. The range
- of package types starting with EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN
- through EFI_HII_PACKAGE_TYPE_SYSTEM_END are reserved for system
- firmware implementers.
-
- @param Length The size of the package in bytes.
-
- @param Type The package type. See EFI_HII_PACKAGE_TYPE_x,
- below.
-
- @param Data The package data, the format of which is
- determined by Type.
-
-**/
-typedef struct {
- UINT32 Length:24;
- UINT32 Type:8;
- // UINT8 Data[...];
-} EFI_HII_PACKAGE_HEADER;
-
-//
-// EFI_HII_PACKAGE_TYPE_x.
-//
-#define EFI_HII_PACKAGE_TYPE_ALL 0x00
-#define EFI_HII_PACKAGE_TYPE_GUID 0x01
-#define EFI_HII_PACKAGE_FORM 0x02
-#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x03
-#define EFI_HII_PACKAGE_STRINGS 0x04
-#define EFI_HII_PACKAGE_FONTS 0x05
-#define EFI_HII_PACKAGE_IMAGES 0x06
-#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07
-#define EFI_HII_PACKAGE_DEVICE_PATH 0x08
-#define EFI_HII_PACKAGE_END 0xDF
-#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0
-#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF
-
-//
-// Simplified Font Package
-//
-
-#define EFI_GLYPH_HEIGHT 19
-#define EFI_GLYPH_WIDTH 8
-//
-// Contents of EFI_NARROW_GLYPH.Attributes
-//
-#define EFI_GLYPH_NON_SPACING 0x01
-#define EFI_GLYPH_WIDE 0x02
-
-typedef struct {
- CHAR16 UnicodeWeight;
- UINT8 Attributes;
- UINT8 GlyphCol1[EFI_GLYPH_HEIGHT];
-} EFI_NARROW_GLYPH;
-
-typedef struct {
- CHAR16 UnicodeWeight;
- UINT8 Attributes;
- UINT8 GlyphCol1[EFI_GLYPH_HEIGHT];
- UINT8 GlyphCol2[EFI_GLYPH_HEIGHT];
- UINT8 Pad[3];
-} EFI_WIDE_GLYPH;
-
-
-typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
- EFI_HII_PACKAGE_HEADER Header;
- UINT16 NumberOfNarrowGlyphs;
- UINT16 NumberOfWideGlyphs;
- // EFI_NARROW_GLYPH NarrowGlyphs[];
- // EFI_WIDE_GLYPH WideGlyphs[];
-} EFI_HII_SIMPLE_FONT_PACKAGE_HDR;
-
-//
-// Font Package
-//
-
-#define EFI_HII_FONT_STYLE_BOLD 0x00000001
-#define EFI_HII_FONT_STYLE_ITALIC 0x00000002
-#define EFI_HII_FONT_STYLE_EMBOSS 0x00010000
-#define EFI_HII_FONT_STYLE_OUTLINE 0x00020000
-#define EFI_HII_FONT_STYLE_SHADOW 0x00040000
-#define EFI_HII_FONT_STYLE_UNDERLINE 0x00080000
-#define EFI_HII_FONT_STYLE_DBL_UNDER 0x00100000
-
-typedef struct _EFI_HII_GLYPH_INFO {
- UINT16 Width;
- UINT16 Height;
- INT16 OffsetX;
- INT16 OffsetY;
- INT16 AdvanceX;
-} EFI_HII_GLYPH_INFO;
-
-typedef struct _EFI_HII_FONT_PACKAGE_HDR {
- EFI_HII_PACKAGE_HEADER Header;
- UINT32 HdrSize;
- UINT32 GlyphBlockOffset;
- EFI_HII_GLYPH_INFO Cell;
- EFI_HII_FONT_STYLE FontStyle;
- CHAR16 FontFamily[1];
-} EFI_HII_FONT_PACKAGE_HDR;
-
-#define EFI_HII_GIBT_END 0x00
-#define EFI_HII_GIBT_GLYPH 0x10
-#define EFI_HII_GIBT_GLYPHS 0x11
-#define EFI_HII_GIBT_GLYPH_DEFAULT 0x12
-#define EFI_HII_GIBT_GLYPHS_DEFAULT 0x13
-#define EFI_HII_GIBT_DUPLICATE 0x20
-#define EFI_HII_GIBT_SKIP2 0x21
-#define EFI_HII_GIBT_SKIP1 0x22
-#define EFI_HII_GIBT_DEFAULTS 0x23
-#define EFI_HII_GIBT_EXT1 0x30
-#define EFI_HII_GIBT_EXT2 0x31
-#define EFI_HII_GIBT_EXT4 0x32
-
-typedef struct _EFI_HII_GLYPH_BLOCK {
- UINT8 BlockType;
-} EFI_HII_GLYPH_BLOCK;
-
-typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- EFI_HII_GLYPH_INFO Cell;
-} EFI_HII_GIBT_DEFAULTS_BLOCK;
-
-typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- CHAR16 CharValue;
-} EFI_HII_GIBT_DUPLICATE_BLOCK;
-
-typedef struct _EFI_GLYPH_GIBT_END_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
-} EFI_GLYPH_GIBT_END_BLOCK;
-
-typedef struct _EFI_HII_GIBT_EXT1_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT8 BlockType2;
- UINT8 Length;
-} EFI_HII_GIBT_EXT1_BLOCK;
-
-typedef struct _EFI_HII_GIBT_EXT2_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT8 BlockType2;
- UINT16 Length;
-} EFI_HII_GIBT_EXT2_BLOCK;
-
-typedef struct _EFI_HII_GIBT_EXT4_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT8 BlockType2;
- UINT32 Length;
-} EFI_HII_GIBT_EXT4_BLOCK;
-
-typedef struct _EFI_HII_GIBT_GLYPH_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- EFI_HII_GLYPH_INFO Cell;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height
-} EFI_HII_GIBT_GLYPH_BLOCK;
-
-typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- EFI_HII_GLYPH_INFO Cell;
- UINT16 Count;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height
-} EFI_HII_GIBT_GLYPHS_BLOCK;
-
-typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height
-} EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK;
-
-typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT16 Count;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height
-} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK;
-
-typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT8 SkipCount;
-} EFI_HII_GIBT_SKIP1_BLOCK;
-
-typedef struct _EFI_HII_GIBT_SKIP2_BLOCK {
- EFI_HII_GLYPH_BLOCK Header;
- UINT16 SkipCount;
-} EFI_HII_GIBT_SKIP2_BLOCK;
-
-//
-// Device Path Package
-//
-typedef struct _EFI_HII_DEVICE_PATH_PACKAGE {
- EFI_HII_PACKAGE_HEADER Header;
- // EFI_DEVICE_PATH_PROTOCOL DevicePath[];
-} EFI_HII_DEVICE_PATH_PACKAGE;
-
-//
-// GUID Package
-//
-typedef struct _EFI_HII_GUID_PACKAGE_HDR {
- EFI_HII_PACKAGE_HEADER Header;
- EFI_GUID Guid;
- // Data per GUID definition may follow
-} EFI_HII_GUID_PACKAGE_HDR;
-
-//
-// String Package
-//
-
-#define UEFI_CONFIG_LANG "x-UEFI"
-#define UEFI_CONFIG_LANG2 "x-i-UEFI"
-
-typedef struct _EFI_HII_STRING_PACKAGE_HDR {
- EFI_HII_PACKAGE_HEADER Header;
- UINT32 HdrSize;
- UINT32 StringInfoOffset;
- CHAR16 LanguageWindow[16];
- EFI_STRING_ID LanguageName;
- CHAR8 Language[1];
-} EFI_HII_STRING_PACKAGE_HDR;
-
-typedef struct {
- UINT8 BlockType;
-} EFI_HII_STRING_BLOCK;
-
-#define EFI_HII_SIBT_END 0x00
-#define EFI_HII_SIBT_STRING_SCSU 0x10
-#define EFI_HII_SIBT_STRING_SCSU_FONT 0x11
-#define EFI_HII_SIBT_STRINGS_SCSU 0x12
-#define EFI_HII_SIBT_STRINGS_SCSU_FONT 0x13
-#define EFI_HII_SIBT_STRING_UCS2 0x14
-#define EFI_HII_SIBT_STRING_UCS2_FONT 0x15
-#define EFI_HII_SIBT_STRINGS_UCS2 0x16
-#define EFI_HII_SIBT_STRINGS_UCS2_FONT 0x17
-#define EFI_HII_SIBT_DUPLICATE 0x20
-#define EFI_HII_SIBT_SKIP2 0x21
-#define EFI_HII_SIBT_SKIP1 0x22
-#define EFI_HII_SIBT_EXT1 0x30
-#define EFI_HII_SIBT_EXT2 0x31
-#define EFI_HII_SIBT_EXT4 0x32
-#define EFI_HII_SIBT_FONT 0x40
-
-typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- EFI_STRING_ID StringId;
-} EFI_HII_SIBT_DUPLICATE_BLOCK;
-
-typedef struct _EFI_HII_SIBT_END_BLOCK {
- EFI_HII_STRING_BLOCK Header;
-} EFI_HII_SIBT_END_BLOCK;
-
-typedef struct _EFI_HII_SIBT_EXT1_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 BlockType2;
- UINT8 Length;
-} EFI_HII_SIBT_EXT1_BLOCK;
-
-typedef struct _EFI_HII_SIBT_EXT2_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 BlockType2;
- UINT16 Length;
-} EFI_HII_SIBT_EXT2_BLOCK;
-
-typedef struct _EFI_HII_SIBT_EXT4_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 BlockType2;
- UINT32 Length;
-} EFI_HII_SIBT_EXT4_BLOCK;
-
-typedef struct _EFI_HII_SIBT_FONT_BLOCK {
- EFI_HII_SIBT_EXT2_BLOCK Header;
- UINT8 FontId;
- UINT16 FontSize;
- EFI_HII_FONT_STYLE FontStyle;
- CHAR16 FontName[1];
-} EFI_HII_SIBT_FONT_BLOCK;
-
-typedef struct _EFI_HII_SIBT_SKIP1_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 SkipCount;
-} EFI_HII_SIBT_SKIP1_BLOCK;
-
-typedef struct _EFI_HII_SIBT_SKIP2_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT16 SkipCount;
-} EFI_HII_SIBT_SKIP2_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 StringText[1];
-} EFI_HII_SIBT_STRING_SCSU_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 FontIdentifier;
- UINT8 StringText[1];
-} EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT16 StringCount;
- UINT8 StringText[1];
-} EFI_HII_SIBT_STRINGS_SCSU_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 FontIdentifier;
- UINT16 StringCount;
- UINT8 StringText[1];
-} EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- CHAR16 StringText[1];
-} EFI_HII_SIBT_STRING_UCS2_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 FontIdentifier;
- CHAR16 StringText[1];
-} EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT16 StringCount;
- CHAR16 StringText[1];
-} EFI_HII_SIBT_STRINGS_UCS2_BLOCK;
-
-typedef struct _EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK {
- EFI_HII_STRING_BLOCK Header;
- UINT8 FontIdentifier;
- UINT16 StringCount;
- CHAR16 StringText[1];
-} EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK;
-
-//
-// Image Packages
-//
-
-typedef struct _EFI_HII_IMAGE_PACKAGE_HDR {
- EFI_HII_PACKAGE_HEADER Header;
- UINT32 ImageInfoOffset;
- UINT32 PaletteInfoOffset;
-} EFI_HII_IMAGE_PACKAGE_HDR;
-
-typedef struct _EFI_HII_IMAGE_BLOCK {
- UINT8 BlockType;
-} EFI_HII_IMAGE_BLOCK;
-
-#define EFI_HII_IIBT_END 0x00
-#define EFI_HII_IIBT_IMAGE_1BIT 0x10
-#define EFI_HII_IIBT_IMAGE_1BIT_TRANS 0x11
-#define EFI_HII_IIBT_IMAGE_4BIT 0x12
-#define EFI_HII_IIBT_IMAGE_4BIT_TRANS 0x13
-#define EFI_HII_IIBT_IMAGE_8BIT 0x14
-#define EFI_HII_IIBT_IMAGE_8BIT_TRANS 0x15
-#define EFI_HII_IIBT_IMAGE_24BIT 0x16
-#define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17
-#define EFI_HII_IIBT_IMAGE_JPEG 0x18
-#define EFI_HII_IIBT_DUPLICATE 0x20
-#define EFI_HII_IIBT_SKIP2 0x21
-#define EFI_HII_IIBT_SKIP1 0x22
-#define EFI_HII_IIBT_EXT1 0x30
-#define EFI_HII_IIBT_EXT2 0x31
-#define EFI_HII_IIBT_EXT4 0x32
-
-typedef struct _EFI_HII_IIBT_END_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
-} EFI_HII_IIBT_END_BLOCK;
-
-typedef struct _EFI_HII_IIBT_EXT1_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 BlockType2;
- UINT8 Length;
-} EFI_HII_IIBT_EXT1_BLOCK;
-
-typedef struct _EFI_HII_IIBT_EXT2_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 BlockType2;
- UINT16 Length;
-} EFI_HII_IIBT_EXT2_BLOCK;
-
-typedef struct _EFI_HII_IIBT_EXT4_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 BlockType2;
- UINT32 Length;
-} EFI_HII_IIBT_EXT4_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE {
- UINT16 Width;
- UINT16 Height;
- UINT8 Data[1];
-} EFI_HII_IIBT_IMAGE_1BIT_BASE;
-
-typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_1BIT_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK;
-
-typedef struct _EFI_HII_RGB_PIXEL {
- UINT8 b;
- UINT8 g;
- UINT8 r;
-} EFI_HII_RGB_PIXEL;
-
-typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE {
- UINT16 Width;
- UINT16 Height;
- EFI_HII_RGB_PIXEL Bitmap[1];
-} EFI_HII_IIBT_IMAGE_24BIT_BASE;
-
-typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_24BIT_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE {
- UINT16 Width;
- UINT16 Height;
- UINT8 Data[1];
-} EFI_HII_IIBT_IMAGE_4BIT_BASE;
-
-typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_4BIT_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE {
- UINT16 Width;
- UINT16 Height;
- UINT8 Data[1];
-} EFI_HII_IIBT_IMAGE_8BIT_BASE;
-
-typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_8BIT_BLOCK;
-
-typedef struct _EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 PaletteIndex;
- EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;
-} EFI_HII_IIBT_IMAGE_8BIT_TRAN_BLOCK;
-
-typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- EFI_IMAGE_ID ImageId;
-} EFI_HII_IIBT_DUPLICATE_BLOCK;
-
-typedef struct _EFI_HII_IIBT_JPEG_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT32 Size;
- UINT8 Data[1];
-} EFI_HII_IIBT_JPEG_BLOCK;
-
-typedef struct _EFI_HII_IIBT_SKIP1_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT8 SkipCount;
-} EFI_HII_IIBT_SKIP1_BLOCK;
-
-typedef struct _EFI_HII_IIBT_SKIP2_BLOCK {
- EFI_HII_IMAGE_BLOCK Header;
- UINT16 SkipCount;
-} EFI_HII_IIBT_SKIP2_BLOCK;
-
-typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER {
- UINT16 PaletteCount;
-} EFI_HII_IMAGE_PALETTE_INFO_HEADER;
-
-typedef struct _EFI_HII_IMAGE_PALETTE_INFO {
- UINT16 PaletteSize;
- EFI_HII_RGB_PIXEL PaletteValue[1];
-} EFI_HII_IMAGE_PALETTE_INFO;
-
-//
-// Forms Package
-//
-
-typedef struct _EFI_HII_FORM_PACKAGE {
- EFI_HII_PACKAGE_HEADER Header;
- // EFI_IFR_OP_HEADER OpCodeHeader;
- // More op-codes follow
-} EFI_HII_FORM_PACKAGE;
-
-typedef struct {
- UINT8 Hour;
- UINT8 Minute;
- UINT8 Second;
-} EFI_HII_TIME;
-
-typedef struct {
- UINT16 Year;
- UINT8 Month;
- UINT8 Day;
-} EFI_HII_DATE;
-
-typedef struct {
- EFI_QUESTION_ID QuestionId;
- EFI_FORM_ID FormId;
- EFI_GUID FormSetGuid;
- EFI_STRING_ID DevicePath;
-} EFI_HII_REF;
-
-typedef union {
- UINT8 u8;
- UINT16 u16;
- UINT32 u32;
- UINT64 u64;
- BOOLEAN b;
- EFI_HII_TIME time;
- EFI_HII_DATE date;
- EFI_STRING_ID string;
- EFI_HII_REF ref;
-} EFI_IFR_TYPE_VALUE;
-
-#define EFI_IFR_FORM_OP 0x01
-#define EFI_IFR_SUBTITLE_OP 0x02
-#define EFI_IFR_TEXT_OP 0x03
-#define EFI_IFR_IMAGE_OP 0x04
-#define EFI_IFR_ONE_OF_OP 0x05
-#define EFI_IFR_CHECKBOX_OP 0x06
-#define EFI_IFR_NUMERIC_OP 0x07
-#define EFI_IFR_PASSWORD_OP 0x08
-#define EFI_IFR_ONE_OF_OPTION_OP 0x09
-#define EFI_IFR_SUPPRESS_IF_OP 0x0A
-#define EFI_IFR_LOCKED_OP 0x0B
-#define EFI_IFR_ACTION_OP 0x0C
-#define EFI_IFR_RESET_BUTTON_OP 0x0D
-#define EFI_IFR_FORM_SET_OP 0x0E
-#define EFI_IFR_REF_OP 0x0F
-#define EFI_IFR_NO_SUBMIT_IF_OP 0x10
-#define EFI_IFR_INCONSISTENT_IF_OP 0x11
-#define EFI_IFR_EQ_ID_VAL_OP 0x12
-#define EFI_IFR_EQ_ID_ID_OP 0x13
-#define EFI_IFR_EQ_ID_VAL_LIST_OP 0x14
-#define EFI_IFR_AND_OP 0x15
-#define EFI_IFR_OR_OP 0x16
-#define EFI_IFR_NOT_OP 0x17
-#define EFI_IFR_RULE_OP 0x18
-#define EFI_IFR_GRAY_OUT_IF_OP 0x19
-#define EFI_IFR_DATE_OP 0x1A
-#define EFI_IFR_TIME_OP 0x1B
-#define EFI_IFR_STRING_OP 0x1C
-#define EFI_IFR_REFRESH_OP 0x1D
-#define EFI_IFR_DISABLE_IF_OP 0x1E
-#define EFI_IFR_TO_LOWER_OP 0x20
-#define EFI_IFR_TO_UPPER_OP 0x21
-#define EFI_IFR_MAP_OP 0x22
-#define EFI_IFR_ORDERED_LIST_OP 0x23
-#define EFI_IFR_VARSTORE_OP 0x24
-#define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25
-#define EFI_IFR_VARSTORE_EFI_OP 0x26
-#define EFI_IFR_VARSTORE_DEVICE_OP 0x27
-#define EFI_IFR_VERSION_OP 0x28
-#define EFI_IFR_END_OP 0x29
-#define EFI_IFR_MATCH_OP 0x2A
-#define EFI_IFR_GET_OP 0x2B
-#define EFI_IFR_SET_OP 0x2C
-#define EFI_IFR_READ_OP 0x2D
-#define EFI_IFR_WRITE_OP 0x2E
-#define EFI_IFR_EQUAL_OP 0x2F
-#define EFI_IFR_NOT_EQUAL_OP 0x30
-#define EFI_IFR_GREATER_THAN_OP 0x31
-#define EFI_IFR_GREATER_EQUAL_OP 0x32
-#define EFI_IFR_LESS_THAN_OP 0x33
-#define EFI_IFR_LESS_EQUAL_OP 0x34
-#define EFI_IFR_BITWISE_AND_OP 0x35
-#define EFI_IFR_BITWISE_OR_OP 0x36
-#define EFI_IFR_BITWISE_NOT_OP 0x37
-#define EFI_IFR_SHIFT_LEFT_OP 0x38
-#define EFI_IFR_SHIFT_RIGHT_OP 0x39
-#define EFI_IFR_ADD_OP 0x3A
-#define EFI_IFR_SUBTRACT_OP 0x3B
-#define EFI_IFR_MULTIPLY_OP 0x3C
-#define EFI_IFR_DIVIDE_OP 0x3D
-#define EFI_IFR_MODULO_OP 0x3E
-#define EFI_IFR_RULE_REF_OP 0x3F
-#define EFI_IFR_QUESTION_REF1_OP 0x40
-#define EFI_IFR_QUESTION_REF2_OP 0x41
-#define EFI_IFR_UINT8_OP 0x42
-#define EFI_IFR_UINT16_OP 0x43
-#define EFI_IFR_UINT32_OP 0x44
-#define EFI_IFR_UINT64_OP 0x45
-#define EFI_IFR_TRUE_OP 0x46
-#define EFI_IFR_FALSE_OP 0x47
-#define EFI_IFR_TO_UINT_OP 0x48
-#define EFI_IFR_TO_STRING_OP 0x49
-#define EFI_IFR_TO_BOOLEAN_OP 0x4A
-#define EFI_IFR_MID_OP 0x4B
-#define EFI_IFR_FIND_OP 0x4C
-#define EFI_IFR_TOKEN_OP 0x4D
-#define EFI_IFR_STRING_REF1_OP 0x4E
-#define EFI_IFR_STRING_REF2_OP 0x4F
-#define EFI_IFR_CONDITIONAL_OP 0x50
-#define EFI_IFR_QUESTION_REF3_OP 0x51
-#define EFI_IFR_ZERO_OP 0x52
-#define EFI_IFR_ONE_OP 0x53
-#define EFI_IFR_ONES_OP 0x54
-#define EFI_IFR_UNDEFINED_OP 0x55
-#define EFI_IFR_LENGTH_OP 0x56
-#define EFI_IFR_DUP_OP 0x57
-#define EFI_IFR_THIS_OP 0x58
-#define EFI_IFR_SPAN_OP 0x59
-#define EFI_IFR_VALUE_OP 0x5A
-#define EFI_IFR_DEFAULT_OP 0x5B
-#define EFI_IFR_DEFAULTSTORE_OP 0x5C
-#define EFI_IFR_FORM_MAP_OP 0x5D
-#define EFI_IFR_CATENATE_OP 0x5E
-#define EFI_IFR_GUID_OP 0x5F
-#define EFI_IFR_SECURITY_OP 0x60
-#define EFI_IFR_MODAL_TAG_OP 0x61
-#define EFI_IFR_REFRESH_ID_OP 0x62
-
-
-typedef struct _EFI_IFR_OP_HEADER {
- UINT8 OpCode;
- UINT8 Length:7;
- UINT8 Scope:1;
-} EFI_IFR_OP_HEADER;
-
-typedef struct _EFI_IFR_STATEMENT_HEADER {
- EFI_STRING_ID Prompt;
- EFI_STRING_ID Help;
-} EFI_IFR_STATEMENT_HEADER;
-
-typedef struct _EFI_IFR_QUESTION_HEADER {
- EFI_IFR_STATEMENT_HEADER Header;
- EFI_QUESTION_ID QuestionId;
- EFI_VARSTORE_ID VarStoreId;
- union {
- EFI_STRING_ID VarName;
- UINT16 VarOffset;
- } VarStoreInfo;
- UINT8 Flags;
-} EFI_IFR_QUESTION_HEADER;
-
-#define EFI_IFR_FLAG_READ_ONLY 0x01
-#define EFI_IFR_FLAG_CALLBACK 0x04
-#define EFI_IFR_FLAG_RESET_REQUIRED 0x10
-#define EFI_IFR_FLAG_OPTIONS_ONLY 0x80
-
-typedef struct _EFI_IFR_DEFAULTSTORE {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID DefaultName;
- UINT16 DefaultId;
-} EFI_IFR_DEFAULTSTORE;
-
-#define EFI_HII_DEFAULT_CLASS_STANDARD 0x0000
-#define EFI_HII_DEFAULT_CLASS_MANUFACTURING 0x0001
-#define EFI_HII_DEFAULT_CLASS_SAFE 0x0002
-#define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN 0x4000
-#define EFI_HII_DEFAULT_CLASS_PLATFORM_END 0x7fff
-#define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN 0x8000
-#define EFI_HII_DEFAULT_CLASS_HARDWARE_END 0xbfff
-#define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN 0xc000
-#define EFI_HII_DEFAULT_CLASS_FIRMWARE_END 0xffff
-
-typedef struct _EFI_IFR_VARSTORE {
- EFI_IFR_OP_HEADER Header;
- EFI_GUID Guid;
- EFI_VARSTORE_ID VarStoreId;
- UINT16 Size;
- UINT8 Name[1];
-} EFI_IFR_VARSTORE;
-
-typedef struct _EFI_IFR_VARSTORE_EFI {
- EFI_IFR_OP_HEADER Header;
- EFI_VARSTORE_ID VarStoreId;
- EFI_GUID Guid;
- UINT32 Attributes;
- UINT16 Size;
- UINT8 Name[1];
-} EFI_IFR_VARSTORE_EFI;
-
-typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {
- EFI_IFR_OP_HEADER Header;
- EFI_VARSTORE_ID VarStoreId;
- EFI_GUID Guid;
-} EFI_IFR_VARSTORE_NAME_VALUE;
-
-typedef struct _EFI_IFR_FORM_SET {
- EFI_IFR_OP_HEADER Header;
- EFI_GUID Guid;
- EFI_STRING_ID FormSetTitle;
- EFI_STRING_ID Help;
- UINT8 Flags;
- // EFI_GUID ClassGuid[];
-} EFI_IFR_FORM_SET;
-
-typedef struct _EFI_IFR_END {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_END;
-
-typedef struct _EFI_IFR_FORM {
- EFI_IFR_OP_HEADER Header;
- UINT16 FormId;
- EFI_STRING_ID FormTitle;
-} EFI_IFR_FORM;
-
-typedef struct _EFI_IFR_IMAGE {
- EFI_IFR_OP_HEADER Header;
- EFI_IMAGE_ID Id;
-} EFI_IFR_IMAGE;
-
-typedef struct _EFI_IFR_MODAL_TAG {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MODAL_TAG;
-
-typedef struct _EFI_IFR_LOCKED {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_LOCKED;
-
-typedef struct _EFI_IFR_RULE {
- EFI_IFR_OP_HEADER Header;
- UINT8 RuleId;
-} EFI_IFR_RULE;
-
-typedef struct _EFI_IFR_DEFAULT {
- EFI_IFR_OP_HEADER Header;
- UINT16 DefaultId;
- UINT8 Type;
- EFI_IFR_TYPE_VALUE Value;
-} EFI_IFR_DEFAULT;
-
-typedef struct _EFI_IFR_DEFAULT_2 {
- EFI_IFR_OP_HEADER Header;
- UINT16 DefaultId;
- UINT8 Type;
-} EFI_IFR_DEFAULT_2;
-
-typedef struct _EFI_IFR_VALUE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_VALUE;
-
-typedef struct _EFI_IFR_SUBTITLE {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_STATEMENT_HEADER Statement;
- UINT8 Flags;
-} EFI_IFR_SUBTITLE;
-
-#define EFI_IFR_FLAGS_HORIZONTAL 0x01
-
-typedef struct _EFI_IFR_CHECKBOX {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 Flags;
-} EFI_IFR_CHECKBOX;
-
-#define EFI_IFR_CHECKBOX_DEFAULT 0x01
-#define EFI_IFR_CHECKBOX_DEFAULT_MFG 0x02
-
-typedef struct _EFI_IFR_TEXT {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_STATEMENT_HEADER Statement;
- EFI_STRING_ID TextTwo;
-} EFI_IFR_TEXT;
-
-typedef struct _EFI_IFR_REF {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- EFI_FORM_ID FormId;
-} EFI_IFR_REF;
-
-typedef struct _EFI_IFR_REF2 {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- EFI_FORM_ID FormId;
- EFI_QUESTION_ID QuestionId;
-} EFI_IFR_REF2;
-
-typedef struct _EFI_IFR_REF3 {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- EFI_FORM_ID FormId;
- EFI_QUESTION_ID QuestionId;
- EFI_GUID FormSetId;
-} EFI_IFR_REF3;
-
-typedef struct _EFI_IFR_REF4 {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- EFI_FORM_ID FormId;
- EFI_QUESTION_ID QuestionId;
- EFI_GUID FormSetId;
- EFI_STRING_ID DevicePath;
-} EFI_IFR_REF4;
-
-typedef struct _EFI_IFR_REF5 {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
-} EFI_IFR_REF5;
-
-typedef struct _EFI_IFR_RESET_BUTTON {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_STATEMENT_HEADER Statement;
- EFI_DEFAULT_ID DefaultId;
-} EFI_IFR_RESET_BUTTON;
-
-typedef struct _EFI_IFR_ACTION {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- EFI_STRING_ID QuestionConfig;
-} EFI_IFR_ACTION;
-
-typedef struct _EFI_IFR_ACTION_1 {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
-} EFI_IFR_ACTION_1;
-
-typedef struct _EFI_IFR_DATE {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 Flags;
-} EFI_IFR_DATE;
-
-#define EFI_QF_DATE_YEAR_SUPPRESS 0x01
-#define EFI_QF_DATE_MONTH_SUPPRESS 0x02
-#define EFI_QF_DATE_DAY_SUPPRESS 0x04
-
-#define EFI_QF_DATE_STORAGE 0x30
-#define QF_DATE_STORAGE_NORMAL 0x00
-#define QF_DATE_STORAGE_TIME 0x10
-#define QF_DATE_STORAGE_WAKEUP 0x20
-
-typedef union {
- struct {
- UINT8 MinValue;
- UINT8 MaxValue;
- UINT8 Step;
- } u8;
- struct {
- UINT16 MinValue;
- UINT16 MaxValue;
- UINT16 Step;
- } u16;
- struct {
- UINT32 MinValue;
- UINT32 MaxValue;
- UINT32 Step;
- } u32;
- struct {
- UINT64 MinValue;
- UINT64 MaxValue;
- UINT64 Step;
- } u64;
-} MINMAXSTEP_DATA;
-
-typedef struct _EFI_IFR_NUMERIC {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 Flags;
- MINMAXSTEP_DATA data;
-} EFI_IFR_NUMERIC;
-
-#define EFI_IFR_NUMERIC_SIZE 0x03
-#define EFI_IFR_NUMERIC_SIZE_1 0x00
-#define EFI_IFR_NUMERIC_SIZE_2 0x01
-#define EFI_IFR_NUMERIC_SIZE_4 0x02
-#define EFI_IFR_NUMERIC_SIZE_8 0x03
-
-#define EFI_IFR_DISPLAY 0x30
-#define EFI_IFR_DISPLAY_INT_DEC 0x00
-#define EFI_IFR_DISPLAY_UINT_DEC 0x10
-#define EFI_IFR_DISPLAY_UINT_HEX 0x20
-
-typedef struct _EFI_IFR_ONE_OF {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 Flags;
- MINMAXSTEP_DATA data;
-} EFI_IFR_ONE_OF;
-
-typedef struct _EFI_IFR_STRING {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 MinSize;
- UINT8 MaxSize;
- UINT8 Flags;
-} EFI_IFR_STRING;
-
-#define EFI_IFR_STRING_MULTI_LINE 0x01
-
-typedef struct _EFI_IFR_PASSWORD {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT16 MinSize;
- UINT16 MaxSize;
-} EFI_IFR_PASSWORD;
-
-typedef struct _EFI_IFR_ORDERED_LIST {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 MaxContainers;
- UINT8 Flags;
-} EFI_IFR_ORDERED_LIST;
-
-#define EFI_IFR_UNIQUE_SET 0x01
-#define EFI_IFR_NO_EMPTY_SET 0x02
-
-typedef struct _EFI_IFR_TIME {
- EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
- UINT8 Flags;
-} EFI_IFR_TIME;
-
-#define QF_TIME_HOUR_SUPPRESS 0x01
-#define QF_TIME_MINUTE_SUPPRESS 0x02
-#define QF_TIME_SECOND_SUPPRESS 0x04
-
-#define QF_TIME_STORAGE 0x30
-#define QF_TIME_STORAGE_NORMAL 0x00
-#define QF_TIME_STORAGE_TIME 0x10
-#define QF_TIME_STORAGE_WAKEUP 0x20
-
-typedef struct _EFI_IFR_DISABLE_IF {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_DISABLE_IF;
-
-typedef struct _EFI_IFR_SUPPRESS_IF {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_SUPPRESS_IF;
-
-typedef struct _EFI_IFR_GRAY_OUT_IF {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_GRAY_OUT_IF;
-
-typedef struct _EFI_IFR_INCONSISTENT_IF {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID Error;
-} EFI_IFR_INCONSISTENT_IF;
-
-typedef struct _EFI_IFR_NO_SUBMIT_IF {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID Error;
-} EFI_IFR_NO_SUBMIT_IF;
-
-typedef struct _EFI_IFR_REFRESH {
- EFI_IFR_OP_HEADER Header;
- UINT8 RefreshInterval;
-} EFI_IFR_REFRESH;
-
-typedef struct _EFI_IFR_REFRESH_ID {
- EFI_IFR_OP_HEADER Header;
- EFI_GUID RefreshEventGroupId;
-} EFI_IFR_REFRESH_ID;
-
-typedef struct _EFI_IFR_VARSTORE_DEVICE {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID DevicePath;
-} EFI_IFR_VARSTORE_DEVICE;
-
-typedef struct _EFI_IFR_ONE_OF_OPTION {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID Option;
- UINT8 Flags;
- UINT8 Type;
- EFI_IFR_TYPE_VALUE Value;
-} EFI_IFR_ONE_OF_OPTION;
-
-#define EFI_IFR_TYPE_NUM_SIZE_8 0x00
-#define EFI_IFR_TYPE_NUM_SIZE_16 0x01
-#define EFI_IFR_TYPE_NUM_SIZE_32 0x02
-#define EFI_IFR_TYPE_NUM_SIZE_64 0x03
-#define EFI_IFR_TYPE_BOOLEAN 0x04
-#define EFI_IFR_TYPE_TIME 0x05
-#define EFI_IFR_TYPE_DATE 0x06
-#define EFI_IFR_TYPE_STRING 0x07
-#define EFI_IFR_TYPE_OTHER 0x08
-#define EFI_IFR_TYPE_UNDEFINED 0x09
-#define EFI_IFR_TYPE_ACTION 0x0A
-#define EFI_IFR_TYPE_BUFFER 0x0B
-#define EFI_IFR_TYPE_REF 0x0C
-
-#define EFI_IFR_OPTION_DEFAULT 0x10
-#define EFI_IFR_OPTION_DEFAULT_MFG 0x20
-
-typedef struct _EFI_IFR_GUID {
- EFI_IFR_OP_HEADER Header;
- EFI_GUID Guid;
- //Optional Data Follows
-} EFI_IFR_GUID;
-
-typedef struct _EFI_IFR_DUP {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_DUP;
-
-typedef struct _EFI_IFR_EQ_ID_ID {
- EFI_IFR_OP_HEADER Header;
- EFI_QUESTION_ID QuestionId1;
- EFI_QUESTION_ID QuestionId2;
-} EFI_IFR_EQ_ID_ID;
-
-typedef struct _EFI_IFR_EQ_ID_VAL {
- EFI_IFR_OP_HEADER Header;
- EFI_QUESTION_ID QuestionId;
- UINT16 Value;
-} EFI_IFR_EQ_ID_VAL;
-
-typedef struct _EFI_IFR_EQ_ID_VAL_LIST {
- EFI_IFR_OP_HEADER Header;
- EFI_QUESTION_ID QuestionId;
- UINT16 ListLength;
- UINT16 ValueList[1];
-} EFI_IFR_EQ_ID_VAL_LIST;
-
-typedef struct _EFI_IFR_QUESTION_REF1 {
- EFI_IFR_OP_HEADER Header;
- EFI_QUESTION_ID QuestionId;
-} EFI_IFR_QUESTION_REF1;
-
-typedef struct _EFI_IFR_UINT8 {
- EFI_IFR_OP_HEADER Header;
- UINT8 Value;
-} EFI_IFR_UINT8;
-
-typedef struct _EFI_IFR_UINT16 {
- EFI_IFR_OP_HEADER Header;
- UINT16 Value;
-} EFI_IFR_UINT16;
-
-typedef struct _EFI_IFR_QUESTION_REF2 {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_QUESTION_REF2;
-
-typedef struct _EFI_IFR_UINT32 {
- EFI_IFR_OP_HEADER Header;
- UINT32 Value;
-} EFI_IFR_UINT32;
-
-typedef struct _EFI_IFR_UINT64 {
- EFI_IFR_OP_HEADER Header;
- UINT64 Value;
-} EFI_IFR_UINT64;
-
-typedef struct _EFI_IFR_QUESTION_REF3 {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_QUESTION_REF3;
-
-typedef struct _EFI_IFR_QUESTION_REF3_2 {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID DevicePath;
-} EFI_IFR_QUESTION_REF3_2;
-
-typedef struct _EFI_IFR_QUESTION_REF3_3 {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID DevicePath;
- EFI_GUID Guid;
-} EFI_IFR_QUESTION_REF3_3;
-
-typedef struct _EFI_IFR_RULE_REF {
- EFI_IFR_OP_HEADER Header;
- UINT8 RuleId;
-} EFI_IFR_RULE_REF;
-
-typedef struct _EFI_IFR_STRING_REF1 {
- EFI_IFR_OP_HEADER Header;
- EFI_STRING_ID StringId;
-} EFI_IFR_STRING_REF1;
-
-typedef struct _EFI_IFR_STRING_REF2 {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_STRING_REF2;
-
-typedef struct _EFI_IFR_THIS {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_THIS;
-
-typedef struct _EFI_IFR_TRUE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TRUE;
-
-typedef struct _EFI_IFR_FALSE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_FALSE;
-
-typedef struct _EFI_IFR_ONE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_ONE;
-
-typedef struct _EFI_IFR_ONES {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_ONES;
-
-typedef struct _EFI_IFR_ZERO {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_ZERO;
-
-typedef struct _EFI_IFR_UNDEFINED {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_UNDEFINED;
-
-typedef struct _EFI_IFR_VERSION {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_VERSION;
-
-typedef struct _EFI_IFR_LENGTH {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_LENGTH;
-
-typedef struct _EFI_IFR_NOT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_NOT;
-
-typedef struct _EFI_IFR_BITWISE_NOT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_BITWISE_NOT;
-
-typedef struct _EFI_IFR_TO_BOOLEAN {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TO_BOOLEAN;
-
-#define EFI_IFR_STRING_UNSIGNED_DEC 0
-#define EFI_IFR_STRING_SIGNED_DEC 1
-#define EFI_IFR_STRING_LOWERCASE_HEX 2
-#define EFI_IFR_STRING_UPPERCASE_HEX 3
-
-#define EFI_IFR_STRING_ASCII 0
-#define EFI_IFR_STRING_UNICODE 8
-
-typedef struct _EFI_IFR_TO_STRING {
- EFI_IFR_OP_HEADER Header;
- UINT8 Format;
-} EFI_IFR_TO_STRING;
-
-typedef struct _EFI_IFR_TO_UINT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TO_UINT;
-
-typedef struct _EFI_IFR_TO_UPPER {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TO_UPPER;
-
-typedef struct _EFI_IFR_TO_LOWER {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TO_LOWER;
-
-typedef struct _EFI_IFR_ADD {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_ADD;
-
-typedef struct _EFI_IFR_AND {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_AND;
-
-typedef struct _EFI_IFR_BITWISE_AND {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_BITWISE_AND;
-
-typedef struct _EFI_IFR_BITWISE_OR {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_BITWISE_OR;
-
-typedef struct _EFI_IFR_CATENATE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_CATENATE;
-
-typedef struct _EFI_IFR_DIVIDE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_DIVIDE;
-
-typedef struct _EFI_IFR_EQUAL {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_EQUAL;
-
-typedef struct _EFI_IFR_GREATER_EQUAL {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_GREATER_EQUAL;
-
-typedef struct _EFI_IFR_GREATER_THAN {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_GREATER_THAN;
-
-typedef struct _EFI_IFR_LESS_EQUAL {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_LESS_EQUAL;
-
-typedef struct _EFI_IFR_LESS_THAN {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_LESS_THAN;
-
-typedef struct _EFI_IFR_MATCH {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MATCH;
-
-typedef struct _EFI_IFR_MULTIPLY {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MULTIPLY;
-
-typedef struct _EFI_IFR_MODULO {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MODULO;
-
-typedef struct _EFI_IFR_NOT_EQUAL {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_NOT_EQUAL;
-
-typedef struct _EFI_IFR_OR {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_OR;
-
-typedef struct _EFI_IFR_SHIFT_LEFT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_SHIFT_LEFT;
-
-typedef struct _EFI_IFR_SHIFT_RIGHT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_SHIFT_RIGHT;
-
-typedef struct _EFI_IFR_SUBTRACT {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_SUBTRACT;
-
-typedef struct _EFI_IFR_CONDITIONAL {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_CONDITIONAL;
-
-#define EFI_IFR_FF_CASE_SENSITIVE 0x00
-#define EFI_IFR_FF_CASE_INSENSITIVE 0x01
-
-typedef struct _EFI_IFR_FIND {
- EFI_IFR_OP_HEADER Header;
- UINT8 Format;
-} EFI_IFR_FIND;
-
-typedef struct _EFI_IFR_MID {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MID;
-
-typedef struct _EFI_IFR_TOKEN {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_TOKEN;
-
-#define EFI_IFR_FLAGS_FIRST_MATCHING 0x00
-#define EFI_IFR_FLAGS_FIRST_NON_MATCHING 0x01
-
-typedef struct _EFI_IFR_SPAN {
- EFI_IFR_OP_HEADER Header;
- UINT8 Flags;
-} EFI_IFR_SPAN;
-
-typedef struct _EFI_IFR_SECURITY {
- ///
- /// Standard opcode header, where Header.Op = EFI_IFR_SECURITY_OP.
- ///
- EFI_IFR_OP_HEADER Header;
- ///
- /// Security permission level.
- ///
- EFI_GUID Permissions;
-} EFI_IFR_SECURITY;
-
-typedef struct _EFI_IFR_FORM_MAP_METHOD {
- ///
- /// The string identifier which provides the human-readable name of
- /// the configuration method for this standards map form.
- ///
- EFI_STRING_ID MethodTitle;
- ///
- /// Identifier which uniquely specifies the configuration methods
- /// associated with this standards map form.
- ///
- EFI_GUID MethodIdentifier;
-} EFI_IFR_FORM_MAP_METHOD;
-
-typedef struct _EFI_IFR_FORM_MAP {
- ///
- /// The sequence that defines the type of opcode as well as the length
- /// of the opcode being defined. Header.OpCode = EFI_IFR_FORM_MAP_OP.
- ///
- EFI_IFR_OP_HEADER Header;
- ///
- /// The unique identifier for this particular form.
- ///
- EFI_FORM_ID FormId;
- ///
- /// One or more configuration method's name and unique identifier.
- ///
- // EFI_IFR_FORM_MAP_METHOD Methods[];
-} EFI_IFR_FORM_MAP;
-
-typedef struct _EFI_IFR_SET {
- ///
- /// The sequence that defines the type of opcode as well as the length
- /// of the opcode being defined. Header.OpCode = EFI_IFR_SET_OP.
- ///
- EFI_IFR_OP_HEADER Header;
- ///
- /// Specifies the identifier of a previously declared variable store to
- /// use when storing the question's value.
- ///
- EFI_VARSTORE_ID VarStoreId;
- union {
- ///
- /// A 16-bit Buffer Storage offset.
- ///
- EFI_STRING_ID VarName;
- ///
- /// A Name Value or EFI Variable name (VarName).
- ///
- UINT16 VarOffset;
- } VarStoreInfo;
- ///
- /// Specifies the type used for storage.
- ///
- UINT8 VarStoreType;
-} EFI_IFR_SET;
-
-typedef struct _EFI_IFR_GET {
- ///
- /// The sequence that defines the type of opcode as well as the length
- /// of the opcode being defined. Header.OpCode = EFI_IFR_GET_OP.
- ///
- EFI_IFR_OP_HEADER Header;
- ///
- /// Specifies the identifier of a previously declared variable store to
- /// use when retrieving the value.
- ///
- EFI_VARSTORE_ID VarStoreId;
- union {
- ///
- /// A 16-bit Buffer Storage offset.
- ///
- EFI_STRING_ID VarName;
- ///
- /// A Name Value or EFI Variable name (VarName).
- ///
- UINT16 VarOffset;
- } VarStoreInfo;
- ///
- /// Specifies the type used for storage.
- ///
- UINT8 VarStoreType;
-} EFI_IFR_GET;
-
-typedef struct _EFI_IFR_READ {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_READ;
-
-typedef struct _EFI_IFR_WRITE {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_WRITE;
-
-typedef struct _EFI_IFR_MAP {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_MAP;
-//
-// Keyboard Package
-//
-
-typedef enum {
- EfiKeyLCtrl,
- EfiKeyA0,
- EfiKeyLAlt,
- EfiKeySpaceBar,
- EfiKeyA2,
- EfiKeyA3,
- EfiKeyA4,
- EfiKeyRCtrl,
- EfiKeyLeftArrow,
- EfiKeyDownArrow,
- EfiKeyRightArrow,
- EfiKeyZero,
- EfiKeyPeriod,
- EfiKeyEnter,
- EfiKeyLShift,
- EfiKeyB0,
- EfiKeyB1,
- EfiKeyB2,
- EfiKeyB3,
- EfiKeyB4,
- EfiKeyB5,
- EfiKeyB6,
- EfiKeyB7,
- EfiKeyB8,
- EfiKeyB9,
- EfiKeyB10,
- EfiKeyRshift,
- EfiKeyUpArrow,
- EfiKeyOne,
- EfiKeyTwo,
- EfiKeyThree,
- EfiKeyCapsLock,
- EfiKeyC1,
- EfiKeyC2,
- EfiKeyC3,
- EfiKeyC4,
- EfiKeyC5,
- EfiKeyC6,
- EfiKeyC7,
- EfiKeyC8,
- EfiKeyC9,
- EfiKeyC10,
- EfiKeyC11,
- EfiKeyC12,
- EfiKeyFour,
- EfiKeyFive,
- EfiKeySix,
- EfiKeyPlus,
- EfiKeyTab,
- EfiKeyD1,
- EfiKeyD2,
- EfiKeyD3,
- EfiKeyD4,
- EfiKeyD5,
- EfiKeyD6,
- EfiKeyD7,
- EfiKeyD8,
- EfiKeyD9,
- EfiKeyD10,
- EfiKeyD11,
- EfiKeyD12,
- EfiKeyD13,
- EfiKeyDel,
- EfiKeyEnd,
- EfiKeyPgDn,
- EfiKeySeven,
- EfiKeyEight,
- EfiKeyNine,
- EfiKeyE0,
- EfiKeyE1,
- EfiKeyE2,
- EfiKeyE3,
- EfiKeyE4,
- EfiKeyE5,
- EfiKeyE6,
- EfiKeyE7,
- EfiKeyE8,
- EfiKeyE9,
- EfiKeyE10,
- EfiKeyE11,
- EfiKeyE12,
- EfiKeyBackSpace,
- EfiKeyIns,
- EfiKeyHome,
- EfiKeyPgUp,
- EfiKeyNLck,
- EfiKeySlash,
- EfiKeyAsterisk,
- EfiKeyMinus,
- EfiKeyEsc,
- EfiKeyF1,
- EfiKeyF2,
- EfiKeyF3,
- EfiKeyF4,
- EfiKeyF5,
- EfiKeyF6,
- EfiKeyF7,
- EfiKeyF8,
- EfiKeyF9,
- EfiKeyF10,
- EfiKeyF11,
- EfiKeyF12,
- EfiKeyPrint,
- EfiKeySLck,
- EfiKeyPause
-} EFI_KEY;
-
-typedef struct {
- EFI_KEY Key;
- CHAR16 Unicode;
- CHAR16 ShiftedUnicode;
- CHAR16 AltGrUnicode;
- CHAR16 ShiftedAltGrUnicode;
- UINT16 Modifier;
- UINT16 AffectedAttribute;
-} EFI_KEY_DESCRIPTOR;
-
-//
-// A key which is affected by all the standard shift modifiers.
-// Most keys would be expected to have this bit active.
-//
-#define EFI_AFFECTED_BY_STANDARD_SHIFT 0x0001
-//
-// This key is affected by the caps lock so that if a keyboard driver
-// would need to disambiguate between a key which had a "1" defined
-// versus a "a" character. Having this bit turned on would tell
-// the keyboard driver to use the appropriate shifted state or not.
-//
-#define EFI_AFFECTED_BY_CAPS_LOCK 0x0002
-//
-// Similar to the case of CAPS lock, if this bit is active, the key
-// is affected by the num lock being turned on.
-//
-#define EFI_AFFECTED_BY_NUM_LOCK 0x0004
-
-typedef struct {
- UINT16 LayoutLength;
- EFI_GUID Guid;
- UINT32 LayoutDescriptorStringOffset;
- UINT8 DescriptorCount;
- // EFI_KEY_DESCRIPTOR Descriptors[];
-} EFI_HII_KEYBOARD_LAYOUT;
-
-typedef struct {
- EFI_HII_PACKAGE_HEADER Header;
- UINT16 LayoutCount;
- // EFI_HII_KEYBOARD_LAYOUT Layout[];
-} EFI_HII_KEYBOARD_PACKAGE_HDR;
-
-typedef struct {
- CHAR16 Language[3];
- CHAR16 Space;
- CHAR16 DescriptionString[1];
-} EFI_DESCRIPTION_STRING;
-
-typedef struct {
- UINT16 DescriptionCount;
- EFI_DESCRIPTION_STRING DescriptionString[1];
-} EFI_DESCRIPTION_STRING_BUNDLE;
-
-//
-// Modifier values
-//
-#define EFI_NULL_MODIFIER 0x0000
-#define EFI_LEFT_CONTROL_MODIFIER 0x0001
-#define EFI_RIGHT_CONTROL_MODIFIER 0x0002
-#define EFI_LEFT_ALT_MODIFIER 0x0003
-#define EFI_RIGHT_ALT_MODIFIER 0x0004
-#define EFI_ALT_GR_MODIFIER 0x0005
-#define EFI_INSERT_MODIFIER 0x0006
-#define EFI_DELETE_MODIFIER 0x0007
-#define EFI_PAGE_DOWN_MODIFIER 0x0008
-#define EFI_PAGE_UP_MODIFIER 0x0009
-#define EFI_HOME_MODIFIER 0x000A
-#define EFI_END_MODIFIER 0x000B
-#define EFI_LEFT_SHIFT_MODIFIER 0x000C
-#define EFI_RIGHT_SHIFT_MODIFIER 0x000D
-#define EFI_CAPS_LOCK_MODIFIER 0x000E
-#define EFI_NUM_LOCK _MODIFIER 0x000F
-#define EFI_LEFT_ARROW_MODIFIER 0x0010
-#define EFI_RIGHT_ARROW_MODIFIER 0x0011
-#define EFI_DOWN_ARROW_MODIFIER 0x0012
-#define EFI_UP_ARROW_MODIFIER 0x0013
-#define EFI_NS_KEY_MODIFIER 0x0014
-#define EFI_NS_KEY_DEPENDENCY_MODIFIER 0x0015
-#define EFI_FUNCTION_KEY_ONE_MODIFIER 0x0016
-#define EFI_FUNCTION_KEY_TWO_MODIFIER 0x0017
-#define EFI_FUNCTION_KEY_THREE_MODIFIER 0x0018
-#define EFI_FUNCTION_KEY_FOUR_MODIFIER 0x0019
-#define EFI_FUNCTION_KEY_FIVE_MODIFIER 0x001A
-#define EFI_FUNCTION_KEY_SIX_MODIFIER 0x001B
-#define EFI_FUNCTION_KEY_SEVEN_MODIFIER 0x001C
-#define EFI_FUNCTION_KEY_EIGHT_MODIFIER 0x001D
-#define EFI_FUNCTION_KEY_NINE_MODIFIER 0x001E
-#define EFI_FUNCTION_KEY_TEN_MODIFIER 0x001F
-#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020
-#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021
-
-//
-// Keys that have multiple control functions based on modifier
-// settings are handled in the keyboard driver implementation.
-// For instance PRINT_KEY might have a modifier held down and
-// is still a nonprinting character, but might have an alternate
-// control function like SYSREQUEST
-//
-#define EFI_PRINT_MODIFIER 0x0022
-#define EFI_SYS_REQUEST_MODIFIER 0x0023
-#define EFI_SCROLL_LOCK_MODIFIER 0x0024
-#define EFI_PAUSE_MODIFIER 0x0025
-#define EFI_BREAK_MODIFIER 0x0026
-
-#pragma pack()
-
-
-
-//
-// References to string tokens must use this macro to enable scanning for
-// token usages.
-//
-//
-// STRING_TOKEN is not defined in UEFI specification. But it is placed
-// here for the easy access by C files and VFR source files.
-//
-#define STRING_TOKEN(t) t
-
-#endif
diff --git a/BaseTools/Source/C/Include/Common/UefiMultiPhase.h b/BaseTools/Source/C/Include/Common/UefiMultiPhase.h
deleted file mode 100644
index 7c487471a8..0000000000
--- a/BaseTools/Source/C/Include/Common/UefiMultiPhase.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/** @file
- This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: UefiMultiPhase.h
-
-**/
-
-#ifndef __UEFI_MULTIPHASE_H__
-#define __UEFI_MULTIPHASE_H__
-
-//
-// Enumeration of memory types introduced in UEFI.
-//
-typedef enum {
- EfiReservedMemoryType,
- EfiLoaderCode,
- EfiLoaderData,
- EfiBootServicesCode,
- EfiBootServicesData,
- EfiRuntimeServicesCode,
- EfiRuntimeServicesData,
- EfiConventionalMemory,
- EfiUnusableMemory,
- EfiACPIReclaimMemory,
- EfiACPIMemoryNVS,
- EfiMemoryMappedIO,
- EfiMemoryMappedIOPortSpace,
- EfiPalCode,
- EfiMaxMemoryType
-} EFI_MEMORY_TYPE;
-
-
-//
-// Data structure that precedes all of the standard EFI table types.
-//
-typedef struct {
- UINT64 Signature;
- UINT32 Revision;
- UINT32 HeaderSize;
- UINT32 CRC32;
- UINT32 Reserved;
-} EFI_TABLE_HEADER;
-
-//
-// Attributes of variable.
-//
-#define EFI_VARIABLE_NON_VOLATILE 0x00000001
-#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
-#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
-#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
-
-//
-// This attribute is identified by the mnemonic 'HR'
-// elsewhere in this specification.
-//
-#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
-
-
-
-//
-// _WIN_CERTIFICATE.wCertificateType
-//
-#define WIN_CERT_TYPE_EFI_PKCS115 0x0EF0
-#define WIN_CERT_TYPE_EFI_GUID 0x0EF1
-
-/**
-
- The WIN_CERTIFICATE structure is part of the PE/COFF
- specification and has the following definition:
-
- @param dwLength The length of the entire certificate,
- including the length of the header, in
- bytes.
-
- @param wRevision The revision level of the WIN_CERTIFICATE
- structure. The current revision level is
- 0x0200.
-
- @param wCertificateType The certificate type. See
- WIN_CERT_TYPE_xxx for the UEFI
- certificate types. The UEFI
- specification reserves the range of
- certificate type values from 0x0EF0
- to 0x0EFF.
-
- @param bCertificate The actual certificate. The format of
- the certificate depends on
- wCertificateType. The format of the UEFI
- certificates is defined below.
-
-
-**/
-typedef struct _WIN_CERTIFICATE {
- UINT32 dwLength;
- UINT16 wRevision;
- UINT16 wCertificateType;
- //UINT8 bCertificate[ANYSIZE_ARRAY];
-} WIN_CERTIFICATE;
-
-//
-// WIN_CERTIFICATE_UEFI_GUID.CertType
-//
-#define EFI_CERT_TYPE_RSA2048_SHA256_GUID \
- {0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } }
-
-//
-// WIN_CERTIFICATE_UEFI_GUID.CertData
-//
-typedef struct _EFI_CERT_BLOCK_RSA_2048_SHA256 {
- EFI_GUID HashType;
- UINT8 PublicKey[256];
- UINT8 Signature[256];
-} EFI_CERT_BLOCK_RSA_2048_SHA256;
-
-
-/**
-
- @param Hdr This is the standard WIN_CERTIFICATE header, where
- wCertificateType is set to
- WIN_CERT_TYPE_EFI_GUID.
-
- @param CertType This is the unique id which determines the
- format of the CertData. In this case, the
- value is EFI_CERT_TYPE_RSA2048_SHA256_GUID.
-
- @param CertData This is the certificate data. The format of
- the data is determined by the CertType. In
- this case the value is
- EFI_CERT_BLOCK_RSA_2048_SHA256.
-
- @param Information The WIN_CERTIFICATE_UEFI_GUID certificate
- type allows new types of certificates to
- be developed for driver authentication
- without requiring a new certificate type.
- The CertType defines the format of the
- CertData, which length is defined by the
- size of the certificate less the fixed
- size of the WIN_CERTIFICATE_UEFI_GUID
- structure.
-
-**/
-typedef struct _WIN_CERTIFICATE_UEFI_GUID {
- WIN_CERTIFICATE Hdr;
- EFI_GUID CertType;
- // UINT8 CertData[ANYSIZE_ARRAY];
-} WIN_CERTIFICATE_UEFI_GUID;
-
-
-/**
-
- Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital
- signature.
-
- The WIN_CERTIFICATE_UEFI_PKCS1_15 structure is derived from
- WIN_CERTIFICATE and encapsulate the information needed to
- implement the RSASSA-PKCS1-v1_5 digital signature algorithm as
- specified in RFC2437.
-
- @param Hdr This is the standard WIN_CERTIFICATE header, where
- wCertificateType is set to
- WIN_CERT_TYPE_UEFI_PKCS1_15.
-
- @param HashAlgorithm This is the hashing algorithm which was
- performed on the UEFI executable when
- creating the digital signature. It is
- one of the enumerated values pre-defined
- in Section 26.4.1. See
- EFI_HASH_ALGORITHM_x.
-
- @param Signature This is the actual digital signature. The
- size of the signature is the same size as
- the key (1024-bit key is 128 bytes) and can
- be determined by subtracting the length of
- the other parts of this header from the
- total length of the certificate as found in
- Hdr.dwLength.
-
-**/
-typedef struct _WIN_CERTIFICATE_EFI_PKCS1_15 {
- WIN_CERTIFICATE Hdr;
- EFI_GUID HashAlgorithm;
- // UINT8 Signature[ANYSIZE_ARRAY];
-} WIN_CERTIFICATE_EFI_PKCS1_15;
-
-
-/**
-
- AuthInfo is a WIN_CERTIFICATE using the wCertificateType
- WIN_CERTIFICATE_UEFI_GUID and the CertType
- EFI_CERT_TYPE_RSA2048_SHA256. If the attribute specifies
- authenticated access, then the Data buffer should begin with an
- authentication descriptor prior to the data payload and DataSize
- should reflect the the data.and descriptor size. The caller
- shall digest the Monotonic Count value and the associated data
- for the variable update using the SHA-256 1-way hash algorithm.
- The ensuing the 32-byte digest will be signed using the private
- key associated w/ the public/private 2048-bit RSA key-pair. The
- WIN_CERTIFICATE shall be used to describe the signature of the
- Variable data *Data. In addition, the signature will also
- include the MonotonicCount value to guard against replay attacks
-
- @param MonotonicCount Included in the signature of
- AuthInfo.Used to ensure freshness/no
- replay. Incremented during each
- "Write" access.
-
- @param AuthInfo Provides the authorization for the variable
- access. It is a signature across the
- variable data and the Monotonic Count
- value. Caller uses Private key that is
- associated with a public key that has been
- provisioned via the key exchange.
-
-**/
-typedef struct {
- UINT64 MonotonicCount;
- WIN_CERTIFICATE_UEFI_GUID AuthInfo;
-} EFI_VARIABLE_AUTHENTICATION;
-
-#endif
-
diff --git a/BaseTools/Source/C/Include/Common/VariableFormat.h b/BaseTools/Source/C/Include/Common/VariableFormat.h
deleted file mode 100644
index a0e25be878..0000000000
--- a/BaseTools/Source/C/Include/Common/VariableFormat.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/**@file
- Header file for EFI Variable Services.
-
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: VariableFormat.h
-
-**/
-
-#ifndef __VARIABLE_FORMAT_H__
-#define __VARIABLE_FORMAT_H__
-
-#define VARIABLE_DATA 0x55AA
-
-//
-// Variable Store Header flags
-//
-#define VARIABLE_STORE_FORMATTED 0x5a
-#define VARIABLE_STORE_HEALTHY 0xfe
-
-#pragma pack(1)
-
-typedef struct {
- EFI_GUID Signature;
- UINT32 Size;
- UINT8 Format;
- UINT8 State;
- UINT16 Reserved;
- UINT32 Reserved1;
-} VARIABLE_STORE_HEADER;
-
-typedef struct {
- UINT16 StartId;
- UINT8 State;
- UINT8 Reserved;
- UINT32 Attributes;
- UINT32 NameSize;
- UINT32 DataSize;
- EFI_GUID VendorGuid;
-} VARIABLE_HEADER;
-
-#pragma pack()
-
-#endif // _EFI_VARIABLE_H_
diff --git a/BaseTools/Source/C/Include/Common/WorkingBlockHeader.h b/BaseTools/Source/C/Include/Common/WorkingBlockHeader.h
deleted file mode 100644
index 01fba26a05..0000000000
--- a/BaseTools/Source/C/Include/Common/WorkingBlockHeader.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/** @file
- Defines data structure that is the headers found at the runtime
- updatable firmware volumes, such as the FileSystemGuid of the
- working block, the header structure of the variable block, FTW
- working block, or event log block.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: WorkingBlockHeader.h
-
-**/
-
-#ifndef __EFI_WORKING_BLOCK_HEADER_H__
-#define __EFI_WORKING_BLOCK_HEADER_H__
-
-//
-// EFI Fault tolerant working block header
-// The header is immediately followed by the write queue.
-//
-typedef struct {
- EFI_GUID Signature;
- UINT32 Crc;
- UINT8 WorkingBlockValid : 1;
- UINT8 WorkingBlockInvalid : 1;
-#define WORKING_BLOCK_VALID 0x1
-#define WORKING_BLOCK_INVALID 0x2
- UINT8 Reserved : 6;
- UINT8 Reserved3[3];
- UINT64 WriteQueueSize;
- //
- // UINT8 WriteQueue[WriteQueueSize];
- //
-} EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Guid/PcAnsi.h b/BaseTools/Source/C/Include/Guid/PcAnsi.h
deleted file mode 100644
index 3691e27244..0000000000
--- a/BaseTools/Source/C/Include/Guid/PcAnsi.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/** @file
- Terminal Device Path Vendor Guid.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: PcAnsi.h
-
- @par Revision Reference:
- GUIDs defined in UEFI 2.0 spec.
-
-**/
-
-#ifndef __PC_ANSI_H__
-#define __PC_ANSI_H__
-
-#define EFI_PC_ANSI_GUID \
- { \
- 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
- }
-
-#define EFI_VT_100_GUID \
- { \
- 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
- }
-
-#define EFI_VT_100_PLUS_GUID \
- { \
- 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } \
- }
-
-#define EFI_VT_UTF8_GUID \
- { \
- 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \
- }
-
-#define EFI_UART_DEVICE_PATH_GUID \
- { \
- 0x37499a9d, 0x542f, 0x4c89, {0xa0, 0x26, 0x35, 0xda, 0x14, 0x20, 0x94, 0xe4 } \
- }
-
-#define EFI_SAS_DEVICE_PATH_GUID \
- { \
- 0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \
- }
-
-extern EFI_GUID gEfiPcAnsiGuid;
-extern EFI_GUID gEfiVT100Guid;
-extern EFI_GUID gEfiVT100PlusGuid;
-extern EFI_GUID gEfiVTUTF8Guid;
-extern EFI_GUID gEfiUartDevicePathGuid;
-extern EFI_GUID gEfiSasDevicePathGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Guid/PiFirmwareFileSystem.h b/BaseTools/Source/C/Include/Guid/PiFirmwareFileSystem.h
deleted file mode 100644
index a1c6b55f1d..0000000000
--- a/BaseTools/Source/C/Include/Guid/PiFirmwareFileSystem.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file
- Guid used to define the Firmware File System. See PI spec volume 3 for more
- details.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: PiFirmwareFileSystem.h
-
- @par Revision Reference:
- Guids defined in PI Spec Volume 3
-
-**/
-
-#ifndef __FIRMWARE_FILE_SYSTEM2_GUID_H__
-#define __FIRMWARE_FILE_SYSTEM2_GUID_H__
-
-//
-// GUIDs defined by the PI specification.
-//
-#define EFI_FIRMWARE_FILE_SYSTEM2_GUID \
- { \
- 0x8c8ce578, 0x8a3d, 0x4f1c, {0x99, 0x35, 0x89, 0x61, 0x85, 0xc3, 0x2d, 0xd3 } \
- }
-
-#define EFI_FFS_VOLUME_TOP_FILE_GUID \
- { \
- 0x1BA0062E, 0xC779, 0x4582, {0x85, 0x66, 0x33, 0x6A, 0xE8, 0xF7, 0x8F, 0x09 } \
- }
-
-extern EFI_GUID gEfiFirmwareFileSystem2Guid;
-extern EFI_GUID gEfiFirmwareVolumeTopFileGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Ia32/ProcessorBind.h b/BaseTools/Source/C/Include/Ia32/ProcessorBind.h
deleted file mode 100644
index f1ed522b42..0000000000
--- a/BaseTools/Source/C/Include/Ia32/ProcessorBind.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/** @file
- Processor or Compiler specific defines and types for x64.
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: ProcessorBind.h
-
-**/
-
-#ifndef __PROCESSOR_BIND_H__
-#define __PROCESSOR_BIND_H__
-
-//
-// Define the processor type so other code can make processor based choices
-//
-#define MDE_CPU_IA32
-
-//
-// Make sure we are useing the correct packing rules per EFI specification
-//
-#ifndef __GNUC__
-#pragma pack()
-#endif
-
-#if _MSC_EXTENSIONS
-
-//
-// Disable warning that make it impossible to compile at /W4
-// This only works for Microsoft* tools
-//
-
-//
-// Disabling bitfield type checking warnings.
-//
-#pragma warning ( disable : 4214 )
-
-//
-// Disabling the unreferenced formal parameter warnings.
-//
-#pragma warning ( disable : 4100 )
-
-//
-// Disable slightly different base types warning as CHAR8 * can not be set
-// to a constant string.
-//
-#pragma warning ( disable : 4057 )
-
-//
-// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
-//
-#pragma warning ( disable : 4127 )
-
-
-#endif
-
-
-#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
- //
- // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
- //
-
- #if _MSC_EXTENSIONS
-
- //
- // use Microsoft* C complier dependent integer width types
- //
- typedef unsigned __int64 UINT64;
- typedef __int64 INT64;
- typedef unsigned __int32 UINT32;
- typedef __int32 INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef char INT8;
- #else
-
- //
- // Assume standard IA-32 alignment.
- // BugBug: Need to check portability of long long
- //
- typedef unsigned long long UINT64;
- typedef long long INT64;
- typedef unsigned int UINT32;
- typedef int INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef char INT8;
- #endif
-
- #define UINT8_MAX 0xff
-
-#else
- //
- // Use ANSI C 2000 stdint.h integer width declarations
- //
- #include "stdint.h"
- typedef uint8_t BOOLEAN;
- typedef int8_t INT8;
- typedef uint8_t UINT8;
- typedef int16_t INT16;
- typedef uint16_t UINT16;
- typedef int32_t INT32;
- typedef uint32_t UINT32;
- typedef int64_t INT64;
- typedef uint64_t UINT64;
- typedef char CHAR8;
- typedef uint16_t CHAR16;
-
-#endif
-
-typedef UINT32 UINTN;
-typedef INT32 INTN;
-
-
-//
-// Processor specific defines
-//
-#define MAX_BIT 0x80000000
-#define MAX_2_BITS 0xC0000000
-
-//
-// Maximum legal IA-32 address
-//
-#define MAX_ADDRESS 0xFFFFFFFF
-
-//
-// Modifier to ensure that all protocol member functions and EFI intrinsics
-// use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify their member functions with EFIAPI.
-//
-#if _MSC_EXTENSIONS
- //
- // Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
- //
- #define EFIAPI __cdecl
-#endif
-
-#if __GNUC__
- #define EFIAPI __attribute__((cdecl))
-#endif
-
-//
-// The Microsoft* C compiler can removed references to unreferenced data items
-// if the /OPT:REF linker option is used. We defined a macro as this is a
-// a non standard extension
-//
-#if _MSC_EXTENSIONS
- #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
-#else
- #define GLOBAL_REMOVE_IF_UNREFERENCED
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/Acpi.h b/BaseTools/Source/C/Include/IndustryStandard/Acpi.h
deleted file mode 100644
index 6b4179086c..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/Acpi.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/** @file
- This file contains some basic ACPI definitions that are consumed by drivers
- that do not care about ACPI versions.
-
- Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: Acpi.h
-
-**/
-
-#ifndef _ACPI_H_
-#define _ACPI_H_
-
-//
-// Common table header, this prefaces all ACPI tables, including FACS, but
-// excluding the RSD PTR structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
-} EFI_ACPI_COMMON_HEADER;
-
-//
-// Common ACPI description table header. This structure prefaces most ACPI tables.
-//
-#pragma pack(1)
-
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
- UINT8 Revision;
- UINT8 Checksum;
- UINT8 OemId[6];
- UINT64 OemTableId;
- UINT32 OemRevision;
- UINT32 CreatorId;
- UINT32 CreatorRevision;
-} EFI_ACPI_DESCRIPTION_HEADER;
-
-#pragma pack()
-//
-// Define for Pci Host Bridge Resource Allocation
-//
-#define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
-#define ACPI_END_TAG_DESCRIPTOR 0x79
-
-#define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
-#define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
-#define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
-
-//
-// Power Management Timer frequency is fixed at 3.579545MHz
-//
-#define ACPI_TIMER_FREQUENCY 3579545
-
-//
-// Make sure structures match spec
-//
-#pragma pack(1)
-
-typedef struct {
- UINT8 Desc;
- UINT16 Len;
- UINT8 ResType;
- UINT8 GenFlag;
- UINT8 SpecificFlag;
- UINT64 AddrSpaceGranularity;
- UINT64 AddrRangeMin;
- UINT64 AddrRangeMax;
- UINT64 AddrTranslationOffset;
- UINT64 AddrLen;
-} EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
-
-typedef struct {
- UINT8 Desc;
- UINT8 Checksum;
-} EFI_ACPI_END_TAG_DESCRIPTOR;
-
-//
-// General use definitions
-//
-#define EFI_ACPI_RESERVED_BYTE 0x00
-#define EFI_ACPI_RESERVED_WORD 0x0000
-#define EFI_ACPI_RESERVED_DWORD 0x00000000
-#define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
-
-//
-// Resource Type Specific Flags
-// Ref ACPI specification 6.4.3.5.5
-//
-// Bit [0] : Write Status, _RW
-//
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
-//
-// Bit [2:1] : Memory Attributes, _MEM
-//
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
-//
-// Bit [4:3] : Memory Attributes, _MTP
-//
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
-#define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
-//
-// Bit [5] : Memory to I/O Translation, _TTP
-//
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
-#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
-
-#pragma pack()
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/Acpi1_0.h b/BaseTools/Source/C/Include/IndustryStandard/Acpi1_0.h
deleted file mode 100644
index a118e4ffa2..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/Acpi1_0.h
+++ /dev/null
@@ -1,293 +0,0 @@
-/** @file
- ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
-
- Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: Acpi1_0.h
-
-**/
-
-#ifndef _ACPI_1_0_H_
-#define _ACPI_1_0_H_
-
-#include "IndustryStandard/Acpi.h"
-
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
-//
-// ACPI 1.0b table structures
-//
-//
-// Root System Description Pointer Structure
-//
-typedef struct {
- UINT64 Signature;
- UINT8 Checksum;
- UINT8 OemId[6];
- UINT8 Reserved;
- UINT32 RsdtAddress;
-} EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
-
-//
-// Root System Description Table
-// No definition needed as it is a common description table header followed by a
-// variable number of UINT32 table pointers.
-//
-//
-// RSDT Revision (as defined in ACPI 1.0b spec.)
-//
-#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Fixed ACPI Description Table Structure (FADT)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 FirmwareCtrl;
- UINT32 Dsdt;
- UINT8 IntModel;
- UINT8 Reserved1;
- UINT16 SciInt;
- UINT32 SmiCmd;
- UINT8 AcpiEnable;
- UINT8 AcpiDisable;
- UINT8 S4BiosReq;
- UINT8 Reserved2;
- UINT32 Pm1aEvtBlk;
- UINT32 Pm1bEvtBlk;
- UINT32 Pm1aCntBlk;
- UINT32 Pm1bCntBlk;
- UINT32 Pm2CntBlk;
- UINT32 PmTmrBlk;
- UINT32 Gpe0Blk;
- UINT32 Gpe1Blk;
- UINT8 Pm1EvtLen;
- UINT8 Pm1CntLen;
- UINT8 Pm2CntLen;
- UINT8 PmTmLen;
- UINT8 Gpe0BlkLen;
- UINT8 Gpe1BlkLen;
- UINT8 Gpe1Base;
- UINT8 Reserved3;
- UINT16 PLvl2Lat;
- UINT16 PLvl3Lat;
- UINT16 FlushSize;
- UINT16 FlushStride;
- UINT8 DutyOffset;
- UINT8 DutyWidth;
- UINT8 DayAlrm;
- UINT8 MonAlrm;
- UINT8 Century;
- UINT8 Reserved4;
- UINT8 Reserved5;
- UINT8 Reserved6;
- UINT32 Flags;
-} EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE;
-
-//
-// FADT Version (as defined in ACPI 1.0b spec.)
-//
-#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Fixed ACPI Description Table Fixed Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_1_0_WBINVD (1 << 0)
-#define EFI_ACPI_1_0_WBINVD_FLUSH (1 << 1)
-#define EFI_ACPI_1_0_PROC_C1 (1 << 2)
-#define EFI_ACPI_1_0_P_LVL2_UP (1 << 3)
-#define EFI_ACPI_1_0_PWR_BUTTON (1 << 4)
-#define EFI_ACPI_1_0_SLP_BUTTON (1 << 5)
-#define EFI_ACPI_1_0_FIX_RTC (1 << 6)
-#define EFI_ACPI_1_0_RTC_S4 (1 << 7)
-#define EFI_ACPI_1_0_TMR_VAL_EXT (1 << 8)
-#define EFI_ACPI_1_0_DCK_CAP (1 << 9)
-
-#define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x0
-//
-// Firmware ACPI Control Structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
- UINT32 HardwareSignature;
- UINT32 FirmwareWakingVector;
- UINT32 GlobalLock;
- UINT32 Flags;
- UINT8 Reserved[40];
-} EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
-
-//
-// Firmware Control Structure Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_1_0_S4BIOS_F (1 << 0)
-
-//
-// Multiple APIC Description Table header definition. The rest of the table
-// must be defined in a platform specific manner.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 LocalApicAddress;
- UINT32 Flags;
-} EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
-
-//
-// MADT Revision (as defined in ACPI 1.0b spec.)
-//
-#define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Multiple APIC Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_1_0_PCAT_COMPAT (1 << 0)
-
-//
-// Multiple APIC Description Table APIC structure types
-// All other values between 0x09 an 0xFF are reserved and
-// will be ignored by OSPM.
-//
-#define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
-#define EFI_ACPI_1_0_IO_APIC 0x01
-#define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
-#define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
-#define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
-
-//
-// APIC Structure Definitions
-//
-//
-// Processor Local APIC Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT8 ApicId;
- UINT32 Flags;
-} EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
-
-//
-// Local APIC Flags. All other bits are reserved and must be 0.
-//
-#define EFI_ACPI_1_0_LOCAL_APIC_ENABLED (1 << 0)
-
-//
-// IO APIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 IoApicId;
- UINT8 Reserved;
- UINT32 IoApicAddress;
- UINT32 SystemVectorBase;
-} EFI_ACPI_1_0_IO_APIC_STRUCTURE;
-
-//
-// Interrupt Source Override Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 Bus;
- UINT8 Source;
- UINT32 GlobalSystemInterruptVector;
- UINT16 Flags;
-} EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
-
-//
-// Non-Maskable Interrupt Source Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT32 GlobalSystemInterruptVector;
-} EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
-
-//
-// Local APIC NMI Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT16 Flags;
- UINT8 LocalApicInti;
-} EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;
-
-//
-// Smart Battery Description Table (SBST)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 WarningEnergyLevel;
- UINT32 LowEnergyLevel;
- UINT32 CriticalEnergyLevel;
-} EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE;
-
-//
-// Known table signatures
-//
-//
-// "RSD PTR " Root System Description Pointer
-//
-#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE 0x2052545020445352ULL
-
-//
-// "APIC" Multiple APIC Description Table
-//
-#define EFI_ACPI_1_0_APIC_SIGNATURE 0x43495041
-
-//
-// "DSDT" Differentiated System Description Table
-//
-#define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344
-
-//
-// "FACS" Firmware ACPI Control Structure
-//
-#define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE 0x53434146
-
-//
-// "FACP" Fixed ACPI Description Table
-//
-#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE 0x50434146
-
-//
-// "PSDT" Persistent System Description Table
-//
-#define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445350
-
-//
-// "RSDT" Root System Description Table
-//
-#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445352
-
-//
-// "SBST" Smart Battery Specification Table
-//
-#define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE 0x54534253
-
-//
-// "SSDT" Secondary System Description Table
-//
-#define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445353
-
-#pragma pack()
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/Acpi2_0.h b/BaseTools/Source/C/Include/IndustryStandard/Acpi2_0.h
deleted file mode 100644
index 9cbd5e00b7..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/Acpi2_0.h
+++ /dev/null
@@ -1,528 +0,0 @@
-/** @file
- ACPI 2.0 definitions from the ACPI Specification, revision 2.0
-
- Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: Acpi2_0.h
-
-**/
-
-#ifndef _ACPI_2_0_H_
-#define _ACPI_2_0_H_
-
-#include "IndustryStandard/Acpi.h"
-
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
-//
-// ACPI Specification Revision
-//
-#define EFI_ACPI_2_0_REVISION 0x02
-
-//
-// BUGBUG: OEM values need to be moved somewhere else, probably read from data hub
-// and produced by a platform specific driver.
-//
-//
-// ACPI OEM ID
-//
-#define EFI_ACPI_2_0_OEM_ID "INTEL "
-#define EFI_ACPI_2_0_OEM_TABLE_ID 0x5034303738543245 // "E2T8704P"
-//
-// ACPI OEM Revision
-//
-#define EFI_ACPI_2_0_OEM_REVISION 0x00000002
-
-//
-// ACPI table creator ID
-//
-#define EFI_ACPI_2_0_CREATOR_ID 0x5446534D // TBD "MSFT"
-//
-// ACPI table creator revision
-//
-#define EFI_ACPI_2_0_CREATOR_REVISION 0x01000013 // TBD
-//
-// ACPI 2.0 Generic Address Space definition
-//
-typedef struct {
- UINT8 AddressSpaceId;
- UINT8 RegisterBitWidth;
- UINT8 RegisterBitOffset;
- UINT8 Reserved;
- UINT64 Address;
-} EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE;
-
-//
-// Generic Address Space Address IDs
-//
-#define EFI_ACPI_2_0_SYSTEM_MEMORY 0
-#define EFI_ACPI_2_0_SYSTEM_IO 1
-#define EFI_ACPI_2_0_PCI_CONFIGURATION_SPACE 2
-#define EFI_ACPI_2_0_EMBEDDED_CONTROLLER 3
-#define EFI_ACPI_2_0_SMBUS 4
-#define EFI_ACPI_2_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
-
-//
-// ACPI 2.0 table structures
-//
-//
-// Root System Description Pointer Structure
-//
-typedef struct {
- UINT64 Signature;
- UINT8 Checksum;
- UINT8 OemId[6];
- UINT8 Revision;
- UINT32 RsdtAddress;
- UINT32 Length;
- UINT64 XsdtAddress;
- UINT8 ExtendedChecksum;
- UINT8 Reserved[3];
-} EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
-
-//
-// RSD_PTR Revision (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02
-
-//
-// Common table header, this prefaces all ACPI tables, including FACS, but
-// excluding the RSD PTR structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
-} EFI_ACPI_2_0_COMMON_HEADER;
-
-//
-// Root System Description Table
-// No definition needed as it is a common description table header followed by a
-// variable number of UINT32 table pointers.
-//
-//
-// RSDT Revision (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Extended System Description Table
-// No definition needed as it is a common description table header followed by a
-// variable number of UINT64 table pointers.
-//
-//
-// XSDT Revision (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Fixed ACPI Description Table Structure (FADT)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 FirmwareCtrl;
- UINT32 Dsdt;
- UINT8 Reserved0;
- UINT8 PreferredPmProfile;
- UINT16 SciInt;
- UINT32 SmiCmd;
- UINT8 AcpiEnable;
- UINT8 AcpiDisable;
- UINT8 S4BiosReq;
- UINT8 PstateCnt;
- UINT32 Pm1aEvtBlk;
- UINT32 Pm1bEvtBlk;
- UINT32 Pm1aCntBlk;
- UINT32 Pm1bCntBlk;
- UINT32 Pm2CntBlk;
- UINT32 PmTmrBlk;
- UINT32 Gpe0Blk;
- UINT32 Gpe1Blk;
- UINT8 Pm1EvtLen;
- UINT8 Pm1CntLen;
- UINT8 Pm2CntLen;
- UINT8 PmTmrLen;
- UINT8 Gpe0BlkLen;
- UINT8 Gpe1BlkLen;
- UINT8 Gpe1Base;
- UINT8 CstCnt;
- UINT16 PLvl2Lat;
- UINT16 PLvl3Lat;
- UINT16 FlushSize;
- UINT16 FlushStride;
- UINT8 DutyOffset;
- UINT8 DutyWidth;
- UINT8 DayAlrm;
- UINT8 MonAlrm;
- UINT8 Century;
- UINT16 IaPcBootArch;
- UINT8 Reserved1;
- UINT32 Flags;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
- UINT8 ResetValue;
- UINT8 Reserved2[3];
- UINT64 XFirmwareCtrl;
- UINT64 XDsdt;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
-} EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE;
-
-//
-// FADT Version (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x03
-
-//
-// Fixed ACPI Description Table Boot Architecture Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_2_0_LEGACY_DEVICES (1 << 0)
-#define EFI_ACPI_2_0_8042 (1 << 1)
-
-//
-// Fixed ACPI Description Table Fixed Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_2_0_WBINVD (1 << 0)
-#define EFI_ACPI_2_0_WBINVD_FLUSH (1 << 1)
-#define EFI_ACPI_2_0_PROC_C1 (1 << 2)
-#define EFI_ACPI_2_0_P_LVL2_UP (1 << 3)
-#define EFI_ACPI_2_0_PWR_BUTTON (1 << 4)
-#define EFI_ACPI_2_0_SLP_BUTTON (1 << 5)
-#define EFI_ACPI_2_0_FIX_RTC (1 << 6)
-#define EFI_ACPI_2_0_RTC_S4 (1 << 7)
-#define EFI_ACPI_2_0_TMR_VAL_EXT (1 << 8)
-#define EFI_ACPI_2_0_DCK_CAP (1 << 9)
-#define EFI_ACPI_2_0_RESET_REG_SUP (1 << 10)
-#define EFI_ACPI_2_0_SEALED_CASE (1 << 11)
-#define EFI_ACPI_2_0_HEADLESS (1 << 12)
-#define EFI_ACPI_2_0_CPU_SW_SLP (1 << 13)
-
-//
-// Firmware ACPI Control Structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
- UINT32 HardwareSignature;
- UINT32 FirmwareWakingVector;
- UINT32 GlobalLock;
- UINT32 Flags;
- UINT64 XFirmwareWakingVector;
- UINT8 Version;
- UINT8 Reserved[31];
-} EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
-
-//
-// FACS Version (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
-
-//
-// Firmware Control Structure Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_2_0_S4BIOS_F (1 << 0)
-
-//
-// Multiple APIC Description Table header definition. The rest of the table
-// must be defined in a platform specific manner.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 LocalApicAddress;
- UINT32 Flags;
-} EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
-
-//
-// MADT Revision (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Multiple APIC Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_2_0_PCAT_COMPAT (1 << 0)
-
-//
-// Multiple APIC Description Table APIC structure types
-// All other values between 0x09 an 0xFF are reserved and
-// will be ignored by OSPM.
-//
-#define EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC 0x00
-#define EFI_ACPI_2_0_IO_APIC 0x01
-#define EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE 0x02
-#define EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
-#define EFI_ACPI_2_0_LOCAL_APIC_NMI 0x04
-#define EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
-#define EFI_ACPI_2_0_IO_SAPIC 0x06
-#define EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC 0x07
-#define EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES 0x08
-
-//
-// APIC Structure Definitions
-//
-//
-// Processor Local APIC Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT8 ApicId;
- UINT32 Flags;
-} EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
-
-//
-// Local APIC Flags. All other bits are reserved and must be 0.
-//
-#define EFI_ACPI_2_0_LOCAL_APIC_ENABLED (1 << 0)
-
-//
-// IO APIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 IoApicId;
- UINT8 Reserved;
- UINT32 IoApicAddress;
- UINT32 GlobalSystemInterruptBase;
-} EFI_ACPI_2_0_IO_APIC_STRUCTURE;
-
-//
-// Interrupt Source Override Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 Bus;
- UINT8 Source;
- UINT32 GlobalSystemInterrupt;
- UINT16 Flags;
-} EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
-
-//
-// Non-Maskable Interrupt Source Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT32 GlobalSystemInterrupt;
-} EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
-
-//
-// Local APIC NMI Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT16 Flags;
- UINT8 LocalApicLint;
-} EFI_ACPI_2_0_LOCAL_APIC_NMI_STRUCTURE;
-
-//
-// Local APIC Address Override Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Reserved;
- UINT64 LocalApicAddress;
-} EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
-
-//
-// IO SAPIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 IoApicId;
- UINT8 Reserved;
- UINT32 GlobalSystemInterruptBase;
- UINT64 IoSapicAddress;
-} EFI_ACPI_2_0_IO_SAPIC_STRUCTURE;
-
-//
-// Local SAPIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT8 LocalSapicId;
- UINT8 LocalSapicEid;
- UINT8 Reserved[3];
- UINT32 Flags;
-} EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
-
-//
-// Platform Interrupt Sources Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT8 InterruptType;
- UINT8 ProcessorId;
- UINT8 ProcessorEid;
- UINT8 IoSapicVector;
- UINT32 GlobalSystemInterrupt;
- UINT32 Reserved;
-} EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
-
-//
-// Smart Battery Description Table (SBST)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 WarningEnergyLevel;
- UINT32 LowEnergyLevel;
- UINT32 CriticalEnergyLevel;
-} EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE;
-
-//
-// SBST Version (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Embedded Controller Boot Resources Table (ECDT)
-// The table is followed by a null terminated ASCII string that contains
-// a fully qualified reference to the name space object.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcControl;
- EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcData;
- UINT32 Uid;
- UINT8 GpeBit;
-} EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
-
-//
-// ECDT Version (as defined in ACPI 2.0 spec.)
-//
-#define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
-
-//
-// Known table signatures
-//
-//
-// "RSD PTR " Root System Description Pointer
-//
-#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE 0x2052545020445352
-
-//
-// "SPIC" Multiple SAPIC Description Table
-//
-// BUGBUG: Don't know where this came from except SR870BN4 uses it.
-// #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495053
-//
-#define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
-
-//
-// "BOOT" MS Simple Boot Spec
-//
-#define EFI_ACPI_2_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE 0x544F4F42
-
-//
-// "DBGP" MS Bebug Port Spec
-//
-#define EFI_ACPI_2_0_DEBUG_PORT_TABLE_SIGNATURE 0x50474244
-
-//
-// "DSDT" Differentiated System Description Table
-//
-#define EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344
-
-//
-// "ECDT" Embedded Controller Boot Resources Table
-//
-#define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE 0x54444345
-
-//
-// "ETDT" Event Timer Description Table
-//
-#define EFI_ACPI_2_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE 0x54445445
-
-//
-// "FACS" Firmware ACPI Control Structure
-//
-#define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE 0x53434146
-
-//
-// "FACP" Fixed ACPI Description Table
-//
-#define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE 0x50434146
-
-//
-// "APIC" Multiple APIC Description Table
-//
-#define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
-
-//
-// "PSDT" Persistent System Description Table
-//
-#define EFI_ACPI_2_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445350
-
-//
-// "RSDT" Root System Description Table
-//
-#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445352
-
-//
-// "SBST" Smart Battery Specification Table
-//
-#define EFI_ACPI_2_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE 0x54534253
-
-//
-// "SLIT" System Locality Information Table
-//
-#define EFI_ACPI_2_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE 0x54494C53
-
-//
-// "SPCR" Serial Port Concole Redirection Table
-//
-#define EFI_ACPI_2_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE 0x52435053
-
-//
-// "SRAT" Static Resource Affinity Table
-//
-#define EFI_ACPI_2_0_STATIC_RESOURCE_AFFINITY_TABLE_SIGNATURE 0x54415253
-
-//
-// "SSDT" Secondary System Description Table
-//
-#define EFI_ACPI_2_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445353
-
-//
-// "SPMI" Server Platform Management Interface Table
-//
-#define EFI_ACPI_2_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_SIGNATURE 0x494D5053
-
-//
-// "XSDT" Extended System Description Table
-//
-#define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445358
-
-#pragma pack()
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/Acpi3_0.h b/BaseTools/Source/C/Include/IndustryStandard/Acpi3_0.h
deleted file mode 100644
index 47824eff3a..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/Acpi3_0.h
+++ /dev/null
@@ -1,676 +0,0 @@
-/** @file
- ACPI 3.0 definitions from the ACPI Specification Revision 3.0 September 2, 2004
-
- Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: Acpi3_0.h
-
-**/
-
-#ifndef _ACPI_3_0_H_
-#define _ACPI_3_0_H_
-
-#include "IndustryStandard/Acpi.h"
-
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
-//
-// ACPI Specification Revision
-//
-#define EFI_ACPI_3_0_REVISION 0x03 // BUGBUG: Not in spec yet.
-//
-// BUGBUG: OEM values need to be moved somewhere else, probably read from data hub
-// and produced by a platform specific driver.
-//
-//
-// ACPI 3.0 Generic Address Space definition
-//
-typedef struct {
- UINT8 AddressSpaceId;
- UINT8 RegisterBitWidth;
- UINT8 RegisterBitOffset;
- UINT8 AccessSize;
- UINT64 Address;
-} EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE;
-
-//
-// Generic Address Space Address IDs
-//
-#define EFI_ACPI_3_0_SYSTEM_MEMORY 0
-#define EFI_ACPI_3_0_SYSTEM_IO 1
-#define EFI_ACPI_3_0_PCI_CONFIGURATION_SPACE 2
-#define EFI_ACPI_3_0_EMBEDDED_CONTROLLER 3
-#define EFI_ACPI_3_0_SMBUS 4
-#define EFI_ACPI_3_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
-
-//
-// Generic Address Space Access Sizes
-//
-#define EFI_ACPI_3_0_UNDEFINED 0
-#define EFI_ACPI_3_0_BYTE 1
-#define EFI_ACPI_3_0_WORD 2
-#define EFI_ACPI_3_0_DWORD 3
-#define EFI_ACPI_3_0_QWORD 4
-
-//
-// ACPI 3.0 table structures
-//
-//
-// Root System Description Pointer Structure
-//
-typedef struct {
- UINT64 Signature;
- UINT8 Checksum;
- UINT8 OemId[6];
- UINT8 Revision;
- UINT32 RsdtAddress;
- UINT32 Length;
- UINT64 XsdtAddress;
- UINT8 ExtendedChecksum;
- UINT8 Reserved[3];
-} EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
-
-//
-// RSD_PTR Revision (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02 // ACPISpec30 (Revision 3.0 September 2, 2004) says current value is 2
-//
-// Common table header, this prefaces all ACPI tables, including FACS, but
-// excluding the RSD PTR structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
-} EFI_ACPI_3_0_COMMON_HEADER;
-
-//
-// Root System Description Table
-// No definition needed as it is a common description table header followed by a
-// variable number of UINT32 table pointers.
-//
-//
-// RSDT Revision (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Extended System Description Table
-// No definition needed as it is a common description table header followed by a
-// variable number of UINT64 table pointers.
-//
-//
-// XSDT Revision (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Fixed ACPI Description Table Structure (FADT)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 FirmwareCtrl;
- UINT32 Dsdt;
- UINT8 Reserved0;
- UINT8 PreferredPmProfile;
- UINT16 SciInt;
- UINT32 SmiCmd;
- UINT8 AcpiEnable;
- UINT8 AcpiDisable;
- UINT8 S4BiosReq;
- UINT8 PstateCnt;
- UINT32 Pm1aEvtBlk;
- UINT32 Pm1bEvtBlk;
- UINT32 Pm1aCntBlk;
- UINT32 Pm1bCntBlk;
- UINT32 Pm2CntBlk;
- UINT32 PmTmrBlk;
- UINT32 Gpe0Blk;
- UINT32 Gpe1Blk;
- UINT8 Pm1EvtLen;
- UINT8 Pm1CntLen;
- UINT8 Pm2CntLen;
- UINT8 PmTmrLen;
- UINT8 Gpe0BlkLen;
- UINT8 Gpe1BlkLen;
- UINT8 Gpe1Base;
- UINT8 CstCnt;
- UINT16 PLvl2Lat;
- UINT16 PLvl3Lat;
- UINT16 FlushSize;
- UINT16 FlushStride;
- UINT8 DutyOffset;
- UINT8 DutyWidth;
- UINT8 DayAlrm;
- UINT8 MonAlrm;
- UINT8 Century;
- UINT16 IaPcBootArch;
- UINT8 Reserved1;
- UINT32 Flags;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
- UINT8 ResetValue;
- UINT8 Reserved2[3];
- UINT64 XFirmwareCtrl;
- UINT64 XDsdt;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
-} EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE;
-
-//
-// FADT Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x04
-
-//
-// Fixed ACPI Description Table Preferred Power Management Profile
-//
-#define EFI_ACPI_3_0_PM_PROFILE_UNSPECIFIED 0
-#define EFI_ACPI_3_0_PM_PROFILE_DESKTOP 1
-#define EFI_ACPI_3_0_PM_PROFILE_MOBILE 2
-#define EFI_ACPI_3_0_PM_PROFILE_WORKSTATION 3
-#define EFI_ACPI_3_0_PM_PROFILE_ENTERPRISE_SERVER 4
-#define EFI_ACPI_3_0_PM_PROFILE_SOHO_SERVER 5
-#define EFI_ACPI_3_0_PM_PROFILE_APPLIANCE_PC 6
-#define EFI_ACPI_3_0_PM_PROFILE_PERFORMANCE_SERVER 7
-
-//
-// Fixed ACPI Description Table Boot Architecture Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_LEGACY_DEVICES (1 << 0)
-#define EFI_ACPI_3_0_8042 (1 << 1)
-#define EFI_ACPI_3_0_VGA_NOT_PRESENT (1 << 2)
-#define EFI_ACPI_3_0_MSI_NOT_SUPPORTED (1 << 3)
-//
-// Fixed ACPI Description Table Fixed Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_WBINVD (1 << 0)
-#define EFI_ACPI_3_0_WBINVD_FLUSH (1 << 1)
-#define EFI_ACPI_3_0_PROC_C1 (1 << 2)
-#define EFI_ACPI_3_0_P_LVL2_UP (1 << 3)
-#define EFI_ACPI_3_0_PWR_BUTTON (1 << 4)
-#define EFI_ACPI_3_0_SLP_BUTTON (1 << 5)
-#define EFI_ACPI_3_0_FIX_RTC (1 << 6)
-#define EFI_ACPI_3_0_RTC_S4 (1 << 7)
-#define EFI_ACPI_3_0_TMR_VAL_EXT (1 << 8)
-#define EFI_ACPI_3_0_DCK_CAP (1 << 9)
-#define EFI_ACPI_3_0_RESET_REG_SUP (1 << 10)
-#define EFI_ACPI_3_0_SEALED_CASE (1 << 11)
-#define EFI_ACPI_3_0_HEADLESS (1 << 12)
-#define EFI_ACPI_3_0_CPU_SW_SLP (1 << 13)
-#define EFI_ACPI_3_0_PCI_EXP_WAK (1 << 14)
-#define EFI_ACPI_3_0_USE_PLATFORM_CLOCK (1 << 15)
-#define EFI_ACPI_3_0_S4_RTC_STS_VALID (1 << 16)
-#define EFI_ACPI_3_0_REMOTE_POWER_ON_CAPABLE (1 << 17)
-#define EFI_ACPI_3_0_FORCE_APIC_CLUSTER_MODEL (1 << 18)
-#define EFI_ACPI_3_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE (1 << 19)
-
-//
-// Firmware ACPI Control Structure
-//
-typedef struct {
- UINT32 Signature;
- UINT32 Length;
- UINT32 HardwareSignature;
- UINT32 FirmwareWakingVector;
- UINT32 GlobalLock;
- UINT32 Flags;
- UINT64 XFirmwareWakingVector;
- UINT8 Version;
- UINT8 Reserved[31];
-} EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
-
-//
-// FACS Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
-
-//
-// Firmware Control Structure Feature Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_S4BIOS_F (1 << 0)
-
-//
-// Differentiated System Description Table,
-// Secondary System Description Table
-// and Persistent System Description Table,
-// no definition needed as they are common description table header followed by a
-// definition block.
-//
-#define EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x02
-#define EFI_ACPI_3_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION 0x02
-
-//
-// Multiple APIC Description Table header definition. The rest of the table
-// must be defined in a platform specific manner.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 LocalApicAddress;
- UINT32 Flags;
-} EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
-
-//
-// MADT Revision (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x02
-
-//
-// Multiple APIC Flags
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_PCAT_COMPAT (1 << 0)
-
-//
-// Multiple APIC Description Table APIC structure types
-// All other values between 0x09 an 0xFF are reserved and
-// will be ignored by OSPM.
-//
-#define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC 0x00
-#define EFI_ACPI_3_0_IO_APIC 0x01
-#define EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE 0x02
-#define EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
-#define EFI_ACPI_3_0_LOCAL_APIC_NMI 0x04
-#define EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
-#define EFI_ACPI_3_0_IO_SAPIC 0x06
-#define EFI_ACPI_3_0_LOCAL_SAPIC 0x07
-#define EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES 0x08
-
-//
-// APIC Structure Definitions
-//
-//
-// Processor Local APIC Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT8 ApicId;
- UINT32 Flags;
-} EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
-
-//
-// Local APIC Flags. All other bits are reserved and must be 0.
-//
-#define EFI_ACPI_3_0_LOCAL_APIC_ENABLED (1 << 0)
-
-//
-// IO APIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 IoApicId;
- UINT8 Reserved;
- UINT32 IoApicAddress;
- UINT32 GlobalSystemInterruptBase;
-} EFI_ACPI_3_0_IO_APIC_STRUCTURE;
-
-//
-// Interrupt Source Override Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 Bus;
- UINT8 Source;
- UINT32 GlobalSystemInterrupt;
- UINT16 Flags;
-} EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
-
-//
-// Platform Interrupt Sources Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT8 InterruptType;
- UINT8 ProcessorId;
- UINT8 ProcessorEid;
- UINT8 IoSapicVector;
- UINT32 GlobalSystemInterrupt;
- UINT32 PlatformInterruptSourceFlags;
- UINT8 CpeiProcessorOverride;
- UINT8 Reserved[31];
-} EFI_ACPI_3_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
-
-//
-// MPS INTI flags.
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_POLARITY (3 << 0)
-#define EFI_ACPI_3_0_TRIGGER_MODE (3 << 2)
-
-//
-// Non-Maskable Interrupt Source Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT32 GlobalSystemInterrupt;
-} EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
-
-//
-// Local APIC NMI Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT16 Flags;
- UINT8 LocalApicLint;
-} EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE;
-
-//
-// Local APIC Address Override Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Reserved;
- UINT64 LocalApicAddress;
-} EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
-
-//
-// IO SAPIC Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 IoApicId;
- UINT8 Reserved;
- UINT32 GlobalSystemInterruptBase;
- UINT64 IoSapicAddress;
-} EFI_ACPI_3_0_IO_SAPIC_STRUCTURE;
-
-//
-// Local SAPIC Structure
-// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 AcpiProcessorId;
- UINT8 LocalSapicId;
- UINT8 LocalSapicEid;
- UINT8 Reserved[3];
- UINT32 Flags;
- UINT32 ACPIProcessorUIDValue;
-} EFI_ACPI_3_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
-
-//
-// Platform Interrupt Sources Structure
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT16 Flags;
- UINT8 InterruptType;
- UINT8 ProcessorId;
- UINT8 ProcessorEid;
- UINT8 IoSapicVector;
- UINT32 GlobalSystemInterrupt;
- UINT32 PlatformInterruptSourceFlags;
-} EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
-
-//
-// Platform Interrupt Source Flags.
-// All other bits are reserved and must be set to 0.
-//
-#define EFI_ACPI_3_0_CPEI_PROCESSOR_OVERRIDE (1 << 0)
-
-//
-// Smart Battery Description Table (SBST)
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 WarningEnergyLevel;
- UINT32 LowEnergyLevel;
- UINT32 CriticalEnergyLevel;
-} EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE;
-
-//
-// SBST Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
-
-//
-// Embedded Controller Boot Resources Table (ECDT)
-// The table is followed by a null terminated ASCII string that contains
-// a fully qualified reference to the name space object.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE EcControl;
- EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE EcData;
- UINT32 Uid;
- UINT8 GpeBit;
-} EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
-
-//
-// ECDT Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
-
-//
-// System Resource Affinity Table (SRAT. The rest of the table
-// must be defined in a platform specific manner.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 Reserved1; // Must be set to 1
- UINT64 Reserved2;
-} EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
-
-//
-// SRAT Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_REVISION 0x02
-
-//
-// SRAT structure types.
-// All other values between 0x02 an 0xFF are reserved and
-// will be ignored by OSPM.
-//
-#define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY 0x00
-#define EFI_ACPI_3_0_MEMORY_AFFINITY 0x01
-
-//
-// Processor Local APIC/SAPIC Affinity Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 ProximityDomain7To0;
- UINT8 ApicId;
- UINT32 Flags;
- UINT8 LocalSapicEid;
- UINT8 ProximityDomain31To8[3];
- UINT8 Reserved[4];
-} EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
-
-//
-// Local APIC/SAPIC Flags. All other bits are reserved and must be 0.
-//
-#define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
-
-//
-// Memory Affinity Structure Definition
-//
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT32 ProximityDomain;
- UINT16 Reserved1;
- UINT32 AddressBaseLow;
- UINT32 AddressBaseHigh;
- UINT32 LengthLow;
- UINT32 LengthHigh;
- UINT32 Reserved2;
- UINT32 Flags;
- UINT64 Reserved3;
-} EFI_ACPI_3_0_MEMORY_AFFINITY_STRUCTURE;
-
-//
-// Memory Flags. All other bits are reserved and must be 0.
-//
-#define EFI_ACPI_3_0_MEMORY_ENABLED (1 << 0)
-#define EFI_ACPI_3_0_MEMORY_HOT_PLUGGABLE (1 << 1)
-#define EFI_ACPI_3_0_MEMORY_NONVOLATILE (1 << 2)
-
-//
-// System Locality Distance Information Table (SLIT).
-// The rest of the table is a matrix.
-//
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT64 NumberOfSystemLocalities;
-} EFI_ACPI_3_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
-
-//
-// SLIT Version (as defined in ACPI 3.0 spec.)
-//
-#define EFI_ACPI_3_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_REVISION 0x01
-
-//
-// Known table signatures
-//
-//
-// "RSD PTR " Root System Description Pointer
-//
-#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE 0x2052545020445352ULL
-
-//
-// "APIC" Multiple APIC Description Table
-//
-#define EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
-
-//
-// "DSDT" Differentiated System Description Table
-//
-#define EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344
-
-//
-// "ECDT" Embedded Controller Boot Resources Table
-//
-#define EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE 0x54444345
-
-//
-// "FACP" Fixed ACPI Description Table
-//
-#define EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE 0x50434146
-
-//
-// "FACS" Firmware ACPI Control Structure
-//
-#define EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE 0x53434146
-
-//
-// "PSDT" Persistent System Description Table
-//
-#define EFI_ACPI_3_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445350
-
-//
-// "RSDT" Root System Description Table
-//
-#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445352
-
-//
-// "SBST" Smart Battery Specification Table
-//
-#define EFI_ACPI_3_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE 0x54534253
-
-//
-// "SLIT" System Locality Information Table
-//
-#define EFI_ACPI_3_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE 0x54494C53
-
-//
-// "SRAT" System Resource Affinity Table
-//
-#define EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_SIGNATURE 0x54415253
-
-//
-// "SSDT" Secondary System Description Table
-//
-#define EFI_ACPI_3_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445353
-
-//
-// "XSDT" Extended System Description Table
-//
-#define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445358
-
-//
-// "BOOT" MS Simple Boot Spec
-//
-#define EFI_ACPI_3_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE 0x544F4F42
-
-//
-// "CPEP" Corrected Platform Error Polling Table
-// See
-//
-#define EFI_ACPI_3_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_SIGNATURE 0x50455043
-
-//
-// "DBGP" MS Debug Port Spec
-//
-#define EFI_ACPI_3_0_DEBUG_PORT_TABLE_SIGNATURE 0x50474244
-
-//
-// "ETDT" Event Timer Description Table
-//
-#define EFI_ACPI_3_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE 0x54445445
-
-//
-// "HPET" IA-PC High Precision Event Timer Table
-//
-#define EFI_ACPI_3_0_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE 0x54455048
-
-//
-// "MCFG" PCI Express Memory Mapped Configuration Space Base Address Description Table
-//
-#define EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE 0x4746434D
-
-//
-// "SPCR" Serial Port Concole Redirection Table
-//
-#define EFI_ACPI_3_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE 0x52435053
-
-//
-// "SPMI" Server Platform Management Interface Table
-//
-#define EFI_ACPI_3_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE_SIGNATURE 0x494D5053
-
-//
-// "TCPA" Trusted Computing Platform Alliance Capabilities Table
-//
-#define EFI_ACPI_3_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE 0x41504354
-
-//
-// "WDRT" Watchdog Resource Table
-//
-#define EFI_ACPI_3_0_WATCHDOG_RESOURCE_TABLE_SIGNATURE 0x54524457
-
-#pragma pack()
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/EfiPci.h b/BaseTools/Source/C/Include/IndustryStandard/EfiPci.h
deleted file mode 100644
index bd23e5a5ee..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/EfiPci.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/** @file
- Support for EFI PCI specification.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: EfiPci.h
-
-**/
-
-#ifndef _EFI_PCI_H_
-#define _EFI_PCI_H_
-
-//#include "pci22.h"
-//#include "pci23.h"
-//#include "pci30.h"
-
-#pragma pack(push, 1)
-
-typedef struct {
- UINT8 Register;
- UINT8 Function;
- UINT8 Device;
- UINT8 Bus;
- UINT8 Reserved[4];
-} DEFIO_PCI_ADDR;
-
-#define EFI_ROOT_BRIDGE_LIST 'eprb'
-#define EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE 0x0EF1
-
-typedef struct {
- UINT16 Signature; // 0xaa55
- UINT16 InitializationSize;
- UINT32 EfiSignature; // 0x0EF1
- UINT16 EfiSubsystem;
- UINT16 EfiMachineType;
- UINT16 CompressionType;
- UINT8 Reserved[8];
- UINT16 EfiImageHeaderOffset;
- UINT16 PcirOffset;
-} EFI_PCI_EXPANSION_ROM_HEADER;
-
-typedef union {
- UINT8 *Raw;
- PCI_EXPANSION_ROM_HEADER *Generic;
- EFI_PCI_EXPANSION_ROM_HEADER *Efi;
- EFI_LEGACY_EXPANSION_ROM_HEADER *PcAt;
-} EFI_PCI_ROM_HEADER;
-
-#pragma pack(pop)
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h b/BaseTools/Source/C/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h
deleted file mode 100644
index b661eecb5d..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file
- ACPI memory mapped configuration space access table definition, defined at
- in the PCI Firmware Specification, version 3.0 draft version 0.5.
- Specification is available at http://www.pcisig.com.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: MemoryMappedConfigurationSpaceAccessTable.h
-
-**/
-
-#ifndef _MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_H_
-#define _MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_H_
-
-//
-// Ensure proper structure formats
-//
-#pragma pack(1)
-//
-// Memory Mapped Configuration Space Access Table (MCFG)
-// This table is a basic description table header followed by
-// a number of base address allocation structures.
-//
-typedef struct {
- UINT64 BaseAddress;
- UINT16 PciSegmentGroupNumber;
- UINT8 StartBusNumber;
- UINT8 EndBusNumber;
- UINT32 Reserved;
-} EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE;
-
-//
-// MCFG Revision (defined in spec)
-//
-#define EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION 0x01
-
-#pragma pack()
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h b/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
deleted file mode 100644
index 7e7c0ea46a..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
+++ /dev/null
@@ -1,771 +0,0 @@
-/** @file
- EFI image format for PE32+. Please note some data structures are different
- for IA-32 and Itanium-based images, look for UINTN and the #ifdef EFI_IA64
-
- @bug Fix text - doc as defined in MSFT EFI specification.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
- Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: PeImage.h
-
-**/
-
-#ifndef __PE_IMAGE_H__
-#define __PE_IMAGE_H__
-
-//
-// PE32+ Subsystem type for EFI images
-//
-#define EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION 10
-#define EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
-#define EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
-#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13
-
-//
-// BugBug: Need to get a real answer for this problem. This is not in the
-// PE specification.
-//
-// A SAL runtime driver does not get fixed up when a transition to
-// virtual mode is made. In all other cases it should be treated
-// like a EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER image
-//
-#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13
-
-//
-// PE32+ Machine type for EFI images
-//
-#define IMAGE_FILE_MACHINE_I386 0x014c
-#define IMAGE_FILE_MACHINE_IA64 0x0200
-#define IMAGE_FILE_MACHINE_EBC 0x0EBC
-#define IMAGE_FILE_MACHINE_X64 0x8664
-#define IMAGE_FILE_MACHINE_ARM 0x01c0 // Thumb only
-#define IMAGE_FILE_MACHINE_ARMT 0x01c2 // 32bit Mixed ARM and Thumb/Thumb 2 Little Endian
-#define IMAGE_FILE_MACHINE_ARM64 0xAA64 // 64bit ARM Architecture, Little Endian
-
-//
-// Support old names for backward compatible
-//
-#define EFI_IMAGE_MACHINE_IA32 IMAGE_FILE_MACHINE_I386
-#define EFI_IMAGE_MACHINE_IA64 IMAGE_FILE_MACHINE_IA64
-#define EFI_IMAGE_MACHINE_IPF IMAGE_FILE_MACHINE_IA64
-#define EFI_IMAGE_MACHINE_EBC IMAGE_FILE_MACHINE_EBC
-#define EFI_IMAGE_MACHINE_X64 IMAGE_FILE_MACHINE_X64
-#define EFI_IMAGE_MACHINE_ARMT IMAGE_FILE_MACHINE_ARMT
-#define EFI_IMAGE_MACHINE_AARCH64 IMAGE_FILE_MACHINE_ARM64
-
-#define EFI_IMAGE_DOS_SIGNATURE 0x5A4D // MZ
-#define EFI_IMAGE_OS2_SIGNATURE 0x454E // NE
-#define EFI_IMAGE_OS2_SIGNATURE_LE 0x454C // LE
-#define EFI_IMAGE_NT_SIGNATURE 0x00004550 // PE00
-#define EFI_IMAGE_EDOS_SIGNATURE 0x44454550 // PEED
-
-///
-/// PE images can start with an optional DOS header, so if an image is run
-/// under DOS it can print an error message.
-///
-typedef struct {
- UINT16 e_magic; // Magic number
- UINT16 e_cblp; // Bytes on last page of file
- UINT16 e_cp; // Pages in file
- UINT16 e_crlc; // Relocations
- UINT16 e_cparhdr; // Size of header in paragraphs
- UINT16 e_minalloc; // Minimum extra paragraphs needed
- UINT16 e_maxalloc; // Maximum extra paragraphs needed
- UINT16 e_ss; // Initial (relative) SS value
- UINT16 e_sp; // Initial SP value
- UINT16 e_csum; // Checksum
- UINT16 e_ip; // Initial IP value
- UINT16 e_cs; // Initial (relative) CS value
- UINT16 e_lfarlc; // File address of relocation table
- UINT16 e_ovno; // Overlay number
- UINT16 e_res[4]; // Reserved words
- UINT16 e_oemid; // OEM identifier (for e_oeminfo)
- UINT16 e_oeminfo; // OEM information; e_oemid specific
- UINT16 e_res2[10]; // Reserved words
- UINT32 e_lfanew; // File address of new exe header
-} EFI_IMAGE_DOS_HEADER;
-
-///
-/// File header format.
-///
-typedef struct {
- UINT16 Machine;
- UINT16 NumberOfSections;
- UINT32 TimeDateStamp;
- UINT32 PointerToSymbolTable;
- UINT32 NumberOfSymbols;
- UINT16 SizeOfOptionalHeader;
- UINT16 Characteristics;
-} EFI_IMAGE_FILE_HEADER;
-
-#define EFI_IMAGE_SIZEOF_FILE_HEADER 20
-
-#define EFI_IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file.
-#define EFI_IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references).
-#define EFI_IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file.
-#define EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file.
-#define EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE 0x0020 // Supports addresses > 2-GB
-#define EFI_IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed.
-#define EFI_IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine.
-#define EFI_IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file
-#define EFI_IMAGE_FILE_SYSTEM 0x1000 // System File.
-#define EFI_IMAGE_FILE_DLL 0x2000 // File is a DLL.
-#define EFI_IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed.
-#define EFI_IMAGE_FILE_MACHINE_UNKNOWN 0
-#define EFI_IMAGE_FILE_MACHINE_I386 0x14c // Intel 386.
-#define EFI_IMAGE_FILE_MACHINE_R3000 0x162 // MIPS* little-endian, 0540 big-endian
-#define EFI_IMAGE_FILE_MACHINE_R4000 0x166 // MIPS* little-endian
-#define EFI_IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP*
-#define EFI_IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM* PowerPC Little-Endian
-#define EFI_IMAGE_FILE_MACHINE_TAHOE 0x7cc // Intel EM machine
-//
-// * Other names and brands may be claimed as the property of others.
-//
-
-///
-/// Directory format.
-///
-typedef struct {
- UINT32 VirtualAddress;
- UINT32 Size;
-} EFI_IMAGE_DATA_DIRECTORY;
-
-#define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES 16
-
-typedef struct {
- UINT16 Magic;
- UINT8 MajorLinkerVersion;
- UINT8 MinorLinkerVersion;
- UINT32 SizeOfCode;
- UINT32 SizeOfInitializedData;
- UINT32 SizeOfUninitializedData;
- UINT32 AddressOfEntryPoint;
- UINT32 BaseOfCode;
- UINT32 BaseOfData;
- UINT32 BaseOfBss;
- UINT32 GprMask;
- UINT32 CprMask[4];
- UINT32 GpValue;
-} EFI_IMAGE_ROM_OPTIONAL_HEADER;
-
-#define EFI_IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
-#define EFI_IMAGE_SIZEOF_ROM_OPTIONAL_HEADER sizeof (EFI_IMAGE_ROM_OPTIONAL_HEADER)
-
-typedef struct {
- EFI_IMAGE_FILE_HEADER FileHeader;
- EFI_IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
-} EFI_IMAGE_ROM_HEADERS;
-
-///
-/// @attention
-/// EFI_IMAGE_OPTIONAL_HEADER32 and EFI_IMAGE_OPTIONAL_HEADER64
-/// are for use ONLY by tools. All proper EFI code MUST use
-/// EFI_IMAGE_OPTIONAL_HEADER ONLY!!!
-///
-#define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
-
-typedef struct {
- //
- // Standard fields.
- //
- UINT16 Magic;
- UINT8 MajorLinkerVersion;
- UINT8 MinorLinkerVersion;
- UINT32 SizeOfCode;
- UINT32 SizeOfInitializedData;
- UINT32 SizeOfUninitializedData;
- UINT32 AddressOfEntryPoint;
- UINT32 BaseOfCode;
- UINT32 BaseOfData;
- //
- // NT additional fields.
- //
- UINT32 ImageBase;
- UINT32 SectionAlignment;
- UINT32 FileAlignment;
- UINT16 MajorOperatingSystemVersion;
- UINT16 MinorOperatingSystemVersion;
- UINT16 MajorImageVersion;
- UINT16 MinorImageVersion;
- UINT16 MajorSubsystemVersion;
- UINT16 MinorSubsystemVersion;
- UINT32 Win32VersionValue;
- UINT32 SizeOfImage;
- UINT32 SizeOfHeaders;
- UINT32 CheckSum;
- UINT16 Subsystem;
- UINT16 DllCharacteristics;
- UINT32 SizeOfStackReserve;
- UINT32 SizeOfStackCommit;
- UINT32 SizeOfHeapReserve;
- UINT32 SizeOfHeapCommit;
- UINT32 LoaderFlags;
- UINT32 NumberOfRvaAndSizes;
- EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];
-} EFI_IMAGE_OPTIONAL_HEADER32;
-
-///
-/// @attention
-/// EFI_IMAGE_OPTIONAL_HEADER32 and EFI_IMAGE_OPTIONAL_HEADER64
-/// are for use ONLY by tools. All proper EFI code MUST use
-/// EFI_IMAGE_OPTIONAL_HEADER ONLY!!!
-///
-#define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
-
-typedef struct {
- //
- // Standard fields.
- //
- UINT16 Magic;
- UINT8 MajorLinkerVersion;
- UINT8 MinorLinkerVersion;
- UINT32 SizeOfCode;
- UINT32 SizeOfInitializedData;
- UINT32 SizeOfUninitializedData;
- UINT32 AddressOfEntryPoint;
- UINT32 BaseOfCode;
- //
- // NT additional fields.
- //
- UINT64 ImageBase;
- UINT32 SectionAlignment;
- UINT32 FileAlignment;
- UINT16 MajorOperatingSystemVersion;
- UINT16 MinorOperatingSystemVersion;
- UINT16 MajorImageVersion;
- UINT16 MinorImageVersion;
- UINT16 MajorSubsystemVersion;
- UINT16 MinorSubsystemVersion;
- UINT32 Win32VersionValue;
- UINT32 SizeOfImage;
- UINT32 SizeOfHeaders;
- UINT32 CheckSum;
- UINT16 Subsystem;
- UINT16 DllCharacteristics;
- UINT64 SizeOfStackReserve;
- UINT64 SizeOfStackCommit;
- UINT64 SizeOfHeapReserve;
- UINT64 SizeOfHeapCommit;
- UINT32 LoaderFlags;
- UINT32 NumberOfRvaAndSizes;
- EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];
-} EFI_IMAGE_OPTIONAL_HEADER64;
-
-///
-/// @attention
-/// EFI_IMAGE_NT_HEADERS32 and EFI_IMAGE_HEADERS64 are for use ONLY
-/// by tools. All proper EFI code MUST use EFI_IMAGE_NT_HEADERS ONLY!!!
-///
-typedef struct {
- UINT32 Signature;
- EFI_IMAGE_FILE_HEADER FileHeader;
- EFI_IMAGE_OPTIONAL_HEADER32 OptionalHeader;
-} EFI_IMAGE_NT_HEADERS32;
-
-#define EFI_IMAGE_SIZEOF_NT_OPTIONAL32_HEADER sizeof (EFI_IMAGE_NT_HEADERS32)
-
-typedef struct {
- UINT32 Signature;
- EFI_IMAGE_FILE_HEADER FileHeader;
- EFI_IMAGE_OPTIONAL_HEADER64 OptionalHeader;
-} EFI_IMAGE_NT_HEADERS64;
-
-#define EFI_IMAGE_SIZEOF_NT_OPTIONAL64_HEADER sizeof (EFI_IMAGE_NT_HEADERS64)
-
-//
-// Subsystem Values
-//
-#define EFI_IMAGE_SUBSYSTEM_UNKNOWN 0
-#define EFI_IMAGE_SUBSYSTEM_NATIVE 1
-#define EFI_IMAGE_SUBSYSTEM_WINDOWS_GUI 2
-#define EFI_IMAGE_SUBSYSTEM_WINDOWS_CUI 3.
-#define EFI_IMAGE_SUBSYSTEM_OS2_CUI 5
-#define EFI_IMAGE_SUBSYSTEM_POSIX_CUI 7
-
-//
-// Directory Entries
-//
-#define EFI_IMAGE_DIRECTORY_ENTRY_EXPORT 0
-#define EFI_IMAGE_DIRECTORY_ENTRY_IMPORT 1
-#define EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE 2
-#define EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
-#define EFI_IMAGE_DIRECTORY_ENTRY_SECURITY 4
-#define EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC 5
-#define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG 6
-#define EFI_IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
-#define EFI_IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
-#define EFI_IMAGE_DIRECTORY_ENTRY_TLS 9
-#define EFI_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
-
-//
-// Section header format.
-//
-#define EFI_IMAGE_SIZEOF_SHORT_NAME 8
-
-typedef struct {
- UINT8 Name[EFI_IMAGE_SIZEOF_SHORT_NAME];
- union {
- UINT32 PhysicalAddress;
- UINT32 VirtualSize;
- } Misc;
- UINT32 VirtualAddress;
- UINT32 SizeOfRawData;
- UINT32 PointerToRawData;
- UINT32 PointerToRelocations;
- UINT32 PointerToLinenumbers;
- UINT16 NumberOfRelocations;
- UINT16 NumberOfLinenumbers;
- UINT32 Characteristics;
-} EFI_IMAGE_SECTION_HEADER;
-
-#define EFI_IMAGE_SIZEOF_SECTION_HEADER 40
-
-#define EFI_IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved.
-#define EFI_IMAGE_SCN_CNT_CODE 0x00000020
-#define EFI_IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040
-#define EFI_IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080
-
-#define EFI_IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved.
-#define EFI_IMAGE_SCN_LNK_INFO 0x00000200 // Section contains comments or some other type of information.
-#define EFI_IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents will not become part of image.
-#define EFI_IMAGE_SCN_LNK_COMDAT 0x00001000
-
-#define EFI_IMAGE_SCN_ALIGN_1BYTES 0x00100000
-#define EFI_IMAGE_SCN_ALIGN_2BYTES 0x00200000
-#define EFI_IMAGE_SCN_ALIGN_4BYTES 0x00300000
-#define EFI_IMAGE_SCN_ALIGN_8BYTES 0x00400000
-#define EFI_IMAGE_SCN_ALIGN_16BYTES 0x00500000
-#define EFI_IMAGE_SCN_ALIGN_32BYTES 0x00600000
-#define EFI_IMAGE_SCN_ALIGN_64BYTES 0x00700000
-
-#define EFI_IMAGE_SCN_MEM_DISCARDABLE 0x02000000
-#define EFI_IMAGE_SCN_MEM_NOT_CACHED 0x04000000
-#define EFI_IMAGE_SCN_MEM_NOT_PAGED 0x08000000
-#define EFI_IMAGE_SCN_MEM_SHARED 0x10000000
-#define EFI_IMAGE_SCN_MEM_EXECUTE 0x20000000
-#define EFI_IMAGE_SCN_MEM_READ 0x40000000
-#define EFI_IMAGE_SCN_MEM_WRITE 0x80000000
-
-///
-/// Symbol format.
-///
-#define EFI_IMAGE_SIZEOF_SYMBOL 18
-
-//
-// Section values.
-//
-// Symbols have a section number of the section in which they are
-// defined. Otherwise, section numbers have the following meanings:
-//
-#define EFI_IMAGE_SYM_UNDEFINED (UINT16) 0 // Symbol is undefined or is common.
-#define EFI_IMAGE_SYM_ABSOLUTE (UINT16) -1 // Symbol is an absolute value.
-#define EFI_IMAGE_SYM_DEBUG (UINT16) -2 // Symbol is a special debug item.
-//
-// Type (fundamental) values.
-//
-#define EFI_IMAGE_SYM_TYPE_NULL 0 // no type.
-#define EFI_IMAGE_SYM_TYPE_VOID 1 //
-#define EFI_IMAGE_SYM_TYPE_CHAR 2 // type character.
-#define EFI_IMAGE_SYM_TYPE_SHORT 3 // type short integer.
-#define EFI_IMAGE_SYM_TYPE_INT 4
-#define EFI_IMAGE_SYM_TYPE_LONG 5
-#define EFI_IMAGE_SYM_TYPE_FLOAT 6
-#define EFI_IMAGE_SYM_TYPE_DOUBLE 7
-#define EFI_IMAGE_SYM_TYPE_STRUCT 8
-#define EFI_IMAGE_SYM_TYPE_UNION 9
-#define EFI_IMAGE_SYM_TYPE_ENUM 10 // enumeration.
-#define EFI_IMAGE_SYM_TYPE_MOE 11 // member of enumeration.
-#define EFI_IMAGE_SYM_TYPE_BYTE 12
-#define EFI_IMAGE_SYM_TYPE_WORD 13
-#define EFI_IMAGE_SYM_TYPE_UINT 14
-#define EFI_IMAGE_SYM_TYPE_DWORD 15
-
-//
-// Type (derived) values.
-//
-#define EFI_IMAGE_SYM_DTYPE_NULL 0 // no derived type.
-#define EFI_IMAGE_SYM_DTYPE_POINTER 1
-#define EFI_IMAGE_SYM_DTYPE_FUNCTION 2
-#define EFI_IMAGE_SYM_DTYPE_ARRAY 3
-
-//
-// Storage classes.
-//
-#define EFI_IMAGE_SYM_CLASS_END_OF_FUNCTION (UINT8) -1
-#define EFI_IMAGE_SYM_CLASS_NULL 0
-#define EFI_IMAGE_SYM_CLASS_AUTOMATIC 1
-#define EFI_IMAGE_SYM_CLASS_EXTERNAL 2
-#define EFI_IMAGE_SYM_CLASS_STATIC 3
-#define EFI_IMAGE_SYM_CLASS_REGISTER 4
-#define EFI_IMAGE_SYM_CLASS_EXTERNAL_DEF 5
-#define EFI_IMAGE_SYM_CLASS_LABEL 6
-#define EFI_IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
-#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
-#define EFI_IMAGE_SYM_CLASS_ARGUMENT 9
-#define EFI_IMAGE_SYM_CLASS_STRUCT_TAG 10
-#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
-#define EFI_IMAGE_SYM_CLASS_UNION_TAG 12
-#define EFI_IMAGE_SYM_CLASS_TYPE_DEFINITION 13
-#define EFI_IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
-#define EFI_IMAGE_SYM_CLASS_ENUM_TAG 15
-#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
-#define EFI_IMAGE_SYM_CLASS_REGISTER_PARAM 17
-#define EFI_IMAGE_SYM_CLASS_BIT_FIELD 18
-#define EFI_IMAGE_SYM_CLASS_BLOCK 100
-#define EFI_IMAGE_SYM_CLASS_FUNCTION 101
-#define EFI_IMAGE_SYM_CLASS_END_OF_STRUCT 102
-#define EFI_IMAGE_SYM_CLASS_FILE 103
-#define EFI_IMAGE_SYM_CLASS_SECTION 104
-#define EFI_IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
-
-//
-// type packing constants
-//
-#define EFI_IMAGE_N_BTMASK 017
-#define EFI_IMAGE_N_TMASK 060
-#define EFI_IMAGE_N_TMASK1 0300
-#define EFI_IMAGE_N_TMASK2 0360
-#define EFI_IMAGE_N_BTSHFT 4
-#define EFI_IMAGE_N_TSHIFT 2
-
-//
-// Communal selection types.
-//
-#define EFI_IMAGE_COMDAT_SELECT_NODUPLICATES 1
-#define EFI_IMAGE_COMDAT_SELECT_ANY 2
-#define EFI_IMAGE_COMDAT_SELECT_SAME_SIZE 3
-#define EFI_IMAGE_COMDAT_SELECT_EXACT_MATCH 4
-#define EFI_IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
-
-#define EFI_IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
-#define EFI_IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
-#define EFI_IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
-
-///
-/// Relocation format.
-///
-typedef struct {
- UINT32 VirtualAddress;
- UINT32 SymbolTableIndex;
- UINT16 Type;
-} EFI_IMAGE_RELOCATION;
-
-#define EFI_IMAGE_SIZEOF_RELOCATION 10
-
-//
-// I386 relocation types.
-//
-#define EFI_IMAGE_REL_I386_ABSOLUTE 0 // Reference is absolute, no relocation is necessary
-#define EFI_IMAGE_REL_I386_DIR16 01 // Direct 16-bit reference to the symbols virtual address
-#define EFI_IMAGE_REL_I386_REL16 02 // PC-relative 16-bit reference to the symbols virtual address
-#define EFI_IMAGE_REL_I386_DIR32 06 // Direct 32-bit reference to the symbols virtual address
-#define EFI_IMAGE_REL_I386_DIR32NB 07 // Direct 32-bit reference to the symbols virtual address, base not included
-#define EFI_IMAGE_REL_I386_SEG12 09 // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address
-#define EFI_IMAGE_REL_I386_SECTION 010
-#define EFI_IMAGE_REL_I386_SECREL 011
-#define EFI_IMAGE_REL_I386_REL32 020 // PC-relative 32-bit reference to the symbols virtual address
-
-//
-// x64 processor relocation types.
-//
-#define IMAGE_REL_AMD64_ABSOLUTE 0x0000
-#define IMAGE_REL_AMD64_ADDR64 0x0001
-#define IMAGE_REL_AMD64_ADDR32 0x0002
-#define IMAGE_REL_AMD64_ADDR32NB 0x0003
-#define IMAGE_REL_AMD64_REL32 0x0004
-#define IMAGE_REL_AMD64_REL32_1 0x0005
-#define IMAGE_REL_AMD64_REL32_2 0x0006
-#define IMAGE_REL_AMD64_REL32_3 0x0007
-#define IMAGE_REL_AMD64_REL32_4 0x0008
-#define IMAGE_REL_AMD64_REL32_5 0x0009
-#define IMAGE_REL_AMD64_SECTION 0x000A
-#define IMAGE_REL_AMD64_SECREL 0x000B
-#define IMAGE_REL_AMD64_SECREL7 0x000C
-#define IMAGE_REL_AMD64_TOKEN 0x000D
-#define IMAGE_REL_AMD64_SREL32 0x000E
-#define IMAGE_REL_AMD64_PAIR 0x000F
-#define IMAGE_REL_AMD64_SSPAN32 0x0010
-
-///
-/// Based relocation format.
-///
-typedef struct {
- UINT32 VirtualAddress;
- UINT32 SizeOfBlock;
-} EFI_IMAGE_BASE_RELOCATION;
-
-#define EFI_IMAGE_SIZEOF_BASE_RELOCATION 8
-
-//
-// Based relocation types.
-//
-#define EFI_IMAGE_REL_BASED_ABSOLUTE 0
-#define EFI_IMAGE_REL_BASED_HIGH 1
-#define EFI_IMAGE_REL_BASED_LOW 2
-#define EFI_IMAGE_REL_BASED_HIGHLOW 3
-#define EFI_IMAGE_REL_BASED_HIGHADJ 4
-#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR 5
-#define EFI_IMAGE_REL_BASED_ARM_MOV32A 5
-#define EFI_IMAGE_REL_BASED_ARM_MOV32T 7
-#define EFI_IMAGE_REL_BASED_IA64_IMM64 9
-#define EFI_IMAGE_REL_BASED_DIR64 10
-
-
-///
-/// Line number format.
-///
-typedef struct {
- union {
- UINT32 SymbolTableIndex; // Symbol table index of function name if Linenumber is 0.
- UINT32 VirtualAddress; // Virtual address of line number.
- } Type;
- UINT16 Linenumber; // Line number.
-} EFI_IMAGE_LINENUMBER;
-
-#define EFI_IMAGE_SIZEOF_LINENUMBER 6
-
-//
-// Archive format.
-//
-#define EFI_IMAGE_ARCHIVE_START_SIZE 8
-#define EFI_IMAGE_ARCHIVE_START "!<arch>\n"
-#define EFI_IMAGE_ARCHIVE_END "`\n"
-#define EFI_IMAGE_ARCHIVE_PAD "\n"
-#define EFI_IMAGE_ARCHIVE_LINKER_MEMBER "/ "
-#define EFI_IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
-
-typedef struct {
- UINT8 Name[16]; // File member name - `/' terminated.
- UINT8 Date[12]; // File member date - decimal.
- UINT8 UserID[6]; // File member user id - decimal.
- UINT8 GroupID[6]; // File member group id - decimal.
- UINT8 Mode[8]; // File member mode - octal.
- UINT8 Size[10]; // File member size - decimal.
- UINT8 EndHeader[2]; // String to end header.
-} EFI_IMAGE_ARCHIVE_MEMBER_HEADER;
-
-#define EFI_IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
-
-//
-// DLL support.
-//
-
-///
-/// DLL Export Format
-///
-typedef struct {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT16 MajorVersion;
- UINT16 MinorVersion;
- UINT32 Name;
- UINT32 Base;
- UINT32 NumberOfFunctions;
- UINT32 NumberOfNames;
- UINT32 AddressOfFunctions;
- UINT32 AddressOfNames;
- UINT32 AddressOfNameOrdinals;
-} EFI_IMAGE_EXPORT_DIRECTORY;
-
-///
-/// DLL support.
-/// Import Format
-///
-typedef struct {
- UINT16 Hint;
- UINT8 Name[1];
-} EFI_IMAGE_IMPORT_BY_NAME;
-
-typedef struct {
- union {
- UINT32 Function;
- UINT32 Ordinal;
- EFI_IMAGE_IMPORT_BY_NAME *AddressOfData;
- } u1;
-} EFI_IMAGE_THUNK_DATA;
-
-#define EFI_IMAGE_ORDINAL_FLAG 0x80000000
-#define EFI_IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & EFI_IMAGE_ORDINAL_FLAG) != 0)
-#define EFI_IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
-
-typedef struct {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT32 ForwarderChain;
- UINT32 Name;
- EFI_IMAGE_THUNK_DATA *FirstThunk;
-} EFI_IMAGE_IMPORT_DESCRIPTOR;
-
-///
-/// Debug Format
-///
-#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2
-
-typedef struct {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT16 MajorVersion;
- UINT16 MinorVersion;
- UINT32 Type;
- UINT32 SizeOfData;
- UINT32 RVA;
- UINT32 FileOffset;
-} EFI_IMAGE_DEBUG_DIRECTORY_ENTRY;
-
-#define CODEVIEW_SIGNATURE_NB10 0x3031424E // "NB10"
-typedef struct {
- UINT32 Signature; // "NB10"
- UINT32 Unknown;
- UINT32 Unknown2;
- UINT32 Unknown3;
- //
- // Filename of .PDB goes here
- //
-} EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY;
-
-#define CODEVIEW_SIGNATURE_RSDS 0x53445352 // "RSDS"
-typedef struct {
- UINT32 Signature; // "RSDS"
- UINT32 Unknown;
- UINT32 Unknown2;
- UINT32 Unknown3;
- UINT32 Unknown4;
- UINT32 Unknown5;
- //
- // Filename of .PDB goes here
- //
-} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
-
-///
-/// Debug Data Structure defined by Apple Mach-O to Coff utility
-///
-#define CODEVIEW_SIGNATURE_MTOC EFI_SIGNATURE_32('M', 'T', 'O', 'C')
-typedef struct {
- UINT32 Signature; ///< "MTOC"
- EFI_GUID MachOUuid;
- //
- // Filename of .DLL (Mach-O with debug info) goes here
- //
-} EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY;
-
-//
-// .pdata entries for X64
-//
-typedef struct {
- UINT32 FunctionStartAddress;
- UINT32 FunctionEndAddress;
- UINT32 UnwindInfoAddress;
-} RUNTIME_FUNCTION;
-
-typedef struct {
- UINT8 Version:3;
- UINT8 Flags:5;
- UINT8 SizeOfProlog;
- UINT8 CountOfUnwindCodes;
- UINT8 FrameRegister:4;
- UINT8 FrameRegisterOffset:4;
-} UNWIND_INFO;
-
-///
-/// Resource format.
-///
-typedef struct {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT16 MajorVersion;
- UINT16 MinorVersion;
- UINT16 NumberOfNamedEntries;
- UINT16 NumberOfIdEntries;
- //
- // Array of EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY entries goes here.
- //
-} EFI_IMAGE_RESOURCE_DIRECTORY;
-
-///
-/// Resource directory entry format.
-///
-typedef struct {
- union {
- struct {
- UINT32 NameOffset:31;
- UINT32 NameIsString:1;
- } s;
- UINT32 Id;
- } u1;
- union {
- UINT32 OffsetToData;
- struct {
- UINT32 OffsetToDirectory:31;
- UINT32 DataIsDirectory:1;
- } s;
- } u2;
-} EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY;
-
-///
-/// Resource directory entry for string.
-///
-typedef struct {
- UINT16 Length;
- CHAR16 String[1];
-} EFI_IMAGE_RESOURCE_DIRECTORY_STRING;
-
-///
-/// Resource directory entry for data array.
-///
-typedef struct {
- UINT32 OffsetToData;
- UINT32 Size;
- UINT32 CodePage;
- UINT32 Reserved;
-} EFI_IMAGE_RESOURCE_DATA_ENTRY;
-
-///
-/// Header format for TE images
-///
-typedef struct {
- UINT16 Signature; // signature for TE format = "VZ"
- UINT16 Machine; // from the original file header
- UINT8 NumberOfSections; // from the original file header
- UINT8 Subsystem; // from original optional header
- UINT16 StrippedSize; // how many bytes we removed from the header
- UINT32 AddressOfEntryPoint; // offset to entry point -- from original optional header
- UINT32 BaseOfCode; // from original image -- required for ITP debug
- UINT64 ImageBase; // from original file header
- EFI_IMAGE_DATA_DIRECTORY DataDirectory[2]; // only base relocation and debug directory
-} EFI_TE_IMAGE_HEADER;
-
-#define EFI_TE_IMAGE_HEADER_SIGNATURE 0x5A56 // "VZ"
-
-//
-// Data directory indexes in our TE image header
-//
-#define EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC 0
-#define EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG 1
-
-
-//
-// Union of PE32, PE32+, and TE headers
-//
-typedef union {
- EFI_IMAGE_NT_HEADERS32 Pe32;
- EFI_IMAGE_NT_HEADERS64 Pe32Plus;
- EFI_TE_IMAGE_HEADER Te;
-} EFI_IMAGE_OPTIONAL_HEADER_UNION;
-
-typedef union {
- EFI_IMAGE_NT_HEADERS32 *Pe32;
- EFI_IMAGE_NT_HEADERS64 *Pe32Plus;
- EFI_TE_IMAGE_HEADER *Te;
- EFI_IMAGE_OPTIONAL_HEADER_UNION *Union;
-} EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION;
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/pci22.h b/BaseTools/Source/C/Include/IndustryStandard/pci22.h
deleted file mode 100644
index e1d347afbb..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/pci22.h
+++ /dev/null
@@ -1,544 +0,0 @@
-/** @file
- Support for PCI 2.2 standard.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: pci22.h
-
-**/
-
-#ifndef _PCI22_H
-#define _PCI22_H
-
-#define PCI_MAX_SEGMENT 0
-
-#define PCI_MAX_BUS 255
-
-#define PCI_MAX_DEVICE 31
-#define PCI_MAX_FUNC 7
-
-//
-// Command
-//
-#define PCI_VGA_PALETTE_SNOOP_DISABLED 0x20
-
-#pragma pack(push, 1)
-typedef struct {
- UINT16 VendorId;
- UINT16 DeviceId;
- UINT16 Command;
- UINT16 Status;
- UINT8 RevisionID;
- UINT8 ClassCode[3];
- UINT8 CacheLineSize;
- UINT8 LatencyTimer;
- UINT8 HeaderType;
- UINT8 BIST;
-} PCI_DEVICE_INDEPENDENT_REGION;
-
-typedef struct {
- UINT32 Bar[6];
- UINT32 CISPtr;
- UINT16 SubsystemVendorID;
- UINT16 SubsystemID;
- UINT32 ExpansionRomBar;
- UINT8 CapabilityPtr;
- UINT8 Reserved1[3];
- UINT32 Reserved2;
- UINT8 InterruptLine;
- UINT8 InterruptPin;
- UINT8 MinGnt;
- UINT8 MaxLat;
-} PCI_DEVICE_HEADER_TYPE_REGION;
-
-typedef struct {
- PCI_DEVICE_INDEPENDENT_REGION Hdr;
- PCI_DEVICE_HEADER_TYPE_REGION Device;
-} PCI_TYPE00;
-
-typedef struct {
- UINT32 Bar[2];
- UINT8 PrimaryBus;
- UINT8 SecondaryBus;
- UINT8 SubordinateBus;
- UINT8 SecondaryLatencyTimer;
- UINT8 IoBase;
- UINT8 IoLimit;
- UINT16 SecondaryStatus;
- UINT16 MemoryBase;
- UINT16 MemoryLimit;
- UINT16 PrefetchableMemoryBase;
- UINT16 PrefetchableMemoryLimit;
- UINT32 PrefetchableBaseUpper32;
- UINT32 PrefetchableLimitUpper32;
- UINT16 IoBaseUpper16;
- UINT16 IoLimitUpper16;
- UINT8 CapabilityPtr;
- UINT8 Reserved[3];
- UINT32 ExpansionRomBAR;
- UINT8 InterruptLine;
- UINT8 InterruptPin;
- UINT16 BridgeControl;
-} PCI_BRIDGE_CONTROL_REGISTER;
-
-typedef struct {
- PCI_DEVICE_INDEPENDENT_REGION Hdr;
- PCI_BRIDGE_CONTROL_REGISTER Bridge;
-} PCI_TYPE01;
-
-typedef union {
- PCI_TYPE00 Device;
- PCI_TYPE01 Bridge;
-} PCI_TYPE_GENERIC;
-
-typedef struct {
- UINT32 CardBusSocketReg; // Cardus Socket/ExCA Base
- // Address Register
- //
- UINT16 Reserved;
- UINT16 SecondaryStatus; // Secondary Status
- UINT8 PciBusNumber; // PCI Bus Number
- UINT8 CardBusBusNumber; // CardBus Bus Number
- UINT8 SubordinateBusNumber; // Subordinate Bus Number
- UINT8 CardBusLatencyTimer; // CardBus Latency Timer
- UINT32 MemoryBase0; // Memory Base Register 0
- UINT32 MemoryLimit0; // Memory Limit Register 0
- UINT32 MemoryBase1;
- UINT32 MemoryLimit1;
- UINT32 IoBase0;
- UINT32 IoLimit0; // I/O Base Register 0
- UINT32 IoBase1; // I/O Limit Register 0
- UINT32 IoLimit1;
- UINT8 InterruptLine; // Interrupt Line
- UINT8 InterruptPin; // Interrupt Pin
- UINT16 BridgeControl; // Bridge Control
-} PCI_CARDBUS_CONTROL_REGISTER;
-
-//
-// Definitions of PCI class bytes and manipulation macros.
-//
-#define PCI_CLASS_OLD 0x00
-#define PCI_CLASS_OLD_OTHER 0x00
-#define PCI_CLASS_OLD_VGA 0x01
-
-#define PCI_CLASS_MASS_STORAGE 0x01
-#define PCI_CLASS_MASS_STORAGE_SCSI 0x00
-#define PCI_CLASS_MASS_STORAGE_IDE 0x01 // obsolete
-#define PCI_CLASS_IDE 0x01
-#define PCI_CLASS_MASS_STORAGE_FLOPPY 0x02
-#define PCI_CLASS_MASS_STORAGE_IPI 0x03
-#define PCI_CLASS_MASS_STORAGE_RAID 0x04
-#define PCI_CLASS_MASS_STORAGE_OTHER 0x80
-
-#define PCI_CLASS_NETWORK 0x02
-#define PCI_CLASS_NETWORK_ETHERNET 0x00
-#define PCI_CLASS_ETHERNET 0x00 // obsolete
-#define PCI_CLASS_NETWORK_TOKENRING 0x01
-#define PCI_CLASS_NETWORK_FDDI 0x02
-#define PCI_CLASS_NETWORK_ATM 0x03
-#define PCI_CLASS_NETWORK_ISDN 0x04
-#define PCI_CLASS_NETWORK_OTHER 0x80
-
-#define PCI_CLASS_DISPLAY 0x03
-#define PCI_CLASS_DISPLAY_CTRL 0x03 // obsolete
-#define PCI_CLASS_DISPLAY_VGA 0x00
-#define PCI_CLASS_VGA 0x00 // obsolete
-#define PCI_CLASS_DISPLAY_XGA 0x01
-#define PCI_CLASS_DISPLAY_3D 0x02
-#define PCI_CLASS_DISPLAY_OTHER 0x80
-#define PCI_CLASS_DISPLAY_GFX 0x80
-#define PCI_CLASS_GFX 0x80 // obsolete
-#define PCI_CLASS_BRIDGE 0x06
-#define PCI_CLASS_BRIDGE_HOST 0x00
-#define PCI_CLASS_BRIDGE_ISA 0x01
-#define PCI_CLASS_ISA 0x01 // obsolete
-#define PCI_CLASS_BRIDGE_EISA 0x02
-#define PCI_CLASS_BRIDGE_MCA 0x03
-#define PCI_CLASS_BRIDGE_P2P 0x04
-#define PCI_CLASS_BRIDGE_PCMCIA 0x05
-#define PCI_CLASS_BRIDGE_NUBUS 0x06
-#define PCI_CLASS_BRIDGE_CARDBUS 0x07
-#define PCI_CLASS_BRIDGE_RACEWAY 0x08
-#define PCI_CLASS_BRIDGE_ISA_PDECODE 0x80
-#define PCI_CLASS_ISA_POSITIVE_DECODE 0x80 // obsolete
-
-#define PCI_CLASS_SCC 0x07 // Simple communications controllers
-#define PCI_SUBCLASS_SERIAL 0x00
-#define PCI_IF_GENERIC_XT 0x00
-#define PCI_IF_16450 0x01
-#define PCI_IF_16550 0x02
-#define PCI_IF_16650 0x03
-#define PCI_IF_16750 0x04
-#define PCI_IF_16850 0x05
-#define PCI_IF_16950 0x06
-#define PCI_SUBCLASS_PARALLEL 0x01
-#define PCI_IF_PARALLEL_PORT 0x00
-#define PCI_IF_BI_DIR_PARALLEL_PORT 0x01
-#define PCI_IF_ECP_PARALLEL_PORT 0x02
-#define PCI_IF_1284_CONTROLLER 0x03
-#define PCI_IF_1284_DEVICE 0xFE
-#define PCI_SUBCLASS_MULTIPORT_SERIAL 0x02
-#define PCI_SUBCLASS_MODEM 0x03
-#define PCI_IF_GENERIC_MODEM 0x00
-#define PCI_IF_16450_MODEM 0x01
-#define PCI_IF_16550_MODEM 0x02
-#define PCI_IF_16650_MODEM 0x03
-#define PCI_IF_16750_MODEM 0x04
-#define PCI_SUBCLASS_OTHER 0x80
-
-#define PCI_CLASS_SYSTEM_PERIPHERAL 0x08
-#define PCI_SUBCLASS_PIC 0x00
-#define PCI_IF_8259_PIC 0x00
-#define PCI_IF_ISA_PIC 0x01
-#define PCI_IF_EISA_PIC 0x02
-#define PCI_IF_APIC_CONTROLLER 0x10 // I/O APIC interrupt controller , 32 bye none-prefectable memory.
-#define PCI_IF_APIC_CONTROLLER2 0x20
-#define PCI_SUBCLASS_TIMER 0x02
-#define PCI_IF_8254_TIMER 0x00
-#define PCI_IF_ISA_TIMER 0x01
-#define PCI_EISA_TIMER 0x02
-#define PCI_SUBCLASS_RTC 0x03
-#define PCI_IF_GENERIC_RTC 0x00
-#define PCI_IF_ISA_RTC 0x00
-#define PCI_SUBCLASS_PNP_CONTROLLER 0x04 // HotPlug Controller
-
-#define PCI_CLASS_INPUT_DEVICE 0x09
-#define PCI_SUBCLASS_KEYBOARD 0x00
-#define PCI_SUBCLASS_PEN 0x01
-#define PCI_SUBCLASS_MOUSE_CONTROLLER 0x02
-#define PCI_SUBCLASS_SCAN_CONTROLLER 0x03
-#define PCI_SUBCLASS_GAMEPORT 0x04
-
-#define PCI_CLASS_DOCKING_STATION 0x0A
-
-#define PCI_CLASS_PROCESSOR 0x0B
-#define PCI_SUBCLASS_PROC_386 0x00
-#define PCI_SUBCLASS_PROC_486 0x01
-#define PCI_SUBCLASS_PROC_PENTIUM 0x02
-#define PCI_SUBCLASS_PROC_ALPHA 0x10
-#define PCI_SUBCLASS_PROC_POWERPC 0x20
-#define PCI_SUBCLASS_PROC_MIPS 0x30
-#define PCI_SUBCLASS_PROC_CO_PORC 0x40 // Co-Processor
-
-#define PCI_CLASS_SERIAL 0x0C
-#define PCI_CLASS_SERIAL_FIREWIRE 0x00
-#define PCI_CLASS_SERIAL_ACCESS_BUS 0x01
-#define PCI_CLASS_SERIAL_SSA 0x02
-#define PCI_CLASS_SERIAL_USB 0x03
-#define PCI_CLASS_SERIAL_FIBRECHANNEL 0x04
-#define PCI_CLASS_SERIAL_SMB 0x05
-
-#define PCI_CLASS_WIRELESS 0x0D
-#define PCI_SUBCLASS_IRDA 0x00
-#define PCI_SUBCLASS_IR 0x01
-#define PCI_SUBCLASS_RF 0x02
-
-#define PCI_CLASS_INTELLIGENT_IO 0x0E
-
-#define PCI_CLASS_SATELLITE 0x0F
-#define PCI_SUBCLASS_TV 0x01
-#define PCI_SUBCLASS_AUDIO 0x02
-#define PCI_SUBCLASS_VOICE 0x03
-#define PCI_SUBCLASS_DATA 0x04
-
-#define PCI_SECURITY_CONTROLLER 0x10 // Encryption and decryption controller
-#define PCI_SUBCLASS_NET_COMPUT 0x00
-#define PCI_SUBCLASS_ENTERTAINMENT 0x10
-
-#define PCI_CLASS_DPIO 0x11
-
-#define IS_CLASS1(_p, c) ((_p)->Hdr.ClassCode[2] == (c))
-#define IS_CLASS2(_p, c, s) (IS_CLASS1 (_p, c) && ((_p)->Hdr.ClassCode[1] == (s)))
-#define IS_CLASS3(_p, c, s, p) (IS_CLASS2 (_p, c, s) && ((_p)->Hdr.ClassCode[0] == (p)))
-
-#define IS_PCI_DISPLAY(_p) IS_CLASS1 (_p, PCI_CLASS_DISPLAY)
-#define IS_PCI_VGA(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 0)
-#define IS_PCI_8514(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 1)
-#define IS_PCI_GFX(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_GFX, 0)
-#define IS_PCI_OLD(_p) IS_CLASS1 (_p, PCI_CLASS_OLD)
-#define IS_PCI_OLD_VGA(_p) IS_CLASS2 (_p, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA)
-#define IS_PCI_IDE(_p) IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_IDE)
-#define IS_PCI_SCSI(_p) IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_SCSI, 0)
-#define IS_PCI_RAID(_p) IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_RAID, 0)
-#define IS_PCI_LPC(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA, 0)
-#define IS_PCI_P2P(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 0)
-#define IS_PCI_P2P_SUB(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 1)
-#define IS_PCI_USB(_p) IS_CLASS2 (_p, PCI_CLASS_SERIAL, PCI_CLASS_SERIAL_USB)
-
-#define HEADER_TYPE_DEVICE 0x00
-#define HEADER_TYPE_PCI_TO_PCI_BRIDGE 0x01
-#define HEADER_TYPE_CARDBUS_BRIDGE 0x02
-
-#define HEADER_TYPE_MULTI_FUNCTION 0x80
-#define HEADER_LAYOUT_CODE 0x7f
-
-#define IS_PCI_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_PCI_TO_PCI_BRIDGE))
-#define IS_CARDBUS_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_CARDBUS_BRIDGE))
-#define IS_PCI_MULTI_FUNC(_p) ((_p)->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION)
-
-#define PCI_DEVICE_ROMBAR 0x30
-#define PCI_BRIDGE_ROMBAR 0x38
-
-#define PCI_MAX_BAR 0x0006
-#define PCI_MAX_CONFIG_OFFSET 0x0100
-
-#define PCI_VENDOR_ID_OFFSET 0x00
-#define PCI_DEVICE_ID_OFFSET 0x02
-#define PCI_COMMAND_OFFSET 0x04
-#define PCI_PRIMARY_STATUS_OFFSET 0x06
-#define PCI_REVISION_ID_OFFSET 0x08
-#define PCI_CLASSCODE_OFFSET 0x09
-#define PCI_CACHELINE_SIZE_OFFSET 0x0C
-#define PCI_LATENCY_TIMER_OFFSET 0x0D
-#define PCI_HEADER_TYPE_OFFSET 0x0E
-#define PCI_BIST_OFFSET 0x0F
-#define PCI_BASE_ADDRESSREG_OFFSET 0x10
-#define PCI_CARDBUS_CIS_OFFSET 0x28
-#define PCI_SVID_OFFSET 0x2C // SubSystem Vendor id
-#define PCI_SUBSYSTEM_VENDOR_ID_OFFSET 0x2C
-#define PCI_SID_OFFSET 0x2E // SubSystem ID
-#define PCI_SUBSYSTEM_ID_OFFSET 0x2E
-#define PCI_EXPANSION_ROM_BASE 0x30
-#define PCI_CAPBILITY_POINTER_OFFSET 0x34
-#define PCI_INT_LINE_OFFSET 0x3C // Interrupt Line Register
-#define PCI_INT_PIN_OFFSET 0x3D // Interrupt Pin Register
-#define PCI_MAXGNT_OFFSET 0x3E // Max Grant Register
-#define PCI_MAXLAT_OFFSET 0x3F // Max Latency Register
-
-#define PCI_BRIDGE_CONTROL_REGISTER_OFFSET 0x3E
-#define PCI_BRIDGE_STATUS_REGISTER_OFFSET 0x1E
-
-#define PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET 0x18
-#define PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET 0x19
-#define PCI_BRIDGE_SUBORDINATE_BUS_REGISTER_OFFSET 0x1a
-
-typedef union {
- struct {
- UINT32 Reg : 8;
- UINT32 Func : 3;
- UINT32 Dev : 5;
- UINT32 Bus : 8;
- UINT32 Reserved : 7;
- UINT32 Enable : 1;
- } Bits;
- UINT32 Uint32;
-} PCI_CONFIG_ACCESS_CF8;
-
-#pragma pack()
-
-#define PCI_EXPANSION_ROM_HEADER_SIGNATURE 0xaa55
-#define PCI_DATA_STRUCTURE_SIGNATURE EFI_SIGNATURE_32 ('P', 'C', 'I', 'R')
-#define PCI_CODE_TYPE_PCAT_IMAGE 0x00
-#define PCI_CODE_TYPE_EFI_IMAGE 0x03
-#define EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED 0x0001
-
-#define EFI_PCI_COMMAND_IO_SPACE 0x0001
-#define EFI_PCI_COMMAND_MEMORY_SPACE 0x0002
-#define EFI_PCI_COMMAND_BUS_MASTER 0x0004
-#define EFI_PCI_COMMAND_SPECIAL_CYCLE 0x0008
-#define EFI_PCI_COMMAND_MEMORY_WRITE_AND_INVALIDATE 0x0010
-#define EFI_PCI_COMMAND_VGA_PALETTE_SNOOP 0x0020
-#define EFI_PCI_COMMAND_PARITY_ERROR_RESPOND 0x0040
-#define EFI_PCI_COMMAND_STEPPING_CONTROL 0x0080
-#define EFI_PCI_COMMAND_SERR 0x0100
-#define EFI_PCI_COMMAND_FAST_BACK_TO_BACK 0x0200
-
-#define EFI_PCI_BRIDGE_CONTROL_PARITY_ERROR_RESPONSE 0x0001
-#define EFI_PCI_BRIDGE_CONTROL_SERR 0x0002
-#define EFI_PCI_BRIDGE_CONTROL_ISA 0x0004
-#define EFI_PCI_BRIDGE_CONTROL_VGA 0x0008
-#define EFI_PCI_BRIDGE_CONTROL_VGA_16 0x0010
-#define EFI_PCI_BRIDGE_CONTROL_MASTER_ABORT 0x0020
-#define EFI_PCI_BRIDGE_CONTROL_RESET_SECONDARY_BUS 0x0040
-#define EFI_PCI_BRIDGE_CONTROL_FAST_BACK_TO_BACK 0x0080
-#define EFI_PCI_BRIDGE_CONTROL_PRIMARY_DISCARD_TIMER 0x0100
-#define EFI_PCI_BRIDGE_CONTROL_SECONDARY_DISCARD_TIMER 0x0200
-#define EFI_PCI_BRIDGE_CONTROL_TIMER_STATUS 0x0400
-#define EFI_PCI_BRIDGE_CONTROL_DISCARD_TIMER_SERR 0x0800
-
-//
-// Following are the PCI-CARDBUS bridge control bit
-//
-#define EFI_PCI_BRIDGE_CONTROL_IREQINT_ENABLE 0x0080
-#define EFI_PCI_BRIDGE_CONTROL_RANGE0_MEMORY_TYPE 0x0100
-#define EFI_PCI_BRIDGE_CONTROL_RANGE1_MEMORY_TYPE 0x0200
-#define EFI_PCI_BRIDGE_CONTROL_WRITE_POSTING_ENABLE 0x0400
-
-//
-// Following are the PCI status control bit
-//
-#define EFI_PCI_STATUS_CAPABILITY 0x0010
-#define EFI_PCI_STATUS_66MZ_CAPABLE 0x0020
-#define EFI_PCI_FAST_BACK_TO_BACK_CAPABLE 0x0080
-#define EFI_PCI_MASTER_DATA_PARITY_ERROR 0x0100
-
-#define EFI_PCI_CAPABILITY_PTR 0x34
-#define EFI_PCI_CARDBUS_BRIDGE_CAPABILITY_PTR 0x14
-
-#pragma pack(1)
-typedef struct {
- UINT16 Signature; // 0xaa55
- UINT8 Reserved[0x16];
- UINT16 PcirOffset;
-} PCI_EXPANSION_ROM_HEADER;
-
-typedef struct {
- UINT16 Signature; // 0xaa55
- UINT8 Size512;
- UINT8 InitEntryPoint[3];
- UINT8 Reserved[0x12];
- UINT16 PcirOffset;
-} EFI_LEGACY_EXPANSION_ROM_HEADER;
-
-typedef struct {
- UINT32 Signature; // "PCIR"
- UINT16 VendorId;
- UINT16 DeviceId;
- UINT16 Reserved0;
- UINT16 Length;
- UINT8 Revision;
- UINT8 ClassCode[3];
- UINT16 ImageLength;
- UINT16 CodeRevision;
- UINT8 CodeType;
- UINT8 Indicator;
- UINT16 Reserved1;
-} PCI_DATA_STRUCTURE;
-
-//
-// PCI Capability List IDs and records
-//
-#define EFI_PCI_CAPABILITY_ID_PMI 0x01
-#define EFI_PCI_CAPABILITY_ID_AGP 0x02
-#define EFI_PCI_CAPABILITY_ID_VPD 0x03
-#define EFI_PCI_CAPABILITY_ID_SLOTID 0x04
-#define EFI_PCI_CAPABILITY_ID_MSI 0x05
-#define EFI_PCI_CAPABILITY_ID_HOTPLUG 0x06
-#define EFI_PCI_CAPABILITY_ID_PCIX 0x07
-
-typedef struct {
- UINT8 CapabilityID;
- UINT8 NextItemPtr;
-} EFI_PCI_CAPABILITY_HDR;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_PMI
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 PMC;
- UINT16 PMCSR;
- UINT8 BridgeExtention;
- UINT8 Data;
-} EFI_PCI_CAPABILITY_PMI;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_AGP
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT8 Rev;
- UINT8 Reserved;
- UINT32 Status;
- UINT32 Command;
-} EFI_PCI_CAPABILITY_AGP;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_VPD
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 AddrReg;
- UINT32 DataReg;
-} EFI_PCI_CAPABILITY_VPD;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_SLOTID
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT8 ExpnsSlotReg;
- UINT8 ChassisNo;
-} EFI_PCI_CAPABILITY_SLOTID;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_MSI
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 MsgCtrlReg;
- UINT32 MsgAddrReg;
- UINT16 MsgDataReg;
-} EFI_PCI_CAPABILITY_MSI32;
-
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 MsgCtrlReg;
- UINT32 MsgAddrRegLsdw;
- UINT32 MsgAddrRegMsdw;
- UINT16 MsgDataReg;
-} EFI_PCI_CAPABILITY_MSI64;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_HOTPLUG
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- //
- // not finished - fields need to go here
- //
-} EFI_PCI_CAPABILITY_HOTPLUG;
-
-//
-// Capability EFI_PCI_CAPABILITY_ID_PCIX
-//
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 CommandReg;
- UINT32 StatusReg;
-} EFI_PCI_CAPABILITY_PCIX;
-
-typedef struct {
- EFI_PCI_CAPABILITY_HDR Hdr;
- UINT16 SecStatusReg;
- UINT32 StatusReg;
- UINT32 SplitTransCtrlRegUp;
- UINT32 SplitTransCtrlRegDn;
-} EFI_PCI_CAPABILITY_PCIX_BRDG;
-
-#define DEVICE_ID_NOCARE 0xFFFF
-
-#define PCI_ACPI_UNUSED 0
-#define PCI_BAR_NOCHANGE 0
-#define PCI_BAR_OLD_ALIGN 0xFFFFFFFFFFFFFFFFULL
-#define PCI_BAR_EVEN_ALIGN 0xFFFFFFFFFFFFFFFEULL
-#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL
-#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL
-
-#define PCI_BAR_IDX0 0x00
-#define PCI_BAR_IDX1 0x01
-#define PCI_BAR_IDX2 0x02
-#define PCI_BAR_IDX3 0x03
-#define PCI_BAR_IDX4 0x04
-#define PCI_BAR_IDX5 0x05
-#define PCI_BAR_ALL 0xFF
-
-#pragma pack(pop)
-
-//
-// NOTE: The following header files are included here for
-// compatibility consideration.
-//
-#include "pci23.h"
-#include "pci30.h"
-#include "EfiPci.h"
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/pci23.h b/BaseTools/Source/C/Include/IndustryStandard/pci23.h
deleted file mode 100644
index 491d05f11a..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/pci23.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/** @file
- Support for PCI 2.3 standard.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: pci23.h
-
-**/
-
-#ifndef _PCI23_H
-#define _PCI23_H
-
-//#include "pci22.h"
-
-#define PCI_EXP_MAX_CONFIG_OFFSET 0x1000
-#define EFI_PCI_CAPABILITY_ID_PCIEXP 0x10
-
-#endif
diff --git a/BaseTools/Source/C/Include/IndustryStandard/pci30.h b/BaseTools/Source/C/Include/IndustryStandard/pci30.h
deleted file mode 100644
index 5477f44fed..0000000000
--- a/BaseTools/Source/C/Include/IndustryStandard/pci30.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/** @file
- Support for PCI 3.0 standard.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: pci30.h
-
-**/
-
-#ifndef _PCI30_H
-#define _PCI30_H
-
-//#include "pci23.h"
-
-#define PCI_CLASS_MASS_STORAGE_SATADPA 0x06
-
-#pragma pack(push, 1)
-
-typedef struct {
- UINT32 Signature; // "PCIR"
- UINT16 VendorId;
- UINT16 DeviceId;
- UINT16 DeviceListOffset;
- UINT16 Length;
- UINT8 Revision;
- UINT8 ClassCode[3];
- UINT16 ImageLength;
- UINT16 CodeRevision;
- UINT8 CodeType;
- UINT8 Indicator;
- UINT16 MaxRuntimeImageLength;
- UINT16 ConfigUtilityCodeHeaderOffset;
- UINT16 DMTFCLPEntryPointOffset;
-} PCI_3_0_DATA_STRUCTURE;
-
-#pragma pack(pop)
-
-#endif
diff --git a/BaseTools/Source/C/Include/Protocol/GraphicsOutput.h b/BaseTools/Source/C/Include/Protocol/GraphicsOutput.h
deleted file mode 100644
index cdcc28f40a..0000000000
--- a/BaseTools/Source/C/Include/Protocol/GraphicsOutput.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/** @file
- Graphics Output Protocol from the UEFI 2.0 specification.
-
- Abstraction of a very simple graphics device.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: GraphicsOutput.h
-
-**/
-
-#ifndef __GRAPHICS_OUTPUT_H__
-#define __GRAPHICS_OUTPUT_H__
-
-#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
- { \
- 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \
- }
-
-typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;
-
-typedef struct {
- UINT32 RedMask;
- UINT32 GreenMask;
- UINT32 BlueMask;
- UINT32 ReservedMask;
-} EFI_PIXEL_BITMASK;
-
-typedef enum {
- PixelRedGreenBlueReserved8BitPerColor,
- PixelBlueGreenRedReserved8BitPerColor,
- PixelBitMask,
- PixelBltOnly,
- PixelFormatMax
-} EFI_GRAPHICS_PIXEL_FORMAT;
-
-typedef struct {
- UINT32 Version;
- UINT32 HorizontalResolution;
- UINT32 VerticalResolution;
- EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;
- EFI_PIXEL_BITMASK PixelInformation;
- UINT32 PixelsPerScanLine;
-} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;
-
-/**
- Return the current video mode information.
-
- @param This Protocol instance pointer.
- @param ModeNumber The mode number to return information on.
- @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
- @param Info A pointer to callee allocated buffer that returns information about ModeNumber.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.
- @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
- @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN UINT32 ModeNumber,
- OUT UINTN *SizeOfInfo,
- OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
- )
-;
-
-/**
- Return the current video mode information.
-
- @param This Protocol instance pointer.
- @param ModeNumber The mode number to be set.
-
- @retval EFI_SUCCESS Graphics mode was changed.
- @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
- @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN UINT32 ModeNumber
- )
-;
-
-typedef struct {
- UINT8 Blue;
- UINT8 Green;
- UINT8 Red;
- UINT8 Reserved;
-} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;
-
-typedef union {
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;
- UINT32 Raw;
-} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;
-
-typedef enum {
- EfiBltVideoFill,
- EfiBltVideoToBltBuffer,
- EfiBltBufferToVideo,
- EfiBltVideoToVideo,
- EfiGraphicsOutputBltOperationMax
-} EFI_GRAPHICS_OUTPUT_BLT_OPERATION;
-
-/**
- The following table defines actions for BltOperations:
-
- <B>EfiBltVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)
- directly to every pixel of the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- Only one pixel will be used from the BltBuffer. Delta is NOT used.
-
- <B>EfiBltVideoToBltBuffer</B> - Read data from the video display rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
- the BltBuffer rectangle (DestinationX, DestinationY )
- (DestinationX + Width, DestinationY + Height). If DestinationX or
- DestinationY is not zero then Delta must be set to the length in bytes
- of a row in the BltBuffer.
-
- <B>EfiBltBufferToVideo</B> - Write data from the BltBuffer rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
- video display rectangle (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
- not zero then Delta must be set to the length in bytes of a row in the
- BltBuffer.
-
- <B>EfiBltVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
- (SourceX + Width, SourceY + Height) .to the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- The BltBuffer and Delta are not used in this mode.
-
- @param This Protocol instance pointer.
- @param BltBuffer Buffer containing data to blit into video buffer. This
- buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- @param BltOperation Operation to perform on BlitBuffer and video memory
- @param SourceX X coordinate of source for the BltBuffer.
- @param SourceY Y coordinate of source for the BltBuffer.
- @param DestinationX X coordinate of destination for the BltBuffer.
- @param DestinationY Y coordinate of destination for the BltBuffer.
- @param Width Width of rectangle in BltBuffer in pixels.
- @param Height Hight of rectangle in BltBuffer in pixels.
- @param Delta OPTIONAL
-
- @retval EFI_SUCCESS The Blt operation completed.
- @retval EFI_INVALID_PARAMETER BltOperation is not valid.
- @retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
- IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- );
-
-typedef struct {
- UINT32 MaxMode;
- UINT32 Mode;
- EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
- UINTN SizeOfInfo;
- EFI_PHYSICAL_ADDRESS FrameBufferBase;
- UINTN FrameBufferSize;
-} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;
-
-struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {
- EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;
- EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode;
- EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt;
- EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;
-};
-
-extern EFI_GUID gEfiGraphicsOutputProtocolGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Protocol/GuidedSectionExtraction.h b/BaseTools/Source/C/Include/Protocol/GuidedSectionExtraction.h
deleted file mode 100644
index 6a1114d053..0000000000
--- a/BaseTools/Source/C/Include/Protocol/GuidedSectionExtraction.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/** @file
- This file declares GUIDed section extraction protocol.
-
- This interface provides a means of decoding a GUID defined encapsulation
- section. There may be multiple different GUIDs associated with the GUIDed
- section extraction protocol. That is, all instances of the GUIDed section
- extraction protocol must have the same interface structure.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: EfiGuidedSectionExtraction.h
-
- @par Revision Reference: PI
- Version 1.00.
-
-**/
-
-#ifndef __EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
-#define __EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
-
-//
-// Forward reference for pure ANSI compatability
-
-typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;
-
-
-/**
- The ExtractSection() function processes the input section and
- allocates a buffer from the pool in which it returns the section
- contents. If the section being extracted contains
- authentication information (the section's
- GuidedSectionHeader.Attributes field has the
- EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values
- returned in AuthenticationStatus must reflect the results of
- the authentication operation. Depending on the algorithm and
- size of the encapsulated data, the time that is required to do
- a full authentication may be prohibitively long for some
- classes of systems. To indicate this, use
- EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by
- the security policy driver (see the Platform Initialization
- Driver Execution Environment Core Interface Specification for
- more details and the GUID definition). If the
- EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle
- database, then, if possible, full authentication should be
- skipped and the section contents simply returned in the
- OutputBuffer. In this case, the
- EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus
- must be set on return. ExtractSection() is callable only from
- TPL_NOTIFY and below. Behavior of ExtractSection() at any
- EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is
- defined in RaiseTPL() in the UEFI 2.0 specification.
-
-
- @param This Indicates the
- EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.
-
- @param InputSection Buffer containing the input GUIDed section
- to be processed. OutputBuffer OutputBuffer
- is allocated from boot services pool
- memory and contains the new section
- stream. The caller is responsible for
- freeing this buffer.
-
- @param OutputSize A pointer to a caller-allocated UINTN in
- which the size of OutputBuffer allocation
- is stored. If the function returns
- anything other than EFI_SUCCESS, the value
- of OutputSize is undefined.
-
- @param AuthenticationStatus A pointer to a caller-allocated
- UINT32 that indicates the
- authentication status of the
- output buffer. If the input
- section's
- GuidedSectionHeader.Attributes
- field has the
- EFI_GUIDED_SECTION_AUTH_STATUS_VAL
- bit as clear, AuthenticationStatus
- must return zero. Both local bits
- (19:16) and aggregate bits (3:0)
- in AuthenticationStatus are
- returned by ExtractSection().
- These bits reflect the status of
- the extraction operation. The bit
- pattern in both regions must be
- the same, as the local and
- aggregate authentication statuses
- have equivalent meaning at this
- level. If the function returns
- anything other than EFI_SUCCESS,
- the value of AuthenticationStatus
- is undefined.
-
-
- @retval EFI_SUCCESS The InputSection was successfully
- processed and the section contents were
- returned.
-
- @retval EFI_OUT_OF_RESOURCES The system has insufficient
- resources to process the
- request.
-
- @retval EFI_INVALID_PARAMETER The GUID in InputSection does
- not match this instance of the
- GUIDed Section Extraction
- Protocol.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_EXTRACT_GUIDED_SECTION)(
- IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
- IN CONST VOID *InputSection,
- OUT VOID **OutputBuffer,
- OUT UINTN *OutputSize,
- OUT UINT32 *AuthenticationStatus
-);
-
-
-/**
-
- Takes the GUIDed section as input and produces the section
- stream data. See the ExtractSection() function description.
-
-**/
-struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {
- EFI_EXTRACT_GUIDED_SECTION ExtractSection;
-};
-
-//
-// Protocol GUID definition. Each GUIDed section extraction protocol has the
-// same interface but with different GUID. All the GUIDs is defined here.
-// May add multiple GUIDs here.
-//
-#define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID \
- { \
- 0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } \
- }
-
-//
-// may add other GUID here
-//
-extern EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Protocol/HiiFramework.h b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
deleted file mode 100644
index d8da4aa5d8..0000000000
--- a/BaseTools/Source/C/Include/Protocol/HiiFramework.h
+++ /dev/null
@@ -1,952 +0,0 @@
-/** @file
- This file defines the Human Interface Infrastructure protocol which will
- be used by resources which want to publish IFR/Font/String data and have it
- collected by the Configuration engine.
-
- Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: HiiFramework.h
-
- @par Revision Reference:
- This protocol is defined in HII spec 0.92.
-
-**/
-
-#ifndef _FRAMEWORK_HII_H_
-#define _FRAMEWORK_HII_H_
-
-//#include <PiDxe.h>
-
-//
-// To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,
-// is defined in MdePkg/Protocol/GraphicsOutput.h
-//
-#include <Protocol/GraphicsOutput.h>
-
-#define EFI_HII_PROTOCOL_GUID \
- { \
- 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
- }
-
-// BugBug:
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-// If UGA goes away we need to put this some place. I'm not sure where?
-//
-//typedef struct {
-// UINT8 Blue;
-// UINT8 Green;
-// UINT8 Red;
-// UINT8 Reserved;
-//} EFI_UGA_PIXEL;
-
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-//
-
-typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;
-
-//
-// Global definition
-//
-#define NARROW_CHAR 0xFFF0
-#define WIDE_CHAR 0xFFF1
-#define NON_BREAKING_CHAR 0xFFF2
-#define GLYPH_WIDTH 8
-#define GLYPH_HEIGHT 19
-
-#define EFI_HII_FONT 1
-#define EFI_HII_STRING 2
-#define EFI_HII_IFR 3
-#define EFI_HII_KEYBOARD 4
-#define EFI_HII_HANDLES 5
-#define EFI_HII_VARIABLE 6
-#define EFI_HII_DEVICE_PATH 7
-
-
-// References to string tokens must use this macro to enable scanning for
-// token usages.
-//
-#define STRING_TOKEN(t) t
-
-//
-// The following types are currently defined:
-// EFI_FROM_ID has been defined in UEFI spec.
-//
-typedef UINT16 EFI_FORM_LABEL;
-
-#pragma pack(1)
-
-typedef struct {
- UINT32 Length;
- UINT16 Type;
-} EFI_HII_PACK_HEADER;
-
-//
-// A form list consists of a large variety of structure
-// possibilities so to represent the binary blob of data
-// associated with a package of forms, we will assume a
-// pointer to a self-describing data buffer.
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
-} EFI_HII_IFR_PACK;
-
-typedef struct {
- EFI_HII_PACK_HEADER Header; // Must be filled in
- EFI_HANDLE ImageHandle; // Must be filled in
- EFI_HANDLE DeviceHandle; // Optional
- EFI_HANDLE ControllerHandle; // Optional
- EFI_HANDLE CallbackHandle; // Optional
- EFI_HANDLE COBExportHandle; // Optional
-} EFI_HII_HANDLE_PACK;
-
-//
-// ********************************************************
-// EFI_VARIABLE_CONTENTS
-// ********************************************************
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
- EFI_GUID VariableGuid;
- UINT32 VariableNameLength;
- UINT16 VariableId;
- //
- // CHAR16 VariableName[]; //Null-terminated
- //
-} EFI_HII_VARIABLE_PACK;
-
-//
-// ********************************************************
-// EFI_DEVICE_PATH_PACK
-// ********************************************************
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
- //
- // EFI_DEVICE_PATH DevicePath[];
- //
-} EFI_HII_DEVICE_PATH_PACK;
-
-//
-// ********************************************************
-// EFI_HII_DATA_TABLE
-// ********************************************************
-//
-typedef struct {
- EFI_HII_HANDLE HiiHandle;
- EFI_GUID PackageGuid;
- UINT32 DataTableSize;
- UINT32 IfrDataOffset;
- UINT32 StringDataOffset;
- UINT32 VariableDataOffset;
- UINT32 DevicePathOffset;
- UINT32 NumberOfVariableData;
- UINT32 NumberOfLanguages;
- //
- // EFI_HII_DEVICE_PATH_PACK DevicePath[];
- // EFI_HII_VARIABLE_PACK VariableData[];
- // EFI_HII_IFR_PACK IfrData;
- // EFI_HII_STRING_PACK StringData[];
- //
-} EFI_HII_DATA_TABLE;
-
-//
-// ********************************************************
-// EFI_HII_EXPORT_TABLE
-// ********************************************************
-//
-typedef struct {
- UINT32 NumberOfHiiDataTables;
- EFI_GUID Revision;
- //
- // EFI_HII_DATA_TABLE HiiDataTable[];
- //
-} EFI_HII_EXPORT_TABLE;
-
-typedef struct {
- BOOLEAN FormSetUpdate; // If TRUE, next variable is significant
- EFI_PHYSICAL_ADDRESS FormCallbackHandle; // If not 0, will update Formset with this info
- BOOLEAN FormUpdate; // If TRUE, next variable is significant
- UINT16 FormValue; // specify which form is to be updated if FormUpdate value is TRUE.
- STRING_REF FormTitle; // If not 0, will update Form with this info
- UINT16 DataCount; // The number of Data entries in this structure
- UINT8 *Data; // An array of 1+ op-codes, specified by DataCount
-} EFI_HII_UPDATE_DATA;
-
-//
-// String attributes
-//
-#define LANG_RIGHT_TO_LEFT 0x00000001
-
-//
-// A string package is used to localize strings to a particular
-// language. The package is associated with a particular driver
-// or set of drivers. Tools are used to associate tokens with
-// string references in forms and in programs. These tokens are
-// language agnostic. When paired with a language pack (directly
-// or indirectly), the string token resolves into an actual
-// UNICODE string. The NumStringPointers determines how many
-// StringPointers (offset values) there are as well as the total
-// number of Strings that are defined.
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
- RELOFST LanguageNameString;
- RELOFST PrintableLanguageName;
- UINT32 NumStringPointers;
- UINT32 Attributes;
- //
- // RELOFST StringPointers[];
- // EFI_STRING Strings[];
- //
-} EFI_HII_STRING_PACK;
-
-//
-// Glyph Attributes
-//
-#define EFI_GLYPH_NON_SPACING 1
-#define EFI_GLYPH_WIDE 2
-
-typedef struct {
- CHAR16 UnicodeWeight;
- UINT8 Attributes;
- UINT8 GlyphCol1[GLYPH_HEIGHT];
-} EFI_NARROW_GLYPH;
-
-typedef struct {
- CHAR16 UnicodeWeight;
- UINT8 Attributes;
- UINT8 GlyphCol1[GLYPH_HEIGHT];
- UINT8 GlyphCol2[GLYPH_HEIGHT];
- UINT8 Pad[3];
-} EFI_WIDE_GLYPH;
-
-//
-// A font list consists of a font header followed by a series
-// of glyph structures. Note that fonts are not language specific.
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
- UINT16 NumberOfNarrowGlyphs;
- UINT16 NumberOfWideGlyphs;
-} EFI_HII_FONT_PACK;
-
-//
-// The IfrData in the EFI_HII_IFR_PACK structure definition
-// is variable length, and not really part of the header. To
-// simplify from code the size of the header, define an
-// identical structure that does not include the IfrData field.
-// Then use sizeof() this new structure to determine the
-// actual size of the header.
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
-} EFI_HII_IFR_PACK_HEADER;
-
-//
-// pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;
-//
-typedef enum {
- EfiKeyLCtrl,
- EfiKeyA0,
- EfiKeyLAlt,
- EfiKeySpaceBar,
- EfiKeyA2,
- EfiKeyA3,
- EfiKeyA4,
- EfiKeyRCtrl,
- EfiKeyLeftArrow,
- EfiKeyDownArrow,
- EfiKeyRightArrow,
- EfiKeyZero,
- EfiKeyPeriod,
- EfiKeyEnter,
- EfiKeyLShift,
- EfiKeyB0,
- EfiKeyB1,
- EfiKeyB2,
- EfiKeyB3,
- EfiKeyB4,
- EfiKeyB5,
- EfiKeyB6,
- EfiKeyB7,
- EfiKeyB8,
- EfiKeyB9,
- EfiKeyB10,
- EfiKeyRshift,
- EfiKeyUpArrow,
- EfiKeyOne,
- EfiKeyTwo,
- EfiKeyThree,
- EfiKeyCapsLock,
- EfiKeyC1,
- EfiKeyC2,
- EfiKeyC3,
- EfiKeyC4,
- EfiKeyC5,
- EfiKeyC6,
- EfiKeyC7,
- EfiKeyC8,
- EfiKeyC9,
- EfiKeyC10,
- EfiKeyC11,
- EfiKeyC12,
- EfiKeyFour,
- EfiKeyFive,
- EfiKeySix,
- EfiKeyPlus,
- EfiKeyTab,
- EfiKeyD1,
- EfiKeyD2,
- EfiKeyD3,
- EfiKeyD4,
- EfiKeyD5,
- EfiKeyD6,
- EfiKeyD7,
- EfiKeyD8,
- EfiKeyD9,
- EfiKeyD10,
- EfiKeyD11,
- EfiKeyD12,
- EfiKeyD13,
- EfiKeyDel,
- EfiKeyEnd,
- EfiKeyPgDn,
- EfiKeySeven,
- EfiKeyEight,
- EfiKeyNine,
- EfiKeyE0,
- EfiKeyE1,
- EfiKeyE2,
- EfiKeyE3,
- EfiKeyE4,
- EfiKeyE5,
- EfiKeyE6,
- EfiKeyE7,
- EfiKeyE8,
- EfiKeyE9,
- EfiKeyE10,
- EfiKeyE11,
- EfiKeyE12,
- EfiKeyBackSpace,
- EfiKeyIns,
- EfiKeyHome,
- EfiKeyPgUp,
- EfiKeyNLck,
- EfiKeySlash,
- EfiKeyAsterisk,
- EfiKeyMinus,
- EfiKeyEsc,
- EfiKeyF1,
- EfiKeyF2,
- EfiKeyF3,
- EfiKeyF4,
- EfiKeyF5,
- EfiKeyF6,
- EfiKeyF7,
- EfiKeyF8,
- EfiKeyF9,
- EfiKeyF10,
- EfiKeyF11,
- EfiKeyF12,
- EfiKeyPrint,
- EfiKeySLck,
- EfiKeyPause
-} EFI_KEY;
-
-typedef struct {
- EFI_KEY Key;
- CHAR16 Unicode;
- CHAR16 ShiftedUnicode;
- CHAR16 AltGrUnicode;
- CHAR16 ShiftedAltGrUnicode;
- UINT16 Modifier;
-} EFI_KEY_DESCRIPTOR;
-
-//
-// This structure allows a sparse set of keys to be redefined
-// or a complete redefinition of the keyboard layout. Most
-// keyboards have a lot of commonality in their layouts, therefore
-// only defining those keys that need to change from the default
-// minimizes the passed in information.
-//
-// Additionally, when an update occurs, the active keyboard layout
-// will be switched to the newly updated keyboard layout. This
-// allows for situations that when a keyboard layout driver is
-// loaded as part of system initialization, the system will default
-// the keyboard behavior to the new layout.
-//
-// Each call to update the keyboard mapping should contain the
-// complete set of key descriptors to be updated, since every
-// call to the HII which contains an EFI_HII_KEYBOARD_PACK will
-// wipe the previous set of overrides. A call to
-//
-typedef struct {
- EFI_HII_PACK_HEADER Header;
- EFI_KEY_DESCRIPTOR *Descriptor;
- UINT8 DescriptorCount;
-} EFI_HII_KEYBOARD_PACK;
-
-//
-// The EFI_HII_PACKAGES can contain different types of packages just
-// after the structure as inline data.
-//
-typedef struct {
- UINTN NumberOfPackages;
- EFI_GUID *GuidId;
- //
- // EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.
- // EFI_HII_IFR_PACK *IfrPack; // Only one pack.
- // EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok
- // EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok
- // EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok
- //
-} EFI_HII_PACKAGES;
-
-typedef struct _EFI_HII_VARIABLE_PACK_LIST {
- struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;
- EFI_HII_VARIABLE_PACK *VariablePack;
-} EFI_HII_VARIABLE_PACK_LIST;
-
-
-#pragma pack()
-
-/**
- Registers the various packs that are passed in via the Packages parameter.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Packages A pointer to an EFI_HII_PACKAGES package instance.
- @param Handle A pointer to the EFI_HII_HANDLE instance.
-
- @retval EFI_SUCCESS Data was extracted from Packages, the database
- was updated with the data, and Handle returned successfully.
- @retval EFI_INVALID_PARAMETER The content of Packages was invalid.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_NEW_PACK) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_PACKAGES *Packages,
- OUT EFI_HII_HANDLE *Handle
- );
-
-/**
- Removes a package from the HII database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle that was registered to the data that is requested
- for removal.
-
- @retval EFI_SUCCESS The data associated with the Handle was removed
- from the HII database.
- @retval EFI_INVALID_PARAMETER The Handle was not valid.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_REMOVE_PACK) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle
- );
-
-/**
- Determines the handles that are currently active in the database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param HandleBufferLength On input, a pointer to the length of the handle
- buffer. On output, the length of the handle buffer that is required
- for the handles found.
- @param Handle An array of EFI_HII_HANDLE instances returned.
-
- @retval EFI_SUCCESS Handle was updated successfully.
- @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates
- that Handle is too small to support the number of handles.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_FIND_HANDLES) (
- IN EFI_HII_PROTOCOL *This,
- IN OUT UINT16 *HandleBufferLength,
- OUT EFI_HII_HANDLE *Handle
- );
-
-/**
- Exports the contents of the database into a buffer.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle An EFI_HII_HANDLE that corresponds to the desired
- handle to export. If the value is 0, the entire database will be exported.
- In either case, the data will be exported in a format described by the
- structure definition of EFI_HII_EXPORT_TABLE.
- @param BufferSize
- On input, a pointer to the length of the buffer. On output, the length
- of the buffer that is required for the export data.
- @param Buffer A pointer to a buffer that will contain the results of the export function.
-
- @retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.
- @retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_EXPORT) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- );
-
-/**
- Remove any new strings that were added after the initial string export
- for this handle.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle on which the string resides.
-
- @retval EFI_SUCCESS Remove strings from the handle successfully.
- @retval EFI_INVALID_PARAMETER The Handle was unknown.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_RESET_STRINGS) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle
- );
-
-/**
- Tests if all of the characters in a string have corresponding font characters.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param StringToTest A pointer to a Unicode string.
- @param FirstMissing A pointer to an index into the string. On input,
- the index of the first character in the StringToTest to examine. On exit,
- the index of the first character encountered for which a glyph is unavailable.
- If all glyphs in the string are available, the index is the index of the
- terminator of the string.
- @param GlyphBufferSize A pointer to a value. On output, if the function
- returns EFI_SUCCESS, it contains the amount of memory that is required to
- store the string's glyph equivalent.
-
- @retval EFI_SUCCESS All glyphs are available. Note that an empty string
- always returns this value.
- @retval EFI_NOT_FOUND A glyph was not found for a character.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_TEST_STRING) (
- IN EFI_HII_PROTOCOL *This,
- IN CHAR16 *StringToTest,
- IN OUT UINT32 *FirstMissing,
- OUT UINT32 *GlyphBufferSize
- );
-
-/**
- Translates a Unicode character into the corresponding font glyph.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Source A pointer to a Unicode string.
- @param Index On input, the offset into the string from which to fetch
- the character.On successful completion, the index is updated to the first
- character past the character(s) making up the just extracted glyph.
- @param GlyphBuffer Pointer to an array where the glyphs corresponding
- to the characters in the source may be stored. GlyphBuffer is assumed
- to be wide enough to accept a wide glyph character.
- @param BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by
- this value is filled with the length of the glyph in pixels. It is unchanged
- if the call was unsuccessful.
- @param InternalStatus The cell pointed to by this parameter must be
- initialized to zero prior to invoking the call the first time for any string.
-
- @retval EFI_SUCCESS It worked.
- @retval EFI_NOT_FOUND A glyph for a character was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_GLYPH) (
- IN EFI_HII_PROTOCOL *This,
- IN CHAR16 *Source,
- IN OUT UINT16 *Index,
- OUT UINT8 **GlyphBuffer,
- OUT UINT16 *BitWidth,
- IN OUT UINT32 *InternalStatus
- );
-
-/**
- Translates a glyph into the format required for input to the Universal
- Graphics Adapter (UGA) Block Transfer (BLT) routines.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param GlyphBuffer A pointer to the buffer that contains glyph data.
- @param Foreground The foreground setting requested to be used for the
- generated BltBuffer data.
- @param Background The background setting requested to be used for the
- generated BltBuffer data.
- @param Count The entry in the BltBuffer upon which to act.
- @param Width The width in bits of the glyph being converted.
- @param Height The height in bits of the glyph being converted
- @param BltBuffer A pointer to the buffer that contains the data that is
- ready to be used by the UGA BLT routines.
-
- @retval EFI_SUCCESS It worked.
- @retval EFI_NOT_FOUND A glyph for a character was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GLYPH_TO_BLT) (
- IN EFI_HII_PROTOCOL *This,
- IN UINT8 *GlyphBuffer,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
- IN UINTN Count,
- IN UINTN Width,
- IN UINTN Height,
- IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
- );
-
-/**
- Allows a new string to be added to an already existing string package.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Pointer to a NULL-terminated string containing a single ISO 639-2
- language identifier, indicating the language in which the string is translated.
- @param Handle The handle of the language pack to which the string is to be added.
- @param Reference The identifier of the string to be added. If the reference
- value is zero, then the string will be assigned a new identifier on that
- handle for the language specified. Otherwise, the string will be updated
- with the NewString Value.
- @param NewString The string to be added.
-
- @retval EFI_SUCCESS The string was effectively registered.
- @retval EFI_INVALID_PARAMETER The Handle was unknown.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_NEW_STRING) (
- IN EFI_HII_PROTOCOL *This,
- IN CHAR16 *Language,
- IN EFI_HII_HANDLE Handle,
- IN OUT STRING_REF *Reference,
- IN CHAR16 *NewString
- );
-
-/**
- Allows a program to determine the primary languages that are supported
- on a given handle.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle on which the strings reside.
- @param LanguageString A string allocated by GetPrimaryLanguages() that
- contains a list of all primary languages registered on the handle.
-
- @retval EFI_SUCCESS LanguageString was correctly returned.
- @retval EFI_INVALID_PARAMETER The Handle was unknown.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- OUT EFI_STRING *LanguageString
- );
-
-/**
- Allows a program to determine which secondary languages are supported
- on a given handle for a given primary language.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle on which the strings reside.
- @param PrimaryLanguage Pointer to a NULL-terminated string containing a single
- ISO 639-2 language identifier, indicating the primary language.
- @param LanguageString A string allocated by GetSecondaryLanguages()
- containing a list of all secondary languages registered on the handle.
-
- @retval EFI_SUCCESS LanguageString was correctly returned.
- @retval EFI_INVALID_PARAMETER The Handle was unknown.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN CHAR16 *PrimaryLanguage,
- OUT EFI_STRING *LanguageString
- );
-
-/**
- Extracts a string from a package already registered with the EFI HII database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle on which the string resides.
- @param Token The string token assigned to the string.
- @param Raw If TRUE, the string is returned unedited in the internal
- storage format described above. If false, the string returned is edited
- by replacing <cr> with <space> and by removing special characters such
- as the <wide> prefix.
- @param LanguageString Pointer to a NULL-terminated string containing a
- single ISO 639-2 language identifier, indicating the language to print.
- If the LanguageString is empty (starts with a NULL), the default system
- language will be used to determine the language.
- @param BufferLength Length of the StringBuffer.
- @param StringBuffer The buffer designed to receive the characters in the string.
-
- @retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.
- @retval EFI_INVALID_PARAMETER The handle or string token is unknown.
- @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to
- allow the entire string to be stored.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_STRING) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN STRING_REF Token,
- IN BOOLEAN Raw,
- IN CHAR16 *LanguageString,
- IN OUT UINTN *BufferLength,
- OUT EFI_STRING StringBuffer
- );
-
-/**
- Allows a program to extract a part of a string of not more than a given width.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The handle on which the string resides.
- @param Token The string token assigned to the string.
- @param Index On input, the offset into the string where the line is to start.
- On output, the index is updated to point to beyond the last character returned
- in the call.
- @param LineWidth The maximum width of the line in units of narrow glyphs.
- @param LanguageString Pointer to a NULL-terminated string containing a
- single ISO 639-2 language identifier, indicating the language to print.
- @param BufferLength Pointer to the length of the StringBuffer.
- @param StringBuffer The buffer designed to receive the characters in the string.
-
- @retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.
- @retval EFI_NOT_FOUND The font glyph for at least one of the characters in
- the string is not in the font database.
- @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
- to allow the entire string to be stored.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_LINE) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN STRING_REF Token,
- IN OUT UINT16 *Index,
- IN UINT16 LineWidth,
- IN CHAR16 *LanguageString,
- IN OUT UINT16 *BufferLength,
- OUT EFI_STRING StringBuffer
- );
-
-/**
- Allows a program to extract a form or form package that has previously
- been registered with the HII database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle Handle on which the form resides.
- @param FormId The ID of the form to return. If the ID is zero,
- the entire form package is returned.
- @param BufferLength On input, the length of the Buffer. On output,
- the length of the returned buffer,
- @param Buffer The buffer designed to receive the form(s).
-
- @retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength
- was updated.
- @retval EFI_INVALID_PARAMETER The handle is unknown.
- @retval EFI_NOT_FOUND A form on the requested handle cannot be found with
- the requested FormId.
- @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
- to allow the form to be stored.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_FORMS) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN EFI_FORM_ID FormId,
- IN OUT UINTN *BufferLength,
- OUT UINT8 *Buffer
- );
-
-/**
- Extracts the defaults that are associated with a given handle in the HII database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle The HII handle from which will have default data retrieved.
- @param DefaultMask The mask used to specify some type of default override when extracting
- the default image data.
- @param VariablePackList A indirect pointer to the first entry of a link list with
- type EFI_HII_VARIABLE_PACK_LIST.
-
- @retval EFI_SUCCESS The VariablePackList was populated with the appropriate
- default setting data.
- @retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).
- @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle
- contain invalid data.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN UINTN DefaultMask,
- OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
- );
-
-/**
- Allows the caller to update a form or form package that has previously been
- registered with the EFI HII database.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param Handle Handle of the package where the form to be updated resides.
- @param Label The label inside the form package where the update is to take place.
- @param AddData If TRUE, adding data at a given Label; otherwise,
- if FALSE, removing data at a given Label.
- @param Data The buffer containing the new tags to insert after the Label
-
- @retval EFI_SUCCESS The form was updated with the new tags.
- @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not
- contain an integral number of tags.
- @retval EFI_NOT_FOUND The Handle, Label, or FormId was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_UPDATE_FORM) (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_HANDLE Handle,
- IN EFI_FORM_LABEL Label,
- IN BOOLEAN AddData,
- IN EFI_HII_UPDATE_DATA *Data
- );
-
-/**
- Retrieves the current keyboard layout.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param DescriptorCount A pointer to the number of Descriptor entries being
- described in the keyboard layout being retrieved.
- @param Descriptor A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR
- entries. Each entry will reflect the definition of a specific physical key.
-
- @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (
- IN EFI_HII_PROTOCOL *This,
- OUT UINT16 *DescriptorCount,
- OUT EFI_KEY_DESCRIPTOR *Descriptor
- );
-
-/**
- @par Protocol Description:
- The HII Protocol manages the HII database, which is a repository for data
- having to do with fonts, strings, forms, keyboards, and other future human
- interface items.
-
- @param NewPack
- Extracts the various packs from a package list.
-
- @param RemovePack
- Removes a package from the HII database.
-
- @param FindHandles
- Determines the handles that are currently active in the database.
-
- @param ExportDatabase
- Export the entire contents of the database to a buffer.
-
- @param TestString
- Tests if all of the characters in a string have corresponding font characters.
-
- @param GetGlyph
- Translates a Unicode character into the corresponding font glyph.
-
- @param GlyphToBlt
- Converts a glyph value into a format that is ready for a UGA BLT command.
-
- @param NewString
- Allows a new string to be added to an already existing string package.
-
- @param GetPrimaryLanguages
- Allows a program to determine the primary languages that are supported
- on a given handle.
-
- @param GetSecondaryLanguages
- Allows a program to determine which secondary languages are supported
- on a given handle for a given primary language.
-
- @param GetString
- Extracts a string from a package that is already registered with the
- EFI HII database.
-
- @param ResetString
- Remove any new strings that were added after the initial string export
- for this handle.
-
- @param GetLine
- Allows a program to extract a part of a string of not more than a given width.
-
- @param GetForms
- Allows a program to extract a form or form package that has been previously registered.
-
- @param GetDefaultImage
- Allows a program to extract the nonvolatile image that represents the default storage image.
-
- @param UpdateForm
- Allows a program to update a previously registered form.
-
- @param GetKeyboardLayout
- Allows a program to extract the current keyboard layout.
-
-**/
-struct _EFI_HII_PROTOCOL {
- EFI_HII_NEW_PACK NewPack;
- EFI_HII_REMOVE_PACK RemovePack;
- EFI_HII_FIND_HANDLES FindHandles;
- EFI_HII_EXPORT ExportDatabase;
-
- EFI_HII_TEST_STRING TestString;
- EFI_HII_GET_GLYPH GetGlyph;
- EFI_HII_GLYPH_TO_BLT GlyphToBlt;
-
- EFI_HII_NEW_STRING NewString;
- EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;
- EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;
- EFI_HII_GET_STRING GetString;
- EFI_HII_RESET_STRINGS ResetStrings;
- EFI_HII_GET_LINE GetLine;
- EFI_HII_GET_FORMS GetForms;
- EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage;
- EFI_HII_UPDATE_FORM UpdateForm;
-
- EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
-};
-
-extern EFI_GUID gEfiHiiProtocolGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/Protocol/UgaDraw.h b/BaseTools/Source/C/Include/Protocol/UgaDraw.h
deleted file mode 100644
index 2da3d1d5fe..0000000000
--- a/BaseTools/Source/C/Include/Protocol/UgaDraw.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/** @file
- UGA Draw protocol from the EFI 1.1 specification.
-
- Abstraction of a very simple graphics device.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File name: UgaDraw.h
-
-**/
-
-#ifndef __UGA_DRAW_H__
-#define __UGA_DRAW_H__
-
-#define EFI_UGA_DRAW_PROTOCOL_GUID \
- { \
- 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
- }
-
-typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
-
-/**
- Return the current video mode information.
-
- @param This Protocol instance pointer.
- @param HorizontalResolution Current video horizontal resolution in pixels
- @param VerticalResolution Current video vertical resolution in pixels
- @param ColorDepth Current video color depth in bits per pixel
- @param RefreshRate Current video refresh rate in Hz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
- @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- OUT UINT32 *HorizontalResolution,
- OUT UINT32 *VerticalResolution,
- OUT UINT32 *ColorDepth,
- OUT UINT32 *RefreshRate
- )
-;
-
-/**
- Return the current video mode information.
-
- @param This Protocol instance pointer.
- @param HorizontalResolution Current video horizontal resolution in pixels
- @param VerticalResolution Current video vertical resolution in pixels
- @param ColorDepth Current video color depth in bits per pixel
- @param RefreshRate Current video refresh rate in Hz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- IN UINT32 HorizontalResolution,
- IN UINT32 VerticalResolution,
- IN UINT32 ColorDepth,
- IN UINT32 RefreshRate
- )
-;
-
-typedef struct {
- UINT8 Blue;
- UINT8 Green;
- UINT8 Red;
- UINT8 Reserved;
-} EFI_UGA_PIXEL;
-
-typedef union {
- EFI_UGA_PIXEL Pixel;
- UINT32 Raw;
-} EFI_UGA_PIXEL_UNION;
-
-typedef enum {
- EfiUgaVideoFill,
- EfiUgaVideoToBltBuffer,
- EfiUgaBltBufferToVideo,
- EfiUgaVideoToVideo,
- EfiUgaBltMax
-} EFI_UGA_BLT_OPERATION;
-
-/**
- Type specifying a pointer to a function to perform an UGA Blt operation.
-
- The following table defines actions for BltOperations:
-
- <B>EfiUgaVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)
- directly to every pixel of the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- Only one pixel will be used from the BltBuffer. Delta is NOT used.
-
- <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
- the BltBuffer rectangle (DestinationX, DestinationY )
- (DestinationX + Width, DestinationY + Height). If DestinationX or
- DestinationY is not zero then Delta must be set to the length in bytes
- of a row in the BltBuffer.
-
- <B>EfiUgaBltBufferToVideo</B> - Write data from the BltBuffer rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
- video display rectangle (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
- not zero then Delta must be set to the length in bytes of a row in the
- BltBuffer.
-
- <B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
- (SourceX + Width, SourceY + Height) .to the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- The BltBuffer and Delta are not used in this mode.
-
-
- @param[in] This - Protocol instance pointer.
- @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
- buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
- @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
- @param[in] SourceX - X coordinate of source for the BltBuffer.
- @param[in] SourceY - Y coordinate of source for the BltBuffer.
- @param[in] DestinationX - X coordinate of destination for the BltBuffer.
- @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
- @param[in] Width - Width of rectangle in BltBuffer in pixels.
- @param[in] Height - Hight of rectangle in BltBuffer in pixels.
- @param[in] Delta - OPTIONAL
-
- @retval EFI_SUCCESS - The Blt operation completed.
- @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
- @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.
-
---*/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (
- IN EFI_UGA_DRAW_PROTOCOL * This,
- IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL
- IN EFI_UGA_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- );
-
-struct _EFI_UGA_DRAW_PROTOCOL {
- EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;
- EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;
- EFI_UGA_DRAW_PROTOCOL_BLT Blt;
-};
-
-extern EFI_GUID gEfiUgaDrawProtocolGuid;
-
-#endif
diff --git a/BaseTools/Source/C/Include/X64/ProcessorBind.h b/BaseTools/Source/C/Include/X64/ProcessorBind.h
deleted file mode 100644
index 6f03dfa67d..0000000000
--- a/BaseTools/Source/C/Include/X64/ProcessorBind.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/** @file
- Processor or Compiler specific defines and types x64 (Intel(r) EM64T, AMD64).
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at:
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- File Name: ProcessorBind.h
-
-**/
-
-#ifndef __PROCESSOR_BIND_H__
-#define __PROCESSOR_BIND_H__
-
-//
-// Define the processor type so other code can make processor based choices
-//
-#define MDE_CPU_X64
-
-
-//
-// Make sure we are useing the correct packing rules per EFI specification
-//
-#ifndef __GNUC__
-#pragma pack()
-#endif
-
-
-#if _MSC_EXTENSIONS
-
-//
-// Disable warning that make it impossible to compile at /W4
-// This only works for Microsoft* tools
-//
-
-//
-// Disabling bitfield type checking warnings.
-//
-#pragma warning ( disable : 4214 )
-
-//
-// Disabling the unreferenced formal parameter warnings.
-//
-#pragma warning ( disable : 4100 )
-
-//
-// Disable slightly different base types warning as CHAR8 * can not be set
-// to a constant string.
-//
-#pragma warning ( disable : 4057 )
-
-//
-// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
-//
-#pragma warning ( disable : 4127 )
-
-
-#endif
-
-
-#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
- //
- // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
- //
-
- #if _MSC_EXTENSIONS
-
-
- //
- // use Microsoft C complier dependent integer width types
- //
- typedef unsigned __int64 UINT64;
- typedef __int64 INT64;
- typedef unsigned __int32 UINT32;
- typedef __int32 INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef char INT8;
- #else
- #ifdef _EFI_P64
- //
- // P64 - is Intel Itanium(TM) speak for pointers being 64-bit and longs and ints
- // are 32-bits
- //
- typedef unsigned long long UINT64;
- typedef long long INT64;
- typedef unsigned int UINT32;
- typedef int INT32;
- typedef unsigned short CHAR16;
- typedef unsigned short UINT16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef char INT8;
- #else
- //
- // Assume LP64 - longs and pointers are 64-bit. Ints are 32-bit.
- //
- typedef unsigned long UINT64;
- typedef long INT64;
- typedef unsigned int UINT32;
- typedef int INT32;
- typedef unsigned short UINT16;
- typedef unsigned short CHAR16;
- typedef short INT16;
- typedef unsigned char BOOLEAN;
- typedef unsigned char UINT8;
- typedef char CHAR8;
- typedef char INT8;
- #endif
- #endif
-
- #define UINT8_MAX 0xff
-
-#else
- //
- // Use ANSI C 2000 stdint.h integer width declarations
- //
- #include <stdint.h>
- typedef uint8_t BOOLEAN;
- typedef int8_t INT8;
- typedef uint8_t UINT8;
- typedef int16_t INT16;
- typedef uint16_t UINT16;
- typedef int32_t INT32;
- typedef uint32_t UINT32;
- typedef int64_t INT64;
- typedef uint64_t UINT64;
- typedef char CHAR8;
- typedef uint16_t CHAR16;
-
-#endif
-
-typedef UINT64 UINTN;
-typedef INT64 INTN;
-
-
-//
-// Processor specific defines
-//
-#define MAX_BIT 0x8000000000000000ULL
-#define MAX_2_BITS 0xC000000000000000ULL
-
-//
-// Maximum legal Itanium-based address
-//
-#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
-
-//
-// Modifier to ensure that all protocol member functions and EFI intrinsics
-// use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify thier member functions with EFIAPI.
-//
-#if _MSC_EXTENSIONS
- ///
- /// Define the standard calling convention reguardless of optimization level.
- /// __cdecl is Microsoft* specific C extension.
- ///
- #define EFIAPI __cdecl
-#elif __GNUC__
- ///
- /// Define the standard calling convention reguardless of optimization level.
- /// efidecl is an extension to GCC that supports the differnece between x64
- /// GCC ABI and x64 Microsoft* ABI. EFI is closer to the Microsoft* ABI and
- /// EFIAPI makes sure the right ABI is used for public interfaces.
- /// eficecl is a work in progress and we do not yet have the compiler
- ///
- #define EFIAPI
-#else
- #define EFIAPI
-#endif
-
-//
-// The Microsoft* C compiler can removed references to unreferenced data items
-// if the /OPT:REF linker option is used. We defined a macro as this is a
-// a non standard extension
-//
-#if _MSC_EXTENSIONS
- #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
-#else
- #define GLOBAL_REMOVE_IF_UNREFERENCED
-#endif
-
-#endif
-
diff --git a/BaseTools/Source/C/LzmaCompress/GNUmakefile b/BaseTools/Source/C/LzmaCompress/GNUmakefile
deleted file mode 100644
index 21c75ef7df..0000000000
--- a/BaseTools/Source/C/LzmaCompress/GNUmakefile
+++ /dev/null
@@ -1,31 +0,0 @@
-## @file
-# GNU/Linux makefile for 'LzmaCompress' module build.
-#
-# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = LzmaCompress
-
-SDK_C = Sdk/C
-
-OBJECTS = \
- LzmaCompress.o \
- $(SDK_C)/Alloc.o \
- $(SDK_C)/LzFind.o \
- $(SDK_C)/LzmaDec.o \
- $(SDK_C)/LzmaEnc.o \
- $(SDK_C)/7zFile.o \
- $(SDK_C)/7zStream.o \
- $(SDK_C)/Bra86.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
-
diff --git a/BaseTools/Source/C/LzmaCompress/LZMA-SDK-README.txt b/BaseTools/Source/C/LzmaCompress/LZMA-SDK-README.txt
deleted file mode 100644
index e0476ad994..0000000000
--- a/BaseTools/Source/C/LzmaCompress/LZMA-SDK-README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-LzmaCompress is based on the LZMA SDK 4.65. LZMA SDK 4.65
-was placed in the public domain on 2009-02-03. It was
-released on the http://www.7-zip.org/sdk.html website. \ No newline at end of file
diff --git a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c
deleted file mode 100644
index b569b4e4d9..0000000000
--- a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/** @file
- LZMA Compress/Decompress tool (LzmaCompress)
-
- Based on LZMA SDK 4.65:
- LzmaUtil.c -- Test application for LZMA compression
- 2008-11-23 : Igor Pavlov : Public domain
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#define _CRT_SECURE_NO_WARNINGS
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "Sdk/C/Alloc.h"
-#include "Sdk/C/7zFile.h"
-#include "Sdk/C/7zVersion.h"
-#include "Sdk/C/LzmaDec.h"
-#include "Sdk/C/LzmaEnc.h"
-#include "Sdk/C/Bra.h"
-#include "CommonLib.h"
-
-#define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8)
-
-typedef enum {
- NoConverter,
- X86Converter,
- MaxConverter
-} CONVERTER_TYPE;
-
-const char *kCantReadMessage = "Can not read input file";
-const char *kCantWriteMessage = "Can not write output file";
-const char *kCantAllocateMessage = "Can not allocate memory";
-const char *kDataErrorMessage = "Data error";
-
-static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
-static void SzFree(void *p, void *address) { p = p; MyFree(address); }
-static ISzAlloc g_Alloc = { SzAlloc, SzFree };
-
-static Bool mQuietMode = False;
-static CONVERTER_TYPE mConType = NoConverter;
-
-#define UTILITY_NAME "LzmaCompress"
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 2
-#define INTEL_COPYRIGHT \
- "Copyright (c) 2009-2012, Intel Corporation. All rights reserved."
-void PrintHelp(char *buffer)
-{
- strcat(buffer,
- "\n" UTILITY_NAME " - " INTEL_COPYRIGHT "\n"
- "Based on LZMA Utility " MY_VERSION_COPYRIGHT_DATE "\n"
- "\nUsage: LzmaCompress -e|-d [options] <inputFile>\n"
- " -e: encode file\n"
- " -d: decode file\n"
- " -o FileName, --output FileName: specify the output filename\n"
- " --f86: enable converter for x86 code\n"
- " -v, --verbose: increase output messages\n"
- " -q, --quiet: reduce output messages\n"
- " --debug [0-9]: set debug level\n"
- " --version: display the program version and exit\n"
- " -h, --help: display this help text\n"
- );
-}
-
-int PrintError(char *buffer, const char *message)
-{
- strcat(buffer, "\nError: ");
- strcat(buffer, message);
- strcat(buffer, "\n");
- return 1;
-}
-
-int PrintErrorNumber(char *buffer, SRes val)
-{
- sprintf(buffer + strlen(buffer), "\nError code: %x\n", (unsigned)val);
- return 1;
-}
-
-int PrintUserError(char *buffer)
-{
- return PrintError(buffer, "Incorrect command");
-}
-
-void PrintVersion(char *buffer)
-{
- sprintf (buffer, "%s Version %d.%d %s ", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize)
-{
- SRes res;
- size_t inSize = (size_t)fileSize;
- Byte *inBuffer = 0;
- Byte *outBuffer = 0;
- Byte *filteredStream = 0;
- size_t outSize;
- CLzmaEncProps props;
-
- LzmaEncProps_Init(&props);
- LzmaEncProps_Normalize(&props);
-
- if (inSize != 0) {
- inBuffer = (Byte *)MyAlloc(inSize);
- if (inBuffer == 0)
- return SZ_ERROR_MEM;
- } else {
- return SZ_ERROR_INPUT_EOF;
- }
-
- if (SeqInStream_Read(inStream, inBuffer, inSize) != SZ_OK) {
- res = SZ_ERROR_READ;
- goto Done;
- }
-
- // we allocate 105% of original size + 64KB for output buffer
- outSize = (size_t)fileSize / 20 * 21 + (1 << 16);
- outBuffer = (Byte *)MyAlloc(outSize);
- if (outBuffer == 0) {
- res = SZ_ERROR_MEM;
- goto Done;
- }
-
- {
- int i;
- for (i = 0; i < 8; i++)
- outBuffer[i + LZMA_PROPS_SIZE] = (Byte)(fileSize >> (8 * i));
- }
-
- if (mConType != NoConverter)
- {
- filteredStream = (Byte *)MyAlloc(inSize);
- if (filteredStream == 0) {
- res = SZ_ERROR_MEM;
- goto Done;
- }
- memcpy(filteredStream, inBuffer, inSize);
-
- if (mConType == X86Converter) {
- {
- UInt32 x86State;
- x86_Convert_Init(x86State);
- x86_Convert(filteredStream, (SizeT) inSize, 0, &x86State, 1);
- }
- }
- }
-
- {
- size_t outSizeProcessed = outSize - LZMA_HEADER_SIZE;
- size_t outPropsSize = LZMA_PROPS_SIZE;
-
- res = LzmaEncode(outBuffer + LZMA_HEADER_SIZE, &outSizeProcessed,
- mConType != NoConverter ? filteredStream : inBuffer, inSize,
- &props, outBuffer, &outPropsSize, 0,
- NULL, &g_Alloc, &g_Alloc);
-
- if (res != SZ_OK)
- goto Done;
-
- outSize = LZMA_HEADER_SIZE + outSizeProcessed;
- }
-
- if (outStream->Write(outStream, outBuffer, outSize) != outSize)
- res = SZ_ERROR_WRITE;
-
-Done:
- MyFree(outBuffer);
- MyFree(inBuffer);
- MyFree(filteredStream);
-
- return res;
-}
-
-static SRes Decode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize)
-{
- SRes res;
- size_t inSize = (size_t)fileSize;
- Byte *inBuffer = 0;
- Byte *outBuffer = 0;
- size_t outSize = 0;
- size_t inSizePure;
- ELzmaStatus status;
- UInt64 outSize64 = 0;
-
- int i;
-
- if (inSize < LZMA_HEADER_SIZE)
- return SZ_ERROR_INPUT_EOF;
-
- inBuffer = (Byte *)MyAlloc(inSize);
- if (inBuffer == 0)
- return SZ_ERROR_MEM;
-
- if (SeqInStream_Read(inStream, inBuffer, inSize) != SZ_OK) {
- res = SZ_ERROR_READ;
- goto Done;
- }
-
- for (i = 0; i < 8; i++)
- outSize64 += ((UInt64)inBuffer[LZMA_PROPS_SIZE + i]) << (i * 8);
-
- outSize = (size_t)outSize64;
- if (outSize != 0) {
- outBuffer = (Byte *)MyAlloc(outSize);
- if (outBuffer == 0) {
- res = SZ_ERROR_MEM;
- goto Done;
- }
- } else {
- res = SZ_OK;
- goto Done;
- }
-
- inSizePure = inSize - LZMA_HEADER_SIZE;
- res = LzmaDecode(outBuffer, &outSize, inBuffer + LZMA_HEADER_SIZE, &inSizePure,
- inBuffer, LZMA_PROPS_SIZE, LZMA_FINISH_END, &status, &g_Alloc);
-
- if (res != SZ_OK)
- goto Done;
-
- if (mConType == X86Converter)
- {
- UInt32 x86State;
- x86_Convert_Init(x86State);
- x86_Convert(outBuffer, (SizeT) outSize, 0, &x86State, 0);
- }
-
- if (outStream->Write(outStream, outBuffer, outSize) != outSize)
- res = SZ_ERROR_WRITE;
-
-Done:
- MyFree(outBuffer);
- MyFree(inBuffer);
-
- return res;
-}
-
-int main2(int numArgs, const char *args[], char *rs)
-{
- CFileSeqInStream inStream;
- CFileOutStream outStream;
- int res;
- int encodeMode = 0;
- Bool modeWasSet = False;
- const char *inputFile = NULL;
- const char *outputFile = "file.tmp";
- int param;
- UInt64 fileSize;
-
- FileSeqInStream_CreateVTable(&inStream);
- File_Construct(&inStream.file);
-
- FileOutStream_CreateVTable(&outStream);
- File_Construct(&outStream.file);
-
- if (numArgs == 1)
- {
- PrintHelp(rs);
- return 0;
- }
-
- for (param = 1; param < numArgs; param++) {
- if (strcmp(args[param], "-e") == 0 || strcmp(args[param], "-d") == 0) {
- encodeMode = (args[param][1] == 'e');
- modeWasSet = True;
- } else if (strcmp(args[param], "--f86") == 0) {
- mConType = X86Converter;
- } else if (strcmp(args[param], "-o") == 0 ||
- strcmp(args[param], "--output") == 0) {
- if (numArgs < (param + 2)) {
- return PrintUserError(rs);
- }
- outputFile = args[++param];
- } else if (strcmp(args[param], "--debug") == 0) {
- if (numArgs < (param + 2)) {
- return PrintUserError(rs);
- }
- //
- // For now we silently ignore this parameter to achieve command line
- // parameter compatibility with other build tools.
- //
- param++;
- } else if (
- strcmp(args[param], "-h") == 0 ||
- strcmp(args[param], "--help") == 0
- ) {
- PrintHelp(rs);
- return 0;
- } else if (
- strcmp(args[param], "-v") == 0 ||
- strcmp(args[param], "--verbose") == 0
- ) {
- //
- // For now we silently ignore this parameter to achieve command line
- // parameter compatibility with other build tools.
- //
- } else if (
- strcmp(args[param], "-q") == 0 ||
- strcmp(args[param], "--quiet") == 0
- ) {
- mQuietMode = True;
- } else if (strcmp(args[param], "--version") == 0) {
- PrintVersion(rs);
- return 0;
- } else if (inputFile == NULL) {
- inputFile = args[param];
- } else {
- return PrintUserError(rs);
- }
- }
-
- if ((inputFile == NULL) || !modeWasSet) {
- return PrintUserError(rs);
- }
-
- {
- size_t t4 = sizeof(UInt32);
- size_t t8 = sizeof(UInt64);
- if (t4 != 4 || t8 != 8)
- return PrintError(rs, "Incorrect UInt32 or UInt64");
- }
-
- if (InFile_Open(&inStream.file, inputFile) != 0)
- return PrintError(rs, "Can not open input file");
-
- if (OutFile_Open(&outStream.file, outputFile) != 0)
- return PrintError(rs, "Can not open output file");
-
- File_GetLength(&inStream.file, &fileSize);
-
- if (encodeMode)
- {
- if (!mQuietMode) {
- printf("Encoding\n");
- }
- res = Encode(&outStream.s, &inStream.s, fileSize);
- }
- else
- {
- if (!mQuietMode) {
- printf("Decoding\n");
- }
- res = Decode(&outStream.s, &inStream.s, fileSize);
- }
-
- File_Close(&outStream.file);
- File_Close(&inStream.file);
-
- if (res != SZ_OK)
- {
- if (res == SZ_ERROR_MEM)
- return PrintError(rs, kCantAllocateMessage);
- else if (res == SZ_ERROR_DATA)
- return PrintError(rs, kDataErrorMessage);
- else if (res == SZ_ERROR_WRITE)
- return PrintError(rs, kCantWriteMessage);
- else if (res == SZ_ERROR_READ)
- return PrintError(rs, kCantReadMessage);
- return PrintErrorNumber(rs, res);
- }
- return 0;
-}
-
-int MY_CDECL main(int numArgs, const char *args[])
-{
- char rs[2000] = { 0 };
- int res = main2(numArgs, args, rs);
- if (strlen(rs) > 0) {
- puts(rs);
- }
- return res;
-}
diff --git a/BaseTools/Source/C/LzmaCompress/LzmaF86Compress.bat b/BaseTools/Source/C/LzmaCompress/LzmaF86Compress.bat
deleted file mode 100644
index 77749dfd16..0000000000
--- a/BaseTools/Source/C/LzmaCompress/LzmaF86Compress.bat
+++ /dev/null
@@ -1,31 +0,0 @@
-@REM
-@REM This script will exec LzmaCompress tool with --f86 option that enables converter for x86 code.
-@REM
-@REM Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
-@REM This program and the accompanying materials
-@REM are licensed and made available under the terms and conditions of the BSD License
-@REM which accompanies this distribution. The full text of the license may be found at
-@REM http://opensource.org/licenses/bsd-license.php
-@REM
-@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-@REM
-
-@echo off
-@setlocal
-
-:Begin
-if "%1"=="" goto End
-if "%1"=="-e" (
- set FLAG=--f86
-)
-if "%1"=="-d" (
- set FLAG=--f86
-)
-set ARGS=%ARGS% %1
-shift
-goto Begin
-
-:End
-LzmaCompress %ARGS% %FLAG%
-@echo on
diff --git a/BaseTools/Source/C/LzmaCompress/Makefile b/BaseTools/Source/C/LzmaCompress/Makefile
deleted file mode 100644
index 872e899512..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-## @file
-# Windows makefile for 'LzmaCompress' module build.
-#
-# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = LzmaCompress
-
-#LIBS = $(LIB_PATH)\Common.lib
-
-SDK_C = Sdk\C
-
-OBJECTS = \
- LzmaCompress.obj \
- $(SDK_C)\Alloc.obj \
- $(SDK_C)\LzFind.obj \
- $(SDK_C)\LzmaDec.obj \
- $(SDK_C)\LzmaEnc.obj \
- $(SDK_C)\7zFile.obj \
- $(SDK_C)\7zStream.obj \
- $(SDK_C)\Bra86.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
-all: $(BIN_PATH)\LzmaF86Compress.bat
-
-$(BIN_PATH)\LzmaF86Compress.bat: LzmaF86Compress.bat
- copy LzmaF86Compress.bat $(BIN_PATH)\LzmaF86Compress.bat /Y
-
-cleanall: localCleanall
-
-localCleanall:
- del /f /q $(BIN_PATH)\LzmaF86Compress.bat > nul
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/7zFile.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/7zFile.c
deleted file mode 100644
index 2b605a5665..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/7zFile.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/* 7zFile.c -- File IO
-2008-11-22 : Igor Pavlov : Public domain */
-
-#include "7zFile.h"
-
-#ifndef USE_WINDOWS_FILE
-
-#include <errno.h>
-
-#endif
-
-#ifdef USE_WINDOWS_FILE
-
-/*
- ReadFile and WriteFile functions in Windows have BUG:
- If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1)
- from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES
- (Insufficient system resources exist to complete the requested service).
- Probably in some version of Windows there are problems with other sizes:
- for 32 MB (maybe also for 16 MB).
- And message can be "Network connection was lost"
-*/
-
-#define kChunkSizeMax (1 << 22)
-
-#endif
-
-void File_Construct(CSzFile *p)
-{
- #ifdef USE_WINDOWS_FILE
- p->handle = INVALID_HANDLE_VALUE;
- #else
- p->file = NULL;
- #endif
-}
-
-static WRes File_Open(CSzFile *p, const char *name, int writeMode)
-{
- #ifdef USE_WINDOWS_FILE
- p->handle = CreateFileA(name,
- writeMode ? GENERIC_WRITE : GENERIC_READ,
- FILE_SHARE_READ, NULL,
- writeMode ? CREATE_ALWAYS : OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL, NULL);
- return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();
- #else
- p->file = fopen(name, writeMode ? "wb+" : "rb");
- return (p->file != 0) ? 0 : errno;
- #endif
-}
-
-WRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); }
-WRes OutFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 1); }
-
-WRes File_Close(CSzFile *p)
-{
- #ifdef USE_WINDOWS_FILE
- if (p->handle != INVALID_HANDLE_VALUE)
- {
- if (!CloseHandle(p->handle))
- return GetLastError();
- p->handle = INVALID_HANDLE_VALUE;
- }
- #else
- if (p->file != NULL)
- {
- int res = fclose(p->file);
- if (res != 0)
- return res;
- p->file = NULL;
- }
- #endif
- return 0;
-}
-
-WRes File_Read(CSzFile *p, void *data, size_t *size)
-{
- size_t originalSize = *size;
- if (originalSize == 0)
- return 0;
-
- #ifdef USE_WINDOWS_FILE
-
- *size = 0;
- do
- {
- DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;
- DWORD processed = 0;
- BOOL res = ReadFile(p->handle, data, curSize, &processed, NULL);
- data = (void *)((Byte *)data + processed);
- originalSize -= processed;
- *size += processed;
- if (!res)
- return GetLastError();
- if (processed == 0)
- break;
- }
- while (originalSize > 0);
- return 0;
-
- #else
-
- *size = fread(data, 1, originalSize, p->file);
- if (*size == originalSize)
- return 0;
- return ferror(p->file);
-
- #endif
-}
-
-WRes File_Write(CSzFile *p, const void *data, size_t *size)
-{
- size_t originalSize = *size;
- if (originalSize == 0)
- return 0;
-
- #ifdef USE_WINDOWS_FILE
-
- *size = 0;
- do
- {
- DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;
- DWORD processed = 0;
- BOOL res = WriteFile(p->handle, data, curSize, &processed, NULL);
- data = (void *)((Byte *)data + processed);
- originalSize -= processed;
- *size += processed;
- if (!res)
- return GetLastError();
- if (processed == 0)
- break;
- }
- while (originalSize > 0);
- return 0;
-
- #else
-
- *size = fwrite(data, 1, originalSize, p->file);
- if (*size == originalSize)
- return 0;
- return ferror(p->file);
-
- #endif
-}
-
-WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
-{
- #ifdef USE_WINDOWS_FILE
-
- LARGE_INTEGER value;
- DWORD moveMethod;
- value.LowPart = (DWORD)*pos;
- value.HighPart = (LONG)((UInt64)*pos >> 16 >> 16); /* for case when UInt64 is 32-bit only */
- switch (origin)
- {
- case SZ_SEEK_SET: moveMethod = FILE_BEGIN; break;
- case SZ_SEEK_CUR: moveMethod = FILE_CURRENT; break;
- case SZ_SEEK_END: moveMethod = FILE_END; break;
- default: return ERROR_INVALID_PARAMETER;
- }
- value.LowPart = SetFilePointer(p->handle, value.LowPart, &value.HighPart, moveMethod);
- if (value.LowPart == 0xFFFFFFFF)
- {
- WRes res = GetLastError();
- if (res != NO_ERROR)
- return res;
- }
- *pos = ((Int64)value.HighPart << 32) | value.LowPart;
- return 0;
-
- #else
-
- int moveMethod;
- int res;
- switch (origin)
- {
- case SZ_SEEK_SET: moveMethod = SEEK_SET; break;
- case SZ_SEEK_CUR: moveMethod = SEEK_CUR; break;
- case SZ_SEEK_END: moveMethod = SEEK_END; break;
- default: return 1;
- }
- res = fseek(p->file, (long)*pos, moveMethod);
- *pos = ftell(p->file);
- return res;
-
- #endif
-}
-
-WRes File_GetLength(CSzFile *p, UInt64 *length)
-{
- #ifdef USE_WINDOWS_FILE
-
- DWORD sizeHigh;
- DWORD sizeLow = GetFileSize(p->handle, &sizeHigh);
- if (sizeLow == 0xFFFFFFFF)
- {
- DWORD res = GetLastError();
- if (res != NO_ERROR)
- return res;
- }
- *length = (((UInt64)sizeHigh) << 32) + sizeLow;
- return 0;
-
- #else
-
- long pos = ftell(p->file);
- int res = fseek(p->file, 0, SEEK_END);
- *length = ftell(p->file);
- fseek(p->file, pos, SEEK_SET);
- return res;
-
- #endif
-}
-
-
-/* ---------- FileSeqInStream ---------- */
-
-static SRes FileSeqInStream_Read(void *pp, void *buf, size_t *size)
-{
- CFileSeqInStream *p = (CFileSeqInStream *)pp;
- return File_Read(&p->file, buf, size) == 0 ? SZ_OK : SZ_ERROR_READ;
-}
-
-void FileSeqInStream_CreateVTable(CFileSeqInStream *p)
-{
- p->s.Read = FileSeqInStream_Read;
-}
-
-
-/* ---------- FileInStream ---------- */
-
-static SRes FileInStream_Read(void *pp, void *buf, size_t *size)
-{
- CFileInStream *p = (CFileInStream *)pp;
- return (File_Read(&p->file, buf, size) == 0) ? SZ_OK : SZ_ERROR_READ;
-}
-
-static SRes FileInStream_Seek(void *pp, Int64 *pos, ESzSeek origin)
-{
- CFileInStream *p = (CFileInStream *)pp;
- return File_Seek(&p->file, pos, origin);
-}
-
-void FileInStream_CreateVTable(CFileInStream *p)
-{
- p->s.Read = FileInStream_Read;
- p->s.Seek = FileInStream_Seek;
-}
-
-
-/* ---------- FileOutStream ---------- */
-
-static size_t FileOutStream_Write(void *pp, const void *data, size_t size)
-{
- CFileOutStream *p = (CFileOutStream *)pp;
- File_Write(&p->file, data, &size);
- return size;
-}
-
-void FileOutStream_CreateVTable(CFileOutStream *p)
-{
- p->s.Write = FileOutStream_Write;
-}
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/7zFile.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/7zFile.h
deleted file mode 100644
index 4fd2936cc3..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/7zFile.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* 7zFile.h -- File IO
-2008-11-22 : Igor Pavlov : Public domain */
-
-#ifndef __7Z_FILE_H
-#define __7Z_FILE_H
-
-#ifdef _WIN32
-#define USE_WINDOWS_FILE
-#endif
-
-#ifdef USE_WINDOWS_FILE
-#include <windows.h>
-#else
-#include <stdio.h>
-#endif
-
-#include "Types.h"
-
-
-/* ---------- File ---------- */
-
-typedef struct
-{
- #ifdef USE_WINDOWS_FILE
- HANDLE handle;
- #else
- FILE *file;
- #endif
-} CSzFile;
-
-void File_Construct(CSzFile *p);
-WRes InFile_Open(CSzFile *p, const char *name);
-WRes OutFile_Open(CSzFile *p, const char *name);
-WRes File_Close(CSzFile *p);
-
-/* reads max(*size, remain file's size) bytes */
-WRes File_Read(CSzFile *p, void *data, size_t *size);
-
-/* writes *size bytes */
-WRes File_Write(CSzFile *p, const void *data, size_t *size);
-
-WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
-WRes File_GetLength(CSzFile *p, UInt64 *length);
-
-
-/* ---------- FileInStream ---------- */
-
-typedef struct
-{
- ISeqInStream s;
- CSzFile file;
-} CFileSeqInStream;
-
-void FileSeqInStream_CreateVTable(CFileSeqInStream *p);
-
-
-typedef struct
-{
- ISeekInStream s;
- CSzFile file;
-} CFileInStream;
-
-void FileInStream_CreateVTable(CFileInStream *p);
-
-
-typedef struct
-{
- ISeqOutStream s;
- CSzFile file;
-} CFileOutStream;
-
-void FileOutStream_CreateVTable(CFileOutStream *p);
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/7zStream.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/7zStream.c
deleted file mode 100644
index a0a2405d01..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/7zStream.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/* 7zStream.c -- 7z Stream functions
-2008-11-23 : Igor Pavlov : Public domain */
-
-#include <string.h>
-
-#include "Types.h"
-
-SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType)
-{
- while (size != 0)
- {
- size_t processed = size;
- RINOK(stream->Read(stream, buf, &processed));
- if (processed == 0)
- return errorType;
- buf = (void *)((Byte *)buf + processed);
- size -= processed;
- }
- return SZ_OK;
-}
-
-SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size)
-{
- return SeqInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
-}
-
-SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf)
-{
- size_t processed = 1;
- RINOK(stream->Read(stream, buf, &processed));
- return (processed == 1) ? SZ_OK : SZ_ERROR_INPUT_EOF;
-}
-
-SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset)
-{
- Int64 t = offset;
- return stream->Seek(stream, &t, SZ_SEEK_SET);
-}
-
-SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size)
-{
- void *lookBuf;
- if (*size == 0)
- return SZ_OK;
- RINOK(stream->Look(stream, &lookBuf, size));
- memcpy(buf, lookBuf, *size);
- return stream->Skip(stream, *size);
-}
-
-SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType)
-{
- while (size != 0)
- {
- size_t processed = size;
- RINOK(stream->Read(stream, buf, &processed));
- if (processed == 0)
- return errorType;
- buf = (void *)((Byte *)buf + processed);
- size -= processed;
- }
- return SZ_OK;
-}
-
-SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size)
-{
- return LookInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
-}
-
-static SRes LookToRead_Look_Lookahead(void *pp, void **buf, size_t *size)
-{
- SRes res = SZ_OK;
- CLookToRead *p = (CLookToRead *)pp;
- size_t size2 = p->size - p->pos;
- if (size2 == 0 && *size > 0)
- {
- p->pos = 0;
- size2 = LookToRead_BUF_SIZE;
- res = p->realStream->Read(p->realStream, p->buf, &size2);
- p->size = size2;
- }
- if (size2 < *size)
- *size = size2;
- *buf = p->buf + p->pos;
- return res;
-}
-
-static SRes LookToRead_Look_Exact(void *pp, void **buf, size_t *size)
-{
- SRes res = SZ_OK;
- CLookToRead *p = (CLookToRead *)pp;
- size_t size2 = p->size - p->pos;
- if (size2 == 0 && *size > 0)
- {
- p->pos = 0;
- if (*size > LookToRead_BUF_SIZE)
- *size = LookToRead_BUF_SIZE;
- res = p->realStream->Read(p->realStream, p->buf, size);
- size2 = p->size = *size;
- }
- if (size2 < *size)
- *size = size2;
- *buf = p->buf + p->pos;
- return res;
-}
-
-static SRes LookToRead_Skip(void *pp, size_t offset)
-{
- CLookToRead *p = (CLookToRead *)pp;
- p->pos += offset;
- return SZ_OK;
-}
-
-static SRes LookToRead_Read(void *pp, void *buf, size_t *size)
-{
- CLookToRead *p = (CLookToRead *)pp;
- size_t rem = p->size - p->pos;
- if (rem == 0)
- return p->realStream->Read(p->realStream, buf, size);
- if (rem > *size)
- rem = *size;
- memcpy(buf, p->buf + p->pos, rem);
- p->pos += rem;
- *size = rem;
- return SZ_OK;
-}
-
-static SRes LookToRead_Seek(void *pp, Int64 *pos, ESzSeek origin)
-{
- CLookToRead *p = (CLookToRead *)pp;
- p->pos = p->size = 0;
- return p->realStream->Seek(p->realStream, pos, origin);
-}
-
-void LookToRead_CreateVTable(CLookToRead *p, int lookahead)
-{
- p->s.Look = lookahead ?
- LookToRead_Look_Lookahead :
- LookToRead_Look_Exact;
- p->s.Skip = LookToRead_Skip;
- p->s.Read = LookToRead_Read;
- p->s.Seek = LookToRead_Seek;
-}
-
-void LookToRead_Init(CLookToRead *p)
-{
- p->pos = p->size = 0;
-}
-
-static SRes SecToLook_Read(void *pp, void *buf, size_t *size)
-{
- CSecToLook *p = (CSecToLook *)pp;
- return LookInStream_LookRead(p->realStream, buf, size);
-}
-
-void SecToLook_CreateVTable(CSecToLook *p)
-{
- p->s.Read = SecToLook_Read;
-}
-
-static SRes SecToRead_Read(void *pp, void *buf, size_t *size)
-{
- CSecToRead *p = (CSecToRead *)pp;
- return p->realStream->Read(p->realStream, buf, size);
-}
-
-void SecToRead_CreateVTable(CSecToRead *p)
-{
- p->s.Read = SecToRead_Read;
-}
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/7zVersion.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/7zVersion.h
deleted file mode 100644
index 5a6bcadac6..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/7zVersion.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#define MY_VER_MAJOR 4
-#define MY_VER_MINOR 65
-#define MY_VER_BUILD 0
-#define MY_VERSION "4.65"
-#define MY_DATE "2009-02-03"
-#define MY_COPYRIGHT ": Igor Pavlov : Public domain"
-#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/Alloc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/Alloc.c
deleted file mode 100644
index bb24a772b3..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/Alloc.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Alloc.c -- Memory allocation functions
-2008-09-24
-Igor Pavlov
-Public domain */
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
-#include <stdlib.h>
-
-#include "Alloc.h"
-
-/* #define _SZ_ALLOC_DEBUG */
-
-/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
-#ifdef _SZ_ALLOC_DEBUG
-#include <stdio.h>
-int g_allocCount = 0;
-int g_allocCountMid = 0;
-int g_allocCountBig = 0;
-#endif
-
-void *MyAlloc(size_t size)
-{
- if (size == 0)
- return 0;
- #ifdef _SZ_ALLOC_DEBUG
- {
- void *p = malloc(size);
- fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p);
- return p;
- }
- #else
- return malloc(size);
- #endif
-}
-
-void MyFree(void *address)
-{
- #ifdef _SZ_ALLOC_DEBUG
- if (address != 0)
- fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address);
- #endif
- free(address);
-}
-
-#ifdef _WIN32
-
-void *MidAlloc(size_t size)
-{
- if (size == 0)
- return 0;
- #ifdef _SZ_ALLOC_DEBUG
- fprintf(stderr, "\nAlloc_Mid %10d bytes; count = %10d", size, g_allocCountMid++);
- #endif
- return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
-}
-
-void MidFree(void *address)
-{
- #ifdef _SZ_ALLOC_DEBUG
- if (address != 0)
- fprintf(stderr, "\nFree_Mid; count = %10d", --g_allocCountMid);
- #endif
- if (address == 0)
- return;
- VirtualFree(address, 0, MEM_RELEASE);
-}
-
-#ifndef MEM_LARGE_PAGES
-#undef _7ZIP_LARGE_PAGES
-#endif
-
-#ifdef _7ZIP_LARGE_PAGES
-SIZE_T g_LargePageSize = 0;
-typedef SIZE_T (WINAPI *GetLargePageMinimumP)();
-#endif
-
-void SetLargePageSize()
-{
- #ifdef _7ZIP_LARGE_PAGES
- SIZE_T size = 0;
- GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP)
- GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum");
- if (largePageMinimum == 0)
- return;
- size = largePageMinimum();
- if (size == 0 || (size & (size - 1)) != 0)
- return;
- g_LargePageSize = size;
- #endif
-}
-
-
-void *BigAlloc(size_t size)
-{
- if (size == 0)
- return 0;
- #ifdef _SZ_ALLOC_DEBUG
- fprintf(stderr, "\nAlloc_Big %10d bytes; count = %10d", size, g_allocCountBig++);
- #endif
-
- #ifdef _7ZIP_LARGE_PAGES
- if (g_LargePageSize != 0 && g_LargePageSize <= (1 << 30) && size >= (1 << 18))
- {
- void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),
- MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);
- if (res != 0)
- return res;
- }
- #endif
- return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
-}
-
-void BigFree(void *address)
-{
- #ifdef _SZ_ALLOC_DEBUG
- if (address != 0)
- fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig);
- #endif
-
- if (address == 0)
- return;
- VirtualFree(address, 0, MEM_RELEASE);
-}
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/Alloc.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/Alloc.h
deleted file mode 100644
index a396c6b9e1..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/Alloc.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Alloc.h -- Memory allocation functions
-2008-03-13
-Igor Pavlov
-Public domain */
-
-#ifndef __COMMON_ALLOC_H
-#define __COMMON_ALLOC_H
-
-#include <stddef.h>
-
-void *MyAlloc(size_t size);
-void MyFree(void *address);
-
-#ifdef _WIN32
-
-void SetLargePageSize();
-
-void *MidAlloc(size_t size);
-void MidFree(void *address);
-void *BigAlloc(size_t size);
-void BigFree(void *address);
-
-#else
-
-#define MidAlloc(size) MyAlloc(size)
-#define MidFree(address) MyFree(address)
-#define BigAlloc(size) MyAlloc(size)
-#define BigFree(address) MyFree(address)
-
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/Bra.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/Bra.h
deleted file mode 100644
index b9018eb991..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/Bra.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Bra.h -- Branch converters for executables
-2008-10-04 : Igor Pavlov : Public domain */
-
-#ifndef __BRA_H
-#define __BRA_H
-
-#include "Types.h"
-
-/*
-These functions convert relative addresses to absolute addresses
-in CALL instructions to increase the compression ratio.
-
- In:
- data - data buffer
- size - size of data
- ip - current virtual Instruction Pinter (IP) value
- state - state variable for x86 converter
- encoding - 0 (for decoding), 1 (for encoding)
-
- Out:
- state - state variable for x86 converter
-
- Returns:
- The number of processed bytes. If you call these functions with multiple calls,
- you must start next call with first byte after block of processed bytes.
-
- Type Endian Alignment LookAhead
-
- x86 little 1 4
- ARMT little 2 2
- ARM little 4 0
- PPC big 4 0
- SPARC big 4 0
- IA64 little 16 0
-
- size must be >= Alignment + LookAhead, if it's not last block.
- If (size < Alignment + LookAhead), converter returns 0.
-
- Example:
-
- UInt32 ip = 0;
- for ()
- {
- ; size must be >= Alignment + LookAhead, if it's not last block
- SizeT processed = Convert(data, size, ip, 1);
- data += processed;
- size -= processed;
- ip += processed;
- }
-*/
-
-#define x86_Convert_Init(state) { state = 0; }
-SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding);
-SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
-SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
-SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
-SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
-SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/Bra86.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/Bra86.c
deleted file mode 100644
index 93566cb212..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/Bra86.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Bra86.c -- Converter for x86 code (BCJ)
-2008-10-04 : Igor Pavlov : Public domain */
-
-#include "Bra.h"
-
-#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
-
-const Byte kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0};
-const Byte kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3};
-
-SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding)
-{
- SizeT bufferPos = 0, prevPosT;
- UInt32 prevMask = *state & 0x7;
- if (size < 5)
- return 0;
- ip += 5;
- prevPosT = (SizeT)0 - 1;
-
- for (;;)
- {
- Byte *p = data + bufferPos;
- Byte *limit = data + size - 4;
- for (; p < limit; p++)
- if ((*p & 0xFE) == 0xE8)
- break;
- bufferPos = (SizeT)(p - data);
- if (p >= limit)
- break;
- prevPosT = bufferPos - prevPosT;
- if (prevPosT > 3)
- prevMask = 0;
- else
- {
- prevMask = (prevMask << ((int)prevPosT - 1)) & 0x7;
- if (prevMask != 0)
- {
- Byte b = p[4 - kMaskToBitNumber[prevMask]];
- if (!kMaskToAllowedStatus[prevMask] || Test86MSByte(b))
- {
- prevPosT = bufferPos;
- prevMask = ((prevMask << 1) & 0x7) | 1;
- bufferPos++;
- continue;
- }
- }
- }
- prevPosT = bufferPos;
-
- if (Test86MSByte(p[4]))
- {
- UInt32 src = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]);
- UInt32 dest;
- for (;;)
- {
- Byte b;
- int index;
- if (encoding)
- dest = (ip + (UInt32)bufferPos) + src;
- else
- dest = src - (ip + (UInt32)bufferPos);
- if (prevMask == 0)
- break;
- index = kMaskToBitNumber[prevMask] * 8;
- b = (Byte)(dest >> (24 - index));
- if (!Test86MSByte(b))
- break;
- src = dest ^ ((1 << (32 - index)) - 1);
- }
- p[4] = (Byte)(~(((dest >> 24) & 1) - 1));
- p[3] = (Byte)(dest >> 16);
- p[2] = (Byte)(dest >> 8);
- p[1] = (Byte)dest;
- bufferPos += 5;
- }
- else
- {
- prevMask = ((prevMask << 1) & 0x7) | 1;
- bufferPos++;
- }
- }
- prevPosT = bufferPos - prevPosT;
- *state = ((prevPosT > 3) ? 0 : ((prevMask << ((int)prevPosT - 1)) & 0x7));
- return bufferPos;
-}
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/CpuArch.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/CpuArch.h
deleted file mode 100644
index 006361f2f2..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/CpuArch.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* CpuArch.h
-2008-08-05
-Igor Pavlov
-Public domain */
-
-#ifndef __CPUARCH_H
-#define __CPUARCH_H
-
-/*
-LITTLE_ENDIAN_UNALIGN means:
- 1) CPU is LITTLE_ENDIAN
- 2) it's allowed to make unaligned memory accesses
-if LITTLE_ENDIAN_UNALIGN is not defined, it means that we don't know
-about these properties of platform.
-*/
-
-#if defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64) || defined(__i386__) || defined(__x86_64__)
-#define LITTLE_ENDIAN_UNALIGN
-#endif
-
-#ifdef LITTLE_ENDIAN_UNALIGN
-
-#define GetUi16(p) (*(const UInt16 *)(p))
-#define GetUi32(p) (*(const UInt32 *)(p))
-#define GetUi64(p) (*(const UInt64 *)(p))
-#define SetUi32(p, d) *(UInt32 *)(p) = (d);
-
-#else
-
-#define GetUi16(p) (((const Byte *)(p))[0] | ((UInt16)((const Byte *)(p))[1] << 8))
-
-#define GetUi32(p) ( \
- ((const Byte *)(p))[0] | \
- ((UInt32)((const Byte *)(p))[1] << 8) | \
- ((UInt32)((const Byte *)(p))[2] << 16) | \
- ((UInt32)((const Byte *)(p))[3] << 24))
-
-#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32))
-
-#define SetUi32(p, d) { UInt32 _x_ = (d); \
- ((Byte *)(p))[0] = (Byte)_x_; \
- ((Byte *)(p))[1] = (Byte)(_x_ >> 8); \
- ((Byte *)(p))[2] = (Byte)(_x_ >> 16); \
- ((Byte *)(p))[3] = (Byte)(_x_ >> 24); }
-
-#endif
-
-#if defined(LITTLE_ENDIAN_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300)
-
-#pragma intrinsic(_byteswap_ulong)
-#pragma intrinsic(_byteswap_uint64)
-#define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p))
-#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p))
-
-#else
-
-#define GetBe32(p) ( \
- ((UInt32)((const Byte *)(p))[0] << 24) | \
- ((UInt32)((const Byte *)(p))[1] << 16) | \
- ((UInt32)((const Byte *)(p))[2] << 8) | \
- ((const Byte *)(p))[3] )
-
-#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4))
-
-#endif
-
-#define GetBe16(p) (((UInt16)((const Byte *)(p))[0] << 8) | ((const Byte *)(p))[1])
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFind.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFind.c
deleted file mode 100644
index e0ebe62356..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFind.c
+++ /dev/null
@@ -1,751 +0,0 @@
-/* LzFind.c -- Match finder for LZ algorithms
-2008-10-04 : Igor Pavlov : Public domain */
-
-#include <string.h>
-
-#include "LzFind.h"
-#include "LzHash.h"
-
-#define kEmptyHashValue 0
-#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)
-#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */
-#define kNormalizeMask (~(kNormalizeStepMin - 1))
-#define kMaxHistorySize ((UInt32)3 << 30)
-
-#define kStartMaxLen 3
-
-static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc)
-{
- if (!p->directInput)
- {
- alloc->Free(alloc, p->bufferBase);
- p->bufferBase = 0;
- }
-}
-
-/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */
-
-static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc)
-{
- UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
- if (p->directInput)
- {
- p->blockSize = blockSize;
- return 1;
- }
- if (p->bufferBase == 0 || p->blockSize != blockSize)
- {
- LzInWindow_Free(p, alloc);
- p->blockSize = blockSize;
- p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize);
- }
- return (p->bufferBase != 0);
-}
-
-Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }
-Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; }
-
-UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
-
-void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)
-{
- p->posLimit -= subValue;
- p->pos -= subValue;
- p->streamPos -= subValue;
-}
-
-static void MatchFinder_ReadBlock(CMatchFinder *p)
-{
- if (p->streamEndWasReached || p->result != SZ_OK)
- return;
- for (;;)
- {
- Byte *dest = p->buffer + (p->streamPos - p->pos);
- size_t size = (p->bufferBase + p->blockSize - dest);
- if (size == 0)
- return;
- p->result = p->stream->Read(p->stream, dest, &size);
- if (p->result != SZ_OK)
- return;
- if (size == 0)
- {
- p->streamEndWasReached = 1;
- return;
- }
- p->streamPos += (UInt32)size;
- if (p->streamPos - p->pos > p->keepSizeAfter)
- return;
- }
-}
-
-void MatchFinder_MoveBlock(CMatchFinder *p)
-{
- memmove(p->bufferBase,
- p->buffer - p->keepSizeBefore,
- (size_t)(p->streamPos - p->pos + p->keepSizeBefore));
- p->buffer = p->bufferBase + p->keepSizeBefore;
-}
-
-int MatchFinder_NeedMove(CMatchFinder *p)
-{
- /* if (p->streamEndWasReached) return 0; */
- return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter);
-}
-
-void MatchFinder_ReadIfRequired(CMatchFinder *p)
-{
- if (p->streamEndWasReached)
- return;
- if (p->keepSizeAfter >= p->streamPos - p->pos)
- MatchFinder_ReadBlock(p);
-}
-
-static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p)
-{
- if (MatchFinder_NeedMove(p))
- MatchFinder_MoveBlock(p);
- MatchFinder_ReadBlock(p);
-}
-
-static void MatchFinder_SetDefaultSettings(CMatchFinder *p)
-{
- p->cutValue = 32;
- p->btMode = 1;
- p->numHashBytes = 4;
- /* p->skipModeBits = 0; */
- p->directInput = 0;
- p->bigHash = 0;
-}
-
-#define kCrcPoly 0xEDB88320
-
-void MatchFinder_Construct(CMatchFinder *p)
-{
- UInt32 i;
- p->bufferBase = 0;
- p->directInput = 0;
- p->hash = 0;
- MatchFinder_SetDefaultSettings(p);
-
- for (i = 0; i < 256; i++)
- {
- UInt32 r = i;
- int j;
- for (j = 0; j < 8; j++)
- r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
- p->crc[i] = r;
- }
-}
-
-static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc)
-{
- alloc->Free(alloc, p->hash);
- p->hash = 0;
-}
-
-void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc)
-{
- MatchFinder_FreeThisClassMemory(p, alloc);
- LzInWindow_Free(p, alloc);
-}
-
-static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc)
-{
- size_t sizeInBytes = (size_t)num * sizeof(CLzRef);
- if (sizeInBytes / sizeof(CLzRef) != num)
- return 0;
- return (CLzRef *)alloc->Alloc(alloc, sizeInBytes);
-}
-
-int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
- UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
- ISzAlloc *alloc)
-{
- UInt32 sizeReserv;
- if (historySize > kMaxHistorySize)
- {
- MatchFinder_Free(p, alloc);
- return 0;
- }
- sizeReserv = historySize >> 1;
- if (historySize > ((UInt32)2 << 30))
- sizeReserv = historySize >> 2;
- sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);
-
- p->keepSizeBefore = historySize + keepAddBufferBefore + 1;
- p->keepSizeAfter = matchMaxLen + keepAddBufferAfter;
- /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */
- if (LzInWindow_Create(p, sizeReserv, alloc))
- {
- UInt32 newCyclicBufferSize = (historySize /* >> p->skipModeBits */) + 1;
- UInt32 hs;
- p->matchMaxLen = matchMaxLen;
- {
- p->fixedHashSize = 0;
- if (p->numHashBytes == 2)
- hs = (1 << 16) - 1;
- else
- {
- hs = historySize - 1;
- hs |= (hs >> 1);
- hs |= (hs >> 2);
- hs |= (hs >> 4);
- hs |= (hs >> 8);
- hs >>= 1;
- /* hs >>= p->skipModeBits; */
- hs |= 0xFFFF; /* don't change it! It's required for Deflate */
- if (hs > (1 << 24))
- {
- if (p->numHashBytes == 3)
- hs = (1 << 24) - 1;
- else
- hs >>= 1;
- }
- }
- p->hashMask = hs;
- hs++;
- if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size;
- if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size;
- if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size;
- hs += p->fixedHashSize;
- }
-
- {
- UInt32 prevSize = p->hashSizeSum + p->numSons;
- UInt32 newSize;
- p->historySize = historySize;
- p->hashSizeSum = hs;
- p->cyclicBufferSize = newCyclicBufferSize;
- p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize);
- newSize = p->hashSizeSum + p->numSons;
- if (p->hash != 0 && prevSize == newSize)
- return 1;
- MatchFinder_FreeThisClassMemory(p, alloc);
- p->hash = AllocRefs(newSize, alloc);
- if (p->hash != 0)
- {
- p->son = p->hash + p->hashSizeSum;
- return 1;
- }
- }
- }
- MatchFinder_Free(p, alloc);
- return 0;
-}
-
-static void MatchFinder_SetLimits(CMatchFinder *p)
-{
- UInt32 limit = kMaxValForNormalize - p->pos;
- UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
- if (limit2 < limit)
- limit = limit2;
- limit2 = p->streamPos - p->pos;
- if (limit2 <= p->keepSizeAfter)
- {
- if (limit2 > 0)
- limit2 = 1;
- }
- else
- limit2 -= p->keepSizeAfter;
- if (limit2 < limit)
- limit = limit2;
- {
- UInt32 lenLimit = p->streamPos - p->pos;
- if (lenLimit > p->matchMaxLen)
- lenLimit = p->matchMaxLen;
- p->lenLimit = lenLimit;
- }
- p->posLimit = p->pos + limit;
-}
-
-void MatchFinder_Init(CMatchFinder *p)
-{
- UInt32 i;
- for (i = 0; i < p->hashSizeSum; i++)
- p->hash[i] = kEmptyHashValue;
- p->cyclicBufferPos = 0;
- p->buffer = p->bufferBase;
- p->pos = p->streamPos = p->cyclicBufferSize;
- p->result = SZ_OK;
- p->streamEndWasReached = 0;
- MatchFinder_ReadBlock(p);
- MatchFinder_SetLimits(p);
-}
-
-static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)
-{
- return (p->pos - p->historySize - 1) & kNormalizeMask;
-}
-
-void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems)
-{
- UInt32 i;
- for (i = 0; i < numItems; i++)
- {
- UInt32 value = items[i];
- if (value <= subValue)
- value = kEmptyHashValue;
- else
- value -= subValue;
- items[i] = value;
- }
-}
-
-static void MatchFinder_Normalize(CMatchFinder *p)
-{
- UInt32 subValue = MatchFinder_GetSubValue(p);
- MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons);
- MatchFinder_ReduceOffsets(p, subValue);
-}
-
-static void MatchFinder_CheckLimits(CMatchFinder *p)
-{
- if (p->pos == kMaxValForNormalize)
- MatchFinder_Normalize(p);
- if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos)
- MatchFinder_CheckAndMoveAndRead(p);
- if (p->cyclicBufferPos == p->cyclicBufferSize)
- p->cyclicBufferPos = 0;
- MatchFinder_SetLimits(p);
-}
-
-static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
- UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
- UInt32 *distances, UInt32 maxLen)
-{
- son[_cyclicBufferPos] = curMatch;
- for (;;)
- {
- UInt32 delta = pos - curMatch;
- if (cutValue-- == 0 || delta >= _cyclicBufferSize)
- return distances;
- {
- const Byte *pb = cur - delta;
- curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
- if (pb[maxLen] == cur[maxLen] && *pb == *cur)
- {
- UInt32 len = 0;
- while (++len != lenLimit)
- if (pb[len] != cur[len])
- break;
- if (maxLen < len)
- {
- *distances++ = maxLen = len;
- *distances++ = delta - 1;
- if (len == lenLimit)
- return distances;
- }
- }
- }
- }
-}
-
-UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
- UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
- UInt32 *distances, UInt32 maxLen)
-{
- CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
- CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
- UInt32 len0 = 0, len1 = 0;
- for (;;)
- {
- UInt32 delta = pos - curMatch;
- if (cutValue-- == 0 || delta >= _cyclicBufferSize)
- {
- *ptr0 = *ptr1 = kEmptyHashValue;
- return distances;
- }
- {
- CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
- const Byte *pb = cur - delta;
- UInt32 len = (len0 < len1 ? len0 : len1);
- if (pb[len] == cur[len])
- {
- if (++len != lenLimit && pb[len] == cur[len])
- while (++len != lenLimit)
- if (pb[len] != cur[len])
- break;
- if (maxLen < len)
- {
- *distances++ = maxLen = len;
- *distances++ = delta - 1;
- if (len == lenLimit)
- {
- *ptr1 = pair[0];
- *ptr0 = pair[1];
- return distances;
- }
- }
- }
- if (pb[len] < cur[len])
- {
- *ptr1 = curMatch;
- ptr1 = pair + 1;
- curMatch = *ptr1;
- len1 = len;
- }
- else
- {
- *ptr0 = curMatch;
- ptr0 = pair;
- curMatch = *ptr0;
- len0 = len;
- }
- }
- }
-}
-
-static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
- UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
-{
- CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
- CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
- UInt32 len0 = 0, len1 = 0;
- for (;;)
- {
- UInt32 delta = pos - curMatch;
- if (cutValue-- == 0 || delta >= _cyclicBufferSize)
- {
- *ptr0 = *ptr1 = kEmptyHashValue;
- return;
- }
- {
- CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
- const Byte *pb = cur - delta;
- UInt32 len = (len0 < len1 ? len0 : len1);
- if (pb[len] == cur[len])
- {
- while (++len != lenLimit)
- if (pb[len] != cur[len])
- break;
- {
- if (len == lenLimit)
- {
- *ptr1 = pair[0];
- *ptr0 = pair[1];
- return;
- }
- }
- }
- if (pb[len] < cur[len])
- {
- *ptr1 = curMatch;
- ptr1 = pair + 1;
- curMatch = *ptr1;
- len1 = len;
- }
- else
- {
- *ptr0 = curMatch;
- ptr0 = pair;
- curMatch = *ptr0;
- len0 = len;
- }
- }
- }
-}
-
-#define MOVE_POS \
- ++p->cyclicBufferPos; \
- p->buffer++; \
- if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
-
-#define MOVE_POS_RET MOVE_POS return offset;
-
-static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
-
-#define GET_MATCHES_HEADER2(minLen, ret_op) \
- UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \
- lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \
- cur = p->buffer;
-
-#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0)
-#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue)
-
-#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue
-
-#define GET_MATCHES_FOOTER(offset, maxLen) \
- offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \
- distances + offset, maxLen) - distances); MOVE_POS_RET;
-
-#define SKIP_FOOTER \
- SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
-
-static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
-{
- UInt32 offset;
- GET_MATCHES_HEADER(2)
- HASH2_CALC;
- curMatch = p->hash[hashValue];
- p->hash[hashValue] = p->pos;
- offset = 0;
- GET_MATCHES_FOOTER(offset, 1)
-}
-
-UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
-{
- UInt32 offset;
- GET_MATCHES_HEADER(3)
- HASH_ZIP_CALC;
- curMatch = p->hash[hashValue];
- p->hash[hashValue] = p->pos;
- offset = 0;
- GET_MATCHES_FOOTER(offset, 2)
-}
-
-static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
-{
- UInt32 hash2Value, delta2, maxLen, offset;
- GET_MATCHES_HEADER(3)
-
- HASH3_CALC;
-
- delta2 = p->pos - p->hash[hash2Value];
- curMatch = p->hash[kFix3HashSize + hashValue];
-
- p->hash[hash2Value] =
- p->hash[kFix3HashSize + hashValue] = p->pos;
-
-
- maxLen = 2;
- offset = 0;
- if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
- {
- for (; maxLen != lenLimit; maxLen++)
- if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
- break;
- distances[0] = maxLen;
- distances[1] = delta2 - 1;
- offset = 2;
- if (maxLen == lenLimit)
- {
- SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
- MOVE_POS_RET;
- }
- }
- GET_MATCHES_FOOTER(offset, maxLen)
-}
-
-static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
-{
- UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
- GET_MATCHES_HEADER(4)
-
- HASH4_CALC;
-
- delta2 = p->pos - p->hash[ hash2Value];
- delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
- curMatch = p->hash[kFix4HashSize + hashValue];
-
- p->hash[ hash2Value] =
- p->hash[kFix3HashSize + hash3Value] =
- p->hash[kFix4HashSize + hashValue] = p->pos;
-
- maxLen = 1;
- offset = 0;
- if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
- {
- distances[0] = maxLen = 2;
- distances[1] = delta2 - 1;
- offset = 2;
- }
- if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
- {
- maxLen = 3;
- distances[offset + 1] = delta3 - 1;
- offset += 2;
- delta2 = delta3;
- }
- if (offset != 0)
- {
- for (; maxLen != lenLimit; maxLen++)
- if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
- break;
- distances[offset - 2] = maxLen;
- if (maxLen == lenLimit)
- {
- SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
- MOVE_POS_RET;
- }
- }
- if (maxLen < 3)
- maxLen = 3;
- GET_MATCHES_FOOTER(offset, maxLen)
-}
-
-static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
-{
- UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
- GET_MATCHES_HEADER(4)
-
- HASH4_CALC;
-
- delta2 = p->pos - p->hash[ hash2Value];
- delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
- curMatch = p->hash[kFix4HashSize + hashValue];
-
- p->hash[ hash2Value] =
- p->hash[kFix3HashSize + hash3Value] =
- p->hash[kFix4HashSize + hashValue] = p->pos;
-
- maxLen = 1;
- offset = 0;
- if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
- {
- distances[0] = maxLen = 2;
- distances[1] = delta2 - 1;
- offset = 2;
- }
- if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
- {
- maxLen = 3;
- distances[offset + 1] = delta3 - 1;
- offset += 2;
- delta2 = delta3;
- }
- if (offset != 0)
- {
- for (; maxLen != lenLimit; maxLen++)
- if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
- break;
- distances[offset - 2] = maxLen;
- if (maxLen == lenLimit)
- {
- p->son[p->cyclicBufferPos] = curMatch;
- MOVE_POS_RET;
- }
- }
- if (maxLen < 3)
- maxLen = 3;
- offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
- distances + offset, maxLen) - (distances));
- MOVE_POS_RET
-}
-
-UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
-{
- UInt32 offset;
- GET_MATCHES_HEADER(3)
- HASH_ZIP_CALC;
- curMatch = p->hash[hashValue];
- p->hash[hashValue] = p->pos;
- offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
- distances, 2) - (distances));
- MOVE_POS_RET
-}
-
-static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
-{
- do
- {
- SKIP_HEADER(2)
- HASH2_CALC;
- curMatch = p->hash[hashValue];
- p->hash[hashValue] = p->pos;
- SKIP_FOOTER
- }
- while (--num != 0);
-}
-
-void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
-{
- do
- {
- SKIP_HEADER(3)
- HASH_ZIP_CALC;
- curMatch = p->hash[hashValue];
- p->hash[hashValue] = p->pos;
- SKIP_FOOTER
- }
- while (--num != 0);
-}
-
-static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
-{
- do
- {
- UInt32 hash2Value;
- SKIP_HEADER(3)
- HASH3_CALC;
- curMatch = p->hash[kFix3HashSize + hashValue];
- p->hash[hash2Value] =
- p->hash[kFix3HashSize + hashValue] = p->pos;
- SKIP_FOOTER
- }
- while (--num != 0);
-}
-
-static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
-{
- do
- {
- UInt32 hash2Value, hash3Value;
- SKIP_HEADER(4)
- HASH4_CALC;
- curMatch = p->hash[kFix4HashSize + hashValue];
- p->hash[ hash2Value] =
- p->hash[kFix3HashSize + hash3Value] = p->pos;
- p->hash[kFix4HashSize + hashValue] = p->pos;
- SKIP_FOOTER
- }
- while (--num != 0);
-}
-
-static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
-{
- do
- {
- UInt32 hash2Value, hash3Value;
- SKIP_HEADER(4)
- HASH4_CALC;
- curMatch = p->hash[kFix4HashSize + hashValue];
- p->hash[ hash2Value] =
- p->hash[kFix3HashSize + hash3Value] =
- p->hash[kFix4HashSize + hashValue] = p->pos;
- p->son[p->cyclicBufferPos] = curMatch;
- MOVE_POS
- }
- while (--num != 0);
-}
-
-void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
-{
- do
- {
- SKIP_HEADER(3)
- HASH_ZIP_CALC;
- curMatch = p->hash[hashValue];
- p->hash[hashValue] = p->pos;
- p->son[p->cyclicBufferPos] = curMatch;
- MOVE_POS
- }
- while (--num != 0);
-}
-
-void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable)
-{
- vTable->Init = (Mf_Init_Func)MatchFinder_Init;
- vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte;
- vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes;
- vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos;
- if (!p->btMode)
- {
- vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches;
- vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip;
- }
- else if (p->numHashBytes == 2)
- {
- vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches;
- vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip;
- }
- else if (p->numHashBytes == 3)
- {
- vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches;
- vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip;
- }
- else
- {
- vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches;
- vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;
- }
-}
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFind.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFind.h
deleted file mode 100644
index 423d67e0c3..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFind.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* LzFind.h -- Match finder for LZ algorithms
-2008-10-04 : Igor Pavlov : Public domain */
-
-#ifndef __LZFIND_H
-#define __LZFIND_H
-
-#include "Types.h"
-
-typedef UInt32 CLzRef;
-
-typedef struct _CMatchFinder
-{
- Byte *buffer;
- UInt32 pos;
- UInt32 posLimit;
- UInt32 streamPos;
- UInt32 lenLimit;
-
- UInt32 cyclicBufferPos;
- UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
-
- UInt32 matchMaxLen;
- CLzRef *hash;
- CLzRef *son;
- UInt32 hashMask;
- UInt32 cutValue;
-
- Byte *bufferBase;
- ISeqInStream *stream;
- int streamEndWasReached;
-
- UInt32 blockSize;
- UInt32 keepSizeBefore;
- UInt32 keepSizeAfter;
-
- UInt32 numHashBytes;
- int directInput;
- int btMode;
- /* int skipModeBits; */
- int bigHash;
- UInt32 historySize;
- UInt32 fixedHashSize;
- UInt32 hashSizeSum;
- UInt32 numSons;
- SRes result;
- UInt32 crc[256];
-} CMatchFinder;
-
-#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)
-#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)])
-
-#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos)
-
-int MatchFinder_NeedMove(CMatchFinder *p);
-Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);
-void MatchFinder_MoveBlock(CMatchFinder *p);
-void MatchFinder_ReadIfRequired(CMatchFinder *p);
-
-void MatchFinder_Construct(CMatchFinder *p);
-
-/* Conditions:
- historySize <= 3 GB
- keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB
-*/
-int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
- UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
- ISzAlloc *alloc);
-void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);
-void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems);
-void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
-
-UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
- UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
- UInt32 *distances, UInt32 maxLen);
-
-/*
-Conditions:
- Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func.
- Mf_GetPointerToCurrentPos_Func's result must be used only before any other function
-*/
-
-typedef void (*Mf_Init_Func)(void *object);
-typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index);
-typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
-typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
-typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
-typedef void (*Mf_Skip_Func)(void *object, UInt32);
-
-typedef struct _IMatchFinder
-{
- Mf_Init_Func Init;
- Mf_GetIndexByte_Func GetIndexByte;
- Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
- Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
- Mf_GetMatches_Func GetMatches;
- Mf_Skip_Func Skip;
-} IMatchFinder;
-
-void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);
-
-void MatchFinder_Init(CMatchFinder *p);
-UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
-UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
-void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
-void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFindMt.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFindMt.c
deleted file mode 100644
index 0ef134735d..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFindMt.c
+++ /dev/null
@@ -1,793 +0,0 @@
-/* LzFindMt.c -- multithreaded Match finder for LZ algorithms
-2008-10-04 : Igor Pavlov : Public domain */
-
-#include "LzHash.h"
-
-#include "LzFindMt.h"
-
-void MtSync_Construct(CMtSync *p)
-{
- p->wasCreated = False;
- p->csWasInitialized = False;
- p->csWasEntered = False;
- Thread_Construct(&p->thread);
- Event_Construct(&p->canStart);
- Event_Construct(&p->wasStarted);
- Event_Construct(&p->wasStopped);
- Semaphore_Construct(&p->freeSemaphore);
- Semaphore_Construct(&p->filledSemaphore);
-}
-
-void MtSync_GetNextBlock(CMtSync *p)
-{
- if (p->needStart)
- {
- p->numProcessedBlocks = 1;
- p->needStart = False;
- p->stopWriting = False;
- p->exit = False;
- Event_Reset(&p->wasStarted);
- Event_Reset(&p->wasStopped);
-
- Event_Set(&p->canStart);
- Event_Wait(&p->wasStarted);
- }
- else
- {
- CriticalSection_Leave(&p->cs);
- p->csWasEntered = False;
- p->numProcessedBlocks++;
- Semaphore_Release1(&p->freeSemaphore);
- }
- Semaphore_Wait(&p->filledSemaphore);
- CriticalSection_Enter(&p->cs);
- p->csWasEntered = True;
-}
-
-/* MtSync_StopWriting must be called if Writing was started */
-
-void MtSync_StopWriting(CMtSync *p)
-{
- UInt32 myNumBlocks = p->numProcessedBlocks;
- if (!Thread_WasCreated(&p->thread) || p->needStart)
- return;
- p->stopWriting = True;
- if (p->csWasEntered)
- {
- CriticalSection_Leave(&p->cs);
- p->csWasEntered = False;
- }
- Semaphore_Release1(&p->freeSemaphore);
-
- Event_Wait(&p->wasStopped);
-
- while (myNumBlocks++ != p->numProcessedBlocks)
- {
- Semaphore_Wait(&p->filledSemaphore);
- Semaphore_Release1(&p->freeSemaphore);
- }
- p->needStart = True;
-}
-
-void MtSync_Destruct(CMtSync *p)
-{
- if (Thread_WasCreated(&p->thread))
- {
- MtSync_StopWriting(p);
- p->exit = True;
- if (p->needStart)
- Event_Set(&p->canStart);
- Thread_Wait(&p->thread);
- Thread_Close(&p->thread);
- }
- if (p->csWasInitialized)
- {
- CriticalSection_Delete(&p->cs);
- p->csWasInitialized = False;
- }
-
- Event_Close(&p->canStart);
- Event_Close(&p->wasStarted);
- Event_Close(&p->wasStopped);
- Semaphore_Close(&p->freeSemaphore);
- Semaphore_Close(&p->filledSemaphore);
-
- p->wasCreated = False;
-}
-
-#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; }
-
-static SRes MtSync_Create2(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks)
-{
- if (p->wasCreated)
- return SZ_OK;
-
- RINOK_THREAD(CriticalSection_Init(&p->cs));
- p->csWasInitialized = True;
-
- RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canStart));
- RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStarted));
- RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStopped));
-
- RINOK_THREAD(Semaphore_Create(&p->freeSemaphore, numBlocks, numBlocks));
- RINOK_THREAD(Semaphore_Create(&p->filledSemaphore, 0, numBlocks));
-
- p->needStart = True;
-
- RINOK_THREAD(Thread_Create(&p->thread, startAddress, obj));
- p->wasCreated = True;
- return SZ_OK;
-}
-
-static SRes MtSync_Create(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks)
-{
- SRes res = MtSync_Create2(p, startAddress, obj, numBlocks);
- if (res != SZ_OK)
- MtSync_Destruct(p);
- return res;
-}
-
-void MtSync_Init(CMtSync *p) { p->needStart = True; }
-
-#define kMtMaxValForNormalize 0xFFFFFFFF
-
-#define DEF_GetHeads2(name, v, action) \
-static void GetHeads ## name(const Byte *p, UInt32 pos, \
-UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc) \
-{ action; for (; numHeads != 0; numHeads--) { \
-const UInt32 value = (v); p++; *heads++ = pos - hash[value]; hash[value] = pos++; } }
-
-#define DEF_GetHeads(name, v) DEF_GetHeads2(name, v, ;)
-
-DEF_GetHeads2(2, (p[0] | ((UInt32)p[1] << 8)), hashMask = hashMask; crc = crc; )
-DEF_GetHeads(3, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8)) & hashMask)
-DEF_GetHeads(4, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5)) & hashMask)
-DEF_GetHeads(4b, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ ((UInt32)p[3] << 16)) & hashMask)
-DEF_GetHeads(5, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5) ^ (crc[p[4]] << 3)) & hashMask)
-
-void HashThreadFunc(CMatchFinderMt *mt)
-{
- CMtSync *p = &mt->hashSync;
- for (;;)
- {
- UInt32 numProcessedBlocks = 0;
- Event_Wait(&p->canStart);
- Event_Set(&p->wasStarted);
- for (;;)
- {
- if (p->exit)
- return;
- if (p->stopWriting)
- {
- p->numProcessedBlocks = numProcessedBlocks;
- Event_Set(&p->wasStopped);
- break;
- }
-
- {
- CMatchFinder *mf = mt->MatchFinder;
- if (MatchFinder_NeedMove(mf))
- {
- CriticalSection_Enter(&mt->btSync.cs);
- CriticalSection_Enter(&mt->hashSync.cs);
- {
- const Byte *beforePtr = MatchFinder_GetPointerToCurrentPos(mf);
- const Byte *afterPtr;
- MatchFinder_MoveBlock(mf);
- afterPtr = MatchFinder_GetPointerToCurrentPos(mf);
- mt->pointerToCurPos -= beforePtr - afterPtr;
- mt->buffer -= beforePtr - afterPtr;
- }
- CriticalSection_Leave(&mt->btSync.cs);
- CriticalSection_Leave(&mt->hashSync.cs);
- continue;
- }
-
- Semaphore_Wait(&p->freeSemaphore);
-
- MatchFinder_ReadIfRequired(mf);
- if (mf->pos > (kMtMaxValForNormalize - kMtHashBlockSize))
- {
- UInt32 subValue = (mf->pos - mf->historySize - 1);
- MatchFinder_ReduceOffsets(mf, subValue);
- MatchFinder_Normalize3(subValue, mf->hash + mf->fixedHashSize, mf->hashMask + 1);
- }
- {
- UInt32 *heads = mt->hashBuf + ((numProcessedBlocks++) & kMtHashNumBlocksMask) * kMtHashBlockSize;
- UInt32 num = mf->streamPos - mf->pos;
- heads[0] = 2;
- heads[1] = num;
- if (num >= mf->numHashBytes)
- {
- num = num - mf->numHashBytes + 1;
- if (num > kMtHashBlockSize - 2)
- num = kMtHashBlockSize - 2;
- mt->GetHeadsFunc(mf->buffer, mf->pos, mf->hash + mf->fixedHashSize, mf->hashMask, heads + 2, num, mf->crc);
- heads[0] += num;
- }
- mf->pos += num;
- mf->buffer += num;
- }
- }
-
- Semaphore_Release1(&p->filledSemaphore);
- }
- }
-}
-
-void MatchFinderMt_GetNextBlock_Hash(CMatchFinderMt *p)
-{
- MtSync_GetNextBlock(&p->hashSync);
- p->hashBufPosLimit = p->hashBufPos = ((p->hashSync.numProcessedBlocks - 1) & kMtHashNumBlocksMask) * kMtHashBlockSize;
- p->hashBufPosLimit += p->hashBuf[p->hashBufPos++];
- p->hashNumAvail = p->hashBuf[p->hashBufPos++];
-}
-
-#define kEmptyHashValue 0
-
-/* #define MFMT_GM_INLINE */
-
-#ifdef MFMT_GM_INLINE
-
-#define NO_INLINE MY_FAST_CALL
-
-Int32 NO_INLINE GetMatchesSpecN(UInt32 lenLimit, UInt32 pos, const Byte *cur, CLzRef *son,
- UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
- UInt32 *_distances, UInt32 _maxLen, const UInt32 *hash, Int32 limit, UInt32 size, UInt32 *posRes)
-{
- do
- {
- UInt32 *distances = _distances + 1;
- UInt32 curMatch = pos - *hash++;
-
- CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
- CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
- UInt32 len0 = 0, len1 = 0;
- UInt32 cutValue = _cutValue;
- UInt32 maxLen = _maxLen;
- for (;;)
- {
- UInt32 delta = pos - curMatch;
- if (cutValue-- == 0 || delta >= _cyclicBufferSize)
- {
- *ptr0 = *ptr1 = kEmptyHashValue;
- break;
- }
- {
- CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
- const Byte *pb = cur - delta;
- UInt32 len = (len0 < len1 ? len0 : len1);
- if (pb[len] == cur[len])
- {
- if (++len != lenLimit && pb[len] == cur[len])
- while (++len != lenLimit)
- if (pb[len] != cur[len])
- break;
- if (maxLen < len)
- {
- *distances++ = maxLen = len;
- *distances++ = delta - 1;
- if (len == lenLimit)
- {
- *ptr1 = pair[0];
- *ptr0 = pair[1];
- break;
- }
- }
- }
- if (pb[len] < cur[len])
- {
- *ptr1 = curMatch;
- ptr1 = pair + 1;
- curMatch = *ptr1;
- len1 = len;
- }
- else
- {
- *ptr0 = curMatch;
- ptr0 = pair;
- curMatch = *ptr0;
- len0 = len;
- }
- }
- }
- pos++;
- _cyclicBufferPos++;
- cur++;
- {
- UInt32 num = (UInt32)(distances - _distances);
- *_distances = num - 1;
- _distances += num;
- limit -= num;
- }
- }
- while (limit > 0 && --size != 0);
- *posRes = pos;
- return limit;
-}
-
-#endif
-
-void BtGetMatches(CMatchFinderMt *p, UInt32 *distances)
-{
- UInt32 numProcessed = 0;
- UInt32 curPos = 2;
- UInt32 limit = kMtBtBlockSize - (p->matchMaxLen * 2);
- distances[1] = p->hashNumAvail;
- while (curPos < limit)
- {
- if (p->hashBufPos == p->hashBufPosLimit)
- {
- MatchFinderMt_GetNextBlock_Hash(p);
- distances[1] = numProcessed + p->hashNumAvail;
- if (p->hashNumAvail >= p->numHashBytes)
- continue;
- for (; p->hashNumAvail != 0; p->hashNumAvail--)
- distances[curPos++] = 0;
- break;
- }
- {
- UInt32 size = p->hashBufPosLimit - p->hashBufPos;
- UInt32 lenLimit = p->matchMaxLen;
- UInt32 pos = p->pos;
- UInt32 cyclicBufferPos = p->cyclicBufferPos;
- if (lenLimit >= p->hashNumAvail)
- lenLimit = p->hashNumAvail;
- {
- UInt32 size2 = p->hashNumAvail - lenLimit + 1;
- if (size2 < size)
- size = size2;
- size2 = p->cyclicBufferSize - cyclicBufferPos;
- if (size2 < size)
- size = size2;
- }
- #ifndef MFMT_GM_INLINE
- while (curPos < limit && size-- != 0)
- {
- UInt32 *startDistances = distances + curPos;
- UInt32 num = (UInt32)(GetMatchesSpec1(lenLimit, pos - p->hashBuf[p->hashBufPos++],
- pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue,
- startDistances + 1, p->numHashBytes - 1) - startDistances);
- *startDistances = num - 1;
- curPos += num;
- cyclicBufferPos++;
- pos++;
- p->buffer++;
- }
- #else
- {
- UInt32 posRes;
- curPos = limit - GetMatchesSpecN(lenLimit, pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue,
- distances + curPos, p->numHashBytes - 1, p->hashBuf + p->hashBufPos, (Int32)(limit - curPos) , size, &posRes);
- p->hashBufPos += posRes - pos;
- cyclicBufferPos += posRes - pos;
- p->buffer += posRes - pos;
- pos = posRes;
- }
- #endif
-
- numProcessed += pos - p->pos;
- p->hashNumAvail -= pos - p->pos;
- p->pos = pos;
- if (cyclicBufferPos == p->cyclicBufferSize)
- cyclicBufferPos = 0;
- p->cyclicBufferPos = cyclicBufferPos;
- }
- }
- distances[0] = curPos;
-}
-
-void BtFillBlock(CMatchFinderMt *p, UInt32 globalBlockIndex)
-{
- CMtSync *sync = &p->hashSync;
- if (!sync->needStart)
- {
- CriticalSection_Enter(&sync->cs);
- sync->csWasEntered = True;
- }
-
- BtGetMatches(p, p->btBuf + (globalBlockIndex & kMtBtNumBlocksMask) * kMtBtBlockSize);
-
- if (p->pos > kMtMaxValForNormalize - kMtBtBlockSize)
- {
- UInt32 subValue = p->pos - p->cyclicBufferSize;
- MatchFinder_Normalize3(subValue, p->son, p->cyclicBufferSize * 2);
- p->pos -= subValue;
- }
-
- if (!sync->needStart)
- {
- CriticalSection_Leave(&sync->cs);
- sync->csWasEntered = False;
- }
-}
-
-void BtThreadFunc(CMatchFinderMt *mt)
-{
- CMtSync *p = &mt->btSync;
- for (;;)
- {
- UInt32 blockIndex = 0;
- Event_Wait(&p->canStart);
- Event_Set(&p->wasStarted);
- for (;;)
- {
- if (p->exit)
- return;
- if (p->stopWriting)
- {
- p->numProcessedBlocks = blockIndex;
- MtSync_StopWriting(&mt->hashSync);
- Event_Set(&p->wasStopped);
- break;
- }
- Semaphore_Wait(&p->freeSemaphore);
- BtFillBlock(mt, blockIndex++);
- Semaphore_Release1(&p->filledSemaphore);
- }
- }
-}
-
-void MatchFinderMt_Construct(CMatchFinderMt *p)
-{
- p->hashBuf = 0;
- MtSync_Construct(&p->hashSync);
- MtSync_Construct(&p->btSync);
-}
-
-void MatchFinderMt_FreeMem(CMatchFinderMt *p, ISzAlloc *alloc)
-{
- alloc->Free(alloc, p->hashBuf);
- p->hashBuf = 0;
-}
-
-void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc)
-{
- MtSync_Destruct(&p->hashSync);
- MtSync_Destruct(&p->btSync);
- MatchFinderMt_FreeMem(p, alloc);
-}
-
-#define kHashBufferSize (kMtHashBlockSize * kMtHashNumBlocks)
-#define kBtBufferSize (kMtBtBlockSize * kMtBtNumBlocks)
-
-static unsigned MY_STD_CALL HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; }
-static unsigned MY_STD_CALL BtThreadFunc2(void *p)
-{
- Byte allocaDummy[0x180];
- int i = 0;
- for (i = 0; i < 16; i++)
- allocaDummy[i] = (Byte)i;
- BtThreadFunc((CMatchFinderMt *)p);
- return 0;
-}
-
-SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore,
- UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc)
-{
- CMatchFinder *mf = p->MatchFinder;
- p->historySize = historySize;
- if (kMtBtBlockSize <= matchMaxLen * 4)
- return SZ_ERROR_PARAM;
- if (p->hashBuf == 0)
- {
- p->hashBuf = (UInt32 *)alloc->Alloc(alloc, (kHashBufferSize + kBtBufferSize) * sizeof(UInt32));
- if (p->hashBuf == 0)
- return SZ_ERROR_MEM;
- p->btBuf = p->hashBuf + kHashBufferSize;
- }
- keepAddBufferBefore += (kHashBufferSize + kBtBufferSize);
- keepAddBufferAfter += kMtHashBlockSize;
- if (!MatchFinder_Create(mf, historySize, keepAddBufferBefore, matchMaxLen, keepAddBufferAfter, alloc))
- return SZ_ERROR_MEM;
-
- RINOK(MtSync_Create(&p->hashSync, HashThreadFunc2, p, kMtHashNumBlocks));
- RINOK(MtSync_Create(&p->btSync, BtThreadFunc2, p, kMtBtNumBlocks));
- return SZ_OK;
-}
-
-/* Call it after ReleaseStream / SetStream */
-void MatchFinderMt_Init(CMatchFinderMt *p)
-{
- CMatchFinder *mf = p->MatchFinder;
- p->btBufPos = p->btBufPosLimit = 0;
- p->hashBufPos = p->hashBufPosLimit = 0;
- MatchFinder_Init(mf);
- p->pointerToCurPos = MatchFinder_GetPointerToCurrentPos(mf);
- p->btNumAvailBytes = 0;
- p->lzPos = p->historySize + 1;
-
- p->hash = mf->hash;
- p->fixedHashSize = mf->fixedHashSize;
- p->crc = mf->crc;
-
- p->son = mf->son;
- p->matchMaxLen = mf->matchMaxLen;
- p->numHashBytes = mf->numHashBytes;
- p->pos = mf->pos;
- p->buffer = mf->buffer;
- p->cyclicBufferPos = mf->cyclicBufferPos;
- p->cyclicBufferSize = mf->cyclicBufferSize;
- p->cutValue = mf->cutValue;
-}
-
-/* ReleaseStream is required to finish multithreading */
-void MatchFinderMt_ReleaseStream(CMatchFinderMt *p)
-{
- MtSync_StopWriting(&p->btSync);
- /* p->MatchFinder->ReleaseStream(); */
-}
-
-void MatchFinderMt_Normalize(CMatchFinderMt *p)
-{
- MatchFinder_Normalize3(p->lzPos - p->historySize - 1, p->hash, p->fixedHashSize);
- p->lzPos = p->historySize + 1;
-}
-
-void MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p)
-{
- UInt32 blockIndex;
- MtSync_GetNextBlock(&p->btSync);
- blockIndex = ((p->btSync.numProcessedBlocks - 1) & kMtBtNumBlocksMask);
- p->btBufPosLimit = p->btBufPos = blockIndex * kMtBtBlockSize;
- p->btBufPosLimit += p->btBuf[p->btBufPos++];
- p->btNumAvailBytes = p->btBuf[p->btBufPos++];
- if (p->lzPos >= kMtMaxValForNormalize - kMtBtBlockSize)
- MatchFinderMt_Normalize(p);
-}
-
-const Byte * MatchFinderMt_GetPointerToCurrentPos(CMatchFinderMt *p)
-{
- return p->pointerToCurPos;
-}
-
-#define GET_NEXT_BLOCK_IF_REQUIRED if (p->btBufPos == p->btBufPosLimit) MatchFinderMt_GetNextBlock_Bt(p);
-
-UInt32 MatchFinderMt_GetNumAvailableBytes(CMatchFinderMt *p)
-{
- GET_NEXT_BLOCK_IF_REQUIRED;
- return p->btNumAvailBytes;
-}
-
-Byte MatchFinderMt_GetIndexByte(CMatchFinderMt *p, Int32 index)
-{
- return p->pointerToCurPos[index];
-}
-
-UInt32 * MixMatches2(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances)
-{
- UInt32 hash2Value, curMatch2;
- UInt32 *hash = p->hash;
- const Byte *cur = p->pointerToCurPos;
- UInt32 lzPos = p->lzPos;
- MT_HASH2_CALC
-
- curMatch2 = hash[hash2Value];
- hash[hash2Value] = lzPos;
-
- if (curMatch2 >= matchMinPos)
- if (cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0])
- {
- *distances++ = 2;
- *distances++ = lzPos - curMatch2 - 1;
- }
- return distances;
-}
-
-UInt32 * MixMatches3(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances)
-{
- UInt32 hash2Value, hash3Value, curMatch2, curMatch3;
- UInt32 *hash = p->hash;
- const Byte *cur = p->pointerToCurPos;
- UInt32 lzPos = p->lzPos;
- MT_HASH3_CALC
-
- curMatch2 = hash[ hash2Value];
- curMatch3 = hash[kFix3HashSize + hash3Value];
-
- hash[ hash2Value] =
- hash[kFix3HashSize + hash3Value] =
- lzPos;
-
- if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0])
- {
- distances[1] = lzPos - curMatch2 - 1;
- if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2])
- {
- distances[0] = 3;
- return distances + 2;
- }
- distances[0] = 2;
- distances += 2;
- }
- if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0])
- {
- *distances++ = 3;
- *distances++ = lzPos - curMatch3 - 1;
- }
- return distances;
-}
-
-/*
-UInt32 *MixMatches4(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances)
-{
- UInt32 hash2Value, hash3Value, hash4Value, curMatch2, curMatch3, curMatch4;
- UInt32 *hash = p->hash;
- const Byte *cur = p->pointerToCurPos;
- UInt32 lzPos = p->lzPos;
- MT_HASH4_CALC
-
- curMatch2 = hash[ hash2Value];
- curMatch3 = hash[kFix3HashSize + hash3Value];
- curMatch4 = hash[kFix4HashSize + hash4Value];
-
- hash[ hash2Value] =
- hash[kFix3HashSize + hash3Value] =
- hash[kFix4HashSize + hash4Value] =
- lzPos;
-
- if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0])
- {
- distances[1] = lzPos - curMatch2 - 1;
- if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2])
- {
- distances[0] = (cur[(ptrdiff_t)curMatch2 - lzPos + 3] == cur[3]) ? 4 : 3;
- return distances + 2;
- }
- distances[0] = 2;
- distances += 2;
- }
- if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0])
- {
- distances[1] = lzPos - curMatch3 - 1;
- if (cur[(ptrdiff_t)curMatch3 - lzPos + 3] == cur[3])
- {
- distances[0] = 4;
- return distances + 2;
- }
- distances[0] = 3;
- distances += 2;
- }
-
- if (curMatch4 >= matchMinPos)
- if (
- cur[(ptrdiff_t)curMatch4 - lzPos] == cur[0] &&
- cur[(ptrdiff_t)curMatch4 - lzPos + 3] == cur[3]
- )
- {
- *distances++ = 4;
- *distances++ = lzPos - curMatch4 - 1;
- }
- return distances;
-}
-*/
-
-#define INCREASE_LZ_POS p->lzPos++; p->pointerToCurPos++;
-
-UInt32 MatchFinderMt2_GetMatches(CMatchFinderMt *p, UInt32 *distances)
-{
- const UInt32 *btBuf = p->btBuf + p->btBufPos;
- UInt32 len = *btBuf++;
- p->btBufPos += 1 + len;
- p->btNumAvailBytes--;
- {
- UInt32 i;
- for (i = 0; i < len; i += 2)
- {
- *distances++ = *btBuf++;
- *distances++ = *btBuf++;
- }
- }
- INCREASE_LZ_POS
- return len;
-}
-
-UInt32 MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *distances)
-{
- const UInt32 *btBuf = p->btBuf + p->btBufPos;
- UInt32 len = *btBuf++;
- p->btBufPos += 1 + len;
-
- if (len == 0)
- {
- if (p->btNumAvailBytes-- >= 4)
- len = (UInt32)(p->MixMatchesFunc(p, p->lzPos - p->historySize, distances) - (distances));
- }
- else
- {
- /* Condition: there are matches in btBuf with length < p->numHashBytes */
- UInt32 *distances2;
- p->btNumAvailBytes--;
- distances2 = p->MixMatchesFunc(p, p->lzPos - btBuf[1], distances);
- do
- {
- *distances2++ = *btBuf++;
- *distances2++ = *btBuf++;
- }
- while ((len -= 2) != 0);
- len = (UInt32)(distances2 - (distances));
- }
- INCREASE_LZ_POS
- return len;
-}
-
-#define SKIP_HEADER2 do { GET_NEXT_BLOCK_IF_REQUIRED
-#define SKIP_HEADER(n) SKIP_HEADER2 if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash;
-#define SKIP_FOOTER } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0);
-
-void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num)
-{
- SKIP_HEADER2 { p->btNumAvailBytes--;
- SKIP_FOOTER
-}
-
-void MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num)
-{
- SKIP_HEADER(2)
- UInt32 hash2Value;
- MT_HASH2_CALC
- hash[hash2Value] = p->lzPos;
- SKIP_FOOTER
-}
-
-void MatchFinderMt3_Skip(CMatchFinderMt *p, UInt32 num)
-{
- SKIP_HEADER(3)
- UInt32 hash2Value, hash3Value;
- MT_HASH3_CALC
- hash[kFix3HashSize + hash3Value] =
- hash[ hash2Value] =
- p->lzPos;
- SKIP_FOOTER
-}
-
-/*
-void MatchFinderMt4_Skip(CMatchFinderMt *p, UInt32 num)
-{
- SKIP_HEADER(4)
- UInt32 hash2Value, hash3Value, hash4Value;
- MT_HASH4_CALC
- hash[kFix4HashSize + hash4Value] =
- hash[kFix3HashSize + hash3Value] =
- hash[ hash2Value] =
- p->lzPos;
- SKIP_FOOTER
-}
-*/
-
-void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable)
-{
- vTable->Init = (Mf_Init_Func)MatchFinderMt_Init;
- vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinderMt_GetIndexByte;
- vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinderMt_GetNumAvailableBytes;
- vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinderMt_GetPointerToCurrentPos;
- vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt_GetMatches;
- switch(p->MatchFinder->numHashBytes)
- {
- case 2:
- p->GetHeadsFunc = GetHeads2;
- p->MixMatchesFunc = (Mf_Mix_Matches)0;
- vTable->Skip = (Mf_Skip_Func)MatchFinderMt0_Skip;
- vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt2_GetMatches;
- break;
- case 3:
- p->GetHeadsFunc = GetHeads3;
- p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches2;
- vTable->Skip = (Mf_Skip_Func)MatchFinderMt2_Skip;
- break;
- default:
- /* case 4: */
- p->GetHeadsFunc = p->MatchFinder->bigHash ? GetHeads4b : GetHeads4;
- /* p->GetHeadsFunc = GetHeads4; */
- p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches3;
- vTable->Skip = (Mf_Skip_Func)MatchFinderMt3_Skip;
- break;
- /*
- default:
- p->GetHeadsFunc = GetHeads5;
- p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches4;
- vTable->Skip = (Mf_Skip_Func)MatchFinderMt4_Skip;
- break;
- */
- }
-}
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFindMt.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFindMt.h
deleted file mode 100644
index b7ead2d472..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzFindMt.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* LzFindMt.h -- multithreaded Match finder for LZ algorithms
-2008-10-04 : Igor Pavlov : Public domain */
-
-#ifndef __LZFINDMT_H
-#define __LZFINDMT_H
-
-#include "Threads.h"
-#include "LzFind.h"
-
-#define kMtHashBlockSize (1 << 13)
-#define kMtHashNumBlocks (1 << 3)
-#define kMtHashNumBlocksMask (kMtHashNumBlocks - 1)
-
-#define kMtBtBlockSize (1 << 14)
-#define kMtBtNumBlocks (1 << 6)
-#define kMtBtNumBlocksMask (kMtBtNumBlocks - 1)
-
-typedef struct _CMtSync
-{
- Bool wasCreated;
- Bool needStart;
- Bool exit;
- Bool stopWriting;
-
- CThread thread;
- CAutoResetEvent canStart;
- CAutoResetEvent wasStarted;
- CAutoResetEvent wasStopped;
- CSemaphore freeSemaphore;
- CSemaphore filledSemaphore;
- Bool csWasInitialized;
- Bool csWasEntered;
- CCriticalSection cs;
- UInt32 numProcessedBlocks;
-} CMtSync;
-
-typedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances);
-
-/* kMtCacheLineDummy must be >= size_of_CPU_cache_line */
-#define kMtCacheLineDummy 128
-
-typedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos,
- UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc);
-
-typedef struct _CMatchFinderMt
-{
- /* LZ */
- const Byte *pointerToCurPos;
- UInt32 *btBuf;
- UInt32 btBufPos;
- UInt32 btBufPosLimit;
- UInt32 lzPos;
- UInt32 btNumAvailBytes;
-
- UInt32 *hash;
- UInt32 fixedHashSize;
- UInt32 historySize;
- const UInt32 *crc;
-
- Mf_Mix_Matches MixMatchesFunc;
-
- /* LZ + BT */
- CMtSync btSync;
- Byte btDummy[kMtCacheLineDummy];
-
- /* BT */
- UInt32 *hashBuf;
- UInt32 hashBufPos;
- UInt32 hashBufPosLimit;
- UInt32 hashNumAvail;
-
- CLzRef *son;
- UInt32 matchMaxLen;
- UInt32 numHashBytes;
- UInt32 pos;
- Byte *buffer;
- UInt32 cyclicBufferPos;
- UInt32 cyclicBufferSize; /* it must be historySize + 1 */
- UInt32 cutValue;
-
- /* BT + Hash */
- CMtSync hashSync;
- /* Byte hashDummy[kMtCacheLineDummy]; */
-
- /* Hash */
- Mf_GetHeads GetHeadsFunc;
- CMatchFinder *MatchFinder;
-} CMatchFinderMt;
-
-void MatchFinderMt_Construct(CMatchFinderMt *p);
-void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc);
-SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore,
- UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc);
-void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable);
-void MatchFinderMt_ReleaseStream(CMatchFinderMt *p);
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzHash.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzHash.h
deleted file mode 100644
index c923417501..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzHash.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* LzHash.h -- HASH functions for LZ algorithms
-2008-10-04 : Igor Pavlov : Public domain */
-
-#ifndef __LZHASH_H
-#define __LZHASH_H
-
-#define kHash2Size (1 << 10)
-#define kHash3Size (1 << 16)
-#define kHash4Size (1 << 20)
-
-#define kFix3HashSize (kHash2Size)
-#define kFix4HashSize (kHash2Size + kHash3Size)
-#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
-
-#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8);
-
-#define HASH3_CALC { \
- UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
- hash2Value = temp & (kHash2Size - 1); \
- hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
-
-#define HASH4_CALC { \
- UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
- hash2Value = temp & (kHash2Size - 1); \
- hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
- hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; }
-
-#define HASH5_CALC { \
- UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
- hash2Value = temp & (kHash2Size - 1); \
- hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
- hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \
- hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \
- hash4Value &= (kHash4Size - 1); }
-
-/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
-#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
-
-
-#define MT_HASH2_CALC \
- hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);
-
-#define MT_HASH3_CALC { \
- UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
- hash2Value = temp & (kHash2Size - 1); \
- hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }
-
-#define MT_HASH4_CALC { \
- UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
- hash2Value = temp & (kHash2Size - 1); \
- hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
- hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c
deleted file mode 100644
index eb5250174b..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.c
+++ /dev/null
@@ -1,1007 +0,0 @@
-/* LzmaDec.c -- LZMA Decoder
-2008-11-06 : Igor Pavlov : Public domain */
-
-#include "LzmaDec.h"
-
-#include <string.h>
-
-#define kNumTopBits 24
-#define kTopValue ((UInt32)1 << kNumTopBits)
-
-#define kNumBitModelTotalBits 11
-#define kBitModelTotal (1 << kNumBitModelTotalBits)
-#define kNumMoveBits 5
-
-#define RC_INIT_SIZE 5
-
-#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
-
-#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
-#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
-#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
-#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
- { UPDATE_0(p); i = (i + i); A0; } else \
- { UPDATE_1(p); i = (i + i) + 1; A1; }
-#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)
-
-#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }
-#define TREE_DECODE(probs, limit, i) \
- { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
-
-/* #define _LZMA_SIZE_OPT */
-
-#ifdef _LZMA_SIZE_OPT
-#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
-#else
-#define TREE_6_DECODE(probs, i) \
- { i = 1; \
- TREE_GET_BIT(probs, i); \
- TREE_GET_BIT(probs, i); \
- TREE_GET_BIT(probs, i); \
- TREE_GET_BIT(probs, i); \
- TREE_GET_BIT(probs, i); \
- TREE_GET_BIT(probs, i); \
- i -= 0x40; }
-#endif
-
-#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
-
-#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
-#define UPDATE_0_CHECK range = bound;
-#define UPDATE_1_CHECK range -= bound; code -= bound;
-#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
- { UPDATE_0_CHECK; i = (i + i); A0; } else \
- { UPDATE_1_CHECK; i = (i + i) + 1; A1; }
-#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
-#define TREE_DECODE_CHECK(probs, limit, i) \
- { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
-
-
-#define kNumPosBitsMax 4
-#define kNumPosStatesMax (1 << kNumPosBitsMax)
-
-#define kLenNumLowBits 3
-#define kLenNumLowSymbols (1 << kLenNumLowBits)
-#define kLenNumMidBits 3
-#define kLenNumMidSymbols (1 << kLenNumMidBits)
-#define kLenNumHighBits 8
-#define kLenNumHighSymbols (1 << kLenNumHighBits)
-
-#define LenChoice 0
-#define LenChoice2 (LenChoice + 1)
-#define LenLow (LenChoice2 + 1)
-#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
-#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
-#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
-
-
-#define kNumStates 12
-#define kNumLitStates 7
-
-#define kStartPosModelIndex 4
-#define kEndPosModelIndex 14
-#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
-
-#define kNumPosSlotBits 6
-#define kNumLenToPosStates 4
-
-#define kNumAlignBits 4
-#define kAlignTableSize (1 << kNumAlignBits)
-
-#define kMatchMinLen 2
-#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
-
-#define IsMatch 0
-#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
-#define IsRepG0 (IsRep + kNumStates)
-#define IsRepG1 (IsRepG0 + kNumStates)
-#define IsRepG2 (IsRepG1 + kNumStates)
-#define IsRep0Long (IsRepG2 + kNumStates)
-#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
-#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
-#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
-#define LenCoder (Align + kAlignTableSize)
-#define RepLenCoder (LenCoder + kNumLenProbs)
-#define Literal (RepLenCoder + kNumLenProbs)
-
-#define LZMA_BASE_SIZE 1846
-#define LZMA_LIT_SIZE 768
-
-#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
-
-#if Literal != LZMA_BASE_SIZE
-StopCompilingDueBUG
-#endif
-
-static const Byte kLiteralNextStates[kNumStates * 2] =
-{
- 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5,
- 7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10
-};
-
-#define LZMA_DIC_MIN (1 << 12)
-
-/* First LZMA-symbol is always decoded.
-And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization
-Out:
- Result:
- SZ_OK - OK
- SZ_ERROR_DATA - Error
- p->remainLen:
- < kMatchSpecLenStart : normal remain
- = kMatchSpecLenStart : finished
- = kMatchSpecLenStart + 1 : Flush marker
- = kMatchSpecLenStart + 2 : State Init Marker
-*/
-
-static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
-{
- CLzmaProb *probs = p->probs;
-
- unsigned state = p->state;
- UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
- unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;
- unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1;
- unsigned lc = p->prop.lc;
-
- Byte *dic = p->dic;
- SizeT dicBufSize = p->dicBufSize;
- SizeT dicPos = p->dicPos;
-
- UInt32 processedPos = p->processedPos;
- UInt32 checkDicSize = p->checkDicSize;
- unsigned len = 0;
-
- const Byte *buf = p->buf;
- UInt32 range = p->range;
- UInt32 code = p->code;
-
- do
- {
- CLzmaProb *prob;
- UInt32 bound;
- unsigned ttt;
- unsigned posState = processedPos & pbMask;
-
- prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
- IF_BIT_0(prob)
- {
- unsigned symbol;
- UPDATE_0(prob);
- prob = probs + Literal;
- if (checkDicSize != 0 || processedPos != 0)
- prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) +
- (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc))));
-
- if (state < kNumLitStates)
- {
- symbol = 1;
- do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100);
- }
- else
- {
- unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
- unsigned offs = 0x100;
- symbol = 1;
- do
- {
- unsigned bit;
- CLzmaProb *probLit;
- matchByte <<= 1;
- bit = (matchByte & offs);
- probLit = prob + offs + bit + symbol;
- GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit)
- }
- while (symbol < 0x100);
- }
- dic[dicPos++] = (Byte)symbol;
- processedPos++;
-
- state = kLiteralNextStates[state];
- /* if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; */
- continue;
- }
- else
- {
- UPDATE_1(prob);
- prob = probs + IsRep + state;
- IF_BIT_0(prob)
- {
- UPDATE_0(prob);
- state += kNumStates;
- prob = probs + LenCoder;
- }
- else
- {
- UPDATE_1(prob);
- if (checkDicSize == 0 && processedPos == 0)
- return SZ_ERROR_DATA;
- prob = probs + IsRepG0 + state;
- IF_BIT_0(prob)
- {
- UPDATE_0(prob);
- prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;
- IF_BIT_0(prob)
- {
- UPDATE_0(prob);
- dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
- dicPos++;
- processedPos++;
- state = state < kNumLitStates ? 9 : 11;
- continue;
- }
- UPDATE_1(prob);
- }
- else
- {
- UInt32 distance;
- UPDATE_1(prob);
- prob = probs + IsRepG1 + state;
- IF_BIT_0(prob)
- {
- UPDATE_0(prob);
- distance = rep1;
- }
- else
- {
- UPDATE_1(prob);
- prob = probs + IsRepG2 + state;
- IF_BIT_0(prob)
- {
- UPDATE_0(prob);
- distance = rep2;
- }
- else
- {
- UPDATE_1(prob);
- distance = rep3;
- rep3 = rep2;
- }
- rep2 = rep1;
- }
- rep1 = rep0;
- rep0 = distance;
- }
- state = state < kNumLitStates ? 8 : 11;
- prob = probs + RepLenCoder;
- }
- {
- unsigned limit, offset;
- CLzmaProb *probLen = prob + LenChoice;
- IF_BIT_0(probLen)
- {
- UPDATE_0(probLen);
- probLen = prob + LenLow + (posState << kLenNumLowBits);
- offset = 0;
- limit = (1 << kLenNumLowBits);
- }
- else
- {
- UPDATE_1(probLen);
- probLen = prob + LenChoice2;
- IF_BIT_0(probLen)
- {
- UPDATE_0(probLen);
- probLen = prob + LenMid + (posState << kLenNumMidBits);
- offset = kLenNumLowSymbols;
- limit = (1 << kLenNumMidBits);
- }
- else
- {
- UPDATE_1(probLen);
- probLen = prob + LenHigh;
- offset = kLenNumLowSymbols + kLenNumMidSymbols;
- limit = (1 << kLenNumHighBits);
- }
- }
- TREE_DECODE(probLen, limit, len);
- len += offset;
- }
-
- if (state >= kNumStates)
- {
- UInt32 distance;
- prob = probs + PosSlot +
- ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);
- TREE_6_DECODE(prob, distance);
- if (distance >= kStartPosModelIndex)
- {
- unsigned posSlot = (unsigned)distance;
- int numDirectBits = (int)(((distance >> 1) - 1));
- distance = (2 | (distance & 1));
- if (posSlot < kEndPosModelIndex)
- {
- distance <<= numDirectBits;
- prob = probs + SpecPos + distance - posSlot - 1;
- {
- UInt32 mask = 1;
- unsigned i = 1;
- do
- {
- GET_BIT2(prob + i, i, ; , distance |= mask);
- mask <<= 1;
- }
- while (--numDirectBits != 0);
- }
- }
- else
- {
- numDirectBits -= kNumAlignBits;
- do
- {
- NORMALIZE
- range >>= 1;
-
- {
- UInt32 t;
- code -= range;
- t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */
- distance = (distance << 1) + (t + 1);
- code += range & t;
- }
- /*
- distance <<= 1;
- if (code >= range)
- {
- code -= range;
- distance |= 1;
- }
- */
- }
- while (--numDirectBits != 0);
- prob = probs + Align;
- distance <<= kNumAlignBits;
- {
- unsigned i = 1;
- GET_BIT2(prob + i, i, ; , distance |= 1);
- GET_BIT2(prob + i, i, ; , distance |= 2);
- GET_BIT2(prob + i, i, ; , distance |= 4);
- GET_BIT2(prob + i, i, ; , distance |= 8);
- }
- if (distance == (UInt32)0xFFFFFFFF)
- {
- len += kMatchSpecLenStart;
- state -= kNumStates;
- break;
- }
- }
- }
- rep3 = rep2;
- rep2 = rep1;
- rep1 = rep0;
- rep0 = distance + 1;
- if (checkDicSize == 0)
- {
- if (distance >= processedPos)
- return SZ_ERROR_DATA;
- }
- else if (distance >= checkDicSize)
- return SZ_ERROR_DATA;
- state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
- /* state = kLiteralNextStates[state]; */
- }
-
- len += kMatchMinLen;
-
- if (limit == dicPos)
- return SZ_ERROR_DATA;
- {
- SizeT rem = limit - dicPos;
- unsigned curLen = ((rem < len) ? (unsigned)rem : len);
- SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0);
-
- processedPos += curLen;
-
- len -= curLen;
- if (pos + curLen <= dicBufSize)
- {
- Byte *dest = dic + dicPos;
- ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;
- const Byte *lim = dest + curLen;
- dicPos += curLen;
- do
- *(dest) = (Byte)*(dest + src);
- while (++dest != lim);
- }
- else
- {
- do
- {
- dic[dicPos++] = dic[pos];
- if (++pos == dicBufSize)
- pos = 0;
- }
- while (--curLen != 0);
- }
- }
- }
- }
- while (dicPos < limit && buf < bufLimit);
- NORMALIZE;
- p->buf = buf;
- p->range = range;
- p->code = code;
- p->remainLen = len;
- p->dicPos = dicPos;
- p->processedPos = processedPos;
- p->reps[0] = rep0;
- p->reps[1] = rep1;
- p->reps[2] = rep2;
- p->reps[3] = rep3;
- p->state = state;
-
- return SZ_OK;
-}
-
-static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit)
-{
- if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart)
- {
- Byte *dic = p->dic;
- SizeT dicPos = p->dicPos;
- SizeT dicBufSize = p->dicBufSize;
- unsigned len = p->remainLen;
- UInt32 rep0 = p->reps[0];
- if (limit - dicPos < len)
- len = (unsigned)(limit - dicPos);
-
- if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)
- p->checkDicSize = p->prop.dicSize;
-
- p->processedPos += len;
- p->remainLen -= len;
- while (len-- != 0)
- {
- dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
- dicPos++;
- }
- p->dicPos = dicPos;
- }
-}
-
-static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
-{
- do
- {
- SizeT limit2 = limit;
- if (p->checkDicSize == 0)
- {
- UInt32 rem = p->prop.dicSize - p->processedPos;
- if (limit - p->dicPos > rem)
- limit2 = p->dicPos + rem;
- }
- RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit));
- if (p->processedPos >= p->prop.dicSize)
- p->checkDicSize = p->prop.dicSize;
- LzmaDec_WriteRem(p, limit);
- }
- while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart);
-
- if (p->remainLen > kMatchSpecLenStart)
- {
- p->remainLen = kMatchSpecLenStart;
- }
- return 0;
-}
-
-typedef enum
-{
- DUMMY_ERROR, /* unexpected end of input stream */
- DUMMY_LIT,
- DUMMY_MATCH,
- DUMMY_REP
-} ELzmaDummy;
-
-static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)
-{
- UInt32 range = p->range;
- UInt32 code = p->code;
- const Byte *bufLimit = buf + inSize;
- CLzmaProb *probs = p->probs;
- unsigned state = p->state;
- ELzmaDummy res;
-
- {
- CLzmaProb *prob;
- UInt32 bound;
- unsigned ttt;
- unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1);
-
- prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
- IF_BIT_0_CHECK(prob)
- {
- UPDATE_0_CHECK
-
- /* if (bufLimit - buf >= 7) return DUMMY_LIT; */
-
- prob = probs + Literal;
- if (p->checkDicSize != 0 || p->processedPos != 0)
- prob += (LZMA_LIT_SIZE *
- ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +
- (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));
-
- if (state < kNumLitStates)
- {
- unsigned symbol = 1;
- do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100);
- }
- else
- {
- unsigned matchByte = p->dic[p->dicPos - p->reps[0] +
- ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)];
- unsigned offs = 0x100;
- unsigned symbol = 1;
- do
- {
- unsigned bit;
- CLzmaProb *probLit;
- matchByte <<= 1;
- bit = (matchByte & offs);
- probLit = prob + offs + bit + symbol;
- GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit)
- }
- while (symbol < 0x100);
- }
- res = DUMMY_LIT;
- }
- else
- {
- unsigned len;
- UPDATE_1_CHECK;
-
- prob = probs + IsRep + state;
- IF_BIT_0_CHECK(prob)
- {
- UPDATE_0_CHECK;
- state = 0;
- prob = probs + LenCoder;
- res = DUMMY_MATCH;
- }
- else
- {
- UPDATE_1_CHECK;
- res = DUMMY_REP;
- prob = probs + IsRepG0 + state;
- IF_BIT_0_CHECK(prob)
- {
- UPDATE_0_CHECK;
- prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;
- IF_BIT_0_CHECK(prob)
- {
- UPDATE_0_CHECK;
- NORMALIZE_CHECK;
- return DUMMY_REP;
- }
- else
- {
- UPDATE_1_CHECK;
- }
- }
- else
- {
- UPDATE_1_CHECK;
- prob = probs + IsRepG1 + state;
- IF_BIT_0_CHECK(prob)
- {
- UPDATE_0_CHECK;
- }
- else
- {
- UPDATE_1_CHECK;
- prob = probs + IsRepG2 + state;
- IF_BIT_0_CHECK(prob)
- {
- UPDATE_0_CHECK;
- }
- else
- {
- UPDATE_1_CHECK;
- }
- }
- }
- state = kNumStates;
- prob = probs + RepLenCoder;
- }
- {
- unsigned limit, offset;
- CLzmaProb *probLen = prob + LenChoice;
- IF_BIT_0_CHECK(probLen)
- {
- UPDATE_0_CHECK;
- probLen = prob + LenLow + (posState << kLenNumLowBits);
- offset = 0;
- limit = 1 << kLenNumLowBits;
- }
- else
- {
- UPDATE_1_CHECK;
- probLen = prob + LenChoice2;
- IF_BIT_0_CHECK(probLen)
- {
- UPDATE_0_CHECK;
- probLen = prob + LenMid + (posState << kLenNumMidBits);
- offset = kLenNumLowSymbols;
- limit = 1 << kLenNumMidBits;
- }
- else
- {
- UPDATE_1_CHECK;
- probLen = prob + LenHigh;
- offset = kLenNumLowSymbols + kLenNumMidSymbols;
- limit = 1 << kLenNumHighBits;
- }
- }
- TREE_DECODE_CHECK(probLen, limit, len);
- len += offset;
- }
-
- if (state < 4)
- {
- unsigned posSlot;
- prob = probs + PosSlot +
- ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
- kNumPosSlotBits);
- TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot);
- if (posSlot >= kStartPosModelIndex)
- {
- int numDirectBits = ((posSlot >> 1) - 1);
-
- /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */
-
- if (posSlot < kEndPosModelIndex)
- {
- prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1;
- }
- else
- {
- numDirectBits -= kNumAlignBits;
- do
- {
- NORMALIZE_CHECK
- range >>= 1;
- code -= range & (((code - range) >> 31) - 1);
- /* if (code >= range) code -= range; */
- }
- while (--numDirectBits != 0);
- prob = probs + Align;
- numDirectBits = kNumAlignBits;
- }
- {
- unsigned i = 1;
- do
- {
- GET_BIT_CHECK(prob + i, i);
- }
- while (--numDirectBits != 0);
- }
- }
- }
- }
- }
- NORMALIZE_CHECK;
- return res;
-}
-
-
-static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data)
-{
- p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]);
- p->range = 0xFFFFFFFF;
- p->needFlush = 0;
-}
-
-void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState)
-{
- p->needFlush = 1;
- p->remainLen = 0;
- p->tempBufSize = 0;
-
- if (initDic)
- {
- p->processedPos = 0;
- p->checkDicSize = 0;
- p->needInitState = 1;
- }
- if (initState)
- p->needInitState = 1;
-}
-
-void LzmaDec_Init(CLzmaDec *p)
-{
- p->dicPos = 0;
- LzmaDec_InitDicAndState(p, True, True);
-}
-
-static void LzmaDec_InitStateReal(CLzmaDec *p)
-{
- UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp));
- UInt32 i;
- CLzmaProb *probs = p->probs;
- for (i = 0; i < numProbs; i++)
- probs[i] = kBitModelTotal >> 1;
- p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1;
- p->state = 0;
- p->needInitState = 0;
-}
-
-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
- ELzmaFinishMode finishMode, ELzmaStatus *status)
-{
- SizeT inSize = *srcLen;
- (*srcLen) = 0;
- LzmaDec_WriteRem(p, dicLimit);
-
- *status = LZMA_STATUS_NOT_SPECIFIED;
-
- while (p->remainLen != kMatchSpecLenStart)
- {
- int checkEndMarkNow;
-
- if (p->needFlush != 0)
- {
- for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--)
- p->tempBuf[p->tempBufSize++] = *src++;
- if (p->tempBufSize < RC_INIT_SIZE)
- {
- *status = LZMA_STATUS_NEEDS_MORE_INPUT;
- return SZ_OK;
- }
- if (p->tempBuf[0] != 0)
- return SZ_ERROR_DATA;
-
- LzmaDec_InitRc(p, p->tempBuf);
- p->tempBufSize = 0;
- }
-
- checkEndMarkNow = 0;
- if (p->dicPos >= dicLimit)
- {
- if (p->remainLen == 0 && p->code == 0)
- {
- *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK;
- return SZ_OK;
- }
- if (finishMode == LZMA_FINISH_ANY)
- {
- *status = LZMA_STATUS_NOT_FINISHED;
- return SZ_OK;
- }
- if (p->remainLen != 0)
- {
- *status = LZMA_STATUS_NOT_FINISHED;
- return SZ_ERROR_DATA;
- }
- checkEndMarkNow = 1;
- }
-
- if (p->needInitState)
- LzmaDec_InitStateReal(p);
-
- if (p->tempBufSize == 0)
- {
- SizeT processed;
- const Byte *bufLimit;
- if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
- {
- int dummyRes = LzmaDec_TryDummy(p, src, inSize);
- if (dummyRes == DUMMY_ERROR)
- {
- memcpy(p->tempBuf, src, inSize);
- p->tempBufSize = (unsigned)inSize;
- (*srcLen) += inSize;
- *status = LZMA_STATUS_NEEDS_MORE_INPUT;
- return SZ_OK;
- }
- if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
- {
- *status = LZMA_STATUS_NOT_FINISHED;
- return SZ_ERROR_DATA;
- }
- bufLimit = src;
- }
- else
- bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX;
- p->buf = src;
- if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0)
- return SZ_ERROR_DATA;
- processed = (SizeT)(p->buf - src);
- (*srcLen) += processed;
- src += processed;
- inSize -= processed;
- }
- else
- {
- unsigned rem = p->tempBufSize, lookAhead = 0;
- while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize)
- p->tempBuf[rem++] = src[lookAhead++];
- p->tempBufSize = rem;
- if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
- {
- int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem);
- if (dummyRes == DUMMY_ERROR)
- {
- (*srcLen) += lookAhead;
- *status = LZMA_STATUS_NEEDS_MORE_INPUT;
- return SZ_OK;
- }
- if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
- {
- *status = LZMA_STATUS_NOT_FINISHED;
- return SZ_ERROR_DATA;
- }
- }
- p->buf = p->tempBuf;
- if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0)
- return SZ_ERROR_DATA;
- lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf));
- (*srcLen) += lookAhead;
- src += lookAhead;
- inSize -= lookAhead;
- p->tempBufSize = 0;
- }
- }
- if (p->code == 0)
- *status = LZMA_STATUS_FINISHED_WITH_MARK;
- return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA;
-}
-
-SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
-{
- SizeT outSize = *destLen;
- SizeT inSize = *srcLen;
- *srcLen = *destLen = 0;
- for (;;)
- {
- SizeT inSizeCur = inSize, outSizeCur, dicPos;
- ELzmaFinishMode curFinishMode;
- SRes res;
- if (p->dicPos == p->dicBufSize)
- p->dicPos = 0;
- dicPos = p->dicPos;
- if (outSize > p->dicBufSize - dicPos)
- {
- outSizeCur = p->dicBufSize;
- curFinishMode = LZMA_FINISH_ANY;
- }
- else
- {
- outSizeCur = dicPos + outSize;
- curFinishMode = finishMode;
- }
-
- res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status);
- src += inSizeCur;
- inSize -= inSizeCur;
- *srcLen += inSizeCur;
- outSizeCur = p->dicPos - dicPos;
- memcpy(dest, p->dic + dicPos, outSizeCur);
- dest += outSizeCur;
- outSize -= outSizeCur;
- *destLen += outSizeCur;
- if (res != 0)
- return res;
- if (outSizeCur == 0 || outSize == 0)
- return SZ_OK;
- }
-}
-
-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc)
-{
- alloc->Free(alloc, p->probs);
- p->probs = 0;
-}
-
-static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc)
-{
- alloc->Free(alloc, p->dic);
- p->dic = 0;
-}
-
-void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc)
-{
- LzmaDec_FreeProbs(p, alloc);
- LzmaDec_FreeDict(p, alloc);
-}
-
-SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
-{
- UInt32 dicSize;
- Byte d;
-
- if (size < LZMA_PROPS_SIZE)
- return SZ_ERROR_UNSUPPORTED;
- else
- dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);
-
- if (dicSize < LZMA_DIC_MIN)
- dicSize = LZMA_DIC_MIN;
- p->dicSize = dicSize;
-
- d = data[0];
- if (d >= (9 * 5 * 5))
- return SZ_ERROR_UNSUPPORTED;
-
- p->lc = d % 9;
- d /= 9;
- p->pb = d / 5;
- p->lp = d % 5;
-
- return SZ_OK;
-}
-
-static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc)
-{
- UInt32 numProbs = LzmaProps_GetNumProbs(propNew);
- if (p->probs == 0 || numProbs != p->numProbs)
- {
- LzmaDec_FreeProbs(p, alloc);
- p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb));
- p->numProbs = numProbs;
- if (p->probs == 0)
- return SZ_ERROR_MEM;
- }
- return SZ_OK;
-}
-
-SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)
-{
- CLzmaProps propNew;
- RINOK(LzmaProps_Decode(&propNew, props, propsSize));
- RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
- p->prop = propNew;
- return SZ_OK;
-}
-
-SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)
-{
- CLzmaProps propNew;
- SizeT dicBufSize;
- RINOK(LzmaProps_Decode(&propNew, props, propsSize));
- RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
- dicBufSize = propNew.dicSize;
- if (p->dic == 0 || dicBufSize != p->dicBufSize)
- {
- LzmaDec_FreeDict(p, alloc);
- p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize);
- if (p->dic == 0)
- {
- LzmaDec_FreeProbs(p, alloc);
- return SZ_ERROR_MEM;
- }
- }
- p->dicBufSize = dicBufSize;
- p->prop = propNew;
- return SZ_OK;
-}
-
-SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
- const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
- ELzmaStatus *status, ISzAlloc *alloc)
-{
- CLzmaDec p;
- SRes res;
- SizeT inSize = *srcLen;
- SizeT outSize = *destLen;
- *srcLen = *destLen = 0;
- if (inSize < RC_INIT_SIZE)
- return SZ_ERROR_INPUT_EOF;
-
- LzmaDec_Construct(&p);
- res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc);
- if (res != 0)
- return res;
- p.dic = dest;
- p.dicBufSize = outSize;
-
- LzmaDec_Init(&p);
-
- *srcLen = inSize;
- res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);
-
- if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)
- res = SZ_ERROR_INPUT_EOF;
-
- (*destLen) = p.dicPos;
- LzmaDec_FreeProbs(&p, alloc);
- return res;
-}
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.h
deleted file mode 100644
index ad7d7057a4..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaDec.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/* LzmaDec.h -- LZMA Decoder
-2008-10-04 : Igor Pavlov : Public domain */
-
-#ifndef __LZMADEC_H
-#define __LZMADEC_H
-
-#include "Types.h"
-
-/* #define _LZMA_PROB32 */
-/* _LZMA_PROB32 can increase the speed on some CPUs,
- but memory usage for CLzmaDec::probs will be doubled in that case */
-
-#ifdef _LZMA_PROB32
-#define CLzmaProb UInt32
-#else
-#define CLzmaProb UInt16
-#endif
-
-
-/* ---------- LZMA Properties ---------- */
-
-#define LZMA_PROPS_SIZE 5
-
-typedef struct _CLzmaProps
-{
- unsigned lc, lp, pb;
- UInt32 dicSize;
-} CLzmaProps;
-
-/* LzmaProps_Decode - decodes properties
-Returns:
- SZ_OK
- SZ_ERROR_UNSUPPORTED - Unsupported properties
-*/
-
-SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
-
-
-/* ---------- LZMA Decoder state ---------- */
-
-/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
- Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
-
-#define LZMA_REQUIRED_INPUT_MAX 20
-
-typedef struct
-{
- CLzmaProps prop;
- CLzmaProb *probs;
- Byte *dic;
- const Byte *buf;
- UInt32 range, code;
- SizeT dicPos;
- SizeT dicBufSize;
- UInt32 processedPos;
- UInt32 checkDicSize;
- unsigned state;
- UInt32 reps[4];
- unsigned remainLen;
- int needFlush;
- int needInitState;
- UInt32 numProbs;
- unsigned tempBufSize;
- Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
-} CLzmaDec;
-
-#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
-
-void LzmaDec_Init(CLzmaDec *p);
-
-/* There are two types of LZMA streams:
- 0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
- 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */
-
-typedef enum
-{
- LZMA_FINISH_ANY, /* finish at any point */
- LZMA_FINISH_END /* block must be finished at the end */
-} ELzmaFinishMode;
-
-/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
-
- You must use LZMA_FINISH_END, when you know that current output buffer
- covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
-
- If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
- and output value of destLen will be less than output buffer size limit.
- You can check status result also.
-
- You can use multiple checks to test data integrity after full decompression:
- 1) Check Result and "status" variable.
- 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
- 3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
- You must use correct finish mode in that case. */
-
-typedef enum
-{
- LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */
- LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
- LZMA_STATUS_NOT_FINISHED, /* stream was not finished */
- LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */
- LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */
-} ELzmaStatus;
-
-/* ELzmaStatus is used only as output value for function call */
-
-
-/* ---------- Interfaces ---------- */
-
-/* There are 3 levels of interfaces:
- 1) Dictionary Interface
- 2) Buffer Interface
- 3) One Call Interface
- You can select any of these interfaces, but don't mix functions from different
- groups for same object. */
-
-
-/* There are two variants to allocate state for Dictionary Interface:
- 1) LzmaDec_Allocate / LzmaDec_Free
- 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
- You can use variant 2, if you set dictionary buffer manually.
- For Buffer Interface you must always use variant 1.
-
-LzmaDec_Allocate* can return:
- SZ_OK
- SZ_ERROR_MEM - Memory allocation error
- SZ_ERROR_UNSUPPORTED - Unsupported properties
-*/
-
-SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
-
-SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
-void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
-
-/* ---------- Dictionary Interface ---------- */
-
-/* You can use it, if you want to eliminate the overhead for data copying from
- dictionary to some other external buffer.
- You must work with CLzmaDec variables directly in this interface.
-
- STEPS:
- LzmaDec_Constr()
- LzmaDec_Allocate()
- for (each new stream)
- {
- LzmaDec_Init()
- while (it needs more decompression)
- {
- LzmaDec_DecodeToDic()
- use data from CLzmaDec::dic and update CLzmaDec::dicPos
- }
- }
- LzmaDec_Free()
-*/
-
-/* LzmaDec_DecodeToDic
-
- The decoding to internal dictionary buffer (CLzmaDec::dic).
- You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
-
-finishMode:
- It has meaning only if the decoding reaches output limit (dicLimit).
- LZMA_FINISH_ANY - Decode just dicLimit bytes.
- LZMA_FINISH_END - Stream must be finished after dicLimit.
-
-Returns:
- SZ_OK
- status:
- LZMA_STATUS_FINISHED_WITH_MARK
- LZMA_STATUS_NOT_FINISHED
- LZMA_STATUS_NEEDS_MORE_INPUT
- LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
- SZ_ERROR_DATA - Data error
-*/
-
-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
- const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
-
-
-/* ---------- Buffer Interface ---------- */
-
-/* It's zlib-like interface.
- See LzmaDec_DecodeToDic description for information about STEPS and return results,
- but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
- to work with CLzmaDec variables manually.
-
-finishMode:
- It has meaning only if the decoding reaches output limit (*destLen).
- LZMA_FINISH_ANY - Decode just destLen bytes.
- LZMA_FINISH_END - Stream must be finished after (*destLen).
-*/
-
-SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
- const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
-
-
-/* ---------- One Call Interface ---------- */
-
-/* LzmaDecode
-
-finishMode:
- It has meaning only if the decoding reaches output limit (*destLen).
- LZMA_FINISH_ANY - Decode just destLen bytes.
- LZMA_FINISH_END - Stream must be finished after (*destLen).
-
-Returns:
- SZ_OK
- status:
- LZMA_STATUS_FINISHED_WITH_MARK
- LZMA_STATUS_NOT_FINISHED
- LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
- SZ_ERROR_DATA - Data error
- SZ_ERROR_MEM - Memory allocation error
- SZ_ERROR_UNSUPPORTED - Unsupported properties
- SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
-*/
-
-SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
- const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
- ELzmaStatus *status, ISzAlloc *alloc);
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
deleted file mode 100644
index 7272272784..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.c
+++ /dev/null
@@ -1,2296 +0,0 @@
-/** @file
- Based on LZMA SDK 4.65:
- LzmaEnc.c -- LZMA Encoder
- 2009-02-02 : Igor Pavlov : Public domain
-
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <string.h>
-
-/* #define SHOW_STAT */
-/* #define SHOW_STAT2 */
-
-#if defined(SHOW_STAT) || defined(SHOW_STAT2)
-#include <stdio.h>
-#endif
-
-#include "LzmaEnc.h"
-
-#include "LzFind.h"
-#ifdef COMPRESS_MF_MT
-#include "LzFindMt.h"
-#endif
-
-#ifdef SHOW_STAT
-static int ttt = 0;
-#endif
-
-#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1)
-
-#define kBlockSize (9 << 10)
-#define kUnpackBlockSize (1 << 18)
-#define kMatchArraySize (1 << 21)
-#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX)
-
-#define kNumMaxDirectBits (31)
-
-#define kNumTopBits 24
-#define kTopValue ((UInt32)1 << kNumTopBits)
-
-#define kNumBitModelTotalBits 11
-#define kBitModelTotal (1 << kNumBitModelTotalBits)
-#define kNumMoveBits 5
-#define kProbInitValue (kBitModelTotal >> 1)
-
-#define kNumMoveReducingBits 4
-#define kNumBitPriceShiftBits 4
-#define kBitPrice (1 << kNumBitPriceShiftBits)
-
-void LzmaEncProps_Init(CLzmaEncProps *p)
-{
- p->level = 5;
- p->dictSize = p->mc = 0;
- p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1;
- p->writeEndMark = 0;
-}
-
-void LzmaEncProps_Normalize(CLzmaEncProps *p)
-{
- int level = p->level;
- if (level < 0) level = 5;
- p->level = level;
- if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26)));
- if (p->lc < 0) p->lc = 3;
- if (p->lp < 0) p->lp = 0;
- if (p->pb < 0) p->pb = 2;
- if (p->algo < 0) p->algo = (level < 5 ? 0 : 1);
- if (p->fb < 0) p->fb = (level < 7 ? 32 : 64);
- if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1);
- if (p->numHashBytes < 0) p->numHashBytes = 4;
- if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1);
- if (p->numThreads < 0)
- p->numThreads =
- #ifdef COMPRESS_MF_MT
- ((p->btMode && p->algo) ? 2 : 1);
- #else
- 1;
- #endif
-}
-
-UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2)
-{
- CLzmaEncProps props = *props2;
- LzmaEncProps_Normalize(&props);
- return props.dictSize;
-}
-
-/* #define LZMA_LOG_BSR */
-/* Define it for Intel's CPU */
-
-
-#ifdef LZMA_LOG_BSR
-
-#define kDicLogSizeMaxCompress 30
-
-#define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); }
-
-UInt32 GetPosSlot1(UInt32 pos)
-{
- UInt32 res;
- BSR2_RET(pos, res);
- return res;
-}
-#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }
-#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); }
-
-#else
-
-#define kNumLogBits (9 + (int)sizeof(size_t) / 2)
-#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7)
-
-void LzmaEnc_FastPosInit(Byte *g_FastPos)
-{
- int c = 2, slotFast;
- g_FastPos[0] = 0;
- g_FastPos[1] = 1;
-
- for (slotFast = 2; slotFast < kNumLogBits * 2; slotFast++)
- {
- UInt32 k = (1 << ((slotFast >> 1) - 1));
- UInt32 j;
- for (j = 0; j < k; j++, c++)
- g_FastPos[c] = (Byte)slotFast;
- }
-}
-
-#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \
- (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \
- res = p->g_FastPos[pos >> i] + (i * 2); }
-/*
-#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \
- p->g_FastPos[pos >> 6] + 12 : \
- p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; }
-*/
-
-#define GetPosSlot1(pos) p->g_FastPos[pos]
-#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }
-#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); }
-
-#endif
-
-
-#define LZMA_NUM_REPS 4
-
-typedef unsigned CState;
-
-typedef struct _COptimal
-{
- UInt32 price;
-
- CState state;
- int prev1IsChar;
- int prev2;
-
- UInt32 posPrev2;
- UInt32 backPrev2;
-
- UInt32 posPrev;
- UInt32 backPrev;
- UInt32 backs[LZMA_NUM_REPS];
-} COptimal;
-
-#define kNumOpts (1 << 12)
-
-#define kNumLenToPosStates 4
-#define kNumPosSlotBits 6
-#define kDicLogSizeMin 0
-#define kDicLogSizeMax 32
-#define kDistTableSizeMax (kDicLogSizeMax * 2)
-
-
-#define kNumAlignBits 4
-#define kAlignTableSize (1 << kNumAlignBits)
-#define kAlignMask (kAlignTableSize - 1)
-
-#define kStartPosModelIndex 4
-#define kEndPosModelIndex 14
-#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex)
-
-#define kNumFullDistances (1 << (kEndPosModelIndex / 2))
-
-#ifdef _LZMA_PROB32
-#define CLzmaProb UInt32
-#else
-#define CLzmaProb UInt16
-#endif
-
-#define LZMA_PB_MAX 4
-#define LZMA_LC_MAX 8
-#define LZMA_LP_MAX 4
-
-#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX)
-
-
-#define kLenNumLowBits 3
-#define kLenNumLowSymbols (1 << kLenNumLowBits)
-#define kLenNumMidBits 3
-#define kLenNumMidSymbols (1 << kLenNumMidBits)
-#define kLenNumHighBits 8
-#define kLenNumHighSymbols (1 << kLenNumHighBits)
-
-#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
-
-#define LZMA_MATCH_LEN_MIN 2
-#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1)
-
-#define kNumStates 12
-
-typedef struct
-{
- CLzmaProb choice;
- CLzmaProb choice2;
- CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits];
- CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits];
- CLzmaProb high[kLenNumHighSymbols];
-} CLenEnc;
-
-typedef struct
-{
- CLenEnc p;
- UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal];
- UInt32 tableSize;
- UInt32 counters[LZMA_NUM_PB_STATES_MAX];
-} CLenPriceEnc;
-
-typedef struct _CRangeEnc
-{
- UInt32 range;
- Byte cache;
- UInt64 low;
- UInt64 cacheSize;
- Byte *buf;
- Byte *bufLim;
- Byte *bufBase;
- ISeqOutStream *outStream;
- UInt64 processed;
- SRes res;
-} CRangeEnc;
-
-typedef struct _CSeqInStreamBuf
-{
- ISeqInStream funcTable;
- const Byte *data;
- SizeT rem;
-} CSeqInStreamBuf;
-
-static SRes MyRead(void *pp, void *data, size_t *size)
-{
- size_t curSize = *size;
- CSeqInStreamBuf *p = (CSeqInStreamBuf *)pp;
- if (p->rem < curSize)
- curSize = p->rem;
- memcpy(data, p->data, curSize);
- p->rem -= curSize;
- p->data += curSize;
- *size = curSize;
- return SZ_OK;
-}
-
-typedef struct
-{
- CLzmaProb *litProbs;
-
- CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];
- CLzmaProb isRep[kNumStates];
- CLzmaProb isRepG0[kNumStates];
- CLzmaProb isRepG1[kNumStates];
- CLzmaProb isRepG2[kNumStates];
- CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];
-
- CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];
- CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex];
- CLzmaProb posAlignEncoder[1 << kNumAlignBits];
-
- CLenPriceEnc lenEnc;
- CLenPriceEnc repLenEnc;
-
- UInt32 reps[LZMA_NUM_REPS];
- UInt32 state;
-} CSaveState;
-
-typedef struct _CLzmaEnc
-{
- IMatchFinder matchFinder;
- void *matchFinderObj;
-
- #ifdef COMPRESS_MF_MT
- Bool mtMode;
- CMatchFinderMt matchFinderMt;
- #endif
-
- CMatchFinder matchFinderBase;
-
- #ifdef COMPRESS_MF_MT
- Byte pad[128];
- #endif
-
- UInt32 optimumEndIndex;
- UInt32 optimumCurrentIndex;
-
- UInt32 longestMatchLength;
- UInt32 numPairs;
- UInt32 numAvail;
- COptimal opt[kNumOpts];
-
- #ifndef LZMA_LOG_BSR
- Byte g_FastPos[1 << kNumLogBits];
- #endif
-
- UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits];
- UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1];
- UInt32 numFastBytes;
- UInt32 additionalOffset;
- UInt32 reps[LZMA_NUM_REPS];
- UInt32 state;
-
- UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax];
- UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances];
- UInt32 alignPrices[kAlignTableSize];
- UInt32 alignPriceCount;
-
- UInt32 distTableSize;
-
- unsigned lc, lp, pb;
- unsigned lpMask, pbMask;
-
- CLzmaProb *litProbs;
-
- CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];
- CLzmaProb isRep[kNumStates];
- CLzmaProb isRepG0[kNumStates];
- CLzmaProb isRepG1[kNumStates];
- CLzmaProb isRepG2[kNumStates];
- CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];
-
- CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];
- CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex];
- CLzmaProb posAlignEncoder[1 << kNumAlignBits];
-
- CLenPriceEnc lenEnc;
- CLenPriceEnc repLenEnc;
-
- unsigned lclp;
-
- Bool fastMode;
-
- CRangeEnc rc;
-
- Bool writeEndMark;
- UInt64 nowPos64;
- UInt32 matchPriceCount;
- Bool finished;
- Bool multiThread;
-
- SRes result;
- UInt32 dictSize;
- UInt32 matchFinderCycles;
-
- ISeqInStream *inStream;
- CSeqInStreamBuf seqBufInStream;
-
- CSaveState saveState;
-} CLzmaEnc;
-
-void LzmaEnc_SaveState(CLzmaEncHandle pp)
-{
- CLzmaEnc *p = (CLzmaEnc *)pp;
- CSaveState *dest = &p->saveState;
- int i;
- dest->lenEnc = p->lenEnc;
- dest->repLenEnc = p->repLenEnc;
- dest->state = p->state;
-
- for (i = 0; i < kNumStates; i++)
- {
- memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i]));
- memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i]));
- }
- for (i = 0; i < kNumLenToPosStates; i++)
- memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i]));
- memcpy(dest->isRep, p->isRep, sizeof(p->isRep));
- memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0));
- memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1));
- memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2));
- memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders));
- memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder));
- memcpy(dest->reps, p->reps, sizeof(p->reps));
- memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb));
-}
-
-void LzmaEnc_RestoreState(CLzmaEncHandle pp)
-{
- CLzmaEnc *dest = (CLzmaEnc *)pp;
- const CSaveState *p = &dest->saveState;
- int i;
- dest->lenEnc = p->lenEnc;
- dest->repLenEnc = p->repLenEnc;
- dest->state = p->state;
-
- for (i = 0; i < kNumStates; i++)
- {
- memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i]));
- memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i]));
- }
- for (i = 0; i < kNumLenToPosStates; i++)
- memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i]));
- memcpy(dest->isRep, p->isRep, sizeof(p->isRep));
- memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0));
- memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1));
- memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2));
- memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders));
- memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder));
- memcpy(dest->reps, p->reps, sizeof(p->reps));
- memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb));
-}
-
-SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2)
-{
- CLzmaEnc *p = (CLzmaEnc *)pp;
- CLzmaEncProps props = *props2;
- LzmaEncProps_Normalize(&props);
-
- if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX ||
- props.dictSize > (1 << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30))
- return SZ_ERROR_PARAM;
- p->dictSize = props.dictSize;
- p->matchFinderCycles = props.mc;
- {
- unsigned fb = props.fb;
- if (fb < 5)
- fb = 5;
- if (fb > LZMA_MATCH_LEN_MAX)
- fb = LZMA_MATCH_LEN_MAX;
- p->numFastBytes = fb;
- }
- p->lc = props.lc;
- p->lp = props.lp;
- p->pb = props.pb;
- p->fastMode = (props.algo == 0);
- p->matchFinderBase.btMode = props.btMode;
- {
- UInt32 numHashBytes = 4;
- if (props.btMode)
- {
- if (props.numHashBytes < 2)
- numHashBytes = 2;
- else if (props.numHashBytes < 4)
- numHashBytes = props.numHashBytes;
- }
- p->matchFinderBase.numHashBytes = numHashBytes;
- }
-
- p->matchFinderBase.cutValue = props.mc;
-
- p->writeEndMark = props.writeEndMark;
-
- #ifdef COMPRESS_MF_MT
- /*
- if (newMultiThread != _multiThread)
- {
- ReleaseMatchFinder();
- _multiThread = newMultiThread;
- }
- */
- p->multiThread = (props.numThreads > 1);
- #endif
-
- return SZ_OK;
-}
-
-static const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
-static const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
-static const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
-static const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
-
-#define IsCharState(s) ((s) < 7)
-
-#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1)
-
-#define kInfinityPrice (1 << 30)
-
-static void RangeEnc_Construct(CRangeEnc *p)
-{
- p->outStream = 0;
- p->bufBase = 0;
-}
-
-#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize)
-
-#define RC_BUF_SIZE (1 << 16)
-static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc)
-{
- if (p->bufBase == 0)
- {
- p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE);
- if (p->bufBase == 0)
- return 0;
- p->bufLim = p->bufBase + RC_BUF_SIZE;
- }
- return 1;
-}
-
-static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc)
-{
- alloc->Free(alloc, p->bufBase);
- p->bufBase = 0;
-}
-
-static void RangeEnc_Init(CRangeEnc *p)
-{
- /* Stream.Init(); */
- p->low = 0;
- p->range = 0xFFFFFFFF;
- p->cacheSize = 1;
- p->cache = 0;
-
- p->buf = p->bufBase;
-
- p->processed = 0;
- p->res = SZ_OK;
-}
-
-static void RangeEnc_FlushStream(CRangeEnc *p)
-{
- size_t num;
- if (p->res != SZ_OK)
- return;
- num = p->buf - p->bufBase;
- if (num != p->outStream->Write(p->outStream, p->bufBase, num))
- p->res = SZ_ERROR_WRITE;
- p->processed += num;
- p->buf = p->bufBase;
-}
-
-static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p)
-{
- if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0)
- {
- Byte temp = p->cache;
- do
- {
- Byte *buf = p->buf;
- *buf++ = (Byte)(temp + (Byte)(p->low >> 32));
- p->buf = buf;
- if (buf == p->bufLim)
- RangeEnc_FlushStream(p);
- temp = 0xFF;
- }
- while (--p->cacheSize != 0);
- p->cache = (Byte)((UInt32)p->low >> 24);
- }
- p->cacheSize++;
- p->low = (UInt32)p->low << 8;
-}
-
-static void RangeEnc_FlushData(CRangeEnc *p)
-{
- int i;
- for (i = 0; i < 5; i++)
- RangeEnc_ShiftLow(p);
-}
-
-static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits)
-{
- do
- {
- p->range >>= 1;
- p->low += p->range & (0 - ((value >> --numBits) & 1));
- if (p->range < kTopValue)
- {
- p->range <<= 8;
- RangeEnc_ShiftLow(p);
- }
- }
- while (numBits != 0);
-}
-
-static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol)
-{
- UInt32 ttt = *prob;
- UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt;
- if (symbol == 0)
- {
- p->range = newBound;
- ttt += (kBitModelTotal - ttt) >> kNumMoveBits;
- }
- else
- {
- p->low += newBound;
- p->range -= newBound;
- ttt -= ttt >> kNumMoveBits;
- }
- *prob = (CLzmaProb)ttt;
- if (p->range < kTopValue)
- {
- p->range <<= 8;
- RangeEnc_ShiftLow(p);
- }
-}
-
-static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol)
-{
- symbol |= 0x100;
- do
- {
- RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1);
- symbol <<= 1;
- }
- while (symbol < 0x10000);
-}
-
-static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte)
-{
- UInt32 offs = 0x100;
- symbol |= 0x100;
- do
- {
- matchByte <<= 1;
- RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1);
- symbol <<= 1;
- offs &= ~(matchByte ^ symbol);
- }
- while (symbol < 0x10000);
-}
-
-void LzmaEnc_InitPriceTables(UInt32 *ProbPrices)
-{
- UInt32 i;
- for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits))
- {
- const int kCyclesBits = kNumBitPriceShiftBits;
- UInt32 w = i;
- UInt32 bitCount = 0;
- int j;
- for (j = 0; j < kCyclesBits; j++)
- {
- w = w * w;
- bitCount <<= 1;
- while (w >= ((UInt32)1 << 16))
- {
- w >>= 1;
- bitCount++;
- }
- }
- ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount);
- }
-}
-
-
-#define GET_PRICE(prob, symbol) \
- p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
-
-#define GET_PRICEa(prob, symbol) \
- ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
-
-#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits]
-#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
-
-#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits]
-#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
-
-static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices)
-{
- UInt32 price = 0;
- symbol |= 0x100;
- do
- {
- price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1);
- symbol <<= 1;
- }
- while (symbol < 0x10000);
- return price;
-}
-
-static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices)
-{
- UInt32 price = 0;
- UInt32 offs = 0x100;
- symbol |= 0x100;
- do
- {
- matchByte <<= 1;
- price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1);
- symbol <<= 1;
- offs &= ~(matchByte ^ symbol);
- }
- while (symbol < 0x10000);
- return price;
-}
-
-
-static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)
-{
- UInt32 m = 1;
- int i;
- for (i = numBitLevels; i != 0;)
- {
- UInt32 bit;
- i--;
- bit = (symbol >> i) & 1;
- RangeEnc_EncodeBit(rc, probs + m, bit);
- m = (m << 1) | bit;
- }
-}
-
-static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)
-{
- UInt32 m = 1;
- int i;
- for (i = 0; i < numBitLevels; i++)
- {
- UInt32 bit = symbol & 1;
- RangeEnc_EncodeBit(rc, probs + m, bit);
- m = (m << 1) | bit;
- symbol >>= 1;
- }
-}
-
-static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)
-{
- UInt32 price = 0;
- symbol |= (1 << numBitLevels);
- while (symbol != 1)
- {
- price += GET_PRICEa(probs[symbol >> 1], symbol & 1);
- symbol >>= 1;
- }
- return price;
-}
-
-static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)
-{
- UInt32 price = 0;
- UInt32 m = 1;
- int i;
- for (i = numBitLevels; i != 0; i--)
- {
- UInt32 bit = symbol & 1;
- symbol >>= 1;
- price += GET_PRICEa(probs[m], bit);
- m = (m << 1) | bit;
- }
- return price;
-}
-
-
-static void LenEnc_Init(CLenEnc *p)
-{
- unsigned i;
- p->choice = p->choice2 = kProbInitValue;
- for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++)
- p->low[i] = kProbInitValue;
- for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++)
- p->mid[i] = kProbInitValue;
- for (i = 0; i < kLenNumHighSymbols; i++)
- p->high[i] = kProbInitValue;
-}
-
-static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState)
-{
- if (symbol < kLenNumLowSymbols)
- {
- RangeEnc_EncodeBit(rc, &p->choice, 0);
- RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol);
- }
- else
- {
- RangeEnc_EncodeBit(rc, &p->choice, 1);
- if (symbol < kLenNumLowSymbols + kLenNumMidSymbols)
- {
- RangeEnc_EncodeBit(rc, &p->choice2, 0);
- RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols);
- }
- else
- {
- RangeEnc_EncodeBit(rc, &p->choice2, 1);
- RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols);
- }
- }
-}
-
-static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices)
-{
- UInt32 a0 = GET_PRICE_0a(p->choice);
- UInt32 a1 = GET_PRICE_1a(p->choice);
- UInt32 b0 = a1 + GET_PRICE_0a(p->choice2);
- UInt32 b1 = a1 + GET_PRICE_1a(p->choice2);
- UInt32 i = 0;
- for (i = 0; i < kLenNumLowSymbols; i++)
- {
- if (i >= numSymbols)
- return;
- prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices);
- }
- for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++)
- {
- if (i >= numSymbols)
- return;
- prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices);
- }
- for (; i < numSymbols; i++)
- prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices);
-}
-
-static void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices)
-{
- LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices);
- p->counters[posState] = p->tableSize;
-}
-
-static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices)
-{
- UInt32 posState;
- for (posState = 0; posState < numPosStates; posState++)
- LenPriceEnc_UpdateTable(p, posState, ProbPrices);
-}
-
-static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices)
-{
- LenEnc_Encode(&p->p, rc, symbol, posState);
- if (updatePrice)
- if (--p->counters[posState] == 0)
- LenPriceEnc_UpdateTable(p, posState, ProbPrices);
-}
-
-
-
-
-static void MovePos(CLzmaEnc *p, UInt32 num)
-{
- #ifdef SHOW_STAT
- ttt += num;
- printf("\n MovePos %d", num);
- #endif
- if (num != 0)
- {
- p->additionalOffset += num;
- p->matchFinder.Skip(p->matchFinderObj, num);
- }
-}
-
-static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes)
-{
- UInt32 lenRes = 0, numPairs;
- p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
- numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches);
- #ifdef SHOW_STAT
- printf("\n i = %d numPairs = %d ", ttt, numPairs / 2);
- ttt++;
- {
- UInt32 i;
- for (i = 0; i < numPairs; i += 2)
- printf("%2d %6d | ", p->matches[i], p->matches[i + 1]);
- }
- #endif
- if (numPairs > 0)
- {
- lenRes = p->matches[numPairs - 2];
- if (lenRes == p->numFastBytes)
- {
- const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
- UInt32 distance = p->matches[numPairs - 1] + 1;
- UInt32 numAvail = p->numAvail;
- if (numAvail > LZMA_MATCH_LEN_MAX)
- numAvail = LZMA_MATCH_LEN_MAX;
- {
- const Byte *pby2 = pby - distance;
- for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++);
- }
- }
- }
- p->additionalOffset++;
- *numDistancePairsRes = numPairs;
- return lenRes;
-}
-
-
-#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False;
-#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False;
-#define IsShortRep(p) ((p)->backPrev == 0)
-
-static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState)
-{
- return
- GET_PRICE_0(p->isRepG0[state]) +
- GET_PRICE_0(p->isRep0Long[state][posState]);
-}
-
-static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState)
-{
- UInt32 price;
- if (repIndex == 0)
- {
- price = GET_PRICE_0(p->isRepG0[state]);
- price += GET_PRICE_1(p->isRep0Long[state][posState]);
- }
- else
- {
- price = GET_PRICE_1(p->isRepG0[state]);
- if (repIndex == 1)
- price += GET_PRICE_0(p->isRepG1[state]);
- else
- {
- price += GET_PRICE_1(p->isRepG1[state]);
- price += GET_PRICE(p->isRepG2[state], repIndex - 2);
- }
- }
- return price;
-}
-
-static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState)
-{
- return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] +
- GetPureRepPrice(p, repIndex, state, posState);
-}
-
-static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur)
-{
- UInt32 posMem = p->opt[cur].posPrev;
- UInt32 backMem = p->opt[cur].backPrev;
- p->optimumEndIndex = cur;
- do
- {
- if (p->opt[cur].prev1IsChar)
- {
- MakeAsChar(&p->opt[posMem])
- p->opt[posMem].posPrev = posMem - 1;
- if (p->opt[cur].prev2)
- {
- p->opt[posMem - 1].prev1IsChar = False;
- p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2;
- p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2;
- }
- }
- {
- UInt32 posPrev = posMem;
- UInt32 backCur = backMem;
-
- backMem = p->opt[posPrev].backPrev;
- posMem = p->opt[posPrev].posPrev;
-
- p->opt[posPrev].backPrev = backCur;
- p->opt[posPrev].posPrev = cur;
- cur = posPrev;
- }
- }
- while (cur != 0);
- *backRes = p->opt[0].backPrev;
- p->optimumCurrentIndex = p->opt[0].posPrev;
- return p->optimumCurrentIndex;
-}
-
-#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300)
-
-static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes)
-{
- UInt32 numAvail, mainLen, numPairs, repMaxIndex, i, posState, lenEnd, len, cur;
- UInt32 matchPrice, repMatchPrice, normalMatchPrice;
- UInt32 reps[LZMA_NUM_REPS], repLens[LZMA_NUM_REPS];
- UInt32 *matches;
- const Byte *data;
- Byte curByte, matchByte;
- if (p->optimumEndIndex != p->optimumCurrentIndex)
- {
- const COptimal *opt = &p->opt[p->optimumCurrentIndex];
- UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex;
- *backRes = opt->backPrev;
- p->optimumCurrentIndex = opt->posPrev;
- return lenRes;
- }
- p->optimumCurrentIndex = p->optimumEndIndex = 0;
-
- if (p->additionalOffset == 0)
- mainLen = ReadMatchDistances(p, &numPairs);
- else
- {
- mainLen = p->longestMatchLength;
- numPairs = p->numPairs;
- }
-
- numAvail = p->numAvail;
- if (numAvail < 2)
- {
- *backRes = (UInt32)(-1);
- return 1;
- }
- if (numAvail > LZMA_MATCH_LEN_MAX)
- numAvail = LZMA_MATCH_LEN_MAX;
-
- data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
- repMaxIndex = 0;
- for (i = 0; i < LZMA_NUM_REPS; i++)
- {
- UInt32 lenTest;
- const Byte *data2;
- reps[i] = p->reps[i];
- data2 = data - (reps[i] + 1);
- if (data[0] != data2[0] || data[1] != data2[1])
- {
- repLens[i] = 0;
- continue;
- }
- for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++);
- repLens[i] = lenTest;
- if (lenTest > repLens[repMaxIndex])
- repMaxIndex = i;
- }
- if (repLens[repMaxIndex] >= p->numFastBytes)
- {
- UInt32 lenRes;
- *backRes = repMaxIndex;
- lenRes = repLens[repMaxIndex];
- MovePos(p, lenRes - 1);
- return lenRes;
- }
-
- matches = p->matches;
- if (mainLen >= p->numFastBytes)
- {
- *backRes = matches[numPairs - 1] + LZMA_NUM_REPS;
- MovePos(p, mainLen - 1);
- return mainLen;
- }
- curByte = *data;
- matchByte = *(data - (reps[0] + 1));
-
- if (mainLen < 2 && curByte != matchByte && repLens[repMaxIndex] < 2)
- {
- *backRes = (UInt32)-1;
- return 1;
- }
-
- p->opt[0].state = (CState)p->state;
-
- posState = (position & p->pbMask);
-
- {
- const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));
- p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) +
- (!IsCharState(p->state) ?
- LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) :
- LitEnc_GetPrice(probs, curByte, p->ProbPrices));
- }
-
- MakeAsChar(&p->opt[1]);
-
- matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]);
- repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]);
-
- if (matchByte == curByte)
- {
- UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState);
- if (shortRepPrice < p->opt[1].price)
- {
- p->opt[1].price = shortRepPrice;
- MakeAsShortRep(&p->opt[1]);
- }
- }
- lenEnd = ((mainLen >= repLens[repMaxIndex]) ? mainLen : repLens[repMaxIndex]);
-
- if (lenEnd < 2)
- {
- *backRes = p->opt[1].backPrev;
- return 1;
- }
-
- p->opt[1].posPrev = 0;
- for (i = 0; i < LZMA_NUM_REPS; i++)
- p->opt[0].backs[i] = reps[i];
-
- len = lenEnd;
- do
- p->opt[len--].price = kInfinityPrice;
- while (len >= 2);
-
- for (i = 0; i < LZMA_NUM_REPS; i++)
- {
- UInt32 repLen = repLens[i];
- UInt32 price;
- if (repLen < 2)
- continue;
- price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState);
- do
- {
- UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2];
- COptimal *opt = &p->opt[repLen];
- if (curAndLenPrice < opt->price)
- {
- opt->price = curAndLenPrice;
- opt->posPrev = 0;
- opt->backPrev = i;
- opt->prev1IsChar = False;
- }
- }
- while (--repLen >= 2);
- }
-
- normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]);
-
- len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2);
- if (len <= mainLen)
- {
- UInt32 offs = 0;
- while (len > matches[offs])
- offs += 2;
- for (; ; len++)
- {
- COptimal *opt;
- UInt32 distance = matches[offs + 1];
-
- UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN];
- UInt32 lenToPosState = GetLenToPosState(len);
- if (distance < kNumFullDistances)
- curAndLenPrice += p->distancesPrices[lenToPosState][distance];
- else
- {
- UInt32 slot;
- GetPosSlot2(distance, slot);
- curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot];
- }
- opt = &p->opt[len];
- if (curAndLenPrice < opt->price)
- {
- opt->price = curAndLenPrice;
- opt->posPrev = 0;
- opt->backPrev = distance + LZMA_NUM_REPS;
- opt->prev1IsChar = False;
- }
- if (len == matches[offs])
- {
- offs += 2;
- if (offs == numPairs)
- break;
- }
- }
- }
-
- cur = 0;
-
- #ifdef SHOW_STAT2
- if (position >= 0)
- {
- unsigned i;
- printf("\n pos = %4X", position);
- for (i = cur; i <= lenEnd; i++)
- printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price);
- }
- #endif
-
- for (;;)
- {
- UInt32 numAvailFull, newLen, numPairs, posPrev, state, posState, startLen;
- UInt32 curPrice, curAnd1Price, matchPrice, repMatchPrice;
- Bool nextIsChar;
- Byte curByte, matchByte;
- const Byte *data;
- COptimal *curOpt;
- COptimal *nextOpt;
-
- cur++;
- if (cur == lenEnd)
- return Backward(p, backRes, cur);
-
- newLen = ReadMatchDistances(p, &numPairs);
- if (newLen >= p->numFastBytes)
- {
- p->numPairs = numPairs;
- p->longestMatchLength = newLen;
- return Backward(p, backRes, cur);
- }
- position++;
- curOpt = &p->opt[cur];
- posPrev = curOpt->posPrev;
- if (curOpt->prev1IsChar)
- {
- posPrev--;
- if (curOpt->prev2)
- {
- state = p->opt[curOpt->posPrev2].state;
- if (curOpt->backPrev2 < LZMA_NUM_REPS)
- state = kRepNextStates[state];
- else
- state = kMatchNextStates[state];
- }
- else
- state = p->opt[posPrev].state;
- state = kLiteralNextStates[state];
- }
- else
- state = p->opt[posPrev].state;
- if (posPrev == cur - 1)
- {
- if (IsShortRep(curOpt))
- state = kShortRepNextStates[state];
- else
- state = kLiteralNextStates[state];
- }
- else
- {
- UInt32 pos;
- const COptimal *prevOpt;
- if (curOpt->prev1IsChar && curOpt->prev2)
- {
- posPrev = curOpt->posPrev2;
- pos = curOpt->backPrev2;
- state = kRepNextStates[state];
- }
- else
- {
- pos = curOpt->backPrev;
- if (pos < LZMA_NUM_REPS)
- state = kRepNextStates[state];
- else
- state = kMatchNextStates[state];
- }
- prevOpt = &p->opt[posPrev];
- if (pos < LZMA_NUM_REPS)
- {
- UInt32 i;
- reps[0] = prevOpt->backs[pos];
- for (i = 1; i <= pos; i++)
- reps[i] = prevOpt->backs[i - 1];
- for (; i < LZMA_NUM_REPS; i++)
- reps[i] = prevOpt->backs[i];
- }
- else
- {
- UInt32 i;
- reps[0] = (pos - LZMA_NUM_REPS);
- for (i = 1; i < LZMA_NUM_REPS; i++)
- reps[i] = prevOpt->backs[i - 1];
- }
- }
- curOpt->state = (CState)state;
-
- curOpt->backs[0] = reps[0];
- curOpt->backs[1] = reps[1];
- curOpt->backs[2] = reps[2];
- curOpt->backs[3] = reps[3];
-
- curPrice = curOpt->price;
- nextIsChar = False;
- data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
- curByte = *data;
- matchByte = *(data - (reps[0] + 1));
-
- posState = (position & p->pbMask);
-
- curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]);
- {
- const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));
- curAnd1Price +=
- (!IsCharState(state) ?
- LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) :
- LitEnc_GetPrice(probs, curByte, p->ProbPrices));
- }
-
- nextOpt = &p->opt[cur + 1];
-
- if (curAnd1Price < nextOpt->price)
- {
- nextOpt->price = curAnd1Price;
- nextOpt->posPrev = cur;
- MakeAsChar(nextOpt);
- nextIsChar = True;
- }
-
- matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]);
- repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]);
-
- if (matchByte == curByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0))
- {
- UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState);
- if (shortRepPrice <= nextOpt->price)
- {
- nextOpt->price = shortRepPrice;
- nextOpt->posPrev = cur;
- MakeAsShortRep(nextOpt);
- nextIsChar = True;
- }
- }
- numAvailFull = p->numAvail;
- {
- UInt32 temp = kNumOpts - 1 - cur;
- if (temp < numAvailFull)
- numAvailFull = temp;
- }
-
- if (numAvailFull < 2)
- continue;
- numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes);
-
- if (!nextIsChar && matchByte != curByte) /* speed optimization */
- {
- /* try Literal + rep0 */
- UInt32 temp;
- UInt32 lenTest2;
- const Byte *data2 = data - (reps[0] + 1);
- UInt32 limit = p->numFastBytes + 1;
- if (limit > numAvailFull)
- limit = numAvailFull;
-
- for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++);
- lenTest2 = temp - 1;
- if (lenTest2 >= 2)
- {
- UInt32 state2 = kLiteralNextStates[state];
- UInt32 posStateNext = (position + 1) & p->pbMask;
- UInt32 nextRepMatchPrice = curAnd1Price +
- GET_PRICE_1(p->isMatch[state2][posStateNext]) +
- GET_PRICE_1(p->isRep[state2]);
- /* for (; lenTest2 >= 2; lenTest2--) */
- {
- UInt32 curAndLenPrice;
- COptimal *opt;
- UInt32 offset = cur + 1 + lenTest2;
- while (lenEnd < offset)
- p->opt[++lenEnd].price = kInfinityPrice;
- curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);
- opt = &p->opt[offset];
- if (curAndLenPrice < opt->price)
- {
- opt->price = curAndLenPrice;
- opt->posPrev = cur + 1;
- opt->backPrev = 0;
- opt->prev1IsChar = True;
- opt->prev2 = False;
- }
- }
- }
- }
-
- startLen = 2; /* speed optimization */
- {
- UInt32 repIndex;
- for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++)
- {
- UInt32 lenTest;
- UInt32 lenTestTemp;
- UInt32 price;
- const Byte *data2 = data - (reps[repIndex] + 1);
- if (data[0] != data2[0] || data[1] != data2[1])
- continue;
- for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++);
- while (lenEnd < cur + lenTest)
- p->opt[++lenEnd].price = kInfinityPrice;
- lenTestTemp = lenTest;
- price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState);
- do
- {
- UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2];
- COptimal *opt = &p->opt[cur + lenTest];
- if (curAndLenPrice < opt->price)
- {
- opt->price = curAndLenPrice;
- opt->posPrev = cur;
- opt->backPrev = repIndex;
- opt->prev1IsChar = False;
- }
- }
- while (--lenTest >= 2);
- lenTest = lenTestTemp;
-
- if (repIndex == 0)
- startLen = lenTest + 1;
-
- /* if (_maxMode) */
- {
- UInt32 lenTest2 = lenTest + 1;
- UInt32 limit = lenTest2 + p->numFastBytes;
- UInt32 nextRepMatchPrice;
- if (limit > numAvailFull)
- limit = numAvailFull;
- for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++);
- lenTest2 -= lenTest + 1;
- if (lenTest2 >= 2)
- {
- UInt32 state2 = kRepNextStates[state];
- UInt32 posStateNext = (position + lenTest) & p->pbMask;
- UInt32 curAndLenCharPrice =
- price + p->repLenEnc.prices[posState][lenTest - 2] +
- GET_PRICE_0(p->isMatch[state2][posStateNext]) +
- LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]),
- data[lenTest], data2[lenTest], p->ProbPrices);
- state2 = kLiteralNextStates[state2];
- posStateNext = (position + lenTest + 1) & p->pbMask;
- nextRepMatchPrice = curAndLenCharPrice +
- GET_PRICE_1(p->isMatch[state2][posStateNext]) +
- GET_PRICE_1(p->isRep[state2]);
-
- /* for (; lenTest2 >= 2; lenTest2--) */
- {
- UInt32 curAndLenPrice;
- COptimal *opt;
- UInt32 offset = cur + lenTest + 1 + lenTest2;
- while (lenEnd < offset)
- p->opt[++lenEnd].price = kInfinityPrice;
- curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);
- opt = &p->opt[offset];
- if (curAndLenPrice < opt->price)
- {
- opt->price = curAndLenPrice;
- opt->posPrev = cur + lenTest + 1;
- opt->backPrev = 0;
- opt->prev1IsChar = True;
- opt->prev2 = True;
- opt->posPrev2 = cur;
- opt->backPrev2 = repIndex;
- }
- }
- }
- }
- }
- }
- /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */
- if (newLen > numAvail)
- {
- newLen = numAvail;
- for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2);
- matches[numPairs] = newLen;
- numPairs += 2;
- }
- if (newLen >= startLen)
- {
- UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]);
- UInt32 offs, curBack, posSlot;
- UInt32 lenTest;
- while (lenEnd < cur + newLen)
- p->opt[++lenEnd].price = kInfinityPrice;
-
- offs = 0;
- while (startLen > matches[offs])
- offs += 2;
- curBack = matches[offs + 1];
- GetPosSlot2(curBack, posSlot);
- for (lenTest = /*2*/ startLen; ; lenTest++)
- {
- UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN];
- UInt32 lenToPosState = GetLenToPosState(lenTest);
- COptimal *opt;
- if (curBack < kNumFullDistances)
- curAndLenPrice += p->distancesPrices[lenToPosState][curBack];
- else
- curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask];
-
- opt = &p->opt[cur + lenTest];
- if (curAndLenPrice < opt->price)
- {
- opt->price = curAndLenPrice;
- opt->posPrev = cur;
- opt->backPrev = curBack + LZMA_NUM_REPS;
- opt->prev1IsChar = False;
- }
-
- if (/*_maxMode && */lenTest == matches[offs])
- {
- /* Try Match + Literal + Rep0 */
- const Byte *data2 = data - (curBack + 1);
- UInt32 lenTest2 = lenTest + 1;
- UInt32 limit = lenTest2 + p->numFastBytes;
- UInt32 nextRepMatchPrice;
- if (limit > numAvailFull)
- limit = numAvailFull;
- for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++);
- lenTest2 -= lenTest + 1;
- if (lenTest2 >= 2)
- {
- UInt32 state2 = kMatchNextStates[state];
- UInt32 posStateNext = (position + lenTest) & p->pbMask;
- UInt32 curAndLenCharPrice = curAndLenPrice +
- GET_PRICE_0(p->isMatch[state2][posStateNext]) +
- LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]),
- data[lenTest], data2[lenTest], p->ProbPrices);
- state2 = kLiteralNextStates[state2];
- posStateNext = (posStateNext + 1) & p->pbMask;
- nextRepMatchPrice = curAndLenCharPrice +
- GET_PRICE_1(p->isMatch[state2][posStateNext]) +
- GET_PRICE_1(p->isRep[state2]);
-
- /* for (; lenTest2 >= 2; lenTest2--) */
- {
- UInt32 offset = cur + lenTest + 1 + lenTest2;
- UInt32 curAndLenPrice;
- COptimal *opt;
- while (lenEnd < offset)
- p->opt[++lenEnd].price = kInfinityPrice;
- curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);
- opt = &p->opt[offset];
- if (curAndLenPrice < opt->price)
- {
- opt->price = curAndLenPrice;
- opt->posPrev = cur + lenTest + 1;
- opt->backPrev = 0;
- opt->prev1IsChar = True;
- opt->prev2 = True;
- opt->posPrev2 = cur;
- opt->backPrev2 = curBack + LZMA_NUM_REPS;
- }
- }
- }
- offs += 2;
- if (offs == numPairs)
- break;
- curBack = matches[offs + 1];
- if (curBack >= kNumFullDistances)
- GetPosSlot2(curBack, posSlot);
- }
- }
- }
- }
-}
-
-#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist))
-
-static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes)
-{
- UInt32 numAvail, mainLen, mainDist, numPairs, repIndex, repLen, i;
- const Byte *data;
- const UInt32 *matches;
-
- if (p->additionalOffset == 0)
- mainLen = ReadMatchDistances(p, &numPairs);
- else
- {
- mainLen = p->longestMatchLength;
- numPairs = p->numPairs;
- }
-
- numAvail = p->numAvail;
- *backRes = (UInt32)-1;
- if (numAvail < 2)
- return 1;
- if (numAvail > LZMA_MATCH_LEN_MAX)
- numAvail = LZMA_MATCH_LEN_MAX;
- data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
-
- repLen = repIndex = 0;
- for (i = 0; i < LZMA_NUM_REPS; i++)
- {
- UInt32 len;
- const Byte *data2 = data - (p->reps[i] + 1);
- if (data[0] != data2[0] || data[1] != data2[1])
- continue;
- for (len = 2; len < numAvail && data[len] == data2[len]; len++);
- if (len >= p->numFastBytes)
- {
- *backRes = i;
- MovePos(p, len - 1);
- return len;
- }
- if (len > repLen)
- {
- repIndex = i;
- repLen = len;
- }
- }
-
- matches = p->matches;
- if (mainLen >= p->numFastBytes)
- {
- *backRes = matches[numPairs - 1] + LZMA_NUM_REPS;
- MovePos(p, mainLen - 1);
- return mainLen;
- }
-
- mainDist = 0; /* for GCC */
- if (mainLen >= 2)
- {
- mainDist = matches[numPairs - 1];
- while (numPairs > 2 && mainLen == matches[numPairs - 4] + 1)
- {
- if (!ChangePair(matches[numPairs - 3], mainDist))
- break;
- numPairs -= 2;
- mainLen = matches[numPairs - 2];
- mainDist = matches[numPairs - 1];
- }
- if (mainLen == 2 && mainDist >= 0x80)
- mainLen = 1;
- }
-
- if (repLen >= 2 && (
- (repLen + 1 >= mainLen) ||
- (repLen + 2 >= mainLen && mainDist >= (1 << 9)) ||
- (repLen + 3 >= mainLen && mainDist >= (1 << 15))))
- {
- *backRes = repIndex;
- MovePos(p, repLen - 1);
- return repLen;
- }
-
- if (mainLen < 2 || numAvail <= 2)
- return 1;
-
- p->longestMatchLength = ReadMatchDistances(p, &p->numPairs);
- if (p->longestMatchLength >= 2)
- {
- UInt32 newDistance = matches[p->numPairs - 1];
- if ((p->longestMatchLength >= mainLen && newDistance < mainDist) ||
- (p->longestMatchLength == mainLen + 1 && !ChangePair(mainDist, newDistance)) ||
- (p->longestMatchLength > mainLen + 1) ||
- (p->longestMatchLength + 1 >= mainLen && mainLen >= 3 && ChangePair(newDistance, mainDist)))
- return 1;
- }
-
- data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
- for (i = 0; i < LZMA_NUM_REPS; i++)
- {
- UInt32 len, limit;
- const Byte *data2 = data - (p->reps[i] + 1);
- if (data[0] != data2[0] || data[1] != data2[1])
- continue;
- limit = mainLen - 1;
- for (len = 2; len < limit && data[len] == data2[len]; len++);
- if (len >= limit)
- return 1;
- }
- *backRes = mainDist + LZMA_NUM_REPS;
- MovePos(p, mainLen - 2);
- return mainLen;
-}
-
-static void WriteEndMarker(CLzmaEnc *p, UInt32 posState)
-{
- UInt32 len;
- RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1);
- RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0);
- p->state = kMatchNextStates[p->state];
- len = LZMA_MATCH_LEN_MIN;
- LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices);
- RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1);
- RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits);
- RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask);
-}
-
-static SRes CheckErrors(CLzmaEnc *p)
-{
- if (p->result != SZ_OK)
- return p->result;
- if (p->rc.res != SZ_OK)
- p->result = SZ_ERROR_WRITE;
- if (p->matchFinderBase.result != SZ_OK)
- p->result = SZ_ERROR_READ;
- if (p->result != SZ_OK)
- p->finished = True;
- return p->result;
-}
-
-static SRes Flush(CLzmaEnc *p, UInt32 nowPos)
-{
- /* ReleaseMFStream(); */
- p->finished = True;
- if (p->writeEndMark)
- WriteEndMarker(p, nowPos & p->pbMask);
- RangeEnc_FlushData(&p->rc);
- RangeEnc_FlushStream(&p->rc);
- return CheckErrors(p);
-}
-
-static void FillAlignPrices(CLzmaEnc *p)
-{
- UInt32 i;
- for (i = 0; i < kAlignTableSize; i++)
- p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices);
- p->alignPriceCount = 0;
-}
-
-static void FillDistancesPrices(CLzmaEnc *p)
-{
- UInt32 tempPrices[kNumFullDistances];
- UInt32 i, lenToPosState;
- for (i = kStartPosModelIndex; i < kNumFullDistances; i++)
- {
- UInt32 posSlot = GetPosSlot1(i);
- UInt32 footerBits = ((posSlot >> 1) - 1);
- UInt32 base = ((2 | (posSlot & 1)) << footerBits);
- tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices);
- }
-
- for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++)
- {
- UInt32 posSlot;
- const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState];
- UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState];
- for (posSlot = 0; posSlot < p->distTableSize; posSlot++)
- posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices);
- for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++)
- posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits);
-
- {
- UInt32 *distancesPrices = p->distancesPrices[lenToPosState];
- UInt32 i;
- for (i = 0; i < kStartPosModelIndex; i++)
- distancesPrices[i] = posSlotPrices[i];
- for (; i < kNumFullDistances; i++)
- distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i];
- }
- }
- p->matchPriceCount = 0;
-}
-
-void LzmaEnc_Construct(CLzmaEnc *p)
-{
- RangeEnc_Construct(&p->rc);
- MatchFinder_Construct(&p->matchFinderBase);
- #ifdef COMPRESS_MF_MT
- MatchFinderMt_Construct(&p->matchFinderMt);
- p->matchFinderMt.MatchFinder = &p->matchFinderBase;
- #endif
-
- {
- CLzmaEncProps props;
- LzmaEncProps_Init(&props);
- LzmaEnc_SetProps(p, &props);
- }
-
- #ifndef LZMA_LOG_BSR
- LzmaEnc_FastPosInit(p->g_FastPos);
- #endif
-
- LzmaEnc_InitPriceTables(p->ProbPrices);
- p->litProbs = 0;
- p->saveState.litProbs = 0;
-}
-
-CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc)
-{
- void *p;
- p = alloc->Alloc(alloc, sizeof(CLzmaEnc));
- if (p != 0)
- LzmaEnc_Construct((CLzmaEnc *)p);
- return p;
-}
-
-void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc)
-{
- alloc->Free(alloc, p->litProbs);
- alloc->Free(alloc, p->saveState.litProbs);
- p->litProbs = 0;
- p->saveState.litProbs = 0;
-}
-
-void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig)
-{
- #ifdef COMPRESS_MF_MT
- MatchFinderMt_Destruct(&p->matchFinderMt, allocBig);
- #endif
- MatchFinder_Free(&p->matchFinderBase, allocBig);
- LzmaEnc_FreeLits(p, alloc);
- RangeEnc_Free(&p->rc, alloc);
-}
-
-void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig)
-{
- LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig);
- alloc->Free(alloc, p);
-}
-
-static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize)
-{
- UInt32 nowPos32, startPos32;
- if (p->inStream != 0)
- {
- p->matchFinderBase.stream = p->inStream;
- p->matchFinder.Init(p->matchFinderObj);
- p->inStream = 0;
- }
-
- if (p->finished)
- return p->result;
- RINOK(CheckErrors(p));
-
- nowPos32 = (UInt32)p->nowPos64;
- startPos32 = nowPos32;
-
- if (p->nowPos64 == 0)
- {
- UInt32 numPairs;
- Byte curByte;
- if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
- return Flush(p, nowPos32);
- ReadMatchDistances(p, &numPairs);
- RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0);
- p->state = kLiteralNextStates[p->state];
- curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset);
- LitEnc_Encode(&p->rc, p->litProbs, curByte);
- p->additionalOffset--;
- nowPos32++;
- }
-
- if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0)
- for (;;)
- {
- UInt32 pos, len, posState;
-
- if (p->fastMode)
- len = GetOptimumFast(p, &pos);
- else
- len = GetOptimum(p, nowPos32, &pos);
-
- #ifdef SHOW_STAT2
- printf("\n pos = %4X, len = %d pos = %d", nowPos32, len, pos);
- #endif
-
- posState = nowPos32 & p->pbMask;
- if (len == 1 && pos == (UInt32)-1)
- {
- Byte curByte;
- CLzmaProb *probs;
- const Byte *data;
-
- RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0);
- data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
- curByte = *data;
- probs = LIT_PROBS(nowPos32, *(data - 1));
- if (IsCharState(p->state))
- LitEnc_Encode(&p->rc, probs, curByte);
- else
- LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1));
- p->state = kLiteralNextStates[p->state];
- }
- else
- {
- RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1);
- if (pos < LZMA_NUM_REPS)
- {
- RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1);
- if (pos == 0)
- {
- RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0);
- RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1));
- }
- else
- {
- UInt32 distance = p->reps[pos];
- RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1);
- if (pos == 1)
- RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0);
- else
- {
- RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1);
- RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2);
- if (pos == 3)
- p->reps[3] = p->reps[2];
- p->reps[2] = p->reps[1];
- }
- p->reps[1] = p->reps[0];
- p->reps[0] = distance;
- }
- if (len == 1)
- p->state = kShortRepNextStates[p->state];
- else
- {
- LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices);
- p->state = kRepNextStates[p->state];
- }
- }
- else
- {
- UInt32 posSlot;
- RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0);
- p->state = kMatchNextStates[p->state];
- LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices);
- pos -= LZMA_NUM_REPS;
- GetPosSlot(pos, posSlot);
- RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot);
-
- if (posSlot >= kStartPosModelIndex)
- {
- UInt32 footerBits = ((posSlot >> 1) - 1);
- UInt32 base = ((2 | (posSlot & 1)) << footerBits);
- UInt32 posReduced = pos - base;
-
- if (posSlot < kEndPosModelIndex)
- RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced);
- else
- {
- RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits);
- RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask);
- p->alignPriceCount++;
- }
- }
- p->reps[3] = p->reps[2];
- p->reps[2] = p->reps[1];
- p->reps[1] = p->reps[0];
- p->reps[0] = pos;
- p->matchPriceCount++;
- }
- }
- p->additionalOffset -= len;
- nowPos32 += len;
- if (p->additionalOffset == 0)
- {
- UInt32 processed;
- if (!p->fastMode)
- {
- if (p->matchPriceCount >= (1 << 7))
- FillDistancesPrices(p);
- if (p->alignPriceCount >= kAlignTableSize)
- FillAlignPrices(p);
- }
- if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
- break;
- processed = nowPos32 - startPos32;
- if (useLimits)
- {
- if (processed + kNumOpts + 300 >= maxUnpackSize ||
- RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize)
- break;
- }
- else if (processed >= (1 << 15))
- {
- p->nowPos64 += nowPos32 - startPos32;
- return CheckErrors(p);
- }
- }
- }
- p->nowPos64 += nowPos32 - startPos32;
- return Flush(p, nowPos32);
-}
-
-#define kBigHashDicLimit ((UInt32)1 << 24)
-
-static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
-{
- UInt32 beforeSize = kNumOpts;
- #ifdef COMPRESS_MF_MT
- Bool btMode;
- #endif
- if (!RangeEnc_Alloc(&p->rc, alloc))
- return SZ_ERROR_MEM;
- #ifdef COMPRESS_MF_MT
- btMode = (p->matchFinderBase.btMode != 0);
- p->mtMode = (p->multiThread && !p->fastMode && btMode);
- #endif
-
- {
- unsigned lclp = p->lc + p->lp;
- if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp)
- {
- LzmaEnc_FreeLits(p, alloc);
- p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb));
- p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb));
- if (p->litProbs == 0 || p->saveState.litProbs == 0)
- {
- LzmaEnc_FreeLits(p, alloc);
- return SZ_ERROR_MEM;
- }
- p->lclp = lclp;
- }
- }
-
- p->matchFinderBase.bigHash = (p->dictSize > kBigHashDicLimit);
-
- if (beforeSize + p->dictSize < keepWindowSize)
- beforeSize = keepWindowSize - p->dictSize;
-
- #ifdef COMPRESS_MF_MT
- if (p->mtMode)
- {
- RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig));
- p->matchFinderObj = &p->matchFinderMt;
- MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder);
- }
- else
- #endif
- {
- if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig))
- return SZ_ERROR_MEM;
- p->matchFinderObj = &p->matchFinderBase;
- MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder);
- }
- return SZ_OK;
-}
-
-void LzmaEnc_Init(CLzmaEnc *p)
-{
- UInt32 i;
- p->state = 0;
- for (i = 0 ; i < LZMA_NUM_REPS; i++)
- p->reps[i] = 0;
-
- RangeEnc_Init(&p->rc);
-
-
- for (i = 0; i < kNumStates; i++)
- {
- UInt32 j;
- for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++)
- {
- p->isMatch[i][j] = kProbInitValue;
- p->isRep0Long[i][j] = kProbInitValue;
- }
- p->isRep[i] = kProbInitValue;
- p->isRepG0[i] = kProbInitValue;
- p->isRepG1[i] = kProbInitValue;
- p->isRepG2[i] = kProbInitValue;
- }
-
- {
- UInt32 num = 0x300 << (p->lp + p->lc);
- for (i = 0; i < num; i++)
- p->litProbs[i] = kProbInitValue;
- }
-
- {
- for (i = 0; i < kNumLenToPosStates; i++)
- {
- CLzmaProb *probs = p->posSlotEncoder[i];
- UInt32 j;
- for (j = 0; j < (1 << kNumPosSlotBits); j++)
- probs[j] = kProbInitValue;
- }
- }
- {
- for (i = 0; i < kNumFullDistances - kEndPosModelIndex; i++)
- p->posEncoders[i] = kProbInitValue;
- }
-
- LenEnc_Init(&p->lenEnc.p);
- LenEnc_Init(&p->repLenEnc.p);
-
- for (i = 0; i < (1 << kNumAlignBits); i++)
- p->posAlignEncoder[i] = kProbInitValue;
-
- p->optimumEndIndex = 0;
- p->optimumCurrentIndex = 0;
- p->additionalOffset = 0;
-
- p->pbMask = (1 << p->pb) - 1;
- p->lpMask = (1 << p->lp) - 1;
-}
-
-void LzmaEnc_InitPrices(CLzmaEnc *p)
-{
- if (!p->fastMode)
- {
- FillDistancesPrices(p);
- FillAlignPrices(p);
- }
-
- p->lenEnc.tableSize =
- p->repLenEnc.tableSize =
- p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN;
- LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices);
- LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices);
-}
-
-static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
-{
- UInt32 i;
- for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++)
- if (p->dictSize <= ((UInt32)1 << i))
- break;
- p->distTableSize = i * 2;
-
- p->finished = False;
- p->result = SZ_OK;
- RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig));
- LzmaEnc_Init(p);
- LzmaEnc_InitPrices(p);
- p->nowPos64 = 0;
- return SZ_OK;
-}
-
-static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqInStream *inStream, ISeqOutStream *outStream,
- ISzAlloc *alloc, ISzAlloc *allocBig)
-{
- CLzmaEnc *p = (CLzmaEnc *)pp;
- p->inStream = inStream;
- p->rc.outStream = outStream;
- return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig);
-}
-
-SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp,
- ISeqInStream *inStream, UInt32 keepWindowSize,
- ISzAlloc *alloc, ISzAlloc *allocBig)
-{
- CLzmaEnc *p = (CLzmaEnc *)pp;
- p->inStream = inStream;
- return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);
-}
-
-static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen)
-{
- p->seqBufInStream.funcTable.Read = MyRead;
- p->seqBufInStream.data = src;
- p->seqBufInStream.rem = srcLen;
-}
-
-SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen,
- UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
-{
- CLzmaEnc *p = (CLzmaEnc *)pp;
- LzmaEnc_SetInputBuf(p, src, srcLen);
- p->inStream = &p->seqBufInStream.funcTable;
- return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);
-}
-
-void LzmaEnc_Finish(CLzmaEncHandle pp)
-{
- #ifdef COMPRESS_MF_MT
- CLzmaEnc *p = (CLzmaEnc *)pp;
- if (p->mtMode)
- MatchFinderMt_ReleaseStream(&p->matchFinderMt);
- #else
- pp = pp;
- #endif
-}
-
-typedef struct _CSeqOutStreamBuf
-{
- ISeqOutStream funcTable;
- Byte *data;
- SizeT rem;
- Bool overflow;
-} CSeqOutStreamBuf;
-
-static size_t MyWrite(void *pp, const void *data, size_t size)
-{
- CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp;
- if (p->rem < size)
- {
- size = p->rem;
- p->overflow = True;
- }
- memcpy(p->data, data, size);
- p->rem -= size;
- p->data += size;
- return size;
-}
-
-
-UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp)
-{
- const CLzmaEnc *p = (CLzmaEnc *)pp;
- return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
-}
-
-const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp)
-{
- const CLzmaEnc *p = (CLzmaEnc *)pp;
- return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
-}
-
-SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit,
- Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize)
-{
- CLzmaEnc *p = (CLzmaEnc *)pp;
- UInt64 nowPos64;
- SRes res;
- CSeqOutStreamBuf outStream;
-
- outStream.funcTable.Write = MyWrite;
- outStream.data = dest;
- outStream.rem = *destLen;
- outStream.overflow = False;
-
- p->writeEndMark = False;
- p->finished = False;
- p->result = SZ_OK;
-
- if (reInit)
- LzmaEnc_Init(p);
- LzmaEnc_InitPrices(p);
- nowPos64 = p->nowPos64;
- RangeEnc_Init(&p->rc);
- p->rc.outStream = &outStream.funcTable;
-
- res = LzmaEnc_CodeOneBlock(p, True, desiredPackSize, *unpackSize);
-
- *unpackSize = (UInt32)(p->nowPos64 - nowPos64);
- *destLen -= outStream.rem;
- if (outStream.overflow)
- return SZ_ERROR_OUTPUT_EOF;
-
- return res;
-}
-
-SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress,
- ISzAlloc *alloc, ISzAlloc *allocBig)
-{
- CLzmaEnc *p = (CLzmaEnc *)pp;
- SRes res = SZ_OK;
-
- #ifdef COMPRESS_MF_MT
- Byte allocaDummy[0x300];
- int i = 0;
- for (i = 0; i < 16; i++)
- allocaDummy[i] = (Byte)i;
- #endif
-
- RINOK(LzmaEnc_Prepare(pp, inStream, outStream, alloc, allocBig));
-
- for (;;)
- {
- res = LzmaEnc_CodeOneBlock(p, False, 0, 0);
- if (res != SZ_OK || p->finished != 0)
- break;
- if (progress != 0)
- {
- res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc));
- if (res != SZ_OK)
- {
- res = SZ_ERROR_PROGRESS;
- break;
- }
- }
- }
- LzmaEnc_Finish(pp);
- return res;
-}
-
-SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size)
-{
- CLzmaEnc *p = (CLzmaEnc *)pp;
- int i;
- UInt32 dictSize = p->dictSize;
- if (*size < LZMA_PROPS_SIZE)
- return SZ_ERROR_PARAM;
- *size = LZMA_PROPS_SIZE;
- props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc);
-
- for (i = 11; i <= 30; i++)
- {
- if (dictSize <= ((UInt32)2 << i))
- {
- dictSize = (2 << i);
- break;
- }
- if (dictSize <= ((UInt32)3 << i))
- {
- dictSize = (3 << i);
- break;
- }
- }
-
- for (i = 0; i < 4; i++)
- props[1 + i] = (Byte)(dictSize >> (8 * i));
- return SZ_OK;
-}
-
-SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
- int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
-{
- SRes res;
- CLzmaEnc *p = (CLzmaEnc *)pp;
-
- CSeqOutStreamBuf outStream;
-
- LzmaEnc_SetInputBuf(p, src, srcLen);
-
- outStream.funcTable.Write = MyWrite;
- outStream.data = dest;
- outStream.rem = *destLen;
- outStream.overflow = False;
-
- p->writeEndMark = writeEndMark;
- res = LzmaEnc_Encode(pp, &outStream.funcTable, &p->seqBufInStream.funcTable,
- progress, alloc, allocBig);
-
- *destLen -= outStream.rem;
- if (outStream.overflow)
- return SZ_ERROR_OUTPUT_EOF;
- return res;
-}
-
-SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
- const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
- ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)
-{
- CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc);
- SRes res;
- if (p == 0)
- return SZ_ERROR_MEM;
-
- res = LzmaEnc_SetProps(p, props);
- if (res == SZ_OK)
- {
- res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize);
- if (res == SZ_OK)
- res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen,
- writeEndMark, progress, alloc, allocBig);
- }
-
- LzmaEnc_Destroy(p, alloc, allocBig);
- return res;
-}
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.h
deleted file mode 100644
index e3d84fa35e..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/LzmaEnc.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* LzmaEnc.h -- LZMA Encoder
-2008-10-04 : Igor Pavlov : Public domain */
-
-#ifndef __LZMAENC_H
-#define __LZMAENC_H
-
-#include "Types.h"
-
-#define LZMA_PROPS_SIZE 5
-
-typedef struct _CLzmaEncProps
-{
- int level; /* 0 <= level <= 9 */
- UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
- (1 << 12) <= dictSize <= (1 << 30) for 64-bit version
- default = (1 << 24) */
- int lc; /* 0 <= lc <= 8, default = 3 */
- int lp; /* 0 <= lp <= 4, default = 0 */
- int pb; /* 0 <= pb <= 4, default = 2 */
- int algo; /* 0 - fast, 1 - normal, default = 1 */
- int fb; /* 5 <= fb <= 273, default = 32 */
- int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
- int numHashBytes; /* 2, 3 or 4, default = 4 */
- UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
- unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
- int numThreads; /* 1 or 2, default = 2 */
-} CLzmaEncProps;
-
-void LzmaEncProps_Init(CLzmaEncProps *p);
-void LzmaEncProps_Normalize(CLzmaEncProps *p);
-UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
-
-
-/* ---------- CLzmaEncHandle Interface ---------- */
-
-/* LzmaEnc_* functions can return the following exit codes:
-Returns:
- SZ_OK - OK
- SZ_ERROR_MEM - Memory allocation error
- SZ_ERROR_PARAM - Incorrect paramater in props
- SZ_ERROR_WRITE - Write callback error.
- SZ_ERROR_PROGRESS - some break from progress callback
- SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
-*/
-
-typedef void * CLzmaEncHandle;
-
-CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);
-void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);
-SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
-SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
-SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
- ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
-SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
- int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
-
-/* ---------- One Call Interface ---------- */
-
-/* LzmaEncode
-Return code:
- SZ_OK - OK
- SZ_ERROR_MEM - Memory allocation error
- SZ_ERROR_PARAM - Incorrect paramater
- SZ_ERROR_OUTPUT_EOF - output buffer overflow
- SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
-*/
-
-SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
- const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
- ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/Threads.c b/BaseTools/Source/C/LzmaCompress/Sdk/C/Threads.c
deleted file mode 100644
index c7d8b0a8ab..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/Threads.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Threads.c -- multithreading library
-2008-08-05
-Igor Pavlov
-Public domain */
-
-#include "Threads.h"
-#include <process.h>
-
-static WRes GetError()
-{
- DWORD res = GetLastError();
- return (res) ? (WRes)(res) : 1;
-}
-
-WRes HandleToWRes(HANDLE h) { return (h != 0) ? 0 : GetError(); }
-WRes BOOLToWRes(BOOL v) { return v ? 0 : GetError(); }
-
-static WRes MyCloseHandle(HANDLE *h)
-{
- if (*h != NULL)
- if (!CloseHandle(*h))
- return GetError();
- *h = NULL;
- return 0;
-}
-
-WRes Thread_Create(CThread *thread, THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE *startAddress)(void *), LPVOID parameter)
-{
- unsigned threadId; /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */
- thread->handle =
- /* CreateThread(0, 0, startAddress, parameter, 0, &threadId); */
- (HANDLE)_beginthreadex(NULL, 0, startAddress, parameter, 0, &threadId);
- /* maybe we must use errno here, but probably GetLastError() is also OK. */
- return HandleToWRes(thread->handle);
-}
-
-WRes WaitObject(HANDLE h)
-{
- return (WRes)WaitForSingleObject(h, INFINITE);
-}
-
-WRes Thread_Wait(CThread *thread)
-{
- if (thread->handle == NULL)
- return 1;
- return WaitObject(thread->handle);
-}
-
-WRes Thread_Close(CThread *thread)
-{
- return MyCloseHandle(&thread->handle);
-}
-
-WRes Event_Create(CEvent *p, BOOL manualReset, int initialSignaled)
-{
- p->handle = CreateEvent(NULL, manualReset, (initialSignaled ? TRUE : FALSE), NULL);
- return HandleToWRes(p->handle);
-}
-
-WRes ManualResetEvent_Create(CManualResetEvent *p, int initialSignaled)
- { return Event_Create(p, TRUE, initialSignaled); }
-WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p)
- { return ManualResetEvent_Create(p, 0); }
-
-WRes AutoResetEvent_Create(CAutoResetEvent *p, int initialSignaled)
- { return Event_Create(p, FALSE, initialSignaled); }
-WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p)
- { return AutoResetEvent_Create(p, 0); }
-
-WRes Event_Set(CEvent *p) { return BOOLToWRes(SetEvent(p->handle)); }
-WRes Event_Reset(CEvent *p) { return BOOLToWRes(ResetEvent(p->handle)); }
-WRes Event_Wait(CEvent *p) { return WaitObject(p->handle); }
-WRes Event_Close(CEvent *p) { return MyCloseHandle(&p->handle); }
-
-
-WRes Semaphore_Create(CSemaphore *p, UInt32 initiallyCount, UInt32 maxCount)
-{
- p->handle = CreateSemaphore(NULL, (LONG)initiallyCount, (LONG)maxCount, NULL);
- return HandleToWRes(p->handle);
-}
-
-WRes Semaphore_Release(CSemaphore *p, LONG releaseCount, LONG *previousCount)
-{
- return BOOLToWRes(ReleaseSemaphore(p->handle, releaseCount, previousCount));
-}
-WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 releaseCount)
-{
- return Semaphore_Release(p, (LONG)releaseCount, NULL);
-}
-WRes Semaphore_Release1(CSemaphore *p)
-{
- return Semaphore_ReleaseN(p, 1);
-}
-
-WRes Semaphore_Wait(CSemaphore *p) { return WaitObject(p->handle); }
-WRes Semaphore_Close(CSemaphore *p) { return MyCloseHandle(&p->handle); }
-
-WRes CriticalSection_Init(CCriticalSection *p)
-{
- /* InitializeCriticalSection can raise only STATUS_NO_MEMORY exception */
- __try
- {
- InitializeCriticalSection(p);
- /* InitializeCriticalSectionAndSpinCount(p, 0); */
- }
- __except (EXCEPTION_EXECUTE_HANDLER) { return 1; }
- return 0;
-}
-
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/Threads.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/Threads.h
deleted file mode 100644
index 3d9072946e..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/Threads.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Threads.h -- multithreading library
-2008-11-22 : Igor Pavlov : Public domain */
-
-#ifndef __7Z_THRESDS_H
-#define __7Z_THRESDS_H
-
-#include "Types.h"
-
-typedef struct _CThread
-{
- HANDLE handle;
-} CThread;
-
-#define Thread_Construct(thread) (thread)->handle = NULL
-#define Thread_WasCreated(thread) ((thread)->handle != NULL)
-
-typedef unsigned THREAD_FUNC_RET_TYPE;
-#define THREAD_FUNC_CALL_TYPE MY_STD_CALL
-#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE
-
-WRes Thread_Create(CThread *thread, THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE *startAddress)(void *), LPVOID parameter);
-WRes Thread_Wait(CThread *thread);
-WRes Thread_Close(CThread *thread);
-
-typedef struct _CEvent
-{
- HANDLE handle;
-} CEvent;
-
-typedef CEvent CAutoResetEvent;
-typedef CEvent CManualResetEvent;
-
-#define Event_Construct(event) (event)->handle = NULL
-#define Event_IsCreated(event) ((event)->handle != NULL)
-
-WRes ManualResetEvent_Create(CManualResetEvent *event, int initialSignaled);
-WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *event);
-WRes AutoResetEvent_Create(CAutoResetEvent *event, int initialSignaled);
-WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *event);
-WRes Event_Set(CEvent *event);
-WRes Event_Reset(CEvent *event);
-WRes Event_Wait(CEvent *event);
-WRes Event_Close(CEvent *event);
-
-
-typedef struct _CSemaphore
-{
- HANDLE handle;
-} CSemaphore;
-
-#define Semaphore_Construct(p) (p)->handle = NULL
-
-WRes Semaphore_Create(CSemaphore *p, UInt32 initiallyCount, UInt32 maxCount);
-WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num);
-WRes Semaphore_Release1(CSemaphore *p);
-WRes Semaphore_Wait(CSemaphore *p);
-WRes Semaphore_Close(CSemaphore *p);
-
-
-typedef CRITICAL_SECTION CCriticalSection;
-
-WRes CriticalSection_Init(CCriticalSection *p);
-#define CriticalSection_Delete(p) DeleteCriticalSection(p)
-#define CriticalSection_Enter(p) EnterCriticalSection(p)
-#define CriticalSection_Leave(p) LeaveCriticalSection(p)
-
-#endif
-
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/C/Types.h b/BaseTools/Source/C/LzmaCompress/Sdk/C/Types.h
deleted file mode 100644
index 2638196aac..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/C/Types.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/* Types.h -- Basic types
-2008-11-23 : Igor Pavlov : Public domain */
-
-#ifndef __7Z_TYPES_H
-#define __7Z_TYPES_H
-
-#include <stddef.h>
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-#define SZ_OK 0
-
-#define SZ_ERROR_DATA 1
-#define SZ_ERROR_MEM 2
-#define SZ_ERROR_CRC 3
-#define SZ_ERROR_UNSUPPORTED 4
-#define SZ_ERROR_PARAM 5
-#define SZ_ERROR_INPUT_EOF 6
-#define SZ_ERROR_OUTPUT_EOF 7
-#define SZ_ERROR_READ 8
-#define SZ_ERROR_WRITE 9
-#define SZ_ERROR_PROGRESS 10
-#define SZ_ERROR_FAIL 11
-#define SZ_ERROR_THREAD 12
-
-#define SZ_ERROR_ARCHIVE 16
-#define SZ_ERROR_NO_ARCHIVE 17
-
-typedef int SRes;
-
-#ifdef _WIN32
-typedef DWORD WRes;
-#else
-typedef int WRes;
-#endif
-
-#ifndef RINOK
-#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
-#endif
-
-typedef unsigned char Byte;
-typedef short Int16;
-typedef unsigned short UInt16;
-
-#ifdef _LZMA_UINT32_IS_ULONG
-typedef long Int32;
-typedef unsigned long UInt32;
-#else
-typedef int Int32;
-typedef unsigned int UInt32;
-#endif
-
-#ifdef _SZ_NO_INT_64
-
-/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.
- NOTES: Some code will work incorrectly in that case! */
-
-typedef long Int64;
-typedef unsigned long UInt64;
-
-#else
-
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-typedef __int64 Int64;
-typedef unsigned __int64 UInt64;
-#else
-typedef long long int Int64;
-typedef unsigned long long int UInt64;
-#endif
-
-#endif
-
-#ifdef _LZMA_NO_SYSTEM_SIZE_T
-typedef UInt32 SizeT;
-#else
-typedef size_t SizeT;
-#endif
-
-typedef int Bool;
-#define True 1
-#define False 0
-
-
-#ifdef _MSC_VER
-
-#if _MSC_VER >= 1300
-#define MY_NO_INLINE __declspec(noinline)
-#else
-#define MY_NO_INLINE
-#endif
-
-#define MY_CDECL __cdecl
-#define MY_STD_CALL __stdcall
-#define MY_FAST_CALL MY_NO_INLINE __fastcall
-
-#else
-
-#define MY_CDECL
-#define MY_STD_CALL
-#define MY_FAST_CALL
-
-#endif
-
-
-/* The following interfaces use first parameter as pointer to structure */
-
-typedef struct
-{
- SRes (*Read)(void *p, void *buf, size_t *size);
- /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
- (output(*size) < input(*size)) is allowed */
-} ISeqInStream;
-
-/* it can return SZ_ERROR_INPUT_EOF */
-SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size);
-SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType);
-SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf);
-
-typedef struct
-{
- size_t (*Write)(void *p, const void *buf, size_t size);
- /* Returns: result - the number of actually written bytes.
- (result < size) means error */
-} ISeqOutStream;
-
-typedef enum
-{
- SZ_SEEK_SET = 0,
- SZ_SEEK_CUR = 1,
- SZ_SEEK_END = 2
-} ESzSeek;
-
-typedef struct
-{
- SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
- SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
-} ISeekInStream;
-
-typedef struct
-{
- SRes (*Look)(void *p, void **buf, size_t *size);
- /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
- (output(*size) > input(*size)) is not allowed
- (output(*size) < input(*size)) is allowed */
- SRes (*Skip)(void *p, size_t offset);
- /* offset must be <= output(*size) of Look */
-
- SRes (*Read)(void *p, void *buf, size_t *size);
- /* reads directly (without buffer). It's same as ISeqInStream::Read */
- SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
-} ILookInStream;
-
-SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size);
-SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset);
-
-/* reads via ILookInStream::Read */
-SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType);
-SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size);
-
-#define LookToRead_BUF_SIZE (1 << 14)
-
-typedef struct
-{
- ILookInStream s;
- ISeekInStream *realStream;
- size_t pos;
- size_t size;
- Byte buf[LookToRead_BUF_SIZE];
-} CLookToRead;
-
-void LookToRead_CreateVTable(CLookToRead *p, int lookahead);
-void LookToRead_Init(CLookToRead *p);
-
-typedef struct
-{
- ISeqInStream s;
- ILookInStream *realStream;
-} CSecToLook;
-
-void SecToLook_CreateVTable(CSecToLook *p);
-
-typedef struct
-{
- ISeqInStream s;
- ILookInStream *realStream;
-} CSecToRead;
-
-void SecToRead_CreateVTable(CSecToRead *p);
-
-typedef struct
-{
- SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize);
- /* Returns: result. (result != SZ_OK) means break.
- Value (UInt64)(Int64)-1 for size means unknown value. */
-} ICompressProgress;
-
-typedef struct
-{
- void *(*Alloc)(void *p, size_t size);
- void (*Free)(void *p, void *address); /* address can be 0 */
-} ISzAlloc;
-
-#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
-#define IAlloc_Free(p, a) (p)->Free((p), a)
-
-#endif
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/history.txt b/BaseTools/Source/C/LzmaCompress/Sdk/history.txt
deleted file mode 100644
index 9bed5ebbef..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/history.txt
+++ /dev/null
@@ -1,236 +0,0 @@
-HISTORY of the LZMA SDK
------------------------
-
-4.65 2009-02-03
--------------------------
-- Some minor fixes
-
-
-4.63 2008-12-31
--------------------------
-- Some minor fixes
-
-
-4.61 beta 2008-11-23
--------------------------
-- The bug in ANSI-C LZMA Decoder was fixed:
- If encoded stream was corrupted, decoder could access memory
- outside of allocated range.
-- Some changes in ANSI-C 7z Decoder interfaces.
-- LZMA SDK is placed in the public domain.
-
-
-4.60 beta 2008-08-19
--------------------------
-- Some minor fixes.
-
-
-4.59 beta 2008-08-13
--------------------------
-- The bug was fixed:
- LZMA Encoder in fast compression mode could access memory outside of
- allocated range in some rare cases.
-
-
-4.58 beta 2008-05-05
--------------------------
-- ANSI-C LZMA Decoder was rewritten for speed optimizations.
-- ANSI-C LZMA Encoder was included to LZMA SDK.
-- C++ LZMA code now is just wrapper over ANSI-C code.
-
-
-4.57 2007-12-12
--------------------------
-- Speed optimizations in Ñ++ LZMA Decoder.
-- Small changes for more compatibility with some C/C++ compilers.
-
-
-4.49 beta 2007-07-05
--------------------------
-- .7z ANSI-C Decoder:
- - now it supports BCJ and BCJ2 filters
- - now it supports files larger than 4 GB.
- - now it supports "Last Write Time" field for files.
-- C++ code for .7z archives compressing/decompressing from 7-zip
- was included to LZMA SDK.
-
-
-4.43 2006-06-04
--------------------------
-- Small changes for more compatibility with some C/C++ compilers.
-
-
-4.42 2006-05-15
--------------------------
-- Small changes in .h files in ANSI-C version.
-
-
-4.39 beta 2006-04-14
--------------------------
-- The bug in versions 4.33b:4.38b was fixed:
- C++ version of LZMA encoder could not correctly compress
- files larger than 2 GB with HC4 match finder (-mfhc4).
-
-
-4.37 beta 2005-04-06
--------------------------
-- Fixes in C++ code: code could no be compiled if _NO_EXCEPTIONS was defined.
-
-
-4.35 beta 2005-03-02
--------------------------
-- The bug was fixed in C++ version of LZMA Decoder:
- If encoded stream was corrupted, decoder could access memory
- outside of allocated range.
-
-
-4.34 beta 2006-02-27
--------------------------
-- Compressing speed and memory requirements for compressing were increased
-- LZMA now can use only these match finders: HC4, BT2, BT3, BT4
-
-
-4.32 2005-12-09
--------------------------
-- Java version of LZMA SDK was included
-
-
-4.30 2005-11-20
--------------------------
-- Compression ratio was improved in -a2 mode
-- Speed optimizations for compressing in -a2 mode
-- -fb switch now supports values up to 273
-- The bug in 7z_C (7zIn.c) was fixed:
- It used Alloc/Free functions from different memory pools.
- So if program used two memory pools, it worked incorrectly.
-- 7z_C: .7z format supporting was improved
-- LZMA# SDK (C#.NET version) was included
-
-
-4.27 (Updated) 2005-09-21
--------------------------
-- Some GUIDs/interfaces in C++ were changed.
- IStream.h:
- ISequentialInStream::Read now works as old ReadPart
- ISequentialOutStream::Write now works as old WritePart
-
-
-4.27 2005-08-07
--------------------------
-- The bug in LzmaDecodeSize.c was fixed:
- if _LZMA_IN_CB and _LZMA_OUT_READ were defined,
- decompressing worked incorrectly.
-
-
-4.26 2005-08-05
--------------------------
-- Fixes in 7z_C code and LzmaTest.c:
- previous versions could work incorrectly,
- if malloc(0) returns 0
-
-
-4.23 2005-06-29
--------------------------
-- Small fixes in C++ code
-
-
-4.22 2005-06-10
--------------------------
-- Small fixes
-
-
-4.21 2005-06-08
--------------------------
-- Interfaces for ANSI-C LZMA Decoder (LzmaDecode.c) were changed
-- New additional version of ANSI-C LZMA Decoder with zlib-like interface:
- - LzmaStateDecode.h
- - LzmaStateDecode.c
- - LzmaStateTest.c
-- ANSI-C LZMA Decoder now can decompress files larger than 4 GB
-
-
-4.17 2005-04-18
--------------------------
-- New example for RAM->RAM compressing/decompressing:
- LZMA + BCJ (filter for x86 code):
- - LzmaRam.h
- - LzmaRam.cpp
- - LzmaRamDecode.h
- - LzmaRamDecode.c
- - -f86 switch for lzma.exe
-
-
-4.16 2005-03-29
--------------------------
-- The bug was fixed in LzmaDecode.c (ANSI-C LZMA Decoder):
- If _LZMA_OUT_READ was defined, and if encoded stream was corrupted,
- decoder could access memory outside of allocated range.
-- Speed optimization of ANSI-C LZMA Decoder (now it's about 20% faster).
- Old version of LZMA Decoder now is in file LzmaDecodeSize.c.
- LzmaDecodeSize.c can provide slightly smaller code than LzmaDecode.c
-- Small speed optimization in LZMA C++ code
-- filter for SPARC's code was added
-- Simplified version of .7z ANSI-C Decoder was included
-
-
-4.06 2004-09-05
--------------------------
-- The bug in v4.05 was fixed:
- LZMA-Encoder didn't release output stream in some cases.
-
-
-4.05 2004-08-25
--------------------------
-- Source code of filters for x86, IA-64, ARM, ARM-Thumb
- and PowerPC code was included to SDK
-- Some internal minor changes
-
-
-4.04 2004-07-28
--------------------------
-- More compatibility with some C++ compilers
-
-
-4.03 2004-06-18
--------------------------
-- "Benchmark" command was added. It measures compressing
- and decompressing speed and shows rating values.
- Also it checks hardware errors.
-
-
-4.02 2004-06-10
--------------------------
-- C++ LZMA Encoder/Decoder code now is more portable
- and it can be compiled by GCC on Linux.
-
-
-4.01 2004-02-15
--------------------------
-- Some detection of data corruption was enabled.
- LzmaDecode.c / RangeDecoderReadByte
- .....
- {
- rd->ExtraBytes = 1;
- return 0xFF;
- }
-
-
-4.00 2004-02-13
--------------------------
-- Original version of LZMA SDK
-
-
-
-HISTORY of the LZMA
--------------------
- 2001-2008: Improvements to LZMA compressing/decompressing code,
- keeping compatibility with original LZMA format
- 1996-2001: Development of LZMA compression format
-
- Some milestones:
-
- 2001-08-30: LZMA compression was added to 7-Zip
- 1999-01-02: First version of 7-Zip was released
-
-
-End of document
diff --git a/BaseTools/Source/C/LzmaCompress/Sdk/lzma.txt b/BaseTools/Source/C/LzmaCompress/Sdk/lzma.txt
deleted file mode 100644
index d4f4af929a..0000000000
--- a/BaseTools/Source/C/LzmaCompress/Sdk/lzma.txt
+++ /dev/null
@@ -1,594 +0,0 @@
-LZMA SDK 4.65
--------------
-
-LZMA SDK provides the documentation, samples, header files, libraries,
-and tools you need to develop applications that use LZMA compression.
-
-LZMA is default and general compression method of 7z format
-in 7-Zip compression program (www.7-zip.org). LZMA provides high
-compression ratio and very fast decompression.
-
-LZMA is an improved version of famous LZ77 compression algorithm.
-It was improved in way of maximum increasing of compression ratio,
-keeping high decompression speed and low memory requirements for
-decompressing.
-
-
-
-LICENSE
--------
-
-LZMA SDK is written and placed in the public domain by Igor Pavlov.
-
-
-LZMA SDK Contents
------------------
-
-LZMA SDK includes:
-
- - ANSI-C/C++/C#/Java source code for LZMA compressing and decompressing
- - Compiled file->file LZMA compressing/decompressing program for Windows system
-
-
-UNIX/Linux version
-------------------
-To compile C++ version of file->file LZMA encoding, go to directory
-C++/7zip/Compress/LZMA_Alone
-and call make to recompile it:
- make -f makefile.gcc clean all
-
-In some UNIX/Linux versions you must compile LZMA with static libraries.
-To compile with static libraries, you can use
-LIB = -lm -static
-
-
-Files
----------------------
-lzma.txt - LZMA SDK description (this file)
-7zFormat.txt - 7z Format description
-7zC.txt - 7z ANSI-C Decoder description
-methods.txt - Compression method IDs for .7z
-lzma.exe - Compiled file->file LZMA encoder/decoder for Windows
-history.txt - history of the LZMA SDK
-
-
-Source code structure
----------------------
-
-C/ - C files
- 7zCrc*.* - CRC code
- Alloc.* - Memory allocation functions
- Bra*.* - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
- LzFind.* - Match finder for LZ (LZMA) encoders
- LzFindMt.* - Match finder for LZ (LZMA) encoders for multithreading encoding
- LzHash.h - Additional file for LZ match finder
- LzmaDec.* - LZMA decoding
- LzmaEnc.* - LZMA encoding
- LzmaLib.* - LZMA Library for DLL calling
- Types.h - Basic types for another .c files
- Threads.* - The code for multithreading.
-
- LzmaLib - LZMA Library (.DLL for Windows)
-
- LzmaUtil - LZMA Utility (file->file LZMA encoder/decoder).
-
- Archive - files related to archiving
- 7z - 7z ANSI-C Decoder
-
-CPP/ -- CPP files
-
- Common - common files for C++ projects
- Windows - common files for Windows related code
-
- 7zip - files related to 7-Zip Project
-
- Common - common files for 7-Zip
-
- Compress - files related to compression/decompression
-
- Copy - Copy coder
- RangeCoder - Range Coder (special code of compression/decompression)
- LZMA - LZMA compression/decompression on C++
- LZMA_Alone - file->file LZMA compression/decompression
- Branch - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
-
- Archive - files related to archiving
-
- Common - common files for archive handling
- 7z - 7z C++ Encoder/Decoder
-
- Bundles - Modules that are bundles of other modules
-
- Alone7z - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2
- Format7zR - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2
- Format7zExtractR - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2.
-
- UI - User Interface files
-
- Client7z - Test application for 7za.dll, 7zr.dll, 7zxr.dll
- Common - Common UI files
- Console - Code for console archiver
-
-
-
-CS/ - C# files
- 7zip
- Common - some common files for 7-Zip
- Compress - files related to compression/decompression
- LZ - files related to LZ (Lempel-Ziv) compression algorithm
- LZMA - LZMA compression/decompression
- LzmaAlone - file->file LZMA compression/decompression
- RangeCoder - Range Coder (special code of compression/decompression)
-
-Java/ - Java files
- SevenZip
- Compression - files related to compression/decompression
- LZ - files related to LZ (Lempel-Ziv) compression algorithm
- LZMA - LZMA compression/decompression
- RangeCoder - Range Coder (special code of compression/decompression)
-
-
-C/C++ source code of LZMA SDK is part of 7-Zip project.
-7-Zip source code can be downloaded from 7-Zip's SourceForge page:
-
- http://sourceforge.net/projects/sevenzip/
-
-
-
-LZMA features
--------------
- - Variable dictionary size (up to 1 GB)
- - Estimated compressing speed: about 2 MB/s on 2 GHz CPU
- - Estimated decompressing speed:
- - 20-30 MB/s on 2 GHz Core 2 or AMD Athlon 64
- - 1-2 MB/s on 200 MHz ARM, MIPS, PowerPC or other simple RISC
- - Small memory requirements for decompressing (16 KB + DictionarySize)
- - Small code size for decompressing: 5-8 KB
-
-LZMA decoder uses only integer operations and can be
-implemented in any modern 32-bit CPU (or on 16-bit CPU with some conditions).
-
-Some critical operations that affect the speed of LZMA decompression:
- 1) 32*16 bit integer multiply
- 2) Misspredicted branches (penalty mostly depends from pipeline length)
- 3) 32-bit shift and arithmetic operations
-
-The speed of LZMA decompressing mostly depends from CPU speed.
-Memory speed has no big meaning. But if your CPU has small data cache,
-overall weight of memory speed will slightly increase.
-
-
-How To Use
-----------
-
-Using LZMA encoder/decoder executable
---------------------------------------
-
-Usage: LZMA <e|d> inputFile outputFile [<switches>...]
-
- e: encode file
-
- d: decode file
-
- b: Benchmark. There are two tests: compressing and decompressing
- with LZMA method. Benchmark shows rating in MIPS (million
- instructions per second). Rating value is calculated from
- measured speed and it is normalized with Intel's Core 2 results.
- Also Benchmark checks possible hardware errors (RAM
- errors in most cases). Benchmark uses these settings:
- (-a1, -d21, -fb32, -mfbt4). You can change only -d parameter.
- Also you can change the number of iterations. Example for 30 iterations:
- LZMA b 30
- Default number of iterations is 10.
-
-<Switches>
-
-
- -a{N}: set compression mode 0 = fast, 1 = normal
- default: 1 (normal)
-
- d{N}: Sets Dictionary size - [0, 30], default: 23 (8MB)
- The maximum value for dictionary size is 1 GB = 2^30 bytes.
- Dictionary size is calculated as DictionarySize = 2^N bytes.
- For decompressing file compressed by LZMA method with dictionary
- size D = 2^N you need about D bytes of memory (RAM).
-
- -fb{N}: set number of fast bytes - [5, 273], default: 128
- Usually big number gives a little bit better compression ratio
- and slower compression process.
-
- -lc{N}: set number of literal context bits - [0, 8], default: 3
- Sometimes lc=4 gives gain for big files.
-
- -lp{N}: set number of literal pos bits - [0, 4], default: 0
- lp switch is intended for periodical data when period is
- equal 2^N. For example, for 32-bit (4 bytes)
- periodical data you can use lp=2. Often it's better to set lc0,
- if you change lp switch.
-
- -pb{N}: set number of pos bits - [0, 4], default: 2
- pb switch is intended for periodical data
- when period is equal 2^N.
-
- -mf{MF_ID}: set Match Finder. Default: bt4.
- Algorithms from hc* group doesn't provide good compression
- ratio, but they often works pretty fast in combination with
- fast mode (-a0).
-
- Memory requirements depend from dictionary size
- (parameter "d" in table below).
-
- MF_ID Memory Description
-
- bt2 d * 9.5 + 4MB Binary Tree with 2 bytes hashing.
- bt3 d * 11.5 + 4MB Binary Tree with 3 bytes hashing.
- bt4 d * 11.5 + 4MB Binary Tree with 4 bytes hashing.
- hc4 d * 7.5 + 4MB Hash Chain with 4 bytes hashing.
-
- -eos: write End Of Stream marker. By default LZMA doesn't write
- eos marker, since LZMA decoder knows uncompressed size
- stored in .lzma file header.
-
- -si: Read data from stdin (it will write End Of Stream marker).
- -so: Write data to stdout
-
-
-Examples:
-
-1) LZMA e file.bin file.lzma -d16 -lc0
-
-compresses file.bin to file.lzma with 64 KB dictionary (2^16=64K)
-and 0 literal context bits. -lc0 allows to reduce memory requirements
-for decompression.
-
-
-2) LZMA e file.bin file.lzma -lc0 -lp2
-
-compresses file.bin to file.lzma with settings suitable
-for 32-bit periodical data (for example, ARM or MIPS code).
-
-3) LZMA d file.lzma file.bin
-
-decompresses file.lzma to file.bin.
-
-
-Compression ratio hints
------------------------
-
-Recommendations
----------------
-
-To increase the compression ratio for LZMA compressing it's desirable
-to have aligned data (if it's possible) and also it's desirable to locate
-data in such order, where code is grouped in one place and data is
-grouped in other place (it's better than such mixing: code, data, code,
-data, ...).
-
-
-Filters
--------
-You can increase the compression ratio for some data types, using
-special filters before compressing. For example, it's possible to
-increase the compression ratio on 5-10% for code for those CPU ISAs:
-x86, IA-64, ARM, ARM-Thumb, PowerPC, SPARC.
-
-You can find C source code of such filters in C/Bra*.* files
-
-You can check the compression ratio gain of these filters with such
-7-Zip commands (example for ARM code):
-No filter:
- 7z a a1.7z a.bin -m0=lzma
-
-With filter for little-endian ARM code:
- 7z a a2.7z a.bin -m0=arm -m1=lzma
-
-It works in such manner:
-Compressing = Filter_encoding + LZMA_encoding
-Decompressing = LZMA_decoding + Filter_decoding
-
-Compressing and decompressing speed of such filters is very high,
-so it will not increase decompressing time too much.
-Moreover, it reduces decompression time for LZMA_decoding,
-since compression ratio with filtering is higher.
-
-These filters convert CALL (calling procedure) instructions
-from relative offsets to absolute addresses, so such data becomes more
-compressible.
-
-For some ISAs (for example, for MIPS) it's impossible to get gain from such filter.
-
-
-LZMA compressed file format
----------------------------
-Offset Size Description
- 0 1 Special LZMA properties (lc,lp, pb in encoded form)
- 1 4 Dictionary size (little endian)
- 5 8 Uncompressed size (little endian). -1 means unknown size
- 13 Compressed data
-
-
-ANSI-C LZMA Decoder
-~~~~~~~~~~~~~~~~~~~
-
-Please note that interfaces for ANSI-C code were changed in LZMA SDK 4.58.
-If you want to use old interfaces you can download previous version of LZMA SDK
-from sourceforge.net site.
-
-To use ANSI-C LZMA Decoder you need the following files:
-1) LzmaDec.h + LzmaDec.c + Types.h
-LzmaUtil/LzmaUtil.c is example application that uses these files.
-
-
-Memory requirements for LZMA decoding
--------------------------------------
-
-Stack usage of LZMA decoding function for local variables is not
-larger than 200-400 bytes.
-
-LZMA Decoder uses dictionary buffer and internal state structure.
-Internal state structure consumes
- state_size = (4 + (1.5 << (lc + lp))) KB
-by default (lc=3, lp=0), state_size = 16 KB.
-
-
-How To decompress data
-----------------------
-
-LZMA Decoder (ANSI-C version) now supports 2 interfaces:
-1) Single-call Decompressing
-2) Multi-call State Decompressing (zlib-like interface)
-
-You must use external allocator:
-Example:
-void *SzAlloc(void *p, size_t size) { p = p; return malloc(size); }
-void SzFree(void *p, void *address) { p = p; free(address); }
-ISzAlloc alloc = { SzAlloc, SzFree };
-
-You can use p = p; operator to disable compiler warnings.
-
-
-Single-call Decompressing
--------------------------
-When to use: RAM->RAM decompressing
-Compile files: LzmaDec.h + LzmaDec.c + Types.h
-Compile defines: no defines
-Memory Requirements:
- - Input buffer: compressed size
- - Output buffer: uncompressed size
- - LZMA Internal Structures: state_size (16 KB for default settings)
-
-Interface:
- int LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
- const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
- ELzmaStatus *status, ISzAlloc *alloc);
- In:
- dest - output data
- destLen - output data size
- src - input data
- srcLen - input data size
- propData - LZMA properties (5 bytes)
- propSize - size of propData buffer (5 bytes)
- finishMode - It has meaning only if the decoding reaches output limit (*destLen).
- LZMA_FINISH_ANY - Decode just destLen bytes.
- LZMA_FINISH_END - Stream must be finished after (*destLen).
- You can use LZMA_FINISH_END, when you know that
- current output buffer covers last bytes of stream.
- alloc - Memory allocator.
-
- Out:
- destLen - processed output size
- srcLen - processed input size
-
- Output:
- SZ_OK
- status:
- LZMA_STATUS_FINISHED_WITH_MARK
- LZMA_STATUS_NOT_FINISHED
- LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
- SZ_ERROR_DATA - Data error
- SZ_ERROR_MEM - Memory allocation error
- SZ_ERROR_UNSUPPORTED - Unsupported properties
- SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
-
- If LZMA decoder sees end_marker before reaching output limit, it returns OK result,
- and output value of destLen will be less than output buffer size limit.
-
- You can use multiple checks to test data integrity after full decompression:
- 1) Check Result and "status" variable.
- 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
- 3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
- You must use correct finish mode in that case. */
-
-
-Multi-call State Decompressing (zlib-like interface)
-----------------------------------------------------
-
-When to use: file->file decompressing
-Compile files: LzmaDec.h + LzmaDec.c + Types.h
-
-Memory Requirements:
- - Buffer for input stream: any size (for example, 16 KB)
- - Buffer for output stream: any size (for example, 16 KB)
- - LZMA Internal Structures: state_size (16 KB for default settings)
- - LZMA dictionary (dictionary size is encoded in LZMA properties header)
-
-1) read LZMA properties (5 bytes) and uncompressed size (8 bytes, little-endian) to header:
- unsigned char header[LZMA_PROPS_SIZE + 8];
- ReadFile(inFile, header, sizeof(header)
-
-2) Allocate CLzmaDec structures (state + dictionary) using LZMA properties
-
- CLzmaDec state;
- LzmaDec_Constr(&state);
- res = LzmaDec_Allocate(&state, header, LZMA_PROPS_SIZE, &g_Alloc);
- if (res != SZ_OK)
- return res;
-
-3) Init LzmaDec structure before any new LZMA stream. And call LzmaDec_DecodeToBuf in loop
-
- LzmaDec_Init(&state);
- for (;;)
- {
- ...
- int res = LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
- const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode);
- ...
- }
-
-
-4) Free all allocated structures
- LzmaDec_Free(&state, &g_Alloc);
-
-For full code example, look at C/LzmaUtil/LzmaUtil.c code.
-
-
-How To compress data
---------------------
-
-Compile files: LzmaEnc.h + LzmaEnc.c + Types.h +
-LzFind.c + LzFind.h + LzFindMt.c + LzFindMt.h + LzHash.h
-
-Memory Requirements:
- - (dictSize * 11.5 + 6 MB) + state_size
-
-Lzma Encoder can use two memory allocators:
-1) alloc - for small arrays.
-2) allocBig - for big arrays.
-
-For example, you can use Large RAM Pages (2 MB) in allocBig allocator for
-better compression speed. Note that Windows has bad implementation for
-Large RAM Pages.
-It's OK to use same allocator for alloc and allocBig.
-
-
-Single-call Compression with callbacks
---------------------------------------
-
-Check C/LzmaUtil/LzmaUtil.c as example,
-
-When to use: file->file decompressing
-
-1) you must implement callback structures for interfaces:
-ISeqInStream
-ISeqOutStream
-ICompressProgress
-ISzAlloc
-
-static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
-static void SzFree(void *p, void *address) { p = p; MyFree(address); }
-static ISzAlloc g_Alloc = { SzAlloc, SzFree };
-
- CFileSeqInStream inStream;
- CFileSeqOutStream outStream;
-
- inStream.funcTable.Read = MyRead;
- inStream.file = inFile;
- outStream.funcTable.Write = MyWrite;
- outStream.file = outFile;
-
-
-2) Create CLzmaEncHandle object;
-
- CLzmaEncHandle enc;
-
- enc = LzmaEnc_Create(&g_Alloc);
- if (enc == 0)
- return SZ_ERROR_MEM;
-
-
-3) initialize CLzmaEncProps properties;
-
- LzmaEncProps_Init(&props);
-
- Then you can change some properties in that structure.
-
-4) Send LZMA properties to LZMA Encoder
-
- res = LzmaEnc_SetProps(enc, &props);
-
-5) Write encoded properties to header
-
- Byte header[LZMA_PROPS_SIZE + 8];
- size_t headerSize = LZMA_PROPS_SIZE;
- UInt64 fileSize;
- int i;
-
- res = LzmaEnc_WriteProperties(enc, header, &headerSize);
- fileSize = MyGetFileLength(inFile);
- for (i = 0; i < 8; i++)
- header[headerSize++] = (Byte)(fileSize >> (8 * i));
- MyWriteFileAndCheck(outFile, header, headerSize)
-
-6) Call encoding function:
- res = LzmaEnc_Encode(enc, &outStream.funcTable, &inStream.funcTable,
- NULL, &g_Alloc, &g_Alloc);
-
-7) Destroy LZMA Encoder Object
- LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc);
-
-
-If callback function return some error code, LzmaEnc_Encode also returns that code.
-
-
-Single-call RAM->RAM Compression
---------------------------------
-
-Single-call RAM->RAM Compression is similar to Compression with callbacks,
-but you provide pointers to buffers instead of pointers to stream callbacks:
-
-HRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
- CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
- ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
-
-Return code:
- SZ_OK - OK
- SZ_ERROR_MEM - Memory allocation error
- SZ_ERROR_PARAM - Incorrect paramater
- SZ_ERROR_OUTPUT_EOF - output buffer overflow
- SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
-
-
-
-LZMA Defines
-------------
-
-_LZMA_SIZE_OPT - Enable some optimizations in LZMA Decoder to get smaller executable code.
-
-_LZMA_PROB32 - It can increase the speed on some 32-bit CPUs, but memory usage for
- some structures will be doubled in that case.
-
-_LZMA_UINT32_IS_ULONG - Define it if int is 16-bit on your compiler and long is 32-bit.
-
-_LZMA_NO_SYSTEM_SIZE_T - Define it if you don't want to use size_t type.
-
-
-C++ LZMA Encoder/Decoder
-~~~~~~~~~~~~~~~~~~~~~~~~
-C++ LZMA code use COM-like interfaces. So if you want to use it,
-you can study basics of COM/OLE.
-C++ LZMA code is just wrapper over ANSI-C code.
-
-
-C++ Notes
-~~~~~~~~~~~~~~~~~~~~~~~~
-If you use some C++ code folders in 7-Zip (for example, C++ code for .7z handling),
-you must check that you correctly work with "new" operator.
-7-Zip can be compiled with MSVC 6.0 that doesn't throw "exception" from "new" operator.
-So 7-Zip uses "CPP\Common\NewHandler.cpp" that redefines "new" operator:
-operator new(size_t size)
-{
- void *p = ::malloc(size);
- if (p == 0)
- throw CNewException();
- return p;
-}
-If you use MSCV that throws exception for "new" operator, you can compile without
-"NewHandler.cpp". So standard exception will be used. Actually some code of
-7-Zip catches any exception in internal code and converts it to HRESULT code.
-So you don't need to catch CNewException, if you call COM interfaces of 7-Zip.
-
----
-
-http://www.7-zip.org
-http://www.7-zip.org/sdk.html
-http://www.7-zip.org/support.html
diff --git a/BaseTools/Source/C/Makefile b/BaseTools/Source/C/Makefile
deleted file mode 100644
index 789e06f18d..0000000000
--- a/BaseTools/Source/C/Makefile
+++ /dev/null
@@ -1,74 +0,0 @@
-## @file
-# Windows makefile for C tools build.
-#
-# Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH = IA32
-
-!INCLUDE Makefiles\ms.common
-
-LIBRARIES = Common
-APPLICATIONS = \
- BootSectImage \
- EfiLdrImage \
- EfiRom \
- GenBootSector \
- GenCrc32 \
- GenFfs \
- GenFv \
- GenFw \
- GenPage \
- GenSec \
- GenVtf \
- LzmaCompress \
- Split \
- TianoCompress \
- VolInfo \
- VfrCompile
-
-all: libs apps install
-
-libs: $(LIBRARIES)
- @echo.
- @echo ######################
- @echo # Build libraries
- @echo ######################
- @if not exist $(LIB_PATH) mkdir $(LIB_PATH)
- @Makefiles\NmakeSubdirs.bat all $**
-
-apps: $(APPLICATIONS)
- @echo.
- @echo ######################
- @echo # Build executables
- @echo ######################
- @if not exist $(BIN_PATH) mkdir $(BIN_PATH)
- @Makefiles\NmakeSubdirs.bat all $**
-
-install: $(LIB_PATH) $(BIN_PATH)
- @echo.
- @echo ######################
- @echo # Install to $(SYS_LIB_PATH)
- @echo # Install to $(SYS_BIN_PATH)
- @echo ######################
- @-xcopy $(LIB_PATH)\*.lib $(SYS_LIB_PATH) /I /D /E /F /Y > NUL 2>&1
- @-xcopy $(BIN_PATH)\*.exe $(SYS_BIN_PATH) /I /D /E /F /Y > NUL 2>&1
- @-xcopy $(BIN_PATH)\*.bat $(SYS_BIN_PATH) /I /D /E /F /Y > NUL 2>&1
-
-.PHONY: clean
-clean:
- @Makefiles\NmakeSubdirs.bat clean $(LIBRARIES) $(APPLICATIONS)
-
-.PHONY: cleanall
-cleanall:
- @Makefiles\NmakeSubdirs.bat cleanall $(LIBRARIES) $(APPLICATIONS)
- @del /f /q $(BIN_PATH)\*.pdb $(BIN_PATH)\*.ilk
-
-!INCLUDE Makefiles\ms.rule
-
diff --git a/BaseTools/Source/C/Makefiles/NmakeSubdirs.bat b/BaseTools/Source/C/Makefiles/NmakeSubdirs.bat
deleted file mode 100644
index 25b8790ac5..0000000000
--- a/BaseTools/Source/C/Makefiles/NmakeSubdirs.bat
+++ /dev/null
@@ -1,40 +0,0 @@
-@REM ## @file
-@REM #
-@REM # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-@REM # This program and the accompanying materials
-@REM # are licensed and made available under the terms and conditions of the BSD License
-@REM # which accompanies this distribution. The full text of the license may be found at
-@REM # http://opensource.org/licenses/bsd-license.php
-@REM #
-@REM # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-@REM # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
-@echo off
-setlocal
-SET NMAKE_COMMAND=%1
-SHIFT
-
-:loop
-if "%1"=="" goto success
-
-ECHO Building %1
-pushd %1
-nmake %NMAKE_COMMAND%
-if ERRORLEVEL 1 goto error
-ECHO %1 built successfully (%NMAKE_COMMAND%)
-ECHO.
-shift
-popd
-goto loop
-
-:success
-goto exit
-
-:error
-popd
-ENDLOCAL
-ECHO Error while making %1!
-VERIFY OTHER 2>NUL
-
-:exit
diff --git a/BaseTools/Source/C/Makefiles/app.makefile b/BaseTools/Source/C/Makefiles/app.makefile
deleted file mode 100644
index ed2e2fba08..0000000000
--- a/BaseTools/Source/C/Makefiles/app.makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-## @file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-MAKEROOT ?= ../..
-
-include $(MAKEROOT)/Makefiles/header.makefile
-
-APPLICATION = $(MAKEROOT)/bin/$(APPNAME)
-
-.PHONY:all
-all: $(MAKEROOT)/bin $(APPLICATION)
-
-$(APPLICATION): $(OBJECTS)
- $(LINKER) -o $(APPLICATION) $(LFLAGS) $(OBJECTS) -L$(MAKEROOT)/libs $(LIBS)
-
-$(OBJECTS): ../Include/Common/BuildVersion.h
-
-include $(MAKEROOT)/Makefiles/footer.makefile
diff --git a/BaseTools/Source/C/Makefiles/footer.makefile b/BaseTools/Source/C/Makefiles/footer.makefile
deleted file mode 100644
index de7114257d..0000000000
--- a/BaseTools/Source/C/Makefiles/footer.makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-## @file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-DEPFILES = $(OBJECTS:%.o=%.d)
-
-$(MAKEROOT)/libs-$(ARCH):
- mkdir -p $(MAKEROOT)/libs-$(ARCH)
-
-.PHONY: install
-install: $(MAKEROOT)/libs-$(ARCH) $(LIBRARY)
- cp $(LIBRARY) $(MAKEROOT)/libs-$(ARCH)
-
-$(LIBRARY): $(OBJECTS)
- $(AR) crs $@ $^
-
-%.o : %.c
- $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
-
-%.o : %.S
- $(AS) -c $(ASFLAGS) $< -o $@
-
-.PHONY: clean
-clean:
- @rm -f $(OBJECTS) $(LIBRARY) $(DEPFILES)
-
--include $(DEPFILES)
diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
deleted file mode 100644
index 6895f98c6e..0000000000
--- a/BaseTools/Source/C/Makefiles/header.makefile
+++ /dev/null
@@ -1,72 +0,0 @@
-## @file
-#
-# The makefile can be invoked with
-# ARCH = x86_64 or x64 for EM64T build
-# ARCH = ia32 or IA32 for IA32 build
-# ARCH = ia64 or IA64 for IA64 build
-# ARCH = Arm or ARM for ARM build
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-ARCH ?= IA32
-
-CYGWIN:=$(findstring CYGWIN, $(shell uname -s))
-LINUX:=$(findstring Linux, $(shell uname -s))
-DARWIN:=$(findstring Darwin, $(shell uname -s))
-
-CC = gcc
-CXX = g++
-AS = gcc
-AR = ar
-LD = ld
-LINKER ?= $(CC)
-ifeq ($(ARCH), IA32)
-ARCH_INCLUDE = -I $(MAKEROOT)/Include/Ia32/
-endif
-
-ifeq ($(ARCH), X64)
-ARCH_INCLUDE = -I $(MAKEROOT)/Include/X64/
-endif
-
-ifeq ($(ARCH), ARM)
-ARCH_INCLUDE = -I $(MAKEROOT)/Include/Arm/
-endif
-
-INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
-CPPFLAGS = $(INCLUDE)
-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fno-merge-constants -nostdlib -Wall -Werror -c -g
-LFLAGS =
-
-ifeq ($(ARCH), IA32)
-#
-# Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
-# to x86_64. So make sure tools match uname -m. You can manual have a 64-bit kernal on Snow Leopard
-# so only do this is uname -m returns i386.
-#
-uname_s = $(shell uname -s)
-ifeq ($(uname_s),Darwin)
- CFLAGS += -arch i386
- CPPFLAGS += -arch i386
- LFLAGS += -arch i386
-endif
-endif
-
-
-.PHONY: all
-.PHONY: install
-.PHONY: clean
-
-all:
-
-$(MAKEROOT)/libs:
- mkdir $(MAKEROOT)/libs
-
-$(MAKEROOT)/bin:
- mkdir $(MAKEROOT)/bin
diff --git a/BaseTools/Source/C/Makefiles/lib.makefile b/BaseTools/Source/C/Makefiles/lib.makefile
deleted file mode 100644
index dc8d90ccca..0000000000
--- a/BaseTools/Source/C/Makefiles/lib.makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-## @file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-include $(MAKEROOT)/Makefiles/header.makefile
-
-LIBRARY = $(MAKEROOT)/libs/lib$(LIBNAME).a
-
-all: $(MAKEROOT)/libs $(LIBRARY)
-
-include $(MAKEROOT)/Makefiles/footer.makefile
diff --git a/BaseTools/Source/C/Makefiles/ms.app b/BaseTools/Source/C/Makefiles/ms.app
deleted file mode 100644
index 7812175e7f..0000000000
--- a/BaseTools/Source/C/Makefiles/ms.app
+++ /dev/null
@@ -1,34 +0,0 @@
-## @file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-!INCLUDE ..\Makefiles\ms.common
-
-APPLICATION = $(BIN_PATH)\$(APPNAME).exe
-
-all: $(APPLICATION)
-
-$(APPLICATION) : $(OBJECTS)
- -@if not exist $(BIN_PATH) mkdir $(BIN_PATH)
- $(LD) /nologo /debug /incremental:no /nodefaultlib:libc.lib /out:$@ $(LIBS) $**
-
-$(OBJECTS) : ..\Include\Common\BuildVersion.h
-
-.PHONY:clean
-.PHONY:cleanall
-
-clean:
- del /f /q $(OBJECTS) *.pdb > nul
-
-cleanall:
- del /f /q $(OBJECTS) $(APPLICATION) *.pdb $(BIN_PATH)\*.pdb > nul
-
-!INCLUDE ..\Makefiles\ms.rule
-
diff --git a/BaseTools/Source/C/Makefiles/ms.common b/BaseTools/Source/C/Makefiles/ms.common
deleted file mode 100644
index d2fbc453ee..0000000000
--- a/BaseTools/Source/C/Makefiles/ms.common
+++ /dev/null
@@ -1,60 +0,0 @@
-## @file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-!IFNDEF EDK_TOOLS_PATH
-!ERROR "Please set your EDK_TOOLS_PATH!"
-!ENDIF
-
-!IFNDEF BASE_TOOLS_PATH
-!ERROR "BASE_TOOLS_PATH is not set! Please run build_tools.bat at first!"
-!ENDIF
-
-!IFNDEF ARCH
-ARCH = IA32
-!ENDIF
-
-MAKE = nmake -nologo
-
-SOURCE_PATH = $(BASE_TOOLS_PATH)\Source\C
-BIN_PATH = $(BASE_TOOLS_PATH)\Bin
-LIB_PATH = $(BASE_TOOLS_PATH)\Lib
-
-SYS_BIN_PATH=$(EDK_TOOLS_PATH)\Bin
-SYS_LIB_PATH=$(EDK_TOOLS_PATH)\Lib
-
-!IF "$(ARCH)"=="IA32"
-ARCH_INCLUDE = $(SOURCE_PATH)\Include\Ia32
-BIN_PATH = $(BASE_TOOLS_PATH)\Bin\Win32
-LIB_PATH = $(BASE_TOOLS_PATH)\Lib\Win32
-SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win32
-SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win32
-!ENDIF
-
-!IF "$(ARCH)"=="X64"
-ARCH_INCLUDE = $(SOURCE_PATH)\Include\X64
-BIN_PATH = $(BASE_TOOLS_PATH)\Bin\Win64
-LIB_PATH = $(BASE_TOOLS_PATH)\Lib\Win64
-SYS_BIN_PATH = $(EDK_TOOLS_PATH)\Bin\Win64
-SYS_LIB_PATH = $(EDK_TOOLS_PATH)\Lib\Win64
-!ENDIF
-
-CC = cl.exe
-CXX = cl.exe
-AS = ml.exe
-AR = lib.exe
-LD = link.exe
-LINKER = $(LD)
-
-INC = -I . -I $(SOURCE_PATH)\Include -I $(ARCH_INCLUDE) -I $(SOURCE_PATH)\Common $(INC)
-
-CFLAGS = $(CFLAGS) /nologo /c /Zi /Od /RTC1 /D _DEBUG /MTd /W4 /WX /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
-CPPFLAGS = $(CPPFLAGS) /EHsc /nologo /c /Zi /Od /RTC1 /D _DEBUG /MTd /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
-
diff --git a/BaseTools/Source/C/Makefiles/ms.lib b/BaseTools/Source/C/Makefiles/ms.lib
deleted file mode 100644
index 0e418f3c8f..0000000000
--- a/BaseTools/Source/C/Makefiles/ms.lib
+++ /dev/null
@@ -1,31 +0,0 @@
-## @file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-!INCLUDE ..\Makefiles\ms.common
-
-LIBRARY = $(LIB_PATH)\$(LIBNAME).lib
-
-all: $(LIBRARY)
-
-$(LIBRARY) : $(OBJECTS)
- -@if not exist $(LIB_PATH) mkdir $(LIB_PATH)
- $(AR) /nologo /out:$@ $**
-
-.PHONY:clean
-clean:
- del /f /q $(OBJECTS) *.pdb > nul
-
-.PHONY:cleanall
-cleanall:
- del /f /q $(OBJECTS) $(LIBRARY) *.pdb > nul
-
-!INCLUDE ..\Makefiles\ms.rule
-
diff --git a/BaseTools/Source/C/Makefiles/ms.rule b/BaseTools/Source/C/Makefiles/ms.rule
deleted file mode 100644
index afbd5dcc4b..0000000000
--- a/BaseTools/Source/C/Makefiles/ms.rule
+++ /dev/null
@@ -1,24 +0,0 @@
-## @file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-#DEPFILES = $(OBJECTS:%.o=%.d)
-
-.c.obj :
- $(CC) -c $(CFLAGS) $(INC) $< -Fo$@
-
-.S.obj :
- $(AS) -c $(ASFLAGS) $< -Fo$@
-
-.cpp.obj :
- $(CXX) -c $(CPPFLAGS) $(INC) $< -Fo$@
-
-#-include $(DEPFILES)
-
diff --git a/BaseTools/Source/C/PyEfiCompressor/EfiCompressor.c b/BaseTools/Source/C/PyEfiCompressor/EfiCompressor.c
deleted file mode 100644
index cf37c0c100..0000000000
--- a/BaseTools/Source/C/PyEfiCompressor/EfiCompressor.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/** @file
-
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Python.h>
-#include <Decompress.h>
-
-/*
- UefiDecompress(data_buffer, size, original_size)
-*/
-STATIC
-PyObject*
-UefiDecompress(
- PyObject *Self,
- PyObject *Args
- )
-{
- PyObject *SrcData;
- UINT32 SrcDataSize;
- UINT32 DstDataSize;
- UINTN Status;
- UINT8 *SrcBuf;
- UINT8 *DstBuf;
- UINT8 *TmpBuf;
- Py_ssize_t SegNum;
- Py_ssize_t Index;
-
- Status = PyArg_ParseTuple(
- Args,
- "Oi",
- &SrcData,
- &SrcDataSize
- );
- if (Status == 0) {
- return NULL;
- }
-
- if (SrcData->ob_type->tp_as_buffer == NULL
- || SrcData->ob_type->tp_as_buffer->bf_getreadbuffer == NULL
- || SrcData->ob_type->tp_as_buffer->bf_getsegcount == NULL) {
- PyErr_SetString(PyExc_Exception, "First argument is not a buffer\n");
- return NULL;
- }
-
- // Because some Python objects which support "buffer" protocol have more than one
- // memory segment, we have to copy them into a contiguous memory.
- SrcBuf = PyMem_Malloc(SrcDataSize);
- if (SrcBuf == NULL) {
- PyErr_SetString(PyExc_Exception, "Not enough memory\n");
- goto ERROR;
- }
-
- SegNum = SrcData->ob_type->tp_as_buffer->bf_getsegcount((PyObject *)SrcData, NULL);
- TmpBuf = SrcBuf;
- for (Index = 0; Index < SegNum; ++Index) {
- VOID *BufSeg;
- Py_ssize_t Len;
-
- Len = SrcData->ob_type->tp_as_buffer->bf_getreadbuffer((PyObject *)SrcData, Index, &BufSeg);
- if (Len < 0) {
- PyErr_SetString(PyExc_Exception, "Buffer segment is not available\n");
- goto ERROR;
- }
- memcpy(TmpBuf, BufSeg, Len);
- TmpBuf += Len;
- }
-
- Status = Extract((VOID *)SrcBuf, SrcDataSize, (VOID **)&DstBuf, &DstDataSize, 1);
- if (Status != EFI_SUCCESS) {
- PyErr_SetString(PyExc_Exception, "Failed to decompress\n");
- goto ERROR;
- }
-
- return PyBuffer_FromMemory(DstBuf, (Py_ssize_t)DstDataSize);
-
-ERROR:
- if (SrcBuf != NULL) {
- free(SrcBuf);
- }
-
- if (DstBuf != NULL) {
- free(DstBuf);
- }
- return NULL;
-}
-
-
-STATIC
-PyObject*
-FrameworkDecompress(
- PyObject *Self,
- PyObject *Args
- )
-{
- PyObject *SrcData;
- UINT32 SrcDataSize;
- UINT32 DstDataSize;
- UINTN Status;
- UINT8 *SrcBuf;
- UINT8 *DstBuf;
- UINT8 *TmpBuf;
- Py_ssize_t SegNum;
- Py_ssize_t Index;
-
- Status = PyArg_ParseTuple(
- Args,
- "Oi",
- &SrcData,
- &SrcDataSize
- );
- if (Status == 0) {
- return NULL;
- }
-
- if (SrcData->ob_type->tp_as_buffer == NULL
- || SrcData->ob_type->tp_as_buffer->bf_getreadbuffer == NULL
- || SrcData->ob_type->tp_as_buffer->bf_getsegcount == NULL) {
- PyErr_SetString(PyExc_Exception, "First argument is not a buffer\n");
- return NULL;
- }
-
- // Because some Python objects which support "buffer" protocol have more than one
- // memory segment, we have to copy them into a contiguous memory.
- SrcBuf = PyMem_Malloc(SrcDataSize);
- if (SrcBuf == NULL) {
- PyErr_SetString(PyExc_Exception, "Not enough memory\n");
- goto ERROR;
- }
-
- SegNum = SrcData->ob_type->tp_as_buffer->bf_getsegcount((PyObject *)SrcData, NULL);
- TmpBuf = SrcBuf;
- for (Index = 0; Index < SegNum; ++Index) {
- VOID *BufSeg;
- Py_ssize_t Len;
-
- Len = SrcData->ob_type->tp_as_buffer->bf_getreadbuffer((PyObject *)SrcData, Index, &BufSeg);
- if (Len < 0) {
- PyErr_SetString(PyExc_Exception, "Buffer segment is not available\n");
- goto ERROR;
- }
- memcpy(TmpBuf, BufSeg, Len);
- TmpBuf += Len;
- }
-
- Status = Extract((VOID *)SrcBuf, SrcDataSize, (VOID **)&DstBuf, &DstDataSize, 2);
- if (Status != EFI_SUCCESS) {
- PyErr_SetString(PyExc_Exception, "Failed to decompress\n");
- goto ERROR;
- }
-
- return PyString_FromStringAndSize((CONST INT8*)DstBuf, (Py_ssize_t)DstDataSize);
-
-ERROR:
- if (SrcBuf != NULL) {
- free(SrcBuf);
- }
-
- if (DstBuf != NULL) {
- free(DstBuf);
- }
- return NULL;
-}
-
-
-STATIC
-PyObject*
-UefiCompress(
- PyObject *Self,
- PyObject *Args
- )
-{
- return NULL;
-}
-
-
-STATIC
-PyObject*
-FrameworkCompress(
- PyObject *Self,
- PyObject *Args
- )
-{
- return NULL;
-}
-
-STATIC INT8 DecompressDocs[] = "Decompress(): Decompress data using UEFI standard algorithm\n";
-STATIC INT8 CompressDocs[] = "Compress(): Compress data using UEFI standard algorithm\n";
-
-STATIC PyMethodDef EfiCompressor_Funcs[] = {
- {"UefiDecompress", (PyCFunction)UefiDecompress, METH_VARARGS, DecompressDocs},
- {"UefiCompress", (PyCFunction)UefiCompress, METH_VARARGS, DecompressDocs},
- {"FrameworkDecompress", (PyCFunction)FrameworkDecompress, METH_VARARGS, DecompressDocs},
- {"FrameworkCompress", (PyCFunction)FrameworkCompress, METH_VARARGS, DecompressDocs},
- {NULL, NULL, 0, NULL}
-};
-
-PyMODINIT_FUNC
-initEfiCompressor(VOID) {
- Py_InitModule3("EfiCompressor", EfiCompressor_Funcs, "EFI Compression Algorithm Extension Module");
-}
-
-
diff --git a/BaseTools/Source/C/PyEfiCompressor/Makefile b/BaseTools/Source/C/PyEfiCompressor/Makefile
deleted file mode 100644
index d52a3454b7..0000000000
--- a/BaseTools/Source/C/PyEfiCompressor/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-## @file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = GenSec
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = GenSec.obj
-
-#CFLAGS = $(CFLAGS) /nodefaultlib:libc.lib
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/PyEfiCompressor/setup.py b/BaseTools/Source/C/PyEfiCompressor/setup.py
deleted file mode 100644
index e0cf5ef5d5..0000000000
--- a/BaseTools/Source/C/PyEfiCompressor/setup.py
+++ /dev/null
@@ -1,43 +0,0 @@
-## @file
-# package and install PyEfiCompressor extension
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from distutils.core import setup, Extension
-import os
-
-if 'BASE_TOOLS_PATH' not in os.environ:
- raise "Please define BASE_TOOLS_PATH to the root of base tools tree"
-
-BaseToolsDir = os.environ['BASE_TOOLS_PATH']
-setup(
- name="EfiCompressor",
- version="0.01",
- ext_modules=[
- Extension(
- 'EfiCompressor',
- sources=[
- os.path.join(BaseToolsDir, 'Source', 'C', 'Common', 'Decompress.c'),
- 'EfiCompressor.c'
- ],
- include_dirs=[
- os.path.join(BaseToolsDir, 'Source', 'C', 'Include'),
- os.path.join(BaseToolsDir, 'Source', 'C', 'Include', 'Ia32'),
- os.path.join(BaseToolsDir, 'Source', 'C', 'Common')
- ],
- )
- ],
- )
-
diff --git a/BaseTools/Source/C/PyUtility/Makefile b/BaseTools/Source/C/PyUtility/Makefile
deleted file mode 100644
index 71d4d542bd..0000000000
--- a/BaseTools/Source/C/PyUtility/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-## @file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = GenSec
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = PyUtility.obj
-
-#CFLAGS = $(CFLAGS) /nodefaultlib:libc.lib
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/PyUtility/PyUtility.c b/BaseTools/Source/C/PyUtility/PyUtility.c
deleted file mode 100644
index ff3ad9443b..0000000000
--- a/BaseTools/Source/C/PyUtility/PyUtility.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/** @file
-
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Python.h>
-#include <Windows.h>
-#include <Common/UefiBaseTypes.h>
-
-/*
- SaveFileToDisk(FilePath, Content)
-*/
-STATIC
-PyObject*
-SaveFileToDisk (
- PyObject *Self,
- PyObject *Args
- )
-{
- CHAR8 *File;
- UINT8 *Data;
- UINTN DataLength;
- UINTN WriteBytes;
- UINTN Status;
- HANDLE FileHandle;
- PyObject *ReturnValue = Py_False;
-
- Status = PyArg_ParseTuple(
- Args,
- "ss#",
- &File,
- &Data,
- &DataLength
- );
- if (Status == 0) {
- return NULL;
- }
-
- FileHandle = CreateFile(
- File,
- GENERIC_WRITE,
- FILE_SHARE_WRITE|FILE_SHARE_READ|FILE_SHARE_DELETE,
- NULL,
- CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL,
- NULL
- );
- if (FileHandle == INVALID_HANDLE_VALUE) {
- PyErr_SetString(PyExc_Exception, "File creation failure");
- return NULL;
- }
-
- while (WriteFile(FileHandle, Data, DataLength, &WriteBytes, NULL)) {
- if (DataLength <= WriteBytes) {
- DataLength = 0;
- break;
- }
-
- Data += WriteBytes;
- DataLength -= WriteBytes;
- }
-
- if (DataLength != 0) {
- // file saved unsuccessfully
- PyErr_SetString(PyExc_Exception, "File write failure");
- goto Done;
- }
-
- //
- // Flush buffer may slow down the whole build performance (average 10s slower)
- //
- //if (!FlushFileBuffers(FileHandle)) {
- // PyErr_SetString(PyExc_Exception, "File flush failure");
- // goto Done;
- //}
-
- // success!
- ReturnValue = Py_True;
-
-Done:
- CloseHandle(FileHandle);
- return ReturnValue;
-}
-
-STATIC INT8 SaveFileToDiskDocs[] = "SaveFileToDisk(): Make sure the file is saved to disk\n";
-
-STATIC PyMethodDef PyUtility_Funcs[] = {
- {"SaveFileToDisk", (PyCFunction)SaveFileToDisk, METH_VARARGS, SaveFileToDiskDocs},
- {NULL, NULL, 0, NULL}
-};
-
-PyMODINIT_FUNC
-initPyUtility(VOID) {
- Py_InitModule3("PyUtility", PyUtility_Funcs, "Utilties Module Implemented C Language");
-}
-
-
diff --git a/BaseTools/Source/C/PyUtility/setup.py b/BaseTools/Source/C/PyUtility/setup.py
deleted file mode 100644
index e4d407d84f..0000000000
--- a/BaseTools/Source/C/PyUtility/setup.py
+++ /dev/null
@@ -1,42 +0,0 @@
-## @file
-# package and install PyEfiCompressor extension
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from distutils.core import setup, Extension
-import os
-
-if 'BASE_TOOLS_PATH' not in os.environ:
- raise "Please define BASE_TOOLS_PATH to the root of base tools tree"
-
-BaseToolsDir = os.environ['BASE_TOOLS_PATH']
-setup(
- name="PyUtility",
- version="0.01",
- ext_modules=[
- Extension(
- 'PyUtility',
- sources=[
- 'PyUtility.c'
- ],
- include_dirs=[
- os.path.join(BaseToolsDir, 'Source', 'C', 'Include'),
- os.path.join(BaseToolsDir, 'Source', 'C', 'Include', 'Ia32'),
- os.path.join(BaseToolsDir, 'Source', 'C', 'Common')
- ],
- )
- ],
- )
-
diff --git a/BaseTools/Source/C/Split/GNUmakefile b/BaseTools/Source/C/Split/GNUmakefile
deleted file mode 100644
index e38a01f8c1..0000000000
--- a/BaseTools/Source/C/Split/GNUmakefile
+++ /dev/null
@@ -1,24 +0,0 @@
-## @file
-# GNU/Linux makefile for 'Split' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = Split
-
-OBJECTS = Split.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
-
-LIBS = -lCommon
-
-
diff --git a/BaseTools/Source/C/Split/Makefile b/BaseTools/Source/C/Split/Makefile
deleted file mode 100644
index 0fbc5e3dc2..0000000000
--- a/BaseTools/Source/C/Split/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'Split' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = Split
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = Split.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/Split/Split.c b/BaseTools/Source/C/Split/Split.c
deleted file mode 100644
index 544da91f4b..0000000000
--- a/BaseTools/Source/C/Split/Split.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/** @file
-
- Split a file into two pieces at the request offset.
-
-Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available
-under the terms and conditions of the BSD License which accompanies this
-distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-// GC_TODO: fix comment to start with /*++
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#ifdef __GNUC__
-#include <unistd.h>
-#else
-#include <direct.h>
-#endif
-#include <ctype.h>
-#include "ParseInf.h"
-#include "CommonLib.h"
-#include "EfiUtilityMsgs.h"
-//
-// Utility Name
-//
-#define UTILITY_NAME "Split"
-
-//
-// Utility version information
-//
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-void
-Version (
- void
- )
-/*++
-
-Routine Description:
-
- Displays the standard utility information to SDTOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- printf ("%s v%d.%d %s -Utility to break a file into two pieces at the request offset.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
- printf ("Copyright (c) 1999-2010 Intel Corporation. All rights reserved.\n");
-}
-
-void
-Usage (
- void
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
-
-Returns:
-
- GC_TODO: add return values
-
---*/
-{
- Version();
- printf ("\nUsage: \n\
- Split\n\
- -f, --filename inputFile to split\n\
- -s, --split VALUE the number of bytes in the first file\n\
- [-p, --prefix OutputDir]\n\
- [-o, --firstfile Filename1]\n\
- [-t, --secondfile Filename2]\n\
- [-v, --verbose]\n\
- [--version]\n\
- [-q, --quiet disable all messages except fatal errors]\n\
- [-d, --debug[#]\n\
- [-h, --help]\n");
-}
-
-EFI_STATUS
-GetSplitValue (
- IN CONST CHAR8* SplitValueString,
- OUT UINT64 *ReturnValue
-)
-{
- UINT64 len = strlen(SplitValueString);
- UINT64 base = 1;
- UINT64 index = 0;
- UINT64 number = 0;
- CHAR8 lastCHAR = 0;
- EFI_STATUS Status = EFI_SUCCESS;
-
- if (len == 0) {
- return EFI_ABORTED;
- }
-
- Status = AsciiStringToUint64 (SplitValueString, FALSE, ReturnValue);
- if (!EFI_ERROR (Status)) {
- return Status;
- }
-
- if (SplitValueString[0] == '0' && (SplitValueString[1] == 'x' || SplitValueString[1] == 'X')) {
- Status = AsciiStringToUint64 (SplitValueString, TRUE, ReturnValue);
- if (!EFI_ERROR (Status)) {
- return Status;
- }
- }
-
- lastCHAR = (CHAR8)toupper((int)SplitValueString[len - 1]);
-
- if (lastCHAR != 'K' && lastCHAR != 'M' && lastCHAR != 'G') {
- return STATUS_ERROR;
- }
-
- for (;index < len - 1; ++index) {
- if (!isdigit((int)SplitValueString[index])) {
- return EFI_ABORTED;
- }
- }
-
- number = atol (SplitValueString);
- if (lastCHAR == 'K')
- base = 1024;
- else if (lastCHAR == 'M')
- base = 1024*1024;
- else
- base = 1024*1024*1024;
-
- *ReturnValue = number*base;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CountVerboseLevel (
- IN CONST CHAR8* VerboseLevelString,
- IN CONST UINT64 Length,
- OUT UINT64 *ReturnValue
-)
-{
- UINT64 i = 0;
- for (;i < Length; ++i) {
- if (VerboseLevelString[i] != 'v' && VerboseLevelString[i] != 'V') {
- return EFI_ABORTED;
- }
- ++(*ReturnValue);
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateDir (
- IN OUT CHAR8** FullFileName
-)
-{
- CHAR8* temp = *FullFileName;
- CHAR8* start = temp;
- UINT64 index = 0;
-
- for (;index < strlen(temp); ++index) {
- if (temp[index] == '\\' || temp[index] == '/') {
- temp[index] = 0;
- if (chdir(start)) {
- if (mkdir(start, S_IRWXU | S_IRWXG | S_IRWXO) != 0) {
- return EFI_ABORTED;
- }
- chdir(start);
- }
- start = temp + index + 1;
- temp[index] = '/';
- }
- }
-
- return EFI_SUCCESS;
-}
-
-int
-main (
- int argc,
- char*argv[]
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- argc - GC_TODO: add argument description
- ] - GC_TODO: add argument description
-
-Returns:
-
- GC_TODO: add return values
-
---*/
-{
- EFI_STATUS Status = EFI_SUCCESS;
- FILE *In;
- CHAR8 *InputFileName = NULL;
- CHAR8 *OutputDir = NULL;
- CHAR8 *OutFileName1 = NULL;
- CHAR8 *OutFileName2 = NULL;
- UINT64 SplitValue = (UINT64) -1;
- FILE *Out1;
- FILE *Out2;
- CHAR8 *OutName1 = NULL;
- CHAR8 *OutName2 = NULL;
- CHAR8 *CurrentDir = NULL;
- UINT64 Index;
- CHAR8 CharC;
- UINT64 DebugLevel = 0;
- UINT64 VerboseLevel = 0;
-
- SetUtilityName(UTILITY_NAME);
- if (argc == 1) {
- Usage();
- return STATUS_ERROR;
- }
-
- argc --;
- argv ++;
-
- if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
- Usage();
- return STATUS_SUCCESS;
- }
-
- if (stricmp (argv[0], "--version") == 0) {
- Version();
- return STATUS_SUCCESS;
- }
-
- while (argc > 0) {
- if ((stricmp (argv[0], "-p") == 0) || (stricmp (argv[0], "--prefix") == 0)) {
- OutputDir = argv[1];
- if (OutputDir == NULL) {
- Warning (NULL, 0, 0, "NO output directory specified.", NULL);
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-f") == 0) || (stricmp (argv[0], "--filename") == 0)) {
- InputFileName = argv[1];
- if (InputFileName == NULL) {
- Error (NULL, 0, 0x1001, "NO Input file specified.", NULL);
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-s") == 0) || (stricmp (argv[0], "--split") == 0)) {
- Status = GetSplitValue(argv[1], &SplitValue);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0x1003, "Input split value is not one valid integer.", NULL);
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--firstfile") == 0)) {
- OutFileName1 = argv[1];
- if (OutFileName1 == NULL) {
- Warning (NULL, 0, 0, NULL, "No output file1 specified.");
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-t") == 0) || (stricmp (argv[0], "--secondfile") == 0)) {
- OutFileName2 = argv[1];
- if (OutFileName2 == NULL) {
- Warning (NULL, 0, 0, NULL, "No output file2 specified.");
- }
- argc -= 2;
- argv += 2;
- continue;
- }
-
- if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- argc --;
- argv ++;
- continue;
- }
-
- if ((strlen(argv[0]) >= 2 && argv[0][0] == '-' && (argv[0][1] == 'v' || argv[0][1] == 'V')) || (stricmp (argv[0], "--verbose") == 0)) {
- VerboseLevel = 1;
- if (strlen(argv[0]) > 2) {
- Status = CountVerboseLevel (&argv[0][2], strlen(argv[0]) - 2, &VerboseLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0x1003, NULL, "%s is invaild paramter!", argv[0]);
- return STATUS_ERROR;
- }
- }
-
- argc --;
- argv ++;
- continue;
- }
-
- if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--debug") == 0)) {
- Status = AsciiStringToUint64 (argv[1], FALSE, &DebugLevel);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0x1003, "Input debug level is not one valid integrator.", NULL);
- return STATUS_ERROR;
- }
- argc -= 2;
- argv += 2;
- continue;
- }
- //
- // Don't recognize the paramter.
- //
- Error (NULL, 0, 0x1003, NULL, "%s is invaild paramter!", argv[0]);
- return STATUS_ERROR;
- }
-
- if (InputFileName == NULL) {
- Error (NULL, 0, 0x1001, "NO Input file specified.", NULL);
- return STATUS_ERROR;
- }
-
- In = fopen (InputFileName, "rb");
- if (In == NULL) {
- // ("Unable to open file \"%s\"\n", InputFileName);
- Error (InputFileName, 0, 1, "File open failure", NULL);
- return STATUS_ERROR;
- }
-
- if (OutFileName1 == NULL) {
- OutName1 = (CHAR8*)malloc(strlen(InputFileName) + 16);
- if (OutName1 == NULL) {
- Warning (NULL, 0, 0, NULL, "Memory Allocation Fail.");
- return STATUS_ERROR;
- }
- strcpy (OutName1, InputFileName);
- strcat (OutName1, "1");
- OutFileName1 = OutName1;
-
- }
- if (OutFileName2 == NULL) {
- OutName2 = (CHAR8*)malloc(strlen(InputFileName) + 16);
- if (OutName2 == NULL) {
- Warning (NULL, 0, 0, NULL, "Memory Allocation Fail.");
- return STATUS_ERROR;
- }
- strcpy (OutName2, InputFileName);
- strcat (OutName2, "2");
- OutFileName2 = OutName2;
-
- }
-
- if (OutputDir != NULL) {
- //OutputDirSpecified = TRUE;
- if (chdir(OutputDir) != 0) {
- Warning (NULL, 0, 0, NULL, "Change dir to OutputDir Fail.");
- return STATUS_ERROR;
- }
- }
-
- CurrentDir = (CHAR8*)getcwd((CHAR8*)0, 0);
- if (EFI_ERROR(CreateDir(&OutFileName1))) {
- Error (OutFileName1, 0, 5, "Create Dir for File1 Fail.", NULL);
- return STATUS_ERROR;
- }
- chdir(CurrentDir);
-
- if (EFI_ERROR(CreateDir(&OutFileName2))) {
- Error (OutFileName2, 0, 5, "Create Dir for File2 Fail.", NULL);
- return STATUS_ERROR;
- }
- chdir(CurrentDir);
- free(CurrentDir);
-
- Out1 = fopen (OutFileName1, "wb");
- if (Out1 == NULL) {
- // ("Unable to open file \"%s\"\n", OutFileName1);
- Error (OutFileName1, 0, 1, "File open failure", NULL);
- return STATUS_ERROR;
- }
-
- Out2 = fopen (OutFileName2, "wb");
- if (Out2 == NULL) {
- // ("Unable to open file \"%s\"\n", OutFileName2);
- Error (OutFileName2, 0, 1, "File open failure", NULL);
- return STATUS_ERROR;
- }
-
- for (Index = 0; Index < SplitValue; Index++) {
- CharC = (CHAR8) fgetc (In);
- if (feof (In)) {
- break;
- }
-
- fputc (CharC, Out1);
- }
-
- for (;;) {
- CharC = (CHAR8) fgetc (In);
- if (feof (In)) {
- break;
- }
-
- fputc (CharC, Out2);
- }
-
- if (OutName1 != NULL) {
- free(OutName1);
- }
- if (OutName2 != NULL) {
- free(OutName2);
- }
- fclose (In);
- fclose (Out1);
- fclose (Out2);
-
- return STATUS_SUCCESS;
-}
diff --git a/BaseTools/Source/C/TianoCompress/GNUmakefile b/BaseTools/Source/C/TianoCompress/GNUmakefile
deleted file mode 100644
index e4f3a69638..0000000000
--- a/BaseTools/Source/C/TianoCompress/GNUmakefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# GNU/Linux makefile for 'TianoCompress' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = TianoCompress
-
-LIBS = -lCommon
-
-OBJECTS = TianoCompress.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
diff --git a/BaseTools/Source/C/TianoCompress/Makefile b/BaseTools/Source/C/TianoCompress/Makefile
deleted file mode 100644
index 2987d99016..0000000000
--- a/BaseTools/Source/C/TianoCompress/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'TianoCompress' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = TianoCompress
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = TianoCompress.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/TianoCompress/TianoCompress.c b/BaseTools/Source/C/TianoCompress/TianoCompress.c
deleted file mode 100644
index 145288bb80..0000000000
--- a/BaseTools/Source/C/TianoCompress/TianoCompress.c
+++ /dev/null
@@ -1,2718 +0,0 @@
-/** @file
-
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- TianoCompress.c
-
-Abstract:
-
- Compression routine. The compression algorithm is a mixture of
- LZ77 and Huffman coding. LZ77 transforms the source data into a
- sequence of Original Characters and Pointers to repeated strings.
- This sequence is further divided into Blocks and Huffman codings
- are applied to each Block.
-
-**/
-
-#include "Compress.h"
-#include "TianoCompress.h"
-#include "EfiUtilityMsgs.h"
-#include "ParseInf.h"
-#include <stdio.h>
-#include "assert.h"
-
-//
-// Macro Definitions
-//
-static BOOLEAN VerboseMode = FALSE;
-static BOOLEAN QuietMode = FALSE;
-#undef UINT8_MAX
-#define UINT8_MAX 0xff
-#define UINT8_BIT 8
-#define THRESHOLD 3
-#define INIT_CRC 0
-#define WNDBIT 19
-#define WNDSIZ (1U << WNDBIT)
-#define MAXMATCH 256
-#define BLKSIZ (1U << 14) // 16 * 1024U
-#define PERC_FLAG 0x80000000U
-#define CODE_BIT 16
-#define NIL 0
-#define MAX_HASH_VAL (3 * WNDSIZ + (WNDSIZ / 512 + 1) * UINT8_MAX)
-#define HASH(p, c) ((p) + ((c) << (WNDBIT - 9)) + WNDSIZ * 2)
-#define CRCPOLY 0xA001
-#define UPDATE_CRC(c) mCrc = mCrcTable[(mCrc ^ (c)) & 0xFF] ^ (mCrc >> UINT8_BIT)
-
-//
-// C: the Char&Len Set; P: the Position Set; T: the exTra Set
-//
-//#define NC (UINT8_MAX + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define NP (WNDBIT + 1)
-#define PBIT 5
-//#define NT (CODE_BIT + 3)
-//#define TBIT 5
-//#if NT > NP
-//#define NPT NT
-//#else
-//#define NPT NP
-//#endif
-
-//
-// Global Variables
-//
-STATIC BOOLEAN ENCODE = FALSE;
-STATIC BOOLEAN DECODE = FALSE;
-STATIC UINT8 *mSrc, *mDst, *mSrcUpperLimit, *mDstUpperLimit;
-STATIC UINT8 *mLevel, *mText, *mChildCount, *mBuf, mCLen[NC], mPTLen[NPT], *mLen;
-STATIC INT16 mHeap[NC + 1];
-STATIC INT32 mRemainder, mMatchLen, mBitCount, mHeapSize, mN;
-STATIC UINT32 mBufSiz = 0, mOutputPos, mOutputMask, mSubBitBuf, mCrc;
-STATIC UINT32 mCompSize, mOrigSize;
-
-STATIC UINT16 *mFreq, *mSortPtr, mLenCnt[17], mLeft[2 * NC - 1], mRight[2 * NC - 1], mCrcTable[UINT8_MAX + 1],
- mCFreq[2 * NC - 1], mCCode[NC], mPFreq[2 * NP - 1], mPTCode[NPT], mTFreq[2 * NT - 1];
-
-STATIC NODE mPos, mMatchPos, mAvail, *mPosition, *mParent, *mPrev, *mNext = NULL;
-
-static UINT64 DebugLevel;
-static BOOLEAN DebugMode;
-//
-// functions
-//
-EFI_STATUS
-TianoCompress (
- IN UINT8 *SrcBuffer,
- IN UINT32 SrcSize,
- IN UINT8 *DstBuffer,
- IN OUT UINT32 *DstSize
- )
-/*++
-
-Routine Description:
-
- The internal implementation of [Efi/Tiano]Compress().
-
-Arguments:
-
- SrcBuffer - The buffer storing the source data
- SrcSize - The size of source data
- DstBuffer - The buffer to store the compressed data
-
- Version - The version of de/compression algorithm.
- Version 1 for EFI 1.1 de/compression algorithm.
- Version 2 for Tiano de/compression algorithm.
-
-Returns:
-
- EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. In this case,
- DstSize contains the size needed.
- EFI_SUCCESS - Compression is successful.
- EFI_OUT_OF_RESOURCES - No resource to complete function.
- EFI_INVALID_PARAMETER - Parameter supplied is wrong.
-
---*/
-{
- EFI_STATUS Status;
-
- //
- // Initializations
- //
- mBufSiz = 0;
- mBuf = NULL;
- mText = NULL;
- mLevel = NULL;
- mChildCount = NULL;
- mPosition = NULL;
- mParent = NULL;
- mPrev = NULL;
- mNext = NULL;
-
-
- mSrc = SrcBuffer;
- mSrcUpperLimit = mSrc + SrcSize;
- mDst = DstBuffer;
- mDstUpperLimit = mDst +*DstSize;
-
- PutDword (0L);
- PutDword (0L);
-
- MakeCrcTable ();
-
- mOrigSize = mCompSize = 0;
- mCrc = INIT_CRC;
-
- //
- // Compress it
- //
- Status = Encode ();
- if (EFI_ERROR (Status)) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Null terminate the compressed data
- //
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = 0;
- }
-
- //
- // Fill in compressed size and original size
- //
- mDst = DstBuffer;
-
- PutDword (mCompSize + 1);
- PutDword (mOrigSize);
- //
- // Return
- //
-
- if (mCompSize + 1 + 8 > *DstSize) {
- *DstSize = mCompSize + 1 + 8;
- return EFI_BUFFER_TOO_SMALL;
- } else {
- *DstSize = mCompSize + 1 + 8;
- return EFI_SUCCESS;
- }
-}
-
-STATIC
-VOID
-PutDword (
- IN UINT32 Data
- )
-/*++
-
-Routine Description:
-
- Put a dword to output stream
-
-Arguments:
-
- Data - the dword to put
-
-Returns: (VOID)
-
---*/
-{
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x08)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x10)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x18)) & 0xff);
- }
-}
-
-STATIC
-EFI_STATUS
-AllocateMemory (
- VOID
- )
-/*++
-
-Routine Description:
-
- Allocate memory spaces for data structures used in compression process
-
-Argements:
- VOID
-
-Returns:
-
- EFI_SUCCESS - Memory is allocated successfully
- EFI_OUT_OF_RESOURCES - Allocation fails
-
---*/
-{
- UINT32 Index;
-
- mText = malloc (WNDSIZ * 2 + MAXMATCH);
- for (Index = 0; Index < WNDSIZ * 2 + MAXMATCH; Index++) {
- mText[Index] = 0;
- }
-
- mLevel = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mLevel));
- mChildCount = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mChildCount));
- mPosition = malloc ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mPosition));
- mParent = malloc (WNDSIZ * 2 * sizeof (*mParent));
- mPrev = malloc (WNDSIZ * 2 * sizeof (*mPrev));
- mNext = malloc ((MAX_HASH_VAL + 1) * sizeof (*mNext));
-
- mBufSiz = BLKSIZ;
- mBuf = malloc (mBufSiz);
- while (mBuf == NULL) {
- mBufSiz = (mBufSiz / 10U) * 9U;
- if (mBufSiz < 4 * 1024U) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- mBuf = malloc (mBufSiz);
- }
-
- mBuf[0] = 0;
-
- return EFI_SUCCESS;
-}
-
-VOID
-FreeMemory (
- VOID
- )
-/*++
-
-Routine Description:
-
- Called when compression is completed to free memory previously allocated.
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- if (mText != NULL) {
- free (mText);
- }
-
- if (mLevel != NULL) {
- free (mLevel);
- }
-
- if (mChildCount != NULL) {
- free (mChildCount);
- }
-
- if (mPosition != NULL) {
- free (mPosition);
- }
-
- if (mParent != NULL) {
- free (mParent);
- }
-
- if (mPrev != NULL) {
- free (mPrev);
- }
-
- if (mNext != NULL) {
- free (mNext);
- }
-
- if (mBuf != NULL) {
- free (mBuf);
- }
-
- return ;
-}
-
-STATIC
-VOID
-InitSlide (
- VOID
- )
-/*++
-
-Routine Description:
-
- Initialize String Info Log data structures
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- NODE Index;
-
- for (Index = WNDSIZ; Index <= WNDSIZ + UINT8_MAX; Index++) {
- mLevel[Index] = 1;
- mPosition[Index] = NIL; // sentinel
- }
-
- for (Index = WNDSIZ; Index < WNDSIZ * 2; Index++) {
- mParent[Index] = NIL;
- }
-
- mAvail = 1;
- for (Index = 1; Index < WNDSIZ - 1; Index++) {
- mNext[Index] = (NODE) (Index + 1);
- }
-
- mNext[WNDSIZ - 1] = NIL;
- for (Index = WNDSIZ * 2; Index <= MAX_HASH_VAL; Index++) {
- mNext[Index] = NIL;
- }
-}
-
-STATIC
-NODE
-Child (
- IN NODE NodeQ,
- IN UINT8 CharC
- )
-/*++
-
-Routine Description:
-
- Find child node given the parent node and the edge character
-
-Arguments:
-
- NodeQ - the parent node
- CharC - the edge character
-
-Returns:
-
- The child node (NIL if not found)
-
---*/
-{
- NODE NodeR;
-
- NodeR = mNext[HASH (NodeQ, CharC)];
- //
- // sentinel
- //
- mParent[NIL] = NodeQ;
- while (mParent[NodeR] != NodeQ) {
- NodeR = mNext[NodeR];
- }
-
- return NodeR;
-}
-
-STATIC
-VOID
-MakeChild (
- IN NODE Parent,
- IN UINT8 CharC,
- IN NODE Child
- )
-/*++
-
-Routine Description:
-
- Create a new child for a given parent node.
-
-Arguments:
-
- Parent - the parent node
- CharC - the edge character
- Child - the child node
-
-Returns: (VOID)
-
---*/
-{
- NODE Node1;
- NODE Node2;
-
- Node1 = (NODE) HASH (Parent, CharC);
- Node2 = mNext[Node1];
- mNext[Node1] = Child;
- mNext[Child] = Node2;
- mPrev[Node2] = Child;
- mPrev[Child] = Node1;
- mParent[Child] = Parent;
- mChildCount[Parent]++;
-}
-
-STATIC
-VOID
-Split (
- NODE Old
- )
-/*++
-
-Routine Description:
-
- Split a node.
-
-Arguments:
-
- Old - the node to split
-
-Returns: (VOID)
-
---*/
-{
- NODE New;
- NODE TempNode;
-
- New = mAvail;
- mAvail = mNext[New];
- mChildCount[New] = 0;
- TempNode = mPrev[Old];
- mPrev[New] = TempNode;
- mNext[TempNode] = New;
- TempNode = mNext[Old];
- mNext[New] = TempNode;
- mPrev[TempNode] = New;
- mParent[New] = mParent[Old];
- mLevel[New] = (UINT8) mMatchLen;
- mPosition[New] = mPos;
- MakeChild (New, mText[mMatchPos + mMatchLen], Old);
- MakeChild (New, mText[mPos + mMatchLen], mPos);
-}
-
-STATIC
-VOID
-InsertNode (
- VOID
- )
-/*++
-
-Routine Description:
-
- Insert string info for current position into the String Info Log
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- NODE NodeQ;
- NODE NodeR;
- NODE Index2;
- NODE NodeT;
- UINT8 CharC;
- UINT8 *t1;
- UINT8 *t2;
-
- if (mMatchLen >= 4) {
- //
- // We have just got a long match, the target tree
- // can be located by MatchPos + 1. Travese the tree
- // from bottom up to get to a proper starting point.
- // The usage of PERC_FLAG ensures proper node deletion
- // in DeleteNode() later.
- //
- mMatchLen--;
- NodeR = (NODE) ((mMatchPos + 1) | WNDSIZ);
- NodeQ = mParent[NodeR];
- while (NodeQ == NIL) {
- NodeR = mNext[NodeR];
- NodeQ = mParent[NodeR];
- }
-
- while (mLevel[NodeQ] >= mMatchLen) {
- NodeR = NodeQ;
- NodeQ = mParent[NodeQ];
- }
-
- NodeT = NodeQ;
- while (mPosition[NodeT] < 0) {
- mPosition[NodeT] = mPos;
- NodeT = mParent[NodeT];
- }
-
- if (NodeT < WNDSIZ) {
- mPosition[NodeT] = (NODE) (mPos | (UINT32) PERC_FLAG);
- }
- } else {
- //
- // Locate the target tree
- //
- NodeQ = (NODE) (mText[mPos] + WNDSIZ);
- CharC = mText[mPos + 1];
- NodeR = Child (NodeQ, CharC);
- if (NodeR == NIL) {
- MakeChild (NodeQ, CharC, mPos);
- mMatchLen = 1;
- return ;
- }
-
- mMatchLen = 2;
- }
- //
- // Traverse down the tree to find a match.
- // Update Position value along the route.
- // Node split or creation is involved.
- //
- for (;;) {
- if (NodeR >= WNDSIZ) {
- Index2 = MAXMATCH;
- mMatchPos = NodeR;
- } else {
- Index2 = mLevel[NodeR];
- mMatchPos = (NODE) (mPosition[NodeR] & (UINT32)~PERC_FLAG);
- }
-
- if (mMatchPos >= mPos) {
- mMatchPos -= WNDSIZ;
- }
-
- t1 = &mText[mPos + mMatchLen];
- t2 = &mText[mMatchPos + mMatchLen];
- while (mMatchLen < Index2) {
- if (*t1 != *t2) {
- Split (NodeR);
- return ;
- }
-
- mMatchLen++;
- t1++;
- t2++;
- }
-
- if (mMatchLen >= MAXMATCH) {
- break;
- }
-
- mPosition[NodeR] = mPos;
- NodeQ = NodeR;
- NodeR = Child (NodeQ, *t1);
- if (NodeR == NIL) {
- MakeChild (NodeQ, *t1, mPos);
- return ;
- }
-
- mMatchLen++;
- }
-
- NodeT = mPrev[NodeR];
- mPrev[mPos] = NodeT;
- mNext[NodeT] = mPos;
- NodeT = mNext[NodeR];
- mNext[mPos] = NodeT;
- mPrev[NodeT] = mPos;
- mParent[mPos] = NodeQ;
- mParent[NodeR] = NIL;
-
- //
- // Special usage of 'next'
- //
- mNext[NodeR] = mPos;
-
-}
-
-STATIC
-VOID
-DeleteNode (
- VOID
- )
-/*++
-
-Routine Description:
-
- Delete outdated string info. (The Usage of PERC_FLAG
- ensures a clean deletion)
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- NODE NodeQ;
- NODE NodeR;
- NODE NodeS;
- NODE NodeT;
- NODE NodeU;
-
- if (mParent[mPos] == NIL) {
- return ;
- }
-
- NodeR = mPrev[mPos];
- NodeS = mNext[mPos];
- mNext[NodeR] = NodeS;
- mPrev[NodeS] = NodeR;
- NodeR = mParent[mPos];
- mParent[mPos] = NIL;
- if (NodeR >= WNDSIZ) {
- return ;
- }
-
- mChildCount[NodeR]--;
- if (mChildCount[NodeR] > 1) {
- return ;
- }
-
- NodeT = (NODE) (mPosition[NodeR] & (UINT32)~PERC_FLAG);
- if (NodeT >= mPos) {
- NodeT -= WNDSIZ;
- }
-
- NodeS = NodeT;
- NodeQ = mParent[NodeR];
- NodeU = mPosition[NodeQ];
- while (NodeU & (UINT32) PERC_FLAG) {
- NodeU &= (UINT32)~PERC_FLAG;
- if (NodeU >= mPos) {
- NodeU -= WNDSIZ;
- }
-
- if (NodeU > NodeS) {
- NodeS = NodeU;
- }
-
- mPosition[NodeQ] = (NODE) (NodeS | WNDSIZ);
- NodeQ = mParent[NodeQ];
- NodeU = mPosition[NodeQ];
- }
-
- if (NodeQ < WNDSIZ) {
- if (NodeU >= mPos) {
- NodeU -= WNDSIZ;
- }
-
- if (NodeU > NodeS) {
- NodeS = NodeU;
- }
-
- mPosition[NodeQ] = (NODE) (NodeS | WNDSIZ | (UINT32) PERC_FLAG);
- }
-
- NodeS = Child (NodeR, mText[NodeT + mLevel[NodeR]]);
- NodeT = mPrev[NodeS];
- NodeU = mNext[NodeS];
- mNext[NodeT] = NodeU;
- mPrev[NodeU] = NodeT;
- NodeT = mPrev[NodeR];
- mNext[NodeT] = NodeS;
- mPrev[NodeS] = NodeT;
- NodeT = mNext[NodeR];
- mPrev[NodeT] = NodeS;
- mNext[NodeS] = NodeT;
- mParent[NodeS] = mParent[NodeR];
- mParent[NodeR] = NIL;
- mNext[NodeR] = mAvail;
- mAvail = NodeR;
-}
-
-STATIC
-VOID
-GetNextMatch (
- VOID
- )
-/*++
-
-Routine Description:
-
- Advance the current position (read in new data if needed).
- Delete outdated string info. Find a match string for current position.
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- INT32 Number;
-
- mRemainder--;
- mPos++;
- if (mPos == WNDSIZ * 2) {
- memmove (&mText[0], &mText[WNDSIZ], WNDSIZ + MAXMATCH);
- Number = FreadCrc (&mText[WNDSIZ + MAXMATCH], WNDSIZ);
- mRemainder += Number;
- mPos = WNDSIZ;
- }
-
- DeleteNode ();
- InsertNode ();
-}
-
-STATIC
-EFI_STATUS
-Encode (
- VOID
- )
-/*++
-
-Routine Description:
-
- The main controlling routine for compression process.
-
-Arguments: (VOID)
-
-Returns:
-
- EFI_SUCCESS - The compression is successful
- EFI_OUT_0F_RESOURCES - Not enough memory for compression process
-
---*/
-{
- EFI_STATUS Status;
- INT32 LastMatchLen;
- NODE LastMatchPos;
-
- Status = AllocateMemory ();
- if (EFI_ERROR (Status)) {
- FreeMemory ();
- return Status;
- }
-
- InitSlide ();
-
- HufEncodeStart ();
-
- mRemainder = FreadCrc (&mText[WNDSIZ], WNDSIZ + MAXMATCH);
-
- mMatchLen = 0;
- mPos = WNDSIZ;
- InsertNode ();
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
-
- while (mRemainder > 0) {
- LastMatchLen = mMatchLen;
- LastMatchPos = mMatchPos;
- GetNextMatch ();
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
-
- if (mMatchLen > LastMatchLen || LastMatchLen < THRESHOLD) {
- //
- // Not enough benefits are gained by outputting a pointer,
- // so just output the original character
- //
- Output (mText[mPos - 1], 0);
-
- } else {
-
- if (LastMatchLen == THRESHOLD) {
- if (((mPos - LastMatchPos - 2) & (WNDSIZ - 1)) > (1U << 11)) {
- Output (mText[mPos - 1], 0);
- continue;
- }
- }
- //
- // Outputting a pointer is beneficial enough, do it.
- //
- Output (
- LastMatchLen + (UINT8_MAX + 1 - THRESHOLD),
- (mPos - LastMatchPos - 2) & (WNDSIZ - 1)
- );
- LastMatchLen--;
- while (LastMatchLen > 0) {
- GetNextMatch ();
- LastMatchLen--;
- }
-
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
- }
- }
-
- HufEncodeEnd ();
- FreeMemory ();
- return EFI_SUCCESS;
-}
-
-STATIC
-VOID
-CountTFreq (
- VOID
- )
-/*++
-
-Routine Description:
-
- Count the frequencies for the Extra Set
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- INT32 Index;
- INT32 Index3;
- INT32 Number;
- INT32 Count;
-
- for (Index = 0; Index < NT; Index++) {
- mTFreq[Index] = 0;
- }
-
- Number = NC;
- while (Number > 0 && mCLen[Number - 1] == 0) {
- Number--;
- }
-
- Index = 0;
- while (Index < Number) {
- Index3 = mCLen[Index++];
- if (Index3 == 0) {
- Count = 1;
- while (Index < Number && mCLen[Index] == 0) {
- Index++;
- Count++;
- }
-
- if (Count <= 2) {
- mTFreq[0] = (UINT16) (mTFreq[0] + Count);
- } else if (Count <= 18) {
- mTFreq[1]++;
- } else if (Count == 19) {
- mTFreq[0]++;
- mTFreq[1]++;
- } else {
- mTFreq[2]++;
- }
- } else {
- mTFreq[Index3 + 2]++;
- }
- }
-}
-
-STATIC
-VOID
-WritePTLen (
- IN INT32 Number,
- IN INT32 nbit,
- IN INT32 Special
- )
-/*++
-
-Routine Description:
-
- Outputs the code length array for the Extra Set or the Position Set.
-
-Arguments:
-
- Number - the number of symbols
- nbit - the number of bits needed to represent 'n'
- Special - the special symbol that needs to be take care of
-
-Returns: (VOID)
-
---*/
-{
- INT32 Index;
- INT32 Index3;
-
- while (Number > 0 && mPTLen[Number - 1] == 0) {
- Number--;
- }
-
- PutBits (nbit, Number);
- Index = 0;
- while (Index < Number) {
- Index3 = mPTLen[Index++];
- if (Index3 <= 6) {
- PutBits (3, Index3);
- } else {
- PutBits (Index3 - 3, (1U << (Index3 - 3)) - 2);
- }
-
- if (Index == Special) {
- while (Index < 6 && mPTLen[Index] == 0) {
- Index++;
- }
-
- PutBits (2, (Index - 3) & 3);
- }
- }
-}
-
-STATIC
-VOID
-WriteCLen (
- VOID
- )
-/*++
-
-Routine Description:
-
- Outputs the code length array for Char&Length Set
-
-Arguments: (VOID)
-
-Returns: (VOID)
-
---*/
-{
- INT32 Index;
- INT32 Index3;
- INT32 Number;
- INT32 Count;
-
- Number = NC;
- while (Number > 0 && mCLen[Number - 1] == 0) {
- Number--;
- }
-
- PutBits (CBIT, Number);
- Index = 0;
- while (Index < Number) {
- Index3 = mCLen[Index++];
- if (Index3 == 0) {
- Count = 1;
- while (Index < Number && mCLen[Index] == 0) {
- Index++;
- Count++;
- }
-
- if (Count <= 2) {
- for (Index3 = 0; Index3 < Count; Index3++) {
- PutBits (mPTLen[0], mPTCode[0]);
- }
- } else if (Count <= 18) {
- PutBits (mPTLen[1], mPTCode[1]);
- PutBits (4, Count - 3);
- } else if (Count == 19) {
- PutBits (mPTLen[0], mPTCode[0]);
- PutBits (mPTLen[1], mPTCode[1]);
- PutBits (4, 15);
- } else {
- PutBits (mPTLen[2], mPTCode[2]);
- PutBits (CBIT, Count - 20);
- }
- } else {
- PutBits (mPTLen[Index3 + 2], mPTCode[Index3 + 2]);
- }
- }
-}
-
-STATIC
-VOID
-EncodeC (
- IN INT32 Value
- )
-{
- PutBits (mCLen[Value], mCCode[Value]);
-}
-
-STATIC
-VOID
-EncodeP (
- IN UINT32 Value
- )
-{
- UINT32 Index;
- UINT32 NodeQ;
-
- Index = 0;
- NodeQ = Value;
- while (NodeQ) {
- NodeQ >>= 1;
- Index++;
- }
-
- PutBits (mPTLen[Index], mPTCode[Index]);
- if (Index > 1) {
- PutBits (Index - 1, Value & (0xFFFFFFFFU >> (32 - Index + 1)));
- }
-}
-
-STATIC
-VOID
-SendBlock (
- VOID
- )
-/*++
-
-Routine Description:
-
- Huffman code the block and output it.
-
-Arguments:
- (VOID)
-
-Returns:
- (VOID)
-
---*/
-{
- UINT32 Index;
- UINT32 Index2;
- UINT32 Index3;
- UINT32 Flags;
- UINT32 Root;
- UINT32 Pos;
- UINT32 Size;
- Flags = 0;
-
- Root = MakeTree (NC, mCFreq, mCLen, mCCode);
- Size = mCFreq[Root];
-
- PutBits (16, Size);
- if (Root >= NC) {
- CountTFreq ();
- Root = MakeTree (NT, mTFreq, mPTLen, mPTCode);
- if (Root >= NT) {
- WritePTLen (NT, TBIT, 3);
- } else {
- PutBits (TBIT, 0);
- PutBits (TBIT, Root);
- }
-
- WriteCLen ();
- } else {
- PutBits (TBIT, 0);
- PutBits (TBIT, 0);
- PutBits (CBIT, 0);
- PutBits (CBIT, Root);
- }
-
- Root = MakeTree (NP, mPFreq, mPTLen, mPTCode);
- if (Root >= NP) {
- WritePTLen (NP, PBIT, -1);
- } else {
- PutBits (PBIT, 0);
- PutBits (PBIT, Root);
- }
-
- Pos = 0;
- for (Index = 0; Index < Size; Index++) {
- if (Index % UINT8_BIT == 0) {
- Flags = mBuf[Pos++];
- } else {
- Flags <<= 1;
- }
-
- if (Flags & (1U << (UINT8_BIT - 1))) {
- EncodeC (mBuf[Pos++] + (1U << UINT8_BIT));
- Index3 = mBuf[Pos++];
- for (Index2 = 0; Index2 < 3; Index2++) {
- Index3 <<= UINT8_BIT;
- Index3 += mBuf[Pos++];
- }
-
- EncodeP (Index3);
- } else {
- EncodeC (mBuf[Pos++]);
- }
- }
-
- for (Index = 0; Index < NC; Index++) {
- mCFreq[Index] = 0;
- }
-
- for (Index = 0; Index < NP; Index++) {
- mPFreq[Index] = 0;
- }
-}
-
-STATIC
-VOID
-Output (
- IN UINT32 CharC,
- IN UINT32 Pos
- )
-/*++
-
-Routine Description:
-
- Outputs an Original Character or a Pointer
-
-Arguments:
-
- CharC - The original character or the 'String Length' element of a Pointer
- Pos - The 'Position' field of a Pointer
-
-Returns: (VOID)
-
---*/
-{
- STATIC UINT32 CPos;
-
- if ((mOutputMask >>= 1) == 0) {
- mOutputMask = 1U << (UINT8_BIT - 1);
- //
- // Check the buffer overflow per outputing UINT8_BIT symbols
- // which is an Original Character or a Pointer. The biggest
- // symbol is a Pointer which occupies 5 bytes.
- //
- if (mOutputPos >= mBufSiz - 5 * UINT8_BIT) {
- SendBlock ();
- mOutputPos = 0;
- }
-
- CPos = mOutputPos++;
- mBuf[CPos] = 0;
- }
-
- mBuf[mOutputPos++] = (UINT8) CharC;
- mCFreq[CharC]++;
- if (CharC >= (1U << UINT8_BIT)) {
- mBuf[CPos] |= mOutputMask;
- mBuf[mOutputPos++] = (UINT8) (Pos >> 24);
- mBuf[mOutputPos++] = (UINT8) (Pos >> 16);
- mBuf[mOutputPos++] = (UINT8) (Pos >> (UINT8_BIT));
- mBuf[mOutputPos++] = (UINT8) Pos;
- CharC = 0;
- while (Pos) {
- Pos >>= 1;
- CharC++;
- }
-
- mPFreq[CharC]++;
- }
-}
-
-STATIC
-VOID
-HufEncodeStart (
- VOID
- )
-{
- INT32 Index;
-
- for (Index = 0; Index < NC; Index++) {
- mCFreq[Index] = 0;
- }
-
- for (Index = 0; Index < NP; Index++) {
- mPFreq[Index] = 0;
- }
-
- mOutputPos = mOutputMask = 0;
- InitPutBits ();
- return ;
-}
-
-STATIC
-VOID
-HufEncodeEnd (
- VOID
- )
-{
- SendBlock ();
-
- //
- // Flush remaining bits
- //
- PutBits (UINT8_BIT - 1, 0);
-
- return ;
-}
-
-STATIC
-VOID
-MakeCrcTable (
- VOID
- )
-{
- UINT32 Index;
- UINT32 Index2;
- UINT32 Temp;
-
- for (Index = 0; Index <= UINT8_MAX; Index++) {
- Temp = Index;
- for (Index2 = 0; Index2 < UINT8_BIT; Index2++) {
- if (Temp & 1) {
- Temp = (Temp >> 1) ^ CRCPOLY;
- } else {
- Temp >>= 1;
- }
- }
-
- mCrcTable[Index] = (UINT16) Temp;
- }
-}
-
-STATIC
-VOID
-PutBits (
- IN INT32 Number,
- IN UINT32 Value
- )
-/*++
-
-Routine Description:
-
- Outputs rightmost n bits of x
-
-Arguments:
-
- Number - the rightmost n bits of the data is used
- x - the data
-
-Returns: (VOID)
-
---*/
-{
- UINT8 Temp;
-
- while (Number >= mBitCount) {
- //
- // Number -= mBitCount should never equal to 32
- //
- Temp = (UINT8) (mSubBitBuf | (Value >> (Number -= mBitCount)));
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = Temp;
- }
-
- mCompSize++;
- mSubBitBuf = 0;
- mBitCount = UINT8_BIT;
- }
-
- mSubBitBuf |= Value << (mBitCount -= Number);
-}
-
-STATIC
-INT32
-FreadCrc (
- OUT UINT8 *Pointer,
- IN INT32 Number
- )
-/*++
-
-Routine Description:
-
- Read in source data
-
-Arguments:
-
- Pointer - the buffer to hold the data
- Number - number of bytes to read
-
-Returns:
-
- number of bytes actually read
-
---*/
-{
- INT32 Index;
-
- for (Index = 0; mSrc < mSrcUpperLimit && Index < Number; Index++) {
- *Pointer++ = *mSrc++;
- }
-
- Number = Index;
-
- Pointer -= Number;
- mOrigSize += Number;
-
- Index--;
- while (Index >= 0) {
- UPDATE_CRC (*Pointer++);
- Index--;
- }
-
- return Number;
-}
-
-STATIC
-VOID
-InitPutBits (
- VOID
- )
-{
- mBitCount = UINT8_BIT;
- mSubBitBuf = 0;
-}
-
-STATIC
-VOID
-CountLen (
- IN INT32 Index
- )
-/*++
-
-Routine Description:
-
- Count the number of each code length for a Huffman tree.
-
-Arguments:
-
- Index - the top node
-
-Returns: (VOID)
-
---*/
-{
- STATIC INT32 Depth = 0;
-
- if (Index < mN) {
- mLenCnt[(Depth < 16) ? Depth : 16]++;
- } else {
- Depth++;
- CountLen (mLeft[Index]);
- CountLen (mRight[Index]);
- Depth--;
- }
-}
-
-STATIC
-VOID
-MakeLen (
- IN INT32 Root
- )
-/*++
-
-Routine Description:
-
- Create code length array for a Huffman tree
-
-Arguments:
-
- Root - the root of the tree
-
-Returns:
-
- VOID
-
---*/
-{
- INT32 Index;
- INT32 Index3;
- UINT32 Cum;
-
- for (Index = 0; Index <= 16; Index++) {
- mLenCnt[Index] = 0;
- }
-
- CountLen (Root);
-
- //
- // Adjust the length count array so that
- // no code will be generated longer than its designated length
- //
- Cum = 0;
- for (Index = 16; Index > 0; Index--) {
- Cum += mLenCnt[Index] << (16 - Index);
- }
-
- while (Cum != (1U << 16)) {
- mLenCnt[16]--;
- for (Index = 15; Index > 0; Index--) {
- if (mLenCnt[Index] != 0) {
- mLenCnt[Index]--;
- mLenCnt[Index + 1] += 2;
- break;
- }
- }
-
- Cum--;
- }
-
- for (Index = 16; Index > 0; Index--) {
- Index3 = mLenCnt[Index];
- Index3--;
- while (Index3 >= 0) {
- mLen[*mSortPtr++] = (UINT8) Index;
- Index3--;
- }
- }
-}
-
-STATIC
-VOID
-DownHeap (
- IN INT32 Index
- )
-{
- INT32 Index2;
- INT32 Index3;
-
- //
- // priority queue: send Index-th entry down heap
- //
- Index3 = mHeap[Index];
- Index2 = 2 * Index;
- while (Index2 <= mHeapSize) {
- if (Index2 < mHeapSize && mFreq[mHeap[Index2]] > mFreq[mHeap[Index2 + 1]]) {
- Index2++;
- }
-
- if (mFreq[Index3] <= mFreq[mHeap[Index2]]) {
- break;
- }
-
- mHeap[Index] = mHeap[Index2];
- Index = Index2;
- Index2 = 2 * Index;
- }
-
- mHeap[Index] = (INT16) Index3;
-}
-
-STATIC
-VOID
-MakeCode (
- IN INT32 Number,
- IN UINT8 Len[ ],
- OUT UINT16 Code[]
- )
-/*++
-
-Routine Description:
-
- Assign code to each symbol based on the code length array
-
-Arguments:
-
- Number - number of symbols
- Len - the code length array
- Code - stores codes for each symbol
-
-Returns: (VOID)
-
---*/
-{
- INT32 Index;
- UINT16 Start[18];
-
- Start[1] = 0;
- for (Index = 1; Index <= 16; Index++) {
- Start[Index + 1] = (UINT16) ((Start[Index] + mLenCnt[Index]) << 1);
- }
-
- for (Index = 0; Index < Number; Index++) {
- Code[Index] = Start[Len[Index]]++;
- }
-}
-
-STATIC
-INT32
-MakeTree (
- IN INT32 NParm,
- IN UINT16 FreqParm[],
- OUT UINT8 LenParm[ ],
- OUT UINT16 CodeParm[]
- )
-/*++
-
-Routine Description:
-
- Generates Huffman codes given a frequency distribution of symbols
-
-Arguments:
-
- NParm - number of symbols
- FreqParm - frequency of each symbol
- LenParm - code length for each symbol
- CodeParm - code for each symbol
-
-Returns:
-
- Root of the Huffman tree.
-
---*/
-{
- INT32 Index;
- INT32 Index2;
- INT32 Index3;
- INT32 Avail;
-
- //
- // make tree, calculate len[], return root
- //
- mN = NParm;
- mFreq = FreqParm;
- mLen = LenParm;
- Avail = mN;
- mHeapSize = 0;
- mHeap[1] = 0;
- for (Index = 0; Index < mN; Index++) {
- mLen[Index] = 0;
- if (mFreq[Index]) {
- mHeapSize++;
- mHeap[mHeapSize] = (INT16) Index;
- }
- }
-
- if (mHeapSize < 2) {
- CodeParm[mHeap[1]] = 0;
- return mHeap[1];
- }
-
- for (Index = mHeapSize / 2; Index >= 1; Index--) {
- //
- // make priority queue
- //
- DownHeap (Index);
- }
-
- mSortPtr = CodeParm;
- do {
- Index = mHeap[1];
- if (Index < mN) {
- *mSortPtr++ = (UINT16) Index;
- }
-
- mHeap[1] = mHeap[mHeapSize--];
- DownHeap (1);
- Index2 = mHeap[1];
- if (Index2 < mN) {
- *mSortPtr++ = (UINT16) Index2;
- }
-
- Index3 = Avail++;
- mFreq[Index3] = (UINT16) (mFreq[Index] + mFreq[Index2]);
- mHeap[1] = (INT16) Index3;
- DownHeap (1);
- mLeft[Index3] = (UINT16) Index;
- mRight[Index3] = (UINT16) Index2;
- } while (mHeapSize > 1);
-
- mSortPtr = CodeParm;
- MakeLen (Index3);
- MakeCode (NParm, LenParm, CodeParm);
-
- //
- // return root
- //
- return Index3;
-}
-
-EFI_STATUS
-GetFileContents (
- IN char *InputFileName,
- OUT UINT8 *FileBuffer,
- OUT UINT32 *BufferLength
- )
-/*++
-
-Routine Description:
-
- Get the contents of file specified in InputFileName
- into FileBuffer.
-
-Arguments:
-
- InputFileName - Name of the input file.
-
- FileBuffer - Output buffer to contain data
-
- BufferLength - Actual length of the data
-
-Returns:
-
- EFI_SUCCESS on successful return
- EFI_ABORTED if unable to open input file.
-
---*/
-{
- UINTN Size;
- UINTN FileSize;
- FILE *InputFile;
-
- Size = 0;
- //
- // Copy the file contents to the output buffer.
- //
- InputFile = fopen (InputFileName, "rb");
- if (InputFile == NULL) {
- Error (NULL, 0, 0001, "Error opening file: %s", InputFileName);
- return EFI_ABORTED;
- }
-
- fseek (InputFile, 0, SEEK_END);
- FileSize = ftell (InputFile);
- fseek (InputFile, 0, SEEK_SET);
- //
- // Now read the contents of the file into the buffer
- //
- if (FileSize > 0 && FileBuffer != NULL) {
- if (fread (FileBuffer, FileSize, 1, InputFile) != 1) {
- Error (NULL, 0, 0004, "Error reading contents of input file: %s", InputFileName);
- fclose (InputFile);
- return EFI_ABORTED;
- }
- }
-
- fclose (InputFile);
- Size += (UINTN) FileSize;
- *BufferLength = Size;
-
- if (FileBuffer != NULL) {
- return EFI_SUCCESS;
- } else {
- return EFI_BUFFER_TOO_SMALL;
- }
-}
-
-VOID
-Version (
- VOID
- )
-/*++
-
-Routine Description:
-
- Displays the standard utility information to SDTOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
-}
-
-VOID
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- Displays the utility usage syntax to STDOUT
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-{
- //
- // Summary usage
- //
- fprintf (stdout, "Usage: %s -e|-d [options] <input_file>\n\n", UTILITY_NAME);
-
- //
- // Copyright declaration
- //
- fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
-
- //
- // Details Option
- //
- fprintf (stdout, "Options:\n");
- fprintf (stdout, " -o FileName, --output FileName\n\
- File will be created to store the ouput content.\n");
- fprintf (stdout, " -v, --verbose\n\
- Turn on verbose output with informational messages.\n");
- fprintf (stdout, " -q, --quiet\n\
- Disable all messages except key message and fatal error\n");
- fprintf (stdout, " --debug [0-9]\n\
- Enable debug messages, at input debug level.\n");
- fprintf (stdout, " --version\n\
- Show program's version number and exit.\n");
- fprintf (stdout, " -h, --help\n\
- Show this help message and exit.\n");
-}
-
-
-int
-main (
- int argc,
- char *argv[]
- )
-/*++
-
-Routine Description:
-
- Main
-
-Arguments:
-
- command line parameters
-
-Returns:
-
- EFI_SUCCESS Section header successfully generated and section concatenated.
- EFI_ABORTED Could not generate the section
- EFI_OUT_OF_RESOURCES No resource to complete the operation.
-
---*/
-{
- FILE *OutputFile;
- char *OutputFileName;
- char *InputFileName;
- FILE *InputFile;
- EFI_STATUS Status;
- UINT8 *FileBuffer;
- UINT8 *OutBuffer;
- UINT32 InputLength;
- UINT32 DstSize;
- SCRATCH_DATA *Scratch;
- UINT8 *Src;
- UINT32 OrigSize;
-
- SetUtilityName(UTILITY_NAME);
-
- FileBuffer = NULL;
- Src = NULL;
- OutBuffer = NULL;
- Scratch = NULL;
- OrigSize = 0;
- InputLength = 0;
- InputFileName = NULL;
- OutputFileName = NULL;
- DstSize=0;
- DebugLevel = 0;
- DebugMode = FALSE;
-
- //
- // Verify the correct number of arguments
- //
- if (argc == 1) {
- Error (NULL, 0, 1001, "Missing options", "No input options specified.");
- Usage();
- return 0;
- }
-
- if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0)) {
- Usage();
- return 0;
- }
-
- if ((strcmp(argv[1], "--version") == 0)) {
- Version();
- return 0;
- }
-
- argc--;
- argv++;
- if (strcmp(argv[0],"-e") == 0) {
- //
- // encode the input file
- //
- ENCODE = TRUE;
- argc--;
- argv++;
- } else if (strcmp(argv[0], "-d") == 0) {
- //
- // decode the input file
- //
- DECODE = TRUE;
- argc--;
- argv++;
- } else {
- //
- // Error command line
- //
- Error (NULL, 0, 1003, "Invalid option value", "the options specified are not recognized.");
- Usage();
- return 1;
- }
-
- while (argc > 0) {
- if ((strcmp(argv[0], "-v") == 0) || (stricmp(argv[0], "--verbose") == 0)) {
- VerboseMode = TRUE;
- argc--;
- argv++;
- continue;
- }
-
- if (stricmp (argv[0], "--debug") == 0) {
- argc-=2;
- argv++;
- Status = AsciiStringToUint64(argv[0], FALSE, &DebugLevel);
- if (DebugLevel > 9) {
- Error (NULL, 0 ,2000, "Invalid parameter", "Unrecognized argument %s", argv[0]);
- goto ERROR;
- }
- if (DebugLevel>=5 && DebugLevel <=9){
- DebugMode = TRUE;
- } else {
- DebugMode = FALSE;
- }
- argv++;
- continue;
- }
-
- if ((strcmp(argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
- QuietMode = TRUE;
- argc--;
- argv++;
- continue;
- }
-
- if ((strcmp(argv[0], "-o") == 0) || (stricmp (argv[0], "--output") == 0)) {
- if (argv[1] == NULL || argv[1][0] == '-') {
- Error (NULL, 0, 1003, "Invalid option value", "Output File name is missing for -o option");
- goto ERROR;
- }
- OutputFileName = argv[1];
- argc -=2;
- argv +=2;
- continue;
- }
-
- if (argv[0][0]!='-') {
- InputFileName = argv[0];
- argc--;
- argv++;
- continue;
- }
-
- Error (NULL, 0, 1000, "Unknown option", argv[0]);
- goto ERROR;
- }
-
- if (InputFileName == NULL) {
- Error (NULL, 0, 1001, "Missing options", "No input files specified.");
- goto ERROR;
- }
-
-//
-// All Parameters has been parsed, now set the message print level
-//
- if (QuietMode) {
- SetPrintLevel(40);
- } else if (VerboseMode) {
- SetPrintLevel(15);
- } else if (DebugMode) {
- SetPrintLevel(DebugLevel);
- }
-
- if (VerboseMode) {
- VerboseMsg("%s tool start.\n", UTILITY_NAME);
- }
- Scratch = (SCRATCH_DATA *)malloc(sizeof(SCRATCH_DATA));
- if (Scratch == NULL) {
- Error (NULL, 0, 4001, "Resource:", "Memory cannot be allocated!");
- goto ERROR;
- }
-
- InputFile = fopen (InputFileName, "rb");
- if (InputFile == NULL) {
- Error (NULL, 0, 0001, "Error opening input file", InputFileName);
- goto ERROR;
- }
-
- Status = GetFileContents(
- InputFileName,
- FileBuffer,
- &InputLength);
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- FileBuffer = (UINT8 *) malloc (InputLength);
- if (FileBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource:", "Memory cannot be allocated!");
- return 1;
- }
-
- Status = GetFileContents (
- InputFileName,
- FileBuffer,
- &InputLength
- );
- }
-
- if (EFI_ERROR(Status)) {
- free(FileBuffer);
- return 1;
- }
-
- if (OutputFileName != NULL) {
- OutputFile = fopen (OutputFileName, "wb");
- if (OutputFile == NULL) {
- Error (NULL, 0, 0001, "Error opening output file for writing", OutputFileName);
- if (InputFile != NULL) {
- fclose (InputFile);
- }
- goto ERROR;
- }
- } else {
- OutputFileName = DEFAULT_OUTPUT_FILE;
- OutputFile = fopen (OutputFileName, "wb");
- }
-
- if (ENCODE) {
- //
- // First call TianoCompress to get DstSize
- //
- if (DebugMode) {
- DebugMsg(UTILITY_NAME, 0, DebugLevel, "Encoding", NULL);
- }
- Status = TianoCompress ((UINT8 *)FileBuffer, InputLength, OutBuffer, &DstSize);
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- OutBuffer = (UINT8 *) malloc (DstSize);
- if (OutBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource:", "Memory cannot be allocated!");
- goto ERROR;
- }
- }
- Status = TianoCompress ((UINT8 *)FileBuffer, InputLength, OutBuffer, &DstSize);
- if (Status != EFI_SUCCESS) {
- Error (NULL, 0, 0007, "Error compressing file", NULL);
- goto ERROR;
- }
-
- fwrite(OutBuffer,(size_t)DstSize, 1, OutputFile);
- free(Scratch);
- free(FileBuffer);
- free(OutBuffer);
-
- if (DebugMode) {
- DebugMsg(UTILITY_NAME, 0, DebugLevel, "Encoding Successful!\n", NULL);
- }
- if (VerboseMode) {
- VerboseMsg("Encoding successful\n");
- }
- return 0;
- }
- else if (DECODE) {
- if (DebugMode) {
- DebugMsg(UTILITY_NAME, 0, DebugLevel, "Decoding\n", NULL);
- }
- //
- // Get Compressed file original size
- //
- Src = (UINT8 *)FileBuffer;
- OrigSize = Src[4] + (Src[5] << 8) + (Src[6] << 16) + (Src[7] << 24);
-
- //
- // Allocate OutputBuffer
- //
- OutBuffer = (UINT8 *)malloc(OrigSize);
- if (OutBuffer == NULL) {
- Error (NULL, 0, 4001, "Resource:", "Memory cannot be allocated!");
- goto ERROR;
- }
-
- Status = Decompress((VOID *)FileBuffer, (VOID *)OutBuffer, (VOID *)Scratch, 2);
- if (Status != EFI_SUCCESS) {
- goto ERROR;
- }
-
- fwrite(OutBuffer, (size_t)(Scratch->mOrigSize), 1, OutputFile);
- free(Scratch);
- free(FileBuffer);
- free(OutBuffer);
-
- if (DebugMode) {
- DebugMsg(UTILITY_NAME, 0, DebugLevel, "Encoding successful!\n", NULL);
- }
-
- if (VerboseMode) {
- VerboseMsg("Decoding successful\n");
- }
- return 0;
- }
-
-ERROR:
- if (DebugMode) {
- if (ENCODE) {
- DebugMsg(UTILITY_NAME, 0, DebugLevel, "Encoding Error\n", NULL);
- } else if (DECODE) {
- DebugMsg(UTILITY_NAME, 0, DebugLevel, "Decoding Error\n", NULL);
- }
- }
- if (Scratch != NULL) {
- free(Scratch);
- }
- if (FileBuffer != NULL) {
- free(FileBuffer);
- }
- if (OutBuffer != NULL) {
- free(OutBuffer);
- }
-
- if (VerboseMode) {
- VerboseMsg("%s tool done with return code is 0x%x.\n", UTILITY_NAME, GetUtilityStatus ());
- }
- return GetUtilityStatus ();
-}
-
-VOID
-FillBuf (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- )
-/*++
-
-Routine Description:
-
- Shift mBitBuf NumOfBits left. Read in NumOfBits of bits from source.
-
-Arguments:
-
- Sd - The global scratch data
- NumOfBits - The number of bits to shift and read.
-
-Returns: (VOID)
-
---*/
-{
- Sd->mBitBuf = (UINT32) (Sd->mBitBuf << NumOfBits);
-
- while (NumOfBits > Sd->mBitCount) {
-
- Sd->mBitBuf |= (UINT32) (Sd->mSubBitBuf << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
-
- if (Sd->mCompSize > 0) {
- //
- // Get 1 byte into SubBitBuf
- //
- Sd->mCompSize--;
- Sd->mSubBitBuf = 0;
- Sd->mSubBitBuf = Sd->mSrcBase[Sd->mInBuf++];
- Sd->mBitCount = 8;
-
- } else {
- //
- // No more bits from the source, just pad zero bit.
- //
- Sd->mSubBitBuf = 0;
- Sd->mBitCount = 8;
-
- }
- }
-
- Sd->mBitCount = (UINT16) (Sd->mBitCount - NumOfBits);
- Sd->mBitBuf |= Sd->mSubBitBuf >> Sd->mBitCount;
-}
-
-UINT32
-GetBits (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- )
-/*++
-
-Routine Description:
-
- Get NumOfBits of bits out from mBitBuf. Fill mBitBuf with subsequent
- NumOfBits of bits from source. Returns NumOfBits of bits that are
- popped out.
-
-Arguments:
-
- Sd - The global scratch data.
- NumOfBits - The number of bits to pop and read.
-
-Returns:
-
- The bits that are popped out.
-
---*/
-{
- UINT32 OutBits;
-
- OutBits = (UINT32) (Sd->mBitBuf >> (BITBUFSIZ - NumOfBits));
-
- FillBuf (Sd, NumOfBits);
-
- return OutBits;
-}
-
-UINT16
-MakeTable (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfChar,
- IN UINT8 *BitLen,
- IN UINT16 TableBits,
- OUT UINT16 *Table
- )
-/*++
-
-Routine Description:
-
- Creates Huffman Code mapping table according to code length array.
-
-Arguments:
-
- Sd - The global scratch data
- NumOfChar - Number of symbols in the symbol set
- BitLen - Code length array
- TableBits - The width of the mapping table
- Table - The table
-
-Returns:
-
- 0 - OK.
- BAD_TABLE - The table is corrupted.
-
---*/
-{
- UINT16 Count[17];
- UINT16 Weight[17];
- UINT16 Start[18];
- UINT16 *Pointer;
- UINT16 Index3;
- volatile UINT16 Index;
- UINT16 Len;
- UINT16 Char;
- UINT16 JuBits;
- UINT16 Avail;
- UINT16 NextCode;
- UINT16 Mask;
- UINT16 WordOfStart;
- UINT16 WordOfCount;
-
- for (Index = 1; Index <= 16; Index++) {
- Count[Index] = 0;
- }
-
- for (Index = 0; Index < NumOfChar; Index++) {
- Count[BitLen[Index]]++;
- }
-
- Start[1] = 0;
-
- for (Index = 1; Index <= 16; Index++) {
- WordOfStart = Start[Index];
- WordOfCount = Count[Index];
- Start[Index + 1] = (UINT16) (WordOfStart + (WordOfCount << (16 - Index)));
- }
-
- if (Start[17] != 0) {
- //
- //(1U << 16)
- //
- return (UINT16) BAD_TABLE;
- }
-
- JuBits = (UINT16) (16 - TableBits);
-
- for (Index = 1; Index <= TableBits; Index++) {
- Start[Index] >>= JuBits;
- Weight[Index] = (UINT16) (1U << (TableBits - Index));
- }
-
- while (Index <= 16) {
- Weight[Index] = (UINT16) (1U << (16 - Index));
- Index++;
- }
-
- Index = (UINT16) (Start[TableBits + 1] >> JuBits);
-
- if (Index != 0) {
- Index3 = (UINT16) (1U << TableBits);
- while (Index != Index3) {
- Table[Index++] = 0;
- }
- }
-
- Avail = NumOfChar;
- Mask = (UINT16) (1U << (15 - TableBits));
-
- for (Char = 0; Char < NumOfChar; Char++) {
-
- Len = BitLen[Char];
- if (Len == 0) {
- continue;
- }
-
- NextCode = (UINT16) (Start[Len] + Weight[Len]);
-
- if (Len <= TableBits) {
-
- for (Index = Start[Len]; Index < NextCode; Index++) {
- Table[Index] = Char;
- }
-
- } else {
-
- Index3 = Start[Len];
- Pointer = &Table[Index3 >> JuBits];
- Index = (UINT16) (Len - TableBits);
-
- while (Index != 0) {
- if (*Pointer == 0) {
- Sd->mRight[Avail] = Sd->mLeft[Avail] = 0;
- *Pointer = Avail++;
- }
-
- if (Index3 & Mask) {
- Pointer = &Sd->mRight[*Pointer];
- } else {
- Pointer = &Sd->mLeft[*Pointer];
- }
-
- Index3 <<= 1;
- Index--;
- }
-
- *Pointer = Char;
-
- }
-
- Start[Len] = NextCode;
- }
- //
- // Succeeds
- //
- return 0;
-}
-
-UINT32
-DecodeP (
- IN SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Decodes a position value.
-
-Arguments:
-
- Sd - the global scratch data
-
-Returns:
-
- The position value decoded.
-
---*/
-{
- UINT16 Val;
- UINT32 Mask;
- UINT32 Pos;
-
- Val = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
-
- if (Val >= MAXNP) {
- Mask = 1U << (BITBUFSIZ - 1 - 8);
-
- do {
-
- if (Sd->mBitBuf & Mask) {
- Val = Sd->mRight[Val];
- } else {
- Val = Sd->mLeft[Val];
- }
-
- Mask >>= 1;
- } while (Val >= MAXNP);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mPTLen[Val]);
-
- Pos = Val;
- if (Val > 1) {
- Pos = (UINT32) ((1U << (Val - 1)) + GetBits (Sd, (UINT16) (Val - 1)));
- }
-
- return Pos;
-}
-
-UINT16
-ReadPTLen (
- IN SCRATCH_DATA *Sd,
- IN UINT16 nn,
- IN UINT16 nbit,
- IN UINT16 Special
- )
-/*++
-
-Routine Description:
-
- Reads code lengths for the Extra Set or the Position Set
-
-Arguments:
-
- Sd - The global scratch data
- nn - Number of symbols
- nbit - Number of bits needed to represent nn
- Special - The special symbol that needs to be taken care of
-
-Returns:
-
- 0 - OK.
- BAD_TABLE - Table is corrupted.
-
---*/
-{
- UINT16 Number;
- UINT16 CharC;
- volatile UINT16 Index;
- UINT32 Mask;
-
- Number = (UINT16) GetBits (Sd, nbit);
-
- if (Number == 0) {
- CharC = (UINT16) GetBits (Sd, nbit);
-
- for (Index = 0; Index < 256; Index++) {
- Sd->mPTTable[Index] = CharC;
- }
-
- for (Index = 0; Index < nn; Index++) {
- Sd->mPTLen[Index] = 0;
- }
-
- return 0;
- }
-
- Index = 0;
-
- while (Index < Number) {
-
- CharC = (UINT16) (Sd->mBitBuf >> (BITBUFSIZ - 3));
-
- if (CharC == 7) {
- Mask = 1U << (BITBUFSIZ - 1 - 3);
- while (Mask & Sd->mBitBuf) {
- Mask >>= 1;
- CharC += 1;
- }
- }
-
- FillBuf (Sd, (UINT16) ((CharC < 7) ? 3 : CharC - 3));
-
- Sd->mPTLen[Index++] = (UINT8) CharC;
-
- if (Index == Special) {
- CharC = (UINT16) GetBits (Sd, 2);
- while ((INT16) (--CharC) >= 0) {
- Sd->mPTLen[Index++] = 0;
- }
- }
- }
-
- while (Index < nn) {
- Sd->mPTLen[Index++] = 0;
- }
-
- return MakeTable (Sd, nn, Sd->mPTLen, 8, Sd->mPTTable);
-}
-
-VOID
-ReadCLen (
- SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Reads code lengths for Char&Len Set.
-
-Arguments:
-
- Sd - the global scratch data
-
-Returns: (VOID)
-
---*/
-{
- UINT16 Number;
- UINT16 CharC;
- volatile UINT16 Index;
- UINT32 Mask;
-
- Number = (UINT16) GetBits (Sd, CBIT);
-
- if (Number == 0) {
- CharC = (UINT16) GetBits (Sd, CBIT);
-
- for (Index = 0; Index < NC; Index++) {
- Sd->mCLen[Index] = 0;
- }
-
- for (Index = 0; Index < 4096; Index++) {
- Sd->mCTable[Index] = CharC;
- }
-
- return ;
- }
-
- Index = 0;
- while (Index < Number) {
-
- CharC = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
- if (CharC >= NT) {
- Mask = 1U << (BITBUFSIZ - 1 - 8);
-
- do {
-
- if (Mask & Sd->mBitBuf) {
- CharC = Sd->mRight[CharC];
- } else {
- CharC = Sd->mLeft[CharC];
- }
-
- Mask >>= 1;
-
- } while (CharC >= NT);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mPTLen[CharC]);
-
- if (CharC <= 2) {
-
- if (CharC == 0) {
- CharC = 1;
- } else if (CharC == 1) {
- CharC = (UINT16) (GetBits (Sd, 4) + 3);
- } else if (CharC == 2) {
- CharC = (UINT16) (GetBits (Sd, CBIT) + 20);
- }
-
- while ((INT16) (--CharC) >= 0) {
- Sd->mCLen[Index++] = 0;
- }
-
- } else {
-
- Sd->mCLen[Index++] = (UINT8) (CharC - 2);
-
- }
- }
-
- while (Index < NC) {
- Sd->mCLen[Index++] = 0;
- }
-
- MakeTable (Sd, NC, Sd->mCLen, 12, Sd->mCTable);
-
- return ;
-}
-
-UINT16
-DecodeC (
- SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Decode a character/length value.
-
-Arguments:
-
- Sd - The global scratch data.
-
-Returns:
-
- The value decoded.
-
---*/
-{
- UINT16 Index2;
- UINT32 Mask;
-
- if (Sd->mBlockSize == 0) {
- //
- // Starting a new block
- //
- Sd->mBlockSize = (UINT16) GetBits (Sd, 16);
- Sd->mBadTableFlag = ReadPTLen (Sd, NT, TBIT, 3);
- if (Sd->mBadTableFlag != 0) {
- return 0;
- }
-
- ReadCLen (Sd);
-
- Sd->mBadTableFlag = ReadPTLen (Sd, MAXNP, Sd->mPBit, (UINT16) (-1));
- if (Sd->mBadTableFlag != 0) {
- return 0;
- }
- }
-
- Sd->mBlockSize--;
- Index2 = Sd->mCTable[Sd->mBitBuf >> (BITBUFSIZ - 12)];
-
- if (Index2 >= NC) {
- Mask = 1U << (BITBUFSIZ - 1 - 12);
-
- do {
- if (Sd->mBitBuf & Mask) {
- Index2 = Sd->mRight[Index2];
- } else {
- Index2 = Sd->mLeft[Index2];
- }
-
- Mask >>= 1;
- } while (Index2 >= NC);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mCLen[Index2]);
-
- return Index2;
-}
-
-VOID
-Decode (
- SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Decode the source data and put the resulting data into the destination buffer.
-
-Arguments:
-
- Sd - The global scratch data
-
-Returns: (VOID)
-
- --*/
-{
- UINT16 BytesRemain;
- UINT32 DataIdx;
- UINT16 CharC;
-
- BytesRemain = (UINT16) (-1);
-
- DataIdx = 0;
-
- for (;;) {
- CharC = DecodeC (Sd);
- if (Sd->mBadTableFlag != 0) {
- goto Done ;
- }
-
- if (CharC < 256) {
- //
- // Process an Original character
- //
- if (Sd->mOutBuf >= Sd->mOrigSize) {
- goto Done ;
- } else {
- Sd->mDstBase[Sd->mOutBuf++] = (UINT8) CharC;
- }
-
- } else {
- //
- // Process a Pointer
- //
- CharC = (UINT16) (CharC - (UINT8_MAX + 1 - THRESHOLD));
-
- BytesRemain = CharC;
-
- DataIdx = Sd->mOutBuf - DecodeP (Sd) - 1;
-
- BytesRemain--;
- while ((INT16) (BytesRemain) >= 0) {
- Sd->mDstBase[Sd->mOutBuf++] = Sd->mDstBase[DataIdx++];
- if (Sd->mOutBuf >= Sd->mOrigSize) {
- goto Done ;
- }
-
- BytesRemain--;
- }
- }
- }
-
-Done:
- return ;
-}
-
-RETURN_STATUS
-EFIAPI
-Decompress (
- IN VOID *Source,
- IN OUT VOID *Destination,
- IN OUT VOID *Scratch,
- IN UINT32 Version
- )
-/*++
-
-Routine Description:
-
- The internal implementation of Decompress().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- Destination - The destination buffer to store the decompressed data
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- Version - 1 for EFI1.1 Decompress algoruthm, 2 for Tiano Decompress algorithm
-
-Returns:
-
- RETURN_SUCCESS - Decompression is successfull
- RETURN_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- volatile UINT32 Index;
- UINT32 CompSize;
- UINT32 OrigSize;
- SCRATCH_DATA *Sd;
- CONST UINT8 *Src;
- UINT8 *Dst;
-
- //
- // Verify input is not NULL
- //
- assert(Source);
-// assert(Destination);
- assert(Scratch);
-
- Src = (UINT8 *)Source;
- Dst = (UINT8 *)Destination;
-
- Sd = (SCRATCH_DATA *) Scratch;
- CompSize = Src[0] + (Src[1] << 8) + (Src[2] << 16) + (Src[3] << 24);
- OrigSize = Src[4] + (Src[5] << 8) + (Src[6] << 16) + (Src[7] << 24);
-
- //
- // If compressed file size is 0, return
- //
- if (OrigSize == 0) {
- return RETURN_SUCCESS;
- }
-
- Src = Src + 8;
-
- for (Index = 0; Index < sizeof (SCRATCH_DATA); Index++) {
- ((UINT8 *) Sd)[Index] = 0;
- }
- //
- // The length of the field 'Position Set Code Length Array Size' in Block Header.
- // For EFI 1.1 de/compression algorithm(Version 1), mPBit = 4
- // For Tiano de/compression algorithm(Version 2), mPBit = 5
- //
- switch (Version) {
- case 1 :
- Sd->mPBit = 4;
- break;
- case 2 :
- Sd->mPBit = 5;
- break;
- default:
- assert(FALSE);
- }
- Sd->mSrcBase = (UINT8 *)Src;
- Sd->mDstBase = Dst;
- Sd->mCompSize = CompSize;
- Sd->mOrigSize = OrigSize;
-
- //
- // Fill the first BITBUFSIZ bits
- //
- FillBuf (Sd, BITBUFSIZ);
-
- //
- // Decompress it
- //
-
- Decode (Sd);
-
- if (Sd->mBadTableFlag != 0) {
- //
- // Something wrong with the source
- //
- return RETURN_INVALID_PARAMETER;
- }
-
- return RETURN_SUCCESS;
-}
-
-
diff --git a/BaseTools/Source/C/TianoCompress/TianoCompress.h b/BaseTools/Source/C/TianoCompress/TianoCompress.h
deleted file mode 100644
index b719ad2deb..0000000000
--- a/BaseTools/Source/C/TianoCompress/TianoCompress.h
+++ /dev/null
@@ -1,439 +0,0 @@
-/** @file
- Internal include file for Tiano Decompress Libary.
-
- Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- Module Name: TianoDecompress.h
-
-**/
-
-#ifndef __TIANO_DECOMPRESS_H__
-#define __TIANO_DECOMPRESS_H__
-
-#include <stdio.h>
-#include <assert.h>
-#include <Common/UefiBaseTypes.h>
-
-
-//
-// Decompression algorithm begins here
-//
-#define UTILITY_NAME "TianoCompress"
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 1
-
-//
-// Default output file name
-//
-#define DEFAULT_OUTPUT_FILE "file.tmp"
-
-#define BITBUFSIZ 32
-#define MAXMATCH 256
-#define THRESHOLD 3
-#define CODE_BIT 16
-#define BAD_TABLE - 1
-
-typedef INT32 NODE;
-
-//
-// C: Char&Len Set; P: Position Set; T: exTra Set
-//
-#define NC (0xff + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define MAXPBIT 5
-#define TBIT 5
-#define MAXNP ((1U << MAXPBIT) - 1)
-#define NT (CODE_BIT + 3)
-#if NT > MAXNP
-#define NPT NT
-#else
-#define NPT MAXNP
-#endif
-
-typedef struct {
- UINT8 *mSrcBase; // Starting address of compressed data
- UINT8 *mDstBase; // Starting address of decompressed data
- UINT32 mOutBuf;
- UINT32 mInBuf;
-
- UINT16 mBitCount;
- UINT32 mBitBuf;
- UINT32 mSubBitBuf;
- UINT16 mBlockSize;
- UINT32 mCompSize;
- UINT32 mOrigSize;
-
- UINT16 mBadTableFlag;
-
- UINT16 mLeft[2 * NC - 1];
- UINT16 mRight[2 * NC - 1];
- UINT8 mCLen[NC];
- UINT8 mPTLen[NPT];
- UINT16 mCTable[4096];
- UINT16 mPTTable[256];
-
- //
- // The length of the field 'Position Set Code Length Array Size' in Block Header.
- // For EFI 1.1 de/compression algorithm, mPBit = 4
- // For Tiano de/compression algorithm, mPBit = 5
- //
- UINT8 mPBit;
-} SCRATCH_DATA;
-
-//
-// Function Prototypes
-//
-
-EFI_STATUS
-GetFileContents (
- IN char *InputFileName,
- OUT UINT8 *FileBuffer,
- OUT UINT32 *BufferLength
- );
-
-STATIC
-VOID
-PutDword(
- IN UINT32 Data
- );
-
-STATIC
-EFI_STATUS
-AllocateMemory (
- VOID
- );
-
-STATIC
-VOID
-FreeMemory (
- VOID
- );
-
-STATIC
-VOID
-InitSlide (
- VOID
- );
-
-STATIC
-NODE
-Child (
- IN NODE NodeQ,
- IN UINT8 CharC
- );
-
-STATIC
-VOID
-MakeChild (
- IN NODE NodeQ,
- IN UINT8 CharC,
- IN NODE NodeR
- );
-
-STATIC
-VOID
-Split (
- IN NODE Old
- );
-
-STATIC
-VOID
-InsertNode (
- VOID
- );
-
-STATIC
-VOID
-DeleteNode (
- VOID
- );
-
-STATIC
-VOID
-GetNextMatch (
- VOID
- );
-
-STATIC
-EFI_STATUS
-Encode (
- VOID
- );
-
-STATIC
-VOID
-CountTFreq (
- VOID
- );
-
-STATIC
-VOID
-WritePTLen (
- IN INT32 Number,
- IN INT32 nbit,
- IN INT32 Special
- );
-
-STATIC
-VOID
-WriteCLen (
- VOID
- );
-
-STATIC
-VOID
-EncodeC (
- IN INT32 Value
- );
-
-STATIC
-VOID
-EncodeP (
- IN UINT32 Value
- );
-
-STATIC
-VOID
-SendBlock (
- VOID
- );
-
-STATIC
-VOID
-Output (
- IN UINT32 c,
- IN UINT32 p
- );
-
-STATIC
-VOID
-HufEncodeStart (
- VOID
- );
-
-STATIC
-VOID
-HufEncodeEnd (
- VOID
- );
-
-STATIC
-VOID
-MakeCrcTable (
- VOID
- );
-
-
-STATIC
-VOID
-PutBits (
- IN INT32 Number,
- IN UINT32 Value
- );
-
-STATIC
-INT32
-FreadCrc (
- OUT UINT8 *Pointer,
- IN INT32 Number
- );
-
-STATIC
-VOID
-InitPutBits (
- VOID
- );
-
-STATIC
-VOID
-CountLen (
- IN INT32 Index
- );
-
-STATIC
-VOID
-MakeLen (
- IN INT32 Root
- );
-
-STATIC
-VOID
-DownHeap (
- IN INT32 Index
- );
-
-STATIC
-VOID
-MakeCode (
- IN INT32 Number,
- IN UINT8 Len[ ],
- OUT UINT16 Code[]
- );
-
-STATIC
-INT32
-MakeTree (
- IN INT32 NParm,
- IN UINT16 FreqParm[],
- OUT UINT8 LenParm[ ],
- OUT UINT16 CodeParm[]
- );
-
-/**
- Read NumOfBit of bits from source into mBitBuf
-
- Shift mBitBuf NumOfBits left. Read in NumOfBits of bits from source.
-
- @param Sd The global scratch data
- @param NumOfBits The number of bits to shift and read.
-
-**/
-VOID
-FillBuf (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- );
-
-/**
- Get NumOfBits of bits out from mBitBuf
-
- Get NumOfBits of bits out from mBitBuf. Fill mBitBuf with subsequent
- NumOfBits of bits from source. Returns NumOfBits of bits that are
- popped out.
-
- @param Sd The global scratch data.
- @param NumOfBits The number of bits to pop and read.
-
- @return The bits that are popped out.
-
-**/
-UINT32
-GetBits (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- );
-
-/**
- Creates Huffman Code mapping table according to code length array.
-
- Creates Huffman Code mapping table for Extra Set, Char&Len Set
- and Position Set according to code length array.
-
- @param Sd The global scratch data
- @param NumOfChar Number of symbols in the symbol set
- @param BitLen Code length array
- @param TableBits The width of the mapping table
- @param Table The table
-
- @retval 0 OK.
- @retval BAD_TABLE The table is corrupted.
-
-**/
-UINT16
-MakeTable (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfChar,
- IN UINT8 *BitLen,
- IN UINT16 TableBits,
- OUT UINT16 *Table
- );
-
-/**
- Decodes a position value.
-
- Get a position value according to Position Huffman Table.
-
- @param Sd the global scratch data
-
- @return The position value decoded.
-
-**/
-UINT32
-DecodeP (
- IN SCRATCH_DATA *Sd
- );
-
-/**
- Reads code lengths for the Extra Set or the Position Set.
-
- Read in the Extra Set or Pointion Set Length Arrary, then
- generate the Huffman code mapping for them.
-
- @param Sd The global scratch data.
- @param nn Number of symbols.
- @param nbit Number of bits needed to represent nn.
- @param Special The special symbol that needs to be taken care of.
-
- @retval 0 OK.
- @retval BAD_TABLE Table is corrupted.
-
-**/
-UINT16
-ReadPTLen (
- IN SCRATCH_DATA *Sd,
- IN UINT16 nn,
- IN UINT16 nbit,
- IN UINT16 Special
- );
-
-/**
- Reads code lengths for Char&Len Set.
-
- Read in and decode the Char&Len Set Code Length Array, then
- generate the Huffman Code mapping table for the Char&Len Set.
-
- @param Sd the global scratch data
-
-**/
-VOID
-ReadCLen (
- SCRATCH_DATA *Sd
- );
-
-/**
- Decode a character/length value.
-
- Read one value from mBitBuf, Get one code from mBitBuf. If it is at block boundary, generates
- Huffman code mapping table for Extra Set, Code&Len Set and
- Position Set.
-
- @param Sd The global scratch data.
-
- @return The value decoded.
-
-**/
-UINT16
-DecodeC (
- SCRATCH_DATA *Sd
- );
-
-/**
- Decode the source data and put the resulting data into the destination buffer.
-
- Decode the source data and put the resulting data into the destination buffer.
-
- @param Sd The global scratch data
-
-**/
-VOID
-Decode (
- SCRATCH_DATA *Sd
- );
-
-RETURN_STATUS
-EFIAPI
-Decompress (
- IN VOID *Source,
- IN OUT VOID *Destination,
- IN OUT VOID *Scratch,
- IN UINT32 Version
- );
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/EfiVfr.h b/BaseTools/Source/C/VfrCompile/EfiVfr.h
deleted file mode 100644
index 4b9aed0adb..0000000000
--- a/BaseTools/Source/C/VfrCompile/EfiVfr.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/** @file
-
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- EfiVfr.h
-
-Abstract:
-
- Defines and prototypes for the UEFI VFR compiler internal use.
-
-**/
-
-#ifndef _EFIVFR_H_
-#define _EFIVFR_H_
-
-#include "Common/UefiBaseTypes.h"
-#include "Common/UefiInternalFormRepresentation.h"
-#include "Common/MdeModuleHii.h"
-
-#define MAX_PATH 255
-#define MAX_VFR_LINE_LEN 4096
-
-#define EFI_IFR_MAX_LENGTH 0xFF
-#define MAX_IFR_EXPRESSION_DEPTH 0x9
-
-#define EFI_VARSTORE_ID_INVALID 0
-#define EFI_VAROFFSET_INVALID 0xFFFF
-#define EFI_VARSTORE_ID_START 0x20
-#define EFI_STRING_ID_INVALID 0x0
-#define EFI_IMAGE_ID_INVALID 0xFFFF
-
-#define EFI_IFR_MAX_DEFAULT_TYPE 0x10
-
-typedef enum {
- QUESTION_NORMAL,
- QUESTION_DATE,
- QUESTION_TIME,
- QUESTION_REF,
-} EFI_QUESION_TYPE;
-
-typedef enum {
- EQUAL,
- LESS_EQUAL,
- LESS_THAN,
- GREATER_THAN,
- GREATER_EQUAL
-} EFI_COMPARE_TYPE;
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/GNUmakefile b/BaseTools/Source/C/VfrCompile/GNUmakefile
deleted file mode 100644
index 82005e11f1..0000000000
--- a/BaseTools/Source/C/VfrCompile/GNUmakefile
+++ /dev/null
@@ -1,79 +0,0 @@
-## @file
-# GNU/Linux makefile for 'VfrCompile' module build.
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = VfrCompile
-
-LIBS = -lCommon
-
-TOOL_INCLUDE = -I Pccts/h
-
-#OBJECTS = VfrSyntax.o VfrServices.o DLGLexer.o EfiVfrParser.o ATokenBuffer.o DLexerBase.o AParser.o
-OBJECTS = AParser.o DLexerBase.o ATokenBuffer.o EfiVfrParser.o VfrLexer.o VfrSyntax.o \
- VfrFormPkg.o VfrError.o VfrUtilityLib.o VfrCompiler.o
-
-VFR_CPPFLAGS = -DPCCTS_USE_NAMESPACE_STD $(CPPFLAGS)
-
-LINKER = $(CXX)
-
-EXTRA_CLEAN_OBJECTS = EfiVfrParser.cpp EfiVfrParser.h VfrParser.dlg VfrTokens.h VfrLexer.cpp VfrLexer.h VfrSyntax.cpp tokens.h
-
-MAKEROOT ?= ../..
-
-include $(MAKEROOT)/Makefiles/header.makefile
-
-APPLICATION = $(MAKEROOT)/bin/$(APPNAME)
-
-.PHONY:all
-all: $(MAKEROOT)/bin $(APPLICATION)
-
-$(APPLICATION): $(OBJECTS)
- $(LINKER) -o $(APPLICATION) $(LFLAGS) $(OBJECTS) -L$(MAKEROOT)/libs $(LIBS)
-
-VfrCompiler.o: ../Include/Common/BuildVersion.h
-
-include $(MAKEROOT)/Makefiles/footer.makefile
-
-VfrSyntax.cpp EfiVfrParser.cpp EfiVfrParser.h VfrParser.dlg VfrTokens.h: Pccts/antlr/antlr VfrSyntax.g
- Pccts/antlr/antlr -CC -e3 -ck 3 -k 2 -fl VfrParser.dlg -ft VfrTokens.h -o . VfrSyntax.g
-
-VfrLexer.cpp VfrLexer.h: Pccts/dlg/dlg VfrParser.dlg
- Pccts/dlg/dlg -C2 -i -CC -cl VfrLexer -o . VfrParser.dlg
-
-Pccts/antlr/antlr:
- BIN_DIR='.' make -C Pccts/antlr
-
-Pccts/dlg/dlg:
- BIN_DIR='.' make -C Pccts/dlg
-
-ATokenBuffer.o: Pccts/h/ATokenBuffer.cpp
- $(CXX) -c $(VFR_CPPFLAGS) $(INC) $? -o $@
-
-DLexerBase.o: Pccts/h/DLexerBase.cpp
- $(CXX) -c $(VFR_CPPFLAGS) $(INC) $? -o $@
-
-AParser.o: Pccts/h/AParser.cpp
- $(CXX) -c $(VFR_CPPFLAGS) $(INC) $? -o $@
-
-VfrSyntax.o: VfrSyntax.cpp
- $(CXX) -c $(VFR_CPPFLAGS) $(INC) $? -o $@
-
-clean: localClean
-
-localClean:
- BIN_DIR='.' make -C Pccts/antlr clean
- BIN_DIR='.' make -C Pccts/dlg clean
- rm -f $(EXTRA_CLEAN_OBJECTS)
-
diff --git a/BaseTools/Source/C/VfrCompile/Makefile b/BaseTools/Source/C/VfrCompile/Makefile
deleted file mode 100644
index 0272966087..0000000000
--- a/BaseTools/Source/C/VfrCompile/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-## @file
-# Windows makefile for 'VfrCompile' module build.
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-CPPFLAGS = $(CPPFLAGS) /WX /D PCCTS_USE_NAMESPACE_STD
-APPNAME = VfrCompile
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = AParser.obj DLexerBase.obj ATokenBuffer.obj \
- EfiVfrParser.obj VfrLexer.obj VfrSyntax.obj \
- VfrFormPkg.obj VfrError.obj VfrUtilityLib.obj VfrCompiler.obj
-
-INC = $(INC) -I $(BASE_TOOLS_PATH)\Source\C\VfrCompile\Pccts\h
-
-!INCLUDE ..\Makefiles\ms.app
-
-VfrSyntax.cpp EfiVfrParser.cpp EfiVfrParser.h VfrParser.dlg VfrTokens.h: VfrSyntax.g
- pushd . & cd Pccts & $(MAKE) & popd
- antlr -CC -e3 -ck 3 -k 2 -fl VfrParser.dlg -ft VfrTokens.h -o . VfrSyntax.g
-# pushd . & cd Pccts & $(MAKE) clean
-
-VfrLexer.cpp VfrLexer.h: VfrParser.dlg
- dlg -C2 -i -CC -cl VfrLexer -o . VfrParser.dlg
-
-ATokenBuffer.obj: Pccts\h\ATokenBuffer.cpp
- $(CXX) -c $(CPPFLAGS) $(INC) $? -Fo$@
-
-DLexerBase.obj: Pccts\h\DLexerBase.cpp
- $(CXX) -c $(CPPFLAGS) $(INC) $? -Fo$@
-
-AParser.obj: Pccts\h\AParser.cpp
- $(CXX) -c $(CPPFLAGS) $(INC) $? -Fo$@
-
-EXTRA_CLEAN_OBJECTS = VfrParser.dlg EfiVfrParser.cpp EfiVfrParser.h \
- VfrLexer.cpp VfrLexer.h \
- VfrSyntax.cpp VfrTokens.h
-
-clean: localClean
-cleanall: localClean localCleanall
-
-localClean:
- -DEL $(EXTRA_CLEAN_OBJECTS)
-
-localCleanall:
- pushd . & cd Pccts & $(MAKE) cleanall & popd
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_131.txt b/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_131.txt
deleted file mode 100644
index 500d84f2e8..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_131.txt
+++ /dev/null
@@ -1,522 +0,0 @@
-CHANGES FROM 1.31
-
-This file contains the migration of PCCTS from 1.31 in the order that
-changes were made. 1.32b7 is the last beta before full 1.32.
-Terence Parr, Parr Research Corporation 1995.
-
-
-======================================================================
-1.32b1
-Added Russell Quong to banner, changed banner for output slightly
-Fixed it so that you have before / after actions for C++ in class def
-Fixed bug in optimizer that made it sometimes forget to set internal
- token pointers. Only showed up when a {...} was in the "wrong spot".
-
-======================================================================
-1.32b2
-Added fixes by Dave Seidel for PC compilers in 32 bit mode (config.h
-and set.h).
-
-======================================================================
-1.32b3
-Fixed hideous bug in code generator for wildcard and for ~token op.
-
-from Dave Seidel
-
- Added pcnames.bat
- 1. in antlr/main.c: change strcasecmp() to stricmp()
-
- 2. in dlg/output.c: use DLEXER_C instead on "DLexer.C"
-
- 3. in h/PBlackBox.h: use <iostream.h> instead of <stream.h>
-
-======================================================================
-1.32b4
-When the -ft option was used, any path prefix screwed up
-the gate on the .h files
-
-Fixed yet another bug due to the optimizer.
-
-The exception handling thing was a bit wacko:
-
-a : ( A B )? A B
- | A C
- ;
- exception ...
-
-caused an exception if "A C" was the input. In other words,
-it found that A C didn't match the (A B)? pred and caused
-an exception rather than trying the next alt. All I did
-was to change the zzmatch_wsig() macros.
-
-Fixed some problems in gen.c relating to the name of token
-class bit sets in the output.
-
-Added the tremendously cool generalized predicate. For the
-moment, I'll give this bried description.
-
-a : <<predicate>>? blah
- | foo
- ;
-
-This implies that (assuming blah and foo are syntactically
-ambiguous) "predicate" indicates the semantic validity of
-applying "blah". If "predicate" is false, "foo" is attempted.
-
-Previously, you had to say:
-
-a : <<LA(1)==ID ? predicate : 1>>? ID
- | ID
- ;
-
-Now, you can simply use "predicate" without the ?: operator
-if you turn on ANTLR command line option: "-prc on". This
-tells ANTLR to compute that all by itself. It computes n
-tokens of lookahead where LT(n) or LATEXT(n) is the farthest
-ahead you look.
-
-If you give a predicate using "-prc on" that is followed
-by a construct that can recognize more than one n-sequence,
-you will get a warning from ANTLR. For example,
-
-a : <<isTypeName(LT(1)->getText())>>? (ID|INT)
- ;
-
-This is wrong because the predicate will be applied to INTs
-as well as ID's. You should use this syntax to make
-the predicate more specific:
-
-a : (ID)? => <<isTypeName(LT(1)->getText())>>? (ID|INT)
- ;
-
-which says "don't apply the predicate unless ID is the
-current lookahead context".
-
-You cannot currently have anything in the "(context)? =>"
-except sequences such as:
-
-( LPAREN ID | LPAREN SCOPE )? => <<pred>>?
-
-I haven't tested this THAT much, but it does work for the
-C++ grammar.
-
-======================================================================
-1.32b5
-
-Added getLine() to the ANTLRTokenBase and DLGBasedToken classes
-left line() for backward compatibility.
-----
-Removed SORCERER_TRANSFORM from the ast.h stuff.
--------
-Fixed bug in code gen of ANTLR such that nested syn preds work more
-efficiently now. The ANTLRTokenBuffer was getting very large
-with nested predicates.
-------
-Memory leak is now gone from ANTLRTokenBuf; all tokens are deleted.
-For backward compatibility reasons, you have to say parser->deleteTokens()
-or mytokenbuffer->deleteTokens() but later it will be the default mode.
-Say this after the parser is constructed. E.g.,
-
- ParserBlackBox<DLGLexer, MyParser, ANTLRToken> p(stdin);
- p.parser()->deleteTokens();
- p.parser()->start_symbol();
-
-
-==============================
-1.32b6
-
-Changed so that deleteTokens() will do a delete ((ANTLRTokenBase *))
-on the ptr. This gets the virtual destructor.
-
-Fixed some weird things in the C++ header files (a few return types).
-
-Made the AST routines correspond to the book and SORCERER stuff.
-
-New token stuff: See testcpp/14/test.g
-
-ANTLR accepts a #pragma gc_tokens which says
-[1] Generate label = copy(LT(1)) instead of label=LT(1) for
- all labeled token references.
-[2] User now has to define ANTLRTokenPtr (as a class or a typedef
- to just a pointer) as well as the ANTLRToken class itself.
- See the example.
-
-To delete tokens in token buffer, use deleteTokens() message on parser.
-
- All tokens that fall off the ANTLRTokenBuffer get deleted
- which is what currently happens when deleteTokens() message
- has been sent to token buffer.
-
-We always generate ANTLRTokenPtr instead of 'ANTLRToken *' now.
-Then if no pragma set, ANTLR generates a
-
- class ANTLRToken;
- typedef ANTLRToken *ANTLRTokenPtr;
-
-in each file.
-
-Made a warning for x:rule_ref <<$x>>; still no warning for $i's, however.
-class BB {
-
-a : x:b y:A <<$x
-$y>>
- ;
-
-b : B;
-
-}
-generates
-Antlr parser generator Version 1.32b6 1989-1995
-test.g, line 3: error: There are no token ptrs for rule references: '$x'
-
-===================
-1.32b7:
-
-[With respect to token object garbage collection (GC), 1.32b7
- backtracks from 1.32b6, but results in better and less intrusive GC.
- This is the last beta version before full 1.32.]
-
-BIGGEST CHANGES:
-
-o The "#pragma gc_tokens" is no longer used.
-
-o .C files are now .cpp files (hence, makefiles will have to
- be changed; or you can rerun genmk). This is a good move,
- but causes some backward incompatibility problems. You can
- avoid this by changing CPP_FILE_SUFFIX to ".C" in pccts/h/config.h.
-
-o The token object class hierarchy has been flattened to include
- only three classes: ANTLRAbstractToken, ANTLRCommonToken, and
- ANTLRCommonNoRefCountToken. The common token now does garbage
- collection via ref counting.
-
-o "Smart" pointers are now used for garbage collection. That is,
- ANTLRTokenPtr is used instead of "ANTLRToken *".
-
-o The antlr.1 man page has been cleaned up slightly.
-
-o The SUN C++ compiler now complains less about C++ support code.
-
-o Grammars which subclass ANTLRCommonToken must wrap all token
- pointer references in mytoken(token_ptr). This is the only
- serious backward incompatibility. See below.
-
-
-MINOR CHANGES:
-
---------------------------------------------------------
-1 deleteTokens()
-
-The deleteTokens() message to the parser or token buffer has been changed
-to one of:
-
- void noGarbageCollectTokens() { inputTokens->noGarbageCollectTokens(); }
- void garbageCollectTokens() { inputTokens->garbageCollectTokens(); }
-
-The token buffer deletes all non-referenced tokens by default now.
-
---------------------------------------------------------
-2 makeToken()
-
-The makeToken() message returns a new type. The function should look
-like:
-
- virtual ANTLRAbstractToken *makeToken(ANTLRTokenType tt,
- ANTLRChar *txt,
- int line)
- {
- ANTLRAbstractToken *t = new ANTLRCommonToken(tt,txt);
- t->setLine(line);
- return t;
- }
-
---------------------------------------------------------
-3 TokenType
-
-Changed TokenType-> ANTLRTokenType (often forces changes in AST defs due
-to #[] constructor called to AST(tokentype, string)).
-
---------------------------------------------------------
-4 AST()
-
-You must define AST(ANTLRTokenPtr t) now in your AST class definition.
-You might also have to include ATokPtr.h above the definition; e.g.,
-if AST is defined in a separate file, such as AST.h, it's a good idea
-to include ATOKPTR_H (ATokPtr.h). For example,
-
- #include ATOKPTR_H
- class AST : public ASTBase {
- protected:
- ANTLRTokenPtr token;
- public:
- AST(ANTLRTokenPtr t) { token = t; }
- void preorder_action() {
- char *s = token->getText();
- printf(" %s", s);
- }
- };
-
-Note the use of smart pointers rather than "ANTLRToken *".
-
---------------------------------------------------------
-5 SUN C++
-
-From robertb oakhill.sps.mot.com Bob Bailey. Changed ANTLR C++ output
-to avoid an error in Sun C++ 3.0.1. Made "public" return value
-structs created to hold multiple return values public.
-
---------------------------------------------------------
-6 genmk
-
-Fixed genmk so that target List.* is not included anymore. It's
-called SList.* anyway.
-
---------------------------------------------------------
-7 \r vs \n
-
-Scott Vorthmann <vorth cmu.edu> fixed antlr.g in ANTLR so that \r
-is allowed as the return character as well as \n.
-
---------------------------------------------------------
-8 Exceptions
-
-Bug in exceptions attached to labeled token/tokclass references. Didn't gen
-code for exceptions. This didn't work:
-
-a : "help" x:ID
- ;
- exception[x]
- catch MismatchedToken : <<printf("eh?\n");>>
-
-Now ANTLR generates (which is kinda big, but necessary):
-
- if ( !_match_wsig(ID) ) {
- if ( guessing ) goto fail;
- _signal=MismatchedToken;
- switch ( _signal ) {
- case MismatchedToken :
- printf("eh?\n");
- _signal = NoSignal;
- break;
- default :
- goto _handler;
- }
- }
-
-which implies that you can recover and continue parsing after a missing/bad
-token reference.
-
---------------------------------------------------------
-9 genmk
-
-genmk now correctly uses config file for CPP_FILE_SUFFIX stuff.
-
---------------------------------------------------------
-10 general cleanup / PURIFY
-
-Anthony Green <green vizbiz.com> suggested a bunch of good general
-clean up things for the code; he also suggested a few things to
-help out the "PURIFY" memory allocation checker.
-
---------------------------------------------------------
-11 $-variable references.
-
-Manuel ORNATO indicated that a $-variable outside of a rule caused
-ANTLR to crash. I fixed this.
-
-12 Tom Moog suggestion
-
-Fail action of semantic predicate needs "{}" envelope. FIXED.
-
-13 references to LT(1).
-
-I have enclosed all assignments such as:
-
- _t22 = (ANTLRTokenPtr)LT(1);
-
-in "if ( !guessing )" so that during backtracking the reference count
-for token objects is not increased.
-
-
-TOKEN OBJECT GARBAGE COLLECTION
-
-1 INTRODUCTION
-
-The class ANTLRCommonToken is now garbaged collected through a "smart"
-pointer called ANTLRTokenPtr using reference counting. Any token
-object not referenced by your grammar actions is destroyed by the
-ANTLRTokenBuffer when it must make room for more token objects.
-Referenced tokens are then destroyed in your parser when local
-ANTLRTokenPtr objects are deleted. For example,
-
-a : label:ID ;
-
-would be converted to something like:
-
-void yourclass::a(void)
-{
- zzRULE;
- ANTLRTokenPtr label=NULL; // used to be ANTLRToken *label;
- zzmatch(ID);
- label = (ANTLRTokenPtr)LT(1);
- consume();
- ...
-}
-
-When the "label" object is destroyed (it's just a pointer to your
-input token object LT(1)), it decrements the reference count on the
-object created for the ID. If the count goes to zero, the object
-pointed by label is deleted.
-
-To correctly manage the garbage collection, you should use
-ANTLRTokenPtr instead of "ANTLRToken *". Most ANTLR support code
-(visible to the user) has been modified to use the smart pointers.
-
-***************************************************************
-Remember that any local objects that you create are not deleted when a
-lonjmp() is executed. Unfortunately, the syntactic predicates (...)?
-use setjmp()/longjmp(). There are some situations when a few tokens
-will "leak".
-***************************************************************
-
-2 DETAILS
-
-o The default is to perform token object garbage collection.
- You may use parser->noGarbageCollectTokens() to turn off
- garbage collection.
-
-
-o The type ANTLRTokenPtr is always defined now (automatically).
- If you do not wish to use smart pointers, you will have to
- redefined ANTLRTokenPtr by subclassing, changing the header
- file or changing ANTLR's code generation (easy enough to
- do in gen.c).
-
-o If you don't use ParserBlackBox, the new initialization sequence is:
-
- ANTLRTokenPtr aToken = new ANTLRToken;
- scan.setToken(mytoken(aToken));
-
- where mytoken(aToken) gets an ANTLRToken * from the smart pointer.
-
-o Define C++ preprocessor symbol DBG_REFCOUNTTOKEN to see a bunch of
- debugging stuff for reference counting if you suspect something.
-
-
-3 WHY DO I HAVE TO TYPECAST ALL MY TOKEN POINTERS NOW??????
-
-If you subclass ANTLRCommonToken and then attempt to refer to one of
-your token members via a token pointer in your grammar actions, the
-C++ compiler will complain that your token object does not have that
-member. For example, if you used to do this
-
-<<
-class ANTLRToken : public ANTLRCommonToken {
- int muck;
- ...
-};
->>
-
-class Foo {
-a : t:ID << t->muck = ...; >> ;
-}
-
-Now, you must do change the t->muck reference to:
-
-a : t:ID << mytoken(t)->muck = ...; >> ;
-
-in order to downcast 't' to be an "ANTLRToken *" not the
-"ANTLRAbstractToken *" resulting from ANTLRTokenPtr::operator->().
-The macro is defined as:
-
-/*
- * Since you cannot redefine operator->() to return one of the user's
- * token object types, we must down cast. This is a drag. Here's
- * a macro that helps. template: "mytoken(a-smart-ptr)->myfield".
- */
-#define mytoken(tp) ((ANTLRToken *)(tp.operator->()))
-
-You have to use macro mytoken(grammar-label) now because smart
-pointers are not specific to a parser's token objects. In other
-words, the ANTLRTokenPtr class has a pointer to a generic
-ANTLRAbstractToken not your ANTLRToken; the ANTLR support code must
-use smart pointers too, but be able to work with any kind of
-ANTLRToken. Sorry about this, but it's C++'s fault not mine. Some
-nebulous future version of the C++ compilers should obviate the need
-to downcast smart pointers with runtime type checking (and by allowing
-different return type of overridden functions).
-
-A way to have backward compatible code is to shut off the token object
-garbage collection; i.e., use parser->noGarbageCollectTokens() and
-change the definition of ANTLRTokenPtr (that's why you get source code
-<wink>).
-
-
-PARSER EXCEPTION HANDLING
-
-I've noticed some weird stuff with the exception handling. I intend
-to give this top priority for the "book release" of ANTLR.
-
-==========
-1.32 Full Release
-
-o Changed Token class hierarchy to be (Thanks to Tom Moog):
-
- ANTLRAbstractToken
- ANTLRRefCountToken
- ANTLRCommonToken
- ANTLRNoRefCountCommonToken
-
-o Added virtual panic() to ANTLRAbstractToken. Made ANTLRParser::panic()
- virtual also.
-
-o Cleaned up the dup() stuff in AST hierarchy to use shallowCopy() to
- make node copies. John Farr at Medtronic suggested this. I.e.,
- if you want to use dup() with either ANTLR or SORCERER or -transform
- mode with SORCERER, you must defined shallowCopy() as:
-
- virtual PCCTS_AST *shallowCopy()
- {
- return new AST;
- p->setDown(NULL);
- p->setRight(NULL);
- return p;
- }
-
- or
-
- virtual PCCTS_AST *shallowCopy()
- {
- return new AST(*this);
- }
-
- if you have defined a copy constructor such as
-
- AST(const AST &t) // shallow copy constructor
- {
- token = t.token;
- iconst = t.iconst;
- setDown(NULL);
- setRight(NULL);
- }
-
-o Added a warning with -CC and -gk are used together. This is broken,
- hence a warning is appropriate.
-
-o Added warning when #-stuff is used w/o -gt option.
-
-o Updated MPW installation.
-
-o "Miller, Philip W." <MILLERPW f1groups.fsd.jhuapl.edu> suggested
- that genmk be use RENAME_OBJ_FLAG RENAME_EXE_FLAG instead of
- hardcoding "-o" in genmk.c.
-
-o made all exit() calls use EXIT_SUCCESS or EXIT_FAILURE.
-
-===========================================================================
-1.33
-
-EXIT_FAILURE and EXIT_SUCCESS were not always defined. I had to modify
-a bunch of files to use PCCTS_EXIT_XXX, which forces a new version. Sorry
-about that.
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_133.txt b/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_133.txt
deleted file mode 100644
index 2128c4ff25..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_133.txt
+++ /dev/null
@@ -1,2448 +0,0 @@
-=======================================================================
-List of Implemented Fixes and Changes for Maintenance Releases of PCCTS
-=======================================================================
-
- DISCLAIMER
-
- The software and these notes are provided "as is". They may include
- typographical or technical errors and their authors disclaims all
- liability of any kind or nature for damages due to error, fault,
- defect, or deficiency regardless of cause. All warranties of any
- kind, either express or implied, including, but not limited to, the
- implied warranties of merchantability and fitness for a particular
- purpose are disclaimed.
-
-
- -------------------------------------------------------
- Note: Items #153 to #1 are now in a separate file named
- CHANGES_FROM_133_BEFORE_MR13.txt
- -------------------------------------------------------
-
-#312. (Changed in MR33) Bug caused by change #299.
-
- In change #299 a warning message was suppressed when there was
- no LT(1) in a semantic predicate and max(k,ck) was 1. The
- changed caused the code which set a default predicate depth for
- the semantic predicate to be left as 0 rather than set to 1.
-
- This manifested as an error at line #1559 of mrhost.c
-
- Reported by Peter Dulimov.
-
-#311. (Changed in MR33) Added sorcer/lib to Makefile.
-
- Reported by Dale Martin.
-
-#310. (Changed in MR32) In C mode zzastPush was spelled zzastpush in one case.
-
- Reported by Jean-Claude Durand
-
-#309. (Changed in MR32) Renamed baseName because of VMS name conflict
-
- Renamed baseName to pcctsBaseName to avoid library name conflict with
- VMS library routine. Reported by Jean-François PIÉRONNE.
-
-#308. (Changed in MR32) Used "template" as name of formal in C routine
-
- In astlib.h routine ast_scan a formal was named "template". This caused
- problems when the C code was compiled with a C++ compiler. Reported by
- Sabyasachi Dey.
-
-#307. (Changed in MR31) Compiler dependent bug in function prototype generation
-
- The code which generated function prototypes contained a bug which
- was compiler/optimization dependent. Under some circumstance an
- extra character would be included in portions of a function prototype.
-
- Reported by David Cook.
-
-#306. (Changed in MR30) Validating predicate following a token
-
- A validating predicate which immediately followed a token match
- consumed the token after the predicate rather than before. Prior
- to this fix (in the following example) isValidTimeScaleValue() in
- the predicate would test the text for TIMESCALE rather than for
- NUMBER:
-
- time_scale :
- TIMESCALE
- <<isValidTimeScaleValue(LT(1)->getText())>>?
- ts:NUMBER
- ( us:MICROSECOND << tVal = ...>>
- | ns:NANOSECOND << tVal = ... >>
- )
-
- Reported by Adalbert Perbandt.
-
-#305. (Changed in MR30) Alternatives with guess blocks inside (...)* blocks.
-
- In MR14 change #175 fixed a bug in the prediction expressions for guess
- blocks which were of the form (alpha)? beta. Unfortunately, this
- resulted in a new bug as exemplified by the example below, which computed
- the first set for r as {B} rather than {B C}:
-
- r : ( (A)? B
- | C
- )*
-
- This example doesn't make any sense as A is not a prefix of B, but it
- illustrates the problem. This bug did not appear for:
-
- r : ( (A)?
- | C
- )*
-
- because it does not use the (alpha)? beta form.
-
- Item #175 fixed an asymmetry in ambiguity messages for the following
- constructs which appear to have identical ambiguities (between repeating
- the loop vs. exiting the loop). MR30 retains this fix, but the implementation
- is slightly different.
-
- r_star : ( (A B)? )* A ;
- r_plus : ( (A B)? )+ A ;
-
- Reported by Arpad Beszedes (beszedes inf.u-szeged.hu).
-
-#304. (Changed in MR30) Crash when mismatch between output value counts.
-
- For a rule such as:
-
- r1 : r2>[i,j];
- r2 >[int i, int j] : A;
-
- If there were extra actuals for the reference to rule r2 from rule r1
- there antlr would crash. This bug was introduced by change #276.
-
- Reported by Sinan Karasu.
-
-#303. (Changed in MR30) DLGLexerBase::replchar
-
- DLGLexerBase::replchar and the C mode routine zzreplchar did not work
- properly when the new character was 0.
-
- Reported with fix by Philippe Laporte
-
-#302. (Changed in MR28) Fix significant problems in initial release of MR27.
-
-#301. (Changed in MR27) Default tab stops set to 2 spaces.
-
- To have antlr generate true tabs rather than spaces, use "antlr -tab 0".
- To generate 4 spaces per tab stop use "antlr -tab 4"
-
-#300. (Changed in MR27)
-
- Consider the following methods of constructing an AST from ID:
-
- rule1!
- : id:ID << #0 = #[id]; >> ;
-
- rule2!
- : id:ID << #0 = #id; >> ;
-
- rule3
- : ID ;
-
- rule4
- : id:ID << #0 = #id; >> ;
-
- For rule_2, the AST corresponding to id would always be NULL. This
- is because the user explicitly suppressed AST construction using the
- "!" operator on the rule. In MR27 the use of an AST expression
- such as #id overrides the "!" operator and forces construction of
- the AST.
-
- This fix does not apply to C mode ASTs when the ASTs are referenced
- using numbers rather than symbols.
-
- For C mode, this requires that the (optional) function/macro zzmk_ast
- be defined. This functions copies information from an attribute into
- a previously allocated AST.
-
- Reported by Jan Langer (jan langernetz.de)
-
-#299. (Changed in MR27) Don't warn if k=1 and semantic predicate missing LT(i)
-
- If a semantic does not have a reference to LT(i) or (C mode LATEXT(i))
- then pccts doesn't know how many lookahead tokens to use for context.
- However, if max(k,ck) is 1 then there is really only one choice and
- the warning is unnecessary.
-
-#298. (Changed in MR27) Removed "register" for lastpos in dlgauto.c zzgettok
-
-#297. (Changed in MR27) Incorrect prototypes when used with classic C
-
- There were a number of errors in function headers when antlr was
- built with compilers that do not have __STDC__ or __cplusplus set.
-
- The functions which have variable length argument lists now use
- PCCTS_USE_STDARG rather than __USE_PROTOTYPES__ to determine
- whether to use stdargs or varargs.
-
-#296. (Changed in MR27) Complex return types in rules.
-
- The following return type was not properly handled when
- unpacking a struct with containing multiple return values:
-
- rule > [int i, IIR_Bool (IIR_Decl::*constraint)()] : ...
-
- Instead of using "constraint", the program got lost and used
- an empty string.
-
- Reported by P.A. Wilsey.
-
-#295. (Changed in MR27) Extra ";" following zzGUESS_DONE sometimes.
-
- Certain constructs with guess blocks in MR23 led to extra ";"
- preceding the "else" clause of an "if".
-
- Reported by P.A. Wilsey.
-
-#294. (Changed in MR27) Infinite loop in antlr for nested blocks
-
- An oversight in detecting an empty alternative sometimes led
- to an infinite loop in antlr when it encountered a rule with
- nested blocks and guess blocks.
-
- Reported by P.A. Wilsey.
-
-#293. (Changed in MR27) Sorcerer optimization of _t->type()
-
- Sorcerer generated code may contain many calls to _t->type() in a
- single statement. This change introduces a temporary variable
- to eliminate unnnecesary function calls.
-
- Change implemented by Tom Molteno (tim videoscript.com).
-
-#292. (Changed in MR27)
-
- WARNING: Item #267 changes the signature of methods in the AST class.
-
- **** Be sure to revise your AST functions of the same name ***
-
-#291. (Changed in MR24)
-
- Fix to serious code generation error in MR23 for (...)+ block.
-
-#290. (Changed in MR23)
-
- Item #247 describes a change in the way {...} blocks handled
- an error. Consider:
-
- r1 : {A} b ;
- b : B;
-
- with input "C".
-
- Prior to change #247, the error would resemble "expected B -
- found C". This is correct but incomplete, and therefore
- misleading. In #247 it was changed to "expected A, B - found
- C". This was fine, except for users of parser exception
- handling because the exception was generated in the epilogue
- for {...} block rather than in rule b. This made it difficult
- for users of parser exception handling because B was not
- expected in that context. Those not using parser exception
- handling didn't notice the difference.
-
- The current change restores the behavior prior to #247 when
- parser exceptions are present, but retains the revised behavior
- otherwise. This change should be visible only when exceptions
- are in use and only for {...} blocks and sub-blocks of the form
- (something|something | something | epsilon) where epsilon represents
- an empty production and it is the last alternative of a sub-block.
- In contrast, (something | epsilon | something) should generate the
- same code as before, even when exceptions are used.
-
- Reported by Philippe Laporte (philippe at transvirtual.com).
-
-#289. (Changed in MR23) Bug in matching complement of a #tokclass
-
- Prior to MR23 when a #tokclass was matched in both its complemented form
- and uncomplemented form, the bit set generated for its first use was used
- for both cases. However, the prediction expression was correctly computed
- in both cases. This meant that the second case would never be matched
- because, for the second appearance, the prediction expression and the
- set to be matched would be complements of each other.
-
- Consider:
-
- #token A "a"
- #token B "b"
- #token C "c"
- #tokclass AB {A B}
-
- r1 : AB /* alt 1x */
- | ~AB /* alt 1y */
- ;
-
- Prior to MR23, this resulted in alternative 1y being unreachable. Had it
- been written:
-
- r2 : ~AB /* alt 2x */
- : AB /* alt 2y */
-
- then alternative 2y would have become unreachable.
-
- This bug was only for the case of complemented #tokclass. For complemented
- #token the proper code was generated.
-
-#288. (Changed in MR23) #errclass not restricted to choice points
-
- The #errclass directive is supposed to allow a programmer to define
- print strings which should appear in syntax error messages as a replacement
- for some combinations of tokens. For instance:
-
- #errclass Operator {PLUS MINUS TIMES DIVIDE}
-
- If a syntax message includes all four of these tokens, and there is no
- "better" choice of error class, the word "Operator" will be used rather
- than a list of the four token names.
-
- Prior to MR23 the #errclass definitions were used only at choice points
- (which call the FAIL macro). In other cases where there was no choice
- (e.g. where a single token or token class were matched) the #errclass
- information was not used.
-
- With MR23 the #errclass declarations are used for syntax error messages
- when matching a #tokclass, a wildcard (i.e. "*"), or the complement of a
- #token or #tokclass (e.g. ~Operator).
-
- Please note that #errclass may now be defined using #tokclass names
- (see Item #284).
-
- Reported by Philip A. Wilsey.
-
-#287. (Changed in MR23) Print name for #tokclass
-
- Item #148 describes how to give a print name to a #token so that,for
- example, #token ID could have the expression "identifier" in syntax
- error messages. This has been extended to #tokclass:
-
- #token ID("identifier") "[a-zA-Z]+"
- #tokclass Primitive("primitive type")
- {INT, FLOAT, CHAR, FLOAT, DOUBLE, BOOL}
-
- This is really a cosmetic change, since #tokclass names do not appear
- in any error messages.
-
-#286. (Changed in MR23) Makefile change to use of cd
-
- In cases where a pccts subdirectory name matched a directory identified
- in a $CDPATH environment variable the build would fail. All makefile
- cd commands have been changed from "cd xyz" to "cd ./xyz" in order
- to avoid this problem.
-
-#285. (Changed in MR23) Check for null pointers in some dlg structures
-
- An invalid regular expression can cause dlg to build an invalid
- structure to represent the regular expression even while it issues
- error messages. Additional pointer checks were added.
-
- Reported by Robert Sherry.
-
-#284. (Changed in MR23) Allow #tokclass in #errclass definitions
-
- Previously, a #tokclass reference in the definition of an
- #errclass was not handled properly. Instead of being expanded
- into the set of tokens represented by the #tokclass it was
- treated somewhat like an #errclass. However, in a later phase
- when all #errclass were expanded into the corresponding tokens
- the #tokclass reference was not expanded (because it wasn't an
- #errclass). In effect the reference was ignored.
-
- This has been fixed.
-
- Problem reported by Mike Dimmick (mike dimmick.demon.co.uk).
-
-#283. (Changed in MR23) Option -tmake invoke's parser's tmake
-
- When the string #(...) appears in an action antlr replaces it with
- a call to ASTBase::tmake(...) to construct an AST. It is sometimes
- useful to change the tmake routine so that it has access to information
- in the parser - something which is not possible with a static method
- in an application where they may be multiple parsers active.
-
- The antlr option -tmake replaces the call to ASTBase::tmake with a call
- to a user supplied tmake routine.
-
-#282. (Changed in MR23) Initialization error for DBG_REFCOUNTTOKEN
-
- When the pre-processor symbol DBG_REFCOUNTTOKEN is defined
- incorrect code is generated to initialize ANTLRRefCountToken::ctor and
- dtor.
-
- Fix reported by Sven Kuehn (sven sevenkuehn.de).
-
-#281. (Changed in MR23) Addition of -noctor option for Sorcerer
-
- Added a -noctor option to suppress generation of the blank ctor
- for users who wish to define their own ctor.
-
- Contributed by Jan Langer (jan langernetz.de).
-
-#280. (Changed in MR23) Syntax error message for EOF token
-
- The EOF token now receives special treatment in syntax error messages
- because there is no text matched by the eof token. The token name
- of the eof token is used unless it is "@" - in which case the string
- "<eof>" is used.
-
- Problem reported by Erwin Achermann (erwin.achermann switzerland.org).
-
-#279. (Changed in MR23) Exception groups
-
- There was a bug in the way that exception groups were attached to
- alternatives which caused problems when there was a block contained
- in an alternative. For instance, in the following rule;
-
- statement : IF S { ELSE S }
- exception ....
- ;
-
- the exception would be attached to the {...} block instead of the
- entire alternative because it was attached, in error, to the last
- alternative instead of the last OPEN alternative.
-
- Reported by Ty Mordane (tymordane hotmail.com).
-
-#278. (Changed in MR23) makefile changes
-
- Contributed by Tomasz Babczynski (faster lab05-7.ict.pwr.wroc.pl).
-
- The -cfile option is not absolutely needed: when extension of
- source file is one of the well-known C/C++ extensions it is
- treated as C/C++ source
-
- The gnu make defines the CXX variable as the default C++ compiler
- name, so I added a line to copy this (if defined) to the CCC var.
-
- Added a -sor option: after it any -class command defines the class
- name for sorcerer, not for ANTLR. A file extended with .sor is
- treated as sorcerer input. Because sorcerer can be called multiple
- times, -sor option can be repeated. Any files and classes (one class
- per group) after each -sor makes one tree parser.
-
- Not implemented:
-
- 1. Generate dependences for user c/c++ files.
- 2. Support for -sor in c mode not.
-
- I have left the old genmk program in the directory as genmk_old.c.
-
-#277. (Changed in MR23) Change in macro for failed semantic predicates
-
- In the past, a semantic predicate that failed generated a call to
- the macro zzfailed_pred:
-
- #ifndef zzfailed_pred
- #define zzfailed_pred(_p) \
- if (guessing) { \
- zzGUESS_FAIL; \
- } else { \
- something(_p)
- }
- #endif
-
- If a user wished to use the failed action option for semantic predicates:
-
- rule : <<my_predicate>>? [my_fail_action] A
- | ...
-
-
- the code for my_fail_action would have to contain logic for handling
- the guess part of the zzfailed_pred macro. The user should not have
- to be aware of the guess logic in writing the fail action.
-
- The zzfailed_pred has been rewritten to have three arguments:
-
- arg 1: the stringized predicate of the semantic predicate
- arg 2: 0 => there is no user-defined fail action
- 1 => there is a user-defined fail action
- arg 3: the user-defined fail action (if defined)
- otherwise a no-operation
-
- The zzfailed_pred macro is now defined as:
-
- #ifndef zzfailed_pred
- #define zzfailed_pred(_p,_hasuseraction,_useraction) \
- if (guessing) { \
- zzGUESS_FAIL; \
- } else { \
- zzfailed_pred_action(_p,_hasuseraction,_useraction) \
- }
- #endif
-
-
- With zzfailed_pred_action defined as:
-
- #ifndef zzfailed_pred_action
- #define zzfailed_pred_action(_p,_hasuseraction,_useraction) \
- if (_hasUserAction) { _useraction } else { failedSemanticPredicate(_p); }
- #endif
-
- In C++ mode failedSemanticPredicate() is a virtual function.
- In C mode the default action is a fprintf statement.
-
- Suggested by Erwin Achermann (erwin.achermann switzerland.org).
-
-#276. (Changed in MR23) Addition of return value initialization syntax
-
- In an attempt to reduce the problems caused by the PURIFY macro I have
- added new syntax for initializing the return value of rules and the
- antlr option "-nopurify".
-
- A rule with a single return argument:
-
- r1 > [Foo f = expr] :
-
- now generates code that resembles:
-
- Foo r1(void) {
- Foo _retv = expr;
- ...
- }
-
- A rule with more than one return argument:
-
- r2 > [Foo f = expr1, Bar b = expr2 ] :
-
- generates code that resembles:
-
- struct _rv1 {
- Foo f;
- Bar b;
- }
-
- _rv1 r2(void) {
- struct _rv1 _retv;
- _retv.f = expr1;
- _retv.b = expr2;
- ...
- }
-
- C++ style comments appearing in the initialization list may cause problems.
-
-#275. (Changed in MR23) Addition of -nopurify option to antlr
-
- A long time ago the PURIFY macro was introduced to initialize
- return value arguments and get rid of annying messages from program
- that checked for unitialized variables.
-
- This has caused significant annoyance for C++ users that had
- classes with virtual functions or non-trivial contructors because
- it would zero the object, including the pointer to the virtual
- function table. This could be defeated by redefining
- the PURIFY macro to be empty, but it was a constant surprise to
- new C++ users of pccts.
-
- I would like to remove it, but I fear that some existing programs
- depend on it and would break. My temporary solution is to add
- an antlr option -nopurify which disables generation of the PURIFY
- macro call.
-
- The PURIFY macro should be avoided in favor of the new syntax
- for initializing return arguments described in item #275.
-
- To avoid name clash, the PURIFY macro has been renamed PCCTS_PURIFY.
-
-#274. (Changed in MR23) DLexer.cpp renamed to DLexer.h
- (Changed in MR23) ATokPtr.cpp renamed to ATokPtrImpl.h
-
- These two files had .cpp extensions but acted like .h files because
- there were included in other files. This caused problems for many IDE.
- I have renamed them. The ATokPtrImpl.h was necessary because there was
- already an ATokPtr.h.
-
-#273. (Changed in MR23) Default win32 library changed to multi-threaded DLL
-
- The model used for building the Win32 debug and release libraries has changed
- to multi-threaded DLL.
-
- To make this change in your MSVC 6 project:
-
- Project -> Settings
- Select the C++ tab in the right pane of the dialog box
- Select "Category: Code Generation"
- Under "Use run-time library" select one of the following:
-
- Multi-threaded DLL
- Debug Multi-threaded DLL
-
- Suggested by Bill Menees (bill.menees gogallagher.com)
-
-#272. (Changed in MR23) Failed semantic predicate reported via virtual function
-
- In the past, a failed semantic predicated reported the problem via a
- macro which used fprintf(). The macro now expands into a call on
- the virtual function ANTLRParser::failedSemanticPredicate().
-
-#271. (Changed in MR23) Warning for LT(i), LATEXT(i) in token match actions
-
- An bug (or at least an oddity) is that a reference to LT(1), LA(1),
- or LATEXT(1) in an action which immediately follows a token match
- in a rule refers to the token matched, not the token which is in
- the lookahead buffer. Consider:
-
- r : abc <<action alpha>> D <<action beta>> E;
-
- In this case LT(1) in action alpha will refer to the next token in
- the lookahead buffer ("D"), but LT(1) in action beta will refer to
- the token matched by D - the preceding token.
-
- A warning has been added for users about this when an action
- following a token match contains a reference to LT(1), LA(1), or LATEXT(1).
-
- This behavior should be changed, but it appears in too many programs
- now. Another problem, perhaps more significant, is that the obvious
- fix (moving the consume() call to before the action) could change the
- order in which input is requested and output appears in existing programs.
-
- This problem was reported, along with a fix by Benjamin Mandel
- (beny sd.co.il). However, I felt that changing the behavior was too
- dangerous for existing code.
-
-#270. (Changed in MR23) Removed static objects from PCCTSAST.cpp
-
- There were some statically allocated objects in PCCTSAST.cpp
- These were changed to non-static.
-
-#269. (Changed in MR23) dlg output for initializing static array
-
- The output from dlg contains a construct similar to the
- following:
-
- struct XXX {
- static const int size;
- static int array1[5];
- };
-
- const int XXX::size = 4;
- int XXX::array1[size+1];
-
-
- The problem is that although the expression "size+1" used in
- the definition of array1 is equal to 5 (the expression used to
- declare array), it is not considered equivalent by some compilers.
-
- Reported with fix by Volker H. Simonis (simonis informatik.uni-tuebingen.de)
-
-#268. (Changed in MR23) syn() routine output when k > 1
-
- The syn() routine is supposed to print out the text of the
- token causing the syntax error. It appears that it always
- used the text from the first lookahead token rather than the
- appropriate one. The appropriate one is computed by comparing
- the token codes of lookahead token i (for i = 1 to k) with
- the FIRST(i) set.
-
- This has been corrected in ANTLRParser::syn().
-
- Reported by Bill Menees (bill.menees gogallagher.com)
-
-#267. (Changed in MR23) AST traversal functions client data argument
-
- The AST traversal functions now take an extra (optional) parameter
- which can point to client data:
-
- preorder_action(void* pData = NULL)
- preorder_before_action(void* pData = NULL)
- preorder_after_action(void* pData = NULL)
-
- **** Warning: this changes the AST signature. ***
- **** Be sure to revise your AST functions of the same name ***
-
- Bill Menees (bill.menees gogallagher.com)
-
-#266. (Changed in MR23) virtual function printMessage()
-
- Bill Menees (bill.menees gogallagher.com) has completed the
- tedious taks of replacing all calls to fprintf() with calls
- to the virtual function printMessage(). For classes which
- have a pointer to the parser it forwards the printMessage()
- call to the parser's printMessage() routine.
-
- This should make it significanly easier to redirect pccts
- error and warning messages.
-
-#265. (Changed in MR23) Remove "labase++" in C++ mode
-
- In C++ mode labase++ is called when a token is matched.
- It appears that labase is not used in C++ mode at all, so
- this code has been commented out.
-
-#264. (Changed in MR23) Complete rewrite of ParserBlackBox.h
-
- The parser black box (PBlackBox.h) was completely rewritten
- by Chris Uzdavinis (chris atdesk.com) to improve its robustness.
-
-#263. (Changed in MR23) -preamble and -preamble_first rescinded
-
- Changes for item #253 have been rescinded.
-
-#262. (Changed in MR23) Crash with -alpha option during traceback
-
- Under some circumstances a -alpha traceback was started at the
- "wrong" time. As a result, internal data structures were not
- initialized.
-
- Reported by Arpad Beszedes (beszedes inf.u-szeged.hu).
-
-#261. (Changed in MR23) Defer token fetch for C++ mode
-
- Item #216 has been revised to indicate that use of the defer fetch
- option (ZZDEFER_FETCH) requires dlg option -i.
-
-#260. (MR22) Raise default lex buffer size from 8,000 to 32,000 bytes.
-
- ZZLEXBUFSIZE is the size (in bytes) of the buffer used by dlg
- generated lexers. The default value has been raised to 32,000 and
- the value used by antlr, dlg, and sorcerer has also been raised to
- 32,000.
-
-#259. (MR22) Default function arguments in C++ mode.
-
- If a rule is declared:
-
- rr [int i = 0] : ....
-
- then the declaration generated by pccts resembles:
-
- void rr(int i = 0);
-
- however, the definition must omit the default argument:
-
- void rr(int i) {...}
-
- In the past the default value was not omitted. In MR22
- the generated code resembles:
-
- void rr(int i /* = 0 */ ) {...}
-
- Implemented by Volker H. Simonis (simonis informatik.uni-tuebingen.de)
-
-
- Note: In MR23 this was changed so that nested C style comments
- ("/* ... */") would not cause problems.
-
-#258. (MR22) Using a base class for your parser
-
- In item #102 (MR10) the class statement was extended to allow one
- to specify a base class other than ANTLRParser for the generated
- parser. It turned out that this was less than useful because
- the constructor still specified ANTLRParser as the base class.
-
- The class statement now uses the first identifier appearing after
- the ":" as the name of the base class. For example:
-
- class MyParser : public FooParser {
-
- Generates in MyParser.h:
-
- class MyParser : public FooParser {
-
- Generates in MyParser.cpp something that resembles:
-
- MyParser::MyParser(ANTLRTokenBuffer *input) :
- FooParser(input,1,0,0,4)
- {
- token_tbl = _token_tbl;
- traceOptionValueDefault=1; // MR10 turn trace ON
- }
-
- The base class constructor must have a signature similar to
- that of ANTLRParser.
-
-#257. (MR21a) Removed dlg statement that -i has no effect in C++ mode.
-
- This was incorrect.
-
-#256. (MR21a) Malformed syntax graph causes crash after error message.
-
- In the past, certain kinds of errors in the very first grammar
- element could cause the construction of a malformed graph
- representing the grammar. This would eventually result in a
- fatal internal error. The code has been changed to be more
- resistant to this particular error.
-
-#255. (MR21a) ParserBlackBox(FILE* f)
-
- This constructor set openByBlackBox to the wrong value.
-
- Reported by Kees Bakker (kees_bakker tasking.nl).
-
-#254. (MR21a) Reporting syntax error at end-of-file
-
- When there was a syntax error at the end-of-file the syntax
- error routine would substitute "<eof>" for the programmer's
- end-of-file symbol. This substitution is now done only when
- the programmer does not define his own end-of-file symbol
- or the symbol begins with the character "@".
-
- Reported by Kees Bakker (kees_bakker tasking.nl).
-
-#253. (MR21) Generation of block preamble (-preamble and -preamble_first)
-
- *** This change was rescinded by item #263 ***
-
- The antlr option -preamble causes antlr to insert the code
- BLOCK_PREAMBLE at the start of each rule and block. It does
- not insert code before rules references, token references, or
- actions. By properly defining the macro BLOCK_PREAMBLE the
- user can generate code which is specific to the start of blocks.
-
- The antlr option -preamble_first is similar, but inserts the
- code BLOCK_PREAMBLE_FIRST(PreambleFirst_123) where the symbol
- PreambleFirst_123 is equivalent to the first set defined by
- the #FirstSetSymbol described in Item #248.
-
- I have not investigated how these options interact with guess
- mode (syntactic predicates).
-
-#252. (MR21) Check for null pointer in trace routine
-
- When some trace options are used when the parser is generated
- without the trace enabled, the current rule name may be a
- NULL pointer. A guard was added to check for this in
- restoreState.
-
- Reported by Douglas E. Forester (dougf projtech.com).
-
-#251. (MR21) Changes to #define zzTRACE_RULES
-
- The macro zzTRACE_RULES was being use to pass information to
- AParser.h. If this preprocessor symbol was not properly
- set the first time AParser.h was #included, the declaration
- of zzTRACEdata would be omitted (it is used by the -gd option).
- Subsequent #includes of AParser.h would be skipped because of
- the #ifdef guard, so the declaration of zzTracePrevRuleName would
- never be made. The result was that proper compilation was very
- order dependent.
-
- The declaration of zzTRACEdata was made unconditional and the
- problem of removing unused declarations will be left to optimizers.
-
- Diagnosed by Douglas E. Forester (dougf projtech.com).
-
-#250. (MR21) Option for EXPERIMENTAL change to error sets for blocks
-
- The antlr option -mrblkerr turns on an experimental feature
- which is supposed to provide more accurate syntax error messages
- for k=1, ck=1 grammars. When used with k>1 or ck>1 grammars the
- behavior should be no worse than the current behavior.
-
- There is no problem with the matching of elements or the computation
- of prediction expressions in pccts. The task is only one of listing
- the most appropriate tokens in the error message. The error sets used
- in pccts error messages are approximations of the exact error set when
- optional elements in (...)* or (...)+ are involved. While entirely
- correct, the error messages are sometimes not 100% accurate.
-
- There is also a minor philosophical issue. For example, suppose the
- grammar expects the token to be an optional A followed by Z, and it
- is X. X, of course, is neither A nor Z, so an error message is appropriate.
- Is it appropriate to say "Expected Z" ? It is correct, it is accurate,
- but it is not complete.
-
- When k>1 or ck>1 the problem of providing the exactly correct
- list of tokens for the syntax error messages ends up becoming
- equivalent to evaluating the prediction expression for the
- alternatives twice. However, for k=1 ck=1 grammars the prediction
- expression can be computed easily and evaluated cheaply, so I
- decided to try implementing it to satisfy a particular application.
- This application uses the error set in an interactive command language
- to provide prompts which list the alternatives available at that
- point in the parser. The user can then enter additional tokens to
- complete the command line. To do this required more accurate error
- sets then previously provided by pccts.
-
- In some cases the default pccts behavior may lead to more robust error
- recovery or clearer error messages then having the exact set of tokens.
- This is because (a) features like -ge allow the use of symbolic names for
- certain sets of tokens, so having extra tokens may simply obscure things
- and (b) the error set is use to resynchronize the parser, so a good
- choice is sometimes more important than having the exact set.
-
- Consider the following example:
-
- Note: All examples code has been abbreviated
- to the absolute minimum in order to make the
- examples concise.
-
- star1 : (A)* Z;
-
- The generated code resembles:
-
- old new (with -mrblkerr)
- --//----------- --------------------
- for (;;) { for (;;) {
- match(A); match(A);
- } }
- match(Z); if (! A and ! Z) then
- FAIL(...{A,Z}...);
- }
- match(Z);
-
-
- With input X
- old message: Found X, expected Z
- new message: Found X, expected A, Z
-
- For the example:
-
- star2 : (A|B)* Z;
-
- old new (with -mrblkerr)
- ------------- --------------------
- for (;;) { for (;;) {
- if (!A and !B) break; if (!A and !B) break;
- if (...) { if (...) {
- <same ...> <same ...>
- } }
- else { else {
- FAIL(...{A,B,Z}...) FAIL(...{A,B}...);
- } }
- } }
- match(B); if (! A and ! B and !Z) then
- FAIL(...{A,B,Z}...);
- }
- match(B);
-
- With input X
- old message: Found X, expected Z
- new message: Found X, expected A, B, Z
- With input A X
- old message: Found X, expected Z
- new message: Found X, expected A, B, Z
-
- This includes the choice of looping back to the
- star block.
-
- The code for plus blocks:
-
- plus1 : (A)+ Z;
-
- The generated code resembles:
-
- old new (with -mrblkerr)
- ------------- --------------------
- do { do {
- match(A); match(A);
- } while (A) } while (A)
- match(Z); if (! A and ! Z) then
- FAIL(...{A,Z}...);
- }
- match(Z);
-
- With input A X
- old message: Found X, expected Z
- new message: Found X, expected A, Z
-
- This includes the choice of looping back to the
- plus block.
-
- For the example:
-
- plus2 : (A|B)+ Z;
-
- old new (with -mrblkerr)
- ------------- --------------------
- do { do {
- if (A) { <same>
- match(A); <same>
- } else if (B) { <same>
- match(B); <same>
- } else { <same>
- if (cnt > 1) break; <same>
- FAIL(...{A,B,Z}...) FAIL(...{A,B}...);
- } }
- cnt++; <same>
- } }
-
- match(Z); if (! A and ! B and !Z) then
- FAIL(...{A,B,Z}...);
- }
- match(B);
-
- With input X
- old message: Found X, expected A, B, Z
- new message: Found X, expected A, B
- With input A X
- old message: Found X, expected Z
- new message: Found X, expected A, B, Z
-
- This includes the choice of looping back to the
- star block.
-
-#249. (MR21) Changes for DEC/VMS systems
-
- Jean-François Piéronne (jfp altavista.net) has updated some
- VMS related command files and fixed some minor problems related
- to building pccts under the DEC/VMS operating system. For DEC/VMS
- users the most important differences are:
-
- a. Revised makefile.vms
- b. Revised genMMS for genrating VMS style makefiles.
-
-#248. (MR21) Generate symbol for first set of an alternative
-
- pccts can generate a symbol which represents the tokens which may
- appear at the start of a block:
-
- rr : #FirstSetSymbol(rr_FirstSet) ( Foo | Bar ) ;
-
- This will generate the symbol rr_FirstSet of type SetWordType with
- elements Foo and Bar set. The bits can be tested using code similar
- to the following:
-
- if (set_el(Foo, &rr_FirstSet)) { ...
-
- This can be combined with the C array zztokens[] or the C++ routine
- tokenName() to get the print name of the token in the first set.
-
- The size of the set is given by the newly added enum SET_SIZE, a
- protected member of the generated parser's class. The number of
- elements in the generated set will not be exactly equal to the
- value of SET_SIZE because of synthetic tokens created by #tokclass,
- #errclass, the -ge option, and meta-tokens such as epsilon, and
- end-of-file.
-
- The #FirstSetSymbol must appear immediately before a block
- such as (...)+, (...)*, and {...}, and (...). It may not appear
- immediately before a token, a rule reference, or action. However
- a token or rule reference can be enclosed in a (...) in order to
- make the use of #pragma FirstSetSymbol legal.
-
- rr_bad : #FirstSetSymbol(rr_bad_FirstSet) Foo; // Illegal
-
- rr_ok : #FirstSetSymbol(rr_ok_FirstSet) (Foo); // Legal
-
- Do not confuse FirstSetSymbol sets with the sets used for testing
- lookahead. The sets used for FirstSetSymbol have one element per bit,
- so the number of bytes is approximately the largest token number
- divided by 8. The sets used for testing lookahead store 8 lookahead
- sets per byte, so the length of the array is approximately the largest
- token number.
-
- If there is demand, a similar routine for follow sets can be added.
-
-#247. (MR21) Misleading error message on syntax error for optional elements.
-
- ===================================================
- The behavior has been revised when parser exception
- handling is used. See Item #290
- ===================================================
-
- Prior to MR21, tokens which were optional did not appear in syntax
- error messages if the block which immediately followed detected a
- syntax error.
-
- Consider the following grammar which accepts Number, Word, and Other:
-
- rr : {Number} Word;
-
- For this rule the code resembles:
-
- if (LA(1) == Number) {
- match(Number);
- consume();
- }
- match(Word);
-
- Prior to MR21, the error message for input "$ a" would be:
-
- line 1: syntax error at "$" missing Word
-
- With MR21 the message will be:
-
- line 1: syntax error at "$" expecting Word, Number.
-
- The generate code resembles:
-
- if ( (LA(1)==Number) ) {
- zzmatch(Number);
- consume();
- }
- else {
- if ( (LA(1)==Word) ) {
- /* nothing */
- }
- else {
- FAIL(... message for both Number and Word ...);
- }
- }
- match(Word);
-
- The code generated for optional blocks in MR21 is slightly longer
- than the previous versions, but it should give better error messages.
-
- The code generated for:
-
- { a | b | c }
-
- should now be *identical* to:
-
- ( a | b | c | )
-
- which was not the case prior to MR21.
-
- Reported by Sue Marvin (sue siara.com).
-
-#246. (Changed in MR21) Use of $(MAKE) for calls to make
-
- Calls to make from the makefiles were replaced with $(MAKE)
- because of problems when using gmake.
-
- Reported with fix by Sunil K.Vallamkonda (sunil siara.com).
-
-#245. (Changed in MR21) Changes to genmk
-
- The following command line options have been added to genmk:
-
- -cfiles ...
-
- To add a user's C or C++ files into makefile automatically.
- The list of files must be enclosed in apostrophes. This
- option may be specified multiple times.
-
- -compiler ...
-
- The name of the compiler to use for $(CCC) or $(CC). The
- default in C++ mode is "CC". The default in C mode is "cc".
-
- -pccts_path ...
-
- The value for $(PCCTS), the pccts directory. The default
- is /usr/local/pccts.
-
- Contributed by Tomasz Babczynski (t.babczynski ict.pwr.wroc.pl).
-
-#244. (Changed in MR21) Rename variable "not" in antlr.g
-
- When antlr.g is compiled with a C++ compiler, a variable named
- "not" causes problems. Reported by Sinan Karasu
- (sinan.karasu boeing.com).
-
-#243 (Changed in MR21) Replace recursion with iteration in zzfree_ast
-
- Another refinement to zzfree_ast in ast.c to limit recursion.
-
- NAKAJIMA Mutsuki (muc isr.co.jp).
-
-
-#242. (Changed in MR21) LineInfoFormatStr
-
- Added an #ifndef/#endif around LineInfoFormatStr in pcctscfg.h.
-
-#241. (Changed in MR21) Changed macro PURIFY to a no-op
-
- ***********************
- *** NOT IMPLEMENTED ***
- ***********************
-
- The PURIFY macro was changed to a no-op because it was causing
- problems when passing C++ objects.
-
- The old definition:
-
- #define PURIFY(r,s) memset((char *) &(r),'\\0',(s));
-
- The new definition:
-
- #define PURIFY(r,s) /* nothing */
-#endif
-
-#240. (Changed in MR21) sorcerer/h/sorcerer.h _MATCH and _MATCHRANGE
-
- Added test for NULL token pointer.
-
- Suggested by Peter Keller (keller ebi.ac.uk)
-
-#239. (Changed in MR21) C++ mode AParser::traceGuessFail
-
- If tracing is turned on when the code has been generated
- without trace code, a failed guess generates a trace report
- even though there are no other trace reports. This
- make the behavior consistent with other parts of the
- trace system.
-
- Reported by David Wigg (wiggjd sbu.ac.uk).
-
-#238. (Changed in MR21) Namespace version #include files
-
- Changed reference from CStdio to cstdio (and other
- #include file names) in the namespace version of pccts.
- Should have known better.
-
-#237. (Changed in MR21) ParserBlackBox(FILE*)
-
- In the past, ParserBlackBox would close the FILE in the dtor
- even though it was not opened by ParserBlackBox. The problem
- is that there were two constructors, one which accepted a file
- name and did an fopen, the other which accepted a FILE and did
- not do an fopen. There is now an extra member variable which
- remembers whether ParserBlackBox did the open or not.
-
- Suggested by Mike Percy (mpercy scires.com).
-
-#236. (Changed in MR21) tmake now reports down pointer problem
-
- When ASTBase::tmake attempts to update the down pointer of
- an AST it checks to see if the down pointer is NULL. If it
- is not NULL it does not do the update and returns NULL.
- An attempt to update the down pointer is almost always a
- result of a user error. This can lead to difficult to find
- problems during tree construction.
-
- With this change, the routine calls a virtual function
- reportOverwriteOfDownPointer() which calls panic to
- report the problem. Users who want the old behavior can
- redefined the virtual function in their AST class.
-
- Suggested by Sinan Karasu (sinan.karasu boeing.com)
-
-#235. (Changed in MR21) Made ANTLRParser::resynch() virtual
-
- Suggested by Jerry Evans (jerry swsl.co.uk).
-
-#234. (Changed in MR21) Implicit int for function return value
-
- ATokenBuffer:bufferSize() did not specify a type for the
- return value.
-
- Reported by Hai Vo-Ba (hai fc.hp.com).
-
-#233. (Changed in MR20) Converted to MSVC 6.0
-
- Due to external circumstances I have had to convert to MSVC 6.0
- The MSVC 5.0 project files (.dsw and .dsp) have been retained as
- xxx50.dsp and xxx50.dsw. The MSVC 6.0 files are named xxx60.dsp
- and xxx60.dsw (where xxx is the related to the directory/project).
-
-#232. (Changed in MR20) Make setwd bit vectors protected in parser.h
-
- The access for the setwd array in the parser header was not
- specified. As a result, it would depend on the code which
- preceded it. In MR20 it will always have access "protected".
-
- Reported by Piotr Eljasiak (eljasiak zt.gdansk.tpsa.pl).
-
-#231. (Changed in MR20) Error in token buffer debug code.
-
- When token buffer debugging is selected via the pre-processor
- symbol DEBUG_TOKENBUFFER there is an erroneous check in
- AParser.cpp:
-
- #ifdef DEBUG_TOKENBUFFER
- if (i >= inputTokens->bufferSize() ||
- inputTokens->minTokens() < LLk ) /* MR20 Was "<=" */
- ...
- #endif
-
- Reported by David Wigg (wiggjd sbu.ac.uk).
-
-#230. (Changed in MR20) Fixed problem with #define for -gd option
-
- There was an error in setting zzTRACE_RULES for the -gd (trace) option.
-
- Reported by Gary Funck (gary intrepid.com).
-
-#229. (Changed in MR20) Additional "const" for literals
-
- "const" was added to the token name literal table.
- "const" was added to some panic() and similar routine
-
-#228. (Changed in MR20) dlg crashes on "()"
-
- The following token defintion will cause DLG to crash.
-
- #token "()"
-
- When there is a syntax error in a regular expression
- many of the dlg routines return a structure which has
- null pointers. When this is accessed by callers it
- generates the crash.
-
- I have attempted to fix the more common cases.
-
- Reported by Mengue Olivier (dolmen bigfoot.com).
-
-#227. (Changed in MR20) Array overwrite
-
- Steveh Hand (sassth unx.sas.com) reported a problem which
- was traced to a temporary array which was not properly
- resized for deeply nested blocks. This has been fixed.
-
-#226. (Changed in MR20) -pedantic conformance
-
- G. Hobbelt (i_a mbh.org) and THM made many, many minor
- changes to create prototypes for all the functions and
- bring antlr, dlg, and sorcerer into conformance with
- the gcc -pedantic option.
-
- This may require uses to add pccts/h/pcctscfg.h to some
- files or makefiles in order to have __USE_PROTOS defined.
-
-#225 (Changed in MR20) AST stack adjustment in C mode
-
- The fix in #214 for AST stack adjustment in C mode missed
- some cases.
-
- Reported with fix by Ger Hobbelt (i_a mbh.org).
-
-#224 (Changed in MR20) LL(1) and LL(2) with #pragma approx
-
- This may take a record for the oldest, most trival, lexical
- error in pccts. The regular expressions for LL(1) and LL(2)
- lacked an escape for the left and right parenthesis.
-
- Reported by Ger Hobbelt (i_a mbh.org).
-
-#223 (Changed in MR20) Addition of IBM_VISUAL_AGE directory
-
- Build files for antlr, dlg, and sorcerer under IBM Visual Age
- have been contributed by Anton Sergeev (ags mlc.ru). They have
- been placed in the pccts/IBM_VISUAL_AGE directory.
-
-#222 (Changed in MR20) Replace __STDC__ with __USE_PROTOS
-
- Most occurrences of __STDC__ replaced with __USE_PROTOS due to
- complaints from several users.
-
-#221 (Changed in MR20) Added #include for DLexerBase.h to PBlackBox.
-
- Added #include for DLexerBase.h to PBlackBox.
-
-#220 (Changed in MR19) strcat arguments reversed in #pred parse
-
- The arguments to strcat are reversed when creating a print
- name for a hash table entry for use with #pred feature.
-
- Problem diagnosed and fix reported by Scott Harrington
- (seh4 ix.netcom.com).
-
-#219. (Changed in MR19) C Mode routine zzfree_ast
-
- Changes to reduce use of recursion for AST trees with only right
- links or only left links in the C mode routine zzfree_ast.
-
- Implemented by SAKAI Kiyotaka (ksakai isr.co.jp).
-
-#218. (Changed in MR19) Changes to support unsigned char in C mode
-
- Changes to antlr.h and err.h to fix omissions in use of zzchar_t
-
- Implemented by SAKAI Kiyotaka (ksakai isr.co.jp).
-
-#217. (Changed in MR19) Error message when dlg -i and -CC options selected
-
- *** This change was rescinded by item #257 ***
-
- The parsers generated by pccts in C++ mode are not able to support the
- interactive lexer option (except, perhaps, when using the deferred fetch
- parser option.(Item #216).
-
- DLG now warns when both -i and -CC are selected.
-
- This warning was suggested by David Venditti (07751870267-0001 t-online.de).
-
-#216. (Changed in MR19) Defer token fetch for C++ mode
-
- Implemented by Volker H. Simonis (simonis informatik.uni-tuebingen.de)
-
- Normally, pccts keeps the lookahead token buffer completely filled.
- This requires max(k,ck) tokens of lookahead. For some applications
- this can cause deadlock problems. For example, there may be cases
- when the parser can't tell when the input has been completely consumed
- until the parse is complete, but the parse can't be completed because
- the input routines are waiting for additional tokens to fill the
- lookahead buffer.
-
- When the ANTLRParser class is built with the pre-processor option
- ZZDEFER_FETCH defined, the fetch of new tokens by consume() is deferred
- until LA(i) or LT(i) is called.
-
- To test whether this option has been built into the ANTLRParser class
- use "isDeferFetchEnabled()".
-
- Using the -gd trace option with the default tracein() and traceout()
- routines will defeat the effort to defer the fetch because the
- trace routines print out information about the lookahead token at
- the start of the rule.
-
- Because the tracein and traceout routines are virtual it is
- easy to redefine them in your parser:
-
- class MyParser {
- <<
- virtual void tracein(ANTLRChar * ruleName)
- { fprintf(stderr,"Entering: %s\n", ruleName); }
- virtual void traceout(ANTLRChar * ruleName)
- { fprintf(stderr,"Leaving: %s\n", ruleName); }
- >>
-
- The originals for those routines are pccts/h/AParser.cpp
-
- This requires use of the dlg option -i (interactive lexer).
-
- This is implemented only for C++ mode.
-
- This is experimental. The interaction with guess mode (syntactic
- predicates)is not known.
-
-#215. (Changed in MR19) Addition of reset() to DLGLexerBase
-
- There was no obvious way to reset the lexer for reuse. The
- reset() method now does this.
-
- Suggested by David Venditti (07751870267-0001 t-online.de).
-
-#214. (Changed in MR19) C mode: Adjust AST stack pointer at exit
-
- In C mode the AST stack pointer needs to be reset if there will
- be multiple calls to the ANTLRx macros.
-
- Reported with fix by Paul D. Smith (psmith baynetworks.com).
-
-#213. (Changed in MR18) Fatal error with -mrhoistk (k>1 hoisting)
-
- When rearranging code I forgot to un-comment a critical line of
- code that handles hoisting of predicates with k>1 lookahead. This
- is now fixed.
-
- Reported by Reinier van den Born (reinier vnet.ibm.com).
-
-#212. (Changed in MR17) Mac related changes by Kenji Tanaka
-
- Kenji Tanaka (kentar osa.att.ne.jp) has made a number of changes for
- Macintosh users.
-
- a. The following Macintosh MPW files aid in installing pccts on Mac:
-
- pccts/MPW_Read_Me
-
- pccts/install68K.mpw
- pccts/installPPC.mpw
-
- pccts/antlr/antlr.r
- pccts/antlr/antlr68K.make
- pccts/antlr/antlrPPC.make
-
- pccts/dlg/dlg.r
- pccts/dlg/dlg68K.make
- pccts/dlg/dlgPPC.make
-
- pccts/sorcerer/sor.r
- pccts/sorcerer/sor68K.make
- pccts/sorcerer/sorPPC.make
-
- They completely replace the previous Mac installation files.
-
- b. The most significant is a change in the MAC_FILE_CREATOR symbol
- in pcctscfg.h:
-
- old: #define MAC_FILE_CREATOR 'MMCC' /* Metrowerks C/C++ Text files */
- new: #define MAC_FILE_CREATOR 'CWIE' /* Metrowerks C/C++ Text files */
-
- c. Added calls to special_fopen_actions() where necessary.
-
-#211. (Changed in MR16a) C++ style comment in dlg
-
- This has been fixed.
-
-#210. (Changed in MR16a) Sor accepts \r\n, \r, or \n for end-of-line
-
- A user requested that Sorcerer be changed to accept other forms
- of end-of-line.
-
-#209. (Changed in MR16) Name of files changed.
-
- Old: CHANGES_FROM_1.33
- New: CHANGES_FROM_133.txt
-
- Old: KNOWN_PROBLEMS
- New: KNOWN_PROBLEMS.txt
-
-#208. (Changed in MR16) Change in use of pccts #include files
-
- There were problems with MS DevStudio when mixing Sorcerer and
- PCCTS in the same source file. The problem is caused by the
- redefinition of setjmp in the MS header file setjmp.h. In
- setjmp.h the pre-processor symbol setjmp was redefined to be
- _setjmp. A later effort to execute #include <setjmp.h> resulted
- in an effort to #include <_setjmp.h>. I'm not sure whether this
- is a bug or a feature. In any case, I decided to fix it by
- avoiding the use of pre-processor symbols in #include statements
- altogether. This has the added benefit of making pre-compiled
- headers work again.
-
- I've replaced statements:
-
- old: #include PCCTS_SETJMP_H
- new: #include "pccts_setjmp.h"
-
- Where pccts_setjmp.h contains:
-
- #ifndef __PCCTS_SETJMP_H__
- #define __PCCTS_SETJMP_H__
-
- #ifdef PCCTS_USE_NAMESPACE_STD
- #include <Csetjmp>
- #else
- #include <setjmp.h>
- #endif
-
- #endif
-
- A similar change has been made for other standard header files
- required by pccts and sorcerer: stdlib.h, stdarg.h, stdio.h, etc.
-
- Reported by Jeff Vincent (JVincent novell.com) and Dale Davis
- (DalDavis spectrace.com).
-
-#207. (Changed in MR16) dlg reports an invalid range for: [\0x00-\0xff]
-
- -----------------------------------------------------------------
- Note from MR23: This fix does not work. I am investigating why.
- -----------------------------------------------------------------
-
- dlg will report that this is an invalid range.
-
- Diagnosed by Piotr Eljasiak (eljasiak no-spam.zt.gdansk.tpsa.pl):
-
- I think this problem is not specific to unsigned chars
- because dlg reports no error for the range [\0x00-\0xfe].
-
- I've found that information on range is kept in field
- letter (unsigned char) of Attrib struct. Unfortunately
- the letter value internally is for some reasons increased
- by 1, so \0xff is represented here as 0.
-
- That's why dlg complains about the range [\0x00-\0xff] in
- dlg_p.g:
-
- if ($$.letter > $2.letter) {
- error("invalid range ", zzline);
- }
-
- The fix is:
-
- if ($$.letter > $2.letter && 255 != $$2.letter) {
- error("invalid range ", zzline);
- }
-
-#206. (Changed in MR16) Free zzFAILtext in ANTLRParser destructor
-
- The ANTLRParser destructor now frees zzFAILtext.
-
- Problem and fix reported by Manfred Kogler (km cast.uni-linz.ac.at).
-
-#205. (Changed in MR16) DLGStringReset argument now const
-
- Changed: void DLGStringReset(DLGChar *s) {...}
- To: void DLGStringReset(const DLGChar *s) {...}
-
- Suggested by Dale Davis (daldavis spectrace.com)
-
-#204. (Changed in MR15a) Change __WATCOM__ to __WATCOMC__ in pcctscfg.h
-
- Reported by Oleg Dashevskii (olegdash my-dejanews.com).
-
-#203. (Changed in MR15) Addition of sorcerer to distribution kit
-
- I have finally caved in to popular demand. The pccts 1.33mr15
- kit will include sorcerer. The separate sorcerer kit will be
- discontinued.
-
-#202. (Changed) in MR15) Organization of MS Dev Studio Projects in Kit
-
- Previously there was one workspace that contained projects for
- all three parts of pccts: antlr, dlg, and sorcerer. Now each
- part (and directory) has its own workspace/project and there
- is an additional workspace/project to build a library from the
- .cpp files in the pccts/h directory.
-
- The library build will create pccts_debug.lib or pccts_release.lib
- according to the configuration selected.
-
- If you don't want to build pccts 1.33MR15 you can download a
- ready-to-run kit for win32 from http://www.polhode.com/win32.zip.
- The ready-to-run for win32 includes executables, a pre-built static
- library for the .cpp files in the pccts/h directory, and a sample
- application
-
- You will need to define the environment variable PCCTS to point to
- the root of the pccts directory hierarchy.
-
-#201. (Changed in MR15) Several fixes by K.J. Cummings (cummings peritus.com)
-
- Generation of SETJMP rather than SETJMP_H in gen.c.
-
- (Sor B19) Declaration of ref_vars_inits for ref_var_inits in
- pccts/sorcerer/sorcerer.h.
-
-#200. (Changed in MR15) Remove operator=() in AToken.h
-
- User reported that WatCom couldn't handle use of
- explicit operator =(). Replace with equivalent
- using cast operator.
-
-#199. (Changed in MR15) Don't allow use of empty #tokclass
-
- Change antlr.g to disallow empty #tokclass sets.
-
- Reported by Manfred Kogler (km cast.uni-linz.ac.at).
-
-#198. Revised ANSI C grammar due to efforts by Manuel Kessler
-
- Manuel Kessler (mlkessler cip.physik.uni-wuerzburg.de)
-
- Allow trailing ... in function parameter lists.
- Add bit fields.
- Allow old-style function declarations.
- Support cv-qualified pointers.
- Better checking of combinations of type specifiers.
- Release of memory for local symbols on scope exit.
- Allow input file name on command line as well as by redirection.
-
- and other miscellaneous tweaks.
-
- This is not part of the pccts distribution kit. It must be
- downloaded separately from:
-
- http://www.polhode.com/ansi_mr15.zip
-
-#197. (Changed in MR14) Resetting the lookahead buffer of the parser
-
- Explanation and fix by Sinan Karasu (sinan.karasu boeing.com)
-
- Consider the code used to prime the lookahead buffer LA(i)
- of the parser when init() is called:
-
- void
- ANTLRParser::
- prime_lookahead()
- {
- int i;
- for(i=1;i<=LLk; i++) consume();
- dirty=0;
- //lap = 0; // MR14 - Sinan Karasu (sinan.karusu boeing.com)
- //labase = 0; // MR14
- labase=lap; // MR14
- }
-
- When the parser is instantiated, lap=0,labase=0 is set.
-
- The "for" loop runs LLk times. In consume(), lap = lap +1 (mod LLk) is
- computed. Therefore, lap(before the loop) == lap (after the loop).
-
- Now the only problem comes in when one does an init() of the parser
- after an Eof has been seen. At that time, lap could be non zero.
- Assume it was lap==1. Now we do a prime_lookahead(). If LLk is 2,
- then
-
- consume()
- {
- NLA = inputTokens->getToken()->getType();
- dirty--;
- lap = (lap+1)&(LLk-1);
- }
-
- or expanding NLA,
-
- token_type[lap&(LLk-1)]) = inputTokens->getToken()->getType();
- dirty--;
- lap = (lap+1)&(LLk-1);
-
- so now we prime locations 1 and 2. In prime_lookahead it used to set
- lap=0 and labase=0. Now, the next token will be read from location 0,
- NOT 1 as it should have been.
-
- This was never caught before, because if a parser is just instantiated,
- then lap and labase are 0, the offending assignment lines are
- basically no-ops, since the for loop wraps around back to 0.
-
-#196. (Changed in MR14) Problems with "(alpha)? beta" guess
-
- Consider the following syntactic predicate in a grammar
- with 2 tokens of lookahead (k=2 or ck=2):
-
- rule : ( alpha )? beta ;
- alpha : S t ;
- t : T U
- | T
- ;
- beta : S t Z ;
-
- When antlr computes the prediction expression with one token
- of lookahead for alts 1 and 2 of rule t it finds an ambiguity.
-
- Because the grammar has a lookahead of 2 it tries to compute
- two tokens of lookahead for alts 1 and 2 of t. Alt 1 clearly
- has a lookahead of (T U). Alt 2 is one token long so antlr
- tries to compute the follow set of alt 2, which means finding
- the things which can follow rule t in the context of (alpha)?.
- This cannot be computed, because alpha is only part of a rule,
- and antlr can't tell what part of beta is matched by alpha and
- what part remains to be matched. Thus it impossible for antlr
- to properly determine the follow set of rule t.
-
- Prior to 1.33MR14, the follow of (alpha)? was computed as
- FIRST(beta) as a result of the internal representation of
- guess blocks.
-
- With MR14 the follow set will be the empty set for that context.
-
- Normally, one expects a rule appearing in a guess block to also
- appear elsewhere. When the follow context for this other use
- is "ored" with the empty set, the context from the other use
- results, and a reasonable follow context results. However if
- there is *no* other use of the rule, or it is used in a different
- manner then the follow context will be inaccurate - it was
- inaccurate even before MR14, but it will be inaccurate in a
- different way.
-
- For the example given earlier, a reasonable way to rewrite the
- grammar:
-
- rule : ( alpha )? beta
- alpha : S t ;
- t : T U
- | T
- ;
- beta : alpha Z ;
-
- If there are no other uses of the rule appearing in the guess
- block it will generate a test for EOF - a workaround for
- representing a null set in the lookahead tests.
-
- If you encounter such a problem you can use the -alpha option
- to get additional information:
-
- line 2: error: not possible to compute follow set for alpha
- in an "(alpha)? beta" block.
-
- With the antlr -alpha command line option the following information
- is inserted into the generated file:
-
- #if 0
-
- Trace of references leading to attempt to compute the follow set of
- alpha in an "(alpha)? beta" block. It is not possible for antlr to
- compute this follow set because it is not known what part of beta has
- already been matched by alpha and what part remains to be matched.
-
- Rules which make use of the incorrect follow set will also be incorrect
-
- 1 #token T alpha/2 line 7 brief.g
- 2 end alpha alpha/3 line 8 brief.g
- 2 end (...)? block at start/1 line 2 brief.g
-
- #endif
-
- At the moment, with the -alpha option selected the program marks
- any rules which appear in the trace back chain (above) as rules with
- possible problems computing follow set.
-
- Reported by Greg Knapen (gregory.knapen bell.ca).
-
-#195. (Changed in MR14) #line directive not at column 1
-
- Under certain circunstances a predicate test could generate
- a #line directive which was not at column 1.
-
- Reported with fix by David Kågedal (davidk lysator.liu.se)
- (http://www.lysator.liu.se/~davidk/).
-
-#194. (Changed in MR14) (C Mode only) Demand lookahead with #tokclass
-
- In C mode with the demand lookahead option there is a bug in the
- code which handles matches for #tokclass (zzsetmatch and
- zzsetmatch_wsig).
-
- The bug causes the lookahead pointer to get out of synchronization
- with the current token pointer.
-
- The problem was reported with a fix by Ger Hobbelt (hobbelt axa.nl).
-
-#193. (Changed in MR14) Use of PCCTS_USE_NAMESPACE_STD
-
- The pcctscfg.h now contains the following definitions:
-
- #ifdef PCCTS_USE_NAMESPACE_STD
- #define PCCTS_STDIO_H <Cstdio>
- #define PCCTS_STDLIB_H <Cstdlib>
- #define PCCTS_STDARG_H <Cstdarg>
- #define PCCTS_SETJMP_H <Csetjmp>
- #define PCCTS_STRING_H <Cstring>
- #define PCCTS_ASSERT_H <Cassert>
- #define PCCTS_ISTREAM_H <istream>
- #define PCCTS_IOSTREAM_H <iostream>
- #define PCCTS_NAMESPACE_STD namespace std {}; using namespace std;
- #else
- #define PCCTS_STDIO_H <stdio.h>
- #define PCCTS_STDLIB_H <stdlib.h>
- #define PCCTS_STDARG_H <stdarg.h>
- #define PCCTS_SETJMP_H <setjmp.h>
- #define PCCTS_STRING_H <string.h>
- #define PCCTS_ASSERT_H <assert.h>
- #define PCCTS_ISTREAM_H <istream.h>
- #define PCCTS_IOSTREAM_H <iostream.h>
- #define PCCTS_NAMESPACE_STD
- #endif
-
- The runtime support in pccts/h uses these pre-processor symbols
- consistently.
-
- Also, antlr and dlg have been changed to generate code which uses
- these pre-processor symbols rather than having the names of the
- #include files hard-coded in the generated code.
-
- This required the addition of "#include pcctscfg.h" to a number of
- files in pccts/h.
-
- It appears that this sometimes causes problems for MSVC 5 in
- combination with the "automatic" option for pre-compiled headers.
- In such cases disable the "automatic" pre-compiled headers option.
-
- Suggested by Hubert Holin (Hubert.Holin Bigfoot.com).
-
-#192. (Changed in MR14) Change setText() to accept "const ANTLRChar *"
-
- Changed ANTLRToken::setText(ANTLRChar *) to setText(const ANTLRChar *).
- This allows literal strings to be used to initialize tokens. Since
- the usual token implementation (ANTLRCommonToken) makes a copy of the
- input string, this was an unnecessary limitation.
-
- Suggested by Bob McWhirter (bob netwrench.com).
-
-#191. (Changed in MR14) HP/UX aCC compiler compatibility problem
-
- Needed to explicitly declare zzINF_DEF_TOKEN_BUFFER_SIZE and
- zzINF_BUFFER_TOKEN_CHUNK_SIZE as ints in pccts/h/AParser.cpp.
-
- Reported by David Cook (dcook bmc.com).
-
-#190. (Changed in MR14) IBM OS/2 CSet compiler compatibility problem
-
- Name conflict with "_cs" in pccts/h/ATokenBuffer.cpp
-
- Reported by David Cook (dcook bmc.com).
-
-#189. (Changed in MR14) -gxt switch in C mode
-
- The -gxt switch in C mode didn't work because of incorrect
- initialization.
-
- Reported by Sinan Karasu (sinan boeing.com).
-
-#188. (Changed in MR14) Added pccts/h/DLG_stream_input.h
-
- This is a DLG stream class based on C++ istreams.
-
- Contributed by Hubert Holin (Hubert.Holin Bigfoot.com).
-
-#187. (Changed in MR14) Rename config.h to pcctscfg.h
-
- The PCCTS configuration file has been renamed from config.h to
- pcctscfg.h. The problem with the original name is that it led
- to name collisions when pccts parsers were combined with other
- software.
-
- All of the runtime support routines in pccts/h/* have been
- changed to use the new name. Existing software can continue
- to use pccts/h/config.h. The contents of pccts/h/config.h is
- now just "#include "pcctscfg.h".
-
- I don't have a record of the user who suggested this.
-
-#186. (Changed in MR14) Pre-processor symbol DllExportPCCTS class modifier
-
- Classes in the C++ runtime support routines are now declared:
-
- class DllExportPCCTS className ....
-
- By default, the pre-processor symbol is defined as the empty
- string. This if for use by MSVC++ users to create DLL classes.
-
- Suggested by Manfred Kogler (km cast.uni-linz.ac.at).
-
-#185. (Changed in MR14) Option to not use PCCTS_AST base class for ASTBase
-
- Normally, the ASTBase class is derived from PCCTS_AST which contains
- functions useful to Sorcerer. If these are not necessary then the
- user can define the pre-processor symbol "PCCTS_NOT_USING_SOR" which
- will cause the ASTBase class to replace references to PCCTS_AST with
- references to ASTBase where necessary.
-
- The class ASTDoublyLinkedBase will contain a pure virtual function
- shallowCopy() that was formerly defined in class PCCTS_AST.
-
- Suggested by Bob McWhirter (bob netwrench.com).
-
-#184. (Changed in MR14) Grammars with no tokens generate invalid tokens.h
-
- Reported by Hubert Holin (Hubert.Holin bigfoot.com).
-
-#183. (Changed in MR14) -f to specify file with names of grammar files
-
- In DEC/VMS it is difficult to specify very long command lines.
- The -f option allows one to place the names of the grammar files
- in a data file in order to bypass limitations of the DEC/VMS
- command language interpreter.
-
- Addition supplied by Bernard Giroud (b_giroud decus.ch).
-
-#182. (Changed in MR14) Output directory option for DEC/VMS
-
- Fix some problems with the -o option under DEC/VMS.
-
- Fix supplied by Bernard Giroud (b_giroud decus.ch).
-
-#181. (Changed in MR14) Allow chars > 127 in DLGStringInput::nextChar()
-
- Changed DLGStringInput to cast the character using (unsigned char)
- so that languages with character codes greater than 127 work
- without changes.
-
- Suggested by Manfred Kogler (km cast.uni-linz.ac.at).
-
-#180. (Added in MR14) ANTLRParser::getEofToken()
-
- Added "ANTLRToken ANTLRParser::getEofToken() const" to match the
- setEofToken routine.
-
- Requested by Manfred Kogler (km cast.uni-linz.ac.at).
-
-#179. (Fixed in MR14) Memory leak for BufFileInput subclass of DLGInputStream
-
- The BufFileInput class described in Item #142 neglected to release
- the allocated buffer when an instance was destroyed.
-
- Reported by Manfred Kogler (km cast.uni-linz.ac.at).
-
-#178. (Fixed in MR14) Bug in "(alpha)? beta" guess blocks first sets
-
- In 1.33 vanilla, and all maintenance releases prior to MR14
- there is a bug in the handling of guess blocks which use the
- "long" form:
-
- (alpha)? beta
-
- inside a (...)*, (...)+, or {...} block.
-
- This problem does *not* apply to the case where beta is omitted
- or when the syntactic predicate is on the leading edge of an
- alternative.
-
- The problem is that both alpha and beta are stored in the
- syntax diagram, and that some analysis routines would fail
- to skip the alpha portion when it was not on the leading edge.
- Consider the following grammar with -ck 2:
-
- r : ( (A)? B )* C D
-
- | A B /* forces -ck 2 computation for old antlr */
- /* reports ambig for alts 1 & 2 */
-
- | B C /* forces -ck 2 computation for new antlr */
- /* reports ambig for alts 1 & 3 */
- ;
-
- The prediction expression for the first alternative should be
- LA(1)={B C} LA(2)={B C D}, but previous versions of antlr
- would compute the prediction expression as LA(1)={A C} LA(2)={B D}
-
- Reported by Arpad Beszedes (beszedes inf.u-szeged.hu) who provided
- a very clear example of the problem and identified the probable cause.
-
-#177. (Changed in MR14) #tokdefs and #token with regular expression
-
- In MR13 the change described by Item #162 caused an existing
- feature of antlr to fail. Prior to the change it was possible
- to give regular expression definitions and actions to tokens
- which were defined via the #tokdefs directive.
-
- This now works again.
-
- Reported by Manfred Kogler (km cast.uni-linz.ac.at).
-
-#176. (Changed in MR14) Support for #line in antlr source code
-
- Note: this was implemented by Arpad Beszedes (beszedes inf.u-szeged.hu).
-
- In 1.33MR14 it is possible for a pre-processor to generate #line
- directives in the antlr source and have those line numbers and file
- names used in antlr error messages and in the #line directives
- generated by antlr.
-
- The #line directive may appear in the following forms:
-
- #line ll "sss" xx xx ...
-
- where ll represents a line number, "sss" represents the name of a file
- enclosed in quotation marks, and xxx are arbitrary integers.
-
- The following form (without "line") is not supported at the moment:
-
- # ll "sss" xx xx ...
-
- The result:
-
- zzline
-
- is replaced with ll from the # or #line directive
-
- FileStr[CurFile]
-
- is updated with the contents of the string (if any)
- following the line number
-
- Note
- ----
- The file-name string following the line number can be a complete
- name with a directory-path. Antlr generates the output files from
- the input file name (by replacing the extension from the file-name
- with .c or .cpp).
-
- If the input file (or the file-name from the line-info) contains
- a path:
-
- "../grammar.g"
-
- the generated source code will be placed in "../grammar.cpp" (i.e.
- in the parent directory). This is inconvenient in some cases
- (even the -o switch can not be used) so the path information is
- removed from the #line directive. Thus, if the line-info was
-
- #line 2 "../grammar.g"
-
- then the current file-name will become "grammar.g"
-
- In this way, the generated source code according to the grammar file
- will always be in the current directory, except when the -o switch
- is used.
-
-#175. (Changed in MR14) Bug when guess block appears at start of (...)*
-
- In 1.33 vanilla and all maintenance releases prior to 1.33MR14
- there is a bug when a guess block appears at the start of a (...)+.
- Consider the following k=1 (ck=1) grammar:
-
- rule :
- ( (STAR)? ZIP )* ID ;
-
- Prior to 1.33MR14, the generated code resembled:
-
- ...
- zzGUESS_BLOCK
- while ( 1 ) {
- if ( ! LA(1)==STAR) break;
- zzGUESS
- if ( !zzrv ) {
- zzmatch(STAR);
- zzCONSUME;
- zzGUESS_DONE
- zzmatch(ZIP);
- zzCONSUME;
- ...
-
- Note that the routine uses STAR for the prediction expression
- rather than ZIP. With 1.33MR14 the generated code resembles:
-
- ...
- while ( 1 ) {
- if ( ! LA(1)==ZIP) break;
- ...
-
- This problem existed only with (...)* blocks and was caused
- by the slightly more complicated graph which represents (...)*
- blocks. This caused the analysis routine to compute the first
- set for the alpha part of the "(alpha)? beta" rather than the
- beta part.
-
- Both (...)+ and {...} blocks handled the guess block correctly.
-
- Reported by Arpad Beszedes (beszedes inf.u-szeged.hu) who provided
- a very clear example of the problem and identified the probable cause.
-
-#174. (Changed in MR14) Bug when action precedes syntactic predicate
-
- In 1.33 vanilla, and all maintenance releases prior to MR14,
- there was a bug when a syntactic predicate was immediately
- preceded by an action. Consider the following -ck 2 grammar:
-
- rule :
- <<int i;>>
- (alpha)? beta C
- | A B
- ;
-
- alpha : A ;
- beta : A B;
-
- Prior to MR14, the code generated for the first alternative
- resembled:
-
- ...
- zzGUESS
- if ( !zzrv && LA(1)==A && LA(2)==A) {
- alpha();
- zzGUESS_DONE
- beta();
- zzmatch(C);
- zzCONSUME;
- } else {
- ...
-
- The prediction expression (i.e. LA(1)==A && LA(2)==A) is clearly
- wrong because LA(2) should be matched to B (first[2] of beta is {B}).
-
- With 1.33MR14 the prediction expression is:
-
- ...
- if ( !zzrv && LA(1)==A && LA(2)==B) {
- alpha();
- zzGUESS_DONE
- beta();
- zzmatch(C);
- zzCONSUME;
- } else {
- ...
-
- This will only affect users in which alpha is shorter than
- than max(k,ck) and there is an action immediately preceding
- the syntactic predicate.
-
- This problem was reported by reported by Arpad Beszedes
- (beszedes inf.u-szeged.hu) who provided a very clear example
- of the problem and identified the presence of the init-action
- as the likely culprit.
-
-#173. (Changed in MR13a) -glms for Microsoft style filenames with -gl
-
- With the -gl option antlr generates #line directives using the
- exact name of the input files specified on the command line.
- An oddity of the Microsoft C and C++ compilers is that they
- don't accept file names in #line directives containing "\"
- even though these are names from the native file system.
-
- With -glms option, the "\" in file names appearing in #line
- directives is replaced with a "/" in order to conform to
- Microsoft compiler requirements.
-
- Reported by Erwin Achermann (erwin.achermann switzerland.org).
-
-#172. (Changed in MR13) \r\n in antlr source counted as one line
-
- Some MS software uses \r\n to indicate a new line. Antlr
- now recognizes this in counting lines.
-
- Reported by Edward L. Hepler (elh ece.vill.edu).
-
-#171. (Changed in MR13) #tokclass L..U now allowed
-
- The following is now allowed:
-
- #tokclass ABC { A..B C }
-
- Reported by Dave Watola (dwatola amtsun.jpl.nasa.gov)
-
-#170. (Changed in MR13) Suppression for predicates with lookahead depth >1
-
- In MR12 the capability for suppression of predicates with lookahead
- depth=1 was introduced. With MR13 this had been extended to
- predicates with lookahead depth > 1 and released for use by users
- on an experimental basis.
-
- Consider the following grammar with -ck 2 and the predicate in rule
- "a" with depth 2:
-
- r1 : (ab)* "@"
- ;
-
- ab : a
- | b
- ;
-
- a : (A B)? => <<p(LATEXT(2))>>? A B C
- ;
-
- b : A B C
- ;
-
- Normally, the predicate would be hoisted into rule r1 in order to
- determine whether to call rule "ab". However it should *not* be
- hoisted because, even if p is false, there is a valid alternative
- in rule b. With "-mrhoistk on" the predicate will be suppressed.
-
- If "-info p" command line option is present the following information
- will appear in the generated code:
-
- while ( (LA(1)==A)
- #if 0
-
- Part (or all) of predicate with depth > 1 suppressed by alternative
- without predicate
-
- pred << p(LATEXT(2))>>?
- depth=k=2 ("=>" guard) rule a line 8 t1.g
- tree context:
- (root = A
- B
- )
-
- The token sequence which is suppressed: ( A B )
- The sequence of references which generate that sequence of tokens:
-
- 1 to ab r1/1 line 1 t1.g
- 2 ab ab/1 line 4 t1.g
- 3 to b ab/2 line 5 t1.g
- 4 b b/1 line 11 t1.g
- 5 #token A b/1 line 11 t1.g
- 6 #token B b/1 line 11 t1.g
-
- #endif
-
- A slightly more complicated example:
-
- r1 : (ab)* "@"
- ;
-
- ab : a
- | b
- ;
-
- a : (A B)? => <<p(LATEXT(2))>>? (A B | D E)
- ;
-
- b : <<q(LATEXT(2))>>? D E
- ;
-
-
- In this case, the sequence (D E) in rule "a" which lies behind
- the guard is used to suppress the predicate with context (D E)
- in rule b.
-
- while ( (LA(1)==A || LA(1)==D)
- #if 0
-
- Part (or all) of predicate with depth > 1 suppressed by alternative
- without predicate
-
- pred << q(LATEXT(2))>>?
- depth=k=2 rule b line 11 t2.g
- tree context:
- (root = D
- E
- )
-
- The token sequence which is suppressed: ( D E )
- The sequence of references which generate that sequence of tokens:
-
- 1 to ab r1/1 line 1 t2.g
- 2 ab ab/1 line 4 t2.g
- 3 to a ab/1 line 4 t2.g
- 4 a a/1 line 8 t2.g
- 5 #token D a/1 line 8 t2.g
- 6 #token E a/1 line 8 t2.g
-
- #endif
- &&
- #if 0
-
- pred << p(LATEXT(2))>>?
- depth=k=2 ("=>" guard) rule a line 8 t2.g
- tree context:
- (root = A
- B
- )
-
- #endif
-
- (! ( LA(1)==A && LA(2)==B ) || p(LATEXT(2)) ) {
- ab();
- ...
-
-#169. (Changed in MR13) Predicate test optimization for depth=1 predicates
-
- When the MR12 generated a test of a predicate which had depth 1
- it would use the depth >1 routines, resulting in correct but
- inefficient behavior. In MR13, a bit test is used.
-
-#168. (Changed in MR13) Token expressions in context guards
-
- The token expressions appearing in context guards such as:
-
- (A B)? => <<test(LT(1))>>? someRule
-
- are computed during an early phase of antlr processing. As
- a result, prior to MR13, complex expressions such as:
-
- ~B
- L..U
- ~L..U
- TokClassName
- ~TokClassName
-
- were not computed properly. This resulted in incorrect
- context being computed for such expressions.
-
- In MR13 these context guards are verified for proper semantics
- in the initial phase and then re-evaluated after complex token
- expressions have been computed in order to produce the correct
- behavior.
-
- Reported by Arpad Beszedes (beszedes inf.u-szeged.hu).
-
-#167. (Changed in MR13) ~L..U
-
- Prior to MR13, the complement of a token range was
- not properly computed.
-
-#166. (Changed in MR13) token expression L..U
-
- The token U was represented as an unsigned char, restricting
- the use of L..U to cases where U was assigned a token number
- less than 256. This is corrected in MR13.
-
-#165. (Changed in MR13) option -newAST
-
- To create ASTs from an ANTLRTokenPtr antlr usually calls
- "new AST(ANTLRTokenPtr)". This option generates a call
- to "newAST(ANTLRTokenPtr)" instead. This allows a user
- to define a parser member function to create an AST object.
-
- Similar changes for ASTBase::tmake and ASTBase::link were not
- thought necessary since they do not create AST objects, only
- use existing ones.
-
-#164. (Changed in MR13) Unused variable _astp
-
- For many compilations, we have lived with warnings about
- the unused variable _astp. It turns out that this varible
- can *never* be used because the code which references it was
- commented out.
-
- This investigation was sparked by a note from Erwin Achermann
- (erwin.achermann switzerland.org).
-
-#163. (Changed in MR13) Incorrect makefiles for testcpp examples
-
- All the examples in pccts/testcpp/* had incorrect definitions
- in the makefiles for the symbol "CCC". Instead of CCC=CC they
- had CC=$(CCC).
-
- There was an additional problem in testcpp/1/test.g due to the
- change in ANTLRToken::getText() to a const member function
- (Item #137).
-
- Reported by Maurice Mass (maas cuci.nl).
-
-#162. (Changed in MR13) Combining #token with #tokdefs
-
- When it became possible to change the print-name of a
- #token (Item #148) it became useful to give a #token
- statement whose only purpose was to giving a print name
- to the #token. Prior to this change this could not be
- combined with the #tokdefs feature.
-
-#161. (Changed in MR13) Switch -gxt inhibits generation of tokens.h
-
-#160. (Changed in MR13) Omissions in list of names for remap.h
-
- When a user selects the -gp option antlr creates a list
- of macros in remap.h to rename some of the standard
- antlr routines from zzXXX to userprefixXXX.
-
- There were number of omissions from the remap.h name
- list related to the new trace facility. This was reported,
- along with a fix, by Bernie Solomon (bernard ug.eds.com).
-
-#159. (Changed in MR13) Violations of classic C rules
-
- There were a number of violations of classic C style in
- the distribution kit. This was reported, along with fixes,
- by Bernie Solomon (bernard ug.eds.com).
-
-#158. (Changed in MR13) #header causes problem for pre-processors
-
- A user who runs the C pre-processor on antlr source suggested
- that another syntax be allowed. With MR13 such directives
- such as #header, #pragma, etc. may be written as "\#header",
- "\#pragma", etc. For escaping pre-processor directives inside
- a #header use something like the following:
-
- \#header
- <<
- \#include <stdio.h>
- >>
-
-#157. (Fixed in MR13) empty error sets for rules with infinite recursion
-
- When the first set for a rule cannot be computed due to infinite
- left recursion and it is the only alternative for a block then
- the error set for the block would be empty. This would result
- in a fatal error.
-
- Reported by Darin Creason (creason genedax.com)
-
-#156. (Changed in MR13) DLGLexerBase::getToken() now public
-
-#155. (Changed in MR13) Context behind predicates can suppress
-
- With -mrhoist enabled the context behind a guarded predicate can
- be used to suppress other predicates. Consider the following grammar:
-
- r0 : (r1)+;
-
- r1 : rp
- | rq
- ;
- rp : <<p LATEXT(1)>>? B ;
- rq : (A)? => <<q LATEXT(1)>>? (A|B);
-
- In earlier versions both predicates "p" and "q" would be hoisted into
- rule r0. With MR12c predicate p is suppressed because the context which
- follows predicate q includes "B" which can "cover" predicate "p". In
- other words, in trying to decide in r0 whether to call r1, it doesn't
- really matter whether p is false or true because, either way, there is
- a valid choice within r1.
-
-#154. (Changed in MR13) Making hoist suppression explicit using <<nohoist>>
-
- A common error, even among experienced pccts users, is to code
- an init-action to inhibit hoisting rather than a leading action.
- An init-action does not inhibit hoisting.
-
- This was coded:
-
- rule1 : <<;>> rule2
-
- This is what was meant:
-
- rule1 : <<;>> <<;>> rule2
-
- With MR13, the user can code:
-
- rule1 : <<;>> <<nohoist>> rule2
-
- The following will give an error message:
-
- rule1 : <<nohoist>> rule2
-
- If the <<nohoist>> appears as an init-action rather than a leading
- action an error message is issued. The meaning of an init-action
- containing "nohoist" is unclear: does it apply to just one
- alternative or to all alternatives ?
-
-
-
-
-
-
-
-
- -------------------------------------------------------
- Note: Items #153 to #1 are now in a separate file named
- CHANGES_FROM_133_BEFORE_MR13.txt
- -------------------------------------------------------
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_133_BEFORE_MR13.txt b/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_133_BEFORE_MR13.txt
deleted file mode 100644
index bba5ecdd64..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_FROM_133_BEFORE_MR13.txt
+++ /dev/null
@@ -1,3666 +0,0 @@
-
- ------------------------------------------------------------
- This is the second part of a two part file.
- This is a list of changes to pccts 1.33 prior to MR13
- For more recent information see CHANGES_FROM_133.txt
- ------------------------------------------------------------
-
- DISCLAIMER
-
- The software and these notes are provided "as is". They may include
- typographical or technical errors and their authors disclaims all
- liability of any kind or nature for damages due to error, fault,
- defect, or deficiency regardless of cause. All warranties of any
- kind, either express or implied, including, but not limited to, the
- implied warranties of merchantability and fitness for a particular
- purpose are disclaimed.
-
-
-#153. (Changed in MR12b) Bug in computation of -mrhoist suppression set
-
- Consider the following grammar with k=1 and "-mrhoist on":
-
- r1 : (A)? => ((p>>? x /* l1 */
- | r2 /* l2 */
- ;
- r2 : A /* l4 */
- | (B)? => <<q>>? y /* l5 */
- ;
-
- In earlier versions the mrhoist routine would see that both l1 and
- l2 contained predicates and would assume that this prevented either
- from acting to suppress the other predicate. In the example above
- it didn't realize the A at line l4 is capable of suppressing the
- predicate at l1 even though alt l2 contains (indirectly) a predicate.
-
- This is fixed in MR12b.
-
- Reported by Reinier van den Born (reinier@vnet.ibm.com)
-
-#153. (Changed in MR12a) Bug in computation of -mrhoist suppression set
-
- An oversight similar to that described in Item #152 appeared in
- the computation of the set that "covered" a predicate. If a
- predicate expression included a term such as p=AND(q,r) the context
- of p was taken to be context(q) & context(r), when it should have
- been context(q) | context(r). This is fixed in MR12a.
-
-#152. (Changed in MR12) Bug in generation of predicate expressions
-
- The primary purpose for MR12 is to make quite clear that MR11 is
- obsolete and to fix the bug related to predicate expressions.
-
- In MR10 code was added to optimize the code generated for
- predicate expression tests. Unfortunately, there was a
- significant oversight in the code which resulted in a bug in
- the generation of code for predicate expression tests which
- contained predicates combined using AND:
-
- r0 : (r1)* "@" ;
- r1 : (AAA)? => <<p LATEXT(1)>>? r2 ;
- r2 : (BBB)? => <<q LATEXT(1)>>? Q
- | (BBB)? => <<r LATEXT(1)>>? Q
- ;
-
- In MR11 (and MR10 when using "-mrhoist on") the code generated
- for r0 to predict r1 would be equivalent to:
-
- if ( LA(1)==Q &&
- (LA(1)==AAA && LA(1)==BBB) &&
- ( p && ( q || r )) ) {
-
- This is incorrect because it expresses the idea that LA(1)
- *must* be AAA in order to attempt r1, and *must* be BBB to
- attempt r2. The result was that r1 became unreachable since
- both condition can not be simultaneously true.
-
- The general philosophy of code generation for predicates
- can be summarized as follows:
-
- a. If the context is true don't enter an alt
- for which the corresponding predicate is false.
-
- If the context is false then it is okay to enter
- the alt without evaluating the predicate at all.
-
- b. A predicate created by ORing of predicates has
- context which is the OR of their individual contexts.
-
- c. A predicate created by ANDing of predicates has
- (surprise) context which is the OR of their individual
- contexts.
-
- d. Apply these rules recursively.
-
- e. Remember rule (a)
-
- The correct code should express the idea that *if* LA(1) is
- AAA then p must be true to attempt r1, but if LA(1) is *not*
- AAA then it is okay to attempt r1, provided that *if* LA(1) is
- BBB then one of q or r must be true.
-
- if ( LA(1)==Q &&
- ( !(LA(1)==AAA || LA(1)==BBB) ||
- ( ! LA(1) == AAA || p) &&
- ( ! LA(1) == BBB || q || r ) ) ) {
-
- I believe this is fixed in MR12.
-
- Reported by Reinier van den Born (reinier@vnet.ibm.com)
-
-#151a. (Changed in MR12) ANTLRParser::getLexer()
-
- As a result of several requests, I have added public methods to
- get a pointer to the lexer belonging to a parser.
-
- ANTLRTokenStream *ANTLRParser::getLexer() const
-
- Returns a pointer to the lexer being used by the
- parser. ANTLRTokenStream is the base class of
- DLGLexer
-
- ANTLRTokenStream *ANTLRTokenBuffer::getLexer() const
-
- Returns a pointer to the lexer being used by the
- ANTLRTokenBuffer. ANTLRTokenStream is the base
- class of DLGLexer
-
- You must manually cast the ANTLRTokenStream to your program's
- lexer class. Because the name of the lexer's class is not fixed.
- Thus it is impossible to incorporate it into the DLGLexerBase
- class.
-
-#151b.(Changed in MR12) ParserBlackBox member getLexer()
-
- The template class ParserBlackBox now has a member getLexer()
- which returns a pointer to the lexer.
-
-#150. (Changed in MR12) syntaxErrCount and lexErrCount now public
-
- See Item #127 for more information.
-
-#149. (Changed in MR12) antlr option -info o (letter o for orphan)
-
- If there is more than one rule which is not referenced by any
- other rule then all such rules are listed. This is useful for
- alerting one to rules which are not used, but which can still
- contribute to ambiguity. For example:
-
- start : a Z ;
- unused: a A ;
- a : (A)+ ;
-
- will cause an ambiguity report for rule "a" which will be
- difficult to understand if the user forgets about rule "unused"
- simply because it is not used in the grammar.
-
-#148. (Changed in MR11) #token names appearing in zztokens,token_tbl
-
- In a #token statement like the following:
-
- #token Plus "\+"
-
- the string "Plus" appears in the zztokens array (C mode) and
- token_tbl (C++ mode). This string is used in most error
- messages. In MR11 one has the option of using some other string,
- (e.g. "+") in those tables.
-
- In MR11 one can write:
-
- #token Plus ("+") "\+"
- #token RP ("(") "\("
- #token COM ("comment begin") "/\*"
-
- A #token statement is allowed to appear in more than one #lexclass
- with different regular expressions. However, the token name appears
- only once in the zztokens/token_tbl array. This means that only
- one substitute can be specified for a given #token name. The second
- attempt to define a substitute name (different from the first) will
- result in an error message.
-
-#147. (Changed in MR11) Bug in follow set computation
-
- There is a bug in 1.33 vanilla and all maintenance releases
- prior to MR11 in the computation of the follow set. The bug is
- different than that described in Item #82 and probably more
- common. It was discovered in the ansi.g grammar while testing
- the "ambiguity aid" (Item #119). The search for a bug started
- when the ambiguity aid was unable to discover the actual source
- of an ambiguity reported by antlr.
-
- The problem appears when an optimization of the follow set
- computation is used inappropriately. The result is that the
- follow set used is the "worst case". In other words, the error
- can lead to false reports of ambiguity. The good news is that
- if you have a grammar in which you have addressed all reported
- ambiguities you are ok. The bad news is that you may have spent
- time fixing ambiguities that were not real, or used k=2 when
- ck=2 might have been sufficient, and so on.
-
- The following grammar demonstrates the problem:
-
- ------------------------------------------------------------
- expr : ID ;
-
- start : stmt SEMI ;
-
- stmt : CASE expr COLON
- | expr SEMI
- | plain_stmt
- ;
-
- plain_stmt : ID COLON ;
- ------------------------------------------------------------
-
- When compiled with k=1 and ck=2 it will report:
-
- warning: alts 2 and 3 of the rule itself ambiguous upon
- { IDENTIFIER }, { COLON }
-
- When antlr analyzes "stmt" it computes the first[1] set of all
- alternatives. It finds an ambiguity between alts 2 and 3 for ID.
- It then computes the first[2] set for alternatives 2 and 3 to resolve
- the ambiguity. In computing the first[2] set of "expr" (which is
- only one token long) it needs to determine what could follow "expr".
- Under a certain combination of circumstances antlr forgets that it
- is trying to analyze "stmt" which can only be followed by SEMI and
- adds to the first[2] set of "expr" the "global" follow set (including
- "COLON") which could follow "expr" (under other conditions) in the
- phrase "CASE expr COLON".
-
-#146. (Changed in MR11) Option -treport for locating "difficult" alts
-
- It can be difficult to determine which alternatives are causing
- pccts to work hard to resolve an ambiguity. In some cases the
- ambiguity is successfully resolved after much CPU time so there
- is no message at all.
-
- A rough measure of the amount of work being peformed which is
- independent of the CPU speed and system load is the number of
- tnodes created. Using "-info t" gives information about the
- total number of tnodes created and the peak number of tnodes.
-
- Tree Nodes: peak 1300k created 1416k lost 0
-
- It also puts in the generated C or C++ file the number of tnodes
- created for a rule (at the end of the rule). However this
- information is not sufficient to locate the alternatives within
- a rule which are causing the creation of tnodes.
-
- Using:
-
- antlr -treport 100000 ....
-
- causes antlr to list on stdout any alternatives which require the
- creation of more than 100,000 tnodes, along with the lookahead sets
- for those alternatives.
-
- The following is a trivial case from the ansi.g grammar which shows
- the format of the report. This report might be of more interest
- in cases where 1,000,000 tuples were created to resolve the ambiguity.
-
- -------------------------------------------------------------------------
- There were 0 tuples whose ambiguity could not be resolved
- by full lookahead
- There were 157 tnodes created to resolve ambiguity between:
-
- Choice 1: statement/2 line 475 file ansi.g
- Choice 2: statement/3 line 476 file ansi.g
-
- Intersection of lookahead[1] sets:
-
- IDENTIFIER
-
- Intersection of lookahead[2] sets:
-
- LPARENTHESIS COLON AMPERSAND MINUS
- STAR PLUSPLUS MINUSMINUS ONESCOMPLEMENT
- NOT SIZEOF OCTALINT DECIMALINT
- HEXADECIMALINT FLOATONE FLOATTWO IDENTIFIER
- STRING CHARACTER
- -------------------------------------------------------------------------
-
-#145. (Documentation) Generation of Expression Trees
-
- Item #99 was misleading because it implied that the optimization
- for tree expressions was available only for trees created by
- predicate expressions and neglected to mention that it required
- the use of "-mrhoist on". The optimization applies to tree
- expressions created for grammars with k>1 and for predicates with
- lookahead depth >1.
-
- In MR11 the optimized version is always used so the -mrhoist on
- option need not be specified.
-
-#144. (Changed in MR11) Incorrect test for exception group
-
- In testing for a rule's exception group the label a pointer
- is compared against '\0'. The intention is "*pointer".
-
- Reported by Jeffrey C. Fried (Jeff@Fried.net).
-
-#143. (Changed in MR11) Optional ";" at end of #token statement
-
- Fixes problem of:
-
- #token X "x"
-
- <<
- parser action
- >>
-
- Being confused with:
-
- #token X "x" <<lexical action>>
-
-#142. (Changed in MR11) class BufFileInput subclass of DLGInputStream
-
- Alexey Demakov (demakov@kazbek.ispras.ru) has supplied class
- BufFileInput derived from DLGInputStream which provides a
- function lookahead(char *string) to test characters in the
- input stream more than one character ahead.
-
- The default amount of lookahead is specified by the constructor
- and defaults to 8 characters. This does *not* include the one
- character of lookahead maintained internally by DLG in member "ch"
- and which is not available for testing via BufFileInput::lookahead().
-
- This is a useful class for overcoming the one-character-lookahead
- limitation of DLG without resorting to a lexer capable of
- backtracking (like flex) which is not integrated with antlr as is
- DLG.
-
- There are no restrictions on copying or using BufFileInput.* except
- that the authorship and related information must be retained in the
- source code.
-
- The class is located in pccts/h/BufFileInput.* of the kit.
-
-#141. (Changed in MR11) ZZDEBUG_CONSUME for ANTLRParser::consume()
-
- A debug aid has been added to file ANTLRParser::consume() in
- file AParser.cpp:
-
- #ifdef ZZDEBUG_CONSUME_ACTION
- zzdebug_consume_action();
- #endif
-
- Suggested by Sramji Ramanathan (ps@kumaran.com).
-
-#140. (Changed in MR11) #pred to define predicates
-
- +---------------------------------------------------+
- | Note: Assume "-prc on" for this entire discussion |
- +---------------------------------------------------+
-
- A problem with predicates is that each one is regarded as
- unique and capable of disambiguating cases where two
- alternatives have identical lookahead. For example:
-
- rule : <<pred(LATEXT(1))>>? A
- | <<pred(LATEXT(1))>>? A
- ;
-
- will not cause any error messages or warnings to be issued
- by earlier versions of pccts. To compare the text of the
- predicates is an incomplete solution.
-
- In 1.33MR11 I am introducing the #pred statement in order to
- solve some problems with predicates. The #pred statement allows
- one to give a symbolic name to a "predicate literal" or a
- "predicate expression" in order to refer to it in other predicate
- expressions or in the rules of the grammar.
-
- The predicate literal associated with a predicate symbol is C
- or C++ code which can be used to test the condition. A
- predicate expression defines a predicate symbol in terms of other
- predicate symbols using "!", "&&", and "||". A predicate symbol
- can be defined in terms of a predicate literal, a predicate
- expression, or *both*.
-
- When a predicate symbol is defined with both a predicate literal
- and a predicate expression, the predicate literal is used to generate
- code, but the predicate expression is used to check for two
- alternatives with identical predicates in both alternatives.
-
- Here are some examples of #pred statements:
-
- #pred IsLabel <<isLabel(LATEXT(1))>>?
- #pred IsLocalVar <<isLocalVar(LATEXT(1))>>?
- #pred IsGlobalVar <<isGlobalVar(LATEXT(1)>>?
- #pred IsVar <<isVar(LATEXT(1))>>? IsLocalVar || IsGlobalVar
- #pred IsScoped <<isScoped(LATEXT(1))>>? IsLabel || IsLocalVar
-
- I hope that the use of EBNF notation to describe the syntax of the
- #pred statement will not cause problems for my readers (joke).
-
- predStatement : "#pred"
- CapitalizedName
- (
- "<<predicate_literal>>?"
- | "<<predicate_literal>>?" predOrExpr
- | predOrExpr
- )
- ;
-
- predOrExpr : predAndExpr ( "||" predAndExpr ) * ;
-
- predAndExpr : predPrimary ( "&&" predPrimary ) * ;
-
- predPrimary : CapitalizedName
- | "!" predPrimary
- | "(" predOrExpr ")"
- ;
-
- What is the purpose of this nonsense ?
-
- To understand how predicate symbols help, you need to realize that
- predicate symbols are used in two different ways with two different
- goals.
-
- a. Allow simplification of predicates which have been combined
- during predicate hoisting.
-
- b. Allow recognition of identical predicates which can't disambiguate
- alternatives with common lookahead.
-
- First we will discuss goal (a). Consider the following rule:
-
- rule0: rule1
- | ID
- | ...
- ;
-
- rule1: rule2
- | rule3
- ;
-
- rule2: <<isX(LATEXT(1))>>? ID ;
- rule3: <<!isX(LATEXT(1)>>? ID ;
-
- When the predicates in rule2 and rule3 are combined by hoisting
- to create a prediction expression for rule1 the result is:
-
- if ( LA(1)==ID
- && ( isX(LATEXT(1) || !isX(LATEXT(1) ) ) { rule1(); ...
-
- This is inefficient, but more importantly, can lead to false
- assumptions that the predicate expression distinguishes the rule1
- alternative with some other alternative with lookahead ID. In
- MR11 one can write:
-
- #pred IsX <<isX(LATEXT(1))>>?
-
- ...
-
- rule2: <<IsX>>? ID ;
- rule3: <<!IsX>>? ID ;
-
- During hoisting MR11 recognizes this as a special case and
- eliminates the predicates. The result is a prediction
- expression like the following:
-
- if ( LA(1)==ID ) { rule1(); ...
-
- Please note that the following cases which appear to be equivalent
- *cannot* be simplified by MR11 during hoisting because the hoisting
- logic only checks for a "!" in the predicate action, not in the
- predicate expression for a predicate symbol.
-
- *Not* equivalent and is not simplified during hoisting:
-
- #pred IsX <<isX(LATEXT(1))>>?
- #pred NotX <<!isX(LATEXT(1))>>?
- ...
- rule2: <<IsX>>? ID ;
- rule3: <<NotX>>? ID ;
-
- *Not* equivalent and is not simplified during hoisting:
-
- #pred IsX <<isX(LATEXT(1))>>?
- #pred NotX !IsX
- ...
- rule2: <<IsX>>? ID ;
- rule3: <<NotX>>? ID ;
-
- Now we will discuss goal (b).
-
- When antlr discovers that there is a lookahead ambiguity between
- two alternatives it attempts to resolve the ambiguity by searching
- for predicates in both alternatives. In the past any predicate
- would do, even if the same one appeared in both alternatives:
-
- rule: <<p(LATEXT(1))>>? X
- | <<p(LATEXT(1))>>? X
- ;
-
- The #pred statement is a start towards solving this problem.
- During ambiguity resolution (*not* predicate hoisting) the
- predicates for the two alternatives are expanded and compared.
- Consider the following example:
-
- #pred Upper <<isUpper(LATEXT(1))>>?
- #pred Lower <<isLower(LATEXT(1))>>?
- #pred Alpha <<isAlpha(LATEXT(1))>>? Upper || Lower
-
- rule0: rule1
- | <<Alpha>>? ID
- ;
-
- rule1:
- | rule2
- | rule3
- ...
- ;
-
- rule2: <<Upper>>? ID;
- rule3: <<Lower>>? ID;
-
- The definition of #pred Alpha expresses:
-
- a. to test the predicate use the C code "isAlpha(LATEXT(1))"
-
- b. to analyze the predicate use the information that
- Alpha is equivalent to the union of Upper and Lower,
-
- During ambiguity resolution the definition of Alpha is expanded
- into "Upper || Lower" and compared with the predicate in the other
- alternative, which is also "Upper || Lower". Because they are
- identical MR11 will report a problem.
-
- -------------------------------------------------------------------------
- t10.g, line 5: warning: the predicates used to disambiguate rule rule0
- (file t10.g alt 1 line 5 and alt 2 line 6)
- are identical when compared without context and may have no
- resolving power for some lookahead sequences.
- -------------------------------------------------------------------------
-
- If you use the "-info p" option the output file will contain:
-
- +----------------------------------------------------------------------+
- |#if 0 |
- | |
- |The following predicates are identical when compared without |
- | lookahead context information. For some ambiguous lookahead |
- | sequences they may not have any power to resolve the ambiguity. |
- | |
- |Choice 1: rule0/1 alt 1 line 5 file t10.g |
- | |
- | The original predicate for choice 1 with available context |
- | information: |
- | |
- | OR expr |
- | |
- | pred << Upper>>? |
- | depth=k=1 rule rule2 line 14 t10.g |
- | set context: |
- | ID |
- | |
- | pred << Lower>>? |
- | depth=k=1 rule rule3 line 15 t10.g |
- | set context: |
- | ID |
- | |
- | The predicate for choice 1 after expansion (but without context |
- | information): |
- | |
- | OR expr |
- | |
- | pred << isUpper(LATEXT(1))>>? |
- | depth=k=1 rule line 1 t10.g |
- | |
- | pred << isLower(LATEXT(1))>>? |
- | depth=k=1 rule line 2 t10.g |
- | |
- | |
- |Choice 2: rule0/2 alt 2 line 6 file t10.g |
- | |
- | The original predicate for choice 2 with available context |
- | information: |
- | |
- | pred << Alpha>>? |
- | depth=k=1 rule rule0 line 6 t10.g |
- | set context: |
- | ID |
- | |
- | The predicate for choice 2 after expansion (but without context |
- | information): |
- | |
- | OR expr |
- | |
- | pred << isUpper(LATEXT(1))>>? |
- | depth=k=1 rule line 1 t10.g |
- | |
- | pred << isLower(LATEXT(1))>>? |
- | depth=k=1 rule line 2 t10.g |
- | |
- | |
- |#endif |
- +----------------------------------------------------------------------+
-
- The comparison of the predicates for the two alternatives takes
- place without context information, which means that in some cases
- the predicates will be considered identical even though they operate
- on disjoint lookahead sets. Consider:
-
- #pred Alpha
-
- rule1: <<Alpha>>? ID
- | <<Alpha>>? Label
- ;
-
- Because the comparison of predicates takes place without context
- these will be considered identical. The reason for comparing
- without context is that otherwise it would be necessary to re-evaluate
- the entire predicate expression for each possible lookahead sequence.
- This would require more code to be written and more CPU time during
- grammar analysis, and it is not yet clear whether anyone will even make
- use of the new #pred facility.
-
- A temporary workaround might be to use different #pred statements
- for predicates you know have different context. This would avoid
- extraneous warnings.
-
- The above example might be termed a "false positive". Comparison
- without context will also lead to "false negatives". Consider the
- following example:
-
- #pred Alpha
- #pred Beta
-
- rule1: <<Alpha>>? A
- | rule2
- ;
-
- rule2: <<Alpha>>? A
- | <<Beta>>? B
- ;
-
- The predicate used for alt 2 of rule1 is (Alpha || Beta). This
- appears to be different than the predicate Alpha used for alt1.
- However, the context of Beta is B. Thus when the lookahead is A
- Beta will have no resolving power and Alpha will be used for both
- alternatives. Using the same predicate for both alternatives isn't
- very helpful, but this will not be detected with 1.33MR11.
-
- To properly handle this the predicate expression would have to be
- evaluated for each distinct lookahead context.
-
- To determine whether two predicate expressions are identical is
- difficult. The routine may fail to identify identical predicates.
-
- The #pred feature also compares predicates to see if a choice between
- alternatives which is resolved by a predicate which makes the second
- choice unreachable. Consider the following example:
-
- #pred A <<A(LATEXT(1)>>?
- #pred B <<B(LATEXT(1)>>?
- #pred A_or_B A || B
-
- r : s
- | t
- ;
- s : <<A_or_B>>? ID
- ;
- t : <<A>>? ID
- ;
-
- ----------------------------------------------------------------------------
- t11.g, line 5: warning: the predicate used to disambiguate the
- first choice of rule r
- (file t11.g alt 1 line 5 and alt 2 line 6)
- appears to "cover" the second predicate when compared without context.
- The second predicate may have no resolving power for some lookahead
- sequences.
- ----------------------------------------------------------------------------
-
-#139. (Changed in MR11) Problem with -gp in C++ mode
-
- The -gp option to add a prefix to rule names did not work in
- C++ mode. This has been fixed.
-
- Reported by Alexey Demakov (demakov@kazbek.ispras.ru).
-
-#138. (Changed in MR11) Additional makefiles for non-MSVC++ MS systems
-
- Sramji Ramanathan (ps@kumaran.com) has supplied makefiles for
- building antlr and dlg with Win95/NT development tools that
- are not based on MSVC5. They are pccts/antlr/AntlrMS.mak and
- pccts/dlg/DlgMS.mak.
-
- The first line of the makefiles require a definition of PCCTS_HOME.
-
- These are in additiion to the AntlrMSVC50.* and DlgMSVC50.*
- supplied by Jeff Vincent (JVincent@novell.com).
-
-#137. (Changed in MR11) Token getType(), getText(), getLine() const members
-
- --------------------------------------------------------------------
- If you use ANTLRCommonToken this change probably does not affect you.
- --------------------------------------------------------------------
-
- For a long time it has bothered me that these accessor functions
- in ANTLRAbstractToken were not const member functions. I have
- refrained from changing them because it require users to modify
- existing token class definitions which are derived directly
- from ANTLRAbstractToken. I think it is now time.
-
- For those who are not used to C++, a "const member function" is a
- member function which does not modify its own object - the thing
- to which "this" points. This is quite different from a function
- which does not modify its arguments
-
- Most token definitions based on ANTLRAbstractToken have something like
- the following in order to create concrete definitions of the pure
- virtual methods in ANTLRAbstractToken:
-
- class MyToken : public ANTLRAbstractToken {
- ...
- ANTLRTokenType getType() {return _type; }
- int getLine() {return _line; }
- ANTLRChar * getText() {return _text; }
- ...
- }
-
- The required change is simply to put "const" following the function
- prototype in the header (.h file) and the definition file (.cpp if
- it is not inline):
-
- class MyToken : public ANTLRAbstractToken {
- ...
- ANTLRTokenType getType() const {return _type; }
- int getLine() const {return _line; }
- ANTLRChar * getText() const {return _text; }
- ...
- }
-
- This was originally proposed a long time ago by Bruce
- Guenter (bruceg@qcc.sk.ca).
-
-#136. (Changed in MR11) Added getLength() to ANTLRCommonToken
-
- Classes ANTLRCommonToken and ANTLRCommonTokenNoRefCountToken
- now have a member function:
-
- int getLength() const { return strlen(getText()) }
-
- Suggested by Sramji Ramanathan (ps@kumaran.com).
-
-#135. (Changed in MR11) Raised antlr's own default ZZLEXBUFSIZE to 8k
-
-#134a. (ansi_mr10.zip) T.J. Parr's ANSI C grammar made 1.33MR11 compatible
-
- There is a typographical error in the definition of BITWISEOREQ:
-
- #token BITWISEOREQ "!=" should be "\|="
-
- When this change is combined with the bugfix to the follow set cache
- problem (Item #147) and a minor rearrangement of the grammar
- (Item #134b) it becomes a k=1 ck=2 grammar.
-
-#134b. (ansi_mr10.zip) T.J. Parr's ANSI C grammar made 1.33MR11 compatible
-
- The following changes were made in the ansi.g grammar (along with
- using -mrhoist on):
-
- ansi.g
- ======
- void tracein(char *) ====> void tracein(const char *)
- void traceout(char *) ====> void traceout(const char *)
-
- <LT(1)->getType()==IDENTIFIER ? isTypeName(LT(1)->getText()) : 1>>?
- ====> <<isTypeName(LT(1)->getText())>>?
-
- <<(LT(1)->getType()==LPARENTHESIS && LT(2)->getType()==IDENTIFIER) ? \
- isTypeName(LT(2)->getText()) : 1>>?
- ====> (LPARENTHESIS IDENTIFIER)? => <<isTypeName(LT(2)->getText())>>?
-
- <<(LT(1)->getType()==LPARENTHESIS && LT(2)->getType()==IDENTIFIER) ? \
- isTypeName(LT(2)->getText()) : 1>>?
- ====> (LPARENTHESIS IDENTIFIER)? => <<isTypeName(LT(2)->getText())>>?
-
- added to init(): traceOptionValueDefault=0;
- added to init(): traceOption(-1);
-
- change rule "statement":
-
- statement
- : plain_label_statement
- | case_label_statement
- | <<;>> expression SEMICOLON
- | compound_statement
- | selection_statement
- | iteration_statement
- | jump_statement
- | SEMICOLON
- ;
-
- plain_label_statement
- : IDENTIFIER COLON statement
- ;
-
- case_label_statement
- : CASE constant_expression COLON statement
- | DEFAULT COLON statement
- ;
-
- support.cpp
- ===========
- void tracein(char *) ====> void tracein(const char *)
- void traceout(char *) ====> void traceout(const char *)
-
- added to tracein(): ANTLRParser::tracein(r); // call superclass method
- added to traceout(): ANTLRParser::traceout(r); // call superclass method
-
- Makefile
- ========
- added to AFLAGS: -mrhoist on -prc on
-
-#133. (Changed in 1.33MR11) Make trace options public in ANTLRParser
-
- In checking T.J. Parr's ANSI C grammar for compatibility with
- 1.33MR11 discovered that it was inconvenient to have the
- trace facilities with protected access.
-
-#132. (Changed in 1.33MR11) Recognition of identical predicates in alts
-
- Prior to 1.33MR11, there would be no ambiguity warning when the
- very same predicate was used to disambiguate both alternatives:
-
- test: ref B
- | ref C
- ;
-
- ref : <<pred(LATEXT(1)>>? A
-
- In 1.33MR11 this will cause the warning:
-
- warning: the predicates used to disambiguate rule test
- (file v98.g alt 1 line 1 and alt 2 line 2)
- are identical and have no resolving power
-
- ----------------- Note -----------------
-
- This is different than the following case
-
- test: <<pred(LATEXT(1))>>? A B
- | <<pred(LATEXT(1)>>? A C
- ;
-
- In this case there are two distinct predicates
- which have exactly the same text. In the first
- example there are two references to the same
- predicate. The problem represented by this
- grammar will be addressed later.
-
-#131. (Changed in 1.33MR11) Case insensitive command line options
-
- Command line switches like "-CC" and keywords like "on", "off",
- and "stdin" are no longer case sensitive in antlr, dlg, and sorcerer.
-
-#130. (Changed in 1.33MR11) Changed ANTLR_VERSION to int from string
-
- The ANTLR_VERSION was not an integer, making it difficult to
- perform conditional compilation based on the antlr version.
-
- Henceforth, ANTLR_VERSION will be:
-
- (base_version * 10000) + release number
-
- thus 1.33MR11 will be: 133*100+11 = 13311
-
- Suggested by Rainer Janssen (Rainer.Janssen@Informatik.Uni-Oldenburg.DE).
-
-#129. (Changed in 1.33MR11) Addition of ANTLR_VERSION to <parserName>.h
-
- The following code is now inserted into <parserName>.h amd
- stdpccts.h:
-
- #ifndef ANTLR_VERSION
- #define ANTLR_VERSION 13311
- #endif
-
- Suggested by Rainer Janssen (Rainer.Janssen@Informatik.Uni-Oldenburg.DE)
-
-#128. (Changed in 1.33MR11) Redundant predicate code in (<<pred>>? ...)+
-
- Prior to 1.33MR11, the following grammar would generate
- redundant tests for the "while" condition.
-
- rule2 : (<<pred>>? X)+ X
- | B
- ;
-
- The code would resemble:
-
- if (LA(1)==X) {
- if (pred) {
- do {
- if (!pred) {zzfailed_pred(" pred");}
- zzmatch(X); zzCONSUME;
- } while (LA(1)==X && pred && pred);
- } else {...
-
- With 1.33MR11 the redundant predicate test is omitted.
-
-#127. (Changed in 1.33MR11)
-
- Count Syntax Errors Count DLG Errors
- ------------------- ----------------
-
- C++ mode ANTLRParser:: DLGLexerBase::
- syntaxErrCount lexErrCount
- C mode zzSyntaxErrCount zzLexErrCount
-
- The C mode variables are global and initialized to 0.
- They are *not* reset to 0 automatically when antlr is
- restarted.
-
- The C++ mode variables are public. They are initialized
- to 0 by the constructors. They are *not* reset to 0 by the
- ANTLRParser::init() method.
-
- Suggested by Reinier van den Born (reinier@vnet.ibm.com).
-
-#126. (Changed in 1.33MR11) Addition of #first <<...>>
-
- The #first <<...>> inserts the specified text in the output
- files before any other #include statements required by pccts.
- The only things before the #first text are comments and
- a #define ANTLR_VERSION.
-
- Requested by and Esa Pulkkinen (esap@cs.tut.fi) and Alexin
- Zoltan (alexin@inf.u-szeged.hu).
-
-#125. (Changed in 1.33MR11) Lookahead for (guard)? && <<p>>? predicates
-
- When implementing the new style of guard predicate (Item #113)
- in 1.33MR10 I decided to temporarily ignore the problem of
- computing the "narrowest" lookahead context.
-
- Consider the following k=1 grammar:
-
- start : a
- | b
- ;
-
- a : (A)? && <<pred1(LATEXT(1))>>? ab ;
- b : (B)? && <<pred2(LATEXT(1))>>? ab ;
-
- ab : A | B ;
-
- In MR10 the context for both "a" and "b" was {A B} because this is
- the first set of rule "ab". Normally, this is not a problem because
- the predicate which follows the guard inhibits any ambiguity report
- by antlr.
-
- In MR11 the first set for rule "a" is {A} and for rule "b" it is {B}.
-
-#124. A Note on the New "&&" Style Guarded Predicates
-
- I've been asked several times, "What is the difference between
- the old "=>" style guard predicates and the new style "&&" guard
- predicates, and how do you choose one over the other" ?
-
- The main difference is that the "=>" does not apply the
- predicate if the context guard doesn't match, whereas
- the && form always does. What is the significance ?
-
- If you have a predicate which is not on the "leading edge"
- it cannot be hoisted. Suppose you need a predicate that
- looks at LA(2). You must introduce it manually. The
- classic example is:
-
- castExpr :
- LP typeName RP
- | ....
- ;
-
- typeName : <<isTypeName(LATEXT(1))>>? ID
- | STRUCT ID
- ;
-
- The problem is that typeName isn't on the leading edge
- of castExpr, so the predicate isTypeName won't be hoisted into
- castExpr to help make a decision on which production to choose.
-
- The *first* attempt to fix it is this:
-
- castExpr :
- <<isTypeName(LATEXT(2))>>?
- LP typeName RP
- | ....
- ;
-
- Unfortunately, this won't work because it ignores
- the problem of STRUCT. The solution is to apply
- isTypeName() in castExpr if LA(2) is an ID and
- don't apply it when LA(2) is STRUCT:
-
- castExpr :
- (LP ID)? => <<isTypeName(LATEXT(2))>>?
- LP typeName RP
- | ....
- ;
-
- In conclusion, the "=>" style guarded predicate is
- useful when:
-
- a. the tokens required for the predicate
- are not on the leading edge
- b. there are alternatives in the expression
- selected by the predicate for which the
- predicate is inappropriate
-
- If (b) were false, then one could use a simple
- predicate (assuming "-prc on"):
-
- castExpr :
- <<isTypeName(LATEXT(2))>>?
- LP typeName RP
- | ....
- ;
-
- typeName : <<isTypeName(LATEXT(1))>>? ID
- ;
-
- So, when do you use the "&&" style guarded predicate ?
-
- The new-style "&&" predicate should always be used with
- predicate context. The context guard is in ADDITION to
- the automatically computed context. Thus it useful for
- predicates which depend on the token type for reasons
- other than context.
-
- The following example is contributed by Reinier van den Born
- (reinier@vnet.ibm.com).
-
- +-------------------------------------------------------------------------+
- | This grammar has two ways to call functions: |
- | |
- | - a "standard" call syntax with parens and comma separated args |
- | - a shell command like syntax (no parens and spacing separated args) |
- | |
- | The former also allows a variable to hold the name of the function, |
- | the latter can also be used to call external commands. |
- | |
- | The grammar (simplified) looks like this: |
- | |
- | fun_call : ID "(" { expr ("," expr)* } ")" |
- | /* ID is function name */ |
- | | "@" ID "(" { expr ("," expr)* } ")" |
- | /* ID is var containing fun name */ |
- | ; |
- | |
- | command : ID expr* /* ID is function name */ |
- | | path expr* /* path is external command name */ |
- | ; |
- | |
- | path : ID /* left out slashes and such */ |
- | | "@" ID /* ID is environment var */ |
- | ; |
- | |
- | expr : .... |
- | | "(" expr ")"; |
- | |
- | call : fun_call |
- | | command |
- | ; |
- | |
- | Obviously the call is wildly ambiguous. This is more or less how this |
- | is to be resolved: |
- | |
- | A call begins with an ID or an @ followed by an ID. |
- | |
- | If it is an ID and if it is an ext. command name -> command |
- | if followed by a paren -> fun_call |
- | otherwise -> command |
- | |
- | If it is an @ and if the ID is a var name -> fun_call |
- | otherwise -> command |
- | |
- | One can implement these rules quite neatly using && predicates: |
- | |
- | call : ("@" ID)? && <<isVarName(LT(2))>>? fun_call |
- | | (ID)? && <<isExtCmdName>>? command |
- | | (ID "(")? fun_call |
- | | command |
- | ; |
- | |
- | This can be done better, so it is not an ideal example, but it |
- | conveys the principle. |
- +-------------------------------------------------------------------------+
-
-#123. (Changed in 1.33MR11) Correct definition of operators in ATokPtr.h
-
- The return value of operators in ANTLRTokenPtr:
-
- changed: unsigned ... operator !=(...)
- to: int ... operator != (...)
- changed: unsigned ... operator ==(...)
- to: int ... operator == (...)
-
- Suggested by R.A. Nelson (cowboy@VNET.IBM.COM)
-
-#122. (Changed in 1.33MR11) Member functions to reset DLG in C++ mode
-
- void DLGFileReset(FILE *f) { input = f; found_eof = 0; }
- void DLGStringReset(DLGChar *s) { input = s; p = &input[0]; }
-
- Supplied by R.A. Nelson (cowboy@VNET.IBM.COM)
-
-#121. (Changed in 1.33MR11) Another attempt to fix -o (output dir) option
-
- Another attempt is made to improve the -o option of antlr, dlg,
- and sorcerer. This one by JVincent (JVincent@novell.com).
-
- The current rule:
-
- a. If -o is not specified than any explicit directory
- names are retained.
-
- b. If -o is specified than the -o directory name overrides any
- explicit directory names.
-
- c. The directory name of the grammar file is *not* stripped
- to create the main output file. However it is stil subject
- to override by the -o directory name.
-
-#120. (Changed in 1.33MR11) "-info f" output to stdout rather than stderr
-
- Added option 0 (e.g. "-info 0") which is a noop.
-
-#119. (Changed in 1.33MR11) Ambiguity aid for grammars
-
- The user can ask for additional information on ambiguities reported
- by antlr to stdout. At the moment, only one ambiguity report can
- be created in an antlr run.
-
- This feature is enabled using the "-aa" (Ambiguity Aid) option.
-
- The following options control the reporting of ambiguities:
-
- -aa ruleName Selects reporting by name of rule
- -aa lineNumber Selects reporting by line number
- (file name not compared)
-
- -aam Selects "multiple" reporting for a token
- in the intersection set of the
- alternatives.
-
- For instance, the token ID may appear dozens
- of times in various paths as the program
- explores the rules which are reachable from
- the point of an ambiguity. With option -aam
- every possible path the search program
- encounters is reported.
-
- Without -aam only the first encounter is
- reported. This may result in incomplete
- information, but the information may be
- sufficient and much shorter.
-
- -aad depth Selects the depth of the search.
- The default value is 1.
-
- The number of paths to be searched, and the
- size of the report can grow geometrically
- with the -ck value if a full search for all
- contributions to the source of the ambiguity
- is explored.
-
- The depth represents the number of tokens
- in the lookahead set which are matched against
- the set of ambiguous tokens. A depth of 1
- means that the search stops when a lookahead
- sequence of just one token is matched.
-
- A k=1 ck=6 grammar might generate 5,000 items
- in a report if a full depth 6 search is made
- with the Ambiguity Aid. The source of the
- problem may be in the first token and obscured
- by the volume of data - I hesitate to call
- it information.
-
- When the user selects a depth > 1, the search
- is first performed at depth=1 for both
- alternatives, then depth=2 for both alternatives,
- etc.
-
- Sample output for rule grammar in antlr.g itself:
-
- +---------------------------------------------------------------------+
- | Ambiguity Aid |
- | |
- | Choice 1: grammar/70 line 632 file a.g |
- | Choice 2: grammar/82 line 644 file a.g |
- | |
- | Intersection of lookahead[1] sets: |
- | |
- | "\}" "class" "#errclass" "#tokclass" |
- | |
- | Choice:1 Depth:1 Group:1 ("#errclass") |
- | 1 in (...)* block grammar/70 line 632 a.g |
- | 2 to error grammar/73 line 635 a.g |
- | 3 error error/1 line 894 a.g |
- | 4 #token "#errclass" error/2 line 895 a.g |
- | |
- | Choice:1 Depth:1 Group:2 ("#tokclass") |
- | 2 to tclass grammar/74 line 636 a.g |
- | 3 tclass tclass/1 line 937 a.g |
- | 4 #token "#tokclass" tclass/2 line 938 a.g |
- | |
- | Choice:1 Depth:1 Group:3 ("class") |
- | 2 to class_def grammar/75 line 637 a.g |
- | 3 class_def class_def/1 line 669 a.g |
- | 4 #token "class" class_def/3 line 671 a.g |
- | |
- | Choice:1 Depth:1 Group:4 ("\}") |
- | 2 #token "\}" grammar/76 line 638 a.g |
- | |
- | Choice:2 Depth:1 Group:5 ("#errclass") |
- | 1 in (...)* block grammar/83 line 645 a.g |
- | 2 to error grammar/93 line 655 a.g |
- | 3 error error/1 line 894 a.g |
- | 4 #token "#errclass" error/2 line 895 a.g |
- | |
- | Choice:2 Depth:1 Group:6 ("#tokclass") |
- | 2 to tclass grammar/94 line 656 a.g |
- | 3 tclass tclass/1 line 937 a.g |
- | 4 #token "#tokclass" tclass/2 line 938 a.g |
- | |
- | Choice:2 Depth:1 Group:7 ("class") |
- | 2 to class_def grammar/95 line 657 a.g |
- | 3 class_def class_def/1 line 669 a.g |
- | 4 #token "class" class_def/3 line 671 a.g |
- | |
- | Choice:2 Depth:1 Group:8 ("\}") |
- | 2 #token "\}" grammar/96 line 658 a.g |
- +---------------------------------------------------------------------+
-
- For a linear lookahead set ambiguity (where k=1 or for k>1 but
- when all lookahead sets [i] with i<k all have degree one) the
- reports appear in the following order:
-
- for (depth=1 ; depth <= "-aad depth" ; depth++) {
- for (alternative=1; alternative <=2 ; alternative++) {
- while (matches-are-found) {
- group++;
- print-report
- };
- };
- };
-
- For reporting a k-tuple ambiguity, the reports appear in the
- following order:
-
- for (depth=1 ; depth <= "-aad depth" ; depth++) {
- while (matches-are-found) {
- for (alternative=1; alternative <=2 ; alternative++) {
- group++;
- print-report
- };
- };
- };
-
- This is because matches are generated in different ways for
- linear lookahead and k-tuples.
-
-#118. (Changed in 1.33MR11) DEC VMS makefile and VMS related changes
-
- Revised makefiles for DEC/VMS operating system for antlr, dlg,
- and sorcerer.
-
- Reduced names of routines with external linkage to less than 32
- characters to conform to DEC/VMS linker limitations.
-
- Jean-Francois Pieronne discovered problems with dlg and antlr
- due to the VMS linker not being case sensitive for names with
- external linkage. In dlg the problem was with "className" and
- "ClassName". In antlr the problem was with "GenExprSets" and
- "genExprSets".
-
- Added genmms, a version of genmk for the DEC/VMS version of make.
- The source is in directory pccts/support/DECmms.
-
- All VMS contributions by Jean-Francois Pieronne (jfp@iname.com).
-
-#117. (Changed in 1.33MR10) new EXPERIMENTAL predicate hoisting code
-
- The hoisting of predicates into rules to create prediction
- expressions is a problem in antlr. Consider the following
- example (k=1 with -prc on):
-
- start : (a)* "@" ;
- a : b | c ;
- b : <<isUpper(LATEXT(1))>>? A ;
- c : A ;
-
- Prior to 1.33MR10 the code generated for "start" would resemble:
-
- while {
- if (LA(1)==A &&
- (!LA(1)==A || isUpper())) {
- a();
- }
- };
-
- This code is wrong because it makes rule "c" unreachable from
- "start". The essence of the problem is that antlr fails to
- recognize that there can be a valid alternative within "a" even
- when the predicate <<isUpper(LATEXT(1))>>? is false.
-
- In 1.33MR10 with -mrhoist the hoisting of the predicate into
- "start" is suppressed because it recognizes that "c" can
- cover all the cases where the predicate is false:
-
- while {
- if (LA(1)==A) {
- a();
- }
- };
-
- With the antlr "-info p" switch the user will receive information
- about the predicate suppression in the generated file:
-
- --------------------------------------------------------------
- #if 0
-
- Hoisting of predicate suppressed by alternative without predicate.
- The alt without the predicate includes all cases where
- the predicate is false.
-
- WITH predicate: line 7 v1.g
- WITHOUT predicate: line 7 v1.g
-
- The context set for the predicate:
-
- A
-
- The lookahead set for the alt WITHOUT the semantic predicate:
-
- A
-
- The predicate:
-
- pred << isUpper(LATEXT(1))>>?
- depth=k=1 rule b line 9 v1.g
- set context:
- A
- tree context: null
-
- Chain of referenced rules:
-
- #0 in rule start (line 5 v1.g) to rule a
- #1 in rule a (line 7 v1.g)
-
- #endif
- --------------------------------------------------------------
-
- A predicate can be suppressed by a combination of alternatives
- which, taken together, cover a predicate:
-
- start : (a)* "@" ;
-
- a : b | ca | cb | cc ;
-
- b : <<isUpper(LATEXT(1))>>? ( A | B | C ) ;
-
- ca : A ;
- cb : B ;
- cc : C ;
-
- Consider a more complex example in which "c" covers only part of
- a predicate:
-
- start : (a)* "@" ;
-
- a : b
- | c
- ;
-
- b : <<isUpper(LATEXT(1))>>?
- ( A
- | X
- );
-
- c : A
- ;
-
- Prior to 1.33MR10 the code generated for "start" would resemble:
-
- while {
- if ( (LA(1)==A || LA(1)==X) &&
- (! (LA(1)==A || LA(1)==X) || isUpper()) {
- a();
- }
- };
-
- With 1.33MR10 and -mrhoist the predicate context is restricted to
- the non-covered lookahead. The code resembles:
-
- while {
- if ( (LA(1)==A || LA(1)==X) &&
- (! (LA(1)==X) || isUpper()) {
- a();
- }
- };
-
- With the antlr "-info p" switch the user will receive information
- about the predicate restriction in the generated file:
-
- --------------------------------------------------------------
- #if 0
-
- Restricting the context of a predicate because of overlap
- in the lookahead set between the alternative with the
- semantic predicate and one without
- Without this restriction the alternative without the predicate
- could not be reached when input matched the context of the
- predicate and the predicate was false.
-
- WITH predicate: line 11 v4.g
- WITHOUT predicate: line 12 v4.g
-
- The original context set for the predicate:
-
- A X
-
- The lookahead set for the alt WITHOUT the semantic predicate:
-
- A
-
- The intersection of the two sets
-
- A
-
- The original predicate:
-
- pred << isUpper(LATEXT(1))>>?
- depth=k=1 rule b line 15 v4.g
- set context:
- A X
- tree context: null
-
- The new (modified) form of the predicate:
-
- pred << isUpper(LATEXT(1))>>?
- depth=k=1 rule b line 15 v4.g
- set context:
- X
- tree context: null
-
- #endif
- --------------------------------------------------------------
-
- The bad news about -mrhoist:
-
- (a) -mrhoist does not analyze predicates with lookahead
- depth > 1.
-
- (b) -mrhoist does not look past a guarded predicate to
- find context which might cover other predicates.
-
- For these cases you might want to use syntactic predicates.
- When a semantic predicate fails during guess mode the guess
- fails and the next alternative is tried.
-
- Limitation (a) is illustrated by the following example:
-
- start : (stmt)* EOF ;
-
- stmt : cast
- | expr
- ;
- cast : <<isTypename(LATEXT(2))>>? LP ID RP ;
-
- expr : LP ID RP ;
-
- This is not much different from the first example, except that
- it requires two tokens of lookahead context to determine what
- to do. This predicate is NOT suppressed because the current version
- is unable to handle predicates with depth > 1.
-
- A predicate can be combined with other predicates during hoisting.
- In those cases the depth=1 predicates are still handled. Thus,
- in the following example the isUpper() predicate will be suppressed
- by line #4 when hoisted from "bizarre" into "start", but will still
- be present in "bizarre" in order to predict "stmt".
-
- start : (bizarre)* EOF ; // #1
- // #2
- bizarre : stmt // #3
- | A // #4
- ;
-
- stmt : cast
- | expr
- ;
-
- cast : <<isTypename(LATEXT(2))>>? LP ID RP ;
-
- expr : LP ID RP ;
- | <<isUpper(LATEXT(1))>>? A
-
- Limitation (b) is illustrated by the following example of a
- context guarded predicate:
-
- rule : (A)? <<p>>? // #1
- (A // #2
- |B // #3
- ) // #4
- | <<q>> B // #5
- ;
-
- Recall that this means that when the lookahead is NOT A then
- the predicate "p" is ignored and it attempts to match "A|B".
- Ideally, the "B" at line #3 should suppress predicate "q".
- However, the current version does not attempt to look past
- the guard predicate to find context which might suppress other
- predicates.
-
- In some cases -mrhoist will lead to the reporting of ambiguities
- which were not visible before:
-
- start : (a)* "@";
- a : bc | d;
- bc : b | c ;
-
- b : <<isUpper(LATEXT(1))>>? A;
- c : A ;
-
- d : A ;
-
- In this case there is a true ambiguity in "a" between "bc" and "d"
- which can both match "A". Without -mrhoist the predicate in "b"
- is hoisted into "a" and there is no ambiguity reported. However,
- with -mrhoist, the predicate in "b" is suppressed by "c" (as it
- should be) making the ambiguity in "a" apparent.
-
- The motivations for these changes were hoisting problems reported
- by Reinier van den Born (reinier@vnet.ibm.com) and several others.
-
-#116. (Changed in 1.33MR10) C++ mode: tracein/traceout rule name is (const char *)
-
- The prototype for C++ mode routine tracein (and traceout) has changed from
- "char *" to "const char *".
-
-#115. (Changed in 1.33MR10) Using guess mode with exception handlers in C mode
-
- The definition of the C mode macros zzmatch_wsig and zzsetmatch_wsig
- neglected to consider guess mode. When control passed to the rule's
- parse exception handler the routine would exit without ever closing the
- guess block. This would lead to unpredictable behavior.
-
- In 1.33MR10 the behavior of exceptions in C mode and C++ mode should be
- identical.
-
-#114. (Changed in 1.33MR10) difference in [zz]resynch() between C and C++ modes
-
- There was a slight difference in the way C and C++ mode resynchronized
- following a parsing error. The C routine would sometimes skip an extra
- token before attempting to resynchronize.
-
- The C routine was changed to match the C++ routine.
-
-#113. (Changed in 1.33MR10) new context guarded pred: (g)? && <<p>>? expr
-
- The existing context guarded predicate:
-
- rule : (guard)? => <<p>>? expr
- | next_alternative
- ;
-
- generates code which resembles:
-
- if (lookahead(expr) && (!guard || pred)) {
- expr()
- } else ....
-
- This is not suitable for some applications because it allows
- expr() to be invoked when the predicate is false. This is
- intentional because it is meant to mimic automatically computed
- predicate context.
-
- The new context guarded predicate uses the guard information
- differently because it has a different goal. Consider:
-
- rule : (guard)? && <<p>>? expr
- | next_alternative
- ;
-
- The new style of context guarded predicate is equivalent to:
-
- rule : <<guard==true && pred>>? expr
- | next_alternative
- ;
-
- It generates code which resembles:
-
- if (lookahead(expr) && guard && pred) {
- expr();
- } else ...
-
- Both forms of guarded predicates severely restrict the form of
- the context guard: it can contain no rule references, no
- (...)*, no (...)+, and no {...}. It may contain token and
- token class references, and alternation ("|").
-
- Addition for 1.33MR11: in the token expression all tokens must
- be at the same height of the token tree:
-
- (A ( B | C))? && ... is ok (all height 2)
- (A ( B | ))? && ... is not ok (some 1, some 2)
- (A B C D | E F G H)? && ... is ok (all height 4)
- (A B C D | E )? && ... is not ok (some 4, some 1)
-
- This restriction is required in order to properly compute the lookahead
- set for expressions like:
-
- rule1 : (A B C)? && <<pred>>? rule2 ;
- rule2 : (A|X) (B|Y) (C|Z);
-
- This addition was suggested by Rienier van den Born (reinier@vnet.ibm.com)
-
-#112. (Changed in 1.33MR10) failed validation predicate in C guess mode
-
- John Lilley (jlilley@empathy.com) suggested that failed validation
- predicates abort a guess rather than reporting a failed error.
- This was installed in C++ mode (Item #4). Only now was it noticed
- that the fix was never installed for C mode.
-
-#111. (Changed in 1.33MR10) moved zzTRACEIN to before init action
-
- When the antlr -gd switch is present antlr generates calls to
- zzTRACEIN at the start of a rule and zzTRACEOUT at the exit
- from a rule. Prior to 1.33MR10 Tthe call to zzTRACEIN was
- after the init-action, which could cause confusion because the
- init-actions were reported with the name of the enclosing rule,
- rather than the active rule.
-
-#110. (Changed in 1.33MR10) antlr command line copied to generated file
-
- The antlr command line is now copied to the generated file near
- the start.
-
-#109. (Changed in 1.33MR10) improved trace information
-
- The quality of the trace information provided by the "-gd"
- switch has been improved significantly. Here is an example
- of the output from a test program. It shows the rule name,
- the first token of lookahead, the call depth, and the guess
- status:
-
- exit rule gusxx {"?"} depth 2
- enter rule gusxx {"?"} depth 2
- enter rule gus1 {"o"} depth 3 guessing
- guess done - returning to rule gus1 {"o"} at depth 3
- (guess mode continues - an enclosing guess is still active)
- guess done - returning to rule gus1 {"Z"} at depth 3
- (guess mode continues - an enclosing guess is still active)
- exit rule gus1 {"Z"} depth 3 guessing
- guess done - returning to rule gusxx {"o"} at depth 2 (guess mode ends)
- enter rule gus1 {"o"} depth 3
- guess done - returning to rule gus1 {"o"} at depth 3 (guess mode ends)
- guess done - returning to rule gus1 {"Z"} at depth 3 (guess mode ends)
- exit rule gus1 {"Z"} depth 3
- line 1: syntax error at "Z" missing SC
- ...
-
- Rule trace reporting is controlled by the value of the integer
- [zz]traceOptionValue: when it is positive tracing is enabled,
- otherwise it is disabled. Tracing during guess mode is controlled
- by the value of the integer [zz]traceGuessOptionValue. When
- it is positive AND [zz]traceOptionValue is positive rule trace
- is reported in guess mode.
-
- The values of [zz]traceOptionValue and [zz]traceGuessOptionValue
- can be adjusted by subroutine calls listed below.
-
- Depending on the presence or absence of the antlr -gd switch
- the variable [zz]traceOptionValueDefault is set to 0 or 1. When
- the parser is initialized or [zz]traceReset() is called the
- value of [zz]traceOptionValueDefault is copied to [zz]traceOptionValue.
- The value of [zz]traceGuessOptionValue is always initialzed to 1,
- but, as noted earlier, nothing will be reported unless
- [zz]traceOptionValue is also positive.
-
- When the parser state is saved/restored the value of the trace
- variables are also saved/restored. If a restore causes a change in
- reporting behavior from on to off or vice versa this will be reported.
-
- When the -gd option is selected, the macro "#define zzTRACE_RULES"
- is added to appropriate output files.
-
- C++ mode
- --------
- int traceOption(int delta)
- int traceGuessOption(int delta)
- void traceReset()
- int traceOptionValueDefault
-
- C mode
- --------
- int zzTraceOption(int delta)
- int zzTraceGuessOption(int delta)
- void zzTraceReset()
- int zzTraceOptionValueDefault
-
- The argument "delta" is added to the traceOptionValue. To
- turn on trace when inside a particular rule one:
-
- rule : <<traceOption(+1);>>
- (
- rest-of-rule
- )
- <<traceOption(-1);>>
- ; /* fail clause */ <<traceOption(-1);>>
-
- One can use the same idea to turn *off* tracing within a
- rule by using a delta of (-1).
-
- An improvement in the rule trace was suggested by Sramji
- Ramanathan (ps@kumaran.com).
-
-#108. A Note on Deallocation of Variables Allocated in Guess Mode
-
- NOTE
- ------------------------------------------------------
- This mechanism only works for heap allocated variables
- ------------------------------------------------------
-
- The rewrite of the trace provides the machinery necessary
- to properly free variables or undo actions following a
- failed guess.
-
- The macro zzUSER_GUESS_HOOK(guessSeq,zzrv) is expanded
- as part of the zzGUESS macro. When a guess is opened
- the value of zzrv is 0. When a longjmp() is executed to
- undo the guess, the value of zzrv will be 1.
-
- The macro zzUSER_GUESS_DONE_HOOK(guessSeq) is expanded
- as part of the zzGUESS_DONE macro. This is executed
- whether the guess succeeds or fails as part of closing
- the guess.
-
- The guessSeq is a sequence number which is assigned to each
- guess and is incremented by 1 for each guess which becomes
- active. It is needed by the user to associate the start of
- a guess with the failure and/or completion (closing) of a
- guess.
-
- Guesses are nested. They must be closed in the reverse
- of the order that they are opened.
-
- In order to free memory used by a variable during a guess
- a user must write a routine which can be called to
- register the variable along with the current guess sequence
- number provided by the zzUSER_GUESS_HOOK macro. If the guess
- fails, all variables tagged with the corresponding guess
- sequence number should be released. This is ugly, but
- it would require a major rewrite of antlr 1.33 to use
- some mechanism other than setjmp()/longjmp().
-
- The order of calls for a *successful* guess would be:
-
- zzUSER_GUESS_HOOK(guessSeq,0);
- zzUSER_GUESS_DONE_HOOK(guessSeq);
-
- The order of calls for a *failed* guess would be:
-
- zzUSER_GUESS_HOOK(guessSeq,0);
- zzUSER_GUESS_HOOK(guessSeq,1);
- zzUSER_GUESS_DONE_HOOK(guessSeq);
-
- The default definitions of these macros are empty strings.
-
- Here is an example in C++ mode. The zzUSER_GUESS_HOOK and
- zzUSER_GUESS_DONE_HOOK macros and myGuessHook() routine
- can be used without change in both C and C++ versions.
-
- ----------------------------------------------------------------------
- <<
-
- #include "AToken.h"
-
- typedef ANTLRCommonToken ANTLRToken;
-
- #include "DLGLexer.h"
-
- int main() {
-
- {
- DLGFileInput in(stdin);
- DLGLexer lexer(&in,2000);
- ANTLRTokenBuffer pipe(&lexer,1);
- ANTLRCommonToken aToken;
- P parser(&pipe);
-
- lexer.setToken(&aToken);
- parser.init();
- parser.start();
- };
-
- fclose(stdin);
- fclose(stdout);
- return 0;
- }
-
- >>
-
- <<
- char *s=NULL;
-
- #undef zzUSER_GUESS_HOOK
- #define zzUSER_GUESS_HOOK(guessSeq,zzrv) myGuessHook(guessSeq,zzrv);
- #undef zzUSER_GUESS_DONE_HOOK
- #define zzUSER_GUESS_DONE_HOOK(guessSeq) myGuessHook(guessSeq,2);
-
- void myGuessHook(int guessSeq,int zzrv) {
- if (zzrv == 0) {
- fprintf(stderr,"User hook: starting guess #%d\n",guessSeq);
- } else if (zzrv == 1) {
- free (s);
- s=NULL;
- fprintf(stderr,"User hook: failed guess #%d\n",guessSeq);
- } else if (zzrv == 2) {
- free (s);
- s=NULL;
- fprintf(stderr,"User hook: ending guess #%d\n",guessSeq);
- };
- }
-
- >>
-
- #token A "a"
- #token "[\t \ \n]" <<skip();>>
-
- class P {
-
- start : (top)+
- ;
-
- top : (which) ? <<fprintf(stderr,"%s is a which\n",s); free(s); s=NULL; >>
- | other <<fprintf(stderr,"%s is an other\n",s); free(s); s=NULL; >>
- ; <<if (s != NULL) free(s); s=NULL; >>
-
- which : which2
- ;
-
- which2 : which3
- ;
- which3
- : (label)? <<fprintf(stderr,"%s is a label\n",s);>>
- | (global)? <<fprintf(stderr,"%s is a global\n",s);>>
- | (exclamation)? <<fprintf(stderr,"%s is an exclamation\n",s);>>
- ;
-
- label : <<s=strdup(LT(1)->getText());>> A ":" ;
-
- global : <<s=strdup(LT(1)->getText());>> A "::" ;
-
- exclamation : <<s=strdup(LT(1)->getText());>> A "!" ;
-
- other : <<s=strdup(LT(1)->getText());>> "other" ;
-
- }
- ----------------------------------------------------------------------
-
- This is a silly example, but illustrates the idea. For the input
- "a ::" with tracing enabled the output begins:
-
- ----------------------------------------------------------------------
- enter rule "start" depth 1
- enter rule "top" depth 2
- User hook: starting guess #1
- enter rule "which" depth 3 guessing
- enter rule "which2" depth 4 guessing
- enter rule "which3" depth 5 guessing
- User hook: starting guess #2
- enter rule "label" depth 6 guessing
- guess failed
- User hook: failed guess #2
- guess done - returning to rule "which3" at depth 5 (guess mode continues
- - an enclosing guess is still active)
- User hook: ending guess #2
- User hook: starting guess #3
- enter rule "global" depth 6 guessing
- exit rule "global" depth 6 guessing
- guess done - returning to rule "which3" at depth 5 (guess mode continues
- - an enclosing guess is still active)
- User hook: ending guess #3
- enter rule "global" depth 6 guessing
- exit rule "global" depth 6 guessing
- exit rule "which3" depth 5 guessing
- exit rule "which2" depth 4 guessing
- exit rule "which" depth 3 guessing
- guess done - returning to rule "top" at depth 2 (guess mode ends)
- User hook: ending guess #1
- enter rule "which" depth 3
- .....
- ----------------------------------------------------------------------
-
- Remember:
-
- (a) Only init-actions are executed during guess mode.
- (b) A rule can be invoked multiple times during guess mode.
- (c) If the guess succeeds the rule will be called once more
- without guess mode so that normal actions will be executed.
- This means that the init-action might need to distinguish
- between guess mode and non-guess mode using the variable
- [zz]guessing.
-
-#107. (Changed in 1.33MR10) construction of ASTs in guess mode
-
- Prior to 1.33MR10, when using automatic AST construction in C++
- mode for a rule, an AST would be constructed for elements of the
- rule even while in guess mode. In MR10 this no longer occurs.
-
-#106. (Changed in 1.33MR10) guess variable confusion
-
- In C++ mode a guess which failed always restored the parser state
- using zzGUESS_DONE as part of zzGUESS_FAIL. Prior to 1.33MR10,
- C mode required an explicit call to zzGUESS_DONE after the
- call to zzGUESS_FAIL.
-
- Consider:
-
- rule : (alpha)? beta
- | ...
- ;
-
- The generated code resembles:
-
- zzGUESS
- if (!zzrv && LA(1)==ID) { <==== line #1
- alpha
- zzGUESS_DONE
- beta
- } else {
- if (! zzrv) zzGUESS_DONE <==== line #2a
- ....
-
- However, in some cases line #2 was rendered:
-
- if (guessing) zzGUESS_DONE <==== line #2b
-
- This would work for simple test cases, but would fail in
- some cases where there was a guess while another guess was active.
- One kind of failure would be to match up the zzGUESS_DONE at line
- #2b with the "outer" guess which was still active. The outer
- guess would "succeed" when only the inner guess should have
- succeeded.
-
- In 1.33MR10 the behavior of zzGUESS and zzGUESS_FAIL in C and
- and C++ mode should be identical.
-
- The same problem appears in 1.33 vanilla in some places. For
- example:
-
- start : { (sub)? } ;
-
- or:
-
- start : (
- B
- | ( sub )?
- | C
- )+
- ;
-
- generates incorrect code.
-
- The general principle is:
-
- (a) use [zz]guessing only when deciding between a call to zzFAIL
- or zzGUESS_FAIL
-
- (b) use zzrv in all other cases
-
- This problem was discovered while testing changes to item #105.
- I believe this is now fixed. My apologies.
-
-#105. (Changed in 1.33MR10) guess block as single alt of (...)+
-
- Prior to 1.33MR10 the following constructs:
-
- rule_plus : (
- (sub)?
- )+
- ;
-
- rule_star : (
- (sub)?
- )*
- ;
-
- generated incorrect code for the guess block (which could result
- in runtime errors) because of an incorrect optimization of a
- block with only a single alternative.
-
- The fix caused some changes to the fix described in Item #49
- because there are now three code generation sequences for (...)+
- blocks containing a guess block:
-
- a. single alternative which is a guess block
- b. multiple alternatives in which the last is a guess block
- c. all other cases
-
- Forms like "rule_star" can have unexpected behavior when there
- is a syntax error: if the subrule "sub" is not matched *exactly*
- then "rule_star" will consume no tokens.
-
- Reported by Esa Pulkkinen (esap@cs.tut.fi).
-
-#104. (Changed in 1.33MR10) -o option for dlg
-
- There was problem with the code added by item #74 to handle the
- -o option of dlg. This should fix it.
-
-#103. (Changed in 1.33MR10) ANDed semantic predicates
-
- Rescinded.
-
- The optimization was a mistake.
- The resulting problem is described in Item #150.
-
-#102. (Changed in 1.33MR10) allow "class parser : .... {"
-
- The syntax of the class statement ("class parser-name {")
- has been extended to allow for the specification of base
- classes. An arbirtrary number of tokens may now appear
- between the class name and the "{". They are output
- again when the class declaration is generated. For
- example:
-
- class Parser : public MyBaseClassANTLRparser {
-
- This was suggested by a user, but I don't have a record
- of who it was.
-
-#101. (Changed in 1.33MR10) antlr -info command line switch
-
- -info
-
- p - extra predicate information in generated file
-
- t - information about tnode use:
- at the end of each rule in generated file
- summary on stderr at end of program
-
- m - monitor progress
- prints name of each rule as it is started
- flushes output at start of each rule
-
- f - first/follow set information to stdout
-
- 0 - no operation (added in 1.33MR11)
-
- The options may be combined and may appear in any order.
- For example:
-
- antlr -info ptm -CC -gt -mrhoist on mygrammar.g
-
-#100a. (Changed in 1.33MR10) Predicate tree simplification
-
- When the same predicates can be referenced in more than one
- alternative of a block large predicate trees can be formed.
-
- The difference that these optimizations make is so dramatic
- that I have decided to use it even when -mrhoist is not selected.
-
- Consider the following grammar:
-
- start : ( all )* ;
-
- all : a
- | d
- | e
- | f
- ;
-
- a : c A B
- | c A C
- ;
-
- c : <<AAA(LATEXT(2))>>?
- ;
-
- d : <<BBB(LATEXT(2))>>? B C
- ;
-
- e : <<CCC(LATEXT(2))>>? B C
- ;
-
- f : e X Y
- ;
-
- In rule "a" there is a reference to rule "c" in both alternatives.
- The length of the predicate AAA is k=2 and it can be followed in
- alternative 1 only by (A B) while in alternative 2 it can be
- followed only by (A C). Thus they do not have identical context.
-
- In rule "all" the alternatives which refer to rules "e" and "f" allow
- elimination of the duplicate reference to predicate CCC.
-
- The table below summarized the kind of simplification performed by
- 1.33MR10. In the table, X and Y stand for single predicates
- (not trees).
-
- (OR X (OR Y (OR Z))) => (OR X Y Z)
- (AND X (AND Y (AND Z))) => (AND X Y Z)
-
- (OR X (... (OR X Y) ... )) => (OR X (... Y ... ))
- (AND X (... (AND X Y) ... )) => (AND X (... Y ... ))
- (OR X (... (AND X Y) ... )) => (OR X (... ... ))
- (AND X (... (OR X Y) ... )) => (AND X (... ... ))
-
- (AND X) => X
- (OR X) => X
-
- In a test with a complex grammar for a real application, a predicate
- tree with six OR nodes and 12 leaves was reduced to "(OR X Y Z)".
-
- In 1.33MR10 there is a greater effort to release memory used
- by predicates once they are no longer in use.
-
-#100b. (Changed in 1.33MR10) Suppression of extra predicate tests
-
- The following optimizations require that -mrhoist be selected.
-
- It is relatively easy to optimize the code generated for predicate
- gates when they are of the form:
-
- (AND X Y Z ...)
- or (OR X Y Z ...)
-
- where X, Y, Z, and "..." represent individual predicates (leaves) not
- predicate trees.
-
- If the predicate is an AND the contexts of the X, Y, Z, etc. are
- ANDed together to create a single Tree context for the group and
- context tests for the individual predicates are suppressed:
-
- --------------------------------------------------
- Note: This was incorrect. The contexts should be
- ORed together. This has been fixed. A more
- complete description is available in item #152.
- ---------------------------------------------------
-
- Optimization 1: (AND X Y Z ...)
-
- Suppose the context for Xtest is LA(1)==LP and the context for
- Ytest is LA(1)==LP && LA(2)==ID.
-
- Without the optimization the code would resemble:
-
- if (lookaheadContext &&
- !(LA(1)==LP && LA(1)==LP && LA(2)==ID) ||
- ( (! LA(1)==LP || Xtest) &&
- (! (LA(1)==LP || LA(2)==ID) || Xtest)
- )) {...
-
- With the -mrhoist optimization the code would resemble:
-
- if (lookaheadContext &&
- ! (LA(1)==LP && LA(2)==ID) || (Xtest && Ytest) {...
-
- Optimization 2: (OR X Y Z ...) with identical contexts
-
- Suppose the context for Xtest is LA(1)==ID and for Ytest
- the context is also LA(1)==ID.
-
- Without the optimization the code would resemble:
-
- if (lookaheadContext &&
- ! (LA(1)==ID || LA(1)==ID) ||
- (LA(1)==ID && Xtest) ||
- (LA(1)==ID && Ytest) {...
-
- With the -mrhoist optimization the code would resemble:
-
- if (lookaheadContext &&
- (! LA(1)==ID) || (Xtest || Ytest) {...
-
- Optimization 3: (OR X Y Z ...) with distinct contexts
-
- Suppose the context for Xtest is LA(1)==ID and for Ytest
- the context is LA(1)==LP.
-
- Without the optimization the code would resemble:
-
- if (lookaheadContext &&
- ! (LA(1)==ID || LA(1)==LP) ||
- (LA(1)==ID && Xtest) ||
- (LA(1)==LP && Ytest) {...
-
- With the -mrhoist optimization the code would resemble:
-
- if (lookaheadContext &&
- (zzpf=0,
- (LA(1)==ID && (zzpf=1) && Xtest) ||
- (LA(1)==LP && (zzpf=1) && Ytest) ||
- !zzpf) {
-
- These may appear to be of similar complexity at first,
- but the non-optimized version contains two tests of each
- context while the optimized version contains only one
- such test, as well as eliminating some of the inverted
- logic (" !(...) || ").
-
- Optimization 4: Computation of predicate gate trees
-
- When generating code for the gates of predicate expressions
- antlr 1.33 vanilla uses a recursive procedure to generate
- "&&" and "||" expressions for testing the lookahead. As each
- layer of the predicate tree is exposed a new set of "&&" and
- "||" expressions on the lookahead are generated. In many
- cases the lookahead being tested has already been tested.
-
- With -mrhoist a lookahead tree is computed for the entire
- lookahead expression. This means that predicates with identical
- context or context which is a subset of another predicate's
- context disappear.
-
- This is especially important for predicates formed by rules
- like the following:
-
- uppperCaseVowel : <<isUpperCase(LATEXT(1))>>? vowel;
- vowel: : <<isVowel(LATEXT(1))>>? LETTERS;
-
- These predicates are combined using AND since both must be
- satisfied for rule upperCaseVowel. They have identical
- context which makes this optimization very effective.
-
- The affect of Items #100a and #100b together can be dramatic. In
- a very large (but real world) grammar one particular predicate
- expression was reduced from an (unreadable) 50 predicate leaves,
- 195 LA(1) terms, and 5500 characters to an (easily comprehensible)
- 3 predicate leaves (all different) and a *single* LA(1) term.
-
-#99. (Changed in 1.33MR10) Code generation for expression trees
-
- Expression trees are used for k>1 grammars and predicates with
- lookahead depth >1. This optimization must be enabled using
- "-mrhoist on". (Clarification added for 1.33MR11).
-
- In the processing of expression trees, antlr can generate long chains
- of token comparisons. Prior to 1.33MR10 there were many redundant
- parenthesis which caused problems for compilers which could handle
- expressions of only limited complexity. For example, to test an
- expression tree (root R A B C D), antlr would generate something
- resembling:
-
- (LA(1)==R && (LA(2)==A || (LA(2)==B || (LA(2)==C || LA(2)==D)))))
-
- If there were twenty tokens to test then there would be twenty
- parenthesis at the end of the expression.
-
- In 1.33MR10 the generated code for tree expressions resembles:
-
- (LA(1)==R && (LA(2)==A || LA(2)==B || LA(2)==C || LA(2)==D))
-
- For "complex" expressions the output is indented to reflect the LA
- number being tested:
-
- (LA(1)==R
- && (LA(2)==A || LA(2)==B || LA(2)==C || LA(2)==D
- || LA(2)==E || LA(2)==F)
- || LA(1)==S
- && (LA(2)==G || LA(2)==H))
-
-
- Suggested by S. Bochnak (S.Bochnak@@microTool.com.pl),
-
-#98. (Changed in 1.33MR10) Option "-info p"
-
- When the user selects option "-info p" the program will generate
- detailed information about predicates. If the user selects
- "-mrhoist on" additional detail will be provided explaining
- the promotion and suppression of predicates. The output is part
- of the generated file and sandwiched between #if 0/#endif statements.
-
- Consider the following k=1 grammar:
-
- start : ( all ) * ;
-
- all : ( a
- | b
- )
- ;
-
- a : c B
- ;
-
- c : <<LATEXT(1)>>?
- | B
- ;
-
- b : <<LATEXT(1)>>? X
- ;
-
- Below is an excerpt of the output for rule "start" for the three
- predicate options (off, on, and maintenance release style hoisting).
-
- For those who do not wish to use the "-mrhoist on" option for code
- generation the option can be used in a "diagnostic" mode to provide
- valuable information:
-
- a. where one should insert null actions to inhibit hoisting
- b. a chain of rule references which shows where predicates are
- being hoisted
-
- ======================================================================
- Example of "-info p" with "-mrhoist on"
- ======================================================================
- #if 0
-
- Hoisting of predicate suppressed by alternative without predicate.
- The alt without the predicate includes all cases where the
- predicate is false.
-
- WITH predicate: line 11 v36.g
- WITHOUT predicate: line 12 v36.g
-
- The context set for the predicate:
-
- B
-
- The lookahead set for alt WITHOUT the semantic predicate:
-
- B
-
- The predicate:
-
- pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g
-
- set context:
- B
- tree context: null
-
- Chain of referenced rules:
-
- #0 in rule start (line 1 v36.g) to rule all
- #1 in rule all (line 3 v36.g) to rule a
- #2 in rule a (line 8 v36.g) to rule c
- #3 in rule c (line 11 v36.g)
-
- #endif
- &&
- #if 0
-
- pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g
-
- set context:
- X
- tree context: null
-
- #endif
- ======================================================================
- Example of "-info p" with the default -prc setting ( "-prc off")
- ======================================================================
- #if 0
-
- OR
- pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g
-
- set context:
- nil
- tree context: null
-
- pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g
-
- set context:
- nil
- tree context: null
-
- #endif
- ======================================================================
- Example of "-info p" with "-prc on" and "-mrhoist off"
- ======================================================================
- #if 0
-
- OR
- pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g
-
- set context:
- B
- tree context: null
-
- pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g
-
- set context:
- X
- tree context: null
-
- #endif
- ======================================================================
-
-#97. (Fixed in 1.33MR10) "Predicate applied for more than one ... "
-
- In 1.33 vanilla, the grammar listed below produced this message for
- the first alternative (only) of rule "b":
-
- warning: predicate applied for >1 lookahead 1-sequences
- [you may only want one lookahead 1-sequence to apply.
- Try using a context guard '(...)? =>'
-
- In 1.33MR10 the message is issued for both alternatives.
-
- top : (a)*;
- a : b | c ;
-
- b : <<PPP(LATEXT(1))>>? ( AAA | BBB )
- | <<QQQ(LATEXT(1))>>? ( XXX | YYY )
- ;
-
- c : AAA | XXX;
-
-#96. (Fixed in 1.33MR10) Guard predicates ignored when -prc off
-
- Prior to 1.33MR10, guard predicate code was not generated unless
- "-prc on" was selected.
-
- This was incorrect, since "-prc off" (the default) is supposed to
- disable only AUTOMATIC computation of predicate context, not the
- programmer specified context supplied by guard predicates.
-
-#95. (Fixed in 1.33MR10) Predicate guard context length was k, not max(k,ck)
-
- Prior to 1.33MR10, predicate guards were computed to k tokens rather
- than max(k,ck). Consider the following grammar:
-
- a : ( A B C)? => <<AAA(LATEXT(1))>>? (A|X) (B|Y) (C|Z) ;
-
- The code generated by 1.33 vanilla with "-k 1 -ck 3 -prc on"
- for the predicate in "a" resembles:
-
- if ( (! LA(1)==A) || AAA(LATEXT(1))) {...
-
- With 1.33MR10 and the same options the code resembles:
-
- if ( (! (LA(1)==A && LA(2)==B && LA(3)==C) || AAA(LATEXT(1))) {...
-
-#94. (Fixed in 1.33MR10) Predicates followed by rule references
-
- Prior to 1.33MR10, a semantic predicate which referenced a token
- which was off the end of the rule caused an incomplete context
- to be computed (with "-prc on") for the predicate under some circum-
- stances. In some cases this manifested itself as illegal C code
- (e.g. "LA(2)==[Ep](1)" in the k=2 examples below:
-
- all : ( a ) *;
-
- a : <<AAA(LATEXT(2))>>? ID X
- | <<BBB(LATEXT(2))>>? Y
- | Z
- ;
-
- This might also occur when the semantic predicate was followed
- by a rule reference which was shorter than the length of the
- semantic predicate:
-
- all : ( a ) *;
-
- a : <<AAA(LATEXT(2))>>? ID X
- | <<BBB(LATEXT(2))>>? y
- | Z
- ;
-
- y : Y ;
-
- Depending on circumstance, the resulting context might be too
- generous because it was too short, or too restrictive because
- of missing alternatives.
-
-#93. (Changed in 1.33MR10) Definition of Purify macro
-
- Ofer Ben-Ami (gremlin@cs.huji.ac.il) has supplied a definition
- for the Purify macro:
-
- #define PURIFY(r, s) memset((char *) &(r), '\0', (s));
-
- Note: This may not be the right thing to do for C++ objects that
- have constructors. Reported by Bonny Rais (bonny@werple.net.au).
-
- For those cases one should #define PURIFY to an empty macro in the
- #header or #first actions.
-
-#92. (Fixed in 1.33MR10) Guarded predicates and hoisting
-
- When a guarded predicate participates in hoisting it is linked into
- a predicate expression tree. Prior to 1.33MR10 this link was never
- cleared and the next time the guard was used to construct a new
- tree the link could contain a spurious reference to another element
- which had previosly been joined to it in the semantic predicate tree.
-
- For example:
-
- start : ( all ) *;
- all : ( a | b ) ;
-
- start2 : ( all2 ) *;
- all2 : ( a ) ;
-
- a : (A)? => <<AAA(LATEXT(1))>>? A ;
- b : (B)? => <<BBB(LATEXT(1))>>? B ;
-
- Prior to 1.33MR10 the code for "start2" would include a spurious
- reference to the BBB predicate which was left from constructing
- the predicate tree for rule "start" (i.e. or(AAA,BBB) ).
-
- In 1.33MR10 this problem is avoided by cloning the original guard
- each time it is linked into a predicate tree.
-
-#91. (Changed in 1.33MR10) Extensive changes to semantic pred hoisting
-
- ============================================
- This has been rendered obsolete by Item #117
- ============================================
-
-#90. (Fixed in 1.33MR10) Semantic pred with LT(i) and i>max(k,ck)
-
- There is a bug in antlr 1.33 vanilla and all maintenance releases
- prior to 1.33MR10 which allows semantic predicates to reference
- an LT(i) or LATEXT(i) where i is larger than max(k,ck). When
- this occurs antlr will attempt to mark the ith element of an array
- in which there are only max(k,ck) elements. The result cannot
- be predicted.
-
- Using LT(i) or LATEXT(i) for i>max(k,ck) is reported as an error
- in 1.33MR10.
-
-#89. Rescinded
-
-#88. (Fixed in 1.33MR10) Tokens used in semantic predicates in guess mode
-
- Consider the behavior of a semantic predicate during guess mode:
-
- rule : a:A (
- <<test($a)>>? b:B
- | c:C
- );
-
- Prior to MR10 the assignment of the token or attribute to
- $a did not occur during guess mode, which would cause the
- semantic predicate to misbehave because $a would be null.
-
- In 1.33MR10 a semantic predicate with a reference to an
- element label (such as $a) forces the assignment to take
- place even in guess mode.
-
- In order to work, this fix REQUIRES use of the $label format
- for token pointers and attributes referenced in semantic
- predicates.
-
- The fix does not apply to semantic predicates using the
- numeric form to refer to attributes (e.g. <<test($1)>>?).
- The user will receive a warning for this case.
-
- Reported by Rob Trout (trout@mcs.cs.kent.edu).
-
-#87. (Fixed in 1.33MR10) Malformed guard predicates
-
- Context guard predicates may contain only references to
- tokens. They may not contain references to (...)+ and
- (...)* blocks. This is now checked. This replaces the
- fatal error message in item #78 with an appropriate
- (non-fatal) error messge.
-
- In theory, context guards should be allowed to reference
- rules. However, I have not had time to fix this.
- Evaluation of the guard takes place before all rules have
- been read, making it difficult to resolve a forward reference
- to rule "zzz" - it hasn't been read yet ! To postpone evaluation
- of the guard until all rules have been read is too much
- for the moment.
-
-#86. (Fixed in 1.33MR10) Unequal set size in set_sub
-
- Routine set_sub() in pccts/support/set/set.h did not work
- correctly when the sets were of unequal sizes. Rewrote
- set_equ to make it simpler and remove unnecessary and
- expensive calls to set_deg(). This routine was not used
- in 1.33 vanila.
-
-#85. (Changed in 1.33MR10) Allow redefinition of MaxNumFiles
-
- Raised the maximum number of input files to 99 from 20.
- Put a #ifndef/#endif around the "#define MaxNumFiles 99".
-
-#84. (Fixed in 1.33MR10) Initialize zzBadTok in macro zzRULE
-
- Initialize zzBadTok to NULL in zzRULE macro of AParser.h.
- in order to get rid of warning messages.
-
-#83. (Fixed in 1.33MR10) False warnings with -w2 for #tokclass
-
- When -w2 is selected antlr gives inappropriate warnings about
- #tokclass names not having any associated regular expressions.
- Since a #tokclass is not a "real" token it will never have an
- associated regular expression and there should be no warning.
-
- Reported by Derek Pappas (derek.pappas@eng.sun.com)
-
-#82. (Fixed in 1.33MR10) Computation of follow sets with multiple cycles
-
- Reinier van den Born (reinier@vnet.ibm.com) reported a problem
- in the computation of follow sets by antlr. The problem (bug)
- exists in 1.33 vanilla and all maintenance releases prior to 1.33MR10.
-
- The problem involves the computation of follow sets when there are
- cycles - rules which have mutual references. I believe the problem
- is restricted to cases where there is more than one cycle AND
- elements of those cycles have rules in common. Even when this
- occurs it may not affect the code generated - but it might. It
- might also lead to undetected ambiguities.
-
- There were no changes in antlr or dlg output from the revised version.
-
- The following fragment demonstates the problem by giving different
- follow sets (option -pa) for var_access when built with k=1 and ck=2 on
- 1.33 vanilla and 1.33MR10:
-
- echo_statement : ECHO ( echo_expr )*
- ;
-
- echo_expr : ( command )?
- | expression
- ;
-
- command : IDENTIFIER
- { concat }
- ;
-
- expression : operand ( OPERATOR operand )*
- ;
-
- operand : value
- | START command END
- ;
-
- value : concat
- | TYPE operand
- ;
-
- concat : var_access { CONCAT value }
- ;
-
- var_access : IDENTIFIER { INDEX }
-
- ;
-#81. (Changed in 1.33MR10) C mode use of attributes and ASTs
-
- Reported by Isaac Clark (irclark@mindspring.com).
-
- C mode code ignores attributes returned by rules which are
- referenced using element labels when ASTs are enabled (-gt option).
-
- 1. start : r:rule t:Token <<$start=$r;>>
-
- The $r refrence will not work when combined with
- the -gt option.
-
- 2. start : t:Token <<$start=$t;>>
-
- The $t reference works in all cases.
-
- 3. start : rule <<$0=$1;>>
-
- Numeric labels work in all cases.
-
- With MR10 the user will receive an error message for case 1 when
- the -gt option is used.
-
-#80. (Fixed in 1.33MR10) (...)? as last alternative of block
-
- A construct like the following:
-
- rule : a
- | (b)?
- ;
-
- does not make sense because there is no alternative when
- the guess block fails. This is now reported as a warning
- to the user.
-
- Previously, there was a code generation error for this case:
- the guess block was not "closed" when the guess failed.
- This could cause an infinite loop or other problems. This
- is now fixed.
-
- Example problem:
-
- #header<<
- #include <stdio.h>
- #include "charptr.h"
- >>
-
- <<
- #include "charptr.c"
- main ()
- {
- ANTLR(start(),stdin);
- }
- >>
-
- #token "[\ \t]+" << zzskip(); >>
- #token "[\n]" << zzline++; zzskip(); >>
-
- #token Word "[a-z]+"
- #token Number "[0-9]+"
-
-
- start : (test1)?
- | (test2)?
- ;
- test1 : (Word Word Word Word)?
- | (Word Word Word Number)?
- ;
- test2 : (Word Word Number Word)?
- | (Word Word Number Number)?
- ;
-
- Test data which caused infinite loop:
-
- a 1 a a
-
-#79. (Changed in 1.33MR10) Use of -fh with multiple parsers
-
- Previously, antlr always used the pre-processor symbol
- STDPCCTS_H as a gate for the file stdpccts.h. This
- caused problems when there were multiple parsers defined
- because they used the same gate symbol.
-
- In 1.33MR10, the -fh filename is used to generate the
- gate file for stdpccts.h. For instance:
-
- antlr -fh std_parser1.h
-
- generates the pre-processor symbol "STDPCCTS_std_parser1_H".
-
- Reported by Ramanathan Santhanam (ps@kumaran.com).
-
-#78. (Changed in 1.33MR9) Guard predicates that refer to rules
-
- ------------------------
- Please refer to Item #87
- ------------------------
-
- Guard predicates are processed during an early phase
- of antlr (during parsing) before all data structures
- are completed.
-
- There is an apparent bug in earlier versions of 1.33
- which caused guard predicates which contained references
- to rules (rather than tokens) to reference a structure
- which hadn't yet been initialized.
-
- In some cases (perhaps all cases) references to rules
- in guard predicates resulted in the use of "garbage".
-
-#79. (Changed in 1.33MR9) Jeff Vincent (JVincent@novell.com)
-
- Previously, the maximum length file name was set
- arbitrarily to 300 characters in antlr, dlg, and sorcerer.
-
- The config.h file now attempts to define the maximum length
- filename using _MAX_PATH from stdlib.h before falling back
- to using the value 300.
-
-#78. (Changed in 1.33MR9) Jeff Vincent (JVincent@novell.com)
-
- Put #ifndef/#endif around definition of ZZLEXBUFSIZE in
- antlr.
-
-#77. (Changed in 1.33MR9) Arithmetic overflow for very large grammars
-
- In routine HandleAmbiguities() antlr attempts to compute the
- number of possible elements in a set that is order of
- number-of-tokens raised to the number-of-lookahead-tokens power.
- For large grammars or large lookahead (e.g. -ck 7) this can
- cause arithmetic overflow.
-
- With 1.33MR9, arithmetic overflow in this computation is reported
- the first time it happens. The program continues to run and
- the program branches based on the assumption that the computed
- value is larger than any number computed by counting actual cases
- because 2**31 is larger than the number of bits in most computers.
-
- Before 1.33MR9 overflow was not reported. The behavior following
- overflow is not predictable by anyone but the original author.
-
- NOTE
-
- In 1.33MR10 the warning message is suppressed.
- The code which detects the overflow allows the
- computation to continue without an error. The
- error message itself made made users worry.
-
-#76. (Changed in 1.33MR9) Jeff Vincent (JVincent@novell.com)
-
- Jeff Vincent has convinced me to make ANTLRCommonToken and
- ANTLRCommonNoRefCountToken use variable length strings
- allocated from the heap rather than fixed length strings.
- By suitable definition of setText(), the copy constructor,
- and operator =() it is possible to maintain "copy" semantics.
- By "copy" semantics I mean that when a token is copied from
- an existing token it receives its own, distinct, copy of the
- text allocated from the heap rather than simply a pointer
- to the original token's text.
-
- ============================================================
- W * A * R * N * I * N * G
- ============================================================
-
- It is possible that this may cause problems for some users.
- For those users I have included the old version of AToken.h as
- pccts/h/AToken_traditional.h.
-
-#75. (Changed in 1.33MR9) Bruce Guenter (bruceg@qcc.sk.ca)
-
- Make DLGStringInput const correct. Since this is infrequently
- subclassed, it should affect few users, I hope.
-
-#74. (Changed in 1.33MR9) -o (output directory) option
-
- Antlr does not properly handle the -o output directory option
- when the filename of the grammar contains a directory part. For
- example:
-
- antlr -o outdir pccts_src/myfile.g
-
- causes antlr create a file called "outdir/pccts_src/myfile.cpp.
- It SHOULD create outdir/myfile.cpp
-
- The suggested code fix has been installed in antlr, dlg, and
- Sorcerer.
-
-#73. (Changed in 1.33MR9) Hoisting of semantic predicates and -mrhoist
-
- ============================================
- This has been rendered obsolete by Item #117
- ============================================
-
-#72. (Changed in 1.33MR9) virtual saveState()/restoreState()/guess_XXX
-
- The following methods in ANTLRParser were made virtual at
- the request of S. Bochnak (S.Bochnak@microTool.com.pl):
-
- saveState() and restoreState()
- guess(), guess_fail(), and guess_done()
-
-#71. (Changed in 1.33MR9) Access to omitted command line argument
-
- If a switch requiring arguments is the last thing on the
- command line, and the argument is omitted, antlr would core.
-
- antlr test.g -prc
-
- instead of
-
- antlr test.g -prc off
-
-#70. (Changed in 1.33MR9) Addition of MSVC .dsp and .mak build files
-
- The following MSVC .dsp and .mak files for pccts and sorcerer
- were contributed by Stanislaw Bochnak (S.Bochnak@microTool.com.pl)
- and Jeff Vincent (JVincent@novell.com)
-
- PCCTS Distribution Kit
- ----------------------
- pccts/PCCTSMSVC50.dsw
-
- pccts/antlr/AntlrMSVC50.dsp
- pccts/antlr/AntlrMSVC50.mak
-
- pccts/dlg/DlgMSVC50.dsp
- pccts/dlg/DlgMSVC50.mak
-
- pccts/support/msvc.dsp
-
- Sorcerer Distribution Kit
- -------------------------
- pccts/sorcerer/SorcererMSVC50.dsp
- pccts/sorcerer/SorcererMSVC50.mak
-
- pccts/sorcerer/lib/msvc.dsp
-
-#69. (Changed in 1.33MR9) Change "unsigned int" to plain "int"
-
- Declaration of max_token_num in misc.c as "unsigned int"
- caused comparison between signed and unsigned ints giving
- warning message without any special benefit.
-
-#68. (Changed in 1.33MR9) Add void return for dlg internal_error()
-
- Get rid of "no return value" message in internal_error()
- in file dlg/support.c and dlg/dlg.h.
-
-#67. (Changed in Sor) sor.g: lisp() has no return value
-
- Added a "void" for the return type.
-
-#66. (Added to Sor) sor.g: ZZLEXBUFSIZE enclosed in #ifndef/#endif
-
- A user needed to be able to change the ZZLEXBUFSIZE for
- sor. Put the definition of ZZLEXBUFSIZE inside #ifndef/#endif
-
-#65. (Changed in 1.33MR9) PCCTSAST::deepCopy() and ast_dup() bug
-
- Jeff Vincent (JVincent@novell.com) found that deepCopy()
- made new copies of only the direct descendents. No new
- copies were made of sibling nodes, Sibling pointers are
- set to zero by shallowCopy().
-
- PCCTS_AST::deepCopy() has been changed to make a
- deep copy in the traditional sense.
-
- The deepCopy() routine depends on the behavior of
- shallowCopy(). In all sor examples I've found,
- shallowCopy() zeroes the right and down pointers.
-
- Original Tree Original deepCopy() Revised deepCopy
- ------------- ------------------- ----------------
- a->b->c A A
- | | |
- d->e->f D D->E->F
- | | |
- g->h->i G G->H->I
- | |
- j->k J->K
-
- While comparing deepCopy() for C++ mode with ast_dup for
- C mode I found a problem with ast_dup().
-
- Routine ast_dup() has been changed to make a deep copy
- in the traditional sense.
-
- Original Tree Original ast_dup() Revised ast_dup()
- ------------- ------------------- ----------------
- a->b->c A->B->C A
- | | |
- d->e->f D->E->F D->E->F
- | | |
- g->h->i G->H->I G->H->I
- | | |
- j->k J->K J->K
-
-
- I believe this affects transform mode sorcerer programs only.
-
-#64. (Changed in 1.33MR9) anltr/hash.h prototype for killHashTable()
-
-#63. (Changed in 1.33MR8) h/charptr.h does not zero pointer after free
-
- The charptr.h routine now zeroes the pointer after free().
-
- Reported by Jens Tingleff (jensting@imaginet.fr)
-
-#62. (Changed in 1.33MR8) ANTLRParser::resynch had static variable
-
- The static variable "consumed" in ANTLRParser::resynch was
- changed into an instance variable of the class with the
- name "resynchConsumed".
-
- Reported by S.Bochnak@microTool.com.pl
-
-#61. (Changed in 1.33MR8) Using rule>[i,j] when rule has no return values
-
- Previously, the following code would cause antlr to core when
- it tried to generate code for rule1 because rule2 had no return
- values ("upward inheritance"):
-
- rule1 : <<int i; int j>>
- rule2 > [i,j]
- ;
-
- rule2 : Anything ;
-
- Reported by S.Bochnak@microTool.com.pl
-
- Verified correct operation of antlr MR8 when missing or extra
- inheritance arguments for all combinations. When there are
- missing or extra arguments code will still be generated even
- though this might cause the invocation of a subroutine with
- the wrong number of arguments.
-
-#60. (Changed in 1.33MR7) Major changes to exception handling
-
- There were significant problems in the handling of exceptions
- in 1.33 vanilla. The general problem is that it can only
- process one level of exception handler. For example, a named
- exception handler, an exception handler for an alternative, or
- an exception for a subrule always went to the rule's exception
- handler if there was no "catch" which matched the exception.
-
- In 1.33MR7 the exception handlers properly "nest". If an
- exception handler does not have a matching "catch" then the
- nextmost outer exception handler is checked for an appropriate
- "catch" clause, and so on until an exception handler with an
- appropriate "catch" is found.
-
- There are still undesirable features in the way exception
- handlers are implemented, but I do not have time to fix them
- at the moment:
-
- The exception handlers for alternatives are outside the
- block containing the alternative. This makes it impossible
- to access variables declared in a block or to resume the
- parse by "falling through". The parse can still be easily
- resumed in other ways, but not in the most natural fashion.
-
- This results in an inconsistentcy between named exception
- handlers and exception handlers for alternatives. When
- an exception handler for an alternative "falls through"
- it goes to the nextmost outer handler - not the "normal
- action".
-
- A major difference between 1.33MR7 and 1.33 vanilla is
- the default action after an exception is caught:
-
- 1.33 Vanilla
- ------------
- In 1.33 vanilla the signal value is set to zero ("NoSignal")
- and the code drops through to the code following the exception.
- For named exception handlers this is the "normal action".
- For alternative exception handlers this is the rule's handler.
-
- 1.33MR7
- -------
- In 1.33MR7 the signal value is NOT automatically set to zero.
-
- There are two cases:
-
- For named exception handlers: if the signal value has been
- set to zero the code drops through to the "normal action".
-
- For all other cases the code branches to the nextmost outer
- exception handler until it reaches the handler for the rule.
-
- The following macros have been defined for convenience:
-
- C/C++ Mode Name
- --------------------
- (zz)suppressSignal
- set signal & return signal arg to 0 ("NoSignal")
- (zz)setSignal(intValue)
- set signal & return signal arg to some value
- (zz)exportSignal
- copy the signal value to the return signal arg
-
- I'm not sure why PCCTS make a distinction between the local
- signal value and the return signal argument, but I'm loathe
- to change the code. The burden of copying the local signal
- value to the return signal argument can be given to the
- default signal handler, I suppose.
-
-#59. (Changed in 1.33MR7) Prototypes for some functions
-
- Added prototypes for the following functions to antlr.h
-
- zzconsumeUntil()
- zzconsumeUntilToken()
-
-#58. (Changed in 1.33MR7) Added defintion of zzbufsize to dlgauto.h
-
-#57. (Changed in 1.33MR7) Format of #line directive
-
- Previously, the -gl directive for line 1234 would
- resemble: "# 1234 filename.g". This caused problems
- for some compilers/pre-processors. In MR7 it generates
- "#line 1234 filename.g".
-
-#56. (Added in 1.33MR7) Jan Mikkelsen <janm@zeta.org.au>
-
- Move PURIFY macro invocaton to after rule's init action.
-
-#55. (Fixed in 1.33MR7) Unitialized variables in ANTLRParser
-
- Member variables inf_labase and inf_last were not initialized.
- (See item #50.)
-
-#54. (Fixed in 1.33MR6) Brad Schick (schick@interacess.com)
-
- Previously, the following constructs generated the same
- code:
-
- rule1 : (A B C)?
- | something-else
- ;
-
- rule2 : (A B C)? ()
- | something-else
- ;
-
- In all versions of pccts rule1 guesses (A B C) and then
- consume all three tokens if the guess succeeds. In MR6
- rule2 guesses (A B C) but consumes NONE of the tokens
- when the guess succeeds because "()" matches epsilon.
-
-#53. (Explanation for 1.33MR6) What happens after an exception is caught ?
-
- The Book is silent about what happens after an exception
- is caught.
-
- The following code fragment prints "Error Action" followed
- by "Normal Action".
-
- test : Word ex:Number <<printf("Normal Action\n");>>
- exception[ex]
- catch NoViableAlt:
- <<printf("Error Action\n");>>
- ;
-
- The reason for "Normal Action" is that the normal flow of the
- program after a user-written exception handler is to "drop through".
- In the case of an exception handler for a rule this results in
- the exection of a "return" statement. In the case of an
- exception handler attached to an alternative, rule, or token
- this is the code that would have executed had there been no
- exception.
-
- The user can achieve the desired result by using a "return"
- statement.
-
- test : Word ex:Number <<printf("Normal Action\n");>>
- exception[ex]
- catch NoViableAlt:
- <<printf("Error Action\n"); return;>>
- ;
-
- The most powerful mechanism for recovery from parse errors
- in pccts is syntactic predicates because they provide
- backtracking. Exceptions allow "return", "break",
- "consumeUntil(...)", "goto _handler", "goto _fail", and
- changing the _signal value.
-
-#52. (Fixed in 1.33MR6) Exceptions without syntactic predicates
-
- The following generates bad code in 1.33 if no syntactic
- predicates are present in the grammar.
-
- test : Word ex:Number <<printf("Normal Action\n");>>
- exception[ex]
- catch NoViableAlt:
- <<printf("Error Action\n");>>
-
- There is a reference to a guess variable. In C mode
- this causes a compiler error. In C++ mode it generates
- an extraneous check on member "guessing".
-
- In MR6 correct code is generated for both C and C++ mode.
-
-#51. (Added to 1.33MR6) Exception operator "@" used without exceptions
-
- In MR6 added a warning when the exception operator "@" is
- used and no exception group is defined. This is probably
- a case where "\@" or "@" is meant.
-
-#50. (Fixed in 1.33MR6) Gunnar Rxnning (gunnar@candleweb.no)
- http://www.candleweb.no/~gunnar/
-
- Routines zzsave_antlr_state and zzrestore_antlr_state don't
- save and restore all the data needed when switching states.
-
- Suggested patch applied to antlr.h and err.h for MR6.
-
-#49. (Fixed in 1.33MR6) Sinan Karasu (sinan@boeing.com)
-
- Generated code failed to turn off guess mode when leaving a
- (...)+ block which contained a guess block. The result was
- an infinite loop. For example:
-
- rule : (
- (x)?
- | y
- )+
-
- Suggested code fix implemented in MR6. Replaced
-
- ... else if (zzcnt>1) break;
-
- with:
-
- C++ mode:
- ... else if (zzcnt>1) {if (!zzrv) zzGUESS_DONE; break;};
- C mode:
- ... else if (zzcnt>1) {if (zzguessing) zzGUESS_DONE; break;};
-
-#48. (Fixed in 1.33MR6) Invalid exception element causes core
-
- A label attached to an invalid construct can cause
- pccts to crash while processing the exception associated
- with the label. For example:
-
- rule : t:(B C)
- exception[t] catch MismatchedToken: <<printf(...);>>
-
- Version MR6 generates the message:
-
- reference in exception handler to undefined label 't'
-
-#47. (Fixed in 1.33MR6) Manuel Ornato
-
- Under some circumstances involving a k >1 or ck >1
- grammar and a loop block (i.e. (...)* ) pccts will
- fail to detect a syntax error and loop indefinitely.
- The problem did not exist in 1.20, but has existed
- from 1.23 to the present.
-
- Fixed in MR6.
-
- ---------------------------------------------------
- Complete test program
- ---------------------------------------------------
- #header<<
- #include <stdio.h>
- #include "charptr.h"
- >>
-
- <<
- #include "charptr.c"
- main ()
- {
- ANTLR(global(),stdin);
- }
- >>
-
- #token "[\ \t]+" << zzskip(); >>
- #token "[\n]" << zzline++; zzskip(); >>
-
- #token B "b"
- #token C "c"
- #token D "d"
- #token E "e"
- #token LP "\("
- #token RP "\)"
-
- #token ANTLREOF "@"
-
- global : (
- (E liste)
- | liste
- | listed
- ) ANTLREOF
- ;
-
- listeb : LP ( B ( B | C )* ) RP ;
- listec : LP ( C ( B | C )* ) RP ;
- listed : LP ( D ( B | C )* ) RP ;
- liste : ( listeb | listec )* ;
-
- ---------------------------------------------------
- Sample data causing infinite loop
- ---------------------------------------------------
- e (d c)
- ---------------------------------------------------
-
-#46. (Fixed in 1.33MR6) Robert Richter
- (Robert.Richter@infotech.tu-chemnitz.de)
-
- This item from the list of known problems was
- fixed by item #18 (below).
-
-#45. (Fixed in 1.33MR6) Brad Schick (schick@interaccess.com)
-
- The dependency scanner in VC++ mistakenly sees a
- reference to an MPW #include file even though properly
- #ifdef/#endif in config.h. The suggested workaround
- has been implemented:
-
- #ifdef MPW
- .....
- #define MPW_CursorCtl_Header <CursorCtl.h>
- #include MPW_CursorCtl_Header
- .....
- #endif
-
-#44. (Fixed in 1.33MR6) cast malloc() to (char *) in charptr.c
-
- Added (char *) cast for systems where malloc returns "void *".
-
-#43. (Added to 1.33MR6) Bruce Guenter (bruceg@qcc.sk.ca)
-
- Add setLeft() and setUp methods to ASTDoublyLinkedBase
- for symmetry with setRight() and setDown() methods.
-
-#42. (Fixed in 1.33MR6) Jeff Katcher (jkatcher@nortel.ca)
-
- C++ style comment in antlr.c corrected.
-
-#41. (Added in 1.33MR6) antlr -stdout
-
- Using "antlr -stdout ..." forces the text that would
- normally go to the grammar.c or grammar.cpp file to
- stdout.
-
-#40. (Added in 1.33MR6) antlr -tab to change tab stops
-
- Using "antlr -tab number ..." changes the tab stops
- for the grammar.c or grammar.cpp file. The number
- must be between 0 and 8. Using 0 gives tab characters,
- values between 1 and 8 give the appropriate number of
- space characters.
-
-#39. (Fixed in 1.33MR5) Jan Mikkelsen <janm@zeta.org.au>
-
- Commas in function prototype still not correct under
- some circumstances. Suggested code fix installed.
-
-#38. (Fixed in 1.33MR5) ANTLRTokenBuffer constructor
-
- Have ANTLRTokenBuffer ctor initialize member "parser" to null.
-
-#37. (Fixed in 1.33MR4) Bruce Guenter (bruceg@qcc.sk.ca)
-
- In ANTLRParser::FAIL(int k,...) released memory pointed to by
- f[i] (as well as f itself. Should only free f itself.
-
-#36. (Fixed in 1.33MR3) Cortland D. Starrett (cort@shay.ecn.purdue.edu)
-
- Neglected to properly declare isDLGmaxToken() when fixing problem
- reported by Andreas Magnusson.
-
- Undo "_retv=NULL;" change which caused problems for return values
- from rules whose return values weren't pointers.
-
- Failed to create bin directory if it didn't exist.
-
-#35. (Fixed in 1.33MR2) Andreas Magnusson
-(Andreas.Magnusson@mailbox.swipnet.se)
-
- Repair bug introduced by 1.33MR1 for #tokdefs. The original fix
- placed "DLGmaxToken=9999" and "DLGminToken=0" in the TokenType enum
- in order to fix a problem with an aggresive compiler assigning an 8
- bit enum which might be too narrow. This caused #tokdefs to assume
- that there were 9999 real tokens. The repair to the fix causes antlr to
- ignore TokenTypes "DLGmaxToken" and "DLGminToken" in a #tokdefs file.
-
-#34. (Added to 1.33MR1) Add public DLGLexerBase::set_line(int newValue)
-
- Previously there was no public function for changing the line
- number maintained by the lexer.
-
-#33. (Fixed in 1.33MR1) Franklin Chen (chen@adi.com)
-
- Accidental use of EXIT_FAILURE rather than PCCTS_EXIT_FAILURE
- in pccts/h/AParser.cpp.
-
-#32. (Fixed in 1.33MR1) Franklin Chen (chen@adi.com)
-
- In PCCTSAST.cpp lines 405 and 466: Change
-
- free (t)
- to
- free ( (char *)t );
-
- to match prototype.
-
-#31. (Added to 1.33MR1) Pointer to parser in ANTLRTokenBuffer
- Pointer to parser in DLGLexerBase
-
- The ANTLRTokenBuffer class now contains a pointer to the
- parser which is using it. This is established by the
- ANTLRParser constructor calling ANTLRTokenBuffer::
- setParser(ANTLRParser *p).
-
- When ANTLRTokenBuffer::setParser(ANTLRParser *p) is
- called it saves the pointer to the parser and then
- calls ANTLRTokenStream::setParser(ANTLRParser *p)
- so that the lexer can also save a pointer to the
- parser.
-
- There is also a function getParser() in each class
- with the obvious purpose.
-
- It is possible that these functions will return NULL
- under some circumstances (e.g. a non-DLG lexer is used).
-
-#30. (Added to 1.33MR1) function tokenName(int token) standard
-
- The generated parser class now includes the
- function:
-
- static const ANTLRChar * tokenName(int token)
-
- which returns a pointer to the "name" corresponding
- to the token.
-
- The base class (ANTLRParser) always includes the
- member function:
-
- const ANTLRChar * parserTokenName(int token)
-
- which can be accessed by objects which have a pointer
- to an ANTLRParser, but do not know the name of the
- parser class (e.g. ANTLRTokenBuffer and DLGLexerBase).
-
-#29. (Added to 1.33MR1) Debugging DLG lexers
-
- If the pre-processor symbol DEBUG_LEXER is defined
- then DLexerBase will include code for printing out
- key information about tokens which are recognized.
-
- The debug feature of the lexer is controlled by:
-
- int previousDebugValue=lexer.debugLexer(newValue);
-
- a value of 0 disables output
- a value of 1 enables output
-
- Even if the lexer debug code is compiled into DLexerBase
- it must be enabled before any output is generated. For
- example:
-
- DLGFileInput in(stdin);
- MyDLG lexer(&in,2000);
-
- lexer.setToken(&aToken);
-
- #if DEBUG_LEXER
- lexer.debugLexer(1); // enable debug information
- #endif
-
-#28. (Added to 1.33MR1) More control over DLG header
-
- Version 1.33MR1 adds the following directives to PCCTS
- for C++ mode:
-
- #lexprefix <<source code>>
-
- Adds source code to the DLGLexer.h file
- after the #include "DLexerBase.h" but
- before the start of the class definition.
-
- #lexmember <<source code>>
-
- Adds source code to the DLGLexer.h file
- as part of the DLGLexer class body. It
- appears immediately after the start of
- the class and a "public: statement.
-
-#27. (Fixed in 1.33MR1) Comments in DLG actions
-
- Previously, DLG would not recognize comments as a special case.
- Thus, ">>" in the comments would cause errors. This is fixed.
-
-#26. (Fixed in 1.33MR1) Removed static variables from error routines
-
- Previously, the existence of statically allocated variables
- in some of the parser's member functions posed a danger when
- there was more than one parser active.
-
- Replaced with dynamically allocated/freed variables in 1.33MR1.
-
-#25. (Fixed in 1.33MR1) Use of string literals in semantic predicates
-
- Previously, it was not possible to place a string literal in
- a semantic predicate because it was not properly "stringized"
- for the report of a failed predicate.
-
-#24. (Fixed in 1.33MR1) Continuation lines for semantic predicates
-
- Previously, it was not possible to continue semantic
- predicates across a line because it was not properly
- "stringized" for the report of a failed predicate.
-
- rule : <<ifXYZ()>>?[ a very
- long statement ]
-
-#23. (Fixed in 1.33MR1) {...} envelope for failed semantic predicates
-
- Previously, there was a code generation error for failed
- semantic predicates:
-
- rule : <<xyz()>>?[ stmt1; stmt2; ]
-
- which generated code which resembled:
-
- if (! xyz()) stmt1; stmt2;
-
- It now puts the statements in a {...} envelope:
-
- if (! xyz()) { stmt1; stmt2; };
-
-#22. (Fixed in 1.33MR1) Continuation of #token across lines using "\"
-
- Previously, it was not possible to continue a #token regular
- expression across a line. The trailing "\" and newline caused
- a newline to be inserted into the regular expression by DLG.
-
- Fixed in 1.33MR1.
-
-#21. (Fixed in 1.33MR1) Use of ">>" (right shift operator in DLG actions
-
- It is now possible to use the C++ right shift operator ">>"
- in DLG actions by using the normal escapes:
-
- #token "shift-right" << value=value \>\> 1;>>
-
-#20. (Version 1.33/19-Jan-97 Karl Eccleson <karle@microrobotics.co.uk>
- P.A. Keller (P.A.Keller@bath.ac.uk)
-
- There is a problem due to using exceptions with the -gh option.
-
- Suggested fix now in 1.33MR1.
-
-#19. (Fixed in 1.33MR1) Tom Piscotti and John Lilley
-
- There were problems suppressing messages to stdin and stdout
- when running in a window environment because some functions
- which uses fprint were not virtual.
-
- Suggested change now in 1.33MR1.
-
- I believe all functions containing error messages (excluding those
- indicating internal inconsistency) have been placed in functions
- which are virtual.
-
-#18. (Version 1.33/ 22-Nov-96) John Bair (jbair@iftime.com)
-
- Under some combination of options a required "return _retv" is
- not generated.
-
- Suggested fix now in 1.33MR1.
-
-#17. (Version 1.33/3-Sep-96) Ron House (house@helios.usq.edu.au)
-
- The routine ASTBase::predorder_action omits two "tree->"
- prefixes, which results in the preorder_action belonging
- to the wrong node to be invoked.
-
- Suggested fix now in 1.33MR1.
-
-#16. (Version 1.33/7-Jun-96) Eli Sternheim <eli@interhdl.com>
-
- Routine consumeUntilToken() does not check for end-of-file
- condition.
-
- Suggested fix now in 1.33MR1.
-
-#15. (Version 1.33/8 Apr 96) Asgeir Olafsson <olafsson@cstar.ac.com>
-
- Problem with tree duplication of doubly linked ASTs in ASTBase.cpp.
-
- Suggested fix now in 1.33MR1.
-
-#14. (Version 1.33/28-Feb-96) Andreas.Magnusson@mailbox.swipnet.se
-
- Problem with definition of operator = (const ANTLRTokenPtr rhs).
-
- Suggested fix now in 1.33MR1.
-
-#13. (Version 1.33/13-Feb-96) Franklin Chen (chen@adi.com)
-
- Sun C++ Compiler 3.0.1 can't compile testcpp/1 due to goto in
- block with destructors.
-
- Apparently fixed. Can't locate "goto".
-
-#12. (Version 1.33/10-Nov-95) Minor problems with 1.33 code
-
- The following items have been fixed in 1.33MR1:
-
- 1. pccts/antlr/main.c line 142
-
- "void" appears in classic C code
-
- 2. no makefile in support/genmk
-
- 3. EXIT_FAILURE/_SUCCESS instead of PCCTS_EXIT_FAILURE/_SUCCESS
-
- pccts/h/PCCTSAST.cpp
- pccts/h/DLexerBase.cpp
- pccts/testcpp/6/test.g
-
- 4. use of "signed int" isn't accepted by AT&T cfront
-
- pccts/h/PCCTSAST.h line 42
-
- 5. in call to ANTLRParser::FAIL the var arg err_k is passed as
- "int" but is declared "unsigned int".
-
- 6. I believe that a failed validation predicate still does not
- get put in a "{...}" envelope, despite the release notes.
-
- 7. The #token ">>" appearing in the DLG grammar description
- causes DLG to generate the string literal "\>\>" which
- is non-conforming and will cause some compilers to
- complain (scan.c function act10 line 143 of source code).
-
-#11. (Version 1.32b6) Dave Kuhlman (dkuhlman@netcom.com)
-
- Problem with file close in gen.c. Already fixed in 1.33.
-
-#10. (Version 1.32b6/29-Aug-95)
-
- pccts/antlr/main.c contains a C++ style comments on lines 149
- and 176 which causes problems for most C compilers.
-
- Already fixed in 1.33.
-
-#9. (Version 1.32b4/14-Mar-95) dlgauto.h #include "config.h"
-
- The file pccts/h/dlgauto.h should probably contain a #include
- "config.h" as it uses the #define symbol __USE_PROTOS.
-
- Added to 1.33MR1.
-
-#8. (Version 1.32b4/6-Mar-95) Michael T. Richter (mtr@igs.net)
-
- In C++ output mode anonymous tokens from in-line regular expressions
- can create enum values which are too wide for the datatype of the enum
- assigned by the C++ compiler.
-
- Fixed in 1.33MR1.
-
-#7. (Version 1.32b4/6-Mar-95) C++ does not imply __STDC__
-
- In err.h the combination of # directives assumes that a C++
- compiler has __STDC__ defined. This is not necessarily true.
-
- This problem also appears in the use of __USE_PROTOS which
- is appropriate for both Standard C and C++ in antlr/gen.c
- and antlr/lex.c
-
- Fixed in 1.33MR1.
-
-#6. (Version 1.32 ?/15-Feb-95) Name conflict for "TokenType"
-
- Already fixed in 1.33.
-
-#5. (23-Jan-95) Douglas_Cuthbertson.JTIDS@jtids_qmail.hanscom.af.mil
-
- The fail action following a semantic predicate is not enclosed in
- "{...}". This can lead to problems when the fail action contains
- more than one statement.
-
- Fixed in 1.33MR1.
-
-#4 . (Version 1.33/31-Mar-96) jlilley@empathy.com (John Lilley)
-
- Put briefly, a semantic predicate ought to abort a guess if it fails.
-
- Correction suggested by J. Lilley has been added to 1.33MR1.
-
-#3 . (Version 1.33) P.A.Keller@bath.ac.uk
-
- Extra commas are placed in the K&R style argument list for rules
- when using both exceptions and ASTs.
-
- Fixed in 1.33MR1.
-
-#2. (Version 1.32b6/2-Oct-95) Brad Schick <schick@interaccess.com>
-
- Construct #[] generates zzastnew() in C++ mode.
-
- Already fixed in 1.33.
-
-#1. (Version 1.33) Bob Bailey (robert@oakhill.sps.mot.com)
-
- Previously, config.h assumed that all PC systems required
- "short" file names. The user can now override that
- assumption with "#define LONGFILENAMES".
-
- Added to 1.33MR1.
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_SUMMARY.txt b/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_SUMMARY.txt
deleted file mode 100644
index 91defae169..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/CHANGES_SUMMARY.txt
+++ /dev/null
@@ -1,2049 +0,0 @@
-======================================================================
-
- CHANGES_SUMMARY.TXT
-
- A QUICK overview of changes from 1.33 in reverse order
-
- A summary of additions rather than bug fixes and minor code changes.
-
- Numbers refer to items in CHANGES_FROM_133*.TXT
- which may contain additional information.
-
- DISCLAIMER
-
- The software and these notes are provided "as is". They may include
- typographical or technical errors and their authors disclaims all
- liability of any kind or nature for damages due to error, fault,
- defect, or deficiency regardless of cause. All warranties of any
- kind, either express or implied, including, but not limited to, the
- implied warranties of merchantability and fitness for a particular
- purpose are disclaimed.
-
-======================================================================
-
-#258. You can specify a user-defined base class for your parser
-
- The base class must constructor must have a signature similar to
- that of ANTLRParser.
-
-#253. Generation of block preamble (-preamble and -preamble_first)
-
- The antlr option -preamble causes antlr to insert the code
- BLOCK_PREAMBLE at the start of each rule and block.
-
- The antlr option -preamble_first is similar, but inserts the
- code BLOCK_PREAMBLE_FIRST(PreambleFirst_123) where the symbol
- PreambleFirst_123 is equivalent to the first set defined by
- the #FirstSetSymbol described in Item #248.
-
-#248. Generate symbol for first set of an alternative
-
- rr : #FirstSetSymbol(rr_FirstSet) ( Foo | Bar ) ;
-
-#216. Defer token fetch for C++ mode
-
- When the ANTLRParser class is built with the pre-processor option
- ZZDEFER_FETCH defined, the fetch of new tokens by consume() is deferred
- until LA(i) or LT(i) is called.
-
-#215. Use reset() to reset DLGLexerBase
-#188. Added pccts/h/DLG_stream_input.h
-#180. Added ANTLRParser::getEofToken()
-#173. -glms for Microsoft style filenames with -gl
-#170. Suppression for predicates with lookahead depth >1
-
- Consider the following grammar with -ck 2 and the predicate in rule
- "a" with depth 2:
-
- r1 : (ab)* "@"
- ;
-
- ab : a
- | b
- ;
-
- a : (A B)? => <<p(LATEXT(2))>>? A B C
- ;
-
- b : A B C
- ;
-
- Normally, the predicate would be hoisted into rule r1 in order to
- determine whether to call rule "ab". However it should *not* be
- hoisted because, even if p is false, there is a valid alternative
- in rule b. With "-mrhoistk on" the predicate will be suppressed.
-
- If "-info p" command line option is present the following information
- will appear in the generated code:
-
- while ( (LA(1)==A)
- #if 0
-
- Part (or all) of predicate with depth > 1 suppressed by alternative
- without predicate
-
- pred << p(LATEXT(2))>>?
- depth=k=2 ("=>" guard) rule a line 8 t1.g
- tree context:
- (root = A
- B
- )
-
- The token sequence which is suppressed: ( A B )
- The sequence of references which generate that sequence of tokens:
-
- 1 to ab r1/1 line 1 t1.g
- 2 ab ab/1 line 4 t1.g
- 3 to b ab/2 line 5 t1.g
- 4 b b/1 line 11 t1.g
- 5 #token A b/1 line 11 t1.g
- 6 #token B b/1 line 11 t1.g
-
- #endif
-
- A slightly more complicated example:
-
- r1 : (ab)* "@"
- ;
-
- ab : a
- | b
- ;
-
- a : (A B)? => <<p(LATEXT(2))>>? (A B | D E)
- ;
-
- b : <<q(LATEXT(2))>>? D E
- ;
-
-
- In this case, the sequence (D E) in rule "a" which lies behind
- the guard is used to suppress the predicate with context (D E)
- in rule b.
-
- while ( (LA(1)==A || LA(1)==D)
- #if 0
-
- Part (or all) of predicate with depth > 1 suppressed by alternative
- without predicate
-
- pred << q(LATEXT(2))>>?
- depth=k=2 rule b line 11 t2.g
- tree context:
- (root = D
- E
- )
-
- The token sequence which is suppressed: ( D E )
- The sequence of references which generate that sequence of tokens:
-
- 1 to ab r1/1 line 1 t2.g
- 2 ab ab/1 line 4 t2.g
- 3 to a ab/1 line 4 t2.g
- 4 a a/1 line 8 t2.g
- 5 #token D a/1 line 8 t2.g
- 6 #token E a/1 line 8 t2.g
-
- #endif
- &&
- #if 0
-
- pred << p(LATEXT(2))>>?
- depth=k=2 ("=>" guard) rule a line 8 t2.g
- tree context:
- (root = A
- B
- )
-
- #endif
-
- (! ( LA(1)==A && LA(2)==B ) || p(LATEXT(2)) ) {
- ab();
- ...
-
-#165. (Changed in MR13) option -newAST
-
- To create ASTs from an ANTLRTokenPtr antlr usually calls
- "new AST(ANTLRTokenPtr)". This option generates a call
- to "newAST(ANTLRTokenPtr)" instead. This allows a user
- to define a parser member function to create an AST object.
-
-#161. (Changed in MR13) Switch -gxt inhibits generation of tokens.h
-
-#158. (Changed in MR13) #header causes problem for pre-processors
-
- A user who runs the C pre-processor on antlr source suggested
- that another syntax be allowed. With MR13 such directives
- such as #header, #pragma, etc. may be written as "\#header",
- "\#pragma", etc. For escaping pre-processor directives inside
- a #header use something like the following:
-
- \#header
- <<
- \#include <stdio.h>
- >>
-
-#155. (Changed in MR13) Context behind predicates can suppress
-
- With -mrhoist enabled the context behind a guarded predicate can
- be used to suppress other predicates. Consider the following grammar:
-
- r0 : (r1)+;
-
- r1 : rp
- | rq
- ;
- rp : <<p LATEXT(1)>>? B ;
- rq : (A)? => <<q LATEXT(1)>>? (A|B);
-
- In earlier versions both predicates "p" and "q" would be hoisted into
- rule r0. With MR12c predicate p is suppressed because the context which
- follows predicate q includes "B" which can "cover" predicate "p". In
- other words, in trying to decide in r0 whether to call r1, it doesn't
- really matter whether p is false or true because, either way, there is
- a valid choice within r1.
-
-#154. (Changed in MR13) Making hoist suppression explicit using <<nohoist>>
-
- A common error, even among experienced pccts users, is to code
- an init-action to inhibit hoisting rather than a leading action.
- An init-action does not inhibit hoisting.
-
- This was coded:
-
- rule1 : <<;>> rule2
-
- This is what was meant:
-
- rule1 : <<;>> <<;>> rule2
-
- With MR13, the user can code:
-
- rule1 : <<;>> <<nohoist>> rule2
-
- The following will give an error message:
-
- rule1 : <<nohoist>> rule2
-
- If the <<nohoist>> appears as an init-action rather than a leading
- action an error message is issued. The meaning of an init-action
- containing "nohoist" is unclear: does it apply to just one
- alternative or to all alternatives ?
-
-#151a. Addition of ANTLRParser::getLexer(), ANTLRTokenStream::getLexer()
-
- You must manually cast the ANTLRTokenStream to your program's
- lexer class. Because the name of the lexer's class is not fixed.
- Thus it is impossible to incorporate it into the DLGLexerBase
- class.
-
-#151b.(Changed in MR12) ParserBlackBox member getLexer()
-
-#150. (Changed in MR12) syntaxErrCount and lexErrCount now public
-
-#149. (Changed in MR12) antlr option -info o (letter o for orphan)
-
- If there is more than one rule which is not referenced by any
- other rule then all such rules are listed. This is useful for
- alerting one to rules which are not used, but which can still
- contribute to ambiguity.
-
-#148. (Changed in MR11) #token names appearing in zztokens,token_tbl
-
- One can write:
-
- #token Plus ("+") "\+"
- #token RP ("(") "\("
- #token COM ("comment begin") "/\*"
-
- The string in parenthesis will be used in syntax error messages.
-
-#146. (Changed in MR11) Option -treport for locating "difficult" alts
-
- It can be difficult to determine which alternatives are causing
- pccts to work hard to resolve an ambiguity. In some cases the
- ambiguity is successfully resolved after much CPU time so there
- is no message at all.
-
- A rough measure of the amount of work being peformed which is
- independent of the CPU speed and system load is the number of
- tnodes created. Using "-info t" gives information about the
- total number of tnodes created and the peak number of tnodes.
-
- Tree Nodes: peak 1300k created 1416k lost 0
-
- It also puts in the generated C or C++ file the number of tnodes
- created for a rule (at the end of the rule). However this
- information is not sufficient to locate the alternatives within
- a rule which are causing the creation of tnodes.
-
- Using:
-
- antlr -treport 100000 ....
-
- causes antlr to list on stdout any alternatives which require the
- creation of more than 100,000 tnodes, along with the lookahead sets
- for those alternatives.
-
- The following is a trivial case from the ansi.g grammar which shows
- the format of the report. This report might be of more interest
- in cases where 1,000,000 tuples were created to resolve the ambiguity.
-
- -------------------------------------------------------------------------
- There were 0 tuples whose ambiguity could not be resolved
- by full lookahead
- There were 157 tnodes created to resolve ambiguity between:
-
- Choice 1: statement/2 line 475 file ansi.g
- Choice 2: statement/3 line 476 file ansi.g
-
- Intersection of lookahead[1] sets:
-
- IDENTIFIER
-
- Intersection of lookahead[2] sets:
-
- LPARENTHESIS COLON AMPERSAND MINUS
- STAR PLUSPLUS MINUSMINUS ONESCOMPLEMENT
- NOT SIZEOF OCTALINT DECIMALINT
- HEXADECIMALINT FLOATONE FLOATTWO IDENTIFIER
- STRING CHARACTER
- -------------------------------------------------------------------------
-
-#143. (Changed in MR11) Optional ";" at end of #token statement
-
- Fixes problem of:
-
- #token X "x"
-
- <<
- parser action
- >>
-
- Being confused with:
-
- #token X "x" <<lexical action>>
-
-#142. (Changed in MR11) class BufFileInput subclass of DLGInputStream
-
- Alexey Demakov (demakov@kazbek.ispras.ru) has supplied class
- BufFileInput derived from DLGInputStream which provides a
- function lookahead(char *string) to test characters in the
- input stream more than one character ahead.
- The class is located in pccts/h/BufFileInput.* of the kit.
-
-#140. #pred to define predicates
-
- +---------------------------------------------------+
- | Note: Assume "-prc on" for this entire discussion |
- +---------------------------------------------------+
-
- A problem with predicates is that each one is regarded as
- unique and capable of disambiguating cases where two
- alternatives have identical lookahead. For example:
-
- rule : <<pred(LATEXT(1))>>? A
- | <<pred(LATEXT(1))>>? A
- ;
-
- will not cause any error messages or warnings to be issued
- by earlier versions of pccts. To compare the text of the
- predicates is an incomplete solution.
-
- In 1.33MR11 I am introducing the #pred statement in order to
- solve some problems with predicates. The #pred statement allows
- one to give a symbolic name to a "predicate literal" or a
- "predicate expression" in order to refer to it in other predicate
- expressions or in the rules of the grammar.
-
- The predicate literal associated with a predicate symbol is C
- or C++ code which can be used to test the condition. A
- predicate expression defines a predicate symbol in terms of other
- predicate symbols using "!", "&&", and "||". A predicate symbol
- can be defined in terms of a predicate literal, a predicate
- expression, or *both*.
-
- When a predicate symbol is defined with both a predicate literal
- and a predicate expression, the predicate literal is used to generate
- code, but the predicate expression is used to check for two
- alternatives with identical predicates in both alternatives.
-
- Here are some examples of #pred statements:
-
- #pred IsLabel <<isLabel(LATEXT(1))>>?
- #pred IsLocalVar <<isLocalVar(LATEXT(1))>>?
- #pred IsGlobalVar <<isGlobalVar(LATEXT(1)>>?
- #pred IsVar <<isVar(LATEXT(1))>>? IsLocalVar || IsGlobalVar
- #pred IsScoped <<isScoped(LATEXT(1))>>? IsLabel || IsLocalVar
-
- I hope that the use of EBNF notation to describe the syntax of the
- #pred statement will not cause problems for my readers (joke).
-
- predStatement : "#pred"
- CapitalizedName
- (
- "<<predicate_literal>>?"
- | "<<predicate_literal>>?" predOrExpr
- | predOrExpr
- )
- ;
-
- predOrExpr : predAndExpr ( "||" predAndExpr ) * ;
-
- predAndExpr : predPrimary ( "&&" predPrimary ) * ;
-
- predPrimary : CapitalizedName
- | "!" predPrimary
- | "(" predOrExpr ")"
- ;
-
- What is the purpose of this nonsense ?
-
- To understand how predicate symbols help, you need to realize that
- predicate symbols are used in two different ways with two different
- goals.
-
- a. Allow simplification of predicates which have been combined
- during predicate hoisting.
-
- b. Allow recognition of identical predicates which can't disambiguate
- alternatives with common lookahead.
-
- First we will discuss goal (a). Consider the following rule:
-
- rule0: rule1
- | ID
- | ...
- ;
-
- rule1: rule2
- | rule3
- ;
-
- rule2: <<isX(LATEXT(1))>>? ID ;
- rule3: <<!isX(LATEXT(1)>>? ID ;
-
- When the predicates in rule2 and rule3 are combined by hoisting
- to create a prediction expression for rule1 the result is:
-
- if ( LA(1)==ID
- && ( isX(LATEXT(1) || !isX(LATEXT(1) ) ) { rule1(); ...
-
- This is inefficient, but more importantly, can lead to false
- assumptions that the predicate expression distinguishes the rule1
- alternative with some other alternative with lookahead ID. In
- MR11 one can write:
-
- #pred IsX <<isX(LATEXT(1))>>?
-
- ...
-
- rule2: <<IsX>>? ID ;
- rule3: <<!IsX>>? ID ;
-
- During hoisting MR11 recognizes this as a special case and
- eliminates the predicates. The result is a prediction
- expression like the following:
-
- if ( LA(1)==ID ) { rule1(); ...
-
- Please note that the following cases which appear to be equivalent
- *cannot* be simplified by MR11 during hoisting because the hoisting
- logic only checks for a "!" in the predicate action, not in the
- predicate expression for a predicate symbol.
-
- *Not* equivalent and is not simplified during hoisting:
-
- #pred IsX <<isX(LATEXT(1))>>?
- #pred NotX <<!isX(LATEXT(1))>>?
- ...
- rule2: <<IsX>>? ID ;
- rule3: <<NotX>>? ID ;
-
- *Not* equivalent and is not simplified during hoisting:
-
- #pred IsX <<isX(LATEXT(1))>>?
- #pred NotX !IsX
- ...
- rule2: <<IsX>>? ID ;
- rule3: <<NotX>>? ID ;
-
- Now we will discuss goal (b).
-
- When antlr discovers that there is a lookahead ambiguity between
- two alternatives it attempts to resolve the ambiguity by searching
- for predicates in both alternatives. In the past any predicate
- would do, even if the same one appeared in both alternatives:
-
- rule: <<p(LATEXT(1))>>? X
- | <<p(LATEXT(1))>>? X
- ;
-
- The #pred statement is a start towards solving this problem.
- During ambiguity resolution (*not* predicate hoisting) the
- predicates for the two alternatives are expanded and compared.
- Consider the following example:
-
- #pred Upper <<isUpper(LATEXT(1))>>?
- #pred Lower <<isLower(LATEXT(1))>>?
- #pred Alpha <<isAlpha(LATEXT(1))>>? Upper || Lower
-
- rule0: rule1
- | <<Alpha>>? ID
- ;
-
- rule1:
- | rule2
- | rule3
- ...
- ;
-
- rule2: <<Upper>>? ID;
- rule3: <<Lower>>? ID;
-
- The definition of #pred Alpha expresses:
-
- a. to test the predicate use the C code "isAlpha(LATEXT(1))"
-
- b. to analyze the predicate use the information that
- Alpha is equivalent to the union of Upper and Lower,
-
- During ambiguity resolution the definition of Alpha is expanded
- into "Upper || Lower" and compared with the predicate in the other
- alternative, which is also "Upper || Lower". Because they are
- identical MR11 will report a problem.
-
- -------------------------------------------------------------------------
- t10.g, line 5: warning: the predicates used to disambiguate rule rule0
- (file t10.g alt 1 line 5 and alt 2 line 6)
- are identical when compared without context and may have no
- resolving power for some lookahead sequences.
- -------------------------------------------------------------------------
-
- If you use the "-info p" option the output file will contain:
-
- +----------------------------------------------------------------------+
- |#if 0 |
- | |
- |The following predicates are identical when compared without |
- | lookahead context information. For some ambiguous lookahead |
- | sequences they may not have any power to resolve the ambiguity. |
- | |
- |Choice 1: rule0/1 alt 1 line 5 file t10.g |
- | |
- | The original predicate for choice 1 with available context |
- | information: |
- | |
- | OR expr |
- | |
- | pred << Upper>>? |
- | depth=k=1 rule rule2 line 14 t10.g |
- | set context: |
- | ID |
- | |
- | pred << Lower>>? |
- | depth=k=1 rule rule3 line 15 t10.g |
- | set context: |
- | ID |
- | |
- | The predicate for choice 1 after expansion (but without context |
- | information): |
- | |
- | OR expr |
- | |
- | pred << isUpper(LATEXT(1))>>? |
- | depth=k=1 rule line 1 t10.g |
- | |
- | pred << isLower(LATEXT(1))>>? |
- | depth=k=1 rule line 2 t10.g |
- | |
- | |
- |Choice 2: rule0/2 alt 2 line 6 file t10.g |
- | |
- | The original predicate for choice 2 with available context |
- | information: |
- | |
- | pred << Alpha>>? |
- | depth=k=1 rule rule0 line 6 t10.g |
- | set context: |
- | ID |
- | |
- | The predicate for choice 2 after expansion (but without context |
- | information): |
- | |
- | OR expr |
- | |
- | pred << isUpper(LATEXT(1))>>? |
- | depth=k=1 rule line 1 t10.g |
- | |
- | pred << isLower(LATEXT(1))>>? |
- | depth=k=1 rule line 2 t10.g |
- | |
- | |
- |#endif |
- +----------------------------------------------------------------------+
-
- The comparison of the predicates for the two alternatives takes
- place without context information, which means that in some cases
- the predicates will be considered identical even though they operate
- on disjoint lookahead sets. Consider:
-
- #pred Alpha
-
- rule1: <<Alpha>>? ID
- | <<Alpha>>? Label
- ;
-
- Because the comparison of predicates takes place without context
- these will be considered identical. The reason for comparing
- without context is that otherwise it would be necessary to re-evaluate
- the entire predicate expression for each possible lookahead sequence.
- This would require more code to be written and more CPU time during
- grammar analysis, and it is not yet clear whether anyone will even make
- use of the new #pred facility.
-
- A temporary workaround might be to use different #pred statements
- for predicates you know have different context. This would avoid
- extraneous warnings.
-
- The above example might be termed a "false positive". Comparison
- without context will also lead to "false negatives". Consider the
- following example:
-
- #pred Alpha
- #pred Beta
-
- rule1: <<Alpha>>? A
- | rule2
- ;
-
- rule2: <<Alpha>>? A
- | <<Beta>>? B
- ;
-
- The predicate used for alt 2 of rule1 is (Alpha || Beta). This
- appears to be different than the predicate Alpha used for alt1.
- However, the context of Beta is B. Thus when the lookahead is A
- Beta will have no resolving power and Alpha will be used for both
- alternatives. Using the same predicate for both alternatives isn't
- very helpful, but this will not be detected with 1.33MR11.
-
- To properly handle this the predicate expression would have to be
- evaluated for each distinct lookahead context.
-
- To determine whether two predicate expressions are identical is
- difficult. The routine may fail to identify identical predicates.
-
- The #pred feature also compares predicates to see if a choice between
- alternatives which is resolved by a predicate which makes the second
- choice unreachable. Consider the following example:
-
- #pred A <<A(LATEXT(1)>>?
- #pred B <<B(LATEXT(1)>>?
- #pred A_or_B A || B
-
- r : s
- | t
- ;
- s : <<A_or_B>>? ID
- ;
- t : <<A>>? ID
- ;
-
- ----------------------------------------------------------------------------
- t11.g, line 5: warning: the predicate used to disambiguate the
- first choice of rule r
- (file t11.g alt 1 line 5 and alt 2 line 6)
- appears to "cover" the second predicate when compared without context.
- The second predicate may have no resolving power for some lookahead
- sequences.
- ----------------------------------------------------------------------------
-
-#132. (Changed in 1.33MR11) Recognition of identical predicates in alts
-
- Prior to 1.33MR11, there would be no ambiguity warning when the
- very same predicate was used to disambiguate both alternatives:
-
- test: ref B
- | ref C
- ;
-
- ref : <<pred(LATEXT(1)>>? A
-
- In 1.33MR11 this will cause the warning:
-
- warning: the predicates used to disambiguate rule test
- (file v98.g alt 1 line 1 and alt 2 line 2)
- are identical and have no resolving power
-
- ----------------- Note -----------------
-
- This is different than the following case
-
- test: <<pred(LATEXT(1))>>? A B
- | <<pred(LATEXT(1)>>? A C
- ;
-
- In this case there are two distinct predicates
- which have exactly the same text. In the first
- example there are two references to the same
- predicate. The problem represented by this
- grammar will be addressed later.
-
-
-#127. (Changed in 1.33MR11)
-
- Count Syntax Errors Count DLG Errors
- ------------------- ----------------
-
- C++ mode ANTLRParser:: DLGLexerBase::
- syntaxErrCount lexErrCount
- C mode zzSyntaxErrCount zzLexErrCount
-
- The C mode variables are global and initialized to 0.
- They are *not* reset to 0 automatically when antlr is
- restarted.
-
- The C++ mode variables are public. They are initialized
- to 0 by the constructors. They are *not* reset to 0 by the
- ANTLRParser::init() method.
-
- Suggested by Reinier van den Born (reinier@vnet.ibm.com).
-
-#126. (Changed in 1.33MR11) Addition of #first <<...>>
-
- The #first <<...>> inserts the specified text in the output
- files before any other #include statements required by pccts.
- The only things before the #first text are comments and
- a #define ANTLR_VERSION.
-
- Requested by and Esa Pulkkinen (esap@cs.tut.fi) and Alexin
- Zoltan (alexin@inf.u-szeged.hu).
-
-#124. A Note on the New "&&" Style Guarded Predicates
-
- I've been asked several times, "What is the difference between
- the old "=>" style guard predicates and the new style "&&" guard
- predicates, and how do you choose one over the other" ?
-
- The main difference is that the "=>" does not apply the
- predicate if the context guard doesn't match, whereas
- the && form always does. What is the significance ?
-
- If you have a predicate which is not on the "leading edge"
- it is cannot be hoisted. Suppose you need a predicate that
- looks at LA(2). You must introduce it manually. The
- classic example is:
-
- castExpr :
- LP typeName RP
- | ....
- ;
-
- typeName : <<isTypeName(LATEXT(1))>>? ID
- | STRUCT ID
- ;
-
- The problem is that isTypeName() isn't on the leading edge
- of typeName, so it won't be hoisted into castExpr to help
- make a decision on which production to choose.
-
- The *first* attempt to fix it is this:
-
- castExpr :
- <<isTypeName(LATEXT(2))>>?
- LP typeName RP
- | ....
- ;
-
- Unfortunately, this won't work because it ignores
- the problem of STRUCT. The solution is to apply
- isTypeName() in castExpr if LA(2) is an ID and
- don't apply it when LA(2) is STRUCT:
-
- castExpr :
- (LP ID)? => <<isTypeName(LATEXT(2))>>?
- LP typeName RP
- | ....
- ;
-
- In conclusion, the "=>" style guarded predicate is
- useful when:
-
- a. the tokens required for the predicate
- are not on the leading edge
- b. there are alternatives in the expression
- selected by the predicate for which the
- predicate is inappropriate
-
- If (b) were false, then one could use a simple
- predicate (assuming "-prc on"):
-
- castExpr :
- <<isTypeName(LATEXT(2))>>?
- LP typeName RP
- | ....
- ;
-
- typeName : <<isTypeName(LATEXT(1))>>? ID
- ;
-
- So, when do you use the "&&" style guarded predicate ?
-
- The new-style "&&" predicate should always be used with
- predicate context. The context guard is in ADDITION to
- the automatically computed context. Thus it useful for
- predicates which depend on the token type for reasons
- other than context.
-
- The following example is contributed by Reinier van den Born
- (reinier@vnet.ibm.com).
-
- +-------------------------------------------------------------------------+
- | This grammar has two ways to call functions: |
- | |
- | - a "standard" call syntax with parens and comma separated args |
- | - a shell command like syntax (no parens and spacing separated args) |
- | |
- | The former also allows a variable to hold the name of the function, |
- | the latter can also be used to call external commands. |
- | |
- | The grammar (simplified) looks like this: |
- | |
- | fun_call : ID "(" { expr ("," expr)* } ")" |
- | /* ID is function name */ |
- | | "@" ID "(" { expr ("," expr)* } ")" |
- | /* ID is var containing fun name */ |
- | ; |
- | |
- | command : ID expr* /* ID is function name */ |
- | | path expr* /* path is external command name */ |
- | ; |
- | |
- | path : ID /* left out slashes and such */ |
- | | "@" ID /* ID is environment var */ |
- | ; |
- | |
- | expr : .... |
- | | "(" expr ")"; |
- | |
- | call : fun_call |
- | | command |
- | ; |
- | |
- | Obviously the call is wildly ambiguous. This is more or less how this |
- | is to be resolved: |
- | |
- | A call begins with an ID or an @ followed by an ID. |
- | |
- | If it is an ID and if it is an ext. command name -> command |
- | if followed by a paren -> fun_call |
- | otherwise -> command |
- | |
- | If it is an @ and if the ID is a var name -> fun_call |
- | otherwise -> command |
- | |
- | One can implement these rules quite neatly using && predicates: |
- | |
- | call : ("@" ID)? && <<isVarName(LT(2))>>? fun_call |
- | | (ID)? && <<isExtCmdName>>? command |
- | | (ID "(")? fun_call |
- | | command |
- | ; |
- | |
- | This can be done better, so it is not an ideal example, but it |
- | conveys the principle. |
- +-------------------------------------------------------------------------+
-
-#122. (Changed in 1.33MR11) Member functions to reset DLG in C++ mode
-
- void DLGFileReset(FILE *f) { input = f; found_eof = 0; }
- void DLGStringReset(DLGChar *s) { input = s; p = &input[0]; }
-
- Supplied by R.A. Nelson (cowboy@VNET.IBM.COM)
-
-#119. (Changed in 1.33MR11) Ambiguity aid for grammars
-
- The user can ask for additional information on ambiguities reported
- by antlr to stdout. At the moment, only one ambiguity report can
- be created in an antlr run.
-
- This feature is enabled using the "-aa" (Ambiguity Aid) option.
-
- The following options control the reporting of ambiguities:
-
- -aa ruleName Selects reporting by name of rule
- -aa lineNumber Selects reporting by line number
- (file name not compared)
-
- -aam Selects "multiple" reporting for a token
- in the intersection set of the
- alternatives.
-
- For instance, the token ID may appear dozens
- of times in various paths as the program
- explores the rules which are reachable from
- the point of an ambiguity. With option -aam
- every possible path the search program
- encounters is reported.
-
- Without -aam only the first encounter is
- reported. This may result in incomplete
- information, but the information may be
- sufficient and much shorter.
-
- -aad depth Selects the depth of the search.
- The default value is 1.
-
- The number of paths to be searched, and the
- size of the report can grow geometrically
- with the -ck value if a full search for all
- contributions to the source of the ambiguity
- is explored.
-
- The depth represents the number of tokens
- in the lookahead set which are matched against
- the set of ambiguous tokens. A depth of 1
- means that the search stops when a lookahead
- sequence of just one token is matched.
-
- A k=1 ck=6 grammar might generate 5,000 items
- in a report if a full depth 6 search is made
- with the Ambiguity Aid. The source of the
- problem may be in the first token and obscured
- by the volume of data - I hesitate to call
- it information.
-
- When the user selects a depth > 1, the search
- is first performed at depth=1 for both
- alternatives, then depth=2 for both alternatives,
- etc.
-
- Sample output for rule grammar in antlr.g itself:
-
- +---------------------------------------------------------------------+
- | Ambiguity Aid |
- | |
- | Choice 1: grammar/70 line 632 file a.g |
- | Choice 2: grammar/82 line 644 file a.g |
- | |
- | Intersection of lookahead[1] sets: |
- | |
- | "\}" "class" "#errclass" "#tokclass" |
- | |
- | Choice:1 Depth:1 Group:1 ("#errclass") |
- | 1 in (...)* block grammar/70 line 632 a.g |
- | 2 to error grammar/73 line 635 a.g |
- | 3 error error/1 line 894 a.g |
- | 4 #token "#errclass" error/2 line 895 a.g |
- | |
- | Choice:1 Depth:1 Group:2 ("#tokclass") |
- | 2 to tclass grammar/74 line 636 a.g |
- | 3 tclass tclass/1 line 937 a.g |
- | 4 #token "#tokclass" tclass/2 line 938 a.g |
- | |
- | Choice:1 Depth:1 Group:3 ("class") |
- | 2 to class_def grammar/75 line 637 a.g |
- | 3 class_def class_def/1 line 669 a.g |
- | 4 #token "class" class_def/3 line 671 a.g |
- | |
- | Choice:1 Depth:1 Group:4 ("\}") |
- | 2 #token "\}" grammar/76 line 638 a.g |
- | |
- | Choice:2 Depth:1 Group:5 ("#errclass") |
- | 1 in (...)* block grammar/83 line 645 a.g |
- | 2 to error grammar/93 line 655 a.g |
- | 3 error error/1 line 894 a.g |
- | 4 #token "#errclass" error/2 line 895 a.g |
- | |
- | Choice:2 Depth:1 Group:6 ("#tokclass") |
- | 2 to tclass grammar/94 line 656 a.g |
- | 3 tclass tclass/1 line 937 a.g |
- | 4 #token "#tokclass" tclass/2 line 938 a.g |
- | |
- | Choice:2 Depth:1 Group:7 ("class") |
- | 2 to class_def grammar/95 line 657 a.g |
- | 3 class_def class_def/1 line 669 a.g |
- | 4 #token "class" class_def/3 line 671 a.g |
- | |
- | Choice:2 Depth:1 Group:8 ("\}") |
- | 2 #token "\}" grammar/96 line 658 a.g |
- +---------------------------------------------------------------------+
-
- For a linear lookahead set ambiguity (where k=1 or for k>1 but
- when all lookahead sets [i] with i<k all have degree one) the
- reports appear in the following order:
-
- for (depth=1 ; depth <= "-aad depth" ; depth++) {
- for (alternative=1; alternative <=2 ; alternative++) {
- while (matches-are-found) {
- group++;
- print-report
- };
- };
- };
-
- For reporting a k-tuple ambiguity, the reports appear in the
- following order:
-
- for (depth=1 ; depth <= "-aad depth" ; depth++) {
- while (matches-are-found) {
- for (alternative=1; alternative <=2 ; alternative++) {
- group++;
- print-report
- };
- };
- };
-
- This is because matches are generated in different ways for
- linear lookahead and k-tuples.
-
-#117. (Changed in 1.33MR10) new EXPERIMENTAL predicate hoisting code
-
- The hoisting of predicates into rules to create prediction
- expressions is a problem in antlr. Consider the following
- example (k=1 with -prc on):
-
- start : (a)* "@" ;
- a : b | c ;
- b : <<isUpper(LATEXT(1))>>? A ;
- c : A ;
-
- Prior to 1.33MR10 the code generated for "start" would resemble:
-
- while {
- if (LA(1)==A &&
- (!LA(1)==A || isUpper())) {
- a();
- }
- };
-
- This code is wrong because it makes rule "c" unreachable from
- "start". The essence of the problem is that antlr fails to
- recognize that there can be a valid alternative within "a" even
- when the predicate <<isUpper(LATEXT(1))>>? is false.
-
- In 1.33MR10 with -mrhoist the hoisting of the predicate into
- "start" is suppressed because it recognizes that "c" can
- cover all the cases where the predicate is false:
-
- while {
- if (LA(1)==A) {
- a();
- }
- };
-
- With the antlr "-info p" switch the user will receive information
- about the predicate suppression in the generated file:
-
- --------------------------------------------------------------
- #if 0
-
- Hoisting of predicate suppressed by alternative without predicate.
- The alt without the predicate includes all cases where
- the predicate is false.
-
- WITH predicate: line 7 v1.g
- WITHOUT predicate: line 7 v1.g
-
- The context set for the predicate:
-
- A
-
- The lookahead set for the alt WITHOUT the semantic predicate:
-
- A
-
- The predicate:
-
- pred << isUpper(LATEXT(1))>>?
- depth=k=1 rule b line 9 v1.g
- set context:
- A
- tree context: null
-
- Chain of referenced rules:
-
- #0 in rule start (line 5 v1.g) to rule a
- #1 in rule a (line 7 v1.g)
-
- #endif
- --------------------------------------------------------------
-
- A predicate can be suppressed by a combination of alternatives
- which, taken together, cover a predicate:
-
- start : (a)* "@" ;
-
- a : b | ca | cb | cc ;
-
- b : <<isUpper(LATEXT(1))>>? ( A | B | C ) ;
-
- ca : A ;
- cb : B ;
- cc : C ;
-
- Consider a more complex example in which "c" covers only part of
- a predicate:
-
- start : (a)* "@" ;
-
- a : b
- | c
- ;
-
- b : <<isUpper(LATEXT(1))>>?
- ( A
- | X
- );
-
- c : A
- ;
-
- Prior to 1.33MR10 the code generated for "start" would resemble:
-
- while {
- if ( (LA(1)==A || LA(1)==X) &&
- (! (LA(1)==A || LA(1)==X) || isUpper()) {
- a();
- }
- };
-
- With 1.33MR10 and -mrhoist the predicate context is restricted to
- the non-covered lookahead. The code resembles:
-
- while {
- if ( (LA(1)==A || LA(1)==X) &&
- (! (LA(1)==X) || isUpper()) {
- a();
- }
- };
-
- With the antlr "-info p" switch the user will receive information
- about the predicate restriction in the generated file:
-
- --------------------------------------------------------------
- #if 0
-
- Restricting the context of a predicate because of overlap
- in the lookahead set between the alternative with the
- semantic predicate and one without
- Without this restriction the alternative without the predicate
- could not be reached when input matched the context of the
- predicate and the predicate was false.
-
- WITH predicate: line 11 v4.g
- WITHOUT predicate: line 12 v4.g
-
- The original context set for the predicate:
-
- A X
-
- The lookahead set for the alt WITHOUT the semantic predicate:
-
- A
-
- The intersection of the two sets
-
- A
-
- The original predicate:
-
- pred << isUpper(LATEXT(1))>>?
- depth=k=1 rule b line 15 v4.g
- set context:
- A X
- tree context: null
-
- The new (modified) form of the predicate:
-
- pred << isUpper(LATEXT(1))>>?
- depth=k=1 rule b line 15 v4.g
- set context:
- X
- tree context: null
-
- #endif
- --------------------------------------------------------------
-
- The bad news about -mrhoist:
-
- (a) -mrhoist does not analyze predicates with lookahead
- depth > 1.
-
- (b) -mrhoist does not look past a guarded predicate to
- find context which might cover other predicates.
-
- For these cases you might want to use syntactic predicates.
- When a semantic predicate fails during guess mode the guess
- fails and the next alternative is tried.
-
- Limitation (a) is illustrated by the following example:
-
- start : (stmt)* EOF ;
-
- stmt : cast
- | expr
- ;
- cast : <<isTypename(LATEXT(2))>>? LP ID RP ;
-
- expr : LP ID RP ;
-
- This is not much different from the first example, except that
- it requires two tokens of lookahead context to determine what
- to do. This predicate is NOT suppressed because the current version
- is unable to handle predicates with depth > 1.
-
- A predicate can be combined with other predicates during hoisting.
- In those cases the depth=1 predicates are still handled. Thus,
- in the following example the isUpper() predicate will be suppressed
- by line #4 when hoisted from "bizarre" into "start", but will still
- be present in "bizarre" in order to predict "stmt".
-
- start : (bizarre)* EOF ; // #1
- // #2
- bizarre : stmt // #3
- | A // #4
- ;
-
- stmt : cast
- | expr
- ;
-
- cast : <<isTypename(LATEXT(2))>>? LP ID RP ;
-
- expr : LP ID RP ;
- | <<isUpper(LATEXT(1))>>? A
-
- Limitation (b) is illustrated by the following example of a
- context guarded predicate:
-
- rule : (A)? <<p>>? // #1
- (A // #2
- |B // #3
- ) // #4
- | <<q>> B // #5
- ;
-
- Recall that this means that when the lookahead is NOT A then
- the predicate "p" is ignored and it attempts to match "A|B".
- Ideally, the "B" at line #3 should suppress predicate "q".
- However, the current version does not attempt to look past
- the guard predicate to find context which might suppress other
- predicates.
-
- In some cases -mrhoist will lead to the reporting of ambiguities
- which were not visible before:
-
- start : (a)* "@";
- a : bc | d;
- bc : b | c ;
-
- b : <<isUpper(LATEXT(1))>>? A;
- c : A ;
-
- d : A ;
-
- In this case there is a true ambiguity in "a" between "bc" and "d"
- which can both match "A". Without -mrhoist the predicate in "b"
- is hoisted into "a" and there is no ambiguity reported. However,
- with -mrhoist, the predicate in "b" is suppressed by "c" (as it
- should be) making the ambiguity in "a" apparent.
-
- The motivations for these changes were hoisting problems reported
- by Reinier van den Born (reinier@vnet.ibm.com) and several others.
-
-#113. (Changed in 1.33MR10) new context guarded pred: (g)? && <<p>>? expr
-
- The existing context guarded predicate:
-
- rule : (guard)? => <<p>>? expr
- | next_alternative
- ;
-
- generates code which resembles:
-
- if (lookahead(expr) && (!guard || pred)) {
- expr()
- } else ....
-
- This is not suitable for some applications because it allows
- expr() to be invoked when the predicate is false. This is
- intentional because it is meant to mimic automatically computed
- predicate context.
-
- The new context guarded predicate uses the guard information
- differently because it has a different goal. Consider:
-
- rule : (guard)? && <<p>>? expr
- | next_alternative
- ;
-
- The new style of context guarded predicate is equivalent to:
-
- rule : <<guard==true && pred>>? expr
- | next_alternative
- ;
-
- It generates code which resembles:
-
- if (lookahead(expr) && guard && pred) {
- expr();
- } else ...
-
- Both forms of guarded predicates severely restrict the form of
- the context guard: it can contain no rule references, no
- (...)*, no (...)+, and no {...}. It may contain token and
- token class references, and alternation ("|").
-
- Addition for 1.33MR11: in the token expression all tokens must
- be at the same height of the token tree:
-
- (A ( B | C))? && ... is ok (all height 2)
- (A ( B | ))? && ... is not ok (some 1, some 2)
- (A B C D | E F G H)? && ... is ok (all height 4)
- (A B C D | E )? && ... is not ok (some 4, some 1)
-
- This restriction is required in order to properly compute the lookahead
- set for expressions like:
-
- rule1 : (A B C)? && <<pred>>? rule2 ;
- rule2 : (A|X) (B|Y) (C|Z);
-
- This addition was suggested by Rienier van den Born (reinier@vnet.ibm.com)
-
-#109. (Changed in 1.33MR10) improved trace information
-
- The quality of the trace information provided by the "-gd"
- switch has been improved significantly. Here is an example
- of the output from a test program. It shows the rule name,
- the first token of lookahead, the call depth, and the guess
- status:
-
- exit rule gusxx {"?"} depth 2
- enter rule gusxx {"?"} depth 2
- enter rule gus1 {"o"} depth 3 guessing
- guess done - returning to rule gus1 {"o"} at depth 3
- (guess mode continues - an enclosing guess is still active)
- guess done - returning to rule gus1 {"Z"} at depth 3
- (guess mode continues - an enclosing guess is still active)
- exit rule gus1 {"Z"} depth 3 guessing
- guess done - returning to rule gusxx {"o"} at depth 2 (guess mode ends)
- enter rule gus1 {"o"} depth 3
- guess done - returning to rule gus1 {"o"} at depth 3 (guess mode ends)
- guess done - returning to rule gus1 {"Z"} at depth 3 (guess mode ends)
- exit rule gus1 {"Z"} depth 3
- line 1: syntax error at "Z" missing SC
- ...
-
- Rule trace reporting is controlled by the value of the integer
- [zz]traceOptionValue: when it is positive tracing is enabled,
- otherwise it is disabled. Tracing during guess mode is controlled
- by the value of the integer [zz]traceGuessOptionValue. When
- it is positive AND [zz]traceOptionValue is positive rule trace
- is reported in guess mode.
-
- The values of [zz]traceOptionValue and [zz]traceGuessOptionValue
- can be adjusted by subroutine calls listed below.
-
- Depending on the presence or absence of the antlr -gd switch
- the variable [zz]traceOptionValueDefault is set to 0 or 1. When
- the parser is initialized or [zz]traceReset() is called the
- value of [zz]traceOptionValueDefault is copied to [zz]traceOptionValue.
- The value of [zz]traceGuessOptionValue is always initialzed to 1,
- but, as noted earlier, nothing will be reported unless
- [zz]traceOptionValue is also positive.
-
- When the parser state is saved/restored the value of the trace
- variables are also saved/restored. If a restore causes a change in
- reporting behavior from on to off or vice versa this will be reported.
-
- When the -gd option is selected, the macro "#define zzTRACE_RULES"
- is added to appropriate output files.
-
- C++ mode
- --------
- int traceOption(int delta)
- int traceGuessOption(int delta)
- void traceReset()
- int traceOptionValueDefault
-
- C mode
- --------
- int zzTraceOption(int delta)
- int zzTraceGuessOption(int delta)
- void zzTraceReset()
- int zzTraceOptionValueDefault
-
- The argument "delta" is added to the traceOptionValue. To
- turn on trace when inside a particular rule one:
-
- rule : <<traceOption(+1);>>
- (
- rest-of-rule
- )
- <<traceOption(-1);>>
- ; /* fail clause */ <<traceOption(-1);>>
-
- One can use the same idea to turn *off* tracing within a
- rule by using a delta of (-1).
-
- An improvement in the rule trace was suggested by Sramji
- Ramanathan (ps@kumaran.com).
-
-#108. A Note on Deallocation of Variables Allocated in Guess Mode
-
- NOTE
- ------------------------------------------------------
- This mechanism only works for heap allocated variables
- ------------------------------------------------------
-
- The rewrite of the trace provides the machinery necessary
- to properly free variables or undo actions following a
- failed guess.
-
- The macro zzUSER_GUESS_HOOK(guessSeq,zzrv) is expanded
- as part of the zzGUESS macro. When a guess is opened
- the value of zzrv is 0. When a longjmp() is executed to
- undo the guess, the value of zzrv will be 1.
-
- The macro zzUSER_GUESS_DONE_HOOK(guessSeq) is expanded
- as part of the zzGUESS_DONE macro. This is executed
- whether the guess succeeds or fails as part of closing
- the guess.
-
- The guessSeq is a sequence number which is assigned to each
- guess and is incremented by 1 for each guess which becomes
- active. It is needed by the user to associate the start of
- a guess with the failure and/or completion (closing) of a
- guess.
-
- Guesses are nested. They must be closed in the reverse
- of the order that they are opened.
-
- In order to free memory used by a variable during a guess
- a user must write a routine which can be called to
- register the variable along with the current guess sequence
- number provided by the zzUSER_GUESS_HOOK macro. If the guess
- fails, all variables tagged with the corresponding guess
- sequence number should be released. This is ugly, but
- it would require a major rewrite of antlr 1.33 to use
- some mechanism other than setjmp()/longjmp().
-
- The order of calls for a *successful* guess would be:
-
- zzUSER_GUESS_HOOK(guessSeq,0);
- zzUSER_GUESS_DONE_HOOK(guessSeq);
-
- The order of calls for a *failed* guess would be:
-
- zzUSER_GUESS_HOOK(guessSeq,0);
- zzUSER_GUESS_HOOK(guessSeq,1);
- zzUSER_GUESS_DONE_HOOK(guessSeq);
-
- The default definitions of these macros are empty strings.
-
- Here is an example in C++ mode. The zzUSER_GUESS_HOOK and
- zzUSER_GUESS_DONE_HOOK macros and myGuessHook() routine
- can be used without change in both C and C++ versions.
-
- ----------------------------------------------------------------------
- <<
-
- #include "AToken.h"
-
- typedef ANTLRCommonToken ANTLRToken;
-
- #include "DLGLexer.h"
-
- int main() {
-
- {
- DLGFileInput in(stdin);
- DLGLexer lexer(&in,2000);
- ANTLRTokenBuffer pipe(&lexer,1);
- ANTLRCommonToken aToken;
- P parser(&pipe);
-
- lexer.setToken(&aToken);
- parser.init();
- parser.start();
- };
-
- fclose(stdin);
- fclose(stdout);
- return 0;
- }
-
- >>
-
- <<
- char *s=NULL;
-
- #undef zzUSER_GUESS_HOOK
- #define zzUSER_GUESS_HOOK(guessSeq,zzrv) myGuessHook(guessSeq,zzrv);
- #undef zzUSER_GUESS_DONE_HOOK
- #define zzUSER_GUESS_DONE_HOOK(guessSeq) myGuessHook(guessSeq,2);
-
- void myGuessHook(int guessSeq,int zzrv) {
- if (zzrv == 0) {
- fprintf(stderr,"User hook: starting guess #%d\n",guessSeq);
- } else if (zzrv == 1) {
- free (s);
- s=NULL;
- fprintf(stderr,"User hook: failed guess #%d\n",guessSeq);
- } else if (zzrv == 2) {
- free (s);
- s=NULL;
- fprintf(stderr,"User hook: ending guess #%d\n",guessSeq);
- };
- }
-
- >>
-
- #token A "a"
- #token "[\t \ \n]" <<skip();>>
-
- class P {
-
- start : (top)+
- ;
-
- top : (which) ? <<fprintf(stderr,"%s is a which\n",s); free(s); s=NULL; >>
- | other <<fprintf(stderr,"%s is an other\n",s); free(s); s=NULL; >>
- ; <<if (s != NULL) free(s); s=NULL; >>
-
- which : which2
- ;
-
- which2 : which3
- ;
- which3
- : (label)? <<fprintf(stderr,"%s is a label\n",s);>>
- | (global)? <<fprintf(stderr,"%s is a global\n",s);>>
- | (exclamation)? <<fprintf(stderr,"%s is an exclamation\n",s);>>
- ;
-
- label : <<s=strdup(LT(1)->getText());>> A ":" ;
-
- global : <<s=strdup(LT(1)->getText());>> A "::" ;
-
- exclamation : <<s=strdup(LT(1)->getText());>> A "!" ;
-
- other : <<s=strdup(LT(1)->getText());>> "other" ;
-
- }
- ----------------------------------------------------------------------
-
- This is a silly example, but illustrates the idea. For the input
- "a ::" with tracing enabled the output begins:
-
- ----------------------------------------------------------------------
- enter rule "start" depth 1
- enter rule "top" depth 2
- User hook: starting guess #1
- enter rule "which" depth 3 guessing
- enter rule "which2" depth 4 guessing
- enter rule "which3" depth 5 guessing
- User hook: starting guess #2
- enter rule "label" depth 6 guessing
- guess failed
- User hook: failed guess #2
- guess done - returning to rule "which3" at depth 5 (guess mode continues
- - an enclosing guess is still active)
- User hook: ending guess #2
- User hook: starting guess #3
- enter rule "global" depth 6 guessing
- exit rule "global" depth 6 guessing
- guess done - returning to rule "which3" at depth 5 (guess mode continues
- - an enclosing guess is still active)
- User hook: ending guess #3
- enter rule "global" depth 6 guessing
- exit rule "global" depth 6 guessing
- exit rule "which3" depth 5 guessing
- exit rule "which2" depth 4 guessing
- exit rule "which" depth 3 guessing
- guess done - returning to rule "top" at depth 2 (guess mode ends)
- User hook: ending guess #1
- enter rule "which" depth 3
- .....
- ----------------------------------------------------------------------
-
- Remember:
-
- (a) Only init-actions are executed during guess mode.
- (b) A rule can be invoked multiple times during guess mode.
- (c) If the guess succeeds the rule will be called once more
- without guess mode so that normal actions will be executed.
- This means that the init-action might need to distinguish
- between guess mode and non-guess mode using the variable
- [zz]guessing.
-
-#101. (Changed in 1.33MR10) antlr -info command line switch
-
- -info
-
- p - extra predicate information in generated file
-
- t - information about tnode use:
- at the end of each rule in generated file
- summary on stderr at end of program
-
- m - monitor progress
- prints name of each rule as it is started
- flushes output at start of each rule
-
- f - first/follow set information to stdout
-
- 0 - no operation (added in 1.33MR11)
-
- The options may be combined and may appear in any order.
- For example:
-
- antlr -info ptm -CC -gt -mrhoist on mygrammar.g
-
-#100a. (Changed in 1.33MR10) Predicate tree simplification
-
- When the same predicates can be referenced in more than one
- alternative of a block large predicate trees can be formed.
-
- The difference that these optimizations make is so dramatic
- that I have decided to use it even when -mrhoist is not selected.
-
- Consider the following grammar:
-
- start : ( all )* ;
-
- all : a
- | d
- | e
- | f
- ;
-
- a : c A B
- | c A C
- ;
-
- c : <<AAA(LATEXT(2))>>?
- ;
-
- d : <<BBB(LATEXT(2))>>? B C
- ;
-
- e : <<CCC(LATEXT(2))>>? B C
- ;
-
- f : e X Y
- ;
-
- In rule "a" there is a reference to rule "c" in both alternatives.
- The length of the predicate AAA is k=2 and it can be followed in
- alternative 1 only by (A B) while in alternative 2 it can be
- followed only by (A C). Thus they do not have identical context.
-
- In rule "all" the alternatives which refer to rules "e" and "f" allow
- elimination of the duplicate reference to predicate CCC.
-
- The table below summarized the kind of simplification performed by
- 1.33MR10. In the table, X and Y stand for single predicates
- (not trees).
-
- (OR X (OR Y (OR Z))) => (OR X Y Z)
- (AND X (AND Y (AND Z))) => (AND X Y Z)
-
- (OR X (... (OR X Y) ... )) => (OR X (... Y ... ))
- (AND X (... (AND X Y) ... )) => (AND X (... Y ... ))
- (OR X (... (AND X Y) ... )) => (OR X (... ... ))
- (AND X (... (OR X Y) ... )) => (AND X (... ... ))
-
- (AND X) => X
- (OR X) => X
-
- In a test with a complex grammar for a real application, a predicate
- tree with six OR nodes and 12 leaves was reduced to "(OR X Y Z)".
-
- In 1.33MR10 there is a greater effort to release memory used
- by predicates once they are no longer in use.
-
-#100b. (Changed in 1.33MR10) Suppression of extra predicate tests
-
- The following optimizations require that -mrhoist be selected.
-
- It is relatively easy to optimize the code generated for predicate
- gates when they are of the form:
-
- (AND X Y Z ...)
- or (OR X Y Z ...)
-
- where X, Y, Z, and "..." represent individual predicates (leaves) not
- predicate trees.
-
- If the predicate is an AND the contexts of the X, Y, Z, etc. are
- ANDed together to create a single Tree context for the group and
- context tests for the individual predicates are suppressed:
-
- --------------------------------------------------
- Note: This was incorrect. The contexts should be
- ORed together. This has been fixed. A more
- complete description is available in item #152.
- ---------------------------------------------------
-
- Optimization 1: (AND X Y Z ...)
-
- Suppose the context for Xtest is LA(1)==LP and the context for
- Ytest is LA(1)==LP && LA(2)==ID.
-
- Without the optimization the code would resemble:
-
- if (lookaheadContext &&
- !(LA(1)==LP && LA(1)==LP && LA(2)==ID) ||
- ( (! LA(1)==LP || Xtest) &&
- (! (LA(1)==LP || LA(2)==ID) || Xtest)
- )) {...
-
- With the -mrhoist optimization the code would resemble:
-
- if (lookaheadContext &&
- ! (LA(1)==LP && LA(2)==ID) || (Xtest && Ytest) {...
-
- Optimization 2: (OR X Y Z ...) with identical contexts
-
- Suppose the context for Xtest is LA(1)==ID and for Ytest
- the context is also LA(1)==ID.
-
- Without the optimization the code would resemble:
-
- if (lookaheadContext &&
- ! (LA(1)==ID || LA(1)==ID) ||
- (LA(1)==ID && Xtest) ||
- (LA(1)==ID && Ytest) {...
-
- With the -mrhoist optimization the code would resemble:
-
- if (lookaheadContext &&
- (! LA(1)==ID) || (Xtest || Ytest) {...
-
- Optimization 3: (OR X Y Z ...) with distinct contexts
-
- Suppose the context for Xtest is LA(1)==ID and for Ytest
- the context is LA(1)==LP.
-
- Without the optimization the code would resemble:
-
- if (lookaheadContext &&
- ! (LA(1)==ID || LA(1)==LP) ||
- (LA(1)==ID && Xtest) ||
- (LA(1)==LP && Ytest) {...
-
- With the -mrhoist optimization the code would resemble:
-
- if (lookaheadContext &&
- (zzpf=0,
- (LA(1)==ID && (zzpf=1) && Xtest) ||
- (LA(1)==LP && (zzpf=1) && Ytest) ||
- !zzpf) {
-
- These may appear to be of similar complexity at first,
- but the non-optimized version contains two tests of each
- context while the optimized version contains only one
- such test, as well as eliminating some of the inverted
- logic (" !(...) || ").
-
- Optimization 4: Computation of predicate gate trees
-
- When generating code for the gates of predicate expressions
- antlr 1.33 vanilla uses a recursive procedure to generate
- "&&" and "||" expressions for testing the lookahead. As each
- layer of the predicate tree is exposed a new set of "&&" and
- "||" expressions on the lookahead are generated. In many
- cases the lookahead being tested has already been tested.
-
- With -mrhoist a lookahead tree is computed for the entire
- lookahead expression. This means that predicates with identical
- context or context which is a subset of another predicate's
- context disappear.
-
- This is especially important for predicates formed by rules
- like the following:
-
- uppperCaseVowel : <<isUpperCase(LATEXT(1))>>? vowel;
- vowel: : <<isVowel(LATEXT(1))>>? LETTERS;
-
- These predicates are combined using AND since both must be
- satisfied for rule upperCaseVowel. They have identical
- context which makes this optimization very effective.
-
- The affect of Items #100a and #100b together can be dramatic. In
- a very large (but real world) grammar one particular predicate
- expression was reduced from an (unreadable) 50 predicate leaves,
- 195 LA(1) terms, and 5500 characters to an (easily comprehensible)
- 3 predicate leaves (all different) and a *single* LA(1) term.
-
-#98. (Changed in 1.33MR10) Option "-info p"
-
- When the user selects option "-info p" the program will generate
- detailed information about predicates. If the user selects
- "-mrhoist on" additional detail will be provided explaining
- the promotion and suppression of predicates. The output is part
- of the generated file and sandwiched between #if 0/#endif statements.
-
- Consider the following k=1 grammar:
-
- start : ( all ) * ;
-
- all : ( a
- | b
- )
- ;
-
- a : c B
- ;
-
- c : <<LATEXT(1)>>?
- | B
- ;
-
- b : <<LATEXT(1)>>? X
- ;
-
- Below is an excerpt of the output for rule "start" for the three
- predicate options (off, on, and maintenance release style hoisting).
-
- For those who do not wish to use the "-mrhoist on" option for code
- generation the option can be used in a "diagnostic" mode to provide
- valuable information:
-
- a. where one should insert null actions to inhibit hoisting
- b. a chain of rule references which shows where predicates are
- being hoisted
-
- ======================================================================
- Example of "-info p" with "-mrhoist on"
- ======================================================================
- #if 0
-
- Hoisting of predicate suppressed by alternative without predicate.
- The alt without the predicate includes all cases where the
- predicate is false.
-
- WITH predicate: line 11 v36.g
- WITHOUT predicate: line 12 v36.g
-
- The context set for the predicate:
-
- B
-
- The lookahead set for alt WITHOUT the semantic predicate:
-
- B
-
- The predicate:
-
- pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g
-
- set context:
- B
- tree context: null
-
- Chain of referenced rules:
-
- #0 in rule start (line 1 v36.g) to rule all
- #1 in rule all (line 3 v36.g) to rule a
- #2 in rule a (line 8 v36.g) to rule c
- #3 in rule c (line 11 v36.g)
-
- #endif
- &&
- #if 0
-
- pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g
-
- set context:
- X
- tree context: null
-
- #endif
- ======================================================================
- Example of "-info p" with the default -prc setting ( "-prc off")
- ======================================================================
- #if 0
-
- OR
- pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g
-
- set context:
- nil
- tree context: null
-
- pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g
-
- set context:
- nil
- tree context: null
-
- #endif
- ======================================================================
- Example of "-info p" with "-prc on" and "-mrhoist off"
- ======================================================================
- #if 0
-
- OR
- pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g
-
- set context:
- B
- tree context: null
-
- pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g
-
- set context:
- X
- tree context: null
-
- #endif
- ======================================================================
-
-#60. (Changed in 1.33MR7) Major changes to exception handling
-
- There were significant problems in the handling of exceptions
- in 1.33 vanilla. The general problem is that it can only
- process one level of exception handler. For example, a named
- exception handler, an exception handler for an alternative, or
- an exception for a subrule always went to the rule's exception
- handler if there was no "catch" which matched the exception.
-
- In 1.33MR7 the exception handlers properly "nest". If an
- exception handler does not have a matching "catch" then the
- nextmost outer exception handler is checked for an appropriate
- "catch" clause, and so on until an exception handler with an
- appropriate "catch" is found.
-
- There are still undesirable features in the way exception
- handlers are implemented, but I do not have time to fix them
- at the moment:
-
- The exception handlers for alternatives are outside the
- block containing the alternative. This makes it impossible
- to access variables declared in a block or to resume the
- parse by "falling through". The parse can still be easily
- resumed in other ways, but not in the most natural fashion.
-
- This results in an inconsistentcy between named exception
- handlers and exception handlers for alternatives. When
- an exception handler for an alternative "falls through"
- it goes to the nextmost outer handler - not the "normal
- action".
-
- A major difference between 1.33MR7 and 1.33 vanilla is
- the default action after an exception is caught:
-
- 1.33 Vanilla
- ------------
- In 1.33 vanilla the signal value is set to zero ("NoSignal")
- and the code drops through to the code following the exception.
- For named exception handlers this is the "normal action".
- For alternative exception handlers this is the rule's handler.
-
- 1.33MR7
- -------
- In 1.33MR7 the signal value is NOT automatically set to zero.
-
- There are two cases:
-
- For named exception handlers: if the signal value has been
- set to zero the code drops through to the "normal action".
-
- For all other cases the code branches to the nextmost outer
- exception handler until it reaches the handler for the rule.
-
- The following macros have been defined for convenience:
-
- C/C++ Mode Name
- --------------------
- (zz)suppressSignal
- set signal & return signal arg to 0 ("NoSignal")
- (zz)setSignal(intValue)
- set signal & return signal arg to some value
- (zz)exportSignal
- copy the signal value to the return signal arg
-
- I'm not sure why PCCTS make a distinction between the local
- signal value and the return signal argument, but I'm loathe
- to change the code. The burden of copying the local signal
- value to the return signal argument can be given to the
- default signal handler, I suppose.
-
-#53. (Explanation for 1.33MR6) What happens after an exception is caught ?
-
- The Book is silent about what happens after an exception
- is caught.
-
- The following code fragment prints "Error Action" followed
- by "Normal Action".
-
- test : Word ex:Number <<printf("Normal Action\n");>>
- exception[ex]
- catch NoViableAlt:
- <<printf("Error Action\n");>>
- ;
-
- The reason for "Normal Action" is that the normal flow of the
- program after a user-written exception handler is to "drop through".
- In the case of an exception handler for a rule this results in
- the exection of a "return" statement. In the case of an
- exception handler attached to an alternative, rule, or token
- this is the code that would have executed had there been no
- exception.
-
- The user can achieve the desired result by using a "return"
- statement.
-
- test : Word ex:Number <<printf("Normal Action\n");>>
- exception[ex]
- catch NoViableAlt:
- <<printf("Error Action\n"); return;>>
- ;
-
- The most powerful mechanism for recovery from parse errors
- in pccts is syntactic predicates because they provide
- backtracking. Exceptions allow "return", "break",
- "consumeUntil(...)", "goto _handler", "goto _fail", and
- changing the _signal value.
-
-#41. (Added in 1.33MR6) antlr -stdout
-
- Using "antlr -stdout ..." forces the text that would
- normally go to the grammar.c or grammar.cpp file to
- stdout.
-
-#40. (Added in 1.33MR6) antlr -tab to change tab stops
-
- Using "antlr -tab number ..." changes the tab stops
- for the grammar.c or grammar.cpp file. The number
- must be between 0 and 8. Using 0 gives tab characters,
- values between 1 and 8 give the appropriate number of
- space characters.
-
-#34. (Added to 1.33MR1) Add public DLGLexerBase::set_line(int newValue)
-
- Previously there was no public function for changing the line
- number maintained by the lexer.
-
-#28. (Added to 1.33MR1) More control over DLG header
-
- Version 1.33MR1 adds the following directives to PCCTS
- for C++ mode:
-
- #lexprefix <<source code>>
-
- Adds source code to the DLGLexer.h file
- after the #include "DLexerBase.h" but
- before the start of the class definition.
-
- #lexmember <<source code>>
-
- Adds source code to the DLGLexer.h file
- as part of the DLGLexer class body. It
- appears immediately after the start of
- the class and a "public: statement.
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/KNOWN_PROBLEMS.txt b/BaseTools/Source/C/VfrCompile/Pccts/KNOWN_PROBLEMS.txt
deleted file mode 100644
index 5a9b22e1bd..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/KNOWN_PROBLEMS.txt
+++ /dev/null
@@ -1,241 +0,0 @@
-
- =======================================================
- Known Problems In PCCTS - Last revised 14 November 1998
- =======================================================
-
-#17. The dlg fix for handling characters up to 255 is incorrect.
-
- See item #207.
-
- Reported by Frank Hartmann.
-
-#16. A note about "&&" predicates (Mike Dimmick)
-
- Mike Dimmick has pointed out a potential pitfall in the use of the
- "&&" style predicate. Consider:
-
- r0: (g)? => <<P>>? r1
- | ...
- ;
- r1: A | B;
-
- If the context guard g is not a subset of the lookahead context for r1
- (in other words g is neither A nor B) then the code may execute r1
- even when the lookahead context is not satisfied. This is an error
- by the person coding the grammer, and the error should be reported to
- the user, but it isn't. expect. Some examples I've run seem to
- indicate that such an error actually results in the rule becoming
- unreachable.
-
- When g is properly coded the code is correct, the problem is when g
- is not properly coded.
-
- A second problem reported by Mike Dimmick is that the test for a
- failed validation predicate is equivalent to a test on the predicate
- along. In other words, if the "&&" has not been hoisted then it may
- falsely report a validation error.
-
-#15. (Changed in MR23) Warning for LT(i), LATEXT(i) in token match actions
-
- An bug (or at least an oddity) is that a reference to LT(1), LA(1),
- or LATEXT(1) in an action which immediately follows a token match
- in a rule refers to the token matched, not the token which is in
- the lookahead buffer. Consider:
-
- r : abc <<action alpha>> D <<action beta>> E;
-
- In this case LT(1) in action alpha will refer to the next token in
- the lookahead buffer ("D"), but LT(1) in action beta will refer to
- the token matched by D - the preceding token.
-
- A warning has been added which warns users about this when an action
- following a token match contains a reference to LT(1), LA(1), or LATEXT(1).
-
- This behavior should be changed, but it appears in too many programs
- now. Another problem, perhaps more significant, is that the obvious
- fix (moving the consume() call to before the action) could change the
- order in which input is requested and output appears in existing programs.
-
- This problem was reported, along with a fix by Benjamin Mandel
- (beny@sd.co.il). However, I felt that changing the behavior was too
- dangerous for existing code.
-
-#14. Parsing bug in dlg
-
- THM: I have been unable to reproduce this problem.
-
- Reported by Rick Howard Mijenix Corporation (rickh@mijenix.com).
-
- The regular expression parser (in rexpr.c) fails while
- trying to parse the following regular expression:
-
- {[a-zA-Z]:}(\\\\[a-zA-Z0-9]*)+
-
- See my comment in the following excerpt from rexpr.c:
-
- /*
- * <regExpr> ::= <andExpr> ( '|' {<andExpr>} )*
- *
- * Return -1 if syntax error
- * Return 0 if none found
- * Return 1 if a regExrp was found
- */
- static
- regExpr(g)
- GraphPtr g;
- {
- Graph g1, g2;
-
- if ( andExpr(&g1) == -1 )
- {
- return -1;
- }
-
- while ( token == '|' )
- {
- int a;
- next();
- a = andExpr(&g2);
- if ( a == -1 ) return -1; /* syntax error below */
- else if ( !a ) return 1; /* empty alternative */
- g1 = BuildNFA_AorB(g1, g2);
- }
-
- if ( token!='\0' ) return -1;
- *****
- ***** It appears to fail here becuause token is 125 - the closing '}'
- ***** If I change it to:
- ***** if ( token!='\0' && token!='}' && token!= ')' ) return -1;
- *****
- ***** It succeeds, but I'm not sure this is the corrrect approach.
- *****
- *g = g1;
- return 1;
- }
-
-#13. dlg reports an invalid range for: [\0x00-\0xff]
-
- Diagnosed by Piotr Eljasiak (eljasiak@no-spam.zt.gdansk.tpsa.pl):
-
- Fixed in MR16.
-
-#12. Strings containing comment actions
-
- Sequences that looked like C style comments appearing in string
- literals are improperly parsed by antlr/dlg.
-
- << fprintf(out," /* obsolete */ ");
-
- For this case use:
-
- << fprintf(out," \/\* obsolete \*\/ ");
-
- Reported by K.J. Cummings (cummings@peritus.com).
-
-#11. User hook for deallocation of variables on guess fail
-
- The mechanism outlined in Item #108 works only for
- heap allocated variables.
-
-#10. Label re-initialization in ( X {y:Y} )*
-
- If a label assignment is optional and appears in a
- (...)* or (...)+ block it will not be reset to NULL
- when it is skipped by a subsequent iteration.
-
- Consider the example:
-
- ( X { y:Y })* Z
-
- with input:
-
- X Y X Z
-
- The first time through the block Y will be matched and
- y will be set to point to the token. On the second
- iteration of the (...)* block there is no match for Y.
- But y will not be reset to NULL, as the user might
- expect, it will contain a reference to the Y that was
- matched in the first iteration.
-
- The work-around is to manually reset y:
-
- ( X << y = NULL; >> { y:Y } )* Z
-
- or
-
- ( X ( y:Y | << y = NULL; >> /* epsilon */ ) )* Z
-
- Reported by Jeff Vincent (JVincent@novell.com).
-
-#9. PCCTAST.h PCCTSAST::setType() is a noop
-
-#8. #tokdefs with ~Token and .
-
- THM: I have been unable to reproduce this problem.
-
- When antlr uses #tokdefs to define tokens the fields of
- #errclass and #tokclass do not get properly defined.
- When it subsequently attempts to take the complement of
- the set of tokens (using ~Token or .) it can refer to
- tokens which don't have names, generating a fatal error.
-
-#7. DLG crashes on some invalid inputs
-
- THM: In MR20 have fixed the most common cases.
-
- The following token defintion will cause DLG to crash.
-
- #token "()"
-
- Reported by Mengue Olivier (dolmen@bigfoot.com).
-
-#6. On MS systems \n\r is treated as two new lines
-
- Fixed.
-
-#5. Token expressions in #tokclass
-
- #errclass does not support TOK1..TOK2 or ~TOK syntax.
- #tokclass does not support ~TOKEN syntax
-
- A workaround for #errclass TOK1..TOK2 is to use a
- #tokclass.
-
- Reported by Dave Watola (dwatola@amtsun.jpl.nasa.gov)
-
-#4. A #tokdef must appear "early" in the grammar file.
-
- The "early" section of the grammar file is the only
- place where the following directives may appear:
-
- #header
- #first
- #tokdefs
- #parser
-
- Any other kind of statement signifiies the end of the
- "early" section.
-
-#3. Use of PURIFY macro for C++ mode
-
- Item #93 of the CHANGES_FROM_1.33 describes the use of
- the PURIFY macro to zero arguments to be passed by
- upward inheritance.
-
- #define PURIFY(r, s) memset((char *) &(r), '\0', (s));
-
- This may not be the right thing to do for C++ objects that
- have constructors. Reported by Bonny Rais (bonny@werple.net.au).
-
- For those cases one should #define PURIFY to be an empty macro
- in the #header or #first actions.
-
-#2. Fixed in 1.33MR10 - See CHANGES_FROM_1.33 Item #80.
-
-#1. The quality of support for systems with 8.3 file names leaves
- much to be desired. Since the kit is distributed using the
- long file names and the make file uses long file names it requires
- some effort to generate. This will probably not be changed due
- to the large number of systems already written using the long
- file names.
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/MPW_Read_Me b/BaseTools/Source/C/VfrCompile/Pccts/MPW_Read_Me
deleted file mode 100644
index 70a9d1bcad..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/MPW_Read_Me
+++ /dev/null
@@ -1,21 +0,0 @@
-
-1. You can control the creator type of generated files by changing a value of
- #if control statement.
-
-
- pccts:h:pcctscfg.h
-
- line 225-231
-
- #if 0
- #define MAC_FILE_CREATOR 'MPS ' /* MPW Text files */
- #endif
- #if 0
- #define MAC_FILE_CREATOR 'KAHL' /* THINK C/Symantec C++ Text files */
- #endif
- #if 0
- #define MAC_FILE_CREATOR 'CWIE' /* Metrowerks C/C++ Text files */
- #endif
-
-2. If you want to build 68K version. You must convert all source files to Macintosh
- format before compile.
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/Makefile b/BaseTools/Source/C/VfrCompile/Pccts/Makefile
deleted file mode 100644
index 57eeda5934..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Main makefile for PCCTS 1.33MR33 /* MRXXX */
-#
-pccts:
- pushd . & cd antlr & $(MAKE) /nologo /f AntlrMS.mak & popd
- pushd . & cd dlg & $(MAKE) /nologo /f DlgMS.mak & popd
-
-clean:
- pushd . & cd antlr & $(MAKE) /nologo /f AntlrMS.mak clean & popd
- pushd . & cd dlg & $(MAKE) /nologo /f DlgMS.mak clean & popd
-
-cleanall:
- pushd . & cd antlr & $(MAKE) /nologo /f AntlrMS.mak cleanall & popd
- pushd . & cd dlg & $(MAKE) /nologo /f DlgMS.mak cleanall & popd
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/NOTES.bcc b/BaseTools/Source/C/VfrCompile/Pccts/NOTES.bcc
deleted file mode 100644
index 1ac05b17c5..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/NOTES.bcc
+++ /dev/null
@@ -1,184 +0,0 @@
-March 95
-Version 1.32 of pccts
-
-At the moment this file is available via anonymous FTP at
-
- Node: marvin.ecn.purdue.edu
- File: pub/pccts/1.32/NOTES.BCC
-
-Mail corrections or additions to David Seidel <71333.1575@compuserve.com>
-===============================================================================
-Notes on Building PCCTS 1.32 with Borland C++
-
-David Seidel, Innovative Data Concepts Incorporated
-CompuServe: 71333,1575
-Internet: 71333.1575@compuserve.com
- dseidel@delphi.com
-
-I have gotten ANTLR and DLG to succesfully build with BCC 4.0, but have found
-from experience that ANTLR, in particular, is likely to run out of memory
-with grammars over a certain size, or with larger values for the -k and -ck
-options. Now that BCC 4.02 and the new Borland Power Pack for DOS is now
-available, I feel that there is no excuse not to build these tools as
-32-bit executables, as they ought to be.
-
-For people without the Power Pack, the makefiles below should be fairly easily
-modified to build 16-bit real-mode executables, but I don't really recommend
-it. As an alternative, you might consider the highly regarded DJGPP compiler
-(a DOS port of the Gnu GCC compiler, with a DOS extender included). Hopefully
-some other PCCTS who has DJGPP can provode whatever advice is necessary. The
-Watcom compiler is also an excellent possibility (albeit a commercial one),
-and I hope to make available Watcom makefiles in the near future.
-
-Here are the makefiles I am using. Both makefiles use a compiler configuration
-file that contains compiler switches such as optimization settings. I call
-this file bor32.cfg and keep a copy in both the ANTLR and DLG subdirectories.
-
-==== File: bor32.cfg (cut here) ===============================================
--w-
--RT-
--x-
--N-
--k-
--d
--O2-e-l
--Z
--D__STDC__=1
-==== End of file bor32.cfg (cut here) =========================================
-
-==== File: antlr\bor32.mak (cut here) =========================================
-#
-# ANTLR 1.32 Makefile for Borland C++ 4.02 with DPMI 32-bit DOS extender by
-# David Seidel
-# Innovative Data Concepts Incorporated
-# 71333.1575@compuserve.com (or) dseidel@delphi.com
-#
-# Notes: 1. Compiler switches (optimization etc.) are contained in the
-# file bor32.cfg.
-# 2. This makefile requires Borland C++ 4.02 or greater with
-# the DOS Power Pack add-on package.
-# 3. Change the BCCDIR macro below to the topmost directory in
-# which BCC is installed on your system.
-#
-
-BCCDIR = d:\bc4
-CC = bcc32
-SET = ..\support\set
-PCCTS_H = ..\h
-ANTLR = ..\bin\antlr
-DLG = ..\bin\dlg
-CFLAGS = -I$(BCCDIR)\include -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN \
- +bor32.cfg
-LIBS = dpmi32 cw32
-OBJ_EXT = obj
-OBJS = antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj fset.obj \
- gen.obj globals.obj hash.obj lex.obj main.obj misc.obj pred.obj dialog.obj \
- set.obj
-
-.c.obj:
- $(CC) -c $(CFLAGS) {$&.c }
-
-antlr.exe: $(OBJS)
- tlink32 @&&|
--Tpe -ax -c -s -L$(BCCDIR)\lib +
-$(BCCDIR)\lib\c0x32 $**
-$@
-
-$(LIBS)
-;
-|
- copy *.exe ..\bin
-
-
-# *********** Target list of PC machines ***********
-#
-# Don't worry about the ambiguity messages coming from antlr
-# for making antlr.c etc... [should be 10 of them, I think]
-#
-
-# leave this commented out for initial build!
-#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g
-# $(ANTLR) antlr.g
-
-antlr.$(OBJ_EXT): antlr.c mode.h tokens.h
-
-scan.$(OBJ_EXT): scan.c mode.h tokens.h
-
-# leave this commented out for initial build!
-#scan.c mode.h: parser.dlg
-# $(DLG) -C2 parser.dlg scan.c
-
-set.$(OBJ_EXT): $(SET)\set.c
- $(CC) -c $(CFLAGS) $(SET)\set.c
-
-==== End of file antlr\bor32.mak (cut here) ===================================
-
-==== File: dlg\bor32.mak (cut here) ===========================================
-#
-# DLG 1.32 Makefile for Borland C++ 4.02 with DPMI 32-bit DOS extender by
-# David Seidel
-# Innovative Data Concepts Incorporated
-# 71333.1575@compuserve.com (or) dseidel@delphi.com
-#
-# Notes: 1. Compiler switches (optimization etc.) are contained in the
-# file bor32.cfg.
-# 2. This makefile requires Borland C++ 4.02 or greater with
-# the DOS Power Pack add-on package.
-# 3. Change the BCCDIR macro below to the topmost directory in
-# which BCC is installed on your system.
-#
-
-
-BCCDIR = d:\bc4
-CC = bcc32
-SET = ..\support\set
-PCCTS_H = ..\h
-ANTLR = ..\bin\antlr
-DLG = ..\bin\dlg
-CFLAGS = -I$(BCCDIR)\include -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN \
- +bor32.cfg
-LIBS = dpmi32 cw32
-OBJ_EXT = obj
-OBJS = dlg_p.obj dlg_a.obj main.obj err.obj support.obj \
- output.obj relabel.obj automata.obj set.obj
-
-.c.obj:
- $(CC) -c $(CFLAGS) {$&.c }
-
-dlg.exe : $(OBJS)
- tlink32 @&&|
--Tpe -ax -c -s -L$(BCCDIR)\lib +
-c0x32 $**
-$@
-
-$(LIBS)
-;
-|
- copy *.exe ..\bin
-
-dlg_p.obj: dlg_p.c
-
-dlg_a.obj: dlg_a.c
-
-main.obj: main.c
-
-err.obj: err.c
-
-support.obj: support.c
-
-output.obj: output.c
-
-relabel.obj: relabel.c
-
-automata.obj: automata.c
-
-set.$(OBJ_EXT): $(SET)\set.c
- $(CC) -c $(CFLAGS) $(SET)\set.c
-
-==== End of file dlg\bor32.mak (cut here) =====================================
-
-
-
-
-
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/NOTES.msvc b/BaseTools/Source/C/VfrCompile/Pccts/NOTES.msvc
deleted file mode 100644
index 86f8ed66e0..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/NOTES.msvc
+++ /dev/null
@@ -1,189 +0,0 @@
-
- Microsoft Visual C Stuff
-
-
-[Tom Moog 2-Oct-98
-
- Users of Microsoft Visual C++ should download a separate
- ready-to-run zip file from my web site. It contains
- binaries, static library, and a sample project.
-]
-
-[
- Two notes added by Tom Moog 23-Sep-97. I believe the *.dsp and
- *.mak files that were once at the end of this file are now obsolete.
-
- The following MSVC .dsp and .mak files for pccts and sorcerer
- were contributed by Stanislaw Bochnak (S.Bochnak@microtool.com.pl)
- and Jeff Vincent (jvincent@novell.com)
-
- PCCTS Distribution Kit
- ----------------------
- pccts/antlr/AntlrMSVC50.dsp
- pccts/antlr/AntlrMSVC50.mak
-
- pccts/dlg/DlgMSVC50.dsp
- pccts/dlg/DlgMSVC50.mak
-
- pccts/support/genmk/watgenmk.mak
- pccts/support/msvc.dsp
-
- Sorcerer Distribution Kit
- -------------------------
- pccts/sorcerer/SorcererMSVC50.dsp
- pccts/sorcerer/SorcererMSVC50.mak
-
- pccts/sorcerer/lib/msvc.dsp
-
- I do not have an MS based computer. If you discover problems
- please report them so as to save trouble for others in the future.
-]
-
-[
- Modified by Terence Parr (September 1995) to change .C to .cpp
-]
-
-[
- This file contains notes on MSVC for Windows NT console execs by Dave
- Seidel and an explanation of flags etc.. by John Hall; good luck,
- Terence
-]
-
-===============================================================================
-Date: Sat, 31 Dec 1994 11:40:36 -0500 (EST)
-From: David Seidel <75342.2034@compuserve.com>
-
-I've succesfully build 1.31b3 with djgpp for DOS and MSVC 2.0 for Windows
-NT. The only (minor) problem I had was that GNU make (version 3.71, in the
-djgpp port) complained about "multiple targets" in both the antlr and dlg
-makefiles. I got around the error by, in each makefile, commenting out the
-$(SRC) dependency, for example:
-
- antlr: $(OBJ) #$(SRC)
-
-I don't know why this is happenning, since you haven't changed that part of
-the makefile at all, and I think this used to work ok...
-
-Here are the makefiles I built from within the MSVC 2.0 environment for antlr
-and dlg and Windows NT console executables. Please feel free to pass them
-on. Of course, as soon as 1.31 "goes gold", I will send you nice new
-binaries. I'm not going to bother to keep doing both Borland and djgpp for
-DOS however. Instead, I'll just keep the djgpp version up to date and also
-provide WinNT binaries.
-
-Dave
-===============================================================================
-
- How to port PCCTS 1.10 (and 1.32 hopefully) to Visual C++
-
- By
-
- John Hall <jhall@ivy.wpi.edu>
-
-Here is how to compile an ANTLR grammar in Visual C++. These steps
-describe how to have your ANTLR grammar parse the input file the user
-selects when they choose File Open in your Windows application. (Even
-if you aren't using Visual C++, the steps should be portable enough to
-other compilers.)
-
- * Make sure that ANTLR and DLG generate ANSI code (use the -ga
- switch).
-
- * Set the following compiler flags in Visual C++ (these are in the
- Memory Model category of the compiler options in the Project
- Options menu):
-
- FLAG MEANING
- ==== ==============================================================
- /AL Large memory model (multiple data segments; data items must be
- smaller than 64K).
-
- /Gtn Allocates all items whose size is greater than or equal to n
- in a new data segment. (I let n be 256: /Gt256.)
-
- /Gx- All references to data items are done with far addressing in
- case they are placed in a far segment.
-
- * Add the following member variable to the attributes section of your
- derived CDocument class (you will need to make sure you also
- include stdio.h):
-
- FILE *fp;
-
- * Add the following method to your derived CDocument class:
-
- BOOL CAppDoc::OnOpenDocument(const char* pszPathName)
- {
- // Call CDocument's OnOpenDocument to do housekeeping for us
- // DON'T add anything to the loading section of Serialize
- if (!CDocument::OnOpenDocument(pszPathName))
- return FALSE;
-
- // Open input file
- if ((fp = fopen(pszPathName, "r")) == NULL)
- return FALSE;
-
- // Parse input file
- ANTLR(start(), fp);
-
- // Close input file
- fclose(fp);
- return TRUE;
- }
-
- (Note: additional code may be necessary, depending on your parser.
- For example, if your parser uses PCCTS's symbol table library, you
- will need to insert calls to zzs_init and zzs_done.)
-
- * Compile the generated C files as C++ files. (I renamed the files
- to have a .CPP extension to fool Visual C++ into thinking they were
- C++ files. One might also use the /Tp switch, but that switch
- requires you separately include the filename.) [I used this step
- as an easy out for all the external linking errors I was getting
- that I couldn't fix by declaring things extern "C".]
-
- * Make sure the __STDC__ portion of the generated files gets
- compiled. (Either define __STDC__ yourself or else change all
- occurrences of __STDC__ to __cplusplus in the generated files. You
- can define __STDC__ in the Preprocessor category of the compiler
- options.)
-
- ================================================================
- = Note 23-Sep-97: This is probably not necessary any more. =
- = With 1.33MRxxx the use of __STDC__ was replaced with the =
- = macro __USE_PROTOS to control the compilation of prototypes. =
- ================================================================
-
-That last step is important for Visual C++, but may not apply to other
-compilers. For C++ compilers, whether __STDC__ is defined is
-implementation dependent (ARM, page 379). Apparently, Visual C++ does
-not to define it; it also does not support "old style" C function
-definitions (which is okay, according to page 404 of the ARM). Those
-two things together caused problems when trying to port the code.
-When it saw this:
-
-#ifdef __STDC__
-void
-globals(AST **_root)
-#else
-globals(_root)
-AST **_root;
-#endif
-
-it skipped the __STDC__ section and tried to process the "old style"
-function definition, where it choked.
-
-When you finally get your parser to compile and link without error,
-you may get General Protection Fault errors at run time. The problem
-I had was that a NULL was passed to a variable argument function
-without an explicit cast. The function grabbed a pointer (32-bits)
-off the stack using va_arg, but the NULL was passed silently as the
-integer 0 (16 bits), making the resulting pointer was invalid. (This
-was in PCCTS's sample C parser.)
-
-There is one other thing I might suggest to help you avoid a run-time
-error. Make sure you redefine the default error reporting function,
-zzsyn. To do this, put "#define USER_ZZSYN" in your #header section
-and put your own zzsyn somewhere. You can then pop up a MessageBox or
-print the error to some output window.
-===============================================================================
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/README b/BaseTools/Source/C/VfrCompile/Pccts/README
deleted file mode 100644
index d089b638b4..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/README
+++ /dev/null
@@ -1,159 +0,0 @@
-
- Parr Research Corporation
- with
- Purdue University Electrical Engineering
- and
- University of Minnesota, AHPCRC
-
- Terence Parr
- Russell Quong
- Will Cohen
- Hank Dietz
-
-
-A central place for information about PCCTS 1.33 is:
-
- http://www.polhode.com/pccts.html
-
-The maintenance release is available from:
-
- http://www.polhode.com/pccts133mr.zip
-
-There is a ready-to-run version for win32 for Microsoft Visual Studio
-at the same site. It is available from:
-
- http://www.polhode.com/win32.zip
-
-New users should visit http://www.polhode.com/pccts.html in
-order to get the following document:
-
- "Notes For New Users of PCCTS"
-
-This is a Postscript file of about 40 pages which is extremely
-useful for someone starting out. It is a based on 1.33mr21
-
-When you have a little more experience, be sure to review the
-following documents in the distribution kit:
-
- CHANGES_FROM_133.txt
- CHANGES_FROM_133_BEFORE_MR13.txt
- KNOWN_PROBLEMS.txt
-
--------------------------------------------------------------------------
- INSTALLATION (Unix)
--------------------------------------------------------------------------
-0. Download http://www.polhode.com/pccts133mr.zip
-
-1. Unzip the distribution kit to your preferred location.
- If there are newline problems try using zip -a ...
-
-2. cd to the main pccts directory.
-
-3. make
-
- This will create:
-
- antlr
- dlg
- sorcerer
- genmk
-
-4. Copy to /usr/local/bin or /usr/local/bin if you like. If you
- don't wish to then add pccts/bin to your path.
-
-5. To get an up-to-date list of program options execute the
- program with no command line options. To get up-to-date
- documentation read CHANGES_FROM_133*.txt and KNOWN_PROBLEMS.txt
- at:
-
- http://www.polhode.com/pccts.html
-
-6. You need not create a library. The makefile created by genmk
- assumes that the files are not part of a library.
-
- If you wish to create a library from elements of pccts/h:
-
- If the first letter of the filename is lowercase (uppercase) it is
- related to the code generated using the pccts C mode (C++ mode).
- Some of the .c and .cpp files in the h directory are not meant to
- be placed in a library and will not compile because they are meant
- to be #include in pccts generated files which are grammar specific.
-
- For C++ users place the following elements in the library:
-
- AParser.cpp
- ASTBase.cpp
- ATokenBuffer.cpp
- BufFileInput.cpp (optional)
- DLexerBase.cpp
- PCCTSAST.cpp
- SList.cpp
-
--------------------------------------------------------------------------
- INSTALLATION (Win32)
--------------------------------------------------------------------------
-
-I've tried to keep the win32 kit to the minimum necessary to get
-up and running. The complete kit contains additional information
-(some historical), source code, and DevStudio projects for
-rebuilding pccts from the source code.
-
-The kit is now distributed with both MSVC 5 and MSVC6 style projects.
-
-0. Download http://www.polhode.com/win32.zip.
-
- You may also wish to download:
-
- http://www.polhode.com/CHANGES_FROM_133.txt
- http://www.polhode.com/CHANGES_FROM_133_BEFORE_MR13.txt
- http://www.polhode.com/KNOWN_PROBLEMS.txt
-
-1. Unzip the distribution kit to your preferred location.
-
- This will create:
-
- a pccts directory tree
- pccts/bin/*.exe
- pccts/lib/*.lib
- pccts/h/*
- sorcerer/lib/*
- sorcerer/h/*
-
- an example directory tree
- pccts\example\calcAST\*
- pccts\example\simple\*
-
-2. Define the environment variable PCCTS to point to the main
- pccts directory.
-
-3. Try building the simple project: pccts\example\simple\simple50.dsw
- or simple60.dsw.
-
-4. Try building the complex project: pccts\example\calcAST\calcAST50.dsw
- or calcAST60.dsw.
-
--------------------------------------------------------------------------
- INSTALLATION (DEC/VMS)
--------------------------------------------------------------------------
-
-DEC/VMS support added by Piéronne Jean-François (jfp@altavista.net)
-
-0. Download http://www.polhode.com/pccts133mr.zip
-
-1. Unzip the distribution kit to your preferred location.
-
-2. set default to the main pccts directory.
-
-3. @makefile.vms
-
- This will create in directory [.bin]:
-
- antlr.exe
- dlg.exe
- sorcerer.exe
- genmk.exe
-
-5. To get an up-to-date list of program options execute the
- program with no command line options. To get up-to-date
- documentation read CHANGES_FROM_133*.txt and KNOWN_PROBLEMS.txt
- at http://www.polhode.com/pccts.html.
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/RIGHTS b/BaseTools/Source/C/VfrCompile/Pccts/RIGHTS
deleted file mode 100644
index 9db175ff40..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/RIGHTS
+++ /dev/null
@@ -1,26 +0,0 @@
-
-SOFTWARE RIGHTS
-
-We reserve no LEGAL rights to the Purdue Compiler Construction Tool
-Set (PCCTS) -- PCCTS is in the public domain. An individual or
-company may do whatever they wish with source code distributed with
-PCCTS or the code generated by PCCTS, including the incorporation of
-PCCTS, or its output, into commerical software.
-
-We encourage users to develop software with PCCTS. However, we do ask
-that credit is given to us for developing PCCTS. By "credit", we mean
-that if you incorporate our source code into one of your programs
-(commercial product, research project, or otherwise) that you
-acknowledge this fact somewhere in the documentation, research report,
-etc... If you like PCCTS and have developed a nice tool with the
-output, please mention that you developed it using PCCTS. In
-addition, we ask that this header remain intact in our source code.
-As long as these guidelines are kept, we expect to continue enhancing
-this system and expect to make other tools available as they are
-completed.
-
-ANTLR 1.33
-Terence Parr
-Parr Research Corporation
-with Purdue University and AHPCRC, University of Minnesota
-1989-1995
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak b/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
deleted file mode 100644
index 71b7c6b0b1..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrDDK.mak
+++ /dev/null
@@ -1,233 +0,0 @@
-# PCCTS directory
-
-# You will need to set the LIB variable similar to this.
-# LIB="C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/lib;c:/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib"
-
-# PCCTS_HOME=<your PCCTS_HOME>
-PCCTS_HOME=$(WORKSPACE)\Tools\CCode\Source\Pccts
-ANTLR_SRC=$(PCCTS_HOME)\antlr
-PCCTS_H=$(PCCTS_HOME)\h
-
-
-# Support directories
-SET=$(PCCTS_HOME)\support\set
-
-
-# Compiler stuff
-CC = cl
-CFLAGS = /nologo -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D "PC" \
- -D "ZZLEXBUFSIZE=65536" -D "LONGFILENAMES" /Zi /W3 -D__USE_PROTOS /wd4700
-
-ANTLR_OBJS = antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
- fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
- misc.obj pred.obj egman.obj mrhoist.obj fcache.obj
-
-SUPPORT_OBJS = set.obj
-
-# Dependencies
-
-$(WORKSPACE)\Tools\bin\antlr.exe: $(ANTLR_OBJS) $(SUPPORT_OBJS)
- $(CC) $(CFLAGS) -o antlr.exe bufferoverflowu.lib $(ANTLR_OBJS) $(SUPPORT_OBJS)
- del *.obj
- move antlr.exe $(WORKSPACE)\Tools\bin
-
-
-antlr.obj: $(ANTLR_SRC)\antlr.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\mode.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
- $(ANTLR_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\antlr.c
-
-scan.obj: $(ANTLR_SRC)\scan.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgauto.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\mode.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
- $(ANTLR_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\scan.c
-
-err.obj: $(ANTLR_SRC)\err.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(PCCTS_H)\err.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
- $(ANTLR_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\err.c
-
-bits.obj: $(ANTLR_SRC)\bits.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\bits.c
-
-build.obj: $(ANTLR_SRC)\build.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\build.c
-
-fset2.obj: $(ANTLR_SRC)\fset2.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\fset2.c
-
-fset.obj: $(ANTLR_SRC)\fset.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\fset.c
-
-gen.obj: $(ANTLR_SRC)\gen.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\gen.c
-
-globals.obj: $(ANTLR_SRC)\globals.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\globals.c
-
-hash.obj: $(ANTLR_SRC)\hash.c \
- $(PCCTS_H)\config.h \
- $(ANTLR_SRC)\hash.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\hash.c
-
-lex.obj: $(ANTLR_SRC)\lex.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\lex.c
-
-main.obj: $(ANTLR_SRC)\main.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\mode.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\stdpccts.h \
- $(ANTLR_SRC)\syn.h \
- $(ANTLR_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\main.c
-
-misc.obj: $(ANTLR_SRC)\misc.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\misc.c
-
-pred.obj: $(ANTLR_SRC)\pred.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\pred.c
-
-egman.obj: $(ANTLR_SRC)\egman.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\egman.c
-
-mrhoist.obj: $(ANTLR_SRC)\mrhoist.c \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\mrhoist.c
-
-fcache.obj: $(ANTLR_SRC)\fcache.c \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\fcache.c
-
-set.obj: $(SET)\set.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
-
- $(CC) -c $(CFLAGS) $(SET)\set.c
-
-clean:
- del *.obj
-
-distclean:
- del *.obj
- del $(WORKSPACE)\Tools\bin\antlr.exe
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak b/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak
deleted file mode 100644
index 8d87547a50..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrMS.mak
+++ /dev/null
@@ -1,238 +0,0 @@
-# PCCTS directory
-
-# You will need to set the LIB variable similar to this.
-# LIB="C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/lib;c:/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib"
-
-# PCCTS_HOME=<your PCCTS_HOME>
-PCCTS_HOME=$(BASE_TOOLS_PATH)\Source\C\VfrCompile\Pccts
-ANTLR_SRC=$(PCCTS_HOME)\antlr
-PCCTS_H=$(PCCTS_HOME)\h
-
-
-# Support directories
-SET=$(PCCTS_HOME)\support\set
-
-
-# Compiler stuff
-CC = cl
-CFLAGS = /nologo -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D "PC" \
- -D "ZZLEXBUFSIZE=65536" /D "LONGFILENAMES" /Zi /W3 -D__USE_PROTOS /wd4700 \
- /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
-
-ANTLR_OBJS = antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
- fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
- misc.obj pred.obj egman.obj mrhoist.obj fcache.obj
-
-SUPPORT_OBJS = set.obj
-
-# Dependencies
-
-$(EDK_TOOLS_PATH)\Bin\Win32\antlr.exe: $(ANTLR_OBJS) $(SUPPORT_OBJS)
- $(CC) $(CFLAGS) -Feantlr.exe $(ANTLR_OBJS) $(SUPPORT_OBJS)
- copy antlr.exe $(EDK_TOOLS_PATH)\Bin\Win32
-
-
-antlr.obj: $(ANTLR_SRC)\antlr.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\mode.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
- $(ANTLR_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\antlr.c
-
-scan.obj: $(ANTLR_SRC)\scan.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgauto.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\mode.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
- $(ANTLR_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\scan.c
-
-err.obj: $(ANTLR_SRC)\err.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(PCCTS_H)\err.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
- $(ANTLR_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\err.c
-
-bits.obj: $(ANTLR_SRC)\bits.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\bits.c
-
-build.obj: $(ANTLR_SRC)\build.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\build.c
-
-fset2.obj: $(ANTLR_SRC)\fset2.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\fset2.c
-
-fset.obj: $(ANTLR_SRC)\fset.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\fset.c
-
-gen.obj: $(ANTLR_SRC)\gen.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\gen.c
-
-globals.obj: $(ANTLR_SRC)\globals.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\globals.c
-
-hash.obj: $(ANTLR_SRC)\hash.c \
- $(PCCTS_H)\config.h \
- $(ANTLR_SRC)\hash.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\hash.c
-
-lex.obj: $(ANTLR_SRC)\lex.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\lex.c
-
-main.obj: $(ANTLR_SRC)\main.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\mode.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\stdpccts.h \
- $(ANTLR_SRC)\syn.h \
- $(ANTLR_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\main.c
-
-misc.obj: $(ANTLR_SRC)\misc.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\misc.c
-
-pred.obj: $(ANTLR_SRC)\pred.c \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\pred.c
-
-egman.obj: $(ANTLR_SRC)\egman.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\egman.c
-
-mrhoist.obj: $(ANTLR_SRC)\mrhoist.c \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\mrhoist.c
-
-fcache.obj: $(ANTLR_SRC)\fcache.c \
- $(ANTLR_SRC)\generic.h \
- $(ANTLR_SRC)\hash.h \
- $(ANTLR_SRC)\proto.h \
- $(ANTLR_SRC)\syn.h \
-
- $(CC) -c $(CFLAGS) $(ANTLR_SRC)\fcache.c
-
-set.obj: $(SET)\set.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
-
- $(CC) -c $(CFLAGS) $(SET)\set.c
-
-clean:
- -del *.obj
- -del *.ilk
- -del *.pdb
-
-cleanall:
- -del *.obj
- -del *.ilk
- -del *.pdb
- -del *.exe
- -del $(EDK_TOOLS_PATH)\Bin\Win32\antlr.exe
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrPPC.mak b/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrPPC.mak
deleted file mode 100644
index 9ede60d64c..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/AntlrPPC.mak
+++ /dev/null
@@ -1,101 +0,0 @@
-# Target: antlrPPC
-# Sources: ::support:set:set.c
-# antlr.c
-# bits.c
-# build.c
-# egman.c
-# err.c
-# fcache.c
-# fset2.c
-# fset.c
-# gen.c
-# globals.c
-# hash.c
-# lex.c
-# main.c
-# misc.c
-# mrhoist.c
-# pred.c
-# scan.c
-# Created: Sunday, May 17, 1998 10:24:53 PM
-# Author: Kenji Tanaka
-MAKEFILE = antlrPPC.make
-¥MondoBuild¥ = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified
-Includes = ¶
- -i "::h:" ¶
- -i "::support:set:"
-Sym¥PPC =
-ObjDir¥PPC = :Obj:
-PPCCOptions = {Includes} {Sym¥PPC} -w off -d MPW -d __STDC__=1 -d USER_ZZSYN
-Objects¥PPC = ¶
- "{ObjDir¥PPC}set.c.x" ¶
- "{ObjDir¥PPC}antlr.c.x" ¶
- "{ObjDir¥PPC}bits.c.x" ¶
- "{ObjDir¥PPC}build.c.x" ¶
- "{ObjDir¥PPC}egman.c.x" ¶
- "{ObjDir¥PPC}err.c.x" ¶
- "{ObjDir¥PPC}fcache.c.x" ¶
- "{ObjDir¥PPC}fset2.c.x" ¶
- "{ObjDir¥PPC}fset.c.x" ¶
- "{ObjDir¥PPC}gen.c.x" ¶
- "{ObjDir¥PPC}globals.c.x" ¶
- "{ObjDir¥PPC}hash.c.x" ¶
- "{ObjDir¥PPC}lex.c.x" ¶
- "{ObjDir¥PPC}main.c.x" ¶
- "{ObjDir¥PPC}misc.c.x" ¶
- "{ObjDir¥PPC}mrhoist.c.x" ¶
- "{ObjDir¥PPC}pred.c.x" ¶
- "{ObjDir¥PPC}scan.c.x"
-antlrPPC ÄÄ {¥MondoBuild¥} {Objects¥PPC}
- PPCLink ¶
- -o {Targ} {Sym¥PPC} ¶
- {Objects¥PPC} ¶
- -t 'MPST' ¶
- -c 'MPS ' ¶
- "{SharedLibraries}InterfaceLib" ¶
- "{SharedLibraries}StdCLib" ¶
- #"{SharedLibraries}MathLib" ¶
- "{PPCLibraries}StdCRuntime.o" ¶
- "{PPCLibraries}PPCCRuntime.o" ¶
- "{PPCLibraries}PPCToolLibs.o"
-"{ObjDir¥PPC}set.c.x" Ä {¥MondoBuild¥} "::support:set:set.c"
- {PPCC} "::support:set:set.c" -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}antlr.c.x" Ä {¥MondoBuild¥} antlr.c
- {PPCC} antlr.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}bits.c.x" Ä {¥MondoBuild¥} bits.c
- {PPCC} bits.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}build.c.x" Ä {¥MondoBuild¥} build.c
- {PPCC} build.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}egman.c.x" Ä {¥MondoBuild¥} egman.c
- {PPCC} egman.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}err.c.x" Ä {¥MondoBuild¥} err.c
- {PPCC} err.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}fcache.c.x" Ä {¥MondoBuild¥} fcache.c
- {PPCC} fcache.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}fset2.c.x" Ä {¥MondoBuild¥} fset2.c
- {PPCC} fset2.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}fset.c.x" Ä {¥MondoBuild¥} fset.c
- {PPCC} fset.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}gen.c.x" Ä {¥MondoBuild¥} gen.c
- {PPCC} gen.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}globals.c.x" Ä {¥MondoBuild¥} globals.c
- {PPCC} globals.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}hash.c.x" Ä {¥MondoBuild¥} hash.c
- {PPCC} hash.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}lex.c.x" Ä {¥MondoBuild¥} lex.c
- {PPCC} lex.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}main.c.x" Ä {¥MondoBuild¥} main.c
- {PPCC} main.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}misc.c.x" Ä {¥MondoBuild¥} misc.c
- {PPCC} misc.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}mrhoist.c.x" Ä {¥MondoBuild¥} mrhoist.c
- {PPCC} mrhoist.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}pred.c.x" Ä {¥MondoBuild¥} pred.c
- {PPCC} pred.c -o {Targ} {PPCCOptions}
-"{ObjDir¥PPC}scan.c.x" Ä {¥MondoBuild¥} scan.c
- {PPCC} scan.c -o {Targ} {PPCCOptions}
-
-antlrPPC ÄÄ antlr.r
- Rez antlr.r -o antlrPPC -a
-Install Ä antlrPPC
- Duplicate -y antlrPPC "{MPW}"Tools:antlr
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/README b/BaseTools/Source/C/VfrCompile/Pccts/antlr/README
deleted file mode 100644
index d7fc95916e..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/README
+++ /dev/null
@@ -1,19 +0,0 @@
- ANTLR 1.33
-
-This directory contains the files necessary to build ANTLR.
-
-If you do a "make scrub", ANTLR will have to run on antlr.g and DLG
-will have to run on parser.dlg. Either
-
-(1) ANTLR uses the previous antlr in that directory to rebuild itself
-(2) Needs to find antlr on the search path
-
-You will find that running "antlr -gh antlr.g" will result in about
-10 ambiguity warnings. These are normal. Don't worry.
-
-If you do a "make clean" right after installation, ANTLR and DLG should
-not need to run; only the C files will compile.
-
-Don't forget to go into the makefile to uncomment the appropriate
-definitions for your OS/architecture/compiler or see the appropriate
-NOTES.?? file.
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.1 b/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.1
deleted file mode 100644
index acfa85b066..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.1
+++ /dev/null
@@ -1,209 +0,0 @@
-.TH ANTLR 1 "September 1995" "ANTLR" "PCCTS Manual Pages"
-.SH NAME
-antlr \- ANother Tool for Language Recognition
-.SH SYNTAX
-.LP
-\fBantlr\fR [\fIoptions\fR] \fIgrammar_files\fR
-.SH DESCRIPTION
-.PP
-\fIAntlr\fP converts an extended form of context-free grammar into a
-set of C functions which directly implement an efficient form of
-deterministic recursive-descent LL(k) parser. Context-free grammars
-may be augmented with predicates to allow semantics to influence
-parsing; this allows a form of context-sensitive parsing. Selective
-backtracking is also available to handle non-LL(k) and even
-non-LALR(k) constructs. \fIAntlr\fP also produces a definition of a
-lexer which can be automatically converted into C code for a DFA-based
-lexer by \fIdlg\fR. Hence, \fIantlr\fR serves a function much like
-that of \fIyacc\fR, however, it is notably more flexible and is more
-integrated with a lexer generator (\fIantlr\fR directly generates
-\fIdlg\fR code, whereas \fIyacc\fR and \fIlex\fR are given independent
-descriptions). Unlike \fIyacc\fR which accepts LALR(1) grammars,
-\fIantlr\fR accepts LL(k) grammars in an extended BNF notation \(em
-which eliminates the need for precedence rules.
-.PP
-Like \fIyacc\fR grammars, \fIantlr\fR grammars can use
-automatically-maintained symbol attribute values referenced as dollar
-variables. Further, because \fIantlr\fR generates top-down parsers,
-arbitrary values may be inherited from parent rules (passed like
-function parameters). \fIAntlr\fP also has a mechanism for creating
-and manipulating abstract-syntax-trees.
-.PP
-There are various other niceties in \fIantlr\fR, including the ability to
-spread one grammar over multiple files or even multiple grammars in a single
-file, the ability to generate a version of the grammar with actions stripped
-out (for documentation purposes), and lots more.
-.SH OPTIONS
-.IP "\fB-ck \fIn\fR"
-Use up to \fIn\fR symbols of lookahead when using compressed (linear
-approximation) lookahead. This type of lookahead is very cheap to
-compute and is attempted before full LL(k) lookahead, which is of
-exponential complexity in the worst case. In general, the compressed
-lookahead can be much deeper (e.g, \f(CW-ck 10\fP) than the full
-lookahead (which usually must be less than 4).
-.IP \fB-CC\fP
-Generate C++ output from both ANTLR and DLG.
-.IP \fB-cr\fP
-Generate a cross-reference for all rules. For each rule, print a list
-of all other rules that reference it.
-.IP \fB-e1\fP
-Ambiguities/errors shown in low detail (default).
-.IP \fB-e2\fP
-Ambiguities/errors shown in more detail.
-.IP \fB-e3\fP
-Ambiguities/errors shown in excruciating detail.
-.IP "\fB-fe\fP file"
-Rename \fBerr.c\fP to file.
-.IP "\fB-fh\fP file"
-Rename \fBstdpccts.h\fP header (turns on \fB-gh\fP) to file.
-.IP "\fB-fl\fP file"
-Rename lexical output, \fBparser.dlg\fP, to file.
-.IP "\fB-fm\fP file"
-Rename file with lexical mode definitions, \fBmode.h\fP, to file.
-.IP "\fB-fr\fP file"
-Rename file which remaps globally visible symbols, \fBremap.h\fP, to file.
-.IP "\fB-ft\fP file"
-Rename \fBtokens.h\fP to file.
-.IP \fB-ga\fP
-Generate ANSI-compatible code (default case). This has not been
-rigorously tested to be ANSI XJ11 C compliant, but it is close. The
-normal output of \fIantlr\fP is currently compilable under both K&R,
-ANSI C, and C++\(emthis option does nothing because \fIantlr\fP
-generates a bunch of #ifdef's to do the right thing depending on the
-language.
-.IP \fB-gc\fP
-Indicates that \fIantlr\fP should generate no C code, i.e., only
-perform analysis on the grammar.
-.IP \fB-gd\fP
-C code is inserted in each of the \fIantlr\fR generated parsing functions to
-provide for user-defined handling of a detailed parse trace. The inserted
-code consists of calls to the user-supplied macros or functions called
-\fBzzTRACEIN\fR and \fBzzTRACEOUT\fP. The only argument is a
-\fIchar *\fR pointing to a C-style string which is the grammar rule
-recognized by the current parsing function. If no definition is given
-for the trace functions, upon rule entry and exit, a message will be
-printed indicating that a particular rule as been entered or exited.
-.IP \fB-ge\fP
-Generate an error class for each non-terminal.
-.IP \fB-gh\fP
-Generate \fBstdpccts.h\fP for non-ANTLR-generated files to include.
-This file contains all defines needed to describe the type of parser
-generated by \fIantlr\fP (e.g. how much lookahead is used and whether
-or not trees are constructed) and contains the \fBheader\fP action
-specified by the user.
-.IP \fB-gk\fP
-Generate parsers that delay lookahead fetches until needed. Without
-this option, \fIantlr\fP generates parsers which always have \fIk\fP
-tokens of lookahead available.
-.IP \fB-gl\fP
-Generate line info about grammar actions in C parser of the form
-\fB#\ \fIline\fP\ "\fIfile\fP"\fR which makes error messages from
-the C/C++ compiler make more sense as they will \*Qpoint\*U into the
-grammar file not the resulting C file. Debugging is easier as well,
-because you will step through the grammar not C file.
-.IP \fB-gs\fR
-Do not generate sets for token expression lists; instead generate a
-\fB||\fP-separated sequence of \fBLA(1)==\fItoken_number\fR. The
-default is to generate sets.
-.IP \fB-gt\fP
-Generate code for Abstract-Syntax Trees.
-.IP \fB-gx\fP
-Do not create the lexical analyzer files (dlg-related). This option
-should be given when the user wishes to provide a customized lexical
-analyzer. It may also be used in \fImake\fR scripts to cause only the
-parser to be rebuilt when a change not affecting the lexical structure
-is made to the input grammars.
-.IP "\fB-k \fIn\fR"
-Set k of LL(k) to \fIn\fR; i.e. set tokens of look-ahead (default==1).
-.IP "\fB-o\fP dir
-Directory where output files should go (default="."). This is very
-nice for keeping the source directory clear of ANTLR and DLG spawn.
-.IP \fB-p\fP
-The complete grammar, collected from all input grammar files and
-stripped of all comments and embedded actions, is listed to
-\fBstdout\fP. This is intended to aid in viewing the entire grammar
-as a whole and to eliminate the need to keep actions concisely stated
-so that the grammar is easier to read. Hence, it is preferable to
-embed even complex actions directly in the grammar, rather than to
-call them as subroutines, since the subroutine call overhead will be
-saved.
-.IP \fB-pa\fP
-This option is the same as \fB-p\fP except that the output is
-annotated with the first sets determined from grammar analysis.
-.IP "\fB-prc on\fR
-Turn on the computation and hoisting of predicate context.
-.IP "\fB-prc off\fR
-Turn off the computation and hoisting of predicate context. This
-option makes 1.10 behave like the 1.06 release with option \fB-pr\fR
-on. Context computation is off by default.
-.IP "\fB-rl \fIn\fR
-Limit the maximum number of tree nodes used by grammar analysis to
-\fIn\fP. Occasionally, \fIantlr\fP is unable to analyze a grammar
-submitted by the user. This rare situation can only occur when the
-grammar is large and the amount of lookahead is greater than one. A
-nonlinear analysis algorithm is used by PCCTS to handle the general
-case of LL(k) parsing. The average complexity of analysis, however, is
-near linear due to some fancy footwork in the implementation which
-reduces the number of calls to the full LL(k) algorithm. An error
-message will be displayed, if this limit is reached, which indicates
-the grammar construct being analyzed when \fIantlr\fP hit a
-non-linearity. Use this option if \fIantlr\fP seems to go out to
-lunch and your disk start thrashing; try \fIn\fP=10000 to start. Once
-the offending construct has been identified, try to remove the
-ambiguity that \fIantlr\fP was trying to overcome with large lookahead
-analysis. The introduction of (...)? backtracking blocks eliminates
-some of these problems\ \(em \fIantlr\fP does not analyze alternatives
-that begin with (...)? (it simply backtracks, if necessary, at run
-time).
-.IP \fB-w1\fR
-Set low warning level. Do not warn if semantic predicates and/or
-(...)? blocks are assumed to cover ambiguous alternatives.
-.IP \fB-w2\fR
-Ambiguous parsing decisions yield warnings even if semantic predicates
-or (...)? blocks are used. Warn if predicate context computed and
-semantic predicates incompletely disambiguate alternative productions.
-.IP \fB-\fR
-Read grammar from standard input and generate \fBstdin.c\fP as the
-parser file.
-.SH "SPECIAL CONSIDERATIONS"
-.PP
-\fIAntlr\fP works... we think. There is no implicit guarantee of
-anything. We reserve no \fBlegal\fP rights to the software known as
-the Purdue Compiler Construction Tool Set (PCCTS) \(em PCCTS is in the
-public domain. An individual or company may do whatever they wish
-with source code distributed with PCCTS or the code generated by
-PCCTS, including the incorporation of PCCTS, or its output, into
-commercial software. We encourage users to develop software with
-PCCTS. However, we do ask that credit is given to us for developing
-PCCTS. By "credit", we mean that if you incorporate our source code
-into one of your programs (commercial product, research project, or
-otherwise) that you acknowledge this fact somewhere in the
-documentation, research report, etc... If you like PCCTS and have
-developed a nice tool with the output, please mention that you
-developed it using PCCTS. As long as these guidelines are followed,
-we expect to continue enhancing this system and expect to make other
-tools available as they are completed.
-.SH FILES
-.IP *.c
-output C parser.
-.IP *.cpp
-output C++ parser when C++ mode is used.
-.IP \fBparser.dlg\fP
-output \fIdlg\fR lexical analyzer.
-.IP \fBerr.c\fP
-token string array, error sets and error support routines. Not used in
-C++ mode.
-.IP \fBremap.h\fP
-file that redefines all globally visible parser symbols. The use of
-the #parser directive creates this file. Not used in
-C++ mode.
-.IP \fBstdpccts.h\fP
-list of definitions needed by C files, not generated by PCCTS, that
-reference PCCTS objects. This is not generated by default. Not used in
-C++ mode.
-.IP \fBtokens.h\fP
-output \fI#defines\fR for tokens used and function prototypes for
-functions generated for rules.
-.SH "SEE ALSO"
-.LP
-dlg(1), pccts(1)
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.c
deleted file mode 100644
index 8aaef794e1..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.c
+++ /dev/null
@@ -1,3564 +0,0 @@
-/*
- * A n t l r T r a n s l a t i o n H e a d e r
- *
- * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
- * Purdue University Electrical Engineering
- * With AHPCRC, University of Minnesota
- * ANTLR Version 1.33MR33
- *
- * ..\bin\antlr -gh antlr.g
- *
- */
-
-#define ANTLR_VERSION 13333
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-#include "pcctscfg.h"
-#include "set.h"
-#include <ctype.h>
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#define zzcr_attr(attr,tok,t)
-#define zzSET_SIZE 20
-#include "antlr.h"
-#include "tokens.h"
-#include "dlgdef.h"
-#include "mode.h"
-
-/* MR23 In order to remove calls to PURIFY use the antlr -nopurify option */
-
-#ifndef PCCTS_PURIFY
-#define PCCTS_PURIFY(r,s) memset((char *) &(r),'\0',(s));
-#endif
-
-ANTLR_INFO
-
-
-/* MR20 G. Hobbelt For Borland C++ 4.x & 5.x compiling with ALL warnings enabled */
-#if defined(__TURBOC__)
-#pragma warn -aus /* unused assignment of 'xxx' */
-#endif
-
-
-#ifdef __USE_PROTOS
-static void chkToken(char *, char *, char *, int);
-#else
-static void chkToken();
-#endif
-
-#ifdef __USE_PROTOS
-static int isDLGmaxToken(char *Token); /* MR3 */
-#else
-static int isDLGmaxToken(); /* MR3 */
-#endif
-
-static int class_nest_level = 0;
-
-/* MR20 G. Hobbelt extern definitions moved to antlr.h */
-
-
-
-void
-#ifdef __USE_PROTOS
-grammar(void)
-#else
-grammar()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- Graph g;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- for (;;) {
- if ( !((setwd1[LA(1)]&0x1))) break;
- if ( (LA(1)==94) ) {
- zzmatch(94); zzCONSUME;
- zzmatch(Action);
-
- if ( HdrAction==NULL ) {
- HdrAction = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(HdrAction!=NULL, "rule grammar: cannot allocate header action");
- strcpy(HdrAction, LATEXT(1));
- }
- else warn("additional #header statement ignored");
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==95) ) {
- zzmatch(95); zzCONSUME;
- zzmatch(Action);
-
- if ( FirstAction==NULL ) {
- FirstAction = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(FirstAction!=NULL, "rule grammar: cannot allocate #first action");
- strcpy(FirstAction, LATEXT(1));
- } else {
- warn("additional #first statement ignored");
- };
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==96) ) {
- zzmatch(96); zzCONSUME;
- zzmatch(QuotedTerm);
-
- if ( GenCC ) {
- warn("#parser meta-op incompatible with -CC; ignored");
- }
- else {
- if ( strcmp(ParserName,"zzparser")==0 ) {
- ParserName=StripQuotes(mystrdup(LATEXT(1)));
- if ( RulePrefix[0]!='\0' )
- {
- warn("#parser meta-op incompatible with '-gp prefix'; '-gp' ignored");
- RulePrefix[0]='\0';
- }
- }
- else warn("additional #parser statement ignored");
- }
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==97) ) {
- zzmatch(97); zzCONSUME;
- zzmatch(QuotedTerm);
- {
- char *fname;
- zzantlr_state st; FILE *f; struct zzdlg_state dst;
- UserTokenDefsFile = mystrdup(LATEXT(1));
- zzsave_antlr_state(&st);
- zzsave_dlg_state(&dst);
- fname = mystrdup(LATEXT(1));
- f = fopen(StripQuotes(fname), "r");
- if ( f==NULL ) {warn(eMsg1("cannot open token defs file '%s'", fname+1));}
- else {
- ANTLRm(enum_file(fname+1), f, PARSE_ENUM_FILE);
- UserDefdTokens = 1;
- }
- zzrestore_antlr_state(&st);
- zzrestore_dlg_state(&dst);
- }
- zzCONSUME;
-
- }
- else break; /* MR6 code for exiting loop "for sure" */
- }
- }
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- for (;;) {
- if ( !((setwd1[LA(1)]&0x2))) break;
- if ( (LA(1)==Action) ) {
- zzmatch(Action);
- {
- UserAction *ua = newUserAction(LATEXT(1));
- ua->file = action_file; ua->line = action_line;
- if ( class_nest_level>0 ) list_add(&class_before_actions, ua);
- else list_add(&BeforeActions, ua);
- }
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==108) ) {
- laction();
- }
- else {
- if ( (LA(1)==109) ) {
- lmember();
- }
- else {
- if ( (LA(1)==110) ) {
- lprefix();
- }
- else {
- if ( (LA(1)==116) ) {
- aLexclass();
- }
- else {
- if ( (LA(1)==120) ) {
- token();
- }
- else {
- if ( (LA(1)==117) ) {
- error();
- }
- else {
- if ( (LA(1)==118) ) {
- tclass();
- }
- else {
- if ( (LA(1)==111) ) {
- aPred();
- }
- else {
- if ( (LA(1)==133) ) {
- default_exception_handler();
- }
- else {
- if ( (LA(1)==99) ) {
- class_def();
- }
- else {
- if ( (LA(1)==98) ) {
- zzmatch(98);
-
- if ( class_nest_level==0 )
- warn("missing class definition for trailing '}'");
- class_nest_level--;
- zzCONSUME;
-
- }
- else break; /* MR6 code for exiting loop "for sure" */
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- rule();
- g=zzaArg(zztasp1,3); SynDiag = (Junction *) zzaArg(zztasp1,3 ).left;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- for (;;) {
- if ( !((setwd1[LA(1)]&0x4))) break;
- if ( (LA(1)==NonTerminal) ) {
- rule();
- if ( zzaArg(zztasp2,1 ).left!=NULL ) {
- g.right = NULL;
-
-/* MR21a */ /* Avoid use of a malformed graph when CannotContinue */
- /* MR21a */ /* is already set */
- /* MR21a */
- /* MR21a */ if (! (CannotContinue && g.left == NULL)) {
- /* MR21a */ g = Or(g, zzaArg(zztasp2,1));
- /* MR21a */ }
- /* MR21a */ }
- }
- else {
- if ( (LA(1)==116) ) {
- aLexclass();
- }
- else {
- if ( (LA(1)==120) ) {
- token();
- }
- else {
- if ( (LA(1)==117) ) {
- error();
- }
- else {
- if ( (LA(1)==118) ) {
- tclass();
- }
- else {
- if ( (LA(1)==111) ) {
- aPred();
- }
- else {
- if ( (LA(1)==99) ) {
- class_def();
- }
- else {
- if ( (LA(1)==98) ) {
- zzmatch(98);
-
- if ( class_nest_level==0 )
- warn("missing class definition for trailing '}'");
- class_nest_level--;
- zzCONSUME;
-
- }
- else break; /* MR6 code for exiting loop "for sure" */
- }
- }
- }
- }
- }
- }
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- for (;;) {
- if ( !((setwd1[LA(1)]&0x8))) break;
- if ( (LA(1)==Action) ) {
- zzmatch(Action);
- {
- UserAction *ua = newUserAction(LATEXT(1));
- ua->file = action_file; ua->line = action_line;
- if ( class_nest_level>0 ) list_add(&class_after_actions, ua);
- else list_add(&AfterActions, ua);
- }
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==108) ) {
- laction();
- }
- else {
- if ( (LA(1)==109) ) {
- lmember();
- }
- else {
- if ( (LA(1)==110) ) {
- lprefix();
- }
- else {
- if ( (LA(1)==117) ) {
- error();
- }
- else {
- if ( (LA(1)==118) ) {
- tclass();
- }
- else {
- if ( (LA(1)==99) ) {
- class_def();
- }
- else {
- if ( (LA(1)==111) ) {
- aPred();
- }
- else {
- if ( (LA(1)==98) ) {
- zzmatch(98);
-
- if ( class_nest_level==0 )
- warn("missing class definition for trailing '}'");
- class_nest_level--;
- zzCONSUME;
-
- }
- else break; /* MR6 code for exiting loop "for sure" */
- }
- }
- }
- }
- }
- }
- }
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- zzmatch(Eof); zzCONSUME;
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd1, 0x10);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-class_def(void)
-#else
-class_def()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- int go=1; char name[MaxRuleName+1];
- zzmatch(99); zzCONSUME;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==NonTerminal) ) {
- zzmatch(NonTerminal);
- if(go) strncpy(name,LATEXT(1),MaxRuleName);
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
- if(go) strncpy(name,LATEXT(1),MaxRuleName);
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr1,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
-
- if ( CurrentClassName[0]!='\0' && strcmp(CurrentClassName,name)!=0
- && GenCC ) {
- err("only one grammar class allowed in this release");
- go = 0;
- }
- else strcpy(CurrentClassName, name);
- if ( !GenCC ) { err("class meta-op used without C++ option"); }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (setwd1[LA(1)]&0x20) ) {
- zzsetmatch(zzerr2, zzerr3);
- if (ClassDeclStuff == NULL) {
- /* MR10 */ ClassDeclStuff=(char *)calloc(MaxClassDeclStuff+1,sizeof(char));
- /* MR10 */ };
- /* MR10 */ strncat(ClassDeclStuff," ",MaxClassDeclStuff);
- /* MR10 */ strncat(ClassDeclStuff,LATEXT(1),MaxClassDeclStuff);
- /* MR22 */ do {
- /* MR22 */ if (0 == strcmp(LATEXT(1),"public")) break;
- /* MR22 */ if (0 == strcmp(LATEXT(1),"private")) break;
- /* MR22 */ if (0 == strcmp(LATEXT(1),"protected")) break;
- /* MR22 */ if (0 == strcmp(LATEXT(1),"virtual")) break;
- /* MR22 */ if (0 == strcmp(LATEXT(1),",")) break;
- /* MR22 */ if (0 == strcmp(LATEXT(1),":")) break;
- /* MR22 */ if (BaseClassName != NULL) break;
- /* MR22 */ BaseClassName=(char *)calloc(strlen(LATEXT(1))+1,sizeof(char));
- /* MR22 */ require(BaseClassName!=NULL, "rule grammar: cannot allocate base class name");
- /* MR22 */ strcpy(BaseClassName,LATEXT(1));
- /* MR22 */ } while (0);
- /* MR10 */
- zzCONSUME;
-
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- zzmatch(102);
-
- no_classes_found = 0;
- if ( class_nest_level>=1 ) {warn("cannot have nested classes");}
- else class_nest_level++;
- zzCONSUME;
-
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd1, 0x40);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-rule(void)
-#else
-rule()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
-
-
- ExceptionGroup *eg;
- RuleEntry *q; Junction *p; Graph r; int f, l; ECnode *e;
- set toksrefd, rulesrefd;
- char *pdecl=NULL, *ret=NULL, *a; CurRetDef = CurParmDef = NULL;
- CurExGroups = NULL;
- CurElementLabels = NULL;
- CurAstLabelsInActions = NULL; /* MR27 */
- /* We want a new element label hash table for each rule */
- if ( Elabel!=NULL ) killHashTable(Elabel);
- Elabel = newHashTable();
- attribsRefdFromAction = empty;
- zzmatch(NonTerminal);
- q=NULL;
- if ( hash_get(Rname, LATEXT(1))!=NULL ) {
- err(eMsg1("duplicate rule definition: '%s'",LATEXT(1)));
- CannotContinue=TRUE;
- }
- else
- {
- q = (RuleEntry *)hash_add(Rname,
- LATEXT(1),
- (Entry *)newRuleEntry(LATEXT(1)));
- CurRule = q->str;
- }
- CurRuleNode = q;
- f = CurFile; l = zzline;
- NumRules++;
- zzCONSUME;
-
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==103) ) {
- zzmatch(103);
- if ( q!=NULL ) q->noAST = TRUE;
- zzCONSUME;
-
- }
- else {
- if ( (setwd1[LA(1)]&0x80) ) {
- }
- else {zzFAIL(1,zzerr4,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- ;
- if ( (setwd2[LA(1)]&0x1) ) {
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==104) ) {
- zzmatch(104); zzCONSUME;
- }
- else {
- if ( (LA(1)==PassAction) ) {
- }
- else {zzFAIL(1,zzerr5,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- zzmatch(PassAction);
- pdecl = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(pdecl!=NULL, "rule rule: cannot allocate param decl");
- strcpy(pdecl, LATEXT(1));
- CurParmDef = pdecl;
- zzCONSUME;
-
- }
- else {
- if ( (setwd2[LA(1)]&0x2) ) {
- }
- else {zzFAIL(1,zzerr6,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==105) ) {
- zzmatch(105); zzCONSUME;
- zzmatch(PassAction);
- ret = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(ret!=NULL, "rule rule: cannot allocate ret type");
- strcpy(ret, LATEXT(1));
- CurRetDef = ret;
- zzCONSUME;
-
- }
- else {
- if ( (setwd2[LA(1)]&0x4) ) {
- }
- else {zzFAIL(1,zzerr7,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==QuotedTerm) ) {
- zzmatch(QuotedTerm);
- if ( q!=NULL ) q->egroup=mystrdup(LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==106) ) {
- }
- else {zzFAIL(1,zzerr8,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
-
- if ( GenEClasseForRules && q!=NULL ) {
- e = newECnode;
- require(e!=NULL, "cannot allocate error class node");
- if ( q->egroup == NULL ) {a = q->str; a[0] = (char)toupper(a[0]);}
- else a = q->egroup;
- if ( Tnum( a ) == 0 )
- {
- e->tok = addTname( a );
- list_add(&eclasses, (char *)e);
- if ( q->egroup == NULL ) a[0] = (char)tolower(a[0]);
- /* refers to itself */
- list_add(&(e->elist), mystrdup(q->str));
- }
- else {
- warn(eMsg1("default errclass for '%s' would conflict with token/errclass/tokclass",a));
- if ( q->egroup == NULL ) a[0] = (char)tolower(a[0]);
- free((char *)e);
- }
- }
- BlkLevel++;
- if (BlkLevel >= MAX_BLK_LEVEL) fatal("Blocks nested too deeply");
- /* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID;
- /* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum;
- zzmatch(106);
- inAlt=1;
- zzCONSUME;
-
- block( &toksrefd, &rulesrefd );
- r = makeBlk(zzaArg(zztasp1,7),0, NULL /* pFirstSetSymbol */ );
- CurRuleBlk = (Junction *)r.left;
- CurRuleBlk->blockid = CurBlockID;
- CurRuleBlk->jtype = RuleBlk;
- if ( q!=NULL ) CurRuleBlk->rname = q->str;
- CurRuleBlk->file = f;
- CurRuleBlk->line = l;
- CurRuleBlk->pdecl = pdecl;
- CurRuleBlk->ret = ret;
- CurRuleBlk->lock = makelocks();
- CurRuleBlk->pred_lock = makelocks();
- CurRuleBlk->tokrefs = toksrefd;
- CurRuleBlk->rulerefs = rulesrefd;
- p = newJunction(); /* add EndRule Node */
- ((Junction *)r.right)->p1 = (Node *)p;
- r.right = (Node *) p;
- p->jtype = EndRule;
- p->lock = makelocks();
- p->pred_lock = makelocks();
- CurRuleBlk->end = p;
- if ( q!=NULL ) q->rulenum = NumRules;
- zzaArg(zztasp1,7) = r;
-
- /* MR23 */ CurBlockID_array[BlkLevel] = (-1);
- /* MR23 */ CurAltNum_array[BlkLevel] = (-1);
- --BlkLevel;
- altFixup();leFixup();egFixup();
- zzmatch(107);
- inAlt=0;
- zzCONSUME;
-
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==Action) ) {
- zzmatch(Action);
- a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule rule: cannot allocate error action");
- strcpy(a, LATEXT(1));
- CurRuleBlk->erraction = a;
- zzCONSUME;
-
- }
- else {
- if ( (setwd2[LA(1)]&0x8) ) {
- }
- else {zzFAIL(1,zzerr9,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (LA(1)==133) ) {
- eg = exception_group();
-
- if ( eg!=NULL ) {
- list_add(&CurExGroups, (void *)eg);
- if (eg->label == NULL || *eg->label=='\0' ) q->has_rule_exception = 1;
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- if ( q==NULL ) zzaArg(zztasp1,0 ).left = NULL; else zzaArg(zztasp1,0) = zzaArg(zztasp1,7);
- CurRuleBlk->exceptions = CurExGroups;
- CurRuleBlk->el_labels = CurElementLabels;
- CurRuleNode->ast_labels_in_actions = CurAstLabelsInActions;
- CurRuleNode = NULL;
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd2, 0x10);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-laction(void)
-#else
-laction()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- char *a;
- zzmatch(108); zzCONSUME;
- zzmatch(Action);
-
- a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule laction: cannot allocate action");
- strcpy(a, LATEXT(1));
- list_add(&LexActions, a);
- zzCONSUME;
-
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd2, 0x20);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-lmember(void)
-#else
-lmember()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- char *a;
- zzmatch(109); zzCONSUME;
- zzmatch(Action);
-
- /* MR1 */ if (! GenCC) {
- /* MR1 */ err("Use #lexmember only in C++ mode (to insert code in DLG class header");
- /* MR1 */ } else {
- /* MR1 */ a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- /* MR1 */ require(a!=NULL, "rule lmember: cannot allocate action");
- /* MR1 */ strcpy(a, LATEXT(1));
- /* MR1 */ list_add(&LexMemberActions, a);
- /* MR1 */ };
- /* MR1 */
- zzCONSUME;
-
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd2, 0x40);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-lprefix(void)
-#else
-lprefix()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- char *a;
- zzmatch(110); zzCONSUME;
- zzmatch(Action);
-
- /* MR1 */ if (! GenCC) {
- /* MR1 */ err("Use #lexprefix only in C++ mode (to insert code in DLG class header");
- /* MR1 */ } else {
- /* MR1 */ a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- /* MR1 */ require(a!=NULL, "rule lprefix: cannot allocate action");
- /* MR1 */ strcpy(a, LATEXT(1));
- /* MR1 */ list_add(&LexPrefixActions, a);
- /* MR1 */ };
- /* MR1 */
- zzCONSUME;
-
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd2, 0x80);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-aPred(void)
-#else
-aPred()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- PredEntry *predEntry=NULL;
- char *name=NULL;
- Predicate *predExpr=NULL;
- char *predLiteral=NULL;
- int save_file;
- int save_line;
- int predExprPresent=0;
- zzmatch(111);
-
- MR_usingPredNames=1; /* will need to use -mrhoist version of genPredTree */
- zzCONSUME;
-
- zzmatch(TokenTerm);
- name=mystrdup(LATEXT(1));
- zzCONSUME;
-
-
- /* don't free - referenced in predicates */
-
- CurPredName=(char *)calloc(1,strlen(name) + 10);
- strcat(CurPredName,"#pred ");
- strcat(CurPredName,name);
-
- predEntry=(PredEntry *) hash_get(Pname,name);
- if (predEntry != NULL) {
- warnFL(eMsg1("#pred %s previously defined - ignored",name),
- FileStr[action_file],action_line);
- name=NULL;
-};
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==Pred) ) {
- zzmatch(Pred);
- predLiteral=mystrdup(LATEXT(1));
- save_line=action_line;
- save_file=action_file;
- zzCONSUME;
-
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (setwd3[LA(1)]&0x1) ) {
- predExpr = predOrExpr();
-
- predExprPresent=1;
- }
- else {
- if ( (setwd3[LA(1)]&0x2) ) {
- }
- else {zzFAIL(1,zzerr10,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- if (predLiteral != NULL && name != NULL) {
-
- /*
- * predExpr may be NULL due to syntax errors
- * or simply omitted by the user
- */
-
- predEntry=newPredEntry(name);
- predEntry->file=save_file;
- predEntry->line=save_line;
- predExpr=MR_predFlatten(predExpr);
- predEntry->predLiteral=predLiteral;
- if (! predExprPresent || predExpr == NULL) {
- predExpr=new_pred();
- predExpr->expr=predLiteral;
- predExpr->source=newActionNode();
- predExpr->source->action=predExpr->expr;
- predExpr->source->rname=CurPredName;
- predExpr->source->line=action_line;
- predExpr->source->file=action_file;
- predExpr->source->is_predicate=1;
- predExpr->k=predicateLookaheadDepth(predExpr->source);
- };
- predEntry->pred=predExpr;
- hash_add(Pname,name,(Entry *)predEntry);
- predExpr=NULL;
- };
- predicate_free(predExpr);
- }
- else {
- if ( (setwd3[LA(1)]&0x4) ) {
- save_line=zzline; save_file=CurFile;
- predExpr = predOrExpr();
-
- if (predExpr != NULL && name != NULL) {
- predEntry=newPredEntry(name);
- predEntry->file=CurFile;
- predEntry->line=zzline;
- predExpr=MR_predFlatten(predExpr);
- predEntry->pred=predExpr;
- hash_add(Pname,name,(Entry *)predEntry);
- predExpr=NULL;
- };
- predicate_free(predExpr);
- }
- else {zzFAIL(1,zzerr11,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==107) ) {
- zzmatch(107); zzCONSUME;
- }
- else {
- if ( (setwd3[LA(1)]&0x8) ) {
- }
- else {zzFAIL(1,zzerr12,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- predicate_free(predExpr);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd3, 0x10);
- }
-}
-
-Predicate *
-#ifdef __USE_PROTOS
-predOrExpr(void)
-#else
-predOrExpr()
-#endif
-{
- Predicate * _retv;
- zzRULE;
- zzBLOCK(zztasp1);
- PCCTS_PURIFY(_retv,sizeof(Predicate * ))
- zzMake0;
- {
- Predicate *ORnode;
- Predicate *predExpr;
- Predicate **tail=NULL;
- predExpr = predAndExpr();
-
-
- ORnode=new_pred();
- ORnode->expr=PRED_OR_LIST;
- if (predExpr != NULL) {
- ORnode->down=predExpr;
- tail=&predExpr->right;
- };
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (LA(1)==112) ) {
- zzmatch(112); zzCONSUME;
- predExpr = predAndExpr();
-
-
- if (predExpr != NULL) {
- *tail=predExpr;
- tail=&predExpr->right;
- };
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
-
- _retv=ORnode;
- ORnode=NULL;
- zzEXIT(zztasp1);
- return _retv;
-fail:
- zzEXIT(zztasp1);
- predicate_free(ORnode);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd3, 0x20);
- return _retv;
- }
-}
-
-Predicate *
-#ifdef __USE_PROTOS
-predAndExpr(void)
-#else
-predAndExpr()
-#endif
-{
- Predicate * _retv;
- zzRULE;
- zzBLOCK(zztasp1);
- PCCTS_PURIFY(_retv,sizeof(Predicate * ))
- zzMake0;
- {
- Predicate *ANDnode;
- Predicate *predExpr;
- Predicate **tail=NULL;
- predExpr = predPrimary();
-
-
- ANDnode=new_pred();
- ANDnode->expr=PRED_AND_LIST;
- if (predExpr != NULL) {
- ANDnode->down=predExpr;
- tail=&predExpr->right;
- };
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (LA(1)==113) ) {
- zzmatch(113); zzCONSUME;
- predExpr = predPrimary();
-
-
- if (predExpr != NULL) {
- *tail=predExpr;
- tail=&predExpr->right;
- };
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
-
- _retv=ANDnode;
- ANDnode=NULL;
- zzEXIT(zztasp1);
- return _retv;
-fail:
- zzEXIT(zztasp1);
- predicate_free(ANDnode);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd3, 0x40);
- return _retv;
- }
-}
-
-Predicate *
-#ifdef __USE_PROTOS
-predPrimary(void)
-#else
-predPrimary()
-#endif
-{
- Predicate * _retv;
- zzRULE;
- zzBLOCK(zztasp1);
- PCCTS_PURIFY(_retv,sizeof(Predicate * ))
- zzMake0;
- {
-
- char *name=NULL;
- PredEntry *predEntry=NULL;
- Predicate *predExpr=NULL;
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
- name=mystrdup(LATEXT(1));
- zzCONSUME;
-
-
- predEntry=(PredEntry *) hash_get(Pname,name);
- if (predEntry == NULL) {
- warnFL(eMsg1("no previously defined #pred with name \"%s\"",name),
- FileStr[CurFile],zzline);
- name=NULL;
- _retv=NULL;
- } else {
- predExpr=predicate_dup(predEntry->pred);
- predExpr->predEntry=predEntry;
- _retv=predExpr;
- };
- }
- else {
- if ( (LA(1)==114) ) {
- zzmatch(114); zzCONSUME;
- predExpr = predOrExpr();
-
- zzmatch(115);
-
- _retv=predExpr;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==103) ) {
- zzmatch(103); zzCONSUME;
- predExpr = predPrimary();
-
-
- predExpr->inverted=!predExpr->inverted;
- _retv=predExpr;
- }
- else {zzFAIL(1,zzerr13,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- zzEXIT(zztasp1);
- return _retv;
-fail:
- zzEXIT(zztasp1);
-
- predicate_free(predExpr);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd3, 0x80);
- return _retv;
- }
-}
-
-void
-#ifdef __USE_PROTOS
-aLexclass(void)
-#else
-aLexclass()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- zzmatch(116); zzCONSUME;
- zzmatch(TokenTerm);
- lexclass(mystrdup(LATEXT(1)));
- zzCONSUME;
-
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd4, 0x1);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-error(void)
-#else
-error()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- char *t=NULL; ECnode *e; int go=1; TermEntry *p;
- zzmatch(117); zzCONSUME;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- ;
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
- t=mystrdup(LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==QuotedTerm) ) {
- zzmatch(QuotedTerm);
- t=mystrdup(LATEXT(1));
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr14,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- e = newECnode;
- require(e!=NULL, "cannot allocate error class node");
- e->lexclass = CurrentLexClass;
- if ( Tnum( (t=StripQuotes(t)) ) == 0 )
- {
- if ( hash_get(Texpr, t) != NULL )
- warn(eMsg1("errclass name conflicts with regular expression '%s'",t));
- e->tok = addTname( t );
- set_orel(e->tok, &imag_tokens);
- require((p=(TermEntry *)hash_get(Tname, t)) != NULL,
- "hash table mechanism is broken");
- p->classname = 1; /* entry is errclass name, not token */
- list_add(&eclasses, (char *)e);
- }
- else
- {
- warn(eMsg1("redefinition of errclass or conflict w/token or tokclass '%s'; ignored",t));
- free( (char *)e );
- go=0;
-}
- zzmatch(102); zzCONSUME;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==NonTerminal) ) {
- zzmatch(NonTerminal);
- if ( go ) t=mystrdup(LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
- if ( go ) t=mystrdup(LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==QuotedTerm) ) {
- zzmatch(QuotedTerm);
- if ( go ) t=mystrdup(LATEXT(1));
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr15,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- zzEXIT(zztasp2);
- }
- }
- if ( go ) list_add(&(e->elist), t);
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (setwd4[LA(1)]&0x2) ) {
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==NonTerminal) ) {
- zzmatch(NonTerminal);
- if ( go ) t=mystrdup(LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
- if ( go ) t=mystrdup(LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==QuotedTerm) ) {
- zzmatch(QuotedTerm);
- if ( go ) t=mystrdup(LATEXT(1));
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr16,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- zzEXIT(zztasp3);
- }
- }
- if ( go ) list_add(&(e->elist), t);
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- zzmatch(98); zzCONSUME;
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd4, 0x4);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-tclass(void)
-#else
-tclass()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- char *t=NULL; TCnode *e; int go=1,tok,totok; TermEntry *p, *term, *toterm;
- char *akaString=NULL; int save_file; int save_line;
- char *totext=NULL;
- zzmatch(118); zzCONSUME;
- zzmatch(TokenTerm);
- t=mystrdup(LATEXT(1));
- zzCONSUME;
-
- e = newTCnode;
- require(e!=NULL, "cannot allocate token class node");
- e->lexclass = CurrentLexClass;
- if ( Tnum( t ) == 0 )
- {
- e->tok = addTname( t );
- set_orel(e->tok, &imag_tokens);
- set_orel(e->tok, &tokclasses);
- require((p=(TermEntry *)hash_get(Tname, t)) != NULL,
- "hash table mechanism is broken");
- p->classname = 1; /* entry is class name, not token */
- p->tclass = e; /* save ptr to this tclass def */
- list_add(&tclasses, (char *)e);
- }
- else
- {
- warn(eMsg1("redefinition of tokclass or conflict w/token '%s'; ignored",t));
- free( (char *)e );
- go=0;
-}
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==114) ) {
- zzmatch(114); zzCONSUME;
- zzmatch(QuotedTerm);
- akaString=mystrdup(StripQuotes(LATEXT(1)));
- /* MR11 */ save_file=CurFile;save_line=zzline;
- /* MR23 */
- zzCONSUME;
-
- zzmatch(115); zzCONSUME;
- }
- else {
- if ( (LA(1)==102) ) {
- }
- else {zzFAIL(1,zzerr17,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
-
- /* MR23 */ if (p!= NULL && akaString != NULL) {
- /* MR23 */ if (p->akaString != NULL) {
- /* MR23 */ if (strcmp(p->akaString,akaString) != 0) {
- /* MR23 */ warnFL(eMsg2("this #tokclass statment conflicts with a previous #tokclass %s(\"%s\") statement",
- /* MR23 */ t,p->akaString),
- /* MR23 */ FileStr[save_file],save_line);
- /* MR23 */ };
- /* MR23 */ } else {
- /* MR23 */ p->akaString=akaString;
- /* MR23 */ };
- /* MR23 */ };
- /* MR23 */
- zzmatch(102); zzCONSUME;
- {
- zzBLOCK(zztasp2);
- int zzcnt=1;
- zzMake0;
- {
- do {
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
- if ( go ) {
- term = (TermEntry *) hash_get(Tname, LATEXT(1));
- if ( term==NULL && UserDefdTokens ) {
- err("implicit token definition not allowed with #tokdefs");
- go = 0;
- }
- else {t=mystrdup(LATEXT(1)); tok=addTname(LATEXT(1));}
- }
- zzCONSUME;
-
- {
- zzBLOCK(zztasp4);
- zzMake0;
- {
- if ( (LA(1)==119) ) {
- zzmatch(119); zzCONSUME;
- zzmatch(TokenTerm);
- if ( go ) {
- toterm = (TermEntry *) hash_get(Tname, LATEXT(1));
- if ( toterm==NULL && UserDefdTokens ) {
- err("implicit token definition not allowed with #tokdefs");
- go = 0;
- } else {
- totext=mystrdup(LATEXT(1)); totok=addTname(LATEXT(1));
- }
- }
- zzCONSUME;
-
- }
- else {
- if ( (setwd4[LA(1)]&0x8) ) {
- }
- else {zzFAIL(1,zzerr18,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp4);
- }
- }
- }
- else {
- if ( (LA(1)==QuotedTerm) ) {
- zzmatch(QuotedTerm);
- if ( go ) {
- term = (TermEntry *) hash_get(Texpr, LATEXT(1));
- if ( term==NULL && UserDefdTokens ) {
- err("implicit token definition not allowed with #tokdefs");
- go = 0;
- }
- else {t=mystrdup(LATEXT(1)); tok=addTexpr(LATEXT(1));}
- }
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr19,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- if ( go ) {
- if (totext == NULL) {
- list_add(&(e->tlist), t);
- } else {
- list_add(&(e->tlist),"..");
- list_add(&(e->tlist),t);
- list_add(&(e->tlist),totext);
- }
- totext=NULL;
- }
- zzLOOP(zztasp2);
- } while ( (setwd4[LA(1)]&0x10) );
- zzEXIT(zztasp2);
- }
- }
- zzmatch(98); zzCONSUME;
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd4, 0x20);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-token(void)
-#else
-token()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- char *t=NULL, *e=NULL, *a=NULL; int tnum=0;
- char *akaString=NULL; TermEntry *te;int save_file=0,save_line=0;
- zzmatch(120);
- tokenActionActive=1;
- zzCONSUME;
-
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
- t=mystrdup(LATEXT(1));
- zzCONSUME;
-
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==114) ) {
- zzmatch(114); zzCONSUME;
- zzmatch(QuotedTerm);
- akaString=mystrdup(StripQuotes(LATEXT(1)));
- /* MR11 */ save_file=CurFile;save_line=zzline;
- /* MR11 */
- zzCONSUME;
-
- zzmatch(115); zzCONSUME;
- }
- else {
- if ( (setwd4[LA(1)]&0x40) ) {
- }
- else {zzFAIL(1,zzerr20,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==121) ) {
- zzmatch(121); zzCONSUME;
- zzmatch(122);
- tnum = atoi(LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (setwd4[LA(1)]&0x80) ) {
- }
- else {zzFAIL(1,zzerr21,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- }
- else {
- if ( (setwd5[LA(1)]&0x1) ) {
- }
- else {zzFAIL(1,zzerr22,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==QuotedTerm) ) {
- zzmatch(QuotedTerm);
- e=mystrdup(LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (setwd5[LA(1)]&0x2) ) {
- }
- else {zzFAIL(1,zzerr23,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==Action) ) {
- zzmatch(Action);
-
- a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule token: cannot allocate action");
- strcpy(a, LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (setwd5[LA(1)]&0x4) ) {
- }
- else {zzFAIL(1,zzerr24,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==107) ) {
- zzmatch(107); zzCONSUME;
- }
- else {
- if ( (setwd5[LA(1)]&0x8) ) {
- }
- else {zzFAIL(1,zzerr25,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- chkToken(t, e, a, tnum);
- if (t != NULL) {
- te=(TermEntry *)hash_get(Tname,t);
- if (te != NULL && akaString != NULL) {
- if (te->akaString != NULL) {
- if (strcmp(te->akaString,akaString) != 0) {
- warnFL(eMsg2("this #token statment conflicts with a previous #token %s(\"%s\") statement",
- t,te->akaString),
- FileStr[save_file],save_line);
- };
- } else {
- te->akaString=akaString;
- };
- };
- };
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd5, 0x10);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-block(set * toksrefd,set * rulesrefd)
-#else
-block(toksrefd,rulesrefd)
- set *toksrefd;
-set *rulesrefd ;
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
-
- Graph g, b;
- set saveblah;
- int saveinalt = inAlt;
- ExceptionGroup *eg;
- * toksrefd = empty;
- * rulesrefd = empty;
- set_clr(AST_nodes_refd_in_actions);
- CurBlockID++;
- /* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID;
- CurAltNum = 1;
- /* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum;
- saveblah = attribsRefdFromAction;
- attribsRefdFromAction = empty;
- alt( toksrefd,rulesrefd );
- b = g = zzaArg(zztasp1,1);
-
- if ( ((Junction *)g.left)->p1->ntype == nAction )
- {
- ActionNode *actionNode=(ActionNode *)
- ( ( (Junction *)g.left) ->p1);
- if (!actionNode->is_predicate )
- {
- actionNode->init_action = TRUE;
- /* MR12c */ if (actionNode->noHoist) {
- /* MR12c */ errFL("<<nohoist>> appears as init-action - use <<>> <<nohoist>>",
- /* MR12c */ FileStr[actionNode->file],actionNode->line);
- /* MR12c */ };
- }
- }
- ((Junction *)g.left)->blockid = CurBlockID;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (LA(1)==133) ) {
- eg = exception_group();
-
-
- if ( eg!=NULL ) {
- /* MR7 ***** eg->altID = makeAltID(CurBlockID,CurAltNum); *****/
- /* MR7 ***** CurAltStart->exception_label = eg->altID; *****/
- list_add(&CurExGroups, (void *)eg);
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- CurAltNum++;
- /* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (LA(1)==123) ) {
- zzmatch(123);
- inAlt=1;
- zzCONSUME;
-
- alt( toksrefd,rulesrefd );
- g = Or(g, zzaArg(zztasp2,2));
-
- ((Junction *)g.left)->blockid = CurBlockID;
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- while ( (LA(1)==133) ) {
- eg = exception_group();
-
-
- if ( eg!=NULL ) {
- /* MR7 ***** eg->altID = makeAltID(CurBlockID,CurAltNum); *****/
- /* MR7 ***** CurAltStart->exception_label = eg->altID; *****/
- list_add(&CurExGroups, (void *)eg);
- }
- zzLOOP(zztasp3);
- }
- zzEXIT(zztasp3);
- }
- }
- CurAltNum++;
- /* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum;
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- zzaArg(zztasp1,0) = b;
- attribsRefdFromAction = saveblah; inAlt = saveinalt;
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd5, 0x20);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-alt(set * toksrefd,set * rulesrefd)
-#else
-alt(toksrefd,rulesrefd)
- set *toksrefd;
-set *rulesrefd ;
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- int n=0; Graph g; int e_num=0, old_not=0; Node *node; set elems, dif;
- int first_on_line = 1, use_def_MT_handler = 0;
- g.left=NULL; g.right=NULL;
-
- CurAltStart = NULL;
- elems = empty;
- inAlt = 1;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==88) ) {
- zzmatch(88);
- use_def_MT_handler = 1;
- zzCONSUME;
-
- }
- else {
- if ( (setwd5[LA(1)]&0x40) ) {
- }
- else {zzFAIL(1,zzerr26,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- ;
- while ( (setwd5[LA(1)]&0x80) ) {
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- old_not=0;
- if ( (LA(1)==124) ) {
- zzmatch(124);
- old_not=1;
- zzCONSUME;
-
- }
- else {
- if ( (setwd6[LA(1)]&0x1) ) {
- }
- else {zzFAIL(1,zzerr27,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- node = element( old_not, first_on_line, use_def_MT_handler );
-
- if ( node!=NULL && node->ntype!=nAction ) first_on_line = 0;
-
- if ( zzaArg(zztasp2,2 ).left!=NULL ) {
- g = Cat(g, zzaArg(zztasp2,2));
- n++;
- if ( node!=NULL ) {
- if ( node->ntype!=nAction ) e_num++;
- /* record record number of all rule and token refs */
- if ( node->ntype==nToken ) {
- TokNode *tk = (TokNode *)((Junction *)zzaArg(zztasp2,2 ).left)->p1;
- tk->elnum = e_num;
- set_orel(e_num, &elems);
- }
- else if ( node->ntype==nRuleRef ) {
- RuleRefNode *rn = (RuleRefNode *)((Junction *)zzaArg(zztasp2,2 ).left)->p1;
- rn->elnum = e_num;
- set_orel(e_num, rulesrefd);
- }
- }
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- if ( n == 0 ) g = emptyAlt();
- zzaArg(zztasp1,0) = g;
- /* We want to reduce number of LT(i) calls and the number of
- * local attribute variables in C++ mode (for moment, later we'll
- * do for C also). However, if trees are being built, they
- * require most of the attrib variables to create the tree nodes
- * with; therefore, we gen a token ptr for each token ref in C++
- */
- if ( GenCC && !GenAST )
- {
- /* This now free's the temp set -ATG 5/6/95 */
- set temp;
- temp = set_and(elems, attribsRefdFromAction);
- set_orin( toksrefd, temp);
- set_free(temp);
-}
-else set_orin( toksrefd, elems);
-if ( GenCC ) {
- dif = set_dif(attribsRefdFromAction, elems);
- if ( set_deg(dif)>0 )
- err("one or more $i in action(s) refer to non-token elements");
- set_free(dif);
-}
-set_free(elems);
-set_free(attribsRefdFromAction);
-inAlt = 0;
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd6, 0x2);
- }
-}
-
-LabelEntry *
-#ifdef __USE_PROTOS
-element_label(void)
-#else
-element_label()
-#endif
-{
- LabelEntry * _retv;
- zzRULE;
- zzBLOCK(zztasp1);
- PCCTS_PURIFY(_retv,sizeof(LabelEntry * ))
- zzMake0;
- {
- TermEntry *t=NULL; LabelEntry *l=NULL; RuleEntry *r=NULL; char *lab;
- zzmatch(LABEL);
- lab = mystrdup(LATEXT(1));
- zzCONSUME;
-
-
- UsedNewStyleLabel = 1;
- if ( UsedOldStyleAttrib ) err("cannot mix with new-style labels with old-style $i");
- t = (TermEntry *) hash_get(Tname, lab);
- if ( t==NULL ) t = (TermEntry *) hash_get(Texpr, lab);
- if ( t==NULL ) r = (RuleEntry *) hash_get(Rname, lab);
- if ( t!=NULL ) {
- err(eMsg1("label definition clashes with token/tokclass definition: '%s'", lab));
- _retv = NULL;
- }
- else if ( r!=NULL ) {
- err(eMsg1("label definition clashes with rule definition: '%s'", lab));
- _retv = NULL;
- }
- else {
- /* we don't clash with anybody else */
- l = (LabelEntry *) hash_get(Elabel, lab);
- if ( l==NULL ) { /* ok to add new element label */
- l = (LabelEntry *)hash_add(Elabel,
- lab,
- (Entry *)newLabelEntry(lab));
- /* add to list of element labels for this rule */
- list_add(&CurElementLabels, (void *)lab);
- /* MR7 */ leAdd(l); /* list of labels waiting for exception group definitions */
- _retv = l;
- }
- else {
- err(eMsg1("label definitions must be unique per rule: '%s'", lab));
- _retv = NULL;
-}
-}
- zzmatch(106); zzCONSUME;
- zzEXIT(zztasp1);
- return _retv;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd6, 0x4);
- return _retv;
- }
-}
-
-Node *
-#ifdef __USE_PROTOS
-element(int old_not,int first_on_line,int use_def_MT_handler)
-#else
-element(old_not,first_on_line,use_def_MT_handler)
- int old_not;
-int first_on_line;
-int use_def_MT_handler ;
-#endif
-{
- Node * _retv;
- zzRULE;
- zzBLOCK(zztasp1);
- PCCTS_PURIFY(_retv,sizeof(Node * ))
- zzMake0;
- {
-
- Attrib blk;
- Predicate *pred = NULL;
- int local_use_def_MT_handler=0;
- ActionNode *act;
- RuleRefNode *rr;
- set toksrefd, rulesrefd;
- TermEntry *term;
- TokNode *p=NULL; RuleRefNode *q; int approx=0;
- LabelEntry *label=NULL;
- int predMsgDone=0;
- int semDepth=0;
- int ampersandStyle;
- int height; /* MR11 */
- int equal_height; /* MR11 */
-
- char* pFirstSetSymbol = NULL; /* MR21 */
-
- _retv = NULL;
- if ( (setwd6[LA(1)]&0x8) ) {
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==LABEL) ) {
- label = element_label();
-
- }
- else {
- if ( (setwd6[LA(1)]&0x10) ) {
- }
- else {zzFAIL(1,zzerr28,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
-
- term = (TermEntry *) hash_get(Tname, LATEXT(1));
- if ( term==NULL && UserDefdTokens ) {
- err("implicit token definition not allowed with #tokdefs");
- zzaRet.left = zzaRet.right = NULL;
- }
- else {
- zzaRet = buildToken(LATEXT(1));
- p=((TokNode *)((Junction *)zzaRet.left)->p1);
- term = (TermEntry *) hash_get(Tname, LATEXT(1));
- require( term!= NULL, "hash table mechanism is broken");
- p->tclass = term->tclass;
- p->complement = old_not;
- if ( label!=NULL ) {
- p->el_label = label->str;
- label->elem = (Node *)p;
- }
- }
- zzCONSUME;
-
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==119) ) {
- zzmatch(119); zzCONSUME;
- {
- zzBLOCK(zztasp4);
- zzMake0;
- {
- if ( (LA(1)==QuotedTerm) ) {
- zzmatch(QuotedTerm);
- if ( p!=NULL ) setUpperRange(p, LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
- if ( p!=NULL ) setUpperRange(p, LATEXT(1));
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr29,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp4);
- }
- }
- }
- else {
- if ( (setwd6[LA(1)]&0x20) ) {
- }
- else {zzFAIL(1,zzerr30,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
-
- if ( p!=NULL && (p->upper_range!=0 || p->tclass || old_not) )
- list_add(&MetaTokenNodes, (void *)p);
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==125) ) {
- zzmatch(125);
- if ( p!=NULL ) p->astnode=ASTroot;
- zzCONSUME;
-
- }
- else {
- if ( (setwd6[LA(1)]&0x40) ) {
- if ( p!=NULL ) p->astnode=ASTchild;
- }
- else {
- if ( (LA(1)==103) ) {
- zzmatch(103);
- if ( p!=NULL ) p->astnode=ASTexclude;
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr31,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- zzEXIT(zztasp3);
- }
- }
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==88) ) {
- zzmatch(88);
- local_use_def_MT_handler = 1;
- zzCONSUME;
-
- }
- else {
- if ( (setwd6[LA(1)]&0x80) ) {
- }
- else {zzFAIL(1,zzerr32,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
-
- if ( p!=NULL && first_on_line ) {
- CurAltStart = (Junction *)zzaRet.left;
- altAdd(CurAltStart); /* MR7 */
- p->altstart = CurAltStart;
- }
- if ( p!=NULL )
- p->use_def_MT_handler = use_def_MT_handler || local_use_def_MT_handler;
- _retv = (Node *)p;
- }
- else {
- if ( (LA(1)==QuotedTerm) ) {
- zzmatch(QuotedTerm);
-
- term = (TermEntry *) hash_get(Texpr, LATEXT(1));
- if ( term==NULL && UserDefdTokens ) {
- err("implicit token definition not allowed with #tokdefs");
- zzaRet.left = zzaRet.right = NULL;
- }
- else {
- zzaRet = buildToken(LATEXT(1)); p=((TokNode *)((Junction *)zzaRet.left)->p1);
- p->complement = old_not;
- if ( label!=NULL ) {
- p->el_label = label->str;
- label->elem = (Node *)p;
- }
- }
- zzCONSUME;
-
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==119) ) {
- zzmatch(119); zzCONSUME;
- {
- zzBLOCK(zztasp4);
- zzMake0;
- {
- if ( (LA(1)==QuotedTerm) ) {
- zzmatch(QuotedTerm);
- if ( p!=NULL ) setUpperRange(p, LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
- if ( p!=NULL ) setUpperRange(p, LATEXT(1));
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr33,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp4);
- }
- }
- }
- else {
- if ( (setwd7[LA(1)]&0x1) ) {
- }
- else {zzFAIL(1,zzerr34,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==125) ) {
- zzmatch(125);
- if ( p!=NULL ) p->astnode=ASTroot;
- zzCONSUME;
-
- }
- else {
- if ( (setwd7[LA(1)]&0x2) ) {
- if ( p!=NULL ) p->astnode=ASTchild;
- }
- else {
- if ( (LA(1)==103) ) {
- zzmatch(103);
- if ( p!=NULL ) p->astnode=ASTexclude;
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr35,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- zzEXIT(zztasp3);
- }
- }
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==88) ) {
- zzmatch(88);
- local_use_def_MT_handler = 1;
- zzCONSUME;
-
- }
- else {
- if ( (setwd7[LA(1)]&0x4) ) {
- }
- else {zzFAIL(1,zzerr36,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
-
- if ( p!=NULL && (p->upper_range!=0 || p->tclass || old_not) )
- list_add(&MetaTokenNodes, (void *)p);
-
- if ( first_on_line ) {
- CurAltStart = (Junction *)zzaRet.left;
- altAdd(CurAltStart); /* MR7 */
- p->altstart = CurAltStart;
- }
- if ( p!=NULL )
- p->use_def_MT_handler = use_def_MT_handler || local_use_def_MT_handler;
- _retv = (Node *)p;
- }
- else {
- if ( (LA(1)==WildCard) ) {
- if ( old_not ) warn("~ WILDCARD is an undefined operation (implies 'nothing')");
- zzmatch(WildCard);
- zzaRet = buildWildCard(LATEXT(1)); p=((TokNode *)((Junction *)zzaRet.left)->p1);
- zzCONSUME;
-
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==125) ) {
- zzmatch(125);
- p->astnode=ASTroot;
- zzCONSUME;
-
- }
- else {
- if ( (setwd7[LA(1)]&0x8) ) {
- p->astnode=ASTchild;
- }
- else {
- if ( (LA(1)==103) ) {
- zzmatch(103);
- p->astnode=ASTexclude;
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr37,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- zzEXIT(zztasp3);
- }
- }
- list_add(&MetaTokenNodes, (void *)p);
-
- if ( first_on_line ) {
- CurAltStart = (Junction *)zzaRet.left;
- altAdd(CurAltStart); /* MR7 */
- p->altstart = CurAltStart;
- if ( label!=NULL ) {
- p->el_label = label->str;
- label->elem = (Node *)p;
- }
- }
- _retv = (Node *)p;
- }
- else {
- if ( (LA(1)==NonTerminal) ) {
- if ( old_not ) warn("~ NONTERMINAL is an undefined operation");
- zzmatch(NonTerminal);
- zzaRet = buildRuleRef(LATEXT(1));
- zzCONSUME;
-
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==103) ) {
- zzmatch(103);
- q = (RuleRefNode *) ((Junction *)zzaRet.left)->p1;
- q->astnode=ASTexclude;
- zzCONSUME;
-
- }
- else {
- if ( (setwd7[LA(1)]&0x10) ) {
- }
- else {zzFAIL(1,zzerr38,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (setwd7[LA(1)]&0x20) ) {
- {
- zzBLOCK(zztasp4);
- zzMake0;
- {
- if ( (LA(1)==104) ) {
- zzmatch(104); zzCONSUME;
- }
- else {
- if ( (LA(1)==PassAction) ) {
- }
- else {zzFAIL(1,zzerr39,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp4);
- }
- }
- zzmatch(PassAction);
- addParm(((Junction *)zzaRet.left)->p1, LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (setwd7[LA(1)]&0x40) ) {
- }
- else {zzFAIL(1,zzerr40,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- rr=(RuleRefNode *) ((Junction *)zzaRet.left)->p1;
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- char *a;
- if ( (LA(1)==105) ) {
- zzmatch(105); zzCONSUME;
- zzmatch(PassAction);
-
- a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule element: cannot allocate assignment");
- strcpy(a, LATEXT(1));
- rr->assign = a;
- zzCONSUME;
-
- }
- else {
- if ( (setwd7[LA(1)]&0x80) ) {
- }
- else {zzFAIL(1,zzerr41,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
-
- if ( label!=NULL ) {
- rr->el_label = label->str;
- label->elem = (Node *)rr;
- }
- if ( first_on_line ) {
- CurAltStart = (Junction *)zzaRet.left;
- altAdd(CurAltStart); /* MR7 */
- ((RuleRefNode *)((Junction *)zzaRet.left)->p1)->altstart = CurAltStart;
- }
- _retv = (Node *)rr;
- }
- else {zzFAIL(1,zzerr42,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- }
- zzEXIT(zztasp2);
- }
- }
- }
- else {
- if ( (LA(1)==Action) ) {
- if ( old_not ) warn("~ ACTION is an undefined operation");
- zzmatch(Action);
- zzaArg(zztasp1,0) = buildAction(LATEXT(1),action_file,action_line, 0);
- zzCONSUME;
-
- if ( first_on_line ) { /* MR7 */
- CurAltStart = (Junction *)zzaArg(zztasp1,0 ).left; /* MR7 */
- altAdd(CurAltStart); /* MR7 */
- };
- _retv = (Node *) ((Junction *)zzaArg(zztasp1,0 ).left)->p1;
- }
- else {
- if ( (LA(1)==Pred) ) {
- if ( old_not ) warn("~ SEMANTIC-PREDICATE is an undefined operation");
- zzmatch(Pred);
- zzaArg(zztasp1,0) = buildAction(LATEXT(1),action_file,action_line, 1);
- zzCONSUME;
-
- act = (ActionNode *) ((Junction *)zzaArg(zztasp1,0 ).left)->p1;
- if (numericActionLabel) { /* MR10 */
- list_add(&NumericPredLabels,act); /* MR10 */
- numericActionLabel=0; /* MR10 */
- }; /* MR10 */
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- char *a;
- if ( (LA(1)==PassAction) ) {
- zzmatch(PassAction);
-
- a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule element: cannot allocate predicate fail action");
- strcpy(a, LATEXT(1));
- act->pred_fail = a;
- zzCONSUME;
-
- }
- else {
- if ( (setwd8[LA(1)]&0x1) ) {
- }
- else {zzFAIL(1,zzerr43,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- if ( first_on_line ) { /* MR7 */
- CurAltStart = (Junction *)zzaArg(zztasp1,0 ).left; /* MR7 */
- altAdd(CurAltStart); /* MR7 */
- };
- _retv = (Node *)act;
- }
- else {
- if ( (setwd8[LA(1)]&0x2) ) {
- if ( old_not ) warn("~ BLOCK is an undefined operation");
- BlkLevel++;
- if (BlkLevel >= MAX_BLK_LEVEL) fatal("Blocks nested too deeply");
- /* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID;
- /* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==Pragma) ) {
- zzmatch(Pragma); zzCONSUME;
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==126) ) {
- zzmatch(126);
- approx=LL_k;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==127) ) {
- zzmatch(127);
- approx = 1;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==128) ) {
- zzmatch(128);
- approx = 2;
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr44,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- zzEXIT(zztasp3);
- }
- }
- }
- else {
- if ( (setwd8[LA(1)]&0x4) ) {
- }
- else {zzFAIL(1,zzerr45,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==FirstSetSymbol) ) {
- zzmatch(FirstSetSymbol); zzCONSUME;
- zzmatch(114); zzCONSUME;
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==NonTerminal) ) {
- zzmatch(NonTerminal);
-
- /* MR21 */ pFirstSetSymbol = (char *) calloc(strlen(LATEXT(1))+1,
- /* MR21 */ sizeof(char));
- /* MR21 */ require(pFirstSetSymbol!=NULL,
- /* MR21 */ "cannot allocate first set name");
- /* MR21 */ strcpy(pFirstSetSymbol, LATEXT(1));
- /* MR21 */
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
-
- /* MR21 */ pFirstSetSymbol = (char *) calloc(strlen(LATEXT(1))+1,
- /* MR21 */ sizeof(char));
- /* MR21 */ require(pFirstSetSymbol!=NULL,
- /* MR21 */ "cannot allocate first set name");
- /* MR21 */ strcpy(pFirstSetSymbol, LATEXT(1));
- /* MR21 */
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr46,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- zzmatch(115); zzCONSUME;
- }
- else {
- if ( (setwd8[LA(1)]&0x8) ) {
- }
- else {zzFAIL(1,zzerr47,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==114) ) {
- zzmatch(114); zzCONSUME;
- block( &toksrefd,&rulesrefd );
- zzmatch(115);
- blk = zzaRet = zzaArg(zztasp2,2);
- /* MR23 */ CurBlockID_array[BlkLevel] = (-1);
- /* MR23 */ CurAltNum_array[BlkLevel] = (-1);
- --BlkLevel;
- zzCONSUME;
-
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==129) ) {
- zzmatch(129);
- zzaRet = makeLoop(zzaRet,approx,pFirstSetSymbol);
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==130) ) {
- zzmatch(130);
- zzaRet = makePlus(zzaRet,approx,pFirstSetSymbol);
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==131) ) {
- zzmatch(131); zzCONSUME;
- {
- zzBLOCK(zztasp4);
- zzMake0;
- {
- if ( (setwd8[LA(1)]&0x10) ) {
- {
- zzBLOCK(zztasp5);
- zzMake0;
- {
- if ( (LA(1)==132) ) {
- zzmatch(132);
- ampersandStyle=0;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==113) ) {
- zzmatch(113);
- ampersandStyle=1;
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr48,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp5);
- }
- }
- zzmatch(Pred);
- zzaRet = buildAction(LATEXT(1),action_file,action_line,1);
- zzCONSUME;
-
- act = (ActionNode *) ((Junction *)zzaRet.left)->p1;
- semDepth=predicateLookaheadDepth(act);
- if (numericActionLabel) { /* MR10 */
- list_add(&NumericPredLabels,act); /* MR10 */
- numericActionLabel=0; /* MR10 */
- }; /* MR10 */
- {
- zzBLOCK(zztasp5);
- zzMake0;
- {
- char *a;
- if ( (LA(1)==PassAction) ) {
- zzmatch(PassAction);
-
- a = (char *)calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule element: cannot allocate predicate fail action");
- strcpy(a, LATEXT(1));
- act->pred_fail = a;
- zzCONSUME;
-
- }
- else {
- if ( (setwd8[LA(1)]&0x20) ) {
- }
- else {zzFAIL(1,zzerr49,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp5);
- }
- }
- if ( first_on_line) { /* MR7 */
- CurAltStart=(Junction *)zzaRet.left; /* MR7 */
- altAdd(CurAltStart); /* MR7 */
- };
- _retv = (Node *)act;
-
- pred = computePredFromContextGuard(blk,&predMsgDone); /* MR10 */
- if ( pred==NULL) { /* MR10 */
- if ( !predMsgDone) err("invalid or missing context guard"); /* MR10 */
- predMsgDone=1; /* MR10 */
- } else { /* MR10 */
- act->guardNodes=(Junction *)blk.left; /* MR11 */
- pred->expr = act->action;
- pred->source = act;
- /* MR10 */ pred->ampersandStyle = ampersandStyle; /* 0 means (g)? => ... 1 means (g)? && ... */
- /* MR13 */ if (pred->tcontext != NULL) {
- /* MR13 */ height=MR_max_height_of_tree(pred->tcontext);
- /* MR13 */ equal_height=MR_all_leaves_same_height(pred->tcontext,height);
- /* MR13 */ if (! equal_height) {
- /* MR13 */ errFL("in guarded predicates all tokens in the guard must be at the same height",
- /* MR13 */ FileStr[act->file],act->line);
- /* MR13 */ };
- /* MR13 */ }
- /* MR10 */ if (ampersandStyle) {
- /* MR10 */ act->ampersandPred = pred;
- /* MR11 */ if (! HoistPredicateContext) {
- /* MR11 */ errFL("without \"-prc on\" (guard)? && <<pred>>? ... doesn't make sense",
- /* MR11 */ FileStr[act->file],act->line);
- /* MR11 */ };
- /* MR10 */ } else {
- /* MR10 */ act->guardpred = pred;
- /* MR10 */ };
- /* MR10 */ if (pred->k != semDepth) {
- /* MR10 */ warn(eMsgd2("length of guard (%d) does not match the length of semantic predicate (%d)",
- /* MR10 */ pred->k,semDepth));
- /* MR10 */ };
- }
- }
- else {
- if ( (setwd8[LA(1)]&0x40) ) {
- zzaRet = makeBlk(zzaRet,approx,pFirstSetSymbol);
- FoundGuessBlk = 1;
- ((Junction *) ((Junction *)zzaRet.left)->p1)->guess=1;
- if ( ! first_on_line ) {
- err("(...)? predicate must be first element of production");
- }
- }
- else {zzFAIL(1,zzerr50,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp4);
- }
- }
- }
- else {
- if ( (setwd8[LA(1)]&0x80) ) {
- zzaRet = makeBlk(zzaRet,approx,pFirstSetSymbol);
- }
- else {zzFAIL(1,zzerr51,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- }
- zzEXIT(zztasp3);
- }
- }
-
- if ( pred==NULL && !predMsgDone) { /* MR10 */
- ((Junction *)((Junction *)zzaRet.left)->p1)->blockid = CurBlockID;
- ((Junction *)((Junction *)zzaRet.left)->p1)->tokrefs = toksrefd;
- ((Junction *)((Junction *)zzaRet.left)->p1)->rulerefs = rulesrefd;
- if ( first_on_line ) { /* MR7 */
- CurAltStart = (Junction *)((Junction *)((Junction *)zzaRet.left)->p1); /* MR7 */
- altAdd(CurAltStart); /* MR7 */
- }; /* MR7 */
- _retv = (Node *) ((Junction *)zzaRet.left)->p1;
- }
- }
- else {
- if ( (LA(1)==102) ) {
- zzmatch(102); zzCONSUME;
- block( &toksrefd,&rulesrefd );
- zzaRet = makeOpt(zzaArg(zztasp2,2),approx,pFirstSetSymbol);
- /* MR23 */ CurBlockID_array[BlkLevel] = (-1);
- /* MR23 */ CurAltNum_array[BlkLevel] = (-1);
- --BlkLevel;
- zzmatch(98);
-
- ((Junction *)((Junction *)zzaRet.left)->p1)->blockid = CurBlockID;
- ((Junction *)((Junction *)zzaRet.left)->p1)->tokrefs = toksrefd;
- ((Junction *)((Junction *)zzaRet.left)->p1)->rulerefs = rulesrefd;
- zzCONSUME;
-
- if ( first_on_line ) { /* MR7 */
- CurAltStart = (Junction *) ((Junction *)((Junction *)zzaRet.left)->p1); /* MR7 */
- altAdd(CurAltStart); /* MR7 */
- };
- _retv = (Node *) ((Junction *)zzaRet.left)->p1;
- }
- else {zzFAIL(1,zzerr52,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- }
- else {
- if ( (LA(1)==129) ) {
- zzmatch(129);
- warn("don't you want a ')' with that '*'?"); CannotContinue=TRUE;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==130) ) {
- zzmatch(130);
- warn("don't you want a ')' with that '+'?"); CannotContinue=TRUE;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==105) ) {
- zzmatch(105);
- warn("'>' can only appear after a nonterminal"); CannotContinue=TRUE;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==PassAction) ) {
- zzmatch(PassAction);
- warn("[...] out of context 'rule > [...]'");
- CannotContinue=TRUE;
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr53,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- }
- }
- }
- }
- }
- zzEXIT(zztasp1);
- return _retv;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd9, 0x1);
- return _retv;
- }
-}
-
-void
-#ifdef __USE_PROTOS
-default_exception_handler(void)
-#else
-default_exception_handler()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- DefaultExGroup = exception_group();
-
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd9, 0x2);
- }
-}
-
-ExceptionGroup *
-#ifdef __USE_PROTOS
-exception_group(void)
-#else
-exception_group()
-#endif
-{
- ExceptionGroup * _retv;
- zzRULE;
- zzBLOCK(zztasp1);
- PCCTS_PURIFY(_retv,sizeof(ExceptionGroup * ))
- zzMake0;
- {
- ExceptionHandler *h; LabelEntry *label=NULL; /* MR6 */
- FoundException = 1; FoundExceptionGroup = 1;
- zzmatch(133);
- _retv = (ExceptionGroup *)calloc(1, sizeof(ExceptionGroup));
- zzCONSUME;
-
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- char *p;
- if ( (LA(1)==PassAction) ) {
- zzmatch(PassAction);
-
- p = LATEXT(1)+1;
- p[strlen(p)-1] = '\0'; /* kill trailing space */
- label = (LabelEntry *) hash_get(Elabel, LATEXT(1)+1);
- if ( label==NULL )
- {
- err(eMsg1("unknown label in exception handler: '%s'", LATEXT(1)+1));
- }
- zzCONSUME;
-
- }
- else {
- if ( (setwd9[LA(1)]&0x4) ) {
- }
- else {zzFAIL(1,zzerr54,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (LA(1)==135) ) {
- h = exception_handler();
-
- list_add(&(_retv->handlers), (void *)h);
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==134) ) {
- zzmatch(134); zzCONSUME;
- zzmatch(106); zzCONSUME;
- zzmatch(Action);
- {
- ExceptionHandler *eh = (ExceptionHandler *)
- calloc(1, sizeof(ExceptionHandler));
- char *a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(eh!=NULL, "exception: cannot allocate handler");
- require(a!=NULL, "exception: cannot allocate action");
- strcpy(a, LATEXT(1));
- eh->action = a;
- eh->signalname = (char *) calloc(strlen("default")+1, sizeof(char));
- require(eh->signalname!=NULL, "exception: cannot allocate sig name");
- strcpy(eh->signalname, "default");
- list_add(&(_retv->handlers), (void *)eh);
- }
- zzCONSUME;
-
- }
- else {
- if ( (setwd9[LA(1)]&0x8) ) {
- }
- else {zzFAIL(1,zzerr55,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
-
- if ( label!=NULL ) {
- /* Record ex group in sym tab for this label */
- if ( label->ex_group!=NULL ) {
- err(eMsg1("duplicate exception handler for label '%s'",label->str));
- } else {
- label->ex_group = _retv;
- /* Label the exception group itself */
- _retv->label = label->str;
- /* Make the labelled element pt to the exception also */
- /* MR6 */ if (label->elem == NULL) {
- /* MR6 */ err(eMsg1("reference in exception handler to undefined label '%s'",label->str));
- /* MR6 */ } else {
- switch ( label->elem->ntype ) {
- case nRuleRef :
- {
- RuleRefNode *r = (RuleRefNode *)label->elem;
- r->ex_group = _retv;
- break;
- }
- case nToken :
- {
- TokNode *t = (TokNode *)label->elem;
- t->ex_group = _retv;
- break;
- }
- } /* end switch */
- /* MR6 */ }; /* end test on label->elem */
- } /* end test on label->ex_group */
-
- } /* end test on exception label */
-
-/* MR7 */
- /* MR7 */ if (BlkLevel == 1 && label == NULL) {
- /* MR7 */ _retv->forRule=1;
- /* MR7 */ } else if (label == NULL) {
- /* MR7 */ _retv->altID = makeAltID(CurBlockID_array[BlkLevel], CurAltNum_array[BlkLevel]);
- /* MR7 */ egAdd(_retv);
- /* MR7 */ } else {
- /* MR7 */ _retv->labelEntry=label;
- /* MR7 */ };
- /* MR7 */
- /* MR7 */ /* You may want to remove this exc from the rule list */
- /* MR7 */ /* and handle at the labeled element site. */
- /* MR7 */
- /* MR7 */ if (label != NULL) {
- /* MR7 */ _retv = NULL;
- /* MR7 */ };
- zzEXIT(zztasp1);
- return _retv;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd9, 0x10);
- return _retv;
- }
-}
-
-ExceptionHandler *
-#ifdef __USE_PROTOS
-exception_handler(void)
-#else
-exception_handler()
-#endif
-{
- ExceptionHandler * _retv;
- zzRULE;
- zzBLOCK(zztasp1);
- PCCTS_PURIFY(_retv,sizeof(ExceptionHandler * ))
- zzMake0;
- {
- ;
- zzmatch(135);
-
- _retv = (ExceptionHandler *)calloc(1, sizeof(ExceptionHandler));
- require(_retv!=NULL, "exception: cannot allocate handler");
- zzCONSUME;
-
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==NonTerminal) ) {
- zzmatch(NonTerminal);
-
- _retv->signalname = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(_retv->signalname!=NULL, "exception: cannot allocate sig name");
- strcpy(_retv->signalname, LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==TokenTerm) ) {
- zzmatch(TokenTerm);
-
- _retv->signalname = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(_retv->signalname!=NULL, "exception: cannot allocate sig name");
- strcpy(_retv->signalname, LATEXT(1));
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr56,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- zzmatch(106); zzCONSUME;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- _retv->action = NULL;
- if ( (LA(1)==Action) ) {
- zzmatch(Action);
-
- _retv->action = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(_retv->action!=NULL, "exception: cannot allocate action");
- strcpy(_retv->action, LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (setwd9[LA(1)]&0x20) ) {
- }
- else {zzFAIL(1,zzerr57,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- zzEXIT(zztasp1);
- return _retv;
-fail:
- zzEXIT(zztasp1);
- CannotContinue=TRUE;
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd9, 0x40);
- return _retv;
- }
-}
-
-void
-#ifdef __USE_PROTOS
-enum_file(char * fname)
-#else
-enum_file(fname)
- char *fname ;
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- if ( (setwd9[LA(1)]&0x80) ) {
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==143) ) {
- zzmatch(143); zzCONSUME;
- zzmatch(ID); zzCONSUME;
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==149) ) {
- zzmatch(149); zzCONSUME;
- zzmatch(ID); zzCONSUME;
- }
- else {
- if ( (setwd10[LA(1)]&0x1) ) {
- }
- else {zzFAIL(1,zzerr58,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp3);
- }
- }
- }
- else {
- if ( (setwd10[LA(1)]&0x2) ) {
- }
- else {zzFAIL(1,zzerr59,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==151) ) {
- {
- zzBLOCK(zztasp3);
- int zzcnt=1;
- zzMake0;
- {
- do {
- enum_def( fname );
- zzLOOP(zztasp3);
- } while ( (LA(1)==151) );
- zzEXIT(zztasp3);
- }
- }
- }
- else {
- if ( (LA(1)==149) ) {
- defines( fname );
- }
- else {zzFAIL(1,zzerr60,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- }
- else {
- if ( (LA(1)==Eof) ) {
- }
- else {zzFAIL(1,zzerr61,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd10, 0x4);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-defines(char * fname)
-#else
-defines(fname)
- char *fname ;
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- int v; int maxt=(-1); char *t;
- {
- zzBLOCK(zztasp2);
- int zzcnt=1;
- zzMake0;
- {
- do {
- zzmatch(149); zzCONSUME;
- zzmatch(ID);
- t = mystrdup(LATEXT(1));
- zzCONSUME;
-
- zzmatch(INT);
-
- v = atoi(LATEXT(1));
- /* fprintf(stderr, "#token %s=%d\n", t, v);*/
-
- /* MR2 Andreas Magnusson (Andreas.Magnusson@mailbox.swipnet.se) */
- /* MR2 Fix to bug introduced by 1.33MR1 for #tokdefs */
- /* MR2 Don't let #tokdefs be confused by */
- /* MR2 DLGminToken and DLGmaxToken */
-
- if ( ! isDLGmaxToken(t)) { /* MR2 */
- TokenNum = v;
- if ( v>maxt ) maxt=v;
- if ( Tnum( t ) == 0 ) {
- addForcedTname( t, v );
- } else {
- warnFL(eMsg1("redefinition of token %s; ignored",t), fname,zzline);
- };
-};
- zzCONSUME;
-
- zzLOOP(zztasp2);
- } while ( (LA(1)==149) );
- zzEXIT(zztasp2);
- }
- }
- TokenNum = maxt + 1;
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd10, 0x8);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-enum_def(char * fname)
-#else
-enum_def(fname)
- char *fname ;
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- int v= 0; int maxt=(-1); char *t;
- zzmatch(151); zzCONSUME;
- zzmatch(ID); zzCONSUME;
- zzmatch(152); zzCONSUME;
- zzmatch(ID);
- t = mystrdup(LATEXT(1));
- zzCONSUME;
-
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==153) ) {
- zzmatch(153); zzCONSUME;
- zzmatch(INT);
- v=atoi(LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (setwd10[LA(1)]&0x10) ) {
- v++;
- }
- else {zzFAIL(1,zzerr62,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
-
- /* fprintf(stderr, "#token %s=%d\n", t, v);*/
- TokenNum = v;
- if ( v>maxt ) maxt=v; /* MR3 */
- if ( Tnum( t ) == 0 ) addForcedTname( t, v );
- else {
- warnFL(eMsg1("redefinition of token %s; ignored",t), fname,zzline);
- }
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (LA(1)==154) ) {
- zzmatch(154); zzCONSUME;
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==ID)&&(isDLGmaxToken(LATEXT(1))) ) {
- if (!(isDLGmaxToken(LATEXT(1))) ) {zzfailed_pred(" isDLGmaxToken(LATEXT(1))",0 /* report */, { 0; /* no user action */ } );}
- zzmatch(ID); zzCONSUME;
- {
- zzBLOCK(zztasp4);
- zzMake0;
- {
- if ( (LA(1)==153) ) {
- zzmatch(153); zzCONSUME;
- zzmatch(INT); zzCONSUME;
- }
- else {
- if ( (setwd10[LA(1)]&0x20) ) {
- }
- else {zzFAIL(1,zzerr63,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp4);
- }
- }
- }
- else {
- if ( (LA(1)==ID) ) {
- zzmatch(ID);
- t = mystrdup(LATEXT(1));
- zzCONSUME;
-
- {
- zzBLOCK(zztasp4);
- zzMake0;
- {
- if ( (LA(1)==153) ) {
- zzmatch(153); zzCONSUME;
- zzmatch(INT);
- v=atoi(LATEXT(1));
- zzCONSUME;
-
- }
- else {
- if ( (setwd10[LA(1)]&0x40) ) {
- v++;
- }
- else {zzFAIL(1,zzerr64,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp4);
- }
- }
-
- /* fprintf(stderr, "#token %s=%d\n", t, v);*/
- TokenNum = v;
- if ( v>maxt ) maxt=v; /* MR3 */
- if ( Tnum( t ) == 0 ) addForcedTname( t, v );
- else {
- warnFL(eMsg1("redefinition of token %s; ignored",t), fname,zzline);
- }
- }
- else {
- if ( (setwd10[LA(1)]&0x80) ) {
- }
- else {zzFAIL(1,zzerr65,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- zzEXIT(zztasp3);
- }
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- zzmatch(155); zzCONSUME;
- zzmatch(156);
- TokenNum = maxt + 1;
- zzCONSUME;
-
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd11, 0x1);
- }
-}
-
-
-/* MR2 Andreas Magnusson (Andreas.Magnusson@mailbox.swipnet.se) */
-/* MR2 Fix to bug introduced by 1.33MR1 for #tokdefs */
-/* MR2 Don't let #tokdefs be confused by */
-/* MR2 DLGminToken and DLGmaxToken */
-
-/* semantic check on DLGminToken and DLGmaxmaxToken in #tokdefs */
-
-#ifdef __USE_PROTOS
-static int isDLGmaxToken(char *Token)
-#else
-static int isDLGmaxToken(Token)
-char * Token;
-#endif
-{
-static char checkStr1[] = "DLGmaxToken";
-static char checkStr2[] = "DLGminToken";
-
- if (strcmp(Token, checkStr1) == 0)
-return 1;
-else if (strcmp(Token, checkStr2) == 0)
-return 1;
-else
-return 0;
-}
-
-/* semantics of #token */
-static void
-#ifdef __USE_PROTOS
-chkToken(char *t, char *e, char *a, int tnum)
-#else
-chkToken(t,e,a,tnum)
-char *t, *e, *a;
-int tnum;
-#endif
-{
-TermEntry *p;
-
- /* check to see that they don't try to redefine a token as a token class */
-if ( t!=NULL ) {
-p = (TermEntry *) hash_get(Tname, t);
-if ( p!=NULL && p->classname ) {
- err(eMsg1("redefinition of #tokclass '%s' to #token not allowed; ignored",t));
- if ( a!=NULL ) free((char *)a);
- return;
-}
-}
-
- if ( t==NULL && e==NULL ) { /* none found */
-err("#token requires at least token name or rexpr");
-}
-else if ( t!=NULL && e!=NULL ) { /* both found */
-if ( UserDefdTokens ) { /* if #tokdefs, must not define new */
- p = (TermEntry *) hash_get(Tname, t);
- if ( p == NULL) {
- err(eMsg1("new token definition '%s' not allowed - only #token with name already defined by #tokdefs file allowed",t));
- return;
- };
-}
-Tklink(t, e);
-if ( a!=NULL ) {
- if ( hasAction(e) ) {
- err(eMsg1("redefinition of action for %s; ignored",e));
- }
- else setHasAction(e, a);
-}
-}
-else if ( t!=NULL ) { /* only one found */
-if ( UserDefdTokens ) {
- p = (TermEntry *) hash_get(Tname, t);
- if (p == NULL) {
- err(eMsg1("new token definition '%s' not allowed - only #token with name already defined by #tokdefs file allowed",t));
- };
- return;
-}
-if ( Tnum( t ) == 0 ) addTname( t );
-else {
- err(eMsg1("redefinition of token %s; ignored",t));
-}
-if ( a!=NULL ) {
- err(eMsg1("action cannot be attached to a token name (%s); ignored",t));
- free((char *)a);
-}
-}
-else if ( e!=NULL ) {
-if ( Tnum( e ) == 0 ) addTexpr( e );
-else {
- if ( hasAction(e) ) {
- err(eMsg1("redefinition of action for expr %s; ignored",e));
- }
- else if ( a==NULL ) {
- err(eMsg1("redefinition of expr %s; ignored",e));
- }
-}
-if ( a!=NULL ) setHasAction(e, a);
-}
-
- /* if a token type number was specified, then add the token ID and 'tnum'
-* pair to the ForcedTokens list. (only applies if an id was given)
-*/
-if ( t!=NULL && tnum>0 )
-{
-if ( set_el(tnum, reserved_positions) )
-{
- err(eMsgd("a token has already been forced to token number %d; ignored", tnum));
-}
-else
-{
- list_add(&ForcedTokens, newForcedToken(t,tnum));
- set_orel(tnum, &reserved_positions);
-}
-}
-}
-
-static int
-#ifdef __USE_PROTOS
-match_token(char *s, char **nxt)
-#else
-match_token(s,nxt)
-char *s;
-char **nxt;
-#endif
-{
- if ( !(*s>='A' && *s<='Z') ) return 0;
- s++;
- while ( (*s>='a' && *s<='z') ||
- (*s>='A' && *s<='Z') ||
- (*s>='0' && *s<='9') ||
- *s=='_' )
- {
- s++;
- }
- if ( *s!=' ' && *s!='}' ) return 0;
- *nxt = s;
- return 1;
-}
-
-static int
-#ifdef __USE_PROTOS
-match_rexpr(char *s, char **nxt)
-#else
-match_rexpr(s,nxt)
-char *s;
-char **nxt;
-#endif
-{
- if ( *s!='"' ) return 0;
- s++;
- while ( *s!='"' )
- {
- if ( *s=='\n' || *s=='\r' ) /* MR13 */
- warn("eoln found in regular expression");
- if ( *s=='\\' ) s++;
- s++;
- }
- *nxt = s+1;
- return 1;
-}
-
-/*
-* Walk a string "{ A .. Z }" where A..Z is a space separated list
-* of token references (either labels or reg exprs). Return a
-* string "inlineX_set" for some unique integer X. Basically,
-* we pretend as if we had seen "#tokclass inlineX { A .. Z }"
-* on the input stream outside of an action.
-*/
-char *
-#ifdef __USE_PROTOS
-inline_set(char *s)
-#else
-inline_set(s)
-char *s;
-#endif
-{
- char *nxt;
- fprintf(stderr, "found consumeUntil( {...} )\n");
- while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;}
- if ( *s!='{' )
- {
- err("malformed consumeUntil( {...} ); missing '{'");
- return "bad_set";
- }
- s++;
- while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;}
- while ( *s!='}' )
- {
- if ( match_token(s,&nxt) ) fprintf(stderr, "found token %s\n", s);
- else if ( match_rexpr(s,&nxt) ) fprintf(stderr, "found rexpr %s\n", s);
- else {
- err("invalid element in consumeUntil( {...} )");
- return "bad_set";
- }
- s = nxt;
- while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;}
- }
- return "inlineX_set";
-}
-
-/* ANTLR-specific syntax error message generator
-* (define USER_ZZSYN when compiling so don't get 2 definitions)
-*/
-void
-#ifdef __USE_PROTOS
-zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok,
-int k, char *bad_text)
-#else
-zzsyn(text, tok, egroup, eset, etok, k, bad_text)
-char *text, *egroup, *bad_text;
-int tok;
-int etok;
-int k;
-SetWordType *eset;
-#endif
-{
-fprintf(stderr, ErrHdr, FileStr[CurFile]!=NULL?FileStr[CurFile]:"stdin", zzline);
-fprintf(stderr, " syntax error at \"%s\"", (tok==zzEOF_TOKEN)?"EOF":text);
-if ( !etok && !eset ) {fprintf(stderr, "\n"); return;}
-if ( k==1 ) fprintf(stderr, " missing");
-else
-{
-fprintf(stderr, "; \"%s\" not", bad_text);
-if ( zzset_deg(eset)>1 ) fprintf(stderr, " in");
-}
-if ( zzset_deg(eset)>0 ) zzedecode(eset);
-else fprintf(stderr, " %s", zztokens[etok]);
-if ( strlen(egroup) > (size_t)0 ) fprintf(stderr, " in %s", egroup);
-fprintf(stderr, "\n");
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.g b/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.g
deleted file mode 100644
index e6eda6010c..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.g
+++ /dev/null
@@ -1,2586 +0,0 @@
-/*
- * antlr.g -- PCCTS Version 1.xx ANTLR
- *
- * Parse an antlr input grammar and build a syntax-diagram.
- *
- * Written in itself (needs at least 1.06 to work)
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-1995
- */
-
-/* MR1 */
-/* MR1 10-Apr-97 MR1 Replace #if logic with #include "pcctscfg.h" */
-/* MR1 */
-
-#header <<
- #include "pcctscfg.h"
- #include "set.h"
- #include <ctype.h>
- #include "syn.h"
- #include "hash.h"
- #include "generic.h"
- #define zzcr_attr(attr,tok,t)
- >>
-
-<<
-
-/* MR20 G. Hobbelt For Borland C++ 4.x & 5.x compiling with ALL warnings enabled */
-#if defined(__TURBOC__)
-#pragma warn -aus /* unused assignment of 'xxx' */
-#endif
-
-
-#ifdef __USE_PROTOS
-static void chkToken(char *, char *, char *, int);
-#else
-static void chkToken();
-#endif
-
-#ifdef __USE_PROTOS
-static int isDLGmaxToken(char *Token); /* MR3 */
-#else
-static int isDLGmaxToken(); /* MR3 */
-#endif
-
-static int class_nest_level = 0;
-
-/* MR20 G. Hobbelt extern definitions moved to antlr.h */
-
->>
-
-#lexaction <<
-/* maintained, but not used for now */
-set AST_nodes_refd_in_actions = set_init;
-int inAlt = 0;
-set attribsRefdFromAction = set_init; /* MR20 */
-int UsedOldStyleAttrib = 0;
-int UsedNewStyleLabel = 0;
-#ifdef __USE_PROTOS
-char *inline_set(char *);
-#else
-char *inline_set();
-#endif
-
-/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */
-/* MR1 in DLG action */
-
-int tokenActionActive=0; /* MR1 */
-
->>
-
-#lexclass STRINGS
-#token QuotedTerm "\"" << zzmode(START); >>
-#token "\n|\r|\r\n" <<
- zzline++;
- warn("eoln found in string");
- zzskip();
- >>
-#token "\\(\n|\r|\r\n)" << zzline++; zzmore(); >>
-#token "\\~[]" << zzmore(); >>
-#token "~[\n\r\"\\]+" << zzmore(); >>
-
-#lexclass ACTION_STRINGS
-#token "\"" << zzmode(ACTIONS); zzmore(); >>
-#token "\n|\r|\r\n" <<
- zzline++;
- warn("eoln found in string (in user action)");
- zzskip();
- >>
-#token "\\(\n|\r|\r\n)" << zzline++; zzmore(); >>
-#token "\\~[]" << zzmore(); >>
-#token "~[\n\r\"\\]+" << zzmore(); >>
-
-#lexclass ACTION_CHARS
-#token "'" << zzmode(ACTIONS); zzmore(); >>
-#token "\n|\r|\r\n" <<
- zzline++;
- warn("eoln found in char literal (in user action)");
- zzskip();
- >>
-#token "\\~[]" << zzmore(); >>
-#token "~[\n\r'\\]+" << zzmore(); >>
-
-#lexclass ACTION_COMMENTS
-#token "\*/" << zzmode(ACTIONS); zzmore(); >>
-#token "\*" << zzmore(); >>
-#token "\n|\r|\r\n" << zzline++; zzmore(); DAWDLE; >>
-#token "~[\n\r\*]+" << zzmore(); >>
-
-#lexclass TOK_DEF_COMMENTS
-#token "\*/" << zzmode(PARSE_ENUM_FILE);
- zzmore(); >>
-#token "\*" << zzmore(); >>
-#token "\n|\r|\r\n" << zzline++; zzmore(); DAWDLE; >>
-#token "~[\n\r\*]+" << zzmore(); >>
-
-#lexclass TOK_DEF_CPP_COMMENTS
-#token "\n|\r|\r\n" << zzline++; zzmode(PARSE_ENUM_FILE); zzskip(); DAWDLE; >>
-#token "~[\n\r]+" << zzskip(); >>
-
-#lexclass ACTION_CPP_COMMENTS
-#token "\n|\r|\r\n" << zzline++; zzmode(ACTIONS); zzmore(); DAWDLE; >>
-#token "~[\n\r]+" << zzmore(); >>
-
-#lexclass CPP_COMMENTS
-#token "\n|\r|\r\n" << zzline++; zzmode(START); zzskip(); DAWDLE; >>
-#token "~[\n\r]+" << zzskip(); >>
-
-#lexclass COMMENTS
-#token "\*/" << zzmode(START); zzskip(); >>
-#token "\*" << zzskip(); >>
-#token "\n|\r|\r\n" << zzline++; zzskip(); DAWDLE; >>
-#token "~[\n\r\*]+" << zzskip(); >>
-
-/*
- * This lexical class accepts actions of type [..] and <<..>>
- *
- * It translates the following special items for C:
- *
- * $j --> "zzaArg(current zztasp, j)"
- * $i.j --> "zzaArg(zztaspi, j)"
- * $i.nondigit> "zzaArg(current zztasp, i).nondigit"
- * $$ --> "zzaRet"
- * $alnum --> "alnum" (used to ref parameters)
- * $rule --> "zzaRet"
- * $retval --> "_retv.retval" if > 1 return values else "_retv"
- * $[token, text] --> "zzconstr_attr(token, text)"
- * $[] --> "zzempty_attr()"
- *
- * It translates the following special items for C++:
- * (attributes are now stored with 'Token' and $i's are only
- * pointers to the Tokens. Rules don't have attributes now.)
- *
- * $j --> "_tbj" where b is the block level
- * $i.j --> "_tij"
- * $j->nondigit> "_tbj->nondigit"
- * $$ --> "$$"
- * $alnum --> "alnum" (used to ref parameters)
- * $rule --> "$rule"
- * $retval --> "_retv.retval" if > 1 return values else "_retv"
- * $[token, text] --> invalid
- * $[] --> invalid
- *
- * And, for trees:
- *
- * #0 --> "(*_root)"
- * #i --> "zzastArg(i)"
- * #[args] --> "zzmk_ast(zzastnew(), args)"
- * #[] --> "zzastnew()"
- * #( root, child1, ..., childn )
- * --> "zztmake(root, child1, ...., childn, NULL)"
- * #() --> "NULL"
- *
- * For C++, ...
- *
- * #0 --> "(*_root)"
- * #i --> "_astbi" where b is the block level
- * #alnum --> "alnum_ast" (used to ref #label)
- * #[args] --> "new AST(args)"
- * #[] --> "new AST"
- * #( root, child1, ..., childn )
- * --> "AST::tmake(root, child1, ...., childn, NULL)"
- * #() --> "NULL"
- *
- * To escape,
- *
- * \] --> ]
- * \) --> )
- * \$ --> $
- * \# --> #
- *
- * A stack is used to nest action terminators because they can be nested
- * like crazy: << #[$[..],..] >>
- */
-#lexclass ACTIONS
-#token Action "\>\>" << /* these do not nest */
- zzmode(START);
- NLATEXT[0] = ' ';
- NLATEXT[1] = ' ';
- zzbegexpr[0] = ' ';
- zzbegexpr[1] = ' ';
- if ( zzbufovf ) {
- err( eMsgd("action buffer overflow; size %d",ZZLEXBUFSIZE));
- }
-
-/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */
-/* MR1 in DLG action */
-/* MR1 Doesn't matter what kind of action it is - reset*/
-
- tokenActionActive=0; /* MR1 */
- >>
-#token Pred "\>\>?" << /* these do not nest */
- zzmode(START);
- NLATEXT[0] = ' ';
- NLATEXT[1] = ' ';
- zzbegexpr[0] = '\0';
- if ( zzbufovf ) {
- err( eMsgd("predicate buffer overflow; size %d",ZZLEXBUFSIZE));
- };
-#ifdef __cplusplus__
-/* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred);
-#else
-#ifdef __STDC__
-/* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred);
-#else
-#ifdef __USE_PROTOS
-/* MRxx */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred);
-#else
-/* MR10 */ list_apply(CurActionLabels,mark_label_used_in_sem_pred);
-#endif
-#endif
-#endif
- >>
-#token PassAction "\]" << if ( topint() == ']' ) {
- popint();
- if ( istackempty() ) /* terminate action */
- {
- zzmode(START);
- NLATEXT[0] = ' ';
- zzbegexpr[0] = ' ';
- if ( zzbufovf ) {
- err( eMsgd("parameter buffer overflow; size %d",ZZLEXBUFSIZE));
- }
- }
- else {
- /* terminate $[..] and #[..] */
- if ( GenCC ) zzreplstr("))");
- else zzreplstr(")");
- zzmore();
- }
- }
- else if ( topint() == '|' ) { /* end of simple [...] */
- popint();
- zzmore();
- }
- else zzmore();
- >>
-#token "consumeUntil\( [\ \t]* \{~[\}]+\} [\ \t]* \)"
- <<
- zzmore();
- zzreplstr(inline_set(zzbegexpr+
- strlen("consumeUntil(")));
- >>
-#token "consumeUntil\( ~[\)]+ \)"
- << zzmore(); >>
-#token "\n|\r|\r\n" << zzline++; zzmore(); DAWDLE; >>
-#token "\>" << zzmore(); >>
-#token "$" << zzmore(); >>
-#token "$$" << if ( !GenCC ) {zzreplstr("zzaRet"); zzmore();}
- else err("$$ use invalid in C++ mode"); >>
-
-#token "$\[\]" << if ( !GenCC ) {zzreplstr("zzempty_attr"); zzmore();}
- else err("$[] use invalid in C++ mode"); >>
-#token "$\[" <<
- pushint(']');
- if ( !GenCC ) zzreplstr("zzconstr_attr(");
- else err("$[..] use invalid in C++ mode");
- zzmore();
- >>
-#token "$[0-9]+" <<{
- static char buf[100];
- numericActionLabel=1; /* MR10 */
- if ( strlen(zzbegexpr)>(size_t)85 )
- fatal("$i attrib ref too big");
- set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction);
- if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s)",
- BlkLevel-1,zzbegexpr+1);
- else sprintf(buf,"_t%d%s",
- BlkLevel-1,zzbegexpr+1);
- zzreplstr(buf);
- zzmore();
- UsedOldStyleAttrib = 1;
- if ( UsedNewStyleLabel )
- err("cannot mix old-style $i with new-style labels");
- }
- >>
-#token "$[0-9]+." <<{
- static char buf[100];
- numericActionLabel=1; /* MR10 */
- if ( strlen(zzbegexpr)>(size_t)85 )
- fatal("$i.field attrib ref too big");
- zzbegexpr[strlen(zzbegexpr)-1] = ' ';
- set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction);
- if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s).",
- BlkLevel-1,zzbegexpr+1);
- else sprintf(buf,"_t%d%s.",
- BlkLevel-1,zzbegexpr+1);
- zzreplstr(buf);
- zzmore();
- UsedOldStyleAttrib = 1;
- if ( UsedNewStyleLabel )
- err("cannot mix old-style $i with new-style labels");
- }
- >>
-#token "$[0-9]+.[0-9]+" <<{
- static char buf[100];
- static char i[20], j[20];
- char *p,*q;
- numericActionLabel=1; /* MR10 */
- if (strlen(zzbegexpr)>(size_t)85) fatal("$i.j attrib ref too big");
- for (p=zzbegexpr+1,q= &i[0]; *p!='.'; p++) {
- if ( q == &i[20] )
- fatalFL("i of $i.j attrib ref too big",
- FileStr[CurFile], zzline );
- *q++ = *p;
- }
- *q = '\0';
- for (p++, q= &j[0]; *p!='\0'; p++) {
- if ( q == &j[20] )
- fatalFL("j of $i.j attrib ref too big",
- FileStr[CurFile], zzline );
- *q++ = *p;
- }
- *q = '\0';
- if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%s,%s)",i,j);
- else sprintf(buf,"_t%s%s",i,j);
- zzreplstr(buf);
- zzmore();
- UsedOldStyleAttrib = 1;
- if ( UsedNewStyleLabel )
- err("cannot mix old-style $i with new-style labels");
- }
- >>
-#token "$[_a-zA-Z][_a-zA-Z0-9]*"
- <<{ static char buf[300]; LabelEntry *el;
- zzbegexpr[0] = ' ';
- if ( CurRule != NULL &&
- strcmp(CurRule, &zzbegexpr[1])==0 ) {
- if ( !GenCC ) zzreplstr("zzaRet");
- }
- else if ( CurRetDef != NULL &&
- strmember(CurRetDef, &zzbegexpr[1])) {
- if ( hasMultipleOperands( CurRetDef ) ) {
- require (strlen(zzbegexpr)<=(size_t)285,
- "$retval attrib ref too big");
- sprintf(buf,"_retv.%s",&zzbegexpr[1]);
- zzreplstr(buf);
- }
- else zzreplstr("_retv");
- }
- else if ( CurParmDef != NULL &&
- strmember(CurParmDef, &zzbegexpr[1])) {
- ;
- }
- else if ( Elabel==NULL ) {
- { err("$-variables in actions outside of rules are not allowed"); }
- } else if ( (el=(LabelEntry *)hash_get(Elabel, &zzbegexpr[1]))!=NULL ) {
-/* MR10 */
-/* MR10 */ /* element labels might exist without an elem when */
-/* MR10 */ /* it is a forward reference (to a rule) */
-/* MR10 */
-/* MR10 */ if ( GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) )
-/* MR10 */ { err(eMsg1("There are no token ptrs for rule references: '$%s'",&zzbegexpr[1])); }
-/* MR10 */
-/* MR10 */ if ( !GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) && GenAST) {
-/* MR10 */ err("You can no longer use attributes returned by rules when also using ASTs");
-/* MR10 */ err(" Use upward inheritance (\"rule >[Attrib a] : ... <<$a=...\>\>\")");
-/* MR10 */ };
-/* MR10 */
-/* MR10 */ /* keep track of <<... $label ...>> for semantic predicates in guess mode */
-/* MR10 */ /* element labels contain pointer to the owners node */
-/* MR10 */
-/* MR10 */ if (el->elem != NULL && el->elem->ntype == nToken) {
-/* MR10 */ list_add(&CurActionLabels,el);
-/* MR10 */ };
- }
- else
- warn(eMsg1("$%s not parameter, return value, (defined) element label",&zzbegexpr[1]));
- }
- zzmore();
- >>
-#token "#0" << zzreplstr("(*_root)"); zzmore(); chkGTFlag(); >>
-#token "#\[\]" << if ( GenCC ) {
- if (NewAST) zzreplstr("(newAST)");
- else zzreplstr("(new AST)");}
- else {zzreplstr("zzastnew()");} zzmore();
- chkGTFlag();
- >>
-#token "#\(\)" << zzreplstr("NULL"); zzmore(); chkGTFlag(); >>
-#token "#[0-9]+" <<{
- static char buf[100];
- if ( strlen(zzbegexpr)>(size_t)85 )
- fatal("#i AST ref too big");
- if ( GenCC ) sprintf(buf,"_ast%d%s",BlkLevel-1,zzbegexpr+1);
- else sprintf(buf,"zzastArg(%s)",zzbegexpr+1);
- zzreplstr(buf);
- zzmore();
- set_orel(atoi(zzbegexpr+1), &AST_nodes_refd_in_actions);
- chkGTFlag();
- }
- >>
-
-/* MR14 Arpad Beszedes 26-May-98
- Add support for #line directives when antlr source is pre-processed
- #lexclass ACTIONS
-*/
-
-#token "#line[\ \t]* [0-9]+ {[\ \t]* \"~[\"]+\" ([\ \t]* [0-9]*)* } (\n|\r|\r\n)"
- <<
- zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore();
- getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr);
- >>
-
-#token "#line ~[\n\r]* (\n|\r|\r\n)"
- <<
- zzline++; zzmore();
- >>
-
-/* MR14 end of a block to support #line in antlr source code */
-
-#token "#[_a-zA-Z][_a-zA-Z0-9]*"
- <<
- if ( !(strcmp(zzbegexpr, "#ifdef")==0 ||
- strcmp(zzbegexpr, "#if")==0 ||
- strcmp(zzbegexpr, "#else")==0 ||
- strcmp(zzbegexpr, "#endif")==0 ||
- strcmp(zzbegexpr, "#ifndef")==0 ||
- strcmp(zzbegexpr, "#define")==0 ||
- strcmp(zzbegexpr, "#pragma")==0 ||
- strcmp(zzbegexpr, "#undef")==0 ||
- strcmp(zzbegexpr, "#import")==0 ||
- strcmp(zzbegexpr, "#line")==0 ||
- strcmp(zzbegexpr, "#include")==0 ||
- strcmp(zzbegexpr, "#error")==0) )
- {
- static char buf[100];
- sprintf(buf, "%s_ast", zzbegexpr+1);
-/* MR27 */ list_add(&CurAstLabelsInActions, mystrdup(zzbegexpr+1));
- zzreplstr(buf);
- chkGTFlag();
- }
- zzmore();
- >>
-#token "#\[" <<
- pushint(']');
- if ( GenCC ) {
- if (NewAST) zzreplstr("(newAST(");
- else zzreplstr("(new AST("); }
- else zzreplstr("zzmk_ast(zzastnew(),");
- zzmore();
- chkGTFlag();
- >>
-#token "#\(" <<
- pushint('}');
- if ( GenCC ) {
- if (tmakeInParser) {
- zzreplstr("tmake(");
- }
- else {
- zzreplstr("ASTBase::tmake(");
- }
- }
- else {
- zzreplstr("zztmake(");
- }
- zzmore();
- chkGTFlag();
- >>
-#token "#" << zzmore(); >>
-#token "\)" <<
- if ( istackempty() )
- zzmore();
- else if ( topint()==')' ) {
- popint();
- }
- else if ( topint()=='}' ) {
- popint();
- /* terminate #(..) */
- zzreplstr(", NULL)");
- }
- zzmore();
- >>
-#token "\[" <<
- pushint('|'); /* look for '|' to terminate simple [...] */
- zzmore();
- >>
-#token "\(" <<
- pushint(')');
- zzmore();
- >>
-
-#token "\\\]" << zzreplstr("]"); zzmore(); >>
-#token "\\\)" << zzreplstr(")"); zzmore(); >>
-
-/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */
-/* MR1 in DLG action */
-
-#token "\\>" << if (! tokenActionActive) zzreplstr(">"); /* MR1 */
- zzmore(); /* MR1 */
- >> /* MR1 */
-
-
-#token "'" << zzmode(ACTION_CHARS); zzmore();>>
-#token "\"" << zzmode(ACTION_STRINGS); zzmore();>>
-#token "\\$" << zzreplstr("$"); zzmore(); >>
-#token "\\#" << zzreplstr("#"); zzmore(); >>
-#token "\\(\n|\r|\r\n)" << zzline++; zzmore(); >>
-#token "\\~[\]\)>$#]" << zzmore(); >> /* escaped char, always ignore */
-#token "/" << zzmore(); >>
-#token "/\*" << zzmode(ACTION_COMMENTS); zzmore(); >>
-#token "\*/" << warn("Missing /*; found dangling */ in action"); zzmore(); >>
-#token "//" << zzmode(ACTION_CPP_COMMENTS); zzmore(); >>
-#token "~[\n\r\)\(\\$#\>\]\[\"'/]+" << zzmore(); >>
-
-#lexclass START
-#token "[\t\ ]+" << zzskip(); >> /* Ignore White */
-#token "\n|\r|\r\n" << zzline++; zzskip(); >> /* Track Line # */
-#token "\[" << zzmode(ACTIONS); zzmore();
- istackreset();
- pushint(']'); >>
-#token "\<\<" << action_file=CurFile; action_line=zzline;
- zzmode(ACTIONS); zzmore();
- list_free(&CurActionLabels,0); /* MR10 */
- numericActionLabel=0; /* MR10 */
- istackreset();
- pushint('>'); >>
-#token "\"" << zzmode(STRINGS); zzmore(); >>
-#token "/\*" << zzmode(COMMENTS); zzskip(); >>
-#token "\*/" << warn("Missing /*; found dangling */"); zzskip(); >>
-#token "//" << zzmode(CPP_COMMENTS); zzskip(); >>
-
-/* MR14 Arpad Beszedes 26-May-98
- Add support for #line directives when antlr source is pre-processed
- #lexclass START
-*/
-
-#token "#line[\ \t]* [0-9]+ {[\ \t]* \"~[\"]+\" ([\ \t]* [0-9]*)* } (\n|\r|\r\n)"
- <<
- zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore();
- getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr);
- >>
-
-#token "#line ~[\n\r]* (\n|\r|\r\n)"
- <<
- zzline++; zzmore();
- >>
-
-/* MR14 end of a block to support #line in antlr source code */
-
-/* */
-/* 8-Apr-97 Regularize escape sequence for ">>" */
-/* appearing in string literals */
-/* */
-
-#token "\>\>" << warn("Missing <<; found dangling \>\>"); zzskip(); >> /* MR1 */
-#token WildCard "."
-#token "\@" <<FoundException = 1; /* MR6 */
- FoundAtOperator = 1;>> /* MR6 */
-#token Eof "@"
- << /* L o o k F o r A n o t h e r F i l e */
- {
- FILE *new_input;
- new_input = NextFile();
- if ( new_input == NULL ) { NLA=Eof; return; }
- fclose( input );
- input = new_input;
- zzrdstream( input );
- zzskip(); /* Skip the Eof (@) char i.e continue */
- }
- >>
-
-#token LABEL
-
-#errclass "grammar-element" { element }
-#errclass "meta-symbol" { "\}" "!" ";" "\|" "\~" "^" "\)" }
-
-#token Pragma "{\\}#pragma" /* MR21 */
-#token FirstSetSymbol "{\\}#FirstSetSymbol" /* MR21 */
-/*
- * Get a grammar -- Build a list of rules like:
- *
- * o-->Rule1--o
- * |
- * o-->Rule2--o
- * |
- * ...
- * |
- * o-->RuleN--o
- */
-
-/* rule grammar */
-
-grammar : <<Graph g;>>
- ( "{\\}#header" Action /* MR13 */
- <<
- if ( HdrAction==NULL ) {
- HdrAction = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(HdrAction!=NULL, "rule grammar: cannot allocate header action");
- strcpy(HdrAction, LATEXT(1));
- }
- else warn("additional #header statement ignored");
- >>
- | "{\\}#first" Action
- <<
- if ( FirstAction==NULL ) {
- FirstAction = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(FirstAction!=NULL, "rule grammar: cannot allocate #first action");
- strcpy(FirstAction, LATEXT(1));
- } else {
- warn("additional #first statement ignored");
- };
- >>
-
- | "{\\}#parser" QuotedTerm
- <<
- if ( GenCC ) {
- warn("#parser meta-op incompatible with -CC; ignored");
- }
- else {
- if ( strcmp(ParserName,"zzparser")==0 ) {
- ParserName=StripQuotes(mystrdup(LATEXT(1)));
- if ( RulePrefix[0]!='\0' )
- {
- warn("#parser meta-op incompatible with '-gp prefix'; '-gp' ignored");
- RulePrefix[0]='\0';
- }
- }
- else warn("additional #parser statement ignored");
- }
- >>
- | "{\\}#tokdefs" QuotedTerm
- <<{
- char *fname;
- zzantlr_state st; FILE *f; struct zzdlg_state dst;
- UserTokenDefsFile = mystrdup(LATEXT(1));
- zzsave_antlr_state(&st);
- zzsave_dlg_state(&dst);
- fname = mystrdup(LATEXT(1));
- f = fopen(StripQuotes(fname), "r");
- if ( f==NULL ) {warn(eMsg1("cannot open token defs file '%s'", fname+1));}
- else {
- ANTLRm(enum_file(fname+1), f, PARSE_ENUM_FILE);
- UserDefdTokens = 1;
- }
- zzrestore_antlr_state(&st);
- zzrestore_dlg_state(&dst);
- }>>
- )*
- ( Action
- <<{
- UserAction *ua = newUserAction(LATEXT(1));
- ua->file = action_file; ua->line = action_line;
- if ( class_nest_level>0 ) list_add(&class_before_actions, ua);
- else list_add(&BeforeActions, ua);
- }>>
- | laction
- | lmember /* MR1 */
- | lprefix /* MR1 */
- | aLexclass
- | token
- | error
- | tclass
- | aPred /* MR11 */
- | default_exception_handler
- | class_def
- | "\}"
- <<
- if ( class_nest_level==0 )
- warn("missing class definition for trailing '}'");
- class_nest_level--;
- >>
- )*
-
- rule <<g=$3; SynDiag = (Junction *) $3.left;>>
- ( rule
-
- <<if ( $1.left!=NULL ) {
- g.right = NULL;
-
-/* MR21a */ /* Avoid use of a malformed graph when CannotContinue */
-/* MR21a */ /* is already set */
-/* MR21a */
-/* MR21a */ if (! (CannotContinue && g.left == NULL)) {
-/* MR21a */ g = Or(g, $1);
-/* MR21a */ }
-/* MR21a */ }
- >>
-
- | aLexclass
- | token
- | error
- | tclass
- | aPred /* MR11 */
- | class_def
- | "\}"
- <<
- if ( class_nest_level==0 )
- warn("missing class definition for trailing '}'");
- class_nest_level--;
- >>
- )*
- ( Action
- <<{
- UserAction *ua = newUserAction(LATEXT(1));
- ua->file = action_file; ua->line = action_line;
- if ( class_nest_level>0 ) list_add(&class_after_actions, ua);
- else list_add(&AfterActions, ua);
- }>>
- | laction
- | lmember /* MR1 */
- | lprefix /* MR1 */
- | error
- | tclass
- | class_def
- | aPred /* MR11 */
- | "\}"
- <<
- if ( class_nest_level==0 )
- warn("missing class definition for trailing '}'");
- class_nest_level--;
- >>
- )*
- Eof
- ;
- <<CannotContinue=TRUE;>>
-
-/* rule class_def */
-
-class_def
- : <<int go=1; char name[MaxRuleName+1];>>
- "class"
- ( NonTerminal <<if(go) strncpy(name,LATEXT(1),MaxRuleName);>>
- | TokenTerm <<if(go) strncpy(name,LATEXT(1),MaxRuleName);>>
- )
- <<
- if ( CurrentClassName[0]!='\0' && strcmp(CurrentClassName,name)!=0
- && GenCC ) {
- err("only one grammar class allowed in this release");
- go = 0;
- }
- else strcpy(CurrentClassName, name);
- >>
- <<if ( !GenCC ) { err("class meta-op used without C++ option"); }>>
-
-/* MR10 */ (~ "\{"
-/* MR10 */ <<if (ClassDeclStuff == NULL) {
-/* MR10 */ ClassDeclStuff=(char *)calloc(MaxClassDeclStuff+1,sizeof(char));
-/* MR10 */ };
-/* MR10 */ strncat(ClassDeclStuff," ",MaxClassDeclStuff);
-/* MR10 */ strncat(ClassDeclStuff,LATEXT(1),MaxClassDeclStuff);
-/* MR22 */ do {
-/* MR22 */ if (0 == strcmp(LATEXT(1),"public")) break;
-/* MR22 */ if (0 == strcmp(LATEXT(1),"private")) break;
-/* MR22 */ if (0 == strcmp(LATEXT(1),"protected")) break;
-/* MR22 */ if (0 == strcmp(LATEXT(1),"virtual")) break;
-/* MR22 */ if (0 == strcmp(LATEXT(1),",")) break;
-/* MR22 */ if (0 == strcmp(LATEXT(1),":")) break;
-/* MR22 */ if (BaseClassName != NULL) break;
-/* MR22 */ BaseClassName=(char *)calloc(strlen(LATEXT(1))+1,sizeof(char));
-/* MR22 */ require(BaseClassName!=NULL, "rule grammar: cannot allocate base class name");
-/* MR22 */ strcpy(BaseClassName,LATEXT(1));
-/* MR22 */ } while (0);
-/* MR10 */ >>
-/* MR10 */ )*
-
- "\{"
- <<
- no_classes_found = 0;
- if ( class_nest_level>=1 ) {warn("cannot have nested classes");}
- else class_nest_level++;
- >>
- ;
- <<CannotContinue=TRUE;>>
-
-/*
- * Build -o-->o-R-o-->o- where -o-R-o- is the block from rule 'block'.
- * Construct the RuleBlk front and EndRule node on the end of the
- * block. This is used to add FOLLOW pointers to the rule end. Add the
- * new rule name to the Rname hash table and sets its rulenum.
- * Store the parameter definitions if any are found.
- *
- * Note that locks are required on the RuleBlk and EndRule nodes to thwart
- * infinite recursion.
- *
- * Return the left graph pointer == NULL to indicate error/dupl rule def.
- */
-
-/* rule rule */
-
-rule : <<
-
- ExceptionGroup *eg;
- RuleEntry *q; Junction *p; Graph r; int f, l; ECnode *e;
- set toksrefd, rulesrefd;
- char *pdecl=NULL, *ret=NULL, *a; CurRetDef = CurParmDef = NULL;
- CurExGroups = NULL;
- CurElementLabels = NULL;
- CurAstLabelsInActions = NULL; /* MR27 */
- /* We want a new element label hash table for each rule */
- if ( Elabel!=NULL ) killHashTable(Elabel);
- Elabel = newHashTable();
- attribsRefdFromAction = empty;
- >>
- NonTerminal
- <<q=NULL;
- if ( hash_get(Rname, LATEXT(1))!=NULL ) {
- err(eMsg1("duplicate rule definition: '%s'",LATEXT(1)));
- CannotContinue=TRUE;
- }
- else
- {
- q = (RuleEntry *)hash_add(Rname,
- LATEXT(1),
- (Entry *)newRuleEntry(LATEXT(1)));
- CurRule = q->str;
- }
- CurRuleNode = q;
- f = CurFile; l = zzline;
- NumRules++;
- >>
- { "!" <<if ( q!=NULL ) q->noAST = TRUE;>> }
- { <<;>>
- {"\<"}
- PassAction
- << pdecl = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(pdecl!=NULL, "rule rule: cannot allocate param decl");
- strcpy(pdecl, LATEXT(1));
- CurParmDef = pdecl;
- >>
- }
- { "\>"
- PassAction
- << ret = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(ret!=NULL, "rule rule: cannot allocate ret type");
- strcpy(ret, LATEXT(1));
- CurRetDef = ret;
- >>
- }
- { QuotedTerm <<if ( q!=NULL ) q->egroup=mystrdup(LATEXT(1));>> }
- <<
- if ( GenEClasseForRules && q!=NULL ) {
- e = newECnode;
- require(e!=NULL, "cannot allocate error class node");
- if ( q->egroup == NULL ) {a = q->str; a[0] = (char)toupper(a[0]);}
- else a = q->egroup;
- if ( Tnum( a ) == 0 )
- {
- e->tok = addTname( a );
- list_add(&eclasses, (char *)e);
- if ( q->egroup == NULL ) a[0] = (char)tolower(a[0]);
- /* refers to itself */
- list_add(&(e->elist), mystrdup(q->str));
- }
- else {
- warn(eMsg1("default errclass for '%s' would conflict with token/errclass/tokclass",a));
- if ( q->egroup == NULL ) a[0] = (char)tolower(a[0]);
- free((char *)e);
- }
- }
- >>
- <<BlkLevel++;
- if (BlkLevel >= MAX_BLK_LEVEL) fatal("Blocks nested too deeply");
-/* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID;
-/* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum;
- >>
-
- ":" <<inAlt=1;>>
- block[&toksrefd, &rulesrefd]
- <<r = makeBlk($7,0, NULL /* pFirstSetSymbol */ );
- CurRuleBlk = (Junction *)r.left;
- CurRuleBlk->blockid = CurBlockID;
- CurRuleBlk->jtype = RuleBlk;
- if ( q!=NULL ) CurRuleBlk->rname = q->str;
- CurRuleBlk->file = f;
- CurRuleBlk->line = l;
- CurRuleBlk->pdecl = pdecl;
- CurRuleBlk->ret = ret;
- CurRuleBlk->lock = makelocks();
- CurRuleBlk->pred_lock = makelocks();
- CurRuleBlk->tokrefs = toksrefd;
- CurRuleBlk->rulerefs = rulesrefd;
- p = newJunction(); /* add EndRule Node */
- ((Junction *)r.right)->p1 = (Node *)p;
- r.right = (Node *) p;
- p->jtype = EndRule;
- p->lock = makelocks();
- p->pred_lock = makelocks();
- CurRuleBlk->end = p;
- if ( q!=NULL ) q->rulenum = NumRules;
- $7 = r;
- >>
- <<
- /* MR23 */ CurBlockID_array[BlkLevel] = (-1);
- /* MR23 */ CurAltNum_array[BlkLevel] = (-1);
- --BlkLevel;
- >>
- <<altFixup();leFixup();egFixup();>> /* MR7 */
- ";" <<inAlt=0;>>
- { Action
- << a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule rule: cannot allocate error action");
- strcpy(a, LATEXT(1));
- CurRuleBlk->erraction = a;
- >>
- }
- ( exception_group > [eg]
- <<if ( eg!=NULL ) {
- list_add(&CurExGroups, (void *)eg);
- if (eg->label == NULL || *eg->label=='\0' ) q->has_rule_exception = 1;
- }
- >>
- )*
- <<if ( q==NULL ) $0.left = NULL; else $0 = $7;>>
- <<CurRuleBlk->exceptions = CurExGroups;>>
- <<CurRuleBlk->el_labels = CurElementLabels;>>
- <<CurRuleNode->ast_labels_in_actions = CurAstLabelsInActions;>> /* MR27 */
- <<CurRuleNode = NULL;>> /* MR27 Moved */
- ;
- <<CannotContinue=TRUE;>>
-
-/*
- * pragma : "{\\}#pragma" "dup\-labeled\-tokens"
- * <<Pragma_DupLabeledTokens=1;>>
- * ;
- */
-
-/* rule laction */
-
-laction : <<char *a;>>
-
- "{\\}#lexaction"
- Action
- <<
- a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule laction: cannot allocate action");
- strcpy(a, LATEXT(1));
- list_add(&LexActions, a);
- >>
- ;
- <<CannotContinue=TRUE;>>
-
-/* MR1 */
-/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
-/* MR1 via #lexmember <<....>> & #lexprefix <<...>> */
-/* MR1 */
-
-/* rule lmember */
-
-lmember: <<char *a;>> /* MR1 */
-
-/* MR1 */ "{\\}#lexmember"
-/* MR1 */ Action
-/* MR1 */ <<
-/* MR1 */ if (! GenCC) {
-/* MR1 */ err("Use #lexmember only in C++ mode (to insert code in DLG class header");
-/* MR1 */ } else {
-/* MR1 */ a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
-/* MR1 */ require(a!=NULL, "rule lmember: cannot allocate action");
-/* MR1 */ strcpy(a, LATEXT(1));
-/* MR1 */ list_add(&LexMemberActions, a);
-/* MR1 */ };
-/* MR1 */ >>
-/* MR1 */ ;
-/* MR1 */ <<CannotContinue=TRUE;>>
-
-/* rule lprefix */
-
-lprefix: <<char *a;>> /* MR1 */
-
-/* MR1 */ "{\\}#lexprefix"
-/* MR1 */ Action
-/* MR1 */ <<
-/* MR1 */ if (! GenCC) {
-/* MR1 */ err("Use #lexprefix only in C++ mode (to insert code in DLG class header");
-/* MR1 */ } else {
-/* MR1 */ a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
-/* MR1 */ require(a!=NULL, "rule lprefix: cannot allocate action");
-/* MR1 */ strcpy(a, LATEXT(1));
-/* MR1 */ list_add(&LexPrefixActions, a);
-/* MR1 */ };
-/* MR1 */ >>
-/* MR1 */ ;
-/* MR1 */ <<CannotContinue=TRUE;>>
-
-/*
- * #pred upper <<isupper()>>? predicate literal
- * #pred lower <<islower()>>? predicate literal
- * #pred up_or_low upper || lower predicate expression
- * concealed interdependence
- * #pred up_or_low_2 <<isletter()>>? A || B predicate literal equals predicate expr
- * analyze using lower||upper
- * generate using isLetter()
- */
-
-/* rule aPref */
-
-aPred: <<PredEntry *predEntry=NULL;
- char *name=NULL;
- Predicate *predExpr=NULL;
- char *predLiteral=NULL;
- int save_file;
- int save_line;
- int predExprPresent=0;
- >>
-
- "{\\}#pred"
-
- <<
- MR_usingPredNames=1; /* will need to use -mrhoist version of genPredTree */
- >>
-
- /* used to allow NonTerminal but it caused problems
- when a rule name immediately followed a #pred statement */
-
- TokenTerm <<name=mystrdup(LATEXT(1));>>
-
- <<
- /* don't free - referenced in predicates */
-
- CurPredName=(char *)calloc(1,strlen(name) + 10);
- strcat(CurPredName,"#pred ");
- strcat(CurPredName,name);
-
- predEntry=(PredEntry *) hash_get(Pname,name);
- if (predEntry != NULL) {
- warnFL(eMsg1("#pred %s previously defined - ignored",name),
- FileStr[action_file],action_line);
- name=NULL;
- };
- >>
-
- (
-
- Pred <<predLiteral=mystrdup(LATEXT(1));
- save_line=action_line;
- save_file=action_file;
- >>
-
- {
- predOrExpr>[predExpr] <<predExprPresent=1;>>
- }
-
- <<if (predLiteral != NULL && name != NULL) {
-
- /*
- * predExpr may be NULL due to syntax errors
- * or simply omitted by the user
- */
-
- predEntry=newPredEntry(name);
- predEntry->file=save_file;
- predEntry->line=save_line;
- predExpr=MR_predFlatten(predExpr);
- predEntry->predLiteral=predLiteral;
- if (! predExprPresent || predExpr == NULL) {
- predExpr=new_pred();
- predExpr->expr=predLiteral;
- predExpr->source=newActionNode();
- predExpr->source->action=predExpr->expr;
- predExpr->source->rname=CurPredName;
- predExpr->source->line=action_line;
- predExpr->source->file=action_file;
- predExpr->source->is_predicate=1;
- predExpr->k=predicateLookaheadDepth(predExpr->source);
- };
- predEntry->pred=predExpr;
- hash_add(Pname,name,(Entry *)predEntry);
- predExpr=NULL;
- };
- predicate_free(predExpr);
- >>
-
- |
- <<save_line=zzline; save_file=CurFile;>>
-
- predOrExpr>[predExpr]
-
- <<if (predExpr != NULL && name != NULL) {
- predEntry=newPredEntry(name);
- predEntry->file=CurFile;
- predEntry->line=zzline;
- predExpr=MR_predFlatten(predExpr);
- predEntry->pred=predExpr;
- hash_add(Pname,name,(Entry *)predEntry);
- predExpr=NULL;
- };
- predicate_free(predExpr);
- >>
- )
- {";"}
-;
-
-/* fail */
-
-<<predicate_free(predExpr);
->>
-
-/* rule predOrExpr */
-
-predOrExpr>[Predicate *result] :
- <<Predicate *ORnode;
- Predicate *predExpr;
- Predicate **tail=NULL;
- >>
- predAndExpr>[predExpr]
- <<
- ORnode=new_pred();
- ORnode->expr=PRED_OR_LIST;
- if (predExpr != NULL) {
- ORnode->down=predExpr;
- tail=&predExpr->right;
- };
- >>
- ( "\|\|" predAndExpr>[predExpr]
- <<
- if (predExpr != NULL) {
- *tail=predExpr;
- tail=&predExpr->right;
- };
- >>
- )*
- <<
- $result=ORnode;
- ORnode=NULL;
- >>
-;
-
-/* fail */
-
-<<predicate_free(ORnode);>>
-
-/* rule predAndExpr */
-
-predAndExpr>[Predicate *result] :
- <<Predicate *ANDnode;
- Predicate *predExpr;
- Predicate **tail=NULL;
- >>
- predPrimary>[predExpr]
- <<
- ANDnode=new_pred();
- ANDnode->expr=PRED_AND_LIST;
- if (predExpr != NULL) {
- ANDnode->down=predExpr;
- tail=&predExpr->right;
- };
- >>
- ( "&&" predPrimary>[predExpr]
- <<
- if (predExpr != NULL) {
- *tail=predExpr;
- tail=&predExpr->right;
- };
- >>
- )*
- <<
- $result=ANDnode;
- ANDnode=NULL;
- >>
-;
-
-/* fail */
-
-<<predicate_free(ANDnode);>>
-
-
-/* rule predPrimary */
-
-predPrimary>[Predicate *result] :
- <<
- char *name=NULL;
- PredEntry *predEntry=NULL;
- Predicate *predExpr=NULL;
- >>
-
- TokenTerm <<name=mystrdup(LATEXT(1));>>
-
- <<
- predEntry=(PredEntry *) hash_get(Pname,name);
- if (predEntry == NULL) {
- warnFL(eMsg1("no previously defined #pred with name \"%s\"",name),
- FileStr[CurFile],zzline);
- name=NULL;
- $result=NULL;
- } else {
- predExpr=predicate_dup(predEntry->pred);
- predExpr->predEntry=predEntry;
- $result=predExpr;
- };
- >>
-
- | "\(" predOrExpr>[predExpr] "\)"
- <<
- $result=predExpr;
- >>
-
- | "!" predPrimary>[predExpr]
- <<
- predExpr->inverted=!predExpr->inverted;
- $result=predExpr;
- >>
-;
-
-/* fail */ <<
- predicate_free(predExpr);
- >>
-
-/* rule aLexclass */
-
-aLexclass: "{\\}#lexclass" TokenTerm <<lexclass(mystrdup(LATEXT(1)));>>
- ;
- <<CannotContinue=TRUE;>>
-
-/* rule error */
-
-error : <<char *t=NULL; ECnode *e; int go=1; TermEntry *p;>>
- "{\\}#errclass"
- (<<;>> TokenTerm <<t=mystrdup(LATEXT(1));>>
- | QuotedTerm <<t=mystrdup(LATEXT(1));>>
- )
- <<e = newECnode;
- require(e!=NULL, "cannot allocate error class node");
- e->lexclass = CurrentLexClass;
- if ( Tnum( (t=StripQuotes(t)) ) == 0 )
- {
- if ( hash_get(Texpr, t) != NULL )
- warn(eMsg1("errclass name conflicts with regular expression '%s'",t));
- e->tok = addTname( t );
- set_orel(e->tok, &imag_tokens);
- require((p=(TermEntry *)hash_get(Tname, t)) != NULL,
- "hash table mechanism is broken");
- p->classname = 1; /* entry is errclass name, not token */
- list_add(&eclasses, (char *)e);
- }
- else
- {
- warn(eMsg1("redefinition of errclass or conflict w/token or tokclass '%s'; ignored",t));
- free( (char *)e );
- go=0;
- }
- >>
- "\{"
- ( NonTerminal <<if ( go ) t=mystrdup(LATEXT(1));>>
- | TokenTerm <<if ( go ) t=mystrdup(LATEXT(1));>>
- | QuotedTerm <<if ( go ) t=mystrdup(LATEXT(1));>>
- )
- <<if ( go ) list_add(&(e->elist), t);>>
- (
- ( NonTerminal <<if ( go ) t=mystrdup(LATEXT(1));>>
- | TokenTerm <<if ( go ) t=mystrdup(LATEXT(1));>>
- | QuotedTerm <<if ( go ) t=mystrdup(LATEXT(1));>>
- )
- <<if ( go ) list_add(&(e->elist), t);>>
- )*
- "\}"
- ;
- <<CannotContinue=TRUE;>>
-
-/* rule tclass */
-
-tclass : <<char *t=NULL; TCnode *e; int go=1,tok,totok; TermEntry *p, *term, *toterm;>>
- <<char *akaString=NULL; int save_file; int save_line;>>
- <<char *totext=NULL; >>
- "{\\}#tokclass" TokenTerm <<t=mystrdup(LATEXT(1));>>
- <<e = newTCnode;
- require(e!=NULL, "cannot allocate token class node");
- e->lexclass = CurrentLexClass;
- if ( Tnum( t ) == 0 )
- {
- e->tok = addTname( t );
- set_orel(e->tok, &imag_tokens);
- set_orel(e->tok, &tokclasses);
- require((p=(TermEntry *)hash_get(Tname, t)) != NULL,
- "hash table mechanism is broken");
- p->classname = 1; /* entry is class name, not token */
- p->tclass = e; /* save ptr to this tclass def */
- list_add(&tclasses, (char *)e);
- }
- else
- {
- warn(eMsg1("redefinition of tokclass or conflict w/token '%s'; ignored",t));
- free( (char *)e );
- go=0;
- }
- >>
-/* MR23 */ {
-/* MR23 */ "\("
-/* MR23 */ QuotedTerm
-/* MR23 */ <<akaString=mystrdup(StripQuotes(LATEXT(1)));
-/* MR11 */ save_file=CurFile;save_line=zzline;
-/* MR23 */ >>
-/* MR23 */ "\)"
-/* MR23 */ }
-/* MR23 */
-/* MR23 */
-/* MR23 */ <<
-/* MR23 */ if (p!= NULL && akaString != NULL) {
-/* MR23 */ if (p->akaString != NULL) {
-/* MR23 */ if (strcmp(p->akaString,akaString) != 0) {
-/* MR23 */ warnFL(eMsg2("this #tokclass statment conflicts with a previous #tokclass %s(\"%s\") statement",
-/* MR23 */ t,p->akaString),
-/* MR23 */ FileStr[save_file],save_line);
-/* MR23 */ };
-/* MR23 */ } else {
-/* MR23 */ p->akaString=akaString;
-/* MR23 */ };
-/* MR23 */ };
-/* MR23 */ >>
-
- "\{"
- (
- ( TokenTerm
- <<if ( go ) {
- term = (TermEntry *) hash_get(Tname, LATEXT(1));
- if ( term==NULL && UserDefdTokens ) {
- err("implicit token definition not allowed with #tokdefs");
- go = 0;
- }
- else {t=mystrdup(LATEXT(1)); tok=addTname(LATEXT(1));}
- }>>
-
- {
- ".."
- TokenTerm
-
- <<if ( go ) {
- toterm = (TermEntry *) hash_get(Tname, LATEXT(1));
- if ( toterm==NULL && UserDefdTokens ) {
- err("implicit token definition not allowed with #tokdefs");
- go = 0;
- } else {
- totext=mystrdup(LATEXT(1)); totok=addTname(LATEXT(1));
- }
- }
- >>
- }
-
- | QuotedTerm
- <<if ( go ) {
- term = (TermEntry *) hash_get(Texpr, LATEXT(1));
- if ( term==NULL && UserDefdTokens ) {
- err("implicit token definition not allowed with #tokdefs");
- go = 0;
- }
- else {t=mystrdup(LATEXT(1)); tok=addTexpr(LATEXT(1));}
- }>>
- )
- <<if ( go ) {
- if (totext == NULL) {
- list_add(&(e->tlist), t);
- } else {
- list_add(&(e->tlist),"..");
- list_add(&(e->tlist),t);
- list_add(&(e->tlist),totext);
- }
- totext=NULL;
- }
- >>
- )+ // MR15 Manfred Kogler - forbid empty #tokclass sets (was "+")
- "\}"
- ;
- <<CannotContinue=TRUE;>>
-
-/* rule token */
-
-token : <<char *t=NULL, *e=NULL, *a=NULL; int tnum=0;>>
- <<char *akaString=NULL; TermEntry *te;int save_file=0,save_line=0;>> /* MR11 */
- "{\\}#token"
-
-/* MR1 10-Apr-97 MR1 Allow shift right operator in DLG actions */
-/* MR1 Danger when parser feedback to lexer */
-/* MR1 */
-
- <<tokenActionActive=1;>> /* MR1 */
- { TokenTerm <<t=mystrdup(LATEXT(1));>>
-
-/* MR11 */ {
-/* MR11 */ "\("
-/* MR11 */ QuotedTerm
-/* MR11 */ <<akaString=mystrdup(StripQuotes(LATEXT(1)));
-/* MR11 */ save_file=CurFile;save_line=zzline;
-/* MR11 */ >>
-/* MR11 */ "\)"
-/* MR11 */ }
-
- { "=" "[0-9]+" /* define the token type number */
- <<tnum = atoi(LATEXT(1));>>
- }
- }
- { QuotedTerm <<e=mystrdup(LATEXT(1));>> }
- { Action
- <<
- a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule token: cannot allocate action");
- strcpy(a, LATEXT(1));
- >>
- }
-
- { ";" } /* MR11 */
-
- <<chkToken(t, e, a, tnum);>>
-
- <<if (t != NULL) {
- te=(TermEntry *)hash_get(Tname,t);
- if (te != NULL && akaString != NULL) {
- if (te->akaString != NULL) {
- if (strcmp(te->akaString,akaString) != 0) {
- warnFL(eMsg2("this #token statment conflicts with a previous #token %s(\"%s\") statement",
- t,te->akaString),
- FileStr[save_file],save_line);
- };
- } else {
- te->akaString=akaString;
- };
- };
- };
- >>
- ;
- <<CannotContinue=TRUE;>>
-
-/* rule block */
-
-block[set *toksrefd, set *rulesrefd]
- : <<
- Graph g, b;
- set saveblah;
- int saveinalt = inAlt;
- ExceptionGroup *eg;
- *$toksrefd = empty;
- *$rulesrefd = empty;
- set_clr(AST_nodes_refd_in_actions);
- CurBlockID++;
-/* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID;
- CurAltNum = 1;
-/* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum;
- saveblah = attribsRefdFromAction;
- attribsRefdFromAction = empty;
- >>
-
- alt[toksrefd,rulesrefd] <<b = g = $1;>>
-
- <<
- if ( ((Junction *)g.left)->p1->ntype == nAction )
- {
- ActionNode *actionNode=(ActionNode *)
- ( ( (Junction *)g.left) ->p1);
- if (!actionNode->is_predicate )
- {
- actionNode->init_action = TRUE;
-/* MR12c */ if (actionNode->noHoist) {
-/* MR12c */ errFL("<<nohoist>> appears as init-action - use <<>> <<nohoist>>",
-/* MR12c */ FileStr[actionNode->file],actionNode->line);
-/* MR12c */ };
- }
- }
- ((Junction *)g.left)->blockid = CurBlockID;
- >>
-
- ( exception_group > [eg]
- <<
- if ( eg!=NULL ) {
-/* MR7 ***** eg->altID = makeAltID(CurBlockID,CurAltNum); *****/
-/* MR7 ***** CurAltStart->exception_label = eg->altID; *****/
- list_add(&CurExGroups, (void *)eg);
- }
- >>
- )*
- <<CurAltNum++;
-/* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum;
- >>
-
- ( "\|" <<inAlt=1;>>
- alt[toksrefd,rulesrefd] <<g = Or(g, $2);>>
- <<
- ((Junction *)g.left)->blockid = CurBlockID;
- >>
-
- ( exception_group > [eg]
- <<
- if ( eg!=NULL ) {
-/* MR7 ***** eg->altID = makeAltID(CurBlockID,CurAltNum); *****/
-/* MR7 ***** CurAltStart->exception_label = eg->altID; *****/
- list_add(&CurExGroups, (void *)eg);
- }
- >>
- )*
-
- <<CurAltNum++;
-/* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum;
- >>
-
- )*
- <<$0 = b;>>
- <<attribsRefdFromAction = saveblah; inAlt = saveinalt;>>
- ;
- <<CannotContinue=TRUE;>>
-
-/* rule alt */
-
-alt[set *toksrefd, set *rulesrefd]
- : <<int n=0; Graph g; int e_num=0, old_not=0; Node *node; set elems, dif;
- int first_on_line = 1, use_def_MT_handler = 0;
- g.left=NULL; g.right=NULL;
-
- CurAltStart = NULL;
- elems = empty;
- inAlt = 1;
- >>
- { "\@" /* handle MismatchedToken signals with default handler */
- <<use_def_MT_handler = 1;>>
- }
-
- ( <<;>> /* MR9 Removed unreferenced variable "tok" */
- { <<old_not=0;>> "\~" <<old_not=1;>> }
- element[old_not, first_on_line, use_def_MT_handler] > [node]
- <<if ( node!=NULL && node->ntype!=nAction ) first_on_line = 0;>>
- <<
- if ( $2.left!=NULL ) {
- g = Cat(g, $2);
- n++;
- if ( node!=NULL ) {
- if ( node->ntype!=nAction ) e_num++;
- /* record record number of all rule and token refs */
- if ( node->ntype==nToken ) {
- TokNode *tk = (TokNode *)((Junction *)$2.left)->p1;
- tk->elnum = e_num;
- set_orel(e_num, &elems);
- }
- else if ( node->ntype==nRuleRef ) {
- RuleRefNode *rn = (RuleRefNode *)((Junction *)$2.left)->p1;
- rn->elnum = e_num;
- set_orel(e_num, $rulesrefd);
- }
- }
- }
- >>
- )*
- <<if ( n == 0 ) g = emptyAlt();
- $0 = g;
- /* We want to reduce number of LT(i) calls and the number of
- * local attribute variables in C++ mode (for moment, later we'll
- * do for C also). However, if trees are being built, they
- * require most of the attrib variables to create the tree nodes
- * with; therefore, we gen a token ptr for each token ref in C++
- */
- if ( GenCC && !GenAST )
- {
- /* This now free's the temp set -ATG 5/6/95 */
- set temp;
- temp = set_and(elems, attribsRefdFromAction);
- set_orin($toksrefd, temp);
- set_free(temp);
- }
- else set_orin($toksrefd, elems);
- if ( GenCC ) {
- dif = set_dif(attribsRefdFromAction, elems);
- if ( set_deg(dif)>0 )
- err("one or more $i in action(s) refer to non-token elements");
- set_free(dif);
- }
- set_free(elems);
- set_free(attribsRefdFromAction);
- inAlt = 0;
- >>
- ;
- <<CannotContinue=TRUE;>>
-
-/* rule element_label */
-
-element_label > [LabelEntry *label]
- : <<TermEntry *t=NULL; LabelEntry *l=NULL; RuleEntry *r=NULL; char *lab;>>
- LABEL <<lab = mystrdup(LATEXT(1));>>
- <<
- UsedNewStyleLabel = 1;
- if ( UsedOldStyleAttrib ) err("cannot mix with new-style labels with old-style $i");
- t = (TermEntry *) hash_get(Tname, lab);
- if ( t==NULL ) t = (TermEntry *) hash_get(Texpr, lab);
- if ( t==NULL ) r = (RuleEntry *) hash_get(Rname, lab);
- if ( t!=NULL ) {
- err(eMsg1("label definition clashes with token/tokclass definition: '%s'", lab));
- $label = NULL;
- }
- else if ( r!=NULL ) {
- err(eMsg1("label definition clashes with rule definition: '%s'", lab));
- $label = NULL;
- }
- else {
- /* we don't clash with anybody else */
- l = (LabelEntry *) hash_get(Elabel, lab);
- if ( l==NULL ) { /* ok to add new element label */
- l = (LabelEntry *)hash_add(Elabel,
- lab,
- (Entry *)newLabelEntry(lab));
- /* add to list of element labels for this rule */
- list_add(&CurElementLabels, (void *)lab);
-/* MR7 */ leAdd(l); /* list of labels waiting for exception group definitions */
- $label = l;
- }
- else {
- err(eMsg1("label definitions must be unique per rule: '%s'", lab));
- $label = NULL;
- }
- }
- >>
- ":"
- ;
-
-/* rule element */
-
-element[int old_not, int first_on_line, int use_def_MT_handler] > [Node *node]
- : <<
- Attrib blk;
- Predicate *pred = NULL;
- int local_use_def_MT_handler=0;
- ActionNode *act;
- RuleRefNode *rr;
- set toksrefd, rulesrefd;
- TermEntry *term;
- TokNode *p=NULL; RuleRefNode *q; int approx=0;
- LabelEntry *label=NULL;
- int predMsgDone=0;
- int semDepth=0;
- int ampersandStyle;
- int height; /* MR11 */
- int equal_height; /* MR11 */
-
- char* pFirstSetSymbol = NULL; /* MR21 */
-
- $node = NULL;
- >>
- {element_label>[label]}
- ( TokenTerm
- <<
- term = (TermEntry *) hash_get(Tname, LATEXT(1));
- if ( term==NULL && UserDefdTokens ) {
- err("implicit token definition not allowed with #tokdefs");
- $$.left = $$.right = NULL;
- }
- else {
- $$ = buildToken(LATEXT(1));
- p=((TokNode *)((Junction *)$$.left)->p1);
- term = (TermEntry *) hash_get(Tname, LATEXT(1));
- require( term!= NULL, "hash table mechanism is broken");
- p->tclass = term->tclass;
- p->complement = $old_not;
- if ( label!=NULL ) {
- p->el_label = label->str;
- label->elem = (Node *)p;
- }
- }
- >>
- { ".."
- ( QuotedTerm
- <<if ( p!=NULL ) setUpperRange(p, LATEXT(1));>>
- | TokenTerm
- <<if ( p!=NULL ) setUpperRange(p, LATEXT(1));>>
- )
- }
- <<
- if ( p!=NULL && (p->upper_range!=0 || p->tclass || $old_not) )
- list_add(&MetaTokenNodes, (void *)p);
- >>
- ( "^" <<if ( p!=NULL ) p->astnode=ASTroot;>>
- | <<if ( p!=NULL ) p->astnode=ASTchild;>>
- | "!" <<if ( p!=NULL ) p->astnode=ASTexclude;>>
- )
- { "\@" <<local_use_def_MT_handler = 1;>> }
- <<
- if ( p!=NULL && $first_on_line ) {
- CurAltStart = (Junction *)$$.left;
- altAdd(CurAltStart); /* MR7 */
- p->altstart = CurAltStart;
- }
- if ( p!=NULL )
- p->use_def_MT_handler = $use_def_MT_handler || local_use_def_MT_handler;
- $node = (Node *)p;
- >>
- | QuotedTerm
- <<
- term = (TermEntry *) hash_get(Texpr, LATEXT(1));
- if ( term==NULL && UserDefdTokens ) {
- err("implicit token definition not allowed with #tokdefs");
- $$.left = $$.right = NULL;
- }
- else {
- $$ = buildToken(LATEXT(1)); p=((TokNode *)((Junction *)$$.left)->p1);
- p->complement = $old_not;
- if ( label!=NULL ) {
- p->el_label = label->str;
- label->elem = (Node *)p;
- }
- }
- >>
- { ".."
- ( QuotedTerm
- <<if ( p!=NULL ) setUpperRange(p, LATEXT(1));>>
- | TokenTerm
- <<if ( p!=NULL ) setUpperRange(p, LATEXT(1));>>
- )
- }
- ( "^" <<if ( p!=NULL ) p->astnode=ASTroot;>>
- | <<if ( p!=NULL ) p->astnode=ASTchild;>>
- | "!" <<if ( p!=NULL ) p->astnode=ASTexclude;>>
- )
- { "\@" <<local_use_def_MT_handler = 1;>> }
- <<
- if ( p!=NULL && (p->upper_range!=0 || p->tclass || $old_not) )
- list_add(&MetaTokenNodes, (void *)p);
- >>
- <<
- if ( $first_on_line ) {
- CurAltStart = (Junction *)$$.left;
- altAdd(CurAltStart); /* MR7 */
- p->altstart = CurAltStart;
- }
- if ( p!=NULL )
- p->use_def_MT_handler = $use_def_MT_handler || local_use_def_MT_handler;
- $node = (Node *)p;
- >>
-
- | <<if ( $old_not ) warn("~ WILDCARD is an undefined operation (implies 'nothing')");>>
- "."
- <<$$ = buildWildCard(LATEXT(1)); p=((TokNode *)((Junction *)$$.left)->p1);>>
- ( "^" <<p->astnode=ASTroot;>>
- | <<p->astnode=ASTchild;>>
- | "!" <<p->astnode=ASTexclude;>>
- )
- <<list_add(&MetaTokenNodes, (void *)p);>>
- <<
- if ( $first_on_line ) {
- CurAltStart = (Junction *)$$.left;
- altAdd(CurAltStart); /* MR7 */
- p->altstart = CurAltStart;
- if ( label!=NULL ) {
- p->el_label = label->str;
- label->elem = (Node *)p;
- }
- }
- $node = (Node *)p;
- >>
-
- | <<if ( $old_not ) warn("~ NONTERMINAL is an undefined operation");>>
- NonTerminal
- <<$$ = buildRuleRef(LATEXT(1));>>
- { "!" <<q = (RuleRefNode *) ((Junction *)$$.left)->p1;
- q->astnode=ASTexclude;>>
- }
- { {"\<"}
- PassAction <<addParm(((Junction *)$$.left)->p1, LATEXT(1));>>
- }
- <<rr=(RuleRefNode *) ((Junction *)$$.left)->p1;>>
- { <<char *a;>>
- "\>"
- PassAction
- <<
- a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule element: cannot allocate assignment");
- strcpy(a, LATEXT(1));
- rr->assign = a;
- >>
- }
- <<
- if ( label!=NULL ) {
- rr->el_label = label->str;
- label->elem = (Node *)rr;
- }
- if ( $first_on_line ) {
- CurAltStart = (Junction *)$$.left;
- altAdd(CurAltStart); /* MR7 */
- ((RuleRefNode *)((Junction *)$$.left)->p1)->altstart = CurAltStart;
- }
- $node = (Node *)rr;
- >>
- )
-
- | <<if ( $old_not ) warn("~ ACTION is an undefined operation");>>
- Action <<$0 = buildAction(LATEXT(1),action_file,action_line, 0);>>
- <<if ( $first_on_line ) { /* MR7 */
- CurAltStart = (Junction *)$0.left; /* MR7 */
- altAdd(CurAltStart); /* MR7 */
- };>> /* MR7 */
- <<$node = (Node *) ((Junction *)$0.left)->p1;>>
-
- | <<if ( $old_not ) warn("~ SEMANTIC-PREDICATE is an undefined operation");>>
- Pred <<$0 = buildAction(LATEXT(1),action_file,action_line, 1);>>
- <<act = (ActionNode *) ((Junction *)$0.left)->p1;>>
- <<if (numericActionLabel) { /* MR10 */
- list_add(&NumericPredLabels,act); /* MR10 */
- numericActionLabel=0; /* MR10 */
- }; /* MR10 */
- >>
- { <<char *a;>>
- PassAction
- <<
- a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule element: cannot allocate predicate fail action");
- strcpy(a, LATEXT(1));
- act->pred_fail = a;
- >>
- }
- <<if ( $first_on_line ) { /* MR7 */
- CurAltStart = (Junction *)$0.left; /* MR7 */
- altAdd(CurAltStart); /* MR7 */
- };>> /* MR7 */
- <<$node = (Node *)act;>>
-
- | <<if ( $old_not ) warn("~ BLOCK is an undefined operation");>>
- <<BlkLevel++;
- if (BlkLevel >= MAX_BLK_LEVEL) fatal("Blocks nested too deeply");
-/* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID;
-/* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum;
- >>
- { Pragma
- ( "approx" <<approx=LL_k;>>
- | "LL\(1\)" <<approx = 1;>> /* MR20 */
- | "LL\(2\)" <<approx = 2;>> /* MR20 */
- )
- }
-
-/* MR21 */ { FirstSetSymbol
-/* MR21 */ "\("
-/* MR21 */ ( NonTerminal
-/* MR21 */ <<
-/* MR21 */ pFirstSetSymbol = (char *) calloc(strlen(LATEXT(1))+1,
-/* MR21 */ sizeof(char));
-/* MR21 */ require(pFirstSetSymbol!=NULL,
-/* MR21 */ "cannot allocate first set name");
-/* MR21 */ strcpy(pFirstSetSymbol, LATEXT(1));
-/* MR21 */ >>
-/* MR21 */ | TokenTerm
-/* MR21 */ <<
-/* MR21 */ pFirstSetSymbol = (char *) calloc(strlen(LATEXT(1))+1,
-/* MR21 */ sizeof(char));
-/* MR21 */ require(pFirstSetSymbol!=NULL,
-/* MR21 */ "cannot allocate first set name");
-/* MR21 */ strcpy(pFirstSetSymbol, LATEXT(1));
-/* MR21 */ >>
-/* MR21 */ )
-/* MR21 */ "\)"
-/* MR21 */ }
-
- (
-
- "\(" block[&toksrefd,&rulesrefd] "\)"
- <<blk = $$ = $2;
- /* MR23 */ CurBlockID_array[BlkLevel] = (-1);
- /* MR23 */ CurAltNum_array[BlkLevel] = (-1);
- --BlkLevel;
- >>
-
- ( "\*" <<$$ = makeLoop($$,approx,pFirstSetSymbol);>>
- | "\+" <<$$ = makePlus($$,approx,pFirstSetSymbol);>>
- | "?"
- (
- ( "=>" <<ampersandStyle=0;>>
- | "&&" <<ampersandStyle=1;>> /* MR10 (g)? && <<p>>? */
- )
- Pred /* generalized predicate */
- /* first make into a predicate */
- <<$$ = buildAction(LATEXT(1),action_file,action_line,1);>>
- <<act = (ActionNode *) ((Junction *)$$.left)->p1;>>
- <<semDepth=predicateLookaheadDepth(act);>> /* MR10 */
- <<if (numericActionLabel) { /* MR10 */
- list_add(&NumericPredLabels,act); /* MR10 */
- numericActionLabel=0; /* MR10 */
- }; /* MR10 */
- >>
- { <<char *a;>>
- PassAction
- <<
- a = (char *)calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(a!=NULL, "rule element: cannot allocate predicate fail action");
- strcpy(a, LATEXT(1));
- act->pred_fail = a;
- >>
- }
- <<if ($first_on_line) { /* MR7 */
- CurAltStart=(Junction *)$$.left; /* MR7 */
- altAdd(CurAltStart); /* MR7 */
- };>>
- <<$node = (Node *)act;>>
-
- /* for now, just snag context */
- <<
- pred = computePredFromContextGuard(blk,&predMsgDone); /* MR10 */
- if ( pred==NULL) { /* MR10 */
- if ( !predMsgDone) err("invalid or missing context guard"); /* MR10 */
- predMsgDone=1; /* MR10 */
- } else { /* MR10 */
- act->guardNodes=(Junction *)blk.left; /* MR11 */
- pred->expr = act->action;
- pred->source = act;
-/* MR10 */ pred->ampersandStyle = ampersandStyle; /* 0 means (g)? => ... 1 means (g)? && ... */
-/* MR13 */ if (pred->tcontext != NULL) {
-/* MR13 */ height=MR_max_height_of_tree(pred->tcontext);
-/* MR13 */ equal_height=MR_all_leaves_same_height(pred->tcontext,height);
-/* MR13 */ if (! equal_height) {
-/* MR13 */ errFL("in guarded predicates all tokens in the guard must be at the same height",
-/* MR13 */ FileStr[act->file],act->line);
-/* MR13 */ };
-/* MR13 */ }
-/* MR10 */ if (ampersandStyle) {
-/* MR10 */ act->ampersandPred = pred;
-/* MR11 */ if (! HoistPredicateContext) {
-/* MR11 */ errFL("without \"-prc on\" (guard)? && <<pred>>? ... doesn't make sense",
-/* MR11 */ FileStr[act->file],act->line);
-/* MR11 */ };
-/* MR10 */ } else {
-/* MR10 */ act->guardpred = pred;
-/* MR10 */ };
-/* MR10 */ if (pred->k != semDepth) {
-/* MR10 */ warn(eMsgd2("length of guard (%d) does not match the length of semantic predicate (%d)",
-/* MR10 */ pred->k,semDepth));
-/* MR10 */ };
- }
- >>
- | <<$$ = makeBlk($$,approx,pFirstSetSymbol);
- FoundGuessBlk = 1;
- ((Junction *) ((Junction *)$$.left)->p1)->guess=1;
- if ( !$first_on_line ) {
- err("(...)? predicate must be first element of production");
- }
- >>
- )
- | <<$$ = makeBlk($$,approx,pFirstSetSymbol);>>
- )
- <<
- if ( pred==NULL && !predMsgDone) { /* MR10 */
- ((Junction *)((Junction *)$$.left)->p1)->blockid = CurBlockID;
- ((Junction *)((Junction *)$$.left)->p1)->tokrefs = toksrefd;
- ((Junction *)((Junction *)$$.left)->p1)->rulerefs = rulesrefd;
- if ( $first_on_line ) { /* MR7 */
- CurAltStart = (Junction *)((Junction *)((Junction *)$$.left)->p1); /* MR7 */
- altAdd(CurAltStart); /* MR7 */
- }; /* MR7 */
- $node = (Node *) ((Junction *)$$.left)->p1;
- }
- >>
-
- | "\{" block[&toksrefd,&rulesrefd]
- <<$$ = makeOpt($2,approx,pFirstSetSymbol);
- /* MR23 */ CurBlockID_array[BlkLevel] = (-1);
- /* MR23 */ CurAltNum_array[BlkLevel] = (-1);
- --BlkLevel;
- >>
- "\}"
- <<
- ((Junction *)((Junction *)$$.left)->p1)->blockid = CurBlockID;
- ((Junction *)((Junction *)$$.left)->p1)->tokrefs = toksrefd;
- ((Junction *)((Junction *)$$.left)->p1)->rulerefs = rulesrefd;
- >>
- <<if ( $first_on_line ) { /* MR7 */
- CurAltStart = (Junction *) ((Junction *)((Junction *)$$.left)->p1); /* MR7 */
- altAdd(CurAltStart); /* MR7 */
- };
- >>
- <<$node = (Node *) ((Junction *)$$.left)->p1;>>
-
- )
-
-/* Error catching alternatives */
- | "\*" <<warn("don't you want a ')' with that '*'?"); CannotContinue=TRUE;>>
- | "\+" <<warn("don't you want a ')' with that '+'?"); CannotContinue=TRUE;>>
- | "\>" <<warn("'>' can only appear after a nonterminal"); CannotContinue=TRUE;>>
- | PassAction <<warn("[...] out of context 'rule > [...]'");
- CannotContinue=TRUE;>>
- ;
- <<CannotContinue=TRUE;>>
-
-/* rule default_exception_handler */
-
-default_exception_handler
- : exception_group > [DefaultExGroup]
- ;
-
-/* rule exception_group */
-
-exception_group > [ExceptionGroup *eg]
- : <<ExceptionHandler *h; LabelEntry *label=NULL; /* MR6 */
- FoundException = 1; FoundExceptionGroup = 1;>> /* MR6 */
-
- "exception" <<$eg = (ExceptionGroup *)calloc(1, sizeof(ExceptionGroup));>>
- { <<char *p;>>
- PassAction /* did they attach a label? */
- <<
- p = LATEXT(1)+1;
- p[strlen(p)-1] = '\0'; /* kill trailing space */
- label = (LabelEntry *) hash_get(Elabel, LATEXT(1)+1);
- if ( label==NULL )
- {
- err(eMsg1("unknown label in exception handler: '%s'", LATEXT(1)+1));
- }
- >>
- }
- ( exception_handler > [h]
- <<list_add(&($eg->handlers), (void *)h);>>
- )*
- { "default" ":" Action
- <<{
- ExceptionHandler *eh = (ExceptionHandler *)
- calloc(1, sizeof(ExceptionHandler));
- char *a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require(eh!=NULL, "exception: cannot allocate handler");
- require(a!=NULL, "exception: cannot allocate action");
- strcpy(a, LATEXT(1));
- eh->action = a;
- eh->signalname = (char *) calloc(strlen("default")+1, sizeof(char));
- require(eh->signalname!=NULL, "exception: cannot allocate sig name");
- strcpy(eh->signalname, "default");
- list_add(&($eg->handlers), (void *)eh);
- }>>
- }
-
- <<
- if ( label!=NULL ) {
- /* Record ex group in sym tab for this label */
- if ( label->ex_group!=NULL ) {
- err(eMsg1("duplicate exception handler for label '%s'",label->str));
- } else {
- label->ex_group = $eg;
- /* Label the exception group itself */
- $eg->label = label->str;
- /* Make the labelled element pt to the exception also */
-/* MR6 */ if (label->elem == NULL) {
-/* MR6 */ err(eMsg1("reference in exception handler to undefined label '%s'",label->str));
-/* MR6 */ } else {
- switch ( label->elem->ntype ) {
- case nRuleRef :
- {
- RuleRefNode *r = (RuleRefNode *)label->elem;
- r->ex_group = $eg;
- break;
- }
- case nToken :
- {
- TokNode *t = (TokNode *)label->elem;
- t->ex_group = $eg;
- break;
- }
- } /* end switch */
-/* MR6 */ }; /* end test on label->elem */
- } /* end test on label->ex_group */
-
- } /* end test on exception label */
-
-/* MR7 */
-/* MR7 */ if (BlkLevel == 1 && label == NULL) {
-/* MR7 */ $eg->forRule=1;
-/* MR7 */ } else if (label == NULL) {
-/* MR7 */ $eg->altID = makeAltID(CurBlockID_array[BlkLevel], CurAltNum_array[BlkLevel]);
-/* MR7 */ egAdd($eg);
-/* MR7 */ } else {
-/* MR7 */ $eg->labelEntry=label;
-/* MR7 */ };
-/* MR7 */
-/* MR7 */ /* You may want to remove this exc from the rule list */
-/* MR7 */ /* and handle at the labeled element site. */
-/* MR7 */
-/* MR7 */ if (label != NULL) {
-/* MR7 */ $eg = NULL;
-/* MR7 */ };
-
- >>
- ;
- <<CannotContinue=TRUE;>>
-
-/* rule exception_handler */
-
-exception_handler > [ExceptionHandler *eh]
- : <<;>> /* MR9 Removed unreferenced variable "a" */
- "catch"
- <<
- $eh = (ExceptionHandler *)calloc(1, sizeof(ExceptionHandler));
- require($eh!=NULL, "exception: cannot allocate handler");
- >>
- ( NonTerminal
- <<
- $eh->signalname = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require($eh->signalname!=NULL, "exception: cannot allocate sig name");
- strcpy($eh->signalname, LATEXT(1));
- >>
- | TokenTerm
- <<
- $eh->signalname = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require($eh->signalname!=NULL, "exception: cannot allocate sig name");
- strcpy($eh->signalname, LATEXT(1));
- >>
- )
- ":"
- { <<$eh->action = NULL;>>
- Action
- <<
- $eh->action = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- require($eh->action!=NULL, "exception: cannot allocate action");
- strcpy($eh->action, LATEXT(1));
- >>
- }
- ;
- <<CannotContinue=TRUE;>>
-
-#token NonTerminal "[a-z] [A-Za-z0-9_]*"
- <<
- while ( zzchar==' ' || zzchar=='\t' ) {
- zzadvance();
- }
- if ( zzchar == ':' && inAlt ) NLA = LABEL;
- >>
-#token TokenTerm "[A-Z] [A-Za-z0-9_]*"
- <<
- while ( zzchar==' ' || zzchar=='\t' ) {
- zzadvance();
- }
- if ( zzchar == ':' && inAlt ) NLA = LABEL;
- >>
-#token "{\\}#[A-Za-z0-9_]*" <<warn(eMsg1("unknown meta-op: %s",LATEXT(1))); zzskip(); >>
-
-#lexclass PARSE_ENUM_FILE
-
-#token "[\t\ ]+" << zzskip(); >> /* Ignore White */
-#token "\n|\r|\r\n" << zzline++; zzskip(); >> /* Track Line # */
-#token "//" << zzmode(TOK_DEF_CPP_COMMENTS); zzmore(); >>
-#token "/\*" << zzmode(TOK_DEF_COMMENTS); zzskip(); >>
-#token "#ifdef" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >>
-#token "#if" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >>
-#token "#ifndef" << ; >>
-#token "#else" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >>
-#token "#endif" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >>
-#token "#undef" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >>
-#token "#import" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >>
-#token "@" << ; >>
-
-/* rule enum_file */
-
-enum_file[char *fname]
- : { "#ifndef" ID
- { "#define" ID /* ignore if it smells like a gate */
- /* First #define after the first #ifndef (if any) is ignored */
- }
- }
- ( ( enum_def[$fname] )+
- | defines[$fname]
- )
- |
- ;
-
-/* rule defines */
-
-defines[char *fname]
- : <<int v; int maxt=(-1); char *t;>> /* MR3 */
- (
- "#define" ID
- <<t = mystrdup(LATEXT(1));>>
- INT
- <<
- v = atoi(LATEXT(1));
-/* fprintf(stderr, "#token %s=%d\n", t, v);*/
-
- /* MR2 Andreas Magnusson (Andreas.Magnusson@mailbox.swipnet.se) */
- /* MR2 Fix to bug introduced by 1.33MR1 for #tokdefs */
- /* MR2 Don't let #tokdefs be confused by */
- /* MR2 DLGminToken and DLGmaxToken */
-
- if ( ! isDLGmaxToken(t)) { /* MR2 */
- TokenNum = v;
- if ( v>maxt ) maxt=v;
- if ( Tnum( t ) == 0 ) {
- addForcedTname( t, v );
- } else {
- warnFL(eMsg1("redefinition of token %s; ignored",t),$fname,zzline);
- };
- };
- >>
- )+
- <<TokenNum = maxt + 1;>>
- ;
-
-/* rule enum_def */
-
-enum_def[char *fname]
- : <<int v= 0; int maxt=(-1); char *t;>> /* MR3 */
- "enum" ID
- "\{"
- ID
- <<t = mystrdup(LATEXT(1));>>
- ( "=" INT <<v=atoi(LATEXT(1));>>
- | <<v++;>>
- )
- <<
-/* fprintf(stderr, "#token %s=%d\n", t, v);*/
- TokenNum = v;
- if ( v>maxt ) maxt=v; /* MR3 */
- if ( Tnum( t ) == 0 ) addForcedTname( t, v );
- else {
- warnFL(eMsg1("redefinition of token %s; ignored",t),$fname,zzline);
- }
- >>
- ( ","
-
- /* MR2 Andreas Magnusson (Andreas.Magnusson@mailbox.swipnet.se) */
- /* MR2 Fix to bug introduced by 1.33MR1 for #tokdefs */
- /* MR2 Don't let #tokdefs be confused by */
- /* MR2 DLGminToken and DLGmaxToken */
-
- {
- <<isDLGmaxToken(LATEXT(1))>>? ID { "=" INT } /* MR2 */
- | ID /* MR2 */
- <<t = mystrdup(LATEXT(1));>>
- ( "=" INT <<v=atoi(LATEXT(1));>>
- | <<v++;>>
- )
- <<
-/* fprintf(stderr, "#token %s=%d\n", t, v);*/
- TokenNum = v;
- if ( v>maxt ) maxt=v; /* MR3 */
- if ( Tnum( t ) == 0 ) addForcedTname( t, v );
- else {
- warnFL(eMsg1("redefinition of token %s; ignored",t),$fname,zzline);
- }
- >>
- }
- )*
- "\}"
- ";"
- <<TokenNum = maxt + 1;>> /* MR3 */
- ;
-
-#token INT "[0-9]+"
-#token ID "[a-zA-Z_][_a-zA-Z0-9]*"
-
-#lexclass START
-
-/* MR14 Arpad Beszedes 26-May-98
- Add support for #line directives when antlr source is pre-processed
-*/
-
-#lexaction
-<<
-
-static char *
-#ifdef __USE_PROTOS
-getFileNameFromTheLineInfo(char *toStr, char *fromStr)
-#else
-getFileNameFromTheLineInfo(toStr, fromStr)
-char *toStr, *fromStr;
-#endif
-{
- int i, j, k;
-
- if (!fromStr || !toStr) return toStr;
-
- /* find the first " */
-
- for (i=0;
- (i<MaxFileName) &&
- (fromStr[i] != '\n') &&
- (fromStr[i] != '\r') &&
- (fromStr[i] != '\"');
- i++) /* nothing */ ;
-
- if ( (i == MaxFileName) ||
- (fromStr[i] == '\n') ||
- (fromStr[i] == '\r') ) {
- return toStr;
- }
-
- /* find the second " */
-
- for (j=i+1;
- (j<MaxFileName) &&
- (fromStr[j] != '\n') &&
- (fromStr[j] != '\r') &&
- (fromStr[j] != '\"');
- j++) /* nothing */ ;
-
- if ((j == MaxFileName) ||
- (fromStr[j] == '\n') ||
- (fromStr[j] == '\r') ) {
- return toStr;
- }
-
- /* go back until the last / or \ */
-
- for (k=j-1;
- (fromStr[k] != '\"') &&
- (fromStr[k] != '/') &&
- (fromStr[k] != '\\');
- k--) /* nothing */ ;
-
- /* copy the string after " / or \ into toStr */
-
- for (i=k+1; fromStr[i] != '\"'; i++) {
- toStr[i-k-1] = fromStr[i];
- }
-
- toStr[i-k-1] = '\0';
-
- return toStr;
-}
-
-/* MR14 end of a block to support #line in antlr source code */
-
->>
-
-<<
-
-/* MR2 Andreas Magnusson (Andreas.Magnusson@mailbox.swipnet.se) */
-/* MR2 Fix to bug introduced by 1.33MR1 for #tokdefs */
-/* MR2 Don't let #tokdefs be confused by */
-/* MR2 DLGminToken and DLGmaxToken */
-
-/* semantic check on DLGminToken and DLGmaxmaxToken in #tokdefs */
-
-#ifdef __USE_PROTOS
-static int isDLGmaxToken(char *Token)
-#else
-static int isDLGmaxToken(Token)
- char * Token;
-#endif
-{
- static char checkStr1[] = "DLGmaxToken";
- static char checkStr2[] = "DLGminToken";
-
- if (strcmp(Token, checkStr1) == 0)
- return 1;
- else if (strcmp(Token, checkStr2) == 0)
- return 1;
- else
- return 0;
-}
-
-/* semantics of #token */
-static void
-#ifdef __USE_PROTOS
-chkToken(char *t, char *e, char *a, int tnum)
-#else
-chkToken(t,e,a,tnum)
-char *t, *e, *a;
-int tnum;
-#endif
-{
- TermEntry *p;
-
- /* check to see that they don't try to redefine a token as a token class */
- if ( t!=NULL ) {
- p = (TermEntry *) hash_get(Tname, t);
- if ( p!=NULL && p->classname ) {
- err(eMsg1("redefinition of #tokclass '%s' to #token not allowed; ignored",t));
- if ( a!=NULL ) free((char *)a);
- return;
- }
- }
-
- if ( t==NULL && e==NULL ) { /* none found */
- err("#token requires at least token name or rexpr");
- }
- else if ( t!=NULL && e!=NULL ) { /* both found */
- if ( UserDefdTokens ) { /* if #tokdefs, must not define new */
- p = (TermEntry *) hash_get(Tname, t);
- if ( p == NULL) {
-err(eMsg1("new token definition '%s' not allowed - only #token with name already defined by #tokdefs file allowed",t));
- return;
- };
- }
- Tklink(t, e);
- if ( a!=NULL ) {
- if ( hasAction(e) ) {
- err(eMsg1("redefinition of action for %s; ignored",e));
- }
- else setHasAction(e, a);
- }
- }
- else if ( t!=NULL ) { /* only one found */
- if ( UserDefdTokens ) {
- p = (TermEntry *) hash_get(Tname, t);
- if (p == NULL) {
-err(eMsg1("new token definition '%s' not allowed - only #token with name already defined by #tokdefs file allowed",t));
- };
- return;
- }
- if ( Tnum( t ) == 0 ) addTname( t );
- else {
- err(eMsg1("redefinition of token %s; ignored",t));
- }
- if ( a!=NULL ) {
- err(eMsg1("action cannot be attached to a token name (%s); ignored",t));
- free((char *)a);
- }
- }
- else if ( e!=NULL ) {
- if ( Tnum( e ) == 0 ) addTexpr( e );
- else {
- if ( hasAction(e) ) {
- err(eMsg1("redefinition of action for expr %s; ignored",e));
- }
- else if ( a==NULL ) {
- err(eMsg1("redefinition of expr %s; ignored",e));
- }
- }
- if ( a!=NULL ) setHasAction(e, a);
- }
-
- /* if a token type number was specified, then add the token ID and 'tnum'
- * pair to the ForcedTokens list. (only applies if an id was given)
- */
- if ( t!=NULL && tnum>0 )
- {
- if ( set_el(tnum, reserved_positions) )
- {
- err(eMsgd("a token has already been forced to token number %d; ignored", tnum));
- }
- else
- {
- list_add(&ForcedTokens, newForcedToken(t,tnum));
- set_orel(tnum, &reserved_positions);
- }
- }
-}
->>
-
-<<
-static int
-#ifdef __USE_PROTOS
-match_token(char *s, char **nxt)
-#else
-match_token(s,nxt)
-char *s;
-char **nxt;
-#endif
-{
- if ( !(*s>='A' && *s<='Z') ) return 0;
- s++;
- while ( (*s>='a' && *s<='z') ||
- (*s>='A' && *s<='Z') ||
- (*s>='0' && *s<='9') ||
- *s=='_' )
- {
- s++;
- }
- if ( *s!=' ' && *s!='}' ) return 0;
- *nxt = s;
- return 1;
-}
-
-static int
-#ifdef __USE_PROTOS
-match_rexpr(char *s, char **nxt)
-#else
-match_rexpr(s,nxt)
-char *s;
-char **nxt;
-#endif
-{
- if ( *s!='"' ) return 0;
- s++;
- while ( *s!='"' )
- {
- if ( *s=='\n' || *s=='\r' ) /* MR13 */
- warn("eoln found in regular expression");
- if ( *s=='\\' ) s++;
- s++;
- }
- *nxt = s+1;
- return 1;
-}
-
-/*
- * Walk a string "{ A .. Z }" where A..Z is a space separated list
- * of token references (either labels or reg exprs). Return a
- * string "inlineX_set" for some unique integer X. Basically,
- * we pretend as if we had seen "#tokclass inlineX { A .. Z }"
- * on the input stream outside of an action.
- */
-char *
-#ifdef __USE_PROTOS
-inline_set(char *s)
-#else
-inline_set(s)
-char *s;
-#endif
-{
- char *nxt;
- fprintf(stderr, "found consumeUntil( {...} )\n");
- while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;}
- if ( *s!='{' )
- {
- err("malformed consumeUntil( {...} ); missing '{'");
- return "bad_set";
- }
- s++;
- while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;}
- while ( *s!='}' )
- {
- if ( match_token(s,&nxt) ) fprintf(stderr, "found token %s\n", s);
- else if ( match_rexpr(s,&nxt) ) fprintf(stderr, "found rexpr %s\n", s);
- else {
- err("invalid element in consumeUntil( {...} )");
- return "bad_set";
- }
- s = nxt;
- while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;}
- }
- return "inlineX_set";
-}
->>
-
-<<
-/* ANTLR-specific syntax error message generator
- * (define USER_ZZSYN when compiling so don't get 2 definitions)
- */
-void
-#ifdef __USE_PROTOS
-zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok,
-int k, char *bad_text)
-#else
-zzsyn(text, tok, egroup, eset, etok, k, bad_text)
-char *text, *egroup, *bad_text;
-int tok;
-int etok;
-int k;
-SetWordType *eset;
-#endif
-{
- fprintf(stderr, ErrHdr, FileStr[CurFile]!=NULL?FileStr[CurFile]:"stdin", zzline);
- fprintf(stderr, " syntax error at \"%s\"", (tok==zzEOF_TOKEN)?"EOF":text);
- if ( !etok && !eset ) {fprintf(stderr, "\n"); return;}
- if ( k==1 ) fprintf(stderr, " missing");
- else
- {
- fprintf(stderr, "; \"%s\" not", bad_text);
- if ( zzset_deg(eset)>1 ) fprintf(stderr, " in");
- }
- if ( zzset_deg(eset)>0 ) zzedecode(eset);
- else fprintf(stderr, " %s", zztokens[etok]);
- if ( strlen(egroup) > (size_t)0 ) fprintf(stderr, " in %s", egroup);
- fprintf(stderr, "\n");
-}
->>
-
-#lexaction <<
-#ifdef __USE_PROTOS
-void mark_label_used_in_sem_pred(LabelEntry *le) /* MR10 */
-#else
-void mark_label_used_in_sem_pred(le) /* MR10 */
- LabelEntry *le;
-#endif
-{
- TokNode *tn;
- require (le->elem->ntype == nToken,"mark_label_used... ntype != nToken");
- tn=(TokNode *)le->elem;
- require (tn->label != 0,"mark_label_used... TokNode has no label");
- tn->label_used_in_semantic_pred=1;
-}
->>
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.r b/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.r
deleted file mode 100644
index e3de38759f..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr.r
+++ /dev/null
@@ -1,787 +0,0 @@
-/*
- File: antlrMPW.r
- Target: antlr 133MR
- Created: Monday, June 15, 1998 4:41:11 AM
- Author: Kenji Tanaka (kentar@osa.att.ne.jp)
-*/
-
-#include "cmdo.r"
-
-resource 'cmdo' (128, "Antlr") {
- { /* array dialogs: 5 elements */
- /* [1] */
- 295,
- "ANTLR -- Purdue Compiler Construction To"
- "ol Set (PCCTS) LL(k) parser generator.",
- { /* array itemArray: 12 elements */
- /* [1] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {18, 23, 33, 223},
- "Read grammar from stdin",
- "-",
- "Read grammar from stdin."
- },
- /* [2] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {38, 23, 53, 310},
- "Send grammar.c/grammar.cpp to stdout",
- "-stdout",
- "Send grammar.c/grammar.cpp to stdout."
- },
- /* [3] */
- NotDependent {
-
- },
- MultiFiles {
- "Grammar File(s)É",
- "Choose the grammar specification files y"
- "ou wish to have ANTLR process.",
- {79, 22, 98, 152},
- "Grammar specification:",
- "",
- MultiInputFiles {
- { /* array MultiTypesArray: 1 elements */
- /* [1] */
- text
- },
- ".g",
- "Files ending in .g",
- "All text files"
- }
- },
- /* [4] */
- NotDependent {
-
- },
- Files {
- DirOnly,
- OptionalFile {
- {58, 168, 74, 298},
- {79, 169, 98, 299},
- "Output Directory",
- ":",
- "-o",
- "",
- "Choose the directory where ANTLR will pu"
- "t its output.",
- dim,
- "Output DirectoryÉ",
- "",
- ""
- },
- NoMore {
-
- }
- },
- /* [5] */
- NotDependent {
-
- },
- Redirection {
- StandardOutput,
- {126, 27}
- },
- /* [6] */
- NotDependent {
-
- },
- Redirection {
- DiagnosticOutput,
- {126, 178}
- },
- /* [7] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {117, 20, 167, 300},
- "Redirection"
- },
- /* [8] */
- NotDependent {
-
- },
- NestedDialog {
- 5,
- {20, 324, 40, 460},
- "Parse OptionsÉ",
- "Parse control options may be set with th"
- "is button."
- },
- /* [9] */
- NotDependent {
-
- },
- NestedDialog {
- 2,
- {50, 324, 70, 460},
- "Generate OptionsÉ",
- "Various command line options may be set "
- "with this button."
- },
- /* [10] */
- NotDependent {
-
- },
- NestedDialog {
- 3,
- {78, 324, 98, 460},
- "More OptionsÉ",
- "Antlr has ALOT of options. There are eve"
- "n more to be found with this button."
- },
- /* [11] */
- NotDependent {
-
- },
- NestedDialog {
- 4,
- {106, 324, 126, 460},
- "Rename OptionsÉ",
- "Options for renaming output files may be"
- " set with this button."
- },
- /* [12] */
- NotDependent {
-
- },
- VersionDialog {
- VersionString {
- "1.33MR"
- },
- "PCCTS was written by Terence Parr, Russe"
- "ll Quong, Will Cohen, and Hank Dietz: 19"
- "89-1998. MPW port by Scott Haney.",
- noDialog
- }
- },
- /* [2] */
- 295,
- "Use this dialog to specify command line "
- "Generate Options.",
- { /* array itemArray: 15 elements */
- /* [1] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {18, 25, 33, 225},
- "Generate C++ code",
- "-CC",
- "Generate C++ output from both ANTLR and "
- "DLG."
- },
- /* [2] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {38, 25, 53, 225},
- "Generate ASTs",
- "-gt",
- "Generate code for Abstract-Syntax-Trees "
- "(ASTs)."
- },
- /* [3] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {58, 25, 73, 225},
- "Generate line info",
- "-gl",
- "If this option is checked, ANTLR will ge"
- "nerate line info about grammaractions, t"
- "hereby making debugging easier since com"
- "pile errors will point to the grammar fi"
- "le."
- },
- /* [4] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {78, 25, 93, 225},
- "Generate error classes",
- "-ge",
- "If this option is checked, ANTLR will ge"
- "nerate an error class foreach non-termin"
- "al."
- },
- /* [5] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {98, 25, 113, 225},
- "Don't generate Code",
- "-gc",
- "If this option is checked, ANTLR will ge"
- "nerate no code, i.e. it will only perfor"
- "m analysis on the grammar."
- },
- /* [6] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {118, 25, 133, 225},
- "Delay lookahead fetches",
- "-gk",
- "If this option is checked, ANTLR will ge"
- "nerate a parser that delays lookahead fe"
- "tches until needed."
- },
- /* [7] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {138, 25, 153, 225},
- "Use newAST(...)",
- "-newAST",
- "In C++ mode use \"newAST(...)\" rather tha"
- "n \"new AST(...)\""
- },
- /* [8] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {18, 235, 33, 435},
- "Support parse traces",
- "-gd",
- "If this option is checked, ANTLR inserts"
- " code in each parsing function to provid"
- "e for user-defined handling of a detaile"
- "d parse trace. The code consists of call"
- "s to zzTRACEIN and zzTRACEOUT."
- },
- /* [9] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {38, 235, 53, 435},
- "Generate cross-references",
- "-cr",
- "If this option is checked, ANTLR will ge"
- "nerate a cross reference for all rules. "
- "For each rule it will print a list of al"
- "l other rules that refrence it."
- },
- /* [10] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {58, 235, 73, 435},
- "Don't create Lexer files",
- "-gx",
- "If this option is checked, ANTLR will no"
- "t generate DLG-related output files. Thi"
- "s option should be used if one wants a c"
- "ustom lexical analyzer or if one has mad"
- "e changes to the grammar not affecting t"
- "he lexical structure."
- },
- /* [11] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {78, 235, 93, 460},
- "Don't generate token expr sets",
- "-gs",
- "If this option is checked, ANTLR will no"
- "t generate sets for token expression set"
- "s; instead, it will generate a || separa"
- "ted sequence of LA(1)==token #. "
- },
- /* [12] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {98, 235, 113, 460},
- "Generate ANSI-compatible",
- "-ga",
- "Generate ANSI-compatible code (default=F"
- "ALSE)"
- },
- /* [13] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {118, 235, 133, 460},
- "Don't generate tokens.h",
- "-gxt",
- "Do not generate tokens.h (default=FALSE)"
- },
- /* [13] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {138, 235, 153, 460},
- "Provide \"(alpha)? beta\" info",
- "-alpha",
- "Provide additional information for \"(alpha)? beta\" error messages"
- },
- /* [14] */
- NotDependent {
-
- },
- RegularEntry {
- "Tabs(1 to 8):",
- {162, 23, 177, 117},
- {163, 125, 179, 196},
- "",
- keepCase,
- "-tab",
- "Width of tabs (1 to 8) for grammar.c/gra"
- "mmar.cpp files."
- },
- /* [15] */
- NotDependent {
-
- },
- RegularEntry {
- "Function Prefix:",
- {161, 236, 177, 342},
- {162, 345, 177, 454},
- "",
- keepCase,
- "-gp",
- "Prefix all generated rule functions with"
- " a string."
- }
- },
- /* [3] */
- 295,
- "Use this dialog to specify still more co"
- "mmand line options.",
- { /* array itemArray: 12 elements */
- /* [1] */
- NotDependent {
-
- },
- RadioButtons {
- { /* array radioArray: 3 elements */
- /* [1] */
- {38, 25, 53, 85}, "None", "", Set, "When this option is selected, ANTLR will"
- " not print the grammar to stdout.",
- /* [2] */
- {38, 100, 53, 160}, "Yes", "-p", NotSet, "When this option is selected, ANTLR will"
- " print the grammar, stripped of all acti"
- "ons and comments, to stdout.",
- /* [3] */
- {38, 175, 53, 235}, "More", "-pa", NotSet, "When this option is selected, ANTLR will"
- " print the grammar, stripped of all acti"
- "ons and comments, to stdout. It will als"
- "o annotate the output with the first set"
- "s determined from grammar analysis."
- }
- },
- /* [2] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {28, 15, 60, 250},
- "Grammar Printing"
- },
- /* [3] */
- NotDependent {
-
- },
- RadioButtons {
- { /* array radioArray: 3 elements */
- /* [1] */
- {88, 25, 103, 85}, "Low", "", Set, "When this option is selected, ANTLR will"
- " show ambiguities/errors in low detail.",
- /* [2] */
- {88, 100, 103, 160}, "Medium", "-e2", NotSet, "When this option is selected, ANTLR will"
- " show ambiguities/errors in more detail.",
- /* [3] */
- {88, 175, 103, 235}, "High", "-e3", NotSet, "When this option is selected, ANTLR will"
- " show ambiguities/errors in excruciating"
- " detail."
- }
- },
- /* [4] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {78, 15, 110, 250},
- "Error reporting"
- },
- /* [5] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {130, 22, 145, 222},
- "More warnings",
- "-w2",
- "If this option is checked, ANTLR will wa"
- "rn if semantic predicates and/or (É)? bl"
- "ocks are assumed to cover ambiguous alte"
- "rnatives."
- },
- /* [6] */
- NotDependent {
-
- },
- RegularEntry {
- "Report when tnode usage exceeds:",
- {162, 23, 180, 253},
- {162, 255, 178, 326},
- "",
- keepCase,
- "-treport",
- "Report when tnode usage exceeds value du"
- "ring ambiguity resolution."
- },
- /* [7] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {40, 292, 55, 431},
- "Predicate",
- "-info p",
- "With the antlr \"-info p\" switch the user"
- " will receive information about the pred"
- "icate suppression in the generated file."
- },
- /* [8] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {60, 292, 75, 430},
- "Tree Nodes",
- "-info t",
- "Using \"-info t\" gives information about "
- "the total number of tnodes created and t"
- "he peak number of tnodes."
- },
- /* [9] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {80, 292, 95, 425},
- "First/follow",
- "-info f",
- "first/follow set information."
- },
- /* [10] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {100, 292, 115, 425},
- "Monitor progress",
- "-info m",
- "prints name of each rule as it is starte"
- "d and flushes output at start of each rule."
- },
- /* [11] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {120, 292, 135, 416},
- "Orphan rules",
- "-info o",
- "If there is more than one rule which is "
- "not referenced by any other rule then al"
- "l such rules are listed."
- },
- /* [12] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {28, 279, 147, 451},
- "Extra info"
- }
- },
- /* [4] */
- 295,
- "Use this dialog to specify command line "
- "options relating to renaming output file"
- "s.",
- { /* array itemArray: 7 elements */
- /* [1] */
- NotDependent {
-
- },
- RegularEntry {
- "Errors file name:",
- {35, 25, 50, 205},
- {35, 205, 51, 300},
- "err.c",
- keepCase,
- "-fe",
- "This entry specifies the name ANTLR uses"
- " for the errors file."
- },
- /* [2] */
- NotDependent {
-
- },
- RegularEntry {
- "Lexical output name:",
- {60, 25, 75, 205},
- {60, 205, 76, 300},
- "parser.dlg",
- keepCase,
- "-fl",
- "This entry specifies the name ANTLR uses"
- " for the lexical output file."
- },
- /* [3] */
- NotDependent {
-
- },
- RegularEntry {
- "Lexical modes name:",
- {85, 25, 100, 205},
- {85, 205, 101, 300},
- "mode.h",
- keepCase,
- "-fm",
- "This entry specifies the name ANTLR uses"
- " for the lexical mode definitions file."
- },
- /* [4] */
- NotDependent {
-
- },
- RegularEntry {
- "Remap file name:",
- {110, 25, 125, 205},
- {110, 205, 126, 300},
- "remap.h",
- keepCase,
- "-fr",
- "This entry specifies the name ANTLR uses"
- " for the file that remaps globally visib"
- "le symbols."
- },
- /* [5] */
- NotDependent {
-
- },
- RegularEntry {
- "Tokens file name:",
- {135, 25, 150, 205},
- {135, 205, 151, 300},
- "tokens.h",
- keepCase,
- "-ft",
- "This entry specifies the name ANTLR uses"
- " for the tokens file."
- },
- /* [6] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {160, 25, 175, 175},
- "Create std header",
- "-gh",
- "If this option is checked, ANTLR will cr"
- "eate a standard header file named, by de"
- "fault 'stdpccts.h'. This name can be alt"
- "ered using the entry right next door."
- },
- /* [7] */
- Or {
- { /* array OrArray: 1 elements */
- /* [1] */
- 6
- }
- },
- RegularEntry {
- "Std header file name:",
- {160, 175, 175, 355},
- {160, 355, 176, 450},
- "stdpccts.h",
- keepCase,
- "-fh",
- "This entry specifies the name ANTLR uses"
- " for the standard header file."
- }
- },
- /* [5] */
- 295,
- "Use this dialog to specify parse options"
- ".",
- { /* array itemArray: 9 elements */
- /* [1] */
- NotDependent {
-
- },
- RegularEntry {
- "Lookahead:",
- {23, 27, 38, 152},
- {46, 29, 62, 154},
- "1",
- keepCase,
- "-k",
- "This entry specifies the number of token"
- "s of lookahead."
- },
- /* [2] */
- NotDependent {
-
- },
- RegularEntry {
- "Compr lookahead:",
- {22, 167, 37, 292},
- {46, 172, 62, 297},
- "",
- keepCase,
- "-ck",
- "This entry specifies the number of token"
- "s of lookahead when using compressed (li"
- "near approximation) lookahead. In genera"
- "l, the compressed lookahead is much deep"
- "er than the full lookahead."
- },
- /* [3] */
- NotDependent {
-
- },
- RegularEntry {
- "Max tree nodes:",
- {22, 312, 37, 437},
- {46, 315, 62, 445},
- "",
- keepCase,
- "-rl",
- "This entry specifies the maximum number "
- "of tokens of tree nodes used by the gram"
- "mar analysis."
- },
- /* [4] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {76, 25, 91, 350},
- "Maintenance Release style hoisting",
- "-mrhoist",
- "Turn on/off k=1 Maintenance Release styl"
- "e hoisting."
- },
- /* [5] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {96, 25, 111, 431},
- "EXPERIMENTAL Maintenance Release style h"
- "oisting",
- "-mrhoistk",
- "Turn on/off k>1 EXPERIMENTAL Maintenance"
- " Release style hoisting."
- },
- /* [6] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {116, 25, 131, 363},
- "Compute context for hoisted predicates",
- "-prc on",
- "Turn on/off computation of context for h"
- "oisted predicates."
- },
- /* [7] */
- NotDependent {
-
- },
- RegularEntry {
- "Ambiguity aid:",
- {140, 27, 155, 125},
- {141, 135, 155, 209},
- "",
- keepCase,
- "-aa",
- "Ambiguity aid for a rule (rule name or l"
- "ine number)."
- },
- /* [8] */
- NotDependent {
-
- },
- RegularEntry {
- "Limits exp growth:",
- {140, 236, 155, 361},
- {139, 372, 155, 452},
- "",
- keepCase,
- "-aad",
- "Limits exp growth of -aa listing - defau"
- "lt=1 (max=ck value)."
- },
- /* [9] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {164, 26, 179, 366},
- "Lookahead token may appear multiple time"
- "s",
- "-aam",
- "Lookahead token may appear multiple time"
- "s in -aa listing."
- }
- }
- }
-};
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr1.txt b/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr1.txt
deleted file mode 100644
index 4a7d22e7f2..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/antlr1.txt
+++ /dev/null
@@ -1,264 +0,0 @@
-
-
-
-ANTLR(1) PCCTS Manual Pages ANTLR(1)
-
-
-
-NAME
- antlr - ANother Tool for Language Recognition
-
-SYNTAX
- antlr [_o_p_t_i_o_n_s] _g_r_a_m_m_a_r__f_i_l_e_s
-
-DESCRIPTION
- _A_n_t_l_r converts an extended form of context-free grammar into
- a set of C functions which directly implement an efficient
- form of deterministic recursive-descent LL(k) parser.
- Context-free grammars may be augmented with predicates to
- allow semantics to influence parsing; this allows a form of
- context-sensitive parsing. Selective backtracking is also
- available to handle non-LL(k) and even non-LALR(k) con-
- structs. _A_n_t_l_r also produces a definition of a lexer which
- can be automatically converted into C code for a DFA-based
- lexer by _d_l_g. Hence, _a_n_t_l_r serves a function much like that
- of _y_a_c_c, however, it is notably more flexible and is more
- integrated with a lexer generator (_a_n_t_l_r directly generates
- _d_l_g code, whereas _y_a_c_c and _l_e_x are given independent
- descriptions). Unlike _y_a_c_c which accepts LALR(1) grammars,
- _a_n_t_l_r accepts LL(k) grammars in an extended BNF notation -
- which eliminates the need for precedence rules.
-
- Like _y_a_c_c grammars, _a_n_t_l_r grammars can use automatically-
- maintained symbol attribute values referenced as dollar
- variables. Further, because _a_n_t_l_r generates top-down
- parsers, arbitrary values may be inherited from parent rules
- (passed like function parameters). _A_n_t_l_r also has a mechan-
- ism for creating and manipulating abstract-syntax-trees.
-
- There are various other niceties in _a_n_t_l_r, including the
- ability to spread one grammar over multiple files or even
- multiple grammars in a single file, the ability to generate
- a version of the grammar with actions stripped out (for
- documentation purposes), and lots more.
-
-OPTIONS
- -ck _n
- Use up to _n symbols of lookahead when using compressed
- (linear approximation) lookahead. This type of looka-
- head is very cheap to compute and is attempted before
- full LL(k) lookahead, which is of exponential complex-
- ity in the worst case. In general, the compressed loo-
- kahead can be much deeper (e.g, -ck 10) _t_h_a_n _t_h_e _f_u_l_l
- _l_o_o_k_a_h_e_a_d (_w_h_i_c_h _u_s_u_a_l_l_y _m_u_s_t _b_e _l_e_s_s _t_h_a_n _4).
-
- -CC Generate C++ output from both ANTLR and DLG.
-
- -cr Generate a cross-reference for all rules. For each
- rule, print a list of all other rules that reference
- it.
-
- -e1 Ambiguities/errors shown in low detail (default).
-
- -e2 Ambiguities/errors shown in more detail.
-
- -e3 Ambiguities/errors shown in excruciating detail.
-
- -fe file
- Rename err.c to file.
-
- -fh file
- Rename stdpccts.h header (turns on -gh) to file.
-
- -fl file
- Rename lexical output, parser.dlg, to file.
-
- -fm file
- Rename file with lexical mode definitions, mode.h, to
- file.
-
- -fr file
- Rename file which remaps globally visible symbols,
- remap.h, to file.
-
- -ft file
- Rename tokens.h to file.
-
- -ga Generate ANSI-compatible code (default case). This has
- not been rigorously tested to be ANSI XJ11 C compliant,
- but it is close. The normal output of _a_n_t_l_r is
- currently compilable under both K&R, ANSI C, and C++-
- this option does nothing because _a_n_t_l_r generates a
- bunch of #ifdef's to do the right thing depending on
- the language.
-
- -gc Indicates that _a_n_t_l_r should generate no C code, i.e.,
- only perform analysis on the grammar.
-
- -gd C code is inserted in each of the _a_n_t_l_r generated pars-
- ing functions to provide for user-defined handling of a
- detailed parse trace. The inserted code consists of
- calls to the user-supplied macros or functions called
- zzTRACEIN and zzTRACEOUT. The only argument is a _c_h_a_r
- * pointing to a C-style string which is the grammar
- rule recognized by the current parsing function. If no
- definition is given for the trace functions, upon rule
- entry and exit, a message will be printed indicating
- that a particular rule as been entered or exited.
-
- -ge Generate an error class for each non-terminal.
-
- -gh Generate stdpccts.h for non-ANTLR-generated files to
- include. This file contains all defines needed to
- describe the type of parser generated by _a_n_t_l_r (e.g.
- how much lookahead is used and whether or not trees are
- constructed) and contains the header action specified
- by the user.
-
- -gk Generate parsers that delay lookahead fetches until
- needed. Without this option, _a_n_t_l_r generates parsers
- which always have _k tokens of lookahead available.
-
- -gl Generate line info about grammar actions in C parser of
- the form # _l_i_n_e "_f_i_l_e" which makes error messages from
- the C/C++ compiler make more sense as they will point
- into the grammar file not the resulting C file.
- Debugging is easier as well, because you will step
- through the grammar not C file.
-
- -gs Do not generate sets for token expression lists;
- instead generate a ||-separated sequence of
- LA(1)==_t_o_k_e_n__n_u_m_b_e_r. The default is to generate sets.
-
- -gt Generate code for Abstract-Syntax Trees.
-
- -gx Do not create the lexical analyzer files (dlg-related).
- This option should be given when the user wishes to
- provide a customized lexical analyzer. It may also be
- used in _m_a_k_e scripts to cause only the parser to be
- rebuilt when a change not affecting the lexical struc-
- ture is made to the input grammars.
-
- -k _n Set k of LL(k) to _n; i.e. set tokens of look-ahead
- (default==1).
-
- -o dir
- Directory where output files should go (default=".").
- This is very nice for keeping the source directory
- clear of ANTLR and DLG spawn.
-
- -p The complete grammar, collected from all input grammar
- files and stripped of all comments and embedded
- actions, is listed to stdout. This is intended to aid
- in viewing the entire grammar as a whole and to elim-
- inate the need to keep actions concisely stated so that
- the grammar is easier to read. Hence, it is preferable
- to embed even complex actions directly in the grammar,
- rather than to call them as subroutines, since the sub-
- routine call overhead will be saved.
-
- -pa This option is the same as -p except that the output is
- annotated with the first sets determined from grammar
- analysis.
-
- -prc on
- Turn on the computation and hoisting of predicate con-
- text.
-
- -prc off
- Turn off the computation and hoisting of predicate con-
- text. This option makes 1.10 behave like the 1.06
- release with option -pr on. Context computation is off
- by default.
-
- -rl _n
- Limit the maximum number of tree nodes used by grammar
- analysis to _n. Occasionally, _a_n_t_l_r is unable to
- analyze a grammar submitted by the user. This rare
- situation can only occur when the grammar is large and
- the amount of lookahead is greater than one. A non-
- linear analysis algorithm is used by PCCTS to handle
- the general case of LL(k) parsing. The average com-
- plexity of analysis, however, is near linear due to
- some fancy footwork in the implementation which reduces
- the number of calls to the full LL(k) algorithm. An
- error message will be displayed, if this limit is
- reached, which indicates the grammar construct being
- analyzed when _a_n_t_l_r hit a non-linearity. Use this
- option if _a_n_t_l_r seems to go out to lunch and your disk
- start thrashing; try _n=10000 to start. Once the
- offending construct has been identified, try to remove
- the ambiguity that _a_n_t_l_r was trying to overcome with
- large lookahead analysis. The introduction of (...)?
- backtracking blocks eliminates some of these problems -
- _a_n_t_l_r does not analyze alternatives that begin with
- (...)? (it simply backtracks, if necessary, at run
- time).
-
- -w1 Set low warning level. Do not warn if semantic
- predicates and/or (...)? blocks are assumed to cover
- ambiguous alternatives.
-
- -w2 Ambiguous parsing decisions yield warnings even if
- semantic predicates or (...)? blocks are used. Warn if
- predicate context computed and semantic predicates
- incompletely disambiguate alternative productions.
-
- - Read grammar from standard input and generate stdin.c
- as the parser file.
-
-SPECIAL CONSIDERATIONS
- _A_n_t_l_r works... we think. There is no implicit guarantee of
- anything. We reserve no legal rights to the software known
- as the Purdue Compiler Construction Tool Set (PCCTS) - PCCTS
- is in the public domain. An individual or company may do
- whatever they wish with source code distributed with PCCTS
- or the code generated by PCCTS, including the incorporation
- of PCCTS, or its output, into commercial software. We
- encourage users to develop software with PCCTS. However, we
- do ask that credit is given to us for developing PCCTS. By
- "credit", we mean that if you incorporate our source code
- into one of your programs (commercial product, research pro-
- ject, or otherwise) that you acknowledge this fact somewhere
- in the documentation, research report, etc... If you like
- PCCTS and have developed a nice tool with the output, please
- mention that you developed it using PCCTS. As long as these
- guidelines are followed, we expect to continue enhancing
- this system and expect to make other tools available as they
- are completed.
-
-FILES
- *.c output C parser.
-
- *.cpp
- output C++ parser when C++ mode is used.
-
- parser.dlg
- output _d_l_g lexical analyzer.
-
- err.c
- token string array, error sets and error support rou-
- tines. Not used in C++ mode.
-
- remap.h
- file that redefines all globally visible parser sym-
- bols. The use of the #parser directive creates this
- file. Not used in C++ mode.
-
- stdpccts.h
- list of definitions needed by C files, not generated by
- PCCTS, that reference PCCTS objects. This is not gen-
- erated by default. Not used in C++ mode.
-
- tokens.h
- output #_d_e_f_i_n_e_s for tokens used and function prototypes
- for functions generated for rules.
-
-
-SEE ALSO
- dlg(1), pccts(1)
-
-
-
-
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/bits.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/bits.c
deleted file mode 100644
index ddd9bd6053..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/bits.c
+++ /dev/null
@@ -1,1025 +0,0 @@
-/* bits.c -- manage creation and output of bit sets used by the parser.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <assert.h>
-#include "pcctscfg.h"
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#include "dlgdef.h"
-
-/* char is only thing that is pretty much always known == 8 bits
- * This allows output of antlr (set stuff, anyway) to be androgynous (portable)
- */
-typedef unsigned char SetWordType;
-#define BitsPerByte 8
-#define BitsPerWord BitsPerByte*sizeof(SetWordType)
-
-static SetWordType *setwd = NULL;
-int setnum = -1;
-int wordnum = 0;
-
-int esetnum = 0;
-
-/* Used to convert native wordsize, which ANTLR uses (via set.c) to manipulate sets,
- to bytes that are most portable size-wise.
- */
-void
-#ifdef __USE_PROTOS
-DumpIntAsChars( FILE *f, char *format, unsigned wd )
-#else
-DumpIntAsChars( f, format, wd )
-FILE *f;
-char *format;
-unsigned wd;
-#endif
-{
- int i;
- /* uses max of 32 bit unsigned integer for the moment */
- static unsigned long byte_mask[sizeof(unsigned long)] =
- { 0xFF, 0xFF00UL, 0xFF0000UL, 0xFF000000UL }; /* MR20 G. Hobbelt */
-/* 0xFF00000000, 0xFF0000000000, 0xFF000000000000, 0xFF00000000000000 };*/
-
- /* for each byte in the word */
- assert(sizeof(unsigned) <= 4); /* M20 G. Hobbelt Sanity check */
- for (i=0; i<sizeof(unsigned); i++)
- {
- /* mask out the ith byte and shift down to the first 8 bits */
- fprintf(f, format, (wd&byte_mask[i])>>(i*BitsPerByte));
- if ( i<sizeof(unsigned)-1) fprintf(f, ",");
- }
-}
-
-/* Create a new setwd (ignoring [Ep] token on end) */
-void
-#ifdef __USE_PROTOS
-NewSetWd( void )
-#else
-NewSetWd( )
-#endif
-{
- SetWordType *p;
-
- if ( setwd == NULL )
- {
- setwd = (SetWordType *) calloc(TokenNum, sizeof(SetWordType));
- require(setwd!=NULL, "NewSetWd: cannot alloc set wd\n");
- }
- for (p = setwd; p<&(setwd[TokenNum]); p++) {*p=0;}
- wordnum++;
-}
-
-void
-#ifdef __USE_PROTOS
-DumpSetWd( void )
-#else
-DumpSetWd( )
-#endif
-{
- if ( GenCC ) DumpSetWdForCC();
- else DumpSetWdForC();
-}
-
-/* Dump the current setwd to ErrFile. 0..MaxTokenVal */
-void
-#ifdef __USE_PROTOS
-DumpSetWdForC( void )
-#else
-DumpSetWdForC( )
-#endif
-{
- int i,c=1;
-
- if ( setwd==NULL ) return;
- fprintf(DefFile, "extern SetWordType setwd%d[];\n", wordnum);
- fprintf(ErrFile,
- "SetWordType setwd%d[%d] = {", wordnum, TokenNum-1);
- for (i=0; i<TokenNum-1; i++)
- {
- DAWDLE;
- if ( i!=0 ) fprintf(ErrFile, ",");
- if ( c == 8 ) {fprintf(ErrFile, "\n\t"); c=1;} else c++;
- fprintf(ErrFile, "0x%x", setwd[i]);
- }
- fprintf(ErrFile, "};\n");
-}
-
-/* Dump the current setwd to Parser.C file. 0..MaxTokenVal;
- * Only used if -CC on.
- */
-void
-#ifdef __USE_PROTOS
-DumpSetWdForCC( void )
-#else
-DumpSetWdForCC( )
-#endif
-{
- int i,c=1;
-
- if ( setwd==NULL ) return;
- fprintf(Parser_h, "\tstatic SetWordType setwd%d[%d];\n", wordnum, TokenNum-1);
- fprintf(Parser_c,
- "SetWordType %s::setwd%d[%d] = {", CurrentClassName, wordnum,
- TokenNum-1);
- for (i=0; i<TokenNum-1; i++)
- {
- DAWDLE;
- if ( i!=0 ) fprintf(Parser_c, ",");
- if ( c == 8 ) {fprintf(Parser_c, "\n\t"); c=1;} else c++;
- fprintf(Parser_c, "0x%x", setwd[i]);
- }
- fprintf(Parser_c, "};\n");
-}
-
-/* Make a new set. Dump old setwd and create new setwd if current setwd is full */
-void
-#ifdef __USE_PROTOS
-NewSet( void )
-#else
-NewSet( )
-#endif
-{
- setnum++;
- if ( setnum==BitsPerWord ) /* is current setwd full? */
- {
- DumpSetWd(); NewSetWd(); setnum = 0;
- }
-}
-
-/* s is a set of tokens. Turn on bit at each token position in set 'setnum' */
-void
-#ifdef __USE_PROTOS
-FillSet( set s )
-#else
-FillSet( s )
-set s;
-#endif
-{
- SetWordType mask=(((unsigned)1)<<setnum);
- unsigned int e;
-
- while ( !set_nil(s) )
- {
- e = set_int(s);
- set_rm(e, s);
- setwd[e] |= mask;
- }
-}
-
- /* E r r o r C l a s s S t u f f */
-
-/* compute the FIRST of a rule for the error class stuff */
-static set
-#ifdef __USE_PROTOS
-Efirst( char *rule, ECnode *eclass )
-#else
-Efirst( rule, eclass )
-char *rule;
-ECnode *eclass;
-#endif
-{
- set rk, a;
- Junction *r;
- RuleEntry *q = (RuleEntry *) hash_get(Rname, rule);
-
- if ( q == NULL )
- {
- warnNoFL(eMsg2("undefined rule '%s' referenced in errclass '%s'; ignored",
- rule, TokenString(eclass->tok)));
- return empty;
- }
- r = RulePtr[q->rulenum];
- r->end->halt = TRUE; /* don't let reach fall off end of rule here */
- rk = empty;
- REACH(r, 1, &rk, a);
- r->end->halt = FALSE;
- return a;
-}
-
-/*
- * scan the list of tokens/eclasses/nonterminals filling the new eclass
- * with the set described by the list. Note that an eclass can be
- * quoted to allow spaces etc... However, an eclass must not conflict
- * with a reg expr found elsewhere. The reg expr will be taken over
- * the eclass name.
- */
-static void
-#ifdef __USE_PROTOS
-doEclass( char *eclass )
-#else
-doEclass( eclass )
-char *eclass;
-#endif
-{
- TermEntry *q;
- ECnode *p;
- TCnode *tcnode;
- ListNode *e;
- unsigned int t;
- unsigned deg=0;
- set a;
- require(eclass!=NULL, "doEclass: NULL eset");
-
- p = (ECnode *) eclass;
- lexmode(p->lexclass); /* switch to lexclass where errclass is defined */
- p->eset = empty;
- for (e = (p->elist)->next; e!=NULL; e=e->next)
- {
- q = NULL; /* MR23 */
-
- if ( islower( *((char *)e->elem) ) ) /* is it a rule ref? (alias FIRST request) */
- {
- a = Efirst((char *)e->elem, p);
- set_orin(&p->eset, a);
- deg += set_deg(a);
- set_free( a );
- continue;
- }
- else if ( *((char *)e->elem)=='"' )
- {
- t = 0;
- q = (TermEntry *) hash_get(Texpr, (char *) e->elem);
- if ( q == NULL )
- {
- /* if quoted and not an expr look for eclass name */
- q = (TermEntry *) hash_get(Tname, *((char **)&(e->elem))=StripQuotes((char *)e->elem));
- if ( q != NULL ) t = q->token;
- }
- else t = q->token;
- }
- else /* labelled token/eclass/tokclass */
- {
- q = (TermEntry *) hash_get(Tname, (char *)e->elem);
- if ( q != NULL )
- {
- if ( strcmp((char *)e->elem, TokenString(p->tok))==0 )
- {
- warnNoFL(eMsg1("self-referential error class '%s'; ignored",
- (char *)e->elem));
- continue;
- }
- else
- t = q->token;
- }
- else t=0;
- }
- if ( t!=0 )
- {
- if (isTermEntryTokClass(q)) { /* MR23 */
- tcnode = q->tclass; /* MR23 */
- set_orin(&p->eset, tcnode->tset); /* MR23 */
- deg = set_deg(p->eset); /* MR23 */
- } /* MR23 */
- else {
- set_orel(t, &p->eset);
- deg++;
- }
- }
- else warnNoFL(eMsg2("undefined token '%s' referenced in errclass '%s'; ignored",
- (char *)e->elem, TokenString(p->tok)));
- }
- p->setdeg = deg;
-}
-
-void
-#ifdef __USE_PROTOS
-ComputeErrorSets( void )
-#else
-ComputeErrorSets( )
-#endif
-{
-#ifdef __cplusplus
- list_apply(eclasses, (void (*)(void *)) doEclass);
-#else
-#ifdef __USE_PROTOS
- list_apply(eclasses, (void (*)(void *)) doEclass);
-#else
- list_apply(eclasses, doEclass);
-#endif
-#endif
-}
-
-void
-#ifdef __USE_PROTOS
-ComputeTokSets( void )
-#else
-ComputeTokSets( )
-#endif
-{
- ListNode *t, *e = NULL, *e1, *e2;
- int something_changed;
- int i;
- TCnode *p;
- TermEntry *q, *q1, *q2;
-
- if ( tclasses == NULL ) return;
-
- /* turn lists of token/tokclass references into sets */
- for (t = tclasses->next; t!=NULL; t=t->next)
- {
- p = (TCnode *) t->elem;
-
- /* if wild card, then won't have entries in tclass, assume all_tokens */
- if ( p->tok == WildCardToken )
- {
- p->tset = set_dup(all_tokens);
- continue;
- }
-
- lexmode(p->lexclass); /* switch to lexclass where tokclass is defined */
- p->tset = empty;
-
- /* instantiate all tokens/token_classes into the tset */
- for (e = (p->tlist)->next; e!=NULL; e=e->next)
- {
- char *tokstr;
- tokstr = (char *)e->elem;
- if ( *tokstr == '"' ) {
- q = (TermEntry *) hash_get(Texpr, tokstr);
- require(q!=NULL, "ComputeTokSets: no token def");
- set_orel(q->token, &p->tset);
- } else if (tokstr[0] == '.') {
- e1=e->next;
- e2=e1->next;
- e=e2;
- q1= (TermEntry *) hash_get(Tname, (char *)e1->elem);
- require(q1!=NULL, "ComputeTokSets: no token def");
- q2= (TermEntry *) hash_get(Tname, (char *)e2->elem);
- require(q2!=NULL, "ComputeTokSets: no token def");
-
- if (set_el(q1->token,imag_tokens)) {
-errNoFL(eMsg2("can't define #tokclass %s using #tokclass or #errclass %s",
- TokenString(p->tok),(char *)e1->elem) );
- }
- if (set_el(q2->token,imag_tokens)) {
-errNoFL(eMsg2("can't define #tokclass %s using #tokclass or #errclass %s",
- TokenString(p->tok),(char *)e2->elem) );
- }
- if (q1->token > q2->token) {
-errNoFL(eMsg3("for #tokclass %s %s..%s - first token number > second token number",
- TokenString(p->tok),(char *)e1->elem,(char *)e2->elem) );
- for (i=q2->token; i<=q1->token; i++) { set_orel(i, &p->tset); }
- } else {
- for (i=q1->token; i<=q2->token; i++) { set_orel(i, &p->tset); }
- }
- } else {
- q = (TermEntry *) hash_get(Tname, tokstr);
- require(q!=NULL, "ComputeTokSets: no token def");
- set_orel(q->token, &p->tset);
- }
- }
- }
-
- /* Go thru list of tokclasses again looking for tokclasses in sets */
-again:
- something_changed = 0;
- for (t = tclasses->next; t!=NULL; t=t->next)
- {
- set tcl;
- p = (TCnode *) t->elem;
- tcl = set_and(p->tset, tokclasses);
- if ( !set_nil(tcl) )
- {
- int tk;
- /* replace refs to tokclasses with the associated set of tokens */
- something_changed = 1;
- while ( !set_nil(tcl) )
- {
- tk = set_int(tcl); /* grab one of the tok class refs */
- set_rm(tk, tcl);
- if ( p->tok != tk ) /* tokclass ref to yourself? */
- {
- q = (TermEntry *) hash_get(Tname, TokenString(tk));
- require(q!=NULL, "#tokclass not in hash table");
- set_orin(&p->tset, q->tclass->tset);
- }
- set_rm(tk, p->tset); /* remove ref that we replaced */
- }
- }
- set_free(tcl);
- }
- if ( something_changed ) goto again;
-}
-
-void
-#ifdef __USE_PROTOS
-DumpRemainingTokSets(void)
-#else
-DumpRemainingTokSets()
-#endif
-{
- TCnode *p;
- ListNode *t;
-
- /* Go thru tclasses (for the last time) and dump the sets not dumped
- * during code gen; yes, this is a bogus way to do this, but ComputeTokSets()
- * can't dump the defs as the error file and tok file has not been created
- * yet etc...
- */
- if ( tclasses==NULL ) return;
- for (t = tclasses->next; t!=NULL; t=t->next)
- {
- unsigned e;
- p = (TCnode *) t->elem;
- if ( p->dumped ) continue;
- e = DefErrSet(&(p->tset), 0, TokenString(p->tok));
- p->dumped = 1;
- p->setnum = e;
- }
-}
-
-
-/* replace a subset of an error set with an error class name if a subset is found
- * repeat process until no replacements made
- */
-void
-#ifdef __USE_PROTOS
-SubstErrorClass( set *f )
-#else
-SubstErrorClass( f )
-set *f;
-#endif
-{
- int max, done = 0;
- ListNode *p;
- ECnode *ec, *maxclass = NULL;
- set a;
- require(f!=NULL, "SubstErrorClass: NULL eset");
-
- if ( eclasses == NULL ) return;
- while ( !done )
- {
- max = 0;
- maxclass = NULL;
- for (p=eclasses->next; p!=NULL; p=p->next) /* chk all error classes */
- {
- ec = (ECnode *) p->elem;
- if ( ec->setdeg > max )
- {
- if ( set_sub(ec->eset, *f) || set_equ(ec->eset, *f) )
- {maxclass = ec; max=ec->setdeg;}
- }
- }
- if ( maxclass != NULL ) /* if subset found, replace with token */
- {
- a = set_dif(*f, maxclass->eset);
- set_orel((unsigned)maxclass->tok, &a);
- set_free(*f);
- *f = a;
- }
- else done = 1;
- }
-}
-
-int
-#ifdef __USE_PROTOS
-DefErrSet1(int nilOK, set *f, int subst, char *name )
-#else
-DefErrSet1(nilOK, f, subst, name )
-int nilOK;
-set *f;
-int subst; /* should be substitute error classes? */
-char *name;
-#endif
-{
- if ( GenCC ) return DefErrSetForCC1(nilOK, f, subst, name, "_set");
- else return DefErrSetForC1(nilOK, f, subst, name, "_set");
-}
-
-int
-#ifdef __USE_PROTOS
-DefErrSet( set *f, int subst, char *name )
-#else
-DefErrSet( f, subst, name )
-set *f;
-int subst; /* should be substitute error classes? */
-char *name;
-#endif
-{
- return DefErrSet1(0,f,subst,name);
-}
-
-int
-#ifdef __USE_PROTOS
-DefErrSetWithSuffix(int nilOK, set *f, int subst, char *name, const char* suffix)
-#else
-DefErrSetWithSuffix(nilOK, f, subst, name, suffix )
-int nilOK;
-set *f;
-int subst; /* should be substitute error classes? */
-char *name;
-char *suffix;
-#endif
-{
- if ( GenCC ) return DefErrSetForCC1(nilOK, f, subst, name, suffix );
- else return DefErrSetForC1(nilOK, f, subst, name, suffix);
-}
-
-/* Define a new error set. WARNING...set-implementation dependent.
- */
-int
-#ifdef __USE_PROTOS
-DefErrSetForC1(int nilOK, set *f, int subst, char * name, const char * suffix)
-#else
-DefErrSetForC1(nilOK, f, subst, name, suffix)
-int nilOK; /* MR13 */
-set *f;
-int subst; /* should be substitute error classes? */
-char *name;
-const char *suffix;
-#endif
-{
- unsigned *p, *endp;
- int e=1;
-
- if (!nilOK) require(!set_nil(*f), "DefErrSetForC1: nil set to dump?");
-
- if ( subst ) SubstErrorClass(f);
- p = f->setword;
- endp = &(f->setword[f->n]);
- esetnum++;
- if ( name!=NULL )
- fprintf(DefFile, "extern SetWordType %s%s[];\n", name, suffix);
- else
- fprintf(DefFile, "extern SetWordType zzerr%d[];\n", esetnum);
- if ( name!=NULL ) {
- fprintf(ErrFile, "SetWordType %s%s[%d] = {",
- name,
- suffix,
- NumWords(TokenNum-1)*sizeof(unsigned));
- }
- else {
- fprintf(ErrFile, "SetWordType zzerr%d[%d] = {",
- esetnum,
- NumWords(TokenNum-1)*sizeof(unsigned));
- }
- while ( p < endp )
- {
- if ( e > 1 ) fprintf(ErrFile, ", ");
- DumpIntAsChars(ErrFile, "0x%x", *p++);
- if ( e == 3 )
- {
- DAWDLE;
- if ( p < endp ) fprintf(ErrFile, ",");
- fprintf(ErrFile, "\n\t");
- e=1;
- }
- else e++;
- }
- fprintf(ErrFile, "};\n");
-
- return esetnum;
-}
-
-int
-#ifdef __USE_PROTOS
-DefErrSetForC( set *f, int subst, char *name )
-#else
-DefErrSetForC( f, subst, name )
-set *f;
-int subst; /* should be substitute error classes? */
-char *name;
-#endif
-{
- return DefErrSetForC1(0,f,subst,name, "_set");
-}
-
-/* Define a new error set. WARNING...set-implementation dependent;
- * Only used when -CC on.
- */
-
-int
-#ifdef __USE_PROTOS
-DefErrSetForCC1(int nilOK, set *f, int subst, char *name, const char *suffix )
-#else
-DefErrSetForCC1(nilOK, f, subst, name, suffix )
-int nilOK; /* MR13 */
-set *f;
-int subst; /* should be substitute error classes? */
-char *name;
-const char *suffix;
-#endif
-{
- unsigned *p, *endp;
- int e=1;
-
- if (!nilOK) require(!set_nil(*f), "DefErrSetForCC1: nil set to dump?");
-
- if ( subst ) SubstErrorClass(f);
- p = f->setword;
- endp = &(f->setword[f->n]);
- esetnum++;
-
- if ( name!=NULL ) {
- fprintf(Parser_h, "\tstatic SetWordType %s%s[%d];\n", name, suffix,
- NumWords(TokenNum-1)*sizeof(unsigned));
- fprintf(Parser_c, "SetWordType %s::%s%s[%d] = {",
- CurrentClassName,
- name,
- suffix,
- NumWords(TokenNum-1)*sizeof(unsigned));
- }
- else {
- fprintf(Parser_c, "SetWordType %s::err%d[%d] = {",
- CurrentClassName,
- esetnum,
- NumWords(TokenNum-1)*sizeof(unsigned));
- fprintf(Parser_h, "\tstatic SetWordType err%d[%d];\n", esetnum,
- NumWords(TokenNum-1)*sizeof(unsigned));
- }
-
- while ( p < endp )
- {
- if ( e > 1 ) fprintf(Parser_c, ", ");
- DumpIntAsChars(Parser_c, "0x%x", *p++);
- if ( e == 3 )
- {
- if ( p < endp ) fprintf(Parser_c, ",");
- fprintf(Parser_c, "\n\t");
- e=1;
- }
- else e++;
- }
- fprintf(Parser_c, "};\n");
-
- return esetnum;
-}
-
-int
-#ifdef __USE_PROTOS
-DefErrSetForCC( set *f, int subst, char *name )
-#else
-DefErrSetForCC( f, subst, name )
-set *f;
-int subst; /* should be substitute error classes? */
-char *name;
-#endif
-{
- return DefErrSetForCC1(0,f,subst,name, "_set");
-}
-
-void
-#ifdef __USE_PROTOS
-GenParser_c_Hdr(void)
-#else
-GenParser_c_Hdr()
-#endif
-{
- int i,j;
- TermEntry *te;
- char * hasAkaName = NULL; /* MR23 */
-
- hasAkaName = (char *) malloc(TokenNum+1); /* MR23 */
- require(hasAkaName!=NULL, "Cannot alloc hasAkaName\n"); /* MR23 */
- for (i = 0; i < TokenNum; i++) hasAkaName[i]='0'; /* MR23 */
- hasAkaName[TokenNum] = 0; /* MR23 */
-
- fprintf(Parser_c, "/*\n");
- fprintf(Parser_c, " * %s: P a r s e r S u p p o r t\n", CurrentClassName);
- fprintf(Parser_c, " *\n");
- fprintf(Parser_c, " * Generated from:");
- for (i=0; i<NumFiles; i++) fprintf(Parser_c, " %s", FileStr[i]);
- fprintf(Parser_c, "\n");
- fprintf(Parser_c, " *\n");
- fprintf(Parser_c, " * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001\n");
- fprintf(Parser_c, " * Parr Research Corporation\n");
- fprintf(Parser_c, " * with Purdue University Electrical Engineering\n");
- fprintf(Parser_c, " * with AHPCRC, University of Minnesota\n");
- fprintf(Parser_c, " * ANTLR Version %s\n", Version);
- fprintf(Parser_c, " */\n\n");
-
- if ( FirstAction != NULL ) dumpAction(FirstAction,Parser_c, 0, -1, 0, 1); /* MR11 MR15b */
-
- fprintf(Parser_c, "#define ANTLR_VERSION %s\n", VersionDef);
-
- fprintf(Parser_c, "#include \"pcctscfg.h\"\n");
- fprintf(Parser_c, "#include \"pccts_stdio.h\"\n");
- fprintf(Parser_c, "#define ANTLR_SUPPORT_CODE\n");
- if ( UserTokenDefsFile != NULL )
- fprintf(Parser_c, "#include %s\n", UserTokenDefsFile);
- else
- fprintf(Parser_c, "#include \"%s\"\n", DefFileName);
-
- fprintf(Parser_c, "#include \"%s.h\"\n\n", CurrentClassName);
-
- fprintf(Parser_c, "const ANTLRChar *%s::tokenName(int tok) ", /* MR1 */
- CurrentClassName); /* MR1 */
- fprintf(Parser_c, " { return _token_tbl[tok]; }\n"); /* MR1 */ /* MR10 */
- /* Dump a Parser::tokens for each automaton */
- fprintf(Parser_c, "\nconst ANTLRChar *%s::_token_tbl[]={\n",
- CurrentClassName); /* MR20 */
- fprintf(Parser_c, "\t/* 00 */\t\"Invalid\"");
-
- for (i=1; i<TokenNum-1; i++)
- {
- DAWDLE;
- if ( i == EpToken ) continue;
- /* remapped to invalid token? */
- if ( TokenInd!=NULL && TokenInd[i]>=LastTokenCounted )
- {
- fprintf(Parser_c, ",\n\t/* %02d */\t\"invalid\"", i);
- continue;
- }
- if ( TokenString(i) != NULL ) {
- te=(TermEntry *) hash_get(Tname,TokenString(i)); /* MR11 */
- if (te == NULL || te->akaString == NULL) { /* MR11 */
- fprintf(Parser_c, ",\n\t/* %02d */\t\"%s\"", i, TokenString(i));
- } else {
- hasAkaName[i] = '1'; /* MR23 */
- fprintf(Parser_c, ",\n\t/* %02d */\t\"%s\"", i, te->akaString); /* MR11 */
- }
- }
- else
- {
- /* look in all lexclasses for the reg expr */
- for (j=0; j<NumLexClasses; j++)
- {
- lexmode(j);
- if ( ExprString(i) != NULL )
- {
- fprintf(Parser_c, ",\n\t/* %02d */\t", i);
- dumpExpr(Parser_c, ExprString(i));
- break;
- }
- }
- if ( j>=NumLexClasses )
- {
- if ( UserDefdTokens )
- {
- fprintf(Parser_c, ",\n\t/* %02d */\t\"\"", i);
- }
- else
- fatal_internal(eMsgd("No label or expr for token %d",i));
- }
- }
- }
- fprintf(Parser_c, "\n};\n");
-
- /* Build constructors */
- fprintf(Parser_c, "\n%s::", CurrentClassName);
- fprintf(Parser_c, "%s(ANTLRTokenBuffer *input) : %s(input,%d,%d,%d,%d)\n",
- CurrentClassName,
- (BaseClassName == NULL ? "ANTLRParser" : BaseClassName),
- OutputLL_k,
- FoundGuessBlk,
- DemandLookahead,
- NumWords(TokenNum-1)*sizeof(unsigned));
- fprintf(Parser_c, "{\n");
- fprintf(Parser_c, "\ttoken_tbl = _token_tbl;\n");
- if (TraceGen) {
- fprintf(Parser_c, "\ttraceOptionValueDefault=1;\t\t// MR10 turn trace ON\n");
- } else {
- fprintf(Parser_c, "\ttraceOptionValueDefault=0;\t\t// MR10 turn trace OFF\n");
- };
- fprintf(Parser_c, "}\n\n");
- free ( (void *) hasAkaName);
-}
-
-void
-#ifdef __USE_PROTOS
-GenParser_h_Hdr(void)
-#else
-GenParser_h_Hdr()
-#endif
-{
- int i;
-
- fprintf(Parser_h, "/*\n");
- fprintf(Parser_h, " * %s: P a r s e r H e a d e r \n", CurrentClassName);
- fprintf(Parser_h, " *\n");
- fprintf(Parser_h, " * Generated from:");
- for (i=0; i<NumFiles; i++) fprintf(Parser_h, " %s", FileStr[i]);
- fprintf(Parser_h, "\n");
- fprintf(Parser_h, " *\n");
- fprintf(Parser_h, " * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001\n");
- fprintf(Parser_h, " * Parr Research Corporation\n");
- fprintf(Parser_h, " * with Purdue University Electrical Engineering\n");
- fprintf(Parser_h, " * with AHPCRC, University of Minnesota\n");
- fprintf(Parser_h, " * ANTLR Version %s\n", Version);
- fprintf(Parser_h, " */\n\n");
-
- if ( FirstAction != NULL ) dumpAction( FirstAction, Parser_h, 0, -1, 0, 1); /* MR11 MR15b */
-
- fprintf(Parser_h, "#ifndef %s_h\n", CurrentClassName);
- fprintf(Parser_h, "#define %s_h\n\n", CurrentClassName);
-
- fprintf(Parser_h, "#ifndef ANTLR_VERSION\n");
- fprintf(Parser_h, "#define ANTLR_VERSION %s\n",VersionDef);
- fprintf(Parser_h, "#endif\n\n");
-
- if ( GenAST ) fprintf(Parser_h, "class ASTBase;\n");
- if (TraceGen) {
- fprintf(Parser_h,"#ifndef zzTRACE_RULES\n"); /* MR20 */
- fprintf(Parser_h,"#define zzTRACE_RULES\n"); /* MR20 */
- fprintf(Parser_h,"#endif\n"); /* MR22 */
- };
- fprintf(Parser_h, "#include \"%s\"\n\n", APARSER_H);
-
- if ( HdrAction != NULL ) dumpAction( HdrAction, Parser_h, 0, -1, 0, 1);
-
-/* MR10 */ if (ClassDeclStuff == NULL) {
-/* MR10 */ fprintf(Parser_h, "class %s : public ANTLRParser {\n", CurrentClassName);
-/* MR10 */ } else {
-/* MR10 */ fprintf(Parser_h, "class %s %s {\n",CurrentClassName,ClassDeclStuff);
-/* MR10 */ };
-
- fprintf(Parser_h, "public:\n"); /* MR1 */
- fprintf(Parser_h, "\tstatic const ANTLRChar *tokenName(int tk);\n");/* MR1 */
- fprintf(Parser_h, "\tenum { SET_SIZE = %i };\n",TokenNum-1); /* MR21 */
- fprintf(Parser_h, "protected:\n");
- fprintf(Parser_h, "\tstatic const ANTLRChar *_token_tbl[];\n"); /* MR20 */
- fprintf(Parser_h, "private:\n");
-}
-
-/* Currently, this is only used in !GenCC mode */
-void
-#ifdef __USE_PROTOS
-GenErrHdr( void )
-#else
-GenErrHdr( )
-#endif
-{
- int i, j;
- TermEntry *te;
-
- fprintf(ErrFile, "/*\n");
- fprintf(ErrFile, " * A n t l r S e t s / E r r o r F i l e H e a d e r\n");
- fprintf(ErrFile, " *\n");
- fprintf(ErrFile, " * Generated from:");
- for (i=0; i<NumFiles; i++) fprintf(ErrFile, " %s", FileStr[i]);
- fprintf(ErrFile, "\n");
- fprintf(ErrFile, " *\n");
- fprintf(ErrFile, " * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001\n");
- fprintf(ErrFile, " * Parr Research Corporation\n");
- fprintf(ErrFile, " * with Purdue University Electrical Engineering\n");
- fprintf(ErrFile, " * With AHPCRC, University of Minnesota\n");
- fprintf(ErrFile, " * ANTLR Version %s\n", Version);
- fprintf(ErrFile, " */\n\n");
-
- if ( FirstAction != NULL ) dumpAction( FirstAction, ErrFile, 0, -1, 0, 1); /* MR11 MR15b */
-
- fprintf(ErrFile, "#define ANTLR_VERSION %s\n", VersionDef);
-
- fprintf(ErrFile, "#include \"pcctscfg.h\"\n");
- fprintf(ErrFile, "#include \"pccts_stdio.h\"\n");
- if ( strcmp(ParserName, DefaultParserName)!=0 )
- fprintf(ErrFile, "#define %s %s\n", DefaultParserName, ParserName);
- if ( strcmp(ParserName, DefaultParserName)!=0 )
- fprintf(ErrFile, "#include \"%s\"\n", RemapFileName);
- if ( HdrAction != NULL ) dumpAction( HdrAction, ErrFile, 0, -1, 0, 1 );
- if ( FoundGuessBlk )
- {
- fprintf(ErrFile, "#define ZZCAN_GUESS\n");
- fprintf(ErrFile, "#include \"pccts_setjmp.h\"\n");
- }
- if (TraceGen) {
- fprintf(ErrFile,"#ifndef zzTRACE_RULES\n"); /* MR20 */
- fprintf(ErrFile,"#define zzTRACE_RULES\n"); /* MR20 */
- fprintf(ErrFile,"#endif\n"); /* MR22 */
- };
-
- if ( OutputLL_k > 1 ) fprintf(ErrFile, "#define LL_K %d\n", OutputLL_k);
-#ifdef DUM
- if ( LexGen ) fprintf(ErrFile, "#define zzEOF_TOKEN %d\n", (TokenInd!=NULL?TokenInd[EofToken]:EofToken));
-#endif
- fprintf(ErrFile, "#define zzSET_SIZE %d\n", NumWords(TokenNum-1)*sizeof(unsigned));
- if ( DemandLookahead ) fprintf(ErrFile, "#define DEMAND_LOOK\n");
- fprintf(ErrFile, "#include \"antlr.h\"\n");
- if ( GenAST ) fprintf(ErrFile, "#include \"ast.h\"\n");
-
- if ( UserDefdTokens ) fprintf(ErrFile, "#include %s\n", UserTokenDefsFile);
- /* still need this one as it has the func prototypes */
- fprintf(ErrFile, "#include \"%s\"\n", DefFileName);
- fprintf(ErrFile, "#include \"dlgdef.h\"\n");
- fprintf(ErrFile, "#include \"err.h\"\n\n");
-
- /* Dump a zztokens for each automaton */
- if ( strcmp(ParserName, DefaultParserName)!=0 )
- {
- fprintf(ErrFile, "ANTLRChar *%s_zztokens[%d]={\n", ParserName, TokenNum-1);
- }
- else
- {
- fprintf(ErrFile, "ANTLRChar *zztokens[%d]={\n", TokenNum-1);
- }
- fprintf(ErrFile, "\t/* 00 */\t\"Invalid\"");
- for (i=1; i<TokenNum-1; i++)
- {
- DAWDLE;
- if ( i == EpToken ) continue;
- /* remapped to invalid token? */
- if ( TokenInd!=NULL && TokenInd[i]>=LastTokenCounted )
- {
- fprintf(ErrFile, ",\n\t/* %02d */\t\"invalid\"", i);
- continue;
- }
- if ( TokenString(i) != NULL ) {
- te=(TermEntry *) hash_get(Tname,TokenString(i)); /* MR11 */
- if (te == NULL || te->akaString == NULL) { /* MR11 */
- fprintf(ErrFile, ",\n\t/* %02d */\t\"%s\"", i, TokenString(i));
- } else {
- fprintf(ErrFile, ",\n\t/* %02d */\t\"%s\"", i, te->akaString); /* MR11 */
- }
- }
- else
- {
- /* look in all lexclasses for the reg expr */
- for (j=0; j<NumLexClasses; j++)
- {
- lexmode(j);
- if ( ExprString(i) != NULL )
- {
- fprintf(ErrFile, ",\n\t/* %02d */\t", i);
- dumpExpr(ErrFile, ExprString(i));
- break;
- }
- }
- if ( j>=NumLexClasses )
- {
- if ( UserDefdTokens )
- {
- fprintf(ErrFile, ",\n\t/* %02d */\t\"\"", i);
- }
- else
- fatal_internal(eMsgd("No label or expr for token %d",i));
- }
- }
- }
- fprintf(ErrFile, "\n};\n");
-}
-
-void
-#ifdef __USE_PROTOS
-dumpExpr( FILE *f, char *e )
-#else
-dumpExpr( f, e )
-FILE *f;
-char *e;
-#endif
-{
- while ( *e!='\0' )
- {
- if ( *e=='\\' && *(e+1)=='\\' )
- {putc('\\', f); putc('\\', f); e+=2;}
- else if ( *e=='\\' && *(e+1)=='"' )
- {putc('\\', f); putc('"', f); e+=2;}
- else if ( *e=='\\' ) {putc('\\', f); putc('\\', f); e++;}
- else {putc(*e, f); e++;}
- }
-}
-
-int
-#ifdef __USE_PROTOS
-isTermEntryTokClass(TermEntry *te)
-#else
-isTermEntryTokClass(te)
-TermEntry *te;
-#endif
-{
- ListNode *t;
- TCnode *p;
- TermEntry *q;
- char *tokstr;
-
- if (tclasses == NULL) return 0;
-
- for (t = tclasses->next; t!=NULL; t=t->next)
- {
- p = (TCnode *) t->elem;
- tokstr = TokenString(p->tok);
- lexmode(p->lexclass); /* switch to lexclass where tokclass is defined */
- q = (TermEntry *) hash_get(Tname, tokstr);
- if (q == te) return 1;
- }
- return 0;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c
deleted file mode 100644
index 4eb3b02af1..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/build.c
+++ /dev/null
@@ -1,813 +0,0 @@
-/*
- * build.c -- functions associated with building syntax diagrams.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include "pcctscfg.h"
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#include "dlgdef.h"
-
-#define SetBlk(g, t, approx, first_set_symbol) { \
- ((Junction *)g.left)->jtype = t; \
- ((Junction *)g.left)->approx = approx; \
- ((Junction *)g.left)->pFirstSetSymbol = first_set_symbol; \
- ((Junction *)g.left)->end = (Junction *) g.right; \
- ((Junction *)g.right)->jtype = EndBlk;}
-
-/* Add the parameter string 'parm' to the parms field of a block-type junction
- * g.left points to the sentinel node on a block. i.e. g.left->p1 points to
- * the actual junction with its jtype == some block-type.
- */
-void
-#ifdef __USE_PROTOS
-addParm( Node *p, char *parm )
-#else
-addParm( p, parm )
-Node *p;
-char *parm;
-#endif
-{
- char *q = (char *) malloc( strlen(parm) + 1 );
- require(p!=NULL, "addParm: NULL object\n");
- require(q!=NULL, "addParm: unable to alloc parameter\n");
-
- strcpy(q, parm);
- if ( p->ntype == nRuleRef )
- {
- ((RuleRefNode *)p)->parms = q;
- }
- else if ( p->ntype == nJunction )
- {
- ((Junction *)p)->parm = q; /* only one parameter allowed on subrules */
- }
- else fatal_internal("addParm: invalid node for adding parm");
-}
-
-/*
- * Build an action node for the syntax diagram
- *
- * buildAction(ACTION) ::= --o-->ACTION-->o--
- *
- * Where o is a junction node.
- */
-Graph
-#ifdef __USE_PROTOS
-buildAction( char *action, int file, int line, int is_predicate )
-#else
-buildAction( action, file, line, is_predicate )
-char *action;
-int file;
-int line;
-int is_predicate;
-#endif
-{
- Junction *j1, *j2;
- Graph g;
- ActionNode *a;
- require(action!=NULL, "buildAction: invalid action");
-
- j1 = newJunction();
- j2 = newJunction();
- a = newActionNode();
- a->action = (char *) malloc( strlen(action)+1 );
- require(a->action!=NULL, "buildAction: cannot alloc space for action\n");
- strcpy(a->action, action);
- j1->p1 = (Node *) a;
- a->next = (Node *) j2;
- a->is_predicate = is_predicate;
-
- if (is_predicate) {
- PredEntry *predEntry;
- char *t;
- char *key;
- char *u;
- int inverted=0;
-
- t=key=(char *)calloc(1,strlen(a->action)+1);
-
- for (u=a->action; *u != '\0' ; u++) {
- if (*u != ' ') {
- if (t==key && *u=='!') {
- inverted=!inverted;
- } else {
- *t++=*u;
- };
- };
- };
-
- *t='\0';
-
-
- predEntry=(PredEntry *)hash_get(Pname,key);
- a->predEntry=predEntry;
- if (predEntry != NULL) a->inverted=inverted;
- } else {
-/* MR12c */ char *strStart=a->action;
-/* MR12c */ char *strEnd;
-/* MR12c */ strEnd=strStart+strlen(strStart)-1;
-/* MR12c */ for ( ; strEnd >= strStart && isspace(*strEnd); strEnd--) *strEnd=0;
-/* MR12c */ while (*strStart != '\0' && isspace(*strStart)) strStart++;
-/* MR12c */ if (ci_strequ(strStart,"nohoist")) {
-/* MR12c */ a->noHoist=1;
-/* MR12c */ }
- }
-
- g.left = (Node *) j1; g.right = (Node *) j2;
- a->file = file;
- a->line = line;
- a->rname = CurRule; /* MR10 */
- return g;
-}
-
-/*
- * Build a token node for the syntax diagram
- *
- * buildToken(TOKEN) ::= --o-->TOKEN-->o--
- *
- * Where o is a junction node.
- */
-Graph
-#ifdef __USE_PROTOS
-buildToken( char *text )
-#else
-buildToken( text )
-char *text;
-#endif
-{
- Junction *j1, *j2;
- Graph g;
- TokNode *t;
- require(text!=NULL, "buildToken: invalid token name");
-
- j1 = newJunction();
- j2 = newJunction();
- t = newTokNode();
- t->altstart = CurAltStart;
- if ( *text == '"' ) {t->label=FALSE; t->token = addTexpr( text );}
- else {t->label=TRUE; t->token = addTname( text );}
- j1->p1 = (Node *) t;
- t->next = (Node *) j2;
- g.left = (Node *) j1; g.right = (Node *) j2;
- return g;
-}
-
-/*
- * Build a wild-card node for the syntax diagram
- *
- * buildToken(TOKEN) ::= --o-->'.'-->o--
- *
- * Where o is a junction node.
- */
-Graph
-#ifdef __USE_PROTOS
-buildWildCard( char *text )
-#else
-buildWildCard( text )
-char *text;
-#endif
-{
- Junction *j1, *j2;
- Graph g;
- TokNode *t;
- TCnode *w;
- TermEntry *p;
- require(text!=NULL, "buildWildCard: invalid token name");
-
- j1 = newJunction();
- j2 = newJunction();
- t = newTokNode();
-
- /* If the ref a wild card, make a token class for it */
- if ( Tnum(WildCardString) == 0 )
- {
- w = newTCnode;
- w->tok = addTname( WildCardString );
- set_orel(w->tok, &imag_tokens);
- set_orel(w->tok, &tokclasses);
- WildCardToken = w->tok;
- require((p=(TermEntry *)hash_get(Tname, WildCardString)) != NULL,
- "hash table mechanism is broken");
- p->classname = 1; /* entry is class name, not token */
- p->tclass = w; /* save ptr to this tclass def */
- list_add(&tclasses, (char *)w);
- }
- else {
- p=(TermEntry *)hash_get(Tname, WildCardString);
- require( p!= NULL, "hash table mechanism is broken");
- w = p->tclass;
- }
-
- t->token = w->tok;
- t->wild_card = 1;
- t->tclass = w;
-
- t->altstart = CurAltStart;
- j1->p1 = (Node *) t;
- t->next = (Node *) j2;
- g.left = (Node *) j1; g.right = (Node *) j2;
- return g;
-}
-
-void
-#ifdef __USE_PROTOS
-setUpperRange(TokNode *t, char *text)
-#else
-setUpperRange(t, text)
-TokNode *t;
-char *text;
-#endif
-{
- require(t!=NULL, "setUpperRange: NULL token node");
- require(text!=NULL, "setUpperRange: NULL token string");
-
- if ( *text == '"' ) {t->upper_range = addTexpr( text );}
- else {t->upper_range = addTname( text );}
-}
-
-/*
- * Build a rule reference node of the syntax diagram
- *
- * buildRuleRef(RULE) ::= --o-->RULE-->o--
- *
- * Where o is a junction node.
- *
- * If rule 'text' has been defined already, don't alloc new space to store string.
- * Set r->text to point to old copy in string table.
- */
-Graph
-#ifdef __USE_PROTOS
-buildRuleRef( char *text )
-#else
-buildRuleRef( text )
-char *text;
-#endif
-{
- Junction *j1, *j2;
- Graph g;
- RuleRefNode *r;
- RuleEntry *p;
- require(text!=NULL, "buildRuleRef: invalid rule name");
-
- j1 = newJunction();
- j2 = newJunction();
- r = newRNode();
- r->altstart = CurAltStart;
- r->assign = NULL;
- if ( (p=(RuleEntry *)hash_get(Rname, text)) != NULL ) r->text = p->str;
- else r->text = mystrdup( text );
- j1->p1 = (Node *) r;
- r->next = (Node *) j2;
- g.left = (Node *) j1; g.right = (Node *) j2;
- return g;
-}
-
-/*
- * Or two subgraphs into one graph via:
- *
- * Or(G1, G2) ::= --o-G1-o--
- * | ^
- * v |
- * o-G2-o
- *
- * Set the altnum of junction starting G2 to 1 + altnum of junction starting G1.
- * If, however, the G1 altnum is 0, make it 1 and then
- * make G2 altnum = G1 altnum + 1.
- */
-Graph
-#ifdef __USE_PROTOS
-Or( Graph g1, Graph g2 )
-#else
-Or( g1, g2 )
-Graph g1;
-Graph g2;
-#endif
-{
- Graph g;
- require(g1.left != NULL, "Or: invalid graph");
- require(g2.left != NULL && g2.right != NULL, "Or: invalid graph");
-
- ((Junction *)g1.left)->p2 = g2.left;
- ((Junction *)g2.right)->p1 = g1.right;
- /* set altnums */
- if ( ((Junction *)g1.left)->altnum == 0 ) ((Junction *)g1.left)->altnum = 1;
- ((Junction *)g2.left)->altnum = ((Junction *)g1.left)->altnum + 1;
- g.left = g2.left;
- g.right = g1.right;
- return g;
-}
-
-/*
- * Catenate two subgraphs
- *
- * Cat(G1, G2) ::= --o-G1-o-->o-G2-o--
- * Cat(NULL,G2)::= --o-G2-o--
- * Cat(G1,NULL)::= --o-G1-o--
- */
-Graph
-#ifdef __USE_PROTOS
-Cat( Graph g1, Graph g2 )
-#else
-Cat( g1, g2 )
-Graph g1;
-Graph g2;
-#endif
-{
- Graph g;
-
- if ( g1.left == NULL && g1.right == NULL ) return g2;
- if ( g2.left == NULL && g2.right == NULL ) return g1;
- ((Junction *)g1.right)->p1 = g2.left;
- g.left = g1.left;
- g.right = g2.right;
- return g;
-}
-
-/*
- * Make a subgraph an optional block
- *
- * makeOpt(G) ::= --o-->o-G-o-->o--
- * | ^
- * v |
- * o-------o
- *
- * Note that this constructs {A|B|...|Z} as if (A|B|...|Z|) was found.
- *
- * The node on the far right is added so that every block owns its own
- * EndBlk node.
- */
-Graph
-#ifdef __USE_PROTOS
-makeOpt( Graph g1, int approx, char * pFirstSetSymbol )
-#else
-makeOpt( g1, approx, pFirstSetSymbol )
-Graph g1;
-int approx;
-char * pFirstSetSymbol;
-#endif
-{
- Junction *j1,*j2,*p;
- Graph g;
- require(g1.left != NULL && g1.right != NULL, "makeOpt: invalid graph");
-
- j1 = newJunction();
- j2 = newJunction();
- ((Junction *)g1.right)->p1 = (Node *) j2; /* add node to G at end */
-
- /* MR21
- *
- * There is code in genBlk which recognizes the node created
- * by emptyAlt() as a special case and bypasses it. We don't
- * want this to happen for the optBlk.
- */
-
- g = emptyAlt3(); /* MR21 */
- if ( ((Junction *)g1.left)->altnum == 0 ) ((Junction *)g1.left)->altnum = 1;
- ((Junction *)g.left)->altnum = ((Junction *)g1.left)->altnum + 1;
- for(p=(Junction *)g1.left; p->p2!=NULL; p=(Junction *)p->p2)
- {;} /* find last alt */
- p->p2 = g.left; /* add optional alternative */
- ((Junction *)g.right)->p1 = (Node *)j2; /* opt alt points to EndBlk */
- g1.right = (Node *)j2;
- SetBlk(g1, aOptBlk, approx, pFirstSetSymbol);
- j1->p1 = g1.left; /* add generic node in front */
- g.left = (Node *) j1;
- g.right = g1.right;
- return g;
-}
-
-/*
- * Make a graph into subblock
- *
- * makeBlk(G) ::= --o-->o-G-o-->o--
- *
- * The node on the far right is added so that every block owns its own
- * EndBlk node.
- */
-Graph
-#ifdef __USE_PROTOS
-makeBlk( Graph g1, int approx, char * pFirstSetSymbol )
-#else
-makeBlk( g1, approx, pFirstSetSymbol )
-Graph g1;
-int approx;
-char * pFirstSetSymbol;
-#endif
-{
- Junction *j,*j2;
- Graph g;
- require(g1.left != NULL && g1.right != NULL, "makeBlk: invalid graph");
-
- j = newJunction();
- j2 = newJunction();
- ((Junction *)g1.right)->p1 = (Node *) j2; /* add node to G at end */
- g1.right = (Node *)j2;
- SetBlk(g1, aSubBlk, approx, pFirstSetSymbol);
- j->p1 = g1.left; /* add node in front */
- g.left = (Node *) j;
- g.right = g1.right;
-
- return g;
-}
-
-/*
- * Make a subgraph into a loop (closure) block -- (...)*
- *
- * makeLoop(G) ::= |---|
- * v |
- * --o-->o-->o-G-o-->o--
- * | ^
- * v |
- * o-----------o
- *
- * After making loop, always place generic node out front. It becomes
- * the start of enclosing block. The aLoopBlk is the target of the loop.
- *
- * Loop blks have TWO EndBlk nodes--the far right and the node that loops back
- * to the aLoopBlk node. Node with which we can branch past loop == aLoopBegin and
- * one which is loop target == aLoopBlk.
- * The branch-past (initial) aLoopBegin node has end
- * pointing to the last EndBlk node. The loop-target node has end==NULL.
- *
- * Loop blocks have a set of locks (from 1..CLL_k) on the aLoopBlk node.
- */
-Graph
-#ifdef __USE_PROTOS
-makeLoop( Graph g1, int approx, char * pFirstSetSymbol )
-#else
-makeLoop( g1, approx, pFirstSetSymbol)
-Graph g1;
-int approx;
-char * pFirstSetSymbol;
-#endif
-{
- Junction *back, *front, *begin;
- Graph g;
- require(g1.left != NULL && g1.right != NULL, "makeLoop: invalid graph");
-
- back = newJunction();
- front = newJunction();
- begin = newJunction();
- g = emptyAlt3();
- ((Junction *)g1.right)->p2 = g1.left; /* add loop branch to G */
- ((Junction *)g1.right)->p1 = (Node *) back; /* add node to G at end */
- ((Junction *)g1.right)->jtype = EndBlk; /* mark 1st EndBlk node */
- ((Junction *)g1.left)->jtype = aLoopBlk; /* mark 2nd aLoopBlk node */
- ((Junction *)g1.left)->end = (Junction *) g1.right;
- ((Junction *)g1.left)->lock = makelocks();
- ((Junction *)g1.left)->pred_lock = makelocks();
- g1.right = (Node *) back;
- begin->p1 = (Node *) g1.left;
- g1.left = (Node *) begin;
- begin->p2 = (Node *) g.left; /* make bypass arc */
- ((Junction *)g.right)->p1 = (Node *) back;
- SetBlk(g1, aLoopBegin, approx, pFirstSetSymbol);
- front->p1 = g1.left; /* add node to front */
- g1.left = (Node *) front;
-
- return g1;
-}
-
-/*
- * Make a subgraph into a plus block -- (...)+ -- 1 or more times
- *
- * makePlus(G) ::= |---|
- * v |
- * --o-->o-G-o-->o--
- *
- * After making loop, always place generic node out front. It becomes
- * the start of enclosing block. The aPlusBlk is the target of the loop.
- *
- * Plus blks have TWO EndBlk nodes--the far right and the node that loops back
- * to the aPlusBlk node.
- *
- * Plus blocks have a set of locks (from 1..CLL_k) on the aPlusBlk node.
- */
-Graph
-#ifdef __USE_PROTOS
-makePlus( Graph g1, int approx, char * pFirstSetSymbol)
-#else
-makePlus( g1, approx, pFirstSetSymbol)
-Graph g1;
-int approx;
-char * pFirstSetSymbol;
-#endif
-{
- int has_empty_alt_already = 0;
- Graph g;
- Junction *j2, *j3, *first_alt;
- Junction *last_alt=NULL, *p;
- require(g1.left != NULL && g1.right != NULL, "makePlus: invalid graph");
-
- first_alt = (Junction *)g1.left;
- j2 = newJunction();
- j3 = newJunction();
- if ( ((Junction *)g1.left)->altnum == 0 ) ((Junction *)g1.left)->altnum = 1;
- ((Junction *)g1.right)->p2 = g1.left; /* add loop branch to G */
- ((Junction *)g1.right)->p1 = (Node *) j2; /* add node to G at end */
- ((Junction *)g1.right)->jtype = EndBlk; /* mark 1st EndBlk node */
- g1.right = (Node *) j2;
- SetBlk(g1, aPlusBlk, approx, pFirstSetSymbol);
- ((Junction *)g1.left)->lock = makelocks();
- ((Junction *)g1.left)->pred_lock = makelocks();
- j3->p1 = g1.left; /* add node to front */
- g1.left = (Node *) j3;
-
- /* add an optional branch which is the "exit" branch of loop */
- /* FIRST, check to ensure that there does not already exist
- * an optional path.
- */
- /* find last alt */
- for(p=first_alt; p!=NULL; p=(Junction *)p->p2)
- {
- if ( p->p1->ntype == nJunction &&
- p->p1!=NULL &&
- ((Junction *)p->p1)->jtype==Generic &&
- ((Junction *)p->p1)->p1!=NULL &&
- ((Junction *)((Junction *)p->p1)->p1)->jtype==EndBlk )
- {
- has_empty_alt_already = 1;
- }
- last_alt = p;
- }
- if ( !has_empty_alt_already )
- {
- require(last_alt!=NULL, "last_alt==NULL; bad (..)+");
- g = emptyAlt();
- last_alt->p2 = g.left;
- ((Junction *)g.right)->p1 = (Node *) j2;
-
- /* make sure lookahead computation ignores this alt for
- * FIRST("(..)+"); but it's still used for computing the FIRST
- * of each alternative.
- */
- ((Junction *)g.left)->ignore = 1;
- }
-
- return g1;
-}
-
-/*
- * Return an optional path: --o-->o--
- */
-
-Graph
-#ifdef __USE_PROTOS
-emptyAlt( void )
-#else
-emptyAlt( )
-#endif
-{
- Junction *j1, *j2;
- Graph g;
-
- j1 = newJunction();
- j2 = newJunction();
- j1->p1 = (Node *) j2;
- g.left = (Node *) j1;
- g.right = (Node *) j2;
-
- return g;
-}
-
-/* MR21
- *
- * There is code in genBlk which recognizes the node created
- * by emptyAlt() as a special case and bypasses it. We don't
- * want this to happen for the optBlk.
- */
-
-Graph
-#ifdef __USE_PROTOS
-emptyAlt3( void )
-#else
-emptyAlt3( )
-#endif
-{
- Junction *j1, *j2, *j3;
- Graph g;
-
- j1 = newJunction();
- j2 = newJunction();
- j3 = newJunction();
- j1->p1 = (Node *) j2;
- j2->p1 = (Node *) j3;
- g.left = (Node *) j1;
- g.right = (Node *) j3;
-
- return g;
-}
-
-/* N o d e A l l o c a t i o n */
-
-TokNode *
-#ifdef __USE_PROTOS
-newTokNode( void )
-#else
-newTokNode( )
-#endif
-{
- static TokNode *FreeList = NULL;
- TokNode *p, *newblk;
-
- if ( FreeList == NULL )
- {
- newblk = (TokNode *)calloc(TokenBlockAllocSize, sizeof(TokNode));
- if ( newblk == NULL )
- fatal_internal(eMsg1("out of memory while building rule '%s'",CurRule));
- for (p=newblk; p<&(newblk[TokenBlockAllocSize]); p++)
- {
- p->next = (Node *)FreeList; /* add all new token nodes to FreeList */
- FreeList = p;
- }
- }
- p = FreeList;
- FreeList = (TokNode *)FreeList->next;/* remove a TokNode node */
- p->next = NULL; /* NULL the ptr we used */
- memset( (char *) p, 0, sizeof(TokNode)); /* MR10 */
- p->ntype = nToken;
- p->rname = CurRule;
- p->file = CurFile;
- p->line = zzline;
- p->altstart = NULL;
-
- return p;
-}
-
-RuleRefNode *
-#ifdef __USE_PROTOS
-newRNode( void )
-#else
-newRNode( )
-#endif
-{
- static RuleRefNode *FreeList = NULL;
- RuleRefNode *p, *newblk;
-
- if ( FreeList == NULL )
- {
- newblk = (RuleRefNode *)calloc(RRefBlockAllocSize, sizeof(RuleRefNode));
- if ( newblk == NULL )
- fatal_internal(eMsg1("out of memory while building rule '%s'",CurRule));
- for (p=newblk; p<&(newblk[RRefBlockAllocSize]); p++)
- {
- p->next = (Node *)FreeList; /* add all new rref nodes to FreeList */
- FreeList = p;
- }
- }
- p = FreeList;
- FreeList = (RuleRefNode *)FreeList->next;/* remove a Junction node */
- p->next = NULL; /* NULL the ptr we used */
- memset( (char *) p, 0, sizeof(RuleRefNode)); /* MR10 */
- p->ntype = nRuleRef;
- p->rname = CurRule;
- p->file = CurFile;
- p->line = zzline;
- p->astnode = ASTinclude;
- p->altstart = NULL;
-
- return p;
-}
-
-static int junctionSeqNumber=0; /* MR10 */
-
-Junction *
-#ifdef __USE_PROTOS
-newJunction( void )
-#else
-newJunction( )
-#endif
-{
- static Junction *FreeList = NULL;
- Junction *p, *newblk;
-
- if ( FreeList == NULL )
- {
- newblk = (Junction *)calloc(JunctionBlockAllocSize, sizeof(Junction));
- if ( newblk == NULL )
- fatal_internal(eMsg1("out of memory while building rule '%s'",CurRule));
- for (p=newblk; p<&(newblk[JunctionBlockAllocSize]); p++)
- {
- p->p1 = (Node *)FreeList; /* add all new Junction nodes to FreeList */
- FreeList = p;
- }
- }
- p = FreeList;
- FreeList = (Junction *)FreeList->p1;/* remove a Junction node */
- p->p1 = NULL; /* NULL the ptr we used */
- memset( (char *) p, 0, sizeof(Junction)); /* MR10 */
- p->ntype = nJunction;
- p->visited = 0;
- p->jtype = Generic;
- p->rname = CurRule;
- p->file = CurFile;
- p->line = zzline;
- p->exception_label = NULL;
- p->fset = (set *) calloc(CLL_k+1, sizeof(set));
- require(p->fset!=NULL, "cannot allocate fset in newJunction");
- p->seq=++junctionSeqNumber; /* MR10 */
-
- return p;
-}
-
-ActionNode *
-#ifdef __USE_PROTOS
-newActionNode( void )
-#else
-newActionNode( )
-#endif
-{
- static ActionNode *FreeList = NULL;
- ActionNode *p, *newblk;
-
- if ( FreeList == NULL )
- {
- newblk = (ActionNode *)calloc(ActionBlockAllocSize, sizeof(ActionNode));
- if ( newblk == NULL )
- fatal_internal(eMsg1("out of memory while building rule '%s'",CurRule));
- for (p=newblk; p<&(newblk[ActionBlockAllocSize]); p++)
- {
- p->next = (Node *)FreeList; /* add all new Action nodes to FreeList */
- FreeList = p;
- }
- }
- p = FreeList;
- FreeList = (ActionNode *)FreeList->next;/* remove an Action node */
- memset( (char *) p, 0, sizeof(ActionNode)); /* MR10 */
- p->ntype = nAction;
- p->next = NULL; /* NULL the ptr we used */
- p->done = 0;
- p->pred_fail = NULL;
- p->guardpred = NULL;
- p->ampersandPred = NULL;
- return p;
-}
-
-/*
- * allocate the array of locks (1..CLL_k) used to inhibit infinite recursion.
- * Infinite recursion can occur in (..)* blocks, FIRST calcs and FOLLOW calcs.
- * Therefore, we need locks on aLoopBlk, RuleBlk, EndRule nodes.
- *
- * if ( lock[k]==TRUE ) then we have been here before looking for k tokens
- * of lookahead.
- */
-char *
-#ifdef __USE_PROTOS
-makelocks( void )
-#else
-makelocks( )
-#endif
-{
- char *p = (char *) calloc(CLL_k+1, sizeof(char));
- require(p!=NULL, "cannot allocate lock array");
-
- return p;
-}
-
-#if 0
-** #ifdef __USE_PROTOS
-** void my_memset(char *p,char value,int count)
-** #else
-** void my_memset(p,value,count)
-** char *p;
-** char value;
-** int count;
-** #endif
-** {
-** int i;
-**
-** for (i=0; i<count; i++) {
-** p[i]=value;
-** };
-** }
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c
deleted file mode 100644
index 8156159f71..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpcycles.c
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <stdio.h>
-#include <ctype.h>
-
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-
-void
-#ifdef __USE_PROTOS
-dumpcycles(void)
-#else
-dumpcycles()
-#endif
-{
- Cycle *c;
- CacheEntry *f;
- ListNode *p;
- int i=0;
- int k;
- int degree;
-
- for (k=1; k <= CLL_k; k++) {
- if (Cycles[k] == NULL) continue;
-
- for (p = Cycles[k]->next; p!=NULL; p=p->next) {
- c = (Cycle *) p->elem;
- degree=set_deg(c->cyclicDep);
- fprintf(stderr,"Cycle %d: (degree %d) %s -->\n", i++, degree, RulePtr[c->croot]->rname);
- fprintf(stderr," *self*\n");
- MR_dumpRuleSet(c->cyclicDep);
- fprintf(stderr,"\n");
- f = (CacheEntry *)
- hash_get(Fcache,Fkey(RulePtr[c->croot]->rname,'o',k));
- if (f == NULL) {
- fprintf(stderr," *** FOLLOW(%s) must be in cache but isn't ***\n",
- RulePtr[c->croot]->rname);
- };
- };
- };
-}
-
-void
-#ifdef __USE_PROTOS
-dumpfostack(int k)
-#else
-dumpfostack(k)
-int k;
-#endif
-{
- int i=0;
- int *pi;
-
- fprintf(stderr,"\n");
- if (FoStack[k] == NULL) {
- fprintf(stderr,"FoStack[%d] is null\n",k);
- };
- if (FoTOS[k] == NULL) {
- fprintf(stderr,"FoTOS[%d] is null\n",k);
- }
- if (FoTOS[k] != NULL && FoStack[k] != NULL) {
- for (pi=FoStack[k]; pi <= FoTOS[k]; pi++) {
- i++;
- fprintf(stderr,"#%d rule %d %s\n",i,*pi,RulePtr[*pi]->rname);
- }
- }
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpnode.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpnode.c
deleted file mode 100644
index 2a34c6fcd5..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/dumpnode.c
+++ /dev/null
@@ -1,423 +0,0 @@
-#include <stdio.h>
-#include <ctype.h>
-
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-
-#ifdef __USE_PROTOS
-void dumpset1(set s)
-#else
-void dumpset1(s)
- set s;
-#endif
-{
- if (set_nil(s)) {
- fprintf(stderr,"{}");
- } else {
- s_fprT(stderr,s);
- };
-}
-
-#ifdef __USE_PROTOS
-void dumpset(set s)
-#else
-void dumpset(s)
- set s;
-#endif
-{
- dumpset1(s);
- fprintf(stderr,"\n");
-}
-
-#ifdef __USE_PROTOS
-int isEndRule(Node * p)
-#else
-int isEndRule(p)
- Node * p;
-#endif
-{
- int result=0;
- if ( p->ntype == nJunction &&
- ( (Junction *) p)->jtype == EndRule) {
- result=1;
- };
- return result;
-}
-
-#ifdef __USE_PROTOS
-void dumppred1(int depth,Predicate *p)
-#else
-void dumppred1(depth,p)
- int depth;
- Predicate *p;
-#endif
-{
- int i;
- int k;
-
- for (i=0; i<depth ; i++) {
- fprintf(stderr," ");
- };
- if (p->expr == PRED_AND_LIST ||
- p->expr == PRED_OR_LIST) {
- fprintf(stderr," %s", (p->expr == NULL ? "null expr" : p->expr));
- if (p->inverted) fprintf(stderr," predicate inverted !");
- if (p->redundant) {
- fprintf(stderr," Redundant!");
- };
- if (p->isConst) fprintf(stderr," const %d !",p->constValue);
- fprintf(stderr,"\n");
- } else {
- fprintf(stderr,"predicate k=%d",p->k);
- k=set_int(p->completionSet);
- if (k >= 0) {
- fprintf(stderr," Incomplete Set=%d !",k);
- };
- k=set_int(p->completionTree);
- if (k >= 0) {
- fprintf(stderr," Incomplete Tree=%d !",k);
- };
- if (p->redundant) {
- fprintf(stderr," Redundant!");
- };
- fprintf(stderr," \"%s\" (%x)", (p->expr == NULL ? "null expr" : p->expr) ,p);
- if (p->source != NULL) {
- fprintf(stderr,"line %d",p->source->line);
- };
- if (p->inverted) fprintf(stderr," predicate inverted !");
- fprintf(stderr,"\n");
- for (i=0; i<depth ; i++) {
- fprintf(stderr," ");
- };
- fprintf(stderr,"scontext: ");
- dumpset(p->scontext[1]);
- for (i=0; i<depth ; i++) {
- fprintf(stderr," ");
- };
- fprintf(stderr,"tcontext: ");
- preorder(p->tcontext);
- fprintf(stderr,"\n");
- };
- fprintf(stderr,"\n");
- if (p->down != NULL) {
- dumppred1(depth+1,p->down);
- };
- if (p->right != NULL) {
- dumppred1(depth,p->right);
- };
-}
-
-#ifdef __USE_PROTOS
-void dumppred(Predicate *p)
-#else
-void dumppred(p)
- Predicate *p;
-#endif
-{
- fprintf(stderr,"---------------------------------\n");
- dumppred1(0,p);
- fprintf(stderr,"\n");
-}
-
-#ifdef __USE_PROTOS
-void dumppredtree(Predicate *p)
-#else
-void dumppredtree(p)
- Predicate *p;
-#endif
-{
- fprintf(stderr,"predicate k=%d \"%s\" line %d\n",p->k,p->expr,p->source->line);
- dumpset(p->scontext[1]);
-}
-
-#ifdef __USE_PROTOS
-void dumppredexpr(Predicate *p)
-#else
-void dumppredexpr(p)
- Predicate *p;
-#endif
-{
- fprintf(stderr," pred expr \"%s\"\n",p->expr);
-}
-
-#ifdef __USE_PROTOS
-void dt(Tree *t)
-#else
-void dt(t)
- Tree *t;
-#endif
-{
- MR_dumpTreeF(stderr,0,t,5);
-}
-
-#ifdef __USE_PROTOS
-void d(Node * p)
-#else
-void d(p)
- Node * p;
-#endif
-{
-
- Junction *j;
- RuleRefNode *r;
- TokNode *t;
- ActionNode *a;
-
- if (p==NULL) {
- fprintf(stderr,"dumpNode: Node is NULL");
- return;
- };
-
- switch (p->ntype) {
- case nJunction :
- j = (Junction *) p;
- fprintf(stderr, "Junction (#%d in rule %s line %d) ",j->seq,j->rname,j->line);
- if (j->guess) fprintf(stderr,"guess block ");
- switch (j->jtype ) {
- case aSubBlk :
- fprintf(stderr,"aSubBlk");
- break;
- case aOptBlk :
- fprintf(stderr,"aOptBlk");
- break;
- case aLoopBegin :
- fprintf(stderr,"aLoopBeginBlk");
- break;
- case aLoopBlk :
- fprintf(stderr,"aLoopBlk");
- break;
- case aPlusBlk :
- fprintf(stderr,"aPlusBlk");
- break;
- case EndBlk :
- fprintf(stderr,"EndBlk");
- break;
- case RuleBlk :
- fprintf(stderr,"RuleBlk");
- break;
- case Generic :
- fprintf(stderr,"Generic");
- break;
- case EndRule :
- fprintf(stderr,"EndRule");
- break;
- };
- if (j->halt) fprintf(stderr," halt!");
- if (j->p1) fprintf(stderr," p1 valid");
- if (j->p2) {
- if (j->p2->ntype == nJunction) {
- fprintf(stderr," (p2=#%d)",( (Junction *) j->p2)->seq);
- } else {
- fprintf(stderr," (p2 valid)");
- };
- };
- if (j->ignore) fprintf(stderr, " ignore/plus-block-bypass");
- if (j->fset != NULL && set_deg(*j->fset) != 0) {
- fprintf(stderr,"\nfset:\n");
- dumpset(*j->fset);
- };
- if (j->ftree != NULL) {
- fprintf(stderr,"\nftree:\n");
- preorder(j->ftree);
- };
- fprintf(stderr,"\n");
- break;
- case nRuleRef :
- r = (RuleRefNode *) p;
- fprintf(stderr, "RuleRefNode (in rule %s line %d) to rule %s\n", r->rname,r->line,r->text);
- break;
- case nToken :
- t = (TokNode *) p;
- fprintf(stderr, "TokNode (in rule %s line %d) token %s\n",t->rname,t->line,TerminalString(t->token));
- break;
- case nAction :
- a =(ActionNode *) p;
- if (a->is_predicate) {
- fprintf(stderr, "Predicate (in rule %s line %d) %s",a->rname,a->line,a->action);
- if (a->inverted) fprintf(stderr," action inverted !");
- if (a->guardpred != NULL) {
- fprintf(stderr," guarded");
- dumppredexpr(a->guardpred);
- if (a->ampersandPred) {
- fprintf(stderr," \"&&\" style");
- } else {
- fprintf(stderr," \"=>\" style");
- };
- };
- if (a->predEntry != NULL) fprintf(stderr," predEntry \"%s\" ",a->predEntry->str);
- fprintf(stderr,"\n");
- } else if (a->init_action) {
- fprintf(stderr, "Init-Action (in rule %s line %d) %s\n",a->rname,a->line,a->action);
- } else {
- fprintf(stderr, "Action (in rule %s line %d) %s\n",a->rname,a->line,a->action);
- };
- break;
- };
-}
-
-#ifdef __USE_PROTOS
-Node * dp1(Node * p)
-#else
-Node * dp1(p)
- Node * p;
-#endif
-{
- Node *result=NULL;
-
- if (p->ntype == nJunction) {
- result=( (Junction *) p )->p1;
- d(result);
- } else {
- fprintf(stderr,"dp1: Not a Junction node");
- };
- return result;
-}
-
-#ifdef __USE_PROTOS
-Node * dp2(Node * p)
-#else
-Node * dp2(p)
- Node * p;
-#endif
-{
- Node *result=NULL;
-
- if (p->ntype == nJunction) {
- result=( (Junction *) p )->p2;
- d(result);
- } else {
- fprintf(stderr,"dp2: Not a Junction node");
- };
- return result;
-}
-
-#ifdef __USE_PROTOS
-Node * dn(Node * p)
-#else
-Node * dn(p)
- Node * p;
-#endif
-
-{
- Node *result=NULL;
-
- if (p->ntype == nRuleRef) {
- result=( (RuleRefNode *)p )->next;
- } else if (p->ntype == nAction) {
- result=( (ActionNode *)p )->next;
- } else if (p->ntype == nToken) {
- result=( (TokNode *)p )->next;
- } else {
- fprintf(stderr,"No next field: Neither a RuleRefNode, ActionNode, nor TokNode");
- };
- if (result != NULL) d(result);
- return result;
-}
-
-#ifdef __USE_PROTOS
-void df(Node * p)
-#else
-void df(p)
- Node * p;
-#endif
-{
- int count=0;
- Node *next;
-
- fprintf(stderr,"\n#%d ",++count);
- d(p);
-
- for (next=p; next != NULL && !isEndRule(next) ; ) {
- fprintf(stderr,"#%d ",++count);
- if (next->ntype == nJunction) {
- next=dp1(next);
- } else {
- next=dn(next);
- };
- };
-}
-
-#ifdef __USE_PROTOS
-Node * dfn(Node * p,int target)
-#else
-Node * dfn(p,target)
- Node * p;
- int target;
-#endif
-{
- Node *result=NULL;
- int count=0;
- Node *next;
-
- fprintf(stderr,"#%d ",++count);
- d(p);
-
- for (next=p; next != NULL && !isEndRule(next) ; ) {
- fprintf(stderr,"#%d ",++count);
- if (next->ntype == nJunction) {
- next=dp1(next);
- } else {
- next=dn(next);
- };
- if (count == target) {
- result=next;
- break;
- };
- };
- return result;
-}
-
-
-static int findnodeMatch;
-
-#ifdef __USE_PROTOS
-Junction *findnode1(Node *n)
-#else
-Junction *findnode1(n)
- Node *n;
-#endif
-{
- Node *next;
- Junction *j;
- Junction *match;
-
- if (n == NULL) return NULL;
- if (n->ntype == nJunction) {
- j=(Junction *) n;
- if (j->seq == findnodeMatch) return j;
- if (j->jtype == EndRule) return NULL;
- if (j->jtype != RuleBlk && j->jtype != EndBlk) {
- if (j->p2 != NULL && !j->ignore) {
- match=findnode1(j->p2);
- if (match != NULL) return match;
- };
- };
- };
- next=MR_advance(n);
- return findnode1(next);
-}
-
-#ifdef __USE_PROTOS
-Junction *findnode(int match)
-#else
-Junction *findnode(match)
- int match;
-#endif
-{
- Junction *j;
- Junction *result=NULL;
-
- findnodeMatch=match;
-
- for (j=SynDiag; j != NULL; j=(Junction *)j->p2) {
- require (j->ntype == nJunction && j->jtype == RuleBlk,"Not a rule block");
- result=findnode1( (Node *) j);
- if (result != NULL) break;
- };
- if (result != NULL) {
- d( (Node *) result);
- };
- return result;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/egman.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/egman.c
deleted file mode 100644
index c8a633fc06..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/egman.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * egman.c
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33MR10
- * 2001
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#include "proto.h"
-
-static ExceptionGroup **egArray=NULL; /* ExceptionGroup by BlkLevel */
-static LabelEntry **leArray=NULL; /* LabelEntry by BlkLevel */
-static Junction **altArray=NULL; /* start of alternates */
-static int arraySize=0;
-static int highWater=0;
-static ExceptionGroup *lastEG=NULL; /* used in altFixup() */
-static int lastBlkLevel=0; /* used in altFixup() */
-
-#ifdef __USE_PROTOS
-static void arrayCheck(void);
-#else
-static void arrayCheck();
-#endif
-
-/* Called to add an exception group for an alternative EG */
-
-#ifdef __USE_PROTOS
-void egAdd(ExceptionGroup * eg)
-#else
-void egAdd(eg)
-ExceptionGroup *eg;
-#endif
-{
- int i;
-
- ExceptionGroup *nextEG;
- ExceptionGroup *innerEG;
-
- LabelEntry *nextLE;
- LabelEntry *innerLE;
-
- Junction *nextAlt;
- Junction *innerAlt;
-
- lastEG=eg;
- lastBlkLevel=BlkLevel;
-
- arrayCheck();
- eg->pendingLink=egArray[BlkLevel];
- egArray[BlkLevel]=eg;
-
- /* EG for alternates already have their altID filled in */
-
- for (i=BlkLevel+1; i<=highWater ; i++) {
- for (innerEG=egArray[i]; innerEG != NULL ; innerEG=nextEG) {
- nextEG=innerEG->pendingLink;
- innerEG->pendingLink=NULL;
- innerEG->outerEG=eg;
- };
- egArray[i]=NULL;
- };
-
- /*
- * for patching up the LabelEntry you might use an EG for the
- * current alternative - unlike patching up an alternative EG
- * i.e. start the loop at BlkLevel rather than (BlkLevel+1)
- * fill it in only if the EG and the LE are for the very
- * same alternative if they're at the same BlkLevel
- * it's easier to leave the LE on this list (filled in) rather than
- * trying to selectively remove it. It will eventually be
- * removed anyway when the BlkLevel gets small enough.
- */
-
- for (i=BlkLevel; i<=highWater ; i++) {
- for (innerLE=leArray[i]; innerLE != NULL ; innerLE=nextLE) {
- nextLE=innerLE->pendingLink;
- if (BlkLevel != i ||
- innerLE->curAltNum == CurAltNum_array[BlkLevel]) {
- if (innerLE->outerEG == NULL) {
- innerLE->outerEG=eg;
- };
- };
- };
- if (BlkLevel != i) leArray[i]=NULL;
- };
-
-/*
- * For the start of alternatives it is necessary to make a
- * distinction between the exception group for the current
- * alternative and the "fallback" EG for the block which
- * contains the alternative
- *
- * The fallback outerEG is used to handle the case where
- * no alternative of a block matches. In that case the
- * signal is "NoViableAlt" (or "NoSemViableAlt" and the
- * generator needs the EG of the block CONTAINING the
- * current one.
- *
- * rule: ( ( ( a
- * | b
- * )
- * | c
- * )
- * | d
- * );
- */
-
- for (i=BlkLevel; i <= highWater ; i++) {
- for (innerAlt=altArray[i]; innerAlt != NULL ; innerAlt=nextAlt) {
- nextAlt=innerAlt->pendingLink;
-
- /* first fill in the EG for the current alternative */
- /* but leave it on the list in order to get the fallback EG */
- /* if the EG is at the same LEVEL as the alternative then */
- /* fill it in only if in the very same alternative */
- /* */
- /* rule: ( a */
- /* | b */
- /* | c exception ... */
- /* ) */
- /* */
- /* if the EG is outside the alternative (e.g. BlkLevel < i) */
- /* then it doesn't matter about the alternative */
- /* */
- /* rule: ( a */
- /* | b */
- /* | c */
- /* ) exception ... */
- /* */
-
-#if 0
- printf("BlkLevel=%d i=%d altnum=%d CurAltNum=%d altID=%s\n",
- BlkLevel,i,innerAlt->curAltNum,CurAltNum_array[BlkLevel],eg->altID);
-#endif
- if (BlkLevel != i ||
- innerAlt->curAltNum == CurAltNum_array[BlkLevel]) {
- if (innerAlt->exception_label == NULL) {
- innerAlt->exception_label=eg->altID;
- };
- };
-
- /* ocurs at a later pass then for the exception_label */
- /* if an outerEG has been found then fill in the outer EG */
- /* remove if from the list when the BlkLevel gets smaller */
-
- if (BlkLevel != i) {
- if (innerAlt->outerEG == NULL) {
- innerAlt->outerEG=eg;
- };
- };
- };
- if (BlkLevel != i) altArray[i]=NULL;
- };
-}
-
-#ifdef __USE_PROTOS
-void leAdd(LabelEntry * le)
-#else
-void leAdd(le)
-LabelEntry *le;
-#endif
-
-{
- arrayCheck();
- le->pendingLink=leArray[BlkLevel];
- le->curAltNum=CurAltNum_array[BlkLevel];
- leArray[BlkLevel]=le;
-}
-
-#ifdef __USE_PROTOS
-void altAdd(Junction *alt)
-#else
-void altAdd(alt)
-Junction *alt;
-#endif
-
-{
- arrayCheck();
-#if 0
- printf("BlkLevel=%d CurAltNum=%d\n",
- BlkLevel,CurAltNum_array[BlkLevel]);
-#endif
- alt->curAltNum=CurAltNum_array[BlkLevel];
- alt->pendingLink=altArray[BlkLevel];
- altArray[BlkLevel]=alt;
-}
-
-static void
-#ifdef __USE_PROTOS
-arrayCheck(void)
-#else
-arrayCheck()
-#endif
-{
- ExceptionGroup **egArrayNew;
- LabelEntry **leArrayNew;
- Junction **altArrayNew;
- int arraySizeNew;
- int i;
-
- if (BlkLevel > highWater) highWater=BlkLevel;
-
- if (BlkLevel >= arraySize) {
- arraySizeNew=BlkLevel+5; /* MR20 */
- egArrayNew=(ExceptionGroup **)
- calloc(arraySizeNew,sizeof(ExceptionGroup *));
- leArrayNew=(LabelEntry **)
- calloc(arraySizeNew,sizeof(LabelEntry *));
- altArrayNew=(Junction **)
- calloc(arraySizeNew,sizeof(Junction *));
- for (i=0; i<arraySize ; i++) {
- egArrayNew[i]=egArray[i];
- leArrayNew[i]=leArray[i];
- altArrayNew[i]=altArray[i];
- };
- arraySize=arraySizeNew;
- if (egArray != NULL) free( (char *) egArray);
- if (leArray != NULL) free( (char *) leArray);
- if (altArray != NULL) free( (char *) altArray);
- egArray=egArrayNew;
- leArray=leArrayNew;
- altArray=altArrayNew;
- };
-}
-
-/* always call leFixup() BEFORE egFixup() */
-
-void
-#ifdef __USE_PROTOS
-egFixup(void)
-#else
-egFixup()
-#endif
-{
- int i;
- ExceptionGroup *nextEG;
- ExceptionGroup *innerEG;
-
- for (i=1; i<=highWater ; i++) {
- for (innerEG=egArray[i]; innerEG != NULL ; innerEG=nextEG) {
- nextEG=innerEG->pendingLink;
- innerEG->pendingLink=NULL;
- };
- egArray[i]=NULL;
- };
- lastEG=NULL;
- lastBlkLevel=0;
-}
-
-/* always call leFixup() BEFORE egFixup() */
-
-#ifdef __USE_PROTOS
-void leFixup(void)
-#else
-void leFixup()
-#endif
-{
-
- int i;
- LabelEntry *nextLE;
- LabelEntry *innerLE;
-
- for (i=BlkLevel; i<=highWater ; i++) {
- for (innerLE=leArray[i]; innerLE != NULL ; innerLE=nextLE) {
- nextLE=innerLE->pendingLink;
- innerLE->pendingLink=NULL;
- };
- leArray[i]=NULL;
- };
-}
-
-/* always call altFixup() BEFORE egFixup() */
-
-#ifdef __USE_PROTOS
-void altFixup(void)
-#else
-void altFixup()
-#endif
-{
-
- int i;
- Junction *nextAlt;
- Junction *innerAlt;
-
- for (i=BlkLevel; i<=highWater ; i++) {
- for (innerAlt=altArray[i]; innerAlt != NULL ; innerAlt=nextAlt) {
-
- /* if an outerEG has been found then fill in the outer EG */
-
- if (lastBlkLevel <= i) {
- if (innerAlt->outerEG == NULL) {
- innerAlt->outerEG=lastEG;
- };
- };
- nextAlt=innerAlt->pendingLink;
- innerAlt->pendingLink=NULL;
- };
- altArray[i]=NULL;
- };
-}
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/err.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/err.c
deleted file mode 100644
index ca239398cf..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/err.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- * A n t l r S e t s / E r r o r F i l e H e a d e r
- *
- * Generated from: antlr.g
- *
- * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001
- * Parr Research Corporation
- * with Purdue University Electrical Engineering
- * With AHPCRC, University of Minnesota
- * ANTLR Version 1.33MR33
- */
-
-#define ANTLR_VERSION 13333
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-#include "pcctscfg.h"
-#include "set.h"
-#include <ctype.h>
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#define zzcr_attr(attr,tok,t)
-#define zzSET_SIZE 20
-#include "antlr.h"
-#include "tokens.h"
-#include "dlgdef.h"
-#include "err.h"
-
-ANTLRChar *zztokens[157]={
- /* 00 */ "Invalid",
- /* 01 */ "Eof",
- /* 02 */ "QuotedTerm",
- /* 03 */ "\\n|\\r|\\r\\n",
- /* 04 */ "\\(\\n|\\r|\\r\\n)",
- /* 05 */ "\\~[]",
- /* 06 */ "~[\\n\\r\"\\]+",
- /* 07 */ "\"",
- /* 08 */ "\\n|\\r|\\r\\n",
- /* 09 */ "\\(\\n|\\r|\\r\\n)",
- /* 10 */ "\\~[]",
- /* 11 */ "~[\\n\\r\"\\]+",
- /* 12 */ "'",
- /* 13 */ "\\n|\\r|\\r\\n",
- /* 14 */ "\\~[]",
- /* 15 */ "~[\\n\\r'\\]+",
- /* 16 */ "\\*/",
- /* 17 */ "\\*",
- /* 18 */ "\\n|\\r|\\r\\n",
- /* 19 */ "~[\\n\\r\\*]+",
- /* 20 */ "\\*/",
- /* 21 */ "\\*",
- /* 22 */ "\\n|\\r|\\r\\n",
- /* 23 */ "~[\\n\\r\\*]+",
- /* 24 */ "\\n|\\r|\\r\\n",
- /* 25 */ "~[\\n\\r]+",
- /* 26 */ "\\n|\\r|\\r\\n",
- /* 27 */ "~[\\n\\r]+",
- /* 28 */ "\\n|\\r|\\r\\n",
- /* 29 */ "~[\\n\\r]+",
- /* 30 */ "\\*/",
- /* 31 */ "\\*",
- /* 32 */ "\\n|\\r|\\r\\n",
- /* 33 */ "~[\\n\\r\\*]+",
- /* 34 */ "Action",
- /* 35 */ "Pred",
- /* 36 */ "PassAction",
- /* 37 */ "consumeUntil\\( [\\ \\t]* \\{~[\\}]+\\} [\\ \\t]* \\)",
- /* 38 */ "consumeUntil\\( ~[\\)]+ \\)",
- /* 39 */ "\\n|\\r|\\r\\n",
- /* 40 */ "\\>",
- /* 41 */ "$",
- /* 42 */ "$$",
- /* 43 */ "$\\[\\]",
- /* 44 */ "$\\[",
- /* 45 */ "$[0-9]+",
- /* 46 */ "$[0-9]+.",
- /* 47 */ "$[0-9]+.[0-9]+",
- /* 48 */ "$[_a-zA-Z][_a-zA-Z0-9]*",
- /* 49 */ "#0",
- /* 50 */ "#\\[\\]",
- /* 51 */ "#\\(\\)",
- /* 52 */ "#[0-9]+",
- /* 53 */ "#line[\\ \\t]* [0-9]+ {[\\ \\t]* \"~[\"]+\" ([\\ \\t]* [0-9]*)* } (\\n|\\r|\\r\\n)",
- /* 54 */ "#line ~[\\n\\r]* (\\n|\\r|\\r\\n)",
- /* 55 */ "#[_a-zA-Z][_a-zA-Z0-9]*",
- /* 56 */ "#\\[",
- /* 57 */ "#\\(",
- /* 58 */ "#",
- /* 59 */ "\\)",
- /* 60 */ "\\[",
- /* 61 */ "\\(",
- /* 62 */ "\\\\]",
- /* 63 */ "\\\\)",
- /* 64 */ "\\>",
- /* 65 */ "'",
- /* 66 */ "\"",
- /* 67 */ "\\$",
- /* 68 */ "\\#",
- /* 69 */ "\\(\\n|\\r|\\r\\n)",
- /* 70 */ "\\~[\\]\\)>$#]",
- /* 71 */ "/",
- /* 72 */ "/\\*",
- /* 73 */ "\\*/",
- /* 74 */ "//",
- /* 75 */ "~[\\n\\r\\)\\(\\$#\\>\\]\\[\"'/]+",
- /* 76 */ "[\\t\\ ]+",
- /* 77 */ "\\n|\\r|\\r\\n",
- /* 78 */ "\\[",
- /* 79 */ "\\<\\<",
- /* 80 */ "\"",
- /* 81 */ "/\\*",
- /* 82 */ "\\*/",
- /* 83 */ "//",
- /* 84 */ "#line[\\ \\t]* [0-9]+ {[\\ \\t]* \"~[\"]+\" ([\\ \\t]* [0-9]*)* } (\\n|\\r|\\r\\n)",
- /* 85 */ "#line ~[\\n\\r]* (\\n|\\r|\\r\\n)",
- /* 86 */ "\\>\\>",
- /* 87 */ "WildCard",
- /* 88 */ "\\@",
- /* 89 */ "LABEL",
- /* 90 */ "grammar-element",
- /* 91 */ "meta-symbol",
- /* 92 */ "Pragma",
- /* 93 */ "FirstSetSymbol",
- /* 94 */ "{\\}#header",
- /* 95 */ "{\\}#first",
- /* 96 */ "{\\}#parser",
- /* 97 */ "{\\}#tokdefs",
- /* 98 */ "\\}",
- /* 99 */ "class",
- /* 100 */ "NonTerminal",
- /* 101 */ "TokenTerm",
- /* 102 */ "\\{",
- /* 103 */ "!",
- /* 104 */ "\\<",
- /* 105 */ "\\>",
- /* 106 */ ":",
- /* 107 */ ";",
- /* 108 */ "{\\}#lexaction",
- /* 109 */ "{\\}#lexmember",
- /* 110 */ "{\\}#lexprefix",
- /* 111 */ "{\\}#pred",
- /* 112 */ "\\|\\|",
- /* 113 */ "&&",
- /* 114 */ "\\(",
- /* 115 */ "\\)",
- /* 116 */ "{\\}#lexclass",
- /* 117 */ "{\\}#errclass",
- /* 118 */ "{\\}#tokclass",
- /* 119 */ "..",
- /* 120 */ "{\\}#token",
- /* 121 */ "=",
- /* 122 */ "[0-9]+",
- /* 123 */ "\\|",
- /* 124 */ "\\~",
- /* 125 */ "^",
- /* 126 */ "approx",
- /* 127 */ "LL\\(1\\)",
- /* 128 */ "LL\\(2\\)",
- /* 129 */ "\\*",
- /* 130 */ "\\+",
- /* 131 */ "?",
- /* 132 */ "=>",
- /* 133 */ "exception",
- /* 134 */ "default",
- /* 135 */ "catch",
- /* 136 */ "{\\}#[A-Za-z0-9_]*",
- /* 137 */ "[\\t\\ ]+",
- /* 138 */ "\\n|\\r|\\r\\n",
- /* 139 */ "//",
- /* 140 */ "/\\*",
- /* 141 */ "#ifdef",
- /* 142 */ "#if",
- /* 143 */ "#ifndef",
- /* 144 */ "#else",
- /* 145 */ "#endif",
- /* 146 */ "#undef",
- /* 147 */ "#import",
- /* 148 */ "ID",
- /* 149 */ "#define",
- /* 150 */ "INT",
- /* 151 */ "enum",
- /* 152 */ "\\{",
- /* 153 */ "=",
- /* 154 */ ",",
- /* 155 */ "\\}",
- /* 156 */ ";"
-};
-SetWordType zzerr1[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr2[20] = {0xfc,0xff,0xff,0xff, 0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xf3,
- 0xbf,0xff,0xff,0xff, 0xff,0xff,0xff,0x1f};
-SetWordType zzerr3[20] = {0xfc,0xff,0xff,0xff, 0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xfb,
- 0x3b,0xf7,0xf7,0xc7, 0xff,0xff,0xff,0x1f};
-SetWordType zzerr4[20] = {0x4,0x0,0x0,0x0, 0x10,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x80,0x7,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType setwd1[157] = {0x0,0x50,0xa0,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x6a,0x20,0xa0,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x0,0x0,0x20,0x20,0x21,
- 0x21,0x21,0x21,0x6e,0x6e,0x64,0x20,0x0,
- 0x20,0xa0,0xa0,0xa0,0x20,0x6a,0x6a,0x6a,
- 0x6e,0x20,0x20,0x20,0x20,0x66,0x6e,0x6e,
- 0x20,0x66,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20};
-SetWordType zzerr5[20] = {0x0,0x0,0x0,0x0, 0x10,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x1,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr6[20] = {0x4,0x0,0x0,0x0, 0x10,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x7,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr7[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x6,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr8[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x4,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr9[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x1c,0xf0,0x70,0x1, 0x20,0x0,0x0,0x0};
-SetWordType setwd2[157] = {0x0,0xf8,0x6,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xf8,0x0,0x1,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xf8,0xf8,0xf8,0x0,0x0,
- 0x0,0x1,0x2,0x6,0x0,0xf8,0xf8,0xf8,
- 0xf8,0x0,0x0,0x0,0x0,0xf8,0xf8,0xf8,
- 0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0xe8,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0};
-SetWordType zzerr10[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0xbc,0xf8,0x74,0x1, 0x20,0x0,0x0,0x0};
-SetWordType zzerr11[20] = {0x0,0x0,0x0,0x0, 0x8,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0xa0,0x0,0x4,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr12[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x1c,0xf8,0x70,0x1, 0x20,0x0,0x0,0x0};
-SetWordType zzerr13[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0xa0,0x0,0x4,0x0, 0x0,0x0,0x0,0x0};
-SetWordType setwd3[157] = {0x0,0xfa,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xfa,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xfa,0xfa,0xfa,0x5,0x0,
- 0x5,0x0,0x0,0x0,0xe2,0xfa,0xfa,0xfa,
- 0xfa,0xc0,0x80,0x5,0xe0,0xfa,0xfa,0xfa,
- 0x0,0xfa,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0xfa,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0};
-SetWordType zzerr14[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x20,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr15[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr16[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr17[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x40,0x0,0x4,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr18[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x24,0x0,0x80,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr19[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x20,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr20[20] = {0x6,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x1c,0xf8,0x74,0x3, 0x20,0x0,0x0,0x0};
-SetWordType zzerr21[20] = {0x6,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x1c,0xf8,0x70,0x3, 0x20,0x0,0x0,0x0};
-SetWordType setwd4[157] = {0x0,0xe5,0xda,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xe5,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xed,0xe5,0xe7,0x1a,0x0,
- 0x0,0x0,0x0,0x0,0xc0,0xe5,0xe5,0xe5,
- 0xe5,0x0,0x0,0x0,0x0,0xe5,0xe5,0xe5,
- 0x0,0xe5,0x40,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0xe5,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0};
-SetWordType zzerr22[20] = {0x6,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x3c,0xf8,0x70,0x1, 0x20,0x0,0x0,0x0};
-SetWordType zzerr23[20] = {0x6,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x1c,0xf8,0x70,0x1, 0x20,0x0,0x0,0x0};
-SetWordType zzerr24[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x1c,0xf8,0x70,0x1, 0x20,0x0,0x0,0x0};
-SetWordType zzerr25[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x1c,0xf8,0x70,0x1, 0x20,0x0,0x0,0x0};
-SetWordType zzerr26[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x5,
- 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0};
-SetWordType setwd5[157] = {0x0,0x1f,0xc1,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xdf,0xc0,0xc0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0xc0,0x0,0xc0,0x0,0x0,0xc0,0xc0,0x0,
- 0x0,0x0,0x0,0x7f,0x1f,0xdf,0xc0,0xc0,
- 0x0,0x0,0xc0,0x0,0x67,0x1f,0x1f,0x1f,
- 0x1f,0x0,0x0,0xc0,0x60,0x1f,0x1f,0x1f,
- 0x0,0x1f,0x0,0x0,0x40,0xc0,0x0,0x0,
- 0x0,0x0,0xc0,0xc0,0x0,0x0,0x5f,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0};
-SetWordType zzerr27[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4,
- 0x0,0x0,0x0,0x10, 0x0,0x0,0x0,0x0};
-SetWordType zzerr28[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x80,0x2,
- 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr29[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x20,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr30[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xd,
- 0x0,0x0,0x80,0x0, 0x20,0x0,0x0,0x0};
-SetWordType zzerr31[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xd,
- 0x0,0x0,0x0,0x0, 0x20,0x0,0x0,0x0};
-SetWordType zzerr32[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x5,
- 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0};
-SetWordType zzerr33[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x20,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType setwd6[157] = {0x0,0x0,0xfd,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xe1,0xe1,0xe1,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0xfd,0x60,0xe9,0x0,0x0,0xe1,0xe1,0x0,
- 0x0,0x0,0x0,0xe2,0x0,0xfd,0xfd,0xe1,
- 0x20,0x0,0xe1,0x0,0xe2,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xe1,0xe2,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0xe2,0xe0,0x20,0x0,
- 0x0,0x0,0xe1,0xe1,0x0,0x0,0xe2,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0};
-SetWordType zzerr34[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xd,
- 0x0,0x0,0x80,0x0, 0x20,0x0,0x0,0x0};
-SetWordType zzerr35[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xd,
- 0x0,0x0,0x0,0x0, 0x20,0x0,0x0,0x0};
-SetWordType zzerr36[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x5,
- 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0};
-SetWordType zzerr37[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xc,
- 0x0,0x0,0x0,0x0, 0x20,0x0,0x0,0x0};
-SetWordType zzerr38[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4,
- 0x84,0x9,0x8,0x18, 0x20,0x0,0x0,0x0};
-SetWordType zzerr39[20] = {0x0,0x0,0x0,0x0, 0x10,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x1,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr40[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4,
- 0x4,0x9,0x8,0x18, 0x20,0x0,0x0,0x0};
-SetWordType zzerr41[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4,
- 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0};
-SetWordType zzerr42[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x80,0x0,
- 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType setwd7[157] = {0x0,0x0,0xdf,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xdf,0xdf,0xff,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0xdf,0x3,0xdf,0x0,0x0,0xdf,0xdf,0x0,
- 0x0,0x0,0x0,0xdf,0x0,0xdf,0xdf,0xdf,
- 0x1,0x30,0xdf,0x0,0xdf,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xdf,0xdf,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0xdf,0xdf,0x1,0x0,
- 0x0,0x0,0xdf,0xdf,0x0,0x0,0xdf,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0};
-SetWordType zzerr43[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4,
- 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0};
-SetWordType zzerr44[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xc0, 0x1,0x0,0x0,0x0};
-SetWordType zzerr45[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x30,
- 0x40,0x0,0x4,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr46[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr47[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x20,
- 0x40,0x0,0x4,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr48[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x0,0x2,0x0, 0x10,0x0,0x0,0x0};
-SetWordType zzerr49[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4,
- 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0};
-SetWordType zzerr50[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4,
- 0x4,0x8,0xa,0x18, 0x30,0x0,0x0,0x0};
-SetWordType zzerr51[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4,
- 0x4,0x8,0x8,0x18, 0x28,0x0,0x0,0x0};
-SetWordType zzerr52[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x40,0x0,0x4,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr53[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4,
- 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType setwd8[157] = {0x0,0x0,0xe1,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0xe1,0xe1,0xe1,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0xe1,0x0,0xe1,0x0,0x0,0xe3,0xe7,0x0,
- 0x0,0x0,0x0,0xe1,0x0,0xe1,0xe1,0xef,
- 0x0,0x0,0xe1,0x0,0xe1,0x0,0x0,0x0,
- 0x0,0x0,0x10,0xef,0xe1,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0xe1,0xe1,0x0,0x0,
- 0x0,0x0,0xe1,0xe1,0x0,0x10,0xe1,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0};
-SetWordType zzerr54[20] = {0x2,0x0,0x0,0x0, 0x14,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x1c,0xf8,0x78,0x9, 0xe0,0x0,0x0,0x0};
-SetWordType zzerr55[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x1c,0xf8,0x78,0x9, 0x60,0x0,0x0,0x0};
-SetWordType zzerr56[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr57[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x1c,0xf8,0x78,0x9, 0xe0,0x0,0x0,0x0};
-SetWordType setwd9[157] = {0x0,0x7c,0x1,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x7f,0x1,0x1,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x1,0x0,0x1,0x0,0x0,0x1,0x1,0x0,
- 0x0,0x0,0x0,0x7f,0x7e,0x7f,0x1,0x1,
- 0x0,0x0,0x1,0x0,0x7d,0x7e,0x7e,0x7e,
- 0x7e,0x0,0x0,0x1,0x7d,0x7e,0x7e,0x7e,
- 0x0,0x7e,0x0,0x0,0x7d,0x1,0x0,0x0,
- 0x0,0x0,0x1,0x1,0x0,0x0,0x7f,0x64,
- 0x64,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x80,0x0,0x0,0x0,0x0,0x0,0x80,0x0,
- 0x80,0x0,0x0,0x0,0x0,0x0};
-SetWordType zzerr58[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0, 0x0,0x0,0xa0,0x0};
-SetWordType zzerr59[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0, 0x0,0x80,0xa0,0x0};
-SetWordType zzerr60[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0, 0x0,0x0,0xa0,0x0};
-SetWordType zzerr61[20] = {0x2,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0, 0x0,0x80,0xa0,0x0};
-SetWordType zzerr62[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xe};
-SetWordType zzerr63[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xe};
-SetWordType zzerr64[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xe};
-SetWordType zzerr65[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0, 0x0,0x0,0x10,0xc};
-SetWordType setwd10[157] = {0x0,0xc,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,
- 0x3,0x0,0x0,0xf0,0xf0,0x0};
-SetWordType setwd11[157] = {0x0,0x1,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
- 0x1,0x0,0x0,0x0,0x0,0x0};
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/fcache.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/fcache.c
deleted file mode 100644
index ff7dcdfdd5..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/fcache.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * fcache.c
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33MR10
- *
- */
-
-#include <stdio.h>
-#include <ctype.h>
-
-#include "pcctscfg.h"
-
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-
-#ifdef __USE_PROTOS
-CacheEntry *dumpFcache1(char *prev)
-#else
-CacheEntry *dumpFcache1(prev)
- char *prev;
-#endif
-{
- Entry **table=Fcache;
-
- int low=0;
- int hi=0;
-
- CacheEntry *least=NULL;
-
- Entry **p;
-
- for (p=table; p<&(table[HashTableSize]); p++) {
-
- CacheEntry *q =(CacheEntry *) *p;
-
- if ( q != NULL && low==0 ) low = p-table;
- while ( q != NULL ) {
- if (strcmp(q->str,prev) > 0) {
- if (least == NULL) {
- least=q;
- } else {
- if (strcmp(q->str,least->str) < 0) {
- least=q;
- };
- };
- };
- q = q->next;
- };
-
- if ( *p != NULL ) hi = p-table;
- }
- return least;
-}
-
-#ifdef __USE_PROTOS
-void reportFcache(CacheEntry *q)
-#else
-void reportFcache(q)
- CacheEntry *q;
-#endif
-{
- char *qstr;
-
- fprintf(stdout,"\nrule ");
- for (qstr=q->str; *qstr != '*' ; qstr++) {
- fprintf(stdout,"%c",*qstr);
- };
-
- qstr++;
- if (*qstr == 'i') fprintf(stdout," First[");
- if (*qstr == 'o') fprintf(stdout," Follow[");
- qstr++;
- fprintf(stdout,"%s]",qstr);
- if (q->incomplete) fprintf(stdout," *** incomplete ***");
- fprintf(stdout,"\n");
- MR_dumpTokenSet(stdout,1,q->fset);
-}
-
-void
-#ifdef __USE_PROTOS
-DumpFcache(void)
-#else
-DumpFcache()
-#endif
-{
-
- char *prev="";
- int n=0;
- CacheEntry *next;
-
- fprintf(stdout,"\n\nDump of First/Follow Cache\n");
-
- for(;;) {
- next=dumpFcache1(prev);
- if (next == NULL) break;
- reportFcache(next);
- ++n;
- prev=next->str;
- };
- fprintf(stdout,"\nEnd dump of First/Follow Cache\n");
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset.c
deleted file mode 100644
index e1a76ec620..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset.c
+++ /dev/null
@@ -1,1555 +0,0 @@
-/*
- * fset.c
- *
- * Compute FIRST and FOLLOW sets.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "pcctscfg.h"
-
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#include "dlgdef.h"
-#include "limits.h"
-
-#ifdef __USE_PROTOS
-static void ensure_predicates_cover_ambiguous_lookahead_sequences
- (Junction *, Junction *, char *, Tree *);
-#else
-static void ensure_predicates_cover_ambiguous_lookahead_sequences();
-#endif
-
-/*
- * What tokens are k tokens away from junction q?
- *
- * Follow both p1 and p2 paths (unless RuleBlk) to collect the tokens k away from this
- * node.
- * We lock the junction according to k--the lookahead. If we have been at this
- * junction before looking for the same, k, number of lookahead tokens, we will
- * do it again and again...until we blow up the stack. Locks are only used on aLoopBlk,
- * RuleBlk, aPlusBlk and EndRule junctions to remove/detect infinite recursion from
- * FIRST and FOLLOW calcs.
- *
- * If p->jtype == EndRule we are going to attempt a FOLLOW. (FOLLOWs are really defined
- * in terms of FIRST's, however). To proceed with the FOLLOW, p->halt cannot be
- * set. p->halt is set to indicate that a reference to the current rule is in progress
- * and the FOLLOW is not desirable.
- *
- * If we attempt a FOLLOW and find that there is no FOLLOW or REACHing beyond the EndRule
- * junction yields an empty set, replace the empty set with EOF. No FOLLOW means that
- * only EOF can follow the current rule. This normally occurs only on the start symbol
- * since all other rules are referenced by another rule somewhere.
- *
- * Normally, both p1 and p2 are followed. However, checking p2 on a RuleBlk node is
- * the same as checking the next rule which is clearly incorrect.
- *
- * Cycles in the FOLLOW sense are possible. e.g. Fo(c) requires Fo(b) which requires
- * Fo(c). Both Fo(b) and Fo(c) are defined to be Fo(b) union Fo(c). Let's say
- * Fo(c) is attempted first. It finds all of the FOLLOW symbols and then attempts
- * to do Fo(b) which finds of its FOLLOW symbols. So, we have:
- *
- * Fo(c)
- * / \
- * a set Fo(b)
- * / \
- * a set Fo(c) .....Hmmmm..... Infinite recursion!
- *
- * The 2nd Fo(c) is not attempted and Fo(b) is left deficient, but Fo(c) is now
- * correctly Fo(c) union Fo(b). We wish to pick up where we left off, so the fact
- * that Fo(b) terminated early means that we lack Fo(c) in the Fo(b) set already
- * laying around. SOOOOoooo, we track FOLLOW cycles. All FOLLOW computations are
- * cached in a hash table. After the sequence of FOLLOWs finish, we reconcile all
- * cycles --> correct all Fo(rule) sets in the cache.
- *
- * Confused? Good! Read my MS thesis [Purdue Technical Report TR90-30].
- * TJP 8/93 -- can now read PhD thesis from Purdue.
- *
- * Also, FIRST sets are cached in the hash table. Keys are (rulename,Fi/Fo,k).
- * Only FIRST sets, for which the FOLLOW is not included, are stored.
- *
- * SPECIAL CASE of (...)+ blocks:
- * I added an optional alt so that the alts could see what
- * was behind the (...)+ block--thus using enough lookahead
- * to branch out rather than just enough to distinguish
- * between alts in the (...)+. However, when the FIRST("(...)+") is
- * is needed, must not use this last "optional" alt. This routine
- * turns off this path by setting a new 'ignore' flag for
- * the alt and then resetting it afterwards.
- */
-
-set
-#ifdef __USE_PROTOS
-rJunc( Junction *p, int k, set *rk )
-#else
-rJunc( p, k, rk )
-Junction *p;
-int k;
-set *rk;
-#endif
-{
- set a, b;
-
- require(p!=NULL, "rJunc: NULL node");
- require(p->ntype==nJunction, "rJunc: not junction");
-
-#ifdef DBG_LL1
- if ( p->jtype == RuleBlk ) fprintf(stderr, "FIRST(%s,%d) \n",((Junction *)p)->rname,k);
- else fprintf(stderr, "rJunc: %s in rule %s\n",
- decodeJType[p->jtype], ((Junction *)p)->rname);
-#endif
- /* if this is one of the added optional alts for (...)+ then return */
-
- /* no need to pop backtrace - hasn't been pushed */
-
- if ( p->ignore ) return empty;
-
- if (MR_MaintainBackTrace) MR_pointerStackPush(&MR_BackTraceStack,p);
-
-/* MR14 */ if (AlphaBetaTrace && p->alpha_beta_guess_end) {
-/* MR14 */ warnFL(
-/* MR14 */ "not possible to compute follow set for alpha in an \"(alpha)? beta\" block. ",
-/* MR14 */ FileStr[p->file],p->line);
-/* MR14 */ MR_alphaBetaTraceReport();
-/* MR14 */ };
-
-/* MR14 */ if (p->alpha_beta_guess_end) {
-/* MR14 */ if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
-/* MR14 */ return empty;
-/* MR14 */ }
-
- /* locks are valid for aLoopBlk,aPlusBlk,RuleBlk,EndRule junctions only */
- if ( p->jtype==aLoopBlk || p->jtype==RuleBlk ||
- p->jtype==aPlusBlk || p->jtype==EndRule )
- {
- require(p->lock!=NULL, "rJunc: lock array is NULL");
- if ( p->lock[k] )
- {
- if ( p->jtype == EndRule ) /* FOLLOW cycle? */
- {
-#ifdef DBG_LL1
- fprintf(stderr, "FOLLOW cycle to %s: panic!\n", p->rname);
-#endif
- if (! MR_AmbSourceSearch) RegisterCycle(p->rname, k);
- }
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
- return empty;
- }
- if ( p->jtype == RuleBlk &&
- p->end->halt &&
- ! MR_AmbSourceSearch) /* check for FIRST cache */
- {
- CacheEntry *q = (CacheEntry *) hash_get(Fcache, Fkey(p->rname,'i',k));
- if ( q != NULL )
- {
- set_orin(rk, q->rk);
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
- return set_dup( q->fset );
- }
- }
- if ( p->jtype == EndRule &&
- !p->halt && /* MR11 was using cache even when halt set */
- ! MR_AmbSourceSearch) /* FOLLOW set cached already? */
- {
- CacheEntry *q = (CacheEntry *) hash_get(Fcache, Fkey(p->rname,'o',k));
- if ( q != NULL )
- {
-#ifdef DBG_LL1
- fprintf(stderr, "cache for FOLLOW(%s,%d):", p->rname,k);
- s_fprT(stderr, q->fset);
- if ( q->incomplete ) fprintf(stderr, " (incomplete)");
- fprintf(stderr, "\n");
-#endif
- if ( !q->incomplete )
- {
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
- return set_dup( q->fset );
- }
- }
- }
- p->lock[k] = TRUE; /* This rule is busy */
- }
-
- a = b = empty;
-
- if ( p->jtype == EndRule )
- {
- if (p->halt ) /* don't want FOLLOW here? */ /* unless MR10 hoisting */
- {
- p->lock[k] = FALSE;
- set_orel(k, rk); /* indicate this k value needed */
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
- return empty;
- }
- if (! MR_AmbSourceSearch) FoPush(p->rname, k); /* Attempting FOLLOW */
- if ( p->p1 == NULL ) set_orel((TokenInd!=NULL?TokenInd[EofToken]:EofToken), &a);/* if no FOLLOW assume EOF */
-#ifdef DBG_LL1
- fprintf(stderr, "-->FOLLOW(%s,%d)\n", p->rname,k);
-#endif
- }
-
- if ( p->p1 != NULL ) {
-/* MR14 */ if (p->guess) {
-/* MR14 */ if (p->guess_analysis_point == NULL) {
-/* MR14 */ Node * guess_point;
-/* MR14 */ guess_point=(Node *)analysis_point(p);
-/* MR14 */ if (guess_point == (Node *)p) {
-/* MR14 */ guess_point=p->p1;
-/* MR14 */ }
-/* MR14 */ p->guess_analysis_point=guess_point;
-/* MR14 */ }
-/* MR14 */ REACH(p->guess_analysis_point, k, rk, a);
- } else {
- REACH(p->p1, k, rk, a);
- }
- }
-
- /* C a c h e R e s u l t s */
-
- if ( p->jtype == RuleBlk && p->end->halt && ! MR_AmbSourceSearch) /* can save FIRST set? */
- {
- CacheEntry *q = newCacheEntry( Fkey(p->rname,'i',k) );
- /*fprintf(stderr, "Caching %s FIRST %d\n", p->rname, k);*/
- hash_add(Fcache, Fkey(p->rname,'i',k), (Entry *)q);
- q->fset = set_dup( a );
- q->rk = set_dup( *rk );
- }
-
- if ( p->jtype == EndRule &&
- !p->halt && /* MR11 was using cache even with halt set */
- ! MR_AmbSourceSearch) /* just completed FOLLOW? */
- {
- /* Cache Follow set */
- CacheEntry *q = (CacheEntry *) hash_get(Fcache, Fkey(p->rname,'o',k));
- if ( q==NULL )
- {
- q = newCacheEntry( Fkey(p->rname,'o',k) );
- hash_add(Fcache, Fkey(p->rname,'o',k), (Entry *)q);
- }
- /*fprintf(stderr, "Caching %s FOLLOW %d\n", p->rname, k);*/
- if ( set_nil(a) && !q->incomplete )
- {
- /* Don't ever save a nil set as complete.
- * Turn it into an eof set.
- */
- set_orel(EofToken, &a);
- }
- set_orin(&(q->fset), a);
- FoPop( k );
- if ( FoTOS[k] == NULL && Cycles[k] != NULL ) ResolveFoCycles(k);
-#ifdef DBG_LL1
- fprintf(stderr, "saving FOLLOW(%s,%d):", p->rname, k);
- s_fprT(stderr, q->fset);
- if ( q->incomplete ) fprintf(stderr, " (incomplete)");
- fprintf(stderr, "\n");
-#endif
- }
-
- if (p->jtype != RuleBlk && p->p2 != NULL && /* MR14 */ ! p->guess) {
- REACH(p->p2, k, rk, b);
- }
-
- if ( p->jtype==aLoopBlk || p->jtype==RuleBlk ||
- p->jtype==aPlusBlk || p->jtype==EndRule )
- p->lock[k] = FALSE; /* unlock node */
-
- set_orin(&a, b);
- set_free(b);
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
- return a;
-}
-
-set
-#ifdef __USE_PROTOS
-rRuleRef( RuleRefNode *p, int k, set *rk_out )
-#else
-rRuleRef( p, k, rk_out )
-RuleRefNode *p;
-int k;
-set *rk_out;
-#endif
-{
- set rk;
- Junction *r;
- int k2;
- set a, rk2, b;
- int save_halt;
- RuleEntry *q = (RuleEntry *) hash_get(Rname, p->text);
- require(p!=NULL, "rRuleRef: NULL node");
- require(p->ntype==nRuleRef, "rRuleRef: not rule ref");
-
-#ifdef DBG_LL1
- fprintf(stderr, "rRuleRef: %s\n", p->text);
-#endif
-
- if (MR_MaintainBackTrace) MR_pointerStackPush(&MR_BackTraceStack,p);
-
- if ( q == NULL )
- {
- warnFL( eMsg1("rule %s not defined",p->text), FileStr[p->file], p->line );
- REACH(p->next, k, rk_out, a);
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
- return a;
- }
- rk2 = empty;
-
-/* MR9 Problems with rule references in guarded predicates */
-/* MR9 Perhaps can use hash table to find rule ? */
-
-/* MR9 */ if (RulePtr == NULL) {
-/* MR9 */ fatalFL(eMsg2("Rule %s uses rule %s via RulePtr before it has been initialized",
-/* MR9 */ p->rname,q->str),FileStr[p->file],p->line);
-/* MR9 */ };
-
- r = RulePtr[q->rulenum];
- if ( r->lock[k] )
- {
- errNoFL( eMsg2("infinite left-recursion to rule %s from rule %s",
- r->rname, p->rname) );
-
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
-
- return empty;
- }
-
- save_halt = r->end->halt;
- r->end->halt = TRUE; /* don't let reach fall off end of rule here */
- rk = empty;
- REACH(r, k, &rk, a);
- r->end->halt = save_halt;
- while ( !set_nil(rk) ) {
- k2 = set_int(rk); /* MR11 this messes up the ambiguity search routine */
- set_rm(k2, rk);
- REACH(p->next, k2, &rk2, b); /* MR11 by changing the value of k */
- set_orin(&a, b);
- set_free(b);
- }
- set_free(rk); /* this has no members, but free it's memory */
- set_orin(rk_out, rk2); /* remember what we couldn't do */
- set_free(rk2);
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
- return a;
-}
-
-/*
- * Return FIRST sub k ( token_node )
- *
- * TJP 10/11/93 modified this so that token nodes that are actually
- * ranges (T1..T2) work.
- */
-set
-#ifdef __USE_PROTOS
-rToken( TokNode *p, int k, set *rk )
-#else
-rToken( p, k, rk )
-TokNode *p;
-int k;
-set *rk;
-#endif
-{
- set a;
-
- require(p!=NULL, "rToken: NULL node");
- require(p->ntype==nToken, "rToken: not token node");
-
-#ifdef DBG_LL1
- fprintf(stderr, "rToken: %s\n", (TokenString(p->token)!=NULL)?TokenString(p->token):
- ExprString(p->token));
-#endif
-
-
- if (MR_MaintainBackTrace) MR_pointerStackPush(&MR_BackTraceStack,p);
-
- if (MR_AmbSourceSearch && (k-1) == 0) {
-
- set localConstrain;
- set intersection;
-
- localConstrain=fset[maxk-k+1];
-
- if (! set_nil(p->tset)) {
- intersection=set_and(localConstrain,p->tset);
- if (! set_nil(intersection)) {
- MR_backTraceReport();
- };
- set_free(intersection);
- } else {
- if (set_el( (unsigned) p->token,localConstrain)) {
- MR_backTraceReport();
- }
- };
- };
-
- if ( k-1 == 0 ) {
-
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
-
- if ( !set_nil(p->tset) ) {
- return set_dup(p->tset);
- } else {
- return set_of(p->token);
- };
- }
-
- REACH(p->next, k-1, rk, a);
-
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
-
- return a;
-}
-
-set
-#ifdef __USE_PROTOS
-rAction( ActionNode *p, int k, set *rk )
-#else
-rAction( p, k, rk )
-ActionNode *p;
-int k;
-set *rk;
-#endif
-{
- set a;
-
- require(p!=NULL, "rJunc: NULL node");
- require(p->ntype==nAction, "rJunc: not action");
-
-/* MR11 */ if (p->is_predicate && p->ampersandPred != NULL) {
-/* MR11 */ Predicate *pred=p->ampersandPred;
-/* MR11 */ if (k <= pred->k) {
-/* MR11 */ REACH(p->guardNodes,k,rk,a);
-/* MR11 */ return a;
-/* MR11 */ };
-/* MR11 */ };
-
- /* it might be a good idea when doing an MR_AmbSourceSearch
- to *not* look behind predicates under some circumstances
- we'll look into that later
- */
-
- REACH(p->next, k, rk, a); /* ignore actions */
- return a;
-}
-
- /* A m b i g u i t y R e s o l u t i o n */
-
-
-void
-#ifdef __USE_PROTOS
-dumpAmbigMsg( set *fset, FILE *f, int want_nls )
-#else
-dumpAmbigMsg( fset, f, want_nls )
-set *fset;
-FILE *f;
-int want_nls;
-#endif
-{
- int i;
-
- set copy; /* MR11 */
-
- if ( want_nls ) fprintf(f, "\n\t");
- else fprintf(f, " ");
-
- for (i=1; i<=CLL_k; i++)
- {
- copy=set_dup(fset[i]); /* MR11 */
-
- if ( i>1 )
- {
- if ( !want_nls ) fprintf(f, ", ");
- }
- if ( set_deg(copy) > 3 && elevel == 1 )
- {
- int e,m;
- fprintf(f, "{");
- for (m=1; m<=3; m++)
- {
- e=set_int(copy);
- fprintf(f, " %s", TerminalString(e));
- set_rm(e, copy);
- }
- fprintf(f, " ... }");
- }
- else s_fprT(f, copy);
- if ( want_nls ) fprintf(f, "\n\t");
- set_free(copy);
- }
- fprintf(f, "\n");
-
-}
-
-static void
-#ifdef __USE_PROTOS
-verify_context(Predicate *predicate)
-#else
-verify_context(predicate)
-Predicate *predicate;
-#endif
-{
- if ( predicate == NULL ) return;
-
- if ( predicate->expr == PRED_OR_LIST ||
- predicate->expr == PRED_AND_LIST )
- {
- verify_context(predicate->down);
- verify_context(predicate->right); /* MR10 */
- return;
- }
-
- if ( !predicate->source->ctxwarned && predicate->source->guardpred==NULL &&
- ((predicate->k > 1 &&
- !is_single_tuple(predicate->tcontext)) ||
- ( predicate->k == 1 &&
- set_deg(predicate->scontext[1])>1 )) )
- {
-
-/* MR9 Suppress annoying messages caused by our own clever(?) fix */
-
- fprintf(stderr, ErrHdr, FileStr[predicate->source->file],
- predicate->source->line);
- fprintf(stderr, " warning: predicate applied for >1 lookahead %d-sequences\n", predicate->k);
- fprintf(stderr, ErrHdr, FileStr[predicate->source->file],
- predicate->source->line);
- fprintf(stderr, " predicate text: \"%s\"\n",
- (predicate->expr == NULL ? "(null)" : predicate->expr) );
- fprintf(stderr, ErrHdr, FileStr[predicate->source->file],
- predicate->source->line);
- fprintf(stderr, " You may only want one lookahead %d-sequence to apply\n", predicate->k);
- fprintf(stderr, ErrHdr, FileStr[predicate->source->file],
- predicate->source->line);
- fprintf(stderr, " Try using a context guard '(...)? =>'\n");
- predicate->source->ctxwarned = 1;
- }
- verify_context(predicate->right); /* MR10 */
-}
-
-/*
- * If delta is the set of ambiguous lookahead sequences, then make sure that
- * the predicate(s) for productions alt1,alt2 cover the sequences in delta.
- *
- * For example,
- * a : <<PRED1>>? (A B|A C)
- * | b
- * ;
- * b : <<PRED2>>? A B
- * | A C
- * ;
- *
- * This should give a warning that (A C) predicts both productions and alt2
- * does not have a predicate in the production that generates (A C).
- *
- * The warning detection is simple. Let delta = LOOK(alt1) intersection LOOK(alt2).
- * Now, if ( delta set-difference context(predicates-for-alt1) != empty then
- * alt1 does not "cover" all ambiguous sequences.
- *
- * If ambig is nonempty, then ambig in LL(k) sense -> use tree info; else use fset
- * info. Actually, sets are used only if k=1 for this grammar.
- */
-static void
-#ifdef __USE_PROTOS
-ensure_predicates_cover_ambiguous_lookahead_sequences
- ( Junction *alt1, Junction *alt2, char *sub, Tree *ambig )
-#else
-ensure_predicates_cover_ambiguous_lookahead_sequences( alt1, alt2, sub, ambig )
-Junction *alt1;
-Junction *alt2;
-char *sub;
-Tree *ambig;
-#endif
-{
- if ( !ParseWithPredicates ) return;
-
- if ( ambig!=NULL )
- {
- Tree *non_covered = NULL;
- if ( alt1->predicate!=NULL )
- non_covered = tdif(ambig, alt1->predicate, alt1->fset, alt2->fset);
- if ( (non_covered!=NULL || alt1->predicate==NULL) && WarningLevel>1 )
- {
- fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line);
- fprintf(stderr, " warning: alt %d %shas no predicate to resolve ambiguity",
- alt1->altnum, sub);
- if ( alt1->predicate!=NULL && non_covered!=NULL )
- {
- fprintf(stderr, " upon");
- preorder(non_covered);
- }
- else if ( alt1->predicate==NULL )
- {
- fprintf(stderr, " upon");
- preorder(ambig->down);
- }
- fprintf(stderr, "\n");
- }
- Tfree(non_covered);
- non_covered = NULL;
- if ( alt2->predicate!=NULL )
- non_covered = tdif(ambig, alt2->predicate, alt1->fset, alt2->fset);
- if ( (non_covered!=NULL || alt2->predicate==NULL) && WarningLevel>1 )
- {
- fprintf(stderr, ErrHdr, FileStr[alt2->file], alt2->line);
- fprintf(stderr, " warning: alt %d %shas no predicate to resolve ambiguity",
- alt2->altnum, sub);
- if ( alt2->predicate!=NULL && non_covered!=NULL )
- {
- fprintf(stderr, " upon");
- preorder(non_covered);
- }
- else if ( alt2->predicate==NULL )
- {
- fprintf(stderr, " upon");
- preorder(ambig->down);
- }
- fprintf(stderr, "\n");
- }
- Tfree(non_covered);
- }
- else if ( !set_nil(alt1->fset[1]) )
- {
- set delta, non_covered;
- delta = set_and(alt1->fset[1], alt2->fset[1]);
- non_covered = set_dif(delta, covered_set(alt1->predicate));
- if ( set_deg(non_covered)>0 && WarningLevel>1 )
- {
- fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line);
- fprintf(stderr, " warning: alt %d %shas no predicate to resolve ambiguity",
- alt1->altnum, sub);
- if ( alt1->predicate!=NULL )
- {
- fprintf(stderr, " upon ");
- s_fprT(stderr, non_covered);
- }
- fprintf(stderr, "\n");
- }
- set_free( non_covered );
- non_covered = set_dif(delta, covered_set(alt2->predicate));
- if ( set_deg(non_covered)>0 && WarningLevel>1 )
- {
- fprintf(stderr, ErrHdr, FileStr[alt2->file], alt2->line);
- fprintf(stderr, " warning: alt %d %shas no predicate to resolve ambiguity",
- alt2->altnum, sub);
- if ( alt2->predicate!=NULL )
- {
- fprintf(stderr, " upon ");
- s_fprT(stderr, non_covered);
- }
- fprintf(stderr, "\n");
- }
- set_free( non_covered );
- set_free( delta );
- }
- else fatal_internal("productions have no lookahead in predicate checking routine");
-}
-
-#ifdef __USE_PROTOS
-void MR_doPredicatesHelp(int inGuessBlock,Junction *alt1,Junction *alt2,int jtype,char *sub)
-#else
-void MR_doPredicatesHelp(inGuessBlock,alt1,alt2,jtype,sub)
- int inGuessBlock;
- Junction *alt1;
- Junction *alt2;
- int jtype;
- char *sub;
-#endif
-{
- Predicate *p1;
- Predicate *p2;
-
- Junction *parentRule=MR_nameToRuleBlk(alt1->rname);
-
- if (inGuessBlock && WarningLevel <= 1) return;
-
- /* let antlr give the usual error message */
-
- if (alt1->predicate == NULL && alt2->predicate == NULL) return;
-
- if ( (jtype == RuleBlk || jtype == aSubBlk)
- && (alt1->predicate == NULL && alt2->predicate != NULL)) {
- fprintf(stderr, ErrHdr, FileStr[parentRule->file],parentRule->line);
- fprintf(stderr," warning: alt %d line %d and alt %d line %d of %s\n%s%s%s",
- alt1->altnum,
- alt1->line,
- alt2->altnum,
- alt2->line,
- sub,
- " These alts have ambig lookahead sequences resolved by a predicate for\n",
- " the second choice. The second choice may not be reachable.\n",
- " You may want to use a complementary predicate or rearrange the alts\n"
- );
- return;
- };
-
- /* first do the easy comparison. then do the hard one */
-
- if (MR_comparePredicates(alt1->predicate,alt2->predicate)) {
-
- if (jtype == aLoopBegin || jtype == aPlusBlk ) {
-
- /* I'm not sure this code is reachable.
- Predicates following a (...)+ or (...)* block are probably
- considered validation predicates and therefore not
- participate in the predication expression
- */
-
- fprintf(stderr, ErrHdr,FileStr[parentRule->file],parentRule->line);
- fprintf(stderr," warning: %s of %s in rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s",
- "the predicates used to disambiguate optional/exit paths of ",
- sub,
- CurRule,
- FileStr[alt1->file],
- alt1->altnum,
- alt1->line,
- alt2->altnum,
- alt2->line,
- " are identical and have no resolving power\n");
- } else {
- fprintf(stderr, ErrHdr, FileStr[parentRule->file], parentRule->line);
- fprintf(stderr," warning: %s rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s",
- "the predicates used to disambiguate",
- CurRule,
- FileStr[alt1->file],
- alt1->altnum,
- alt1->line,
- alt2->altnum,
- alt2->line,
- " are identical and have no resolving power\n");
- };
- } else {
- p1=predicate_dup_without_context(alt1->predicate);
- p1=MR_unfold(p1);
- MR_clearPredEntry(p1);
- MR_simplifyInverted(p1,0);
- p1=MR_predSimplifyALL(p1);
- p2=predicate_dup_without_context(alt2->predicate);
- p2=MR_unfold(p2);
- MR_clearPredEntry(p2);
- MR_simplifyInverted(p2,0);
- p2=MR_predSimplifyALL(p2);
- if (MR_comparePredicates(p1,p2)) {
- if (jtype == aLoopBegin || jtype == aPlusBlk ) {
- fprintf(stderr, ErrHdr, FileStr[parentRule->file], parentRule->line);
- fprintf(stderr," warning: %s of %s in rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s%s",
- "the predicates used to disambiguate optional/exit paths of ",
- sub,
- CurRule,
- FileStr[alt1->file],
- alt1->altnum,
- alt1->line,
- alt2->altnum,
- alt2->line,
- " are identical when compared without context and may have no\n",
- " resolving power for some lookahead sequences.\n");
- } else {
- fprintf(stderr, ErrHdr, FileStr[parentRule->file], parentRule->line);
- fprintf(stderr," warning: %s rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s%s",
- "the predicates used to disambiguate",
- CurRule,
- FileStr[alt1->file],
- alt1->altnum,
- alt1->line,
- alt2->altnum,
- alt2->line,
- " are identical when compared without context and may have no\n",
- " resolving power for some lookahead sequences.\n");
- };
- if (InfoP) {
- fprintf(output,"\n#if 0\n\n");
- fprintf(output,"The following predicates are identical when compared without\n");
- fprintf(output," lookahead context information. For some ambiguous lookahead\n");
- fprintf(output," sequences they may not have any power to resolve the ambiguity.\n");
- fprintf(output,"\n");
-
- fprintf(output,"Choice 1: %s alt %d line %d file %s\n\n",
- MR_ruleNamePlusOffset( (Node *) alt1),
- alt1->altnum,
- alt1->line,
- FileStr[alt1->file]);
- fprintf(output," The original predicate for choice 1 with available context information:\n\n");
- MR_dumpPred1(2,alt1->predicate,1);
- fprintf(output," The predicate for choice 1 after expansion (but without context information):\n\n");
- MR_dumpPred1(2,p1,0);
- if (p1 == NULL) {
- Predicate *phelp;
- fprintf(output," The predicate for choice 1 after expansion (but before simplification)\n\n");
- phelp=predicate_dup_without_context(alt1->predicate);
- phelp=MR_unfold(phelp);
- MR_clearPredEntry(phelp);
- MR_simplifyInverted(phelp,0);
- phelp=MR_predSimplifyALLX(phelp,1);
- MR_dumpPred1(2,phelp,0);
- predicate_free(phelp);
- };
- fprintf(output,"\n");
-
- fprintf(output,"Choice 2: %s alt %d line %d file %s\n\n",
- MR_ruleNamePlusOffset( (Node *) alt2),
- alt2->altnum,
- alt2->line,
- FileStr[alt2->file]);
- fprintf(output," The original predicate for choice 2 with available context information:\n\n");
- MR_dumpPred1(1,alt2->predicate,1);
- fprintf(output," The predicate for choice 2 after expansion (but without context information):\n\n");
- MR_dumpPred1(1,p2,0);
- if (p2 == NULL) {
- Predicate *phelp;
- fprintf(output," The predicate for choice 2 after expansion (but before simplification)\n\n");
- phelp=predicate_dup_without_context(alt2->predicate);
- phelp=MR_unfold(phelp);
- MR_clearPredEntry(phelp);
- MR_simplifyInverted(phelp,0);
- phelp=MR_predSimplifyALLX(phelp,1);
- MR_dumpPred1(2,phelp,0);
- predicate_free(phelp);
- };
- fprintf(output,"\n#endif\n");
- };
- } else if (MR_secondPredicateUnreachable(p1,p2)) {
- if (jtype == aLoopBegin || jtype == aPlusBlk ) {
- fprintf(stderr, ErrHdr, FileStr[parentRule->file], parentRule->line);
- fprintf(stderr," warning: %s of %s in rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s%s",
- "the predicate used to disambiguate the first choice of the optional/exit paths of ",
- sub,
- CurRule,
- FileStr[alt1->file],
- alt1->altnum,
- alt1->line,
- alt2->altnum,
- alt2->line,
- " appears to \"cover\" the second predicate when compared without context.\n",
- " The second predicate may have no resolving power for some lookahead sequences.\n");
- } else {
- fprintf(stderr, ErrHdr, FileStr[parentRule->file], parentRule->line);
- fprintf(stderr," warning: %s rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s%s",
- "the predicate used to disambiguate the first choice of",
- CurRule,
- FileStr[alt1->file],
- alt1->altnum,
- alt1->line,
- alt2->altnum,
- alt2->line,
- " appears to \"cover\" the second predicate when compared without context.\n",
- " The second predicate may have no resolving power for some lookahead sequences.\n");
- };
- if (InfoP) {
- fprintf(output,"\n#if 0\n\n");
- fprintf(output,"The first predicate appears to \"cover\" the second predicate when they\n");
- fprintf(output," are compared without lookahead context information. For some ambiguous\n");
- fprintf(output," lookahead sequences the second predicate may not have any power to\n");
- fprintf(output," resolve the ambiguity.\n");
- fprintf(output,"\n");
- fprintf(output,"Choice 1: %s alt %d line %d file %s\n\n",
- MR_ruleNamePlusOffset( (Node *) alt1),
- alt1->altnum,
- alt1->line,
- FileStr[alt1->file]);
- fprintf(output," The original predicate for choice 1 with available context information:\n\n");
- MR_dumpPred1(2,alt1->predicate,1);
- fprintf(output," The predicate for choice 1 after expansion (but without context information):\n\n");
- MR_dumpPred1(2,p1,0);
- if (p1 == NULL) {
- Predicate *phelp;
- fprintf(output," The predicate for choice 1 after expansion (but before simplification)\n\n");
- phelp=predicate_dup_without_context(alt1->predicate);
- phelp=MR_unfold(phelp);
- MR_clearPredEntry(phelp);
- MR_simplifyInverted(phelp,0);
- phelp=MR_predSimplifyALLX(phelp,1);
- MR_dumpPred1(2,phelp,0);
- predicate_free(phelp);
- };
- fprintf(output,"\n");
-
- fprintf(output,"Choice 2: %s alt %d line %d file %s\n\n",
- MR_ruleNamePlusOffset( (Node *) alt2),
- alt2->altnum,
- alt2->line,
- FileStr[alt2->file]);
- fprintf(output," The original predicate for choice 2 with available context information:\n\n");
- MR_dumpPred1(1,alt2->predicate,1);
- fprintf(output," The predicate for choice 2 after expansion (but without context information):\n\n");
- MR_dumpPred1(1,p2,0);
- if (p2 == NULL) {
- Predicate *phelp;
- fprintf(output," The predicate for choice 2 after expansion (but before simplification)\n\n");
- phelp=predicate_dup_without_context(alt2->predicate);
- phelp=MR_unfold(phelp);
- MR_clearPredEntry(phelp);
- MR_simplifyInverted(phelp,0);
- phelp=MR_predSimplifyALLX(phelp,1);
- MR_dumpPred1(2,phelp,0);
- predicate_free(phelp);
- };
- fprintf(output,"\n#endif\n");
- };
- };
- predicate_free(p1);
- predicate_free(p2);
- };
-}
-
-static int totalOverflow=0; /* MR9 */
-
-void
-#ifdef __USE_PROTOS
-HandleAmbiguity( Junction *block, Junction *alt1, Junction *alt2, int jtype )
-#else
-HandleAmbiguity( block, alt1, alt2, jtype )
-Junction *block;
-Junction *alt1;
-Junction *alt2;
-int jtype;
-#endif
-{
- unsigned **ftbl;
- set *fset, b;
- int i, numAmbig,n2;
- Tree *ambig=NULL, *t, *u;
- char *sub = "";
- long n;
- int thisOverflow=0; /* MR9 */
- long set_deg_value; /* MR10 */
- long threshhold; /* MR10 */
-
- require(block!=NULL, "NULL block");
- require(block->ntype==nJunction, "invalid block");
-
- /* These sets are used to constrain LL_k set, but are made CLL_k long anyway */
- fset = (set *) calloc(CLL_k+1, sizeof(set));
- require(fset!=NULL, "cannot allocate fset");
- ftbl = (unsigned **) calloc(CLL_k+1, sizeof(unsigned *));
- require(ftbl!=NULL, "cannot allocate ftbl");
-
- /* create constraint table and count number of possible ambiguities (use<=LL_k) */
- for (n=1,i=1; i<=CLL_k; i++)
- {
- b = set_and(alt1->fset[i], alt2->fset[i]);
-/* MR9 */ set_deg_value = set_deg(b);
-/* MR10 */ if (n > 0) {
-/* MR10 */ threshhold = LONG_MAX / n;
-/* MR10 */ if (set_deg_value <= threshhold) {
-/* MR10 */ n *= set_deg_value;
-/* MR10 */ } else {
-/* MR10 */ n=LONG_MAX;
-/* MR9 */ if (totalOverflow == 0) {
-#if 0
- /* MR10 comment this out because it just makes users worry */
-
-/* MR9 */ warnNoFL("Overflow in computing number of possible ambiguities in HandleAmbiguity\n");
-#endif
-/* MR9 */ };
-/* MR9 */ thisOverflow++;
-/* MR9 */ totalOverflow++;
-/* MR9 */ };
-/* MR10 */ } else {
-/* MR10 */ n *= set_deg_value;
-/* MR9 */ };
- fset[i] = set_dup(b);
- ftbl[i] = set_pdq(b);
- set_free(b);
- }
-
- switch ( jtype )
- {
- case aSubBlk: sub = "of (..) "; break;
- case aOptBlk: sub = "of {..} "; break;
- case aLoopBegin: sub = "of (..)* "; break;
- case aLoopBlk: sub = "of (..)* "; break;
- case aPlusBlk: sub = "of (..)+ "; break;
- case RuleBlk: sub = "of the rule itself "; break;
- default : sub = ""; break;
- }
-
- /* If the block is marked as a compressed lookahead only block, then
- * simply return; ambiguity warning is given only at warning level 2.
- */
- if ( block->approx>0 )
- {
- if ( ParseWithPredicates )
- {
- if (alt1->predicate != NULL) predicate_free(alt1->predicate); /* MR12 */
- if (alt2->predicate != NULL) predicate_free(alt2->predicate); /* MR12 */
-
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- alt1->predicate = MR_find_predicates_and_supp((Node *)alt1->p1);
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- require (MR_predicate_context_completed(alt1->predicate),"predicate alt 1 not completed");
- alt1->predicate=MR_predSimplifyALL(alt1->predicate);
-
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- alt2->predicate = MR_find_predicates_and_supp((Node *)alt2->p1);
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- require (MR_predicate_context_completed(alt2->predicate),"predicate alt 2 not completed");
- alt2->predicate=MR_predSimplifyALL(alt2->predicate);
-
- MR_doPredicatesHelp(0,alt1,alt2,jtype,sub);
-
- if ( HoistPredicateContext
- && (alt1->predicate!=NULL||alt2->predicate!=NULL) )
- {
- verify_context(alt1->predicate);
- verify_context(alt2->predicate);
- }
-
- if ( HoistPredicateContext
- && (alt1->predicate!=NULL||alt2->predicate!=NULL)
- && WarningLevel>1 )
- ensure_predicates_cover_ambiguous_lookahead_sequences(alt1, alt2, sub, ambig);
- }
-
- if ( WarningLevel>1 )
- {
- fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line);
- if ( jtype == aLoopBegin || jtype == aPlusBlk )
- fprintf(stderr, " warning: optional/exit path and alt(s) %sambiguous upon", sub);
- else
- fprintf(stderr, " warning(approx): alts %d and %d %sambiguous upon",
- alt1->altnum, alt2->altnum, sub);
- dumpAmbigMsg(fset, stderr, 0);
- MR_traceAmbSource(fset,alt1,alt2);
- }
- for (i=1; i<=CLL_k; i++) set_free( fset[i] );
- free((char *)fset);
- for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] );
- free((char *)ftbl);
- return;
- }
-
- /* if all sets have degree 1 for k<LL_k, then must be ambig upon >=1 permutation;
- * don't bother doing full LL(k) analysis.
- * (This "if" block handles the LL(1) case)
- */
-
- n2 = 0;
- for (i=1; i<LL_k; i++) n2 += set_deg(alt1->fset[i])+set_deg(alt2->fset[i]);
-
- /* here STARTS the special case in which the lookahead sets for alt1 and alt2
- all have degree 1 for k<LL_k (including LL_k=1)
- */
-
- if ( n2==2*(LL_k-1) )
- {
-
- /* TJP: added to fix the case where LL(1) and syntactic predicates didn't
- * work. It now recognizes syntactic predicates, but does not like combo:
- * LL(1)/syn/sem predicates. (10/24/93)
- */
-
- if ( first_item_is_guess_block_extra((Junction *)alt1->p1)!=NULL )
- {
- if ( WarningLevel==1 )
- {
- for (i=1; i<=CLL_k; i++) set_free( fset[i] );
- free((char *)fset);
- for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] );
- free((char *)ftbl);
- return;
- }
-
- fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line);
- if ( jtype == aLoopBegin || jtype == aPlusBlk )
- fprintf(stderr, " warning: optional/exit path and alt(s) %sambiguous upon", sub);
- else
- fprintf(stderr, " warning: alts %d and %d %sambiguous upon",
- alt1->altnum, alt2->altnum, sub);
- dumpAmbigMsg(fset, stderr, 0);
- MR_traceAmbSource(fset,alt1,alt2);
- }
-
- ambig = NULL;
- if ( LL_k>1 ) ambig = make_tree_from_sets(alt1->fset, alt2->fset);
- if ( ParseWithPredicates )
- {
- if (alt1->predicate != NULL) predicate_free(alt1->predicate); /* MR12 */
- if (alt2->predicate != NULL) predicate_free(alt2->predicate); /* MR12 */
-
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- alt1->predicate = MR_find_predicates_and_supp((Node *)alt1->p1);
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- require (MR_predicate_context_completed(alt1->predicate),"predicate alt 1 not completed");
- alt1->predicate=MR_predSimplifyALL(alt1->predicate);
-
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- alt2->predicate = MR_find_predicates_and_supp((Node *)alt2->p1);
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- require (MR_predicate_context_completed(alt2->predicate),"predicate alt 2 not completed");
- alt2->predicate=MR_predSimplifyALL(alt2->predicate);
-
- MR_doPredicatesHelp(0,alt1,alt2,jtype,sub);
-
- if ( HoistPredicateContext && (alt1->predicate!=NULL||alt2->predicate!=NULL) )
- {
- verify_context(alt1->predicate);
- verify_context(alt2->predicate);
- }
- if (HoistPredicateContext&&(alt1->predicate!=NULL||alt2->predicate!=NULL) && WarningLevel>1)
- ensure_predicates_cover_ambiguous_lookahead_sequences(alt1, alt2, sub, ambig);
- if ( WarningLevel == 1 &&
- (alt1->predicate!=NULL||alt2->predicate!=NULL))
- {
- for (i=1; i<=CLL_k; i++) set_free( fset[i] );
- free((char *)fset);
- for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] );
- free((char *)ftbl);
- Tfree(ambig);
- return;
- }
- }
-/* end TJP (10/24/93) */
-
- fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line);
- if ( jtype == aLoopBegin || jtype == aPlusBlk )
- fprintf(stderr, " warning: optional/exit path and alt(s) %sambiguous upon", sub);
- else
- fprintf(stderr, " warning: alts %d and %d %sambiguous upon",
- alt1->altnum, alt2->altnum, sub);
- if ( elevel == 3 && LL_k>1 )
- {
- preorder(ambig);
- fprintf(stderr, "\n");
- for (i=1; i<=CLL_k; i++) set_free( fset[i] );
- free((char *)fset);
- for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] );
- free((char *)ftbl);
- Tfree(ambig);
- return;
- };
-
- Tfree(ambig);
- dumpAmbigMsg(fset, stderr, 0);
-
- /* because this is a special case in which both alt1 and alt2 have
- lookahead sets of degree 1 for k<LL_k (including k=1) the linear
- lookahead style search is adequate
- */
-
- MR_traceAmbSource(fset,alt1,alt2);
-
- for (i=1; i<=CLL_k; i++) set_free( fset[i] );
- free((char *)fset);
- for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] );
- free((char *)ftbl);
- return;
- }
-
- /* here ENDS the special case in which the lookahead sets for alt1 and alt2
- all have degree 1 for k<LL_k (including LL_k=1)
- */
-
- /* in case tree construction runs out of memory, set info to make good err msg */
-
- CurAmbigAlt1 = alt1->altnum;
- CurAmbigAlt2 = alt2->altnum;
- CurAmbigbtype = sub;
- CurAmbigfile = alt1->file;
- CurAmbigline = alt1->line;
-
- /* Don't do full LL(n) analysis if (...)? block because the block,
- by definition, defies LL(n) analysis.
- If guess (...)? block and ambiguous then don't remove anything from
- 2nd alt to resolve ambig.
- Want to predict with LL sup 1 ( n ) decision not LL(n) if guess block
- since it is much cheaper than LL(n). LL sup 1 ( n ) "covers" the LL(n)
- lookahead information.
-
- Note: LL(n) context cannot be computed for semantic predicates when
- followed by (..)?.
-
- If (..)? then we scream "AAAHHHH! No LL(n) analysis will help"
-
- Is 'ambig' always defined if we enter this if? I hope so
- because the 'ensure...()' func references it. TJP Nov 1993.
- */
-
- /* THM MR30: Instead of using first_item_is_guss_block we use
- first_item_is_guess_block_extra which will look inside a
- loop block for a guess block. In other words ( (...)? )*.
- It there is an ambiguity in this circumstance then we suppress
- the normal methods of resolving ambiguities.
- */
-
- if ( first_item_is_guess_block_extra((Junction *)alt1->p1)!=NULL )
- {
- if ( ParseWithPredicates )
- {
- if (alt1->predicate != NULL) predicate_free(alt1->predicate); /* MR12 */
- if (alt2->predicate != NULL) predicate_free(alt2->predicate); /* MR12 */
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- alt1->predicate = MR_find_predicates_and_supp((Node *)alt1->p1);
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- require (MR_predicate_context_completed(alt1->predicate),"predicate alt 1 not completed");
- alt1->predicate=MR_predSimplifyALL(alt1->predicate);
-
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- alt2->predicate = MR_find_predicates_and_supp((Node *)alt2->p1);
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- require (MR_predicate_context_completed(alt2->predicate),"predicate alt 2 not completed");
- alt2->predicate=MR_predSimplifyALL(alt2->predicate);
-
- MR_doPredicatesHelp(1,alt1,alt2,jtype,sub);
-
- if ( HoistPredicateContext && (alt1->predicate!=NULL||alt2->predicate!=NULL) )
- {
- verify_context(alt1->predicate);
- verify_context(alt2->predicate);
- }
- if ( HoistPredicateContext && (alt1->predicate!=NULL||alt2->predicate!=NULL) && WarningLevel>1 )
- ensure_predicates_cover_ambiguous_lookahead_sequences(alt1, alt2, sub, ambig);
- if ( WarningLevel==1 &&
- (alt1->predicate!=NULL||alt2->predicate!=NULL))
- {
- for (i=1; i<=CLL_k; i++) set_free( fset[i] );
- free((char *)fset);
- for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] );
- free((char *)ftbl);
- return;
- }
- }
-
- if ( WarningLevel>1 )
- {
- fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line);
- if ( jtype == aLoopBegin || jtype == aPlusBlk )
- fprintf(stderr, " warning: optional/exit path and alt(s) %sambiguous upon", sub);
- else
- fprintf(stderr, " warning: alts %d and %d %sambiguous upon",
- alt1->altnum, alt2->altnum, sub);
- dumpAmbigMsg(fset, stderr, 0);
- MR_traceAmbSource(fset,alt1,alt2);
- }
-
- for (i=1; i<=CLL_k; i++) set_free( fset[i] );
- free((char *)fset);
- for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] );
- free((char *)ftbl);
- return;
- }
-
- /* Not resolved with (..)? block. Do full LL(n) analysis */
-
- /* ambig is the set of k-tuples truly in common between alt 1 and alt 2 */
- /* MR11 VerifyAmbig once used fset destructively */
-
- ambig = VerifyAmbig(alt1, alt2, ftbl, fset, &t, &u, &numAmbig);
-
- /* are all things in intersection really ambigs? */
-
- if (thisOverflow || numAmbig < n ) /* MR9 */
- {
- Tree *v;
-
- /* remove ambig permutation from 2nd alternative to resolve ambig;
- * We want to compute the set of artificial tuples, arising from
- * LL sup 1 (n) compression, that collide with real tuples from the
- * 2nd alternative. This is the set of "special case" tuples that
- * the LL sup 1 (n) decision template maps incorrectly.
- */
-
- /* when generating code in genExpr() it does
- *
- * if ( genExprSets(j->fset) && !genExprTree(j->ftree)) {...
- *
- * Sooooo the j->ftree is the tree of alt2
- * after removal of conflicts, not alt1 !
- */
-
- if ( ambig!=NULL )
- {
- /* at the top of ambig is an ALT node */
-
- for (v=ambig->down; v!=NULL; v=v->right)
- {
- u = trm_perm(u, v); /* remove v FROM u */
- }
-/* fprintf(stderr, "after rm alt2:"); preorder(u); fprintf(stderr, "\n");*/
- }
- Tfree( t );
- alt1->ftree = tappend(alt1->ftree, u);
- alt1->ftree = tleft_factor(alt1->ftree);
- }
-
- if ( ambig==NULL )
- {
- for (i=1; i<=CLL_k; i++) set_free( fset[i] );
- free((char *)fset);
- for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] );
- free((char *)ftbl);
- return;
- }
-
- ambig = tleft_factor(ambig);
-
-/* TJP:
- * At this point, we surely have an LL(k) ambiguity. Check for predicates
- */
- if ( ParseWithPredicates )
- {
- if (alt1->predicate != NULL) predicate_free(alt1->predicate); /* MR12 */
- if (alt2->predicate != NULL) predicate_free(alt2->predicate); /* MR12 */
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- alt1->predicate = MR_find_predicates_and_supp((Node *)alt1->p1);
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- require (MR_predicate_context_completed(alt1->predicate),"predicate alt 1 not completed");
- alt1->predicate=MR_predSimplifyALL(alt1->predicate);
-
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- alt2->predicate = MR_find_predicates_and_supp((Node *)alt2->p1);
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- require (MR_predicate_context_completed(alt2->predicate),"predicate alt 2 not completed");
- alt2->predicate=MR_predSimplifyALL(alt2->predicate);
-
- MR_doPredicatesHelp(0,alt1,alt2,jtype,sub);
-
- if ( HoistPredicateContext && (alt1->predicate!=NULL||alt2->predicate!=NULL) )
- {
- verify_context(alt1->predicate);
- verify_context(alt2->predicate);
- }
- if ( HoistPredicateContext && (alt1->predicate!=NULL||alt2->predicate!=NULL) && WarningLevel>1 )
- ensure_predicates_cover_ambiguous_lookahead_sequences(alt1, alt2, sub, ambig);
- if ( WarningLevel==1 &&
- (alt1->predicate!=NULL||alt2->predicate!=NULL))
- {
-
- /* We found at least one pred for at least one of the alts;
- * If warnings are low, just return.
- */
-
- Tfree(ambig);
- for (i=1; i<=CLL_k; i++) set_free( fset[i] );
- free((char *)fset);
- for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] );
- free((char *)ftbl);
- return;
- }
- /* else we're gonna give a warning */
- }
-/* end TJP addition */
-
- fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line);
- if ( jtype == aLoopBegin || jtype == aPlusBlk )
- fprintf(stderr, " warning: optional/exit path and alt(s) %sambiguous upon", sub);
- else
- fprintf(stderr, " warning: alts %d and %d %sambiguous upon",
- alt1->altnum, alt2->altnum, sub);
- if ( elevel == 3 )
- {
- preorder(ambig->down); /* <===== k>1 ambiguity message data */
- fprintf(stderr, "\n");
- } else {
- MR_skipped_e3_report=1;
- dumpAmbigMsg(fset, stderr, 0);
- };
-
- MR_traceAmbSourceK(ambig,alt1,alt2); /* <====== k>1 ambiguity aid */
-
- Tfree(ambig);
-
- for (i=1; i<=CLL_k; i++) set_free( fset[i] );
- free((char *)fset);
- for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] );
- free((char *)ftbl);
-}
-
-/* Don't analyze alpha block of (alpha)?beta; if (alpha)? then analyze
- * Return the 1st node of the beta block if present else return j.
- */
-Junction *
-#ifdef __USE_PROTOS
-analysis_point( Junction *j )
-#else
-analysis_point( j )
-Junction *j;
-#endif
-{
- Junction *gblock;
-
- /* MR13b When there was an action/predicate preceding a guess block
- the guess block became invisible at the analysis_point.
-
- first_item_is_guess_block accepts any kind of node,
- despite the fact that the formal is a junction. But
- I don't want to have to change it all over the place
- until I know it works.
- */
-
- if ( j->ntype != nJunction && j->ntype != nAction) return j;
-
- gblock = first_item_is_guess_block((Junction *)j);
-
- if ( gblock!=NULL )
- {
- Junction *past = gblock->end;
- Junction *p;
- require(past!=NULL, "analysis_point: no end block on (...)? block");
-
- for (p=(Junction *)past->p1; p!=NULL; )
- {
- if ( p->ntype==nAction )
- {
- p=(Junction *)((ActionNode *)p)->next;
- continue;
- }
- if ( p->ntype!=nJunction )
- {
- past->alpha_beta_guess_end=1; /* MR14 */
- return (Junction *)past->p1;
- }
- if ( p->jtype==EndBlk || p->jtype==EndRule )
- {
- return j;
- }
-/* MR6 */
-/* MR6 A guess block is of the form "(alpha)? beta" or "(alpha)?". */
-/* MR6 When beta is omitted (second form) this means "(alpha)? alpha". */
-/* MR6 The program does not store another copy of alpha in this case. */
-/* MR6 During analysis when the program needs to know what follows the */
-/* MR6 guess clause. It calls this routine. */
-/* MR6 */
-/* MR6 If it is of the form "(alpha)? beta" it returns a pointer to beta.*/
-/* MR6 */
-/* MR6 If it is of the form "(alpha)?" it returns a pointer to the guess */
-/* MR6 block itself thereby reusing the junction tree. */
-/* MR6 */
-/* MR6 It works by searching the "next in sequence" chain (skipping actions) */
-/* MR6 searching for a RuleRef or Token node. (Those are the only 4 kinds */
-/* MR6 of nodes: Junctions, RuleRef, Token, and Action.) */
-/* MR6 */
-/* MR6 This won't work for the special case "(alpha)? ()" because it has no */
-/* MR6 rule references or token nodes. It eventually encounters a */
-/* MR6 junction of type EndBlk or EndRule and says to its caller: nothing */
-/* MR6 more here to analyze - must be of the form "(alpha)?". */
-/* MR6 */
-/* MR6 In the case of "(alpha)? ()" it should return a pointer to "()" */
-/* MR6 */
-/* MR6 I think. */
-/* MR6 */
- if ( p->jtype!=Generic) { /* MR6 */
- past->alpha_beta_guess_end=1; /* MR14 */
- return (Junction *)past->p1; /* MR6 */
- }; /* MR6 */
- p=(Junction *)p->p1;
- }
- }
- return j;
-}
-
-set
-#ifdef __USE_PROTOS
-First( Junction *j, int k, int jtype, int *max_k )
-#else
-First( j, k, jtype, max_k )
-Junction *j;
-int k;
-int jtype;
-int *max_k;
-#endif
-{
- Junction *alt1, *alt2;
- set a, rk, fCurBlk;
- int savek;
- int p1, p2;
-
- int save_maintainBackTrace;
-
- require(j->ntype==nJunction, "First: non junction passed");
-
- /* C o m p u t e F I R S T s e t w i t h k l o o k a h e a d */
- fCurBlk = rk = empty;
- for (alt1=j; alt1!=NULL; alt1 = (Junction *)alt1->p2 )
- {
- Junction * p = NULL;
- Junction * p1junction = NULL;
- p = analysis_point((Junction *)alt1->p1);
- p1junction = (Junction *) (alt1->p1);
-#if 0
- if (p != p1junction) {
- fprintf(stdout,"Analysis point for #%d is #%d", p1junction->seq, p->seq); /* debug */
- }
-#endif
- REACH(p, k, &rk, alt1->fset[k]);
- require(set_nil(rk), "rk != nil");
- set_free(rk);
- set_orin(&fCurBlk, alt1->fset[k]);
- }
-
- /* D e t e c t A m b i g u i t i e s */
- *max_k = 1;
- for (p1=1,alt1=j; alt1!=NULL; alt1 = (Junction *)alt1->p2, p1++)
- {
- for (p2=1,alt2=(Junction *)alt1->p2; alt2!=NULL; alt2 = (Junction *)alt2->p2, p2++)
- {
- savek = k;
- a = set_and(alt1->fset[k], alt2->fset[k]);
- while ( !set_nil(a) )
- {
- /* if we have hit the max k requested, just give warning */
- if ( j->approx==k ) {
- }
-
- if ( k==CLL_k )
- {
-#ifdef NOT_USED
-*** int save_LL_k = LL_k;
-*** int save_CLL_k = CLL_k;
-*** /* Get new LL_k from interactive feature if enabled */
-*** if ( AImode )
-*** AmbiguityDialog(j, jtype, alt1, alt2, &CLL_k, &LL_k);
-#endif
- *max_k = CLL_k;
- save_maintainBackTrace=MR_MaintainBackTrace;
- if (AlphaBetaTrace) MR_MaintainBackTrace=0;
- HandleAmbiguity(j, alt1, alt2, jtype);
- MR_MaintainBackTrace=save_maintainBackTrace;
- break;
- }
- else
- {
- Junction *p = analysis_point((Junction *)alt1->p1);
- Junction *q = analysis_point((Junction *)alt2->p1);
- k++; /* attempt ambig alts again with more lookahead */
-
- REACH(p, k, &rk, alt1->fset[k]);
- require(set_nil(rk), "rk != nil");
- REACH(q, k, &rk, alt2->fset[k]);
- require(set_nil(rk), "rk != nil");
- set_free(a);
- a = set_and(alt1->fset[k], alt2->fset[k]);
- if ( k > *max_k ) *max_k = k;
- }
- }
- set_free(a);
- k = savek;
- }
- }
-
- return fCurBlk;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c
deleted file mode 100644
index 7f686a53d5..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c
+++ /dev/null
@@ -1,2250 +0,0 @@
-/*
- * fset2.c
- *
- * Compute FIRST sets for full LL(k)
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include "pcctscfg.h"
-#include <stdlib.h>
-
-#ifdef PCCTS_USE_STDARG
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#include "dlgdef.h"
-
-/* ick! globals. Used by permute() to track which elements of a set have been used */
-
-static int *findex;
-set *fset; /* MR11 make global */
-static unsigned **ftbl;
-static set *constrain; /* pts into fset. constrains tToken() to 'constrain' */
-int ConstrainSearch;
-int maxk; /* set to initial k upon tree construction request */
- /* MR11 make global */
-static Tree *FreeList = NULL;
-
-#ifdef __USE_PROTOS
-static int tmember_of_context(Tree *, Predicate *);
-#else
-static int tmember_of_context();
-#endif
-
-#if TREE_DEBUG
-set set_of_tnodes_in_use;
-int stop_on_tnode_seq_number=(-1); /* (-1) to disable */
-#endif
-
-/* Do root
- * Then each sibling
- */
-
-void
-#ifdef __USE_PROTOS
-preorder( Tree *tree )
-#else
-preorder( tree )
-Tree *tree;
-#endif
-{
- if ( tree == NULL ) return;
- if ( tree->down != NULL ) fprintf(stderr, " (");
- if ( tree->token == ALT ) fprintf(stderr, " ALT");
- else fprintf(stderr, " %s", TerminalString(tree->token));
- if ( tree->token==EpToken ) fprintf(stderr, "(%d)", tree->v.rk);
- preorder(tree->down);
- if ( tree->down != NULL ) fprintf(stderr, " )");
- preorder(tree->right);
-}
-
-#ifdef __USE_PROTOS
-int MR_tree_matches_constraints(int k,set * constrain,Tree *t)
-#else
-int MR_tree_matches_constraints(k,constrain,t)
- int k;
- set * constrain;
- Tree * t;
-#endif
-{
- int i;
- Tree *u;
-
- if (k == 0) return 1;
-
- /* for testing guard predicates: if the guard tree is shorter
- than the constraint then it is a match. The reason is that
- a guard of (A B) should be equivalent to a guard of (A B . . .)
- where "." matches every token. Thus a match which runs out
- of tree before constraint is a match.
- */
-
- if (t == NULL) return 1;
- require (set_deg(constrain[0]) == 1,
- "MR_tree_matches_constraints: set_deg != 1");
- i=set_int(constrain[0]);
- if (t->token != i) return 0;
- if (k-1 == 0) return 1;
- for (u=t->down; u != NULL; u=u->right) {
- if (MR_tree_matches_constraints(k-1,&constrain[1],u)) {
- return 1;
- };
- };
- return 0;
-}
-
-/* check the depth of each primary sibling to see that it is exactly
- * k deep. e.g.;
- *
- * ALT
- * |
- * A ------- B
- * | |
- * C -- D E
- *
- * Remove all branches <= k deep.
- *
- * Added by TJP 9-23-92 to make the LL(k) constraint mechanism to work.
- */
-
-static int pruneCount=0;
-static int prunePeak=200;
-
-Tree *
-#ifdef __USE_PROTOS
-prune( Tree *t, int k )
-#else
-prune( t, k )
-Tree *t;
-int k;
-#endif
-{
- pruneCount++;
- if (pruneCount > prunePeak+100) {
- prunePeak=pruneCount;
-#if 0
-*** fprintf(stderr,"pruneCount=%d\n",pruneCount);
-/*** preorder(t); ***/
-*** fprintf(stderr,"\n",pruneCount);
-#endif
- };
- if ( t == NULL ) {
- pruneCount--;
- return NULL;
- };
- if ( t->token == ALT ) fatal_internal("prune: ALT node in FIRST tree");
- if ( t->right!=NULL ) t->right = prune(t->right, k);
- if ( k>1 )
- {
- if ( t->down!=NULL ) t->down = prune(t->down, k-1);
- if ( t->down == NULL )
- {
- Tree *r = t->right;
- t->right = NULL;
- Tfree(t);
- pruneCount--;
- return r;
- }
- }
- pruneCount--;
- return t;
-}
-
-/* build a tree (root child1 child2 ... NULL) */
-#ifdef PCCTS_USE_STDARG
-Tree *tmake(Tree *root, ...)
-#else
-Tree *tmake(va_alist)
-va_dcl
-#endif
-{
- Tree *w;
- va_list ap;
- Tree *child, *sibling=NULL, *tail=NULL;
-#ifndef PCCTS_USE_STDARG
- Tree *root;
-#endif
-
-#ifdef PCCTS_USE_STDARG
- va_start(ap, root);
-#else
- va_start(ap);
- root = va_arg(ap, Tree *);
-#endif
- child = va_arg(ap, Tree *);
- while ( child != NULL )
- {
-#ifdef DUM
- /* added "find end of child" thing TJP March 1994 */
- for (w=child; w->right!=NULL; w=w->right) {;} /* find end of child */
-#else
- w = child;
-#endif
-
- if ( sibling == NULL ) {sibling = child; tail = w;}
- else {tail->right = child; tail = w;}
- child = va_arg(ap, Tree *);
- }
-
- /* was "root->down = sibling;" */
- if ( root==NULL ) root = sibling;
- else root->down = sibling;
-
- va_end(ap);
- return root;
-}
-
-Tree *
-#ifdef __USE_PROTOS
-tnode( int tok )
-#else
-tnode( tok )
-int tok;
-#endif
-{
- Tree *p, *newblk;
- static int n=0;
-
- if ( FreeList == NULL )
- {
- /*fprintf(stderr, "tnode: %d more nodes\n", TreeBlockAllocSize);*/
- if ( TreeResourceLimit > 0 )
- {
- if ( (n+TreeBlockAllocSize) >= TreeResourceLimit )
- {
- fprintf(stderr, ErrHdr, FileStr[CurAmbigfile], CurAmbigline);
- fprintf(stderr, " hit analysis resource limit while analyzing alts %d and %d %s\n",
- CurAmbigAlt1,
- CurAmbigAlt2,
- CurAmbigbtype);
- exit(PCCTS_EXIT_FAILURE);
- }
- }
- newblk = (Tree *)calloc(TreeBlockAllocSize, sizeof(Tree));
- if ( newblk == NULL )
- {
- fprintf(stderr, ErrHdr, FileStr[CurAmbigfile], CurAmbigline);
- fprintf(stderr, " out of memory while analyzing alts %d and %d %s\n",
- CurAmbigAlt1,
- CurAmbigAlt2,
- CurAmbigbtype);
- exit(PCCTS_EXIT_FAILURE);
- }
- n += TreeBlockAllocSize;
- for (p=newblk; p<&(newblk[TreeBlockAllocSize]); p++)
- {
- p->right = FreeList; /* add all new Tree nodes to Free List */
- FreeList = p;
- }
- }
- p = FreeList;
- FreeList = FreeList->right; /* remove a tree node */
- p->right = NULL; /* zero out ptrs */
- p->down = NULL;
- p->token = tok;
-
- TnodesAllocated++; /* MR10 */
- TnodesInUse++; /* MR10 */
- if (TnodesInUse > TnodesPeak) TnodesPeak=TnodesInUse; /* MR10 */
-
-#ifdef TREE_DEBUG
- require(!p->in_use, "tnode: node in use!");
- p->in_use = 1;
- p->seq=TnodesAllocated;
- set_orel( (unsigned) TnodesAllocated,&set_of_tnodes_in_use);
- if (stop_on_tnode_seq_number == p->seq) {
- fprintf(stderr,"\n*** just allocated tnode #%d ***\n",
- stop_on_tnode_seq_number);
- };
-#endif
- return p;
-}
-
-static Tree *
-#ifdef __USE_PROTOS
-eofnode( int k )
-#else
-eofnode( k )
-int k;
-#endif
-{
- Tree *t=NULL;
- int i;
-
- for (i=1; i<=k; i++)
- {
- t = tmake(tnode((TokenInd!=NULL?TokenInd[EofToken]:EofToken)), t, NULL);
- }
- return t;
-}
-
-
-
-void
-#ifdef __USE_PROTOS
-_Tfree( Tree *t )
-#else
-_Tfree( t )
-Tree *t;
-#endif
-{
- if ( t!=NULL )
- {
-#ifdef TREE_DEBUG
- if (t->seq == stop_on_tnode_seq_number) {
- fprintf(stderr,"\n*** just freed tnode #%d ***\n",t->seq);
- };
- require(t->in_use, "_Tfree: node not in use!");
- t->in_use = 0;
- set_rm( (unsigned) t->seq,set_of_tnodes_in_use);
-#endif
- t->right = FreeList;
- FreeList = t;
- TnodesInUse--; /* MR10 */
- }
-}
-
-/* tree duplicate */
-Tree *
-#ifdef __USE_PROTOS
-tdup( Tree *t )
-#else
-tdup( t )
-Tree *t;
-#endif
-{
- Tree *u;
-
- if ( t == NULL ) return NULL;
- u = tnode(t->token);
- u->v.rk = t->v.rk;
- u->right = tdup(t->right);
- u->down = tdup(t->down);
- return u;
-}
-
-/* tree duplicate (assume tree is a chain downwards) */
-Tree *
-#ifdef __USE_PROTOS
-tdup_chain( Tree *t )
-#else
-tdup_chain( t )
-Tree *t;
-#endif
-{
- Tree *u;
-
- if ( t == NULL ) return NULL;
- u = tnode(t->token);
- u->v.rk = t->v.rk;
- u->down = tdup(t->down);
- return u;
-}
-
-Tree *
-#ifdef __USE_PROTOS
-tappend( Tree *t, Tree *u )
-#else
-tappend( t, u )
-Tree *t;
-Tree *u;
-#endif
-{
- Tree *w;
-
-/*** fprintf(stderr, "tappend(");
- *** preorder(t); fprintf(stderr, ",");
- *** preorder(u); fprintf(stderr, " )\n");
-*/
- if ( t == NULL ) return u;
- if ( t->token == ALT && t->right == NULL ) return tappend(t->down, u);
- for (w=t; w->right!=NULL; w=w->right) {;}
- w->right = u;
- return t;
-}
-
-/* dealloc all nodes in a tree */
-void
-#ifdef __USE_PROTOS
-Tfree( Tree *t )
-#else
-Tfree( t )
-Tree *t;
-#endif
-{
- if ( t == NULL ) return;
- Tfree( t->down );
- Tfree( t->right );
- _Tfree( t );
-}
-
-/* find all children (alts) of t that require remaining_k nodes to be LL_k
- * tokens long.
- *
- * t-->o
- * |
- * a1--a2--...--an <-- LL(1) tokens
- * | | |
- * b1 b2 ... bn <-- LL(2) tokens
- * | | |
- * . . .
- * . . .
- * z1 z2 ... zn <-- LL(LL_k) tokens
- *
- * We look for all [Ep] needing remaining_k nodes and replace with u.
- * u is not destroyed or actually used by the tree (a copy is made).
- */
-Tree *
-#ifdef __USE_PROTOS
-tlink( Tree *t, Tree *u, int remaining_k )
-#else
-tlink( t, u, remaining_k )
-Tree *t;
-Tree *u;
-int remaining_k;
-#endif
-{
- Tree *p;
- require(remaining_k!=0, "tlink: bad tree");
-
- if ( t==NULL ) return NULL;
- /*fprintf(stderr, "tlink: u is:"); preorder(u); fprintf(stderr, "\n");*/
- if ( t->token == EpToken && t->v.rk == remaining_k )
- {
- require(t->down==NULL, "tlink: invalid tree");
- if ( u == NULL ) {
-/* MR10 */ Tree *tt=t->right;
-/* MR10 */ _Tfree(t);
-/* MR10 */ return tt;
- };
- p = tdup( u );
- p->right = t->right;
- _Tfree( t );
- return p;
- }
- t->down = tlink(t->down, u, remaining_k);
- t->right = tlink(t->right, u, remaining_k);
- return t;
-}
-
-/* remove as many ALT nodes as possible while still maintaining semantics */
-Tree *
-#ifdef __USE_PROTOS
-tshrink( Tree *t )
-#else
-tshrink( t )
-Tree *t;
-#endif
-{
- if ( t == NULL ) return NULL;
- t->down = tshrink( t->down );
- t->right = tshrink( t->right );
- if ( t->down == NULL )
- {
- if ( t->token == ALT )
- {
- Tree *u = t->right;
- _Tfree(t);
- return u; /* remove useless alts */
- }
- return t;
- }
-
- /* (? (ALT (? ...)) s) ==> (? (? ...) s) where s = sibling, ? = match any */
- if ( t->token == ALT && t->down->right == NULL)
- {
- Tree *u = t->down;
- u->right = t->right;
- _Tfree( t );
- return u;
- }
- /* (? (A (ALT t)) s) ==> (? (A t) s) where A is a token; s,t siblings */
- if ( t->token != ALT && t->down->token == ALT && t->down->right == NULL )
- {
- Tree *u = t->down->down;
- _Tfree( t->down );
- t->down = u;
- return t;
- }
- return t;
-}
-
-Tree *
-#ifdef __USE_PROTOS
-tflatten( Tree *t )
-#else
-tflatten( t )
-Tree *t;
-#endif
-{
- if ( t == NULL ) return NULL;
- t->down = tflatten( t->down );
- t->right = tflatten( t->right );
- if ( t->down == NULL ) return t;
-
- if ( t->token == ALT )
- {
- Tree *u;
- /* find tail of children */
- for (u=t->down; u->right!=NULL; u=u->right) {;}
- u->right = t->right;
- u = t->down;
- _Tfree( t );
- return u;
- }
- return t;
-}
-
-Tree *
-#ifdef __USE_PROTOS
-tJunc( Junction *p, int k, set *rk )
-#else
-tJunc( p, k, rk )
-Junction *p;
-int k;
-set *rk;
-#endif
-{
- Tree *t=NULL, *u=NULL;
- Junction *alt;
- Tree *tail=NULL, *r;
-
-#ifdef DBG_TRAV
- fprintf(stderr, "tJunc(%d): %s in rule %s\n", k,
- decodeJType[p->jtype], ((Junction *)p)->rname);
-#endif
-
-/* MR14 */ if (AlphaBetaTrace && p->alpha_beta_guess_end) {
-/* MR14 */ warnFL(
-/* MR14 */ "not possible to compute follow set for alpha in an \"(alpha)? beta\" block. ",
-/* MR14 */ FileStr[p->file],p->line);
-/* MR14 */ MR_alphaBetaTraceReport();
-/* MR14 */ };
-
-/* MR14 */ if (p->alpha_beta_guess_end) {
-/* MR14 */ return NULL;
-/* MR14 */ }
-
- if ( p->jtype==aLoopBlk || p->jtype==RuleBlk ||
- p->jtype==aPlusBlk || p->jtype==aSubBlk || p->jtype==aOptBlk )
- {
- if ( p->jtype!=aSubBlk && p->jtype!=aOptBlk ) {
- require(p->lock!=NULL, "rJunc: lock array is NULL");
- if ( p->lock[k] ) return NULL;
- p->lock[k] = TRUE;
- }
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ if (p->jtype != Generic) MR_pointerStackPush(&MR_BackTraceStack,p);
-/* MR10 */ };
-
- TRAV(p->p1, k, rk, tail);
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ if (p->jtype != Generic) MR_pointerStackPop(&MR_BackTraceStack);
-/* MR10 */ };
-
- if ( p->jtype==RuleBlk ) {p->lock[k] = FALSE; return tail;}
- r = tmake(tnode(ALT), tail, NULL);
- for (alt=(Junction *)p->p2; alt!=NULL; alt = (Junction *)alt->p2)
- {
- /* if this is one of the added optional alts for (...)+ then break */
- if ( alt->ignore ) break;
-
- if ( tail==NULL ) {TRAV(alt->p1, k, rk, tail); r->down = tail;}
- else
- {
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ if (p->jtype != Generic) MR_pointerStackPush(&MR_BackTraceStack,p);
-/* MR10 */ };
-
- TRAV(alt->p1, k, rk, tail->right);
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ if (p->jtype != Generic) MR_pointerStackPop(&MR_BackTraceStack);
-/* MR10 */ };
- if ( tail->right != NULL ) tail = tail->right;
- }
- }
- if ( p->jtype!=aSubBlk && p->jtype!=aOptBlk ) p->lock[k] = FALSE;
-#ifdef DBG_TREES
- fprintf(stderr, "blk(%s) returns:",((Junction *)p)->rname); preorder(r); fprintf(stderr, "\n");
-#endif
- if ( r->down == NULL ) {_Tfree(r); return NULL;}
- return r;
- }
-
- if ( p->jtype==EndRule )
- {
- if ( p->halt ) /* don't want FOLLOW here? */
- {
-/**** if ( ContextGuardTRAV ) return NULL; ****/
- set_orel( (unsigned) k, rk); /* indicate this k value needed */ /* MR10 cast */
- t = tnode(EpToken);
- t->v.rk = k;
- return t;
- }
- require(p->lock!=NULL, "rJunc: lock array is NULL");
- if ( p->lock[k] ) return NULL;
- /* if no FOLLOW assume k EOF's */
- if ( p->p1 == NULL ) return eofnode(k);
- p->lock[k] = TRUE;
- }
-
-/* MR14 */ if (p->p1 != NULL && p->guess && p->guess_analysis_point == NULL) {
-/* MR14 */ Node * guess_point;
-/* MR14 */ guess_point=(Node *)analysis_point(p);
-/* MR14 */ if (guess_point == (Node *)p) {
-/* MR14 */ guess_point=p->p1;
-/* MR14 */ }
-/* MR14 */ p->guess_analysis_point=guess_point;
-/* MR14 */ }
-
- if ( p->p2 == NULL )
- {
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ if (p->jtype != Generic) MR_pointerStackPush(&MR_BackTraceStack,p);
-/* MR10 */ };
-
-/* M14 */ if (p->guess_analysis_point != NULL) {
-/* M14 */ TRAV(p->guess_analysis_point, k, rk,t);
-/* M14 */ } else {
- TRAV(p->p1, k, rk,t);
-/* M14 */ }
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ if (p->jtype != Generic) MR_pointerStackPop(&MR_BackTraceStack);
-/* MR10 */ };
-
- if ( p->jtype==EndRule ) p->lock[k]=FALSE;
- return t;
- }
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ if (p->jtype != Generic) MR_pointerStackPush(&MR_BackTraceStack,p);
-/* MR10 */ };
-
-/* M14 */ if (p->guess_analysis_point != NULL) {
-/* M14 */ TRAV(p->guess_analysis_point, k, rk,t);
-/* M14 */ } else {
- TRAV(p->p1, k, rk,t);
-/* M14 */ }
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ if (p->jtype != Generic) MR_pointerStackPop(&MR_BackTraceStack);
-/* MR10 */ };
-
- if ( p->jtype!=RuleBlk && /* MR14 */ !p->guess) TRAV(p->p2, k, rk, u);
-
- if ( p->jtype==EndRule ) p->lock[k] = FALSE;/* unlock node */
-
- if ( t==NULL ) return tmake(tnode(ALT), u, NULL);
- return tmake(tnode(ALT), t, u, NULL);
-}
-
-Tree *
-#ifdef __USE_PROTOS
-tRuleRef( RuleRefNode *p, int k, set *rk_out )
-#else
-tRuleRef( p, k, rk_out )
-RuleRefNode *p;
-int k;
-set *rk_out;
-#endif
-{
- int k2;
- Tree *t=NULL, *u=NULL;
- Junction *r;
- set rk, rk2;
- int save_halt;
- RuleEntry *q = (RuleEntry *) hash_get(Rname, p->text);
-
-#ifdef DBG_TRAV
- fprintf(stderr, "tRuleRef: %s\n", p->text);
-#endif
- if ( q == NULL )
- {
- TRAV(p->next, k, rk_out, t);/* ignore undefined rules */
- return t;
- }
- rk = rk2 = empty;
- if (RulePtr == NULL) fatal("RulePtr==NULL");
- r = RulePtr[q->rulenum];
- if ( r->lock[k] ) return NULL;
- save_halt = r->end->halt;
- r->end->halt = TRUE; /* don't let reach fall off end of rule here */
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ MR_pointerStackPush(&MR_BackTraceStack,p);
-/* MR10 */ };
-
- TRAV(r, k, &rk, t);
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ MR_pointerStackPop(&MR_BackTraceStack);
-/* MR10 */ };
-
- r->end->halt = save_halt;
-#ifdef DBG_TREES
- fprintf(stderr, "after ruleref, t is:"); preorder(t); fprintf(stderr, "\n");
-#endif
- t = tshrink( t );
- while ( !set_nil(rk) ) { /* any k left to do? if so, link onto tree */
- k2 = set_int(rk);
- set_rm(k2, rk);
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ MR_pointerStackPush(&MR_BackTraceStack,p);
-/* MR10 */ };
-
- TRAV(p->next, k2, &rk2, u);
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ MR_pointerStackPop(&MR_BackTraceStack);
-/* MR10 */ };
-
- t = tlink(t, u, k2); /* any alts missing k2 toks, add u onto end */
- Tfree(u); /* MR10 */
- }
- set_free(rk); /* rk is empty, but free it's memory */
- set_orin(rk_out, rk2); /* remember what we couldn't do */
- set_free(rk2);
- return t;
-}
-
-Tree *
-#ifdef __USE_PROTOS
-tToken( TokNode *p, int k, set *rk )
-#else
-tToken( p, k, rk )
-TokNode *p;
-int k;
-set *rk;
-#endif
-{
- Tree *t=NULL, *tset=NULL, *u;
-
- if (ConstrainSearch) {
- if (MR_AmbSourceSearch) {
- require(constrain>=fset&&constrain<=&(fset[CLL_k]),"tToken: constrain is not a valid set");
- } else {
- require(constrain>=fset&&constrain<=&(fset[LL_k]),"tToken: constrain is not a valid set");
- };
- constrain = &fset[maxk-k+1];
- }
-
-#ifdef DBG_TRAV
- fprintf(stderr, "tToken(%d): %s\n", k, TerminalString(p->token));
- if ( ConstrainSearch ) {
- fprintf(stderr, "constrain is:"); s_fprT(stderr, *constrain); fprintf(stderr, "\n");
- }
-#endif
-
- /* is it a meta token (set of tokens)? */
-
- if ( !set_nil(p->tset) )
- {
- unsigned e=0;
- set a;
- Tree *n, *tail = NULL;
-
- if ( ConstrainSearch ) {
- a = set_and(p->tset, *constrain);
- if (set_nil(a)) { /* MR10 */
- set_free(a); /* MR11 */
- return NULL; /* MR10 */
- }; /* MR10 */
- } else {
- a = set_dup(p->tset);
- };
-
- for (; !set_nil(a); set_rm(e, a))
- {
- e = set_int(a);
- n = tnode(e);
- if ( tset==NULL ) { tset = n; tail = n; }
- else { tail->right = n; tail = n; }
- }
- set_free( a );
- }
- else if ( ConstrainSearch && !set_el(p->token, *constrain) )
- {
-/* fprintf(stderr, "ignoring token %s(%d)\n", TerminalString(p->token),
- k);*/
- return NULL;
- }
- else {
- tset = tnode( p->token );
- };
-
-/* MR10 */ if (MR_MaintainBackTrace) {
-/* MR10 */ if (k == 1) {
-/* MR10 */ MR_pointerStackPush(&MR_BackTraceStack,p);
-/* MR13 */ if (MR_SuppressSearch) {
-/* MR13 */ MR_suppressSearchReport();
-/* MR13 */ } else {
-/* MR10 */ MR_backTraceReport();
-/* MR13 */ };
-/* MR10 */ MR_pointerStackPop(&MR_BackTraceStack);
-/* MR11 */ Tfree(tset);
-/* MR11 */ return NULL;
-/* MR10 */ };
-/* MR10 */ };
-
- if ( k == 1 ) return tset;
-
- if (MR_MaintainBackTrace) {
- MR_pointerStackPush(&MR_BackTraceStack,p);
- };
-
- TRAV(p->next, k-1, rk, t);
-
- if (MR_MaintainBackTrace) {
- Tfree(t);
- Tfree(tset);
- MR_pointerStackPop(&MR_BackTraceStack);
- return NULL;
- };
-
- /* here, we are positive that, at least, this tree will not contribute
- * to the LL(2) tree since it will be too shallow, IF t==NULL.
- * If doing a context guard walk, then don't prune.
- */
- if ( t == NULL && !ContextGuardTRAV ) /* tree will be too shallow */
- {
- if ( tset!=NULL ) Tfree( tset );
- return NULL;
- }
-#ifdef DBG_TREES
- fprintf(stderr, "tToken(%d)->next:",k); preorder(t); fprintf(stderr, "\n");
-#endif
-
- /* if single token root, then just make new tree and return */
- /* MR10 - set_nil(p->tset) isn't a good test because of ConstraintSearch */
-
- if (tset->right == NULL) return tmake(tset, t, NULL); /* MR10 */
-
- /* here we must make a copy of t as a child of each element of the tset;
- * e.g., "T1..T3 A" would yield ( nil ( T1 A ) ( T2 A ) ( T3 A ) )
- */
- for (u=tset; u!=NULL; u=u->right)
- {
- /* make a copy of t and hook it onto bottom of u */
- u->down = tdup(t);
- }
- Tfree( t );
-#ifdef DBG_TREES
- fprintf(stderr, "range is:"); preorder(tset); fprintf(stderr, "\n");
-#endif
- return tset;
-}
-
-Tree *
-#ifdef __USE_PROTOS
-tAction( ActionNode *p, int k, set *rk )
-#else
-tAction( p, k, rk )
-ActionNode *p;
-int k;
-set *rk;
-#endif
-{
- Tree *t=NULL;
- set *save_fset=NULL;
- int i;
-
- /* fprintf(stderr, "tAction\n"); */
-
-/* An MR_SuppressSearch is looking for things that can be
- reached even when the predicate is false.
-
- There are three kinds of predicates:
- plain: r1: <<p>>? r2
- guarded: r1: (A)? => <<p>>? r2
- ampersand style: r1: (A)? && <<p>>? r2
-
- Of the three kinds of predicates, only a guard predicate
- has things which are reachable even when the predicate
- is false. To be reachable the constraint must *not*
- match the guard.
-
-*/
-
- if (p->is_predicate && MR_SuppressSearch) {
-
- Predicate *pred=p->guardpred;
-
- if (pred == NULL) {
- t=NULL;
- goto EXIT;
- };
- constrain = &fset[maxk-k+1];
- if (pred->k == 1) {
- set dif;
- dif=set_dif(*constrain,pred->scontext[1]);
- if (set_nil(dif)) {
- set_free(dif);
- t=NULL;
- goto EXIT;
- };
- set_free(dif);
- } else {
- if (MR_tree_matches_constraints(k,constrain,pred->tcontext)) {
- t=NULL;
- goto EXIT;
- };
- }
- };
-
- /* The ampersand predicate differs from the
- other predicates because its first set
- is a subset of the first set behind the predicate
-
- r1: (A)? && <<p>>? r2 ;
- r2: A | B;
-
- In this case first[1] of r1 is A, even
- though first[1] of r2 is {A B}.
- */
-
- if (p->is_predicate && p->ampersandPred != NULL) {
-
- Predicate *pred=p->ampersandPred;
- Tree *tAND;
- Tree *tset;
-
- if (k <= pred->k) {
- if (MR_MaintainBackTrace) MR_pointerStackPush(&MR_BackTraceStack,p);
- TRAV(p->guardNodes,k,rk,t);
- if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack);
- return t;
- } else {
- require (k>1,"tAction for ampersandpred: k <= 1");
- if (ConstrainSearch) {
- if (MR_AmbSourceSearch) {
- require(constrain>=fset&&constrain<=&(fset[CLL_k]),
- "tToken: constrain is not a valid set");
- } else {
- require(constrain>=fset&&constrain<=&(fset[LL_k]),
- "tToken: constrain is not a valid set");
- };
- save_fset=(set *) calloc (CLL_k+1,sizeof(set));
- require (save_fset != NULL,"tAction save_fset alloc");
- for (i=1; i <= CLL_k ; i++) {
- save_fset[i]=set_dup(fset[i]);
- };
- if (pred->k == 1) {
- constrain = &fset[maxk-k+1];
- set_andin(constrain,pred->scontext[1]);
- if (set_nil(*constrain)) {
- t=NULL;
- goto EXIT;
- };
- } else {
- constrain = &fset[maxk-k+1];
- if (! MR_tree_matches_constraints(pred->k,constrain,pred->tcontext)) {
- t=NULL;
- goto EXIT;
- }; /* end loop on i */
- }; /* end loop on pred scontext/tcontext */
- }; /* end if on k > pred->k */
- }; /* end if on constrain search */
-
- TRAV(p->next,k,rk,t);
-
- if (t != NULL) {
- t=tshrink(t);
- t=tflatten(t);
- t=tleft_factor(t);
- if (pred->tcontext != NULL) {
- tAND=MR_computeTreeAND(t,pred->tcontext);
- } else {
- tset=MR_make_tree_from_set(pred->scontext[1]);
- tAND=MR_computeTreeAND(t,tset);
- Tfree(tset);
- };
- Tfree(t);
- t=tAND;
- };
- goto EXIT;
-
- }; /* end if on ampersand predicate */
-
- TRAV(p->next,k,rk,t);
-
-EXIT:
- if (save_fset != NULL) {
- for (i=1 ; i <= CLL_k ; i++) {
- set_free(fset[i]);
- fset[i]=save_fset[i];
- };
- free ( (char *) save_fset);
- };
- return t;
-}
-
-/* see if e exists in s as a possible input permutation (e is always a chain) */
-
-int
-#ifdef __USE_PROTOS
-tmember( Tree *e, Tree *s )
-#else
-tmember( e, s )
-Tree *e;
-Tree *s;
-#endif
-{
- if ( e==NULL||s==NULL ) return 0;
-/** fprintf(stderr, "tmember(");
-*** preorder(e); fprintf(stderr, ",");
-*** preorder(s); fprintf(stderr, " )\n");
-*/
- if ( s->token == ALT && s->right == NULL ) return tmember(e, s->down);
- if ( e->token!=s->token )
- {
- if ( s->right==NULL ) return 0;
- return tmember(e, s->right);
- }
- if ( e->down==NULL && s->down == NULL ) return 1;
- if ( tmember(e->down, s->down) ) return 1;
- if ( s->right==NULL ) return 0;
- return tmember(e, s->right);
-}
-
-/* see if e exists in s as a possible input permutation (e is always a chain);
- * Only check s to the depth of e. In other words, 'e' can be a shorter
- * sequence than s.
- */
-int
-#ifdef __USE_PROTOS
-tmember_constrained( Tree *e, Tree *s)
-#else
-tmember_constrained( e, s )
-Tree *e;
-Tree *s;
-#endif
-{
- if ( e==NULL||s==NULL ) return 0;
-/** fprintf(stderr, "tmember_constrained(");
-*** preorder(e); fprintf(stderr, ",");
-*** preorder(s); fprintf(stderr, " )\n");
-**/
- if ( s->token == ALT && s->right == NULL )
- return tmember_constrained(e, s->down);
- if ( e->token!=s->token )
- {
- if ( s->right==NULL ) return 0;
- return tmember_constrained(e, s->right);
- }
- if ( e->down == NULL ) return 1; /* if s is matched to depth of e return */
- if ( tmember_constrained(e->down, s->down) ) return 1;
- if ( s->right==NULL ) return 0;
- return tmember_constrained(e, s->right);
-}
-
-/* combine (? (A t) ... (A u) ...) into (? (A t u)) */
-Tree *
-#ifdef __USE_PROTOS
-tleft_factor( Tree *t )
-#else
-tleft_factor( t )
-Tree *t;
-#endif
-{
- Tree *u, *v, *trail, *w;
-
- /* left-factor what is at this level */
- if ( t == NULL ) return NULL;
- for (u=t; u!=NULL; u=u->right)
- {
- trail = u;
- v=u->right;
- while ( v!=NULL )
- {
- if ( u->token == v->token )
- {
- if ( u->down!=NULL )
- {
- for (w=u->down; w->right!=NULL; w=w->right) {;}
- w->right = v->down; /* link children together */
- }
- else u->down = v->down;
- trail->right = v->right; /* unlink factored node */
- _Tfree( v );
- v = trail->right;
- }
- else {trail = v; v=v->right;}
- }
- }
- /* left-factor what is below */
- for (u=t; u!=NULL; u=u->right) u->down = tleft_factor( u->down );
- return t;
-}
-
-/* remove the permutation p from t if present */
-Tree *
-#ifdef __USE_PROTOS
-trm_perm( Tree *t, Tree *p )
-#else
-trm_perm( t, p )
-Tree *t;
-Tree *p;
-#endif
-{
- /*
- fprintf(stderr, "trm_perm(");
- preorder(t); fprintf(stderr, ",");
- preorder(p); fprintf(stderr, " )\n");
- */
- if ( t == NULL || p == NULL ) return NULL;
- if ( t->token == ALT )
- {
- t->down = trm_perm(t->down, p);
- if ( t->down == NULL ) /* nothing left below, rm cur node */
- {
- Tree *u = t->right;
- _Tfree( t );
- return trm_perm(u, p);
- }
- t->right = trm_perm(t->right, p); /* look for more instances of p */
- return t;
- }
- if ( p->token != t->token ) /* not found, try a sibling */
- {
- t->right = trm_perm(t->right, p);
- return t;
- }
- t->down = trm_perm(t->down, p->down);
- if ( t->down == NULL ) /* nothing left below, rm cur node */
- {
- Tree *u = t->right;
- _Tfree( t );
- return trm_perm(u, p);
- }
- t->right = trm_perm(t->right, p); /* look for more instances of p */
- return t;
-}
-
-/* add the permutation 'perm' to the LL_k sets in 'fset' */
-void
-#ifdef __USE_PROTOS
-tcvt( set *fset, Tree *perm )
-#else
-tcvt( fset, perm )
-set *fset;
-Tree *perm;
-#endif
-{
- if ( perm==NULL ) return;
- set_orel(perm->token, fset);
- tcvt(fset+1, perm->down);
-}
-
-/* for each element of ftbl[k], make it the root of a tree with permute(ftbl[k+1])
- * as a child.
- */
-Tree *
-#ifdef __USE_PROTOS
-permute( int k, int max_k )
-#else
-permute( k, max_k )
-int k, max_k;
-#endif
-{
- Tree *t, *u;
-
- if ( k>max_k ) return NULL;
- if ( ftbl[k][findex[k]] == nil ) return NULL;
- t = permute(k+1, max_k);
- if ( t==NULL&&k<max_k ) /* no permutation left below for k+1 tokens? */
- {
- findex[k+1] = 0;
- (findex[k])++; /* try next token at this k */
- return permute(k, max_k);
- }
-
- u = tmake(tnode(ftbl[k][findex[k]]), t, NULL);
- if ( k == max_k ) (findex[k])++;
- return u;
-}
-
-/* Compute LL(k) trees for alts alt1 and alt2 of p.
- * function result is tree of ambiguous input permutations
- *
- * ALGORITHM may change to look for something other than LL_k size
- * trees ==> maxk will have to change.
- */
-Tree *
-#ifdef __USE_PROTOS
-VerifyAmbig( Junction *alt1, Junction *alt2, unsigned **ft, set *fs, Tree **t, Tree **u, int *numAmbig )
-#else
-VerifyAmbig( alt1, alt2, ft, fs, t, u, numAmbig )
-Junction *alt1;
-Junction *alt2;
-unsigned **ft;
-set *fs;
-Tree **t;
-Tree **u;
-int *numAmbig;
-#endif
-{
- set rk;
- Tree *perm, *ambig=NULL;
- Junction *p;
- int k;
- int tnodes_at_start=TnodesAllocated;
- int tnodes_at_end;
- int tnodes_used;
- set *save_fs;
- int j;
-
- save_fs=(set *) calloc(CLL_k+1,sizeof(set));
- require(save_fs != NULL,"save_fs calloc");
-
- for (j=0; j <= CLL_k ; j++) save_fs[j]=set_dup(fs[j]);
-
- maxk = LL_k; /* NOTE: for now, we look for LL_k */
- ftbl = ft;
- fset = fs;
- constrain = &(fset[1]);
- findex = (int *) calloc(LL_k+1, sizeof(int));
- if ( findex == NULL )
- {
- fprintf(stderr, ErrHdr, FileStr[CurAmbigfile], CurAmbigline);
- fprintf(stderr, " out of memory while analyzing alts %d and %d of %s\n",
- CurAmbigAlt1,
- CurAmbigAlt2,
- CurAmbigbtype);
- exit(PCCTS_EXIT_FAILURE);
- }
- for (k=1; k<=LL_k; k++) findex[k] = 0;
-
- rk = empty;
- ConstrainSearch = 1; /* consider only tokens in ambig sets */
-
- p = analysis_point((Junction *)alt1->p1);
- TRAV(p, LL_k, &rk, *t);
- *t = tshrink( *t );
- *t = tflatten( *t );
- *t = tleft_factor( *t ); /* MR10 */
- *t = prune(*t, LL_k);
- *t = tleft_factor( *t );
-
-/*** fprintf(stderr, "after shrink&flatten&prune&left_factor:"); preorder(*t); fprintf(stderr, "\n");*/
- if ( *t == NULL )
- {
-/*** fprintf(stderr, "TreeIncomplete --> no LL(%d) ambiguity\n", LL_k);*/
- Tfree( *t ); /* kill if impossible to have ambig */
- *t = NULL;
- }
-
- p = analysis_point((Junction *)alt2->p1);
-
- TRAV(p, LL_k, &rk, *u);
- *u = tshrink( *u );
- *u = tflatten( *u );
- *t = tleft_factor( *t ); /* MR10 */
- *u = prune(*u, LL_k);
- *u = tleft_factor( *u );
-/* fprintf(stderr, "after shrink&flatten&prune&lfactor:"); preorder(*u); fprintf(stderr, "\n");*/
- if ( *u == NULL )
- {
-/* fprintf(stderr, "TreeIncomplete --> no LL(%d) ambiguity\n", LL_k);*/
- Tfree( *u );
- *u = NULL;
- }
-
- for (k=1; k<=LL_k; k++) set_clr( fs[k] );
-
- ambig = tnode(ALT);
- k = 0;
- if ( *t!=NULL && *u!=NULL )
- {
- while ( (perm=permute(1,LL_k))!=NULL )
- {
-/* fprintf(stderr, "chk perm:"); preorder(perm); fprintf(stderr, "\n");*/
- if ( tmember(perm, *t) && tmember(perm, *u) )
- {
-/* fprintf(stderr, "ambig upon"); preorder(perm); fprintf(stderr, "\n");*/
-
- k++;
- perm->right = ambig->down;
- ambig->down = perm;
- tcvt(&(fs[1]), perm);
- }
- else Tfree( perm );
- }
- }
-
- for (j=0; j <= CLL_k ; j++) fs[j]=save_fs[j];
- free( (char *) save_fs);
-
- tnodes_at_end=TnodesAllocated;
- tnodes_used=tnodes_at_end - tnodes_at_start;
-
- if (TnodesReportThreshold > 0 && tnodes_used > TnodesReportThreshold) {
- fprintf(stdout,"There were %d tuples whose ambiguity could not be resolved by full lookahead\n",k);
- fprintf(stdout,"There were %d tnodes created to resolve ambiguity between:\n\n",tnodes_used);
- fprintf(stdout," Choice 1: %s line %d file %s\n",
- MR_ruleNamePlusOffset( (Node *) alt1),alt1->line,FileStr[alt1->file]);
- fprintf(stdout," Choice 2: %s line %d file %s\n",
- MR_ruleNamePlusOffset( (Node *) alt2),alt2->line,FileStr[alt2->file]);
- for (j=1; j <= CLL_k ; j++) {
- fprintf(stdout,"\n Intersection of lookahead[%d] sets:\n",j);
- MR_dumpTokenSet(stdout,2,fs[j]);
- };
- fprintf(stdout,"\n");
- };
-
- *numAmbig = k;
- if ( ambig->down == NULL ) {_Tfree(ambig); ambig = NULL;}
- free( (char *)findex );
-/* fprintf(stderr, "final ambig:"); preorder(ambig); fprintf(stderr, "\n");*/
- return ambig;
-}
-
-static Tree *
-#ifdef __USE_PROTOS
-bottom_of_chain( Tree *t )
-#else
-bottom_of_chain( t )
-Tree *t;
-#endif
-{
- if ( t==NULL ) return NULL;
- for (; t->down != NULL; t=t->down) {;}
- return t;
-}
-
-/*
- * Make a tree from k sets where the degree of the first k-1 sets is 1.
- */
-Tree *
-#ifdef __USE_PROTOS
-make_tree_from_sets( set *fset1, set *fset2 )
-#else
-make_tree_from_sets( fset1, fset2 )
-set *fset1;
-set *fset2;
-#endif
-{
- set inter;
- int i;
- Tree *t=NULL, *n, *u;
- unsigned *p,*q;
- require(LL_k>1, "make_tree_from_sets: LL_k must be > 1");
-
- /* do the degree 1 sets first */
- for (i=1; i<=LL_k-1; i++)
- {
- inter = set_and(fset1[i], fset2[i]);
- require(set_deg(inter)==1, "invalid set to tree conversion");
- n = tnode(set_int(inter));
- if (t==NULL) t=n; else tmake(t, n, NULL);
- set_free(inter);
- }
-
- /* now add the chain of tokens at depth k */
- u = bottom_of_chain(t);
- inter = set_and(fset1[LL_k], fset2[LL_k]);
- if ( (q=p=set_pdq(inter)) == NULL ) fatal_internal("Can't alloc space for set_pdq");
- /* first one is linked to bottom, then others are sibling linked */
- n = tnode(*p++);
- u->down = n;
- u = u->down;
- while ( *p != nil )
- {
- n = tnode(*p);
- u->right = n;
- u = u->right;
- p++;
- }
- free((char *)q);
-
- return t;
-}
-
-/* create and return the tree of lookahead k-sequences that are in t, but not
- * in the context of predicates in predicate list p.
- */
-Tree *
-#ifdef __USE_PROTOS
-tdif( Tree *ambig_tuples, Predicate *p, set *fset1, set *fset2 )
-#else
-tdif( ambig_tuples, p, fset1, fset2 )
-Tree *ambig_tuples;
-Predicate *p;
-set *fset1;
-set *fset2;
-#endif
-{
- unsigned **ft;
- Tree *dif=NULL;
- Tree *perm;
- set b;
- int i,k;
-
- if ( p == NULL ) return tdup(ambig_tuples);
-
- ft = (unsigned **) calloc(CLL_k+1, sizeof(unsigned *));
- require(ft!=NULL, "cannot allocate ft");
- for (i=1; i<=CLL_k; i++)
- {
- b = set_and(fset1[i], fset2[i]);
- ft[i] = set_pdq(b);
- set_free(b);
- }
- findex = (int *) calloc(LL_k+1, sizeof(int));
- if ( findex == NULL )
- {
- fatal_internal("out of memory in tdif while checking predicates");
- }
- for (k=1; k<=LL_k; k++) findex[k] = 0;
-
-#ifdef DBG_TRAV
- fprintf(stderr, "tdif_%d[", p->k);
- preorder(ambig_tuples);
- fprintf(stderr, ",");
- preorder(p->tcontext);
- fprintf(stderr, "] =");
-#endif
-
- ftbl = ft;
- while ( (perm=permute(1,p->k))!=NULL )
- {
-#ifdef DBG_TRAV
- fprintf(stderr, "test perm:"); preorder(perm); fprintf(stderr, "\n");
-#endif
- if ( tmember_constrained(perm, ambig_tuples) &&
- !tmember_of_context(perm, p) )
- {
-#ifdef DBG_TRAV
- fprintf(stderr, "satisfied upon"); preorder(perm); fprintf(stderr, "\n");
-#endif
- k++;
- if ( dif==NULL ) dif = perm;
- else
- {
- perm->right = dif;
- dif = perm;
- }
- }
- else Tfree( perm );
- }
-
-#ifdef DBG_TRAV
- preorder(dif);
- fprintf(stderr, "\n");
-#endif
-
- for (i=1; i<=CLL_k; i++) free( (char *)ft[i] );
- free((char *)ft);
- free((char *)findex);
-
- return dif;
-}
-
-/* is lookahead sequence t a member of any context tree for any
- * predicate in p?
- */
-static int
-#ifdef __USE_PROTOS
-tmember_of_context( Tree *t, Predicate *p )
-#else
-tmember_of_context( t, p )
-Tree *t;
-Predicate *p;
-#endif
-{
- for (; p!=NULL; p=p->right)
- {
- if ( p->expr==PRED_AND_LIST || p->expr==PRED_OR_LIST )
- return tmember_of_context(t, p->down);
- if ( tmember_constrained(t, p->tcontext) ) return 1;
- if ( tmember_of_context(t, p->down) ) return 1;
- }
- return 0;
-}
-
-int
-#ifdef __USE_PROTOS
-is_single_tuple( Tree *t )
-#else
-is_single_tuple( t )
-Tree *t;
-#endif
-{
- if ( t == NULL ) return 0;
- if ( t->right != NULL ) return 0;
- if ( t->down == NULL ) return 1;
- return is_single_tuple(t->down);
-}
-
-
-/* MR10 Check that a context guard contains only allowed things */
-/* MR10 (mainly token references). */
-
-#ifdef __USE_PROTOS
-int contextGuardOK(Node *p,int h,int *hmax)
-#else
-int contextGuardOK(p,h,hmax)
- Node *p;
- int h;
- int *hmax;
-#endif
-{
- Junction *j;
- TokNode *tn;
-
- if (p == NULL) return 1;
- if (p->ntype == nToken) {
- h++;
- if (h > *hmax) *hmax=h;
- tn=(TokNode *)p;
- if (tn->el_label != NULL) {
- warnFL(eMsg1("a label (\"%s\") for a context guard element is meaningless",tn->el_label),
- FileStr[p->file],p->line);
- };
- return contextGuardOK( ( (TokNode *) p)->next,h,hmax);
- } else if (p->ntype == nAction) {
- goto Fail;
- } else if (p->ntype == nRuleRef) {
- goto Fail;
- } else {
- require (p->ntype == nJunction,"Unexpected ntype");
- j=(Junction *) p;
- if (j->jtype != Generic &&
- j->jtype != aSubBlk && /* pretty sure this one is allowed */
-/**** j->jtype != aOptBlk && ****/ /* pretty sure this one is allowed */ /* MR11 not any more ! */
- j->jtype != EndBlk) {
- errFL("A context guard may not contain an option block: {...} or looping block: (...)* or (...)+",
- FileStr[p->file],p->line);
- contextGuardOK(j->p1,h,hmax);
- return 0;
- };
- /* do both p1 and p2 so use | rather than || */
- return contextGuardOK(j->p2,h,hmax) | contextGuardOK(j->p1,h,hmax);
- };
-Fail:
- errFL("A context guard may contain only Token references - guard will be ignored",
- FileStr[p->file],p->line);
- contextGuardOK( ( (ActionNode *) p)->next,h,hmax);
- return 0;
-}
-
-/*
- * Look at a (...)? generalized-predicate context-guard and compute
- * either a lookahead set (k==1) or a lookahead tree for k>1. The
- * k level is determined by the guard itself rather than the LL_k
- * variable. For example, ( A B )? is an LL(2) guard and ( ID )?
- * is an LL(1) guard. For the moment, you can only have a single
- * tuple in the guard. Physically, the block must look like this
- * --o-->TOKEN-->o-->o-->TOKEN-->o-- ... -->o-->TOKEN-->o--
- * An error is printed for any other type.
- */
-Predicate *
-#ifdef __USE_PROTOS
-computePredFromContextGuard(Graph blk,int *msgDone) /* MR10 */
-#else
-computePredFromContextGuard(blk,msgDone) /* MR10 */
- Graph blk;
- int *msgDone; /* MR10 */
-#endif
-{
- Junction *junc = (Junction *)blk.left, *p;
- Tree *t=NULL;
- Predicate *pred = NULL;
- set scontext, rk;
- int ok;
- int hmax=0;
-
- require(junc!=NULL && junc->ntype == nJunction, "bad context guard");
-
-/* MR10 Check for anything other than Tokens and generic junctions */
-
- *msgDone=0; /* MR10 */
- ok=contextGuardOK( (Node *)junc,0,&hmax); /* MR10 */
- if (! ok) { /* MR10 */
- *msgDone=1; /* MR10 */
- return NULL; /* MR10 */
- }; /* MR10 */
- if (hmax == 0) {
-errFL("guard is 0 tokens long",FileStr[junc->file],junc->line); /* MR11 */
- *msgDone=1;
- return NULL;
- };
- if (hmax > CLL_k) { /* MR10 */
-errFL(eMsgd2("guard is %d tokens long - lookahead is limited to max(k,ck)==%d", /* MR10 */
- hmax,CLL_k), /* MR10 */
- FileStr[junc->file],junc->line); /* MR10 */
- *msgDone=1; /* MR10 */
- return NULL; /* MR10 */
- }; /* MR10 */
-
- rk = empty;
- p = junc;
- pred = new_pred();
- pred->k = hmax; /* MR10 should be CLL_k, not LLK ? */
- if (hmax > 1 ) /* MR10 was LL_k */
- {
- ConstrainSearch = 0;
- ContextGuardTRAV = 1;
- TRAV(p, hmax, &rk, t); /* MR10 was LL_k */
- ContextGuardTRAV = 0;
- set_free(rk);
- t = tshrink( t );
- t = tflatten( t );
- t = tleft_factor( t );
-/*
- fprintf(stderr, "ctx guard:");
- preorder(t);
- fprintf(stderr, "\n");
-*/
- pred->tcontext = t;
- }
- else
- {
- REACH(p, 1, &rk, scontext);
- require(set_nil(rk), "rk != nil");
- set_free(rk);
-/*
- fprintf(stderr, "LL(1) ctx guard is:");
- s_fprT(stderr, scontext);
- fprintf(stderr, "\n");
-*/
- pred->scontext[1] = scontext;
- }
-
- list_add(&ContextGuardPredicateList,pred); /* MR13 */
-
- return pred;
-}
-
-/* MR13
- When the context guard is originally computed the
- meta-tokens are not known.
-*/
-
-#ifdef __USE_PROTOS
-void recomputeContextGuard(Predicate *pred)
-#else
-void recomputeContextGuard(pred)
- Predicate *pred;
-#endif
-{
- Tree * t=NULL;
- set scontext;
- set rk;
- ActionNode * actionNode;
- Junction * p;
-
- actionNode=pred->source;
- require (actionNode != NULL,"context predicate's source == NULL");
-
- p=actionNode->guardNodes;
- require (p != NULL,"context predicate's guardNodes == NULL");
-
- rk = empty;
- if (pred->k > 1 )
- {
- ConstrainSearch = 0;
- ContextGuardTRAV = 1;
- TRAV(p, pred->k, &rk, t);
- ContextGuardTRAV = 0;
- set_free(rk);
- t = tshrink( t );
- t = tflatten( t );
- t = tleft_factor( t );
- Tfree(pred->tcontext);
- pred->tcontext = t;
- }
- else
- {
- REACH(p, 1, &rk, scontext);
- require(set_nil(rk), "rk != nil");
- set_free(rk);
- set_free(pred->scontext[1]);
- pred->scontext[1] = scontext;
- }
-}
-
-/* MR11 - had enough of flags yet ? */
-
-int MR_AmbSourceSearch=0;
-int MR_AmbSourceSearchGroup=0;
-int MR_AmbSourceSearchChoice=0;
-int MR_AmbSourceSearchLimit=0;
-int MR_matched_AmbAidRule=0;
-
-static set *matchSets[2]={NULL,NULL};
-static int *tokensInChain=NULL;
-static Junction *MR_AmbSourceSearchJ[2];
-
-void MR_traceAmbSourceKclient()
-{
- int i;
- set *save_fset;
- int save_ConstrainSearch;
- set incomplete;
- Tree *t;
-
- if (matchSets[0] == NULL) {
- matchSets[0]=(set *) calloc (CLL_k+1,sizeof(set));
- require (matchSets[0] != NULL,"matchSets[0] alloc");
- matchSets[1]=(set *) calloc (CLL_k+1,sizeof(set));
- require (matchSets[1] != NULL,"matchSets[1] alloc");
- };
-
- for (i=1 ; i <= MR_AmbSourceSearchLimit ; i++) {
- set_clr(matchSets[0][i]);
- set_orel( (unsigned) tokensInChain[i],
- &matchSets[0][i]);
- set_clr(matchSets[1][i]);
- set_orel( (unsigned) tokensInChain[i],
- &matchSets[1][i]);
- };
-
- save_fset=fset;
- save_ConstrainSearch=ConstrainSearch;
-
-
-
- for (i=0 ; i < 2 ; i++) {
-
-#if 0
-** fprintf(stdout," Choice:%d Depth:%d ",i+1,MR_AmbSourceSearchLimit);
-** fprintf(stdout,"(");
-** for (j=1 ; j <= MR_AmbSourceSearchLimit ; j++) {
-** if (j != 1) fprintf(stdout," ");
-** fprintf(stdout,"%s",TerminalString(tokensInChain[j]));
-** };
-** fprintf(stdout,")\n\n");
-#endif
-
- fset=matchSets[i];
-
- MR_AmbSourceSearch=1;
- MR_MaintainBackTrace=1;
- MR_AmbSourceSearchChoice=i;
- ConstrainSearch=1;
-
- maxk = MR_AmbSourceSearchLimit;
-
- incomplete=empty;
- t=NULL;
-
- constrain = &(fset[1]);
- MR_pointerStackReset(&MR_BackTraceStack);
-
- TRAV(MR_AmbSourceSearchJ[i],maxk,&incomplete,t);
-
- Tfree(t);
-
- require (set_nil(incomplete),"MR_traceAmbSourceK TRAV incomplete");
- require (MR_BackTraceStack.count == 0,"K: MR_BackTraceStack.count != 0");
-
- set_free(incomplete);
- };
-
- ConstrainSearch=save_ConstrainSearch;
- fset=save_fset;
- MR_AmbSourceSearch=0;
- MR_MaintainBackTrace=0;
- MR_AmbSourceSearchChoice=0;
-}
-
-#ifdef __USE_PROTOS
-Tree *tTrunc(Tree *t,int depth)
-#else
-Tree *tTrunc(t,depth)
- Tree *t;
-#endif
-{
- Tree *u;
-
- require ( ! (t == NULL && depth > 0),"tree too short");
-
- if (depth == 0) return NULL;
-
- if (t->token == ALT) {
- u=tTrunc(t->down,depth);
- } else {
- u=tnode(t->token);
- u->down=tTrunc(t->down,depth-1);
- };
- if (t->right != NULL) u->right=tTrunc(t->right,depth);
- return u;
-}
-
-#ifdef __USE_PROTOS
-void MR_iterateOverTree(Tree *t,int chain[])
-#else
-void MR_iterateOverTree(t,chain)
- Tree *t;
- int chain[];
-#endif
-{
- if (t == NULL) return;
- chain[0]=t->token;
- if (t->down != NULL) {
- MR_iterateOverTree(t->down,&chain[1]);
- } else {
- MR_traceAmbSourceKclient();
- };
- MR_iterateOverTree(t->right,&chain[0]);
- chain[0]=0;
-}
-
-#ifdef __USE_PROTOS
-void MR_traceAmbSourceK(Tree *t,Junction *alt1,Junction *alt2)
-#else
-void MR_traceAmbSourceK(t,alt1,alt2)
- Tree *t;
- Junction *alt1;
- Junction *alt2;
-#endif
-{
- int i;
- int depth;
- int maxDepth;
- Tree *truncatedTree;
-
- if (MR_AmbAidRule == NULL) return;
-
- if ( ! (
- strcmp(MR_AmbAidRule,alt1->rname) == 0 ||
- strcmp(MR_AmbAidRule,alt2->rname) == 0 ||
- MR_AmbAidLine==alt1->line ||
- MR_AmbAidLine==alt2->line
- )
- ) return;
-
- MR_matched_AmbAidRule++;
-
- /* there are no token sets in trees, only in TokNodes */
-
- MR_AmbSourceSearchJ[0]=analysis_point( (Junction *) alt1->p1);
- MR_AmbSourceSearchJ[1]=analysis_point( (Junction *) alt2->p1);
-
- if (tokensInChain == NULL) {
- tokensInChain=(int *) calloc (CLL_k+1,sizeof(int));
- require (tokensInChain != NULL,"tokensInChain alloc");
- };
-
- MR_AmbSourceSearchGroup=0;
-
- fprintf(stdout,"\n");
- fprintf(stdout," Ambiguity Aid ");
- fprintf(stdout,
- (MR_AmbAidDepth <= LL_k ?
- "(-k %d -aa %s %s -aad %d)\n\n" :
- "(-k %d -aa %s %s [-k value limits -aad %d])\n\n"),
- LL_k,
- MR_AmbAidRule,
- (MR_AmbAidMultiple ? "-aam" : ""),
- MR_AmbAidDepth);
-
- for (i=0 ; i < 2 ; i++) {
- fprintf(stdout," Choice %d: %-25s line %d file %s\n",
- (i+1),
- MR_ruleNamePlusOffset( (Node *) MR_AmbSourceSearchJ[i]),
- MR_AmbSourceSearchJ[i]->line,
- FileStr[MR_AmbSourceSearchJ[i]->file]);
- };
-
- fprintf(stdout,"\n");
-
- if (MR_AmbAidDepth < LL_k) {
- maxDepth=MR_AmbAidDepth;
- } else {
- maxDepth=LL_k;
- };
-
- for (depth=1 ; depth <= maxDepth; depth++) {
- MR_AmbSourceSearchLimit=depth;
- if (depth < LL_k) {
- truncatedTree=tTrunc(t,depth);
- truncatedTree=tleft_factor(truncatedTree);
- MR_iterateOverTree(truncatedTree,&tokensInChain[1]); /* <===== */
- Tfree(truncatedTree);
- } else {
- MR_iterateOverTree(t,tokensInChain); /* <===== */
- };
- fflush(stdout);
- fflush(stderr);
- };
-
- fprintf(stdout,"\n");
- MR_AmbSourceSearch=0;
- MR_MaintainBackTrace=0;
- MR_AmbSourceSearchGroup=0;
- MR_AmbSourceSearchChoice=0;
- MR_AmbSourceSearchLimit=0;
-
-}
-
-
-/* this if for k=1 grammars only
-
- this is approximate only because of the limitations of linear
- approximation lookahead. Don't want to do a k=3 search when
- the user only specified a ck=3 grammar
-*/
-
-#ifdef __USE_PROTOS
-void MR_traceAmbSource(set *matchSets,Junction *alt1, Junction *alt2)
-#else
-void MR_traceAmbSource(matchSets,alt1,alt2)
- set *matchSets;
- Junction *alt1;
- Junction *alt2;
-#endif
-{
- set *save_fset;
- Junction *p[2];
- int i;
- int j;
- set *dup_matchSets;
- set intersection;
- set incomplete;
- set tokensUsed;
- int depth;
-
- if (MR_AmbAidRule == NULL) return;
- if ( ! (
- strcmp(MR_AmbAidRule,alt1->rname) == 0 ||
- strcmp(MR_AmbAidRule,alt2->rname) == 0 ||
- MR_AmbAidLine==alt1->line ||
- MR_AmbAidLine==alt2->line
- )
- ) return;
-
- MR_matched_AmbAidRule++;
-
- save_fset=fset;
-
- dup_matchSets=(set *) calloc(CLL_k+1,sizeof(set));
- require (dup_matchSets != NULL,"Can't allocate dup_matchSets");
-
- p[0]=analysis_point( (Junction *) alt1->p1);
- p[1]=analysis_point( (Junction *) alt2->p1);
-
- fprintf(stdout,"\n");
-
- fprintf(stdout," Ambiguity Aid ");
- fprintf(stdout,
- (MR_AmbAidDepth <= CLL_k ?
- "(-ck %d -aa %s %s -aad %d)\n\n" :
- "(-ck %d -aa %s %s [-ck value limits -aad %d])\n\n"),
- CLL_k,
- MR_AmbAidRule,
- (MR_AmbAidMultiple ? "-aam" : ""),
- MR_AmbAidDepth);
-
- for (i=0 ; i < 2 ; i++) {
- fprintf(stdout," Choice %d: %-25s line %d file %s\n",
- (i+1),
- MR_ruleNamePlusOffset( (Node *) p[i]),
- p[i]->line,FileStr[p[i]->file]);
- };
-
- for (j=1; j <= CLL_k ; j++) {
- fprintf(stdout,"\n Intersection of lookahead[%d] sets:\n",j);
- intersection=set_and(alt1->fset[j],alt2->fset[j]);
- MR_dumpTokenSet(stdout,2,intersection);
- set_free(intersection);
- };
-
- fprintf(stdout,"\n");
-
- require (1 <= MR_AmbAidDepth && MR_AmbAidDepth <= CLL_k,
- "illegal MR_AmbAidDepth");
-
- MR_AmbSourceSearchGroup=0;
- for (depth=1; depth <= MR_AmbAidDepth; depth++) {
- MR_AmbSourceSearchLimit=depth;
- for (i=0 ; i < 2 ; i++) {
-
-/*** fprintf(stdout," Choice:%d Depth:%d\n\n",i+1,depth); ***/
-
- for (j=0 ; j <= CLL_k ; j++) { dup_matchSets[j]=set_dup(matchSets[j]); };
- fset=dup_matchSets;
-
- fflush(output);
- fflush(stdout);
-
- MR_AmbSourceSearch=1;
- MR_MaintainBackTrace=1;
- MR_AmbSourceSearchChoice=i;
-
- maxk = depth;
- tokensUsed=empty;
- incomplete=empty;
-
- constrain = &(fset[1]);
- MR_pointerStackReset(&MR_BackTraceStack);
-
- REACH(p[i],depth,&incomplete,tokensUsed);
-
- fflush(output);
- fflush(stdout);
-
- require (set_nil(incomplete),"MR_traceAmbSource REACH incomplete");
- require (MR_BackTraceStack.count == 0,"1: MR_BackTraceStack.count != 0");
-
- set_free(incomplete);
- set_free(tokensUsed);
-
- for (j=0 ; j <= CLL_k ; j++) { set_free(dup_matchSets[j]); };
- };
- };
-
- fprintf(stdout,"\n");
-
- MR_AmbSourceSearch=0;
- MR_MaintainBackTrace=0;
- MR_AmbSourceSearchGroup=0;
- MR_AmbSourceSearchChoice=0;
- MR_AmbSourceSearchLimit=0;
-
- fset=save_fset;
- free ( (char *) dup_matchSets);
-}
-
-static int itemCount;
-
-void MR_backTraceDumpItemReset() {
- itemCount=0;
-}
-
-#ifdef __USE_PROTOS
-void MR_backTraceDumpItem(FILE *f,int skip,Node *n)
-#else
-void MR_backTraceDumpItem(f,skip,n)
- FILE *f;
- int skip;
- Node *n;
-#endif
-{
- TokNode *tn;
- RuleRefNode *rrn;
- Junction *j;
- ActionNode *a;
-
- switch (n->ntype) {
- case nToken:
- itemCount++; if (skip) goto EXIT;
- tn=(TokNode *)n;
- if (set_nil(tn->tset)) {
- fprintf(f," %2d #token %-23s",itemCount,TerminalString(tn->token));
- } else {
- fprintf(f," %2d #tokclass %-20s",itemCount,TerminalString(tn->token));
- };
- break;
- case nRuleRef:
- itemCount++; if (skip) goto EXIT;
- rrn=(RuleRefNode *)n;
- fprintf(f," %2d to %-27s",itemCount,rrn->text);
- break;
- case nAction:
- a=(ActionNode *)n;
- goto EXIT;
- case nJunction:
-
- j=(Junction *)n;
-
- switch (j->jtype) {
- case aSubBlk:
- if (j->guess) {
- itemCount++; if (skip) goto EXIT;
- fprintf(f," %2d %-30s",itemCount,"in (...)? block at");
- break;
- };
-/****** fprintf(f," %2d %-32s",itemCount,"in (...) block at"); *******/
-/****** break; *******/
- goto EXIT;
- case aOptBlk:
- itemCount++; if (skip) goto EXIT;
- fprintf(f," %2d %-30s",itemCount,"in {...} block");
- break;
- case aLoopBlk:
- itemCount++; if (skip) goto EXIT;
- fprintf(f," %2d %-30s",itemCount,"in (...)* block");
- break;
- case EndBlk:
- if (j->alpha_beta_guess_end) {
- itemCount++; if (skip) goto EXIT;
- fprintf(f," %2d %-30s",itemCount,"end (...)? block at");
- break;
- };
- goto EXIT;
-/****** fprintf(f," %2d %-32s",itemCount,"end of a block at"); *****/
-/****** break; *****/
- case RuleBlk:
- itemCount++; if (skip) goto EXIT;
- fprintf(f," %2d %-30s",itemCount,j->rname);
- break;
- case Generic:
- goto EXIT;
- case EndRule:
- itemCount++; if (skip) goto EXIT;
- fprintf (f," %2d end %-26s",itemCount,j->rname);
- break;
- case aPlusBlk:
- itemCount++; if (skip) goto EXIT;
- fprintf(f," %2d %-30s",itemCount,"in (...)+ block");
- break;
- case aLoopBegin:
- goto EXIT;
- };
- break;
- };
- fprintf(f," %-23s line %-4d %s\n",MR_ruleNamePlusOffset(n),n->line,FileStr[n->file]);
-EXIT:
- return;
-}
-
-
-static PointerStack previousBackTrace={0,0,NULL};
-
-#ifdef __USE_PROTOS
-void MR_backTraceReport(void)
-#else
-void MR_backTraceReport()
-#endif
-{
- int i;
- int match = 0;
- int limitMatch;
-
- Node *p;
- TokNode *tn;
- set remainder;
- int depth;
-
- /* Even when doing a k=2 search this routine can get
- called when there is only 1 token on the stack.
- This is because something like rRuleRef can change
- the search value of k from 2 to 1 temporarily.
- It does this because the it wants to know the k=1
- first set before it does a k=2 search
- */
-
- depth=0;
- for (i=0; i < MR_BackTraceStack.count ; i++) {
- p=(Node *) MR_BackTraceStack.data[i];
- if (p->ntype == nToken) depth++;
- };
-
-/* MR14 */ if (MR_AmbSourceSearch) {
-/* MR14 */ require (depth <= MR_AmbSourceSearchLimit,"depth > MR_AmbSourceSearchLimit");
-/* MR14 */ }
-
- /* MR23 THM - Traceback report was being called at the wrong time for -alpha reports */
- /* Reported by Arpad Beszedes (beszedes@inf.u-szeged.hu) */
-
- if (MR_AmbSourceSearchLimit == 0 || depth < MR_AmbSourceSearchLimit) {
- return;
- };
-
- MR_backTraceDumpItemReset();
-
- limitMatch=MR_BackTraceStack.count;
- if (limitMatch > previousBackTrace.count) {
- limitMatch=previousBackTrace.count;
- };
-
- for (match=0; match < limitMatch; match++) {
- if (MR_BackTraceStack.data[match] !=
- previousBackTrace.data[match]) {
- break;
- };
- };
-
- /* not sure at the moment why there would be duplicates */
-
- if (match != MR_BackTraceStack.count) {
-
- fprintf(stdout," Choice:%d Depth:%d Group:%d",
- (MR_AmbSourceSearchChoice+1),
- MR_AmbSourceSearchLimit,
- ++MR_AmbSourceSearchGroup);
-
- depth=0;
- fprintf(stdout," (");
- for (i=0; i < MR_BackTraceStack.count ; i++) {
- p=(Node *) MR_BackTraceStack.data[i];
- if (p->ntype != nToken) continue;
- tn=(TokNode *)p;
- if (depth != 0) fprintf(stdout," ");
- fprintf(stdout,TerminalString(tn->token));
- depth++;
- if (! MR_AmbAidMultiple) {
- if (set_nil(tn->tset)) {
- set_rm( (unsigned) tn->token,fset[depth]);
- } else {
- remainder=set_dif(fset[depth],tn->tset);
- set_free(fset[depth]);
- fset[depth]=remainder;
- };
- };
- };
- fprintf(stdout,")\n");
-
- for (i=0; i < MR_BackTraceStack.count ; i++) {
- MR_backTraceDumpItem(stdout, (i<match) ,(Node *) MR_BackTraceStack.data[i]);
- };
- fprintf(stdout,"\n");
- fflush(stdout);
-
- MR_pointerStackReset(&previousBackTrace);
-
- for (i=0; i < MR_BackTraceStack.count ; i++) {
- MR_pointerStackPush(&previousBackTrace,MR_BackTraceStack.data[i]);
- };
-
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_setConstrainPointer(set * newConstrainValue)
-#else
-void MR_setConstrainPointer(newConstrainValue)
- set * newConstrainValue;
-#endif
-{
- constrain=newConstrainValue;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c
deleted file mode 100644
index 368a96b9ac..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c
+++ /dev/null
@@ -1,4797 +0,0 @@
-/*
- * gen.c
- *
- * Generate C code (ANSI, K&R, C++)
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include "pcctscfg.h"
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#include "dlgdef.h"
-
-#define NumExprPerLine 4
-static int on1line=0;
-static set tokensRefdInBlock;
-
- /* T r a n s l a t i o n T a b l e s */
-
-/* C_Trans[node type] == pointer to function that knows how to translate that node. */
-#ifdef __cplusplus
-void (*C_Trans[NumNodeTypes+1])(...) = {
- NULL,
- NULL, /* See next table.
-Junctions have many types */
- (void (*)(...)) genRuleRef,
- (void (*)(...)) genToken,
- (void (*)(...)) genAction
- };
-#else
-void (*C_Trans[NumNodeTypes+1])() = {
- NULL,
- NULL, /* See next table.
-Junctions have many types */
- genRuleRef,
- genToken,
- genAction
- };
-#endif
-
-/* C_JTrans[Junction type] == pointer to function that knows how to translate that
- * kind of junction node.
- */
-#ifdef __cplusplus
-void (*C_JTrans[NumJuncTypes+1])(...) = {
- NULL,
- (void (*)(...)) genSubBlk,
- (void (*)(...)) genOptBlk,
- (void (*)(...)) genLoopBlk,
- (void (*)(...)) genEndBlk,
- (void (*)(...)) genRule,
- (void (*)(...)) genJunction,
- (void (*)(...)) genEndRule,
- (void (*)(...)) genPlusBlk,
- (void (*)(...)) genLoopBegin
- };
-#else
-void (*C_JTrans[NumJuncTypes+1])() = {
- NULL,
- genSubBlk,
- genOptBlk,
- genLoopBlk,
- genEndBlk,
- genRule,
- genJunction,
- genEndRule,
- genPlusBlk,
- genLoopBegin
- };
-#endif
-
-#define PastWhiteSpace(s) while (*(s) == ' ' || *(s) == '\t') {s++;}
-
-static int tabs = 0;
-
-/* MR6 Got tired of text running off page when using standard tab stops */
-
-#define TAB { int i; \
- if (TabWidth==0) { \
- for (i=0; i<tabs; i++) fputc('\t', output); \
- } else { \
- for (i=0; i<tabs*TabWidth; i++) fputc(' ',output); \
- }; \
- }
-
-static void
-#ifdef __USE_PROTOS
-tab( void )
-#else
-tab( )
-#endif
-TAB
-
-#ifdef __USE_PROTOS
-static char *tokenFollowSet(TokNode *);
-static ActionNode *findImmedAction( Node * );
-static void dumpRetValAssign(char *, char *, RuleRefNode *); /* MR30 */
-static void dumpAfterActions(FILE *output);
-static set ComputeErrorSet(Junction *, int, int);
-static void makeErrorClause(Junction *, set, int, int);
-static void DumpFuncHeader( Junction *, RuleEntry * );
-static int has_guess_block_as_first_item(Junction *);
-static int genExprSets(set *, int);
-static void genExprTree( Tree *t, int k );
-static void genExprTreeOriginal( Tree *t, int k ); /* MR10 */
-static char * findOuterHandlerLabel(ExceptionGroup *eg); /* MR7 */
-static void OutLineInfo(FILE *file,int line,char *fileName); /* MR14 */
-#else
-static char *tokenFollowSet();
-static ActionNode *findImmedAction();
-static void dumpRetValAssign();
-static void dumpAfterActions();
-static set ComputeErrorSet();
-static void makeErrorClause();
-static void DumpFuncHeader();
-static int has_guess_block_as_first_item();
-static int genExprSets();
-static void genExprTree();
-static void genExprTreeOriginal(); /* MR10 */
-static char * findOuterHandlerLabel(); /* MR7 */
-static void OutLineInfo(); /* MR14 */
-#endif
-
-#define gen(s) {tab(); fprintf(output, s);}
-#define gen1(s,a) {tab(); fprintf(output, s,a);}
-#define gen2(s,a,b) {tab(); fprintf(output, s,a,b);}
-#define gen3(s,a,b,c) {tab(); fprintf(output, s,a,b,c);}
-#define gen4(s,a,b,c,d) {tab(); fprintf(output, s,a,b,c,d);}
-#define gen5(s,a,b,c,d,e) {tab(); fprintf(output, s,a,b,c,d,e);}
-#define gen6(s,a,b,c,d,e,f) {tab(); fprintf(output, s,a,b,c,d,e,f);}
-#define gen7(s,a,b,c,d,e,f,g) {tab(); fprintf(output, s,a,b,c,d,e,f,g);}
-
-#define _gen(s) {fprintf(output, s);}
-#define _gen1(s,a) {fprintf(output, s,a);}
-#define _gen2(s,a,b) {fprintf(output, s,a,b);}
-#define _gen3(s,a,b,c) {fprintf(output, s,a,b,c);}
-#define _gen4(s,a,b,c,d){fprintf(output, s,a,b,c,d);}
-#define _gen5(s,a,b,c,d,e){fprintf(output, s,a,b,c,d,e);}
-#define _gen6(s,a,b,c,d,e,f){fprintf(output, s,a,b,c,d,e,f);}
-#define _gen7(s,a,b,c,d,e,f,g){fprintf(output, s,a,b,c,d,e,f,g);}
-
-
-/* MR11 a convenient place to set a break point */
-
-#ifdef __USE_PROTOS
-void MR_break(void)
-#else
-void MR_break()
-#endif
-{
- return;
-}
-
-/* MR10 genTraceOut(Junction *) */
-
-#ifdef __USE_PROTOS
-static void genTraceOut(Junction *q)
-#else
-static void genTraceOut(q)
- Junction *q;
-#endif
-{
- if ( TraceGen ) {
- if ( GenCC ) {gen1("zzTRACEOUT(\"%s\");\n", q->rname);}
- else gen1("zzTRACEOUT((ANTLRChar *)\"%s\");\n", q->rname);
- }
-}
-
-static void
-#ifdef __USE_PROTOS
-warn_about_using_gk_option(void)
-#else
-warn_about_using_gk_option()
-#endif
-{
- static int warned_already=0;
-
- if ( !DemandLookahead || warned_already ) return;
- warned_already = 1;
- warnNoFL("-gk option could cause trouble for <<...>>? predicates");
-}
-
-void
-#ifdef __USE_PROTOS
-freeBlkFsets( Junction *q )
-#else
-freeBlkFsets( q )
-Junction *q;
-#endif
-{
- int i;
- Junction *alt;
- require(q!=NULL, "freeBlkFsets: invalid node");
-
- for (alt=q; alt != NULL; alt= (Junction *) alt->p2 )
- {
- for (i=1; i<=CLL_k; i++) set_free(alt->fset[i]);
- }
-}
-
-/*
- * Generate a local variable allocation for each token references
- * in this block.
- */
-static void
-#ifdef __USE_PROTOS
-genTokenPointers( Junction *q )
-#else
-genTokenPointers( q )
-Junction *q;
-#endif
-{
- /* Rule refs are counted and can be referenced, but their
- * value is not set to anything useful ever.
- *
- * The ptrs are to be named _tij where i is the current level
- * and j is the element number within an alternative.
- */
- int first=1, t=0;
- set a;
- tokensRefdInBlock = q->tokrefs;
-
- if ( set_deg(q->tokrefs) == 0 ) return;
- a = set_dup(q->tokrefs);
- gen("ANTLRTokenPtr ");
- for (; !set_nil(a); set_rm(t, a))
- {
- t = set_int(a);
- if ( first ) first = 0;
- else _gen(",");
- if ( !DontCopyTokens ) _gen2("_tv%d%d,", BlkLevel, t);
- _gen2("_t%d%d", BlkLevel, t);
- if ( !DontCopyTokens ) {_gen2("= &_tv%d%d", BlkLevel, t);}
- else _gen("=NULL");
- }
- _gen(";\n");
- set_free(a);
-}
-
-static int
-#ifdef __USE_PROTOS
-hasDefaultException(ExceptionGroup *eg)
-#else
-hasDefaultException(eg)
-ExceptionGroup *eg;
-#endif
-{
- ListNode *q;
-
- for (q = eg->handlers->next; q!=NULL; q=q->next)
- {
- ExceptionHandler *eh = (ExceptionHandler *)q->elem;
- if ( strcmp("default", eh->signalname)==0 ) {
- return 1;
- }
- }
- return 0;
-}
-static void
-#ifdef __USE_PROTOS
-dumpException(ExceptionGroup *eg, int no_default_case)
-#else
-dumpException(eg, no_default_case)
-ExceptionGroup *eg;
-int no_default_case;
-#endif
-{
- char *outerLabel; /* MR7 */
- int altHandler=0; /* MR7 */
- int namedHandler=0; /* MR7 */
-
- outerLabel=findOuterHandlerLabel(eg); /* MR7 */
-
- if (eg->label != NULL) { /* MR7 */
- namedHandler=1; /* MR7 */
- } else if (eg->forRule) { /* MR7 */
- /* nothing */ /* MR20 */
- } else { /* MR7 */
- altHandler=1; /* MR7 */
- }; /* MR7 */
-
-#if 0
-** if (! eg->used) { /* MR7 */
-** warnFL("exception group never used", /* MR7 */
-** FileStr[eg->altstart->file],eg->altstart->line); /* MR7 */
-** }; /* MR7 */
-#endif
-
- if (namedHandler) { /* MR7 */
- gen1("switch ( _signal ) { /* [%s] */\n",eg->label); /* MR7 */
- } else { /* MR7 */
- gen("switch ( _signal ) {\n"); /* MR7 */
- gen("case NoSignal: break; /* MR7 */\n"); /* MR7 */
- }; /* MR7 */
- {
- ListNode *q;
- for (q = eg->handlers->next; q!=NULL; q=q->next)
- {
- ExceptionHandler *eh = (ExceptionHandler *)q->elem;
- if ( strcmp("default", eh->signalname)==0 ) {
- gen("default :\n");
- tabs++;
- dumpAction(eh->action, output, tabs, -1, 1, 1);
- gen("_signal=NoSignal; /* MR7 */\n"); /* MR7 */
- gen("break; /* MR7 */\n"); /* MR7 */
- tabs--;
- gen("}\n");
-
- /* copied from later code in dumpException */ /* MR7 */
-
- if (namedHandler) { /* MR7 */
- gen("if (_signal != NoSignal)"); /* MR7 */
- _gen1(" goto %s_handler; /* MR7 */\n",outerLabel);/* MR7 */
- } else if (altHandler) { /* MR7 */
- gen1("goto %s_handler; /* MR7 */\n",outerLabel); /* MR7 */
- };
- return;
- }
- gen1("case %s :\n", eh->signalname);
- tabs++;
- if ( eh->action != NULL )
- {
- dumpAction(eh->action, output, tabs, -1, 1, 1);
- gen("break; /* MR7 */\n"); /* MR7 */
- }
- tabs--;
- }
- }
- if ( no_default_case ) return;
-
- gen("default :\n");
- tabs++; /* MR7 */
- gen("break; /* MR7 */\n"); /* MR7 */
- tabs--; /* MR7 */
-
- tabs++;
-/***** gen("*_retsignal = _signal;\n"); *****/
-
- tabs--;
- gen("}\n");
-
- if (namedHandler) { /* MR7 */
- gen("if (_signal != NoSignal)"); /* MR7 */
- _gen1(" goto %s_handler; /* MR7 */\n",outerLabel); /* MR7 */
- } else if (altHandler) { /* MR7 */
- gen1("goto %s_handler; /* MR7 */\n",outerLabel); /* MR7 */
- };
-
-}
-
-static void
-#ifdef __USE_PROTOS
-dumpExceptions(ListNode *list)
-#else
-dumpExceptions(list)
-ListNode *list;
-#endif
-{
- ListNode *p;
-
- for (p = list->next; p!=NULL; p=p->next)
- {
- ExceptionGroup *eg = (ExceptionGroup *) p->elem;
- _gen2("%s%s_handler:\n",
- eg->label==NULL?"":eg->label,
- eg->altID==NULL?"":eg->altID);
- if ( eg->altID!=NULL ) dumpException(eg, 0);
- else {
- /* This must be the rule exception handler */
- dumpException(eg, 1);
- if ( !hasDefaultException(eg) )
- {
- gen("default :\n");
- tabs++;
- gen("zzdflthandlers(_signal,_retsignal);\n");
- tabs--;
- gen("}\n");
- }
- }
- }
-}
-
-/* For each element label that is found in a rule, generate a unique
- * Attribute (and AST pointer if GenAST) variable.
- */
-void
-#ifdef __USE_PROTOS
-genElementLabels(ListNode *list)
-#else
-genElementLabels(list)
-ListNode *list;
-#endif
-{
- int first=1;
- ListNode *p;
-
- if ( GenCC ) {gen("ANTLRTokenPtr");}
- else {gen("Attrib");}
- for (p = list->next; p!=NULL; p=p->next)
- {
- char *ep = (char *)p->elem;
- if ( first ) first = 0;
- else _gen(",");
- if ( GenCC ) {_gen1(" %s=NULL",ep);}
- else {_gen1(" %s",ep);}
- }
- _gen(";\n");
-
- if ( !GenAST ) return;
-
- first = 1;
- gen("AST");
- for (p = list->next; p!=NULL; p=p->next)
- {
- char *ep = (char *)p->elem;
- if ( first ) first = 0;
- else _gen(",");
- _gen1(" *%s_ast=NULL",ep);
- }
- _gen(";\n");
-}
-
-/*
- * Generate a local variable allocation for each token or rule reference
- * in this block.
- */
-static void
-#ifdef __USE_PROTOS
-genASTPointers( Junction *q )
-#else
-genASTPointers( q )
-Junction *q;
-#endif
-{
- int first=1, t;
- set a;
-
- a = set_or(q->tokrefs, q->rulerefs);
- if ( set_deg(a) > 0 )
- {
- gen("AST ");
- for (; !set_nil(a); set_rm(t, a))
- {
- t = set_int(a);
- if ( first ) first = 0;
- else _gen(",");
- _gen2("*_ast%d%d=NULL", BlkLevel, t);
- }
- set_free(a);
- }
- _gen(";\n");
-}
-
-static void
-#ifdef __USE_PROTOS
-BLOCK_Head( void )
-#else
-BLOCK_Head( )
-#endif
-{
- gen("{\n");
- tabs++;
- if ( !GenCC ) gen1("zzBLOCK(zztasp%d);\n", BlkLevel);
-}
-
-static void
-#ifdef __USE_PROTOS
-BLOCK_Tail( void )
-#else
-BLOCK_Tail( )
-#endif
-{
- if ( !GenCC ) gen1("zzEXIT(zztasp%d);\n", BlkLevel);
- if ( !GenCC ) gen("}\n");
- tabs--;
- gen("}\n");
-}
-
-static void
-#ifdef __USE_PROTOS
-BLOCK_Preamble( Junction *q )
-#else
-BLOCK_Preamble( q )
-Junction *q;
-#endif
-{
- ActionNode *a;
- Junction *begin;
-
- BLOCK_Head();
- if ( GenCC ) genTokenPointers(q);
- if ( GenCC&&GenAST ) genASTPointers(q);
- if ( q->jtype == aPlusBlk ) gen("int zzcnt=1;\n");
- if ( q->parm != NULL && !q->predparm ) gen1("zzaPush(%s);\n", q->parm)
- else if ( !GenCC ) gen("zzMake0;\n");
- if ( !GenCC ) gen("{\n");
- if ( q->jtype == aLoopBegin ) begin = (Junction *) ((Junction *)q->p1);
- else begin = q;
- if ( has_guess_block_as_first_item(begin) )
- {
- gen("zzGUESS_BLOCK\n");
- }
- if ( q->jtype == aLoopBegin )
- a = findImmedAction( ((Junction *)q->p1)->p1 ); /* look at aLoopBlk */
- else
- a = findImmedAction( q->p1 );
- if ( a!=NULL && !a->is_predicate) {
-/* MR21 */ if (!a->noHoist) dumpActionPlus(a, a->action, output, tabs, a->file, a->line, 1);
- a->done = 1; /* remove action. We have already handled it */
- }
-}
-
-void
-#ifdef __USE_PROTOS
-genCombinedPredTreeContextOrig( Predicate *p )
-#else
-genCombinedPredTreeContextOrig( p )
-Predicate *p;
-#endif
-{
- static set *ctx=NULL; /* genExprSets() is destructive, make copy*/
- require(p!=NULL, "can't make context tree for NULL pred tree");
-
-#ifdef DBG_PRED
- fprintf(stderr, "enter genCombinedPredTreeContextOrig(%s,0x%x) with sets:\n", p->expr, p);
- s_fprT(stderr, p->scontext[1]);
- fprintf(stderr, "\n");
-#endif
- if ( p->down == NULL )
- {
-/*** if ( p->k>1 && p->tcontext!=NULL ) ***/
- if ( p->tcontext!=NULL )
- {
- _gen("(");
- genExprTree(p->tcontext, 1);
- _gen(")");
- }
-/*** else if ( p->k==1 && set_deg(p->scontext[1])>0 ) ***/
- else if ( set_deg(p->scontext[1])>0 )
- {
- if ( ctx==NULL ) ctx = (set *)calloc(CLL_k+1, sizeof(set));
- require(ctx!=NULL, "ctx cannot allocate");
- ctx[0]=empty;
- ctx[1]=set_dup(p->scontext[1]);
- _gen("(");
- genExprSets(&(ctx[0]), p->k);
- _gen(")");
- set_free(ctx[1]);
- }
- else if ( p->expr==PRED_AND_LIST || p->expr==PRED_OR_LIST ) {
- fatal_internal("pred tree is orphan OR or AND list");
- }
- else {
- if (! HoistPredicateContext) {
- _gen(" 1 /* no context: prc is off */ ");
- } else {
- fatal_internal("pred tree context is empty");
- };
- }
- return;
- }
-
-/* MR10 - make AND just like OR */
-
- if ( p->expr == PRED_AND_LIST )
- {
- Predicate *list = p->down;
- for (; list!=NULL; list=list->right)
- {
- genCombinedPredTreeContextOrig(list);
- if ( list->right!=NULL ) _gen("|| /* MR10 was wrong */ ");
- };
- return;
- }
-
- if ( p->expr == PRED_OR_LIST )
- {
- Predicate *list = p->down;
- for (; list!=NULL; list=list->right)
- {
- genCombinedPredTreeContextOrig(list);
- if ( list->right!=NULL ) _gen("||");
- };
- return;
- };
-
- fatal("pred tree is really wacked");
-}
-
-/* [genCombinedPredTreeContext] */
-
-void
-#ifdef __USE_PROTOS
-genCombinedPredTreeContext( Predicate *p )
-#else
-genCombinedPredTreeContext( p )
-Predicate *p;
-#endif
-{
- Tree *t;
- int predDepth=0;
-
- if (0 && ! MR_usingPredNames && ! MRhoisting) {
- genCombinedPredTreeContextOrig(p);
- } else {
-/* MR13 */ MR_pred_depth(p,&predDepth);
-/* MR13 */ if (predDepth == 1) {
-/* MR13 */
-/* MR13 */ set scontext[2];
-/* MR13 */ scontext[0]=empty;
-/* MR13 */ scontext[1]=MR_compute_pred_set(p);
-/* MR13 */ if (set_nil(scontext[1])) {
-/* MR13 */ _gen(" 1 /* MR12 no context (-prc off) */ ");
-/* MR13 */ } else {
-/* MR13 */ _gen("(");
-/* MR13 */ genExprSets(&scontext[0], 1);
-/* MR13 */ set_free(scontext[1]);
-/* MR13 */ _gen(")");
-/* MR13 */ };
-
- } else {
- t=MR_compute_pred_tree_context(p);
- if (t == NULL) {
- _gen(" 1 /* MR12 no context (-prc off) */ ");
- } else {
- _gen("(");
- genExprTree(t, 1);
- Tfree(t); /* MR10 */
- _gen(")");
- };
- };
- };
-}
-
-/* [genPredTreeGate] */
-
-void
-#ifdef __USE_PROTOS
-genPredTreeGate( Predicate *p, int in_and_expr )
-#else
-genPredTreeGate( p, in_and_expr )
-Predicate *p;
-int in_and_expr;
-#endif
-{
- if ( in_and_expr )
- {
- _gen("!(");
- genCombinedPredTreeContext(p);
- _gen(")||");
- if ( p->down!=NULL ) _gen("\n");
- }
- else
- {
- _gen("(");
- genCombinedPredTreeContext(p);
- _gen(")&&");
- if ( p->down!=NULL ) _gen("\n");
- }
-}
-
-#ifdef __USE_PROTOS
-void genPredEntry(Predicate *p,int outer)
-#else
-void genPredEntry(p,outer)
- Predicate *p;
- int outer;
-#endif
-{
- int inverted=0;
- Predicate *q;
- int localOuter=outer;
- int needRP=0;
-
- if (p == NULL) return;
-
- if (p->predEntry != NULL && p->predEntry->predLiteral != NULL) {
- if (p->inverted != p->predEntry->pred->inverted) {
- _gen("! /* inverted pred */ (");
- needRP=1;
- } else {
- if (!localOuter) _gen("(");
- needRP=1;
- };
- dumpAction(p->predEntry->predLiteral,output,0,p->source->file,p->source->line,0);
- if (needRP) _gen(")");
- return;
- };
-
- inverted=p->inverted;
-
- if (inverted) {
- _gen(" ! /* inverted pred */ (");
- localOuter=1;
- };
-
- if (p->expr == PRED_OR_LIST) {
- if (!localOuter) _gen("(");
- for (q=p->down; q != NULL ; q=q->right) {
- genPredEntry(q,0);
- if (q->right != NULL) _gen(" || ");
- };
- if (!localOuter) _gen(")");
- } else if (p->expr == PRED_AND_LIST) {
- if (!localOuter) _gen("(");
- for (q=p->down; q != NULL ; q=q->right) {
- genPredEntry(q,0);
- if (q->right != NULL) _gen(" && ");
- };
- if (!localOuter) _gen(")");
- } else {
- if (!localOuter) _gen("(");
- require (p->source != NULL,"predEntry->source == NULL");
- require (p->source->inverted == 0,"dumpPredEntry p->source->inverted != 0");
- dumpAction(p->source->action,output,0,p->source->file,p->source->line,0);
- if (!localOuter) _gen(")");
- };
-
- if (inverted) {
- _gen(")");
- }
-}
-
-void
-#ifdef __USE_PROTOS
-dumpPredAction(ActionNode *anode,
- char *s,FILE *output,int tabs,int file,int line,int final_newline)
-#else
-dumpPredAction(anode,
- s,output,tabs,file,line,final_newline)
-
- ActionNode *anode;
- char *s;
- FILE *output;
- int tabs;
- int file;
- int line;
- int final_newline;
-#endif
-{
- PredEntry *predEntry=anode->predEntry;
- int inverted=anode->inverted;
- Predicate *workPred;
-
- if (predEntry == NULL) {
-
- /* inline predicate literal */
-
- require(inverted == 0,"dumpPredAction action->inverted");
- dumpAction(s,output,tabs,file,line,final_newline);
-
- } else {
-
- /* a reference to a predicate - possibly with an inverted source */
-
- if (predEntry->predLiteral != NULL) {
- if (inverted) _gen("! /* inverted pred */ (");
- dumpAction(predEntry->predLiteral,output,0,anode->file,anode->line,0);
- if (inverted) _gen(")");
- } else {
- workPred=predicate_dup(predEntry->pred);
- if (inverted) workPred->inverted=!workPred->inverted;
- genPredEntry(workPred,1);
- predicate_free(workPred);
- };
- };
-}
-
-/* [genPred] */
-
-void
-#ifdef __USE_PROTOS
-genPred(Predicate *p, Node *j,int suppress_sva)
-#else
-genPred(p,j,suppress_sva)
- Predicate *p;
- Node *j;
- int suppress_sva;
-#endif
-{
- if ( FoundException && !suppress_sva) {_gen("(_sva=(");} /* MR11 suppress_sva */
- else {_gen("(");}
- if ( GenLineInfo && j->file != -1 ) _gen("\n");
- if (p->source != NULL && p->source->ampersandPred != NULL) {
- if (p->source->ampersandPred->k == 1) {
-
- set ctx[2];
-
- ctx[0]=empty;
- ctx[1]=set_dup(p->source->ampersandPred->scontext[1]);
-
- _gen("(");
- genExprSets(&(ctx[0]), p->k);
- _gen(") && ");
- set_free(ctx[1]);
- } else {
- _gen("( ");
- genExprTree(p->source->ampersandPred->tcontext,1);
- _gen(" ) && ");
- };
- };
-
- dumpPredAction((ActionNode *)p->source,
- p->expr, output, 0, -1 /*indicates no line info*/, j->line, 0);
-
- if ( FoundException && !suppress_sva) /* MR11 suppress_sva */
- {_gen("),_sva)");} /* MR10 - get red of "meant ==" messages */
- else {_gen(")");}
-}
-
-void
-#ifdef __USE_PROTOS
-MR_distinctORcontextOpt(Predicate *p,Node *j,int in_and_expr)
-#else
-MR_distinctORcontextOpt(p,j,in_and_expr)
- Predicate *p;
- Node *j;
- int in_and_expr;
-#endif
-{
- Predicate *q;
-
- _gen(" /* MR10 Distinct OR context optimization */ \n");
-
- if (in_and_expr) {
- gen("zzpf=0,\n");
- for (q=p->down; q != NULL; q=q->right) {
- gen("( ");
- genCombinedPredTreeContext(q);
- _gen(" && (zzpf=1, ");
- genPred(q,j,0);
- _gen(" )) ||\n");
- };
- gen("!zzpf)");
- } else {
- require (0,
- "MR_distinctORcontextOpt: can't get here when using MR_predSimplify");
-#if 0
-** for (q=p->down; q != NULL; q=q->right) {
-** gen("( ");
-** genCombinedPredTreeContext(q);
-** _gen(" && ");
-** genPred(q,j);
-** if (q->right != NULL) {
-** _gen(" ) ||\n");
-** };
-** };
-** gen(")");
-#endif
- };
-}
-
-void
-#ifdef __USE_PROTOS
-genPredTreeOrig( Predicate *p, Node *j, int in_and_expr )
-#else
-genPredTreeOrig( p, j, in_and_expr )
-Predicate *p;
-Node *j;
-int in_and_expr;
-#endif
-{
-
-/* MR10 */ int allHaveContext=1;
-/* MR10 */ int noneHaveContext=1;
-
-/* MR10 */ MR_predContextPresent(p,&allHaveContext,&noneHaveContext);
-
- if ( ! noneHaveContext ) /* MR10 context guards ignored when -prc off */
- {
- _gen("(");
- genPredTreeGate(p, in_and_expr);
- }
-
- /* if leaf node, just gen predicate */
-
- if ( p->down==NULL )
- {
- genPred(p,j,0);
- if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */
- return;
- }
-
- /* if AND list, do both preds (only two possible) */
- if ( p->expr == PRED_AND_LIST )
- {
-#if 0
-** _gen("(");
-** genPredTreeOrig(p->down, j, 1);
-** _gen("&&");
-** genPredTreeOrig(p->down->right, j, 1);
-** _gen(")");
-** if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */
-** return;
-#endif
- /* MR11 - make it work with AND with more than two children - like OR */
-
- Predicate *list;
- _gen("(");
- list = p->down;
- for (; list!=NULL; list=list->right)
- {
- genPredTreeOrig(list, j, 1);
- if ( list->right!=NULL ) _gen("&&");
- }
- _gen(")");
- if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */
- return;
- };
-
- if ( p->expr == PRED_OR_LIST )
- {
- Predicate *list;
- _gen("(");
- list = p->down;
- for (; list!=NULL; list=list->right)
- {
- genPredTreeOrig(list, j, 0);
- if ( list->right!=NULL ) _gen("||");
- }
- _gen(")");
- if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */
- return;
- }
-
- fatal_internal("genPredTreeOrig: predicate tree is wacked");
-}
-
-#if 0
-** Predicate member dummyPredDepth is no longer used in MR10
-** but we might need it again in the future
-**
-** if (MRhoisting) {
-** if ( !noneHaveContext &&
-** ! in_and_expr &&
-** p->source != NULL &&
-** p->source->dummyPredicateDepth > 0 &&
-** p->down == NULL) {
-** _gen("(");
-** genCombinedPredTreeContext(p);
-** _gen(" )\n");
-** return;
-** };
-** };
-#endif
-
-/* [genPredTree] */
-
-/* in_and_expr
-
- what to do if the context is wrong
- what to do if the context is correct but the predicate is false
-
- remember: if the context is wrong it's the same as if the
- predicate is true as far as enabling an alternative
-
- Consider (AND p q r)
-
- if in an ... && ... expression then you don't want
- the entire predicate chain to fail just because the
- context for one component is wrong: so return true
-
- Consider (OR p q r)
-
- if in an ... || ... expression then you don't want
- the entire predicate chain to succeed just because
- the context for one component is correct when the
- corresponding test is false: so return false when
- the context is correct but the test is false.
-*/
-
-void
-#ifdef __USE_PROTOS
-genPredTree( Predicate *p, Node *j, int in_and_expr, int suppress_sva )
-#else
-genPredTree( p, j, in_and_expr, suppress_sva)
- Predicate *p;
- Node *j;
- int in_and_expr;
- int suppress_sva;
-#endif
-{
-
- int allHaveContext=1;
- int noneHaveContext=1;
- Tree *groupTree;
- Tree *oneTree;
- Predicate *q;
- int identicalORcontextOptimization=0;
- int identicalANDcontextOptimization=0;
-
- if (0 && !MR_usingPredNames && !MRhoisting) {
- genPredTreeOrig(p,j,in_and_expr);
- return;
- };
-
- MR_predContextPresent(p,&allHaveContext,&noneHaveContext);
-
- if ( ! noneHaveContext ) { /* MR10 context guards ignored when -prc off */
-
- _gen("(");
-
- /* MR10 optimize OR predicates which are all leaves */
-
- if (p->expr == PRED_OR_LIST && MR_allPredLeaves(p->down)) {
- groupTree=MR_compute_pred_tree_context(p);
- for (q=p->down ; q != NULL ; q=q->right) {
- oneTree=MR_compute_pred_tree_context(q);
- if (! MR_tree_equ(groupTree,oneTree)) {
- Tfree(oneTree);
- break;
- };
- Tfree(oneTree);
- };
- Tfree(groupTree);
- if (q == NULL) {
- _gen("/* MR10 individual OR gates suppressed when all predicates are leaves");
- _gen(" with identical context */\n");
- genPredTreeGate(p,in_and_expr); /* use the parent's in_and_expr for this gate */
- identicalORcontextOptimization=1;
- } else {
- MR_distinctORcontextOpt(p,j,in_and_expr);
- return;
- };
- } else if (p->expr == PRED_AND_LIST && MR_allPredLeaves(p->down)) {
-
- /* MR12 optimize AND predicates which are all leaves */
-
- groupTree=MR_compute_pred_tree_context(p);
- for (q=p->down ; q != NULL ; q=q->right) {
- oneTree=MR_compute_pred_tree_context(q);
- if (! MR_tree_equ(groupTree,oneTree)) {
- Tfree(oneTree);
- break;
- };
- Tfree(oneTree);
- };
- Tfree(groupTree);
- if (q == NULL) {
- _gen("/* MR12 individual AND gates suppressed when all predicates are leaves");
- _gen(" with identical context */\n");
- genPredTreeGate(p,in_and_expr); /* use the parent's in_and_expr for this gate */
- identicalANDcontextOptimization=1;
- } else {
- genPredTreeGate(p, in_and_expr);
- };
- } else {
- genPredTreeGate(p, in_and_expr);
- };
- }
-
- /* if leaf node, just gen predicate */
-
- if ( p->down==NULL )
- {
- genPred(p,j,suppress_sva);
- if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */
- return;
- }
-
- /* if AND list, do both preds (only two possible) */
- /* MR10 not any more ! */
-
- if ( p->expr == PRED_AND_LIST )
- {
- Predicate *list;
- _gen("(");
- list = p->down;
- for (; list != NULL; list=list->right) {
- if (identicalANDcontextOptimization) {
- genPred(list, j,suppress_sva);
- } else {
- genPredTree(list, j, 1, suppress_sva); /* in and context */
- };
- if ( list->right!=NULL ) _gen("&&");
- };
- _gen(")");
- if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */
- return;
- }
-
- if ( p->expr == PRED_OR_LIST )
- {
- Predicate *list;
- _gen("(");
- list = p->down;
- for (; list!=NULL; list=list->right)
- {
- if (identicalORcontextOptimization) {
- genPred(list, j,suppress_sva);
- } else {
- genPredTree(list, j, 0, suppress_sva);
- };
- if ( list->right!=NULL ) _gen("||");
- }
- _gen(")");
- if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */
- return;
- }
-
- fatal_internal("predicate tree is wacked");
-}
-
-/* [genPredTreeMainXX] */
-
-Predicate * /* MR10 */
-#ifdef __USE_PROTOS
-genPredTreeMainXX( Predicate *p, Node *j ,int in_and_expr)
-#else
-genPredTreeMainXX( p, j ,in_and_expr)
- Predicate *p;
- Node *j;
- int in_and_expr;
-#endif
-{
-
- int allHaveContext=1;
- int noneHaveContext=1;
-
-#if 0
- fprintf(stderr,"Pred before\n");
- dumppred(p);
- fprintf(stderr,"\n");
- fprintf(stderr,"Pred after\n");
- dumppred(p);
- fprintf(stderr,"\n");
-#endif
-
- p=MR_predSimplifyALL(p); /* MR10 */
-
- require (MR_predicate_context_completed(p),"predicate context is not complete");
-
- MR_cleanup_pred_trees(p); /* MR10 */
-
- MR_predContextPresent(p,&allHaveContext,&noneHaveContext);
- if (!noneHaveContext & !allHaveContext) {
- warnFL("predicate contains elements both with and without context",
- FileStr[j->file],j->line);
- };
-
- if (InfoP) {
- _gen("\n#if 0\n\n");
- MR_dumpPred(p,1);
- _gen("#endif\n");
- };
- genPredTree(p,j,in_and_expr,0);
- return p;
-}
-
-Predicate * /* MR10 */
-#ifdef __USE_PROTOS
-genPredTreeMain( Predicate *p, Node *j)
-#else
-genPredTreeMain( p, j)
- Predicate *p;
- Node *j;
-#endif
-{
- return genPredTreeMainXX(p,j,1);
-}
-
-static void
-#ifdef __USE_PROTOS
-genExprTreeOriginal( Tree *t, int k )
-#else
-genExprTreeOriginal( t, k )
-Tree *t;
-int k;
-#endif
-{
- require(t!=NULL, "genExprTreeOriginal: NULL tree");
-
- if ( t->token == ALT )
- {
- _gen("("); genExprTreeOriginal(t->down, k); _gen(")");
- if ( t->right!=NULL )
- {
- _gen("||");
- on1line++;
- if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); }
- _gen("("); genExprTreeOriginal(t->right, k); _gen(")");
- }
- return;
- }
- if ( t->down!=NULL ) _gen("(");
- _gen1("LA(%d)==",k);
- if ( TokenString(t->token) == NULL ) _gen1("%d", t->token)
- else _gen1("%s", TokenString(t->token));
- if ( t->down!=NULL )
- {
- _gen("&&");
- on1line++;
- if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); }
- _gen("("); genExprTreeOriginal(t->down, k+1); _gen(")");
- }
- if ( t->down!=NULL ) _gen(")");
- if ( t->right!=NULL )
- {
- _gen("||");
- on1line++;
- if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); }
- _gen("("); genExprTreeOriginal(t->right, k); _gen(")");
- }
-}
-
-#ifdef __USE_PROTOS
-static void MR_LAtokenString(int k,int token)
-#else
-static void MR_LAtokenString(k,token)
- int k;
- int token;
-#endif
-{
- char *ts;
-
- ts=TokenString(token);
- if (ts == NULL) {
- _gen2(" LA(%d)==%d",k,token);
- } else {
- _gen2(" LA(%d)==%s",k,ts);
- };
-}
-
-
-#ifdef __USE_PROTOS
-static int MR_countLeaves(Tree *t)
-#else
-static int MR_countLeaves(t)
- Tree *t;
-#endif
-{
- if (t == NULL) return 0;
- if (t->token == ALT) {
- return MR_countLeaves(t->down)+MR_countLeaves(t->right);
- } else {
- return 1+MR_countLeaves(t->down)+MR_countLeaves(t->right);
- };
-}
-
-#ifdef __USE_PROTOS
-static void MR_genOneLine(Tree *tree,int k)
-#else
-static void MR_genOneLine(tree,k)
- Tree *tree;
- int k;
-#endif
-{
- if (tree == NULL) return;
- if (tree->token == ALT) {
- MR_genOneLine(tree->down,k);
- } else {
- MR_LAtokenString(k,tree->token);
- if (tree->down != NULL &&
- tree->down->right == NULL) {
- _gen(" &&");
- MR_genOneLine(tree->down,k+1);
- } else if (tree->down != NULL) {
- _gen(" && (");
- MR_genOneLine(tree->down,k+1);
- _gen(")");
- };
- };
- if (tree->right != NULL) {
- _gen(" ||");
- MR_genOneLine(tree->right,k);
- };
-}
-
-static int across;
-static int depth;
-static int lastkonline;
-
-#ifdef __USE_PROTOS
-static void MR_genMultiLine(Tree *tree,int k)
-#else
-static void MR_genMultiLine(tree,k)
- Tree *tree;
- int k;
-#endif
-{
- int i;
-
- if (tree == NULL) return;
- if (tree->token == ALT) {
- MR_genMultiLine(tree,k);
- } else {
- MR_LAtokenString(k,tree->token);
- lastkonline=k;
- across++;
- if (tree->down != NULL && tree->down->right == NULL) {
- if (across > 3) {
- _gen("\n");
- across=0;
- lastkonline=0;
- for (i=0 ; i < depth+k ; i++) _gen(" ");
- _gen("&&");
- } else {
- _gen(" &&");
- };
- MR_genMultiLine(tree->down,k+1);
- } else if (tree->down != NULL) {
- _gen("\n");
- lastkonline=0;
- across=0;
- for (i=0 ; i < depth+k ; i++) _gen(" ");
- _gen("&& (");
- MR_genMultiLine(tree->down,k+1);
- _gen(")");
- };
- };
- if (tree->right != NULL) {
- if (k < lastkonline) {
- _gen("\n");
- across=0;
- lastkonline=0;
- for (i=0; i < depth+k-1 ; i++) _gen(" ");
- _gen("||");
- } else if (across > 3 ) {
- _gen("\n");
- across=0;
- lastkonline=0;
- for (i=0; i < depth+k ; i++) _gen(" ");
- _gen("||");
- } else {
- _gen(" ||");
- };
- MR_genMultiLine(tree->right,k);
- };
-}
-
-#ifdef __USE_PROTOS
-static void genExprTree(Tree *tree,int k)
-#else
-static void genExprTree(tree,k)
- Tree *tree;
- int k;
-#endif
-{
- int count;
-
-#if 0
- /* MR20 THM This was probably an error.
- The routine should probably reference that static
- "across" and this declaration hides it.
- */
-
- int across;
-#endif
-
- require (tree != NULL,"genExprTree: tree is NULL");
- require (k > 0,"genExprTree: k <= 0");
-
- if (0 && !MRhoisting) { /* MR11 make new version standard */
- genExprTreeOriginal(tree,k);
- } else {
- count=MR_countLeaves(tree);
- if (count < 5) {
- MR_genOneLine(tree,k);
- } else {
- _gen("\n");
- across=0;
- depth=0;
- lastkonline=0;
- MR_genMultiLine(tree,k);
- _gen("\n");
- };
- };
-}
-
-
-/*
- * Generate LL(k) type expressions of the form:
- *
- * (LA(1) == T1 || LA(1) == T2 || ... || LA(1) == Tn) &&
- * (LA(2) == T1 || LA(2) == T2 || ... || LA(2) == Tn) &&
- * .....
- * (LA(k) == T1 || LA(k) == T2 || ... || LA(k) == Tn)
- *
- * If GenExprSetsOpt generate:
- *
- * (setwdi[LA(1)]&(1<<j)) && (setwdi[LA(2)]&(1<<j)) ...
- *
- * where n is set_deg(expr) and Ti is some random token and k is the last nonempty
- * set in fset <=CLL_k.
- * k=1..CLL_k where CLL_k >= 1.
- *
- * This routine is visible only to this file and cannot answer a TRANS message.
- *
- */
-
-/* [genExpr] */
-
-static int
-#ifdef __USE_PROTOS
-genExpr( Junction *j )
-#else
-genExpr( j )
-Junction *j;
-#endif
-{
- int max_k;
-
- /* if full LL(k) is sufficient, then don't use approximate (-ck) lookahead
- * from CLL_k..LL_k
- */
- {
- int limit;
- if ( j->ftree!=NULL ) limit = LL_k;
- else limit = CLL_k;
- max_k = genExprSets(j->fset, limit);
- }
-
- /* Do tests for real tuples from other productions that conflict with
- * artificial tuples generated by compression (using sets of tokens
- * rather than k-trees).
- */
- if ( j->ftree != NULL )
- {
- _gen(" && !("); genExprTree(j->ftree, 1); _gen(")");
- }
-
- if ( ParseWithPredicates && j->predicate!=NULL )
- {
- Predicate *p = j->predicate;
- warn_about_using_gk_option();
- _gen("&&");
- j->predicate=genPredTreeMain(p, (Node *)j); /* MR10 */
- }
-
- return max_k;
-}
-
-static int
-#ifdef __USE_PROTOS
-genExprSets( set *fset, int limit )
-#else
-genExprSets( fset, limit )
-set *fset;
-int limit;
-#endif
-{
- int k = 1;
- int max_k = 0;
- unsigned *e, *g, firstTime=1;
-
- if (set_nil(fset[1])) {
- _gen(" 0 /* MR13 empty set expression - undefined rule ? infinite left recursion ? */ ");
- MR_BadExprSets++;
- };
-
- if ( GenExprSetsOpt )
- {
- while ( k <= limit && !set_nil(fset[k]) ) /* MR11 */
- {
- if ( set_deg(fset[k])==1 ) /* too simple for a set? */
- {
- int e;
- _gen1("(LA(%d)==",k);
- e = set_int(fset[k]);
- if ( TokenString(e) == NULL ) _gen1("%d)", e)
- else _gen1("%s)", TokenString(e));
- }
- else
- {
- NewSet();
- FillSet( fset[k] );
- _gen3("(setwd%d[LA(%d)]&0x%x)", wordnum, k, 1<<setnum);
- }
- if ( k>max_k ) max_k = k;
- if ( k == CLL_k ) break;
- k++;
- if ( k<=limit && !set_nil(fset[k]) ) _gen(" && "); /* MR11 */
- on1line++;
- if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); }
- }
- return max_k;
- }
-
- while ( k<= limit && !set_nil(fset[k]) ) /* MR11 */
- {
- if ( (e=g=set_pdq(fset[k])) == NULL ) fatal_internal("genExpr: cannot allocate IF expr pdq set");
- for (; *e!=nil; e++)
- {
- if ( !firstTime ) _gen(" || ") else { _gen("("); firstTime = 0; }
- on1line++;
- if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); }
- _gen1("LA(%d)==",k);
- if ( TokenString(*e) == NULL ) _gen1("%d", *e)
- else _gen1("%s", TokenString(*e));
- }
- free( (char *)g );
- _gen(")");
- if ( k>max_k ) max_k = k;
- if ( k == CLL_k ) break;
- k++;
- if ( k <= limit && !set_nil(fset[k]) ) { firstTime=1; _gen(" && "); } /* MR11 */
- on1line++;
- if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); }
- }
- return max_k;
-}
-
-/*
- * Generate code for any type of block. If the last alternative in the block is
- * empty (not even an action) don't bother doing it. This permits us to handle
- * optional and loop blocks as well.
- *
- * Only do this block, return after completing the block.
- * This routine is visible only to this file and cannot answer a TRANS message.
- */
-static set
-#ifdef __USE_PROTOS
-genBlk( Junction *q, int jtype, int *max_k, int *need_right_curly, int * lastAltEmpty /* MR23 */)
-#else
-genBlk( q, jtype, max_k, need_right_curly, lastAltEmpty /* MR23 */)
-Junction *q;
-int jtype;
-int *max_k;
-int *need_right_curly;
-int *lastAltEmpty; /* MR23 */
-#endif
-{
- set f;
- Junction *alt;
- int a_guess_in_block = 0;
- require(q!=NULL, "genBlk: invalid node");
- require(q->ntype == nJunction, "genBlk: not junction");
- *need_right_curly=0;
- *lastAltEmpty = 0; /* MR23 */
- if ( q->p2 == NULL ) /* only one alternative? Then don't need if */
- {
- if (first_item_is_guess_block((Junction *)q->p1)!=NULL )
- {
- if (jtype != aLoopBlk && jtype != aOptBlk && jtype != aPlusBlk) {
- warnFL("(...)? as only alternative of block is unnecessary", FileStr[q->file], q->line);
- };
- gen("zzGUESS\n"); /* guess anyway to make output code consistent */
-/* MR10 disable */ /**** gen("if ( !zzrv )\n"); ****/
-/* MR10 */ gen("if ( !zzrv ) {\n"); tabs++; (*need_right_curly)++;
- };
- TRANS(q->p1);
- return empty; /* no decision to be made-->no error set */
- }
-
- f = First(q, 1, jtype, max_k);
- for (alt=q; alt != NULL; alt= (Junction *) alt->p2 )
- {
- if ( alt->p2 == NULL ) /* chk for empty alt */
- {
- Node *p = alt->p1;
- if ( p->ntype == nJunction )
- {
- /* we have empty alt */
-/* MR23
- There is a conflict between giving good error information for non-exceptions
- and making life easy for those using parser exception handling. Consider:
-
- r: { A } b;
- b: B;
-
- with input "C"
-
- Before MR21 the error message would be "expecting B - found C". After MR21
- the error message would be "expcect A, B - found C". This was good, but it
- caused problems for those using parser exceptions because the reference to
- B was generated inside the {...} where B really wasn't part of the block.
-
- In MR23 this has been changed for the case where exceptions are in use to
- not generate the extra check in the tail of the {A} block.
-*/
-
-
-/* MR23 */ if (isEmptyAlt( ((Junction *)p)->p1, (Node *)q->end)) {
-/* MR23 */ *lastAltEmpty = 1;
-/* MR23 */ if (FoundException) {
-/* MR23 */ /* code to restore state if a prev alt didn't follow guess */
-/* MR23 */ if ( a_guess_in_block && jtype != aPlusBlk) {
-/* MR23 */ gen("if ( !zzrv ) zzGUESS_DONE; /* MR28 */\n");
-/* MR23 */ }
-/* MR23 */ break;
-/* MR23 */ };
-/* MR28 */ if (jtype == aPlusBlk) {
-/* MR28 */ break;
-/* MR28 */ }
-/* MR23 */ }
- }
- } /* end of for loop on alt */
-
-/* MR10 */ if (alt->p2 == NULL &&
-/* MR10 */ ( q->jtype == aSubBlk || q->jtype == RuleBlk) ) {
-/* MR10 */ if (first_item_is_guess_block(alt)) {
-/* MR10 */ warnFL("(...)? as last alternative of block is unnecessary",
-/* MR10 */ FileStr[alt->file],alt->line);
-/* MR10 */ };
-/* MR10 */ };
-
- if ( alt != q ) gen("else ")
- else
- {
- if ( DemandLookahead ) {
- if ( !GenCC ) {gen1("LOOK(%d);\n", *max_k);}
- else gen1("look(%d);\n", *max_k);
- }
- }
-
- if ( alt!=q )
- {
- _gen("{\n");
- tabs++;
- (*need_right_curly)++;
- /* code to restore state if a prev alt didn't follow guess */
- if ( a_guess_in_block )
- gen("if ( !zzrv ) zzGUESS_DONE;\n");
- }
- if ( first_item_is_guess_block((Junction *)alt->p1)!=NULL )
- {
- a_guess_in_block = 1;
- gen("zzGUESS\n");
- }
- gen("if ( ");
- if ( first_item_is_guess_block((Junction *)alt->p1)!=NULL ) _gen("!zzrv && ");
- genExpr(alt);
- _gen(" ) ");
- _gen("{\n");
- tabs++;
- TRANS(alt->p1);
- --tabs;
- gen("}\n");
-/* MR10 */ if (alt->p2 == NULL) {
-/* MR10 */ if (first_item_is_guess_block(alt)) {
-/* MR10 */ gen("/* MR10 */ else {\n");
-/* MR10 */ tabs++;
-/* MR10 */ (*need_right_curly)++;
-/* MR10 */ /* code to restore state if a prev alt didn't follow guess */
-/* MR10 */ gen("/* MR10 */ if ( !zzrv ) zzGUESS_DONE;\n");
-/* MR10 */ gen("/* MR10 */ if (0) {} /* last alternative of block is guess block */\n");
-/* MR10 */ };
-/* MR10 */ };
- }
- return f;
-}
-
-static int
-#ifdef __USE_PROTOS
-has_guess_block_as_first_item( Junction *q )
-#else
-has_guess_block_as_first_item( q )
-Junction *q;
-#endif
-{
- Junction *alt;
-
- for (alt=q; alt != NULL; alt= (Junction *) alt->p2 )
- {
- if ( first_item_is_guess_block((Junction *)alt->p1)!=NULL ) return 1;
- }
- return 0;
-}
-
-static int
-#ifdef __USE_PROTOS
-has_guess_block_as_last_item( Junction *q )
-#else
-has_guess_block_as_last_item( q )
-Junction *q;
-#endif
-{
- Junction *alt;
-
- if (q == NULL) return 0;
- for (alt=q; alt->p2 != NULL && !( (Junction *) alt->p2)->ignore; alt= (Junction *) alt->p2 ) {};
- return first_item_is_guess_block( (Junction *) alt->p1) != NULL;
-}
-
-/* MR30 See description of first_item_is_guess_block for background */
-
-Junction *
-#ifdef __USE_PROTOS
-first_item_is_guess_block_extra(Junction *q )
-#else
-first_item_is_guess_block_extra(q)
-Junction *q;
-#endif
-{
- while ( q!=NULL &&
- ( ( q->ntype==nAction ) ||
- ( q->ntype==nJunction &&
- (q->jtype==Generic || q->jtype == aLoopBlk)
- )
- )
- )
- {
- if ( q->ntype==nJunction ) q = (Junction *)q->p1;
- else q = (Junction *) ((ActionNode *)q)->next;
- }
-
- if ( q==NULL ) return NULL;
- if ( q->ntype!=nJunction ) return NULL;
- if ( q->jtype!=aSubBlk ) return NULL;
- if ( !q->guess ) return NULL;
-
- return q;
-}
-
-/* return NULL if 1st item of alt is NOT (...)? block; else return ptr to aSubBlk node
- * of (...)?; This function ignores actions and predicates.
- */
-
-Junction *
-#ifdef __USE_PROTOS
-first_item_is_guess_block( Junction *q )
-#else
-first_item_is_guess_block( q )
-Junction *q;
-#endif
-{
- Junction * qOriginal = q; /* DEBUG */
-
- /* MR14 Couldn't find aSubBlock which was a guess block when it lay
- behind aLoopBlk. The aLoopBlk only appear in conjunction with
- aLoopBegin, but the routine didn't know that. I think.
-
- MR14a Added extra parentheses to clarify precedence
-
- MR30 This appears to have been a mistake. The First set was then
- computed incorrectly for:
-
- r : ( (A)? B
- | C
- )*
-
- The routine analysis_point was seeing the guess block when
- it was still analyzing the loopBegin block. As a consequence,
- when it looked for the analysis_point it was processing the B, but
- skipping over the C alternative altogether because it thought
- it was looking at a guess block, not realizing there was a loop
- block in front of the loopBegin.
-
- loopBegin loopBlk subBlk/guess A G EB G B EB EB EB ER
- | | | ^ ^
- | | | |
- | +-> G C G ----------------------+ |
- | |
- +--- G G G -------------------------------------+
-
- Reported by Arpad Beszedes (beszedes@inf.u-szeged.hu).
-
- MR30 This is still more complicated. This fix caused ambiguity messages
- to be reported for "( (A B)? )* A B" but not for "( (A B)? )+". Why is
- there a difference when these are outwardly identical ? It is because the
- start of a (...)* block is represented by two nodes: a loopBegin block
- followed by a loopBlock whereas the start of a (...)+ block is
- represented as a single node: a plusBlock. So if first_item_is_guess_block
- is called when the current node is a loopBegin it starts with the
- loop block rather than the the sub block which follows the loop block.
- However, we can't just skip past the loop block because some routines
- depend on the old implementation. So, we provide a new implementation
- which does skip the loopBlock. However, which should be called when ?
- I'm not sure, but my guess is that first_item_is_guess_block_extra (the
- new one) should only be called for the ambiguity routines.
-
- */
-
- while ( q!=NULL &&
- ( ( q->ntype==nAction ) ||
- ( q->ntype==nJunction &&
- (q->jtype==Generic /*** || q->jtype == aLoopBlk ***/ ) /*** MR30 Undo MR14 change ***/
- )
- )
- )
- {
- if ( q->ntype==nJunction ) q = (Junction *)q->p1;
- else q = (Junction *) ((ActionNode *)q)->next;
- }
-
- if ( q==NULL ) return NULL;
- if ( q->ntype!=nJunction ) return NULL;
- if ( q->jtype!=aSubBlk ) return NULL;
- if ( !q->guess ) return NULL;
-
- return q;
-}
-
-/* MR1 */
-/* MR1 10-Apr-97 MR1 Routine to stringize failed semantic predicates msgs */
-/* MR1 */
-
-#define STRINGIZEBUFSIZE 1024
-
-static char stringizeBuf[STRINGIZEBUFSIZE];
-char *
-#ifdef __USE_PROTOS
-stringize(char * s)
-#else
-stringize(s)
-char *s;
-#endif
-
-{
- char *p;
- char *stop;
-
- p=stringizeBuf;
- stop=&stringizeBuf[1015];
-
- if (s != 0) {
- while (*s != 0) {
- if (p >= stop) {
- goto stringizeStop;
- } else if (*s == '\n') {
- *p++='\\';
- *p++='n';
- *p++='\\';
- *p++=*s++;
- } else if (*s == '\\') {
- *p++=*s;
- *p++=*s++;
- } else if (*s == '\"') {
- *p++='\\';
- *p++=*s++;
- while (*s != 0) {
- if (p >= stop) {
- goto stringizeStop;
- } else if (*s == '\n') {
- *p++='\\';
- *p++=*s++;
- } else if (*s == '\\') {
- *p++=*s++;
- *p++=*s++;
- } else if (*s == '\"') {
- *p++='\\';
- *p++=*s++;
- break;
- } else {
- *p++=*s++;
- };
- };
- } else if (*s == '\'') {
- *p++=*s++;
- while (*s != 0) {
- if (p >= stop) {
- goto stringizeStop;
- } else if (*s == '\'') {
- *p++=*s++;
- break;
- } else if (*s == '\\') {
- *p++=*s++;
- *p++=*s++;
- } else if (*s == '\"') {
- *p++='\\';
- *p++=*s++;
- break;
- } else {
- *p++=*s++;
- };
- };
- } else {
- *p++=*s++;
- };
- };
- };
- goto stringizeExit;
-stringizeStop:
- *p++='.';
- *p++='.';
- *p++='.';
-stringizeExit:
- *p=0;
- return stringizeBuf;
-}
-
-#ifdef __USE_PROTOS
-int isNullAction(char *s)
-#else
-int isNullAction(s)
- char *s;
-#endif
-{
- char *p;
- for (p=s; *p != '\0' ; p++) {
- if (*p != ';' && *p !=' ') return 0;
- };
- return 1;
-}
-/* MR1 */
-/* MR1 End of Routine to stringize code for failed predicates msgs */
-/* MR1 */
-
-/* Generate an action. Don't if action is NULL which means that it was already
- * handled as an init action.
- */
-void
-#ifdef __USE_PROTOS
-genAction( ActionNode *p )
-#else
-genAction( p )
-ActionNode *p;
-#endif
-{
- require(p!=NULL, "genAction: invalid node and/or rule");
- require(p->ntype==nAction, "genAction: not action");
-
- if ( !p->done ) /* MR10 */ /* MR11 */
- {
- if ( p->is_predicate)
- {
- if ( p->guardpred != NULL )
- {
- Predicate *guardDup=predicate_dup(p->guardpred); /* MR10 */
- gen("if (!");
- guardDup=genPredTreeMain(guardDup, (Node *)p);
- predicate_free(guardDup);
- }
-/* MR10 */ else if (p->ampersandPred != NULL) {
-/* MR10 */ gen("if (!");
-/* MR10 */ p->ampersandPred=genPredTreeMain(p->ampersandPred, (Node *)p);
-/* MR10 */ }
- else
- {
- gen("if (!(");
- /* make sure that '#line n' is on front of line */
- if ( GenLineInfo && p->file != -1 ) _gen("\n");
- dumpPredAction(p,p->action, output, 0, p->file, p->line, 0);
- _gen(")");
- }
-
-/* MR23 Change failed predicate macro to have three arguments:
-
- macro arg 1: The stringized predicate itself
- macro arg 2: 0 => no user-defined error action
- 1 => user-defined error action
- macro arg 3: The user-defined error action
-
- This gives the user more control of the error action.
-*/
- tabs++;
- gen3(") {zzfailed_pred(\"%s\",%s, { %s } );}\n", /* MR23 */
- stringize(p->action), /* MR23 */
- (p->pred_fail == NULL ? /* MR23/MR27 */
- "0 /* report */" : "1 /* user action */"), /* MR23/MR27 */
- (p->pred_fail == NULL ? /* MR23 */
- "0; /* no user action */" : p->pred_fail)); /* MR23 */
- tabs--;
- }
- else /* not a predicate */
- {
- if (! isNullAction(p->action) && !p->noHoist) {
- if ( FoundGuessBlk ) {
- if ( GenCC ) {
- gen("if ( !guessing ) {\n");
- } else {
- gen("zzNON_GUESS_MODE {\n");
- };
- };
- dumpActionPlus(p, p->action, output, tabs, p->file, p->line, 1); /* MR21 */
- if ( FoundGuessBlk ) gen("}\n");
- };
- }
- }
- TRANS(p->next)
-}
-
-/*
- * if invoking rule has !noAST pass zzSTR to rule ref and zzlink it in
- * else pass addr of temp root ptr (&_ast) (don't zzlink it in).
- *
- * if ! modifies rule-ref, then never link it in and never pass zzSTR.
- * Always pass address of temp root ptr.
- */
-void
-#ifdef __USE_PROTOS
-genRuleRef( RuleRefNode *p )
-#else
-genRuleRef( p )
-RuleRefNode *p;
-#endif
-{
- Junction *q;
- char *handler_id = "";
- RuleEntry *r, *r2;
- char *parm = "", *exsig = "";
-
- int genRuleRef_emittedGuessGuard=0; /* MR10 */
-
- require(p!=NULL, "genRuleRef: invalid node and/or rule");
- require(p->ntype==nRuleRef, "genRuleRef: not rule reference");
-
- if ( p->altstart!=NULL && p->altstart->exception_label!=NULL )
- handler_id = p->altstart->exception_label;
-
- r = (RuleEntry *) hash_get(Rname, p->text);
- if ( r == NULL )
- {
- warnFL( eMsg1("rule %s not defined",
- p->text), FileStr[p->file], p->line );
- return;
- }
-
-/* MR8 5-Aug-97 Reported by S.Bochnak@microtool.com.pl */
-/* Don't do assign when no return values declared */
-/* Move definition of q up and use it to guard p->assign */
-
- q = RulePtr[r->rulenum]; /* find definition of ref'd rule */ /* MR8 */
-
- r2 = (RuleEntry *) hash_get(Rname, p->rname);
- if ( r2 == NULL ) {warnNoFL("Rule hash table is screwed up beyond belief"); return;}
-
- OutLineInfo(output,p->line,FileStr[p->file]);
-
- if ( GenCC && GenAST ) {
- gen("_ast = NULL;\n");
- }
-
- if ( FoundGuessBlk && p->assign!=NULL && q->ret != NULL ) { /* MR8 */
- if ( GenCC ) {
- gen("if ( !guessing ) {\n");
- } else {
- gen("zzNON_GUESS_MODE {\n");
- };
- tabs++; /* MR11 */
- genRuleRef_emittedGuessGuard=1; /* MR11 */
- };
-
- if ( FoundException ) exsig = "&_signal";
-
- tab();
- if ( GenAST )
- {
- if ( GenCC ) {
-/**** if ( r2->noAST || p->astnode==ASTexclude )
-****/
- {
-/**** _gen("_ast = NULL;\n");
-****/
- parm = "&_ast";
- }
-/*** we always want to set just a pointer now, then set correct
-pointer after
-
- else {
- _gen("_astp =
-(_tail==NULL)?(&_sibling):(&(_tail->_right));\n");
- parm = "_astp";
- }
-****/
- }
- else {
- if ( r2->noAST || p->astnode==ASTexclude )
- {
- _gen("_ast = NULL; ");
- parm = "&_ast";
- }
- else parm = "zzSTR";
- }
- if ( p->assign!=NULL && q->ret!=NULL ) /* MR8 */
- {
- if ( !hasMultipleOperands(p->assign) ) {_gen1("%s = ",p->assign);} /* MR23 */
- else _gen1("{ struct _rv%d _trv; _trv = ", r->rulenum);
- }
- if ( FoundException ) {
- _gen5("%s%s(%s,&_signal%s%s); ",
- RulePrefix,
- p->text,
- parm,
- (p->parms!=NULL)?",":"",
- (p->parms!=NULL)?p->parms:"");
- if ( p->ex_group!=NULL ) {
- _gen("\n");
- gen("if (_signal) {\n");
- tabs++;
- dumpException(p->ex_group, 0);
- tabs--;
- gen("}");
- }
- else {
- _gen1("if (_signal) goto %s_handler;", handler_id);
- }
- }
- else {
- _gen5("%s%s(%s%s%s);",
- RulePrefix,
- p->text,
- parm,
- (p->parms!=NULL)?",":"",
- (p->parms!=NULL)?p->parms:"");
- }
- if ( GenCC && (r2->noAST || p->astnode==ASTexclude) )
- {
- /* rule has a ! or element does */
- /* still need to assign to #i so we can play with it */
- _gen("\n");
- gen2("_ast%d%d = (AST *)_ast;", BlkLevel-1, p->elnum);
- }
- else if ( !r2->noAST && p->astnode == ASTinclude )
- {
- /* rule doesn't have a ! and neither does element */
-/* MR10 */ if (FoundGuessBlk && !genRuleRef_emittedGuessGuard) {
-/* MR10 */ _gen("\n");
-/* MR10 */ if (GenCC) gen ("if (!guessing) { /* MR10 */")
-/* MR10 */ else gen ("if (!zzguessing) { /* MR10 */\n");
-/* MR10 */ tabs++;
-/* MR10 */ };
- if ( GenCC ) {
- _gen("\n");
- gen("if ( _tail==NULL ) _sibling = _ast; else _tail->setRight(_ast);\n");
- gen2("_ast%d%d = (AST *)_ast;\n", BlkLevel-1, p->elnum);
- tab();
- }
- else _gen(" ");
- if ( GenCC ) {
- _gen("ASTBase::"); }
- else _gen("zz");
- _gen("link(_root, &_sibling, &_tail);");
-
-/* MR10 */ if (FoundGuessBlk && !genRuleRef_emittedGuessGuard) { /* MR10 */
-/* MR10 */ _gen("\n");
-/* MR10 */ tabs--;
-/* MR10 */ if (GenCC) gen ("}; /* MR10 */")
-/* MR10 */ else gen ("}; /* MR10 */");
-/* MR10 */ };
- }
- }
- else
- {
- if ( p->assign!=NULL && q->ret!=NULL ) /* MR8 */
- {
- if ( !hasMultipleOperands(p->assign) ) {_gen1("%s = ",p->assign);} /* MR23 */
- else _gen1("{ struct _rv%d _trv; _trv = ", r->rulenum);
- }
- if ( FoundException ) {
- _gen4("%s%s(&_signal%s%s); ",
- RulePrefix,
- p->text,
- (p->parms!=NULL)?",":"",
- (p->parms!=NULL)?p->parms:"");
- if ( p->ex_group!=NULL ) {
- _gen("\n");
- gen("if (_signal) {\n");
- tabs++;
- dumpException(p->ex_group, 0);
- tabs--;
- gen("}");
- }
- else {
- _gen1("if (_signal) goto %s_handler;", handler_id);
- }
- }
- else {
- _gen3("%s%s(%s);",
- RulePrefix,
- p->text,
- (p->parms!=NULL)?p->parms:"");
- }
- if ( p->assign!=NULL && q->ret!=NULL ) _gen("\n"); /* MR8 */
- }
-
- if ( p->assign!=NULL && q->ret!=NULL) { /* MR8 */
- if ( hasMultipleOperands(p->assign) ) /* MR23 */
- {
- _gen("\n");
- dumpRetValAssign(p->assign, q->ret, p); /* MR30 */
- _gen("}");
- }
- }
- _gen("\n");
-
- /* Handle element labels now */
- if ( p->el_label!=NULL )
- {
- if ( GenAST )
- {
- if ( GenCC ) {
- gen3("%s_ast = _ast%d%d;\n", p->el_label, BlkLevel-1, p->elnum);
- }
- else {gen1("%s_ast = zzastCur;\n", p->el_label);}
- }
- else if (!GenCC ) {
- gen1("%s = zzaCur;\n", p->el_label);
- }
- }
-
- if ( FoundGuessBlk && p->assign!=NULL && q->ret!=NULL ) { /* MR8 */
- /* in guessing mode, don't branch to handler upon error */
- tabs--; /* MR11 */
- gen("} else {\n");
- tabs++; /* MR11 */
- if ( FoundException ) {
- gen6("%s%s(%s%s&_signal%s%s);\n",
- RulePrefix,
- p->text,
- parm,
- (*parm!='\0')?",":"",
- (p->parms!=NULL)?",":"",
- (p->parms!=NULL)?p->parms:"");
- }
- else {
- gen5("%s%s(%s%s%s);\n",
- RulePrefix,
- p->text,
- parm,
- (p->parms!=NULL && *parm!='\0')?",":"",
- (p->parms!=NULL)?p->parms:"");
- }
- tabs--; /* MR11 */
- gen("}\n");
- }
- TRANS(p->next)
-}
-
-/*
- * Generate code to match a token.
- *
- * Getting the next token is tricky. We want to ensure that any action
- * following a token is executed before the next GetToken();
- */
-void
-#ifdef __USE_PROTOS
-genToken( TokNode *p )
-#else
-genToken( p )
-TokNode *p;
-#endif
-{
- RuleEntry *r;
- char *handler_id = "";
- ActionNode *a;
- char *set_name;
- char *set_nameErrSet;
- int complement;
- int ast_label_in_action = 0; /* MR27 */
- int pushedCmodeAST = 0; /* MR27 */
-
- require(p!=NULL, "genToken: invalid node and/or rule");
- require(p->ntype==nToken, "genToken: not token");
- if ( p->altstart!=NULL && p->altstart->exception_label!=NULL )
- handler_id = p->altstart->exception_label;
-
- r = (RuleEntry *) hash_get(Rname, p->rname);
- if ( r == NULL ) {warnNoFL("Rule hash table is screwed up beyond belief"); return;}
-
-/*
- * MR27 Has the element label been referenced as an AST (with the # operator) ?
- * If so, then we'll want to build the AST even though the user has used
- * the ! operator.
- */
-/* MR27 */ if (GenAST && p->el_label != NULL) {
-/* MR27 */ ast_label_in_action = list_search_cstring(r->ast_labels_in_actions,
-/* MR27 */ p->el_label);
-/* MR27 */ }
-
- OutLineInfo(output,p->line,FileStr[p->file]);
-
- if ( !set_nil(p->tset) ) /* implies '.', ~Tok, or tokenclass */
- {
- unsigned e;
- unsigned eErrSet = 0;
- set b;
- set bErrSet; /* MR23 */
- b = set_dup(p->tset);
- bErrSet = set_dup(p->tset); /* MR23 */
- complement = p->complement; /* MR23 */
- if ( p->tclass!=NULL && complement == 0 /* MR23 */) { /* token class not complemented*/
- static char buf[MaxRuleName+20]; /* MR23 */
- static char bufErrSet[MaxRuleName+20]; /* MR23 */
- if ( p->tclass->dumped ) {
- e = p->tclass->setnum;
- eErrSet = p->tclass->setnumErrSet;
- }
- else {
- e = DefErrSet(&b, 0, TokenString(p->token));
- eErrSet = DefErrSetWithSuffix(0, &bErrSet, 1, TokenString(p->token), "_errset");
- p->tclass->dumped = 1; /* indicate set has been created */
- p->tclass->setnum = e;
- p->tclass->setnumErrSet = eErrSet; /* MR23 */
- }
- sprintf(buf, "%s_set", TokenString(p->token));
- sprintf(bufErrSet, "%s_errset", TokenString(p->token)); /* MR23 */
- set_name = buf;
- set_nameErrSet = bufErrSet; /* MR23 */
- }
-
- /* MR23 - Forgot about the case of ~TOKCLASS. */
-
- else if ( p->tclass!=NULL && complement != 0 /* MR23 */)
- {
- static char buf[MaxRuleName+20]; /* MR23 */
- static char bufErrSet[MaxRuleName+20]; /* MR23 */
- if ( p->tclass->dumpedComplement ) {
- e = p->tclass->setnumComplement;
- eErrSet = p->tclass->setnumErrSetComplement;
- }
- else {
- e = DefErrSetWithSuffix(0, &b, 0, TokenString(p->token), "_setbar");
- eErrSet = DefErrSetWithSuffix(0, &bErrSet, 1, TokenString(p->token), "_errsetbar");
- p->tclass->dumpedComplement = 1; /* indicate set has been created */
- p->tclass->setnumComplement = e;
- p->tclass->setnumErrSetComplement = eErrSet; /* MR23 */
- }
- sprintf(buf, "%s_setbar", TokenString(p->token));
- sprintf(bufErrSet, "%s_errsetbar", TokenString(p->token)); /* MR23 */
- set_name = buf;
- set_nameErrSet = bufErrSet; /* MR23 */
- }
- else { /* wild card */
- static char buf[sizeof("zzerr")+10];
- static char bufErrSet[sizeof("zzerr")+10];
- int n = DefErrSet( &b, 0, NULL );
- int nErrSet = DefErrSetWithSuffix(0, &bErrSet, 1, NULL, "_set");
- if ( GenCC ) sprintf(buf, "err%d", n);
- else sprintf(buf, "zzerr%d", n);
- if ( GenCC ) sprintf(bufErrSet, "err%d", nErrSet);
- else sprintf(bufErrSet, "zzerr%d", nErrSet);
- set_name = buf;
- set_nameErrSet = bufErrSet;
- }
-
- if ( !FoundException ) {
-/* MR23 */ gen2("zzsetmatch(%s, %s);", set_name, set_nameErrSet);
- }
- else if ( p->ex_group==NULL ) {
- if ( p->use_def_MT_handler )
- gen3("zzsetmatch_wdfltsig(%s,(ANTLRTokenType)%d,%s);",
- set_name,
- p->token,
- tokenFollowSet(p))
- else
- gen2("zzsetmatch_wsig(%s, %s_handler);",
- set_name,
- handler_id);
- }
- else
- {
- gen1("if ( !_setmatch_wsig(%s) ) {\n", set_name);
- tabs++;
-/* MR6 */ if (FoundGuessBlk) {
-/* MR6 */ if ( GenCC ) {gen("if ( guessing ) goto fail;\n");}
-/* MR6 */ else gen("if ( zzguessing ) goto fail;\n");
-/* MR6 */ };
- gen("_signal=MismatchedToken;\n");
- dumpException(p->ex_group, 0);
- tabs--;
- gen("}\n");
- }
- set_free(b);
- set_free(bErrSet);
- }
- else if ( TokenString(p->token)!=NULL )
- {
- if ( FoundException ) {
- if ( p->use_def_MT_handler )
- gen2("zzmatch_wdfltsig(%s,%s);",TokenString(p->token),tokenFollowSet(p))
- else if ( p->ex_group==NULL )
- {
- gen2("zzmatch_wsig(%s, %s_handler);",
- TokenString(p->token),
- handler_id);
- }
- else
- {
-/* MR6 */ if (GenCC) {
-/* MR6 */ gen1("if ( !_match_wsig(%s) ) {\n", TokenString(p->token));
-/* MR6 */ } else {
-/* MR6 */ gen1("if ( !_zzmatch_wsig(%s) ) {\n", TokenString(p->token));
-/* MR6 */ };
- tabs++;
-/* MR6 */ if (FoundGuessBlk) {
-/* MR6 */ if ( GenCC ) {gen("if ( guessing ) goto fail;\n");}
-/* MR6 */ else gen("if ( zzguessing ) goto fail;\n");
-/* MR6 */ };
- gen("_signal=MismatchedToken;\n");
- dumpException(p->ex_group, 0);
- tabs--;
- gen("}\n");
- }
- }
- else gen1("zzmatch(%s);", TokenString(p->token));
- }
- else {
- if ( FoundException ) {
- if ( p->use_def_MT_handler )
- gen2("zzmatch_wdfltsig((ANTLRTokenType)%d,%s);",
- p->token,tokenFollowSet(p))
- else
- gen2("zzmatch_wsig(%d,%s_handler);",p->token,handler_id);
- }
- else {gen1("zzmatch(%d);", p->token);}
- }
-
- a = findImmedAction( p->next );
- /* generate the token labels */
- if ( GenCC && p->elnum>0 )
- {
- /* If building trees in C++, always gen the LT() assigns */
- if ( set_el(p->elnum, tokensRefdInBlock) || GenAST )
- {
-/* MR10 */ if ( FoundGuessBlk ) {
-/* MR10 */ gen("\n");
-/* MR10 */ if (p->label_used_in_semantic_pred) {
-/* MR10 */ gen2(" _t%d%d = (ANTLRTokenPtr)LT(1); /* MR10 */\n", BlkLevel-1, p->elnum);
-/* MR10 */ } else {
-/* MR10 */ gen("if ( !guessing ) {\n"); tab();
-/* MR10 */ _gen2(" _t%d%d = (ANTLRTokenPtr)LT(1);\n", BlkLevel-1, p->elnum);
-/* MR10 */ gen("}\n");
-/* MR10 */ };
-/* MR10 */ } else {
-/* MR10 */ _gen2(" _t%d%d = (ANTLRTokenPtr)LT(1);", BlkLevel-1, p->elnum);
-/* MR10 */ };
-/* MR10 */
- }
-
-/*
- * MR23 labase is never used in the C++ runtime library.
- * and this code is generated only in C++ mode
- */
-
-/*** if ( LL_k>1 ) / * MR23 disabled */
-/*** if ( !DemandLookahead ) _gen(" labase++;"); / * MR23 disabled */
-/*** _gen("\n"); / * MR23 disabled */
-/*** tab(); / * MR23 disabled */
- }
- if ( GenAST )
- {
- if ( FoundGuessBlk &&
- (ast_label_in_action || !(p->astnode == ASTexclude || r->noAST)) )
- {
- if ( GenCC ) {_gen("if ( !guessing ) {\n"); tab();}
- else {_gen("zzNON_GUESS_MODE {\n"); tab();}
- }
-
-/* MR27 addition when labels referenced when operator ! used */
-
- pushedCmodeAST = 0; /* MR27 */
- if (ast_label_in_action && (p->astnode == ASTexclude || r->noAST)) {
- _gen("\n");
- if (GenCC) {
-/* MR13 */ if (NewAST) {
-/* MR13 */ gen4("_ast%d%d = newAST(_t%d%d); /* MR27 */\n", BlkLevel-1, p->elnum, BlkLevel-1, p->elnum);
-/* MR13 */ } else {
-/* MR13 */ gen4("_ast%d%d = new AST(_t%d%d); /* MR27 */\n", BlkLevel-1, p->elnum, BlkLevel-1, p->elnum);
-/* MR13 */ }
- }
- else {
- pushedCmodeAST = 1;
- gen("zzastPush(zzmk_ast(zzastnew(),zzaCur)); /* MR27 */");
- }
- }
-
-/* end MR27 addition for labels referenced when operator ! used */
-
- if (!r->noAST )
- {
- if (GenCC && !(p->astnode == ASTexclude) ) {
- _gen("\n");
-/* MR13 */ if (NewAST) {
-/* MR13 */ gen4("_ast%d%d = newAST(_t%d%d);\n", BlkLevel-1, p->elnum, BlkLevel-1, p->elnum);
-/* MR13 */ } else {
-/* MR13 */ gen4("_ast%d%d = new AST(_t%d%d);\n", BlkLevel-1, p->elnum, BlkLevel-1, p->elnum);
-/* MR13 */ }
- tab();
- }
- if ( GenCC && !(p->astnode == ASTexclude) )
- {_gen2("_ast%d%d->", BlkLevel-1, p->elnum);}
- else _gen(" ");
- if ( p->astnode==ASTchild ) {
- if ( !GenCC ) _gen("zz");
- _gen("subchild(_root, &_sibling, &_tail);");
- }
- else if ( p->astnode==ASTroot ) {
- if ( !GenCC ) _gen("zz");
- _gen("subroot(_root, &_sibling, &_tail);");
- }
- if ( GenCC && !(p->astnode == ASTexclude) ) {
- _gen("\n");
- tab();
- }
- }
- else if ( !GenCC ) {
- if (! pushedCmodeAST) _gen(" zzastDPush;");
- }
- if ( FoundGuessBlk &&
- (ast_label_in_action || !(p->astnode == ASTexclude || r->noAST)) )
- {gen("}\n"); tab();}
- }
-
- /* Handle element labels now */
- if ( p->el_label!=NULL )
- {
- int done_NON_GUESSMODE=0;
-
- _gen("\n");
-
-/* MR10 */ /* do Attrib / Token ptr for token label used in semantic pred */
-/* MR10 */ /* for these cases do assign even in guess mode */
-/* MR10 */
-/* MR10 */ if (p->label_used_in_semantic_pred) {
-/* MR10 */ if ( GenCC ) {
-/* MR10 */ if ( set_el(p->elnum, tokensRefdInBlock) || GenAST ) {
-/* MR10 */ gen3("%s = _t%d%d;", p->el_label, BlkLevel-1, p->elnum);
-/* MR10 */ } else {
-/* MR10 */ gen1("%s = (ANTLRTokenPtr)LT(1);\n", p->el_label);
-/* MR10 */ };
-/* MR10 */ } else {
-/* MR10 */ gen1("%s = zzaCur;", p->el_label);
-/* MR10 */ };
-/* MR10 */ if (FoundGuessBlk) _gen(" /* MR10 */");
-/* MR10 */ _gen("\n");
-/* MR10 */ };
-
- /* Do Attrib / Token ptr */
-
-/* MR10 */ if (! p->label_used_in_semantic_pred) {
-/* MR10 */
-/* MR10 */ if ( FoundGuessBlk ) {
-/* MR10 */ if (! done_NON_GUESSMODE) {
-/* MR10 */ done_NON_GUESSMODE=1;
-/* MR10 */ if ( GenCC ) {gen("if ( !guessing ) {\n"); tab();}
-/* MR10 */ else {gen("zzNON_GUESS_MODE {\n"); tab();}
-/* MR10 */ };
-/* MR10 */ };
-/* MR10 */
-/* MR10 */ if ( GenCC ) {
-/* MR10 */ if ( set_el(p->elnum, tokensRefdInBlock) || GenAST ) {
-/* MR10 */ gen3("%s = _t%d%d;\n", p->el_label, BlkLevel-1, p->elnum);
-/* MR10 */ } else {
-/* MR10 */ gen1("%s = (ANTLRTokenPtr)LT(1);\n", p->el_label);
-/* MR10 */ };
-/* MR10 */ } else {
-/* MR10 */ gen1("%s = zzaCur;\n", p->el_label);
-/* MR10 */ };
-/* MR10 */ };
-
- /* Do AST ptr */
-
- if (GenAST && (ast_label_in_action || !(p->astnode == ASTexclude || r->noAST) )) /* MR27 */
- {
-
-/* MR10 */ if ( FoundGuessBlk ) {
-/* MR10 */ if (! done_NON_GUESSMODE) {
-/* MR10 */ done_NON_GUESSMODE=1;
-/* MR10 */ if ( GenCC ) {gen("if ( !guessing ) {\n"); tab();}
-/* MR10 */ else {gen("zzNON_GUESS_MODE {\n"); tab();}
-/* MR10 */ };
-/* MR10 */ };
-
- if ( GenCC ) {
- gen3("%s_ast = _ast%d%d;\n", p->el_label, BlkLevel-1, p->elnum);
- }
- else {gen1("%s_ast = zzastCur;\n", p->el_label);}
- }
-
-/* MR10 */ if (done_NON_GUESSMODE) {
-/* MR10 */ gen("}\n"); tab();
-/* MR10 */ };
-
- }
-
- /* Handle any actions immediately following action */
- if ( a != NULL ) /* MR10 */ /* MR11 */
- {
- /* delay next token fetch until after action */
- _gen("\n");
- if ( a->is_predicate)
- {
-#if 0
-/* Disabled in MR30 ************************************************************
- And moved into genAction
- *****************************************************************************
-*/
-
- gen("if (!(");
-
- /* make sure that '#line n' is on front of line */ /* MR14 */
- if ( GenLineInfo && p->file != -1 ) _gen("\n"); /* MR14 */
- dumpPredAction(a,a->action, output, 0, a->file, a->line, 0);
-
-/* MR23 Change failed predicate macro to have three arguments:
-
- macro arg 1: The stringized predicate itself
- macro arg 2: 0 => no user-defined error action
- 1 => user-defined error action
- macro arg 3: The user-defined error action
-
- This gives the user more control of the error action.
-*/
- _gen(")) \n");
- tabs++;
- gen3(" {zzfailed_pred(\"%s\",%s,{ %s } );}\n", /* MR23 */
- stringize(a->action), /* MR23 */
- (a->pred_fail == NULL ? /* MR23/MR27 */
- "0 /* report */" : "1 /* user action */"), /* MR23/MR27 */
- (a->pred_fail == NULL ? /* MR23 */
- "0; /* no user action */" : a->pred_fail)); /* MR23 */
- tabs--;
-/* Disabled in MR30 ************************************************************
- And moved into genAction
- *****************************************************************************
-*/
-#endif
- }
- else /* MR9 a regular action - not a predicate action */
- {
-
-/* MR23: Search an action which is not a predicate for LT(i),
- LA(i), or LATEXT(i) in order to warn novice users that
- it refers to the previous matched token, not the next
- one. This is different than the case for semantic
- predicates.
-*/
-
-/* MR23 */ if (GenCC) {
-/* MR23 */ if (strstr(a->action, "LT(") != NULL) LTinTokenAction = 1;
-/* MR23 */ }
-/* MR23 */ else {
-/* MR23 */ if (strstr(a->action, "LA(") != NULL) LTinTokenAction = 1;
-/* MR23 */ if (strstr(a->action, "LATEXT(") != NULL) LTinTokenAction = 1;
-/* MR23 */ }
-
- if ( FoundGuessBlk ) {
- if ( GenCC ) {gen("if ( !guessing ) {\n");}
- else gen("zzNON_GUESS_MODE {\n");
- }
- dumpActionPlus(a, a->action, output, tabs, a->file, a->line, 1); /* MR21 */
- if ( FoundGuessBlk ) gen("}\n");
- a->done = 1; /* MR30 */
- }
-/*** a->done = 1; MR30 Moved up into then branch for true actions, but not predicates ***/
- if ( !DemandLookahead ) {
- if ( GenCC ) {
- if ( FoundException && p->use_def_MT_handler ) gen("if (!_signal)");
- _gen(" consume();")
- if ( FoundException && p->use_def_MT_handler )
- _gen(" _signal=NoSignal;");
- _gen("\n");
- }
- else
- {
- if ( FoundException && p->use_def_MT_handler ) _gen("if (!_signal)");
- _gen(" zzCONSUME;\n");
- if ( FoundException && p->use_def_MT_handler ) _gen(" _signal=NoSignal;");
- _gen("\n");
- }
- }
- else gen("\n");
- if (a->done) { /* MR30 */
- TRANS( a->next ); /* MR30 */
- } /* MR30 */
- else { /* MR30 */
- TRANS( p->next ); /* MR30 */
- } /* MR30 */
- }
- else
- {
- if ( !DemandLookahead ) {
- if ( GenCC ) {
- if (FoundException && p->use_def_MT_handler) _gen("if (!_signal)");
- _gen(" consume();")
- if (FoundException&&p->use_def_MT_handler) _gen(" _signal=NoSignal;");
- _gen("\n");
- }
- else {
- if (FoundException && p->use_def_MT_handler) _gen("if (!_signal)");
- _gen(" zzCONSUME;");
- if ( FoundException && p->use_def_MT_handler ) _gen(" _signal=NoSignal;");
- _gen("\n");
- }
- }
- else _gen("\n");
- TRANS(p->next);
- }
-}
-
-/* MR21
- *
- * There was a bug in the code generation for {...} which causes it
- * to omit the optional tokens from the error messages. The easiest
- * way to fix this was to make the opt block look like a sub block:
- *
- * { a | b | c }
- *
- * becomes (internally):
- *
- * ( a | b | c | )
- *
- * The code for genOptBlk is now identical to genSubBlk except for
- * cosmetic changes.
- */
-
-void
-#ifdef __USE_PROTOS
-genOptBlk( Junction *q )
-#else
-genOptBlk( q )
-Junction *q;
-#endif
-{
- int max_k;
- set f;
- int need_right_curly;
- set savetkref;
- int lastAltEmpty; /* MR23 */
- savetkref = tokensRefdInBlock;
- require(q->ntype == nJunction, "genOptBlk: not junction");
- require(q->jtype == aOptBlk, "genOptBlk: not opt block");
-
- OutLineInfo(output,q->line,FileStr[q->file]);
- BLOCK_Preamble(q);
- BlkLevel++;
- BlockPreambleOption(q,q->pFirstSetSymbol); /* MR21 */
- f = genBlk(q, aOptBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */);
-/* MR23
- Bypass error clause generation when exceptions are used in {...} block
- See multi-line note in genBlk near call to isEmptyAlt.
-*/
- if (! FoundException) {
- if ( q->p2 != NULL ) {tab(); makeErrorClause(q,f,max_k,0 /* use plus block bypass ? */ );}
- }
- else {
- gen("/* MR23 skip error clause for {...} when exceptions in use */\n");
- }
- { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} }
- freeBlkFsets(q);
- --BlkLevel;
- BLOCK_Tail();
-
- if ( q->guess )
- {
- gen("zzGUESS_DONE\n");
- }
-
- /* must duplicate if (alpha)?; one guesses (validates), the
- * second pass matches */
- if ( q->guess && analysis_point(q)==q )
- {
- OutLineInfo(output,q->line,FileStr[q->file]);
- BLOCK_Preamble(q);
- BlkLevel++;
- f = genBlk(q, aSubBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */);
- if ( q->p2 != NULL ) {tab(); makeErrorClause(q,f,max_k,0 /* use plus block bypass ? */ );}
- { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} }
- freeBlkFsets(q);
- --BlkLevel;
- BLOCK_Tail();
- }
-
- tokensRefdInBlock = savetkref;
- if (q->end->p1 != NULL) TRANS(q->end->p1);
-}
-
-/*
- * Generate code for a loop blk of form:
- *
- * |---|
- * v |
- * --o-G-o-->o--
- */
-void
-#ifdef __USE_PROTOS
-genLoopBlk( Junction *begin, Junction *q, Junction *start, int max_k )
-#else
-genLoopBlk( begin, q, start, max_k )
-Junction *begin;
-Junction *q;
-Junction *start; /* where to start generating code from */
-int max_k;
-#endif
-{
- set f;
- int need_right_curly;
- set savetkref;
- Junction *guessBlock; /* MR10 */
- int singleAlt; /* MR10 */
- int lastAltEmpty; /* MR23 */
-
- savetkref = tokensRefdInBlock;
- require(q->ntype == nJunction, "genLoopBlk: not junction");
- require(q->jtype == aLoopBlk, "genLoopBlk: not loop block");
-
- if ( q->visited ) return;
- q->visited = TRUE;
-
- /* first_item_is_guess_block doesn't care what kind of node it is */
-
- guessBlock=first_item_is_guess_block( (Junction *) q->p1); /* MR10 */
- singleAlt=q->p2==NULL; /* MR10 */
-
- if (singleAlt && !guessBlock) /* MR10 */ /* only one alternative? */
- {
- if ( DemandLookahead ) {
- if ( !GenCC ) {gen1("LOOK(%d);\n", max_k);}
- else gen1("look(%d);\n", max_k);
- }
- gen("while ( ");
- if ( begin!=NULL ) genExpr(begin);
- else genExpr(q);
- /* if no predicates have been hoisted for this single alt (..)*
- * do so now
- */
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- if ( ParseWithPredicates && begin->predicate==NULL )
- {
- Predicate *a = MR_find_predicates_and_supp((Node *)q->p1);
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
-
- if ( a!=NULL )
- {
- _gen("&&");
- a=genPredTreeMain(a, (Node *)q); /* MR10 */
- }
-/* MR10 */ if (MRhoisting) {
-/* MR10 */ predicate_free(a);
-/* MR10 */ };
- }
- _gen(" ) {\n");
- tabs++;
- TRANS(q->p1);
- if ( !GenCC ) gen1("zzLOOP(zztasp%d);\n", BlkLevel-1);
- if ( DemandLookahead ) {
- if ( !GenCC ) {gen1("LOOK(%d);\n", max_k);}
- else gen1("look(%d);\n", max_k);
- }
- --tabs;
- gen("}\n");
- freeBlkFsets(q);
- q->visited = FALSE;
- tokensRefdInBlock = savetkref;
- return;
- }
- gen("for (;;) {\n"); /* MR20 G. Hobbelt */
- tabs++;
-/* MR6 */
-/* MR6 "begin" can never be null when called from genLoopBegin */
-/* MR6 because q==(Junction *)begin->p1 and we know q is valid */
-/* MR6 */
-/* MR6 from genLoopBegin: */
-/* MR6 */
-/* MR6 if ( LL_k>1 && !set_nil(q->fset[2]) ) */
-/* MR6 genLoopBlk( q, (Junction *)q->p1, q, max_k ); */
-/* MR6 else genLoopBlk( q, (Junction *)q->p1, NULL, max_k ); */
-/* MR6 */
- if ( begin!=NULL )
- {
- if ( DemandLookahead )
- {
- if ( !GenCC ) {gen1("LOOK(%d);\n", max_k);}
- else gen1("look(%d);\n", max_k);
- }
- /* The bypass arc of the (...)* predicts what to do when you fail, but
- * ONLY after having tested the loop start expression. To avoid this,
- * we simply break out of the (...)* loop when we find something that
- * is not in the prediction of the loop (all alts thereof).
- */
- gen("if ( !(");
-
-/*** TJP says: It used to use the prediction expression for the bypass arc
- of the (...)*. HOWEVER, if a non LL^1(k) decision was found, this
- thing would miss the ftree stored in the aLoopBegin node and generate
- an LL^1(k) decision anyway.
-
- *** genExpr((Junction *)begin->p2);
- ***/
-
- genExpr((Junction *)begin);
- _gen(")) break;\n");
-
- }
-
- /* generate code for terminating loop (this is optional branch) */
-
- f = genBlk(q, aLoopBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */);
- set_free(f);
- freeBlkFsets(q);
-
- /* generate code for terminating loop (this is optional branch) */
-
-/* MR6 */
-/* MR6 30-May-97 Bug reported by Manuel Ornato */
-/* MR6 A definite bug involving the exit from a loop block */
-/* MR6 In 1.23 and later versions (including 1.33) Instead */
-/* MR6 exiting the block and reporting a syntax error the */
-/* MR6 code loops forever. */
-/* MR6 Looking at 1.20 which generates proper code it is not */
-/* MR6 clear which of two changes should be undone. */
-/* MR6 This is my best guess. */
-/* MR6 From earlier MR6 note we know that begin can never be */
-/* MR6 null when genLoopBlk called from genLoopBegin */
-/* MR6 */
-/* MR6 */ if ( begin==NULL) {
-/* MR6 */ /* code for exiting loop "for sure" */
-/* MR6 */ gen("/* Suppressed by MR6 */ /*** else break; ***/\n");
-/* MR6 */ };
-
-/* MR10 */if (singleAlt && guessBlock) {
-/* MR10 */ tabs--;
-/* MR6 */ gen("} else break; /* MR6 code for exiting loop \"for sure\" */\n");
-/* MR10 */ need_right_curly--;
-/* MR10 */ } else {
-/* MR6 */ gen("else break; /* MR6 code for exiting loop \"for sure\" */\n");
-/* MR10 */ };
-
- { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} }
- if ( !GenCC ) gen1("zzLOOP(zztasp%d);\n", BlkLevel-1);
- --tabs;
- gen("}\n");
- q->visited = FALSE;
- tokensRefdInBlock = savetkref;
-}
-
-/*
- * Generate code for a loop blk of form:
- *
- * |---|
- * v |
- * --o-->o-->o-G-o-->o--
- * | ^
- * v |
- * o-----------o
- *
- * q->end points to the last node (far right) in the blk.
- *
- * Note that q->end->jtype must be 'EndBlk'.
- *
- * Generate code roughly of the following form:
- *
- * do {
- * ... code for alternatives ...
- * } while ( First Set of aLoopBlk );
- *
- * OR if > 1 alternative
- *
- * do {
- * ... code for alternatives ...
- * else break;
- * } while ( 1 );
- */
-void
-#ifdef __USE_PROTOS
-genLoopBegin( Junction *q )
-#else
-genLoopBegin( q )
-Junction *q;
-#endif
-{
- set f;
- int i;
- int max_k;
- set savetkref;
- savetkref = tokensRefdInBlock;
- require(q!=NULL, "genLoopBegin: invalid node and/or rule");
- require(q->ntype == nJunction, "genLoopBegin: not junction");
- require(q->jtype == aLoopBegin, "genLoopBegin: not loop block");
- require(q->p2!=NULL, "genLoopBegin: invalid Loop Graph");
-
- OutLineInfo(output,q->line,FileStr[q->file]);
-
- BLOCK_Preamble(q);
- BlkLevel++;
- BlockPreambleOption(q,q->pFirstSetSymbol); /* MR21 */
- f = First(q, 1, aLoopBegin, &max_k);
- /* If not simple LL(1), must specify to start at LoopBegin, not LoopBlk */
- if ( LL_k>1 && !set_nil(q->fset[2]) )
- genLoopBlk( q, (Junction *)q->p1, q, max_k );
- else genLoopBlk( q, (Junction *)q->p1, NULL, max_k );
-
- for (i=1; i<=CLL_k; i++) set_free(q->fset[i]);
- for (i=1; i<=CLL_k; i++) set_free(((Junction *)q->p2)->fset[i]);
- --BlkLevel;
- BLOCK_Tail();
- set_free(f);
- tokensRefdInBlock = savetkref;
-/* MR21 */ if (MR_BlkErr) {
-/* MR21 */ set f, fArray[2];
-/* MR21 */ f = ComputeErrorSet(q,1,0 /* use plus block bypass ? */ );
-/* MR21 */ fArray[0]= empty;
-/* MR21 */ fArray[1]= set_dup(f);
-/* MR21 */ gen("if (");
-/* MR21 */ genExprSets(fArray,1); /* note: destroys set arguments */
-/* MR21 */ _gen(") { /* MR21 option -mrblksynerr */\n");
-/* MR21 */ tabs++;
-/* MR21 */ tab();
-/* MR21 */ _gen("/* nothing */ }\n");
-/* MR21 */ tab();
-/* MR21 */ makeErrorClause(q,f,1,0 /* use plus block bypass ? */ ); /* frees set */
-/* MR21 */ tabs--;
-/* MR21 */ };
- if (q->end->p1 != NULL) TRANS(q->end->p1);
-}
-
-/*
- * Generate code for a loop blk of form:
- *
- * |---|
- * v |
- * --o-G-o-->o--
- *
- * q->end points to the last node (far right) in the blk.
- * Note that q->end->jtype must be 'EndBlk'.
- *
- * Generate code roughly of the following form:
- *
- * do {
- * ... code for alternatives ...
- * } while ( First Set of aPlusBlk );
- *
- * OR if > 1 alternative
- *
- * do {
- * ... code for alternatives ...
- * else if not 1st time through, break;
- * } while ( 1 );
- */
-void
-#ifdef __USE_PROTOS
-genPlusBlk( Junction *q )
-#else
-genPlusBlk( q )
-Junction *q;
-#endif
-{
- int max_k;
- set f;
- int need_right_curly;
- int lastAltEmpty; /* MR23 */
- set savetkref;
- Junction *guessBlock; /* MR10 */
- int singleAlt; /* MR10 */
-
- savetkref = tokensRefdInBlock;
- require(q!=NULL, "genPlusBlk: invalid node and/or rule");
- require(q->ntype == nJunction, "genPlusBlk: not junction");
- require(q->jtype == aPlusBlk, "genPlusBlk: not Plus block");
- require(q->p2 != NULL, "genPlusBlk: not a valid Plus block");
-
- if ( q->visited ) return;
- q->visited = TRUE;
- OutLineInfo(output,q->line,FileStr[q->file]);
- BLOCK_Preamble(q);
- BlkLevel++;
-
- BlockPreambleOption((Junction *)q, q->pFirstSetSymbol); /* MR21 */
-
- /* first_item_is_guess_block doesn't care what kind of node it is */
-
- guessBlock=first_item_is_guess_block( (Junction *)q->p1); /* MR10 */
-
- /* if the ignore flag is set on the 2nd alt and that alt is empty,
- * then it is the implied optional alternative that we added for (...)+
- * and, hence, only 1 alt.
- */
-
-/* MR10 Reported by Pulkkinen Esa (esap@cs.tut.fi)
- * Outer code for guess blocks ignored when there is only one alt
- * for a (...)+ block.
- * Force use of regular code rather than "optimized" code for that case
- */
-
- singleAlt=( ( (Junction *) q->p2)->p2 == NULL) &&
- ( ( (Junction *) q->p2)->ignore ); /* only one alternative? */
-
- if (singleAlt && !guessBlock) /* MR10 */
- {
-
- Predicate *a=NULL;
- /* if the only alt has a semantic predicate, hoist it; must test before
- * entering loop.
- */
- if ( ParseWithPredicates )
- {
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
- a = MR_find_predicates_and_supp((Node *)q);
- require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty");
-
- if ( a!=NULL ) {
- gen("if (");
- a=genPredTreeMain(a, (Node *)q); /* MR10 */
- _gen(") {\n");
- }
- }
- gen("do {\n");
- tabs++;
- TRANS(q->p1);
- if ( !GenCC ) gen1("zzLOOP(zztasp%d);\n", BlkLevel-1);
- f = First(q, 1, aPlusBlk, &max_k);
- if ( DemandLookahead ) {
- if ( !GenCC ) {gen1("LOOK(%d);\n", max_k);}
- else gen1("look(%d);\n", max_k);
- }
- --tabs;
- gen("} while ( ");
- if ( q->parm!=NULL && q->predparm ) _gen1("(%s) && ", q->parm);
- genExpr(q);
- if ( ParseWithPredicates && a!=NULL )
- {
- if (! MR_comparePredicates(q->predicate,a)) {
- _gen("&&");
- a=genPredTreeMain(a, (Node *)q); /* MR10 */
- };
- }
- _gen(" );\n");
- if ( ParseWithPredicates && a!=NULL ) gen("}\n");
- --BlkLevel;
- BLOCK_Tail();
- q->visited = FALSE;
- freeBlkFsets(q);
- set_free(f);
- tokensRefdInBlock = savetkref;
-/* MR21 */ if (MR_BlkErr) {
-/* MR21 */ set f, fArray[2];
-/* MR21 */ f = ComputeErrorSet(q,1,1 /* use plus block bypass ? */ );
-/* MR21 */ fArray[0]= empty;
-/* MR21 */ fArray[1]= set_dup(f);
-/* MR21 */ gen("if (");
-/* MR21 */ genExprSets(fArray,1); /* note: destroys set arguments */
-/* MR21 */ _gen(") { /* MR21 option -mrblksynerr */\n");
-/* MR21 */ tabs++;
-/* MR21 */ tab();
-/* MR21 */ _gen("/* nothing */ }\n");
-/* MR21 */ tab();
-/* MR21 */ makeErrorClause(q,f,1,1 /* use plus block bypass ? */ ); /* frees set */
-/* MR21 */ tabs--;
-/* MR21 */ };
- if (q->end->p1 != NULL) TRANS(q->end->p1);
-/* MR10 */ if (MRhoisting) {
-/* MR10 */ predicate_free(a);
-/* MR10 */ };
- return;
- }
- gen("do {\n");
- tabs++;
- f = genBlk(q, aPlusBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */);
-/* MR6 */
-/* MR6 Sinan Karasu (sinan@tardis.ds.boeing.com) */
-/* MR6 Failed to turn off guess mode when leaving block */
-/* MR6 */
-/* MR6 */ if ( has_guess_block_as_last_item(q) ) {
-/* MR10 */ gen("/* MR10 ()+ */ else {\n");
-/* MR10 */ tabs++;
-/* MR10 */ need_right_curly++;
-/* MR10 */ gen("/* MR10 ()+ */ if ( !zzrv ) zzGUESS_DONE;\n");
-/* MR6 */ gen("/* MR10 ()+ */ if ( zzcnt > 1 ) break;\n");
-/* MR10 */ } else {
-/* MR10 */ gen("/* MR10 ()+ */ else {\n");
-/* MR10 */ tabs++;
-/* MR10 */ need_right_curly++;
-/* MR10 */ gen("if ( zzcnt > 1 ) break;\n");
-/* MR10 */ };
-
-/* MR21 */ if (MR_BlkErr && 1 >= max_k) {
-/* MR21 */ set f;
-/* MR21 */ f = ComputeErrorSet(q,1,0 /* use plus block bypass ? */ );
-/* MR21 */ tabs++;
-/* MR21 */ tab();
-/* MR21 */ makeErrorClause(q,f,1,0 /* use plus block bypass ? */ ); /* frees set */
-/* MR21 */ tabs--;
-/* MR21 */ }
-/* MR21 */ else {
- tab();
- makeErrorClause(q,f,max_k,1 /* use plus block bypass ? */);
- /* MR21 I think this generates the wrong set ? */
- /* MR21 because it includes the plus block bypass ? */
- /* MR21 but I'm afraid to change it without additional checking */
- }
-
- { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} }
- freeBlkFsets(q);
- gen("zzcnt++;");
- if ( !GenCC ) _gen1(" zzLOOP(zztasp%d);", BlkLevel-1);
- _gen("\n");
- if ( DemandLookahead ) {
- if ( !GenCC ) {gen1("LOOK(%d);\n", max_k);}
- else gen1("look(%d);\n", max_k);
- }
- --tabs;
- if ( q->parm!=NULL && q->predparm ) {gen1("} while (%s);\n", q->parm);}
- else gen("} while ( 1 );\n");
- --BlkLevel;
- BLOCK_Tail();
- q->visited = FALSE;
- tokensRefdInBlock = savetkref;
-/* MR21 */ if (MR_BlkErr) {
-/* MR21 */ set f, fArray[2];
-/* MR21 */ f = ComputeErrorSet(q,1,1 /* use plus block bypass ? */ );
-/* MR21 */ fArray[0]= empty;
-/* MR21 */ fArray[1]= set_dup(f);
-/* MR21 */ gen("if (");
-/* MR21 */ genExprSets(fArray,1); /* note: destroys set arguments */
-/* MR21 */ _gen(") { /* MR21 option -mrblksynerr */\n");
-/* MR21 */ tabs++;
-/* MR21 */ tab();
-/* MR21 */ _gen("/* nothing */ }\n");
-/* MR21 */ tab();
-/* MR21 */ makeErrorClause(q,f,1,1 /* use plus block bypass ? */ ); /* frees set */
-/* MR21 */ tabs--;
-/* MR21 */ };
- if (q->end->p1 != NULL) TRANS(q->end->p1);
-}
-
-/*
- * Generate code for a sub blk of alternatives of form:
- *
- * --o-G1--o--
- * | ^
- * v /|
- * o-G2-o|
- * | ^
- * v |
- * ..........
- * | ^
- * v /
- * o-Gn-o
- *
- * q points to the 1st junction of blk (upper-left).
- * q->end points to the last node (far right) in the blk.
- * Note that q->end->jtype must be 'EndBlk'.
- * The last node in every alt points to q->end.
- *
- * Generate code of the following form:
- * if ( First(G1) ) {
- * ...code for G1...
- * }
- * else if ( First(G2) ) {
- * ...code for G2...
- * }
- * ...
- * else {
- * ...code for Gn...
- * }
- */
-
-void
-#ifdef __USE_PROTOS
-genSubBlk( Junction *q )
-#else
-genSubBlk( q )
-Junction *q;
-#endif
-{
- int max_k;
- set f;
- int need_right_curly;
- int lastAltEmpty; /* MR23 */
- set savetkref;
- savetkref = tokensRefdInBlock;
- require(q->ntype == nJunction, "genSubBlk: not junction");
- require(q->jtype == aSubBlk, "genSubBlk: not subblock");
-
- OutLineInfo(output,q->line,FileStr[q->file]);
- BLOCK_Preamble(q);
- BlkLevel++;
- BlockPreambleOption(q,q->pFirstSetSymbol); /* MR21 */
- f = genBlk(q, aSubBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */);
-
-/* MR23
- Bypass error clause generation when exceptions are used in a sub block
- in which the last alternative is epsilon. Example: "(A | B | )".
- See multi-line note in genBlk near call to isEmptyAlt.
-*/
- if (FoundException && lastAltEmpty) {
- gen("/* MR23 skip error clause for (...| epsilon) when exceptions in use */\n");
- }
- else {
- if ( q->p2 != NULL ) {tab(); makeErrorClause(q,f,max_k,0 /* use plus block bypass ? */ );}
- }
-
- { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} }
- freeBlkFsets(q);
- --BlkLevel;
- BLOCK_Tail();
-
- if ( q->guess )
- {
- gen("zzGUESS_DONE\n");
- }
-
- /* must duplicate if (alpha)?; one guesses (validates), the
- * second pass matches */
- if ( q->guess && analysis_point(q)==q )
- {
- OutLineInfo(output,q->line,FileStr[q->file]);
- BLOCK_Preamble(q);
- BlkLevel++;
- f = genBlk(q, aSubBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */);
- if ( q->p2 != NULL ) {tab(); makeErrorClause(q,f,max_k,0 /* use plus block bypass ? */);}
- { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} }
- freeBlkFsets(q);
- --BlkLevel;
- BLOCK_Tail();
- }
-
- tokensRefdInBlock = savetkref;
- if (q->end->p1 != NULL) TRANS(q->end->p1);
-}
-
-static int TnodesAllocatedPrevRule=0;
-
-/*
- * Generate code for a rule.
- *
- * rule--> o-->o-Alternatives-o-->o
- * Or,
- * rule--> o-->o-Alternative-o-->o
- *
- * The 1st junction is a RuleBlk. The second can be a SubBlk or just a junction
- * (one alternative--no block), the last is EndRule.
- * The second to last is EndBlk if more than one alternative exists in the rule.
- *
- * To get to the init-action for a rule, we must bypass the RuleBlk,
- * and possible SubBlk.
- * Mark any init-action as generated so genBlk() does not regenerate it.
- */
-void
-#ifdef __USE_PROTOS
-genRule( Junction *q )
-#else
-genRule( q )
-Junction *q;
-#endif
-{
-
- const char * returnValueInitializer;
-
-do { /* MR10 Change recursion into iteration */
-
- int max_k;
- set follow, rk, f;
- ActionNode *a;
- RuleEntry *r;
- int lastAltEmpty; /* MR23 */
- static int file = -1;
- int need_right_curly;
- require(q->ntype == nJunction, "genRule: not junction");
- require(q->jtype == RuleBlk, "genRule: not rule");
-
-/* MR14 */ require (MR_BackTraceStack.count == 0,"-alpha MR_BackTraceStack.count != 0");
-/* MR14 */ MR_pointerStackReset(&MR_BackTraceStack);
-/* MR14 */ if (AlphaBetaTrace) MR_MaintainBackTrace=1;
-
- CurRule=q->rname; /* MR11 */
-
- r = (RuleEntry *) hash_get(Rname, q->rname);
- if ( r == NULL ) warnNoFL("Rule hash table is screwed up beyond belief");
- if ( q->file != file ) /* open new output file if need to */
- {
-/* MR6 */
-/* MR6 Simpler to debug when output goes to stdout rather than a file */
-/* MR6 */
-/* MR6 */ if (UseStdout) {
-/* MR6 */ output = stdout;
-/* MR6 */ } else {
-/* MR6 */ if ( output != NULL) fclose( output );
-/* MR6 */ output = fopen(OutMetaName(outname(FileStr[q->file])), "w");
-/* MR6 */ };
- require(output != NULL, "genRule: can't open output file");
-
-#ifdef SPECIAL_FOPEN
- special_fopen_actions(OutMetaName(outname(FileStr[q->file]))); /* MR1 */
-#endif
- if ( file == -1 ) genHdr1(q->file);
- else genHdr(q->file);
- file = q->file;
- }
-
- if (InfoM) {
- fprintf(stderr," rule %s\n",q->rname);
- fflush(output);
- };
-
-#if 0
- if (strcmp(q->rname,"***debug***") == 0) {
- fprintf(stderr,"***debug*** %s reached\n",q->rname);
- MR_break();
- };
-#endif
-
- DumpFuncHeader(q,r);
- tabs++;
-
- /* MR23
-
- If there is a single return value then it can be initialized in
- the declaration using assignment syntax. If there are multiple
- return values then antlr creates a struct and initialization takes
- place element by element for each element of the struct. For
- multiple elements the initialization is by assignment so we have
- to wait until all declarations are done before emitting that code -
- because of restrictions in C which don't exist in C++.
-
- In the past (before MR23) the only kind of initialization was
- the PURIFY macro which was just a memset() of 0. Now we allow
- the user to specify an initial value. PURIFY is still used in C
- mode because C does not have constructors. However, PURIFY is
- not used in C++ mode because it might overwrite information created
- by elements which have their own ctor.
-
- */
-
- if ( q->ret!=NULL )
- {
- if ( hasMultipleOperands(q->ret) ) /* MR23 */
- {
-
- /* Emit initialization code later. */
-
- gen1("struct _rv%d _retv;\n",r->rulenum);
- }
- else
- {
- /* Emit initialization code now. */
-
- tab();
- DumpType(q->ret, output);
- returnValueInitializer = getInitializer(q->ret);
- if (returnValueInitializer == NULL) { /* MR23 */
- gen(" _retv;\n"); /* MR1 MR3 */
- } /* MR23 */
- else { /* MR23 */
- gen1(" _retv = %s;\n", returnValueInitializer); /* MR23 */
- } /* MR23 */
- }
- }
-
- OutLineInfo(output,q->line,FileStr[q->file]);
-
- if (InfoM) {
- fflush(output);
- };
-
- gen("zzRULE;\n");
- if ( FoundException )
- {
- gen("int _sva=1;\n");
- }
- if ( GenCC && GenAST )
- gen("ASTBase *_ast = NULL, *_sibling = NULL, *_tail = NULL;\n");
- if ( GenCC ) genTokenPointers(q);
- if ( GenCC&&GenAST ) genASTPointers(q);
- if ( q->el_labels!=NULL ) genElementLabels(q->el_labels);
- if ( FoundException ) gen("int _signal=NoSignal;\n");
-
- if ( !GenCC ) gen1("zzBLOCK(zztasp%d);\n", BlkLevel);
-
-/* MR10 */ /* move zzTRACEIN to before init action */
-
-/* MR10 */ if ( TraceGen ) {
-/* MR10 */ if ( GenCC ) {gen1("zzTRACEIN(\"%s\");\n", q->rname);}
-/* MR10 */ else gen1("zzTRACEIN((ANTLRChar *)\"%s\");\n", q->rname);
-/* MR10 */ }
-
-/* MR7 Moved PURIFY() to after all local variables have been declared */
-/* MR7 so that the generated code is valid C as well as C++ */
-/* MR7 Jan Mikkelsen 10-June-1997 */
-
-
- /*
- MR23 Do the PURIFY macro only for C mode.
- C++ users should use constructors or initialization expressions.
- */
-
- if ( q->ret != NULL ) /* MR7 */
- { /* MR7 */
- if (hasMultipleOperands(q->ret)) { /* MR23 */
- if (PURIFY == TRUE) {
- gen1("PCCTS_PURIFY(_retv,sizeof(struct _rv%d))\n",r->rulenum); /* MR23 */
- }
- } /* MR7 */
- else { /* MR7 */
-
- /* MR23
- If there were only one return value operand and
- it had an initializer then it would have been
- initiailized in the declaration.
- */
-
- returnValueInitializer = getInitializer(q->ret); /* MR23 */
- if (returnValueInitializer == NULL) { /* MR23 */
- if (PURIFY == TRUE) {
- gen("PCCTS_PURIFY(_retv,sizeof("); /* MR23 */
- DumpType(q->ret, output); /* MR7 */
- gen("))\n"); /* MR7 */
- }
- } /* MR23 */
- } /* MR7 */
-
- if (hasMultipleOperands(q->ret)) { /* MR23 */
- DumpInitializers(output, r, q->ret); /* MR23 */
- }
-
- }
- if ( !GenCC ) gen("zzMake0;\n");
- if ( FoundException ) gen("*_retsignal = NoSignal;\n");
-
- if ( !GenCC ) gen("{\n");
-
- if ( has_guess_block_as_first_item((Junction *)q->p1) )
- {
- gen("zzGUESS_BLOCK\n");
- }
-
- /* L o o k F o r I n i t A c t i o n */
- if ( ((Junction *)q->p1)->jtype == aSubBlk )
- a = findImmedAction( ((Junction *)q->p1)->p1 );
- else
- a = findImmedAction( q->p1 ); /* only one alternative in rule */
- if ( a!=NULL && !a->is_predicate)
- {
- /* MR21 */ if (!a->noHoist) dumpActionPlus(a, a->action, output, tabs, a->file, a->line, 1);
- a->done = 1; /* ignore action. We have already handled it */
- }
-
- BlkLevel++;
- q->visited = TRUE; /* mark RULE as visited for FIRST/FOLLOW */
- BlockPreambleOption((Junction *)q->p1, NULL); /* MR21 */
- f = genBlk((Junction *)q->p1, RuleBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */);
- if ( q->p1 != NULL )
- if ( ((Junction *)q->p1)->p2 != NULL )
- {tab(); makeErrorClause((Junction *)q->p1,f,max_k,0 /* use plus block bypass ? */);}
- { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} }
- freeBlkFsets((Junction *)q->p1);
- q->visited = FALSE;
- --BlkLevel;
- if ( !GenCC ) gen1("zzEXIT(zztasp%d);\n", BlkLevel);
-
- genTraceOut(q);
-
- if ( q->ret!=NULL ) gen("return _retv;\n") else gen("return;\n");
- /* E r r o r R e c o v e r y */
- NewSet();
- rk = empty;
-
-/* MR14 */ if (r->dontComputeErrorSet) {
-/* MR14 */ follow=empty;
- } else {
- MR_pointerStackReset(&MR_BackTraceStack); /* MR14 */
- MR_ErrorSetComputationActive=1;
- REACH(q->end, 1, &rk, follow);
- MR_ErrorSetComputationActive=0;
- require (MR_BackTraceStack.count == 0,"K: MR_BackTraceStack.count != 0");
- }
-
- FillSet( follow );
- set_free( follow );
-
- /* MR20 G. Hobbelt
- Isn't it so that "fail:" is ONLY referenced when:
-
- !FoundException || FoundGuessBlk ?
-
- Therefore add the "if" around this piece of code generation...
-
- Should guessing mode also use _handler label instead of "fail"
- when exception handling is active? gen can automatically put
- "if (guessing)" there so as to skip all kinds of user code.
-
- */
-
- if ( !FoundException || FoundGuessBlk ) /* MR20 G. Hobbelt */
- { /* MR20 G. Hobbelt */
- _gen("fail:\n");
- if ( !GenCC ) gen("zzEXIT(zztasp1);\n");
- if ( FoundGuessBlk ) {
- if ( !GenCC ) {gen("if ( zzguessing ) zzGUESS_FAIL;\n");}
- else gen("if ( guessing ) zzGUESS_FAIL;\n");
- }
- if ( q->erraction!=NULL )
- dumpAction(q->erraction, output, tabs, q->file, q->line, 1);
- if ( GenCC )
- {
- gen1("syn(zzBadTok, %s, zzMissSet, zzMissTok, zzErrk);\n",
- r->egroup==NULL?"(ANTLRChar *)\"\"":r->egroup);
- }
- else
- {
- gen1("zzsyn(zzMissText, zzBadTok, %s, zzMissSet, zzMissTok, zzErrk, zzBadText);\n",
- r->egroup==NULL?"(ANTLRChar *)\"\"":r->egroup);
- }
- gen3("%sresynch(setwd%d, 0x%x);\n", GenCC?"":"zz", wordnum, 1<<setnum);
-
- if ( q->ret!=NULL ) {
- genTraceOut(q);
- gen("return _retv;\n");
- } else if ( q->exceptions!=NULL ) {
- genTraceOut(q);
- gen("return;\n");
- } else if (!FoundException) { /* MR10 */
- genTraceOut(q); /* MR10 */
- };
-
- } /* MR20 G. Hobbelt */
-
- if ( !GenCC ) gen("}\n");
-
- /* Gen code for exception handlers */
- /* make sure each path out contains genTraceOut() */
-
- if ( q->exceptions!=NULL )
- {
-
- gen("/* exception handlers */\n");
-
- dumpExceptions(q->exceptions);
-
- if ( !r->has_rule_exception )
- {
- _gen("_handler:\n");
- gen("zzdflthandlers(_signal,_retsignal);\n");
- }
-/* MR20 G. Gobbelt The label "adios" is never referenced */
-
-#if 0
- _gen("_adios:\n");
-#endif
- if ( q->ret!=NULL ) {
- genTraceOut(q);
- gen("return _retv;\n");
- }
- else {
- genTraceOut(q);
- gen("return;\n");
- }
- }
- else if ( FoundException )
- {
- _gen("_handler:\n");
- gen("zzdflthandlers(_signal,_retsignal);\n");
-
-/* MR1 */
-/* MR1 7-Apr-97 Fix suggested by: John Bair (jbair@iftime.com) */
-/* MR1 */
-
- if ( q->ret != NULL) { /* MR1 */
- genTraceOut(q); /* MR10 */
- gen("return _retv;\n"); /* MR1 */
- } else { /* MR1 */
- genTraceOut(q); /* MR10 */
- gen("return;\n") ; /* MR1 */
- }; /* MR1 */
- }
-
- tabs--;
- gen("}\n");
-
-/* MR10 Tired of looking at stacks that are as deep as the number of */
-/* MR10 rules. Changes recursion to iteration. */
-
- MR_releaseResourcesUsedInRule( (Node *) q ); /* MR10 */
-
- if (InfoT) {
- fprintf(output,"\n/* tnodes created for rule %s: %d */\n",
- q->rname, (TnodesAllocated-TnodesAllocatedPrevRule) );
- };
-
- TnodesAllocatedPrevRule=TnodesAllocated;
-
- if (q->p2 == NULL) dumpAfterActions( output );
- q=(Junction *)q->p2;
- require(q==NULL || q->jtype==RuleBlk,"RuleBlk p2 does not point to another RuleBlk");
-
-} while (q != NULL);
-
-/**** The old code ****/
-/**** if ( q->p2 != NULL ) {TRANS(q->p2);} ****/ /* generate code for next rule too */
-/**** else dumpAfterActions( output ); ****/
-
-}
-
-
-/* This is for the function definition, not the declaration. */
-
-static void
-#ifdef __USE_PROTOS
-DumpFuncHeader( Junction *q, RuleEntry *r )
-#else
-DumpFuncHeader( q, r )
-Junction *q;
-RuleEntry *r;
-#endif
-{
-/* */
-/* MR1 10-Apr-97 MR1 Simplify insertion of commas in function header */
-/* */
- int needComma; /* MR1 */
-
-
- /* A N S I */
- _gen("\n");
- if ( q->ret!=NULL )
- {
- if ( hasMultipleOperands(q->ret) ) /* MR23 */
- {
- if (GenCC) gen2("%s::_rv%d\n", CurrentClassName, r->rulenum)
- else gen1("struct _rv%d\n",r->rulenum);
- }
- else
- {
- DumpType(q->ret, output);
- gen("\n");
- }
- }
- else
- {
- _gen("void\n");
- }
-/* MR1 */
-/* MR1 10-Apr-97 133MR1 Replace __STDC__ with __USE_PROTOS */
-/* MR1 */
- if ( !GenCC ) _gen("#ifdef __USE_PROTOS\n"); /* MR1 */
- if ( !GenCC ) gen2("%s%s(", RulePrefix, q->rname)
- else gen3("%s::%s%s(", CurrentClassName, RulePrefix,q->rname);
-
- /* If we generate C++ method names, we must hide default arguments */
- /* which can appear in the parameter declaration list. */
- /* NOTICE: this is done only here, for the method definition, but */
- /* not for the method declaration inside the class */
- /* definition. This is exactly the behaviour defined in */
- /* C++ standard for default paramters. */
-
- DumpANSIFunctionArgDef(output,q, 0 /* emit initializers ? */);
- _gen("\n");
-
- if ( GenCC ) {
- gen("{\n");
- return;
- }
-
- /* K & R */
- gen("#else\n");
- gen2("%s%s(", RulePrefix, q->rname);
- needComma=0; /* MR1 */
- if ( GenAST ) /* MR1 */
- { /* MR1 */
- _gen("_root"); /* MR1 */
- needComma=1; /* MR1 */
- } /* MR1 */
- if ( FoundException ) /* MR1 */
- { /* MR1 */
- if (needComma) {_gen(",");needComma=0;}; /* MR1 */
- _gen("_retsignal"); /* MR1 */
- needComma=1; /* MR1 */
- } /* MR1 */
-/* MR5 Change below by Jan Mikkelsen (janm@zeta.org.au) 26-May-97 MR5 */
- DumpListOfParmNames( q->pdecl, output, needComma ); /* MR5 */
- gen(")\n");
- if ( GenAST ) gen("AST **_root;\n");
- if ( FoundException ) gen("int *_retsignal;\n");
- DumpOldStyleParms( q->pdecl, output );
- gen("#endif\n");
- gen("{\n");
-}
-
-void
-#ifdef __USE_PROTOS
-DumpANSIFunctionArgDef(FILE *f, Junction *q, int bInitializer)
-#else
-DumpANSIFunctionArgDef(f,q,bInitializer)
-FILE *f;
-Junction *q;
-int bInitializer;
-#endif
-{
- if ( GenAST )
- {
- if ( GenCC ) {fprintf(f,"ASTBase **_root");}
- else fprintf(f,"AST**_root");
- if ( !FoundException && q->pdecl!=NULL ) fprintf(f,",");
- }
- if ( FoundException )
- {
- if ( GenAST ) fprintf(f,",");
- fprintf(f,"int *_retsignal");
- if ( q->pdecl!=NULL ) {
- fprintf(f,",");
- }
- }
- if ( q->pdecl!=NULL ) {
- DumpFormals(f, q->pdecl, bInitializer); /* MR23 */
- }
- else {
- if ( !GenAST && !FoundException ) {
- fprintf(f,"void");
- }
- }
- fprintf(f,")");
-}
-
-void
-#ifdef __USE_PROTOS
-genJunction( Junction *q )
-#else
-genJunction( q )
-Junction *q;
-#endif
-{
- require(q->ntype == nJunction, "genJunction: not junction");
- require(q->jtype == Generic, "genJunction: not generic junction");
-
- if ( q->p1 != NULL ) TRANS(q->p1);
- if ( q->p2 != NULL ) TRANS(q->p2);
-}
-
-void
-#ifdef __USE_PROTOS
-genEndBlk( Junction *q )
-#else
-genEndBlk( q )
-Junction *q;
-#endif
-{
-}
-
-void
-#ifdef __USE_PROTOS
-genEndRule( Junction *q )
-#else
-genEndRule( q )
-Junction *q;
-#endif
-{
-}
-
-void
-#ifdef __USE_PROTOS
-genHdr( int file )
-#else
-genHdr( file )
-int file;
-#endif
-{
- int i;
-
- _gen("/*\n");
- _gen(" * A n t l r T r a n s l a t i o n H e a d e r\n");
- _gen(" *\n");
- _gen(" * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001\n");
- _gen(" * Purdue University Electrical Engineering\n");
- _gen(" * With AHPCRC, University of Minnesota\n");
- _gen1(" * ANTLR Version %s\n", Version);
- _gen(" *\n");
-/* MR10 */ _gen(" * ");
-/* MR10 */ for (i=0 ; i < Save_argc ; i++) {
-/* MR10 */ _gen(" ");
-/* MR10 */ _gen(Save_argv[i]);
-/* MR10 */ };
- _gen("\n");
- _gen(" *\n");
- _gen(" */\n\n");
- if (FirstAction != NULL ) dumpAction( FirstAction, output, 0, -1, 0, 1); /* MR11 MR15b */
- _gen1("#define ANTLR_VERSION %s\n", VersionDef);
- _gen("#include \"pcctscfg.h\"\n");
- _gen("#include \"pccts_stdio.h\"\n");
- if ( strcmp(ParserName, DefaultParserName)!=0 )
- _gen2("#define %s %s\n", DefaultParserName, ParserName);
- if ( strcmp(ParserName, DefaultParserName)!=0 )
- {_gen1("#include \"%s\"\n", RemapFileName);}
- OutLineInfo(output,1,FileStr[file]);
- if ( GenCC ) {
- if ( UserTokenDefsFile != NULL )
- fprintf(output, "#include %s\n", UserTokenDefsFile);
- else
- fprintf(output, "#include \"%s\"\n", DefFileName);
- }
-
- if ( HdrAction != NULL ) dumpAction( HdrAction, output, 0, -1, 0, 1);
- if ( !GenCC && FoundGuessBlk )
- {
- _gen("#define ZZCAN_GUESS\n");
- _gen("#include \"pccts_setjmp.h\"\n"); /* MR15 K.J. Cummings (cummings@peritus.com) */
- }
- if ( FoundException )
- {
- _gen("#define EXCEPTION_HANDLING\n");
- _gen1("#define NUM_SIGNALS %d\n", NumSignals);
- }
- if ( !GenCC && OutputLL_k > 1 ) _gen1("#define LL_K %d\n", OutputLL_k);
- if ( GenAST&&!GenCC ) _gen("#define GENAST\n\n");
- if ( GenAST ) {
- if ( GenCC ) {_gen1("#include \"%s\"\n\n", ASTBASE_H);}
- else _gen("#include \"ast.h\"\n\n");
- }
- if ( !GenCC && DemandLookahead ) _gen("#define DEMAND_LOOK\n\n");
-#ifdef DUM
- if ( !GenCC && LexGen ) {
- _gen1("#define zzEOF_TOKEN %d\n", (TokenInd!=NULL?TokenInd[EofToken]:EofToken));
- }
-#endif
- /* ###WARNING: This will have to change when SetWordSize changes */
- if ( !GenCC ) _gen1("#define zzSET_SIZE %d\n", NumWords(TokenNum-1)*sizeof(unsigned));
- if (TraceGen) {
- _gen("#ifndef zzTRACE_RULES\n"); /* MR20 */
- _gen("#define zzTRACE_RULES\n"); /* MR20 */
- _gen("#endif\n"); /* MR22 */
- };
- if ( !GenCC ) {_gen("#include \"antlr.h\"\n");}
- else {
- _gen1("#include \"%s\"\n", APARSER_H);
- _gen1("#include \"%s.h\"\n", CurrentClassName);
- }
- if ( !GenCC ) {
- if ( UserDefdTokens )
- {_gen1("#include %s\n", UserTokenDefsFile);}
- /* still need this one as it has the func prototypes */
- _gen1("#include \"%s\"\n", DefFileName);
- }
- /* still need this one as it defines the DLG interface */
- if ( !GenCC ) _gen("#include \"dlgdef.h\"\n");
- if ( LexGen && GenCC ) _gen1("#include \"%s\"\n", DLEXERBASE_H);
- if ( GenCC ) _gen1("#include \"%s\"\n", ATOKPTR_H);
- if ( !GenCC && LexGen ) _gen1("#include \"%s\"\n", ModeFileName);
-
-/* MR10 Ofer Ben-Ami (gremlin@cs.huji.ac.il) */
-/* MR10 Finally, a definition of the Purify macro */
-
- if (PURIFY == TRUE) { /* MR23 */
- _gen("\n/* MR23 In order to remove calls to PURIFY use the antlr"); /* MR23 */
- _gen(" -nopurify option */\n\n"); /* MR23 */
- _gen("#ifndef PCCTS_PURIFY\n");
- _gen("#define PCCTS_PURIFY(r,s) memset((char *) &(r),'\\0',(s));\n");
- _gen("#endif\n\n");
- } /* MR23 */
-}
-
-void
-#ifdef __USE_PROTOS
-genHdr1( int file )
-#else
-genHdr1( file )
-int file;
-#endif
-{
- ListNode *p;
-
- genHdr(file);
- if ( GenAST )
- {
- if ( !GenCC ) {
- _gen("#include \"ast.c\"\n");
- _gen("zzASTgvars\n\n");
- }
- }
- if ( !GenCC ) _gen("ANTLR_INFO\n");
- if ( BeforeActions != NULL )
- {
- for (p = BeforeActions->next; p!=NULL; p=p->next)
- {
- UserAction *ua = (UserAction *)p->elem;
- dumpAction( ua->action, output, 0, ua->file, ua->line, 1);
- }
- }
-
- if ( !FoundException ) return;
-
- if ( GenCC )
- {
- _gen1("\nvoid %s::\n", CurrentClassName);
- _gen("zzdflthandlers( int _signal, int *_retsignal )\n");
- _gen("{\n");
- }
- else
- {
- _gen("\nvoid\n");
-/* MR1 */
-/* MR1 10-Apr-97 133MR1 Replace __STDC__ with __USE_PROTOS */
-/* MR1 */
- _gen("#ifdef __USE_PROTOS\n"); /* MR1 */
- _gen("zzdflthandlers( int _signal, int *_retsignal )\n");
- _gen("#else\n");
- _gen("zzdflthandlers( _signal, _retsignal )\n");
- _gen("int _signal;\n");
- _gen("int *_retsignal;\n");
- _gen("#endif\n");
- _gen("{\n");
- }
- tabs++;
- if ( DefaultExGroup!=NULL )
- {
- dumpException(DefaultExGroup, 1);
- if ( !hasDefaultException(DefaultExGroup) )
- {
- gen("default :\n");
- tabs++;
- gen("*_retsignal = _signal;\n");
- tabs--;
- gen("}\n");
- }
- }
- else {
- gen("*_retsignal = _signal;\n");
- }
-
- tabs--;
- _gen("}\n\n");
-}
-
-void
-#ifdef __USE_PROTOS
-genStdPCCTSIncludeFile( FILE *f,char *gate ) /* MR10 */
-#else
-genStdPCCTSIncludeFile( f , gate) /* MR10 */
-FILE *f;
-char * gate; /* MR10 */
-#endif
-{
-/* MR10 Ramanathan Santhanam (ps@kumaran.com) */
-/* MR10 Same preprocessor symbol use to gate stdpccts.h */
-/* MR10 even when two grammars are in use. */
-/* MR10 Derive gate symbol from -fh filename */
-
- if (gate == NULL) {
- fprintf(f,"#ifndef STDPCCTS_H\n"); /* MR10 */
- fprintf(f,"#define STDPCCTS_H\n"); /* MR10 */
- } else {
- fprintf(f,"#ifndef STDPCCTS_%s_H\n",gate); /* MR10 */
- fprintf(f,"#define STDPCCTS_%s_H\n",gate); /* MR10 */
- };
- fprintf(f,"/*\n");
- if (gate == NULL) {
- fprintf(f," * %s -- P C C T S I n c l u d e\n", stdpccts);
- } else {
- fprintf(f," * Standard PCCTS include file with -fh %s -- P C C T S I n c l u d e\n", stdpccts);
- }
- fprintf(f," *\n");
- fprintf(f," * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001\n");
- fprintf(f," * Purdue University Electrical Engineering\n");
- fprintf(f," * With AHPCRC, University of Minnesota\n");
- fprintf(f," * ANTLR Version %s\n", Version);
- fprintf(f," */\n\n");
-
- fprintf(f,"#ifndef ANTLR_VERSION\n");
- fprintf(f,"#define ANTLR_VERSION %s\n", VersionDef);
- fprintf(f,"#endif\n\n");
-
- if (FirstAction != NULL ) dumpAction(FirstAction, f, 0, -1, 0, 1); /* MR11 */
-
- fprintf(f,"#include \"pcctscfg.h\"\n");
- fprintf(f,"#include \"pccts_stdio.h\"\n");
- if ( GenCC )
- {
- if ( UserDefdTokens )
- fprintf(f, "#include %s\n", UserTokenDefsFile);
- else {
- fprintf(f, "#include \"%s\"\n", DefFileName);
- }
-
- fprintf(f, "#include \"%s\"\n", ATOKEN_H);
-
- if ( HdrAction != NULL ) dumpAction( HdrAction, f, 0, -1, 0, 1);
-
- fprintf(f, "#include \"%s\"\n", ATOKENBUFFER_H);
-
- if ( OutputLL_k > 1 ) fprintf(f,"static const unsigned LL_K=%d;\n", OutputLL_k);
- if ( GenAST ) {
- fprintf(f, "#include \"%s\"\n", ASTBASE_H);
- }
-
- if (TraceGen) {
- fprintf(f,"#ifndef zzTRACE_RULES\n"); /* MR20 */
- fprintf(f,"#define zzTRACE_RULES\n"); /* MR20 */
- fprintf(f,"#endif\n"); /* MR22 */
- };
-
- fprintf(f,"#include \"%s\"\n", APARSER_H);
- fprintf(f,"#include \"%s.h\"\n", CurrentClassName);
- if ( LexGen ) fprintf(f,"#include \"%s\"\n", DLEXERBASE_H);
- fprintf(f, "#endif\n");
- return;
- }
-
- if ( strcmp(ParserName, DefaultParserName)!=0 )
- fprintf(f, "#define %s %s\n", DefaultParserName, ParserName);
- if ( strcmp(ParserName, DefaultParserName)!=0 )
- fprintf(f, "#include \"%s\"\n", RemapFileName);
- if ( UserTokenDefsFile != NULL )
- fprintf(f, "#include %s\n", UserTokenDefsFile);
- if ( HdrAction != NULL ) dumpAction( HdrAction, f, 0, -1, 0, 1);
- if ( FoundGuessBlk )
- {
- fprintf(f,"#define ZZCAN_GUESS\n");
- fprintf(f,"#include \"pccts_setjmp.h\"\n");
- }
- if (TraceGen) {
- fprintf(f,"#ifndef zzTRACE_RULES\n"); /* MR20 */
- fprintf(f,"#define zzTRACE_RULES\n"); /* MR20 */
- fprintf(f,"#endif\n"); /* MR22 */
- };
- if ( OutputLL_k > 1 ) fprintf(f,"#define LL_K %d\n", OutputLL_k);
- if ( GenAST ) fprintf(f,"#define GENAST\n");
- if ( FoundException )
- {
-/* MR1 7-Apr-97 1.33MR1 */
-/* MR1 Fix suggested by: */
-/* MR1 Francois-Xavier Fontaine (fontaine_f@istvax.ist.lu) */
-
- fprintf(f,"#define EXCEPTION_HANDLING\n"); /* MR1 */
- fprintf(f,"#define NUM_SIGNALS %d\n", NumSignals); /* MR1 */
- }
- if ( DemandLookahead ) fprintf(f,"#define DEMAND_LOOK\n");
-#ifdef DUM
- if ( LexGen ) fprintf(f, "#define zzEOF_TOKEN %d\n", (TokenInd!=NULL?TokenInd[EofToken]:EofToken));
-#endif
- /* ###WARNING: This will have to change when SetWordSize changes */
- fprintf(f, "#define zzSET_SIZE %d\n", NumWords(TokenNum-1)*sizeof(unsigned));
- if (TraceGen) {
- fprintf(f,"#ifndef zzTRACE_RULES\n"); /* MR20 */
- fprintf(f,"#define zzTRACE_RULES\n"); /* MR20 */
- fprintf(f,"#endif\n"); /* MR22 */
- };
- fprintf(f,"#include \"antlr.h\"\n");
- if ( GenAST ) fprintf(f,"#include \"ast.h\"\n");
- if ( UserDefdTokens )
- fprintf(f, "#include %s\n", UserTokenDefsFile);
- /* still need this one as it has the func prototypes */
- fprintf(f, "#include \"%s\"\n", DefFileName);
- /* still need this one as it defines the DLG interface */
- fprintf(f,"#include \"dlgdef.h\"\n");
- /* don't need this one unless DLG is used */
- if ( LexGen ) fprintf(f,"#include \"%s\"\n", ModeFileName);
- fprintf(f,"#endif\n");
-}
-
-/* dump action 's' to file 'output' starting at "local" tab 'tabs'
- Dump line information in front of action if GenLineInfo is set
- If file == -1 then GenLineInfo is ignored.
- The user may redefine the LineInfoFormatStr to his/her liking
- most compilers will like the default, however.
-
- June '93; changed so that empty lines are left alone so that
- line information is correct for the compiler/debuggers.
-*/
-void
-#ifdef __USE_PROTOS
-dumpAction( char *s, FILE *output, int tabs, int file, int line,
-int final_newline )
-#else
-dumpAction( s, output, tabs, file, line, final_newline )
-char *s;
-FILE *output;
-int tabs;
-int file;
-int line;
-int final_newline;
-#endif
-{
- int inDQuote, inSQuote;
- require(s!=NULL, "dumpAction: NULL action");
- require(output!=NULL, eMsg1("dumpAction: output FILE is NULL for %s",s));
-
- if ( GenLineInfo && file != -1 )
- {
- OutLineInfo(output,line,FileStr[file]);
- }
- PastWhiteSpace( s );
- /* don't print a tab if first non-white char is a # (preprocessor command) */
- if ( *s!='#' ) {TAB;}
- inDQuote = inSQuote = FALSE;
- while ( *s != '\0' )
- {
- if ( *s == '\\' )
- {
- fputc( *s++, output ); /* Avoid '"' Case */
- if ( *s == '\0' ) return;
- if ( *s == '\'' ) fputc( *s++, output );
- if ( *s == '\"' ) fputc( *s++, output );
- }
- if ( *s == '\'' )
- {
- if ( !inDQuote ) inSQuote = !inSQuote;
- }
- if ( *s == '"' )
- {
- if ( !inSQuote ) inDQuote = !inDQuote;
- }
- if ( *s == '\n' )
- {
- fputc('\n', output);
- s++;
- PastWhiteSpace( s );
- if ( *s == '}' )
- {
- --tabs;
- TAB;
- fputc( *s++, output );
- continue;
- }
- if ( *s == '\0' ) return;
- if ( *s != '#' ) /* #define, #endif etc.. start at col 1 */
- {
- TAB;
- }
- }
- if ( *s == '}' && !(inSQuote || inDQuote) )
- {
- --tabs; /* Indent one fewer */
- }
- if ( *s == '{' && !(inSQuote || inDQuote) )
- {
- tabs++; /* Indent one more */
- }
- fputc( *s, output );
- s++;
- }
- if ( final_newline ) fputc('\n', output);
-}
-
-static void
-#ifdef __USE_PROTOS
-dumpAfterActions( FILE *output )
-#else
-dumpAfterActions( output )
-FILE *output;
-#endif
-{
- ListNode *p;
- require(output!=NULL, "dumpAfterActions: output file was NULL for some reason");
- if ( AfterActions != NULL )
- {
- for (p = AfterActions->next; p!=NULL; p=p->next)
- {
- UserAction *ua = (UserAction *)p->elem;
- dumpAction( ua->action, output, 0, ua->file, ua->line, 1);
- }
- }
- fclose( output );
-}
-
-/*
- * Find the next action in the stream of execution. Do not pass
- * junctions with more than one path leaving them.
- * Only pass generic junctions.
- *
- * Scan forward while (generic junction with p2==NULL)
- * If we stop on an action, return ptr to the action
- * else return NULL;
- */
-static ActionNode *
-#ifdef __USE_PROTOS
-findImmedAction( Node *q )
-#else
-findImmedAction( q )
-Node *q;
-#endif
-{
- Junction *j;
- require(q!=NULL, "findImmedAction: NULL node");
- require(q->ntype>=1 && q->ntype<=NumNodeTypes, "findImmedAction: invalid node");
-
- while ( q->ntype == nJunction )
- {
- j = (Junction *)q;
- if ( j->jtype != Generic || j->p2 != NULL ) return NULL;
- q = j->p1;
- if ( q == NULL ) return NULL;
- }
- if ( q->ntype == nAction ) return (ActionNode *)q;
- return NULL;
-}
-
-static void
-#ifdef __USE_PROTOS
-dumpRetValAssign( char *retval, char *ret_def, RuleRefNode * ruleRef /* MR30 */)
-#else
-dumpRetValAssign( retval, ret_def, ruleRef /* MR30 */)
-char *retval;
-char *ret_def;
-RuleRefNode *ruleRefNode;
-#endif
-{
- char *q = ret_def;
-
- tab();
- while ( *retval != '\0' && *q != '\0')
- {
- while ( isspace((*retval)) ) retval++;
- while ( *retval!=',' && *retval!='\0' ) fputc(*retval++, output);
- fprintf(output, " = _trv.");
-
- DumpNextNameInDef(&q, output);
- while ( isspace(*q) ) q++;
- fputc(';', output); fputc(' ', output);
- if ( *retval == ',' ) retval++;
- }
- if (*retval == '\0' && *q != '\0') {
-/* MR30 */ errFL("Fewer output values than output formals for rule reference",
-/* MR30 */ FileStr[ruleRef->file],ruleRef->line);
- }
- if (*retval != '\0' && *q == '\0') {
-/* MR30 */ errFL("More output actuals than output formals for rule reference",
-/* MR30 */ FileStr[ruleRef->file],ruleRef->line);
- }
-}
-
-/* This function computes the set of tokens that can possibly be seen k
- * tokens in the future from point j
- */
-
-static set
-#ifdef __USE_PROTOS
-ComputeErrorSet( Junction *j, int k, int usePlusBlockBypass)
-#else
-ComputeErrorSet( j, k, usePlusBlockBypass )
-Junction *j;
-int k;
-int usePlusBlockBypass;
-#endif
-{
- Junction *alt1;
- set a, rk, f;
- require(j->ntype==nJunction, "ComputeErrorSet: non junction passed");
-
- f = rk = empty;
- for (alt1=j; alt1!=NULL; alt1 = (Junction *)alt1->p2)
- {
- if (alt1->ignore && ! usePlusBlockBypass) continue; /* MR21 - Ignore aPlusBlk forward p2 */
- REACH(alt1->p1, k, &rk, a);
- require(set_nil(rk), "ComputeErrorSet: rk != nil");
- set_free(rk);
- set_orin(&f, a);
- set_free(a);
- }
- return f;
-}
-
-static char *
-#ifdef __USE_PROTOS
-tokenFollowSet(TokNode *p)
-#else
-tokenFollowSet(p)
-TokNode *p;
-#endif
-{
- static char buf[100];
- set rk, a;
- int n;
- rk = empty;
-
- REACH(p->next, 1, &rk, a);
- require(set_nil(rk), "rk != nil");
- set_free(rk);
- n = DefErrSet( &a, 0, NULL );
- set_free(a);
- if ( GenCC )
- sprintf(buf, "err%d", n);
- else
- sprintf(buf, "zzerr%d", n);
- return buf;
-}
-
-static void
-#ifdef __USE_PROTOS
-makeErrorClause( Junction *q, set f, int max_k, int usePlusBlockBypass )
-#else
-makeErrorClause( q, f, max_k, usePlusBlockBypass )
-Junction *q;
-set f;
-int max_k;
-int usePlusBlockBypass;
-#endif
-{
- char * handler_id=""; /* MR7 */
- int nilf=0; /* MR13 */
- RuleEntry *ruleEntry; /* MR14 */
-
- if ( FoundException )
- {
- _gen("else {\n");
- tabs++;
- if ( FoundGuessBlk )
- {
- if ( GenCC ) {gen("if ( guessing ) goto fail;\n");}
- else gen("if ( zzguessing ) goto fail;\n");
- }
- gen("if (_sva) _signal=NoViableAlt;\n");
- gen("else _signal=NoSemViableAlt;\n");
- if (q->outerEG != NULL) {
- handler_id=q->outerEG->altID;
-#if 0
- } else {
- printf("q->curAltNum=%d q->exception_label=%s\n",q->curAltNum,q->exception_label);
- gen("*** DEBUG *** outerEG==NULL\n");
-#endif
- };
- gen1("goto %s_handler; /* MR7 */\n",handler_id); /* MR7 */
- tabs--;
- gen("}\n");
- return;
- }
-
- if ( max_k == 1 )
- {
-/* MR13 */ nilf=set_nil(f);
- if ( GenCC ) {
- _gen1("else {FAIL(1,err%d", DefErrSet1(1,&f,1,NULL));
- } else {
- _gen1("else {zzFAIL(1,zzerr%d", DefErrSet1(1,&f,1,NULL));
- };
- set_free(f);
- }
- else
- {
- int i;
- set_free(f);
- if ( GenCC ) {_gen1("else {FAIL(%d", max_k);}
- else _gen1("else {zzFAIL(%d", max_k);
-
- ruleEntry = (RuleEntry *) hash_get(Rname,q->rname);
-
- for (i=1; i<=max_k; i++)
- {
-/* MR14 */ if (ruleEntry->dontComputeErrorSet) {
-/* MR14 */ f=empty;
- } else {
- f = ComputeErrorSet(q, i, usePlusBlockBypass /* use plus block bypass ? */ );
- }
-
- if ( GenCC ) {_gen1(",err%d", DefErrSet( &f, 1, NULL ));}
- else _gen1(",zzerr%d", DefErrSet( &f, 1, NULL ));
-
- set_free(f);
- }
- }
- _gen(",&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}\n");
-/* MR13 */ if (nilf) {
-/* MR13 */ errFL("empty error set for alt - probably because of undefined rule or infinite left recursion",
-/* MR13 */ FileStr[q->file],q->line);
-/* MR13 */ gen(" /* MR13 empty error set for this alt - undef rule ? infinite left recursion ? */");
-/* MR13 */ };
-}
-
-static /* MR7 */
-#ifdef __USE_PROTOS
-char * findOuterHandlerLabel(ExceptionGroup *eg) /* MR7 */
-#else
-char * findOuterHandlerLabel(eg) /* MR7 */
-ExceptionGroup *eg; /* MR7 */
-#endif
-{
- char *label=NULL; /* MR7 */
- ExceptionGroup *outerEG; /* MR7 */
-
- if (eg->forRule == 0) { /* MR7 */
- if (eg->labelEntry != NULL) { /* MR7 */
- outerEG=eg->labelEntry->outerEG; /* MR7 */
- if (outerEG != NULL) { /* MR7 */
- label=outerEG->altID; /* MR7 */
- outerEG->used=1; /* MR7 */
- }; /* MR7 */
- } else if (eg->outerEG != NULL) { /* MR7 */
- outerEG=eg->outerEG; /* MR7 */
- label=outerEG->altID; /* MR7 */
- outerEG->used=1; /* MR7 */
- }; /* MR7 */
- }; /* MR7 */
- return (label==NULL ? "" : label); /* MR7 */
-} /* MR7 */
-
-/*** debug ***/
-#if 0
-** static /* MR7 */
-** #ifdef __USE_PROTOS
-** char * findOuterAltHandlerLabel(Junction *startJ) /* MR7 */
-** #else
-** char * findOuterAltHandlerLabel(startJ) /* MR7 */
-** Junction *startJ; /* MR7 */
-** #endif
-** { /* MR7 */
-** char *label=NULL; /* MR7 */
-** Junction *alt; /* MR7 */
-** /* MR7 */
-** for (alt=startJ; alt != NULL; alt=alt->outerAltstart) { /* MR7 */
-** label=alt->exception_label; /* MR7 */
-** if (label != NULL) break; /* MR7 */
-** }; /* MR7 */
-** return (label==NULL ? "" : label); /* MR7 */
-** } /* MR7 */
-#endif
-
-#ifdef __USE_PROTOS
-static void OutLineInfo(FILE *file,int line,char *fileName)
-#else
-static void OutLineInfo(file,line,fileName)
- FILE * file;
- int line;
- char * fileName;
-#endif
-{
- static char * prevFileName=NULL;
- static char * prevFileNameMS=NULL;
-
- char * p;
- char * q;
-
- if (! GenLineInfo) return;
-
- if (!GenLineInfoMS) {
- fprintf(file, LineInfoFormatStr,line,fileName);
- } else {
- if (fileName == prevFileName) {
- fprintf(file, LineInfoFormatStr,line,prevFileNameMS);
- } else {
- if (prevFileNameMS != NULL) free (prevFileNameMS);
- prevFileNameMS=(char *)calloc(1,strlen(fileName)+1);
- require(prevFileNameMS != NULL,"why not do this in calloc wrapper");
- q=prevFileNameMS;
- for (p=fileName; *p != 0; p++) {
- *q=*p;
- if (*q == '\\') *q='/';
- q++;
- }
- }
- prevFileName=fileName;
- };
-}
-
-#if 0
-
-/* MR21 */
-
-#ifdef __USE_PROTOS
-void OutFirstSetSymbol(Junction *q, char * pSymbol)
-#else
-void OutFirstSetSymbol(q, pSymbol)
- Junction* q;
- char * pSymbol
-#endif
-{
-
- set f;
- if (pSymbol == NULL) return;
- gen1("/** #FirstSetSymbol(%s) **/\n",pSymbol);
- f = ComputeErrorSet(q, 1, 0 /* use plus block bypass ? */);
- DefErrSetWithSuffix (0 /* nil ok */, &f,0 /* no substitute */, pSymbol, "");
- set_free(f);
-}
-#endif
-
-/* MR21 */
-
-#ifdef __USE_PROTOS
-void BlockPreambleOption(Junction *q, char * pSymbol)
-#else
-void BlockPreambleOption(q, pSymbol)
- Junction* q;
- char * pSymbol;
-#endif
-{
- set f = empty;
- if (pSymbol != NULL) {
- f = ComputeErrorSet(q, 1, 0 /* use plus block bypass ? */);
- gen1("/** #FirstSetSymbol(%s) **/\n",pSymbol);
- DefErrSetWithSuffix (0 /* nil ok */, &f,0 /* no substitute */, pSymbol, "");
- }
- set_free(f);
-}
-
-/* MR21 */
-
-void
-#ifdef __USE_PROTOS
-dumpActionPlus(ActionNode *a, char *s, FILE *output, int tabs, int file, int line,
-int final_newline )
-#else
-dumpActionPlus(a, s, output, tabs, file, line, final_newline )
-ActionNode *a;
-char *s;
-FILE *output;
-int tabs;
-int file;
-int line;
-int final_newline;
-#endif
-{
- dumpAction(s,output,tabs,file,line,final_newline);
-}
-
-
-#if 0
-** #ifdef __USE_PROTOS
-** void MR_ErrorSets(Junction *q, int max_k, int usePlusBlockBypass)
-** #else
-** void MR_ErrorSets(q, max_k, usePlusBlockBypass)
-** Junction *q;
-** int max_k;
-** int usePlusBlockBypass;
-** #endif
-** {
-** int k;
-** set setResult;
-** Junction* alt1;
-** Junction* p;
-** set rk;
-**
-** require (max_k <= CLL_k, "k > CLL_k");
-**
-**
-** for (k = 1; k <= CLL_k; k++) {set_clr(q->fset[k]); }
-**
-** for (k = 1; k <= max_k; k++) {
-** for (alt1=q; alt1 != NULL; alt1 = (Junction *)alt1->p2)
-** {
-** if (alt1->ignore && ! usePlusBlockBypass) continue;
-** p = analysis_point((Junction *)alt1->p1);
-** REACH(p, k, &rk, setResult);
-** require(set_nil(rk), "rk != nil");
-** set_orin(&q->fset[k], setResult);
-** }
-** }
-** }
-#endif
-
-
-#ifdef __USE_PROTOS
-void DumpInitializers(FILE* output, RuleEntry *r, char * pReturn)
-#else
-void DumpInitializers(output, r, pReturn)
-FILE* output;
-RuleEntry *r;
-char * pReturn;
-#endif
-{
- char *p = pReturn;
- char *pDataType;
- char *pSymbol;
- char *pEqualSign;
- char *pValue;
- char *pSeparator;
- int nest = 0;
- char *q;
-
- require(pReturn!=NULL, "DumpInitializer: invalid string");
-
- while (*p != 0) {
- p = endFormal(p,
- &pDataType,
- &pSymbol,
- &pEqualSign,
- &pValue,
- &pSeparator,
- &nest);
- if (nest != 0) return;
- if (pValue != NULL) {
- tab();
- q = strBetween(pSymbol, pEqualSign, pSeparator);
- fprintf(output, "_retv.%s", q);
- q = strBetween(pValue, NULL, pSeparator);
- fprintf(output, " = %s;\n", q);
- }
- }
-}
-
-#ifdef __USE_PROTOS
-void DumpFormals(FILE* output, char * pReturn, int bInitializer)
-#else
-void DumpFormals(output, pReturn, bInitializer)
-FILE* output;
-char * pReturn;
-int bInitializer;
-#endif
-{
- char *p = pReturn;
- char *pDataType;
- char *pSymbol;
- char *pEqualSign;
- char *pValue;
- char *pSeparator;
- int nest = 0;
- char *q;
- int count = 0;
-
- require(pReturn!=NULL, "DumpFormals: invalid string");
-
- while (*p != 0) {
- p = endFormal(p,
- &pDataType,
- &pSymbol,
- &pEqualSign,
- &pValue,
- &pSeparator,
- &nest);
- if (nest != 0) return;
- if (count > 0) fprintf(output,",");
- if (pDataType != NULL && pSymbol != NULL) {
- q = strBetween(pDataType, pSymbol, pSeparator);
- fprintf(output, "%s", q);
- q = strBetween(pSymbol, pEqualSign, pSeparator);
- fprintf(output," %s",q);
- if (pValue != NULL) {
- q = strBetween(pValue, NULL, pSeparator);
- if (bInitializer != 0) {
- fprintf(output, " = %s", q);
- }
- }
- }
- count++;
- }
-}
-
-/* MR23 Check for empty alt in a more intelligent way.
- Previously, an empty alt for genBlk had to point directly
- to the endBlock. This did not work once I changed {...}
- blocks to look like (...|...| epsilon) since there were
- intervening generics. This fixes the problem for this
- particular case. Things like actions or empty blocks of
- various kinds will still cause problems, but I wasnt't
- prepared to handle pathological cases like (A|()*). It
- does handle (A | ()), which is a recommended idiom for
- epsilon.
-
- Actually, this isn't quite correct since it doesn't handle
- the case of the ignore bit in the plus block bypass, but
- I'm too tired to figure out the correct fix, and will just
- work around it.
-*/
-
-#ifdef __USE_PROTOS
-int isEmptyAlt(Node * alt, Node * endBlock)
-#else
-int isEmptyAlt(alt, endBlock)
-Node * alt;
-Node * endBlock;
-#endif
-{
- Node * n = alt;
- Junction * j;
- while (n != endBlock) {
- switch (n->ntype) {
-
- case nRuleRef:
- return 0;
-
- case nToken:
- return 0;
-
- case nAction:
- return 0;
-
- case nJunction:
- goto JUNCTION;
-
- default:
- fatal_internal("Invalid node type");
- return 0;
- }
-JUNCTION:
- j = (Junction *) n;
-
- switch (j->jtype) {
- case Generic:
- {
- n = j->p1;
- goto NEXT;
- }
-
- case aSubBlk:
- {
- n = j->p1; /* MR26 */
- goto NEXT; /* MR26 */
- }
-
- case EndBlk:
- return 0;
-
- case EndRule:
- return 1;
-
- default:
- return 0;
- }
-NEXT: continue;
- }
- return 1;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/generic.h b/BaseTools/Source/C/VfrCompile/Pccts/antlr/generic.h
deleted file mode 100644
index 8d736d5200..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/generic.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * generic.h -- generic include stuff for new PCCTS ANTLR.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#define StrSame 0
-
-#define DefaultParserName "zzparser"
-
-/* MR9 JVincent@novell.com Allow user to override default ZZLEXBUFSIZE */
-/* MR11 thm Raise antlr's own default ZZLEXBUFSIZE to 8k */
-/* MR22 thm Raise antlr's own default ZZLEXBUFSIZE to 32k */
-
-#ifndef ZZLEXBUFSIZE
-#define ZZLEXBUFSIZE 32000
-#endif
-
-/* Tree/FIRST/FOLLOW defines -- valid only after all grammar has been read */
-#define ALT TokenNum+1
-#define SET TokenNum+2
-#define TREE_REF TokenNum+3
-
- /* E r r o r M a c r o s */
-
-#define fatal(err) fatalFL(err, __FILE__, __LINE__)
-#define fatal_internal(err) fatal_intern(err, __FILE__, __LINE__)
-
-
-#define eMsg1(s,a) eMsg3(s,a,NULL,NULL)
-#define eMsg2(s,a,b) eMsg3(s,a,b,NULL)
-
- /* S a n i t y C h e c k i n g */
-
-#ifndef require
-#define require(expr, err) {if ( !(expr) ) fatal_internal(err);}
-#endif
-
- /* L i s t N o d e s */
-
-typedef struct _ListNode {
- void *elem; /* pointer to any kind of element */
- struct _ListNode *next;
- } ListNode;
-
-/* Define a Cycle node which is used to track lists of cycles for later
- * reconciliation by ResolveFoCycles().
- */
-typedef struct _c {
- int croot; /* cycle root */
- set cyclicDep; /* cyclic dependents */
- unsigned deg; /* degree of FOLLOW set of croot */
- } Cycle;
-
-typedef struct _e {
- int tok; /* error class name == TokenStr[tok] */
- ListNode *elist; /* linked list of elements in error set */
- set eset;
- int setdeg; /* how big is the set */
- int lexclass; /* which lex class is it in? */
- } ECnode;
-
-typedef struct _TCnode {
- int tok; /* token class name */
- ListNode *tlist; /* linked list of elements in token set */
- set tset;
- int lexclass; /* which lex class is it in? */
- unsigned char dumped; /* this def has been been dumped */
- unsigned char dumpedComplement; /* this def has been been dumped */
- unsigned setnum; /* which set number is this guy? (if dumped) */
- unsigned setnumComplement; /* MR23 */
- unsigned setnumErrSet; /* MR23 which set is this #tokclass error set (if dumped) */
- unsigned setnumErrSetComplement; /* MR23 */
- } TCnode;
-
-typedef struct _ft {
- char *token; /* id of token type to remap */
- int tnum; /* move token type to which token position */
- } ForcedToken;
-
-typedef struct _ContextGuardPredicates { /* MR13 */
- Predicate *pred; /* MR13 */
- } ContextGuardPredicates; /* MR13 */
-
-#define newListNode (ListNode *) calloc(1, sizeof(ListNode));
-#define newCycle (Cycle *) calloc(1, sizeof(Cycle));
-#define newECnode (ECnode *) calloc(1, sizeof(ECnode));
-#define newTCnode (TCnode *) calloc(1, sizeof(TCnode));
-
-
- /* H a s h T a b l e E n t r i e s */
-
-typedef struct _t { /* Token name or expression */
- char *str;
- struct _t *next;
- int token; /* token number */
- unsigned char classname; /* is it a err/tok class name or token */
- TCnode *tclass; /* ptr to token class */
- char *action;
- char *akaString;
- } TermEntry;
-
-typedef struct _r { /* Rule name and ptr to start of rule */
- char *str;
- struct _t *next;
- int rulenum; /* RulePtr[rulenum]== ptr to RuleBlk junction */
- unsigned char noAST;/* gen AST construction code? (def==gen code) */
- char *egroup; /* which error group (err reporting stuff) */
-#if 0
- /* MR27 This appears to never be used. Delete this code later. */
-
- ListNode *el_labels;/* list of element labels ref in all of rule */
-#endif
- ListNode *ast_labels_in_actions; /* MR27 */
- unsigned char has_rule_exception;
- char dontComputeErrorSet; /* MR14 - don't compute error set
- special for rule in alpha part of
- (alpha)? beta block */
- } RuleEntry;
-
-typedef struct _f { /* cache Fi/Fo set */
- char *str; /* key == (rulename, computation, k) */
- struct _f *next;
- set fset; /* First/Follow of rule */
- set rk; /* set of k's remaining to be done after ruleref */
- int incomplete; /* only w/FOLLOW sets. Use only if complete */
- } CacheEntry;
-
-typedef struct _LabelEntry { /* element labels */
- char *str;
- struct _f *next;
- Node *elem; /* which element does it point to? */
- ExceptionGroup *ex_group;
- /* Is there an exception attached to label? */
- ExceptionGroup *outerEG; /* MR7 */
- /* next EG if ex_group doesn't catch it MR7 */
- struct _LabelEntry *pendingLink; /* MR7 */
- /* too lazy to use ListNode ? MR7 */
- int curAltNum; /* MR7 */
- } LabelEntry;
-
-typedef struct _SignalEntry {
- char *str;
- struct _f *next;
- int signum; /* unique signal number */
- } SignalEntry;
-
-typedef struct _PredEntry { /* MR11 predicate name and ptr to string */
- char *str;
- struct _PredEntry *next;
- int file;
- int line;
- Predicate *pred;
- char *predLiteral;
- } PredEntry;
-
-typedef struct _PointerStack { /* MR10 */
- int count;
- int size;
- void **data;
- } PointerStack;
-
-#define newTermEntry(s) (TermEntry *) newEntry(s, sizeof(TermEntry))
-#define newRuleEntry(s) (RuleEntry *) newEntry(s, sizeof(RuleEntry))
-#define newCacheEntry(s) (CacheEntry *) newEntry(s, sizeof(CacheEntry))
-#define newLabelEntry(s) (LabelEntry *) newEntry(s, sizeof(LabelEntry))
-#define newSignalEntry(s) (SignalEntry *) newEntry(s, sizeof(SignalEntry))
-#define newPredEntry(s) (PredEntry *) newEntry(s,sizeof(PredEntry))
-
-typedef struct _UserAction {
- char *action;
- int file, line;
- } UserAction;
-
-
- /* L e x i c a l C l a s s */
-
-/* to switch lex classes, switch ExprStr and Texpr (hash table) */
-typedef struct _lc {
- char *classnum, **exprs;
- Entry **htable;
- } LClass;
-
-typedef struct _exprOrder {
- char *expr;
- int lclass;
- } Expr;
-
-
-typedef Graph Attrib;
-
- /* M a x i m u m s */
-
-/* MR20 Note G. Hobbelt These values are superceded by values in hash.h */
-
-#ifndef HashTableSize
-#define HashTableSize 253
-#endif
-#ifndef StrTableSize
-#define StrTableSize 15000 /* all tokens, nonterminals, rexprs stored here */
-#endif
-#define MaxLexClasses 50 /* how many automatons */
-/* TokenStart and EofToken are ignored if #tokdefs meta-op is used */
-#define TokenStart 2 /* MUST be in 1 + EofToken */
-#define EofToken 1 /* Always predefined to be 1 */
-
-#ifndef MaxNumFiles
-#define MaxNumFiles 99
-#endif
-
-/**** MR9 JVincent@novell.com Move to pcctscfg.h */
-/**** #define MaxFileName 300 ****/ /* MR9 Move to pcctscfg.h */ /* largest file name size */
-
-#define MaxRuleName 100 /* largest rule name size */
-#define TSChunk 100 /* how much to expand TokenStr/ExprStr each time */
-#define TIChunk TSChunk /* expand TokenInd by same as TokenStr to mirror them */
-#define FoStackSize 100 /* deepest FOLLOW recursion possible */
-
-#define MaxClassDeclStuff 256 /* MR10 */
-
-#define NumPredefinedSignals 3
-
- /* S t a n d a r d S i g n a l s */
-
-#define sigNoSignal 0
-#define sigMismatchedToken 1
-#define sigNoViableAlt 2
-#define sigNoSemViableAlt 3
-
-
-
-/* AST token types */
-#define ASTexclude 0
-#define ASTchild 1
-#define ASTroot 2
-#define ASTinclude 3 /* include subtree made by rule ref */
-
-
-#define PredictionVariable "zzpr_expr"
-#define PredictionLexClassSuffix "_zzpred"
-
-#define WildCardString "WildCard"
-
-#if 0
- /* Removed in version 1.33MR19
- Don't understand why this never caused problems before
- */
-
- /*********************************************************
- #ifndef ANTLRm
- #define ANTLRm(st, f, _m) zzbufsize = ZZLEXBUFSIZE;\
- zzmode(_m); \
- zzenterANTLR(f); \
- st; ++zzasp; \
- zzleaveANTLR(f);
- #endif
- *********************************************************/
-#endif
-
-#include "proto.h"
-#include "pcctscfg.h" /* MR14 */
-#include <string.h>
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/globals.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/globals.c
deleted file mode 100644
index 59d00320a0..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/globals.c
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * globals.c -- File containing all variables/tables visible to all files.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-
-#include "pcctscfg.h"
-
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-
-char Version[] = "1.33MR33" ; /* PCCTS version number */ /* MRXXX */
-char VersionDef[] = "13333"; /* same (except int equiv for preproc symbol) */ /* MRXXX */
-
-char LexStartSymbol[] = "START";/* Name of starting lexical class/automaton */
-char *RemapFileName = "remap.h";
-char *DlgFileName = "parser.dlg";
-char *DefFileName = "tokens.h";
-char *ErrFileName = "err.c";
-char *ModeFileName = "mode.h";
-char *StdMsgName = NULL;
-
-char *ParserName = DefaultParserName;
-
-/* list of PCCTS supplied support symbols; these are renamed when more than
- * one ANTLR-generated parsers are linked together to avoid name conflicts.
- * Can't use '##' ANSIC preprocessor concat operator with K&R and:
- * #define zzskip zzparser ## skip
- * will not work for ANSI/C++ as 'zzparserskip' is created w/o zzparser
- * being substituted--ack!!!
- */
-char *StandardSymbols[] = {
-/* ANTLR stuff */
- "zzStackOvfMsg",
- "zzasp",
- "zzaStack",
- "inf_tokens",
- "inf_text",
- "inf_text_buffer",
- "inf_text_buffer_ptr",
- "inf_text_buffer_size",
- "inf_labase",
- "inf_last",
- "inf_lap",
- "zztokenLA",
- "zztextLA",
- "zzlap",
- "zzlabase",
- "zztoktext",
- "zztoken",
- "zzdirty",
- "zzguessing",
- "zzguess_start",
- "zzresynch",
- "zzinf_tokens",
- "zzinf_text",
- "zzinf_text_buffer",
- "zzinf_labase",
- "zzinf_last",
- "zzfill_inf_look",
- "zzFAIL",
- "zzsave_antlr_state",
- "zzrestore_antlr_state",
- "zzsyn",
- "zzset_el",
- "zzset_deg",
- "zzedecode",
- "_zzsetmatch",
- "_zzmatch",
- "_inf_zzgettok",
- "zzconsumeUntil",
- "zzconsumeUntilToken",
- "_zzmatch_wsig",
- "_zzsetmatch_wsig",
- "_zzmatch_wdfltsig",
- "_zzsetmatch_wdfltsig",
- "zzdflthandlers",
-/* DLG stuff */
- "zzreal_line",
- "zzcharfull",
- "zzerr",
- "zzlextext",
- "zzbegexpr",
- "zzendexpr",
- "zzbufsize",
- "zzbegcol",
- "zzendcol",
- "zzline",
- "zzchar",
- "zzbufovf",
- "zzrdstream",
- "zzrdfunc",
- "zzrdstr",
- "zzclose_stream",
- "zzsave_dlg_state",
- "zzrestore_dlg_state",
- "zzmode",
- "zzskip",
- "zzmore",
- "zzreplchar",
- "zzreplstr",
- "zzgettok",
- "zzadvance",
- "zzerrstd",
- "zzerr_in",
- "zzconstr_attr",
- "zzempty_attr",
- "zzerraction",
- "zztokens", /* list of token regular expressions */
- "dfa",
- "accepts",
- "actions",
- "zzTraceOptionValue", /* MR10 */
- "zzTraceGuessOptionValue", /* MR10 */
- "zzTraceCurrentRuleName", /* MR10 */
- "zzTraceDepth", /* MR10 */
- "zzGuessSeq", /* MR10 */
- "zzSyntaxErrCount", /* MR11 */
- "zzLexErrCount", /* MR11 */
- "zzTraceGuessDone", /* MR13 - BJS */
- "zzTraceGuessFail", /* MR13 - BJS */
- "zzTraceGuessOption", /* MR13 - BJS */
- "zzTraceIn", /* MR13 - BJS */
- "zzTraceOption", /* MR13 - BJS */
- "zzTraceOut", /* MR13 - BJS */
- "zzTraceReset", /* MR13 - BJS */
- NULL /* must be present */
-};
-
-/* list of PCCTS supplied support functions; these are renamed when more than
- * one ANTLR-generated parsers are linked together to avoid name conflicts.
- */
-char *ASTSymbols[] = {
- "AST",
- "zzast_sp",
- "zzastStack",
- "zzlink",
- "zzastnew",
- "zzsubchild",
- "zzsubroot",
- "zzpre_ast",
- "zzfree_ast",
- "zztmake",
- "zzdup_ast",
- "zztfree",
- "zzdouble_link",
- NULL /* must be present */
-};
-
-/* Current ambiguity examination information */
-int CurAmbigAlt1, CurAmbigAlt2, CurAmbigline, CurAmbigfile;
-char *CurAmbigbtype;
-
-
- /* M e t h o d T a b l e s */
-/*
- * The following tables are used to fill syntax diagram nodes with the correct
- * function pointers for computing FIRST sets and printing themselves.
- */
-
-/* fpTraverse[node type] == pointer to function that calculates trees
- * representing the FIRST sets for that node (maintains spatial info).
- * We use 'struct _tree' not 'tree' due to a g++ 2.4.3 bug.
- */
-#ifdef __cplusplus
-struct _tree *(*fpTraverse[NumNodeTypes+1])(... /* Node *, int, set * */) = {
- NULL,
- (struct _tree *(*)(...)) tJunc,
- (struct _tree *(*)(...)) tRuleRef,
- (struct _tree *(*)(...)) tToken,
- (struct _tree *(*)(...)) tAction
-};
-#else
-Tree *(*fpTraverse[NumNodeTypes+1])() = {
- NULL,
- tJunc,
- tRuleRef,
- tToken,
- tAction
-};
-#endif
-
-/* fpReach[node type] == pointer to function that calculates FIRST set for
- * that node. (r stands for reach). We use 'struct _set' not 'set'
- * due to a g++ 2.4.3 bug.
- */
-#ifdef __cplusplus
-struct _set (*fpReach[NumNodeTypes+1])(... /* Node *, int, set * */) = {
- NULL,
- (struct _set (*)(...)) rJunc,
- (struct _set (*)(...)) rRuleRef,
- (struct _set (*)(...)) rToken,
- (struct _set (*)(...)) rAction
-};
-#else
-set (*fpReach[NumNodeTypes+1])() = {
- NULL,
- rJunc,
- rRuleRef,
- rToken,
- rAction
-};
-#endif
-
-/* fpPrint[node type] == pointer to function that knows how to print that node. */
-#ifdef __cplusplus
-void (*fpPrint[NumNodeTypes+1])(... /* Node * */) = {
- NULL,
- (void (*)(...)) pJunc,
- (void (*)(...)) pRuleRef,
- (void (*)(...)) pToken,
- (void (*)(...)) pAction
-};
-#else
-void (*fpPrint[NumNodeTypes+1])() = {
- NULL,
- pJunc,
- pRuleRef,
- pToken,
- pAction
-};
-#endif
-
-char *decodeJType[] = {
- "invalid",
- "aSubBlk",
- "aOptBlk",
- "aLoopBlk",
- "EndBlk",
- "RuleBlk",
- "Generic",
- "EndRule",
- "aPlusBlk",
- "aLoopBegin"
-};
-
-
- /* H a s h T a b l e s */
-
-Entry **Tname, /* Table of all token names (maps name to tok num)*/
- **Texpr, /* Table of all token expressions
- (maps expr to tok num) */
- **Rname, /* Table of all Rules (has ptr to start of rule) */
- **Fcache, /* Cache of First/Follow Computations */
- **Tcache; /* Tree cache; First/Follow for permute trees */
-Entry **Elabel; /* Table of all element label names */
-Entry **Sname; /* Signal names */
-Entry **Pname; /* symbolic predicate names MR11 */
-
-
- /* V a r i a b l e s */
-
-int Save_argc; /* MR10 */
-char **Save_argv; /* MR10 */
-int EpToken=0; /* Imaginary Epsilon token number */
-int WildCardToken=0;
-int CurFile= -1; /* Index into FileStr table */
-char *CurPredName=NULL; /* MR11 */
-char *CurRule=NULL; /* Pointer to current rule name */
-int CurRuleDebug=0; /* MR13 debug flag */
-RuleEntry *CurRuleNode=NULL;/* Pointer to current rule node in syntax tree */
-char *CurRetDef=NULL; /* Pointer to current return type definition */
-char *CurParmDef=NULL; /* Pointer to current parameter definition */
-Junction *CurRuleBlk=NULL; /* Pointer to current block node for enclosing block */
-ListNode *CurExGroups=NULL; /* Current list of exception groups for rule/alts */
-ListNode *CurElementLabels=NULL;
-ListNode *CurAstLabelsInActions=NULL; /* MR27 */
-
-/* MR10 used by <<>>? to set "label_used_in_semantic_pred" */
-/* MR10 this will force LT(i) assignment even in guess mode */
-
-ListNode *CurActionLabels=NULL; /* MR10 Element Labels appearing in last action */
-int numericActionLabel=0 ; /* MR10 << ... $1 ... >> or << ... $1 ... >>? */
-ListNode *NumericPredLabels=NULL; /* MR10 << ... $1 ... >>? ONLY */
-ListNode *ContextGuardPredicateList=NULL; /* MR13 for re-evaluating predicates
- after meta tokens are defined */
-
-int CurBlockID=0; /* Unique int for each block */
-int CurAltNum=0;
-Junction *CurAltStart = NULL; /* Junction node that starts the alt */
-Junction *OuterAltStart = NULL; /* For chaining exception groups MR7 */
-int NumRules=0; /* Rules are from 1 to n */
-FILE *output=NULL; /* current parser output file */
-FILE *input=NULL; /* current grammar input file */
-char *FileStr[MaxNumFiles];/* Ptr to array of file names on command-line */
-int NumFiles=0; /* current grammar file number */
-#ifdef __cplusplus
-void (**fpTrans)(...), /* array of ptrs to funcs that translate nodes */
- (**fpJTrans)(...); /* ... that translate junctions */
-#else
-void (**fpTrans)(), /* array of ptrs to funcs that translate nodes */
- (**fpJTrans)(); /* ... that translate junctions */
-#endif
-int **FoStack; /* Array of LL_k ptrs to stacks of rule numbers */
-int **FoTOS; /* FOLLOW stack top-of-stack pointers */
-Junction *SynDiag = NULL; /* Pointer to start of syntax diagram */
-int BlkLevel=1; /* Current block level. Set by antlr.g, used by
- * scanner to translate $i.j attributes */
-set reserved_positions; /* set of token positions reserved by '#token T=i' cmds */
-set all_tokens; /* set of all token types */
-set imag_tokens; /* set of all imaginary token types (EpToken, errclasses...) */
-set tokclasses; /* set of all token class token types */
-ListNode *ForcedTokens = 0; /* list of token_id/token_num pairs to remap */
-ListNode *MetaTokenNodes=NULL; /* list of meta token refs such as token classes etc... */
-int *TokenInd=NULL; /* an indirection level between token num and position
- * of that token def in TokenStr and ExprStr */
-int LastTokenCounted=0; /* ==TokenNum if no token renumbering (same as old TokenNum) */
-int TokenNum=TokenStart;
-char **TokenStr=NULL; /* map token # to token name */
-char **ExprStr=NULL; /* map token # to expr */
-Junction **RulePtr=NULL; /* map rule # to RuleBlk node of rule */
-ListNode *ExprOrder=NULL; /* list of exprs as they are found in grammar */
-ListNode *BeforeActions=NULL;/* list of grammar actions before rules */
-ListNode *AfterActions=NULL;/* list of grammar actions after rules */
-ListNode *LexActions=NULL; /* list of lexical actions */
-
-/* MR1 */
-/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
-/* MR1 via #lexmember <<....>> */
-/* MR1 via #lexprefix <<....>> */
-/* MR1 */
-
-ListNode *LexMemberActions=NULL;/* list of lexical header member decl MR1 */
-ListNode *LexPrefixActions=NULL;/* list of lexical header #include decl MR1 */
-ListNode **Cycles=NULL; /* list of cycles (for each k) found when
- doing FOLLOWs */
-ListNode *eclasses=NULL; /* list of error classes */
-ListNode *tclasses=NULL; /* list of token classes */
-LClass lclass[MaxLexClasses]; /* array of lex class definitions */
-int CurrentLexClass; /* index into lclass */
-int NumLexClasses=0; /* in range 1..MaxLexClasses (init 0) */
-
-char *HdrAction=NULL; /* action defined with #header */
-char *FirstAction=NULL; /* action defined with #first MR11 */
-FILE *ErrFile; /* sets and error recovery stuff */
-FILE *DefFile=NULL; /* list of tokens, return value structs, setwd defs */
-FILE *MRinfoFile=NULL; /* MR10 information file */
-int MRinfo=0; /* MR10 */
-int MRinfoSeq=0; /* MR10 */
-int InfoP=0; /* MR10 predicates */
-int InfoT=0; /* MR10 tnodes */
-int InfoF=0; /* MR10 first/follow sets */
-int InfoM=0; /* MR10 monitor progress */
-int InfoO=0; /* MR12 orphan rules */
-int TnodesInUse=0; /* MR10 */
-int TnodesPeak=0; /* MR10 */
-int TnodesAllocated=0; /* MR10 */
-int TnodesReportThreshold=0; /* MR11 */
-int PotentialSuppression=0; /* MR10 */
-int PotentialDummy=0; /* MR10 */
-int CannotContinue=FALSE;
-int OutputLL_k = 1; /* LL_k for parsing must be power of 2 */
-int action_file; /* used to track start of action */
-int action_line;
-int FoundGuessBlk=0; /* there is a (...)? block somewhere in grammar */
-int FoundException=0; /* there is an exception somewhere in grammar */
-/* MR6 Distinguish between @ operator and real exception */
-/* MR6 by keeping separate flags for @ operator and real exceptions */
-int FoundAtOperator=0; /* MR6 */
-int FoundExceptionGroup=0; /* MR6 */
-int pLevel=0; /* print Level */
-int pAlt1,pAlt2; /* print "==>" in front of these alts */
-
-/* C++ output stuff */
-FILE *Parser_h, /* where subclass of ANTLRParser goes */
- *Parser_c; /* where code for subclass of ANTLRParser goes */
-char Parser_h_Name[MaxFileName+1] = "";
-char Parser_c_Name[MaxFileName+1] = "";
-char MRinfoFile_Name[MaxFileName+1] = ""; /* MR10 */
-char *ClassDeclStuff=NULL; /* MR10 */
-char *BaseClassName=NULL; /* MR22 */
-/* list of actions inside the #class {...} defs */
-ListNode *class_before_actions=NULL;
-ListNode *class_after_actions=NULL;
-
-char CurrentClassName[MaxRuleName]="";
-int no_classes_found=1;
-char *UserTokenDefsFile;
-int UserDefdTokens=0; /* found #tokdefs? */
-char *OutputDirectory=TopDirectory;
-ExceptionGroup *DefaultExGroup = NULL;
-int NumSignals = NumPredefinedSignals;
-int ContextGuardTRAV=0;
-
-char *MR_AmbAidRule=NULL; /* MR11 */
-int MR_AmbAidLine=0; /* MR11 */
-int MR_AmbAidDepth=0; /* MR11 */
-int MR_AmbAidMultiple=0; /* MR11 */
-int MR_skipped_e3_report=0; /* MR11 */
-int MR_usingPredNames=0; /* MR11 */
-int MR_BadExprSets=0; /* MR13 */
-int MR_Inhibit_Tokens_h_Gen=0; /* MR13 */
-int NewAST=0; /* MR13 */
-int tmakeInParser=0; /* MR23 */
-int AlphaBetaTrace=0; /* MR14 */
-int MR_BlkErr=0; /* MR21 */
-int MR_AlphaBetaMessageCount=0; /* MR14 */
-int MR_AlphaBetaWarning=0; /* MR14 */
-int MR_ErrorSetComputationActive=0; /* MR14 */
-int MR_MaintainBackTrace=0; /* MR14 */
-set MR_CompromisedRules; /* MR14 */
-
-Junction *MR_RuleBlkWithHalt; /* MR10 */
-
- /* C m d - L i n e O p t i o n s */
-
-int LL_k=1; /* how many tokens of full lookahead */
-int CLL_k= -1; /* how many tokens of compressed lookahead */
-int PrintOut = FALSE; /* print out the grammar */
-int PrintAnnotate = FALSE;/* annotate printout with FIRST sets */
-int CodeGen=TRUE; /* Generate output code? */
-int LexGen=TRUE; /* Generate lexical files? (tokens.h, parser.dlg) */
-int GenAST=FALSE; /* Generate AST's? */
-int GenANSI=FALSE; /* Generate ANSI code where necessary */
-int GenExprSetsOpt=TRUE;/* use sets not (LA(1)==tok) expression lists */
-int GenCR=FALSE; /* Generate cross reference? */
-int GenLineInfo=FALSE; /* Generate # line "file" stuff? */
-int GenLineInfoMS=FALSE;/* Like -gl but replace "\" with "/" for MS C/C++ systems */
-int TraceGen=FALSE; /* Generate code to trace rule invocation */
-int elevel=1; /* error level for ambiguity messages */
-int GenEClasseForRules=0;/* don't generate eclass for each rule */
-int TreeResourceLimit= -1;/* don't limit tree resource */
-int DemandLookahead = 0;/* demand/delayed lookahead or not */
-char *RulePrefix = ""; /* prefix each generated rule with this */
-char *stdpccts = "stdpccts.h";/* where to generate std pccts include file */
-int GenStdPccts = 0; /* don't gen stdpccts.h? */
-int ParseWithPredicates = 1;
-int WarningLevel = 1;
-int UseStdout = 0; /* MR6 */
-int TabWidth = 2; /* MR6 */ /* MR27 */
-int HoistPredicateContext = 0;
-int MRhoisting = 0; /* MR9 */
-int MRhoistingk = 0; /* MR13 */
-int MR_debugGenRule=0; /* MR11 */
-
-int GenCC = 0; /* Generate C++ output */
-
-PointerStack MR_BackTraceStack={0,0,NULL}; /* MR10 */
-PointerStack MR_PredRuleRefStack={0,0,NULL}; /* MR10 */
-PointerStack MR_RuleBlkWithHaltStack={0,0,NULL}; /* MR10 */
-
-/* DontCopyTokens and Pragma_DupLabeledTokens were a bad idea. I've just
- turned them off rather than backpatching the code. Who knows? We
- may need them in the future.
- */
-int DontCopyTokens = 1; /* in C++, don't copy ANTLRToken passed to ANTLR */
-
-/* Remember if LT(i), LA(i), or LATEXT(i) used in an action which is not
- a predicate. If so, give a warning for novice users.
-*/
-
-int LTinTokenAction = 0; /* MR23 */
-int PURIFY = 1; /* MR23 */
-
-int CurBlockID_array[MAX_BLK_LEVEL]; /* MR23 */
-int CurAltNum_array[MAX_BLK_LEVEL]; /* MR23 */
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/hash.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/hash.c
deleted file mode 100644
index 68fe8fd227..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/hash.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * hash.c
- *
- * Manage hash tables.
- *
- * The following functions are visible:
- *
- * char *mystrdup(char *); Make space and copy string
- * Entry **newHashTable(); Create and return initialized hash table
- * Entry *hash_add(Entry **, char *, Entry *)
- * Entry *hash_get(Entry **, char *)
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include "pcctscfg.h"
-#include "hash.h"
-
-#ifdef __USE_PROTOS
-#include <stdlib.h>
-#else
-#ifdef VAXC
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
-#endif
-#include <string.h>
-
-#define StrSame 0
-
-#define fatal(err) \
- {fprintf(stderr, "%s(%d):", __FILE__, __LINE__); \
- fprintf(stderr, " %s\n", err); exit(PCCTS_EXIT_FAILURE);}
-#define require(expr, err) {if ( !(expr) ) fatal(err);}
-
-static unsigned size = HashTableSize;
-static char *strings = NULL;
-static char *strp;
-static unsigned strsize = StrTableSize;
-
-/* create the hash table and string table for terminals (string table only once) */
-Entry **
-#ifdef __USE_PROTOS
-newHashTable( void )
-#else
-newHashTable( )
-#endif
-{
- Entry **table;
-
- table = (Entry **) calloc(size, sizeof(Entry *));
- require( table != NULL, "cannot allocate hash table");
- if ( strings == NULL )
- {
- strings = (char *) calloc(strsize, sizeof(char));
- require( strings != NULL, "cannot allocate string table");
- strp = strings;
- }
- return table;
-}
-
-void
-#ifdef __USE_PROTOS
-killHashTable( Entry **table )
-#else
-killHashTable( table )
-Entry **table;
-#endif
-{
- /* for now, just free table, forget entries */
- free( (char *) table ); /* MR10 cast */
-}
-
-/* Given a table, add 'rec' with key 'key' (add to front of list). return ptr to entry */
-Entry *
-#ifdef __USE_PROTOS
-hash_add( Entry **table, char *key, Entry *rec )
-#else
-hash_add( table, key, rec )
-Entry **table;
-char *key;
-Entry *rec;
-#endif
-{
- unsigned h=0;
- char *p=key;
- require(table!=NULL && key!=NULL && rec!=NULL, "add: invalid addition");
-
- Hash(p,h,size);
- rec->next = table[h]; /* Add to singly-linked list */
- table[h] = rec;
- return rec;
-}
-
-/* Return ptr to 1st entry found in table under key (return NULL if none found) */
-Entry *
-#ifdef __USE_PROTOS
-hash_get( Entry **table, char *key )
-#else
-hash_get( table, key )
-Entry **table;
-char *key;
-#endif
-{
- unsigned h=0;
- char *p=key;
- Entry *q;
-/* require(table!=NULL && key!=NULL, "get: invalid table and/or key");*/
- if ( !(table!=NULL && key!=NULL) ) *((char *) 34) = 3;
-
- Hash(p,h,size);
- for (q = table[h]; q != NULL; q = q->next)
- {
- if ( strcmp(key, q->str) == StrSame ) return( q );
- }
- return( NULL );
-}
-
-#ifdef DEBUG_HASH
-void
-#ifdef __USE_PROTOS
-hashStat( Entry **table )
-#else
-hashStat( table )
-Entry **table;
-#endif
-{
- static unsigned short count[20];
- int i,n=0,low=0, hi=0;
- Entry **p;
- float avg=0.0;
-
- for (i=0; i<20; i++) count[i] = 0;
- for (p=table; p<&(table[size]); p++)
- {
- Entry *q = *p;
- int len;
-
- if ( q != NULL && low==0 ) low = p-table;
- len = 0;
- if ( q != NULL ) fprintf(stderr, "[%d]", p-table);
- while ( q != NULL )
- {
- len++;
- n++;
- fprintf(stderr, " %s", q->str);
- q = q->next;
- if ( q == NULL ) fprintf(stderr, "\n");
- }
- count[len]++;
- if ( *p != NULL ) hi = p-table;
- }
-
- fprintf(stderr, "Storing %d recs used %d hash positions out of %d\n",
- n, size-count[0], size);
- fprintf(stderr, "%f %% utilization\n",
- ((float)(size-count[0]))/((float)size));
- for (i=0; i<20; i++)
- {
- if ( count[i] != 0 )
- {
- avg += (((float)(i*count[i]))/((float)n)) * i;
- fprintf(stderr, "Bucket len %d == %d (%f %% of recs)\n",
- i, count[i], ((float)(i*count[i]))/((float)n));
- }
- }
- fprintf(stderr, "Avg bucket length %f\n", avg);
- fprintf(stderr, "Range of hash function: %d..%d\n", low, hi);
-}
-#endif
-
-/* Add a string to the string table and return a pointer to it.
- * Bump the pointer into the string table to next avail position.
- */
-char *
-#ifdef __USE_PROTOS
-mystrdup( char *s )
-#else
-mystrdup( s )
-char *s;
-#endif
-{
- char *start=strp;
- require(s!=NULL, "mystrdup: NULL string");
-
- while ( *s != '\0' )
- {
- require( strp <= &(strings[strsize-2]),
- "string table overflow\nIncrease StrTableSize in hash.h and recompile hash.c\n");
- *strp++ = *s++;
- }
- *strp++ = '\0';
-
- return( start );
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/hash.h b/BaseTools/Source/C/VfrCompile/Pccts/antlr/hash.h
deleted file mode 100644
index 3969c40b4a..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/hash.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * hash.h -- define hash table entries, sizes, hash function...
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
- /* H a s h T a b l e S t u f f */
-
-#ifndef HashTableSize
-#define HashTableSize 553
-#endif
-
-#ifndef StrTableSize
-#ifdef PC32
-#define StrTableSize 1000000
-#endif
-#endif
-
-#ifndef StrTableSize
-#ifdef PC
-#define StrTableSize 655200
-#endif
-#endif
-
-#ifndef StrTableSize
-#define StrTableSize 1000000
-#endif
-
-typedef struct _entry { /* Minimum hash table entry -- superclass */
- char *str;
- struct _entry *next;
- } Entry;
-
-/* Hash 's' using 'size', place into h (s is modified) */
-#define Hash(s,h,size) \
- {while ( *s != '\0' ) h = (h<<1) + *s++; \
- h %= size;}
-
-#ifdef __USE_PROTOS
-Entry *hash_get(Entry **, char *),
- **newHashTable(void),
- *hash_add(Entry **, char *, Entry *);
-
-void killHashTable(Entry **);
-
-#else
-Entry *hash_get(), **newHashTable(), *hash_add();
-void killHashTable(); /* MR9 23-Sep-97 */
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c
deleted file mode 100644
index 8c524fe465..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c
+++ /dev/null
@@ -1,878 +0,0 @@
-/*
- * lex.c -- Generate all of the lexical type files: parser.dlg tokens.h
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include <ctype.h>
-/* MR1 */
-/* MR1 10-Apr-97 MR1 Replace use of __STDC__ with __USE_PROTOS */
-/* MR1 */
-#include "pcctscfg.h"
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-
-#define DLGErrorString "invalid token"
-
-/* Generate a complete lexical description of the lexemes found in the grammar */
-void
-#ifdef __USE_PROTOS
-genLexDescr( void )
-#else
-genLexDescr( )
-#endif
-{
- ListNode *p;
- FILE *dlgFile = fopen(OutMetaName(DlgFileName), "w");
- require(dlgFile!=NULL, eMsg1("genLexFile: cannot open %s", OutMetaName(DlgFileName)) );
-#ifdef SPECIAL_FOPEN
- special_fopen_actions(OutMetaName(DlgFileName)); /* MR1 */
-#endif
- fprintf(dlgFile, "<<\n");
- fprintf(dlgFile, "/* %s -- DLG Description of scanner\n", DlgFileName);
- fprintf(dlgFile, " *\n");
- fprintf(dlgFile, " * Generated from:");
- {int i; for (i=0; i<NumFiles; i++) fprintf(dlgFile, " %s", FileStr[i]);}
- fprintf(dlgFile, "\n");
- fprintf(dlgFile, " *\n");
- fprintf(dlgFile, " * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001\n");
- fprintf(dlgFile, " * Purdue University Electrical Engineering\n");
- fprintf(dlgFile, " * With AHPCRC, University of Minnesota\n");
- fprintf(dlgFile, " * ANTLR Version %s\n", Version);
- fprintf(dlgFile, " */\n\n");
- if (FirstAction != NULL ) dumpAction( FirstAction, dlgFile, 0, -1, 0, 1 ); /* MR11 MR15b */
- fprintf(dlgFile, "#define ANTLR_VERSION %s\n", VersionDef);
- if ( GenCC )
- {
- if ( !UserDefdTokens ) fprintf(dlgFile, "#include \"%s\"\n", DefFileName);
- else fprintf(dlgFile, "#include %s\n", UserTokenDefsFile);
- fprintf(dlgFile, "#include \"%s\"\n", ATOKEN_H);
- if ( GenAST ) fprintf(dlgFile, "#include \"%s\"\n", ASTBASE_H);
- if ( HdrAction != NULL ) dumpAction( HdrAction, dlgFile, 0, -1, 0, 1 );
- }
- else
- {
- fprintf(dlgFile, "#include \"pcctscfg.h\"\n");
- fprintf(dlgFile, "#include \"pccts_stdio.h\"\n");
- if ( strcmp(ParserName, DefaultParserName)!=0 )
- fprintf(dlgFile, "#define %s %s\n", DefaultParserName, ParserName);
- if ( strcmp(ParserName, DefaultParserName)!=0 )
- fprintf(dlgFile, "#include \"%s\"\n", RemapFileName);
- if ( HdrAction != NULL ) dumpAction( HdrAction, dlgFile, 0, -1, 0, 1 );
- if ( FoundGuessBlk )
- {
- fprintf(dlgFile, "#define ZZCAN_GUESS\n");
- fprintf(dlgFile, "#include \"pccts_setjmp.h\"\n");
- }
- if ( OutputLL_k > 1 ) fprintf(dlgFile, "#define LL_K %d\n", OutputLL_k);
- if ( DemandLookahead ) fprintf(dlgFile, "#define DEMAND_LOOK\n");
- if (TraceGen) {
- fprintf(dlgFile,"#ifndef zzTRACE_RULES\n"); /* MR20 */
- fprintf(dlgFile,"#define zzTRACE_RULES\n"); /* MR20 */
- fprintf(dlgFile,"#endif\n"); /* MR22 */
- };
- fprintf(dlgFile, "#include \"antlr.h\"\n");
- if ( GenAST ) {
- fprintf(dlgFile, "#include \"ast.h\"\n");
- }
- if ( UserDefdTokens )
- fprintf(dlgFile, "#include %s\n", UserTokenDefsFile);
- /* still need this one as it has the func prototypes */
- fprintf(dlgFile, "#include \"%s\"\n", DefFileName);
- fprintf(dlgFile, "#include \"dlgdef.h\"\n");
- fprintf(dlgFile, "LOOKAHEAD\n");
- fprintf(dlgFile, "\n");
- fprintf(dlgFile, "void\n");
- fprintf(dlgFile, "#ifdef __USE_PROTOS\n");
- fprintf(dlgFile, "zzerraction(void)\n");
- fprintf(dlgFile, "#else\n");
- fprintf(dlgFile, "zzerraction()\n");
- fprintf(dlgFile, "#endif\n");
- fprintf(dlgFile, "{\n");
- fprintf(dlgFile, "\t(*zzerr)(\"%s\");\n", DLGErrorString);
- fprintf(dlgFile, "\tzzadvance();\n");
- fprintf(dlgFile, "\tzzskip();\n");
- fprintf(dlgFile, "}\n");
- }
- fprintf(dlgFile, ">>\n\n");
-
- /* dump all actions */
-
-/* MR1 */
-/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
-/* MR1 via <<%%lexmember ....>> & <<%%lexprefix ...>> */
-/* MR1 */
- if (LexActions != NULL) {
- for (p = LexActions->next; p!=NULL; p=p->next)
- {
-/* MR1 */ fprintf(dlgFile, "<<%%%%lexaction\n");
- dumpAction( (char *)p->elem, dlgFile, 0, -1, 0, 1 );
- fprintf(dlgFile, ">>\n\n");
- }
- };
-
-/* MR1 */ if (GenCC) {
-/* MR1 */ fprintf(dlgFile,"<<%%%%parserclass %s>>\n\n",CurrentClassName);
-/* MR1 */ };
-
-/* MR1 */ if (LexPrefixActions != NULL) {
-/* MR1 */ for (p = LexPrefixActions->next; p!=NULL; p=p->next)
-/* MR1 */ {
-/* MR1 */ fprintf(dlgFile, "<<%%%%lexprefix\n");
-/* MR1 */ dumpAction( (char *)p->elem, dlgFile, 0, -1, 0, 1 );
-/* MR1 */ fprintf(dlgFile, ">>\n\n");
-/* MR1 */ }
-/* MR1 */ };
-
-/* MR1 */ if (LexMemberActions != NULL) {
-/* MR1 */ for (p = LexMemberActions->next; p!=NULL; p=p->next)
-/* MR1 */ {
-/* MR1 */ fprintf(dlgFile, "<<%%%%lexmember\n");
-/* MR1 */ dumpAction( (char *)p->elem, dlgFile, 0, -1, 0, 1 );
-/* MR1 */ fprintf(dlgFile, ">>\n\n");
-/* MR1 */ }
-/* MR1 */ };
-
- /* dump all regular expression rules/actions (skip sentinel node) */
- if ( ExprOrder == NULL ) {
- warnNoFL("no regular expressions found in grammar");
- }
- else dumpLexClasses(dlgFile);
- fprintf(dlgFile, "%%%%\n");
- fclose( dlgFile );
-}
-
-/* For each lexical class, scan ExprOrder looking for expressions
- * in that lexical class. Print out only those that match.
- * Each element of the ExprOrder list has both an expr and an lclass
- * field.
- */
-void
-#ifdef __USE_PROTOS
-dumpLexClasses( FILE *dlgFile )
-#else
-dumpLexClasses( dlgFile )
-FILE *dlgFile;
-#endif
-{
- int i;
- TermEntry *t;
- ListNode *p;
- Expr *q;
-
- for (i=0; i<NumLexClasses; i++)
- {
- fprintf(dlgFile, "\n%%%%%s\n\n", lclass[i].classnum);
- for (p=ExprOrder->next; p!=NULL; p=p->next)
- {
- q = (Expr *) p->elem;
- if ( q->lclass != i ) continue;
- lexmode(i);
- t = (TermEntry *) hash_get(Texpr, q->expr);
- require(t!=NULL, eMsg1("genLexDescr: rexpr %s not in hash table",q->expr) );
- if ( t->token == EpToken ) continue;
- fprintf(dlgFile, "%s\n\t<<\n", StripQuotes(q->expr));
- /* replace " killed by StripQuotes() */
- q->expr[ strlen(q->expr) ] = '"';
- if ( !GenCC ) {
- if ( TokenString(t->token) != NULL )
- fprintf(dlgFile, "\t\tNLA = %s;\n", TokenString(t->token));
- else
- fprintf(dlgFile, "\t\tNLA = %d;\n", t->token);
- }
- if ( t->action != NULL ) dumpAction( t->action, dlgFile, 2,-1,0,1 );
- if ( GenCC ) {
- if ( TokenString(t->token) != NULL )
- fprintf(dlgFile, "\t\treturn %s;\n", TokenString(t->token));
- else
- fprintf(dlgFile, "\t\treturn (ANTLRTokenType)%d;\n", t->token);
- }
- fprintf(dlgFile, "\t>>\n\n");
- }
- }
-}
-
-/* Strip the leading path (if any) from a filename */
-char *
-#ifdef __USE_PROTOS
-StripPath( char *fileName )
-#else
-StripPath( fileName )
-char *fileName;
-#endif
-{
- char *p;
- static char dirSym[2] = DirectorySymbol;
-
- if(NULL != (p = strrchr(fileName, dirSym[0])))
- p++;
- else
- p = fileName;
-
- return(p);
-}
-
-/* Generate a list of #defines && list of struct definitions for
- * aggregate retv's */
-void
-#ifdef __USE_PROTOS
-genDefFile( void )
-#else
-genDefFile( )
-#endif
-{
- int i;
-
- /* If C++ mode and #tokdef used, then don't need anything in here since
- * C++ puts all definitions in the class file name.
- */
- if ( GenCC && UserTokenDefsFile ) return;
- if ( MR_Inhibit_Tokens_h_Gen) return;
-
- DefFile = fopen(OutMetaName(DefFileName), "w");
- require(DefFile!=NULL, eMsg1("genDefFile: cannot open %s", OutMetaName(DefFileName)) );
-#ifdef SPECIAL_FOPEN
- special_fopen_actions(OutMetaName(DefFileName)); /* MR1 */
-#endif
- fprintf(DefFile, "#ifndef %s\n", StripPath(gate_symbol(DefFileName)));
- fprintf(DefFile, "#define %s\n", StripPath(gate_symbol(DefFileName)));
-
- fprintf(DefFile, "/* %s -- List of labelled tokens and stuff\n", DefFileName);
- fprintf(DefFile, " *\n");
- fprintf(DefFile, " * Generated from:");
- for (i=0; i<NumFiles; i++) fprintf(DefFile, " %s", FileStr[i]);
- fprintf(DefFile, "\n");
- fprintf(DefFile, " *\n");
- fprintf(DefFile, " * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001\n");
- fprintf(DefFile, " * Purdue University Electrical Engineering\n");
- fprintf(DefFile, " * ANTLR Version %s\n", Version);
- fprintf(DefFile, " */\n");
-
- if ( !GenCC && LexGen ) {
- fprintf(DefFile,"#define zzEOF_TOKEN %d\n",
- TokenInd!=NULL?TokenInd[EofToken]:EofToken);
- }
-
- if ( !UserDefdTokens )
- {
- int first=1;
-
- if ( GenCC ) fprintf(DefFile, "enum ANTLRTokenType {\n");
- for (i=1; i<TokenNum; i++)
- {
- /* Don't do EpToken or expr w/o labels */
- if ( TokenString(i)!=NULL && i != EpToken )
- {
- TermEntry *p;
-
- if ( WarningLevel>1 )
- {
- int j;
- /* look in all lexclasses for the reg expr */
-
-/* MR10 Derek Pappas */
-/* MR10 A #tokclass doesn't have associated regular expressiones */
-/* MR10 so don't warn user about it's omission */
-
- p = (TermEntry *) hash_get(Tname, TokenString(i));
-
- if (p != NULL && ! p->classname) {
- for (j=0; j<NumLexClasses; j++)
- {
- lexmode(j);
- if ( ExprString(i)!=NULL ) break;
- }
- if ( j>=NumLexClasses )
- {
- warnNoFL(eMsg1("token label has no associated rexpr: %s",TokenString(i)));
- }
- };
- }
- require((p=(TermEntry *)hash_get(Tname, TokenString(i))) != NULL,
- "token not in sym tab when it should be");
- if ( !p->classname )
- {
- if ( GenCC ) {
- if ( !first ) fprintf(DefFile, ",\n");
- first = 0;
- fprintf(DefFile, "\t%s=%d", TokenString(i), i);
- }
- else
- fprintf(DefFile, "#define %s %d\n", TokenString(i), i);
- }
- }
- }
-/* MR1 */
-/* MR1 10-Apr-97 133MR1 Prevent use of varying sizes of integer */
-/* MR1 for the enum ANTLRTokenType */
-/* MR1 */
- if ( GenCC ) { /* MR1 */
- if ( !first ) fprintf(DefFile, ",\n"); /* MR14 */
- fprintf(DefFile, "\tDLGminToken=0"); /* MR1 */
- fprintf(DefFile, ",\n\tDLGmaxToken=9999};\n"); /* MR1 */
- }; /* MR1 */
- }
-
- if ( !GenCC ) GenRulePrototypes(DefFile, SynDiag);
-
- fprintf(DefFile, "\n#endif\n");
-}
-
-void
-#ifdef __USE_PROTOS
-GenRemapFile( void )
-#else
-GenRemapFile( )
-#endif
-{
- if ( strcmp(ParserName, DefaultParserName)!=0 )
- {
- FILE *f;
- int i;
-
- f = fopen(OutMetaName(RemapFileName), "w");
- require(f!=NULL, eMsg1("GenRemapFile: cannot open %s", OutMetaName(RemapFileName)) );
-#ifdef SPECIAL_FOPEN
- special_fopen_actions(OutMetaName(RemapFileName)); /* MR1 */
-#endif
- fprintf(f, "/* %s -- List of symbols to remap\n", RemapFileName);
- fprintf(f, " *\n");
- fprintf(f, " * Generated from:");
- for (i=0; i<NumFiles; i++) fprintf(f, " %s", FileStr[i]);
- fprintf(f, "\n");
- fprintf(f, " *\n");
- fprintf(f, " * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001\n");
- fprintf(f, " * Purdue University Electrical Engineering\n");
- fprintf(f, " * ANTLR Version %s\n", Version);
- fprintf(f, " */\n");
-
- GenRuleFuncRedefs(f, SynDiag);
- GenPredefinedSymbolRedefs(f);
- if ( GenAST ) GenASTSymbolRedefs(f);
- GenSetRedefs(f);
-
- fclose(f);
- }
-}
-
-/* Generate a bunch of #defines that rename all functions to be "ParserName_func" */
-void
-#ifdef __USE_PROTOS
-GenRuleFuncRedefs( FILE *f, Junction *p )
-#else
-GenRuleFuncRedefs( f, p )
-FILE *f;
-Junction *p;
-#endif
-{
- fprintf(f, "\n/* rename rule functions to be 'ParserName_func' */\n");
- while ( p!=NULL )
- {
- fprintf(f, "#define %s %s_%s\n", p->rname, ParserName, p->rname);
- p = (Junction *)p->p2;
- }
-}
-
-/* Generate a bunch of #defines that rename all standard symbols to be
- * "ParserName_symbol". The list of standard symbols to change is in
- * globals.c.
- */
-void
-#ifdef __USE_PROTOS
-GenPredefinedSymbolRedefs( FILE *f )
-#else
-GenPredefinedSymbolRedefs( f )
-FILE *f;
-#endif
-{
- char **p;
-
- fprintf(f, "\n/* rename PCCTS-supplied symbols to be 'ParserName_symbol' */\n");
- for (p = &StandardSymbols[0]; *p!=NULL; p++)
- {
- fprintf(f, "#define %s %s_%s\n", *p, ParserName, *p);
- }
-}
-
-/* Generate a bunch of #defines that rename all AST symbols to be
- * "ParserName_symbol". The list of AST symbols to change is in
- * globals.c.
- */
-void
-#ifdef __USE_PROTOS
-GenASTSymbolRedefs( FILE *f )
-#else
-GenASTSymbolRedefs( f )
-FILE *f;
-#endif
-{
- char **p;
-
- fprintf(f, "\n/* rename PCCTS-supplied AST symbols to be 'ParserName_symbol' */\n");
- for (p = &ASTSymbols[0]; *p!=NULL; p++)
- {
- fprintf(f, "#define %s %s_%s\n", *p, ParserName, *p);
- }
-}
-
-/* redefine all sets generated by ANTLR; WARNING: 'zzerr', 'setwd' must match
- * use in bits.c (DumpSetWd() etc...)
- */
-void
-#ifdef __USE_PROTOS
-GenSetRedefs( FILE *f )
-#else
-GenSetRedefs( f )
-FILE *f;
-#endif
-{
- int i;
-
- for (i=1; i<=wordnum; i++)
- {
- fprintf(f, "#define setwd%d %s_setwd%d\n", i, ParserName, i);
- }
- for (i=1; i<=esetnum; i++)
- {
- fprintf(f, "#define zzerr%d %s_err%d\n", i, ParserName, i);
- }
-}
-
-/* Find all return types/parameters that require structs and def
- * all rules with ret types.
- *
- * This is for the declaration, not the definition.
- */
-void
-#ifdef __USE_PROTOS
-GenRulePrototypes( FILE *f, Junction *p )
-#else
-GenRulePrototypes( f, p )
-FILE *f;
-Junction *p;
-#endif
-{
- int i;
-
- i = 1;
- while ( p!=NULL )
- {
- if ( p->ret != NULL )
- {
-/* MR23 */ if ( hasMultipleOperands(p->ret) )
- {
- DumpRetValStruct(f, p->ret, i);
- }
- fprintf(f, "\n#ifdef __USE_PROTOS\n");
-/* MR23 */ if ( hasMultipleOperands(p->ret) )
- {
- fprintf(f, "extern struct _rv%d", i);
- }
- else
- {
- fprintf(f, "extern ");
- DumpType(p->ret, f);
- }
- fprintf(f, " %s%s(", RulePrefix, p->rname);
- DumpANSIFunctionArgDef(f,p,1 /* emit initializers ? */);
- fprintf(f, ";\n");
- fprintf(f, "#else\n");
-/* MR23 */ if ( hasMultipleOperands(p->ret) )
- {
- fprintf(f, "extern struct _rv%d", i);
- }
- else
- {
- fprintf(f, "extern ");
- DumpType(p->ret, f);
- }
- fprintf(f, " %s%s();\n", RulePrefix, p->rname);
- fprintf(f, "#endif\n");
- }
- else
- {
- fprintf(f, "\n#ifdef __USE_PROTOS\n");
- fprintf(f, "void %s%s(", RulePrefix, p->rname);
- DumpANSIFunctionArgDef(f,p, 1 /* emit initializers ? */ );
- fprintf(f, ";\n");
-#ifdef OLD
- if ( p->pdecl != NULL || GenAST )
- {
- if ( GenAST ) {
- fprintf(f, "AST **%s",(p->pdecl!=NULL)?",":"");
- }
- if ( p->pdecl!=NULL ) fprintf(f, "%s", p->pdecl);
- }
- else fprintf(f, "void");
- fprintf(f, ");\n");
-#endif
- fprintf(f, "#else\n");
- fprintf(f, "extern void %s%s();\n", RulePrefix, p->rname);
- fprintf(f, "#endif\n");
- }
- i++;
- p = (Junction *)p->p2;
- }
-}
-
-/* Define all rules in the class.h file; generate any required
- * struct definitions first, however.
- */
-void
-#ifdef __USE_PROTOS
-GenRuleMemberDeclarationsForCC( FILE *f, Junction *q )
-#else
-GenRuleMemberDeclarationsForCC( f, q )
-FILE *f;
-Junction *q;
-#endif
-{
- Junction *p = q;
- int i;
-
- fprintf(f, "private:\n");
-
- /* Dump dflt handler declaration */
- fprintf(f, "\tvoid zzdflthandlers( int _signal, int *_retsignal );\n\n");
-
- fprintf(f, "public:\n");
-
- /* Dump return value structs */
- i = 1;
- while ( p!=NULL )
- {
- if ( p->ret != NULL )
- {
-/* MR23 */ if ( hasMultipleOperands(p->ret) )
- {
- DumpRetValStruct(f, p->ret, i);
- }
- }
- i++;
- p = (Junction *)p->p2;
- }
-
- /* Dump member func defs && CONSTRUCTOR */
- fprintf(f, "\t%s(ANTLRTokenBuffer *input);\n", CurrentClassName);
-/*
- fprintf(f, "\t%s(ANTLRTokenBuffer *input, ANTLRTokenType eof);\n",
- CurrentClassName);
-*/
-
- i = 1;
- p = q;
- while ( p!=NULL )
- {
- if ( p->ret != NULL )
- {
-/* MR23 */ if ( hasMultipleOperands(p->ret) )
- {
- fprintf(f, "\tstruct _rv%d", i);
- }
- else
- {
- fprintf(f, "\t");
- DumpType(p->ret, f);
- }
- fprintf(f, " %s%s(",RulePrefix,p->rname);
- DumpANSIFunctionArgDef(f,p, 1 /* emit initializers ? */ );
- fprintf(f, ";\n");
-#ifdef OLD
- if ( p->pdecl != NULL || GenAST )
- {
- if ( GenAST ) fprintf(f, "ASTBase **%s",(p->pdecl!=NULL)?",":"");
- if ( p->pdecl!=NULL ) fprintf(f, "%s", p->pdecl);
- }
- fprintf(f, ");\n");
-#endif
- }
- else
- {
- fprintf(f, "\tvoid %s%s(",RulePrefix,p->rname);
- DumpANSIFunctionArgDef(f,p, 1 /* emit initializers ? */);
- fprintf(f, ";\n");
-#ifdef OLD
- if ( p->pdecl != NULL || GenAST )
- {
- if ( GenAST ) fprintf(f, "ASTBase **%s",(p->pdecl!=NULL)?",":"");
- if ( p->pdecl!=NULL ) fprintf(f, "%s", p->pdecl);
- }
- fprintf(f, ");\n");
-#endif
- }
- i++;
- p = (Junction *)p->p2;
- }
-}
-
-/* Given a list of ANSI-style parameter declarations, print out a
- * comma-separated list of the symbols (w/o types).
- * Basically, we look for a comma, then work backwards until start of
- * the symbol name. Then print it out until 1st non-alnum char. Now,
- * move on to next parameter.
- *
- */
-
-/* MR5 Jan Mikkelsen 26-May-97 - added initalComma parameter */
-
-void
-#ifdef __USE_PROTOS
-DumpListOfParmNames(char *pdecl, FILE *output, int initialComma) /* MR5 */
-#else
-DumpListOfParmNames(pdecl, output, initialComma) /* MR5 */
-char *pdecl; /* MR5 */
-FILE *output; /* MR5 */
-int initialComma; /* MR5 */
-#endif
-{
- int firstTime = 1, done = 0;
- require(output!=NULL, "DumpListOfParmNames: NULL parm");
-
- if ( pdecl == NULL ) return;
- while ( !done )
- {
- if ( !firstTime || initialComma ) putc(',', output); /* MR5 */
- done = DumpNextNameInDef(&pdecl, output);
- firstTime = 0;
- }
-}
-
-/* given a list of parameters or return values, dump the next
- * name to output. Return 1 if last one just printed, 0 if more to go.
- */
-
-/* MR23 Total rewrite */
-
-int
-#ifdef __USE_PROTOS
-DumpNextNameInDef( char **q, FILE *output )
-#else
-DumpNextNameInDef( q, output )
-char **q;
-FILE *output;
-#endif
-{
- char *p;
- char *t;
- char *pDataType;
- char *pSymbol;
- char *pEqualSign;
- char *pValue;
- char *pSeparator;
- int nest = 0;
-
- p = endFormal(*q,
- &pDataType,
- &pSymbol,
- &pEqualSign,
- &pValue,
- &pSeparator,
- &nest);
-
- /* MR26 Handle rule arguments such as: IIR_Bool (IIR_Decl::*contstraint)()
- For this we need to strip off anything which follows the symbol.
- */
-
-/* MR26 */ t = pSymbol;
-/* MR26 */ if (t != NULL) {
-/* MR26 */ for (t = pSymbol; *t != 0; t++) {
-/* MR26 */ if (! (isalpha(*t) || isdigit(*t) || *t == '_' || *t == '$')) break;
-/* MR26 */ }
-/* MR26 */ }
-/* MR26 */ fprintf(output,strBetween(pSymbol, t, pSeparator));
-
- *q = p;
- return (*pSeparator == 0);
-}
-
-/* Given a list of ANSI-style parameter declarations, dump K&R-style
- * declarations, one per line for each parameter. Basically, convert
- * comma to semi-colon, newline.
- */
-void
-#ifdef __USE_PROTOS
-DumpOldStyleParms( char *pdecl, FILE *output )
-#else
-DumpOldStyleParms( pdecl, output )
-char *pdecl;
-FILE *output;
-#endif
-{
- require(output!=NULL, "DumpOldStyleParms: NULL parm");
-
- if ( pdecl == NULL ) return;
- while ( *pdecl != '\0' )
- {
- if ( *pdecl == ',' )
- {
- pdecl++;
- putc(';', output); putc('\n', output);
- while ( *pdecl==' ' || *pdecl=='\t' || *pdecl=='\n' ) pdecl++;
- }
- else {putc(*pdecl, output); pdecl++;}
- }
- putc(';', output);
- putc('\n', output);
-}
-
-/* Take in a type definition (type + symbol) and print out type only */
-/* MR23 Total rewrite */
-
-void
-#ifdef __USE_PROTOS
-DumpType( char *s, FILE *f )
-#else
-DumpType( s, f )
-char *s;
-FILE *f;
-#endif
-{
- char *p;
- char *pDataType;
- char *pSymbol;
- char *pEqualSign;
- char *pValue;
- char *pSeparator;
- int nest = 0;
-
- require(s!=NULL, "DumpType: invalid type string");
-
- p = endFormal(s,
- &pDataType,
- &pSymbol,
- &pEqualSign,
- &pValue,
- &pSeparator,
- &nest);
- fprintf(f,strBetween(pDataType, pSymbol, pSeparator));
-}
-
-/* check to see if string e is a word in string s */
-int
-#ifdef __USE_PROTOS
-strmember( char *s, char *e )
-#else
-strmember( s, e )
-char *s;
-char *e;
-#endif
-{
- register char *p;
- require(s!=NULL&&e!=NULL, "strmember: NULL string");
-
- if ( *e=='\0' ) return 1; /* empty string is always member */
- do {
- while ( *s!='\0' && !isalnum(*s) && *s!='_' )
- ++s;
- p = e;
- while ( *p!='\0' && *p==*s ) {p++; s++;}
- if ( *p=='\0' ) {
- if ( *s=='\0' ) return 1;
- if ( !isalnum (*s) && *s != '_' ) return 1;
- }
- while ( isalnum(*s) || *s == '_' )
- ++s;
- } while ( *s!='\0' );
- return 0;
-}
-
-#if 0
-
-/* MR23 Replaced by hasMultipleOperands() */
-
-int
-#ifdef __USE_PROTOS
-HasComma( char *s )
-#else
-HasComma( s )
-char *s;
-#endif
-{
- while (*s!='\0')
- if ( *s++ == ',' ) return 1;
- return 0;
-}
-#endif
-
-
-/* MR23 Total rewrite */
-
-void
-#ifdef __USE_PROTOS
-DumpRetValStruct( FILE *f, char *ret, int i )
-#else
-DumpRetValStruct( f, ret, i )
-FILE *f;
-char *ret;
-int i;
-#endif
-{
- char *p = ret;
- char *pDataType;
- char *pSymbol;
- char *pEqualSign;
- char *pValue;
- char *pSeparator;
- int nest = 0;
-
- fprintf(f, "\nstruct _rv%d {\n", i);
- while (*p != 0 && nest == 0) {
- p = endFormal(p,
- &pDataType,
- &pSymbol,
- &pEqualSign,
- &pValue,
- &pSeparator,
- &nest);
- fprintf(f,"\t");
- fprintf(f,strBetween(pDataType, pSymbol, pSeparator));
- fprintf(f," ");
- fprintf(f,strBetween(pSymbol, pEqualSign, pSeparator));
- fprintf(f,";\n");
- }
- fprintf(f,"};\n");
-}
-
-/* given "s" yield s -- DESTRUCTIVE (we modify s if starts with " else return s) */
-char *
-#ifdef __USE_PROTOS
-StripQuotes( char *s )
-#else
-StripQuotes( s )
-char *s;
-#endif
-{
- if ( *s == '"' )
- {
- s[ strlen(s)-1 ] = '\0'; /* remove last quote */
- return( s+1 ); /* return address past initial quote */
- }
- return( s );
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c
deleted file mode 100644
index 051ee4ec5d..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c
+++ /dev/null
@@ -1,1747 +0,0 @@
-/*
- * main.c -- main program for PCCTS ANTLR.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-/* To set a breakpoint just before exit look for "cleanUp". */
-/* To set a breakpoint for fatal error look for "fatal_intern" */
-
-#include <stdio.h>
-
-#include "pcctscfg.h"
-#include "stdpccts.h"
-
-#define MAX_INT_STACK 50
-static int istack[MAX_INT_STACK]; /* Int stack */
-static int isp = MAX_INT_STACK;
-
-static int DontAcceptFiles = 0; /* if stdin, don't read files */
-static int DontAcceptStdin = 0; /* if files seen first, don't accept stdin */
-
-static int tnodes_used_in_guard_predicates_etc; /* MR10 */
-
- /* C m d - L i n e O p t i o n S t r u c t & F u n c s */
-
-typedef struct _Opt {
- char *option;
- int arg;
-#ifdef __cplusplus
- void (*process)(...);
-#else
- void (*process)();
-#endif
- char *descr;
- } Opt;
-
-#ifdef __USE_PROTOS
-extern void ProcessArgs(int, char **, Opt *);
-#else
-extern void ProcessArgs();
-#endif
-
-#ifdef __USE_PROTOS
-int ci_strequ(char *a,char *b)
-#else
-int ci_strequ(a,b)
- char *a;
- char *b;
-#endif
-{
- for ( ;*a != 0 && *b != 0; a++, b++) {
- if (toupper(*a) != toupper(*b)) return 0;
- }
- return (*a == *b);
-}
-
-static void
-#ifdef __USE_PROTOS
-pStdin( void )
-#else
-pStdin( )
-#endif
-{
- if ( DontAcceptStdin )
- {
- warnNoFL("'-' (stdin) ignored as files were specified first");
- return;
- }
-
- require(NumFiles<MaxNumFiles,"exceeded max # of input files");
- FileStr[NumFiles++] = "stdin";
- DontAcceptFiles = 1;
-}
-
-static void
-#ifdef __USE_PROTOS
-pFile( char *s )
-#else
-pFile( s )
-char *s;
-#endif
-{
- if ( *s=='-' ) { warnNoFL( eMsg1("invalid option: '%s'",s) ); return; }
- if ( DontAcceptFiles )
- {
- warnNoFL(eMsg1("file '%s' ignored as '-' (stdin option) was specified first",s));
- return;
- }
-
- require(NumFiles<MaxNumFiles,"exceeded max # of input files");
- FileStr[NumFiles++] = s;
- DontAcceptStdin = 1;
-}
-
-/* MR14
- Allow input to be a file containing a list of files
- Bernard Giroud (b_giroud@decus.ch)
-*/
-
-static void
-#ifdef __USE_PROTOS
-pFileList( char *s, char *t )
-#else
-pFileList( s, t )
-char *s;
-char *t;
-#endif
-{
-#define MaxFLArea 1024
- FILE *fl;
- static char Fn_in_Fl[MaxFLArea] = "";
- char one_fn[MaxFileName];
- char *flp = &Fn_in_Fl[0];
- int fnl, left = MaxFLArea, i;
-
- if ( *t=='-' ) { warnNoFL( eMsg1("invalid option: '%s'",t) ); return; }
- if ( DontAcceptFiles )
- {
- warnNoFL(eMsg1("file '%s' ignored as '-' (stdin option) was specified first",t));
- return;
- }
-
- if ((fl = fopen(t, "r")) == NULL)
- {
- warnNoFL(eMsg1("file '%s' can't be opened", t));
- return;
- }
- for (;;)
- {
- if (fgets(one_fn, 128 - 1, fl) == NULL)
- break;
- fnl = strlen(one_fn);
- require(fnl<=left, "no more room in File List Area");
- /* drop the trailing LF */
- if (one_fn[fnl - 1] == 0x0a) one_fn[fnl - 1] = ' ';
- strcat(Fn_in_Fl, one_fn);
- left = left - fnl;
- require(NumFiles<MaxNumFiles,"exceeded max # of input files");
- FileStr[NumFiles++] = flp;
- flp = flp + fnl;
- }
- fclose(fl);
- for (i=0;i < MaxFLArea;i++) if (Fn_in_Fl[i] == ' ') Fn_in_Fl[i] = '\0';
- DontAcceptStdin = 1;
-}
-
-static void
-#ifdef __USE_PROTOS
-pLLK( char *s, char *t )
-#else
-pLLK( s, t )
-char *s;
-char *t;
-#endif
-{
- LL_k = atoi(t);
- if ( LL_k <= 0 ) {
- warnNoFL("must have at least one token of lookahead (setting to 1)");
- LL_k = 1;
- }
-}
-
-static void
-#ifdef __USE_PROTOS
-pCk( char *s, char *t )
-#else
-pCk( s, t )
-char *s;
-char *t;
-#endif
-{
- CLL_k = atoi(t);
- if ( CLL_k <= 0 ) {
- warnNoFL("must have at least one token of look-ahead (setting to 1)");
- CLL_k = 1;
- }
-}
-
-static void /* MR6 */
-#ifdef __USE_PROTOS
-pTab( char *s, char *t ) /* MR6 */
-#else
-pTab( s, t ) /* MR6 */
-char *s; /* MR6 */
-char *t; /* MR6 */
-#endif
-{ /* MR6 */
- TabWidth = atoi(t); /* MR6 */
- if ( TabWidth < 0 || TabWidth > 8 ) { /* MR6 */
- warnNoFL("tab width must be between 1 and 8"); /* MR6 */
- TabWidth=0; /* MR6 */
- } /* MR6 */
-} /* MR6 */
-
-static int ambAidDepthSpecified=0; /* MR11 */
-
-static void /* MR11 */
-#ifdef __USE_PROTOS
-pAAd( char *s, char *t ) /* MR11 */
-#else
-pAAd( s, t ) /* MR11 */
-char *s; /* MR11 */
-char *t; /* MR11 */
-#endif
-{ /* MR11 */
- ambAidDepthSpecified=1; /* MR11 */
- MR_AmbAidDepth = atoi(t); /* MR11 */
-} /* MR11 */
-
-static void /* MR11 */
-#ifdef __USE_PROTOS
-pTreport( char *s, char *t ) /* MR11 */
-#else
-pTreport( s, t ) /* MR11 */
- char *s; /* MR11 */
- char *t; /* MR11 */
-#endif
-{ /* MR11 */
- TnodesReportThreshold = atoi(t); /* MR11 */
-} /* MR11 */
-
-#ifdef __USE_PROTOS
-void chkGTFlag(void) /* 7-Apr-97 MR1 */
-#else
-void chkGTFlag() /* 7-Apr-97 MR1 */
-#endif
-{
- if ( !GenAST )
- warn("#-variable or other AST item referenced w/o -gt option");
-}
-
-
-#ifdef __USE_PROTOS
-static void pInfo(char *s, char *t) /* MR10 */
-#else
-static void pInfo(s,t) /* MR10 */
- char *s;
- char *t;
-#endif
-{
- char *p;
- int q;
- for (p=t; *p != 0; p++) {
- q=tolower(*p);
- if (q=='t') {
- InfoT=1;
- } else if (q=='p') {
- InfoP=1;
- } else if (q=='m') {
- InfoM=1;
- } else if (q=='o') {
- InfoO=1;
- } else if (q=='0') {
- ; /* nothing */
- } else if (q=='f') {
- InfoF=1;
- } else {
- warnNoFL(eMsgd("unrecognized -info option \"%c\"",(int)*p));
- };
- };
-}
-
-#ifdef __USE_PROTOS
-static void pCGen(void) { CodeGen = FALSE; LexGen = FALSE; }
-static void pLGen(void) { LexGen = FALSE; }
-static void pXTGen(void){ MR_Inhibit_Tokens_h_Gen = TRUE; }
-static void pTGen(void) { TraceGen = TRUE; }
-static void pSGen(void) { GenExprSetsOpt = FALSE; }
-static void pPrt(void) { PrintOut = TRUE; pCGen(); pLGen(); }
-static void pPrtA(void) { PrintOut = TRUE; PrintAnnotate = TRUE; pCGen(); pLGen(); }
-static void pAst(void) { GenAST = TRUE; }
-static void pANSI(void) { GenANSI = TRUE; }
-static void pCr(void) { GenCR = TRUE; }
-static void pNOPURIFY(void) { PURIFY = FALSE; }
-/*static void pCt(void) { warnNoFL("-ct option is now the default"); }*/
-static void pLI(void) { GenLineInfo = TRUE; GenLineInfoMS = FALSE; } /* MR14 */
-static void pLIms(void) { GenLineInfo = TRUE; GenLineInfoMS = TRUE; } /* MR14 */
-static void pFr(char *s, char *t) {RemapFileName = t;}
-static void pFe(char *s, char *t) {ErrFileName = t;}
-static void pFl(char *s, char *t) {DlgFileName = t;}
-static void pFm(char *s, char *t) {ModeFileName = t;}
-static void pFt(char *s, char *t) {DefFileName = t;}
-
-static void pE1(void) { elevel = 1; }
-static void pE2(void) { elevel = 2; }
-static void pE3(void) { elevel = 3; }
-static void pEGen(void) { GenEClasseForRules = 1; }
-static void pDL(void)
- {
- DemandLookahead = 1;
- if ( GenCC ) {
- warnNoFL("-gk does not work currently in C++ mode; -gk turned off");
- DemandLookahead = 0;
- }
- }
-
-static void pAA(char *s,char *t) {MR_AmbAidRule = t;} /* MR11 */
-static void pAAm(char *s){MR_AmbAidMultiple = 1;} /* MR11 */
-static void pGHdr(void) { GenStdPccts = 1; }
-static void pFHdr(char *s, char *t) { stdpccts = t; pGHdr(); }
-static void pW1(void) { WarningLevel = 1; }
-static void pNewAST(void) { NewAST = 1; } /* MR13 */
-static void ptmakeInParser(void) { tmakeInParser = 1; } /* MR23 */
-static void pAlpha(void) { AlphaBetaTrace = 1; } /* MR14 */
-static void pMR_BlkErr(void) { MR_BlkErr = 1; } /* MR21 */
-static void pStdout(void) {UseStdout = 1; } /* MR6 */
-static void pW2(void) { WarningLevel = 2; }
-static void pCC(void) { GenCC = TRUE; }
-#else
-static void pCGen() { CodeGen = FALSE; LexGen = FALSE; }
-static void pLGen() { LexGen = FALSE; }
-static void pXTGen(){ MR_Inhibit_Tokens_h_Gen = TRUE; } /* MR14 */
-static void pTGen() { TraceGen = TRUE; }
-static void pSGen() { GenExprSetsOpt = FALSE; }
-static void pPrt() { PrintOut = TRUE; pCGen(); pLGen(); }
-static void pPrtA() { PrintOut = TRUE; PrintAnnotate = TRUE; pCGen(); pLGen(); }
-static void pAst() { GenAST = TRUE; }
-static void pANSI() { GenANSI = TRUE; }
-static void pCr() { GenCR = TRUE; }
-static void pNOPURIFY() { PURIFY = FALSE; }
-
-/*static void pCt() { warnNoFL("-ct option is now the default"); }*/
-static void pLI() { GenLineInfo = TRUE; GenLineInfoMS = FALSE; } /* MR14 */
-static void pLIms() { GenLineInfo = TRUE; GenLineInfoMS = TRUE; } /* MR14 */
-static void pFr(s,t) char *s, *t; {RemapFileName = t;}
-static void pFe(s,t) char *s, *t; {ErrFileName = t;}
-static void pFl(s,t) char *s, *t; {DlgFileName = t;}
-static void pFm(s,t) char *s, *t; {ModeFileName = t;}
-static void pFt(s,t) char *s, *t; {DefFileName = t;}
-
-static void pE1() { elevel = 1; }
-static void pE2() { elevel = 2; }
-static void pE3() { elevel = 3; }
-static void pEGen() { GenEClasseForRules = 1; }
-static void pDL()
- {
- DemandLookahead = 1;
- if ( GenCC ) {
- warnNoFL("-gk does not work currently in C++ mode; -gk turned off");
- DemandLookahead = 0;
- }
- }
-
-static void pAA(s,t) char *s; char *t; {MR_AmbAidRule = t;} /* MR11 BJS 20-Mar-98 */
-static void pAAm(s) char *s; {MR_AmbAidMultiple = 1;} /* MR11 BJS 20-Mar-98 */
-static void pGHdr() { GenStdPccts = 1; }
-static void pFHdr(s,t) char *s, *t; { stdpccts = t; pGHdr(); }
-static void pW1() { WarningLevel = 1; }
-static void pNewAST() { NewAST = 1; } /* MR13 */
-static void ptmakeInParser() { tmakeInParser = 1; } /* MR23 */
-static void pAlpha() { AlphaBetaTrace = 1; } /* MR14 */
-static void pMR_BlkErr() { MR_BlkErr = 1; } /* MR21 */
-static void pStdout() {UseStdout = 1; } /* MR6 */
-static void pW2() { WarningLevel = 2; }
-static void pCC() { GenCC = TRUE; }
-#endif
-
-static void
-#ifdef __USE_PROTOS
-pPre( char *s, char *t )
-#else
-pPre( s, t )
-char *s;
-char *t;
-#endif
-{
- RulePrefix = t;
-}
-
-static void
-#ifdef __USE_PROTOS
-pOut( char *s, char *t )
-#else
-pOut( s, t )
-char *s;
-char *t;
-#endif
-{
- OutputDirectory = t;
-}
-
-static void
-#ifdef __USE_PROTOS
-pPred( void )
-#else
-pPred( )
-#endif
-{
- warnNoFL("-pr is no longer used (predicates employed if present); see -prc, -mrhoist, -mrhoistk");
-/*
-** if ( DemandLookahead )
-** warnNoFL("-gk conflicts with -pr; -gk turned off");
-** DemandLookahead = 0;
-** HoistPredicateContext = 0;
-*/
-}
-
-static void
-#ifdef __USE_PROTOS
-pPredCtx( char *s, char *t )
-#else
-pPredCtx(s,t)
-char *s;
-char *t;
-#endif
-{
- if ( ci_strequ(t,"on")) HoistPredicateContext = 1;
- else if ( ci_strequ(t,"off")) HoistPredicateContext = 0;
- if ( DemandLookahead )
- {
- warnNoFL("-gk incompatible with semantic predicate usage; -gk turned off");
- DemandLookahead = 0;
- }
-}
-
-static void
-#ifdef __USE_PROTOS
-pMRhoist( char *s, char *t )
-#else
-pMRhoist(s,t)
-char *s;
-char *t;
-#endif
-{
- if ( ci_strequ(t,"on")) MRhoisting = 1;
- else if ( ci_strequ(t,"off")==0 ) MRhoisting = 0;
- if (MRhoisting) {
- fprintf(stderr,"Maintenance Release style hoisting enabled for predicates with lookahead depth = 1\n");
- fprintf(stderr," No longer considered experimental\n");
- fprintf(stderr," Can't consider suppression for predicates with lookahead depth > 1\n");
- fprintf(stderr," Implies -prc on but does *not* imply -mrhoistk for k>1 predicates\n");
- fprintf(stderr," This is a reminder, not a warning or error.\n");
- };
-}
-
-static void
-#ifdef __USE_PROTOS
-pMRhoistk( char *s, char *t )
-#else
-pMRhoistk(s,t)
-char *s;
-char *t;
-#endif
-{
- if ( ci_strequ(t,"on")) MRhoistingk = 1;
- else if ( ci_strequ(t,"off")==0 ) MRhoistingk = 0;
- if (MRhoistingk) {
- fprintf(stderr,"EXPERIMENTAL Maintenance Release style hoisting enabled\n");
- fprintf(stderr," Applies to predicates with lookahead depth > 1\n");
- fprintf(stderr," Implies -prc on and -mrhoist on\n");
- };
-}
-
-static void
-#ifdef __USE_PROTOS
-pTRes( char *s, char *t )
-#else
-pTRes( s, t )
-char *s;
-char *t;
-#endif
-{
- TreeResourceLimit = atoi(t);
- if ( TreeResourceLimit <= 0 )
- {
- warnNoFL("analysis resource limit (# of tree nodes) must be greater than 0");
- TreeResourceLimit = -1; /* set to no limit */
- }
-}
-
-Opt options[] = {
-#ifdef __cplusplus
- { "-CC", 0, (void (*)(...)) pCC, "Generate C++ output (default=FALSE)"},
- { "-ck", 1, (void (*)(...)) pCk, "Set compressed lookahead depth; fast approximate lookahead"},
- { "-cr", 0, (void (*)(...)) pCr, "Generate cross reference (default=FALSE)"},
- { "-e1", 0, (void (*)(...)) pE1, "Ambiguities/errors shown in low detail (default)"},
- { "-e2", 0, (void (*)(...)) pE2, "Ambiguities/errors shown in more detail"},
- { "-e3", 0, (void (*)(...)) pE3,
- "Ambiguities for k>1 grammars shown with exact tuples (not lookahead sets)"},
- { "-f", 1, (void (*)(...)) pFileList,"Read names of grammar files from specified file"}, /* MR14 */
- { "-fe", 1, (void (*)(...)) pFe, "Rename err.c"},
- { "-fh", 1, (void (*)(...)) pFHdr, "Rename stdpccts.h header (turns on -gh)"},
- { "-fl", 1, (void (*)(...)) pFl, "Rename lexical output--parser.dlg"},
- { "-fm", 1, (void (*)(...)) pFm, "Rename mode.h"},
- { "-fr", 1, (void (*)(...)) pFr, "Rename remap.h"},
- { "-ft", 1, (void (*)(...)) pFt, "Rename tokens.h"},
- { "-ga", 0, (void (*)(...)) pANSI, "Generate ANSI-compatible code (default=FALSE)"},
- { "-gc", 0, (void (*)(...)) pCGen, "Do not generate output parser code (default=FALSE)"},
- { "-gd", 0, (void (*)(...)) pTGen, "Generate code to trace rule invocation (default=FALSE)"},
- { "-ge", 0, (void (*)(...)) pEGen, "Generate an error class for each non-terminal (default=FALSE)"},
- { "-gh", 0, (void (*)(...)) pGHdr, "Generate stdpccts.h for non-ANTLR-generated-files to include"},
- { "-gk", 0, (void (*)(...)) pDL, "Generate parsers that delay lookahead fetches until needed"},
- { "-gl", 0, (void (*)(...)) pLI, "Generate line info about grammar actions in parser"},
- { "-glms", 0, (void (*)(...)) pLIms,"Like -gl but replace '\\' with '/' in #line filenames for MS C/C++ systems"},
- { "-gp", 1, (void (*)(...)) pPre, "Prefix all generated rule functions with a string"},
- { "-gs", 0, (void (*)(...)) pSGen, "Do not generate sets for token expression lists (default=FALSE)"},
- { "-gt", 0, (void (*)(...)) pAst, "Generate code for Abstract-Syntax-Trees (default=FALSE)"},
- { "-gx", 0, (void (*)(...)) pLGen, "Do not generate lexical (dlg-related) files (default=FALSE)"},
- { "-gxt",0, (void (*)(...)) pXTGen, "Do not generate tokens.h (default=FALSE)"},
- { "-k", 1, (void (*)(...)) pLLK, "Set full LL(k) lookahead depth (default==1)"},
- { "-o", 1, (void (*)(...)) pOut, OutputDirectoryOption},
- { "-p", 0, (void (*)(...)) pPrt, "Print out the grammar w/o actions (default=no)"},
- { "-pa", 0, (void (*)(...)) pPrtA, "Print out the grammar w/o actions & w/FIRST sets (default=no)"},
- { "-pr",0, (void (*)(...)) pPred, "no longer used; predicates employed if present"},
- { "-prc", 1, (void (*)(...)) pPredCtx,"Turn on/off computation of context for hoisted predicates"},
- { "-rl", 1, (void (*)(...)) pTRes, "Limit max # of tree nodes used by grammar analysis"},
- { "-stdout",0, (void (*)(...)) pStdout,"Send grammar.c/grammar.cpp to stdout"}, /* MR6 */
- { "-tab", 1, (void (*)(...)) pTab, "Width of tabs (1 to 8) for grammar.c/grammar.cpp files"}, /* MR6 */
- { "-w1", 0, (void (*)(...)) pW1, "Set the warning level to 1 (default)"},
- { "-w2", 0, (void (*)(...)) pW2, "Ambiguities yield warnings even if predicates or (...)? block"},
- { "-", 0, (void (*)(...)) pStdin, "Read grammar from stdin" },
- { "-mrhoist",1, (void (*)(...)) pMRhoist, /* MR9 */
- "Turn on/off k=1 Maintenance Release style hoisting"}, /* MR9 */
- { "-mrhoistk",1, (void (*)(...)) pMRhoistk, /* MR9 */
- "Turn on/off EXPERIMENTAL k>1 Maintenance Release style hoisting"}, /* MR13 */
- { "-aa" , 1, (void (*)(...)) pAA, "Ambiguity aid for a rule (rule name or line number)"}, /* MR11 */
- { "-aam" , 0, (void (*)(...)) pAAm,
- "Lookahead token may appear multiple times in -aa listing"}, /* MR11 */
- { "-aad" , 1, (void (*)(...)) pAAd,
- "Limits exp growth of -aa listing - default=1 (max=ck value)"}, /* MR11 */
- { "-info", 1, (void (*)(...)) pInfo,
- "Extra info: p=pred t=tnodes f=first/follow m=monitor o=orphans 0=noop"}, /* MR12 */
- { "-treport",1,(void (*)(...)) pTreport,
- "Report when tnode usage exceeds value during ambiguity resolution"}, /* MR11 */
- { "-newAST", 0, (void (*)(...)) pNewAST,
- "In C++ mode use \"newAST(...)\" rather than \"new AST(...)\""}, /* MR13 */
- { "-tmake", 0, (void (*)(...)) ptmakeInParser,
- "In C++ mode use parser's tmake method rather than \"ASTBase::tmake(...)\""}, /* MR23 */
- { "-alpha",0,(void (*)(...)) pAlpha,
- "Provide additional information for \"(alpha)? beta\" error messages"}, /* MR14 */
- { "-mrblkerr",0,(void (*)(...)) pMR_BlkErr, /* MR21 */
- "EXPERIMENTAL change to (...)* and (...)+ syntax error sets"}, /* MR21 */
- { "-nopurify",0,(void (*)(...)) pNOPURIFY,
- "Don't use the notorious PURIFY macro (replaced by MR23 initial value syntax) to zero return arguments of rules"}, /* MR23 */
- { "*", 0, (void (*)(...)) pFile, "" }, /* anything else is a file */
-#else
- { "-CC", 0, pCC, "Generate C++ output (default=FALSE)"},
- { "-cr", 0, pCr, "Generate cross reference (default=FALSE)"},
- { "-ck", 1, pCk, "Set compressed lookahead depth; fast approximate lookahead"},
- { "-e1", 0, pE1, "Ambiguities/errors shown in low detail (default)"},
- { "-e2", 0, pE2, "Ambiguities/errors shown in more detail"},
- { "-e3", 0, pE3, "Ambiguities for k>1 grammars shown with exact tuples (not lookahead sets)"},
- { "-f", 1, pFileList,"Read names of grammar files from specified file"}, /* MR14 */
- { "-fe", 1, pFe, "Rename err.c"},
- { "-fh", 1, pFHdr, "Rename stdpccts.h header (turns on -gh)"},
- { "-fl", 1, pFl, "Rename lexical output--parser.dlg"},
- { "-fm", 1, pFm, "Rename mode.h"},
- { "-fr", 1, pFr, "Rename remap.h"},
- { "-ft", 1, pFt, "Rename tokens.h"},
- { "-ga", 0, pANSI, "Generate ANSI-compatible code (default=FALSE)"},
- { "-gc", 0, pCGen, "Do not generate output parser code (default=FALSE)"},
- { "-gd", 0, pTGen, "Generate code to trace rule invocation (default=FALSE)"},
- { "-ge", 0, pEGen, "Generate an error class for each non-terminal (default=FALSE)"},
- { "-gh", 0, pGHdr, "Generate stdpccts.h for non-ANTLR-generated-files to include"},
- { "-gk", 0, pDL, "Generate parsers that delay lookahead fetches until needed"},
- { "-gl", 0, pLI, "Generate line info about grammar actions in C parser"},
- { "-glms", 0, pLIms,"Like -gl but replace '\\' with '/' in #line filenames for MS C/C++ systems"},
- { "-gp", 1, pPre, "Prefix all generated rule functions with a string"},
- { "-gs", 0, pSGen, "Do not generate sets for token expression lists (default=FALSE)"},
- { "-gt", 0, pAst, "Generate code for Abstract-Syntax-Trees (default=FALSE)"},
- { "-gx", 0, pLGen, "Do not generate lexical (dlg-related) files (default=FALSE)"},
- { "-gxt",0, pXTGen, "Do not generate tokens.h (default=FALSE)"},
- { "-k", 1, pLLK, "Set full LL(k) lookahead depth (default==1)"},
- { "-o", 1, pOut, OutputDirectoryOption},
- { "-p", 0, pPrt, "Print out the grammar w/o actions (default=no)"},
- { "-pa", 0, pPrtA, "Print out the grammar w/o actions & w/FIRST sets (default=no)"},
- { "-pr",0, pPred, "no longer used; predicates employed if present"},
- { "-prc", 1, pPredCtx,"Turn on/off computation of context for hoisted predicates"},
- { "-rl", 1, pTRes, "Limit max # of tree nodes used by grammar analysis"},
- { "-stdout",0, pStdout, "Send grammar.c/grammar.cpp to stdout"}, /* MR6 */
- { "-tab", 1, pTab, "Width of tabs (1 to 8) for grammar.c/grammar.cpp files"}, /* MR6 */
- { "-w1", 0, pW1, "Set the warning level to 1 (default)"},
- { "-w2", 0, pW2, "Ambiguities yield warnings even if predicates or (...)? block"},
- { "-mrhoist",1,pMRhoist, /* MR9 */
- "Turn on/off k=1 Maintenance Release style hoisting"}, /* MR9 */
- { "-mrhoistk",1,pMRhoistk, /* MR13 */
- "Turn on/off k>1 EXPERIMENTAL Maintenance Release style hoisting"}, /* MR13 */
- { "-aa" ,1,pAA, "Ambiguity aid for a rule (rule name or line number)"}, /* MR11 */
- { "-aam" ,0,pAAm,
- "Lookahead token may appear multiple times in -aa listing"}, /* MR11 */
- { "-aad" ,1,pAAd,
- "Limits exp growth of -aa listing - default=1 (max=ck value)"}, /* MR11 */
- { "-info",1,pInfo,
- "Extra info: p=pred t=tnodes f=first/follow m=monitor o=orphans 0=noop"}, /* MR11 */
- { "-treport",1,pTreport,
- "Report when tnode usage exceeds value during ambiguity resolution"}, /* MR11 */
- { "-newAST", 0, pNewAST,
- "In C++ mode use \"newAST(...)\" rather than \"new AST(...)\""}, /* MR13 */
- { "-tmake", 0, ptmakeInParser,
- "In C++ mode use parser's tmake method rather than \"ASTBase::tmake(...)\""}, /* MR23 */
- { "-alpha",0, pAlpha,
- "Provide additional information for \"(alpha)? beta\" error messages"}, /* MR14 */
- { "-mrblkerr",0,pMR_BlkErr, /* MR21 */
- "EXPERIMENTAL change to (...)* and (...)+ syntax error sets"}, /* MR21 */
- { "-nopurify",0,pNOPURIFY,
- "Don't use the notorious PURIFY macro (replaced by MR23 initial value syntax) to zero return arguments of rules"}, /* MR23 */
- { "-", 0, pStdin, "Read grammar from stdin" },
- { "*", 0, pFile, "" }, /* anything else is a file */
-#endif
- { NULL, 0, NULL }
- };
-
-void readDescr();
-void cleanUp();
-
-#ifdef __USE_PROTOS
-static void buildRulePtr( void );
-static void help( void );
-static void init( void );
-static void CompleteTokenSetRefs( void );
-static void ensure_no_C_file_collisions(char *);
-static void CompleteContextGuards(void);
-#else
-static void buildRulePtr( );
-static void help( );
-static void init( );
-static void CompleteTokenSetRefs( );
-static void ensure_no_C_file_collisions();
-static void CompleteContextGuards();
-#endif
-
-static void
-#ifdef __USE_PROTOS /* <BJS> */
-report_numericPredLabels(ActionNode *a)
-#else
-report_numericPredLabels(a)
-ActionNode *a;
-#endif
-{ /* MR10 */
- warnFL("numeric references to attributes (e.g. $i or $i.j) in semantic pred will be null during guess mode", /* MR10 */
- FileStr[a->file],a->line); /* MR10 */
-} /* MR10 */
-
- /* M a i n */
-
-int
-#ifdef __USE_PROTOS
-main( int argc, char *argv[] )
-#else
-main( argc, argv )
-int argc;
-char *argv[];
-#endif
-{
- int i;
- static char EPSTR[] = "[Ep]";
-
- Save_argc=argc; /* MR10 */
- Save_argv=argv; /* MR10 */
-
-/* malloc_debug(8);*/
-
-#ifdef SPECIAL_INITS
- special_inits(); /* MR1 */
-#endif
- fprintf(stderr, "Antlr parser generator Version %s 1989-2001\n", Version);
- if ( argc == 1 ) { help(); zzDIE; }
- ProcessArgs(argc-1, &(argv[1]), options);
-
-/* MR14 */ if (MR_AmbAidRule && AlphaBetaTrace) {
-/* MR14 */ fatal("Can't specify both -aa (ambiguity aid) and -alpha (\"(alpha)? beta\" aid)");
-/* MR14 */ }
-
- if (MRhoistingk) { /* MR13 */
- HoistPredicateContext=1; /* MR13 */
- MRhoisting=1; /* MR13 */
- }; /* MR13 */
- if (MRhoisting && ! HoistPredicateContext) {
-/*** warnNoFL("Using \"-mrhoist\" forces \"-prc on\""); ***/
- HoistPredicateContext=1;
- };
- if (HoistPredicateContext && ! MRhoisting) {
- warnNoFL("When using predicate context (-prc on) -mrhoist on is recommended");
- }
- /* Fix lookahead depth */
- /* Compressed lookahead must always be larger than or equal to full lookahead */
- if ( CLL_k < LL_k && CLL_k>0 )
- {
- warnNoFL("must have compressed lookahead >= full LL(k) lookahead (setting -ck to -k)");
- CLL_k = LL_k;
- }
- if ( CLL_k == -1 ) CLL_k = LL_k;
- OutputLL_k = CLL_k;
- if ( ((CLL_k-1)&CLL_k)!=0 ) { /* output ll(k) must be power of 2 */
- int n;
- for(n=1; n<CLL_k; n<<=1) {;}
- OutputLL_k = n;
- };
-
- if (MR_BlkErr) {
- warnNoFL("The -mrblkerr option is EXPERIMENTAL");
- if (LL_k > 1) {
- warnNoFL("The -mrblkerr option is designed only for k=1 ck=1 grammars");
- }
- };
-
- if ( ! ambAidDepthSpecified) {
- MR_AmbAidDepth=1;
- } else {
- if (MR_AmbAidDepth > CLL_k || MR_AmbAidDepth <= 0) {
- warnNoFL(eMsgd(
- "Ambiguity aid depth (\"-aad ...\") must be a number between 1 and max(k,ck)=%d",CLL_k));
- MR_AmbAidDepth=1;
- };
- if (MR_AmbAidDepth == 0) {
- MR_AmbAidDepth=2;
- };
- };
-
- if (MR_AmbAidRule != NULL) MR_AmbAidLine=atoi(MR_AmbAidRule);
-
- fpTrans = &(C_Trans[0]); /* Translate to C Language */
- fpJTrans = &(C_JTrans[0]);
- init();
- lexclass(LexStartSymbol);
-
- readDescr();
- LastTokenCounted = TokenNum;
- RemapForcedTokens();
- if ( CannotContinue ) {cleanUp(); zzDIE;}
- if ( GenCC && no_classes_found ) fatal("required grammar class not found (exiting...)");
- if ( WarningLevel>1 && HdrAction == NULL )
- warnNoFL("no #header action was found");
- if ( FoundAtOperator && ! FoundExceptionGroup) {
- warnNoFL("found the exception operator '@' - but no exception group was found");
- };
- EpToken = addTname(EPSTR); /* add imaginary token epsilon */
- set_orel(EpToken, &imag_tokens);
-
- /* this won't work for hand-built scanners since EofToken is not
- * known. Forces EOF to be token type 1.
- */
- set_orel(EofToken, &imag_tokens);
-
- set_size(NumWords(TokenNum-1));
-
- /* compute the set of all known token types
- * It represents the set of tokens from 1 to last_token_num + the
- * reserved positions above that (if any). Don't include the set of
- * imaginary tokens such as the token/error classes or EOF.
- */
- {
- set a;
- a = set_dup(reserved_positions);
- for (i=1; i<TokenNum; i++) { set_orel(i, &a); }
- all_tokens = set_dif(a, imag_tokens);
- set_free(a);
- }
-
- ComputeTokSets(); /* Compute #tokclass sets */
- CompleteTokenSetRefs(); /* Change complex nodes in syn diag */
- CompleteContextGuards(); /* MR13 */
-
- if ( CodeGen ) genDefFile(); /* create tokens.h */
- if ( LexGen ) genLexDescr(); /* create parser.dlg */
-
- if ( GenStdPccts )
- {
- FILE *f = fopen(OutMetaName(stdpccts), "w");
- if ( f==NULL ) {warnNoFL( eMsg1("can't create %s",OutMetaName(stdpccts)) );}
- else
- {
-#ifdef SPECIAL_FOPEN
- special_fopen_actions(OutMetaName(stdpccts)); /* MR1 */
-#endif
- if (strcmp(stdpccts,"stdpccts.h") == 0) { /* MR10 */
- genStdPCCTSIncludeFile(f,NULL); /* MR10 */
- } else { /* MR10 */
- genStdPCCTSIncludeFile(f,pcctsBaseName(stdpccts)); /* MR32 */
- };
- fclose(f);
- }
- }
-
- buildRulePtr(); /* create mapping from rule # to RuleBlk junction */
- ComputeErrorSets();
- FoLink( (Node *)SynDiag ); /* add follow links to end of all rules */
-
- if ( GenCR ) GenCrossRef( SynDiag );
-
- if ( CodeGen )
- {
- if ( SynDiag == NULL )
- {
- warnNoFL("no grammar description recognized");
- cleanUp();
- zzDIE;
- }
- else if ( !GenCC ) {
- ErrFile = fopen(OutMetaName(ErrFileName), "w");
- require(ErrFile != NULL, "main: can't open err file");
-#ifdef SPECIAL_FOPEN
- special_fopen_actions(OutMetaName(ErrFileName)); /* MR1 */
-#endif
- NewSetWd();
- GenErrHdr();
- TRANS(SynDiag); /* Translate to the target language */
- DumpSetWd();
- DumpRemainingTokSets();
- fclose( ErrFile );
- }
- else {
- strcpy(Parser_h_Name, CurrentClassName);
- strcat(Parser_h_Name, ".h");
- strcpy(Parser_c_Name, CurrentClassName);
- strcat(Parser_c_Name, CPP_FILE_SUFFIX);
- ensure_no_C_file_collisions(Parser_c_Name);
- Parser_h = fopen(OutMetaName(Parser_h_Name), "w");
- require(Parser_h != NULL, "main: can't open class Parserx.h file");
-#ifdef SPECIAL_FOPEN
- special_fopen_actions(OutMetaName(Parser_h_Name)); /* MR1 */
-#endif
- Parser_c = fopen(OutMetaName(Parser_c_Name), "w");
- require(Parser_c != NULL, "main: can't open class Parserx.c file");
-#ifdef SPECIAL_FOPEN
- special_fopen_actions(OutMetaName(Parser_c_Name)); /* MR1 */
-#endif
- GenParser_h_Hdr();
- if ( class_before_actions != NULL )
- {
- ListNode *p;
- for (p = class_before_actions->next; p!=NULL; p=p->next)
- {
- UserAction *ua = (UserAction *)p->elem;
- dumpAction( ua->action, Parser_h, 0, ua->file, ua->line, 1);
- }
- }
- GenParser_c_Hdr();
- fprintf(Parser_h, "protected:\n"); /* MR20 */
- NewSetWd();
- TRANS(SynDiag); /* Translate to the target language */
- DumpSetWd();
- GenRuleMemberDeclarationsForCC(Parser_h, SynDiag);
- if ( class_after_actions != NULL )
- {
- ListNode *p;
- for (p = class_after_actions->next; p!=NULL; p=p->next)
- {
- UserAction *ua = (UserAction *)p->elem;
- dumpAction( ua->action, Parser_h, 0, ua->file, ua->line, 1);
- }
- }
- DumpRemainingTokSets();
- fprintf(Parser_h, "};\n");
- fprintf(Parser_h, "\n#endif /* %s_h */\n", CurrentClassName);
- fclose( Parser_h );
- fclose( Parser_c );
- }
- }
-
- MR_orphanRules(stderr);
- if (LTinTokenAction && WarningLevel >= 2) {
- if (GenCC) {
- warnNoFL("At least one <<action>> following a token match contains a reference to LT(...)\n this will reference the immediately preceding token,\n not the one which follows as is the case with semantic predicates.");
- }
- warnNoFL("At least one <<action>> following a token match contains a reference to LA(...) or LATEXT(...)\n this will reference the immediately preceding token,\n not the one which follows as is the case with semantic predicates.");
- }
-
- if ( PrintOut )
- {
- if ( SynDiag == NULL ) {warnNoFL("no grammar description recognized");}
- else PRINT(SynDiag);
- }
-
-#ifdef DBG_LL1
-#endif
- GenRemapFile(); /* create remap.h */
-/* MR10 */ if (FoundGuessBlk) {
-#ifdef __cplusplus__
-/* MR10 */ list_apply(NumericPredLabels, (void (*)(void *))report_numericPredLabels);
-#else
-#ifdef __USE_PROTOS
-/* MR10 */ list_apply(NumericPredLabels, (void (*)(void *))report_numericPredLabels);
-#else
-/* MR10 */ list_apply(NumericPredLabels,report_numericPredLabels);
-#endif
-#endif
-/* MR10 */ };
-
- if (InfoT && TnodesAllocated > 0) {
- if (TnodesPeak > 10000) {
- fprintf(stdout,"\nTree Nodes: peak %dk created %dk lost %d\n",
- (TnodesPeak/1000),
- (TnodesAllocated/1000),
- TnodesInUse-tnodes_used_in_guard_predicates_etc);
- } else {
- fprintf(stdout,"\nTree Nodes: peak %d created %d lost %d\n",
- TnodesPeak,
- TnodesAllocated,
- TnodesInUse-tnodes_used_in_guard_predicates_etc);
- };
- };
- if (InfoF) {
- DumpFcache();
- };
- if (MR_skipped_e3_report) {
- fprintf(stderr,"note: use -e3 to get exact information on ambiguous tuples\n");
- };
- if (MR_BadExprSets != 0) {
- fprintf(stderr,"note: Unreachable C or C++ code was generated for empty expression sets,\n");
- fprintf(stderr," probably due to undefined rules or infinite left recursion.\n");
- fprintf(stderr," To locate: search the generated code for \"empty set expression\"\n");
- };
- if (MR_AmbAidRule != NULL && MR_matched_AmbAidRule==0) {
- RuleEntry *q = (RuleEntry *) hash_get(Rname,MR_AmbAidRule);
- if (MR_AmbAidLine == 0 && q == NULL) {
- warnNoFL(eMsg2("there is no rule \"%s\" so \"-aa %s\" will never match",
- MR_AmbAidRule,MR_AmbAidRule));
- } else {
- warnNoFL(eMsg1("there was no ambiguity that matched \"-aa %s\"",MR_AmbAidRule));
- };
- };
- if (AlphaBetaTrace) {
-
- if (MR_AlphaBetaMessageCount == 0) {
- fprintf(stderr,"note: there were no messages about \"(alpha)? beta\" blocks added to the generated code\n");
- } else {
- fprintf(stderr,"note: there were %d messages about \"(alpha)? beta\" blocks added to the generated code\n",
- MR_AlphaBetaMessageCount);
- }
-
- if (set_null(MR_CompromisedRules)) {
- fprintf(stderr,"note: the list of rules with compromised follow sets is empty\n");
- } else {
- fprintf(stderr,"note: the following is a list of rules which *may* have incorrect\n");
- fprintf(stderr," follow sets computed as a result of an \"(alpha)? beta\" block\n");
- fprintf(stderr,"\n");
- MR_dumpRuleSet(MR_CompromisedRules);
- fprintf(stderr,"\n");
- }
- }
- cleanUp();
- exit(PCCTS_EXIT_SUCCESS);
- return 0; /* MR11 make compilers happy */
-}
-
-static void
-#ifdef __USE_PROTOS
-init( void )
-#else
-init( )
-#endif
-{
- SignalEntry *q;
-
- Tname = newHashTable();
- Rname = newHashTable();
- Fcache = newHashTable();
- Tcache = newHashTable();
- Sname = newHashTable();
- Pname = newHashTable(); /* MR11 */
-
- /* Add default signal names */
- q = (SignalEntry *)hash_add(Sname,
- "NoViableAlt",
- (Entry *)newSignalEntry("NoViableAlt"));
- require(q!=NULL, "cannot alloc signal entry");
- q->signum = sigNoViableAlt;
- q = (SignalEntry *)hash_add(Sname,
- "MismatchedToken",
- (Entry *)newSignalEntry("MismatchedToken"));
- require(q!=NULL, "cannot alloc signal entry");
- q->signum = sigMismatchedToken;
- q = (SignalEntry *)hash_add(Sname,
- "NoSemViableAlt",
- (Entry *)newSignalEntry("NoSemViableAlt"));
- require(q!=NULL, "cannot alloc signal entry");
- q->signum = sigNoSemViableAlt;
-
- reserved_positions = empty;
- all_tokens = empty;
- imag_tokens = empty;
- tokclasses = empty;
- TokenStr = (char **) calloc(TSChunk, sizeof(char *));
- require(TokenStr!=NULL, "main: cannot allocate TokenStr");
- FoStack = (int **) calloc(CLL_k+1, sizeof(int *));
- require(FoStack!=NULL, "main: cannot allocate FoStack");
- FoTOS = (int **) calloc(CLL_k+1, sizeof(int *));
- require(FoTOS!=NULL, "main: cannot allocate FoTOS");
- Cycles = (ListNode **) calloc(CLL_k+1, sizeof(ListNode *));
- require(Cycles!=NULL, "main: cannot allocate Cycles List");
- MR_CompromisedRules=empty; /* MR14 */
-}
-
-static void
-#ifdef __USE_PROTOS
-help( void )
-#else
-help( )
-#endif
-{
- Opt *p = options;
- fprintf(stderr, "antlr [options] f1 f2 ... fn\n");
- while ( *(p->option) != '*' )
- {
- fprintf(stderr, " %-9s%s %s\n",
- p->option,
- (p->arg)?"___":" ",
- p->descr);
- p++;
- }
-}
-
-/* The RulePtr array is filled in here. RulePtr exists primarily
- * so that sets of rules can be maintained for the FOLLOW caching
- * mechanism found in rJunc(). RulePtr maps a rule num from 1 to n
- * to a pointer to its RuleBlk junction where n is the number of rules.
- */
-static void
-#ifdef __USE_PROTOS
-buildRulePtr( void )
-#else
-buildRulePtr( )
-#endif
-{
- int r=1;
- Junction *p = SynDiag;
- RulePtr = (Junction **) calloc(NumRules+1, sizeof(Junction *));
- require(RulePtr!=NULL, "cannot allocate RulePtr array");
-
- while ( p!=NULL )
- {
- require(r<=NumRules, "too many rules???");
- RulePtr[r++] = p;
- p = (Junction *)p->p2;
- }
-}
-
-void
-#ifdef __USE_PROTOS
-dlgerror(const char *s)
-#else
-dlgerror(s)
-char *s;
-#endif
-{
- fprintf(stderr, ErrHdr, FileStr[CurFile], zzline);
- fprintf(stderr, " lexical error: %s (text was '%s')\n",
- ((s == NULL) ? "Lexical error" : s), zzlextext);
-}
-
-void
-#ifdef __USE_PROTOS
-readDescr( void )
-#else
-readDescr( )
-#endif
-{
- zzerr = dlgerror;
- input = NextFile();
- if ( input==NULL ) fatal("No grammar description found (exiting...)");
- ANTLR(grammar(), input);
- tnodes_used_in_guard_predicates_etc=TnodesInUse; /* MR10 */
-}
-
-FILE *
-#ifdef __USE_PROTOS
-NextFile( void )
-#else
-NextFile( )
-#endif
-{
- FILE *f;
-
- for (;;)
- {
- CurFile++;
- if ( CurFile >= NumFiles ) return(NULL);
- if ( ci_strequ(FileStr[CurFile],"stdin")) return stdin;
- f = fopen(FileStr[CurFile], "r");
- if ( f == NULL )
- {
- warnNoFL( eMsg1("file %s doesn't exist; ignored", FileStr[CurFile]) );
- }
- else
- {
- return(f);
- }
- }
-}
-
-/*
- * Return a string corresponding to the output file name associated
- * with the input file name passed in.
- *
- * Observe the following rules:
- *
- * f.e --> f".c"
- * f --> f".c"
- * f. --> f".c"
- * f.e.g --> f.e".c"
- *
- * Where f,e,g are arbitrarily long sequences of characters in a file
- * name.
- *
- * In other words, if a ".x" appears on the end of a file name, make it
- * ".c". If no ".x" appears, append ".c" to the end of the file name.
- *
- * C++ mode using .cpp not .c.
- *
- * Use malloc() for new string.
- */
-
-char *
-#ifdef __USE_PROTOS
-outname( char *fs )
-#else
-outname( fs )
-char *fs;
-#endif
-{
- if ( GenCC) {
- return outnameX(fs,CPP_FILE_SUFFIX);
- } else {
- return outnameX(fs,".c");
- };
-}
-
-char *
-#ifdef __USE_PROTOS
-outnameX( char *fs ,char *suffix)
-#else
-outnameX( fs , suffix )
-char *fs;
-char *suffix;
-#endif
-{
- static char buf[MaxFileName+1];
- char *p;
- require(fs!=NULL&&*fs!='\0', "outname: NULL filename");
-
- p = buf;
- strcpy(buf, fs);
- while ( *p != '\0' ) {p++;} /* Stop on '\0' */
- while ( *p != '.' && p != buf ) {--p;} /* Find '.' */
- if ( p != buf ) *p = '\0'; /* Found '.' */
- require(strlen(buf) + 2 < (size_t)MaxFileName, "outname: filename too big");
- strcat(buf,suffix);
- return( buf );
-}
-
-void
-#ifdef __USE_PROTOS
-fatalFL( char *err_, char *f, int l )
-#else
-fatalFL( err_, f, l )
-char *err_;
-char *f;
-int l;
-#endif
-{
- fprintf(stderr, ErrHdr, f, l);
- fprintf(stderr, " %s\n", err_);
- cleanUp();
- exit(PCCTS_EXIT_FAILURE);
-}
-
-void
-#ifdef __USE_PROTOS
-fatal_intern( char *err_, char *f, int l )
-#else
-fatal_intern( err_, f, l )
-char *err_;
-char *f;
-int l;
-#endif
-{
- fprintf(stderr, ErrHdr, f, l);
- fprintf(stderr, " #$%%*&@# internal error: %s\n", err_);
- fprintf(stderr, ErrHdr, f, l);
- fprintf(stderr, " [complain to nearest government official\n");
- fprintf(stderr, ErrHdr, f, l);
- fprintf(stderr, " or send hate-mail to parrt@parr-research.com;\n");
- fprintf(stderr, ErrHdr, f, l);
- fprintf(stderr, " please pray to the ``bug'' gods that there is a trival fix.]\n");
- cleanUp();
- exit(PCCTS_EXIT_FAILURE);
-}
-
-void
-#ifdef __USE_PROTOS
-cleanUp( void )
-#else
-cleanUp( )
-#endif
-{
- if ( DefFile != NULL) fclose( DefFile );
-}
-
-/* sprintf up to 3 strings */
-char *
-#ifdef __USE_PROTOS
-eMsg3( char *s, char *a1, char *a2, char *a3 )
-#else
-eMsg3( s, a1, a2, a3 )
-char *s;
-char *a1;
-char *a2;
-char *a3;
-#endif
-{
- static char buf[250]; /* DANGEROUS as hell !!!!!! */
-
- sprintf(buf, s, a1, a2, a3);
- return( buf );
-}
-
-/* sprintf a decimal */
-char *
-#ifdef __USE_PROTOS
-eMsgd( char *s, int d )
-#else
-eMsgd( s, d )
-char *s;
-int d;
-#endif
-{
- static char buf[250]; /* DANGEROUS as hell !!!!!! */
-
- sprintf(buf, s, d);
- return( buf );
-}
-
-char *
-#ifdef __USE_PROTOS
-eMsgd2( char *s, int d1,int d2)
-#else
-eMsgd2( s, d1, d2 )
-char *s;
-int d1;
-int d2;
-#endif
-{
- static char buf[250]; /* DANGEROUS as hell !!!!!! */
-
- sprintf(buf, s, d1, d2);
- return( buf );
-}
-
-void
-#ifdef __USE_PROTOS
-s_fprT( FILE *f, set e )
-#else
-s_fprT( f, e )
-FILE *f;
-set e;
-#endif
-{
- register unsigned *p;
- unsigned *q;
-
- if ( set_nil(e) ) return;
- if ( (q=p=set_pdq(e)) == NULL ) fatal_internal("Can't alloc space for set_pdq");
- fprintf(f, "{");
- while ( *p != nil )
- {
- fprintf(f, " %s", TerminalString(*p));
- p++;
- }
- fprintf(f, " }");
- free((char *)q);
-}
-
-/* Return the token name or regular expression for a token number. */
-char *
-#ifdef __USE_PROTOS
-TerminalString( int token )
-#else
-TerminalString( token )
-int token;
-#endif
-{
- int j;
- static char imag_name[20];
-
- /* look in all lexclasses for the token */
- if ( TokenString(token) != NULL ) return TokenString(token);
- for (j=0; j<NumLexClasses; j++)
- {
- lexmode(j);
- if ( ExprString(token) != NULL ) return ExprString(token);
- }
-
- if (1) {
- sprintf(imag_name,"UnknownToken#%d",token); /* MR13 */
- return imag_name; /* MR13 */
- }
-
- require(j<NumLexClasses, eMsgd("No label or expr for token %d",token));
- return "invalid";
-}
-
- /* S i m p l e I n t S t a c k */
-
-void
-#ifdef __USE_PROTOS
-pushint( int i )
-#else
-pushint( i )
-int i;
-#endif
-{
- require(isp>0, "pushint: stack overflow");
- istack[--isp] = i;
-}
-
-int
-#ifdef __USE_PROTOS
-popint( void )
-#else
-popint( )
-#endif
-{
- require(isp<MAX_INT_STACK, "popint: stack underflow");
- return istack[isp++];
-}
-
-int
-#ifdef __USE_PROTOS
-istacksize( void )
-#else
-istacksize( )
-#endif
-{
- return MAX_INT_STACK-isp;
-}
-
-void
-#ifdef __USE_PROTOS
-istackreset( void )
-#else
-istackreset( )
-#endif
-{
- isp = MAX_INT_STACK;
-}
-
-int
-#ifdef __USE_PROTOS
-istackempty( void )
-#else
-istackempty( )
-#endif
-{
- return isp==MAX_INT_STACK;
-}
-
-int
-#ifdef __USE_PROTOS
-topint( void )
-#else
-topint( )
-#endif
-{
- require(isp<MAX_INT_STACK, "topint: stack underflow");
- return istack[isp];
-}
-
-void
-#ifdef __USE_PROTOS
-ProcessArgs( int argc, char **argv, Opt *options )
-#else
-ProcessArgs( argc, argv, options )
-int argc;
-char **argv;
-Opt *options;
-#endif
-{
- Opt *p;
- require(argv!=NULL, "ProcessArgs: command line NULL");
-
- while ( argc-- > 0 )
- {
- p = options;
- while ( p->option != NULL )
- {
- if ( strcmp(p->option, "*") == 0 ||
- ci_strequ(p->option, *argv) == 1 )
- {
- if ( p->arg )
- {
-/* MR9 26-Sep-97 Check for argv valid */
- if (argc-- > 0) {
- (*p->process)( *argv, *(argv+1) );
- argv++;
- } else {
-fprintf(stderr,"error: required argument for option %s omitted\n",*argv);
-exit(PCCTS_EXIT_FAILURE);
- };
- }
- else
- (*p->process)( *argv );
- break;
- }
- p++;
- }
- argv++;
- }
-}
-
-static void
-#ifdef __USE_PROTOS
-CompleteContextGuards(void)
-#else
-CompleteContextGuards()
-#endif
-{
- ListNode * p;
- Predicate * pred;
-
- if (ContextGuardPredicateList == NULL) return;
-
- for (p=ContextGuardPredicateList->next; p != NULL; p=p->next) {
- pred=(Predicate *)p->elem;
- recomputeContextGuard(pred);
- }
-}
-
-/* Go back into the syntax diagram and compute all meta tokens; i.e.
- * turn all '.', ranges, token class refs etc... into actual token sets
- */
-static void
-#ifdef __USE_PROTOS
-CompleteTokenSetRefs(void)
-#else
-CompleteTokenSetRefs()
-#endif
-{
- ListNode *p;
-
- if ( MetaTokenNodes==NULL ) return;
- for (p = MetaTokenNodes->next; p!=NULL; p=p->next)
- {
- set a,b;
-
- TokNode *q = (TokNode *)p->elem;
- if ( q->wild_card )
- {
- q->tset = all_tokens;
- }
- else if ( q->tclass!=NULL )
- {
- if ( q->complement ) q->tset = set_dif(all_tokens, q->tclass->tset);
- else q->tset = q->tclass->tset;
- }
- else if ( q->upper_range!=0 )
- {
- /* we have a range on our hands: make a set from q->token .. q->upper_range */
- int i;
- a = empty;
- for (i=q->token; i<=q->upper_range; i++) { set_orel(i, &a); } /* MR13 */
-
-/* MR13 */ if (q->complement) {
-/* MR13 */ q->tset = set_dif(all_tokens, a);
-/* MR13 */ set_free(a);
-/* MR13 */ } else {
-/* MR13 */ q->tset = a;
-/* MR13 */ }
-
- }
-
- /* at this point, it can only be a complemented single token */
- else if ( q->complement )
- {
- a = set_of(q->token);
- b = set_dif(all_tokens, a);
- set_free(a);
- q->tset=b;
- }
- else fatal("invalid meta token");
- }
-}
-
-/* MR10: Jeff Vincent
- MR10: Changed to remove directory information from n only if
- MR10: if OutputDirectory was changed by user (-o option)
-*/
-
-char *
-#ifdef __USE_PROTOS
-OutMetaName(char *n)
-#else
-OutMetaName(n)
-char *n;
-#endif
-{
- static char *dir_sym = DirectorySymbol;
- static char newname[MaxFileName+1];
- char *p;
-
- /* If OutputDirectory is same as TopDirectory (platform default) then leave n alone. */
- if (strcmp(OutputDirectory, TopDirectory) == 0) /* TopDirectory is "." on Unix. */
- return n;
-
- /* p will point to filename without path information */
- if ((p = strrchr(n, *dir_sym)) != NULL) /* Directory symbol is "/" on Unix. */
- p++;
- else
- p = n;
-
- /* Copy new output directory into newname[] */
- strcpy(newname, OutputDirectory);
-
- /* if new output directory does not have trailing dir_sym, add it! */
- if (newname[strlen(newname)-1] != *dir_sym) {
- strcat(newname, dir_sym);
- }
- strcat(newname, p);
- return newname;
-}
-
-char *
-#ifdef __USE_PROTOS
-pcctsBaseName(char *n) /* MR32 */
-#else
-pcctsBaseName(n)
-char *n;
-#endif
-{
- static char newname[MaxFileName+1];
- static char* dir_sym = DirectorySymbol;
- int count = 0;
- char *p;
-
- p = n;
-
- while ( *p != '\0' ) {p++;} /* go to end of string */
- while ( (*p != *dir_sym) && (p != n) ) {--p;} /* Find last DirectorySymbol */
- while ( *p == *dir_sym) p++; /* step forward if we're on a dir symbol */
- while ( *p != '\0' && *p != '.')
- {
- newname[count++] = *p;
- p++;
- } /* create a new name */
- newname[count] = '\0';
- return newname;
-}
-
-static void
-#ifdef __USE_PROTOS
-ensure_no_C_file_collisions(char *class_c_file)
-#else
-ensure_no_C_file_collisions(class_c_file)
-char *class_c_file;
-#endif
-{
- int i;
-
- for (i=0; i<NumFiles; i++)
- {
-
-#ifdef PCCTS_CASE_INSENSITIVE_FILE_NAME
- /* assume that file names are case insensitive */
- if ( STRICMP(outname(FileStr[i]), class_c_file)==0 )
-#else
- if ( strcmp(outname(FileStr[i]), class_c_file)==0 )
-#endif
- {
- fatal(eMsg1("class def output file conflicts with parser output file: %s",
- outname(FileStr[i])));
- }
- }
-}
-
-void
-#ifdef __USE_PROTOS
-warnNoFL(char *err)
-#else
-warnNoFL(err)
-char *err;
-#endif
-{
- fprintf(stderr, "warning: %s\n", err);
-}
-
-void
-#ifdef __USE_PROTOS
-warnFL(char *err,char *f,int l)
-#else
-warnFL(err,f,l)
-char *f;
-int l;
-char *err;
-#endif
-{
- fprintf(stderr, ErrHdr, f, l);
- fprintf(stderr, " warning: %s\n", err);
-}
-
-void
-#ifdef __USE_PROTOS
-warn(char *err)
-#else
-warn(err)
-char *err;
-#endif
-{
- /* back up the file number if we hit an error at the end of the last file */
- if ( CurFile >= NumFiles && CurFile >= 1 ) CurFile--;
- fprintf(stderr, ErrHdr, FileStr[CurFile], zzline);
- fprintf(stderr, " warning: %s\n", err);
-}
-
-void
-#ifdef __USE_PROTOS
-warnNoCR( char *err )
-#else
-warnNoCR( err )
-char *err;
-#endif
-{
- /* back up the file number if we hit an error at the end of the last file */
- if ( CurFile >= NumFiles && CurFile >= 1 ) CurFile--;
- fprintf(stderr, ErrHdr, FileStr[CurFile], zzline);
- fprintf(stderr, " warning: %s", err);
-}
-
-void
-#ifdef __USE_PROTOS
-errNoFL(char *err)
-#else
-errNoFL(err)
-char *err;
-#endif
-{
- fprintf(stderr, "error: %s\n", err);
-}
-
-void
-#ifdef __USE_PROTOS
-errFL(char *err,char *f,int l)
-#else
-errFL(err,f,l)
-char *err;
-char *f;
-int l;
-#endif
-{
- fprintf(stderr, ErrHdr, f, l);
- fprintf(stderr, " error: %s\n", err);
-}
-
-void
-#ifdef __USE_PROTOS
-err(char *err)
-#else
-err(err)
-char *err;
-#endif
-{
- /* back up the file number if we hit an error at the end of the last file */
- if ( CurFile >= NumFiles && CurFile >= 1 ) CurFile--;
- fprintf(stderr, ErrHdr, FileStr[CurFile], zzline);
- fprintf(stderr, " error: %s\n", err);
-}
-
-void
-#ifdef __USE_PROTOS
-errNoCR( char *err )
-#else
-errNoCR( err )
-char *err;
-#endif
-{
- /* back up the file number if we hit an error at the end of the last file */
- if ( CurFile >= NumFiles && CurFile >= 1 ) CurFile--;
- fprintf(stderr, ErrHdr, FileStr[CurFile], zzline);
- fprintf(stderr, " error: %s", err);
-}
-
-UserAction *
-#ifdef __USE_PROTOS
-newUserAction(char *s)
-#else
-newUserAction(s)
-char *s;
-#endif
-{
- UserAction *ua = (UserAction *) calloc(1, sizeof(UserAction));
- require(ua!=NULL, "cannot allocate UserAction");
-
- ua->action = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
- strcpy(ua->action, s);
- return ua;
-}
-
-/* Added by TJP September 1994 */
-/* Take in file.h and return file_h; names w/o '.'s are left alone */
-char *
-#ifdef __USE_PROTOS
-gate_symbol(char *name)
-#else
-gate_symbol(name)
-char *name;
-#endif
-{
- static char buf[100];
- char *p;
- sprintf(buf, "%s", name);
-
- for (p=buf; *p!='\0'; p++)
- {
- if ( *p=='.' ) *p = '_';
- }
- return buf;
-}
-
-char *
-#ifdef __USE_PROTOS
-makeAltID(int blockid, int altnum)
-#else
-makeAltID(blockid, altnum)
-int blockid;
-int altnum;
-#endif
-{
- static char buf[100];
- char *p;
- sprintf(buf, "_blk%d_alt%d", blockid, altnum);
- p = (char *)malloc(strlen(buf)+1);
- strcpy(p, buf);
- return p;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
deleted file mode 100644
index 478a3a1ccf..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
+++ /dev/null
@@ -1,218 +0,0 @@
-#
-# Makefile for ANTLR 1.33
-#
-# SOFTWARE RIGHTS
-#
-# We reserve no LEGAL rights to the Purdue Compiler Construction Tool
-# Set (PCCTS) -- PCCTS is in the public domain. An individual or
-# company may do whatever they wish with source code distributed with
-# PCCTS or the code generated by PCCTS, including the incorporation of
-# PCCTS, or its output, into commerical software.
-#
-# We encourage users to develop software with PCCTS. However, we do ask
-# that credit is given to us for developing PCCTS. By "credit",
-# we mean that if you incorporate our source code into one of your
-# programs (commercial product, research project, or otherwise) that you
-# acknowledge this fact somewhere in the documentation, research report,
-# etc... If you like PCCTS and have developed a nice tool with the
-# output, please mention that you developed it using PCCTS. In
-# addition, we ask that this header remain intact in our source code.
-# As long as these guidelines are kept, we expect to continue enhancing
-# this system and expect to make other tools available as they are
-# completed.
-#
-# ANTLR 1.33
-# Terence Parr
-# Parr Research Corporation
-# with Purdue University
-# and AHPCRC, University of Minnesota
-# 1989-1995
-#
-# Ported to Borland C++, IBM C-Set/2 and Microsoft 6.0 by
-# Ed Harfmann
-# Micro Data Base Systems
-# Lafayette, Indiana
-#
-SET=../support/set
-PCCTS_H=../h
-
-##
-## Uncomment the appropriate section to build
-## (both targets and 'make' variable definitions)
-## Note that UNIX is the default
-##
-
-#
-# OS/2 & DOS 16 bit using MSC 6.0
-#
-#CC=cl
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) /AL /Za /W3 -DPC -DUSER_ZZSYN
-#OUT_OBJ = -Fo
-#LIBS=/NOD:LLIBCE LLIBCEP
-#OBJ_EXT = obj
-#
-#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
-# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
-# misc.obj set.obj pred.obj egamn.obj
-# link @<<
-#$** /NOI
-#$@ /STACK:14336
-#
-#$(LIBS: = +^
-#)
-#$(DEF_FILE) $(LFLAGS) ;
-#<<
-# bind $@ c:\os2\doscalls.lib
-# copy *.exe ..\bin
-#
-
-#
-# Borland C++ for DOS
-#
-#CC=bcc
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -ml -ff- -w- -DPC -DUSER_ZZSYN
-#OUT_OBJ = -o
-#LIBS= emu mathl cl
-#OBJ_EXT = obj
-#
-#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
-# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
-# misc.obj set.obj pred.obj egman.obj mrhoist.obj fcache.obj
-# tlink @&&|
-#C0L $**
-#$@ /Tde /c
-#
-#$(LIBS)
-#$(DEF_FILE) $(LFLAGS) ;
-#|
-# copy *.exe ..\bin
-#
-
-#
-# C-Set/2 for OS/2
-#
-#CC=icc
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) /Sa /W3 -DUSER_ZZSYN -D__STDC__
-#OUT_OBJ = -Fo
-#LIBS=
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#OBJ_EXT = obj
-#
-#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
-# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
-# misc.obj set.obj pred.obj egman.obj mrhoist.obj fcache.obj
-# link386 @<<
-#$** /NOI
-#$@ /STACK:32768
-#
-#$(LIBS: = +^
-#)
-#$(DEF_FILE) $(LFLAGS) ;
-#<<
-# copy *.exe ..\bin
-#
-
-#
-# Borland C++ for OS/2
-#
-#CC=bcc
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -w- -v -DUSER_ZZSYN
-#OUT_OBJ = -o
-#LIBS= c2 os2
-#
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#OBJ_EXT = obj
-#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
-# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
-# misc.obj set.obj pred.obj egman.obj mrhoist.obj fcache.obj
-# tlink @&&|
-#c02 $** -c -v
-#antlr.exe
-#
-#C2 os2
-#
-#|
-# copy *.exe ..\bin
-#
-
-# *********** Target list of PC machines ***********
-#
-# Don't worry about the ambiguity messages coming from antlr
-# for making antlr.c etc... [should be 10 of them, I think]
-#
-#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g
-# $(ANTLR) antlr.g
-#
-#antlr.$(OBJ_EXT): antlr.c mode.h tokens.h
-#
-#scan.$(OBJ_EXT): scan.c mode.h tokens.h
-#
-#scan.c mode.h: parser.dlg
-# $(DLG) -C2 parser.dlg scan.c
-#
-#set.$(OBJ_EXT): $(SET)/set.c
-# $(CC) $(CFLAGS) -c $(OUT_OBJ)set.$(OBJ_EXT) $(SET)/set.c
-
-
-
-#
-# UNIX (default)
-#
-CC=gcc
-COPT=-O
-ANTLR=${BIN_DIR}/antlr
-DLG=${BIN_DIR}/dlg
-OBJ_EXT=o
-OUT_OBJ = -o
-CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) -DZZLEXBUFSIZE=65536
-#
-# SGI Users, use this CFLAGS
-#
-#CFLAGS= -O -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -woff 3262
-OBJ=antlr.o scan.o err.o bits.o build.o fset2.o fset.o gen.o \
- globals.o hash.o lex.o main.o misc.o set.o pred.o egman.o mrhoist.o fcache.o
-
-$(BIN_DIR)/antlr : $(OBJ) $(SRC)
- $(CC) $(CFLAGS) -o $(BIN_DIR)/antlr $(OBJ)
-
-# what files does PCCTS generate (both ANTLR and DLG)
-PCCTS_GEN=antlr.c scan.c err.c tokens.h mode.h parser.dlg stdpccts.h remap.h
-
-SRC=antlr.c scan.c err.c bits.c build.c fset2.c fset.c gen.c globals.c \
- hash.c lex.c main.c misc.c $(SET)/set.c pred.c egman.c mrhoist.c fcache.c
-
-#
-# Don't worry about the ambiguity messages coming from antlr
-# for making antlr.c etc... [should be 10 of them, I think]
-#
-#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g
-# $(ANTLR) -gh antlr.g
-
-antlr.o : antlr.c mode.h tokens.h
-
-scan.o : scan.c mode.h tokens.h
-
-#scan.c mode.h: parser.dlg
-# $(DLG) -C2 parser.dlg scan.c
-
-set.o : $(SET)/set.c
- $(CC) $(CFLAGS) -c -o set.o $(SET)/set.c
-
-
-#
-# ****** These next targets are common to UNIX and PC world ********
-#
-
-#clean up all the intermediate files
-clean:
- rm -f $(BIN_DIR)/antlr *.$(OBJ_EXT) core
-
-#remove everything in clean plus the PCCTS files generated
-scrub:
- rm -f $(PCCTS_GEN) *.$(OBJ_EXT) core
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile.cygwin b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile.cygwin
deleted file mode 100644
index 956de0be07..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile.cygwin
+++ /dev/null
@@ -1,219 +0,0 @@
-#
-# Makefile for ANTLR 1.33
-#
-# SOFTWARE RIGHTS
-#
-# We reserve no LEGAL rights to the Purdue Compiler Construction Tool
-# Set (PCCTS) -- PCCTS is in the public domain. An individual or
-# company may do whatever they wish with source code distributed with
-# PCCTS or the code generated by PCCTS, including the incorporation of
-# PCCTS, or its output, into commerical software.
-#
-# We encourage users to develop software with PCCTS. However, we do ask
-# that credit is given to us for developing PCCTS. By "credit",
-# we mean that if you incorporate our source code into one of your
-# programs (commercial product, research project, or otherwise) that you
-# acknowledge this fact somewhere in the documentation, research report,
-# etc... If you like PCCTS and have developed a nice tool with the
-# output, please mention that you developed it using PCCTS. In
-# addition, we ask that this header remain intact in our source code.
-# As long as these guidelines are kept, we expect to continue enhancing
-# this system and expect to make other tools available as they are
-# completed.
-#
-# ANTLR 1.33
-# Terence Parr
-# Parr Research Corporation
-# with Purdue University
-# and AHPCRC, University of Minnesota
-# 1989-1995
-#
-# Ported to Borland C++, IBM C-Set/2 and Microsoft 6.0 by
-# Ed Harfmann
-# Micro Data Base Systems
-# Lafayette, Indiana
-#
-SET=../support/set
-PCCTS_H=../h
-
-##
-## Uncomment the appropriate section to build
-## (both targets and 'make' variable definitions)
-## Note that UNIX is the default
-##
-
-#
-# OS/2 & DOS 16 bit using MSC 6.0
-#
-#CC=cl
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) /AL /Za /W3 -DPC -DUSER_ZZSYN
-#OUT_OBJ = -Fo
-#LIBS=/NOD:LLIBCE LLIBCEP
-#OBJ_EXT = obj
-#
-#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
-# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
-# misc.obj set.obj pred.obj egamn.obj
-# link @<<
-#$** /NOI
-#$@ /STACK:14336
-#
-#$(LIBS: = +^
-#)
-#$(DEF_FILE) $(LFLAGS) ;
-#<<
-# bind $@ c:\os2\doscalls.lib
-# copy *.exe ..\bin
-#
-
-#
-# Borland C++ for DOS
-#
-#CC=bcc
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -ml -ff- -w- -DPC -DUSER_ZZSYN
-#OUT_OBJ = -o
-#LIBS= emu mathl cl
-#OBJ_EXT = obj
-#
-#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
-# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
-# misc.obj set.obj pred.obj egman.obj mrhoist.obj fcache.obj
-# tlink @&&|
-#C0L $**
-#$@ /Tde /c
-#
-#$(LIBS)
-#$(DEF_FILE) $(LFLAGS) ;
-#|
-# copy *.exe ..\bin
-#
-
-#
-# C-Set/2 for OS/2
-#
-#CC=icc
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) /Sa /W3 -DUSER_ZZSYN -D__STDC__
-#OUT_OBJ = -Fo
-#LIBS=
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#OBJ_EXT = obj
-#
-#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
-# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
-# misc.obj set.obj pred.obj egman.obj mrhoist.obj fcache.obj
-# link386 @<<
-#$** /NOI
-#$@ /STACK:32768
-#
-#$(LIBS: = +^
-#)
-#$(DEF_FILE) $(LFLAGS) ;
-#<<
-# copy *.exe ..\bin
-#
-
-#
-# Borland C++ for OS/2
-#
-#CC=bcc
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -w- -v -DUSER_ZZSYN
-#OUT_OBJ = -o
-#LIBS= c2 os2
-#
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#OBJ_EXT = obj
-#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \
-# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \
-# misc.obj set.obj pred.obj egman.obj mrhoist.obj fcache.obj
-# tlink @&&|
-#c02 $** -c -v
-#antlr.exe
-#
-#C2 os2
-#
-#|
-# copy *.exe ..\bin
-#
-
-# *********** Target list of PC machines ***********
-#
-# Don't worry about the ambiguity messages coming from antlr
-# for making antlr.c etc... [should be 10 of them, I think]
-#
-#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g
-# $(ANTLR) antlr.g
-#
-#antlr.$(OBJ_EXT): antlr.c mode.h tokens.h
-#
-#scan.$(OBJ_EXT): scan.c mode.h tokens.h
-#
-#scan.c mode.h: parser.dlg
-# $(DLG) -C2 parser.dlg scan.c
-#
-#set.$(OBJ_EXT): $(SET)/set.c
-# $(CC) $(CFLAGS) -c $(OUT_OBJ)set.$(OBJ_EXT) $(SET)/set.c
-
-
-
-#
-# UNIX (default)
-#
-BIN_DIR=../../../../bin
-CC=gcc
-COPT=-O
-ANTLR=$(BIN_DIR)/antlr.exe
-DLG=${BIN_DIR}/dlg.exe
-OBJ_EXT=o
-OUT_OBJ = -o
-CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) -DZZLEXBUFSIZE=65536
-#
-# SGI Users, use this CFLAGS
-#
-#CFLAGS= -O -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -woff 3262
-OBJ=antlr.o scan.o err.o bits.o build.o fset2.o fset.o gen.o \
- globals.o hash.o lex.o main.o misc.o set.o pred.o egman.o mrhoist.o fcache.o
-
-antlr : $(OBJ) $(SRC)
- $(CC) $(CFLAGS) -o $(BIN_DIR)/antlr.exe $(OBJ)
-
-# what files does PCCTS generate (both ANTLR and DLG)
-PCCTS_GEN=antlr.c scan.c err.c tokens.h mode.h parser.dlg stdpccts.h remap.h
-
-SRC=antlr.c scan.c err.c bits.c build.c fset2.c fset.c gen.c globals.c \
- hash.c lex.c main.c misc.c $(SET)/set.c pred.c egman.c mrhoist.c fcache.c
-
-#
-# Don't worry about the ambiguity messages coming from antlr
-# for making antlr.c etc... [should be 10 of them, I think]
-#
-#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g
-# $(ANTLR) -gh antlr.g
-
-antlr.o : antlr.c mode.h tokens.h
-
-scan.o : scan.c mode.h tokens.h
-
-#scan.c mode.h: parser.dlg
-# $(DLG) -C2 parser.dlg scan.c
-
-set.o : $(SET)/set.c
- $(CC) $(CFLAGS) -c -o set.o $(SET)/set.c
-
-
-#
-# ****** These next targets are common to UNIX and PC world ********
-#
-
-#clean up all the intermediate files
-clean:
- rm -f *.$(OBJ_EXT) core
-
-#remove everything in clean plus the PCCTS files generated
-scrub:
- rm -f $(PCCTS_GEN) *.$(OBJ_EXT) core
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile1 b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile1
deleted file mode 100644
index dffc709478..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile1
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# Makefile for ANTLR 1.33
-#
-# SOFTWARE RIGHTS
-#
-# We reserve no LEGAL rights to the Purdue Compiler Construction Tool
-# Set (PCCTS) -- PCCTS is in the public domain. An individual or
-# company may do whatever they wish with source code distributed with
-# PCCTS or the code generated by PCCTS, including the incorporation of
-# PCCTS, or its output, into commerical software.
-#
-# We encourage users to develop software with PCCTS. However, we do ask
-# that credit is given to us for developing PCCTS. By "credit",
-# we mean that if you incorporate our source code into one of your
-# programs (commercial product, research project, or otherwise) that you
-# acknowledge this fact somewhere in the documentation, research report,
-# etc... If you like PCCTS and have developed a nice tool with the
-# output, please mention that you developed it using PCCTS. In
-# addition, we ask that this header remain intact in our source code.
-# As long as these guidelines are kept, we expect to continue enhancing
-# this system and expect to make other tools available as they are
-# completed.
-#
-# ANTLR 1.33
-# Terence Parr
-# Parr Research Corporation
-# with Purdue University
-# and AHPCRC, University of Minnesota
-# 1989-1995
-#
-# Ported to Borland C++, IBM C-Set/2 and Microsoft 6.0 by
-# Ed Harfmann
-# Micro Data Base Systems
-# Lafayette, Indiana
-#
-SET=../support/set
-PCCTS_H=../h
-
-#
-# UNIX (default)
-#
-CC=cc
-ANTLR=${WORKSPACE}/Tools/bin/antlr
-DLG=${WORKSPACE}/Tools/bin/dlg
-OBJ_EXT=o
-OUT_OBJ = -o
-ANSI=-ansi
-AOTHER=
-CFLAGS= -O0 -g -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) $(ANSI) -DZZLEXBUFSIZE=32000
-#
-# SGI Users, use this CFLAGS
-#
-#CFLAGS= -O -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -woff 3262
-
-OBJ=antlr.o scan.o err.o bits.o build.o fset2.o fset.o gen.o \
- globals.o hash.o lex.o main.o misc.o set.o pred.o egman.o mrhoist.o fcache.o $(OBJOTHER)
-
-antlr : $(OBJ) $(SRC)
- $(CC) $(CFLAGS) -o antlr $(OBJ)
- mv antlr ${WORKSPACE}/Tools/bin
-
-# what files does PCCTS generate (both ANTLR and DLG)
-PCCTS_GEN=antlr.c scan.c err.c tokens.h mode.h parser.dlg stdpccts.h remap.h
-
-SRC=antlr.c scan.c err.c bits.c build.c fset2.c fset.c gen.c globals.c \
- hash.c lex.c main.c misc.c $(SET)/set.c pred.c egman.c mrhoist.c fcache.c
-
-#
-# Don't worry about the ambiguity messages coming from antlr
-# for making antlr.c etc... [should be 10 of them, I think]
-#
-antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g
- $(ANTLR) -gh antlr.g $(AOTHER)
-
-antlr.o : antlr.c mode.h tokens.h
-
-scan.o : scan.c mode.h tokens.h
-
-scan.c mode.h: parser.dlg
- $(DLG) -C2 parser.dlg scan.c
-
-set.o : $(SET)/set.c
- $(CC) $(CFLAGS) -c -o set.o $(SET)/set.c
-
-
-#
-# ****** These next targets are common to UNIX and PC world ********
-#
-
-#clean up all the intermediate files
-clean:
- rm -f *.$(OBJ_EXT) core
-
-#remove everything in clean plus the PCCTS files generated
-scrub:
- rm -f $(PCCTS_GEN) *.$(OBJ_EXT) core
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/misc.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/misc.c
deleted file mode 100644
index 3f58da34c5..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/misc.c
+++ /dev/null
@@ -1,1864 +0,0 @@
-/*
- * misc.c
- *
- * Manage tokens, regular expressions.
- * Print methods for debugging
- * Compute follow lists onto tail ends of rules.
- *
- * The following functions are visible:
- *
- * int addTname(char *); Add token name
- * int addTexpr(char *); Add token expression
- * int Tnum(char *); Get number of expr/token
- * void Tklink(char *, char *); Link a name with an expression
- * int hasAction(expr); Does expr already have action assigned?
- * void setHasAction(expr); Indicate that expr now has an action
- * Entry *newEntry(char *,int); Create new table entry with certain size
- * void list_add(ListNode **list, char *e)
- * void list_free(ListNode **list, int freeData); *** MR10 ***
- * void list_apply(ListNode *list, void (*f)())
- * void lexclass(char *m); switch to new/old lexical class
- * void lexmode(int i); switch to old lexical class i
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include "pcctscfg.h"
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#include "dlgdef.h"
-#include <ctype.h>
-
-static int tsize=TSChunk; /* size of token str arrays */
-
-static void
-#ifdef __USE_PROTOS
-RemapForcedTokensInSyntaxDiagram(Node *);
-#else
-RemapForcedTokensInSyntaxDiagram();
-#endif
-
- /* T o k e n M a n i p u l a t i o n */
-
-/*
- * add token 't' to the TokenStr/Expr array. Make more room if necessary.
- * 't' is either an expression or a token name.
- *
- * There is only one TokenStr array, but multiple ExprStr's. Therefore,
- * for each lex class (element of lclass) we must extend the ExprStr array.
- * ExprStr's and TokenStr are always all the same size.
- *
- * Also, there is a Texpr hash table for each automaton.
- */
-static void
-#ifdef __USE_PROTOS
-Ttrack( char *t )
-#else
-Ttrack( t )
-char *t;
-#endif
-{
- if ( TokenNum >= tsize ) /* terminal table overflow? */
- {
- char **p;
- int i, more, j;
-
- more = TSChunk * (1 + ((TokenNum-tsize) / TSChunk));
- tsize += more;
- TokenStr = (char **) realloc((char *)TokenStr, tsize*sizeof(char *));
- require(TokenStr != NULL, "Ttrack: can't extend TokenStr");
- for (i=0; i<NumLexClasses; i++)
- {
- lclass[i].exprs = (char **)
- realloc((char *)lclass[i].exprs, tsize*sizeof(char *));
- require(lclass[i].exprs != NULL, "Ttrack: can't extend ExprStr");
- for (p= &lclass[i].exprs[tsize-more],j=1; j<=more; j++) *p++ = NULL;
- }
- for (p= &TokenStr[tsize-more],i=1; i<=more; i++) *p++ = NULL;
- lexmode( CurrentLexClass ); /* reset ExprStr in case table moved */
- }
- /* note: we use the actual ExprStr/TokenStr array
- * here as TokenInd doesn't exist yet
- */
- if ( *t == '"' ) ExprStr[TokenNum] = t;
- else TokenStr[TokenNum] = t;
-}
-
-static Expr *
-#ifdef __USE_PROTOS
-newExpr( char *e )
-#else
-newExpr( e )
-char *e;
-#endif
-{
- Expr *p = (Expr *) calloc(1, sizeof(Expr));
- require(p!=NULL, "newExpr: cannot alloc Expr node");
-
- p->expr = e;
- p->lclass = CurrentLexClass;
- return p;
-}
-
-/* switch to lexical class/mode m. This amounts to creating a new
- * lex mode if one does not already exist and making ExprStr point
- * to the correct char string array. We must also switch Texpr tables.
- *
- * BTW, we need multiple ExprStr arrays because more than one automaton
- * may have the same label for a token, but with different expressions.
- * We need to track an expr for each automaton. If we disallowed this
- * feature, only one ExprStr would be required.
- */
-void
-#ifdef __USE_PROTOS
-lexclass( char *m )
-#else
-lexclass( m )
-char *m;
-#endif
-{
- int i;
- TermEntry *p;
- static char EOFSTR[] = "\"@\"";
-
- if ( hash_get(Tname, m) != NULL )
- {
- warn(eMsg1("lexclass name conflicts with token/errclass label '%s'",m));
- }
- /* does m already exist? */
- i = LexClassIndex(m);
- if ( i != -1 ) {lexmode(i); return;}
- /* must make new one */
- NumLexClasses++;
- CurrentLexClass = NumLexClasses-1;
- require(NumLexClasses<=MaxLexClasses, "number of allowable lexclasses exceeded\nIncrease MaxLexClasses in generic.h and recompile all C files");
- lclass[CurrentLexClass].classnum = m;
- lclass[CurrentLexClass].exprs = (char **) calloc(tsize, sizeof(char *));
- require(lclass[CurrentLexClass].exprs!=NULL,
- "lexclass: cannot allocate ExprStr");
- lclass[CurrentLexClass].htable = newHashTable();
- ExprStr = lclass[CurrentLexClass].exprs;
- Texpr = lclass[CurrentLexClass].htable;
- /* define EOF for each automaton */
- p = newTermEntry( EOFSTR );
- p->token = EofToken; /* couldn't have remapped tokens yet, use EofToken */
- hash_add(Texpr, EOFSTR, (Entry *)p);
- list_add(&ExprOrder, (void *)newExpr(EOFSTR));
- /* note: we use the actual ExprStr array
- * here as TokenInd doesn't exist yet
- */
- ExprStr[EofToken] = EOFSTR;
-}
-
-void
-#ifdef __USE_PROTOS
-lexmode( int i )
-#else
-lexmode( i )
-int i;
-#endif
-{
- require(i<NumLexClasses, "lexmode: invalid mode");
- ExprStr = lclass[i].exprs;
- Texpr = lclass[i].htable;
- CurrentLexClass = i;
-}
-
-/* return index into lclass array of lexical class. return -1 if nonexistent */
-int
-#ifdef __USE_PROTOS
-LexClassIndex( char *cl )
-#else
-LexClassIndex( cl )
-char *cl;
-#endif
-{
- int i;
-
- for (i=0; i<NumLexClasses; i++)
- {
- if ( strcmp(lclass[i].classnum, cl) == 0 ) return i;
- }
- return -1;
-}
-
-int
-#ifdef __USE_PROTOS
-hasAction( char *expr )
-#else
-hasAction( expr )
-char *expr;
-#endif
-{
- TermEntry *p;
- require(expr!=NULL, "hasAction: invalid expr");
-
- p = (TermEntry *) hash_get(Texpr, expr);
- require(p!=NULL, eMsg1("hasAction: expr '%s' doesn't exist",expr));
- return (p->action!=NULL);
-}
-
-void
-#ifdef __USE_PROTOS
-setHasAction( char *expr, char *action )
-#else
-setHasAction( expr, action )
-char *expr;
-char *action;
-#endif
-{
- TermEntry *p;
- require(expr!=NULL, "setHasAction: invalid expr");
-
- p = (TermEntry *) hash_get(Texpr, expr);
- require(p!=NULL, eMsg1("setHasAction: expr '%s' doesn't exist",expr));
- p->action = action;
-}
-
-ForcedToken *
-#ifdef __USE_PROTOS
-newForcedToken(char *token, int tnum)
-#else
-newForcedToken(token, tnum)
-char *token;
-int tnum;
-#endif
-{
- ForcedToken *ft = (ForcedToken *) calloc(1, sizeof(ForcedToken));
- require(ft!=NULL, "out of memory");
- ft->token = token;
- ft->tnum = tnum;
- return ft;
-}
-
-/*
- * Make a token indirection array that remaps token numbers and then walk
- * the appropriate symbol tables and SynDiag to change token numbers
- */
-void
-#ifdef __USE_PROTOS
-RemapForcedTokens(void)
-#else
-RemapForcedTokens()
-#endif
-{
- ListNode *p;
- ForcedToken *q;
- int max_token_number=0; /* MR9 23-Sep-97 Removed "unsigned" */
- int i;
-
- if ( ForcedTokens == NULL ) return;
-
- /* find max token num */
- for (p = ForcedTokens->next; p!=NULL; p=p->next)
- {
- q = (ForcedToken *) p->elem;
- if ( q->tnum > max_token_number ) max_token_number = q->tnum;
- }
- fprintf(stderr, "max token number is %d\n", max_token_number);
-
- /* make token indirection array */
- TokenInd = (int *) calloc(max_token_number+1, sizeof(int));
- LastTokenCounted = TokenNum;
- TokenNum = max_token_number+1;
- require(TokenInd!=NULL, "RemapForcedTokens: cannot allocate TokenInd");
-
- /* fill token indirection array and change token id htable ; swap token indices */
- for (i=1; i<TokenNum; i++) TokenInd[i] = i;
- for (p = ForcedTokens->next; p!=NULL; p=p->next)
- {
- TermEntry *te;
- int old_pos, t;
-
- q = (ForcedToken *) p->elem;
- fprintf(stderr, "%s forced to %d\n", q->token, q->tnum);
- te = (TermEntry *) hash_get(Tname, q->token);
- require(te!=NULL, "RemapForcedTokens: token not in hash table");
- old_pos = te->token;
- fprintf(stderr, "Before: TokenInd[old_pos==%d] is %d\n", old_pos, TokenInd[old_pos]);
- fprintf(stderr, "Before: TokenInd[target==%d] is %d\n", q->tnum, TokenInd[q->tnum]);
- q = (ForcedToken *) p->elem;
- t = TokenInd[old_pos];
- TokenInd[old_pos] = q->tnum;
- TokenInd[q->tnum] = t;
- te->token = q->tnum; /* update token type id symbol table */
- fprintf(stderr, "After: TokenInd[old_pos==%d] is %d\n", old_pos, TokenInd[old_pos]);
- fprintf(stderr, "After: TokenInd[target==%d] is %d\n", q->tnum, TokenInd[q->tnum]);
-
- /* Change the token number in the sym tab entry for the exprs
- * at the old position of the token id and the target position
- */
- /* update expr at target (if any) of forced token id */
- if ( q->tnum < TokenNum ) /* is it a valid position? */
- {
- for (i=0; i<NumLexClasses; i++)
- {
- if ( lclass[i].exprs[q->tnum]!=NULL )
- {
- /* update the symbol table for this expr */
- TermEntry *e = (TermEntry *) hash_get(lclass[i].htable, lclass[i].exprs[q->tnum]);
- require(e!=NULL, "RemapForcedTokens: expr not in hash table");
- e->token = old_pos;
- fprintf(stderr, "found expr '%s' at target %d in lclass[%d]; changed to %d\n",
- lclass[i].exprs[q->tnum], q->tnum, i, old_pos);
- }
- }
- }
- /* update expr at old position (if any) of forced token id */
- for (i=0; i<NumLexClasses; i++)
- {
- if ( lclass[i].exprs[old_pos]!=NULL )
- {
- /* update the symbol table for this expr */
- TermEntry *e = (TermEntry *) hash_get(lclass[i].htable, lclass[i].exprs[old_pos]);
- require(e!=NULL, "RemapForcedTokens: expr not in hash table");
- e->token = q->tnum;
- fprintf(stderr, "found expr '%s' for id %s in lclass[%d]; changed to %d\n",
- lclass[i].exprs[old_pos], q->token, i, q->tnum);
- }
- }
- }
-
- /* Update SynDiag */
- RemapForcedTokensInSyntaxDiagram((Node *)SynDiag);
-}
-
-static void
-#ifdef __USE_PROTOS
-RemapForcedTokensInSyntaxDiagram(Node *p)
-#else
-RemapForcedTokensInSyntaxDiagram(p)
-Node *p;
-#endif
-{
- Junction *j = (Junction *) p;
- RuleRefNode *r = (RuleRefNode *) p;
- TokNode *t = (TokNode *)p;
-
- if ( p==NULL ) return;
- require(p->ntype>=1 && p->ntype<=NumNodeTypes, "Remap...: invalid diagram node");
- switch ( p->ntype )
- {
- case nJunction :
- if ( j->visited ) return;
- if ( j->jtype == EndRule ) return;
- j->visited = TRUE;
- RemapForcedTokensInSyntaxDiagram( j->p1 );
- RemapForcedTokensInSyntaxDiagram( j->p2 );
- j->visited = FALSE;
- return;
- case nRuleRef :
- RemapForcedTokensInSyntaxDiagram( r->next );
- return;
- case nToken :
- if ( t->remapped ) return; /* we've been here before */
- t->remapped = 1;
- fprintf(stderr, "remapping %d to %d\n", t->token, TokenInd[t->token]);
- t->token = TokenInd[t->token];
- RemapForcedTokensInSyntaxDiagram( t->next );
- return;
- case nAction :
- RemapForcedTokensInSyntaxDiagram( ((ActionNode *)p)->next );
- return;
- default :
- fatal_internal("invalid node type");
- }
-}
-
-/*
- * Add a token name. Return the token number associated with it. If it already
- * exists, then return the token number assigned to it.
- *
- * Track the order in which tokens are found so that the DLG output maintains
- * that order. It also lets us map token numbers to strings.
- */
-int
-#ifdef __USE_PROTOS
-addTname( char *token )
-#else
-addTname( token )
-char *token;
-#endif
-{
- TermEntry *p;
- require(token!=NULL, "addTname: invalid token name");
-
- if ( (p=(TermEntry *)hash_get(Tname, token)) != NULL ) return p->token;
- p = newTermEntry( token );
- Ttrack( p->str );
- p->token = TokenNum++;
- hash_add(Tname, token, (Entry *)p);
- return p->token;
-}
-
-/* This is the same as addTname except we force the TokenNum to be tnum.
- * We don't have to use the Forced token stuff as no tokens will have
- * been defined with #tokens when this is called. This is only called
- * when a #tokdefs meta-op is used.
- */
-int
-#ifdef __USE_PROTOS
-addForcedTname( char *token, int tnum )
-#else
-addForcedTname( token, tnum )
-char *token;
-int tnum;
-#endif
-{
- TermEntry *p;
- require(token!=NULL, "addTname: invalid token name");
-
- if ( (p=(TermEntry *)hash_get(Tname, token)) != NULL ) return p->token;
- p = newTermEntry( token );
- Ttrack( p->str );
- p->token = tnum;
- hash_add(Tname, token, (Entry *)p);
- return p->token;
-}
-
-/*
- * Add a token expr. Return the token number associated with it. If it already
- * exists, then return the token number assigned to it.
- */
-int
-#ifdef __USE_PROTOS
-addTexpr( char *expr )
-#else
-addTexpr( expr )
-char *expr;
-#endif
-{
- TermEntry *p;
- require(expr!=NULL, "addTexpr: invalid regular expression");
-
- if ( (p=(TermEntry *)hash_get(Texpr, expr)) != NULL ) return p->token;
- p = newTermEntry( expr );
- Ttrack( p->str );
- /* track the order in which they occur */
- list_add(&ExprOrder, (void *)newExpr(p->str));
- p->token = TokenNum++;
- hash_add(Texpr, expr, (Entry *)p);
- return p->token;
-}
-
-/* return the token number of 'term'. Return 0 if no 'term' exists */
-int
-#ifdef __USE_PROTOS
-Tnum( char *term )
-#else
-Tnum( term )
-char *term;
-#endif
-{
- TermEntry *p;
- require(term!=NULL, "Tnum: invalid terminal");
-
- if ( *term=='"' ) p = (TermEntry *) hash_get(Texpr, term);
- else p = (TermEntry *) hash_get(Tname, term);
- if ( p == NULL ) return 0;
- else return p->token;
-}
-
-/* associate a Name with an expr. If both have been already assigned
- * token numbers, then an error is reported. Add the token or expr
- * that has not been added if no error. This 'represents' the #token
- * ANTLR pseudo-op. If both have not been defined, define them both
- * linked to same token number.
- */
-void
-#ifdef __USE_PROTOS
-Tklink( char *token, char *expr )
-#else
-Tklink( token, expr )
-char *token;
-char *expr;
-#endif
-{
- TermEntry *p, *q;
- require(token!=NULL && expr!=NULL, "Tklink: invalid token name and/or expr");
-
- p = (TermEntry *) hash_get(Tname, token);
- q = (TermEntry *) hash_get(Texpr, expr);
- if ( p != NULL && q != NULL ) /* both defined */
- {
- warn( eMsg2("token name %s and rexpr %s already defined; ignored",
- token, expr) );
- return;
- }
- if ( p==NULL && q==NULL ) /* both not defined */
- {
- int t = addTname( token );
- q = newTermEntry( expr );
- hash_add(Texpr, expr, (Entry *)q);
- q->token = t;
- /* note: we use the actual ExprStr array
- * here as TokenInd doesn't exist yet
- */
- ExprStr[t] = q->str;
- /* track the order in which they occur */
- list_add(&ExprOrder, (void *)newExpr(q->str));
- return;
- }
- if ( p != NULL ) /* one is defined, one is not */
- {
- q = newTermEntry( expr );
- hash_add(Texpr, expr, (Entry *)q);
- q->token = p->token;
- ExprStr[p->token] = q->str; /* both expr and token str defined now */
- list_add(&ExprOrder, (void *)newExpr(q->str));
- }
- else /* trying to associate name with expr here*/
- {
- p = newTermEntry( token );
- hash_add(Tname, token, (Entry *)p);
- p->token = q->token;
- TokenStr[p->token] = p->str;/* both expr and token str defined now */
- }
-}
-
-/*
- * Given a string, this function allocates and returns a pointer to a
- * hash table record of size 'sz' whose "str" pointer is reset to a position
- * in the string table.
- */
-Entry *
-#ifdef __USE_PROTOS
-newEntry( char *text, int sz )
-#else
-newEntry( text, sz )
-char *text;
-int sz;
-#endif
-{
- Entry *p;
- require(text!=NULL, "new: NULL terminal");
-
- if ( (p = (Entry *) calloc(1,sz)) == 0 )
- {
- fatal_internal("newEntry: out of memory for terminals\n");
- exit(PCCTS_EXIT_FAILURE);
- }
- p->str = mystrdup(text);
-
- return(p);
-}
-
-/*
- * add an element to a list.
- *
- * Any non-empty list has a sentinel node whose 'elem' pointer is really
- * a pointer to the last element. (i.e. length(list) = #elemIn(list)+1).
- * Elements are appended to the list.
- */
-void
-#ifdef __USE_PROTOS
-list_add( ListNode **list, void *e )
-#else
-list_add( list, e )
-ListNode **list;
-void *e;
-#endif
-{
- ListNode *p, *tail;
- require(e!=NULL, "list_add: attempting to add NULL list element");
-
- p = newListNode;
- require(p!=NULL, "list_add: cannot alloc new list node");
- p->elem = e;
- if ( *list == NULL )
- {
- ListNode *sentinel = newListNode;
- require(sentinel!=NULL, "list_add: cannot alloc sentinel node");
- *list=sentinel;
- sentinel->next = p;
- sentinel->elem = (char *)p; /* set tail pointer */
- }
- else /* find end of list */
- {
- tail = (ListNode *) (*list)->elem; /* get tail pointer */
- tail->next = p;
- (*list)->elem = (char *) p; /* reset tail */
- }
-}
-
-/* MR10 list_free() frees the ListNode elements in the list */
-/* MR10 if freeData then free the data elements of the list too */
-
-void
-#ifdef __USE_PROTOS
-list_free(ListNode **list,int freeData)
-#else
-list_free(list,freeData)
- ListNode **list;
- int freeData;
-#endif
-{
- ListNode *p;
- ListNode *next;
-
- if (list == NULL) return;
- if (*list == NULL) return;
- for (p=*list; p != NULL; p=next) {
- next=p->next;
- if (freeData && p->elem != NULL) {
- free( (char *) p->elem);
- };
- free( (char *) p);
- };
- *list=NULL;
-}
-
-void
-#ifdef __USE_PROTOS
-list_apply( ListNode *list, void (*f)(void *) )
-#else
-list_apply( list, f )
-ListNode *list;
-void (*f)();
-#endif
-{
- ListNode *p;
- require(f!=NULL, "list_apply: NULL function to apply");
-
- if ( list == NULL ) return;
- for (p = list->next; p!=NULL; p=p->next) (*f)( p->elem );
-}
-
-/* MR27 */
-
-#ifdef __USE_PROTOS
-int list_search_cstring(ListNode *list, char * cstring)
-#else
-int list_search_cstring(list, cstring)
- ListNode * list;
- char * cstring;
-#endif
-{
- ListNode *p;
- if (list == NULL ) return 0;
- for (p = list->next; p!=NULL; p=p->next) {
- if (p->elem == NULL) continue;
- if (0 == strcmp((char *) p->elem , cstring)) return 1;
- }
- return 0;
-}
-
- /* F O L L O W C y c l e S t u f f */
-
-/* make a key based upon (rulename, computation, k value).
- * Computation values are 'i'==FIRST, 'o'==FOLLOW.
- */
-
-/* MR10 Make the key all characters so it can be read easily */
-/* MR10 by a simple dump program. Also, separates */
-/* MR10 'o' and 'i' from rule name */
-
-char *
-#ifdef __USE_PROTOS
-Fkey( char *rule, int computation, int k )
-#else
-Fkey( rule, computation, k )
-char *rule;
-int computation;
-int k;
-#endif
-{
- static char key[MaxRuleName+2+2+1]; /* MR10 */
- int i;
-
- if ( k > 99 ) /* MR10 */
- fatal("k>99 is too big for this implementation of ANTLR!\n"); /* MR10 */
- if ( (i=strlen(rule)) > MaxRuleName ) /* MR10 */
- fatal( eMsgd("rule name > max of %d\n", MaxRuleName) ); /* MR10 */
- strcpy(key,rule);
-
-/* MR10 */ key[i]='*';
-/* MR10 */ key[i+1] = (char) computation; /* MR20 G. Hobbelt */
-/* MR10 */ if (k < 10) {
-/* MR10 */ key[i+2] = (char) ( '0' + k);
-/* MR10 */ key[i+3] = '\0';
-/* MR10 */ } else {
-/* MR10 */ key[i+2] = (char) ( '0' + k/10);
-/* MR10 */ key[i+3] = (char) ( '0' + k % 10);
-/* MR10 */ key[i+4] = '\0';
-/* MR10 */ };
-
- return key;
-}
-
-/* Push a rule onto the kth FOLLOW stack */
-void
-#ifdef __USE_PROTOS
-FoPush( char *rule, int k )
-#else
-FoPush( rule, k )
-char *rule;
-int k;
-#endif
-{
- RuleEntry *r;
- require(rule!=NULL, "FoPush: tried to push NULL rule");
- require(k<=CLL_k, "FoPush: tried to access non-existent stack");
-
- /*fprintf(stderr, "FoPush(%s)\n", rule);*/
- r = (RuleEntry *) hash_get(Rname, rule);
- if ( r == NULL ) {fatal_internal( eMsg1("rule %s must be defined but isn't", rule) );}
- if ( FoStack[k] == NULL ) /* Does the kth stack exist yet? */
- {
- /*fprintf(stderr, "allocating FoStack\n");*/
- FoStack[k] = (int *) calloc(FoStackSize, sizeof(int));
- require(FoStack[k]!=NULL, "FoPush: cannot allocate FOLLOW stack\n");
- }
- if ( FoTOS[k] == NULL )
- {
- FoTOS[k]=FoStack[k];
- *(FoTOS[k]) = r->rulenum;
- }
- else
- {
-#ifdef MEMCHK
- require(valid(FoStack[k]), "FoPush: invalid FoStack");
-#endif
- if ( FoTOS[k] >= &(FoStack[k][FoStackSize-1]) )
- fatal( eMsgd("exceeded max depth of FOLLOW recursion (%d)\n",
- FoStackSize) );
- require(FoTOS[k]>=FoStack[k],
- eMsg1("FoPush: FoStack stack-ptr is playing out of its sandbox",
- rule));
- ++(FoTOS[k]);
- *(FoTOS[k]) = r->rulenum;
- }
- {
- /*
-**** int *p;
-**** fprintf(stderr, "FoStack[k=%d]:\n", k);
-**** for (p=FoStack[k]; p<=FoTOS[k]; p++)
-**** {
-**** fprintf(stderr, "\t%s\n", RulePtr[*p]->rname);
-**** }
- */
- }
-}
-
-/* Pop one rule off of the FOLLOW stack. TOS ptr is NULL if empty. */
-void
-#ifdef __USE_PROTOS
-FoPop( int k )
-#else
-FoPop( k )
-int k;
-#endif
-{
- require(k<=CLL_k, "FoPop: tried to access non-existent stack");
- /*fprintf(stderr, "FoPop\n");*/
- require(FoTOS[k]>=FoStack[k]&&FoTOS[k]<=&(FoStack[k][FoStackSize-1]),
- "FoPop: FoStack stack-ptr is playing out of its sandbox");
- if ( FoTOS[k] == FoStack[k] ) FoTOS[k] = NULL;
- else (FoTOS[k])--;
-}
-
-/* Compute FOLLOW cycle.
- * Mark all FOLLOW sets for rules in cycle as incomplete.
- * Then, save cycle on the cycle list (Cycles) for later resolution.
- * The Cycle is stored in the form:
- * (head of cycle==croot, rest of rules in cycle==cyclicDep)
- *
- * e.g. (Fo means "FOLLOW of", "-->" means requires or depends on)
- *
- * Fo(x)-->Fo(a)-->Fo(b)-->Fo(c)-->Fo(x)
- * ^----Infinite recursion (cycle)
- *
- * the cycle would be: x -> {a,b,c} or stored as (x,{a,b,c}). Fo(x) depends
- * on the FOLLOW of a,b, and c. The root of a cycle is always complete after
- * Fo(x) finishes. Fo(a,b,c) however are not. It turns out that all rules
- * in a FOLLOW cycle have the same FOLLOW set.
- */
-void
-#ifdef __USE_PROTOS
-RegisterCycle( char *rule, int k )
-#else
-RegisterCycle( rule, k )
-char *rule;
-int k;
-#endif
-{
- CacheEntry *f;
- Cycle *c;
- int *p;
- RuleEntry *r;
- require(rule!=NULL, "RegisterCycle: tried to register NULL rule");
- require(k<=CLL_k, "RegisterCycle: tried to access non-existent stack");
-
- /*fprintf(stderr, "RegisterCycle(%s)\n", rule);*/
- /* Find cycle start */
- r = (RuleEntry *) hash_get(Rname, rule);
- require(r!=NULL,eMsg1("rule %s must be defined but isn't", rule));
- require(FoTOS[k]>=FoStack[k]&&FoTOS[k]<=&(FoStack[k][FoStackSize-1]),
- eMsg1("RegisterCycle(%s): FoStack stack-ptr is playing out of its sandbox",
- rule));
-/*** if ( FoTOS[k]<FoStack[k]||FoTOS[k]>&(FoStack[k][FoStackSize-1]) )
-**** {
-**** fprintf(stderr, "RegisterCycle(%s): FoStack stack-ptr is playing out of its sandbox\n",
-**** rule);
-**** fprintf(stderr, "RegisterCycle: sp==0x%x out of bounds 0x%x...0x%x\n",
-**** FoTOS[k], FoStack[k], &(FoStack[k][FoStackSize-1]));
-**** exit(PCCTS_EXIT_FAILURE);
-**** }
-****/
-
-#ifdef MEMCHK
- require(valid(FoStack[k]), "RegisterCycle: invalid FoStack");
-#endif
- for (p=FoTOS[k]; *p != r->rulenum && p >= FoStack[k]; --p) {;}
- require(p>=FoStack[k], "RegisterCycle: FoStack is screwed up beyond belief");
- if ( p == FoTOS[k] ) return; /* don't worry about cycles to oneself */
-
- /* compute cyclic dependents (rules in cycle except head) */
- c = newCycle;
- require(c!=NULL, "RegisterCycle: couldn't alloc new cycle");
- c->cyclicDep = empty;
- c->croot = *p++; /* record root of cycle */
- for (; p<=FoTOS[k]; p++)
- {
- /* Mark all dependent rules as incomplete */
- f = (CacheEntry *) hash_get(Fcache, Fkey(RulePtr[*p]->rname,'o',k));
- if ( f==NULL )
- {
- f = newCacheEntry( Fkey(RulePtr[*p]->rname,'o',k) );
- hash_add(Fcache, Fkey(RulePtr[*p]->rname,'o',k), (Entry *)f);
- }
- f->incomplete = TRUE;
-
- set_orel(*p, &(c->cyclicDep)); /* mark rule as dependent of croot */
- }
- list_add(&(Cycles[k]), (void *)c);
-}
-
-/* make all rules in cycle complete
- *
- * while ( some set has changed ) do
- * for each cycle do
- * if degree of FOLLOW set for croot > old degree then
- * update all FOLLOW sets for rules in cyclic dependency
- * change = TRUE
- * endif
- * endfor
- * endwhile
- */
-void
-#ifdef __USE_PROTOS
-ResolveFoCycles( int k )
-#else
-ResolveFoCycles( k )
-int k;
-#endif
-{
- ListNode *p, *q;
- Cycle *c;
- int changed = 1;
- CacheEntry *f,*g;
- int r;
-/* int i; */ /* MR10 not useful */
- unsigned d;
-
- unsigned *cursor; /* MR10 */
- unsigned *origin; /* MR10 */
-
- /*fprintf(stderr, "Resolving following cycles for %d\n", k);*/
- while ( changed )
- {
- changed = 0;
-/* MR10 i = 0; */
- for (p = Cycles[k]->next; p!=NULL; p=p->next)
- {
- c = (Cycle *) p->elem;
- /*fprintf(stderr, "cycle %d: %s -->", i++, RulePtr[c->croot]->rname);*/
- /*s_fprT(stderr, c->cyclicDep);*/
- /*fprintf(stderr, "\n");*/
- f = (CacheEntry *)
- hash_get(Fcache, Fkey(RulePtr[c->croot]->rname,'o',k));
- require(f!=NULL, eMsg1("FOLLOW(%s) must be in cache but isn't", RulePtr[c->croot]->rname) );
- if ( (d=set_deg(f->fset)) > c->deg )
- {
- /*fprintf(stderr, "Fo(%s) has changed\n", RulePtr[c->croot]->rname);*/
- changed = 1;
- c->deg = d; /* update cycle FOLLOW set degree */
-
-/* MR10 */ origin=set_pdq(c->cyclicDep);
-/* MR10 */ for (cursor=origin; *cursor != nil; cursor++) {
-/* MR10 */ r=*cursor;
-
-/******** while ( !set_nil(c->cyclicDep) ) { *****/
-/******** r = set_int(c->cyclicDep); *****/
-/******** set_rm(r, c->cyclicDep); *****/
-
- /*fprintf(stderr, "updating Fo(%s)\n", RulePtr[r]->rname);*/
- g = (CacheEntry *)
- hash_get(Fcache, Fkey(RulePtr[r]->rname,'o',k));
- require(g!=NULL, eMsg1("FOLLOW(%s) must be in cache but isn't", RulePtr[r]->rname) );
- set_orin(&(g->fset), f->fset);
- g->incomplete = FALSE;
- }
-/* MR10 */ free( (char *) origin);
-/* MR10 */ origin=NULL;
- }
- }
-/* MR10 - this if statement appears to be meaningless since i is always 0 */
-/* MR10 if ( i == 1 ) changed = 0; */ /* if only 1 cycle, no need to repeat */
- }
- /* kill Cycle list */
- for (q = Cycles[k]->next; q != NULL; q=p)
- {
- p = q->next;
- set_free( ((Cycle *)q->elem)->cyclicDep );
- free((char *)q);
- }
- free( (char *)Cycles[k] );
- Cycles[k] = NULL;
-}
-
-
- /* P r i n t i n g S y n t a x D i a g r a m s */
-
-static void
-#ifdef __USE_PROTOS
-pBlk( Junction *q, int btype )
-#else
-pBlk( q, btype )
-Junction *q;
-int btype;
-#endif
-{
- int k,a;
- Junction *alt, *p;
-
- q->end->pvisited = TRUE;
- if ( btype == aLoopBegin )
- {
- require(q->p2!=NULL, "pBlk: invalid ()* block");
- PRINT(q->p1);
- alt = (Junction *)q->p2;
- PRINT(alt->p1);
- if ( PrintAnnotate )
- {
- printf(" /* Opt ");
- k = 1;
- while ( !set_nil(alt->fset[k]) )
- {
- s_fprT(stdout, alt->fset[k]);
- if ( k++ == CLL_k ) break;
- if ( !set_nil(alt->fset[k]) ) printf(", ");
- }
- printf(" */\n");
- }
- return;
- }
- for (a=1,alt=q; alt != NULL; alt= (Junction *) alt->p2, a++)
- {
- if ( alt->p1 != NULL ) PRINT(alt->p1);
- if ( PrintAnnotate )
- {
- printf( " /* [%d] ", alt->altnum);
- k = 1;
- while ( !set_nil(alt->fset[k]) )
- {
- s_fprT(stdout, alt->fset[k]);
- if ( k++ == CLL_k ) break;
- if ( !set_nil(alt->fset[k]) ) printf(", ");
- }
- if ( alt->p2 == NULL && btype == aOptBlk )
- printf( " (optional branch) */\n");
- else printf( " */\n");
- }
-
- /* ignore implied empty alt of Plus blocks */
- if ( alt->p2 != NULL && ((Junction *)alt->p2)->ignore ) break;
-
- if ( alt->p2 != NULL && !(((Junction *)alt->p2)->p2==NULL && btype == aOptBlk) )
- {
- if ( pLevel == 1 )
- {
- printf("\n");
- if ( a+1==pAlt1 || a+1==pAlt2 ) printf("=>");
- printf("\t");
- }
- else printf(" ");
- printf("|");
- if ( pLevel == 1 )
- {
- p = (Junction *) ((Junction *)alt->p2)->p1;
- while ( p!=NULL )
- {
- if ( p->ntype==nAction )
- {
- p=(Junction *)((ActionNode *)p)->next;
- continue;
- }
- if ( p->ntype!=nJunction )
- {
- break;
- }
- if ( p->jtype==EndBlk || p->jtype==EndRule )
- {
- p = NULL;
- break;
- }
- p = (Junction *)p->p1;
- }
- if ( p==NULL ) printf("\n\t"); /* Empty alt? */
- }
- }
- }
- q->end->pvisited = FALSE;
-}
-
-/* How to print out a junction */
-void
-#ifdef __USE_PROTOS
-pJunc( Junction *q )
-#else
-pJunc( q )
-Junction *q;
-#endif
-{
- int dum_k;
- int doing_rule;
- require(q!=NULL, "pJunc: NULL node");
- require(q->ntype==nJunction, "pJunc: not junction");
-
- if ( q->pvisited == TRUE ) return;
- q->pvisited = TRUE;
- switch ( q->jtype )
- {
- case aSubBlk :
- if ( PrintAnnotate ) First(q, 1, q->jtype, &dum_k);
- if ( q->end->p1 != NULL && ((Junction *)q->end->p1)->ntype==nJunction &&
- ((Junction *)q->end->p1)->jtype == EndRule ) doing_rule = 1;
- else doing_rule = 0;
- pLevel++;
- if ( pLevel==1 )
- {
- if ( pAlt1==1 ) printf("=>");
- printf("\t");
- }
- else printf(" ");
- if ( doing_rule )
- {
- if ( pLevel==1 ) printf(" ");
- pBlk(q,q->jtype);
- }
- else {
- printf("(");
- if ( pLevel==1 ) printf(" ");
- pBlk(q,q->jtype);
- if ( pLevel>1 ) printf(" ");
- printf(")");
- }
- if ( q->guess ) printf("?");
- pLevel--;
- if ( PrintAnnotate ) freeBlkFsets(q);
- if ( q->end->p1 != NULL ) PRINT(q->end->p1);
- break;
- case aOptBlk :
- if ( PrintAnnotate ) First(q, 1, q->jtype, &dum_k);
- pLevel++;
- if ( pLevel==1 )
- {
- if ( pAlt1==1 ) printf("=>");
- printf("\t");
- }
- else printf(" ");
- printf("{");
- if ( pLevel==1 ) printf(" ");
- pBlk(q,q->jtype);
- if ( pLevel>1 ) printf(" ");
- else printf("\n\t");
- printf("}");
- pLevel--;
- if ( PrintAnnotate ) freeBlkFsets(q);
- if ( q->end->p1 != NULL ) PRINT(q->end->p1);
- break;
- case aLoopBegin :
- if ( PrintAnnotate ) First(q, 1, q->jtype, &dum_k);
- pLevel++;
- if ( pLevel==1 )
- {
- if ( pAlt1==1 ) printf("=>");
- printf("\t");
- }
- else printf(" ");
- printf("(");
- if ( pLevel==1 ) printf(" ");
- pBlk(q,q->jtype);
- if ( pLevel>1 ) printf(" ");
- else printf("\n\t");
- printf(")*");
- pLevel--;
- if ( PrintAnnotate ) freeBlkFsets(q);
- if ( q->end->p1 != NULL ) PRINT(q->end->p1);
- break;
- case aLoopBlk :
- if ( PrintAnnotate ) First(q, 1, q->jtype, &dum_k);
- pBlk(q,q->jtype);
- if ( PrintAnnotate ) freeBlkFsets(q);
- break;
- case aPlusBlk :
- if ( PrintAnnotate ) First(q, 1, q->jtype, &dum_k);
- pLevel++;
- if ( pLevel==1 )
- {
- if ( pAlt1==1 ) printf("=>");
- printf("\t");
- }
- else printf(" ");
- printf("(");
- if ( pLevel==1 ) printf(" ");
- pBlk(q,q->jtype);
- if ( pLevel>1 ) printf(" ");
- printf(")+");
- pLevel--;
- if ( PrintAnnotate ) freeBlkFsets(q);
- if ( q->end->p1 != NULL ) PRINT(q->end->p1);
- break;
- case EndBlk :
- break;
- case RuleBlk :
- printf( "\n%s :\n", q->rname);
- PRINT(q->p1);
- if ( q->p2 != NULL ) PRINT(q->p2);
- break;
- case Generic :
- if ( q->p1 != NULL ) PRINT(q->p1);
- q->pvisited = FALSE;
- if ( q->p2 != NULL ) PRINT(q->p2);
- break;
- case EndRule :
- printf( "\n\t;\n");
- break;
- }
- q->pvisited = FALSE;
-}
-
-/* How to print out a rule reference node */
-void
-#ifdef __USE_PROTOS
-pRuleRef( RuleRefNode *p )
-#else
-pRuleRef( p )
-RuleRefNode *p;
-#endif
-{
- require(p!=NULL, "pRuleRef: NULL node");
- require(p->ntype==nRuleRef, "pRuleRef: not rule ref node");
-
- printf( " %s", p->text);
- PRINT(p->next);
-}
-
-/* How to print out a terminal node */
-void
-#ifdef __USE_PROTOS
-pToken( TokNode *p )
-#else
-pToken( p )
-TokNode *p;
-#endif
-{
- require(p!=NULL, "pToken: NULL node");
- require(p->ntype==nToken, "pToken: not token node");
-
- if ( p->wild_card ) printf(" .");
- printf( " %s", TerminalString(p->token));
- PRINT(p->next);
-}
-
-/* How to print out a terminal node */
-void
-#ifdef __USE_PROTOS
-pAction( ActionNode *p )
-#else
-pAction( p )
-ActionNode *p;
-#endif
-{
- require(p!=NULL, "pAction: NULL node");
- require(p->ntype==nAction, "pAction: not action node");
-
- PRINT(p->next);
-}
-
- /* F i l l F o l l o w L i s t s */
-
-/*
- * Search all rules for all rule reference nodes, q to rule, r.
- * Add q->next to follow list dangling off of rule r.
- * i.e.
- *
- * r: -o-R-o-->o--> Ptr to node following rule r in another rule
- * |
- * o--> Ptr to node following another reference to r.
- *
- * This is the data structure employed to avoid FOLLOW set computation. We
- * simply compute the FIRST (reach) of the EndRule Node which follows the
- * list found at the end of all rules which are referenced elsewhere. Rules
- * not invoked by other rules have no follow list (r->end->p1==NULL).
- * Generally, only start symbols are not invoked by another rule.
- *
- * Note that this mechanism also gives a free cross-reference mechanism.
- *
- * The entire syntax diagram is layed out like this:
- *
- * SynDiag
- * |
- * v
- * o-->R1--o
- * |
- * o-->R2--o
- * |
- * ...
- * |
- * o-->Rn--o
- *
- */
-void
-#ifdef __USE_PROTOS
-FoLink( Node *p )
-#else
-FoLink( p )
-Node *p;
-#endif
-{
- RuleEntry *q;
- Junction *j = (Junction *) p;
- RuleRefNode *r = (RuleRefNode *) p;
-
- if ( p==NULL ) return;
- require(p->ntype>=1 && p->ntype<=NumNodeTypes,
- eMsgd("FoLink: invalid diagram node: ntype==%d",p->ntype));
- switch ( p->ntype )
- {
- case nJunction :
- if ( j->fvisited ) return;
- if ( j->jtype == EndRule ) return;
- j->fvisited = TRUE;
- FoLink( j->p1 );
- FoLink( j->p2 );
-/* MR14 */
-/* MR14 */ /* Need to determine whether the guess block is an */
-/* MR14 */ /* of the form (alpha)? beta before follow sets are */
-/* MR14 */ /* computed. This is necessary to solve problem */
-/* MR14 */ /* of doing follow on the alpha of an (alpha)? beta block. */
-/* MR14 */
-/* MR14 */ /* This is performed by analysis_point as a side-effect. */
-/* MR14 */
-/* MR14 */
-/* MR14 */ if (j->jtype == aSubBlk && j->guess) {
-/* MR14 */ Junction *ignore;
-/* MR14 */ ignore=analysis_point(j);
-/* MR14 */ }
-/* MR14 */
- return;
- case nRuleRef :
- if ( r->linked ) return;
- q = (RuleEntry *) hash_get(Rname, r->text);
- if ( q == NULL )
- {
- warnFL( eMsg1("rule %s not defined",r->text), FileStr[r->file], r->line );
- }
- else
- {
- if ( r->parms!=NULL && RulePtr[q->rulenum]->pdecl==NULL )
- {
- warnFL( eMsg1("rule %s accepts no parameter(s)", r->text),
- FileStr[r->file], r->line );
- }
- if ( r->parms==NULL && RulePtr[q->rulenum]->pdecl!=NULL )
- {
- warnFL( eMsg1("rule %s requires parameter(s)", r->text),
- FileStr[r->file], r->line );
- }
- if ( r->assign!=NULL && RulePtr[q->rulenum]->ret==NULL )
- {
- warnFL( eMsg1("rule %s yields no return value(s)", r->text),
- FileStr[r->file], r->line );
- }
- if ( r->assign==NULL && RulePtr[q->rulenum]->ret!=NULL )
- {
- warnFL( eMsg1("rule %s returns a value(s)", r->text),
- FileStr[r->file], r->line );
- }
- if ( !r->linked )
- {
- addFoLink( r->next, r->rname, RulePtr[q->rulenum] );
- r->linked = TRUE;
- }
- }
- FoLink( r->next );
- return;
- case nToken :
- FoLink( ((TokNode *)p)->next );
- return;
- case nAction :
- FoLink( ((ActionNode *)p)->next );
- return;
- default :
- fatal_internal("invalid node type");
- }
-}
-
-/*
- * Add a reference to the end of a rule.
- *
- * 'r' points to the RuleBlk node in a rule. r->end points to the last node
- * (EndRule jtype) in a rule.
- *
- * Initial:
- * r->end --> o
- *
- * After:
- * r->end --> o-->o--> Ptr to node following rule r in another rule
- * |
- * o--> Ptr to node following another reference to r.
- *
- * Note that the links are added to the head of the list so that r->end->p1
- * always points to the most recently added follow-link. At the end, it should
- * point to the last reference found in the grammar (starting from the 1st rule).
- */
-void
-#ifdef __USE_PROTOS
-addFoLink( Node *p, char *rname, Junction *r )
-#else
-addFoLink( p, rname, r )
-Node *p;
-char *rname;
-Junction *r;
-#endif
-{
- Junction *j;
- require(r!=NULL, "addFoLink: incorrect rule graph");
- require(r->end!=NULL, "addFoLink: incorrect rule graph");
- require(r->end->jtype==EndRule, "addFoLink: incorrect rule graph");
- require(p!=NULL, "addFoLink: NULL FOLLOW link");
-
- j = newJunction();
- j->rname = rname; /* rname on follow links point to target rule */
- j->p1 = p; /* link to other rule */
- j->p2 = (Node *) r->end->p1;/* point to head of list */
- r->end->p1 = (Node *) j; /* reset head to point to new node */
-}
-
-void
-#ifdef __USE_PROTOS
-GenCrossRef( Junction *p )
-#else
-GenCrossRef( p )
-Junction *p;
-#endif
-{
- set a;
- Junction *j;
- RuleEntry *q;
- unsigned e;
- require(p!=NULL, "GenCrossRef: why are you passing me a null grammar?");
-
- printf("Cross Reference:\n\n");
- a = empty;
- for (; p!=NULL; p = (Junction *)p->p2)
- {
- printf("Rule %20s referenced by {", p->rname);
- /* make a set of rules for uniqueness */
- for (j = (Junction *)(p->end)->p1; j!=NULL; j = (Junction *)j->p2)
- {
- q = (RuleEntry *) hash_get(Rname, j->rname);
- require(q!=NULL, "GenCrossRef: FoLinks are screwed up");
- set_orel(q->rulenum, &a);
- }
- for (; !set_nil(a); set_rm(e, a))
- {
- e = set_int(a);
- printf(" %s", RulePtr[e]->rname);
- }
- printf(" }\n");
- }
- set_free( a );
-}
-
-/*
- The single argument is a pointer to the start of an element of a
- C++ style function prototypet list. Given a pointer to the start of
- an formal we must locate the comma (or the end of the string)
- and locate the datatype, formal name, and initial value expression.
-
- The function returns a pointer to the character following the comma
- which terminates the formal declaration, or a pointer to the end of
- the string if none was found.
-
- I thought we were parsing specialists, how come I'm doing this by
- hand written code ?
-
- Examples of input:
-
- Foo f,
- Foo f = Foo(1),
- Foo f = Foo(1,2),
- Foo f = &farray[1,2],
- Foo f = ",",
- Foo f = ',',
- TFoo<int,char> f = TFoo<int,char>(1,2),
-
- A non-zero value for nesting indicates a problem matching '(' and ')',
- '[' and ']', '<' and '>', '{' and '}', or improperly terminated string
- or character literal.
-
-*/
-
-
-/*
- * Don't care if it is a valid string literal or not, just find the end
- * Start with pointer to leading "\""
- */
-
-#ifdef __USE_PROTOS
-char * skipStringLiteral(char *pCurrent)
-#else
-char * skipStringLiteral(pCurrent)
-char *pCurrent;
-#endif
-{
- char *p = pCurrent;
- if (*p == 0) return p;
- require (*p == '\"', "skipStringLiteral")
- p++;
- for (p = p; *p != 0; p++) {
- if (*p == '\\') {
- p++;
- if (*p == 0) break;
- p++;
- }
- if (*p == '\"') {
- p++;
- break;
- }
- }
- return p;
-}
-
-/*
- * Don't care if it is a valid character literal or not, just find the end
- * Start with pointer to leading "'"
- */
-
-#ifdef __USE_PROTOS
-char * skipCharLiteral(char *pStart)
-#else
-char * skipCharLiteral(pStart)
- char *pStart;
-#endif
-{
- char *p = pStart;
- if (*p == 0) return p;
- require (*p == '\'', "skipCharLiteral")
- p++;
- for (p = p; *p != 0; p++) {
- if (*p == '\\') {
- p++;
- if (*p == 0) break;
- p++;
- }
- if (*p == '\'') {
- p++;
- break;
- }
- }
- return p;
-}
-
-#ifdef __USE_PROTOS
-char * skipSpaces(char *pStart)
-#else
-char * skipSpaces(pStart)
-char * pStart;
-#endif
-{
- char *p = pStart;
- while (*p != 0 && isspace(*p)) p++;
- return p;
-}
-
-#ifdef __USE_PROTOS
-char * skipToSeparatorOrEqualSign(char *pStart, int *pNest)
-#else
-char * skipToSeparatorOrEqualSign(pStart, pNest)
-char *pStart;
-int *pNest;
-#endif
-{
- char *p = pStart;
-
- int nest = 0;
-
- *pNest = (-1);
-
- while (*p != 0) {
- switch (*p) {
-
- case '(' :
- case '[' :
- case '<' :
- case '{' :
- nest++;
- p++;
- break;
-
- case ')' :
- case ']' :
- case '>' :
- case '}' :
- nest--;
- p++;
- break;
-
- case '"' :
- p = skipStringLiteral(p);
- break;
-
- case '\'' :
- p = skipCharLiteral(p);
- break;
-
- case '\\':
- p++;
- if (*p == 0) goto EXIT;
- p++;
- break;
-
- case ',':
- case '=':
- if (nest == 0) goto EXIT;
- p++;
- break;
-
- default:
- p++;
- }
- }
-EXIT:
- *pNest = nest;
- return p;
-}
-
-#ifdef __USE_PROTOS
-char * skipToSeparator(char *pStart, int *pNest)
-#else
-char * skipToSeparator(pStart, pNest)
-char *pStart;
-int *pNest;
-#endif
-{
- char * p = pStart;
- for ( ; ; ) {
- p = skipToSeparatorOrEqualSign(p, pNest);
- if (*pNest != 0) return p;
- if (*p == ',') return p;
- if (*p == 0) return p;
- p++;
- }
-}
-
-/* skip to just past the "=" separating the declaration from the initialization value */
-
-#ifdef __USE_PROTOS
-char * getInitializer(char *pStart)
-#else
-char * getInitializer(pStart)
-char * pStart;
-#endif
-{
- char *p;
- char *pDataType;
- char *pSymbol;
- char *pEqualSign;
- char *pValue;
- char *pSeparator;
- int nest = 0;
-
- require(pStart!=NULL, "getInitializer: invalid string");
-
- p = endFormal(pStart,
- &pDataType,
- &pSymbol,
- &pEqualSign,
- &pValue,
- &pSeparator,
- &nest);
- if (nest != 0) return NULL;
- if (pEqualSign == NULL) return NULL;
- if (pValue == NULL) return NULL;
- return strBetween(pValue, NULL, pSeparator);
-}
-
-/*
- Examines the string from pStart to pEnd-1.
- If the string has 0 length or is entirely white space
- returns 1. Otherwise 0.
-*/
-
-#ifdef __USE_PROTOS
-int isWhiteString(const char *pStart, const char *pEnd)
-#else
-int isWhiteString(pStart, pEnd)
-const char *pStart;
-const char *pEnd;
-#endif
-{
- const char *p;
- for (p = pStart; p < pEnd; p++) {
- if (! isspace(*p)) return 0;
- }
- return 1;
-}
-
-/*
- This replaces HasComma() which couldn't distinguish
-
- foo ["a,b"]
-
- from:
-
- foo[a,b]
-
-*/
-
-#ifdef __USE_PROTOS
-int hasMultipleOperands(char *pStart)
-#else
-int hasMultipleOperands(pStart)
-char *pStart;
-#endif
-{
- char *p = pStart;
- int nest = 0;
-
- p = skipSpaces(p);
- if (*p == 0) return 0;
- p = skipToSeparator(p, &nest);
- if (nest == 0 && *p == ',') return 1;
- return 0;
-}
-
-
-#define MAX_STR_BETWEEN_WORK_AREA 1000
-
-static char strBetweenWorkArea[MAX_STR_BETWEEN_WORK_AREA];
-
-
-/*
- strBetween(pStart, pNext, pStop)
-
- Creates a null terminated string by copying the text between two pointers
- to a work area. The start of the string is pStart. The end of the string
- is the character before pNext, or if pNext is null then the character before
- pStop. Trailing spaces are not included in the copy operation.
-
- This is used when a string contains several parts. The pNext part may be
- optional. The pStop will stop the scan when the optional part is not present
- (is a null pointer).
-*/
-
-#ifdef __USE_PROTOS
-char *strBetween(char *pStart, char *pNext, char *pStop)
-#else
-char *strBetween(pStart, pNext, pStop)
-char *pStart;
-char *pNext;
-char *pStop;
-#endif
-{
- char *p;
- char *q = strBetweenWorkArea;
- const char *pEnd;
-
- pEnd = (pNext != NULL) ? pNext : pStop;
-
- require (pEnd != NULL, "pEnd == NULL");
- require (pEnd >= pStart, "pEnd < pStart");
- for (pEnd--; pEnd >= pStart; pEnd--) { /* MR31 */
- if (! isspace(*pEnd)) break;
- }
- for (p = pStart;
- p <= pEnd && q < &strBetweenWorkArea[MAX_STR_BETWEEN_WORK_AREA-2];
- p++, q++) {
- *q = *p;
- }
- *q = 0;
- return strBetweenWorkArea;
-}
-
-/*
- function Returns pointer to character following separator at
- value which to continue search for next formal. If at the
- end of the string a pointer to the null byte at the
- end of the string is returned.
-
- pStart Pointer to the starting position of the formal list
-
- This may be the middle of a longer string, for example
- when looking for the end of formal #3 starting from
- the middle of the complete formal list.
-
- ppDataType Returns a pointer to the start of the data type in the
- formal. Example: pointer to "Foo".
-
- ppSymbol Returns a pointer to the start of the formal symbol.
- Example: pointer to "f".
-
- ppEqualSign Returns a pointer to the equal sign separating the
- formal symbol from the initial value. If there is
- no "=" then this will be NULL.
-
- ppValue Returns a pointer to the initial value part of the
- formal declaration. Example: pointer to "&farray[1,2]"
-
- ppSeparator Returns a pointer to the character which terminated the
- scan. This should be a pointer to a comma or a null
- byte which terminates the string.
-
- pNest Returns the nesting level when a separator was found.
- This is non-zero for any kind of error. This is zero
- for a successful parse of this portion of the formal
- list.
-
-*/
-
-#ifdef __USE_PROTOS
-char * endFormal(char *pStart,
- char **ppDataType,
- char **ppSymbol,
- char **ppEqualSign,
- char **ppValue,
- char **ppSeparator,
- int *pNest)
-#else
-char * endFormal(pStart,
- ppDataType,
- ppSymbol,
- ppEqualSign,
- ppValue,
- ppSeparator,
- pNest)
-char *pStart;
-char **ppDataType;
-char **ppSymbol;
-char **ppEqualSign;
-char **ppValue;
-char **ppSeparator;
-int *pNest;
-
-#endif
-{
- char *p = pStart;
- char *q;
-
- *ppDataType = NULL;
- *ppSymbol = NULL;
- *ppEqualSign = NULL;
- *ppValue = NULL;
- *ppSeparator = NULL;
-
- *pNest = 0;
-
- /* The first non-blank is the start of the datatype */
-
- p = skipSpaces(p);
- if (*p == 0) goto EXIT;
- *ppDataType = p;
-
- /* We are not looking for the symbol, we are looking
- for the separator that follows the symbol. Then
- we'll back up.
-
- Search for the ',' or '=" or null terminator.
- */
-
- p = skipToSeparatorOrEqualSign(p, pNest);
-
- if (*pNest != 0) goto EXIT;
-
- /*
- Work backwards to find start of symbol
- Skip spaces between the end of symbol and separator
- Assume that there are no spaces in the formal, but
- there is a space preceding the formal
- */
-
- for (q = &p[-1]; q >= *ppDataType; q--) {
- if (! isspace(*q)) break;
- }
- if (q < *ppDataType) goto EXIT;
-
- /*
- MR26 Handle things like: IIR_Bool (IIR_Decl::*constraint)()
- Backup until we hit the end of a symbol string, then find the
- start of the symbol string. This wont' work for functions
- with prototypes, but works for the most common cases. For
- others, use typedef names.
- */
-
-/* MR26 */ for (q = q; q >= *ppDataType; q--) {
-/* MR26 */ if (isalpha(*q) || isdigit(*q) || *q == '_' || *q == '$') break;
-/* MR26 */ }
-/* MR26 */ if (q < *ppDataType) goto EXIT;
-
- for (q = q; q >= *ppDataType; q--) {
- if ( ! (isalpha(*q) || isdigit(*q) || *q == '_' || *q == '$')) break;
- }
-
- *ppSymbol = &q[1];
-
- if (*p == ',' || *p == 0) {
- *ppSeparator = p;
- goto EXIT;
- }
-
- *ppEqualSign = p;
- p = skipSpaces(++p);
- *ppValue = p;
- if (*p == 0) goto EXIT;
-
-
- while (*p != 0 && *pNest == 0 && *p != ',') {
- p = skipToSeparator(p, pNest);
- }
- if (*pNest == 0) *ppSeparator = p;
-
-EXIT:
- if (*p == ',') p++;
- return p;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mode.h b/BaseTools/Source/C/VfrCompile/Pccts/antlr/mode.h
deleted file mode 100644
index c08bf31ac7..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mode.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#define START 0
-#define STRINGS 1
-#define ACTION_STRINGS 2
-#define ACTION_CHARS 3
-#define ACTION_COMMENTS 4
-#define TOK_DEF_COMMENTS 5
-#define TOK_DEF_CPP_COMMENTS 6
-#define ACTION_CPP_COMMENTS 7
-#define CPP_COMMENTS 8
-#define COMMENTS 9
-#define ACTIONS 10
-#define PARSE_ENUM_FILE 11
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c
deleted file mode 100644
index 110bf5996f..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c
+++ /dev/null
@@ -1,3030 +0,0 @@
-/*
- * mrhoist.c
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33MR10
- *
- */
-
-#include <stdio.h>
-
-#include "pcctscfg.h"
-
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#include "dlgdef.h"
-#include <ctype.h>
-
-#ifdef __USE_PROTOS
-void dumppred(Predicate *);
-#else
-void dumppred();
-#endif
-
-/*
- Try to determine whether predicate "first" is true for
- all cases where "second" is true. Comparison takes place
- without regard to context.
- Assumes that predicate symbols have been expanded.
- Assumes that there are no NAND or NOR nodes
-
-*/
-
-#ifdef __USE_PROTOS
-int MR_secondPredicateUnreachable(Predicate *first,Predicate *second)
-#else
-int MR_secondPredicateUnreachable(first,second)
- Predicate *first;
- Predicate *second;
-#endif
-{
- Predicate *f;
- Predicate *s;
-
- if (first == NULL) {
- return 1;
- } else if (second == NULL) {
- return 0;
- } else if (first->down == NULL && second->down == NULL) {
- if (first->source == second->source &&
- first->inverted == second->inverted) {
- return 1; /* look identical - will never reach alt2 */
- } else {
- return 0; /* look different */
- };
- } else if (first->down == NULL && second->down != NULL) {
-
- if (second->expr == PRED_AND_LIST) {
-
- /* unreachable if first covers any child of second */
-
- for (s=second->down; s != NULL; s=s->right) {
- if (MR_secondPredicateUnreachable(first,s)) {
- return 1;
- };
- };
- return 0;
- } else if (second->expr == PRED_OR_LIST) {
-
- /* unreachable if first covers every child of second */
-
- for (s=second->down; s != NULL; s=s->right) {
- if (!MR_secondPredicateUnreachable(first,s)) {
- return 0;
- };
- };
- return 1;
- } else {
- require (0,"Illegal pred->expr");
- return 0; /* MR20 Make compiler happy */
- };
- } else if (first->down != NULL && second->down == NULL) {
- if (first->expr == PRED_AND_LIST) {
-
- /* unreachable if every child of first covers second */
-
- for (f=first->down; f != NULL; f=f->right) {
- if (!MR_secondPredicateUnreachable(f,second)) {
- return 0;
- };
- };
- return 1;
- } else if (first->expr == PRED_OR_LIST) {
-
- /* unreachable if any child of first covers second */
-
- for (f=first->down; f != NULL; f=f->right) {
- if (MR_secondPredicateUnreachable(f,second)) {
- return 1;
- };
- };
- return 0;
- } else {
- require (0,"Illegal predicate->expr");
- return 0; /* MR20 Make compiler happy */
- };
- } else {
-
- if (first->expr == PRED_AND_LIST && second->expr == PRED_AND_LIST) {
-
- /* unreachable if each child of first covers at least one child of second */
-
- for (f=first->down; f != NULL ; f=f->right) {
- for (s=second->down; s != NULL ; s=s->right) {
- if (MR_secondPredicateUnreachable(f,s)) goto A_next_f;
- };
- return 0;
-A_next_f:
- continue;
- };
- return 1;
-
- } else if (first->expr == PRED_AND_LIST && second->expr == PRED_OR_LIST) {
-
- /* unreachable if each child of first covers ALL of second's children */
-
- for (f=first->down; f != NULL ; f=f->right) {
- for (s=second->down; s != NULL ; s=s->right) {
- if (!MR_secondPredicateUnreachable(f,s)) return 0;
- };
- };
- return 1;
-
- } else if (first->expr == PRED_OR_LIST && second->expr == PRED_AND_LIST) {
-
- /* unreachable if any child of second is covered by any child of first */
-
- for (f=first->down; f != NULL ; f=f->right) {
- for (s=second->down; s != NULL ; s=s->right) {
- if (MR_secondPredicateUnreachable(f,s)) return 1;
- };
- };
- return 0;
-
- } else if (first->expr == PRED_OR_LIST && second->expr == PRED_OR_LIST) {
-
- /* unreachable if every child of second is covered by some child of first */
-
- for (f=first->down; f != NULL ; f=f->right) {
- for (s=second->down; s != NULL ; s=s->right) {
- if (MR_secondPredicateUnreachable(f,s)) goto B_next_f;
- };
- return 0;
-B_next_f:
- continue;
- };
- return 1;
-
- } else {
- require (0,"Illegal predicate->expr");
- return 0; /* MR20 Make compiler happy */
- };
- };
- return 0; /* MR20 MSVC 5.0 complains about missing return statement */
-}
-
-#ifdef __USE_PROTOS
-void MR_xxxIndent(FILE *f,int depth)
-#else
-void MR_xxxIndent(f,depth)
- FILE *f;
- int depth;
-#endif
-{
- int i;
-
- for (i=0; i<depth ; i++) {
- fprintf(f," ");
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_stderrIndent(int depth)
-#else
-void MR_stderrIndent(depth)
- int depth;
-#endif
-{
- MR_xxxIndent(stderr,depth);
-}
-
-#ifdef __USE_PROTOS
-void MR_outputIndent(int depth)
-#else
-void MR_outputIndent(depth)
- int depth;
-#endif
-{
- MR_xxxIndent(output,depth);
-}
-
-#ifdef __USE_PROTOS
-void MR_set_reuse(set *s)
-#else
-void MR_set_reuse(s)
- set *s;
-#endif
-{
- set_free(*s);
- *s=empty;
-}
-
-#ifdef __USE_PROTOS
-void MR_dumpPredRuleRefStack(FILE *iounit,int indent)
-#else
-void MR_dumpPredRuleRefStack(iounit,indent)
- FILE *iounit;
- int indent;
-#endif
-{
- int i;
- int j;
- int count=MR_PredRuleRefStack.count;
- RuleRefNode *rrn=NULL;
- Junction *lastOne;
-
- if (count == 0) {
- fprintf(iounit,"empty\n");
- return;
- };
- for (i=0; i < count; i++) {
- rrn=(RuleRefNode *) MR_PredRuleRefStack.data[i];
- for (j=0; j<indent; j++) fprintf(iounit," ");
- fprintf(iounit,"#%-2d in rule %s (line %d %s) to rule %s\n",
- i,rrn->rname,rrn->line,FileStr[rrn->file],rrn->text);
- };
- lastOne=MR_ruleReferenced(rrn);
- if (lastOne != NULL) {
- for (j=0; j<indent; j++) fprintf(iounit," ");
- fprintf(iounit,"#%-2d in rule %s (line %d %s)\n",
- count,lastOne->rname,lastOne->line,FileStr[lastOne->file]);
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_dumpTreeF(FILE *f,int depth,Tree *tree,int across)
-#else
-void MR_dumpTreeF(f,depth,tree,across)
- FILE *f;
- Tree *tree;
- int depth;
- int across;
-#endif
-{
- int newAcross=across;
-
- if (tree == NULL ) return;
- if (tree->down != NULL ) {
- fprintf(output,"\n");
- MR_outputIndent(depth);
- fprintf(output, "(root =");
- };
- if (tree->token == ALT ) {
- fprintf(output," %-16s","Alt");
- } else if (tree->token==EpToken ) {
- fprintf(output,"(%d)%13s",tree->v.rk," ");
- } else {
- fprintf(output," %-16s",TerminalString(tree->token));
- };
- if (tree->down != NULL) {
- fprintf(output,"\n");
- MR_outputIndent(depth+1);
- MR_dumpTreeF(f,depth+1,tree->down,1);
- newAcross=0;
- fprintf(output,"\n");
- MR_outputIndent(depth);
- fprintf(output,")");
- };
- if (newAcross > 3) {
- fprintf(output,"\n");
- MR_outputIndent(depth);
- newAcross=0;
- };
- MR_dumpTreeF(f,depth,tree->right,newAcross+1);
-}
-
-#ifdef __USE_PROTOS
-void MR_dumpTreeX(int depth,Tree *tree,int across)
-#else
-void MR_dumpTreeX(depth,tree,across)
- Tree *tree;
- int depth;
- int across;
-#endif
-{
- MR_dumpTreeF(output,depth,tree,across);
-}
-
-#ifdef __USE_PROTOS
-void MR_dumpTokenSet(FILE *f,int depth,set s)
-#else
-void MR_dumpTokenSet(f,depth,s)
- FILE *f;
- int depth;
- set s;
-#endif
-{
- int i;
- int j;
-
- unsigned *pdq;
-
- if (set_nil(s)) {
- fprintf(f,"\n");
- MR_xxxIndent(f,depth+1);
- fprintf(f,"nil\n");
- return;
- };
-
- pdq=set_pdq(s);
- require(pdq != NULL,"set_pdq failed");
- i=0;
- for (i=0 ; ; i=i+4) {
- fprintf(f,"\n");
- MR_xxxIndent(f,depth+1);
- for (j=0; j < 4 ; j++) {
- if (pdq[i+j] == nil) break;
- fprintf(f," %-16s",TerminalString(pdq[i+j]));
- };
- if (pdq[i+j] == nil) break;
- };
- fprintf(f,"\n");
- free( (char *) pdq);
-}
-
-#ifdef __USE_PROTOS
-void MR_dumpPred1(int depth,Predicate *p,int withContext)
-#else
-void MR_dumpPred1(depth,p,withContext)
- int depth;
- Predicate *p;
- int withContext;
-#endif
-{
- unsigned k;
-
- if (p == NULL) {
- MR_outputIndent(depth);
- fprintf(output,"The predicate is empty (or always true)\n\n");
- return;
- };
- if (p->down != NULL) {
- MR_outputIndent(depth);
- if (p->inverted) {
-
- /* MR14a Left out print expression in fprintf
- Reported by Manuel Kessler (mlkessle@cip.physik.uni-wuerzburg.de)
- */
-
- if (p->expr == PRED_AND_LIST) fprintf(output,"%s NAND (not AND) expr\n\n",p->expr);
- if (p->expr == PRED_OR_LIST) fprintf(output,"%s NOR (not OR) expr\n\n",p->expr);
- } else {
- fprintf(output,"%s expr\n\n",p->expr);
- };
- } else {
- MR_outputIndent(depth);
- fprintf(output,"pred %s <<%s>>?\n",
- (p->inverted ? " *not*" : ""),
- (p->expr == NULL ? "null expr" : p->expr));
- MR_outputIndent(depth+1);
- fprintf(output," ");
- fprintf(output," depth=k=%d",p->k);
- if (p->source != NULL && p->source->guardpred) {
- fprintf(output," (\"=>\" guard)");
- }
- if (p->source != NULL && p->source->ampersandPred != NULL) {
- fprintf(output," (\"&&\" guard)");
- };
- k=set_int(p->completionSet);
- if (k != nil) {
- fprintf(output," Incomplete Set at k=%d !",k);
- };
- k=set_int(p->completionTree);
- if (k != nil) {
- fprintf(output," Incomplete Tree at k=%d !",k);
- };
- if (p->source != NULL) {
- fprintf(output," rule %s line %d %s",
- p->source->rname,p->source->line,FileStr[p->source->file]);
- };
- fprintf(output,"\n");
- if (withContext &&
- (HoistPredicateContext ||
- ! set_nil(p->scontext[1]) ||
- p->tcontext != NULL)) {
- if (p->k == 1) {
- MR_outputIndent(depth+1);
- fprintf(output,"set context: ");
- MR_dumpTokenSet(output,depth+1,p->scontext[1]);
- }
- if (p->k != 1) {
- MR_outputIndent(depth+1);
- fprintf(output,"tree context:");
- if (p->tcontext == NULL) {
- fprintf(output," null");
- } else {
- MR_dumpTreeX(depth+2,p->tcontext,0);
- };
- fprintf(output,"\n");
- };
- };
- fprintf(output,"\n");
- };
- if (p->down != NULL) {
- MR_dumpPred1(depth+1,p->down,withContext);
- };
- if (p->right != NULL) {
- MR_dumpPred1(depth,p->right,withContext);
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_dumpPred(Predicate *p,int withContext)
-#else
-void MR_dumpPred(p,withContext)
- Predicate *p;
- int withContext;
-#endif
-{
- MR_dumpPred1(0,p,withContext);
-}
-
-#ifdef __USE_PROTOS
-Tree * MR_make_tree_from_set(set s)
-#else
-Tree * MR_make_tree_from_set(s)
- set s;
-#endif
-{
- Tree *t=NULL;
- Tree *node;
- Tree **tp=&t;
- int i;
-
- unsigned *pdq=set_pdq(s);
-
- if (pdq != NULL) {
- for (i=0 ; pdq[i] != nil ; i++) {
- node=tnode( (int) pdq[i]);
- *tp=node;
- tp=&(node->right);
- };
- *tp=NULL;
- free ( (char *) pdq);
- };
- return t;
-}
-
-#ifdef __USE_PROTOS
-void MR_check_pred_too_long(Predicate *p,set completion)
-#else
-void MR_check_pred_too_long(p,completion)
- Predicate *p;
- set completion;
-#endif
-{
- if (p != NULL &&
- p->source != NULL &&
- ! p->source->predTooLong) {
- if ( !set_nil(completion)) {
- p->source->predTooLong=1;
-warnFL("It is unusual (but ok) for a semantic predicate to test context past the end of its own rule",
- FileStr[p->source->file],p->source->line);
- };
- };
-}
-
-#ifdef __USE_PROTOS
-int MR_predicate_context_completed(Predicate *p)
-#else
-int MR_predicate_context_completed(p)
- Predicate *p;
-#endif
-{
- if (p == NULL) return 1;
- if (p->expr != PRED_AND_LIST &&
- p->expr != PRED_OR_LIST) {
- if ( ! set_nil(p->completionSet)) return 0;
- if ( ! set_nil(p->completionTree)) return 0;
- };
- return MR_predicate_context_completed(p->down) &
- MR_predicate_context_completed(p->right);
-}
-
-#ifdef __USE_PROTOS
-Node * MR_advance(Node *n)
-#else
-Node * MR_advance(n)
- Node *n;
-#endif
-{
- if (n == NULL) return NULL;
- switch (n->ntype) {
- case nJunction: return ((Junction *)n)->p1;
- case nToken: return ((TokNode *)n)->next;
- case nRuleRef: return ((RuleRefNode *)n)->next;
- case nAction: return ((ActionNode *)n)->next;
- default: return NULL;
- };
- return NULL; /* MSVC 5.0 complains about missing return statement */
-}
-
-#ifdef __USE_PROTOS
-Junction * MR_find_endRule(Node *n)
-#else
-Junction * MR_find_endRule(n)
- Node *n;
-#endif
-{
- Node *next;
- if (n == NULL) return NULL;
- for (next=n; next != NULL; next=MR_advance(next)) {
- if (next->ntype == nJunction &&
- ( (Junction *) next)->jtype == EndRule) {
- break;
- };
- };
- return (Junction *)next;
-}
-
-/*
- Intersection: a branch which is shorter is chosen
- over one which is longer: (A B C) intersect (A B) yields (A B).
-
- AND: a branch which is longer is chosen over the one
- which is shorter: (A B C) AND (A B) yields (A B C)
-
-*/
-
-#ifdef __USE_PROTOS
-Tree *MR_computeTreeIntersection(Tree *l,Tree *r)
-#else
-Tree *MR_computeTreeIntersection(l,r)
- Tree *l;
- Tree *r;
-#endif
-{
- Tree *result=NULL;
- Tree **tail;
- Tree *p;
- Tree *q;
- Tree *match;
-
- if (l == NULL || r == NULL) return NULL;
- for (p=l; p != NULL; p=p->right) {
- require(p->token != EpToken,"MR_computeTreeIntersection: p->EpToken unexpected\n");
- require (p->token != ALT,"MR_computeTreeIntersection: p->ALT unexpected\n");
- };
- for (q=r; q != NULL; q=q->right) {
- require(q->token != EpToken,"MR_computeTreeIntersection: q->EpToken unexpected\n");
- require(q->token != ALT,"MR_computeTreeIntersection: q->ALT unexpected\n");
- };
-
- result=tnode(ALT);
- tail=&(result->down);
-
- for (p=l; p != NULL ; p=p->right) {
- for (q=r; q != NULL ; q=q->right) {
- if (p->token == q->token) {
- match=tnode(p->token);
- match->down=MR_computeTreeIntersection(p->down,q->down);
- *tail=match;
- tail=&(match->right);
- };
- };
- };
-
- *tail=NULL;
- result=tshrink(result);
- result=tflatten( result );
- result=tleft_factor( result );
- return result;
-}
-
-/* the predicates which are ANDed together have a common
- context: they must all have common roots. Thus the
- AND operation is more like an OR operation because
- branches which are longer are grafted onto shorter
- branches of the AND tree. For instance combining
- (A B C) with (A B C D) gives (A B C D). There
- should never be a case of (A B C) and (A B D) because
- they have the same context.
-
- Actually, this may not be true once one throws in
- guard predicates which are defined by the user, not
- the context.
-*/
-
-/* requires input trees to be in "canonical" format */
-
-#ifdef __USE_PROTOS
-Tree *MR_computeTreeAND(Tree *l,Tree *r)
-#else
-Tree *MR_computeTreeAND(l,r)
- Tree *l;
- Tree *r;
-#endif
-{
- Tree *result=NULL;
- Tree **tail;
- Tree *p;
- Tree *q;
- Tree *match;
-
- if (l == NULL) return tdup(r);
- if (r == NULL) return tdup(l);
-
- for (p=l; p != NULL; p=p->right) {
-/**** require(p->token != EpToken,"MR_computeTreeAND: p->EpToken unexpected\n"); ****/
- require (p->token != ALT,"MR_computeTreeAND: p->ALT unexpected\n");
- };
- for (q=r; q != NULL; q=q->right) {
-/**** require(q->token != EpToken,"MR_computeTreeAND: q->EpToken unexpected\n"); ****/
- require(q->token != ALT,"MR_computeTreeAND: q->ALT unexpected\n");
- };
-
- result=tnode(ALT);
- tail=&(result->down);
-
- for (p=l; p != NULL ; p=p->right) {
- for (q=r; q != NULL ; q=q->right) {
- if (p->token == q->token) {
- match=tnode(p->token);
- match->down=MR_computeTreeAND(p->down,q->down);
- *tail=match;
- tail=&(match->right);
- };
- };
- };
-
- *tail=NULL;
- result=tshrink(result);
- result=tflatten( result );
- result=tleft_factor( result );
- return result;
-}
-
-#ifdef __USE_PROTOS
-void MR_union_plain_sets1(Predicate *p,set *theUnion)
-#else
-void MR_union_plain_sets1(p,theUnion)
- Predicate *p;
- set *theUnion;
-#endif
-{
- if (p == NULL) return;
- MR_union_plain_sets1(p->down,theUnion);
- MR_union_plain_sets1(p->right,theUnion);
- set_orin(theUnion,p->plainSet);
- return;
-}
-
-#ifdef __USE_PROTOS
-set MR_union_plain_sets(Predicate *p)
-#else
-set MR_union_plain_sets(p)
- Predicate *p;
-#endif
-{
- set theUnion;
-
- theUnion=empty;
-
- MR_union_plain_sets1(p,&theUnion);
- return theUnion;
-}
-
-/* does NOT left factor: do not want to merge
- (A B) with (A) to get (A B)
- in fact the opposite: (A B) with (A) gives (A)
-*/
-
-#ifdef __USE_PROTOS
-Tree *MR_compute_pred_tree_ctxXX(Predicate *p)
-#else
-Tree *MR_compute_pred_tree_ctxXX(p)
- Predicate *p;
-#endif
-{
- Tree *result=NULL;
- Predicate *q;
- Tree *t;
-
- if (p == NULL) return NULL;
-
-/* this appears strange: why do we OR the context
- of and AND predicate ? It is because of the way
- that predicates are evaluated: if the context is
- wrong then it's the same as if the predicate was
- true. That means that even when one leg of an
- AND has unmatched context, if the other leg has
- matched context and is true then the predicate
- succeeds. It's only when all the legs have unmatched
- context that this one can skip evaluation of the
- predicates.
-*/
- if (p->expr == PRED_OR_LIST ||
- p->expr == PRED_AND_LIST) {
- for (q=p->down; q != NULL ; q=q->right) {
- t=MR_compute_pred_tree_ctxXX(q);
- result=tappend(result,t);
- t=NULL;
- };
-
- result=tshrink(result);
- result=tflatten( result );
-
-/* does NOT left factor: do not want to merge
- (A B) with (A) to get (A B)
- in fact the opposite: (A B) with (A) gives (A)
-*/
-
-/**** result=tleft_factor( result ); ****/
- return result;
- };
-
-#if 0
-** if (p->expr == PRED_AND_LIST) {
-**
-** Predicate *l;
-** Predicate *r;
-** Tree *l1;
-** Tree *r1;
-** Tree *prevl1;
-**
-** l=p->down;
-** require (l->right != NULL,"MR_compute_pred_tree - AND has only one child");
-**
-**/* l1 and r1 should already be in "canonical" format */
-**
-** l1=MR_compute_pred_tree(l);
-** for (r=l->right; r != NULL; r=r->right) {
-** r1=MR_compute_pred_tree(r);
-** prevl1=l1;
-** l1=MR_computeTreeAND(l1,r1);
-** Tfree(r1);
-** Tfree(prevl1);
-** };
-**
-**/* result from computeTreeAND should be in "canonical" format */
-**
-** result=l1;
-**
-**/* result of MR_computeTreeAND should be in "canonical" format */
-**
-** return result;
-** };
-#endif
-
- if (p->k == 1) {
- result=MR_make_tree_from_set(p->scontext[1]);
- } else {
- result=tdup(p->tcontext);
- result=MR_remove_epsilon_from_tree(result);
- result=tshrink(result);
- result=tflatten(result);
- result=tleft_factor(result);
- };
- return result;
-}
-
-#ifdef __USE_PROTOS
-void MR_pred_depth(Predicate *p,int *maxDepth)
-#else
-void MR_pred_depth(p,maxDepth)
- Predicate *p;
- int *maxDepth;
-#endif
-{
- if (p == NULL) return;
- if (p->expr != PRED_OR_LIST &&
- p->expr != PRED_AND_LIST) {
- if (p->k > *maxDepth) *maxDepth=p->k;
- };
- MR_pred_depth(p->down,maxDepth);
- MR_pred_depth(p->right,maxDepth);
-}
-
-/* this computes the OR of all the contexts */
-
-#ifdef __USE_PROTOS
-set MR_compute_pred_set(Predicate *p)
-#else
-set MR_compute_pred_set(p)
- Predicate *p;
-#endif
-{
- set result;
- Predicate *q;
-
- result=empty;
-
- if (p == NULL) return empty;
-
- if (p->expr == PRED_OR_LIST ||
- p->expr == PRED_AND_LIST) { /* yes, I do mean PRED_AND_LIST ! */
- /* remember: r1: (A)? => <<p>>? r2; */
- /* r2: (B)? => <<q>>? r3; */
- set t;
-
- t=empty;
- result=empty;
-
- for (q=p->down; q != NULL; q=q->right) {
- t=MR_compute_pred_set(q);
- set_orin(&result,t);
- set_free(t);
- };
- return result;
- } else if (p->k > 1) {
- return empty;
- } else {
- return set_dup(p->scontext[1]);
- };
-}
-
-#ifdef __USE_PROTOS
-set MR_First(int ck,Junction *j,set *incomplete)
-#else
-set MR_First(ck,j,incomplete)
- int ck;
- Junction *j;
- set *incomplete;
-#endif
-{
- Junction *p;
- set tokensUsed;
-
- tokensUsed=empty;
-
- require(j->ntype==nJunction, "MR_First: non junction passed");
-
- p = analysis_point((Junction *)j->p1);
-
- REACH(p,ck,incomplete,tokensUsed);
-
- return tokensUsed;
-}
-
-#ifdef __USE_PROTOS
-void MR_cleanup_pred_trees(Predicate *p)
-#else
-void MR_cleanup_pred_trees(p)
- Predicate *p;
-#endif
-{
- Tree *t;
-
- if (p == NULL) return;
- if (p->expr != PRED_OR_LIST &&
- p->expr != PRED_AND_LIST) {
- t=p->tcontext;
- t=tshrink(t);
- t=tflatten(t);
- t=tleft_factor(t);
- p->tcontext=t;
- };
- MR_cleanup_pred_trees(p->down);
- MR_cleanup_pred_trees(p->right);
-}
-
-/* does NOT return canonical tree */
-
-#ifdef __USE_PROTOS
-Tree * MR_remove_epsilon_from_tree(Tree *t)
-#else
-Tree * MR_remove_epsilon_from_tree(t)
- Tree *t;
-#endif
-{
- if (t == NULL) return NULL;
-
- /* I think ALT can be ignored as a special case */
-
- if (t->token != EpToken) {
- t->down=MR_remove_epsilon_from_tree(t->down);
- t->right=MR_remove_epsilon_from_tree(t->right);
- return t;
- } else {
- Tree *u;
- u=MR_remove_epsilon_from_tree(t->right);
- t->right=NULL;
- Tfree(t);
- return u;
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_complete_set(int predDepth,set *tokensUsed,set *incomplete)
-#else
-void MR_complete_set(predDepth,tokensUsed,incomplete)
- int predDepth;
- set *tokensUsed;
- set *incomplete;
-#endif
-{
- int i;
- RuleRefNode *ruleRef;
- set rk2;
- set b;
- int k2;
- Junction *save_MR_RuleBlkWithHalt;
-
- if (set_int(*incomplete) > (unsigned) predDepth) {
- return;
- };
-
- require(MR_PredRuleRefStack.count == MR_RuleBlkWithHaltStack.count,
- "RuleRefStack and RuleBlkWithHaltStack not same size");
-
- require(MR_RuleBlkWithHalt == NULL ||
- (MR_RuleBlkWithHalt->jtype == RuleBlk && MR_RuleBlkWithHalt->end->halt == TRUE),
- "RuleBlkWithHalt has no halt set");
-
- save_MR_RuleBlkWithHalt=MR_RuleBlkWithHalt;
-
- if (MR_RuleBlkWithHalt != NULL) {
- MR_RuleBlkWithHalt->end->halt=FALSE;
- };
-
- for (i=MR_PredRuleRefStack.count-1; i >= 0 ; i--) {
- ruleRef=(RuleRefNode *)MR_PredRuleRefStack.data[i];
- if (ruleRef == NULL) continue;
-
- MR_RuleBlkWithHalt=(Junction *)MR_RuleBlkWithHaltStack.data[i];
- if (MR_RuleBlkWithHalt != NULL) MR_RuleBlkWithHalt->end->halt=TRUE;
-
- rk2=empty;
- b=empty;
-
- while ( !set_nil(*incomplete) ) {
- k2=set_int(*incomplete);
- if (k2 > predDepth) break; /* <=== another exit from loop */
- set_rm(k2,*incomplete);
- REACH(ruleRef->next,k2,&rk2,b);
- set_orin(tokensUsed,b);
- set_free(b);
- };
-
- if (MR_RuleBlkWithHalt != NULL) MR_RuleBlkWithHalt->end->halt=FALSE;
-
- set_orin(incomplete,rk2); /* remember what we couldn't do */
- set_free(rk2);
- if (set_int(*incomplete) > (unsigned) predDepth) break; /* <=== another exit from loop */
- };
-
- MR_RuleBlkWithHalt=save_MR_RuleBlkWithHalt;
- if (MR_RuleBlkWithHalt != NULL) {
- MR_RuleBlkWithHalt->end->halt=TRUE;
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_complete_tree(int predDepth,Tree **t,set *incomplete)
-#else
-void MR_complete_tree(predDepth,t,incomplete)
- int predDepth;
- Tree **t;
- set *incomplete;
-#endif
-{
- int i;
- RuleRefNode *ruleRef;
- set rk2;
- Tree *u;
- unsigned k2;
- Junction *save_MR_RuleBlkWithHalt;
- int saveConstrainSearch;
-
- if (set_int(*incomplete) > (unsigned) predDepth) {
- return;
- };
-
- require(MR_PredRuleRefStack.count == MR_RuleBlkWithHaltStack.count,
- "RuleRefStack and RuleBlkWithHaltStack not same size");
-
- require(MR_RuleBlkWithHalt == NULL ||
- (MR_RuleBlkWithHalt->jtype == RuleBlk && MR_RuleBlkWithHalt->end->halt == TRUE),
- "RuleBlkWithHalt has no halt set");
-
- save_MR_RuleBlkWithHalt=MR_RuleBlkWithHalt;
- saveConstrainSearch=ConstrainSearch;
- ConstrainSearch=0;
-
- if (MR_RuleBlkWithHalt != NULL) {
- MR_RuleBlkWithHalt->end->halt=FALSE;
- };
-
- for (i=MR_PredRuleRefStack.count-1; i >= 0 ; i--) {
- ruleRef=(RuleRefNode *)MR_PredRuleRefStack.data[i];
- if (ruleRef == NULL) continue;
-
- MR_RuleBlkWithHalt=(Junction *)MR_RuleBlkWithHaltStack.data[i];
-
- if (MR_RuleBlkWithHalt != NULL) MR_RuleBlkWithHalt->end->halt=TRUE;
-
- rk2=empty;
-
- while ( !set_nil(*incomplete) ) {
- k2 = set_int(*incomplete);
- if (k2 > (unsigned) predDepth) break; /* <=== another exit from loop */
- set_rm(k2,*incomplete);
- u = NULL;
-
- TRAV(ruleRef->next,k2,&rk2,u);
-
- /* any subtrees missing k2 tokens, add u onto end */
-
- *t=tlink(*t,u,k2);
- Tfree(u);
- }
-
- set_orin(incomplete,rk2); /* remember what we couldn't do */
- set_free(rk2);
-
- if (MR_RuleBlkWithHalt != NULL) MR_RuleBlkWithHalt->end->halt=FALSE;
-
- if (set_int(*incomplete) > (unsigned) predDepth) break; /* <=== another exit from loop */
- };
-
- MR_RuleBlkWithHalt=save_MR_RuleBlkWithHalt;
-
- if (MR_RuleBlkWithHalt != NULL) {
- MR_RuleBlkWithHalt->end->halt=TRUE;
- };
- ConstrainSearch=saveConstrainSearch;
-}
-
-#ifdef __USE_PROTOS
-void MR_complete_predicates(int predDepth,Predicate *pred)
-#else
-void MR_complete_predicates(predDepth,pred)
- int predDepth;
- Predicate *pred;
-#endif
-{
- if (pred == NULL) return;
- if (pred->expr != PRED_AND_LIST &&
- pred->expr != PRED_OR_LIST) {
- MR_complete_set(predDepth,&(pred->scontext[1]),&(pred->completionSet));
- MR_complete_tree(predDepth,&(pred->tcontext),&(pred->completionTree));
- };
- MR_complete_predicates(predDepth,pred->down);
- MR_complete_predicates(predDepth,pred->right);
-}
-
-#ifdef __USE_PROTOS
-Junction * MR_junctionWithoutP2(Junction *j)
-#else
-Junction * MR_junctionWithoutP2(j)
- Junction *j;
-#endif
-{
- Junction *thisAlt;
-
-/* don't want to follow p2 to the next alternative of this rule */
-/* insert a generic node with null p2 if necessary */
-/* however FIRST requires a junction */
-
- thisAlt=j;
- if (thisAlt->p2 != NULL) {
- if (thisAlt->p1->ntype == nJunction) {
- thisAlt=(Junction *) thisAlt->p1;
- } else {
- thisAlt=newJunction();
- thisAlt->p1=j->p1;
- thisAlt->rname=j->rname;
- thisAlt->file=j->file;
- thisAlt->line=j->line;
- j->p1=(Node *)thisAlt;
- };
- };
- return thisAlt;
-}
-
-#ifdef __USE_PROTOS
-int MR_tree_equ(Tree *big, Tree *small) {
-#else
-int MR_tree_equ(big,small)
- Tree *big;
- Tree *small;
-{
-#endif
-
- Tree *b;
- Tree *s;
- int bcount=0;
- int scount=0;
-
- if (small == NULL && big == NULL) return 1;
- if (small == NULL) return 0;
- if (big == NULL) return 0;
-
- if (small->token == ALT) {
- require(small->right == NULL,
- "MR_tree_equ: small: ALT node has siblings");
- return MR_tree_equ(big,small->down);
- };
- if (big->token == ALT) {
- require(big->right == NULL,
- "MR_tree_equ: big: ALT node has siblings");
- return MR_tree_equ(big->down,small);
- };
- for (s=small; s != NULL; s=s->right) {
- scount++;
- require(s->token != EpToken,"MR_tree_equ: s->EpToken unexpected\n");
- };
- for (b=big; b != NULL; b=b->right) {
- bcount++;
- require(b->token != EpToken,"MR_tree_equ: b->EpToken unexpected\n");
- };
-
- if (bcount != scount) return 0;
-
- for (s=small; s != NULL; s=s->right) {
- for (b=big; b!= NULL; b=b->right) {
- if (s->token == b->token) {
- if (MR_tree_equ(b->down,s->down)) goto next_s;
- };
- };
- return 0;
-next_s:
- continue;
- };
- return 1;
-}
-
-/* this does not compare sources - only contexts ! */
-
-#ifdef __USE_PROTOS
-int MR_identicalContext(Predicate *p,Predicate *q)
-#else
-int MR_identicalContext(p,q)
- Predicate *p;
- Predicate *q;
-#endif
-{
- if (p->k != q->k) return 0;
- require ( (p->tcontext == NULL) == (q->tcontext == NULL),
- "tcontext inconsistent");
- if (p->k == 1) {
- return set_equ(p->scontext[1],q->scontext[1]);
- } else {
- return MR_tree_equ(p->tcontext,q->tcontext);
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_reportSetSuppression(int predDepth,
- set predSet,set plainSet,Junction *jPred,Junction *jPlain,Predicate *p)
-#else
-void MR_reportSetSuppression(predDepth,predSet,plainSet,jPred,jPlain,p)
- int predDepth;
- set predSet;
- set plainSet;
- Junction *jPred;
- Junction *jPlain;
- Predicate *p;
-#endif
-{
- if (InfoP) {
- fprintf(output,"\n#if 0\n\n");
- fprintf(output,"Hoisting of predicate suppressed by alternative without predicate.\n");
- fprintf(output,"The alt without the predicate includes all cases where the predicate is false.\n\n");
- fprintf(output," WITH predicate: line %d %s\n",jPred->line,FileStr[jPred->file]);
- if (jPlain != NULL) {
- fprintf(output," WITHOUT predicate: line %d %s\n",jPlain->line,FileStr[jPlain->file]);
- } else {
- fprintf(output," WITHOUT predicate: all alternatives without predicates (combined)\n");
- };
- if (predDepth == 1) {
- fprintf(output,"\nThe context set for the predicate:\n");
- MR_dumpTokenSet(output,1,predSet);
- };
- fprintf(output,"\nThe lookahead set for the alt WITHOUT the semantic predicate:\n");
- MR_dumpTokenSet(output,1,plainSet);
- fprintf(output,"\nThe predicate:\n\n");
- MR_dumpPred1(1,p,1);
- fprintf(output,"Chain of referenced rules:\n\n");
- MR_dumpPredRuleRefStack(output,4);
- fprintf(output,"\n#endif\n");
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_reportSetRestriction(int predDepth,set predSet,set plainSet,
- Junction *jPred,Junction *jPlain,Predicate *origPred,Predicate *newPred)
-#else
-void MR_reportSetRestriction(predDepth,predSet,plainSet,jPred,jPlain,origPred,newPred)
- int predDepth;
- set predSet;
- set plainSet;
- Junction *jPred;
- Junction *jPlain;
- Predicate *origPred;
- Predicate *newPred;
-#endif
-{
- set intersect;
-
- intersect=empty;
-
- if (! InfoP) return;
- fprintf(output,"\n#if 0\n\n");
- fprintf(output,"Restricting the context of a predicate because of overlap in the lookahead set\n");
- fprintf(output," between the alternative with the semantic predicate and one without\n");
- fprintf(output,"Without this restriction the alternative without the predicate could not\n");
- fprintf(output," be reached when input matched the context of the predicate and the predicate\n");
- fprintf(output," was false.\n\n");
-
- fprintf(output," WITH predicate: line %d %s\n",jPred->line,FileStr[jPred->file]);
- if (jPlain != NULL) {
- fprintf(output," WITHOUT predicate: line %d %s\n",jPlain->line,FileStr[jPlain->file]);
- } else {
- fprintf(output," WITHOUT predicate: all alternatives without predicates (combined)\n");
- };
- if (predDepth == 1) {
- fprintf(output,"\nThe original context set for the predicate:\n");
- MR_dumpTokenSet(output,1,predSet);
- };
- fprintf(output,"\nThe lookahead set for the alt WITHOUT the semantic predicate:\n");
- MR_dumpTokenSet(output,1,plainSet);
- if (predDepth == 1) {
- fprintf(output,"\nThe intersection of the two sets\n");
- intersect=set_and(predSet,plainSet);
- MR_dumpTokenSet(output,1,intersect);
- set_free(intersect);
- };
- fprintf(output,"\nThe original predicate:\n\n");
- MR_dumpPred1(1,origPred,1);
- fprintf(output,"The new (modified) form of the predicate:\n\n");
- MR_dumpPred1(1,newPred,1);
- fprintf(output,"#endif\n");
-}
-
-/* don't use Pass3 by itself unless you know that inverted is not important */
-
-#ifdef __USE_PROTOS
-Predicate * MR_removeRedundantPredPass3(Predicate *p)
-#else
-Predicate * MR_removeRedundantPredPass3(p)
- Predicate *p;
-#endif
-{
- Predicate *q;
-
- if (p == NULL) return NULL;
- p->right=MR_removeRedundantPredPass3(p->right);
- p->down=MR_removeRedundantPredPass3(p->down);
- if (p->redundant) {
- q=p->right;
- p->right=NULL;
- predicate_free(p);
- return q;
- };
- if (p->expr == PRED_AND_LIST ||
- p->expr == PRED_OR_LIST) {
- if (p->down == NULL) {
- q=p->right;
- p->right=NULL;
- predicate_free(p);
- return q;
- };
- if (p->down != NULL && p->down->right == NULL) {
- q=p->down;
- q->right=p->right;
- p->right=NULL;
- p->down=NULL;
- return q;
- };
- };
- return p;
-}
-
-#ifdef __USE_PROTOS
-void MR_removeRedundantPredPass2(Predicate *p)
-#else
-void MR_removeRedundantPredPass2(p)
- Predicate *p;
-#endif
-{
- Predicate *q;
-
- if (p == NULL) return;
-
- if (p->expr == PRED_AND_LIST) {
- for (q=p->down ; q != NULL ; q=q->right) {
- MR_removeRedundantPredPass2(q);
- if (q->isConst) {
- if (q->constValue == 0) {
- p->isConst=1;
- p->constValue=0;
- return;
- } else {
- q->redundant=1;
- };
- };
- };
- };
-
- if (p->expr == PRED_OR_LIST) {
- for (q=p->down ; q != NULL ; q=q->right) {
- MR_removeRedundantPredPass2(q);
- if (q->isConst) {
- if (q->constValue == 0) {
- q->redundant=1;
- } else {
- p->isConst=1;
- p->constValue=1;
- return;
- };
- };
- };
- };
-
- return;
-}
-
-#if 0
- this totally ignores the implications of guarded predicates
- in which the part after the guard could possibly cover a predicate.
- that would be much harder:
-
- rule : (A)? => <<p>>? sub1; /* 1 */
- | (B)? => <<r>>? sub2 /* 2 */
- sub1 : (A)? => <<q>>? A B /* 3 */
- | B /* 4 - suppresses line 2 */
- ;
-#endif
-
-#ifdef __USE_PROTOS
-void MR_apply_restriction1(Predicate *pred,set *plainSet,int *changed)
-#else
-void MR_apply_restriction1(pred,plainSet,changed)
- Predicate *pred;
- set *plainSet;
- int *changed;
-#endif
-{
- if (pred == NULL) return;
- MR_apply_restriction1(pred->right,plainSet,changed);
- if (pred->down != NULL) {
- MR_apply_restriction1(pred->down,plainSet,changed);
- } else {
- set t;
- if (pred->k == 1) {
- t=set_dif(pred->scontext[1],*plainSet);
- if (*changed == 0 &&
- !set_equ(t,pred->scontext[1])) {
- *changed=1;
- };
- if (set_nil(t)) {
- pred->redundant=1;
- };
- set_free(pred->scontext[1]);
- pred->scontext[1]=t;
- };
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_orin_plainSet(Predicate *p,set plainSet)
-#else
-void MR_orin_plainSet(p,plainSet)
- Predicate *p;
- set plainSet;
-#endif
-{
- if (p == NULL) return;
- MR_orin_plainSet(p->down,plainSet);
- MR_orin_plainSet(p->right,plainSet);
- set_orin(&p->plainSet,plainSet);
-}
-
-Predicate *PRED_SUPPRESS;
-
-#ifdef __USE_PROTOS
-Predicate * MR_find_in_aSubBlk(Junction *alt)
-#else
-Predicate * MR_find_in_aSubBlk(alt)
- Junction *alt;
-#endif
-{
- Predicate *root=NULL;
- Predicate **tail=NULL;
-
- Junction *p;
-
- int nAlts=0;
- Junction **jList;
- Predicate **predList;
- int *matchList;
- set predSet;
- int i;
- int j;
- int m;
- int predDepth;
- set incomplete;
- set union_plainSet;
- set setChange;
- int changed;
- Predicate *newPred;
- set setDif;
- Predicate *origPred;
- int depth1=1; /* const int */
- set *plainContext;
- set plainSet;
-
- predSet=empty;
- incomplete=empty;
- union_plainSet=empty;
- setChange=empty;
- setDif=empty;
- plainSet=empty;
-
- if (PRED_SUPPRESS == NULL) {
- PRED_SUPPRESS=new_pred();
- PRED_SUPPRESS->expr="Predicate Suppressed";
- };
-
- /* this section just counts the number of "interesting" alternatives */
- /* in order to allocate arrays */
-
- for (p=alt; p!=NULL; p=(Junction *)p->p2) {
- /* ignore empty alts */
- if ( p->p1->ntype != nJunction ||
- ((Junction *)p->p1)->jtype != EndBlk ) {
- nAlts++;
- };
- };
-
- /* if this is a (...)+ block then don't count the last alt because
- it can't be taken until at least one time through the block.
- In other words it isn't a real choice until the (...)+ is entered
- at which point the hoisting issue is moot.
- Maybe look at "ignore" instead ?
- */
-
- if (alt->jtype == aPlusBlk) {
- nAlts--;
- };
-
- jList=(Junction **)calloc(nAlts,sizeof(Junction *));
- require(jList!=NULL,"cannot allocate MR_find_in_aSubBlk jList");
-
- plainContext=(set *)calloc(nAlts,sizeof(set));
- require(plainContext!=NULL,"cannot allocate MR_find_in_aSubBlk plainContext");
- for (m=0; m < nAlts; m++) plainContext[m]=empty;
-
- predList=(Predicate **)calloc(nAlts,sizeof(Predicate *));
- require(predList!=NULL,"cannot allocate MR_find_in_aSubBlk predList");
-
- matchList=(int *)calloc(nAlts,sizeof(int));
- require(matchList!=NULL,"cannot allocate MR_find_in_aSubBlk matchList");
-
- /* this section just fills in the arrays previously allocated */
- /* the most interesting one is matchList[] */
- /* */
- /* bit 0 => this alt has a semantic pred which is "covered" */
- /* by an alt without a semantic pred. Don't hoist. */
-
- for (i=0,p=alt;
- p!=NULL && i<nAlts;
- i++,p=(Junction *)p->p2) {
-
- /* ignore empty alts */
-
- if ( p->p1->ntype != nJunction ||
- ((Junction *)p->p1)->jtype != EndBlk ) {
- jList[i]=MR_junctionWithoutP2(p);
- predList[i]=find_predicates(p->p1); /* should be jList ????? */
- if (predList[i] != NULL) {
- MR_cleanup_pred_trees(predList[i]); /* flatten & left factor */
- plainContext[i]=MR_union_plain_sets(predList[i]);
- } else {
- MR_set_reuse(&plainSet);
- MR_set_reuse(&incomplete);
- plainSet=MR_First(depth1,jList[i],&incomplete);
- MR_complete_set(depth1,&plainSet,&incomplete);
- require(set_nil(incomplete),"couldn't complete k=1");
- plainContext[i]=plainSet;
- plainSet=empty;
- };
- set_orin(&union_plainSet,plainContext[i]);
- };
- };
-
- if (nAlts == 1) {
- goto EXIT_SIMPLE;
- };
-
-/*
- * Looking for cases where alt i has a semantic pred and alt j does not.
- * Don't care about cases where lookahead for semantic predicates overlap
- * because normal predicate hoisting does the correct thing automatically.
- * Don't care about cases where lookahead for alts without semantic predicates
- * overlap because normal prediction does the correct thing automatically.
- *
- * When we find such a case check for one of three subcases:
- *
- * 1. if lookahead for alt i is contained in the lookahead for any
- * alt j then ignore semantic predicate of alt i
- * 2. if lookahead for alt i is not contained in the lookahead for
- * any alt j then add add predicate i to the OR list to be hoisted
- * 3. if lookahead for alt i overlaps the lookahead for some alt j then
- * add a dummy semantic predicate for alt j
- *
- * There is an implicit assumption that the context of all alternatives following
- * the rule being processed here are identical (but may vary from hoist to
- * hoist depending on the place where the rule was invoked that led to hoisting
- * these predicates. In othere words in the fragment:
- *
- * ( <<a>>? a1 a2 a3 | <<b>>? b1 b2 b3 )
- *
- * both a3 and b3 have the same follow sets because they are both at the end of
- * alternatives in the same block.
- */
-
- for (i=0; i < nAlts; i++) {
- if (jList[i] == NULL) continue;
- if (predList[i] == NULL) continue;
-
- /* if the predicate depth turns out to be one token only */
- /* then it is can be easily represented as a set and */
- /* compared to the junction set create by MR_First() */
-
- predDepth=0;
- MR_pred_depth(predList[i],&predDepth);
- require (predDepth >= 1,"MR_find_in_aSubBlk: pred depth < 1");
- require (predDepth <= CLL_k,"MR_find_in_aSubBlk: predDepth > CLL_k");
-
- /* complete predicates to predDepth
- If completed to depth=1 then the context would be incomplete.
- The context would be truncated and the predicate simplify routine
- would have incomplete information. It would lead to
- either false matches of failure to find true matches.
- */
-
- MR_complete_predicates(predDepth,predList[i]);
-
- if (predList[i] != NULL) {
- MR_cleanup_pred_trees(predList[i]); /* flatten & left factor */
- };
-
- /* If the predicate depth is 1 then it is possible to suppress
- a predicate completely using a single plain alt. Check for suppression
- by a single plain alt first because it gives better messages. If that
- fails try the union of all the plain alts.
- */
-
- if (predDepth == 1) {
-
- MR_set_reuse(&predSet);
- predSet=MR_compute_pred_set(predList[i]); /* ignores k>1 predicates */
-
- for (j=0; j < nAlts; j++) {
- if (jList[j] == NULL) continue;
- if (j == i) continue;
-
- MR_set_reuse(&setDif);
- setDif=set_dif(predSet,plainContext[j]);
- if (set_nil(setDif)) {
- matchList[i] |= 1;
- MR_reportSetSuppression(predDepth,predSet,plainContext[j],jList[i],jList[j],predList[i]);
- predicate_free(predList[i]);
- predList[i]=PRED_SUPPRESS;
- goto next_i;
- };
-
- }; /* end loop on j */
-
- changed=0;
-
- /* predicate_dup is only to give good error messages */
- /* remember to do a predicate_free() */
-
- origPred=predicate_dup(predList[i]);
- MR_apply_restriction1(predList[i],&union_plainSet,&changed);
- if (changed) {
-
- /* don't use Pass3 by itself unless you know that inverted is not important */
-
- newPred=MR_removeRedundantPredPass3(predList[i]);
- newPred=MR_predSimplifyALL(newPred);
- if (newPred == NULL) {
- matchList[i] |= 1;
- MR_reportSetSuppression(predDepth,predSet,union_plainSet,jList[i],
- NULL,origPred);
- predList[i]=PRED_SUPPRESS;
- } else {
- MR_reportSetRestriction(predDepth,predSet,union_plainSet,jList[i],
- NULL,origPred,newPred);
- predList[i]=newPred;
- };
- };
- predicate_free(origPred);
- origPred=NULL;
- };
-
- /*
- If the predicate depth is > 1 then it can't be suppressed completely
- because the code doesn't support inspection of such things. They're
- much messier than k=1 sets.
- */
-
- if (predDepth > 1 ) {
-
- changed=0;
-
- /* predicate_dup is only to give good error messages */
- /* remember to do a predicate_free() */
-
- origPred=predicate_dup(predList[i]);
- MR_apply_restriction1(predList[i],&union_plainSet,&changed);
- if (changed) {
- newPred=MR_removeRedundantPredPass3(predList[i]);
- newPred=MR_predSimplifyALL(newPred);
- if (newPred == NULL) {
- matchList[i] |= 1;
- MR_reportSetSuppression(predDepth,predSet,union_plainSet,jList[i],
- NULL,origPred);
- predList[i]=PRED_SUPPRESS;
- } else {
- MR_reportSetRestriction(predDepth,predSet,union_plainSet,jList[i],
- NULL,origPred,newPred);
- predList[i]=newPred;
- };
- };
- predicate_free(origPred);
- origPred=NULL;
- };
-next_i:
- continue;
- };
-
-EXIT_SIMPLE:
-
- root = new_pred();
- root->expr=PRED_OR_LIST;
- tail = &(root->down);
-
- for (i=0 ; i< nAlts ; i++) {
- if (jList[i] == NULL) continue;
-
- if (predList[i] == NULL) {
- continue;
- } else if ( (matchList[i] & 1) != 0) {
- if (predList[i] != PRED_SUPPRESS) {
- predicate_free(predList[i]);
- };
- continue;
- };
-
- /* make an OR list of predicates */
-
- *tail=predList[i];
- tail=&(predList[i]->right);
- };
-
- /* if just one pred, remove OR root */
-
- if (root->down == NULL) {
- predicate_free(root);
- root=NULL;
- } else if (root->down->right == NULL) {
- Predicate *p=root->down;
- root->down=NULL;
- predicate_free(root);
- root=p;
- }
-
- root=MR_predSimplifyALL(root);
-
- MR_orin_plainSet(root,union_plainSet);
-
- set_free(predSet);
- set_free(union_plainSet);
- set_free(incomplete);
- set_free(setChange);
- set_free(setDif);
-
- for (m=0; m < nAlts; m++) set_free(plainContext[m]);
-
- free ( (char *) jList);
- free ( (char *) predList);
- free ( (char *) matchList);
- free ( (char *) plainContext);
-
- return root;
-}
-
-#ifdef __USE_PROTOS
-void MR_predContextPresent(Predicate *p,int *allHaveContext,int *noneHaveContext)
-#else
-void MR_predContextPresent(p,allHaveContext,noneHaveContext)
- Predicate *p;
- int *allHaveContext;
- int *noneHaveContext;
-#endif
-{
- if (p == NULL) return;
- MR_predContextPresent(p->right,allHaveContext,noneHaveContext);
- if (p->expr != PRED_AND_LIST &&
- p->expr != PRED_OR_LIST) {
- if (set_nil(p->scontext[1]) == 0 ||
- (p->tcontext != NULL)) {
- *noneHaveContext=0;
- } else {
- *allHaveContext=0;
- };
- };
- MR_predContextPresent(p->down,allHaveContext,noneHaveContext);
-}
-
-#ifdef __USE_PROTOS
-int MR_pointerStackPush(PointerStack *ps,void *dataPointer)
-#else
-int MR_pointerStackPush(ps,dataPointer)
- PointerStack *ps;
- void *dataPointer;
-#endif
-{
- void **newStack;
- int newSize;
- int i;
-
- if (ps->count == ps->size) {
- newSize=20+ps->size*2;
- newStack=(void **)calloc(newSize,sizeof(void *));
- require (newStack != NULL,"cannot allocate PointerStack");
- for (i=0; i < ps->size; i++) {
- newStack[i]=ps->data[i];
- };
- if (ps->data != NULL) free( (char *) ps->data);
- ps->data=newStack;
- ps->size=newSize;
- };
- ps->data[ps->count]=dataPointer;
- ps->count++;
- return ps->count-1;
-}
-
-#ifdef __USE_PROTOS
-void * MR_pointerStackPop(PointerStack *ps)
-#else
-void * MR_pointerStackPop(ps)
- PointerStack *ps;
-#endif
-{
- void *dataPointer;
-
- require(ps->count > 0,"MR_pointerStackPop underflow");
-
- dataPointer=ps->data[ps->count-1];
- ps->data[ps->count-1]=NULL;
- (ps->count)--;
- return dataPointer;
-}
-
-#ifdef __USE_PROTOS
-void * MR_pointerStackTop(PointerStack *ps)
-#else
-void * MR_pointerStackTop(ps)
- PointerStack *ps;
-#endif
-{
- require(ps->count > 0,"MR_pointerStackTop underflow");
- return ps->data[ps->count-1];
-}
-
-#ifdef __USE_PROTOS
-void MR_pointerStackReset(PointerStack *ps)
-#else
-void MR_pointerStackReset(ps)
- PointerStack *ps;
-#endif
-{
- int i;
- if (ps->data != NULL) {
- for (i=0; i < ps->count ; i++) {
- ps->data[i]=NULL;
- };
- };
- ps->count=0;
-}
-
-#ifdef __USE_PROTOS
-Junction *MR_nameToRuleBlk(char *name)
-#else
-Junction *MR_nameToRuleBlk(name)
- char *name;
-#endif
-{
- RuleEntry *q;
-
- require (RulePtr != NULL,"MR_nameToRule: RulePtr not initialized");
-
- if (name == NULL) return NULL;
-
- q = (RuleEntry *) hash_get(Rname,name);
-
- if ( q == NULL ) {
- return NULL;
- } else {
- return RulePtr[q->rulenum];
- };
-}
-
-#ifdef __USE_PROTOS
-Junction * MR_ruleReferenced(RuleRefNode *rrn)
-#else
-Junction * MR_ruleReferenced(rrn)
- RuleRefNode *rrn;
-#endif
-{
- return MR_nameToRuleBlk(rrn->text);
-}
-
-#ifdef __USE_PROTOS
-void MR_comparePredLeaves(Predicate *me,Predicate *myParent,Predicate *him,Predicate *hisParent)
-#else
-void MR_comparePredLeaves(me,myParent,him,hisParent)
- Predicate *me;
- Predicate *myParent;
- Predicate *him;
- Predicate *hisParent;
-#endif
-{
- if (me == NULL) return;
- if (me == him) {
- MR_comparePredLeaves(me->right,myParent,him,hisParent);
- return;
- } else if (me->expr == PRED_AND_LIST ||
- me->expr == PRED_OR_LIST) {
- MR_comparePredLeaves(me->down,me,him,hisParent);
- MR_comparePredLeaves(me->right,myParent,him,hisParent);
- return;
- } else {
- if (me->source != NULL) {
-
- /* predicate->invert can be set only in the predEntry predicates */
- /* thus they are only visible after the predEntry predicates have been "unfolded" */
-
- int sameSource=(me->source == him->source);
- int sameInvert=1 &
- (1 + me->inverted + him->inverted + me->source->inverted + him->source->inverted);
- int samePredEntry=(me->source->predEntry != NULL
- && him->source->predEntry != NULL
- && me->source->predEntry == him->source->predEntry);
- if (sameInvert && (sameSource || samePredEntry)) {
- if (MR_identicalContext(me,him)) {
-
- /* identical predicates */
-
- if (hisParent->expr == PRED_OR_LIST &&
- myParent->expr == PRED_OR_LIST) {
- me->redundant=1;
- } else if (hisParent->expr == PRED_AND_LIST &&
- myParent->expr == PRED_AND_LIST) {
- me->redundant=1;
- } else if ( (hisParent->expr == PRED_OR_LIST &&
- myParent->expr == PRED_AND_LIST)
- ||
- (hisParent->expr == PRED_AND_LIST &&
- myParent->expr == PRED_OR_LIST)
- ) {
- myParent->redundant=1;
- } else {
- require (0,"MR_comparePredLeaves: not both PRED_LIST");
- };
- };
- }; /* end same source or same predEntrr with same invert sense */
-
- /* same predEntry but opposite invert sense */
-
- if (!sameInvert && (sameSource || samePredEntry)) {
- if (MR_identicalContext(me,him)) {
- if (hisParent->expr == PRED_OR_LIST &&
- myParent->expr == PRED_OR_LIST) {
- myParent->isConst=1;
- myParent->constValue=1;
- } else if (hisParent->expr == PRED_AND_LIST &&
- myParent->expr == PRED_AND_LIST) {
- myParent->isConst=1;
- myParent->constValue=0;
- } else if ( (hisParent->expr == PRED_OR_LIST &&
- myParent->expr == PRED_AND_LIST)
- ||
- (hisParent->expr == PRED_AND_LIST &&
- myParent->expr == PRED_OR_LIST)
- ) {
- me->redundant=1;
- } else {
- require (0,"MR_comparePredLeaves: not both PRED_LIST");
- };
- };
- }; /* end same predEntry with opposite invert sense */
- };
-
- MR_comparePredLeaves(me->right,myParent,him,hisParent);
- return;
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_removeRedundantPredPass1(Predicate *me,Predicate *myParent)
-#else
-void MR_removeRedundantPredPass1(me,myParent)
- Predicate *me;
- Predicate *myParent;
-#endif
-{
- if (me == NULL) return;
- if (me->redundant) {
- MR_removeRedundantPredPass1(me->right,myParent);
- return;
- };
- if (me->expr == PRED_AND_LIST ||
- me->expr == PRED_OR_LIST) {
- MR_removeRedundantPredPass1(me->down,me);
- MR_removeRedundantPredPass1(me->right,myParent);
- } else {
- require (me->source != NULL,"me->source == NULL");
- if (myParent != NULL) {
- MR_comparePredLeaves(myParent->down,myParent,me,myParent);
- };
- MR_removeRedundantPredPass1(me->right,myParent);
- };
-}
-
-/* pretty much ignores things with the inverted bit set */
-
-#ifdef __USE_PROTOS
-Predicate *MR_predFlatten(Predicate *p)
-#else
-Predicate *MR_predFlatten(p)
- Predicate *p;
-#endif
-{
- if (p == NULL) return NULL;
- if (p->expr == PRED_OR_LIST
- || p->expr == PRED_AND_LIST) {
-
- Predicate *child;
- Predicate *gchild;
- Predicate **tail;
- Predicate *next;
- char *PRED_XXX_LIST=p->expr;
-
- require (p->down != NULL,"MR_predFlatten AND/OR no child");
-
-
- p->down=MR_predFlatten(p->down);
- p->right=MR_predFlatten(p->right);
- child=p->down;
- if (child->right == NULL) {
- child->right=p->right;
- p->right=NULL;
- p->down=NULL;
- if (p->inverted) child->inverted=!child->inverted;
- predicate_free(p);
- return child;
- };
-
- /* make a single list of all children and grandchildren */
-
- tail=&(p->down);
- for (child=p->down; child != NULL; child=next) {
- if (child->expr != PRED_XXX_LIST
- || child->inverted
- || child->predEntry != NULL) {
- *tail=child;
- tail=&(child->right);
- next=child->right;
- } else {
- for (gchild=child->down;
- gchild != NULL;
- gchild=gchild->right) {
- *tail=gchild;
- tail=&(gchild->right);
- };
- next=child->right;
- child->right=NULL;
- child->down=NULL;
- predicate_free(child);
- };
- };
- *tail=NULL;
- return p;
- } else {
- p->right=MR_predFlatten(p->right);
- return p;
- };
-}
-
-static char *alwaysFalseWarning=NULL;
-
-#ifdef __USE_PROTOS
-Predicate *checkPredicateConflict(Predicate *p)
-#else
-Predicate *checkPredicateConflict(p)
- Predicate *p;
-#endif
-{
- if (p->isConst) {
- if (p->constValue == 1) {
- predicate_free(p);
- return NULL;
- } else {
- if (InfoP && !p->conflictReported) {
- p->conflictReported=1;
- fprintf(output,"\n#if 0\n\n");
- fprintf(output,"The following predicate expression will always be false:\n\n");
- MR_dumpPred1(1,p,1);
- fprintf(output,"\n#endif\n");
- };
-
- if (alwaysFalseWarning != CurRule) {
- alwaysFalseWarning=CurRule;
- if (InfoP) {
- warnNoFL(eMsg1("one (or more) predicate expression hoisted into rule \"%s\" are always false \
-- see output file for more information",CurRule));
- } else {
- warnNoFL(eMsg1("one (or more) predicate expressions hoisted into rule \"%s\" are always false \
-- use \"-info p\" for more information",CurRule));
- };
- };
- };
- };
- return p;
-}
-
-
-#ifdef __USE_PROTOS
-int MR_countPredNodes(Predicate *p)
-#else
-int MR_countPredNodes(p)
- Predicate *p;
-#endif
-{
- if (p == NULL) return 0;
- return 1 + MR_countPredNodes(p->down) + MR_countPredNodes(p->right);
-}
-
-#ifdef __USE_PROTOS
-Predicate *MR_predSimplifyALLX(Predicate *p,int skipPass3)
-#else
-Predicate *MR_predSimplifyALLX(p,skipPass3)
- Predicate *p;
- int skipPass3;
-#endif
-{
- int countBefore;
- int countAfter;
-
- countAfter=MR_countPredNodes(p);
-
- do {
- if (p == NULL) return NULL;
- if (p->right == NULL && p->down == NULL) return p;
- countBefore=countAfter;
- MR_simplifyInverted(p,0);
- p=MR_predFlatten(p);
- MR_removeRedundantPredPass1(p,NULL);
- MR_removeRedundantPredPass2(p);
- if (! skipPass3) {
- p=checkPredicateConflict(p);
- p=MR_removeRedundantPredPass3(p);
- };
- countAfter=MR_countPredNodes(p);
- } while (countBefore != countAfter);
-
- return p;
-}
-
-#ifdef __USE_PROTOS
-Predicate *MR_predSimplifyALL(Predicate *p)
-#else
-Predicate *MR_predSimplifyALL(p)
- Predicate *p;
-#endif
-{
- return MR_predSimplifyALLX(p,0);
-}
-
-#ifdef __USE_PROTOS
-void MR_releaseResourcesUsedInRule(Node *n)
-#else
-void MR_releaseResourcesUsedInRule(n)
- Node *n;
-#endif
-{
- Node *next;
- Junction *j;
- int i;
-
- if (n == NULL) return;
- if (n->ntype == nJunction) {
- j=(Junction *) n;
-
- if (j->predicate != NULL) {
- predicate_free(j->predicate);
- j->predicate=NULL;
- };
- for (i=0; i< CLL_k; i++) {
- set_free(j->fset[i]);
- j->fset[i]=empty;
- };
- if (j->ftree != NULL) {
- Tfree(j->ftree);
- j->ftree=NULL;
- };
- if (j->jtype == EndRule) return;
- if (j->jtype != RuleBlk && j->jtype != EndBlk) {
- if (j->p2 != NULL && !j->ignore) { /* MR11 */
- MR_releaseResourcesUsedInRule(j->p2);
- };
- };
- };
- next=MR_advance(n);
- MR_releaseResourcesUsedInRule(next);
-}
-
-#ifdef __USE_PROTOS
-int MR_allPredLeaves(Predicate *p)
-#else
-int MR_allPredLeaves(p)
- Predicate *p;
-#endif
-{
- Predicate *q;
-
- if (p == NULL) return 1;
-
- for (q=p; q != NULL; q=q->right) {
- if (q->down != NULL) return 0;
- };
- return 1;
-}
-
-/* make sure it works for the last rule in a file */
-
-#ifdef __USE_PROTOS
-int MR_offsetFromRule(Node *n)
-#else
-int MR_offsetFromRule(n)
- Node *n;
-#endif
-{
- Junction *j;
- int offset=(-1);
-
- for (j=SynDiag; j != NULL; j=(Junction *)j->p2) {
-
- require (j->ntype == nJunction && j->jtype == RuleBlk,"Not a rule block");
-
- if (n->file < j->file) {
- return offset;
- };
- if (n->file == j->file) {
- if (n->line < j->line) {
- return (offset < 0) ? 0 : offset;
- } else {
- offset=n->line - j->line;
- if (offset == 0) return 0;
- };
- };
- };
- return offset;
-}
-
-#define ruleNameMax 50
-
-static char ruleNameStatic1[ruleNameMax];
-static char ruleNameStatic2[ruleNameMax+10];
-
-#ifdef __USE_PROTOS
-char * MR_ruleNamePlusOffset(Node *n)
-#else
-char * MR_ruleNamePlusOffset(n)
- Node *n;
-#endif
-{
- int offset=MR_offsetFromRule(n);
-
- strncpy(ruleNameStatic1,n->rname,ruleNameMax);
- if (offset < 0) {
- sprintf(ruleNameStatic2,"%s/?",ruleNameStatic1);
- } else {
- sprintf(ruleNameStatic2,"%s/%d",ruleNameStatic1,offset+1);
- };
- return ruleNameStatic2;
-}
-
-#ifdef __USE_PROTOS
-int MR_max_height_of_tree(Tree *t)
-#else
-int MR_max_height_of_tree(t)
- Tree *t;
-#endif
-{
- int h;
- int height=0;
- Tree *u;
-
- if (t == NULL) return 0;
-
- require (t->token != ALT && t->token != EpToken,"MR_max_height_of_tree ALT or EpToken");
-
- for (u=t; u != NULL; u=u->right) {
- h=MR_max_height_of_tree(u->down)+1;
- if (h > height) height=h;
- };
- return height;
-}
-
-#ifdef __USE_PROTOS
-int MR_all_leaves_same_height(Tree *t,int depth)
-#else
-int MR_all_leaves_same_height(t,depth)
- Tree *t;
- int depth;
-#endif
-{
- if (t == NULL) {
- return (depth==0);
- };
-
- require (t->token != ALT && t->token != EpToken,"MR_all_leaves_same_height ALT or EpToken");
-
- if (depth == 0) {
- return 0;
- } else {
- if ( ! MR_all_leaves_same_height(t->down,depth-1)) {
- return 0;
- };
- if (t->right == NULL) {
- return 1;
- } else {
- return MR_all_leaves_same_height(t->right,depth);
- };
- };
-}
-
-#ifdef __USE_PROTOS
-void MR_projectTreeOntoSet(Tree *tree,int ck,set *ckset)
-#else
-void MR_projectTreeOntoSet(tree,ck,ckset)
- Tree *tree;
- int ck;
- set *ckset;
-#endif
-{
- if (tree == NULL) return;
-
- require(tree->token != EpToken,"MR_projectTreeOntoSet: EpToken unexpected\n");
-
- MR_projectTreeOntoSet(tree->right,ck,ckset);
- if (tree->token == ALT) {
- MR_projectTreeOntoSet(tree->down,ck,ckset);
- } else {
- if (ck > 1) {
- MR_projectTreeOntoSet(tree->down,ck-1,ckset);
- } else {
- set_orel(tree->token,ckset);
- };
- };
-}
-
-#ifdef __USE_PROTOS
-int MR_comparePredicates(Predicate *a,Predicate *b)
-#else
-int MR_comparePredicates(a,b)
- Predicate *a;
- Predicate *b;
-#endif
-{
- Predicate *p;
- Predicate *q;
-
- if (a == b) return 1;
- if (a == NULL || b == NULL ) return 0;
- if (a->down == NULL && b->down == NULL) {
-
- /* predicate->invert can be set only in the predEntry predicates */
- /* thus they are only visible after the predEntry predicates have been "unfolded" */
-
- int sameSource=(a->source == b->source);
- int sameInvert= 1 & (1 +a->inverted + b->inverted +
- a->source->inverted + b->source->inverted);
- int samePredEntry=(a->source->predEntry != NULL
- && b->source->predEntry != NULL
- && a->source->predEntry == b->source->predEntry);
- if (sameInvert && (sameSource || samePredEntry)) {
- if (MR_identicalContext(a,b)) {
- return 1;
- };
- };
- return 0;
- };
- if (a->down == NULL || b->down == NULL) return 0;
- if (a->expr != b->expr) return 0;
-
- for (p=a->down; p != NULL; p=p->right) {
- for (q=b->down; q != NULL; q=q->right) {
- if (MR_comparePredicates(p,q)) goto NEXT_P;
- };
- return 0;
-NEXT_P:
- continue;
- };
- return 1;
-}
-
-/*
- * action->inverted can be set only when a predicate symbol appears in
- * a rule: "rule : <<!XXX>>? X". It cannot be set under any
- * other circumstances. In particular it cannot be set by
- * "#pred NotA !A" or by "#pred Nota <<!A>>?". The first case
- * creates a predEntry and the predicate expression of that predEntry
- * has inverted set. In the second case, the code for handling "!"
- * is only present in buildAction, which is not called by the #pred
- * semantic routines, only when a <<...>>? is recognized as part of
- * a rule definition.
- *
- * predicate->inverted can only be set by a predicate created by a #pred
- * expression, such as "#pred NotA !A" or "#pred NotXY ! (X && Y) or
- * "#pred XbarY !(X && Y)". In particular, it cannot be set by any
- * predicate expression occurring under any other circumstances.
- * The #pred predicate expresssions are stored with in predEntry->pred
- * and do not normally appear anywhere else until the predicates are
- * "unfolded" in order to recognize redundancies, conflicts, and
- * tautologies.
- *
- * The unfold routine expands all references to #pred expressions.
- *
- * The simplifyInvert goes through and propagates the invert bit so that
- * all OR and AND nodes are un-inverted.
- *
- * Note that !(A and B) => (!A or !B)
- * !(A or B) => (!A and !B)
- *
- * MR_unfold() is called to expand predicate symbols by replacing predicates
- * that reference predicate entries with the copies of the predicate entries.
- * Each reference receives a duplicate of the original. This is necessary
- * because the next phase involves simplification and removal of redundant
- * predicate nodes. Anyway, the point I'm making is that predicate->invert
- * should not be set in any predicate until it has been expanded.
- *
- * This is a recursive structure, but there is no need for "recursive expansion"
- * by which I mean a predicate symbol refers to other predicate symbols which
- * must also be expanded.
- *
- * Recursive expansion is *not* performed by this routine because it is not
- * necessary. Expansion of references is performed by predPrimary when
- * a new predicate symbol is created by referring to others in the pred expr.
- */
-
-#ifdef __USE_PROTOS
-Predicate *MR_unfold(Predicate *pred)
-#else
-Predicate *MR_unfold(pred)
- Predicate *pred;
-#endif
-{
- Predicate *result;
-
- if (pred == NULL) return NULL;
-
- pred->right=MR_unfold(pred->right);
-
- if (pred->down == NULL) {
- if (pred->source->predEntry != NULL) {
- if (pred->source->predEntry->pred == NULL) {
- ; /* do nothing */ /* a reference to a literal #pred (perhaps with "!" */
- } else {
- result=predicate_dup_without_context(pred->source->predEntry->pred);
- if (pred->inverted) {
- result->inverted=!result->inverted;
- };
- if (pred->source->inverted) {
- result->inverted=!result->inverted;
- };
- result->right=pred->right;
- pred->right=NULL;
- predicate_free(pred);
-/*** result=MR_unfold(result); *** not necessary */ /* recursive expansion */
- return result;
- };
- } else {
- ; /* do nothing */ /* an inline literal predicate */
- };
- } else {
- pred->down=MR_unfold(pred->down);
- };
- return pred;
-}
-
-/* this should be called immediately after MR_unfold() and
- at no other times
-*/
-
-#ifdef __USE_PROTOS
-void MR_simplifyInverted(Predicate *pred,int inverted)
-#else
-void MR_simplifyInverted(pred,inverted)
- Predicate *pred;
- int inverted;
-#endif
-{
- int newInverted;
-
- if (pred == NULL) return;
-
- MR_simplifyInverted(pred->right,inverted);
-
- newInverted= 1 & (inverted + pred->inverted);
-
- if (pred->down == NULL) {
- pred->inverted=newInverted;
- } else {
- if (newInverted != 0) {
- if (pred->expr == PRED_AND_LIST) {
- pred->expr=PRED_OR_LIST;
- } else {
- pred->expr=PRED_AND_LIST;
- };
- };
- pred->inverted=0;
- MR_simplifyInverted(pred->down,newInverted);
- };
-}
-
-/* only remove it from AND and OR nodes, not leaves */
-
-#ifdef __USE_PROTOS
-void MR_clearPredEntry(Predicate *p)
-#else
-void MR_clearPredEntry(p)
- Predicate *p;
-#endif
-{
- if (p == NULL) return;
- MR_clearPredEntry(p->down);
- MR_clearPredEntry(p->right);
- if (p->down != NULL) p->predEntry=NULL;
-}
-
-
-#ifdef __USE_PROTOS
-void MR_orphanRules(FILE *f)
-#else
-void MR_orphanRules(f)
- FILE *f;
-#endif
-{
- set a;
- Junction *p;
- unsigned e;
- RuleEntry *re;
-
- a=empty;
-
- if (! InfoO) return;
-
- for (p=SynDiag; p!=NULL; p = (Junction *)p->p2) {
- if ( (Junction *) (p->end)->p1 == NULL) {
- re=(RuleEntry *) hash_get(Rname,p->rname);
- require (re != NULL,"RuleEntry == NULL");
- set_orel(re->rulenum, &a);
- }
- }
-
- if (set_deg(a) > 1) {
- fprintf(f,"note: Start rules: {");
- for (; !set_nil(a); set_rm(e,a)) {
- e=set_int(a);
- fprintf(f," %s",RulePtr[e]->rname);
- };
- fprintf(f," }\n");
- };
- set_free( a );
-}
-
-/* merge (X Y) and (X) to create (X) */
-
-static int *mergeChain;
-static Tree *mergeTree;
-
-#ifdef __USE_PROTOS
-Tree *MR_merge_tree_contexts_client(Tree *t,int chain[])
-#else
-Tree *MR_merge_tree_contexts_client(t,chain)
- Tree *t;
- int chain[];
-#endif
-{
- if (t == NULL) return NULL;
- if (chain[0] == 0) {
- Tree *u=t->right;
- t->right=NULL;
- Tfree(t);
- return MR_merge_tree_contexts_client(u,&chain[0]);
- }
- if (chain[0] == t->token) {
- t->down=MR_merge_tree_contexts_client(t->down,&chain[1]);
- };
- t->right=MR_merge_tree_contexts_client(t->right,&chain[0]);
- return t;
-}
-
-#ifdef __USE_PROTOS
-void MR_iterateOverTreeContexts(Tree *t,int chain[])
-#else
-void MR_iterateOverTreeContexts(t,chain)
- Tree *t;
- int chain[];
-#endif
-{
- if (t == NULL) return;
- chain[0]=t->token;
- if (t->down != NULL) {
- MR_iterateOverTreeContexts(t->down,&chain[1]);
- } else {
- MR_merge_tree_contexts_client(mergeTree,mergeChain);
- };
- MR_iterateOverTreeContexts(t->right,&chain[0]);
- chain[0]=0;
-}
-
-#ifdef __USE_PROTOS
-Tree *MR_merge_tree_contexts(Tree *t)
-#else
-Tree *MR_merge_tree_contexts(t)
- Tree *t;
-#endif
-{
- int h=MR_max_height_of_tree(t);
-
- mergeTree=t;
- mergeChain=(int *) calloc(h+1,sizeof(int));
- require (mergeChain != NULL,"MR_merge_tree_contexts: can't alloc chain");
- MR_iterateOverTreeContexts(t,mergeChain);
- t=tshrink(t);
- t=tflatten(t);
- t=tleft_factor(t);
- free ( (char *) mergeChain);
- mergeChain=NULL;
- return t;
-}
-
-#ifdef __USE_PROTOS
-Tree *MR_compute_pred_tree_context(Predicate *p)
-#else
-Tree *MR_compute_pred_tree_context(p)
- Predicate *p;
-#endif
-{
- Tree *t;
-
- t=MR_compute_pred_tree_ctxXX(p);
- MR_merge_tree_contexts(t);
- return t;
-}
-
-#ifdef __USE_PROTOS
-void MR_guardPred_plainSet(ActionNode *anode,Predicate *pred)
-#else
-void MR_guardPred_plainSet(anode,pred)
- ActionNode *anode;
- Predicate *pred;
-#endif
-{
- Junction *j;
- Predicate *workPred;
- set maskSet;
-
- maskSet=empty;
-
- if (!MRhoisting) return;
-
- /* it doesn't really matter whether the predicate has
- depth k=1 or k>1 because we're not really looking
- at the predicate itself, just the stuff "behind"
- the predicate.
- */
-
- /* shouldn't have to worry about REACHing off the end
- of the rule containing the predicate because the
- Rule->end->halt should have been set already by the
- the code which handles RuleRef nodes.
-
- We don't want to REACH off the end of the rule because
- this would give the "global" follow context rather than
- the "local" context.
-
- r1a : (A)? => <<p>>? r2 (A|B)
- r1b : (A)? => <<p>>? r2 (A|C)
- r2 : ();
-
- For r1a we want follow of predicate = {A B}
- we want plainSet = {B}
- For r1b we want follow of predicate = {A C}
- we want plainSet = {C}
- */
-
- require (anode->next->ntype == nJunction,"MR_guardpred_plainSet not Junction");
- j=(Junction *)(anode->next);
-
- workPred=predicate_dup_without_context(pred);
- workPred->k=1;
- workPred->scontext[1]=MR_First(1,j, &(workPred->completionSet) );
- MR_complete_predicates(1,workPred);
- if (pred->k == 1) {
- maskSet=pred->scontext[1];
- } else {
- MR_projectTreeOntoSet(pred->tcontext,1,&maskSet);
- }
- pred->plainSet=set_dif(workPred->scontext[1],maskSet);
- predicate_free(workPred);
-}
-
-/*******************************************************************************/
-
-static Tree * suppressTree;
-static int * suppressChain; /* element 0 not used */
-static set * suppressSets;
-static Node * suppressNode;
-static int suppressChainLength;
-int MR_SuppressSearch=0;
-static int suppressSucceeded;
-static Predicate * suppressPredicate;
-
-#ifdef __USE_PROTOS
-int MR_isChain(Tree *t)
-#else
-int MR_isChain(t)
- Tree *t;
-#endif
-{
- Tree *u;
-
- for (u=t; u != NULL; u=u->down) {
- if (u->right != NULL) return 0;
- }
- return 1;
-}
-
-#ifdef __USE_PROTOS
-int MR_suppressK_client(Tree *tree,int tokensInChain[])
-#else
-int MR_suppressK_client(tree,tokensInChain)
- Tree *tree;
- int tokensInChain[];
-#endif
-{
- int i;
- set *save_fset;
- int save_ConstrainSearch;
- set incomplete;
- Tree *t;
-
- suppressSucceeded=0; /* volatile */
-
- if (suppressSets == NULL) {
- suppressSets=(set *) calloc (CLL_k+1,sizeof(set));
- require (suppressSets != NULL,"MR_suppressK_client: suppressSets alloc");
- };
-
- for (suppressChainLength=1;
- tokensInChain[suppressChainLength+1] != 0;
- suppressChainLength++) {};
-
- require (suppressChainLength != 0,"MR_suppressK_client: chain empty");
-
- for (i=1 ; i <= suppressChainLength ; i++) {
- set_clr(suppressSets[i]);
- set_orel( (unsigned) tokensInChain[i],
- &suppressSets[i]);
- };
-
- save_fset=fset;
- save_ConstrainSearch=ConstrainSearch;
-
- fset=suppressSets;
-
- MR_SuppressSearch=1;
- MR_AmbSourceSearch=1;
- MR_MaintainBackTrace=1;
- ConstrainSearch=1;
-
- maxk = suppressChainLength;
-
- incomplete=empty;
- t=NULL;
-
-/*** constrain = &(fset[1]); ***/
-
- MR_setConstrainPointer(&(fset[1])); /* MR18 */
-
- MR_pointerStackReset(&MR_BackTraceStack);
-
- TRAV(suppressNode,maxk,&incomplete,t);
-
- Tfree(t);
-
- require (set_nil(incomplete),"MR_suppressK_client TRAV incomplete");
- require (MR_BackTraceStack.count == 0,
- "MR_suppressK_client: MR_BackTraceStack.count != 0");
- set_free(incomplete);
-
- ConstrainSearch=save_ConstrainSearch;
- fset=save_fset;
-
- MR_AmbSourceSearch=0;
- MR_MaintainBackTrace=0;
- MR_SuppressSearch=0;
- return suppressSucceeded;
-}
-
-#ifdef __USE_PROTOS
-Tree * MR_iterateOverTreeSuppressK(Tree *t,int chain[])
-#else
-Tree * MR_iterateOverTreeSuppressK(t,chain)
- Tree *t;
- int chain[];
-#endif
-{
- if (t == NULL) return NULL;
- t->right=MR_iterateOverTreeSuppressK(t->right,&chain[0]);
- chain[0]=t->token;
- if (t->down != NULL) {
- t->down=MR_iterateOverTreeSuppressK(t->down,&chain[1]);
- if (t->down == NULL) {
- Tree *u=t->right;
- t->right=NULL;
- Tfree(t);
- chain[0]=0;
- return u;
- };
- } else {
- MR_suppressK_client(suppressTree,suppressChain);
- if (suppressSucceeded) {
- Tree *u=t->right;
- t->right=NULL;
- Tfree(t);
- chain[0]=0;
- return u;
- };
- };
- chain[0]=0;
- return t;
-}
-
-/* @@@ */
-
-#ifdef __USE_PROTOS
-Predicate * MR_suppressK(Node *j,Predicate *p)
-#else
-Predicate * MR_suppressK(j,p)
- Node *j;
- Predicate *p;
-#endif
-{
- Predicate *result;
- int guardPred=0;
- int ampersandPred=0;
- Node *nodePrime;
-
- if (! MRhoistingk) {
- return p;
- }
-
- if (! MRhoisting) return p;
- if (CLL_k == 1) return p;
-
- if (suppressChain == NULL) {
- suppressChain=(int *) calloc(CLL_k+2,sizeof(int));
- require (suppressChain != NULL,"MR_suppressK: can't allocate chain");
- }
-
- if (p == NULL) return NULL;
-
- if (j->ntype == nJunction) {
- nodePrime=(Node *) MR_junctionWithoutP2( (Junction *) j);
- } else {
- nodePrime=j;
- };
-
- p->down=MR_suppressK(j,p->down);
- p->right=MR_suppressK(j,p->right);
- if (p->down != NULL) {
- result=p;
- goto EXIT;
- };
- if (p->k == 1) {
- result=p;
- goto EXIT;
- };
-
- if (p->source != NULL) {
- if (p->source->guardpred != NULL) guardPred=1;
- if (p->source->ampersandPred != NULL) ampersandPred=1;
- }
-
- suppressPredicate=p;
- suppressNode=nodePrime; /* was j*/
-
- suppressTree=p->tcontext;
-
- if (guardPred || ampersandPred) {
- p->tcontext=MR_iterateOverTreeSuppressK(suppressTree,&suppressChain[1]);
- if (p->tcontext == NULL) {
- predicate_free(p);
- result=NULL;
- goto EXIT;
- };
- } else {
- if (MR_isChain(p->tcontext)) {
- p->tcontext=MR_iterateOverTreeSuppressK(suppressTree,&suppressChain[1]);
- if (p->tcontext == NULL) {
- predicate_free(p);
- result=NULL;
- goto EXIT;
- };
- }
- }
- result=p;
-EXIT:
- return result;
-}
-
-#ifdef __USE_PROTOS
-void MR_suppressSearchReport(void)
-#else
-void MR_suppressSearchReport()
-#endif
-{
- int i;
- Node *p;
- TokNode *tn;
- int depth;
- set setAnd;
-
- /* number of tokens in back trace stack matches length of chain */
-
- depth=0;
- for (i=0; i < MR_BackTraceStack.count ; i++) {
- p=(Node *) MR_BackTraceStack.data[i];
- if (p->ntype == nToken) depth++;
- };
-
- require (depth == suppressChainLength,"depth > suppressChainLength");
-
- /* token codes match chain */
-
- depth=0;
- for (i=0; i < MR_BackTraceStack.count ; i++) {
- p=(Node *) MR_BackTraceStack.data[i];
- if (p->ntype != nToken) continue;
- tn=(TokNode *) p;
- depth++;
- if (set_nil(tn->tset)) {
- require(set_el( (unsigned) tn->token,fset[depth]),
- "MR_suppressSearchReport: no match to #token in chain");
- } else {
- setAnd=set_and(fset[depth],tn->tset);
- require(!set_nil(setAnd),
- "MR_suppressSearchReport: no match to #token set in chain");
- set_free(setAnd);
- };
- };
-
- /* have a match - now remove it from the predicate */
-
- suppressSucceeded=1;
-
- if (suppressSucceeded) {
- fprintf(output,"\n");
- fprintf(output,"#if 0\n");
- fprintf(output,"\n");
- fprintf(output,"Part (or all) of predicate with depth > 1 suppressed by ");
- fprintf(output,"alternative without predicate\n\n");
- MR_dumpPred(suppressPredicate,1);
- fprintf(output,"The token sequence which is suppressed:");
- fprintf(output," (");
- for (i=1; i <= suppressChainLength; i++) {
- fprintf(output," %s",TerminalString(suppressChain[i]));
- };
- fprintf(output," )\n");
- fprintf(output,"The sequence of references which generate that sequence of tokens:\n\n");
-
- MR_backTraceDumpItemReset();
-
- for (i=0; i < MR_BackTraceStack.count ; i++) {
- MR_backTraceDumpItem(output,0,(Node *) MR_BackTraceStack.data[i]);
- };
- fprintf(output,"\n");
- fprintf(output,"#endif\n");
- }
-}
-
-#ifdef __USE_PROTOS
-void MR_markCompromisedRule(Node *n)
-#else
-void MR_markCompromisedRule(n)
- Node *n;
-#endif
-{
- RuleEntry *q;
- Node *mark=NULL;
- Junction *j;
-
- if (n->ntype == nRuleRef) {
- mark=(Node *) MR_ruleReferenced( (RuleRefNode *) n);
- } else if (n->ntype == nToken) {
- mark=n;
- } else if (n->ntype == nJunction) {
- j=(Junction *)n;
- switch (j->jtype) {
- case aOptBlk:
- case aLoopBlk:
- case RuleBlk:
- case EndRule:
- case aPlusBlk:
- case aLoopBegin:
- mark=n;
- break;
- default:
- break;
- };
- }
-
- if (mark == NULL) return;
-
- require (RulePtr != NULL,"RulePtr not initialized");
-
- q = (RuleEntry *) hash_get(Rname,mark->rname);
- require (q != NULL,"RuleEntry not found");
- set_orel(q->rulenum,&MR_CompromisedRules);
-}
-
-#ifdef __USE_PROTOS
-void MR_alphaBetaTraceReport(void)
-#else
-void MR_alphaBetaTraceReport()
-#endif
-{
- int i;
-
- if (! AlphaBetaTrace) return;
-
- MR_AlphaBetaMessageCount++;
-
- fprintf(output,"\n");
- fprintf(output,"#if 0\n");
- fprintf(output,"\n");
- fprintf(output,"Trace of references leading to attempt to compute the follow set of\n");
- fprintf(output,"alpha in an \"(alpha)? beta\" block. It is not possible for antlr to\n");
- fprintf(output,"compute this follow set because it is not known what part of beta has\n");
- fprintf(output,"already been matched by alpha and what part remains to be matched.\n");
- fprintf(output,"\n");
- fprintf(output,"Rules which make use of the incorrect follow set will also be incorrect\n");
- fprintf(output,"\n");
-
- MR_backTraceDumpItemReset();
-
- for (i=0; i < MR_BackTraceStack.count ; i++) {
- MR_backTraceDumpItem(output,0,(Node *) MR_BackTraceStack.data[i]);
- if (i < MR_BackTraceStack.count-1) {
- MR_markCompromisedRule( (Node *) MR_BackTraceStack.data[i]);
- };
- };
- fprintf(output,"\n");
- fprintf(output,"#endif\n");
-}
-
-#ifdef __USE_PROTOS
-void MR_dumpRuleSet(set s)
-#else
-void MR_dumpRuleSet(s)
- set s;
-#endif
-{
- unsigned *cursor;
- unsigned *origin=set_pdq(s);
-
- require(origin != NULL,"set_pdq failed");
-
- if (RulePtr == NULL) {
- fprintf(stderr,"RulePtr[] not yet initialized");
- } else {
- for (cursor=origin; *cursor != nil ; cursor++) {
-/**** if (cursor != origin) fprintf(stderr,","); ****/
- fprintf(stderr," %s",RulePtr[*cursor]->rname);
- fprintf(stderr,"\n");
- };
- free( (char *) origin);
- };
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/parser.dlg b/BaseTools/Source/C/VfrCompile/Pccts/antlr/parser.dlg
deleted file mode 100644
index 8c43dff300..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/parser.dlg
+++ /dev/null
@@ -1,1387 +0,0 @@
-<<
-/* parser.dlg -- DLG Description of scanner
- *
- * Generated from: antlr.g
- *
- * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
- * Purdue University Electrical Engineering
- * With AHPCRC, University of Minnesota
- * ANTLR Version 1.33MR33
- */
-
-#define ANTLR_VERSION 13333
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-#include "pcctscfg.h"
-#include "set.h"
-#include <ctype.h>
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#define zzcr_attr(attr,tok,t)
-#include "antlr.h"
-#include "tokens.h"
-#include "dlgdef.h"
-LOOKAHEAD
-
-void
-#ifdef __USE_PROTOS
-zzerraction(void)
-#else
-zzerraction()
-#endif
-{
- (*zzerr)("invalid token");
- zzadvance();
- zzskip();
-}
->>
-
-<<%%lexaction
-
-/* maintained, but not used for now */
-set AST_nodes_refd_in_actions = set_init;
-int inAlt = 0;
-set attribsRefdFromAction = set_init; /* MR20 */
-int UsedOldStyleAttrib = 0;
-int UsedNewStyleLabel = 0;
-#ifdef __USE_PROTOS
-char *inline_set(char *);
-#else
-char *inline_set();
-#endif
-
-/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */
-/* MR1 in DLG action */
-
-int tokenActionActive=0; /* MR1 */
-
-
->>
-
-<<%%lexaction
-
-
-static char *
-#ifdef __USE_PROTOS
-getFileNameFromTheLineInfo(char *toStr, char *fromStr)
-#else
-getFileNameFromTheLineInfo(toStr, fromStr)
-char *toStr, *fromStr;
-#endif
-{
- int i, j, k;
-
- if (!fromStr || !toStr) return toStr;
-
- /* find the first " */
-
- for (i=0;
- (i<MaxFileName) &&
- (fromStr[i] != '\n') &&
- (fromStr[i] != '\r') &&
- (fromStr[i] != '\"');
- i++) /* nothing */ ;
-
- if ( (i == MaxFileName) ||
- (fromStr[i] == '\n') ||
- (fromStr[i] == '\r') ) {
- return toStr;
-}
-
- /* find the second " */
-
- for (j=i+1;
-(j<MaxFileName) &&
-(fromStr[j] != '\n') &&
-(fromStr[j] != '\r') &&
-(fromStr[j] != '\"');
-j++) /* nothing */ ;
-
- if ((j == MaxFileName) ||
-(fromStr[j] == '\n') ||
-(fromStr[j] == '\r') ) {
- return toStr;
-}
-
- /* go back until the last / or \ */
-
- for (k=j-1;
-(fromStr[k] != '\"') &&
-(fromStr[k] != '/') &&
-(fromStr[k] != '\\');
-k--) /* nothing */ ;
-
- /* copy the string after " / or \ into toStr */
-
- for (i=k+1; fromStr[i] != '\"'; i++) {
-toStr[i-k-1] = fromStr[i];
-}
-
- toStr[i-k-1] = '\0';
-
- return toStr;
-}
-
-/* MR14 end of a block to support #line in antlr source code */
-
-
->>
-
-<<%%lexaction
-
-#ifdef __USE_PROTOS
-void mark_label_used_in_sem_pred(LabelEntry *le) /* MR10 */
-#else
-void mark_label_used_in_sem_pred(le) /* MR10 */
-LabelEntry *le;
-#endif
-{
- TokNode *tn;
- require (le->elem->ntype == nToken,"mark_label_used... ntype != nToken");
- tn=(TokNode *)le->elem;
- require (tn->label != 0,"mark_label_used... TokNode has no label");
- tn->label_used_in_semantic_pred=1;
-}
->>
-
-
-%%START
-
-@
- <<
- NLA = Eof;
- /* L o o k F o r A n o t h e r F i l e */
- {
- FILE *new_input;
- new_input = NextFile();
- if ( new_input == NULL ) { NLA=Eof; return; }
- fclose( input );
- input = new_input;
- zzrdstream( input );
- zzskip(); /* Skip the Eof (@) char i.e continue */
- }
- >>
-
-[\t\ ]+
- <<
- NLA = 76;
- zzskip();
- >>
-
-\n|\r|\r\n
- <<
- NLA = 77;
- zzline++; zzskip();
- >>
-
-\[
- <<
- NLA = 78;
- zzmode(ACTIONS); zzmore();
- istackreset();
- pushint(']');
- >>
-
-\<\<
- <<
- NLA = 79;
- action_file=CurFile; action_line=zzline;
- zzmode(ACTIONS); zzmore();
- list_free(&CurActionLabels,0); /* MR10 */
- numericActionLabel=0; /* MR10 */
- istackreset();
- pushint('>');
- >>
-
-\"
- <<
- NLA = 80;
- zzmode(STRINGS); zzmore();
- >>
-
-/\*
- <<
- NLA = 81;
- zzmode(COMMENTS); zzskip();
- >>
-
-\*/
- <<
- NLA = 82;
- warn("Missing /*; found dangling */"); zzskip();
- >>
-
-//
- <<
- NLA = 83;
- zzmode(CPP_COMMENTS); zzskip();
- >>
-
-#line[\ \t]* [0-9]+ {[\ \t]* \"~[\"]+\" ([\ \t]* [0-9]*)* } (\n|\r|\r\n)
- <<
- NLA = 84;
-
- zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore();
- getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr);
- >>
-
-#line ~[\n\r]* (\n|\r|\r\n)
- <<
- NLA = 85;
-
- zzline++; zzmore();
- >>
-
-\>\>
- <<
- NLA = 86;
- warn("Missing <<; found dangling \>\>"); zzskip();
- >>
-
-.
- <<
- NLA = WildCard;
- >>
-
-\@
- <<
- NLA = 88;
- FoundException = 1; /* MR6 */
- FoundAtOperator = 1;
- >>
-
-{\\}#pragma
- <<
- NLA = Pragma;
- >>
-
-{\\}#FirstSetSymbol
- <<
- NLA = FirstSetSymbol;
- >>
-
-{\\}#header
- <<
- NLA = 94;
- >>
-
-{\\}#first
- <<
- NLA = 95;
- >>
-
-{\\}#parser
- <<
- NLA = 96;
- >>
-
-{\\}#tokdefs
- <<
- NLA = 97;
- >>
-
-\}
- <<
- NLA = 98;
- >>
-
-class
- <<
- NLA = 99;
- >>
-
-\{
- <<
- NLA = 102;
- >>
-
-!
- <<
- NLA = 103;
- >>
-
-\<
- <<
- NLA = 104;
- >>
-
-\>
- <<
- NLA = 105;
- >>
-
-:
- <<
- NLA = 106;
- >>
-
-;
- <<
- NLA = 107;
- >>
-
-{\\}#lexaction
- <<
- NLA = 108;
- >>
-
-{\\}#lexmember
- <<
- NLA = 109;
- >>
-
-{\\}#lexprefix
- <<
- NLA = 110;
- >>
-
-{\\}#pred
- <<
- NLA = 111;
- >>
-
-\|\|
- <<
- NLA = 112;
- >>
-
-&&
- <<
- NLA = 113;
- >>
-
-\(
- <<
- NLA = 114;
- >>
-
-\)
- <<
- NLA = 115;
- >>
-
-{\\}#lexclass
- <<
- NLA = 116;
- >>
-
-{\\}#errclass
- <<
- NLA = 117;
- >>
-
-{\\}#tokclass
- <<
- NLA = 118;
- >>
-
-..
- <<
- NLA = 119;
- >>
-
-{\\}#token
- <<
- NLA = 120;
- >>
-
-=
- <<
- NLA = 121;
- >>
-
-[0-9]+
- <<
- NLA = 122;
- >>
-
-\|
- <<
- NLA = 123;
- >>
-
-\~
- <<
- NLA = 124;
- >>
-
-^
- <<
- NLA = 125;
- >>
-
-approx
- <<
- NLA = 126;
- >>
-
-LL\(1\)
- <<
- NLA = 127;
- >>
-
-LL\(2\)
- <<
- NLA = 128;
- >>
-
-\*
- <<
- NLA = 129;
- >>
-
-\+
- <<
- NLA = 130;
- >>
-
-?
- <<
- NLA = 131;
- >>
-
-=>
- <<
- NLA = 132;
- >>
-
-exception
- <<
- NLA = 133;
- >>
-
-default
- <<
- NLA = 134;
- >>
-
-catch
- <<
- NLA = 135;
- >>
-
-[a-z] [A-Za-z0-9_]*
- <<
- NLA = NonTerminal;
-
- while ( zzchar==' ' || zzchar=='\t' ) {
- zzadvance();
- }
- if ( zzchar == ':' && inAlt ) NLA = LABEL;
- >>
-
-[A-Z] [A-Za-z0-9_]*
- <<
- NLA = TokenTerm;
-
- while ( zzchar==' ' || zzchar=='\t' ) {
- zzadvance();
- }
- if ( zzchar == ':' && inAlt ) NLA = LABEL;
- >>
-
-{\\}#[A-Za-z0-9_]*
- <<
- NLA = 136;
- warn(eMsg1("unknown meta-op: %s",LATEXT(1))); zzskip();
- >>
-
-
-%%STRINGS
-
-@
- <<
- NLA = Eof;
- >>
-
-\"
- <<
- NLA = QuotedTerm;
- zzmode(START);
- >>
-
-\n|\r|\r\n
- <<
- NLA = 3;
-
- zzline++;
- warn("eoln found in string");
- zzskip();
- >>
-
-\\(\n|\r|\r\n)
- <<
- NLA = 4;
- zzline++; zzmore();
- >>
-
-\\~[]
- <<
- NLA = 5;
- zzmore();
- >>
-
-~[\n\r\"\\]+
- <<
- NLA = 6;
- zzmore();
- >>
-
-
-%%ACTION_STRINGS
-
-@
- <<
- NLA = Eof;
- >>
-
-\"
- <<
- NLA = 7;
- zzmode(ACTIONS); zzmore();
- >>
-
-\n|\r|\r\n
- <<
- NLA = 8;
-
- zzline++;
- warn("eoln found in string (in user action)");
- zzskip();
- >>
-
-\\(\n|\r|\r\n)
- <<
- NLA = 9;
- zzline++; zzmore();
- >>
-
-\\~[]
- <<
- NLA = 10;
- zzmore();
- >>
-
-~[\n\r\"\\]+
- <<
- NLA = 11;
- zzmore();
- >>
-
-
-%%ACTION_CHARS
-
-@
- <<
- NLA = Eof;
- >>
-
-'
- <<
- NLA = 12;
- zzmode(ACTIONS); zzmore();
- >>
-
-\n|\r|\r\n
- <<
- NLA = 13;
-
- zzline++;
- warn("eoln found in char literal (in user action)");
- zzskip();
- >>
-
-\\~[]
- <<
- NLA = 14;
- zzmore();
- >>
-
-~[\n\r'\\]+
- <<
- NLA = 15;
- zzmore();
- >>
-
-
-%%ACTION_COMMENTS
-
-@
- <<
- NLA = Eof;
- >>
-
-\*/
- <<
- NLA = 16;
- zzmode(ACTIONS); zzmore();
- >>
-
-\*
- <<
- NLA = 17;
- zzmore();
- >>
-
-\n|\r|\r\n
- <<
- NLA = 18;
- zzline++; zzmore(); DAWDLE;
- >>
-
-~[\n\r\*]+
- <<
- NLA = 19;
- zzmore();
- >>
-
-
-%%TOK_DEF_COMMENTS
-
-@
- <<
- NLA = Eof;
- >>
-
-\*/
- <<
- NLA = 20;
- zzmode(PARSE_ENUM_FILE);
- zzmore();
- >>
-
-\*
- <<
- NLA = 21;
- zzmore();
- >>
-
-\n|\r|\r\n
- <<
- NLA = 22;
- zzline++; zzmore(); DAWDLE;
- >>
-
-~[\n\r\*]+
- <<
- NLA = 23;
- zzmore();
- >>
-
-
-%%TOK_DEF_CPP_COMMENTS
-
-@
- <<
- NLA = Eof;
- >>
-
-\n|\r|\r\n
- <<
- NLA = 24;
- zzline++; zzmode(PARSE_ENUM_FILE); zzskip(); DAWDLE;
- >>
-
-~[\n\r]+
- <<
- NLA = 25;
- zzskip();
- >>
-
-
-%%ACTION_CPP_COMMENTS
-
-@
- <<
- NLA = Eof;
- >>
-
-\n|\r|\r\n
- <<
- NLA = 26;
- zzline++; zzmode(ACTIONS); zzmore(); DAWDLE;
- >>
-
-~[\n\r]+
- <<
- NLA = 27;
- zzmore();
- >>
-
-
-%%CPP_COMMENTS
-
-@
- <<
- NLA = Eof;
- >>
-
-\n|\r|\r\n
- <<
- NLA = 28;
- zzline++; zzmode(START); zzskip(); DAWDLE;
- >>
-
-~[\n\r]+
- <<
- NLA = 29;
- zzskip();
- >>
-
-
-%%COMMENTS
-
-@
- <<
- NLA = Eof;
- >>
-
-\*/
- <<
- NLA = 30;
- zzmode(START); zzskip();
- >>
-
-\*
- <<
- NLA = 31;
- zzskip();
- >>
-
-\n|\r|\r\n
- <<
- NLA = 32;
- zzline++; zzskip(); DAWDLE;
- >>
-
-~[\n\r\*]+
- <<
- NLA = 33;
- zzskip();
- >>
-
-
-%%ACTIONS
-
-@
- <<
- NLA = Eof;
- >>
-
-\>\>
- <<
- NLA = Action;
- /* these do not nest */
- zzmode(START);
- NLATEXT[0] = ' ';
- NLATEXT[1] = ' ';
- zzbegexpr[0] = ' ';
- zzbegexpr[1] = ' ';
- if ( zzbufovf ) {
- err( eMsgd("action buffer overflow; size %d",ZZLEXBUFSIZE));
- }
-
-/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */
- /* MR1 in DLG action */
- /* MR1 Doesn't matter what kind of action it is - reset*/
-
- tokenActionActive=0; /* MR1 */
- >>
-
-\>\>?
- <<
- NLA = Pred;
- /* these do not nest */
- zzmode(START);
- NLATEXT[0] = ' ';
- NLATEXT[1] = ' ';
- zzbegexpr[0] = '\0';
- if ( zzbufovf ) {
- err( eMsgd("predicate buffer overflow; size %d",ZZLEXBUFSIZE));
- };
-#ifdef __cplusplus__
- /* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred);
-#else
-#ifdef __STDC__
- /* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred);
-#else
-#ifdef __USE_PROTOS
- /* MRxx */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred);
-#else
- /* MR10 */ list_apply(CurActionLabels,mark_label_used_in_sem_pred);
-#endif
-#endif
-#endif
- >>
-
-\]
- <<
- NLA = PassAction;
- if ( topint() == ']' ) {
- popint();
- if ( istackempty() ) /* terminate action */
- {
- zzmode(START);
- NLATEXT[0] = ' ';
- zzbegexpr[0] = ' ';
- if ( zzbufovf ) {
- err( eMsgd("parameter buffer overflow; size %d",ZZLEXBUFSIZE));
- }
- }
- else {
- /* terminate $[..] and #[..] */
- if ( GenCC ) zzreplstr("))");
- else zzreplstr(")");
- zzmore();
- }
- }
- else if ( topint() == '|' ) { /* end of simple [...] */
- popint();
- zzmore();
- }
- else zzmore();
- >>
-
-consumeUntil\( [\ \t]* \{~[\}]+\} [\ \t]* \)
- <<
- NLA = 37;
-
- zzmore();
- zzreplstr(inline_set(zzbegexpr+
- strlen("consumeUntil(")));
- >>
-
-consumeUntil\( ~[\)]+ \)
- <<
- NLA = 38;
- zzmore();
- >>
-
-\n|\r|\r\n
- <<
- NLA = 39;
- zzline++; zzmore(); DAWDLE;
- >>
-
-\>
- <<
- NLA = 40;
- zzmore();
- >>
-
-$
- <<
- NLA = 41;
- zzmore();
- >>
-
-$$
- <<
- NLA = 42;
- if ( !GenCC ) {zzreplstr("zzaRet"); zzmore();}
- else err("$$ use invalid in C++ mode");
- >>
-
-$\[\]
- <<
- NLA = 43;
- if ( !GenCC ) {zzreplstr("zzempty_attr"); zzmore();}
- else err("$[] use invalid in C++ mode");
- >>
-
-$\[
- <<
- NLA = 44;
-
- pushint(']');
- if ( !GenCC ) zzreplstr("zzconstr_attr(");
- else err("$[..] use invalid in C++ mode");
- zzmore();
- >>
-
-$[0-9]+
- <<
- NLA = 45;
- {
- static char buf[100];
- numericActionLabel=1; /* MR10 */
- if ( strlen(zzbegexpr)>(size_t)85 )
- fatal("$i attrib ref too big");
- set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction);
- if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s)",
- BlkLevel-1,zzbegexpr+1);
- else sprintf(buf,"_t%d%s",
- BlkLevel-1,zzbegexpr+1);
- zzreplstr(buf);
- zzmore();
- UsedOldStyleAttrib = 1;
- if ( UsedNewStyleLabel )
- err("cannot mix old-style $i with new-style labels");
- }
- >>
-
-$[0-9]+.
- <<
- NLA = 46;
- {
- static char buf[100];
- numericActionLabel=1; /* MR10 */
- if ( strlen(zzbegexpr)>(size_t)85 )
- fatal("$i.field attrib ref too big");
- zzbegexpr[strlen(zzbegexpr)-1] = ' ';
- set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction);
- if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s).",
- BlkLevel-1,zzbegexpr+1);
- else sprintf(buf,"_t%d%s.",
- BlkLevel-1,zzbegexpr+1);
- zzreplstr(buf);
- zzmore();
- UsedOldStyleAttrib = 1;
- if ( UsedNewStyleLabel )
- err("cannot mix old-style $i with new-style labels");
- }
- >>
-
-$[0-9]+.[0-9]+
- <<
- NLA = 47;
- {
- static char buf[100];
- static char i[20], j[20];
- char *p,*q;
- numericActionLabel=1; /* MR10 */
- if (strlen(zzbegexpr)>(size_t)85) fatal("$i.j attrib ref too big");
- for (p=zzbegexpr+1,q= &i[0]; *p!='.'; p++) {
- if ( q == &i[20] )
- fatalFL("i of $i.j attrib ref too big",
- FileStr[CurFile], zzline );
- *q++ = *p;
- }
- *q = '\0';
- for (p++, q= &j[0]; *p!='\0'; p++) {
- if ( q == &j[20] )
- fatalFL("j of $i.j attrib ref too big",
- FileStr[CurFile], zzline );
- *q++ = *p;
- }
- *q = '\0';
- if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%s,%s)",i,j);
- else sprintf(buf,"_t%s%s",i,j);
- zzreplstr(buf);
- zzmore();
- UsedOldStyleAttrib = 1;
- if ( UsedNewStyleLabel )
- err("cannot mix old-style $i with new-style labels");
- }
- >>
-
-$[_a-zA-Z][_a-zA-Z0-9]*
- <<
- NLA = 48;
- { static char buf[300]; LabelEntry *el;
- zzbegexpr[0] = ' ';
- if ( CurRule != NULL &&
- strcmp(CurRule, &zzbegexpr[1])==0 ) {
- if ( !GenCC ) zzreplstr("zzaRet");
- }
- else if ( CurRetDef != NULL &&
- strmember(CurRetDef, &zzbegexpr[1])) {
- if ( hasMultipleOperands( CurRetDef ) ) {
- require (strlen(zzbegexpr)<=(size_t)285,
- "$retval attrib ref too big");
- sprintf(buf,"_retv.%s",&zzbegexpr[1]);
- zzreplstr(buf);
- }
- else zzreplstr("_retv");
- }
- else if ( CurParmDef != NULL &&
- strmember(CurParmDef, &zzbegexpr[1])) {
- ;
- }
- else if ( Elabel==NULL ) {
- { err("$-variables in actions outside of rules are not allowed"); }
- } else if ( (el=(LabelEntry *)hash_get(Elabel, &zzbegexpr[1]))!=NULL ) {
- /* MR10 */
- /* MR10 */ /* element labels might exist without an elem when */
- /* MR10 */ /* it is a forward reference (to a rule) */
- /* MR10 */
- /* MR10 */ if ( GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) )
- /* MR10 */ { err(eMsg1("There are no token ptrs for rule references: '$%s'",&zzbegexpr[1])); }
- /* MR10 */
- /* MR10 */ if ( !GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) && GenAST) {
- /* MR10 */ err("You can no longer use attributes returned by rules when also using ASTs");
- /* MR10 */ err(" Use upward inheritance (\"rule >[Attrib a] : ... <<$a=...\>\>\")");
- /* MR10 */ };
- /* MR10 */
- /* MR10 */ /* keep track of <<... $label ...>> for semantic predicates in guess mode */
- /* MR10 */ /* element labels contain pointer to the owners node */
- /* MR10 */
- /* MR10 */ if (el->elem != NULL && el->elem->ntype == nToken) {
- /* MR10 */ list_add(&CurActionLabels,el);
- /* MR10 */ };
-}
-else
-warn(eMsg1("$%s not parameter, return value, (defined) element label",&zzbegexpr[1]));
-}
-zzmore();
- >>
-
-#0
- <<
- NLA = 49;
- zzreplstr("(*_root)"); zzmore(); chkGTFlag();
- >>
-
-#\[\]
- <<
- NLA = 50;
- if ( GenCC ) {
- if (NewAST) zzreplstr("(newAST)");
- else zzreplstr("(new AST)");}
- else {zzreplstr("zzastnew()");} zzmore();
- chkGTFlag();
- >>
-
-#\(\)
- <<
- NLA = 51;
- zzreplstr("NULL"); zzmore(); chkGTFlag();
- >>
-
-#[0-9]+
- <<
- NLA = 52;
- {
- static char buf[100];
- if ( strlen(zzbegexpr)>(size_t)85 )
- fatal("#i AST ref too big");
- if ( GenCC ) sprintf(buf,"_ast%d%s",BlkLevel-1,zzbegexpr+1);
- else sprintf(buf,"zzastArg(%s)",zzbegexpr+1);
- zzreplstr(buf);
- zzmore();
- set_orel(atoi(zzbegexpr+1), &AST_nodes_refd_in_actions);
- chkGTFlag();
- }
- >>
-
-#line[\ \t]* [0-9]+ {[\ \t]* \"~[\"]+\" ([\ \t]* [0-9]*)* } (\n|\r|\r\n)
- <<
- NLA = 53;
-
- zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore();
- getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr);
- >>
-
-#line ~[\n\r]* (\n|\r|\r\n)
- <<
- NLA = 54;
-
- zzline++; zzmore();
- >>
-
-#[_a-zA-Z][_a-zA-Z0-9]*
- <<
- NLA = 55;
-
- if ( !(strcmp(zzbegexpr, "#ifdef")==0 ||
- strcmp(zzbegexpr, "#if")==0 ||
- strcmp(zzbegexpr, "#else")==0 ||
- strcmp(zzbegexpr, "#endif")==0 ||
- strcmp(zzbegexpr, "#ifndef")==0 ||
- strcmp(zzbegexpr, "#define")==0 ||
- strcmp(zzbegexpr, "#pragma")==0 ||
- strcmp(zzbegexpr, "#undef")==0 ||
- strcmp(zzbegexpr, "#import")==0 ||
- strcmp(zzbegexpr, "#line")==0 ||
- strcmp(zzbegexpr, "#include")==0 ||
- strcmp(zzbegexpr, "#error")==0) )
- {
- static char buf[100];
- sprintf(buf, "%s_ast", zzbegexpr+1);
- /* MR27 */ list_add(&CurAstLabelsInActions, mystrdup(zzbegexpr+1));
- zzreplstr(buf);
- chkGTFlag();
- }
- zzmore();
- >>
-
-#\[
- <<
- NLA = 56;
-
- pushint(']');
- if ( GenCC ) {
- if (NewAST) zzreplstr("(newAST(");
- else zzreplstr("(new AST("); }
- else zzreplstr("zzmk_ast(zzastnew(),");
- zzmore();
- chkGTFlag();
- >>
-
-#\(
- <<
- NLA = 57;
-
- pushint('}');
- if ( GenCC ) {
- if (tmakeInParser) {
- zzreplstr("tmake(");
- }
- else {
- zzreplstr("ASTBase::tmake(");
- }
- }
- else {
- zzreplstr("zztmake(");
- }
- zzmore();
- chkGTFlag();
- >>
-
-#
- <<
- NLA = 58;
- zzmore();
- >>
-
-\)
- <<
- NLA = 59;
-
- if ( istackempty() )
- zzmore();
- else if ( topint()==')' ) {
- popint();
- }
- else if ( topint()=='}' ) {
- popint();
- /* terminate #(..) */
- zzreplstr(", NULL)");
- }
- zzmore();
- >>
-
-\[
- <<
- NLA = 60;
-
- pushint('|'); /* look for '|' to terminate simple [...] */
- zzmore();
- >>
-
-\(
- <<
- NLA = 61;
-
- pushint(')');
- zzmore();
- >>
-
-\\\]
- <<
- NLA = 62;
- zzreplstr("]"); zzmore();
- >>
-
-\\\)
- <<
- NLA = 63;
- zzreplstr(")"); zzmore();
- >>
-
-\\>
- <<
- NLA = 64;
- if (! tokenActionActive) zzreplstr(">"); /* MR1 */
- zzmore(); /* MR1 */
- >>
-
-'
- <<
- NLA = 65;
- zzmode(ACTION_CHARS); zzmore();
- >>
-
-\"
- <<
- NLA = 66;
- zzmode(ACTION_STRINGS); zzmore();
- >>
-
-\\$
- <<
- NLA = 67;
- zzreplstr("$"); zzmore();
- >>
-
-\\#
- <<
- NLA = 68;
- zzreplstr("#"); zzmore();
- >>
-
-\\(\n|\r|\r\n)
- <<
- NLA = 69;
- zzline++; zzmore();
- >>
-
-\\~[\]\)>$#]
- <<
- NLA = 70;
- zzmore();
- >>
-
-/
- <<
- NLA = 71;
- zzmore();
- >>
-
-/\*
- <<
- NLA = 72;
- zzmode(ACTION_COMMENTS); zzmore();
- >>
-
-\*/
- <<
- NLA = 73;
- warn("Missing /*; found dangling */ in action"); zzmore();
- >>
-
-//
- <<
- NLA = 74;
- zzmode(ACTION_CPP_COMMENTS); zzmore();
- >>
-
-~[\n\r\)\(\\$#\>\]\[\"'/]+
- <<
- NLA = 75;
- zzmore();
- >>
-
-
-%%PARSE_ENUM_FILE
-
-@
- <<
- NLA = Eof;
- ;
- >>
-
-[\t\ ]+
- <<
- NLA = 137;
- zzskip();
- >>
-
-\n|\r|\r\n
- <<
- NLA = 138;
- zzline++; zzskip();
- >>
-
-//
- <<
- NLA = 139;
- zzmode(TOK_DEF_CPP_COMMENTS); zzmore();
- >>
-
-/\*
- <<
- NLA = 140;
- zzmode(TOK_DEF_COMMENTS); zzskip();
- >>
-
-#ifdef
- <<
- NLA = 141;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- >>
-
-#if
- <<
- NLA = 142;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- >>
-
-#ifndef
- <<
- NLA = 143;
- ;
- >>
-
-#else
- <<
- NLA = 144;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- >>
-
-#endif
- <<
- NLA = 145;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- >>
-
-#undef
- <<
- NLA = 146;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- >>
-
-#import
- <<
- NLA = 147;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- >>
-
-#define
- <<
- NLA = 149;
- >>
-
-enum
- <<
- NLA = 151;
- >>
-
-\{
- <<
- NLA = 152;
- >>
-
-=
- <<
- NLA = 153;
- >>
-
-,
- <<
- NLA = 154;
- >>
-
-\}
- <<
- NLA = 155;
- >>
-
-;
- <<
- NLA = 156;
- >>
-
-[0-9]+
- <<
- NLA = INT;
- >>
-
-[a-zA-Z_][_a-zA-Z0-9]*
- <<
- NLA = ID;
- >>
-
-%%
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/pred.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/pred.c
deleted file mode 100644
index eb11c4d950..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/pred.c
+++ /dev/null
@@ -1,821 +0,0 @@
-/*
- * pred.c -- source for predicate detection, manipulation
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include "pcctscfg.h"
-#include "set.h"
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#include "dlgdef.h"
-#include <ctype.h>
-
-#ifdef __USE_PROTOS
-static void complete_context_sets(RuleRefNode *, Predicate *);
-static void complete_context_trees(RuleRefNode *, Predicate *);
-#else
-static void complete_context_sets();
-static void complete_context_trees();
-#endif
-
-char *PRED_AND_LIST = "AND";
-char *PRED_OR_LIST = "OR";
-
-/*
- * In C mode, return the largest constant integer found as the
- * sole argument to LATEXT(i).
- *
- * In C++ mode, return the largest constant integer found as the
- * sole argument to LT(i) given that the char before is nonalpha.
- */
-
-int
-#ifdef __USE_PROTOS
-predicateLookaheadDepth(ActionNode *a)
-#else
-predicateLookaheadDepth(a)
-ActionNode *a;
-#endif
-{
- int max_k=0;
-
- if (a->predEntry != NULL) {
- MR_pred_depth(a->predEntry->pred,&max_k);
- goto PREDENTRY_EXIT;
- }
-
- if ( GenCC )
- {
- /* scan for LT(i) */
- int k = 0;
- char *p = a->action;
- while ( p!=NULL )
- {
- p = strstr(p, "LT(");
- if ( p!=NULL )
- {
- if ( p>=a->action && !isalpha(*(p-1)) )
- {
- k = atoi(p+strlen("LT("));
- if ( k>max_k ) max_k=k;
- }
- p += strlen("LT(");
- }
- }
- }
- else {
- /* scan for LATEXT(i) */
- int k = 0;
- char *p = a->action;
- while ( p!=NULL )
- {
- p = strstr(p, "LATEXT(");
- if ( p!=NULL )
- {
- p += strlen("LATEXT(");
- k = atoi(p);
- if ( k>max_k ) max_k=k;
- }
- }
- }
-
- if (max_k==0) {
- max_k = 1; /* MR33 Badly designed if didn't set max_k when CLL_k = 1 */
- if (CLL_k > 1) /* MR27 Don't warn if max(k,ck) == 1 */
- {
- if ( !a->frmwarned )
- {
- a->frmwarned = 1;
- warnFL(eMsg1("predicate: %s missing, bad, or with i=0; assuming i=1",
- GenCC?"LT(i)":"LATEXT(i)"),
- FileStr[a->file], a->line);
- }
- }
- }
-
-/* MR10 */ if ( max_k > CLL_k) {
-/* MR10 */ if ( !a->frmwarned )
-/* MR10 */ {
-/* MR10 */ a->frmwarned = 1;
-/* MR11 */ errFL(eMsgd2("predicate refers to lookahead token %d. Semantic lookahead is limited to max(k,ck)==%d",
-/* MR10 */ max_k,CLL_k),
-/* MR10 */ FileStr[a->file],a->line);
-/* MR10 */ if (max_k >= OutputLL_k) {
-/* MR10 */ if (!GenCC) {
-/* MR10 */ errFL(eMsgd(" the lookahead buffer size in C mode is %d token(s) (including the one just recognized)",
-/* MR10 */ OutputLL_k),
-/* MR10 */ FileStr[a->file],a->line);
-/* MR10 */ };
-/* MR10 */ };
-/* MR10 */ };
-/* MR10 */ max_k= CLL_k;
-/* MR10 */ };
-
-PREDENTRY_EXIT:
- return max_k;
-}
-
-/* Find all predicates in a block of alternatives. DO NOT find predicates
- * behind the block because that predicate could depend on things set in
- * one of the nonoptional blocks
- */
-
-Predicate *
-#ifdef __USE_PROTOS
-find_in_aSubBlk( Junction *alt )
-#else
-find_in_aSubBlk( alt )
-Junction *alt;
-#endif
-{
- Predicate *a, *head=NULL, *tail=NULL, *root=NULL;
- Junction *p = alt;
-
- if (MRhoisting) {
- return MR_find_in_aSubBlk(alt);
- };
- for (; p!=NULL; p=(Junction *)p->p2)
- {
- /* ignore empty alts */
- if ( p->p1->ntype != nJunction ||
- ((Junction *)p->p1)->jtype != EndBlk )
- {
- a = find_predicates(p->p1); /* get preds for this alt */
- if ( a==NULL ) continue;
-
- /* make an OR list of predicates */
- if ( head==NULL )
- {
- root = new_pred();
- root->expr = PRED_OR_LIST;
- head = tail = a;
- root->down = head;
- }
- else {
- tail->right = a;
- a->left = tail;
- a->up = tail->up;
- tail = a;
- }
- }
- }
-
- /* if just one pred, remove OR root */
- if ( root!=NULL && root->down->right == NULL )
- {
- Predicate *d = root->down;
- free( (char *) root);
- return d;
- }
-
- return root;
-}
-
-Predicate *
-#ifdef __USE_PROTOS
-find_in_aOptBlk( Junction *alt )
-#else
-find_in_aOptBlk( alt )
-Junction *alt;
-#endif
-{
- return find_in_aSubBlk( alt );
-}
-
-Predicate *
-#ifdef __USE_PROTOS
-find_in_aLoopBegin( Junction *alt )
-#else
-find_in_aLoopBegin( alt )
-Junction *alt;
-#endif
-{
- return find_in_aSubBlk( (Junction *) alt->p1 ); /* get preds in alts */
-}
-
-Predicate *
-#ifdef __USE_PROTOS
-find_in_aPlusBlk( Junction *alt )
-#else
-find_in_aPlusBlk( alt )
-Junction *alt;
-#endif
-{
- require(alt!=NULL&&alt->p2!=NULL, "invalid aPlusBlk");
- return find_in_aSubBlk( alt );
-}
-
-/* Look for a predicate;
- *
- * Do not pass anything but Junction nodes; no Actions, Tokens, RuleRefs.
- * This means that a "hoisting distance" of zero is the only distance
- * allowable. Init actions are ignored.
- *
- * WARNING:
- * Assumes no (..)? block after predicate for the moment.
- * Does not check to see if pred is in production that can generate
- * a sequence contained in the set of ambiguous tuples.
- *
- * Return the predicate found if any.
- */
-
-
-Predicate *
-#ifdef __USE_PROTOS
-find_predicates( Node *alt )
-#else
-find_predicates( alt )
-Node *alt;
-#endif
-{
-#ifdef DBG_PRED
- Junction *j;
- RuleRefNode *r;
- TokNode *t;
-#endif
- Predicate *pred;
-
- if ( alt==NULL ) return NULL;
-
-#ifdef DBG_PRED
- switch ( alt->ntype )
- {
- case nJunction :
- j = (Junction *) alt;
- fprintf(stderr, "Junction(in %s)", j->rname);
- switch ( j->jtype )
- {
- case aSubBlk :
- fprintf(stderr,"aSubBlk\n");
- break;
- case aOptBlk :
- fprintf(stderr,"aOptBlk\n");
- break;
- case aLoopBegin :
- fprintf(stderr,"aLoopBeginBlk\n");
- break;
- case aLoopBlk :
- fprintf(stderr,"aLoopBlk\n");
- break;
- case aPlusBlk :
- fprintf(stderr,"aPlusBlk\n");
- break;
- case EndBlk :
- fprintf(stderr,"EndBlk\n");
- break;
- case RuleBlk :
- fprintf(stderr,"RuleBlk\n");
- break;
- case Generic :
- fprintf(stderr,"Generic\n");
- break;
- case EndRule :
- fprintf(stderr,"EndRule\n");
- break;
- }
- break;
- case nRuleRef :
- r = (RuleRefNode *) alt;
- fprintf(stderr, "RuleRef(in %s)\n", r->rname);
- break;
- case nToken :
- t = (TokNode *) alt;
- fprintf(stderr, "TokenNode(in %s)%s\n", t->rname, TokenString(t->token));
- break;
- case nAction :
- fprintf(stderr, "Action\n");
- break;
- }
-#endif
-
- switch ( alt->ntype )
- {
- case nJunction :
- {
- Predicate *a, *b;
- Junction *p = (Junction *) alt;
-
- /* lock nodes */
- if ( p->jtype==aLoopBlk || p->jtype==RuleBlk ||
- p->jtype==aPlusBlk || p->jtype==EndRule )
- {
- require(p->pred_lock!=NULL, "rJunc: lock array is NULL");
- if ( p->pred_lock[1] )
- {
- return NULL;
- }
- p->pred_lock[1] = TRUE;
- }
-
- switch ( p->jtype )
- {
- case aSubBlk :
- a = find_in_aSubBlk(p);
- return a; /* nothing is visible past this guy */
- case aOptBlk :
- a = find_in_aOptBlk(p);
- return a;
- case aLoopBegin :
- a = find_in_aLoopBegin(p);
- return a;
- case aLoopBlk :
- a = find_in_aSubBlk(p);
- p->pred_lock[1] = FALSE;
- return a;
- case aPlusBlk :
- a = find_in_aPlusBlk(p);
- p->pred_lock[1] = FALSE;
- return a; /* nothing is visible past this guy */
- case RuleBlk :
- a = find_predicates(p->p1);
- p->pred_lock[1] = FALSE;
- return a;
- case Generic :
- a = find_predicates(p->p1);
- b = find_predicates(p->p2);
- if ( p->pred_lock!=NULL ) p->pred_lock[1] = FALSE;
- if ( a==NULL ) return b;
- if ( b==NULL ) return a;
- /* otherwise OR the two preds together */
- {
- fatal_internal("hit unknown situation during predicate hoisting");
- }
- case EndBlk :
- case EndRule : /* Find no predicates after a rule ref */
- return NULL;
- default:
- fatal_internal("this cannot be printed\n");
- break;
- }
- }
- case nAction :
- {
- ActionNode *p = (ActionNode *) alt;
- if ( p->noHoist) return NULL; /* MR12c */
- if ( p->init_action ) return find_predicates(p->next);
- if ( p->is_predicate )
- {
- Tree *t=NULL;
-#ifdef DBG_PRED
- fprintf(stderr, "predicate: <<%s>>?\n", p->action);
-#endif
- if ( p->guardpred!=NULL )
- {
- pred = predicate_dup(p->guardpred);
- MR_guardPred_plainSet(p,pred); /* MR12c */
- }
- else
- {
- pred = new_pred();
- pred->k = predicateLookaheadDepth(p);
- pred->source = p;
- pred->expr = p->action;
- if ( HoistPredicateContext && pred->k > 1 )
- {
- /* MR30 No need to use first_item_is_guess_block_extra
- since we know this is an action, not a (...)* or
- (...)+ block.
- */
-
- if ( first_item_is_guess_block((Junction *)p->next) )
- {
- warnFL("cannot compute context of predicate in front of (..)? block",
- FileStr[p->file], p->line);
- }
- else
- {
- ConstrainSearch = 0;
-/* MR11 */ if (p->ampersandPred != NULL) {
-/* MR11 */ TRAV(p,
-/* MR11 */ pred->k,
-/* MR11 */ &(pred->completionTree), t);
-/* MR11 */ } else {
- TRAV(p->next,
- pred->k,
- &(pred->completionTree), t);
- };
- pred->tcontext = t;
- MR_check_pred_too_long(pred,pred->completionTree);
-#ifdef DBG_PRED
- fprintf(stderr, "LL(%d) context:", pred->k);
- preorder(t);
- fprintf(stderr, "\n");
-#endif
- }
- }
- else if ( HoistPredicateContext && pred->k == 1 )
- {
- pred->scontext[1] = empty;
- /* MR30 No need to use first_item_is_guess_block_extra
- since we know this is an action.
- */
- if ( first_item_is_guess_block((Junction *)p->next) )
- {
- warnFL("cannot compute context of predicate in front of (..)? block",
- FileStr[p->file], p->line);
- }
- else
- {
- REACH((Junction *)p->next,
- 1,
- &(pred->completionSet),
- pred->scontext[1]);
- MR_check_pred_too_long(pred,pred->completionSet);
-#ifdef DBG_PRED
- fprintf(stderr, "LL(1) context:");
- s_fprT(stderr, pred->scontext[1]);
- fprintf(stderr, "\n");
-#endif
- }
- }
- }
- {
- Predicate *d = find_predicates(p->next);
- Predicate *root;
-
-/* Warning: Doesn't seem like the up pointers will all be set correctly;
- * TJP: that's ok, we're not using them now.
- */
- if ( d!=NULL )
- {
- root = new_pred();
- root->expr = PRED_AND_LIST;
- root->down = pred;
- pred->right = d;
- pred->up = root;
- d->left = pred;
- d->up = pred->up;
- return root;
- }
- }
- return pred;
- }
- return NULL;
- }
- case nRuleRef :
- {
- Predicate *a;
- RuleRefNode *p = (RuleRefNode *) alt;
- Junction *r;
- Junction *save_MR_RuleBlkWithHalt;
-
- RuleEntry *q = (RuleEntry *) hash_get(Rname, p->text);
- if ( q == NULL )
- {
- warnFL( eMsg1("rule %s not defined",p->text), FileStr[p->file], p->line );
- return NULL;
- }
- r = RulePtr[q->rulenum];
- if ( r->pred_lock[1] )
- {
- /* infinite left-recursion; ignore 'cause LL sup 1 (k) analysis
- * must have seen it earlier.
- */
- return NULL;
- }
-
- /* MR10 There should only be one halt set at a time. */
- /* MR10 Life would have been easier with a global variable */
- /* MR10 (at least for this particular need) */
- /* MR10 Unset the old one and set the new one, later undo. */
-
- require(r->end->halt == FALSE,"should only have one halt at a time");
-
-/* MR10 */ require(MR_RuleBlkWithHalt == NULL ||
-/* MR10 */ (MR_RuleBlkWithHalt->jtype == RuleBlk && MR_RuleBlkWithHalt->end->halt == TRUE),
-/* MR10 */ "RuleBlkWithHalt->end not RuleBlk or does not have halt set");
-/* MR10 */ if (MR_RuleBlkWithHalt != NULL) {
-/* MR10 */ MR_RuleBlkWithHalt->end->halt=FALSE;
-/* MR10 */ };
-
-/*** fprintf(stderr,"\nSetting halt on junction #%d\n",r->end->seq); ***/
-
- require(r->end->halt == FALSE,"rule->end->halt already set");
-
- save_MR_RuleBlkWithHalt=MR_RuleBlkWithHalt;
-
-/* MR10 */ MR_pointerStackPush(&MR_RuleBlkWithHaltStack,MR_RuleBlkWithHalt);
-/* MR10 */ MR_pointerStackPush(&MR_PredRuleRefStack,p);
-
- r->end->halt = TRUE;
-/* MR10 */ MR_RuleBlkWithHalt=r;
-
- a = find_predicates((Node *)r);
-
- require(r->end->halt == TRUE,"rule->end->halt not set");
- r->end->halt = FALSE;
-
-/* MR10 */ MR_pointerStackPop(&MR_PredRuleRefStack);
-/* MR10 */ MR_RuleBlkWithHalt=(Junction *) MR_pointerStackPop(&MR_RuleBlkWithHaltStack);
-
- require (MR_RuleBlkWithHalt==save_MR_RuleBlkWithHalt,
- "RuleBlkWithHaltStack not consistent");
-
-/* MR10 */ require(MR_RuleBlkWithHalt == NULL ||
-/* MR10 */ (MR_RuleBlkWithHalt->jtype == RuleBlk && MR_RuleBlkWithHalt->end->halt == FALSE),
-/* MR10 */ "RuleBlkWithHalt->end not RuleBlk or has no halt set");
-/* MR10 */ if (MR_RuleBlkWithHalt != NULL) {
-/* MR10 */ MR_RuleBlkWithHalt->end->halt=TRUE;
-/* MR10 */ };
-
-/*** fprintf(stderr,"\nRestoring halt on junction #%d\n",r->end->seq); ***/
-
- if ( a==NULL ) return NULL;
-
- /* attempt to compute the "local" FOLLOW just like in normal lookahead
- * computation if needed
- */
-
- complete_context_sets(p,a);
- complete_context_trees(p,a);
-
-/* MR10 */ MR_cleanup_pred_trees(a);
-
- return a;
- }
- case nToken :
- break;
- }
-
- return NULL;
-}
-
-#ifdef __USE_PROTOS
-Predicate *MR_find_predicates_and_supp(Node *alt)
-#else
-Predicate *MR_find_predicates_and_supp(alt)
- Node *alt;
-#endif
-{
- Predicate *p;
-
- p=find_predicates(alt);
- p=MR_suppressK(alt,p);
- return p;
-}
-
-Predicate *
-#ifdef __USE_PROTOS
-new_pred( void )
-#else
-new_pred( )
-#endif
-{
- Predicate *p = (Predicate *) calloc(1,sizeof(Predicate)); /* MR10 */
- require(p!=NULL, "new_pred: cannot alloc predicate");
- p->scontext[0]=empty;
- p->scontext[1]=empty;
- p->completionTree=empty;
- p->completionSet=empty;
- p->plainSet=empty;
- return p;
-}
-
-static void
-#ifdef __USE_PROTOS
-complete_context_sets( RuleRefNode *p, Predicate *a )
-#else
-complete_context_sets( p, a )
-RuleRefNode *p;
-Predicate *a;
-#endif
-{
- set rk2, b;
- int k2;
-
-#ifdef DBG_PRED
- fprintf(stderr, "enter complete_context_sets\n");
-#endif
- for (; a!=NULL; a=a->right)
- {
- if ( a->expr == PRED_AND_LIST || a->expr == PRED_OR_LIST )
- {
- complete_context_sets(p,a->down);
- continue;
- }
- rk2 = b = empty;
- while ( !set_nil(a->completionSet) )
- {
- k2 = set_int(a->completionSet);
- set_rm(k2, a->completionSet);
-
- REACH(p->next, k2, &rk2, b);
- set_orin(&(a->scontext[1]), b);
- set_free(b);
- }
-
- set_orin(&(a->completionSet), rk2);/* remember what we couldn't do */
- set_free(rk2);
-#ifdef DBG_PRED
- fprintf(stderr, "LL(1) context for %s(addr 0x%x) after ruleref:", a->expr, a);
- s_fprT(stderr, a->scontext[1]);
- fprintf(stderr, "\n");
-#endif
-/* complete_context_sets(p, a->down);*/
- }
-#ifdef DBG_PRED
- fprintf(stderr, "exit complete_context_sets\n");
-#endif
-}
-
-static void
-#ifdef __USE_PROTOS
-complete_context_trees( RuleRefNode *p, Predicate *a )
-#else
-complete_context_trees( p, a )
-RuleRefNode *p;
-Predicate *a;
-#endif
-{
- set rk2;
- int k2;
- Tree *u;
-
-#ifdef DBG_PRED
- fprintf(stderr, "enter complete_context_trees\n");
-#endif
- for (; a!=NULL; a=a->right)
- {
- if ( a->expr == PRED_AND_LIST || a->expr == PRED_OR_LIST )
- {
- complete_context_trees(p, a->down);
- continue;
- }
- rk2 = empty;
-
- /* any k left to do? if so, link onto tree */
- while ( !set_nil(a->completionTree) )
- {
- k2 = set_int(a->completionTree);
- set_rm(k2, a->completionTree);
- u = NULL;
-
- TRAV(p->next, k2, &rk2, u);
-
- /* any subtrees missing k2 tokens, add u onto end */
- a->tcontext = tlink(a->tcontext, u, k2);
- Tfree(u); /* MR10 */
- }
- set_orin(&(a->completionTree), rk2);/* remember what we couldn't do */
- set_free(rk2);
-#ifdef DBG_PRED
- fprintf(stderr, "LL(i<%d) context after ruleref:", LL_k);
- preorder(a->tcontext);
- fprintf(stderr, "\n");
-#endif
-/* complete_context_trees(p, a->down);*/
- }
-#ifdef DBG_PRED
- fprintf(stderr, "exit complete_context_trees\n");
-#endif
-}
-
-/* Walk a list of predicates and return the set of all tokens in scontext[1]'s */
-set
-#ifdef __USE_PROTOS
-covered_set( Predicate *p )
-#else
-covered_set( p )
-Predicate *p;
-#endif
-{
- set a;
-
- a = empty;
- for (; p!=NULL; p=p->right)
- {
- if ( p->expr == PRED_AND_LIST || p->expr == PRED_OR_LIST )
- {
- set_orin(&a, covered_set(p->down));
- continue;
- }
- set_orin(&a, p->scontext[1]);
- set_orin(&a, covered_set(p->down));
- }
- return a;
-}
-
-/* MR10 predicate_free()
- MR10 Don't free the leaf nodes since they are part of the action node
-*/
-
-#ifdef __USE_PROTOS
-void predicate_free(Predicate *p)
-#else
-void predicate_free(p)
- Predicate *p;
-#endif
-{
- if (p == NULL) return;
- predicate_free(p->right);
- predicate_free(p->down);
- if (p->cloned ||
- p->source == NULL ||
- p->source->guardpred == NULL ||
- p->expr == PRED_AND_LIST ||
- p->expr == PRED_OR_LIST) {
- set_free(p->scontext[1]);
- set_free(p->completionSet);
- set_free(p->completionTree);
- set_free(p->plainSet);
- Tfree(p->tcontext);
- free( (char *) p);
- } else {
- p->right=NULL;
- p->down=NULL; /* MR13 *** debug */
- };
-}
-
-/* MR10 predicate_dup() */
-
-#ifdef __USE_PROTOS
-Predicate * predicate_dup_xxx(Predicate *p,int contextToo)
-#else
-Predicate * predicate_dup_xxx(p,contextToo)
- Predicate *p;
- int contextToo;
-#endif
-{
- Predicate *q;
-
- if (p == NULL) return NULL;
- q=new_pred();
- q->down=predicate_dup(p->down);
- q->right=predicate_dup(p->right);
-
- /*
- don't replicate expr - it is read-only
- and address comparison is used to look
- for identical predicates.
- */
-
- q->expr=p->expr;
- q->k=p->k;
- q->source=p->source;
- q->cloned=1;
- q->ampersandStyle=p->ampersandStyle;
- q->inverted=p->inverted;
- q->predEntry=p->predEntry;
- q->plainSet=set_dup(p->plainSet);
-
- if (contextToo) {
- q->tcontext=tdup(p->tcontext);
- q->scontext[0]=set_dup(p->scontext[0]);
- q->scontext[1]=set_dup(p->scontext[1]);
- q->completionTree=set_dup(p->completionTree);
- q->completionSet=set_dup(p->completionSet);
- };
-
- /* don't need to dup "redundant" */
-
- return q;
-
-}
-
-#ifdef __USE_PROTOS
-Predicate * predicate_dup_without_context(Predicate *p)
-#else
-Predicate * predicate_dup_without_context(p)
- Predicate *p;
-#endif
-{
- return predicate_dup_xxx(p,0);
-}
-
-#ifdef __USE_PROTOS
-Predicate * predicate_dup(Predicate *p)
-#else
-Predicate * predicate_dup(p)
- Predicate *p;
-#endif
-{
- return predicate_dup_xxx(p,1);
-}
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/proto.h b/BaseTools/Source/C/VfrCompile/Pccts/antlr/proto.h
deleted file mode 100644
index 53035e720e..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/proto.h
+++ /dev/null
@@ -1,852 +0,0 @@
-/*
- * proto.h -- function prototypes
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
- /* V a r i a b l e s */
-
-extern int tp;
-extern Junction *SynDiag;
-extern char Version[];
-extern char VersionDef[];
-#ifdef __cplusplus
-extern void (*fpPrint[])(...);
-#else
-extern void (*fpPrint[])();
-#endif
-#ifdef __cplusplus
-extern struct _set (*fpReach[])(...);
-#else
-extern struct _set (*fpReach[])();
-#endif
-#ifdef __cplusplus
-extern struct _tree *(*fpTraverse[])(...);
-#else
-extern struct _tree *(*fpTraverse[])();
-#endif
-#ifdef __cplusplus
-extern void (**fpTrans)(...);
-#else
-extern void (**fpTrans)();
-#endif
-#ifdef __cplusplus
-extern void (**fpJTrans)(...);
-#else
-extern void (**fpJTrans)();
-#endif
-#ifdef __cplusplus
-extern void (*C_Trans[NumNodeTypes+1])(...);
-#else
-extern void (*C_Trans[])();
-#endif
-#ifdef __cplusplus
-extern void (*C_JTrans[NumJuncTypes+1])(...);
-#else
-extern void (*C_JTrans[])();
-#endif
-extern int BlkLevel;
-extern int CurFile;
-extern char *CurPredName;
-extern char *CurRule;
-extern int CurRuleDebug; /* MR13 */
-extern Junction *CurRuleBlk;
-extern RuleEntry *CurRuleNode;
-extern ListNode *CurElementLabels;
-extern ListNode *CurAstLabelsInActions; /* MR27 */
-extern ListNode *ContextGuardPredicateList; /* MR13 */
-extern ListNode *CurActionLabels;
-extern int numericActionLabel; /* MR10 << ... $1 ... >> or << ... $1 ... >>? */
-extern ListNode *NumericPredLabels; /* MR10 << ... $1 ... >>? ONLY */
-extern char *FileStr[];
-extern int NumFiles;
-extern int EpToken;
-extern int WildCardToken;
-extern Entry **Tname,
- **Texpr,
- **Rname,
- **Fcache,
- **Tcache,
- **Elabel,
- **Sname,
- **Pname; /* MR11 */
-extern ListNode *ExprOrder;
-extern ListNode **Cycles;
-extern int TokenNum;
-extern int LastTokenCounted;
-extern ListNode *BeforeActions, *AfterActions, *LexActions;
-
-/* MR1 */
-/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
-/* MR1 via #lexmember <<....>> & #lexprefix <<...>> */
-/* MR1 */
-
-extern ListNode *LexMemberActions; /* MR1 */
-extern ListNode *LexPrefixActions; /* MR1 */
-
-extern set *fset; /* for constrained search */ /* MR11 */
-extern int maxk; /* for constrained search */ /* MR11 */
-extern int Save_argc; /* MR10 */
-extern char **Save_argv; /* MR10 */
-extern ListNode *eclasses, *tclasses;
-extern char *HdrAction;
-extern char *FirstAction; /* MR11 */
-extern FILE *ErrFile;
-extern char *RemapFileName;
-extern char *ErrFileName;
-extern char *DlgFileName;
-extern char *DefFileName;
-extern char *ModeFileName;
-extern char *StdMsgName;
-extern int NumRules;
-extern Junction **RulePtr;
-extern int LL_k;
-extern int CLL_k;
-extern char *decodeJType[];
-extern int PrintOut;
-extern int PrintAnnotate;
-extern int CodeGen;
-extern int LexGen;
-extern int esetnum;
-extern int setnum;
-extern int wordnum;
-extern int GenAST;
-extern int GenANSI;
-extern int **FoStack;
-extern int **FoTOS;
-extern int GenExprSetsOpt;
-extern FILE *DefFile;
-extern int CannotContinue;
-extern int GenCR;
-extern int GenLineInfo;
-extern int GenLineInfoMS;
-extern int action_file, action_line;
-extern int TraceGen;
-extern int CurAmbigAlt1, CurAmbigAlt2, CurAmbigline, CurAmbigfile;
-extern char *CurAmbigbtype;
-extern int elevel;
-extern int GenEClasseForRules;
-extern FILE *input, *output;
-extern char **TokenStr, **ExprStr;
-extern int CurrentLexClass, NumLexClasses;
-extern LClass lclass[];
-extern char LexStartSymbol[];
-extern char *CurRetDef;
-extern char *CurParmDef;
-extern int OutputLL_k;
-extern int TreeResourceLimit;
-extern int DemandLookahead;
-extern char *RulePrefix;
-extern int GenStdPccts;
-extern char *stdpccts;
-extern int ParseWithPredicates;
-extern int ConstrainSearch;
-extern int PURIFY; /* MR23 */
-
-extern set MR_CompromisedRules; /* MR14 */
-extern int MR_AmbSourceSearch; /* MR11 */
-extern int MR_SuppressSearch; /* MR13 */
-extern int MR_AmbSourceSearchGroup; /* MR11 */
-extern int MR_AmbSourceSearchChoice; /* MR11 */
-extern int MR_AmbSourceSearchLimit; /* MR11 */
-extern int MR_usingPredNames; /* MR11 */
-extern int MR_ErrorSetComputationActive; /* MR14 */
-extern char *MR_AmbAidRule; /* MR11 */
-extern int MR_AmbAidLine; /* MR11 */
-extern int MR_AmbAidMultiple; /* MR11 */
-extern int MR_AmbAidDepth; /* MR11 */
-extern int MR_skipped_e3_report; /* MR11 */
-extern int MR_matched_AmbAidRule; /* MR11 */
-extern int MR_Inhibit_Tokens_h_Gen; /* MR13 */
-extern int NewAST; /* MR13 */
-extern int tmakeInParser; /* MR23 */
-extern int AlphaBetaTrace; /* MR14 */
-extern int MR_BlkErr; /* MR21 */
-extern int MR_AlphaBetaWarning; /* MR14 */
-extern int MR_AlphaBetaMessageCount; /* MR14 */
-extern int MR_MaintainBackTrace; /* MR14 */
-extern int MR_BadExprSets; /* MR13 */
-extern int FoundGuessBlk;
-extern int FoundException;
-extern int FoundAtOperator; /* MR6 */
-extern int FoundExceptionGroup; /* MR6 */
-extern int WarningLevel;
-extern int UseStdout; /* MR6 */
-extern int TabWidth; /* MR6 */
-extern int pLevel;
-extern int pAlt1;
-extern int pAlt2;
-extern int AImode;
-extern int HoistPredicateContext;
-extern int MRhoisting; /* MR9 */
-extern int MRhoistingk; /* MR13 */
-extern int MR_debugGenRule; /* MR11 */
-extern int GenCC;
-extern char *ParserName;
-extern char *StandardSymbols[];
-extern char *ASTSymbols[];
-extern set reserved_positions;
-extern set all_tokens;
-extern set imag_tokens;
-extern set tokclasses;
-extern ListNode *ForcedTokens;
-extern int *TokenInd;
-extern FILE *Parser_h, *Parser_c;
-extern char CurrentClassName[];
-extern int no_classes_found;
-extern char Parser_h_Name[];
-extern char Parser_c_Name[];
-extern char MRinfoFile_Name[]; /* MR10 */
-extern FILE *MRinfoFile; /* MR10 */
-extern int MRinfo; /* MR10 */
-extern int MRinfoSeq; /* MR10 */
-extern int InfoP; /* MR10 */
-extern int InfoT; /* MR10 */
-extern int InfoF; /* MR10 */
-extern int InfoM; /* MR10 */
-extern int InfoO; /* MR12 */
-extern int PotentialSuppression; /* MR10 */
-extern int PotentialDummy; /* MR10 */
-extern int TnodesInUse; /* MR10 */
-extern int TnodesPeak; /* MR10 */
-extern int TnodesReportThreshold; /* MR11 */
-extern int TnodesAllocated; /* MR10 */
-extern char *ClassDeclStuff; /* MR10 */
-extern char *BaseClassName; /* MR22 */
-extern ListNode *class_before_actions, *class_after_actions;
-extern char *UserTokenDefsFile;
-extern int UserDefdTokens;
-extern ListNode *MetaTokenNodes;
-extern char *OutputDirectory;
-extern int DontCopyTokens;
-extern int LTinTokenAction; /* MR23 */
-extern set AST_nodes_refd_in_actions;
-extern ListNode *CurExGroups;
-extern int CurBlockID;
-extern int CurAltNum;
-extern Junction *CurAltStart;
-extern Junction *OuterAltStart; /* chain exception groups MR7 */
-extern ExceptionGroup *DefaultExGroup;
-extern int NumSignals;
-extern int ContextGuardTRAV;
-extern Junction *MR_RuleBlkWithHalt; /* MR10 */
-extern PointerStack MR_BackTraceStack; /* MR10 */
-extern PointerStack MR_PredRuleRefStack; /* MR10 */
-extern PointerStack MR_RuleBlkWithHaltStack; /* MR10 */
-
-/* */
-/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */
-/* MR1 in DLG action */
-/* */
-extern int tokenActionActive; /* MR1 */
-
-extern char *PRED_OR_LIST; /* MR10 */
-extern char *PRED_AND_LIST; /* MR10 */
-
-#ifdef __VMS
-#define STRICMP strcasecmp /* MR21 */
-#else
-#define STRICMP stricmp /* MR21 */
-#endif
-
-/* MR26 */
-#ifdef PCCTS_USE_STDARG
-extern Tree *tmake(Tree *root, ...);
-#else
-extern Tree *tmake();
-#endif
-
-#ifdef __USE_PROTOS
-extern int STRICMP(const char*, const char*);
-extern void istackreset(void);
-extern int istacksize(void);
-extern void pushint(int);
-extern int popint( void );
-extern int istackempty( void );
-extern int topint( void );
-extern void NewSetWd( void );
-extern void DumpSetWd( void );
-extern void DumpSetWdForC( void );
-extern void DumpSetWdForCC( void );
-extern void NewSet( void );
-extern void FillSet( set );
-extern void ComputeErrorSets( void );
-extern void ComputeTokSets( void );
-extern void SubstErrorClass( set * );
-extern int DefErrSet( set *, int, char * );
-extern int DefErrSetForC( set *, int, char * );
-extern int DefErrSetForCC( set *, int, char * );
-extern int DefErrSet1(int, set *, int, char *); /* MR21 */
-extern int DefErrSetForC1(int, set *, int, char *, const char* ); /* MR21 */
-extern int DefErrSetForCC1(int, set *, int, char *, const char* ); /* MR21 */
-extern int DefErrSetWithSuffix(int, set *, int, char *, const char *); /* MR21 */
-extern void GenErrHdr( void );
-extern void dumpExpr( FILE *, char * );
-extern void addParm( Node *, char * );
-extern Graph buildAction( char *, int, int, int );
-extern Graph buildToken( char * );
-extern Graph buildWildCard( char * );
-extern Graph buildRuleRef( char * );
-extern Graph Or( Graph, Graph );
-extern Graph Cat( Graph, Graph );
-extern Graph makeOpt( Graph, int, char *);
-extern Graph makeBlk( Graph, int, char *);
-extern Graph makeLoop( Graph, int, char *);
-extern Graph makePlus( Graph, int, char *);
-extern Graph emptyAlt( void );
-extern Graph emptyAlt3( void );
-extern TokNode * newTokNode( void );
-extern RuleRefNode * newRNode( void );
-extern Junction * newJunction( void );
-extern ActionNode * newActionNode( void );
-extern char * makelocks( void );
-extern void preorder( Tree * );
-extern Tree * tnode( int );
-extern void _Tfree( Tree * );
-extern Tree * tdup( Tree * );
-extern int is_single_tuple( Tree * );
-extern Tree * tappend( Tree *, Tree * );
-extern void Tfree( Tree * );
-extern Tree * tlink( Tree *, Tree *, int );
-extern Tree * tshrink( Tree * );
-extern Tree * tflatten( Tree * );
-extern Tree * tJunc( Junction *, int, set * );
-extern Tree * tRuleRef( RuleRefNode *, int, set * );
-extern Tree * tToken( TokNode *, int, set * );
-extern Tree * tAction( ActionNode *, int, set * );
-extern int tmember( Tree *, Tree * );
-extern int tmember_constrained( Tree *, Tree * );
-extern Tree * tleft_factor( Tree * );
-extern Tree * trm_perm( Tree *, Tree * );
-extern void tcvt( set *, Tree * );
-extern Tree * permute( int, int );
-extern Tree * VerifyAmbig( Junction *, Junction *, unsigned **, set *, Tree **, Tree **, int * );
-extern set rJunc( Junction *, int, set * );
-extern set rRuleRef( RuleRefNode *, int, set * );
-extern set rToken( TokNode *, int, set * );
-extern set rAction( ActionNode *, int, set * );
-extern void HandleAmbiguity( Junction *, Junction *, Junction *, int );
-extern set First( Junction *, int, int, int * );
-extern void freeBlkFsets( Junction * );
-extern void genAction( ActionNode * );
-extern void genRuleRef( RuleRefNode * );
-extern void genToken( TokNode * );
-extern void genOptBlk( Junction * );
-extern void genLoopBlk( Junction *, Junction *, Junction *, int );
-extern void genLoopBegin( Junction * );
-extern void genPlusBlk( Junction * );
-extern void genSubBlk( Junction * );
-extern void genRule( Junction * );
-extern void genJunction( Junction * );
-extern void genEndBlk( Junction * );
-extern void genEndRule( Junction * );
-extern void genHdr( int );
-extern void genHdr1( int );
-extern void dumpAction( char *, FILE *, int, int, int, int );
-extern void dumpActionPlus(ActionNode*, char *, FILE *, int, int, int, int ); /* MR21 */
-extern Entry ** newHashTable( void );
-extern Entry * hash_add( Entry **, char *, Entry * );
-extern Entry * hash_get( Entry **, char * );
-extern void hashStat( Entry ** );
-extern char * mystrdup( char * );
-extern void genLexDescr( void );
-extern void dumpLexClasses( FILE * );
-extern void genDefFile( void );
-extern void DumpListOfParmNames( char *, FILE *, int ); /* MR5 janm 26-May-97 */
-extern int DumpNextNameInDef( char **, FILE * );
-extern void DumpOldStyleParms( char *, FILE * );
-extern void DumpType( char *, FILE * );
-extern int strmember( char *, char * );
-/* extern int HasComma( char * ); MR23 Replaced by hasMultipleOperands() */
-extern void DumpRetValStruct( FILE *, char *, int );
-extern char * StripQuotes( char * );
-extern int main( int, char *[] );
-extern void readDescr( void );
-extern FILE * NextFile( void );
-extern char * outnameX( char *, char *);
-extern char * outname( char * );
-extern void fatalFL( char *, char *, int );
-extern void fatal_intern( char *, char *, int );
-extern void cleanUp( void );
-extern char * eMsg3( char *, char *, char *, char * );
-extern char * eMsgd( char *, int );
-extern char * eMsgd2( char *, int, int );
-extern void s_fprT( FILE *, set );
-extern char * TerminalString( int );
-extern void lexclass( char * );
-extern void lexmode( int );
-extern int LexClassIndex( char * );
-extern int hasAction( char * );
-extern void setHasAction( char *, char * );
-extern int addTname( char * );
-extern int addTexpr( char * );
-extern int Tnum( char * );
-extern void Tklink( char *, char * );
-extern Entry * newEntry( char *, int );
-extern void list_add( ListNode **, void * );
-extern void list_free( ListNode **, int freeData ); /* MR10 */
-extern void list_apply( ListNode *, void (*)(void *) );
-extern int list_search_cstring (ListNode *, char *); /* MR27 */
-extern char * Fkey( char *, int, int );
-extern void FoPush( char *, int );
-extern void FoPop( int );
-extern void RegisterCycle( char *, int );
-extern void ResolveFoCycles( int );
-extern void pJunc( Junction * );
-extern void pRuleRef( RuleRefNode * );
-extern void pToken( TokNode * );
-extern void pAction( ActionNode * );
-extern void FoLink( Node * );
-extern void addFoLink( Node *, char *, Junction * );
-extern void GenCrossRef( Junction * );
-extern void defErr( char *, long, long, long, long, long, long );
-extern void genStdPCCTSIncludeFile(FILE *,char *); /* MR10 */
-extern char * pcctsBaseName(char *); /* MR32 */
-extern Predicate *find_predicates(Node *); /* MR10 */
-extern Predicate *MR_find_predicates_and_supp(Node *); /* MR13 */
-extern int predicateLookaheadDepth(ActionNode *); /* MR10 */
-extern void predicate_free(Predicate *); /* MR10 */
-extern Predicate * predicate_dup(Predicate *); /* MR10 */
-extern Predicate * predicate_dup_without_context(Predicate *); /* MR11 */
-extern void GenRulePrototypes(FILE *, Junction *);
-extern Junction *first_item_is_guess_block(Junction *);
-extern Junction *first_item_is_guess_block_extra(Junction * q); /* MR30 */
-extern Junction *analysis_point(Junction *);
-extern Tree *make_tree_from_sets(set *, set *);
-extern Tree *tdup_chain(Tree *);
-extern Tree *tdif(Tree *, Predicate *, set *, set *);
-extern set covered_set(Predicate *);
-extern void AmbiguityDialog(Junction *, int, Junction *, Junction *, int *, int *);
-extern void dumpAmbigMsg(set *, FILE *, int);
-extern void GenRuleFuncRedefs(FILE *, Junction *);
-extern void GenPredefinedSymbolRedefs(FILE *);
-extern void GenASTSymbolRedefs(FILE *);
-extern void GenRemapFile(void);
-extern void GenSetRedefs(FILE *);
-extern ForcedToken *newForcedToken(char *, int);
-extern void RemapForcedTokens(void);
-extern char *TokenOrExpr(int);
-extern void setUpperRange(TokNode *, char *);
-extern void GenParser_c_Hdr(void);
-extern void GenParser_h_Hdr(void);
-extern void GenRuleMemberDeclarationsForCC(FILE *, Junction *);
-extern int addForcedTname( char *, int );
-extern char *OutMetaName(char *);
-extern void OutFirstSetSymbol(Junction *q, char *); /* MR21 */
-extern void warnNoFL(char *err);
-extern void warnFL(char *err,char *f,int l);
-extern void warn(char *err);
-extern void warnNoCR( char *err );
-extern void errNoFL(char *err);
-extern void errFL(char *err,char *f,int l);
-extern void err(char *err);
-extern void errNoCR( char *err );
-extern void genPredTree( Predicate *p, Node *j, int ,int);
-extern UserAction *newUserAction(char *);
-extern char *gate_symbol(char *name);
-extern char *makeAltID(int blockid, int altnum);
-extern void DumpRemainingTokSets(void);
-extern void DumpANSIFunctionArgDef(FILE *f, Junction *q, int bInit); /* MR23 */
-extern void DumpFormals(FILE *, char *, int bInit); /* MR23 */
-extern char* hideDefaultArgs(const char* pdecl); /* MR22 VHS */
-extern Predicate *computePredFromContextGuard(Graph,int *msgDone); /* MR21 */
-extern void recomputeContextGuard(Predicate *); /* MR13 */
-extern Predicate *new_pred(void);
-extern void chkGTFlag(void);
-extern void leAdd(LabelEntry *); /* MR7 */
-extern void leFixup(void); /* MR7 */
-extern void egAdd(ExceptionGroup *); /* MR7 */
-extern void egFixup(void); /* MR7 */
-extern void altAdd(Junction *); /* MR7 */
-extern void altFixup(void); /* MR7 */
-extern Predicate * MR_find_in_aSubBlk(Junction *alt); /* MR10 */
-extern Predicate * MR_predFlatten(Predicate *p); /* MR10 */
-extern Predicate * MR_predSimplifyALL(Predicate *p); /* MR10 */
-extern Predicate * MR_predSimplifyALLX(Predicate *p,int skipPass3); /* MR10 */
-extern int MR_allPredLeaves(Predicate *p); /* MR10 */
-extern void MR_cleanup_pred_trees(Predicate *p); /* MR10 */
-extern int MR_predicate_context_completed(Predicate *p); /* MR10 */
-extern void MR_check_pred_too_long(Predicate *p,set completion); /* MR10 */
-extern Tree * MR_remove_epsilon_from_tree(Tree *t); /* MR10 */
-extern Tree * MR_computeTreeAND(Tree *l,Tree *r); /* MR10 */
-extern int MR_tree_equ(Tree *big, Tree *small); /* MR10 */
-extern set MR_First(int ck,Junction *j,set *incomplete); /* MR10 */
-extern set MR_compute_pred_set(Predicate *p); /* MR10 */
-extern Tree * MR_compute_pred_tree_context(Predicate *p); /* MR10 */
-extern int MR_pointerStackPush(PointerStack *,void *); /* MR10 */
-extern void * MR_pointerStackPop(PointerStack *); /* MR10 */
-extern void * MR_pointerStackTop(PointerStack *); /* MR10 */
-extern void MR_pointerStackReset(PointerStack *); /* MR10 */
-extern void MR_backTraceReport(void); /* MR10 */
-extern void MR_alphaBetaTraceReport(void); /* MR14 */
-extern void MR_dumpRuleSet(set); /* MR14 */
-extern void MR_predContextPresent(Predicate *p,int *,int *); /* MR10 */
-extern void MR_dumpPred(Predicate *p,int withContext); /* MR10 */
-extern void MR_dumpPred1(int,Predicate *p,int withContext); /* MR10 */
-extern void MR_xxxIndent(FILE *f,int depth); /* MR11 */
-extern void MR_outputIndent(int depth); /* MR11 */
-extern void MR_stderrIndent(int depth); /* MR11 */
-extern Junction * MR_ruleReferenced(RuleRefNode *rrn); /* MR10 */
-extern Junction * MR_nameToRuleBlk(char *); /* MR10 */
-extern void MR_releaseResourcesUsedInRule(Node *); /* MR10 */
-extern void MR_dumpTreeX(int depth,Tree *t,int across); /* MR10 */
-extern void MR_dumpTreeF(FILE *f,int depth,Tree *t,int across); /* MR10 */
-extern void DumpFcache(void); /* MR10 */
-extern void MR_dumpTokenSet(FILE *f,int depth,set s); /* MR10 */
-extern void MR_traceAmbSource(set *,Junction *,Junction *); /* MR11 */
-extern void MR_traceAmbSourceK(Tree *,Junction *a1,Junction *a2); /* MR11 */
-extern void MR_traceAmbSourceKclient(void); /* MR20 */
-extern Node *MR_advance(Node *); /* MR11 */
-extern int MR_offsetFromRule(Node *); /* MR11 */
-extern char *MR_ruleNamePlusOffset(Node *); /* MR11 */
-extern int MR_max_height_of_tree(Tree *); /* MR11 */
-extern int MR_all_leaves_same_height(Tree *,int); /* MR11 */
-extern void MR_projectTreeOntoSet(Tree *t,int k,set *); /* MR11 */
-extern Tree *MR_make_tree_from_set(set); /* MR11 */
-extern Predicate *MR_removeRedundantPredPass3(Predicate *); /* MR11 */
-extern void MR_pred_depth(Predicate *,int *); /* MR11 */
-extern int MR_comparePredicates(Predicate *,Predicate *); /* MR11 */
-extern Predicate * MR_unfold(Predicate *); /* MR11 */
-extern void MR_simplifyInverted(Predicate *,int); /* MR11 */
-extern int MR_secondPredicateUnreachable /* MR11 */
- (Predicate *first,Predicate *second); /* MR11 */
-extern void MR_clearPredEntry(Predicate *); /* MR11 */
-extern void MR_orphanRules(FILE *); /* MR12 */
-extern void MR_merge_contexts(Tree *); /* MR12 */
-extern int ci_strequ(char *,char *); /* MR12 */
-extern void MR_guardPred_plainSet(ActionNode *anode,Predicate *); /* MR12c */
-extern void MR_suppressSearchReport(void); /* MR12c */
-extern Predicate * MR_suppressK(Node *,Predicate *); /* MR13 */
-extern void MR_backTraceDumpItem(FILE *,int skip,Node *n); /* MR13 */
-extern void MR_backTraceDumpItemReset(void); /* MR13 */
-extern Junction * MR_junctionWithoutP2(Junction *); /* MR13 */
-extern void MR_setConstrainPointer(set *); /* MR18 */
-extern void BlockPreambleOption(Junction *q, char * pSymbol); /* MR23 */
-extern char* getInitializer(char *); /* MR23 */
-extern char *endFormal(char *pStart, /* MR23 */
- char **ppDataType, /* MR23 */
- char **ppSymbol, /* MR23 */
- char **ppEqualSign, /* MR23 */
- char **ppValue, /* MR23 */
- char **ppSeparator, /* MR23 */
- int *pNext); /* MR23 */
-extern char *strBetween(char *pStart, /* MR23 */
- char *pNext, /* MR23 */
- char *pStop); /* MR23 */
-extern int hasMultipleOperands(char *); /* MR23 */
-extern void DumpInitializers(FILE*, RuleEntry*, char*); /* MR23 */
-extern int isTermEntryTokClass(TermEntry *); /* MR23 */
-extern int isEmptyAlt(Node *, Node *); /* MR23 */
-#else
-extern int STRICMP();
-extern void istackreset();
-extern int istacksize();
-extern void pushint();
-extern int popint();
-extern int istackempty();
-extern int topint();
-extern void NewSetWd();
-extern void DumpSetWd();
-extern void DumpSetWdForC();
-extern void DumpSetWdForCC();
-extern void NewSet();
-extern void FillSet();
-extern void ComputeErrorSets();
-extern void ComputeTokSets();
-extern void SubstErrorClass();
-extern int DefErrSet();
-extern int DefErrSetForC();
-extern int DefErrSetForCC();
-extern int DefErrSet1();
-extern int DefErrSetForC1();
-extern int DefErrSetForCC1();
-extern int DefErrSetWithSuffix(); /* MR21 */
-extern void GenErrHdr();
-extern void dumpExpr();
-extern void addParm();
-extern Graph buildAction();
-extern Graph buildToken();
-extern Graph buildWildCard();
-extern Graph buildRuleRef();
-extern Graph Or();
-extern Graph Cat();
-extern Graph makeOpt();
-extern Graph makeBlk();
-extern Graph makeLoop();
-extern Graph makePlus();
-extern Graph emptyAlt();
-extern Graph emptyAlt3();
-extern TokNode * newTokNode();
-extern RuleRefNode * newRNode();
-extern Junction * newJunction();
-extern ActionNode * newActionNode();
-extern char * makelocks();
-extern void preorder();
-extern Tree * tnode();
-extern void _Tfree();
-extern Tree * tdup();
-extern int is_single_tuple();
-extern Tree * tappend();
-extern void Tfree();
-extern Tree * tlink();
-extern Tree * tshrink();
-extern Tree * tflatten();
-extern Tree * tJunc();
-extern Tree * tRuleRef();
-extern Tree * tToken();
-extern Tree * tAction();
-extern int tmember();
-extern int tmember_constrained();
-extern Tree * tleft_factor();
-extern Tree * trm_perm();
-extern void tcvt();
-extern Tree * permute();
-extern Tree * VerifyAmbig();
-extern set rJunc();
-extern set rRuleRef();
-extern set rToken();
-extern set rAction();
-extern void HandleAmbiguity();
-extern set First();
-extern void freeBlkFsets();
-extern void genAction();
-extern void genRuleRef();
-extern void genToken();
-extern void genOptBlk();
-extern void genLoopBlk();
-extern void genLoopBegin();
-extern void genPlusBlk();
-extern void genSubBlk();
-extern void genRule();
-extern void genJunction();
-extern void genEndBlk();
-extern void genEndRule();
-extern void genHdr();
-extern void genHdr1();
-extern void dumpAction();
-extern void dumpActionPlus(); /* MR21 */
-extern Entry ** newHashTable();
-extern Entry * hash_add();
-extern Entry * hash_get();
-extern void hashStat();
-extern char * mystrdup();
-extern void genLexDescr();
-extern void dumpLexClasses();
-extern void genDefFile();
-extern void DumpListOfParmNames(); /* MR5 janm 26-May-97 */
-extern int DumpNextNameInDef();
-extern void DumpOldStyleParms();
-extern void DumpType();
-extern int strmember();
-/* extern int HasComma(); MR23 Replaced by hasMultipleOperands() */
-extern void DumpRetValStruct();
-extern char * StripQuotes();
-extern int main();
-extern void readDescr();
-extern FILE * NextFile();
-extern char * outnameX();
-extern char * outname();
-extern void fatalFL();
-extern void fatal_intern();
-extern void cleanUp();
-extern char * eMsg3();
-extern char * eMsgd();
-extern char * eMsgd2();
-extern void s_fprT();
-extern char * TerminalString();
-extern void lexclass();
-extern void lexmode();
-extern int LexClassIndex();
-extern int hasAction();
-extern void setHasAction();
-extern int addTname();
-extern int addTexpr();
-extern int Tnum();
-extern void Tklink();
-extern Entry * newEntry();
-extern void list_add();
-extern void list_free(); /* MR10 */
-extern void list_apply();
-extern int list_search_cstring (); /* MR27 */
-extern char * Fkey();
-extern void FoPush();
-extern void FoPop();
-extern void RegisterCycle();
-extern void ResolveFoCycles();
-extern void pJunc();
-extern void pRuleRef();
-extern void pToken();
-extern void pAction();
-extern void FoLink();
-extern void addFoLink();
-extern void GenCrossRef();
-extern void defErr();
-extern void genStdPCCTSIncludeFile();
-extern char * pcctsBaseName(); /* MR32 */
-extern Predicate *find_predicates();
-extern Predicate *MR_find_predicates_and_supp(); /* MR13 */
-extern int predicateLookaheadDepth(); /* MR10 */
-extern void predicate_free(); /* MR10 */
-extern Predicate * predicate_dup(); /* MR10 */
-extern Predicate * predicate_dup_without_context(); /* MR11 */
-extern void GenRulePrototypes();
-extern Junction *first_item_is_guess_block();
-extern Junction *first_item_is_guess_block_extra(); /* MR30 */
-extern Junction *analysis_point();
-extern Tree *make_tree_from_sets();
-extern Tree *tdup_chain();
-extern Tree *tdif();
-extern set covered_set();
-extern void AmbiguityDialog();
-extern void dumpAmbigMsg();
-extern void GenRuleFuncRedefs();
-extern void GenPredefinedSymbolRedefs();
-extern void GenASTSymbolRedefs();
-extern void GenRemapFile();
-extern void GenSetRedefs();
-extern ForcedToken *newForcedToken();
-extern void RemapForcedTokens();
-extern char *TokenOrExpr();
-extern void setUpperRange();
-extern void GenParser_c_Hdr();
-extern void GenParser_h_Hdr();
-extern void GenRuleMemberDeclarationsForCC();
-extern int addForcedTname();
-extern char *OutMetaName();
-extern void OutFirstSetSymbol(); /* MR21 */
-extern void warnNoFL();
-extern void warnFL();
-extern void warn();
-extern void warnNoCR();
-extern void errNoFL();
-extern void errFL();
-extern void err();
-extern void errNoCR();
-extern void genPredTree();
-extern UserAction *newUserAction();
-extern char *gate_symbol();
-extern char *makeAltID();
-extern void DumpRemainingTokSets();
-extern void DumpANSIFunctionArgDef();
-extern void DumpFormals(); /* MR23 */
-extern char* hideDefaultArgs(); /* MR22 VHS */
-extern Predicate *computePredFromContextGuard();
-extern void recomputeContextGuard(); /* MR13 */
-extern Predicate *new_pred();
-extern void chkGTFlag();
-extern void leAdd(); /* MR7 */
-extern void leFixup(); /* MR7 */
-extern void egAdd(); /* MR7 */
-extern void egFixup(); /* MR7 */
-extern void altAdd(); /* MR7 */
-extern void altFixup(); /* MR7 */
-extern Predicate * MR_find_in_aSubBlk(); /* MR10 */
-extern Predicate * MR_predFlatten(); /* MR10 */
-extern Predicate * MR_predSimplifyALL(); /* MR10 */
-extern Predicate * MR_predSimplifyALLX(); /* MR10 */
-extern void MR_cleanup_pred_trees(); /* MR10 */
-extern int MR_allPredLeaves(); /* MR10 */
-extern int MR_predicate_context_completed(); /* MR10 */
-extern void MR_check_pred_too_long(); /* MR10 */
-extern Tree * MR_remove_epsilon_from_tree(); /* MR10 */
-extern Tree * MR_computeTreeAND(); /* MR10 */
-extern int MR_tree_equ(); /* MR10 */
-extern set MR_First(); /* MR10 */
-extern set MR_compute_pred_set(); /* MR10 */
-extern Tree * MR_compute_pred_tree_context(); /* MR10 */
-extern int MR_pointerStackPush(); /* MR10 */
-extern void * MR_pointerStackPop(); /* MR10 */
-extern void * MR_pointerStackTop(); /* MR10 */
-extern void MR_pointerStackReset(); /* MR10 */
-extern void MR_backTraceReport(); /* MR10 */
-extern void MR_alphaBetaTraceReport(); /* MR14 */
-extern void MR_dumpRuleSet(); /* MR14 */
-extern void MR_predContextPresent(); /* MR10 */
-extern void MR_dumpPred(); /* MR10 */
-extern void MR_dumpPred1(); /* MR10 */
-extern void MR_xxxIndent(); /* MR11 */
-extern void MR_stderrIndent(); /* MR11 */
-extern void MR_outputIndent(); /* MR11 */
-extern Junction * MR_ruleReferenced(); /* MR10 */
-extern void MR_releaseResourcesUsedInRule(); /* MR10 */
-extern void MR_dumpTreeX(); /* MR10 */
-extern void MR_dumpTreeF(); /* MR10 */
-extern void DumpFcache(); /* MR10 */
-extern void MR_dumpTokenSet(); /* MR10 */
-extern void MR_traceAmbSource(); /* MR11 */
-extern Node *MR_advance(); /* MR11 */
-extern int MR_offsetFromRule(); /* MR11 */
-extern char *MR_ruleNamePlusOffset(); /* MR11 */
-extern void MR_traceAmbSourceK(); /* MR11 */
-extern void MR_traceAmbSourceKclient(); /* [i_a] added */
-extern int MR_max_height_of_tree(); /* MR11 */
-extern int MR_all_leaves_same_height(); /* MR11 */
-extern void MR_projectTreeOntoSet(); /* MR11 */
-extern Tree *MR_make_tree_from_set(); /* MR11 */
-extern Predicate *MR_removeRedundantPredPass3(); /* MR11 */
-extern void MR_pred_depth(); /* MR11 */
-extern int MR_comparePredicates(); /* MR11 */
-extern Predicate * MR_unfold(); /* MR11 */
-extern void MR_simplifyInverted(); /* MR11 */
-extern int MR_secondPredicateUnreachable(); /* MR11 */
-extern Junction * MR_nameToRuleBlk(); /* MR10 */
-extern void MR_clearPredEntry(); /* MR11 */
-extern void MR_orphanRules(); /* MR12 */
-extern void MR_merge_contexts(); /* MR12 */
-extern int ci_strequ(); /* MR12 */
-extern void MR_guardPred_plainSet(); /* MR12c */
-extern void MR_suppressSearchReport(); /* MR12c */
-extern Predicate * MR_suppressK(); /* MR13 */
-extern void MR_backTraceDumpItem(); /* MR13 */
-extern void MR_backTraceDumpItemReset(); /* MR13 */
-extern Junction * MR_junctionWithoutP2(); /* MR13 */
-extern void MR_setConstrainPointer(); /* MR18 */
-extern void BlockPreambleOption(); /* MR23 */
-extern char* getInitializer(); /* MR23 */
-extern int hasMultipleOperands(); /* MR23 */
-extern char *endFormal(); /* MR23 */
-extern char *strBetween(); /* MR23 */
-extern void DumpInitializers(); /* MR23 */
-extern int isTermEntryTokClass(); /* MR23 */
-extern int isEmptyAlt();
-
-#endif
-
-#ifdef __USE_PROTOS
-#include <stdlib.h>
-#endif
-
-/* MR20 G. Hobbelt Create proper externs for dlg variables */
-
-extern set attribsRefdFromAction;
-extern int inAlt;
-extern int UsedOldStyleAttrib;
-extern int UsedNewStyleLabel;
-
-#define MAX_BLK_LEVEL 100 /* MR23 */
-extern int CurBlockID_array[MAX_BLK_LEVEL]; /* MR23 */
-extern int CurAltNum_array[MAX_BLK_LEVEL]; /* MR23 */
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/scan.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/scan.c
deleted file mode 100644
index 9b4bde08e6..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/scan.c
+++ /dev/null
@@ -1,5735 +0,0 @@
-
-/* parser.dlg -- DLG Description of scanner
- *
- * Generated from: antlr.g
- *
- * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
- * Purdue University Electrical Engineering
- * With AHPCRC, University of Minnesota
- * ANTLR Version 1.33MR33
- */
-
-#define ANTLR_VERSION 13333
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-#include "pcctscfg.h"
-#include "set.h"
-#include <ctype.h>
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#define zzcr_attr(attr,tok,t)
-#include "antlr.h"
-#include "tokens.h"
-#include "dlgdef.h"
-LOOKAHEAD
-
-void
-#ifdef __USE_PROTOS
-zzerraction(void)
-#else
-zzerraction()
-#endif
-{
- (*zzerr)("invalid token");
- zzadvance();
- zzskip();
-}
-/*
- * D L G tables
- *
- * Generated from: parser.dlg
- *
- * 1989-2001 by Will Cohen, Terence Parr, and Hank Dietz
- * Purdue University Electrical Engineering
- * DLG Version 1.33MR33
- */
-
-#include "mode.h"
-
-
-
-
-/* maintained, but not used for now */
-set AST_nodes_refd_in_actions = set_init;
-int inAlt = 0;
-set attribsRefdFromAction = set_init; /* MR20 */
-int UsedOldStyleAttrib = 0;
-int UsedNewStyleLabel = 0;
-#ifdef __USE_PROTOS
-char *inline_set(char *);
-#else
-char *inline_set();
-#endif
-
-/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */
-/* MR1 in DLG action */
-
-int tokenActionActive=0; /* MR1 */
-
-
-
-
-
-static char *
-#ifdef __USE_PROTOS
-getFileNameFromTheLineInfo(char *toStr, char *fromStr)
-#else
-getFileNameFromTheLineInfo(toStr, fromStr)
-char *toStr, *fromStr;
-#endif
-{
- int i, j, k;
-
- if (!fromStr || !toStr) return toStr;
-
- /* find the first " */
-
- for (i=0;
- (i<MaxFileName) &&
- (fromStr[i] != '\n') &&
- (fromStr[i] != '\r') &&
- (fromStr[i] != '\"');
- i++) /* nothing */ ;
-
- if ( (i == MaxFileName) ||
- (fromStr[i] == '\n') ||
- (fromStr[i] == '\r') ) {
- return toStr;
-}
-
- /* find the second " */
-
- for (j=i+1;
-(j<MaxFileName) &&
-(fromStr[j] != '\n') &&
-(fromStr[j] != '\r') &&
-(fromStr[j] != '\"');
-j++) /* nothing */ ;
-
- if ((j == MaxFileName) ||
-(fromStr[j] == '\n') ||
-(fromStr[j] == '\r') ) {
- return toStr;
-}
-
- /* go back until the last / or \ */
-
- for (k=j-1;
-(fromStr[k] != '\"') &&
-(fromStr[k] != '/') &&
-(fromStr[k] != '\\');
-k--) /* nothing */ ;
-
- /* copy the string after " / or \ into toStr */
-
- for (i=k+1; fromStr[i] != '\"'; i++) {
-toStr[i-k-1] = fromStr[i];
-}
-
- toStr[i-k-1] = '\0';
-
- return toStr;
-}
-
-/* MR14 end of a block to support #line in antlr source code */
-
-
-
-
-#ifdef __USE_PROTOS
-void mark_label_used_in_sem_pred(LabelEntry *le) /* MR10 */
-#else
-void mark_label_used_in_sem_pred(le) /* MR10 */
-LabelEntry *le;
-#endif
-{
- TokNode *tn;
- require (le->elem->ntype == nToken,"mark_label_used... ntype != nToken");
- tn=(TokNode *)le->elem;
- require (tn->label != 0,"mark_label_used... TokNode has no label");
- tn->label_used_in_semantic_pred=1;
-}
-
-static void act1()
-{
- NLA = Eof;
- /* L o o k F o r A n o t h e r F i l e */
- {
- FILE *new_input;
- new_input = NextFile();
- if ( new_input == NULL ) { NLA=Eof; return; }
- fclose( input );
- input = new_input;
- zzrdstream( input );
- zzskip(); /* Skip the Eof (@) char i.e continue */
- }
- }
-
-
-static void act2()
-{
- NLA = 76;
- zzskip();
- }
-
-
-static void act3()
-{
- NLA = 77;
- zzline++; zzskip();
- }
-
-
-static void act4()
-{
- NLA = 78;
- zzmode(ACTIONS); zzmore();
- istackreset();
- pushint(']');
- }
-
-
-static void act5()
-{
- NLA = 79;
- action_file=CurFile; action_line=zzline;
- zzmode(ACTIONS); zzmore();
- list_free(&CurActionLabels,0); /* MR10 */
- numericActionLabel=0; /* MR10 */
- istackreset();
- pushint('>');
- }
-
-
-static void act6()
-{
- NLA = 80;
- zzmode(STRINGS); zzmore();
- }
-
-
-static void act7()
-{
- NLA = 81;
- zzmode(COMMENTS); zzskip();
- }
-
-
-static void act8()
-{
- NLA = 82;
- warn("Missing /*; found dangling */"); zzskip();
- }
-
-
-static void act9()
-{
- NLA = 83;
- zzmode(CPP_COMMENTS); zzskip();
- }
-
-
-static void act10()
-{
- NLA = 84;
-
- zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore();
- getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr);
- }
-
-
-static void act11()
-{
- NLA = 85;
-
- zzline++; zzmore();
- }
-
-
-static void act12()
-{
- NLA = 86;
- warn("Missing <<; found dangling >>"); zzskip();
- }
-
-
-static void act13()
-{
- NLA = WildCard;
- }
-
-
-static void act14()
-{
- NLA = 88;
- FoundException = 1; /* MR6 */
- FoundAtOperator = 1;
- }
-
-
-static void act15()
-{
- NLA = Pragma;
- }
-
-
-static void act16()
-{
- NLA = FirstSetSymbol;
- }
-
-
-static void act17()
-{
- NLA = 94;
- }
-
-
-static void act18()
-{
- NLA = 95;
- }
-
-
-static void act19()
-{
- NLA = 96;
- }
-
-
-static void act20()
-{
- NLA = 97;
- }
-
-
-static void act21()
-{
- NLA = 98;
- }
-
-
-static void act22()
-{
- NLA = 99;
- }
-
-
-static void act23()
-{
- NLA = 102;
- }
-
-
-static void act24()
-{
- NLA = 103;
- }
-
-
-static void act25()
-{
- NLA = 104;
- }
-
-
-static void act26()
-{
- NLA = 105;
- }
-
-
-static void act27()
-{
- NLA = 106;
- }
-
-
-static void act28()
-{
- NLA = 107;
- }
-
-
-static void act29()
-{
- NLA = 108;
- }
-
-
-static void act30()
-{
- NLA = 109;
- }
-
-
-static void act31()
-{
- NLA = 110;
- }
-
-
-static void act32()
-{
- NLA = 111;
- }
-
-
-static void act33()
-{
- NLA = 112;
- }
-
-
-static void act34()
-{
- NLA = 113;
- }
-
-
-static void act35()
-{
- NLA = 114;
- }
-
-
-static void act36()
-{
- NLA = 115;
- }
-
-
-static void act37()
-{
- NLA = 116;
- }
-
-
-static void act38()
-{
- NLA = 117;
- }
-
-
-static void act39()
-{
- NLA = 118;
- }
-
-
-static void act40()
-{
- NLA = 119;
- }
-
-
-static void act41()
-{
- NLA = 120;
- }
-
-
-static void act42()
-{
- NLA = 121;
- }
-
-
-static void act43()
-{
- NLA = 122;
- }
-
-
-static void act44()
-{
- NLA = 123;
- }
-
-
-static void act45()
-{
- NLA = 124;
- }
-
-
-static void act46()
-{
- NLA = 125;
- }
-
-
-static void act47()
-{
- NLA = 126;
- }
-
-
-static void act48()
-{
- NLA = 127;
- }
-
-
-static void act49()
-{
- NLA = 128;
- }
-
-
-static void act50()
-{
- NLA = 129;
- }
-
-
-static void act51()
-{
- NLA = 130;
- }
-
-
-static void act52()
-{
- NLA = 131;
- }
-
-
-static void act53()
-{
- NLA = 132;
- }
-
-
-static void act54()
-{
- NLA = 133;
- }
-
-
-static void act55()
-{
- NLA = 134;
- }
-
-
-static void act56()
-{
- NLA = 135;
- }
-
-
-static void act57()
-{
- NLA = NonTerminal;
-
- while ( zzchar==' ' || zzchar=='\t' ) {
- zzadvance();
- }
- if ( zzchar == ':' && inAlt ) NLA = LABEL;
- }
-
-
-static void act58()
-{
- NLA = TokenTerm;
-
- while ( zzchar==' ' || zzchar=='\t' ) {
- zzadvance();
- }
- if ( zzchar == ':' && inAlt ) NLA = LABEL;
- }
-
-
-static void act59()
-{
- NLA = 136;
- warn(eMsg1("unknown meta-op: %s",LATEXT(1))); zzskip();
- }
-
-static unsigned char shift0[257] = {
- 0, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 1, 2, 58, 58, 3, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 1, 40, 6, 9, 58, 58, 45,
- 58, 46, 47, 8, 52, 58, 58, 18, 7, 16,
- 14, 15, 16, 16, 16, 16, 16, 16, 16, 41,
- 42, 5, 48, 17, 53, 19, 56, 56, 56, 56,
- 56, 26, 56, 56, 56, 56, 56, 51, 56, 56,
- 56, 56, 56, 56, 29, 56, 56, 56, 56, 56,
- 56, 56, 4, 20, 58, 50, 57, 58, 23, 31,
- 38, 34, 13, 35, 24, 33, 11, 55, 36, 10,
- 25, 12, 32, 21, 55, 22, 27, 28, 54, 55,
- 55, 43, 30, 55, 39, 44, 37, 49, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
- 58, 58, 58, 58, 58, 58, 58
-};
-
-
-static void act60()
-{
- NLA = Eof;
- }
-
-
-static void act61()
-{
- NLA = QuotedTerm;
- zzmode(START);
- }
-
-
-static void act62()
-{
- NLA = 3;
-
- zzline++;
- warn("eoln found in string");
- zzskip();
- }
-
-
-static void act63()
-{
- NLA = 4;
- zzline++; zzmore();
- }
-
-
-static void act64()
-{
- NLA = 5;
- zzmore();
- }
-
-
-static void act65()
-{
- NLA = 6;
- zzmore();
- }
-
-static unsigned char shift1[257] = {
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 2, 5, 5, 3, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 1, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 4, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5
-};
-
-
-static void act66()
-{
- NLA = Eof;
- }
-
-
-static void act67()
-{
- NLA = 7;
- zzmode(ACTIONS); zzmore();
- }
-
-
-static void act68()
-{
- NLA = 8;
-
- zzline++;
- warn("eoln found in string (in user action)");
- zzskip();
- }
-
-
-static void act69()
-{
- NLA = 9;
- zzline++; zzmore();
- }
-
-
-static void act70()
-{
- NLA = 10;
- zzmore();
- }
-
-
-static void act71()
-{
- NLA = 11;
- zzmore();
- }
-
-static unsigned char shift2[257] = {
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 2, 5, 5, 3, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 1, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 4, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5
-};
-
-
-static void act72()
-{
- NLA = Eof;
- }
-
-
-static void act73()
-{
- NLA = 12;
- zzmode(ACTIONS); zzmore();
- }
-
-
-static void act74()
-{
- NLA = 13;
-
- zzline++;
- warn("eoln found in char literal (in user action)");
- zzskip();
- }
-
-
-static void act75()
-{
- NLA = 14;
- zzmore();
- }
-
-
-static void act76()
-{
- NLA = 15;
- zzmore();
- }
-
-static unsigned char shift3[257] = {
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 2, 5, 5, 3, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 1, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 4, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5
-};
-
-
-static void act77()
-{
- NLA = Eof;
- }
-
-
-static void act78()
-{
- NLA = 16;
- zzmode(ACTIONS); zzmore();
- }
-
-
-static void act79()
-{
- NLA = 17;
- zzmore();
- }
-
-
-static void act80()
-{
- NLA = 18;
- zzline++; zzmore(); DAWDLE;
- }
-
-
-static void act81()
-{
- NLA = 19;
- zzmore();
- }
-
-static unsigned char shift4[257] = {
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 3, 5, 5, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 1, 5, 5, 5, 5, 2, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5
-};
-
-
-static void act82()
-{
- NLA = Eof;
- }
-
-
-static void act83()
-{
- NLA = 20;
- zzmode(PARSE_ENUM_FILE);
- zzmore();
- }
-
-
-static void act84()
-{
- NLA = 21;
- zzmore();
- }
-
-
-static void act85()
-{
- NLA = 22;
- zzline++; zzmore(); DAWDLE;
- }
-
-
-static void act86()
-{
- NLA = 23;
- zzmore();
- }
-
-static unsigned char shift5[257] = {
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 3, 5, 5, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 1, 5, 5, 5, 5, 2, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5
-};
-
-
-static void act87()
-{
- NLA = Eof;
- }
-
-
-static void act88()
-{
- NLA = 24;
- zzline++; zzmode(PARSE_ENUM_FILE); zzskip(); DAWDLE;
- }
-
-
-static void act89()
-{
- NLA = 25;
- zzskip();
- }
-
-static unsigned char shift6[257] = {
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 1, 3, 3, 2, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3
-};
-
-
-static void act90()
-{
- NLA = Eof;
- }
-
-
-static void act91()
-{
- NLA = 26;
- zzline++; zzmode(ACTIONS); zzmore(); DAWDLE;
- }
-
-
-static void act92()
-{
- NLA = 27;
- zzmore();
- }
-
-static unsigned char shift7[257] = {
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 1, 3, 3, 2, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3
-};
-
-
-static void act93()
-{
- NLA = Eof;
- }
-
-
-static void act94()
-{
- NLA = 28;
- zzline++; zzmode(START); zzskip(); DAWDLE;
- }
-
-
-static void act95()
-{
- NLA = 29;
- zzskip();
- }
-
-static unsigned char shift8[257] = {
- 0, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 1, 3, 3, 2, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3
-};
-
-
-static void act96()
-{
- NLA = Eof;
- }
-
-
-static void act97()
-{
- NLA = 30;
- zzmode(START); zzskip();
- }
-
-
-static void act98()
-{
- NLA = 31;
- zzskip();
- }
-
-
-static void act99()
-{
- NLA = 32;
- zzline++; zzskip(); DAWDLE;
- }
-
-
-static void act100()
-{
- NLA = 33;
- zzskip();
- }
-
-static unsigned char shift9[257] = {
- 0, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 3, 5, 5, 4, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 1, 5, 5, 5, 5, 2, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5
-};
-
-
-static void act101()
-{
- NLA = Eof;
- }
-
-
-static void act102()
-{
- NLA = Action;
- /* these do not nest */
- zzmode(START);
- NLATEXT[0] = ' ';
- NLATEXT[1] = ' ';
- zzbegexpr[0] = ' ';
- zzbegexpr[1] = ' ';
- if ( zzbufovf ) {
- err( eMsgd("action buffer overflow; size %d",ZZLEXBUFSIZE));
- }
-
-/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */
- /* MR1 in DLG action */
- /* MR1 Doesn't matter what kind of action it is - reset*/
-
- tokenActionActive=0; /* MR1 */
- }
-
-
-static void act103()
-{
- NLA = Pred;
- /* these do not nest */
- zzmode(START);
- NLATEXT[0] = ' ';
- NLATEXT[1] = ' ';
- zzbegexpr[0] = '\0';
- if ( zzbufovf ) {
- err( eMsgd("predicate buffer overflow; size %d",ZZLEXBUFSIZE));
- };
-#ifdef __cplusplus__
- /* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred);
-#else
-#ifdef __STDC__
- /* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred);
-#else
-#ifdef __USE_PROTOS
- /* MRxx */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred);
-#else
- /* MR10 */ list_apply(CurActionLabels,mark_label_used_in_sem_pred);
-#endif
-#endif
-#endif
- }
-
-
-static void act104()
-{
- NLA = PassAction;
- if ( topint() == ']' ) {
- popint();
- if ( istackempty() ) /* terminate action */
- {
- zzmode(START);
- NLATEXT[0] = ' ';
- zzbegexpr[0] = ' ';
- if ( zzbufovf ) {
- err( eMsgd("parameter buffer overflow; size %d",ZZLEXBUFSIZE));
- }
- }
- else {
- /* terminate $[..] and #[..] */
- if ( GenCC ) zzreplstr("))");
- else zzreplstr(")");
- zzmore();
- }
- }
- else if ( topint() == '|' ) { /* end of simple [...] */
- popint();
- zzmore();
- }
- else zzmore();
- }
-
-
-static void act105()
-{
- NLA = 37;
-
- zzmore();
- zzreplstr(inline_set(zzbegexpr+
- strlen("consumeUntil(")));
- }
-
-
-static void act106()
-{
- NLA = 38;
- zzmore();
- }
-
-
-static void act107()
-{
- NLA = 39;
- zzline++; zzmore(); DAWDLE;
- }
-
-
-static void act108()
-{
- NLA = 40;
- zzmore();
- }
-
-
-static void act109()
-{
- NLA = 41;
- zzmore();
- }
-
-
-static void act110()
-{
- NLA = 42;
- if ( !GenCC ) {zzreplstr("zzaRet"); zzmore();}
- else err("$$ use invalid in C++ mode");
- }
-
-
-static void act111()
-{
- NLA = 43;
- if ( !GenCC ) {zzreplstr("zzempty_attr"); zzmore();}
- else err("$[] use invalid in C++ mode");
- }
-
-
-static void act112()
-{
- NLA = 44;
-
- pushint(']');
- if ( !GenCC ) zzreplstr("zzconstr_attr(");
- else err("$[..] use invalid in C++ mode");
- zzmore();
- }
-
-
-static void act113()
-{
- NLA = 45;
- {
- static char buf[100];
- numericActionLabel=1; /* MR10 */
- if ( strlen(zzbegexpr)>(size_t)85 )
- fatal("$i attrib ref too big");
- set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction);
- if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s)",
- BlkLevel-1,zzbegexpr+1);
- else sprintf(buf,"_t%d%s",
- BlkLevel-1,zzbegexpr+1);
- zzreplstr(buf);
- zzmore();
- UsedOldStyleAttrib = 1;
- if ( UsedNewStyleLabel )
- err("cannot mix old-style $i with new-style labels");
- }
- }
-
-
-static void act114()
-{
- NLA = 46;
- {
- static char buf[100];
- numericActionLabel=1; /* MR10 */
- if ( strlen(zzbegexpr)>(size_t)85 )
- fatal("$i.field attrib ref too big");
- zzbegexpr[strlen(zzbegexpr)-1] = ' ';
- set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction);
- if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s).",
- BlkLevel-1,zzbegexpr+1);
- else sprintf(buf,"_t%d%s.",
- BlkLevel-1,zzbegexpr+1);
- zzreplstr(buf);
- zzmore();
- UsedOldStyleAttrib = 1;
- if ( UsedNewStyleLabel )
- err("cannot mix old-style $i with new-style labels");
- }
- }
-
-
-static void act115()
-{
- NLA = 47;
- {
- static char buf[100];
- static char i[20], j[20];
- char *p,*q;
- numericActionLabel=1; /* MR10 */
- if (strlen(zzbegexpr)>(size_t)85) fatal("$i.j attrib ref too big");
- for (p=zzbegexpr+1,q= &i[0]; *p!='.'; p++) {
- if ( q == &i[20] )
- fatalFL("i of $i.j attrib ref too big",
- FileStr[CurFile], zzline );
- *q++ = *p;
- }
- *q = '\0';
- for (p++, q= &j[0]; *p!='\0'; p++) {
- if ( q == &j[20] )
- fatalFL("j of $i.j attrib ref too big",
- FileStr[CurFile], zzline );
- *q++ = *p;
- }
- *q = '\0';
- if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%s,%s)",i,j);
- else sprintf(buf,"_t%s%s",i,j);
- zzreplstr(buf);
- zzmore();
- UsedOldStyleAttrib = 1;
- if ( UsedNewStyleLabel )
- err("cannot mix old-style $i with new-style labels");
- }
- }
-
-
-static void act116()
-{
- NLA = 48;
- { static char buf[300]; LabelEntry *el;
- zzbegexpr[0] = ' ';
- if ( CurRule != NULL &&
- strcmp(CurRule, &zzbegexpr[1])==0 ) {
- if ( !GenCC ) zzreplstr("zzaRet");
- }
- else if ( CurRetDef != NULL &&
- strmember(CurRetDef, &zzbegexpr[1])) {
- if ( hasMultipleOperands( CurRetDef ) ) {
- require (strlen(zzbegexpr)<=(size_t)285,
- "$retval attrib ref too big");
- sprintf(buf,"_retv.%s",&zzbegexpr[1]);
- zzreplstr(buf);
- }
- else zzreplstr("_retv");
- }
- else if ( CurParmDef != NULL &&
- strmember(CurParmDef, &zzbegexpr[1])) {
- ;
- }
- else if ( Elabel==NULL ) {
- { err("$-variables in actions outside of rules are not allowed"); }
- } else if ( (el=(LabelEntry *)hash_get(Elabel, &zzbegexpr[1]))!=NULL ) {
- /* MR10 */
- /* MR10 */ /* element labels might exist without an elem when */
- /* MR10 */ /* it is a forward reference (to a rule) */
- /* MR10 */
- /* MR10 */ if ( GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) )
- /* MR10 */ { err(eMsg1("There are no token ptrs for rule references: '$%s'",&zzbegexpr[1])); }
- /* MR10 */
- /* MR10 */ if ( !GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) && GenAST) {
- /* MR10 */ err("You can no longer use attributes returned by rules when also using ASTs");
- /* MR10 */ err(" Use upward inheritance (\"rule >[Attrib a] : ... <<$a=...>>\")");
- /* MR10 */ };
- /* MR10 */
- /* MR10 */ /* keep track of <<... $label ...>> for semantic predicates in guess mode */
- /* MR10 */ /* element labels contain pointer to the owners node */
- /* MR10 */
- /* MR10 */ if (el->elem != NULL && el->elem->ntype == nToken) {
- /* MR10 */ list_add(&CurActionLabels,el);
- /* MR10 */ };
-}
-else
-warn(eMsg1("$%s not parameter, return value, (defined) element label",&zzbegexpr[1]));
-}
-zzmore();
- }
-
-
-static void act117()
-{
- NLA = 49;
- zzreplstr("(*_root)"); zzmore(); chkGTFlag();
- }
-
-
-static void act118()
-{
- NLA = 50;
- if ( GenCC ) {
- if (NewAST) zzreplstr("(newAST)");
- else zzreplstr("(new AST)");}
- else {zzreplstr("zzastnew()");} zzmore();
- chkGTFlag();
- }
-
-
-static void act119()
-{
- NLA = 51;
- zzreplstr("NULL"); zzmore(); chkGTFlag();
- }
-
-
-static void act120()
-{
- NLA = 52;
- {
- static char buf[100];
- if ( strlen(zzbegexpr)>(size_t)85 )
- fatal("#i AST ref too big");
- if ( GenCC ) sprintf(buf,"_ast%d%s",BlkLevel-1,zzbegexpr+1);
- else sprintf(buf,"zzastArg(%s)",zzbegexpr+1);
- zzreplstr(buf);
- zzmore();
- set_orel(atoi(zzbegexpr+1), &AST_nodes_refd_in_actions);
- chkGTFlag();
- }
- }
-
-
-static void act121()
-{
- NLA = 53;
-
- zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore();
- getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr);
- }
-
-
-static void act122()
-{
- NLA = 54;
-
- zzline++; zzmore();
- }
-
-
-static void act123()
-{
- NLA = 55;
-
- if ( !(strcmp(zzbegexpr, "#ifdef")==0 ||
- strcmp(zzbegexpr, "#if")==0 ||
- strcmp(zzbegexpr, "#else")==0 ||
- strcmp(zzbegexpr, "#endif")==0 ||
- strcmp(zzbegexpr, "#ifndef")==0 ||
- strcmp(zzbegexpr, "#define")==0 ||
- strcmp(zzbegexpr, "#pragma")==0 ||
- strcmp(zzbegexpr, "#undef")==0 ||
- strcmp(zzbegexpr, "#import")==0 ||
- strcmp(zzbegexpr, "#line")==0 ||
- strcmp(zzbegexpr, "#include")==0 ||
- strcmp(zzbegexpr, "#error")==0) )
- {
- static char buf[100];
- sprintf(buf, "%s_ast", zzbegexpr+1);
- /* MR27 */ list_add(&CurAstLabelsInActions, mystrdup(zzbegexpr+1));
- zzreplstr(buf);
- chkGTFlag();
- }
- zzmore();
- }
-
-
-static void act124()
-{
- NLA = 56;
-
- pushint(']');
- if ( GenCC ) {
- if (NewAST) zzreplstr("(newAST(");
- else zzreplstr("(new AST("); }
- else zzreplstr("zzmk_ast(zzastnew(),");
- zzmore();
- chkGTFlag();
- }
-
-
-static void act125()
-{
- NLA = 57;
-
- pushint('}');
- if ( GenCC ) {
- if (tmakeInParser) {
- zzreplstr("tmake(");
- }
- else {
- zzreplstr("ASTBase::tmake(");
- }
- }
- else {
- zzreplstr("zztmake(");
- }
- zzmore();
- chkGTFlag();
- }
-
-
-static void act126()
-{
- NLA = 58;
- zzmore();
- }
-
-
-static void act127()
-{
- NLA = 59;
-
- if ( istackempty() )
- zzmore();
- else if ( topint()==')' ) {
- popint();
- }
- else if ( topint()=='}' ) {
- popint();
- /* terminate #(..) */
- zzreplstr(", NULL)");
- }
- zzmore();
- }
-
-
-static void act128()
-{
- NLA = 60;
-
- pushint('|'); /* look for '|' to terminate simple [...] */
- zzmore();
- }
-
-
-static void act129()
-{
- NLA = 61;
-
- pushint(')');
- zzmore();
- }
-
-
-static void act130()
-{
- NLA = 62;
- zzreplstr("]"); zzmore();
- }
-
-
-static void act131()
-{
- NLA = 63;
- zzreplstr(")"); zzmore();
- }
-
-
-static void act132()
-{
- NLA = 64;
- if (! tokenActionActive) zzreplstr(">"); /* MR1 */
- zzmore(); /* MR1 */
- }
-
-
-static void act133()
-{
- NLA = 65;
- zzmode(ACTION_CHARS); zzmore();
- }
-
-
-static void act134()
-{
- NLA = 66;
- zzmode(ACTION_STRINGS); zzmore();
- }
-
-
-static void act135()
-{
- NLA = 67;
- zzreplstr("$"); zzmore();
- }
-
-
-static void act136()
-{
- NLA = 68;
- zzreplstr("#"); zzmore();
- }
-
-
-static void act137()
-{
- NLA = 69;
- zzline++; zzmore();
- }
-
-
-static void act138()
-{
- NLA = 70;
- zzmore();
- }
-
-
-static void act139()
-{
- NLA = 71;
- zzmore();
- }
-
-
-static void act140()
-{
- NLA = 72;
- zzmode(ACTION_COMMENTS); zzmore();
- }
-
-
-static void act141()
-{
- NLA = 73;
- warn("Missing /*; found dangling */ in action"); zzmore();
- }
-
-
-static void act142()
-{
- NLA = 74;
- zzmode(ACTION_CPP_COMMENTS); zzmore();
- }
-
-
-static void act143()
-{
- NLA = 75;
- zzmore();
- }
-
-static unsigned char shift10[257] = {
- 0, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 16, 19, 33, 33, 20, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 16, 33, 28, 27, 21, 33, 33,
- 30, 15, 18, 32, 33, 33, 33, 25, 31, 23,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 33,
- 33, 33, 33, 1, 2, 33, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 11, 26, 26, 26,
- 26, 26, 22, 29, 3, 33, 26, 33, 26, 26,
- 4, 26, 10, 26, 26, 26, 13, 26, 26, 14,
- 9, 6, 5, 26, 26, 26, 7, 12, 8, 26,
- 26, 26, 26, 26, 17, 33, 34, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33
-};
-
-
-static void act144()
-{
- NLA = Eof;
- ;
- }
-
-
-static void act145()
-{
- NLA = 137;
- zzskip();
- }
-
-
-static void act146()
-{
- NLA = 138;
- zzline++; zzskip();
- }
-
-
-static void act147()
-{
- NLA = 139;
- zzmode(TOK_DEF_CPP_COMMENTS); zzmore();
- }
-
-
-static void act148()
-{
- NLA = 140;
- zzmode(TOK_DEF_COMMENTS); zzskip();
- }
-
-
-static void act149()
-{
- NLA = 141;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- }
-
-
-static void act150()
-{
- NLA = 142;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- }
-
-
-static void act151()
-{
- NLA = 143;
- ;
- }
-
-
-static void act152()
-{
- NLA = 144;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- }
-
-
-static void act153()
-{
- NLA = 145;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- }
-
-
-static void act154()
-{
- NLA = 146;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- }
-
-
-static void act155()
-{
- NLA = 147;
- zzmode(TOK_DEF_CPP_COMMENTS); zzskip();
- }
-
-
-static void act156()
-{
- NLA = 149;
- }
-
-
-static void act157()
-{
- NLA = 151;
- }
-
-
-static void act158()
-{
- NLA = 152;
- }
-
-
-static void act159()
-{
- NLA = 153;
- }
-
-
-static void act160()
-{
- NLA = 154;
- }
-
-
-static void act161()
-{
- NLA = 155;
- }
-
-
-static void act162()
-{
- NLA = 156;
- }
-
-
-static void act163()
-{
- NLA = INT;
- }
-
-
-static void act164()
-{
- NLA = ID;
- }
-
-static unsigned char shift11[257] = {
- 0, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 1, 2, 27, 27, 3, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 1, 27, 27, 6, 27, 27, 27,
- 27, 27, 27, 5, 27, 22, 27, 27, 4, 25,
- 25, 25, 25, 25, 25, 25, 25, 25, 25, 27,
- 24, 27, 21, 27, 27, 27, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 27, 27, 27, 27, 26, 27, 26, 26,
- 26, 9, 10, 8, 26, 26, 7, 26, 26, 12,
- 15, 11, 17, 16, 26, 18, 13, 19, 14, 26,
- 26, 26, 26, 26, 20, 27, 23, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27
-};
-
-#define DfaStates 436
-typedef unsigned short DfaState;
-
-static DfaState st0[60] = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 11, 11, 12, 13, 13, 13, 14, 15, 16,
- 17, 11, 11, 18, 11, 11, 19, 11, 11, 19,
- 11, 11, 11, 11, 20, 11, 11, 21, 22, 23,
- 24, 25, 26, 11, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 11, 11, 19, 436, 436, 436
-};
-
-static DfaState st1[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st2[60] = {
- 436, 2, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st3[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st4[60] = {
- 436, 436, 37, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st5[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st6[60] = {
- 436, 436, 436, 436, 436, 38, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st7[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st8[60] = {
- 436, 436, 436, 436, 436, 436, 436, 39, 40, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st9[60] = {
- 436, 436, 436, 436, 436, 436, 436, 41, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st10[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 42, 43, 43, 44, 43, 43, 43, 436, 436, 436,
- 436, 45, 43, 43, 43, 43, 46, 43, 47, 43,
- 43, 43, 43, 48, 43, 49, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st11[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st12[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 51, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st13[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 13, 13, 13, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st14[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 52, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st15[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 53, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st16[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st17[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 54,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st18[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 55, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st19[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 56, 56, 56, 56, 56, 56, 56, 436, 436, 436,
- 436, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 436, 56, 436,
- 436, 436, 436, 56, 436, 436, 436, 436, 436, 436,
- 436, 56, 436, 436, 56, 56, 56, 56, 436, 436
-};
-
-static DfaState st20[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 57, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st21[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st22[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 58, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 59, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st23[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st24[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st25[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st26[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st27[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 60, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st28[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 61, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st29[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st30[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st31[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 62, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st32[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st33[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st34[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 56, 56, 56, 56, 56, 56, 56, 436, 436, 436,
- 436, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 436, 56, 436,
- 436, 436, 436, 56, 436, 436, 436, 436, 436, 436,
- 436, 63, 436, 436, 56, 56, 56, 56, 436, 436
-};
-
-static DfaState st35[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st36[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st37[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st38[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st39[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st40[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st41[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st42[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 64, 43, 65, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st43[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st44[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 66, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st45[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 67, 68, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st46[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 69, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st47[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 70, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st48[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 71, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st49[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 72, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st50[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st51[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 73, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st52[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st53[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st54[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 74, 43, 43, 44, 43, 43, 43, 436, 436, 436,
- 436, 45, 43, 43, 43, 43, 46, 43, 47, 43,
- 43, 43, 43, 48, 43, 49, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st55[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 75, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st56[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 56, 56, 56, 56, 56, 56, 56, 436, 436, 436,
- 436, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 436, 56, 436,
- 436, 436, 436, 56, 436, 436, 436, 436, 436, 436,
- 436, 56, 436, 436, 56, 56, 56, 56, 436, 436
-};
-
-static DfaState st57[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 76, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st58[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 77, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st59[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 78, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st60[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st61[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st62[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st63[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 56, 56, 56, 56, 56, 56, 56, 436, 436, 436,
- 436, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 436, 56, 436,
- 436, 436, 436, 56, 436, 436, 79, 436, 436, 436,
- 436, 56, 436, 436, 56, 56, 56, 56, 436, 436
-};
-
-static DfaState st64[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 80, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st65[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 81, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st66[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 82, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st67[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 83, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 84, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st68[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 85, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st69[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 86, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st70[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 87, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st71[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 88, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st72[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 89, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st73[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 90, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st74[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 65, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st75[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 91, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st76[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 92, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st77[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 93, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st78[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 94, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st79[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 95, 96, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st80[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 97, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st81[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 98, 43, 99, 43, 100, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 101, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st82[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 102, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st83[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 103, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st84[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 104, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st85[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 105, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st86[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 106, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st87[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 107, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 108, 43, 43, 436, 109, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st88[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 110, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st89[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 111, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st90[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 112, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st91[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 113, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st92[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 114, 50, 50, 50, 436, 436
-};
-
-static DfaState st93[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 115, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st94[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 116, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st95[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 117, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st96[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 118, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st97[60] = {
- 436, 119, 120, 121, 122, 122, 122, 122, 122, 122,
- 123, 123, 123, 123, 124, 124, 124, 122, 122, 122,
- 122, 123, 123, 123, 123, 123, 123, 123, 123, 123,
- 123, 123, 123, 123, 123, 123, 123, 122, 123, 122,
- 122, 122, 122, 123, 122, 122, 122, 122, 122, 122,
- 122, 123, 122, 122, 123, 123, 123, 123, 122, 436
-};
-
-static DfaState st98[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 125, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st99[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 126, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st100[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 127, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st101[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 128, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st102[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 129, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st103[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st104[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 130, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st105[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 131, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st106[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 132, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st107[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 133, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st108[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 134, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st109[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 135, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st110[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 136, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st111[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 137, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st112[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 138, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st113[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 139, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st114[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 140, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st115[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st116[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st117[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st118[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st119[60] = {
- 436, 119, 120, 121, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 141, 141, 141, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 436
-};
-
-static DfaState st120[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st121[60] = {
- 436, 436, 142, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st122[60] = {
- 436, 122, 120, 121, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 436
-};
-
-static DfaState st123[60] = {
- 436, 122, 120, 121, 122, 122, 122, 122, 122, 122,
- 123, 123, 123, 123, 123, 123, 123, 122, 122, 122,
- 122, 123, 123, 123, 123, 123, 123, 123, 123, 123,
- 123, 123, 123, 123, 123, 123, 123, 122, 123, 122,
- 122, 122, 122, 123, 122, 122, 122, 122, 122, 122,
- 122, 123, 122, 122, 123, 123, 123, 123, 122, 436
-};
-
-static DfaState st124[60] = {
- 436, 143, 144, 145, 122, 122, 146, 122, 122, 122,
- 123, 123, 123, 123, 124, 124, 124, 122, 122, 122,
- 122, 123, 123, 123, 123, 123, 123, 123, 123, 123,
- 123, 123, 123, 123, 123, 123, 123, 122, 123, 122,
- 122, 122, 122, 123, 122, 122, 122, 122, 122, 122,
- 122, 123, 122, 122, 123, 123, 123, 123, 122, 436
-};
-
-static DfaState st125[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 147, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st126[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 148, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st127[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 149, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st128[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 150, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st129[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 151, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st130[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 152, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st131[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 153, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st132[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 154,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st133[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st134[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 155, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st135[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 156, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st136[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 157, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st137[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st138[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 158, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st139[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st140[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 159, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st141[60] = {
- 436, 143, 144, 145, 122, 122, 146, 122, 122, 122,
- 122, 122, 122, 122, 141, 141, 141, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 436
-};
-
-static DfaState st142[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st143[60] = {
- 436, 143, 120, 121, 122, 122, 146, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 436
-};
-
-static DfaState st144[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st145[60] = {
- 436, 436, 160, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st146[60] = {
- 436, 161, 162, 163, 161, 161, 122, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 436
-};
-
-static DfaState st147[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 164, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st148[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 165, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st149[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 166, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st150[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 167, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st151[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 168, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st152[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st153[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st154[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 169, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st155[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 170, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st156[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 171, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st157[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st158[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 172, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st159[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st160[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st161[60] = {
- 436, 161, 162, 163, 161, 161, 173, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
- 161, 161, 161, 161, 161, 161, 161, 161, 161, 436
-};
-
-static DfaState st162[60] = {
- 436, 174, 174, 174, 174, 174, 175, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 436
-};
-
-static DfaState st163[60] = {
- 436, 174, 176, 174, 174, 174, 175, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 436
-};
-
-static DfaState st164[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 177, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st165[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 178, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st166[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 179, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st167[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 180, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st168[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 181, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st169[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 182, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st170[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st171[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 183, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st172[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 184, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st173[60] = {
- 436, 185, 144, 145, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 186, 186, 186, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 436
-};
-
-static DfaState st174[60] = {
- 436, 174, 174, 174, 174, 174, 175, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 436
-};
-
-static DfaState st175[60] = {
- 436, 187, 188, 189, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 190, 190, 190, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st176[60] = {
- 436, 174, 174, 174, 174, 174, 175, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 174, 174, 174, 436
-};
-
-static DfaState st177[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 191, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st178[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 192, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st179[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 193, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st180[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st181[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st182[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 194,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st183[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st184[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 50, 50, 50, 50, 50, 50, 50, 436, 436, 436,
- 436, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 436, 50, 436,
- 436, 436, 436, 50, 436, 436, 436, 436, 436, 436,
- 436, 50, 436, 436, 50, 50, 50, 50, 436, 436
-};
-
-static DfaState st185[60] = {
- 436, 185, 144, 145, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 186, 186, 186, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 436
-};
-
-static DfaState st186[60] = {
- 436, 185, 144, 145, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 186, 186, 186, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
- 122, 122, 122, 122, 122, 122, 122, 122, 122, 436
-};
-
-static DfaState st187[60] = {
- 436, 187, 188, 189, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 190, 190, 190, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st188[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st189[60] = {
- 436, 436, 195, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st190[60] = {
- 436, 187, 188, 189, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 190, 190, 190, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st191[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st192[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st193[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st194[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 196, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st195[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st196[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 197, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st197[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 198, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st198[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 199, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st199[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 200, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st200[60] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 43, 43, 43, 43, 43, 43, 43, 436, 436, 436,
- 436, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 436, 43, 436,
- 436, 436, 436, 43, 436, 436, 436, 436, 436, 436,
- 436, 43, 436, 436, 43, 43, 43, 43, 436, 436
-};
-
-static DfaState st201[7] = {
- 202, 203, 204, 205, 206, 207, 436
-};
-
-static DfaState st202[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st203[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st204[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st205[7] = {
- 436, 436, 208, 436, 436, 436, 436
-};
-
-static DfaState st206[7] = {
- 436, 209, 210, 211, 209, 209, 436
-};
-
-static DfaState st207[7] = {
- 436, 436, 436, 436, 436, 207, 436
-};
-
-static DfaState st208[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st209[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st210[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st211[7] = {
- 436, 436, 212, 436, 436, 436, 436
-};
-
-static DfaState st212[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st213[7] = {
- 214, 215, 216, 217, 218, 219, 436
-};
-
-static DfaState st214[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st215[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st216[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st217[7] = {
- 436, 436, 220, 436, 436, 436, 436
-};
-
-static DfaState st218[7] = {
- 436, 221, 222, 223, 221, 221, 436
-};
-
-static DfaState st219[7] = {
- 436, 436, 436, 436, 436, 219, 436
-};
-
-static DfaState st220[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st221[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st222[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st223[7] = {
- 436, 436, 224, 436, 436, 436, 436
-};
-
-static DfaState st224[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st225[7] = {
- 226, 227, 228, 229, 230, 231, 436
-};
-
-static DfaState st226[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st227[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st228[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st229[7] = {
- 436, 436, 232, 436, 436, 436, 436
-};
-
-static DfaState st230[7] = {
- 436, 233, 233, 233, 233, 233, 436
-};
-
-static DfaState st231[7] = {
- 436, 436, 436, 436, 436, 231, 436
-};
-
-static DfaState st232[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st233[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st234[7] = {
- 235, 236, 237, 238, 239, 237, 436
-};
-
-static DfaState st235[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st236[7] = {
- 436, 436, 240, 436, 436, 436, 436
-};
-
-static DfaState st237[7] = {
- 436, 436, 237, 436, 436, 237, 436
-};
-
-static DfaState st238[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st239[7] = {
- 436, 436, 436, 241, 436, 436, 436
-};
-
-static DfaState st240[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st241[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st242[7] = {
- 243, 244, 245, 246, 247, 245, 436
-};
-
-static DfaState st243[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st244[7] = {
- 436, 436, 248, 436, 436, 436, 436
-};
-
-static DfaState st245[7] = {
- 436, 436, 245, 436, 436, 245, 436
-};
-
-static DfaState st246[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st247[7] = {
- 436, 436, 436, 249, 436, 436, 436
-};
-
-static DfaState st248[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st249[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st250[5] = {
- 251, 252, 253, 254, 436
-};
-
-static DfaState st251[5] = {
- 436, 436, 436, 436, 436
-};
-
-static DfaState st252[5] = {
- 436, 436, 436, 436, 436
-};
-
-static DfaState st253[5] = {
- 436, 255, 436, 436, 436
-};
-
-static DfaState st254[5] = {
- 436, 436, 436, 254, 436
-};
-
-static DfaState st255[5] = {
- 436, 436, 436, 436, 436
-};
-
-static DfaState st256[5] = {
- 257, 258, 259, 260, 436
-};
-
-static DfaState st257[5] = {
- 436, 436, 436, 436, 436
-};
-
-static DfaState st258[5] = {
- 436, 436, 436, 436, 436
-};
-
-static DfaState st259[5] = {
- 436, 261, 436, 436, 436
-};
-
-static DfaState st260[5] = {
- 436, 436, 436, 260, 436
-};
-
-static DfaState st261[5] = {
- 436, 436, 436, 436, 436
-};
-
-static DfaState st262[5] = {
- 263, 264, 265, 266, 436
-};
-
-static DfaState st263[5] = {
- 436, 436, 436, 436, 436
-};
-
-static DfaState st264[5] = {
- 436, 436, 436, 436, 436
-};
-
-static DfaState st265[5] = {
- 436, 267, 436, 436, 436
-};
-
-static DfaState st266[5] = {
- 436, 436, 436, 266, 436
-};
-
-static DfaState st267[5] = {
- 436, 436, 436, 436, 436
-};
-
-static DfaState st268[7] = {
- 269, 270, 271, 272, 273, 271, 436
-};
-
-static DfaState st269[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st270[7] = {
- 436, 436, 274, 436, 436, 436, 436
-};
-
-static DfaState st271[7] = {
- 436, 436, 271, 436, 436, 271, 436
-};
-
-static DfaState st272[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st273[7] = {
- 436, 436, 436, 275, 436, 436, 436
-};
-
-static DfaState st274[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st275[7] = {
- 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st276[36] = {
- 277, 278, 279, 280, 281, 279, 279, 279, 279, 279,
- 279, 279, 279, 279, 279, 282, 279, 279, 283, 284,
- 285, 286, 287, 279, 279, 279, 279, 288, 289, 290,
- 291, 292, 293, 279, 279, 436
-};
-
-static DfaState st277[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st278[36] = {
- 436, 294, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st279[36] = {
- 436, 436, 279, 436, 279, 279, 279, 279, 279, 279,
- 279, 279, 279, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st280[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st281[36] = {
- 436, 436, 279, 436, 279, 295, 279, 279, 279, 279,
- 279, 279, 279, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st282[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st283[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st284[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st285[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 296,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st286[36] = {
- 436, 436, 436, 436, 297, 297, 297, 297, 297, 297,
- 297, 297, 297, 297, 297, 436, 436, 436, 436, 436,
- 436, 298, 299, 300, 300, 436, 297, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st287[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st288[36] = {
- 436, 436, 436, 436, 301, 301, 301, 301, 301, 301,
- 301, 301, 301, 301, 302, 303, 436, 436, 436, 436,
- 436, 436, 304, 305, 306, 436, 301, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st289[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st290[36] = {
- 436, 307, 308, 309, 308, 308, 308, 308, 308, 308,
- 308, 308, 308, 308, 308, 308, 308, 308, 310, 311,
- 312, 313, 308, 308, 308, 308, 308, 314, 308, 308,
- 308, 308, 308, 308, 308, 436
-};
-
-static DfaState st291[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st292[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 315, 316, 436, 436, 436
-};
-
-static DfaState st293[36] = {
- 436, 436, 279, 436, 279, 279, 279, 279, 279, 279,
- 279, 279, 279, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 317, 279, 279, 279, 436
-};
-
-static DfaState st294[36] = {
- 436, 436, 318, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st295[36] = {
- 436, 436, 279, 436, 279, 279, 319, 279, 279, 279,
- 279, 279, 279, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st296[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st297[36] = {
- 436, 436, 436, 436, 320, 320, 320, 320, 320, 320,
- 320, 320, 320, 320, 320, 436, 436, 436, 436, 436,
- 436, 436, 436, 320, 320, 436, 320, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st298[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st299[36] = {
- 436, 436, 436, 321, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st300[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 300, 300, 322, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st301[36] = {
- 436, 436, 436, 436, 323, 323, 323, 323, 323, 323,
- 323, 323, 323, 323, 323, 436, 436, 436, 436, 436,
- 436, 436, 436, 323, 323, 436, 323, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st302[36] = {
- 436, 436, 436, 436, 323, 323, 323, 323, 323, 323,
- 323, 323, 323, 324, 323, 436, 436, 436, 436, 436,
- 436, 436, 436, 323, 323, 436, 323, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st303[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 325, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st304[36] = {
- 436, 436, 436, 326, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st305[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 306, 306, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st306[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 306, 306, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st307[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st308[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st309[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st310[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st311[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st312[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 327,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st313[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st314[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st315[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st316[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st317[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st318[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st319[36] = {
- 436, 436, 279, 436, 279, 279, 279, 328, 279, 279,
- 279, 279, 279, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st320[36] = {
- 436, 436, 436, 436, 320, 320, 320, 320, 320, 320,
- 320, 320, 320, 320, 320, 436, 436, 436, 436, 436,
- 436, 436, 436, 320, 320, 436, 320, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st321[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st322[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 329, 329, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st323[36] = {
- 436, 436, 436, 436, 323, 323, 323, 323, 323, 323,
- 323, 323, 323, 323, 323, 436, 436, 436, 436, 436,
- 436, 436, 436, 323, 323, 436, 323, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st324[36] = {
- 436, 436, 436, 436, 323, 323, 330, 323, 323, 323,
- 323, 323, 323, 323, 323, 436, 436, 436, 436, 436,
- 436, 436, 436, 323, 323, 436, 323, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st325[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st326[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st327[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st328[36] = {
- 436, 436, 279, 436, 279, 279, 279, 279, 331, 279,
- 279, 279, 279, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st329[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 329, 329, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st330[36] = {
- 436, 436, 436, 436, 323, 323, 323, 323, 323, 323,
- 332, 323, 323, 323, 323, 436, 436, 436, 436, 436,
- 436, 436, 436, 323, 323, 436, 323, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st331[36] = {
- 436, 436, 279, 436, 279, 279, 279, 279, 279, 333,
- 279, 279, 279, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st332[36] = {
- 436, 334, 334, 334, 335, 335, 335, 335, 335, 335,
- 335, 335, 335, 335, 335, 334, 336, 334, 334, 337,
- 338, 334, 334, 339, 339, 334, 335, 334, 334, 334,
- 334, 334, 334, 334, 334, 436
-};
-
-static DfaState st333[36] = {
- 436, 436, 279, 436, 279, 279, 279, 279, 279, 279,
- 340, 279, 279, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st334[36] = {
- 436, 334, 334, 334, 334, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 334, 334, 334, 334, 337,
- 338, 334, 334, 334, 334, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 436
-};
-
-static DfaState st335[36] = {
- 436, 334, 334, 334, 335, 335, 335, 335, 335, 335,
- 335, 335, 335, 335, 335, 334, 334, 334, 334, 337,
- 338, 334, 334, 335, 335, 334, 335, 334, 334, 334,
- 334, 334, 334, 334, 334, 436
-};
-
-static DfaState st336[36] = {
- 436, 334, 334, 334, 334, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 334, 336, 334, 334, 337,
- 338, 334, 334, 341, 341, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 436
-};
-
-static DfaState st337[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st338[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 342,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st339[36] = {
- 436, 334, 334, 334, 335, 335, 335, 335, 335, 335,
- 335, 335, 335, 335, 335, 334, 343, 334, 334, 344,
- 345, 334, 334, 339, 339, 334, 335, 334, 346, 334,
- 334, 334, 334, 334, 334, 436
-};
-
-static DfaState st340[36] = {
- 436, 436, 279, 436, 279, 279, 279, 279, 279, 279,
- 279, 347, 279, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st341[36] = {
- 436, 334, 334, 334, 334, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 334, 343, 334, 334, 344,
- 345, 334, 334, 341, 341, 334, 334, 334, 346, 334,
- 334, 334, 334, 334, 334, 436
-};
-
-static DfaState st342[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st343[36] = {
- 436, 334, 334, 334, 334, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 334, 343, 334, 334, 337,
- 338, 334, 334, 334, 334, 334, 334, 334, 346, 334,
- 334, 334, 334, 334, 334, 436
-};
-
-static DfaState st344[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st345[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 348,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st346[36] = {
- 436, 349, 349, 349, 349, 349, 349, 349, 349, 349,
- 349, 349, 349, 349, 349, 349, 349, 349, 349, 350,
- 351, 349, 349, 349, 349, 349, 349, 349, 334, 349,
- 349, 349, 349, 349, 349, 436
-};
-
-static DfaState st347[36] = {
- 436, 436, 279, 436, 279, 279, 352, 279, 279, 279,
- 279, 279, 279, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st348[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st349[36] = {
- 436, 349, 349, 349, 349, 349, 349, 349, 349, 349,
- 349, 349, 349, 349, 349, 349, 349, 349, 349, 350,
- 351, 349, 349, 349, 349, 349, 349, 349, 353, 349,
- 349, 349, 349, 349, 349, 436
-};
-
-static DfaState st350[36] = {
- 436, 354, 354, 354, 354, 354, 354, 354, 354, 354,
- 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
- 354, 354, 354, 354, 354, 354, 354, 354, 355, 354,
- 354, 354, 354, 354, 354, 436
-};
-
-static DfaState st351[36] = {
- 436, 354, 354, 354, 354, 354, 354, 354, 354, 354,
- 354, 354, 354, 354, 354, 354, 354, 354, 354, 356,
- 354, 354, 354, 354, 354, 354, 354, 354, 355, 354,
- 354, 354, 354, 354, 354, 436
-};
-
-static DfaState st352[36] = {
- 436, 436, 279, 436, 279, 279, 279, 279, 279, 279,
- 279, 279, 357, 279, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st353[36] = {
- 436, 334, 334, 334, 334, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 334, 358, 334, 334, 344,
- 345, 334, 334, 359, 359, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 436
-};
-
-static DfaState st354[36] = {
- 436, 354, 354, 354, 354, 354, 354, 354, 354, 354,
- 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
- 354, 354, 354, 354, 354, 354, 354, 354, 355, 354,
- 354, 354, 354, 354, 354, 436
-};
-
-static DfaState st355[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 360, 436, 436, 361,
- 362, 436, 436, 363, 363, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st356[36] = {
- 436, 354, 354, 354, 354, 354, 354, 354, 354, 354,
- 354, 354, 354, 354, 354, 354, 354, 354, 354, 354,
- 354, 354, 354, 354, 354, 354, 354, 354, 355, 354,
- 354, 354, 354, 354, 354, 436
-};
-
-static DfaState st357[36] = {
- 436, 436, 279, 436, 279, 279, 279, 279, 279, 279,
- 279, 279, 279, 364, 279, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st358[36] = {
- 436, 334, 334, 334, 334, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 334, 358, 334, 334, 344,
- 345, 334, 334, 359, 359, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 436
-};
-
-static DfaState st359[36] = {
- 436, 334, 334, 334, 334, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 334, 358, 334, 334, 344,
- 345, 334, 334, 359, 359, 334, 334, 334, 334, 334,
- 334, 334, 334, 334, 334, 436
-};
-
-static DfaState st360[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 360, 436, 436, 361,
- 362, 436, 436, 363, 363, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st361[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st362[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 365,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st363[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 360, 436, 436, 361,
- 362, 436, 436, 363, 363, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st364[36] = {
- 436, 436, 279, 436, 279, 279, 279, 279, 279, 279,
- 279, 279, 279, 279, 366, 436, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st365[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st366[36] = {
- 436, 436, 279, 436, 279, 279, 279, 279, 279, 279,
- 279, 279, 279, 279, 279, 367, 279, 279, 436, 436,
- 436, 436, 436, 279, 279, 279, 279, 436, 436, 436,
- 436, 436, 279, 279, 279, 436
-};
-
-static DfaState st367[36] = {
- 436, 368, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 368, 369, 370, 436, 368,
- 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 436
-};
-
-static DfaState st368[36] = {
- 436, 368, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 368, 368, 368, 371, 368,
- 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 436
-};
-
-static DfaState st369[36] = {
- 436, 368, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 368, 369, 370, 371, 368,
- 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 436
-};
-
-static DfaState st370[36] = {
- 436, 372, 372, 372, 372, 372, 372, 372, 372, 372,
- 372, 372, 372, 372, 372, 372, 372, 372, 373, 372,
- 372, 372, 372, 372, 372, 372, 372, 372, 372, 372,
- 372, 372, 372, 372, 368, 436
-};
-
-static DfaState st371[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st372[36] = {
- 436, 372, 372, 372, 372, 372, 372, 372, 372, 372,
- 372, 372, 372, 372, 372, 372, 372, 372, 373, 372,
- 372, 372, 372, 372, 372, 372, 372, 372, 372, 372,
- 372, 372, 372, 372, 374, 436
-};
-
-static DfaState st373[36] = {
- 436, 375, 375, 375, 375, 375, 375, 375, 375, 375,
- 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
- 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
- 375, 375, 375, 375, 376, 436
-};
-
-static DfaState st374[36] = {
- 436, 368, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 368, 377, 368, 378, 368,
- 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 436
-};
-
-static DfaState st375[36] = {
- 436, 375, 375, 375, 375, 375, 375, 375, 375, 375,
- 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
- 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
- 375, 375, 375, 375, 376, 436
-};
-
-static DfaState st376[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 379, 436, 380, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st377[36] = {
- 436, 368, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 368, 377, 368, 378, 368,
- 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 436
-};
-
-static DfaState st378[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st379[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 379, 436, 380, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st380[36] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st381[28] = {
- 382, 383, 384, 385, 386, 436, 387, 388, 388, 388,
- 389, 388, 388, 388, 388, 388, 388, 388, 388, 388,
- 390, 391, 392, 393, 394, 395, 388, 436
-};
-
-static DfaState st382[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st383[28] = {
- 436, 383, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st384[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st385[28] = {
- 436, 436, 396, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st386[28] = {
- 436, 436, 436, 436, 397, 398, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st387[28] = {
- 436, 436, 436, 436, 436, 436, 436, 399, 436, 400,
- 401, 436, 436, 436, 402, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st388[28] = {
- 436, 436, 436, 436, 436, 436, 436, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 436, 436, 436, 436, 436, 403, 403, 436
-};
-
-static DfaState st389[28] = {
- 436, 436, 436, 436, 436, 436, 436, 403, 403, 403,
- 403, 404, 403, 403, 403, 403, 403, 403, 403, 403,
- 436, 436, 436, 436, 436, 403, 403, 436
-};
-
-static DfaState st390[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st391[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st392[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st393[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st394[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st395[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 395, 436, 436
-};
-
-static DfaState st396[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st397[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st398[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st399[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 405, 436,
- 436, 436, 436, 436, 436, 406, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st400[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 407, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st401[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 408, 409, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st402[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 410, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st403[28] = {
- 436, 436, 436, 436, 436, 436, 436, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 436, 436, 436, 436, 436, 403, 403, 436
-};
-
-static DfaState st404[28] = {
- 436, 436, 436, 436, 436, 436, 436, 403, 403, 403,
- 403, 403, 403, 403, 411, 403, 403, 403, 403, 403,
- 436, 436, 436, 436, 436, 403, 403, 436
-};
-
-static DfaState st405[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 412,
- 436, 413, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st406[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 414, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st407[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 415, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st408[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 416,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st409[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 417, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st410[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 418,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st411[28] = {
- 436, 436, 436, 436, 436, 436, 436, 403, 403, 403,
- 403, 403, 403, 403, 403, 419, 403, 403, 403, 403,
- 436, 436, 436, 436, 436, 403, 403, 436
-};
-
-static DfaState st412[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 420, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st413[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 421,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st414[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 422, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st415[28] = {
- 436, 436, 436, 436, 436, 436, 436, 423, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st416[28] = {
- 436, 436, 436, 436, 436, 436, 436, 424, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st417[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 425, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st418[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 426, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st419[28] = {
- 436, 436, 436, 436, 436, 436, 436, 403, 403, 403,
- 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 436, 436, 436, 436, 436, 403, 403, 436
-};
-
-static DfaState st420[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 427, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st421[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 428, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st422[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 429, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st423[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 430, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st424[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 431, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st425[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st426[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 432, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st427[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st428[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 433, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st429[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 434,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st430[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 435, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st431[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st432[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st433[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st434[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-static DfaState st435[28] = {
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
- 436, 436, 436, 436, 436, 436, 436, 436
-};
-
-
-DfaState *dfa[436] = {
- st0,
- st1,
- st2,
- st3,
- st4,
- st5,
- st6,
- st7,
- st8,
- st9,
- st10,
- st11,
- st12,
- st13,
- st14,
- st15,
- st16,
- st17,
- st18,
- st19,
- st20,
- st21,
- st22,
- st23,
- st24,
- st25,
- st26,
- st27,
- st28,
- st29,
- st30,
- st31,
- st32,
- st33,
- st34,
- st35,
- st36,
- st37,
- st38,
- st39,
- st40,
- st41,
- st42,
- st43,
- st44,
- st45,
- st46,
- st47,
- st48,
- st49,
- st50,
- st51,
- st52,
- st53,
- st54,
- st55,
- st56,
- st57,
- st58,
- st59,
- st60,
- st61,
- st62,
- st63,
- st64,
- st65,
- st66,
- st67,
- st68,
- st69,
- st70,
- st71,
- st72,
- st73,
- st74,
- st75,
- st76,
- st77,
- st78,
- st79,
- st80,
- st81,
- st82,
- st83,
- st84,
- st85,
- st86,
- st87,
- st88,
- st89,
- st90,
- st91,
- st92,
- st93,
- st94,
- st95,
- st96,
- st97,
- st98,
- st99,
- st100,
- st101,
- st102,
- st103,
- st104,
- st105,
- st106,
- st107,
- st108,
- st109,
- st110,
- st111,
- st112,
- st113,
- st114,
- st115,
- st116,
- st117,
- st118,
- st119,
- st120,
- st121,
- st122,
- st123,
- st124,
- st125,
- st126,
- st127,
- st128,
- st129,
- st130,
- st131,
- st132,
- st133,
- st134,
- st135,
- st136,
- st137,
- st138,
- st139,
- st140,
- st141,
- st142,
- st143,
- st144,
- st145,
- st146,
- st147,
- st148,
- st149,
- st150,
- st151,
- st152,
- st153,
- st154,
- st155,
- st156,
- st157,
- st158,
- st159,
- st160,
- st161,
- st162,
- st163,
- st164,
- st165,
- st166,
- st167,
- st168,
- st169,
- st170,
- st171,
- st172,
- st173,
- st174,
- st175,
- st176,
- st177,
- st178,
- st179,
- st180,
- st181,
- st182,
- st183,
- st184,
- st185,
- st186,
- st187,
- st188,
- st189,
- st190,
- st191,
- st192,
- st193,
- st194,
- st195,
- st196,
- st197,
- st198,
- st199,
- st200,
- st201,
- st202,
- st203,
- st204,
- st205,
- st206,
- st207,
- st208,
- st209,
- st210,
- st211,
- st212,
- st213,
- st214,
- st215,
- st216,
- st217,
- st218,
- st219,
- st220,
- st221,
- st222,
- st223,
- st224,
- st225,
- st226,
- st227,
- st228,
- st229,
- st230,
- st231,
- st232,
- st233,
- st234,
- st235,
- st236,
- st237,
- st238,
- st239,
- st240,
- st241,
- st242,
- st243,
- st244,
- st245,
- st246,
- st247,
- st248,
- st249,
- st250,
- st251,
- st252,
- st253,
- st254,
- st255,
- st256,
- st257,
- st258,
- st259,
- st260,
- st261,
- st262,
- st263,
- st264,
- st265,
- st266,
- st267,
- st268,
- st269,
- st270,
- st271,
- st272,
- st273,
- st274,
- st275,
- st276,
- st277,
- st278,
- st279,
- st280,
- st281,
- st282,
- st283,
- st284,
- st285,
- st286,
- st287,
- st288,
- st289,
- st290,
- st291,
- st292,
- st293,
- st294,
- st295,
- st296,
- st297,
- st298,
- st299,
- st300,
- st301,
- st302,
- st303,
- st304,
- st305,
- st306,
- st307,
- st308,
- st309,
- st310,
- st311,
- st312,
- st313,
- st314,
- st315,
- st316,
- st317,
- st318,
- st319,
- st320,
- st321,
- st322,
- st323,
- st324,
- st325,
- st326,
- st327,
- st328,
- st329,
- st330,
- st331,
- st332,
- st333,
- st334,
- st335,
- st336,
- st337,
- st338,
- st339,
- st340,
- st341,
- st342,
- st343,
- st344,
- st345,
- st346,
- st347,
- st348,
- st349,
- st350,
- st351,
- st352,
- st353,
- st354,
- st355,
- st356,
- st357,
- st358,
- st359,
- st360,
- st361,
- st362,
- st363,
- st364,
- st365,
- st366,
- st367,
- st368,
- st369,
- st370,
- st371,
- st372,
- st373,
- st374,
- st375,
- st376,
- st377,
- st378,
- st379,
- st380,
- st381,
- st382,
- st383,
- st384,
- st385,
- st386,
- st387,
- st388,
- st389,
- st390,
- st391,
- st392,
- st393,
- st394,
- st395,
- st396,
- st397,
- st398,
- st399,
- st400,
- st401,
- st402,
- st403,
- st404,
- st405,
- st406,
- st407,
- st408,
- st409,
- st410,
- st411,
- st412,
- st413,
- st414,
- st415,
- st416,
- st417,
- st418,
- st419,
- st420,
- st421,
- st422,
- st423,
- st424,
- st425,
- st426,
- st427,
- st428,
- st429,
- st430,
- st431,
- st432,
- st433,
- st434,
- st435
-};
-
-
-DfaState accepts[437] = {
- 0, 1, 2, 3, 3, 4, 25, 6, 0, 50,
- 59, 57, 57, 43, 26, 13, 14, 0, 57, 58,
- 57, 21, 57, 23, 24, 27, 28, 44, 0, 35,
- 36, 42, 45, 46, 58, 51, 52, 3, 5, 9,
- 7, 8, 59, 59, 59, 59, 59, 59, 59, 59,
- 57, 57, 12, 40, 59, 57, 58, 57, 57, 57,
- 33, 34, 53, 58, 59, 59, 59, 59, 59, 59,
- 59, 59, 59, 57, 59, 57, 57, 57, 57, 0,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
- 57, 57, 57, 57, 57, 0, 0, 59, 59, 59,
- 59, 59, 59, 32, 59, 59, 59, 59, 59, 59,
- 59, 59, 57, 57, 57, 22, 56, 48, 49, 0,
- 11, 11, 0, 59, 59, 59, 59, 59, 59, 59,
- 59, 59, 59, 41, 59, 59, 59, 18, 57, 47,
- 57, 0, 11, 0, 10, 10, 0, 59, 59, 59,
- 59, 59, 15, 19, 59, 59, 59, 17, 57, 55,
- 10, 0, 11, 11, 59, 59, 59, 59, 59, 59,
- 20, 59, 57, 0, 0, 0, 11, 59, 59, 59,
- 37, 38, 59, 39, 54, 0, 0, 0, 10, 10,
- 0, 31, 29, 30, 59, 10, 59, 59, 59, 59,
- 16, 0, 60, 61, 62, 62, 0, 65, 62, 64,
- 63, 63, 63, 0, 66, 67, 68, 68, 0, 71,
- 68, 70, 69, 69, 69, 0, 72, 73, 74, 74,
- 0, 76, 74, 75, 0, 77, 79, 81, 80, 80,
- 78, 80, 0, 82, 84, 86, 85, 85, 83, 85,
- 0, 87, 88, 88, 89, 88, 0, 90, 91, 91,
- 92, 91, 0, 93, 94, 94, 95, 94, 0, 96,
- 98, 100, 99, 99, 97, 99, 0, 101, 108, 143,
- 104, 143, 129, 127, 107, 107, 109, 128, 126, 134,
- 0, 133, 139, 143, 102, 143, 107, 116, 110, 112,
- 113, 123, 123, 125, 124, 117, 120, 132, 138, 130,
- 131, 137, 137, 135, 136, 142, 140, 141, 103, 143,
- 116, 111, 114, 123, 123, 119, 118, 137, 143, 115,
- 123, 143, 123, 143, 0, 123, 0, 122, 122, 123,
- 143, 0, 122, 0, 121, 121, 0, 143, 121, 0,
- 122, 122, 143, 0, 0, 0, 122, 143, 0, 0,
- 0, 121, 121, 0, 143, 121, 143, 0, 0, 0,
- 0, 106, 0, 106, 0, 0, 0, 0, 105, 0,
- 105, 0, 144, 145, 146, 146, 0, 0, 164, 164,
- 158, 159, 160, 161, 162, 163, 146, 147, 148, 0,
- 0, 0, 0, 164, 164, 150, 0, 0, 0, 0,
- 0, 164, 0, 0, 0, 0, 0, 0, 0, 157,
- 0, 0, 0, 0, 0, 152, 0, 149, 0, 0,
- 0, 153, 154, 151, 155, 156, 0
-};
-
-void (*actions[165])() = {
- zzerraction,
- act1,
- act2,
- act3,
- act4,
- act5,
- act6,
- act7,
- act8,
- act9,
- act10,
- act11,
- act12,
- act13,
- act14,
- act15,
- act16,
- act17,
- act18,
- act19,
- act20,
- act21,
- act22,
- act23,
- act24,
- act25,
- act26,
- act27,
- act28,
- act29,
- act30,
- act31,
- act32,
- act33,
- act34,
- act35,
- act36,
- act37,
- act38,
- act39,
- act40,
- act41,
- act42,
- act43,
- act44,
- act45,
- act46,
- act47,
- act48,
- act49,
- act50,
- act51,
- act52,
- act53,
- act54,
- act55,
- act56,
- act57,
- act58,
- act59,
- act60,
- act61,
- act62,
- act63,
- act64,
- act65,
- act66,
- act67,
- act68,
- act69,
- act70,
- act71,
- act72,
- act73,
- act74,
- act75,
- act76,
- act77,
- act78,
- act79,
- act80,
- act81,
- act82,
- act83,
- act84,
- act85,
- act86,
- act87,
- act88,
- act89,
- act90,
- act91,
- act92,
- act93,
- act94,
- act95,
- act96,
- act97,
- act98,
- act99,
- act100,
- act101,
- act102,
- act103,
- act104,
- act105,
- act106,
- act107,
- act108,
- act109,
- act110,
- act111,
- act112,
- act113,
- act114,
- act115,
- act116,
- act117,
- act118,
- act119,
- act120,
- act121,
- act122,
- act123,
- act124,
- act125,
- act126,
- act127,
- act128,
- act129,
- act130,
- act131,
- act132,
- act133,
- act134,
- act135,
- act136,
- act137,
- act138,
- act139,
- act140,
- act141,
- act142,
- act143,
- act144,
- act145,
- act146,
- act147,
- act148,
- act149,
- act150,
- act151,
- act152,
- act153,
- act154,
- act155,
- act156,
- act157,
- act158,
- act159,
- act160,
- act161,
- act162,
- act163,
- act164
-};
-
-static DfaState dfa_base[] = {
- 0,
- 201,
- 213,
- 225,
- 234,
- 242,
- 250,
- 256,
- 262,
- 268,
- 276,
- 381
-};
-
-static unsigned char *b_class_no[] = {
- shift0,
- shift1,
- shift2,
- shift3,
- shift4,
- shift5,
- shift6,
- shift7,
- shift8,
- shift9,
- shift10,
- shift11
-};
-
-
-
-#define ZZSHIFT(c) (b_class_no[zzauto][1+c])
-#define MAX_MODE 12
-#include "dlgauto.h"
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/stdpccts.h b/BaseTools/Source/C/VfrCompile/Pccts/antlr/stdpccts.h
deleted file mode 100644
index ccdc21c3c9..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/stdpccts.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef STDPCCTS_H
-#define STDPCCTS_H
-/*
- * stdpccts.h -- P C C T S I n c l u d e
- *
- * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
- * Purdue University Electrical Engineering
- * With AHPCRC, University of Minnesota
- * ANTLR Version 1.33MR33
- */
-
-#ifndef ANTLR_VERSION
-#define ANTLR_VERSION 13333
-#endif
-
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-#include "pcctscfg.h"
-#include "set.h"
-#include <ctype.h>
-#include "syn.h"
-#include "hash.h"
-#include "generic.h"
-#define zzcr_attr(attr,tok,t)
-#define zzSET_SIZE 20
-#include "antlr.h"
-#include "tokens.h"
-#include "dlgdef.h"
-#include "mode.h"
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/syn.h b/BaseTools/Source/C/VfrCompile/Pccts/antlr/syn.h
deleted file mode 100644
index a23d196d77..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/syn.h
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * syn.h
- *
- * This file includes definitions and macros associated with syntax diagrams
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include "set.h"
-
-#define NumNodeTypes 4
-#define NumJuncTypes 9
-
-/* List the different node types */
-#define nJunction 1
-#define nRuleRef 2
-#define nToken 3
-#define nAction 4
-
-/* Different types of junctions */
-#define aSubBlk 1
-#define aOptBlk 2
-#define aLoopBlk 3
-#define EndBlk 4
-#define RuleBlk 5
-#define Generic 6 /* just a junction--no unusual characteristics */
-#define EndRule 7
-#define aPlusBlk 8
-#define aLoopBegin 9
-
-typedef int NodeType;
-
-#define TreeBlockAllocSize 500
-#define JunctionBlockAllocSize 200
-#define ActionBlockAllocSize 50
-#define RRefBlockAllocSize 100
-#define TokenBlockAllocSize 100
-
-#ifdef __cplusplus
-class ActionNode;
-class Junction;
-#endif
-
-/* note that 'right' is used by the tree node allocator as a ptr for linked list */
-typedef struct _tree {
- struct _tree *down, *right;
- int token;
- union {
- int rk; /* if token==EpToken, => how many more tokens req'd */
- struct _tree *tref; /* if token==TREE_REF */
- set sref; /* if token==SET */
- } v;
-#ifdef TREE_DEBUG
- int in_use;
- int seq;
-#endif
- } Tree;
-
-
-/* a predicate is defined to be a predicate action and a token tree with
- * context info (if used); later, this struct may include the
- * "hoisting distance" when we hoist past tokens.
- *
- * A tree is used to indicate && vs ||
- *
- * p
- * |
- * q--r
- *
- * indicates p && (q||r).
- *
- * If expr is PRED_AND_LIST or PRED_OR_LIST, then it's an operation node
- * and indicates the start of an && or || list.
- */
-
-typedef struct _Predicate {
- struct _Predicate *down, *right; /* these have to be first */
- struct _Predicate *up, *left; /* doubly-link me */
- char *expr;
- Tree *tcontext; /* used if lookahead depth of > one is needed (tree) */
- int k; /* lookahead depth for this tcontext */
- set scontext[2];/* used if lookahead depth of one is needed (set) */
- /* scontext[0] is not used; only needed so genExprSets()
- routine works (it expects an array)
- */
- set completionTree; /* which lookahead depths are required to complete tcontext? */
- set completionSet; /* MR10 separate completion set for sets and trees */
- struct _PredEntry *predEntry; /* MR11 */
-
-#ifdef __cplusplus
- ActionNode *source; /* where did this predicate come from? */
-#else
- struct _anode *source; /* where did this predicate come from? */
-#endif
-
- char cloned; /* MR10 don't want to free original guard pred */
- char redundant; /* MR10 predicate tree simplification */
- char ampersandStyle; /* MR10 (g)? && <<p>>? */
- char inverted; /* MR11 ! predName */
- char isConst; /* MR11 */
- char constValue; /* MR11 */
- char conflictReported; /* MR11 */
-
- set plainSet; /* MR12b */
-
- /*** remember to change new_predicate() and predicate_dup() when changing this ***/
-
-} Predicate;
-
-typedef struct _ExceptionHandler {
- char *signalname;
- char *action;
- } ExceptionHandler;
-
-typedef struct _ExceptionGroup {
- struct _ListNode *handlers; /* list of ExceptionHandler's */
- char *label; /* label==""; implies not attached to any
- * particular rule ref.
- */
- char *altID; /* which alt did it come from (blk#:alt#) */
-
- struct _ExceptionGroup *pendingLink; /* for alternative EG MR7 */
- struct _ExceptionGroup *outerEG; /* for alternative EG MR7 */
- struct _LabelEntry *labelEntry; /* for alternative EG MR7 */
- int forRule; /* MR7 */
- int used; /* MR7 */
- } ExceptionGroup ;
-
-
-#define TokenString(_i) ((TokenInd!=NULL)?TokenStr[TokenInd[_i]]:TokenStr[_i])
-#define ExprString(_i) ((TokenInd!=NULL)?ExprStr[TokenInd[_i]]:ExprStr[_i])
-
-
- /* M e s s a g e P a s s i n g T o N o d e s */
-
-/*
- * assumes a 'Junction *r' exists. This macro calls a function with
- * the pointer to the node to operate on and a pointer to the rule
- * in which it is enclosed.
- */
-#define TRANS(p) {if ( (p)==NULL ) fatal("TRANS: NULL object"); \
- if ( (p)->ntype == nJunction ) (*(fpJTrans[((Junction *)(p))->jtype]))( p );\
- else (*(fpTrans[(p)->ntype]))( p );}
-
-#define PRINT(p) {if ( (p)==NULL ) fatal("PRINT: NULL object");\
- (*(fpPrint[(p)->ntype]))( p );}
-
-#define REACH(p,k,rk,a) {if ( (p)==NULL ) fatal("REACH: NULL object");\
- (a) = (*(fpReach[(p)->ntype]))( p, k, rk );}
-
-#define TRAV(p,k,rk,a) {if ( (p)==NULL ) {\
- if ( ContextGuardTRAV ) (a)=NULL; \
- else fatal("TRAV: NULL object");\
- } \
- else (a) = (*(fpTraverse[(p)->ntype]))( p, k, rk );}
-
-/**
-*** #define TRAV(p,k,rk,a) {if ( (p)==NULL ) fatal("TRAV: NULL object");\
-*** (a) = (*(fpTraverse[(p)->ntype]))( p, k, rk );}
-**/
-
-/* All syntax diagram nodes derive from Node -- superclass
- */
-#ifdef __cplusplus
-class Node {
-public:
- NodeType ntype;
- char *rname; /* what rule does this element live in? */
- int file; /* index in FileStr */
- int line; /* line number that element occurs on */
- };
-#else
-typedef struct _node {
- NodeType ntype;
- char *rname; /* what rule does this element live in? */
- int file; /* index in FileStr */
- int line; /* line number that element occurs on */
- } Node;
-#endif
-
-#ifdef __cplusplus
-class ActionNode : public Node {
-public:
-#else
-typedef struct _anode {
- NodeType ntype;
- char *rname; /* what rule does this action live in? */
- int file; /* index in FileStr (name of file with action) */
- int line; /* line number that action occurs on */
-#endif
- Node *next;
- char *action;
- int is_predicate; /* true if action is a <<...>>? predicate action */
- int done; /* don't dump if action dumped (used for predicates) */
- int init_action; /* is this the 1st action of 1st prod of block? */
- char *pred_fail; /* what to do/print when predicate fails */
- Predicate *guardpred; /* if '(context)? =>' was present, already done */
- unsigned char frmwarned;/* have we dumped a warning for pred yet? */
- unsigned char ctxwarned;/* have we dumped a warning for pred yet? */
- unsigned char predTooLong; /* MR10 have we dumped warning for pred yet */
- unsigned char noHoist; /* MR12 literally "noHoist" */
- Predicate *ampersandPred; /* MR10 (g)? && <<p>>? expr */
-#ifdef __cplusplus
- Junction *guardNodes; /* MR11 */
-#else
- struct _junct *guardNodes; /* MR11 */
-#endif
- struct _PredEntry *predEntry; /* MR11 */
- int inverted; /* MR11 <<!predSymbol>>? */
-#ifdef __cplusplus
- };
-#else
- } ActionNode;
-#endif
-
-#ifdef __cplusplus
-class TokNode : public Node {
-public:
-#else
-typedef struct _toknode {
- NodeType ntype;
- char *rname; /* name of rule it's in */
- int file; /* index in FileStr (name of file with rule) */
- int line; /* line number that token occurs on */
-#endif
- Node *next;
- int token;
- int astnode; /* leaf/root/excluded (used to build AST's) */
- unsigned char label;/* token label or expression ? */
- unsigned char remapped;
- /* used if token id's are forced to certain positions;
- * a function walks the tree reassigning token numbers */
- int upper_range; /* MR13 - was char */
- /* used only if Token is of type T1..T2; in this case,
- * use token..upper_range as the range; else
- * upper_range must be 0 */
- unsigned char wild_card;
- /* indicates that the token is the "." wild-card;
- * field token is ignored if wild_card is set
- */
- unsigned int elnum; /* element number within the alternative */
-#ifdef __cplusplus
- Junction *altstart; /* pointer to node that starts alt */
-#else
- struct _junct *altstart; /* pointer to node that starts alt */
-#endif
- struct _TCnode *tclass; /* token class if tokclass ref */
- set tset; /* set of tokens represented by meta token */
- char *el_label; /* el_label:toknode */
- unsigned char complement; /* complement the set? */
- ExceptionGroup *ex_group; /* any exception[el_label] attached? */
- unsigned char use_def_MT_handler;
- unsigned char label_used_in_semantic_pred; /* MR10 */
-#ifdef __cplusplus
- };
-#else
- } TokNode;
-#endif
-
-#ifdef __cplusplus
-class RuleRefNode : public Node {
-public:
-#else
-typedef struct _rrnode {
- NodeType ntype;
- char *rname; /* name of rule it's in */
- int file; /* index in FileStr (name of file with rule)
- it's in */
- int line; /* line number that rule ref occurs on */
-#endif
- Node *next;
- char *text; /* reference to which rule */
- char *parms; /* point to parameters of rule invocation
- (if present) */
- char *assign; /* point to left-hand-side of assignment
- (if any) */
- int linked; /* Has a FoLink already been established? */
- int astnode; /* excluded? (used to build AST's) */
- unsigned int elnum; /* element number within the alternative */
-#ifdef __cplusplus
- Junction *altstart;
-#else
- struct _junct *altstart;
-#endif
- char *el_label; /* el_label:rrnode */
- ExceptionGroup *ex_group; /* any exception[el_label] attached? */
-#ifdef __cplusplus
- };
-#else
- } RuleRefNode;
-#endif
-
-#ifdef __cplusplus
-class Junction : public Node {
-public:
-#else
-typedef struct _junct {
- NodeType ntype;
- char *rname; /* name of rule junction is in */
- int file; /* index in FileStr (name of file with rule)
- if blk == RuleBlk */
- int line; /* line number that rule occurs on */
-#endif
- int seq; /* MR10 sequence number */
- char ignore; /* used by FIRST computation to ignore
- empty alt added for the (...)+ blks */
- char visited; /* used by recursive routines to avoid
- infinite recursion */
- char pvisited; /* used by print routines to avoid
- infinite recursion */
- char fvisited; /* used by FoLink() to avoid
- infinite recursion */
- char *lock; /* used by REACH to track infinite recursion */
- char *pred_lock; /* used by find_predicates to track infinite recursion */
- int altnum; /* used in subblocks. altnum==0 means not an
- alt of subrule */
- int jtype; /* annotation for code-gen/FIRST/FOLLOW.
- Junction type */
-#ifdef __cplusplus
- Junction *end; /* pointer to node with EndBlk in it
- if blk == a block type */
-#else
- struct _junct *end; /* pointer to node with EndBlk in it
- if blk == a block type */
-#endif
- Node *p1, *p2;
- char halt; /* never move past a junction with halt==TRUE */ /* MR10 was int */
- char *pdecl; /* point to declaration of parameters on rule
- (if present) */
- char *parm; /* point to parameter of block invocation
- (if present) */
- char predparm; /* indicates that the 'parm' is a predicate
- * to be used in the while loop generated
- * for blocks */ /* MR10 was int */
- char *ret; /* point to return type of rule (if present) */
- char *erraction; /* point to error action (if present) */
- int blockid; /* this is a unique ID */
- char *exception_label; /* goto label for this alt */
- set *fset; /* used for code generation */
- Tree *ftree; /* used for code generation */
- Predicate *predicate;/* predicate that can be used to disambiguate */
- char guess; /* true if (...)? block */
- char alpha_beta_guess_end; /* MR14 1 => end block of guess sub block */
- Node *guess_analysis_point; /* MR14 */
- char approx; /* limit block to use linear approx lookahead? */
- set tokrefs; /* if ith element of alt is tokref then i is member */
- set rulerefs; /* if ith element of alt is rule ref then i is member */
- struct _ListNode *exceptions; /* list of exceptions groups for rule */
- struct _ListNode *el_labels; /* list of element labels for rule */
- ExceptionGroup *outerEG; /* MR7 */
- int curAltNum; /* MR7 */
- char* pFirstSetSymbol; /* #pragma FirstSetSymbol(Foo) MR21 */
-#ifdef __cplusplus
- Junction *pendingLink; /* MR7 */
-#else
- struct _junct *pendingLink; /* MR7 */
-#endif
- char overlap_warning; /* MR10 */
-#ifdef __cplusplus
- };
-#else
- } Junction;
-#endif
-
-typedef struct { Node *left, *right;} Graph;
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/tokens.h b/BaseTools/Source/C/VfrCompile/Pccts/antlr/tokens.h
deleted file mode 100644
index 91a53a8471..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/tokens.h
+++ /dev/null
@@ -1,246 +0,0 @@
-#ifndef tokens_h
-#define tokens_h
-/* tokens.h -- List of labelled tokens and stuff
- *
- * Generated from: antlr.g
- *
- * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
- * Purdue University Electrical Engineering
- * ANTLR Version 1.33MR33
- */
-#define zzEOF_TOKEN 1
-#define Eof 1
-#define QuotedTerm 2
-#define Action 34
-#define Pred 35
-#define PassAction 36
-#define WildCard 87
-#define LABEL 89
-#define Pragma 92
-#define FirstSetSymbol 93
-#define NonTerminal 100
-#define TokenTerm 101
-#define ID 148
-#define INT 150
-
-#ifdef __USE_PROTOS
-void grammar(void);
-#else
-extern void grammar();
-#endif
-
-#ifdef __USE_PROTOS
-void class_def(void);
-#else
-extern void class_def();
-#endif
-
-#ifdef __USE_PROTOS
-void rule(void);
-#else
-extern void rule();
-#endif
-
-#ifdef __USE_PROTOS
-void laction(void);
-#else
-extern void laction();
-#endif
-
-#ifdef __USE_PROTOS
-void lmember(void);
-#else
-extern void lmember();
-#endif
-
-#ifdef __USE_PROTOS
-void lprefix(void);
-#else
-extern void lprefix();
-#endif
-
-#ifdef __USE_PROTOS
-void aPred(void);
-#else
-extern void aPred();
-#endif
-
-#ifdef __USE_PROTOS
-extern Predicate * predOrExpr(void);
-#else
-extern Predicate * predOrExpr();
-#endif
-
-#ifdef __USE_PROTOS
-extern Predicate * predAndExpr(void);
-#else
-extern Predicate * predAndExpr();
-#endif
-
-#ifdef __USE_PROTOS
-extern Predicate * predPrimary(void);
-#else
-extern Predicate * predPrimary();
-#endif
-
-#ifdef __USE_PROTOS
-void aLexclass(void);
-#else
-extern void aLexclass();
-#endif
-
-#ifdef __USE_PROTOS
-void error(void);
-#else
-extern void error();
-#endif
-
-#ifdef __USE_PROTOS
-void tclass(void);
-#else
-extern void tclass();
-#endif
-
-#ifdef __USE_PROTOS
-void token(void);
-#else
-extern void token();
-#endif
-
-#ifdef __USE_PROTOS
-void block(set * toksrefd,set * rulesrefd);
-#else
-extern void block();
-#endif
-
-#ifdef __USE_PROTOS
-void alt(set * toksrefd,set * rulesrefd);
-#else
-extern void alt();
-#endif
-
-#ifdef __USE_PROTOS
-extern LabelEntry * element_label(void);
-#else
-extern LabelEntry * element_label();
-#endif
-
-#ifdef __USE_PROTOS
-extern Node * element(int old_not,int first_on_line,int use_def_MT_handler);
-#else
-extern Node * element();
-#endif
-
-#ifdef __USE_PROTOS
-void default_exception_handler(void);
-#else
-extern void default_exception_handler();
-#endif
-
-#ifdef __USE_PROTOS
-extern ExceptionGroup * exception_group(void);
-#else
-extern ExceptionGroup * exception_group();
-#endif
-
-#ifdef __USE_PROTOS
-extern ExceptionHandler * exception_handler(void);
-#else
-extern ExceptionHandler * exception_handler();
-#endif
-
-#ifdef __USE_PROTOS
-void enum_file(char * fname);
-#else
-extern void enum_file();
-#endif
-
-#ifdef __USE_PROTOS
-void defines(char * fname);
-#else
-extern void defines();
-#endif
-
-#ifdef __USE_PROTOS
-void enum_def(char * fname);
-#else
-extern void enum_def();
-#endif
-
-#endif
-extern SetWordType zzerr1[];
-extern SetWordType zzerr2[];
-extern SetWordType zzerr3[];
-extern SetWordType zzerr4[];
-extern SetWordType setwd1[];
-extern SetWordType zzerr5[];
-extern SetWordType zzerr6[];
-extern SetWordType zzerr7[];
-extern SetWordType zzerr8[];
-extern SetWordType zzerr9[];
-extern SetWordType setwd2[];
-extern SetWordType zzerr10[];
-extern SetWordType zzerr11[];
-extern SetWordType zzerr12[];
-extern SetWordType zzerr13[];
-extern SetWordType setwd3[];
-extern SetWordType zzerr14[];
-extern SetWordType zzerr15[];
-extern SetWordType zzerr16[];
-extern SetWordType zzerr17[];
-extern SetWordType zzerr18[];
-extern SetWordType zzerr19[];
-extern SetWordType zzerr20[];
-extern SetWordType zzerr21[];
-extern SetWordType setwd4[];
-extern SetWordType zzerr22[];
-extern SetWordType zzerr23[];
-extern SetWordType zzerr24[];
-extern SetWordType zzerr25[];
-extern SetWordType zzerr26[];
-extern SetWordType setwd5[];
-extern SetWordType zzerr27[];
-extern SetWordType zzerr28[];
-extern SetWordType zzerr29[];
-extern SetWordType zzerr30[];
-extern SetWordType zzerr31[];
-extern SetWordType zzerr32[];
-extern SetWordType zzerr33[];
-extern SetWordType setwd6[];
-extern SetWordType zzerr34[];
-extern SetWordType zzerr35[];
-extern SetWordType zzerr36[];
-extern SetWordType zzerr37[];
-extern SetWordType zzerr38[];
-extern SetWordType zzerr39[];
-extern SetWordType zzerr40[];
-extern SetWordType zzerr41[];
-extern SetWordType zzerr42[];
-extern SetWordType setwd7[];
-extern SetWordType zzerr43[];
-extern SetWordType zzerr44[];
-extern SetWordType zzerr45[];
-extern SetWordType zzerr46[];
-extern SetWordType zzerr47[];
-extern SetWordType zzerr48[];
-extern SetWordType zzerr49[];
-extern SetWordType zzerr50[];
-extern SetWordType zzerr51[];
-extern SetWordType zzerr52[];
-extern SetWordType zzerr53[];
-extern SetWordType setwd8[];
-extern SetWordType zzerr54[];
-extern SetWordType zzerr55[];
-extern SetWordType zzerr56[];
-extern SetWordType zzerr57[];
-extern SetWordType setwd9[];
-extern SetWordType zzerr58[];
-extern SetWordType zzerr59[];
-extern SetWordType zzerr60[];
-extern SetWordType zzerr61[];
-extern SetWordType zzerr62[];
-extern SetWordType zzerr63[];
-extern SetWordType zzerr64[];
-extern SetWordType zzerr65[];
-extern SetWordType setwd10[];
-extern SetWordType setwd11[];
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgDDK.mak b/BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgDDK.mak
deleted file mode 100644
index 156d524acc..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgDDK.mak
+++ /dev/null
@@ -1,121 +0,0 @@
-# PCCTS directory
-
-# You will need to set the LIB variable similar to this.
-# LIB="C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/lib;c:/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib"
-
-# PCCTS_HOME=<your PCCTS_HOME>
-PCCTS_HOME=$(WORKSPACE)\Tools\CCode\Source\Pccts
-DLG_SRC=$(PCCTS_HOME)\dlg
-PCCTS_H=$(PCCTS_HOME)\h
-
-
-# Support directories
-SET=$(PCCTS_HOME)\support\set
-
-
-# Compiler stuff
-CC = cl
-CFLAGS = /nologo -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D "PC" \
- -D "ZZLEXBUFSIZE=65536" /D "LONGFILENAMES" /W3 /Zi
-
-DLG_OBJS = dlg_p.obj dlg_a.obj main.obj err.obj support.obj \
- output.obj relabel.obj automata.obj
-
-SUPPORT_OBJS = set.obj
-
-# Dependencies
-
-dlg.exe: $(DLG_OBJS) $(SUPPORT_OBJS)
- $(CC) $(CFLAGS) -o dlg.exe bufferoverflowu.lib $(DLG_OBJS) $(SUPPORT_OBJS)
- del *.obj
- del *.ilk
- del *.pdb
- move dlg.exe $(WORKSPACE)\Tools\bin\.
-
-dlg_p.obj: $(DLG_SRC)\dlg_p.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
- $(DLG_SRC)\mode.h \
- $(DLG_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\dlg_p.c
-
-dlg_a.obj: $(DLG_SRC)\dlg_a.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgauto.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
- $(DLG_SRC)\mode.h \
- $(DLG_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\dlg_a.c
-
-main.obj: $(DLG_SRC)\main.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
- $(DLG_SRC)\mode.h \
- $(DLG_SRC)\stdpccts.h \
- $(DLG_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\main.c
-
-err.obj: $(DLG_SRC)\err.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(PCCTS_H)\err.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
- $(DLG_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\err.c
-
-support.obj: $(DLG_SRC)\support.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\support.c
-
-output.obj: $(DLG_SRC)\output.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\output.c
-
-relabel.obj: $(DLG_SRC)\relabel.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\relabel.c
-
-automata.obj: $(DLG_SRC)\automata.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\automata.c
-
-
-set.obj: $(SET)\set.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
-
- $(CC) -c $(CFLAGS) $(SET)\set.c
-
-clean:
- del *.obj
-
-distclean:
- del *.obj
- del $(WORKSPACE)\Tools\bin\dlg.exe
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgMS.mak b/BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgMS.mak
deleted file mode 100644
index 18c37d3656..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgMS.mak
+++ /dev/null
@@ -1,125 +0,0 @@
-# PCCTS directory
-
-# You will need to set the LIB variable similar to this.
-# LIB="C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/lib;c:/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib"
-
-# PCCTS_HOME=<your PCCTS_HOME>
-PCCTS_HOME=$(BASE_TOOLS_PATH)\Source\C\VfrCompile\Pccts
-DLG_SRC=$(PCCTS_HOME)\dlg
-PCCTS_H=$(PCCTS_HOME)\h
-
-
-# Support directories
-SET=$(PCCTS_HOME)\support\set
-
-
-# Compiler stuff
-CC = cl
-CFLAGS = /nologo -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D "PC" \
- -D "ZZLEXBUFSIZE=65536" /D "LONGFILENAMES" /W3 /Zi \
- /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE
-
-DLG_OBJS = dlg_p.obj dlg_a.obj main.obj err.obj support.obj \
- output.obj relabel.obj automata.obj
-
-SUPPORT_OBJS = set.obj
-
-# Dependencies
-
-dlg.exe: $(DLG_OBJS) $(SUPPORT_OBJS)
- $(CC) $(CFLAGS) -Fedlg.exe $(DLG_OBJS) $(SUPPORT_OBJS)
- copy dlg.exe $(EDK_TOOLS_PATH)\Bin\Win32
-
-dlg_p.obj: $(DLG_SRC)\dlg_p.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
- $(DLG_SRC)\mode.h \
- $(DLG_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\dlg_p.c
-
-dlg_a.obj: $(DLG_SRC)\dlg_a.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgauto.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
- $(DLG_SRC)\mode.h \
- $(DLG_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\dlg_a.c
-
-main.obj: $(DLG_SRC)\main.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
- $(DLG_SRC)\mode.h \
- $(DLG_SRC)\stdpccts.h \
- $(DLG_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\main.c
-
-err.obj: $(DLG_SRC)\err.c \
- $(PCCTS_H)\antlr.h \
- $(PCCTS_H)\config.h \
- $(PCCTS_H)\dlgdef.h \
- $(PCCTS_H)\err.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
- $(DLG_SRC)\tokens.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\err.c
-
-support.obj: $(DLG_SRC)\support.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\support.c
-
-output.obj: $(DLG_SRC)\output.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\output.c
-
-relabel.obj: $(DLG_SRC)\relabel.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\relabel.c
-
-automata.obj: $(DLG_SRC)\automata.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
- $(DLG_SRC)\dlg.h \
-
- $(CC) -c $(CFLAGS) $(DLG_SRC)\automata.c
-
-
-set.obj: $(SET)\set.c \
- $(PCCTS_H)\config.h \
- $(SET)\set.h \
-
- $(CC) -c $(CFLAGS) $(SET)\set.c
-
-clean:
- -del *.obj
- -del *.ilk
- -del *.pdb
-
-cleanall:
- -del *.obj
- -del *.ilk
- -del *.pdb
- -del *.exe
- -del $(EDK_TOOLS_PATH)\Bin\Win32\dlg.exe
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgPPC.mak b/BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgPPC.mak
deleted file mode 100644
index 55b643ad88..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/DlgPPC.mak
+++ /dev/null
@@ -1,84 +0,0 @@
-# File: dlgPPC.make
-# Target: dlgPPC
-# Sources: automata.c
-# dlg_a.c
-# dlg_p.c
-# err.c
-# main.c
-# output.c
-# relabel.c
-# support.c
-# ::support:set:set.c
-# Created: Sunday, May 17, 1998 11:34:20 PM
-# Author: Kenji Tanaka
-
-
-MAKEFILE = dlgPPC.make
-¥MondoBuild¥ = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified
-Includes = ¶
- -i "::h:" ¶
- -i "::support:set:"
-Sym¥PPC =
-ObjDir¥PPC = ":Obj:"
-
-PPCCOptions = {Includes} {Sym¥PPC} -w off -d MPW -d __STDC__=1 -d USER_ZZSYN
-
-Objects¥PPC = ¶
- "{ObjDir¥PPC}automata.c.x" ¶
- "{ObjDir¥PPC}dlg_a.c.x" ¶
- "{ObjDir¥PPC}dlg_p.c.x" ¶
- "{ObjDir¥PPC}err.c.x" ¶
- "{ObjDir¥PPC}main.c.x" ¶
- "{ObjDir¥PPC}output.c.x" ¶
- "{ObjDir¥PPC}relabel.c.x" ¶
- "{ObjDir¥PPC}support.c.x" ¶
- "{ObjDir¥PPC}set.c.x"
-
-
-dlgPPC ÄÄ {¥MondoBuild¥} {Objects¥PPC}
- PPCLink ¶
- -o {Targ} {Sym¥PPC} ¶
- {Objects¥PPC} ¶
- -t 'MPST' ¶
- -c 'MPS ' ¶
- "{SharedLibraries}InterfaceLib" ¶
- "{SharedLibraries}StdCLib" ¶
- "{SharedLibraries}MathLib" ¶
- "{PPCLibraries}StdCRuntime.o" ¶
- "{PPCLibraries}PPCCRuntime.o" ¶
- "{PPCLibraries}PPCToolLibs.o"
-
-
-"{ObjDir¥PPC}automata.c.x" Ä {¥MondoBuild¥} automata.c
- {PPCC} automata.c -o {Targ} {PPCCOptions}
-
-"{ObjDir¥PPC}dlg_a.c.x" Ä {¥MondoBuild¥} dlg_a.c
- {PPCC} dlg_a.c -o {Targ} {PPCCOptions}
-
-"{ObjDir¥PPC}dlg_p.c.x" Ä {¥MondoBuild¥} dlg_p.c
- {PPCC} dlg_p.c -o {Targ} {PPCCOptions}
-
-"{ObjDir¥PPC}err.c.x" Ä {¥MondoBuild¥} err.c
- {PPCC} err.c -o {Targ} {PPCCOptions}
-
-"{ObjDir¥PPC}main.c.x" Ä {¥MondoBuild¥} main.c
- {PPCC} main.c -o {Targ} {PPCCOptions}
-
-"{ObjDir¥PPC}output.c.x" Ä {¥MondoBuild¥} output.c
- {PPCC} output.c -o {Targ} {PPCCOptions}
-
-"{ObjDir¥PPC}relabel.c.x" Ä {¥MondoBuild¥} relabel.c
- {PPCC} relabel.c -o {Targ} {PPCCOptions}
-
-"{ObjDir¥PPC}support.c.x" Ä {¥MondoBuild¥} support.c
- {PPCC} support.c -o {Targ} {PPCCOptions}
-
-"{ObjDir¥PPC}set.c.x" Ä {¥MondoBuild¥} "::support:set:set.c"
- {PPCC} "::support:set:set.c" -o {Targ} {PPCCOptions}
-
-
-dlgPPC ÄÄ dlg.r
- Rez dlg.r -o dlgPPC -a
-
-Install Ä dlgPPC
- Duplicate -y dlgPPC "{MPW}"Tools:dlg
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/automata.c b/BaseTools/Source/C/VfrCompile/Pccts/dlg/automata.c
deleted file mode 100644
index d6d5d7809d..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/automata.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/* Automata conversion functions for DLG
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * DLG 1.33
- * Will Cohen
- * With mods by Terence Parr; AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include "pcctscfg.h"
-#include "dlg.h"
-#ifdef MEMCHK
-#include "trax.h"
-#else
-#ifdef __STDC__
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif /* __STDC__ */
-#endif
-
-#define hash_list struct _hash_list_
-hash_list{
- hash_list *next; /* next thing in list */
- dfa_node *node;
- };
-
-int dfa_allocated = 0; /* keeps track of number of dfa nodes */
-dfa_node **dfa_array; /* root of binary tree that stores dfa array */
-dfa_node *dfa_model_node;
-hash_list *dfa_hash[HASH_SIZE]; /* used to quickly find */
- /* desired dfa node */
-
-void
-#ifdef __USE_PROTOS
-make_dfa_model_node(int width)
-#else
-make_dfa_model_node(width)
-int width;
-#endif
-{
- register int i;
- dfa_model_node = (dfa_node*) malloc(sizeof(dfa_node)
- + sizeof(int)*width);
- dfa_model_node->node_no = -1; /* impossible value for real dfa node */
- dfa_model_node->dfa_set = 0;
- dfa_model_node->alternatives = FALSE;
- dfa_model_node->done = FALSE;
- dfa_model_node->nfa_states = empty;
- for(i = 0; i<width; i++){
- dfa_model_node->trans[i] = NIL_INDEX;
- }
-}
-
-
-/* adds a new nfa to the binary tree and returns a pointer to it */
-dfa_node *
-#ifdef __USE_PROTOS
-new_dfa_node(set nfa_states)
-#else
-new_dfa_node(nfa_states)
-set nfa_states;
-#endif
-{
- register int j;
- register dfa_node *t;
- static int dfa_size=0; /* elements dfa_array[] can hold */
-
- ++dfa_allocated;
- if (dfa_size<=dfa_allocated){
- /* need to redo array */
- if (!dfa_array){
- /* need some to do inital allocation */
- dfa_size=dfa_allocated+DFA_MIN;
- dfa_array=(dfa_node **) malloc(sizeof(dfa_node*)*
- dfa_size);
- }else{
- /* need more space */
- dfa_size=2*(dfa_allocated+1);
- dfa_array=(dfa_node **) realloc(dfa_array,
- sizeof(dfa_node*)*dfa_size);
- }
- }
- /* fill out entry in array */
- t = (dfa_node*) malloc(sizeof(nfa_node)+sizeof(int)*class_no);
- *t = *dfa_model_node;
- for (j=0; j<class_no; ++j)
- t->trans[j] = NIL_INDEX;
- t->node_no = dfa_allocated;
- t->nfa_states = set_dup(nfa_states);
- dfa_array[dfa_allocated] = t;
- return t;
-}
-
-
-/* past a pointer to the start start of the nfa graph
- * nfa_to_dfa convers this graph to dfa. The function returns
- * a pointer to the first dfa state.
- * NOTE: The function that prints out the table will have to figure out how
- * to find the other dfa states given the first dfa_state and the number of dfa
- * nodes allocated
- */
-dfa_node **
-#ifdef __USE_PROTOS
-nfa_to_dfa(nfa_node *start)
-#else
-nfa_to_dfa(start)
-nfa_node *start;
-#endif
-{
- register dfa_node *d_state, *trans_d_state;
- register int a;
- set t;
- int last_done;
- unsigned *nfa_list;
- unsigned *reach_list;
-
- reach_list = (unsigned *) malloc((2+nfa_allocated)*sizeof(unsigned));
- if (!start) return NULL;
- t = set_of(NFA_NO(start));
- _set_pdq(t,reach_list);
- closure(&t,reach_list);
- /* Make t a dfa state */
- d_state = dfastate(t);
- last_done = DFA_NO(d_state);
-
- do {
- /* Mark dfa state x as "done" */
- d_state->done = TRUE;
- nfa_list = set_pdq(d_state->nfa_states);
- for (a = 0; a<class_no; ++a) {
- /* Add NFA states reached by a from d_state */
- reach(nfa_list,a,reach_list);
- /* Were any states found? */
- if ((*reach_list)!=nil) {
- /* was t=empty; */
- set_free(t);
- /* yes, compute closure */
- closure(&t,reach_list);
- /* Make DFA state of it ... */
- trans_d_state = dfastate(t);
- /* And make transition x->t, labeled with a */
- d_state->trans[a] = DFA_NO(trans_d_state);
- d_state->alternatives = TRUE;
- }
- }
- free(nfa_list);
- ++last_done; /* move forward in queue */
- /* And so forth until nothing isn't done */
- d_state = DFA(last_done);
- } while (last_done<=dfa_allocated);
-
- free(reach_list);
- set_free(t);
-
- /* returns pointer to the array that holds the automaton */
- return dfa_array;
-}
-
-void
-#ifdef __USE_PROTOS
-clear_hash(void)
-#else
-clear_hash()
-#endif
-{
- register int i;
-
- for(i=0; i<HASH_SIZE; ++i)
- dfa_hash[i] = 0;
-}
-
-#if HASH_STAT
-void
-#ifdef __USE_PROTOS
-fprint_hash_stats(FILE *f)
-#else
-fprint_hash_stats(f)
-FILE *f;
-#endif
-{
- register hash_list *p;
- register int i,j;
- register total;
-
- total=0;
- for(i=0; i<HASH_SIZE; ++i){
- j=0;
- p = dfa_hash[i];
- while(p){
- ++j;
- p = p->next;
- }
- total+=j;
- fprintf(f,"bin[%d] has %d\n",i,j);
- }
- fprintf(f,"total = %d\n",total);
-}
-#endif
-
-/* Returns a pointer to a dfa node that has the same nfa nodes in it.
- * This may or maynot be a newly created node.
- */
-dfa_node *
-#ifdef __USE_PROTOS
-dfastate(set nfa_states)
-#else
-dfastate(nfa_states)
-set nfa_states;
-#endif
-{
- register hash_list *p;
- int bin;
-
- /* hash using set and see if it exists */
- bin = set_hash(nfa_states,HASH_SIZE);
- p = dfa_hash[bin];
- while(p && !set_equ(nfa_states,(p->node)->nfa_states)){
- p = p->next;
- }
- if(!p){
- /* next state to add to hash table */
- p = (hash_list*)malloc(sizeof(hash_list));
- p->node = new_dfa_node(nfa_states);
- p->next = dfa_hash[bin];
- dfa_hash[bin] = p;
- }
- return (p->node);
-}
-
-
-/* this reach assumes the closure has been done already on set */
-int
-#ifdef __USE_PROTOS
-reach(unsigned *nfa_list, register int a, unsigned *reach_list)
-#else
-reach(nfa_list, a, reach_list)
-unsigned *nfa_list;
-register int a;
-unsigned *reach_list;
-#endif
-{
- register unsigned *e;
- register nfa_node *node;
- int t=0;
-
- e = nfa_list;
- if (e){
- while (*e != nil){
- node = NFA(*e);
- if (set_el(a,node->label)){
- t=1;
- *reach_list=NFA_NO(node->trans[0]);
- ++reach_list;
- }
- ++e;
- }
- }
- *reach_list=nil;
- return t;
-}
-
-/* finds all the nodes that can be reached by epsilon transitions
- from the set of a nodes and returns puts them back in set b */
-set
-#ifdef __USE_PROTOS
-closure(set *b, unsigned *reach_list)
-#else
-closure(b, reach_list)
-set *b;
-unsigned *reach_list;
-#endif
-{
- register nfa_node *node,*n; /* current node being examined */
- register unsigned *e;
-
- ++operation_no;
-#if 0
- t = e = set_pdq(*b);
-#else
- e=reach_list;
-#endif
- while (*e != nil){
- node = NFA(*e);
- set_orel(NFA_NO(node),b);
- /* mark it done */
- node->nfa_set = operation_no;
- if ((n=node->trans[0]) != NIL_INDEX && set_nil(node->label) &&
- (n->nfa_set != operation_no)){
- /* put in b */
- set_orel(NFA_NO(n),b);
- close1(n,operation_no,b);
- }
- if ((n=node->trans[1]) != NIL_INDEX &&
- (n->nfa_set != operation_no)){
- /* put in b */
- set_orel(NFA_NO(node->trans[1]),b);
- close1(n,operation_no,b);
- }
- ++e;
- }
-#if 0
- free(t);
-#endif
- return *b;
-}
-
-#ifdef __USE_PROTOS
-void close1(nfa_node *node, int o, set *b)
-#else
-void close1(node,o,b)
-nfa_node *node;
-int o; /* marker to avoid cycles */
-set *b;
-#endif
-{
- register nfa_node *n; /* current node being examined */
-
- /* mark it done */
- node->nfa_set = o;
- if ((n=node->trans[0]) != NIL_INDEX && set_nil(node->label) &&
- (n->nfa_set != o)){
- /* put in b */
- set_orel(NFA_NO(n),b);
- close1(n,o,b);
- }
- if ((n=node->trans[1]) != NIL_INDEX &&
- (n->nfa_set != o)){
- /* put in b */
- set_orel(NFA_NO(node->trans[1]),b);
- close1(n,o,b);
- }
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.1 b/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.1
deleted file mode 100644
index f68e3ae8a7..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.1
+++ /dev/null
@@ -1,79 +0,0 @@
-.TH dlg 1 "April 1994" "DLG" "PCCTS Manual Pages"
-.SH NAME
-dlg \- DFA Lexical Analyzer Generator
-.SH SYNTAX
-.LP
-\fBdlg\fR [\fIoptions\fR] \fIlexical_spec\fR [\fIoutput_file\fR]
-.SH DESCRIPTION
-.B dlg
-is a tool that produces fast deterministic finite automata for recognizing
-regular expressions in input.
-.SH OPTIONS
-.IP "\fB-CC\fR"
-Generate C++ output. The \fIoutput_file\fP is not specified in this
-case.
-.IP "\fB-C\fR[\fP level\fR]
-Where \fPlevel\fR is the compression level used. 0 indications no
-compression, 1 removes all unused characters from the transition from table,
-and 2 maps equivalent characters into the same character classes. It is
-suggested that level -C2 is used, since it will significantly reduce the size
-of the dfa produced for lexical analyzer.
-.IP "\fB-m\fP
-Produces the header file for the lexical mode with a name other than
-the default name of "mode.h".
-.IP \fB-i\fP
-An interactive, or as interactive as possible, parser is produced. A character
-is only obtained when required to decide which state to go to. Some care
-must be taken to obtain accept states that do not require look ahead at the
-next character to determine if that is the stop state. Any regular expression
-with a Kleene closure at the end is guaranteed to require another character
-of look ahead.
-.IP "\fB-cl\fP class
-Specify a class name for DLG to generate. The default is DLGLexer.
-'class' will be a subclass of DLGLexerBase; only used for -CC.
-.IP \fB-ci\fP
-The automaton will treat upper and lower case characters identically.
-This is accomplished in the automaton; the characters in the lexical
-buffer are unmodified.
-.IP \fB-cs\fP
-Upper and lower case characters are treated as distinct. This is the
-default.
-.IP "\fB-o\fP dir
-Directory where output files should go (default="."). This is very
-nice for keeping the source directory clear of ANTLR and DLG spawn.
-.IP \fB-Wambiguity\fP
-Warns if more than one regular expression could match the same character
-sequence. The warnings give the numbers of the expressions in the dlg
-lexical specification file. The numbering of the expressions starts at one.
-Multiple warnings may be print for the same expressions.
-.IP \-
-Used in place of file names to get input from standard in or send output
-to standard out.
-.SH "SPECIAL CONSIDERATIONS"
-.PP
-\fIDlg\fP works... we think. There is no implicit guarantee of
-anything. We reserve no \fBlegal\fP rights to the software known as
-the Purdue Compiler Construction Tool Set (PCCTS) \(em PCCTS is in the
-public domain. An individual or company may do whatever they wish
-with source code distributed with PCCTS or the code generated by
-PCCTS, including the incorporation of PCCTS, or its output, into
-commercial software. We encourage users to develop software with
-PCCTS. However, we do ask that credit is given to us for developing
-PCCTS. By "credit", we mean that if you incorporate our source code
-into one of your programs (commercial product, research project, or
-otherwise) that you acknowledge this fact somewhere in the
-documentation, research report, etc... If you like PCCTS and have
-developed a nice tool with the output, please mention that you
-developed it using PCCTS. As long as these guidelines are followed, we
-expect to continue enhancing this system and expect to make other
-tools available as they are completed.
-.SH FILES
-.B mode.h
-,
-.B dlgauto.h
-,
-.B dlgdef.h
-.SH SEE ALSO
-.BR antlr (1),
-.BR pccts (1)
-.SH BUGS
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.h b/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.h
deleted file mode 100644
index 9f387c0a1c..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/* dlg header file
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * DLG 1.33
- * Will Cohen
- * With mods by Terence Parr; AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-/* MR1 Move pcctscfg.h to top of file */
-
-#include "pcctscfg.h"
-
-/* turn off warnings for unreferenced labels */
-
-#ifdef _MSC_VER
-#pragma warning(disable:4102)
-#endif
-
-#include "set.h"
-
-#define TRUE 1
-#define FALSE 0
-
-/***** output related stuff *******************/
-#define IN input_stream
-#define OUT output_stream
-
-#define MAX_MODES 50 /* number of %%names allowed */
-#define MAX_ON_LINE 10
-
-#define NFA_MIN 64 /* minimum nfa_array size */
-#define DFA_MIN 64 /* minimum dfa_array size */
-
-#define DEFAULT_CLASSNAME "DLGLexer"
-
-/* these macros allow the size of the character set to be easily changed */
-/* NOTE: do NOT change MIN_CHAR since EOF is the lowest char, -1 */
-#define MIN_CHAR (-1) /* lowest possible character possible on input */
-#define MAX_CHAR 255 /* highest possible character possible on input */
-#define CHAR_RANGE (1+(MAX_CHAR) - (MIN_CHAR))
-
-/* indicates that the not an "array" reference */
-#define NIL_INDEX 0
-
-/* size of hash table used to find dfa_states quickly */
-#define HASH_SIZE 211
-
-#define nfa_node struct _nfa_node
-nfa_node {
- int node_no;
- int nfa_set;
- int accept; /* what case to use */
- nfa_node *trans[2];
- set label; /* one arc always labelled with epsilon */
-};
-
-#define dfa_node struct _dfa_node
-dfa_node {
- int node_no;
- int dfa_set;
- int alternatives; /* used for interactive mode */
- /* are more characters needed */
- int done;
- set nfa_states;
- int trans[1];/* size of transition table depends on
- * number of classes required for automata.
- */
-
-
-};
-
-/******** macros for accessing the NFA and DFA nodes ****/
-#define NFA(x) (nfa_array[x])
-#define DFA(x) (dfa_array[x])
-#define DFA_NO(x) ( (x) ? (x)->node_no : NIL_INDEX)
-#define NFA_NO(x) ( (x) ? (x)->node_no : NIL_INDEX)
-
-/******** wrapper for memory checking ***/
-/*#define malloc(x) dlg_malloc((x),__FILE__,__LINE__)*/
-
-/*#define calloc(x,y) dlg_calloc((x),(y),__FILE__,__LINE__)*/
-
-/******** antlr attributes *************/
-typedef struct {
- unsigned char letter;
- nfa_node *l,*r;
- set label;
- } Attrib;
-
-#define zzcr_attr(attr, token, text) { \
- (attr)->letter = text[0]; (attr)->l = NULL; \
- (attr)->r = NULL; (attr)->label = empty; \
-}
-#define zzd_attr(a) set_free((a)->label);
-
-/******************** Variable ******************************/
-extern char program[]; /* tells what program this is */
-extern char version[]; /* tells what version this is */
-extern char *file_str[]; /* file names being used */
-extern int err_found; /* flag to indicate error occured */
-extern int action_no; /* last action function printed */
-extern int func_action; /* should actions be turned into functions?*/
-extern set used_chars; /* used to label trans. arcs */
-extern set used_classes; /* classes or chars used to label trans. arcs */
-extern int class_no; /* number of classes used */
-extern set class_sets[]; /* shows char. in each class */
-extern set normal_chars; /* mask off unused portion of set */
-extern int comp_level; /* what compression level to use */
-extern int interactive; /* interactive scanner (avoid lookahead)*/
-extern int mode_counter; /* keeps track of the number of %%name */
-extern int dfa_basep[]; /* start of each group of dfa */
-extern int dfa_class_nop[];/* number of transistion arcs in */
- /* each dfa in each mode */
-extern int nfa_allocated;
-extern int dfa_allocated;
-extern nfa_node **nfa_array; /* start of nfa "array" */
-extern dfa_node **dfa_array; /* start of dfa "array" */
-extern int operation_no; /* unique number for each operation */
-extern FILE *input_stream; /* where description read from */
-extern FILE *output_stream; /* where to put the output */
-extern FILE *mode_stream; /* where to put the mode output */
-extern FILE *class_stream;
-extern char *mode_file; /* name of file for mode output */
-extern int gen_ansi; /* produce ansi compatible code */
-extern int case_insensitive;/* ignore case of input spec. */
-extern int warn_ambig; /* show if regular expressions ambiguous */
-extern int gen_cpp;
-extern char *cl_file_str;
-extern int firstLexMember; /* MR1 */
-extern char *OutputDirectory;
-extern char *class_name;
-
-/******************** Functions ******************************/
-#ifdef __USE_PROTOS
-extern char *dlg_malloc(int, char *, int); /* wrapper malloc */
-extern char *dlg_calloc(int, int, char *, int); /* wrapper calloc */
-extern int reach(unsigned *, register int, unsigned *);
-extern set closure(set *, unsigned *);
-extern dfa_node *new_dfa_node(set);
-extern nfa_node *new_nfa_node(void);
-extern dfa_node *dfastate(set);
-extern dfa_node **nfa_to_dfa(nfa_node *);
-extern void internal_error(char *, char *, int); /* MR9 23-Sep-97 */
-extern FILE *read_stream(char *); /* opens file for reading */
-extern FILE *write_stream(char *); /* opens file for writing */
-extern void make_nfa_model_node(void);
-extern void make_dfa_model_node(int);
-extern char *ClassName(char *);
-extern char *OutMetaName(char *);
-extern void error(char*, int);
-extern void warning(char*, int);
-extern void p_head(void);
-extern void p_class_hdr(void);
-extern void p_includes(void);
-extern void p_tables(void);
-extern void p_tail(void); /* MR1 */
-extern void p_class_def1(void); /* MR1 */
-extern void new_automaton_mode(void); /* MR1 */
-extern int relabel(nfa_node *,int); /* MR1 */
-extern void p_shift_table(int); /* MR1 */
-extern void p_bshift_table(void); /* MR1 */
-extern void p_class_table(void); /* MR1 */
-extern void p_mode_def(char *,int); /* MR1 */
-extern void init(void); /* MR1 */
-extern void p_class_def2(void); /* MR1 */
-extern void clear_hash(void); /* MR1 */
-extern void p_alternative_table(void); /* MR1 */
-extern void p_node_table(void); /* MR1 */
-extern void p_dfa_table(void); /* MR1 */
-extern void p_accept_table(void); /* MR1 */
-extern void p_action_table(void); /* MR1 */
-extern void p_base_table(void); /* MR1 */
-extern void p_single_node(int,int); /* MR1 */
-extern char * minsize(int); /* MR1 */
-extern void close1(nfa_node *,int,set *); /* MR1 */
-extern void partition(nfa_node *,int); /* MR1 */
-extern void intersect_nfa_labels(nfa_node *,set *); /* MR1 */
-extern void r_intersect(nfa_node *,set *); /* MR1 */
-extern void label_node(nfa_node *); /* MR1 */
-extern void label_with_classes(nfa_node *); /* MR1 */
-
-#else
-extern char *dlg_malloc(); /* wrapper malloc */
-extern char *dlg_calloc(); /* wrapper calloc */
-extern int reach();
-extern set closure();
-extern dfa_node *new_dfa_node();
-extern nfa_node *new_nfa_node();
-extern dfa_node *dfastate();
-extern dfa_node **nfa_to_dfa();
-extern void internal_error(); /* MR9 23-Sep-97 */
-extern FILE *read_stream(); /* opens file for reading */
-extern FILE *write_stream(); /* opens file for writing */
-extern void make_nfa_model_node();
-extern void make_dfa_model_node();
-extern char *ClassName();
-extern char *OutMetaName();
-extern void error();
-extern void warning();
-extern void p_head(); /* MR9 */
-extern void p_class_hdr(); /* MR9 */
-extern void p_includes(); /* MR9 */
-extern void p_tables(); /* MR9 */
-extern void p_tail(); /* MR1 */
-extern void p_class_def1(); /* MR1 */
-extern void new_automaton_mode(); /* MR1 */
-extern int relabel(); /* MR1 */
-extern void p_shift_table(); /* MR1 */
-extern void p_bshift_table(); /* MR1 */
-extern void p_class_table(); /* MR1 */
-extern void p_mode_def(); /* MR1 */
-extern void init(); /* MR1 */
-extern void p_class_def2(); /* MR1 */
-extern void clear_hash(); /* MR1 */
-extern void p_alternative_table(); /* MR1 */
-extern void p_node_table(); /* MR1 */
-extern void p_dfa_table(); /* MR1 */
-extern void p_accept_table(); /* MR1 */
-extern void p_action_table(); /* MR1 */
-extern void p_base_table(); /* MR1 */
-extern void p_single_node(); /* MR1 */
-extern char * minsize(); /* MR1 */
-extern void close1(); /* MR1 */
-extern void partition(); /* MR1 */
-extern void intersect_nfa_labels(); /* MR1 */
-extern void r_intersect(); /* MR1 */
-extern void label_node(); /* MR1 */
-extern void label_with_classes(); /* MR1 */
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.r b/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.r
deleted file mode 100644
index c5311fa1b8..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg.r
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- File: dlgMPW.r
- Target: dlg 133MR
- Created: Monday, June 15, 1998 4:44:11 AM
- Author: Kenji Tanaka (kentar@osa.att.ne.jp)
-*/
-
-#include "cmdo.r"
-
-resource 'cmdo' (128, "Dlg") {
- { /* array dialogs: 1 elements */
- /* [1] */
- 295,
- "DLG -- Purdue Compiler Construction Tool"
- " Set (PCCTS) lexical analyzer generator.",
- { /* array itemArray: 18 elements */
- /* [1] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {35, 175, 50, 225},
- "On",
- "-CC",
- "When this control is checked, DLG genera"
- "tes a scanner using C++ classes rather t"
- "han C functions."
- },
- /* [2] */
- Or {
- { /* array OrArray: 1 elements */
- /* [1] */
- 1
- }
- },
- RegularEntry {
- "Lexer Class Name:",
- {35, 225, 50, 355},
- {35, 355, 51, 450},
- "DLGLexer",
- keepCase,
- "-cl",
- "This entry specifies the name DLG uses f"
- "or the C++ lexer class."
- },
- /* [3] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {25, 165, 60, 460},
- "C++ Code Generation"
- },
- /* [4] */
- NotDependent {
-
- },
- Files {
- InputFile,
- RequiredFile {
- {37, 25, 56, 135},
- "Input File",
- "",
- "Choose the lexical description file for "
- "DLG to process."
- },
- Additional {
- "",
- "",
- "",
- "",
- { /* array TypesArray: 1 elements */
- /* [1] */
- text
- }
- }
- },
- /* [5] */
- Or {
- { /* array OrArray: 1 elements */
- /* [1] */
- -1
- }
- },
- Files {
- OutputFile,
- RequiredFile {
- {66, 25, 85, 135},
- "Output File",
- "",
- "Choose the name of the file that will ho"
- "ld the DLG-produced scanner."
- },
- NoMore {
-
- }
- },
- /* [6] */
- Or {
- { /* array OrArray: 2 elements */
- /* [1] */
- 1,
- /* [2] */
- 5
- }
- },
- Dummy {
-
- },
- /* [7] */
- NotDependent {
-
- },
- Redirection {
- DiagnosticOutput,
- {90, 25}
- },
- /* [8] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {25, 20, 132, 145},
- "Files"
- },
- /* [9] */
- NotDependent {
-
- },
- Files {
- DirOnly,
- OptionalFile {
- {68, 175, 84, 305},
- {88, 175, 107, 305},
- "Output Directory",
- ":",
- "-o",
- "",
- "Choose the directory where DLG will put "
- "its output.",
- dim,
- "Output DirectoryI",
- "",
- ""
- },
- NoMore {
-
- }
- },
- /* [10] */
- NotDependent {
-
- },
- RegularEntry {
- "Mode File Name:",
- {68, 315, 83, 450},
- {88, 315, 104, 450},
- "mode.h",
- keepCase,
- "-m",
- "This entry specifies the name DLG uses f"
- "or its lexical mode output file."
- },
- /* [11] */
- NotDependent {
-
- },
- RadioButtons {
- { /* array radioArray: 3 elements */
- /* [1] */
- {134, 175, 149, 255}, "None", "", Set, "When this option is selected, DLG will n"
- "ot compress its tables.",
- /* [2] */
- {134, 265, 149, 345}, "Level 1", "-C1", NotSet, "When this option is selected, DLG will r"
- "emove all unused characters from the tra"
- "nsition-from table.",
- /* [3] */
- {134, 360, 149, 450}, "Level 2", "-C2", NotSet, "When this option is selected, DLG will p"
- "erform level 1 compression plus it will "
- "map equivalent characters into the same "
- "character classes."
- }
- },
- /* [12] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {124, 165, 156, 460},
- "Table Compression"
- },
- /* [13] */
- NotDependent {
-
- },
- CheckOption {
- Set,
- {165, 20, 180, 145},
- "Case Sensitive",
- "-ci",
- "When this control is checked, the DLG au"
- "tomaton will treat upper and lower case "
- "characters identically."
- },
- /* [14] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {165, 150, 180, 300},
- "Interactive Scanner",
- "-i",
- "When this control is checked, DLG will g"
- "enerate as interactive a scanner as poss"
- "ible."
- },
- /* [15] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {165, 310, 180, 460},
- "Ambiguity Warnings",
- "-Wambiguity",
- "When this control is checked, DLG warns "
- "if more than one regular expression coul"
- "d match the same character sequence."
- },
- /* [16] */
- NotDependent {
-
- },
- VersionDialog {
- VersionString {
- "1.33MR"
- },
- "PCCTS was written by Terence Parr, Russe"
- "ll Quong, Will Cohen, and Hank Dietz: 19"
- "89-1998. MPW port by Scott Haney.",
- noDialog
- },
- /* [17] */
- And {
- { /* array AndArray: 2 elements */
- /* [1] */
- 4,
- /* [2] */
- 6
- }
- },
- DoItButton {
-
- },
- /* [18] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {142, 20, 157, 148},
- "Generate ANSI C",
- "-ga",
- "When this control is checked, DLG genera"
- "tes ANSI C compatible code."
- }
- }
- }
-};
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg1.txt b/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg1.txt
deleted file mode 100644
index 06b320de2a..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg1.txt
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
-dlg(1) PCCTS Manual Pages dlg(1)
-
-
-
-NAME
- dlg - DFA Lexical Analyzer Generator
-
-SYNTAX
- dlg [_o_p_t_i_o_n_s] _l_e_x_i_c_a_l__s_p_e_c [_o_u_t_p_u_t__f_i_l_e]
-
-DESCRIPTION
- dlg is a tool that produces fast deterministic finite auto-
- mata for recognizing regular expressions in input.
-
-OPTIONS
- -CC Generate C++ output. The _o_u_t_p_u_t__f_i_l_e is not specified
- in this case.
-
- -C[ level]
- Where level is the compression level used. 0 indica-
- tions no compression, 1 removes all unused characters
- from the transition from table, and 2 maps equivalent
- characters into the same character classes. It is sug-
- gested that level -C2 is used, since it will signifi-
- cantly reduce the size of the dfa produced for lexical
- analyzer.
-
- -m Produces the header file for the lexical mode with a
- name other than the default name of "mode.h".
-
- -i An interactive, or as interactive as possible, parser
- is produced. A character is only obtained when
- required to decide which state to go to. Some care
- must be taken to obtain accept states that do not
- require look ahead at the next character to determine
- if that is the stop state. Any regular expression with
- a Kleene closure at the end is guaranteed to require
- another character of look ahead.
-
- -cl class
- Specify a class name for DLG to generate. The default
- is DLGLexer.
-
- -ci The automaton will treat upper and lower case charac-
- ters identically. This is accomplished in the automa-
- ton; the characters in the lexical buffer are unmodi-
- fied.
-
- -cs Upper and lower case characters are treated as dis-
- tinct. This is the default.
-
- -o dir
- Directory where output files should go (default=".").
- This is very nice for keeping the source directory
- clear of ANTLR and DLG spawn.
-
- -Wambiguity
- Warns if more than one regular expression could match
- the same character sequence. The warnings give the
- numbers of the expressions in the dlg lexical specifi-
- cation file. The numbering of the expressions starts
- at one. Multiple warnings may be print for the same
- expressions.
-
- - Used in place of file names to get input from standard
- in or send output to standard out.
-
-SPECIAL CONSIDERATIONS
- _D_l_g works... we think. There is no implicit guarantee of
- anything. We reserve no legal rights to the software known
- as the Purdue Compiler Construction Tool Set (PCCTS) - PCCTS
- is in the public domain. An individual or company may do
- whatever they wish with source code distributed with PCCTS
- or the code generated by PCCTS, including the incorporation
- of PCCTS, or its output, into commercial software. We
- encourage users to develop software with PCCTS. However, we
- do ask that credit is given to us for developing PCCTS. By
- "credit", we mean that if you incorporate our source code
- into one of your programs (commercial product, research pro-
- ject, or otherwise) that you acknowledge this fact somewhere
- in the documentation, research report, etc... If you like
- PCCTS and have developed a nice tool with the output, please
- mention that you developed it using PCCTS. As long as these
- guidelines are followed, we expect to continue enhancing
- this system and expect to make other tools available as they
- are completed.
-
-FILES
- mode.h , dlgauto.h , dlgdef.h
-
-SEE ALSO
- antlr(1), pccts(1)
-
-BUGS
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_a.c b/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_a.c
deleted file mode 100644
index 0b8982cf2a..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_a.c
+++ /dev/null
@@ -1,1414 +0,0 @@
-
-/* parser.dlg -- DLG Description of scanner
- *
- * Generated from: dlg_p.g
- *
- * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
- * Purdue University Electrical Engineering
- * With AHPCRC, University of Minnesota
- * ANTLR Version 1.33MR33
- */
-
-#define ANTLR_VERSION 13333
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-#include <ctype.h>
-#include "dlg.h"
-#include "antlr.h"
-#include "tokens.h"
-#include "dlgdef.h"
-LOOKAHEAD
-
-void
-#ifdef __USE_PROTOS
-zzerraction(void)
-#else
-zzerraction()
-#endif
-{
- (*zzerr)("invalid token");
- zzadvance();
- zzskip();
-}
-/*
- * D L G tables
- *
- * Generated from: parser.dlg
- *
- * 1989-2001 by Will Cohen, Terence Parr, and Hank Dietz
- * Purdue University Electrical Engineering
- * DLG Version 1.33MR33
- */
-
-#include "mode.h"
-
-
-
-
-int func_action; /* should actions be turned into functions?*/
-int lex_mode_counter = 0; /* keeps track of the number of %%names */
-/* MR1 */
-/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
-/* MR1 via <<%%lexmember...>> */
-/* MR1 */
-int lexMember = 0; /* <<%%lexmemeber ...>> MR1 */
-int lexAction = 0; /* <<%%lexaction ...>> MR1 */
-int parserClass = 0; /* <<%%parserclass ...>> MR1 */
-int lexPrefix = 0; /* <<%%lexprefix ...>> MR1 */
-char theClassName[100]; /* MR11 */
-char *pClassName=theClassName; /* MR11 */
-int firstLexMember=1; /* MR1 */
-
-#ifdef __USE_PROTOS
-void xxputc(int c) { /* MR1 */
-#else
- void xxputc(c) /* MR1 */
- int c; /* MR1 */
- { /* MR1 */
-#endif
- if (parserClass) { /* MR1 */
- *pClassName++=c; /* MR1 */
- *pClassName=0; /* MR1 */
- } else if (lexMember || lexPrefix) { /* MR1 */
- if (class_stream != NULL) fputc(c,class_stream); /* MR1 */
- } else { /* MR1 */
- fputc(c,OUT); /* MR1 */
- }; /* MR1 */
- } /* MR1 */
-
-#ifdef __USE_PROTOS
- void xxprintf(char *format,char *string) { /* MR1 */
-#else
- void xxprintf(format,string) /* MR1 */
- char *format; /* MR1 */
- char *string; /* MR1 */
- { /* MR1 */
-#endif
- if (lexMember || lexPrefix || parserClass) { /* MR1 */
- if (class_stream != NULL) /* MR1 */
- fprintf(class_stream,format,string); /* MR1 */
- } else { /* MR1 */
- fprintf(OUT,format,string); /* MR1 */
- }; /* MR1 */
- } /* MR1 */
-
-static void act1()
-{
- NLA = 1;
- }
-
-
-static void act2()
-{
- NLA = 2;
- zzskip();
- }
-
-
-static void act3()
-{
- NLA = 3;
- zzline++; zzskip(); DAWDLE;
- }
-
-
-static void act4()
-{
- NLA = L_EOF;
- }
-
-
-static void act5()
-{
- NLA = PER_PER;
- }
-
-
-static void act6()
-{
- NLA = NAME_PER_PER;
- p_mode_def(&zzlextext[2],lex_mode_counter++);
- }
-
-
-static void act7()
-{
- NLA = LEXMEMBER;
- lexMember=1; /* MR1 */
- if (firstLexMember != 0) { /* MR1 */
- firstLexMember=0; /* MR1 */
- p_class_def1(); /* MR1 */
- }; /* MR1 */
- zzmode(ACT); /* MR1 */
- }
-
-
-static void act8()
-{
- NLA = LEXACTION;
- lexAction=1;zzmode(ACT);
- }
-
-
-static void act9()
-{
- NLA = PARSERCLASS;
- parserClass=1; /* MR1 */
- zzmode(ACT); /* MR1 */
- }
-
-
-static void act10()
-{
- NLA = LEXPREFIX;
- lexPrefix=1;zzmode(ACT);
- }
-
-
-static void act11()
-{
- NLA = ACTION;
- if (func_action)
- fprintf(OUT,"\n%s %sact%d()\n{ ",
- gen_cpp?"ANTLRTokenType":"static void",
- gen_cpp?ClassName("::"):"", ++action_no);
- zzmode(ACT); zzskip();
- }
-
-
-static void act12()
-{
- NLA = GREAT_GREAT;
- }
-
-
-static void act13()
-{
- NLA = L_BRACE;
- }
-
-
-static void act14()
-{
- NLA = R_BRACE;
- }
-
-
-static void act15()
-{
- NLA = L_PAR;
- }
-
-
-static void act16()
-{
- NLA = R_PAR;
- }
-
-
-static void act17()
-{
- NLA = L_BRACK;
- }
-
-
-static void act18()
-{
- NLA = R_BRACK;
- }
-
-
-static void act19()
-{
- NLA = ZERO_MORE;
- }
-
-
-static void act20()
-{
- NLA = ONE_MORE;
- }
-
-
-static void act21()
-{
- NLA = OR;
- }
-
-
-static void act22()
-{
- NLA = RANGE;
- }
-
-
-static void act23()
-{
- NLA = NOT;
- }
-
-
-static void act24()
-{
- NLA = OCTAL_VALUE;
- {int t; sscanf(&zzlextext[1],"%o",&t); zzlextext[0] = t;}
- }
-
-
-static void act25()
-{
- NLA = HEX_VALUE;
- {int t; sscanf(&zzlextext[3],"%x",&t); zzlextext[0] = t;}
- }
-
-
-static void act26()
-{
- NLA = DEC_VALUE;
- {int t; sscanf(&zzlextext[1],"%d",&t); zzlextext[0] = t;}
- }
-
-
-static void act27()
-{
- NLA = TAB;
- zzlextext[0] = '\t';
- }
-
-
-static void act28()
-{
- NLA = NL;
- zzlextext[0] = '\n';
- }
-
-
-static void act29()
-{
- NLA = CR;
- zzlextext[0] = '\r';
- }
-
-
-static void act30()
-{
- NLA = BS;
- zzlextext[0] = '\b';
- }
-
-
-static void act31()
-{
- NLA = CONTINUATION;
- zzline++; zzskip();
- }
-
-
-static void act32()
-{
- NLA = LIT;
- zzlextext[0] = zzlextext[1];
- }
-
-
-static void act33()
-{
- NLA = REGCHAR;
- }
-
-static unsigned char shift0[257] = {
- 0, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 1, 2, 40, 40, 1, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 1, 40, 40, 40, 40, 4, 40,
- 40, 30, 31, 34, 35, 40, 37, 40, 40, 23,
- 24, 24, 24, 24, 24, 24, 24, 25, 25, 40,
- 40, 26, 40, 27, 40, 3, 21, 21, 21, 21,
- 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 20,
- 22, 22, 32, 39, 33, 40, 22, 40, 11, 9,
- 12, 21, 6, 19, 22, 22, 14, 22, 22, 5,
- 8, 16, 15, 17, 22, 10, 18, 13, 22, 22,
- 22, 7, 22, 22, 28, 36, 29, 38, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40
-};
-
-
-static void act34()
-{
- NLA = 1;
- error("unterminated action", zzline); zzmode(START);
- }
-
-
-static void act35()
-{
- NLA = ACTION;
- if (func_action) fprintf(OUT,"}\n\n");
- zzmode(START);
- /* MR1 */
- /* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
- /* MR1 via <<%%lexmember ...>> */
- /* MR1 This is a consequence of not saving actions */
- /* MR1 */
- /* MR1 */ parserClass=0;
- /* MR1 */ lexPrefix=0;
- /* MR1 */ lexAction=0;
- /* MR1 */ lexMember=0;
- }
-
-
-static void act36()
-{
- NLA = 34;
- xxputc(zzlextext[0]); zzskip();
- }
-
-
-static void act37()
-{
- NLA = 35;
- xxputc('>'); zzskip();
- }
-
-
-static void act38()
-{
- NLA = 36;
- xxputc('\\'); zzskip();
- }
-
-
-static void act39()
-{
- NLA = 37;
- xxputc(zzlextext[0]); ++zzline; zzskip();
- }
-
-
-static void act40()
-{
- NLA = 38;
- zzmode(ACTION_COMMENTS); /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- }
-
-
-static void act41()
-{
- NLA = 39;
- zzmode(ACTION_CPP_COMMENTS); /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- }
-
-
-static void act42()
-{
- NLA = 40;
- xxputc(zzlextext[0]); zzskip();
- }
-
-static unsigned char shift1[257] = {
- 0, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 3, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 5, 6, 6, 6, 6, 4, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 1, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 2, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6
-};
-
-
-static void act43()
-{
- NLA = 1;
- }
-
-
-static void act44()
-{
- NLA = 41;
- zzmode(ACT); /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- }
-
-
-static void act45()
-{
- NLA = 42;
- zzline++; xxputc(zzlextext[0]); zzskip();
- }
-
-
-static void act46()
-{
- NLA = 43;
- xxputc(zzlextext[0]); zzskip();
- }
-
-static unsigned char shift2[257] = {
- 0, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 3, 4, 4, 3, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 1, 4, 4, 4, 4, 2, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4
-};
-
-
-static void act47()
-{
- NLA = 1;
- }
-
-
-static void act48()
-{
- NLA = 44;
- zzmode(ACT); zzline++; /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- }
-
-
-static void act49()
-{
- NLA = 45;
- xxputc(zzlextext[0]); zzskip();
- }
-
-static unsigned char shift3[257] = {
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 1, 2, 2, 1, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2
-};
-
-#define DfaStates 94
-typedef unsigned char DfaState;
-
-static DfaState st0[42] = {
- 1, 2, 3, 4, 5, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 6, 94
-};
-
-static DfaState st1[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st2[42] = {
- 94, 21, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st3[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st4[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st5[42] = {
- 94, 94, 94, 94, 22, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st6[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st7[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 23, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st8[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 24, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st9[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st10[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st11[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st12[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st13[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st14[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st15[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st16[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st17[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st18[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st19[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st20[42] = {
- 94, 25, 26, 25, 25, 25, 25, 25, 25, 27,
- 28, 25, 25, 29, 25, 25, 30, 25, 25, 25,
- 25, 25, 25, 31, 32, 32, 25, 25, 25, 25,
- 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
- 25, 94
-};
-
-static DfaState st21[42] = {
- 94, 21, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st22[42] = {
- 94, 94, 94, 94, 94, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st23[42] = {
- 94, 94, 94, 94, 34, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st24[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st25[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st26[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st27[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st28[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st29[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st30[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st31[42] = {
- 94, 94, 94, 94, 94, 94, 94, 35, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 35, 94, 94, 36, 36, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st32[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 37, 37, 37, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st33[42] = {
- 94, 94, 94, 94, 94, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st34[42] = {
- 94, 94, 94, 94, 39, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st35[42] = {
- 94, 94, 94, 94, 94, 94, 40, 94, 94, 40,
- 94, 40, 40, 94, 94, 94, 94, 94, 94, 40,
- 94, 40, 94, 40, 40, 40, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st36[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 36, 36, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st37[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 37, 37, 37, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st38[42] = {
- 94, 94, 94, 94, 94, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st39[42] = {
- 94, 94, 94, 94, 94, 41, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 42, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st40[42] = {
- 94, 94, 94, 94, 94, 94, 40, 94, 94, 40,
- 94, 40, 40, 94, 94, 94, 94, 94, 94, 40,
- 94, 40, 94, 40, 40, 40, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st41[42] = {
- 94, 94, 94, 94, 94, 94, 43, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st42[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 44, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st43[42] = {
- 94, 94, 94, 94, 94, 94, 94, 45, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st44[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 46, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st45[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 47, 94,
- 94, 48, 94, 94, 94, 94, 94, 49, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st46[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 50, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st47[42] = {
- 94, 94, 94, 94, 94, 94, 51, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st48[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 52, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st49[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 53, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st50[42] = {
- 94, 94, 94, 94, 94, 94, 54, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st51[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 55, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st52[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 56, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st53[42] = {
- 94, 94, 94, 94, 94, 94, 57, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st54[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 58, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st55[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 59,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st56[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 60, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st57[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 61,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st58[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 62, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st59[42] = {
- 94, 94, 94, 94, 94, 94, 63, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st60[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 64, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st61[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 65, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st62[42] = {
- 94, 94, 94, 94, 94, 66, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st63[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 67, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st64[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 68, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st65[42] = {
- 94, 94, 94, 94, 94, 94, 94, 69, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st66[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 70, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st67[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st68[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st69[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st70[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 71, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st71[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 72, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st72[42] = {
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94
-};
-
-static DfaState st73[8] = {
- 74, 75, 76, 77, 78, 79, 79, 94
-};
-
-static DfaState st74[8] = {
- 94, 94, 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st75[8] = {
- 94, 80, 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st76[8] = {
- 94, 81, 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st77[8] = {
- 94, 94, 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st78[8] = {
- 94, 94, 94, 94, 82, 83, 94, 94
-};
-
-static DfaState st79[8] = {
- 94, 94, 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st80[8] = {
- 94, 94, 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st81[8] = {
- 94, 94, 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st82[8] = {
- 94, 94, 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st83[8] = {
- 94, 94, 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st84[6] = {
- 85, 86, 87, 88, 87, 94
-};
-
-static DfaState st85[6] = {
- 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st86[6] = {
- 94, 94, 89, 94, 94, 94
-};
-
-static DfaState st87[6] = {
- 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st88[6] = {
- 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st89[6] = {
- 94, 94, 94, 94, 94, 94
-};
-
-static DfaState st90[4] = {
- 91, 92, 93, 94
-};
-
-static DfaState st91[4] = {
- 94, 94, 94, 94
-};
-
-static DfaState st92[4] = {
- 94, 94, 94, 94
-};
-
-static DfaState st93[4] = {
- 94, 94, 94, 94
-};
-
-
-DfaState *dfa[94] = {
- st0,
- st1,
- st2,
- st3,
- st4,
- st5,
- st6,
- st7,
- st8,
- st9,
- st10,
- st11,
- st12,
- st13,
- st14,
- st15,
- st16,
- st17,
- st18,
- st19,
- st20,
- st21,
- st22,
- st23,
- st24,
- st25,
- st26,
- st27,
- st28,
- st29,
- st30,
- st31,
- st32,
- st33,
- st34,
- st35,
- st36,
- st37,
- st38,
- st39,
- st40,
- st41,
- st42,
- st43,
- st44,
- st45,
- st46,
- st47,
- st48,
- st49,
- st50,
- st51,
- st52,
- st53,
- st54,
- st55,
- st56,
- st57,
- st58,
- st59,
- st60,
- st61,
- st62,
- st63,
- st64,
- st65,
- st66,
- st67,
- st68,
- st69,
- st70,
- st71,
- st72,
- st73,
- st74,
- st75,
- st76,
- st77,
- st78,
- st79,
- st80,
- st81,
- st82,
- st83,
- st84,
- st85,
- st86,
- st87,
- st88,
- st89,
- st90,
- st91,
- st92,
- st93
-};
-
-
-DfaState accepts[95] = {
- 0, 1, 2, 3, 4, 33, 33, 33, 33, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 0, 2, 5, 11, 12, 32, 31, 30, 29, 27,
- 28, 24, 26, 6, 0, 0, 24, 26, 6, 0,
- 25, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 7, 8, 10,
- 0, 0, 9, 0, 34, 36, 38, 39, 42, 42,
- 35, 37, 41, 40, 0, 43, 46, 46, 45, 44,
- 0, 47, 48, 49, 0
-};
-
-void (*actions[50])() = {
- zzerraction,
- act1,
- act2,
- act3,
- act4,
- act5,
- act6,
- act7,
- act8,
- act9,
- act10,
- act11,
- act12,
- act13,
- act14,
- act15,
- act16,
- act17,
- act18,
- act19,
- act20,
- act21,
- act22,
- act23,
- act24,
- act25,
- act26,
- act27,
- act28,
- act29,
- act30,
- act31,
- act32,
- act33,
- act34,
- act35,
- act36,
- act37,
- act38,
- act39,
- act40,
- act41,
- act42,
- act43,
- act44,
- act45,
- act46,
- act47,
- act48,
- act49
-};
-
-static DfaState dfa_base[] = {
- 0,
- 73,
- 84,
- 90
-};
-
-static unsigned char *b_class_no[] = {
- shift0,
- shift1,
- shift2,
- shift3
-};
-
-
-
-#define ZZSHIFT(c) (b_class_no[zzauto][1+c])
-#define MAX_MODE 4
-#include "dlgauto.h"
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c b/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c
deleted file mode 100644
index e726ae3983..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.c
+++ /dev/null
@@ -1,959 +0,0 @@
-/*
- * A n t l r T r a n s l a t i o n H e a d e r
- *
- * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
- * Purdue University Electrical Engineering
- * With AHPCRC, University of Minnesota
- * ANTLR Version 1.33MR33
- *
- * ..\bin\antlr dlg_p.g -gh
- *
- */
-
-#define ANTLR_VERSION 13333
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-#include <ctype.h>
-#include "dlg.h"
-#define zzSET_SIZE 8
-#include "antlr.h"
-#include "tokens.h"
-#include "dlgdef.h"
-#include "mode.h"
-
-/* MR23 In order to remove calls to PURIFY use the antlr -nopurify option */
-
-#ifndef PCCTS_PURIFY
-#define PCCTS_PURIFY(r,s) memset((char *) &(r),'\0',(s));
-#endif
-
-ANTLR_INFO
-
-
-/* MR20 G. Hobbelt
-Fix for Borland C++ 4.x & 5.x compiling with ALL warnings enabled
-*/
-
-#ifdef __TURBOC__
-#pragma warn -aus /* unused assignment of 'xxx' */
-#endif
-
-int action_no = 0; /* keep track of actions outputed */
-int nfa_allocated = 0; /* keeps track of number of nfa nodes */
-nfa_node **nfa_array = NULL;/* root of binary tree that stores nfa array */
-nfa_node nfa_model_node; /* model to initialize new nodes */
-set used_chars; /* used to label trans. arcs */
-set used_classes; /* classes or chars used to label trans. arcs */
-set normal_chars; /* mask to get rid elements that aren't used
-in set */
-int flag_paren = FALSE;
-int flag_brace = FALSE;
-int mode_counter = 0; /* keep track of number of %%names */
-
-
-
-void
-#ifdef __USE_PROTOS
-grammar(void)
-#else
-grammar()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- p_head(); p_class_hdr(); func_action = FALSE;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (setwd1[LA(1)]&0x1) ) {
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- if ( (LA(1)==LEXACTION) ) {
- zzmatch(LEXACTION); zzCONSUME;
- }
- else {
- if ( (LA(1)==LEXMEMBER) ) {
- zzmatch(LEXMEMBER); zzCONSUME;
- }
- else {
- if ( (LA(1)==LEXPREFIX) ) {
- zzmatch(LEXPREFIX); zzCONSUME;
- }
- else {
- if ( (LA(1)==PARSERCLASS) ) {
- zzmatch(PARSERCLASS); zzCONSUME;
- }
- else {
- if ( (LA(1)==ACTION) ) {
- }
- else {zzFAIL(1,zzerr1,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- }
- }
- zzEXIT(zztasp3);
- }
- }
- zzmatch(ACTION); zzCONSUME;
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- if ( gen_cpp ) p_includes();
- start_states();
- func_action = FALSE; p_tables(); p_tail();
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (LA(1)==ACTION) ) {
- zzmatch(ACTION); zzCONSUME;
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- zzmatch(1);
- if (firstLexMember != 0) p_class_def1();
- zzCONSUME;
-
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd1, 0x2);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-start_states(void)
-#else
-start_states()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==PER_PER) ) {
- zzmatch(PER_PER); zzCONSUME;
- do_conversion();
- }
- else {
- if ( (LA(1)==NAME_PER_PER) ) {
- zzmatch(NAME_PER_PER); zzCONSUME;
- do_conversion();
- {
- zzBLOCK(zztasp3);
- zzMake0;
- {
- while ( (LA(1)==NAME_PER_PER) ) {
- zzmatch(NAME_PER_PER); zzCONSUME;
- do_conversion();
- zzLOOP(zztasp3);
- }
- zzEXIT(zztasp3);
- }
- }
- }
- else {zzFAIL(1,zzerr2,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- zzmatch(PER_PER); zzCONSUME;
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd1, 0x4);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-do_conversion(void)
-#else
-do_conversion()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- new_automaton_mode(); func_action = TRUE;
- rule_list();
-
- dfa_class_nop[mode_counter] =
- relabel(zzaArg(zztasp1,1 ).l,comp_level);
- if (comp_level)
- p_shift_table(mode_counter);
- dfa_basep[mode_counter] = dfa_allocated+1;
- make_dfa_model_node(dfa_class_nop[mode_counter]);
- nfa_to_dfa(zzaArg(zztasp1,1 ).l);
- ++mode_counter;
- func_action = FALSE;
-#ifdef HASH_STAT
- fprint_hash_stats(stderr);
-#endif
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd1, 0x8);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-rule_list(void)
-#else
-rule_list()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- if ( (setwd1[LA(1)]&0x10) ) {
- rule();
- zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (setwd1[LA(1)]&0x20) ) {
- rule();
- {nfa_node *t1;
- t1 = new_nfa_node();
- (t1)->trans[0]=zzaRet.l;
- (t1)->trans[1]=zzaArg(zztasp2,1 ).l;
- /* all accept nodes "dead ends" */
- zzaRet.l=t1; zzaRet.r=NULL;
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- }
- else {
- if ( (setwd1[LA(1)]&0x40) ) {
- zzaRet.l = new_nfa_node(); zzaRet.r = NULL;
- warning("no regular expressions", zzline);
- }
- else {zzFAIL(1,zzerr3,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd1, 0x80);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-rule(void)
-#else
-rule()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- if ( (setwd2[LA(1)]&0x1) ) {
- reg_expr();
- zzmatch(ACTION);
- if (zzaArg(zztasp1,1 ).r != NULL) {
- zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r; (zzaArg(zztasp1,1 ).r)->accept=action_no;
- }
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==ACTION) ) {
- zzmatch(ACTION);
- zzaRet.l = NULL; zzaRet.r = NULL;
- error("no expression for action ", zzline);
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr4,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd2, 0x2);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-reg_expr(void)
-#else
-reg_expr()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- and_expr();
- zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (LA(1)==OR) ) {
- zzmatch(OR); zzCONSUME;
- and_expr();
- {nfa_node *t1, *t2;
- t1 = new_nfa_node(); t2 = new_nfa_node();
- (t1)->trans[0]=zzaRet.l;
- (t1)->trans[1]=zzaArg(zztasp2,2 ).l;
- /* MR23 */ if (zzaRet.r != NULL) (zzaRet.r)->trans[1]=t2;
- if (zzaArg(zztasp2,2 ).r) {
- (zzaArg(zztasp2,2 ).r)->trans[1]=t2; /* MR20 */
- }
- zzaRet.l=t1; zzaRet.r=t2;
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd2, 0x4);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-and_expr(void)
-#else
-and_expr()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- repeat_expr();
-
- zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (setwd2[LA(1)]&0x8) ) {
- repeat_expr();
- if (zzaRet.r != NULL) {
- (zzaRet.r)->trans[1]=zzaArg(zztasp2,1 ).l;
- zzaRet.r=zzaArg(zztasp2,1 ).r;
- }
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd2, 0x10);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-repeat_expr(void)
-#else
-repeat_expr()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- if ( (setwd2[LA(1)]&0x20) ) {
- expr();
- zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r;
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==ZERO_MORE) ) {
- zzmatch(ZERO_MORE);
- { nfa_node *t1,*t2;
- /* MR23 */ if (zzaRet.r != NULL) (zzaRet.r)->trans[0] = zzaRet.l;
- t1 = new_nfa_node(); t2 = new_nfa_node();
- t1->trans[0]=zzaRet.l;
- t1->trans[1]=t2;
- /* MR23 */ if (zzaRet.r != NULL) (zzaRet.r)->trans[1]=t2;
- zzaRet.l=t1;zzaRet.r=t2;
- }
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==ONE_MORE) ) {
- zzmatch(ONE_MORE);
- if (zzaRet.r != NULL) (zzaRet.r)->trans[0] = zzaRet.l;
- zzCONSUME;
-
- }
- else {
- if ( (setwd2[LA(1)]&0x40) ) {
- }
- else {zzFAIL(1,zzerr5,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- zzEXIT(zztasp2);
- }
- }
- }
- else {
- if ( (LA(1)==ZERO_MORE) ) {
- zzmatch(ZERO_MORE);
- error("no expression for *", zzline);
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==ONE_MORE) ) {
- zzmatch(ONE_MORE);
- error("no expression for +", zzline);
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr6,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd2, 0x80);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-expr(void)
-#else
-expr()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- zzaRet.l = new_nfa_node();
- zzaRet.r = new_nfa_node();
- if ( (LA(1)==L_BRACK) ) {
- zzmatch(L_BRACK); zzCONSUME;
- atom_list();
- zzmatch(R_BRACK);
-
- /* MR23 */ if (zzaRet.l != NULL) {
- (zzaRet.l)->trans[0] = zzaRet.r;
- (zzaRet.l)->label = set_dup(zzaArg(zztasp1,2 ).label);
- set_orin(&used_chars,(zzaRet.l)->label);
- }
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==NOT) ) {
- zzmatch(NOT); zzCONSUME;
- zzmatch(L_BRACK); zzCONSUME;
- atom_list();
- zzmatch(R_BRACK);
-
- /* MR23 */ if (zzaRet.l != NULL) {
- (zzaRet.l)->trans[0] = zzaRet.r;
- (zzaRet.l)->label = set_dif(normal_chars,zzaArg(zztasp1,3 ).label);
- set_orin(&used_chars,(zzaRet.l)->label);
- }
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==L_PAR) ) {
- zzmatch(L_PAR); zzCONSUME;
- reg_expr();
- zzmatch(R_PAR);
-
- /* MR23 */ if (zzaRet.l != NULL) {
- (zzaRet.l)->trans[0] = zzaArg(zztasp1,2 ).l;
- if (zzaArg(zztasp1,2 ).r) {
- (zzaArg(zztasp1,2 ).r)->trans[1] = zzaRet.r; /* MR20 */
- }
- }
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==L_BRACE) ) {
- zzmatch(L_BRACE); zzCONSUME;
- reg_expr();
- zzmatch(R_BRACE);
-
- /* MR23 */ if (zzaRet.l != NULL) {
- (zzaRet.l)->trans[0] = zzaArg(zztasp1,2 ).l;
- (zzaRet.l)->trans[1] = zzaRet.r;
- if (zzaArg(zztasp1,2 ).r) {
- (zzaArg(zztasp1,2 ).r)->trans[1] = zzaRet.r; /* MR20 */
- }
- }
- zzCONSUME;
-
- }
- else {
- if ( (setwd3[LA(1)]&0x1) ) {
- atom();
-
- /* MR23 */ if (zzaRet.l != NULL) {
- (zzaRet.l)->trans[0] = zzaRet.r;
- (zzaRet.l)->label = set_dup(zzaArg(zztasp1,1 ).label);
- set_orin(&used_chars,(zzaRet.l)->label);
- }
- }
- else {zzFAIL(1,zzerr7,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- }
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd3, 0x2);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-atom_list(void)
-#else
-atom_list()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- set_free(zzaRet.label);
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- while ( (setwd3[LA(1)]&0x4) ) {
- near_atom();
- set_orin(&(zzaRet.label),zzaArg(zztasp2,1 ).label);
- zzLOOP(zztasp2);
- }
- zzEXIT(zztasp2);
- }
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd3, 0x8);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-near_atom(void)
-#else
-near_atom()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- register int i;
- register int i_prime;
- anychar();
- zzaRet.letter=zzaArg(zztasp1,1 ).letter; zzaRet.label=set_of(zzaArg(zztasp1,1 ).letter);
- i_prime = zzaArg(zztasp1,1 ).letter + MIN_CHAR;
- if (case_insensitive && islower(i_prime))
- set_orel(toupper(i_prime)-MIN_CHAR,
- &(zzaRet.label));
- if (case_insensitive && isupper(i_prime))
- set_orel(tolower(i_prime)-MIN_CHAR,
- &(zzaRet.label));
- {
- zzBLOCK(zztasp2);
- zzMake0;
- {
- if ( (LA(1)==RANGE) ) {
- zzmatch(RANGE); zzCONSUME;
- anychar();
- if (case_insensitive){
- i_prime = zzaRet.letter+MIN_CHAR;
- zzaRet.letter = (islower(i_prime) ?
- toupper(i_prime) : i_prime)-MIN_CHAR;
- i_prime = zzaArg(zztasp2,2 ).letter+MIN_CHAR;
- zzaArg(zztasp2,2 ).letter = (islower(i_prime) ?
- toupper(i_prime) : i_prime)-MIN_CHAR;
- }
- /* check to see if range okay */
- {
- int debugLetter1 = zzaRet.letter;
- int debugLetter2 = zzaArg(zztasp2,2 ).letter;
- }
- if (zzaRet.letter > zzaArg(zztasp2,2 ).letter
- && zzaArg(zztasp2,2 ).letter != 0xff){ /* MR16 */
- error("invalid range ", zzline);
- }
- for (i=zzaRet.letter; i<= (int)zzaArg(zztasp2,2 ).letter; ++i){
- set_orel(i,&(zzaRet.label));
- i_prime = i+MIN_CHAR;
- if (case_insensitive && islower(i_prime))
- set_orel(toupper(i_prime)-MIN_CHAR,
- &(zzaRet.label));
- if (case_insensitive && isupper(i_prime))
- set_orel(tolower(i_prime)-MIN_CHAR,
- &(zzaRet.label));
- }
- }
- else {
- if ( (setwd3[LA(1)]&0x10) ) {
- }
- else {zzFAIL(1,zzerr8,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- zzEXIT(zztasp2);
- }
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd3, 0x20);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-atom(void)
-#else
-atom()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- register int i_prime;
- anychar();
- zzaRet.label = set_of(zzaArg(zztasp1,1 ).letter);
- i_prime = zzaArg(zztasp1,1 ).letter + MIN_CHAR;
- if (case_insensitive && islower(i_prime))
- set_orel(toupper(i_prime)-MIN_CHAR,
- &(zzaRet.label));
- if (case_insensitive && isupper(i_prime))
- set_orel(tolower(i_prime)-MIN_CHAR,
- &(zzaRet.label));
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd3, 0x40);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-anychar(void)
-#else
-anychar()
-#endif
-{
- zzRULE;
- zzBLOCK(zztasp1);
- zzMake0;
- {
- if ( (LA(1)==REGCHAR) ) {
- zzmatch(REGCHAR);
- zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==OCTAL_VALUE) ) {
- zzmatch(OCTAL_VALUE);
- zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==HEX_VALUE) ) {
- zzmatch(HEX_VALUE);
- zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==DEC_VALUE) ) {
- zzmatch(DEC_VALUE);
- zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==TAB) ) {
- zzmatch(TAB);
- zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==NL) ) {
- zzmatch(NL);
- zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==CR) ) {
- zzmatch(CR);
- zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==BS) ) {
- zzmatch(BS);
- zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==LIT) ) {
- zzmatch(LIT);
- zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;
- zzCONSUME;
-
- }
- else {
- if ( (LA(1)==L_EOF) ) {
- zzmatch(L_EOF);
- zzaRet.letter = 0;
- zzCONSUME;
-
- }
- else {zzFAIL(1,zzerr9,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
- }
- }
- }
- }
- }
- }
- }
- }
- }
- zzEXIT(zztasp1);
- return;
-fail:
- zzEXIT(zztasp1);
- /* empty action */
- zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
- zzresynch(setwd3, 0x80);
- }
-}
-
-/* adds a new nfa to the binary tree and returns a pointer to it */
-nfa_node *
-#ifdef __USE_PROTOS
-new_nfa_node(void)
-#else
-new_nfa_node()
-#endif
-{
- register nfa_node *t;
- static int nfa_size=0; /* elements nfa_array[] can hold */
-
- ++nfa_allocated;
- if (nfa_size<=nfa_allocated){
- /* need to redo array */
- if (!nfa_array){
- /* need some to do inital allocation */
- nfa_size=nfa_allocated+NFA_MIN;
- nfa_array=(nfa_node **) malloc(sizeof(nfa_node*)*
- nfa_size);
- }else{
- /* need more space */
- nfa_size=2*(nfa_allocated+1);
- nfa_array=(nfa_node **) realloc(nfa_array,
- sizeof(nfa_node*)*nfa_size);
- }
- }
- /* fill out entry in array */
- t = (nfa_node*) malloc(sizeof(nfa_node));
- nfa_array[nfa_allocated] = t;
- *t = nfa_model_node;
- t->node_no = nfa_allocated;
- return t;
-}
-
-
-/* initialize the model node used to fill in newly made nfa_nodes */
-void
-#ifdef __USE_PROTOS
-make_nfa_model_node(void)
-#else
-make_nfa_model_node()
-#endif
-{
- nfa_model_node.node_no = -1; /* impossible value for real nfa node */
- nfa_model_node.nfa_set = 0;
- nfa_model_node.accept = 0; /* error state default*/
- nfa_model_node.trans[0] = NULL;
- nfa_model_node.trans[1] = NULL;
- nfa_model_node.label = empty;
-}
-
-#if defined(DEBUG) || defined(_DEBUG)
-
-/* print out the pointer value and the node_number */
-void
-#ifdef __USE_PROTOS
-fprint_dfa_pair(FILE *f, nfa_node *p)
-#else
-fprint_dfa_pair(f, p)
-FILE *f;
-nfa_node *p;
-#endif
-{
- if (p){
- fprintf(f, "%x (%d)", p, p->node_no);
- }else{
- fprintf(f, "(nil)");
- }
-}
-
-/* print out interest information on a set */
-void
-#ifdef __USE_PROTOS
-fprint_set(FILE *f, set s)
-#else
-fprint_set(f,s)
-FILE *f;
-set s;
-#endif
-{
- unsigned int *x;
-
- fprintf(f, "n = %d,", s.n);
- if (s.setword){
- fprintf(f, "setword = %x, ", s.setword);
- /* print out all the elements in the set */
- x = set_pdq(s);
- while (*x!=nil){
- fprintf(f, "%d ", *x);
- ++x;
- }
- }else{
- fprintf(f, "setword = (nil)");
- }
-}
-
-/* code to be able to dump out the nfas
-return 0 if okay dump
-return 1 if screwed up
-*/
-int
-#ifdef __USE_PROTOS
-dump_nfas(int first_node, int last_node)
-#else
-dump_nfas(first_node, last_node)
-int first_node;
-int last_node;
-#endif
-{
- register int i;
- nfa_node *t;
-
- for (i=first_node; i<=last_node; ++i){
- t = NFA(i);
- if (!t) break;
- fprintf(stderr, "nfa_node %d {\n", t->node_no);
- fprintf(stderr, "\n\tnfa_set = %d\n", t->nfa_set);
- fprintf(stderr, "\taccept\t=\t%d\n", t->accept);
- fprintf(stderr, "\ttrans\t=\t(");
- fprint_dfa_pair(stderr, t->trans[0]);
- fprintf(stderr, ",");
- fprint_dfa_pair(stderr, t->trans[1]);
- fprintf(stderr, ")\n");
- fprintf(stderr, "\tlabel\t=\t{ ");
- fprint_set(stderr, t->label);
- fprintf(stderr, "\t}\n");
- fprintf(stderr, "}\n\n");
- }
- return 0;
-}
-#endif
-
-/* DLG-specific syntax error message generator
-* (define USER_ZZSYN when compiling so don't get 2 definitions)
-*/
-void
-#ifdef __USE_PROTOS
-zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, char *bad_text)
-#else
-zzsyn(text, tok, egroup, eset, etok, k, bad_text)
-char *text, *egroup, *bad_text;
-int tok;
-int etok;
-int k;
-SetWordType *eset;
-#endif
-{
-fprintf(stderr, ErrHdr, file_str[0]!=NULL?file_str[0]:"stdin", zzline);
-fprintf(stderr, " syntax error at \"%s\"", (tok==zzEOF_TOKEN)?"EOF":text);
-if ( !etok && !eset ) {fprintf(stderr, "\n"); return;}
-if ( k==1 ) fprintf(stderr, " missing");
-else
-{
-fprintf(stderr, "; \"%s\" not", bad_text);
-if ( zzset_deg(eset)>1 ) fprintf(stderr, " in");
-}
-if ( zzset_deg(eset)>0 ) zzedecode(eset);
-else fprintf(stderr, " %s", zztokens[etok]);
-if ( strlen(egroup) > (size_t)0 ) fprintf(stderr, " in %s", egroup);
-fprintf(stderr, "\n");
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.g b/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.g
deleted file mode 100644
index 58ca110693..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/dlg_p.g
+++ /dev/null
@@ -1,614 +0,0 @@
-/* This is the parser for the dlg
- * This is a part of the Purdue Compiler Construction Tool Set
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * DLG 1.33
- * Will Cohen
- * With mods by Terence Parr; AHPCRC, University of Minnesota
- * 1989-1995
- */
-
-#header <<
-#include <ctype.h>
-#include "dlg.h"
->>
-
-<<
-
-/* MR20 G. Hobbelt
- Fix for Borland C++ 4.x & 5.x compiling with ALL warnings enabled
-*/
-
-#ifdef __TURBOC__
-#pragma warn -aus /* unused assignment of 'xxx' */
-#endif
-
-int action_no = 0; /* keep track of actions outputed */
-int nfa_allocated = 0; /* keeps track of number of nfa nodes */
-nfa_node **nfa_array = NULL;/* root of binary tree that stores nfa array */
-nfa_node nfa_model_node; /* model to initialize new nodes */
-set used_chars; /* used to label trans. arcs */
-set used_classes; /* classes or chars used to label trans. arcs */
-set normal_chars; /* mask to get rid elements that aren't used
- in set */
-int flag_paren = FALSE;
-int flag_brace = FALSE;
-int mode_counter = 0; /* keep track of number of %%names */
-
->>
-
-#lexaction <<
-int func_action; /* should actions be turned into functions?*/
-int lex_mode_counter = 0; /* keeps track of the number of %%names */
-/* MR1 */
-/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
-/* MR1 via <<%%lexmember...>> */
-/* MR1 */
-int lexMember = 0; /* <<%%lexmemeber ...>> MR1 */
-int lexAction = 0; /* <<%%lexaction ...>> MR1 */
-int parserClass = 0; /* <<%%parserclass ...>> MR1 */
-int lexPrefix = 0; /* <<%%lexprefix ...>> MR1 */
-char theClassName[100]; /* MR11 */
-char *pClassName=theClassName; /* MR11 */
-int firstLexMember=1; /* MR1 */
-
-#ifdef __USE_PROTOS
-void xxputc(int c) { /* MR1 */
-#else
-void xxputc(c) /* MR1 */
- int c; /* MR1 */
-{ /* MR1 */
-#endif
- if (parserClass) { /* MR1 */
- *pClassName++=c; /* MR1 */
- *pClassName=0; /* MR1 */
- } else if (lexMember || lexPrefix) { /* MR1 */
- if (class_stream != NULL) fputc(c,class_stream); /* MR1 */
- } else { /* MR1 */
- fputc(c,OUT); /* MR1 */
- }; /* MR1 */
-} /* MR1 */
-
-#ifdef __USE_PROTOS
-void xxprintf(char *format,char *string) { /* MR1 */
-#else
-void xxprintf(format,string) /* MR1 */
- char *format; /* MR1 */
- char *string; /* MR1 */
-{ /* MR1 */
-#endif
- if (lexMember || lexPrefix || parserClass) { /* MR1 */
- if (class_stream != NULL) /* MR1 */
- fprintf(class_stream,format,string); /* MR1 */
- } else { /* MR1 */
- fprintf(OUT,format,string); /* MR1 */
- }; /* MR1 */
-} /* MR1 */
->>
-
-#token "[\r\t\ ]+" << zzskip(); >> /* Ignore white */
-#token "\n" << zzline++; zzskip(); DAWDLE; >> /* Track Line # */
-#token L_EOF "\@"
-#token PER_PER "\%\%"
-#token NAME_PER_PER "\%\%[a-zA-Z_][a-zA-Z0-9_]*"
- << p_mode_def(&zzlextext[2],lex_mode_counter++); >>
-
-#token LEXMEMBER "\<\<\%\%lexmember" /* MR1 */
- <<lexMember=1; /* MR1 */
- if (firstLexMember != 0) { /* MR1 */
- firstLexMember=0; /* MR1 */
- p_class_def1(); /* MR1 */
- }; /* MR1 */
- zzmode(ACT); /* MR1 */
- >> /* MR1 */
-#token LEXACTION "\<\<\%\%lexaction" /* MR1 */
- <<lexAction=1;zzmode(ACT);>> /* MR1 */
-#token PARSERCLASS "\<\<\%\%parserclass" /* MR1 */
- <<parserClass=1; /* MR1 */
- zzmode(ACT); /* MR1 */
- >> /* MR1 */
-#token LEXPREFIX "\<\<\%\%lexprefix" /* MR1 */
- <<lexPrefix=1;zzmode(ACT);>> /* MR1 */
-
-#token ACTION "\<\<"
- << if (func_action)
- fprintf(OUT,"\n%s %sact%d()\n{ ",
- gen_cpp?"ANTLRTokenType":"static void",
- gen_cpp?ClassName("::"):"", ++action_no);
- zzmode(ACT); zzskip();
- >>
-#token GREAT_GREAT "\>\>"
-#token L_BRACE "\{"
-#token R_BRACE "\}"
-#token L_PAR "\("
-#token R_PAR "\)"
-#token L_BRACK "\["
-#token R_BRACK "\]"
-#token ZERO_MORE "\*"
-#token ONE_MORE "\+"
-#token OR "\|"
-#token RANGE "\-"
-#token NOT "\~"
-#token OCTAL_VALUE "\\0[0-7]*"
- << {int t; sscanf(&zzlextext[1],"%o",&t); zzlextext[0] = t;}>>
-#token HEX_VALUE "\\0[Xx][0-9a-fA-F]+"
- << {int t; sscanf(&zzlextext[3],"%x",&t); zzlextext[0] = t;}>>
-#token DEC_VALUE "\\[1-9][0-9]*"
- << {int t; sscanf(&zzlextext[1],"%d",&t); zzlextext[0] = t;}>>
-#token TAB "\\t" << zzlextext[0] = '\t';>>
-#token NL "\\n" << zzlextext[0] = '\n';>>
-#token CR "\\r" << zzlextext[0] = '\r';>>
-#token BS "\\b" << zzlextext[0] = '\b';>>
-
-/* MR1 */
-/* MR1 10-Apr-97 MR1 Allow #token regular expressions to cross lines */
-/* MR1 */
-#token CONTINUATION "\\ \n" << zzline++; zzskip();>> /* MR1 */
-
-/* NOTE: this takes ANYTHING after the \ */
-#token LIT "\\~[tnrb]" << zzlextext[0] = zzlextext[1];>>
-
-/* NOTE: this takes ANYTHING that doesn't match the other tokens */
-#token REGCHAR "~[\\]"
-
-
-grammar : << p_head(); p_class_hdr(); func_action = FALSE;>>
- ( {LEXACTION | LEXMEMBER | LEXPREFIX | PARSERCLASS } ACTION)* /* MR1 */
- <<if ( gen_cpp ) p_includes();>>
- start_states
- << func_action = FALSE; p_tables(); p_tail(); >>
- (ACTION)* "@"
- << if (firstLexMember != 0) p_class_def1(); >> /* MR1 */
- ;
-
-start_states : ( PER_PER do_conversion
- | NAME_PER_PER do_conversion (NAME_PER_PER do_conversion)*)
- PER_PER
- ;
-
-do_conversion : <<new_automaton_mode(); func_action = TRUE;>>
- rule_list
- <<
- dfa_class_nop[mode_counter] =
- relabel($1.l,comp_level);
- if (comp_level)
- p_shift_table(mode_counter);
- dfa_basep[mode_counter] = dfa_allocated+1;
- make_dfa_model_node(dfa_class_nop[mode_counter]);
- nfa_to_dfa($1.l);
- ++mode_counter;
- func_action = FALSE;
-#ifdef HASH_STAT
- fprint_hash_stats(stderr);
-#endif
- >>
- ;
-
-rule_list : rule <<$$.l=$1.l; $$.r=$1.r;>>
- (rule
- <<{nfa_node *t1;
- t1 = new_nfa_node();
- (t1)->trans[0]=$$.l;
- (t1)->trans[1]=$1.l;
- /* all accept nodes "dead ends" */
- $$.l=t1; $$.r=NULL;
- }
- >>
- )*
- | /* empty */
- <<$$.l = new_nfa_node(); $$.r = NULL;
- warning("no regular expressions", zzline);
- >>
- ;
-
-rule : reg_expr ACTION
-/* MR23 */ << if ($1.r != NULL) {
- $$.l=$1.l; $$.r=$1.r; ($1.r)->accept=action_no;
- }
- >>
- | ACTION
- <<$$.l = NULL; $$.r = NULL;
- error("no expression for action ", zzline);
- >>
- ;
-
-reg_expr : and_expr <<$$.l=$1.l; $$.r=$1.r;>>
- (OR and_expr
- <<{nfa_node *t1, *t2;
- t1 = new_nfa_node(); t2 = new_nfa_node();
- (t1)->trans[0]=$$.l;
- (t1)->trans[1]=$2.l;
-/* MR23 */ if ($$.r != NULL) ($$.r)->trans[1]=t2;
- if ($2.r) {
- ($2.r)->trans[1]=t2; /* MR20 */
- }
- $$.l=t1; $$.r=t2;
- }
- >>
- )*
- ;
-
-and_expr : repeat_expr
- <<
- $$.l=$1.l; $$.r=$1.r;
- >>
- (repeat_expr
-/* MR23 */ << if ($$.r != NULL) {
- ($$.r)->trans[1]=$1.l;
- $$.r=$1.r;
- }
- >>
- )*
- ;
-
-repeat_expr : expr <<$$.l=$1.l; $$.r=$1.r;>>
- { ZERO_MORE
- <<{ nfa_node *t1,*t2;
-/* MR23 */ if ($$.r != NULL) ($$.r)->trans[0] = $$.l;
- t1 = new_nfa_node(); t2 = new_nfa_node();
- t1->trans[0]=$$.l;
- t1->trans[1]=t2;
-/* MR23 */ if ($$.r != NULL) ($$.r)->trans[1]=t2;
- $$.l=t1;$$.r=t2;
- }
- >>
- | ONE_MORE
-/* MR23 */ <<if ($$.r != NULL) ($$.r)->trans[0] = $$.l;>>
- }
- | ZERO_MORE
- << error("no expression for *", zzline);>>
- | ONE_MORE
- << error("no expression for +", zzline);>>
- ;
-
-expr : << $$.l = new_nfa_node();
- $$.r = new_nfa_node();
- >>
- L_BRACK atom_list R_BRACK
- <<
-/* MR23 */ if ($$.l != NULL) {
- ($$.l)->trans[0] = $$.r;
- ($$.l)->label = set_dup($2.label);
- set_orin(&used_chars,($$.l)->label);
- }
- >>
- | NOT L_BRACK atom_list R_BRACK
- <<
-/* MR23 */ if ($$.l != NULL) {
- ($$.l)->trans[0] = $$.r;
- ($$.l)->label = set_dif(normal_chars,$3.label);
- set_orin(&used_chars,($$.l)->label);
- }
- >>
- | L_PAR reg_expr R_PAR
- <<
-/* MR23 */ if ($$.l != NULL) {
- ($$.l)->trans[0] = $2.l;
- if ($2.r) {
- ($2.r)->trans[1] = $$.r; /* MR20 */
- }
- }
- >>
- | L_BRACE reg_expr R_BRACE
- <<
-/* MR23 */ if ($$.l != NULL) {
- ($$.l)->trans[0] = $2.l;
- ($$.l)->trans[1] = $$.r;
- if ($2.r) {
- ($2.r)->trans[1] = $$.r; /* MR20 */
- }
- }
- >>
- | atom
- <<
-/* MR23 */ if ($$.l != NULL) {
- ($$.l)->trans[0] = $$.r;
- ($$.l)->label = set_dup($1.label);
- set_orin(&used_chars,($$.l)->label);
- }
- >>
- ;
-
-atom_list : << set_free($$.label); >>
- (near_atom <<set_orin(&($$.label),$1.label);>>)*
- ;
-
-near_atom : << register int i;
- register int i_prime;
- >>
- anychar
- <<$$.letter=$1.letter; $$.label=set_of($1.letter);
- i_prime = $1.letter + MIN_CHAR;
- if (case_insensitive && islower(i_prime))
- set_orel(toupper(i_prime)-MIN_CHAR,
- &($$.label));
- if (case_insensitive && isupper(i_prime))
- set_orel(tolower(i_prime)-MIN_CHAR,
- &($$.label));
- >>
- { RANGE anychar
- << if (case_insensitive){
- i_prime = $$.letter+MIN_CHAR;
- $$.letter = (islower(i_prime) ?
- toupper(i_prime) : i_prime)-MIN_CHAR;
- i_prime = $2.letter+MIN_CHAR;
- $2.letter = (islower(i_prime) ?
- toupper(i_prime) : i_prime)-MIN_CHAR;
- }
- /* check to see if range okay */
- {
- int debugLetter1 = $$.letter;
- int debugLetter2 = $2.letter;
- }
- if ($$.letter > $2.letter
- && $2.letter != 0xff){ /* MR16 */
- error("invalid range ", zzline);
- }
- for (i=$$.letter; i<= (int)$2.letter; ++i){
- set_orel(i,&($$.label));
- i_prime = i+MIN_CHAR;
- if (case_insensitive && islower(i_prime))
- set_orel(toupper(i_prime)-MIN_CHAR,
- &($$.label));
- if (case_insensitive && isupper(i_prime))
- set_orel(tolower(i_prime)-MIN_CHAR,
- &($$.label));
- }
- >>
- }
- ;
-
-atom : << register int i_prime;>>
- anychar
- <<$$.label = set_of($1.letter);
- i_prime = $1.letter + MIN_CHAR;
- if (case_insensitive && islower(i_prime))
- set_orel(toupper(i_prime)-MIN_CHAR,
- &($$.label));
- if (case_insensitive && isupper(i_prime))
- set_orel(tolower(i_prime)-MIN_CHAR,
- &($$.label));
- >>
- ;
-
-anychar : REGCHAR <<$$.letter = $1.letter - MIN_CHAR;>>
- | OCTAL_VALUE <<$$.letter = $1.letter - MIN_CHAR;>>
- | HEX_VALUE <<$$.letter = $1.letter - MIN_CHAR;>>
- | DEC_VALUE <<$$.letter = $1.letter - MIN_CHAR;>>
- | TAB <<$$.letter = $1.letter - MIN_CHAR;>>
- | NL <<$$.letter = $1.letter - MIN_CHAR;>>
- | CR <<$$.letter = $1.letter - MIN_CHAR;>>
- | BS <<$$.letter = $1.letter - MIN_CHAR;>>
- | LIT <<$$.letter = $1.letter - MIN_CHAR;>>
- /* NOTE: LEX_EOF is ALWAYS shifted to 0 = MIN_CHAR - MIN_CHAR*/
- | L_EOF <<$$.letter = 0;>>
- ;
-
-<</* empty action */>>
-
-#lexclass ACT
-#token "@" << error("unterminated action", zzline); zzmode(START); >>
-#token ACTION "\>\>"
- << if (func_action) fprintf(OUT,"}\n\n");
- zzmode(START);
-/* MR1 */
-/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
-/* MR1 via <<%%lexmember ...>> */
-/* MR1 This is a consequence of not saving actions */
-/* MR1 */
-/* MR1 */ parserClass=0;
-/* MR1 */ lexPrefix=0;
-/* MR1 */ lexAction=0;
-/* MR1 */ lexMember=0;
- >>
-#token "\>" << xxputc(zzlextext[0]); zzskip(); >> /* MR1 */
-#token "\\\>" << xxputc('>'); zzskip(); >> /* MR1 */
-#token "\\" << xxputc('\\'); zzskip(); >> /* MR1 */
-#token "\n" << xxputc(zzlextext[0]); ++zzline; zzskip(); >> /* MR1 */
-#token "/\*" << zzmode(ACTION_COMMENTS); /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- >> /* MR1 */
-#token "//" << zzmode(ACTION_CPP_COMMENTS); /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- >> /* MR1 */
-#token "~[]" << xxputc(zzlextext[0]); zzskip(); >> /* MR1 */
- /* MR1 */
-#lexclass ACTION_COMMENTS /* MR1 */
-#token "\*/" << zzmode(ACT); /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- >> /* MR1 */
-#token "[\n\r]" << zzline++; xxputc(zzlextext[0]); zzskip();>> /* MR1 */
-#token "~[]" << xxputc(zzlextext[0]); zzskip();>> /* MR1 */
- /* MR1 */
-#lexclass ACTION_CPP_COMMENTS /* MR1 */
-#token "[\n\r]" << zzmode(ACT); zzline++; /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- >> /* MR1 */
-#token "~[]" << xxputc(zzlextext[0]); zzskip();>> /* MR1 */
-
-<<
-/* adds a new nfa to the binary tree and returns a pointer to it */
-nfa_node *
-#ifdef __USE_PROTOS
-new_nfa_node(void)
-#else
-new_nfa_node()
-#endif
-{
- register nfa_node *t;
- static int nfa_size=0; /* elements nfa_array[] can hold */
-
- ++nfa_allocated;
- if (nfa_size<=nfa_allocated){
- /* need to redo array */
- if (!nfa_array){
- /* need some to do inital allocation */
- nfa_size=nfa_allocated+NFA_MIN;
- nfa_array=(nfa_node **) malloc(sizeof(nfa_node*)*
- nfa_size);
- }else{
- /* need more space */
- nfa_size=2*(nfa_allocated+1);
- nfa_array=(nfa_node **) realloc(nfa_array,
- sizeof(nfa_node*)*nfa_size);
- }
- }
- /* fill out entry in array */
- t = (nfa_node*) malloc(sizeof(nfa_node));
- nfa_array[nfa_allocated] = t;
- *t = nfa_model_node;
- t->node_no = nfa_allocated;
- return t;
-}
-
-
-/* initialize the model node used to fill in newly made nfa_nodes */
-void
-#ifdef __USE_PROTOS
-make_nfa_model_node(void)
-#else
-make_nfa_model_node()
-#endif
-{
- nfa_model_node.node_no = -1; /* impossible value for real nfa node */
- nfa_model_node.nfa_set = 0;
- nfa_model_node.accept = 0; /* error state default*/
- nfa_model_node.trans[0] = NULL;
- nfa_model_node.trans[1] = NULL;
- nfa_model_node.label = empty;
-}
->>
-
-<<
-#if defined(DEBUG) || defined(_DEBUG)
-
-/* print out the pointer value and the node_number */
-void
-#ifdef __USE_PROTOS
-fprint_dfa_pair(FILE *f, nfa_node *p)
-#else
-fprint_dfa_pair(f, p)
-FILE *f;
-nfa_node *p;
-#endif
-{
- if (p){
- fprintf(f, "%x (%d)", p, p->node_no);
- }else{
- fprintf(f, "(nil)");
- }
-}
-
-/* print out interest information on a set */
-void
-#ifdef __USE_PROTOS
-fprint_set(FILE *f, set s)
-#else
-fprint_set(f,s)
-FILE *f;
-set s;
-#endif
-{
- unsigned int *x;
-
- fprintf(f, "n = %d,", s.n);
- if (s.setword){
- fprintf(f, "setword = %x, ", s.setword);
- /* print out all the elements in the set */
- x = set_pdq(s);
- while (*x!=nil){
- fprintf(f, "%d ", *x);
- ++x;
- }
- }else{
- fprintf(f, "setword = (nil)");
- }
-}
-
-/* code to be able to dump out the nfas
- return 0 if okay dump
- return 1 if screwed up
- */
-int
-#ifdef __USE_PROTOS
-dump_nfas(int first_node, int last_node)
-#else
-dump_nfas(first_node, last_node)
-int first_node;
-int last_node;
-#endif
-{
- register int i;
- nfa_node *t;
-
- for (i=first_node; i<=last_node; ++i){
- t = NFA(i);
- if (!t) break;
- fprintf(stderr, "nfa_node %d {\n", t->node_no);
- fprintf(stderr, "\n\tnfa_set = %d\n", t->nfa_set);
- fprintf(stderr, "\taccept\t=\t%d\n", t->accept);
- fprintf(stderr, "\ttrans\t=\t(");
- fprint_dfa_pair(stderr, t->trans[0]);
- fprintf(stderr, ",");
- fprint_dfa_pair(stderr, t->trans[1]);
- fprintf(stderr, ")\n");
- fprintf(stderr, "\tlabel\t=\t{ ");
- fprint_set(stderr, t->label);
- fprintf(stderr, "\t}\n");
- fprintf(stderr, "}\n\n");
- }
- return 0;
-}
-#endif
->>
-
-<<
-/* DLG-specific syntax error message generator
- * (define USER_ZZSYN when compiling so don't get 2 definitions)
- */
-void
-#ifdef __USE_PROTOS
-zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, char *bad_text)
-#else
-zzsyn(text, tok, egroup, eset, etok, k, bad_text)
-char *text, *egroup, *bad_text;
-int tok;
-int etok;
-int k;
-SetWordType *eset;
-#endif
-{
- fprintf(stderr, ErrHdr, file_str[0]!=NULL?file_str[0]:"stdin", zzline);
- fprintf(stderr, " syntax error at \"%s\"", (tok==zzEOF_TOKEN)?"EOF":text);
- if ( !etok && !eset ) {fprintf(stderr, "\n"); return;}
- if ( k==1 ) fprintf(stderr, " missing");
- else
- {
- fprintf(stderr, "; \"%s\" not", bad_text);
- if ( zzset_deg(eset)>1 ) fprintf(stderr, " in");
- }
- if ( zzset_deg(eset)>0 ) zzedecode(eset);
- else fprintf(stderr, " %s", zztokens[etok]);
- if ( strlen(egroup) > (size_t)0 ) fprintf(stderr, " in %s", egroup);
- fprintf(stderr, "\n");
-}
->>
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/err.c b/BaseTools/Source/C/VfrCompile/Pccts/dlg/err.c
deleted file mode 100644
index c3eaeae6d1..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/err.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * A n t l r S e t s / E r r o r F i l e H e a d e r
- *
- * Generated from: dlg_p.g
- *
- * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001
- * Parr Research Corporation
- * with Purdue University Electrical Engineering
- * With AHPCRC, University of Minnesota
- * ANTLR Version 1.33MR33
- */
-
-#define ANTLR_VERSION 13333
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-#include <ctype.h>
-#include "dlg.h"
-#define zzSET_SIZE 8
-#include "antlr.h"
-#include "tokens.h"
-#include "dlgdef.h"
-#include "err.h"
-
-ANTLRChar *zztokens[46]={
- /* 00 */ "Invalid",
- /* 01 */ "@",
- /* 02 */ "[\\r\\t\\ ]+",
- /* 03 */ "\\n",
- /* 04 */ "L_EOF",
- /* 05 */ "PER_PER",
- /* 06 */ "NAME_PER_PER",
- /* 07 */ "LEXMEMBER",
- /* 08 */ "LEXACTION",
- /* 09 */ "PARSERCLASS",
- /* 10 */ "LEXPREFIX",
- /* 11 */ "ACTION",
- /* 12 */ "GREAT_GREAT",
- /* 13 */ "L_BRACE",
- /* 14 */ "R_BRACE",
- /* 15 */ "L_PAR",
- /* 16 */ "R_PAR",
- /* 17 */ "L_BRACK",
- /* 18 */ "R_BRACK",
- /* 19 */ "ZERO_MORE",
- /* 20 */ "ONE_MORE",
- /* 21 */ "OR",
- /* 22 */ "RANGE",
- /* 23 */ "NOT",
- /* 24 */ "OCTAL_VALUE",
- /* 25 */ "HEX_VALUE",
- /* 26 */ "DEC_VALUE",
- /* 27 */ "TAB",
- /* 28 */ "NL",
- /* 29 */ "CR",
- /* 30 */ "BS",
- /* 31 */ "CONTINUATION",
- /* 32 */ "LIT",
- /* 33 */ "REGCHAR",
- /* 34 */ "\\>",
- /* 35 */ "\\\\>",
- /* 36 */ "\\",
- /* 37 */ "\\n",
- /* 38 */ "/\\*",
- /* 39 */ "//",
- /* 40 */ "~[]",
- /* 41 */ "\\*/",
- /* 42 */ "[\\n\\r]",
- /* 43 */ "~[]",
- /* 44 */ "[\\n\\r]",
- /* 45 */ "~[]"
-};
-SetWordType zzerr1[8] = {0x80,0xf,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr2[8] = {0x60,0x0,0x0,0x0, 0x0,0x0,0x0,0x0};
-SetWordType zzerr3[8] = {0x70,0xa8,0x9a,0x7f, 0x3,0x0,0x0,0x0};
-SetWordType setwd1[46] = {0x0,0x6,0x0,0x0,0x30,0xc8,0xc8,
- 0x1,0x1,0x1,0x1,0x35,0x0,0x30,0x0,
- 0x30,0x0,0x30,0x0,0x30,0x30,0x0,0x0,
- 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
- 0x0,0x30,0x30,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0};
-SetWordType zzerr4[8] = {0x10,0xa8,0x9a,0x7f, 0x3,0x0,0x0,0x0};
-SetWordType zzerr5[8] = {0x10,0xe8,0xbb,0x7f, 0x3,0x0,0x0,0x0};
-SetWordType zzerr6[8] = {0x10,0xa0,0x9a,0x7f, 0x3,0x0,0x0,0x0};
-SetWordType setwd2[46] = {0x0,0x0,0x0,0x0,0xeb,0x2,0x2,
- 0x0,0x0,0x0,0x0,0xd6,0x0,0xeb,0xd4,
- 0xeb,0xd4,0xeb,0x0,0xcb,0xcb,0xd0,0x0,
- 0xeb,0xeb,0xeb,0xeb,0xeb,0xeb,0xeb,0xeb,
- 0x0,0xeb,0xeb,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0};
-SetWordType zzerr7[8] = {0x10,0xa0,0x82,0x7f, 0x3,0x0,0x0,0x0};
-SetWordType zzerr8[8] = {0x10,0x0,0x44,0x7f, 0x3,0x0,0x0,0x0};
-SetWordType zzerr9[8] = {0x10,0x0,0x0,0x7f, 0x3,0x0,0x0,0x0};
-SetWordType setwd3[46] = {0x0,0x0,0x0,0x0,0xf7,0x0,0x0,
- 0x0,0x0,0x0,0x0,0xc2,0x0,0xc2,0xc2,
- 0xc2,0xc2,0xc2,0xb8,0xc2,0xc2,0xc2,0x80,
- 0xc2,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,
- 0x0,0xf7,0xf7,0x0,0x0,0x0,0x0,0x0,
- 0x0,0x0,0x0,0x0,0x0,0x0,0x0};
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/main.c b/BaseTools/Source/C/VfrCompile/Pccts/dlg/main.c
deleted file mode 100644
index 35bd827f8c..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/main.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/* Main function for dlg version
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * DLG 1.33
- * Will Cohen
- * With mods by Terence Parr; AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include "stdpccts.h"
-
-char program[] = "dlg";
-char version[] = "1.33MR33"; /* MRXXX */
-int numfiles = 0;
-char *file_str[2] = {NULL, NULL};
-char *mode_file = "mode.h";
-char *class_name = DEFAULT_CLASSNAME;
-char *OutputDirectory = TopDirectory;
-
-/* Option variables */
-int comp_level = 0;
-int interactive = FALSE;
-int case_insensitive = FALSE;
-int warn_ambig = FALSE;
-int gen_cpp = FALSE;
-
-#ifdef __USE_PROTOS
-static int ci_strequ(char *a,char *b)
-#else
-static int ci_strequ(a,b)
- char *a;
- char *b;
-#endif
-{
- for ( ;*a != 0 && *b != 0; a++, b++) {
- if (toupper(*a) != toupper(*b)) return 0;
- }
- return (*a == *b);
-}
-
-/* Option List Stuff */
-#ifdef __USE_PROTOS
-void p_comp0(void) {comp_level = 0;}
-void p_comp1(void) {comp_level = 1;}
-void p_comp2(void) {comp_level = 2;}
-void p_stdio(void) { file_str[numfiles++] = NULL;}
-void p_file(char *s) { file_str[numfiles++] = s;}
-void p_cl_name(char *s, char *t)
- {
- if ( gen_cpp ) {
- class_name = t;
- }
- else {
- warning("-cl only valid in C++ mode; -cl ignored...",0);
- }
- }
-void p_mode_file(char *s, char *t){mode_file=t;}
-void p_outdir(char *s,char *t) {OutputDirectory=t;}
-void p_ansi(void) {gen_ansi = TRUE;}
-void p_interactive(void) {interactive = TRUE;}
-void p_case_s(void) { case_insensitive = FALSE; }
-void p_case_i(void) { case_insensitive = TRUE; }
-void p_warn_ambig(void) { warn_ambig = TRUE; }
-void p_cpp(void) { gen_cpp = TRUE; }
-#else
-void p_comp0() {comp_level = 0;}
-void p_comp1() {comp_level = 1;}
-void p_comp2() {comp_level = 2;}
-void p_stdio() { file_str[numfiles++] = NULL;}
-void p_file(s) char *s; { file_str[numfiles++] = s;}
-void p_cl_name(s,t)
- char *s, *t;
- {
- if ( gen_cpp ) {
- class_name = t;
- }
- else {
- warning("-cl only valid in C++ mode; -cl ignored...",0);
- }
- }
-void p_mode_file(s,t) char *s,*t;{mode_file=t;}
-void p_outdir(s,t) char *s,*t;{OutputDirectory=t;}
-void p_ansi() {gen_ansi = TRUE;}
-void p_interactive() {interactive = TRUE;}
-void p_case_s() { case_insensitive = FALSE; }
-void p_case_i() { case_insensitive = TRUE; }
-void p_warn_ambig() { warn_ambig = TRUE; }
-void p_cpp() { gen_cpp = TRUE; }
-#endif
-
-#ifdef __cplusplus
-typedef void (*WildFunc)(...);
-#else
-typedef void (*WildFunc)();
-#endif
-
-typedef struct {
- char *option;
- int arg;
- WildFunc process;
- char *descr;
- } Opt;
-
-Opt options[] = {
- { "-CC", 0, (WildFunc)p_cpp, "Generate C++ output" },
- { "-C0", 0, (WildFunc)p_comp0, "No compression (default)" },
- { "-C1", 0, (WildFunc)p_comp1, "Compression level 1" },
- { "-C2", 0, (WildFunc)p_comp2, "Compression level 2" },
- { "-ga", 0, (WildFunc)p_ansi, "Generate ansi C"},
- { "-Wambiguity", 0, (WildFunc)p_warn_ambig, "Warn if expressions ambiguous"},
- { "-m", 1, (WildFunc)p_mode_file, "Rename lexical mode output file"},
- { "-i", 0, (WildFunc)p_interactive, "Build interactive scanner (not valid for C++ mode)"},
- { "-ci", 0, (WildFunc)p_case_i, "Make lexical analyzer case insensitive"},
- { "-cl", 1, (WildFunc)p_cl_name, "Rename lexer class (DLGLexer); only used for -CC"},
- { "-cs", 0, (WildFunc)p_case_s, "Make lexical analyzer case sensitive (default)"},
- { "-o", 1, (WildFunc)p_outdir, OutputDirectoryOption},
- { "-", 0, (WildFunc)p_stdio, "Use standard i/o rather than file"},
- { "*", 0, (WildFunc)p_file, ""}, /* anything else is a file */
- { NULL, 0, NULL }
- };
-
-#ifdef __USE_PROTOS
-void ProcessArgs(int argc, char **argv, Opt *options)
-#else
-void ProcessArgs(argc, argv, options)
-int argc;
-char **argv;
-Opt *options;
-#endif
-{
- Opt *p;
-
- while ( argc-- > 0 )
- {
- p = options;
- while ( p->option != NULL )
- {
- if ( strcmp(p->option, "*") == 0 ||
- ci_strequ(p->option,*argv) )
- {
- if ( p->arg )
- {
- (*p->process)( *argv, *(argv+1) );
- argv++;
- argc--;
- }
- else
- (*p->process)( *argv );
- break;
- }
- p++;
- }
- argv++;
- }
-}
-
-#ifdef __USE_PROTOS
-int main(int argc, char *argv[])
-#else
-int main(argc, argv)
-int argc;
-char *argv[];
-#endif
-{
- init();
- fprintf(stderr, "%s Version %s 1989-2001\n", &(program[0]),
- &(version[0]));
- if ( argc == 1 )
- {
- Opt *p = options;
- fprintf(stderr, "%s [options] f1 f2 ... fn\n",argv[0]);
- while ( *(p->option) != '*' )
- {
- fprintf(stderr, "\t%s %s\t%s\n",
- p->option,
- (p->arg)?"___":" ",
- p->descr);
- p++;
- }
- }else{
- ProcessArgs(argc-1, &(argv[1]), options);
- if (interactive && gen_cpp) {
- fprintf(stderr,"\n");
-/*** MR21a This statement is wrong ! ***/
-#if 0
-*** fprintf(stderr,"Interactive lexer option (\"-i\") has no effect when in C++ mode\n");
-*** fprintf(stderr,"because of extra buffering provided by ANTLRTokenBuffer class.\n");
-*** fprintf(stderr,"\n");
-#endif
- }
- input_stream = read_stream(file_str[0]);
- if (input_stream) {
- /* don't overwrite unless input okay */
- if ( gen_cpp ) {
- output_stream = write_stream(ClassName(CPP_FILE_SUFFIX));
- if ( file_str[1]!=NULL ) {
- warning("output file implicit in C++ mode; ignored...",0);
- }
- class_stream = write_stream(ClassName(".h"));
- mode_stream = class_stream;
- }
- else {
- output_stream = write_stream(file_str[1]);
- mode_stream = write_stream(mode_file);
- }
- }
- /* make sure that error reporting routines in grammar
- know what the file really is */
- /* make sure that reading and writing somewhere */
- if (input_stream && output_stream && mode_stream){
- ANTLR(grammar(), input_stream);
- }
- p_class_def2(); /* MR1 */
- }
- if ( output_stream!=NULL ) fclose(output_stream);
- if ( !gen_cpp && mode_stream!=NULL ) fclose(mode_stream);
- if ( class_stream!=NULL ) fclose(class_stream);
- exit(PCCTS_EXIT_SUCCESS);
- return 0; /* get rid of warning message MR1 */
-}
-
-/* initialize all the variables */
-void
-#ifdef __USE_PROTOS
-init(void)
-#else
-init()
-#endif
-{
- register int i;
-
-#ifdef SPECIAL_INITS
- special_inits(); /* MR1 */
-#endif
- used_chars = empty;
- used_classes = empty;
- /* make the valid character set */
- normal_chars = empty;
- /* NOTE: MIN_CHAR is EOF */
- /* NOTE: EOF is not quite a valid char, it is special. Skip it*/
- for (i = 1; i<CHAR_RANGE; ++i){
- set_orel(i,&normal_chars);
- }
- make_nfa_model_node();
- clear_hash();
- /* NOTE: need to set this flag before the lexer starts getting */
- /* tokens */
- func_action = FALSE;
-}
-
-/* stuff that needs to be reset when a new automaton is being built */
-void
-#ifdef __USE_PROTOS
-new_automaton_mode(void) /* MR1 */
-#else
-new_automaton_mode() /* MR1 */
-#endif
-{
- set_free(used_chars);
- clear_hash();
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile
deleted file mode 100644
index 406725d195..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile
+++ /dev/null
@@ -1,156 +0,0 @@
-#
-# Makefile for DLG 1.33
-# Terence Parr
-# Purdue University, U of MN, Parr Research Corporation
-# 1989-1994
-#
-# Ported to IBM C-Set/2 and Microsoft 6.0 by
-# Ed Harfmann
-# Micro Data Base Systems
-# Lafayette, Indiana
-#
-SET=../support/set
-PCCTS_H=../h
-
-##
-## Uncomment the appropriate section to build
-##
-
-#
-# OS/2 & DOS 16 bit using MSC 6.0
-#
-#CC=cl
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) /AL /Za /W3 -DPC -DUSER_ZZSYN
-#OUT_OBJ = -Fo
-#LIBS=/NOD:LLIBCE LLIBCEP
-#OBJ_EXT = obj
-#
-#dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj \
-# output.obj relabel.obj automata.obj
-# link @<<
-#$** /NOI
-#$@ /STACK:16384
-#
-#$(LIBS: = +^
-#)
-#$(DEF_FILE) $(LFLAGS) ;
-#<<
-# bind $@ c:\os2\doscalls.lib
-# copy *.exe ..\bin
-#
-
-#
-# Borland C++ for DOS
-#
-#CC=bcc
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -ml -ff- -w- -DPC -DUSER_ZZSYN
-#OUT_OBJ = -o
-#LIBS= emu mathl cl
-#OBJ_EXT = obj
-#
-#dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj \
-# output.obj relabel.obj automata.obj
-# tlink @&&|
-#C0L $**
-#$@ /Tde /c
-#
-#$(LIBS)
-#$(DEF_FILE) $(LFLAGS) ;
-#|
-# copy *.exe ..\bin
-#
-
-#
-# C-Set/2 for OS/2
-#
-#CC=icc
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) /Sa /W3 /DUSER_ZZSYN
-#OUT_OBJ = -Fo
-#LIBS=
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#OBJ_EXT=obj
-#
-#dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj \
-# output.obj relabel.obj automata.obj
-# link386 @<<
-#$** /NOI
-#$@ /STACK:32768
-#
-#$(LIBS: = +^
-#)
-#$(DEF_FILE) $(LFLAGS) ;
-#<<
-# copy *.exe ..\bin
-#
-
-#
-# Borland C++ for OS/2
-#
-#CC=bcc
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -w- -DUSER_ZZSYN
-#OUT_OBJ = -o
-#LIBS= c2 os2
-#
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#OBJ_EXT = obj
-#dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj \
-# output.obj relabel.obj automata.obj
-# tlink @&&|
-#c02 $** -c
-#dlg.exe
-#
-#C2 os2
-#
-#|
-# copy *.exe ..\bin
-#
-
-#
-# UNIX
-#
-CC=cc
-COPT=-O
-ANTLR=${BIN_DIR}/antlr
-DLG=${BIN_DIR}/dlg
-CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DZZLEXBUFSIZE=65536
-OBJ_EXT=o
-OUT_OBJ = -o
-OBJ = dlg_p.o dlg_a.o main.o err.o set.o support.o output.o \
- relabel.o automata.o
-
-$(BIN_DIR)/dlg : $(OBJ) $(SRC)
- $(CC) $(CFLAGS) -o $(BIN_DIR)/dlg $(OBJ)
-
-SRC = dlg_p.c dlg_a.c main.c err.c $(SET)/set.c support.c output.c \
- relabel.c automata.c
-
-#dlg_p.c parser.dlg err.c tokens.h : dlg_p.g
-# $(ANTLR) dlg_p.g
-
-#dlg_a.c mode.h : parser.dlg
-# $(DLG) -C2 parser.dlg dlg_a.c
-
-dlg_p.$(OBJ_EXT) : dlg_p.c dlg.h tokens.h mode.h
- $(CC) $(CFLAGS) -c dlg_p.c
-
-dlg_a.$(OBJ_EXT) : dlg_a.c dlg.h tokens.h mode.h
- $(CC) $(CFLAGS) -c dlg_a.c
-
-main.$(OBJ_EXT) : main.c dlg.h
- $(CC) $(CFLAGS) -c main.c
-
-set.$(OBJ_EXT) : $(SET)/set.c
- $(CC) -c $(CFLAGS) $(SET)/set.c
-
-lint:
- lint *.c
-
-#clean up all the intermediate files
-clean:
- rm -f $(BIN_DIR)/dlg *.$(OBJ_EXT) core
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile.cygwin b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile.cygwin
deleted file mode 100644
index bbba820d13..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile.cygwin
+++ /dev/null
@@ -1,157 +0,0 @@
-#
-# Makefile for DLG 1.33
-# Terence Parr
-# Purdue University, U of MN, Parr Research Corporation
-# 1989-1994
-#
-# Ported to IBM C-Set/2 and Microsoft 6.0 by
-# Ed Harfmann
-# Micro Data Base Systems
-# Lafayette, Indiana
-#
-SET=../support/set
-PCCTS_H=../h
-
-##
-## Uncomment the appropriate section to build
-##
-
-#
-# OS/2 & DOS 16 bit using MSC 6.0
-#
-#CC=cl
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) /AL /Za /W3 -DPC -DUSER_ZZSYN
-#OUT_OBJ = -Fo
-#LIBS=/NOD:LLIBCE LLIBCEP
-#OBJ_EXT = obj
-#
-#dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj \
-# output.obj relabel.obj automata.obj
-# link @<<
-#$** /NOI
-#$@ /STACK:16384
-#
-#$(LIBS: = +^
-#)
-#$(DEF_FILE) $(LFLAGS) ;
-#<<
-# bind $@ c:\os2\doscalls.lib
-# copy *.exe ..\bin
-#
-
-#
-# Borland C++ for DOS
-#
-#CC=bcc
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -ml -ff- -w- -DPC -DUSER_ZZSYN
-#OUT_OBJ = -o
-#LIBS= emu mathl cl
-#OBJ_EXT = obj
-#
-#dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj \
-# output.obj relabel.obj automata.obj
-# tlink @&&|
-#C0L $**
-#$@ /Tde /c
-#
-#$(LIBS)
-#$(DEF_FILE) $(LFLAGS) ;
-#|
-# copy *.exe ..\bin
-#
-
-#
-# C-Set/2 for OS/2
-#
-#CC=icc
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) /Sa /W3 /DUSER_ZZSYN
-#OUT_OBJ = -Fo
-#LIBS=
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#OBJ_EXT=obj
-#
-#dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj \
-# output.obj relabel.obj automata.obj
-# link386 @<<
-#$** /NOI
-#$@ /STACK:32768
-#
-#$(LIBS: = +^
-#)
-#$(DEF_FILE) $(LFLAGS) ;
-#<<
-# copy *.exe ..\bin
-#
-
-#
-# Borland C++ for OS/2
-#
-#CC=bcc
-#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -w- -DUSER_ZZSYN
-#OUT_OBJ = -o
-#LIBS= c2 os2
-#
-#ANTLR=..\bin\antlr
-#DLG=..\bin\dlg
-#OBJ_EXT = obj
-#dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj \
-# output.obj relabel.obj automata.obj
-# tlink @&&|
-#c02 $** -c
-#dlg.exe
-#
-#C2 os2
-#
-#|
-# copy *.exe ..\bin
-#
-
-#
-# UNIX
-#
-BIN_DIR=../../../../bin
-CC=cc
-COPT=-O
-ANTLR=$(BIN_DIR)/antlr.exe
-DLG=${BIN_DIR}/dlg.exe
-CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DZZLEXBUFSIZE=65536
-OBJ_EXT=o
-OUT_OBJ = -o
-OBJ = dlg_p.o dlg_a.o main.o err.o set.o support.o output.o \
- relabel.o automata.o
-
-dlg : $(OBJ) $(SRC)
- $(CC) $(CFLAGS) -o $(BIN_DIR)/dlg.exe $(OBJ)
-
-SRC = dlg_p.c dlg_a.c main.c err.c $(SET)/set.c support.c output.c \
- relabel.c automata.c
-
-#dlg_p.c parser.dlg err.c tokens.h : dlg_p.g
-# $(ANTLR) dlg_p.g
-
-#dlg_a.c mode.h : parser.dlg
-# $(DLG) -C2 parser.dlg dlg_a.c
-
-dlg_p.$(OBJ_EXT) : dlg_p.c dlg.h tokens.h mode.h
- $(CC) $(CFLAGS) -c dlg_p.c
-
-dlg_a.$(OBJ_EXT) : dlg_a.c dlg.h tokens.h mode.h
- $(CC) $(CFLAGS) -c dlg_a.c
-
-main.$(OBJ_EXT) : main.c dlg.h
- $(CC) $(CFLAGS) -c main.c
-
-set.$(OBJ_EXT) : $(SET)/set.c
- $(CC) -c $(CFLAGS) $(SET)/set.c
-
-lint:
- lint *.c
-
-#clean up all the intermediate files
-clean:
- rm -f *.$(OBJ_EXT) core
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile1 b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile1
deleted file mode 100644
index 4d00f7966e..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile1
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Makefile for DLG 1.33
-# Terence Parr
-# Purdue University, U of MN, Parr Research Corporation
-# 1989-1994
-#
-# Ported to IBM C-Set/2 and Microsoft 6.0 by
-# Ed Harfmann
-# Micro Data Base Systems
-# Lafayette, Indiana
-#
-SET=../support/set
-PCCTS_H=../h
-
-##
-## Uncomment the appropriate section to build
-##
-
-
-#
-# UNIX
-#
-CC=cc
-ANTLR=../bin/antlr
-DLG=../bin/dlg
-ANSI=-ansi
-CFLAGS= -O -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) $(ANSI) -DZZLEXBUFSIZE=32000
-OBJ_EXT=o
-OUT_OBJ = -o
-OBJ = dlg_p.o dlg_a.o main.o err.o set.o support.o output.o \
- relabel.o automata.o
-
-dlg : $(OBJ) $(SRC)
- $(CC) $(CFLAGS) -o dlg $(OBJ)
- mv dlg ../bin
-
-SRC = dlg_p.c dlg_a.c main.c err.c $(SET)/set.c support.c output.c \
- relabel.c automata.c
-
-dlg_p.c parser.dlg err.c tokens.h : dlg_p.g
- $(ANTLR) dlg_p.g
-
-dlg_a.c mode.h : parser.dlg
- $(DLG) -C2 parser.dlg dlg_a.c
-
-dlg_p.$(OBJ_EXT) : dlg_p.c dlg.h tokens.h mode.h
- $(CC) $(CFLAGS) -c dlg_p.c
-
-dlg_a.$(OBJ_EXT) : dlg_a.c dlg.h tokens.h mode.h
- $(CC) $(CFLAGS) -c dlg_a.c
-
-main.$(OBJ_EXT) : main.c dlg.h
- $(CC) $(CFLAGS) -c main.c
-
-set.$(OBJ_EXT) : $(SET)/set.c
- $(CC) -c $(CFLAGS) $(SET)/set.c
-
-lint:
- lint *.c
-
-#clean up all the intermediate files
-clean:
- rm -f *.$(OBJ_EXT) core
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/mode.h b/BaseTools/Source/C/VfrCompile/Pccts/dlg/mode.h
deleted file mode 100644
index 3f3279e52a..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/mode.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#define START 0
-#define ACT 1
-#define ACTION_COMMENTS 2
-#define ACTION_CPP_COMMENTS 3
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/output.c b/BaseTools/Source/C/VfrCompile/Pccts/dlg/output.c
deleted file mode 100644
index 2e56a6d8c1..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/output.c
+++ /dev/null
@@ -1,850 +0,0 @@
-/* output.c, output generator for dlg
- *
- * Output Notes:
- *
- * DfaStates == number of dfa nodes in automaton (just a #define)
- * DfaState == type large enough to index every node in automaton
- * <256 unsigned char, <65536 unsigned short, etc.
- *
- * Thus, the elements in each of the automaton states (st%d) are type DfaState
- * and are size appropriately, since they must be able to index the next
- * automaton state.
- *
- * dfa[] == a linear array that points to all the automaton states (st%d)
- * (dfa_base[] should be the same, but isn't right now)
- *
- * accepts[] == Taking a closer look at this one, it probably shouldn't be type
- * DfaState because there is no real requirement that the number of
- * accepts states is less than the number of dfa state. However, if
- * the number of accept states was more than the number of DFA states
- * then the lexical specification would be really ambiguous.
- *
- * Another note. Is that is should be possible to fold accepts[] and
- * actions[] together. If this is done, I would suggest get rid of
- * accept[] and make actions[] have an entry for each state (st%d) in
- * the automaton.
- *
- * dfa_base[] == starting location for each lexical mode. This should be
- * Dfastate type (but isn't right now), since it points to the states
- * in the automaton.
- *
- * dfa_class_no[] == indicates the number of columns each lexical mode has.
- *
- * b_class_no[] == pointer to the start of the translation array used to
- * convert from input character to character class. This could cause
- * problems if there are more than 256 classes
- *
- * shift%d[] == the actual translation arrays that convert the input character
- * into the character class. These will have to change if there are
- * more than 256 character classes.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * DLG 1.33
- * Will Cohen
- * With mods by Terence Parr; AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "dlg.h"
-#ifdef MEMCHK
-#include "trax.h"
-#else
-#ifdef __STDC__
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif /* __STDC__ */
-#endif
-
-static char *mode_name[MAX_MODES];
-static int mode_number[MAX_MODES];
-static int cur_mode=0;
-
-int operation_no = 0; /* used to mark nodes so that infinite loops avoided */
-int dfa_basep[MAX_MODES]; /* start of each group of states */
-int dfa_class_nop[MAX_MODES]; /* number of elements in each group of states*/
-
-int gen_ansi = FALSE; /* allows ansi code to be generated */
-
-FILE *input_stream; /* where to read description from */
-FILE *output_stream; /* where to put the output */
-FILE *mode_stream; /* where to put the mode.h stuff */
-FILE *class_stream; /* where to put the scan.h stuff (if gen_cpp) */
-
-/* NOTE: This section is MACHINE DEPENDENT */
-#define DIF_SIZE 4
-#if defined(PC) && !defined(PC32)
-unsigned long typesize[DIF_SIZE] = { 0x7f, 0x7fff, 0x7ffful, 0x7ffffffful }; /* MR20 */
-char t0[] = "unsigned char";
-char t1[] = "unsigned short";
-char t2[] = "unsigned int";
-char t3[] = "unsigned long";
-char *typevar[DIF_SIZE] = { t0, t1, t2, t3};
-#else
-unsigned long typesize[DIF_SIZE] = { 0x7f, 0x7fff, 0x7ffffffful, 0x7ffffffful }; /* MR20 */
-char t0[] = "unsigned char";
-char t1[] = "unsigned short";
-char t2[] = "unsigned int";
-char t3[] = "unsigned long";
-char *typevar[DIF_SIZE] = { t0, t1, t2, t3};
-#endif
-
-/* Added by TJP August 1994 */
-/* Take in MyLexer and return MyLexer_h */
-
-static char *
-#ifdef __USE_PROTOS
-gate_symbol(char *name)
-#else
-gate_symbol(name)
-char *name;
-#endif
-{
- static char buf[100];
- sprintf(buf, "%s_h", name);
- return buf;
-}
-
-/* Added by TJP August 1994 */
-static char *
-#ifdef __USE_PROTOS
-mystrdup(char *s)
-#else
-mystrdup(s)
-char *s;
-#endif
-{
- char *p = (char *)malloc(strlen(s)+1);
- strcpy(p, s);
- return p;
-}
-
-#ifdef __USE_PROTOS
-void p_class_hdr(void)
-#else
-void p_class_hdr()
-#endif
-{
- if ( class_stream == NULL ) return;
- fprintf(class_stream, "#ifndef %s\n", gate_symbol(ClassName("")));
- fprintf(class_stream, "#define %s\n", gate_symbol(ClassName("")));
- fprintf(class_stream, "/*\n");
- fprintf(class_stream, " * D L G L e x e r C l a s s D e f i n i t i o n\n");
- fprintf(class_stream, " *\n");
- fprintf(class_stream, " * Generated from:");
- fprintf(class_stream, " %s", file_str[0]);
- fprintf(class_stream, "\n");
- fprintf(class_stream, " *\n");
- fprintf(class_stream, " * 1989-2001 by Will Cohen, Terence Parr, and Hank Dietz\n");
- fprintf(class_stream, " * Purdue University Electrical Engineering\n");
- fprintf(class_stream, " * DLG Version %s\n", version);
- fprintf(class_stream, " */\n\n");
- fprintf(class_stream, "\n");
- fprintf(class_stream, "#include \"%s\"\n", DLEXERBASE_H);
-}
-
-/* MR1 */
-/* MR1 16-Apr-97 Split printing of class header up into several parts */
-/* MR1 so that #lexprefix <<...>>and #lexmember <<...>> */
-/* MR1 can be inserted in the appropriate spots */
-/* MR1 */
-
-#ifdef __USE_PROTOS
-void p_class_def1(void)
-#else
-void p_class_def1()
-#endif
-{
- if ( class_stream == NULL ) return;
- fprintf(class_stream, "\nclass %s : public DLGLexerBase {\n", ClassName(""));
- fprintf(class_stream, "public:\n");
-}
-
-#ifdef __USE_PROTOS
-void p_class_def2(void)
-#else
-void p_class_def2()
-#endif
-{
- int i, m;
- if ( class_stream == NULL ) return;
- fprintf(class_stream, "public:\n");
- fprintf(class_stream, "\tstatic const int MAX_MODE;\n");
- fprintf(class_stream, "\tstatic const int DfaStates;\n");
- for (i=0; i<cur_mode; i++) {
- fprintf(class_stream, "\tstatic const int %s;\n", mode_name[i]);
- }
-
- fprintf(class_stream, "\ttypedef %s DfaState;\n\n", minsize(dfa_allocated));
- fprintf(class_stream, "\t%s(DLGInputStream *in,\n",ClassName(""));
- fprintf(class_stream, "\t\tunsigned bufsize=2000)\n");
- fprintf(class_stream, "\t\t: DLGLexerBase(in, bufsize, %d)\n", interactive);
- fprintf(class_stream, "\t{\n");
- fprintf(class_stream, "\t;\n");
- fprintf(class_stream, "\t}\n");
- fprintf(class_stream, "\tvoid mode(int);\n");
- fprintf(class_stream, "\tANTLRTokenType nextTokenType(void);\n");
- fprintf(class_stream, "\tvoid advance(void);\n");
- fprintf(class_stream, "protected:\n");
- for (i=1; i<=action_no; ++i) {
- fprintf(class_stream, "\tANTLRTokenType act%d();\n", i);
- }
-
- for(m=0; m<(mode_counter-1); ++m){
- for(i=dfa_basep[m]; i<dfa_basep[m+1]; ++i)
- fprintf(class_stream, "\tstatic DfaState st%d[%d];\n", i-1, dfa_class_nop[m]+1);
- }
- for(i=dfa_basep[m]; i<=dfa_allocated; ++i)
- fprintf(class_stream, "\tstatic DfaState st%d[%d];\n", i-1, dfa_class_nop[m]+1);
-
- fprintf(class_stream, "\tstatic DfaState *dfa[%d];\n", dfa_allocated);
- fprintf(class_stream, "\tstatic DfaState dfa_base[];\n");
-/* fprintf(class_stream, "\tstatic int dfa_base_no[];\n"); */
- fprintf(class_stream, "\tstatic unsigned char *b_class_no[];\n");
- fprintf(class_stream, "\tstatic DfaState accepts[%d];\n",dfa_allocated+1);
- fprintf(class_stream, "\tstatic DLGChar alternatives[%d];\n",dfa_allocated+1);
- /* WARNING: should be ANTLRTokenType for action table, but g++ 2.5.6 is hosed */
- fprintf(class_stream, "\tstatic ANTLRTokenType (%s::*actions[%d])();\n", ClassName(""), action_no+1);
- for(m=0; m<mode_counter; ++m) {
- fprintf(class_stream, "\tstatic unsigned char shift%d[%d];\n",
- m, CHAR_RANGE);
- }
- if (comp_level)
- fprintf(class_stream, "\tint ZZSHIFT(int c) { return b_class_no[automaton][1+c]; }\n");
- else
- fprintf(class_stream, "\tint ZZSHIFT(int c) { return 1+c; }\n");
-
-/* MR1 */
-/* MR1 11-APr-97 Kludge to allow inclusion of user-defined code in */
-/* MR1 DLGLexer class header */
-/* MR1 Deprecated in favor of 133MR1 addition #lexmember <<>> */
-/* MR1 */
-/* MR1 */ fprintf(class_stream,"//\n");
-/* MR1 */ fprintf(class_stream,
-/* MR1 */ "// 133MR1 Deprecated feature to allow inclusion of ");
-/* MR1 */ fprintf(class_stream,
-/* MR1 */ "user-defined code in DLG class header\n");
-/* MR1 */ fprintf(class_stream,"//\n");
-/* MR1 */
-/* MR1 */ fprintf(class_stream,"#ifdef DLGLexerIncludeFile\n");
-/* MR1 */ fprintf(class_stream,"#include DLGLexerIncludeFile\n");
-/* MR1 */ fprintf(class_stream,"#endif\n");
-
- fprintf(class_stream, "};\n");
-
- fprintf(class_stream, "typedef ANTLRTokenType (%s::*Ptr%sMemberFunc)();\n",
- ClassName(""), ClassName(""));
-
- fprintf(class_stream, "#endif\n");
-}
-
-/* generate required header on output */
-
-#ifdef __USE_PROTOS
-void p_head(void)
-#else
-void p_head()
-#endif
-{
- fprintf(OUT, "/*\n");
- fprintf(OUT, " * D L G tables\n");
- fprintf(OUT, " *\n");
- fprintf(OUT, " * Generated from:");
- fprintf(OUT, " %s", file_str[0]);
- fprintf(OUT, "\n");
- fprintf(OUT, " *\n");
- fprintf(OUT, " * 1989-2001 by Will Cohen, Terence Parr, and Hank Dietz\n");
- fprintf(OUT, " * Purdue University Electrical Engineering\n");
- fprintf(OUT, " * DLG Version %s\n", version);
- fprintf(OUT, " */\n\n");
- if ( gen_cpp) fprintf(OUT, "#include \"pcctscfg.h\"\n");
- if ( gen_cpp ) fprintf(OUT, "#include \"pccts_stdio.h\"\n");
- if ( !gen_cpp ) fprintf(OUT, "#include \"%s\"\n\n", mode_file);
- fprintf(OUT,"\n");
-}
-
-#ifdef __USE_PROTOS
-void p_includes(void)
-#else
-void p_includes()
-#endif
-{
- fprintf(OUT, "#include \"%s\"\n", APARSER_H);
- fprintf(OUT, "#include \"%s\"\n", DLEXERBASE_H);
- fprintf(OUT, "#include \"%s\"\n", ClassName(".h"));
-}
-
-/* generate code to tie up any loose ends */
-
-#ifdef __USE_PROTOS
-void p_tail(void) /* MR1 */
-#else
-void p_tail() /* MR1 */
-#endif
-{
- if ( gen_cpp ) {
- if ( strcmp(ClassName(""), DEFAULT_CLASSNAME)!=0 )
- fprintf(OUT, "#define DLGLexer %s\n", ClassName(""));
- fprintf(OUT, "#include \"%s\"\n", DLEXER_H); /* MR23 Rename DLexer.cpp to DLexer.h */
- return;
- }
- fprintf(OUT, "\n");
- fprintf(OUT, "\n");
- if (comp_level)
- fprintf(OUT, "#define ZZSHIFT(c) (b_class_no[zzauto][1+c])\n");
- else
- fprintf(OUT, "#define ZZSHIFT(c) (1+c)\n");
- if ( !gen_cpp ) fprintf(OUT, "#define MAX_MODE %d\n",mode_counter);
- fprintf(OUT, "#include \"dlgauto.h\"\n");
-}
-
-
-/* output the table of DFA for general use */
-
-#ifdef __USE_PROTOS
-void p_tables()
-#else
-void p_tables()
-#endif
-{
- if ( !gen_cpp ) {
- fprintf(OUT, "#define DfaStates\t%d\n", dfa_allocated);
- fprintf(OUT, "typedef %s DfaState;\n\n", minsize(dfa_allocated));
- }
-
- if ( gen_cpp ) {
- int i;
- fprintf(OUT, "\n");
- fprintf(OUT, "const int %s::MAX_MODE=%d;\n",
- ClassName(""),
- mode_counter);
- fprintf(OUT, "const int %s::DfaStates=%d;\n",
- ClassName(""),
- dfa_allocated);
- for (i=0; i<cur_mode; i++) {
- fprintf(OUT, "const int %s::%s=%d;\n",
- ClassName(""), mode_name[i], mode_number[i]);
- }
- fprintf(OUT, "\n");
- }
-
- p_node_table();
- p_dfa_table();
- p_accept_table();
- p_action_table();
- p_base_table();
- p_class_table();
- if (comp_level)
- p_bshift_table();
- if (interactive || gen_cpp )
- p_alternative_table();
-}
-
-
-/* figures out the smallest variable type that will hold the transitions
- */
-
-#ifdef __USE_PROTOS
-char *minsize(int elements)
-#else
-char *minsize(elements)
-int elements;
-#endif
-{
- int i = 0;
-
- while ((unsigned long) elements > typesize[i]) /* MR20 */
- ++i;
- return typevar[i];
-}
-
-
-#ifdef __USE_PROTOS
-void p_node_table(void)
-#else
-void p_node_table()
-#endif
-{
- register int i;
- register int m = 0;
-
- for(m=0; m<(mode_counter-1); ++m){
- for(i=dfa_basep[m]; i<dfa_basep[m+1]; ++i)
- p_single_node(i,dfa_class_nop[m]);
- }
- for(i=dfa_basep[m]; i<=dfa_allocated; ++i)
- p_single_node(i,dfa_class_nop[m]);
-}
-
-
-#ifdef __USE_PROTOS
-void p_single_node(int i,int classes)
-#else
-void p_single_node(i,classes)
-int i,classes;
-#endif
-{
- register int j;
- register int trans, items_on_line;
-
-#if 1
- /* extra state (classes+1) for invalid characters */
- fprintf(OUT, "%sDfaState %sst%d[%d] = {\n ",
- gen_cpp?ClassName("::"):"static ",
- gen_cpp?ClassName("::"):"",(i-1), (classes+1));
-#else
- fprintf(OUT, "static DfaState st%d[%d] = {\n ", (i-1), classes);
-#endif
- items_on_line = MAX_ON_LINE;
- for(j=0; j<classes; ++j){
- DAWDLE;
- trans = DFA(i)->trans[j];
- if (trans == NIL_INDEX)
- trans = dfa_allocated+1;
- /* all of DFA moved down one in array */
- fprintf(OUT, "%d", trans-1);
- fprintf(OUT, ", ");
- if (!(--items_on_line)){
- fprintf(OUT, "\n ");
- items_on_line = MAX_ON_LINE;
- }
- }
-#if 1
- /* put in jump to error state */
- fprintf(OUT, "%d\n};\n\n", dfa_allocated);
-#else
- fprintf(OUT, "\n};\n\n");
-#endif
-}
-
-
-#ifdef __USE_PROTOS
-void p_dfa_table(void)
-#else
-void p_dfa_table()
-#endif
-{
- register int i;
-
- fprintf(OUT, "\n%sDfaState *%sdfa[%d] = {\n",
- gen_cpp?ClassName("::"):"",gen_cpp?ClassName("::"):"", dfa_allocated);
- for (i=0; i<(dfa_allocated-1); ++i){
- fprintf(OUT, "\tst%d,\n", i);
- }
- fprintf(OUT, "\tst%d\n", i);
- fprintf(OUT, "};\n\n");
-}
-
-
-#ifdef __USE_PROTOS
-void p_accept_table(void)
-#else
-void p_accept_table()
-#endif
-{
- register int i = 1;
- register int items_on_line = 0;
- int true_interactive = TRUE;
-
- /* make sure element for one past (zzerraction) -WEC 12/16/92 */
- fprintf(OUT,"\n%sDfaState %saccepts[%d] = {\n ",
- gen_cpp?ClassName("::"):"",
- gen_cpp?ClassName("::"):"",
- dfa_allocated+1);
- /* don't do anything if no dfa nodes */
- if (i>dfa_allocated) goto skip_accepts;
- for (;;) {
- int accept=0; /* MR14a - Manuel Kessler (mlkessle@cip.physik.uni-wuerzburg.de) */
- set accept_set;
- set nfa_states;
- unsigned int *t, *nfa_i;
- unsigned int *q, *regular_expr;
-
- accept_set = empty;
- nfa_states = DFA(i)->nfa_states;
- t = nfa_i = set_pdq(nfa_states);
- /* NOTE: picks lowest accept because accepts monotonic */
- /* with respect to nfa node numbers and set_pdq */
- /* returns in that order */
- while((*nfa_i != nil) && (!(accept = NFA(*nfa_i)->accept))){
- nfa_i++;
- }
-
- /* figure out if more than one accept state there */
- if (warn_ambig ){
- set_orel(accept, &accept_set);
- while(*nfa_i != nil){
- set_orel(NFA(*nfa_i)->accept, &accept_set);
- nfa_i++;
- }
- /* remove error action from consideration */
- set_rm(0, accept_set);
-
- if( set_deg(accept_set)>1){
- fprintf(stderr, "dlg warning: ambiguous regular expression ");
- q = regular_expr = set_pdq(accept_set);
- while(*regular_expr != nil){
- fprintf(stderr," %d ", *regular_expr);
- ++regular_expr;
- }
- fprintf(stderr, "\n");
- free(q);
- }
- }
-
- if ((DFA(i)->alternatives) && (accept != 0)){
- true_interactive = FALSE;
- }
- fprintf(OUT, "%d, ", accept);
-
- /* free up memory before we "break" below -ATG 4/6/95 */
- free(t);
- set_free(accept_set);
-
- if ((++i)>dfa_allocated)
- break;
- if ((++items_on_line)>=MAX_ON_LINE){
- fprintf(OUT,"\n ");
- items_on_line = 0;
- }
-/*
- free(t);
- set_free(accept_set);
-*/
- }
- /* make sure element for one past (zzerraction) -WEC 12/16/92 */
-skip_accepts:
- fprintf(OUT, "0\n};\n\n");
-}
-
-
-#ifdef __USE_PROTOS
-void p_action_table(void)
-#else
-void p_action_table()
-#endif
-{
- register int i;
- char* theClassName = ClassName("");
-
- if ( gen_cpp )
- fprintf(OUT, "Ptr%sMemberFunc %s::actions[%d] = {\n", theClassName,
- theClassName, action_no+1);
- else
- fprintf(OUT, "void (*actions[%d])() = {\n", action_no+1);
- if ( gen_cpp )
-/* fprintf(OUT, "\t(Ptr%sMemberFunc)&%s::erraction,\n", theClassName, theClassName);*/
- fprintf(OUT, "\t&%s::erraction,\n", theClassName);
- else
- fprintf(OUT, "\tzzerraction,\n");
- for (i=1; i<action_no; ++i) {
- if ( gen_cpp )
-/* fprintf(OUT,"\t(Ptr%sMemberFunc)&%s::act%d,\n", theClassName, theClassName, i);*/
- fprintf(OUT,"\t&%s::act%d,\n", theClassName, i);
- else
- fprintf(OUT,"\tact%d,\n", i);
- DAWDLE;
- }
- if ( gen_cpp )
-/* fprintf(OUT,"\t(Ptr%sMemberFunc)&%s::act%d\n", theClassName, theClassName, i);*/
- fprintf(OUT,"\t&%s::act%d\n", theClassName, i);
- else
- fprintf(OUT,"\tact%d\n", i);
- fprintf(OUT, "};\n\n");
-}
-
-
-#ifdef __USE_PROTOS
-void p_shift_table(int m) /* MR1 */
-#else
-void p_shift_table(m) /* MR1 */
-int m;
-#endif
-{
- register int i = 0, j;
- register int items_on_line = 0;
-
- fprintf(OUT, "%s unsigned char %sshift%d[%d] = {\n ",
- gen_cpp?"":"static",
- gen_cpp?ClassName("::"):"", m, CHAR_RANGE);
- for (;;) {
- /* find which partition character i is in */
- for (j=0; j<dfa_class_nop[mode_counter]; ++j){
- if (set_el(i,class_sets[j]))
- break;
- }
- fprintf(OUT,"%d",j);
- if ((++i)>=CHAR_RANGE)
- break;
- fprintf(OUT,", ");
- if ((++items_on_line)>=MAX_ON_LINE){
- fprintf(OUT,"\n ");
- items_on_line = 0;
- }
- }
- fprintf(OUT, "\n};\n\n");
-}
-
-
-#ifdef __USE_PROTOS
-void p_base_table(void)
-#else
-void p_base_table()
-#endif
-{
- register int m;
-
- fprintf(OUT, "%sDfaState %sdfa_base[] = {\n",
- gen_cpp?ClassName("::"):"static ",
- gen_cpp?ClassName("::"):"");
- for(m=0; m<(mode_counter-1); ++m)
- fprintf(OUT, "\t%d,\n", dfa_basep[m]-1);
- fprintf(OUT, "\t%d\n};\n\n", dfa_basep[m]-1);
-}
-
-
-#ifdef __USE_PROTOS
-void p_class_table(void) /* MR1 */
-#else
-void p_class_table() /* MR1 */
-#endif
-{
-#if 0
- register int m;
-
- fprintf(OUT,"%s int %sdfa_class_no[] = {\n",
- gen_cpp?"":"static",
- gen_cpp?ClassName("::"):"");
- for(m=0; m<(mode_counter-1); ++m)
- fprintf(OUT,"\t%d,\n", dfa_class_nop[m]);
- fprintf(OUT,"\t%d\n};\n\n", dfa_class_nop[m]);
-#endif
-}
-
-
-#ifdef __USE_PROTOS
-void p_bshift_table(void) /* MR1 */
-#else
-void p_bshift_table() /* MR1 */
-#endif
-{
- register int m;
-
- fprintf(OUT,"%s unsigned char *%sb_class_no[] = {\n",
- gen_cpp?"":"static",
- gen_cpp?ClassName("::"):"");
- for(m=0; m<(mode_counter-1); ++m)
- fprintf(OUT, "\tshift%d,\n", m);
- fprintf(OUT, "\tshift%d\n};\n\n", m);
-}
-
-
-#ifdef __USE_PROTOS
-void p_alternative_table(void) /* MR1 */
-#else
-void p_alternative_table() /* MR1 */
-#endif
-{
- register int i;
-
- if ( !gen_cpp ) fprintf(OUT, "#define ZZINTERACTIVE\n\n");
- if ( gen_cpp )
- fprintf(OUT, "DLGChar %salternatives[%d] = {\n", /* mr23 vhs %sDfaStates+1 */
- ClassName("::"),
- dfa_allocated+1); /* vhs ClassName("::")); */
- else
- fprintf(OUT, "static %s zzalternatives[DfaStates+1] = {\n",
- minsize(dfa_allocated));
-
- for(i=1; i<=dfa_allocated; ++i)
- fprintf(OUT, "\t%d,\n", DFA(i)->alternatives);
- fprintf(OUT, "/* must have 0 for zzalternatives[DfaStates] */\n");
- fprintf(OUT, "\t0\n};\n\n");
-}
-
-
-#ifdef __USE_PROTOS
-void p_mode_def(char *s,int m) /* MR1 */
-#else
-void p_mode_def(s,m) /* MR1 */
-char *s;
-int m;
-#endif
-{
- if ( gen_cpp )
- {
- mode_name[cur_mode] = mystrdup(s);
- mode_number[cur_mode] = m;
- cur_mode++;
- }
- else
- fprintf(mode_stream, "#define %s %d\n", s, m);
-}
-
-#ifdef __USE_PROTOS
-char * ClassName(char *suffix)
-#else
-char * ClassName(suffix)
-char *suffix;
-#endif
-{
- static char buf[200];
- extern char *class_name;
-
- sprintf(buf, "%s%s", class_name, suffix);
- return buf;
-}
-
-#ifdef DEBUG
-
-/* print out a particular nfa node that is pointed to by p */
-
-#ifdef __USE_PROTOS
-void p_nfa_node(nfa_node *p)
-#else
-void p_nfa_node(p)
-nfa_node *p;
-#endif
-{
- register nfa_node *t;
-
- if (p != NIL_INDEX){
- printf("NFA state : %d\naccept state : %d\n",
- NFA_NO(p),p->accept);
- if (p->trans[0] != NIL_INDEX){
- printf("trans[0] => %d on ", NFA_NO(p->trans[0]));
- p_set(p->label);
- printf("\n");
- }
- else
- printf("trans[0] => nil\n");
- if (p->trans[1] != NIL_INDEX)
- printf("trans[1] => %d on epsilon\n",
- NFA_NO(p->trans[1]));
- else
- printf("trans[1] => nil\n");
- printf("\n");
- }
-}
-#endif
-
-#ifdef DEBUG
-
-/* code to print out special structures when using a debugger */
-
-#ifdef __USE_PROTOS
-void p_nfa(p)
-#else
-void p_nfa(nfa_node *p)
-nfa_node *p; /* state number also index into array */
-#endif
-{
-/* each node has a marker on it so it only gets printed once */
-
- operation_no++; /* get new number */
- s_p_nfa(p);
-}
-
-#ifdef __USE_PROTOS
-void s_p_nfa(nfa_node *p)
-#else
-void s_p_nfa(p)
-nfa_node *p; /* state number also index into array */
-#endif
-{
- if ((p != NIL_INDEX) && (p->nfa_set != operation_no)){
- /* so it is only printed once */
- p->nfa_set = operation_no;
- p_nfa_node(p);
- s_p_nfa(p->trans[0]);
- s_p_nfa(p->trans[1]);
- }
-}
-
-#ifdef __USE_PROTOS
-void p_dfa_node(dfa_node *p)
-#else
-void p_dfa_node(p)
-dfa_node *p;
-#endif
-{
- int i;
-
- if (p != NIL_INDEX){
- printf("DFA state :%d\n",NFA_NO(p));
- if (p->done)
- printf("done\n");
- else
- printf("undone\n");
- printf("from nfa states : ");
- p_set(p->nfa_states);
- printf("\n");
- /* NOTE: trans arcs stored as ints rather than pointer*/
- for (i=0; i<class_no; i++){
- printf("%d ",p->trans[i]);
- }
- printf("\n\n");
- }
-}
-
-#ifdef __USE_PROTOS
-void p_dfa(void)
-#else
-void p_dfa()
-#endif
-{
-/* prints out all the dfa nodes actually allocated */
-
- int i;
-
- for (i = 1; i<=dfa_allocated; i++)
- p_dfa_node(NFA(i));
-}
-
-
-/* print out numbers in the set label */
-
-#ifdef __USE_PROTOS
-void p_set(set label)
-#else
-void p_set(label)
-set label;
-#endif
-{
- unsigned *t, *e;
-
- if (set_nil(label)){
- printf("epsilon\n");
- }else{
- t = e = set_pdq(label);
- while(*e != nil){
- printf("%d ", (*e+MIN_CHAR));
- e++;
- }
- printf("\n");
- free(t);
- }
-
-}
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/parser.dlg b/BaseTools/Source/C/VfrCompile/Pccts/dlg/parser.dlg
deleted file mode 100644
index df9a637f9e..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/parser.dlg
+++ /dev/null
@@ -1,398 +0,0 @@
-<<
-/* parser.dlg -- DLG Description of scanner
- *
- * Generated from: dlg_p.g
- *
- * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
- * Purdue University Electrical Engineering
- * With AHPCRC, University of Minnesota
- * ANTLR Version 1.33MR33
- */
-
-#define ANTLR_VERSION 13333
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-#include <ctype.h>
-#include "dlg.h"
-#include "antlr.h"
-#include "tokens.h"
-#include "dlgdef.h"
-LOOKAHEAD
-
-void
-#ifdef __USE_PROTOS
-zzerraction(void)
-#else
-zzerraction()
-#endif
-{
- (*zzerr)("invalid token");
- zzadvance();
- zzskip();
-}
->>
-
-<<%%lexaction
-
-int func_action; /* should actions be turned into functions?*/
-int lex_mode_counter = 0; /* keeps track of the number of %%names */
-/* MR1 */
-/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
-/* MR1 via <<%%lexmember...>> */
-/* MR1 */
-int lexMember = 0; /* <<%%lexmemeber ...>> MR1 */
-int lexAction = 0; /* <<%%lexaction ...>> MR1 */
-int parserClass = 0; /* <<%%parserclass ...>> MR1 */
-int lexPrefix = 0; /* <<%%lexprefix ...>> MR1 */
-char theClassName[100]; /* MR11 */
-char *pClassName=theClassName; /* MR11 */
-int firstLexMember=1; /* MR1 */
-
-#ifdef __USE_PROTOS
-void xxputc(int c) { /* MR1 */
-#else
- void xxputc(c) /* MR1 */
- int c; /* MR1 */
- { /* MR1 */
-#endif
- if (parserClass) { /* MR1 */
- *pClassName++=c; /* MR1 */
- *pClassName=0; /* MR1 */
- } else if (lexMember || lexPrefix) { /* MR1 */
- if (class_stream != NULL) fputc(c,class_stream); /* MR1 */
- } else { /* MR1 */
- fputc(c,OUT); /* MR1 */
- }; /* MR1 */
- } /* MR1 */
-
-#ifdef __USE_PROTOS
- void xxprintf(char *format,char *string) { /* MR1 */
-#else
- void xxprintf(format,string) /* MR1 */
- char *format; /* MR1 */
- char *string; /* MR1 */
- { /* MR1 */
-#endif
- if (lexMember || lexPrefix || parserClass) { /* MR1 */
- if (class_stream != NULL) /* MR1 */
- fprintf(class_stream,format,string); /* MR1 */
- } else { /* MR1 */
- fprintf(OUT,format,string); /* MR1 */
- }; /* MR1 */
- } /* MR1 */
->>
-
-
-%%START
-
-@
- <<
- NLA = 1;
- >>
-
-[\r\t\ ]+
- <<
- NLA = 2;
- zzskip();
- >>
-
-\n
- <<
- NLA = 3;
- zzline++; zzskip(); DAWDLE;
- >>
-
-\@
- <<
- NLA = L_EOF;
- >>
-
-\%\%
- <<
- NLA = PER_PER;
- >>
-
-\%\%[a-zA-Z_][a-zA-Z0-9_]*
- <<
- NLA = NAME_PER_PER;
- p_mode_def(&zzlextext[2],lex_mode_counter++);
- >>
-
-\<\<\%\%lexmember
- <<
- NLA = LEXMEMBER;
- lexMember=1; /* MR1 */
- if (firstLexMember != 0) { /* MR1 */
- firstLexMember=0; /* MR1 */
- p_class_def1(); /* MR1 */
- }; /* MR1 */
- zzmode(ACT); /* MR1 */
- >>
-
-\<\<\%\%lexaction
- <<
- NLA = LEXACTION;
- lexAction=1;zzmode(ACT);
- >>
-
-\<\<\%\%parserclass
- <<
- NLA = PARSERCLASS;
- parserClass=1; /* MR1 */
- zzmode(ACT); /* MR1 */
- >>
-
-\<\<\%\%lexprefix
- <<
- NLA = LEXPREFIX;
- lexPrefix=1;zzmode(ACT);
- >>
-
-\<\<
- <<
- NLA = ACTION;
- if (func_action)
- fprintf(OUT,"\n%s %sact%d()\n{ ",
- gen_cpp?"ANTLRTokenType":"static void",
- gen_cpp?ClassName("::"):"", ++action_no);
- zzmode(ACT); zzskip();
- >>
-
-\>\>
- <<
- NLA = GREAT_GREAT;
- >>
-
-\{
- <<
- NLA = L_BRACE;
- >>
-
-\}
- <<
- NLA = R_BRACE;
- >>
-
-\(
- <<
- NLA = L_PAR;
- >>
-
-\)
- <<
- NLA = R_PAR;
- >>
-
-\[
- <<
- NLA = L_BRACK;
- >>
-
-\]
- <<
- NLA = R_BRACK;
- >>
-
-\*
- <<
- NLA = ZERO_MORE;
- >>
-
-\+
- <<
- NLA = ONE_MORE;
- >>
-
-\|
- <<
- NLA = OR;
- >>
-
-\-
- <<
- NLA = RANGE;
- >>
-
-\~
- <<
- NLA = NOT;
- >>
-
-\\0[0-7]*
- <<
- NLA = OCTAL_VALUE;
- {int t; sscanf(&zzlextext[1],"%o",&t); zzlextext[0] = t;}
- >>
-
-\\0[Xx][0-9a-fA-F]+
- <<
- NLA = HEX_VALUE;
- {int t; sscanf(&zzlextext[3],"%x",&t); zzlextext[0] = t;}
- >>
-
-\\[1-9][0-9]*
- <<
- NLA = DEC_VALUE;
- {int t; sscanf(&zzlextext[1],"%d",&t); zzlextext[0] = t;}
- >>
-
-\\t
- <<
- NLA = TAB;
- zzlextext[0] = '\t';
- >>
-
-\\n
- <<
- NLA = NL;
- zzlextext[0] = '\n';
- >>
-
-\\r
- <<
- NLA = CR;
- zzlextext[0] = '\r';
- >>
-
-\\b
- <<
- NLA = BS;
- zzlextext[0] = '\b';
- >>
-
-\\ \n
- <<
- NLA = CONTINUATION;
- zzline++; zzskip();
- >>
-
-\\~[tnrb]
- <<
- NLA = LIT;
- zzlextext[0] = zzlextext[1];
- >>
-
-~[\\]
- <<
- NLA = REGCHAR;
- >>
-
-
-%%ACT
-
-@
- <<
- NLA = 1;
- error("unterminated action", zzline); zzmode(START);
- >>
-
-\>\>
- <<
- NLA = ACTION;
- if (func_action) fprintf(OUT,"}\n\n");
- zzmode(START);
- /* MR1 */
- /* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */
- /* MR1 via <<%%lexmember ...>> */
- /* MR1 This is a consequence of not saving actions */
- /* MR1 */
- /* MR1 */ parserClass=0;
- /* MR1 */ lexPrefix=0;
- /* MR1 */ lexAction=0;
- /* MR1 */ lexMember=0;
- >>
-
-\>
- <<
- NLA = 34;
- xxputc(zzlextext[0]); zzskip();
- >>
-
-\\\>
- <<
- NLA = 35;
- xxputc('>'); zzskip();
- >>
-
-\\
- <<
- NLA = 36;
- xxputc('\\'); zzskip();
- >>
-
-\n
- <<
- NLA = 37;
- xxputc(zzlextext[0]); ++zzline; zzskip();
- >>
-
-/\*
- <<
- NLA = 38;
- zzmode(ACTION_COMMENTS); /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- >>
-
-//
- <<
- NLA = 39;
- zzmode(ACTION_CPP_COMMENTS); /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- >>
-
-~[]
- <<
- NLA = 40;
- xxputc(zzlextext[0]); zzskip();
- >>
-
-
-%%ACTION_COMMENTS
-
-@
- <<
- NLA = 1;
- >>
-
-\*/
- <<
- NLA = 41;
- zzmode(ACT); /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- >>
-
-[\n\r]
- <<
- NLA = 42;
- zzline++; xxputc(zzlextext[0]); zzskip();
- >>
-
-~[]
- <<
- NLA = 43;
- xxputc(zzlextext[0]); zzskip();
- >>
-
-
-%%ACTION_CPP_COMMENTS
-
-@
- <<
- NLA = 1;
- >>
-
-[\n\r]
- <<
- NLA = 44;
- zzmode(ACT); zzline++; /* MR1 */
- xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */
- >>
-
-~[]
- <<
- NLA = 45;
- xxputc(zzlextext[0]); zzskip();
- >>
-
-%%
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/relabel.c b/BaseTools/Source/C/VfrCompile/Pccts/dlg/relabel.c
deleted file mode 100644
index 0b8bc163d1..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/relabel.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/* This group of functions does the character class compression.
- It goes over the dfa and relabels the arcs with the partitions
- of characters in the NFA. The partitions are stored in the
- array class.
-
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * DLG 1.33
- * Will Cohen
- * With mods by Terence Parr; AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include "dlg.h"
-#ifdef MEMCHK
-#include "trax.h"
-#else
-#ifdef __STDC__
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif /* __STDC__ */
-#endif
-
-int class_no = CHAR_RANGE; /* number of classes for labels */
-int first_el[CHAR_RANGE]; /* first element in each class partition */
-set class_sets[CHAR_RANGE]; /* array holds partitions from class */
- /* compression */
-
-/* goes through labels on NFA graph and partitions the characters into
- * character classes. This reduces the amount of space required for each
- * dfa node, since only one arc is required each class instead of one arc
- * for each character
- * level:
- * 0 no compression done
- * 1 remove unused characters from classes
- * 2 compress equivalent characters into same class
- *
- * returns the number of character classes required
- */
-#ifdef __USE_PROTOS
-int relabel(nfa_node* start,int level)
-#else
-int relabel(start,level)
-int level;
-nfa_node *start;
-#endif
-{
- if (level){
- set_free(used_classes);
- partition(start,level);
- label_with_classes(start);
- }else{
- /* classes equivalent to all characters in alphabet */
- class_no = CHAR_RANGE;
- }
- return class_no;
-}
-
-/* makes character class sets for new labels */
-#ifdef __USE_PROTOS
-void partition(nfa_node* start,int level)
-#else
-void partition(start,level)
-nfa_node *start; /* beginning of nfa graph */
-int level; /* compression level to uses */
-#endif
-{
- set current_class;
- set unpart_chars;
- set temp;
-
- unpart_chars = set_dup(used_chars);
-#if 0
- /* EOF (-1+1) alway in class 0 */
- class_sets[0] = set_of(0);
- first_el[0] = 0;
- used_classes = set_of(0);
- temp = set_dif(unpart_chars, class_sets[0]);
- set_free(unpart_chars);
- unpart_chars = temp;
- class_no = 1;
-#else
- class_no = 0;
-#endif
- while (!set_nil(unpart_chars)){
- /* don't look for equivalent labels if c <= 1 */
- if (level <= 1){
- current_class = set_of(set_int(unpart_chars));
- }else{
- current_class = set_dup(unpart_chars);
- intersect_nfa_labels(start,&current_class);
- }
- set_orel(class_no,&used_classes);
- first_el[class_no] = set_int(current_class);
- class_sets[class_no] = current_class;
- temp = set_dif(unpart_chars,current_class);
- set_free(unpart_chars);
- unpart_chars = temp;
- ++class_no;
- }
-
- /* free unpart_chars -ATG 5/6/95 */
- set_free(unpart_chars);
-
-#if 0
- /* group all the other unused characters into a class */
- set_orel(class_no,&used_classes);
- first_el[class_no] = set_int(current_class);
- class_sets[class_no] = set_dif(normal_chars,used_chars);
- ++class_no;
-#endif
-}
-
-
-/* given pointer to beginning of graph and recursively walks it trying
- * to find a maximal partition. This partion in returned in maximal_class
- */
-#ifdef __USE_PROTOS
-void intersect_nfa_labels(nfa_node* start,set* maximal_class)
-#else
-void intersect_nfa_labels(start,maximal_class)
-nfa_node *start;
-set *maximal_class;
-#endif
-{
- /* pick a new operation number */
- ++operation_no;
- r_intersect(start,maximal_class);
-}
-
-#ifdef __USE_PROTOS
-void r_intersect(nfa_node* start,set* maximal_class)
-#else
-void r_intersect(start,maximal_class)
-nfa_node *start;
-set * maximal_class;
-#endif
-{
- set temp;
-
- if(start && start->nfa_set != operation_no)
- {
- start->nfa_set = operation_no;
- temp = set_and(*maximal_class,start->label);
- if (!set_nil(temp))
- {
- set_free(*maximal_class);
- *maximal_class = temp;
- }else{
- set_free(temp);
- }
- r_intersect(start->trans[0],maximal_class);
- r_intersect(start->trans[1],maximal_class);
- }
-}
-
-
-/* puts class labels in place of old character labels */
-#ifdef __USE_PROTOS
-void label_with_classes(nfa_node* start)
-#else
-void label_with_classes(start)
-nfa_node *start;
-#endif
-{
- ++operation_no;
- label_node(start);
-}
-
-#ifdef __USE_PROTOS
-void label_node(nfa_node *start)
-#else
-void label_node(start)
-nfa_node *start;
-#endif
-{
- set new_label;
- register int i;
-
- /* only do node if it hasn't been done before */
- if (start && start->nfa_set != operation_no){
- start->nfa_set = operation_no;
- new_label = empty;
- for (i = 0; i<class_no; ++i){
- /* if one element of class in old_label,
- all elements are. */
- if (set_el(first_el[i],start->label))
- set_orel(i,&new_label);
- }
- set_free(start->label);
- start->label = new_label;
- /* do any nodes that can be reached from this one */
- label_node(start->trans[0]);
- label_node(start->trans[1]);
- }
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/stdpccts.h b/BaseTools/Source/C/VfrCompile/Pccts/dlg/stdpccts.h
deleted file mode 100644
index 06ec67e44d..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/stdpccts.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef STDPCCTS_H
-#define STDPCCTS_H
-/*
- * stdpccts.h -- P C C T S I n c l u d e
- *
- * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
- * Purdue University Electrical Engineering
- * With AHPCRC, University of Minnesota
- * ANTLR Version 1.33MR33
- */
-
-#ifndef ANTLR_VERSION
-#define ANTLR_VERSION 13333
-#endif
-
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-#include <ctype.h>
-#include "dlg.h"
-#define zzSET_SIZE 8
-#include "antlr.h"
-#include "tokens.h"
-#include "dlgdef.h"
-#include "mode.h"
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/support.c b/BaseTools/Source/C/VfrCompile/Pccts/dlg/support.c
deleted file mode 100644
index 84fe99d69c..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/support.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * DLG 1.33
- * Will Cohen
- * With mods by Terence Parr; AHPCRC, University of Minnesota
- * 1989-2001
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "dlg.h"
-#ifdef MEMCHK
-#include "trax.h"
-#else
-#ifdef __STDC__
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif /* __STDC__ */
-#endif
-
-int err_found = 0; /* indicates whether problem found */
-
-#ifdef __USE_PROTOS
-void internal_error(char *s, char *file,int line) /* MR9 23-Sep-97 */
-#else
-void internal_error(s,file,line) /* MR9 23-Sep-97 */
-char *s,*file;
-int line;
-#endif
-{
- fprintf(stderr,s,file,line);
- exit(PCCTS_EXIT_FAILURE);
-}
-
-#ifdef __USE_PROTOS
-char *dlg_malloc(int bytes,char *file,int line)
-#else
-char *dlg_malloc(bytes,file,line)
-int bytes;
-char *file;
-int line;
-#endif
-{
- char *t;
-
- t = (char *) malloc(bytes);
- if (!t){
- /* error */
- internal_error("%s(%d): unable to allocate memory\n",
- file,line);
- }
- return t;
-}
-
-
-#ifdef __USE_PROTOS
-char *dlg_calloc(int n,int bytes,char *file,int line)
-#else
-char *dlg_calloc(n,bytes,file,line)
-int n,bytes;
-char *file;
-int line;
-#endif
-{
- char *t;
-
- t = (char *) calloc(n,bytes);
- if (!t){
- /* error */
- internal_error("%s(%d): unable to allocate memory\n",
- file,line);
- }
- return t;
-}
-
-
-#ifdef __USE_PROTOS
-FILE *read_stream(char *name)
-#else
-FILE *read_stream(name)
-char *name;
-#endif
-{
- FILE *f;
-
- if (name){
- if (name[0] == '-') {
- fprintf(stderr, "dlg: invalid option: '%s'\n", name);
- f = NULL;
- }else{
- f = fopen(name, "r");
- if (f == NULL){
- /* couldn't open file */
- fprintf(stderr,
- "dlg: Warning: Can't read file %s.\n",
- name);
- }
- }
- }else{
- /* open stdin if nothing there */
- f = stdin;
- }
- return f;
-}
-
-#ifdef __USE_PROTOS
-FILE *write_stream(char *name)
-#else
-FILE *write_stream(name)
-char *name;
-#endif
-{
- FILE *f;
-
- if (name){
- if (name[0] == '-') {
- fprintf(stderr, "dlg: invalid option: '%s'\n", name);
- f = NULL;
- }else{
- f = fopen(OutMetaName(name), "w");
- if (f == NULL){
- /* couldn't open file */
- fprintf(stderr,
- "dlg: Warning: Can't write to file %s.\n",
- name);
- }
- else
-#ifdef SPECIAL_FOPEN
- special_fopen_actions(OutMetaName(name)); /* MR1 */
-#else
- ; /* MR1 */
-#endif
- }
- }else{
- /* open stdout if nothing there */
- f = stdout;
- }
- return f;
-}
-
-
-#ifdef __USE_PROTOS
-void fatal(char *message,int line_no)
-#else
-void fatal(message,line_no)
-char *message;
-int line_no;
-#endif
-{
- fprintf(stderr,ErrHdr,
- (file_str[0] ? file_str[0] : "stdin"), line_no);
- fprintf(stderr, " Fatal: %s\n", message);
- exit(PCCTS_EXIT_FAILURE);
-}
-
-#ifdef __USE_PROTOS
-void error(char *message,int line_no)
-#else
-void error(message,line_no)
-char *message;
-int line_no;
-#endif
-{
- fprintf(stderr,ErrHdr,
- (file_str[0] ? file_str[0] : "stdin"), line_no);
- fprintf(stderr, " Error: %s\n", message);
- err_found = 1;
-}
-
-#ifdef __USE_PROTOS
-void warning(char *message,int line_no)
-#else
-void warning(message,line_no)
-char *message;
-int line_no;
-#endif
-{
- fprintf(stderr,ErrHdr,
- (file_str[0] ? file_str[0] : "stdin"), line_no);
- fprintf(stderr, " Warning: %s\n", message);
-}
-
-/* MR10: Jeff Vincent
- MR10: Changed to remove directory information from n only if
- MR10: if OutputDirectory was changed by user (-o option)
-*/
-
-#ifdef __USE_PROTOS
-char *OutMetaName(char *n)
-#else
-char *OutMetaName(n)
-char *n;
-#endif
-{
- static char *dir_sym = DirectorySymbol;
- static char newname[MaxFileName+1];
- char *p;
-
- /* If OutputDirectory is same as TopDirectory (platform default) then leave n alone. */
- if (strcmp(OutputDirectory, TopDirectory) == 0)
- return n;
-
- /* p will point to filename without path information */
- if ((p = strrchr(n, *dir_sym)) != NULL)
- p++;
- else
- p = n;
-
- /* Copy new output directory into newname[] */
- strcpy(newname, OutputDirectory);
-
- /* if new output directory does not have trailing dir_sym, add it! */
- if (newname[strlen(newname)-1] != *dir_sym)
- strcat(newname, dir_sym);
-
- /* contatenate FILE NAME ONLY to new output directory */
- strcat(newname, p);
-
- return newname;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/tokens.h b/BaseTools/Source/C/VfrCompile/Pccts/dlg/tokens.h
deleted file mode 100644
index 73e502b7e1..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/tokens.h
+++ /dev/null
@@ -1,133 +0,0 @@
-#ifndef tokens_h
-#define tokens_h
-/* tokens.h -- List of labelled tokens and stuff
- *
- * Generated from: dlg_p.g
- *
- * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
- * Purdue University Electrical Engineering
- * ANTLR Version 1.33MR33
- */
-#define zzEOF_TOKEN 1
-#define L_EOF 4
-#define PER_PER 5
-#define NAME_PER_PER 6
-#define LEXMEMBER 7
-#define LEXACTION 8
-#define PARSERCLASS 9
-#define LEXPREFIX 10
-#define ACTION 11
-#define GREAT_GREAT 12
-#define L_BRACE 13
-#define R_BRACE 14
-#define L_PAR 15
-#define R_PAR 16
-#define L_BRACK 17
-#define R_BRACK 18
-#define ZERO_MORE 19
-#define ONE_MORE 20
-#define OR 21
-#define RANGE 22
-#define NOT 23
-#define OCTAL_VALUE 24
-#define HEX_VALUE 25
-#define DEC_VALUE 26
-#define TAB 27
-#define NL 28
-#define CR 29
-#define BS 30
-#define CONTINUATION 31
-#define LIT 32
-#define REGCHAR 33
-
-#ifdef __USE_PROTOS
-void grammar(void);
-#else
-extern void grammar();
-#endif
-
-#ifdef __USE_PROTOS
-void start_states(void);
-#else
-extern void start_states();
-#endif
-
-#ifdef __USE_PROTOS
-void do_conversion(void);
-#else
-extern void do_conversion();
-#endif
-
-#ifdef __USE_PROTOS
-void rule_list(void);
-#else
-extern void rule_list();
-#endif
-
-#ifdef __USE_PROTOS
-void rule(void);
-#else
-extern void rule();
-#endif
-
-#ifdef __USE_PROTOS
-void reg_expr(void);
-#else
-extern void reg_expr();
-#endif
-
-#ifdef __USE_PROTOS
-void and_expr(void);
-#else
-extern void and_expr();
-#endif
-
-#ifdef __USE_PROTOS
-void repeat_expr(void);
-#else
-extern void repeat_expr();
-#endif
-
-#ifdef __USE_PROTOS
-void expr(void);
-#else
-extern void expr();
-#endif
-
-#ifdef __USE_PROTOS
-void atom_list(void);
-#else
-extern void atom_list();
-#endif
-
-#ifdef __USE_PROTOS
-void near_atom(void);
-#else
-extern void near_atom();
-#endif
-
-#ifdef __USE_PROTOS
-void atom(void);
-#else
-extern void atom();
-#endif
-
-#ifdef __USE_PROTOS
-void anychar(void);
-#else
-extern void anychar();
-#endif
-
-#endif
-extern SetWordType zzerr1[];
-extern SetWordType zzerr2[];
-extern SetWordType zzerr3[];
-extern SetWordType setwd1[];
-extern SetWordType zzerr4[];
-extern SetWordType zzerr5[];
-extern SetWordType zzerr6[];
-extern SetWordType setwd2[];
-extern SetWordType zzerr7[];
-extern SetWordType zzerr8[];
-extern SetWordType zzerr9[];
-extern SetWordType setwd3[];
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp b/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp
deleted file mode 100644
index 720fe75af1..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.cpp
+++ /dev/null
@@ -1,871 +0,0 @@
-/* ANTLRParser.C
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#include "pcctscfg.h"
-
-#include "pccts_stdlib.h"
-#include "pccts_stdarg.h"
-#include "pccts_string.h"
-#include "pccts_stdio.h"
-
-PCCTS_NAMESPACE_STD
-
-/* I have to put this here due to C++ limitation
- * that you can't have a 'forward' decl for enums.
- * I hate C++!!!!!!!!!!!!!!!
- * Of course, if I could use real templates, this would go away.
- */
-// MR1
-// MR1 10-Apr-97 133MR1 Prevent use of varying sizes for the
-// MR1 ANTLRTokenType enum
-// MR1
-
-enum ANTLRTokenType { TER_HATES_CPP=0, ITS_TOO_COMPLICATED=9999}; // MR1
-
-#define ANTLR_SUPPORT_CODE
-
-#include ATOKEN_H
-#include ATOKENBUFFER_H
-#include APARSER_H
-
-static const int zzINF_DEF_TOKEN_BUFFER_SIZE = 2000; /* MR14 */
-static const int zzINF_BUFFER_TOKEN_CHUNK_SIZE = 1000; /* MR14 */
-
- /* L o o k a h e a d M a c r o s */
-
-/* maximum of 32 bits/unsigned int and must be 8 bits/byte;
- * we only use 8 bits of it.
- */
-SetWordType ANTLRParser::bitmask[sizeof(SetWordType)*8] = {
- 0x00000001, 0x00000002, 0x00000004, 0x00000008,
- 0x00000010, 0x00000020, 0x00000040, 0x00000080
-};
-
-char ANTLRParser::eMsgBuffer[500] = "";
-
-ANTLRParser::
-~ANTLRParser()
-{
- delete [] token_type;
- delete [] zzFAILtext; // MR16 Manfred Kogler
-}
-
-ANTLRParser::
-ANTLRParser(ANTLRTokenBuffer *_inputTokens,
- int k,
- int use_inf_look,
- int dlook,
- int ssize)
-{
- LLk = k;
- can_use_inf_look = use_inf_look;
-/* MR14 */ if (dlook != 0) {
-/* MR14 */ panic("ANTLRParser::ANTLRParser - Demand lookahead not supported in C++ mode");
-/* MR14 */
-/* MR14 */ };
- demand_look = 0; /* demand_look = dlook; */
- bsetsize = ssize;
- guessing = 0;
- token_tbl = NULL;
- eofToken = (ANTLRTokenType)1;
-
- // allocate lookahead buffer
- token_type = new ANTLRTokenType[LLk];
- lap = 0;
- labase = 0;
-#ifdef ZZDEFER_FETCH
- stillToFetch = 0; // MR19
-#endif
- dirty = 0;
- inf_labase = 0; // MR7
- inf_last = 0; // MR7
- /* prime lookahead buffer, point to inputTokens */
- this->inputTokens = _inputTokens;
- this->inputTokens->setMinTokens(k);
- _inputTokens->setParser(this); // MR1
- resynchConsumed=1; // MR8
- zzFAILtext=NULL; // MR9
- traceOptionValueDefault=0; // MR10
- traceReset(); // MR10
- zzGuessSeq=0; // MR10
- syntaxErrCount=0; // MR11
-}
-
-void ANTLRParser::init()
-{
- prime_lookahead();
- resynchConsumed=1; // MR8
- traceReset(); // MR10
-}
-
-void ANTLRParser::traceReset()
-{
- traceOptionValue=traceOptionValueDefault;
- traceGuessOptionValue=1;
- traceCurrentRuleName=NULL;
- traceDepth=0;
-}
-
-
-#ifdef _MSC_VER // MR23
-//Turn off warning:
-//interaction between '_setjmp' and C++ object destruction is non-portable
-#pragma warning(disable : 4611)
-#endif
-int ANTLRParser::
-guess(ANTLRParserState *st)
-{
- saveState(st);
- guessing = 1;
- return setjmp(guess_start.state);
-}
-#ifdef _MSC_VER // MR23
-#pragma warning(default: 4611)
-#endif
-
-void ANTLRParser::
-saveState(ANTLRParserState *buf)
-{
- buf->guess_start = guess_start;
- buf->guessing = guessing;
- buf->inf_labase = inf_labase;
- buf->inf_last = inf_last;
- buf->dirty = dirty;
- buf->traceOptionValue=traceOptionValue; /* MR10 */
- buf->traceGuessOptionValue=traceGuessOptionValue; /* MR10 */
- buf->traceCurrentRuleName=traceCurrentRuleName; /* MR10 */
- buf->traceDepth=traceDepth; /* MR10 */
-}
-
-void ANTLRParser::
-restoreState(ANTLRParserState *buf)
-{
- int i;
- int prevTraceOptionValue;
-
- guess_start = buf->guess_start;
- guessing = buf->guessing;
- inf_labase = buf->inf_labase;
- inf_last = buf->inf_last;
- dirty = buf->dirty;
-
- // restore lookahead buffer from k tokens before restored TokenBuffer position
- // if demand_look, then I guess we don't look backwards for these tokens.
- for (i=1; i<=LLk; i++) token_type[i-1] =
- inputTokens->bufferedToken(i-LLk)->getType();
- lap = 0;
- labase = 0;
-
- /* MR10 */
-
- prevTraceOptionValue=traceOptionValue;
- traceOptionValue=buf->traceOptionValue;
- if ( (prevTraceOptionValue > 0) !=
- (traceOptionValue > 0)) {
- if (traceCurrentRuleName != NULL) { /* MR21 */
- if (traceOptionValue > 0) {
- /* MR23 */ printMessage(stderr,
- "trace enable restored in rule %s depth %d\n",
- traceCurrentRuleName,
- traceDepth);
- };
- if (traceOptionValue <= 0) {
- /* MR23 */ printMessage(stderr,
- "trace disable restored in rule %s depth %d\n",
- traceCurrentRuleName, /* MR21 */
- traceDepth);
- };
- }
- };
- traceGuessOptionValue=buf->traceGuessOptionValue;
- traceCurrentRuleName=buf->traceCurrentRuleName;
- traceDepth=buf->traceDepth;
- traceGuessDone(buf);
-}
-
-/* Get the next symbol from the input stream; put it into lookahead buffer;
- * fill token_type[] fast reference cache also. NLA is the next place where
- * a lookahead ANTLRAbstractToken should go.
- */
-void ANTLRParser::
-consume()
-{
-
-#ifdef ZZDEBUG_CONSUME_ACTION
- zzdebug_consume_action();
-#endif
-
-// MR19 V.H. Simonis
-// Defer Fetch feature
-// Moves action of consume() into LA() function
-
-#ifdef ZZDEFER_FETCH
- stillToFetch++;
-#else
- NLA = inputTokens->getToken()->getType();
- dirty--;
- lap = (lap+1)&(LLk-1);
-#endif
-
-}
-
-_ANTLRTokenPtr ANTLRParser::
-LT(int i)
-{
-
-// MR19 V.H. Simonis
-// Defer Fetch feature
-// Moves action of consume() into LA() function
-
-#ifdef ZZDEFER_FETCH
- undeferFetch();
-#endif
-
-#ifdef DEBUG_TOKENBUFFER
- if ( i >= inputTokens->bufferSize() || inputTokens->minTokens() < LLk ) /* MR20 Was "<=" */
- {
- char buf[2000]; /* MR20 Was "static" */
- sprintf(buf, "The minimum number of tokens you requested that the\nANTLRTokenBuffer buffer is not enough to satisfy your\nLT(%d) request; increase 'k' argument to constructor for ANTLRTokenBuffer\n", i);
- panic(buf);
- }
-#endif
- return inputTokens->bufferedToken(i-LLk);
-}
-
-void
-ANTLRParser::
-look(int k)
-{
- int i, c = k - (LLk-dirty);
- for (i=1; i<=c; i++) consume();
-}
-
-/* fill the lookahead buffer up with k symbols (even if DEMAND_LOOK);
- */
-void
-ANTLRParser::
-prime_lookahead()
-{
- int i;
- for(i=1;i<=LLk; i++) consume();
- dirty=0;
- // lap = 0; // MR14 Sinan Karasu (sinan.karasu@boeing.com)
- // labase = 0; // MR14
- labase=lap; // MR14
-}
-
-/* check to see if the current input symbol matches '_t'.
- * During NON demand lookahead mode, dirty will always be 0 and
- * hence the extra code for consuming tokens in _match is never
- * executed; the same routine can be used for both modes.
- */
-int ANTLRParser::
-_match(ANTLRTokenType _t, ANTLRChar **MissText,
- ANTLRTokenType *MissTok, _ANTLRTokenPtr *BadTok,
- SetWordType **MissSet)
-{
- if ( dirty==LLk ) {
- consume();
- }
- if ( LA(1)!=_t ) {
- *MissText=NULL;
- *MissTok= _t;
- *BadTok = LT(1);
- *MissSet=NULL;
- return 0;
- }
- dirty++;
- labase = (labase+1)&(LLk-1); // labase maintained even if !demand look
- return 1;
-}
-
-/* check to see if the current input symbol matches '_t'.
- * Used during exception handling.
- */
-int ANTLRParser::
-_match_wsig(ANTLRTokenType _t)
-{
- if ( dirty==LLk ) {
- consume();
- }
- if ( LA(1)!=_t ) return 0;
- dirty++;
- labase = (labase+1)&(LLk-1); // labase maintained even if !demand look
- return 1;
-}
-
-/* check to see if the current input symbol matches any token in a set.
- * During NON demand lookahead mode, dirty will always be 0 and
- * hence the extra code for consuming tokens in _match is never
- * executed; the same routine can be used for both modes.
- */
-int ANTLRParser::
-_setmatch(SetWordType *tset, ANTLRChar **MissText,
- ANTLRTokenType *MissTok, _ANTLRTokenPtr *BadTok,
- SetWordType **MissSet, SetWordType *tokclassErrset)
-{
- if ( dirty==LLk ) {
- consume();
- }
- if ( !set_el(LA(1), tset) ) {
- *MissText=NULL; /* MR23 */
- *MissTok=(ANTLRTokenType) 0; /* MR23 */
- *BadTok=LT(1); /* MR23 */
- *MissSet=tokclassErrset; /* MR23 */
- return 0;
- }
- dirty++;
- labase = (labase+1)&(LLk-1); // labase maintained even if !demand look
- return 1;
-}
-
-int ANTLRParser::
-_setmatch_wsig(SetWordType *tset)
-{
- if ( dirty==LLk ) {
- consume();
- }
- if ( !set_el(LA(1), tset) ) return 0;
- dirty++;
- labase = (labase+1)&(LLk-1); // labase maintained even if !demand look
- return 1;
-}
-
- /* Exception handling routines */
-//
-// 7-Apr-97 133MR1
-// Change suggested by Eli Sternheim (eli@interhdl.com)
-//
-void ANTLRParser::
-consumeUntil(SetWordType *st)
-{
- ANTLRTokenType tmp; // MR1
- const int Eof=1; // MR1
- while ( !set_el( (tmp=LA(1)), st) && tmp!=Eof) { consume(); } // MR1
-}
-
-//
-// 7-Apr-97 133MR1
-// Change suggested by Eli Sternheim (eli@interhdl.com)
-//
-void ANTLRParser::
-consumeUntilToken(int t)
-{
- int tmp; // MR1
- const int Eof=1; // MR1
- while ( (tmp=LA(1)) !=t && tmp!=Eof) { consume(); } // MR1
-}
-
-
- /* Old error stuff */
-
-void ANTLRParser::
-resynch(SetWordType *wd,SetWordType mask)
-{
-
-/* MR8 S.Bochnak@microtool.com.pl */
-/* MR8 Change file scope static "consumed" to instance var */
-
- /* if you enter here without having consumed a token from last resynch
- * force a token consumption.
- */
-/* MR8 */ if ( !resynchConsumed ) {consume(); resynchConsumed=1; return;}
-
- /* if current token is in resynch set, we've got what we wanted */
-
-/* MR8 */ if ( wd[LA(1)]&mask || LA(1) == eofToken ) {resynchConsumed=0; return;}
-
- /* scan until we find something in the resynch set */
-
- while ( !(wd[LA(1)]&mask) && LA(1) != eofToken ) {consume();}
-
-/* MR8 */ resynchConsumed=1;
-}
-
-/* standard error reporting function that assumes DLG-based scanners;
- * you should redefine in subclass to change it or if you use your
- * own scanner.
- */
-
-/* MR23 THM There appears to be a parameter "badText" passed to syn()
- which is not present in the parameter list. This may be
- because in C mode there is no attribute function which
- returns the text, so the text representation of the token
- must be passed explicitly. I think.
-*/
-
-void ANTLRParser::
-syn(_ANTLRTokenPtr /*tok MR23*/, ANTLRChar *egroup, SetWordType *eset,
- ANTLRTokenType etok, int k)
-{
- int line;
-
- line = LT(1)->getLine();
-
- syntaxErrCount++; /* MR11 */
-
- /* MR23 If the token is not an EOF token, then use the ->getText() value.
-
- If the token is the EOF token the text returned by ->getText()
- may be garbage. If the text from the token table is "@" use
- "<eof>" instead, because end-users don't know what "@" means.
- If the text is not "@" then use that text, which must have been
- supplied by the grammar writer.
- */
- const char * errorAt = LT(1)->getText();
- if (LA(1) == eofToken) {
- errorAt = parserTokenName(LA(1));
- if (errorAt[0] == '@') errorAt = "<eof>";
- }
- /* MR23 */ printMessage(stderr, "line %d: syntax error at \"%s\"",
- line, errorAt);
- if ( !etok && !eset ) {/* MR23 */ printMessage(stderr, "\n"); return;}
- if ( k==1 ) /* MR23 */ printMessage(stderr, " missing");
- else
- {
- /* MR23 */ printMessage(stderr, "; \"%s\" not", LT(k)->getText()); // MR23 use LT(k) since k>1
- if ( set_deg(eset)>1 ) /* MR23 */ printMessage(stderr, " in");
- }
- if ( set_deg(eset)>0 ) edecode(eset);
- else /* MR23 */ printMessage(stderr, " %s", token_tbl[etok]);
- if ( strlen(egroup) > 0 ) /* MR23 */ printMessage(stderr, " in %s", egroup);
- /* MR23 */ printMessage(stderr, "\n");
-}
-
-/* is b an element of set p? */
-int ANTLRParser::
-set_el(ANTLRTokenType b, SetWordType *p)
-{
- return( p[DIVWORD(b)] & bitmask[MODWORD(b)] );
-}
-
-int ANTLRParser::
-set_deg(SetWordType *a)
-{
- /* Fast compute degree of a set... the number
- of elements present in the set. Assumes
- that all word bits are used in the set
- */
- register SetWordType *p = a;
- register SetWordType *endp = &(a[bsetsize]);
- register int degree = 0;
-
- if ( a == NULL ) return 0;
- while ( p < endp )
- {
- register SetWordType t = *p;
- register SetWordType *b = &(bitmask[0]);
- do {
- if (t & *b) ++degree;
- } while (++b < &(bitmask[sizeof(SetWordType)*8]));
- p++;
- }
-
- return(degree);
-}
-
-void ANTLRParser::
-edecode(SetWordType *a)
-{
- register SetWordType *p = a;
- register SetWordType *endp = &(p[bsetsize]);
- register unsigned e = 0;
-
- if ( set_deg(a)>1 ) /* MR23 */ printMessage(stderr, " {");
- do {
- register SetWordType t = *p;
- register SetWordType *b = &(bitmask[0]);
- do {
- if ( t & *b ) /* MR23 */ printMessage(stderr, " %s", token_tbl[e]);
- e++;
- } while (++b < &(bitmask[sizeof(SetWordType)*8]));
- } while (++p < endp);
- if ( set_deg(a)>1 ) /* MR23 */ printMessage(stderr, " }");
-}
-
-/* input looks like:
- * zzFAIL(k, e1, e2, ...,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk)
- * where the zzMiss stuff is set here to the token that did not match
- * (and which set wasn't it a member of).
- */
-
-// MR9 29-Sep-97 Stan Bochnak (S.Bochnak@microTool.com.pl)
-// MR9 Original fix to static allocated text didn't
-// MR9 work because a pointer to it was passed back
-// MR9 to caller. Replace with instance variable.
-
-const int SETWORDCOUNT=20;
-
-void
-ANTLRParser::FAIL(int k, ...)
-{
-//
-// MR1 10-Apr-97
-//
-
- if (zzFAILtext == NULL) zzFAILtext=new char [1000]; // MR9
- SetWordType **f=new SetWordType *[SETWORDCOUNT]; // MR1 // MR9
- SetWordType **miss_set;
- ANTLRChar **miss_text;
- _ANTLRTokenPtr *bad_tok;
- ANTLRChar **bad_text;
-//
-// 7-Apr-97 133MR1
-// err_k is passed as a "int *", not "unsigned *"
-//
- int *err_k; // MR1
- int i;
- va_list ap;
-
- va_start(ap, k);
-
- zzFAILtext[0] = '\0';
- if ( k > SETWORDCOUNT ) panic("FAIL: overflowed buffer");
- for (i=1; i<=k; i++) /* collect all lookahead sets */
- {
- f[i-1] = va_arg(ap, SetWordType *);
- }
- for (i=1; i<=k; i++) /* look for offending token */
- {
- if ( i>1 ) strcat(zzFAILtext, " ");
- strcat(zzFAILtext, LT(i)->getText());
- if ( !set_el(LA(i), f[i-1]) ) break;
- }
- miss_set = va_arg(ap, SetWordType **);
- miss_text = va_arg(ap, ANTLRChar **);
- bad_tok = va_arg(ap, _ANTLRTokenPtr *);
- bad_text = va_arg(ap, ANTLRChar **);
- err_k = va_arg(ap, int *); // MR1
- if ( i>k )
- {
- /* bad; lookahead is permutation that cannot be matched,
- * but, the ith token of lookahead is valid at the ith position
- * (The old LL sub 1 (k) versus LL(k) parsing technique)
- */
- *miss_set = NULL;
- *miss_text = LT(1)->getText();
- *bad_tok = LT(1);
- *bad_text = (*bad_tok)->getText();
- *err_k = k;
-//
-// MR4 20-May-97 erroneously deleted contents of f[]
-// MR4 reported by Bruce Guenter (bruceg@qcc.sk.ca)
-// MR1 10-Apr-97 release temporary storage
-//
- delete [] f; // MR1
- return; // MR1
- }
-/* MR23 printMessage(stderr, "%s not in %dth set\n", zztokens[LA(i)], i);*/
- *miss_set = f[i-1];
- *miss_text = zzFAILtext;
- *bad_tok = LT(i);
- *bad_text = (*bad_tok)->getText();
- if ( i==1 ) *err_k = 1;
- else *err_k = k;
-//
-// MR4 20-May-97 erroneously deleted contents of f[]
-// MR4 reported by Bruce Guenter (bruceg@qcc.sk.ca)
-// MR1 10-Apr-97 release temporary storage
-//
- delete [] f; // MR1
- return; // MR1
-}
-
-int ANTLRParser::
-_match_wdfltsig(ANTLRTokenType tokenWanted, SetWordType *whatFollows)
-{
- if ( dirty==LLk ) consume();
-
- if ( LA(1)!=tokenWanted )
- {
- syntaxErrCount++; /* MR11 */
- /* MR23 */ printMessage(stderr,
- "line %d: syntax error at \"%s\" missing %s\n",
- LT(1)->getLine(),
- (LA(1)==eofToken && LT(1)->getText()[0] == '@')?"<eof>":LT(1)->getText(), /* MR21a */
- token_tbl[tokenWanted]);
- consumeUntil( whatFollows );
- return 0;
- }
- else {
- dirty++;
- labase = (labase+1)&(LLk-1); // labase maintained even if !demand look
-/* if ( !demand_look ) consume(); */
- return 1;
- }
-}
-
-
-int ANTLRParser::
-_setmatch_wdfltsig(SetWordType *tokensWanted,
- ANTLRTokenType tokenTypeOfSet,
- SetWordType *whatFollows)
-{
- if ( dirty==LLk ) consume();
- if ( !set_el(LA(1), tokensWanted) )
- {
- syntaxErrCount++; /* MR11 */
- /* MR23 */ printMessage(stderr,
- "line %d: syntax error at \"%s\" missing %s\n",
- LT(1)->getLine(),
- (LA(1)==eofToken && LT(1)->getText()[0] == '@')?"<eof>":LT(1)->getText(), /* MR21a */
- token_tbl[tokenTypeOfSet]);
- consumeUntil( whatFollows );
- return 0;
- }
- else {
- dirty++;
- labase = (labase+1)&(LLk-1); // labase maintained even if !demand look
-/* if ( !demand_look ) consume(); */
- return 1;
- }
-}
-
-char *ANTLRParser::
-eMsgd(char *err,int d)
-{
- sprintf(eMsgBuffer, err, d); // dangerous, but I don't care
- return eMsgBuffer;
-}
-
-char *ANTLRParser::
-eMsg(char *err, char *s)
-{
- sprintf(eMsgBuffer, err, s);
- return eMsgBuffer;
-}
-
-char *ANTLRParser::
-eMsg2(char *err,char *s, char *t)
-{
- sprintf(eMsgBuffer, err, s, t);
- return eMsgBuffer;
-}
-
-void ANTLRParser::
-panic(const char *msg) // MR20 const
-{
- /* MR23 */ printMessage(stderr, "ANTLR panic: %s\n", msg);
- exit(PCCTS_EXIT_FAILURE); // MR1
-}
-
-const ANTLRChar *ANTLRParser:: // MR1
-parserTokenName(int tok) { // MR1
- return token_tbl[tok]; // MR1
-} // MR1
-
-void ANTLRParser::traceGuessDone(const ANTLRParserState *state) {
-
- int doIt=0;
-
- if (traceCurrentRuleName == NULL) return;
-
- if (traceOptionValue <= 0) {
- doIt=0;
- } else if (traceGuessOptionValue <= 0) {
- doIt=0;
- } else {
- doIt=1;
- };
-
- if (doIt) {
- /* MR23 */ printMessage(stderr,"guess done - returning to rule %s {\"%s\"} at depth %d",
- state->traceCurrentRuleName,
- LT(1)->getType() == eofToken ? "@" : LT(1)->getText(),
- state->traceDepth);
- if (state->guessing != 0) {
- /* MR23 */ printMessage(stderr," (guess mode continues - an enclosing guess is still active)");
- } else {
- /* MR23 */ printMessage(stderr," (guess mode ends)");
- };
- /* MR23 */ printMessage(stderr,"\n");
- };
-}
-
-void ANTLRParser::traceGuessFail() {
-
- int doIt=0;
-
- if (traceCurrentRuleName == NULL) return; /* MR21 */
-
- if (traceOptionValue <= 0) {
- doIt=0;
- } else if (guessing && traceGuessOptionValue <= 0) {
- doIt=0;
- } else {
- doIt=1;
- };
-
- if (doIt) {
- /* MR23 */ printMessage(stderr,"guess failed in %s\n",traceCurrentRuleName);
- };
-}
-
-/* traceOption:
- zero value turns off trace
-*/
-
-void ANTLRParser::tracein(const ANTLRChar * rule) {
-
- int doIt=0;
-
- traceDepth++;
- traceCurrentRuleName=rule;
-
- if (traceOptionValue <= 0) {
- doIt=0;
- } else if (guessing && traceGuessOptionValue <= 0) {
- doIt=0;
- } else {
- doIt=1;
- };
-
- if (doIt) {
- /* MR23 */ printMessage(stderr,"enter rule %s {\"%s\"} depth %d",
- rule,
- LT(1)->getType() == eofToken ? "@" : LT(1)->getText(),
- traceDepth);
- if (guessing) /* MR23 */ printMessage(stderr," guessing");
- /* MR23 */ printMessage(stderr,"\n");
- };
- return;
-}
-
-void ANTLRParser::traceout(const ANTLRChar * rule) {
-
- int doIt=0;
-
- traceDepth--;
-
- if (traceOptionValue <= 0) {
- doIt=0;
- } else if (guessing && traceGuessOptionValue <= 0) {
- doIt=0;
- } else {
- doIt=1;
- };
-
- if (doIt) {
- /* MR23 */ printMessage(stderr,"exit rule %s {\"%s\"} depth %d",
- rule,
- LT(1)->getType() == eofToken ? "@" : LT(1)->getText(),
- traceDepth+1);
- if (guessing) /* MR23 */ printMessage(stderr," guessing");
- /* MR23 */ printMessage(stderr,"\n");
- };
-}
-
-int ANTLRParser::traceOption(int delta) {
-
- int prevValue=traceOptionValue;
-
- traceOptionValue=traceOptionValue+delta;
-
- if (traceCurrentRuleName != NULL) {
- if (prevValue <= 0 && traceOptionValue > 0) {
- /* MR23 */ printMessage(stderr,"trace enabled in rule %s depth %d\n",traceCurrentRuleName,traceDepth);
- };
- if (prevValue > 0 && traceOptionValue <= 0) {
- /* MR23 */ printMessage(stderr,"trace disabled in rule %s depth %d\n",traceCurrentRuleName,traceDepth);
- };
- };
-
- return prevValue;
-}
-
-int ANTLRParser::traceGuessOption(int delta) {
-
- int prevValue=traceGuessOptionValue;
-
- traceGuessOptionValue=traceGuessOptionValue+delta;
-
- if (traceCurrentRuleName != NULL) {
- if (prevValue <= 0 && traceGuessOptionValue > 0) {
- /* MR23 */ printMessage(stderr,"guess trace enabled in rule %s depth %d\n",traceCurrentRuleName,traceDepth);
- };
- if (prevValue > 0 && traceGuessOptionValue <= 0) {
- /* MR23 */ printMessage(stderr,"guess trace disabled in rule %s depth %d\n",traceCurrentRuleName,traceDepth);
- };
- };
- return prevValue;
-}
-
-// MR19 V.H. Simonis Defer Fetch feature
-
-void ANTLRParser::undeferFetch()
-{
-
-#ifdef ZZDEFER_FETCH
- if (stillToFetch) {
- for (int stillToFetch_x = 0; stillToFetch_x < stillToFetch; ++stillToFetch_x) {
- NLA = inputTokens->getToken()->getType();
- dirty--;
- lap = (lap+1)&(LLk-1);
- }
- stillToFetch = 0;
- }
-#else
- return;
-#endif
-
-}
-
-int ANTLRParser::isDeferFetchEnabled()
-{
-#ifdef ZZDEFER_FETCH
- return 1;
-#else
- return 0;
-#endif
-}
-
-//MR23
-int ANTLRParser::printMessage(FILE* pFile, const char* pFormat, ...)
-{
- va_list marker;
- va_start( marker, pFormat );
- int iRet = printMessageV(pFile, pFormat, marker);
- va_end( marker );
- return iRet;
-}
-
-int ANTLRParser::printMessageV(FILE* pFile, const char* pFormat, va_list arglist) // MR23
-{
- return vfprintf(pFile, pFormat, arglist);
-}
-
-// MR23 Move semantic predicate error handling from macro to virtual function
-//
-// Called by the zzfailed_pred
-
-void ANTLRParser::failedSemanticPredicate(const char* predicate)
-{
- printMessage(stdout,"line %d: semantic error; failed predicate: '%s'\n",
- LT(1)->getLine(), predicate);
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h b/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h
deleted file mode 100644
index fe405f4167..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/AParser.h
+++ /dev/null
@@ -1,376 +0,0 @@
-/* ANTLRParser.h
- *
- * Define the generic ANTLRParser superclass, which is subclassed to
- * define an actual parser.
- *
- * Before entry into this file: ANTLRTokenType must be set.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef APARSER_H_GATE
-#define APARSER_H_GATE
-
-#include "pcctscfg.h"
-
-#include "pccts_stdio.h"
-#include "pccts_setjmp.h"
-
-PCCTS_NAMESPACE_STD
-
-#include ATOKEN_H
-#include ATOKENBUFFER_H
-
-#ifdef ZZCAN_GUESS
-#ifndef ZZINF_LOOK
-#define ZZINF_LOOK
-#endif
-#endif
-
-
-#define NLA (token_type[lap&(LLk-1)])/* --> next LA */
-
-typedef unsigned char SetWordType;
-
-/* Define external bit set stuff (for SetWordType) */
-#define EXT_WORDSIZE (sizeof(char)*8)
-#define EXT_LOGWORDSIZE 3
-
- /* s y n t a c t i c p r e d i c a t e s t u f f */
-
-#ifndef zzUSER_GUESS_HOOK
-#define zzUSER_GUESS_HOOK(seqFrozen,zzrv)
-#endif
-
-#ifndef zzUSER_GUESS_DONE_HOOK
-#define zzUSER_GUESS_DONE_HOOK(seqFrozen)
-#endif
-
-/* MR14 Add zzUSER_GUESS_FAIL_HOOK and related code */
-
-#define zzUSER_GUESS_FAIL_HOOK_INTERNAL zzUSER_GUESS_FAIL_HOOK(SeqFrozen)
-#ifndef zzUSER_GUESS_FAIL_HOOK
-#define zzUSER_GUESS_FAIL_HOOK(zzGuessSeq)
-#endif
-
-
-typedef struct _zzjmp_buf {
- jmp_buf state;
- } zzjmp_buf;
-
-/* these need to be macros not member functions */
-#define zzGUESS_BLOCK ANTLRParserState zzst; int zzrv; int _marker; int zzGuessSeqFrozen;
-#define zzNON_GUESS_MODE if ( !guessing )
-#define zzGUESS_FAIL guess_fail();
-
-/* Note: zzGUESS_DONE does not execute longjmp() */
-
-#define zzGUESS_DONE {zzrv=1; inputTokens->rewind(_marker); guess_done(&zzst);zzUSER_GUESS_DONE_HOOK(zzGuessSeqFrozen) }
-#define zzGUESS saveState(&zzst); \
- guessing = 1; \
- zzGuessSeqFrozen = ++zzGuessSeq; \
- _marker = inputTokens->mark(); \
- zzrv = setjmp(guess_start.state); \
- zzUSER_GUESS_HOOK(zzGuessSeqFrozen,zzrv) \
- if ( zzrv ) zzGUESS_DONE
-
-#define zzTRACEdata const ANTLRChar *zzTracePrevRuleName = NULL;
-
-#ifndef zzTRACEIN
-#define zzTRACEIN(r) zzTracePrevRuleName=traceCurrentRuleName;tracein(r);
-#endif
-#ifndef zzTRACEOUT
-#define zzTRACEOUT(r) traceout(r);traceCurrentRuleName=zzTracePrevRuleName;
-#endif
-
- /* a n t l r p a r s e r d e f */
-
-struct ANTLRParserState {
- /* class variables */
- zzjmp_buf guess_start;
- int guessing;
-
- int inf_labase;
- int inf_last;
-
- int dirty;
-
- int traceOptionValue; // MR10
- int traceGuessOptionValue; // MR10
- const ANTLRChar *traceCurrentRuleName; // MR10
- int traceDepth; // MR10
-
-};
-
-/* notes:
- *
- * multiple inheritance is a cool way to include what stuff is needed
- * in this structure (like guess stuff). however, i'm not convinced that
- * multiple inheritance works correctly on all platforms. not that
- * much space is used--just include all possibly useful members.
- *
- * the class should also be a template with arguments for the lookahead
- * depth and so on. that way, more than one parser can be defined (as
- * each will probably have different lookahead requirements). however,
- * am i sure that templates work? no, i'm not sure.
- *
- * no attributes are maintained and, hence, the 'asp' variable is not
- * needed. $i can still be referenced, but it refers to the token
- * associated with that rule element. question: where are the token's
- * stored if not on the software stack? in local variables created
- * and assigned to by antlr.
- */
-class ANTLRParser {
-protected:
- /* class variables */
- static SetWordType bitmask[sizeof(SetWordType)*8];
- static char eMsgBuffer[500];
-
-protected:
- int LLk; // number of lookahead symbols (old LL_K)
- int demand_look;
- ANTLRTokenType eofToken; // when do I stop during resynch()s
- int bsetsize; // size of bitsets created by ANTLR in
- // units of SetWordType
-
- ANTLRTokenBuffer *inputTokens; //place to get input tokens
-
- zzjmp_buf guess_start; // where to jump back to upon failure
- int guessing; // if guessing (using (...)? predicate)
-
- // infinite lookahead stuff
- int can_use_inf_look; // set by subclass (generated by ANTLR)
- int inf_lap;
- int inf_labase;
- int inf_last;
- int *_inf_line;
-
- const ANTLRChar **token_tbl; // pointer to table of token type strings MR20 const
-
- int dirty; // used during demand lookahead
-
- ANTLRTokenType *token_type; // fast reference cache of token.getType()
-// ANTLRLightweightToken **token; // the token with all its attributes
- int lap;
- int labase;
-#ifdef ZZDEFER_FETCH
- int stillToFetch; // MR19 V.H. Simonis
-#endif
-
-private:
- void fill_inf_look();
-
-protected:
- virtual void guess_fail() { // MR9 27-Sep-97 make virtual
- traceGuessFail(); // MR10
- longjmp(guess_start.state, 1); } // MR9
- virtual void guess_done(ANTLRParserState *st) { // MR9 27-Sep-97 make virtual
- restoreState(st); } // MR9
- virtual int guess(ANTLRParserState *); // MR9 27-Sep-97 make virtual
- void look(int);
- int _match(ANTLRTokenType, ANTLRChar **, ANTLRTokenType *,
- _ANTLRTokenPtr *, SetWordType **);
- int _setmatch(SetWordType *, ANTLRChar **, ANTLRTokenType *,
- _ANTLRTokenPtr *, SetWordType **,
- SetWordType * tokclassErrset /* MR23 */);
- int _match_wsig(ANTLRTokenType);
- int _setmatch_wsig(SetWordType *);
- virtual void consume();
- virtual void resynch(SetWordType *wd,SetWordType mask); // MR21
- void prime_lookahead();
- virtual void tracein(const ANTLRChar *r); // MR10
- virtual void traceout(const ANTLRChar *r); // MR10
- static unsigned MODWORD(unsigned x) {return x & (EXT_WORDSIZE-1);} // x % EXT_WORDSIZE // MR9
- static unsigned DIVWORD(unsigned x) {return x >> EXT_LOGWORDSIZE;} // x / EXT_WORDSIZE // MR9
- int set_deg(SetWordType *);
- int set_el(ANTLRTokenType, SetWordType *);
- virtual void edecode(SetWordType *); // MR1
- virtual void FAIL(int k, ...); // MR1
- int traceOptionValue; // MR10
- int traceGuessOptionValue; // MR10
- const ANTLRChar *traceCurrentRuleName; // MR10
- int traceDepth; // MR10
- void traceReset(); // MR10
- virtual void traceGuessFail(); // MR10
- virtual void traceGuessDone(const ANTLRParserState *); // MR10
- int zzGuessSeq; // MR10
-
-public:
- ANTLRParser(ANTLRTokenBuffer *,
- int k=1,
- int use_inf_look=0,
- int demand_look=0,
- int bsetsize=1);
- virtual ~ANTLRParser();
-
- virtual void init();
-
- ANTLRTokenType LA(int i)
- {
-//
-// MR14 demand look will always be 0 for C++ mode
-//
-//// return demand_look ? token_type[(labase+(i)-1)&(LLk-1)] :
-//// token_type[(lap+(i)-1)&(LLk-1)];
-
-// MR19 V.H. Simonis Defer fetch feature
-
-#ifdef ZZDEFER_FETCH
- undeferFetch();
-#endif
- return token_type[(lap+(i)-1)&(LLk-1)];
- }
- _ANTLRTokenPtr LT(int i);
-
- void setEofToken(ANTLRTokenType t) { eofToken = t; }
- ANTLRTokenType getEofToken() const { return eofToken; } // MR14
-
- void noGarbageCollectTokens() { inputTokens->noGarbageCollectTokens(); }
- void garbageCollectTokens() { inputTokens->garbageCollectTokens(); }
-
- virtual void syn(_ANTLRTokenPtr tok, ANTLRChar *egroup,
- SetWordType *eset, ANTLRTokenType etok, int k);
- virtual void saveState(ANTLRParserState *); // MR9 27-Sep-97 make virtual
- virtual void restoreState(ANTLRParserState *); // MR9 27-Sep-97 make virtual
-
- virtual void panic(const char *msg); // MR20 const
-
- static char *eMsgd(char *,int);
- static char *eMsg(char *,char *);
- static char *eMsg2(char *,char *,char *);
-
- virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23
- virtual int printMessageV(FILE* pFile, const char* pFormat, va_list arglist); // MR23
-
- void consumeUntil(SetWordType *st);
- void consumeUntilToken(int t);
-
- virtual int _setmatch_wdfltsig(SetWordType *tokensWanted,
- ANTLRTokenType tokenTypeOfSet,
- SetWordType *whatFollows);
- virtual int _match_wdfltsig(ANTLRTokenType tokenWanted,
- SetWordType *whatFollows);
-
- const ANTLRChar * parserTokenName(int tok); // MR1
-
- int traceOptionValueDefault; // MR11
- int traceOption(int delta); // MR11
- int traceGuessOption(int delta); // MR11
-
-// MR8 5-Aug-97 S.Bochnak@microtool.com.pl
-// MR8 Move resynch static local variable
-// MR8 to class instance
-
- int syntaxErrCount; // MR12
- ANTLRTokenStream *getLexer() const { // MR12
- return inputTokens ? inputTokens->getLexer() : 0; } // MR12
-protected: // MR8
- int resynchConsumed; // MR8
- char *zzFAILtext; // workarea required by zzFAIL // MR9
- void undeferFetch(); // MR19 V.H. Simonis
- int isDeferFetchEnabled(); // MR19 V.H. Simonis
- virtual void failedSemanticPredicate(const char* predicate); /* MR23 */
-};
-
-#define zzmatch(_t) \
- if ( !_match((ANTLRTokenType)_t, &zzMissText, &zzMissTok, \
- (_ANTLRTokenPtr *) &zzBadTok, &zzMissSet) ) goto fail;
-
-#define zzmatch_wsig(_t,handler) \
- if ( !_match_wsig((ANTLRTokenType)_t) ) if ( guessing ) zzGUESS_FAIL else {_signal=MismatchedToken; goto handler;}
-
-#define zzsetmatch(_ts,_tokclassErrset) \
- if ( !_setmatch(_ts, &zzMissText, &zzMissTok, \
- (_ANTLRTokenPtr *) &zzBadTok, &zzMissSet, _tokclassErrset) ) goto fail;
-
-#define zzsetmatch_wsig(_ts, handler) \
- if ( !_setmatch_wsig(_ts) ) if ( guessing ) zzGUESS_FAIL else {_signal=MismatchedToken; goto handler;}
-
-/* For the dflt signal matchers, a FALSE indicates that an error occurred
- * just like the other matchers, but in this case, the routine has already
- * recovered--we do NOT want to consume another token. However, when
- * the match was successful, we do want to consume hence _signal=0 so that
- * a token is consumed by the "if (!_signal) consume(); _signal=NoSignal;"
- * preamble.
- */
-#define zzsetmatch_wdfltsig(tokensWanted, tokenTypeOfSet, whatFollows) \
- if ( !_setmatch_wdfltsig(tokensWanted, tokenTypeOfSet, whatFollows) ) \
- _signal = MismatchedToken;
-
-#define zzmatch_wdfltsig(tokenWanted, whatFollows) \
- if ( !_match_wdfltsig(tokenWanted, whatFollows) ) _signal = MismatchedToken;
-
-
-// MR1 10-Apr-97 zzfailed_pred() macro does not backtrack in guess mode.
-// MR1 Identification and correction due to J. Lilley
-//
-// MR23 Call virtual method to report error.
-// MR23 Provide more control over failed predicate action
-// without any need for user to worry about guessing internals.
-
-#ifndef zzfailed_pred
-#define zzfailed_pred(_p,_hasuseraction,_useraction) \
- if (guessing) { \
- zzGUESS_FAIL; \
- } else { \
- zzfailed_pred_action(_p,_hasuseraction,_useraction) \
- }
-#endif
-
-// MR23 Provide more control over failed predicate action
-// without any need for user to worry about guessing internals.
-// _hasuseraction == 0 => no user specified error action
-// _hasuseraction == 1 => user specified error action
-
-#ifndef zzfailed_pred_action
-#define zzfailed_pred_action(_p,_hasuseraction,_useraction) \
- if (_hasuseraction) { _useraction } else { failedSemanticPredicate(_p); }
-#endif
-
-#define zzRULE \
- SetWordType *zzMissSet=NULL; ANTLRTokenType zzMissTok=(ANTLRTokenType)0; \
- _ANTLRTokenPtr zzBadTok=NULL; ANTLRChar *zzBadText=(ANTLRChar *)""; \
- int zzErrk=1,zzpf=0; \
- zzTRACEdata \
- ANTLRChar *zzMissText=(ANTLRChar *)"";
-
-#endif
-
- /* S t a n d a r d E x c e p t i o n S i g n a l s */
-
-#define NoSignal 0
-#define MismatchedToken 1
-#define NoViableAlt 2
-#define NoSemViableAlt 3
-
-/* MR7 Allow more control over signalling */
-/* by adding "Unwind" and "SetSignal" */
-
-#define Unwind 4
-#define setSignal(newValue) *_retsignal=_signal=(newValue)
-#define suppressSignal *_retsignal=_signal=0
-#define exportSignal *_retsignal=_signal
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ASTBase.cpp b/BaseTools/Source/C/VfrCompile/Pccts/h/ASTBase.cpp
deleted file mode 100644
index a94f080c86..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/ASTBase.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-/* Abstract syntax tree manipulation functions
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#include "pcctscfg.h"
-
-#include "pccts_stdio.h"
-#include "pccts_stdarg.h"
-
-PCCTS_NAMESPACE_STD
-
-#define ANTLR_SUPPORT_CODE
-
-#include "ASTBase.h"
-
-/* ensure that tree manipulation variables are current after a rule
- * reference
- */
-void
-ASTBase::link(ASTBase **_root, ASTBase **_sibling, ASTBase **_tail)
-{
- if ( *_sibling == NULL ) return;
- if ( *_root == NULL ) *_root = *_sibling;
- else if ( *_root != *_sibling ) (*_root)->_down = *_sibling;
- if ( *_tail==NULL ) *_tail = *_sibling;
- while ( (*_tail)->_right != NULL ) *_tail = (*_tail)->_right;
-}
-
-/* add a child node to the current sibling list */
-void
-ASTBase::subchild(ASTBase **_root, ASTBase **_sibling, ASTBase **_tail)
-{
- if ( *_tail != NULL ) (*_tail)->_right = this;
- else {
- *_sibling = this;
- if ( *_root != NULL ) (*_root)->_down = *_sibling;
- }
- *_tail = this;
- if ( *_root == NULL ) *_root = *_sibling;
-}
-
-/* make a new AST node. Make the newly-created
- * node the root for the current sibling list. If a root node already
- * exists, make the newly-created node the root of the current root.
- */
-void
-ASTBase::subroot(ASTBase **_root, ASTBase **_sibling, ASTBase **_tail)
-{
- if ( *_root != NULL )
- if ( (*_root)->_down == *_sibling ) *_sibling = *_tail = *_root;
- *_root = this;
- (*_root)->_down = *_sibling;
-}
-
-/* Apply preorder_action(), etc.. to root then each sibling */
-//
-// 7-Apr-97 133MR1
-// Fix suggested by Ron House (house@helios.usq.edu.au)
-//
-void
-ASTBase::preorder(void* pData /*= NULL*/ /* MR23 */)
-{
- ASTBase *tree = this;
-
- while ( tree!= NULL )
- {
- if ( tree->_down != NULL ) {
- tree->preorder_before_action(pData); // MR1
- };
- tree->preorder_action(pData);
- if ( tree->_down!=NULL )
- {
- tree->_down->preorder(pData);
- tree->preorder_after_action(pData); // MR1
- }
- tree = tree->_right;
- }
-}
-
-/* free all AST nodes in tree; apply func to each before freeing */
-void
-ASTBase::destroy()
-{
- ASTBase* tree = this;
- while (tree) {
- if (tree->_down) tree->_down->destroy();
-
- ASTBase* cur = tree;
- tree = tree->_right;
- delete cur;
- }
-}
-
-/* build a tree (root child1 child2 ... NULL)
- * If root is NULL, simply make the children siblings and return ptr
- * to 1st sibling (child1). If root is not single node, return NULL.
- *
- * Siblings that are actually siblins lists themselves are handled
- * correctly. For example #( NULL, #( NULL, A, B, C), D) results
- * in the tree ( NULL A B C D ).
- *
- * Requires at least two parameters with the last one being NULL. If
- * both are NULL, return NULL.
- */
-ASTBase *
-ASTBase::tmake(ASTBase *root, ...)
-{
- va_list ap;
- register ASTBase *child, *sibling=NULL, *tail=NULL /*MR23*/, *w;
-
- va_start(ap, root);
-
- if ( root != NULL )
- if ( root->_down != NULL ) {
- root->reportOverwriteOfDownPointer(); /* MR21 Report problem which almost always an error */
- return NULL;
- }
- child = va_arg(ap, ASTBase *);
- while ( child != NULL )
- {
- for (w=child; w->_right!=NULL; w=w->_right) {;} /* find end of child */
- if ( sibling == NULL ) {sibling = child; tail = w;}
- else {tail->_right = child; tail = w;}
- child = va_arg(ap, ASTBase *);
- }
- if ( root==NULL ) root = sibling;
- else root->_down = sibling;
- va_end(ap);
- return root;
-}
-
-#ifndef PCCTS_NOT_USING_SOR
-
-/* tree duplicate */
-// forgot to check for NULL this (TJP July 23,1995)
-ASTBase *
-ASTBase::dup()
-{
- ASTBase *u, *t=this;
-
- if ( t == NULL ) return NULL;
-/*
- u = new ASTBase;
- *u = *t;
-*/
- u = (ASTBase *)this->shallowCopy();
- if ( t->_right!=NULL ) u->_right = t->_right->dup();
- else u->_right = NULL;
- if ( t->_down!=NULL ) u->_down = t->_down->dup();
- else u->_down = NULL;
- return u;
-}
-#endif
-
-//
-// 7-Apr-97 133MR1
-// Fix suggested by Asgeir Olafsson (olafsson@cstar.ac.com)
-//
-/* tree duplicate */
-
-#ifndef PCCTS_NOT_USING_SOR
-
-ASTBase *
-ASTDoublyLinkedBase::dup()
-{
- ASTDoublyLinkedBase *u, *t=this;
-
- if ( t == NULL ) return NULL;
- u = (ASTDoublyLinkedBase *)this->shallowCopy();
- u->_up = NULL; /* set by calling invocation */
- u->_left = NULL;
- if (t->_right!=NULL) { // MR1
- u->_right=t->_right->dup(); // MR1
- ((ASTDoublyLinkedBase *)u->_right)->_left = u; // MR1
- } else { // MR1
- u->_right = NULL; // MR1
- }; // MR1
- if (t->_down!=NULL) { // MR1
- u->_down = t->_down->dup(); // MR1
- ((ASTDoublyLinkedBase *)u->_down)->_up = u; // MR1
- } else { // MR1
- u->_down = NULL; // MR1
- }; // MR1
- return u;
-}
-
-#endif
-
-/*
- * Set the 'up', and 'left' pointers of all nodes in 't'.
- * Initial call is double_link(your_tree, NULL, NULL).
- */
-void
-ASTDoublyLinkedBase::double_link(ASTBase *left, ASTBase *up)
-{
- ASTDoublyLinkedBase *t = this;
-
- t->_left = (ASTDoublyLinkedBase *) left;
- t->_up = (ASTDoublyLinkedBase *) up;
- if (t->_down != NULL)
- ((ASTDoublyLinkedBase *)t->_down)->double_link(NULL, t);
- if (t->_right != NULL)
- ((ASTDoublyLinkedBase *)t->_right)->double_link(t, up);
-}
-
-// MR21 ASTBase::reportOverwriteOfDownPointer
-
-void ASTBase::reportOverwriteOfDownPointer()
-{
- panic("Attempt to overwrite down pointer in ASTBase::tmake");
-}
-
-// MR21 ASTBase::panic
-
-void ASTBase::panic(const char *msg)
-{
- /* MR23 */ printMessage(stderr,"ASTBase panic: %s\n", msg);
- exit(PCCTS_EXIT_FAILURE);
-}
-
-#ifdef PCCTS_NOT_USING_SOR
-//MR23
-int ASTBase::printMessage(FILE* pFile, const char* pFormat, ...)
-{
- va_list marker;
- va_start( marker, pFormat );
- int iRet = vfprintf(pFile, pFormat, marker);
- va_end( marker );
- return iRet;
-}
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ASTBase.h b/BaseTools/Source/C/VfrCompile/Pccts/h/ASTBase.h
deleted file mode 100644
index 912f4b8482..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/ASTBase.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Abstract syntax tree
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ASTBase_H
-#define ASTBase_H
-
-#include "pcctscfg.h"
-
-#include "pccts_stdio.h"
-#include "pccts_stdlib.h"
-
-PCCTS_NAMESPACE_STD
-
-#ifndef PCCTS_NOT_USING_SOR
-#include "PCCTSAST.h"
-#endif
-
-/*
- * Notes:
- *
- * To specify a copy constructor, subclass one of these classes and
- * give the copy constructor. To use dup(), you must define shallowCopy().
- * shallowCopy() can use either a copy constructor or just copy the node
- * itself.
- */
-
-#ifdef PCCTS_NOT_USING_SOR
-class DllExportPCCTS ASTBase {
-#else
-class DllExportPCCTS ASTBase : public PCCTS_AST {
-#endif
-
-protected:
- ASTBase *_right, *_down;
-
-public:
-
-#ifdef PCCTS_NOT_USING_SOR
- ASTBase *right() { return _right; }
- ASTBase *down() { return _down; }
- void setRight(ASTBase *t) { _right = (ASTBase *)t; }
- void setDown(ASTBase *t) { _down = (ASTBase *)t; }
-#else
- PCCTS_AST *right() { return _right; } // define the SORCERER interface
- PCCTS_AST *down() { return _down; }
- void setRight(PCCTS_AST *t) { _right = (ASTBase *)t; }
- void setDown(PCCTS_AST *t) { _down = (ASTBase *)t; }
-#endif
- ASTBase() { _right = _down = NULL; }
- virtual ~ASTBase() { ; }
-#ifndef PCCTS_NOT_USING_SOR
- virtual ASTBase *dup();
-#endif
- void destroy();
- void preorder(void* pData = NULL /* MR23 */);
- static ASTBase *tmake(ASTBase *, ...);
- static void link(ASTBase **, ASTBase **, ASTBase **);
- void subchild(ASTBase **, ASTBase **, ASTBase **);
- void subroot(ASTBase **, ASTBase **, ASTBase **);
- virtual void preorder_action(void* /*pData*/ = NULL /* MR23 */) { ; }
- virtual void preorder_before_action(void* /*pData*/ = NULL /* MR23 */) { /* MR23 */ printMessage(stdout, " ("); }
- virtual void preorder_after_action(void* /*pData*/ = NULL /* MR23 */) { /* MR23 */ printMessage(stdout, " )"); }
- virtual void panic(const char *msg); /* MR21 */
- virtual void reportOverwriteOfDownPointer(); /* MR21 */
-#ifdef PCCTS_NOT_USING_SOR
- virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23
-#endif
-};
-
-class DllExportPCCTS ASTDoublyLinkedBase : public ASTBase {
-protected:
- ASTDoublyLinkedBase *_left, *_up;
-
-public:
- void double_link(ASTBase *left, ASTBase *up);
-
-#ifndef PCCTS_NOT_USING_SOR
- virtual ASTBase *dup();
-#endif
-
-#ifdef PCCTS_NOT_USING_SOR
- ASTBase *left() { return _left; }
- ASTBase *up() { return _up; }
- void setLeft(ASTBase *t) { _left = (ASTDoublyLinkedBase *)t; } // MR6
- void setUp(ASTBase *t) { _up = (ASTDoublyLinkedBase *)t; } // MR6
-#else
- PCCTS_AST *left() { return _left; }
- PCCTS_AST *up() { return _up; }
- void setLeft(PCCTS_AST *t) { _left = (ASTDoublyLinkedBase *)t; } // MR6
- void setUp(PCCTS_AST *t) { _up = (ASTDoublyLinkedBase *)t; } // MR6
-#endif
-
-};
-
-class AST; // announce that this class will be coming along shortly
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtr.h b/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtr.h
deleted file mode 100644
index 75b4c86cbf..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtr.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ATokPtr.h
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Written by Russell Quong June 30, 1995
- * Adapted by Terence Parr to ANTLR stuff
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ATokPtr_h
-#define ATokPtr_h
-
-#include "pcctscfg.h"
-
-#include "pccts_stdio.h"
-
-PCCTS_NAMESPACE_STD
-
-// pointer to a reference counted object
-// robust in that an unused ANTLRTokenPtr can point to NULL.
-
-class ANTLRAbstractToken;
-
-class DllExportPCCTS ANTLRTokenPtr {
-public:
- ANTLRTokenPtr(ANTLRAbstractToken *addr=NULL){ptr_ = addr; ref();}
- ANTLRTokenPtr(const ANTLRTokenPtr &lhs) {ptr_ = lhs.ptr_; lhs.ref();}
- ~ANTLRTokenPtr();
-
- // use ANTLRTokenPtr as a pointer to ANTLRToken
-//
-// 8-Apr-97 MR1 Make operator -> a const member function
-// as well as some other member functions
-//
- ANTLRAbstractToken *operator-> () const { return ptr_; } // MR1
-//
-// 7-Apr-97 133MR1
-// Fix suggested by Andreas Magnusson
-// (Andreas.Magnusson@mailbox.swipnet.se)
- void operator = (const ANTLRTokenPtr & lhs); // MR1
- void operator = (ANTLRAbstractToken *addr);
- int operator != (const ANTLRTokenPtr &q) const // MR1 // MR11 unsigned -> int
- { return this->ptr_ != q.ptr_; }
- int operator == (const ANTLRTokenPtr &q) const // MR1 // MR11 unsigned -> int
- { return this->ptr_ == q.ptr_; }
- int operator == (const ANTLRAbstractToken *addr) const // MR11
- { return this->ptr_ == addr; }
- int operator != (const ANTLRAbstractToken *addr) const // MR11
- { return this->ptr_ != addr; }
-
- void ref() const;
- void deref();
-
-protected:
- ANTLRAbstractToken *ptr_;
-};
-
-//typedef ANTLRTokenPtr _ANTLRTokenPtr;
-
-/*
- * Since you cannot redefine operator->() to return one of the user's
- * token object types, we must down cast. This is a drag. Here's
- * a macro that helps. template: "mytoken(a-smart-ptr)->myfield".
- */
-#define mytoken(tk) ((ANTLRToken *)(tk.operator->()))
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtrImpl.h b/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtrImpl.h
deleted file mode 100644
index 9c07cf52a9..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtrImpl.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * ATokPtrImpl.h (formerly ATokPtr.cpp)
- *
- * This is #included in ATokBuffer.cpp for historical reasons.
- * It has been renamed because of problems with the .cpp extension
- * when used with IDE.
- *
- *
- * ANTLRToken MUST be defined before entry to this file.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Written by Russell Quong June 30, 1995
- * Adapted by Terence Parr to ANTLR stuff
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#include "pcctscfg.h"
-
-PCCTS_NAMESPACE_STD
-
-#include "ATokPtr.h"
-
-void ANTLRTokenPtr::ref() const
-{
- if (ptr_ != NULL) {
- ptr_->ref();
- }
-}
-
-void ANTLRTokenPtr::deref()
-{
- if (ptr_ != NULL)
- {
- ptr_->deref();
- if ( ptr_->nref()==0 )
- {
- delete ptr_;
- ptr_ = NULL;
- }
- }
-}
-
-ANTLRTokenPtr::~ANTLRTokenPtr()
-{
- deref();
-}
-
-//
-// 8-Apr-97 MR1 Make operator -> a const member function
-// as weall as some other member functions
-//
-void ANTLRTokenPtr::operator = (const ANTLRTokenPtr & lhs) // MR1
-{
- lhs.ref(); // protect against "xp = xp"; ie same underlying object
- deref();
- ptr_ = lhs.ptr_;
-}
-
-void ANTLRTokenPtr::operator = (ANTLRAbstractToken *addr)
-{
- if (addr != NULL) {
- addr->ref();
- }
- deref();
- ptr_ = addr;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h b/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h
deleted file mode 100644
index 6167c21ef5..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/AToken.h
+++ /dev/null
@@ -1,325 +0,0 @@
-/* ANTLRToken.h
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ATOKEN_H_GATE
-#define ATOKEN_H_GATE
-
-#include "pcctscfg.h"
-
-#include "pccts_string.h"
-#include "pccts_stdio.h"
-#include "pccts_stdlib.h"
-#include "pccts_stdarg.h" // MR23
-
-PCCTS_NAMESPACE_STD
-
-// MR9 RJV (JVincent@novell.com) Not needed for variable length strings
-
-//// MR9 #ifndef ANTLRCommonTokenTEXTSIZE
-//// MR9 #define ANTLRCommonTokenTEXTSIZE 100
-//// MR9 #endif
-
-
-/* must define what a char looks like; can make this a class too */
-typedef char ANTLRChar;
-
-/* D E F I N E S M A R T P O I N T E R S */
-
-//#include ATOKPTR_H not tested yet, leave out
-class ANTLRAbstractToken;
-typedef ANTLRAbstractToken *_ANTLRTokenPtr;
-
-class ANTLRAbstractToken {
-public:
- virtual ~ANTLRAbstractToken() {;}
- virtual ANTLRTokenType getType() const = 0;
- virtual void setType(ANTLRTokenType t) = 0;
- virtual int getLine() const = 0;
- virtual void setLine(int line) = 0;
- virtual ANTLRChar *getText() const = 0;
- virtual void setText(const ANTLRChar *) = 0;
-
- /* This function will disappear when I can use templates */
- virtual ANTLRAbstractToken *makeToken(ANTLRTokenType tt,
- ANTLRChar *text,
- int line) = 0;
-
- /* define to satisfy ANTLRTokenBuffer's need to determine whether or
- not a token object can be destroyed. If nref()==0, no one has
- a reference, and the object may be destroyed. This function defaults
- to 1, hence, if you use deleteTokens() message with a token object
- not derived from ANTLRCommonRefCountToken, the parser will compile
- but will not delete objects after they leave the token buffer.
- */
-
- virtual unsigned nref() const { return 1; } // MR11
- virtual void ref() {;}
- virtual void deref() {;}
-
- virtual void panic(const char *msg) // MR20 const
- {
- /* MR23 */ printMessage(stderr, "ANTLRAbstractToken panic: %s\n", msg);
- exit(PCCTS_EXIT_FAILURE);
- }
-
- virtual int printMessage(FILE* pFile, const char* pFormat, ...) // MR23
- {
- va_list marker;
- va_start( marker, pFormat );
- int iRet = vfprintf(pFile, pFormat, marker);
- va_end( marker );
- return iRet;
- }
-};
-
-/* This class should be subclassed. It cannot store token type or text */
-
-class ANTLRRefCountToken : public ANTLRAbstractToken {
-public:
-#ifdef DBG_REFCOUNTTOKEN
- static int ctor;
- static int dtor;
-#endif
-protected:
- unsigned refcnt_;
-#ifdef DBG_REFCOUNTTOKEN
- char object[200];
-#endif
-
-public:
-
- // MR23 - No matter what you do, you're hammered.
- // Don't give names to formals something breaks.
- // Give names to formals and don't use them it breaks.
-
-#ifndef DBG_REFCOUNTTOKEN
- ANTLRRefCountToken(ANTLRTokenType /* t MR23 */, const ANTLRChar * /* s MR23 */)
-#else
- ANTLRRefCountToken(ANTLRTokenType t, const ANTLRChar * s)
-#endif
-
-#ifndef DBG_REFCOUNTTOKEN
- {
- refcnt_ = 0;
- }
-#else
- {
- ctor++;
- refcnt_ = 0;
- if ( t==1 ) sprintf(object,"tok_EOF");
- else sprintf(object,"tok_%s",s);
- /* MR23 */ printMessage(stderr, "ctor %s #%d\n",object,ctor);
- }
-#endif
- ANTLRRefCountToken()
-#ifndef DBG_REFCOUNTTOKEN
- { refcnt_ = 0; }
-#else
- {
- ctor++;
- refcnt_ = 0;
- sprintf(object,"tok_blank");
- /* MR23 */ printMessage(stderr, "ctor %s #%d\n",object,ctor);
- }
- virtual ~ANTLRRefCountToken()
- {
- dtor++;
- if ( dtor>ctor ) /* MR23 */ printMessage(stderr, "WARNING: dtor>ctor\n");
- /* MR23 */ printMessage(stderr, "dtor %s #%d\n", object, dtor);
- object[0]='\0';
- }
-#endif
-
- // reference counting stuff needed by ANTLRTokenPtr.
- // User should not access these; for C++ language reasons, we had
- // to make these public. Yuck.
-
- void ref() { refcnt_++; }
- void deref() { refcnt_--; }
- unsigned nref() const { return refcnt_; } // MR11
-
- virtual ANTLRAbstractToken *makeToken(ANTLRTokenType /*tt MR23*/,
- ANTLRChar * /*txt MR23*/,
- int /*line MR23*/)
- {
- panic("call to ANTLRRefCountToken::makeToken()\n");
- return NULL;
- }
-};
-
-class ANTLRCommonNoRefCountToken : public ANTLRAbstractToken {
-protected:
- ANTLRTokenType _type;
- int _line;
- ANTLRChar *_text; // MR9 RJV
-
-public:
- ANTLRCommonNoRefCountToken(ANTLRTokenType t, const ANTLRChar *s)
- { setType(t); _line = 0; _text = NULL; setText(s); }
- ANTLRCommonNoRefCountToken()
- { setType((ANTLRTokenType)0); _line = 0; _text = NULL; setText(""); }
-
- ~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string
-
- ANTLRTokenType getType() const { return _type; }
- void setType(ANTLRTokenType t) { _type = t; }
- virtual int getLine() const { return _line; }
- void setLine(int line) { _line = line; }
- ANTLRChar *getText() const { return _text; }
- int getLength() const { return strlen(getText()); } // MR11
-
-// MR9 RJV: Added code for variable length strings to setText()
-
- void setText(const ANTLRChar *s)
- { if (s != _text) {
- if (_text) delete [] _text;
- if (s != NULL) {
- _text = new ANTLRChar[strlen(s)+1];
- if (_text == NULL) panic("ANTLRCommonNoRefCountToken::setText new failed");
- strcpy(_text,s);
- } else {
- _text = new ANTLRChar[1];
- if (_text == NULL) panic("ANTLRCommonNoRefCountToken::setText new failed");
- strcpy(_text,"");
- };
- };
- }
-
- virtual ANTLRAbstractToken *makeToken(ANTLRTokenType tt,
- ANTLRChar *txt,
- int line)
- {
- ANTLRAbstractToken *t = new ANTLRCommonNoRefCountToken;
- t->setType(tt); t->setText(txt); t->setLine(line);
- return t;
- }
-
-// MR9 THM Copy constructor required when heap allocated string is used with copy semantics
-
- ANTLRCommonNoRefCountToken (const ANTLRCommonNoRefCountToken& from) :
- ANTLRAbstractToken(from) {
- setType(from._type);
- setLine(from._line);
- _text=NULL;
- setText(from._text);
- };
-
-// MR9 THM operator =() required when heap allocated string is used with copy semantics
-
- virtual ANTLRCommonNoRefCountToken& operator =(const ANTLRCommonNoRefCountToken& rhs) {
-
-////// MR15 WatCom can't hack use of operator =()
-////// Use this: *( (ANTRLAbstractToken *) this)=rhs;
-
- *( (ANTLRAbstractToken *) this ) = rhs;
-
- setType(rhs._type);
- setLine(rhs._line);
- setText(rhs._text);
- return *this;
- };
-};
-
-class ANTLRCommonToken : public ANTLRRefCountToken {
-protected:
- ANTLRTokenType _type;
- int _line;
- ANTLRChar *_text; // MR9 RJV:Added
-
-public:
- ANTLRCommonToken(ANTLRTokenType t, const ANTLRChar *s) : ANTLRRefCountToken(t,s)
- { setType(t); _line = 0; _text = NULL; setText(s); } // MR9
- ANTLRCommonToken()
- { setType((ANTLRTokenType)0); _line = 0; _text = NULL; setText(""); } // MR9
-
- virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string
-
- ANTLRTokenType getType() const { return _type; }
- void setType(ANTLRTokenType t) { _type = t; }
- virtual int getLine() const { return _line; }
- void setLine(int line) { _line = line; }
- ANTLRChar *getText() const { return _text; }
- int getLength() const { return strlen(getText()); } // MR11
-
-// MR9 RJV: Added code for variable length strings to setText()
-
- void setText(const ANTLRChar *s)
- { if (s != _text) {
- if (_text) delete [] _text;
- if (s != NULL) {
- _text = new ANTLRChar[strlen(s)+1];
- if (_text == NULL) panic("ANTLRCommonToken::setText new failed");
- strcpy(_text,s);
- } else {
- _text = new ANTLRChar[1];
- if (_text == NULL) panic("ANTLRCommonToken::setText new failed");
- strcpy(_text,"");
- };
- };
- }
-
- virtual ANTLRAbstractToken *makeToken(ANTLRTokenType tt,
- ANTLRChar *txt,
- int line)
- {
- ANTLRAbstractToken *t = new ANTLRCommonToken(tt,txt);
- t->setLine(line);
- return t;
- }
-
-// MR9 THM Copy constructor required when heap allocated string is used with copy semantics
-
- ANTLRCommonToken (const ANTLRCommonToken& from) :
- ANTLRRefCountToken(from) {
- setType(from._type);
- setLine(from._line);
- _text=NULL;
- setText(from._text);
- };
-
-// MR9 THM operator =() required when heap allocated string is used with copy semantics
-
- virtual ANTLRCommonToken& operator =(const ANTLRCommonToken& rhs) {
-
-////// MR15 WatCom can't hack use of operator =()
-////// Use this instead: *( (ANTRLRRefCountToken *) this)=rhs;
-
- *( (ANTLRRefCountToken *) this) = rhs;
-
- setType(rhs._type);
- setLine(rhs._line);
- setText(rhs._text);
- return *this;
- };
-};
-
-// used for backward compatibility
-typedef ANTLRCommonToken ANTLRCommonBacktrackingToken;
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokenBuffer.cpp b/BaseTools/Source/C/VfrCompile/Pccts/h/ATokenBuffer.cpp
deleted file mode 100644
index 9a2f2fc88b..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokenBuffer.cpp
+++ /dev/null
@@ -1,374 +0,0 @@
-/* ANTLRTokenBuffer.cpp
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-typedef int ANTLRTokenType; // fool AToken.h into compiling
-
-class ANTLRParser; /* MR1 */
-
-#define ANTLR_SUPPORT_CODE
-
-#include "pcctscfg.h"
-
-#include ATOKENBUFFER_H
-#include APARSER_H // MR23
-
-typedef ANTLRAbstractToken *_ANTLRTokenPtr;
-
-#if defined(DBG_TBUF)||defined(DBG_TBUF_MARK_REW)
-static unsigned char test[1000];
-#endif
-
-#ifdef DBG_REFCOUNTTOKEN
-int ANTLRRefCountToken::ctor = 0; /* MR23 */
-int ANTLRRefCountToken::dtor = 0; /* MR23 */
-#endif
-
-ANTLRTokenBuffer::
-ANTLRTokenBuffer(ANTLRTokenStream *_input, int _k, int _chunk_size_formal) /* MR14 */
-{
- this->input = _input;
- this->k = _k;
- buffer_size = chunk_size = _chunk_size_formal;
- buffer = (_ANTLRTokenPtr *)
- calloc(chunk_size+1,sizeof(_ANTLRTokenPtr ));
- if ( buffer == NULL ) {
- panic("cannot alloc token buffer");
- }
- buffer++; // leave the first elem empty so tp-1 is valid ptr
-
- tp = &buffer[0];
- last = tp-1;
- next = &buffer[0];
- num_markers = 0;
- end_of_buffer = &buffer[buffer_size-1];
- threshold = &buffer[(int)(buffer_size/2)]; // MR23 - Used to be 1.0/2.0 !
- _deleteTokens = 1; // assume we delete tokens
- parser=NULL; // MR5 - uninitialized reference
-}
-
-static void f() {;}
-ANTLRTokenBuffer::
-~ANTLRTokenBuffer()
-{
- f();
- // Delete all remaining tokens (from 0..last inclusive)
- if ( _deleteTokens )
- {
- _ANTLRTokenPtr *z;
- for (z=buffer; z<=last; z++)
- {
- (*z)->deref();
-// z->deref();
-#ifdef DBG_REFCOUNTTOKEN
- /* MR23 */ printMessage(stderr, "##########dtor: deleting token '%s' (ref %d)\n",
- ((ANTLRCommonToken *)*z)->getText(), (*z)->nref());
-#endif
- if ( (*z)->nref()==0 )
- {
- delete (*z);
- }
- }
- }
-
- if ( buffer!=NULL ) free((char *)(buffer-1));
-}
-
-#if defined(DBG_TBUF)||defined(DBG_TBUF_MARK_REW)
-#include "pccts_stdio.h"
-PCCTS_NAMESPACE_STD
-#endif
-
-_ANTLRTokenPtr ANTLRTokenBuffer::
-getToken()
-{
- if ( tp <= last ) // is there any buffered lookahead still to be read?
- {
- return *tp++; // read buffered lookahead
- }
- // out of buffered lookahead, get some more "real"
- // input from getANTLRToken()
- if ( num_markers==0 )
- {
- if( next > threshold )
- {
-#ifdef DBG_TBUF
-/* MR23 */ printMessage(stderr,"getToken: next > threshold (high water is %d)\n", threshold-buffer);
-#endif
- makeRoom();
- }
- }
- else {
- if ( next > end_of_buffer )
- {
-#ifdef DBG_TBUF
-/* MR23 */ printMessage(stderr,"getToken: next > end_of_buffer (size is %d)\n", buffer_size);
-#endif
- extendBuffer();
- }
- }
- *next = getANTLRToken();
- (*next)->ref(); // say we have a copy of this pointer in buffer
- last = next;
- next++;
- tp = last;
- return *tp++;
-}
-
-void ANTLRTokenBuffer::
-rewind(int pos)
-{
-#if defined(DBG_TBUF)||defined(DBG_TBUF_MARK_REW)
- /* MR23 */ printMessage(stderr, "rewind(%d)[nm=%d,from=%d,%d.n=%d]\n", pos, num_markers, tp-buffer,pos,test[pos]);
- test[pos]--;
-#endif
- tp = &buffer[pos];
- num_markers--;
-}
-
-/*
- * This function is used to specify that the token pointers read
- * by the ANTLRTokenBuffer should be buffered up (to be reused later).
- */
-int ANTLRTokenBuffer::
-mark()
-{
-#if defined(DBG_TBUF)||defined(DBG_TBUF_MARK_REW)
- test[tp-buffer]++;
- /* MR23 */ printMessage(stderr,"mark(%d)[nm=%d,%d.n=%d]\n",tp-buffer,num_markers+1,tp-buffer,test[tp-buffer]);
-#endif
- num_markers++;
- return tp - buffer;
-}
-
-/*
- * returns the token pointer n positions ahead.
- * This implies that bufferedToken(1) gets the NEXT symbol of lookahead.
- * This is used in conjunction with the ANTLRParser lookahead buffer.
- *
- * No markers are set or anything. A bunch of input is buffered--that's all.
- * The tp pointer is left alone as the lookahead has not been advanced
- * with getToken(). The next call to getToken() will find a token
- * in the buffer and won't have to call getANTLRToken().
- *
- * If this is called before a consume() is done, how_many_more_i_need is
- * set to 'n'.
- */
-_ANTLRTokenPtr ANTLRTokenBuffer::
-bufferedToken(int n)
-{
-// int how_many_more_i_need = (last-tp < 0) ? n : n-(last-tp)-1;
- int how_many_more_i_need = (tp > last) ? n : n-(last-tp)-1;
- // Make sure that at least n tokens are available in the buffer
-#ifdef DBG_TBUF
- /* MR23 */ printMessage(stderr, "bufferedToken(%d)\n", n);
-#endif
- for (int i=1; i<=how_many_more_i_need; i++)
- {
- if ( next > end_of_buffer ) // buffer overflow?
- {
- extendBuffer();
- }
- *next = getANTLRToken();
- (*next)->ref(); // say we have a copy of this pointer in buffer
- last = next;
- next++;
- }
- return tp[n - 1];
-}
-
-/* If no markers are set, the none of the input needs to be saved (except
- * for the lookahead Token pointers). We save only k-1 token pointers as
- * we are guaranteed to do a getANTLRToken() right after this because otherwise
- * we wouldn't have needed to extend the buffer.
- *
- * If there are markers in the buffer, we need to save things and so
- * extendBuffer() is called.
- */
-void ANTLRTokenBuffer::
-makeRoom()
-{
-#ifdef DBG_TBUF
- /* MR23 */ printMessage(stderr, "in makeRoom.................\n");
- /* MR23 */ printMessage(stderr, "num_markers==%d\n", num_markers);
-#endif
-/*
- if ( num_markers == 0 )
- {
-*/
-#ifdef DBG_TBUF
- /* MR23 */ printMessage(stderr, "moving lookahead and resetting next\n");
-
- _ANTLRTokenPtr *r;
- /* MR23 */ printMessage(stderr, "tbuf = [");
- for (r=buffer; r<=last; r++)
- {
- if ( *r==NULL ) /* MR23 */ printMessage(stderr, " xxx");
- else /* MR23 */ printMessage(stderr, " '%s'", ((ANTLRCommonToken *)*r)->getText());
- }
- /* MR23 */ printMessage(stderr, " ]\n");
-
- /* MR23 */ printMessage(stderr,
- "before: tp=%d, last=%d, next=%d, threshold=%d\n",tp-buffer,last-buffer,next-buffer,threshold-buffer);
-#endif
-
- // Delete all tokens from 0..last-(k-1) inclusive
- if ( _deleteTokens )
- {
- _ANTLRTokenPtr *z;
- for (z=buffer; z<=last-(k-1); z++)
- {
- (*z)->deref();
-// z->deref();
-#ifdef DBG_REFCOUNTTOKEN
- /* MR23 */ printMessage(stderr, "##########makeRoom: deleting token '%s' (ref %d)\n",
- ((ANTLRCommonToken *)*z)->getText(), (*z)->nref());
-#endif
- if ( (*z)->nref()==0 )
- {
- delete (*z);
- }
- }
- }
-
- // reset the buffer to initial conditions, but move k-1 symbols
- // to the beginning of buffer and put new input symbol at k
- _ANTLRTokenPtr *p = buffer, *q = last-(k-1)+1;
-// ANTLRAbstractToken **p = buffer, **q = end_of_buffer-(k-1)+1;
-#ifdef DBG_TBUF
- /* MR23 */ printMessage(stderr, "lookahead buffer = [");
-#endif
- for (int i=1; i<=(k-1); i++)
- {
- *p++ = *q++;
-#ifdef DBG_TBUF
- /* MR23 */ printMessage(stderr,
- " '%s'", ((ANTLRCommonToken *)buffer[i-1])->getText());
-#endif
- }
-#ifdef DBG_TBUF
- /* MR23 */ printMessage(stderr, " ]\n");
-#endif
- next = &buffer[k-1];
- tp = &buffer[k-1]; // tp points to what will be filled in next
- last = tp-1;
-#ifdef DBG_TBUF
- /* MR23 */ printMessage(stderr,
- "after: tp=%d, last=%d, next=%d\n",
- tp-buffer, last-buffer, next-buffer);
-#endif
-/*
- }
- else {
- extendBuffer();
- }
-*/
-}
-
-/* This function extends 'buffer' by chunk_size and returns with all
- * pointers at the same relative positions in the buffer (the buffer base
- * address could have changed in realloc()) except that 'next' comes
- * back set to where the next token should be stored. All other pointers
- * are untouched.
- */
-void
-ANTLRTokenBuffer::
-extendBuffer()
-{
- int save_last = last-buffer, save_tp = tp-buffer, save_next = next-buffer;
-#ifdef DBG_TBUF
- /* MR23 */ printMessage(stderr, "extending physical buffer\n");
-#endif
- buffer_size += chunk_size;
- buffer = (_ANTLRTokenPtr *)
- realloc((char *)(buffer-1),
- (buffer_size+1)*sizeof(_ANTLRTokenPtr ));
- if ( buffer == NULL ) {
- panic("cannot alloc token buffer");
- }
- buffer++; // leave the first elem empty so tp-1 is valid ptr
-
- tp = buffer + save_tp; // put the pointers back to same relative position
- last = buffer + save_last;
- next = buffer + save_next;
- end_of_buffer = &buffer[buffer_size-1];
- threshold = &buffer[(int)(buffer_size*(1.0/2.0))];
-
-/*
- // zero out new token ptrs so we'll know if something to delete in buffer
- ANTLRAbstractToken **p = end_of_buffer-chunk_size+1;
- for (; p<=end_of_buffer; p++) *p = NULL;
-*/
-}
-
-ANTLRParser * ANTLRTokenBuffer:: // MR1
-setParser(ANTLRParser *p) { // MR1
- ANTLRParser *old=parser; // MR1
- parser=p; // MR1
- input->setParser(p); // MR1
- return old; // MR1
-} // MR1
- // MR1
-ANTLRParser * ANTLRTokenBuffer:: // MR1
-getParser() { // MR1
- return parser; // MR1
-} // MR1
-
-void ANTLRTokenBuffer::panic(const char *msg) // MR23
-{
- if (parser) //MR23
- parser->panic(msg); //MR23
- else //MR23
- exit(PCCTS_EXIT_FAILURE);
-}
-
-//MR23
-int ANTLRTokenBuffer::printMessage(FILE* pFile, const char* pFormat, ...)
-{
- va_list marker;
- va_start( marker, pFormat );
-
- int iRet = 0;
- if (parser)
- parser->printMessageV(pFile, pFormat, marker);
- else
- iRet = vfprintf(pFile, pFormat, marker);
-
- va_end( marker );
- return iRet;
-}
-
-/* to avoid having to link in another file just for the smart token ptr
- * stuff, we include it here. Ugh.
- *
- * MR23 This causes nothing but problems for IDEs.
- * Change from .cpp to .h
- *
- */
-
-#include ATOKPTR_IMPL_H
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokenBuffer.h b/BaseTools/Source/C/VfrCompile/Pccts/h/ATokenBuffer.h
deleted file mode 100644
index 1c008fd59e..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokenBuffer.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* ANTLRTokenBuffer.h
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ATOKENBUFFER_H_GATE
-#define ATOKENBUFFER_H_GATE
-
-#include "pcctscfg.h"
-
-#include "pccts_stdlib.h"
-
-PCCTS_NAMESPACE_STD
-
-#include ATOKEN_H
-#include ATOKENSTREAM_H
-
-/*
- * The parser is "attached" to an ANTLRTokenBuffer via interface
- * functions: getToken() and bufferedToken(). The object that actually
- * consumes characters and constructs tokens is connected to the
- * ANTLRTokenBuffer via interface function ANTLRTokenStream::getToken();
- * where ANTLRTokenStream is really just a behavior (class with no data).
- * C++ does not have this abstraction and hence we simply have come up
- * with a fancy name for "void *". See the note in ANTLRTokenStream.h on
- * the "behavior" of ANTLRTokenStream.
- */
-
-class ANTLRParser; // MR1
-
-class DllExportPCCTS ANTLRTokenBuffer {
-protected:
- ANTLRTokenStream *input; // where do I get tokens
- int buffer_size;
- int chunk_size;
- int num_markers;
- int k; // Need at least this many tokens in buffer
- _ANTLRTokenPtr *buffer; // buffer used for arbitrary lookahead
- _ANTLRTokenPtr *tp; // pts into buffer; current token ptr
- _ANTLRTokenPtr *last; // pts to last valid token in buffer
- _ANTLRTokenPtr *next; // place to put token from getANTLRToken()
- _ANTLRTokenPtr *end_of_buffer;
- /* when you try to write a token past this and there are no markers
- set, then move k-1 tokens back to the beginning of the buffer.
- We want to stay away from the end of the buffer because we have
- to extend it if a marker is set and we reach the end (we cannot
- move tokens to the beginning of the buffer in this case).
- */
- _ANTLRTokenPtr *threshold;
- unsigned char _deleteTokens;
-
- // This function is filled in by the subclass; it initiates fetch of input
- virtual _ANTLRTokenPtr getANTLRToken() { return input->getToken(); }
- void makeRoom();
- void extendBuffer();
-
-public:
- ANTLRTokenBuffer(ANTLRTokenStream *in, int k=1, int chksz=50);
- virtual ~ANTLRTokenBuffer();
- virtual _ANTLRTokenPtr getToken();
- virtual void rewind(int pos);
- virtual int mark();
- virtual _ANTLRTokenPtr bufferedToken(int i);
-
- void noGarbageCollectTokens() { _deleteTokens=0; }
- void garbageCollectTokens() { _deleteTokens=1; }
-
- virtual int bufferSize() { return buffer_size; }
- virtual int minTokens() { return k; }
- virtual void setMinTokens(int k_new) { k = k_new; }
-
- virtual void panic(const char *msg); /* MR20 const */
-
- virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23
-
-protected: // MR1
- ANTLRParser *parser; // MR1
-public: // MR1
- ANTLRParser *setParser(ANTLRParser *p); // MR1
- ANTLRParser *getParser(); // MR1
- ANTLRTokenStream *getLexer() const { // MR12
- return input;} // MR12
-};
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokenStream.h b/BaseTools/Source/C/VfrCompile/Pccts/h/ATokenStream.h
deleted file mode 100644
index 3dfea6ebff..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokenStream.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ANTLRTokenStream.h
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ATOKENSTREAM_H_GATE
-#define ATOKENSTREAM_H_GATE
-
-#include "pcctscfg.h"
-
-/* This is really a behavior or protocol; it merely indicates the behavior
- * required of the input and output of an ANTLRTokenBuffer. You could
- * subclass it, but you can also just pass any old pointer to ANTLRTokenBuffer
- * with a type cast (in which case, your getANTLRToken() would have to
- * explicitly cast the input pointer to your REAL type (typically your lexer)).
- */
-
-class ANTLRParser; // MR1
-
-class DllExportPCCTS ANTLRTokenStream {
-public:
- virtual _ANTLRTokenPtr getToken() = 0;
- virtual ANTLRParser * setParser(ANTLRParser * /*p MR23*/) {return 0; }; // MR12
- virtual ANTLRParser * getParser() { return 0; }; // MR12
-};
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/BufFileInput.cpp b/BaseTools/Source/C/VfrCompile/Pccts/h/BufFileInput.cpp
deleted file mode 100644
index 99d08a42a4..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/BufFileInput.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-// FILE: BufFileInput.cpp
-// AUTHOR: Alexey Demakov (AVD) demakov@kazbek.ispras.ru
-// CREATION: 26-JAN-1998
-// DESCRIPTION: File Input Stream with lookahead for Scanner.
-// See file BufFileInput.h for details
-
-// Change History:
-//
-// 22-Jun-1998 assert.h -> PCCTS_ASSERT_H
-// string.h -> PCCTS_STRING_H
-//
-// 28-May-1998 Add virtual destructor to release buffer.
-//
-// Add dummy definition for ANTLRTokenType
-// to allow compilation without knowing
-// token type codes.
-//
-// Manfred Kogler (km@cast.uni-linz.ac.at)
-// (1.33MR14)
-//
-// 20-Jul-1998 MR14a - Reorder initialization list for ctor.
-//
-
-enum ANTLRTokenType {TER_HATES_CPP=0, SO_DO_OTHERS=9999 };
-
-#include "pcctscfg.h"
-#include "pccts_assert.h"
-#include "pccts_string.h"
-
-PCCTS_NAMESPACE_STD
-
-#include "BufFileInput.h"
-
-BufFileInput::BufFileInput( FILE *f, int buf_size )
-: input( f ),
- buf( new int[buf_size] ),
- size( buf_size ),
- start( 0 ),
- len( 0 )
-{
-}
-
-BufFileInput::~BufFileInput()
-{
- delete [] buf;
-}
-
-int BufFileInput::nextChar( void )
-{
- if( len > 0 )
- {
- // get char from buffer
- int c = buf[start];
-
- if( c != EOF )
- {
- start++; start %= size;
- len--;
- }
- return c;
- } else {
- // get char from file
- int c = getc( input );
-
- if( c == EOF )
- {
- // if EOF - put it in the buffer as indicator
- buf[start] = EOF;
- len++;
- }
- return c;
- }
-}
-
-int BufFileInput::lookahead( char* s )
-{
- int l = strlen( s );
-
- assert( 0 < l && l <= size );
-
- while( len < l )
- {
- int c = getc( input );
-
- buf[ (start+len) % size ] = c;
-
- len++;
-
- if( c == EOF ) return 0;
- }
-
- for( int i = 0; i < l; i++ )
- {
- if( s[i] != buf[ (start+i) % size ] ) return 0;
- }
- return 1;
-}
-
-// End of file BufFileInput.cpp
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/BufFileInput.h b/BaseTools/Source/C/VfrCompile/Pccts/h/BufFileInput.h
deleted file mode 100644
index ea54c0ee26..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/BufFileInput.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// FILE: BufFileInput.h
-// AUTHOR: Alexey Demakov (AVD) demakov@kazbek.ispras.ru
-// CREATION: 26-JAN-1998
-// DESCRIPTION: File Input Stream with lookahead for Scanner
-// Tested under Win32 with ANTLR 1.33 MR10 and MSVC 5.0
-
-// Change History:
-//
-// 28-May-1998 Add virtual destructor to release buffer
-// Manfred Kogler (km@cast.uni-linz.ac.at)
-// (1.33MR14)
-
-#ifndef BufFileInput_h
-#define BufFileInput_h
-
-#include "pcctscfg.h"
-
-#include "pccts_stdio.h"
-
-PCCTS_NAMESPACE_STD
-
-#include "DLexerBase.h"
-
-class DllExportPCCTS BufFileInput : public DLGInputStream
-{
-public:
- // constructor
- // f - input stream
- // buf_size - size of buffer (maximal length for string in is_in)
-
- BufFileInput(FILE *f, int buf_size = 8 );
-
- virtual ~BufFileInput();
-
- // gets next char from stream
-
- virtual int nextChar( void );
-
- // looks in stream and compares next l characters with s
- // returns the result of comparision
-
- int lookahead( char* s );
-
-private:
- FILE *input; // input stream;
- int* buf; // buffer
- int size; // size of buffer
- int start; // position of the first symbol in buffer
- int len; // count of characters in buffers
-};
-
-#endif
-// end of file BufFileInput.h
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/DLG_stream_input.h b/BaseTools/Source/C/VfrCompile/Pccts/h/DLG_stream_input.h
deleted file mode 100644
index d2147f5217..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/DLG_stream_input.h
+++ /dev/null
@@ -1,98 +0,0 @@
-
-/************************************************************/
-/* */
-/* Predefined char stream: Input from (c++) stream. */
-/* */
-/* By Hubert Holin (Hubert.Holin@Bigfoot.com), 1998. */
-/* */
-/* This is completely free stuff, do whatever you want with */
-/* it (but then, I will take no responsability for whatever */
-/* may happen if you do either... caveat emptor!). */
-/* */
-/************************************************************/
-
-#ifndef _DLG_STREAM_INPUT_H
-#define _DLG_STREAM_INPUT_H
-
-#include "pccts_istream.h"
-
-PCCTS_NAMESPACE_STD
-
-#ifndef DLGX_H
-#include "DLexerBase.h"
-#endif
-
-
-// NOTES: The semantics of the copy constructor
-// and the affectation operator may be unwaranted...
-// and the stream may not be reset.
-//
-// It would have been so much nicer for nextChar()
-// to throw (of for the DLGInputStream to change status)
-// upon hiting EOF than to return an "int"...
-
-template <
- class E,
- class T = ::std::char_traits<E>
- >
-class DLG_stream_input : public DLGInputStream
-{
-public:
-
- DLG_stream_input(::std::basic_istream<E,T> * p_input_stream)
- : input(p_input_stream)
- {
- // nothing to do!
- };
-
- DLG_stream_input(const DLG_stream_input & a_recopier)
- : input(a_recopier.input)
- {
- // nothing to do!
- };
-
- virtual ~DLG_stream_input()
- {
- this->purge(); // bloody templarized lookup...
- };
-
- DLG_stream_input operator = (const DLG_stream_input & a_affecter)
- {
- if (this != &a_affecter)
- {
- input = a_affecter.input;
- }
-
- return(*this);
- };
-
- virtual int nextChar()
- {
- E extracted_stuff;
-
- input->get(extracted_stuff);
-
- if (*input)
- {
- return(int(extracted_stuff));
- }
- else
- {
- return(EOF);
- }
- };
-
-protected:
-
- ::std::basic_istream<E,T> * input;
-
-private:
-
- void purge()
- {
- // nothing to do!
- };
-};
-
-#endif /* _DLG_STREAM_INPUT_H */
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h b/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h
deleted file mode 100644
index 37cac24f14..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/DLexer.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/* DLexer.h (formerly DLexer.cpp)
- *
- * This was renamed because the use of the .cpp extension caused problems
- * with IDEs.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#define ZZINC {if ( track_columns ) (++_endcol);}
-
-#define ZZGETC {ch = input->nextChar(); cl = ZZSHIFT(ch);}
-
-#define ZZNEWSTATE (newstate = dfa[state][cl])
-
-#ifndef ZZCOPY
-#define ZZCOPY \
- /* Truncate matching buffer to size (not an error) */ \
- if (nextpos < lastpos){ \
- *(nextpos++) = ch; \
- }else{ \
- bufovf = 1; \
- }
-#endif
-
-void DLGLexer::
-mode( int m )
-{
- /* points to base of dfa table */
- if (m<MAX_MODE){
- automaton = m;
- /* have to redo class since using different compression */
- cl = ZZSHIFT(ch);
- }else{
- sprintf((char *)ebuf,"Invalid automaton mode = %d ",m);
- errstd(ebuf);
- }
-}
-
-ANTLRTokenType DLGLexer::
-nextTokenType(void)
-{
- register int state, newstate;
- /* last space reserved for the null char */
- register DLGChar *lastpos;
- ANTLRTokenType tk;
-
-skip:
- bufovf = 0;
- lastpos = &_lextext[_bufsize-1];
- nextpos = _lextext;
- _begcol = _endcol+1;
-more:
- _begexpr = nextpos;
- if ( interactive ) {
- /* interactive version of automaton */
- /* if there is something in ch, process it */
- state = newstate = dfa_base[automaton];
- if (charfull){
- ZZINC;
- ZZCOPY;
- ZZNEWSTATE;
- }
- while (alternatives[newstate]){
- state = newstate;
- ZZGETC;
- ZZINC;
- ZZCOPY;
- ZZNEWSTATE;
- }
- /* figure out if last character really part of token */
- if ((state != dfa_base[automaton]) && (newstate == DfaStates)){
- charfull = 1;
- --nextpos;
- }else{
- charfull = 0;
- state = newstate;
- }
- *(nextpos) = '\0';
- /* Able to transition out of start state to some non err state?*/
- if ( state == dfa_base[automaton] ){
- /* make sure doesn't get stuck */
- advance();
- }
- }
- else { /* non-interactive version of automaton */
- if (!charfull)
- advance();
- else
- ZZINC;
- state = dfa_base[automaton];
- while (ZZNEWSTATE != DfaStates) {
- state = newstate;
- ZZCOPY;
- ZZGETC;
- ZZINC;
- }
- charfull = 1;
- if ( state == dfa_base[automaton] ){
- if (nextpos < lastpos){
- *(nextpos++) = ch;
- }else{
- bufovf = 1;
- }
- *nextpos = '\0';
- /* make sure doesn't get stuck */
- advance();
- }else{
- *nextpos = '\0';
- }
- }
- if ( track_columns ) _endcol -= charfull;
- _endexpr = nextpos -1;
- add_erase = 0;
-#ifdef OLD
- tk = (ANTLRTokenType)
- (*actions[accepts[state]])(this); // must pass this manually
- // actions is not a [] of pointers
- // to member functions.
-#endif
- tk = (this->*actions[accepts[state]])();
-
-// MR1
-// MR1 11-Apr-97 Help for tracking DLG results
-// MR1
-
-#ifdef DEBUG_LEXER
-
-/* MR1 */ if (debugLexerFlag) {
-/* MR1 */ if (parser != NULL) {
-/* MR1 */ /* MR23 */ printMessage(stdout, "\ntoken name=%s",parser->parserTokenName(tk));
-/* MR1 */ } else {
-/* MR1 */ /* MR23 */ printMessage(stdout, "\ntoken nnumber=%d",tk);
-/* MR1 */ };
-/* MR1 */ /* MR23 */ printMessage(stdout, " lextext=(%s) mode=%d",
-/* MR1 */ (_lextext[0]=='\n' && _lextext[1]==0) ?
-/* MR1 */ "newline" : _lextext,
-/* MR1 */ automaton);
-/* MR1 */ if (interactive && !charfull) {
-/* MR1 */ /* MR23 */ printMessage(stdout, " char=empty");
-/* MR1 */ } else {
-/* MR1 */ if (ch=='\n') {
-/* MR1 */ /* MR23 */ printMessage(stdout, " char=newline");
-/* MR1 */ } else {
-/* MR1 */ /* MR23 */ printMessage(stdout, " char=(%c)",ch);
-/* MR1 */ };
-/* MR1 */ };
-/* MR1 */ /* MR23 */ printMessage(stdout, " %s\n",
-/* MR1 */ (add_erase==1 ? "skip()" :
-/* MR1 */ add_erase==2 ? "more()" :
-/* MR1 */ ""));
-/* MR1 */ };
-
-#endif
-
- switch (add_erase) {
- case 1: goto skip;
- case 2: goto more;
- }
- return tk;
-}
-
-void DLGLexer::
-advance()
-{
- if ( input==NULL ) err_in();
- ZZGETC; charfull = 1; ZZINC;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.cpp b/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.cpp
deleted file mode 100644
index b218afc038..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.cpp
+++ /dev/null
@@ -1,302 +0,0 @@
-/* DLGLexerBase.c
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#include "pcctscfg.h"
-
-#include "pccts_stdio.h"
-#include "pccts_stdlib.h"
-
-PCCTS_NAMESPACE_STD
-
-/* I have to put this here due to C++ limitation
- * that you can't have a 'forward' decl for enums.
- * I hate C++!!!!!!!!!!!!!!!
- */
-
-// MR1
-// MR1 10-Apr-97 133MR1 Prevent use of varying sizes for the
-// MR1 ANTLRTokenType enum
-// MR1
-
-enum ANTLRTokenType { TER_HATES_CPP=0, ITS_UTTER_GARBAGE, // MR1
- WITH_SOME_GOOD_IDEAS=9999}; // MR1
-
-#define ANTLR_SUPPORT_CODE
-
-#include "pcctscfg.h"
-#include DLEXERBASE_H
-#include APARSER_H // MR23
-
-DLGLexerBase::
-DLGLexerBase(DLGInputStream *in,
- unsigned bufsize,
- int _interactive,
- int _track_columns)
-{
- this->_bufsize = bufsize;
- this->_lextext = new DLGChar[_bufsize];
- if ( this->_lextext==NULL ) {
- panic("text buffer is NULL");
- }
- this->_begexpr = this->_endexpr = NULL;
- this->ch = this->bufovf = 0;
- this->nextpos = NULL;
- this->cl = 0;
- this->add_erase = 0;
- this->input = in;
- this->_begcol = 0;
- this->_endcol = 0;
- this->_line = 1;
- this->charfull = 0;
- this->automaton = 0;
- this->token_to_fill = NULL;
- this->interactive = _interactive;
- this->track_columns = _track_columns;
- this->debugLexerFlag = 0; // MR1
- this->parser = NULL; // MR1
- this->lexErrCount=0; // MR11
-}
-
-// MR19 THM
-
-void DLGLexerBase::reset()
-{
- this->charfull = 0;
- this->_begcol = 0;
- this->_endcol = 0;
- this->automaton = 0;
- this->_line=1;
- this->lexErrCount=0;
-}
-
-void DLGLexerBase::
-setInputStream( DLGInputStream *in )
-{
- this->input = in;
- _line = 1;
- charfull = 0;
-}
-
-/* saves dlg state, but not what feeds dlg (such as file position) */
-void DLGLexerBase::
-saveState(DLGState *state)
-{
- state->input = input;
- state->interactive = interactive;
- state->track_columns = track_columns;
- state->auto_num = automaton;
- state->add_erase = add_erase;
- state->lookc = ch;
- state->char_full = charfull;
- state->begcol = _begcol;
- state->endcol = _endcol;
- state->line = _line;
- state->lextext = _lextext;
- state->begexpr = _begexpr;
- state->endexpr = _endexpr;
- state->bufsize = _bufsize;
- state->bufovf = bufovf;
- state->nextpos = nextpos;
- state->class_num = cl;
- state->debugLexerFlag = debugLexerFlag; // MR1
- state->parser = parser; // MR1
-}
-
-void DLGLexerBase::
-restoreState(DLGState *state)
-{
- input = state->input;
- interactive = state->interactive;
- track_columns = state->track_columns;
- automaton = state->auto_num;
- add_erase = state->add_erase;
- ch = state->lookc;
- charfull = state->char_full;
- _begcol = state->begcol;
- _endcol = state->endcol;
- _line = state->line;
- _lextext = state->lextext;
- _begexpr = state->begexpr;
- _endexpr = state->endexpr;
- _bufsize = state->bufsize;
- bufovf = state->bufovf;
- nextpos = state->nextpos;
- cl = state->class_num;
- debugLexerFlag = state->debugLexerFlag; // MR1
- parser = state->parser; // MR1
-}
-
-/* erase what is currently in the buffer, and get a new reg. expr */
-void DLGLexerBase::
-skip()
-{
- add_erase = 1;
-}
-
-/* don't erase what is in the lextext buffer, add on to it */
-void DLGLexerBase::
-more()
-{
- add_erase = 2;
-}
-
-/* substitute c for the reg. expr last matched and is in the buffer */
-void DLGLexerBase::
-replchar(DLGChar c)
-{
- /* can't allow overwriting null at end of string */
- if (_begexpr < &_lextext[_bufsize-1]){
- *_begexpr = c;
- *(_begexpr+1) = '\0';
- }
- _endexpr = _begexpr;
- if (c != '\0') {
- nextpos = _begexpr + 1;
- }
- else {
- nextpos = _begexpr; /* MR30 Zero terminates string. */
- }
-}
-
-/* replace the string s for the reg. expr last matched and in the buffer */
-
-#ifdef _MSC_VER // MR23
-//Turn off "assignment within conditional expression" warning
-#pragma warning(disable : 4706)
-#endif
-void DLGLexerBase::
-replstr(const DLGChar *s) /* MR20 const */
-{
- register DLGChar *l= &_lextext[_bufsize -1];
-
- nextpos = _begexpr;
- if (s){
- while ((nextpos <= l) && (*(nextpos++) = *(s++))){
- /* empty */
- }
- /* correct for NULL at end of string */
- nextpos--;
- }
- if ((nextpos <= l) && (*(--s) == 0)){
- bufovf = 0;
- }else{
- bufovf = 1;
- }
- *(nextpos) = '\0';
- _endexpr = nextpos - 1;
-}
-#ifdef _MSC_VER // MR23
-#pragma warning(default: 4706)
-#endif
-
-void DLGLexerBase::
-errstd(const char *s) /* MR20 const */
-{
- lexErrCount++; /* MR11 */
- /* MR23 */ printMessage(stderr,
- "%s near line %d (text was '%s')\n",
- ((s == NULL) ? "Lexical error" : s),
- _line,_lextext);
-}
-
-int DLGLexerBase::
-err_in()
-{
- /* MR23 */ printMessage(stderr,"No input stream, function, or string\n");
- /* return eof to get out gracefully */
- return EOF;
-}
-
-ANTLRTokenType DLGLexerBase::
-erraction()
-{
- errstd("invalid token");
- advance();
- skip();
- return (ANTLRTokenType) 0; // bogus, but satisfies compiler
-}
-
-_ANTLRTokenPtr DLGLexerBase::
-getToken()
-{
- if ( token_to_fill==NULL ) panic("NULL token_to_fill");
- ANTLRTokenType tt = nextTokenType();
- _ANTLRTokenPtr tk = token_to_fill->makeToken(tt, _lextext,_line);
- return tk;
-}
-
-void DLGLexerBase::
-panic(const char *msg) /* MR20 const */
-{
- if (parser) //MR23
- parser->panic(msg); //MR23
- else //MR23
- {
- /* MR23 */ printMessage(stderr, "DLG panic: %s\n", msg);
- //
- // 7-Apr-97 133MR1
- //
- exit(PCCTS_EXIT_FAILURE); // MR1
- }
-}
-
-ANTLRParser * DLGLexerBase:: // MR1
-setParser(ANTLRParser *p) { // MR1
- ANTLRParser *oldValue=parser; // MR1
- parser=p; // MR1
- return oldValue; // MR1
-} // MR1
- // MR1
-ANTLRParser * DLGLexerBase:: // MR1
-getParser() { // MR1
- return parser; // MR1
-} // MR1
- // MR1
-int DLGLexerBase:: // MR1
-debugLexer(int newValue) { // MR1
- int oldValue=debugLexerFlag; // MR1
- debugLexerFlag=newValue; // MR1
- return oldValue; // MR1
-} // MR1
-
-//MR23
-int DLGLexerBase::printMessage(FILE* pFile, const char* pFormat, ...)
-{
- va_list marker;
- va_start( marker, pFormat );
-
- int iRet = 0;
- if (parser)
- parser->printMessageV(pFile, pFormat, marker);
- else
- iRet = vfprintf(pFile, pFormat, marker);
-
- va_end( marker );
- return iRet;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.h b/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.h
deleted file mode 100644
index db6cc1890c..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/* DLGLexerBase.h
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef DLGX_H
-#define DLGX_H
-
-#include "pcctscfg.h"
-#include "pccts_stdio.h"
-
-PCCTS_NAMESPACE_STD
-
-#include ATOKEN_H
-#include ATOKENSTREAM_H
-
-class ANTLRParser; // MR1
-
-/* must define what a char looks like; can make this a class too */
-typedef char DLGChar;
-
-/* Can have it as a class too: (ack this looks weird; is it right?)
-class DllExportPCCTS DLGChar {
-private:
- int c;
-public:
- DLGChar(int ch) { c = ch; }
- int atom() { return c; }
-};
-*/
-
-/* user must subclass this */
-class DllExportPCCTS DLGInputStream {
-public:
- virtual int nextChar() = 0;
-};
-
-/* Predefined char stream: Input from FILE */
-class DllExportPCCTS DLGFileInput : public DLGInputStream {
-private:
- int found_eof;
- FILE *input;
-public:
- DLGFileInput(FILE *f) { input = f; found_eof = 0; }
- int nextChar() {
- int c;
- if ( found_eof ) return EOF;
- else {
- c=getc(input);
- if ( c==EOF ) found_eof = 1;
- return c;
- }
- }
- void DLGFileReset(FILE *f) {input=f; found_eof = 0; }; // MR11
-};
-
-// MR9 Suggested by Bruce Guenter (bruceg@qcc.sk.ca)
-// MR9 Make DLGStringInput const correct
-
-/* Predefined char stream: Input from string */
-class DllExportPCCTS DLGStringInput : public DLGInputStream {
-private:
- const DLGChar *input; // MR9
- const DLGChar *p; // MR9
-public:
- DLGStringInput(const DLGChar *s) { input = s; p = &input[0];} // MR9
- int nextChar()
- {
- if (*p) return (int) (unsigned char) *p++; // MR14
- else return EOF;
- }
-
- void DLGStringReset(const DLGChar *s) {input=s; p= &input[0]; }; // MR11 // MR16
-};
-
-class DllExportPCCTS DLGState {
-public:
- DLGInputStream *input;
- int interactive;
- int track_columns;
- int auto_num;
- int add_erase;
- int lookc;
- int char_full;
- int begcol, endcol;
- int line;
- DLGChar *lextext, *begexpr, *endexpr;
- int bufsize;
- int bufovf;
- DLGChar *nextpos;
- int class_num;
- int debugLexerFlag; // MR1
- ANTLRParser *parser; // MR1
-};
-
-/* user must subclass this */
-class DllExportPCCTS DLGLexerBase : public ANTLRTokenStream {
-public:
- virtual ANTLRTokenType erraction();
-
-protected:
- DLGInputStream *input;
- int interactive;
- int track_columns;
- DLGChar *_lextext; /* text of most recently matched token */
- DLGChar *_begexpr; /* beginning of last reg expr recogn. */
- DLGChar *_endexpr; /* beginning of last reg expr recogn. */
- int _bufsize; /* number of characters in lextext */
- int _begcol; /* column that first character of token is in*/
- int _endcol; /* column that last character of token is in */
- int _line; /* line current token is on */
- int ch; /* character to determine next state */
- int bufovf; /* indicates that buffer too small for text */
- int charfull;
- DLGChar *nextpos; /* points to next available position in lextext*/
- int cl;
- int automaton;
- int add_erase;
- DLGChar ebuf[70];
- _ANTLRTokenPtr token_to_fill;
-
- int debugLexerFlag; // MR1
- ANTLRParser *parser; // MR1
-public:
- virtual _ANTLRTokenPtr getToken(); // MR12 public
- virtual void advance(void) = 0;
- void skip(void); /* erase lextext, look for antoher token */
- void more(void); /* keep lextext, look for another token */
- void mode(int k); /* switch to automaton 'k' */
- void saveState(DLGState *);
- void restoreState(DLGState *);
- virtual ANTLRTokenType nextTokenType(void)=0;/* get next token */
- void replchar(DLGChar c); /* replace last recognized reg. expr. with
- a character */
- void replstr(const DLGChar *s); /* replace last recognized reg. expr. with
- a string */ /* MR20 const */
- virtual int err_in(); // MR1
- virtual void errstd(const char *); // MR1 MR20 const
- int line() { return _line; }
- void set_line(int newValue) { _line=newValue; }; // MR1
- virtual void newline() { _line++; }
- DLGChar *lextext() { return _lextext; }
-
- int begcol() { return _begcol; }
- int endcol() { return _endcol; }
- void set_begcol(int a) { _begcol=a; }
- void set_endcol(int a) { _endcol=a; }
- DLGChar *begexpr() { return _begexpr; }
- DLGChar *endexpr() { return _endexpr; }
- int bufsize() { return _bufsize; }
-
- void setToken(ANTLRAbstractToken *t) { token_to_fill = t; }
-
- void setInputStream(DLGInputStream *);
- DLGLexerBase(DLGInputStream *in,
- unsigned bufsize=2000,
- int interactive=0,
- int track_columns=0);
- void reset(); // MR19
- virtual ~DLGLexerBase() { delete [] _lextext; }
- virtual void panic(const char *msg); // MR1 MR20 const
- void trackColumns() {
- track_columns = 1;
- this->_begcol = 0;
- this->_endcol = 0;
- };
- virtual ANTLRParser *setParser(ANTLRParser *p); // MR1
- virtual ANTLRParser *getParser(); // MR1
- virtual int debugLexer(int value); // MR1
- int lexErrCount; // MR12
- virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23
-};
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/PBlackBox.h b/BaseTools/Source/C/VfrCompile/Pccts/h/PBlackBox.h
deleted file mode 100644
index d25b8d6939..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/PBlackBox.h
+++ /dev/null
@@ -1,134 +0,0 @@
-#ifndef PBLACKBOX_H
-#define PBLACKBOX_H
-
-/*
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-/* Completely rewritten by Chris Uzdavinis (chris@atdesk.com) for MR23 */
-
-#include "pcctscfg.h"
-
-#include "pccts_iostream.h"
-
-PCCTS_NAMESPACE_STD
-
-// MR20 Added #include for "DLexerBase.h"
-
-#include "DLexerBase.h"
-
-//
-// The default buffer size of the lexer is given by the
-// second argument of the lexer's ctor. It is optional
-// and defaults to 2000
-//
-
-template<class Lexer, class Parser, class Token>
-class DllExportPCCTS ParserBlackBox {
-private:
- // no copy construction allowed
- ParserBlackBox(ParserBlackBox const &);
-
- // no copy assignment allowed
- ParserBlackBox & operator=(ParserBlackBox const &);
-
-protected:
- DLGFileInput *in;
- Lexer *scan;
- _ANTLRTokenPtr tok;
- ANTLRTokenBuffer *pipe;
- Parser *_parser;
- FILE *file;
- int openByBlackBox; /* MR21 Don't close what we haven't opened */
-public:
-
- ParserBlackBox(FILE *f)
- : in(0)
- , scan(0)
- , tok(0)
- , pipe(0)
- , _parser(0)
- , file(0)
- , openByBlackBox(0)
- {
- if (f == NULL)
- {
- cerr << "invalid file pointer\n";
- }
- else
- {
- openByBlackBox = 0; /* MR21a */
- file = f;
- in = new DLGFileInput(f);
- scan = new Lexer(in);
- pipe = new ANTLRTokenBuffer(scan);
- tok = new Token;
- scan->setToken(tok);
- _parser = new Parser(pipe);
- _parser->init();
- }
- }
- ParserBlackBox(char *fname)
- : in(0)
- , scan(0)
- , tok(0)
- , pipe(0)
- , _parser(0)
- , file(0)
- , openByBlackBox(0)
- {
- FILE *f = fopen(fname, "r");
- if ( f==NULL ) {
- openByBlackBox = 0;
- cerr << "cannot open " << fname << "\n"; return;
- }
- else {
- openByBlackBox = 1;
- file = f;
- in = new DLGFileInput(f);
- scan = new Lexer(in);
- pipe = new ANTLRTokenBuffer(scan);
- tok = new Token;
- scan->setToken(tok);
- _parser = new Parser(pipe);
- _parser->init();
- }
- }
-
- ~ParserBlackBox()
- {
- delete in; delete scan; delete pipe; delete _parser; delete tok;
- if (1 == openByBlackBox) {
- fclose(file);
- }
- }
-
- Parser *parser() { return _parser; }
- Lexer *getLexer() { return scan; }
-};
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.cpp b/BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.cpp
deleted file mode 100644
index a8249cdac0..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.cpp
+++ /dev/null
@@ -1,684 +0,0 @@
-/*
- * PCCTSAST.C
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public
- * domain. An individual or company may do whatever they wish with
- * source code distributed with SORCERER or the code generated by
- * SORCERER, including the incorporation of SORCERER, or its output, into
- * commerical software.
- *
- * We encourage users to develop software with SORCERER. However, we do
- * ask that credit is given to us for developing SORCERER. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like SORCERER and have developed a nice tool with the
- * output, please mention that you developed it using SORCERER. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * SORCERER 1.00B14 and ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * AHPCRC, University of Minnesota
- * 1992-2000
- */
-
-#define ANTLR_SUPPORT_CODE
-
-#include "pcctscfg.h"
-
-#include "PCCTSAST.h"
-#include "pccts_stdarg.h"
-
-PCCTS_NAMESPACE_STD
-
-#include <ctype.h>
-
-//#include "SList.h"
-
- /* String Scanning/Parsing Stuff */
-
-const char *PCCTS_AST::scan_token_tbl[] = { /* MR20 const */
- "invalid", /* 0 */
- "LPAREN", /* 1 */
- "RPAREN", /* 2 */
- "PERCENT", /* 3 */
- "INT", /* 4 */
- "COLON", /* 5 */
- "POUND", /* 6 */
- "PERIOD", /* 7 */
-};
-
-void PCCTS_AST::
-addChild(PCCTS_AST *t)
-{
- if ( t==NULL ) return;
- PCCTS_AST *s = down();
- if ( s!=NULL )
- {
- while ( s->right()!=NULL ) s = s->right();
- s->setRight(t);
- }
- else
- this->setDown(t);
-}
-
-void PCCTS_AST::
-lisp(FILE *f)
-{
- if ( down() != NULL ) /* MR23 */ printMessage(f," (");
- lisp_action(f);
- if ( down()!=NULL ) down()->lisp(f);
- if ( down() != NULL ) /* MR23 */ printMessage(f," )");
- if ( right()!=NULL ) right()->lisp(f);
-}
-
-/* build a tree (root child1 child2 ... NULL)
- * If root is NULL, simply make the children siblings and return ptr
- * to 1st sibling (child1). If root is not single node, return NULL.
- *
- * Siblings that are actually sibling lists themselves are handled
- * correctly. For example #( NULL, #( NULL, A, B, C), D) results
- * in the tree ( NULL A B C D ).
- *
- * Requires at least two parameters with the last one being NULL. If
- * both are NULL, return NULL.
- *
- * The down() and right() down/right pointers are used to make the tree.
- */
-PCCTS_AST *PCCTS_AST::
-make(PCCTS_AST *rt, ...)
-{
- va_list ap;
- register PCCTS_AST *child, *sibling=NULL, *tail=NULL /*MR23*/, *w;
- PCCTS_AST *root;
-
- va_start(ap, rt);
- root = rt;
-
- if ( root != NULL )
- if ( root->down() != NULL ) return NULL;
- child = va_arg(ap, PCCTS_AST *);
- while ( child != NULL )
- {
- /* find end of child */
- for (w=child; w->right()!=NULL; w=w->right()) {;}
- if ( sibling == NULL ) {sibling = child; tail = w;}
- else {tail->setRight(child); tail = w;}
- child = va_arg(ap, PCCTS_AST *);
- }
- if ( root==NULL ) root = sibling;
- else root->setDown(sibling);
- va_end(ap);
- return root;
-}
-
-/* The following push and pop routines are only used by ast_find_all() */
-
-void PCCTS_AST::
-_push(PCCTS_AST **st, int *sp, PCCTS_AST *e)
-{
- (*sp)--;
- require((*sp)>=0, "stack overflow");
- st[(*sp)] = e;
-}
-
-PCCTS_AST *PCCTS_AST::
-_pop(PCCTS_AST **st, int *sp)
-{
- PCCTS_AST *e = st[*sp];
- (*sp)++;
- require((*sp)<=MaxTreeStackDepth, "stack underflow");
- return e;
-}
-
-/* Find all occurrences of u in t.
- * 'cursor' must be initialized to 't'. It eventually
- * returns NULL when no more occurrences of 'u' are found.
- */
-PCCTS_AST *PCCTS_AST::
-ast_find_all(PCCTS_AST *u, PCCTS_AST **cursor)
-{
- PCCTS_AST *sib;
- /*** static ***/ PCCTS_AST *template_stack[MaxTreeStackDepth]; /* MR23 Remove "static" */
- /*** static ***/ int tsp = MaxTreeStackDepth; /* MR23 Remove "static" */
-
-////static int nesting = 0; /* MR23 Not referenced */
-
- if ( *cursor == NULL ) return NULL;
- if ( *cursor!=this ) sib = *cursor;
- else {
- /* else, first time--start at top of template 't' */
- tsp = MaxTreeStackDepth;
- sib = this;
- /* bottom of stack is always a NULL--"cookie" indicates "done" */
- _push(template_stack, &tsp, NULL);
- }
-
-keep_looking:
- if ( sib==NULL ) /* hit end of sibling list */
- {
- sib = _pop(template_stack, &tsp);
- if ( sib == NULL ) { *cursor = NULL; return NULL; }
- }
-
- if ( sib->type() != u->type() )
- {
- /* look for another match */
- if ( sib->down()!=NULL )
- {
- if ( sib->right()!=NULL ) _push(template_stack, &tsp, sib->right());
- sib=sib->down();
- goto keep_looking;
- }
- /* nothing below to try, try next sibling */
- sib=sib->right();
- goto keep_looking;
- }
-
- /* found a matching root node, try to match what's below */
- if ( match_partial(sib, u) )
- {
- /* record sibling cursor so we can pick up next from there */
- if ( sib->down()!=NULL )
- {
- if ( sib->right()!=NULL ) _push(template_stack, &tsp, sib->right());
- *cursor = sib->down();
- }
- else if ( sib->right()!=NULL ) *cursor = sib->right();
- else *cursor = _pop(template_stack, &tsp);
- return sib;
- }
-
- /* no match, keep searching */
- if ( sib->down()!=NULL )
- {
- if ( sib->right()!=NULL ) _push(template_stack, &tsp, sib->right());
- sib=sib->down();
- }
- else sib = sib->right(); /* else, try to right if zip below */
- goto keep_looking;
-}
-
-/* are two trees exactly alike? */
-int PCCTS_AST::
-match(PCCTS_AST *u)
-{
- PCCTS_AST *t = this;
- PCCTS_AST *sib;
-
- if ( u==NULL ) return 0;
-
- for (sib=t; sib!=NULL&&u!=NULL; sib=sib->right(), u=u->right())
- {
- if ( sib->type() != u->type() ) return 0;
- if ( sib->down()!=NULL )
- if ( !sib->down()->match(u->down()) ) return 0;
- }
- return 1;
-}
-
-/* Is 'u' a subtree of 't' beginning at the root? */
-int PCCTS_AST::
-match_partial(PCCTS_AST *t, PCCTS_AST *u)
-{
- PCCTS_AST *sib;
-
- if ( u==NULL ) return 1;
- if ( t==NULL ) return 0; /* MR23 removed unreachable code */
-
- for (sib=t; sib!=NULL&&u!=NULL; sib=sib->right(), u=u->right())
- {
- if ( sib->type() != u->type() ) return 0;
- if ( sib->down()!=NULL )
- if ( !match_partial(sib->down(), u->down()) ) return 0;
- }
- return 1;
-}
-
-#ifdef _MSC_VER // MR23
-//Turn off "unreachable code" warning
-#pragma warning(disable : 4702)
-#endif
-/* Walk the template tree 't' (matching against 'this'), filling in the
- * 'labels' array, and setting 'n' according to how many labels were matched.
- */
-int PCCTS_AST::
-scanmatch(ScanAST *t, PCCTS_AST **labels[], int *n)
-{
- ScanAST *sib;
- PCCTS_AST *u = this;
-
- if ( u==NULL ) return 0;
-
- for (sib=t; sib!=NULL&&u!=NULL; sib=sib->right(), u=u->right())
- {
- /* make sure tokens match; token of '0' means wildcard match */
- if ( sib->type() != u->type() && sib->type()!=0 ) return 0;
- /* we have a matched token here; set label pointers if exists */
- if ( sib->label_num>0 )
- {
- require(labels!=NULL, "label found in template, but no array of labels");
- (*n)++;
- *(labels[sib->label_num-1]) = u;
- }
- /* match what's below if something there and current node is not wildcard */
- if ( sib->down()!=NULL && sib->type()!=0 )
- {
- if ( sib->down()==NULL )
- {
- if ( u->down()!=NULL )
- return 0;
- else
- return 1;
- }
- if ( !u->down()->scanmatch(sib->down(), labels, n) ) return 0;
- }
- }
- return 1;
-}
-#ifdef _MSC_VER // MR23
-#pragma warning(default : 4702)
-#endif
-
-void PCCTS_AST::
-insert_after(PCCTS_AST *b)
-{
- PCCTS_AST *end;
- if ( b==NULL ) return;
- /* find end of b's child list */
- for (end=b; end->right()!=NULL; end=end->right()) {;}
- end->setRight(this->right());
- this->setRight(b);
-}
-
-void PCCTS_AST::
-append(PCCTS_AST *b)
-{
- PCCTS_AST *end;
- require(b!=NULL, "append: NULL input tree");
- /* find end of child list */
- for (end=this; end->right()!=NULL; end=end->right()) {;}
- end->setRight(b);
-}
-
-PCCTS_AST *PCCTS_AST::
-tail()
-{
- PCCTS_AST *end;
- /* find end of child list */
- for (end=this; end->right()!=NULL; end=end->right()) {;}
- return end;
-}
-
-PCCTS_AST *PCCTS_AST::
-bottom()
-{
- PCCTS_AST *end;
- /* find end of child list */
- for (end=this; end->down()!=NULL; end=end->down()) {;}
- return end;
-}
-
-PCCTS_AST *PCCTS_AST::
-cut_between(PCCTS_AST *a, PCCTS_AST *b)
-{
- PCCTS_AST *end, *ret;
- if (a==NULL||b==NULL) return NULL;
- /* find node pointing to b */
- for (end=a; end->right()!=NULL&&end->right()!=b; end=end->right())
- {;}
- if (end->right()==NULL) return NULL; //ast_cut_between: a,b not connected
- end->setRight(NULL); /* don't want it point to 'b' anymore */
- ret = a->right();
- a->setRight(b);
- return ret;
-}
-
-#ifdef NOT_YET
-SList *PCCTS_AST::
-to_slist()
-{
- SList *list = new SList;
- PCCTS_AST *p;
-
- for (p=this; p!=NULL; p=p->right())
- {
- list->add(p);
- }
- return list;
-}
-#endif
-
-void PCCTS_AST::
-tfree()
-{
- PCCTS_AST *t = this;
- if ( t->down()!=NULL ) t->down()->tfree();
- if ( t->right()!=NULL ) t->right()->tfree();
- delete t;
-}
-
-int PCCTS_AST::
-nsiblings()
-{
- PCCTS_AST *t = this;
- int n=0;
-
- while ( t!=NULL )
- {
- n++;
- t = t->right();
- }
- return n;
-}
-
-PCCTS_AST *PCCTS_AST::
-sibling_index(int i)
-{
- PCCTS_AST *t = this;
- int j=1;
- require(i>0, "sibling_index: i<=0");
-
- while ( t!=NULL )
- {
- if ( j==i ) return t;
- j++;
- t = t->right();
- }
- return NULL;
-}
-
-/* Assume this is a root node of a tree--
- * duplicate that node and what's below; ignore siblings of root node.
- */
-
-// MR9 23-Sep-97 RJV
-// MR9
-// MR9 RJV: Original version only duplicated the node and down elements.
-// MR9 Made copies of the pointers to sibling.
-// MR9 Changed call "down()->deepCopy()" to "down()->deepCopyBushy()"
-// MR9
-
-PCCTS_AST *PCCTS_AST::
-deepCopy()
-{
- PCCTS_AST *u = this->shallowCopy();
- if ( down()!=NULL ) u->setDown(down()->deepCopyBushy());
- u->setRight(NULL);
- return u;
-}
-
-/* Copy all nodes including siblings of root. */
-PCCTS_AST *PCCTS_AST::
-deepCopyBushy()
-{
- PCCTS_AST *u = this->shallowCopy();
- /* copy the rest of the tree */
- if ( down()!=NULL ) u->setDown(down()->deepCopyBushy());
- if ( right()!=NULL ) u->setRight(right()->deepCopyBushy());
- return u;
-}
-
-void PCCTS_AST::
-scanast_free(ScanAST *t)
-{
- if ( t == NULL ) return;
- scanast_free( t->down() );
- scanast_free( t->right() );
- free( (char *) t ); // MR1
-}
-
-/*
- * scan
- *
- * This function is like scanf(): it attempts to match a template
- * against an input tree. A variable number of tree pointers
- * may be set according to the '%i' labels in the template string.
- * For example:
- *
- * t->ast_scan("#( 6 #(5 %1:4 %2:3) #(1 %3:3 %4:3) )",
- * &w, &x, &y, &z);
- *
- * Naturally, you'd want this converted from
- *
- * t->ast_scan("#( RangeOp #(Minus %1:IConst %2:Var) #(Plus %3:Var %4Var) )",
- * &w, &x, &y, &z);
- *
- * by SORCERER.
- *
- * This function call must be done withing a SORCERER file because SORCERER
- * must convert the token references to the associated token number.
- *
- * This functions parses the template and creates trees which are then
- * matched against the input tree. The labels are set as they are
- * encountered; hence, partial matches may leave some pointers set
- * and some NULL. This routines initializes all argument pointers to NULL
- * at the beginning.
- *
- * This function returns the number of labels matched.
- */
-int PCCTS_AST::
-ast_scan(char *templ, ...)
-{
- va_list ap;
- ScanAST *tmpl;
- int n, i, found=0;
- PCCTS_AST ***label_ptrs=NULL;
-
- va_start(ap, templ);
-
- /* make a ScanAST tree out of the template */
- tmpl = stringparser_parse_scanast(templ, &n);
-
- /* make an array out of the labels */
- if ( n>0 )
- {
- label_ptrs = (PCCTS_AST ***) calloc(n, sizeof(PCCTS_AST **));
- require(label_ptrs!=NULL, "scan: out of memory");
- for (i=1; i<=n; i++)
- {
- label_ptrs[i-1] = va_arg(ap, PCCTS_AST **);
- *(label_ptrs[i-1]) = NULL;
- }
- }
-
- /* match the input tree against the template */
- scanmatch(tmpl, label_ptrs, &found);
-
- scanast_free(tmpl);
- free( (char *) label_ptrs); // MR1
-
- return found;
-}
-
-ScanAST *PCCTS_AST::
-new_scanast(int tok)
-{
- ScanAST *p = (ScanAST *) calloc(1, sizeof(ScanAST));
-//
-// 7-Apr-97 133MR1
-//
- if ( p == NULL )
- panic("out of memory\n"); // MR23
- p->_token = tok;
- return p;
-}
-
-ScanAST *PCCTS_AST::
-stringparser_parse_scanast(char *templ, int *num_labels)
-{
- StringLexer lex;
- StringParser parser;
- ScanAST *t;
-
- stringlexer_init(&lex, templ);
- stringparser_init(&parser, &lex);
- t = stringparser_parse_tree(&parser);
- *num_labels = parser.num_labels;
- return t;
-}
-
-void PCCTS_AST::
-stringparser_match(StringParser *parser, int token)
-{
- if ( parser->token != token ) panic("bad tree in scan()");
-}
-
-/*
- * Match a tree of the form:
- * (root child1 child2 ... childn)
- * or,
- * node
- *
- * where the elements are integers or labeled integers.
- */
-ScanAST *PCCTS_AST::
-stringparser_parse_tree(StringParser *parser)
-{
- ScanAST *t=NULL, *root, *child, *last=NULL /*MR23*/;
-
- if ( parser->token != __POUND )
- {
- return stringparser_parse_element(parser);
- }
- stringparser_match(parser,__POUND);
- parser->token = stringscan_gettok(parser->lexer);
- stringparser_match(parser,__LPAREN);
- parser->token = stringscan_gettok(parser->lexer);
- root = stringparser_parse_element(parser);
- while ( parser->token != __RPAREN )
- {
- child = stringparser_parse_element(parser);
- if ( t==NULL ) { t = child; last = t; }
- else { last->_right = child; last = child; }
- }
- stringparser_match(parser,__RPAREN);
- parser->token = stringscan_gettok(parser->lexer);
- root->_down = t;
- return root;
-}
-
-ScanAST *PCCTS_AST::
-stringparser_parse_element(StringParser *parser)
-{
- char ebuf[100];
- int label = 0;
-
- if ( parser->token == __POUND )
- {
- return stringparser_parse_tree(parser);
- }
- if ( parser->token == __PERCENT )
- {
- parser->token = stringscan_gettok(parser->lexer);
- stringparser_match(parser,__INT);
- label = atoi(parser->lexer->text);
- parser->num_labels++;
- if ( label==0 ) panic("%%0 is an invalid label");
- parser->token = stringscan_gettok(parser->lexer);
- stringparser_match(parser,__COLON);
- parser->token = stringscan_gettok(parser->lexer);
- /* can label tokens and wildcards */
- if ( parser->token != __INT && parser->token != __PERIOD )
- panic("can only label tokens");
- }
- if ( parser->token == __INT )
- {
- ScanAST *p = new_scanast(atoi(parser->lexer->text));
- parser->token = stringscan_gettok(parser->lexer);
- p->label_num = label;
- return p;
- }
- if ( parser->token == __PERIOD )
- {
- ScanAST *p = new_scanast(0); /* token of 0 is wildcard */
- parser->token = stringscan_gettok(parser->lexer);
- p->label_num = label;
- return p;
- }
- sprintf(ebuf, "mismatch token in scan(): %s", scan_token_str(parser->token));
- panic(ebuf);
- return NULL;
-}
-
-void PCCTS_AST::
-stringparser_init(StringParser *parser, StringLexer *input)
-{
- parser->lexer = input;
- parser->token = stringscan_gettok(parser->lexer);
- parser->num_labels = 0;
-}
-
-void PCCTS_AST::
-stringlexer_init(StringLexer *scanner, char *input)
-{
- scanner->text[0]='\0';
- scanner->input = input;
- scanner->p = input;
- stringscan_advance(scanner);
-}
-
-void PCCTS_AST::
-stringscan_advance(StringLexer *scanner)
-{
- if ( *(scanner->p) == '\0' ) scanner->c = __StringScanEOF;
- scanner->c = *(scanner->p)++;
-}
-
-int PCCTS_AST::
-stringscan_gettok(StringLexer *scanner)
-{
- char *index = &scanner->text[0];
- char ebuf[100]; /* MR23 Remove static */
-
- while ( isspace(scanner->c) ) { stringscan_advance(scanner); }
- if ( isdigit(scanner->c) )
- {
- int tok = __INT;
- while ( isdigit(scanner->c) ) {
- *index++ = (char) /* static_cast<char> */ (scanner->c); // MR23
- stringscan_advance(scanner);
- }
- *index = '\0';
- return tok;
- }
- switch ( scanner->c )
- {
- case '#' : stringscan_advance(scanner); return __POUND;
- case '(' : stringscan_advance(scanner); return __LPAREN;
- case ')' : stringscan_advance(scanner); return __RPAREN;
- case '%' : stringscan_advance(scanner); return __PERCENT;
- case ':' : stringscan_advance(scanner); return __COLON;
- case '.' : stringscan_advance(scanner); return __PERIOD;
- case '\0' : return __StringScanEOF;
- case __StringScanEOF : return __StringScanEOF;
- default :
- sprintf(ebuf, "invalid char in scan: '%c'", scanner->c);
- panic(ebuf);
- }
- return __StringScanEOF; // never reached
-}
-
-const char *PCCTS_AST:: /* MR20 const */
-scan_token_str(int t)
-{
- if ( VALID_SCAN_TOKEN(t) ) return scan_token_tbl[t];
- else if ( t==__StringScanEOF ) return "<end-of-string>";
- else return "<invalid-token>";
-}
-
-//MR23
-int PCCTS_AST::printMessage(FILE* pFile, const char* pFormat, ...)
-{
- va_list marker;
- va_start( marker, pFormat );
- int iRet = vfprintf(pFile, pFormat, marker);
- va_end( marker );
- return iRet;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.h b/BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.h
deleted file mode 100644
index 3485da7d1b..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/PCCTSAST.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Abstract syntax tree
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef PCCTSAST_H
-#define PCCTSAST_H
-
-#include "pcctscfg.h"
-
-#include "pccts_stdio.h"
-#include "pccts_stdlib.h"
-
-PCCTS_NAMESPACE_STD
-
-//class SList;
-
-#define StringScanMaxText 50
-#define MaxTreeStackDepth 400
-
-//
-// 7-Apr-97 133MR1 signed int not accepted by AT&T cfront
-//
-typedef struct stringlexer {
- int c; // MR1
- char *input;
- char *p;
- char text[StringScanMaxText];
- } StringLexer;
-
-/* Define the structures needed for ast_scan() */
-typedef struct stringparser {
- int token;
- StringLexer *lexer;
- int num_labels;
- } StringParser;
-
-typedef struct _scanast {
- struct _scanast *_right, *_down;
- int _token;
- int label_num;
- int type() { return _token; }
- struct _scanast *right() { return _right; }
- struct _scanast *down() { return _down; }
- } ScanAST;
-
-#define VALID_SCAN_TOKEN(t) (t>=__LPAREN && t<=__PERIOD)
-
-class DllExportPCCTS PCCTS_AST {
-protected:
- static const char *scan_token_tbl[]; /* MR20 const */
- enum {
- __LPAREN=1,
- __RPAREN=2,
- __PERCENT=3,
- __INT=4,
- __COLON=5,
- __POUND=6,
- __PERIOD=7,
- __StringScanEOF=-1};
-
-protected:
- const char *scan_token_str(int t); /* MR20 const */
- void stringlexer_init(StringLexer *scanner, char *input);
- void stringparser_init(StringParser *, StringLexer *);
- ScanAST *stringparser_parse_scanast(char *templ, int *n);
- ScanAST *stringparser_parse_tree(StringParser *parser);
- ScanAST *stringparser_parse_element(StringParser *parser);
- void stringscan_advance(StringLexer *scanner);
- int stringscan_gettok(StringLexer *scanner);
- void _push(PCCTS_AST **st, int *sp, PCCTS_AST *e);
- PCCTS_AST *_pop(PCCTS_AST **st, int *sp);
- int match_partial(PCCTS_AST *t, PCCTS_AST *u);
- int scanmatch(ScanAST *t, PCCTS_AST **labels[], int *n);
- void scanast_free(ScanAST *t);
- ScanAST *new_scanast(int tok);
- void stringparser_match(StringParser *parser, int type);
- virtual PCCTS_AST *deepCopyBushy();
-
-public:
- PCCTS_AST() {;}
- virtual ~PCCTS_AST() {;}
-
- /* This group must be defined for SORCERER to work correctly */
- virtual PCCTS_AST *right() = 0;
- virtual PCCTS_AST *down() = 0;
- virtual void setRight(PCCTS_AST *t) = 0;
- virtual void setDown(PCCTS_AST *t) = 0;
-// we define these so ANTLR doesn't have to
- virtual int type() { return 0; }
- virtual void setType(int /*t MR23 */) {;}
- virtual PCCTS_AST *shallowCopy() {panic("no shallowCopy() defined"); return NULL;}
-
- /* These are not needed by ANTLR, but are support functions */
- virtual PCCTS_AST *deepCopy(); // used by SORCERER in transform mode
- virtual void addChild(PCCTS_AST *t);
- virtual void lisp_action(FILE * /*f MR23 */) {;}
- virtual void lisp(FILE *f);
- static PCCTS_AST *make(PCCTS_AST *rt, ...);
- virtual PCCTS_AST *ast_find_all(PCCTS_AST *u, PCCTS_AST **cursor);
- virtual int match(PCCTS_AST *u);
- virtual void insert_after(PCCTS_AST *b);
- virtual void append(PCCTS_AST *b);
- virtual PCCTS_AST *tail();
- virtual PCCTS_AST *bottom();
- static PCCTS_AST *cut_between(PCCTS_AST *a, PCCTS_AST *b);
-// virtual SList *to_slist();
- virtual void tfree();
- int ast_scan(char *templ, ...);
- virtual int nsiblings();
- virtual PCCTS_AST *sibling_index(int i);
-
- void require(int e,const char *err){ if ( !e ) panic(err); } /* MR20 const */
- virtual void panic(const char *err) // MR20 const
- { /* MR23 */ printMessage(stderr, "PCCTS_AST: %s\n", err); exit(PCCTS_EXIT_FAILURE); }
- virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23
-};
-
-#endif /* PCCTSAST_H */
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/SList.h b/BaseTools/Source/C/VfrCompile/Pccts/h/SList.h
deleted file mode 100644
index 5b8bf97427..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/SList.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef SList_h
-#define SList_h
-
-/*
- * SList.h
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public
- * domain. An individual or company may do whatever they wish with
- * source code distributed with SORCERER or the code generated by
- * SORCERER, including the incorporation of SORCERER, or its output, into
- * commerical software.
- *
- * We encourage users to develop software with SORCERER. However, we do
- * ask that credit is given to us for developing SORCERER. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like SORCERER and have developed a nice tool with the
- * output, please mention that you developed it using SORCERER. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * PCCTS 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1992-2000
- */
-
-#include "pcctscfg.h"
-
-#include "pccts_stdio.h"
-#include "pccts_stdlib.h"
-
-PCCTS_NAMESPACE_STD
-
-#include "PCCTSAST.h"
-
-class PCCTS_AST;
-
-class SListNode {
-protected:
- void *_elem; /* pointer to any kind of element */
- SListNode *_next;
-public:
- SListNode() {_elem=_next=NULL;}
- virtual ~SListNode() {_elem=_next=NULL;}
- void *elem() { return _elem; }
- void setElem(void *e) { _elem = e; }
- void setNext(SListNode *t) { _next = t; }
- SListNode *next() { return _next; }
-};
-
-class SList {
- SListNode *head, *tail;
-public:
- SList() {head=tail=NULL;}
- virtual ~SList() {head=tail=NULL;}
- virtual void *iterate(SListNode **);
- virtual void add(void *e);
- virtual void lfree();
- virtual PCCTS_AST *to_ast(SList list);
- virtual void require(int e,char *err){ if ( !e ) panic(err); }
- virtual void panic(char *err){ /* MR23 */ printMessage(stderr, "SList panic: %s\n", err); exit(PCCTS_EXIT_FAILURE); }
- virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23
-};
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/antlr.h b/BaseTools/Source/C/VfrCompile/Pccts/h/antlr.h
deleted file mode 100644
index 80664535d3..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/antlr.h
+++ /dev/null
@@ -1,807 +0,0 @@
-/* antlr.h
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ANTLR_H
-#define ANTLR_H
-
-#include "pcctscfg.h"
-
-#include "pccts_stdio.h"
-
-/* turn off warnings for unreferenced labels */
-
-#ifdef _MSC_VER
-#pragma warning(disable:4102)
-#endif
-
-/*
- * Define all of the stack setup and manipulation of $i, #i variables.
- *
- * Notes:
- * The type 'Attrib' must be defined before entry into this .h file.
- */
-
-
-#ifdef __USE_PROTOS
-#include "pccts_stdlib.h"
-#else
-#ifdef VAXC
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
-#endif
-#include "pccts_string.h"
-
-#if 0
-#include "set.h"
-#endif
-
-
-typedef int ANTLRTokenType;
-typedef unsigned char SetWordType;
-
-typedef char ANTLRChar;
-
- /* G u e s s S t u f f */
-
-#ifdef ZZCAN_GUESS
-#ifndef ZZINF_LOOK
-#define ZZINF_LOOK
-#endif
-#endif
-
-#ifdef ZZCAN_GUESS
-typedef struct _zzjmp_buf {
- jmp_buf state;
- } zzjmp_buf;
-#endif
-
-
-/* can make this a power of 2 for more efficient lookup */
-
-#ifndef ZZLEXBUFSIZE
-#define ZZLEXBUFSIZE 8000 /* MR22 raise from 2k to 8k */
-#endif
-
-#define zzOvfChk \
- if ( zzasp <= 0 ) \
- { \
- fprintf(stderr, zzStackOvfMsg, __FILE__, __LINE__); \
- exit(PCCTS_EXIT_FAILURE); \
- }
-
-#ifndef ZZA_STACKSIZE
-#define ZZA_STACKSIZE 400
-#endif
-#ifndef ZZAST_STACKSIZE
-#define ZZAST_STACKSIZE 400
-#endif
-
-#ifndef zzfailed_pred
-#ifdef ZZCAN_GUESS
-#define zzfailed_pred(_p,_hasuseraction,_useraction) \
- if (zzguessing) { \
- zzGUESS_FAIL; \
- } else { \
- zzfailed_pred_action(_p,_hasuseraction,_useraction); \
- }
-#else
-#define zzfailed_pred(_p,_hasuseraction,_useraction) \
- zzfailed_pred_action(_p,_hasuseraction,_useraction);
-#endif
-#endif
-
-/* MR23 Provide more control over failed predicate action
- without any need for user to worry about guessing internals.
- _hasuseraction == 0 => no user specified error action
- _hasuseraction == 1 => user specified error action
-*/
-
-#ifndef zzfailed_pred_action
-#define zzfailed_pred_action(_p,_hasuseraction,_useraction) \
- if (_hasuseraction) { _useraction } \
- else { fprintf(stderr, "semantic error; failed predicate: '%s'\n",_p); }
-#endif
-
-/* MR19 zzchar_t additions */
-
-#ifdef LL_K
-#define LOOKAHEAD \
- int zztokenLA[LL_K]; \
- zzchar_t zztextLA[LL_K][ZZLEXBUFSIZE]; \
- int zzlap = 0, zzlabase=0; /* labase only used for DEMAND_LOOK */
-#else
-#define LOOKAHEAD \
- int zztoken;
-#endif
-
-#ifndef zzcr_ast
-#define zzcr_ast(ast,attr,tok,text)
-#endif
-
-#ifdef DEMAND_LOOK
-#define DemandLookData int zzdirty=1;
-#else
-#define DemandLookData
-#endif
-
-#ifndef zzUSER_GUESS_HOOK
-#define zzUSER_GUESS_HOOK(seqFrozen,zzrv)
-#endif
-
-#ifndef zzUSER_GUESS_DONE_HOOK
-#define zzUSER_GUESS_DONE_HOOK(seqFrozen)
-#endif
-
- /* S t a t e S t u f f */
-
-#ifdef ZZCAN_GUESS
-#define zzGUESS_BLOCK zzantlr_state zzst; int zzrv; int zzGuessSeqFrozen;
-
-/* MR10 change zzGUESS: do zzGUESS_DONE when zzrv==1 after longjmp as in C++ mode */
-
-#define zzGUESS zzsave_antlr_state(&zzst); \
- zzguessing = 1; \
- zzGuessSeqFrozen=++zzGuessSeq; \
- zzrv = setjmp(zzguess_start.state); \
- zzUSER_GUESS_HOOK(zzGuessSeqFrozen,zzrv) \
- if (zzrv) zzGUESS_DONE;
-#ifdef zzTRACE_RULES
-#define zzGUESS_FAIL { zzTraceGuessFail(); longjmp(zzguess_start.state, 1); }
-#else
-#define zzGUESS_FAIL longjmp(zzguess_start.state, 1)
-#endif
-
-/* MR10 change zzGUESS_DONE: zzrv=1 to simulate longjmp() return value as in C++ mode */
-
-#define zzGUESS_DONE { zzrestore_antlr_state(&zzst); zzrv=1; zzUSER_GUESS_DONE_HOOK(zzGuessSeqFrozen) }
-#define zzNON_GUESS_MODE if ( !zzguessing )
-#define zzGuessData \
- zzjmp_buf zzguess_start; \
- int zzguessing;
-#else
-#define zzGUESS_BLOCK
-#define zzGUESS
-#define zzGUESS_FAIL
-#define zzGUESS_DONE
-#define zzNON_GUESS_MODE
-#define zzGuessData
-#endif
-
-typedef struct _zzantlr_state {
-#ifdef ZZCAN_GUESS
- zzjmp_buf guess_start;
- int guessing;
-#endif
- int asp;
- int ast_sp;
-#ifdef ZZINF_LOOK
- int inf_lap; /* not sure we need to save this one */
- int inf_labase;
- int inf_last;
-
-/* MR6 Gunnar Rxnning (gunnar@candleweb.no) */
-/* MR6 Additional state needs to be saved/restored */
-/* MR6 Matching changes in err.h */
-
- int *inf_tokens; /* MR6 */
- char **inf_text; /* MR6 */
- char *inf_text_buffer; /* MR6 */
- int *inf_line; /* MR6 */
-#endif
-#ifdef DEMAND_LOOK
- int dirty;
-#endif
-
-#ifdef LL_K
- int tokenLA[LL_K];
- char textLA[LL_K][ZZLEXBUFSIZE];
- int lap;
- int labase;
-#else
- int token;
- char text[ZZLEXBUFSIZE];
-#endif
-#ifdef zzTRACE_RULES
- int traceOptionValue; /* MR10 */
- int traceGuessOptionValue; /* MR10 */
- char *traceCurrentRuleName; /* MR10 */
- int traceDepth; /* MR10 */
-#endif
-
- } zzantlr_state;
-
-#ifdef zzTRACE_RULES
-extern int zzTraceOptionValueDefault;
-extern int zzTraceOptionValue;
-extern int zzTraceGuessOptionValue;
-extern char *zzTraceCurrentRuleName;
-extern int zzTraceDepth;
-#endif
-
-extern int zzGuessSeq; /* MR10 */
-extern int zzSyntaxErrCount; /* MR11 */
-extern int zzLexErrCount; /* MR11 */
-
- /* I n f i n i t e L o o k a h e a d */
-
-
-#ifdef ZZINF_LOOK
-#define InfLookData \
- int *zzinf_tokens; \
- char **zzinf_text; \
- char *zzinf_text_buffer; \
- int *zzinf_line; \
- int zzinf_labase; \
- int zzinf_last;
-#else
-#define InfLookData
-#endif
-
-#ifdef ZZINF_LOOK
-
-#ifndef ZZINF_DEF_TEXT_BUFFER_SIZE
-#define ZZINF_DEF_TEXT_BUFFER_SIZE 20000
-#endif
-#ifndef ZZINF_DEF_TOKEN_BUFFER_SIZE
-#define ZZINF_DEF_TOKEN_BUFFER_SIZE 2000
-#endif
-/* WARNING!!!!!!
- * ZZINF_BUFFER_TEXT_CHUNK_SIZE must be > sizeof(text) largest possible token.
- */
-#ifndef ZZINF_BUFFER_TEXT_CHUNK_SIZE
-#define ZZINF_BUFFER_TEXT_CHUNK_SIZE 5000
-#endif
-#ifndef ZZINF_BUFFER_TOKEN_CHUNK_SIZE
-#define ZZINF_BUFFER_TOKEN_CHUNK_SIZE 1000
-#endif
-
-#if ZZLEXBUFSIZE > ZZINF_BUFFER_TEXT_CHUNK_SIZE
-#define ZZINF_BUFFER_TEXT_CHUNK_SIZE ZZLEXBUFSIZE+5
-#endif
-
-/* make inf_look user-access macros */
-#ifdef LL_K
-#define ZZINF_LA_VALID(i) (((zzinf_labase+i-1)-LL_K+1) <= zzinf_last)
-#define ZZINF_LA(i) zzinf_tokens[(zzinf_labase+i-1)-LL_K+1]
-#define ZZINF_LATEXT(i) zzinf_text[(zzinf_labase+i-1)-LL_K+1]
-/* MR6 In 1.33 vanilla the #define ZZINF_LINE(i) is was commented out */
-#define ZZINF_LINE(i) zzinf_line[(zzinf_labase+i-1)-LL_K+1]
-#else
-#define ZZINF_LA_VALID(i) (((zzinf_labase+i-1)) <= zzinf_last)
-#define ZZINF_LA(i) zzinf_tokens[(zzinf_labase+i-1)]
-#define ZZINF_LATEXT(i) zzinf_text[(zzinf_labase+i-1)]
-#endif
-
-#define inf_zzgettok _inf_zzgettok()
-extern void _inf_zzgettok();
-
-#endif /* ZZINF_LOOK */
-
-
-#ifdef LL_K
-
-#ifdef __USE_PROTOS
-#define ANTLR_INFO \
- Attrib zzempty_attr(void) {static Attrib a; return a;} \
- Attrib zzconstr_attr(int _tok, char *_text) \
- {Attrib a; zzcr_attr((&a),_tok,_text); return a;} \
- int zzasp=ZZA_STACKSIZE; \
- char zzStackOvfMsg[]="fatal: attrib/AST stack overflow %s(%d)!\n"; \
- Attrib zzaStack[ZZA_STACKSIZE]; DemandLookData \
- InfLookData \
- zzGuessData
-#else
-#define ANTLR_INFO \
- Attrib zzempty_attr() {static Attrib a; return a;} \
- Attrib zzconstr_attr(_tok, _text) int _tok; char *_text; \
- {Attrib a; zzcr_attr((&a),_tok,_text); return a;} \
- int zzasp=ZZA_STACKSIZE; \
- char zzStackOvfMsg[]="fatal: attrib/AST stack overflow %s(%d)!\n"; \
- Attrib zzaStack[ZZA_STACKSIZE]; DemandLookData \
- InfLookData \
- zzGuessData
-#endif
-
-#else
-
-#ifdef __USE_PROTOS
-#define ANTLR_INFO \
- Attrib zzempty_attr(void) {static Attrib a; return a;} \
- Attrib zzconstr_attr(int _tok, char *_text) \
- {Attrib a; zzcr_attr((&a),_tok,_text); return a;} \
- int zzasp=ZZA_STACKSIZE; \
- char zzStackOvfMsg[]="fatal: attrib/AST stack overflow %s(%d)!\n"; \
- Attrib zzaStack[ZZA_STACKSIZE]; DemandLookData \
- InfLookData \
- zzGuessData
-#else
-#define ANTLR_INFO \
- Attrib zzempty_attr() {static Attrib a; return a;} \
- Attrib zzconstr_attr(_tok, _text) int _tok; char *_text; \
- {Attrib a; zzcr_attr((&a),_tok,_text); return a;} \
- int zzasp=ZZA_STACKSIZE; \
- char zzStackOvfMsg[]="fatal: attrib/AST stack overflow %s(%d)!\n"; \
- Attrib zzaStack[ZZA_STACKSIZE]; DemandLookData \
- InfLookData \
- zzGuessData
-#endif
-
-#endif /* LL_k */
-
-
-#ifdef ZZINF_LOOK
-
-#ifdef LL_K
-#ifdef DEMAND_LOOK
-#define zzPrimeLookAhead {zzdirty=LL_K; zzlap = zzlabase = 0;}
-#else
-#define zzPrimeLookAhead {zzlap = zzlabase = 0; zzfill_inf_look();\
- {int _i; for(_i=1;_i<=LL_K; _i++) \
- {zzCONSUME;} zzlap = zzlabase = 0;}}
-#endif
-
-#else /* LL_K */
-
-#ifdef DEMAND_LOOK
-#define zzPrimeLookAhead zzfill_inf_look(); zzdirty=1
-#else
-#define zzPrimeLookAhead zzfill_inf_look(); inf_zzgettok
-
-#endif
-#endif /* LL_K */
-
-#else /* ZZINF_LOOK */
-
-#ifdef LL_K
-#ifdef DEMAND_LOOK
-#define zzPrimeLookAhead {zzdirty=LL_K; zzlap = zzlabase = 0;}
-#else
-#define zzPrimeLookAhead {int _i; zzlap = 0; for(_i=1;_i<=LL_K; _i++) \
- {zzCONSUME;} zzlap = 0;}
-#endif
-
-#else
-
-#ifdef DEMAND_LOOK
-#define zzPrimeLookAhead zzdirty=1
-#else
-#define zzPrimeLookAhead zzgettok()
-#endif
-#endif /* LL_K */
-
-#endif /* ZZINF_LOOK */
-
-
-#ifdef LL_K
-#define zzenterANTLRs(s) \
- zzlextext = &(zztextLA[0][0]); zzrdstr( s ); zzPrimeLookAhead;
-#define zzenterANTLRf(f) \
- zzlextext = &(zztextLA[0][0]); zzrdfunc( f ); zzPrimeLookAhead;
-#define zzenterANTLR(f) \
- zzlextext = &(zztextLA[0][0]); zzrdstream( f ); zzPrimeLookAhead;
-#ifdef ZZINF_LOOK
-#define zzleaveANTLR(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line);
-#define zzleaveANTLRf(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line);
-#define zzleaveANTLRs(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line);
-#else
-#define zzleaveANTLR(f)
-#define zzleaveANTLRf(f)
-#define zzleaveANTLRs(f)
-#endif
-
-#else
-
-#define zzenterANTLRs(s) \
- {static char zztoktext[ZZLEXBUFSIZE]; \
- zzlextext = zztoktext; zzrdstr( s ); zzPrimeLookAhead;}
-#define zzenterANTLRf(f) \
- {static char zztoktext[ZZLEXBUFSIZE]; \
- zzlextext = zztoktext; zzrdfunc( f ); zzPrimeLookAhead;}
-#define zzenterANTLR(f) \
- {static char zztoktext[ZZLEXBUFSIZE]; \
- zzlextext = zztoktext; zzrdstream( f ); zzPrimeLookAhead;}
-#ifdef ZZINF_LOOK
-#define zzleaveANTLR(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line);
-#define zzleaveANTLRf(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line);
-#define zzleaveANTLRs(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line);
-#else
-#define zzleaveANTLR(f)
-#define zzleaveANTLRf(f)
-#define zzleaveANTLRs(f)
-#endif
-
-#endif
-
-/* MR19 Paul D. Smith (psmith@baynetworks.com)
- Need to adjust AST stack pointer at exit.
- Referenced in ANTLRx macros.
-*/
-
-#ifdef GENAST
-#define ZZAST_ADJUST ++zzast_sp;
-#else
-#define ZZAST_ADJUST
-#endif
-
-#define ANTLR(st, f) zzbufsize = ZZLEXBUFSIZE; \
- zzenterANTLR(f); \
- { \
- zzBLOCK(zztasp1); \
- st; /* ++zzasp; Removed MR20 G. Hobbelt */ \
- /* ZZAST_ADJUST Removed MR20 G. Hobbelt */ \
- /* MR20 G. Hobbelt. Kill the top' attribute (+AST stack corr.) */ \
- zzEXIT_ANTLR(zztasp1 + 1); \
- } \
- zzleaveANTLR(f);
-
-#define ANTLRm(st, f, _m) zzbufsize = ZZLEXBUFSIZE; \
- zzmode(_m); \
- zzenterANTLR(f); \
- { \
- zzBLOCK(zztasp1); \
- st; /* ++zzasp; Removed MR20 G. Hobbelt */ \
- /* ZZAST_ADJUST Removed MR20 G. Hobbelt */ \
- /* MR20 G. Hobbelt. Kill the top' attribute (+AST stack corr.) */ \
- zzEXIT_ANTLR(zztasp1 + 1); \
- } \
- zzleaveANTLR(f);
-
-#define ANTLRf(st, f) zzbufsize = ZZLEXBUFSIZE; \
- zzenterANTLRf(f); \
- { \
- zzBLOCK(zztasp1); \
- st; /* ++zzasp; Removed MR20 G. Hobbelt */ \
- /* ZZAST_ADJUST Removed MR20 G. Hobbelt */ \
- /* MR20 G. Hobbelt. Kill the top' attribute (+AST stack corr.) */ \
- zzEXIT_ANTLR(zztasp1 + 1); \
- } \
- zzleaveANTLRf(f);
-
-#define ANTLRs(st, s) zzbufsize = ZZLEXBUFSIZE; \
- zzenterANTLRs(s); \
- { \
- zzBLOCK(zztasp1); \
- st; /* ++zzasp; Removed MR20 G. Hobbelt */ \
- /* ZZAST_ADJUST Removed MR20 G. Hobbelt */ \
- /* MR20 G. Hobbelt. Kill the top' attribute (+AST stack corr.) */ \
- zzEXIT_ANTLR(zztasp1 + 1); \
- } \
- zzleaveANTLRs(s);
-
-#ifdef LL_K
-#define zztext (&(zztextLA[zzlap][0]))
-#else
-#define zztext zzlextext
-#endif
-
-
- /* A r g u m e n t A c c e s s */
-
-#define zzaCur (zzaStack[zzasp])
-#define zzaRet (*zzaRetPtr)
-#define zzaArg(v,n) zzaStack[v-n]
-#define zzMakeAttr { zzNON_GUESS_MODE {zzOvfChk; --zzasp; zzcr_attr(&(zzaStack[zzasp]),LA(1),LATEXT(1));}}
-#ifdef zzdef0
-#define zzMake0 { zzOvfChk; --zzasp; zzdef0(&(zzaStack[zzasp]));}
-#else
-#define zzMake0 { zzOvfChk; --zzasp;}
-#endif
-#define zzaPush(_v) { zzOvfChk; zzaStack[--zzasp] = _v;}
-#ifndef zzd_attr
-#define zzREL(t) zzasp=(t); /* Restore state of stack */
-#else
-#define zzREL(t) for (; zzasp<(t); zzasp++) \
- { zzd_attr(&(zzaStack[zzasp])); }
-#endif
-
-
-#define zzsetmatch(_es,_tokclassErrset) \
- if ( !_zzsetmatch(_es, &zzBadText, &zzMissText, &zzMissTok, &zzBadTok, &zzMissSet, _tokclassErrset) ) goto fail; /* MR23 */
-
-#ifdef ZZCAN_GUESS
-#define zzsetmatch_wsig(_es, handler) \
- if ( !_zzsetmatch_wsig(_es) ) if (zzguessing) { zzGUESS_FAIL; } else {_signal=MismatchedToken; goto handler;}
-#else
-#define zzsetmatch_wsig(_es, handler) \
- if ( !_zzsetmatch_wsig(_es) ) {_signal=MismatchedToken; goto handler;}
-#endif
-
-#ifdef __USE_PROTOS
-extern int _zzsetmatch(SetWordType *, char **, char **, int *, int *, SetWordType **, SetWordType * /* MR23 */);
-extern int _zzsetmatch_wsig(SetWordType *);
-#else
-extern int _zzsetmatch();
-extern int _zzsetmatch_wsig();
-#endif
-
-#define zzmatch(_t) \
- if ( !_zzmatch(_t, &zzBadText, &zzMissText, &zzMissTok, &zzBadTok, &zzMissSet) ) goto fail;
-
-#ifdef ZZCAN_GUESS
-#define zzmatch_wsig(_t,handler) \
- if ( !_zzmatch_wsig(_t) ) if (zzguessing) { zzGUESS_FAIL; } else {_signal=MismatchedToken; goto handler;}
-#else
-#define zzmatch_wsig(_t,handler) \
- if ( !_zzmatch_wsig(_t) ) {_signal=MismatchedToken; goto handler;}
-#endif
-
-#ifdef __USE_PROTOS
-extern int _zzmatch(int, char **, char **, int *, int *, SetWordType **);
-extern int _zzmatch_wsig(int);
-#else
-extern int _zzmatch();
-extern int _zzmatch_wsig();
-#endif
-
-#define zzmatch_wdfltsig(_t,_f) \
- if ( !_zzmatch_wdfltsig(_t,_f) ) _signal=MismatchedToken;
-#define zzsetmatch_wdfltsig(tw,tt,wf) \
- if ( !_zzsetmatch_wdfltsig(tw,tt,wf) ) _signal=MismatchedToken;
-
-#ifdef __USE_PROTOS
-extern int _zzmatch_wdfltsig(int, SetWordType *);
-extern int _zzsetmatch_wdfltsig(SetWordType *tokensWanted,
- int tokenTypeOfSet,
- SetWordType *whatFollows);
-#else
-extern int _zzmatch_wdfltsig();
-extern int _zzsetmatch_wdfltsig();
-#endif
-
-#ifdef GENAST
-#define zzRULE Attrib *zzaRetPtr = &(zzaStack[zzasp-1]); \
- SetWordType *zzMissSet=NULL; int zzMissTok=0; \
- int zzBadTok=0; char *zzBadText=""; \
- int zzErrk=1,zzpf=0; \
- zzTRACEdata \
- char *zzMissText=""; zzASTVars
-#else
-#define zzRULE Attrib *zzaRetPtr = &(zzaStack[zzasp-1]); \
- int zzBadTok=0; char *zzBadText=""; \
- int zzErrk=1,zzpf=0; \
- zzTRACEdata \
- SetWordType *zzMissSet=NULL; int zzMissTok=0; char *zzMissText=""
-#endif
-
-#ifdef GENAST
-#define zzBLOCK(i) int i = zzasp - 1; int zztsp = zzast_sp
-#define zzEXIT(i) zzREL(i); zzastREL; zzNON_GUESS_MODE { zzastPush(*_root); }
-#define zzEXIT_ANTLR(i) zzREL(i); zzastREL /* [i_a] added as we want this for the ANTLRx() macros */
-#define zzLOOP(i) zzREL(i); zzastREL
-#else
-#define zzBLOCK(i) int i = zzasp - 1
-#define zzEXIT(i) zzREL(i)
-#define zzEXIT_ANTLR(i) zzREL(i) /* [i_a] added as we want this for the ANTLRx() macros */
-#define zzLOOP(i) zzREL(i)
-#endif
-
-#ifdef LL_K
-
-#ifdef DEMAND_LOOK
-#define LOOK(_k) {int i,stop=_k-(LL_K-zzdirty); for (i=1; i<=stop; i++) \
- zzCONSUME;}
-#define zzCONSUME {zzgettok(); zzdirty--; \
- zzlap = (zzlap+1)&(LL_K-1); \
- zzlextext = &(zztextLA[zzlap][0]);}
-#else
-#ifdef ZZINF_LOOK
-#define zzCONSUME {inf_zzgettok; \
- zzlap = (zzlap+1)&(LL_K-1); \
- zzlextext = &(zztextLA[zzlap][0]); \
- }
-#else
-#define zzCONSUME {zzgettok(); \
- zzlap = (zzlap+1)&(LL_K-1); \
- zzlextext = &(zztextLA[zzlap][0]);}
-#endif /* ZZINF_LOOK */
-#endif /* DEMAND_LOOK */
-
-#else /* LL_K */
-
-#ifdef DEMAND_LOOK
-#define LOOK(_k) if ( zzdirty) zzCONSUME;
-#ifdef ZZINF_LOOK
-#define zzCONSUME inf_zzgettok; zzdirty=0;
-#else
-#define zzCONSUME zzgettok(); zzdirty=0;
-#endif /* ZZINF_LOOK */
-
-#else /* DEMAND_LOOK */
-
-#ifdef ZZINF_LOOK
-#define zzCONSUME inf_zzgettok
-#else
-#define zzCONSUME zzgettok();
-#endif
-
-#endif /* DEMAND_LOOK */
-
-#endif /* LL_K */
-
-#ifdef LL_K
-#define NLA zztokenLA[zzlap&(LL_K-1)] /* --> next LA */
-#define NLATEXT zztextLA[zzlap&(LL_K-1)] /* --> next text of LA */
-#ifdef DEMAND_LOOK
-#define LA(i) zztokenLA[(zzlabase+(i)-1)&(LL_K-1)]
-#define LATEXT(i) (&(zztextLA[(zzlabase+(i)-1)&(LL_K-1)][0]))
-#else
-#define LA(i) zztokenLA[(zzlap+(i)-1)&(LL_K-1)]
-#define LATEXT(i) (&(zztextLA[(zzlap+(i)-1)&(LL_K-1)][0]))
-#endif
-#else
-#define NLA zztoken
-#define NLATEXT zztext
-#define LA(i) zztoken
-#define LATEXT(i) zztext
-#endif
-
-
- /* S t a n d a r d S i g n a l s */
-
-#define NoSignal 0
-#define MismatchedToken 1
-#define NoViableAlt 2
-#define NoSemViableAlt 3
-
-/* MR7 Allow more control over signalling */
-/* by adding "Unwind" and "zzsetSignal" */
-
-#define Unwind 4
-#define zzsetSignal(newValue) *_retsignal=_signal=(newValue)
-#define zzsuppressSignal *_retsignal=_signal=0
-#define zzexportSignal *_retsignal=_signal
-
- /* F u n c t i o n T r a c i n g */
-
-#ifndef zzTRACE_RULES
-#define zzTRACEdata
-#else
-#ifndef zzTRACEdata
-#define zzTRACEdata ANTLRChar *zzTracePrevRuleName = NULL;
-#endif
-#endif
-
-#ifndef zzTRACEIN
-#define zzTRACEIN(r) zzTracePrevRuleName=zzTraceCurrentRuleName;zzTraceIn(r);
-#endif
-#ifndef zzTRACEOUT
-#define zzTRACEOUT(r) zzTraceOut(r);zzTraceCurrentRuleName=zzTracePrevRuleName;
-#endif
-
-/* MR19 zzchar_t additions */
-
-#ifndef zzchar_t
-#ifdef ZZWCHAR_T
-#define zzchar_t wchar_t
-#else
-#define zzchar_t char
-#endif
-#endif
-
-
-/* MR26 */
-
-#ifdef PCCTS_USE_STDARG
-extern void zzFAIL(int k, ...);
-#else
-extern void zzFAIL();
-#endif
- /* E x t e r n D e f s */
-
-#ifdef __USE_PROTOS
-extern Attrib zzempty_attr(void);
-extern Attrib zzconstr_attr(int, char *);
-extern void zzsyn(char *, int, char *, SetWordType *, int, int, char *);
-extern int zzset_el(unsigned, SetWordType *);
-extern int zzset_deg(SetWordType *);
-extern void zzedecode(SetWordType *);
-
-extern void zzresynch(SetWordType *, SetWordType);
-extern void zzsave_antlr_state(zzantlr_state *);
-extern void zzrestore_antlr_state(zzantlr_state *);
-extern void zzfill_inf_look(void);
-extern void zzconsumeUntil(SetWordType *st); /* MR7 */
-extern void zzconsumeUntilToken(int t); /* MR7 */
-extern void zzTraceIn(char * ruleName); /* MR10 */
-extern void zzTraceOut(char * ruleName); /* MR10 */
-extern int zzTraceOption(int delta); /* MR10 */
-extern int zzTraceGuessOption(int delta); /* MR10 */
-extern void zzTraceReset(void); /* MR10 */
-extern void zzTraceGuessFail(void); /* MR10 */
-#ifdef EXCEPTION_HANDLING
-extern void zzdflthandlers(int, int *);
-#endif
-#else
-extern Attrib zzempty_attr();
-extern Attrib zzconstr_attr();
-extern void zzsyn();
-extern int zzset_el();
-extern int zzset_deg();
-extern void zzedecode();
-extern void zzresynch();
-extern void zzsave_antlr_state();
-extern void zzrestore_antlr_state();
-extern void zzfill_inf_look();
-extern void zzconsumeUntil(); /* MR7 */
-extern void zzconsumeUntilToken(); /* MR7 */
-extern void zzTraceIn(); /* MR10 */
-extern void zzTraceOut(); /* MR10 */
-extern int zzTraceOption(); /* MR10 */
-extern int zzTraceGuessOption(); /* MR10 */
-extern void zzTraceReset(); /* MR10 */
-extern void zzTraceGuessFail(); /* MR10 */
-#ifdef EXCEPTION_HANDLING
-extern void zzdflthandlers();
-#endif
-#endif
-
- /* G l o b a l V a r i a b l e s */
-
-/* Define a parser; user should do a "#parser myname" in their grammar file */
-/*extern struct pccts_parser zzparser;*/
-
-extern char *zztokens[];
-#ifdef LL_K
-extern int zztokenLA[];
-extern zzchar_t zztextLA[][ZZLEXBUFSIZE];
-extern int zzlap;
-extern int zzlabase;
-#else
-extern int zztoken;
-#endif
-
-extern char zzStackOvfMsg[];
-extern int zzasp;
-extern Attrib zzaStack[];
-#ifdef ZZINF_LOOK
-extern int *zzinf_tokens;
-extern char **zzinf_text;
-extern char *zzinf_text_buffer;
-extern int *zzinf_line;
-extern int zzinf_labase;
-extern int zzinf_last;
-#endif
-#ifdef DEMAND_LOOK
-extern int zzdirty;
-#endif
-#ifdef ZZCAN_GUESS
-extern int zzguessing;
-extern zzjmp_buf zzguess_start;
-#endif
-
-/* Define global veriables that refer to values exported by the scanner.
- * These declarations duplicate those in dlgdef.h, but are needed
- * if ANTLR is not to generate a .dlg file (-gx); PS, this is a hack.
- */
-extern zzchar_t *zzlextext; /* text of most recently matched token */
-extern int zzbufsize; /* how long zzlextext is */
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ast.c b/BaseTools/Source/C/VfrCompile/Pccts/h/ast.c
deleted file mode 100644
index 9326ae16ae..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/ast.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/* Abstract syntax tree manipulation functions
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#include "pcctscfg.h"
-
-#ifdef PCCTS_USE_STDARG
-#include "pccts_stdarg.h"
-#else
-#include <varargs.h>
-#endif
-
-/* ensure that tree manipulation variables are current after a rule
- * reference
- */
-
-void
-#ifdef __USE_PROTOS
-zzlink(AST **_root, AST **_sibling, AST **_tail)
-#else
-zzlink(_root, _sibling, _tail)
-AST **_root, **_sibling, **_tail;
-#endif
-{
- if ( *_sibling == NULL ) return;
- if ( *_root == NULL ) *_root = *_sibling;
- else if ( *_root != *_sibling ) (*_root)->down = *_sibling;
- if ( *_tail==NULL ) *_tail = *_sibling;
- while ( (*_tail)->right != NULL ) *_tail = (*_tail)->right;
-}
-
-AST *
-#ifdef __USE_PROTOS
-zzastnew(void)
-#else
-zzastnew()
-#endif
-{
- AST *p = (AST *) calloc(1, sizeof(AST));
- if ( p == NULL ) fprintf(stderr,"%s(%d): cannot allocate AST node\n",__FILE__,__LINE__);
- return p;
-}
-
-/* add a child node to the current sibling list */
-void
-#ifdef __USE_PROTOS
-zzsubchild(AST **_root, AST **_sibling, AST **_tail)
-#else
-zzsubchild(_root, _sibling, _tail)
-AST **_root, **_sibling, **_tail;
-#endif
-{
- AST *n;
- zzNON_GUESS_MODE {
- n = zzastnew();
-#ifdef DEMAND_LOOK
- zzcr_ast(n, &(zzaCur), LA(0), LATEXT(0));
-#else
- zzcr_ast(n, &(zzaCur), LA(1), LATEXT(1));
-#endif
- zzastPush( n );
- if ( *_tail != NULL ) (*_tail)->right = n;
- else {
- *_sibling = n;
- if ( *_root != NULL ) (*_root)->down = *_sibling;
- }
- *_tail = n;
- if ( *_root == NULL ) *_root = *_sibling;
- }
-}
-
-/* make a new AST node. Make the newly-created
- * node the root for the current sibling list. If a root node already
- * exists, make the newly-created node the root of the current root.
- */
-void
-#ifdef __USE_PROTOS
-zzsubroot(AST **_root, AST **_sibling, AST **_tail)
-#else
-zzsubroot(_root, _sibling, _tail)
-AST **_root, **_sibling, **_tail;
-#endif
-{
- AST *n;
- zzNON_GUESS_MODE {
- n = zzastnew();
-#ifdef DEMAND_LOOK
- zzcr_ast(n, &(zzaCur), LA(0), LATEXT(0));
-#else
- zzcr_ast(n, &(zzaCur), LA(1), LATEXT(1));
-#endif
- zzastPush( n );
- if ( *_root != NULL )
- if ( (*_root)->down == *_sibling ) *_sibling = *_tail = *_root;
- *_root = n;
- (*_root)->down = *_sibling;
- }
-}
-
-/* Apply function to root then each sibling
- * example: print tree in child-sibling LISP-format (AST has token field)
- *
- * void show(tree)
- * AST *tree;
- * {
- * if ( tree == NULL ) return;
- * printf(" %s", zztokens[tree->token]);
- * }
- *
- * void before() { printf(" ("); }
- * void after() { printf(" )"); }
- *
- * LISPdump() { zzpre_ast(tree, show, before, after); }
- *
- */
-void
-#ifdef __USE_PROTOS
-zzpre_ast(
- AST *tree,
- void (*func)(AST *), /* apply this to each tree node */
- void (*before)(AST *), /* apply this to root of subtree before preordering it */
- void (*after)(AST *)) /* apply this to root of subtree after preordering it */
-#else
-zzpre_ast(tree, func, before, after)
-AST *tree;
-void (*func)(), /* apply this to each tree node */
- (*before)(), /* apply this to root of subtree before preordering it */
- (*after)(); /* apply this to root of subtree after preordering it */
-#endif
-{
- while ( tree!= NULL )
- {
- if ( tree->down != NULL ) (*before)(tree);
- (*func)(tree);
- zzpre_ast(tree->down, func, before, after);
- if ( tree->down != NULL ) (*after)(tree);
- tree = tree->right;
- }
-}
-
-/* free all AST nodes in tree; apply func to each before freeing */
-
-#if 0
-////void
-////#ifdef __USE_PROTOS
-////zzfree_ast(AST *tree)
-////#else
-////zzfree_ast(tree)
-////AST *tree;
-////#endif
-////{
-//// if ( tree == NULL ) return;
-//// zzfree_ast( tree->down );
-//// zzfree_ast( tree->right );
-//// zztfree( tree );
-////}
-#endif
-
-/*
- MR19 Optimize freeing of the following structure to limit recursion
- SAKAI Kiyotaka (ksakai@isr.co.jp)
-*/
-
-/*
- NULL o
- / \
- NULL o
- / \
- NULL NULL
-*/
-
-/*
- MR21 Another refinement to replace recursion with iteration
- NAKAJIMA Mutsuki (muc@isr.co.jp).
-*/
-
-void
-#ifdef __USE_PROTOS
-zzfree_ast(AST *tree)
-#else
-zzfree_ast(tree)
-AST *tree;
-#endif
-{
-
- AST *otree;
-
- if (tree == NULL) return;
-
- while (tree->down == NULL || tree->right == NULL) {
-
- if (tree->down == NULL && tree->right == NULL) {
- zztfree(tree);
- return;
- }
-
- otree = tree;
- if (tree->down == NULL) {
- tree = tree->right;
- } else {
- tree = tree->down;
- }
- zztfree( otree );
- }
-
- while (tree != NULL) {
- zzfree_ast(tree->down);
- otree = tree;
- tree = otree->right;
- zztfree(otree);
- }
-}
-
-/* build a tree (root child1 child2 ... NULL)
- * If root is NULL, simply make the children siblings and return ptr
- * to 1st sibling (child1). If root is not single node, return NULL.
- *
- * Siblings that are actually siblins lists themselves are handled
- * correctly. For example #( NULL, #( NULL, A, B, C), D) results
- * in the tree ( NULL A B C D ).
- *
- * Requires at least two parameters with the last one being NULL. If
- * both are NULL, return NULL.
- */
-#ifdef PCCTS_USE_STDARG
-AST *zztmake(AST *rt, ...)
-#else
-AST *zztmake(va_alist)
-va_dcl
-#endif
-{
- va_list ap;
- register AST *child, *sibling=NULL, *tail=NULL /* MR20 */, *w;
- AST *root;
-
-#ifdef PCCTS_USE_STDARG
- va_start(ap, rt);
- root = rt;
-#else
- va_start(ap);
- root = va_arg(ap, AST *);
-#endif
-
- if ( root != NULL )
- if ( root->down != NULL ) return NULL;
- child = va_arg(ap, AST *);
- while ( child != NULL )
- {
- for (w=child; w->right!=NULL; w=w->right) {;} /* find end of child */
- if ( sibling == NULL ) {sibling = child; tail = w;}
- else {tail->right = child; tail = w;}
- child = va_arg(ap, AST *);
- }
- if ( root==NULL ) root = sibling;
- else root->down = sibling;
- va_end(ap);
- return root;
-}
-
-/* tree duplicate */
-AST *
-#ifdef __USE_PROTOS
-zzdup_ast(AST *t)
-#else
-zzdup_ast(t)
-AST *t;
-#endif
-{
- AST *u;
-
- if ( t == NULL ) return NULL;
- u = zzastnew();
- *u = *t;
-#ifdef zzAST_DOUBLE
- u->up = NULL; /* set by calling invocation */
- u->left = NULL;
-#endif
- u->right = zzdup_ast(t->right);
- u->down = zzdup_ast(t->down);
-#ifdef zzAST_DOUBLE
- if ( u->right!=NULL ) u->right->left = u;
- if ( u->down!=NULL ) u->down->up = u;
-#endif
- return u;
-}
-
-void
-#ifdef __USE_PROTOS
-zztfree(AST *t)
-#else
-zztfree(t)
-AST *t;
-#endif
-{
-#ifdef zzd_ast
- zzd_ast( t );
-#endif
- free( t );
-}
-
-#ifdef zzAST_DOUBLE
-/*
- * Set the 'up', and 'left' pointers of all nodes in 't'.
- * Initial call is double_link(your_tree, NULL, NULL).
- */
-void
-#ifdef __USE_PROTOS
-zzdouble_link(AST *t, AST *left, AST *up)
-#else
-zzdouble_link(t, left, up)
-AST *t, *left, *up;
-#endif
-{
- if ( t==NULL ) return;
- t->left = left;
- t->up = up;
- zzdouble_link(t->down, NULL, t);
- zzdouble_link(t->right, t, up);
-}
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ast.h b/BaseTools/Source/C/VfrCompile/Pccts/h/ast.h
deleted file mode 100644
index 5ff84bd76c..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/ast.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Abstract syntax tree
- *
- * Macros, definitions
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ZZAST_H
-#define ZZAST_H
-
-#define zzastOvfChk \
- if ( zzast_sp <= 0 ) \
- { \
- fprintf(stderr, zzStackOvfMsg, __FILE__, __LINE__); \
- exit(PCCTS_EXIT_FAILURE); \
- }
-
-#ifndef USER_DEFINED_AST
-#ifndef AST_FIELDS
-#define AST_FIELDS
-#endif
-
-typedef struct _ast {
- struct _ast *right, *down;
-#ifdef zzAST_DOUBLE
- struct _ast *left, *up;
-#endif
- AST_FIELDS
-} AST;
-
-#else
-
-#ifdef zzAST_DOUBLE
-#define AST_REQUIRED_FIELDS struct _ast *right, *down, *left, *up;
-#else
-#define AST_REQUIRED_FIELDS struct _ast *right, *down;
-#endif
-
-#endif
-
-
-/* N o d e a c c e s s m a c r o s */
-#define zzchild(t) (((t)==NULL)? (AST *) NULL:(t->down)) /* MR19 */
-#define zzsibling(t) (((t)==NULL)? (AST *) NULL:(t->right)) /* MR19 */
-
-
-/* define global variables needed by #i stack */
-#define zzASTgvars \
- AST *zzastStack[ZZAST_STACKSIZE]; \
- int zzast_sp = ZZAST_STACKSIZE;
-
-#define zzASTVars AST *_ast = NULL, *_sibling = NULL, *_tail = NULL
-#define zzSTR ( (_tail==NULL)?(&_sibling):(&(_tail->right)) )
-#define zzastCur (zzastStack[zzast_sp])
-#define zzastArg(i) (zzastStack[zztsp-i])
-#define zzastPush(p) zzastOvfChk; zzastStack[--zzast_sp] = p;
-#define zzastDPush --zzast_sp
-#define zzastMARK zztsp=zzast_sp; /* Save state of stack */
-#define zzastREL zzast_sp=zztsp; /* Return state of stack */
-#define zzrm_ast {zzfree_ast(*_root); _tail = _sibling = (*_root)=NULL;}
-
-extern int zzast_sp;
-extern AST *zzastStack[];
-
-/* MR26 */
-
-#ifdef PCCTS_USE_STDARG
-AST *zztmake(AST *, ...);
-#else
-AST *zztmake();
-#endif
-
-#ifdef __USE_PROTOS
-void zzlink(AST **, AST **, AST **);
-void zzsubchild(AST **, AST **, AST **);
-void zzsubroot(AST **, AST **, AST **);
-void zzpre_ast(AST *, void (*)(AST *), void (*)(AST *), void (*)(AST *));
-void zzfree_ast(AST *);
-AST *zzdup_ast(AST *);
-void zztfree(AST *);
-void zzdouble_link(AST *, AST *, AST *);
-AST *zzastnew(void);
-
-#else
-
-void zzlink();
-AST *zzastnew();
-void zzsubchild();
-void zzsubroot();
-void zzpre_ast();
-void zzfree_ast();
-AST *zzdup_ast();
-void zztfree();
-void zzdouble_link();
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/charbuf.h b/BaseTools/Source/C/VfrCompile/Pccts/h/charbuf.h
deleted file mode 100644
index 5f01c8ba35..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/charbuf.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ANTLR attribute definition -- constant width text
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ZZCHARBUF_H
-#define ZZCHARBUF_H
-
-#include "pcctscfg.h"
-
-#include "pccts_string.h"
-
-#ifndef D_TextSize
-#define D_TextSize 30
-#endif
-
-typedef struct { char text[D_TextSize]; } Attrib;
-
-#define zzcr_attr(a,tok,t) strncpy((a)->text, t, D_TextSize-1); \
- (a)->text[D_TextSize-1] = '\0';
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/charptr.c b/BaseTools/Source/C/VfrCompile/Pccts/h/charptr.c
deleted file mode 100644
index d3f80e60ba..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/charptr.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#include "pcctscfg.h"
-
-#ifdef __STDC__
-#include "pccts_stdlib.h"
-#else
-#include <malloc.h>
-#endif
-#include "pccts_string.h"
-
-/* 133MR1 include stdio.h for fprintf in charptr.c */
-
-#include "pccts_stdio.h"
-
-/* 133MR1 include charptr.h for Attrib in charptr.c */
-
-#include "charptr.h"
-
-#ifdef __USE_PROTOS
-zzcr_attr(Attrib *a,int token,char *text)
-#else
-zzcr_attr(a,token,text)
-Attrib *a;
-int token;
-char *text;
-#endif
-{
- *a = (char *) malloc(strlen(text)+1); /* MR6 */
- if ( *a == NULL ) {fprintf(stderr, "zzcr_attr: out of memory!\n"); exit(-1);}
- strcpy(*a, text);
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/charptr.h b/BaseTools/Source/C/VfrCompile/Pccts/h/charptr.h
deleted file mode 100644
index e73da681a4..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/charptr.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-/*
- * WARNING!!!!: charptr.h does NOT make copies and the
- * memory is freed after the attribute scope exits.
- */
-
-#ifndef ZZCHARPTR_H
-#define ZZCHARPTR_H
-
-typedef char *Attrib;
-#define zzdef0(a) {*(a)=NULL;}
-/* MR8 Jens Tingleff (jensting@imaginet.fr) */
-/* Set memory pointer to null after free() */
-#define zzd_attr(a) {if ( *(a)!=NULL ) {free(*(a)); *(a)=NULL; }; }
-
-#ifdef __STDC__
-extern zzcr_attr(Attrib *,int,char *);
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/config.h b/BaseTools/Source/C/VfrCompile/Pccts/h/config.h
deleted file mode 100644
index 8aa50ad618..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/config.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "pcctscfg.h"
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/dlgauto.h b/BaseTools/Source/C/VfrCompile/Pccts/h/dlgauto.h
deleted file mode 100644
index db94cefaca..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/dlgauto.h
+++ /dev/null
@@ -1,504 +0,0 @@
-/* dlgauto.h automaton
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Will Cohen and Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ZZDEFAUTO_H
-#define ZZDEFAUTO_H
-
-/* 10-Apr-97 133MR1 Uses __USE_PROTOS show should #include pcctscfg.h */
-
-#include "pcctscfg.h"
-
-zzchar_t *zzlextext; /* text of most recently matched token */
-zzchar_t *zzbegexpr; /* beginning of last reg expr recogn. */
-zzchar_t *zzendexpr; /* beginning of last reg expr recogn. */
-int zzbufsize = 0; /* number of characters in zzlextext */ /* MR7 */
-int zzbegcol = 0; /* column that first character of token is in*/
-int zzendcol = 0; /* column that last character of token is in */
-int zzline = 1; /* line current token is on */
-int zzreal_line=1; /* line of 1st portion of token that is not skipped */
-int zzchar; /* character to determine next state */
-int zzbufovf; /* indicates that buffer too small for text */
-int zzcharfull = 0;
-static zzchar_t *zznextpos;/* points to next available position in zzlextext*/
-static int zzclass;
-
-#ifdef __USE_PROTOS
-void zzerrstd(const char *);
-void (*zzerr)(const char *)=zzerrstd;/* pointer to error reporting function */
-extern int zzerr_in(void);
-static int (*zzfunc_in)(void) = zzerr_in; /* MR20 */
-#else
-void zzerrstd();
-void (*zzerr)()=zzerrstd; /* pointer to error reporting function */
-extern int zzerr_in();
-static int (*zzfunc_in)() = zzerr_in; /* MR20 */
-#endif
-
-static FILE *zzstream_in=0;
-static zzchar_t *zzstr_in=0;
-
-#ifdef USER_ZZMODE_STACK
-int zzauto = 0;
-#else
-static int zzauto = 0;
-#endif
-static int zzadd_erase;
-static char zzebuf[70];
-
-#ifdef ZZCOL
-#define ZZINC (++zzendcol)
-#else
-#define ZZINC
-#endif
-
-
-#define ZZGETC_STREAM {zzchar = getc(zzstream_in); zzclass = ZZSHIFT(zzchar);}
-#define ZZGETC_FUNC {zzchar = (*zzfunc_in)(); zzclass = ZZSHIFT(zzchar);}
-#define ZZGETC_STR { \
- if (*zzstr_in){ \
- zzchar = *zzstr_in; \
- ++zzstr_in; \
- }else{ \
- zzchar = EOF; \
- } \
- zzclass = ZZSHIFT(zzchar); \
-}
-
-#define ZZNEWSTATE (newstate = dfa[state][zzclass])
-
-#ifndef ZZCOPY
-#define ZZCOPY \
- /* Truncate matching buffer to size (not an error) */ \
- if (zznextpos < lastpos){ \
- *(zznextpos++) = zzchar; \
- }else{ \
- zzbufovf = 1; \
- }
-#endif
-
-void
-#ifdef __USE_PROTOS
-zzrdstream( FILE *f )
-#else
-zzrdstream( f )
-FILE *f;
-#endif
-{
- /* make sure that it is really set to something, otherwise just
- leave it be.
- */
- if (f){
- /* make sure that there is always someplace to get input
- before closing zzstream_in
- */
-#if 0
- if (zzstream_in && zzstream_in!=stdin) fclose( zzstream_in );
-#endif
- zzline = 1;
- zzstream_in = f;
- zzfunc_in = NULL;
- zzstr_in = 0;
- zzcharfull = 0;
- }
-}
-
-void
-#ifdef __USE_PROTOS
-zzrdfunc( int (*f)(void) )
-#else
-zzrdfunc( f )
-int (*f)();
-#endif
-{
- /* make sure that it is really set to something, otherwise just
- leave it be.
- */
- if (f){
- /* make sure that there is always someplace to get input
- before closing zzstream_in
- */
-#if 0
- if (zzstream_in && zzstream_in!=stdin) fclose( zzstream_in );
-#endif
- zzline = 1;
- zzstream_in = NULL;
- zzfunc_in = f;
- zzstr_in = 0;
- zzcharfull = 0;
- }
-}
-
-
-void
-#ifdef __USE_PROTOS
-zzrdstr( zzchar_t *s )
-#else
-zzrdstr( s )
-zzchar_t *s;
-#endif
-{
- /* make sure that it is really set to something, otherwise just
- leave it be.
- */
- if (s){
- /* make sure that there is always someplace to get input
- before closing zzstream_in
- */
-#if 0
- if (zzstream_in && zzstream_in!=stdin) fclose( zzstream_in );
-#endif
- zzline = 1;
- zzstream_in = NULL;
- zzfunc_in = 0;
- zzstr_in = s;
- zzcharfull = 0;
- }
-}
-
-
-#ifdef __USE_PROTOS
-void zzclose_stream(void)
-#else
-void zzclose_stream()
-#endif
-{
-#if 0
- fclose( zzstream_in );
- zzstream_in = NULL;
- zzfunc_in = NULL;
-#endif
-}
-
-/* saves dlg state, but not what feeds dlg (such as file position) */
-void
-#ifdef __USE_PROTOS
-zzsave_dlg_state(struct zzdlg_state *state)
-#else
-zzsave_dlg_state(state)
-struct zzdlg_state *state;
-#endif
-{
- state->stream = zzstream_in;
- state->func_ptr = zzfunc_in;
- state->str = zzstr_in;
- state->auto_num = zzauto;
- state->add_erase = zzadd_erase;
- state->lookc = zzchar;
- state->char_full = zzcharfull;
- state->begcol = zzbegcol;
- state->endcol = zzendcol;
- state->line = zzline;
- state->lextext = zzlextext;
- state->begexpr = zzbegexpr;
- state->endexpr = zzendexpr;
- state->bufsize = zzbufsize;
- state->bufovf = zzbufovf;
- state->nextpos = zznextpos;
- state->class_num = zzclass;
-}
-
-void
-#ifdef __USE_PROTOS
-zzrestore_dlg_state(struct zzdlg_state *state)
-#else
-zzrestore_dlg_state(state)
-struct zzdlg_state *state;
-#endif
-{
- zzstream_in = state->stream;
- zzfunc_in = state->func_ptr;
- zzstr_in = state->str;
- zzauto = state->auto_num;
- zzadd_erase = state->add_erase;
- zzchar = state->lookc;
- zzcharfull = state->char_full;
- zzbegcol = state->begcol;
- zzendcol = state->endcol;
- zzline = state->line;
- zzlextext = state->lextext;
- zzbegexpr = state->begexpr;
- zzendexpr = state->endexpr;
- zzbufsize = state->bufsize;
- zzbufovf = state->bufovf;
- zznextpos = state->nextpos;
- zzclass = state->class_num;
-}
-
-void
-#ifdef __USE_PROTOS
-zzmode( int m )
-#else
-zzmode( m )
-int m;
-#endif
-{
- /* points to base of dfa table */
- if (m<MAX_MODE){
- zzauto = m;
- /* have to redo class since using different compression */
- zzclass = ZZSHIFT(zzchar);
- }else{
- sprintf(zzebuf,"Invalid automaton mode = %d ",m);
- zzerr(zzebuf);
- }
-}
-
-/* erase what is currently in the buffer, and get a new reg. expr */
-
-#ifdef __USE_PROTOS
-void zzskip(void)
-#else
-void zzskip()
-#endif
-{
- zzadd_erase = 1;
-}
-
-/* don't erase what is in the zzlextext buffer, add on to it */
-#ifdef __USE_PROTOS
-void zzmore()
-#else
-void zzmore()
-#endif
-{
- zzadd_erase = 2;
-}
-
-/* substitute c for the reg. expr last matched and is in the buffer */
-#ifdef __USE_PROTOS
-void
-zzreplchar(zzchar_t c)
-#else
-void
-zzreplchar(c)
-zzchar_t c;
-#endif
-{
- /* can't allow overwriting null at end of string */
- if (zzbegexpr < &zzlextext[zzbufsize-1]){
- *zzbegexpr = c;
- *(zzbegexpr+1) = '\0';
- }
- zzendexpr = zzbegexpr;
- if (c != '\0') {
- zznextpos = zzbegexpr + 1;
- }
- else {
- zznextpos = zzbegexpr; /* MR30 Zero terminates string. */
- }
-}
-
-/* replace the string s for the reg. expr last matched and in the buffer */
-void
-#ifdef __USE_PROTOS
-zzreplstr(register zzchar_t *s)
-#else
-zzreplstr(s)
-register zzchar_t *s;
-#endif
-{
- register zzchar_t *l= &zzlextext[zzbufsize -1];
-
- zznextpos = zzbegexpr;
- if (s){
- while ((zznextpos <= l) && (*(zznextpos++) = *(s++))!=0){
- /* empty */
- }
- /* correct for NULL at end of string */
- zznextpos--;
- }
- if ((zznextpos <= l) && (*(--s) == 0)){
- zzbufovf = 0;
- }else{
- zzbufovf = 1;
- }
- *(zznextpos) = '\0';
- zzendexpr = zznextpos - 1;
-}
-
-#ifdef __USE_PROTOS
-void zzgettok(void)
-#else
-void zzgettok()
-#endif
-{
- register int state, newstate;
- /* last space reserved for the null char */
- zzchar_t *lastpos; /* MR27 Remove register since address operator used. */
-
-skip:
- zzreal_line = zzline;
- zzbufovf = 0;
- lastpos = &zzlextext[zzbufsize-1];
- zznextpos = zzlextext;
- zzbegcol = zzendcol+1;
-more:
- zzbegexpr = zznextpos;
-#ifdef ZZINTERACTIVE
- /* interactive version of automaton */
- /* if there is something in zzchar, process it */
- state = newstate = dfa_base[zzauto];
- if (zzcharfull){
- ZZINC;
- ZZCOPY;
- ZZNEWSTATE;
- }
- if (zzstr_in)
- while (zzalternatives[newstate]){
- state = newstate;
- ZZGETC_STR;
- ZZINC;
- ZZCOPY;
- ZZNEWSTATE;
- }
- else if (zzstream_in)
- while (zzalternatives[newstate]){
- state = newstate;
- ZZGETC_STREAM;
- ZZINC;
- ZZCOPY;
- ZZNEWSTATE;
- }
- else if (zzfunc_in)
- while (zzalternatives[newstate]){
- state = newstate;
- ZZGETC_FUNC;
- ZZINC;
- ZZCOPY;
- ZZNEWSTATE;
- }
- /* figure out if last character really part of token */
- if ((state != dfa_base[zzauto]) && (newstate == DfaStates)){
- zzcharfull = 1;
- --zznextpos;
- }else{
- zzcharfull = 0;
- state = newstate;
- }
- *(zznextpos) = '\0';
- /* Able to transition out of start state to some non err state?*/
- if ( state == dfa_base[zzauto] ){
- /* make sure doesn't get stuck */
- zzadvance();
- }
-#else
- /* non-interactive version of automaton */
- if (!zzcharfull)
- zzadvance();
- else
- ZZINC;
- state = dfa_base[zzauto];
- if (zzstr_in)
- while (ZZNEWSTATE != DfaStates){
- state = newstate;
- ZZCOPY;
- ZZGETC_STR;
- ZZINC;
- }
- else if (zzstream_in)
- while (ZZNEWSTATE != DfaStates){
- state = newstate;
- ZZCOPY;
- ZZGETC_STREAM;
- ZZINC;
- }
- else if (zzfunc_in)
- while (ZZNEWSTATE != DfaStates){
- state = newstate;
- ZZCOPY;
- ZZGETC_FUNC;
- ZZINC;
- }
- zzcharfull = 1;
- if ( state == dfa_base[zzauto] ){
- if (zznextpos < lastpos){
- *(zznextpos++) = zzchar;
- }else{
- zzbufovf = 1;
- }
- *zznextpos = '\0';
- /* make sure doesn't get stuck */
- zzadvance();
- }else{
- *zznextpos = '\0';
- }
-#endif
-#ifdef ZZCOL
- zzendcol -= zzcharfull;
-#endif
- zzendexpr = zznextpos -1;
- zzadd_erase = 0;
- (*actions[accepts[state]])();
- switch (zzadd_erase) {
- case 1: goto skip;
- case 2: goto more;
- }
-}
-
-#ifdef __USE_PROTOS
-void zzadvance(void)
-#else
-void zzadvance()
-#endif
-{
- if (zzstream_in) { ZZGETC_STREAM; zzcharfull = 1; ZZINC;}
- if (zzfunc_in) { ZZGETC_FUNC; zzcharfull = 1; ZZINC;}
- if (zzstr_in) { ZZGETC_STR; zzcharfull = 1; ZZINC;}
- if (!(zzstream_in || zzfunc_in || zzstr_in)){
- zzerr_in();
- }
-}
-
-void
-#ifdef __USE_PROTOS
-zzerrstd(const char *s)
-#else
-zzerrstd(s)
-char *s;
-#endif
-{
- zzLexErrCount++; /* MR11 */
- fprintf(stderr,
- "%s near line %d (text was '%s')\n",
- ((s == NULL) ? "Lexical error" : s),
- zzline,zzlextext);
-}
-
-#ifdef __USE_PROTOS
-int zzerr_in(void)
-#else
-int zzerr_in()
-#endif
-{
- fprintf(stderr,"No input stream, function, or string\n");
- /* return eof to get out gracefully */
- return EOF;
-}
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/dlgdef.h b/BaseTools/Source/C/VfrCompile/Pccts/h/dlgdef.h
deleted file mode 100644
index 733d2568e3..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/dlgdef.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* dlgdef.h
- * Things in scanner produced by dlg that should be visible to the outside
- * world
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ZZDLGDEF_H
-#define ZZDLGDEF_H
-
-#include "pcctscfg.h"
-
-#ifndef zzchar_t
-#ifdef ZZWCHAR_T
-#define zzchar_t wchar_t
-#else
-#define zzchar_t char
-#endif
-#endif
-
-struct zzdlg_state {
- FILE *stream;
-#ifdef __USE_PROTOS
- int (*func_ptr)(void);
-#else
- int (*func_ptr)();
-#endif
- zzchar_t *str;
- int auto_num;
- int add_erase;
- int lookc;
- int char_full;
- int begcol, endcol;
- int line;
- zzchar_t *lextext, *begexpr, *endexpr;
- int bufsize;
- int bufovf;
- zzchar_t *nextpos;
- int class_num;
-};
-
-extern zzchar_t *zzlextext; /* text of most recently matched token */
-extern zzchar_t *zzbegexpr; /* beginning of last reg expr recogn. */
-extern zzchar_t *zzendexpr; /* beginning of last reg expr recogn. */
-extern int zzbufsize; /* how long zzlextext is */
-extern int zzbegcol; /* column that first character of token is in*/
-extern int zzendcol; /* column that last character of token is in */
-extern int zzline; /* line current token is on */
-extern int zzreal_line; /* line of 1st portion of token that is not skipped */
-extern int zzchar; /* character to determine next state */
-extern int zzbufovf; /* indicates that buffer too small for text */
-#ifdef __USE_PROTOS
-extern void (*zzerr)(const char *);/* pointer to error reporting function */
-#else
-extern void (*zzerr)();
-#endif
-
-#ifdef USER_ZZMODE_STACK
-extern int zzauto;
-#endif
-
-#ifdef __USE_PROTOS
-extern void zzadvance(void);
-extern void zzskip(void); /* erase zzlextext, look for antoher token */
-extern void zzmore(void); /* keep zzlextext, look for another token */
-extern void zzmode(int k); /* switch to automaton 'k' */
-extern void zzrdstream(FILE *);/* what stream to read from */
-extern void zzclose_stream(void);/* close the current input stream */
-extern void zzrdfunc(int (*)(void));/* what function to get char from */
-extern void zzrdstr( zzchar_t * );
-extern void zzgettok(void); /* get next token */
-extern void zzreplchar(zzchar_t c);/* replace last recognized reg. expr. with
- a character */
-extern void zzreplstr(zzchar_t *s);/* replace last recognized reg. expr. with
- a string */
-extern void zzsave_dlg_state(struct zzdlg_state *);
-extern void zzrestore_dlg_state(struct zzdlg_state *);
-extern int zzerr_in(void);
-extern void zzerrstd(const char *);
-extern void zzerraction(void);
-
-#else
-
-extern void zzadvance();
-extern void zzskip(); /* erase zzlextext, look for antoher token */
-extern void zzmore(); /* keep zzlextext, look for another token */
-extern void zzmode(/*k*/); /* switch to automaton 'k' */
-extern void zzrdstream(); /* what stream to read from */
-extern void zzclose_stream();/* close the current input stream */
-extern void zzrdfunc(); /* what function to get char from */
-extern void zzrdstr();
-extern void zzgettok(); /* get next token */
-extern void zzreplchar(); /* replace last recognized reg. expr. with
- a character */
-extern void zzreplstr(); /* replace last recognized reg. expr. with
- a string */
-extern void zzsave_dlg_state();
-extern void zzrestore_dlg_state();
-extern int zzerr_in();
-extern void zzerrstd();
-extern void zzerraction();
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/err.h b/BaseTools/Source/C/VfrCompile/Pccts/h/err.h
deleted file mode 100644
index b2b196bd75..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/err.h
+++ /dev/null
@@ -1,1170 +0,0 @@
-/*
- * err.h
- *
- * Standard error handling mechanism
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * Has grown to hold all kinds of stuff (err.h is increasingly misnamed)
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ERR_H
-#define ERR_H
-
-#include "pcctscfg.h"
-#include <stdlib.h>
-#include <assert.h>
-
-/* */
-/* 7-Apr-97 133MR1 */
-/* Proper choice of STDC and cplusplus pre-processor symbols (?) */
-/* */
-#include "pccts_string.h"
-
-#ifdef PCCTS_USE_STDARG
-#include "pccts_stdarg.h"
-#else
-#include <varargs.h>
-#endif
-
-#ifdef DUM
-/* Define usable bits per unsigned int word (used for set stuff) */
-#ifdef PC
-#define BSETWORDSIZE 16
-#define BSETLOGWORDSIZE 4
-#else
-#define BSETWORDSIZE 32
-#define BSETLOGWORDSIZE 5
-#endif
-#endif
-
-#define BSETWORDSIZE 8
-#define BSETLOGWORDSIZE 3 /* SetWordType is 8bits */
-
-#define BSETMODWORD(x) ((x) & (BSETWORDSIZE-1)) /* x % BSETWORDSIZE */
-#define BSETDIVWORD(x) ((x) >> BSETLOGWORDSIZE) /* x / BSETWORDSIZE */
-
-/* This is not put into the global pccts_parser structure because it is
- * hidden and does not need to be saved during a "save state" operation
- */
-/* maximum of 32 bits/unsigned int and must be 8 bits/byte */
-static SetWordType bitmask[] = {
- 0x00000001, 0x00000002, 0x00000004, 0x00000008,
- 0x00000010, 0x00000020, 0x00000040, 0x00000080
-};
-
-#ifdef zzTRACE_RULES
-int zzTraceOptionValueDefault=1;
-int zzTraceOptionValue=1;
-int zzTraceGuessOptionValue=1;
-char *zzTraceCurrentRuleName=NULL;
-int zzTraceDepth=0;
-#endif
-
-int zzGuessSeq=0; /* MR10 */
-int zzSyntaxErrCount=0; /* MR11 */
-int zzLexErrCount=0; /* MR11 */
-
-void
-#ifdef __USE_PROTOS
-zzresynch(SetWordType *wd,SetWordType mask)
-#else
-zzresynch(wd,mask)
-SetWordType *wd, mask;
-#endif
-{
- static int consumed = 1;
-
- /* if you enter here without having consumed a token from last resynch
- * force a token consumption.
- */
- if ( !consumed ) {zzCONSUME; consumed=1; return;} /* MR10 */
-
- /* if current token is in resynch set, we've got what we wanted */
- if ( wd[LA(1)]&mask || LA(1) == zzEOF_TOKEN ) {consumed=0; return;}
-
- /* scan until we find something in the resynch set */
- while ( !(wd[LA(1)]&mask) && LA(1) != zzEOF_TOKEN ) {zzCONSUME;}
- consumed=1;
-}
-
-/* */
-/* 7-Apr-97 133MR1 for C++ and MR7 for C */
-/* Change suggested by Eli Sternheim (eli@interhdl.com) */
-/* */
-
-void
-#ifdef __USE_PROTOS
-zzconsumeUntil(SetWordType *st)
-#else
-zzconsumeUntil(st)
-SetWordType *st;
-#endif
-{
- int tmp; /* MR7 */
- while ( !zzset_el( (tmp=LA(1)), st) && tmp!=1 /* Eof */) { /* MR7 */
- zzCONSUME; } /* MR7 */
-}
-
-/* */
-/* 7-Apr-97 133MR1 for C++ and MR7 for C */
-/* Change suggested by Eli Sternheim (eli@interhdl.com) */
-/* */
-
-void
-#ifdef __USE_PROTOS
-zzconsumeUntilToken(int t)
-#else
-zzconsumeUntilToken(t)
-int t;
-#endif
-{
- int tmp; /* MR7 */
- while ( (tmp=LA(1)) !=t && tmp!=1 /* Eof */) { zzCONSUME; } /* MR7 */
-}
-
-/* input looks like:
- * zzFAIL(k, e1, e2, ...,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText)
- * where the zzMiss stuff is set here to the token that did not match
- * (and which set wasn't it a member of).
- */
-
-#ifdef PCCTS_USE_STDARG
-void zzFAIL(int k, ...)
-#else
-void zzFAIL(va_alist)
-va_dcl
-#endif
-{
-#ifdef LL_K
- static char text[LL_K*ZZLEXBUFSIZE+1];
- SetWordType *f[LL_K];
-#else
- static char text[ZZLEXBUFSIZE+1];
- SetWordType *f[1];
-#endif
- SetWordType **miss_set;
- char **miss_text;
- int *bad_tok;
- char **bad_text;
- int *err_k;
- int i;
- va_list ap;
-#ifndef PCCTS_USE_STDARG /* MR20 */
- int k;
-#endif
-#ifdef PCCTS_USE_STDARG /* MR20 */
- va_start(ap, k);
-#else
- va_start(ap);
- k = va_arg(ap, int); /* how many lookahead sets? */
-#endif
- assert(k <= sizeof(f)/sizeof(f[0])); /* MR20 G. Hobbelt */
- text[0] = '\0';
- for (i=1; i<=k; i++) /* collect all lookahead sets */
- {
- f[i-1] = va_arg(ap, SetWordType *);
- }
- for (i=1; i<=k; i++) /* look for offending token */
- {
- if ( i>1 ) strcat(text, " ");
- strcat(text, LATEXT(i));
- if ( !zzset_el((unsigned)LA(i), f[i-1]) ) break;
- }
- miss_set = va_arg(ap, SetWordType **);
- miss_text = va_arg(ap, char **);
- bad_tok = va_arg(ap, int *);
- bad_text = va_arg(ap, char **);
- err_k = va_arg(ap, int *);
- if ( i>k )
- {
- /* bad; lookahead is permutation that cannot be matched,
- * but, the ith token of lookahead is valid at the ith position
- * (The old LL sub 1 (k) versus LL(k) parsing technique)
- */
- *miss_set = NULL;
- *miss_text = zzlextext;
- *bad_tok = LA(1);
- *bad_text = LATEXT(1);
- *err_k = k;
- return;
- }
-/* fprintf(stderr, "%s not in %dth set\n", zztokens[LA(i)], i);*/
- *miss_set = f[i-1];
- *miss_text = text;
- *bad_tok = LA(i);
- *bad_text = LATEXT(i);
- if ( i==1 ) *err_k = 1;
- else *err_k = k;
-}
-
-#ifdef __USE_PROTOS
-void zzTraceGuessDone(zzantlr_state *state)
-#else
-void zzTraceGuessDone(state)
- zzantlr_state *state;
-#endif
-{
-#ifdef zzTRACE_RULES
-#ifdef ZZCAN_GUESS
-
- int doIt=0;
-
- if (zzTraceCurrentRuleName == NULL) return;
-
- if (zzTraceOptionValue <= 0) {
- doIt=0;
- } else if (zzTraceGuessOptionValue <= 0) {
- doIt=0;
- } else {
- doIt=1;
- };
-
- if (doIt) {
- fprintf(stderr,"guess done - returning to rule %s {\"%s\"} at depth %d",
- state->traceCurrentRuleName,
- LATEXT(1),
- state->traceDepth);
- if (state->guessing != 0) {
- fprintf(stderr," (guess mode continues - an enclosing guess is still active)");
- } else {
- fprintf(stderr," (guess mode ends)");
- };
- fprintf(stderr,"\n");
- };
-#endif
-#endif
-}
-
-void
-#ifdef __USE_PROTOS
-zzsave_antlr_state(zzantlr_state *buf)
-#else
-zzsave_antlr_state(buf)
-zzantlr_state *buf;
-#endif
-{
-#ifdef LL_K
- int i;
-#endif
-
-#ifdef ZZCAN_GUESS
- buf->guess_start = zzguess_start;
- buf->guessing = zzguessing;
-#endif
- buf->asp = zzasp;
-#ifdef GENAST
- buf->ast_sp = zzast_sp;
-#endif
-#ifdef ZZINF_LOOK
- buf->inf_labase = zzinf_labase;
- buf->inf_last = zzinf_last;
-
-/* MR6 Gunnar Rxnning (gunnar@candleweb.no) */
-/* MR6 Additional state needs to be saved/restored */
-
- buf->inf_tokens = zzinf_tokens; /* MR6 */
- buf->inf_text = zzinf_text; /* MR6 */
- buf->inf_text_buffer = zzinf_text_buffer; /* MR6 */
- buf->inf_line = zzinf_line; /* MR6 */
-
-#endif
-#ifdef DEMAND_LOOK
- buf->dirty = zzdirty;
-#endif
-#ifdef LL_K
- for (i=0; i<LL_K; i++) buf->tokenLA[i] = zztokenLA[i];
- for (i=0; i<LL_K; i++) strcpy(buf->textLA[i], zztextLA[i]);
- buf->lap = zzlap;
- buf->labase = zzlabase;
-#else
- buf->token = zztoken;
- strcpy(buf->text, zzlextext);
-#endif
-#ifdef zzTRACE_RULES
-
- /* MR10 */
-
- buf->traceOptionValue=zzTraceOptionValue;
- buf->traceGuessOptionValue=zzTraceGuessOptionValue;
- buf->traceCurrentRuleName=zzTraceCurrentRuleName;
- buf->traceDepth=zzTraceDepth;
-#endif
-}
-
-void
-#ifdef __USE_PROTOS
-zzrestore_antlr_state(zzantlr_state *buf)
-#else
-zzrestore_antlr_state(buf)
-zzantlr_state *buf;
-#endif
-{
-
-#ifdef zzTRACE_RULES
- int prevTraceOptionValue;
-#endif
-
-#ifdef LL_K
- int i;
-#endif
-
-#ifdef ZZCAN_GUESS
- zzguess_start = buf->guess_start;
- zzguessing = buf->guessing;
-#endif
- zzasp = buf->asp;
-#ifdef GENAST
- zzast_sp = buf->ast_sp;
-#endif
-#ifdef ZZINF_LOOK
- zzinf_labase = buf->inf_labase;
- zzinf_last = buf->inf_last;
-
-/* MR6 Gunnar Rxnning (gunnar@candleweb.no) */
-/* MR6 Additional state needs to be saved/restored */
-
- zzinf_tokens = buf->inf_tokens; /* MR6 */
- zzinf_text = buf->inf_text; /* MR6 */
- zzinf_text_buffer = buf->inf_text_buffer; /* MR6 */
- zzinf_line = buf->inf_line; /* MR6 */
-#endif
-#ifdef DEMAND_LOOK
- zzdirty = buf->dirty;
-#endif
-#ifdef LL_K
- for (i=0; i<LL_K; i++) zztokenLA[i] = buf->tokenLA[i];
- for (i=0; i<LL_K; i++) strcpy(zztextLA[i], buf->textLA[i]);
- zzlap = buf->lap;
- zzlabase = buf->labase;
-#else
- zztoken = buf->token;
- strcpy(zzlextext, buf->text);
-#endif
-#ifdef zzTRACE_RULES
-
- prevTraceOptionValue=zzTraceOptionValue;
- zzTraceOptionValue=buf->traceOptionValue;
- if ( (prevTraceOptionValue > 0) !=
- (zzTraceOptionValue > 0)) {
- if (zzTraceOptionValue > 0) {
- fprintf(stderr,"trace enable restored in rule %s depth %d\n",
- zzTraceCurrentRuleName,zzTraceDepth);
- };
- if (zzTraceOptionValue <= 0) {
- fprintf(stderr,"trace disable restored in rule %s depth %d\n",
- zzTraceCurrentRuleName,zzTraceDepth);
- };
- };
-
- zzTraceOptionValue=buf->traceOptionValue; /* MR10 */
- zzTraceGuessOptionValue=buf->traceGuessOptionValue; /* MR10 */
- zzTraceCurrentRuleName=buf->traceCurrentRuleName; /* MR10 */
- zzTraceDepth=buf->traceDepth; /* MR10 */
- zzTraceGuessDone(buf); /* MR10 */
-#endif
-}
-
-void
-#ifdef __USE_PROTOS
-zzedecode(SetWordType *a)
-#else
-zzedecode(a)
-SetWordType *a;
-#endif
-{
- register SetWordType *p = a;
- register SetWordType *endp = &(p[zzSET_SIZE]);
- register unsigned e = 0;
-
- if ( zzset_deg(a)>1 ) fprintf(stderr, " {");
- do {
- register SetWordType t = *p;
- register SetWordType *b = &(bitmask[0]);
- do {
- if ( t & *b ) fprintf(stderr, " %s", zztokens[e]);
- e++;
- } while (++b < &(bitmask[sizeof(SetWordType)*8]));
- } while (++p < endp);
- if ( zzset_deg(a)>1 ) fprintf(stderr, " }");
-}
-
-#ifndef USER_ZZSYN
-/* standard error reporting function */
-void
-#ifdef __USE_PROTOS
-zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, char *bad_text)
-#else
-zzsyn(text, tok, egroup, eset, etok, k, bad_text)
-char *text, *egroup, *bad_text;
-int tok;
-int etok;
-int k;
-SetWordType *eset;
-#endif
-{
-
- zzSyntaxErrCount++; /* MR11 */
- fprintf(stderr, "line %d: syntax error at \"%s\"", zzline, (tok==zzEOF_TOKEN)?"EOF":bad_text);
- if ( !etok && !eset ) {fprintf(stderr, "\n"); return;}
- if ( k==1 ) fprintf(stderr, " missing");
- else
- {
- fprintf(stderr, "; \"%s\" not", bad_text);
- if ( zzset_deg(eset)>1 ) fprintf(stderr, " in");
- }
- if ( zzset_deg(eset)>0 ) zzedecode(eset);
- else fprintf(stderr, " %s", zztokens[etok]);
- if ( strlen(egroup) > 0 ) fprintf(stderr, " in %s", egroup);
- fprintf(stderr, "\n");
-}
-#endif
-
-/* is b an element of set p? */
-int
-#ifdef __USE_PROTOS
-zzset_el(unsigned b, SetWordType *p)
-#else
-zzset_el(b,p)
-unsigned b;
-SetWordType *p;
-#endif
-{
- return( p[BSETDIVWORD(b)] & bitmask[BSETMODWORD(b)] );
-}
-
-int
-#ifdef __USE_PROTOS
-zzset_deg(SetWordType *a)
-#else
-zzset_deg(a)
-SetWordType *a;
-#endif
-{
- /* Fast compute degree of a set... the number
- of elements present in the set. Assumes
- that all word bits are used in the set
- */
- register SetWordType *p = a;
- register SetWordType *endp = &(a[zzSET_SIZE]);
- register int degree = 0;
-
- if ( a == NULL ) return 0;
- while ( p < endp )
- {
- register SetWordType t = *p;
- register SetWordType *b = &(bitmask[0]);
- do {
- if (t & *b) ++degree;
- } while (++b < &(bitmask[sizeof(SetWordType)*8]));
- p++;
- }
-
- return(degree);
-}
-
-#ifdef DEMAND_LOOK
-
-#ifdef LL_K
-int
-#ifdef __USE_PROTOS
-_zzmatch(int _t, char **zzBadText, char **zzMissText,
- int *zzMissTok, int *zzBadTok,
- SetWordType **zzMissSet)
-#else
-_zzmatch(_t, zzBadText, zzMissText, zzMissTok, zzBadTok, zzMissSet)
-int _t;
-char **zzBadText;
-char **zzMissText;
-int *zzMissTok, *zzBadTok;
-SetWordType **zzMissSet;
-#endif
-{
- if ( zzdirty==LL_K ) {
- zzCONSUME;
- }
- if ( LA(1)!=_t ) {
- *zzBadText = *zzMissText=LATEXT(1);
- *zzMissTok= _t; *zzBadTok=LA(1);
- *zzMissSet=NULL;
- return 0;
- }
- zzMakeAttr
- zzdirty++;
- zzlabase++;
- return 1;
-}
-
-int
-#ifdef __USE_PROTOS
-_zzmatch_wsig(int _t)
-#else
-_zzmatch_wsig(_t)
-int _t;
-#endif
-{
- if ( zzdirty==LL_K ) {
- zzCONSUME;
- }
- if ( LA(1)!=_t ) {
- return 0;
- }
- zzMakeAttr
- zzdirty++;
- zzlabase++;
- return 1;
-}
-
-#else
-
-int
-#ifdef __USE_PROTOS
-_zzmatch(int _t, char **zzBadText, char **zzMissText,
- int *zzMissTok, int *zzBadTok, SetWordType **zzMissSet)
-#else
-_zzmatch(_t, zzBadText, zzMissText, zzMissTok, zzBadTok, zzMissSet)
-int _t;
-char **zzBadText;
-char **zzMissText;
-int *zzMissTok, *zzBadTok;
-SetWordType **zzMissSet;
-#endif
-{
- if ( zzdirty ) {zzCONSUME;}
- if ( LA(1)!=_t ) {
- *zzBadText = *zzMissText=LATEXT(1);
- *zzMissTok= _t; *zzBadTok=LA(1);
- *zzMissSet=NULL;
- return 0;
- }
- zzdirty = 1;
- zzMakeAttr
- return 1;
-}
-
-int
-#ifdef __USE_PROTOS
-_zzmatch_wsig(int _t)
-#else
-_zzmatch_wsig(_t)
-int _t;
-#endif
-{
- if ( zzdirty ) {zzCONSUME;}
- if ( LA(1)!=_t ) {
- return 0;
- }
- zzdirty = 1;
- zzMakeAttr
- return 1;
-}
-
-#endif /*LL_K*/
-
-#else
-
-int
-#ifdef __USE_PROTOS
-_zzmatch(int _t, char **zzBadText, char **zzMissText,
- int *zzMissTok, int *zzBadTok,
- SetWordType **zzMissSet)
-#else
-_zzmatch(_t, zzBadText, zzMissText, zzMissTok, zzBadTok, zzMissSet)
-int _t;
-char **zzBadText;
-char **zzMissText;
-int *zzMissTok, *zzBadTok;
-SetWordType **zzMissSet;
-#endif
-{
- if ( LA(1)!=_t ) {
- *zzBadText = *zzMissText=LATEXT(1);
- *zzMissTok= _t; *zzBadTok=LA(1);
- *zzMissSet=NULL;
- return 0;
- }
- zzMakeAttr
- return 1;
-}
-
-int
-#ifdef __USE_PROTOS
-_zzmatch_wsig(int _t)
-#else
-_zzmatch_wsig(_t)
-int _t;
-#endif
-{
- if ( LA(1)!=_t ) return 0;
- zzMakeAttr
- return 1;
-}
-
-#endif /*DEMAND_LOOK*/
-
-#ifdef ZZINF_LOOK
-void
-#ifdef __USE_PROTOS
-_inf_zzgettok(void)
-#else
-_inf_zzgettok()
-#endif
-{
- if ( zzinf_labase >= zzinf_last )
- {NLA = zzEOF_TOKEN; strcpy(NLATEXT, "");}
- else {
- NLA = zzinf_tokens[zzinf_labase];
- zzline = zzinf_line[zzinf_labase]; /* wrong in 1.21 */
- strcpy(NLATEXT, zzinf_text[zzinf_labase]);
- zzinf_labase++;
- }
-}
-#endif
-
-#ifdef ZZINF_LOOK
-/* allocate default size text,token and line arrays;
- * then, read all of the input reallocing the arrays as needed.
- * Once the number of total tokens is known, the LATEXT(i) array (zzinf_text)
- * is allocated and it's pointers are set to the tokens in zzinf_text_buffer.
- */
-void
-#ifdef __USE_PROTOS
-zzfill_inf_look(void)
-#else
-zzfill_inf_look()
-#endif
-{
- int tok, line;
- int zzinf_token_buffer_size = ZZINF_DEF_TOKEN_BUFFER_SIZE;
- int zzinf_text_buffer_size = ZZINF_DEF_TEXT_BUFFER_SIZE;
- int zzinf_text_buffer_index = 0;
- int zzinf_lap = 0;
-
- /* allocate text/token buffers */
- zzinf_text_buffer = (char *) malloc(zzinf_text_buffer_size);
- if ( zzinf_text_buffer == NULL )
- {
- fprintf(stderr, "cannot allocate lookahead text buffer (%d bytes)\n",
- zzinf_text_buffer_size);
- exit(PCCTS_EXIT_FAILURE);
- }
- zzinf_tokens = (int *) calloc(zzinf_token_buffer_size,sizeof(int));
- if ( zzinf_tokens == NULL )
- {
- fprintf(stderr, "cannot allocate token buffer (%d tokens)\n",
- zzinf_token_buffer_size);
- exit(PCCTS_EXIT_FAILURE);
- }
- zzinf_line = (int *) calloc(zzinf_token_buffer_size,sizeof(int));
- if ( zzinf_line == NULL )
- {
- fprintf(stderr, "cannot allocate line buffer (%d ints)\n",
- zzinf_token_buffer_size);
- exit(PCCTS_EXIT_FAILURE);
- }
-
- /* get tokens, copying text to text buffer */
- zzinf_text_buffer_index = 0;
- do {
- zzgettok();
- line = zzreal_line;
- while ( zzinf_lap>=zzinf_token_buffer_size )
- {
- zzinf_token_buffer_size += ZZINF_BUFFER_TOKEN_CHUNK_SIZE;
- zzinf_tokens = (int *) realloc(zzinf_tokens,
- zzinf_token_buffer_size*sizeof(int));
- if ( zzinf_tokens == NULL )
- {
- fprintf(stderr, "cannot allocate lookahead token buffer (%d tokens)\n",
- zzinf_token_buffer_size);
- exit(PCCTS_EXIT_FAILURE);
- }
- zzinf_line = (int *) realloc(zzinf_line,
- zzinf_token_buffer_size*sizeof(int));
- if ( zzinf_line == NULL )
- {
- fprintf(stderr, "cannot allocate lookahead line buffer (%d ints)\n",
- zzinf_token_buffer_size);
- exit(PCCTS_EXIT_FAILURE);
- }
-
- }
- while ( (zzinf_text_buffer_index+strlen(NLATEXT)+1) >= zzinf_text_buffer_size )
- {
- zzinf_text_buffer_size += ZZINF_BUFFER_TEXT_CHUNK_SIZE;
- zzinf_text_buffer = (char *) realloc(zzinf_text_buffer,
- zzinf_text_buffer_size);
- if ( zzinf_text_buffer == NULL )
- {
- fprintf(stderr, "cannot allocate lookahead text buffer (%d bytes)\n",
- zzinf_text_buffer_size);
- exit(PCCTS_EXIT_FAILURE);
- }
- }
- /* record token and text and line of input symbol */
- tok = zzinf_tokens[zzinf_lap] = NLA;
- strcpy(&zzinf_text_buffer[zzinf_text_buffer_index], NLATEXT);
- zzinf_text_buffer_index += strlen(NLATEXT)+1;
- zzinf_line[zzinf_lap] = line;
- zzinf_lap++;
- } while (tok!=zzEOF_TOKEN);
- zzinf_labase = 0;
- zzinf_last = zzinf_lap-1;
-
- /* allocate ptrs to text of ith token */
- zzinf_text = (char **) calloc(zzinf_last+1,sizeof(char *));
- if ( zzinf_text == NULL )
- {
- fprintf(stderr, "cannot allocate lookahead text buffer (%d)\n",
- zzinf_text_buffer_size);
- exit(PCCTS_EXIT_FAILURE);
- }
- zzinf_text_buffer_index = 0;
- zzinf_lap = 0;
- /* set ptrs so that zzinf_text[i] is the text of the ith token found on input */
- while (zzinf_lap<=zzinf_last)
- {
- zzinf_text[zzinf_lap++] = &zzinf_text_buffer[zzinf_text_buffer_index];
- zzinf_text_buffer_index += strlen(&zzinf_text_buffer[zzinf_text_buffer_index])+1;
- }
-}
-#endif
-
-int
-#ifdef __USE_PROTOS
-_zzsetmatch(SetWordType *e, char **zzBadText, char **zzMissText,
- int *zzMissTok, int *zzBadTok,
- SetWordType **zzMissSet,
- SetWordType *zzTokclassErrset /* MR23 */)
-#else
-_zzsetmatch(e, zzBadText, zzMissText, zzMissTok, zzBadTok, zzMissSet, zzTokclassErrset /* MR23 */)
-SetWordType *e;
-char **zzBadText;
-char **zzMissText;
-int *zzMissTok, *zzBadTok;
-SetWordType **zzMissSet;
-SetWordType *zzTokclassErrset;
-#endif
-{
-#ifdef DEMAND_LOOK
-#ifdef LL_K
- if ( zzdirty==LL_K ) {zzCONSUME;}
-#else
- if ( zzdirty ) {zzCONSUME;}
-#endif
-#endif
- if ( !zzset_el((unsigned)LA(1), e) ) {
- *zzBadText = LATEXT(1); *zzMissText=NULL;
- *zzMissTok= 0; *zzBadTok=LA(1);
- *zzMissSet=zzTokclassErrset; /* MR23 */
- return 0;
- }
- zzMakeAttr /* MR14 Ger Hobbelt (hobbelt@axa.nl) */
-#ifdef DEMAND_LOOK
-#ifdef LL_K
- zzdirty++;
- zzlabase++; /* MR14 Ger Hobbelt (hobbelt@axa.nl) */
-#else
- zzdirty = 1;
-#endif
-#endif
- return 1;
-}
-
-int
-#ifdef __USE_PROTOS
-_zzmatch_wdfltsig(int tokenWanted, SetWordType *whatFollows)
-#else
-_zzmatch_wdfltsig(tokenWanted, whatFollows)
-int tokenWanted;
-SetWordType *whatFollows;
-#endif
-{
-#ifdef DEMAND_LOOK
-#ifdef LL_K
- if ( zzdirty==LL_K ) {
- zzCONSUME;
- }
-#else
- if ( zzdirty ) {zzCONSUME;}
-#endif
-#endif
-
- if ( LA(1)!=tokenWanted )
- {
- zzSyntaxErrCount++; /* MR11 */
- fprintf(stderr,
- "line %d: syntax error at \"%s\" missing %s\n",
- zzline,
- (LA(1)==zzEOF_TOKEN)?"<eof>":(char *)LATEXT(1),
- zztokens[tokenWanted]);
- zzconsumeUntil( whatFollows );
- return 0;
- }
- else {
- zzMakeAttr
-#ifdef DEMAND_LOOK
-#ifdef LL_K
- zzdirty++;
- zzlabase++;
-#else
- zzdirty = 1;
-#endif
-#else
-/* zzCONSUME; consume if not demand lookahead */
-#endif
- return 1;
- }
-}
-
-int
-#ifdef __USE_PROTOS
-_zzsetmatch_wdfltsig(SetWordType *tokensWanted,
- int tokenTypeOfSet,
- SetWordType *whatFollows)
-#else
-_zzsetmatch_wdfltsig(tokensWanted, tokenTypeOfSet, whatFollows)
-SetWordType *tokensWanted;
-int tokenTypeOfSet;
-SetWordType *whatFollows;
-#endif
-{
-#ifdef DEMAND_LOOK
-#ifdef LL_K
- if ( zzdirty==LL_K ) {zzCONSUME;}
-#else
- if ( zzdirty ) {zzCONSUME;}
-#endif
-#endif
- if ( !zzset_el((unsigned)LA(1), tokensWanted) )
- {
- zzSyntaxErrCount++; /* MR11 */
- fprintf(stderr,
- "line %d: syntax error at \"%s\" missing %s\n",
- zzline,
- (LA(1)==zzEOF_TOKEN)?"<eof>":(char *)LATEXT(1),
- zztokens[tokenTypeOfSet]);
- zzconsumeUntil( whatFollows );
- return 0;
- }
- else {
- zzMakeAttr
-#ifdef DEMAND_LOOK
-#ifdef LL_K
- zzdirty++;
- zzlabase++;
-#else
- zzdirty = 1;
-#endif
-#else
-/* zzCONSUME; consume if not demand lookahead */
-#endif
- return 1;
- }
-}
-
-int
-#ifdef __USE_PROTOS
-_zzsetmatch_wsig(SetWordType *e)
-#else
-_zzsetmatch_wsig(e)
-SetWordType *e;
-#endif
-{
-#ifdef DEMAND_LOOK
-#ifdef LL_K
- if ( zzdirty==LL_K ) {zzCONSUME;}
-#else
- if ( zzdirty ) {zzCONSUME;}
-#endif
-#endif
- if ( !zzset_el((unsigned)LA(1), e) ) return 0;
- zzMakeAttr /* MR14 Ger Hobbelt (hobbelt@axa.nl) */
-#ifdef DEMAND_LOOK
-#ifdef LL_K
- zzdirty++;
- zzlabase++; /* MR14 Ger Hobbelt (hobbelt@axa.nl) */
-#else
- zzdirty = 1;
-#endif
-#endif
- return 1;
-}
-
-#ifdef USER_ZZMODE_STACK
-static int zzmstk[ZZMAXSTK] = { -1 };
-static int zzmdep = 0;
-static char zzmbuf[70];
-
-void
-#ifdef __USE_PROTOS
-zzmpush( int m )
-#else
-zzmpush( m )
-int m;
-#endif
-{
- if(zzmdep == ZZMAXSTK - 1) {
- sprintf(zzmbuf, "Mode stack overflow ");
- zzerr(zzmbuf);
- } else {
- zzmstk[zzmdep++] = zzauto;
- zzmode(m);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-zzmpop( void )
-#else
-zzmpop( )
-#endif
-{
- if(zzmdep == 0)
- { sprintf(zzmbuf, "Mode stack underflow ");
- zzerr(zzmbuf);
- }
- else
- { zzmdep--;
- zzmode(zzmstk[zzmdep]);
- }
-}
-
-void
-#ifdef __USE_PROTOS
-zzsave_mode_stack( int modeStack[], int *modeLevel )
-#else
-zzsave_mode_stack( modeStack, modeLevel )
-int modeStack[];
-int *modeLevel;
-#endif
-{
- int i;
- memcpy(modeStack, zzmstk, sizeof(zzmstk));
- *modeLevel = zzmdep;
- zzmdep = 0;
-
- return;
-}
-
-void
-#ifdef __USE_PROTOS
-zzrestore_mode_stack( int modeStack[], int *modeLevel )
-#else
-zzrestore_mode_stack( modeStack, modeLevel )
-int modeStack[];
-int *modeLevel;
-#endif
-{
- int i;
-
- memcpy(zzmstk, modeStack, sizeof(zzmstk));
- zzmdep = *modeLevel;
-
- return;
-}
-#endif /* USER_ZZMODE_STACK */
-
-#ifdef __USE_PROTOS
-void zzTraceReset(void)
-#else
-void zzTraceReset()
-#endif
-{
-#ifdef zzTRACE_RULES
- zzTraceOptionValue=zzTraceOptionValueDefault;
- zzTraceGuessOptionValue=1;
- zzTraceCurrentRuleName=NULL;
- zzTraceDepth=0;
-#endif
-}
-
-#ifdef __USE_PROTOS
-void zzTraceGuessFail(void)
-#else
-void zzTraceGuessFail()
-#endif
-{
-
-#ifdef zzTRACE_RULES
-#ifdef ZZCAN_GUESS
-
- int doIt=0;
-
- if (zzTraceOptionValue <= 0) {
- doIt=0;
- } else if (zzguessing && zzTraceGuessOptionValue <= 0) {
- doIt=0;
- } else {
- doIt=1;
- };
-
- if (doIt) {
- fprintf(stderr,"guess failed\n");
- };
-#endif
-#endif
-}
-
-/* zzTraceOption:
- zero value turns off trace
-*/
-
-#ifdef __USE_PROTOS
-void zzTraceIn(char * rule)
-#else
-void zzTraceIn(rule)
- char *rule;
-#endif
-{
-#ifdef zzTRACE_RULES
-
- int doIt=0;
-
- zzTraceDepth++;
- zzTraceCurrentRuleName=rule;
-
- if (zzTraceOptionValue <= 0) {
- doIt=0;
-#ifdef ZZCAN_GUESS
- } else if (zzguessing && zzTraceGuessOptionValue <= 0) {
- doIt=0;
-#endif
- } else {
- doIt=1;
- };
-
- if (doIt) {
- fprintf(stderr,"enter rule %s {\"%s\"} depth %d",
- rule,
- LA(1)==1 ? "@" : (char *) LATEXT(1), /* MR19 */
- zzTraceDepth);
-#ifdef ZZCAN_GUESS
- if (zzguessing) fprintf(stderr," guessing");
-#endif
- fprintf(stderr,"\n");
- };
-#endif
- return;
-}
-
-#ifdef __USE_PROTOS
-void zzTraceOut(char * rule)
-#else
-void zzTraceOut(rule)
- char *rule;
-#endif
-{
-#ifdef zzTRACE_RULES
- int doIt=0;
-
- zzTraceDepth--;
-
- if (zzTraceOptionValue <= 0) {
- doIt=0;
-#ifdef ZZCAN_GUESS
- } else if (zzguessing && zzTraceGuessOptionValue <= 0) {
- doIt=0;
-#endif
- } else {
- doIt=1;
- };
-
- if (doIt) {
- fprintf(stderr,"exit rule %s {\"%s\"} depth %d",
- rule,
- LA(1)==1 ? "@" : (char *) LATEXT(1), /* MR19 */
- zzTraceDepth+1);
-#ifdef ZZCAN_GUESS
- if (zzguessing) fprintf(stderr," guessing");
-#endif
- fprintf(stderr,"\n");
- };
-#endif
-}
-
-#ifdef __USE_PROTOS
-int zzTraceOption(int delta)
-#else
-int zzTraceOption(delta)
- int delta;
-#endif
-{
-#ifdef zzTRACE_RULES
- int prevValue=zzTraceOptionValue;
-
- zzTraceOptionValue=zzTraceOptionValue+delta;
-
- if (zzTraceCurrentRuleName != NULL) {
- if (prevValue <= 0 && zzTraceOptionValue > 0) {
- fprintf(stderr,"trace enabled in rule %s depth %d\n",
- zzTraceCurrentRuleName,zzTraceDepth);
- };
- if (prevValue > 0 && zzTraceOptionValue <= 0) {
- fprintf(stderr,"trace disabled in rule %s depth %d\n",
- zzTraceCurrentRuleName,zzTraceDepth);
- };
- };
- return prevValue;
-#else
- return 0;
-#endif
-}
-
-#ifdef __USE_PROTOS
-int zzTraceGuessOption(int delta)
-#else
-int zzTraceGuessOption(delta)
- int delta;
-#endif
-{
-#ifdef zzTRACE_RULES
-#ifdef ZZCAN_GUESS
- int prevValue=zzTraceGuessOptionValue;
-
- zzTraceGuessOptionValue=zzTraceGuessOptionValue+delta;
-
- if (zzTraceCurrentRuleName != NULL) {
- if (prevValue <= 0 && zzTraceGuessOptionValue > 0) {
- fprintf(stderr,"guess trace enabled in rule %s depth %d\n",
- zzTraceCurrentRuleName,zzTraceDepth);
- };
- if (prevValue > 0 && zzTraceGuessOptionValue <= 0) {
- fprintf(stderr,"guess trace disabled in rule %s depth %d\n",
- zzTraceCurrentRuleName,zzTraceDepth);
- };
- };
- return prevValue;
-#else
- return 0;
-#endif
-#else
- return 0;
-#endif
-}
-
-#endif /* ERR_H */
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/int.h b/BaseTools/Source/C/VfrCompile/Pccts/h/int.h
deleted file mode 100644
index cdcaa92426..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/int.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ANTLR attribute definition -- long integers
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * ANTLR 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-#ifndef ZZINT_H
-#define ZZINT_H
-
-typedef long Attrib;
-
-#define zzcr_attr(a,tok,t) *(a) = atol(t);
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_assert.h b/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_assert.h
deleted file mode 100644
index ff0dfb5126..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_assert.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __PCCTS_ASSERT_H__
-#define __PCCTS_ASSERT_H__
-
-#ifdef PCCTS_USE_NAMESPACE_STD
-#include <cassert>
-#else
-#include <assert.h>
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_iostream.h b/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_iostream.h
deleted file mode 100644
index 972b32cbd1..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_iostream.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __PCCTS_IOSTREAM_H__
-#define __PCCTS_IOSTREAM_H__
-
-#ifdef PCCTS_USE_NAMESPACE_STD
-#include <iostream>
-#else
-#include <iostream.h>
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_istream.h b/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_istream.h
deleted file mode 100644
index e25cb8c483..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_istream.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __PCCTS_ISTREAM_H__
-#define __PCCTS_ISTREAM_H__
-
-#ifdef PCCTS_USE_NAMESPACE_STD
-#include <istream>
-#else
-#include <istream.h>
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_setjmp.h b/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_setjmp.h
deleted file mode 100644
index 9ea185ca73..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_setjmp.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __PCCTS_SETJMP_H__
-#define __PCCTS_SETJMP_H__
-
-#ifdef PCCTS_USE_NAMESPACE_STD
-#include <csetjmp>
-#else
-#include <setjmp.h>
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdarg.h b/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdarg.h
deleted file mode 100644
index e957430c32..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdarg.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __PCCTS_STDARG_H__
-#define __PCCTS_STDARG_H__
-
-#ifdef PCCTS_USE_NAMESPACE_STD
-#include <cstdarg>
-#else
-#include <stdarg.h>
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdio.h b/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdio.h
deleted file mode 100644
index ac34d1086d..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdio.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __PCCTS_STDIO_H__
-#define __PCCTS_STDIO_H__
-
-#ifdef PCCTS_USE_NAMESPACE_STD
-#include <cstdio>
-#else
-#include <stdio.h>
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdlib.h b/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdlib.h
deleted file mode 100644
index f0b344e8dc..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_stdlib.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __PCCTS_STDLIB_H__
-#define __PCCTS_STDLIB_H__
-
-#ifdef PCCTS_USE_NAMESPACE_STD
-#include <cstdlib>
-#else
-#include <stdlib.h>
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_string.h b/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_string.h
deleted file mode 100644
index 458a08a94b..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/pccts_string.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __PCCTS_STRING_H__
-#define __PCCTS_STRING_H__
-
-#ifdef PCCTS_USE_NAMESPACE_STD
-#include <cstring>
-#else
-#include <string.h>
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/pcctscfg.h b/BaseTools/Source/C/VfrCompile/Pccts/h/pcctscfg.h
deleted file mode 100644
index 0c3c5ba6fd..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/pcctscfg.h
+++ /dev/null
@@ -1,359 +0,0 @@
-#ifndef PCCTS_CONFIG_H
-#define PCCTS_CONFIG_H
-/*
- * pcctscfg.h (formerly config.h) (for ANTLR, DLG, and SORCERER)
- *
- * This is a simple configuration file that doesn't have config stuff
- * in it, but it's a start.
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
- * Set (PCCTS) -- PCCTS is in the public domain. An individual or
- * company may do whatever they wish with source code distributed with
- * PCCTS or the code generated by PCCTS, including the incorporation of
- * PCCTS, or its output, into commerical software.
- *
- * We encourage users to develop software with PCCTS. However, we do ask
- * that credit is given to us for developing PCCTS. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like PCCTS and have developed a nice tool with the
- * output, please mention that you developed it using PCCTS. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * Used by PCCTS 1.33 (SORCERER 1.00B11 and up)
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1989-2000
- */
-
-/* This file knows about the following ``environments''
- UNIX (default)
- DOS (use #define PC)
- MAC (use #define MPW; has a few things for THINK C, Metrowerks)
- MS/C++ (MR14 Microsoft Visual C++ environment uses symbol _MSC_VER)
-
- */
-
-/* should test __STDC__ for 1, but some compilers don't set value, just def */
-
-#ifndef __USE_PROTOS
-#ifdef __STDC__
-#define __USE_PROTOS
-#endif
-#ifdef __cplusplus
-#define __USE_PROTOS
-#endif
-#endif
-
-#ifdef PCCTS_USE_NAMESPACE_STD
-#define PCCTS_NAMESPACE_STD namespace std {}; using namespace std;
-#else
-#define PCCTS_NAMESPACE_STD
-#endif
-
-#include "pccts_stdio.h"
-#include "pccts_stdlib.h"
-
-/* largest file name size */
-
-#ifdef _MAX_PATH
-#define MaxFileName _MAX_PATH /* MR9 RJV: MAX_PATH defined in stdlib.h (MSVC++ 5.0) */
-#else
-#define MaxFileName 300
-#endif
-
-/*
-* Define PC32 if in a 32-bit PC environment (e.g. extended DOS or Win32).
-* The macros tested here are defined by Watcom, Microsoft, Borland,
-* and djgpp, respectively, when they are used as 32-bit compilers.
-* Users of these compilers *must* be sure to define PC in their
-* makefiles for this to work correctly.
-*/
-#ifdef PC
-# if (defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) || \
- defined(__GNUC__) || defined(__GNUG__))
-# ifndef PC32
-# define PC32
-# endif
-# endif
-#endif
-
-/* MR1 10-Apr-97 Default for PC is short file names */
-/* MR1 Default for non-PC is long file names */
-/* MR1 Can override via command line option LONGFILENAMES */
-
-#ifndef LONGFILENAMES
-#ifndef PC
-#define LONGFILENAMES
-#endif
-#endif
-
-#ifndef LONGFILENAMES
-#define ATOKEN_H "AToken.h"
-#define ATOKPTR_H "ATokPtr.h"
-#define ATOKPTR_IMPL_H "ATokPtrIm.h"
-#define ATOKENBUFFER_H "ATokBuf.h"
-#define ATOKENBUFFER_C "ATokBuf.cpp"
-#define ATOKENSTREAM_H "ATokStr.h"
-#define APARSER_H "AParser.h"
-#define APARSER_C "AParser.cpp"
-#define ASTBASE_H "ASTBase.h"
-#define ASTBASE_C "ASTBase.cpp"
-#define PCCTSAST_C "PCCTSAST.cpp"
-#define LIST_C "List.cpp"
-#define DLEXERBASE_H "DLexBase.h"
-#define DLEXERBASE_C "DLexBase.cpp"
-#define DLEXER_H "DLexer.h"
-#define STREESUPPORT_C "STreeSup.C"
-#else
-#define ATOKEN_H "AToken.h"
-#define ATOKPTR_H "ATokPtr.h"
-#define ATOKPTR_IMPL_H "ATokPtrImpl.h"
-#define ATOKENBUFFER_H "ATokenBuffer.h"
-#define ATOKENBUFFER_C "ATokenBuffer.cpp"
-#define ATOKENSTREAM_H "ATokenStream.h"
-#define APARSER_H "AParser.h"
-#define APARSER_C "AParser.cpp"
-#define ASTBASE_H "ASTBase.h"
-#define ASTBASE_C "ASTBase.cpp"
-#define PCCTSAST_C "PCCTSAST.cpp"
-#define LIST_C "List.cpp"
-#define DLEXERBASE_H "DLexerBase.h"
-#define DLEXERBASE_C "DLexerBase.cpp"
-#define DLEXER_H "DLexer.h"
-#define STREESUPPORT_C "STreeSupport.cpp"
-#endif
-
-/* SORCERER Stuff */
-
-/* MR8 6-Aug-97 Change from ifdef PC to ifndef LONGFILENAMES */
-
-#ifndef LONGFILENAMES
-#define STPARSER_H "STreePar.h"
-#define STPARSER_C "STreePar.C"
-#else
-#define STPARSER_H "STreeParser.h"
-#define STPARSER_C "STreeParser.cpp"
-#endif
-
-#ifdef MPW
-#define CPP_FILE_SUFFIX ".cp"
-#define CPP_FILE_SUFFIX_NO_DOT "cp"
-#define OBJ_FILE_SUFFIX ".o"
-#else
-#ifdef PC
-#define CPP_FILE_SUFFIX ".cpp"
-#define CPP_FILE_SUFFIX_NO_DOT "cpp"
-#define OBJ_FILE_SUFFIX ".obj"
-#else
-#ifdef __VMS
-#define CPP_FILE_SUFFIX ".cpp"
-#define CPP_FILE_SUFFIX_NO_DOT "cpp"
-#define OBJ_FILE_SUFFIX ".obj"
-#else
-#define CPP_FILE_SUFFIX ".cpp"
-#define CPP_FILE_SUFFIX_NO_DOT "cpp"
-#define OBJ_FILE_SUFFIX ".o"
-#endif
-#endif
-#endif
-
-/* User may redefine how line information looks */ /* make it #line MR7 */
-/* MR21 Use #ifndef */
-
-#ifndef LineInfoFormatStr
-#define LineInfoFormatStr "#line %d \"%s\"\n"
-#endif
-
-#ifdef MPW /* Macintosh Programmer's Workshop */
-#define ErrHdr "File \"%s\"; Line %d #"
-#else
-#ifdef _MSC_VER /* MR14 Microsoft Visual C++ environment */
-#define ErrHdr "%s(%d) :"
-#else
-#define ErrHdr "%s, line %d:" /* default */
-#endif
-#endif
-
-/* must assume old K&R cpp here, can't use #if defined(..)... */
-
-#ifdef MPW
-#define TopDirectory ":"
-#define DirectorySymbol ":"
-#define OutputDirectoryOption "Directory where all output files should go (default=\":\")"
-#else
-#ifdef PC
-#define TopDirectory "."
-#define DirectorySymbol "\\"
-#define OutputDirectoryOption "Directory where all output files should go (default=\".\")"
-#else
-#ifdef __VMS
-#define TopDirectory "[000000]"
-#define DirectorySymbol "]"
-#define OutputDirectoryOption "Directory where all output files should go (default=\"[]\")"
-#else
-#define TopDirectory "."
-#define DirectorySymbol "/"
-#define OutputDirectoryOption "Directory where all output files should go (default=\".\")"
-#endif
-#endif
-#endif
-
-#ifdef MPW
-
-/* Make sure we have prototypes for all functions under MPW */
-
-#include "pccts_string.h"
-#include "pccts_stdlib.h"
-
-/* MR6 2-Jun-97 Fixes false dependency caused by VC++ #include scanner */
-/* MR6 Reported by Brad Schick (schick@interaccess.com) */
-#define MPW_CursorCtl_Header <CursorCtl.h>
-#include MPW_CursorCtl_Header
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern void fsetfileinfo (const char *filename, unsigned long newcreator, unsigned long newtype);
-#ifdef __cplusplus
-}
-#endif
-
-/* File creators for various popular development environments */
-
-#define MAC_FILE_CREATOR 'MPS ' /* MPW Text files */
-#if 0
-#define MAC_FILE_CREATOR 'KAHL' /* THINK C/Symantec C++ Text files */
-#endif
-#if 0
-#define MAC_FILE_CREATOR 'CWIE' /* Metrowerks C/C++ Text files */
-#endif
-
-#endif
-
-#ifdef MPW
-#define DAWDLE SpinCursor(1)
-#else
-#define DAWDLE
-#endif
-
-#ifdef MPW
-#define SPECIAL_INITS
-#define SPECIAL_FOPEN
-#endif
-
-#ifdef MPW
-#ifdef __cplusplus
-inline
-#else
-static
-#endif
-void special_inits()
-{
- InitCursorCtl((acurHandle) 0);
-}
-#endif
-
-#ifdef MPW
-#ifdef __cplusplus
-inline
-#else
-static
-#endif
-void special_fopen_actions(char * s)
-{
- fsetfileinfo (s, MAC_FILE_CREATOR, 'TEXT');
-}
-#endif
-
-/* Define usable bits for set.c stuff */
-#define BytesPerWord sizeof(unsigned)
-#define WORDSIZE (sizeof(unsigned)*8)
-#define LogWordSize (WORDSIZE==16?4:5)
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#if defined(VAXC) || defined(__VMS)
-#include <ssdef.h>
-#define PCCTS_EXIT_SUCCESS 1
-#define PCCTS_EXIT_FAILURE SS$_ABORT
-#define zzDIE return SS$_ABORT;
-#define zzDONE return 1;
-
-#else /* !VAXC and !__VMS */
-
-#define PCCTS_EXIT_SUCCESS 0
-#define PCCTS_EXIT_FAILURE 1
-#define zzDIE return 1;
-#define zzDONE return 0;
-
-#endif
-
-#ifdef USER_ZZMODE_STACK
-# ifndef ZZSTACK_MAX_MODE
-# define ZZSTACK_MAX_MODE 32
-# endif
-# define ZZMAXSTK (ZZSTACK_MAX_MODE * 2)
-#endif
-
-#ifndef DllExportPCCTS
-#define DllExportPCCTS
-#endif
-
-#ifdef PC
-#ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME
-#define PCCTS_CASE_INSENSITIVE_FILE_NAME
-#endif
-#endif
-
-#ifdef PC32
-#ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME
-#define PCCTS_CASE_INSENSITIVE_FILE_NAME
-#endif
-#endif
-
-#ifdef __VMS
-#ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME
-#define PCCTS_CASE_INSENSITIVE_FILE_NAME
-#endif
-#endif
-
-#ifdef __USE_PROTOS
-#ifndef PCCTS_USE_STDARG
-#define PCCTS_USE_STDARG
-#endif
-#endif
-
-#ifdef __STDC__
-#ifndef PCCTS_USE_STDARG
-#define PCCTS_USE_STDARG
-#endif
-#endif
-
-#ifdef __cplusplus
-#ifndef PCCTS_USE_STDARG
-#define PCCTS_USE_STDARG
-#endif
-#endif
-
-#ifdef _MSC_VER
-/*Turn off the warnings for:
- unreferenced inline/local function has been removed
-*/
-#pragma warning(disable : 4514)
-/* function not expanded */
-#pragma warning(disable : 4710)
-#endif
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/pcnames.bat b/BaseTools/Source/C/VfrCompile/Pccts/h/pcnames.bat
deleted file mode 100644
index 8784aee9ab..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/pcnames.bat
+++ /dev/null
@@ -1,11 +0,0 @@
-ren aparser.c aparser.cpp
-ren astbase.c astbase.cpp
-ren atokenbu.c atokbuf.cpp
-ren atokenbu.h atokbuf.h
-ren atokenst.h atokstr.h
-ren dlexerba.c dlexbase.cpp
-ren dlexerba.h dlexbase.h
-ren dlexer.c dlexer.cpp
-ren list.c list.cpp
-ren pblackbo.h pblckbox.h
-ren pcctsast.c pcctsast.cpp
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/slist.cpp b/BaseTools/Source/C/VfrCompile/Pccts/h/slist.cpp
deleted file mode 100644
index faf2fe4967..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/h/slist.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * SList.C
- *
- * SOFTWARE RIGHTS
- *
- * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public
- * domain. An individual or company may do whatever they wish with
- * source code distributed with SORCERER or the code generated by
- * SORCERER, including the incorporation of SORCERER, or its output, into
- * commerical software.
- *
- * We encourage users to develop software with SORCERER. However, we do
- * ask that credit is given to us for developing SORCERER. By "credit",
- * we mean that if you incorporate our source code into one of your
- * programs (commercial product, research project, or otherwise) that you
- * acknowledge this fact somewhere in the documentation, research report,
- * etc... If you like SORCERER and have developed a nice tool with the
- * output, please mention that you developed it using SORCERER. In
- * addition, we ask that this header remain intact in our source code.
- * As long as these guidelines are kept, we expect to continue enhancing
- * this system and expect to make other tools available as they are
- * completed.
- *
- * PCCTS 1.33
- * Terence Parr
- * Parr Research Corporation
- * with Purdue University and AHPCRC, University of Minnesota
- * 1992-2000
- */
-
-#define ANTLR_SUPPORT_CODE
-
-#include "SList.h"
-#include "pccts_stdarg.h" // MR23
-
-/* Iterate over a list of elements; returns ptr to a new element
- * in list upon every call and NULL when no more are left.
- * Very useful like this:
- *
- * cursor = mylist;
- * while ( (p=mylist->iterate(&cursor)) ) {
- * // place with element p
- * }
- *
- * The cursor must be initialized to point to the list to iterate over.
- */
-void *SList::
-iterate(SListNode **cursor)
-{
- void *e;
-
- if ( cursor == NULL || *cursor==NULL ) return NULL;
- if ( head == *cursor ) { *cursor = (*cursor)->next(); }
- e = (*cursor)->elem();
- (*cursor) = (*cursor)->next();
- return e;
-}
-
-/* add an element to end of list. */
-void SList::
-add(void *e)
-{
- SListNode *p, *tail=NULL;
- require(e!=NULL, "slist_add: attempting to add NULL list element");
-
- p = new SListNode;
- require(p!=NULL, "add: cannot alloc new list node");
- p->setElem(e);
- if ( head == NULL )
- {
- head = tail = p;
- }
- else /* find end of list */
- {
- tail->setNext(p);
- tail = p;
- }
-}
-
-void SList::
-lfree()
-{
- SListNode *p,*q;
-
- if ( head==NULL ) return; /* empty list */
- for (p = head; p!=NULL; p=q)
- {
- q = p->next();
- free(p);
- }
-}
-
-PCCTS_AST *SList::
-to_ast(SList list)
-{
- PCCTS_AST *t=NULL, *last=NULL;
- SListNode *p;
-
- for (p = head; p!=NULL; p=p->next())
- {
- PCCTS_AST *u = (PCCTS_AST *)p->elem();
- if ( last==NULL ) last = t = u;
- else { last->setRight(u); last = u; }
- }
- return t;
-}
-
-// MR23
-int SList::printMessage(FILE* pFile, const char* pFormat, ...)
-{
- va_list marker;
- va_start( marker, pFormat );
- int iRet = vfprintf(pFile, pFormat, marker);
- va_end( marker );
- return iRet;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/history.ps b/BaseTools/Source/C/VfrCompile/Pccts/history.ps
deleted file mode 100644
index e2600d5129..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/history.ps
+++ /dev/null
@@ -1,473 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.06
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Italic
-%%+ font Courier
-%%DocumentSuppliedResources: procset grops 1.06 0
-%%Pages: 3
-%%PageOrder: Ascend
-%%Orientation: Portrait
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset grops 1.06 0
-
-/setpacking where {
- pop
- currentpacking
- true setpacking
-} if
-
-/grops 120 dict dup begin
-
-% The ASCII code of the space character.
-/SC 32 def
-
-/A /show load def
-/B { 0 SC 3 -1 roll widthshow } bind def
-/C { 0 exch ashow } bind def
-/D { 0 exch 0 SC 5 2 roll awidthshow } bind def
-/E { 0 rmoveto show } bind def
-/F { 0 rmoveto 0 SC 3 -1 roll widthshow } bind def
-/G { 0 rmoveto 0 exch ashow } bind def
-/H { 0 rmoveto 0 exch 0 SC 5 2 roll awidthshow } bind def
-/I { 0 exch rmoveto show } bind def
-/J { 0 exch rmoveto 0 SC 3 -1 roll widthshow } bind def
-/K { 0 exch rmoveto 0 exch ashow } bind def
-/L { 0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow } bind def
-/M { rmoveto show } bind def
-/N { rmoveto 0 SC 3 -1 roll widthshow } bind def
-/O { rmoveto 0 exch ashow } bind def
-/P { rmoveto 0 exch 0 SC 5 2 roll awidthshow } bind def
-/Q { moveto show } bind def
-/R { moveto 0 SC 3 -1 roll widthshow } bind def
-/S { moveto 0 exch ashow } bind def
-/T { moveto 0 exch 0 SC 5 2 roll awidthshow } bind def
-
-% name size font SF -
-
-/SF {
- findfont exch
- [ exch dup 0 exch 0 exch neg 0 0 ] makefont
- dup setfont
- [ exch /setfont cvx ] cvx bind def
-} bind def
-
-% name a c d font MF -
-
-/MF {
- findfont
- [ 5 2 roll
- 0 3 1 roll % b
- neg 0 0 ] makefont
- dup setfont
- [ exch /setfont cvx ] cvx bind def
-} bind def
-
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-
-% Guess the page length.
-% This assumes that the imageable area is vertically centered on the page.
-% PLG - length
-
-/PLG {
- gsave newpath clippath pathbbox grestore
- exch pop add exch pop
-} bind def
-
-% BP -
-
-/BP {
- /level0 save def
- 1 setlinecap
- 1 setlinejoin
- 72 RES div dup scale
- LS {
- 90 rotate
- } {
- 0 PL translate
- } ifelse
- 1 -1 scale
-} bind def
-
-/EP {
- level0 restore
- showpage
-} bind def
-
-
-% centerx centery radius startangle endangle DA -
-
-/DA {
- newpath arcn stroke
-} bind def
-
-% x y SN - x' y'
-% round a position to nearest (pixel + (.25,.25))
-
-/SN {
- transform
- .25 sub exch .25 sub exch
- round .25 add exch round .25 add exch
- itransform
-} bind def
-
-% endx endy startx starty DL -
-% we round the endpoints of the line, so that parallel horizontal
-% and vertical lines will appear even
-
-/DL {
- SN
- moveto
- SN
- lineto stroke
-} bind def
-
-% centerx centery radius DC -
-
-/DC {
- newpath 0 360 arc closepath
-} bind def
-
-
-/TM matrix def
-
-% width height centerx centery DE -
-
-/DE {
- TM currentmatrix pop
- translate scale newpath 0 0 .5 0 360 arc closepath
- TM setmatrix
-} bind def
-
-% these are for splines
-
-/RC /rcurveto load def
-/RL /rlineto load def
-/ST /stroke load def
-/MT /moveto load def
-/CL /closepath load def
-
-% fill the last path
-
-% amount FL -
-
-/FL {
- currentgray exch setgray fill setgray
-} bind def
-
-% fill with the ``current color''
-
-/BL /fill load def
-
-/LW /setlinewidth load def
-% new_font_name encoding_vector old_font_name RE -
-
-/RE {
- findfont
- dup maxlength dict begin
- {
- 1 index /FID ne { def } { pop pop } ifelse
- } forall
- /Encoding exch def
- dup /FontName exch def
- currentdict end definefont pop
-} bind def
-
-/DEFS 0 def
-
-% hpos vpos EBEGIN -
-
-/EBEGIN {
- moveto
- DEFS begin
-} bind def
-
-/EEND /end load def
-
-/CNT 0 def
-/level1 0 def
-
-% llx lly newwid wid newht ht newllx newlly PBEGIN -
-
-/PBEGIN {
- /level1 save def
- translate
- div 3 1 roll div exch scale
- neg exch neg exch translate
- % set the graphics state to default values
- 0 setgray
- 0 setlinecap
- 1 setlinewidth
- 0 setlinejoin
- 10 setmiterlimit
- [] 0 setdash
- /setstrokeadjust where {
- pop
- false setstrokeadjust
- } if
- /setoverprint where {
- pop
- false setoverprint
- } if
- newpath
- /CNT countdictstack def
- userdict begin
- /showpage {} def
-} bind def
-
-/PEND {
- clear
- countdictstack CNT sub { end } repeat
- level1 restore
-} bind def
-
-end def
-
-/setpacking where {
- pop
- setpacking
-} if
-%%EndResource
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Italic
-%%IncludeResource: font Courier
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL
-792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron/scaron/zcaron
-/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space
-/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft
-/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four
-/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C
-/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash
-/bracketright/circumflex/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q
-/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase
-/guillemotleft/guillemotright/bullet/florin/fraction/perthousand/dagger
-/daggerdbl/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen/brokenbar
-/section/dieresis/copyright/ordfeminine/guilsinglleft/logicalnot/minus
-/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu
-/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guilsinglright
-/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde
-/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute
-/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
-/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute
-/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve
-/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex
-/udieresis/yacute/thorn/ydieresis]def/Courier@0 ENC0/Courier RE/Times-Italic@0
-ENC0/Times-Italic RE/Times-Roman@0 ENC0/Times-Roman RE
-%%EndProlog
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 13/Times-Roman@0 SF(The History of PCCTS)228.232 84 Q/F1 11/Times-Roman@0
-SF(The Purdue Compiler)190.468 108 Q(-Construction T)-.22 E(ool Set)-.88 E/F2
-10/Times-Italic@0 SF -.92(Te)262.245 144 S -.37(re).92 G(nce P).37 E(arr)-.8 E
-/F3 10/Times-Roman@0 SF -.15(Pa)234.755 156 S(rr Research Corporation).15 E
-(Minneapolis, Minnesota)239.39 168 Q(and)280.78 180 Q(Uni)239.315 192 Q -.15
-(ve)-.25 G(rsity of Minnesota).15 E
-(Army High Performance Computing Research Center)180.38 204 Q F2
-([Updated 8-7-94])252.31 228 Q F1 .084(The PCCTS project be)97 259.6 R -.055
-(ga)-.165 G 2.834(na).055 G 2.833(sap)220.547 259.6 S(arser)240.876 259.6 Q
-.083(-generator project for a graduate course at Purdue Uni-)-.22 F -.165(ve)72
-275.6 S 1.085(rsity in the F).165 F 1.086
-(all of 1988 taught by Hank Dietz\212 translator)-.165 F 1.086
-(-writing systems.)-.22 F 1.086(Under the guid-)6.586 F .627
-(ance of Professor Dietz, the parser generator)72 291.6 R 3.377(,A)-.44 G .626
-(NTLR \(originally called YUCC\), continued after)285.18 291.6 R .253
-(the termination of the course and e)72 307.6 R -.165(ve)-.275 G .254
-(ntually became the subject of T).165 F .254(erence P)-.77 F(arr')-.165 E 3.004
-(sM)-.605 G(aster')445.083 307.6 Q 3.004(st)-.605 G(hesis.)479.25 307.6 Q
-(Originally)72 323.6 Q 4.092(,l)-.715 G -.165(ex)126.406 323.6 S 1.342
-(ical analysis w).165 F 1.342(as performed via ALX which w)-.11 F 1.342
-(as soon replaced by W)-.11 F 1.341(ill Cohen')-.44 F(s)-.605 E .594
-(DLG in the F)72 339.6 R .594(all of 1989 \(DF)-.165 F .595(A-based le)-.814 F
-.595(xical-analyzer generator)-.165 F 3.345(,a)-.44 G .595(lso an of)367.188
-339.6 R .595(fshoot of the graduate)-.275 F(translation course\).)72 355.6 Q
-.877(The alpha v)97 375.2 R .877(ersion of ANTLR w)-.165 F .877(as totally re)
--.11 F .876(written resulting in 1.00B.)-.275 F -1.221(Ve)6.376 G .876
-(rsion 1.00B w)1.221 F(as)-.11 E 1.577(released via an internet ne)72 391.2 R
-1.577(wsgroup \(comp.compilers\) posting in February of 1990 and quickly)-.275
-F -.055(ga)72 407.2 S .356(thered a lar).055 F .356(ge follo)-.198 F 3.106
-(wing. 1.00B)-.275 F .356(generated only LL\(1\) parsers, b)3.106 F .356
-(ut allo)-.22 F .356(wed the mer)-.275 F .356(ged descrip-)-.198 F 1.859
-(tion of le)72 423.2 R 1.859(xical and syntactic analysis.)-.165 F 1.86
-(It had rudimentary attrib)7.359 F 1.86(ute handling similar to that of)-.22 F
--.55 -1.32(YA C)72 439.2 T 3.549(Ca)1.32 G .799
-(nd did not incorporate rule parameters or return v)109.231 439.2 R .798
-(alues; do)-.275 F(wnw)-.275 E .798(ard inheritance w)-.11 F .798(as v)-.11 F
-(ery)-.165 E -.165(aw)72 455.2 S(kw).165 E 6.433(ard. 1.00B-generated)-.11 F
-3.684(parsers terminated upon the \214rst syntax error)6.433 F 9.184(.L)-.605 G
--.165(ex)440.916 455.2 S 3.684(ical classes).165 F(\(modes\) were not allo)72
-471.2 Q(wed and DLG did not ha)-.275 E .33 -.165(ve a)-.22 H 2.75(ni).165 G
-(nteracti)305.959 471.2 Q .33 -.165(ve m)-.275 H(ode.).165 E .831
-(Upon starting his Ph.D. at Purdue in the F)97 490.8 R .83(all of 1990, T)-.165
-F .83(erence P)-.77 F .83(arr be)-.165 F -.055(ga)-.165 G 3.58(nt).055 G .83
-(he second total)436.351 490.8 R(re)72 506.8 Q 1.646(write of ANTLR.)-.275 F
-1.646(The method by which grammars may be practically analyzed to generate)
-7.146 F/F4 11/Times-Italic@0 SF(LL)72.638 522.8 Q F1(\().583 E F4(k).396 E F1
-3.849(\)l).737 G 1.099(ookahead information w)105.703 522.8 R 1.099(as disco)
--.11 F -.165(ve)-.165 G 1.099(red in August of 1990 just before his return.)
-.165 F -1.221(Ve)6.598 G(rsion)1.221 E .626
-(1.00 incorporated this algorithm and included the AST mechanism, le)72 538.8 R
-.626(xical classes, error classes,)-.165 F .354(and automatic error reco)72
-554.8 R -.165(ve)-.165 G .353(ry; code quality and portability were higher).165
-F 5.853(.I)-.605 G 3.103(nF)395.965 554.8 S .353(ebruary of 1992 1.00)410.684
-554.8 R -.11(wa)72 570.8 S 2.76(sr).11 G .01
-(eleased via an article in SIGPLAN Notices.)95.418 570.8 R .01
-(Peter Dahl, Ph.D. candidate, and Professor Matt)5.51 F(O'K)72 586.8 Q 2.074
-(eefe \(both at the Uni)-.275 F -.165(ve)-.275 G 2.073
-(rsity of Minnesota\) tested this v).165 F 2.073(ersion e)-.165 F(xtensi)-.165
-E -.165(ve)-.275 G(ly).165 E 7.573(.D)-.715 G 2.073(ana Hogg)448.522 586.8 R
-(att)-.055 E .078(\(Micro Data Base Systems, Inc.\) came up with the idea of e\
-rror grouping \(strings attached to non-)72 602.8 R
-(terminals\) and tested 1.00 hea)72 618.8 Q(vily)-.22 E(.)-.715 E -1.221(Ve)97
-638.4 S .878(rsion 1.06 w)1.221 F .877
-(as released in December 1992 and represented a lar)-.11 F .877
-(ge feature enhancement)-.198 F -.165(ove)72 654.4 S 3.648(r1).165 G 3.648
-(.00. F)100.365 654.4 R .898(or e)-.165 F .899
-(xample, rudimentary semantic predicates were introduced, error messages were)
--.165 F 2.281(signi\214cantly impro)72 670.4 R -.165(ve)-.165 G 5.031(df).165 G
-(or)181.953 670.4 Q F4(k)5.427 E F1 2.281
-(>1 lookahead and ANTLR parsers could indicate that lookahead).737 F 1.381
-(fetches were to occur only when necessary for the parse \(normally)72 686.4 R
-4.131(,t)-.715 G 1.381(he lookahead `)387.051 686.4 R(`pipe')-.814 E 4.132('w)
--.814 G(as)494.837 686.4 Q 1.182(constantly full\).)72 702.4 R 1.182
-(Russell Quong joined the project in the Spring of 1992 to aid in the semantic)
-6.682 F .681(predicate design.)72 718.4 R(Be)6.181 E .681(ginning and adv)-.165
-F .682(anced tutorials were created and released as well.)-.275 F 3.432(Am)
-6.182 G(ak)485.179 718.4 Q(e-)-.11 E .993(\214le generator w)72 734.4 R .993
-(as included that sets up dependencies and such correctly for ANTLR and DLG.)
--.11 F EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 11/Times-Roman@0 SF 2.75(-2-)278.837 52 S -1.221(Ve)72 88 S 1.414(ry fe)
-1.221 F 4.164(w1)-.275 G 1.414(.00 incompatibilities were introduced \(1.00 w)
-122.81 88 R 1.415(as quite dif)-.11 F 1.415(ferent from 1.00B in some)-.275 F
-(areas\).)72 104 Q 1.089(1.10 w)97 123.6 R 1.088
-(as released on August 31, 1993 and incorporated b)-.11 F 1.088(ug \214x)-.22 F
-1.088(es, a fe)-.165 F 3.838(wf)-.275 G 1.088(eature enhance-)433.59 123.6 R
-3.112(ments and a major ne)72 139.6 R 5.863(wc)-.275 G(apability \212)196.957
-139.6 Q 3.113(an arbitrary lookahead operator \(syntactic predicate\),)5.863 F
-/F1 11/Courier@0 SF(\(alpha\)?beta)72 155.6 Q F0 6.754(.T)C 1.254
-(his feature w)167.425 155.6 R 1.254
-(as co-designed with Professor Russell Quong also at Purdue.)-.11 F 3.297 -.88
-(To s)72 171.6 T 1.537
-(upport in\214nite lookahead, a preprocessor \215ag, ZZINF_LOOK, w).88 F 1.537
-(as created that forced the)-.11 F .21(ANTLR\(\) macro to tok)72 187.6 R .21
-(enize all input prior to parsing.)-.11 F .209(Hence, at an)5.709 F 2.959(ym)
--.165 G .209(oment, an action or predi-)389.215 187.6 R .936
-(cate can see the entire input sentence.)72 203.6 R .936
-(The predicate mechanism of 1.06 w)6.436 F .937(as e)-.11 F .937
-(xtended to allo)-.165 F(w)-.275 E .55
-(multiple predicates to be hoisted; the syntactic conte)72 219.6 R .55
-(xt of a predicate w)-.165 F .55(as also mo)-.11 F -.165(ve)-.165 G 3.299(da)
-.165 G .549(long with)461.585 219.6 R(the predicate.)72 235.6 Q .754
-(In February of 1994, SORCERER \(a simple tree-parser generator\) w)97 255.2 R
-.755(as released.)-.11 F .755(This tool)6.255 F(allo)72 271.2 Q .6(ws the user\
- to parse child-sibling trees by specifying a grammar rather than b)-.275 F
-.599(uilding a recur)-.22 F(-)-.22 E(si)72 287.2 Q -.165(ve)-.275 G 1.39
-(-descent tree w).165 F(alk)-.11 E 1.391(er by hand.)-.11 F -.88(Wo)6.891 G
-1.391(rk to).88 F -.11(wa)-.275 G 1.391
-(rds a library of tree transformations is underw).11 F(ay)-.11 E(.)-.715 E .581
-(Aaron Sa)72 303.2 R(wde)-.165 E 3.331(ya)-.165 G 3.331(tT)145.531 303.2 S .581
-(he Uni)158.641 303.2 R -.165(ve)-.275 G .58
-(rsity of Minnesota became a second author of SORCERER after the).165 F
-(initial release.)72 319.2 Q .627(On April 1, 1994, PCCTS 1.20 w)97 338.8 R
-.627(as released.)-.11 F .627(This w)6.127 F .627(as the \214rst v)-.11 F .627
-(ersion to acti)-.165 F -.165(ve)-.275 G .627(ly support).165 F 1.664
-(C++ output.)72 354.8 R 1.664(It also included important \214x)7.164 F 1.663
-(es re)-.165 F -.055(ga)-.165 G 1.663
-(rding semantic predicates and \(..\)+ subrules.).055 F(This v)72 370.8 Q
-(ersion also introduced tok)-.165 E(en classes, the `)-.11 E(`)-.814 E/F2 11
-/Times-Italic@0 SF(not)A F0 1.628 -.814('' o)D(perator).814 E 2.75(,a)-.44 G
-(nd tok)355.294 370.8 Q(en ranges.)-.11 E .764
-(On June 19, 1994, SORCERER 1.00B9 w)97 390.4 R .765(as released.)-.11 F .765
-(Gary Funck of Intrepid T)6.265 F(echnology)-.77 E .807
-(joined the SORCERER team and pro)72 406.4 R .807(vided v)-.165 F .807(ery v)
--.165 F .807(aluable suggestions re)-.275 F -.055(ga)-.165 G .806(rding the `)
-.055 F(`transform')-.814 E(')-.814 E(mode of SORCERER.)72 422.4 Q 1.137
-(On August 8, 1994, PCCTS 1.21 w)97 442 R 1.137(as released.)-.11 F 1.138
-(It mainly cleaned up the C++ output and)6.637 F(included a number of b)72 458
-Q(ug \214x)-.22 E(es.)-.165 E .316(From the 1.21 release forw)97 477.6 R .316
-(ard, the maintenance and support of all PCCTS tools will be pri-)-.11 F 1.557
-(marily pro)72 493.6 R 1.557(vided by P)-.165 F 1.557
-(arr Research Corporation, Minneapolis MN---an or)-.165 F -.055(ga)-.198 G
-1.558(nization founded on).055 F 1.616(the principles of e)72 509.6 R 1.616
-(xcellence in research and inte)-.165 F 1.616(grity in b)-.165 F 1.616
-(usiness; we are de)-.22 F -.22(vo)-.275 G 1.616(ted to pro).22 F(viding)-.165
-E 1.202(really cool softw)72 525.6 R 1.202(are tools.)-.11 F 1.202
-(Please see \214le PCCTS.FUTURE for more information.)6.702 F 1.203(All PCCTS)
-6.703 F(tools currently in the public domain will continue to be in the public\
- domain.)72 541.6 Q 1.198(Looking to)97 561.2 R -.11(wa)-.275 G 1.198
-(rds the future, a graphical user).11 F(-interf)-.22 E 1.197
-(ace is in the design phase.)-.11 F 1.197(This w)6.697 F(ould)-.11 E(allo)72
-577.2 Q 2.753(wu)-.275 G .003(sers to vie)104.42 577.2 R 2.753(wt)-.275 G .004
-(he syntax diagram representation of their grammars and w)162.509 577.2 R .004
-(ould highlight non-)-.11 F 1.181(deterministic productions.)72 593.2 R -.165
-(Pa)6.681 G 1.18(rsing can be traced graphically as well.).165 F 1.18
-(This system will be b)6.68 F(uilt)-.22 E .167(using a multiplatform windo)72
-609.2 R 2.917(wl)-.275 G(ibrary)211.73 609.2 Q 5.667(.W)-.715 G 2.917(ea)
-255.204 609.2 S .168(lso anticipate the introduction of a sophisticated error)
-267.889 609.2 R(handling mechanism called `)72 625.2 Q(`parser e)-.814 E
-(xception handling')-.165 E 2.75('i)-.814 G 2.75(nan)327.431 625.2 S
-(ear future release.)348.815 625.2 Q(Currently)97 644.8 Q 3.019(,P)-.715 G .269
-(CCTS is used at o)150.333 644.8 R -.165(ve)-.165 G 3.019(r1).165 G .269
-(000 kno)253.098 644.8 R .268(wn academic, go)-.275 F -.165(ve)-.165 G .268
-(rnment, and commercial sites).165 F .859(in 37 countries.)72 660.8 R .859
-(Of course, the true number of users is unkno)6.359 F .859(wn due to the lar)
--.275 F .859(ge number of ftp)-.198 F(sites.)72 676.8 Q EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 11/Times-Roman@0 SF 2.75(-3-)278.837 52 S(Credits)272.11 88 Q .44 LW
-472.162 103.75 103.838 103.75 DL(Idea/T)134.236 117 Q 52.987(ool Coder)-.88 F
-(Co-designer\(s\))345.436 117 Q 281.334 103.75 281.334 124.75 DL 209.273 103.75
-209.273 124.75 DL 209.273 124.75 103.838 124.75 DL 103.838 126.75 209.273
-126.75 DL 281.334 124.75 209.273 124.75 DL 209.273 126.75 281.334 126.75 DL
-472.162 124.75 281.334 124.75 DL 281.334 126.75 472.162 126.75 DL(ANTLR 1.00A)
-109.338 140 Q -.77(Te)217.523 140 S(rence P).77 E 13.75(arr Hank)-.165 F(Dietz)
-2.75 E 82.83(ALX T)109.338 156 R(erence P)-.77 E 13.75(arr Hank)-.165 F(Dietz)
-2.75 E(ANTLR 1.00B)109.338 172 Q -.77(Te)217.523 172 S(rence P).77 E 13.75
-(arr Hank)-.165 F(Dietz, W)2.75 E(ill Cohen)-.44 E(DLG 1.00B)109.338 188 Q -.44
-(Wi)217.523 188 S(ll Cohen).44 E -.77(Te)289.584 188 S(rence P).77 E(arr)-.165
-E 2.75(,H)-.44 G(ank Dietz)358.147 188 Q(NF)109.338 204 Q 2.75(AR)-.814 G
-30.778(elabelling W)140.611 204 R(ill Cohen)-.44 E/F1 11/Times-Italic@0 SF(LL)
-109.976 220 Q F0(\().583 E F1(k).396 E F0 2.75(\)a).737 G 40.447(nalysis T)
-143.768 220 R(erence P)-.77 E 13.75(arr Hank)-.165 F(Dietz)2.75 E(ANTLR 1.00)
-109.338 236 Q -.77(Te)217.523 236 S(rence P).77 E 13.75(arr Hank)-.165 F
-(Dietz, W)2.75 E(ill Cohen)-.44 E(DLG 1.00)109.338 252 Q -.44(Wi)217.523 252 S
-(ll Cohen).44 E -.77(Te)289.584 252 S(rence P).77 E(arr)-.165 E 2.75(,H)-.44 G
-(ank Dietz)358.147 252 Q(ANTLR 1.06)109.338 268 Q -.77(Te)217.523 268 S
-(rence P).77 E 13.75(arr W)-.165 F(ill Cohen, Russell Quong, Hank Dietz)-.44 E
-(DLG 1.06)109.338 284 Q -.44(Wi)217.523 284 S(ll Cohen).44 E -.77(Te)289.584
-284 S(rence P).77 E(arr)-.165 E 2.75(,H)-.44 G(ank Dietz)358.147 284 Q
-(ANTLR 1.10)109.338 300 Q -.77(Te)217.523 300 S(rence P).77 E 13.75(arr W)-.165
-F(ill Cohen, Russell Quong)-.44 E(ANTLR 1.20)109.338 316 Q -.77(Te)217.523 316
-S(rence P).77 E 13.75(arr W)-.165 F(ill Cohen, Russell Quong)-.44 E(ANTLR 1.21)
-109.338 332 Q -.77(Te)217.523 332 S(rence P).77 E 13.75(arr Russell)-.165 F
-(Quong)2.75 E(DLG 1.10)109.338 348 Q -.44(Wi)217.523 348 S(ll Cohen).44 E -.77
-(Te)289.584 348 S(rence P).77 E(arr)-.165 E(DLG 1.20)109.338 364 Q -.44(Wi)
-217.523 364 S(ll Cohen).44 E -.77(Te)289.584 364 S(rence P).77 E(arr)-.165 E
-(DLG 1.21)109.338 380 Q -.77(Te)217.523 380 S(rence P).77 E(arr)-.165 E
-(Semantic predicates)109.338 396 Q -.77(Te)217.523 396 S(rence P).77 E 13.75
-(arr Russell)-.165 F(Quonq)2.75 E(Syntactic predicates)109.338 412 Q -.77(Te)
-217.523 412 S(rence P).77 E 13.75(arr Russell)-.165 F(Quonq)2.75 E
-(SORCERER 1.00A)109.338 428 Q -.77(Te)217.523 428 S(rence P).77 E(arr)-.165 E
-(SORCERER 1.00B)109.338 444 Q -.77(Te)217.523 444 S(rence P).77 E 13.75
-(arr Aaron)-.165 F(Sa)2.75 E(wde)-.165 E(y)-.165 E(SORCERER 1.00B9)109.338 460
-Q -.77(Te)217.523 460 S(rence P).77 E 13.75(arr Aaron)-.165 F(Sa)2.75 E(wde)
--.165 E 1.43 -.715(y, G)-.165 H(ary Funck).715 E 472.162 467.75 103.838 467.75
-DL 472.162 103.75 472.162 467.75 DL 103.838 103.75 103.838 467.75 DL EP
-%%Trailer
-end
-%%EOF
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/history.txt b/BaseTools/Source/C/VfrCompile/Pccts/history.txt
deleted file mode 100644
index 89ad8408c9..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/history.txt
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-
- The History of PCCTS
-
- The Purdue Compiler-Construction Tool Set
-
-
- Terence Parr
- Parr Research Corporation
- Minneapolis, Minnesota
- and
- University of Minnesota
- Army High Performance Computing Research Center
-
- [Updated 8-7-94]
-
-
- The PCCTS project began as a parser-generator project for a gra-
-duate course at Purdue University in the Fall of 1988 taught by Hank
-Dietz- translator-writing systems. Under the guidance of Professor
-Dietz, the parser generator, ANTLR (originally called YUCC), continued
-after the termination of the course and eventually became the subject
-of Terence Parr's Master's thesis. Originally, lexical analysis was
-performed via ALX which was soon replaced by Will Cohen's DLG in the
-Fall of 1989 (DFA-based lexical-analyzer generator, also an offshoot
-of the graduate translation course).
-
- The alpha version of ANTLR was totally rewritten resulting in
-1.00B. Version 1.00B was released via an internet newsgroup
-(comp.compilers) posting in February of 1990 and quickly gathered a
-large following. 1.00B generated only LL(1) parsers, but allowed the
-merged description of lexical and syntactic analysis. It had rudimen-
-tary attribute handling similar to that of YACC and did not incor-
-porate rule parameters or return values; downward inheritance was very
-awkward. 1.00B-generated parsers terminated upon the first syntax
-error. Lexical classes (modes) were not allowed and DLG did not have
-an interactive mode.
-
- Upon starting his Ph.D. at Purdue in the Fall of 1990, Terence
-Parr began the second total rewrite of ANTLR. The method by which
-grammars may be practically analyzed to generate LL(k) lookahead
-information was discovered in August of 1990 just before his return.
-Version 1.00 incorporated this algorithm and included the AST mechan-
-ism, lexical classes, error classes, and automatic error recovery;
-code quality and portability were higher. In February of 1992 1.00
-was released via an article in SIGPLAN Notices. Peter Dahl, Ph.D.
-candidate, and Professor Matt O'Keefe (both at the University of Min-
-nesota) tested this version extensively. Dana Hoggatt (Micro Data
-Base Systems, Inc.) came up with the idea of error grouping (strings
-attached to non-terminals) and tested 1.00 heavily.
-
- Version 1.06 was released in December 1992 and represented a
-large feature enhancement over 1.00. For example, rudimentary seman-
-tic predicates were introduced, error messages were significantly
-improved for k>1 lookahead and ANTLR parsers could indicate that loo-
-kahead fetches were to occur only when necessary for the parse
-
-
-
- Page 1
-
- PCCTS
-
-
-(normally, the lookahead "pipe" was constantly full). Russell Quong
-joined the project in the Spring of 1992 to aid in the semantic predi-
-cate design. Beginning and advanced tutorials were created and
-released as well. A makefile generator was included that sets up
-dependencies and such correctly for ANTLR and DLG. Very few 1.00
-incompatibilities were introduced (1.00 was quite different from 1.00B
-in some areas).
-
- 1.10 was released on August 31, 1993 and incorporated bug fixes,
-a few feature enhancements and a major new capability - an arbitrary
-lookahead operator (syntactic predicate), (alpha)?beta. This feature
-was co-designed with Professor Russell Quong also at Purdue. To sup-
-port infinite lookahead, a preprocessor flag, ZZINF_LOOK, was created
-that forced the ANTLR() macro to tokenize all input prior to parsing.
-Hence, at any moment, an action or predicate can see the entire input
-sentence. The predicate mechanism of 1.06 was extended to allow mul-
-tiple predicates to be hoisted; the syntactic context of a predicate
-was also moved along with the predicate.
-
- In February of 1994, SORCERER (a simple tree-parser generator)
-was released. This tool allows the user to parse child-sibling trees
-by specifying a grammar rather than building a recursive-descent tree
-walker by hand. Work towards a library of tree transformations is
-underway. Aaron Sawdey at The University of Minnesota became a second
-author of SORCERER after the initial release.
-
- On April 1, 1994, PCCTS 1.20 was released. This was the first
-version to actively support C++ output. It also included important
-fixes regarding semantic predicates and (..)+ subrules. This version
-also introduced token classes, the "not" operator, and token ranges.
-
- On June 19, 1994, SORCERER 1.00B9 was released. Gary Funck of
-Intrepid Technology joined the SORCERER team and provided very valu-
-able suggestions regarding the "transform" mode of SORCERER.
-
- On August 8, 1994, PCCTS 1.21 was released. It mainly cleaned up
-the C++ output and included a number of bug fixes.
-
- From the 1.21 release forward, the maintenance and support of all
-PCCTS tools will be primarily provided by Parr Research Corporation,
-Minneapolis MN---an organization founded on the principles of excel-
-lence in research and integrity in business; we are devoted to provid-
-ing really cool software tools. Please see file PCCTS.FUTURE for more
-information. All PCCTS tools currently in the public domain will con-
-tinue to be in the public domain.
-
- Looking towards the future, a graphical user-interface is in the
-design phase. This would allow users to view the syntax diagram
-representation of their grammars and would highlight nondeterministic
-productions. Parsing can be traced graphically as well. This system
-will be built using a multiplatform window library. We also antici-
-pate the introduction of a sophisticated error handling mechanism
-called "parser exception handling" in a near future release.
-
-
-
-
- Page 2
-
- PCCTS
-
-
- Currently, PCCTS is used at over 1000 known academic, government,
-and commercial sites in 37 countries. Of course, the true number of
-users is unknown due to the large number of ftp sites.
- Credits
-
-_____________________________________________________________________________
-_____________________________________________________________________________
-|ANTLR 1.00A Terence Parr Hank Dietz |
-|ALX Terence Parr Hank Dietz |
-|ANTLR 1.00B Terence Parr Hank Dietz, Will Cohen |
-|DLG 1.00B Will Cohen Terence Parr, Hank Dietz |
-|NFA Relabelling Will Cohen |
-|LL(k) analysis Terence Parr Hank Dietz |
-|ANTLR 1.00 Terence Parr Hank Dietz, Will Cohen |
-|DLG 1.00 Will Cohen Terence Parr, Hank Dietz |
-|ANTLR 1.06 Terence Parr Will Cohen, Russell Quong, Hank Dietz|
-|DLG 1.06 Will Cohen Terence Parr, Hank Dietz |
-|ANTLR 1.10 Terence Parr Will Cohen, Russell Quong |
-|ANTLR 1.20 Terence Parr Will Cohen, Russell Quong |
-|ANTLR 1.21 Terence Parr Russell Quong |
-|DLG 1.10 Will Cohen Terence Parr |
-|DLG 1.20 Will Cohen Terence Parr |
-|DLG 1.21 Terence Parr |
-|Semantic predicates Terence Parr Russell Quonq |
-|Syntactic predicates Terence Parr Russell Quonq |
-|SORCERER 1.00A Terence Parr |
-|SORCERER 1.00B Terence Parr Aaron Sawdey |
-|SORCERER 1.00B9 Terence Parr Aaron Sawdey, Gary Funck |
-|___________________________________________________________________________|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 3
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/makefile.old b/BaseTools/Source/C/VfrCompile/Pccts/makefile.old
deleted file mode 100644
index f9b2dd2b9b..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/makefile.old
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# Main makefile for PCCTS 1.33MR33 /* MRXXX */
-#
-# Terence Parr
-# Parr Research Corporation
-#
-# verbosity versus silence...
-PSss=
-#
-# this can be set to /user/local/bin etc...
-BINDIR=bin
-# This part added by Thomas Herter, M"unchen, Germany. See also manpages
-# target.
-MANDIR=$(HOME)/man
-MANEXT=1
-MANFILES=dlg/dlg.1 antlr/antlr.1
-
-#CC=cc
-#CC=gcc
-#COPT=-O2
-
-pccts:
- @echo " "
- @echo " Welcome to PCCTS 1.33MR33 installation"
- @echo " "
- @echo " (Version 1.33 Maintenance Release #33)" # mrxxx
- @echo " "
- @echo " Released 19 April 2002"
- @echo " "
- @echo " Featuring"
- @echo " ANTLR -- ANother Tool for Language Recognition"
- @echo " DLG -- DFA-based Lexical Analyzer Generator"
- @echo " SORCERER -- Source-to-source translator (tree walker)"
- @echo " "
- @echo " http://www.antlr.org"
- @echo " "
- @echo " Trouble reports to tmoog@polhode.com"
- @echo " Additional PCCTS 1.33 information at"
- @echo " http://www.polhode.com"
- @echo
- @echo
- @echo "To substitute gcc for CC to invoke compiler: make CC=gcc"
- @echo "If there are problems with cr and lf try: unzip -a ..."
- @echo
-#
- @if [ ! -d $(BINDIR) ] ; then mkdir $(BINDIR) ; fi
- @echo Making executables...
- (cd ./antlr; $(MAKE) CC="$(CC)" COPT="$(COPT)")
- @echo antlr executable now in $(BINDIR)
- (cd ./dlg; $(MAKE) CC="$(CC)" COPT="$(COPT)")
- @echo dlg executable now in $(BINDIR)
- @echo
- @echo " PCCTS 1.33MR33 installation complete" # MRXXX
-
-clean:
- (cd ./antlr; $(MAKE) -s clean)
- (cd ./dlg; $(MAKE) -s clean)
-
-
-manpages:
- # mkdir -p $(MANDIR)/man$(MANEXT)
- if [ ! -d $(MANDIR) ] ; then \
- mkdir $(MANDIR) ; fi
- if [ ! -d $(MANDIR)/man$(MANEXT) ] ; then \
- mkdir $(MANDIR)/man$(MANEXT); fi
- cp -p $(MANFILES) $(MANDIR)/man$(MANEXT)
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk.c b/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk.c
deleted file mode 100644
index 4952a30b38..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk.c
+++ /dev/null
@@ -1,1063 +0,0 @@
-/*
- * genmk -- a program to make makefiles for PCCTS
- *
- * ANTLR 1.33MR23
- * Terence John Parr 1989 - 2000
- * Purdue University
- * U of MN
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "pcctscfg.h" /* be sensitive to what ANTLR/DLG call the files */
-
-#ifdef VAXC
-#define DIE return 0;
-#define DONE return 1;
-#else
-#define DIE return 1;
-#define DONE return 0;
-#endif
-
-#ifndef require
-#define require(expr, err) {if ( !(expr) ) fatal(err);}
-#endif
-
-#define MAX_FILES 50
-#define MAX_CFILES 1600
-#define MAX_SFILES 50
-#define MAX_SORS 50
-#define MAX_CLASSES 50
-
-char *RENAME_OBJ_FLAG="-o",
- *RENAME_EXE_FLAG="-o";
-
-char *dlg = "parser.dlg";
-char *err = "err.c";
-char *hdr = "stdpccts.h";
-char *tok = "tokens.h";
-char *mode = "mode.h";
-char *scan = "scan";
-
-char ATOKENBUFFER_O[100];
-char APARSER_O[100];
-char ASTBASE_O[100];
-char PCCTSAST_O[100];
-char LIST_O[100];
-char DLEXERBASE_O[100];
-
-/* Option flags */
-static char *project="t", *files[MAX_FILES], *classes[MAX_CLASSES];
-static char *cfiles[MAX_CFILES];
-static char *sfiles[MAX_SORS][MAX_SFILES],*sclasses[MAX_SORS];
-static int num_sfiles[MAX_SORS]; /*sorcerer files in group */
-static int num_sors = 0; /*sorcerer groups */
-static int num_files = 0; /* grammar files */
-static int num_cfiles = 0; /* additional C/C++ files */
-static int num_classes = 0; /* ANTLR classes */
-static int user_lexer = 0;
-static char *user_token_types = NULL;
-static int gen_CPP = 0;
-static char *outdir=".";
-static char *dlg_class = "DLGLexer";
-static int gen_trees = 0;
-static int gen_hoist = 0;
-static int nondef_comp = 0; /* 1=compiler is non default */
-static char *compilerCCC="CC";
-static char *compilerCC="cc";
-static char *pccts_path="/usr/local/pccts";
-
-#ifdef __STDC__
-void help(void);
-void mk(char *project, char **files, int n, int argc, char **argv);
-void pfiles(char **files, int n, char *suffix);
-void fatal(char *msg);
-void warn(char *msg);
-#else
-void help();
-void mk();
-void pfiles();
-void fatal();
-void warn();
-#endif
-
-typedef struct _Opt {
- char *option;
- int arg;
-#ifdef __cplusplus
- void (*process)(...);
-#else
- void (*process)();
-#endif
- char *descr;
- } Opt;
-
-#ifdef __STDC__
-static void ProcessArgs(int, char **, Opt *);
-#else
-static void ProcessArgs();
-#endif
-
-static void
-#ifdef __STDC__
-pProj(char *s, char *t )
-#else
-pProj( s, t )
-char *s;
-char *t;
-#endif
-{
- project = t;
-}
-
-static void
-#ifdef __STDC__
-pUL( char *s )
-#else
-pUL( s )
-char *s;
-#endif
-{
- user_lexer = 1;
-}
-
-static void
-#ifdef __STDC__
-pCPP( char *s )
-#else
-pCPP( s )
-char *s;
-#endif
-{
- gen_CPP = 1;
-}
-
-static void
-#ifdef __STDC__
-pUT( char *s, char *t )
-#else
-pUT( s, t )
-char *s;
-char *t;
-#endif
-{
- user_token_types = t;
-}
-
-static void
-#ifdef __STDC__
-pTrees( char *s )
-#else
-pTrees( s )
-char *s;
-#endif
-{
- gen_trees = 1;
-}
-
-static void
-#ifdef __STDC__
-pHoist( char *s )
-#else
-pHoist( s )
-char *s;
-#endif
-{
- gen_hoist = 1;
-}
-
-static void
-#ifdef __STDC__
-pSor( char *s )
-#else
-pSor( s )
-char *s;
-#endif
-{
- require(num_sors<MAX_SORS, "exceeded max # of sorcerer groups");
- num_sors++;
- pTrees(NULL); /* silently turn on tree generation */
-}
-
-static void
-#ifdef __STDC__
-pSFiles( char *s, char *t )
-#else
-pSFiles( s, t )
-char *s;
-char *t;
-#endif
-{
- if (num_sors==0)
- {
- pSor(NULL);
- warn("sorcerer input file before any '-sor' option");
- }
-
- require(num_sfiles[num_sors-1]<MAX_SFILES,
- "exceeded max # of sorcerer input files");
- sfiles[num_sors-1][num_sfiles[num_sors-1]++] = t;
-}
-
-static void
-#ifdef __STDC__
-pCFiles( char *s, char *t )
-#else
-pCFiles( s, t )
-char *s;
-char *t;
-#endif
-{
- require(num_cfiles<MAX_CFILES, "exceeded max # of C/C++ input files");
- cfiles[num_cfiles++] = t;
-}
-
-int
-#ifdef __STDC__
-isKnownSuffix( char *s )
-#else
-isKnownSuffix( s )
- char *s;
-#endif
-{
- if(s==NULL) return 0;
- if (strcasecmp(s,".c")==0) return 1;
- if (strcasecmp(s,".cc")==0) return 1;
- if (strcasecmp(s,".cpp")==0) return 1;
- if (strcasecmp(s,".cxx")==0) return 1;
- if (strcasecmp(s,CPP_FILE_SUFFIX)==0) return 1;
- if (strcasecmp(s,".sor")==0) return 2;
- return 0;
-}
-
-static void
-#ifdef __STDC__
-pFile( char *s )
-#else
-pFile( s )
-char *s;
-#endif
-{
- if ( *s=='-' )
- {
- fprintf(stderr, "invalid option: '%s'; ignored...",s);
- return;
- }
- switch(isKnownSuffix(strrchr(s,'.')))
- {
- case 1: /* c/c++ */
- pCFiles("-cfiles",s);
- return;
- case 2: /* sorcerer */
- pSFiles("",s);
- return;
- default: /* grammar (ANTLR) */
- break;
- }
- require(num_files<MAX_FILES, "exceeded max # of input files");
- files[num_files++] = s;
-}
-
-static void
-#ifdef __STDC__
-pClass( char *s, char *t )
-#else
-pClass( s, t )
-char *s;
-char *t;
-#endif
-{
- if (num_sors==0)
- {
- require(num_classes<MAX_CLASSES, "exceeded max # of grammar classes");
- classes[num_classes++] = t;
- } else
- {
- sclasses[num_sors-1] = t; /* one class per sorcerer group (last valid) */
- }
-}
-
-static void
-#ifdef __STDC__
-pDLGClass( char *s, char *t )
-#else
-pDLGClass( s, t )
-char *s;
-char *t;
-#endif
-{
- if ( !gen_CPP ) {
- fprintf(stderr, "-dlg-class makes no sense without C++ mode; ignored...");
- }
- else dlg_class = t;
-}
-
-static void
-#ifdef __STDC__
-pOdir( char *s, char *t )
-#else
-pOdir( s, t )
-char *s;
-char *t;
-#endif
-{
- outdir = t;
-}
-
-static void
-#ifdef __STDC__
-pHdr( char *s, char *t )
-#else
-pHdr( s, t )
-char *s;
-char *t;
-#endif
-{
- hdr = t;
-}
-
-static void
-#ifdef __STDC__
-pCompiler( char *s, char *t )
-#else
-pCompiler( s, t )
-char *s;
-char *t;
-#endif
-{
- compilerCCC = t;
- compilerCC = t;
- nondef_comp = 1;
-}
-
-static void
-#ifdef __STDC__
-ppccts_path( char *s, char *t )
-#else
-ppccts_path( s, t )
-char *s;
-char *t;
-#endif
-{
- pccts_path = t;
-}
-
-Opt options[] = {
- { "-CC", 0, pCPP, "Generate C++ output"},
- { "-class", 1, pClass, "Name of a grammar class defined in grammar (if C++)"},
- { "-dlg-class", 1,pDLGClass,"Name of DLG lexer class (default=DLGLexer) (if C++)"},
- { "-header", 1,pHdr, "Name of ANTLR standard header info (default=no file)"},
- { "-o", 1, pOdir, "Directory where output files should go (default=\".\")"},
- { "-project", 1, pProj, "Name of executable to create (default=t)"},
- { "-token-types", 1, pUT, "Token types are in this file (don't use tokens.h)"},
- { "-trees", 0, pTrees, "Generate ASTs"},
- { "-user-lexer", 0, pUL, "Do not create a DLG-based scanner"},
- { "-mrhoist",0,pHoist, "Maintenance release style hoisting"},
- { "-cfiles",1,pCFiles, "Additional files in C or C++ to compile"},
- { "-sor",0,pSor, "Start of sorcerer group"},
- { "-pccts_path",1,ppccts_path,
- "Path for $PCCTS directory (default is /usr/local/pccts)"},
- { "-compiler",1,pCompiler,
- "Default compiler (default is CC/cc)"},
- { "*", 0,pFile, "" }, /* anything else is a file */
- { NULL, 0, NULL, NULL }
-};
-
-#ifdef __STDC__
-extern char *DIR(void);
-#else
-extern char *DIR();
-#endif
-
-#ifdef __STDC__
-int main(int argc, char **argv)
-#else
-int main(argc, argv)
-int argc;
-char **argv;
-#endif
-{
- int i;
-
- if ( argc == 1 ) { help(); DIE; }
- for(i=0;i<MAX_SORS;i++) num_sfiles[i]=0;
-
- ProcessArgs(argc-1, &(argv[1]), options);
-
- strcpy(ATOKENBUFFER_O, ATOKENBUFFER_C);
- ATOKENBUFFER_O[strlen(ATOKENBUFFER_C)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(ATOKENBUFFER_O, OBJ_FILE_SUFFIX);
- strcpy(APARSER_O, APARSER_C);
- APARSER_O[strlen(APARSER_O)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(APARSER_O, OBJ_FILE_SUFFIX);
-
- strcpy(ASTBASE_O, ASTBASE_C);
- ASTBASE_O[strlen(ASTBASE_C)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(ASTBASE_O, OBJ_FILE_SUFFIX);
-
- strcpy(PCCTSAST_O, PCCTSAST_C);
- PCCTSAST_O[strlen(PCCTSAST_C)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(PCCTSAST_O, OBJ_FILE_SUFFIX);
-
- strcpy(LIST_O, LIST_C);
- LIST_O[strlen(LIST_C)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(LIST_O, OBJ_FILE_SUFFIX);
-
- strcpy(DLEXERBASE_O, DLEXERBASE_C);
- DLEXERBASE_O[strlen(DLEXERBASE_C)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(DLEXERBASE_O, OBJ_FILE_SUFFIX);
-
- if ( num_files == 0 ) fatal("no grammar files specified; exiting...");
- if ( !gen_CPP && num_classes>0 ) {
- warn("can't define classes w/o C++ mode; turning on C++ mode...\n");
- gen_CPP=1;
- }
- if (!gen_CPP && num_sors) {
- warn("can't define sorcerer group in C mode (yet); turning on C++ mode...\n");
- gen_CPP=1;
- }
- if ( gen_CPP && num_classes==0 ) {
- fatal("must define classes >0 grammar classes in C++ mode\n");
- }
-
- mk(project, files, num_files, argc, argv);
- DONE;
-}
-
-#ifdef __STDC__
-void help(void)
-#else
-void help()
-#endif
-{
- Opt *p = options;
- static char buf[1000+1];
-
- fprintf(stderr, "genmk [options] f1.g ... fn.g\n");
- while ( p->option!=NULL && *(p->option) != '*' )
- {
- buf[0]='\0';
- if ( p->arg ) sprintf(buf, "%s ___", p->option);
- else strcpy(buf, p->option);
- fprintf(stderr, "\t%-16s %s\n", buf, p->descr);
- p++;
- }
-}
-
-#ifdef __STDC__
-void mk(char *project, char **files, int n, int argc, char **argv)
-#else
-void mk(project, files, n, argc, argv)
-char *project;
-char **files;
-int n;
-int argc;
-char **argv;
-#endif
-{
- int i,j;
-
- printf("#\n");
- printf("# PCCTS makefile for: ");
- pfiles(files, n, NULL);
- printf("\n");
- printf("#\n");
- printf("# Created from:");
- for (i=0; i<argc; i++) printf(" %s", argv[i]);
- printf("\n");
- printf("#\n");
- printf("# PCCTS release 1.33MR23\n");
- printf("# Project: %s\n", project);
- if ( gen_CPP ) printf("# C++ output\n");
- else printf("# C output\n");
- if ( user_lexer ) printf("# User-defined scanner\n");
- else printf("# DLG scanner\n");
- if ( user_token_types!=NULL ) printf("# User-defined token types in '%s'\n", user_token_types);
- else printf("# ANTLR-defined token types\n");
- printf("#\n");
-/***********
- printf(".SUFFIXES:\n.SUFFIXES:\t.o .cpp .c .h .g .i .dlg .sor\n");
- ***********/
- if ( user_token_types!=NULL ) {
- printf("# Make sure #tokdefs directive in ANTLR grammar lists this file:\n");
- printf("TOKENS = %s", user_token_types);
- }
- else printf("TOKENS = %stokens.h", DIR());
- printf("\n");
- printf("#\n");
- printf("# The following filenames must be consistent with ANTLR/DLG flags\n");
- printf("DLG_FILE = %s%s\n", DIR(), dlg);
- printf("ERR = %serr\n", DIR());
- if ( strcmp(hdr,"stdpccts.h")!=0 ) printf("HDR_FILE = %s%s\n", DIR(), hdr);
- else printf("HDR_FILE =\n");
- if ( !gen_CPP ) printf("MOD_FILE = %s%s\n", DIR(), mode);
- if ( !gen_CPP ) printf("SCAN = %s\n", scan);
- else printf("SCAN = %s%s\n", DIR(), dlg_class);
-
- printf("PCCTS = %s\n",pccts_path);
- printf("ANTLR_H = $(PCCTS)%sh\n", DirectorySymbol);
- if (num_sors>0) {
- printf("SOR_H = $(PCCTS)%ssorcerer%sh\n", DirectorySymbol, DirectorySymbol);
- printf("SOR_LIB = $(PCCTS)%ssorcerer%slib\n",
- DirectorySymbol, DirectorySymbol);
- }
- printf("BIN = $(PCCTS)%sbin\n", DirectorySymbol);
- printf("ANTLR = $(BIN)%santlr\n", DirectorySymbol);
- printf("DLG = $(BIN)%sdlg\n", DirectorySymbol);
- if (num_sors>0) printf("SOR = $(BIN)%ssor\n", DirectorySymbol);
- printf("CFLAGS = -I. -I$(ANTLR_H)");
- if (num_sors>0) printf(" -I$(SOR_H)");
- if ( strcmp(outdir, ".")!=0 ) printf(" -I%s", outdir);
- printf(" $(COTHER)");
- printf("\n");
- printf("AFLAGS =");
- if ( strcmp(outdir,".")!=0 ) printf(" -o %s", outdir);
- if ( user_lexer ) printf(" -gx");
- if ( gen_CPP ) printf(" -CC");
- if ( strcmp(hdr,"stdpccts.h")!=0 ) printf(" -gh %s", hdr);
- if ( gen_trees ) printf(" -gt");
- if ( gen_hoist ) {
- printf(" -mrhoist on") ;
- } else {
- printf(" -mrhoist off");
- };
- printf(" $(AOTHER)");
- printf("\n");
- printf("DFLAGS = -C2 -i");
- if ( gen_CPP ) printf(" -CC");
- if ( strcmp(dlg_class,"DLGLexer")!=0 ) printf(" -cl %s", dlg_class);
- if ( strcmp(outdir,".")!=0 ) printf(" -o %s", outdir);
- printf(" $(DOTHER)");
- printf("\n");
- if (num_sors>0)
- {
- printf("SFLAGS = -CPP");
- if ( strcmp(outdir,".")!=0 ) printf(" -out-dir %s", outdir);
- printf(" $(SOTHER)\n");
- }
- printf("GRM = ");
- pfiles(files, n, NULL);
- printf("\n");
- printf("SRC = ");
- if ( gen_CPP ) pfiles(files, n, CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(files, n, "c");
- if ( gen_CPP ) {
- printf(" \\\n\t");
- pclasses(classes, num_classes, CPP_FILE_SUFFIX_NO_DOT);
- printf(" \\\n\t");
- printf("$(ANTLR_H)%s%s", DirectorySymbol, APARSER_C);
- if ( !user_lexer ) printf(" $(ANTLR_H)%s%s", DirectorySymbol, DLEXERBASE_C);
- if ( gen_trees ) {
- printf(" \\\n\t");
- printf("$(ANTLR_H)%s%s", DirectorySymbol, ASTBASE_C);
- printf(" $(ANTLR_H)%s%s", DirectorySymbol, PCCTSAST_C);
-/* printf(" $(ANTLR_H)%s%s", DirectorySymbol, LIST_C); */
- printf(" \\\n\t");
- }
- printf(" $(ANTLR_H)%s%s", DirectorySymbol, ATOKENBUFFER_C);
- }
- if ( !user_lexer ) {
- if ( gen_CPP ) printf(" $(SCAN)%s", CPP_FILE_SUFFIX);
- else printf(" %s$(SCAN).c", DIR());
- }
- if ( !gen_CPP ) printf(" $(ERR).c");
- for (i=0;i<num_sors;i++)
- {
- printf(" \\\n\t");
- pclasses(&sclasses[i],1,CPP_FILE_SUFFIX_NO_DOT);
- printf(" ");
- pfiles(&sfiles[i][0],num_sfiles[i],CPP_FILE_SUFFIX_NO_DOT);
- }
- if(num_sors>0)
- printf(" \\\n\t$(SOR_LIB)%sSTreeParser.cpp", DirectorySymbol);
- if (num_cfiles>0)
- {
- printf(" \\\n\t");
- pfiles(cfiles,num_cfiles,NULL);
- }
- printf("\n\n");
- printf("OBJ = ");
- pfiles(files, n, "o");
- if ( gen_CPP ) {
- printf(" \\\n\t");
- pclasses(classes, num_classes, "o");
- printf(" \\\n\t");
- printf("%s%s", DIR(), APARSER_O);
- if ( !user_lexer ) {
- printf(" %s%s", DIR(), DLEXERBASE_O);
- }
- if ( gen_trees ) {
- printf(" \\\n\t");
- printf("%s%s", DIR(), ASTBASE_O);
- printf(" %s%s", DIR(), PCCTSAST_O);
-/* printf(" %s%s", DIR(), LIST_O); */
- printf(" \\\n\t");
- }
- printf(" %s%s", DIR(), ATOKENBUFFER_O);
- }
- if ( !user_lexer ) {
- if ( gen_CPP ) printf(" $(SCAN)%s", OBJ_FILE_SUFFIX);
- else printf(" %s$(SCAN)%s", DIR(), OBJ_FILE_SUFFIX);
- }
- if ( !gen_CPP ) printf(" $(ERR)%s", OBJ_FILE_SUFFIX);
- for (i=0;i<num_sors;i++)
- {
- printf(" \\\n\t");
- pclasses(&sclasses[i],1,"o");
- printf(" ");
- pfiles(&sfiles[i][0],num_sfiles[i],"o");
- }
- if(num_sors>0) printf(" \\\n\tSTreeParser.o");
- if (num_cfiles>0)
- {
- printf(" \\\n\t");
- pfiles(cfiles,num_cfiles,"o");
- }
- printf("\n\n");
-
- printf("ANTLR_SPAWN = ");
- if ( gen_CPP ) pfiles(files, n, CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(files, n, "c");
- if ( gen_CPP ) {
- printf(" ");
- pclasses(classes, num_classes, CPP_FILE_SUFFIX_NO_DOT);
- printf(" \\\n\t\t");
- pclasses(classes, num_classes, "h");
- if ( strcmp(hdr,"stdpccts.h")!=0 ) {
- printf(" \\\n\t\t");
- printf("$(HDR_FILE) stdpccts.h");
- }
- }
- if ( user_lexer ) {
- if ( !user_token_types ) printf(" $(TOKENS)");
- }
- else {
- printf(" $(DLG_FILE)");
- if ( !user_token_types ) printf(" $(TOKENS)");
- }
- if ( !gen_CPP ) printf(" $(ERR).c");
- printf("\n");
-
- if ( !user_lexer ) {
- if ( gen_CPP ) printf("DLG_SPAWN = $(SCAN)%s", CPP_FILE_SUFFIX);
- else printf("DLG_SPAWN = %s$(SCAN).c", DIR());
- if ( gen_CPP ) printf(" $(SCAN).h");
- if ( !gen_CPP ) printf(" $(MOD_FILE)");
- printf("\n");
- }
-
- if ( gen_CPP ) {
- if ( !nondef_comp )
- printf("ifdef CXX\nCCC = $(CXX)\nendif\n\nifndef CCC\n");
- printf("CCC = %s\n",compilerCCC);
- if ( !nondef_comp ) printf("endif\n\n");
- }
- else
- {
- if ( !nondef_comp ) printf("ifndef CC\n");
- printf("CC = %s\n",compilerCC);
- if ( !nondef_comp ) printf("endif\n\n");
- }
-
- /* set up dependencies */
- printf("\n%s : $(SRC) $(OBJ)\n", project);
- printf("\t%s %s %s $(CFLAGS) $(OBJ)\n",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_EXE_FLAG,
- project);
- printf("\n");
-
- /* implicit rules */
-
-/* if(gen_CPP)
- printf("%%.o : %%.cpp\n\t$(CCC) -c $(CFLAGS) $<\n\n");
-
- printf("%%.o : %%.c\n\t%s -c $(CFLAGS) $<\n\n",
- gen_CPP?"$(CCC)":"$(CC)");
-*/
- /* how to compile parser files */
-
- for (i=0; i<num_files; i++)
- {
- pfiles(&files[i], 1, "o");
- if ( user_lexer ) {
- printf(" : $(TOKENS)");
- }
- else {
- if ( gen_CPP ) printf(" : $(TOKENS) $(SCAN).h");
- else printf(" : $(MOD_FILE) $(TOKENS)");
- }
- printf(" ");
- if ( gen_CPP ) pfiles(&files[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(&files[i], 1, "c");
- if ( gen_CPP && strcmp(hdr,"stdpccts.h")!=0 ) printf(" $(HDR_FILE)");
- printf("\n");
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",RENAME_OBJ_FLAG);
- pfiles(&files[i], 1, "o");
- printf(" ");
- if ( gen_CPP ) pfiles(&files[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(&files[i], 1, "c");
- printf("\n\n");
- }
-
- for (i=0; i<num_cfiles; i++)
- {
- pfiles(&cfiles[i], 1, "o");
- printf(" : ");
- pfiles(&cfiles[i], 1, NULL);
- if ( gen_CPP && strcmp(hdr,"stdpccts.h")!=0 ) printf(" $(HDR_FILE)");
-/*** printf(" "); ***/
-/*** pfiles(&cfiles[i], 1, "h"); ***/
- printf("\n");
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",RENAME_OBJ_FLAG);
- pfiles(&cfiles[i], 1, "o");
- printf(" ");
- pfiles(&cfiles[i], 1, NULL);
- printf("\n\n");
-
-/*
- * pfiles(&cfiles[i], 1, "h");
- * printf(" :\ntouch ");
- * pfiles(&cfiles[i], 1, "h");
- * printf("\n\n");
- */
- }
-
- /* how to compile err.c */
- if ( !gen_CPP ) {
- printf("$(ERR)%s : $(ERR).c", OBJ_FILE_SUFFIX);
- if ( !user_lexer ) printf(" $(TOKENS)");
- printf("\n");
- printf("\t%s -c $(CFLAGS) %s $(ERR)%s $(ERR).c",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG,
- OBJ_FILE_SUFFIX);
- printf("\n\n");
- }
-
- /* how to compile Class.c */
- for (i=0; i<num_classes; i++)
- {
- pclasses(&classes[i], 1, "o");
- if ( user_lexer ) {
- printf(" : $(TOKENS)");
- }
- else {
- printf(" : $(TOKENS) $(SCAN).h");
- }
- printf(" ");
- pclasses(&classes[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- printf(" ");
- pclasses(&classes[i], 1, "h");
- if ( gen_CPP && strcmp(hdr,"stdpccts.h")!=0 ) printf(" $(HDR_FILE)");
- printf("\n");
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- pclasses(&classes[i], 1, "o");
- printf(" ");
- pclasses(&classes[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- printf("\n\n");
- }
-
- /* how to compile scan.c */
- if ( !user_lexer ) {
- if ( gen_CPP ) printf("$(SCAN)%s : $(SCAN)%s", OBJ_FILE_SUFFIX, CPP_FILE_SUFFIX);
- else printf("%s$(SCAN)%s : %s$(SCAN).c", DIR(), OBJ_FILE_SUFFIX, DIR());
- if ( !user_lexer ) printf(" $(TOKENS)");
- printf("\n");
- if ( gen_CPP ) printf("\t$(CCC) -c $(CFLAGS) %s $(SCAN)%s $(SCAN)%s",
- RENAME_OBJ_FLAG,
- OBJ_FILE_SUFFIX,
- CPP_FILE_SUFFIX);
- else printf("\t$(CC) -c $(CFLAGS) %s %s$(SCAN)%s %s$(SCAN).c",
- RENAME_OBJ_FLAG,
- DIR(),
- OBJ_FILE_SUFFIX,
- DIR());
- printf("\n\n");
- }
-/* how to compile sorcerer classes */
- for (i=0;i<num_sors;i++)
- {
- pclasses(&sclasses[i], 1, "o");
- printf(" : ");
- pclasses(&sclasses[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- printf(" ");
- pclasses(&sclasses[i], 1, "h");
- if ( gen_CPP && strcmp(hdr,"stdpccts.h")!=0 ) printf(" $(HDR_FILE)");
- printf("\n");
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- pclasses(&sclasses[i], 1, "o");
- printf(" ");
- pclasses(&sclasses[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- printf("\n\n");
-/* how to compile i-th sorcerer's files*/
- for (j=0; j<num_sfiles[i]; j++)
- {
- pfiles(&sfiles[i][j], 1, "o");
- printf(" : ");
- if ( gen_CPP ) pfiles(&sfiles[i][j], 1, CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(&sfiles[i][j], 1, "c");
- if ( gen_CPP && strcmp(hdr,"stdpccts.h")!=0 ) printf(" $(HDR_FILE)");
- printf("\n");
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",RENAME_OBJ_FLAG);
- pfiles(&sfiles[i][j], 1, "o");
- printf(" ");
- if ( gen_CPP ) pfiles(&sfiles[i][j], 1, CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(&sfiles[i][j], 1, "c");
- printf("\n\n");
- }
- if ( gen_CPP ) pfiles(&sfiles[i][0], num_sfiles[i], CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(&sfiles[i][0], num_sfiles[i], "c");
- if ( gen_CPP )
- {
- printf(" ");
- pclasses(&sclasses[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- printf(" ");
- pclasses(&sclasses[i], 1, "h");
- if ( strcmp(hdr,"stdpccts.h")!=0 )
- {
- printf(" ");
- printf("$(HDR_FILE) stdpccts.h");
- }
- }
- printf(" : ");
- pfiles(&sfiles[i][0],num_sfiles[i],NULL);
- printf("\n\t$(SOR) $(SFLAGS) ");
- pfiles(&sfiles[i][0],num_sfiles[i],NULL);
- printf("\n\n");
- }
- if(num_sors>0)
- {
- printf("STreeParser%s : $(SOR_LIB)%sSTreeParser.cpp\n",
- OBJ_FILE_SUFFIX,DirectorySymbol);
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",RENAME_OBJ_FLAG);
- printf("STreeParser%s ",OBJ_FILE_SUFFIX);
- printf("$(SOR_LIB)%sSTreeParser.cpp\n\n",DirectorySymbol);
- }
-
- printf("$(ANTLR_SPAWN) : $(GRM)\n");
- printf("\t$(ANTLR) $(AFLAGS) $(GRM)\n");
-
- if ( !user_lexer )
- {
- printf("\n");
- printf("$(DLG_SPAWN) : $(DLG_FILE)\n");
- if ( gen_CPP ) printf("\t$(DLG) $(DFLAGS) $(DLG_FILE)\n");
- else printf("\t$(DLG) $(DFLAGS) $(DLG_FILE) $(SCAN).c\n");
- }
-
- /* do the makes for ANTLR/DLG support */
- if ( gen_CPP ) {
- printf("\n");
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), APARSER_O, DirectorySymbol, APARSER_C);
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), APARSER_O, DirectorySymbol, APARSER_C);
- printf("\n");
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), ATOKENBUFFER_O, DirectorySymbol, ATOKENBUFFER_C);
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), ATOKENBUFFER_O, DirectorySymbol, ATOKENBUFFER_C);
- if ( !user_lexer ) {
- printf("\n");
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), DLEXERBASE_O, DirectorySymbol, DLEXERBASE_C);
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), DLEXERBASE_O, DirectorySymbol, DLEXERBASE_C);
- }
- if ( gen_trees ) {
- printf("\n");
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), ASTBASE_O, DirectorySymbol, ASTBASE_C);
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), ASTBASE_O, DirectorySymbol, ASTBASE_C);
- printf("\n");
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), PCCTSAST_O, DirectorySymbol, PCCTSAST_C);
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), PCCTSAST_O, DirectorySymbol, PCCTSAST_C);
- printf("\n");
-/*
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), LIST_O, DirectorySymbol, LIST_C);
- printf("\t%s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), LIST_O, DirectorySymbol, LIST_C);
-*/
- }
- }
-
- /* clean and scrub targets */
-
- printf("\nclean:\n");
- printf("\trm -f *%s core %s", OBJ_FILE_SUFFIX, project);
- if ( strcmp(outdir, ".")!=0 ) printf(" %s*%s", DIR(), OBJ_FILE_SUFFIX);
- printf("\n");
-
- printf("\nscrub: clean\n");
-/* printf("\trm -f *%s core %s", OBJ_FILE_SUFFIX, project); */
-/* if ( strcmp(outdir, ".")!=0 ) printf(" %s*%s", DIR(), OBJ_FILE_SUFFIX); */
- printf("\trm -f $(ANTLR_SPAWN)");
- if ( !user_lexer ) printf(" $(DLG_SPAWN)");
- for (i=0;i<num_sors;i++)
- {
- printf(" ");
- if ( gen_CPP ) pfiles(&sfiles[i][0], num_sfiles[i], CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(&sfiles[i][0], num_sfiles[i], "c");
- if ( gen_CPP )
- {
- printf(" ");
- pclasses(&sclasses[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- printf(" ");
- pclasses(&sclasses[i], 1, "h");
- }
- }
- printf("\n\n");
-}
-
-#ifdef __STDC__
-void pfiles(char **files, int n, char *suffix)
-#else
-void pfiles(files, n, suffix)
-char **files;
-int n;
-char *suffix;
-#endif
-{
- int first=1;
-
- while ( n>0 )
- {
- char *p = &(*files)[strlen(*files)-1];
- if ( !first ) putchar(' ');
- first=0;
- while ( p > *files && *p != '.' ) --p;
- if ( p == *files )
- {
- fprintf(stderr,
- "genmk: filenames must be file.suffix format: %s\n",
- *files);
- exit(-1);
- }
- if ( suffix == NULL ) printf("%s", *files);
- else
- {
- *p = '\0';
- printf("%s", DIR());
- if ( strcmp(suffix, "o")==0 ) printf("%s%s", *files, OBJ_FILE_SUFFIX);
- else printf("%s.%s", *files, suffix);
- *p = '.';
- }
- files++;
- --n;
- }
-}
-
-#ifdef __STDC__
-pclasses(char **classes, int n, char *suffix)
-#else
-pclasses(classes, n, suffix)
-char **classes;
-int n;
-char *suffix;
-#endif
-{
- int first=1;
-
- while ( n>0 )
- {
- if ( !first ) putchar(' ');
- first=0;
- if ( suffix == NULL ) printf("%s", *classes);
- else {
- printf("%s", DIR());
- if ( strcmp(suffix, "o")==0 ) printf("%s%s", *classes, OBJ_FILE_SUFFIX);
- else printf("%s.%s", *classes, suffix);
- }
- classes++;
- --n;
- }
-}
-
-static void
-#ifdef __STDC__
-ProcessArgs( int argc, char **argv, Opt *options )
-#else
-ProcessArgs( argc, argv, options )
-int argc;
-char **argv;
-Opt *options;
-#endif
-{
- Opt *p;
- require(argv!=NULL, "ProcessArgs: command line NULL");
-
- while ( argc-- > 0 )
- {
- p = options;
- while ( p->option != NULL )
- {
- if ( strcmp(p->option, "*") == 0 ||
- strcmp(p->option, *argv) == 0 )
- {
- if ( p->arg )
- {
- (*p->process)( *argv, *(argv+1) );
- argv++;
- argc--;
- }
- else
- (*p->process)( *argv );
- break;
- }
- p++;
- }
- argv++;
- }
-}
-
-#ifdef __STDC__
-void fatal( char *err_)
-#else
-void fatal( err_)
-char *err_;
-#endif
-{
- fprintf(stderr, "genmk: %s\n", err_);
- exit(1);
-}
-
-#ifdef __STDC__
-void warn( char *err_)
-#else
-void warn( err_)
-char *err_;
-#endif
-{
- fprintf(stderr, "genmk: %s\n", err_);
-}
-
-#ifdef __STDC__
-char *DIR(void)
-#else
-char *DIR()
-#endif
-{
- static char buf[200+1];
-
- if ( strcmp(outdir,TopDirectory)==0 ) return "";
- sprintf(buf, "%s%s", outdir, DirectorySymbol);
- return buf;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk_old.c b/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk_old.c
deleted file mode 100644
index 2cf9fad727..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/genmk_old.c
+++ /dev/null
@@ -1,762 +0,0 @@
-/*
- * genmk -- a program to make makefiles for PCCTS
- *
- * ANTLR 1.33MR10
- * Terence John Parr 1989 - 1998
- * Purdue University
- * U of MN
- */
-
-#include <stdio.h>
-#include "pcctscfg.h" /* be sensitive to what ANTLR/DLG call the files */
-
-#ifdef VAXC
-#define DIE return 0;
-#define DONE return 1;
-#else
-#define DIE return 1;
-#define DONE return 0;
-#endif
-
-#ifndef require
-#define require(expr, err) {if ( !(expr) ) fatal(err);}
-#endif
-
-#define MAX_FILES 50
-#define MAX_CLASSES 50
-
-char *RENAME_OBJ_FLAG="-o",
- *RENAME_EXE_FLAG="-o";
-
-char *dlg = "parser.dlg";
-char *err = "err.c";
-char *hdr = "stdpccts.h";
-char *tok = "tokens.h";
-char *mode = "mode.h";
-char *scan = "scan";
-
-char ATOKENBUFFER_O[100];
-char APARSER_O[100];
-char ASTBASE_O[100];
-char PCCTSAST_O[100];
-char LIST_O[100];
-char DLEXERBASE_O[100];
-
-/* Option flags */
-static char *project="t", *files[MAX_FILES], *classes[MAX_CLASSES];
-static int num_files = 0;
-static int num_classes = 0;
-static int user_lexer = 0;
-static char *user_token_types = NULL;
-static int gen_CPP = 0;
-static char *outdir=".";
-static char *dlg_class = "DLGLexer";
-static int gen_trees = 0;
-static int gen_hoist = 0;
-static char cfiles[1600]="";
-static char *compilerCCC="CC";
-static char *compilerCC="cc";
-static char *pccts_path="/usr/local/pccts";
-
-void help();
-void mk();
-void pfiles();
-void pclasses();
-void fatal();
-void warn();
-
-typedef struct _Opt {
- char *option;
- int arg;
-#ifdef __cplusplus
- void (*process)(...);
-#else
- void (*process)();
-#endif
- char *descr;
- } Opt;
-
-#ifdef __STDC__
-static void ProcessArgs(int, char **, Opt *);
-#else
-static void ProcessArgs();
-#endif
-
-static void
-pProj( s, t )
-char *s;
-char *t;
-{
- project = t;
-}
-
-static void
-pUL( s )
-char *s;
-{
- user_lexer = 1;
-}
-
-static void
-pCPP( s )
-char *s;
-{
- gen_CPP = 1;
-}
-
-static void
-pUT( s, t )
-char *s;
-char *t;
-{
- user_token_types = t;
-}
-
-static void
-pTrees( s )
-char *s;
-{
- gen_trees = 1;
-}
-
-static void
-pHoist( s )
-char *s;
-{
- gen_hoist = 1;
-}
-
-static void
-#ifdef __STDC__
-pFile( char *s )
-#else
-pFile( s )
-char *s;
-#endif
-{
- if ( *s=='-' )
- {
- fprintf(stderr, "invalid option: '%s'; ignored...",s);
- return;
- }
-
- require(num_files<MAX_FILES, "exceeded max # of input files");
- files[num_files++] = s;
-}
-
-static void
-#ifdef __STDC__
-pClass( char *s, char *t )
-#else
-pClass( s, t )
-char *s;
-char *t;
-#endif
-{
- require(num_classes<MAX_CLASSES, "exceeded max # of grammar classes");
- classes[num_classes++] = t;
-}
-
-static void
-#ifdef __STDC__
-pDLGClass( char *s, char *t )
-#else
-pDLGClass( s, t )
-char *s;
-char *t;
-#endif
-{
- if ( !gen_CPP ) {
- fprintf(stderr, "-dlg-class makes no sense without C++ mode; ignored...");
- }
- else dlg_class = t;
-}
-
-static void
-#ifdef __STDC__
-pOdir( char *s, char *t )
-#else
-pOdir( s, t )
-char *s;
-char *t;
-#endif
-{
- outdir = t;
-}
-
-static void
-#ifdef __STDC__
-pHdr( char *s, char *t )
-#else
-pHdr( s, t )
-char *s;
-char *t;
-#endif
-{
- hdr = t;
-}
-
-static void
-#ifdef __STDC__
-pCFiles( char *s, char *t )
-#else
-pCFiles( s, t )
-char *s;
-char *t;
-#endif
-{
- strcat(strcat(cfiles," "), t);
-}
-
-static void
-#ifdef __STDC__
-pCompiler( char *s, char *t )
-#else
-pCompiler( s, t )
-char *s;
-char *t;
-#endif
-{
- compilerCCC = t;
- compilerCC = t;
-}
-
-static void
-#ifdef __STDC__
-ppccts_path( char *s, char *t )
-#else
-ppccts_path( s, t )
-char *s;
-char *t;
-#endif
-{
- pccts_path = t;
-}
-
-Opt options[] = {
- { "-CC", 0, pCPP, "Generate C++ output"},
- { "-class", 1, pClass, "Name of a grammar class defined in grammar (if C++)"},
- { "-dlg-class", 1,pDLGClass,"Name of DLG lexer class (default=DLGLexer) (if C++)"},
- { "-header", 1,pHdr, "Name of ANTLR standard header info (default=no file)"},
- { "-o", 1, pOdir, "Directory where output files should go (default=\".\")"},
- { "-project", 1, pProj, "Name of executable to create (default=t)"},
- { "-token-types", 1, pUT, "Token types are in this file (don't use tokens.h)"},
- { "-trees", 0, pTrees, "Generate ASTs"},
- { "-user-lexer", 0, pUL, "Do not create a DLG-based scanner"},
- { "-mrhoist",0,pHoist, "Maintenance release style hoisting"},
- { "-cfiles",1,pCFiles, "Additional files in C or C++ to compile"},
- { "-pccts_path",1,ppccts_path,
- "Path for $PCCTS directory (default is /usr/local/pccts)"},
- { "-compiler",1,pCompiler,
- "Default compiler (default is CC/cc)"},
- { "*", 0,pFile, "" }, /* anything else is a file */
- { NULL, 0, NULL, NULL }
-};
-
-extern char *DIR();
-
-int main(argc, argv)
-int argc;
-char **argv;
-{
- if ( argc == 1 ) { help(); DIE; }
- ProcessArgs(argc-1, &(argv[1]), options);
-
- strcpy(ATOKENBUFFER_O, ATOKENBUFFER_C);
- ATOKENBUFFER_O[strlen(ATOKENBUFFER_C)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(ATOKENBUFFER_O, OBJ_FILE_SUFFIX);
- strcpy(APARSER_O, APARSER_C);
- APARSER_O[strlen(APARSER_O)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(APARSER_O, OBJ_FILE_SUFFIX);
-
- strcpy(ASTBASE_O, ASTBASE_C);
- ASTBASE_O[strlen(ASTBASE_C)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(ASTBASE_O, OBJ_FILE_SUFFIX);
-
- strcpy(PCCTSAST_O, PCCTSAST_C);
- PCCTSAST_O[strlen(PCCTSAST_C)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(PCCTSAST_O, OBJ_FILE_SUFFIX);
-
- strcpy(LIST_O, LIST_C);
- LIST_O[strlen(LIST_C)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(LIST_O, OBJ_FILE_SUFFIX);
-
- strcpy(DLEXERBASE_O, DLEXERBASE_C);
- DLEXERBASE_O[strlen(DLEXERBASE_C)-strlen(CPP_FILE_SUFFIX)] = '\0';
- strcat(DLEXERBASE_O, OBJ_FILE_SUFFIX);
-
- if ( num_files == 0 ) fatal("no grammar files specified; exiting...");
- if ( !gen_CPP && num_classes>0 ) {
- warn("can't define classes w/o C++ mode; turning on C++ mode...\n");
- gen_CPP=1;
- }
- if ( gen_CPP && num_classes==0 ) {
- fatal("must define classes >0 grammar classes in C++ mode\n");
- }
-
- mk(project, files, num_files, argc, argv);
- DONE;
-}
-
-void help()
-{
- Opt *p = options;
- static char buf[1000+1];
-
- fprintf(stderr, "genmk [options] f1.g ... fn.g\n");
- while ( p->option!=NULL && *(p->option) != '*' )
- {
- buf[0]='\0';
- if ( p->arg ) sprintf(buf, "%s ___", p->option);
- else strcpy(buf, p->option);
- fprintf(stderr, "\t%-16s %s\n", buf, p->descr);
- p++;
- }
-}
-
-void mk(project, files, n, argc, argv)
-char *project;
-char **files;
-int n;
-int argc;
-char **argv;
-{
- int i;
-
- printf("#\n");
- printf("# PCCTS makefile for: ");
- pfiles(files, n, NULL);
- printf("\n");
- printf("#\n");
- printf("# Created from:");
- for (i=0; i<argc; i++) printf(" %s", argv[i]);
- printf("\n");
- printf("#\n");
- printf("# PCCTS release 1.33MR21\n");
- printf("# Project: %s\n", project);
- if ( gen_CPP ) printf("# C++ output\n");
- else printf("# C output\n");
- if ( user_lexer ) printf("# User-defined scanner\n");
- else printf("# DLG scanner\n");
- if ( user_token_types!=NULL ) printf("# User-defined token types in '%s'\n", user_token_types);
- else printf("# ANTLR-defined token types\n");
- printf("#\n");
- printf(".SUFFIXES:\n.SUFFIXES: .o .cpp .c .h .g .i .dlg\n");
- if ( user_token_types!=NULL ) {
- printf("# Make sure #tokdefs directive in ANTLR grammar lists this file:\n");
- printf("TOKENS = %s", user_token_types);
- }
- else printf("TOKENS = %stokens.h", DIR());
- printf("\n");
- printf("#\n");
- printf("# The following filenames must be consistent with ANTLR/DLG flags\n");
- printf("DLG_FILE = %s%s\n", DIR(), dlg);
- printf("ERR = %serr\n", DIR());
- if ( strcmp(hdr,"stdpccts.h")!=0 ) printf("HDR_FILE = %s%s\n", DIR(), hdr);
- else printf("HDR_FILE =\n");
- if ( !gen_CPP ) printf("MOD_FILE = %s%s\n", DIR(), mode);
- if ( !gen_CPP ) printf("SCAN = %s\n", scan);
- else printf("SCAN = %s%s\n", DIR(), dlg_class);
-
- printf("PCCTS = %s\n",pccts_path);
- printf("ANTLR_H = $(PCCTS)%sh\n", DirectorySymbol);
- printf("BIN = $(PCCTS)%sbin\n", DirectorySymbol);
- printf("ANTLR = $(BIN)%santlr\n", DirectorySymbol);
- printf("DLG = $(BIN)%sdlg\n", DirectorySymbol);
- printf("CFLAGS = -I. -I$(ANTLR_H)");
- if ( strcmp(outdir, ".")!=0 ) printf(" -I%s", outdir);
- printf(" $(COTHER)");
- printf("\n");
- printf("AFLAGS =");
- if ( strcmp(outdir,".")!=0 ) printf(" -o %s", outdir);
- if ( user_lexer ) printf(" -gx");
- if ( gen_CPP ) printf(" -CC");
- if ( strcmp(hdr,"stdpccts.h")!=0 ) printf(" -gh %s", hdr);
- if ( gen_trees ) printf(" -gt");
- if ( gen_hoist ) {
- printf(" -mrhoist on") ;
- } else {
- printf(" -mrhoist off");
- };
- printf(" $(AOTHER)");
- printf("\n");
- printf("DFLAGS = -C2 -i");
- if ( gen_CPP ) printf(" -CC");
- if ( strcmp(dlg_class,"DLGLexer")!=0 ) printf(" -cl %s", dlg_class);
- if ( strcmp(outdir,".")!=0 ) printf(" -o %s", outdir);
- printf(" $(DOTHER)");
- printf("\n");
- printf("GRM = ");
- pfiles(files, n, NULL);
- printf("\n");
- printf("MYFILES = %s\n",cfiles);
- printf("SRC = ");
- if ( gen_CPP ) pfiles(files, n, CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(files, n, "c");
- if ( gen_CPP ) {
- printf(" \\\n ");
- printf(" ");
- pclasses(classes, num_classes, CPP_FILE_SUFFIX_NO_DOT);
- printf(" \\\n ");
- printf("$(ANTLR_H)%s%s", DirectorySymbol, APARSER_C);
- if ( !user_lexer ) printf(" $(ANTLR_H)%s%s", DirectorySymbol, DLEXERBASE_C);
- if ( gen_trees ) {
- printf(" \\\n ");
- printf("$(ANTLR_H)%s%s", DirectorySymbol, ASTBASE_C);
- printf(" $(ANTLR_H)%s%s", DirectorySymbol, PCCTSAST_C);
-/* printf(" $(ANTLR_H)%s%s", DirectorySymbol, LIST_C); */
- printf(" \\\n ");
- }
- printf(" $(ANTLR_H)%s%s", DirectorySymbol, ATOKENBUFFER_C);
- }
- if ( !user_lexer ) {
- if ( gen_CPP ) printf(" $(SCAN)%s", CPP_FILE_SUFFIX);
- else printf(" %s$(SCAN).c", DIR());
- }
- if ( !gen_CPP ) printf(" $(ERR).c");
- printf("\\\n $(MYFILES)\n");
- printf("OBJ = ");
- pfiles(files, n, "o");
- if ( gen_CPP ) {
- printf(" \\\n ");
- printf(" ");
- pclasses(classes, num_classes, "o");
- printf(" \\\n ");
- printf(" %s%s", DIR(), APARSER_O);
- if ( !user_lexer ) {
- printf(" %s%s", DIR(), DLEXERBASE_O);
- }
- if ( gen_trees ) {
- printf(" \\\n ");
- printf("%s%s", DIR(), ASTBASE_O);
- printf(" %s%s", DIR(), PCCTSAST_O);
-/* printf(" %s%s", DIR(), LIST_O); */
- printf(" \\\n ");
- }
- printf(" %s%s", DIR(), ATOKENBUFFER_O);
- }
- if ( !user_lexer ) {
- if ( gen_CPP ) printf(" $(SCAN)%s", OBJ_FILE_SUFFIX);
- else printf(" %s$(SCAN)%s", DIR(), OBJ_FILE_SUFFIX);
- }
- if ( !gen_CPP ) printf(" $(ERR)%s", OBJ_FILE_SUFFIX);
- printf("\\\n $(MYFILES:.cpp=.o)\n");
-
- printf("ANTLR_SPAWN = ");
- if ( gen_CPP ) pfiles(files, n, CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(files, n, "c");
- if ( gen_CPP ) {
- printf(" ");
- pclasses(classes, num_classes, CPP_FILE_SUFFIX_NO_DOT);
- printf(" \\\n ");
- pclasses(classes, num_classes, "h");
- if ( strcmp(hdr,"stdpccts.h")!=0 ) {
- printf(" \\\n ");
- printf("$(HDR_FILE) stdpccts.h");
- }
- }
- if ( user_lexer ) {
- if ( !user_token_types ) printf(" $(TOKENS)");
- }
- else {
- printf(" $(DLG_FILE)");
- if ( !user_token_types ) printf(" $(TOKENS)");
- }
- if ( !gen_CPP ) printf(" $(ERR).c");
- printf("\n");
-
- if ( !user_lexer ) {
- if ( gen_CPP ) printf("DLG_SPAWN = $(SCAN)%s", CPP_FILE_SUFFIX);
- else printf("DLG_SPAWN = %s$(SCAN).c", DIR());
- if ( gen_CPP ) printf(" $(SCAN).h");
- if ( !gen_CPP ) printf(" $(MOD_FILE)");
- printf("\n");
- }
-
- if ( gen_CPP ) {
- printf("CCC = %s\n",compilerCCC);
- }
- else printf("CC = %s\n",compilerCC);
-
- /* set up dependencies */
- printf("\n%s : $(OBJ) $(SRC)\n", project);
- printf(" %s %s %s $(CFLAGS) $(OBJ)\n",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_EXE_FLAG,
- project);
- printf("\n");
-
- /* implicit rules */
-
- if(gen_CPP)
- printf("%%.o : %%.cpp\n\t$(CCC) -c $(CFLAGS) $<\n\n");
-
- printf("%%.o : %%.c\n\t%s -c $(CFLAGS) $<\n\n",
- gen_CPP?"$(CCC)":"$(CC)");
-
- /* how to compile parser files */
-
- for (i=0; i<num_files; i++)
- {
- pfiles(&files[i], 1, "o");
- if ( user_lexer ) {
- printf(" : $(TOKENS)");
- }
- else {
- if ( gen_CPP ) printf(" : $(TOKENS) $(SCAN).h");
- else printf(" : $(MOD_FILE) $(TOKENS)");
- }
- printf(" ");
- if ( gen_CPP ) pfiles(&files[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(&files[i], 1, "c");
- if ( gen_CPP && strcmp(hdr,"stdpccts.h")!=0 ) printf(" $(HDR_FILE)");
- printf("\n");
- printf(" %s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",RENAME_OBJ_FLAG);
- pfiles(&files[i], 1, "o");
- printf(" ");
- if ( gen_CPP ) pfiles(&files[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- else pfiles(&files[i], 1, "c");
- printf("\n\n");
- }
-
- /* how to compile err.c */
- if ( !gen_CPP ) {
- printf("$(ERR)%s : $(ERR).c", OBJ_FILE_SUFFIX);
- if ( !user_lexer ) printf(" $(TOKENS)");
- printf("\n");
- printf(" %s -c $(CFLAGS) %s $(ERR)%s $(ERR).c",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG,
- OBJ_FILE_SUFFIX);
- printf("\n\n");
- }
-
- /* how to compile Class.c */
- for (i=0; i<num_classes; i++)
- {
- pclasses(&classes[i], 1, "o");
- if ( user_lexer ) {
- printf(" : $(TOKENS)");
- }
- else {
- printf(" : $(TOKENS) $(SCAN).h");
- }
- printf(" ");
- pclasses(&classes[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- printf(" ");
- pclasses(&classes[i], 1, "h");
- if ( gen_CPP && strcmp(hdr,"stdpccts.h")!=0 ) printf(" $(HDR_FILE)");
- printf("\n");
- printf(" %s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- pclasses(&classes[i], 1, "o");
- printf(" ");
- pclasses(&classes[i], 1, CPP_FILE_SUFFIX_NO_DOT);
- printf("\n\n");
- }
-
- /* how to compile scan.c */
- if ( !user_lexer ) {
- if ( gen_CPP ) printf("$(SCAN)%s : $(SCAN)%s", OBJ_FILE_SUFFIX, CPP_FILE_SUFFIX);
- else printf("%s$(SCAN)%s : %s$(SCAN).c", DIR(), OBJ_FILE_SUFFIX, DIR());
- if ( !user_lexer ) printf(" $(TOKENS)");
- printf("\n");
- if ( gen_CPP ) printf(" $(CCC) -c $(CFLAGS) %s $(SCAN)%s $(SCAN)%s",
- RENAME_OBJ_FLAG,
- OBJ_FILE_SUFFIX,
- CPP_FILE_SUFFIX);
- else printf(" $(CC) -c $(CFLAGS) %s %s$(SCAN)%s %s$(SCAN).c",
- RENAME_OBJ_FLAG,
- DIR(),
- OBJ_FILE_SUFFIX,
- DIR());
- printf("\n\n");
- }
-
- printf("$(ANTLR_SPAWN) : $(GRM)\n");
- printf(" $(ANTLR) $(AFLAGS) $(GRM)\n");
-
- if ( !user_lexer )
- {
- printf("\n");
- printf("$(DLG_SPAWN) : $(DLG_FILE)\n");
- if ( gen_CPP ) printf(" $(DLG) $(DFLAGS) $(DLG_FILE)\n");
- else printf(" $(DLG) $(DFLAGS) $(DLG_FILE) $(SCAN).c\n");
- }
-
- /* do the makes for ANTLR/DLG support */
- if ( gen_CPP ) {
- printf("\n");
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), APARSER_O, DirectorySymbol, APARSER_C);
- printf(" %s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), APARSER_O, DirectorySymbol, APARSER_C);
- printf("\n");
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), ATOKENBUFFER_O, DirectorySymbol, ATOKENBUFFER_C);
- printf(" %s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), ATOKENBUFFER_O, DirectorySymbol, ATOKENBUFFER_C);
- if ( !user_lexer ) {
- printf("\n");
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), DLEXERBASE_O, DirectorySymbol, DLEXERBASE_C);
- printf(" %s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), DLEXERBASE_O, DirectorySymbol, DLEXERBASE_C);
- }
- if ( gen_trees ) {
- printf("\n");
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), ASTBASE_O, DirectorySymbol, ASTBASE_C);
- printf(" %s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), ASTBASE_O, DirectorySymbol, ASTBASE_C);
- printf("\n");
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), PCCTSAST_O, DirectorySymbol, PCCTSAST_C);
- printf(" %s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",
- RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), PCCTSAST_O, DirectorySymbol, PCCTSAST_C);
- printf("\n");
-/*
- printf("%s%s : $(ANTLR_H)%s%s\n", DIR(), LIST_O, DirectorySymbol, LIST_C);
- printf(" %s -c $(CFLAGS) %s ",
- gen_CPP?"$(CCC)":"$(CC)",RENAME_OBJ_FLAG);
- printf("%s%s $(ANTLR_H)%s%s\n", DIR(), LIST_O, DirectorySymbol, LIST_C);
-*/
- }
- }
-
- /* clean and scrub targets */
-
- printf("\nclean:\n");
- printf(" rm -f *%s core %s", OBJ_FILE_SUFFIX, project);
- if ( strcmp(outdir, ".")!=0 ) printf(" %s*%s", DIR(), OBJ_FILE_SUFFIX);
- printf("\n");
-
- printf("\nscrub:\n");
- printf(" rm -f *%s core %s", OBJ_FILE_SUFFIX, project);
- if ( strcmp(outdir, ".")!=0 ) printf(" %s*%s", DIR(), OBJ_FILE_SUFFIX);
- printf(" $(ANTLR_SPAWN)");
- if ( !user_lexer ) printf(" $(DLG_SPAWN)");
- printf("\n");
-}
-
-void pfiles(files, n, suffix)
-char **files;
-int n;
-char *suffix;
-{
- int first=1;
-
- while ( n>0 )
- {
- char *p = &(*files)[strlen(*files)-1];
- if ( !first ) putchar(' ');
- first=0;
- while ( p > *files && *p != '.' ) --p;
- if ( p == *files )
- {
- fprintf(stderr,
- "genmk: filenames must be file.suffix format: %s\n",
- *files);
- exit(-1);
- }
- if ( suffix == NULL ) printf("%s", *files);
- else
- {
- *p = '\0';
- printf("%s", DIR());
- if ( strcmp(suffix, "o")==0 ) printf("%s%s", *files, OBJ_FILE_SUFFIX);
- else printf("%s.%s", *files, suffix);
- *p = '.';
- }
- files++;
- --n;
- }
-}
-
-void pclasses(classes, n, suffix)
-char **classes;
-int n;
-char *suffix;
-{
- int first=1;
-
- while ( n>0 )
- {
- if ( !first ) putchar(' ');
- first=0;
- if ( suffix == NULL ) printf("%s", *classes);
- else {
- printf("%s", DIR());
- if ( strcmp(suffix, "o")==0 ) printf("%s%s", *classes, OBJ_FILE_SUFFIX);
- else printf("%s.%s", *classes, suffix);
- }
- classes++;
- --n;
- }
-}
-
-static void
-#ifdef __STDC__
-ProcessArgs( int argc, char **argv, Opt *options )
-#else
-ProcessArgs( argc, argv, options )
-int argc;
-char **argv;
-Opt *options;
-#endif
-{
- Opt *p;
- require(argv!=NULL, "ProcessArgs: command line NULL");
-
- while ( argc-- > 0 )
- {
- p = options;
- while ( p->option != NULL )
- {
- if ( strcmp(p->option, "*") == 0 ||
- strcmp(p->option, *argv) == 0 )
- {
- if ( p->arg )
- {
- (*p->process)( *argv, *(argv+1) );
- argv++;
- argc--;
- }
- else
- (*p->process)( *argv );
- break;
- }
- p++;
- }
- argv++;
- }
-}
-
-void fatal( err_)
-char *err_;
-{
- fprintf(stderr, "genmk: %s\n", err_);
- exit(1);
-}
-
-void warn( err_)
-char *err_;
-{
- fprintf(stderr, "genmk: %s\n", err_);
-}
-
-char *DIR()
-{
- static char buf[200+1];
-
- if ( strcmp(outdir,TopDirectory)==0 ) return "";
- sprintf(buf, "%s%s", outdir, DirectorySymbol);
- return buf;
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/makefile b/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/makefile
deleted file mode 100644
index a003c2f321..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/genmk/makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-##
-## 7-Apr-97
-## added support/genmk/makefile to pccts 1.33MR1 distribution kit
-## (support/genmk/makefile" omitted from 1.33 distribution kit)
-##
-SRC=genmk.c
-OBJ=genmk.o
-# Define PC if you use a PC OS (changes directory symbol and object file extension)
-# see pccts/h/pcctscfg.h
-CC=cc
-COPT=-O
-#CFLAGS=-I../../h -DPC
-CFLAGS=$(COPT) -I../../h
-BAG=../../bin/bag
-
-genmk: $(OBJ) $(SRC) ../../h/pcctscfg.h
- $(CC) -o genmk $(OBJ)
-
-clean:
- rm -rf core *.o
-
-scrub:
- rm -rf genmk core *.o
-
-shar:
- shar genmk.c makefile > genmk.shar
-
-archive:
- $(BAG) genmk.c makefile > genmk.bag
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/makefile b/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/makefile
deleted file mode 100644
index 44caef1aa5..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-BAG=../../bin/bag
-SRC=test.c rexpr.c
-OBJ=test.o rexpr.o
-CFLAGS = -g
-
-test: $(OBJ) $(SRC)
- cc -g -o texpr $(OBJ)
-
-shar:
- shar makefile test.c rexpr.c rexpr.h > rexpr.shar
-
-archive:
- $(BAG) makefile test.c rexpr.c rexpr.h > rexpr.bag
-
-clean:
- rm -rf *.o core texpr
-
-scrub:
- rm -rf *.o core texpr
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/rexpr.c b/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/rexpr.c
deleted file mode 100644
index 805bf65533..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/rexpr.c
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- * This file contains code for
- *
- * int rexpr(char *expr, char *s);
- *
- * which answers
- *
- * 1 if 's' is in the language described by the regular expression 'expr'
- * 0 if it is not
- * -1 if the regular expression is invalid
- *
- * Language membership is determined by constructing a non-deterministic
- * finite automata (NFA) from the regular expression. A depth-
- * first-search is performed on the NFA (graph) to check for a match of 's'.
- * Each non-epsilon arc consumes one character from 's'. Backtracking is
- * performed to check all possible paths through the NFA.
- *
- * Regular expressions follow the meta-language:
- *
- * <regExpr> ::= <andExpr> ( '|' <andExpr> )*
- *
- * <andExpr> ::= <expr> ( <expr> )*
- *
- * <expr> ::= {'~'} '[' <atomList> ']' <repeatSymbol>
- * | '(' <regExpr> ')' <repeatSymbol>
- * | '{' <regExpr> '}' <repeatSymbol>
- * | <atom> <repeatSymbol>
- *
- * <repeatSymbol> ::= { '*' | '+' }
- *
- * <atomList> ::= <atom> ( <atom> )*
- * | { <atomList> } <atom> '-' <atom> { <atomList> }
- *
- * <atom> ::= Token[Atom]
- *
- * Notes:
- * ~ means complement the set in [..]. i.e. all characters not listed
- * * means match 0 or more times (can be on expression or atom)
- * + means match 1 or more times (can be on expression or atom)
- * {} optional
- * () grouping
- * [] set of atoms
- * x-y all characters from x to y (found only in [..])
- * \xx the character with value xx
- *
- * Examples:
- * [a-z]+
- * match 1 or more lower-case letters (e.g. variable)
- *
- * 0x[0-9A-Fa-f]+
- * match a hex number with 0x on front (e.g. 0xA1FF)
- *
- * [0-9]+.[0-9]+{e[0-9]+}
- * match a floating point number (e.g. 3.14e21)
- *
- * Code example:
- * if ( rexpr("[a-zA-Z][a-zA-Z0-9]+", str) ) then str is keyword
- *
- * Terence Parr
- * Purdue University
- * April 1991
- */
-
-#include <stdio.h>
-#include <ctype.h>
-#ifdef __STDC__
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
-#include "rexpr.h"
-
-#ifdef __USE_PROTOS
-static int regExpr( GraphPtr g );
-static int andExpr( GraphPtr g );
-static int expr( GraphPtr g );
-static int repeatSymbol( GraphPtr g );
-static int atomList( char *p, int complement );
-static void next( void );
-static ArcPtr newGraphArc( void );
-static NodePtr newNode( void );
-static int ArcBetweenGraphNode( NodePtr i, NodePtr j, int label );
-static Graph BuildNFA_atom( int label );
-static Graph BuildNFA_AB( Graph A, Graph B );
-static Graph BuildNFA_AorB( Graph A, Graph B );
-static Graph BuildNFA_set( char *s );
-static Graph BuildNFA_Astar( Graph A );
-static Graph BuildNFA_Aplus( Graph A );
-static Graph BuildNFA_Aoptional( Graph A );
-#else
-static int regExpr();
-static int andExpr();
-static int expr();
-static int repeatSymbol();
-static int atomList();
-static void next();
-static ArcPtr newGraphArc();
-static NodePtr newNode();
-static int ArcBetweenGraphNode();
-static Graph BuildNFA_atom();
-static Graph BuildNFA_AB();
-static Graph BuildNFA_AorB();
-static Graph BuildNFA_set();
-static Graph BuildNFA_Astar();
-static Graph BuildNFA_Aplus();
-static Graph BuildNFA_Aoptional();
-#endif
-
-static char *_c;
-static int token, tokchar;
-static NodePtr accept;
-static NodePtr freelist = NULL;
-
-/*
- * return 1 if s in language described by expr
- * 0 if s is not
- * -1 if expr is an invalid regular expression
- */
-#ifdef __USE_PROTOS
-static int rexpr(char *expr,char *s)
-#else
-static int rexpr(expr, s)
-char *expr, *s;
-#endif
-{
- NodePtr p,q;
- Graph nfa;
- int result;
-
- fprintf(stderr, "rexpr(%s,%s);\n", expr,s);
- freelist = NULL;
- _c = expr;
- next();
- if ( regExpr(&nfa) == -1 ) return -1;
- accept = nfa.right;
- result = match(nfa.left, s);
- /* free all your memory */
- p = q = freelist;
- while ( p!=NULL ) { q = p->track; free(p); p = q; }
- return result;
-}
-
-/*
- * do a depth-first-search on the NFA looking for a path from start to
- * accept state labelled with the characters of 's'.
- */
-
-#ifdef __USE_PROTOS
-static int match(NodePtr automaton,char *s)
-#else
-static int match(automaton, s)
-NodePtr automaton;
-char *s;
-#endif
-{
- ArcPtr p;
-
- if ( automaton == accept && *s == '\0' ) return 1; /* match */
-
- for (p=automaton->arcs; p!=NULL; p=p->next) /* try all arcs */
- {
- if ( p->label == Epsilon )
- {
- if ( match(p->target, s) ) return 1;
- }
- else if ( p->label == *s )
- if ( match(p->target, s+1) ) return 1;
- }
- return 0;
-}
-
-/*
- * <regExpr> ::= <andExpr> ( '|' {<andExpr>} )*
- *
- * Return -1 if syntax error
- * Return 0 if none found
- * Return 1 if a regExrp was found
- */
-
-#ifdef __USE_PROTOS
-static int regExpr(GraphPtr g)
-#else
-static int regExpr(g)
-GraphPtr g;
-#endif
-{
- Graph g1, g2;
-
- if ( andExpr(&g1) == -1 )
- {
- return -1;
- }
-
- while ( token == '|' )
- {
- int a;
- next();
- a = andExpr(&g2);
- if ( a == -1 ) return -1; /* syntax error below */
- else if ( !a ) return 1; /* empty alternative */
- g1 = BuildNFA_AorB(g1, g2);
- }
-
- if ( token!='\0' ) return -1;
-
- *g = g1;
- return 1;
-}
-
-/*
- * <andExpr> ::= <expr> ( <expr> )*
- */
-
-#ifdef __USE_PROTOS
-static int andExpr(GraphPtr g)
-#else
-static int andExpr(g)
-GraphPtr g;
-#endif
-{
- Graph g1, g2;
-
- if ( expr(&g1) == -1 )
- {
- return -1;
- }
-
- while ( token==Atom || token=='{' || token=='(' || token=='~' || token=='[' )
- {
- if (expr(&g2) == -1) return -1;
- g1 = BuildNFA_AB(g1, g2);
- }
-
- *g = g1;
- return 1;
-}
-
-/*
- * <expr> ::= {'~'} '[' <atomList> ']' <repeatSymbol>
- * | '(' <regExpr> ')' <repeatSymbol>
- * | '{' <regExpr> '}' <repeatSymbol>
- * | <atom> <repeatSymbol>
- */
-
-#ifdef __USE_PROTOS
-static int expr(GraphPtr g)
-#else
-static int expr(g)
-GraphPtr g;
-#endif
-{
- int complement = 0;
- char s[257]; /* alloc space for string of char in [] */
-
- if ( token == '~' || token == '[' )
- {
- if ( token == '~' ) {complement = 1; next();}
- if ( token != '[' ) return -1;
- next();
- if ( atomList( s, complement ) == -1 ) return -1;
- *g = BuildNFA_set( s );
- if ( token != ']' ) return -1;
- next();
- repeatSymbol( g );
- return 1;
- }
- if ( token == '(' )
- {
- next();
- if ( regExpr( g ) == -1 ) return -1;
- if ( token != ')' ) return -1;
- next();
- repeatSymbol( g );
- return 1;
- }
- if ( token == '{' )
- {
- next();
- if ( regExpr( g ) == -1 ) return -1;
- if ( token != '}' ) return -1;
- next();
- /* S p e c i a l C a s e O p t i o n a l { } */
- if ( token != '*' && token != '+' )
- {
- *g = BuildNFA_Aoptional( *g );
- }
- repeatSymbol( g );
- return 1;
- }
- if ( token == Atom )
- {
- *g = BuildNFA_atom( tokchar );
- next();
- repeatSymbol( g );
- return 1;
- }
-
- return -1;
-}
-
-/*
- * <repeatSymbol> ::= { '*' | '+' }
- */
-#ifdef __USE_PROTOS
-static int repeatSymbol(GraphPtr g)
-#else
-static int repeatSymbol(g)
-GraphPtr g;
-#endif
-{
- switch ( token )
- {
- case '*' : *g = BuildNFA_Astar( *g ); next(); break;
- case '+' : *g = BuildNFA_Aplus( *g ); next(); break;
- }
- return 1;
-}
-
-/*
- * <atomList> ::= <atom> { <atom> }*
- * { <atomList> } <atom> '-' <atom> { <atomList> }
- *
- * a-b is same as ab
- * q-a is same as q
- */
-
-#ifdef __USE_PROTOS
-static int atomList(char *p, int complement)
-#else
-static int atomList(p, complement)
-char *p;
-int complement;
-#endif
-{
- static unsigned char set[256]; /* no duplicates */
- int first, last, i;
- char *s = p;
-
- if ( token != Atom ) return -1;
-
- for (i=0; i<256; i++) set[i] = 0;
- while ( token == Atom )
- {
- if ( !set[tokchar] ) *s++ = tokchar;
- set[tokchar] = 1; /* Add atom to set */
- next();
- if ( token == '-' ) /* have we found '-' */
- {
- first = *(s-1); /* Get last char */
- next();
- if ( token != Atom ) return -1;
- else
- {
- last = tokchar;
- }
- for (i = first+1; i <= last; i++)
- {
- if ( !set[tokchar] ) *s++ = i;
- set[i] = 1; /* Add atom to set */
- }
- next();
- }
- }
- *s = '\0';
- if ( complement )
- {
- for (i=0; i<256; i++) set[i] = !set[i];
- for (i=1,s=p; i<256; i++) if ( set[i] ) *s++ = i;
- *s = '\0';
- }
- return 1;
-}
-
-/* a somewhat stupid lexical analyzer */
-
-#ifdef __USE_PROTOS
-static void next(void)
-#else
-static void next()
-#endif
-{
- while ( *_c==' ' || *_c=='\t' || *_c=='\n' ) _c++;
- if ( *_c=='\\' )
- {
- _c++;
- if ( isdigit(*_c) )
- {
- int n=0;
- while ( isdigit(*_c) )
- {
- n = n*10 + (*_c++ - '0');
- }
- if ( n>255 ) n=255;
- tokchar = n;
- }
- else
- {
- switch (*_c)
- {
- case 'n' : tokchar = '\n'; break;
- case 't' : tokchar = '\t'; break;
- case 'r' : tokchar = '\r'; break;
- default : tokchar = *_c;
- }
- _c++;
- }
- token = Atom;
- }
- else if ( isgraph(*_c) && *_c!='[' && *_c!='(' && *_c!='{' &&
- *_c!='-' && *_c!='}' && *_c!=')' && *_c!=']' &&
- *_c!='+' && *_c!='*' && *_c!='~' && *_c!='|' )
- {
- token = Atom;
- tokchar = *_c++;
- }
- else
- {
- token = tokchar = *_c++;
- }
-}
-
-/* N F A B u i l d i n g R o u t i n e s */
-
-#ifdef __USE_PROTOS
-static ArcPtr newGraphArc(void)
-#else
-static ArcPtr newGraphArc()
-#endif
-{
- ArcPtr p;
- p = (ArcPtr) calloc(1, sizeof(Arc));
- if ( p==NULL ) {fprintf(stderr,"rexpr: out of memory\n"); exit(-1);}
- if ( freelist != NULL ) p->track = (ArcPtr) freelist;
- freelist = (NodePtr) p;
- return p;
-}
-
-#ifdef __USE_PROTOS
-static NodePtr newNode(void)
-#else
-static NodePtr newNode()
-#endif
-{
- NodePtr p;
- p = (NodePtr) calloc(1, sizeof(Node));
- if ( p==NULL ) {fprintf(stderr,"rexpr: out of memory\n"); exit(-1);}
- if ( freelist != NULL ) p->track = freelist;
- freelist = p;
- return p;
-}
-
-#ifdef __USE_PROTOS
-static void ArcBetweenGraphNodes(NodePtr i,NodePtr j,int label)
-#else
-static void ArcBetweenGraphNodes(i, j, label)
-NodePtr i, j;
-int label;
-#endif
-{
- ArcPtr a;
-
- a = newGraphArc();
- if ( i->arcs == NULL ) i->arctail = i->arcs = a;
- else {(i->arctail)->next = a; i->arctail = a;}
- a->label = label;
- a->target = j;
-}
-
-#ifdef __USE_PROTOS
-static Graph BuildNFA_atom(int label)
-#else
-static Graph BuildNFA_atom(label)
-int label;
-#endif
-{
- Graph g;
-
- g.left = newNode();
- g.right = newNode();
- ArcBetweenGraphNodes(g.left, g.right, label);
- return( g );
-}
-
-#ifdef __USE_PROTOS
-static Graph BuildNFA_AB(Graph A,Graph B)
-#else
-static Graph BuildNFA_AB(A, B)
-Graph A, B;
-#endif
-{
- Graph g;
-
- ArcBetweenGraphNodes(A.right, B.left, Epsilon);
- g.left = A.left;
- g.right = B.right;
- return( g );
-}
-
-#ifdef __USE_PROTOS
-static Graph BuildNFA_AorB(Graph A,Graph B)
-#else
-static Graph BuildNFA_AorB(A, B)
-Graph A, B;
-#endif
-{
- Graph g;
-
- g.left = newNode();
- ArcBetweenGraphNodes(g.left, A.left, Epsilon);
- ArcBetweenGraphNodes(g.left, B.left, Epsilon);
- g.right = newNode();
- ArcBetweenGraphNodes(A.right, g.right, Epsilon);
- ArcBetweenGraphNodes(B.right, g.right, Epsilon);
- return( g );
-}
-
-#ifdef __USE_PROTOS
-static Graph BuildNFA_set(char *s)
-#else
-static Graph BuildNFA_set( s )
-char *s;
-#endif
-{
- Graph g;
-
- if ( s == NULL ) return g;
-
- g.left = newNode();
- g.right = newNode();
- while ( *s != '\0' )
- {
- ArcBetweenGraphNodes(g.left, g.right, *s++);
- }
- return g;
-}
-
-#ifdef __USE_PROTOS
-static Graph BuildNFA_Astar(Graph A)
-#else
-static Graph BuildNFA_Astar( A )
-Graph A;
-#endif
-{
- Graph g;
-
- g.left = newNode();
- g.right = newNode();
-
- ArcBetweenGraphNodes(g.left, A.left, Epsilon);
- ArcBetweenGraphNodes(g.left, g.right, Epsilon);
- ArcBetweenGraphNodes(A.right, g.right, Epsilon);
- ArcBetweenGraphNodes(A.right, A.left, Epsilon);
-
- return( g );
-}
-
-#ifdef __USE_PROTOS
-static Graph BuildNFA_Aplus(Graph A)
-#else
-static Graph BuildNFA_Aplus( A )
-Graph A;
-#endif
-{
- ArcBetweenGraphNodes(A.right, A.left, Epsilon);
-
- return( A );
-}
-
-#ifdef __USE_PROTOS
-static Graph BuildNFA_Aoptional(Graph A)
-#else
-static Graph BuildNFA_Aoptional( A )
-Graph A;
-#endif
-{
- Graph g;
-
- g.left = newNode();
- g.right = newNode();
-
- ArcBetweenGraphNodes(g.left, A.left, Epsilon);
- ArcBetweenGraphNodes(g.left, g.right, Epsilon);
- ArcBetweenGraphNodes(A.right, g.right, Epsilon);
-
- return( g );
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/rexpr.h b/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/rexpr.h
deleted file mode 100644
index e67a9652fb..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/rexpr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#define Atom 256 /* token Atom (an impossible char value) */
-#define Epsilon 257 /* epsilon arc (an impossible char value) */
-
-/* track field must be same for all node types */
-typedef struct _a {
- struct _a *track; /* track mem allocation */
- int label;
- struct _a *next;
- struct _n *target;
- } Arc, *ArcPtr;
-
-typedef struct _n {
- struct _n *track;
- ArcPtr arcs, arctail;
- } Node, *NodePtr;
-
-typedef struct {
- NodePtr left,
- right;
- } Graph, *GraphPtr;
-
-#ifdef __USE_PROTOS
-int rexpr( char *expr, char *s );
-int match( NodePtr automaton, char *s );
-#else
-int rexpr();
-int match();
-#endif
-
-
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/test.c b/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/test.c
deleted file mode 100644
index 2619539e4b..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/rexpr/test.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdio.h>
-#include "rexpr.h"
-
-/*
- * test for rexpr().
- * To make this test:
- * cc -o rexpr test.c rexpr.c
- * Then from command line type:
- * rexpr r string
- * where r is the regular expression that decribes a language
- * and string is the string to verify.
- */
-main(argc,argv)
-int argc;
-char *argv[];
-{
- if ( argc!=3 ) fprintf(stderr,"rexpr: expr s\n");
- else printf("%d\n", rexpr(argv[1], argv[2]));
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.c b/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.c
deleted file mode 100644
index eb6fba7393..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.c
+++ /dev/null
@@ -1,816 +0,0 @@
-/* set.c
-
- The following is a general-purpose set library originally developed
- by Hank Dietz and enhanced by Terence Parr to allow dynamic sets.
-
- Sets are now structs containing the #words in the set and
- a pointer to the actual set words.
-
- Generally, sets need not be explicitly allocated. They are
- created/extended/shrunk when appropriate (e.g. in set_of()).
- HOWEVER, sets need to be destroyed (free()ed) when they go out of scope
- or are otherwise no longer needed. A routine is provided to
- free a set.
-
- Sets can be explicitly created with set_new(s, max_elem).
-
- Sets can be declared to have minimum size to reduce realloc traffic.
- Default minimum size = 1.
-
- Sets can be explicitly initialized to have no elements (set.n == 0)
- by using the 'empty' initializer:
-
- Examples:
- set a = empty; -- set_deg(a) == 0
-
- return( empty );
-
- Example set creation and destruction:
-
- set
- set_of2(e,g)
- unsigned e,g;
- {
- set a,b,c;
-
- b = set_of(e); -- Creates space for b and sticks in e
- set_new(c, g); -- set_new(); set_orel() ==> set_of()
- set_orel(g, &c);
- a = set_or(b, c);
- .
- .
- .
- set_free(b);
- set_free(c);
- return( a );
- }
-
- 1987 by Hank Dietz
-
- Modified by:
- Terence Parr
- Purdue University
- October 1989
-
- Made it smell less bad to C++ 7/31/93 -- TJP
-*/
-
-#include <stdio.h>
-#include "pcctscfg.h"
-#ifdef __STDC__
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
-#include <string.h>
-
-#include "set.h"
-
-#define MIN(i,j) ( (i) > (j) ? (j) : (i))
-#define MAX(i,j) ( (i) < (j) ? (j) : (i))
-
-/* elems can be a maximum of 32 bits */
-static unsigned bitmask[] = {
- 0x00000001, 0x00000002, 0x00000004, 0x00000008,
- 0x00000010, 0x00000020, 0x00000040, 0x00000080,
- 0x00000100, 0x00000200, 0x00000400, 0x00000800,
- 0x00001000, 0x00002000, 0x00004000, 0x00008000,
-#if !defined(PC) || defined(PC32)
- 0x00010000, 0x00020000, 0x00040000, 0x00080000,
- 0x00100000, 0x00200000, 0x00400000, 0x00800000,
- 0x01000000, 0x02000000, 0x04000000, 0x08000000,
- 0x10000000, 0x20000000, 0x40000000, 0x80000000
-#endif
-};
-
-set empty = set_init;
-static unsigned min=1;
-
-#define StrSize 200
-
-#ifdef MEMCHK
-#define CHK(a) \
- if ( a.setword != NULL ) \
- if ( !valid(a.setword) ) \
- {fprintf(stderr, "%s(%d): invalid set\n",__FILE__,__LINE__); exit(-1);}
-#else
-#define CHK(a)
-#endif
-
-/*
- * Set the minimum size (in words) of a set to reduce realloc calls
- */
-void
-#ifdef __USE_PROTOS
-set_size( unsigned n )
-#else
-set_size( n )
-unsigned n;
-#endif
-{
- min = n;
-}
-
-unsigned int
-#ifdef __USE_PROTOS
-set_deg( set a )
-#else
-set_deg( a )
-set a;
-#endif
-{
- /* Fast compute degree of a set... the number
- of elements present in the set. Assumes
- that all word bits are used in the set
- and that SETSIZE(a) is a multiple of WORDSIZE.
- */
- register unsigned *p = &(a.setword[0]);
- register unsigned *endp = NULL; /* MR27 Avoid false memory check report */
- register unsigned degree = 0;
-
- CHK(a);
- if ( a.n == 0 ) return(0);
- endp = &(a.setword[a.n]);
- while ( p < endp )
- {
- register unsigned t = *p;
- register unsigned *b = &(bitmask[0]);
- do {
- if (t & *b) ++degree;
- } while (++b < &(bitmask[WORDSIZE]));
- p++;
- }
-
- return(degree);
-}
-
-set
-#ifdef __USE_PROTOS
-set_or( set b, set c )
-#else
-set_or( b, c )
-set b;
-set c;
-#endif
-{
- /* Fast set union operation */
- /* resultant set size is max(b, c); */
- set *big;
- set t;
- unsigned int m,n;
- register unsigned *r, *p, *q, *endp;
-
- CHK(b); CHK(c);
- t = empty;
- if (b.n > c.n) {big= &b; m=b.n; n=c.n;} else {big= &c; m=c.n; n=b.n;}
- set_ext(&t, m);
- r = t.setword;
-
- /* Or b,c until max of smaller set */
- q = c.setword;
- p = b.setword;
- endp = &(b.setword[n]);
- while ( p < endp ) *r++ = *p++ | *q++;
-
- /* Copy rest of bigger set into result */
- p = &(big->setword[n]);
- endp = &(big->setword[m]);
- while ( p < endp ) *r++ = *p++;
-
- return(t);
-}
-
-set
-#ifdef __USE_PROTOS
-set_and( set b, set c )
-#else
-set_and( b, c )
-set b;
-set c;
-#endif
-{
- /* Fast set intersection operation */
- /* resultant set size is min(b, c); */
- set t;
- unsigned int n;
- register unsigned *r, *p, *q, *endp;
-
- CHK(b); CHK(c);
- t = empty;
- n = (b.n > c.n) ? c.n : b.n;
- if ( n == 0 ) return t; /* TJP 4-27-92 fixed for empty set */
- set_ext(&t, n);
- r = t.setword;
-
- /* & b,c until max of smaller set */
- q = c.setword;
- p = b.setword;
- endp = &(b.setword[n]);
- while ( p < endp ) *r++ = *p++ & *q++;
-
- return(t);
-}
-
-set
-#ifdef __USE_PROTOS
-set_dif( set b, set c )
-#else
-set_dif( b, c )
-set b;
-set c;
-#endif
-{
- /* Fast set difference operation b - c */
- /* resultant set size is size(b) */
- set t;
- unsigned int n;
- register unsigned *r, *p, *q, *endp;
-
- CHK(b); CHK(c);
- t = empty;
- n = (b.n <= c.n) ? b.n : c.n ;
- if ( b.n == 0 ) return t; /* TJP 4-27-92 fixed for empty set */
- /* WEC 12-1-92 fixed for c.n = 0 */
- set_ext(&t, b.n);
- r = t.setword;
-
- /* Dif b,c until smaller set size */
- q = c.setword;
- p = b.setword;
- endp = &(b.setword[n]);
- while ( p < endp ) *r++ = *p++ & (~ *q++);
-
- /* Copy rest of b into result if size(b) > c */
- if ( b.n > n )
- {
- p = &(b.setword[n]);
- endp = &(b.setword[b.n]);
- while ( p < endp ) *r++ = *p++;
- }
-
- return(t);
-}
-
-set
-#ifdef __USE_PROTOS
-set_of( unsigned b )
-#else
-set_of( b )
-unsigned b;
-#endif
-{
- /* Fast singleton set constructor operation */
- static set a;
-
- if ( b == nil ) return( empty );
- set_new(a, b);
- a.setword[DIVWORD(b)] = bitmask[MODWORD(b)];
-
- return(a);
-}
-
-/*
- * Extend (or shrink) the set passed in to have n words.
- *
- * if n is smaller than the minimum, boost n to have the minimum.
- * if the new set size is the same as the old one, do nothing.
- *
- * TJP 4-27-92 Fixed so won't try to alloc 0 bytes
- */
-void
-#ifdef __USE_PROTOS
-set_ext( set *a, unsigned int n )
-#else
-set_ext( a, n )
-set *a;
-unsigned int n;
-#endif
-{
- register unsigned *p;
- register unsigned *endp;
- unsigned int size;
-
- CHK((*a));
- if ( a->n == 0 )
- {
- if ( n == 0 ) return;
- if (a->setword != NULL) {
- free (a->setword); /* MR20 */
- }
- a->setword = (unsigned *) calloc(n, BytesPerWord);
- if ( a->setword == NULL )
- {
- fprintf(stderr, "set_ext(%d words): cannot allocate set\n", n);
- exit(-1);
- }
- a->n = n;
- return;
- }
- if ( n < min ) n = min;
- if ( a->n == n || n == 0 ) return;
- size = a->n;
- a->n = n;
- a->setword = (unsigned *) realloc( (char *)a->setword, (n*BytesPerWord) );
- if ( a->setword == NULL )
- {
- fprintf(stderr, "set_ext(%d words): cannot allocate set\n", n);
- exit(-1);
- }
-
- p = &(a->setword[size]); /* clear from old size to new size */
- endp = &(a->setword[a->n]);
- do {
- *p++ = 0;
- } while ( p < endp );
-}
-
-set
-#ifdef __USE_PROTOS
-set_not( set a )
-#else
-set_not( a )
-set a;
-#endif
-{
- /* Fast not of set a (assumes all bits used) */
- /* size of resultant set is size(a) */
- /* ~empty = empty cause we don't know how bit to make set */
- set t;
- register unsigned *r;
- register unsigned *p = a.setword;
- register unsigned *endp = &(a.setword[a.n]);
-
- CHK(a);
- t = empty;
- if ( a.n == 0 ) return( empty );
- set_ext(&t, a.n);
- r = t.setword;
-
- do {
- *r++ = (~ *p++);
- } while ( p < endp );
-
- return(t);
-}
-
-int
-#ifdef __USE_PROTOS
-set_equ( set a, set b )
-#else
-set_equ( a, b )
-set a;
-set b;
-#endif
-{
-/* 8-Nov-97 Make it work with sets of different sizes */
-/* Easy to understand, too. Probably faster. */
-/* Check for a equal to b */
-
- unsigned int count; /* MR11 */
- unsigned int i; /* MR11 */
-
- CHK(a); CHK(b);
-
- count=MIN(a.n,b.n);
- if (count == 0) return 1;
- for (i=0; i < count; i++) {
- if (a.setword[i] != b.setword[i]) return 0;
- };
- if (a.n < b.n) {
- for (i=count; i < b.n; i++) {
- if (b.setword[i] != 0) return 0;
- }
- return 1;
- } else if (a.n > b.n) {
- for (i=count; i < a.n; i++) {
- if (a.setword[i] != 0) return 0;
- }
- return 1;
- } else {
- return 1;
- };
-}
-
-int
-#ifdef __USE_PROTOS
-set_sub( set a, set b )
-#else
-set_sub( a, b )
-set a;
-set b;
-#endif
-{
-
-/* 8-Nov-97 Make it work with sets of different sizes */
-/* Easy to understand, too. Probably faster. */
-/* Check for a is a PROPER subset of b */
-
- unsigned int count;
- unsigned int i;
-
- CHK(a); CHK(b);
-
- if (a.n == 0) return 1;
- count=MIN(a.n,b.n);
- for (i=0; i < count; i++) {
- if (a.setword[i] & ~b.setword[i]) return 0;
- };
- if (a.n <= b.n) {
- return 1;
- } else {
- for (i=count; i<a.n ; i++) {
- if (a.setword[i]) return 0;
- };
- };
- return 1;
-}
-
-unsigned
-#ifdef __USE_PROTOS
-set_int( set b )
-#else
-set_int( b )
-set b;
-#endif
-{
- /* Fast pick any element of the set b */
- register unsigned *p = b.setword;
- register unsigned *endp = &(b.setword[b.n]);
-
- CHK(b);
- if ( b.n == 0 ) return( nil );
-
- do {
- if (*p) {
- /* Found a non-empty word of the set */
- register unsigned i = ((p - b.setword) << LogWordSize);
- register unsigned t = *p;
- p = &(bitmask[0]);
- while (!(*p & t)) {
- ++i; ++p;
- }
- return(i);
- }
- } while (++p < endp);
-
- /* Empty -- only element it contains is nil */
- return(nil);
-}
-
-int
-#ifdef __USE_PROTOS
-set_el( unsigned b, set a )
-#else
-set_el( b, a )
-unsigned b;
-set a;
-#endif
-{
- CHK(a);
- /* nil is an element of every set */
- if (b == nil) return(1);
- if ( a.n == 0 || NumWords(b) > a.n ) return(0);
-
- /* Otherwise, we have to check */
- return( a.setword[DIVWORD(b)] & bitmask[MODWORD(b)] );
-}
-
-int
-#ifdef __USE_PROTOS
-set_nil( set a )
-#else
-set_nil( a )
-set a;
-#endif
-{
- /* Fast check for nil set */
- register unsigned *p = a.setword;
- register unsigned *endp;
-
- CHK(a);
- if ( a.n == 0 ) return(1);
- endp = &(a.setword[a.n]);
-
- /* The set is not empty if any word used to store
- the set is non-zero. This means one must be a
- bit careful about doing things like negation.
- */
- do {
- if (*p) return(0);
- } while (++p < endp);
-
- return(1);
-}
-
-char *
-#ifdef __USE_PROTOS
-set_str( set a )
-#else
-set_str( a )
-set a;
-#endif
-{
- /* Fast convert set a into ASCII char string...
- assumes that all word bits are used in the set
- and that SETSIZE is a multiple of WORDSIZE.
- Trailing 0 bits are removed from the string.
- if no bits are on or set is empty, "" is returned.
- */
- register unsigned *p = a.setword;
- register unsigned *endp = &(a.setword[a.n]);
- static char str_tmp[StrSize+1];
- register char *q = &(str_tmp[0]);
-
- CHK(a);
- if ( a.n==0 ) {*q=0; return( &(str_tmp[0]) );}
- do {
- register unsigned t = *p;
- register unsigned *b = &(bitmask[0]);
- do {
- *(q++) = (char) ((t & *b) ? '1' : '0');
- } while (++b < &(bitmask[WORDSIZE]));
- } while (++p < endp);
-
- /* Trim trailing 0s & NULL terminate the string */
- while ((q > &(str_tmp[0])) && (*(q-1) != '1')) --q;
- *q = 0;
-
- return(&(str_tmp[0]));
-}
-
-set
-#ifdef __USE_PROTOS
-set_val( register char *s )
-#else
-set_val( s )
-register char *s;
-#endif
-{
- /* Fast convert set ASCII char string into a set.
- If the string ends early, the remaining set bits
- are all made zero.
- The resulting set size is just big enough to hold all elements.
- */
- static set a;
- register unsigned *p, *endp;
-
- set_new(a, strlen(s));
- p = a.setword;
- endp = &(a.setword[a.n]);
- do {
- register unsigned *b = &(bitmask[0]);
- /* Start with a word with no bits on */
- *p = 0;
- do {
- if (*s) {
- if (*s == '1') {
- /* Turn-on this bit */
- *p |= *b;
- }
- ++s;
- }
- } while (++b < &(bitmask[WORDSIZE]));
- } while (++p < endp);
-
- return(a);
-}
-
-/*
- * Or element e into set a. a can be empty.
- */
-void
-#ifdef __USE_PROTOS
-set_orel( unsigned e, set *a )
-#else
-set_orel( e, a )
-unsigned e;
-set *a;
-#endif
-{
- CHK((*a));
- if ( e == nil ) return;
- if ( NumWords(e) > a->n ) set_ext(a, NumWords(e));
- a->setword[DIVWORD(e)] |= bitmask[MODWORD(e)];
-}
-
-/*
- * Or set b into set a. a can be empty. does nothing if b empty.
- */
-void
-#ifdef __USE_PROTOS
-set_orin( set *a, set b )
-#else
-set_orin( a, b )
-set *a;
-set b;
-#endif
-{
- /* Fast set union operation */
- /* size(a) is max(a, b); */
- unsigned int m;
- register unsigned *p,
- *q = b.setword,
- *endq; /* MR20 */
-
- CHK((*a)); CHK(b);
- if ( b.n == 0 ) return;
- endq = &(b.setword[b.n]); /* MR20 */
- m = (a->n > b.n) ? a->n : b.n;
- set_ext(a, m);
- p = a->setword;
- do {
- *p++ |= *q++;
- } while ( q < endq );
-}
-
-/*
- * And set b into set a. a can be empty. does nothing if b empty.
- */
-void
-#ifdef __USE_PROTOS
-set_andin( set *a, set b )
-#else
-set_andin( a, b )
-set *a;
-set b;
-#endif
-{
- /* Fast set intersection operation */
- /* size(a) is max(a, b); */
- unsigned int m;
- register unsigned *p,
- *q = b.setword,
- *endq = &(b.setword[b.n]);
-
- CHK((*a)); CHK(b);
- if ( b.n == 0 ) return;
- m = (a->n > b.n) ? a->n : b.n;
- set_ext(a, m);
- p = a->setword;
- do {
- *p++ &= *q++;
- } while ( q < endq );
-}
-
-void
-#ifdef __USE_PROTOS
-set_rm( unsigned e, set a )
-#else
-set_rm( e, a )
-unsigned e;
-set a;
-#endif
-{
- /* Does not effect size of set */
- CHK(a);
- if ( (e == nil) || (NumWords(e) > a.n) ) return;
- a.setword[DIVWORD(e)] ^= (a.setword[DIVWORD(e)]&bitmask[MODWORD(e)]);
-}
-
-void
-#ifdef __USE_PROTOS
-set_clr( set a )
-#else
-set_clr( a )
-set a;
-#endif
-{
- /* Does not effect size of set */
- register unsigned *p = a.setword;
- register unsigned *endp;
-
- CHK(a);
- if ( a.n == 0 ) return;
- endp = &(a.setword[a.n]);
- do {
- *p++ = 0;
- } while ( p < endp );
-}
-
-set
-#ifdef __USE_PROTOS
-set_dup( set a )
-#else
-set_dup( a )
-set a;
-#endif
-{
- set b;
- register unsigned *p,
- *q = a.setword,
- *endq; /* MR20 */
-
- CHK(a);
- b = empty;
- if ( a.n == 0 ) return( empty );
- endq = &(a.setword[a.n]); /* MR20 */
- set_ext(&b, a.n);
- p = b.setword;
- do {
- *p++ = *q++;
- } while ( q < endq );
-
- return(b);
-}
-
-/*
- * Return a nil terminated list of unsigned ints that represents all
- * "on" bits in the bit set.
- *
- * e.g. {011011} --> {1, 2, 4, 5, nil}
- *
- * _set_pdq and set_pdq are useful when an operation is required on each element
- * of a set. Normally, the sequence is:
- *
- * while ( set_deg(a) > 0 ) {
- * e = set_int(a);
- * set_rm(e, a);
- * ...process e...
- * }
- * Now,
- *
- * t = e = set_pdq(a);
- * while ( *e != nil ) {
- * ...process *e...
- * e++;
- * }
- * free( t );
- *
- * We have saved many set calls and have not destroyed set a.
- */
-void
-#ifdef __USE_PROTOS
-_set_pdq( set a, register unsigned *q )
-#else
-_set_pdq( a, q )
-set a;
-register unsigned *q;
-#endif
-{
- register unsigned *p = a.setword,
- *endp = &(a.setword[a.n]);
- register unsigned e=0;
-
- CHK(a);
- /* are there any space (possibility of elements)? */
- if ( a.n == 0 ) return;
- do {
- register unsigned t = *p;
- register unsigned *b = &(bitmask[0]);
- do {
- if ( t & *b ) *q++ = e;
- ++e;
- } while (++b < &(bitmask[WORDSIZE]));
- } while (++p < endp);
- *q = nil;
-}
-
-/*
- * Same as _set_pdq except allocate memory. set_pdq is the natural function
- * to use.
- */
-unsigned *
-#ifdef __USE_PROTOS
-set_pdq( set a )
-#else
-set_pdq( a )
-set a;
-#endif
-{
- unsigned *q;
- int max_deg;
-
- CHK(a);
- max_deg = WORDSIZE*a.n;
- /* assume a.n!=0 & no elements is rare, but still ok */
- if ( a.n == 0 ) return(NULL);
- q = (unsigned *) malloc((max_deg+1)*BytesPerWord);
- if ( q == NULL ) return( NULL );
- _set_pdq(a, q);
- return( q );
-}
-
-/* a function that produces a hash number for the set
- */
-unsigned int
-#ifdef __USE_PROTOS
-set_hash( set a, register unsigned int mod )
-#else
-set_hash( a, mod )
-set a;
-register unsigned int mod;
-#endif
-{
- /* Fast hash of set a (assumes all bits used) */
- register unsigned *p = &(a.setword[0]);
- register unsigned *endp = &(a.setword[a.n]);
- register unsigned i = 0;
-
- CHK(a);
- while (p<endp){
- i += (*p);
- ++p;
- }
-
- return(i % mod);
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.h b/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.h
deleted file mode 100644
index 5d68152df4..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/set/set.h
+++ /dev/null
@@ -1,121 +0,0 @@
-#ifndef __GATE_SET_H
-#define __GATE_SET_H
-
-/* set.h
-
- The following is a general-purpose set library originally developed
- by Hank Dietz and enhanced by Terence Parr to allow dynamic sets.
-
- Sets are now structs containing the #words in the set and
- a pointer to the actual set words.
-
- 1987 by Hank Dietz
-
- Modified by:
- Terence Parr
- Purdue University
- October 1989
-
- Added ANSI prototyping Dec. 1992 -- TJP
-*/
-
-#include "pcctscfg.h"
-
-#ifdef NOT_USED /* SEE config.h */
-/* Define usable bits per unsigned int word */
-#ifdef PC
-#define WORDSIZE 16
-#define LogWordSize 4
-#else
-#define WORDSIZE 32
-#define LogWordSize 5
-#endif
-#define BytesPerWord sizeof(unsigned)
-#endif
-
-#define SETSIZE(a) ((a).n<<LogWordSize) /* Maximum items per set */
-#define MODWORD(x) ((x) & (WORDSIZE-1)) /* x % WORDSIZE */
-#define DIVWORD(x) ((x) >> LogWordSize) /* x / WORDSIZE */
-#define nil (~((unsigned) 0)) /* An impossible set member all bits on (big!) */
-
-typedef struct _set {
- unsigned int n; /* Number of words in set */
- unsigned *setword;
- } set;
-
-#define set_init {0, NULL}
-#define set_null(a) ((a).setword==NULL)
-
-#define NumBytes(x) (((x)>>3)+1) /* Num bytes to hold x */
-#define NumWords(x) ((((unsigned)(x))>>LogWordSize)+1) /* Num words to hold x */
-
-
-/* M a c r o s */
-
-/* make arg1 a set big enough to hold max elem # of arg2 */
-#define set_new(a,_max) \
-if (((a).setword=(unsigned *)calloc(NumWords(_max),BytesPerWord))==NULL) \
- fprintf(stderr, "set_new: Cannot allocate set with max of %d\n", _max); \
- (a).n = NumWords(_max);
-
-#define set_free(a) \
- {if ( (a).setword != NULL ) free((char *)((a).setword)); \
- (a) = empty;}
-
-#ifdef __USE_PROTOS
-extern void set_size( unsigned );
-extern unsigned int set_deg( set );
-extern set set_or( set, set );
-extern set set_and( set, set );
-extern set set_dif( set, set );
-extern set set_of( unsigned );
-extern void set_ext( set *, unsigned int );
-extern set set_not( set );
-extern int set_equ( set, set );
-extern int set_sub( set, set );
-extern unsigned set_int( set );
-extern int set_el( unsigned, set );
-extern int set_nil( set );
-extern char * set_str( set );
-extern set set_val( register char * );
-extern void set_orel( unsigned, set * );
-extern void set_orin( set *, set );
-extern void set_andin( set *, set );
-extern void set_rm( unsigned, set );
-extern void set_clr( set );
-extern set set_dup( set );
-extern void set_PDQ( set, register unsigned * );
-extern unsigned *set_pdq( set );
-extern void _set_pdq( set a, register unsigned *q );
-extern unsigned int set_hash( set, register unsigned int );
-#else
-extern void set_size();
-extern unsigned int set_deg();
-extern set set_or();
-extern set set_and();
-extern set set_dif();
-extern set set_of();
-extern void set_ext();
-extern set set_not();
-extern int set_equ();
-extern int set_sub();
-extern unsigned set_int();
-extern int set_el();
-extern int set_nil();
-extern char * set_str();
-extern set set_val();
-extern void set_orel();
-extern void set_orin();
-extern void set_andin();
-extern void set_rm();
-extern void set_clr();
-extern set set_dup();
-extern void set_PDQ();
-extern unsigned *set_pdq();
-extern void _set_pdq();
-extern unsigned int set_hash();
-#endif
-
-extern set empty;
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/sym/sym.c b/BaseTools/Source/C/VfrCompile/Pccts/support/sym/sym.c
deleted file mode 100644
index eccce059bb..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/sym/sym.c
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * Simple symbol table manager using coalesced chaining to resolve collisions
- *
- * Doubly-linked lists are used for fast removal of entries.
- *
- * 'sym.h' must have a definition for typedef "Sym". Sym must include at
- * minimum the following fields:
- *
- * ...
- * char *symbol;
- * struct ... *next, *prev, **head, *scope;
- * unsigned int hash;
- * ...
- *
- * 'template.h' can be used as a template to create a 'sym.h'.
- *
- * 'head' is &(table[hash(itself)]).
- * The hash table is not resizable at run-time.
- * The scope field is used to link all symbols of a current scope together.
- * Scope() sets the current scope (linked list) to add symbols to.
- * Any number of scopes can be handled. The user passes the address of
- * a pointer to a symbol table
- * entry (INITIALIZED TO NULL first time).
- *
- * Available Functions:
- *
- * zzs_init(s1,s2) -- Create hash table with size s1, string table size s2.
- * zzs_done() -- Free hash and string table created with zzs_init().
- * zzs_add(key,rec)-- Add 'rec' with key 'key' to the symbol table.
- * zzs_newadd(key) -- create entry; add using 'key' to the symbol table.
- * zzs_get(key) -- Return pointer to last record entered under 'key'
- * Else return NULL
- * zzs_del(p) -- Unlink the entry associated with p. This does
- * NOT free 'p' and DOES NOT remove it from a scope
- * list. If it was a part of your intermediate code
- * tree or another structure. It will still be there.
- * It is only removed from further consideration
- * by the symbol table.
- * zzs_keydel(s) -- Unlink the entry associated with key s.
- * Calls zzs_del(p) to unlink.
- * zzs_scope(sc) -- Specifies that everything added to the symbol
- * table with zzs_add() is added to the list (scope)
- * 'sc'. 'sc' is of 'Sym **sc' type and must be
- * initialized to NULL before trying to add anything
- * to it (passing it to zzs_scope()). Scopes can be
- * switched at any time and merely links a set of
- * symbol table entries. If a NULL pointer is
- * passed, the current scope is returned.
- * zzs_rmscope(sc) -- Remove (zzs_del()) all elements of scope 'sc'
- * from the symbol table. The entries are NOT
- * free()'d. A pointer to the first
- * element in the "scope" is returned. The user
- * can then manipulate the list as he/she chooses
- * (such as freeing them all). NOTE that this
- * function sets your scope pointer to NULL,
- * but returns a pointer to the list for you to use.
- * zzs_stat() -- Print out the symbol table and some relevant stats.
- * zzs_new(key) -- Create a new record with calloc() of type Sym.
- * Add 'key' to the string table and make the new
- * records 'symbol' pointer point to it.
- * zzs_strdup(s) -- Add s to the string table and return a pointer
- * to it. Very fast allocation routine
- * and does not require strlen() nor calloc().
- *
- * Example:
- *
- * #include <stdio.h>
- * #include "sym.h"
- *
- * main()
- * {
- * Sym *scope1=NULL, *scope2=NULL, *a, *p;
- *
- * zzs_init(101, 100);
- *
- * a = zzs_new("Apple"); zzs_add(a->symbol, a); -- No scope
- * zzs_scope( &scope1 ); -- enter scope 1
- * a = zzs_new("Plum"); zzs_add(a->symbol, a);
- * zzs_scope( &scope2 ); -- enter scope 2
- * a = zzs_new("Truck"); zzs_add(a->symbol, a);
- *
- * p = zzs_get("Plum");
- * if ( p == NULL ) fprintf(stderr, "Hmmm...Can't find 'Plum'\n");
- *
- * p = zzs_rmscope(&scope1)
- * for (; p!=NULL; p=p->scope) {printf("Scope1: %s\n", p->symbol);}
- * p = zzs_rmscope(&scope2)
- * for (; p!=NULL; p=p->scope) {printf("Scope2: %s\n", p->symbol);}
- * }
- *
- * Terence Parr
- * Purdue University
- * February 1990
- *
- * CHANGES
- *
- * Terence Parr
- * May 1991
- * Renamed functions to be consistent with ANTLR
- * Made HASH macro
- * Added zzs_keydel()
- * Added zzs_newadd()
- * Fixed up zzs_stat()
- *
- * July 1991
- * Made symbol table entry save its hash code for fast comparison
- * during searching etc...
- */
-
-#include <stdio.h>
-#if defined(__STDC__) || defined(__USE_PROTOS)
-#include <string.h>
-#include <stdlib.h>
-#else
-#include <malloc.h>
-#endif
-#include "sym.h"
-
-#define StrSame 0
-
-static Sym **CurScope = NULL;
-static unsigned size = 0;
-static Sym **table=NULL;
-static char *strings;
-static char *strp;
-static int strsize = 0;
-
-#ifdef __USE_PROTOS
-void zzs_init(int sz,int strs)
-#else
-void zzs_init(sz, strs)
-int sz, strs;
-#endif
-{
- if ( sz <= 0 || strs <= 0 ) return;
- table = (Sym **) calloc(sz, sizeof(Sym *));
- if ( table == NULL )
- {
- fprintf(stderr, "Cannot allocate table of size %d\n", sz);
- exit(1);
- }
- strings = (char *) calloc(strs, sizeof(char));
- if ( strings == NULL )
- {
- fprintf(stderr, "Cannot allocate string table of size %d\n", strs);
- exit(1);
- }
- size = sz;
- strsize = strs;
- strp = strings;
-}
-
-#ifdef __USE_PROTOS
-void zzs_done(void)
-#else
-void zzs_done()
-#endif
-{
- if ( table != NULL ) free( table );
- if ( strings != NULL ) free( strings );
-}
-
-#ifdef __USE_PROTOS
-void zzs_add(char *key,Sym rec)
-#else
-void zzs_add(key, rec)
-char *key;
-register Sym *rec;
-#endif
-{
- register unsigned int h=0;
- register char *p=key;
-
- HASH(p, h);
- rec->hash = h; /* save hash code for fast comp later */
- h %= size;
-
- if ( CurScope != NULL ) {rec->scope = *CurScope; *CurScope = rec;}
- rec->next = table[h]; /* Add to doubly-linked list */
- rec->prev = NULL;
- if ( rec->next != NULL ) (rec->next)->prev = rec;
- table[h] = rec;
- rec->head = &(table[h]);
-}
-
-#ifdef __USE_PROTOS
-Sym * zzs_get(char *key)
-#else
-Sym * zzs_get(key)
-char *key;
-#endif
-{
- register unsigned int h=0;
- register char *p=key;
- register Sym *q;
-
- HASH(p, h);
-
- for (q = table[h%size]; q != NULL; q = q->next)
- {
- if ( q->hash == h ) /* do we even have a chance of matching? */
- if ( strcmp(key, q->symbol) == StrSame ) return( q );
- }
- return( NULL );
-}
-
-/*
- * Unlink p from the symbol table. Hopefully, it's actually in the
- * symbol table.
- *
- * If p is not part of a bucket chain of the symbol table, bad things
- * will happen.
- *
- * Will do nothing if all list pointers are NULL
- */
-#ifdef __USE_PROTOS
-void zzs_del(Sym *p)
-#else
-void zzs_del(p)
-register Sym *p;
-#endif
-{
- if ( p == NULL ) {fprintf(stderr, "zzs_del(NULL)\n"); exit(1);}
- if ( p->prev == NULL ) /* Head of list */
- {
- register Sym **t = p->head;
-
- if ( t == NULL ) return; /* not part of symbol table */
- (*t) = p->next;
- if ( (*t) != NULL ) (*t)->prev = NULL;
- }
- else
- {
- (p->prev)->next = p->next;
- if ( p->next != NULL ) (p->next)->prev = p->prev;
- }
- p->next = p->prev = NULL; /* not part of symbol table anymore */
- p->head = NULL;
-}
-
-#ifdef __USE_PROTOS
-void zzs_keydel(char *key)
-#else
-void zzs_keydel(key)
-char *key;
-#endif
-{
- Sym *p = zzs_get(key);
-
- if ( p != NULL ) zzs_del( p );
-}
-
-/* S c o p e S t u f f */
-
-/* Set current scope to 'scope'; return current scope if 'scope' == NULL */
-
-#ifdef __USE_PROTOS
-Sym ** zzs_scope(Sym **scope)
-#else
-Sym ** zzs_scope(scope)
-Sym **scope;
-#endif
-{
- if ( scope == NULL ) return( CurScope );
- CurScope = scope;
- return( scope );
-}
-
-/* Remove a scope described by 'scope'. Return pointer to 1st element in scope */
-
-#ifdef __USE_PROTOS
-Sym * zzs_rmscope(Sym **scope)
-#else
-Sym * zzs_rmscope(scope)
-register Sym **scope;
-#endif
-{
- register Sym *p;
- Sym *start;
-
- if ( scope == NULL ) return(NULL);
- start = p = *scope;
- for (; p != NULL; p=p->scope) { zzs_del( p ); }
- *scope = NULL;
- return( start );
-}
-
-#ifdef __USE_PROTOS
-void zzs_stat(void)
-#else
-void zzs_stat()
-#endif
-{
- static unsigned short count[20];
- unsigned int i,n=0,low=0, hi=0;
- register Sym **p;
- float avg=0.0;
-
- for (i=0; i<20; i++) count[i] = 0;
- for (p=table; p<&(table[size]); p++)
- {
- register Sym *q = *p;
- unsigned int len;
-
- if ( q != NULL && low==0 ) low = p-table;
- len = 0;
- if ( q != NULL ) printf("[%d]", p-table);
- while ( q != NULL )
- {
- len++;
- n++;
- printf(" %s", q->symbol);
- q = q->next;
- if ( q == NULL ) printf("\n");
- }
- if ( len>=20 ) printf("zzs_stat: count table too small\n");
- else count[len]++;
- if ( *p != NULL ) hi = p-table;
- }
-
- printf("Storing %d recs used %d hash positions out of %d\n",
- n, size-count[0], size);
- printf("%f %% utilization\n",
- ((float)(size-count[0]))/((float)size));
- for (i=0; i<20; i++)
- {
- if ( count[i] != 0 )
- {
- avg += (((float)(i*count[i]))/((float)n)) * i;
- printf("Buckets of len %d == %d (%f %% of recs)\n",
- i, count[i], 100.0*((float)(i*count[i]))/((float)n));
- }
- }
- printf("Avg bucket length %f\n", avg);
- printf("Range of hash function: %d..%d\n", low, hi);
-}
-
-/*
- * Given a string, this function allocates and returns a pointer to a
- * symbol table record whose "symbol" pointer is reset to a position
- * in the string table.
- */
-
-#ifdef __USE_PROTOS
-Sym * zzs_new(char *text)
-#else
-Sym * zzs_new(text)
-char *text;
-#endif
-{
- Sym *p;
-
- if ( (p = (Sym *) calloc(1,sizeof(Sym))) == 0 )
- {
- fprintf(stderr,"Out of memory\n");
- exit(1);
- }
- p->symbol = zzs_strdup(text);
-
- return p;
-}
-
-/* create a new symbol table entry and add it to the symbol table */
-
-#ifdef __USE_PROTOS
-Sym * zzs_newadd(char *text)
-#else
-Sym * zzs_newadd(text)
-char *text;
-#endif
-{
- Sym *p = zzs_new(text);
- if ( p != NULL ) zzs_add(text, p);
- return p;
-}
-
-/* Add a string to the string table and return a pointer to it.
- * Bump the pointer into the string table to next avail position.
- */
-
-#ifdef __USE_PROTOS
-char * zzs_strdup(char *s)
-#else
-char * zzs_strdup(s)
-register char *s;
-#endif
-{
- register char *start=strp;
-
- while ( *s != '\0' )
- {
- if ( strp >= &(strings[strsize-2]) )
- {
- fprintf(stderr, "sym: string table overflow (%d chars)\n", strsize);
- exit(-1);
- }
- *strp++ = *s++;
- }
- *strp++ = '\0';
-
- return( start );
-}
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/support/sym/template.h b/BaseTools/Source/C/VfrCompile/Pccts/support/sym/template.h
deleted file mode 100644
index ee6e665e34..0000000000
--- a/BaseTools/Source/C/VfrCompile/Pccts/support/sym/template.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* T e m p l a t e F o r S y m b o l T a b l e M a n a g e r */
-
-/* define some hash function */
-#ifndef HASH
-#define HASH(p, h) while ( *p != '\0' ) h = (h<<1) + *p++;
-#endif
-
-/* minimum symbol table record */
-typedef struct _sym {
- char *symbol;
- struct _sym *next, *prev, **head, *scope;
- unsigned int hash;
- } Sym, *SymPtr;
-
-#ifdef __USE_PROTOS
-void zzs_init(int, int);
-void zzs_done(void);
-void zzs_add(char *, Sym *);
-Sym *zzs_get(char *);
-void zzs_del(Sym *);
-void zzs_keydel(char *);
-Sym **zzs_scope(Sym **);
-Sym *zzs_rmscope(Sym **);
-void zzs_stat(void);
-Sym *zzs_new(char *);
-Sym *zzs_newadd(char *);
-char *zzs_strdup(char *);
-#else
-void zzs_init();
-void zzs_done();
-void zzs_add();
-Sym *zzs_get();
-void zzs_del();
-void zzs_keydel();
-Sym **zzs_scope();
-Sym *zzs_rmscope();
-void zzs_stat();
-Sym *zzs_new();
-Sym *zzs_newadd();
-char *zzs_strdup();
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
deleted file mode 100644
index da8c529894..0000000000
--- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
+++ /dev/null
@@ -1,838 +0,0 @@
-/** @file
-
- VfrCompiler main class and main function.
-
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "stdio.h"
-#include "stdlib.h"
-#include "string.h"
-#include "VfrCompiler.h"
-#include "CommonLib.h"
-#include "EfiUtilityMsgs.h"
-
-PACKAGE_DATA gCBuffer;
-PACKAGE_DATA gRBuffer;
-CVfrStringDB gCVfrStringDB;
-
-VOID
-CVfrCompiler::DebugError (
- IN CHAR8 *FileName,
- IN UINT32 LineNumber,
- IN UINT32 MessageCode,
- IN CONST CHAR8 *Text,
- IN CONST CHAR8 *MsgFmt,
- ...
- )
-{
- va_list List;
- va_start (List, MsgFmt);
- PrintMessage ((CHAR8 *) "ERROR", FileName, LineNumber, MessageCode, (CHAR8 *) Text, (CHAR8 *) MsgFmt, List);
- va_end (List);
-}
-
-VOID
-CVfrCompiler::SET_RUN_STATUS (
- IN COMPILER_RUN_STATUS Status
- )
-{
- mRunStatus = Status;
-}
-
-BOOLEAN
-CVfrCompiler::IS_RUN_STATUS (
- IN COMPILER_RUN_STATUS Status
- )
-{
- return mRunStatus == Status;
-}
-
-VOID
-CVfrCompiler::OptionInitialization (
- IN INT32 Argc,
- IN CHAR8 **Argv
- )
-{
- INT32 Index;
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
- SetUtilityName ((CHAR8*) PROGRAM_NAME);
-
- mOptions.VfrFileName[0] = '\0';
- mOptions.RecordListFile[0] = '\0';
- mOptions.CreateRecordListFile = FALSE;
- mOptions.CreateIfrPkgFile = FALSE;
- mOptions.PkgOutputFileName[0] = '\0';
- mOptions.COutputFileName[0] = '\0';
- mOptions.OutputDirectory[0] = '\0';
- mOptions.PreprocessorOutputFileName[0] = '\0';
- mOptions.VfrBaseFileName[0] = '\0';
- mOptions.IncludePaths = NULL;
- mOptions.SkipCPreprocessor = TRUE;
- mOptions.CPreprocessorOptions = NULL;
- mOptions.CompatibleMode = FALSE;
- mOptions.HasOverrideClassGuid = FALSE;
- mOptions.WarningAsError = FALSE;
- memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));
-
- if (Argc == 1) {
- Usage ();
- SET_RUN_STATUS (STATUS_DEAD);
- return;
- }
-
- for (Index = 1; (Index < Argc) && (Argv[Index][0] == '-'); Index++) {
- if ((stricmp(Argv[Index], "-h") == 0) || (stricmp(Argv[Index], "--help") == 0)) {
- Usage ();
- SET_RUN_STATUS (STATUS_DEAD);
- return;
- } else if (stricmp(Argv[Index], "-l") == 0) {
- mOptions.CreateRecordListFile = TRUE;
- gCIfrRecordInfoDB.TurnOn ();
- } else if (stricmp(Argv[Index], "-i") == 0) {
- Index++;
- if ((Index >= Argc) || (Argv[Index][0] == '-')) {
- DebugError (NULL, 0, 1001, "Missing option", "-i missing path argument");
- goto Fail;
- }
-
- AppendIncludePath(Argv[Index]);
- } else if (stricmp(Argv[Index], "-o") == 0 || stricmp(Argv[Index], "--output-directory") == 0 || stricmp(Argv[Index], "-od") == 0) {
- Index++;
- if ((Index >= Argc) || (Argv[Index][0] == '-')) {
- DebugError (NULL, 0, 1001, "Missing option", "-o missing output directory name");
- goto Fail;
- }
- strcpy (mOptions.OutputDirectory, Argv[Index]);
-
- CHAR8 lastChar = mOptions.OutputDirectory[strlen(mOptions.OutputDirectory) - 1];
- if ((lastChar != '/') && (lastChar != '\\')) {
- if (strchr(mOptions.OutputDirectory, '/') != NULL) {
- strcat (mOptions.OutputDirectory, "/");
- } else {
- strcat (mOptions.OutputDirectory, "\\");
- }
- }
- DebugMsg (NULL, 0, 9, (CHAR8 *) "Output Directory", mOptions.OutputDirectory);
- } else if (stricmp(Argv[Index], "-b") == 0 || stricmp(Argv[Index], "--create-ifr-package") == 0 || stricmp(Argv[Index], "-ibin") == 0) {
- mOptions.CreateIfrPkgFile = TRUE;
- } else if (stricmp(Argv[Index], "-n") == 0 || stricmp(Argv[Index], "--no-pre-processing") == 0 || stricmp(Argv[Index], "-nopp") == 0) {
- mOptions.SkipCPreprocessor = TRUE;
- } else if (stricmp(Argv[Index], "-f") == 0 || stricmp(Argv[Index], "--pre-processing-flag") == 0 || stricmp(Argv[Index], "-ppflag") == 0) {
- Index++;
- if ((Index >= Argc) || (Argv[Index][0] == '-')) {
- DebugError (NULL, 0, 1001, "Missing option", "-od - missing C-preprocessor argument");
- goto Fail;
- }
-
- AppendCPreprocessorOptions (Argv[Index]);
- } else if (stricmp(Argv[Index], "-c") == 0 || stricmp(Argv[Index], "--compatible-framework") == 0) {
- mOptions.CompatibleMode = TRUE;
- } else if (stricmp(Argv[Index], "-s") == 0|| stricmp(Argv[Index], "--string-db") == 0) {
- Index++;
- if ((Index >= Argc) || (Argv[Index][0] == '-')) {
- DebugError (NULL, 0, 1001, "Missing option", "-s missing input string file name");
- goto Fail;
- }
- gCVfrStringDB.SetStringFileName(Argv[Index]);
- DebugMsg (NULL, 0, 9, (CHAR8 *) "Input string file path", Argv[Index]);
- } else if ((stricmp (Argv[Index], "-g") == 0) || (stricmp (Argv[Index], "--guid") == 0)) {
- Index++;
- Status = StringToGuid (Argv[Index], &mOptions.OverrideClassGuid);
- if (EFI_ERROR (Status)) {
- DebugError (NULL, 0, 1000, "Invalid format:", "%s", Argv[Index]);
- goto Fail;
- }
- mOptions.HasOverrideClassGuid = TRUE;
- } else if (stricmp(Argv[Index], "-w") == 0 || stricmp(Argv[Index], "--warning-as-error") == 0) {
- mOptions.WarningAsError = TRUE;
- } else {
- DebugError (NULL, 0, 1000, "Unknown option", "unrecognized option %s", Argv[Index]);
- goto Fail;
- }
- }
-
- if (Index != Argc - 1) {
- DebugError (NULL, 0, 1001, "Missing option", "VFR file name is not specified.");
- goto Fail;
- } else {
- strcpy (mOptions.VfrFileName, Argv[Index]);
- }
-
- if (SetBaseFileName() != 0) {
- goto Fail;
- }
- if (SetPkgOutputFileName () != 0) {
- goto Fail;
- }
- if (SetCOutputFileName() != 0) {
- goto Fail;
- }
- if (SetPreprocessorOutputFileName () != 0) {
- goto Fail;
- }
- if (SetRecordListFileName () != 0) {
- goto Fail;
- }
- return;
-
-Fail:
- SET_RUN_STATUS (STATUS_DEAD);
-
- mOptions.VfrFileName[0] = '\0';
- mOptions.RecordListFile[0] = '\0';
- mOptions.CreateRecordListFile = FALSE;
- mOptions.CreateIfrPkgFile = FALSE;
- mOptions.PkgOutputFileName[0] = '\0';
- mOptions.COutputFileName[0] = '\0';
- mOptions.OutputDirectory[0] = '\0';
- mOptions.PreprocessorOutputFileName[0] = '\0';
- mOptions.VfrBaseFileName[0] = '\0';
- if (mOptions.IncludePaths != NULL) {
- delete mOptions.IncludePaths;
- mOptions.IncludePaths = NULL;
- }
- if (mOptions.CPreprocessorOptions != NULL) {
- delete mOptions.CPreprocessorOptions;
- mOptions.CPreprocessorOptions = NULL;
- }
-}
-
-VOID
-CVfrCompiler::AppendIncludePath (
- IN CHAR8 *PathStr
- )
-{
- UINT32 Len = 0;
- CHAR8 *IncludePaths = NULL;
-
- Len = strlen (" -I ") + strlen (PathStr) + 1;
- if (mOptions.IncludePaths != NULL) {
- Len += strlen (mOptions.IncludePaths);
- }
- IncludePaths = new CHAR8[Len];
- if (IncludePaths == NULL) {
- DebugError (NULL, 0, 4001, "Resource: memory can't be allocated", NULL);
- return;
- }
- IncludePaths[0] = '\0';
- if (mOptions.IncludePaths != NULL) {
- strcat (IncludePaths, mOptions.IncludePaths);
- }
- strcat (IncludePaths, " -I ");
- strcat (IncludePaths, PathStr);
- if (mOptions.IncludePaths != NULL) {
- delete mOptions.IncludePaths;
- }
- mOptions.IncludePaths = IncludePaths;
-}
-
-VOID
-CVfrCompiler::AppendCPreprocessorOptions (
- IN CHAR8 *Options
- )
-{
- UINT32 Len = 0;
- CHAR8 *Opt = NULL;
-
- Len = strlen (Options) + strlen (" ") + 1;
- if (mOptions.CPreprocessorOptions != NULL) {
- Len += strlen (mOptions.CPreprocessorOptions);
- }
- Opt = new CHAR8[Len];
- if (Opt == NULL) {
- DebugError (NULL, 0, 4001, "Resource: memory can't be allocated", NULL);
- return;
- }
- Opt[0] = 0;
- if (mOptions.CPreprocessorOptions != NULL) {
- strcat (Opt, mOptions.CPreprocessorOptions);
- }
- strcat (Opt, " ");
- strcat (Opt, Options);
- if (mOptions.CPreprocessorOptions != NULL) {
- delete mOptions.CPreprocessorOptions;
- }
- mOptions.CPreprocessorOptions = Opt;
-}
-
-INT8
-CVfrCompiler::SetBaseFileName (
- VOID
- )
-{
- CHAR8 *pFileName, *pPath, *pExt;
-
- if (mOptions.VfrFileName[0] == '\0') {
- return -1;
- }
-
- pFileName = mOptions.VfrFileName;
- while (
- ((pPath = strchr (pFileName, '\\')) != NULL) ||
- ((pPath = strchr (pFileName, '/')) != NULL)
- )
- {
- pFileName = pPath + 1;
- }
-
- if (pFileName == NULL) {
- return -1;
- }
-
- if ((pExt = strchr (pFileName, '.')) == NULL) {
- return -1;
- }
-
- strncpy (mOptions.VfrBaseFileName, pFileName, pExt - pFileName);
- mOptions.VfrBaseFileName[pExt - pFileName] = '\0';
-
- return 0;
-}
-
-INT8
-CVfrCompiler::SetPkgOutputFileName (
- VOID
- )
-{
- if (mOptions.VfrBaseFileName[0] == '\0') {
- return -1;
- }
-
- strcpy (mOptions.PkgOutputFileName, mOptions.OutputDirectory);
- strcat (mOptions.PkgOutputFileName, mOptions.VfrBaseFileName);
- strcat (mOptions.PkgOutputFileName, VFR_PACKAGE_FILENAME_EXTENSION);
-
- return 0;
-}
-
-INT8
-CVfrCompiler::SetCOutputFileName (
- VOID
- )
-{
- if (mOptions.VfrBaseFileName[0] == '\0') {
- return -1;
- }
-
- strcpy (mOptions.COutputFileName, mOptions.OutputDirectory);
- strcat (mOptions.COutputFileName, mOptions.VfrBaseFileName);
- strcat (mOptions.COutputFileName, ".c");
-
- return 0;
-}
-
-INT8
-CVfrCompiler::SetPreprocessorOutputFileName (
- VOID
- )
-{
- if (mOptions.VfrBaseFileName[0] == '\0') {
- return -1;
- }
-
- strcpy (mOptions.PreprocessorOutputFileName, mOptions.OutputDirectory);
- strcat (mOptions.PreprocessorOutputFileName, mOptions.VfrBaseFileName);
- strcat (mOptions.PreprocessorOutputFileName, VFR_PREPROCESS_FILENAME_EXTENSION);
-
- return 0;
-}
-
-INT8
-CVfrCompiler::SetRecordListFileName (
- VOID
- )
-{
- if (mOptions.VfrBaseFileName[0] == '\0') {
- return -1;
- }
-
- strcpy (mOptions.RecordListFile, mOptions.OutputDirectory);
- strcat (mOptions.RecordListFile, mOptions.VfrBaseFileName);
- strcat (mOptions.RecordListFile, VFR_RECORDLIST_FILENAME_EXTENSION);
-
- return 0;
-}
-
-CVfrCompiler::CVfrCompiler (
- IN INT32 Argc,
- IN CHAR8 **Argv
- )
-{
- mPreProcessCmd = (CHAR8 *) PREPROCESSOR_COMMAND;
- mPreProcessOpt = (CHAR8 *) PREPROCESSOR_OPTIONS;
-
- OptionInitialization(Argc, Argv);
-
- if ((IS_RUN_STATUS(STATUS_FAILED)) || (IS_RUN_STATUS(STATUS_DEAD))) {
- return;
- }
-
- SET_RUN_STATUS(STATUS_INITIALIZED);
-}
-
-CVfrCompiler::~CVfrCompiler (
- VOID
- )
-{
- if (mOptions.IncludePaths != NULL) {
- delete mOptions.IncludePaths;
- mOptions.IncludePaths = NULL;
- }
-
- if (mOptions.CPreprocessorOptions != NULL) {
- delete mOptions.CPreprocessorOptions;
- mOptions.CPreprocessorOptions = NULL;
- }
-
- SET_RUN_STATUS(STATUS_DEAD);
-}
-
-VOID
-CVfrCompiler::Usage (
- VOID
- )
-{
- UINT32 Index;
- CONST CHAR8 *Help[] = {
- " ",
- "VfrCompile version " VFR_COMPILER_VERSION __BUILD_VERSION VFR_COMPILER_UPDATE_TIME,
- "Copyright (c) 2004-2011 Intel Corporation. All rights reserved.",
- " ",
- "Usage: VfrCompile [options] VfrFile",
- " ",
- "Options:",
- " -h, --help prints this help",
- " -l create an output IFR listing file",
- " -o DIR, --output-directory DIR",
- " deposit all output files to directory OutputDir",
- " default is current directory",
- " -b, --create-ifr-package",
- " create an IFR HII pack file",
- " -n, --no-pre-processing",
- " do not preprocessing input file",
- " -c, --compatible-framework",
- " compatible framework vfr file",
- " -s, --string-db",
- " input uni string package file",
- " -g, --guid",
- " override class guid input",
- " format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
- " -w --warning-as-error",
- " treat warning as an error",
- NULL
- };
- for (Index = 0; Help[Index] != NULL; Index++) {
- fprintf (stdout, "%s\n", Help[Index]);
- }
-}
-
-VOID
-CVfrCompiler::PreProcess (
- VOID
- )
-{
- FILE *pVfrFile = NULL;
- UINT32 CmdLen = 0;
- CHAR8 *PreProcessCmd = NULL;
-
- if (!IS_RUN_STATUS(STATUS_INITIALIZED)) {
- goto Fail;
- }
-
- if (mOptions.SkipCPreprocessor == TRUE) {
- goto Out;
- }
-
- if ((pVfrFile = fopen (mOptions.VfrFileName, "r")) == NULL) {
- DebugError (NULL, 0, 0001, "Error opening the input VFR file", mOptions.VfrFileName);
- goto Fail;
- }
- fclose (pVfrFile);
-
- CmdLen = strlen (mPreProcessCmd) + strlen (mPreProcessOpt) +
- strlen (mOptions.VfrFileName) + strlen (mOptions.PreprocessorOutputFileName);
- if (mOptions.CPreprocessorOptions != NULL) {
- CmdLen += strlen (mOptions.CPreprocessorOptions);
- }
- if (mOptions.IncludePaths != NULL) {
- CmdLen += strlen (mOptions.IncludePaths);
- }
-
- PreProcessCmd = new CHAR8[CmdLen + 10];
- if (PreProcessCmd == NULL) {
- DebugError (NULL, 0, 4001, "Resource: memory can't be allocated", NULL);
- goto Fail;
- }
- strcpy (PreProcessCmd, mPreProcessCmd), strcat (PreProcessCmd, " ");
- strcat (PreProcessCmd, mPreProcessOpt), strcat (PreProcessCmd, " ");
- if (mOptions.IncludePaths != NULL) {
- strcat (PreProcessCmd, mOptions.IncludePaths), strcat (PreProcessCmd, " ");
- }
- if (mOptions.CPreprocessorOptions != NULL) {
- strcat (PreProcessCmd, mOptions.CPreprocessorOptions), strcat (PreProcessCmd, " ");
- }
- strcat (PreProcessCmd, mOptions.VfrFileName), strcat (PreProcessCmd, " > ");
- strcat (PreProcessCmd, mOptions.PreprocessorOutputFileName);
-
- if (system (PreProcessCmd) != 0) {
- DebugError (NULL, 0, 0003, "Error parsing file", "failed to spawn C preprocessor on VFR file %s\n", PreProcessCmd);
- goto Fail;
- }
-
- delete PreProcessCmd;
-
-Out:
- SET_RUN_STATUS (STATUS_PREPROCESSED);
- return;
-
-Fail:
- if (!IS_RUN_STATUS(STATUS_DEAD)) {
- SET_RUN_STATUS (STATUS_FAILED);
- }
- delete PreProcessCmd;
-}
-
-extern UINT8 VfrParserStart (IN FILE *, IN INPUT_INFO_TO_SYNTAX *);
-
-VOID
-CVfrCompiler::Compile (
- VOID
- )
-{
- FILE *pInFile = NULL;
- CHAR8 *InFileName = NULL;
- INPUT_INFO_TO_SYNTAX InputInfo;
-
- if (!IS_RUN_STATUS(STATUS_PREPROCESSED)) {
- goto Fail;
- }
-
- InFileName = (mOptions.SkipCPreprocessor == TRUE) ? mOptions.VfrFileName : mOptions.PreprocessorOutputFileName;
-
- gCVfrErrorHandle.SetInputFile (InFileName);
- gCVfrErrorHandle.SetWarningAsError(mOptions.WarningAsError);
-
- if ((pInFile = fopen (InFileName, "r")) == NULL) {
- DebugError (NULL, 0, 0001, "Error opening the input file", InFileName);
- goto Fail;
- }
-
- InputInfo.CompatibleMode = mOptions.CompatibleMode;
- if (mOptions.HasOverrideClassGuid) {
- InputInfo.OverrideClassGuid = &mOptions.OverrideClassGuid;
- } else {
- InputInfo.OverrideClassGuid = NULL;
- }
-
- if (VfrParserStart (pInFile, &InputInfo) != 0) {
- goto Fail;
- }
-
- fclose (pInFile);
-
- if (gCFormPkg.HavePendingUnassigned () == TRUE) {
- gCFormPkg.PendingAssignPrintAll ();
- goto Fail;
- }
-
- SET_RUN_STATUS (STATUS_COMPILEED);
- return;
-
-Fail:
- if (!IS_RUN_STATUS(STATUS_DEAD)) {
- DebugError (NULL, 0, 0003, "Error parsing", "compile error in file %s", InFileName);
- SET_RUN_STATUS (STATUS_FAILED);
- }
- if (pInFile != NULL) {
- fclose (pInFile);
- }
-}
-
-VOID
-CVfrCompiler::UpdateInfoForDynamicOpcode (
- VOID
- )
-{
- SIfrRecord *pRecord;
-
- if (!gNeedAdjustOpcode) {
- return;
- }
-
- //
- // Base on the original offset info to update the record list.
- //
- if (!gCIfrRecordInfoDB.IfrAdjustDynamicOpcodeInRecords()) {
- DebugError (NULL, 0, 1001, "Error parsing vfr file", "Can find the offset in the record.");
- }
-
- //
- // Base on the opcode binary length to recalculate the offset for each opcode.
- //
- gCIfrRecordInfoDB.IfrAdjustOffsetForRecord();
-
- //
- // Base on the offset to find the binary address.
- //
- pRecord = gCIfrRecordInfoDB.GetRecordInfoFromOffset(gAdjustOpcodeOffset);
- while (pRecord != NULL) {
- pRecord->mIfrBinBuf = gCFormPkg.GetBufAddrBaseOnOffset(pRecord->mOffset);
- if (pRecord->mIfrBinBuf == NULL) {
- DebugError (NULL, 0, 0001, "Error parsing vfr file", " 0x%X. offset not allocated.", pRecord->mOffset);
- }
- pRecord = pRecord->mNext;
- }
-}
-
-VOID
-CVfrCompiler::AdjustBin (
- VOID
- )
-{
- EFI_VFR_RETURN_CODE Status;
-
- if (!IS_RUN_STATUS(STATUS_COMPILEED)) {
- return;
- }
-
- UpdateInfoForDynamicOpcode ();
-
- //
- // Check Binary Code consistent between Form and IfrRecord
- //
-
- //
- // Get Package Data and IfrRecord Data
- //
- gCFormPkg.BuildPkg (gCBuffer);
- gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);
-
- //
- // Compare Form and Record data
- //
- if (gCBuffer.Buffer != NULL && gRBuffer.Buffer != NULL) {
- UINT32 Index;
- if (gCBuffer.Size != gRBuffer.Size) {
- 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);
- }
- for (Index = 0; Index < gCBuffer.Size; Index ++) {
- if (gCBuffer.Buffer[Index] != gRBuffer.Buffer[Index]) {
- break;
- }
- }
- if (Index != gCBuffer.Size) {
- DebugError (NULL, 0, 0001, "Error parsing vfr file", " %s. the 0x%X byte is different between Form and Record", mOptions.VfrFileName, Index);
- }
- DebugMsg (NULL, 0, 9, (CHAR8 *) "IFR Buffer", (CHAR8 *) "Form Buffer same to Record Buffer and Size is 0x%X", Index);
- } else if (gCBuffer.Buffer == NULL && gRBuffer.Buffer == NULL) {
- //ok
- } else {
- DebugError (NULL, 0, 0001, "Error parsing vfr file", " %s.Buffer not allocated.", mOptions.VfrFileName);
- }
-
- //
- // For UEFI mode, not do OpCode Adjust
- //
- if (mOptions.CompatibleMode) {
- //
- // Adjust Opcode to be compatible with framework vfr
- //
- Status = gCIfrRecordInfoDB.IfrRecordAdjust ();
- if (Status != VFR_RETURN_SUCCESS) {
- //
- // Record List Adjust Failed
- //
- SET_RUN_STATUS (STATUS_FAILED);
- return;
- }
- //
- // Re get the IfrRecord Buffer.
- //
- gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);
- }
-
- return;
-}
-
-VOID
-CVfrCompiler::GenBinary (
- VOID
- )
-{
- FILE *pFile = NULL;
-
- if (!IS_RUN_STATUS(STATUS_COMPILEED)) {
- goto Fail;
- }
-
- if (mOptions.CreateIfrPkgFile == TRUE) {
- if ((pFile = fopen (mOptions.PkgOutputFileName, "wb")) == NULL) {
- DebugError (NULL, 0, 0001, "Error opening file", mOptions.PkgOutputFileName);
- goto Fail;
- }
- if (gCFormPkg.BuildPkg (pFile, &gRBuffer) != VFR_RETURN_SUCCESS) {
- fclose (pFile);
- goto Fail;
- }
- fclose (pFile);
- }
-
- SET_RUN_STATUS (STATUS_GENBINARY);
-
- return;
-
-Fail:
- if (!IS_RUN_STATUS(STATUS_DEAD)) {
- SET_RUN_STATUS (STATUS_FAILED);
- }
-}
-
-static const char *gSourceFileHeader[] = {
- "//",
- "// DO NOT EDIT -- auto-generated file",
- "//",
- "// This file is generated by the vfrcompiler utility",
- "//",
- NULL
-};
-
-VOID
-CVfrCompiler::GenCFile (
- VOID
- )
-{
- FILE *pFile;
- UINT32 Index;
-
- if (!IS_RUN_STATUS(STATUS_GENBINARY)) {
- goto Fail;
- }
-
- if (!mOptions.CreateIfrPkgFile || mOptions.CompatibleMode) {
- if ((pFile = fopen (mOptions.COutputFileName, "w")) == NULL) {
- DebugError (NULL, 0, 0001, "Error opening output C file", mOptions.COutputFileName);
- goto Fail;
- }
-
- for (Index = 0; gSourceFileHeader[Index] != NULL; Index++) {
- fprintf (pFile, "%s\n", gSourceFileHeader[Index]);
- }
-
- if (mOptions.CompatibleMode) {
- gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName);
- }
-
- if (gCFormPkg.GenCFile (mOptions.VfrBaseFileName, pFile, &gRBuffer) != VFR_RETURN_SUCCESS) {
- fclose (pFile);
- goto Fail;
- }
- fclose (pFile);
- }
-
- SET_RUN_STATUS (STATUS_FINISHED);
- return;
-
-Fail:
- if (!IS_RUN_STATUS(STATUS_DEAD)) {
- SET_RUN_STATUS (STATUS_FAILED);
- }
-}
-
-VOID
-CVfrCompiler::GenRecordListFile (
- VOID
- )
-{
- CHAR8 *InFileName = NULL;
- FILE *pInFile = NULL;
- FILE *pOutFile = NULL;
- CHAR8 LineBuf[MAX_VFR_LINE_LEN];
- UINT32 LineNo;
-
- InFileName = (mOptions.SkipCPreprocessor == TRUE) ? mOptions.VfrFileName : mOptions.PreprocessorOutputFileName;
-
- if (mOptions.CreateRecordListFile == TRUE) {
- if ((InFileName[0] == '\0') || (mOptions.RecordListFile[0] == '\0')) {
- return;
- }
-
- if ((pInFile = fopen (InFileName, "r")) == NULL) {
- DebugError (NULL, 0, 0001, "Error opening the input VFR preprocessor output file", InFileName);
- return;
- }
-
- if ((pOutFile = fopen (mOptions.RecordListFile, "w")) == NULL) {
- DebugError (NULL, 0, 0001, "Error opening the record list file", mOptions.RecordListFile);
- goto Err1;
- }
-
- fprintf (pOutFile, "//\n// VFR compiler version " VFR_COMPILER_VERSION __BUILD_VERSION "\n//\n");
- LineNo = 0;
- while (!feof (pInFile)) {
- if (fgets (LineBuf, MAX_VFR_LINE_LEN, pInFile) != NULL) {
- fprintf (pOutFile, "%s", LineBuf);
- LineNo++;
- gCIfrRecordInfoDB.IfrRecordOutput (pOutFile, LineNo);
- }
- }
-
- fprintf (pOutFile, "\n//\n// All Opcode Record List \n//\n");
- gCIfrRecordInfoDB.IfrRecordOutput (pOutFile, 0);
- gCVfrVarDataTypeDB.Dump(pOutFile);
-
- fclose (pOutFile);
- fclose (pInFile);
- }
-
- return;
-
-Err1:
- fclose (pInFile);
-}
-
-int
-main (
- IN int Argc,
- IN char **Argv
- )
-{
- COMPILER_RUN_STATUS Status;
-
- SetPrintLevel(WARNING_LOG_LEVEL);
- CVfrCompiler Compiler(Argc, Argv);
-
- Compiler.PreProcess();
- Compiler.Compile();
- Compiler.AdjustBin();
- Compiler.GenBinary();
- Compiler.GenCFile();
- Compiler.GenRecordListFile ();
-
- Status = Compiler.RunStatus ();
- if ((Status == STATUS_DEAD) || (Status == STATUS_FAILED)) {
- return 2;
- }
-
- if (gCBuffer.Buffer != NULL) {
- delete gCBuffer.Buffer;
- }
-
- if (gRBuffer.Buffer != NULL) {
- delete gRBuffer.Buffer;
- }
-
- return GetUtilityStatus ();
-}
-
-
diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.h b/BaseTools/Source/C/VfrCompile/VfrCompiler.h
deleted file mode 100644
index fe29f7e3af..0000000000
--- a/BaseTools/Source/C/VfrCompile/VfrCompiler.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/** @file
-
- VfrCompiler internal defintions.
-
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _VFRCOMPILER_H_
-#define _VFRCOMPILER_H_
-
-#include "Common/UefiBaseTypes.h"
-#include "EfiVfr.h"
-#include "VfrFormPkg.h"
-#include "VfrUtilityLib.h"
-#include "ParseInf.h"
-
-#define PROGRAM_NAME "VfrCompile"
-#define VFR_COMPILER_VERSION " 2.00 (UEFI 2.3.1)"
-#define VFR_COMPILER_UPDATE_TIME " updated on 2011/07/15"
-//
-// This is how we invoke the C preprocessor on the VFR source file
-// to resolve #defines, #includes, etc. To make C source files
-// shareable between VFR and drivers, define VFRCOMPILE so that
-// #ifdefs can be used in shared .h files.
-//
-#define PREPROCESSOR_COMMAND "cl "
-#define PREPROCESSOR_OPTIONS "/nologo /E /TC /DVFRCOMPILE "
-
-//
-// Specify the filename extensions for the files we generate.
-//
-#define VFR_PREPROCESS_FILENAME_EXTENSION ".i"
-#define VFR_PACKAGE_FILENAME_EXTENSION ".hpk"
-#define VFR_RECORDLIST_FILENAME_EXTENSION ".lst"
-
-typedef struct {
- CHAR8 VfrFileName[MAX_PATH];
- CHAR8 RecordListFile[MAX_PATH];
- CHAR8 PkgOutputFileName[MAX_PATH];
- CHAR8 COutputFileName[MAX_PATH];
- bool CreateRecordListFile;
- bool CreateIfrPkgFile;
- CHAR8 OutputDirectory[MAX_PATH];
- CHAR8 PreprocessorOutputFileName[MAX_PATH];
- CHAR8 VfrBaseFileName[MAX_PATH]; // name of input VFR file with no path or extension
- CHAR8 *IncludePaths;
- bool SkipCPreprocessor;
- CHAR8 *CPreprocessorOptions;
- BOOLEAN CompatibleMode;
- BOOLEAN HasOverrideClassGuid;
- EFI_GUID OverrideClassGuid;
- BOOLEAN WarningAsError;
-} OPTIONS;
-
-typedef enum {
- STATUS_INITIALIZED = 1,
- STATUS_PREPROCESSED,
- STATUS_COMPILEED,
- STATUS_GENBINARY,
- STATUS_FINISHED,
- STATUS_FAILED,
- STATUS_DEAD,
-} COMPILER_RUN_STATUS;
-
-class CVfrCompiler {
-private:
- COMPILER_RUN_STATUS mRunStatus;
- OPTIONS mOptions;
- CHAR8 *mPreProcessCmd;
- CHAR8 *mPreProcessOpt;
-
- VOID OptionInitialization (IN INT32 , IN CHAR8 **);
- VOID AppendIncludePath (IN CHAR8 *);
- VOID AppendCPreprocessorOptions (IN CHAR8 *);
- INT8 SetBaseFileName (VOID);
- INT8 SetPkgOutputFileName (VOID);
- INT8 SetCOutputFileName(VOID);
- INT8 SetPreprocessorOutputFileName (VOID);
- INT8 SetRecordListFileName (VOID);
-
- VOID SET_RUN_STATUS (IN COMPILER_RUN_STATUS);
- BOOLEAN IS_RUN_STATUS (IN COMPILER_RUN_STATUS);
- VOID UpdateInfoForDynamicOpcode (VOID);
-
-public:
- COMPILER_RUN_STATUS RunStatus (VOID) {
- return mRunStatus;
- }
-
-public:
- CVfrCompiler (IN INT32 , IN CHAR8 **);
- ~CVfrCompiler ();
-
- VOID Usage (VOID);
-
- VOID PreProcess (VOID);
- VOID Compile (VOID);
- VOID AdjustBin (VOID);
- VOID GenBinary (VOID);
- VOID GenCFile (VOID);
- VOID GenRecordListFile (VOID);
- VOID DebugError (IN CHAR8*, IN UINT32, IN UINT32, IN CONST CHAR8*, IN CONST CHAR8*, ...);
-};
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/VfrError.cpp b/BaseTools/Source/C/VfrCompile/VfrError.cpp
deleted file mode 100644
index 71305364f6..0000000000
--- a/BaseTools/Source/C/VfrCompile/VfrError.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/** @file
-
- VfrCompiler error handler.
-
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "stdio.h"
-#include "string.h"
-#include "stdlib.h"
-#include "VfrError.h"
-#include "EfiUtilityMsgs.h"
-
-static SVFR_ERROR_HANDLE VFR_ERROR_HANDLE_TABLE [] = {
- { VFR_RETURN_SUCCESS, NULL },
- { VFR_RETURN_ERROR_SKIPED, NULL },
- { VFR_RETURN_FATAL_ERROR, ": fatal error!!" },
-
- { VFR_RETURN_MISMATCHED, ": unexpected token" },
- { VFR_RETURN_INVALID_PARAMETER, ": invalid parameter" },
- { VFR_RETURN_OUT_FOR_RESOURCES, ": system out of memory" },
- { VFR_RETURN_UNSUPPORTED, ": unsupported" },
- { VFR_RETURN_REDEFINED, ": already defined" },
- { VFR_RETURN_FORMID_REDEFINED, ": form id already defined" },
- { VFR_RETURN_QUESTIONID_REDEFINED, ": question id already defined" },
- { VFR_RETURN_VARSTOREID_REDEFINED, ": varstore id already defined" },
- { VFR_RETURN_UNDEFINED, ": undefined" },
- { VFR_RETURN_VAR_NOTDEFINED_BY_QUESTION, ": some variable has not defined by a question"},
- { VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR, ": Data Structure is defined by more than one varstores, it can't be referred as varstore, only varstore name could be used."},
- { VFR_RETURN_GET_EFIVARSTORE_ERROR, ": get efi varstore error"},
- { VFR_RETURN_EFIVARSTORE_USE_ERROR, ": can not use the efi varstore like this" },
- { VFR_RETURN_EFIVARSTORE_SIZE_ERROR, ": unsupport efi varstore size should be <= 8 bytes" },
- { VFR_RETURN_GET_NVVARSTORE_ERROR, ": get name value varstore error" },
- { VFR_RETURN_QVAR_REUSE, ": variable reused by more than one question" },
- { VFR_RETURN_FLAGS_UNSUPPORTED, ": flags unsupported" },
- { VFR_RETURN_ERROR_ARRARY_NUM, ": array number error, the valid value is in (0 ~ MAX_INDEX-1) for UEFI vfr and in (1 ~ MAX_INDEX) for Framework Vfr" },
- { VFR_RETURN_DATA_STRING_ERROR, ": data field string error or not support"},
- { VFR_RETURN_DEFAULT_VALUE_REDEFINED, ": default value re-defined with different value"},
- { VFR_RETURN_CONSTANT_ONLY, ": only constant is allowed in the expression"},
- { VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR, ": Varstore name is defined by more than one varstores, it can't be referred as varstore, only varstore strucure name could be used."},
- { VFR_RETURN_CODEUNDEFINED, ": undefined Error Code" }
-};
-
-static SVFR_WARNING_HANDLE VFR_WARNING_HANDLE_TABLE [] = {
- { VFR_WARNING_DEFAULT_VALUE_REDEFINED, ": default value re-defined with different value"},
- { VFR_WARNING_CODEUNDEFINED, ": undefined Warning Code" }
-};
-
-CVfrErrorHandle::CVfrErrorHandle (
- VOID
- )
-{
- mInputFileName = NULL;
- mScopeRecordListHead = NULL;
- mScopeRecordListTail = NULL;
- mVfrErrorHandleTable = VFR_ERROR_HANDLE_TABLE;
- mVfrWarningHandleTable = VFR_WARNING_HANDLE_TABLE;
-}
-
-CVfrErrorHandle::~CVfrErrorHandle (
- VOID
- )
-{
- SVfrFileScopeRecord *pNode = NULL;
-
- if (mInputFileName != NULL) {
- delete mInputFileName;
- }
-
- while (mScopeRecordListHead != NULL) {
- pNode = mScopeRecordListHead;
- mScopeRecordListHead = mScopeRecordListHead->mNext;
- delete pNode;
- }
-
- mScopeRecordListHead = NULL;
- mScopeRecordListTail = NULL;
- mVfrErrorHandleTable = NULL;
- mVfrWarningHandleTable = NULL;
-}
-
-VOID
-CVfrErrorHandle::SetWarningAsError (
- IN BOOLEAN WarningAsError
- )
-{
- mWarningAsError = WarningAsError;
-}
-
-VOID
-CVfrErrorHandle::SetInputFile (
- IN CHAR8 *InputFile
- )
-{
- if (InputFile != NULL) {
- mInputFileName = new CHAR8[strlen(InputFile) + 1];
- strcpy (mInputFileName, InputFile);
- }
-}
-
-SVfrFileScopeRecord::SVfrFileScopeRecord (
- IN CHAR8 *Record,
- IN UINT32 LineNum
- )
-{
- UINT32 Index;
- CHAR8 *FileName = NULL;
- CHAR8 *Str = NULL;
-
- mWholeScopeLine = LineNum;
- mNext = NULL;
-
- Str = strchr (Record, ' ');
- mScopeLineStart = atoi (++Str);
-
- Str = strchr (Str, '\"');
- FileName = ++Str;
-
- while((Str = strstr (FileName, "\\\\")) != NULL) {
- FileName = Str + 2;
- }
- if ((mFileName = new CHAR8[strlen(FileName)]) != NULL) {
- for (Index = 0; FileName[Index] != '\"'; Index++) {
- mFileName[Index] = FileName[Index];
- }
- mFileName[Index] = '\0';
- }
-
- return;
-}
-
-SVfrFileScopeRecord::~SVfrFileScopeRecord (
- VOID
- )
-{
- if (mFileName != NULL) {
- delete mFileName;
- }
-}
-
-VOID
-CVfrErrorHandle::ParseFileScopeRecord (
- IN CHAR8 *Record,
- IN UINT32 WholeScopeLine
- )
-{
- SVfrFileScopeRecord *pNode = NULL;
-
- if (Record == NULL) {
- return;
- }
-
- if ((pNode = new SVfrFileScopeRecord(Record, WholeScopeLine)) == NULL) {
- return;
- }
-
- if (mScopeRecordListHead == NULL) {
- mScopeRecordListTail = mScopeRecordListHead = pNode;
- } else {
- mScopeRecordListTail->mNext = pNode;
- mScopeRecordListTail = pNode;
- }
-}
-
-VOID
-CVfrErrorHandle::GetFileNameLineNum (
- IN UINT32 LineNum,
- OUT CHAR8 **FileName,
- OUT UINT32 *FileLine
- )
-{
- SVfrFileScopeRecord *pNode = NULL;
-
- if ((FileName == NULL) || (FileLine == NULL)) {
- return;
- }
-
- *FileName = NULL;
- *FileLine = 0xFFFFFFFF;
-
- //
- // Some errors occur before scope record list been built.
- //
- if (mScopeRecordListHead == NULL) {
- *FileLine = LineNum;
- *FileName = mInputFileName;
- return ;
- }
-
- for (pNode = mScopeRecordListHead; pNode->mNext != NULL; pNode = pNode->mNext) {
- if ((LineNum > pNode->mWholeScopeLine) && (pNode->mNext->mWholeScopeLine > LineNum)) {
- *FileName = pNode->mFileName;
- *FileLine = LineNum - pNode->mWholeScopeLine + pNode->mScopeLineStart - 1;
- return ;
- }
- }
-
- *FileName = pNode->mFileName;
- *FileLine = LineNum - pNode->mWholeScopeLine + pNode->mScopeLineStart - 1;
-}
-
-VOID
-CVfrErrorHandle::PrintMsg (
- IN UINT32 LineNum,
- IN CHAR8 *TokName,
- IN CONST CHAR8 *MsgType,
- IN CONST CHAR8 *ErrorMsg
- )
-{
- CHAR8 *FileName = NULL;
- UINT32 FileLine;
-
- if (strncmp ("Warning", MsgType, strlen ("Warning")) == 0) {
- VerboseMsg ((CHAR8 *) ErrorMsg);
- return;
- }
- GetFileNameLineNum (LineNum, &FileName, &FileLine);
- Error (FileName, FileLine, 0x3000, TokName, (CHAR8 *) "\t%s\n", (CHAR8 *) ErrorMsg);
-}
-
-UINT8
-CVfrErrorHandle::HandleError (
- IN EFI_VFR_RETURN_CODE ErrorCode,
- IN UINT32 LineNum,
- IN CHAR8 *TokName
- )
-{
- UINT32 Index;
- CHAR8 *FileName = NULL;
- UINT32 FileLine;
- CONST CHAR8 *ErrorMsg = NULL;
-
- if (mVfrErrorHandleTable == NULL) {
- return 1;
- }
-
- for (Index = 0; mVfrErrorHandleTable[Index].mErrorCode != VFR_RETURN_CODEUNDEFINED; Index++) {
- if (ErrorCode == mVfrErrorHandleTable[Index].mErrorCode) {
- ErrorMsg = mVfrErrorHandleTable[Index].mErrorMsg;
- break;
- }
- }
-
- if (ErrorMsg != NULL) {
- GetFileNameLineNum (LineNum, &FileName, &FileLine);
- Error (FileName, FileLine, 0x3000, TokName, (CHAR8 *) "\t%s\n", (CHAR8 *) ErrorMsg);
- return 1;
- } else {
- return 0;
- }
-}
-
-UINT8
-CVfrErrorHandle::HandleWarning (
- IN EFI_VFR_WARNING_CODE WarningCode,
- IN UINT32 LineNum,
- IN CHAR8 *TokName
- )
-{
- UINT32 Index;
- CHAR8 *FileName = NULL;
- UINT32 FileLine;
- CONST CHAR8 *WarningMsg = NULL;
-
- if (mVfrWarningHandleTable == NULL) {
- return 1;
- }
-
- GetFileNameLineNum (LineNum, &FileName, &FileLine);
-
- if (mWarningAsError) {
- Error (FileName, FileLine, 0x2220, "warning treated as error", NULL);
- }
-
- for (Index = 0; mVfrWarningHandleTable[Index].mWarningCode != VFR_WARNING_CODEUNDEFINED; Index++) {
- if (WarningCode == mVfrWarningHandleTable[Index].mWarningCode) {
- WarningMsg = mVfrWarningHandleTable[Index].mWarningMsg;
- break;
- }
- }
-
- if (WarningMsg != NULL) {
- Warning (FileName, FileLine, 0, TokName, (CHAR8 *) "\t%s\n", (CHAR8 *) WarningMsg);
- return 1;
- } else {
- return 0;
- }
-}
-
-CVfrErrorHandle gCVfrErrorHandle;
diff --git a/BaseTools/Source/C/VfrCompile/VfrError.h b/BaseTools/Source/C/VfrCompile/VfrError.h
deleted file mode 100644
index 8e73e2e997..0000000000
--- a/BaseTools/Source/C/VfrCompile/VfrError.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/** @file
-
- VfrCompiler Error definition
-
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _VFRERROR_H_
-#define _VFRERROR_H_
-
-#include "Common/UefiBaseTypes.h"
-
-typedef enum {
- VFR_RETURN_SUCCESS = 0,
- VFR_RETURN_ERROR_SKIPED,
- VFR_RETURN_FATAL_ERROR,
- VFR_RETURN_MISMATCHED,
- VFR_RETURN_INVALID_PARAMETER,
- VFR_RETURN_OUT_FOR_RESOURCES,
- VFR_RETURN_UNSUPPORTED,
- VFR_RETURN_REDEFINED,
- VFR_RETURN_FORMID_REDEFINED,
- VFR_RETURN_QUESTIONID_REDEFINED,
- VFR_RETURN_VARSTOREID_REDEFINED,
- VFR_RETURN_UNDEFINED,
- VFR_RETURN_VAR_NOTDEFINED_BY_QUESTION,
- VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR,
- VFR_RETURN_GET_EFIVARSTORE_ERROR,
- VFR_RETURN_EFIVARSTORE_USE_ERROR,
- VFR_RETURN_EFIVARSTORE_SIZE_ERROR,
- VFR_RETURN_GET_NVVARSTORE_ERROR,
- VFR_RETURN_QVAR_REUSE,
- VFR_RETURN_FLAGS_UNSUPPORTED,
- VFR_RETURN_ERROR_ARRARY_NUM,
- VFR_RETURN_DATA_STRING_ERROR,
- VFR_RETURN_DEFAULT_VALUE_REDEFINED,
- VFR_RETURN_CONSTANT_ONLY,
- VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR,
- VFR_RETURN_CODEUNDEFINED
-} EFI_VFR_RETURN_CODE;
-
-typedef enum {
- VFR_WARNING_DEFAULT_VALUE_REDEFINED = 0,
- VFR_WARNING_CODEUNDEFINED
-} EFI_VFR_WARNING_CODE;
-
-typedef struct _SVFR_ERROR_HANDLE {
- EFI_VFR_RETURN_CODE mErrorCode;
- CONST CHAR8 *mErrorMsg;
-} SVFR_ERROR_HANDLE;
-
-typedef struct _SVFR_WARNING_HANDLE {
- EFI_VFR_WARNING_CODE mWarningCode;
- CONST CHAR8 *mWarningMsg;
-} SVFR_WARNING_HANDLE;
-
-struct SVfrFileScopeRecord {
- CHAR8 *mFileName;
- UINT32 mWholeScopeLine;
- UINT32 mScopeLineStart;
- SVfrFileScopeRecord *mNext;
-
- SVfrFileScopeRecord (IN CHAR8 *, IN UINT32);
- ~SVfrFileScopeRecord();
-};
-
-class CVfrErrorHandle {
-private:
- CHAR8 *mInputFileName;
- SVFR_ERROR_HANDLE *mVfrErrorHandleTable;
- SVFR_WARNING_HANDLE *mVfrWarningHandleTable;
- SVfrFileScopeRecord *mScopeRecordListHead;
- SVfrFileScopeRecord *mScopeRecordListTail;
- BOOLEAN mWarningAsError;
-
-public:
- CVfrErrorHandle (VOID);
- ~CVfrErrorHandle (VOID);
-
- VOID SetWarningAsError (IN BOOLEAN);
- VOID SetInputFile (IN CHAR8 *);
- VOID ParseFileScopeRecord (IN CHAR8 *, IN UINT32);
- VOID GetFileNameLineNum (IN UINT32, OUT CHAR8 **, OUT UINT32 *);
- UINT8 HandleError (IN EFI_VFR_RETURN_CODE, IN UINT32 LineNum = 0, IN CHAR8 *TokName = NULL);
- UINT8 HandleWarning (IN EFI_VFR_WARNING_CODE, IN UINT32 LineNum = 0, IN CHAR8 *TokName = NULL);
- VOID PrintMsg (IN UINT32 LineNum = 0, IN CHAR8 *TokName = NULL, IN CONST CHAR8 *MsgType = "Error", IN CONST CHAR8 *ErrorMsg = "");
-};
-
-#define CHECK_ERROR_RETURN(f, v) do { EFI_VFR_RETURN_CODE r; if ((r = (f)) != (v)) { return r; } } while (0)
-
-extern CVfrErrorHandle gCVfrErrorHandle;
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
deleted file mode 100644
index 7cadf0f42b..0000000000
--- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
+++ /dev/null
@@ -1,1770 +0,0 @@
-/** @file
-
- The definition of CFormPkg's member function
-
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "stdio.h"
-#include "VfrFormPkg.h"
-
-/*
- * The definition of CFormPkg's member function
- */
-
-SPendingAssign::SPendingAssign (
- IN CHAR8 *Key,
- IN VOID *Addr,
- IN UINT32 Len,
- IN UINT32 LineNo,
- IN CONST CHAR8 *Msg
- )
-{
- mKey = NULL;
- mAddr = Addr;
- mLen = Len;
- mFlag = PENDING;
- mLineNo = LineNo;
- mMsg = NULL;
- mNext = NULL;
- if (Key != NULL) {
- mKey = new CHAR8[strlen (Key) + 1];
- if (mKey != NULL) {
- strcpy (mKey, Key);
- }
- }
-
- if (Msg != NULL) {
- mMsg = new CHAR8[strlen (Msg) + 1];
- if (mMsg != NULL) {
- strcpy (mMsg, Msg);
- }
- }
-}
-
-SPendingAssign::~SPendingAssign (
- VOID
- )
-{
- if (mKey != NULL) {
- delete mKey;
- }
- mAddr = NULL;
- mLen = 0;
- mLineNo = 0;
- if (mMsg != NULL) {
- delete mMsg;
- }
- mNext = NULL;
-}
-
-VOID
-SPendingAssign::SetAddrAndLen (
- IN VOID *Addr,
- IN UINT32 LineNo
- )
-{
- mAddr = Addr;
- mLineNo = LineNo;
-}
-
-VOID
-SPendingAssign::AssignValue (
- IN VOID *Addr,
- IN UINT32 Len
- )
-{
- memcpy (mAddr, Addr, (mLen < Len ? mLen : Len));
- mFlag = ASSIGNED;
-}
-
-CHAR8 *
-SPendingAssign::GetKey (
- VOID
- )
-{
- return mKey;
-}
-
-CFormPkg::CFormPkg (
- IN UINT32 BufferSize = 4096
- )
-{
- CHAR8 *BufferStart;
- CHAR8 *BufferEnd;
- SBufferNode *Node;
-
- mPkgLength = 0;
- mBufferNodeQueueHead = NULL;
- mCurrBufferNode = NULL;
-
- Node = new SBufferNode;
- if (Node == NULL) {
- return ;
- }
- BufferStart = new CHAR8[BufferSize];
- if (BufferStart == NULL) {
- return;
- }
- BufferEnd = BufferStart + BufferSize;
-
- memset (BufferStart, 0, BufferSize);
- Node->mBufferStart = BufferStart;
- Node->mBufferEnd = BufferEnd;
- Node->mBufferFree = BufferStart;
- Node->mNext = NULL;
-
- mBufferSize = BufferSize;
- mBufferNodeQueueHead = Node;
- mBufferNodeQueueTail = Node;
- mCurrBufferNode = Node;
-}
-
-CFormPkg::~CFormPkg ()
-{
- SBufferNode *pBNode;
- SPendingAssign *pPNode;
-
- while (mBufferNodeQueueHead != NULL) {
- pBNode = mBufferNodeQueueHead;
- mBufferNodeQueueHead = mBufferNodeQueueHead->mNext;
- if (pBNode->mBufferStart != NULL) {
- delete pBNode->mBufferStart;
- delete pBNode;
- }
- }
- mBufferNodeQueueTail = NULL;
- mCurrBufferNode = NULL;
-
- while (PendingAssignList != NULL) {
- pPNode = PendingAssignList;
- PendingAssignList = PendingAssignList->mNext;
- delete pPNode;
- }
- PendingAssignList = NULL;
-}
-
-SBufferNode *
-CFormPkg::CreateNewNode (
- VOID
- )
-{
- SBufferNode *Node;
-
- Node = new SBufferNode;
- if (Node == NULL) {
- return NULL;
- }
-
- Node->mBufferStart = new CHAR8[mBufferSize];
- if (Node->mBufferStart == NULL) {
- delete Node;
- return NULL;
- } else {
- memset (Node->mBufferStart, 0, mBufferSize);
- Node->mBufferEnd = Node->mBufferStart + mBufferSize;
- Node->mBufferFree = Node->mBufferStart;
- Node->mNext = NULL;
- }
-
- return Node;
-}
-
-CHAR8 *
-CFormPkg::IfrBinBufferGet (
- IN UINT32 Len
- )
-{
- CHAR8 *BinBuffer = NULL;
- SBufferNode *Node = NULL;
-
- if ((Len == 0) || (Len > mBufferSize)) {
- return NULL;
- }
-
- if ((mCurrBufferNode->mBufferFree + Len) <= mCurrBufferNode->mBufferEnd) {
- BinBuffer = mCurrBufferNode->mBufferFree;
- mCurrBufferNode->mBufferFree += Len;
- } else {
- Node = CreateNewNode ();
- if (Node == NULL) {
- return NULL;
- }
-
- if (mBufferNodeQueueTail == NULL) {
- mBufferNodeQueueHead = mBufferNodeQueueTail = Node;
- } else {
- mBufferNodeQueueTail->mNext = Node;
- mBufferNodeQueueTail = Node;
- }
- mCurrBufferNode = Node;
-
- //
- // Now try again.
- //
- BinBuffer = mCurrBufferNode->mBufferFree;
- mCurrBufferNode->mBufferFree += Len;
- }
-
- mPkgLength += Len;
-
- return BinBuffer;
-}
-
-inline
-UINT32
-CFormPkg::GetPkgLength (
- VOID
- )
-{
- return mPkgLength;
-}
-
-VOID
-CFormPkg::Open (
- VOID
- )
-{
- mReadBufferNode = mBufferNodeQueueHead;
- mReadBufferOffset = 0;
-}
-
-VOID
-CFormPkg::Close (
- VOID
- )
-{
- mReadBufferNode = NULL;
- mReadBufferOffset = 0;
-}
-
-UINT32
-CFormPkg::Read (
- IN CHAR8 *Buffer,
- IN UINT32 Size
- )
-{
- UINT32 Index;
-
- if ((Size == 0) || (Buffer == NULL)) {
- return 0;
- }
-
- if (mReadBufferNode == NULL) {
- return 0;
- }
-
- for (Index = 0; Index < Size; Index++) {
- if ((mReadBufferNode->mBufferStart + mReadBufferOffset) < mReadBufferNode->mBufferFree) {
- Buffer[Index] = mReadBufferNode->mBufferStart[mReadBufferOffset++];
- } else {
- if ((mReadBufferNode = mReadBufferNode->mNext) == NULL) {
- return Index;
- } else {
- mReadBufferOffset = 0;
- Index --;
- }
- }
- }
-
- return Size;
-}
-
-EFI_VFR_RETURN_CODE
-CFormPkg::BuildPkgHdr (
- OUT EFI_HII_PACKAGE_HEADER **PkgHdr
- )
-{
- if (PkgHdr == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- if (((*PkgHdr) = new EFI_HII_PACKAGE_HEADER) == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
-
- (*PkgHdr)->Type = EFI_HII_PACKAGE_FORM;
- (*PkgHdr)->Length = mPkgLength + sizeof (EFI_HII_PACKAGE_HEADER);
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CFormPkg::BuildPkg (
- OUT PACKAGE_DATA &TBuffer
- )
-{
-
- CHAR8 *Temp;
- UINT32 Size;
- CHAR8 Buffer[1024];
-
- if (TBuffer.Buffer != NULL) {
- delete TBuffer.Buffer;
- }
-
- TBuffer.Size = mPkgLength;
- TBuffer.Buffer = NULL;
- if (TBuffer.Size != 0) {
- TBuffer.Buffer = new CHAR8[TBuffer.Size];
- } else {
- return VFR_RETURN_SUCCESS;
- }
-
- Temp = TBuffer.Buffer;
- Open ();
- while ((Size = Read (Buffer, 1024)) != 0) {
- memcpy (Temp, Buffer, Size);
- Temp += Size;
- }
- Close ();
- return VFR_RETURN_SUCCESS;
-}
-
-
-EFI_VFR_RETURN_CODE
-CFormPkg::BuildPkg (
- IN FILE *Output,
- IN PACKAGE_DATA *PkgData
- )
-{
- EFI_VFR_RETURN_CODE Ret;
- CHAR8 Buffer[1024];
- UINT32 Size;
- EFI_HII_PACKAGE_HEADER *PkgHdr;
-
- if (Output == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- if ((Ret = BuildPkgHdr(&PkgHdr)) != VFR_RETURN_SUCCESS) {
- return Ret;
- }
- fwrite (PkgHdr, sizeof (EFI_HII_PACKAGE_HEADER), 1, Output);
- delete PkgHdr;
-
- if (PkgData == NULL) {
- Open ();
- while ((Size = Read (Buffer, 1024)) != 0) {
- fwrite (Buffer, Size, 1, Output);
- }
- Close ();
- } else {
- fwrite (PkgData->Buffer, PkgData->Size, 1, Output);
- }
-
- return VFR_RETURN_SUCCESS;
-}
-
-VOID
-CFormPkg::_WRITE_PKG_LINE (
- IN FILE *pFile,
- IN UINT32 LineBytes,
- IN CONST CHAR8 *LineHeader,
- IN CHAR8 *BlkBuf,
- IN UINT32 BlkSize
- )
-{
- UINT32 Index;
-
- if ((pFile == NULL) || (LineHeader == NULL) || (BlkBuf == NULL)) {
- return;
- }
-
- for (Index = 0; Index < BlkSize; Index++) {
- if ((Index % LineBytes) == 0) {
- fprintf (pFile, "\n%s", LineHeader);
- }
- fprintf (pFile, "0x%02X, ", (UINT8)BlkBuf[Index]);
- }
-}
-
-VOID
-CFormPkg::_WRITE_PKG_END (
- IN FILE *pFile,
- IN UINT32 LineBytes,
- IN CONST CHAR8 *LineHeader,
- IN CHAR8 *BlkBuf,
- IN UINT32 BlkSize
- )
-{
- UINT32 Index;
-
- if ((BlkSize == 0) || (pFile == NULL) || (LineHeader == NULL) || (BlkBuf == NULL)) {
- return;
- }
-
- for (Index = 0; Index < BlkSize - 1; Index++) {
- if ((Index % LineBytes) == 0) {
- fprintf (pFile, "\n%s", LineHeader);
- }
- fprintf (pFile, "0x%02X, ", (UINT8)BlkBuf[Index]);
- }
-
- if ((Index % LineBytes) == 0) {
- fprintf (pFile, "\n%s", LineHeader);
- }
- fprintf (pFile, "0x%02X\n", (UINT8)BlkBuf[Index]);
-}
-
-#define BYTES_PRE_LINE 0x10
-UINT32 gAdjustOpcodeOffset = 0;
-BOOLEAN gNeedAdjustOpcode = FALSE;
-UINT32 gAdjustOpcodeLen = 0;
-
-EFI_VFR_RETURN_CODE
-CFormPkg::GenCFile (
- IN CHAR8 *BaseName,
- IN FILE *pFile,
- IN PACKAGE_DATA *PkgData
- )
-{
- EFI_VFR_RETURN_CODE Ret;
- CHAR8 Buffer[BYTES_PRE_LINE * 8];
- EFI_HII_PACKAGE_HEADER *PkgHdr;
- UINT32 PkgLength = 0;
- UINT32 ReadSize = 0;
-
- if ((BaseName == NULL) || (pFile == NULL)) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- fprintf (pFile, "\nunsigned char %sBin[] = {\n", BaseName);
-
- if ((Ret = BuildPkgHdr(&PkgHdr)) != VFR_RETURN_SUCCESS) {
- return Ret;
- }
-
- //
- // For framework vfr file, the extension framework header will be added.
- //
- if (VfrCompatibleMode) {
- fprintf (pFile, " // FRAMEWORK PACKAGE HEADER Length\n");
- PkgLength = PkgHdr->Length + sizeof (UINT32) + 2;
- _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT32));
- fprintf (pFile, "\n\n // FRAMEWORK PACKAGE HEADER Type\n");
- PkgLength = 3;
- _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT16));
- } else {
- fprintf (pFile, " // ARRAY LENGTH\n");
- PkgLength = PkgHdr->Length + sizeof (UINT32);
- _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT32));
- }
-
- fprintf (pFile, "\n\n // PACKAGE HEADER\n");
- _WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)PkgHdr, sizeof (EFI_HII_PACKAGE_HEADER));
- PkgLength = sizeof (EFI_HII_PACKAGE_HEADER);
-
- fprintf (pFile, "\n\n // PACKAGE DATA\n");
-
- if (PkgData == NULL) {
- Open ();
- while ((ReadSize = Read ((CHAR8 *)Buffer, BYTES_PRE_LINE * 8)) != 0) {
- PkgLength += ReadSize;
- if (PkgLength < PkgHdr->Length) {
- _WRITE_PKG_LINE (pFile, BYTES_PRE_LINE, " ", Buffer, ReadSize);
- } else {
- _WRITE_PKG_END (pFile, BYTES_PRE_LINE, " ", Buffer, ReadSize);
- }
- }
- Close ();
- } else {
- if (PkgData->Size % BYTES_PRE_LINE != 0) {
- PkgLength = PkgData->Size - (PkgData->Size % BYTES_PRE_LINE);
- _WRITE_PKG_LINE (pFile, BYTES_PRE_LINE, " ", PkgData->Buffer, PkgLength);
- _WRITE_PKG_END (pFile, BYTES_PRE_LINE, " ", PkgData->Buffer + PkgLength, PkgData->Size % BYTES_PRE_LINE);
- } else {
- PkgLength = PkgData->Size - BYTES_PRE_LINE;
- _WRITE_PKG_LINE (pFile, BYTES_PRE_LINE, " ", PkgData->Buffer, PkgLength);
- _WRITE_PKG_END (pFile, BYTES_PRE_LINE, " ", PkgData->Buffer + PkgLength, BYTES_PRE_LINE);
- }
- }
-
- delete PkgHdr;
- fprintf (pFile, "\n};\n");
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CFormPkg::AssignPending (
- IN CHAR8 *Key,
- IN VOID *ValAddr,
- IN UINT32 ValLen,
- IN UINT32 LineNo,
- IN CONST CHAR8 *Msg
- )
-{
- SPendingAssign *pNew;
-
- pNew = new SPendingAssign (Key, ValAddr, ValLen, LineNo, Msg);
- if (pNew == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
-
- pNew->mNext = PendingAssignList;
- PendingAssignList = pNew;
- return VFR_RETURN_SUCCESS;
-}
-
-VOID
-CFormPkg::DoPendingAssign (
- IN CHAR8 *Key,
- IN VOID *ValAddr,
- IN UINT32 ValLen
- )
-{
- SPendingAssign *pNode;
-
- if ((Key == NULL) || (ValAddr == NULL)) {
- return;
- }
-
- for (pNode = PendingAssignList; pNode != NULL; pNode = pNode->mNext) {
- if (strcmp (pNode->mKey, Key) == 0) {
- pNode->AssignValue (ValAddr, ValLen);
- }
- }
-}
-
-bool
-CFormPkg::HavePendingUnassigned (
- VOID
- )
-{
- SPendingAssign *pNode;
-
- for (pNode = PendingAssignList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mFlag == PENDING) {
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-VOID
-CFormPkg::PendingAssignPrintAll (
- VOID
- )
-{
- SPendingAssign *pNode;
-
- for (pNode = PendingAssignList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mFlag == PENDING) {
- gCVfrErrorHandle.PrintMsg (pNode->mLineNo, pNode->mKey, "Error", pNode->mMsg);
- }
- }
-}
-
-SBufferNode *
-CFormPkg::GetBinBufferNodeForAddr (
- IN CHAR8 *BinBuffAddr
- )
-{
- SBufferNode *TmpNode;
-
- TmpNode = mBufferNodeQueueHead;
-
- while (TmpNode != NULL) {
- if (TmpNode->mBufferStart <= BinBuffAddr && TmpNode->mBufferFree >= BinBuffAddr) {
- return TmpNode;
- }
-
- TmpNode = TmpNode->mNext;
- }
-
- return NULL;
-}
-
-SBufferNode *
-CFormPkg::GetNodeBefore(
- IN SBufferNode *CurrentNode
- )
-{
- SBufferNode *FirstNode = mBufferNodeQueueHead;
- SBufferNode *LastNode = mBufferNodeQueueHead;
-
- while (FirstNode != NULL) {
- if (FirstNode == CurrentNode) {
- break;
- }
-
- LastNode = FirstNode;
- FirstNode = FirstNode->mNext;
- }
-
- if (FirstNode == NULL) {
- LastNode = NULL;
- }
-
- return LastNode;
-}
-
-EFI_VFR_RETURN_CODE
-CFormPkg::InsertNodeBefore(
- IN SBufferNode *CurrentNode,
- IN SBufferNode *NewNode
- )
-{
- SBufferNode *LastNode = GetNodeBefore (CurrentNode);
-
- if (LastNode == NULL) {
- return VFR_RETURN_MISMATCHED;
- }
-
- NewNode->mNext = LastNode->mNext;
- LastNode->mNext = NewNode;
-
- return VFR_RETURN_SUCCESS;
-}
-
-CHAR8 *
-CFormPkg::GetBufAddrBaseOnOffset (
- IN UINT32 Offset
- )
-{
- SBufferNode *TmpNode;
- UINT32 TotalBufLen;
- UINT32 CurrentBufLen;
-
- TotalBufLen = 0;
-
- for (TmpNode = mBufferNodeQueueHead; TmpNode != NULL; TmpNode = TmpNode->mNext) {
- CurrentBufLen = TmpNode->mBufferFree - TmpNode->mBufferStart;
- if (Offset >= TotalBufLen && Offset < TotalBufLen + CurrentBufLen) {
- return TmpNode->mBufferStart + (Offset - TotalBufLen);
- }
-
- TotalBufLen += CurrentBufLen;
- }
-
- return NULL;
-}
-
-EFI_VFR_RETURN_CODE
-CFormPkg::AdjustDynamicInsertOpcode (
- IN CHAR8 *LastFormEndAddr,
- IN CHAR8 *InsertOpcodeAddr
- )
-{
- SBufferNode *LastFormEndNode;
- SBufferNode *InsertOpcodeNode;
- SBufferNode *NewRestoreNodeBegin;
- SBufferNode *NewRestoreNodeEnd;
- SBufferNode *NewLastEndNode;
- SBufferNode *TmpNode;
- UINT32 NeedRestoreCodeLen;
-
- NewRestoreNodeEnd = NULL;
-
- LastFormEndNode = GetBinBufferNodeForAddr(LastFormEndAddr);
- InsertOpcodeNode = GetBinBufferNodeForAddr(InsertOpcodeAddr);
-
- if (LastFormEndNode == InsertOpcodeNode) {
- //
- // Create New Node to save the restore opcode.
- //
- NeedRestoreCodeLen = InsertOpcodeAddr - LastFormEndAddr;
- gAdjustOpcodeLen = NeedRestoreCodeLen;
- NewRestoreNodeBegin = CreateNewNode ();
- if (NewRestoreNodeBegin == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
- memcpy (NewRestoreNodeBegin->mBufferFree, LastFormEndAddr, NeedRestoreCodeLen);
- NewRestoreNodeBegin->mBufferFree += NeedRestoreCodeLen;
-
- //
- // Override the restore buffer data.
- //
- memcpy (LastFormEndAddr, InsertOpcodeAddr, InsertOpcodeNode->mBufferFree - InsertOpcodeAddr);
- InsertOpcodeNode->mBufferFree -= NeedRestoreCodeLen;
- memset (InsertOpcodeNode->mBufferFree, 0, NeedRestoreCodeLen);
- } else {
- //
- // Create New Node to save the restore opcode.
- //
- NeedRestoreCodeLen = LastFormEndNode->mBufferFree - LastFormEndAddr;
- gAdjustOpcodeLen = NeedRestoreCodeLen;
- NewRestoreNodeBegin = CreateNewNode ();
- if (NewRestoreNodeBegin == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
- memcpy (NewRestoreNodeBegin->mBufferFree, LastFormEndAddr, NeedRestoreCodeLen);
- NewRestoreNodeBegin->mBufferFree += NeedRestoreCodeLen;
- //
- // Override the restore buffer data.
- //
- LastFormEndNode->mBufferFree -= NeedRestoreCodeLen;
- //
- // Link the restore data to new node.
- //
- NewRestoreNodeBegin->mNext = LastFormEndNode->mNext;
-
- //
- // Count the Adjust opcode len.
- //
- TmpNode = LastFormEndNode->mNext;
- while (TmpNode != InsertOpcodeNode) {
- gAdjustOpcodeLen += TmpNode->mBufferFree - TmpNode->mBufferStart;
- TmpNode = TmpNode->mNext;
- }
-
- //
- // Create New Node to save the last node of restore opcode.
- //
- NeedRestoreCodeLen = InsertOpcodeAddr - InsertOpcodeNode->mBufferStart;
- gAdjustOpcodeLen += NeedRestoreCodeLen;
- if (NeedRestoreCodeLen > 0) {
- NewRestoreNodeEnd = CreateNewNode ();
- if (NewRestoreNodeEnd == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
- memcpy (NewRestoreNodeEnd->mBufferFree, InsertOpcodeNode->mBufferStart, NeedRestoreCodeLen);
- NewRestoreNodeEnd->mBufferFree += NeedRestoreCodeLen;
- //
- // Override the restore buffer data.
- //
- memcpy (InsertOpcodeNode->mBufferStart, InsertOpcodeAddr, InsertOpcodeNode->mBufferFree - InsertOpcodeAddr);
- InsertOpcodeNode->mBufferFree -= InsertOpcodeAddr - InsertOpcodeNode->mBufferStart;
-
- //
- // Insert the last restore data node.
- //
- TmpNode = GetNodeBefore (InsertOpcodeNode);
- if (TmpNode == LastFormEndNode) {
- NewRestoreNodeBegin->mNext = NewRestoreNodeEnd;
- } else {
- TmpNode->mNext = NewRestoreNodeEnd;
- }
- //
- // Connect the dynamic opcode node to the node before last form end node.
- //
- LastFormEndNode->mNext = InsertOpcodeNode;
- }
- }
-
- if (mBufferNodeQueueTail->mBufferFree - mBufferNodeQueueTail->mBufferStart > 2) {
- //
- // End form set opcode all in the mBufferNodeQueueTail node.
- //
- NewLastEndNode = CreateNewNode ();
- if (NewLastEndNode == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
- NewLastEndNode->mBufferStart[0] = 0x29;
- NewLastEndNode->mBufferStart[1] = 0x02;
- NewLastEndNode->mBufferFree += 2;
-
- mBufferNodeQueueTail->mBufferFree -= 2;
-
- mBufferNodeQueueTail->mNext = NewRestoreNodeBegin;
- if (NewRestoreNodeEnd != NULL) {
- NewRestoreNodeEnd->mNext = NewLastEndNode;
- } else {
- NewRestoreNodeBegin->mNext = NewLastEndNode;
- }
-
- mBufferNodeQueueTail = NewLastEndNode;
- } else if (mBufferNodeQueueTail->mBufferFree - mBufferNodeQueueTail->mBufferStart == 2) {
- TmpNode = GetNodeBefore(mBufferNodeQueueTail);
- TmpNode->mNext = NewRestoreNodeBegin;
- if (NewRestoreNodeEnd != NULL) {
- NewRestoreNodeEnd->mNext = mBufferNodeQueueTail;
- } else {
- NewRestoreNodeBegin->mNext = mBufferNodeQueueTail;
- }
- }
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CFormPkg::DeclarePendingQuestion (
- IN CVfrVarDataTypeDB &lCVfrVarDataTypeDB,
- IN CVfrDataStorage &lCVfrDataStorage,
- IN CVfrQuestionDB &lCVfrQuestionDB,
- IN EFI_GUID *LocalFormSetGuid,
- IN UINT32 LineNo,
- OUT CHAR8 **InsertOpcodeAddr
- )
-{
- SPendingAssign *pNode;
- CHAR8 *VarStr;
- UINT32 ArrayIdx;
- CHAR8 FName[MAX_NAME_LEN];
- CHAR8 *SName;
- CHAR8 *NewStr;
- UINT32 ShrinkSize;
- EFI_VFR_RETURN_CODE ReturnCode;
- EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
- EFI_VARSTORE_ID VarStoreId = EFI_VARSTORE_ID_INVALID;
-
- //
- // Declare all questions as Numeric in DisableIf True
- //
- // DisableIf
- CIfrDisableIf DIObj;
- DIObj.SetLineNo (LineNo);
- *InsertOpcodeAddr = DIObj.GetObjBinAddr ();
-
- //TrueOpcode
- CIfrTrue TObj (LineNo);
-
- // Declare Numeric qeustion for each undefined question.
- for (pNode = PendingAssignList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mFlag == PENDING) {
- CIfrNumeric CNObj;
- EFI_VARSTORE_INFO Info;
- EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
-
- CNObj.SetLineNo (LineNo);
- CNObj.SetPrompt (0x0);
- CNObj.SetHelp (0x0);
-
- //
- // Register this question, assume it is normal question, not date or time question
- //
- VarStr = pNode->mKey;
- ReturnCode = lCVfrQuestionDB.RegisterQuestion (NULL, VarStr, QId);
- if (ReturnCode != VFR_RETURN_SUCCESS) {
- gCVfrErrorHandle.HandleError (ReturnCode, pNode->mLineNo, pNode->mKey);
- return ReturnCode;
- }
-
-#ifdef VFREXP_DEBUG
- printf ("Undefined Question name is %s and Id is 0x%x\n", VarStr, QId);
-#endif
- //
- // Get Question Info, framework vfr VarName == StructName
- //
- ReturnCode = lCVfrVarDataTypeDB.ExtractFieldNameAndArrary (VarStr, FName, ArrayIdx);
- if (ReturnCode != VFR_RETURN_SUCCESS) {
- gCVfrErrorHandle.PrintMsg (pNode->mLineNo, pNode->mKey, "Error", "Var string is not the valid C variable");
- return ReturnCode;
- }
- //
- // Get VarStoreType
- //
- ReturnCode = lCVfrDataStorage.GetVarStoreId (FName, &Info.mVarStoreId);
- if (ReturnCode == VFR_RETURN_UNDEFINED) {
- lCVfrDataStorage.DeclareBufferVarStore (
- FName,
- LocalFormSetGuid,
- &lCVfrVarDataTypeDB,
- FName,
- EFI_VARSTORE_ID_INVALID,
- FALSE
- );
- ReturnCode = lCVfrDataStorage.GetVarStoreId (FName, &Info.mVarStoreId, LocalFormSetGuid);
- }
- if (ReturnCode != VFR_RETURN_SUCCESS) {
- gCVfrErrorHandle.PrintMsg (pNode->mLineNo, FName, "Error", "Var Store Type is not defined");
- return ReturnCode;
- }
- VarStoreType = lCVfrDataStorage.GetVarStoreType (Info.mVarStoreId);
-
- if (*VarStr == '\0' && ArrayIdx != INVALID_ARRAY_INDEX) {
- ReturnCode = lCVfrDataStorage.GetNameVarStoreInfo (&Info, ArrayIdx);
- } else {
- if (VarStoreType == EFI_VFR_VARSTORE_EFI) {
- ReturnCode = lCVfrDataStorage.GetEfiVarStoreInfo (&Info);
- } else if (VarStoreType == EFI_VFR_VARSTORE_BUFFER) {
- VarStr = pNode->mKey;
- //convert VarStr with store name to VarStr with structure name
- ReturnCode = lCVfrDataStorage.GetBufferVarStoreDataTypeName (Info.mVarStoreId, &SName);
- if (ReturnCode == VFR_RETURN_SUCCESS) {
- NewStr = new CHAR8[strlen (VarStr) + strlen (SName) + 1];
- NewStr[0] = '\0';
- strcpy (NewStr, SName);
- strcat (NewStr, VarStr + strlen (FName));
- ReturnCode = lCVfrVarDataTypeDB.GetDataFieldInfo (NewStr, Info.mInfo.mVarOffset, Info.mVarType, Info.mVarTotalSize);
- delete NewStr;
- }
- } else {
- ReturnCode = VFR_RETURN_UNSUPPORTED;
- }
- }
- if (ReturnCode != VFR_RETURN_SUCCESS) {
- gCVfrErrorHandle.HandleError (ReturnCode, pNode->mLineNo, pNode->mKey);
- return ReturnCode;
- }
-
- CNObj.SetQuestionId (QId);
- CNObj.SetVarStoreInfo (&Info);
- //
- // Numeric doesn't support BOOLEAN data type.
- // BOOLEAN type has the same data size to UINT8.
- //
- if (Info.mVarType == EFI_IFR_TYPE_BOOLEAN) {
- Info.mVarType = EFI_IFR_TYPE_NUM_SIZE_8;
- }
- CNObj.SetFlags (0, Info.mVarType);
- //
- // Use maximum value not to limit the vaild value for the undefined question.
- //
- switch (Info.mVarType) {
- case EFI_IFR_TYPE_NUM_SIZE_64:
- CNObj.SetMinMaxStepData ((UINT64) 0, (UINT64) -1 , (UINT64) 0);
- ShrinkSize = 0;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_32:
- CNObj.SetMinMaxStepData ((UINT32) 0, (UINT32) -1 , (UINT32) 0);
- ShrinkSize = 12;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_16:
- CNObj.SetMinMaxStepData ((UINT16) 0, (UINT16) -1 , (UINT16) 0);
- ShrinkSize = 18;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_8:
- CNObj.SetMinMaxStepData ((UINT8) 0, (UINT8) -1 , (UINT8) 0);
- ShrinkSize = 21;
- break;
- default:
- break;
- }
- CNObj.ShrinkBinSize (ShrinkSize);
-
- //
- // For undefined Efi VarStore type question
- // Append the extended guided opcode to contain VarName
- //
- if (VarStoreType == EFI_VFR_VARSTORE_EFI || VfrCompatibleMode) {
- CIfrVarEqName CVNObj (QId, Info.mInfo.mVarName);
- CVNObj.SetLineNo (LineNo);
- }
-
- //
- // End for Numeric
- //
- CIfrEnd CEObj;
- CEObj.SetLineNo (LineNo);
- }
- }
-
- //
- // End for DisableIf
- //
- CIfrEnd SEObj;
- SEObj.SetLineNo (LineNo);
-
- return VFR_RETURN_SUCCESS;
-}
-
-CFormPkg gCFormPkg;
-
-SIfrRecord::SIfrRecord (
- VOID
- )
-{
- mIfrBinBuf = NULL;
- mBinBufLen = 0;
- mLineNo = 0xFFFFFFFF;
- mOffset = 0xFFFFFFFF;
- mNext = NULL;
-}
-
-SIfrRecord::~SIfrRecord (
- VOID
- )
-{
- if (mIfrBinBuf != NULL) {
- //delete mIfrBinBuf;
- mIfrBinBuf = NULL;
- }
- mLineNo = 0xFFFFFFFF;
- mOffset = 0xFFFFFFFF;
- mBinBufLen = 0;
- mNext = NULL;
-}
-
-CIfrRecordInfoDB::CIfrRecordInfoDB (
- VOID
- )
-{
- mSwitch = TRUE;
- mRecordCount = EFI_IFR_RECORDINFO_IDX_START;
- mIfrRecordListHead = NULL;
- mIfrRecordListTail = NULL;
-}
-
-CIfrRecordInfoDB::~CIfrRecordInfoDB (
- VOID
- )
-{
- SIfrRecord *pNode;
-
- while (mIfrRecordListHead != NULL) {
- pNode = mIfrRecordListHead;
- mIfrRecordListHead = mIfrRecordListHead->mNext;
- delete pNode;
- }
-}
-
-SIfrRecord *
-CIfrRecordInfoDB::GetRecordInfoFromIdx (
- IN UINT32 RecordIdx
- )
-{
- UINT32 Idx;
- SIfrRecord *pNode = NULL;
-
- if (RecordIdx == EFI_IFR_RECORDINFO_IDX_INVALUD) {
- return NULL;
- }
-
- for (Idx = (EFI_IFR_RECORDINFO_IDX_START + 1), pNode = mIfrRecordListHead;
- (Idx != RecordIdx) && (pNode != NULL);
- Idx++, pNode = pNode->mNext)
- ;
-
- return pNode;
-}
-
-UINT32
-CIfrRecordInfoDB::IfrRecordRegister (
- IN UINT32 LineNo,
- IN CHAR8 *IfrBinBuf,
- IN UINT8 BinBufLen,
- IN UINT32 Offset
- )
-{
- SIfrRecord *pNew;
-
- if (mSwitch == FALSE) {
- return EFI_IFR_RECORDINFO_IDX_INVALUD;
- }
-
- if ((pNew = new SIfrRecord) == NULL) {
- return EFI_IFR_RECORDINFO_IDX_INVALUD;
- }
-
- if (mIfrRecordListHead == NULL) {
- mIfrRecordListHead = pNew;
- mIfrRecordListTail = pNew;
- } else {
- mIfrRecordListTail->mNext = pNew;
- mIfrRecordListTail = pNew;
- }
- mRecordCount++;
-
- return mRecordCount;
-}
-
-VOID
-CIfrRecordInfoDB::IfrRecordInfoUpdate (
- IN UINT32 RecordIdx,
- IN UINT32 LineNo,
- IN CHAR8 *BinBuf,
- IN UINT8 BinBufLen,
- IN UINT32 Offset
- )
-{
- SIfrRecord *pNode;
- SIfrRecord *Prev;
-
- if ((pNode = GetRecordInfoFromIdx (RecordIdx)) == NULL) {
- return;
- }
-
- if (LineNo == 0) {
- //
- // Line number is not specified explicitly, try to use line number of previous opcode
- //
- Prev = GetRecordInfoFromIdx (RecordIdx - 1);
- if (Prev != NULL) {
- LineNo = Prev->mLineNo;
- }
- }
-
- pNode->mLineNo = LineNo;
- pNode->mOffset = Offset;
- pNode->mBinBufLen = BinBufLen;
- pNode->mIfrBinBuf = BinBuf;
-
-}
-
-VOID
-CIfrRecordInfoDB::IfrRecordOutput (
- OUT PACKAGE_DATA &TBuffer
- )
-{
- CHAR8 *Temp;
- SIfrRecord *pNode;
-
- if (TBuffer.Buffer != NULL) {
- delete TBuffer.Buffer;
- }
-
- TBuffer.Size = 0;
- TBuffer.Buffer = NULL;
-
-
- if (mSwitch == FALSE) {
- return;
- }
-
- for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {
- TBuffer.Size += pNode->mBinBufLen;
- }
-
- if (TBuffer.Size != 0) {
- TBuffer.Buffer = new CHAR8[TBuffer.Size];
- } else {
- return;
- }
-
- Temp = TBuffer.Buffer;
-
- for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mIfrBinBuf != NULL) {
- memcpy (Temp, pNode->mIfrBinBuf, pNode->mBinBufLen);
- Temp += pNode->mBinBufLen;
- }
- }
-
- return;
-}
-
-VOID
-CIfrRecordInfoDB::IfrRecordOutput (
- IN FILE *File,
- IN UINT32 LineNo
- )
-{
- SIfrRecord *pNode;
- UINT8 Index;
- UINT32 TotalSize;
-
- if (mSwitch == FALSE) {
- return;
- }
-
- if (File == NULL) {
- return;
- }
-
- TotalSize = 0;
-
- for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mLineNo == LineNo || LineNo == 0) {
- fprintf (File, ">%08X: ", pNode->mOffset);
- TotalSize += pNode->mBinBufLen;
- if (pNode->mIfrBinBuf != NULL) {
- for (Index = 0; Index < pNode->mBinBufLen; Index++) {
- fprintf (File, "%02X ", (UINT8)(pNode->mIfrBinBuf[Index]));
- }
- }
- fprintf (File, "\n");
- }
- }
-
- if (LineNo == 0) {
- fprintf (File, "\nTotal Size of all record is 0x%08X\n", TotalSize);
- }
-}
-
-//
-// for framework vfr file
-// adjust opcode sequence for uefi IFR format
-// adjust inconsistent and varstore into the right position.
-//
-BOOLEAN
-CIfrRecordInfoDB::CheckQuestionOpCode (
- IN UINT8 OpCode
- )
-{
- switch (OpCode) {
- case EFI_IFR_CHECKBOX_OP:
- case EFI_IFR_NUMERIC_OP:
- case EFI_IFR_PASSWORD_OP:
- case EFI_IFR_ONE_OF_OP:
- case EFI_IFR_ACTION_OP:
- case EFI_IFR_STRING_OP:
- case EFI_IFR_DATE_OP:
- case EFI_IFR_TIME_OP:
- case EFI_IFR_ORDERED_LIST_OP:
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-BOOLEAN
-CIfrRecordInfoDB::CheckIdOpCode (
- IN UINT8 OpCode
- )
-{
- switch (OpCode) {
- case EFI_IFR_EQ_ID_VAL_OP:
- case EFI_IFR_EQ_ID_ID_OP:
- case EFI_IFR_EQ_ID_VAL_LIST_OP:
- case EFI_IFR_QUESTION_REF1_OP:
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-EFI_QUESTION_ID
-CIfrRecordInfoDB::GetOpcodeQuestionId (
- IN EFI_IFR_OP_HEADER *OpHead
- )
-{
- EFI_IFR_QUESTION_HEADER *QuestionHead;
-
- QuestionHead = (EFI_IFR_QUESTION_HEADER *) (OpHead + 1);
-
- return QuestionHead->QuestionId;
-}
-
-SIfrRecord *
-CIfrRecordInfoDB::GetRecordInfoFromOffset (
- IN UINT32 Offset
- )
-{
- SIfrRecord *pNode = NULL;
-
- for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mOffset == Offset) {
- return pNode;
- }
- }
-
- return pNode;
-}
-
-/*
- Add just the op code position.
-
- From
-
- | form end opcode + end of if opcode for form ... + Dynamic opcode + form set end opcode |
-
- To
-
- | Dynamic opcode + form end opcode + end of if opcode for form ... + form set end opcode |
-
-*/
-BOOLEAN
-CIfrRecordInfoDB::IfrAdjustDynamicOpcodeInRecords (
- VOID
- )
-{
- UINT32 OpcodeOffset;
- SIfrRecord *pNode, *pPreNode;
- SIfrRecord *pStartNode, *pNodeBeforeStart;
- SIfrRecord *pEndNode;
-
- pStartNode = NULL;
- pEndNode = NULL;
- OpcodeOffset = 0;
-
- //
- // Base on the offset info to get the node.
- //
- for (pNode = mIfrRecordListHead; pNode->mNext != NULL; pPreNode = pNode,pNode = pNode->mNext) {
- if (OpcodeOffset == gAdjustOpcodeOffset) {
- pStartNode = pNode;
- pNodeBeforeStart = pPreNode;
- } else if (OpcodeOffset == gAdjustOpcodeOffset + gAdjustOpcodeLen) {
- pEndNode = pPreNode;
- }
-
- OpcodeOffset += pNode->mBinBufLen;
- }
-
- //
- // Check the value.
- //
- if (pEndNode == NULL || pStartNode == NULL) {
- return FALSE;
- }
-
- //
- // Adjust the node. pPreNode save the Node before mIfrRecordListTail
- //
- pNodeBeforeStart->mNext = pEndNode->mNext;
- pPreNode->mNext = pStartNode;
- pEndNode->mNext = mIfrRecordListTail;
-
- return TRUE;
-}
-
-VOID
-CIfrRecordInfoDB::IfrAdjustOffsetForRecord (
- VOID
- )
-{
- UINT32 OpcodeOffset;
- SIfrRecord *pNode;
-
- OpcodeOffset = 0;
- for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {
- pNode->mOffset = OpcodeOffset;
- OpcodeOffset += pNode->mBinBufLen;
- }
-}
-
-EFI_VFR_RETURN_CODE
-CIfrRecordInfoDB::IfrRecordAdjust (
- VOID
- )
-{
- SIfrRecord *pNode, *preNode;
- SIfrRecord *uNode, *tNode;
- EFI_IFR_OP_HEADER *OpHead, *tOpHead;
- EFI_QUESTION_ID QuestionId;
- UINT32 StackCount;
- UINT32 QuestionScope;
- UINT32 OpcodeOffset;
- CHAR8 ErrorMsg[MAX_STRING_LEN] = {0, };
- EFI_VFR_RETURN_CODE Status;
-
- //
- // Init local variable
- //
- Status = VFR_RETURN_SUCCESS;
- pNode = mIfrRecordListHead;
- preNode = pNode;
- QuestionScope = 0;
- while (pNode != NULL) {
- OpHead = (EFI_IFR_OP_HEADER *) pNode->mIfrBinBuf;
-
- //
- // make sure the inconsistent opcode in question scope
- //
- if (QuestionScope > 0) {
- QuestionScope += OpHead->Scope;
- if (OpHead->OpCode == EFI_IFR_END_OP) {
- QuestionScope --;
- }
- }
-
- if (CheckQuestionOpCode (OpHead->OpCode)) {
- QuestionScope = 1;
- }
- //
- // for the inconsistent opcode not in question scope, adjust it
- //
- if (OpHead->OpCode == EFI_IFR_INCONSISTENT_IF_OP && QuestionScope == 0) {
- //
- // for inconsistent opcode not in question scope
- //
-
- //
- // Count inconsistent opcode Scope
- //
- StackCount = OpHead->Scope;
- QuestionId = EFI_QUESTION_ID_INVALID;
- tNode = pNode;
- while (tNode != NULL && StackCount > 0) {
- tNode = tNode->mNext;
- tOpHead = (EFI_IFR_OP_HEADER *) tNode->mIfrBinBuf;
- //
- // Calculate Scope Number
- //
- StackCount += tOpHead->Scope;
- if (tOpHead->OpCode == EFI_IFR_END_OP) {
- StackCount --;
- }
- //
- // by IdEqual opcode to get QuestionId
- //
- if (QuestionId == EFI_QUESTION_ID_INVALID &&
- CheckIdOpCode (tOpHead->OpCode)) {
- QuestionId = *(EFI_QUESTION_ID *) (tOpHead + 1);
- }
- }
- if (tNode == NULL || QuestionId == EFI_QUESTION_ID_INVALID) {
- //
- // report error; not found
- //
- sprintf (ErrorMsg, "Inconsistent OpCode Record list invalid QuestionId is 0x%X", QuestionId);
- gCVfrErrorHandle.PrintMsg (0, NULL, "Error", ErrorMsg);
- Status = VFR_RETURN_MISMATCHED;
- break;
- }
- //
- // extract inconsistent opcode list
- // pNode is Incosistent opcode, tNode is End Opcode
- //
-
- //
- // insert inconsistent opcode list into the right question scope by questionid
- //
- for (uNode = mIfrRecordListHead; uNode != NULL; uNode = uNode->mNext) {
- tOpHead = (EFI_IFR_OP_HEADER *) uNode->mIfrBinBuf;
- if (CheckQuestionOpCode (tOpHead->OpCode) &&
- (QuestionId == GetOpcodeQuestionId (tOpHead))) {
- break;
- }
- }
- //
- // insert inconsistent opcode list and check LATE_CHECK flag
- //
- if (uNode != NULL) {
- if ((((EFI_IFR_QUESTION_HEADER *)(tOpHead + 1))->Flags & 0x20) != 0) {
- //
- // if LATE_CHECK flag is set, change inconsistent to nosumbit
- //
- OpHead->OpCode = EFI_IFR_NO_SUBMIT_IF_OP;
- }
-
- //
- // skip the default storage for Date and Time
- //
- if ((uNode->mNext != NULL) && (*uNode->mNext->mIfrBinBuf == EFI_IFR_DEFAULT_OP)) {
- uNode = uNode->mNext;
- }
-
- preNode->mNext = tNode->mNext;
- tNode->mNext = uNode->mNext;
- uNode->mNext = pNode;
- //
- // reset pNode to head list, scan the whole list again.
- //
- pNode = mIfrRecordListHead;
- preNode = pNode;
- QuestionScope = 0;
- continue;
- } else {
- //
- // not found matched question id, report error
- //
- sprintf (ErrorMsg, "QuestionId required by Inconsistent OpCode is not found. QuestionId is 0x%X", QuestionId);
- gCVfrErrorHandle.PrintMsg (0, NULL, "Error", ErrorMsg);
- Status = VFR_RETURN_MISMATCHED;
- break;
- }
- } else if (OpHead->OpCode == EFI_IFR_VARSTORE_OP ||
- OpHead->OpCode == EFI_IFR_VARSTORE_EFI_OP) {
- //
- // for new added group of varstore opcode
- //
- tNode = pNode;
- while (tNode->mNext != NULL) {
- tOpHead = (EFI_IFR_OP_HEADER *) tNode->mNext->mIfrBinBuf;
- if (tOpHead->OpCode != EFI_IFR_VARSTORE_OP &&
- tOpHead->OpCode != EFI_IFR_VARSTORE_EFI_OP) {
- break;
- }
- tNode = tNode->mNext;
- }
-
- if (tNode->mNext == NULL) {
- //
- // invalid IfrCode, IfrCode end by EndOpCode
- //
- gCVfrErrorHandle.PrintMsg (0, NULL, "Error", "No found End Opcode in the end");
- Status = VFR_RETURN_MISMATCHED;
- break;
- }
-
- if (tOpHead->OpCode != EFI_IFR_END_OP) {
- //
- // not new added varstore, which are not needed to be adjust.
- //
- preNode = tNode;
- pNode = tNode->mNext;
- continue;
- } else {
- //
- // move new added varstore opcode to the position befor form opcode
- // varstore opcode between pNode and tNode
- //
-
- //
- // search form opcode from begin
- //
- for (uNode = mIfrRecordListHead; uNode->mNext != NULL; uNode = uNode->mNext) {
- tOpHead = (EFI_IFR_OP_HEADER *) uNode->mNext->mIfrBinBuf;
- if (tOpHead->OpCode == EFI_IFR_FORM_OP) {
- break;
- }
- }
- //
- // Insert varstore opcode beform form opcode if form opcode is found
- //
- if (uNode->mNext != NULL) {
- preNode->mNext = tNode->mNext;
- tNode->mNext = uNode->mNext;
- uNode->mNext = pNode;
- //
- // reset pNode to head list, scan the whole list again.
- //
- pNode = mIfrRecordListHead;
- preNode = pNode;
- QuestionScope = 0;
- continue;
- } else {
- //
- // not found form, continue scan IfrRecord list
- //
- preNode = tNode;
- pNode = tNode->mNext;
- continue;
- }
- }
- }
- //
- // next node
- //
- preNode = pNode;
- pNode = pNode->mNext;
- }
-
- //
- // Update Ifr Opcode Offset
- //
- if (Status == VFR_RETURN_SUCCESS) {
- IfrAdjustOffsetForRecord ();
- }
- return Status;
-}
-
-CIfrRecordInfoDB gCIfrRecordInfoDB;
-
-VOID
-CIfrObj::_EMIT_PENDING_OBJ (
- VOID
- )
-{
- CHAR8 *ObjBinBuf = NULL;
-
- //
- // do nothing
- //
- if (!mDelayEmit || !gCreateOp) {
- return;
- }
-
- mPkgOffset = gCFormPkg.GetPkgLength ();
- //
- // update data buffer to package data
- //
- ObjBinBuf = gCFormPkg.IfrBinBufferGet (mObjBinLen);
- if (ObjBinBuf != NULL) {
- memcpy (ObjBinBuf, mObjBinBuf, mObjBinLen);
- }
-
- //
- // update bin buffer to package data buffer
- //
- if (mObjBinBuf != NULL) {
- delete mObjBinBuf;
- mObjBinBuf = ObjBinBuf;
- }
-
- mDelayEmit = FALSE;
-}
-
-/*
- * The definition of CIfrObj's member function
- */
-static struct {
- UINT8 mSize;
- UINT8 mScope;
-} gOpcodeSizesScopeTable[] = {
- { 0, 0 }, // EFI_IFR_INVALID - 0x00
- { sizeof (EFI_IFR_FORM), 1 }, // EFI_IFR_FORM_OP
- { sizeof (EFI_IFR_SUBTITLE), 1 }, // EFI_IFR_SUBTITLE_OP
- { sizeof (EFI_IFR_TEXT), 0 }, // EFI_IFR_TEXT_OP
- { sizeof (EFI_IFR_IMAGE), 0 }, // EFI_IFR_IMAGE_OP
- { sizeof (EFI_IFR_ONE_OF), 1 }, // EFI_IFR_ONE_OF_OP - 0x05
- { sizeof (EFI_IFR_CHECKBOX), 1}, // EFI_IFR_CHECKBOX_OP
- { sizeof (EFI_IFR_NUMERIC), 1 }, // EFI_IFR_NUMERIC_OP
- { sizeof (EFI_IFR_PASSWORD), 1 }, // EFI_IFR_PASSWORD_OP
- { sizeof (EFI_IFR_ONE_OF_OPTION), 0 }, // EFI_IFR_ONE_OF_OPTION_OP
- { sizeof (EFI_IFR_SUPPRESS_IF), 1 }, // EFI_IFR_SUPPRESS_IF - 0x0A
- { sizeof (EFI_IFR_LOCKED), 0 }, // EFI_IFR_LOCKED_OP
- { sizeof (EFI_IFR_ACTION), 1 }, // EFI_IFR_ACTION_OP
- { sizeof (EFI_IFR_RESET_BUTTON), 1 }, // EFI_IFR_RESET_BUTTON_OP
- { sizeof (EFI_IFR_FORM_SET), 1 }, // EFI_IFR_FORM_SET_OP -0xE
- { sizeof (EFI_IFR_REF), 0 }, // EFI_IFR_REF_OP
- { sizeof (EFI_IFR_NO_SUBMIT_IF), 1}, // EFI_IFR_NO_SUBMIT_IF_OP -0x10
- { sizeof (EFI_IFR_INCONSISTENT_IF), 1 }, // EFI_IFR_INCONSISTENT_IF_OP
- { sizeof (EFI_IFR_EQ_ID_VAL), 0 }, // EFI_IFR_EQ_ID_VAL_OP
- { sizeof (EFI_IFR_EQ_ID_ID), 0 }, // EFI_IFR_EQ_ID_ID_OP
- { sizeof (EFI_IFR_EQ_ID_VAL_LIST), 0 }, // EFI_IFR_EQ_ID_LIST_OP - 0x14
- { sizeof (EFI_IFR_AND), 0 }, // EFI_IFR_AND_OP
- { sizeof (EFI_IFR_OR), 0 }, // EFI_IFR_OR_OP
- { sizeof (EFI_IFR_NOT), 0 }, // EFI_IFR_NOT_OP
- { sizeof (EFI_IFR_RULE), 1 }, // EFI_IFR_RULE_OP
- { sizeof (EFI_IFR_GRAY_OUT_IF), 1 }, // EFI_IFR_GRAYOUT_IF_OP - 0x19
- { sizeof (EFI_IFR_DATE), 1 }, // EFI_IFR_DATE_OP
- { sizeof (EFI_IFR_TIME), 1 }, // EFI_IFR_TIME_OP
- { sizeof (EFI_IFR_STRING), 1 }, // EFI_IFR_STRING_OP
- { sizeof (EFI_IFR_REFRESH), 0 }, // EFI_IFR_REFRESH_OP
- { sizeof (EFI_IFR_DISABLE_IF), 1 }, // EFI_IFR_DISABLE_IF_OP - 0x1E
- { 0, 0 }, // 0x1F
- { sizeof (EFI_IFR_TO_LOWER), 0 }, // EFI_IFR_TO_LOWER_OP - 0x20
- { sizeof (EFI_IFR_TO_UPPER), 0 }, // EFI_IFR_TO_UPPER_OP - 0x21
- { sizeof (EFI_IFR_MAP), 1 }, // EFI_IFR_MAP - 0x22
- { sizeof (EFI_IFR_ORDERED_LIST), 1 }, // EFI_IFR_ORDERED_LIST_OP - 0x23
- { sizeof (EFI_IFR_VARSTORE), 0 }, // EFI_IFR_VARSTORE_OP
- { sizeof (EFI_IFR_VARSTORE_NAME_VALUE), 0 }, // EFI_IFR_VARSTORE_NAME_VALUE_OP
- { sizeof (EFI_IFR_VARSTORE_EFI), 0 }, // EFI_IFR_VARSTORE_EFI_OP
- { sizeof (EFI_IFR_VARSTORE_DEVICE), 1 }, // EFI_IFR_VARSTORE_DEVICE_OP
- { sizeof (EFI_IFR_VERSION), 0 }, // EFI_IFR_VERSION_OP - 0x28
- { sizeof (EFI_IFR_END), 0 }, // EFI_IFR_END_OP
- { sizeof (EFI_IFR_MATCH), 0 }, // EFI_IFR_MATCH_OP - 0x2A
- { sizeof (EFI_IFR_GET), 0 }, // EFI_IFR_GET - 0x2B
- { sizeof (EFI_IFR_SET), 0 }, // EFI_IFR_SET - 0x2C
- { sizeof (EFI_IFR_READ), 0 }, // EFI_IFR_READ - 0x2D
- { sizeof (EFI_IFR_WRITE), 0 }, // EFI_IFR_WRITE - 0x2E
- { sizeof (EFI_IFR_EQUAL), 0 }, // EFI_IFR_EQUAL_OP - 0x2F
- { sizeof (EFI_IFR_NOT_EQUAL), 0 }, // EFI_IFR_NOT_EQUAL_OP
- { sizeof (EFI_IFR_GREATER_THAN), 0 }, // EFI_IFR_GREATER_THAN_OP
- { sizeof (EFI_IFR_GREATER_EQUAL), 0 }, // EFI_IFR_GREATER_EQUAL_OP
- { sizeof (EFI_IFR_LESS_THAN), 0 }, // EFI_IFR_LESS_THAN_OP
- { sizeof (EFI_IFR_LESS_EQUAL), 0 }, // EFI_IFR_LESS_EQUAL_OP - 0x34
- { sizeof (EFI_IFR_BITWISE_AND), 0 }, // EFI_IFR_BITWISE_AND_OP
- { sizeof (EFI_IFR_BITWISE_OR), 0 }, // EFI_IFR_BITWISE_OR_OP
- { sizeof (EFI_IFR_BITWISE_NOT), 0 }, // EFI_IFR_BITWISE_NOT_OP
- { sizeof (EFI_IFR_SHIFT_LEFT), 0 }, // EFI_IFR_SHIFT_LEFT_OP
- { sizeof (EFI_IFR_SHIFT_RIGHT), 0 }, // EFI_IFR_SHIFT_RIGHT_OP
- { sizeof (EFI_IFR_ADD), 0 }, // EFI_IFR_ADD_OP - 0x3A
- { sizeof (EFI_IFR_SUBTRACT), 0 }, // EFI_IFR_SUBTRACT_OP
- { sizeof (EFI_IFR_MULTIPLY), 0 }, // EFI_IFR_MULTIPLY_OP
- { sizeof (EFI_IFR_DIVIDE), 0 }, // EFI_IFR_DIVIDE_OP
- { sizeof (EFI_IFR_MODULO), 0 }, // EFI_IFR_MODULO_OP - 0x3E
- { sizeof (EFI_IFR_RULE_REF), 0 }, // EFI_IFR_RULE_REF_OP
- { sizeof (EFI_IFR_QUESTION_REF1), 0 }, // EFI_IFR_QUESTION_REF1_OP
- { sizeof (EFI_IFR_QUESTION_REF2), 0 }, // EFI_IFR_QUESTION_REF2_OP - 0x41
- { sizeof (EFI_IFR_UINT8), 0}, // EFI_IFR_UINT8
- { sizeof (EFI_IFR_UINT16), 0}, // EFI_IFR_UINT16
- { sizeof (EFI_IFR_UINT32), 0}, // EFI_IFR_UINT32
- { sizeof (EFI_IFR_UINT64), 0}, // EFI_IFR_UTNT64
- { sizeof (EFI_IFR_TRUE), 0 }, // EFI_IFR_TRUE_OP - 0x46
- { sizeof (EFI_IFR_FALSE), 0 }, // EFI_IFR_FALSE_OP
- { sizeof (EFI_IFR_TO_UINT), 0 }, // EFI_IFR_TO_UINT_OP
- { sizeof (EFI_IFR_TO_STRING), 0 }, // EFI_IFR_TO_STRING_OP
- { sizeof (EFI_IFR_TO_BOOLEAN), 0 }, // EFI_IFR_TO_BOOLEAN_OP
- { sizeof (EFI_IFR_MID), 0 }, // EFI_IFR_MID_OP
- { sizeof (EFI_IFR_FIND), 0 }, // EFI_IFR_FIND_OP
- { sizeof (EFI_IFR_TOKEN), 0 }, // EFI_IFR_TOKEN_OP
- { sizeof (EFI_IFR_STRING_REF1), 0 }, // EFI_IFR_STRING_REF1_OP - 0x4E
- { sizeof (EFI_IFR_STRING_REF2), 0 }, // EFI_IFR_STRING_REF2_OP
- { sizeof (EFI_IFR_CONDITIONAL), 0 }, // EFI_IFR_CONDITIONAL_OP
- { sizeof (EFI_IFR_QUESTION_REF3), 0 }, // EFI_IFR_QUESTION_REF3_OP
- { sizeof (EFI_IFR_ZERO), 0 }, // EFI_IFR_ZERO_OP
- { sizeof (EFI_IFR_ONE), 0 }, // EFI_IFR_ONE_OP
- { sizeof (EFI_IFR_ONES), 0 }, // EFI_IFR_ONES_OP
- { sizeof (EFI_IFR_UNDEFINED), 0 }, // EFI_IFR_UNDEFINED_OP
- { sizeof (EFI_IFR_LENGTH), 0 }, // EFI_IFR_LENGTH_OP
- { sizeof (EFI_IFR_DUP), 0 }, // EFI_IFR_DUP_OP - 0x57
- { sizeof (EFI_IFR_THIS), 0 }, // EFI_IFR_THIS_OP
- { sizeof (EFI_IFR_SPAN), 0 }, // EFI_IFR_SPAN_OP
- { sizeof (EFI_IFR_VALUE), 1 }, // EFI_IFR_VALUE_OP
- { sizeof (EFI_IFR_DEFAULT), 0 }, // EFI_IFR_DEFAULT_OP
- { sizeof (EFI_IFR_DEFAULTSTORE), 0 }, // EFI_IFR_DEFAULTSTORE_OP - 0x5C
- { sizeof (EFI_IFR_FORM_MAP), 1}, // EFI_IFR_FORM_MAP_OP - 0x5D
- { sizeof (EFI_IFR_CATENATE), 0 }, // EFI_IFR_CATENATE_OP
- { sizeof (EFI_IFR_GUID), 0 }, // EFI_IFR_GUID_OP
- { sizeof (EFI_IFR_SECURITY), 0 }, // EFI_IFR_SECURITY_OP - 0x60
- { sizeof (EFI_IFR_MODAL_TAG), 0}, // EFI_IFR_MODAL_TAG_OP - 0x61
- { sizeof (EFI_IFR_REFRESH_ID), 0}, // EFI_IFR_REFRESH_ID_OP - 0x62
-};
-
-#ifdef CIFROBJ_DEUBG
-static struct {
- CHAR8 *mIfrName;
-} gIfrObjPrintDebugTable[] = {
- "EFI_IFR_INVALID", "EFI_IFR_FORM", "EFI_IFR_SUBTITLE", "EFI_IFR_TEXT", "EFI_IFR_IMAGE", "EFI_IFR_ONE_OF",
- "EFI_IFR_CHECKBOX", "EFI_IFR_NUMERIC", "EFI_IFR_PASSWORD", "EFI_IFR_ONE_OF_OPTION", "EFI_IFR_SUPPRESS_IF", "EFI_IFR_LOCKED",
- "EFI_IFR_ACTION", "EFI_IFR_RESET_BUTTON", "EFI_IFR_FORM_SET", "EFI_IFR_REF", "EFI_IFR_NO_SUBMIT_IF", "EFI_IFR_INCONSISTENT_IF",
- "EFI_IFR_EQ_ID_VAL", "EFI_IFR_EQ_ID_ID", "EFI_IFR_EQ_ID_LIST", "EFI_IFR_AND", "EFI_IFR_OR", "EFI_IFR_NOT",
- "EFI_IFR_RULE", "EFI_IFR_GRAY_OUT_IF", "EFI_IFR_DATE", "EFI_IFR_TIME", "EFI_IFR_STRING", "EFI_IFR_REFRESH",
- "EFI_IFR_DISABLE_IF", "EFI_IFR_INVALID", "EFI_IFR_TO_LOWER", "EFI_IFR_TO_UPPER", "EFI_IFR_MAP", "EFI_IFR_ORDERED_LIST",
- "EFI_IFR_VARSTORE", "EFI_IFR_VARSTORE_NAME_VALUE", "EFI_IFR_VARSTORE_EFI", "EFI_IFR_VARSTORE_DEVICE", "EFI_IFR_VERSION", "EFI_IFR_END",
- "EFI_IFR_MATCH", "EFI_IFR_GET", "EFI_IFR_SET", "EFI_IFR_READ", "EFI_IFR_WRITE", "EFI_IFR_EQUAL",
- "EFI_IFR_NOT_EQUAL", "EFI_IFR_GREATER_THAN", "EFI_IFR_GREATER_EQUAL", "EFI_IFR_LESS_THAN", "EFI_IFR_LESS_EQUAL", "EFI_IFR_BITWISE_AND",
- "EFI_IFR_BITWISE_OR", "EFI_IFR_BITWISE_NOT", "EFI_IFR_SHIFT_LEFT", "EFI_IFR_SHIFT_RIGHT", "EFI_IFR_ADD", "EFI_IFR_SUBTRACT",
- "EFI_IFR_MULTIPLY", "EFI_IFR_DIVIDE", "EFI_IFR_MODULO", "EFI_IFR_RULE_REF", "EFI_IFR_QUESTION_REF1", "EFI_IFR_QUESTION_REF2",
- "EFI_IFR_UINT8", "EFI_IFR_UINT16", "EFI_IFR_UINT32", "EFI_IFR_UINT64", "EFI_IFR_TRUE", "EFI_IFR_FALSE",
- "EFI_IFR_TO_UINT", "EFI_IFR_TO_STRING", "EFI_IFR_TO_BOOLEAN", "EFI_IFR_MID", "EFI_IFR_FIND", "EFI_IFR_TOKEN",
- "EFI_IFR_STRING_REF1","EFI_IFR_STRING_REF2", "EFI_IFR_CONDITIONAL", "EFI_IFR_QUESTION_REF3", "EFI_IFR_ZERO", "EFI_IFR_ONE",
- "EFI_IFR_ONES", "EFI_IFR_UNDEFINED", "EFI_IFR_LENGTH", "EFI_IFR_DUP", "EFI_IFR_THIS", "EFI_IFR_SPAN",
- "EFI_IFR_VALUE", "EFI_IFR_DEFAULT", "EFI_IFR_DEFAULTSTORE", "EFI_IFR_FORM_MAP", "EFI_IFR_CATENATE", "EFI_IFR_GUID",
- "EFI_IFR_SECURITY", "EFI_IFR_MODAL_TAG", "EFI_IFR_REFRESH_ID",
-};
-
-VOID
-CIFROBJ_DEBUG_PRINT (
- IN UINT8 OpCode
- )
-{
- printf ("======Create IFR [%s]\n", gIfrObjPrintDebugTable[OpCode].mIfrName);
-}
-#else
-
-#define CIFROBJ_DEBUG_PRINT(OpCode)
-
-#endif
-
-BOOLEAN gCreateOp = TRUE;
-
-CIfrObj::CIfrObj (
- IN UINT8 OpCode,
- OUT CHAR8 **IfrObj,
- IN UINT8 ObjBinLen,
- IN BOOLEAN DelayEmit
- )
-{
- mDelayEmit = DelayEmit;
- mPkgOffset = gCFormPkg.GetPkgLength ();
- mObjBinLen = (ObjBinLen == 0) ? gOpcodeSizesScopeTable[OpCode].mSize : ObjBinLen;
- mObjBinBuf = ((DelayEmit == FALSE) && (gCreateOp == TRUE)) ? gCFormPkg.IfrBinBufferGet (mObjBinLen) : new CHAR8[EFI_IFR_MAX_LENGTH];
- mRecordIdx = (gCreateOp == TRUE) ? gCIfrRecordInfoDB.IfrRecordRegister (0xFFFFFFFF, mObjBinBuf, mObjBinLen, mPkgOffset) : EFI_IFR_RECORDINFO_IDX_INVALUD;
-
- if (IfrObj != NULL) {
- *IfrObj = mObjBinBuf;
- }
-
- CIFROBJ_DEBUG_PRINT (OpCode);
-}
-
-CIfrObj::~CIfrObj (
- VOID
- )
-{
- if ((mDelayEmit == TRUE) && ((gCreateOp == TRUE))) {
- _EMIT_PENDING_OBJ ();
- }
-
- gCIfrRecordInfoDB.IfrRecordInfoUpdate (mRecordIdx, mLineNo, mObjBinBuf, mObjBinLen, mPkgOffset);
-}
-
-/*
- * The definition of CIfrObj's member function
- */
-UINT8 gScopeCount = 0;
-
-CIfrOpHeader::CIfrOpHeader (
- IN UINT8 OpCode,
- IN VOID *StartAddr,
- IN UINT8 Length
- ) : mHeader ((EFI_IFR_OP_HEADER *)StartAddr)
-{
- mHeader->OpCode = OpCode;
- mHeader->Length = (Length == 0) ? gOpcodeSizesScopeTable[OpCode].mSize : Length;
- mHeader->Scope = (gOpcodeSizesScopeTable[OpCode].mScope + gScopeCount > 0) ? 1 : 0;
-}
-
-CIfrOpHeader::CIfrOpHeader (
- IN CIfrOpHeader &OpHdr
- )
-{
- mHeader = OpHdr.mHeader;
-}
-
-UINT32 CIfrFormId::FormIdBitMap[EFI_FREE_FORM_ID_BITMAP_SIZE] = {0, };
diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.h b/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
deleted file mode 100644
index 614471060d..0000000000
--- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
+++ /dev/null
@@ -1,2808 +0,0 @@
-/** @file
-
- The definition of CFormPkg's member function
-
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _EFIIFRCLASS_H_
-#define _EFIIFRCLASS_H_
-
-#include "string.h"
-#include "EfiVfr.h"
-#include "VfrError.h"
-#include "VfrUtilityLib.h"
-
-#define NO_QST_REFED "no question refered"
-
-struct PACKAGE_DATA {
- CHAR8 *Buffer;
- UINT32 Size;
-};
-
-/*
- * The functions below are used for flags setting
- */
-static inline BOOLEAN _FLAGS_ZERO (
- IN UINT8 &Flags
- )
-{
- return Flags == 0;
-}
-
-static inline VOID _FLAG_CLEAR (
- IN UINT8 &Flags,
- IN UINT8 Mask
- )
-{
- Flags &= (~Mask);
-}
-
-static inline UINT8 _FLAG_TEST_AND_CLEAR (
- IN UINT8 &Flags,
- IN UINT8 Mask
- )
-{
- UINT8 Ret = Flags & Mask;
- Flags &= (~Mask);
- return Ret;
-}
-
-static inline UINT8 _IS_EQUAL (
- IN UINT8 &Flags,
- IN UINT8 Value
- )
-{
- return Flags == Value;
-}
-
-/*
- * The definition of CIfrBin
- */
-typedef enum {
- PENDING,
- ASSIGNED
-} ASSIGN_FLAG;
-
-struct SPendingAssign {
- CHAR8 *mKey; // key ! unique
- VOID *mAddr;
- UINT32 mLen;
- ASSIGN_FLAG mFlag;
- UINT32 mLineNo;
- CHAR8 *mMsg;
- struct SPendingAssign *mNext;
-
- SPendingAssign (IN CHAR8 *, IN VOID *, IN UINT32, IN UINT32, IN CONST CHAR8 *);
- ~SPendingAssign ();
-
- VOID SetAddrAndLen (IN VOID *, IN UINT32);
- VOID AssignValue (IN VOID *, IN UINT32);
- CHAR8 * GetKey (VOID);
-};
-
-struct SBufferNode {
- CHAR8 *mBufferStart;
- CHAR8 *mBufferEnd;
- CHAR8 *mBufferFree;
- struct SBufferNode *mNext;
-};
-
-typedef struct {
- BOOLEAN CompatibleMode;
- EFI_GUID *OverrideClassGuid;
-} INPUT_INFO_TO_SYNTAX;
-
-class CFormPkg {
-private:
- UINT32 mBufferSize;
- SBufferNode *mBufferNodeQueueHead;
- SBufferNode *mBufferNodeQueueTail;
- SBufferNode *mCurrBufferNode;
-
- SBufferNode *mReadBufferNode;
- UINT32 mReadBufferOffset;
-
- UINT32 mPkgLength;
-
- VOID _WRITE_PKG_LINE (IN FILE *, IN UINT32 , IN CONST CHAR8 *, IN CHAR8 *, IN UINT32);
- VOID _WRITE_PKG_END (IN FILE *, IN UINT32 , IN CONST CHAR8 *, IN CHAR8 *, IN UINT32);
- SBufferNode * GetBinBufferNodeForAddr (IN CHAR8 *);
- SBufferNode * CreateNewNode ();
- SBufferNode * GetNodeBefore (IN SBufferNode *);
- EFI_VFR_RETURN_CODE InsertNodeBefore (IN SBufferNode *, IN SBufferNode *);
-
-private:
- SPendingAssign *PendingAssignList;
-
-public:
- CFormPkg (IN UINT32 BufferSize);
- ~CFormPkg ();
-
- CHAR8 * IfrBinBufferGet (IN UINT32);
- inline UINT32 GetPkgLength (VOID);
-
- VOID Open ();
- UINT32 Read (IN CHAR8 *, IN UINT32);
- VOID Close ();
-
- EFI_VFR_RETURN_CODE BuildPkgHdr (OUT EFI_HII_PACKAGE_HEADER **);
- EFI_VFR_RETURN_CODE BuildPkg (IN FILE *, IN PACKAGE_DATA *PkgData = NULL);
- EFI_VFR_RETURN_CODE BuildPkg (OUT PACKAGE_DATA &);
- EFI_VFR_RETURN_CODE GenCFile (IN CHAR8 *, IN FILE *, IN PACKAGE_DATA *PkgData = NULL);
-
-public:
- EFI_VFR_RETURN_CODE AssignPending (IN CHAR8 *, IN VOID *, IN UINT32, IN UINT32, IN CONST CHAR8 *Msg = NULL);
- VOID DoPendingAssign (IN CHAR8 *, IN VOID *, IN UINT32);
- bool HavePendingUnassigned (VOID);
- VOID PendingAssignPrintAll (VOID);
- EFI_VFR_RETURN_CODE DeclarePendingQuestion (
- IN CVfrVarDataTypeDB &lCVfrVarDataTypeDB,
- IN CVfrDataStorage &lCVfrDataStorage,
- IN CVfrQuestionDB &lCVfrQuestionDB,
- IN EFI_GUID *LocalFormSetGuid,
- IN UINT32 LineNo,
- OUT CHAR8 **InsertOpcodeAddr
- );
- EFI_VFR_RETURN_CODE AdjustDynamicInsertOpcode (
- IN CHAR8 *LastFormEndAddr,
- IN CHAR8 *InsertOpcodeAddr
- );
- CHAR8 * GetBufAddrBaseOnOffset (
- IN UINT32 Offset
- );
-};
-
-extern CFormPkg gCFormPkg;
-extern CVfrStringDB gCVfrStringDB;
-extern UINT32 gAdjustOpcodeOffset;
-extern BOOLEAN gNeedAdjustOpcode;
-
-struct SIfrRecord {
- UINT32 mLineNo;
- CHAR8 *mIfrBinBuf;
- UINT8 mBinBufLen;
- UINT32 mOffset;
- SIfrRecord *mNext;
-
- SIfrRecord (VOID);
- ~SIfrRecord (VOID);
-};
-
-#define EFI_IFR_RECORDINFO_IDX_INVALUD 0xFFFFFF
-#define EFI_IFR_RECORDINFO_IDX_START 0x0
-
-class CIfrRecordInfoDB {
-private:
- bool mSwitch;
- UINT32 mRecordCount;
- SIfrRecord *mIfrRecordListHead;
- SIfrRecord *mIfrRecordListTail;
-
- SIfrRecord * GetRecordInfoFromIdx (IN UINT32);
- BOOLEAN CheckQuestionOpCode (IN UINT8);
- BOOLEAN CheckIdOpCode (IN UINT8);
- EFI_QUESTION_ID GetOpcodeQuestionId (IN EFI_IFR_OP_HEADER *);
-public:
- CIfrRecordInfoDB (VOID);
- ~CIfrRecordInfoDB (VOID);
-
- inline VOID TurnOn (VOID) {
- mSwitch = TRUE;
- }
-
- inline VOID TurnOff (VOID) {
- mSwitch = FALSE;
- }
-
- SIfrRecord * GetRecordInfoFromOffset (IN UINT32);
- VOID IfrAdjustOffsetForRecord (VOID);
- BOOLEAN IfrAdjustDynamicOpcodeInRecords (VOID);
-
- UINT32 IfrRecordRegister (IN UINT32, IN CHAR8 *, IN UINT8, IN UINT32);
- VOID IfrRecordInfoUpdate (IN UINT32, IN UINT32, IN CHAR8*, IN UINT8, IN UINT32);
- VOID IfrRecordOutput (IN FILE *, IN UINT32 LineNo);
- VOID IfrRecordOutput (OUT PACKAGE_DATA &);
- EFI_VFR_RETURN_CODE IfrRecordAdjust (VOID);
-};
-
-extern CIfrRecordInfoDB gCIfrRecordInfoDB;
-
-/*
- * The definition of CIfrObj
- */
-extern BOOLEAN gCreateOp;
-
-class CIfrObj {
-private:
- BOOLEAN mDelayEmit;
-
- CHAR8 *mObjBinBuf;
- UINT8 mObjBinLen;
- UINT32 mLineNo;
- UINT32 mRecordIdx;
- UINT32 mPkgOffset;
-
-public:
- CIfrObj (IN UINT8 OpCode, OUT CHAR8 **IfrObj = NULL, IN UINT8 ObjBinLen = 0, IN BOOLEAN DelayEmit = FALSE);
- virtual ~CIfrObj(VOID);
-
- VOID _EMIT_PENDING_OBJ (VOID);
-
- inline VOID SetLineNo (IN UINT32 LineNo) {
- mLineNo = LineNo;
- }
-
- inline CHAR8 * GetObjBinAddr (VOID) {
- return mObjBinBuf;
- }
-
- inline UINT32 GetObjBinOffset (VOID) {
- return mPkgOffset;
- }
-
- inline UINT8 GetObjBinLen (VOID) {
- return mObjBinLen;
- }
-
- inline bool ExpendObjBin (IN UINT8 Size) {
- if ((mDelayEmit == TRUE) && ((mObjBinLen + Size) > mObjBinLen)) {
- mObjBinLen = mObjBinLen + Size;
- return TRUE;
- } else {
- return FALSE;
- }
- }
-
- inline bool ShrinkObjBin (IN UINT8 Size) {
- if ((mDelayEmit == TRUE) && (mObjBinLen > Size)) {
- mObjBinLen -= Size;
- return TRUE;
- } else {
- return FALSE;
- }
- }
-};
-
-/*
- * The definition of CIfrOpHeader
- */
-class CIfrOpHeader {
-private:
- EFI_IFR_OP_HEADER *mHeader;
-
-public:
- CIfrOpHeader (IN UINT8 OpCode, IN VOID *StartAddr, IN UINT8 Length = 0);
- CIfrOpHeader (IN CIfrOpHeader &);
-
- VOID IncLength (UINT8 Size) {
- if ((mHeader->Length + Size) > mHeader->Length) {
- mHeader->Length = mHeader->Length + Size;
- }
- }
-
- VOID DecLength (UINT8 Size) {
- if (mHeader->Length >= Size) {
- mHeader->Length -= Size;
- }
- }
-
- UINT8 GetLength () {
- return mHeader->Length;
- }
-
- UINT8 GetScope () {
- return mHeader->Scope;
- }
-
- VOID SetScope (IN UINT8 Scope) {
- mHeader->Scope = Scope;
- }
-
- VOID UpdateHeader (IN EFI_IFR_OP_HEADER *Header) {
- mHeader = Header;
- }
-};
-
-extern UINT8 gScopeCount;
-
-/*
- * The definition of CIfrStatementHeader
- */
-class CIfrStatementHeader {
-private:
- EFI_IFR_STATEMENT_HEADER *mHeader;
-
-public:
- CIfrStatementHeader (
- IN EFI_IFR_STATEMENT_HEADER *StartAddr
- ) : mHeader ((EFI_IFR_STATEMENT_HEADER *)StartAddr) {
- mHeader = StartAddr;
- mHeader->Help = EFI_STRING_ID_INVALID;
- mHeader->Prompt = EFI_STRING_ID_INVALID;
- }
-
- EFI_IFR_STATEMENT_HEADER *GetStatementHeader () {
- return mHeader;
- }
-
- VOID SetPrompt (IN EFI_STRING_ID Prompt) {
- mHeader->Prompt = Prompt;
- }
-
- VOID SetHelp (IN EFI_STRING_ID Help) {
- mHeader->Help = Help;
- }
-};
-
-/*
- * The definition of CIfrQuestionHeader
- */
-#define EFI_IFR_QUESTION_FLAG_DEFAULT 0
-
-class CIfrQuestionHeader : public CIfrStatementHeader {
-private:
- EFI_IFR_QUESTION_HEADER *mHeader;
-
- EFI_IFR_STATEMENT_HEADER * QH2SH (EFI_IFR_QUESTION_HEADER *Qheader) {
- return &(Qheader)->Header;
- }
-
-public:
- EFI_QUESTION_ID QUESTION_ID (VOID) {
- return mHeader->QuestionId;
- }
-
- EFI_VARSTORE_ID VARSTORE_ID (VOID) {
- return mHeader->VarStoreId;
- }
-
- VOID VARSTORE_INFO (OUT EFI_VARSTORE_INFO *Info) {
- if (Info != NULL) {
- Info->mVarStoreId = mHeader->VarStoreId;
- memcpy (&Info->mVarStoreId, &mHeader->VarStoreInfo, sizeof (Info->mVarStoreId));
- }
- }
-
- UINT8 FLAGS (VOID) {
- return mHeader->Flags;
- }
-
-public:
- CIfrQuestionHeader (
- IN EFI_IFR_QUESTION_HEADER *StartAddr,
- IN UINT8 Flags = EFI_IFR_QUESTION_FLAG_DEFAULT
- ) : CIfrStatementHeader (QH2SH(StartAddr)) {
- mHeader = StartAddr;
- mHeader->QuestionId = EFI_QUESTION_ID_INVALID;
- mHeader->VarStoreId = EFI_VARSTORE_ID_INVALID;
- mHeader->VarStoreInfo.VarName = EFI_STRING_ID_INVALID;
- mHeader->VarStoreInfo.VarOffset = EFI_VAROFFSET_INVALID;
- mHeader->Flags = Flags;
- }
-
- VOID SetQuestionId (IN EFI_QUESTION_ID QuestionId) {
- mHeader->QuestionId = QuestionId;
- }
-
- VOID SetVarStoreInfo (IN EFI_VARSTORE_INFO *Info) {
- mHeader->VarStoreId = Info->mVarStoreId;
- mHeader->VarStoreInfo.VarName = Info->mInfo.mVarName;
- mHeader->VarStoreInfo.VarOffset = Info->mInfo.mVarOffset;
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 Flags) {
- if (_FLAG_TEST_AND_CLEAR (Flags, EFI_IFR_FLAG_READ_ONLY)) {
- mHeader->Flags |= EFI_IFR_FLAG_READ_ONLY;
- }
-
- _FLAG_CLEAR (Flags, 0x02);
-
- if (_FLAG_TEST_AND_CLEAR (Flags, EFI_IFR_FLAG_CALLBACK)) {
- mHeader->Flags |= EFI_IFR_FLAG_CALLBACK;
- }
-
- //
- // ignore NVAccessFlag
- //
- _FLAG_CLEAR (Flags, 0x08);
-
- if (_FLAG_TEST_AND_CLEAR (Flags, EFI_IFR_FLAG_RESET_REQUIRED)) {
- mHeader->Flags |= EFI_IFR_FLAG_RESET_REQUIRED;
- }
-
- //
- // Set LateCheck Flag to compatible for framework flag
- // but it uses 0x20 as its flag, if in the future UEFI may take this flag
- //
- if (_FLAG_TEST_AND_CLEAR (Flags, 0x20)) {
- mHeader->Flags |= 0x20;
- }
-
- if (_FLAG_TEST_AND_CLEAR (Flags, EFI_IFR_FLAG_OPTIONS_ONLY)) {
- mHeader->Flags |= EFI_IFR_FLAG_OPTIONS_ONLY;
- }
-
- return _FLAGS_ZERO (Flags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;
- }
-
- VOID UpdateCIfrQuestionHeader (IN EFI_IFR_QUESTION_HEADER *Header) {
- mHeader = Header;
- }
-};
-
-/*
- * The definition of CIfrMinMaxStepData
- */
-class CIfrMinMaxStepData {
-private:
- MINMAXSTEP_DATA *mMinMaxStepData;
- BOOLEAN ValueIsSet;
- BOOLEAN IsNumeric;
-
-public:
- CIfrMinMaxStepData (MINMAXSTEP_DATA *DataAddr, BOOLEAN NumericOpcode=FALSE) : mMinMaxStepData (DataAddr) {
- mMinMaxStepData->u64.MinValue = 0;
- mMinMaxStepData->u64.MaxValue = 0;
- mMinMaxStepData->u64.Step = 0;
- ValueIsSet = FALSE;
- IsNumeric = NumericOpcode;
- }
-
- VOID SetMinMaxStepData (IN UINT64 MinValue, IN UINT64 MaxValue, IN UINT64 Step) {
- if (!ValueIsSet) {
- mMinMaxStepData->u64.MinValue = MinValue;
- mMinMaxStepData->u64.MaxValue = MaxValue;
- ValueIsSet = TRUE;
- } else {
- if (MinValue < mMinMaxStepData->u64.MinValue) {
- mMinMaxStepData->u64.MinValue = MinValue;
- }
- if (MaxValue > mMinMaxStepData->u64.MaxValue) {
- mMinMaxStepData->u64.MaxValue = MaxValue;
- }
- }
- mMinMaxStepData->u64.Step = Step;
- }
-
- VOID SetMinMaxStepData (IN UINT32 MinValue, IN UINT32 MaxValue, IN UINT32 Step) {
- if (!ValueIsSet) {
- mMinMaxStepData->u32.MinValue = MinValue;
- mMinMaxStepData->u32.MaxValue = MaxValue;
- ValueIsSet = TRUE;
- } else {
- if (MinValue < mMinMaxStepData->u32.MinValue) {
- mMinMaxStepData->u32.MinValue = MinValue;
- }
- if (MaxValue > mMinMaxStepData->u32.MaxValue) {
- mMinMaxStepData->u32.MaxValue = MaxValue;
- }
- }
- mMinMaxStepData->u32.Step = Step;
- }
-
- VOID SetMinMaxStepData (IN UINT16 MinValue, IN UINT16 MaxValue, IN UINT16 Step) {
- if (!ValueIsSet) {
- mMinMaxStepData->u16.MinValue = MinValue;
- mMinMaxStepData->u16.MaxValue = MaxValue;
- ValueIsSet = TRUE;
- } else {
- if (MinValue < mMinMaxStepData->u16.MinValue) {
- mMinMaxStepData->u16.MinValue = MinValue;
- }
- if (MaxValue > mMinMaxStepData->u16.MaxValue) {
- mMinMaxStepData->u16.MaxValue = MaxValue;
- }
- }
- mMinMaxStepData->u16.Step = Step;
- }
-
- VOID SetMinMaxStepData (IN UINT8 MinValue, IN UINT8 MaxValue, IN UINT8 Step) {
- if (!ValueIsSet) {
- mMinMaxStepData->u8.MinValue = MinValue;
- mMinMaxStepData->u8.MaxValue = MaxValue;
- ValueIsSet = TRUE;
- } else {
- if (MinValue < mMinMaxStepData->u8.MinValue) {
- mMinMaxStepData->u8.MinValue = MinValue;
- }
- if (MaxValue > mMinMaxStepData->u8.MaxValue) {
- mMinMaxStepData->u8.MaxValue = MaxValue;
- }
- }
- mMinMaxStepData->u8.Step = Step;
- }
-
- UINT64 GetMinData (UINT8 VarType) {
- UINT64 MinValue = 0;
- switch (VarType) {
- case EFI_IFR_TYPE_NUM_SIZE_64:
- MinValue = mMinMaxStepData->u64.MinValue;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_32:
- MinValue = (UINT64) mMinMaxStepData->u32.MinValue;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_16:
- MinValue = (UINT64) mMinMaxStepData->u16.MinValue;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_8:
- MinValue = (UINT64) mMinMaxStepData->u8.MinValue;
- break;
- default:
- break;
- }
- return MinValue;
- }
-
- UINT64 GetMaxData (UINT8 VarType) {
- UINT64 MaxValue = 0;
- switch (VarType) {
- case EFI_IFR_TYPE_NUM_SIZE_64:
- MaxValue = mMinMaxStepData->u64.MaxValue;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_32:
- MaxValue = (UINT64) mMinMaxStepData->u32.MaxValue;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_16:
- MaxValue = (UINT64) mMinMaxStepData->u16.MaxValue;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_8:
- MaxValue = (UINT64) mMinMaxStepData->u8.MaxValue;
- break;
- default:
- break;
- }
- return MaxValue;
- }
-
- UINT64 GetStepData (UINT8 VarType) {
- UINT64 MaxValue = 0;
- switch (VarType) {
- case EFI_IFR_TYPE_NUM_SIZE_64:
- MaxValue = mMinMaxStepData->u64.Step;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_32:
- MaxValue = (UINT64) mMinMaxStepData->u32.Step;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_16:
- MaxValue = (UINT64) mMinMaxStepData->u16.Step;
- break;
- case EFI_IFR_TYPE_NUM_SIZE_8:
- MaxValue = (UINT64) mMinMaxStepData->u8.Step;
- break;
- default:
- break;
- }
- return MaxValue;
- }
-
- BOOLEAN IsNumericOpcode () {
- return IsNumeric;
- }
-
- VOID UpdateCIfrMinMaxStepData (IN MINMAXSTEP_DATA *MinMaxStepData) {
- mMinMaxStepData = MinMaxStepData;
- }
-};
-
-static CIfrQuestionHeader *gCurrentQuestion = NULL;
-static CIfrMinMaxStepData *gCurrentMinMaxData = NULL;
-
-/*
- * The definition of all of the UEFI IFR Objects
- */
-class CIfrFormSet : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_FORM_SET *mFormSet;
- EFI_GUID *mClassGuid;
-
-public:
- CIfrFormSet (UINT8 Size) : CIfrObj (EFI_IFR_FORM_SET_OP, (CHAR8 **)&mFormSet, Size),
- CIfrOpHeader (EFI_IFR_FORM_SET_OP, &mFormSet->Header, Size) {
- mFormSet->Help = EFI_STRING_ID_INVALID;
- mFormSet->FormSetTitle = EFI_STRING_ID_INVALID;
- mFormSet->Flags = 0;
- memset (&mFormSet->Guid, 0, sizeof (EFI_GUID));
- mClassGuid = (EFI_GUID *) (mFormSet + 1);
- }
-
- VOID SetGuid (IN EFI_GUID *Guid) {
- memcpy (&mFormSet->Guid, Guid, sizeof (EFI_GUID));
- }
-
- VOID SetFormSetTitle (IN EFI_STRING_ID FormSetTitle) {
- mFormSet->FormSetTitle = FormSetTitle;
- }
-
- VOID SetHelp (IN EFI_STRING_ID Help) {
- mFormSet->Help = Help;
- }
-
- VOID SetClassGuid (IN EFI_GUID *Guid) {
- memcpy (&(mClassGuid[mFormSet->Flags++]), Guid, sizeof (EFI_GUID));
- }
-
- UINT8 GetFlags() {
- return mFormSet->Flags;
- }
-};
-
-class CIfrEnd : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_END *mEnd;
-
-public:
- CIfrEnd () : CIfrObj (EFI_IFR_END_OP, (CHAR8 **)&mEnd),
- CIfrOpHeader (EFI_IFR_END_OP, &mEnd->Header) {}
-};
-
-class CIfrDefaultStore : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_DEFAULTSTORE *mDefaultStore;
-
-public:
- CIfrDefaultStore () : CIfrObj (EFI_IFR_DEFAULTSTORE_OP, (CHAR8 **)&mDefaultStore),
- CIfrOpHeader (EFI_IFR_DEFAULTSTORE_OP, &mDefaultStore->Header) {
- mDefaultStore->DefaultId = EFI_VARSTORE_ID_INVALID;
- mDefaultStore->DefaultName = EFI_STRING_ID_INVALID;
- }
-
- VOID SetDefaultName (IN EFI_STRING_ID DefaultName) {
- mDefaultStore->DefaultName = DefaultName;
- }
-
- VOID SetDefaultId (IN UINT16 DefaultId) {
- mDefaultStore->DefaultId = DefaultId;
- }
-};
-
-#define EFI_FORM_ID_MAX 0xFFFF
-#define EFI_FREE_FORM_ID_BITMAP_SIZE ((EFI_FORM_ID_MAX + 1) / EFI_BITS_PER_UINT32)
-
-class CIfrFormId {
-public:
- STATIC UINT32 FormIdBitMap[EFI_FREE_FORM_ID_BITMAP_SIZE];
-
- STATIC BOOLEAN ChekFormIdFree (IN EFI_FORM_ID FormId) {
- UINT32 Index = (FormId / EFI_BITS_PER_UINT32);
- UINT32 Offset = (FormId % EFI_BITS_PER_UINT32);
-
- return (FormIdBitMap[Index] & (0x80000000 >> Offset)) == 0;
- }
-
- STATIC VOID MarkFormIdUsed (IN EFI_FORM_ID FormId) {
- UINT32 Index = (FormId / EFI_BITS_PER_UINT32);
- UINT32 Offset = (FormId % EFI_BITS_PER_UINT32);
-
- FormIdBitMap[Index] |= (0x80000000 >> Offset);
- }
-};
-
-class CIfrForm : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_FORM *mForm;
-
-public:
- CIfrForm () : CIfrObj (EFI_IFR_FORM_OP, (CHAR8 **)&mForm),
- CIfrOpHeader (EFI_IFR_FORM_OP, &mForm->Header) {
- mForm->FormId = 0;
- mForm->FormTitle = EFI_STRING_ID_INVALID;
- }
-
- EFI_VFR_RETURN_CODE SetFormId (IN EFI_FORM_ID FormId) {
- if (FormId == 0) {
- //
- // FormId can't be 0.
- //
- return VFR_RETURN_INVALID_PARAMETER;
- }
- if (CIfrFormId::ChekFormIdFree (FormId) == FALSE) {
- return VFR_RETURN_FORMID_REDEFINED;
- }
- mForm->FormId = FormId;
- CIfrFormId::MarkFormIdUsed (FormId);
- return VFR_RETURN_SUCCESS;
- }
-
- VOID SetFormTitle (IN EFI_STRING_ID FormTitle) {
- mForm->FormTitle = FormTitle;
- }
-};
-
-class CIfrFormMap : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_FORM_MAP *mFormMap;
- EFI_IFR_FORM_MAP_METHOD *mMethodMap;
-
-public:
- CIfrFormMap () : CIfrObj (EFI_IFR_FORM_MAP_OP, (CHAR8 **)&mFormMap, sizeof (EFI_IFR_FORM_MAP), TRUE),
- CIfrOpHeader (EFI_IFR_FORM_MAP_OP, &mFormMap->Header) {
- mFormMap->FormId = 0;
- mMethodMap = (EFI_IFR_FORM_MAP_METHOD *) (mFormMap + 1);
- }
-
- EFI_VFR_RETURN_CODE SetFormId (IN EFI_FORM_ID FormId) {
- if (FormId == 0) {
- //
- // FormId can't be 0.
- //
- return VFR_RETURN_INVALID_PARAMETER;
- }
- if (CIfrFormId::ChekFormIdFree (FormId) == FALSE) {
- return VFR_RETURN_FORMID_REDEFINED;
- }
- mFormMap->FormId = FormId;
- CIfrFormId::MarkFormIdUsed (FormId);
- return VFR_RETURN_SUCCESS;
- }
-
- VOID SetFormMapMethod (IN EFI_STRING_ID MethodTitle, IN EFI_GUID *MethodGuid) {
- if (ExpendObjBin (sizeof (EFI_IFR_FORM_MAP_METHOD))) {
- IncLength (sizeof (EFI_IFR_FORM_MAP_METHOD));
-
- mMethodMap->MethodTitle = MethodTitle;
- memcpy (&(mMethodMap->MethodIdentifier), MethodGuid, sizeof (EFI_GUID));
- mMethodMap ++;
- }
- }
-};
-
-class CIfrVarStore : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_VARSTORE *mVarStore;
-
-public:
- CIfrVarStore () : CIfrObj (EFI_IFR_VARSTORE_OP, (CHAR8 **)&mVarStore, sizeof (EFI_IFR_VARSTORE), TRUE),
- CIfrOpHeader (EFI_IFR_VARSTORE_OP, &mVarStore->Header) {
- mVarStore->VarStoreId = EFI_VARSTORE_ID_INVALID;
- mVarStore->Size = 0;
- memset (&mVarStore->Guid, 0, sizeof (EFI_GUID));
- mVarStore->Name[0] = '\0';
- }
-
- VOID SetGuid (IN EFI_GUID *Guid) {
- memcpy (&mVarStore->Guid, Guid, sizeof (EFI_GUID));
- }
-
- VOID SetVarStoreId (IN EFI_VARSTORE_ID VarStoreId) {
- mVarStore->VarStoreId = VarStoreId;
- }
-
- VOID SetSize (IN UINT16 Size) {
- mVarStore->Size = Size;
- }
-
- VOID SetName (IN CHAR8 *Name) {
- UINT8 Len;
-
- if (Name != NULL) {
- Len = (UINT8) strlen (Name);
- if (Len != 0) {
- if (ExpendObjBin (Len) == TRUE) {
- IncLength (Len);
- strcpy ((CHAR8 *)(mVarStore->Name), Name);
- }
- }
- }
- }
-};
-
-class CIfrVarStoreEfi : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_VARSTORE_EFI *mVarStoreEfi;
-
-public:
- CIfrVarStoreEfi () : CIfrObj (EFI_IFR_VARSTORE_EFI_OP, (CHAR8 **)&mVarStoreEfi, sizeof (EFI_IFR_VARSTORE_EFI), TRUE),
- CIfrOpHeader (EFI_IFR_VARSTORE_EFI_OP, &mVarStoreEfi->Header) {
- mVarStoreEfi->VarStoreId = EFI_VAROFFSET_INVALID;
- mVarStoreEfi->Size = 0;
- memset (&mVarStoreEfi->Guid, 0, sizeof (EFI_GUID));
- mVarStoreEfi->Name[0] = '\0';
- }
-
- VOID SetGuid (IN EFI_GUID *Guid) {
- memcpy (&mVarStoreEfi->Guid, Guid, sizeof (EFI_GUID));
- }
-
- VOID SetVarStoreId (IN UINT16 VarStoreId) {
- mVarStoreEfi->VarStoreId = VarStoreId;
- }
-
- VOID SetAttributes (IN UINT32 Attributes) {
- mVarStoreEfi->Attributes = Attributes;
- }
- VOID SetSize (IN UINT16 Size) {
- mVarStoreEfi->Size = Size;
- }
-
- VOID SetName (IN CHAR8 *Name) {
- UINT8 Len;
-
- if (Name != NULL) {
- Len = (UINT8) strlen (Name);
- if (Len != 0) {
- if (ExpendObjBin (Len) == TRUE) {
- IncLength (Len);
- strcpy ((CHAR8 *)(mVarStoreEfi->Name), Name);
- }
- }
- }
- }
-
- VOID SetBinaryLength (IN UINT16 Size) {
- UINT16 Len;
-
- Len = sizeof (EFI_IFR_VARSTORE_EFI);
- if (Size > Len) {
- ExpendObjBin(Size - Len);
- IncLength(Size - Len);
- } else {
- ShrinkObjBin(Len - Size);
- DecLength(Len - Size);
- }
- }
-};
-
-class CIfrVarStoreNameValue : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_VARSTORE_NAME_VALUE *mVarStoreNameValue;
-
-public:
- CIfrVarStoreNameValue () : CIfrObj (EFI_IFR_VARSTORE_NAME_VALUE_OP, (CHAR8 **)&mVarStoreNameValue),
- CIfrOpHeader (EFI_IFR_VARSTORE_NAME_VALUE_OP, &mVarStoreNameValue->Header) {
- mVarStoreNameValue->VarStoreId = EFI_VAROFFSET_INVALID;
- memset (&mVarStoreNameValue->Guid, 0, sizeof (EFI_GUID));
- }
-
- VOID SetGuid (IN EFI_GUID *Guid) {
- memcpy (&mVarStoreNameValue->Guid, Guid, sizeof (EFI_GUID));
- }
-
- VOID SetVarStoreId (IN UINT16 VarStoreId) {
- mVarStoreNameValue->VarStoreId = VarStoreId;
- }
-};
-
-class CIfrImage : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_IMAGE *mImage;
-
-public:
- CIfrImage () : CIfrObj (EFI_IFR_IMAGE_OP, (CHAR8 **)&mImage),
- CIfrOpHeader (EFI_IFR_IMAGE_OP, &mImage->Header) {
- mImage->Id = EFI_IMAGE_ID_INVALID;
- }
-
- VOID SetImageId (IN EFI_IMAGE_ID ImageId) {
- mImage->Id = ImageId;
- }
-};
-
-class CIfrModal : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_MODAL_TAG *mModal;
-
-public:
- CIfrModal () : CIfrObj (EFI_IFR_MODAL_TAG_OP, (CHAR8 **)&mModal),
- CIfrOpHeader (EFI_IFR_MODAL_TAG_OP, &mModal->Header) {
- }
-};
-
-
-class CIfrLocked : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_LOCKED *mLocked;
-
-public:
- CIfrLocked () : CIfrObj (EFI_IFR_LOCKED_OP, (CHAR8 **)&mLocked),
- CIfrOpHeader (EFI_IFR_LOCKED_OP, &mLocked->Header) {}
-};
-
-class CIfrRule : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_RULE *mRule;
-
-public:
- CIfrRule () : CIfrObj (EFI_IFR_RULE_OP, (CHAR8 **)&mRule),
- mRule ((EFI_IFR_RULE *)GetObjBinAddr()),
- CIfrOpHeader (EFI_IFR_RULE_OP, &mRule->Header) {
- mRule->RuleId = EFI_RULE_ID_INVALID;
- }
-
- VOID SetRuleId (IN UINT8 RuleId) {
- mRule->RuleId = RuleId;
- }
-};
-
-static EFI_IFR_TYPE_VALUE gZeroEfiIfrTypeValue = {0, };
-
-class CIfrDefault : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_DEFAULT *mDefault;
-
-public:
- CIfrDefault (
- IN UINT8 Size,
- IN UINT16 DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD,
- IN UINT8 Type = EFI_IFR_TYPE_OTHER,
- IN EFI_IFR_TYPE_VALUE Value = gZeroEfiIfrTypeValue
- ) : CIfrObj (EFI_IFR_DEFAULT_OP, (CHAR8 **)&mDefault, Size),
- CIfrOpHeader (EFI_IFR_DEFAULT_OP, &mDefault->Header, Size) {
- mDefault->Type = Type;
- mDefault->DefaultId = DefaultId;
- memcpy (&(mDefault->Value), &Value, Size - OFFSET_OF (EFI_IFR_DEFAULT, Value));
- }
-
- VOID SetDefaultId (IN UINT16 DefaultId) {
- mDefault->DefaultId = DefaultId;
- }
-
- VOID SetType (IN UINT8 Type) {
- mDefault->Type = Type;
- }
-
- VOID SetValue (IN EFI_IFR_TYPE_VALUE Value) {
- memcpy (&mDefault->Value, &Value, mDefault->Header.Length - OFFSET_OF (EFI_IFR_DEFAULT, Value));
- }
-};
-
-class CIfrDefault2 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_DEFAULT_2 *mDefault;
-
-public:
- CIfrDefault2 (
- IN UINT16 DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD,
- IN UINT8 Type = EFI_IFR_TYPE_OTHER
- ) : CIfrObj (EFI_IFR_DEFAULT_OP, (CHAR8 **)&mDefault, sizeof (EFI_IFR_DEFAULT_2)),
- CIfrOpHeader (EFI_IFR_DEFAULT_OP, &mDefault->Header, sizeof (EFI_IFR_DEFAULT_2)) {
- mDefault->Type = Type;
- mDefault->DefaultId = DefaultId;
- }
-
- VOID SetDefaultId (IN UINT16 DefaultId) {
- mDefault->DefaultId = DefaultId;
- }
-
- VOID SetType (IN UINT8 Type) {
- mDefault->Type = Type;
- }
-};
-
-class CIfrValue : public CIfrObj, public CIfrOpHeader{
-private:
- EFI_IFR_VALUE *mValue;
-
-public:
- CIfrValue () : CIfrObj (EFI_IFR_VALUE_OP, (CHAR8 **)&mValue),
- CIfrOpHeader (EFI_IFR_VALUE_OP, &mValue->Header) {}
-
-};
-
-class CIfrRead : public CIfrObj, public CIfrOpHeader{
-private:
- EFI_IFR_READ *mRead;
-
-public:
- CIfrRead () : CIfrObj (EFI_IFR_READ_OP, (CHAR8 **)&mRead),
- CIfrOpHeader (EFI_IFR_READ_OP, &mRead->Header) {}
-
-};
-
-class CIfrWrite : public CIfrObj, public CIfrOpHeader{
-private:
- EFI_IFR_WRITE *mWrite;
-
-public:
- CIfrWrite () : CIfrObj (EFI_IFR_WRITE_OP, (CHAR8 **)&mWrite),
- CIfrOpHeader (EFI_IFR_WRITE_OP, &mWrite->Header) {}
-
-};
-
-class CIfrGet : public CIfrObj, public CIfrOpHeader{
-private:
- EFI_IFR_GET *mGet;
-
-public:
- CIfrGet (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_GET_OP, (CHAR8 **)&mGet),
- CIfrOpHeader (EFI_IFR_GET_OP, &mGet->Header) {
- SetLineNo (LineNo);
- }
-
- VOID SetVarInfo (IN EFI_VARSTORE_INFO *Info) {
- mGet->VarStoreId = Info->mVarStoreId;
- mGet->VarStoreInfo.VarName = Info->mInfo.mVarName;
- mGet->VarStoreInfo.VarOffset = Info->mInfo.mVarOffset;
- mGet->VarStoreType = Info->mVarType;
- }
-};
-
-class CIfrSet : public CIfrObj, public CIfrOpHeader{
-private:
- EFI_IFR_SET *mSet;
-
-public:
- CIfrSet (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_SET_OP, (CHAR8 **)&mSet),
- CIfrOpHeader (EFI_IFR_SET_OP, &mSet->Header) {
- SetLineNo (LineNo);
- }
-
- VOID SetVarInfo (IN EFI_VARSTORE_INFO *Info) {
- mSet->VarStoreId = Info->mVarStoreId;
- mSet->VarStoreInfo.VarName = Info->mInfo.mVarName;
- mSet->VarStoreInfo.VarOffset = Info->mInfo.mVarOffset;
- mSet->VarStoreType = Info->mVarType;
- }
-};
-
-class CIfrSubtitle : public CIfrObj, public CIfrOpHeader, public CIfrStatementHeader {
-private:
- EFI_IFR_SUBTITLE *mSubtitle;
-
-public:
- CIfrSubtitle () : CIfrObj (EFI_IFR_SUBTITLE_OP, (CHAR8 **)&mSubtitle),
- CIfrOpHeader (EFI_IFR_SUBTITLE_OP, &mSubtitle->Header),
- CIfrStatementHeader (&mSubtitle->Statement) {
- mSubtitle->Flags = 0;
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 LFlags) {
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_IFR_FLAGS_HORIZONTAL)) {
- mSubtitle->Flags |= EFI_IFR_FLAGS_HORIZONTAL;
- }
-
- return _FLAGS_ZERO (LFlags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;
- }
-};
-
-class CIfrText : public CIfrObj, public CIfrOpHeader, public CIfrStatementHeader {
-private:
- EFI_IFR_TEXT *mText;
-
-public:
- CIfrText () : CIfrObj (EFI_IFR_TEXT_OP, (CHAR8 **)&mText),
- CIfrOpHeader (EFI_IFR_TEXT_OP, &mText->Header),
- CIfrStatementHeader (&mText->Statement) {
- mText->TextTwo = EFI_STRING_ID_INVALID;
- }
-
- VOID SetTextTwo (IN EFI_STRING_ID StringId) {
- mText->TextTwo = StringId;
- }
-};
-
-class CIfrRef : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_REF *mRef;
-
-public:
- CIfrRef () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef),
- CIfrOpHeader (EFI_IFR_REF_OP, &mRef->Header),
- CIfrQuestionHeader (&mRef->Question) {
- mRef->FormId = 0;
- }
-
- VOID SetFormId (IN EFI_FORM_ID FormId) {
- mRef->FormId = FormId;
- }
-};
-
-class CIfrRef2 : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_REF2 *mRef2;
-
-public:
- CIfrRef2 () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef2, sizeof (EFI_IFR_REF2)),
- CIfrOpHeader (EFI_IFR_REF_OP, &mRef2->Header, sizeof (EFI_IFR_REF2)),
- CIfrQuestionHeader (&mRef2->Question) {
- mRef2->FormId = 0;
- mRef2->QuestionId = EFI_QUESTION_ID_INVALID;
- }
-
- VOID SetFormId (IN EFI_FORM_ID FormId) {
- mRef2->FormId = FormId;
- }
-
- VOID SetQuestionId (IN EFI_QUESTION_ID QuestionId) {
- mRef2->QuestionId = QuestionId;
- }
-};
-
-class CIfrRef3 : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_REF3 *mRef3;
-
-public:
- CIfrRef3 () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef3, sizeof(EFI_IFR_REF3)),
- CIfrOpHeader (EFI_IFR_REF_OP, &mRef3->Header, sizeof (EFI_IFR_REF3)),
- CIfrQuestionHeader (&mRef3->Question) {
- mRef3->FormId = 0;
- mRef3->QuestionId = EFI_QUESTION_ID_INVALID;
- memset (&mRef3->FormSetId, 0, sizeof (EFI_GUID));
- }
-
- VOID SetFormId (IN EFI_FORM_ID FormId) {
- mRef3->FormId = FormId;
- }
-
- VOID SetQuestionId (IN EFI_QUESTION_ID QuestionId) {
- mRef3->QuestionId = QuestionId;
- }
-
- VOID SetFormSetId (IN EFI_GUID FormSetId) {
- mRef3->FormSetId = FormSetId;
- }
-};
-
-class CIfrRef4 : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_REF4 *mRef4;
-
-public:
- CIfrRef4 () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef4, sizeof(EFI_IFR_REF4)),
- CIfrOpHeader (EFI_IFR_REF_OP, &mRef4->Header, sizeof(EFI_IFR_REF4)),
- CIfrQuestionHeader (&mRef4->Question) {
- mRef4->FormId = 0;
- mRef4->QuestionId = EFI_QUESTION_ID_INVALID;
- memset (&mRef4->FormSetId, 0, sizeof (EFI_GUID));
- mRef4->DevicePath = EFI_STRING_ID_INVALID;
- }
-
- VOID SetFormId (IN EFI_FORM_ID FormId) {
- mRef4->FormId = FormId;
- }
-
- VOID SetQuestionId (IN EFI_QUESTION_ID QuestionId) {
- mRef4->QuestionId = QuestionId;
- }
-
- VOID SetFormSetId (IN EFI_GUID FormSetId) {
- mRef4->FormSetId = FormSetId;
- }
-
- VOID SetDevicePath (IN EFI_STRING_ID DevicePath) {
- mRef4->DevicePath = DevicePath;
- }
-};
-
-class CIfrRef5 : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_REF5 *mRef5;
-
-public:
- CIfrRef5 () : CIfrObj (EFI_IFR_REF_OP, (CHAR8 **)&mRef5, sizeof (EFI_IFR_REF5)),
- CIfrOpHeader (EFI_IFR_REF_OP, &mRef5->Header, sizeof (EFI_IFR_REF5)),
- CIfrQuestionHeader (&mRef5->Question) {
- }
-};
-
-class CIfrResetButton : public CIfrObj, public CIfrOpHeader, public CIfrStatementHeader {
-private:
- EFI_IFR_RESET_BUTTON *mResetButton;
-
-public:
- CIfrResetButton () : CIfrObj (EFI_IFR_RESET_BUTTON_OP, (CHAR8 **)&mResetButton),
- CIfrOpHeader (EFI_IFR_RESET_BUTTON_OP, &mResetButton->Header),
- CIfrStatementHeader (&mResetButton->Statement) {
- mResetButton->DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
- }
-
- VOID SetDefaultId (IN UINT16 DefaultId) {
- mResetButton->DefaultId = DefaultId;
- }
-};
-
-class CIfrCheckBox : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_CHECKBOX *mCheckBox;
-
-public:
- CIfrCheckBox () : CIfrObj (EFI_IFR_CHECKBOX_OP, (CHAR8 **)&mCheckBox),
- CIfrOpHeader (EFI_IFR_CHECKBOX_OP, &mCheckBox->Header),
- CIfrQuestionHeader (&mCheckBox->Question) {
- mCheckBox->Flags = 0;
- gCurrentQuestion = this;
- }
-
- ~CIfrCheckBox () {
- gCurrentQuestion = NULL;
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 HFlags, UINT8 LFlags) {
- EFI_VFR_RETURN_CODE Ret;
-
- Ret = CIfrQuestionHeader::SetFlags (HFlags);
- if (Ret != VFR_RETURN_SUCCESS) {
- return Ret;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_IFR_CHECKBOX_DEFAULT)) {
- mCheckBox->Flags |= EFI_IFR_CHECKBOX_DEFAULT;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_IFR_CHECKBOX_DEFAULT_MFG)) {
- mCheckBox->Flags |= EFI_IFR_CHECKBOX_DEFAULT_MFG;
- }
-
- return _FLAGS_ZERO (LFlags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;
- }
-
- UINT8 GetFlags (VOID) {
- return mCheckBox->Flags;
- }
-};
-
-class CIfrAction : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_ACTION *mAction;
-
-public:
- CIfrAction () : CIfrObj (EFI_IFR_ACTION_OP, (CHAR8 **)&mAction),
- CIfrOpHeader (EFI_IFR_ACTION_OP, &mAction->Header),
- CIfrQuestionHeader (&mAction->Question) {
- mAction->QuestionConfig = EFI_STRING_ID_INVALID;
- }
-
- VOID SetQuestionConfig (IN EFI_STRING_ID QuestionConfig) {
- mAction->QuestionConfig = QuestionConfig;
- }
-};
-
-class CIfrDate : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_DATE *mDate;
-
-public:
- CIfrDate () : CIfrObj (EFI_IFR_DATE_OP, (CHAR8 **)&mDate),
- CIfrOpHeader (EFI_IFR_DATE_OP, &mDate->Header),
- CIfrQuestionHeader (&mDate->Question) {
- mDate->Flags = 0;
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 HFlags, IN UINT8 LFlags) {
- EFI_VFR_RETURN_CODE Ret;
-
- Ret = CIfrQuestionHeader::SetFlags (HFlags);
- if (Ret != VFR_RETURN_SUCCESS) {
- return Ret;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_QF_DATE_YEAR_SUPPRESS)) {
- mDate->Flags |= EFI_QF_DATE_YEAR_SUPPRESS;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_QF_DATE_MONTH_SUPPRESS)) {
- mDate->Flags |= EFI_QF_DATE_MONTH_SUPPRESS;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_QF_DATE_DAY_SUPPRESS)) {
- mDate->Flags |= EFI_QF_DATE_DAY_SUPPRESS;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, QF_DATE_STORAGE_NORMAL)) {
- mDate->Flags |= QF_DATE_STORAGE_NORMAL;
- } else if (_FLAG_TEST_AND_CLEAR (LFlags, QF_DATE_STORAGE_TIME)) {
- mDate->Flags |= QF_DATE_STORAGE_TIME;
- } else if (_FLAG_TEST_AND_CLEAR (LFlags, QF_DATE_STORAGE_WAKEUP)) {
- mDate->Flags |= QF_DATE_STORAGE_WAKEUP;
- }
-
- return _FLAGS_ZERO (LFlags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;
- }
-};
-
-class CIfrNumeric : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader, public CIfrMinMaxStepData {
-private:
- EFI_IFR_NUMERIC *mNumeric;
-
-public:
- CIfrNumeric () : CIfrObj (EFI_IFR_NUMERIC_OP, (CHAR8 **)&mNumeric, sizeof (EFI_IFR_NUMERIC), TRUE),
- CIfrOpHeader (EFI_IFR_NUMERIC_OP, &mNumeric->Header),
- CIfrQuestionHeader (&mNumeric->Question),
- CIfrMinMaxStepData (&mNumeric->data, TRUE) {
- mNumeric->Flags = EFI_IFR_NUMERIC_SIZE_1 | EFI_IFR_DISPLAY_UINT_DEC;
- gCurrentQuestion = this;
- gCurrentMinMaxData = this;
- }
-
- ~CIfrNumeric () {
- gCurrentQuestion = NULL;
- gCurrentMinMaxData = NULL;
- }
-
- VOID ShrinkBinSize (IN UINT16 Size) {
- //
- // Update the buffer size which is truly be used later.
- //
- ShrinkObjBin(Size);
- DecLength(Size);
-
- //
- // Allocate buffer in gCFormPkg.
- //
- _EMIT_PENDING_OBJ();
-
- //
- // Update the buffer pointer used by other class.
- //
- mNumeric = (EFI_IFR_NUMERIC *) GetObjBinAddr();
- UpdateHeader (&mNumeric->Header);
- UpdateCIfrQuestionHeader(&mNumeric->Question);
- UpdateCIfrMinMaxStepData(&mNumeric->data);
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 HFlags, IN UINT8 LFlags) {
- EFI_VFR_RETURN_CODE Ret;
-
- Ret = CIfrQuestionHeader::SetFlags (HFlags);
- if (Ret != VFR_RETURN_SUCCESS) {
- return Ret;
- }
-
- if (LFlags & EFI_IFR_DISPLAY) {
- mNumeric->Flags = LFlags;
- } else {
- mNumeric->Flags = LFlags | EFI_IFR_DISPLAY_UINT_DEC;
- }
- return VFR_RETURN_SUCCESS;
- }
-};
-
-class CIfrOneOf : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader, public CIfrMinMaxStepData {
-private:
- EFI_IFR_ONE_OF *mOneOf;
-
-public:
- CIfrOneOf () : CIfrObj (EFI_IFR_ONE_OF_OP, (CHAR8 **)&mOneOf, sizeof (EFI_IFR_ONE_OF), TRUE),
- CIfrOpHeader (EFI_IFR_ONE_OF_OP, &mOneOf->Header),
- CIfrQuestionHeader (&mOneOf->Question),
- CIfrMinMaxStepData (&mOneOf->data) {
- mOneOf->Flags = 0;
- gCurrentQuestion = this;
- gCurrentMinMaxData = this;
- }
-
- ~CIfrOneOf () {
- gCurrentQuestion = NULL;
- gCurrentMinMaxData = NULL;
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 HFlags, IN UINT8 LFlags) {
- EFI_VFR_RETURN_CODE Ret;
-
- Ret = CIfrQuestionHeader::SetFlags (HFlags);
- if (Ret != VFR_RETURN_SUCCESS) {
- return Ret;
- }
-
- if (LFlags & EFI_IFR_DISPLAY) {
- mOneOf->Flags = LFlags;
- } else {
- mOneOf->Flags = LFlags | EFI_IFR_DISPLAY_UINT_DEC;
- }
- return VFR_RETURN_SUCCESS;
- }
-
- VOID ShrinkBinSize (IN UINT16 Size) {
- //
- // Update the buffer size which is truly be used later.
- //
- ShrinkObjBin(Size);
- DecLength(Size);
-
- //
- // Allocate buffer in gCFormPkg.
- //
- _EMIT_PENDING_OBJ();
-
- //
- // Update the buffer pointer used by other class.
- //
- mOneOf = (EFI_IFR_ONE_OF *) GetObjBinAddr();
- UpdateHeader (&mOneOf->Header);
- UpdateCIfrQuestionHeader(&mOneOf->Question);
- UpdateCIfrMinMaxStepData(&mOneOf->data);
- }
-};
-
-class CIfrString : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_STRING *mString;
-
-public:
- CIfrString () : CIfrObj (EFI_IFR_STRING_OP, (CHAR8 **)&mString),
- CIfrOpHeader (EFI_IFR_STRING_OP, &mString->Header),
- CIfrQuestionHeader (&mString->Question) {
- mString->Flags = 0;
- mString->MinSize = 0;
- mString->MaxSize = 0;
- gCurrentQuestion = this;
- }
-
- ~CIfrString () {
- gCurrentQuestion = NULL;
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 HFlags, IN UINT8 LFlags) {
- EFI_VFR_RETURN_CODE Ret;
-
- Ret = CIfrQuestionHeader::SetFlags (HFlags);
- if (Ret != VFR_RETURN_SUCCESS) {
- return Ret;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_IFR_STRING_MULTI_LINE)) {
- mString->Flags |= EFI_IFR_STRING_MULTI_LINE;
- }
-
- return _FLAGS_ZERO (LFlags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;
- }
-
- VOID SetMinSize (IN UINT8 Flags) {
- mString->MinSize = Flags;
- }
-
- VOID SetMaxSize (IN UINT8 MaxSize) {
- mString->MaxSize = MaxSize;
- }
-};
-
-class CIfrPassword : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_PASSWORD *mPassword;
-
-public:
- CIfrPassword () : CIfrObj (EFI_IFR_PASSWORD_OP, (CHAR8 **)&mPassword),
- CIfrOpHeader (EFI_IFR_PASSWORD_OP, &mPassword->Header),
- CIfrQuestionHeader (&mPassword->Question) {
- mPassword->MinSize = 0;
- mPassword->MaxSize = 0;
- gCurrentQuestion = this;
- }
-
- ~CIfrPassword () {
- gCurrentQuestion = NULL;
- }
-
- VOID SetMinSize (IN UINT16 MinSize) {
- mPassword->MinSize = MinSize;
- }
-
- VOID SetMaxSize (IN UINT16 MaxSize) {
- mPassword->MaxSize = MaxSize;
- }
-};
-
-class CIfrOrderedList : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_ORDERED_LIST *mOrderedList;
-
-public:
- CIfrOrderedList () : CIfrObj (EFI_IFR_ORDERED_LIST_OP, (CHAR8 **)&mOrderedList),
- CIfrOpHeader (EFI_IFR_ORDERED_LIST_OP, &mOrderedList->Header),
- CIfrQuestionHeader (&mOrderedList->Question) {
- mOrderedList->MaxContainers = 0;
- mOrderedList->Flags = 0;
- gCurrentQuestion = this;
- }
-
- ~CIfrOrderedList () {
- gCurrentQuestion = NULL;
- }
-
- VOID SetMaxContainers (IN UINT8 MaxContainers) {
- mOrderedList->MaxContainers = MaxContainers;
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 HFlags, IN UINT8 LFlags) {
- EFI_VFR_RETURN_CODE Ret;
-
- Ret = CIfrQuestionHeader::SetFlags (HFlags);
- if (Ret != VFR_RETURN_SUCCESS) {
- return Ret;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_IFR_UNIQUE_SET)) {
- mOrderedList->Flags |= EFI_IFR_UNIQUE_SET;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_IFR_NO_EMPTY_SET)) {
- mOrderedList->Flags |= EFI_IFR_NO_EMPTY_SET;
- }
-
- return _FLAGS_ZERO (LFlags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;
- }
-};
-
-class CIfrTime : public CIfrObj, public CIfrOpHeader, public CIfrQuestionHeader {
-private:
- EFI_IFR_TIME *mTime;
-
-public:
- CIfrTime () : CIfrObj (EFI_IFR_TIME_OP, (CHAR8 **)&mTime),
- CIfrOpHeader (EFI_IFR_TIME_OP, &mTime->Header),
- CIfrQuestionHeader (&mTime->Question) {
- mTime->Flags = 0;
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 HFlags, IN UINT8 LFlags) {
- EFI_VFR_RETURN_CODE Ret;
-
- Ret = CIfrQuestionHeader::SetFlags (HFlags);
- if (Ret != VFR_RETURN_SUCCESS) {
- return Ret;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, QF_TIME_HOUR_SUPPRESS)) {
- mTime->Flags |= QF_TIME_HOUR_SUPPRESS;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, QF_TIME_MINUTE_SUPPRESS)) {
- mTime->Flags |= QF_TIME_MINUTE_SUPPRESS;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, QF_TIME_SECOND_SUPPRESS)) {
- mTime->Flags |= QF_TIME_SECOND_SUPPRESS;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, QF_TIME_STORAGE_NORMAL)) {
- mTime->Flags |= QF_TIME_STORAGE_NORMAL;
- } else if (_FLAG_TEST_AND_CLEAR (LFlags, QF_TIME_STORAGE_TIME)) {
- mTime->Flags |= QF_TIME_STORAGE_TIME;
- } else if (_FLAG_TEST_AND_CLEAR (LFlags, QF_TIME_STORAGE_WAKEUP)) {
- mTime->Flags |= QF_TIME_STORAGE_WAKEUP;
- }
-
- return _FLAGS_ZERO (LFlags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;
- }
-};
-
-class CIfrDisableIf : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_DISABLE_IF *mDisableIf;
-
-public:
- CIfrDisableIf () : CIfrObj (EFI_IFR_DISABLE_IF_OP, (CHAR8 **)&mDisableIf),
- mDisableIf ((EFI_IFR_DISABLE_IF *) GetObjBinAddr()),
- CIfrOpHeader (EFI_IFR_DISABLE_IF_OP, &mDisableIf->Header) {}
-};
-
-class CIfrSuppressIf : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_SUPPRESS_IF *mSuppressIf;
-
-public:
- CIfrSuppressIf () : CIfrObj (EFI_IFR_SUPPRESS_IF_OP, (CHAR8 **)&mSuppressIf),
- CIfrOpHeader (EFI_IFR_SUPPRESS_IF_OP, &mSuppressIf->Header) {}
-};
-
-class CIfrGrayOutIf : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GRAY_OUT_IF *mGrayOutIf;
-
-public:
- CIfrGrayOutIf () : CIfrObj (EFI_IFR_GRAY_OUT_IF_OP, (CHAR8 **)&mGrayOutIf),
- CIfrOpHeader (EFI_IFR_GRAY_OUT_IF_OP, &mGrayOutIf->Header) {}
-};
-
-class CIfrInconsistentIf : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_INCONSISTENT_IF *mInconsistentIf;
-
-public:
- CIfrInconsistentIf () : CIfrObj (EFI_IFR_INCONSISTENT_IF_OP, (CHAR8 **)&mInconsistentIf),
- CIfrOpHeader (EFI_IFR_INCONSISTENT_IF_OP, &mInconsistentIf->Header) {
- mInconsistentIf->Error = EFI_STRING_ID_INVALID;
- }
-
- VOID SetError (IN EFI_STRING_ID Error) {
- mInconsistentIf->Error = Error;
- }
-};
-
-class CIfrNoSubmitIf : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_NO_SUBMIT_IF *mNoSubmitIf;
-
-public:
- CIfrNoSubmitIf () : CIfrObj (EFI_IFR_NO_SUBMIT_IF_OP, (CHAR8 **)&mNoSubmitIf),
- CIfrOpHeader (EFI_IFR_NO_SUBMIT_IF_OP, &mNoSubmitIf->Header) {
- mNoSubmitIf->Error = EFI_STRING_ID_INVALID;
- }
-
- VOID SetError (IN EFI_STRING_ID Error) {
- mNoSubmitIf->Error = Error;
- }
-};
-
-class CIfrRefresh : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_REFRESH *mRefresh;
-
-public:
- CIfrRefresh () : CIfrObj (EFI_IFR_REFRESH_OP, (CHAR8 **)&mRefresh),
- CIfrOpHeader (EFI_IFR_REFRESH_OP, &mRefresh->Header) {
- mRefresh->RefreshInterval = 0;
- }
-
- VOID SetRefreshInterval (IN UINT8 RefreshInterval) {
- mRefresh->RefreshInterval = RefreshInterval;
- }
-};
-
-class CIfrRefreshId : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_REFRESH_ID *mRefreshId;
-
-public:
- CIfrRefreshId () : CIfrObj (EFI_IFR_REFRESH_ID_OP, (CHAR8 **)&mRefreshId),
- CIfrOpHeader (EFI_IFR_REFRESH_ID_OP, &mRefreshId->Header) {
- memset (&mRefreshId->RefreshEventGroupId, 0, sizeof (EFI_GUID));
- }
-
- VOID SetRefreshEventGroutId (IN EFI_GUID *RefreshEventGroupId) {
- memcpy (&mRefreshId->RefreshEventGroupId, RefreshEventGroupId, sizeof (EFI_GUID));
- }
-};
-
-class CIfrVarStoreDevice : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_VARSTORE_DEVICE *mVarStoreDevice;
-
-public:
- CIfrVarStoreDevice () : CIfrObj (EFI_IFR_VARSTORE_DEVICE_OP, (CHAR8 **)&mVarStoreDevice),
- CIfrOpHeader (EFI_IFR_VARSTORE_DEVICE_OP, &mVarStoreDevice->Header) {
- mVarStoreDevice->DevicePath = EFI_STRING_ID_INVALID;
- }
-
- VOID SetDevicePath (IN EFI_STRING_ID DevicePath) {
- mVarStoreDevice->DevicePath = DevicePath;
- }
-};
-
-class CIfrOneOfOption : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_ONE_OF_OPTION *mOneOfOption;
-
-public:
- CIfrOneOfOption (UINT8 Size) : CIfrObj (EFI_IFR_ONE_OF_OPTION_OP, (CHAR8 **)&mOneOfOption, Size),
- CIfrOpHeader (EFI_IFR_ONE_OF_OPTION_OP, &mOneOfOption->Header, Size) {
- mOneOfOption->Flags = 0;
- mOneOfOption->Option = EFI_STRING_ID_INVALID;
- mOneOfOption->Type = EFI_IFR_TYPE_OTHER;
- memset (&mOneOfOption->Value, 0, Size - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));
- }
-
- VOID SetOption (IN EFI_STRING_ID Option) {
- mOneOfOption->Option = Option;
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 LFlags) {
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_IFR_OPTION_DEFAULT)) {
- mOneOfOption->Flags |= EFI_IFR_OPTION_DEFAULT;
- }
-
- if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_IFR_OPTION_DEFAULT_MFG)) {
- mOneOfOption->Flags |= EFI_IFR_OPTION_DEFAULT_MFG;
- }
-
- if (_IS_EQUAL (LFlags, EFI_IFR_TYPE_NUM_SIZE_8)) {
- _FLAG_CLEAR (LFlags, EFI_IFR_TYPE_NUM_SIZE_8);
- mOneOfOption->Flags |= EFI_IFR_TYPE_NUM_SIZE_8;
- } else if (_IS_EQUAL (LFlags, EFI_IFR_TYPE_NUM_SIZE_16)) {
- _FLAG_CLEAR (LFlags, EFI_IFR_TYPE_NUM_SIZE_16);
- mOneOfOption->Flags |= EFI_IFR_TYPE_NUM_SIZE_16;
- } else if (_IS_EQUAL (LFlags, EFI_IFR_TYPE_NUM_SIZE_32)) {
- _FLAG_CLEAR (LFlags, EFI_IFR_TYPE_NUM_SIZE_32);
- mOneOfOption->Flags |= EFI_IFR_TYPE_NUM_SIZE_32;
- } else if (_IS_EQUAL (LFlags, EFI_IFR_TYPE_NUM_SIZE_64)) {
- _FLAG_CLEAR (LFlags, EFI_IFR_TYPE_NUM_SIZE_64);
- mOneOfOption->Flags |= EFI_IFR_TYPE_NUM_SIZE_64;
- } else if (_IS_EQUAL (LFlags, EFI_IFR_TYPE_BOOLEAN)) {
- _FLAG_CLEAR (LFlags, EFI_IFR_TYPE_BOOLEAN);
- mOneOfOption->Flags |= EFI_IFR_TYPE_BOOLEAN;
- } else if (_IS_EQUAL (LFlags, EFI_IFR_TYPE_TIME)) {
- _FLAG_CLEAR (LFlags, EFI_IFR_TYPE_TIME);
- mOneOfOption->Flags |= EFI_IFR_TYPE_TIME;
- } else if (_IS_EQUAL (LFlags, EFI_IFR_TYPE_DATE)) {
- _FLAG_CLEAR (LFlags, EFI_IFR_TYPE_DATE);
- mOneOfOption->Flags |= EFI_IFR_TYPE_DATE;
- } else if (_IS_EQUAL (LFlags, EFI_IFR_TYPE_STRING)) {
- _FLAG_CLEAR (LFlags, EFI_IFR_TYPE_STRING);
- mOneOfOption->Flags |= EFI_IFR_TYPE_STRING;
- } else if (_IS_EQUAL (LFlags, EFI_IFR_TYPE_OTHER)) {
- _FLAG_CLEAR (LFlags, EFI_IFR_TYPE_OTHER);
- mOneOfOption->Flags |= EFI_IFR_TYPE_OTHER;
- }
-
- return _FLAGS_ZERO (LFlags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;
- }
-
- VOID SetType (IN UINT8 Type) {
- mOneOfOption->Type = Type;
- }
-
- VOID SetValue (IN EFI_IFR_TYPE_VALUE Value) {
- memcpy (&mOneOfOption->Value, &Value, mOneOfOption->Header.Length - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));
- }
-
- UINT8 GetFlags (VOID) {
- return mOneOfOption->Flags;
- }
-};
-
-static EFI_GUID IfrTianoGuid = EFI_IFR_TIANO_GUID;
-static EFI_GUID IfrFrameworkGuid = EFI_IFR_FRAMEWORK_GUID;
-
-class CIfrClass : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GUID_CLASS *mClass;
-
-public:
- CIfrClass () : CIfrObj (EFI_IFR_GUID_OP, (CHAR8 **)&mClass, sizeof (EFI_IFR_GUID_CLASS)),
- CIfrOpHeader (EFI_IFR_GUID_OP, &mClass->Header, sizeof (EFI_IFR_GUID_CLASS)) {
- mClass->ExtendOpCode = EFI_IFR_EXTEND_OP_CLASS;
- mClass->Guid = IfrTianoGuid;
- mClass->Class = EFI_NON_DEVICE_CLASS;
- }
-
- VOID SetClass (IN UINT16 Class) {
- mClass->Class = Class;
- }
-};
-
-class CIfrSubClass : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GUID_SUBCLASS *mSubClass;
-
-public:
- CIfrSubClass () : CIfrObj (EFI_IFR_GUID_OP, (CHAR8 **)&mSubClass, sizeof (EFI_IFR_GUID_SUBCLASS)),
- CIfrOpHeader (EFI_IFR_GUID_OP, &mSubClass->Header, sizeof (EFI_IFR_GUID_SUBCLASS)) {
- mSubClass->ExtendOpCode = EFI_IFR_EXTEND_OP_SUBCLASS;
- mSubClass->Guid = IfrTianoGuid;
- mSubClass->SubClass = EFI_SETUP_APPLICATION_SUBCLASS;
- }
-
- VOID SetSubClass (IN UINT16 SubClass) {
- mSubClass->SubClass = SubClass;
- }
-};
-
-class CIfrLabel : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GUID_LABEL *mLabel;
-
-public:
- CIfrLabel () : CIfrObj (EFI_IFR_GUID_OP, (CHAR8 **)&mLabel, sizeof (EFI_IFR_GUID_LABEL)),
- CIfrOpHeader (EFI_IFR_GUID_OP, &mLabel->Header, sizeof (EFI_IFR_GUID_LABEL)) {
- mLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
- mLabel->Guid = IfrTianoGuid;
- }
-
- VOID SetNumber (IN UINT16 Number) {
- mLabel->Number = Number;
- }
-};
-
-class CIfrBanner : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GUID_BANNER *mBanner;
-
-public:
- CIfrBanner () : CIfrObj (EFI_IFR_GUID_OP, (CHAR8 **)&mBanner, sizeof (EFI_IFR_GUID_BANNER)),
- CIfrOpHeader (EFI_IFR_GUID_OP, &mBanner->Header, sizeof (EFI_IFR_GUID_BANNER)) {
- mBanner->ExtendOpCode = EFI_IFR_EXTEND_OP_BANNER;
- mBanner->Guid = IfrTianoGuid;
- }
-
- VOID SetTitle (IN EFI_STRING_ID StringId) {
- mBanner->Title = StringId;
- }
-
- VOID SetLine (IN UINT16 Line) {
- mBanner->LineNumber = Line;
- }
-
- VOID SetAlign (IN UINT8 Align) {
- mBanner->Alignment = Align;
- }
-};
-
-class CIfrOptionKey : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GUID_OPTIONKEY *mOptionKey;
-
-public:
- CIfrOptionKey (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_IFR_TYPE_VALUE &OptionValue,
- IN EFI_QUESTION_ID KeyValue
- ) : CIfrObj (EFI_IFR_GUID_OP, (CHAR8 **)&mOptionKey, sizeof (EFI_IFR_GUID_OPTIONKEY)),
- CIfrOpHeader (EFI_IFR_GUID_OP, &mOptionKey->Header, sizeof (EFI_IFR_GUID_OPTIONKEY)) {
- mOptionKey->ExtendOpCode = EFI_IFR_EXTEND_OP_OPTIONKEY;
- mOptionKey->Guid = IfrFrameworkGuid;
- mOptionKey->QuestionId = QuestionId;
- mOptionKey->OptionValue = OptionValue;
- mOptionKey->KeyValue = KeyValue;
- }
-};
-
-class CIfrVarEqName : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GUID_VAREQNAME *mVarEqName;
-
-public:
- CIfrVarEqName (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_STRING_ID NameId
- ) : CIfrObj (EFI_IFR_GUID_OP, (CHAR8 **)&mVarEqName, sizeof (EFI_IFR_GUID_VAREQNAME)),
- CIfrOpHeader (EFI_IFR_GUID_OP, &mVarEqName->Header, sizeof (EFI_IFR_GUID_VAREQNAME)) {
- mVarEqName->ExtendOpCode = EFI_IFR_EXTEND_OP_VAREQNAME;
- mVarEqName->Guid = IfrFrameworkGuid;
- mVarEqName->QuestionId = QuestionId;
- mVarEqName->NameId = NameId;
- }
-};
-
-class CIfrTimeout : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GUID_TIMEOUT *mTimeout;
-
-public:
- CIfrTimeout (IN UINT16 Timeout = 0) : CIfrObj (EFI_IFR_GUID_OP, (CHAR8 **)&mTimeout, sizeof (EFI_IFR_GUID_TIMEOUT)),
- CIfrOpHeader (EFI_IFR_GUID_OP, &mTimeout->Header, sizeof (EFI_IFR_GUID_TIMEOUT)) {
- mTimeout->ExtendOpCode = EFI_IFR_EXTEND_OP_TIMEOUT;
- mTimeout->Guid = IfrTianoGuid;
- mTimeout->TimeOut = Timeout;
- }
-
- VOID SetTimeout (IN UINT16 Timeout) {
- mTimeout->TimeOut = Timeout;
- }
-};
-
-class CIfrGuid : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GUID *mGuid;
-
-public:
- CIfrGuid (UINT8 Size) : CIfrObj (EFI_IFR_GUID_OP, (CHAR8 **)&mGuid, sizeof (EFI_IFR_GUID)+Size),
- CIfrOpHeader (EFI_IFR_GUID_OP, &mGuid->Header, sizeof (EFI_IFR_GUID)+Size) {
- memset (&mGuid->Guid, 0, sizeof (EFI_GUID));
- }
-
- VOID SetGuid (IN EFI_GUID *Guid) {
- memcpy (&mGuid->Guid, Guid, sizeof (EFI_GUID));
- }
-
- VOID SetData (IN UINT8* DataBuff, IN UINT8 Size) {
- memcpy ((UINT8 *)mGuid + sizeof (EFI_IFR_GUID), DataBuff, Size);
- }
-};
-
-class CIfrDup : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_DUP *mDup;
-
-public:
- CIfrDup (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_DUP_OP, (CHAR8 **)&mDup),
- CIfrOpHeader (EFI_IFR_DUP_OP, &mDup->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrEqIdId : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_EQ_ID_ID *mEqIdId;
-
-public:
- CIfrEqIdId (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_EQ_ID_ID_OP, (CHAR8 **)&mEqIdId),
- CIfrOpHeader (EFI_IFR_EQ_ID_ID_OP, &mEqIdId->Header) {
- SetLineNo (LineNo);
- mEqIdId->QuestionId1 = EFI_QUESTION_ID_INVALID;
- mEqIdId->QuestionId2 = EFI_QUESTION_ID_INVALID;
- }
-
- VOID SetQuestionId1 (
- IN EFI_QUESTION_ID QuestionId,
- IN CHAR8 *VarIdStr,
- IN UINT32 LineNo
- ) {
- if (QuestionId != EFI_QUESTION_ID_INVALID) {
- mEqIdId->QuestionId1 = QuestionId;
- } else {
- gCFormPkg.AssignPending (VarIdStr, (VOID *)(&mEqIdId->QuestionId1), sizeof (EFI_QUESTION_ID), LineNo, NO_QST_REFED);
- }
- }
-
- VOID SetQuestionId2 (
- IN EFI_QUESTION_ID QuestionId,
- IN CHAR8 *VarIdStr,
- IN UINT32 LineNo
- ) {
- if (QuestionId != EFI_QUESTION_ID_INVALID) {
- mEqIdId->QuestionId2 = QuestionId;
- } else {
- gCFormPkg.AssignPending (VarIdStr, (VOID *)(&mEqIdId->QuestionId2), sizeof (EFI_QUESTION_ID), LineNo, NO_QST_REFED);
- }
- }
-};
-
-class CIfrEqIdVal : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_EQ_ID_VAL *mEqIdVal;
-
-public:
- CIfrEqIdVal (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_EQ_ID_VAL_OP, (CHAR8 **)&mEqIdVal),
- CIfrOpHeader (EFI_IFR_EQ_ID_VAL_OP, &mEqIdVal->Header) {
- SetLineNo (LineNo);
- mEqIdVal->QuestionId = EFI_QUESTION_ID_INVALID;
- }
-
- VOID SetQuestionId (
- IN EFI_QUESTION_ID QuestionId,
- IN CHAR8 *VarIdStr,
- IN UINT32 LineNo
- ) {
- if (QuestionId != EFI_QUESTION_ID_INVALID) {
- mEqIdVal->QuestionId = QuestionId;
- } else {
- gCFormPkg.AssignPending (VarIdStr, (VOID *)(&mEqIdVal->QuestionId), sizeof (EFI_QUESTION_ID), LineNo, NO_QST_REFED);
- }
- }
-
- VOID SetValue (IN UINT16 Value) {
- mEqIdVal->Value = Value;
- }
-};
-
-class CIfrEqIdList : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_EQ_ID_VAL_LIST *mEqIdVList;
-
-public:
- CIfrEqIdList (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_EQ_ID_VAL_LIST_OP, (CHAR8 **)&mEqIdVList, sizeof (EFI_IFR_EQ_ID_VAL_LIST), TRUE),
- CIfrOpHeader (EFI_IFR_EQ_ID_VAL_LIST_OP, &mEqIdVList->Header) {
- SetLineNo (LineNo);
- mEqIdVList->QuestionId = EFI_QUESTION_ID_INVALID;
- mEqIdVList->ListLength = 0;
- mEqIdVList->ValueList[0] = 0;
- }
-
- VOID UpdateIfrBuffer (
- ) {
- _EMIT_PENDING_OBJ();
- mEqIdVList = (EFI_IFR_EQ_ID_VAL_LIST *) GetObjBinAddr();
- UpdateHeader (&mEqIdVList->Header);
- }
-
- VOID SetQuestionId (
- IN EFI_QUESTION_ID QuestionId,
- IN CHAR8 *VarIdStr,
- IN UINT32 LineNo
- ) {
- if (QuestionId != EFI_QUESTION_ID_INVALID) {
- mEqIdVList->QuestionId = QuestionId;
- } else {
- gCFormPkg.AssignPending (VarIdStr, (VOID *)(&mEqIdVList->QuestionId), sizeof (EFI_QUESTION_ID), LineNo, NO_QST_REFED);
- }
- }
-
- VOID SetListLength (IN UINT16 ListLength) {
- mEqIdVList->ListLength = ListLength;
- }
-
- VOID SetValueList (IN UINT16 Index, IN UINT16 Value) {
- if (Index == 0) {
- mEqIdVList->ValueList[0] = Value;
- return;
- }
-
- if (ExpendObjBin (sizeof (UINT16)) ==TRUE) {
- IncLength (sizeof (UINT16));
- mEqIdVList->ValueList[Index] = Value;
- }
- }
-};
-
-class CIfrQuestionRef1 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_QUESTION_REF1 *mQuestionRef1;
-
-public:
- CIfrQuestionRef1 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_QUESTION_REF1_OP, (CHAR8 **)&mQuestionRef1),
- CIfrOpHeader (EFI_IFR_QUESTION_REF1_OP, &mQuestionRef1->Header) {
- SetLineNo (LineNo);
- mQuestionRef1->QuestionId = EFI_QUESTION_ID_INVALID;
- }
-
- VOID SetQuestionId (
- IN EFI_QUESTION_ID QuestionId,
- IN CHAR8 *VarIdStr,
- IN UINT32 LineNo
- ) {
- if (QuestionId != EFI_QUESTION_ID_INVALID) {
- mQuestionRef1->QuestionId = QuestionId;
- } else {
- gCFormPkg.AssignPending (VarIdStr, (VOID *)(&mQuestionRef1->QuestionId), sizeof (EFI_QUESTION_ID), LineNo, NO_QST_REFED);
- }
- }
-};
-
-class CIfrQuestionRef2 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_QUESTION_REF2 *mQuestionRef2;
-
-public:
- CIfrQuestionRef2 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_QUESTION_REF2_OP, (CHAR8 **)&mQuestionRef2),
- CIfrOpHeader (EFI_IFR_QUESTION_REF2_OP, &mQuestionRef2->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrQuestionRef3 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_QUESTION_REF3 *mQuestionRef3;
-
-public:
- CIfrQuestionRef3 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_QUESTION_REF3_OP, (CHAR8 **)&mQuestionRef3),
- CIfrOpHeader (EFI_IFR_QUESTION_REF3_OP, &mQuestionRef3->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrQuestionRef3_2 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_QUESTION_REF3_2 *mQuestionRef3_2;
-
-public:
- CIfrQuestionRef3_2 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_QUESTION_REF3_OP, (CHAR8 **)&mQuestionRef3_2, sizeof (EFI_IFR_QUESTION_REF3_2)),
- CIfrOpHeader (EFI_IFR_QUESTION_REF3_OP, &mQuestionRef3_2->Header, sizeof (EFI_IFR_QUESTION_REF3_2)) {
- SetLineNo (LineNo);
- mQuestionRef3_2->DevicePath = EFI_STRING_ID_INVALID;
- }
-
- VOID SetDevicePath (IN EFI_STRING_ID DevicePath) {
- mQuestionRef3_2->DevicePath = DevicePath;
- }
-};
-
-class CIfrQuestionRef3_3 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_QUESTION_REF3_3 *mQuestionRef3_3;
-
-public:
- CIfrQuestionRef3_3 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_QUESTION_REF3_OP, (CHAR8 **)&mQuestionRef3_3, sizeof (EFI_IFR_QUESTION_REF3_3)),
- CIfrOpHeader (EFI_IFR_QUESTION_REF3_OP, &mQuestionRef3_3->Header, sizeof (EFI_IFR_QUESTION_REF3_3)) {
- SetLineNo (LineNo);
- mQuestionRef3_3->DevicePath = EFI_STRING_ID_INVALID;
- memset (&mQuestionRef3_3->Guid, 0, sizeof (EFI_GUID));
- }
-
- VOID SetDevicePath (IN EFI_STRING_ID DevicePath) {
- mQuestionRef3_3->DevicePath = DevicePath;
- }
-
- VOID SetGuid (IN EFI_GUID *Guid) {
- mQuestionRef3_3->Guid = *Guid;
- }
-};
-
-class CIfrRuleRef : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_RULE_REF *mRuleRef;
-
-public:
- CIfrRuleRef (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_RULE_REF_OP, (CHAR8 **)&mRuleRef),
- CIfrOpHeader (EFI_IFR_RULE_REF_OP, &mRuleRef->Header) {
- SetLineNo (LineNo);
- mRuleRef->RuleId = EFI_RULE_ID_INVALID;
- }
-
- VOID SetRuleId (IN UINT8 RuleId) {
- mRuleRef->RuleId = RuleId;
- }
-};
-
-class CIfrStringRef1 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_STRING_REF1 *mStringRef1;
-
-public:
- CIfrStringRef1 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_STRING_REF1_OP, (CHAR8 **)&mStringRef1),
- CIfrOpHeader (EFI_IFR_STRING_REF1_OP, &mStringRef1->Header) {
- SetLineNo (LineNo);
- mStringRef1->StringId = EFI_STRING_ID_INVALID;
- }
-
- VOID SetStringId (IN EFI_STRING_ID StringId) {
- mStringRef1->StringId = StringId;
- }
-};
-
-class CIfrStringRef2 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_STRING_REF2 *mStringRef2;
-
-public:
- CIfrStringRef2 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_STRING_REF2_OP, (CHAR8 **)&mStringRef2),
- CIfrOpHeader (EFI_IFR_STRING_REF2_OP, &mStringRef2->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrThis : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_THIS *mThis;
-
-public:
- CIfrThis (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_THIS_OP, (CHAR8 **)&mThis),
- CIfrOpHeader (EFI_IFR_THIS_OP, &mThis->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrSecurity : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_SECURITY *mSecurity;
-
-public:
- CIfrSecurity (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_SECURITY_OP, (CHAR8 **)&mSecurity),
- CIfrOpHeader (EFI_IFR_SECURITY_OP, &mSecurity->Header) {
- SetLineNo (LineNo);
- memset (&mSecurity->Permissions, 0, sizeof (EFI_GUID));
- }
-
- VOID SetPermissions (IN EFI_GUID *Permissions) {
- memcpy (&mSecurity->Permissions, Permissions, sizeof (EFI_GUID));
- }
-};
-
-class CIfrUint8 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_UINT8 *mUint8;
-
-public:
- CIfrUint8 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_UINT8_OP, (CHAR8 **)&mUint8),
- CIfrOpHeader (EFI_IFR_UINT8_OP, &mUint8->Header) {
- SetLineNo (LineNo);
- }
-
- VOID SetValue (IN UINT8 Value) {
- mUint8->Value = Value;
- }
-};
-
-class CIfrUint16 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_UINT16 *mUint16;
-
-public:
- CIfrUint16 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_UINT16_OP, (CHAR8 **)&mUint16),
- CIfrOpHeader (EFI_IFR_UINT16_OP, &mUint16->Header) {
- SetLineNo (LineNo);
- }
-
- VOID SetValue (IN UINT16 Value) {
- mUint16->Value = Value;
- }
-};
-
-class CIfrUint32 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_UINT32 *mUint32;
-
-public:
- CIfrUint32 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_UINT32_OP, (CHAR8 **)&mUint32),
- CIfrOpHeader (EFI_IFR_UINT32_OP, &mUint32->Header) {
- SetLineNo (LineNo);
- }
-
- VOID SetValue (IN UINT32 Value) {
- mUint32->Value = Value;
- }
-};
-
-class CIfrUint64 : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_UINT64 *mUint64;
-
-public:
- CIfrUint64 (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_UINT64_OP, (CHAR8 **)&mUint64),
- CIfrOpHeader (EFI_IFR_UINT64_OP, &mUint64->Header) {
- SetLineNo (LineNo);
- }
-
- VOID SetValue (IN UINT64 Value) {
- mUint64->Value = Value;
- }
-};
-
-class CIfrTrue : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_TRUE *mTrue;
-
-public:
- CIfrTrue (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_TRUE_OP, (CHAR8 **)&mTrue),
- CIfrOpHeader (EFI_IFR_TRUE_OP, &mTrue->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrFalse : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_FALSE *mFalse;
-
-public:
- CIfrFalse (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_FALSE_OP, (CHAR8 **)&mFalse),
- CIfrOpHeader (EFI_IFR_FALSE_OP, &mFalse->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrOne : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_ONE *mOne;
-
-public:
- CIfrOne (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_ONE_OP, (CHAR8 **)&mOne),
- CIfrOpHeader (EFI_IFR_ONE_OP, &mOne->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrOnes : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_ONES *mOnes;
-
-public:
- CIfrOnes (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_ONES_OP, (CHAR8 **)&mOnes),
- CIfrOpHeader (EFI_IFR_ONES_OP, &mOnes->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrZero : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_ZERO *mZero;
-
-public:
- CIfrZero (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_ZERO_OP, (CHAR8 **)&mZero),
- CIfrOpHeader (EFI_IFR_ZERO_OP, &mZero->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrUndefined : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_UNDEFINED *mUndefined;
-
-public:
- CIfrUndefined (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_UNDEFINED_OP, (CHAR8 **)&mUndefined),
- CIfrOpHeader (EFI_IFR_UNDEFINED_OP, &mUndefined->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrVersion : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_VERSION *mVersion;
-
-public:
- CIfrVersion (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_VERSION_OP, (CHAR8 **)&mVersion),
- CIfrOpHeader (EFI_IFR_VERSION_OP, &mVersion->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrLength : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_LENGTH *mLength;
-
-public:
- CIfrLength (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_LENGTH_OP, (CHAR8 **)&mLength),
- CIfrOpHeader (EFI_IFR_LENGTH_OP, &mLength->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrNot : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_NOT *mNot;
-
-public:
- CIfrNot (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_NOT_OP, (CHAR8 **)&mNot),
- CIfrOpHeader (EFI_IFR_NOT_OP, &mNot->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrBitWiseNot : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_BITWISE_NOT *mBitWise;
-
-public:
- CIfrBitWiseNot (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_BITWISE_NOT_OP, (CHAR8 **)&mBitWise),
- CIfrOpHeader (EFI_IFR_BITWISE_NOT_OP, &mBitWise->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrToBoolean : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_TO_BOOLEAN *mToBoolean;
-
-public:
- CIfrToBoolean (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_TO_BOOLEAN_OP, (CHAR8 **)&mToBoolean),
- CIfrOpHeader (EFI_IFR_TO_BOOLEAN_OP, &mToBoolean->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrToString : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_TO_STRING *mToString;
-
-public:
- CIfrToString (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_TO_STRING_OP, (CHAR8 **)&mToString),
- CIfrOpHeader (EFI_IFR_TO_STRING_OP, &mToString->Header) {
- SetLineNo (LineNo);
- }
-
- VOID SetFormat (IN UINT8 Format) {
- mToString->Format = Format;
- }
-};
-
-class CIfrToUint : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_TO_UINT *mToUint;
-
-public:
- CIfrToUint (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_TO_UINT_OP, (CHAR8 **)&mToUint),
- CIfrOpHeader (EFI_IFR_TO_UINT_OP, &mToUint->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrToUpper : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_TO_UPPER *mToUpper;
-
-public:
- CIfrToUpper (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_TO_UPPER_OP, (CHAR8 **)&mToUpper),
- CIfrOpHeader (EFI_IFR_TO_UPPER_OP, &mToUpper->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrToLower : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_TO_LOWER *mToLower;
-
-public:
- CIfrToLower (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_TO_LOWER_OP, (CHAR8 **)&mToLower),
- CIfrOpHeader (EFI_IFR_TO_LOWER_OP, &mToLower->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrAdd : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_ADD *mAdd;
-
-public:
- CIfrAdd (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_ADD_OP, (CHAR8 **)&mAdd),
- CIfrOpHeader (EFI_IFR_ADD_OP, &mAdd->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrBitWiseAnd : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_BITWISE_AND *mBitWiseAnd;
-
-public:
- CIfrBitWiseAnd (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_BITWISE_AND_OP, (CHAR8 **)&mBitWiseAnd),
- CIfrOpHeader (EFI_IFR_BITWISE_AND_OP, &mBitWiseAnd->Header) {
- SetLineNo(LineNo);
- }
-};
-
-class CIfrBitWiseOr : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_BITWISE_OR *mBitWiseOr;
-
-public:
- CIfrBitWiseOr (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_BITWISE_OR_OP, (CHAR8 **)&mBitWiseOr),
- CIfrOpHeader (EFI_IFR_BITWISE_OR_OP, &mBitWiseOr->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrAnd : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_AND *mAnd;
-
-public:
- CIfrAnd (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_AND_OP, (CHAR8 **)&mAnd),
- CIfrOpHeader (EFI_IFR_AND_OP, &mAnd->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrCatenate : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_CATENATE *mCatenate;
-
-public:
- CIfrCatenate (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_CATENATE_OP, (CHAR8 **)&mCatenate),
- CIfrOpHeader (EFI_IFR_CATENATE_OP, &mCatenate->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrDivide : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_DIVIDE *mDivide;
-
-public:
- CIfrDivide (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_DIVIDE_OP, (CHAR8 **)&mDivide),
- CIfrOpHeader (EFI_IFR_DIVIDE_OP, &mDivide->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrEqual : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_EQUAL *mEqual;
-
-public:
- CIfrEqual (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_EQUAL_OP, (CHAR8 **)&mEqual),
- CIfrOpHeader (EFI_IFR_EQUAL_OP, &mEqual->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrGreaterEqual : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GREATER_EQUAL *mGreaterEqual;
-
-public:
- CIfrGreaterEqual (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_GREATER_EQUAL_OP, (CHAR8 **)&mGreaterEqual),
- CIfrOpHeader (EFI_IFR_GREATER_EQUAL_OP, &mGreaterEqual->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrGreaterThan : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_GREATER_THAN *mGreaterThan;
-
-public:
- CIfrGreaterThan (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_GREATER_THAN_OP, (CHAR8 **)&mGreaterThan),
- CIfrOpHeader (EFI_IFR_GREATER_THAN_OP, &mGreaterThan->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrLessEqual : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_LESS_EQUAL *mLessEqual;
-
-public:
- CIfrLessEqual (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_LESS_EQUAL_OP, (CHAR8 **)&mLessEqual),
- CIfrOpHeader (EFI_IFR_LESS_EQUAL_OP, &mLessEqual->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrLessThan : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_LESS_THAN *mLessThan;
-
-public:
- CIfrLessThan (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_LESS_THAN_OP, (CHAR8 **)&mLessThan),
- CIfrOpHeader (EFI_IFR_LESS_THAN_OP, &mLessThan->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrMap : public CIfrObj, public CIfrOpHeader{
-private:
- EFI_IFR_MAP *mMap;
-
-public:
- CIfrMap (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_MAP_OP, (CHAR8 **)&mMap),
- CIfrOpHeader (EFI_IFR_MAP_OP, &mMap->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrMatch : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_MATCH *mMatch;
-
-public:
- CIfrMatch (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_MATCH_OP, (CHAR8 **)&mMatch),
- CIfrOpHeader (EFI_IFR_MATCH_OP, &mMatch->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrMultiply : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_MULTIPLY *mMultiply;
-
-public:
- CIfrMultiply (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_MULTIPLY_OP, (CHAR8 **)&mMultiply),
- CIfrOpHeader (EFI_IFR_MULTIPLY_OP, &mMultiply->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrModulo : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_MODULO *mModulo;
-
-public:
- CIfrModulo (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_MODULO_OP, (CHAR8 **)&mModulo),
- CIfrOpHeader (EFI_IFR_MODULO_OP, &mModulo->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrNotEqual : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_NOT_EQUAL *mNotEqual;
-
-public:
- CIfrNotEqual (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_NOT_EQUAL_OP, (CHAR8 **)&mNotEqual),
- CIfrOpHeader (EFI_IFR_NOT_EQUAL_OP, &mNotEqual->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrOr : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_OR *mOr;
-
-public:
- CIfrOr (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_OR_OP, (CHAR8 **)&mOr),
- CIfrOpHeader (EFI_IFR_OR_OP, &mOr->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrShiftLeft : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_SHIFT_LEFT *mShiftLeft;
-
-public:
- CIfrShiftLeft (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_SHIFT_LEFT_OP, (CHAR8 **)&mShiftLeft),
- CIfrOpHeader (EFI_IFR_SHIFT_LEFT_OP, &mShiftLeft->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrShiftRight : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_SHIFT_RIGHT *mShiftRight;
-
-public:
- CIfrShiftRight (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_SHIFT_RIGHT_OP, (CHAR8 **)&mShiftRight),
- CIfrOpHeader (EFI_IFR_SHIFT_RIGHT_OP, &mShiftRight->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrSubtract : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_SUBTRACT *mSubtract;
-
-public:
- CIfrSubtract (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_SUBTRACT_OP, (CHAR8 **)&mSubtract),
- CIfrOpHeader (EFI_IFR_SUBTRACT_OP, &mSubtract->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrConditional : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_CONDITIONAL *mConditional;
-
-public:
- CIfrConditional (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_CONDITIONAL_OP, (CHAR8 **)&mConditional),
- CIfrOpHeader (EFI_IFR_CONDITIONAL_OP, &mConditional->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrFind : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_FIND *mFind;
-
-public:
- CIfrFind (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_FIND_OP, (CHAR8 **)&mFind),
- CIfrOpHeader (EFI_IFR_FIND_OP, &mFind->Header) {
- SetLineNo (LineNo);
- }
-
- VOID SetFormat (IN UINT8 Format) {
- mFind->Format = Format;
- }
-};
-
-class CIfrMid : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_MID *mMid;
-
-public:
- CIfrMid (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_MID_OP, (CHAR8 **)&mMid),
- CIfrOpHeader (EFI_IFR_MID_OP, &mMid->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrToken : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_TOKEN *mToken;
-
-public:
- CIfrToken (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_TOKEN_OP, (CHAR8 **)&mToken),
- CIfrOpHeader (EFI_IFR_TOKEN_OP, &mToken->Header) {
- SetLineNo (LineNo);
- }
-};
-
-class CIfrSpan : public CIfrObj, public CIfrOpHeader {
-private:
- EFI_IFR_SPAN *mSpan;
-
-public:
- CIfrSpan (
- IN UINT32 LineNo
- ) : CIfrObj (EFI_IFR_SPAN_OP, (CHAR8 **)&mSpan),
- CIfrOpHeader (EFI_IFR_SPAN_OP, &mSpan->Header) {
- SetLineNo (LineNo);
- mSpan->Flags = EFI_IFR_FLAGS_FIRST_MATCHING;
- }
-
- EFI_VFR_RETURN_CODE SetFlags (IN UINT8 LFlags) {
- if (_IS_EQUAL (LFlags, EFI_IFR_FLAGS_FIRST_MATCHING)) {
- mSpan->Flags |= EFI_IFR_FLAGS_FIRST_MATCHING;
- } else if (_FLAG_TEST_AND_CLEAR (LFlags, EFI_IFR_FLAGS_FIRST_NON_MATCHING)) {
- mSpan->Flags |= EFI_IFR_FLAGS_FIRST_NON_MATCHING;
- }
-
- return _FLAGS_ZERO (LFlags) ? VFR_RETURN_SUCCESS : VFR_RETURN_FLAGS_UNSUPPORTED;
- }
-};
-
-#endif
diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
deleted file mode 100644
index 253834508a..0000000000
--- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
+++ /dev/null
@@ -1,4928 +0,0 @@
-/*++
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
- VfrSyntax.g
-
-Abstract:
-
---*/
-
-#header<<
-
-#include "EfiVfr.h"
-#include "VfrFormPkg.h"
-#include "VfrError.h"
-#include "VfrUtilityLib.h"
-#include "AToken.h"
-#include "ATokPtr.h"
->>
-
-<<
-#include "stdio.h"
-#include "PBlackBox.h"
-#include "DLexerBase.h"
-#include "VfrLexer.h"
-#include "AToken.h"
-
-#define GET_LINENO(Obj) ((Obj)->getLine())
-#define SET_LINE_INFO(Obj, L) {(Obj).SetLineNo((L)->getLine());} while (0)
-#define CRT_END_OP(Obj) {CIfrEnd EObj; if (Obj != NULL) EObj.SetLineNo ((Obj)->getLine());} while (0)
-
-typedef ANTLRCommonToken ANTLRToken;
-
-class CVfrDLGLexer : public VfrLexer
-{
-public:
- CVfrDLGLexer (DLGFileInput *F) : VfrLexer (F) {};
- INT32 errstd (char *Text)
- {
- printf ("unrecognized input '%s'\n", Text);
- }
-};
-
-UINT8
-VfrParserStart (
- IN FILE *File,
- IN INPUT_INFO_TO_SYNTAX *InputInfo
- )
-{
- ParserBlackBox<CVfrDLGLexer, EfiVfrParser, ANTLRToken> VfrParser(File);
- VfrParser.parser()->SetCompatibleMode (InputInfo->CompatibleMode);
- VfrParser.parser()->SetOverrideClassGuid (InputInfo->OverrideClassGuid);
- return VfrParser.parser()->vfrProgram();
-}
->>
-
-//
-// Define a lexical class for parsing quoted strings. Basically
-// starts with a double quote, and ends with a double quote that
-// is not preceeded with a backslash.
-//
-#lexclass QUOTED_STRING
-#token TheString "~[\"]*\"" << mode (START); >>
-
-//
-// Define a lexclass for skipping over C++ style comments
-//
-#lexclass CPP_COMMENT
-#token "~[\n]*" << skip (); >>
-#token "\n" << skip (); mode (START); newline (); >>
-
-//
-// Standard lexclass is START
-//
-#lexclass START
-
-//
-// Find start of C++ style comments
-//
-#token "//" << skip (); mode (CPP_COMMENT); >>
-
-//
-// Skip whitespace
-//
-#token "[\ \t]" << skip (); >>
-
-//
-// Skip over newlines, but count them
-//
-#token "\n" << skip (); newline (); >>
-
-//
-// Skip over 'extern' in any included .H file
-//
-#token "extern" << skip (); mode (CPP_COMMENT); >>
-
-//
-// Tokens for the different keywords. Syntax is:
-// TokenName("ErrorMessageText") "TokenString"
-// where:
-// TokenName is the token name (must be capitalized) that is used in the rules
-// ErrorMessageText is the string the compiler emits when it detects a syntax error
-// TokenString is the actual matching string used in the user script
-//
-#token FormPkgType("formpkgtype") "formpkgtype"
-#token OpenBrace("{") "\{"
-#token CloseBrace("}") "\}"
-#token OpenParen("(") "\("
-#token CloseParen(")") "\)"
-#token OpenBracket("[") "\["
-#token CloseBracket("]") "\]"
-
-#token LineDefinition "#line\ [0-9]+\ \"~[\"]+\"[\ \t]*\n" << gCVfrErrorHandle.ParseFileScopeRecord (begexpr (), line ()); skip (); newline (); >>
-#token DevicePath("devicepath") "devicepath"
-#token FormSet("formset") "formset"
-#token FormSetId("formsetid") "formsetid"
-#token EndFormSet("endformset") "endformset"
-#token Title("title") "title"
-#token FormId("formid") "formid"
-#token OneOf("oneof") "oneof"
-#token EndOneOf("endoneof") "endoneof"
-#token Prompt("prompt") "prompt"
-#token OrderedList("orderedlist") "orderedlist"
-#token MaxContainers("maxcontainers") "maxcontainers"
-#token EndList("endlist") "endlist"
-#token EndForm("endform") "endform"
-#token Form("form") "form"
-#token FormMap("formmap") "formmap"
-#token MapTitle("maptitle") "maptitle"
-#token MapGuid("mapguid") "mapguid"
-#token Subtitle("subtitle") "subtitle"
-#token Help("help") "help"
-#token Text("text") "text"
-#token Option("option") "option"
-#token FLAGS("flags") "flags"
-#token Date("date") "date"
-#token EndDate("enddate") "enddate"
-#token Year("year") "year"
-#token Month("month") "month"
-#token Day("day") "day"
-#token Time("time") "time"
-#token EndTime("endtime") "endtime"
-#token Hour("hour") "hour"
-#token Minute("minute") "minute"
-#token Second("second") "second"
-#token GrayOutIf("grayoutif") "grayoutif"
-#token Label("label") "label"
-#token Timeout("timeout") "timeout"
-#token Inventory("inventory") "inventory"
-#token NonNvDataMap("_NON_NV_DATA_MAP") "_NON_NV_DATA_MAP"
-#token Struct("struct") "struct"
-#token Boolean("BOOLEAN") "BOOLEAN"
-#token Uint64("UINT64") "UINT64"
-#token Uint32("UINT32") "UINT32"
-#token Uint16("UINT16") "UINT16"
-#token Char16("CHAR16") "CHAR16"
-#token Uint8("UINT8") "UINT8"
-#token Uuid("guid") "guid"
-#token CheckBox("checkbox") "checkbox"
-#token EndCheckBox("endcheckbox") "endcheckbox"
-#token Numeric("numeric") "numeric"
-#token EndNumeric("endnumeric") "endnumeric"
-#token Minimum("minimum") "minimum"
-#token Maximum("maximum") "maximum"
-#token STEP("step") "step"
-#token Default("default") "default"
-#token Password("password") "password"
-#token EndPassword("endpassword") "endpassword"
-#token String("string") "string"
-#token EndString("endstring") "endstring"
-#token MinSize("minsize") "minsize"
-#token MaxSize("maxsize") "maxsize"
-#token Encoding("encoding") "encoding"
-#token SuppressIf("suppressif") "suppressif"
-#token DisableIf("disableif") "disableif"
-#token Hidden("hidden") "hidden"
-#token Goto("goto") "goto"
-#token FormSetGuid("formsetguid") "formsetguid"
-#token InconsistentIf("inconsistentif") "inconsistentif"
-#token NoSubmitIf("nosubmitif") "nosubmitif"
-#token EndIf("endif") "endif"
-#token Key("key") "key"
-#token DefaultFlag("DEFAULT") "DEFAULT"
-#token ManufacturingFlag("MANUFACTURING") "MANUFACTURING"
-#token InteractiveFlag("INTERACTIVE") "INTERACTIVE"
-#token NVAccessFlag("NV_ACCESS") "NV_ACCESS"
-#token ResetRequiredFlag("RESET_REQUIRED") "RESET_REQUIRED"
-#token LateCheckFlag("LATE_CHECK") "LATE_CHECK"
-#token ReadOnlyFlag("READ_ONLY") "READ_ONLY"
-#token OptionOnlyFlag("OPTIONS_ONLY") "OPTIONS_ONLY"
-#token Class("class") "class"
-#token Subclass("subclass") "subclass"
-#token ClassGuid("classguid") "classguid"
-#token TypeDef("typedef") "typedef"
-#token Restore("restore") "restore"
-#token Save("save") "save"
-#token Defaults("defaults") "defaults"
-#token Banner("banner") "banner"
-#token Align("align") "align"
-#token Left("left") "left"
-#token Right("right") "right"
-#token Center("center") "center"
-#token Line("line") "line"
-#token Name("name") "name"
-
-#token VarId("varid") "varid"
-#token Question("question") "question"
-#token QuestionId("questionid") "questionid"
-#token Image("image") "image"
-#token Locked("locked") "locked"
-#token Rule("rule") "rule"
-#token EndRule("endrule") "endrule"
-#token Value("value") "value"
-#token Read("read") "read"
-#token Write("write") "write"
-#token ResetButton("resetbutton") "resetbutton"
-#token EndResetButton("endresetbutton") "endresetbutton"
-#token DefaultStore("defaultstore") "defaultstore"
-#token Attribute("attribute") "attribute"
-#token Varstore("varstore") "varstore"
-#token Efivarstore("efivarstore") "efivarstore"
-#token VarSize("varsize") "varsize"
-#token NameValueVarStore("namevaluevarstore") "namevaluevarstore"
-#token Action("action") "action"
-#token Config("config") "config"
-#token EndAction("endaction") "endaction"
-#token Refresh("refresh") "refresh"
-#token Interval("interval") "interval"
-#token VarstoreDevice("varstoredevice") "varstoredevice"
-#token GuidOp("guidop") "guidop"
-#token EndGuidOp("endguidop") "endguidop"
-#token DataType("datatype") "datatype"
-#token Data("data") "data"
-#token Modal("modal") "modal"
-
-//
-// Define the class and subclass tokens
-//
-#token ClassNonDevice("NONDEVICE") "NON_DEVICE"
-#token ClassDiskDevice("DISK_DEVICE") "DISK_DEVICE"
-#token ClassVideoDevice("VIDEO_DEVICE") "VIDEO_DEVICE"
-#token ClassNetworkDevice("NETWORK_DEVICE") "NETWORK_DEVICE"
-#token ClassInputDevice("INPUT_DEVICE") "INPUT_DEVICE"
-#token ClassOnBoardDevice("ONBOARD_DEVICE") "ONBOARD_DEVICE"
-#token ClassOtherDevice("OTHER_DEVICE") "OTHER_DEVICE"
-
-#token SubclassSetupApplication("SETUP_APPLICATION") "SETUP_APPLICATION"
-#token SubclassGeneralApplication("GENERAL_APPLICATION") "GENERAL_APPLICATION"
-#token SubclassFrontPage("FRONT_PAGE") "FRONT_PAGE"
-#token SubclassSingleUse("SINGLE_USE") "SINGLE_USE"
-
-//
-// This is the overall definition of a VFR form definition script.
-//
-
-vfrProgram > [UINT8 Return] :
- <<
- mParserStatus = 0;
- mCIfrOpHdrIndex = 0;
- mConstantOnlyInExpression = FALSE;
- >>
- (
- vfrPragmaPackDefinition
- | vfrDataStructDefinition
- )*
- vfrFormSetDefinition
- << $Return = mParserStatus; >>
- ;
-
-pragmaPackShowDef :
- L:"show" << gCVfrVarDataTypeDB.Pack (L->getLine(), VFR_PACK_SHOW); >>
- ;
-
-pragmaPackStackDef :
- <<
- UINT32 LineNum;
- UINT8 PackAction;
- CHAR8 *Identifier = NULL;
- UINT32 PackNumber = DEFAULT_PACK_ALIGN;
- >>
- (
- L1:"push" << LineNum = L1->getLine(); PackAction = VFR_PACK_PUSH; >>
- | L2:"pop" << LineNum = L2->getLine(); PackAction = VFR_PACK_POP; >>
- )
- {
- "," ID:StringIdentifier << Identifier = ID->getText(); >>
- }
- {
- "," N:Number << PackAction |= VFR_PACK_ASSIGN; PackNumber = _STOU32(N->getText()); >>
- }
- << gCVfrVarDataTypeDB.Pack (LineNum, PackAction, Identifier, PackNumber); >>
- ;
-
-pragmaPackNumber :
- <<
- UINT32 LineNum;
- UINT32 PackNumber = DEFAULT_PACK_ALIGN;
- >>
- N:Number << LineNum = N->getLine(); PackNumber = _STOU32(N->getText()); >>
- << gCVfrVarDataTypeDB.Pack (LineNum, VFR_PACK_ASSIGN, NULL, PackNumber); >>
- ;
-
-vfrPragmaPackDefinition :
- "\#pragma" "pack" "\("
- {
- pragmaPackShowDef
- | pragmaPackStackDef
- | pragmaPackNumber
- }
- "\)"
- ;
-
-vfrDataStructDefinition :
- { TypeDef } Struct << gCVfrVarDataTypeDB.DeclareDataTypeBegin (); >>
- { NonNvDataMap }
- {
- N1:StringIdentifier << _PCATCH(gCVfrVarDataTypeDB.SetNewTypeName (N1->getText()), N1); >>
- }
- OpenBrace
- vfrDataStructFields
- CloseBrace
- {
- N2:StringIdentifier << _PCATCH(gCVfrVarDataTypeDB.SetNewTypeName (N2->getText()), N2); >>
- }
- ";" << gCVfrVarDataTypeDB.DeclareDataTypeEnd (); >>
- ;
-
-vfrDataStructFields :
- (
- dataStructField64 |
- dataStructField32 |
- dataStructField16 |
- dataStructField8 |
- dataStructFieldBool |
- dataStructFieldString |
- dataStructFieldDate |
- dataStructFieldTime |
- dataStructFieldRef |
- dataStructFieldUser
- )*
- ;
-
-dataStructField64 :
- << UINT32 ArrayNum = 0; >>
- D:"UINT64"
- N:StringIdentifier
- {
- OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
- }
- ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>
- ;
-
-dataStructField32 :
- << UINT32 ArrayNum = 0; >>
- D:"UINT32"
- N:StringIdentifier
- {
- OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
- }
- ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>
- ;
-
-dataStructField16 :
- <<
- UINT32 ArrayNum = 0;
- >>
- ("UINT16" | "CHAR16")
- N:StringIdentifier
- {
- OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
- }
- ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), (CHAR8 *) "UINT16", ArrayNum), N); >>
- ;
-
-dataStructField8 :
- << UINT32 ArrayNum = 0; >>
- D:"UINT8"
- N:StringIdentifier
- {
- OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
- }
- ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>
- ;
-
-dataStructFieldBool :
- << UINT32 ArrayNum = 0; >>
- D:"BOOLEAN"
- N:StringIdentifier
- {
- OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
- }
- ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>
- ;
-
-dataStructFieldString :
- << UINT32 ArrayNum = 0; >>
- D:"EFI_STRING_ID"
- N:StringIdentifier
- {
- OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
- }
- ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>
- ;
-
-dataStructFieldDate :
- << UINT32 ArrayNum = 0; >>
- D:"EFI_HII_DATE"
- N:StringIdentifier
- {
- OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
- }
- ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>
- ;
-
-dataStructFieldTime :
- << UINT32 ArrayNum = 0; >>
- D:"EFI_HII_TIME"
- N:StringIdentifier
- {
- OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
- }
- ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>
- ;
-
-dataStructFieldRef :
- << UINT32 ArrayNum = 0; >>
- D:"EFI_HII_REF"
- N:StringIdentifier
- {
- OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
- }
- ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), D->getText(), ArrayNum), N); >>
- ;
-
-dataStructFieldUser :
- << UINT32 ArrayNum = 0; >>
- T:StringIdentifier
- N:StringIdentifier
- {
- OpenBracket I:Number CloseBracket << ArrayNum = _STOU32(I->getText()); >>
- }
- ";" << _PCATCH(gCVfrVarDataTypeDB.DataTypeAddField (N->getText(), T->getText(), ArrayNum), T); >>
- ;
-
-//*****************************************************************************
-//
-// the syntax of GUID definition
-//
-guidSubDefinition [EFI_GUID &Guid] :
- G4:Number "," G5:Number "," G6:Number "," G7:Number "," G8:Number "," G9:Number "," G10:Number "," G11:Number
- <<
- Guid.Data4[0] = _STOU8(G4->getText());
- Guid.Data4[1] = _STOU8(G5->getText());
- Guid.Data4[2] = _STOU8(G6->getText());
- Guid.Data4[3] = _STOU8(G7->getText());
- Guid.Data4[4] = _STOU8(G8->getText());
- Guid.Data4[5] = _STOU8(G9->getText());
- Guid.Data4[6] = _STOU8(G10->getText());
- Guid.Data4[7] = _STOU8(G11->getText());
- >>
- ;
-
-guidDefinition [EFI_GUID &Guid] :
- OpenBrace
- G1:Number "," G2:Number "," G3:Number ","
- <<
- Guid.Data1 = _STOU32 (G1->getText());
- Guid.Data2 = _STOU16 (G2->getText());
- Guid.Data3 = _STOU16 (G3->getText());
- >>
- (
- OpenBrace guidSubDefinition[Guid] CloseBrace
- | guidSubDefinition[Guid]
- )
- CloseBrace
- ;
-
-//*****************************************************************************
-//
-// the syntax of form set definition
-//
-vfrFormSetDefinition :
- <<
- EFI_GUID Guid;
- EFI_GUID DefaultClassGuid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID;
- EFI_GUID ClassGuid1, ClassGuid2, ClassGuid3;
- UINT8 ClassGuidNum = 0;
- CIfrFormSet *FSObj = NULL;
- UINT16 C, SC;
- CHAR8* InsertOpcodeAddr = NULL;
- >>
- L:FormSet
- Uuid "=" guidDefinition[Guid] ","
- Title "=" "STRING_TOKEN" "\(" S1:Number "\)" ","
- Help "=" "STRING_TOKEN" "\(" S2:Number "\)" ","
- {
- ClassGuid "=" guidDefinition[ClassGuid1] << ++ClassGuidNum; >>
- {
- "\|" guidDefinition[ClassGuid2] << ++ClassGuidNum; >>
- }
- {
- "\|" guidDefinition[ClassGuid3] << ++ClassGuidNum; >>
- }
- ","
- }
- <<
- if (mOverrideClassGuid != NULL && ClassGuidNum >= 3) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Already has 3 class guids, can't add extra class guid!");
- }
- switch (ClassGuidNum) {
- case 0:
- if (mOverrideClassGuid != NULL) {
- ClassGuidNum = 2;
- } else {
- ClassGuidNum = 1;
- }
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
- FSObj->SetClassGuid(&DefaultClassGuid);
- if (mOverrideClassGuid != NULL) {
- FSObj->SetClassGuid(mOverrideClassGuid);
- }
- break;
- case 1:
- if (mOverrideClassGuid != NULL) {
- ClassGuidNum ++;
- }
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
- FSObj->SetClassGuid(&ClassGuid1);
- if (mOverrideClassGuid != NULL) {
- FSObj->SetClassGuid(mOverrideClassGuid);
- }
- break;
- case 2:
- if (mOverrideClassGuid != NULL) {
- ClassGuidNum ++;
- }
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
- FSObj->SetClassGuid(&ClassGuid1);
- FSObj->SetClassGuid(&ClassGuid2);
- if (mOverrideClassGuid != NULL) {
- FSObj->SetClassGuid(mOverrideClassGuid);
- }
- break;
- case 3:
- FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
- FSObj->SetClassGuid(&ClassGuid1);
- FSObj->SetClassGuid(&ClassGuid2);
- FSObj->SetClassGuid(&ClassGuid3);
- break;
- default:
- break;
- }
-
- SET_LINE_INFO (*FSObj, L);
- FSObj->SetGuid (&Guid);
- //
- // for framework vfr to store formset guid used by varstore and efivarstore
- //
- if (mCompatibleMode) {
- memcpy (&mFormsetGuid, &Guid, sizeof (EFI_GUID));
- }
- FSObj->SetFormSetTitle (_STOSID(S1->getText()));
- FSObj->SetHelp (_STOSID(S2->getText()));
- >>
- {
- FC:Class "=" classDefinition[C] "," << {CIfrClass CObj;SET_LINE_INFO (CObj, FC); CObj.SetClass(C);} >>
- }
- {
- FSC:Subclass "=" subclassDefinition[SC] "," << {CIfrSubClass SCObj; SET_LINE_INFO (SCObj, FSC); SCObj.SetSubClass(SC);} >>
- }
- <<
- _DeclareStandardDefaultStorage (GET_LINENO (L));
- >>
- vfrFormSetList
- E:EndFormSet <<
- if (mCompatibleMode) {
- //
- // declare all undefined varstore and efivarstore
- //
- _DeclareDefaultFrameworkVarStore (GET_LINENO(E));
- }
-
- //
- // Declare undefined Question so that they can be used in expression.
- //
- if (gCFormPkg.HavePendingUnassigned()) {
- mParserStatus += gCFormPkg.DeclarePendingQuestion (
- gCVfrVarDataTypeDB,
- mCVfrDataStorage,
- mCVfrQuestionDB,
- &mFormsetGuid,
- E->getLine(),
- &InsertOpcodeAddr
- );
- gNeedAdjustOpcode = TRUE;
- }
-
- CRT_END_OP (E);
-
- //
- // Adjust the pending question position.
- // Move the position from current to before the end of the last form in the form set.
- //
- if (gNeedAdjustOpcode) {
- gCFormPkg.AdjustDynamicInsertOpcode (
- mLastFormEndAddr,
- InsertOpcodeAddr
- );
- }
-
- if (FSObj != NULL) {
- delete FSObj;
- }
- >>
- ";"
- ;
-
-vfrFormSetList :
- (
- vfrFormDefinition |
- vfrFormMapDefinition |
- vfrStatementImage |
- vfrStatementVarStoreLinear |
- vfrStatementVarStoreEfi |
- vfrStatementVarStoreNameValue |
- vfrStatementDefaultStore |
- vfrStatementDisableIfFormSet |
- vfrStatementSuppressIfFormSet |
- vfrStatementExtension
- )*
- ;
-
-vfrStatementExtension:
- <<
- EFI_GUID Guid;
- CIfrGuid *GuidObj = NULL;
- CHAR8 *TypeName = NULL;
- UINT32 TypeSize = 0;
- UINT8 *DataBuff = NULL;
- UINT32 Size = 0;
- UINT8 Idx = 0;
- UINT32 LineNum;
- BOOLEAN IsStruct = FALSE;
- UINT32 ArrayNum = 0;
- >>
- L:GuidOp
- Uuid "=" guidDefinition[Guid]
- {"," DataType "="
- (
- U64:"UINT64" {OpenBracket AN1:Number CloseBracket <<ArrayNum = _STOU32(AN1->getText());>>}
- << TypeName = U64->getText(); LineNum = U64->getLine(); >>
- | U32:"UINT32" {OpenBracket AN2:Number CloseBracket <<ArrayNum = _STOU32(AN2->getText());>>}
- << TypeName = U32->getText(); LineNum = U32->getLine(); >>
- | U16:"UINT16" {OpenBracket AN3:Number CloseBracket <<ArrayNum = _STOU32(AN3->getText());>>}
- << TypeName = U16->getText(); LineNum = U16->getLine(); >>
- | U8:"UINT8" {OpenBracket AN4:Number CloseBracket <<ArrayNum = _STOU32(AN4->getText());>>}
- << TypeName = U8->getText(); LineNum = U8->getLine(); >>
- | BL:"BOOLEAN" {OpenBracket AN5:Number CloseBracket <<ArrayNum = _STOU32(AN5->getText());>>}
- << TypeName = BL->getText(); LineNum = BL->getLine(); >>
- | SI:"EFI_STRING_ID" {OpenBracket AN6:Number CloseBracket <<ArrayNum = _STOU32(AN6->getText());>>}
- << TypeName = SI->getText(); LineNum = SI->getLine(); >>
- | D:"EFI_HII_DATE" {OpenBracket AN7:Number CloseBracket <<ArrayNum = _STOU32(AN7->getText());>>}
- << TypeName = D->getText(); LineNum = D->getLine(); IsStruct = TRUE;>>
- | T:"EFI_HII_TIME" {OpenBracket AN8:Number CloseBracket <<ArrayNum = _STOU32(AN8->getText());>>}
- << TypeName = T->getText(); LineNum = T->getLine(); IsStruct = TRUE;>>
- | R:"EFI_HII_REF" {OpenBracket AN9:Number CloseBracket <<ArrayNum = _STOU32(AN9->getText());>>}
- << TypeName = R->getText(); LineNum = R->getLine(); IsStruct = TRUE;>>
- | TN:StringIdentifier {OpenBracket AN10:Number CloseBracket <<ArrayNum = _STOU32(AN10->getText());>>}
- << TypeName = TN->getText(); LineNum = TN->getLine(); IsStruct = TRUE;>>
- )
- <<
- _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &TypeSize), LineNum);
- if (ArrayNum > 0) {
- Size = TypeSize*ArrayNum;
- } else {
- Size = TypeSize;
- }
- if (Size > (128 - sizeof (EFI_IFR_GUID))) return;
- DataBuff = (UINT8 *)malloc(Size);
- for (Idx = 0; Idx < Size; Idx++) {
- DataBuff[Idx] = 0;
- }
- >>
- vfrExtensionData [DataBuff, Size, TypeName, TypeSize, IsStruct, ArrayNum]
- }
- <<
- {
- GuidObj = new CIfrGuid(Size);
- if (GuidObj != NULL) {
- GuidObj->SetLineNo(L->getLine());
- GuidObj->SetGuid (&Guid);
- }
- }
- if (TypeName != NULL) {
- GuidObj->SetData(DataBuff, Size);
- }
- >>
- {","
- (
- vfrStatementExtension
- )*
- E:EndGuidOp << GuidObj->SetScope(1); CRT_END_OP (E); >>
- }
- <<
- if (GuidObj != NULL) delete GuidObj;
- if (DataBuff != NULL) free(DataBuff);
- >>
- ";"
-;
-
-vfrExtensionData[UINT8 *DataBuff, UINT32 Size, CHAR8 *TypeName, UINT32 TypeSize, BOOLEAN IsStruct, UINT32 ArrayNum]:
- <<
- CHAR8 *TFName = NULL;
- UINT32 ArrayIdx = 0;
- UINT16 FieldOffset;
- UINT8 FieldType;
- UINT32 FieldSize;
- UINT64 Data_U64 = 0;
- UINT32 Data_U32 = 0;
- UINT16 Data_U16 = 0;
- UINT8 Data_U8 = 0;
- BOOLEAN Data_BL = 0;
- EFI_STRING_ID Data_SID = 0;
- BOOLEAN IsArray = FALSE;
- UINT8 *ByteOffset = NULL;
- >>
-(
- ("," "data" {OpenBracket IDX1:Number CloseBracket <<IsArray = TRUE;>>}
- <<
- ArrayIdx = 0;
- if (IsArray == TRUE) {
- ArrayIdx = _STOU8(IDX1->getText());
- if (ArrayIdx >= ArrayNum) return;
- IsArray = FALSE;
- }
- ByteOffset = DataBuff + (ArrayIdx * TypeSize);
- if (IsStruct == TRUE) {
- _STRCAT(&TFName, TypeName);
- }
- >>
- ("." FN:StringIdentifier
- <<
- if (IsStruct == TRUE) {
- _STRCAT(&TFName, ".");
- _STRCAT(&TFName, FN->getText());
- }
- >>
- {
- OpenBracket IDX2:Number CloseBracket
- <<
- if (IsStruct == TRUE) {
- _STRCAT(&TFName, "[");
- _STRCAT(&TFName, IDX2->getText());
- _STRCAT(&TFName, "]");
- }
- >>
- }
- )*
- "=" RD:Number
- <<
- if (IsStruct == FALSE) {
- if (strcmp ("UINT64", TypeName) == 0) {
- Data_U64 = _STOU64(RD->getText());
- memcpy (ByteOffset, &Data_U64, TypeSize);
- }else if (strcmp ("UINT32", TypeName) == 0) {
- Data_U32 = _STOU32(RD->getText());
- memcpy (ByteOffset, &Data_U32, TypeSize);
- }else if (strcmp ("UINT16", TypeName) == 0) {
- Data_U16 = _STOU16(RD->getText());
- memcpy (ByteOffset, &Data_U16, TypeSize);
- }else if (strcmp ("UINT8", TypeName) == 0) {
- Data_U8 = _STOU8(RD->getText());
- memcpy (ByteOffset, &Data_U8, TypeSize);
- }else if (strcmp ("BOOLEAN", TypeName)== 0) {
- Data_BL = _STOU8(RD->getText());
- memcpy (ByteOffset, &Data_BL, TypeSize);
- }else if (strcmp ("EFI_STRING_ID", TypeName) == 0) {
- Data_SID = _STOSID(RD->getText());
- memcpy (ByteOffset, &Data_SID, TypeSize);
- }
- } else {
- gCVfrVarDataTypeDB.GetDataFieldInfo(TFName, FieldOffset, FieldType, FieldSize);
- switch (FieldType) {
- case EFI_IFR_TYPE_NUM_SIZE_8:
- Data_U8 = _STOU8(RD->getText());
- memcpy (ByteOffset + FieldOffset, &Data_U8, FieldSize);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_16:
- Data_U16 = _STOU16(RD->getText());
- memcpy (ByteOffset + FieldOffset, &Data_U16, FieldSize);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_32:
- Data_U32 = _STOU32(RD->getText());
- memcpy (ByteOffset + FieldOffset, &Data_U32, FieldSize);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_64:
- Data_U64 = _STOU64(RD->getText());
- memcpy (ByteOffset + FieldOffset, &Data_U64, FieldSize);
- break;
- case EFI_IFR_TYPE_BOOLEAN:
- Data_BL = _STOU8(RD->getText());
- memcpy (ByteOffset + FieldOffset, &Data_BL, FieldSize);
- break;
- case EFI_IFR_TYPE_STRING:
- Data_SID = _STOSID(RD->getText());
- memcpy (ByteOffset + FieldOffset, &Data_SID, FieldSize);
- break;
- default:
- break;
- }
- }
- if (TFName != NULL) { delete TFName; TFName = NULL; }
- >>
- )*
-)
-;
-
-
-vfrStatementDefaultStore :
- << UINT16 DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD; >>
- D:DefaultStore N:StringIdentifier ","
- Prompt "=" "STRING_TOKEN" "\(" S:Number "\)"
- {
- "," Attribute "=" A:Number << DefaultId = _STOU16(A->getText()); >>
- }
- <<
- if (mCVfrDefaultStore.DefaultIdRegistered (DefaultId) == FALSE) {
- CIfrDefaultStore DSObj;
- _PCATCH(mCVfrDefaultStore.RegisterDefaultStore (DSObj.GetObjBinAddr(), N->getText(), _STOSID(S->getText()), DefaultId)), D->getLine();
- DSObj.SetLineNo(D->getLine());
- DSObj.SetDefaultName (_STOSID(S->getText()));
- DSObj.SetDefaultId (DefaultId);
- } else {
- _PCATCH(mCVfrDefaultStore.ReRegisterDefaultStoreById (DefaultId, N->getText(), _STOSID(S->getText()))), D->getLine();
- }
- >>
- ";"
- ;
-
-vfrStatementVarStoreLinear :
- <<
- EFI_GUID Guid;
- CIfrVarStore VSObj;
- CHAR8 *TypeName;
- CHAR8 *StoreName;
- UINT32 LineNum;
- EFI_VARSTORE_ID VarStoreId = EFI_VARSTORE_ID_INVALID;
- UINT32 Size;
- >>
- V:Varstore << VSObj.SetLineNo(V->getLine()); >>
- (
- TN:StringIdentifier "," << TypeName = TN->getText(); LineNum = TN->getLine(); >>
- | U8:"UINT8" "," << TypeName = U8->getText(); LineNum = U8->getLine(); >>
- | U16:"UINT16" "," << TypeName = U16->getText(); LineNum = U16->getLine(); >>
- | C16:"CHAR16" "," << TypeName = (CHAR8 *) "UINT16"; LineNum = C16->getLine(); >>
- | U32:"UINT32" "," << TypeName = U32->getText(); LineNum = U32->getLine(); >>
- | U64:"UINT64" "," << TypeName = U64->getText(); LineNum = U64->getLine(); >>
- | D:"EFI_HII_DATE" "," << TypeName = D->getText(); LineNum = D->getLine(); >>
- | T:"EFI_HII_TIME" "," << TypeName = T->getText(); LineNum = T->getLine(); >>
- | R:"EFI_HII_REF" "," << TypeName = R->getText(); LineNum = R->getLine(); >>
- )
- { Key "=" FID:Number "," << // Key is used to assign Varid in Framework VFR but no use in UEFI2.1 VFR
- if (mCompatibleMode) {
- VarStoreId = _STOU16(FID->getText());
- }
- >>
- }
- {
- VarId "=" ID:Number "," <<
- _PCATCH(
- (INTN)(VarStoreId = _STOU16(ID->getText())) != 0,
- (INTN)TRUE,
- ID,
- "varid 0 is not allowed."
- );
- >>
- }
- Name "=" SN:StringIdentifier ","
- Uuid "=" guidDefinition[Guid]
- <<
- if (mCompatibleMode) {
- StoreName = TypeName;
- } else {
- StoreName = SN->getText();
- }
- _PCATCH(mCVfrDataStorage.DeclareBufferVarStore (
- StoreName,
- &Guid,
- &gCVfrVarDataTypeDB,
- TypeName,
- VarStoreId
- ), LineNum);
- VSObj.SetGuid (&Guid);
- _PCATCH(mCVfrDataStorage.GetVarStoreId(StoreName, &VarStoreId, &Guid), SN);
- VSObj.SetVarStoreId (VarStoreId);
- _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &Size), LineNum);
- VSObj.SetSize ((UINT16) Size);
- VSObj.SetName (SN->getText());
- >>
- ";"
- ;
-
-vfrStatementVarStoreEfi :
- <<
- BOOLEAN IsUEFI23EfiVarstore = TRUE;
- EFI_GUID Guid;
- CIfrVarStoreEfi VSEObj;
- EFI_VARSTORE_ID VarStoreId = EFI_VARSTORE_ID_INVALID;
- UINT32 Attr = 0;
- UINT32 Size;
- CHAR8 *TypeName;
- UINT32 LineNum;
- CHAR8 *StoreName = NULL;
- >>
- E:Efivarstore << VSEObj.SetLineNo(E->getLine()); >>
- (
- TN:StringIdentifier "," << TypeName = TN->getText(); LineNum = TN->getLine(); >>
- | U8:"UINT8" "," << TypeName = U8->getText(); LineNum = U8->getLine(); >>
- | U16:"UINT16" "," << TypeName = U16->getText(); LineNum = U16->getLine(); >>
- | C16:"CHAR16" "," << TypeName = (CHAR8 *) "UINT16"; LineNum = C16->getLine(); >>
- | U32:"UINT32" "," << TypeName = U32->getText(); LineNum = U32->getLine(); >>
- | U64:"UINT64" "," << TypeName = U64->getText(); LineNum = U64->getLine(); >>
- | D:"EFI_HII_DATE" "," << TypeName = D->getText(); LineNum = D->getLine(); >>
- | T:"EFI_HII_TIME" "," << TypeName = T->getText(); LineNum = T->getLine(); >>
- | R:"EFI_HII_REF" "," << TypeName = R->getText(); LineNum = R->getLine(); >>
- )
- {
- VarId "=" ID:Number "," <<
- _PCATCH(
- (INTN)(VarStoreId = _STOU16(ID->getText())) != 0,
- (INTN)TRUE,
- ID,
- "varid 0 is not allowed."
- );
- >>
- }
- Attribute "=" vfrVarStoreEfiAttr[Attr] ( "\|" vfrVarStoreEfiAttr[Attr] )* ","
- << VSEObj.SetAttributes (Attr); >>
-
- (
- Name "=" SN:StringIdentifier "," << StoreName = SN->getText(); >>
- |
- Name "=" "STRING_TOKEN" "\(" VN:Number "\)" ","
- VarSize "=" N:Number "," <<
- IsUEFI23EfiVarstore = FALSE;
- StoreName = gCVfrStringDB.GetVarStoreNameFormStringId(_STOSID(VN->getText()));
- if (StoreName == NULL) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, VN->getLine(), "Can't get varstore name for this StringId!");
- }
- Size = _STOU32(N->getText());
- switch (Size) {
- case 1:
- TypeName = (CHAR8 *) "UINT8";
- break;
- case 2:
- TypeName = (CHAR8 *) "UINT16";
- break;
- case 4:
- TypeName = (CHAR8 *) "UINT32";
- break;
- case 8:
- TypeName = (CHAR8 *) "UINT64";
- break;
- default:
- _PCATCH (VFR_RETURN_UNSUPPORTED, N);
- break;
- }
- >>
- )
-
- Uuid "=" guidDefinition[Guid] <<
- if (IsUEFI23EfiVarstore) {
- _PCATCH(mCVfrDataStorage.DeclareBufferVarStore (
- StoreName,
- &Guid,
- &gCVfrVarDataTypeDB,
- TypeName,
- VarStoreId
- ), LineNum);
- _PCATCH(mCVfrDataStorage.GetVarStoreId(StoreName, &VarStoreId, &Guid), SN);
- _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &Size), LineNum);
- } else {
- _PCATCH(mCVfrDataStorage.DeclareBufferVarStore (
- TN->getText(),
- &Guid,
- &gCVfrVarDataTypeDB,
- TypeName,
- VarStoreId
- ), LineNum);
- _PCATCH(mCVfrDataStorage.GetVarStoreId(TN->getText(), &VarStoreId, &Guid), VN);
- _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize(TypeName, &Size), N->getLine());
- }
- VSEObj.SetGuid (&Guid);
- VSEObj.SetVarStoreId (VarStoreId);
-
- VSEObj.SetSize ((UINT16) Size);
- VSEObj.SetName (StoreName);
- if (IsUEFI23EfiVarstore == FALSE && StoreName != NULL) {
- delete StoreName;
- }
- >>
- ";"
- ;
-
-vfrVarStoreEfiAttr [UINT32 & Attr] :
- N:Number << $Attr |= _STOU32(N->getText()); >>
- ;
-
-vfrStatementVarStoreNameValue :
- <<
- EFI_GUID Guid;
- CIfrVarStoreNameValue VSNVObj;
- EFI_VARSTORE_ID VarStoreId;
- >>
- L:NameValueVarStore << VSNVObj.SetLineNo(L->getLine()); >>
- SN:StringIdentifier "," << _PCATCH(mCVfrDataStorage.DeclareNameVarStoreBegin (SN->getText()), SN); >>
- (
- Name "=" "STRING_TOKEN" "\(" N:Number "\)" "," << _PCATCH(mCVfrDataStorage.NameTableAddItem (_STOSID(N->getText())), SN); >>
- )+
- Uuid "=" guidDefinition[Guid] << _PCATCH(mCVfrDataStorage.DeclareNameVarStoreEnd (&Guid), SN); >>
- <<
- VSNVObj.SetGuid (&Guid);
- _PCATCH(mCVfrDataStorage.GetVarStoreId(SN->getText(), &VarStoreId, &Guid), SN);
- VSNVObj.SetVarStoreId (VarStoreId);
- >>
- ";"
- ;
-
-//
-// keep classDeinition and validClassNames for compatibility but not generate
-// any IFR object
-//
-classDefinition[UINT16 & Class] :
- << $Class = 0; >>
- validClassNames[$Class] ( "\|" validClassNames[$Class] )*
- ;
-
-validClassNames[UINT16 & Class] :
- ClassNonDevice << $Class |= EFI_NON_DEVICE_CLASS; >>
- | ClassDiskDevice << $Class |= EFI_DISK_DEVICE_CLASS; >>
- | ClassVideoDevice << $Class |= EFI_VIDEO_DEVICE_CLASS; >>
- | ClassNetworkDevice << $Class |= EFI_NETWORK_DEVICE_CLASS; >>
- | ClassInputDevice << $Class |= EFI_INPUT_DEVICE_CLASS; >>
- | ClassOnBoardDevice << $Class |= EFI_ON_BOARD_DEVICE_CLASS; >>
- | ClassOtherDevice << $Class |= EFI_OTHER_DEVICE_CLASS; >>
- | N:Number << $Class |= _STOU16(N->getText()); >>
- ;
-
-subclassDefinition[UINT16 & SubClass] :
- << $SubClass = 0; >>
- SubclassSetupApplication << $SubClass |= EFI_SETUP_APPLICATION_SUBCLASS; >>
- | SubclassGeneralApplication << $SubClass |= EFI_GENERAL_APPLICATION_SUBCLASS; >>
- | SubclassFrontPage << $SubClass |= EFI_FRONT_PAGE_SUBCLASS; >>
- | SubclassSingleUse << $SubClass |= EFI_SINGLE_USE_SUBCLASS; >>
- | N:Number << $SubClass |= _STOU16(N->getText()); >>
- ;
-
-vfrStatementDisableIfFormSet :
- <<
- CIfrDisableIf DIObj;
- mConstantOnlyInExpression = TRUE;
- >>
- D:DisableIf << DIObj.SetLineNo(D->getLine()); >>
- vfrStatementExpression[0] ";" << mConstantOnlyInExpression = FALSE; >>
- vfrFormSetList
- E:EndIf << CRT_END_OP (E); >>
- ";"
- ;
-
-vfrStatementSuppressIfFormSet :
- << CIfrSuppressIf SIObj;>>
- L:SuppressIf <<
- if (mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, L);
- }
- SIObj.SetLineNo(L->getLine());
- >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0] ";"
- vfrFormSetList
- E: EndIf
- ";" << CRT_END_OP (E); >>
- ;
-
-//*****************************************************************************
-//
-// the syntax of question header and statement header
-//
-vfrStatementHeader[CIfrStatementHeader *SHObj] :
- Prompt "=" "STRING_TOKEN" "\(" S1:Number "\)" "," << $SHObj->SetPrompt (_STOSID(S1->getText())); >>
- Help "=" "STRING_TOKEN" "\(" S2:Number "\)" << $SHObj->SetHelp (_STOSID(S2->getText())); >>
- ;
-
-vfrQuestionHeader[CIfrQuestionHeader & QHObj, EFI_QUESION_TYPE QType = QUESTION_NORMAL]:
- <<
- EFI_VARSTORE_INFO Info;
- Info.mVarType = EFI_IFR_TYPE_OTHER;
- Info.mVarTotalSize = 0;
- Info.mInfo.mVarOffset = EFI_VAROFFSET_INVALID;
- Info.mVarStoreId = EFI_VARSTORE_ID_INVALID;
- EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
- CHAR8 *QName = NULL;
- CHAR8 *VarIdStr = NULL;
- mUsedDefaultCount = 0;
- >>
- {
- Name "=" QN:StringIdentifier "," <<
- QName = QN->getText();
- _PCATCH(mCVfrQuestionDB.FindQuestion (QName), VFR_RETURN_UNDEFINED, QN, "has already been used please used anther name");
- >>
- }
- { V:VarId "=" vfrStorageVarId[Info, VarIdStr] "," }
- {
- QuestionId "=" ID:Number "," <<
- QId = _STOQID(ID->getText());
- _PCATCH(mCVfrQuestionDB.FindQuestion (QId), VFR_RETURN_UNDEFINED, ID, "has already been used please assign another number");
- >>
- }
- <<
- switch (QType) {
- case QUESTION_NORMAL:
- mCVfrQuestionDB.RegisterQuestion (QName, VarIdStr, QId);
- break;
- case QUESTION_DATE:
- mCVfrQuestionDB.RegisterNewDateQuestion (QName, VarIdStr, QId);
- break;
- case QUESTION_TIME:
- mCVfrQuestionDB.RegisterNewTimeQuestion (QName, VarIdStr, QId);
- break;
- case QUESTION_REF:
- //
- // VarIdStr != NULL stand for question with storagae.
- //
- if (VarIdStr != NULL) {
- mCVfrQuestionDB.RegisterRefQuestion (QName, VarIdStr, QId);
- } else {
- mCVfrQuestionDB.RegisterQuestion (QName, NULL, QId);
- }
- break;
- default:
- _PCATCH(VFR_RETURN_FATAL_ERROR);
- }
- $QHObj.SetQuestionId (QId);
- if (VarIdStr != NULL) {
- $QHObj.SetVarStoreInfo (&Info);
- }
- >>
- vfrStatementHeader[&$QHObj]
- <<
- if (VarIdStr != NULL) {
- delete VarIdStr;
- }
- _SAVE_CURRQEST_VARINFO (Info);
- >>
- ;
-
-questionheaderFlagsField[UINT8 & Flags] :
- ReadOnlyFlag << $Flags |= 0x01; >>
- | InteractiveFlag << $Flags |= 0x04; >>
- | ResetRequiredFlag << $Flags |= 0x10; >>
- | OptionOnlyFlag << $Flags |= 0x80; >>
- | NVAccessFlag
- | LateCheckFlag
- ;
-
-vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFlag = TRUE] :
- <<
- UINT32 Idx;
- UINT32 LineNo;
- EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
- CHAR8 *VarIdStr = NULL;
- CHAR8 *VarStr = NULL;
- CHAR8 *SName = NULL;
- CHAR8 *TName = NULL;
- EFI_VFR_RETURN_CODE VfrReturnCode = VFR_RETURN_SUCCESS;
- EFI_IFR_TYPE_VALUE Dummy = gZeroEfiIfrTypeValue;
- EFI_GUID *VarGuid = NULL;
- >>
- (
- SN1:StringIdentifier << SName = SN1->getText(); _STRCAT(&VarIdStr, SN1->getText()); >>
- OpenBracket I1:Number CloseBracket <<
- Idx = _STOU32(I1->getText());
- _STRCAT(&VarIdStr, "[");
- _STRCAT(&VarIdStr, I1->getText());
- _STRCAT(&VarIdStr, "]");
- >>
- <<
- VfrReturnCode = mCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId);
- if (mCompatibleMode && VfrReturnCode == VFR_RETURN_UNDEFINED) {
- mCVfrDataStorage.DeclareBufferVarStore (
- SName,
- &mFormsetGuid,
- &gCVfrVarDataTypeDB,
- SName,
- EFI_VARSTORE_ID_INVALID,
- FALSE
- );
- VfrReturnCode = mCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId, &mFormsetGuid);
- }
- if (CheckFlag || VfrReturnCode == VFR_RETURN_SUCCESS) {
- _PCATCH(VfrReturnCode, SN1);
- _PCATCH(mCVfrDataStorage.GetNameVarStoreInfo (&$Info, Idx), SN1);
- }
-
- QuestVarIdStr = VarIdStr;
- >>
- )
- |
- (
- SN2:StringIdentifier << SName = SN2->getText(); _STRCAT(&VarIdStr, SName); >>
- <<
- VfrReturnCode = mCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId);
- if (mCompatibleMode && VfrReturnCode == VFR_RETURN_UNDEFINED) {
- mCVfrDataStorage.DeclareBufferVarStore (
- SName,
- &mFormsetGuid,
- &gCVfrVarDataTypeDB,
- SName,
- EFI_VARSTORE_ID_INVALID,
- FALSE
- );
- VfrReturnCode = mCVfrDataStorage.GetVarStoreId(SName, &$Info.mVarStoreId, &mFormsetGuid);
- }
- if (CheckFlag || VfrReturnCode == VFR_RETURN_SUCCESS) {
- _PCATCH(VfrReturnCode, SN2);
- VarStoreType = mCVfrDataStorage.GetVarStoreType ($Info.mVarStoreId);
- if (VarStoreType == EFI_VFR_VARSTORE_BUFFER) {
- _PCATCH(mCVfrDataStorage.GetBufferVarStoreDataTypeName(Info.mVarStoreId, &TName), SN2);
- _STRCAT(&VarStr, TName);
- }
- }
- >>
-
- (
- "." <<
- if (CheckFlag || VfrReturnCode == VFR_RETURN_SUCCESS) {
- _PCATCH(((VarStoreType != EFI_VFR_VARSTORE_BUFFER) ? VFR_RETURN_EFIVARSTORE_USE_ERROR : VFR_RETURN_SUCCESS), SN2);
- }
- _STRCAT(&VarIdStr, "."); _STRCAT(&VarStr, ".");
- >>
- SF:StringIdentifier << _STRCAT(&VarIdStr, SF->getText()); _STRCAT(&VarStr, SF->getText()); >>
- {
- OpenBracket I2:Number CloseBracket <<
- Idx = _STOU32(I2->getText());
- if (mCompatibleMode) Idx --;
- if (Idx > 0) {
- //
- // Idx == 0, [0] can be ignored.
- // Array[0] is same to Array for unify the varid name to cover [0]
- //
- _STRCAT(&VarIdStr, "[");
- _STRCAT(&VarIdStr, I2->getText());
- _STRCAT(&VarIdStr, "]");
- }
- _STRCAT(&VarStr, "[");
- _STRCAT(&VarStr, I2->getText());
- _STRCAT(&VarStr, "]");
- >>
- }
- )* <<
- switch (VarStoreType) {
- case EFI_VFR_VARSTORE_EFI:
- _PCATCH(mCVfrDataStorage.GetEfiVarStoreInfo (&$Info), SN2);
- break;
- case EFI_VFR_VARSTORE_BUFFER:
- _PCATCH(gCVfrVarDataTypeDB.GetDataFieldInfo (VarStr, $Info.mInfo.mVarOffset, $Info.mVarType, $Info.mVarTotalSize), SN2->getLine(), VarStr);
- VarGuid = mCVfrDataStorage.GetVarStoreGuid($Info.mVarStoreId);
- _PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Register (
- SName,
- VarGuid,
- NULL),
- SN2->getLine());
- _PCATCH((EFI_VFR_RETURN_CODE)gCVfrBufferConfig.Write (
- 'a',
- SName,
- VarGuid,
- NULL,
- $Info.mVarType,
- $Info.mInfo.mVarOffset,
- $Info.mVarTotalSize,
- Dummy),
- SN2->getLine());
- break;
- case EFI_VFR_VARSTORE_NAME:
- default: break;
- }
-
- QuestVarIdStr = VarIdStr;
- if (VarStr != NULL) {delete VarStr;}
- >>
- )
- ;
-
-vfrQuestionDataFieldName [EFI_QUESTION_ID &QId, UINT32 &Mask, CHAR8 *&VarIdStr, UINT32 &LineNo] :
- <<
- UINT32 Idx;
- VarIdStr = NULL; LineNo = 0;
- >>
- (
- SN1:StringIdentifier << _STRCAT(&VarIdStr, SN1->getText()); LineNo = SN1->getLine(); >>
- OpenBracket I1:Number CloseBracket <<
- _STRCAT(&VarIdStr, "[");
- _STRCAT(&VarIdStr, I1->getText());
- _STRCAT(&VarIdStr, "]");
- mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, $QId, $Mask);
- if (mConstantOnlyInExpression) {
- _PCATCH(VFR_RETURN_CONSTANT_ONLY, LineNo);
- }
- >>
- )
- |
- (
- SN2:StringIdentifier << _STRCAT (&VarIdStr, SN2->getText()); LineNo = SN2->getLine(); >>
- (
- "." <<
- _STRCAT (&VarIdStr, ".");
- if (mConstantOnlyInExpression) {
- _PCATCH(VFR_RETURN_CONSTANT_ONLY, LineNo);
- }
- >>
- SF:StringIdentifier << _STRCAT (&VarIdStr, SF->getText()); >>
- {
- OpenBracket I2:Number CloseBracket <<
- Idx = _STOU32(I2->getText());
- if (mCompatibleMode) Idx --;
- if (Idx > 0) {
- //
- // Idx == 0, [0] can be ignored.
- // Array[0] is same to Array
- //
- _STRCAT(&VarIdStr, "[");
- _STRCAT(&VarIdStr, I2->getText());
- _STRCAT(&VarIdStr, "]");
- }
- >>
- }
- )*
- << mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, $QId, $Mask); >>
- )
- ;
-
-vfrConstantValueField[UINT8 Type] > [EFI_IFR_TYPE_VALUE Value] :
- <<
- EFI_GUID Guid;
- >>
- N1:Number <<
- switch ($Type) {
- case EFI_IFR_TYPE_NUM_SIZE_8 :
- $Value.u8 = _STOU8(N1->getText());
- break;
- case EFI_IFR_TYPE_NUM_SIZE_16 :
- $Value.u16 = _STOU16(N1->getText());
- break;
- case EFI_IFR_TYPE_NUM_SIZE_32 :
- $Value.u32 = _STOU32(N1->getText());
- break;
- case EFI_IFR_TYPE_NUM_SIZE_64 :
- $Value.u64 = _STOU64(N1->getText());
- break;
- case EFI_IFR_TYPE_BOOLEAN :
- $Value.b = _STOU8(N1->getText());
- break;
- case EFI_IFR_TYPE_STRING :
- $Value.string = _STOU16(N1->getText());
- break;
- case EFI_IFR_TYPE_TIME :
- case EFI_IFR_TYPE_DATE :
- case EFI_IFR_TYPE_REF :
- default :
- break;
- }
- >>
- | B1:True << $Value.b = TRUE; >>
- | B2:False << $Value.b = FALSE; >>
- | O1:One << $Value.u8 = _STOU8(O1->getText()); >>
- | O2:Ones << $Value.u64 = _STOU64(O2->getText()); >>
- | Z:Zero << $Value.u8 = _STOU8(Z->getText()); >>
- | HOUR:Number ":" MINUTE:Number ":" SECOND:Number << $Value.time = _STOT(HOUR->getText(), MINUTE->getText(), SECOND->getText()); >>
- | YEAR:Number "/" MONTH:Number "/" DAY:Number << $Value.date = _STOD(YEAR->getText(), MONTH->getText(), DAY->getText()); >>
- | QI:Number";" FI:Number";" guidDefinition[Guid] ";" "STRING_TOKEN" "\(" DP:Number "\)"
- << $Value.ref = _STOR(QI->getText(), FI->getText(), &Guid, DP->getText()); >>
- | "STRING_TOKEN" "\(" S1:Number "\)" << $Value.string = _STOSID(S1->getText()); >>
- ;
-
-//*****************************************************************************
-//
-// the syntax of form definition
-//
-vfrFormDefinition :
- << CIfrForm FObj; >>
- F:Form << FObj.SetLineNo(F->getLine()); >>
- FormId "=" S1:Number "," << _PCATCH(FObj.SetFormId (_STOFID(S1->getText())), S1); >>
- Title "=" "STRING_TOKEN" "\(" S2:Number "\)" ";" << FObj.SetFormTitle (_STOSID(S2->getText())); >>
- (
- vfrStatementImage |
- vfrStatementLocked |
- vfrStatementRules |
- vfrStatementDefault |
- vfrStatementStat |
- vfrStatementQuestions |
- vfrStatementConditional |
- vfrStatementLabel |
- vfrStatementBanner |
- // Just for framework vfr compatibility
- vfrStatementInvalid |
- vfrStatementExtension |
- vfrStatementModal
- )*
- E:EndForm <<
- if (mCompatibleMode) {
- //
- // Add Label for Framework Vfr
- //
- CIfrLabel LObj1;
- LObj1.SetLineNo(E->getLine());
- LObj1.SetNumber (0xffff); //add end label for UEFI, label number hardcode 0xffff
- CIfrLabel LObj2;
- LObj2.SetLineNo(E->getLine());
- LObj2.SetNumber (0x0); //add dummy label for UEFI, label number hardcode 0x0
- CIfrLabel LObj3;
- LObj3.SetLineNo(E->getLine());
- LObj3.SetNumber (0xffff); //add end label for UEFI, label number hardcode 0xffff
- }
-
- {CIfrEnd EObj; EObj.SetLineNo (E->getLine()); mLastFormEndAddr = EObj.GetObjBinAddr (); gAdjustOpcodeOffset = EObj.GetObjBinOffset ();}
- >>
- ";"
- ;
-
-vfrFormMapDefinition :
- <<
- CIfrFormMap *FMapObj = NULL;
- UINT32 FormMapMethodNumber = 0;
- EFI_GUID Guid;
- >>
- F:FormMap << FMapObj = new CIfrFormMap(); FMapObj->SetLineNo(F->getLine()); >>
- FormId "=" S1:Number "," << _PCATCH(FMapObj->SetFormId (_STOFID(S1->getText())), S1); >>
- (
- MapTitle "=" "STRING_TOKEN" "\(" S2:Number "\)" ";"
- MapGuid "=" guidDefinition[Guid] ";" << FMapObj->SetFormMapMethod (_STOFID(S2->getText()), &Guid); FormMapMethodNumber ++; >>
- )* << if (FormMapMethodNumber == 0) {_PCATCH (VFR_RETURN_INVALID_PARAMETER, F->getLine(), "No MapMethod is set for FormMap!");} delete FMapObj;>>
- (
- vfrStatementImage |
- vfrStatementLocked |
- vfrStatementRules |
- vfrStatementDefault |
- vfrStatementStat |
- vfrStatementQuestions |
- vfrStatementConditional |
- vfrStatementLabel |
- vfrStatementBanner |
- vfrStatementExtension |
- vfrStatementModal
- )*
- E:EndForm << CRT_END_OP (E); >>
- ";"
- ;
-
-vfrStatementRules :
- << CIfrRule RObj; >>
- R:Rule << RObj.SetLineNo(R->getLine()); >>
- S1:StringIdentifier "," <<
- mCVfrRulesDB.RegisterRule (S1->getText());
- RObj.SetRuleId (mCVfrRulesDB.GetRuleId(S1->getText()));
- >>
- vfrStatementExpression[0]
- E:EndRule << CRT_END_OP (E); >>
- ";"
- ;
-
-vfrStatementDefault :
- <<
- BOOLEAN IsExp = FALSE;
- EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;
- CIfrDefault *DObj = NULL;
- CIfrDefault2 *DObj2 = NULL;
- EFI_DEFAULT_ID DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
- CHAR8 *VarStoreName = NULL;
- EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
- UINT32 Size = 0;
- EFI_GUID *VarGuid = NULL;
- >>
- D:Default
- (
- (
- "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] > [Val] ","
- <<
- if (gCurrentMinMaxData != NULL && gCurrentMinMaxData->IsNumericOpcode()) {
- //check default value is valid for Numeric Opcode
- if (Val.u64 < gCurrentMinMaxData->GetMinData(_GET_CURRQEST_DATATYPE()) || Val.u64 > gCurrentMinMaxData->GetMaxData(_GET_CURRQEST_DATATYPE())) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, D->getLine(), "Numeric default value must be between MinValue and MaxValue.");
- }
- }
- if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {
- _PCATCH (VFR_RETURN_FATAL_ERROR, D->getLine(), "Default data type error.");
- Size = sizeof (EFI_IFR_TYPE_VALUE);
- } else {
- _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &Size), D->getLine());
- }
- Size += OFFSET_OF (EFI_IFR_DEFAULT, Value);
- DObj = new CIfrDefault ((UINT8)Size);
- DObj->SetLineNo(D->getLine());
- DObj->SetType (_GET_CURRQEST_DATATYPE());
- DObj->SetValue(Val);
- >>
- | << IsExp = TRUE; DObj2 = new CIfrDefault2; DObj2->SetLineNo(D->getLine()); DObj2->SetScope (1); >>
- vfrStatementValue "," << CIfrEnd EndObj1; EndObj1.SetLineNo(D->getLine()); >>
- )
- {
- DefaultStore "=" SN:StringIdentifier "," <<
- _PCATCH(mCVfrDefaultStore.GetDefaultId (SN->getText(), &DefaultId), SN);
- if (DObj != NULL) {
- DObj->SetDefaultId (DefaultId);
- }
-
- if (DObj2 != NULL) {
- DObj2->SetDefaultId (DefaultId);
- }
- >>
- }
- <<
- CheckDuplicateDefaultValue (DefaultId, D);
- if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {
- _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), D->getLine());
- VarGuid = mCVfrDataStorage.GetVarStoreGuid(_GET_CURRQEST_VARTINFO().mVarStoreId);
- VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);
- if ((IsExp == FALSE) && (VarStoreType == EFI_VFR_VARSTORE_BUFFER)) {
- _PCATCH(mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
- DefaultId,
- _GET_CURRQEST_VARTINFO(),
- VarStoreName,
- VarGuid,
- _GET_CURRQEST_DATATYPE (),
- Val),
- D->getLine()
- );
- }
- }
- if (DObj != NULL) {delete DObj;}
- if (DObj2 != NULL) {delete DObj2;}
- >>
- )
- ;
-
-vfrStatementStat :
- vfrStatementSubTitle |
- vfrStatementStaticText |
- vfrStatementCrossReference
- ;
-
-vfrStatementQuestions :
- vfrStatementBooleanType |
- vfrStatementDate |
- vfrStatementNumericType |
- vfrStatementStringType |
- vfrStatementOrderedList |
- vfrStatementTime
- ;
-
-vfrStatementConditional :
- vfrStatementDisableIfStat |
- vfrStatementSuppressIfStat | //enhance to be compatible for framework endif
- vfrStatementGrayOutIfStat |
- vfrStatementInconsistentIfStat //to be compatible for framework
- ;
-
-vfrStatementConditionalNew :
- vfrStatementDisableIfStat |
- vfrStatementSuppressIfStatNew |
- vfrStatementGrayOutIfStatNew |
- vfrStatementInconsistentIfStat //to be compatible for framework
- ;
-
-vfrStatementSuppressIfStat :
- <<mCompatibleMode>>? vfrStatementSuppressIfStatOld
- | vfrStatementSuppressIfStatNew
- ;
-
-vfrStatementGrayOutIfStat :
- <<mCompatibleMode>>? vfrStatementGrayOutIfStatOld
- | vfrStatementGrayOutIfStatNew
- ;
-
-vfrStatementInvalid :
- (
- vfrStatementInvalidHidden |
- vfrStatementInvalidInventory |
- vfrStatementInvalidSaveRestoreDefaults
- )
- << _CRT_OP (TRUE); >>
- ;
-
-flagsField :
- Number | InteractiveFlag | ManufacturingFlag | DefaultFlag |
- NVAccessFlag | ResetRequiredFlag | LateCheckFlag
- ;
-
-vfrStatementValue :
- << CIfrValue VObj; >>
- V:Value << VObj.SetLineNo(V->getLine()); >>
- "=" vfrStatementExpression[0] << {CIfrEnd EndObj; EndObj.SetLineNo(V->getLine());} >>
- ;
-
-vfrStatementRead :
- << CIfrRead RObj; >>
- R:Read << RObj.SetLineNo(R->getLine()); >>
- vfrStatementExpression[0] ";"
- ;
-
-vfrStatementWrite :
- << CIfrWrite WObj; >>
- W:Write << WObj.SetLineNo(W->getLine()); >>
- vfrStatementExpression[0] ";"
- ;
-
-vfrStatementSubTitle :
- << CIfrSubtitle SObj; >>
- L:Subtitle << SObj.SetLineNo(L->getLine()); >>
- Text "=" "STRING_TOKEN" "\(" S:Number "\)" << SObj.SetPrompt (_STOSID(S->getText())); >>
- {
- "," FLAGS "=" vfrSubtitleFlags[SObj]
- }
- { vfrStatementStatTagList "," }
- E:";" << CRT_END_OP (E); >>
- ;
-
-vfrSubtitleFlags [CIfrSubtitle & SObj] :
- << UINT8 LFlags = 0; >>
- subtitleFlagsField[LFlags] ( "\|" subtitleFlagsField[LFlags] )*
- << _PCATCH(SObj.SetFlags (LFlags)); >>
- ;
-
-subtitleFlagsField [UINT8 & Flags] :
- N:Number << $Flags |= _STOU8(N->getText()); >>
- | "HORIZONTAL" << $Flags |= 0x01; >>
- ;
-
-vfrStatementStaticText :
- <<
- UINT8 Flags = 0;
- EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
- EFI_STRING_ID TxtTwo = EFI_STRING_ID_INVALID;
- >>
- T:Text
- Help "=" "STRING_TOKEN" "\(" S1:Number "\)" ","
- Text "=" "STRING_TOKEN" "\(" S2:Number "\)"
- {
- "," Text "=" "STRING_TOKEN" "\(" S3:Number "\)" << TxtTwo = _STOSID(S3->getText()); >>
- }
- {
- "," F:FLAGS "=" staticTextFlagsField[Flags] ( "\|" staticTextFlagsField[Flags] )*
- "," Key "=" KN:Number
- }
- <<
- if (Flags & EFI_IFR_FLAG_CALLBACK) {
- CIfrAction AObj;
- mCVfrQuestionDB.RegisterQuestion (NULL, NULL, QId);
- AObj.SetLineNo (F->getLine());
- AObj.SetQuestionId (QId);
- AObj.SetPrompt (_STOSID(S2->getText()));
- AObj.SetHelp (_STOSID(S1->getText()));
- _PCATCH(AObj.SetFlags (Flags), F->getLine());
- AssignQuestionKey (AObj, KN);
- CRT_END_OP (KN);
- } else {
- CIfrText TObj;
- TObj.SetLineNo (T->getLine());
- TObj.SetHelp (_STOSID(S1->getText()));
- TObj.SetPrompt (_STOSID(S2->getText()));
- TObj.SetTextTwo (TxtTwo);
- }
- >>
- { "," vfrStatementStatTagList }
- ";"
- ;
-
-staticTextFlagsField[UINT8 & HFlags] :
- N:Number << _PCATCH(_STOU8(N->getText()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine()); >>
- | questionheaderFlagsField[HFlags]
- ;
-
-vfrStatementCrossReference :
- vfrStatementGoto |
- vfrStatementResetButton
- ;
-
-vfrStatementGoto :
- <<
- UINT8 RefType = 5;
- EFI_STRING_ID DevPath = EFI_STRING_ID_INVALID;
- EFI_GUID FSId = {0,};
- EFI_FORM_ID FId;
- EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
- UINT32 BitMask;
- CIfrQuestionHeader *QHObj = NULL;
- CIfrOpHeader *OHObj = NULL;
- CIfrRef *R1Obj = NULL;
- CIfrRef2 *R2Obj = NULL;
- CIfrRef3 *R3Obj = NULL;
- CIfrRef4 *R4Obj = NULL;
- CIfrRef5 *R5Obj = NULL;
- >>
- G:Goto
- {
- (
- DevicePath "=" "STRING_TOKEN" "\(" P:Number "\)" ","
- FormSetGuid "=" guidDefinition[FSId] ","
- FormId "=" F1:Number ","
- Question "=" QN1:Number ","
- <<
- RefType = 4;
- DevPath = _STOSID(P->getText());
- FId = _STOFID(F1->getText());
- QId = _STOQID(QN1->getText());
- >>
- )
- |
- (
- FormSetGuid "=" guidDefinition[FSId] ","
- FormId "=" F2:Number ","
- Question "=" QN2:Number ","
- <<
- RefType = 3;
- FId = _STOFID(F2->getText());
- QId = _STOQID(QN2->getText());
- >>
- )
- |
- (
- FormId "=" F3:Number "," << RefType = 2; FId = _STOFID(F3->getText()); >>
- Question "="
- (
- QN3:StringIdentifier "," <<
- mCVfrQuestionDB.GetQuestionId (QN3->getText (), NULL, QId, BitMask);
- if (QId == EFI_QUESTION_ID_INVALID) {
- _PCATCH(VFR_RETURN_UNDEFINED, QN3);
- }
- >>
- | QN4:Number "," << QId = _STOQID(QN4->getText()); >>
- )
- )
- |
- (
- F4:Number "," <<
- RefType = 1;
- FId = _STOFID(F4->getText());
- >>
- )
- }
- <<
- switch (RefType) {
- case 5:
- {
- R5Obj = new CIfrRef5;
- QHObj = R5Obj;
- OHObj = R5Obj;
- R5Obj->SetLineNo(G->getLine());
- break;
- }
- case 4:
- {
- R4Obj = new CIfrRef4;
- QHObj = R4Obj;
- OHObj = R4Obj;
- R4Obj->SetLineNo(G->getLine());
- R4Obj->SetDevicePath (DevPath);
- R4Obj->SetFormSetId (FSId);
- R4Obj->SetFormId (FId);
- R4Obj->SetQuestionId (QId);
- break;
- }
- case 3:
- {
- R3Obj = new CIfrRef3;
- QHObj = R3Obj;
- OHObj = R3Obj;
- R3Obj->SetLineNo(G->getLine());
- R3Obj->SetFormSetId (FSId);
- R3Obj->SetFormId (FId);
- R3Obj->SetQuestionId (QId);
- break;
- }
- case 2:
- {
- R2Obj = new CIfrRef2;
- QHObj = R2Obj;
- OHObj = R2Obj;
- R2Obj->SetLineNo(G->getLine());
- R2Obj->SetFormId (FId);
- R2Obj->SetQuestionId (QId);
- break;
- }
- case 1:
- {
- R1Obj = new CIfrRef;
- QHObj = R1Obj;
- OHObj = R1Obj;
- R1Obj->SetLineNo(G->getLine());
- R1Obj->SetFormId (FId);
- break;
- }
- default: break;
- }
- >>
- vfrQuestionHeader[*QHObj, QUESTION_REF] <<
- if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {
- _GET_CURRQEST_VARTINFO().mVarType = EFI_IFR_TYPE_REF;
- }
- >>
- { "," F:FLAGS "=" vfrGotoFlags[QHObj, F->getLine()] }
- {
- "," Key "=" KN:Number << AssignQuestionKey (*QHObj, KN); >>
- }
- {
- E:","
- vfrStatementQuestionOptionList << OHObj->SetScope(1); CRT_END_OP (E);>>
- }
- ";" << if (R1Obj != NULL) {delete R1Obj;} if (R2Obj != NULL) {delete R2Obj;} if (R3Obj != NULL) {delete R3Obj;} if (R4Obj != NULL) {delete R4Obj;} if (R5Obj != NULL) {delete R5Obj;}>>
- ;
-
-vfrGotoFlags [CIfrQuestionHeader *QHObj, UINT32 LineNum] :
- << UINT8 HFlags = 0; >>
- gotoFlagsField[HFlags] ( "\|" gotoFlagsField[HFlags] )*
- << _PCATCH(QHObj->SetFlags (HFlags), LineNum); >>
- ;
-
-gotoFlagsField[UINT8 & HFlags] :
- N:Number << _PCATCH(_STOU8(N->getText()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine()); >>
- | questionheaderFlagsField[HFlags]
- ;
-
-getStringId :
- "STRING_TOKEN" "\("
- IdVal:Number
- "\)"
- ;
-
-vfrStatementResetButton :
- <<
- CIfrResetButton RBObj;
- UINT16 DefaultId;
- >>
- L:ResetButton << RBObj.SetLineNo(L->getLine()); >>
- DefaultStore
- "=" N:StringIdentifier "," <<
- _PCATCH(mCVfrDefaultStore.GetDefaultId (N->getText(), &DefaultId), N->getLine());
- RBObj.SetDefaultId (DefaultId);
- >>
- vfrStatementHeader[&RBObj] ","
- { vfrStatementStatTagList "," }
- E:EndResetButton << CRT_END_OP (E); >>
- ";"
- ;
-
-vfrStatementBooleanType :
- vfrStatementCheckBox |
- vfrStatementAction
- ;
-
-//*****************************************************
-// Syntax of checkbox
-//
-// Example:
-// checkbox
-// varid = MySTestData.mField1,
-// prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
-// help = STRING_TOKEN(STR_CHECK_BOX_HELP),
-// flags = CHECKBOX_DEFAULT | CALLBACK,
-// default value = TRUE, defaultstore = MyDefaultStore,
-// endcheckbox;
-//
-vfrStatementCheckBox :
- <<
- CIfrCheckBox CBObj;
- EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;
- CHAR8 *VarStoreName = NULL;
- UINT32 DataTypeSize;
- EFI_GUID *VarStoreGuid = NULL;
- >>
- L:CheckBox << CBObj.SetLineNo(L->getLine()); >>
- vfrQuestionHeader[CBObj] "," << //check data type
- if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {
- _GET_CURRQEST_VARTINFO().mVarType = EFI_IFR_TYPE_BOOLEAN;
- }
- if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {
- _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize), L->getLine(), "CheckBox varid is not the valid data type");
- if (DataTypeSize != 0 && DataTypeSize != _GET_CURRQEST_VARSIZE()) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "CheckBox varid doesn't support array");
- } else if ((mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId) == EFI_VFR_VARSTORE_BUFFER) &&
- (_GET_CURRQEST_VARSIZE() != sizeof (BOOLEAN))) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "CheckBox varid only support BOOLEAN data type");
- }
- }
- >>
- {
- F:FLAGS "=" vfrCheckBoxFlags[CBObj, F->getLine()] ","
- <<
- if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {
- _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), VFR_RETURN_SUCCESS, L, "Failed to retrieve varstore name");
- VarStoreGuid = mCVfrDataStorage.GetVarStoreGuid(_GET_CURRQEST_VARTINFO().mVarStoreId);
- Val.b = TRUE;
- if (CBObj.GetFlags () & 0x01) {
- CheckDuplicateDefaultValue (EFI_HII_DEFAULT_CLASS_STANDARD, F);
- _PCATCH(
- mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
- EFI_HII_DEFAULT_CLASS_STANDARD,
- _GET_CURRQEST_VARTINFO(),
- VarStoreName,
- VarStoreGuid,
- _GET_CURRQEST_DATATYPE (),
- Val
- ),
- VFR_RETURN_SUCCESS,
- L,
- "No standard default storage found"
- );
- }
- if (CBObj.GetFlags () & 0x02) {
- CheckDuplicateDefaultValue (EFI_HII_DEFAULT_CLASS_MANUFACTURING, F);
- _PCATCH(
- mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
- EFI_HII_DEFAULT_CLASS_MANUFACTURING,
- _GET_CURRQEST_VARTINFO(),
- VarStoreName,
- VarStoreGuid,
- _GET_CURRQEST_DATATYPE (),
- Val
- ),
- VFR_RETURN_SUCCESS,
- L,
- "No manufacturing default storage found"
- );
- }
- }
- >>
- }
- {
- Key "=" KN:Number "," << AssignQuestionKey (CBObj, KN); >>
- }
- vfrStatementQuestionOptionList
- E:EndCheckBox << CRT_END_OP (E); >>
- ";"
- ;
-
-vfrCheckBoxFlags [CIfrCheckBox & CBObj, UINT32 LineNum] :
- <<
- UINT8 LFlags = 0;
- UINT8 HFlags = 0;
- >>
- checkboxFlagsField[LFlags, HFlags] ( "\|" checkboxFlagsField[LFlags, HFlags] )*
- << _PCATCH(CBObj.SetFlags (HFlags, LFlags), LineNum); >>
- ;
-
-checkboxFlagsField[UINT8 & LFlags, UINT8 & HFlags] :
- N:Number <<
- if (mCompatibleMode) {
- //
- // set question flag
- //
- $LFlags |= _STOU8(N->getText());
- } else {
- _PCATCH(_STOU8(N->getText()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine());
- }
- >>
- | D:"DEFAULT" <<
- if (mCompatibleMode) {
- //
- // set question Default flag
- //
- $LFlags |= 0x01;
- } else {
- _PCATCH (VFR_RETURN_UNSUPPORTED, D);
- }
- >>
- | M:"MANUFACTURING" <<
- if (mCompatibleMode) {
- //
- // set question MFG flag
- //
- $LFlags |= 0x02;
- } else {
- _PCATCH (VFR_RETURN_UNSUPPORTED, M);
- }
- >>
- | "CHECKBOX_DEFAULT" << $LFlags |= 0x01; >>
- | "CHECKBOX_DEFAULT_MFG" << $LFlags |= 0x02; >>
- | questionheaderFlagsField[HFlags]
- ;
-
-//*****************************************************
-// Syntax of action
-//
-// Example:
-// action
-// prompt = STRING_TOKEN(STR_ACTION_PROMPT),
-// help = STRING_TOKEN(STR_ACTION_HELP),
-// flags = CALLBACK,
-// config = STRING_TOKEN(STR_ACTION_CONFIG),
-// endaction;
-//
-vfrStatementAction :
- << CIfrAction AObj; >>
- L:Action << AObj.SetLineNo(L->getLine()); >>
- vfrQuestionHeader[AObj] ","
- { F:FLAGS "=" vfrActionFlags[AObj, F->getLine()] "," }
- Config "=" "STRING_TOKEN" "\(" S:Number "\)" "," << AObj.SetQuestionConfig (_STOSID(S->getText())); >>
- vfrStatementQuestionTagList
- E:EndAction << CRT_END_OP (E); >>
- ";"
- ;
-
-vfrActionFlags[CIfrAction & AObj, UINT32 LineNum] :
- << UINT8 HFlags = 0; >>
- actionFlagsField[HFlags] ( "\|" actionFlagsField[HFlags] )*
- << _PCATCH(AObj.SetFlags (HFlags), LineNum); >>
- ;
-
-actionFlagsField[UINT8 & HFlags] :
- N:Number << _PCATCH(_STOU8(N->getText()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine()); >>
- | questionheaderFlagsField[HFlags]
- ;
-
-vfrStatementDate :
- <<
- EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
- CHAR8 *VarIdStr[3] = {NULL, };
- CIfrDate DObj;
- EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;
- UINT8 Size = OFFSET_OF (EFI_IFR_DEFAULT, Value) + sizeof (EFI_HII_DATE);
- >>
- L:Date << DObj.SetLineNo(L->getLine()); >>
- (
- (
- vfrQuestionHeader[DObj, QUESTION_DATE] "," <<
- if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {
- _GET_CURRQEST_VARTINFO().mVarType = EFI_IFR_TYPE_DATE;
- }
- >>
- { F:FLAGS "=" vfrDateFlags[DObj, F->getLine()] "," }
- vfrStatementQuestionOptionList
- )
- |
- (
- Year VarId "=" D1:StringIdentifier "." D1Y:StringIdentifier ","
- << _STRCAT(&VarIdStr[0], D1->getText()); _STRCAT(&VarIdStr[0], "."); _STRCAT(&VarIdStr[0], D1Y->getText()); >>
- Prompt "=" "STRING_TOKEN" "\(" YP:Number "\)" ","
- Help "=" "STRING_TOKEN" "\(" YH:Number "\)" ","
- minMaxDateStepDefault[Val.date, 0]
-
- Month VarId "=" D2:StringIdentifier "." D2M:StringIdentifier ","
- << _STRCAT(&VarIdStr[1], D2->getText()); _STRCAT(&VarIdStr[1], "."); _STRCAT(&VarIdStr[1], D2M->getText()); >>
- Prompt "=" "STRING_TOKEN" "\(" MP:Number "\)" ","
- Help "=" "STRING_TOKEN" "\(" MH:Number "\)" ","
- minMaxDateStepDefault[Val.date, 1]
-
- Day VarId "=" D3:StringIdentifier "." D3D:StringIdentifier ","
- << _STRCAT(&VarIdStr[2], D3->getText()); _STRCAT(&VarIdStr[2], "."); _STRCAT(&VarIdStr[2], D3D->getText()); >>
- Prompt "=" "STRING_TOKEN" "\(" DP:Number "\)" ","
- Help "=" "STRING_TOKEN" "\(" DH:Number "\)" ","
- minMaxDateStepDefault[Val.date, 2]
- { G:FLAGS "=" vfrDateFlags[DObj, G->getLine()] "," }
- <<
- mCVfrQuestionDB.RegisterOldDateQuestion (VarIdStr[0], VarIdStr[1], VarIdStr[2], QId);
- DObj.SetQuestionId (QId);
- DObj.SetFlags (EFI_IFR_QUESTION_FLAG_DEFAULT, QF_DATE_STORAGE_TIME);
- DObj.SetPrompt (_STOSID(YP->getText()));
- DObj.SetHelp (_STOSID(YH->getText()));
- if (VarIdStr[0] != NULL) { delete VarIdStr[0]; } if (VarIdStr[1] != NULL) { delete VarIdStr[1]; } if (VarIdStr[2] != NULL) { delete VarIdStr[2]; }
- >>
- << {CIfrDefault DefaultObj(Size, EFI_HII_DEFAULT_CLASS_STANDARD, EFI_IFR_TYPE_DATE, Val); DefaultObj.SetLineNo(L->getLine());} >>
- )
- ( vfrStatementInconsistentIf )*
- )
- E:EndDate << CRT_END_OP (E); >>
- ";"
- ;
-
-minMaxDateStepDefault[EFI_HII_DATE & D, UINT8 KeyValue] :
- Minimum "=" MinN:Number ","
- Maximum "=" MaxN:Number ","
- { "step" "=" Number "," }
- {
- "default" "=" N:Number "," <<
- switch (KeyValue) {
- case 0:
- D.Year = _STOU16(N->getText());
- if (D.Year < _STOU16 (MinN->getText()) || D.Year > _STOU16 (MaxN->getText())) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Year default value must be between Min year and Max year.");
- }
- break;
- case 1:
- D.Month = _STOU8(N->getText());
- if (D.Month < 1 || D.Month > 12) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Month default value must be between 1 and 12.");
- }
- break;
- case 2:
- D.Day = _STOU8(N->getText());
- if (D.Day < 1 || D.Day > 31) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Day default value must be between 1 and 31.");
- }
- break;
- }
- >>
- }
- ;
-
-vfrDateFlags [CIfrDate & DObj, UINT32 LineNum] :
- << UINT8 LFlags = 0; >>
- dateFlagsField[LFlags] ( "\|" dateFlagsField[LFlags] )*
- << _PCATCH(DObj.SetFlags (EFI_IFR_QUESTION_FLAG_DEFAULT, LFlags), LineNum); >>
- ;
-
-dateFlagsField [UINT8 & Flags] :
- N:Number << $Flags |= _STOU8(N->getText()); >>
- | "YEAR_SUPPRESS" << $Flags |= 0x01; >>
- | "MONTH_SUPPRESS" << $Flags |= 0x02; >>
- | "DAY_SUPPRESS" << $Flags |= 0x04; >>
- | "STORAGE_NORMAL" << $Flags |= 0x00; >>
- | "STORAGE_TIME" << $Flags |= 0x10; >>
- | "STORAGE_WAKEUP" << $Flags |= 0x20; >>
- ;
-
-vfrStatementNumericType :
- vfrStatementNumeric |
- vfrStatementOneOf
- ;
-
-vfrSetMinMaxStep[CIfrMinMaxStepData & MMSDObj] :
- <<
- UINT64 MaxU8 = 0, MinU8 = 0, StepU8 = 0;
- UINT32 MaxU4 = 0, MinU4 = 0, StepU4 = 0;
- UINT16 MaxU2 = 0, MinU2 = 0, StepU2 = 0;
- UINT8 MaxU1 = 0, MinU1 = 0, StepU1 = 0;
- >>
- Minimum "=" I:Number ","
- <<
- switch (_GET_CURRQEST_DATATYPE()) {
- case EFI_IFR_TYPE_NUM_SIZE_64 : MinU8 = _STOU64(I->getText()); break;
- case EFI_IFR_TYPE_NUM_SIZE_32 : MinU4 = _STOU32(I->getText()); break;
- case EFI_IFR_TYPE_NUM_SIZE_16 : MinU2 = _STOU16(I->getText()); break;
- case EFI_IFR_TYPE_NUM_SIZE_8 : MinU1 = _STOU8(I->getText()); break;
- }
- >>
- Maximum "=" A:Number ","
- <<
- switch (_GET_CURRQEST_DATATYPE()) {
- case EFI_IFR_TYPE_NUM_SIZE_64 :
- MaxU8 = _STOU64(A->getText());
- if (MaxU8 < MinU8) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, A->getLine(), "Maximum can't be less than Minimum");
- }
- break;
- case EFI_IFR_TYPE_NUM_SIZE_32 :
- MaxU4 = _STOU32(A->getText());
- if (MaxU4 < MinU4) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, A->getLine(), "Maximum can't be less than Minimum");
- }
- break;
- case EFI_IFR_TYPE_NUM_SIZE_16 :
- MaxU2 = _STOU16(A->getText());
- if (MaxU2 < MinU2) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, A->getLine(), "Maximum can't be less than Minimum");
- }
- break;
- case EFI_IFR_TYPE_NUM_SIZE_8 :
- MaxU1 = _STOU8(A->getText());
- if (MaxU1 < MinU1) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, A->getLine(), "Maximum can't be less than Minimum");
- }
- break;
- }
- >>
- {
- STEP "=" S:Number ","
- <<
- switch (_GET_CURRQEST_DATATYPE()) {
- case EFI_IFR_TYPE_NUM_SIZE_64 : StepU8 = _STOU64(S->getText()); break;
- case EFI_IFR_TYPE_NUM_SIZE_32 : StepU4 = _STOU32(S->getText()); break;
- case EFI_IFR_TYPE_NUM_SIZE_16 : StepU2 = _STOU16(S->getText()); break;
- case EFI_IFR_TYPE_NUM_SIZE_8 : StepU1 = _STOU8(S->getText()); break;
- }
- >>
- }
- <<
- switch (_GET_CURRQEST_DATATYPE()) {
- case EFI_IFR_TYPE_NUM_SIZE_64 : $MMSDObj.SetMinMaxStepData (MinU8, MaxU8, StepU8); break;
- case EFI_IFR_TYPE_NUM_SIZE_32 : $MMSDObj.SetMinMaxStepData (MinU4, MaxU4, StepU4); break;
- case EFI_IFR_TYPE_NUM_SIZE_16 : $MMSDObj.SetMinMaxStepData (MinU2, MaxU2, StepU2); break;
- case EFI_IFR_TYPE_NUM_SIZE_8 : $MMSDObj.SetMinMaxStepData (MinU1, MaxU1, StepU1); break;
- }
- >>
- ;
-
-vfrStatementNumeric :
- <<
- CIfrNumeric NObj;
- UINT32 DataTypeSize;
- BOOLEAN IsSupported = TRUE;
- UINT8 ShrinkSize = 0;
- >>
- L:Numeric << NObj.SetLineNo(L->getLine()); >>
- vfrQuestionHeader[NObj] "," << // check data type
- if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {
- _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize), L->getLine(), "Numeric varid is not the valid data type");
- if (DataTypeSize != 0 && DataTypeSize != _GET_CURRQEST_VARSIZE()) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Numeric varid doesn't support array");
- }
- _PCATCH(NObj.SetFlags (NObj.FLAGS(), _GET_CURRQEST_DATATYPE()), L->getLine());
- }
- >>
- { F:FLAGS "=" vfrNumericFlags[NObj, F->getLine()] "," }
- {
- Key "=" KN:Number "," << AssignQuestionKey (NObj, KN); >>
- }
- vfrSetMinMaxStep[NObj] <<
- switch (_GET_CURRQEST_DATATYPE()) {
- //
- // Base on the type to know the actual used size,shrink the buffer
- // size allocate before.
- //
- case EFI_IFR_TYPE_NUM_SIZE_8: ShrinkSize = 21;break;
- case EFI_IFR_TYPE_NUM_SIZE_16:ShrinkSize = 18;break;
- case EFI_IFR_TYPE_NUM_SIZE_32:ShrinkSize = 12;break;
- case EFI_IFR_TYPE_NUM_SIZE_64:break;
- default:
- IsSupported = FALSE;
- break;
- }
- NObj.ShrinkBinSize (ShrinkSize);
- if (!IsSupported) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Numeric question only support UINT8, UINT16, UINT32 and UINT64 data type.");
- }
- >>
- vfrStatementQuestionOptionList
- E:EndNumeric <<
- CRT_END_OP (E);
- >>
- ";"
- ;
-
-vfrNumericFlags [CIfrNumeric & NObj, UINT32 LineNum] :
- <<
- UINT8 LFlags = _GET_CURRQEST_DATATYPE() & EFI_IFR_NUMERIC_SIZE;
- UINT8 HFlags = 0;
- EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
- BOOLEAN IsSetType = FALSE;
- >>
- numericFlagsField[HFlags, LFlags, IsSetType] ( "\|" numericFlagsField[HFlags, LFlags, IsSetType] )*
- <<
- //check data type flag
- if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {
- VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);
- if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {
- if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {
- _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");
- }
- } else {
- // update data type for name/value store
- UINT32 DataTypeSize;
- _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;
- gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);
- _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;
- }
- } else if (IsSetType){
- _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;
- }
- _PCATCH(NObj.SetFlags (HFlags, LFlags), LineNum);
- >>
- ;
-
-numericFlagsField [UINT8 & HFlags, UINT8 & LFlags, BOOLEAN & IsSetType] :
- N:Number << _PCATCH(_STOU8(N->getText()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine()); >>
- | "NUMERIC_SIZE_1" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_1; IsSetType = TRUE;>>
- | "NUMERIC_SIZE_2" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_2; IsSetType = TRUE;>>
- | "NUMERIC_SIZE_4" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_4; IsSetType = TRUE;>>
- | "NUMERIC_SIZE_8" << $LFlags = ($LFlags & ~EFI_IFR_NUMERIC_SIZE) | EFI_IFR_NUMERIC_SIZE_8; IsSetType = TRUE;>>
- | "DISPLAY_INT_DEC" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_INT_DEC; >>
- | "DISPLAY_UINT_DEC" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_DEC; >>
- | "DISPLAY_UINT_HEX" << $LFlags = ($LFlags & ~EFI_IFR_DISPLAY) | EFI_IFR_DISPLAY_UINT_HEX; >>
- | questionheaderFlagsField[HFlags]
- ;
-
-vfrStatementOneOf :
- <<
- CIfrOneOf OObj;
- UINT32 DataTypeSize;
- BOOLEAN IsSupported = TRUE;
- UINT8 ShrinkSize = 0;
- >>
- L:OneOf << OObj.SetLineNo(L->getLine()); >>
- vfrQuestionHeader[OObj] "," << //check data type
- if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {
- _PCATCH (gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize), L->getLine(), "OneOf varid is not the valid data type");
- if (DataTypeSize != 0 && DataTypeSize != _GET_CURRQEST_VARSIZE()) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "OneOf varid doesn't support array");
- }
- _PCATCH(OObj.SetFlags (OObj.FLAGS(), _GET_CURRQEST_DATATYPE()), L->getLine());
- }
- >>
- { F:FLAGS "=" vfrOneofFlagsField[OObj, F->getLine()] "," }
- {
- vfrSetMinMaxStep[OObj]
- }
- <<
- switch (_GET_CURRQEST_DATATYPE()) {
- //
- // Base on the type to know the actual used size,shrink the buffer
- // size allocate before.
- //
- case EFI_IFR_TYPE_NUM_SIZE_8: ShrinkSize = 21;break;
- case EFI_IFR_TYPE_NUM_SIZE_16:ShrinkSize = 18;break;
- case EFI_IFR_TYPE_NUM_SIZE_32:ShrinkSize = 12;break;
- case EFI_IFR_TYPE_NUM_SIZE_64:break;
- default:
- IsSupported = FALSE;
- break;
- }
- OObj.ShrinkBinSize (ShrinkSize);
- if (!IsSupported) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "OneOf question only support UINT8, UINT16, UINT32 and UINT64 data type.");
- }
- >>
- vfrStatementQuestionOptionList
- E:EndOneOf <<
- CRT_END_OP (E);
- >>
- ";"
- ;
-
-vfrOneofFlagsField [CIfrOneOf & OObj, UINT32 LineNum] :
- <<
- UINT8 LFlags = _GET_CURRQEST_DATATYPE() & EFI_IFR_NUMERIC_SIZE;
- UINT8 HFlags = 0;
- EFI_VFR_VARSTORE_TYPE VarStoreType = EFI_VFR_VARSTORE_INVALID;
- BOOLEAN IsSetType = FALSE;
- >>
- numericFlagsField[HFlags, LFlags, IsSetType] ( "\|" numericFlagsField[HFlags, LFlags, IsSetType] )*
- <<
- //check data type flag
- if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {
- VarStoreType = mCVfrDataStorage.GetVarStoreType (_GET_CURRQEST_VARTINFO().mVarStoreId);
- if (VarStoreType == EFI_VFR_VARSTORE_BUFFER || VarStoreType == EFI_VFR_VARSTORE_EFI) {
- if (_GET_CURRQEST_DATATYPE() != (LFlags & EFI_IFR_NUMERIC_SIZE)) {
- _PCATCH(VFR_RETURN_INVALID_PARAMETER, LineNum, "Numeric Flag is not same to Numeric VarData type");
- }
- } else {
- // update data type for Name/Value store
- UINT32 DataTypeSize;
- _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;
- gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &DataTypeSize);
- _GET_CURRQEST_VARTINFO().mVarTotalSize = DataTypeSize;
- }
- } else if (IsSetType){
- _GET_CURRQEST_VARTINFO().mVarType = LFlags & EFI_IFR_NUMERIC_SIZE;
- }
- _PCATCH(OObj.SetFlags (HFlags, LFlags), LineNum);
- >>
- ;
-
-vfrStatementStringType :
- vfrStatementString |
- vfrStatementPassword
- ;
-
-vfrStatementString :
- <<
- CIfrString SObj;
- UINT32 VarArraySize;
- UINT8 StringMinSize;
- UINT8 StringMaxSize;
- >>
- L:String << SObj.SetLineNo(L->getLine()); >>
- vfrQuestionHeader[SObj] ","
- { F:FLAGS "=" vfrStringFlagsField[SObj, F->getLine()] "," }
- {
- Key "=" KN:Number "," << AssignQuestionKey (SObj, KN); >>
- }
- MinSize "=" MIN:Number "," <<
- VarArraySize = _GET_CURRQEST_ARRAY_SIZE();
- StringMinSize = _STOU8(MIN->getText());
- if (_STOU64(MIN->getText()) > StringMinSize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, MIN->getLine(), "String MinSize takes only one byte, which can't be larger than 0xFF.");
- } else if (VarArraySize != 0 && StringMinSize > VarArraySize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, MIN->getLine(), "String MinSize can't be larger than the max number of elements in string array.");
- }
- SObj.SetMinSize (StringMinSize);
- >>
- MaxSize "=" MAX:Number "," <<
- StringMaxSize = _STOU8(MAX->getText());
- if (_STOU64(MAX->getText()) > StringMaxSize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "String MaxSize takes only one byte, which can't be larger than 0xFF.");
- } else if (VarArraySize != 0 && StringMaxSize > VarArraySize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "String MaxSize can't be larger than the max number of elements in string array.");
- } else if (StringMaxSize < StringMinSize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "String MaxSize can't be less than String MinSize.");
- }
- SObj.SetMaxSize (StringMaxSize);
- >>
- vfrStatementQuestionOptionList
- E:EndString << CRT_END_OP (E); >>
- ";"
- ;
-
-vfrStringFlagsField [CIfrString & SObj, UINT32 LineNum] :
- <<
- UINT8 LFlags = 0;
- UINT8 HFlags = 0;
- >>
- stringFlagsField[HFlags, LFlags] ( "\|" stringFlagsField[HFlags, LFlags] )*
- << _PCATCH(SObj.SetFlags (HFlags, LFlags), LineNum); >>
- ;
-
-stringFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
- N:Number << _PCATCH(_STOU8(N->getText()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine()); >>
- | "MULTI_LINE" << $LFlags = 0x01; >>
- | questionheaderFlagsField[HFlags]
- ;
-
-vfrStatementPassword :
- <<
- CIfrPassword PObj;
- UINT32 VarArraySize;
- UINT16 PasswordMinSize;
- UINT16 PasswordMaxSize;
- >>
- L:Password << PObj.SetLineNo(L->getLine()); >>
- vfrQuestionHeader[PObj] ","
- { F:FLAGS "=" vfrPasswordFlagsField[PObj, F->getLine()] "," }
- {
- Key "=" KN:Number "," << AssignQuestionKey (PObj, KN); >>
- }
- MinSize "=" MIN:Number "," <<
- VarArraySize = _GET_CURRQEST_ARRAY_SIZE();
- PasswordMinSize = _STOU16(MIN->getText());
- if (_STOU64(MIN->getText()) > PasswordMinSize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, MIN->getLine(), "Password MinSize takes only two byte, which can't be larger than 0xFFFF.");
- } else if (VarArraySize != 0 && PasswordMinSize > VarArraySize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, MIN->getLine(), "Password MinSize can't be larger than the max number of elements in password array.");
- }
- PObj.SetMinSize (PasswordMinSize);
- >>
- MaxSize "=" MAX:Number "," <<
- PasswordMaxSize = _STOU16(MAX->getText());
- if (_STOU64(MAX->getText()) > PasswordMaxSize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "Password MaxSize takes only two byte, which can't be larger than 0xFFFF.");
- } else if (VarArraySize != 0 && PasswordMaxSize > VarArraySize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "Password MaxSize can't be larger than the max number of elements in password array.");
- } else if (PasswordMaxSize < PasswordMinSize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "Password MaxSize can't be less than Password MinSize.");
- }
- PObj.SetMaxSize (PasswordMaxSize);
- >>
- { Encoding "=" Number "," }
- vfrStatementQuestionOptionList
- E:EndPassword << CRT_END_OP (E); >>
- ";"
- ;
-
-vfrPasswordFlagsField [CIfrPassword & PObj, UINT32 LineNum] :
- << UINT8 HFlags = 0; >>
- passwordFlagsField[HFlags] ( "\|" passwordFlagsField[HFlags] )*
- << _PCATCH(PObj.SetFlags(HFlags), LineNum); >>
- ;
-
-passwordFlagsField [UINT8 & HFlags] :
- N:Number << _PCATCH(_STOU8(N->getText()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine()); >>
- | questionheaderFlagsField[HFlags]
- ;
-
-vfrStatementOrderedList :
- <<
- CIfrOrderedList OLObj;
- UINT32 VarArraySize;
- >>
- L:OrderedList << OLObj.SetLineNo(L->getLine()); >>
- vfrQuestionHeader[OLObj] ","
- <<
- VarArraySize = _GET_CURRQEST_ARRAY_SIZE();
- OLObj.SetMaxContainers ((UINT8) (VarArraySize > 0xFF ? 0xFF : VarArraySize));
- >>
- {
- MaxContainers "=" M:Number "," <<
- if (_STOU64(M->getText()) > _STOU8(M->getText())) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, M->getLine(), "OrderedList MaxContainers takes only one byte, which can't be larger than 0xFF.");
- } else if (VarArraySize != 0 && _STOU8(M->getText()) > VarArraySize) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, M->getLine(), "OrderedList MaxContainers can't be larger than the max number of elements in array.");
- }
- OLObj.SetMaxContainers (_STOU8(M->getText()));
- >>
- }
- { F:FLAGS "=" vfrOrderedListFlags[OLObj, F->getLine()] }
- vfrStatementQuestionOptionList
- E:EndList << CRT_END_OP (E); >>
- ";"
- ;
-
-vfrOrderedListFlags [CIfrOrderedList & OLObj, UINT32 LineNum] :
- <<
- UINT8 HFlags = 0;
- UINT8 LFlags = 0;
- >>
- orderedlistFlagsField[HFlags, LFlags] ( "\|" orderedlistFlagsField[HFlags, LFlags] )*
- << _PCATCH(OLObj.SetFlags (HFlags, LFlags), LineNum); >>
- ;
-
-orderedlistFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
- N:Number << _PCATCH(_STOU8(N->getText()) == 0 ? VFR_RETURN_SUCCESS : VFR_RETURN_UNSUPPORTED, N->getLine()); >>
- | "UNIQUE" << $LFlags |= 0x01; >>
- | "NOEMPTY" << $LFlags |= 0x02; >>
- | questionheaderFlagsField[HFlags]
- ;
-
-vfrStatementTime :
- <<
- EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
- CHAR8 *VarIdStr[3] = {NULL, };
- CIfrTime TObj;
- EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;
- UINT8 Size = OFFSET_OF (EFI_IFR_DEFAULT, Value) + sizeof (EFI_HII_TIME);
- >>
- L:Time << TObj.SetLineNo(L->getLine()); >>
- (
- (
- vfrQuestionHeader[TObj, QUESTION_TIME] "," <<
- if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {
- _GET_CURRQEST_VARTINFO().mVarType = EFI_IFR_TYPE_TIME;
- }
- >>
- { F:FLAGS "=" vfrTimeFlags[TObj, F->getLine()] "," }
- vfrStatementQuestionOptionList
- )
- |
- (
- Hour VarId "=" T1:StringIdentifier "." T1H:StringIdentifier ","
- << _STRCAT(&VarIdStr[0], T1->getText()); _STRCAT(&VarIdStr[0], "."); _STRCAT(&VarIdStr[0], T1H->getText()); >>
- Prompt "=" "STRING_TOKEN" "\(" HP:Number "\)" ","
- Help "=" "STRING_TOKEN" "\(" HH:Number "\)" ","
- minMaxTimeStepDefault[Val.time, 0]
-
- Minute VarId "=" T2:StringIdentifier "." T2M:StringIdentifier ","
- << _STRCAT(&VarIdStr[1], T2->getText()); _STRCAT(&VarIdStr[1], "."); _STRCAT(&VarIdStr[1], T2M->getText()); >>
- Prompt "=" "STRING_TOKEN" "\(" MP:Number "\)" ","
- Help "=" "STRING_TOKEN" "\(" MH:Number "\)" ","
- minMaxTimeStepDefault[Val.time, 1]
-
- Second VarId "=" T3:StringIdentifier "." T3S:StringIdentifier ","
- << _STRCAT(&VarIdStr[2], T3->getText()); _STRCAT(&VarIdStr[2], "."); _STRCAT(&VarIdStr[2], T3S->getText()); >>
- Prompt "=" "STRING_TOKEN" "\(" SP:Number "\)" ","
- Help "=" "STRING_TOKEN" "\(" SH:Number "\)" ","
- minMaxTimeStepDefault[Val.time, 2]
- { G:FLAGS "=" vfrTimeFlags[TObj, G->getLine()] "," }
- <<
- mCVfrQuestionDB.RegisterOldTimeQuestion (VarIdStr[0], VarIdStr[1], VarIdStr[2], QId);
- TObj.SetQuestionId (QId);
- TObj.SetFlags (EFI_IFR_QUESTION_FLAG_DEFAULT, QF_TIME_STORAGE_TIME);
- TObj.SetPrompt (_STOSID(HP->getText()));
- TObj.SetHelp (_STOSID(HH->getText()));
- if (VarIdStr[0] != NULL) { delete VarIdStr[0]; } if (VarIdStr[1] != NULL) { delete VarIdStr[1]; } if (VarIdStr[2] != NULL) { delete VarIdStr[2]; }
- >>
- << {CIfrDefault DefaultObj(Size, EFI_HII_DEFAULT_CLASS_STANDARD, EFI_IFR_TYPE_TIME, Val); DefaultObj.SetLineNo(L->getLine());} >>
- )
- ( vfrStatementInconsistentIf )*
- )
- E:EndTime << CRT_END_OP (E); >>
- ";"
- ;
-
-minMaxTimeStepDefault[EFI_HII_TIME & T, UINT8 KeyValue] :
- Minimum "=" Number ","
- Maximum "=" Number ","
- { "step" "=" Number "," }
- {
- "default" "=" N:Number "," <<
- switch (KeyValue) {
- case 0:
- T.Hour = _STOU8(N->getText());
- if (T.Hour > 23) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Hour default value must be between 0 and 23.");
- }
- break;
- case 1:
- T.Minute = _STOU8(N->getText());
- if (T.Minute > 59) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Minute default value must be between 0 and 59.");
- }
- break;
- case 2:
- T.Second = _STOU8(N->getText());
- if (T.Second > 59) {
- _PCATCH (VFR_RETURN_INVALID_PARAMETER, N->getLine(), "Second default value must be between 0 and 59.");
- }
- break;
- }
- >>
- }
- ;
-
-vfrTimeFlags [CIfrTime & TObj, UINT32 LineNum] :
- << UINT8 LFlags = 0; >>
- timeFlagsField[LFlags] ( "\|" timeFlagsField[LFlags] )*
- << _PCATCH(TObj.SetFlags(EFI_IFR_QUESTION_FLAG_DEFAULT, LFlags), LineNum); >>
- ;
-
-timeFlagsField [UINT8 & Flags] :
- N:Number << $Flags |= _STOU8(N->getText()); >>
- | "HOUR_SUPPRESS" << $Flags |= 0x01; >>
- | "MINUTE_SUPPRESS" << $Flags |= 0x02; >>
- | "SECOND_SUPPRESS" << $Flags |= 0x04; >>
- | "STORAGE_NORMAL" << $Flags |= 0x00; >>
- | "STORAGE_TIME" << $Flags |= 0x10; >>
- | "STORAGE_WAKEUP" << $Flags |= 0x20; >>
- ;
-
-vfrStatementQuestionTag :
- vfrStatementStatTag "," |
- vfrStatementInconsistentIf |
- vfrStatementNoSubmitIf |
- vfrStatementDisableIfQuest |
- vfrStatementRefresh |
- vfrStatementVarstoreDevice |
- vfrStatementExtension |
- vfrStatementRefreshEvent
- ;
-
-vfrStatementQuestionTagList :
- ( vfrStatementQuestionTag )*
- ;
-
-vfrStatementQuestionOptionTag :
- vfrStatementSuppressIfQuest |
- vfrStatementGrayOutIfQuest |
- vfrStatementValue |
- vfrStatementDefault |
- vfrStatementRead |
- vfrStatementWrite |
- vfrStatementOptions
- ;
-
-vfrStatementQuestionOptionList :
- (
- vfrStatementQuestionTag |
- vfrStatementQuestionOptionTag
- )*
- ;
-
-vfrStatementStatList :
- vfrStatementStat |
- vfrStatementQuestions |
- vfrStatementConditionalNew |
- vfrStatementLabel |
- vfrStatementExtension |
- // Just for framework vfr compatibility
- vfrStatementInvalid
- ;
-
-vfrStatementStatListOld :
- vfrStatementStat |
- vfrStatementQuestions |
- vfrStatementLabel |
- // Just for framework vfr compatibility
- vfrStatementInvalid
- ;
-
-vfrStatementDisableIfStat :
- <<
- CIfrDisableIf DIObj;
- >>
- L:DisableIf << DIObj.SetLineNo(L->getLine()); >>
- vfrStatementExpression[0] ";"
- ( vfrStatementStatList )*
- E:EndIf << CRT_END_OP (E); >>
- ";"
- ;
-
-vfrStatementInconsistentIfStat :
- << CIfrInconsistentIf IIObj; >>
- L:InconsistentIf <<
- if (!mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, L);
- }
- IIObj.SetLineNo(L->getLine());
- >>
- Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << IIObj.SetError (_STOSID(S->getText())); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0]
- E:EndIf << CRT_END_OP (E); >>
- ";"
- ;
-
-//
-// Compatible for framework vfr file
-//
-vfrStatementgrayoutIfSuppressIf:
- << CIfrSuppressIf SIObj; >>
- L:SuppressIf << SIObj.SetLineNo(L->getLine()); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0]
- ";"
- ;
-
-vfrStatementsuppressIfGrayOutIf:
- << CIfrGrayOutIf GOIObj; >>
- L:GrayOutIf << GOIObj.SetLineNo(L->getLine()); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0]
- ";"
- ;
-
-vfrStatementSuppressIfStatNew :
- << CIfrSuppressIf SIObj;>>
- L:SuppressIf << SIObj.SetLineNo(L->getLine()); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0]
- ";"
- ( vfrStatementStatList )*
- E: EndIf ";" << CRT_END_OP (E); >>
- ;
-
-vfrStatementGrayOutIfStatNew :
- << CIfrGrayOutIf GOIObj;>>
- L:GrayOutIf << GOIObj.SetLineNo(L->getLine()); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0]
- ";"
- ( vfrStatementStatList )*
- E: EndIf ";" << CRT_END_OP (E); >>
- ;
-
-vfrStatementSuppressIfStatOld :
- <<
- CIfrSuppressIf SIObj;
- BOOLEAN GrayOutExist = FALSE;
- >>
- L:SuppressIf << SIObj.SetLineNo(L->getLine()); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0]
- ";"
- {
- vfrStatementsuppressIfGrayOutIf
- << GrayOutExist = TRUE; >>
- }
- ( vfrStatementStatListOld )*
- E: EndIf ";" << if (GrayOutExist) CRT_END_OP (E); CRT_END_OP (E);>>
- ;
-
-vfrStatementGrayOutIfStatOld :
- <<
- CIfrGrayOutIf GOIObj;
- BOOLEAN SuppressExist = FALSE;
- >>
- L:GrayOutIf << GOIObj.SetLineNo(L->getLine()); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0]
- ";"
- {
- vfrStatementgrayoutIfSuppressIf
- << SuppressExist = TRUE; >>
- }
- ( vfrStatementStatListOld )*
- E: EndIf ";" << if (SuppressExist) CRT_END_OP (E); CRT_END_OP (E); >>
- ;
-
-vfrImageTag :
- << CIfrImage IObj; >>
- L:Image "=" "IMAGE_TOKEN" "\(" S1:Number "\)" << IObj.SetImageId (_STOSID(S1->getText())); IObj.SetLineNo(L->getLine()); >>
- ;
-
-vfrLockedTag :
- << CIfrLocked LObj; >>
- L:Locked << LObj.SetLineNo(L->getLine()); >>
- ;
-
-vfrModalTag :
- << CIfrModal MObj; >>
- L:Modal << MObj.SetLineNo(L->getLine()); >>
- ;
-
-vfrStatementStatTag :
- vfrImageTag |
- vfrLockedTag
- ;
-
-vfrStatementStatTagList :
- vfrStatementStatTag ( "," vfrStatementStatTag )*
- ;
-
-vfrStatementImage :
- vfrImageTag
- ";"
- ;
-
-vfrStatementModal :
- vfrModalTag
- ";"
- ;
-
-vfrStatementLocked :
- vfrLockedTag
- ";"
- ;
-
-vfrStatementInconsistentIf :
- << CIfrInconsistentIf IIObj; >>
- L:InconsistentIf << IIObj.SetLineNo(L->getLine()); >>
- Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << IIObj.SetError (_STOSID(S->getText())); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0]
- E:EndIf << CRT_END_OP (E); >>
- ;
-
-vfrStatementNoSubmitIf :
- << CIfrNoSubmitIf NSIObj; >>
- L:NoSubmitIf << NSIObj.SetLineNo(L->getLine()); >>
- Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << NSIObj.SetError (_STOSID(S->getText())); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0]
- E:EndIf << CRT_END_OP (E); >>
- ;
-
-vfrStatementDisableIfQuest :
- <<
- CIfrDisableIf DIObj;
- >>
- L:DisableIf << DIObj.SetLineNo(L->getLine()); >>
- vfrStatementExpression[0] ";"
- vfrStatementQuestionOptionList
- E:EndIf << CRT_END_OP (E); >>
- ;
-
-vfrStatementRefresh :
- << CIfrRefresh RObj; >>
- L:Refresh << RObj.SetLineNo(L->getLine()); >>
- Interval "=" I:Number << RObj.SetRefreshInterval (_STOU8(I->getText())); >>
- ;
-
-vfrStatementRefreshEvent :
- <<
- CIfrRefreshId RiObj;
- EFI_GUID Guid;
- >>
- L:RefreshGuid << RiObj.SetLineNo(L->getLine()); >>
- "=" guidDefinition[Guid] "," << RiObj.SetRefreshEventGroutId (&Guid); >>
- ;
-
-vfrStatementVarstoreDevice :
- << CIfrVarStoreDevice VDObj; >>
- L:VarstoreDevice << VDObj.SetLineNo(L->getLine()); >>
- "=" "STRING_TOKEN" "\(" S:Number "\)" "," << VDObj.SetDevicePath (_STOSID(S->getText())); >>
- ;
-
-vfrStatementSuppressIfQuest :
- << CIfrSuppressIf SIObj; >>
- L:SuppressIf << SIObj.SetLineNo(L->getLine()); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0] ";"
- vfrStatementQuestionOptionList
- E:EndIf << CRT_END_OP (E); >>
- ;
-
-vfrStatementGrayOutIfQuest :
- << CIfrGrayOutIf GOIObj; >>
- L:GrayOutIf << GOIObj.SetLineNo(L->getLine()); >>
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0] ";"
- vfrStatementQuestionOptionList
- E:EndIf << CRT_END_OP (E); >>
- ;
-
-vfrStatementOptions :
- vfrStatementOneOfOption
- ;
-
-vfrStatementOneOfOption :
- <<
- EFI_IFR_TYPE_VALUE Val = gZeroEfiIfrTypeValue;
- CHAR8 *VarStoreName = NULL;
- UINT32 Size = 0;
- BOOLEAN TypeError = FALSE;
- EFI_VFR_RETURN_CODE ReturnCode = VFR_RETURN_SUCCESS;
- EFI_GUID *VarStoreGuid = NULL;
-
- if (_GET_CURRQEST_DATATYPE() == EFI_IFR_TYPE_OTHER) {
- TypeError = TRUE;
- Size = sizeof (EFI_IFR_TYPE_VALUE);
- } else {
- ReturnCode = gCVfrVarDataTypeDB.GetDataTypeSize (_GET_CURRQEST_DATATYPE(), &Size);
- }
-
- Size += OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value);
- CIfrOneOfOption OOOObj ((UINT8)Size);
- >>
- L:Option <<
- OOOObj.SetLineNo(L->getLine());
- if (TypeError) {
- _PCATCH (VFR_RETURN_FATAL_ERROR, L->getLine(), "Get data type error.");
- }
- if (ReturnCode != VFR_RETURN_SUCCESS) {
- _PCATCH (ReturnCode, L->getLine());
- }
- >>
- Text "=" "STRING_TOKEN" "\(" S:Number "\)" "," << OOOObj.SetOption (_STOSID(S->getText())); >>
- Value "=" vfrConstantValueField[_GET_CURRQEST_DATATYPE()] >[Val] ","
- <<
- if (gCurrentMinMaxData != NULL) {
- //set min/max value for oneof opcode
- UINT64 Step = gCurrentMinMaxData->GetStepData(_GET_CURRQEST_DATATYPE());
- switch (_GET_CURRQEST_DATATYPE()) {
- case EFI_IFR_TYPE_NUM_SIZE_64:
- gCurrentMinMaxData->SetMinMaxStepData(Val.u64, Val.u64, Step);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_32:
- gCurrentMinMaxData->SetMinMaxStepData(Val.u32, Val.u32, (UINT32) Step);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_16:
- gCurrentMinMaxData->SetMinMaxStepData(Val.u16, Val.u16, (UINT16) Step);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_8:
- gCurrentMinMaxData->SetMinMaxStepData(Val.u8, Val.u8, (UINT8) Step);
- break;
- default:
- break;
- }
- }
- OOOObj.SetType (_GET_CURRQEST_DATATYPE());
- OOOObj.SetValue (Val);
- >>
- F:FLAGS "=" vfrOneOfOptionFlags[OOOObj, F->getLine()]
- <<
- if (_GET_CURRQEST_VARTINFO().mVarStoreId != EFI_VARSTORE_ID_INVALID) {
- _PCATCH(mCVfrDataStorage.GetVarStoreName (_GET_CURRQEST_VARTINFO().mVarStoreId, &VarStoreName), L->getLine());
- VarStoreGuid = mCVfrDataStorage.GetVarStoreGuid(_GET_CURRQEST_VARTINFO().mVarStoreId);
- if (OOOObj.GetFlags () & 0x10) {
- CheckDuplicateDefaultValue (EFI_HII_DEFAULT_CLASS_STANDARD, F);
- _PCATCH(mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
- EFI_HII_DEFAULT_CLASS_STANDARD,
- _GET_CURRQEST_VARTINFO(),
- VarStoreName,
- VarStoreGuid,
- _GET_CURRQEST_DATATYPE (),
- Val
- ), L->getLine());
- }
- if (OOOObj.GetFlags () & 0x20) {
- CheckDuplicateDefaultValue (EFI_HII_DEFAULT_CLASS_MANUFACTURING, F);
- _PCATCH(mCVfrDefaultStore.BufferVarStoreAltConfigAdd (
- EFI_HII_DEFAULT_CLASS_MANUFACTURING,
- _GET_CURRQEST_VARTINFO(),
- VarStoreName,
- VarStoreGuid,
- _GET_CURRQEST_DATATYPE (),
- Val
- ), L->getLine());
- }
- }
- >>
- {
- "," Key "=" KN:Number <<
- if (!mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, KN);
- }
- //
- // Guid Option Key
- //
- CIfrOptionKey IfrOptionKey (
- gCurrentQuestion->QUESTION_ID(),
- Val,
- _STOQID(KN->getText())
- );
- SET_LINE_INFO (IfrOptionKey, KN);
- >>
- }
- (
- T:"," vfrImageTag << OOOObj.SetScope (1); CRT_END_OP (T); >>
- )*
- ";"
- ;
-
-vfrOneOfOptionFlags [CIfrOneOfOption & OOOObj, UINT32 LineNum] :
- <<
- UINT8 LFlags = _GET_CURRQEST_DATATYPE();
- UINT8 HFlags = 0;
- >>
- oneofoptionFlagsField[HFlags, LFlags] ( "\|" oneofoptionFlagsField[HFlags, LFlags] )*
- << _PCATCH(gCurrentQuestion->SetFlags(HFlags), LineNum); >>
- << _PCATCH(OOOObj.SetFlags(LFlags), LineNum); >>
- ;
-
-oneofoptionFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
- N:Number << $LFlags |= _STOU8(N->getText()); >>
- | "OPTION_DEFAULT" << $LFlags |= 0x10; >>
- | "OPTION_DEFAULT_MFG" << $LFlags |= 0x20; >>
- | InteractiveFlag << $HFlags |= 0x04; >>
- | NVAccessFlag << $HFlags |= 0x08; >>
- | ResetRequiredFlag << $HFlags |= 0x10; >>
- | LateCheckFlag << $HFlags |= 0x20; >>
- | ManufacturingFlag << $LFlags |= 0x20; >>
- | DefaultFlag << $LFlags |= 0x10; >>
- ;
-
-vfrStatementLabel :
- L:Label
- N:Number <<
- if (mCompatibleMode) {
- //
- // Add end Label for Framework Vfr
- //
- CIfrLabel LObj1;
- LObj1.SetLineNo(L->getLine());
- LObj1.SetNumber (0xffff); //add end label for UEFI, label number hardcode 0xffff
- }
-
- {
- CIfrLabel LObj2;
- LObj2.SetLineNo(L->getLine());
- LObj2.SetNumber (_STOU16(N->getText()));
- }
- >>
- ";"
- ;
-
-vfrStatementBanner :
- << CIfrBanner BObj; >>
- B:Banner { "," } << BObj.SetLineNo(B->getLine()); >>
- Title "=" "STRING_TOKEN" "\(" S:Number "\)" "," << BObj.SetTitle (_STOSID(S->getText())); >>
- (
- (
- Line L:Number "," << BObj.SetLine (_STOU16(L->getText())); >>
- Align
- (
- Left << BObj.SetAlign (0); >>
- | Center << BObj.SetAlign (1); >>
- | Right << BObj.SetAlign (2); >>
- ) ";"
- )
- |
- (
- Timeout "=" T:Number ";" << {CIfrTimeout TObj(_STOU16(T->getText()));} >>
- )
- )
- ;
-
-//******************************************************************************
-//
-// keep some syntax for compatibility but not generate any IFR object
-//
-vfrStatementInvalidHidden :
- L:Hidden <<
- if (!mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, L);
- }
- >>
- Value "=" Number ","
- Key "=" Number ";"
- ;
-
-vfrStatementInvalidInconsistentIf :
- InconsistentIf
- Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" ","
- { FLAGS "=" flagsField ( "\|" flagsField )* "," }
- vfrStatementExpression[0]
- EndIf
- ";"
- ;
-
-vfrStatementInvalidInventory :
- L:Inventory <<
- if (!mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, L);
- }
- >>
- Help "=" "STRING_TOKEN" "\(" Number "\)" ","
- Text "=" "STRING_TOKEN" "\(" Number "\)" ","
- {
- Text "=" "STRING_TOKEN" "\(" Number "\)"
- }
- ";"
- ;
-
-vfrStatementInvalidSaveRestoreDefaults :
- (
- L:Save <<
- if (!mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, L);
- }
- >>
- |
- K:Restore <<
- if (!mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, K);
- }
- >>
- )
- Defaults ","
- FormId "=" Number ","
- Prompt "=" "STRING_TOKEN" "\(" Number "\)" ","
- Help "=" "STRING_TOKEN" "\(" Number "\)"
- { "," FLAGS "=" flagsField ( "\|" flagsField )* }
- { "," Key "=" Number }
- ";"
- ;
-
-//******************************************************************************
-//
-// The syntax of expression
-//
-#token Dup("dup") "dup"
-#token VarEqVal("vareqval") "vareqval"
-#token Var("var") "var"
-#token IdEqVal("ideqval") "ideqval"
-#token IdEqId("ideqid") "ideqid"
-#token IdEqValList("ideqvallist") "ideqvallist"
-#token QuestionRef("questionref") "questionref"
-#token RuleRef("ruleref") "ruleref"
-#token StringRef("stringref") "stringref"
-#token PushThis("pushthis") "pushthis"
-#token Security("security") "security"
-#token Get("get") "get"
-#token True("TRUE") "TRUE"
-#token False("FALSE") "FALSE"
-#token One("ONE") "ONE"
-#token Ones("ONES") "ONES"
-#token Zero("ZERO") "ZERO"
-#token Undefined("UNDEFINED") "UNDEFINED"
-#token Version("VERSION") "VERSION"
-#token Length("length") "length"
-#token AND("AND") "AND"
-#token OR("OR") "OR"
-#token NOT("NOT") "NOT"
-#token Set("set") "set"
-#token BitWiseNot("~") "\~"
-#token BoolVal("boolval") "boolval"
-#token StringVal("stringval") "stringval"
-#token UnIntVal("unintval") "unintval"
-#token ToUpper("toupper") "toupper"
-#token ToLower("tolower") "tolower"
-#token Match("match") "match"
-#token Catenate("catenate") "catenate"
-#token QuestionRefVal("questionrefval") "questionrefval"
-#token StringRefVal("stringrefval") "stringrefval"
-#token Map("map") "map"
-#token RefreshGuid("refreshguid") "refreshguid"
-
-//
-// Root expression extension function called by other function.
-//
-vfrStatementExpression [UINT32 RootLevel, UINT32 ExpOpCount = 0] :
- << if ($RootLevel == 0) {mCIfrOpHdrIndex ++; if (mCIfrOpHdrIndex >= MAX_IFR_EXPRESSION_DEPTH) _PCATCH (VFR_RETURN_INVALID_PARAMETER, 0, "The depth of expression exceeds the max supported level 8!"); _CLEAR_SAVED_OPHDR ();} >>
- andTerm[$RootLevel, $ExpOpCount]
- (
- L:OR andTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrOr OObj(L->getLine()); >>
- )*
- <<
- //
- // Extend OpCode Scope only for the root expression.
- //
- if ($ExpOpCount > 1 && $RootLevel == 0) {
- if (_SET_SAVED_OPHDR_SCOPE()) {
- CIfrEnd EObj;
- if (mCIfrOpHdrLineNo[mCIfrOpHdrIndex] != 0) {
- EObj.SetLineNo (mCIfrOpHdrLineNo[mCIfrOpHdrIndex]);
- }
- }
- }
-
- if ($RootLevel == 0) {
- mCIfrOpHdrIndex --;
- }
- >>
- ;
-
-//
-// Add new sub function for the sub expression extension to remember the ExpOpCount
-// This funciton is only called by sub expression.
-//
-vfrStatementExpressionSub [UINT32 RootLevel, UINT32 & ExpOpCount] :
- andTerm[$RootLevel, $ExpOpCount]
- (
- L:OR andTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrOr OObj(L->getLine()); >>
- )*
- ;
-
-andTerm[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- bitwiseorTerm[$RootLevel, $ExpOpCount]
- (
- L:AND bitwiseorTerm [$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrAnd AObj(L->getLine()); >>
- )*
- ;
-
-bitwiseorTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- bitwiseandTerm[$RootLevel, $ExpOpCount]
- (
- L:"\|" bitwiseandTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrBitWiseOr BWOObj(L->getLine()); >>
- )*
- ;
-
-bitwiseandTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- equalTerm[$RootLevel, $ExpOpCount]
- (
- L:"&" equalTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrBitWiseAnd BWAObj(L->getLine()); >>
- )*
- ;
-
-equalTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- compareTerm[$RootLevel, $ExpOpCount]
- (
- (
- L1:"==" compareTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrEqual EObj(L1->getLine()); >>
- )
- |
- (
- L2:"!=" compareTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrNotEqual NEObj(L2->getLine()); >>
- )
- )*
- ;
-
-compareTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- shiftTerm[$RootLevel, $ExpOpCount]
- (
- (
- L1:"<" shiftTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrLessThan LTObj(L1->getLine()); >>
- )
- |
- (
- L2:"<=" shiftTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrLessEqual LEObj(L2->getLine()); >>
- )
- |
- (
- L3:">" shiftTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrGreaterThan GTObj(L3->getLine()); >>
- )
- |
- (
- L4:">=" shiftTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrGreaterEqual GEObj(L4->getLine()); >>
- )
- )*
- ;
-
-shiftTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- addMinusTerm[$RootLevel, $ExpOpCount]
- (
- (
- L1:"\<<" addMinusTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrShiftLeft SLObj(L1->getLine()); >>
- )
- |
- (
- L2:"\>>" addMinusTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrShiftRight SRObj(L2->getLine()); >>
- )
- )*
- ;
-
-addMinusTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- multdivmodTerm[$RootLevel, $ExpOpCount]
- (
- (
- L1:"\+" multdivmodTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrAdd AObj(L1->getLine()); >>
- )
- |
- (
- L2:"\-" multdivmodTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrSubtract SObj(L2->getLine()); >>
- )
- )*
- ;
-
-multdivmodTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- castTerm[$RootLevel, $ExpOpCount]
- (
- (
- L1:"\*" castTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrMultiply MObj(L1->getLine()); >>
- )
- |
- (
- L2:"/" castTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrDivide DObj(L2->getLine()); >>
- )
- |
- (
- L3:"%" castTerm[$RootLevel, $ExpOpCount] << $ExpOpCount++; CIfrModulo MObj(L3->getLine()); >>
- )
- )*
- ;
-
-castTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- << UINT8 CastType = 0xFF; >>
- (
- L:"\("
- (
- Boolean << CastType = 0; >>
- | Uint64 << CastType = 1; >>
- | Uint32 << CastType = 1; >>
- | Uint16 << CastType = 1; >>
- | Uint8 << CastType = 1; >>
- )
- "\)"
- )*
- atomTerm[$RootLevel, $ExpOpCount]
- <<
- switch (CastType) {
- case 0: { CIfrToBoolean TBObj(L->getLine()); $ExpOpCount++; } break;
- case 1: { CIfrToUint TUObj(L->getLine()); $ExpOpCount++; } break;
- }
- >>
- ;
-
-atomTerm [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- vfrExpressionCatenate[$RootLevel, $ExpOpCount]
- | vfrExpressionMatch[$RootLevel, $ExpOpCount]
- | vfrExpressionParen[$RootLevel, $ExpOpCount]
- | vfrExpressionBuildInFunction[$RootLevel, $ExpOpCount]
- | vfrExpressionConstant[$RootLevel, $ExpOpCount]
- | vfrExpressionUnaryOp[$RootLevel, $ExpOpCount]
- | vfrExpressionTernaryOp[$RootLevel, $ExpOpCount]
- | vfrExpressionMap[$RootLevel, $ExpOpCount]
- | (
- L:NOT
- atomTerm[$RootLevel, $ExpOpCount] << { CIfrNot NObj(L->getLine()); $ExpOpCount++; } >>
- )
- ;
-
-vfrExpressionCatenate [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- L:Catenate
- "\("
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "\)" << { CIfrCatenate CObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-vfrExpressionMatch [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- L:Match
- "\("
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "\)" << { CIfrMatch MObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-vfrExpressionParen [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- "\("
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "\)"
- ;
-
-vfrExpressionBuildInFunction [UINT32 & RootLevel, UINT32 & ExpOpCount] :
- dupExp[$RootLevel, $ExpOpCount]
- | vareqvalExp[$RootLevel, $ExpOpCount] //Compatible for Framework vareqval
- | ideqvalExp[$RootLevel, $ExpOpCount]
- | ideqidExp[$RootLevel, $ExpOpCount]
- | ideqvallistExp[$RootLevel, $ExpOpCount]
- | questionref1Exp[$RootLevel, $ExpOpCount]
- | rulerefExp[$RootLevel, $ExpOpCount]
- | stringref1Exp[$RootLevel, $ExpOpCount]
- | pushthisExp[$RootLevel, $ExpOpCount]
- | securityExp[$RootLevel, $ExpOpCount]
- | getExp[$RootLevel, $ExpOpCount]
- ;
-
-dupExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:Dup << { CIfrDup DObj(L->getLine()); _SAVE_OPHDR_COND(DObj, ($ExpOpCount == 0), L->getLine()); $ExpOpCount++; } >>
- ;
-
-vareqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
- <<
- EFI_QUESTION_ID QId;
- UINT32 Mask;
- UINT16 ConstVal;
- CHAR8 *VarIdStr;
- UINT32 LineNo;
- EFI_VFR_RETURN_CODE VfrReturnCode = VFR_RETURN_SUCCESS;
- EFI_VARSTORE_ID VarStoreId = EFI_VARSTORE_ID_INVALID;
- >>
- L:VarEqVal <<
- if (!mCompatibleMode) {
- _PCATCH (VFR_RETURN_UNSUPPORTED, L);
- }
- >>
- VK:Var
- OpenParen
- VN:Number <<
- VarIdStr = NULL; _STRCAT(&VarIdStr, VK->getText()); _STRCAT(&VarIdStr, VN->getText());
- VfrReturnCode = mCVfrDataStorage.GetVarStoreId (VarIdStr, &VarStoreId);
- if (VfrReturnCode == VFR_RETURN_UNDEFINED) {
- _PCATCH (mCVfrDataStorage.DeclareEfiVarStore (
- VarIdStr,
- &mFormsetGuid,
- _STOSID(VN->getText()),
- 0x2, //default type is UINT16
- FALSE
- ), VN);
- } else {
- _PCATCH (VfrReturnCode, VN);
- }
- mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, QId, Mask);
- LineNo = GET_LINENO(VN);
- >>
- CloseParen
- (
- (
- "=="
- V1:Number << ConstVal = _STOU16(V1->getText()); >>
- <<
- if (Mask == 0) {
- CIfrEqIdVal EIVObj (L->getLine());
- _SAVE_OPHDR_COND (EIVObj, ($ExpOpCount == 0), L->getLine());
- EIVObj.SetQuestionId (QId, VarIdStr, LineNo);
- EIVObj.SetValue (ConstVal);
- $ExpOpCount++;
- } else {
- IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, EQUAL);
- }
- >>
- )
- |
- (
- "<="
- V2:Number << ConstVal = _STOU16(V2->getText()); >>
- << IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, LESS_EQUAL); >>
- )
- |
- (
- "<"
- V3:Number << ConstVal = _STOU16(V3->getText()); >>
- << IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, LESS_THAN); >>
- )
- |
- (
- ">="
- V4:Number << ConstVal = _STOU16(V4->getText()); >>
- << IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, GREATER_EQUAL); >>
- )
- |
- (
- ">"
- V5:Number << ConstVal = _STOU16(V5->getText()); >>
- << IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, GREATER_THAN); >>
- )
- )
- ;
-
-ideqvalExp [UINT32 & RootLevel, UINT32 & ExpOpCount] :
- <<
- EFI_QUESTION_ID QId;
- UINT32 Mask;
- UINT16 ConstVal;
- CHAR8 *VarIdStr;
- UINT32 LineNo;
- >>
- L:IdEqVal
- vfrQuestionDataFieldName[QId, Mask, VarIdStr, LineNo]
- (
- (
- "=="
- V1:Number << ConstVal = _STOU16(V1->getText()); >>
- <<
- if (Mask == 0) {
- CIfrEqIdVal EIVObj (L->getLine());
- _SAVE_OPHDR_COND (EIVObj, ($ExpOpCount == 0), L->getLine());
- EIVObj.SetQuestionId (QId, VarIdStr, LineNo);
- EIVObj.SetValue (ConstVal);
- $ExpOpCount++;
- } else {
- IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, EQUAL);
- }
- >>
- )
- |
- (
- "<="
- V2:Number << ConstVal = _STOU16(V2->getText()); >>
- << IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, LESS_EQUAL); >>
- )
- |
- (
- "<"
- V3:Number << ConstVal = _STOU16(V3->getText()); >>
- << IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, LESS_THAN); >>
- )
- |
- (
- ">="
- V4:Number << ConstVal = _STOU16(V4->getText()); >>
- << IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, GREATER_EQUAL); >>
- )
- |
- (
- ">"
- V5:Number << ConstVal = _STOU16(V5->getText()); >>
- << IdEqValDoSpecial ($ExpOpCount, L->getLine(), QId, VarIdStr, Mask, ConstVal, GREATER_THAN); >>
- )
- )
- ;
-
-ideqidExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- <<
- EFI_QUESTION_ID QId[2];
- UINT32 Mask[2];
- CHAR8 *VarIdStr[2];
- UINT32 LineNo[2];
- >>
- L:IdEqId
- vfrQuestionDataFieldName[QId[0], Mask[0], VarIdStr[0], LineNo[0]]
- (
- (
- "=="
- vfrQuestionDataFieldName[QId[1], Mask[1], VarIdStr[1], LineNo[1]]
- <<
- if (Mask[0] & Mask[1]) {
- IdEqIdDoSpecial ($ExpOpCount, L->getLine(), QId[0], VarIdStr[0], Mask[0], QId[1], VarIdStr[1], Mask[1], EQUAL);
- } else {
- CIfrEqIdId EIIObj(L->getLine());
- _SAVE_OPHDR_COND (EIIObj, ($ExpOpCount == 0), L->getLine());
- EIIObj.SetQuestionId1 (QId[0], VarIdStr[0], LineNo[0]);
- EIIObj.SetQuestionId2 (QId[1], VarIdStr[1], LineNo[1]);
- $ExpOpCount++;
- }
- >>
- )
- |
- (
- "<="
- vfrQuestionDataFieldName[QId[1], Mask[1], VarIdStr[1], LineNo[1]]
- << IdEqIdDoSpecial ($ExpOpCount, L->getLine(), QId[0], VarIdStr[0], Mask[0], QId[1], VarIdStr[1], Mask[1], LESS_EQUAL); >>
- )
- |
- (
- "<"
- vfrQuestionDataFieldName[QId[1], Mask[1], VarIdStr[1], LineNo[1]]
- << IdEqIdDoSpecial ($ExpOpCount, L->getLine(), QId[0], VarIdStr[0], Mask[0], QId[1], VarIdStr[1], Mask[1], LESS_THAN); >>
- )
- |
- (
- ">="
- vfrQuestionDataFieldName[QId[1], Mask[1], VarIdStr[1], LineNo[1]]
- << IdEqIdDoSpecial ($ExpOpCount, L->getLine(), QId[0], VarIdStr[0], Mask[0], QId[1], VarIdStr[1], Mask[1], GREATER_EQUAL); >>
- )
- |
- (
- ">"
- vfrQuestionDataFieldName[QId[1], Mask[1], VarIdStr[1], LineNo[1]]
- << IdEqIdDoSpecial ($ExpOpCount, L->getLine(), QId[0], VarIdStr[0], Mask[0], QId[1], VarIdStr[1], Mask[1], GREATER_THAN); >>
- )
- )
- ;
-
-ideqvallistExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- <<
- UINT16 ListLen = 0;
- EFI_QUESTION_ID QId;
- UINT32 Mask;
- UINT16 ValueList[EFI_IFR_MAX_LENGTH] = {0,};
- CHAR8 *VarIdStr;
- UINT32 LineNo;
- >>
- L:IdEqValList
- vfrQuestionDataFieldName[QId, Mask, VarIdStr, LineNo]
- "=="
- (
- V:Number << ValueList[ListLen] = _STOU16(V->getText()); ListLen++; >>
- )+
- <<
- if (Mask != 0) {
- IdEqListDoSpecial ($ExpOpCount, LineNo, QId, VarIdStr, Mask, ListLen, ValueList);
- } else {
- UINT16 Index;
- CIfrEqIdList EILObj(L->getLine());
- if (QId != EFI_QUESTION_ID_INVALID) {
- EILObj.SetQuestionId (QId, VarIdStr, LineNo);
- }
- EILObj.SetListLength (ListLen);
- for (Index = 0; Index < ListLen; Index++) {
- EILObj.SetValueList (Index, ValueList[Index]);
- }
-
- EILObj.UpdateIfrBuffer();
- _SAVE_OPHDR_COND (EILObj, ($ExpOpCount == 0), L->getLine());
-
- if (QId == EFI_QUESTION_ID_INVALID) {
- EILObj.SetQuestionId (QId, VarIdStr, LineNo);
- }
- $ExpOpCount++;
- }
- >>
- ;
-
-questionref1Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- <<
- EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
- UINT32 BitMask;
- CHAR8 *QName = NULL;
- UINT32 LineNo = 0;
- >>
- L:QuestionRef
- "\("
- (
- QN:StringIdentifier <<
- QName = QN->getText();
- LineNo = QN->getLine();
- mCVfrQuestionDB.GetQuestionId (QN->getText(), NULL, QId, BitMask);
- >>
- | ID:Number << QId = _STOQID(ID->getText()); >>
- )
- "\)"
- <<
- { CIfrQuestionRef1 QR1Obj(L->getLine()); _SAVE_OPHDR_COND (QR1Obj, ($ExpOpCount == 0), L->getLine()); QR1Obj.SetQuestionId (QId, QName, LineNo); } $ExpOpCount++; >>
- ;
-
-rulerefExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:RuleRef
- "\(" RN:StringIdentifier "\)" << { CIfrRuleRef RRObj(L->getLine()); _SAVE_OPHDR_COND (RRObj, ($ExpOpCount == 0), L->getLine()); RRObj.SetRuleId (mCVfrRulesDB.GetRuleId (RN->getText())); } $ExpOpCount++; >>
- ;
-
-//******************************************************
-// PARSE:
-// stringref (STR_FORM_SET_TITLE)
-//
-stringref1Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- <<
- EFI_STRING_ID RefStringId = EFI_STRING_ID_INVALID;
- >>
- L:StringRef
- "\("
- (
- "STRING_TOKEN"
- "\("
- S:Number << RefStringId = _STOSID(S->getText()); >>
- "\)"
- | I:Number << RefStringId = _STOSID(I->getText()); >>
- )
- "\)" << { CIfrStringRef1 SR1Obj(L->getLine()); _SAVE_OPHDR_COND (SR1Obj, ($ExpOpCount == 0), L->getLine()); SR1Obj.SetStringId (RefStringId); $ExpOpCount++; } >>
- ;
-
-pushthisExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:PushThis << { CIfrThis TObj(L->getLine()); _SAVE_OPHDR_COND (TObj, ($ExpOpCount == 0), L->getLine()); $ExpOpCount++; } >>
- ;
-
-securityExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- <<
- EFI_GUID Guid;
- >>
- L:Security
- "\(" guidDefinition[Guid] "\)" << { CIfrSecurity SObj(L->getLine()); _SAVE_OPHDR_COND (SObj, ($ExpOpCount == 0), L->getLine()); SObj.SetPermissions (&Guid); } $ExpOpCount++; >>
- ;
-
-numericVarStoreType [UINT8 & VarType] :
- "NUMERIC_SIZE_1" << $VarType = EFI_IFR_NUMERIC_SIZE_1; >>
- | "NUMERIC_SIZE_2" << $VarType = EFI_IFR_NUMERIC_SIZE_2; >>
- | "NUMERIC_SIZE_4" << $VarType = EFI_IFR_NUMERIC_SIZE_4; >>
- | "NUMERIC_SIZE_8" << $VarType = EFI_IFR_NUMERIC_SIZE_8; >>
- ;
-
-getExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- <<
- EFI_VARSTORE_INFO Info;
- CHAR8 *VarIdStr = NULL;
- EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
- UINT32 Mask = 0;
- EFI_QUESION_TYPE QType = QUESTION_NORMAL;
- UINT8 VarType = EFI_IFR_TYPE_UNDEFINED;
- UINT32 VarSize = 0;
- Info.mVarStoreId = 0;
- >>
- L:Get
- "\("
- vfrStorageVarId[Info, VarIdStr, FALSE]
- {"\|" FLAGS "=" numericVarStoreType [VarType] }
- "\)" <<
- {
- if (Info.mVarStoreId == 0) {
- // support Date/Time question
- mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, QId, Mask, &QType);
- if (QId == EFI_QUESTION_ID_INVALID || Mask == 0 || QType == QUESTION_NORMAL) {
- _PCATCH(VFR_RETURN_UNSUPPORTED, L->getLine(), "Get/Set opcode can't get the enough varstore information");
- }
- if (QType == QUESTION_DATE) {
- Info.mVarType = EFI_IFR_TYPE_DATE;
- } else if (QType == QUESTION_TIME) {
- Info.mVarType = EFI_IFR_TYPE_TIME;
- }
- switch (Mask) {
- case DATE_YEAR_BITMASK:
- Info.mInfo.mVarOffset = 0;
- break;
- case DATE_DAY_BITMASK:
- Info.mInfo.mVarOffset = 3;
- break;
- case TIME_HOUR_BITMASK:
- Info.mInfo.mVarOffset = 0;
- break;
- case TIME_MINUTE_BITMASK:
- Info.mInfo.mVarOffset = 1;
- break;
- case TIME_SECOND_BITMASK:
- Info.mInfo.mVarOffset = 2;
- break;
- default:
- _PCATCH(VFR_RETURN_UNSUPPORTED, L->getLine(), "Get/Set opcode can't get the enough varstore information");
- break;
- }
- } else {
- if ((mCVfrDataStorage.GetVarStoreType(Info.mVarStoreId) == EFI_VFR_VARSTORE_NAME) && (VarType == EFI_IFR_TYPE_UNDEFINED)) {
- _PCATCH(VFR_RETURN_UNSUPPORTED, L->getLine(), "Get/Set opcode don't support name string");
- }
- if (VarType != EFI_IFR_TYPE_UNDEFINED) {
- Info.mVarType = VarType;
- _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize (Info.mVarType, &VarSize), L->getLine(), "Get/Set opcode can't get var type size");
- Info.mVarTotalSize = VarSize;
- }
- _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize (Info.mVarType, &VarSize), L->getLine(), "Get/Set opcode can't get var type size");
- if (VarSize != Info.mVarTotalSize) {
- _PCATCH(VFR_RETURN_UNSUPPORTED, L->getLine(), "Get/Set opcode don't support data array");
- }
- }
- CIfrGet GObj(L->getLine());
- _SAVE_OPHDR_COND (GObj, ($ExpOpCount == 0), L->getLine());
- GObj.SetVarInfo (&Info);
- delete VarIdStr;
- $ExpOpCount++;
- }
- >>
- ;
-
-vfrExpressionConstant[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L1:True << CIfrTrue TObj(L1->getLine()); _SAVE_OPHDR_COND (TObj, ($ExpOpCount == 0), L1->getLine()); $ExpOpCount++; >>
- | L2:False << CIfrFalse FObj(L2->getLine()); _SAVE_OPHDR_COND (FObj, ($ExpOpCount == 0), L2->getLine()); $ExpOpCount++; >>
- | L3:One << CIfrOne OObj(L3->getLine()); _SAVE_OPHDR_COND (OObj, ($ExpOpCount == 0), L3->getLine()); $ExpOpCount++; >>
- | L4:Ones << CIfrOnes OObj(L4->getLine()); _SAVE_OPHDR_COND (OObj, ($ExpOpCount == 0), L4->getLine()); $ExpOpCount++; >>
- | L5:Zero << CIfrZero ZObj(L5->getLine()); _SAVE_OPHDR_COND (ZObj, ($ExpOpCount == 0), L5->getLine()); $ExpOpCount++; >>
- | L6:Undefined << CIfrUndefined UObj(L6->getLine()); _SAVE_OPHDR_COND (UObj, ($ExpOpCount == 0), L6->getLine()); $ExpOpCount++; >>
- | L7:Version << CIfrVersion VObj(L7->getLine()); _SAVE_OPHDR_COND (VObj, ($ExpOpCount == 0), L7->getLine()); $ExpOpCount++; >>
- | V:Number << CIfrUint64 U64Obj(V->getLine()); U64Obj.SetValue (_STOU64(V->getText())); _SAVE_OPHDR_COND (U64Obj, ($ExpOpCount == 0), V->getLine()); $ExpOpCount++; >>
- ;
-
-vfrExpressionUnaryOp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- lengthExp[$RootLevel, $ExpOpCount]
- | bitwisenotExp[$RootLevel, $ExpOpCount]
- | question23refExp[$RootLevel, $ExpOpCount]
- | stringref2Exp[$RootLevel, $ExpOpCount]
- | toboolExp[$RootLevel, $ExpOpCount]
- | tostringExp[$RootLevel, $ExpOpCount]
- | unintExp[$RootLevel, $ExpOpCount]
- | toupperExp[$RootLevel, $ExpOpCount]
- | tolwerExp[$RootLevel, $ExpOpCount]
- | setExp[$RootLevel, $ExpOpCount]
- ;
-
-lengthExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:Length
- "\(" vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"
- << { CIfrLength LObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-bitwisenotExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:BitWiseNot
- "\(" vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"
- << { CIfrBitWiseNot BWNObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-question23refExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- <<
- UINT8 Type = 0x1;
- EFI_STRING_ID DevPath = EFI_STRING_ID_INVALID;
- EFI_GUID Guid = {0,};
- >>
- L:QuestionRefVal
- "\("
- {
- DevicePath "=" "STRING_TOKEN" "\(" S:Number "\)" "," << Type = 0x2; DevPath = _STOSID(S->getText()); >>
- }
- {
- Uuid "=" guidDefinition[Guid] "," << Type = 0x3; >>
- }
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "\)"
- <<
- switch (Type) {
- case 0x1: {CIfrQuestionRef2 QR2Obj(L->getLine()); _SAVE_OPHDR_COND (QR2Obj, ($ExpOpCount == 0), L->getLine()); break;}
- case 0x2: {CIfrQuestionRef3_2 QR3_2Obj(L->getLine()); _SAVE_OPHDR_COND (QR3_2Obj, ($ExpOpCount == 0), L->getLine()); QR3_2Obj.SetDevicePath (DevPath); break;}
- case 0x3: {CIfrQuestionRef3_3 QR3_3Obj(L->getLine()); _SAVE_OPHDR_COND (QR3_3Obj, ($ExpOpCount == 0), L->getLine()); QR3_3Obj.SetDevicePath (DevPath); QR3_3Obj.SetGuid (&Guid); break;}
- }
- $ExpOpCount++;
- >>
- ;
-
-stringref2Exp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:StringRefVal
- "\(" vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"
- << { CIfrStringRef2 SR2Obj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-toboolExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:BoolVal
- "\(" vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"
- << { CIfrToBoolean TBObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-tostringExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- << UINT8 Fmt = 0; >>
- L:StringVal
- {
- Format "=" F:Number "," << Fmt = _STOU8(F->getText()); >>
- }
- "\(" vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"
- << { CIfrToString TSObj(L->getLine()); TSObj.SetFormat (Fmt); $ExpOpCount++; } >>
- ;
-
-unintExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:UnIntVal
- "\(" vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"
- << { CIfrToUint TUObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-toupperExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:ToUpper
- "\(" vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"
- << { CIfrToUpper TUObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-tolwerExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:ToLower
- "\(" vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount] "\)"
- << { CIfrToLower TLObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-setExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- <<
- EFI_VARSTORE_INFO Info;
- CHAR8 *VarIdStr = NULL;
- EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
- UINT32 Mask = 0;
- EFI_QUESION_TYPE QType = QUESTION_NORMAL;
- UINT8 VarType = EFI_IFR_TYPE_UNDEFINED;
- UINT32 VarSize = 0;
- Info.mVarStoreId = 0;
- >>
- L:Set
- "\("
- vfrStorageVarId[Info, VarIdStr, FALSE]
- {"\|" FLAG "=" numericVarStoreType [VarType] }
- "," vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "\)"
- <<
- {
- if (Info.mVarStoreId == 0) {
- // support Date/Time question
- mCVfrQuestionDB.GetQuestionId (NULL, VarIdStr, QId, Mask, &QType);
- if (QId == EFI_QUESTION_ID_INVALID || Mask == 0 || QType == QUESTION_NORMAL) {
- _PCATCH(VFR_RETURN_UNSUPPORTED, L->getLine(), "Get/Set opcode can't get the enough varstore information");
- }
- if (QType == QUESTION_DATE) {
- Info.mVarType = EFI_IFR_TYPE_DATE;
- } else if (QType == QUESTION_TIME) {
- Info.mVarType = EFI_IFR_TYPE_TIME;
- }
- switch (Mask) {
- case DATE_YEAR_BITMASK:
- Info.mInfo.mVarOffset = 0;
- break;
- case DATE_DAY_BITMASK:
- Info.mInfo.mVarOffset = 3;
- break;
- case TIME_HOUR_BITMASK:
- Info.mInfo.mVarOffset = 0;
- break;
- case TIME_MINUTE_BITMASK:
- Info.mInfo.mVarOffset = 1;
- break;
- case TIME_SECOND_BITMASK:
- Info.mInfo.mVarOffset = 2;
- break;
- default:
- _PCATCH(VFR_RETURN_UNSUPPORTED, L->getLine(), "Get/Set opcode can't get the enough varstore information");
- break;
- }
- } else {
- if ((mCVfrDataStorage.GetVarStoreType(Info.mVarStoreId) == EFI_VFR_VARSTORE_NAME) && (VarType == EFI_IFR_TYPE_UNDEFINED)) {
- _PCATCH(VFR_RETURN_UNSUPPORTED, L->getLine(), "Get/Set opcode don't support name string");
- }
- if (VarType != EFI_IFR_TYPE_UNDEFINED) {
- Info.mVarType = VarType;
- _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize (Info.mVarType, &VarSize), L->getLine(), "Get/Set opcode can't get var type size");
- Info.mVarTotalSize = VarSize;
- }
- _PCATCH(gCVfrVarDataTypeDB.GetDataTypeSize (Info.mVarType, &VarSize), L->getLine(), "Get/Set opcode can't get var type size");
- if (VarSize != Info.mVarTotalSize) {
- _PCATCH(VFR_RETURN_UNSUPPORTED, L->getLine(), "Get/Set opcode don't support data array");
- }
- }
- CIfrSet TSObj(L->getLine());
- TSObj.SetVarInfo (&Info);
- delete VarIdStr;
- $ExpOpCount++;
- }
- >>
- ;
-
-vfrExpressionTernaryOp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- conditionalExp[$RootLevel, $ExpOpCount]
- | findExp[$RootLevel, $ExpOpCount]
- | midExp[$RootLevel, $ExpOpCount]
- | tokenExp[$RootLevel, $ExpOpCount]
- | spanExp[$RootLevel, $ExpOpCount]
- ;
-
-#token Cond("cond") "cond"
-#token Find("find") "find"
-#token Mid("mid") "mid"
-#token Tok("token") "token"
-#token Span("span") "span"
-
-conditionalExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:Cond "\("
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "?"
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ":"
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "\)" << { CIfrConditional CObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-findExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- << UINT8 Format; >>
- L:Find "\("
- findFormat[Format] ( "\|" findFormat[Format] )*
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "\)" << { CIfrFind FObj(L->getLine()); FObj.SetFormat (Format); $ExpOpCount++; } >>
- ;
-
-findFormat [UINT8 & Format] :
- "SENSITIVE" << $Format = 0x00; >>
- | "INSENSITIVE" << $Format = 0x01; >>
- ;
-
-midExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:Mid "\("
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "\)" << { CIfrMid MObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-tokenExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- L:Tok "\("
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "\)" << { CIfrToken TObj(L->getLine()); $ExpOpCount++; } >>
- ;
-
-spanExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
- << UINT8 Flags = 0; >>
- S:Span "\("
- FLAGS "=" spanFlags[Flags] ( "\|" spanFlags[Flags] )*
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ","
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- "\)" << { CIfrSpan SObj(S->getLine()); SObj.SetFlags(Flags); $ExpOpCount++; } >>
- ;
-
-vfrExpressionMap [UINT32 & RootLevel, UINT32 & ExpOpCount]:
- L:Map
- "\("
- vfrStatementExpressionSub[$RootLevel + 1, $ExpOpCount]
- ":" << { CIfrMap MObj(L->getLine()); } >>
- (
- vfrStatementExpression[0]
- ","
- vfrStatementExpression[0]
- ";"
- ) *
- E:"\)" << { CIfrEnd EObj; EObj.SetLineNo(E->getLine()); $ExpOpCount++; } >>
- ;
-
-spanFlags [UINT8 & Flags] :
- N:Number << $Flags |= _STOU8(N->getText()); >>
- | "LAST_NON_MATCH" << $Flags |= 0x00; >>
- | "FIRST_NON_MATCH" << $Flags |= 0x01; >>
- ;
-
-#token StringIdentifier("string identifier") "[A-Za-z_][A-Za-z_0-9]*"
-#token Number("numeric value") "(0x[0-9A-Fa-f]+) | [0-9]+"
-
-//******************************************************************************
-//
-// Parser class definition.
-//
-class EfiVfrParser {
-<<
-private:
- UINT8 mParserStatus;
- BOOLEAN mConstantOnlyInExpression;
-
- CVfrDefaultStore mCVfrDefaultStore;
- CVfrDataStorage mCVfrDataStorage;
- CVfrQuestionDB mCVfrQuestionDB;
- CVfrRulesDB mCVfrRulesDB;
-
- CIfrOpHeader * mCIfrOpHdr[MAX_IFR_EXPRESSION_DEPTH];
- UINT32 mCIfrOpHdrLineNo[MAX_IFR_EXPRESSION_DEPTH];
- UINT8 mCIfrOpHdrIndex;
- VOID _SAVE_OPHDR_COND (IN CIfrOpHeader &, IN BOOLEAN, UINT32 LineNo = 0);
- VOID _CLEAR_SAVED_OPHDR (VOID);
- BOOLEAN _SET_SAVED_OPHDR_SCOPE (VOID);
-
-
- EFI_VARSTORE_INFO mCurrQestVarInfo;
- EFI_GUID *mOverrideClassGuid;
- CHAR8* mLastFormEndAddr;
-
-//
-// Whether the question already has default value.
-//
- UINT16 mUsedDefaultArray[EFI_IFR_MAX_DEFAULT_TYPE];
- UINT16 mUsedDefaultCount;
-
-//
-// For framework vfr compatibility
-//
- BOOLEAN mCompatibleMode;
- EFI_GUID mFormsetGuid;
-
- VOID _CRT_OP (IN BOOLEAN);
-
- VOID _SAVE_CURRQEST_VARINFO (IN EFI_VARSTORE_INFO &);
- EFI_VARSTORE_INFO & _GET_CURRQEST_VARTINFO (VOID);
-
- UINT8 _GET_CURRQEST_DATATYPE ();
- UINT32 _GET_CURRQEST_VARSIZE ();
- UINT32 _GET_CURRQEST_ARRAY_SIZE();
- VOID CheckDuplicateDefaultValue (IN EFI_DEFAULT_ID, IN ANTLRTokenPtr);
-
-public:
- VOID _PCATCH (IN INTN, IN INTN, IN ANTLRTokenPtr, IN CONST CHAR8 *);
- VOID _PCATCH (IN EFI_VFR_RETURN_CODE);
- VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN ANTLRTokenPtr);
- VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32);
- VOID _PCATCH (IN EFI_VFR_RETURN_CODE, IN UINT32, IN CONST CHAR8 *);
-
- VOID syn (ANTLRAbstractToken *, ANTLRChar *, SetWordType *, ANTLRTokenType, INT32);
-
- CHAR8* TrimHex (IN CHAR8 *, OUT BOOLEAN *);
- CHAR8* _U32TOS (IN UINT32);
- UINT8 _STOU8 (IN CHAR8 *);
- UINT16 _STOU16 (IN CHAR8 *);
- UINT32 _STOU32 (IN CHAR8 *);
- UINT64 _STOU64 (IN CHAR8 *);
- EFI_HII_DATE _STOD (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *);
- EFI_HII_TIME _STOT (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *);
- EFI_HII_REF _STOR (IN CHAR8 *, IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *);
-
- EFI_STRING_ID _STOSID (IN CHAR8 *);
- EFI_FORM_ID _STOFID (IN CHAR8 *);
- EFI_QUESTION_ID _STOQID (IN CHAR8 *);
-
- VOID _STRCAT (IN OUT CHAR8 **, IN CONST CHAR8 *);
-
- VOID _DeclareDefaultLinearVarStore (IN UINT32);
- VOID _DeclareStandardDefaultStorage (IN UINT32);
- VOID _DeclareDefaultFrameworkVarStore (IN UINT32);
-
- VOID AssignQuestionKey (IN CIfrQuestionHeader &, IN ANTLRTokenPtr);
-
- VOID ConvertIdExpr (IN UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32);
- VOID IdEqValDoSpecial (IN UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN UINT16, IN EFI_COMPARE_TYPE);
- VOID IdEqIdDoSpecial (IN UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN EFI_COMPARE_TYPE);
- VOID IdEqListDoSpecial (IN UINT32 &, IN UINT32, IN EFI_QUESTION_ID, IN CHAR8 *, IN UINT32, IN UINT16, IN UINT16 *);
- VOID SetOverrideClassGuid (IN EFI_GUID *);
-//
-// For framework vfr compatibility
-//
- VOID SetCompatibleMode (IN BOOLEAN);
->>
-}
-
-<<
-VOID
-EfiVfrParser::_SAVE_OPHDR_COND (
- IN CIfrOpHeader &OpHdr,
- IN BOOLEAN Cond,
- IN UINT32 LineNo
- )
-{
- if (Cond == TRUE) {
- if (mCIfrOpHdr[mCIfrOpHdrIndex] != NULL) {
- return ;
- }
- mCIfrOpHdr[mCIfrOpHdrIndex] = new CIfrOpHeader(OpHdr);
- mCIfrOpHdrLineNo[mCIfrOpHdrIndex] = LineNo;
- }
-}
-
-VOID
-EfiVfrParser::_CLEAR_SAVED_OPHDR (
- VOID
- )
-{
- mCIfrOpHdr[mCIfrOpHdrIndex] = NULL;
- mCIfrOpHdrLineNo[mCIfrOpHdrIndex] = 0;
-}
-
-BOOLEAN
-EfiVfrParser::_SET_SAVED_OPHDR_SCOPE (
- VOID
- )
-{
- if (mCIfrOpHdr[mCIfrOpHdrIndex] != NULL) {
- mCIfrOpHdr[mCIfrOpHdrIndex]->SetScope (1);
- return TRUE;
- }
-
- //
- // IfrOpHdr is not set, FALSE is return.
- //
- return FALSE;
-}
-
-VOID
-EfiVfrParser::_CRT_OP (
- IN BOOLEAN Crt
- )
-{
- gCreateOp = Crt;
-}
-
-VOID
-EfiVfrParser::_SAVE_CURRQEST_VARINFO (
- IN EFI_VARSTORE_INFO &Info
- )
-{
- mCurrQestVarInfo = Info;
-}
-
-EFI_VARSTORE_INFO &
-EfiVfrParser::_GET_CURRQEST_VARTINFO (
- VOID
- )
-{
- return mCurrQestVarInfo;
-}
-
-UINT32
-EfiVfrParser::_GET_CURRQEST_ARRAY_SIZE (
- VOID
- )
-{
- UINT8 Size = 1;
-
- switch (mCurrQestVarInfo.mVarType) {
- case EFI_IFR_TYPE_NUM_SIZE_8:
- Size = 1;
- break;
-
- case EFI_IFR_TYPE_NUM_SIZE_16:
- Size = 2;
- break;
-
- case EFI_IFR_TYPE_NUM_SIZE_32:
- Size = 4;
- break;
-
- case EFI_IFR_TYPE_NUM_SIZE_64:
- Size = 8;
- break;
-
- default:
- break;
- }
-
- return (mCurrQestVarInfo.mVarTotalSize / Size);
-}
-
-UINT8
-EfiVfrParser::_GET_CURRQEST_DATATYPE (
- VOID
- )
-{
- return mCurrQestVarInfo.mVarType;
-}
-
-UINT32
-EfiVfrParser::_GET_CURRQEST_VARSIZE (
- VOID
- )
-{
- return mCurrQestVarInfo.mVarTotalSize;
-}
-
-VOID
-EfiVfrParser::_PCATCH (
- IN INTN ReturnCode,
- IN INTN ExpectCode,
- IN ANTLRTokenPtr Tok,
- IN CONST CHAR8 *ErrorMsg
- )
-{
- if (ReturnCode != ExpectCode) {
- mParserStatus++;
- gCVfrErrorHandle.PrintMsg (Tok->getLine(), Tok->getText(), "Error", ErrorMsg);
- }
-}
-
-VOID
-EfiVfrParser::_PCATCH (
- IN EFI_VFR_RETURN_CODE ReturnCode
- )
-{
- mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (ReturnCode);
-}
-
-VOID
-EfiVfrParser::_PCATCH (
- IN EFI_VFR_RETURN_CODE ReturnCode,
- IN ANTLRTokenPtr Tok
- )
-{
- mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (ReturnCode, Tok->getLine(), Tok->getText());
-}
-
-VOID
-EfiVfrParser::_PCATCH (
- IN EFI_VFR_RETURN_CODE ReturnCode,
- IN UINT32 LineNum
- )
-{
- mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (ReturnCode, LineNum);
-}
-
-VOID
-EfiVfrParser::_PCATCH (
- IN EFI_VFR_RETURN_CODE ReturnCode,
- IN UINT32 LineNum,
- IN CONST CHAR8 *ErrorMsg
- )
-{
- mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (ReturnCode, LineNum, (CHAR8 *) ErrorMsg);
-}
-
-VOID
-EfiVfrParser::syn (
- ANTLRAbstractToken *Tok,
- ANTLRChar *Egroup,
- SetWordType *Eset,
- ANTLRTokenType ETok,
- INT32 Huh
- )
-{
- gCVfrErrorHandle.HandleError (VFR_RETURN_MISMATCHED, Tok->getLine(), Tok->getText());
-
- mParserStatus += 1;
-}
-
-CHAR8 *
-EfiVfrParser::TrimHex (
- IN CHAR8 *Str,
- OUT BOOLEAN *IsHex
- )
-{
- *IsHex = FALSE;
-
- while (*Str && *Str == ' ') {
- Str++;
- }
- while (*Str && *Str == '0') {
- Str++;
- }
- if (*Str && (*Str == 'x' || *Str == 'X')) {
- Str++;
- *IsHex = TRUE;
- }
-
- return Str;
-}
-
-CHAR8 *
-EfiVfrParser::_U32TOS (
- IN UINT32 Value
- )
-{
- CHAR8 *Str;
- Str = new CHAR8[20];
- sprintf (Str, "%d", Value);
- return Str;
-}
-
-UINT8
-EfiVfrParser::_STOU8 (
- IN CHAR8*Str
- )
-{
- BOOLEAN IsHex;
- UINT8 Value;
- CHAR8 c;
-
- Str = TrimHex (Str, &IsHex);
- for (Value = 0; (c = *Str) != '\0'; Str++) {
- //
- // BUG: does not handle overflow here
- //
- (IsHex == TRUE) ? (Value <<= 4) : (Value *= 10);
-
- if ((IsHex == TRUE) && (c >= 'a') && (c <= 'f')) {
- Value += (c - 'a' + 10);
- }
- if ((IsHex == TRUE) && (c >= 'A') && (c <= 'F')) {
- Value += (c - 'A' + 10);
- }
- if (c >= '0' && c <= '9') {
- Value += (c - '0');
- }
- }
-
- return Value;
-}
-
-UINT16
-EfiVfrParser::_STOU16 (
- IN CHAR8*Str
- )
-{
- BOOLEAN IsHex;
- UINT16 Value;
- CHAR8 c;
-
- Str = TrimHex (Str, &IsHex);
- for (Value = 0; (c = *Str) != '\0'; Str++) {
- //
- // BUG: does not handle overflow here
- //
- (IsHex == TRUE) ? (Value <<= 4) : (Value *= 10);
-
- if ((IsHex == TRUE) && (c >= 'a') && (c <= 'f')) {
- Value += (c - 'a' + 10);
- }
- if ((IsHex == TRUE) && (c >= 'A') && (c <= 'F')) {
- Value += (c - 'A' + 10);
- }
- if (c >= '0' && c <= '9') {
- Value += (c - '0');
- }
- }
-
- return Value;
-}
-
-UINT32
-EfiVfrParser::_STOU32 (
- IN CHAR8*Str
- )
-{
- BOOLEAN IsHex;
- UINT32 Value;
- CHAR8 c;
-
- Str = TrimHex (Str, &IsHex);
- for (Value = 0; (c = *Str) != '\0'; Str++) {
- //
- // BUG: does not handle overflow here
- //
- (IsHex == TRUE) ? (Value <<= 4) : (Value *= 10);
-
- if ((IsHex == TRUE) && (c >= 'a') && (c <= 'f')) {
- Value += (c - 'a' + 10);
- }
- if ((IsHex == TRUE) && (c >= 'A') && (c <= 'F')) {
- Value += (c - 'A' + 10);
- }
- if (c >= '0' && c <= '9') {
- Value += (c - '0');
- }
- }
-
- return Value;
-}
-
-UINT64
-EfiVfrParser::_STOU64 (
- IN CHAR8*Str
- )
-{
- BOOLEAN IsHex;
- UINT64 Value;
- CHAR8 c;
-
- Str = TrimHex (Str, &IsHex);
- for (Value = 0; (c = *Str) != '\0'; Str++) {
- //
- // BUG: does not handle overflow here
- //
- (IsHex == TRUE) ? (Value <<= 4) : (Value *= 10);
-
- if ((IsHex == TRUE) && (c >= 'a') && (c <= 'f')) {
- Value += (c - 'a' + 10);
- }
- if ((IsHex == TRUE) && (c >= 'A') && (c <= 'F')) {
- Value += (c - 'A' + 10);
- }
- if (c >= '0' && c <= '9') {
- Value += (c - '0');
- }
- }
-
- return Value;
-}
-
-EFI_HII_DATE
-EfiVfrParser::_STOD (
- IN CHAR8 *Year,
- IN CHAR8 *Month,
- IN CHAR8 *Day
- )
-{
- EFI_HII_DATE Date;
-
- Date.Year = _STOU16 (Year);
- Date.Month = _STOU8 (Month);
- Date.Day = _STOU8 (Day);
-
- return Date;
-}
-
-EFI_HII_TIME
-EfiVfrParser::_STOT (
- IN CHAR8 *Hour,
- IN CHAR8 *Minute,
- IN CHAR8 *Second
- )
-{
- EFI_HII_TIME Time;
-
- Time.Hour = _STOU8 (Hour);
- Time.Minute = _STOU8 (Minute);
- Time.Second = _STOU8 (Second);
-
- return Time;
-}
-
-EFI_STRING_ID
-EfiVfrParser::_STOSID (
- IN CHAR8 *Str
- )
-{
- return (EFI_STRING_ID)_STOU16(Str);
-}
-
-EFI_FORM_ID
-EfiVfrParser::_STOFID (
- IN CHAR8 *Str
- )
-{
- return (EFI_FORM_ID)_STOU16(Str);
-}
-
-EFI_QUESTION_ID
-EfiVfrParser::_STOQID (
- IN CHAR8 *Str
- )
-{
- return (EFI_QUESTION_ID)_STOU16(Str);
-}
-
-VOID
-EfiVfrParser::_STRCAT (
- IN OUT CHAR8 **Dest,
- IN CONST CHAR8 *Src
- )
-{
- CHAR8 *NewStr;
- UINT32 Len;
-
- if ((Dest == NULL) || (Src == NULL)) {
- return;
- }
-
- Len = (*Dest == NULL) ? 0 : strlen (*Dest);
- Len += strlen (Src);
- if ((NewStr = new CHAR8[Len + 1]) == NULL) {
- return;
- }
- NewStr[0] = '\0';
- if (*Dest != NULL) {
- strcpy (NewStr, *Dest);
- delete *Dest;
- }
- strcat (NewStr, Src);
-
- *Dest = NewStr;
-}
-
-EFI_HII_REF
-EfiVfrParser::_STOR (
- IN CHAR8 *QuestionId,
- IN CHAR8 *FormId,
- IN EFI_GUID *FormSetGuid,
- IN CHAR8 *DevicePath
- )
-{
- EFI_HII_REF Ref;
- UINT32 Index;
-
- memcpy (&Ref.FormSetGuid, FormSetGuid, sizeof (EFI_GUID));
- Ref.QuestionId = _STOQID (QuestionId);
- Ref.FormId = _STOFID (FormId);
- Ref.DevicePath = _STOSID (DevicePath);
-
- return Ref;
-}
-
-//
-// framework vfr to default declare varstore for each structure
-//
-VOID
-EfiVfrParser::_DeclareDefaultFrameworkVarStore (
- IN UINT32 LineNo
- )
-{
- SVfrVarStorageNode *pNode;
- UINT32 TypeSize;
- BOOLEAN FirstNode;
- CONST CHAR8 VarName[] = "Setup";
-
- FirstNode = TRUE;
- pNode = mCVfrDataStorage.GetBufferVarStoreList();
- if (pNode == NULL && gCVfrVarDataTypeDB.mFirstNewDataTypeName != NULL) {
- //
- // Create the default Buffer Var Store when no VarStore is defined.
- // its name should be "Setup"
- //
- gCVfrVarDataTypeDB.GetDataTypeSize (gCVfrVarDataTypeDB.mFirstNewDataTypeName, &TypeSize);
- CIfrVarStore VSObj;
- VSObj.SetLineNo (LineNo);
- VSObj.SetVarStoreId (0x1); //the first and only one Buffer Var Store
- VSObj.SetSize ((UINT16) TypeSize);
- //VSObj.SetName (gCVfrVarDataTypeDB.mFirstNewDataTypeName);
- VSObj.SetName ((CHAR8 *) VarName);
- VSObj.SetGuid (&mFormsetGuid);
-#ifdef VFREXP_DEBUG
- printf ("Create the default VarStoreName is %s\n", gCVfrVarDataTypeDB.mFirstNewDataTypeName);
-#endif
- } else {
- for (; pNode != NULL; pNode = pNode->mNext) {
- //
- // create the default varstore opcode for not declared varstore
- // the first varstore name should be "Setup"
- //
- if (!pNode->mAssignedFlag) {
- CIfrVarStore VSObj;
- VSObj.SetLineNo (LineNo);
- VSObj.SetVarStoreId (pNode->mVarStoreId);
- VSObj.SetSize ((UINT16) pNode->mStorageInfo.mDataType->mTotalSize);
- if (FirstNode) {
- VSObj.SetName ((CHAR8 *) VarName);
- FirstNode = FALSE;
- } else {
- VSObj.SetName (pNode->mVarStoreName);
- }
- VSObj.SetGuid (&pNode->mGuid);
-#ifdef VFREXP_DEBUG
- printf ("undefined VarStoreName is %s and Id is 0x%x\n", pNode->mVarStoreName, pNode->mVarStoreId);
-#endif
- }
- }
- }
-
- pNode = mCVfrDataStorage.GetEfiVarStoreList();
- for (; pNode != NULL; pNode = pNode->mNext) {
- //
- // create the default efi varstore opcode for not exist varstore
- //
- if (!pNode->mAssignedFlag) {
- CIfrVarStoreEfi VSEObj;
- VSEObj.SetLineNo (LineNo);
- VSEObj.SetAttributes (0x00000002); //hardcode EFI_VARIABLE_BOOTSERVICE_ACCESS attribute
- VSEObj.SetGuid (&pNode->mGuid);
- VSEObj.SetVarStoreId (pNode->mVarStoreId);
- // Generate old efi varstore storage structure for compatiable with old "VarEqVal" opcode,
- // which is 3 bytes less than new structure define in UEFI Spec 2.3.1.
- VSEObj.SetBinaryLength (sizeof (EFI_IFR_VARSTORE_EFI) - 3);
-#ifdef VFREXP_DEBUG
- printf ("undefined Efi VarStoreName is %s and Id is 0x%x\n", pNode->mVarStoreName, pNode->mVarStoreId);
-#endif
- }
- }
-
-}
-
-VOID
-EfiVfrParser::_DeclareDefaultLinearVarStore (
- IN UINT32 LineNo
- )
-{
- UINT32 Index;
- CHAR8 **TypeNameList;
- UINT32 ListSize;
- CONST CHAR8 DateName[] = "Date";
- CONST CHAR8 TimeName[] = "Time";
- CONST CHAR8 DateType[] = "EFI_HII_DATE";
- CONST CHAR8 TimeType[] = "EFI_HII_TIME";
-
- gCVfrVarDataTypeDB.GetUserDefinedTypeNameList (&TypeNameList, &ListSize);
-
- for (Index = 0; Index < ListSize; Index++) {
- UINT32 Size;
- EFI_VARSTORE_ID VarStoreId;
- CIfrVarStore VSObj;
-
- VSObj.SetLineNo (LineNo);
- mCVfrDataStorage.DeclareBufferVarStore (
- TypeNameList[Index],
- &mFormsetGuid,
- &gCVfrVarDataTypeDB,
- TypeNameList[Index],
- EFI_VARSTORE_ID_INVALID
- );
- mCVfrDataStorage.GetVarStoreId(TypeNameList[Index], &VarStoreId, &mFormsetGuid);
- VSObj.SetVarStoreId (VarStoreId);
- gCVfrVarDataTypeDB.GetDataTypeSize(TypeNameList[Index], &Size);
- VSObj.SetSize ((UINT16) Size);
- VSObj.SetName (TypeNameList[Index]);
- VSObj.SetGuid (&mFormsetGuid);
- }
-
-//
-// not required to declare Date and Time VarStore,
-// because code to support old format Data and Time
-//
- if (gCVfrVarDataTypeDB.IsTypeNameDefined ((CHAR8 *) DateName) == FALSE) {
- UINT32 Size;
- EFI_VARSTORE_ID VarStoreId;
- CIfrVarStore VSObj;
-
- VSObj.SetLineNo (LineNo);
- mCVfrDataStorage.DeclareBufferVarStore (
- (CHAR8 *) DateName,
- &mFormsetGuid,
- &gCVfrVarDataTypeDB,
- (CHAR8 *) DateType,
- EFI_VARSTORE_ID_INVALID
- );
- mCVfrDataStorage.GetVarStoreId((CHAR8 *) DateName, &VarStoreId, &mFormsetGuid);
- VSObj.SetVarStoreId (VarStoreId);
- gCVfrVarDataTypeDB.GetDataTypeSize((CHAR8 *) DateType, &Size);
- VSObj.SetSize ((UINT16) Size);
- VSObj.SetName ((CHAR8 *) DateName);
- VSObj.SetGuid (&mFormsetGuid);
- }
-
- if (gCVfrVarDataTypeDB.IsTypeNameDefined ((CHAR8 *) TimeName) == FALSE) {
- UINT32 Size;
- EFI_VARSTORE_ID VarStoreId;
- CIfrVarStore VSObj;
-
- VSObj.SetLineNo (LineNo);
- mCVfrDataStorage.DeclareBufferVarStore (
- (CHAR8 *) TimeName,
- &mFormsetGuid,
- &gCVfrVarDataTypeDB,
- (CHAR8 *) TimeType,
- EFI_VARSTORE_ID_INVALID
- );
- mCVfrDataStorage.GetVarStoreId((CHAR8 *) TimeName, &VarStoreId, &mFormsetGuid);
- VSObj.SetVarStoreId (VarStoreId);
- gCVfrVarDataTypeDB.GetDataTypeSize((CHAR8 *) TimeType, &Size);
- VSObj.SetSize ((UINT16) Size);
- VSObj.SetName ((CHAR8 *) TimeName);
- VSObj.SetGuid (&mFormsetGuid);
- }
-}
-
-VOID
-EfiVfrParser::_DeclareStandardDefaultStorage (
- IN UINT32 LineNo
- )
-{
- //
- // Default Store is declared.
- //
- CIfrDefaultStore DSObj;
-
- mCVfrDefaultStore.RegisterDefaultStore (DSObj.GetObjBinAddr(), (CHAR8 *) "Standard Defaults", EFI_STRING_ID_INVALID, EFI_HII_DEFAULT_CLASS_STANDARD);
- DSObj.SetLineNo (LineNo);
- DSObj.SetDefaultName (EFI_STRING_ID_INVALID);
- DSObj.SetDefaultId (EFI_HII_DEFAULT_CLASS_STANDARD);
-
- //
- // Default MANUFACTURING Store is declared.
- //
- CIfrDefaultStore DSObjMF;
-
- mCVfrDefaultStore.RegisterDefaultStore (DSObjMF.GetObjBinAddr(), (CHAR8 *) "Standard ManuFacturing", EFI_STRING_ID_INVALID, EFI_HII_DEFAULT_CLASS_MANUFACTURING);
- DSObjMF.SetLineNo (LineNo);
- DSObjMF.SetDefaultName (EFI_STRING_ID_INVALID);
- DSObjMF.SetDefaultId (EFI_HII_DEFAULT_CLASS_MANUFACTURING);
-}
-
-VOID
-EfiVfrParser::AssignQuestionKey (
- IN CIfrQuestionHeader &QHObj,
- IN ANTLRTokenPtr KeyTok
- )
-{
- UINT16 KeyValue;
-
- if (KeyTok == NULL) {
- return;
- }
-
- KeyValue = _STOU16 (KeyTok->getText());
-
- if (QHObj.FLAGS () & EFI_IFR_FLAG_CALLBACK) {
- /*
- * if the question is not CALLBACK ignore the key.
- */
- _PCATCH(mCVfrQuestionDB.UpdateQuestionId (QHObj.QUESTION_ID(), KeyValue), KeyTok);
- QHObj.SetQuestionId (KeyValue);
- }
-}
-
-VOID
-EfiVfrParser::ConvertIdExpr (
- IN UINT32 &ExpOpCount,
- IN UINT32 LineNo,
- IN EFI_QUESTION_ID QId,
- IN CHAR8 *VarIdStr,
- IN UINT32 BitMask
- )
-{
- CIfrQuestionRef1 QR1Obj(LineNo);
- QR1Obj.SetQuestionId (QId, VarIdStr, LineNo);
- _SAVE_OPHDR_COND (QR1Obj, (ExpOpCount == 0));
-
- if (BitMask != 0) {
- CIfrUint32 U32Obj(LineNo);
- U32Obj.SetValue (BitMask);
-
- CIfrBitWiseAnd BWAObj(LineNo);
-
- CIfrUint8 U8Obj(LineNo);
- switch (BitMask) {
- case DATE_YEAR_BITMASK : U8Obj.SetValue (0); break;
- case TIME_SECOND_BITMASK : U8Obj.SetValue (0x10); break;
- case DATE_DAY_BITMASK : U8Obj.SetValue (0x18); break;
- case TIME_HOUR_BITMASK : U8Obj.SetValue (0); break;
- case TIME_MINUTE_BITMASK : U8Obj.SetValue (0x8); break;
- }
-
- CIfrShiftRight SRObj(LineNo);
- }
-
- ExpOpCount += 4;
-}
-
-VOID
-EfiVfrParser::IdEqValDoSpecial (
- IN UINT32 &ExpOpCount,
- IN UINT32 LineNo,
- IN EFI_QUESTION_ID QId,
- IN CHAR8 *VarIdStr,
- IN UINT32 BitMask,
- IN UINT16 ConstVal,
- IN EFI_COMPARE_TYPE CompareType
- )
-{
- ConvertIdExpr (ExpOpCount, LineNo, QId, VarIdStr, BitMask);
-
- if (ConstVal > 0xFF) {
- CIfrUint16 U16Obj(LineNo);
- U16Obj.SetValue (ConstVal);
- } else {
- CIfrUint8 U8Obj(LineNo);
- U8Obj.SetValue ((UINT8)ConstVal);
- }
-
- switch (CompareType) {
- case EQUAL :
- {
- CIfrEqual EObj(LineNo);
- break;
- }
- case LESS_EQUAL :
- {
- CIfrLessEqual LEObj(LineNo);
- break;
- }
- case LESS_THAN :
- {
- CIfrLessThan LTObj(LineNo);
- break;
- }
- case GREATER_EQUAL :
- {
- CIfrGreaterEqual GEObj(LineNo);
- break;
- }
- case GREATER_THAN :
- {
- CIfrGreaterThan GTObj(LineNo);
- break;
- }
- }
-
- ExpOpCount += 2;
-}
-
-VOID
-EfiVfrParser::IdEqIdDoSpecial (
- IN UINT32 &ExpOpCount,
- IN UINT32 LineNo,
- IN EFI_QUESTION_ID QId1,
- IN CHAR8 *VarId1Str,
- IN UINT32 BitMask1,
- IN EFI_QUESTION_ID QId2,
- IN CHAR8 *VarId2Str,
- IN UINT32 BitMask2,
- IN EFI_COMPARE_TYPE CompareType
- )
-{
- ConvertIdExpr (ExpOpCount, LineNo, QId1, VarId1Str, BitMask1);
- ConvertIdExpr (ExpOpCount, LineNo, QId2, VarId2Str, BitMask2);
-
- switch (CompareType) {
- case EQUAL :
- {
- CIfrEqual EObj(LineNo);
- break;
- }
- case LESS_EQUAL :
- {
- CIfrLessEqual LEObj(LineNo);
- break;
- }
- case LESS_THAN :
- {
- CIfrLessThan LTObj(LineNo);
- break;
- }
- case GREATER_EQUAL :
- {
- CIfrGreaterEqual GEObj(LineNo);
- break;
- }
- case GREATER_THAN :
- {
- CIfrGreaterThan GTObj(LineNo);
- break;
- }
- }
-
- ExpOpCount++;
-}
-
-VOID
-EfiVfrParser::IdEqListDoSpecial (
- IN UINT32 &ExpOpCount,
- IN UINT32 LineNo,
- IN EFI_QUESTION_ID QId,
- IN CHAR8 *VarIdStr,
- IN UINT32 BitMask,
- IN UINT16 ListLen,
- IN UINT16 *ValueList
- )
-{
- UINT16 Index;
-
- if (ListLen == 0) {
- return;
- }
-
- IdEqValDoSpecial (ExpOpCount, LineNo, QId, VarIdStr, BitMask, ValueList[0], EQUAL);
- for (Index = 1; Index < ListLen; Index++) {
- IdEqValDoSpecial (ExpOpCount, LineNo, QId, VarIdStr, BitMask, ValueList[Index], EQUAL);
- CIfrOr OObj (LineNo);
- ExpOpCount++;
- }
-}
-
-VOID
-EfiVfrParser::SetOverrideClassGuid (IN EFI_GUID *OverrideClassGuid)
-{
- mOverrideClassGuid = OverrideClassGuid;
-}
-
-//
-// For framework vfr compatibility
-//
-VOID
-EfiVfrParser::SetCompatibleMode (IN BOOLEAN Mode)
-{
- mCompatibleMode = Mode;
- mCVfrQuestionDB.SetCompatibleMode (Mode);
-}
-
-VOID
-EfiVfrParser::CheckDuplicateDefaultValue (
- IN EFI_DEFAULT_ID DefaultId,
- IN ANTLRTokenPtr Tok
- )
-{
- UINT16 Index;
-
- for(Index = 0; Index < mUsedDefaultCount; Index++) {
- if (mUsedDefaultArray[Index] == DefaultId) {
- gCVfrErrorHandle.HandleWarning (VFR_WARNING_DEFAULT_VALUE_REDEFINED, Tok->getLine(), Tok->getText());
- }
- }
-
- if (mUsedDefaultCount >= EFI_IFR_MAX_DEFAULT_TYPE - 1) {
- gCVfrErrorHandle.HandleError (VFR_RETURN_FATAL_ERROR, Tok->getLine(), Tok->getText());
- }
-
- mUsedDefaultArray[mUsedDefaultCount++] = DefaultId;
-}
->>
diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
deleted file mode 100644
index 21a479db68..0000000000
--- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
+++ /dev/null
@@ -1,3606 +0,0 @@
-/** @file
-
- Vfr common library functions.
-
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "stdio.h"
-#include "stdlib.h"
-#include "VfrUtilityLib.h"
-#include "VfrFormPkg.h"
-
-VOID
-CVfrBinaryOutput::WriteLine (
- IN FILE *pFile,
- IN UINT32 LineBytes,
- IN CONST CHAR8 *LineHeader,
- IN CHAR8 *BlkBuf,
- IN UINT32 BlkSize
- )
-{
- UINT32 Index;
-
- if ((pFile == NULL) || (LineHeader == NULL) || (BlkBuf == NULL)) {
- return;
- }
-
- for (Index = 0; Index < BlkSize; Index++) {
- if ((Index % LineBytes) == 0) {
- fprintf (pFile, "\n%s", LineHeader);
- }
- fprintf (pFile, "0x%02X, ", (UINT8)BlkBuf[Index]);
- }
-}
-
-VOID
-CVfrBinaryOutput::WriteEnd (
- IN FILE *pFile,
- IN UINT32 LineBytes,
- IN CONST CHAR8 *LineHeader,
- IN CHAR8 *BlkBuf,
- IN UINT32 BlkSize
- )
-{
- UINT32 Index;
-
- if ((BlkSize == 0) || (pFile == NULL) || (LineHeader == NULL) || (BlkBuf == NULL)) {
- return;
- }
-
- for (Index = 0; Index < BlkSize - 1; Index++) {
- if ((Index % LineBytes) == 0) {
- fprintf (pFile, "\n%s", LineHeader);
- }
- fprintf (pFile, "0x%02X, ", (UINT8)BlkBuf[Index]);
- }
-
- if ((Index % LineBytes) == 0) {
- fprintf (pFile, "\n%s", LineHeader);
- }
- fprintf (pFile, "0x%02X\n", (UINT8)BlkBuf[Index]);
-}
-
-SConfigInfo::SConfigInfo (
- IN UINT8 Type,
- IN UINT16 Offset,
- IN UINT32 Width,
- IN EFI_IFR_TYPE_VALUE Value
- )
-{
- mNext = NULL;
- mOffset = Offset;
- mWidth = (UINT16)Width;
- mValue = new UINT8[mWidth];
- if (mValue == NULL) {
- return;
- }
-
- switch (Type) {
- case EFI_IFR_TYPE_NUM_SIZE_8 :
- memcpy (mValue, &Value.u8, mWidth);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_16 :
- memcpy (mValue, &Value.u16, mWidth);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_32 :
- memcpy (mValue, &Value.u32, mWidth);
- break;
- case EFI_IFR_TYPE_NUM_SIZE_64 :
- memcpy (mValue, &Value.u64, mWidth);
- break;
- case EFI_IFR_TYPE_BOOLEAN :
- memcpy (mValue, &Value.b, mWidth);
- break;
- case EFI_IFR_TYPE_TIME :
- memcpy (mValue, &Value.time, mWidth);
- break;
- case EFI_IFR_TYPE_DATE :
- memcpy (mValue, &Value.date, mWidth);
- break;
- case EFI_IFR_TYPE_STRING :
- memcpy (mValue, &Value.string, mWidth);
- break;
- case EFI_IFR_TYPE_OTHER :
- return;
- }
-}
-
-SConfigInfo::~SConfigInfo (
- VOID
- )
-{
- BUFFER_SAFE_FREE (mValue);
-}
-
-SConfigItem::SConfigItem (
- IN CHAR8 *Name,
- IN EFI_GUID *Guid,
- IN CHAR8 *Id
- )
-{
- mName = NULL;
- mGuid = NULL;
- mId = NULL;
- mInfoStrList = NULL;
- mNext = NULL;
-
- if (Name != NULL) {
- if ((mName = new CHAR8[strlen (Name) + 1]) != NULL) {
- strcpy (mName, Name);
- }
- }
-
- if (Guid != NULL) {
- if ((mGuid = (EFI_GUID *) new CHAR8[sizeof (EFI_GUID)]) != NULL) {
- memcpy (mGuid, Guid, sizeof (EFI_GUID));
- }
- }
-
- if (Id != NULL) {
- if ((mId = new CHAR8[strlen (Id) + 1]) != NULL) {
- strcpy (mId, Id);
- }
- }
-}
-
-SConfigItem::SConfigItem (
- IN CHAR8 *Name,
- IN EFI_GUID *Guid,
- IN CHAR8 *Id,
- IN UINT8 Type,
- IN UINT16 Offset,
- IN UINT16 Width,
- IN EFI_IFR_TYPE_VALUE Value
- )
-{
- mName = NULL;
- mGuid = NULL;
- mId = NULL;
- mInfoStrList = NULL;
- mNext = NULL;
-
- if (Name != NULL) {
- if ((mName = new CHAR8[strlen (Name) + 1]) != NULL) {
- strcpy (mName, Name);
- }
- }
-
- if (Guid != NULL) {
- if ((mGuid = (EFI_GUID *) new CHAR8[sizeof (EFI_GUID)]) != NULL) {
- memcpy (mGuid, Guid, sizeof (EFI_GUID));
- }
- }
-
- if (Id != NULL) {
- if ((mId = new CHAR8[strlen (Id) + 1]) != NULL) {
- strcpy (mId, Id);
- }
- }
-
- mInfoStrList = new SConfigInfo(Type, Offset, Width, Value);
-}
-
-SConfigItem::~SConfigItem (
- VOID
- )
-{
- SConfigInfo *Info;
-
- BUFFER_SAFE_FREE (mName);
- BUFFER_SAFE_FREE (mGuid);
- BUFFER_SAFE_FREE (mId);
- while (mInfoStrList != NULL) {
- Info = mInfoStrList;
- mInfoStrList = mInfoStrList->mNext;
-
- BUFFER_SAFE_FREE (Info);
- }
-}
-
-UINT8
-CVfrBufferConfig::Register (
- IN CHAR8 *Name,
- IN EFI_GUID *Guid,
- IN CHAR8 *Id
- )
-{
- SConfigItem *pNew;
-
- if (Select (Name, Guid) == 0) {
- return 1;
- }
-
- if ((pNew = new SConfigItem (Name, Guid, Id)) == NULL) {
- return 2;
- }
-
- if (mItemListHead == NULL) {
- mItemListHead = pNew;
- mItemListTail = pNew;
- } else {
- mItemListTail->mNext = pNew;
- mItemListTail = pNew;
- }
- mItemListPos = pNew;
-
- return 0;
-}
-
-VOID
-CVfrBufferConfig::Open (
- VOID
- )
-{
- mItemListPos = mItemListHead;
-}
-
-BOOLEAN
-CVfrBufferConfig::Eof(
- VOID
- )
-{
- return (mItemListPos == NULL) ? TRUE : FALSE;
-}
-
-UINT8
-CVfrBufferConfig::Select (
- IN CHAR8 *Name,
- IN EFI_GUID *Guid,
- IN CHAR8 *Id
- )
-{
- SConfigItem *p;
-
- if (Name == NULL || Guid == NULL) {
- mItemListPos = mItemListHead;
- return 0;
- } else {
- for (p = mItemListHead; p != NULL; p = p->mNext) {
- if ((strcmp (p->mName, Name) != 0) || (memcmp (p->mGuid, Guid, sizeof (EFI_GUID)) != 0)) {
- continue;
- }
-
- if (Id != NULL) {
- if (p->mId == NULL || strcmp (p->mId, Id) != 0) {
- continue;
- }
- } else if (p->mId != NULL) {
- continue;
- }
-
- mItemListPos = p;
- return 0;
- }
- }
-
- return 1;
-}
-
-UINT8
-CVfrBufferConfig::Write (
- IN CONST CHAR8 Mode,
- IN CHAR8 *Name,
- IN EFI_GUID *Guid,
- IN CHAR8 *Id,
- IN UINT8 Type,
- IN UINT16 Offset,
- IN UINT32 Width,
- IN EFI_IFR_TYPE_VALUE Value
- )
-{
- UINT8 Ret;
- SConfigItem *pItem;
- SConfigInfo *pInfo;
-
- if ((Ret = Select (Name, Guid)) != 0) {
- return Ret;
- }
-
- switch (Mode) {
- case 'a' : // add
- if (Select (Name, Guid, Id) != 0) {
- if ((pItem = new SConfigItem (Name, Guid, Id, Type, Offset, (UINT16) Width, Value)) == NULL) {
- return 2;
- }
- if (mItemListHead == NULL) {
- mItemListHead = pItem;
- mItemListTail = pItem;
- } else {
- mItemListTail->mNext = pItem;
- mItemListTail = pItem;
- }
- mItemListPos = pItem;
- } else {
- // tranverse the list to find out if there's already the value for the same offset
- for (pInfo = mItemListPos->mInfoStrList; pInfo != NULL; pInfo = pInfo->mNext) {
- if (pInfo->mOffset == Offset) {
- return 0;
- }
- }
- if((pInfo = new SConfigInfo (Type, Offset, Width, Value)) == NULL) {
- return 2;
- }
- pInfo->mNext = mItemListPos->mInfoStrList;
- mItemListPos->mInfoStrList = pInfo;
- }
- break;
-
- case 'd' : // delete
- if (mItemListHead == mItemListPos) {
- mItemListHead = mItemListPos->mNext;
- delete mItemListPos;
- break;
- }
-
- for (pItem = mItemListHead; pItem->mNext != mItemListPos; pItem = pItem->mNext)
- ;
-
- pItem->mNext = mItemListPos->mNext;
- if (mItemListTail == mItemListPos) {
- mItemListTail = pItem;
- }
- delete mItemListPos;
- mItemListPos = pItem->mNext;
- break;
-
- case 'i' : // set info
- if (mItemListPos->mId != NULL) {
- delete mItemListPos->mId;
- }
- mItemListPos->mId = NULL;
- if (Id != NULL) {
- if ((mItemListPos->mId = new CHAR8[strlen (Id) + 1]) == NULL) {
- return 2;
- }
- strcpy (mItemListPos->mId, Id);
- }
- break;
-
- default :
- return 1;
- }
-
- return 0;
-}
-
-
-VOID
-CVfrBufferConfig::Close (
- VOID
- )
-{
- mItemListPos = NULL;
-}
-
-#define BYTES_PRE_LINE 0x10
-
-VOID
-CVfrBufferConfig::OutputCFile (
- IN FILE *pFile,
- IN CHAR8 *BaseName
- )
-{
- CVfrBinaryOutput Output;
- SConfigItem *Item;
- SConfigInfo *Info;
- UINT32 TotalLen;
-
- if (pFile == NULL) {
- return;
- }
-
- for (Item = mItemListHead; Item != NULL; Item = Item->mNext) {
- if (Item->mId != NULL || Item->mInfoStrList == NULL) {
- continue;
- }
- fprintf (pFile, "\nunsigned char %s%sBlockName[] = {", BaseName, Item->mName);
-
- TotalLen = sizeof (UINT32);
- for (Info = Item->mInfoStrList; Info != NULL; Info = Info->mNext) {
- TotalLen += sizeof (UINT16) * 2;
- }
- Output.WriteLine (pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&TotalLen, sizeof (UINT32));
-
- for (Info = Item->mInfoStrList; Info != NULL; Info = Info->mNext) {
- fprintf (pFile, "\n");
- Output.WriteLine (pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&Info->mOffset, sizeof (UINT16));
- Output.WriteLine (pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&Info->mWidth, sizeof (UINT16));
- }
- fprintf (pFile, "\n};\n");
- }
-
- for (Item = mItemListHead; Item != NULL; Item = Item->mNext) {
- if (Item->mId != NULL && Item->mInfoStrList != NULL) {
- fprintf (pFile, "\nunsigned char %s%sDefault%s[] = {", BaseName, Item->mName, Item->mId);
-
- TotalLen = sizeof (UINT32);
- for (Info = Item->mInfoStrList; Info != NULL; Info = Info->mNext) {
- TotalLen += Info->mWidth + sizeof (UINT16) * 2;
- }
- Output.WriteLine (pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&TotalLen, sizeof (UINT32));
-
- for (Info = Item->mInfoStrList; Info != NULL; Info = Info->mNext) {
- fprintf (pFile, "\n");
- Output.WriteLine (pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&Info->mOffset, sizeof (UINT16));
- Output.WriteLine (pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&Info->mWidth, sizeof (UINT16));
- if (Info->mNext == NULL) {
- Output.WriteEnd (pFile, BYTES_PRE_LINE, " ", (CHAR8 *)Info->mValue, Info->mWidth);
- } else {
- Output.WriteLine (pFile, BYTES_PRE_LINE, " ", (CHAR8 *)Info->mValue, Info->mWidth);
- }
- }
- fprintf (pFile, "\n};\n");
- }
- }
-}
-
-CVfrBufferConfig::CVfrBufferConfig (
- VOID
- )
-{
- mItemListHead = NULL;
- mItemListTail = NULL;
- mItemListPos = NULL;
-}
-
-CVfrBufferConfig::~CVfrBufferConfig (
- VOID
- )
-{
- SConfigItem *p;
-
- while (mItemListHead != NULL) {
- p = mItemListHead;
- mItemListHead = mItemListHead->mNext;
- delete p;
- }
-
- mItemListHead = NULL;
- mItemListTail = NULL;
- mItemListPos = NULL;
-}
-
-CVfrBufferConfig gCVfrBufferConfig;
-
-static struct {
- CONST CHAR8 *mTypeName;
- UINT8 mType;
- UINT32 mSize;
- UINT32 mAlign;
-} gInternalTypesTable [] = {
- {"UINT64", EFI_IFR_TYPE_NUM_SIZE_64, sizeof (UINT64), sizeof (UINT64)},
- {"UINT32", EFI_IFR_TYPE_NUM_SIZE_32, sizeof (UINT32), sizeof (UINT32)},
- {"UINT16", EFI_IFR_TYPE_NUM_SIZE_16, sizeof (UINT16), sizeof (UINT16)},
- {"UINT8", EFI_IFR_TYPE_NUM_SIZE_8, sizeof (UINT8), sizeof (UINT8)},
- {"BOOLEAN", EFI_IFR_TYPE_BOOLEAN, sizeof (BOOLEAN), sizeof (BOOLEAN)},
- {"EFI_HII_DATE", EFI_IFR_TYPE_DATE, sizeof (EFI_HII_DATE), sizeof (UINT16)},
- {"EFI_STRING_ID", EFI_IFR_TYPE_STRING, sizeof (EFI_STRING_ID),sizeof (EFI_STRING_ID)},
- {"EFI_HII_TIME", EFI_IFR_TYPE_TIME, sizeof (EFI_HII_TIME), sizeof (UINT8)},
- {"EFI_HII_REF", EFI_IFR_TYPE_REF, sizeof (EFI_HII_REF), sizeof (EFI_GUID)},
- {NULL, EFI_IFR_TYPE_OTHER, 0, 0}
-};
-
-STATIC
-BOOLEAN
-_IS_INTERNAL_TYPE (
- IN CHAR8 *TypeName
- )
-{
- UINT32 Index;
-
- if (TypeName == NULL) {
- return FALSE;
- }
-
- for (Index = 0; gInternalTypesTable[Index].mTypeName != NULL; Index++) {
- if (strcmp (TypeName, gInternalTypesTable[Index].mTypeName) == 0) {
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-STATIC
-CHAR8 *
-TrimHex (
- IN CHAR8 *Str,
- OUT bool *IsHex
- )
-{
- *IsHex = FALSE;
-
- while (*Str && *Str == ' ') {
- Str++;
- }
- while (*Str && *Str == '0') {
- Str++;
- }
- if (*Str && (*Str == 'x' || *Str == 'X')) {
- Str++;
- *IsHex = TRUE;
- }
-
- return Str;
-}
-
-UINT32
-_STR2U32 (
- IN CHAR8 *Str
- )
-{
- bool IsHex;
- UINT32 Value;
- CHAR8 c;
-
- Str = TrimHex (Str, &IsHex);
- for (Value = 0; (c = *Str) != '\0'; Str++) {
- //
- // BUG: does not handle overflow here
- //
- (IsHex == TRUE) ? (Value <<= 4) : (Value *= 10);
-
- if ((IsHex == TRUE) && (c >= 'a') && (c <= 'f')) {
- Value += (c - 'a' + 10);
- }
- if ((IsHex == TRUE) && (c >= 'A') && (c <= 'F')) {
- Value += (c - 'A' + 10);
- }
- if (c >= '0' && c <= '9') {
- Value += (c - '0');
- }
- }
-
- return Value;
-}
-
-VOID
-CVfrVarDataTypeDB::RegisterNewType (
- IN SVfrDataType *New
- )
-{
- New->mNext = mDataTypeList;
- mDataTypeList = New;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::ExtractStructTypeName (
- IN CHAR8 *&VarStr,
- OUT CHAR8 *TName
- )
-{
- if (TName == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- while((*VarStr != '\0') && (*VarStr != '.')) {
- *TName = *VarStr;
- VarStr++;
- TName++;
- }
- *TName = '\0';
- if (*VarStr == '.') {
- VarStr++;
- }
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::ExtractFieldNameAndArrary (
- IN CHAR8 *&VarStr,
- IN CHAR8 *FName,
- OUT UINT32 &ArrayIdx
- )
-{
- UINT32 Idx;
- CHAR8 ArrayStr[MAX_NAME_LEN + 1];
-
- ArrayIdx = INVALID_ARRAY_INDEX;
-
- if (FName == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- while((*VarStr != '\0') &&
- (*VarStr != '.') &&
- (*VarStr != '[') &&
- (*VarStr != ']')) {
- *FName = *VarStr;
- VarStr++;
- FName++;
- }
- *FName = '\0';
-
- switch (*VarStr) {
- case '.' :
- VarStr++;
- case '\0':
- return VFR_RETURN_SUCCESS;
- case '[' :
- VarStr++;
- for (Idx = 0; (Idx < MAX_NAME_LEN) && (*VarStr != '\0') && (*VarStr != ']'); VarStr++, Idx++) {
- ArrayStr[Idx] = *VarStr;
- }
- ArrayStr[Idx] = '\0';
-
- if ((*VarStr != ']') && (ArrayStr[0] == '\0')) {
- return VFR_RETURN_DATA_STRING_ERROR;
- }
- ArrayIdx = _STR2U32 (ArrayStr);
- if (*VarStr == ']') {
- VarStr++;
- }
- if (*VarStr == '.') {
- VarStr++;
- }
- return VFR_RETURN_SUCCESS;
- case ']':
- return VFR_RETURN_DATA_STRING_ERROR;
- }
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::GetTypeField (
- IN CONST CHAR8 *FName,
- IN SVfrDataType *Type,
- OUT SVfrDataField *&Field
- )
-{
- SVfrDataField *pField = NULL;
-
- if ((FName == NULL) && (Type == NULL)) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- for (pField = Type->mMembers; pField != NULL; pField = pField->mNext) {
- //
- // For type EFI_IFR_TYPE_TIME, because field name is not correctly wrote,
- // add code to adjust it.
- //
- if (Type->mType == EFI_IFR_TYPE_TIME) {
- if (strcmp (FName, "Hour") == 0) {
- FName = "Hours";
- } else if (strcmp (FName, "Minute") == 0) {
- FName = "Minuts";
- } else if (strcmp (FName, "Second") == 0) {
- FName = "Seconds";
- }
- }
-
- if (strcmp (pField->mFieldName, FName) == 0) {
- Field = pField;
- return VFR_RETURN_SUCCESS;
- }
- }
-
- return VFR_RETURN_UNDEFINED;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::GetFieldOffset (
- IN SVfrDataField *Field,
- IN UINT32 ArrayIdx,
- OUT UINT32 &Offset
- )
-{
- if (Field == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- //
- // Framework Vfr file Array Index is from 1.
- // But Uefi Vfr file Array Index is from 0.
- //
- if (VfrCompatibleMode && ArrayIdx != INVALID_ARRAY_INDEX) {
- if (ArrayIdx == 0) {
- return VFR_RETURN_ERROR_ARRARY_NUM;
- }
- ArrayIdx = ArrayIdx - 1;
- }
-
- if ((ArrayIdx != INVALID_ARRAY_INDEX) && ((Field->mArrayNum == 0) || (Field->mArrayNum <= ArrayIdx))) {
- return VFR_RETURN_ERROR_ARRARY_NUM;
- }
-
- //
- // Be compatible with the current usage
- // If ArraryIdx is not specified, the first one is used.
- //
- // if ArrayNum is larger than zero, ArraryIdx must be specified.
- //
- // if ((ArrayIdx == INVALID_ARRAY_INDEX) && (Field->mArrayNum > 0)) {
- // return VFR_RETURN_ERROR_ARRARY_NUM;
- // }
- //
-
- Offset = Field->mOffset + Field->mFieldType->mTotalSize * ((ArrayIdx == INVALID_ARRAY_INDEX) ? 0 : ArrayIdx);
- return VFR_RETURN_SUCCESS;
-}
-
-UINT8
-CVfrVarDataTypeDB::GetFieldWidth (
- IN SVfrDataField *Field
- )
-{
- if (Field == NULL) {
- return 0;
- }
-
- return Field->mFieldType->mType;
-}
-
-UINT32
-CVfrVarDataTypeDB::GetFieldSize (
- IN SVfrDataField *Field,
- IN UINT32 ArrayIdx
- )
-{
- if (Field == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- if ((ArrayIdx == INVALID_ARRAY_INDEX) && (Field->mArrayNum != 0)) {
- return Field->mFieldType->mTotalSize * Field->mArrayNum;
- } else {
- return Field->mFieldType->mTotalSize;
- }
-}
-
-VOID
-CVfrVarDataTypeDB::InternalTypesListInit (
- VOID
- )
-{
- SVfrDataType *New = NULL;
- UINT32 Index;
-
- for (Index = 0; gInternalTypesTable[Index].mTypeName != NULL; Index++) {
- New = new SVfrDataType;
- if (New != NULL) {
- strcpy (New->mTypeName, gInternalTypesTable[Index].mTypeName);
- New->mType = gInternalTypesTable[Index].mType;
- New->mAlign = gInternalTypesTable[Index].mAlign;
- New->mTotalSize = gInternalTypesTable[Index].mSize;
- if (strcmp (gInternalTypesTable[Index].mTypeName, "EFI_HII_DATE") == 0) {
- SVfrDataField *pYearField = new SVfrDataField;
- SVfrDataField *pMonthField = new SVfrDataField;
- SVfrDataField *pDayField = new SVfrDataField;
-
- strcpy (pYearField->mFieldName, "Year");
- GetDataType ((CHAR8 *)"UINT16", &pYearField->mFieldType);
- pYearField->mOffset = 0;
- pYearField->mNext = pMonthField;
- pYearField->mArrayNum = 0;
-
- strcpy (pMonthField->mFieldName, "Month");
- GetDataType ((CHAR8 *)"UINT8", &pMonthField->mFieldType);
- pMonthField->mOffset = 2;
- pMonthField->mNext = pDayField;
- pMonthField->mArrayNum = 0;
-
- strcpy (pDayField->mFieldName, "Day");
- GetDataType ((CHAR8 *)"UINT8", &pDayField->mFieldType);
- pDayField->mOffset = 3;
- pDayField->mNext = NULL;
- pDayField->mArrayNum = 0;
-
- New->mMembers = pYearField;
- } else if (strcmp (gInternalTypesTable[Index].mTypeName, "EFI_HII_TIME") == 0) {
- SVfrDataField *pHoursField = new SVfrDataField;
- SVfrDataField *pMinutesField = new SVfrDataField;
- SVfrDataField *pSecondsField = new SVfrDataField;
-
- strcpy (pHoursField->mFieldName, "Hours");
- GetDataType ((CHAR8 *)"UINT8", &pHoursField->mFieldType);
- pHoursField->mOffset = 0;
- pHoursField->mNext = pMinutesField;
- pHoursField->mArrayNum = 0;
-
- strcpy (pMinutesField->mFieldName, "Minutes");
- GetDataType ((CHAR8 *)"UINT8", &pMinutesField->mFieldType);
- pMinutesField->mOffset = 1;
- pMinutesField->mNext = pSecondsField;
- pMinutesField->mArrayNum = 0;
-
- strcpy (pSecondsField->mFieldName, "Seconds");
- GetDataType ((CHAR8 *)"UINT8", &pSecondsField->mFieldType);
- pSecondsField->mOffset = 2;
- pSecondsField->mNext = NULL;
- pSecondsField->mArrayNum = 0;
-
- New->mMembers = pHoursField;
- } else if (strcmp (gInternalTypesTable[Index].mTypeName, "EFI_HII_REF") == 0) {
- SVfrDataField *pQuestionIdField = new SVfrDataField;
- SVfrDataField *pFormIdField = new SVfrDataField;
- SVfrDataField *pFormSetGuidField = new SVfrDataField;
- SVfrDataField *pDevicePathField = new SVfrDataField;
-
- strcpy (pQuestionIdField->mFieldName, "QuestionId");
- GetDataType ((CHAR8 *)"UINT16", &pQuestionIdField->mFieldType);
- pQuestionIdField->mOffset = 0;
- pQuestionIdField->mNext = pFormIdField;
- pQuestionIdField->mArrayNum = 0;
-
- strcpy (pFormIdField->mFieldName, "FormId");
- GetDataType ((CHAR8 *)"UINT16", &pFormIdField->mFieldType);
- pFormIdField->mOffset = 2;
- pFormIdField->mNext = pFormSetGuidField;
- pFormIdField->mArrayNum = 0;
-
- strcpy (pFormSetGuidField->mFieldName, "FormSetGuid");
- GetDataType ((CHAR8 *)"EFI_GUID", &pFormSetGuidField->mFieldType);
- pFormSetGuidField->mOffset = 4;
- pFormSetGuidField->mNext = pDevicePathField;
- pFormSetGuidField->mArrayNum = 0;
-
- strcpy (pDevicePathField->mFieldName, "DevicePath");
- GetDataType ((CHAR8 *)"EFI_STRING_ID", &pDevicePathField->mFieldType);
- pDevicePathField->mOffset = 20;
- pDevicePathField->mNext = NULL;
- pDevicePathField->mArrayNum = 0;
-
- New->mMembers = pQuestionIdField;
- } else {
- New->mMembers = NULL;
- }
- New->mNext = NULL;
- RegisterNewType (New);
- New = NULL;
- }
- }
-}
-
-CVfrVarDataTypeDB::CVfrVarDataTypeDB (
- VOID
- )
-{
- mDataTypeList = NULL;
- mNewDataType = NULL;
- mCurrDataField = NULL;
- mPackAlign = DEFAULT_PACK_ALIGN;
- mPackStack = NULL;
- mFirstNewDataTypeName = NULL;
-
- InternalTypesListInit ();
-}
-
-CVfrVarDataTypeDB::~CVfrVarDataTypeDB (
- VOID
- )
-{
- SVfrDataType *pType;
- SVfrDataField *pField;
- SVfrPackStackNode *pPack;
-
- if (mNewDataType != NULL) {
- delete mNewDataType;
- }
-
- while (mDataTypeList != NULL) {
- pType = mDataTypeList;
- mDataTypeList = mDataTypeList->mNext;
- while(pType->mMembers != NULL) {
- pField = pType->mMembers;
- pType->mMembers = pType->mMembers->mNext;
- delete pField;
- }
- delete pType;
- }
-
- while (mPackStack != NULL) {
- pPack = mPackStack;
- mPackStack = mPackStack->mNext;
- delete pPack;
- }
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::Pack (
- IN UINT32 LineNum,
- IN UINT8 Action,
- IN CHAR8 *Identifier,
- IN UINT32 Number
- )
-{
- UINT32 PackAlign;
- CHAR8 Msg[MAX_STRING_LEN] = {0, };
-
- if (Action & VFR_PACK_SHOW) {
- sprintf (Msg, "value of pragma pack(show) == %d", mPackAlign);
- gCVfrErrorHandle.PrintMsg (LineNum, NULL, "Warning", Msg);
- }
-
- if (Action & VFR_PACK_PUSH) {
- SVfrPackStackNode *pNew = NULL;
-
- if ((pNew = new SVfrPackStackNode (Identifier, mPackAlign)) == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
- pNew->mNext = mPackStack;
- mPackStack = pNew;
- }
-
- if (Action & VFR_PACK_POP) {
- SVfrPackStackNode *pNode = NULL;
-
- if (mPackStack == NULL) {
- gCVfrErrorHandle.PrintMsg (LineNum, NULL, "Error", "#pragma pack(pop...) : more pops than pushes");
- }
-
- for (pNode = mPackStack; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->Match (Identifier) == TRUE) {
- mPackAlign = pNode->mNumber;
- mPackStack = pNode->mNext;
- }
- }
- }
-
- if (Action & VFR_PACK_ASSIGN) {
- PackAlign = (Number > 1) ? Number + Number % 2 : Number;
- if ((PackAlign == 0) || (PackAlign > 16)) {
- gCVfrErrorHandle.PrintMsg (LineNum, NULL, "Error", "expected pragma parameter to be '1', '2', '4', '8', or '16'");
- } else {
- mPackAlign = PackAlign;
- }
- }
-
- return VFR_RETURN_SUCCESS;
-}
-
-VOID
-CVfrVarDataTypeDB::DeclareDataTypeBegin (
- VOID
- )
-{
- SVfrDataType *pNewType = NULL;
-
- pNewType = new SVfrDataType;
- pNewType->mTypeName[0] = '\0';
- pNewType->mType = EFI_IFR_TYPE_OTHER;
- pNewType->mAlign = DEFAULT_ALIGN;
- pNewType->mTotalSize = 0;
- pNewType->mMembers = NULL;
- pNewType->mNext = NULL;
-
- mNewDataType = pNewType;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::SetNewTypeName (
- IN CHAR8 *TypeName
- )
-{
- SVfrDataType *pType;
-
- if (mNewDataType == NULL) {
- return VFR_RETURN_ERROR_SKIPED;
- }
- if (TypeName == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
- if (strlen(TypeName) >= MAX_NAME_LEN) {
- return VFR_RETURN_INVALID_PARAMETER;
- }
-
- for (pType = mDataTypeList; pType != NULL; pType = pType->mNext) {
- if (strcmp(pType->mTypeName, TypeName) == 0) {
- return VFR_RETURN_REDEFINED;
- }
- }
-
- strcpy(mNewDataType->mTypeName, TypeName);
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::DataTypeAddField (
- IN CHAR8 *FieldName,
- IN CHAR8 *TypeName,
- IN UINT32 ArrayNum
- )
-{
- SVfrDataField *pNewField = NULL;
- SVfrDataType *pFieldType = NULL;
- SVfrDataField *pTmp;
- UINT32 Align;
-
- CHECK_ERROR_RETURN (GetDataType (TypeName, &pFieldType), VFR_RETURN_SUCCESS);
-
- if (strlen (FieldName) >= MAX_NAME_LEN) {
- return VFR_RETURN_INVALID_PARAMETER;
- }
-
- for (pTmp = mNewDataType->mMembers; pTmp != NULL; pTmp = pTmp->mNext) {
- if (strcmp (pTmp->mFieldName, FieldName) == 0) {
- return VFR_RETURN_REDEFINED;
- }
- }
-
- Align = MIN (mPackAlign, pFieldType->mAlign);
-
- if ((pNewField = new SVfrDataField) == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
- strcpy (pNewField->mFieldName, FieldName);
- pNewField->mFieldType = pFieldType;
- pNewField->mArrayNum = ArrayNum;
- if ((mNewDataType->mTotalSize % Align) == 0) {
- pNewField->mOffset = mNewDataType->mTotalSize;
- } else {
- pNewField->mOffset = mNewDataType->mTotalSize + ALIGN_STUFF(mNewDataType->mTotalSize, Align);
- }
- if (mNewDataType->mMembers == NULL) {
- mNewDataType->mMembers = pNewField;
- pNewField->mNext = NULL;
- } else {
- for (pTmp = mNewDataType->mMembers; pTmp->mNext != NULL; pTmp = pTmp->mNext)
- ;
- pTmp->mNext = pNewField;
- pNewField->mNext = NULL;
- }
-
- mNewDataType->mAlign = MIN (mPackAlign, MAX (pFieldType->mAlign, mNewDataType->mAlign));
- mNewDataType->mTotalSize = pNewField->mOffset + (pNewField->mFieldType->mTotalSize) * ((ArrayNum == 0) ? 1 : ArrayNum);
-
- return VFR_RETURN_SUCCESS;
-}
-
-VOID
-CVfrVarDataTypeDB::DeclareDataTypeEnd (
- VOID
- )
-{
- if (mNewDataType->mTypeName[0] == '\0') {
- return;
- }
-
- if ((mNewDataType->mTotalSize % mNewDataType->mAlign) !=0) {
- mNewDataType->mTotalSize += ALIGN_STUFF (mNewDataType->mTotalSize, mNewDataType->mAlign);
- }
-
- RegisterNewType (mNewDataType);
- if (mFirstNewDataTypeName == NULL) {
- mFirstNewDataTypeName = mNewDataType->mTypeName;
- }
-
- mNewDataType = NULL;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::GetDataType (
- IN CHAR8 *TypeName,
- OUT SVfrDataType **DataType
- )
-{
- SVfrDataType *pDataType = NULL;
-
- if (TypeName == NULL) {
- return VFR_RETURN_ERROR_SKIPED;
- }
-
- if (DataType == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- *DataType = NULL;
-
- for (pDataType = mDataTypeList; pDataType != NULL; pDataType = pDataType->mNext) {
- if (strcmp (TypeName, pDataType->mTypeName) == 0) {
- *DataType = pDataType;
- return VFR_RETURN_SUCCESS;
- }
- }
-
- return VFR_RETURN_UNDEFINED;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::GetDataTypeSize (
- IN UINT8 DataType,
- OUT UINT32 *Size
- )
-{
- SVfrDataType *pDataType = NULL;
-
- if (Size == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- *Size = 0;
- DataType = DataType & 0x0F;
-
- //
- // For user defined data type, the size can't be got by this function.
- //
- if (DataType == EFI_IFR_TYPE_OTHER) {
- return VFR_RETURN_SUCCESS;
- }
-
- for (pDataType = mDataTypeList; pDataType != NULL; pDataType = pDataType->mNext) {
- if (DataType == pDataType->mType) {
- *Size = pDataType->mTotalSize;
- return VFR_RETURN_SUCCESS;
- }
- }
-
- return VFR_RETURN_UNDEFINED;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::GetDataTypeSize (
- IN CHAR8 *TypeName,
- OUT UINT32 *Size
- )
-{
- SVfrDataType *pDataType = NULL;
-
- if (Size == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- *Size = 0;
-
- for (pDataType = mDataTypeList; pDataType != NULL; pDataType = pDataType->mNext) {
- if (strcmp (TypeName, pDataType->mTypeName) == 0) {
- *Size = pDataType->mTotalSize;
- return VFR_RETURN_SUCCESS;
- }
- }
-
- return VFR_RETURN_UNDEFINED;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::GetDataFieldInfo (
- IN CHAR8 *VarStr,
- OUT UINT16 &Offset,
- OUT UINT8 &Type,
- OUT UINT32 &Size
- )
-{
- CHAR8 TName[MAX_NAME_LEN], FName[MAX_NAME_LEN];
- UINT32 ArrayIdx, Tmp;
- SVfrDataType *pType = NULL;
- SVfrDataField *pField = NULL;
-
- Offset = 0;
- Type = EFI_IFR_TYPE_OTHER;
- Size = 0;
-
- CHECK_ERROR_RETURN (ExtractStructTypeName (VarStr, TName), VFR_RETURN_SUCCESS);
- CHECK_ERROR_RETURN (GetDataType (TName, &pType), VFR_RETURN_SUCCESS);
-
- //
- // if it is not struct data type
- //
- Type = pType->mType;
- Size = pType->mTotalSize;
-
- while (*VarStr != '\0') {
- CHECK_ERROR_RETURN(ExtractFieldNameAndArrary(VarStr, FName, ArrayIdx), VFR_RETURN_SUCCESS);
- CHECK_ERROR_RETURN(GetTypeField (FName, pType, pField), VFR_RETURN_SUCCESS);
- pType = pField->mFieldType;
- CHECK_ERROR_RETURN(GetFieldOffset (pField, ArrayIdx, Tmp), VFR_RETURN_SUCCESS);
- Offset = (UINT16) (Offset + Tmp);
- Type = GetFieldWidth (pField);
- Size = GetFieldSize (pField, ArrayIdx);
- }
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrVarDataTypeDB::GetUserDefinedTypeNameList (
- OUT CHAR8 ***NameList,
- OUT UINT32 *ListSize
- )
-{
- UINT32 Index;
- SVfrDataType *pType;
-
- if ((NameList == NULL) || (ListSize == NULL)) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- *NameList = NULL;
- *ListSize = 0;
-
- for (pType = mDataTypeList; pType != NULL; pType = pType->mNext) {
- if (_IS_INTERNAL_TYPE(pType->mTypeName) == FALSE) {
- (*ListSize)++;
- }
- }
-
- if (*ListSize == 0) {
- return VFR_RETURN_SUCCESS;
- }
-
- if ((*NameList = new CHAR8*[*ListSize]) == NULL) {
- *ListSize = 0;
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
-
- for (Index = 0, pType = mDataTypeList; pType != NULL; pType = pType->mNext, Index++) {
- if (_IS_INTERNAL_TYPE(pType->mTypeName) == FALSE) {
- (*NameList)[Index] = pType->mTypeName;
- }
- }
- return VFR_RETURN_SUCCESS;
-}
-
-BOOLEAN
-CVfrVarDataTypeDB::IsTypeNameDefined (
- IN CHAR8 *TypeName
- )
-{
- SVfrDataType *pType;
-
- if (TypeName == NULL) {
- return FALSE;
- }
-
- for (pType = mDataTypeList; pType != NULL; pType = pType->mNext) {
- if (strcmp (pType->mTypeName, TypeName) == 0) {
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-VOID
-CVfrVarDataTypeDB::Dump (
- IN FILE *File
- )
-{
- SVfrDataType *pTNode;
- SVfrDataField *pFNode;
-
- fprintf (File, "\n\n***************************************************************\n");
- fprintf (File, "\t\tmPackAlign = %x\n", mPackAlign);
- for (pTNode = mDataTypeList; pTNode != NULL; pTNode = pTNode->mNext) {
- fprintf (File, "\t\tstruct %s : mAlign [%d] mTotalSize [0x%x]\n\n", pTNode->mTypeName, pTNode->mAlign, pTNode->mTotalSize);
- fprintf (File, "\t\tstruct %s {\n", pTNode->mTypeName);
- for (pFNode = pTNode->mMembers; pFNode != NULL; pFNode = pFNode->mNext) {
- if (pFNode->mArrayNum > 0) {
- fprintf (File, "\t\t\t+%08d[%08x] %s[%d] <%s>\n", pFNode->mOffset, pFNode->mOffset,
- pFNode->mFieldName, pFNode->mArrayNum, pFNode->mFieldType->mTypeName);
- } else {
- fprintf (File, "\t\t\t+%08d[%08x] %s <%s>\n", pFNode->mOffset, pFNode->mOffset,
- pFNode->mFieldName, pFNode->mFieldType->mTypeName);
- }
- }
- fprintf (File, "\t\t};\n");
- fprintf (File, "---------------------------------------------------------------\n");
- }
- fprintf (File, "***************************************************************\n");
-}
-
-#ifdef CVFR_VARDATATYPEDB_DEBUG
-VOID
-CVfrVarDataTypeDB::ParserDB (
- VOID
- )
-{
- SVfrDataType *pTNode;
- SVfrDataField *pFNode;
-
- printf ("***************************************************************\n");
- printf ("\t\tmPackAlign = %x\n", mPackAlign);
- for (pTNode = mDataTypeList; pTNode != NULL; pTNode = pTNode->mNext) {
- printf ("\t\tstruct %s : mAlign [%x] mTotalSize [%x]\n\n", pTNode->mTypeName, pTNode->mAlign, pTNode->mTotalSize);
- printf ("\t\tstruct %s {\n", pTNode->mTypeName);
- for (pFNode = pTNode->mMembers; pFNode != NULL; pFNode = pFNode->mNext) {
- printf ("\t\t\t%s\t%s\n", pFNode->mFieldType->mTypeName, pFNode->mFieldName);
- }
- printf ("\t\t};\n");
- printf ("---------------------------------------------------------------\n");
- }
- printf ("***************************************************************\n");
-}
-#endif
-
-SVfrVarStorageNode::SVfrVarStorageNode (
- IN EFI_GUID *Guid,
- IN CHAR8 *StoreName,
- IN EFI_VARSTORE_ID VarStoreId,
- IN EFI_STRING_ID VarName,
- IN UINT32 VarSize,
- IN BOOLEAN Flag
- )
-{
- if (Guid != NULL) {
- mGuid = *Guid;
- } else {
- memset (&Guid, 0, sizeof (EFI_GUID));
- }
- if (StoreName != NULL) {
- mVarStoreName = new CHAR8[strlen(StoreName) + 1];
- strcpy (mVarStoreName, StoreName);
- } else {
- mVarStoreName = NULL;
- }
- mNext = NULL;
- mVarStoreId = VarStoreId;
- mVarStoreType = EFI_VFR_VARSTORE_EFI;
- mStorageInfo.mEfiVar.mEfiVarName = VarName;
- mStorageInfo.mEfiVar.mEfiVarSize = VarSize;
- mAssignedFlag = Flag;
-}
-
-SVfrVarStorageNode::SVfrVarStorageNode (
- IN EFI_GUID *Guid,
- IN CHAR8 *StoreName,
- IN EFI_VARSTORE_ID VarStoreId,
- IN SVfrDataType *DataType,
- IN BOOLEAN Flag
- )
-{
- if (Guid != NULL) {
- mGuid = *Guid;
- } else {
- memset (&Guid, 0, sizeof (EFI_GUID));
- }
- if (StoreName != NULL) {
- mVarStoreName = new CHAR8[strlen(StoreName) + 1];
- strcpy (mVarStoreName, StoreName);
- } else {
- mVarStoreName = NULL;
- }
- mNext = NULL;
- mVarStoreId = VarStoreId;
- mVarStoreType = EFI_VFR_VARSTORE_BUFFER;
- mStorageInfo.mDataType = DataType;
- mAssignedFlag = Flag;
-}
-
-SVfrVarStorageNode::SVfrVarStorageNode (
- IN CHAR8 *StoreName,
- IN EFI_VARSTORE_ID VarStoreId
- )
-{
- if (StoreName != NULL) {
- mVarStoreName = new CHAR8[strlen(StoreName) + 1];
- strcpy (mVarStoreName, StoreName);
- } else {
- mVarStoreName = NULL;
- }
- mNext = NULL;
- mVarStoreId = VarStoreId;
- mVarStoreType = EFI_VFR_VARSTORE_NAME;
- mStorageInfo.mNameSpace.mNameTable = new EFI_VARSTORE_ID[DEFAULT_NAME_TABLE_ITEMS];
- mStorageInfo.mNameSpace.mTableSize = 0;
-}
-
-SVfrVarStorageNode::~SVfrVarStorageNode (
- VOID
- )
-{
- if (mVarStoreName != NULL) {
- delete mVarStoreName;
- }
-
- if (mVarStoreType == EFI_VFR_VARSTORE_NAME) {
- delete mStorageInfo.mNameSpace.mNameTable;
- }
-}
-
-CVfrDataStorage::CVfrDataStorage (
- VOID
- )
-{
- UINT32 Index;
-
- for (Index = 0; Index < EFI_FREE_VARSTORE_ID_BITMAP_SIZE; Index++) {
- mFreeVarStoreIdBitMap[Index] = 0;
- }
-
- // Question ID 0 is reserved.
- mFreeVarStoreIdBitMap[0] = 0x80000000;
-
- mBufferVarStoreList = NULL;
- mEfiVarStoreList = NULL;
- mNameVarStoreList = NULL;
- mCurrVarStorageNode = NULL;
- mNewVarStorageNode = NULL;
-}
-
-CVfrDataStorage::~CVfrDataStorage (
- VOID
- )
-{
- SVfrVarStorageNode *pNode;
-
- while (mBufferVarStoreList != NULL) {
- pNode = mBufferVarStoreList;
- mBufferVarStoreList = mBufferVarStoreList->mNext;
- delete pNode;
- }
- while (mEfiVarStoreList != NULL) {
- pNode = mEfiVarStoreList;
- mEfiVarStoreList = mEfiVarStoreList->mNext;
- delete pNode;
- }
- while (mNameVarStoreList != NULL) {
- pNode = mNameVarStoreList;
- mNameVarStoreList = mNameVarStoreList->mNext;
- delete pNode;
- }
- if (mNewVarStorageNode != NULL) {
- delete mNewVarStorageNode;
- }
-}
-
-EFI_VARSTORE_ID
-CVfrDataStorage::GetFreeVarStoreId (
- EFI_VFR_VARSTORE_TYPE VarType
- )
-{
- UINT32 Index, Mask, Offset;
-
- //
- // Assign the different ID range for the different type VarStore to support Framework Vfr
- //
- Index = 0;
- if ((!VfrCompatibleMode) || (VarType == EFI_VFR_VARSTORE_BUFFER)) {
- Index = 0;
- } else if (VarType == EFI_VFR_VARSTORE_EFI) {
- Index = 1;
- } else if (VarType == EFI_VFR_VARSTORE_NAME) {
- Index = 2;
- }
-
- for (; Index < EFI_FREE_VARSTORE_ID_BITMAP_SIZE; Index++) {
- if (mFreeVarStoreIdBitMap[Index] != 0xFFFFFFFF) {
- break;
- }
- }
-
- for (Offset = 0, Mask = 0x80000000; Mask != 0; Mask >>= 1, Offset++) {
- if ((mFreeVarStoreIdBitMap[Index] & Mask) == 0) {
- mFreeVarStoreIdBitMap[Index] |= Mask;
- return (EFI_VARSTORE_ID)((Index << EFI_BITS_SHIFT_PER_UINT32) + Offset);
- }
- }
-
- return EFI_VARSTORE_ID_INVALID;
-}
-
-BOOLEAN
-CVfrDataStorage::ChekVarStoreIdFree (
- IN EFI_VARSTORE_ID VarStoreId
- )
-{
- UINT32 Index = (VarStoreId / EFI_BITS_PER_UINT32);
- UINT32 Offset = (VarStoreId % EFI_BITS_PER_UINT32);
-
- return (mFreeVarStoreIdBitMap[Index] & (0x80000000 >> Offset)) == 0;
-}
-
-VOID
-CVfrDataStorage::MarkVarStoreIdUsed (
- IN EFI_VARSTORE_ID VarStoreId
- )
-{
- UINT32 Index = (VarStoreId / EFI_BITS_PER_UINT32);
- UINT32 Offset = (VarStoreId % EFI_BITS_PER_UINT32);
-
- mFreeVarStoreIdBitMap[Index] |= (0x80000000 >> Offset);
-}
-
-VOID
-CVfrDataStorage::MarkVarStoreIdUnused (
- IN EFI_VARSTORE_ID VarStoreId
- )
-{
- UINT32 Index = (VarStoreId / EFI_BITS_PER_UINT32);
- UINT32 Offset = (VarStoreId % EFI_BITS_PER_UINT32);
-
- mFreeVarStoreIdBitMap[Index] &= ~(0x80000000 >> Offset);
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::DeclareNameVarStoreBegin (
- IN CHAR8 *StoreName
- )
-{
- SVfrVarStorageNode *pNode = NULL;
- EFI_VARSTORE_ID VarStoreId;
-
- if (StoreName == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- if (GetVarStoreId (StoreName, &VarStoreId) == VFR_RETURN_SUCCESS) {
- return VFR_RETURN_REDEFINED;
- }
-
- VarStoreId = GetFreeVarStoreId (EFI_VFR_VARSTORE_NAME);
- if ((pNode = new SVfrVarStorageNode (StoreName, VarStoreId)) == NULL) {
- return VFR_RETURN_UNDEFINED;
- }
-
- mNewVarStorageNode = pNode;
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::NameTableAddItem (
- IN EFI_STRING_ID Item
- )
-{
- EFI_VARSTORE_ID *NewTable, *OldTable;
- UINT32 TableSize;
-
- OldTable = mNewVarStorageNode->mStorageInfo.mNameSpace.mNameTable;
- TableSize = mNewVarStorageNode->mStorageInfo.mNameSpace.mTableSize;
-
- if ((TableSize != 0) && ((TableSize % DEFAULT_NAME_TABLE_ITEMS) == 0)) {
- if ((NewTable = new EFI_VARSTORE_ID[TableSize + DEFAULT_NAME_TABLE_ITEMS]) == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
- memcpy (NewTable, OldTable, TableSize);
- mNewVarStorageNode->mStorageInfo.mNameSpace.mNameTable = NewTable;
- }
-
- mNewVarStorageNode->mStorageInfo.mNameSpace.mNameTable[TableSize++] = Item;
- mNewVarStorageNode->mStorageInfo.mNameSpace.mTableSize = TableSize;
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::DeclareNameVarStoreEnd (
- IN EFI_GUID *Guid
- )
-{
- mNewVarStorageNode->mGuid = *Guid;
- mNewVarStorageNode->mNext = mNameVarStoreList;
- mNameVarStoreList = mNewVarStorageNode;
-
- mNewVarStorageNode = NULL;
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::DeclareEfiVarStore (
- IN CHAR8 *StoreName,
- IN EFI_GUID *Guid,
- IN EFI_STRING_ID NameStrId,
- IN UINT32 VarSize,
- IN BOOLEAN Flag
- )
-{
- SVfrVarStorageNode *pNode;
- EFI_VARSTORE_ID VarStoreId;
-
- if ((StoreName == NULL) || (Guid == NULL)) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- if (VarSize > sizeof (UINT64)) {
- return VFR_RETURN_EFIVARSTORE_SIZE_ERROR;
- }
-
- if (GetVarStoreId (StoreName, &VarStoreId, Guid) == VFR_RETURN_SUCCESS) {
- return VFR_RETURN_REDEFINED;
- }
-
- VarStoreId = GetFreeVarStoreId (EFI_VFR_VARSTORE_EFI);
- if ((pNode = new SVfrVarStorageNode (Guid, StoreName, VarStoreId, NameStrId, VarSize, Flag)) == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
-
- pNode->mNext = mEfiVarStoreList;
- mEfiVarStoreList = pNode;
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::DeclareBufferVarStore (
- IN CHAR8 *StoreName,
- IN EFI_GUID *Guid,
- IN CVfrVarDataTypeDB *DataTypeDB,
- IN CHAR8 *TypeName,
- IN EFI_VARSTORE_ID VarStoreId,
- IN BOOLEAN Flag
- )
-{
- SVfrVarStorageNode *pNew = NULL;
- SVfrDataType *pDataType = NULL;
- EFI_VARSTORE_ID TempVarStoreId;
-
- if ((StoreName == NULL) || (Guid == NULL) || (DataTypeDB == NULL)) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- if (GetVarStoreId (StoreName, &TempVarStoreId, Guid) == VFR_RETURN_SUCCESS) {
- return VFR_RETURN_REDEFINED;
- }
-
- CHECK_ERROR_RETURN(DataTypeDB->GetDataType (TypeName, &pDataType), VFR_RETURN_SUCCESS);
-
- if (VarStoreId == EFI_VARSTORE_ID_INVALID) {
- VarStoreId = GetFreeVarStoreId (EFI_VFR_VARSTORE_BUFFER);
- } else {
- if (ChekVarStoreIdFree (VarStoreId) == FALSE) {
- return VFR_RETURN_VARSTOREID_REDEFINED;
- }
- MarkVarStoreIdUsed (VarStoreId);
- }
-
- if ((pNew = new SVfrVarStorageNode (Guid, StoreName, VarStoreId, pDataType, Flag)) == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
-
- pNew->mNext = mBufferVarStoreList;
- mBufferVarStoreList = pNew;
-
- if (gCVfrBufferConfig.Register(StoreName, Guid) != 0) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::GetVarStoreByDataType (
- IN CHAR8 *DataTypeName,
- OUT SVfrVarStorageNode **VarNode,
- IN EFI_GUID *VarGuid
- )
-{
- SVfrVarStorageNode *pNode;
- SVfrVarStorageNode *MatchNode;
-
- //
- // Framework VFR uses Data type name as varstore name, so don't need check again.
- //
- if (VfrCompatibleMode) {
- return VFR_RETURN_UNDEFINED;
- }
-
- MatchNode = NULL;
- for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (strcmp (pNode->mStorageInfo.mDataType->mTypeName, DataTypeName) != 0) {
- continue;
- }
-
- if ((VarGuid != NULL)) {
- if (memcmp (VarGuid, &pNode->mGuid, sizeof (EFI_GUID)) == 0) {
- *VarNode = pNode;
- return VFR_RETURN_SUCCESS;
- }
- } else {
- if (MatchNode == NULL) {
- MatchNode = pNode;
- } else {
- //
- // More than one varstores referred the same data structures.
- //
- return VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR;
- }
- }
- }
-
- if (MatchNode == NULL) {
- return VFR_RETURN_UNDEFINED;
- }
-
- *VarNode = MatchNode;
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VARSTORE_ID
-CVfrDataStorage::CheckGuidField (
- IN SVfrVarStorageNode *pNode,
- IN EFI_GUID *StoreGuid,
- IN BOOLEAN *HasFoundOne,
- OUT EFI_VFR_RETURN_CODE *ReturnCode
- )
-{
- if (StoreGuid != NULL) {
- //
- // If has guid info, compare the guid filed.
- //
- if (memcmp (StoreGuid, &pNode->mGuid, sizeof (EFI_GUID)) == 0) {
- //
- // Both name and guid are same, this this varstore.
- //
- mCurrVarStorageNode = pNode;
- *ReturnCode = VFR_RETURN_SUCCESS;
- return TRUE;
- }
- } else {
- //
- // Not has Guid field, check whether this name is the only one.
- //
- if (*HasFoundOne) {
- //
- // The name has conflict, return name redefined.
- //
- *ReturnCode = VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR;
- return TRUE;
- }
-
- *HasFoundOne = TRUE;
- mCurrVarStorageNode = pNode;
- }
-
- return FALSE;
-}
-
-/**
- Base on the input store name and guid to find the varstore id.
-
- If both name and guid are inputed, base on the name and guid to
- found the varstore. If only name inputed, base on the name to
- found the varstore and go on to check whether more than one varstore
- has the same name. If only has found one varstore, return this
- varstore; if more than one varstore has same name, return varstore
- name redefined error. If no varstore found by varstore name, call
- function GetVarStoreByDataType and use inputed varstore name as
- data type name to search.
-**/
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::GetVarStoreId (
- IN CHAR8 *StoreName,
- OUT EFI_VARSTORE_ID *VarStoreId,
- IN EFI_GUID *StoreGuid
- )
-{
- EFI_VFR_RETURN_CODE ReturnCode;
- SVfrVarStorageNode *pNode;
- BOOLEAN HasFoundOne = FALSE;
-
- mCurrVarStorageNode = NULL;
-
- for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (strcmp (pNode->mVarStoreName, StoreName) == 0) {
- if (CheckGuidField(pNode, StoreGuid, &HasFoundOne, &ReturnCode)) {
- *VarStoreId = mCurrVarStorageNode->mVarStoreId;
- return ReturnCode;
- }
- }
- }
-
- for (pNode = mEfiVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (strcmp (pNode->mVarStoreName, StoreName) == 0) {
- if (CheckGuidField(pNode, StoreGuid, &HasFoundOne, &ReturnCode)) {
- *VarStoreId = mCurrVarStorageNode->mVarStoreId;
- return ReturnCode;
- }
- }
- }
-
- for (pNode = mNameVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (strcmp (pNode->mVarStoreName, StoreName) == 0) {
- if (CheckGuidField(pNode, StoreGuid, &HasFoundOne, &ReturnCode)) {
- *VarStoreId = mCurrVarStorageNode->mVarStoreId;
- return ReturnCode;
- }
- }
- }
-
- if (HasFoundOne) {
- *VarStoreId = mCurrVarStorageNode->mVarStoreId;
- return VFR_RETURN_SUCCESS;
- }
-
- *VarStoreId = EFI_VARSTORE_ID_INVALID;
-
- //
- // Assume that Data strucutre name is used as StoreName, and check again.
- //
- ReturnCode = GetVarStoreByDataType (StoreName, &pNode, StoreGuid);
- if (pNode != NULL) {
- mCurrVarStorageNode = pNode;
- *VarStoreId = pNode->mVarStoreId;
- }
-
- return ReturnCode;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::GetBufferVarStoreDataTypeName (
- IN EFI_VARSTORE_ID VarStoreId,
- OUT CHAR8 **DataTypeName
- )
-{
- SVfrVarStorageNode *pNode;
-
- if (VarStoreId == EFI_VARSTORE_ID_INVALID) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mVarStoreId == VarStoreId) {
- *DataTypeName = pNode->mStorageInfo.mDataType->mTypeName;
- return VFR_RETURN_SUCCESS;
- }
- }
-
- return VFR_RETURN_UNDEFINED;
-}
-
-EFI_VFR_VARSTORE_TYPE
-CVfrDataStorage::GetVarStoreType (
- IN EFI_VARSTORE_ID VarStoreId
- )
-{
- SVfrVarStorageNode *pNode;
- EFI_VFR_VARSTORE_TYPE VarStoreType;
-
- VarStoreType = EFI_VFR_VARSTORE_INVALID;
-
- if (VarStoreId == EFI_VARSTORE_ID_INVALID) {
- return VarStoreType;
- }
-
- for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mVarStoreId == VarStoreId) {
- VarStoreType = pNode->mVarStoreType;
- return VarStoreType;
- }
- }
-
- for (pNode = mEfiVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mVarStoreId == VarStoreId) {
- VarStoreType = pNode->mVarStoreType;
- return VarStoreType;
- }
- }
-
- for (pNode = mNameVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mVarStoreId == VarStoreId) {
- VarStoreType = pNode->mVarStoreType;
- return VarStoreType;
- }
- }
-
- return VarStoreType;
-}
-
-EFI_GUID *
-CVfrDataStorage::GetVarStoreGuid (
- IN EFI_VARSTORE_ID VarStoreId
- )
-{
- SVfrVarStorageNode *pNode;
- EFI_GUID *VarGuid;
-
- VarGuid = NULL;
-
- if (VarStoreId == EFI_VARSTORE_ID_INVALID) {
- return VarGuid;
- }
-
- for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mVarStoreId == VarStoreId) {
- VarGuid = &pNode->mGuid;
- return VarGuid;
- }
- }
-
- for (pNode = mEfiVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mVarStoreId == VarStoreId) {
- VarGuid = &pNode->mGuid;
- return VarGuid;
- }
- }
-
- for (pNode = mNameVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mVarStoreId == VarStoreId) {
- VarGuid = &pNode->mGuid;
- return VarGuid;
- }
- }
-
- return VarGuid;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::GetVarStoreName (
- IN EFI_VARSTORE_ID VarStoreId,
- OUT CHAR8 **VarStoreName
- )
-{
- SVfrVarStorageNode *pNode;
-
- if (VarStoreName == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- for (pNode = mBufferVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mVarStoreId == VarStoreId) {
- *VarStoreName = pNode->mVarStoreName;
- return VFR_RETURN_SUCCESS;
- }
- }
-
- for (pNode = mEfiVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mVarStoreId == VarStoreId) {
- *VarStoreName = pNode->mVarStoreName;
- return VFR_RETURN_SUCCESS;
- }
- }
-
- for (pNode = mNameVarStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mVarStoreId == VarStoreId) {
- *VarStoreName = pNode->mVarStoreName;
- return VFR_RETURN_SUCCESS;
- }
- }
-
- *VarStoreName = NULL;
- return VFR_RETURN_UNDEFINED;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::GetEfiVarStoreInfo (
- IN OUT EFI_VARSTORE_INFO *Info
- )
-{
- if (Info == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- if (mCurrVarStorageNode == NULL) {
- return VFR_RETURN_GET_EFIVARSTORE_ERROR;
- }
-
- Info->mInfo.mVarName = mCurrVarStorageNode->mStorageInfo.mEfiVar.mEfiVarName;
- Info->mVarTotalSize = mCurrVarStorageNode->mStorageInfo.mEfiVar.mEfiVarSize;
- switch (Info->mVarTotalSize) {
- case 1:
- Info->mVarType = EFI_IFR_TYPE_NUM_SIZE_8;
- break;
- case 2:
- Info->mVarType = EFI_IFR_TYPE_NUM_SIZE_16;
- break;
- case 4:
- Info->mVarType = EFI_IFR_TYPE_NUM_SIZE_32;
- break;
- case 8:
- Info->mVarType = EFI_IFR_TYPE_NUM_SIZE_64;
- break;
- default :
- return VFR_RETURN_FATAL_ERROR;
- }
-
- return VFR_RETURN_SUCCESS;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDataStorage::GetNameVarStoreInfo (
- OUT EFI_VARSTORE_INFO *Info,
- IN UINT32 Index
- )
-{
- if (Info == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- if (mCurrVarStorageNode == NULL) {
- return VFR_RETURN_GET_NVVARSTORE_ERROR;
- }
-
- //
- // Framework Vfr file Index is from 1, but Uefi Vfr file Index is from 0.
- //
- if (VfrCompatibleMode) {
- if (Index == 0) {
- return VFR_RETURN_ERROR_ARRARY_NUM;
- }
- Index --;
- }
-
- Info->mInfo.mVarName = mCurrVarStorageNode->mStorageInfo.mNameSpace.mNameTable[Index];
-
- return VFR_RETURN_SUCCESS;
-}
-
-SVfrDefaultStoreNode::SVfrDefaultStoreNode (
- IN EFI_IFR_DEFAULTSTORE *ObjBinAddr,
- IN CHAR8 *RefName,
- IN EFI_STRING_ID DefaultStoreNameId,
- IN UINT16 DefaultId
- )
-{
- mObjBinAddr = ObjBinAddr;
-
- if (RefName != NULL) {
- mRefName = new CHAR8[strlen (RefName) + 1];
- strcpy (mRefName, RefName);
- } else {
- mRefName = NULL;
- }
-
- mNext = NULL;
- mDefaultId = DefaultId;
- mDefaultStoreNameId = DefaultStoreNameId;
-}
-
-SVfrDefaultStoreNode::~SVfrDefaultStoreNode (
- VOID
- )
-{
- if (mRefName != NULL) {
- delete mRefName;
- }
-}
-
-CVfrDefaultStore::CVfrDefaultStore (
- VOID
- )
-{
- mDefaultStoreList = NULL;
-}
-
-CVfrDefaultStore::~CVfrDefaultStore (
- VOID
- )
-{
- SVfrDefaultStoreNode *pTmp = NULL;
-
- while (mDefaultStoreList != NULL) {
- pTmp = mDefaultStoreList;
- mDefaultStoreList = mDefaultStoreList->mNext;
- delete pTmp;
- }
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDefaultStore::RegisterDefaultStore (
- IN CHAR8 *ObjBinAddr,
- IN CHAR8 *RefName,
- IN EFI_STRING_ID DefaultStoreNameId,
- IN UINT16 DefaultId
- )
-{
- SVfrDefaultStoreNode *pNode = NULL;
-
- if (RefName == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- for (pNode = mDefaultStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (strcmp (pNode->mRefName, RefName) == 0) {
- return VFR_RETURN_REDEFINED;
- }
- }
-
- if ((pNode = new SVfrDefaultStoreNode ((EFI_IFR_DEFAULTSTORE *)ObjBinAddr, RefName, DefaultStoreNameId, DefaultId)) == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
-
- pNode->mNext = mDefaultStoreList;
- mDefaultStoreList = pNode;
-
- return VFR_RETURN_SUCCESS;
-}
-
-/*
- * assign new reference name or new default store name id only if
- * the original is invalid
- */
-EFI_VFR_RETURN_CODE
-CVfrDefaultStore::ReRegisterDefaultStoreById (
- IN UINT16 DefaultId,
- IN CHAR8 *RefName,
- IN EFI_STRING_ID DefaultStoreNameId
- )
-{
- SVfrDefaultStoreNode *pNode = NULL;
-
- for (pNode = mDefaultStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mDefaultId == DefaultId) {
- break;
- }
- }
-
- if (pNode == NULL) {
- return VFR_RETURN_UNDEFINED;
- } else {
- if (pNode->mDefaultStoreNameId == EFI_STRING_ID_INVALID) {
- pNode->mDefaultStoreNameId = DefaultStoreNameId;
- if (pNode->mObjBinAddr != NULL) {
- pNode->mObjBinAddr->DefaultName = DefaultStoreNameId;
- }
- } else {
- return VFR_RETURN_REDEFINED;
- }
-
- if (RefName != NULL) {
- delete pNode->mRefName;
- pNode->mRefName = new CHAR8[strlen (RefName) + 1];
- if (pNode->mRefName != NULL) {
- strcpy (pNode->mRefName, RefName);
- }
- }
- }
-
- return VFR_RETURN_SUCCESS;
-}
-
-BOOLEAN
-CVfrDefaultStore::DefaultIdRegistered (
- IN UINT16 DefaultId
- )
-{
- SVfrDefaultStoreNode *pNode = NULL;
-
- for (pNode = mDefaultStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mDefaultId == DefaultId) {
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDefaultStore::GetDefaultId (
- IN CHAR8 *RefName,
- OUT UINT16 *DefaultId
- )
-{
- SVfrDefaultStoreNode *pTmp = NULL;
-
- if (DefaultId == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- for (pTmp = mDefaultStoreList; pTmp != NULL; pTmp = pTmp->mNext) {
- if (strcmp (pTmp->mRefName, RefName) == 0) {
- *DefaultId = pTmp->mDefaultId;
- return VFR_RETURN_SUCCESS;
- }
- }
-
- return VFR_RETURN_UNDEFINED;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrDefaultStore::BufferVarStoreAltConfigAdd (
- IN EFI_VARSTORE_ID DefaultId,
- IN EFI_VARSTORE_INFO &Info,
- IN CHAR8 *VarStoreName,
- IN EFI_GUID *VarStoreGuid,
- IN UINT8 Type,
- IN EFI_IFR_TYPE_VALUE Value
- )
-{
- SVfrDefaultStoreNode *pNode = NULL;
- CHAR8 NewAltCfg[2 * 2 * sizeof (UINT16) + 1] = {0,};
- INTN Returnvalue = 0;
-
- if (VarStoreName == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- for (pNode = mDefaultStoreList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mDefaultId == DefaultId) {
- break;
- }
- }
-
- if (pNode == NULL) {
- return VFR_RETURN_UNDEFINED;
- }
-
- gCVfrBufferConfig.Open ();
-
- sprintf (NewAltCfg, "%04x", pNode->mDefaultId);
- if ((Returnvalue = gCVfrBufferConfig.Select(VarStoreName, VarStoreGuid)) == 0) {
- if ((Returnvalue = gCVfrBufferConfig.Write ('a', VarStoreName, VarStoreGuid, NewAltCfg, Type, Info.mInfo.mVarOffset, Info.mVarTotalSize, Value)) != 0) {
- goto WriteError;
- }
- }
-
- gCVfrBufferConfig.Close ();
-
- return VFR_RETURN_SUCCESS;
-
-WriteError:
- gCVfrBufferConfig.Close ();
- return (EFI_VFR_RETURN_CODE)Returnvalue;
-}
-
-SVfrRuleNode::SVfrRuleNode (
- IN CHAR8 *RuleName,
- IN UINT8 RuleId
- )
-{
- if (RuleName != NULL) {
- mRuleName = new CHAR8[strlen (RuleName) + 1];
- strcpy (mRuleName, RuleName);
- } else {
- mRuleName = NULL;
- }
-
- mNext = NULL;
- mRuleId = RuleId;
-}
-
-SVfrRuleNode::~SVfrRuleNode (
- VOID
- )
-{
- if (mRuleName != NULL) {
- delete mRuleName;
- }
-}
-
-CVfrRulesDB::CVfrRulesDB ()
-{
- mRuleList = NULL;
- mFreeRuleId = EFI_VARSTORE_ID_START;
-}
-
-CVfrRulesDB::~CVfrRulesDB ()
-{
- SVfrRuleNode *pNode;
-
- while(mRuleList != NULL) {
- pNode = mRuleList;
- mRuleList = mRuleList->mNext;
- delete pNode;
- }
-}
-
-VOID
-CVfrRulesDB::RegisterRule (
- IN CHAR8 *RuleName
- )
-{
- SVfrRuleNode *pNew;
-
- if (RuleName == NULL) {
- return ;
- }
-
- if ((pNew = new SVfrRuleNode (RuleName, mFreeRuleId)) == NULL) {
- return ;
- }
-
- mFreeRuleId++;
-
- pNew->mNext = mRuleList;
- mRuleList = pNew;
-}
-
-UINT8
-CVfrRulesDB::GetRuleId (
- IN CHAR8 *RuleName
- )
-{
- SVfrRuleNode *pNode;
-
- if (RuleName == NULL) {
- return EFI_RULE_ID_INVALID;
- }
-
- for (pNode = mRuleList; pNode != NULL; pNode = pNode->mNext) {
- if (strcmp (pNode->mRuleName, RuleName) == 0) {
- return pNode->mRuleId;
- }
- }
-
- return EFI_RULE_ID_INVALID;
-}
-
-CVfrRulesDB gCVfrRulesDB;
-
-EFI_VARSTORE_INFO::EFI_VARSTORE_INFO (
- VOID
- )
-{
- mVarStoreId = EFI_VARSTORE_ID_INVALID;
- mInfo.mVarName = EFI_STRING_ID_INVALID;
- mInfo.mVarOffset = EFI_VAROFFSET_INVALID;
- mVarType = EFI_IFR_TYPE_OTHER;
- mVarTotalSize = 0;
-}
-
-EFI_VARSTORE_INFO::EFI_VARSTORE_INFO (
- IN EFI_VARSTORE_INFO &Info
- )
-{
- mVarStoreId = Info.mVarStoreId;
- mInfo.mVarName = Info.mInfo.mVarName;
- mInfo.mVarOffset = Info.mInfo.mVarOffset;
- mVarType = Info.mVarType;
- mVarTotalSize = Info.mVarTotalSize;
-}
-
-BOOLEAN
-EFI_VARSTORE_INFO::operator == (
- IN EFI_VARSTORE_INFO *Info
- )
-{
- if ((mVarStoreId == Info->mVarStoreId) &&
- (mInfo.mVarName == Info->mInfo.mVarName) &&
- (mInfo.mVarOffset == Info->mInfo.mVarOffset) &&
- (mVarType == Info->mVarType) &&
- (mVarTotalSize == Info->mVarTotalSize)) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-static EFI_VARSTORE_INFO gEfiInvalidVarStoreInfo;
-
-EFI_QUESTION_ID
-CVfrQuestionDB::GetFreeQuestionId (
- VOID
- )
-{
- UINT32 Index, Mask, Offset;
-
- for (Index = 0; Index < EFI_FREE_QUESTION_ID_BITMAP_SIZE; Index++) {
- if (mFreeQIdBitMap[Index] != 0xFFFFFFFF) {
- break;
- }
- }
-
- for (Offset = 0, Mask = 0x80000000; Mask != 0; Mask >>= 1, Offset++) {
- if ((mFreeQIdBitMap[Index] & Mask) == 0) {
- mFreeQIdBitMap[Index] |= Mask;
- return (EFI_QUESTION_ID)((Index << EFI_BITS_SHIFT_PER_UINT32) + Offset);
- }
- }
-
- return EFI_QUESTION_ID_INVALID;
-}
-
-BOOLEAN
-CVfrQuestionDB::ChekQuestionIdFree (
- IN EFI_QUESTION_ID QId
- )
-{
- UINT32 Index = (QId / EFI_BITS_PER_UINT32);
- UINT32 Offset = (QId % EFI_BITS_PER_UINT32);
-
- return (mFreeQIdBitMap[Index] & (0x80000000 >> Offset)) == 0;
-}
-
-VOID
-CVfrQuestionDB::MarkQuestionIdUsed (
- IN EFI_QUESTION_ID QId
- )
-{
- UINT32 Index = (QId / EFI_BITS_PER_UINT32);
- UINT32 Offset = (QId % EFI_BITS_PER_UINT32);
-
- mFreeQIdBitMap[Index] |= (0x80000000 >> Offset);
-}
-
-VOID
-CVfrQuestionDB::MarkQuestionIdUnused (
- IN EFI_QUESTION_ID QId
- )
-{
- UINT32 Index = (QId / EFI_BITS_PER_UINT32);
- UINT32 Offset = (QId % EFI_BITS_PER_UINT32);
-
- mFreeQIdBitMap[Index] &= ~(0x80000000 >> Offset);
-}
-
-SVfrQuestionNode::SVfrQuestionNode (
- IN CHAR8 *Name,
- IN CHAR8 *VarIdStr,
- IN UINT32 BitMask
- )
-{
- mName = NULL;
- mVarIdStr = NULL;
- mQuestionId = EFI_QUESTION_ID_INVALID;
- mBitMask = BitMask;
- mNext = NULL;
- mQtype = QUESTION_NORMAL;
-
- if (Name == NULL) {
- mName = new CHAR8[strlen ("$DEFAULT") + 1];
- strcpy (mName, "$DEFAULT");
- } else {
- mName = new CHAR8[strlen (Name) + 1];
- strcpy (mName, Name);
- }
-
- if (VarIdStr != NULL) {
- mVarIdStr = new CHAR8[strlen (VarIdStr) + 1];
- strcpy (mVarIdStr, VarIdStr);
- } else {
- mVarIdStr = new CHAR8[strlen ("$") + 1];
- strcpy (mVarIdStr, "$");
- }
-}
-
-SVfrQuestionNode::~SVfrQuestionNode (
- VOID
- )
-{
- if (mName != NULL) {
- delete mName;
- }
-
- if (mVarIdStr != NULL) {
- delete mVarIdStr;
- }
-}
-
-CVfrQuestionDB::CVfrQuestionDB ()
-{
- UINT32 Index;
-
- for (Index = 0; Index < EFI_FREE_QUESTION_ID_BITMAP_SIZE; Index++) {
- mFreeQIdBitMap[Index] = 0;
- }
-
- // Question ID 0 is reserved.
- mFreeQIdBitMap[0] = 0x80000000;
- mQuestionList = NULL;
-}
-
-CVfrQuestionDB::~CVfrQuestionDB ()
-{
- SVfrQuestionNode *pNode;
-
- while (mQuestionList != NULL) {
- pNode = mQuestionList;
- mQuestionList = mQuestionList->mNext;
- delete pNode;
- }
-}
-
-//
-// Reset to init state
-//
-VOID
-CVfrQuestionDB::ResetInit(
- IN VOID
- )
-{
- UINT32 Index;
- SVfrQuestionNode *pNode;
-
- while (mQuestionList != NULL) {
- pNode = mQuestionList;
- mQuestionList = mQuestionList->mNext;
- delete pNode;
- }
-
- for (Index = 0; Index < EFI_FREE_QUESTION_ID_BITMAP_SIZE; Index++) {
- mFreeQIdBitMap[Index] = 0;
- }
-
- // Question ID 0 is reserved.
- mFreeQIdBitMap[0] = 0x80000000;
- mQuestionList = NULL;
-}
-
-VOID
-CVfrQuestionDB::PrintAllQuestion (
- VOID
- )
-{
- SVfrQuestionNode *pNode = NULL;
-
- for (pNode = mQuestionList; pNode != NULL; pNode = pNode->mNext) {
- printf ("Question VarId is %s and QuesitonId is 0x%x\n", pNode->mVarIdStr, pNode->mQuestionId);
- }
-}
-
-EFI_VFR_RETURN_CODE
-CVfrQuestionDB::RegisterQuestion (
- IN CHAR8 *Name,
- IN CHAR8 *VarIdStr,
- IN OUT EFI_QUESTION_ID &QuestionId
- )
-{
- SVfrQuestionNode *pNode = NULL;
-
- if ((Name != NULL) && (FindQuestion(Name) == VFR_RETURN_SUCCESS)) {
- return VFR_RETURN_REDEFINED;
- }
-
- if ((pNode = new SVfrQuestionNode (Name, VarIdStr)) == NULL) {
- return VFR_RETURN_OUT_FOR_RESOURCES;
- }
-
- if (QuestionId == EFI_QUESTION_ID_INVALID) {
- QuestionId = GetFreeQuestionId ();
- } else {
- //
- // For Framework Vfr, don't check question ID conflict.
- //
- if (!VfrCompatibleMode && ChekQuestionIdFree (QuestionId) == FALSE) {
- delete pNode;
- return VFR_RETURN_QUESTIONID_REDEFINED;
- }
- MarkQuestionIdUsed (QuestionId);
- }
- pNode->mQuestionId = QuestionId;
-
- pNode->mNext = mQuestionList;
- mQuestionList = pNode;
-
- gCFormPkg.DoPendingAssign (VarIdStr, (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
-
- return VFR_RETURN_SUCCESS;
-}
-
-VOID
-CVfrQuestionDB::RegisterOldDateQuestion (
- IN CHAR8 *YearVarId,
- IN CHAR8 *MonthVarId,
- IN CHAR8 *DayVarId,
- IN OUT EFI_QUESTION_ID &QuestionId
- )
-{
- SVfrQuestionNode *pNode[3] = {NULL, };
- UINT32 Index;
-
- if ((YearVarId == NULL) || (MonthVarId == NULL) || (DayVarId == NULL)) {
- return;
- }
-
- if ((pNode[0] = new SVfrQuestionNode (NULL, YearVarId, DATE_YEAR_BITMASK)) == NULL) {
- goto Err;
- }
- if ((pNode[1] = new SVfrQuestionNode (NULL, MonthVarId, DATE_MONTH_BITMASK)) == NULL) {
- goto Err;
- }
- if ((pNode[2] = new SVfrQuestionNode (NULL, DayVarId, DATE_DAY_BITMASK)) == NULL) {
- goto Err;
- }
-
- if (QuestionId == EFI_QUESTION_ID_INVALID) {
- QuestionId = GetFreeQuestionId ();
- } else {
- if (ChekQuestionIdFree (QuestionId) == FALSE) {
- goto Err;
- }
- MarkQuestionIdUsed (QuestionId);
- }
-
- pNode[0]->mQuestionId = QuestionId;
- pNode[1]->mQuestionId = QuestionId;
- pNode[2]->mQuestionId = QuestionId;
- pNode[0]->mQtype = QUESTION_DATE;
- pNode[1]->mQtype = QUESTION_DATE;
- pNode[2]->mQtype = QUESTION_DATE;
- pNode[0]->mNext = pNode[1];
- pNode[1]->mNext = pNode[2];
- pNode[2]->mNext = mQuestionList;
- mQuestionList = pNode[0];
-
- gCFormPkg.DoPendingAssign (YearVarId, (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (MonthVarId, (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (DayVarId, (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
-
- return;
-
-Err:
- for (Index = 0; Index < 3; Index++) {
- if (pNode[Index] != NULL) {
- delete pNode[Index];
- }
- }
- QuestionId = EFI_QUESTION_ID_INVALID;
-}
-
-VOID
-CVfrQuestionDB::RegisterNewDateQuestion (
- IN CHAR8 *Name,
- IN CHAR8 *BaseVarId,
- IN OUT EFI_QUESTION_ID &QuestionId
- )
-{
- SVfrQuestionNode *pNode[3] = {NULL, };
- UINT32 Len;
- CHAR8 *VarIdStr[3] = {NULL, };
- CHAR8 Index;
-
- if (BaseVarId == NULL && Name == NULL) {
- return;
- }
-
- if (BaseVarId != NULL) {
- Len = strlen (BaseVarId);
-
- VarIdStr[0] = new CHAR8[Len + strlen (".Year") + 1];
- if (VarIdStr[0] != NULL) {
- strcpy (VarIdStr[0], BaseVarId);
- strcat (VarIdStr[0], ".Year");
- }
- VarIdStr[1] = new CHAR8[Len + strlen (".Month") + 1];
- if (VarIdStr[1] != NULL) {
- strcpy (VarIdStr[1], BaseVarId);
- strcat (VarIdStr[1], ".Month");
- }
- VarIdStr[2] = new CHAR8[Len + strlen (".Day") + 1];
- if (VarIdStr[2] != NULL) {
- strcpy (VarIdStr[2], BaseVarId);
- strcat (VarIdStr[2], ".Day");
- }
- } else {
- Len = strlen (Name);
-
- VarIdStr[0] = new CHAR8[Len + strlen (".Year") + 1];
- if (VarIdStr[0] != NULL) {
- strcpy (VarIdStr[0], Name);
- strcat (VarIdStr[0], ".Year");
- }
- VarIdStr[1] = new CHAR8[Len + strlen (".Month") + 1];
- if (VarIdStr[1] != NULL) {
- strcpy (VarIdStr[1], Name);
- strcat (VarIdStr[1], ".Month");
- }
- VarIdStr[2] = new CHAR8[Len + strlen (".Day") + 1];
- if (VarIdStr[2] != NULL) {
- strcpy (VarIdStr[2], Name);
- strcat (VarIdStr[2], ".Day");
- }
- }
-
- if ((pNode[0] = new SVfrQuestionNode (Name, VarIdStr[0], DATE_YEAR_BITMASK)) == NULL) {
- goto Err;
- }
- if ((pNode[1] = new SVfrQuestionNode (Name, VarIdStr[1], DATE_MONTH_BITMASK)) == NULL) {
- goto Err;
- }
- if ((pNode[2] = new SVfrQuestionNode (Name, VarIdStr[2], DATE_DAY_BITMASK)) == NULL) {
- goto Err;
- }
-
- if (QuestionId == EFI_QUESTION_ID_INVALID) {
- QuestionId = GetFreeQuestionId ();
- } else {
- if (ChekQuestionIdFree (QuestionId) == FALSE) {
- goto Err;
- }
- MarkQuestionIdUsed (QuestionId);
- }
-
- pNode[0]->mQuestionId = QuestionId;
- pNode[1]->mQuestionId = QuestionId;
- pNode[2]->mQuestionId = QuestionId;
- pNode[0]->mQtype = QUESTION_DATE;
- pNode[1]->mQtype = QUESTION_DATE;
- pNode[2]->mQtype = QUESTION_DATE;
- pNode[0]->mNext = pNode[1];
- pNode[1]->mNext = pNode[2];
- pNode[2]->mNext = mQuestionList;
- mQuestionList = pNode[0];
-
- for (Index = 0; Index < 3; Index++) {
- if (VarIdStr[Index] != NULL) {
- delete VarIdStr[Index];
- }
- }
-
- gCFormPkg.DoPendingAssign (VarIdStr[0], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (VarIdStr[1], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (VarIdStr[2], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
-
- return;
-
-Err:
- for (Index = 0; Index < 3; Index++) {
- if (pNode[Index] != NULL) {
- delete pNode[Index];
- }
-
- if (VarIdStr[Index] != NULL) {
- delete VarIdStr[Index];
- }
- }
-}
-
-VOID
-CVfrQuestionDB::RegisterOldTimeQuestion (
- IN CHAR8 *HourVarId,
- IN CHAR8 *MinuteVarId,
- IN CHAR8 *SecondVarId,
- IN OUT EFI_QUESTION_ID &QuestionId
- )
-{
- SVfrQuestionNode *pNode[3] = {NULL, };
- UINT32 Index;
-
- if ((HourVarId == NULL) || (MinuteVarId == NULL) || (SecondVarId == NULL)) {
- return;
- }
-
- if ((pNode[0] = new SVfrQuestionNode (NULL, HourVarId, TIME_HOUR_BITMASK)) == NULL) {
- goto Err;
- }
- if ((pNode[1] = new SVfrQuestionNode (NULL, MinuteVarId, TIME_MINUTE_BITMASK)) == NULL) {
- goto Err;
- }
- if ((pNode[2] = new SVfrQuestionNode (NULL, SecondVarId, TIME_SECOND_BITMASK)) == NULL) {
- goto Err;
- }
-
- if (QuestionId == EFI_QUESTION_ID_INVALID) {
- QuestionId = GetFreeQuestionId ();
- } else {
- if (ChekQuestionIdFree (QuestionId) == FALSE) {
- goto Err;
- }
- MarkQuestionIdUsed (QuestionId);
- }
-
- pNode[0]->mQuestionId = QuestionId;
- pNode[1]->mQuestionId = QuestionId;
- pNode[2]->mQuestionId = QuestionId;
- pNode[0]->mQtype = QUESTION_TIME;
- pNode[1]->mQtype = QUESTION_TIME;
- pNode[2]->mQtype = QUESTION_TIME;
- pNode[0]->mNext = pNode[1];
- pNode[1]->mNext = pNode[2];
- pNode[2]->mNext = mQuestionList;
- mQuestionList = pNode[0];
-
- gCFormPkg.DoPendingAssign (HourVarId, (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (MinuteVarId, (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (SecondVarId, (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
-
- return;
-
-Err:
- for (Index = 0; Index < 3; Index++) {
- if (pNode[Index] != NULL) {
- delete pNode[Index];
- }
- }
- QuestionId = EFI_QUESTION_ID_INVALID;
-}
-
-VOID
-CVfrQuestionDB::RegisterNewTimeQuestion (
- IN CHAR8 *Name,
- IN CHAR8 *BaseVarId,
- IN OUT EFI_QUESTION_ID &QuestionId
- )
-{
- SVfrQuestionNode *pNode[3] = {NULL, };
- UINT32 Len;
- CHAR8 *VarIdStr[3] = {NULL, };
- CHAR8 Index;
-
- if (BaseVarId == NULL && Name == NULL) {
- return;
- }
-
- if (BaseVarId != NULL) {
- Len = strlen (BaseVarId);
-
- VarIdStr[0] = new CHAR8[Len + strlen (".Hour") + 1];
- if (VarIdStr[0] != NULL) {
- strcpy (VarIdStr[0], BaseVarId);
- strcat (VarIdStr[0], ".Hour");
- }
- VarIdStr[1] = new CHAR8[Len + strlen (".Minute") + 1];
- if (VarIdStr[1] != NULL) {
- strcpy (VarIdStr[1], BaseVarId);
- strcat (VarIdStr[1], ".Minute");
- }
- VarIdStr[2] = new CHAR8[Len + strlen (".Second") + 1];
- if (VarIdStr[2] != NULL) {
- strcpy (VarIdStr[2], BaseVarId);
- strcat (VarIdStr[2], ".Second");
- }
- } else {
- Len = strlen (Name);
-
- VarIdStr[0] = new CHAR8[Len + strlen (".Hour") + 1];
- if (VarIdStr[0] != NULL) {
- strcpy (VarIdStr[0], Name);
- strcat (VarIdStr[0], ".Hour");
- }
- VarIdStr[1] = new CHAR8[Len + strlen (".Minute") + 1];
- if (VarIdStr[1] != NULL) {
- strcpy (VarIdStr[1], Name);
- strcat (VarIdStr[1], ".Minute");
- }
- VarIdStr[2] = new CHAR8[Len + strlen (".Second") + 1];
- if (VarIdStr[2] != NULL) {
- strcpy (VarIdStr[2], Name);
- strcat (VarIdStr[2], ".Second");
- }
- }
-
- if ((pNode[0] = new SVfrQuestionNode (Name, VarIdStr[0], TIME_HOUR_BITMASK)) == NULL) {
- goto Err;
- }
- if ((pNode[1] = new SVfrQuestionNode (Name, VarIdStr[1], TIME_MINUTE_BITMASK)) == NULL) {
- goto Err;
- }
- if ((pNode[2] = new SVfrQuestionNode (Name, VarIdStr[2], TIME_SECOND_BITMASK)) == NULL) {
- goto Err;
- }
-
- if (QuestionId == EFI_QUESTION_ID_INVALID) {
- QuestionId = GetFreeQuestionId ();
- } else {
- if (ChekQuestionIdFree (QuestionId) == FALSE) {
- goto Err;
- }
- MarkQuestionIdUsed (QuestionId);
- }
-
- pNode[0]->mQuestionId = QuestionId;
- pNode[1]->mQuestionId = QuestionId;
- pNode[2]->mQuestionId = QuestionId;
- pNode[0]->mQtype = QUESTION_TIME;
- pNode[1]->mQtype = QUESTION_TIME;
- pNode[2]->mQtype = QUESTION_TIME;
- pNode[0]->mNext = pNode[1];
- pNode[1]->mNext = pNode[2];
- pNode[2]->mNext = mQuestionList;
- mQuestionList = pNode[0];
-
- for (Index = 0; Index < 3; Index++) {
- if (VarIdStr[Index] != NULL) {
- delete VarIdStr[Index];
- }
- }
-
- gCFormPkg.DoPendingAssign (VarIdStr[0], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (VarIdStr[1], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (VarIdStr[2], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
-
- return;
-
-Err:
- for (Index = 0; Index < 3; Index++) {
- if (pNode[Index] != NULL) {
- delete pNode[Index];
- }
-
- if (VarIdStr[Index] != NULL) {
- delete VarIdStr[Index];
- }
- }
-}
-
-VOID
-CVfrQuestionDB::RegisterRefQuestion (
- IN CHAR8 *Name,
- IN CHAR8 *BaseVarId,
- IN OUT EFI_QUESTION_ID &QuestionId
- )
-{
- SVfrQuestionNode *pNode[4] = {NULL, };
- UINT32 Len;
- CHAR8 *VarIdStr[4] = {NULL, };
- CHAR8 Index;
-
- if (BaseVarId == NULL && Name == NULL) {
- return;
- }
-
- if (BaseVarId != NULL) {
- Len = strlen (BaseVarId);
-
- VarIdStr[0] = new CHAR8[Len + strlen (".QuestionId") + 1];
- if (VarIdStr[0] != NULL) {
- strcpy (VarIdStr[0], BaseVarId);
- strcat (VarIdStr[0], ".QuestionId");
- }
- VarIdStr[1] = new CHAR8[Len + strlen (".FormId") + 1];
- if (VarIdStr[1] != NULL) {
- strcpy (VarIdStr[1], BaseVarId);
- strcat (VarIdStr[1], ".FormId");
- }
- VarIdStr[2] = new CHAR8[Len + strlen (".FormSetGuid") + 1];
- if (VarIdStr[2] != NULL) {
- strcpy (VarIdStr[2], BaseVarId);
- strcat (VarIdStr[2], ".FormSetGuid");
- }
- VarIdStr[3] = new CHAR8[Len + strlen (".DevicePath") + 1];
- if (VarIdStr[3] != NULL) {
- strcpy (VarIdStr[3], BaseVarId);
- strcat (VarIdStr[3], ".DevicePath");
- }
- } else {
- Len = strlen (Name);
-
- VarIdStr[0] = new CHAR8[Len + strlen (".QuestionId") + 1];
- if (VarIdStr[0] != NULL) {
- strcpy (VarIdStr[0], Name);
- strcat (VarIdStr[0], ".QuestionId");
- }
- VarIdStr[1] = new CHAR8[Len + strlen (".FormId") + 1];
- if (VarIdStr[1] != NULL) {
- strcpy (VarIdStr[1], Name);
- strcat (VarIdStr[1], ".FormId");
- }
- VarIdStr[2] = new CHAR8[Len + strlen (".FormSetGuid") + 1];
- if (VarIdStr[2] != NULL) {
- strcpy (VarIdStr[2], Name);
- strcat (VarIdStr[2], ".FormSetGuid");
- }
- VarIdStr[3] = new CHAR8[Len + strlen (".DevicePath") + 1];
- if (VarIdStr[3] != NULL) {
- strcpy (VarIdStr[3], Name);
- strcat (VarIdStr[3], ".DevicePath");
- }
- }
-
- if ((pNode[0] = new SVfrQuestionNode (Name, VarIdStr[0])) == NULL) {
- goto Err;
- }
- if ((pNode[1] = new SVfrQuestionNode (Name, VarIdStr[1])) == NULL) {
- goto Err;
- }
- if ((pNode[2] = new SVfrQuestionNode (Name, VarIdStr[2])) == NULL) {
- goto Err;
- }
- if ((pNode[3] = new SVfrQuestionNode (Name, VarIdStr[3])) == NULL) {
- goto Err;
- }
-
- if (QuestionId == EFI_QUESTION_ID_INVALID) {
- QuestionId = GetFreeQuestionId ();
- } else {
- if (ChekQuestionIdFree (QuestionId) == FALSE) {
- goto Err;
- }
- MarkQuestionIdUsed (QuestionId);
- }
-
- pNode[0]->mQuestionId = QuestionId;
- pNode[1]->mQuestionId = QuestionId;
- pNode[2]->mQuestionId = QuestionId;
- pNode[3]->mQuestionId = QuestionId;
- pNode[0]->mQtype = QUESTION_REF;
- pNode[1]->mQtype = QUESTION_REF;
- pNode[2]->mQtype = QUESTION_REF;
- pNode[3]->mQtype = QUESTION_REF;
- pNode[0]->mNext = pNode[1];
- pNode[1]->mNext = pNode[2];
- pNode[2]->mNext = pNode[3];
- pNode[3]->mNext = mQuestionList;
- mQuestionList = pNode[0];
-
- gCFormPkg.DoPendingAssign (VarIdStr[0], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (VarIdStr[1], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (VarIdStr[2], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
- gCFormPkg.DoPendingAssign (VarIdStr[3], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
-
- return;
-
- Err:
- for (Index = 0; Index < 4; Index++) {
- if (pNode[Index] != NULL) {
- delete pNode[Index];
- }
-
- if (VarIdStr[Index] != NULL) {
- delete VarIdStr[Index];
- }
- }
-}
-
-EFI_VFR_RETURN_CODE
-CVfrQuestionDB::UpdateQuestionId (
- IN EFI_QUESTION_ID QId,
- IN EFI_QUESTION_ID NewQId
- )
-{
- SVfrQuestionNode *pNode = NULL;
-
- if (QId == NewQId) {
- // don't update
- return VFR_RETURN_SUCCESS;
- }
-
- //
- // For Framework Vfr, don't check question ID conflict.
- //
- if (!VfrCompatibleMode && ChekQuestionIdFree (NewQId) == FALSE) {
- return VFR_RETURN_REDEFINED;
- }
-
- for (pNode = mQuestionList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mQuestionId == QId) {
- break;
- }
- }
-
- if (pNode == NULL) {
- return VFR_RETURN_UNDEFINED;
- }
-
- MarkQuestionIdUnused (QId);
- pNode->mQuestionId = NewQId;
- MarkQuestionIdUsed (NewQId);
-
- gCFormPkg.DoPendingAssign (pNode->mVarIdStr, (VOID *)&NewQId, sizeof(EFI_QUESTION_ID));
-
- return VFR_RETURN_SUCCESS;
-}
-
-VOID
-CVfrQuestionDB::GetQuestionId (
- IN CHAR8 *Name,
- IN CHAR8 *VarIdStr,
- OUT EFI_QUESTION_ID &QuestionId,
- OUT UINT32 &BitMask,
- OUT EFI_QUESION_TYPE *QType
- )
-{
- SVfrQuestionNode *pNode;
-
- QuestionId = EFI_QUESTION_ID_INVALID;
- BitMask = 0x00000000;
- if (QType != NULL) {
- *QType = QUESTION_NORMAL;
- }
-
- if ((Name == NULL) && (VarIdStr == NULL)) {
- return ;
- }
-
- for (pNode = mQuestionList; pNode != NULL; pNode = pNode->mNext) {
- if (Name != NULL) {
- if (strcmp (pNode->mName, Name) != 0) {
- continue;
- }
- }
-
- if (VarIdStr != NULL) {
- if (strcmp (pNode->mVarIdStr, VarIdStr) != 0) {
- continue;
- }
- }
-
- QuestionId = pNode->mQuestionId;
- BitMask = pNode->mBitMask;
- if (QType != NULL) {
- *QType = pNode->mQtype;
- }
- break;
- }
-
- return ;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrQuestionDB::FindQuestion (
- IN EFI_QUESTION_ID QuestionId
- )
-{
- SVfrQuestionNode *pNode;
-
- if (QuestionId == EFI_QUESTION_ID_INVALID) {
- return VFR_RETURN_INVALID_PARAMETER;
- }
-
- for (pNode = mQuestionList; pNode != NULL; pNode = pNode->mNext) {
- if (pNode->mQuestionId == QuestionId) {
- return VFR_RETURN_SUCCESS;
- }
- }
-
- return VFR_RETURN_UNDEFINED;
-}
-
-EFI_VFR_RETURN_CODE
-CVfrQuestionDB::FindQuestion (
- IN CHAR8 *Name
- )
-{
- SVfrQuestionNode *pNode;
-
- if (Name == NULL) {
- return VFR_RETURN_FATAL_ERROR;
- }
-
- for (pNode = mQuestionList; pNode != NULL; pNode = pNode->mNext) {
- if (strcmp (pNode->mName, Name) == 0) {
- return VFR_RETURN_SUCCESS;
- }
- }
-
- return VFR_RETURN_UNDEFINED;
-}
-
-CVfrStringDB::CVfrStringDB ()
-{
- mStringFileName = NULL;
-}
-
-CVfrStringDB::~CVfrStringDB ()
-{
- if (mStringFileName != NULL) {
- delete mStringFileName;
- }
- mStringFileName = NULL;
-}
-
-
-VOID
-CVfrStringDB::SetStringFileName(IN CHAR8 *StringFileName)
-{
- UINT32 FileLen = 0;
-
- if (StringFileName == NULL) {
- return;
- }
-
- FileLen = strlen (StringFileName) + 1;
- mStringFileName = new CHAR8[FileLen];
- if (mStringFileName == NULL) {
- return;
- }
-
- strcpy (mStringFileName, StringFileName);
- mStringFileName[FileLen - 1] = '\0';
-}
-
-
-/**
- Returns TRUE or FALSE whether SupportedLanguages contains the best matching language
- from a set of supported languages.
-
- @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string that
- contains a set of language codes.
- @param[in] Language A variable that contains pointers to Null-terminated
- ASCII strings that contain one language codes.
-
- @retval FALSE The best matching language could not be found in SupportedLanguages.
- @retval TRUE The best matching language could be found in SupportedLanguages.
-
-**/
-BOOLEAN
-CVfrStringDB::GetBestLanguage (
- IN CONST CHAR8 *SupportedLanguages,
- IN CHAR8 *Language
- )
-{
- UINTN CompareLength;
- UINTN LanguageLength;
- CONST CHAR8 *Supported;
-
- if (SupportedLanguages == NULL || Language == NULL){
- return FALSE;
- }
-
- //
- // Determine the length of the first RFC 4646 language code in Language
- //
- for (LanguageLength = 0; Language[LanguageLength] != 0 && Language[LanguageLength] != ';'; LanguageLength++);
-
- //
- // Trim back the length of Language used until it is empty
- //
- while (LanguageLength > 0) {
- //
- // Loop through all language codes in SupportedLanguages
- //
- for (Supported = SupportedLanguages; *Supported != '\0'; Supported += CompareLength) {
- //
- // Skip ';' characters in Supported
- //
- for (; *Supported != '\0' && *Supported == ';'; Supported++);
- //
- // Determine the length of the next language code in Supported
- //
- for (CompareLength = 0; Supported[CompareLength] != 0 && Supported[CompareLength] != ';'; CompareLength++);
- //
- // If Language is longer than the Supported, then skip to the next language
- //
- if (LanguageLength > CompareLength) {
- continue;
- }
-
- //
- // See if the first LanguageLength characters in Supported match Language
- //
- if (strncmp (Supported, Language, LanguageLength) == 0) {
- return TRUE;
- }
- }
-
- //
- // Trim Language from the right to the next '-' character
- //
- for (LanguageLength--; LanguageLength > 0 && Language[LanguageLength] != '-'; LanguageLength--);
- }
-
- //
- // No matches were found
- //
- return FALSE;
-}
-
-
-CHAR8 *
-CVfrStringDB::GetVarStoreNameFormStringId (
- IN EFI_STRING_ID StringId
- )
-{
- FILE *pInFile = NULL;
- UINT32 NameOffset;
- UINT32 Length;
- UINT8 *StringPtr;
- CHAR8 *StringName;
- CHAR16 *UnicodeString;
- CHAR8 *VarStoreName = NULL;
- CHAR8 *DestTmp;
- UINT8 *Current;
- EFI_STATUS Status;
- CHAR8 LineBuf[EFI_IFR_MAX_LENGTH];
- UINT8 BlockType;
- EFI_HII_STRING_PACKAGE_HDR *PkgHeader;
-
- if (mStringFileName == '\0' ) {
- return NULL;
- }
-
- if ((pInFile = fopen (mStringFileName, "rb")) == NULL) {
- return NULL;
- }
-
- //
- // Get file length.
- //
- fseek (pInFile, 0, SEEK_END);
- Length = ftell (pInFile);
- fseek (pInFile, 0, SEEK_SET);
-
- //
- // Get file data.
- //
- StringPtr = new UINT8[Length];
- if (StringPtr == NULL) {
- fclose (pInFile);
- return NULL;
- }
- fread ((char *)StringPtr, sizeof (UINT8), Length, pInFile);
- fclose (pInFile);
-
- PkgHeader = (EFI_HII_STRING_PACKAGE_HDR *) StringPtr;
- //
- // Check the String package.
- //
- if (PkgHeader->Header.Type != EFI_HII_PACKAGE_STRINGS) {
- delete StringPtr;
- return NULL;
- }
-
- //
- // Search the language, get best language base on RFC 4647 matching algorithm.
- //
- Current = StringPtr;
- while (!GetBestLanguage ("en", PkgHeader->Language)) {
- Current += PkgHeader->Header.Length;
- PkgHeader = (EFI_HII_STRING_PACKAGE_HDR *) Current;
- //
- // If can't find string package base on language, just return the first string package.
- //
- if (Current - StringPtr >= Length) {
- Current = StringPtr;
- PkgHeader = (EFI_HII_STRING_PACKAGE_HDR *) StringPtr;
- break;
- }
- }
-
- Current += PkgHeader->HdrSize;
- //
- // Find the string block according the stringId.
- //
- Status = FindStringBlock(Current, StringId, &NameOffset, &BlockType);
- if (Status != EFI_SUCCESS) {
- delete StringPtr;
- return NULL;
- }
-
- //
- // Get varstore name according the string type.
- //
- switch (BlockType) {
- case EFI_HII_SIBT_STRING_SCSU:
- case EFI_HII_SIBT_STRING_SCSU_FONT:
- case EFI_HII_SIBT_STRINGS_SCSU:
- case EFI_HII_SIBT_STRINGS_SCSU_FONT:
- StringName = (CHAR8*)(Current + NameOffset);
- VarStoreName = new CHAR8[strlen(StringName) + 1];
- strcpy (VarStoreName, StringName);
- break;
- case EFI_HII_SIBT_STRING_UCS2:
- case EFI_HII_SIBT_STRING_UCS2_FONT:
- case EFI_HII_SIBT_STRINGS_UCS2:
- case EFI_HII_SIBT_STRINGS_UCS2_FONT:
- UnicodeString = (CHAR16*)(Current + NameOffset);
- Length = GetUnicodeStringTextSize ((UINT8*)UnicodeString) ;
- DestTmp = new CHAR8[Length / 2 + 1];
- VarStoreName = DestTmp;
- while (*UnicodeString != '\0') {
- *(DestTmp++) = (CHAR8) *(UnicodeString++);
- }
- *DestTmp = '\0';
- break;
- default:
- break;
- }
-
- delete StringPtr;
-
- return VarStoreName;
-}
-
-EFI_STATUS
-CVfrStringDB::FindStringBlock (
- IN UINT8 *StringData,
- IN EFI_STRING_ID StringId,
- OUT UINT32 *StringTextOffset,
- OUT UINT8 *BlockType
- )
-{
- UINT8 *BlockHdr;
- EFI_STRING_ID CurrentStringId;
- UINT32 BlockSize;
- UINT32 Index;
- UINT8 *StringTextPtr;
- UINT32 Offset;
- UINT16 StringCount;
- UINT16 SkipCount;
- UINT8 Length8;
- EFI_HII_SIBT_EXT2_BLOCK Ext2;
- UINT32 Length32;
- UINT32 StringSize;
-
- CurrentStringId = 1;
-
- //
- // Parse the string blocks to get the string text and font.
- //
- BlockHdr = StringData;
- BlockSize = 0;
- Offset = 0;
- while (*BlockHdr != EFI_HII_SIBT_END) {
- switch (*BlockHdr) {
- case EFI_HII_SIBT_STRING_SCSU:
- Offset = sizeof (EFI_HII_STRING_BLOCK);
- StringTextPtr = BlockHdr + Offset;
- BlockSize += Offset + strlen ((CHAR8 *) StringTextPtr) + 1;
- CurrentStringId++;
- break;
-
- case EFI_HII_SIBT_STRING_SCSU_FONT:
- Offset = sizeof (EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK) - sizeof (UINT8);
- StringTextPtr = BlockHdr + Offset;
- BlockSize += Offset + strlen ((CHAR8 *) StringTextPtr) + 1;
- CurrentStringId++;
- break;
-
- case EFI_HII_SIBT_STRINGS_SCSU:
- memcpy (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));
- StringTextPtr = BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_BLOCK) - sizeof (UINT8);
- BlockSize += StringTextPtr - BlockHdr;
-
- for (Index = 0; Index < StringCount; Index++) {
- BlockSize += strlen ((CHAR8 *) StringTextPtr) + 1;
- if (CurrentStringId == StringId) {
- *BlockType = *BlockHdr;
- *StringTextOffset = StringTextPtr - StringData;
- return EFI_SUCCESS;
- }
- StringTextPtr = StringTextPtr + strlen ((CHAR8 *) StringTextPtr) + 1;
- CurrentStringId++;
- }
- break;
-
- case EFI_HII_SIBT_STRINGS_SCSU_FONT:
- memcpy (
- &StringCount,
- BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),
- sizeof (UINT16)
- );
- StringTextPtr = BlockHdr + sizeof (EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK) - sizeof (UINT8);
- BlockSize += StringTextPtr - BlockHdr;
-
- for (Index = 0; Index < StringCount; Index++) {
- BlockSize += strlen ((CHAR8 *) StringTextPtr) + 1;
- if (CurrentStringId == StringId) {
- *BlockType = *BlockHdr;
- *StringTextOffset = StringTextPtr - StringData;
- return EFI_SUCCESS;
- }
- StringTextPtr = StringTextPtr + strlen ((CHAR8 *) StringTextPtr) + 1;
- CurrentStringId++;
- }
- break;
-
- case EFI_HII_SIBT_STRING_UCS2:
- Offset = sizeof (EFI_HII_STRING_BLOCK);
- StringTextPtr = BlockHdr + Offset;
- //
- // Use StringSize to store the size of the specified string, including the NULL
- // terminator.
- //
- StringSize = GetUnicodeStringTextSize (StringTextPtr);
- BlockSize += Offset + StringSize;
- CurrentStringId++;
- break;
-
- case EFI_HII_SIBT_STRING_UCS2_FONT:
- Offset = sizeof (EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK) - sizeof (CHAR16);
- StringTextPtr = BlockHdr + Offset;
- //
- // Use StrSize to store the size of the specified string, including the NULL
- // terminator.
- //
- StringSize = GetUnicodeStringTextSize (StringTextPtr);
- BlockSize += Offset + StringSize;
- CurrentStringId++;
- break;
-
- case EFI_HII_SIBT_STRINGS_UCS2:
- Offset = sizeof (EFI_HII_SIBT_STRINGS_UCS2_BLOCK) - sizeof (CHAR16);
- StringTextPtr = BlockHdr + Offset;
- BlockSize += Offset;
- memcpy (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));
- for (Index = 0; Index < StringCount; Index++) {
- StringSize = GetUnicodeStringTextSize (StringTextPtr);
- BlockSize += StringSize;
- if (CurrentStringId == StringId) {
- *BlockType = *BlockHdr;
- *StringTextOffset = StringTextPtr - StringData;
- return EFI_SUCCESS;
- }
- StringTextPtr = StringTextPtr + StringSize;
- CurrentStringId++;
- }
- break;
-
- case EFI_HII_SIBT_STRINGS_UCS2_FONT:
- Offset = sizeof (EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK) - sizeof (CHAR16);
- StringTextPtr = BlockHdr + Offset;
- BlockSize += Offset;
- memcpy (
- &StringCount,
- BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),
- sizeof (UINT16)
- );
- for (Index = 0; Index < StringCount; Index++) {
- StringSize = GetUnicodeStringTextSize (StringTextPtr);
- BlockSize += StringSize;
- if (CurrentStringId == StringId) {
- *BlockType = *BlockHdr;
- *StringTextOffset = StringTextPtr - StringData;
- return EFI_SUCCESS;
- }
- StringTextPtr = StringTextPtr + StringSize;
- CurrentStringId++;
- }
- break;
-
- case EFI_HII_SIBT_DUPLICATE:
- if (CurrentStringId == StringId) {
- //
- // Incoming StringId is an id of a duplicate string block.
- // Update the StringId to be the previous string block.
- // Go back to the header of string block to search.
- //
- memcpy (
- &StringId,
- BlockHdr + sizeof (EFI_HII_STRING_BLOCK),
- sizeof (EFI_STRING_ID)
- );
- CurrentStringId = 1;
- BlockSize = 0;
- } else {
- BlockSize += sizeof (EFI_HII_SIBT_DUPLICATE_BLOCK);
- CurrentStringId++;
- }
- break;
-
- case EFI_HII_SIBT_SKIP1:
- SkipCount = (UINT16) (*(BlockHdr + sizeof (EFI_HII_STRING_BLOCK)));
- CurrentStringId = (UINT16) (CurrentStringId + SkipCount);
- BlockSize += sizeof (EFI_HII_SIBT_SKIP1_BLOCK);
- break;
-
- case EFI_HII_SIBT_SKIP2:
- memcpy (&SkipCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), sizeof (UINT16));
- CurrentStringId = (UINT16) (CurrentStringId + SkipCount);
- BlockSize += sizeof (EFI_HII_SIBT_SKIP2_BLOCK);
- break;
-
- case EFI_HII_SIBT_EXT1:
- memcpy (
- &Length8,
- BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),
- sizeof (UINT8)
- );
- BlockSize += Length8;
- break;
-
- case EFI_HII_SIBT_EXT2:
- memcpy (&Ext2, BlockHdr, sizeof (EFI_HII_SIBT_EXT2_BLOCK));
- BlockSize += Ext2.Length;
- break;
-
- case EFI_HII_SIBT_EXT4:
- memcpy (
- &Length32,
- BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + sizeof (UINT8),
- sizeof (UINT32)
- );
-
- BlockSize += Length32;
- break;
-
- default:
- break;
- }
-
- if (StringId > 0 && StringId != (EFI_STRING_ID)(-1)) {
- *StringTextOffset = BlockHdr - StringData + Offset;
- *BlockType = *BlockHdr;
-
- if (StringId == CurrentStringId - 1) {
- //
- // if only one skip item, return EFI_NOT_FOUND.
- //
- if(*BlockType == EFI_HII_SIBT_SKIP2 || *BlockType == EFI_HII_SIBT_SKIP1) {
- return EFI_NOT_FOUND;
- } else {
- return EFI_SUCCESS;
- }
- }
-
- if (StringId < CurrentStringId - 1) {
- return EFI_NOT_FOUND;
- }
- }
- BlockHdr = StringData + BlockSize;
- }
-
- return EFI_NOT_FOUND;
-}
-
-UINT32
-CVfrStringDB::GetUnicodeStringTextSize (
- IN UINT8 *StringSrc
- )
-{
- UINT32 StringSize;
- CHAR16 *StringPtr;
-
- StringSize = sizeof (CHAR16);
- StringPtr = (UINT16*)StringSrc;
- while (*StringPtr++ != L'\0') {
- StringSize += sizeof (CHAR16);
- }
-
- return StringSize;
-}
-
-BOOLEAN VfrCompatibleMode = FALSE;
-
-CVfrVarDataTypeDB gCVfrVarDataTypeDB;
-
-
diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
deleted file mode 100644
index 2847a74a7b..0000000000
--- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
+++ /dev/null
@@ -1,464 +0,0 @@
-/** @file
-
- Vfr common library functions.
-
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _VFRUTILITYLIB_H_
-#define _VFRUTILITYLIB_H_
-
-#include "string.h"
-#include "Common/UefiBaseTypes.h"
-#include "EfiVfr.h"
-#include "VfrError.h"
-
-extern BOOLEAN VfrCompatibleMode;
-
-#define MAX_NAME_LEN 64
-#define MAX_STRING_LEN 0x100
-#define DEFAULT_ALIGN 1
-#define DEFAULT_PACK_ALIGN 0x8
-#define DEFAULT_NAME_TABLE_ITEMS 1024
-
-#define EFI_BITS_SHIFT_PER_UINT32 0x5
-#define EFI_BITS_PER_UINT32 (1 << EFI_BITS_SHIFT_PER_UINT32)
-
-#define BUFFER_SAFE_FREE(Buf) do { if ((Buf) != NULL) { delete (Buf); } } while (0);
-
-class CVfrBinaryOutput {
-public:
- virtual VOID WriteLine (IN FILE *, IN UINT32, IN CONST CHAR8 *, IN CHAR8 *, IN UINT32);
- virtual VOID WriteEnd (IN FILE *, IN UINT32, IN CONST CHAR8 *, IN CHAR8 *, IN UINT32);
-};
-
-UINT32
-_STR2U32 (
- IN CHAR8 *Str
- );
-
-struct SConfigInfo {
- UINT16 mOffset;
- UINT16 mWidth;
- UINT8 *mValue;
- SConfigInfo *mNext;
-
- SConfigInfo (IN UINT8, IN UINT16, IN UINT32, IN EFI_IFR_TYPE_VALUE);
- ~SConfigInfo (VOID);
-};
-
-struct SConfigItem {
- CHAR8 *mName; // varstore name
- EFI_GUID *mGuid; // varstore guid, varstore name + guid deside one varstore
- CHAR8 *mId; // default ID
- SConfigInfo *mInfoStrList; // list of Offset/Value in the varstore
- SConfigItem *mNext;
-
-public:
- SConfigItem (IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *);
- SConfigItem (IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *, IN UINT8, IN UINT16, IN UINT16, IN EFI_IFR_TYPE_VALUE);
- virtual ~SConfigItem ();
-};
-
-class CVfrBufferConfig {
-private:
- SConfigItem *mItemListHead;
- SConfigItem *mItemListTail;
- SConfigItem *mItemListPos;
-
-public:
- CVfrBufferConfig (VOID);
- virtual ~CVfrBufferConfig (VOID);
-
- virtual UINT8 Register (IN CHAR8 *, IN EFI_GUID *,IN CHAR8 *Info = NULL);
- virtual VOID Open (VOID);
- virtual BOOLEAN Eof(VOID);
- virtual UINT8 Select (IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *Info = NULL);
- virtual UINT8 Write (IN CONST CHAR8, IN CHAR8 *, IN EFI_GUID *, IN CHAR8 *, IN UINT8, IN UINT16, IN UINT32, IN EFI_IFR_TYPE_VALUE);
-#if 0
- virtual UINT8 Read (OUT CHAR8 **, OUT CHAR8 **, OUT CHAR8 **, OUT CHAR8 **, OUT CHAR8 **);
-#endif
- virtual VOID Close (VOID);
- virtual VOID OutputCFile (IN FILE *, IN CHAR8 *);
-};
-
-extern CVfrBufferConfig gCVfrBufferConfig;
-
-#define ALIGN_STUFF(Size, Align) ((Align) - (Size) % (Align))
-#define INVALID_ARRAY_INDEX 0xFFFFFFFF
-
-struct SVfrDataType;
-
-struct SVfrDataField {
- CHAR8 mFieldName[MAX_NAME_LEN];
- SVfrDataType *mFieldType;
- UINT32 mOffset;
- UINT32 mArrayNum;
- SVfrDataField *mNext;
-};
-
-struct SVfrDataType {
- CHAR8 mTypeName[MAX_NAME_LEN];
- UINT8 mType;
- UINT32 mAlign;
- UINT32 mTotalSize;
- SVfrDataField *mMembers;
- SVfrDataType *mNext;
-};
-
-#define VFR_PACK_ASSIGN 0x01
-#define VFR_PACK_SHOW 0x02
-#define VFR_PACK_PUSH 0x04
-#define VFR_PACK_POP 0x08
-
-#define PACKSTACK_MAX_SIZE 0x400
-
-struct SVfrPackStackNode {
- CHAR8 *mIdentifier;
- UINT32 mNumber;
- SVfrPackStackNode *mNext;
-
- SVfrPackStackNode (IN CHAR8 *Identifier, IN UINT32 Number) {
- mIdentifier = NULL;
- mNumber = Number;
- mNext = NULL;
-
- if (Identifier != NULL) {
- mIdentifier = new CHAR8[strlen (Identifier) + 1];
- strcpy (mIdentifier, Identifier);
- }
- }
-
- ~SVfrPackStackNode (VOID) {
- if (mIdentifier != NULL) {
- delete mIdentifier;
- }
- mNext = NULL;
- }
-
- bool Match (IN CHAR8 *Identifier) {
- if (Identifier == NULL) {
- return TRUE;
- } else if (mIdentifier == NULL) {
- return FALSE;
- } else if (strcmp (Identifier, mIdentifier) == 0) {
- return TRUE;
- } else {
- return FALSE;
- }
- }
-};
-
-class CVfrVarDataTypeDB {
-private:
- UINT32 mPackAlign;
- SVfrPackStackNode *mPackStack;
-
-public:
- EFI_VFR_RETURN_CODE Pack (IN UINT32, IN UINT8, IN CHAR8 *Identifier = NULL, IN UINT32 Number = DEFAULT_PACK_ALIGN);
-
-private:
- SVfrDataType *mDataTypeList;
-
- SVfrDataType *mNewDataType;
- SVfrDataType *mCurrDataType;
- SVfrDataField *mCurrDataField;
-
- VOID InternalTypesListInit (VOID);
- VOID RegisterNewType (IN SVfrDataType *);
-
- EFI_VFR_RETURN_CODE ExtractStructTypeName (IN CHAR8 *&, OUT CHAR8 *);
- EFI_VFR_RETURN_CODE GetTypeField (IN CONST CHAR8 *, IN SVfrDataType *, IN SVfrDataField *&);
- EFI_VFR_RETURN_CODE GetFieldOffset (IN SVfrDataField *, IN UINT32, OUT UINT32 &);
- UINT8 GetFieldWidth (IN SVfrDataField *);
- UINT32 GetFieldSize (IN SVfrDataField *, IN UINT32);
-
-public:
- CVfrVarDataTypeDB (VOID);
- ~CVfrVarDataTypeDB (VOID);
-
- VOID DeclareDataTypeBegin (VOID);
- EFI_VFR_RETURN_CODE SetNewTypeName (IN CHAR8 *);
- EFI_VFR_RETURN_CODE DataTypeAddField (IN CHAR8 *, IN CHAR8 *, IN UINT32);
- VOID DeclareDataTypeEnd (VOID);
-
- EFI_VFR_RETURN_CODE GetDataType (IN CHAR8 *, OUT SVfrDataType **);
- EFI_VFR_RETURN_CODE GetDataTypeSize (IN CHAR8 *, OUT UINT32 *);
- EFI_VFR_RETURN_CODE GetDataTypeSize (IN UINT8, OUT UINT32 *);
- EFI_VFR_RETURN_CODE GetDataFieldInfo (IN CHAR8 *, OUT UINT16 &, OUT UINT8 &, OUT UINT32 &);
-
- EFI_VFR_RETURN_CODE GetUserDefinedTypeNameList (OUT CHAR8 ***, OUT UINT32 *);
- EFI_VFR_RETURN_CODE ExtractFieldNameAndArrary (IN CHAR8 *&, OUT CHAR8 *, OUT UINT32 &);
-
- BOOLEAN IsTypeNameDefined (IN CHAR8 *);
-
- VOID Dump(IN FILE *);
- //
- // First the declared
- //
- CHAR8 *mFirstNewDataTypeName;
-#ifdef CVFR_VARDATATYPEDB_DEBUG
- VOID ParserDB ();
-#endif
-};
-
-extern CVfrVarDataTypeDB gCVfrVarDataTypeDB;
-
-typedef enum {
- EFI_VFR_VARSTORE_INVALID,
- EFI_VFR_VARSTORE_BUFFER,
- EFI_VFR_VARSTORE_EFI,
- EFI_VFR_VARSTORE_NAME
-} EFI_VFR_VARSTORE_TYPE;
-
-struct SVfrVarStorageNode {
- EFI_GUID mGuid;
- CHAR8 *mVarStoreName;
- EFI_VARSTORE_ID mVarStoreId;
- BOOLEAN mAssignedFlag; //Create varstore opcode
- struct SVfrVarStorageNode *mNext;
-
- EFI_VFR_VARSTORE_TYPE mVarStoreType;
- union {
- // EFI Variable
- struct {
- EFI_STRING_ID mEfiVarName;
- UINT32 mEfiVarSize;
- } mEfiVar;
-
- // Buffer Storage
- SVfrDataType *mDataType;
-
- // NameValue Storage
- struct {
- EFI_STRING_ID *mNameTable;
- UINT32 mTableSize;
- } mNameSpace;
- } mStorageInfo;
-
-public:
- SVfrVarStorageNode (IN EFI_GUID *, IN CHAR8 *, IN EFI_VARSTORE_ID, IN EFI_STRING_ID, IN UINT32, IN BOOLEAN Flag = TRUE);
- SVfrVarStorageNode (IN EFI_GUID *, IN CHAR8 *, IN EFI_VARSTORE_ID, IN SVfrDataType *, IN BOOLEAN Flag = TRUE);
- SVfrVarStorageNode (IN CHAR8 *, IN EFI_VARSTORE_ID);
- ~SVfrVarStorageNode (VOID);
-};
-
-struct EFI_VARSTORE_INFO {
- EFI_VARSTORE_ID mVarStoreId;
- union {
- EFI_STRING_ID mVarName;
- UINT16 mVarOffset;
- } mInfo;
- UINT8 mVarType;
- UINT32 mVarTotalSize;
-
- EFI_VARSTORE_INFO (VOID);
- EFI_VARSTORE_INFO (IN EFI_VARSTORE_INFO &);
- BOOLEAN operator == (IN EFI_VARSTORE_INFO *);
-};
-
-#define EFI_VARSTORE_ID_MAX 0xFFFF
-#define EFI_FREE_VARSTORE_ID_BITMAP_SIZE ((EFI_VARSTORE_ID_MAX + 1) / EFI_BITS_PER_UINT32)
-
-class CVfrDataStorage {
-private:
- UINT32 mFreeVarStoreIdBitMap[EFI_FREE_VARSTORE_ID_BITMAP_SIZE];
-
- struct SVfrVarStorageNode *mBufferVarStoreList;
- struct SVfrVarStorageNode *mEfiVarStoreList;
- struct SVfrVarStorageNode *mNameVarStoreList;
-
- struct SVfrVarStorageNode *mCurrVarStorageNode;
- struct SVfrVarStorageNode *mNewVarStorageNode;
-
-private:
-
- EFI_VARSTORE_ID GetFreeVarStoreId (EFI_VFR_VARSTORE_TYPE VarType = EFI_VFR_VARSTORE_BUFFER);
- BOOLEAN ChekVarStoreIdFree (IN EFI_VARSTORE_ID);
- VOID MarkVarStoreIdUsed (IN EFI_VARSTORE_ID);
- VOID MarkVarStoreIdUnused (IN EFI_VARSTORE_ID);
- EFI_VARSTORE_ID CheckGuidField (IN SVfrVarStorageNode *,
- IN EFI_GUID *,
- IN BOOLEAN *,
- OUT EFI_VFR_RETURN_CODE *);
-
-public:
- CVfrDataStorage ();
- ~CVfrDataStorage ();
-
- SVfrVarStorageNode * GetBufferVarStoreList () {
- return mBufferVarStoreList;
- }
- SVfrVarStorageNode * GetEfiVarStoreList () {
- return mEfiVarStoreList;
- }
- EFI_VFR_RETURN_CODE DeclareNameVarStoreBegin (CHAR8 *);
- EFI_VFR_RETURN_CODE NameTableAddItem (EFI_STRING_ID);
- EFI_VFR_RETURN_CODE DeclareNameVarStoreEnd (EFI_GUID *);
-
- EFI_VFR_RETURN_CODE DeclareEfiVarStore (IN CHAR8 *, IN EFI_GUID *, IN EFI_STRING_ID, IN UINT32, IN BOOLEAN Flag = TRUE);
-
- EFI_VFR_RETURN_CODE DeclareBufferVarStore (IN CHAR8 *, IN EFI_GUID *, IN CVfrVarDataTypeDB *, IN CHAR8 *, IN EFI_VARSTORE_ID, IN BOOLEAN Flag = TRUE);
-
- EFI_VFR_RETURN_CODE GetVarStoreId (IN CHAR8 *, OUT EFI_VARSTORE_ID *, IN EFI_GUID *VarGuid = NULL);
- EFI_VFR_VARSTORE_TYPE GetVarStoreType (IN EFI_VARSTORE_ID);
- EFI_GUID * GetVarStoreGuid (IN EFI_VARSTORE_ID);
- EFI_VFR_RETURN_CODE GetVarStoreName (IN EFI_VARSTORE_ID, OUT CHAR8 **);
- EFI_VFR_RETURN_CODE GetVarStoreByDataType (IN CHAR8 *, OUT SVfrVarStorageNode **, IN EFI_GUID *VarGuid = NULL);
-
- EFI_VFR_RETURN_CODE GetBufferVarStoreDataTypeName (IN EFI_VARSTORE_ID, OUT CHAR8 **);
- EFI_VFR_RETURN_CODE GetEfiVarStoreInfo (IN EFI_VARSTORE_INFO *);
- EFI_VFR_RETURN_CODE GetNameVarStoreInfo (IN EFI_VARSTORE_INFO *, IN UINT32);
-};
-
-#define EFI_QUESTION_ID_MAX 0xFFFF
-#define EFI_FREE_QUESTION_ID_BITMAP_SIZE ((EFI_QUESTION_ID_MAX + 1) / EFI_BITS_PER_UINT32)
-#define EFI_QUESTION_ID_INVALID 0x0
-
-#define DATE_YEAR_BITMASK 0x0000FFFF
-#define DATE_MONTH_BITMASK 0x00FF0000
-#define DATE_DAY_BITMASK 0xFF000000
-#define TIME_HOUR_BITMASK 0x000000FF
-#define TIME_MINUTE_BITMASK 0x0000FF00
-#define TIME_SECOND_BITMASK 0x00FF0000
-
-struct SVfrQuestionNode {
- CHAR8 *mName;
- CHAR8 *mVarIdStr;
- EFI_QUESTION_ID mQuestionId;
- UINT32 mBitMask;
- SVfrQuestionNode *mNext;
- EFI_QUESION_TYPE mQtype;
-
- SVfrQuestionNode (IN CHAR8 *, IN CHAR8 *, IN UINT32 BitMask = 0);
- ~SVfrQuestionNode ();
-};
-
-class CVfrQuestionDB {
-private:
- SVfrQuestionNode *mQuestionList;
- UINT32 mFreeQIdBitMap[EFI_FREE_QUESTION_ID_BITMAP_SIZE];
-
-private:
- EFI_QUESTION_ID GetFreeQuestionId (VOID);
- BOOLEAN ChekQuestionIdFree (IN EFI_QUESTION_ID);
- VOID MarkQuestionIdUsed (IN EFI_QUESTION_ID);
- VOID MarkQuestionIdUnused (IN EFI_QUESTION_ID);
-
-public:
- CVfrQuestionDB ();
- ~CVfrQuestionDB();
-
- EFI_VFR_RETURN_CODE RegisterQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
- VOID RegisterOldDateQuestion (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
- VOID RegisterNewDateQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
- VOID RegisterOldTimeQuestion (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
- VOID RegisterNewTimeQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
- VOID RegisterRefQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
- EFI_VFR_RETURN_CODE UpdateQuestionId (IN EFI_QUESTION_ID, IN EFI_QUESTION_ID);
- VOID GetQuestionId (IN CHAR8 *, IN CHAR8 *, OUT EFI_QUESTION_ID &, OUT UINT32 &, OUT EFI_QUESION_TYPE *QType = NULL);
- EFI_VFR_RETURN_CODE FindQuestion (IN EFI_QUESTION_ID);
- EFI_VFR_RETURN_CODE FindQuestion (IN CHAR8 *);
- VOID PrintAllQuestion (IN VOID);
- VOID ResetInit (IN VOID);
-
- VOID SetCompatibleMode (IN BOOLEAN Mode) {
- VfrCompatibleMode = Mode;
- }
-};
-
-struct SVfrDefaultStoreNode {
- EFI_IFR_DEFAULTSTORE *mObjBinAddr;
- CHAR8 *mRefName;
- EFI_STRING_ID mDefaultStoreNameId;
- UINT16 mDefaultId;
-
- SVfrDefaultStoreNode *mNext;
-
- SVfrDefaultStoreNode (IN EFI_IFR_DEFAULTSTORE *, IN CHAR8 *, IN EFI_STRING_ID, IN UINT16);
- ~SVfrDefaultStoreNode();
-};
-
-class CVfrDefaultStore {
-private:
- SVfrDefaultStoreNode *mDefaultStoreList;
-
-public:
- CVfrDefaultStore ();
- ~CVfrDefaultStore ();
-
- EFI_VFR_RETURN_CODE RegisterDefaultStore (IN CHAR8 *, IN CHAR8 *, IN EFI_STRING_ID, IN UINT16);
- EFI_VFR_RETURN_CODE ReRegisterDefaultStoreById (IN UINT16, IN CHAR8 *, IN EFI_STRING_ID);
- BOOLEAN DefaultIdRegistered (IN UINT16);
- EFI_VFR_RETURN_CODE GetDefaultId (IN CHAR8 *, OUT UINT16 *);
- EFI_VFR_RETURN_CODE BufferVarStoreAltConfigAdd (IN EFI_VARSTORE_ID, IN EFI_VARSTORE_INFO &, IN CHAR8 *, IN EFI_GUID *, IN UINT8, IN EFI_IFR_TYPE_VALUE);
-};
-
-#define EFI_RULE_ID_START 0x01
-#define EFI_RULE_ID_INVALID 0x00
-
-struct SVfrRuleNode {
- UINT8 mRuleId;
- CHAR8 *mRuleName;
- SVfrRuleNode *mNext;
-
- SVfrRuleNode(IN CHAR8 *, IN UINT8);
- ~SVfrRuleNode();
-};
-
-class CVfrRulesDB {
-private:
- SVfrRuleNode *mRuleList;
- UINT8 mFreeRuleId;
-
-public:
- CVfrRulesDB ();
- ~CVfrRulesDB();
-
- VOID RegisterRule (IN CHAR8 *);
- UINT8 GetRuleId (IN CHAR8 *);
-};
-
-class CVfrStringDB {
-private:
- CHAR8 *mStringFileName;
-
- EFI_STATUS FindStringBlock (
- IN UINT8 *StringData,
- IN EFI_STRING_ID StringId,
- OUT UINT32 *StringTextOffset,
- OUT UINT8 *BlockType
- );
-
- UINT32 GetUnicodeStringTextSize (
- IN UINT8 *StringSrc
- );
-
- BOOLEAN GetBestLanguage (
- IN CONST CHAR8 *SupportedLanguages,
- IN CHAR8 *Language
- );
-
-public:
- CVfrStringDB ();
- ~CVfrStringDB ();
-
- VOID SetStringFileName (
- IN CHAR8 *StringFileName
- );
-
- CHAR8 * GetVarStoreNameFormStringId (
- IN EFI_STRING_ID StringId
- );
-
-};
-
-#endif
diff --git a/BaseTools/Source/C/VolInfo/GNUmakefile b/BaseTools/Source/C/VolInfo/GNUmakefile
deleted file mode 100644
index d5f115abed..0000000000
--- a/BaseTools/Source/C/VolInfo/GNUmakefile
+++ /dev/null
@@ -1,24 +0,0 @@
-## @file
-# GNU/Linux makefile for 'VolInfo' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-ARCH ?= IA32
-MAKEROOT ?= ..
-
-APPNAME = VolInfo
-
-OBJECTS = VolInfo.o
-
-include $(MAKEROOT)/Makefiles/app.makefile
-
-LIBS = -lCommon
-
-
diff --git a/BaseTools/Source/C/VolInfo/Makefile b/BaseTools/Source/C/VolInfo/Makefile
deleted file mode 100644
index 4cee93a869..0000000000
--- a/BaseTools/Source/C/VolInfo/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-## @file
-# Windows makefile for 'VolInfo' module build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-!INCLUDE ..\Makefiles\ms.common
-
-APPNAME = VolInfo
-
-LIBS = $(LIB_PATH)\Common.lib
-
-OBJECTS = VolInfo.obj
-
-!INCLUDE ..\Makefiles\ms.app
-
diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c
deleted file mode 100644
index 7d127e1691..0000000000
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ /dev/null
@@ -1,1826 +0,0 @@
-/** @file
-
-Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- VolInfo.c
-
-Abstract:
-
- The tool dumps the contents of a firmware volume
-
-**/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include <FvLib.h>
-#include <Common/UefiBaseTypes.h>
-#include <Common/UefiCapsule.h>
-#include <Common/PiFirmwareFile.h>
-#include <Common/PiFirmwareVolume.h>
-#include <Guid/PiFirmwareFileSystem.h>
-#include <IndustryStandard/PeImage.h>
-#include <Protocol/GuidedSectionExtraction.h>
-
-#include "Compress.h"
-#include "Decompress.h"
-#include "VolInfo.h"
-#include "CommonLib.h"
-#include "EfiUtilityMsgs.h"
-#include "FirmwareVolumeBufferLib.h"
-#include "OsPath.h"
-#include "ParseGuidedSectionTools.h"
-#include "StringFuncs.h"
-
-//
-// Utility global variables
-//
-
-EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid = EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID;
-
-#define UTILITY_MAJOR_VERSION 0
-#define UTILITY_MINOR_VERSION 82
-
-#define UTILITY_NAME "VolInfo"
-
-#define EFI_SECTION_ERROR EFIERR (100)
-
-#define MAX_BASENAME_LEN 60 // not good to hardcode, but let's be reasonable
-
-//
-// Structure to keep a list of guid-to-basenames
-//
-typedef struct _GUID_TO_BASENAME {
- struct _GUID_TO_BASENAME *Next;
- INT8 Guid[PRINTED_GUID_BUFFER_SIZE];
- INT8 BaseName[MAX_BASENAME_LEN];
-} GUID_TO_BASENAME;
-
-static GUID_TO_BASENAME *mGuidBaseNameList = NULL;
-
-//
-// Store GUIDed Section guid->tool mapping
-//
-EFI_HANDLE mParsedGuidedSectionTools = NULL;
-
-CHAR8* mUtilityFilename = NULL;
-
-EFI_STATUS
-ParseGuidBaseNameFile (
- CHAR8 *FileName
- );
-
-EFI_STATUS
-FreeGuidBaseNameList (
- VOID
- );
-
-EFI_STATUS
-PrintGuidName (
- IN UINT8 *GuidStr
- );
-
-EFI_STATUS
-ParseSection (
- IN UINT8 *SectionBuffer,
- IN UINT32 BufferLength
- );
-
-EFI_STATUS
-DumpDepexSection (
- IN UINT8 *Ptr,
- IN UINT32 SectionLength
- );
-
-STATIC
-EFI_STATUS
-ReadHeader (
- IN FILE *InputFile,
- OUT UINT32 *FvSize,
- OUT BOOLEAN *ErasePolarity
- );
-
-STATIC
-EFI_STATUS
-PrintFileInfo (
- EFI_FIRMWARE_VOLUME_HEADER *FvImage,
- EFI_FFS_FILE_HEADER *FileHeader,
- BOOLEAN ErasePolarity
- );
-
-static
-EFI_STATUS
-PrintFvInfo (
- IN VOID *Fv,
- IN BOOLEAN IsChildFv
- );
-
-static
-VOID
-LoadGuidedSectionToolsTxt (
- IN CHAR8* FirmwareVolumeFilename
- );
-
-void
-Usage (
- VOID
- );
-
-int
-main (
- int argc,
- char *argv[]
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- argc - GC_TODO: add argument description
- ] - GC_TODO: add argument description
-
-Returns:
-
- GC_TODO: add return values
-
---*/
-{
- FILE *InputFile;
- int BytesRead;
- EFI_FIRMWARE_VOLUME_HEADER *FvImage;
- UINT32 FvSize;
- EFI_STATUS Status;
- int Offset;
- BOOLEAN ErasePolarity;
-
- SetUtilityName (UTILITY_NAME);
- //
- // Print utility header
- //
- printf ("%s Tiano Firmware Volume FFS image info. Version %d.%d %s, %s\n",
- UTILITY_NAME,
- UTILITY_MAJOR_VERSION,
- UTILITY_MINOR_VERSION,
- __BUILD_VERSION,
- __DATE__
- );
-
- //
- // Save, and then skip filename arg
- //
- mUtilityFilename = argv[0];
- argc--;
- argv++;
-
- Offset = 0;
-
- //
- // If they specified -x xref guid/basename cross-reference files, process it.
- // This will print the basename beside each file guid. To use it, specify
- // -x xref_filename to processdsc, then use xref_filename as a parameter
- // here.
- //
- while (argc > 2) {
- if ((strcmp(argv[0], "-x") == 0) || (strcmp(argv[0], "--xref") == 0)) {
- ParseGuidBaseNameFile (argv[1]);
- printf("ParseGuidBaseNameFile: %s\n", argv[1]);
- argc -= 2;
- argv += 2;
- } else if (strcmp(argv[0], "--offset") == 0) {
- //
- // Hex or decimal?
- //
- if ((argv[1][0] == '0') && (tolower ((int)argv[1][1]) == 'x')) {
- if (sscanf (argv[1], "%x", &Offset) != 1) {
- Error (NULL, 0, 1003, "Invalid option value", "Offset = %s", argv[1]);
- return GetUtilityStatus ();
- }
- } else {
- if (sscanf (argv[1], "%d", &Offset) != 1) {
- Error (NULL, 0, 1003, "Invalid option value", "Offset = %s", argv[1]);
- return GetUtilityStatus ();
- }
- //
- // See if they said something like "64K"
- //
- if (tolower ((int)argv[1][strlen (argv[1]) - 1]) == 'k') {
- Offset *= 1024;
- }
- }
-
- argc -= 2;
- argv += 2;
- } else {
- Usage ();
- return -1;
- }
- }
- //
- // Check for proper number of arguments
- //
- if (argc != 1) {
- Usage ();
- return -1;
- }
- //
- // Look for help options
- //
- if ((strcmp(argv[0], "-h") == 0) || (strcmp(argv[0], "--help") == 0) ||
- (strcmp(argv[0], "-?") == 0) || (strcmp(argv[0], "/?") == 0)) {
- Usage();
- return STATUS_ERROR;
- }
-
- //
- // Open the file containing the FV
- //
- InputFile = fopen (argv[0], "rb");
- if (InputFile == NULL) {
- Error (NULL, 0, 0001, "Error opening the input file", argv[0]);
- return GetUtilityStatus ();
- }
- //
- // Skip over pad bytes if specified. This is used if they prepend 0xff
- // data to the FV image binary.
- //
- if (Offset != 0) {
- fseek (InputFile, Offset, SEEK_SET);
- }
- //
- // Determine size of FV
- //
- Status = ReadHeader (InputFile, &FvSize, &ErasePolarity);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "error parsing FV image", "%s Header is invalid", argv[0]);
- fclose (InputFile);
- return GetUtilityStatus ();
- }
- //
- // Allocate a buffer for the FV image
- //
- FvImage = malloc (FvSize);
- if (FvImage == NULL) {
- Error (NULL, 0, 4001, "Resource: Memory can't be allocated", NULL);
- fclose (InputFile);
- return GetUtilityStatus ();
- }
- //
- // Seek to the start of the image, then read the entire FV to the buffer
- //
- fseek (InputFile, Offset, SEEK_SET);
- BytesRead = fread (FvImage, 1, FvSize, InputFile);
- fclose (InputFile);
- if ((unsigned int) BytesRead != FvSize) {
- Error (NULL, 0, 0004, "error reading FvImage from", argv[0]);
- free (FvImage);
- return GetUtilityStatus ();
- }
-
- LoadGuidedSectionToolsTxt (argv[0]);
-
- PrintFvInfo (FvImage, FALSE);
-
- //
- // Clean up
- //
- free (FvImage);
- FreeGuidBaseNameList ();
- return GetUtilityStatus ();
-}
-
-
-static
-EFI_STATUS
-PrintFvInfo (
- IN VOID *Fv,
- IN BOOLEAN IsChildFv
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- Fv - Firmware Volume to print information about
- IsChildFv - Flag specifies whether the input FV is a child FV.
-
-Returns:
-
- EFI_STATUS
-
---*/
-{
- EFI_STATUS Status;
- UINTN NumberOfFiles;
- BOOLEAN ErasePolarity;
- UINTN FvSize;
- EFI_FFS_FILE_HEADER *CurrentFile;
- UINTN Key;
-
- Status = FvBufGetSize (Fv, &FvSize);
-
- NumberOfFiles = 0;
- ErasePolarity =
- (((EFI_FIRMWARE_VOLUME_HEADER*)Fv)->Attributes & EFI_FVB2_ERASE_POLARITY) ?
- TRUE : FALSE;
-
- //
- // Get the first file
- //
- Key = 0;
- Status = FvBufFindNextFile (Fv, &Key, (VOID **) &CurrentFile);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "error parsing FV image", "cannot find the first file in the FV image");
- return GetUtilityStatus ();
- }
- //
- // Display information about files found
- //
- while (CurrentFile != NULL) {
- //
- // Increment the number of files counter
- //
- NumberOfFiles++;
-
- //
- // Display info about this file
- //
- Status = PrintFileInfo (Fv, CurrentFile, ErasePolarity);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "error parsing FV image", "failed to parse a file in the FV");
- return GetUtilityStatus ();
- }
- //
- // Get the next file
- //
- Status = FvBufFindNextFile (Fv, &Key, (VOID **) &CurrentFile);
- if (Status == EFI_NOT_FOUND) {
- CurrentFile = NULL;
- } else if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "error parsing FV image", "cannot find the next file in the FV image");
- return GetUtilityStatus ();
- }
- }
-
- if (IsChildFv) {
- printf ("There are a total of %d files in the child FV\n", (int) NumberOfFiles);
- } else {
- printf ("There are a total of %d files in this FV\n", (int) NumberOfFiles);
- }
-
- return EFI_SUCCESS;
-}
-
-UINT32
-GetOccupiedSize (
- IN UINT32 ActualSize,
- IN UINT32 Alignment
- )
-/*++
-
-Routine Description:
-
- This function returns the next larger size that meets the alignment
- requirement specified.
-
-Arguments:
-
- ActualSize The size.
- Alignment The desired alignment.
-
-Returns:
-
- EFI_SUCCESS Function completed successfully.
- EFI_ABORTED The function encountered an error.
-
---*/
-{
- UINT32 OccupiedSize;
-
- OccupiedSize = ActualSize;
- while ((OccupiedSize & (Alignment - 1)) != 0) {
- OccupiedSize++;
- }
-
- return OccupiedSize;
-}
-
-static
-CHAR8 *
-SectionNameToStr (
- IN EFI_SECTION_TYPE Type
- )
-/*++
-
-Routine Description:
-
- Converts EFI Section names to Strings
-
-Arguments:
-
- Type - The EFI Section type
-
-Returns:
-
- CHAR8* - Pointer to the String containing the section name.
-
---*/
-{
- CHAR8 *SectionStr;
- CHAR8 *SectionTypeStringTable[] = {
- //
- // 0X00
- //
- "EFI_SECTION_ALL",
- //
- // 0x01
- //
- "EFI_SECTION_COMPRESSION",
- //
- // 0x02
- //
- "EFI_SECTION_GUID_DEFINED",
- //
- // 0x03
- //
- "Unknown section type - Reserved 0x03",
- //
- // 0x04
- //
- "Unknown section type - Reserved 0x04",
- //
- // 0x05
- //
- "Unknown section type - Reserved 0x05",
- //
- // 0x06
- //
- "Unknown section type - Reserved 0x06",
- //
- // 0x07
- //
- "Unknown section type - Reserved 0x07",
- //
- // 0x08
- //
- "Unknown section type - Reserved 0x08",
- //
- // 0x09
- //
- "Unknown section type - Reserved 0x09",
- //
- // 0x0A
- //
- "Unknown section type - Reserved 0x0A",
- //
- // 0x0B
- //
- "Unknown section type - Reserved 0x0B",
- //
- // 0x0C
- //
- "Unknown section type - Reserved 0x0C",
- //
- // 0x0D
- //
- "Unknown section type - Reserved 0x0D",
- //
- // 0x0E
- //
- "Unknown section type - Reserved 0x0E",
- //
- // 0x0F
- //
- "Unknown section type - Reserved 0x0E",
- //
- // 0x10
- //
- "EFI_SECTION_PE32",
- //
- // 0x11
- //
- "EFI_SECTION_PIC",
- //
- // 0x12
- //
- "EFI_SECTION_TE",
- //
- // 0x13
- //
- "EFI_SECTION_DXE_DEPEX",
- //
- // 0x14
- //
- "EFI_SECTION_VERSION",
- //
- // 0x15
- //
- "EFI_SECTION_USER_INTERFACE",
- //
- // 0x16
- //
- "EFI_SECTION_COMPATIBILITY16",
- //
- // 0x17
- //
- "EFI_SECTION_FIRMWARE_VOLUME_IMAGE ",
- //
- // 0x18
- //
- "EFI_SECTION_FREEFORM_SUBTYPE_GUID ",
- //
- // 0x19
- //
- "EFI_SECTION_RAW",
- //
- // 0x1A
- //
- "Unknown section type - 0x1A",
- //
- // 0x1B
- //
- "EFI_SECTION_PEI_DEPEX",
- //
- // 0x1C
- //
- "EFI_SECTION_SMM_DEPEX",
- //
- // 0x1C+
- //
- "Unknown section type - Reserved - beyond last defined section"
- };
-
- if (Type > EFI_SECTION_LAST_SECTION_TYPE) {
- Type = EFI_SECTION_LAST_SECTION_TYPE + 1;
- }
-
- SectionStr = malloc (100);
- if (SectionStr == NULL) {
- printf ("Error: Out of memory resources.\n");
- return SectionStr;
- }
- strcpy (SectionStr, SectionTypeStringTable[Type]);
- return SectionStr;
-}
-
-STATIC
-EFI_STATUS
-ReadHeader (
- IN FILE *InputFile,
- OUT UINT32 *FvSize,
- OUT BOOLEAN *ErasePolarity
- )
-/*++
-
-Routine Description:
-
- This function determines the size of the FV and the erase polarity. The
- erase polarity is the FALSE value for file state.
-
-Arguments:
-
- InputFile The file that contains the FV image.
- FvSize The size of the FV.
- ErasePolarity The FV erase polarity.
-
-Returns:
-
- EFI_SUCCESS Function completed successfully.
- EFI_INVALID_PARAMETER A required parameter was NULL or is out of range.
- EFI_ABORTED The function encountered an error.
-
---*/
-{
- EFI_FIRMWARE_VOLUME_HEADER VolumeHeader;
- EFI_FV_BLOCK_MAP_ENTRY BlockMap;
- UINTN Signature[2];
- UINTN BytesRead;
- UINT32 Size;
-
- BytesRead = 0;
- Size = 0;
- //
- // Check input parameters
- //
- if (InputFile == NULL || FvSize == NULL || ErasePolarity == NULL) {
- Error (__FILE__, __LINE__, 0, "application error", "invalid parameter to function");
- return EFI_INVALID_PARAMETER;
- }
- //
- // Read the header
- //
- fread (&VolumeHeader, sizeof (EFI_FIRMWARE_VOLUME_HEADER) - sizeof (EFI_FV_BLOCK_MAP_ENTRY), 1, InputFile);
- BytesRead = sizeof (EFI_FIRMWARE_VOLUME_HEADER) - sizeof (EFI_FV_BLOCK_MAP_ENTRY);
- Signature[0] = VolumeHeader.Signature;
- Signature[1] = 0;
-
- //
- // Print FV header information
- //
- printf ("Signature: %s (%X)\n", (char *) Signature, (unsigned) VolumeHeader.Signature);
- printf ("Attributes: %X\n", (unsigned) VolumeHeader.Attributes);
-
- if (VolumeHeader.Attributes & EFI_FVB2_READ_DISABLED_CAP) {
- printf (" EFI_FVB2_READ_DISABLED_CAP\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_READ_ENABLED_CAP) {
- printf (" EFI_FVB2_READ_ENABLED_CAP\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_READ_STATUS) {
- printf (" EFI_FVB2_READ_STATUS\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_WRITE_DISABLED_CAP) {
- printf (" EFI_FVB2_WRITE_DISABLED_CAP\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_WRITE_ENABLED_CAP) {
- printf (" EFI_FVB2_WRITE_ENABLED_CAP\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_WRITE_STATUS) {
- printf (" EFI_FVB2_WRITE_STATUS\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_LOCK_CAP) {
- printf (" EFI_FVB2_LOCK_CAP\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_LOCK_STATUS) {
- printf (" EFI_FVB2_LOCK_STATUS\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_STICKY_WRITE) {
- printf (" EFI_FVB2_STICKY_WRITE\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_MEMORY_MAPPED) {
- printf (" EFI_FVB2_MEMORY_MAPPED\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ERASE_POLARITY) {
- printf (" EFI_FVB2_ERASE_POLARITY\n");
- *ErasePolarity = TRUE;
- }
-
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT) {
- printf (" EFI_FVB2_ALIGNMENT\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2) {
- printf (" EFI_FVB2_ALIGNMENT_2\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4) {
- printf (" EFI_FVB2_ALIGNMENT_4\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8) {
- printf (" EFI_FVB2_ALIGNMENT_8\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16) {
- printf (" EFI_FVB2_ALIGNMENT_16\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32) {
- printf (" EFI_FVB2_ALIGNMENT_32\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64) {
- printf (" EFI_FVB2_ALIGNMENT_64\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128) {
- printf (" EFI_FVB2_ALIGNMENT_128\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256) {
- printf (" EFI_FVB2_ALIGNMENT_256\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512) {
- printf (" EFI_FVB2_ALIGNMENT_512\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1K) {
- printf (" EFI_FVB2_ALIGNMENT_1K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2K) {
- printf (" EFI_FVB2_ALIGNMENT_2K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4K) {
- printf (" EFI_FVB2_ALIGNMENT_4K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8K) {
- printf (" EFI_FVB2_ALIGNMENT_8K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16K) {
- printf (" EFI_FVB2_ALIGNMENT_16K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32K) {
- printf (" EFI_FVB2_ALIGNMENT_32K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64K) {
- printf (" EFI_FVB2_ALIGNMENT_64K\n");
- }
-
-#else
-
- if (VolumeHeader.Attributes & EFI_FVB2_READ_LOCK_CAP) {
- printf (" EFI_FVB2_READ_LOCK_CAP\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_READ_LOCK_STATUS) {
- printf (" EFI_FVB2_READ_LOCK_STATUS\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_WRITE_LOCK_CAP) {
- printf (" EFI_FVB2_WRITE_LOCK_CAP\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_WRITE_LOCK_STATUS) {
- printf (" EFI_FVB2_WRITE_LOCK_STATUS\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1) {
- printf (" EFI_FVB2_ALIGNMENT_1\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2) {
- printf (" EFI_FVB2_ALIGNMENT_2\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4) {
- printf (" EFI_FVB2_ALIGNMENT_4\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8) {
- printf (" EFI_FVB2_ALIGNMENT_8\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16) {
- printf (" EFI_FVB2_ALIGNMENT_16\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32) {
- printf (" EFI_FVB2_ALIGNMENT_32\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64) {
- printf (" EFI_FVB2_ALIGNMENT_64\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128) {
- printf (" EFI_FVB2_ALIGNMENT_128\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256) {
- printf (" EFI_FVB2_ALIGNMENT_256\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512) {
- printf (" EFI_FVB2_ALIGNMENT_512\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1K) {
- printf (" EFI_FVB2_ALIGNMENT_1K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2K) {
- printf (" EFI_FVB2_ALIGNMENT_2K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4K) {
- printf (" EFI_FVB2_ALIGNMENT_4K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8K) {
- printf (" EFI_FVB2_ALIGNMENT_8K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16K) {
- printf (" EFI_FVB2_ALIGNMENT_16K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32K) {
- printf (" EFI_FVB2_ALIGNMENT_32K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64K) {
- printf (" EFI_FVB2_ALIGNMENT_64K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128K) {
- printf (" EFI_FVB2_ALIGNMENT_128K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256K) {
- printf (" EFI_FVB2_ALIGNMENT_256K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512K) {
- printf (" EFI_FVB2_ALIGNMENT_512K\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1M) {
- printf (" EFI_FVB2_ALIGNMENT_1M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2M) {
- printf (" EFI_FVB2_ALIGNMENT_2M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_4M) {
- printf (" EFI_FVB2_ALIGNMENT_4M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_8M) {
- printf (" EFI_FVB2_ALIGNMENT_8M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_16M) {
- printf (" EFI_FVB2_ALIGNMENT_16M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_32M) {
- printf (" EFI_FVB2_ALIGNMENT_32M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64M) {
- printf (" EFI_FVB2_ALIGNMENT_64M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128M) {
- printf (" EFI_FVB2_ALIGNMENT_128M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_64M) {
- printf (" EFI_FVB2_ALIGNMENT_64M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_128M) {
- printf (" EFI_FVB2_ALIGNMENT_128M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_256M) {
- printf (" EFI_FVB2_ALIGNMENT_256M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_512M) {
- printf (" EFI_FVB2_ALIGNMENT_512M\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_1G) {
- printf (" EFI_FVB2_ALIGNMENT_1G\n");
- }
-
- if (VolumeHeader.Attributes & EFI_FVB2_ALIGNMENT_2G) {
- printf (" EFI_FVB2_ALIGNMENT_2G\n");
- }
-
-#endif
- printf ("Header Length: 0x%08X\n", VolumeHeader.HeaderLength);
- printf ("File System ID: ");
- PrintGuid (&VolumeHeader.FileSystemGuid);
- //
- // printf ("\n");
- //
- printf ("Revision: 0x%04X\n", VolumeHeader.Revision);
-
- do {
- fread (&BlockMap, sizeof (EFI_FV_BLOCK_MAP_ENTRY), 1, InputFile);
- BytesRead += sizeof (EFI_FV_BLOCK_MAP_ENTRY);
-
- if (BlockMap.NumBlocks != 0) {
- printf ("Number of Blocks: 0x%08X\n", (unsigned) BlockMap.NumBlocks);
- printf ("Block Length: 0x%08X\n", (unsigned) BlockMap.Length);
- Size += BlockMap.NumBlocks * BlockMap.Length;
- }
-
- } while (!(BlockMap.NumBlocks == 0 && BlockMap.Length == 0));
-
- if (BytesRead != VolumeHeader.HeaderLength) {
- printf ("ERROR: Header length not consistent with Block Maps!\n");
- return EFI_ABORTED;
- }
-
- if (VolumeHeader.FvLength != Size) {
- printf ("ERROR: Volume Size not consistant with Block Maps!\n");
- return EFI_ABORTED;
- }
-
- printf ("Total Volume Size: 0x%08X\n", (unsigned) Size);
-
- *FvSize = Size;
-
- //
- // rewind (InputFile);
- //
- return EFI_SUCCESS;
-}
-
-STATIC
-EFI_STATUS
-PrintFileInfo (
- EFI_FIRMWARE_VOLUME_HEADER *FvImage,
- EFI_FFS_FILE_HEADER *FileHeader,
- BOOLEAN ErasePolarity
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- FvImage - GC_TODO: add argument description
- FileHeader - GC_TODO: add argument description
- ErasePolarity - GC_TODO: add argument description
-
-Returns:
-
- EFI_SUCCESS - GC_TODO: Add description for return value
- EFI_ABORTED - GC_TODO: Add description for return value
-
---*/
-{
- UINT32 FileLength;
- UINT8 FileState;
- UINT8 Checksum;
- EFI_FFS_FILE_HEADER BlankHeader;
- EFI_STATUS Status;
- UINT8 GuidBuffer[PRINTED_GUID_BUFFER_SIZE];
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- UINT16 *Tail;
-#endif
- //
- // Check if we have free space
- //
- if (ErasePolarity) {
- memset (&BlankHeader, -1, sizeof (EFI_FFS_FILE_HEADER));
- } else {
- memset (&BlankHeader, 0, sizeof (EFI_FFS_FILE_HEADER));
- }
-
- if (memcmp (&BlankHeader, FileHeader, sizeof (EFI_FFS_FILE_HEADER)) == 0) {
- return EFI_SUCCESS;
- }
- //
- // Print file information.
- //
- printf ("============================================================\n");
-
- printf ("File Name: ");
- PrintGuidToBuffer (&FileHeader->Name, GuidBuffer, sizeof (GuidBuffer), TRUE);
- printf ("%s ", GuidBuffer);
- PrintGuidName (GuidBuffer);
- printf ("\n");
-
- //
- // PrintGuid (&FileHeader->Name);
- // printf ("\n");
- //
- FileLength = GetLength (FileHeader->Size);
- printf ("File Offset: 0x%08X\n", (unsigned) ((UINTN) FileHeader - (UINTN) FvImage));
- printf ("File Length: 0x%08X\n", (unsigned) FileLength);
- printf ("File Attributes: 0x%02X\n", FileHeader->Attributes);
- printf ("File State: 0x%02X\n", FileHeader->State);
-
- //
- // Print file state
- //
- FileState = GetFileState (ErasePolarity, FileHeader);
-
- switch (FileState) {
-
- case EFI_FILE_HEADER_CONSTRUCTION:
- printf (" EFI_FILE_HEADER_CONSTRUCTION\n");
- return EFI_SUCCESS;
-
- case EFI_FILE_HEADER_INVALID:
- printf (" EFI_FILE_HEADER_INVALID\n");
- return EFI_SUCCESS;
-
- case EFI_FILE_HEADER_VALID:
- printf (" EFI_FILE_HEADER_VALID\n");
- Checksum = CalculateSum8 ((UINT8 *) FileHeader, sizeof (EFI_FFS_FILE_HEADER));
- Checksum = (UINT8) (Checksum - FileHeader->IntegrityCheck.Checksum.File);
- Checksum = (UINT8) (Checksum - FileHeader->State);
- if (Checksum != 0) {
- printf ("ERROR: Header checksum invalid.\n");
- return EFI_ABORTED;
- }
-
- return EFI_SUCCESS;
-
- case EFI_FILE_DELETED:
- printf (" EFI_FILE_DELETED\n");
-
- case EFI_FILE_MARKED_FOR_UPDATE:
- printf (" EFI_FILE_MARKED_FOR_UPDATE\n");
-
- case EFI_FILE_DATA_VALID:
- printf (" EFI_FILE_DATA_VALID\n");
-
- //
- // Calculate header checksum
- //
- Checksum = CalculateSum8 ((UINT8 *) FileHeader, sizeof (EFI_FFS_FILE_HEADER));
- Checksum = (UINT8) (Checksum - FileHeader->IntegrityCheck.Checksum.File);
- Checksum = (UINT8) (Checksum - FileHeader->State);
- if (Checksum != 0) {
- Error (NULL, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has invalid header checksum", GuidBuffer);
- return EFI_ABORTED;
- }
-
- FileLength = GetLength (FileHeader->Size);
-
- if (FileHeader->Attributes & FFS_ATTRIB_CHECKSUM) {
- //
- // Calculate file checksum
- //
- Checksum = CalculateSum8 ((UINT8 *) (FileHeader + 1), FileLength - sizeof (EFI_FFS_FILE_HEADER));
- Checksum = Checksum + FileHeader->IntegrityCheck.Checksum.File;
- if (Checksum != 0) {
- Error (NULL, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has invalid file checksum", GuidBuffer);
- return EFI_ABORTED;
- }
- } else {
- if (FileHeader->IntegrityCheck.Checksum.File != FFS_FIXED_CHECKSUM) {
- Error (NULL, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has invalid header checksum -- not set to fixed value of 0xAA", GuidBuffer);
- return EFI_ABORTED;
- }
- }
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- //
- // Verify tail if present
- //
- if (FileHeader->Attributes & FFS_ATTRIB_TAIL_PRESENT) {
- //
- // Verify tail is complement of integrity check field in the header.
- //
- Tail = (UINT16 *) ((UINTN) FileHeader + GetLength (FileHeader->Size) - sizeof (EFI_FFS_INTEGRITY_CHECK));
- if (FileHeader->IntegrityCheck.TailReference != (UINT16)~(*Tail)) {
- Error (NULL, 0, 0003, "error parsing FFS file", \
- "FFS file with Guid %s failed in the integrity check, tail is not the complement of the header field", GuidBuffer);
- return EFI_ABORTED;
- }
- }
- #endif
- break;
-
- default:
- Error (NULL, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has the invalid/unrecognized file state bits", GuidBuffer);
- return EFI_ABORTED;
- }
-
- printf ("File Type: 0x%02X ", FileHeader->Type);
-
- switch (FileHeader->Type) {
-
- case EFI_FV_FILETYPE_RAW:
- printf ("EFI_FV_FILETYPE_RAW\n");
- break;
-
- case EFI_FV_FILETYPE_FREEFORM:
- printf ("EFI_FV_FILETYPE_FREEFORM\n");
- break;
-
- case EFI_FV_FILETYPE_SECURITY_CORE:
- printf ("EFI_FV_FILETYPE_SECURITY_CORE\n");
- break;
-
- case EFI_FV_FILETYPE_PEI_CORE:
- printf ("EFI_FV_FILETYPE_PEI_CORE\n");
- break;
-
- case EFI_FV_FILETYPE_DXE_CORE:
- printf ("EFI_FV_FILETYPE_DXE_CORE\n");
- break;
-
- case EFI_FV_FILETYPE_PEIM:
- printf ("EFI_FV_FILETYPE_PEIM\n");
- break;
-
- case EFI_FV_FILETYPE_DRIVER:
- printf ("EFI_FV_FILETYPE_DRIVER\n");
- break;
-
- case EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER:
- printf ("EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER\n");
- break;
-
- case EFI_FV_FILETYPE_APPLICATION:
- printf ("EFI_FV_FILETYPE_APPLICATION\n");
- break;
-
- case EFI_FV_FILETYPE_SMM:
- printf ("EFI_FV_FILETYPE_SMM\n");
- break;
-
- case EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE:
- printf ("EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE\n");
- break;
-
- case EFI_FV_FILETYPE_COMBINED_SMM_DXE:
- printf ("EFI_FV_FILETYPE_COMBINED_SMM_DXE\n");
- break;
-
- case EFI_FV_FILETYPE_SMM_CORE:
- printf ("EFI_FV_FILETYPE_SMM_CORE\n");
- break;
-
- case EFI_FV_FILETYPE_FFS_PAD:
- printf ("EFI_FV_FILETYPE_FFS_PAD\n");
- break;
-
- default:
- printf ("\nERROR: Unrecognized file type %X.\n", FileHeader->Type);
- return EFI_ABORTED;
- break;
- }
-
- switch (FileHeader->Type) {
-
- case EFI_FV_FILETYPE_ALL:
- case EFI_FV_FILETYPE_RAW:
- case EFI_FV_FILETYPE_FFS_PAD:
- break;
-
- default:
- //
- // All other files have sections
- //
- Status = ParseSection (
- (UINT8 *) ((UINTN) FileHeader + sizeof (EFI_FFS_FILE_HEADER)),
- GetLength (FileHeader->Size) - sizeof (EFI_FFS_FILE_HEADER)
- );
- if (EFI_ERROR (Status)) {
- //
- // printf ("ERROR: Parsing the FFS file.\n");
- //
- return EFI_ABORTED;
- }
- break;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-ParseSection (
- IN UINT8 *SectionBuffer,
- IN UINT32 BufferLength
- )
-/*++
-
-Routine Description:
-
- Parses EFI Sections
-
-Arguments:
-
- SectionBuffer - Buffer containing the section to parse.
- BufferLength - Length of SectionBuffer
-
-Returns:
-
- EFI_SECTION_ERROR - Problem with section parsing.
- (a) compression errors
- (b) unrecognized section
- EFI_UNSUPPORTED - Do not know how to parse the section.
- EFI_SUCCESS - Section successfully parsed.
- EFI_OUT_OF_RESOURCES - Memory allocation failed.
-
---*/
-{
- EFI_SECTION_TYPE Type;
- UINT8 *Ptr;
- UINT32 SectionLength;
- CHAR8 *SectionName;
- EFI_STATUS Status;
- UINT32 ParsedLength;
- UINT8 *CompressedBuffer;
- UINT32 CompressedLength;
- UINT8 *UncompressedBuffer;
- UINT32 UncompressedLength;
- UINT8 *ToolOutputBuffer;
- UINT32 ToolOutputLength;
- UINT8 CompressionType;
- UINT32 DstSize;
- UINT32 ScratchSize;
- UINT8 *ScratchBuffer;
- DECOMPRESS_FUNCTION DecompressFunction;
- GETINFO_FUNCTION GetInfoFunction;
- // CHAR16 *name;
- CHAR8 *ExtractionTool;
- CHAR8 *ToolInputFile;
- CHAR8 *ToolOutputFile;
- CHAR8 *SystemCommandFormatString;
- CHAR8 *SystemCommand;
-
- ParsedLength = 0;
- while (ParsedLength < BufferLength) {
- Ptr = SectionBuffer + ParsedLength;
-
- SectionLength = GetLength (((EFI_COMMON_SECTION_HEADER *) Ptr)->Size);
- Type = ((EFI_COMMON_SECTION_HEADER *) Ptr)->Type;
-
- //
- // This is sort of an odd check, but is necessary because FFS files are
- // padded to a QWORD boundary, meaning there is potentially a whole section
- // header worth of 0xFF bytes.
- //
- if (SectionLength == 0xffffff && Type == 0xff) {
- ParsedLength += 4;
- continue;
- }
-
- SectionName = SectionNameToStr (Type);
- printf ("------------------------------------------------------------\n");
- printf (" Type: %s\n Size: 0x%08X\n", SectionName, (unsigned) SectionLength);
- free (SectionName);
-
- switch (Type) {
- case EFI_SECTION_RAW:
- case EFI_SECTION_PE32:
- case EFI_SECTION_PIC:
- case EFI_SECTION_TE:
- // default is no more information
- break;
-
- case EFI_SECTION_USER_INTERFACE:
- // name = &((EFI_USER_INTERFACE_SECTION *) Ptr)->FileNameString;
- // printf (" String: %s\n", &name);
- break;
-
- case EFI_SECTION_FIRMWARE_VOLUME_IMAGE:
- Status = PrintFvInfo (((EFI_FIRMWARE_VOLUME_IMAGE_SECTION*)Ptr) + 1, TRUE);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "printing of FV section contents failed", NULL);
- return EFI_SECTION_ERROR;
- }
- break;
-
- case EFI_SECTION_COMPATIBILITY16:
- case EFI_SECTION_FREEFORM_SUBTYPE_GUID:
- //
- // Section does not contain any further header information.
- //
- break;
-
- case EFI_SECTION_PEI_DEPEX:
- case EFI_SECTION_DXE_DEPEX:
- case EFI_SECTION_SMM_DEPEX:
- DumpDepexSection (Ptr, SectionLength);
- break;
-
- case EFI_SECTION_VERSION:
- printf (" Build Number: 0x%02X\n", ((EFI_VERSION_SECTION *) Ptr)->BuildNumber);
- printf (" Version Strg: %s\n", (char*) ((EFI_VERSION_SECTION *) Ptr)->VersionString);
- break;
-
- case EFI_SECTION_COMPRESSION:
- UncompressedBuffer = NULL;
- CompressedLength = SectionLength - sizeof (EFI_COMPRESSION_SECTION);
- UncompressedLength = ((EFI_COMPRESSION_SECTION *) Ptr)->UncompressedLength;
- CompressionType = ((EFI_COMPRESSION_SECTION *) Ptr)->CompressionType;
- printf (" Uncompressed Length: 0x%08X\n", (unsigned) UncompressedLength);
-
- if (CompressionType == EFI_NOT_COMPRESSED) {
- printf (" Compression Type: EFI_NOT_COMPRESSED\n");
- if (CompressedLength != UncompressedLength) {
- Error (
- NULL,
- 0,
- 0,
- "file is not compressed, but the compressed length does not match the uncompressed length",
- NULL
- );
- return EFI_SECTION_ERROR;
- }
-
- UncompressedBuffer = Ptr + sizeof (EFI_COMPRESSION_SECTION);
- } else if (CompressionType == EFI_STANDARD_COMPRESSION) {
- GetInfoFunction = EfiGetInfo;
- DecompressFunction = EfiDecompress;
- printf (" Compression Type: EFI_STANDARD_COMPRESSION\n");
-
- CompressedBuffer = Ptr + sizeof (EFI_COMPRESSION_SECTION);
-
- Status = GetInfoFunction (CompressedBuffer, CompressedLength, &DstSize, &ScratchSize);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "error getting compression info from compression section", NULL);
- return EFI_SECTION_ERROR;
- }
-
- if (DstSize != UncompressedLength) {
- Error (NULL, 0, 0003, "compression error in the compression section", NULL);
- return EFI_SECTION_ERROR;
- }
-
- ScratchBuffer = malloc (ScratchSize);
- UncompressedBuffer = malloc (UncompressedLength);
- if ((ScratchBuffer == NULL) || (UncompressedBuffer == NULL)) {
- return EFI_OUT_OF_RESOURCES;
- }
- Status = DecompressFunction (
- CompressedBuffer,
- CompressedLength,
- UncompressedBuffer,
- UncompressedLength,
- ScratchBuffer,
- ScratchSize
- );
- free (ScratchBuffer);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "decompress failed", NULL);
- free (UncompressedBuffer);
- return EFI_SECTION_ERROR;
- }
- } else {
- Error (NULL, 0, 0003, "unrecognized compression type", "type 0x%X", CompressionType);
- return EFI_SECTION_ERROR;
- }
-
- Status = ParseSection (UncompressedBuffer, UncompressedLength);
-
- if (CompressionType == EFI_STANDARD_COMPRESSION) {
- //
- // We need to deallocate Buffer
- //
- free (UncompressedBuffer);
- }
-
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "failed to parse section", NULL);
- return EFI_SECTION_ERROR;
- }
- break;
-
- case EFI_SECTION_GUID_DEFINED:
- printf (" SectionDefinitionGuid: ");
- PrintGuid (&((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid);
- printf ("\n");
- printf (" DataOffset: 0x%04X\n", (unsigned) ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset);
- printf (" Attributes: 0x%04X\n", (unsigned) ((EFI_GUID_DEFINED_SECTION *) Ptr)->Attributes);
-
- ExtractionTool =
- LookupGuidedSectionToolPath (
- mParsedGuidedSectionTools,
- &((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid
- );
-
- if (ExtractionTool != NULL) {
-
- ToolInputFile = CloneString (tmpnam (NULL));
- ToolOutputFile = CloneString (tmpnam (NULL));
-
- //
- // Construction 'system' command string
- //
- SystemCommandFormatString = "%s -d -o %s %s";
- SystemCommand = malloc (
- strlen (SystemCommandFormatString) +
- strlen (ExtractionTool) +
- strlen (ToolInputFile) +
- strlen (ToolOutputFile) +
- 1
- );
- sprintf (
- SystemCommand,
- SystemCommandFormatString,
- ExtractionTool,
- ToolOutputFile,
- ToolInputFile
- );
- free (ExtractionTool);
-
- Status =
- PutFileImage (
- ToolInputFile,
- (CHAR8*) SectionBuffer + ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset,
- BufferLength - ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset
- );
-
- system (SystemCommand);
- remove (ToolInputFile);
- free (ToolInputFile);
-
- Status =
- GetFileImage (
- ToolOutputFile,
- (CHAR8 **)&ToolOutputBuffer,
- &ToolOutputLength
- );
- remove (ToolOutputFile);
- free (ToolOutputFile);
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0004, "unable to read decoded GUIDED section", NULL);
- return EFI_SECTION_ERROR;
- }
-
- Status = ParseSection (
- ToolOutputBuffer,
- ToolOutputLength
- );
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "parse of decoded GUIDED section failed", NULL);
- return EFI_SECTION_ERROR;
- }
-
- //
- // Check for CRC32 sections which we can handle internally if needed.
- //
- } else if (!CompareGuid (
- &((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid,
- &gEfiCrc32GuidedSectionExtractionProtocolGuid
- )
- ) {
- //
- // CRC32 guided section
- //
- Status = ParseSection (
- SectionBuffer + ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset,
- BufferLength - ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset
- );
- if (EFI_ERROR (Status)) {
- Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NULL);
- return EFI_SECTION_ERROR;
- }
- } else {
- //
- // We don't know how to parse it now.
- //
- Error (NULL, 0, 0003, "Error parsing section", \
- "EFI_SECTION_GUID_DEFINED cannot be parsed at this time. Tool to decode this section should have been defined in GuidedSectionTools.txt (built in the FV directory).");
- return EFI_UNSUPPORTED;
- }
- break;
-
- default:
- //
- // Unknown section, return error
- //
- Error (NULL, 0, 0003, "unrecognized section type found", "section type = 0x%X", Type);
- return EFI_SECTION_ERROR;
- }
-
- ParsedLength += SectionLength;
- //
- // We make then next section begin on a 4-byte boundary
- //
- ParsedLength = GetOccupiedSize (ParsedLength, 4);
- }
-
- if (ParsedLength < BufferLength) {
- Error (NULL, 0, 0003, "sections do not completely fill the sectioned buffer being parsed", NULL);
- return EFI_SECTION_ERROR;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-DumpDepexSection (
- IN UINT8 *Ptr,
- IN UINT32 SectionLength
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- Ptr - GC_TODO: add argument description
- SectionLength - GC_TODO: add argument description
-
-Returns:
-
- EFI_SUCCESS - GC_TODO: Add description for return value
-
---*/
-{
- UINT8 GuidBuffer[PRINTED_GUID_BUFFER_SIZE];
-
- //
- // Need at least a section header + data
- //
- if (SectionLength <= sizeof (EFI_COMMON_SECTION_HEADER)) {
- return EFI_SUCCESS;
- }
-
- Ptr += sizeof (EFI_COMMON_SECTION_HEADER);
- SectionLength -= sizeof (EFI_COMMON_SECTION_HEADER);
- while (SectionLength > 0) {
- printf (" ");
- switch (*Ptr) {
- case EFI_DEP_BEFORE:
- printf ("BEFORE\n");
- Ptr++;
- SectionLength--;
- break;
-
- case EFI_DEP_AFTER:
- printf ("AFTER\n");
- Ptr++;
- SectionLength--;
- break;
-
- case EFI_DEP_PUSH:
- printf ("PUSH\n ");
- PrintGuidToBuffer ((EFI_GUID *) (Ptr + 1), GuidBuffer, sizeof (GuidBuffer), TRUE);
- printf ("%s ", GuidBuffer);
- PrintGuidName (GuidBuffer);
- printf ("\n");
- //
- // PrintGuid ((EFI_GUID *)(Ptr + 1));
- //
- Ptr += 17;
- SectionLength -= 17;
- break;
-
- case EFI_DEP_AND:
- printf ("AND\n");
- Ptr++;
- SectionLength--;
- break;
-
- case EFI_DEP_OR:
- printf ("OR\n");
- Ptr++;
- SectionLength--;
- break;
-
- case EFI_DEP_NOT:
- printf ("NOT\n");
- Ptr++;
- SectionLength--;
- break;
-
- case EFI_DEP_TRUE:
- printf ("TRUE\n");
- Ptr++;
- SectionLength--;
- break;
-
- case EFI_DEP_FALSE:
- printf ("FALSE\n");
- Ptr++;
- SectionLength--;
- break;
-
- case EFI_DEP_END:
- printf ("END DEPEX\n");
- Ptr++;
- SectionLength--;
- break;
-
- case EFI_DEP_SOR:
- printf ("SOR\n");
- Ptr++;
- SectionLength--;
- break;
-
- default:
- printf ("Unrecognized byte in depex: 0x%X\n", *Ptr);
- return EFI_SUCCESS;
- }
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-PrintGuidName (
- IN UINT8 *GuidStr
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- GuidStr - GC_TODO: add argument description
-
-Returns:
-
- EFI_SUCCESS - GC_TODO: Add description for return value
- EFI_INVALID_PARAMETER - GC_TODO: Add description for return value
-
---*/
-{
- GUID_TO_BASENAME *GPtr;
- //
- // If we have a list of guid-to-basenames, then go through the list to
- // look for a guid string match. If found, print the basename to stdout,
- // otherwise return a failure.
- //
- GPtr = mGuidBaseNameList;
- while (GPtr != NULL) {
- if (_stricmp ((CHAR8*) GuidStr, (CHAR8*) GPtr->Guid) == 0) {
- printf ("%s", GPtr->BaseName);
- return EFI_SUCCESS;
- }
-
- GPtr = GPtr->Next;
- }
-
- return EFI_INVALID_PARAMETER;
-}
-
-EFI_STATUS
-ParseGuidBaseNameFile (
- CHAR8 *FileName
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- FileName - GC_TODO: add argument description
-
-Returns:
-
- EFI_DEVICE_ERROR - GC_TODO: Add description for return value
- EFI_OUT_OF_RESOURCES - GC_TODO: Add description for return value
- EFI_SUCCESS - GC_TODO: Add description for return value
-
---*/
-{
- FILE *Fptr;
- CHAR8 Line[MAX_LINE_LEN];
- GUID_TO_BASENAME *GPtr;
-
- if ((Fptr = fopen (FileName, "r")) == NULL) {
- printf ("ERROR: Failed to open input cross-reference file '%s'\n", FileName);
- return EFI_DEVICE_ERROR;
- }
-
- while (fgets (Line, sizeof (Line), Fptr) != NULL) {
- //
- // Allocate space for another guid/basename element
- //
- GPtr = malloc (sizeof (GUID_TO_BASENAME));
- if (GPtr == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- memset ((char *) GPtr, 0, sizeof (GUID_TO_BASENAME));
- if (sscanf (Line, "%s %s", GPtr->Guid, GPtr->BaseName) == 2) {
- GPtr->Next = mGuidBaseNameList;
- mGuidBaseNameList = GPtr;
- } else {
- //
- // Some sort of error. Just continue.
- //
- free (GPtr);
- }
- }
-
- fclose (Fptr);
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-FreeGuidBaseNameList (
- VOID
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS - GC_TODO: Add description for return value
-
---*/
-{
- GUID_TO_BASENAME *Next;
-
- while (mGuidBaseNameList != NULL) {
- Next = mGuidBaseNameList->Next;
- free (mGuidBaseNameList);
- mGuidBaseNameList = Next;
- }
-
- return EFI_SUCCESS;
-}
-
-
-static
-VOID
-LoadGuidedSectionToolsTxt (
- IN CHAR8* FirmwareVolumeFilename
- )
-{
- CHAR8* PeerFilename;
- CHAR8* Places[] = {
- NULL,
- //NULL,
- };
- UINTN Index;
-
- Places[0] = FirmwareVolumeFilename;
- //Places[1] = mUtilityFilename;
-
- mParsedGuidedSectionTools = NULL;
-
- for (Index = 0; Index < (sizeof(Places)/sizeof(Places[0])); Index++) {
- PeerFilename = OsPathPeerFilePath (Places[Index], "GuidedSectionTools.txt");
- //printf("Loading %s...\n", PeerFilename);
- if (OsPathExists (PeerFilename)) {
- mParsedGuidedSectionTools = ParseGuidedSectionToolsFile (PeerFilename);
- }
- free (PeerFilename);
- if (mParsedGuidedSectionTools != NULL) {
- return;
- }
- }
-}
-
-
-void
-Usage (
- VOID
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- GC_TODO: add return values
-
---*/
-{
- //
- // Summary usage
- //
- fprintf (stdout, "Usage: %s [options] <input_file>\n\n", UTILITY_NAME);
-
- //
- // Copyright declaration
- //
- fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");
-
- //
- // Details Option
- //
- fprintf (stdout, "Options:\n");
- fprintf (stdout, " -x xref, --xref xref\n\
- Parse basename to file-guid cross reference file(s).\n");
- fprintf (stdout, " --offset offset\n\
- Offset of file to start processing FV at.\n");
- fprintf (stdout, " -h, --help\n\
- Show this help message and exit.\n");
-
-}
-
diff --git a/BaseTools/Source/C/VolInfo/VolInfo.h b/BaseTools/Source/C/VolInfo/VolInfo.h
deleted file mode 100644
index c2831293ba..0000000000
--- a/BaseTools/Source/C/VolInfo/VolInfo.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file
-
-Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
- VolInfo.c
-
-Abstract:
-
- Local Definitions for the VolInfo utility
-
-**/
-
-#ifndef _VOLINFO_H_
-#define _VOLINFO_H_ 1
-
-#define PI_SPECIFICATION_VERSION 0x00010000
-
-#define EFI_DEP_BEFORE 0x00
-#define EFI_DEP_AFTER 0x01
-#define EFI_DEP_PUSH 0x02
-#define EFI_DEP_AND 0x03
-#define EFI_DEP_OR 0x04
-#define EFI_DEP_NOT 0x05
-#define EFI_DEP_TRUE 0x06
-#define EFI_DEP_FALSE 0x07
-#define EFI_DEP_END 0x08
-#define EFI_DEP_SOR 0x09
-
-#define EFI_SECTION_LAST_LEAF_SECTION_TYPE 0x1B
-#define EFI_SECTION_LAST_SECTION_TYPE 0x1B
-
-#endif
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
deleted file mode 100644
index 6711880f60..0000000000
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ /dev/null
@@ -1,2916 +0,0 @@
-## @file
-# Generate AutoGen.h, AutoGen.c and *.depex files
-#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-## Import Modules
-#
-import os
-import re
-import os.path as path
-import copy
-
-import GenC
-import GenMake
-import GenDepex
-from StringIO import StringIO
-
-from StrGather import *
-from BuildEngine import BuildRule
-
-from Common.BuildToolError import *
-from Common.DataType import *
-from Common.Misc import *
-from Common.String import *
-import Common.GlobalData as GlobalData
-from GenFds.FdfParser import *
-from CommonDataClass.CommonClass import SkuInfoClass
-from Workspace.BuildClassObject import *
-import Common.VpdInfoFile as VpdInfoFile
-
-## Regular expression for splitting Dependency Expression stirng into tokens
-gDepexTokenPattern = re.compile("(\(|\)|\w+| \S+\.inf)")
-
-## Mapping Makefile type
-gMakeTypeMap = {"MSFT":"nmake", "GCC":"gmake"}
-
-
-## Build rule configuration file
-gBuildRuleFile = 'Conf/build_rule.txt'
-
-## Build rule default version
-AutoGenReqBuildRuleVerNum = "0.1"
-
-## default file name for AutoGen
-gAutoGenCodeFileName = "AutoGen.c"
-gAutoGenHeaderFileName = "AutoGen.h"
-gAutoGenStringFileName = "%(module_name)sStrDefs.h"
-gAutoGenStringFormFileName = "%(module_name)sStrDefs.hpk"
-gAutoGenDepexFileName = "%(module_name)s.depex"
-
-#
-# Template string to generic AsBuilt INF
-#
-gAsBuiltInfHeaderString = TemplateString("""## @file
-# ${module_name}
-#
-# DO NOT EDIT
-# FILE auto-generated Binary INF
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010016
- BASE_NAME = ${module_name}
- FILE_GUID = ${module_guid}
- MODULE_TYPE = ${module_module_type}
- VERSION_STRING = ${module_version_string}${BEGIN}
- UEFI_SPECIFICATION_VERSION = ${module_uefi_specification_version}${END}${BEGIN}
- PI_SPECIFICATION_VERSION = ${module_pi_specification_version}${END}
-
-[Packages]${BEGIN}
- ${package_item}${END}
-
-[Binaries.${module_arch}]${BEGIN}
- ${binary_item}${END}
-
-[PcdEx]${BEGIN}
- ${pcd_item}${END}
-
-## @AsBuilt${BEGIN}
-## ${flags_item}${END}
-""")
-
-## Base class for AutoGen
-#
-# This class just implements the cache mechanism of AutoGen objects.
-#
-class AutoGen(object):
- # database to maintain the objects of xxxAutoGen
- _CACHE_ = {} # (BuildTarget, ToolChain) : {ARCH : {platform file: AutoGen object}}}
-
- ## Factory method
- #
- # @param Class class object of real AutoGen class
- # (WorkspaceAutoGen, ModuleAutoGen or PlatformAutoGen)
- # @param Workspace Workspace directory or WorkspaceAutoGen object
- # @param MetaFile The path of meta file
- # @param Target Build target
- # @param Toolchain Tool chain name
- # @param Arch Target arch
- # @param *args The specific class related parameters
- # @param **kwargs The specific class related dict parameters
- #
- def __new__(Class, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
- # check if the object has been created
- Key = (Target, Toolchain)
- if Key not in Class._CACHE_ or Arch not in Class._CACHE_[Key] \
- or MetaFile not in Class._CACHE_[Key][Arch]:
- AutoGenObject = super(AutoGen, Class).__new__(Class)
- # call real constructor
- if not AutoGenObject._Init(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
- return None
- if Key not in Class._CACHE_:
- Class._CACHE_[Key] = {}
- if Arch not in Class._CACHE_[Key]:
- Class._CACHE_[Key][Arch] = {}
- Class._CACHE_[Key][Arch][MetaFile] = AutoGenObject
- else:
- AutoGenObject = Class._CACHE_[Key][Arch][MetaFile]
-
- return AutoGenObject
-
- ## hash() operator
- #
- # The file path of platform file will be used to represent hash value of this object
- #
- # @retval int Hash value of the file path of platform file
- #
- def __hash__(self):
- return hash(self.MetaFile)
-
- ## str() operator
- #
- # The file path of platform file will be used to represent this object
- #
- # @retval string String of platform file path
- #
- def __str__(self):
- return str(self.MetaFile)
-
- ## "==" operator
- def __eq__(self, Other):
- return Other and self.MetaFile == Other
-
-## Workspace AutoGen class
-#
-# This class is used mainly to control the whole platform build for different
-# architecture. This class will generate top level makefile.
-#
-class WorkspaceAutoGen(AutoGen):
- ## Real constructor of WorkspaceAutoGen
- #
- # This method behaves the same as __init__ except that it needs explicit invoke
- # (in super class's __new__ method)
- #
- # @param WorkspaceDir Root directory of workspace
- # @param ActivePlatform Meta-file of active platform
- # @param Target Build target
- # @param Toolchain Tool chain name
- # @param ArchList List of architecture of current build
- # @param MetaFileDb Database containing meta-files
- # @param BuildConfig Configuration of build
- # @param ToolDefinition Tool chain definitions
- # @param FlashDefinitionFile File of flash definition
- # @param Fds FD list to be generated
- # @param Fvs FV list to be generated
- # @param Caps Capsule list to be generated
- # @param SkuId SKU id from command line
- #
- def _Init(self, WorkspaceDir, ActivePlatform, Target, Toolchain, ArchList, MetaFileDb,
- BuildConfig, ToolDefinition, FlashDefinitionFile='', Fds=None, Fvs=None, Caps=None, SkuId='', UniFlag=None,
- Progress=None, BuildModule=None):
- if Fds is None:
- Fds = []
- if Fvs is None:
- Fvs = []
- if Caps is None:
- Caps = []
- self.BuildDatabase = MetaFileDb
- self.MetaFile = ActivePlatform
- self.WorkspaceDir = WorkspaceDir
- self.Platform = self.BuildDatabase[self.MetaFile, 'COMMON', Target, Toolchain]
- GlobalData.gActivePlatform = self.Platform
- self.BuildTarget = Target
- self.ToolChain = Toolchain
- self.ArchList = ArchList
- self.SkuId = SkuId
- self.UniFlag = UniFlag
-
- self.TargetTxt = BuildConfig
- self.ToolDef = ToolDefinition
- self.FdfFile = FlashDefinitionFile
- self.FdTargetList = Fds
- self.FvTargetList = Fvs
- self.CapTargetList = Caps
- self.AutoGenObjectList = []
-
- # there's many relative directory operations, so ...
- os.chdir(self.WorkspaceDir)
-
- #
- # Merge Arch
- #
- if not self.ArchList:
- ArchList = set(self.Platform.SupArchList)
- else:
- ArchList = set(self.ArchList) & set(self.Platform.SupArchList)
- if not ArchList:
- EdkLogger.error("build", PARAMETER_INVALID,
- ExtraData = "Invalid ARCH specified. [Valid ARCH: %s]" % (" ".join(self.Platform.SupArchList)))
- elif self.ArchList and len(ArchList) != len(self.ArchList):
- SkippedArchList = set(self.ArchList).symmetric_difference(set(self.Platform.SupArchList))
- EdkLogger.verbose("\nArch [%s] is ignored because the platform supports [%s] only!"
- % (" ".join(SkippedArchList), " ".join(self.Platform.SupArchList)))
- self.ArchList = tuple(ArchList)
-
- # Validate build target
- if self.BuildTarget not in self.Platform.BuildTargets:
- EdkLogger.error("build", PARAMETER_INVALID,
- ExtraData="Build target [%s] is not supported by the platform. [Valid target: %s]"
- % (self.BuildTarget, " ".join(self.Platform.BuildTargets)))
-
- # Validate SKU ID
- if not self.SkuId:
- self.SkuId = 'DEFAULT'
-
- if self.SkuId not in self.Platform.SkuIds:
- EdkLogger.error("build", PARAMETER_INVALID,
- ExtraData="SKU-ID [%s] is not supported by the platform. [Valid SKU-ID: %s]"
- % (self.SkuId, " ".join(self.Platform.SkuIds.keys())))
-
- # parse FDF file to get PCDs in it, if any
- if not self.FdfFile:
- self.FdfFile = self.Platform.FlashDefinition
-
- EdkLogger.info("")
- if self.ArchList:
- EdkLogger.info('%-16s = %s' % ("Architecture(s)", ' '.join(self.ArchList)))
- EdkLogger.info('%-16s = %s' % ("Build target", self.BuildTarget))
- EdkLogger.info('%-16s = %s' % ("Toolchain",self.ToolChain))
-
- EdkLogger.info('\n%-24s = %s' % ("Active Platform", self.Platform))
- if BuildModule:
- EdkLogger.info('%-24s = %s' % ("Active Module", BuildModule))
-
- if self.FdfFile:
- EdkLogger.info('%-24s = %s' % ("Flash Image Definition", self.FdfFile))
-
- EdkLogger.verbose("\nFLASH_DEFINITION = %s" % self.FdfFile)
-
- if Progress:
- Progress.Start("\nProcessing meta-data")
-
- if self.FdfFile:
- #
- # Mark now build in AutoGen Phase
- #
- GlobalData.gAutoGenPhase = True
- Fdf = FdfParser(self.FdfFile.Path)
- Fdf.ParseFile()
- GlobalData.gAutoGenPhase = False
- PcdSet = Fdf.Profile.PcdDict
- ModuleList = Fdf.Profile.InfList
- self.FdfProfile = Fdf.Profile
- for fvname in self.FvTargetList:
- if fvname.upper() not in self.FdfProfile.FvDict:
- EdkLogger.error("build", OPTION_VALUE_INVALID,
- "No such an FV in FDF file: %s" % fvname)
- else:
- PcdSet = {}
- ModuleList = []
- self.FdfProfile = None
- if self.FdTargetList:
- EdkLogger.info("No flash definition file found. FD [%s] will be ignored." % " ".join(self.FdTargetList))
- self.FdTargetList = []
- if self.FvTargetList:
- EdkLogger.info("No flash definition file found. FV [%s] will be ignored." % " ".join(self.FvTargetList))
- self.FvTargetList = []
- if self.CapTargetList:
- EdkLogger.info("No flash definition file found. Capsule [%s] will be ignored." % " ".join(self.CapTargetList))
- self.CapTargetList = []
-
- # apply SKU and inject PCDs from Flash Definition file
- for Arch in self.ArchList:
- Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
-
- DecPcds = {}
- DecPcdsKey = set()
- PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
- Pkgs = PGen.PackageList
- for Pkg in Pkgs:
- for Pcd in Pkg.Pcds:
- DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd]
- DecPcdsKey.add((Pcd[0], Pcd[1], Pcd[2]))
-
- Platform.SkuName = self.SkuId
- for Name, Guid in PcdSet:
- if (Name, Guid) not in DecPcds:
- EdkLogger.error(
- 'build',
- PARSER_ERROR,
- "PCD (%s.%s) used in FDF is not declared in DEC files." % (Guid, Name),
- File = self.FdfProfile.PcdFileLineDict[Name, Guid][0],
- Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1]
- )
- else:
- # Check whether Dynamic or DynamicEx PCD used in FDF file. If used, build break and give a error message.
- if (Name, Guid, TAB_PCDS_FIXED_AT_BUILD) in DecPcdsKey \
- or (Name, Guid, TAB_PCDS_PATCHABLE_IN_MODULE) in DecPcdsKey \
- or (Name, Guid, TAB_PCDS_FEATURE_FLAG) in DecPcdsKey:
- Platform.AddPcd(Name, Guid, PcdSet[Name, Guid])
- continue
- elif (Name, Guid, TAB_PCDS_DYNAMIC) in DecPcdsKey or (Name, Guid, TAB_PCDS_DYNAMIC_EX) in DecPcdsKey:
- EdkLogger.error(
- 'build',
- PARSER_ERROR,
- "Using Dynamic or DynamicEx type of PCD [%s.%s] in FDF file is not allowed." % (Guid, Name),
- File = self.FdfProfile.PcdFileLineDict[Name, Guid][0],
- Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1]
- )
-
- Pa = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
- #
- # Explicitly collect platform's dynamic PCDs
- #
- Pa.CollectPlatformDynamicPcds()
- self.AutoGenObjectList.append(Pa)
-
- #
- # Check PCDs token value conflict in each DEC file.
- #
- self._CheckAllPcdsTokenValueConflict()
-
- #
- # Check PCD type and definition between DSC and DEC
- #
- self._CheckPcdDefineAndType()
-
- if self.FdfFile:
- self._CheckDuplicateInFV(Fdf)
-
- self._BuildDir = None
- self._FvDir = None
- self._MakeFileDir = None
- self._BuildCommand = None
-
- return True
-
- ## _CheckDuplicateInFV() method
- #
- # Check whether there is duplicate modules/files exist in FV section.
- # The check base on the file GUID;
- #
- def _CheckDuplicateInFV(self, Fdf):
- for Fv in Fdf.Profile.FvDict:
- _GuidDict = {}
- for FfsFile in Fdf.Profile.FvDict[Fv].FfsList:
- if FfsFile.InfFileName and FfsFile.NameGuid == None:
- #
- # Get INF file GUID
- #
- InfFoundFlag = False
- for Pa in self.AutoGenObjectList:
- if InfFoundFlag:
- break
- for Module in Pa.ModuleAutoGenList:
- if path.normpath(Module.MetaFile.File) == path.normpath(FfsFile.InfFileName):
- InfFoundFlag = True
- if not Module.Guid.upper() in _GuidDict.keys():
- _GuidDict[Module.Guid.upper()] = FfsFile
- break
- else:
- EdkLogger.error("build",
- FORMAT_INVALID,
- "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s"%(FfsFile.CurrentLineNum,
- FfsFile.CurrentLineContent,
- _GuidDict[Module.Guid.upper()].CurrentLineNum,
- _GuidDict[Module.Guid.upper()].CurrentLineContent,
- Module.Guid.upper()),
- ExtraData=self.FdfFile)
- #
- # Some INF files not have entity in DSC file.
- #
- if not InfFoundFlag:
- if FfsFile.InfFileName.find('$') == -1:
- InfPath = NormPath(FfsFile.InfFileName)
- if not os.path.exists(InfPath):
- EdkLogger.error('build', GENFDS_ERROR, "Non-existant Module %s !" % (FfsFile.InfFileName))
-
- PathClassObj = PathClass(FfsFile.InfFileName, self.WorkspaceDir)
- #
- # Here we just need to get FILE_GUID from INF file, use 'COMMON' as ARCH attribute. and use
- # BuildObject from one of AutoGenObjectList is enough.
- #
- InfObj = self.AutoGenObjectList[0].BuildDatabase.WorkspaceDb.BuildObject[PathClassObj, 'COMMON', self.BuildTarget, self.ToolChain]
- if not InfObj.Guid.upper() in _GuidDict.keys():
- _GuidDict[InfObj.Guid.upper()] = FfsFile
- else:
- EdkLogger.error("build",
- FORMAT_INVALID,
- "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s"%(FfsFile.CurrentLineNum,
- FfsFile.CurrentLineContent,
- _GuidDict[InfObj.Guid.upper()].CurrentLineNum,
- _GuidDict[InfObj.Guid.upper()].CurrentLineContent,
- InfObj.Guid.upper()),
- ExtraData=self.FdfFile)
- InfFoundFlag = False
-
- if FfsFile.NameGuid != None:
- _CheckPCDAsGuidPattern = re.compile("^PCD\(.+\..+\)$")
-
- #
- # If the NameGuid reference a PCD name.
- # The style must match: PCD(xxxx.yyy)
- #
- if _CheckPCDAsGuidPattern.match(FfsFile.NameGuid):
- #
- # Replace the PCD value.
- #
- _PcdName = FfsFile.NameGuid.lstrip("PCD(").rstrip(")")
- PcdFoundFlag = False
- for Pa in self.AutoGenObjectList:
- if not PcdFoundFlag:
- for PcdItem in Pa.AllPcdList:
- if (PcdItem.TokenSpaceGuidCName + "." + PcdItem.TokenCName) == _PcdName:
- #
- # First convert from CFormatGuid to GUID string
- #
- _PcdGuidString = GuidStructureStringToGuidString(PcdItem.DefaultValue)
-
- if not _PcdGuidString:
- #
- # Then try Byte array.
- #
- _PcdGuidString = GuidStructureByteArrayToGuidString(PcdItem.DefaultValue)
-
- if not _PcdGuidString:
- #
- # Not Byte array or CFormat GUID, raise error.
- #
- EdkLogger.error("build",
- FORMAT_INVALID,
- "The format of PCD value is incorrect. PCD: %s , Value: %s\n"%(_PcdName, PcdItem.DefaultValue),
- ExtraData=self.FdfFile)
-
- if not _PcdGuidString.upper() in _GuidDict.keys():
- _GuidDict[_PcdGuidString.upper()] = FfsFile
- PcdFoundFlag = True
- break
- else:
- EdkLogger.error("build",
- FORMAT_INVALID,
- "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s"%(FfsFile.CurrentLineNum,
- FfsFile.CurrentLineContent,
- _GuidDict[_PcdGuidString.upper()].CurrentLineNum,
- _GuidDict[_PcdGuidString.upper()].CurrentLineContent,
- FfsFile.NameGuid.upper()),
- ExtraData=self.FdfFile)
-
- if not FfsFile.NameGuid.upper() in _GuidDict.keys():
- _GuidDict[FfsFile.NameGuid.upper()] = FfsFile
- else:
- #
- # Two raw file GUID conflict.
- #
- EdkLogger.error("build",
- FORMAT_INVALID,
- "Duplicate GUID found for these lines: Line %d: %s and Line %d: %s. GUID: %s"%(FfsFile.CurrentLineNum,
- FfsFile.CurrentLineContent,
- _GuidDict[FfsFile.NameGuid.upper()].CurrentLineNum,
- _GuidDict[FfsFile.NameGuid.upper()].CurrentLineContent,
- FfsFile.NameGuid.upper()),
- ExtraData=self.FdfFile)
-
-
- def _CheckPcdDefineAndType(self):
- PcdTypeList = [
- "FixedAtBuild", "PatchableInModule", "FeatureFlag",
- "Dynamic", #"DynamicHii", "DynamicVpd",
- "DynamicEx", # "DynamicExHii", "DynamicExVpd"
- ]
-
- # This dict store PCDs which are not used by any modules with specified arches
- UnusedPcd = sdict()
- for Pa in self.AutoGenObjectList:
- # Key of DSC's Pcds dictionary is PcdCName, TokenSpaceGuid
- for Pcd in Pa.Platform.Pcds:
- PcdType = Pa.Platform.Pcds[Pcd].Type
-
- # If no PCD type, this PCD comes from FDF
- if not PcdType:
- continue
-
- # Try to remove Hii and Vpd suffix
- if PcdType.startswith("DynamicEx"):
- PcdType = "DynamicEx"
- elif PcdType.startswith("Dynamic"):
- PcdType = "Dynamic"
-
- for Package in Pa.PackageList:
- # Key of DEC's Pcds dictionary is PcdCName, TokenSpaceGuid, PcdType
- if (Pcd[0], Pcd[1], PcdType) in Package.Pcds:
- break
- for Type in PcdTypeList:
- if (Pcd[0], Pcd[1], Type) in Package.Pcds:
- EdkLogger.error(
- 'build',
- FORMAT_INVALID,
- "Type [%s] of PCD [%s.%s] in DSC file doesn't match the type [%s] defined in DEC file." \
- % (Pa.Platform.Pcds[Pcd].Type, Pcd[1], Pcd[0], Type),
- ExtraData=None
- )
- return
- else:
- UnusedPcd.setdefault(Pcd, []).append(Pa.Arch)
-
- for Pcd in UnusedPcd:
- EdkLogger.warn(
- 'build',
- "The PCD was not specified by any INF module in the platform for the given architecture.\n"
- "\tPCD: [%s.%s]\n\tPlatform: [%s]\n\tArch: %s"
- % (Pcd[1], Pcd[0], os.path.basename(str(self.MetaFile)), str(UnusedPcd[Pcd])),
- ExtraData=None
- )
-
- def __repr__(self):
- return "%s [%s]" % (self.MetaFile, ", ".join(self.ArchList))
-
- ## Return the directory to store FV files
- def _GetFvDir(self):
- if self._FvDir == None:
- self._FvDir = path.join(self.BuildDir, 'FV')
- return self._FvDir
-
- ## Return the directory to store all intermediate and final files built
- def _GetBuildDir(self):
- return self.AutoGenObjectList[0].BuildDir
-
- ## Return the build output directory platform specifies
- def _GetOutputDir(self):
- return self.Platform.OutputDirectory
-
- ## Return platform name
- def _GetName(self):
- return self.Platform.PlatformName
-
- ## Return meta-file GUID
- def _GetGuid(self):
- return self.Platform.Guid
-
- ## Return platform version
- def _GetVersion(self):
- return self.Platform.Version
-
- ## Return paths of tools
- def _GetToolDefinition(self):
- return self.AutoGenObjectList[0].ToolDefinition
-
- ## Return directory of platform makefile
- #
- # @retval string Makefile directory
- #
- def _GetMakeFileDir(self):
- if self._MakeFileDir == None:
- self._MakeFileDir = self.BuildDir
- return self._MakeFileDir
-
- ## Return build command string
- #
- # @retval string Build command string
- #
- def _GetBuildCommand(self):
- if self._BuildCommand == None:
- # BuildCommand should be all the same. So just get one from platform AutoGen
- self._BuildCommand = self.AutoGenObjectList[0].BuildCommand
- return self._BuildCommand
-
- ## Check the PCDs token value conflict in each DEC file.
- #
- # Will cause build break and raise error message while two PCDs conflict.
- #
- # @return None
- #
- def _CheckAllPcdsTokenValueConflict(self):
- for Pa in self.AutoGenObjectList:
- for Package in Pa.PackageList:
- PcdList = Package.Pcds.values()
- PcdList.sort(lambda x, y: cmp(x.TokenValue, y.TokenValue))
- Count = 0
- while (Count < len(PcdList) - 1) :
- Item = PcdList[Count]
- ItemNext = PcdList[Count + 1]
- #
- # Make sure in the same token space the TokenValue should be unique
- #
- if (Item.TokenValue == ItemNext.TokenValue):
- SameTokenValuePcdList = []
- SameTokenValuePcdList.append(Item)
- SameTokenValuePcdList.append(ItemNext)
- RemainPcdListLength = len(PcdList) - Count - 2
- for ValueSameCount in range(RemainPcdListLength):
- if PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount].TokenValue == Item.TokenValue:
- SameTokenValuePcdList.append(PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount])
- else:
- break;
- #
- # Sort same token value PCD list with TokenGuid and TokenCName
- #
- SameTokenValuePcdList.sort(lambda x, y: cmp("%s.%s"%(x.TokenSpaceGuidCName, x.TokenCName), "%s.%s"%(y.TokenSpaceGuidCName, y.TokenCName)))
- SameTokenValuePcdListCount = 0
- while (SameTokenValuePcdListCount < len(SameTokenValuePcdList) - 1):
- TemListItem = SameTokenValuePcdList[SameTokenValuePcdListCount]
- TemListItemNext = SameTokenValuePcdList[SameTokenValuePcdListCount + 1]
-
- if (TemListItem.TokenSpaceGuidCName == TemListItemNext.TokenSpaceGuidCName) and (TemListItem.TokenCName != TemListItemNext.TokenCName):
- EdkLogger.error(
- 'build',
- FORMAT_INVALID,
- "The TokenValue [%s] of PCD [%s.%s] is conflict with: [%s.%s] in %s"\
- % (TemListItem.TokenValue, TemListItem.TokenSpaceGuidCName, TemListItem.TokenCName, TemListItemNext.TokenSpaceGuidCName, TemListItemNext.TokenCName, Package),
- ExtraData=None
- )
- SameTokenValuePcdListCount += 1
- Count += SameTokenValuePcdListCount
- Count += 1
-
- PcdList = Package.Pcds.values()
- PcdList.sort(lambda x, y: cmp("%s.%s"%(x.TokenSpaceGuidCName, x.TokenCName), "%s.%s"%(y.TokenSpaceGuidCName, y.TokenCName)))
- Count = 0
- while (Count < len(PcdList) - 1) :
- Item = PcdList[Count]
- ItemNext = PcdList[Count + 1]
- #
- # Check PCDs with same TokenSpaceGuidCName.TokenCName have same token value as well.
- #
- if (Item.TokenSpaceGuidCName == ItemNext.TokenSpaceGuidCName) and (Item.TokenCName == ItemNext.TokenCName) and (Item.TokenValue != ItemNext.TokenValue):
- EdkLogger.error(
- 'build',
- FORMAT_INVALID,
- "The TokenValue [%s] of PCD [%s.%s] in %s defined in two places should be same as well."\
- % (Item.TokenValue, Item.TokenSpaceGuidCName, Item.TokenCName, Package),
- ExtraData=None
- )
- Count += 1
-
-
- ## Create makefile for the platform and modules in it
- #
- # @param CreateDepsMakeFile Flag indicating if the makefile for
- # modules will be created as well
- #
- def CreateMakeFile(self, CreateDepsMakeFile=False):
- # create makefile for platform
- Makefile = GenMake.TopLevelMakefile(self)
- if Makefile.Generate():
- EdkLogger.debug(EdkLogger.DEBUG_9, "Generated makefile for platform [%s] %s\n" %
- (self.MetaFile, self.ArchList))
- else:
- EdkLogger.debug(EdkLogger.DEBUG_9, "Skipped the generation of makefile for platform [%s] %s\n" %
- (self.MetaFile, self.ArchList))
-
- if CreateDepsMakeFile:
- for Pa in self.AutoGenObjectList:
- Pa.CreateMakeFile(CreateDepsMakeFile)
-
- ## Create autogen code for platform and modules
- #
- # Since there's no autogen code for platform, this method will do nothing
- # if CreateModuleCodeFile is set to False.
- #
- # @param CreateDepsCodeFile Flag indicating if creating module's
- # autogen code file or not
- #
- def CreateCodeFile(self, CreateDepsCodeFile=False):
- if not CreateDepsCodeFile:
- return
- for Pa in self.AutoGenObjectList:
- Pa.CreateCodeFile(CreateDepsCodeFile)
-
- ## Create AsBuilt INF file the platform
- #
- def CreateAsBuiltInf(self):
- return
-
- Name = property(_GetName)
- Guid = property(_GetGuid)
- Version = property(_GetVersion)
- OutputDir = property(_GetOutputDir)
-
- ToolDefinition = property(_GetToolDefinition) # toolcode : tool path
-
- BuildDir = property(_GetBuildDir)
- FvDir = property(_GetFvDir)
- MakeFileDir = property(_GetMakeFileDir)
- BuildCommand = property(_GetBuildCommand)
-
-## AutoGen class for platform
-#
-# PlatformAutoGen class will process the original information in platform
-# file in order to generate makefile for platform.
-#
-class PlatformAutoGen(AutoGen):
- #
- # Used to store all PCDs for both PEI and DXE phase, in order to generate
- # correct PCD database
- #
- _DynaPcdList_ = []
- _NonDynaPcdList_ = []
-
- #
- # The priority list while override build option
- #
- PrioList = {"0x11111" : 16, # TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE (Highest)
- "0x01111" : 15, # ******_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE
- "0x10111" : 14, # TARGET_*********_ARCH_COMMANDTYPE_ATTRIBUTE
- "0x00111" : 13, # ******_*********_ARCH_COMMANDTYPE_ATTRIBUTE
- "0x11011" : 12, # TARGET_TOOLCHAIN_****_COMMANDTYPE_ATTRIBUTE
- "0x01011" : 11, # ******_TOOLCHAIN_****_COMMANDTYPE_ATTRIBUTE
- "0x10011" : 10, # TARGET_*********_****_COMMANDTYPE_ATTRIBUTE
- "0x00011" : 9, # ******_*********_****_COMMANDTYPE_ATTRIBUTE
- "0x11101" : 8, # TARGET_TOOLCHAIN_ARCH_***********_ATTRIBUTE
- "0x01101" : 7, # ******_TOOLCHAIN_ARCH_***********_ATTRIBUTE
- "0x10101" : 6, # TARGET_*********_ARCH_***********_ATTRIBUTE
- "0x00101" : 5, # ******_*********_ARCH_***********_ATTRIBUTE
- "0x11001" : 4, # TARGET_TOOLCHAIN_****_***********_ATTRIBUTE
- "0x01001" : 3, # ******_TOOLCHAIN_****_***********_ATTRIBUTE
- "0x10001" : 2, # TARGET_*********_****_***********_ATTRIBUTE
- "0x00001" : 1} # ******_*********_****_***********_ATTRIBUTE (Lowest)
-
- ## The real constructor of PlatformAutoGen
- #
- # This method is not supposed to be called by users of PlatformAutoGen. It's
- # only used by factory method __new__() to do real initialization work for an
- # object of PlatformAutoGen
- #
- # @param Workspace WorkspaceAutoGen object
- # @param PlatformFile Platform file (DSC file)
- # @param Target Build target (DEBUG, RELEASE)
- # @param Toolchain Name of tool chain
- # @param Arch arch of the platform supports
- #
- def _Init(self, Workspace, PlatformFile, Target, Toolchain, Arch):
- EdkLogger.debug(EdkLogger.DEBUG_9, "AutoGen platform [%s] [%s]" % (PlatformFile, Arch))
- GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (PlatformFile, Arch, Toolchain, Target)
-
- self.MetaFile = PlatformFile
- self.Workspace = Workspace
- self.WorkspaceDir = Workspace.WorkspaceDir
- self.ToolChain = Toolchain
- self.BuildTarget = Target
- self.Arch = Arch
- self.SourceDir = PlatformFile.SubDir
- self.SourceOverrideDir = None
- self.FdTargetList = self.Workspace.FdTargetList
- self.FvTargetList = self.Workspace.FvTargetList
- self.AllPcdList = []
-
- # flag indicating if the makefile/C-code file has been created or not
- self.IsMakeFileCreated = False
- self.IsCodeFileCreated = False
-
- self._Platform = None
- self._Name = None
- self._Guid = None
- self._Version = None
-
- self._BuildRule = None
- self._SourceDir = None
- self._BuildDir = None
- self._OutputDir = None
- self._FvDir = None
- self._MakeFileDir = None
- self._FdfFile = None
-
- self._PcdTokenNumber = None # (TokenCName, TokenSpaceGuidCName) : GeneratedTokenNumber
- self._DynamicPcdList = None # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
- self._NonDynamicPcdList = None # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
-
- self._ToolDefinitions = None
- self._ToolDefFile = None # toolcode : tool path
- self._ToolChainFamily = None
- self._BuildRuleFamily = None
- self._BuildOption = None # toolcode : option
- self._EdkBuildOption = None # edktoolcode : option
- self._EdkIIBuildOption = None # edkiitoolcode : option
- self._PackageList = None
- self._ModuleAutoGenList = None
- self._LibraryAutoGenList = None
- self._BuildCommand = None
-
- # get the original module/package/platform objects
- self.BuildDatabase = Workspace.BuildDatabase
- return True
-
- def __repr__(self):
- return "%s [%s]" % (self.MetaFile, self.Arch)
-
- ## Create autogen code for platform and modules
- #
- # Since there's no autogen code for platform, this method will do nothing
- # if CreateModuleCodeFile is set to False.
- #
- # @param CreateModuleCodeFile Flag indicating if creating module's
- # autogen code file or not
- #
- def CreateCodeFile(self, CreateModuleCodeFile=False):
- # only module has code to be greated, so do nothing if CreateModuleCodeFile is False
- if self.IsCodeFileCreated or not CreateModuleCodeFile:
- return
-
- for Ma in self.ModuleAutoGenList:
- Ma.CreateCodeFile(True)
-
- # don't do this twice
- self.IsCodeFileCreated = True
-
- ## Create makefile for the platform and mdoules in it
- #
- # @param CreateModuleMakeFile Flag indicating if the makefile for
- # modules will be created as well
- #
- def CreateMakeFile(self, CreateModuleMakeFile=False):
- if CreateModuleMakeFile:
- for ModuleFile in self.Platform.Modules:
- Ma = ModuleAutoGen(self.Workspace, ModuleFile, self.BuildTarget,
- self.ToolChain, self.Arch, self.MetaFile)
- Ma.CreateMakeFile(True)
- Ma.CreateAsBuiltInf()
-
- # no need to create makefile for the platform more than once
- if self.IsMakeFileCreated:
- return
-
- # create makefile for platform
- Makefile = GenMake.PlatformMakefile(self)
- if Makefile.Generate():
- EdkLogger.debug(EdkLogger.DEBUG_9, "Generated makefile for platform [%s] [%s]\n" %
- (self.MetaFile, self.Arch))
- else:
- EdkLogger.debug(EdkLogger.DEBUG_9, "Skipped the generation of makefile for platform [%s] [%s]\n" %
- (self.MetaFile, self.Arch))
- self.IsMakeFileCreated = True
-
- ## Collect dynamic PCDs
- #
- # Gather dynamic PCDs list from each module and their settings from platform
- # This interface should be invoked explicitly when platform action is created.
- #
- def CollectPlatformDynamicPcds(self):
- # for gathering error information
- NoDatumTypePcdList = set()
-
- self._GuidValue = {}
- for F in self.Platform.Modules.keys():
- M = ModuleAutoGen(self.Workspace, F, self.BuildTarget, self.ToolChain, self.Arch, self.MetaFile)
- #GuidValue.update(M.Guids)
-
- self.Platform.Modules[F].M = M
-
- for PcdFromModule in M.ModulePcdList+M.LibraryPcdList:
- # make sure that the "VOID*" kind of datum has MaxDatumSize set
- if PcdFromModule.DatumType == "VOID*" and PcdFromModule.MaxDatumSize == None:
- NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, F))
-
- if PcdFromModule.Type in GenC.gDynamicPcd or PcdFromModule.Type in GenC.gDynamicExPcd:
- #
- # If a dynamic PCD used by a PEM module/PEI module & DXE module,
- # it should be stored in Pcd PEI database, If a dynamic only
- # used by DXE module, it should be stored in DXE PCD database.
- # The default Phase is DXE
- #
- if M.ModuleType in ["PEIM", "PEI_CORE"]:
- PcdFromModule.Phase = "PEI"
- if PcdFromModule not in self._DynaPcdList_:
- self._DynaPcdList_.append(PcdFromModule)
- elif PcdFromModule.Phase == 'PEI':
- # overwrite any the same PCD existing, if Phase is PEI
- Index = self._DynaPcdList_.index(PcdFromModule)
- self._DynaPcdList_[Index] = PcdFromModule
- elif PcdFromModule not in self._NonDynaPcdList_:
- self._NonDynaPcdList_.append(PcdFromModule)
-
- # print out error information and break the build, if error found
- if len(NoDatumTypePcdList) > 0:
- NoDatumTypePcdListString = "\n\t\t".join(NoDatumTypePcdList)
- EdkLogger.error("build", AUTOGEN_ERROR, "PCD setting error",
- File=self.MetaFile,
- ExtraData="\n\tPCD(s) without MaxDatumSize:\n\t\t%s\n"
- % NoDatumTypePcdListString)
- self._NonDynamicPcdList = self._NonDynaPcdList_
- self._DynamicPcdList = self._DynaPcdList_
- self.AllPcdList = self._NonDynamicPcdList + self._DynamicPcdList
-
- #
- # Sort dynamic PCD list to:
- # 1) If PCD's datum type is VOID* and value is unicode string which starts with L, the PCD item should
- # try to be put header of dynamicd List
- # 2) If PCD is HII type, the PCD item should be put after unicode type PCD
- #
- # The reason of sorting is make sure the unicode string is in double-byte alignment in string table.
- #
- UnicodePcdArray = []
- HiiPcdArray = []
- OtherPcdArray = []
- VpdPcdDict = {}
- VpdFile = VpdInfoFile.VpdInfoFile()
- NeedProcessVpdMapFile = False
-
- if (self.Workspace.ArchList[-1] == self.Arch):
- for Pcd in self._DynamicPcdList:
- # just pick the a value to determine whether is unicode string type
- Sku = Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]]
- Sku.VpdOffset = Sku.VpdOffset.strip()
-
- PcdValue = Sku.DefaultValue
- if Pcd.DatumType == 'VOID*' and PcdValue.startswith("L"):
- # if found PCD which datum value is unicode string the insert to left size of UnicodeIndex
- UnicodePcdArray.append(Pcd)
- elif len(Sku.VariableName) > 0:
- # if found HII type PCD then insert to right of UnicodeIndex
- HiiPcdArray.append(Pcd)
- else:
- OtherPcdArray.append(Pcd)
- if Pcd.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:
- VpdPcdDict[(Pcd.TokenCName, Pcd.TokenSpaceGuidCName)] = Pcd
-
- PlatformPcds = self.Platform.Pcds.keys()
- PlatformPcds.sort()
- #
- # Add VPD type PCD into VpdFile and determine whether the VPD PCD need to be fixed up.
- #
- for PcdKey in PlatformPcds:
- Pcd = self.Platform.Pcds[PcdKey]
- if Pcd.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:
- Pcd = VpdPcdDict[PcdKey]
- Sku = Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]]
- Sku.VpdOffset = Sku.VpdOffset.strip()
- #
- # Fix the optional data of VPD PCD.
- #
- if (Pcd.DatumType.strip() != "VOID*"):
- if Sku.DefaultValue == '':
- Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]].DefaultValue = Pcd.MaxDatumSize
- Pcd.MaxDatumSize = None
- else:
- EdkLogger.error("build", AUTOGEN_ERROR, "PCD setting error",
- File=self.MetaFile,
- ExtraData="\n\tPCD: %s.%s format incorrect in DSC: %s\n\t\t\n"
- % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, self.Platform.MetaFile.Path))
-
- VpdFile.Add(Pcd, Sku.VpdOffset)
- # if the offset of a VPD is *, then it need to be fixed up by third party tool.
- if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":
- NeedProcessVpdMapFile = True
- if self.Platform.VpdToolGuid == None or self.Platform.VpdToolGuid == '':
- EdkLogger.error("Build", FILE_NOT_FOUND, \
- "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")
-
-
- #
- # Fix the PCDs define in VPD PCD section that never referenced by module.
- # An example is PCD for signature usage.
- #
- for DscPcd in PlatformPcds:
- DscPcdEntry = self.Platform.Pcds[DscPcd]
- if DscPcdEntry.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:
- if not (self.Platform.VpdToolGuid == None or self.Platform.VpdToolGuid == ''):
- FoundFlag = False
- for VpdPcd in VpdFile._VpdArray.keys():
- # This PCD has been referenced by module
- if (VpdPcd.TokenSpaceGuidCName == DscPcdEntry.TokenSpaceGuidCName) and \
- (VpdPcd.TokenCName == DscPcdEntry.TokenCName):
- FoundFlag = True
-
- # Not found, it should be signature
- if not FoundFlag :
- # just pick the a value to determine whether is unicode string type
- Sku = DscPcdEntry.SkuInfoList[DscPcdEntry.SkuInfoList.keys()[0]]
- Sku.VpdOffset = Sku.VpdOffset.strip()
-
- # Need to iterate DEC pcd information to get the value & datumtype
- for eachDec in self.PackageList:
- for DecPcd in eachDec.Pcds:
- DecPcdEntry = eachDec.Pcds[DecPcd]
- if (DecPcdEntry.TokenSpaceGuidCName == DscPcdEntry.TokenSpaceGuidCName) and \
- (DecPcdEntry.TokenCName == DscPcdEntry.TokenCName):
- # Print warning message to let the developer make a determine.
- EdkLogger.warn("build", "Unreferenced vpd pcd used!",
- File=self.MetaFile, \
- ExtraData = "PCD: %s.%s used in the DSC file %s is unreferenced." \
- %(DscPcdEntry.TokenSpaceGuidCName, DscPcdEntry.TokenCName, self.Platform.MetaFile.Path))
-
- DscPcdEntry.DatumType = DecPcdEntry.DatumType
- DscPcdEntry.DefaultValue = DecPcdEntry.DefaultValue
- # Only fix the value while no value provided in DSC file.
- if (Sku.DefaultValue == "" or Sku.DefaultValue==None):
- DscPcdEntry.SkuInfoList[DscPcdEntry.SkuInfoList.keys()[0]].DefaultValue = DecPcdEntry.DefaultValue
-
-
- VpdFile.Add(DscPcdEntry, Sku.VpdOffset)
- # if the offset of a VPD is *, then it need to be fixed up by third party tool.
- if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":
- NeedProcessVpdMapFile = True
-
-
- if (self.Platform.FlashDefinition == None or self.Platform.FlashDefinition == '') and \
- VpdFile.GetCount() != 0:
- EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,
- "Fail to get FLASH_DEFINITION definition in DSC file %s which is required when DSC contains VPD PCD." % str(self.Platform.MetaFile))
-
- if VpdFile.GetCount() != 0:
- DscTimeStamp = self.Platform.MetaFile.TimeStamp
- FvPath = os.path.join(self.BuildDir, "FV")
- if not os.path.exists(FvPath):
- try:
- os.makedirs(FvPath)
- except:
- EdkLogger.error("build", FILE_WRITE_FAILURE, "Fail to create FV folder under %s" % self.BuildDir)
-
-
- VpdFilePath = os.path.join(FvPath, "%s.txt" % self.Platform.VpdToolGuid)
-
-
- if not os.path.exists(VpdFilePath) or os.path.getmtime(VpdFilePath) < DscTimeStamp:
- VpdFile.Write(VpdFilePath)
-
- # retrieve BPDG tool's path from tool_def.txt according to VPD_TOOL_GUID defined in DSC file.
- BPDGToolName = None
- for ToolDef in self.ToolDefinition.values():
- if ToolDef.has_key("GUID") and ToolDef["GUID"] == self.Platform.VpdToolGuid:
- if not ToolDef.has_key("PATH"):
- EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "PATH attribute was not provided for BPDG guid tool %s in tools_def.txt" % self.Platform.VpdToolGuid)
- BPDGToolName = ToolDef["PATH"]
- break
- # Call third party GUID BPDG tool.
- if BPDGToolName != None:
- VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath)
- else:
- EdkLogger.error("Build", FILE_NOT_FOUND, "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")
-
- # Process VPD map file generated by third party BPDG tool
- if NeedProcessVpdMapFile:
- VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid)
- if os.path.exists(VpdMapFilePath):
- VpdFile.Read(VpdMapFilePath)
-
- # Fixup "*" offset
- for Pcd in self._DynamicPcdList:
- # just pick the a value to determine whether is unicode string type
- Sku = Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]]
- if Sku.VpdOffset == "*":
- Sku.VpdOffset = VpdFile.GetOffset(Pcd)[0].strip()
- else:
- EdkLogger.error("build", FILE_READ_FAILURE, "Can not find VPD map file %s to fix up VPD offset." % VpdMapFilePath)
-
- # Delete the DynamicPcdList At the last time enter into this function
- del self._DynamicPcdList[:]
- self._DynamicPcdList.extend(UnicodePcdArray)
- self._DynamicPcdList.extend(HiiPcdArray)
- self._DynamicPcdList.extend(OtherPcdArray)
-
-
- ## Return the platform build data object
- def _GetPlatform(self):
- if self._Platform == None:
- self._Platform = self.BuildDatabase[self.MetaFile, self.Arch, self.BuildTarget, self.ToolChain]
- return self._Platform
-
- ## Return platform name
- def _GetName(self):
- return self.Platform.PlatformName
-
- ## Return the meta file GUID
- def _GetGuid(self):
- return self.Platform.Guid
-
- ## Return the platform version
- def _GetVersion(self):
- return self.Platform.Version
-
- ## Return the FDF file name
- def _GetFdfFile(self):
- if self._FdfFile == None:
- if self.Workspace.FdfFile != "":
- self._FdfFile= path.join(self.WorkspaceDir, self.Workspace.FdfFile)
- else:
- self._FdfFile = ''
- return self._FdfFile
-
- ## Return the build output directory platform specifies
- def _GetOutputDir(self):
- return self.Platform.OutputDirectory
-
- ## Return the directory to store all intermediate and final files built
- def _GetBuildDir(self):
- if self._BuildDir == None:
- if os.path.isabs(self.OutputDir):
- self._BuildDir = path.join(
- path.abspath(self.OutputDir),
- self.BuildTarget + "_" + self.ToolChain,
- )
- else:
- self._BuildDir = path.join(
- self.WorkspaceDir,
- self.OutputDir,
- self.BuildTarget + "_" + self.ToolChain,
- )
- return self._BuildDir
-
- ## Return directory of platform makefile
- #
- # @retval string Makefile directory
- #
- def _GetMakeFileDir(self):
- if self._MakeFileDir == None:
- self._MakeFileDir = path.join(self.BuildDir, self.Arch)
- return self._MakeFileDir
-
- ## Return build command string
- #
- # @retval string Build command string
- #
- def _GetBuildCommand(self):
- if self._BuildCommand == None:
- self._BuildCommand = []
- if "MAKE" in self.ToolDefinition and "PATH" in self.ToolDefinition["MAKE"]:
- self._BuildCommand += SplitOption(self.ToolDefinition["MAKE"]["PATH"])
- if "FLAGS" in self.ToolDefinition["MAKE"]:
- NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()
- if NewOption != '':
- self._BuildCommand += SplitOption(NewOption)
- return self._BuildCommand
-
- ## Get tool chain definition
- #
- # Get each tool defition for given tool chain from tools_def.txt and platform
- #
- def _GetToolDefinition(self):
- if self._ToolDefinitions == None:
- ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDictionary
- if TAB_TOD_DEFINES_COMMAND_TYPE not in self.Workspace.ToolDef.ToolsDefTxtDatabase:
- EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "No tools found in configuration",
- ExtraData="[%s]" % self.MetaFile)
- self._ToolDefinitions = {}
- DllPathList = set()
- for Def in ToolDefinition:
- Target, Tag, Arch, Tool, Attr = Def.split("_")
- if Target != self.BuildTarget or Tag != self.ToolChain or Arch != self.Arch:
- continue
-
- Value = ToolDefinition[Def]
- # don't record the DLL
- if Attr == "DLL":
- DllPathList.add(Value)
- continue
-
- if Tool not in self._ToolDefinitions:
- self._ToolDefinitions[Tool] = {}
- self._ToolDefinitions[Tool][Attr] = Value
-
- ToolsDef = ''
- MakePath = ''
- if GlobalData.gOptions.SilentMode and "MAKE" in self._ToolDefinitions:
- if "FLAGS" not in self._ToolDefinitions["MAKE"]:
- self._ToolDefinitions["MAKE"]["FLAGS"] = ""
- self._ToolDefinitions["MAKE"]["FLAGS"] += " -s"
- MakeFlags = ''
- for Tool in self._ToolDefinitions:
- for Attr in self._ToolDefinitions[Tool]:
- Value = self._ToolDefinitions[Tool][Attr]
- if Tool in self.BuildOption and Attr in self.BuildOption[Tool]:
- # check if override is indicated
- if self.BuildOption[Tool][Attr].startswith('='):
- Value = self.BuildOption[Tool][Attr][1:]
- else:
- Value += " " + self.BuildOption[Tool][Attr]
-
- if Attr == "PATH":
- # Don't put MAKE definition in the file
- if Tool == "MAKE":
- MakePath = Value
- else:
- ToolsDef += "%s = %s\n" % (Tool, Value)
- elif Attr != "DLL":
- # Don't put MAKE definition in the file
- if Tool == "MAKE":
- if Attr == "FLAGS":
- MakeFlags = Value
- else:
- ToolsDef += "%s_%s = %s\n" % (Tool, Attr, Value)
- ToolsDef += "\n"
-
- SaveFileOnChange(self.ToolDefinitionFile, ToolsDef)
- for DllPath in DllPathList:
- os.environ["PATH"] = DllPath + os.pathsep + os.environ["PATH"]
- os.environ["MAKE_FLAGS"] = MakeFlags
-
- return self._ToolDefinitions
-
- ## Return the paths of tools
- def _GetToolDefFile(self):
- if self._ToolDefFile == None:
- self._ToolDefFile = os.path.join(self.MakeFileDir, "TOOLS_DEF." + self.Arch)
- return self._ToolDefFile
-
- ## Retrieve the toolchain family of given toolchain tag. Default to 'MSFT'.
- def _GetToolChainFamily(self):
- if self._ToolChainFamily == None:
- ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDatabase
- if TAB_TOD_DEFINES_FAMILY not in ToolDefinition \
- or self.ToolChain not in ToolDefinition[TAB_TOD_DEFINES_FAMILY] \
- or not ToolDefinition[TAB_TOD_DEFINES_FAMILY][self.ToolChain]:
- EdkLogger.verbose("No tool chain family found in configuration for %s. Default to MSFT." \
- % self.ToolChain)
- self._ToolChainFamily = "MSFT"
- else:
- self._ToolChainFamily = ToolDefinition[TAB_TOD_DEFINES_FAMILY][self.ToolChain]
- return self._ToolChainFamily
-
- def _GetBuildRuleFamily(self):
- if self._BuildRuleFamily == None:
- ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDatabase
- if TAB_TOD_DEFINES_BUILDRULEFAMILY not in ToolDefinition \
- or self.ToolChain not in ToolDefinition[TAB_TOD_DEFINES_BUILDRULEFAMILY] \
- or not ToolDefinition[TAB_TOD_DEFINES_BUILDRULEFAMILY][self.ToolChain]:
- EdkLogger.verbose("No tool chain family found in configuration for %s. Default to MSFT." \
- % self.ToolChain)
- self._BuildRuleFamily = "MSFT"
- else:
- self._BuildRuleFamily = ToolDefinition[TAB_TOD_DEFINES_BUILDRULEFAMILY][self.ToolChain]
- return self._BuildRuleFamily
-
- ## Return the build options specific for all modules in this platform
- def _GetBuildOptions(self):
- if self._BuildOption == None:
- self._BuildOption = self._ExpandBuildOption(self.Platform.BuildOptions)
- return self._BuildOption
-
- ## Return the build options specific for EDK modules in this platform
- def _GetEdkBuildOptions(self):
- if self._EdkBuildOption == None:
- self._EdkBuildOption = self._ExpandBuildOption(self.Platform.BuildOptions, EDK_NAME)
- return self._EdkBuildOption
-
- ## Return the build options specific for EDKII modules in this platform
- def _GetEdkIIBuildOptions(self):
- if self._EdkIIBuildOption == None:
- self._EdkIIBuildOption = self._ExpandBuildOption(self.Platform.BuildOptions, EDKII_NAME)
- return self._EdkIIBuildOption
-
- ## Parse build_rule.txt in $(WORKSPACE)/Conf/build_rule.txt
- #
- # @retval BuildRule object
- #
- def _GetBuildRule(self):
- if self._BuildRule == None:
- BuildRuleFile = None
- if TAB_TAT_DEFINES_BUILD_RULE_CONF in self.Workspace.TargetTxt.TargetTxtDictionary:
- BuildRuleFile = self.Workspace.TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_BUILD_RULE_CONF]
- if BuildRuleFile in [None, '']:
- BuildRuleFile = gBuildRuleFile
- self._BuildRule = BuildRule(BuildRuleFile)
- if self._BuildRule._FileVersion == "":
- self._BuildRule._FileVersion = AutoGenReqBuildRuleVerNum
- else:
- if self._BuildRule._FileVersion < AutoGenReqBuildRuleVerNum :
- # If Build Rule's version is less than the version number required by the tools, halting the build.
- EdkLogger.error("build", AUTOGEN_ERROR,
- ExtraData="The version number [%s] of build_rule.txt is less than the version number required by the AutoGen.(the minimum required version number is [%s])"\
- % (self._BuildRule._FileVersion, AutoGenReqBuildRuleVerNum))
-
- return self._BuildRule
-
- ## Summarize the packages used by modules in this platform
- def _GetPackageList(self):
- if self._PackageList == None:
- self._PackageList = set()
- for La in self.LibraryAutoGenList:
- self._PackageList.update(La.DependentPackageList)
- for Ma in self.ModuleAutoGenList:
- self._PackageList.update(Ma.DependentPackageList)
- self._PackageList = list(self._PackageList)
- return self._PackageList
-
- ## Get list of non-dynamic PCDs
- def _GetNonDynamicPcdList(self):
- if self._NonDynamicPcdList == None:
- self.CollectPlatformDynamicPcds()
- return self._NonDynamicPcdList
-
- ## Get list of dynamic PCDs
- def _GetDynamicPcdList(self):
- if self._DynamicPcdList == None:
- self.CollectPlatformDynamicPcds()
- return self._DynamicPcdList
-
- ## Generate Token Number for all PCD
- def _GetPcdTokenNumbers(self):
- if self._PcdTokenNumber == None:
- self._PcdTokenNumber = sdict()
- TokenNumber = 1
- #
- # Make the Dynamic and DynamicEx PCD use within different TokenNumber area.
- # Such as:
- #
- # Dynamic PCD:
- # TokenNumber 0 ~ 10
- # DynamicEx PCD:
- # TokeNumber 11 ~ 20
- #
- for Pcd in self.DynamicPcdList:
- if Pcd.Phase == "PEI":
- if Pcd.Type in ["Dynamic", "DynamicDefault", "DynamicVpd", "DynamicHii"]:
- EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))
- self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber
- TokenNumber += 1
-
- for Pcd in self.DynamicPcdList:
- if Pcd.Phase == "PEI":
- if Pcd.Type in ["DynamicEx", "DynamicExDefault", "DynamicExVpd", "DynamicExHii"]:
- EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))
- self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber
- TokenNumber += 1
-
- for Pcd in self.DynamicPcdList:
- if Pcd.Phase == "DXE":
- if Pcd.Type in ["Dynamic", "DynamicDefault", "DynamicVpd", "DynamicHii"]:
- EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))
- self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber
- TokenNumber += 1
-
- for Pcd in self.DynamicPcdList:
- if Pcd.Phase == "DXE":
- if Pcd.Type in ["DynamicEx", "DynamicExDefault", "DynamicExVpd", "DynamicExHii"]:
- EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))
- self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber
- TokenNumber += 1
-
- for Pcd in self.NonDynamicPcdList:
- self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber
- TokenNumber += 1
- return self._PcdTokenNumber
-
- ## Summarize ModuleAutoGen objects of all modules/libraries to be built for this platform
- def _GetAutoGenObjectList(self):
- self._ModuleAutoGenList = []
- self._LibraryAutoGenList = []
- for ModuleFile in self.Platform.Modules:
- Ma = ModuleAutoGen(
- self.Workspace,
- ModuleFile,
- self.BuildTarget,
- self.ToolChain,
- self.Arch,
- self.MetaFile
- )
- if Ma not in self._ModuleAutoGenList:
- self._ModuleAutoGenList.append(Ma)
- for La in Ma.LibraryAutoGenList:
- if La not in self._LibraryAutoGenList:
- self._LibraryAutoGenList.append(La)
-
- ## Summarize ModuleAutoGen objects of all modules to be built for this platform
- def _GetModuleAutoGenList(self):
- if self._ModuleAutoGenList == None:
- self._GetAutoGenObjectList()
- return self._ModuleAutoGenList
-
- ## Summarize ModuleAutoGen objects of all libraries to be built for this platform
- def _GetLibraryAutoGenList(self):
- if self._LibraryAutoGenList == None:
- self._GetAutoGenObjectList()
- return self._LibraryAutoGenList
-
- ## Test if a module is supported by the platform
- #
- # An error will be raised directly if the module or its arch is not supported
- # by the platform or current configuration
- #
- def ValidModule(self, Module):
- return Module in self.Platform.Modules or Module in self.Platform.LibraryInstances
-
- ## Resolve the library classes in a module to library instances
- #
- # This method will not only resolve library classes but also sort the library
- # instances according to the dependency-ship.
- #
- # @param Module The module from which the library classes will be resolved
- #
- # @retval library_list List of library instances sorted
- #
- def ApplyLibraryInstance(self, Module):
- ModuleType = Module.ModuleType
-
- # for overridding library instances with module specific setting
- PlatformModule = self.Platform.Modules[str(Module)]
-
- # add forced library instances (specified under LibraryClasses sections)
- #
- # If a module has a MODULE_TYPE of USER_DEFINED,
- # do not link in NULL library class instances from the global [LibraryClasses.*] sections.
- #
- if Module.ModuleType != SUP_MODULE_USER_DEFINED:
- for LibraryClass in self.Platform.LibraryClasses.GetKeys():
- if LibraryClass.startswith("NULL") and self.Platform.LibraryClasses[LibraryClass, Module.ModuleType]:
- Module.LibraryClasses[LibraryClass] = self.Platform.LibraryClasses[LibraryClass, Module.ModuleType]
-
- # add forced library instances (specified in module overrides)
- for LibraryClass in PlatformModule.LibraryClasses:
- if LibraryClass.startswith("NULL"):
- Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]
-
- # EdkII module
- LibraryConsumerList = [Module]
- Constructor = []
- ConsumedByList = sdict()
- LibraryInstance = sdict()
-
- EdkLogger.verbose("")
- EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(Module), self.Arch))
- while len(LibraryConsumerList) > 0:
- M = LibraryConsumerList.pop()
- for LibraryClassName in M.LibraryClasses:
- if LibraryClassName not in LibraryInstance:
- # override library instance for this module
- if LibraryClassName in PlatformModule.LibraryClasses:
- LibraryPath = PlatformModule.LibraryClasses[LibraryClassName]
- else:
- LibraryPath = self.Platform.LibraryClasses[LibraryClassName, ModuleType]
- if LibraryPath == None or LibraryPath == "":
- LibraryPath = M.LibraryClasses[LibraryClassName]
- if LibraryPath == None or LibraryPath == "":
- EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,
- "Instance of library class [%s] is not found" % LibraryClassName,
- File=self.MetaFile,
- ExtraData="in [%s] [%s]\n\tconsumed by module [%s]" % (str(M), self.Arch, str(Module)))
-
- LibraryModule = self.BuildDatabase[LibraryPath, self.Arch, self.BuildTarget, self.ToolChain]
- # for those forced library instance (NULL library), add a fake library class
- if LibraryClassName.startswith("NULL"):
- LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, [ModuleType]))
- elif LibraryModule.LibraryClass == None \
- or len(LibraryModule.LibraryClass) == 0 \
- or (ModuleType != 'USER_DEFINED'
- and ModuleType not in LibraryModule.LibraryClass[0].SupModList):
- # only USER_DEFINED can link against any library instance despite of its SupModList
- EdkLogger.error("build", OPTION_MISSING,
- "Module type [%s] is not supported by library instance [%s]" \
- % (ModuleType, LibraryPath), File=self.MetaFile,
- ExtraData="consumed by [%s]" % str(Module))
-
- LibraryInstance[LibraryClassName] = LibraryModule
- LibraryConsumerList.append(LibraryModule)
- EdkLogger.verbose("\t" + str(LibraryClassName) + " : " + str(LibraryModule))
- else:
- LibraryModule = LibraryInstance[LibraryClassName]
-
- if LibraryModule == None:
- continue
-
- if LibraryModule.ConstructorList != [] and LibraryModule not in Constructor:
- Constructor.append(LibraryModule)
-
- if LibraryModule not in ConsumedByList:
- ConsumedByList[LibraryModule] = []
- # don't add current module itself to consumer list
- if M != Module:
- if M in ConsumedByList[LibraryModule]:
- continue
- ConsumedByList[LibraryModule].append(M)
- #
- # Initialize the sorted output list to the empty set
- #
- SortedLibraryList = []
- #
- # Q <- Set of all nodes with no incoming edges
- #
- LibraryList = [] #LibraryInstance.values()
- Q = []
- for LibraryClassName in LibraryInstance:
- M = LibraryInstance[LibraryClassName]
- LibraryList.append(M)
- if ConsumedByList[M] == []:
- Q.append(M)
-
- #
- # start the DAG algorithm
- #
- while True:
- EdgeRemoved = True
- while Q == [] and EdgeRemoved:
- EdgeRemoved = False
- # for each node Item with a Constructor
- for Item in LibraryList:
- if Item not in Constructor:
- continue
- # for each Node without a constructor with an edge e from Item to Node
- for Node in ConsumedByList[Item]:
- if Node in Constructor:
- continue
- # remove edge e from the graph if Node has no constructor
- ConsumedByList[Item].remove(Node)
- EdgeRemoved = True
- if ConsumedByList[Item] == []:
- # insert Item into Q
- Q.insert(0, Item)
- break
- if Q != []:
- break
- # DAG is done if there's no more incoming edge for all nodes
- if Q == []:
- break
-
- # remove node from Q
- Node = Q.pop()
- # output Node
- SortedLibraryList.append(Node)
-
- # for each node Item with an edge e from Node to Item do
- for Item in LibraryList:
- if Node not in ConsumedByList[Item]:
- continue
- # remove edge e from the graph
- ConsumedByList[Item].remove(Node)
-
- if ConsumedByList[Item] != []:
- continue
- # insert Item into Q, if Item has no other incoming edges
- Q.insert(0, Item)
-
- #
- # if any remaining node Item in the graph has a constructor and an incoming edge, then the graph has a cycle
- #
- for Item in LibraryList:
- if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:
- ErrorMessage = "\tconsumed by " + "\n\tconsumed by ".join([str(L) for L in ConsumedByList[Item]])
- EdkLogger.error("build", BUILD_ERROR, 'Library [%s] with constructors has a cycle' % str(Item),
- ExtraData=ErrorMessage, File=self.MetaFile)
- if Item not in SortedLibraryList:
- SortedLibraryList.append(Item)
-
- #
- # Build the list of constructor and destructir names
- # The DAG Topo sort produces the destructor order, so the list of constructors must generated in the reverse order
- #
- SortedLibraryList.reverse()
- return SortedLibraryList
-
-
- ## Override PCD setting (type, value, ...)
- #
- # @param ToPcd The PCD to be overrided
- # @param FromPcd The PCD overrideing from
- #
- def _OverridePcd(self, ToPcd, FromPcd, Module=""):
- #
- # in case there's PCDs coming from FDF file, which have no type given.
- # at this point, ToPcd.Type has the type found from dependent
- # package
- #
- if FromPcd != None:
- if ToPcd.Pending and FromPcd.Type not in [None, '']:
- ToPcd.Type = FromPcd.Type
- elif (ToPcd.Type not in [None, '']) and (FromPcd.Type not in [None, ''])\
- and (ToPcd.Type != FromPcd.Type) and (ToPcd.Type in FromPcd.Type):
- if ToPcd.Type.strip() == "DynamicEx":
- ToPcd.Type = FromPcd.Type
- elif ToPcd.Type not in [None, ''] and FromPcd.Type not in [None, ''] \
- and ToPcd.Type != FromPcd.Type:
- EdkLogger.error("build", OPTION_CONFLICT, "Mismatched PCD type",
- ExtraData="%s.%s is defined as [%s] in module %s, but as [%s] in platform."\
- % (ToPcd.TokenSpaceGuidCName, ToPcd.TokenCName,
- ToPcd.Type, Module, FromPcd.Type),
- File=self.MetaFile)
-
- if FromPcd.MaxDatumSize not in [None, '']:
- ToPcd.MaxDatumSize = FromPcd.MaxDatumSize
- if FromPcd.DefaultValue not in [None, '']:
- ToPcd.DefaultValue = FromPcd.DefaultValue
- if FromPcd.TokenValue not in [None, '']:
- ToPcd.TokenValue = FromPcd.TokenValue
- if FromPcd.MaxDatumSize not in [None, '']:
- ToPcd.MaxDatumSize = FromPcd.MaxDatumSize
- if FromPcd.DatumType not in [None, '']:
- ToPcd.DatumType = FromPcd.DatumType
- if FromPcd.SkuInfoList not in [None, '', []]:
- ToPcd.SkuInfoList = FromPcd.SkuInfoList
-
- # check the validation of datum
- IsValid, Cause = CheckPcdDatum(ToPcd.DatumType, ToPcd.DefaultValue)
- if not IsValid:
- EdkLogger.error('build', FORMAT_INVALID, Cause, File=self.MetaFile,
- ExtraData="%s.%s" % (ToPcd.TokenSpaceGuidCName, ToPcd.TokenCName))
-
- if ToPcd.DatumType == "VOID*" and ToPcd.MaxDatumSize in ['', None]:
- EdkLogger.debug(EdkLogger.DEBUG_9, "No MaxDatumSize specified for PCD %s.%s" \
- % (ToPcd.TokenSpaceGuidCName, ToPcd.TokenCName))
- Value = ToPcd.DefaultValue
- if Value in [None, '']:
- ToPcd.MaxDatumSize = 1
- elif Value[0] == 'L':
- ToPcd.MaxDatumSize = str(len(Value) * 2)
- elif Value[0] == '{':
- ToPcd.MaxDatumSize = str(len(Value.split(',')))
- else:
- ToPcd.MaxDatumSize = str(len(Value))
-
- # apply default SKU for dynamic PCDS if specified one is not available
- if (ToPcd.Type in PCD_DYNAMIC_TYPE_LIST or ToPcd.Type in PCD_DYNAMIC_EX_TYPE_LIST) \
- and ToPcd.SkuInfoList in [None, {}, '']:
- if self.Platform.SkuName in self.Platform.SkuIds:
- SkuName = self.Platform.SkuName
- else:
- SkuName = 'DEFAULT'
- ToPcd.SkuInfoList = {
- SkuName : SkuInfoClass(SkuName, self.Platform.SkuIds[SkuName], '', '', '', '', '', ToPcd.DefaultValue)
- }
-
- ## Apply PCD setting defined platform to a module
- #
- # @param Module The module from which the PCD setting will be overrided
- #
- # @retval PCD_list The list PCDs with settings from platform
- #
- def ApplyPcdSetting(self, Module, Pcds):
- # for each PCD in module
- for Name,Guid in Pcds:
- PcdInModule = Pcds[Name,Guid]
- # find out the PCD setting in platform
- if (Name,Guid) in self.Platform.Pcds:
- PcdInPlatform = self.Platform.Pcds[Name,Guid]
- else:
- PcdInPlatform = None
- # then override the settings if any
- self._OverridePcd(PcdInModule, PcdInPlatform, Module)
- # resolve the VariableGuid value
- for SkuId in PcdInModule.SkuInfoList:
- Sku = PcdInModule.SkuInfoList[SkuId]
- if Sku.VariableGuid == '': continue
- Sku.VariableGuidValue = GuidValue(Sku.VariableGuid, self.PackageList)
- if Sku.VariableGuidValue == None:
- PackageList = "\n\t".join([str(P) for P in self.PackageList])
- EdkLogger.error(
- 'build',
- RESOURCE_NOT_AVAILABLE,
- "Value of GUID [%s] is not found in" % Sku.VariableGuid,
- ExtraData=PackageList + "\n\t(used with %s.%s from module %s)" \
- % (Guid, Name, str(Module)),
- File=self.MetaFile
- )
-
- # override PCD settings with module specific setting
- if Module in self.Platform.Modules:
- PlatformModule = self.Platform.Modules[str(Module)]
- for Key in PlatformModule.Pcds:
- if Key in Pcds:
- self._OverridePcd(Pcds[Key], PlatformModule.Pcds[Key], Module)
- return Pcds.values()
-
- ## Resolve library names to library modules
- #
- # (for Edk.x modules)
- #
- # @param Module The module from which the library names will be resolved
- #
- # @retval library_list The list of library modules
- #
- def ResolveLibraryReference(self, Module):
- EdkLogger.verbose("")
- EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(Module), self.Arch))
- LibraryConsumerList = [Module]
-
- # "CompilerStub" is a must for Edk modules
- if Module.Libraries:
- Module.Libraries.append("CompilerStub")
- LibraryList = []
- while len(LibraryConsumerList) > 0:
- M = LibraryConsumerList.pop()
- for LibraryName in M.Libraries:
- Library = self.Platform.LibraryClasses[LibraryName, ':dummy:']
- if Library == None:
- for Key in self.Platform.LibraryClasses.data.keys():
- if LibraryName.upper() == Key.upper():
- Library = self.Platform.LibraryClasses[Key, ':dummy:']
- break
- if Library == None:
- EdkLogger.warn("build", "Library [%s] is not found" % LibraryName, File=str(M),
- ExtraData="\t%s [%s]" % (str(Module), self.Arch))
- continue
-
- if Library not in LibraryList:
- LibraryList.append(Library)
- LibraryConsumerList.append(Library)
- EdkLogger.verbose("\t" + LibraryName + " : " + str(Library) + ' ' + str(type(Library)))
- return LibraryList
-
- ## Calculate the priority value of the build option
- #
- # @param Key Build option definition contain: TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE
- #
- # @retval Value Priority value based on the priority list.
- #
- def CalculatePriorityValue(self, Key):
- Target, ToolChain, Arch, CommandType, Attr = Key.split('_')
- PriorityValue = 0x11111
- if Target == "*":
- PriorityValue &= 0x01111
- if ToolChain == "*":
- PriorityValue &= 0x10111
- if Arch == "*":
- PriorityValue &= 0x11011
- if CommandType == "*":
- PriorityValue &= 0x11101
- if Attr == "*":
- PriorityValue &= 0x11110
-
- return self.PrioList["0x%0.5x"%PriorityValue]
-
-
- ## Expand * in build option key
- #
- # @param Options Options to be expanded
- #
- # @retval options Options expanded
- #
- def _ExpandBuildOption(self, Options, ModuleStyle=None):
- BuildOptions = {}
- FamilyMatch = False
- FamilyIsNull = True
-
- OverrideList = {}
- #
- # Construct a list contain the build options which need override.
- #
- for Key in Options:
- #
- # Key[0] -- tool family
- # Key[1] -- TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE
- #
- if Key[0] == self.BuildRuleFamily :
- Target, ToolChain, Arch, CommandType, Attr = Key[1].split('_')
- if Target == self.BuildTarget or Target == "*":
- if ToolChain == self.ToolChain or ToolChain == "*":
- if Arch == self.Arch or Arch == "*":
- if Options[Key].startswith("="):
- if OverrideList.get(Key[1]) != None:
- OverrideList.pop(Key[1])
- OverrideList[Key[1]] = Options[Key]
-
- #
- # Use the highest priority value.
- #
- if (len(OverrideList) >= 2):
- KeyList = OverrideList.keys()
- for Index in range(len(KeyList)):
- NowKey = KeyList[Index]
- Target1, ToolChain1, Arch1, CommandType1, Attr1 = NowKey.split("_")
- for Index1 in range(len(KeyList) - Index - 1):
- NextKey = KeyList[Index1 + Index + 1]
- #
- # Compare two Key, if one is included by another, choose the higher priority one
- #
- Target2, ToolChain2, Arch2, CommandType2, Attr2 = NextKey.split("_")
- if Target1 == Target2 or Target1 == "*" or Target2 == "*":
- if ToolChain1 == ToolChain2 or ToolChain1 == "*" or ToolChain2 == "*":
- if Arch1 == Arch2 or Arch1 == "*" or Arch2 == "*":
- if CommandType1 == CommandType2 or CommandType1 == "*" or CommandType2 == "*":
- if Attr1 == Attr2 or Attr1 == "*" or Attr2 == "*":
- if self.CalculatePriorityValue(NowKey) > self.CalculatePriorityValue(NextKey):
- if Options.get((self.BuildRuleFamily, NextKey)) != None:
- Options.pop((self.BuildRuleFamily, NextKey))
- else:
- if Options.get((self.BuildRuleFamily, NowKey)) != None:
- Options.pop((self.BuildRuleFamily, NowKey))
-
-
- for Key in Options:
- if ModuleStyle != None and len (Key) > 2:
- # Check Module style is EDK or EDKII.
- # Only append build option for the matched style module.
- if ModuleStyle == EDK_NAME and Key[2] != EDK_NAME:
- continue
- elif ModuleStyle == EDKII_NAME and Key[2] != EDKII_NAME:
- continue
- Family = Key[0]
- Target, Tag, Arch, Tool, Attr = Key[1].split("_")
- # if tool chain family doesn't match, skip it
- if Tool in self.ToolDefinition and Family != "":
- FamilyIsNull = False
- if self.ToolDefinition[Tool].get(TAB_TOD_DEFINES_BUILDRULEFAMILY, "") != "":
- if Family != self.ToolDefinition[Tool][TAB_TOD_DEFINES_BUILDRULEFAMILY]:
- continue
- elif Family != self.ToolDefinition[Tool][TAB_TOD_DEFINES_FAMILY]:
- continue
- FamilyMatch = True
- # expand any wildcard
- if Target == "*" or Target == self.BuildTarget:
- if Tag == "*" or Tag == self.ToolChain:
- if Arch == "*" or Arch == self.Arch:
- if Tool not in BuildOptions:
- BuildOptions[Tool] = {}
- if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:
- BuildOptions[Tool][Attr] = Options[Key]
- else:
- # append options for the same tool
- BuildOptions[Tool][Attr] += " " + Options[Key]
- # Build Option Family has been checked, which need't to be checked again for family.
- if FamilyMatch or FamilyIsNull:
- return BuildOptions
-
- for Key in Options:
- if ModuleStyle != None and len (Key) > 2:
- # Check Module style is EDK or EDKII.
- # Only append build option for the matched style module.
- if ModuleStyle == EDK_NAME and Key[2] != EDK_NAME:
- continue
- elif ModuleStyle == EDKII_NAME and Key[2] != EDKII_NAME:
- continue
- Family = Key[0]
- Target, Tag, Arch, Tool, Attr = Key[1].split("_")
- # if tool chain family doesn't match, skip it
- if Tool not in self.ToolDefinition or Family =="":
- continue
- # option has been added before
- if Family != self.ToolDefinition[Tool][TAB_TOD_DEFINES_FAMILY]:
- continue
-
- # expand any wildcard
- if Target == "*" or Target == self.BuildTarget:
- if Tag == "*" or Tag == self.ToolChain:
- if Arch == "*" or Arch == self.Arch:
- if Tool not in BuildOptions:
- BuildOptions[Tool] = {}
- if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:
- BuildOptions[Tool][Attr] = Options[Key]
- else:
- # append options for the same tool
- BuildOptions[Tool][Attr] += " " + Options[Key]
- return BuildOptions
-
- ## Append build options in platform to a module
- #
- # @param Module The module to which the build options will be appened
- #
- # @retval options The options appended with build options in platform
- #
- def ApplyBuildOption(self, Module):
- # Get the different options for the different style module
- if Module.AutoGenVersion < 0x00010005:
- PlatformOptions = self.EdkBuildOption
- else:
- PlatformOptions = self.EdkIIBuildOption
- ModuleOptions = self._ExpandBuildOption(Module.BuildOptions)
- if Module in self.Platform.Modules:
- PlatformModule = self.Platform.Modules[str(Module)]
- PlatformModuleOptions = self._ExpandBuildOption(PlatformModule.BuildOptions)
- else:
- PlatformModuleOptions = {}
-
- AllTools = set(ModuleOptions.keys() + PlatformOptions.keys() + PlatformModuleOptions.keys() + self.ToolDefinition.keys())
- BuildOptions = {}
- for Tool in AllTools:
- if Tool not in BuildOptions:
- BuildOptions[Tool] = {}
-
- for Options in [self.ToolDefinition, ModuleOptions, PlatformOptions, PlatformModuleOptions]:
- if Tool not in Options:
- continue
- for Attr in Options[Tool]:
- Value = Options[Tool][Attr]
- if Attr not in BuildOptions[Tool]:
- BuildOptions[Tool][Attr] = ""
- # check if override is indicated
- if Value.startswith('='):
- BuildOptions[Tool][Attr] = Value[1:]
- else:
- BuildOptions[Tool][Attr] += " " + Value
- if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag != None:
- #
- # Override UNI flag only for EDK module.
- #
- if 'BUILD' not in BuildOptions:
- BuildOptions['BUILD'] = {}
- BuildOptions['BUILD']['FLAGS'] = self.Workspace.UniFlag
- return BuildOptions
-
- Platform = property(_GetPlatform)
- Name = property(_GetName)
- Guid = property(_GetGuid)
- Version = property(_GetVersion)
-
- OutputDir = property(_GetOutputDir)
- BuildDir = property(_GetBuildDir)
- MakeFileDir = property(_GetMakeFileDir)
- FdfFile = property(_GetFdfFile)
-
- PcdTokenNumber = property(_GetPcdTokenNumbers) # (TokenCName, TokenSpaceGuidCName) : GeneratedTokenNumber
- DynamicPcdList = property(_GetDynamicPcdList) # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
- NonDynamicPcdList = property(_GetNonDynamicPcdList) # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
- PackageList = property(_GetPackageList)
-
- ToolDefinition = property(_GetToolDefinition) # toolcode : tool path
- ToolDefinitionFile = property(_GetToolDefFile) # toolcode : lib path
- ToolChainFamily = property(_GetToolChainFamily)
- BuildRuleFamily = property(_GetBuildRuleFamily)
- BuildOption = property(_GetBuildOptions) # toolcode : option
- EdkBuildOption = property(_GetEdkBuildOptions) # edktoolcode : option
- EdkIIBuildOption = property(_GetEdkIIBuildOptions) # edkiitoolcode : option
-
- BuildCommand = property(_GetBuildCommand)
- BuildRule = property(_GetBuildRule)
- ModuleAutoGenList = property(_GetModuleAutoGenList)
- LibraryAutoGenList = property(_GetLibraryAutoGenList)
-
-## ModuleAutoGen class
-#
-# This class encapsules the AutoGen behaviors for the build tools. In addition to
-# the generation of AutoGen.h and AutoGen.c, it will generate *.depex file according
-# to the [depex] section in module's inf file.
-#
-class ModuleAutoGen(AutoGen):
- ## The real constructor of ModuleAutoGen
- #
- # This method is not supposed to be called by users of ModuleAutoGen. It's
- # only used by factory method __new__() to do real initialization work for an
- # object of ModuleAutoGen
- #
- # @param Workspace EdkIIWorkspaceBuild object
- # @param ModuleFile The path of module file
- # @param Target Build target (DEBUG, RELEASE)
- # @param Toolchain Name of tool chain
- # @param Arch The arch the module supports
- # @param PlatformFile Platform meta-file
- #
- def _Init(self, Workspace, ModuleFile, Target, Toolchain, Arch, PlatformFile):
- EdkLogger.debug(EdkLogger.DEBUG_9, "AutoGen module [%s] [%s]" % (ModuleFile, Arch))
- GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (ModuleFile, Arch, Toolchain, Target)
-
- self.Workspace = Workspace
- self.WorkspaceDir = Workspace.WorkspaceDir
-
- self.MetaFile = ModuleFile
- self.PlatformInfo = PlatformAutoGen(Workspace, PlatformFile, Target, Toolchain, Arch)
- # check if this module is employed by active platform
- if not self.PlatformInfo.ValidModule(self.MetaFile):
- EdkLogger.verbose("Module [%s] for [%s] is not employed by active platform\n" \
- % (self.MetaFile, Arch))
- return False
-
- self.SourceDir = self.MetaFile.SubDir
- self.SourceOverrideDir = None
- # use overrided path defined in DSC file
- if self.MetaFile.Key in GlobalData.gOverrideDir:
- self.SourceOverrideDir = GlobalData.gOverrideDir[self.MetaFile.Key]
-
- self.ToolChain = Toolchain
- self.BuildTarget = Target
- self.Arch = Arch
- self.ToolChainFamily = self.PlatformInfo.ToolChainFamily
- self.BuildRuleFamily = self.PlatformInfo.BuildRuleFamily
-
- self.IsMakeFileCreated = False
- self.IsCodeFileCreated = False
- self.IsAsBuiltInfCreated = False
- self.DepexGenerated = False
-
- self.BuildDatabase = self.Workspace.BuildDatabase
-
- self._Module = None
- self._Name = None
- self._Guid = None
- self._Version = None
- self._ModuleType = None
- self._ComponentType = None
- self._PcdIsDriver = None
- self._AutoGenVersion = None
- self._LibraryFlag = None
- self._CustomMakefile = None
- self._Macro = None
-
- self._BuildDir = None
- self._OutputDir = None
- self._DebugDir = None
- self._MakeFileDir = None
-
- self._IncludePathList = None
- self._AutoGenFileList = None
- self._UnicodeFileList = None
- self._SourceFileList = None
- self._ObjectFileList = None
- self._BinaryFileList = None
-
- self._DependentPackageList = None
- self._DependentLibraryList = None
- self._LibraryAutoGenList = None
- self._DerivedPackageList = None
- self._ModulePcdList = None
- self._LibraryPcdList = None
- self._GuidList = None
- self._ProtocolList = None
- self._PpiList = None
- self._DepexList = None
- self._DepexExpressionList = None
- self._BuildOption = None
- self._BuildOptionIncPathList = None
- self._BuildTargets = None
- self._IntroBuildTargetList = None
- self._FinalBuildTargetList = None
- self._FileTypes = None
- self._BuildRules = None
-
- return True
-
- def __repr__(self):
- return "%s [%s]" % (self.MetaFile, self.Arch)
-
- # Macros could be used in build_rule.txt (also Makefile)
- def _GetMacros(self):
- if self._Macro == None:
- self._Macro = sdict()
- self._Macro["WORKSPACE" ] = self.WorkspaceDir
- self._Macro["MODULE_NAME" ] = self.Name
- self._Macro["MODULE_GUID" ] = self.Guid
- self._Macro["MODULE_VERSION" ] = self.Version
- self._Macro["MODULE_TYPE" ] = self.ModuleType
- self._Macro["MODULE_FILE" ] = str(self.MetaFile)
- self._Macro["MODULE_FILE_BASE_NAME" ] = self.MetaFile.BaseName
- self._Macro["MODULE_RELATIVE_DIR" ] = self.SourceDir
- self._Macro["MODULE_DIR" ] = self.SourceDir
-
- self._Macro["BASE_NAME" ] = self.Name
-
- self._Macro["ARCH" ] = self.Arch
- self._Macro["TOOLCHAIN" ] = self.ToolChain
- self._Macro["TOOLCHAIN_TAG" ] = self.ToolChain
- self._Macro["TOOL_CHAIN_TAG" ] = self.ToolChain
- self._Macro["TARGET" ] = self.BuildTarget
-
- self._Macro["BUILD_DIR" ] = self.PlatformInfo.BuildDir
- self._Macro["BIN_DIR" ] = os.path.join(self.PlatformInfo.BuildDir, self.Arch)
- self._Macro["LIB_DIR" ] = os.path.join(self.PlatformInfo.BuildDir, self.Arch)
- self._Macro["MODULE_BUILD_DIR" ] = self.BuildDir
- self._Macro["OUTPUT_DIR" ] = self.OutputDir
- self._Macro["DEBUG_DIR" ] = self.DebugDir
- return self._Macro
-
- ## Return the module build data object
- def _GetModule(self):
- if self._Module == None:
- self._Module = self.Workspace.BuildDatabase[self.MetaFile, self.Arch, self.BuildTarget, self.ToolChain]
- return self._Module
-
- ## Return the module name
- def _GetBaseName(self):
- return self.Module.BaseName
-
- ## Return the module DxsFile if exist
- def _GetDxsFile(self):
- return self.Module.DxsFile
-
- ## Return the module SourceOverridePath
- def _GetSourceOverridePath(self):
- return self.Module.SourceOverridePath
-
- ## Return the module meta-file GUID
- def _GetGuid(self):
- return self.Module.Guid
-
- ## Return the module version
- def _GetVersion(self):
- return self.Module.Version
-
- ## Return the module type
- def _GetModuleType(self):
- return self.Module.ModuleType
-
- ## Return the component type (for Edk.x style of module)
- def _GetComponentType(self):
- return self.Module.ComponentType
-
- ## Return the build type
- def _GetBuildType(self):
- return self.Module.BuildType
-
- ## Return the PCD_IS_DRIVER setting
- def _GetPcdIsDriver(self):
- return self.Module.PcdIsDriver
-
- ## Return the autogen version, i.e. module meta-file version
- def _GetAutoGenVersion(self):
- return self.Module.AutoGenVersion
-
- ## Check if the module is library or not
- def _IsLibrary(self):
- if self._LibraryFlag == None:
- if self.Module.LibraryClass != None and self.Module.LibraryClass != []:
- self._LibraryFlag = True
- else:
- self._LibraryFlag = False
- return self._LibraryFlag
-
- ## Return the directory to store intermediate files of the module
- def _GetBuildDir(self):
- if self._BuildDir == None:
- self._BuildDir = path.join(
- self.PlatformInfo.BuildDir,
- self.Arch,
- self.SourceDir,
- self.MetaFile.BaseName
- )
- CreateDirectory(self._BuildDir)
- return self._BuildDir
-
- ## Return the directory to store the intermediate object files of the mdoule
- def _GetOutputDir(self):
- if self._OutputDir == None:
- self._OutputDir = path.join(self.BuildDir, "OUTPUT")
- CreateDirectory(self._OutputDir)
- return self._OutputDir
-
- ## Return the directory to store auto-gened source files of the mdoule
- def _GetDebugDir(self):
- if self._DebugDir == None:
- self._DebugDir = path.join(self.BuildDir, "DEBUG")
- CreateDirectory(self._DebugDir)
- return self._DebugDir
-
- ## Return the path of custom file
- def _GetCustomMakefile(self):
- if self._CustomMakefile == None:
- self._CustomMakefile = {}
- for Type in self.Module.CustomMakefile:
- if Type in gMakeTypeMap:
- MakeType = gMakeTypeMap[Type]
- else:
- MakeType = 'nmake'
- if self.SourceOverrideDir != None:
- File = os.path.join(self.SourceOverrideDir, self.Module.CustomMakefile[Type])
- if not os.path.exists(File):
- File = os.path.join(self.SourceDir, self.Module.CustomMakefile[Type])
- else:
- File = os.path.join(self.SourceDir, self.Module.CustomMakefile[Type])
- self._CustomMakefile[MakeType] = File
- return self._CustomMakefile
-
- ## Return the directory of the makefile
- #
- # @retval string The directory string of module's makefile
- #
- def _GetMakeFileDir(self):
- return self.BuildDir
-
- ## Return build command string
- #
- # @retval string Build command string
- #
- def _GetBuildCommand(self):
- return self.PlatformInfo.BuildCommand
-
- ## Get object list of all packages the module and its dependent libraries belong to
- #
- # @retval list The list of package object
- #
- def _GetDerivedPackageList(self):
- PackageList = []
- for M in [self.Module] + self.DependentLibraryList:
- for Package in M.Packages:
- if Package in PackageList:
- continue
- PackageList.append(Package)
- return PackageList
-
- ## Merge dependency expression
- #
- # @retval list The token list of the dependency expression after parsed
- #
- def _GetDepexTokenList(self):
- if self._DepexList == None:
- self._DepexList = {}
- if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
- return self._DepexList
-
- self._DepexList[self.ModuleType] = []
-
- for ModuleType in self._DepexList:
- DepexList = self._DepexList[ModuleType]
- #
- # Append depex from dependent libraries, if not "BEFORE", "AFTER" expresion
- #
- for M in [self.Module] + self.DependentLibraryList:
- Inherited = False
- for D in M.Depex[self.Arch, ModuleType]:
- if DepexList != []:
- DepexList.append('AND')
- DepexList.append('(')
- DepexList.extend(D)
- if DepexList[-1] == 'END': # no need of a END at this time
- DepexList.pop()
- DepexList.append(')')
- Inherited = True
- if Inherited:
- EdkLogger.verbose("DEPEX[%s] (+%s) = %s" % (self.Name, M.BaseName, DepexList))
- if 'BEFORE' in DepexList or 'AFTER' in DepexList:
- break
- if len(DepexList) > 0:
- EdkLogger.verbose('')
- return self._DepexList
-
- ## Merge dependency expression
- #
- # @retval list The token list of the dependency expression after parsed
- #
- def _GetDepexExpressionTokenList(self):
- if self._DepexExpressionList == None:
- self._DepexExpressionList = {}
- if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
- return self._DepexExpressionList
-
- self._DepexExpressionList[self.ModuleType] = ''
-
- for ModuleType in self._DepexExpressionList:
- DepexExpressionList = self._DepexExpressionList[ModuleType]
- #
- # Append depex from dependent libraries, if not "BEFORE", "AFTER" expresion
- #
- for M in [self.Module] + self.DependentLibraryList:
- Inherited = False
- for D in M.DepexExpression[self.Arch, ModuleType]:
- if DepexExpressionList != '':
- DepexExpressionList += ' AND '
- DepexExpressionList += '('
- DepexExpressionList += D
- DepexExpressionList = DepexExpressionList.rstrip('END').strip()
- DepexExpressionList += ')'
- Inherited = True
- if Inherited:
- EdkLogger.verbose("DEPEX[%s] (+%s) = %s" % (self.Name, M.BaseName, DepexExpressionList))
- if 'BEFORE' in DepexExpressionList or 'AFTER' in DepexExpressionList:
- break
- if len(DepexExpressionList) > 0:
- EdkLogger.verbose('')
- self._DepexExpressionList[ModuleType] = DepexExpressionList
- return self._DepexExpressionList
-
- ## Return the list of specification version required for the module
- #
- # @retval list The list of specification defined in module file
- #
- def _GetSpecification(self):
- return self.Module.Specification
-
- ## Tool option for the module build
- #
- # @param PlatformInfo The object of PlatformBuildInfo
- # @retval dict The dict containing valid options
- #
- def _GetModuleBuildOption(self):
- if self._BuildOption == None:
- self._BuildOption = self.PlatformInfo.ApplyBuildOption(self.Module)
- return self._BuildOption
-
- ## Get include path list from tool option for the module build
- #
- # @retval list The include path list
- #
- def _GetBuildOptionIncPathList(self):
- if self._BuildOptionIncPathList == None:
- #
- # Regular expression for finding Include Directories, the difference between MSFT and INTEL/GCC/RVCT
- # is the former use /I , the Latter used -I to specify include directories
- #
- if self.PlatformInfo.ToolChainFamily in ('MSFT'):
- gBuildOptIncludePattern = re.compile(r"(?:.*?)/I[ \t]*([^ ]*)", re.MULTILINE|re.DOTALL)
- elif self.PlatformInfo.ToolChainFamily in ('INTEL', 'GCC', 'RVCT'):
- gBuildOptIncludePattern = re.compile(r"(?:.*?)-I[ \t]*([^ ]*)", re.MULTILINE|re.DOTALL)
- else:
- #
- # New ToolChainFamily, don't known whether there is option to specify include directories
- #
- self._BuildOptionIncPathList = []
- return self._BuildOptionIncPathList
-
- BuildOptionIncPathList = []
- for Tool in ('CC', 'PP', 'VFRPP', 'ASLPP', 'ASLCC', 'APP', 'ASM'):
- Attr = 'FLAGS'
- try:
- FlagOption = self.BuildOption[Tool][Attr]
- except KeyError:
- FlagOption = ''
-
- if self.PlatformInfo.ToolChainFamily != 'RVCT':
- IncPathList = [NormPath(Path, self.Macros) for Path in gBuildOptIncludePattern.findall(FlagOption)]
- else:
- #
- # RVCT may specify a list of directory seperated by commas
- #
- IncPathList = []
- for Path in gBuildOptIncludePattern.findall(FlagOption):
- PathList = GetSplitList(Path, TAB_COMMA_SPLIT)
- IncPathList += [NormPath(PathEntry, self.Macros) for PathEntry in PathList]
-
- #
- # EDK II modules must not reference header files outside of the packages they depend on or
- # within the module's directory tree. Report error if violation.
- #
- if self.AutoGenVersion >= 0x00010005 and len(IncPathList) > 0:
- for Path in IncPathList:
- if (Path not in self.IncludePathList) and (CommonPath([Path, self.MetaFile.Dir]) != self.MetaFile.Dir):
- ErrMsg = "The include directory for the EDK II module in this line is invalid %s specified in %s FLAGS '%s'" % (Path, Tool, FlagOption)
- EdkLogger.error("build",
- PARAMETER_INVALID,
- ExtraData = ErrMsg,
- File = str(self.MetaFile))
-
-
- BuildOptionIncPathList += IncPathList
-
- self._BuildOptionIncPathList = BuildOptionIncPathList
-
- return self._BuildOptionIncPathList
-
- ## Return a list of files which can be built from source
- #
- # What kind of files can be built is determined by build rules in
- # $(WORKSPACE)/Conf/build_rule.txt and toolchain family.
- #
- def _GetSourceFileList(self):
- if self._SourceFileList == None:
- self._SourceFileList = []
- for F in self.Module.Sources:
- # match tool chain
- if F.TagName not in ("", "*", self.ToolChain):
- EdkLogger.debug(EdkLogger.DEBUG_9, "The toolchain [%s] for processing file [%s] is found, "
- "but [%s] is needed" % (F.TagName, str(F), self.ToolChain))
- continue
- # match tool chain family
- if F.ToolChainFamily not in ("", "*", self.ToolChainFamily):
- EdkLogger.debug(
- EdkLogger.DEBUG_0,
- "The file [%s] must be built by tools of [%s], " \
- "but current toolchain family is [%s]" \
- % (str(F), F.ToolChainFamily, self.ToolChainFamily))
- continue
-
- # add the file path into search path list for file including
- if F.Dir not in self.IncludePathList and self.AutoGenVersion >= 0x00010005:
- self.IncludePathList.insert(0, F.Dir)
- self._SourceFileList.append(F)
- self._ApplyBuildRule(F, TAB_UNKNOWN_FILE)
- return self._SourceFileList
-
- ## Return the list of unicode files
- def _GetUnicodeFileList(self):
- if self._UnicodeFileList == None:
- if TAB_UNICODE_FILE in self.FileTypes:
- self._UnicodeFileList = self.FileTypes[TAB_UNICODE_FILE]
- else:
- self._UnicodeFileList = []
- return self._UnicodeFileList
-
- ## Return a list of files which can be built from binary
- #
- # "Build" binary files are just to copy them to build directory.
- #
- # @retval list The list of files which can be built later
- #
- def _GetBinaryFiles(self):
- if self._BinaryFileList == None:
- self._BinaryFileList = []
- for F in self.Module.Binaries:
- if F.Target not in ['COMMON', '*'] and F.Target != self.BuildTarget:
- continue
- self._BinaryFileList.append(F)
- self._ApplyBuildRule(F, F.Type)
- return self._BinaryFileList
-
- def _GetBuildRules(self):
- if self._BuildRules == None:
- BuildRules = {}
- BuildRuleDatabase = self.PlatformInfo.BuildRule
- for Type in BuildRuleDatabase.FileTypeList:
- #first try getting build rule by BuildRuleFamily
- RuleObject = BuildRuleDatabase[Type, self.BuildType, self.Arch, self.BuildRuleFamily]
- if not RuleObject:
- # build type is always module type, but ...
- if self.ModuleType != self.BuildType:
- RuleObject = BuildRuleDatabase[Type, self.ModuleType, self.Arch, self.BuildRuleFamily]
- #second try getting build rule by ToolChainFamily
- if not RuleObject:
- RuleObject = BuildRuleDatabase[Type, self.BuildType, self.Arch, self.ToolChainFamily]
- if not RuleObject:
- # build type is always module type, but ...
- if self.ModuleType != self.BuildType:
- RuleObject = BuildRuleDatabase[Type, self.ModuleType, self.Arch, self.ToolChainFamily]
- if not RuleObject:
- continue
- RuleObject = RuleObject.Instantiate(self.Macros)
- BuildRules[Type] = RuleObject
- for Ext in RuleObject.SourceFileExtList:
- BuildRules[Ext] = RuleObject
- self._BuildRules = BuildRules
- return self._BuildRules
-
- def _ApplyBuildRule(self, File, FileType):
- if self._BuildTargets == None:
- self._IntroBuildTargetList = set()
- self._FinalBuildTargetList = set()
- self._BuildTargets = {}
- self._FileTypes = {}
-
- LastTarget = None
- RuleChain = []
- SourceList = [File]
- Index = 0
- while Index < len(SourceList):
- Source = SourceList[Index]
- Index = Index + 1
-
- if Source != File:
- CreateDirectory(Source.Dir)
-
- if File.IsBinary and File == Source and self._BinaryFileList != None and File in self._BinaryFileList:
- # Skip all files that are not binary libraries
- if not self.IsLibrary:
- continue
- RuleObject = self.BuildRules[TAB_DEFAULT_BINARY_FILE]
- elif FileType in self.BuildRules:
- RuleObject = self.BuildRules[FileType]
- elif Source.Ext in self.BuildRules:
- RuleObject = self.BuildRules[Source.Ext]
- else:
- # stop at no more rules
- if LastTarget:
- self._FinalBuildTargetList.add(LastTarget)
- break
-
- FileType = RuleObject.SourceFileType
- if FileType not in self._FileTypes:
- self._FileTypes[FileType] = set()
- self._FileTypes[FileType].add(Source)
-
- # stop at STATIC_LIBRARY for library
- if self.IsLibrary and FileType == TAB_STATIC_LIBRARY:
- if LastTarget:
- self._FinalBuildTargetList.add(LastTarget)
- break
-
- Target = RuleObject.Apply(Source)
- if not Target:
- if LastTarget:
- self._FinalBuildTargetList.add(LastTarget)
- break
- elif not Target.Outputs:
- # Only do build for target with outputs
- self._FinalBuildTargetList.add(Target)
-
- if FileType not in self._BuildTargets:
- self._BuildTargets[FileType] = set()
- self._BuildTargets[FileType].add(Target)
-
- if not Source.IsBinary and Source == File:
- self._IntroBuildTargetList.add(Target)
-
- # to avoid cyclic rule
- if FileType in RuleChain:
- break
-
- RuleChain.append(FileType)
- SourceList.extend(Target.Outputs)
- LastTarget = Target
- FileType = TAB_UNKNOWN_FILE
-
- def _GetTargets(self):
- if self._BuildTargets == None:
- self._IntroBuildTargetList = set()
- self._FinalBuildTargetList = set()
- self._BuildTargets = {}
- self._FileTypes = {}
-
- #TRICK: call _GetSourceFileList to apply build rule for source files
- if self.SourceFileList:
- pass
-
- #TRICK: call _GetBinaryFileList to apply build rule for binary files
- if self.BinaryFileList:
- pass
-
- return self._BuildTargets
-
- def _GetIntroTargetList(self):
- self._GetTargets()
- return self._IntroBuildTargetList
-
- def _GetFinalTargetList(self):
- self._GetTargets()
- return self._FinalBuildTargetList
-
- def _GetFileTypes(self):
- self._GetTargets()
- return self._FileTypes
-
- ## Get the list of package object the module depends on
- #
- # @retval list The package object list
- #
- def _GetDependentPackageList(self):
- return self.Module.Packages
-
- ## Return the list of auto-generated code file
- #
- # @retval list The list of auto-generated file
- #
- def _GetAutoGenFileList(self):
- UniStringAutoGenC = True
- UniStringBinBuffer = StringIO()
- if self.BuildType == 'UEFI_HII':
- UniStringAutoGenC = False
- if self._AutoGenFileList == None:
- self._AutoGenFileList = {}
- AutoGenC = TemplateString()
- AutoGenH = TemplateString()
- StringH = TemplateString()
- GenC.CreateCode(self, AutoGenC, AutoGenH, StringH, UniStringAutoGenC, UniStringBinBuffer)
- if str(AutoGenC) != "" and TAB_C_CODE_FILE in self.FileTypes:
- AutoFile = PathClass(gAutoGenCodeFileName, self.DebugDir)
- self._AutoGenFileList[AutoFile] = str(AutoGenC)
- self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)
- if str(AutoGenH) != "":
- AutoFile = PathClass(gAutoGenHeaderFileName, self.DebugDir)
- self._AutoGenFileList[AutoFile] = str(AutoGenH)
- self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)
- if str(StringH) != "":
- AutoFile = PathClass(gAutoGenStringFileName % {"module_name":self.Name}, self.DebugDir)
- self._AutoGenFileList[AutoFile] = str(StringH)
- self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)
- if UniStringBinBuffer != None and UniStringBinBuffer.getvalue() != "":
- AutoFile = PathClass(gAutoGenStringFormFileName % {"module_name":self.Name}, self.OutputDir)
- self._AutoGenFileList[AutoFile] = UniStringBinBuffer.getvalue()
- AutoFile.IsBinary = True
- self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)
- if UniStringBinBuffer != None:
- UniStringBinBuffer.close()
- return self._AutoGenFileList
-
- ## Return the list of library modules explicitly or implicityly used by this module
- def _GetLibraryList(self):
- if self._DependentLibraryList == None:
- # only merge library classes and PCD for non-library module
- if self.IsLibrary:
- self._DependentLibraryList = []
- else:
- if self.AutoGenVersion < 0x00010005:
- self._DependentLibraryList = self.PlatformInfo.ResolveLibraryReference(self.Module)
- else:
- self._DependentLibraryList = self.PlatformInfo.ApplyLibraryInstance(self.Module)
- return self._DependentLibraryList
-
- ## Get the list of PCDs from current module
- #
- # @retval list The list of PCD
- #
- def _GetModulePcdList(self):
- if self._ModulePcdList == None:
- # apply PCD settings from platform
- self._ModulePcdList = self.PlatformInfo.ApplyPcdSetting(self.Module, self.Module.Pcds)
- return self._ModulePcdList
-
- ## Get the list of PCDs from dependent libraries
- #
- # @retval list The list of PCD
- #
- def _GetLibraryPcdList(self):
- if self._LibraryPcdList == None:
- Pcds = sdict()
- if not self.IsLibrary:
- # get PCDs from dependent libraries
- for Library in self.DependentLibraryList:
- for Key in Library.Pcds:
- # skip duplicated PCDs
- if Key in self.Module.Pcds or Key in Pcds:
- continue
- Pcds[Key] = copy.copy(Library.Pcds[Key])
- # apply PCD settings from platform
- self._LibraryPcdList = self.PlatformInfo.ApplyPcdSetting(self.Module, Pcds)
- else:
- self._LibraryPcdList = []
- return self._LibraryPcdList
-
- ## Get the GUID value mapping
- #
- # @retval dict The mapping between GUID cname and its value
- #
- def _GetGuidList(self):
- if self._GuidList == None:
- self._GuidList = self.Module.Guids
- for Library in self.DependentLibraryList:
- self._GuidList.update(Library.Guids)
- return self._GuidList
-
- ## Get the protocol value mapping
- #
- # @retval dict The mapping between protocol cname and its value
- #
- def _GetProtocolList(self):
- if self._ProtocolList == None:
- self._ProtocolList = self.Module.Protocols
- for Library in self.DependentLibraryList:
- self._ProtocolList.update(Library.Protocols)
- return self._ProtocolList
-
- ## Get the PPI value mapping
- #
- # @retval dict The mapping between PPI cname and its value
- #
- def _GetPpiList(self):
- if self._PpiList == None:
- self._PpiList = self.Module.Ppis
- for Library in self.DependentLibraryList:
- self._PpiList.update(Library.Ppis)
- return self._PpiList
-
- ## Get the list of include search path
- #
- # @retval list The list path
- #
- def _GetIncludePathList(self):
- if self._IncludePathList == None:
- self._IncludePathList = []
- if self.AutoGenVersion < 0x00010005:
- for Inc in self.Module.Includes:
- if Inc not in self._IncludePathList:
- self._IncludePathList.append(Inc)
- # for Edk modules
- Inc = path.join(Inc, self.Arch.capitalize())
- if os.path.exists(Inc) and Inc not in self._IncludePathList:
- self._IncludePathList.append(Inc)
- # Edk module needs to put DEBUG_DIR at the end of search path and not to use SOURCE_DIR all the time
- self._IncludePathList.append(self.DebugDir)
- else:
- self._IncludePathList.append(self.MetaFile.Dir)
- self._IncludePathList.append(self.DebugDir)
-
- for Package in self.Module.Packages:
- PackageDir = path.join(self.WorkspaceDir, Package.MetaFile.Dir)
- if PackageDir not in self._IncludePathList:
- self._IncludePathList.append(PackageDir)
- for Inc in Package.Includes:
- if Inc not in self._IncludePathList:
- self._IncludePathList.append(str(Inc))
- return self._IncludePathList
-
- ## Create AsBuilt INF file the module
- #
- def CreateAsBuiltInf(self):
- if self.IsAsBuiltInfCreated:
- return
-
- # Skip the following code for EDK I inf
- if self.AutoGenVersion < 0x00010005:
- return
-
- # Skip the following code for libraries
- if self.IsLibrary:
- return
-
- # Skip the following code for modules with no source files
- if self.SourceFileList == None or self.SourceFileList == []:
- return
-
- # Skip the following code for modules without any binary files
- if self.BinaryFileList <> None and self.BinaryFileList <> []:
- return
-
- ### TODO: How to handles mixed source and binary modules
-
- # Find all DynamicEx PCDs used by this module and dependent libraries
- # Also find all packages that the DynamicEx PCDs depend on
- Pcds = []
- Packages = []
- for Pcd in self.ModulePcdList + self.LibraryPcdList:
- if Pcd.Type in GenC.gDynamicExPcd:
- if Pcd not in Pcds:
- Pcds += [Pcd]
- for Package in self.DerivedPackageList:
- if Package not in Packages:
- if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, 'DynamicEx') in Package.Pcds:
- Packages += [Package]
- elif (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, 'Dynamic') in Package.Pcds:
- Packages += [Package]
-
- ModuleType = self.ModuleType
- if ModuleType == 'UEFI_DRIVER' and self.DepexGenerated:
- ModuleType = 'DXE_DRIVER'
-
- AsBuiltInfDict = {
- 'module_name' : self.Name,
- 'module_guid' : self.Guid,
- 'module_module_type' : ModuleType,
- 'module_version_string' : self.Version,
- 'module_uefi_specification_version' : [],
- 'module_pi_specification_version' : [],
- 'module_arch' : self.Arch,
- 'package_item' : ['%s' % (Package.MetaFile.File.replace('\\','/')) for Package in Packages],
- 'binary_item' : [],
- 'pcd_item' : [],
- 'flags_item' : []
- }
-
- if 'UEFI_SPECIFICATION_VERSION' in self.Specification:
- AsBuiltInfDict['module_uefi_specification_version'] += [self.Specification['UEFI_SPECIFICATION_VERSION']]
- if 'PI_SPECIFICATION_VERSION' in self.Specification:
- AsBuiltInfDict['module_pi_specification_version'] += [self.Specification['PI_SPECIFICATION_VERSION']]
-
- OutputDir = self.OutputDir.replace('\\','/').strip('/')
- if self.ModuleType in ['BASE', 'USER_DEFINED']:
- for Item in self.CodaTargetList:
- File = Item.Target.Path.replace('\\','/').strip('/').replace(OutputDir,'').strip('/')
- if Item.Target.Ext.lower() == '.aml':
- AsBuiltInfDict['binary_item'] += ['ASL|' + File]
- elif Item.Target.Ext.lower() == '.acpi':
- AsBuiltInfDict['binary_item'] += ['ACPI|' + File]
- else:
- AsBuiltInfDict['binary_item'] += ['BIN|' + File]
- else:
- for Item in self.CodaTargetList:
- File = Item.Target.Path.replace('\\','/').strip('/').replace(OutputDir,'').strip('/')
- if Item.Target.Ext.lower() == '.efi':
- AsBuiltInfDict['binary_item'] += ['PE32|' + self.Name + '.efi']
- else:
- AsBuiltInfDict['binary_item'] += ['BIN|' + File]
- if self.DepexGenerated:
- if self.ModuleType in ['PEIM']:
- AsBuiltInfDict['binary_item'] += ['PEI_DEPEX|' + self.Name + '.depex']
- if self.ModuleType in ['DXE_DRIVER','DXE_RUNTIME_DRIVER','DXE_SAL_DRIVER','UEFI_DRIVER']:
- AsBuiltInfDict['binary_item'] += ['DXE_DEPEX|' + self.Name + '.depex']
- if self.ModuleType in ['DXE_SMM_DRIVER']:
- AsBuiltInfDict['binary_item'] += ['SMM_DEPEX|' + self.Name + '.depex']
-
- for Pcd in Pcds:
- AsBuiltInfDict['pcd_item'] += [Pcd.TokenSpaceGuidCName + '.' + Pcd.TokenCName]
-
- for Item in self.BuildOption:
- if 'FLAGS' in self.BuildOption[Item]:
- AsBuiltInfDict['flags_item'] += ['%s:%s_%s_%s_%s_FLAGS = %s' % (self.ToolChainFamily, self.BuildTarget, self.ToolChain, self.Arch, Item, self.BuildOption[Item]['FLAGS'].strip())]
-
- AsBuiltInf = TemplateString()
- AsBuiltInf.Append(gAsBuiltInfHeaderString.Replace(AsBuiltInfDict))
-
- SaveFileOnChange(os.path.join(self.OutputDir, self.Name + '.inf'), str(AsBuiltInf), False)
-
- self.IsAsBuiltInfCreated = True
-
- ## Create makefile for the module and its dependent libraries
- #
- # @param CreateLibraryMakeFile Flag indicating if or not the makefiles of
- # dependent libraries will be created
- #
- def CreateMakeFile(self, CreateLibraryMakeFile=True):
- if self.IsMakeFileCreated:
- return
-
- if not self.IsLibrary and CreateLibraryMakeFile:
- for LibraryAutoGen in self.LibraryAutoGenList:
- LibraryAutoGen.CreateMakeFile()
-
- if len(self.CustomMakefile) == 0:
- Makefile = GenMake.ModuleMakefile(self)
- else:
- Makefile = GenMake.CustomMakefile(self)
- if Makefile.Generate():
- EdkLogger.debug(EdkLogger.DEBUG_9, "Generated makefile for module %s [%s]" %
- (self.Name, self.Arch))
- else:
- EdkLogger.debug(EdkLogger.DEBUG_9, "Skipped the generation of makefile for module %s [%s]" %
- (self.Name, self.Arch))
-
- self.IsMakeFileCreated = True
-
- ## Create autogen code for the module and its dependent libraries
- #
- # @param CreateLibraryCodeFile Flag indicating if or not the code of
- # dependent libraries will be created
- #
- def CreateCodeFile(self, CreateLibraryCodeFile=True):
- if self.IsCodeFileCreated:
- return
-
- if not self.IsLibrary and CreateLibraryCodeFile:
- for LibraryAutoGen in self.LibraryAutoGenList:
- LibraryAutoGen.CreateCodeFile()
-
- AutoGenList = []
- IgoredAutoGenList = []
-
- for File in self.AutoGenFileList:
- if GenC.Generate(File.Path, self.AutoGenFileList[File], File.IsBinary):
- #Ignore Edk AutoGen.c
- if self.AutoGenVersion < 0x00010005 and File.Name == 'AutoGen.c':
- continue
-
- AutoGenList.append(str(File))
- else:
- IgoredAutoGenList.append(str(File))
-
- # Skip the following code for EDK I inf
- if self.AutoGenVersion < 0x00010005:
- return
-
- for ModuleType in self.DepexList:
- # Ignore empty [depex] section or [depex] section for "USER_DEFINED" module
- if len(self.DepexList[ModuleType]) == 0 or ModuleType == "USER_DEFINED":
- continue
-
- Dpx = GenDepex.DependencyExpression(self.DepexList[ModuleType], ModuleType, True)
- DpxFile = gAutoGenDepexFileName % {"module_name" : self.Name}
-
- if len(Dpx.PostfixNotation) <> 0:
- self.DepexGenerated = True
-
- if Dpx.Generate(path.join(self.OutputDir, DpxFile)):
- AutoGenList.append(str(DpxFile))
- else:
- IgoredAutoGenList.append(str(DpxFile))
-
- if IgoredAutoGenList == []:
- EdkLogger.debug(EdkLogger.DEBUG_9, "Generated [%s] files for module %s [%s]" %
- (" ".join(AutoGenList), self.Name, self.Arch))
- elif AutoGenList == []:
- EdkLogger.debug(EdkLogger.DEBUG_9, "Skipped the generation of [%s] files for module %s [%s]" %
- (" ".join(IgoredAutoGenList), self.Name, self.Arch))
- else:
- EdkLogger.debug(EdkLogger.DEBUG_9, "Generated [%s] (skipped %s) files for module %s [%s]" %
- (" ".join(AutoGenList), " ".join(IgoredAutoGenList), self.Name, self.Arch))
-
- self.IsCodeFileCreated = True
- return AutoGenList
-
- ## Summarize the ModuleAutoGen objects of all libraries used by this module
- def _GetLibraryAutoGenList(self):
- if self._LibraryAutoGenList == None:
- self._LibraryAutoGenList = []
- for Library in self.DependentLibraryList:
- La = ModuleAutoGen(
- self.Workspace,
- Library.MetaFile,
- self.BuildTarget,
- self.ToolChain,
- self.Arch,
- self.PlatformInfo.MetaFile
- )
- if La not in self._LibraryAutoGenList:
- self._LibraryAutoGenList.append(La)
- for Lib in La.CodaTargetList:
- self._ApplyBuildRule(Lib.Target, TAB_UNKNOWN_FILE)
- return self._LibraryAutoGenList
-
- Module = property(_GetModule)
- Name = property(_GetBaseName)
- Guid = property(_GetGuid)
- Version = property(_GetVersion)
- ModuleType = property(_GetModuleType)
- ComponentType = property(_GetComponentType)
- BuildType = property(_GetBuildType)
- PcdIsDriver = property(_GetPcdIsDriver)
- AutoGenVersion = property(_GetAutoGenVersion)
- Macros = property(_GetMacros)
- Specification = property(_GetSpecification)
-
- IsLibrary = property(_IsLibrary)
-
- BuildDir = property(_GetBuildDir)
- OutputDir = property(_GetOutputDir)
- DebugDir = property(_GetDebugDir)
- MakeFileDir = property(_GetMakeFileDir)
- CustomMakefile = property(_GetCustomMakefile)
-
- IncludePathList = property(_GetIncludePathList)
- AutoGenFileList = property(_GetAutoGenFileList)
- UnicodeFileList = property(_GetUnicodeFileList)
- SourceFileList = property(_GetSourceFileList)
- BinaryFileList = property(_GetBinaryFiles) # FileType : [File List]
- Targets = property(_GetTargets)
- IntroTargetList = property(_GetIntroTargetList)
- CodaTargetList = property(_GetFinalTargetList)
- FileTypes = property(_GetFileTypes)
- BuildRules = property(_GetBuildRules)
-
- DependentPackageList = property(_GetDependentPackageList)
- DependentLibraryList = property(_GetLibraryList)
- LibraryAutoGenList = property(_GetLibraryAutoGenList)
- DerivedPackageList = property(_GetDerivedPackageList)
-
- ModulePcdList = property(_GetModulePcdList)
- LibraryPcdList = property(_GetLibraryPcdList)
- GuidList = property(_GetGuidList)
- ProtocolList = property(_GetProtocolList)
- PpiList = property(_GetPpiList)
- DepexList = property(_GetDepexTokenList)
- DxsFile = property(_GetDxsFile)
- DepexExpressionList = property(_GetDepexExpressionTokenList)
- BuildOption = property(_GetModuleBuildOption)
- BuildOptionIncPathList = property(_GetBuildOptionIncPathList)
- BuildCommand = property(_GetBuildCommand)
-
-# This acts like the main() function for the script, unless it is 'import'ed into another script.
-if __name__ == '__main__':
- pass
-
diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py
deleted file mode 100644
index 5a7527ef4b..0000000000
--- a/BaseTools/Source/Python/AutoGen/BuildEngine.py
+++ /dev/null
@@ -1,627 +0,0 @@
-## @file
-# The engine for building files
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import re
-import copy
-import string
-
-from Common.GlobalData import *
-from Common.BuildToolError import *
-from Common.Misc import tdict, PathClass
-from Common.String import NormPath
-from Common.DataType import *
-
-import Common.EdkLogger as EdkLogger
-
-## Convert file type to file list macro name
-#
-# @param FileType The name of file type
-#
-# @retval string The name of macro
-#
-def FileListMacro(FileType):
- return "%sS" % FileType.replace("-", "_").upper()
-
-## Convert file type to list file macro name
-#
-# @param FileType The name of file type
-#
-# @retval string The name of macro
-#
-def ListFileMacro(FileType):
- return "%s_LIST" % FileListMacro(FileType)
-
-class TargetDescBlock(object):
- _Cache_ = {} # {TargetFile : TargetDescBlock object}
-
- # Factory method
- def __new__(Class, Inputs, Outputs, Commands, Dependencies):
- if Outputs[0] in Class._Cache_:
- Tdb = Class._Cache_[Outputs[0]]
- for File in Inputs:
- Tdb.AddInput(File)
- else:
- Tdb = super(TargetDescBlock, Class).__new__(Class)
- Tdb._Init(Inputs, Outputs, Commands, Dependencies)
- #Class._Cache_[Outputs[0]] = Tdb
- return Tdb
-
- def _Init(self, Inputs, Outputs, Commands, Dependencies):
- self.Inputs = Inputs
- self.Outputs = Outputs
- self.Commands = Commands
- self.Dependencies = Dependencies
- if self.Outputs:
- self.Target = self.Outputs[0]
- else:
- self.Target = None
-
- def __str__(self):
- return self.Target.Path
-
- def __hash__(self):
- return hash(self.Target.Path)
-
- def __eq__(self, Other):
- if type(Other) == type(self):
- return Other.Target.Path == self.Target.Path
- else:
- return str(Other) == self.Target.Path
-
- def AddInput(self, Input):
- if Input not in self.Inputs:
- self.Inputs.append(Input)
-
- def IsMultipleInput(self):
- return len(self.Inputs) > 1
-
- @staticmethod
- def Renew():
- TargetDescBlock._Cache_ = {}
-
-## Class for one build rule
-#
-# This represents a build rule which can give out corresponding command list for
-# building the given source file(s). The result can be used for generating the
-# target for makefile.
-#
-class FileBuildRule:
- INC_LIST_MACRO = "INC_LIST"
- INC_MACRO = "INC"
-
- ## constructor
- #
- # @param Input The dictionary represeting input file(s) for a rule
- # @param Output The list represeting output file(s) for a rule
- # @param Command The list containing commands to generate the output from input
- #
- def __init__(self, Type, Input, Output, Command, ExtraDependency=None):
- # The Input should not be empty
- if not Input:
- Input = []
- if not Output:
- Output = []
- if not Command:
- Command = []
-
- self.FileListMacro = FileListMacro(Type)
- self.ListFileMacro = ListFileMacro(Type)
- self.IncListFileMacro = self.INC_LIST_MACRO
-
- self.SourceFileType = Type
- # source files listed not in "*" or "?" pattern format
- if not ExtraDependency:
- self.ExtraSourceFileList = []
- else:
- self.ExtraSourceFileList = ExtraDependency
-
- #
- # Search macros used in command lines for <FILE_TYPE>_LIST and INC_LIST.
- # If found, generate a file to keep the input files used to get over the
- # limitation of command line length
- #
- self.MacroList = []
- self.CommandList = []
- for CmdLine in Command:
- self.MacroList.extend(gMacroRefPattern.findall(CmdLine))
- # replace path separator with native one
- self.CommandList.append(CmdLine)
-
- # Indicate what should be generated
- if self.FileListMacro in self.MacroList:
- self.GenFileListMacro = True
- else:
- self.GenFileListMacro = False
-
- if self.ListFileMacro in self.MacroList:
- self.GenListFile = True
- self.GenFileListMacro = True
- else:
- self.GenListFile = False
-
- if self.INC_LIST_MACRO in self.MacroList:
- self.GenIncListFile = True
- else:
- self.GenIncListFile = False
-
- # Check input files
- self.IsMultipleInput = False
- self.SourceFileExtList = []
- for File in Input:
- Base, Ext = os.path.splitext(File)
- if Base.find("*") >= 0:
- # There's "*" in the file name
- self.IsMultipleInput = True
- self.GenFileListMacro = True
- elif Base.find("?") < 0:
- # There's no "*" and "?" in file name
- self.ExtraSourceFileList.append(File)
- continue
- if Ext not in self.SourceFileExtList:
- self.SourceFileExtList.append(Ext)
-
- # Check output files
- self.DestFileList = []
- for File in Output:
- self.DestFileList.append(File)
-
- # All build targets generated by this rule for a module
- self.BuildTargets = {}
-
- ## str() function support
- #
- # @retval string
- #
- def __str__(self):
- SourceString = ""
- SourceString += " %s %s %s" % (self.SourceFileType, " ".join(self.SourceFileExtList), self.ExtraSourceFileList)
- DestString = ", ".join(self.DestFileList)
- CommandString = "\n\t".join(self.CommandList)
- return "%s : %s\n\t%s" % (DestString, SourceString, CommandString)
-
- ## Check if given file extension is supported by this rule
- #
- # @param FileExt The extension of a file
- #
- # @retval True If the extension is supported
- # @retval False If the extension is not supported
- #
- def IsSupported(self, FileExt):
- return FileExt in self.SourceFileExtList
-
- def Instantiate(self, Macros={}):
- NewRuleObject = copy.copy(self)
- NewRuleObject.BuildTargets = {}
- NewRuleObject.DestFileList = []
- for File in self.DestFileList:
- NewRuleObject.DestFileList.append(PathClass(NormPath(File, Macros)))
- return NewRuleObject
-
- ## Apply the rule to given source file(s)
- #
- # @param SourceFile One file or a list of files to be built
- # @param RelativeToDir The relative path of the source file
- # @param PathSeparator Path separator
- #
- # @retval tuple (Source file in full path, List of individual sourcefiles, Destionation file, List of build commands)
- #
- def Apply(self, SourceFile):
- if not self.CommandList or not self.DestFileList:
- return None
-
- # source file
- if self.IsMultipleInput:
- SrcFileName = ""
- SrcFileBase = ""
- SrcFileExt = ""
- SrcFileDir = ""
- SrcPath = ""
- # SourceFile must be a list
- SrcFile = "$(%s)" % self.FileListMacro
- else:
- SrcFileName, SrcFileBase, SrcFileExt = SourceFile.Name, SourceFile.BaseName, SourceFile.Ext
- if SourceFile.Root:
- SrcFileDir = SourceFile.SubDir
- if SrcFileDir == "":
- SrcFileDir = "."
- else:
- SrcFileDir = "."
- SrcFile = SourceFile.Path
- SrcPath = SourceFile.Dir
-
- # destination file (the first one)
- if self.DestFileList:
- DestFile = self.DestFileList[0].Path
- DestPath = self.DestFileList[0].Dir
- DestFileName = self.DestFileList[0].Name
- DestFileBase, DestFileExt = self.DestFileList[0].BaseName, self.DestFileList[0].Ext
- else:
- DestFile = ""
- DestPath = ""
- DestFileName = ""
- DestFileBase = ""
- DestFileExt = ""
-
- BuildRulePlaceholderDict = {
- # source file
- "src" : SrcFile,
- "s_path" : SrcPath,
- "s_dir" : SrcFileDir,
- "s_name" : SrcFileName,
- "s_base" : SrcFileBase,
- "s_ext" : SrcFileExt,
- # destination file
- "dst" : DestFile,
- "d_path" : DestPath,
- "d_name" : DestFileName,
- "d_base" : DestFileBase,
- "d_ext" : DestFileExt,
- }
-
- DstFile = []
- for File in self.DestFileList:
- File = string.Template(str(File)).safe_substitute(BuildRulePlaceholderDict)
- File = string.Template(str(File)).safe_substitute(BuildRulePlaceholderDict)
- DstFile.append(PathClass(File, IsBinary=True))
-
- if DstFile[0] in self.BuildTargets:
- TargetDesc = self.BuildTargets[DstFile[0]]
- TargetDesc.AddInput(SourceFile)
- else:
- CommandList = []
- for CommandString in self.CommandList:
- CommandString = string.Template(CommandString).safe_substitute(BuildRulePlaceholderDict)
- CommandString = string.Template(CommandString).safe_substitute(BuildRulePlaceholderDict)
- CommandList.append(CommandString)
- TargetDesc = TargetDescBlock([SourceFile], DstFile, CommandList, self.ExtraSourceFileList)
- TargetDesc.ListFileMacro = self.ListFileMacro
- TargetDesc.FileListMacro = self.FileListMacro
- TargetDesc.IncListFileMacro = self.IncListFileMacro
- TargetDesc.GenFileListMacro = self.GenFileListMacro
- TargetDesc.GenListFile = self.GenListFile
- TargetDesc.GenIncListFile = self.GenIncListFile
- self.BuildTargets[DstFile[0]] = TargetDesc
- return TargetDesc
-
-## Class for build rules
-#
-# BuildRule class parses rules defined in a file or passed by caller, and converts
-# the rule into FileBuildRule object.
-#
-class BuildRule:
- _SectionHeader = "SECTIONHEADER"
- _Section = "SECTION"
- _SubSectionHeader = "SUBSECTIONHEADER"
- _SubSection = "SUBSECTION"
- _InputFile = "INPUTFILE"
- _OutputFile = "OUTPUTFILE"
- _ExtraDependency = "EXTRADEPENDENCY"
- _Command = "COMMAND"
- _UnknownSection = "UNKNOWNSECTION"
-
- _SubSectionList = [_InputFile, _OutputFile, _Command]
-
- _PATH_SEP = "(+)"
- _FileTypePattern = re.compile("^[_a-zA-Z][_\-0-9a-zA-Z]*$")
- _BinaryFileRule = FileBuildRule(TAB_DEFAULT_BINARY_FILE, [], [os.path.join("$(OUTPUT_DIR)", "${s_name}")],
- ["$(CP) ${src} ${dst}"], [])
-
- ## Constructor
- #
- # @param File The file containing build rules in a well defined format
- # @param Content The string list of build rules in a well defined format
- # @param LineIndex The line number from which the parsing will begin
- # @param SupportedFamily The list of supported tool chain families
- #
- def __init__(self, File=None, Content=None, LineIndex=0, SupportedFamily=["MSFT", "INTEL", "GCC", "RVCT"]):
- self.RuleFile = File
- # Read build rules from file if it's not none
- if File != None:
- try:
- self.RuleContent = open(File, 'r').readlines()
- except:
- EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=File)
- elif Content != None:
- self.RuleContent = Content
- else:
- EdkLogger.error("build", PARAMETER_MISSING, ExtraData="No rule file or string given")
-
- self.SupportedToolChainFamilyList = SupportedFamily
- self.RuleDatabase = tdict(True, 4) # {FileExt, ModuleType, Arch, Family : FileBuildRule object}
- self.Ext2FileType = {} # {ext : file-type}
- self.FileTypeList = set()
-
- self._LineIndex = LineIndex
- self._State = ""
- self._RuleInfo = tdict(True, 2) # {toolchain family : {"InputFile": {}, "OutputFile" : [], "Command" : []}}
- self._FileType = ''
- self._BuildTypeList = []
- self._ArchList = []
- self._FamilyList = []
- self._TotalToolChainFamilySet = set()
- self._RuleObjectList = [] # FileBuildRule object list
- self._FileVersion = ""
-
- self.Parse()
-
- # some intrinsic rules
- self.RuleDatabase[TAB_DEFAULT_BINARY_FILE, "COMMON", "COMMON", "COMMON"] = self._BinaryFileRule
- self.FileTypeList.add(TAB_DEFAULT_BINARY_FILE)
-
- ## Parse the build rule strings
- def Parse(self):
- self._State = self._Section
- for Index in range(self._LineIndex, len(self.RuleContent)):
- # Clean up the line and replace path separator with native one
- Line = self.RuleContent[Index].strip().replace(self._PATH_SEP, os.path.sep)
- self.RuleContent[Index] = Line
-
- # find the build_rule_version
- if Line and Line[0] == "#" and Line.find(TAB_BUILD_RULE_VERSION) <> -1:
- if Line.find("=") <> -1 and Line.find("=") < (len(Line)-1) and (Line[(Line.find("=") + 1):]).split():
- self._FileVersion = (Line[(Line.find("=") + 1):]).split()[0]
- # skip empty or comment line
- if Line == "" or Line[0] == "#":
- continue
-
- # find out section header, enclosed by []
- if Line[0] == '[' and Line[-1] == ']':
- # merge last section information into rule database
- self.EndOfSection()
- self._State = self._SectionHeader
- # find out sub-section header, enclosed by <>
- elif Line[0] == '<' and Line[-1] == '>':
- if self._State != self._UnknownSection:
- self._State = self._SubSectionHeader
-
- # call section handler to parse each (sub)section
- self._StateHandler[self._State](self, Index)
- # merge last section information into rule database
- self.EndOfSection()
-
- ## Parse definitions under a section
- #
- # @param LineIndex The line index of build rule text
- #
- def ParseSection(self, LineIndex):
- pass
-
- ## Parse definitions under a subsection
- #
- # @param LineIndex The line index of build rule text
- #
- def ParseSubSection(self, LineIndex):
- # currenly nothing here
- pass
-
- ## Placeholder for not supported sections
- #
- # @param LineIndex The line index of build rule text
- #
- def SkipSection(self, LineIndex):
- pass
-
- ## Merge section information just got into rule database
- def EndOfSection(self):
- Database = self.RuleDatabase
- # if there's specific toochain family, 'COMMON' doesn't make sense any more
- if len(self._TotalToolChainFamilySet) > 1 and 'COMMON' in self._TotalToolChainFamilySet:
- self._TotalToolChainFamilySet.remove('COMMON')
- for Family in self._TotalToolChainFamilySet:
- Input = self._RuleInfo[Family, self._InputFile]
- Output = self._RuleInfo[Family, self._OutputFile]
- Command = self._RuleInfo[Family, self._Command]
- ExtraDependency = self._RuleInfo[Family, self._ExtraDependency]
-
- BuildRule = FileBuildRule(self._FileType, Input, Output, Command, ExtraDependency)
- for BuildType in self._BuildTypeList:
- for Arch in self._ArchList:
- Database[self._FileType, BuildType, Arch, Family] = BuildRule
- for FileExt in BuildRule.SourceFileExtList:
- self.Ext2FileType[FileExt] = self._FileType
-
- ## Parse section header
- #
- # @param LineIndex The line index of build rule text
- #
- def ParseSectionHeader(self, LineIndex):
- self._RuleInfo = tdict(True, 2)
- self._BuildTypeList = []
- self._ArchList = []
- self._FamilyList = []
- self._TotalToolChainFamilySet = set()
- FileType = ''
- RuleNameList = self.RuleContent[LineIndex][1:-1].split(',')
- for RuleName in RuleNameList:
- Arch = 'COMMON'
- BuildType = 'COMMON'
- TokenList = [Token.strip().upper() for Token in RuleName.split('.')]
- # old format: Build.File-Type
- if TokenList[0] == "BUILD":
- if len(TokenList) == 1:
- EdkLogger.error("build", FORMAT_INVALID, "Invalid rule section",
- File=self.RuleFile, Line=LineIndex+1,
- ExtraData=self.RuleContent[LineIndex])
-
- FileType = TokenList[1]
- if FileType == '':
- EdkLogger.error("build", FORMAT_INVALID, "No file type given",
- File=self.RuleFile, Line=LineIndex+1,
- ExtraData=self.RuleContent[LineIndex])
- if self._FileTypePattern.match(FileType) == None:
- EdkLogger.error("build", FORMAT_INVALID, File=self.RuleFile, Line=LineIndex+1,
- ExtraData="Only character, number (non-first character), '_' and '-' are allowed in file type")
- # new format: File-Type.Build-Type.Arch
- else:
- if FileType == '':
- FileType = TokenList[0]
- elif FileType != TokenList[0]:
- EdkLogger.error("build", FORMAT_INVALID,
- "Different file types are not allowed in the same rule section",
- File=self.RuleFile, Line=LineIndex+1,
- ExtraData=self.RuleContent[LineIndex])
- if len(TokenList) > 1:
- BuildType = TokenList[1]
- if len(TokenList) > 2:
- Arch = TokenList[2]
- if BuildType not in self._BuildTypeList:
- self._BuildTypeList.append(BuildType)
- if Arch not in self._ArchList:
- self._ArchList.append(Arch)
-
- if 'COMMON' in self._BuildTypeList and len(self._BuildTypeList) > 1:
- EdkLogger.error("build", FORMAT_INVALID,
- "Specific build types must not be mixed with common one",
- File=self.RuleFile, Line=LineIndex+1,
- ExtraData=self.RuleContent[LineIndex])
- if 'COMMON' in self._ArchList and len(self._ArchList) > 1:
- EdkLogger.error("build", FORMAT_INVALID,
- "Specific ARCH must not be mixed with common one",
- File=self.RuleFile, Line=LineIndex+1,
- ExtraData=self.RuleContent[LineIndex])
-
- self._FileType = FileType
- self._State = self._Section
- self.FileTypeList.add(FileType)
-
- ## Parse sub-section header
- #
- # @param LineIndex The line index of build rule text
- #
- def ParseSubSectionHeader(self, LineIndex):
- SectionType = ""
- List = self.RuleContent[LineIndex][1:-1].split(',')
- FamilyList = []
- for Section in List:
- TokenList = Section.split('.')
- Type = TokenList[0].strip().upper()
-
- if SectionType == "":
- SectionType = Type
- elif SectionType != Type:
- EdkLogger.error("build", FORMAT_INVALID,
- "Two different section types are not allowed in the same sub-section",
- File=self.RuleFile, Line=LineIndex+1,
- ExtraData=self.RuleContent[LineIndex])
-
- if len(TokenList) > 1:
- Family = TokenList[1].strip().upper()
- else:
- Family = "COMMON"
-
- if Family not in FamilyList:
- FamilyList.append(Family)
-
- self._FamilyList = FamilyList
- self._TotalToolChainFamilySet.update(FamilyList)
- self._State = SectionType.upper()
- if 'COMMON' in FamilyList and len(FamilyList) > 1:
- EdkLogger.error("build", FORMAT_INVALID,
- "Specific tool chain family should not be mixed with general one",
- File=self.RuleFile, Line=LineIndex+1,
- ExtraData=self.RuleContent[LineIndex])
- if self._State not in self._StateHandler:
- EdkLogger.error("build", FORMAT_INVALID, File=self.RuleFile, Line=LineIndex+1,
- ExtraData="Unknown subsection: %s" % self.RuleContent[LineIndex])
- ## Parse <InputFile> sub-section
- #
- # @param LineIndex The line index of build rule text
- #
- def ParseInputFile(self, LineIndex):
- FileList = [File.strip() for File in self.RuleContent[LineIndex].split(",")]
- for ToolChainFamily in self._FamilyList:
- InputFiles = self._RuleInfo[ToolChainFamily, self._State]
- if InputFiles == None:
- InputFiles = []
- self._RuleInfo[ToolChainFamily, self._State] = InputFiles
- InputFiles.extend(FileList)
-
- ## Parse <ExtraDependency> sub-section
- #
- # @param LineIndex The line index of build rule text
- #
- def ParseCommon(self, LineIndex):
- for ToolChainFamily in self._FamilyList:
- Items = self._RuleInfo[ToolChainFamily, self._State]
- if Items == None:
- Items = []
- self._RuleInfo[ToolChainFamily, self._State] = Items
- Items.append(self.RuleContent[LineIndex])
-
- ## Get a build rule via [] operator
- #
- # @param FileExt The extension of a file
- # @param ToolChainFamily The tool chain family name
- # @param BuildVersion The build version number. "*" means any rule
- # is applicalbe.
- #
- # @retval FileType The file type string
- # @retval FileBuildRule The object of FileBuildRule
- #
- # Key = (FileExt, ModuleType, Arch, ToolChainFamily)
- def __getitem__(self, Key):
- if not Key:
- return None
-
- if Key[0] in self.Ext2FileType:
- Type = self.Ext2FileType[Key[0]]
- elif Key[0].upper() in self.FileTypeList:
- Type = Key[0].upper()
- else:
- return None
-
- if len(Key) > 1:
- Key = (Type,) + Key[1:]
- else:
- Key = (Type,)
- return self.RuleDatabase[Key]
-
- _StateHandler = {
- _SectionHeader : ParseSectionHeader,
- _Section : ParseSection,
- _SubSectionHeader : ParseSubSectionHeader,
- _SubSection : ParseSubSection,
- _InputFile : ParseInputFile,
- _OutputFile : ParseCommon,
- _ExtraDependency : ParseCommon,
- _Command : ParseCommon,
- _UnknownSection : SkipSection,
- }
-
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-if __name__ == '__main__':
- import sys
- EdkLogger.Initialize()
- if len(sys.argv) > 1:
- Br = BuildRule(sys.argv[1])
- print str(Br[".c", "DXE_DRIVER", "IA32", "MSFT"][1])
- print
- print str(Br[".c", "DXE_DRIVER", "IA32", "INTEL"][1])
- print
- print str(Br[".c", "DXE_DRIVER", "IA32", "GCC"][1])
- print
- print str(Br[".ac", "ACPI_TABLE", "IA32", "MSFT"][1])
- print
- print str(Br[".h", "ACPI_TABLE", "IA32", "INTEL"][1])
- print
- print str(Br[".ac", "ACPI_TABLE", "IA32", "MSFT"][1])
- print
- print str(Br[".s", "SEC", "IPF", "COMMON"][1])
- print
- print str(Br[".s", "SEC"][1])
-
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
deleted file mode 100644
index 2eb920417e..0000000000
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ /dev/null
@@ -1,2127 +0,0 @@
-## @file
-# Routines for generating AutoGen.h and AutoGen.c
-#
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-## Import Modules
-#
-import string
-
-from Common import EdkLogger
-
-from Common.BuildToolError import *
-from Common.DataType import *
-from Common.Misc import *
-from Common.String import StringToArray
-from StrGather import *
-
-## PCD type string
-gItemTypeStringDatabase = {
- TAB_PCDS_FEATURE_FLAG : 'FixedAtBuild',
- TAB_PCDS_FIXED_AT_BUILD : 'FixedAtBuild',
- TAB_PCDS_PATCHABLE_IN_MODULE: 'BinaryPatch',
- TAB_PCDS_DYNAMIC : '',
- TAB_PCDS_DYNAMIC_DEFAULT : '',
- TAB_PCDS_DYNAMIC_VPD : '',
- TAB_PCDS_DYNAMIC_HII : '',
- TAB_PCDS_DYNAMIC_EX : '',
- TAB_PCDS_DYNAMIC_EX_DEFAULT : '',
- TAB_PCDS_DYNAMIC_EX_VPD : '',
- TAB_PCDS_DYNAMIC_EX_HII : '',
-}
-
-## Dynamic PCD types
-gDynamicPcd = [TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_DEFAULT, TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_HII]
-
-## Dynamic-ex PCD types
-gDynamicExPcd = [TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFAULT, TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII]
-
-## Datum size
-gDatumSizeStringDatabase = {'UINT8':'8','UINT16':'16','UINT32':'32','UINT64':'64','BOOLEAN':'BOOLEAN','VOID*':'8'}
-gDatumSizeStringDatabaseH = {'UINT8':'8','UINT16':'16','UINT32':'32','UINT64':'64','BOOLEAN':'BOOL','VOID*':'PTR'}
-gDatumSizeStringDatabaseLib = {'UINT8':'8','UINT16':'16','UINT32':'32','UINT64':'64','BOOLEAN':'Bool','VOID*':'Ptr'}
-
-## Mapping between PCD driver type and EFI phase
-gPcdPhaseMap = {
- "PEI_PCD_DRIVER" : "PEI",
- "DXE_PCD_DRIVER" : "DXE"
-}
-
-gPcdDatabaseCommonAutoGenH = """
-//
-// The following definition will be generated by build tool
-//
-
-//
-// Common definitions
-//
-typedef UINT8 SKU_ID;
-
-#define PCD_TYPE_SHIFT 28
-
-#define PCD_TYPE_DATA (0x0U << PCD_TYPE_SHIFT)
-#define PCD_TYPE_HII (0x8U << PCD_TYPE_SHIFT)
-#define PCD_TYPE_VPD (0x4U << PCD_TYPE_SHIFT)
-#define PCD_TYPE_SKU_ENABLED (0x2U << PCD_TYPE_SHIFT)
-#define PCD_TYPE_STRING (0x1U << PCD_TYPE_SHIFT)
-
-#define PCD_TYPE_ALL_SET (PCD_TYPE_DATA | PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_SKU_ENABLED | PCD_TYPE_STRING)
-
-#define PCD_DATUM_TYPE_SHIFT 24
-
-#define PCD_DATUM_TYPE_POINTER (0x0U << PCD_DATUM_TYPE_SHIFT)
-#define PCD_DATUM_TYPE_UINT8 (0x1U << PCD_DATUM_TYPE_SHIFT)
-#define PCD_DATUM_TYPE_UINT16 (0x2U << PCD_DATUM_TYPE_SHIFT)
-#define PCD_DATUM_TYPE_UINT32 (0x4U << PCD_DATUM_TYPE_SHIFT)
-#define PCD_DATUM_TYPE_UINT64 (0x8U << PCD_DATUM_TYPE_SHIFT)
-
-#define PCD_DATUM_TYPE_ALL_SET (PCD_DATUM_TYPE_POINTER | \\
- PCD_DATUM_TYPE_UINT8 | \\
- PCD_DATUM_TYPE_UINT16 | \\
- PCD_DATUM_TYPE_UINT32 | \\
- PCD_DATUM_TYPE_UINT64)
-
-#define PCD_DATABASE_OFFSET_MASK (~(PCD_TYPE_ALL_SET | PCD_DATUM_TYPE_ALL_SET))
-
-typedef struct {
- UINT32 ExTokenNumber;
- UINT16 LocalTokenNumber; // PCD Number of this particular platform build
- UINT16 ExGuidIndex; // Index of GuidTable
-} DYNAMICEX_MAPPING;
-
-typedef struct {
- UINT32 SkuDataStartOffset; //We have to use offsetof MACRO as we don't know padding done by compiler
- UINT32 SkuIdTableOffset; //Offset from the PCD_DB
-} SKU_HEAD;
-
-typedef struct {
- UINT32 StringIndex; // Offset in String Table in units of UINT32.
- UINT32 DefaultValueOffset; // Offset of the Default Value
- UINT16 GuidTableIndex; // Offset in Guid Table in units of GUID.
- UINT16 Offset; // Offset in Variable
-} VARIABLE_HEAD;
-
-typedef struct {
- UINT32 Offset;
-} VPD_HEAD;
-
-typedef UINT32 STRING_HEAD;
-
-typedef UINT16 SIZE_INFO;
-
-#define offsetof(s,m) (UINT32) (UINTN) &(((s *)0)->m)
-
-"""
-
-gPcdDatabaseEpilogueAutoGenH = """
-typedef struct {
- PEI_PCD_DATABASE PeiDb;
- DXE_PCD_DATABASE DxeDb;
-} PCD_DATABASE;
-
-#define PCD_TOTAL_TOKEN_NUMBER (PEI_LOCAL_TOKEN_NUMBER + DXE_LOCAL_TOKEN_NUMBER)
-
-"""
-
-gPcdDatabaseAutoGenH = TemplateString("""
-#define ${PHASE}_GUID_TABLE_SIZE ${GUID_TABLE_SIZE}
-#define ${PHASE}_STRING_TABLE_SIZE ${STRING_TABLE_SIZE}
-#define ${PHASE}_SKUID_TABLE_SIZE ${SKUID_TABLE_SIZE}
-#define ${PHASE}_LOCAL_TOKEN_NUMBER_TABLE_SIZE ${LOCAL_TOKEN_NUMBER_TABLE_SIZE}
-#define ${PHASE}_LOCAL_TOKEN_NUMBER ${LOCAL_TOKEN_NUMBER}
-#define ${PHASE}_EXMAPPING_TABLE_SIZE ${EXMAPPING_TABLE_SIZE}
-#define ${PHASE}_EX_TOKEN_NUMBER ${EX_TOKEN_NUMBER}
-#define ${PHASE}_SIZE_TABLE_SIZE ${SIZE_TABLE_SIZE}
-#define ${PHASE}_GUID_TABLE_EMPTY ${GUID_TABLE_EMPTY}
-#define ${PHASE}_STRING_TABLE_EMPTY ${STRING_TABLE_EMPTY}
-#define ${PHASE}_SKUID_TABLE_EMPTY ${SKUID_TABLE_EMPTY}
-#define ${PHASE}_DATABASE_EMPTY ${DATABASE_EMPTY}
-#define ${PHASE}_EXMAP_TABLE_EMPTY ${EXMAP_TABLE_EMPTY}
-
-typedef struct {
-${BEGIN} UINT64 ${INIT_CNAME_DECL_UINT64}_${INIT_GUID_DECL_UINT64}[${INIT_NUMSKUS_DECL_UINT64}];
-${END}
-${BEGIN} UINT64 ${VARDEF_CNAME_UINT64}_${VARDEF_GUID_UINT64}_VariableDefault_${VARDEF_SKUID_UINT64};
-${END}
-${BEGIN} UINT32 ${INIT_CNAME_DECL_UINT32}_${INIT_GUID_DECL_UINT32}[${INIT_NUMSKUS_DECL_UINT32}];
-${END}
-${BEGIN} UINT32 ${VARDEF_CNAME_UINT32}_${VARDEF_GUID_UINT32}_VariableDefault_${VARDEF_SKUID_UINT32};
-${END}
-${BEGIN} VPD_HEAD ${VPD_HEAD_CNAME_DECL}_${VPD_HEAD_GUID_DECL}[${VPD_HEAD_NUMSKUS_DECL}];
-${END}
- DYNAMICEX_MAPPING ExMapTable[${PHASE}_EXMAPPING_TABLE_SIZE];
- UINT32 LocalTokenNumberTable[${PHASE}_LOCAL_TOKEN_NUMBER_TABLE_SIZE];
- GUID GuidTable[${PHASE}_GUID_TABLE_SIZE];
-${BEGIN} STRING_HEAD ${STRING_HEAD_CNAME_DECL}_${STRING_HEAD_GUID_DECL}[${STRING_HEAD_NUMSKUS_DECL}];
-${END}
-${BEGIN} VARIABLE_HEAD ${VARIABLE_HEAD_CNAME_DECL}_${VARIABLE_HEAD_GUID_DECL}_Variable_Header[${VARIABLE_HEAD_NUMSKUS_DECL}];
-${END}
-${BEGIN} UINT8 StringTable${STRING_TABLE_INDEX}[${STRING_TABLE_LENGTH}]; /* ${STRING_TABLE_CNAME}_${STRING_TABLE_GUID} */
-${END}
- SIZE_INFO SizeTable[${PHASE}_SIZE_TABLE_SIZE];
-${BEGIN} UINT16 ${INIT_CNAME_DECL_UINT16}_${INIT_GUID_DECL_UINT16}[${INIT_NUMSKUS_DECL_UINT16}];
-${END}
-${BEGIN} UINT16 ${VARDEF_CNAME_UINT16}_${VARDEF_GUID_UINT16}_VariableDefault_${VARDEF_SKUID_UINT16};
-${END}
-${BEGIN} UINT8 ${INIT_CNAME_DECL_UINT8}_${INIT_GUID_DECL_UINT8}[${INIT_NUMSKUS_DECL_UINT8}];
-${END}
-${BEGIN} UINT8 ${VARDEF_CNAME_UINT8}_${VARDEF_GUID_UINT8}_VariableDefault_${VARDEF_SKUID_UINT8};
-${END}
-${BEGIN} BOOLEAN ${INIT_CNAME_DECL_BOOLEAN}_${INIT_GUID_DECL_BOOLEAN}[${INIT_NUMSKUS_DECL_BOOLEAN}];
-${END}
-${BEGIN} BOOLEAN ${VARDEF_CNAME_BOOLEAN}_${VARDEF_GUID_BOOLEAN}_VariableDefault_${VARDEF_SKUID_BOOLEAN};
-${END}
- UINT8 SkuIdTable[${PHASE}_SKUID_TABLE_SIZE];
-${SYSTEM_SKU_ID}
-} ${PHASE}_PCD_DATABASE_INIT;
-
-typedef struct {
-${PCD_DATABASE_UNINIT_EMPTY}
-${BEGIN} UINT64 ${UNINIT_CNAME_DECL_UINT64}_${UNINIT_GUID_DECL_UINT64}[${UNINIT_NUMSKUS_DECL_UINT64}];
-${END}
-${BEGIN} UINT32 ${UNINIT_CNAME_DECL_UINT32}_${UNINIT_GUID_DECL_UINT32}[${UNINIT_NUMSKUS_DECL_UINT32}];
-${END}
-${BEGIN} UINT16 ${UNINIT_CNAME_DECL_UINT16}_${UNINIT_GUID_DECL_UINT16}[${UNINIT_NUMSKUS_DECL_UINT16}];
-${END}
-${BEGIN} UINT8 ${UNINIT_CNAME_DECL_UINT8}_${UNINIT_GUID_DECL_UINT8}[${UNINIT_NUMSKUS_DECL_UINT8}];
-${END}
-${BEGIN} BOOLEAN ${UNINIT_CNAME_DECL_BOOLEAN}_${UNINIT_GUID_DECL_BOOLEAN}[${UNINIT_NUMSKUS_DECL_BOOLEAN}];
-${END}
-} ${PHASE}_PCD_DATABASE_UNINIT;
-
-#define PCD_${PHASE}_SERVICE_DRIVER_VERSION 2
-
-typedef struct {
- ${PHASE}_PCD_DATABASE_INIT Init;
- ${PHASE}_PCD_DATABASE_UNINIT Uninit;
-} ${PHASE}_PCD_DATABASE;
-
-#define ${PHASE}_NEX_TOKEN_NUMBER (${PHASE}_LOCAL_TOKEN_NUMBER - ${PHASE}_EX_TOKEN_NUMBER)
-""")
-
-gEmptyPcdDatabaseAutoGenC = TemplateString("""
-${PHASE}_PCD_DATABASE_INIT g${PHASE}PcdDbInit = {
- /* ExMapTable */
- {
- {0, 0, 0}
- },
- /* LocalTokenNumberTable */
- {
- 0
- },
- /* GuidTable */
- {
- {0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}
- },
- /* StringTable */
- { 0 },
- /* SizeTable */
- {
- 0, 0
- },
- /* SkuIdTable */
- { 0 },
- ${SYSTEM_SKU_ID_VALUE}
-};
-""")
-
-gPcdDatabaseAutoGenC = TemplateString("""
-${PHASE}_PCD_DATABASE_INIT g${PHASE}PcdDbInit = {
-${BEGIN} { ${INIT_VALUE_UINT64} }, /* ${INIT_CNAME_DECL_UINT64}_${INIT_GUID_DECL_UINT64}[${INIT_NUMSKUS_DECL_UINT64}] */
-${END}
-${BEGIN} ${VARDEF_VALUE_UINT64}, /* ${VARDEF_CNAME_UINT64}_${VARDEF_GUID_UINT64}_VariableDefault_${VARDEF_SKUID_UINT64} */
-${END}
-${BEGIN} { ${INIT_VALUE_UINT32} }, /* ${INIT_CNAME_DECL_UINT32}_${INIT_GUID_DECL_UINT32}[${INIT_NUMSKUS_DECL_UINT32}] */
-${END}
-${BEGIN} ${VARDEF_VALUE_UINT32}, /* ${VARDEF_CNAME_UINT32}_${VARDEF_GUID_UINT32}_VariableDefault_${VARDEF_SKUID_UINT32} */
-${END}
- /* VPD */
-${BEGIN} { ${VPD_HEAD_VALUE} }, /* ${VPD_HEAD_CNAME_DECL}_${VPD_HEAD_GUID_DECL}[${VPD_HEAD_NUMSKUS_DECL}] */
-${END}
- /* ExMapTable */
- {
-${BEGIN} { ${EXMAPPING_TABLE_EXTOKEN}, ${EXMAPPING_TABLE_LOCAL_TOKEN}, ${EXMAPPING_TABLE_GUID_INDEX} },
-${END}
- },
- /* LocalTokenNumberTable */
- {
-${BEGIN} offsetof(${PHASE}_PCD_DATABASE, ${TOKEN_INIT}.${TOKEN_CNAME}_${TOKEN_GUID}${VARDEF_HEADER}) | ${TOKEN_TYPE},
-${END}
- },
- /* GuidTable */
- {
-${BEGIN} ${GUID_STRUCTURE},
-${END}
- },
-${BEGIN} { ${STRING_HEAD_VALUE} }, /* ${STRING_HEAD_CNAME_DECL}_${STRING_HEAD_GUID_DECL}[${STRING_HEAD_NUMSKUS_DECL}] */
-${END}
-${BEGIN} /* ${VARIABLE_HEAD_CNAME_DECL}_${VARIABLE_HEAD_GUID_DECL}_Variable_Header[${VARIABLE_HEAD_NUMSKUS_DECL}] */
- {
- ${VARIABLE_HEAD_VALUE}
- },
-${END}
- /* StringTable */
-${BEGIN} ${STRING_TABLE_VALUE}, /* ${STRING_TABLE_CNAME}_${STRING_TABLE_GUID} */
-${END}
- /* SizeTable */
- {
-${BEGIN} ${SIZE_TABLE_MAXIMUM_LENGTH}, ${SIZE_TABLE_CURRENT_LENGTH}, /* ${SIZE_TABLE_CNAME}_${SIZE_TABLE_GUID} */
-${END}
- },
-${BEGIN} { ${INIT_VALUE_UINT16} }, /* ${INIT_CNAME_DECL_UINT16}_${INIT_GUID_DECL_UINT16}[${INIT_NUMSKUS_DECL_UINT16}] */
-${END}
-${BEGIN} ${VARDEF_VALUE_UINT16}, /* ${VARDEF_CNAME_UINT16}_${VARDEF_GUID_UINT16}_VariableDefault_${VARDEF_SKUID_UINT16} */
-${END}
-${BEGIN} { ${INIT_VALUE_UINT8} }, /* ${INIT_CNAME_DECL_UINT8}_${INIT_GUID_DECL_UINT8}[${INIT_NUMSKUS_DECL_UINT8}] */
-${END}
-${BEGIN} ${VARDEF_VALUE_UINT8}, /* ${VARDEF_CNAME_UINT8}_${VARDEF_GUID_UINT8}_VariableDefault_${VARDEF_SKUID_UINT8} */
-${END}
-${BEGIN} { ${INIT_VALUE_BOOLEAN} }, /* ${INIT_CNAME_DECL_BOOLEAN}_${INIT_GUID_DECL_BOOLEAN}[${INIT_NUMSKUS_DECL_BOOLEAN}] */
-${END}
-${BEGIN} ${VARDEF_VALUE_BOOLEAN}, /* ${VARDEF_CNAME_BOOLEAN}_${VARDEF_GUID_BOOLEAN}_VariableDefault_${VARDEF_SKUID_BOOLEAN} */
-${END}
- /* SkuIdTable */
- { ${BEGIN}${SKUID_VALUE}, ${END} },
- ${SYSTEM_SKU_ID_VALUE}
-};
-""")
-
-
-## AutoGen File Header Templates
-gAutoGenHeaderString = TemplateString("""\
-/**
- DO NOT EDIT
- FILE auto-generated
- Module name:
- ${FileName}
- Abstract: Auto-generated ${FileName} for building module or library.
-**/
-""")
-
-gAutoGenHPrologueString = TemplateString("""
-#ifndef _${File}_${Guid}
-#define _${File}_${Guid}
-
-""")
-
-gAutoGenHCppPrologueString = """\
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-"""
-
-gAutoGenHEpilogueString = """
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-"""
-
-## PEI Core Entry Point Templates
-gPeiCoreEntryPointPrototype = TemplateString("""
-${BEGIN}
-VOID
-EFIAPI
-${Function} (
- IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
- IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,
- IN VOID *Context
- );
-${END}
-""")
-
-gPeiCoreEntryPointString = TemplateString("""
-${BEGIN}
-VOID
-EFIAPI
-ProcessModuleEntryPointList (
- IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
- IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,
- IN VOID *Context
- )
-
-{
- ${Function} (SecCoreData, PpiList, Context);
-}
-${END}
-""")
-
-
-## DXE Core Entry Point Templates
-gDxeCoreEntryPointPrototype = TemplateString("""
-${BEGIN}
-VOID
-EFIAPI
-${Function} (
- IN VOID *HobStart
- );
-${END}
-""")
-
-gDxeCoreEntryPointString = TemplateString("""
-${BEGIN}
-VOID
-EFIAPI
-ProcessModuleEntryPointList (
- IN VOID *HobStart
- )
-
-{
- ${Function} (HobStart);
-}
-${END}
-""")
-
-## PEIM Entry Point Templates
-gPeimEntryPointPrototype = TemplateString("""
-${BEGIN}
-EFI_STATUS
-EFIAPI
-${Function} (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- );
-${END}
-""")
-
-gPeimEntryPointString = [
-TemplateString("""
-GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = ${PiSpecVersion};
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- )
-
-{
- return EFI_SUCCESS;
-}
-"""),
-TemplateString("""
-GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = ${PiSpecVersion};
-${BEGIN}
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- )
-
-{
- return ${Function} (FileHandle, PeiServices);
-}
-${END}
-"""),
-TemplateString("""
-GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = ${PiSpecVersion};
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- )
-
-{
- EFI_STATUS Status;
- EFI_STATUS CombinedStatus;
-
- CombinedStatus = EFI_LOAD_ERROR;
-${BEGIN}
- Status = ${Function} (FileHandle, PeiServices);
- if (!EFI_ERROR (Status) || EFI_ERROR (CombinedStatus)) {
- CombinedStatus = Status;
- }
-${END}
- return CombinedStatus;
-}
-""")
-]
-
-## SMM_CORE Entry Point Templates
-gSmmCoreEntryPointPrototype = TemplateString("""
-${BEGIN}
-EFI_STATUS
-EFIAPI
-${Function} (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-${END}
-""")
-
-gSmmCoreEntryPointString = TemplateString("""
-${BEGIN}
-const UINT32 _gUefiDriverRevision = ${UefiSpecVersion};
-const UINT32 _gDxeRevision = ${PiSpecVersion};
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- return ${Function} (ImageHandle, SystemTable);
-}
-${END}
-""")
-
-## DXE SMM Entry Point Templates
-gDxeSmmEntryPointPrototype = TemplateString("""
-${BEGIN}
-EFI_STATUS
-EFIAPI
-${Function} (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-${END}
-""")
-
-gDxeSmmEntryPointString = [
-TemplateString("""
-const UINT32 _gUefiDriverRevision = ${UefiSpecVersion};
-const UINT32 _gDxeRevision = ${PiSpecVersion};
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-
-{
- return EFI_SUCCESS;
-}
-"""),
-TemplateString("""
-const UINT32 _gUefiDriverRevision = ${UefiSpecVersion};
-const UINT32 _gDxeRevision = ${PiSpecVersion};
-
-static BASE_LIBRARY_JUMP_BUFFER mJumpContext;
-static EFI_STATUS mDriverEntryPointStatus;
-
-VOID
-EFIAPI
-ExitDriver (
- IN EFI_STATUS Status
- )
-{
- if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {
- mDriverEntryPointStatus = Status;
- }
- LongJump (&mJumpContext, (UINTN)-1);
- ASSERT (FALSE);
-}
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- mDriverEntryPointStatus = EFI_LOAD_ERROR;
-
-${BEGIN}
- if (SetJump (&mJumpContext) == 0) {
- ExitDriver (${Function} (ImageHandle, SystemTable));
- ASSERT (FALSE);
- }
-${END}
-
- return mDriverEntryPointStatus;
-}
-""")
-]
-
-## UEFI Driver Entry Point Templates
-gUefiDriverEntryPointPrototype = TemplateString("""
-${BEGIN}
-EFI_STATUS
-EFIAPI
-${Function} (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-${END}
-""")
-
-gUefiDriverEntryPointString = [
-TemplateString("""
-const UINT32 _gUefiDriverRevision = ${UefiSpecVersion};
-const UINT32 _gDxeRevision = ${PiSpecVersion};
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- return EFI_SUCCESS;
-}
-"""),
-TemplateString("""
-const UINT32 _gUefiDriverRevision = ${UefiSpecVersion};
-const UINT32 _gDxeRevision = ${PiSpecVersion};
-
-${BEGIN}
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-
-{
- return ${Function} (ImageHandle, SystemTable);
-}
-${END}
-VOID
-EFIAPI
-ExitDriver (
- IN EFI_STATUS Status
- )
-{
- if (EFI_ERROR (Status)) {
- ProcessLibraryDestructorList (gImageHandle, gST);
- }
- gBS->Exit (gImageHandle, Status, 0, NULL);
-}
-"""),
-TemplateString("""
-const UINT32 _gUefiDriverRevision = ${UefiSpecVersion};
-const UINT32 _gDxeRevision = ${PiSpecVersion};
-
-static BASE_LIBRARY_JUMP_BUFFER mJumpContext;
-static EFI_STATUS mDriverEntryPointStatus;
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- mDriverEntryPointStatus = EFI_LOAD_ERROR;
- ${BEGIN}
- if (SetJump (&mJumpContext) == 0) {
- ExitDriver (${Function} (ImageHandle, SystemTable));
- ASSERT (FALSE);
- }
- ${END}
- return mDriverEntryPointStatus;
-}
-
-VOID
-EFIAPI
-ExitDriver (
- IN EFI_STATUS Status
- )
-{
- if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {
- mDriverEntryPointStatus = Status;
- }
- LongJump (&mJumpContext, (UINTN)-1);
- ASSERT (FALSE);
-}
-""")
-]
-
-
-## UEFI Application Entry Point Templates
-gUefiApplicationEntryPointPrototype = TemplateString("""
-${BEGIN}
-EFI_STATUS
-EFIAPI
-${Function} (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-${END}
-""")
-
-gUefiApplicationEntryPointString = [
-TemplateString("""
-const UINT32 _gUefiDriverRevision = ${UefiSpecVersion};
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- return EFI_SUCCESS;
-}
-"""),
-TemplateString("""
-const UINT32 _gUefiDriverRevision = ${UefiSpecVersion};
-
-${BEGIN}
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-
-{
- return ${Function} (ImageHandle, SystemTable);
-}
-${END}
-VOID
-EFIAPI
-ExitDriver (
- IN EFI_STATUS Status
- )
-{
- if (EFI_ERROR (Status)) {
- ProcessLibraryDestructorList (gImageHandle, gST);
- }
- gBS->Exit (gImageHandle, Status, 0, NULL);
-}
-"""),
-TemplateString("""
-const UINT32 _gUefiDriverRevision = ${UefiSpecVersion};
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-
-{
- ${BEGIN}
- if (SetJump (&mJumpContext) == 0) {
- ExitDriver (${Function} (ImageHandle, SystemTable));
- ASSERT (FALSE);
- }
- ${END}
- return mDriverEntryPointStatus;
-}
-
-static BASE_LIBRARY_JUMP_BUFFER mJumpContext;
-static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;
-
-VOID
-EFIAPI
-ExitDriver (
- IN EFI_STATUS Status
- )
-{
- if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {
- mDriverEntryPointStatus = Status;
- }
- LongJump (&mJumpContext, (UINTN)-1);
- ASSERT (FALSE);
-}
-""")
-]
-
-## UEFI Unload Image Templates
-gUefiUnloadImagePrototype = TemplateString("""
-${BEGIN}
-EFI_STATUS
-EFIAPI
-${Function} (
- IN EFI_HANDLE ImageHandle
- );
-${END}
-""")
-
-gUefiUnloadImageString = [
-TemplateString("""
-GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ${Count};
-
-EFI_STATUS
-EFIAPI
-ProcessModuleUnloadList (
- IN EFI_HANDLE ImageHandle
- )
-{
- return EFI_SUCCESS;
-}
-"""),
-TemplateString("""
-GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ${Count};
-
-${BEGIN}
-EFI_STATUS
-EFIAPI
-ProcessModuleUnloadList (
- IN EFI_HANDLE ImageHandle
- )
-{
- return ${Function} (ImageHandle);
-}
-${END}
-"""),
-TemplateString("""
-GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ${Count};
-
-EFI_STATUS
-EFIAPI
-ProcessModuleUnloadList (
- IN EFI_HANDLE ImageHandle
- )
-{
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
-${BEGIN}
- if (EFI_ERROR (Status)) {
- ${Function} (ImageHandle);
- } else {
- Status = ${Function} (ImageHandle);
- }
-${END}
- return Status;
-}
-""")
-]
-
-gLibraryStructorPrototype = {
-'BASE' : TemplateString("""${BEGIN}
-RETURN_STATUS
-EFIAPI
-${Function} (
- VOID
- );${END}
-"""),
-
-'PEI' : TemplateString("""${BEGIN}
-EFI_STATUS
-EFIAPI
-${Function} (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- );${END}
-"""),
-
-'DXE' : TemplateString("""${BEGIN}
-EFI_STATUS
-EFIAPI
-${Function} (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );${END}
-"""),
-}
-
-gLibraryStructorCall = {
-'BASE' : TemplateString("""${BEGIN}
- Status = ${Function} ();
- ASSERT_EFI_ERROR (Status);${END}
-"""),
-
-'PEI' : TemplateString("""${BEGIN}
- Status = ${Function} (FileHandle, PeiServices);
- ASSERT_EFI_ERROR (Status);${END}
-"""),
-
-'DXE' : TemplateString("""${BEGIN}
- Status = ${Function} (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);${END}
-"""),
-}
-
-## Library Constructor and Destructor Templates
-gLibraryString = {
-'BASE' : TemplateString("""
-${BEGIN}${FunctionPrototype}${END}
-
-VOID
-EFIAPI
-ProcessLibrary${Type}List (
- VOID
- )
-{
-${BEGIN} EFI_STATUS Status;
-${FunctionCall}${END}
-}
-"""),
-
-'PEI' : TemplateString("""
-${BEGIN}${FunctionPrototype}${END}
-
-VOID
-EFIAPI
-ProcessLibrary${Type}List (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- )
-{
-${BEGIN} EFI_STATUS Status;
-${FunctionCall}${END}
-}
-"""),
-
-'DXE' : TemplateString("""
-${BEGIN}${FunctionPrototype}${END}
-
-VOID
-EFIAPI
-ProcessLibrary${Type}List (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
-${BEGIN} EFI_STATUS Status;
-${FunctionCall}${END}
-}
-"""),
-}
-
-gBasicHeaderFile = "Base.h"
-
-gModuleTypeHeaderFile = {
- "BASE" : [gBasicHeaderFile],
- "SEC" : ["PiPei.h", "Library/DebugLib.h"],
- "PEI_CORE" : ["PiPei.h", "Library/DebugLib.h", "Library/PeiCoreEntryPoint.h"],
- "PEIM" : ["PiPei.h", "Library/DebugLib.h", "Library/PeimEntryPoint.h"],
- "DXE_CORE" : ["PiDxe.h", "Library/DebugLib.h", "Library/DxeCoreEntryPoint.h"],
- "DXE_DRIVER" : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],
- "DXE_SMM_DRIVER" : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],
- "DXE_RUNTIME_DRIVER": ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],
- "DXE_SAL_DRIVER" : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],
- "UEFI_DRIVER" : ["Uefi.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoint.h"],
- "UEFI_APPLICATION" : ["Uefi.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiApplicationEntryPoint.h"],
- "SMM_CORE" : ["PiDxe.h", "Library/BaseLib.h", "Library/DebugLib.h", "Library/UefiDriverEntryPoint.h"],
- "USER_DEFINED" : [gBasicHeaderFile]
-}
-
-## Create code for module PCDs
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-# @param Pcd The PCD object
-#
-def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
- TokenSpaceGuidValue = Pcd.TokenSpaceGuidValue #Info.GuidList[Pcd.TokenSpaceGuidCName]
- PcdTokenNumber = Info.PlatformInfo.PcdTokenNumber
- #
- # Write PCDs
- #
- PcdTokenName = '_PCD_TOKEN_' + Pcd.TokenCName
- if Pcd.Type in gDynamicExPcd:
- TokenNumber = int(Pcd.TokenValue, 0)
- else:
- if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in PcdTokenNumber:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "No generated token number for %s.%s\n" % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- TokenNumber = PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName]
- AutoGenH.Append('\n#define %s %dU\n' % (PcdTokenName, TokenNumber))
-
- EdkLogger.debug(EdkLogger.DEBUG_3, "Creating code for " + Pcd.TokenCName + "." + Pcd.TokenSpaceGuidCName)
- if Pcd.Type not in gItemTypeStringDatabase:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "Unknown PCD type [%s] of PCD %s.%s" % (Pcd.Type, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- if Pcd.DatumType not in gDatumSizeStringDatabase:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "Unknown datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
-
- DatumSize = gDatumSizeStringDatabase[Pcd.DatumType]
- DatumSizeLib = gDatumSizeStringDatabaseLib[Pcd.DatumType]
- GetModeName = '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + Pcd.TokenCName
- SetModeName = '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + Pcd.TokenCName
-
- if Pcd.Type in gDynamicExPcd:
- AutoGenH.Append('#define %s LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
- if Pcd.DatumType == 'VOID*':
- AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
- else:
- AutoGenH.Append('#define %s(Value) LibPcdSetEx%s(&%s, %s, (Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
- elif Pcd.Type in gDynamicPcd:
- AutoGenH.Append('#define %s LibPcdGet%s(%s)\n' % (GetModeName, DatumSizeLib, PcdTokenName))
- if Pcd.DatumType == 'VOID*':
- AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSet%s(%s, (SizeOfBuffer), (Buffer))\n' %(SetModeName, DatumSizeLib, PcdTokenName))
- else:
- AutoGenH.Append('#define %s(Value) LibPcdSet%s(%s, (Value))\n' % (SetModeName, DatumSizeLib, PcdTokenName))
- else:
- PcdVariableName = '_gPcd_' + gItemTypeStringDatabase[Pcd.Type] + '_' + Pcd.TokenCName
- Const = 'const'
- if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:
- Const = ''
- Type = ''
- Array = ''
- Value = Pcd.DefaultValue
- Unicode = False
- ValueNumber = 0
-
- if Pcd.DatumType == 'BOOLEAN':
- BoolValue = Value.upper()
- if BoolValue == 'TRUE' or BoolValue == '1':
- Value = '1U'
- elif BoolValue == 'FALSE' or BoolValue == '0':
- Value = '0U'
-
- if Pcd.DatumType in ['UINT64', 'UINT32', 'UINT16', 'UINT8']:
- try:
- if Value.upper().startswith('0X'):
- ValueNumber = int (Value, 16)
- else:
- ValueNumber = int (Value)
- except:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "PCD value is not valid dec or hex number for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- if Pcd.DatumType == 'UINT64':
- if ValueNumber < 0:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- elif ValueNumber >= 0x10000000000000000:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- if not Value.endswith('ULL'):
- Value += 'ULL'
- elif Pcd.DatumType == 'UINT32':
- if ValueNumber < 0:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- elif ValueNumber >= 0x100000000:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- if not Value.endswith('U'):
- Value += 'U'
- elif Pcd.DatumType == 'UINT16':
- if ValueNumber < 0:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- elif ValueNumber >= 0x10000:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- if not Value.endswith('U'):
- Value += 'U'
- elif Pcd.DatumType == 'UINT8':
- if ValueNumber < 0:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- elif ValueNumber >= 0x100:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "Too large PCD value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- if not Value.endswith('U'):
- Value += 'U'
- if Pcd.DatumType == 'VOID*':
- if Pcd.MaxDatumSize == None or Pcd.MaxDatumSize == '':
- EdkLogger.error("build", AUTOGEN_ERROR,
- "Unknown [MaxDatumSize] of PCD [%s.%s]" % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
-
- ArraySize = int(Pcd.MaxDatumSize, 0)
- if Value[0] == '{':
- Type = '(VOID *)'
- else:
- if Value[0] == 'L':
- Unicode = True
- Value = Value.lstrip('L') #.strip('"')
- Value = eval(Value) # translate escape character
- NewValue = '{'
- for Index in range(0,len(Value)):
- if Unicode:
- NewValue = NewValue + str(ord(Value[Index]) % 0x10000) + ', '
- else:
- NewValue = NewValue + str(ord(Value[Index]) % 0x100) + ', '
- if Unicode:
- ArraySize = ArraySize / 2;
-
- if ArraySize < (len(Value) + 1):
- EdkLogger.error("build", AUTOGEN_ERROR,
- "The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- Value = NewValue + '0 }'
- Array = '[%d]' % ArraySize
- #
- # skip casting for fixed at build since it breaks ARM assembly.
- # Long term we need PCD macros that work in assembly
- #
- elif Pcd.Type != TAB_PCDS_FIXED_AT_BUILD:
- Value = "((%s)%s)" % (Pcd.DatumType, Value)
-
- if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:
- PcdValueName = '_PCD_PATCHABLE_VALUE_' + Pcd.TokenCName
- else:
- PcdValueName = '_PCD_VALUE_' + Pcd.TokenCName
-
- if Pcd.DatumType == 'VOID*':
- #
- # For unicode, UINT16 array will be generated, so the alignment of unicode is guaranteed.
- #
- if Unicode:
- AutoGenH.Append('#define _PCD_PATCHABLE_%s_SIZE %s\n' % (Pcd.TokenCName, Pcd.MaxDatumSize))
- AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT16 %s%s = %s;\n' % (Const, PcdVariableName, Array, Value))
- AutoGenH.Append('extern %s UINT16 %s%s;\n' %(Const, PcdVariableName, Array))
- AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdVariableName))
- else:
- AutoGenH.Append('#define _PCD_PATCHABLE_%s_SIZE %s\n' % (Pcd.TokenCName, Pcd.MaxDatumSize))
- AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT8 %s%s = %s;\n' % (Const, PcdVariableName, Array, Value))
- AutoGenH.Append('extern %s UINT8 %s%s;\n' %(Const, PcdVariableName, Array))
- AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdVariableName))
- elif Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:
- AutoGenH.Append('#define %s %s\n' %(PcdValueName, Value))
- AutoGenC.Append('volatile %s %s %s = %s;\n' %(Const, Pcd.DatumType, PcdVariableName, PcdValueName))
- AutoGenH.Append('extern volatile %s %s %s%s;\n' % (Const, Pcd.DatumType, PcdVariableName, Array))
- AutoGenH.Append('#define %s %s%s\n' % (GetModeName, Type, PcdVariableName))
- else:
- AutoGenH.Append('#define %s %s\n' %(PcdValueName, Value))
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s %s = %s;\n' %(Const, Pcd.DatumType, PcdVariableName, PcdValueName))
- AutoGenH.Append('extern %s %s %s%s;\n' % (Const, Pcd.DatumType, PcdVariableName, Array))
- AutoGenH.Append('#define %s %s%s\n' % (GetModeName, Type, PcdVariableName))
-
- if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:
- if Pcd.DatumType == 'VOID*':
- AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcdSetPtr(_gPcd_BinaryPatch_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' % (SetModeName, Pcd.TokenCName, Pcd.TokenCName))
- else:
- AutoGenH.Append('#define %s(Value) (%s = (Value))\n' % (SetModeName, PcdVariableName))
- else:
- AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD\n' % SetModeName)
-
-## Create code for library module PCDs
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-# @param Pcd The PCD object
-#
-def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
- PcdTokenNumber = Info.PlatformInfo.PcdTokenNumber
- TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName
- TokenCName = Pcd.TokenCName
- TokenSpaceGuidValue = Pcd.TokenSpaceGuidValue #Info.GuidList[TokenSpaceGuidCName]
- if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in PcdTokenNumber:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "No generated token number for %s.%s\n" % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- TokenNumber = PcdTokenNumber[TokenCName, TokenSpaceGuidCName]
-
- # If PCD is DynamicEx, then use TokenNumber declared in DEC file
- if Pcd.Type in gDynamicExPcd:
- TokenNumber = int(Pcd.TokenValue, 0)
-
- if Pcd.Type not in gItemTypeStringDatabase:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "Unknown PCD type [%s] of PCD %s.%s" % (Pcd.Type, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
- if Pcd.DatumType not in gDatumSizeStringDatabase:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "Unknown datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Info))
-
- DatumType = Pcd.DatumType
- DatumSize = gDatumSizeStringDatabaseH[DatumType]
- DatumSizeLib= gDatumSizeStringDatabaseLib[DatumType]
- GetModeName = '_PCD_GET_MODE_' + DatumSize + '_' + TokenCName
- SetModeName = '_PCD_SET_MODE_' + DatumSize + '_' + TokenCName
-
- Type = ''
- Array = ''
- if Pcd.DatumType == 'VOID*':
- Type = '(VOID *)'
- Array = '[]'
-
- AutoGenH.Append('#define _PCD_TOKEN_%s %dU\n' % (TokenCName, TokenNumber))
-
- PcdItemType = Pcd.Type
- #if PcdItemType in gDynamicPcd:
- # PcdItemType = TAB_PCDS_FIXED_AT_BUILD
- # if (TokenCName, TokenSpaceGuidCName) in Info.PlatformInfo.Platform.Pcds:
- # PcdItemType = Info.PlatformInfo.Platform.Pcds[TokenCName, TokenSpaceGuidCName].Type
- if PcdItemType in gDynamicExPcd:
- PcdTokenName = '_PCD_TOKEN_' + TokenCName
- AutoGenH.Append('#define %s LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, TokenSpaceGuidCName, PcdTokenName))
- if DatumType == 'VOID*':
- AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName,DatumSizeLib, TokenSpaceGuidCName, PcdTokenName))
- else:
- AutoGenH.Append('#define %s(Value) LibPcdSetEx%s(&%s, %s, (Value))\n' % (SetModeName, DatumSizeLib, TokenSpaceGuidCName, PcdTokenName))
- if PcdItemType in gDynamicPcd:
- PcdTokenName = '_PCD_TOKEN_' + TokenCName
- AutoGenH.Append('#define %s LibPcdGet%s(%s)\n' % (GetModeName, DatumSizeLib, PcdTokenName))
- if DatumType == 'VOID*':
- AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSet%s(%s, (SizeOfBuffer), (Buffer))\n' %(SetModeName, DatumSizeLib, PcdTokenName))
- else:
- AutoGenH.Append('#define %s(Value) LibPcdSet%s(%s, (Value))\n' % (SetModeName, DatumSizeLib, PcdTokenName))
- if PcdItemType == TAB_PCDS_PATCHABLE_IN_MODULE:
- PcdVariableName = '_gPcd_' + gItemTypeStringDatabase[TAB_PCDS_PATCHABLE_IN_MODULE] + '_' + TokenCName
- AutoGenH.Append('extern %s _gPcd_BinaryPatch_%s%s;\n' %(DatumType, TokenCName, Array) )
- AutoGenH.Append('#define %s %s_gPcd_BinaryPatch_%s\n' %(GetModeName, Type, TokenCName))
- AutoGenH.Append('#define %s(Value) (%s = (Value))\n' % (SetModeName, PcdVariableName))
- if PcdItemType == TAB_PCDS_FIXED_AT_BUILD or PcdItemType == TAB_PCDS_FEATURE_FLAG:
- AutoGenH.Append('extern const %s _gPcd_FixedAtBuild_%s%s;\n' %(DatumType, TokenCName, Array))
- #AutoGenH.Append('#define _PCD_VALUE_%s _gPcd_FixedAtBuild_%s\n' %(TokenCName, TokenCName))
- AutoGenH.Append('#define %s %s_gPcd_FixedAtBuild_%s\n' %(GetModeName, Type, TokenCName))
- AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD\n' % SetModeName)
-
-## Create code for PCD database in DXE or PEI phase
-#
-# @param Platform The platform object
-# @retval tuple Two TemplateString objects for C code and header file,
-# respectively
-#
-def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
- AutoGenC = TemplateString()
- AutoGenH = TemplateString()
-
- Dict = {
- 'PHASE' : Phase,
- 'GUID_TABLE_SIZE' : '1U',
- 'STRING_TABLE_SIZE' : '1U',
- 'SKUID_TABLE_SIZE' : '1U',
- 'LOCAL_TOKEN_NUMBER_TABLE_SIZE' : '1U',
- 'LOCAL_TOKEN_NUMBER' : '0U',
- 'EXMAPPING_TABLE_SIZE' : '1U',
- 'EX_TOKEN_NUMBER' : '0U',
- 'SIZE_TABLE_SIZE' : '2U',
- 'GUID_TABLE_EMPTY' : 'TRUE',
- 'STRING_TABLE_EMPTY' : 'TRUE',
- 'SKUID_TABLE_EMPTY' : 'TRUE',
- 'DATABASE_EMPTY' : 'TRUE',
- 'EXMAP_TABLE_EMPTY' : 'TRUE',
- 'PCD_DATABASE_UNINIT_EMPTY' : ' UINT8 dummy; /* PCD_DATABASE_UNINIT is emptry */',
- 'SYSTEM_SKU_ID' : ' SKU_ID SystemSkuId;',
- 'SYSTEM_SKU_ID_VALUE' : '0U'
- }
-
- for DatumType in ['UINT64','UINT32','UINT16','UINT8','BOOLEAN', "VOID*"]:
- Dict['VARDEF_CNAME_' + DatumType] = []
- Dict['VARDEF_GUID_' + DatumType] = []
- Dict['VARDEF_SKUID_' + DatumType] = []
- Dict['VARDEF_VALUE_' + DatumType] = []
- for Init in ['INIT','UNINIT']:
- Dict[Init+'_CNAME_DECL_' + DatumType] = []
- Dict[Init+'_GUID_DECL_' + DatumType] = []
- Dict[Init+'_NUMSKUS_DECL_' + DatumType] = []
- Dict[Init+'_VALUE_' + DatumType] = []
-
- for Type in ['STRING_HEAD','VPD_HEAD','VARIABLE_HEAD']:
- Dict[Type + '_CNAME_DECL'] = []
- Dict[Type + '_GUID_DECL'] = []
- Dict[Type + '_NUMSKUS_DECL'] = []
- Dict[Type + '_VALUE'] = []
-
- Dict['STRING_TABLE_INDEX'] = []
- Dict['STRING_TABLE_LENGTH'] = []
- Dict['STRING_TABLE_CNAME'] = []
- Dict['STRING_TABLE_GUID'] = []
- Dict['STRING_TABLE_VALUE'] = []
-
- Dict['SIZE_TABLE_CNAME'] = []
- Dict['SIZE_TABLE_GUID'] = []
- Dict['SIZE_TABLE_CURRENT_LENGTH'] = []
- Dict['SIZE_TABLE_MAXIMUM_LENGTH'] = []
-
- Dict['EXMAPPING_TABLE_EXTOKEN'] = []
- Dict['EXMAPPING_TABLE_LOCAL_TOKEN'] = []
- Dict['EXMAPPING_TABLE_GUID_INDEX'] = []
-
- Dict['GUID_STRUCTURE'] = []
-
- Dict['SKUID_VALUE'] = []
- Dict['VARDEF_HEADER'] = []
- if Phase == 'DXE':
- Dict['SYSTEM_SKU_ID'] = ''
- Dict['SYSTEM_SKU_ID_VALUE'] = ''
-
- StringTableIndex = 0
- StringTableSize = 0
- NumberOfLocalTokens = 0
- NumberOfPeiLocalTokens = 0
- NumberOfDxeLocalTokens = 0
- NumberOfExTokens = 0
- NumberOfSizeItems = 0
- GuidList = []
-
- for Pcd in Platform.DynamicPcdList:
- CName = Pcd.TokenCName
- TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName
-
- EdkLogger.debug(EdkLogger.DEBUG_3, "PCD: %s %s (%s : %s)" % (CName, TokenSpaceGuidCName, Pcd.Phase, Phase))
- if Pcd.DatumType not in gDatumSizeStringDatabase:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "Unknown datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Platform))
-
- if Pcd.Phase == 'PEI':
- NumberOfPeiLocalTokens += 1
- if Pcd.Phase == 'DXE':
- NumberOfDxeLocalTokens += 1
- if Pcd.Phase != Phase:
- continue
-
- #
- # TODO: need GetGuidValue() definition
- #
- TokenSpaceGuidStructure = Pcd.TokenSpaceGuidValue
- TokenSpaceGuid = GuidStructureStringToGuidValueName(TokenSpaceGuidStructure)
- if Pcd.Type in gDynamicExPcd:
- if TokenSpaceGuid not in GuidList:
- GuidList += [TokenSpaceGuid]
- Dict['GUID_STRUCTURE'].append(TokenSpaceGuidStructure)
- NumberOfExTokens += 1
-
- ValueList = []
- StringHeadOffsetList = []
- VpdHeadOffsetList = []
- VariableHeadValueList = []
- Pcd.InitString = 'UNINIT'
-
- if Pcd.DatumType == 'VOID*':
- if Pcd.Type not in ["DynamicVpd", "DynamicExVpd"]:
- Pcd.TokenTypeList = ['PCD_TYPE_STRING']
- else:
- Pcd.TokenTypeList = []
- elif Pcd.DatumType == 'BOOLEAN':
- Pcd.TokenTypeList = ['PCD_DATUM_TYPE_UINT8']
- else:
- Pcd.TokenTypeList = ['PCD_DATUM_TYPE_' + Pcd.DatumType]
-
- if len(Pcd.SkuInfoList) > 1:
- Pcd.TokenTypeList += ['PCD_TYPE_SKU_ENABLED']
-
- for SkuName in Pcd.SkuInfoList:
- Sku = Pcd.SkuInfoList[SkuName]
- SkuId = Sku.SkuId
- if SkuId == None or SkuId == '':
- continue
-
- if (SkuId + 'U') not in Dict['SKUID_VALUE']:
- Dict['SKUID_VALUE'].append(SkuId + 'U')
-
- SkuIdIndex = Dict['SKUID_VALUE'].index(SkuId + 'U')
- if len(Sku.VariableName) > 0:
- Pcd.TokenTypeList += ['PCD_TYPE_HII']
- Pcd.InitString = 'INIT'
- VariableNameStructure = StringToArray(Sku.VariableName)
- if VariableNameStructure not in Dict['STRING_TABLE_VALUE']:
- Dict['STRING_TABLE_CNAME'].append(CName)
- Dict['STRING_TABLE_GUID'].append(TokenSpaceGuid)
- if StringTableIndex == 0:
- Dict['STRING_TABLE_INDEX'].append('')
- else:
- Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex)
-
- Dict['STRING_TABLE_LENGTH'].append((len(Sku.VariableName) - 3 + 1) * 2)
- Dict['STRING_TABLE_VALUE'].append(VariableNameStructure)
- StringTableIndex += 1
- StringTableSize += (len(Sku.VariableName) - 3 + 1) * 2
-
- VariableHeadStringIndex = 0
- for Index in range(Dict['STRING_TABLE_VALUE'].index(VariableNameStructure)):
- VariableHeadStringIndex += Dict['STRING_TABLE_LENGTH'][Index]
-
- VariableGuidStructure = Sku.VariableGuidValue
- VariableGuid = GuidStructureStringToGuidValueName(VariableGuidStructure)
- if VariableGuid not in GuidList:
- GuidList += [VariableGuid]
- Dict['GUID_STRUCTURE'].append(VariableGuidStructure)
- VariableHeadGuidIndex = GuidList.index(VariableGuid)
-
- if "PCD_TYPE_STRING" in Pcd.TokenTypeList:
- VariableHeadValueList.append('%dU, offsetof(%s_PCD_DATABASE, Init.%s_%s), %dU, %sU' %
- (VariableHeadStringIndex, Phase, CName, TokenSpaceGuid,
- VariableHeadGuidIndex, Sku.VariableOffset))
- else:
- VariableHeadValueList.append('%dU, offsetof(%s_PCD_DATABASE, Init.%s_%s_VariableDefault_%s), %dU, %sU' %
- (VariableHeadStringIndex, Phase, CName, TokenSpaceGuid, SkuIdIndex,
- VariableHeadGuidIndex, Sku.VariableOffset))
- Dict['VARDEF_CNAME_'+Pcd.DatumType].append(CName)
- Dict['VARDEF_GUID_'+Pcd.DatumType].append(TokenSpaceGuid)
- Dict['VARDEF_SKUID_'+Pcd.DatumType].append(SkuIdIndex)
- if "PCD_TYPE_STRING" in Pcd.TokenTypeList:
- Dict['VARDEF_VALUE_' + Pcd.DatumType].append("%s_%s[%d]" % (Pcd.TokenCName, TokenSpaceGuid, SkuIdIndex))
- else:
- #
- # ULL (for UINT64) or U(other integer type) should be append to avoid
- # warning under linux building environment.
- #
- if Pcd.DatumType == "UINT64":
- Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue + "ULL")
- elif Pcd.DatumType in ("UINT32", "UINT16", "UINT8"):
- Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue + "U")
- elif Pcd.DatumType == "BOOLEAN":
- if Sku.HiiDefaultValue in ["1", "0"]:
- Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue + "U")
- else:
- Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue)
-
- elif Sku.VpdOffset != '':
- Pcd.TokenTypeList += ['PCD_TYPE_VPD']
- Pcd.InitString = 'INIT'
- VpdHeadOffsetList.append(str(Sku.VpdOffset) + 'U')
- continue
-
- if Pcd.DatumType == 'VOID*':
- Pcd.TokenTypeList += ['PCD_TYPE_STRING']
- Pcd.InitString = 'INIT'
- if Sku.HiiDefaultValue != '' and Sku.DefaultValue == '':
- Sku.DefaultValue = Sku.HiiDefaultValue
- if Sku.DefaultValue != '':
- NumberOfSizeItems += 1
- Dict['STRING_TABLE_CNAME'].append(CName)
- Dict['STRING_TABLE_GUID'].append(TokenSpaceGuid)
-
- if StringTableIndex == 0:
- Dict['STRING_TABLE_INDEX'].append('')
- else:
- Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex)
- if Sku.DefaultValue[0] == 'L':
- Size = (len(Sku.DefaultValue) - 3 + 1) * 2
- Dict['STRING_TABLE_VALUE'].append(StringToArray(Sku.DefaultValue))
- elif Sku.DefaultValue[0] == '"':
- Size = len(Sku.DefaultValue) - 2 + 1
- Dict['STRING_TABLE_VALUE'].append(StringToArray(Sku.DefaultValue))
- elif Sku.DefaultValue[0] == '{':
- Size = len(Sku.DefaultValue.replace(',',' ').split())
- Dict['STRING_TABLE_VALUE'].append(Sku.DefaultValue)
-
- StringHeadOffsetList.append(str(StringTableSize) + 'U')
- Dict['SIZE_TABLE_CNAME'].append(CName)
- Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid)
- Dict['SIZE_TABLE_CURRENT_LENGTH'].append(str(Size) + 'U')
- Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(str(Pcd.MaxDatumSize) + 'U')
- if Pcd.MaxDatumSize != '':
- MaxDatumSize = int(Pcd.MaxDatumSize, 0)
- if MaxDatumSize < Size:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
- ExtraData="[%s]" % str(Platform))
- Size = MaxDatumSize
- Dict['STRING_TABLE_LENGTH'].append(Size)
- StringTableIndex += 1
- StringTableSize += (Size)
- else:
- if "PCD_TYPE_HII" not in Pcd.TokenTypeList:
- Pcd.TokenTypeList += ['PCD_TYPE_DATA']
- if Sku.DefaultValue == 'TRUE':
- Pcd.InitString = 'INIT'
- else:
- try:
- if int(Sku.DefaultValue, 0) != 0:
- Pcd.InitString = 'INIT'
- except:
- pass
-
- #
- # For UNIT64 type PCD's value, ULL should be append to avoid
- # warning under linux building environment.
- #
- if Pcd.DatumType == "UINT64":
- ValueList.append(Sku.DefaultValue + "ULL")
- elif Pcd.DatumType in ("UINT32", "UINT16", "UINT8"):
- ValueList.append(Sku.DefaultValue + "U")
- elif Pcd.DatumType == "BOOLEAN":
- if Sku.DefaultValue in ["1", "0"]:
- ValueList.append(Sku.DefaultValue + "U")
- else:
- ValueList.append(Sku.DefaultValue)
-
- Pcd.TokenTypeList = list(set(Pcd.TokenTypeList))
-
-
- if 'PCD_TYPE_HII' in Pcd.TokenTypeList:
- Dict['VARIABLE_HEAD_CNAME_DECL'].append(CName)
- Dict['VARIABLE_HEAD_GUID_DECL'].append(TokenSpaceGuid)
- Dict['VARIABLE_HEAD_NUMSKUS_DECL'].append(len(Pcd.SkuInfoList))
- Dict['VARIABLE_HEAD_VALUE'].append('{ %s }\n' % ' },\n { '.join(VariableHeadValueList))
- Dict['VARDEF_HEADER'].append('_Variable_Header')
- else:
- Dict['VARDEF_HEADER'].append('')
- if 'PCD_TYPE_VPD' in Pcd.TokenTypeList:
- Dict['VPD_HEAD_CNAME_DECL'].append(CName)
- Dict['VPD_HEAD_GUID_DECL'].append(TokenSpaceGuid)
- Dict['VPD_HEAD_NUMSKUS_DECL'].append(len(Pcd.SkuInfoList))
- Dict['VPD_HEAD_VALUE'].append('{ %s }' % ' }, { '.join(VpdHeadOffsetList))
- if 'PCD_TYPE_STRING' in Pcd.TokenTypeList:
- Dict['STRING_HEAD_CNAME_DECL'].append(CName)
- Dict['STRING_HEAD_GUID_DECL'].append(TokenSpaceGuid)
- Dict['STRING_HEAD_NUMSKUS_DECL'].append(len(Pcd.SkuInfoList))
- Dict['STRING_HEAD_VALUE'].append(', '.join(StringHeadOffsetList))
- if 'PCD_TYPE_DATA' in Pcd.TokenTypeList:
- Dict[Pcd.InitString+'_CNAME_DECL_'+Pcd.DatumType].append(CName)
- Dict[Pcd.InitString+'_GUID_DECL_'+Pcd.DatumType].append(TokenSpaceGuid)
- Dict[Pcd.InitString+'_NUMSKUS_DECL_'+Pcd.DatumType].append(len(Pcd.SkuInfoList))
- if Pcd.InitString == 'UNINIT':
- Dict['PCD_DATABASE_UNINIT_EMPTY'] = ''
- else:
- Dict[Pcd.InitString+'_VALUE_'+Pcd.DatumType].append(', '.join(ValueList))
-
- if Phase == 'PEI':
- NumberOfLocalTokens = NumberOfPeiLocalTokens
- if Phase == 'DXE':
- NumberOfLocalTokens = NumberOfDxeLocalTokens
-
- Dict['TOKEN_INIT'] = ['' for x in range(NumberOfLocalTokens)]
- Dict['TOKEN_CNAME'] = ['' for x in range(NumberOfLocalTokens)]
- Dict['TOKEN_GUID'] = ['' for x in range(NumberOfLocalTokens)]
- Dict['TOKEN_TYPE'] = ['' for x in range(NumberOfLocalTokens)]
-
- for Pcd in Platform.DynamicPcdList:
- CName = Pcd.TokenCName
- TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName
- if Pcd.Phase != Phase:
- continue
-
- TokenSpaceGuid = GuidStructureStringToGuidValueName(Pcd.TokenSpaceGuidValue) #(Platform.PackageList, TokenSpaceGuidCName))
- GeneratedTokenNumber = Platform.PcdTokenNumber[CName, TokenSpaceGuidCName] - 1
- if Phase == 'DXE':
- GeneratedTokenNumber -= NumberOfPeiLocalTokens
-
- EdkLogger.debug(EdkLogger.DEBUG_1, "PCD = %s.%s" % (CName, TokenSpaceGuidCName))
- EdkLogger.debug(EdkLogger.DEBUG_1, "phase = %s" % Phase)
- EdkLogger.debug(EdkLogger.DEBUG_1, "GeneratedTokenNumber = %s" % str(GeneratedTokenNumber))
-
- Dict['TOKEN_INIT'][GeneratedTokenNumber] = 'Init'
- if Pcd.InitString == 'UNINIT':
- Dict['TOKEN_INIT'][GeneratedTokenNumber] = 'Uninit'
- Dict['TOKEN_CNAME'][GeneratedTokenNumber] = CName
- Dict['TOKEN_GUID'][GeneratedTokenNumber] = TokenSpaceGuid
- Dict['TOKEN_TYPE'][GeneratedTokenNumber] = ' | '.join(Pcd.TokenTypeList)
-
- Pcd.TokenTypeList = list(set(Pcd.TokenTypeList))
- #
- # Update VARDEF_HEADER
- #
- if 'PCD_TYPE_HII' in Pcd.TokenTypeList:
- Dict['VARDEF_HEADER'][GeneratedTokenNumber] = '_Variable_Header'
- else:
- Dict['VARDEF_HEADER'][GeneratedTokenNumber] = ''
-
-
- if Pcd.Type in gDynamicExPcd:
- Dict['EXMAPPING_TABLE_EXTOKEN'].append(str(Pcd.TokenValue) + 'U')
- if Phase == 'DXE':
- GeneratedTokenNumber += NumberOfPeiLocalTokens
- #
- # Per, PCD architecture specification, PCD Token Number is 1 based and 0 is defined as invalid token number.
- # For each EX type PCD, a PCD Token Number is assigned. When the
- # PCD Driver/PEIM map EX_GUID and EX_TOKEN_NUMBER to the PCD Token Number,
- # the non-EX Protocol/PPI interface can be called to get/set the value. This assumption is made by
- # Pcd Driver/PEIM in MdeModulePkg.
- # Therefore, 1 is added to GeneratedTokenNumber to generate a PCD Token Number before being inserted
- # to the EXMAPPING_TABLE.
- #
- Dict['EXMAPPING_TABLE_LOCAL_TOKEN'].append(str(GeneratedTokenNumber + 1) + 'U')
- Dict['EXMAPPING_TABLE_GUID_INDEX'].append(str(GuidList.index(TokenSpaceGuid)) + 'U')
-
- if GuidList != []:
- Dict['GUID_TABLE_EMPTY'] = 'FALSE'
- Dict['GUID_TABLE_SIZE'] = str(len(GuidList)) + 'U'
- else:
- Dict['GUID_STRUCTURE'] = [GuidStringToGuidStructureString('00000000-0000-0000-0000-000000000000')]
-
- if StringTableIndex == 0:
- Dict['STRING_TABLE_INDEX'].append('')
- Dict['STRING_TABLE_LENGTH'].append(1)
- Dict['STRING_TABLE_CNAME'].append('')
- Dict['STRING_TABLE_GUID'].append('')
- Dict['STRING_TABLE_VALUE'].append('{ 0 }')
- else:
- Dict['STRING_TABLE_EMPTY'] = 'FALSE'
- Dict['STRING_TABLE_SIZE'] = str(StringTableSize) + 'U'
-
- if Dict['SIZE_TABLE_CNAME'] == []:
- Dict['SIZE_TABLE_CNAME'].append('')
- Dict['SIZE_TABLE_GUID'].append('')
- Dict['SIZE_TABLE_CURRENT_LENGTH'].append('0U')
- Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append('0U')
-
- if NumberOfLocalTokens != 0:
- Dict['DATABASE_EMPTY'] = 'FALSE'
- Dict['LOCAL_TOKEN_NUMBER_TABLE_SIZE'] = NumberOfLocalTokens
- Dict['LOCAL_TOKEN_NUMBER'] = NumberOfLocalTokens
-
- if NumberOfExTokens != 0:
- Dict['EXMAP_TABLE_EMPTY'] = 'FALSE'
- Dict['EXMAPPING_TABLE_SIZE'] = str(NumberOfExTokens) + 'U'
- Dict['EX_TOKEN_NUMBER'] = str(NumberOfExTokens) + 'U'
- else:
- Dict['EXMAPPING_TABLE_EXTOKEN'].append('0U')
- Dict['EXMAPPING_TABLE_LOCAL_TOKEN'].append('0U')
- Dict['EXMAPPING_TABLE_GUID_INDEX'].append('0U')
-
- if NumberOfSizeItems != 0:
- Dict['SIZE_TABLE_SIZE'] = str(NumberOfSizeItems * 2) + 'U'
-
- AutoGenH.Append(gPcdDatabaseAutoGenH.Replace(Dict))
- if NumberOfLocalTokens == 0:
- AutoGenC.Append(gEmptyPcdDatabaseAutoGenC.Replace(Dict))
- else:
- #
- # Update Size Table to the right order, it should be same with LocalTokenNumberTable
- #
- SizeCNameTempList = []
- SizeGuidTempList = []
- SizeCurLenTempList = []
- SizeMaxLenTempList = []
- ReOrderFlag = True
-
- if len(Dict['SIZE_TABLE_CNAME']) == 1:
- if not (Dict['SIZE_TABLE_CNAME'][0] and Dict['SIZE_TABLE_GUID'][0]):
- ReOrderFlag = False
-
- if ReOrderFlag:
- for Count in range(len(Dict['TOKEN_CNAME'])):
- for Count1 in range(len(Dict['SIZE_TABLE_CNAME'])):
- if Dict['TOKEN_CNAME'][Count] == Dict['SIZE_TABLE_CNAME'][Count1] and \
- Dict['TOKEN_GUID'][Count] == Dict['SIZE_TABLE_GUID'][Count1]:
- SizeCNameTempList.append(Dict['SIZE_TABLE_CNAME'][Count1])
- SizeGuidTempList.append(Dict['SIZE_TABLE_GUID'][Count1])
- SizeCurLenTempList.append(Dict['SIZE_TABLE_CURRENT_LENGTH'][Count1])
- SizeMaxLenTempList.append(Dict['SIZE_TABLE_MAXIMUM_LENGTH'][Count1])
-
- for Count in range(len(Dict['SIZE_TABLE_CNAME'])):
- Dict['SIZE_TABLE_CNAME'][Count] = SizeCNameTempList[Count]
- Dict['SIZE_TABLE_GUID'][Count] = SizeGuidTempList[Count]
- Dict['SIZE_TABLE_CURRENT_LENGTH'][Count] = SizeCurLenTempList[Count]
- Dict['SIZE_TABLE_MAXIMUM_LENGTH'][Count] = SizeMaxLenTempList[Count]
-
- AutoGenC.Append(gPcdDatabaseAutoGenC.Replace(Dict))
-
- return AutoGenH, AutoGenC
-
-## Create code for PCD database
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreatePcdDatabaseCode (Info, AutoGenC, AutoGenH):
- if Info.PcdIsDriver == "":
- return
- if Info.PcdIsDriver not in gPcdPhaseMap:
- EdkLogger.error("build", AUTOGEN_ERROR, "Not supported PcdIsDriver type:%s" % Info.PcdIsDriver,
- ExtraData="[%s]" % str(Info))
-
- AutoGenH.Append(gPcdDatabaseCommonAutoGenH)
- AdditionalAutoGenH, AdditionalAutoGenC = CreatePcdDatabasePhaseSpecificAutoGen (Info.PlatformInfo, 'PEI')
- AutoGenH.Append(AdditionalAutoGenH.String)
-
- Phase = gPcdPhaseMap[Info.PcdIsDriver]
- if Phase == 'PEI':
- AutoGenC.Append(AdditionalAutoGenC.String)
-
- if Phase == 'DXE':
- AdditionalAutoGenH, AdditionalAutoGenC = CreatePcdDatabasePhaseSpecificAutoGen (Info.PlatformInfo, Phase)
- AutoGenH.Append(AdditionalAutoGenH.String)
- AutoGenC.Append(AdditionalAutoGenC.String)
- AutoGenH.Append(gPcdDatabaseEpilogueAutoGenH)
-
-## Create code for library constructor
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreateLibraryConstructorCode(Info, AutoGenC, AutoGenH):
- #
- # Library Constructors
- #
- ConstructorPrototypeString = TemplateString()
- ConstructorCallingString = TemplateString()
- if Info.IsLibrary:
- DependentLibraryList = [Info.Module]
- else:
- DependentLibraryList = Info.DependentLibraryList
- for Lib in DependentLibraryList:
- if len(Lib.ConstructorList) <= 0:
- continue
- Dict = {'Function':Lib.ConstructorList}
- if Lib.ModuleType in ['BASE', 'SEC']:
- ConstructorPrototypeString.Append(gLibraryStructorPrototype['BASE'].Replace(Dict))
- ConstructorCallingString.Append(gLibraryStructorCall['BASE'].Replace(Dict))
- elif Lib.ModuleType in ['PEI_CORE','PEIM']:
- ConstructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))
- ConstructorCallingString.Append(gLibraryStructorCall['PEI'].Replace(Dict))
- elif Lib.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',
- 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION','SMM_CORE']:
- ConstructorPrototypeString.Append(gLibraryStructorPrototype['DXE'].Replace(Dict))
- ConstructorCallingString.Append(gLibraryStructorCall['DXE'].Replace(Dict))
-
- if str(ConstructorPrototypeString) == '':
- ConstructorPrototypeList = []
- else:
- ConstructorPrototypeList = [str(ConstructorPrototypeString)]
- if str(ConstructorCallingString) == '':
- ConstructorCallingList = []
- else:
- ConstructorCallingList = [str(ConstructorCallingString)]
-
- Dict = {
- 'Type' : 'Constructor',
- 'FunctionPrototype' : ConstructorPrototypeList,
- 'FunctionCall' : ConstructorCallingList
- }
- if Info.IsLibrary:
- AutoGenH.Append("${BEGIN}${FunctionPrototype}${END}", Dict)
- else:
- if Info.ModuleType in ['BASE', 'SEC']:
- AutoGenC.Append(gLibraryString['BASE'].Replace(Dict))
- elif Info.ModuleType in ['PEI_CORE','PEIM']:
- AutoGenC.Append(gLibraryString['PEI'].Replace(Dict))
- elif Info.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',
- 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION','SMM_CORE']:
- AutoGenC.Append(gLibraryString['DXE'].Replace(Dict))
-
-## Create code for library destructor
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH):
- #
- # Library Destructors
- #
- DestructorPrototypeString = TemplateString()
- DestructorCallingString = TemplateString()
- if Info.IsLibrary:
- DependentLibraryList = [Info.Module]
- else:
- DependentLibraryList = Info.DependentLibraryList
- for Index in range(len(DependentLibraryList)-1, -1, -1):
- Lib = DependentLibraryList[Index]
- if len(Lib.DestructorList) <= 0:
- continue
- Dict = {'Function':Lib.DestructorList}
- if Lib.ModuleType in ['BASE', 'SEC']:
- DestructorPrototypeString.Append(gLibraryStructorPrototype['BASE'].Replace(Dict))
- DestructorCallingString.Append(gLibraryStructorCall['BASE'].Replace(Dict))
- elif Lib.ModuleType in ['PEI_CORE','PEIM']:
- DestructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))
- DestructorCallingString.Append(gLibraryStructorCall['PEI'].Replace(Dict))
- elif Lib.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',
- 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION', 'SMM_CORE']:
- DestructorPrototypeString.Append(gLibraryStructorPrototype['DXE'].Replace(Dict))
- DestructorCallingString.Append(gLibraryStructorCall['DXE'].Replace(Dict))
-
- if str(DestructorPrototypeString) == '':
- DestructorPrototypeList = []
- else:
- DestructorPrototypeList = [str(DestructorPrototypeString)]
- if str(DestructorCallingString) == '':
- DestructorCallingList = []
- else:
- DestructorCallingList = [str(DestructorCallingString)]
-
- Dict = {
- 'Type' : 'Destructor',
- 'FunctionPrototype' : DestructorPrototypeList,
- 'FunctionCall' : DestructorCallingList
- }
- if Info.IsLibrary:
- AutoGenH.Append("${BEGIN}${FunctionPrototype}${END}", Dict)
- else:
- if Info.ModuleType in ['BASE', 'SEC']:
- AutoGenC.Append(gLibraryString['BASE'].Replace(Dict))
- elif Info.ModuleType in ['PEI_CORE','PEIM']:
- AutoGenC.Append(gLibraryString['PEI'].Replace(Dict))
- elif Info.ModuleType in ['DXE_CORE','DXE_DRIVER','DXE_SMM_DRIVER','DXE_RUNTIME_DRIVER',
- 'DXE_SAL_DRIVER','UEFI_DRIVER','UEFI_APPLICATION','SMM_CORE']:
- AutoGenC.Append(gLibraryString['DXE'].Replace(Dict))
-
-
-## Create code for ModuleEntryPoint
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary or Info.ModuleType in ['USER_DEFINED', 'SEC']:
- return
- #
- # Module Entry Points
- #
- NumEntryPoints = len(Info.Module.ModuleEntryPointList)
- if 'PI_SPECIFICATION_VERSION' in Info.Module.Specification:
- PiSpecVersion = Info.Module.Specification['PI_SPECIFICATION_VERSION']
- else:
- PiSpecVersion = '0x00000000'
- if 'UEFI_SPECIFICATION_VERSION' in Info.Module.Specification:
- UefiSpecVersion = Info.Module.Specification['UEFI_SPECIFICATION_VERSION']
- else:
- UefiSpecVersion = '0x00000000'
- Dict = {
- 'Function' : Info.Module.ModuleEntryPointList,
- 'PiSpecVersion' : PiSpecVersion + 'U',
- 'UefiSpecVersion': UefiSpecVersion + 'U'
- }
-
- if Info.ModuleType in ['PEI_CORE', 'DXE_CORE', 'SMM_CORE']:
- if Info.SourceFileList <> None and Info.SourceFileList <> []:
- if NumEntryPoints != 1:
- EdkLogger.error(
- "build",
- AUTOGEN_ERROR,
- '%s must have exactly one entry point' % Info.ModuleType,
- File=str(Info),
- ExtraData= ", ".join(Info.Module.ModuleEntryPointList)
- )
- if Info.ModuleType == 'PEI_CORE':
- AutoGenC.Append(gPeiCoreEntryPointString.Replace(Dict))
- AutoGenH.Append(gPeiCoreEntryPointPrototype.Replace(Dict))
- elif Info.ModuleType == 'DXE_CORE':
- AutoGenC.Append(gDxeCoreEntryPointString.Replace(Dict))
- AutoGenH.Append(gDxeCoreEntryPointPrototype.Replace(Dict))
- elif Info.ModuleType == 'SMM_CORE':
- AutoGenC.Append(gSmmCoreEntryPointString.Replace(Dict))
- AutoGenH.Append(gSmmCoreEntryPointPrototype.Replace(Dict))
- elif Info.ModuleType == 'PEIM':
- if NumEntryPoints < 2:
- AutoGenC.Append(gPeimEntryPointString[NumEntryPoints].Replace(Dict))
- else:
- AutoGenC.Append(gPeimEntryPointString[2].Replace(Dict))
- AutoGenH.Append(gPeimEntryPointPrototype.Replace(Dict))
- elif Info.ModuleType in ['DXE_RUNTIME_DRIVER','DXE_DRIVER','DXE_SAL_DRIVER','UEFI_DRIVER']:
- if NumEntryPoints < 2:
- AutoGenC.Append(gUefiDriverEntryPointString[NumEntryPoints].Replace(Dict))
- else:
- AutoGenC.Append(gUefiDriverEntryPointString[2].Replace(Dict))
- AutoGenH.Append(gUefiDriverEntryPointPrototype.Replace(Dict))
- elif Info.ModuleType == 'DXE_SMM_DRIVER':
- if NumEntryPoints == 0:
- AutoGenC.Append(gDxeSmmEntryPointString[0].Replace(Dict))
- else:
- AutoGenC.Append(gDxeSmmEntryPointString[1].Replace(Dict))
- AutoGenH.Append(gDxeSmmEntryPointPrototype.Replace(Dict))
- elif Info.ModuleType == 'UEFI_APPLICATION':
- if NumEntryPoints < 2:
- AutoGenC.Append(gUefiApplicationEntryPointString[NumEntryPoints].Replace(Dict))
- else:
- AutoGenC.Append(gUefiApplicationEntryPointString[2].Replace(Dict))
- AutoGenH.Append(gUefiApplicationEntryPointPrototype.Replace(Dict))
-
-## Create code for ModuleUnloadImage
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary or Info.ModuleType in ['USER_DEFINED', 'SEC']:
- return
- #
- # Unload Image Handlers
- #
- NumUnloadImage = len(Info.Module.ModuleUnloadImageList)
- Dict = {'Count':str(NumUnloadImage) + 'U', 'Function':Info.Module.ModuleUnloadImageList}
- if NumUnloadImage < 2:
- AutoGenC.Append(gUefiUnloadImageString[NumUnloadImage].Replace(Dict))
- else:
- AutoGenC.Append(gUefiUnloadImageString[2].Replace(Dict))
- AutoGenH.Append(gUefiUnloadImagePrototype.Replace(Dict))
-
-## Create code for GUID
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary:
- return
-
- if Info.ModuleType in ["USER_DEFINED", "BASE"]:
- GuidType = "GUID"
- else:
- GuidType = "EFI_GUID"
-
- if Info.GuidList:
- AutoGenC.Append("\n// Guids\n")
- #
- # GUIDs
- #
- for Key in Info.GuidList:
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.GuidList[Key]))
-
-## Create code for protocol
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary:
- return
-
- if Info.ModuleType in ["USER_DEFINED", "BASE"]:
- GuidType = "GUID"
- else:
- GuidType = "EFI_GUID"
-
- if Info.ProtocolList:
- AutoGenC.Append("\n// Protocols\n")
- #
- # Protocol GUIDs
- #
- for Key in Info.ProtocolList:
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.ProtocolList[Key]))
-
-## Create code for PPI
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary:
- return
-
- if Info.ModuleType in ["USER_DEFINED", "BASE"]:
- GuidType = "GUID"
- else:
- GuidType = "EFI_GUID"
-
- if Info.PpiList:
- AutoGenC.Append("\n// PPIs\n")
- #
- # PPI GUIDs
- #
- for Key in Info.PpiList:
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.PpiList[Key]))
-
-## Create code for PCD
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreatePcdCode(Info, AutoGenC, AutoGenH):
-
- # Collect Token Space GUIDs used by DynamicEc PCDs
- TokenSpaceList = []
- for Pcd in Info.ModulePcdList:
- if Pcd.Type in gDynamicExPcd and Pcd.TokenSpaceGuidCName not in TokenSpaceList:
- TokenSpaceList += [Pcd.TokenSpaceGuidCName]
-
- # Add extern declarations to AutoGen.h if one or more Token Space GUIDs were found
- if TokenSpaceList <> []:
- AutoGenH.Append("\n// Definition of PCD Token Space GUIDs used in this module\n\n")
- if Info.ModuleType in ["USER_DEFINED", "BASE"]:
- GuidType = "GUID"
- else:
- GuidType = "EFI_GUID"
- for Item in TokenSpaceList:
- AutoGenH.Append('extern %s %s;\n' % (GuidType, Item))
-
- if Info.IsLibrary:
- if Info.ModulePcdList:
- AutoGenH.Append("\n// PCD definitions\n")
- for Pcd in Info.ModulePcdList:
- CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd)
- else:
- if Info.ModulePcdList:
- AutoGenH.Append("\n// Definition of PCDs used in this module\n")
- AutoGenC.Append("\n// Definition of PCDs used in this module\n")
- for Pcd in Info.ModulePcdList:
- CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd)
-
- if Info.LibraryPcdList:
- AutoGenH.Append("\n// Definition of PCDs used in libraries is in AutoGen.c\n")
- AutoGenC.Append("\n// Definition of PCDs used in libraries\n")
- for Pcd in Info.LibraryPcdList:
- CreateModulePcdCode(Info, AutoGenC, AutoGenC, Pcd)
- CreatePcdDatabaseCode(Info, AutoGenC, AutoGenH)
-
-## Create code for unicode string definition
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-# @param UniGenCFlag UniString is generated into AutoGen C file when it is set to True
-# @param UniGenBinBuffer Buffer to store uni string package data
-#
-def CreateUnicodeStringCode(Info, AutoGenC, AutoGenH, UniGenCFlag, UniGenBinBuffer):
- WorkingDir = os.getcwd()
- os.chdir(Info.WorkspaceDir)
-
- IncList = [Info.MetaFile.Dir]
- # Get all files under [Sources] section in inf file for EDK-II module
- EDK2Module = True
- SrcList = [F for F in Info.SourceFileList]
- if Info.AutoGenVersion < 0x00010005:
- EDK2Module = False
- # Get all files under the module directory for EDK-I module
- Cwd = os.getcwd()
- os.chdir(Info.MetaFile.Dir)
- for Root, Dirs, Files in os.walk("."):
- if 'CVS' in Dirs:
- Dirs.remove('CVS')
- if '.svn' in Dirs:
- Dirs.remove('.svn')
- for File in Files:
- File = PathClass(os.path.join(Root, File), Info.MetaFile.Dir)
- if File in SrcList:
- continue
- SrcList.append(File)
- os.chdir(Cwd)
-
- if 'BUILD' in Info.BuildOption and Info.BuildOption['BUILD']['FLAGS'].find('-c') > -1:
- CompatibleMode = True
- else:
- CompatibleMode = False
-
- #
- # -s is a temporary option dedicated for building .UNI files with ISO 639-2 language codes of EDK Shell in EDK2
- #
- if 'BUILD' in Info.BuildOption and Info.BuildOption['BUILD']['FLAGS'].find('-s') > -1:
- if CompatibleMode:
- EdkLogger.error("build", AUTOGEN_ERROR,
- "-c and -s build options should be used exclusively",
- ExtraData="[%s]" % str(Info))
- ShellMode = True
- else:
- ShellMode = False
-
- #RFC4646 is only for EDKII modules and ISO639-2 for EDK modules
- if EDK2Module:
- FilterInfo = [EDK2Module] + [Info.PlatformInfo.Platform.RFCLanguages]
- else:
- FilterInfo = [EDK2Module] + [Info.PlatformInfo.Platform.ISOLanguages]
- Header, Code = GetStringFiles(Info.UnicodeFileList, SrcList, IncList, Info.IncludePathList, ['.uni', '.inf'], Info.Name, CompatibleMode, ShellMode, UniGenCFlag, UniGenBinBuffer, FilterInfo)
- if CompatibleMode or UniGenCFlag:
- AutoGenC.Append("\n//\n//Unicode String Pack Definition\n//\n")
- AutoGenC.Append(Code)
- AutoGenC.Append("\n")
- AutoGenH.Append("\n//\n//Unicode String ID\n//\n")
- AutoGenH.Append(Header)
- if CompatibleMode or UniGenCFlag:
- AutoGenH.Append("\n#define STRING_ARRAY_NAME %sStrings\n" % Info.Name)
- os.chdir(WorkingDir)
-
-## Create common code
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreateHeaderCode(Info, AutoGenC, AutoGenH):
- # file header
- AutoGenH.Append(gAutoGenHeaderString.Replace({'FileName':'AutoGen.h'}))
- # header file Prologue
- AutoGenH.Append(gAutoGenHPrologueString.Replace({'File':'AUTOGENH','Guid':Info.Guid.replace('-','_')}))
- AutoGenH.Append(gAutoGenHCppPrologueString)
- if Info.AutoGenVersion >= 0x00010005:
- # header files includes
- AutoGenH.Append("#include <%s>\n" % gBasicHeaderFile)
- if Info.ModuleType in gModuleTypeHeaderFile \
- and gModuleTypeHeaderFile[Info.ModuleType][0] != gBasicHeaderFile:
- AutoGenH.Append("#include <%s>\n" % gModuleTypeHeaderFile[Info.ModuleType][0])
- #
- # if either PcdLib in [LibraryClasses] sections or there exist Pcd section, add PcdLib.h
- # As if modules only uses FixedPcd, then PcdLib is not needed in [LibraryClasses] section.
- #
- if 'PcdLib' in Info.Module.LibraryClasses or Info.Module.Pcds:
- AutoGenH.Append("#include <Library/PcdLib.h>\n")
-
- AutoGenH.Append('\nextern GUID gEfiCallerIdGuid;')
- AutoGenH.Append('\nextern CHAR8 *gEfiCallerBaseName;\n\n')
-
- if Info.IsLibrary:
- return
-
- AutoGenH.Append("#define EFI_CALLER_ID_GUID \\\n %s\n" % GuidStringToGuidStructureString(Info.Guid))
-
- if Info.IsLibrary:
- return
- # C file header
- AutoGenC.Append(gAutoGenHeaderString.Replace({'FileName':'AutoGen.c'}))
- if Info.AutoGenVersion >= 0x00010005:
- # C file header files includes
- if Info.ModuleType in gModuleTypeHeaderFile:
- for Inc in gModuleTypeHeaderFile[Info.ModuleType]:
- AutoGenC.Append("#include <%s>\n" % Inc)
- else:
- AutoGenC.Append("#include <%s>\n" % gBasicHeaderFile)
-
- #
- # Publish the CallerId Guid
- #
- AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = %s;\n' % GuidStringToGuidStructureString(Info.Guid))
- AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED CHAR8 *gEfiCallerBaseName = "%s";\n' % Info.Name)
-
-## Create common code for header file
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-#
-def CreateFooterCode(Info, AutoGenC, AutoGenH):
- AutoGenH.Append(gAutoGenHEpilogueString)
-
-## Create code for a module
-#
-# @param Info The ModuleAutoGen object
-# @param AutoGenC The TemplateString object for C code
-# @param AutoGenH The TemplateString object for header file
-# @param UniGenCFlag UniString is generated into AutoGen C file when it is set to True
-# @param UniGenBinBuffer Buffer to store uni string package data
-#
-def CreateCode(Info, AutoGenC, AutoGenH, StringH, UniGenCFlag, UniGenBinBuffer):
- CreateHeaderCode(Info, AutoGenC, AutoGenH)
-
- if Info.AutoGenVersion >= 0x00010005:
- CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH)
- CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH)
- CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH)
- CreatePcdCode(Info, AutoGenC, AutoGenH)
- CreateLibraryConstructorCode(Info, AutoGenC, AutoGenH)
- CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH)
- CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH)
- CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH)
-
- if Info.UnicodeFileList:
- FileName = "%sStrDefs.h" % Info.Name
- StringH.Append(gAutoGenHeaderString.Replace({'FileName':FileName}))
- StringH.Append(gAutoGenHPrologueString.Replace({'File':'STRDEFS', 'Guid':Info.Guid.replace('-','_')}))
- CreateUnicodeStringCode(Info, AutoGenC, StringH, UniGenCFlag, UniGenBinBuffer)
- StringH.Append("\n#endif\n")
- AutoGenH.Append('#include "%s"\n' % FileName)
-
- CreateFooterCode(Info, AutoGenC, AutoGenH)
-
- # no generation of AutoGen.c for Edk modules without unicode file
- if Info.AutoGenVersion < 0x00010005 and len(Info.UnicodeFileList) == 0:
- AutoGenC.String = ''
-
-## Create the code file
-#
-# @param FilePath The path of code file
-# @param Content The content of code file
-# @param IsBinaryFile The flag indicating if the file is binary file or not
-#
-# @retval True If file content is changed or file doesn't exist
-# @retval False If the file exists and the content is not changed
-#
-def Generate(FilePath, Content, IsBinaryFile):
- return SaveFileOnChange(FilePath, Content, IsBinaryFile)
-
diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source/Python/AutoGen/GenDepex.py
deleted file mode 100644
index 37ba7bc72c..0000000000
--- a/BaseTools/Source/Python/AutoGen/GenDepex.py
+++ /dev/null
@@ -1,448 +0,0 @@
-## @file
-# This file is used to generate DEPEX file for module's dependency expression
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-## Import Modules
-#
-import sys
-import os
-import re
-import traceback
-
-from StringIO import StringIO
-from struct import pack
-from Common.BuildToolError import *
-from Common.Misc import SaveFileOnChange
-from Common.Misc import GuidStructureStringToGuidString
-from Common import EdkLogger as EdkLogger
-from Common.BuildVersion import gBUILD_VERSION
-
-## Regular expression for matching "DEPENDENCY_START ... DEPENDENCY_END"
-gStartClosePattern = re.compile(".*DEPENDENCY_START(.+)DEPENDENCY_END.*", re.S)
-
-## Mapping between module type and EFI phase
-gType2Phase = {
- "BASE" : None,
- "SEC" : "PEI",
- "PEI_CORE" : "PEI",
- "PEIM" : "PEI",
- "DXE_CORE" : "DXE",
- "DXE_DRIVER" : "DXE",
- "DXE_SMM_DRIVER" : "DXE",
- "DXE_RUNTIME_DRIVER": "DXE",
- "DXE_SAL_DRIVER" : "DXE",
- "UEFI_DRIVER" : "DXE",
- "UEFI_APPLICATION" : "DXE",
- "SMM_CORE" : "DXE",
-}
-
-## Convert dependency expression string into EFI internal representation
-#
-# DependencyExpression class is used to parse dependency expression string and
-# convert it into its binary form.
-#
-class DependencyExpression:
-
- ArchProtocols = set([
- '665e3ff6-46cc-11d4-9a38-0090273fc14d', # 'gEfiBdsArchProtocolGuid'
- '26baccb1-6f42-11d4-bce7-0080c73c8881', # 'gEfiCpuArchProtocolGuid'
- '26baccb2-6f42-11d4-bce7-0080c73c8881', # 'gEfiMetronomeArchProtocolGuid'
- '1da97072-bddc-4b30-99f1-72a0b56fff2a', # 'gEfiMonotonicCounterArchProtocolGuid'
- '27cfac87-46cc-11d4-9a38-0090273fc14d', # 'gEfiRealTimeClockArchProtocolGuid'
- '27cfac88-46cc-11d4-9a38-0090273fc14d', # 'gEfiResetArchProtocolGuid'
- 'b7dfb4e1-052f-449f-87be-9818fc91b733', # 'gEfiRuntimeArchProtocolGuid'
- 'a46423e3-4617-49f1-b9ff-d1bfa9115839', # 'gEfiSecurityArchProtocolGuid'
- '26baccb3-6f42-11d4-bce7-0080c73c8881', # 'gEfiTimerArchProtocolGuid'
- '6441f818-6362-4e44-b570-7dba31dd2453', # 'gEfiVariableWriteArchProtocolGuid'
- '1e5668e2-8481-11d4-bcf1-0080c73c8881', # 'gEfiVariableArchProtocolGuid'
- '665e3ff5-46cc-11d4-9a38-0090273fc14d' # 'gEfiWatchdogTimerArchProtocolGuid'
- ]
- )
-
- OpcodePriority = {
- "AND" : 1,
- "OR" : 1,
- "NOT" : 2,
- # "SOR" : 9,
- # "BEFORE": 9,
- # "AFTER" : 9,
- }
-
- Opcode = {
- "PEI" : {
- "PUSH" : 0x02,
- "AND" : 0x03,
- "OR" : 0x04,
- "NOT" : 0x05,
- "TRUE" : 0x06,
- "FALSE" : 0x07,
- "END" : 0x08
- },
-
- "DXE" : {
- "BEFORE": 0x00,
- "AFTER" : 0x01,
- "PUSH" : 0x02,
- "AND" : 0x03,
- "OR" : 0x04,
- "NOT" : 0x05,
- "TRUE" : 0x06,
- "FALSE" : 0x07,
- "END" : 0x08,
- "SOR" : 0x09
- }
- }
-
- # all supported op codes and operands
- SupportedOpcode = ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", "END", "SOR"]
- SupportedOperand = ["TRUE", "FALSE"]
-
- OpcodeWithSingleOperand = ['NOT', 'BEFORE', 'AFTER']
- OpcodeWithTwoOperand = ['AND', 'OR']
-
- # op code that should not be the last one
- NonEndingOpcode = ["AND", "OR", "NOT", 'SOR']
- # op code must not present at the same time
- ExclusiveOpcode = ["BEFORE", "AFTER"]
- # op code that should be the first one if it presents
- AboveAllOpcode = ["SOR", "BEFORE", "AFTER"]
-
- #
- # open and close brace must be taken as individual tokens
- #
- TokenPattern = re.compile("(\(|\)|\{[^{}]+\{?[^{}]+\}?[ ]*\}|\w+)")
-
- ## Constructor
- #
- # @param Expression The list or string of dependency expression
- # @param ModuleType The type of the module using the dependency expression
- #
- def __init__(self, Expression, ModuleType, Optimize=False):
- self.ModuleType = ModuleType
- self.Phase = gType2Phase[ModuleType]
- if type(Expression) == type([]):
- self.ExpressionString = " ".join(Expression)
- self.TokenList = Expression
- else:
- self.ExpressionString = Expression
- self.GetExpressionTokenList()
-
- self.PostfixNotation = []
- self.OpcodeList = []
-
- self.GetPostfixNotation()
- self.ValidateOpcode()
-
- EdkLogger.debug(EdkLogger.DEBUG_8, repr(self))
- if Optimize:
- self.Optimize()
- EdkLogger.debug(EdkLogger.DEBUG_8, "\n Optimized: " + repr(self))
-
- def __str__(self):
- return " ".join(self.TokenList)
-
- def __repr__(self):
- WellForm = ''
- for Token in self.PostfixNotation:
- if Token in self.SupportedOpcode:
- WellForm += "\n " + Token
- else:
- WellForm += ' ' + Token
- return WellForm
-
- ## Split the expression string into token list
- def GetExpressionTokenList(self):
- self.TokenList = self.TokenPattern.findall(self.ExpressionString)
-
- ## Convert token list into postfix notation
- def GetPostfixNotation(self):
- Stack = []
- LastToken = ''
- for Token in self.TokenList:
- if Token == "(":
- if LastToken not in self.SupportedOpcode + ['(', '', None]:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid dependency expression: missing operator before open parentheses",
- ExtraData="Near %s" % LastToken)
- Stack.append(Token)
- elif Token == ")":
- if '(' not in Stack:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid dependency expression: mismatched parentheses",
- ExtraData=str(self))
- elif LastToken in self.SupportedOpcode + ['', None]:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid dependency expression: missing operand before close parentheses",
- ExtraData="Near %s" % LastToken)
- while len(Stack) > 0:
- if Stack[-1] == '(':
- Stack.pop()
- break
- self.PostfixNotation.append(Stack.pop())
- elif Token in self.OpcodePriority:
- if Token == "NOT":
- if LastToken not in self.SupportedOpcode + ['(', '', None]:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid dependency expression: missing operator before NOT",
- ExtraData="Near %s" % LastToken)
- elif LastToken in self.SupportedOpcode + ['(', '', None]:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid dependency expression: missing operand before " + Token,
- ExtraData="Near %s" % LastToken)
-
- while len(Stack) > 0:
- if Stack[-1] == "(" or self.OpcodePriority[Token] >= self.OpcodePriority[Stack[-1]]:
- break
- self.PostfixNotation.append(Stack.pop())
- Stack.append(Token)
- self.OpcodeList.append(Token)
- else:
- if Token not in self.SupportedOpcode:
- # not OP, take it as GUID
- if LastToken not in self.SupportedOpcode + ['(', '', None]:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid dependency expression: missing operator before %s" % Token,
- ExtraData="Near %s" % LastToken)
- if len(self.OpcodeList) == 0 or self.OpcodeList[-1] not in self.ExclusiveOpcode:
- if Token not in self.SupportedOperand:
- self.PostfixNotation.append("PUSH")
- # check if OP is valid in this phase
- elif Token in self.Opcode[self.Phase]:
- if Token == "END":
- break
- self.OpcodeList.append(Token)
- else:
- EdkLogger.error("GenDepex", PARSER_ERROR,
- "Opcode=%s doesn't supported in %s stage " % (Token, self.Phase),
- ExtraData=str(self))
- self.PostfixNotation.append(Token)
- LastToken = Token
-
- # there should not be parentheses in Stack
- if '(' in Stack or ')' in Stack:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid dependency expression: mismatched parentheses",
- ExtraData=str(self))
- while len(Stack) > 0:
- self.PostfixNotation.append(Stack.pop())
- if self.PostfixNotation[-1] != 'END':
- self.PostfixNotation.append("END")
-
- ## Validate the dependency expression
- def ValidateOpcode(self):
- for Op in self.AboveAllOpcode:
- if Op in self.PostfixNotation:
- if Op != self.PostfixNotation[0]:
- EdkLogger.error("GenDepex", PARSER_ERROR, "%s should be the first opcode in the expression" % Op,
- ExtraData=str(self))
- if len(self.PostfixNotation) < 3:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Missing operand for %s" % Op,
- ExtraData=str(self))
- for Op in self.ExclusiveOpcode:
- if Op in self.OpcodeList:
- if len(self.OpcodeList) > 1:
- EdkLogger.error("GenDepex", PARSER_ERROR, "%s should be the only opcode in the expression" % Op,
- ExtraData=str(self))
- if len(self.PostfixNotation) < 3:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Missing operand for %s" % Op,
- ExtraData=str(self))
- if self.TokenList[-1] != 'END' and self.TokenList[-1] in self.NonEndingOpcode:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Extra %s at the end of the dependency expression" % self.TokenList[-1],
- ExtraData=str(self))
- if self.TokenList[-1] == 'END' and self.TokenList[-2] in self.NonEndingOpcode:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Extra %s at the end of the dependency expression" % self.TokenList[-2],
- ExtraData=str(self))
- if "END" in self.TokenList and "END" != self.TokenList[-1]:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Extra expressions after END",
- ExtraData=str(self))
-
- ## Simply optimize the dependency expression by removing duplicated operands
- def Optimize(self):
- ValidOpcode = list(set(self.OpcodeList))
- if len(ValidOpcode) != 1 or ValidOpcode[0] not in ['AND', 'OR']:
- return
- Op = ValidOpcode[0]
- NewOperand = []
- AllOperand = set()
- for Token in self.PostfixNotation:
- if Token in self.SupportedOpcode or Token in NewOperand:
- continue
- AllOperand.add(Token)
- if Token == 'TRUE':
- if Op == 'AND':
- continue
- else:
- NewOperand.append(Token)
- break
- elif Token == 'FALSE':
- if Op == 'OR':
- continue
- else:
- NewOperand.append(Token)
- break
- NewOperand.append(Token)
-
- # don't generate depex if only TRUE operand left
- if self.ModuleType == 'PEIM' and len(NewOperand) == 1 and NewOperand[0] == 'TRUE':
- self.PostfixNotation = []
- return
-
- # don't generate depex if all operands are architecture protocols
- if self.ModuleType in ['UEFI_DRIVER', 'DXE_DRIVER', 'DXE_RUNTIME_DRIVER', 'DXE_SAL_DRIVER', 'DXE_SMM_DRIVER'] and \
- Op == 'AND' and \
- self.ArchProtocols == set([GuidStructureStringToGuidString(Guid) for Guid in AllOperand]):
- self.PostfixNotation = []
- return
-
- if len(NewOperand) == 0:
- self.TokenList = list(AllOperand)
- else:
- self.TokenList = []
- while True:
- self.TokenList.append(NewOperand.pop(0))
- if NewOperand == []:
- break
- self.TokenList.append(Op)
- self.PostfixNotation = []
- self.GetPostfixNotation()
-
-
- ## Convert a GUID value in C structure format into its binary form
- #
- # @param Guid The GUID value in C structure format
- #
- # @retval array The byte array representing the GUID value
- #
- def GetGuidValue(self, Guid):
- GuidValueString = Guid.replace("{", "").replace("}", "").replace(" ", "")
- GuidValueList = GuidValueString.split(",")
- if len(GuidValueList) != 11:
- EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid GUID value string or opcode: %s" % Guid)
- return pack("1I2H8B", *(int(value, 16) for value in GuidValueList))
-
- ## Save the binary form of dependency expression in file
- #
- # @param File The path of file. If None is given, put the data on console
- #
- # @retval True If the file doesn't exist or file is changed
- # @retval False If file exists and is not changed.
- #
- def Generate(self, File=None):
- Buffer = StringIO()
- if len(self.PostfixNotation) == 0:
- return False
-
- for Item in self.PostfixNotation:
- if Item in self.Opcode[self.Phase]:
- Buffer.write(pack("B", self.Opcode[self.Phase][Item]))
- elif Item in self.SupportedOpcode:
- EdkLogger.error("GenDepex", FORMAT_INVALID,
- "Opcode [%s] is not expected in %s phase" % (Item, self.Phase),
- ExtraData=self.ExpressionString)
- else:
- Buffer.write(self.GetGuidValue(Item))
-
- FilePath = ""
- FileChangeFlag = True
- if File == None:
- sys.stdout.write(Buffer.getvalue())
- FilePath = "STDOUT"
- else:
- FileChangeFlag = SaveFileOnChange(File, Buffer.getvalue(), True)
-
- Buffer.close()
- return FileChangeFlag
-
-versionNumber = ("0.04" + " " + gBUILD_VERSION)
-__version__ = "%prog Version " + versionNumber
-__copyright__ = "Copyright (c) 2007-2010, Intel Corporation All rights reserved."
-__usage__ = "%prog [options] [dependency_expression_file]"
-
-## Parse command line options
-#
-# @retval OptionParser
-#
-def GetOptions():
- from optparse import OptionParser
-
- Parser = OptionParser(description=__copyright__, version=__version__, usage=__usage__)
-
- Parser.add_option("-o", "--output", dest="OutputFile", default=None, metavar="FILE",
- help="Specify the name of depex file to be generated")
- Parser.add_option("-t", "--module-type", dest="ModuleType", default=None,
- help="The type of module for which the dependency expression serves")
- Parser.add_option("-e", "--dependency-expression", dest="Expression", default="",
- help="The string of dependency expression. If this option presents, the input file will be ignored.")
- Parser.add_option("-m", "--optimize", dest="Optimize", default=False, action="store_true",
- help="Do some simple optimization on the expression.")
- Parser.add_option("-v", "--verbose", dest="verbose", default=False, action="store_true",
- help="build with verbose information")
- Parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.")
- Parser.add_option("-q", "--quiet", dest="quiet", default=False, action="store_true",
- help="build with little information")
-
- return Parser.parse_args()
-
-
-## Entrance method
-#
-# @retval 0 Tool was successful
-# @retval 1 Tool failed
-#
-def Main():
- EdkLogger.Initialize()
- Option, Input = GetOptions()
-
- # Set log level
- if Option.quiet:
- EdkLogger.SetLevel(EdkLogger.QUIET)
- elif Option.verbose:
- EdkLogger.SetLevel(EdkLogger.VERBOSE)
- elif Option.debug != None:
- EdkLogger.SetLevel(Option.debug + 1)
- else:
- EdkLogger.SetLevel(EdkLogger.INFO)
-
- try:
- if Option.ModuleType == None or Option.ModuleType not in gType2Phase:
- EdkLogger.error("GenDepex", OPTION_MISSING, "Module type is not specified or supported")
-
- DxsFile = ''
- if len(Input) > 0 and Option.Expression == "":
- DxsFile = Input[0]
- DxsString = open(DxsFile, 'r').read().replace("\n", " ").replace("\r", " ")
- DxsString = gStartClosePattern.sub("\\1", DxsString)
- elif Option.Expression != "":
- if Option.Expression[0] == '"':
- DxsString = Option.Expression[1:-1]
- else:
- DxsString = Option.Expression
- else:
- EdkLogger.error("GenDepex", OPTION_MISSING, "No expression string or file given")
-
- Dpx = DependencyExpression(DxsString, Option.ModuleType, Option.Optimize)
- if Option.OutputFile != None:
- FileChangeFlag = Dpx.Generate(Option.OutputFile)
- if not FileChangeFlag and DxsFile:
- #
- # Touch the output file if its time stamp is older than the original
- # DXS file to avoid re-invoke this tool for the dependency check in build rule.
- #
- if os.stat(DxsFile)[8] > os.stat(Option.OutputFile)[8]:
- os.utime(Option.OutputFile, None)
- else:
- Dpx.Generate()
- except BaseException, X:
- EdkLogger.quiet("")
- if Option != None and Option.debug != None:
- EdkLogger.quiet(traceback.format_exc())
- else:
- EdkLogger.quiet(str(X))
- return 1
-
- return 0
-
-if __name__ == '__main__':
- sys.exit(Main())
-
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
deleted file mode 100644
index b2ebff324d..0000000000
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ /dev/null
@@ -1,1411 +0,0 @@
-## @file
-# Create makefile for MS nmake and GNU make
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-## Import Modules
-#
-import os
-import sys
-import string
-import re
-import os.path as path
-
-from Common.BuildToolError import *
-from Common.Misc import *
-from Common.String import *
-from BuildEngine import *
-import Common.GlobalData as GlobalData
-
-## Regular expression for finding header file inclusions
-gIncludePattern = re.compile(r"^[ \t]*#?[ \t]*include(?:[ \t]*(?:\\(?:\r\n|\r|\n))*[ \t]*)*(?:\(?[\"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ \t]*[\">]?\)?)", re.MULTILINE|re.UNICODE|re.IGNORECASE)
-
-## Regular expression for matching macro used in header file inclusion
-gMacroPattern = re.compile("([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", re.UNICODE)
-
-gIsFileMap = {}
-
-## pattern for include style in Edk.x code
-gProtocolDefinition = "Protocol/%(HeaderKey)s/%(HeaderKey)s.h"
-gGuidDefinition = "Guid/%(HeaderKey)s/%(HeaderKey)s.h"
-gArchProtocolDefinition = "ArchProtocol/%(HeaderKey)s/%(HeaderKey)s.h"
-gPpiDefinition = "Ppi/%(HeaderKey)s/%(HeaderKey)s.h"
-gIncludeMacroConversion = {
- "EFI_PROTOCOL_DEFINITION" : gProtocolDefinition,
- "EFI_GUID_DEFINITION" : gGuidDefinition,
- "EFI_ARCH_PROTOCOL_DEFINITION" : gArchProtocolDefinition,
- "EFI_PROTOCOL_PRODUCER" : gProtocolDefinition,
- "EFI_PROTOCOL_CONSUMER" : gProtocolDefinition,
- "EFI_PROTOCOL_DEPENDENCY" : gProtocolDefinition,
- "EFI_ARCH_PROTOCOL_PRODUCER" : gArchProtocolDefinition,
- "EFI_ARCH_PROTOCOL_CONSUMER" : gArchProtocolDefinition,
- "EFI_ARCH_PROTOCOL_DEPENDENCY" : gArchProtocolDefinition,
- "EFI_PPI_DEFINITION" : gPpiDefinition,
- "EFI_PPI_PRODUCER" : gPpiDefinition,
- "EFI_PPI_CONSUMER" : gPpiDefinition,
- "EFI_PPI_DEPENDENCY" : gPpiDefinition,
-}
-
-## default makefile type
-gMakeType = ""
-if sys.platform == "win32":
- gMakeType = "nmake"
-else:
- gMakeType = "gmake"
-
-
-## BuildFile class
-#
-# This base class encapsules build file and its generation. It uses template to generate
-# the content of build file. The content of build file will be got from AutoGen objects.
-#
-class BuildFile(object):
- ## template used to generate the build file (i.e. makefile if using make)
- _TEMPLATE_ = TemplateString('')
-
- _DEFAULT_FILE_NAME_ = "Makefile"
-
- ## default file name for each type of build file
- _FILE_NAME_ = {
- "nmake" : "Makefile",
- "gmake" : "GNUmakefile"
- }
-
- ## Fixed header string for makefile
- _MAKEFILE_HEADER = '''#
-# DO NOT EDIT
-# This file is auto-generated by build utility
-#
-# Module Name:
-#
-# %s
-#
-# Abstract:
-#
-# Auto-generated makefile for building modules, libraries or platform
-#
- '''
-
- ## Header string for each type of build file
- _FILE_HEADER_ = {
- "nmake" : _MAKEFILE_HEADER % _FILE_NAME_["nmake"],
- "gmake" : _MAKEFILE_HEADER % _FILE_NAME_["gmake"]
- }
-
- ## shell commands which can be used in build file in the form of macro
- # $(CP) copy file command
- # $(MV) move file command
- # $(RM) remove file command
- # $(MD) create dir command
- # $(RD) remove dir command
- #
- _SHELL_CMD_ = {
- "nmake" : {
- "CP" : "copy /y",
- "MV" : "move /y",
- "RM" : "del /f /q",
- "MD" : "mkdir",
- "RD" : "rmdir /s /q",
- },
-
- "gmake" : {
- "CP" : "cp -f",
- "MV" : "mv -f",
- "RM" : "rm -f",
- "MD" : "mkdir -p",
- "RD" : "rm -r -f",
- }
- }
-
- ## directory separator
- _SEP_ = {
- "nmake" : "\\",
- "gmake" : "/"
- }
-
- ## directory creation template
- _MD_TEMPLATE_ = {
- "nmake" : 'if not exist %(dir)s $(MD) %(dir)s',
- "gmake" : "$(MD) %(dir)s"
- }
-
- ## directory removal template
- _RD_TEMPLATE_ = {
- "nmake" : 'if exist %(dir)s $(RD) %(dir)s',
- "gmake" : "$(RD) %(dir)s"
- }
-
- _CD_TEMPLATE_ = {
- "nmake" : 'if exist %(dir)s cd %(dir)s',
- "gmake" : "test -e %(dir)s && cd %(dir)s"
- }
-
- _MAKE_TEMPLATE_ = {
- "nmake" : 'if exist %(file)s "$(MAKE)" $(MAKE_FLAGS) -f %(file)s',
- "gmake" : 'test -e %(file)s && "$(MAKE)" $(MAKE_FLAGS) -f %(file)s'
- }
-
- _INCLUDE_CMD_ = {
- "nmake" : '!INCLUDE',
- "gmake" : "include"
- }
-
- _INC_FLAG_ = {"MSFT" : "/I", "GCC" : "-I", "INTEL" : "-I", "RVCT" : "-I"}
-
- ## Constructor of BuildFile
- #
- # @param AutoGenObject Object of AutoGen class
- #
- def __init__(self, AutoGenObject):
- self._AutoGenObject = AutoGenObject
- self._FileType = gMakeType
-
- ## Create build file
- #
- # @param FileType Type of build file. Only nmake and gmake are supported now.
- #
- # @retval TRUE The build file is created or re-created successfully
- # @retval FALSE The build file exists and is the same as the one to be generated
- #
- def Generate(self, FileType=gMakeType):
- if FileType not in self._FILE_NAME_:
- EdkLogger.error("build", PARAMETER_INVALID, "Invalid build type [%s]" % FileType,
- ExtraData="[%s]" % str(self._AutoGenObject))
- self._FileType = FileType
- FileContent = self._TEMPLATE_.Replace(self._TemplateDict)
- FileName = self._FILE_NAME_[FileType]
- return SaveFileOnChange(os.path.join(self._AutoGenObject.MakeFileDir, FileName), FileContent, False)
-
- ## Return a list of directory creation command string
- #
- # @param DirList The list of directory to be created
- #
- # @retval list The directory creation command list
- #
- def GetCreateDirectoryCommand(self, DirList):
- return [self._MD_TEMPLATE_[self._FileType] % {'dir':Dir} for Dir in DirList]
-
- ## Return a list of directory removal command string
- #
- # @param DirList The list of directory to be removed
- #
- # @retval list The directory removal command list
- #
- def GetRemoveDirectoryCommand(self, DirList):
- return [self._RD_TEMPLATE_[self._FileType] % {'dir':Dir} for Dir in DirList]
-
- def PlaceMacro(self, Path, MacroDefinitions={}):
- if Path.startswith("$("):
- return Path
- else:
- PathLength = len(Path)
- for MacroName in MacroDefinitions:
- MacroValue = MacroDefinitions[MacroName]
- MacroValueLength = len(MacroValue)
- if MacroValueLength <= PathLength and Path.startswith(MacroValue):
- Path = "$(%s)%s" % (MacroName, Path[MacroValueLength:])
- break
- return Path
-
-## ModuleMakefile class
-#
-# This class encapsules makefie and its generation for module. It uses template to generate
-# the content of makefile. The content of makefile will be got from ModuleAutoGen object.
-#
-class ModuleMakefile(BuildFile):
- ## template used to generate the makefile for module
- _TEMPLATE_ = TemplateString('''\
-${makefile_header}
-
-#
-# Platform Macro Definition
-#
-PLATFORM_NAME = ${platform_name}
-PLATFORM_GUID = ${platform_guid}
-PLATFORM_VERSION = ${platform_version}
-PLATFORM_RELATIVE_DIR = ${platform_relative_directory}
-PLATFORM_DIR = $(WORKSPACE)${separator}${platform_relative_directory}
-PLATFORM_OUTPUT_DIR = ${platform_output_directory}
-
-#
-# Module Macro Definition
-#
-MODULE_NAME = ${module_name}
-MODULE_GUID = ${module_guid}
-MODULE_VERSION = ${module_version}
-MODULE_TYPE = ${module_type}
-MODULE_FILE = ${module_file}
-MODULE_FILE_BASE_NAME = ${module_file_base_name}
-BASE_NAME = $(MODULE_NAME)
-MODULE_RELATIVE_DIR = ${module_relative_directory}
-MODULE_DIR = $(WORKSPACE)${separator}${module_relative_directory}
-
-MODULE_ENTRY_POINT = ${module_entry_point}
-ARCH_ENTRY_POINT = ${arch_entry_point}
-IMAGE_ENTRY_POINT = ${image_entry_point}
-
-${BEGIN}${module_extra_defines}
-${END}
-#
-# Build Configuration Macro Definition
-#
-ARCH = ${architecture}
-TOOLCHAIN = ${toolchain_tag}
-TOOLCHAIN_TAG = ${toolchain_tag}
-TARGET = ${build_target}
-
-#
-# Build Directory Macro Definition
-#
-# PLATFORM_BUILD_DIR = ${platform_build_directory}
-BUILD_DIR = ${platform_build_directory}
-BIN_DIR = $(BUILD_DIR)${separator}${architecture}
-LIB_DIR = $(BIN_DIR)
-MODULE_BUILD_DIR = ${module_build_directory}
-OUTPUT_DIR = ${module_output_directory}
-DEBUG_DIR = ${module_debug_directory}
-DEST_DIR_OUTPUT = $(OUTPUT_DIR)
-DEST_DIR_DEBUG = $(DEBUG_DIR)
-
-#
-# Shell Command Macro
-#
-${BEGIN}${shell_command_code} = ${shell_command}
-${END}
-
-#
-# Tools definitions specific to this module
-#
-${BEGIN}${module_tool_definitions}
-${END}
-MAKE_FILE = ${makefile_path}
-
-#
-# Build Macro
-#
-${BEGIN}${file_macro}
-${END}
-
-COMMON_DEPS = ${BEGIN}${common_dependency_file} \\
- ${END}
-
-#
-# Overridable Target Macro Definitions
-#
-FORCE_REBUILD = force_build
-INIT_TARGET = init
-PCH_TARGET =
-BC_TARGET = ${BEGIN}${backward_compatible_target} ${END}
-CODA_TARGET = ${BEGIN}${remaining_build_target} \\
- ${END}
-
-#
-# Default target, which will build dependent libraries in addition to source files
-#
-
-all: mbuild
-
-
-#
-# Target used when called from platform makefile, which will bypass the build of dependent libraries
-#
-
-pbuild: $(INIT_TARGET) $(BC_TARGET) $(PCH_TARGET) $(CODA_TARGET)
-
-#
-# ModuleTarget
-#
-
-mbuild: $(INIT_TARGET) $(BC_TARGET) gen_libs $(PCH_TARGET) $(CODA_TARGET)
-
-#
-# Build Target used in multi-thread build mode, which will bypass the init and gen_libs targets
-#
-
-tbuild: $(BC_TARGET) $(PCH_TARGET) $(CODA_TARGET)
-
-#
-# Phony target which is used to force executing commands for a target
-#
-force_build:
-\t-@
-
-#
-# Target to update the FD
-#
-
-fds: mbuild gen_fds
-
-#
-# Initialization target: print build information and create necessary directories
-#
-init: info dirs
-
-info:
-\t-@echo Building ... $(MODULE_DIR)${separator}$(MODULE_FILE) [$(ARCH)]
-
-dirs:
-${BEGIN}\t-@${create_directory_command}\n${END}
-
-strdefs:
-\t-@$(CP) $(DEBUG_DIR)${separator}AutoGen.h $(DEBUG_DIR)${separator}$(MODULE_NAME)StrDefs.h
-
-#
-# GenLibsTarget
-#
-gen_libs:
-\t${BEGIN}@"$(MAKE)" $(MAKE_FLAGS) -f ${dependent_library_build_directory}${separator}${makefile_name}
-\t${END}@cd $(MODULE_BUILD_DIR)
-
-#
-# Build Flash Device Image
-#
-gen_fds:
-\t@"$(MAKE)" $(MAKE_FLAGS) -f $(BUILD_DIR)${separator}${makefile_name} fds
-\t@cd $(MODULE_BUILD_DIR)
-
-#
-# Individual Object Build Targets
-#
-${BEGIN}${file_build_target}
-${END}
-
-#
-# clean all intermediate files
-#
-clean:
-\t${BEGIN}${clean_command}
-\t${END}
-
-#
-# clean all generated files
-#
-cleanall:
-${BEGIN}\t${cleanall_command}
-${END}\t$(RM) *.pdb *.idb > NUL 2>&1
-\t$(RM) $(BIN_DIR)${separator}$(MODULE_NAME).efi
-
-#
-# clean all dependent libraries built
-#
-cleanlib:
-\t${BEGIN}-@${library_build_command} cleanall
-\t${END}@cd $(MODULE_BUILD_DIR)\n\n''')
-
- _FILE_MACRO_TEMPLATE = TemplateString("${macro_name} = ${BEGIN} \\\n ${source_file}${END}\n")
- _BUILD_TARGET_TEMPLATE = TemplateString("${BEGIN}${target} : ${deps}\n${END}\t${cmd}\n")
-
- ## Constructor of ModuleMakefile
- #
- # @param ModuleAutoGen Object of ModuleAutoGen class
- #
- def __init__(self, ModuleAutoGen):
- BuildFile.__init__(self, ModuleAutoGen)
- self.PlatformInfo = self._AutoGenObject.PlatformInfo
-
- self.ResultFileList = []
- self.IntermediateDirectoryList = ["$(DEBUG_DIR)", "$(OUTPUT_DIR)"]
-
- self.SourceFileDatabase = {} # {file type : file path}
- self.DestFileDatabase = {} # {file type : file path}
- self.FileBuildTargetList = [] # [(src, target string)]
- self.BuildTargetList = [] # [target string]
- self.PendingBuildTargetList = [] # [FileBuildRule objects]
- self.CommonFileDependency = []
- self.FileListMacros = {}
- self.ListFileMacros = {}
-
- self.FileCache = {}
- self.FileDependency = []
- self.LibraryBuildCommandList = []
- self.LibraryFileList = []
- self.LibraryMakefileList = []
- self.LibraryBuildDirectoryList = []
- self.SystemLibraryList = []
- self.Macros = sdict()
- self.Macros["OUTPUT_DIR" ] = self._AutoGenObject.Macros["OUTPUT_DIR"]
- self.Macros["DEBUG_DIR" ] = self._AutoGenObject.Macros["DEBUG_DIR"]
- self.Macros["MODULE_BUILD_DIR"] = self._AutoGenObject.Macros["MODULE_BUILD_DIR"]
- self.Macros["BIN_DIR" ] = self._AutoGenObject.Macros["BIN_DIR"]
- self.Macros["BUILD_DIR" ] = self._AutoGenObject.Macros["BUILD_DIR"]
- self.Macros["WORKSPACE" ] = self._AutoGenObject.Macros["WORKSPACE"]
-
- # Compose a dict object containing information used to do replacement in template
- def _CreateTemplateDict(self):
- if self._FileType not in self._SEP_:
- EdkLogger.error("build", PARAMETER_INVALID, "Invalid Makefile type [%s]" % self._FileType,
- ExtraData="[%s]" % str(self._AutoGenObject))
- Separator = self._SEP_[self._FileType]
-
- # break build if no source files and binary files are found
- if len(self._AutoGenObject.SourceFileList) == 0 and len(self._AutoGenObject.BinaryFileList) == 0:
- EdkLogger.error("build", AUTOGEN_ERROR, "No files to be built in module [%s, %s, %s]"
- % (self._AutoGenObject.BuildTarget, self._AutoGenObject.ToolChain, self._AutoGenObject.Arch),
- ExtraData="[%s]" % str(self._AutoGenObject))
-
- # convert dependent libraries to build command
- self.ProcessDependentLibrary()
- if len(self._AutoGenObject.Module.ModuleEntryPointList) > 0:
- ModuleEntryPoint = self._AutoGenObject.Module.ModuleEntryPointList[0]
- else:
- ModuleEntryPoint = "_ModuleEntryPoint"
-
- # Intel EBC compiler enforces EfiMain
- if self._AutoGenObject.AutoGenVersion < 0x00010005 and self._AutoGenObject.Arch == "EBC":
- ArchEntryPoint = "EfiMain"
- else:
- ArchEntryPoint = ModuleEntryPoint
-
- if self._AutoGenObject.Arch == "EBC":
- # EBC compiler always use "EfiStart" as entry point. Only applies to EdkII modules
- ImageEntryPoint = "EfiStart"
- elif self._AutoGenObject.AutoGenVersion < 0x00010005:
- # Edk modules use entry point specified in INF file
- ImageEntryPoint = ModuleEntryPoint
- else:
- # EdkII modules always use "_ModuleEntryPoint" as entry point
- ImageEntryPoint = "_ModuleEntryPoint"
-
- # tools definitions
- ToolsDef = []
- IncPrefix = self._INC_FLAG_[self._AutoGenObject.ToolChainFamily]
- for Tool in self._AutoGenObject.BuildOption:
- for Attr in self._AutoGenObject.BuildOption[Tool]:
- Value = self._AutoGenObject.BuildOption[Tool][Attr]
- if Attr == "FAMILY":
- continue
- elif Attr == "PATH":
- ToolsDef.append("%s = %s" % (Tool, Value))
- else:
- # Don't generate MAKE_FLAGS in makefile. It's put in environment variable.
- if Tool == "MAKE":
- continue
- # Remove duplicated include path, if any
- if Attr == "FLAGS":
- Value = RemoveDupOption(Value, IncPrefix, self._AutoGenObject.IncludePathList)
- ToolsDef.append("%s_%s = %s" % (Tool, Attr, Value))
- ToolsDef.append("")
-
- # convert source files and binary files to build targets
- self.ResultFileList = [str(T.Target) for T in self._AutoGenObject.CodaTargetList]
- if len(self.ResultFileList) == 0 and len(self._AutoGenObject.SourceFileList) <> 0:
- EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build",
- ExtraData="[%s]" % str(self._AutoGenObject))
-
- self.ProcessBuildTargetList()
-
- # Generate macros used to represent input files
- FileMacroList = [] # macro name = file list
- for FileListMacro in self.FileListMacros:
- FileMacro = self._FILE_MACRO_TEMPLATE.Replace(
- {
- "macro_name" : FileListMacro,
- "source_file" : self.FileListMacros[FileListMacro]
- }
- )
- FileMacroList.append(FileMacro)
-
- # INC_LIST is special
- FileMacro = ""
- IncludePathList = []
- for P in self._AutoGenObject.IncludePathList:
- IncludePathList.append(IncPrefix+self.PlaceMacro(P, self.Macros))
- if FileBuildRule.INC_LIST_MACRO in self.ListFileMacros:
- self.ListFileMacros[FileBuildRule.INC_LIST_MACRO].append(IncPrefix+P)
- FileMacro += self._FILE_MACRO_TEMPLATE.Replace(
- {
- "macro_name" : "INC",
- "source_file" : IncludePathList
- }
- )
- FileMacroList.append(FileMacro)
-
- # Generate macros used to represent files containing list of input files
- for ListFileMacro in self.ListFileMacros:
- ListFileName = os.path.join(self._AutoGenObject.OutputDir, "%s.lst" % ListFileMacro.lower()[:len(ListFileMacro)-5])
- FileMacroList.append("%s = %s" % (ListFileMacro, ListFileName))
- SaveFileOnChange(
- ListFileName,
- "\n".join(self.ListFileMacros[ListFileMacro]),
- False
- )
-
- # Edk modules need <BaseName>StrDefs.h for string ID
- #if self._AutoGenObject.AutoGenVersion < 0x00010005 and len(self._AutoGenObject.UnicodeFileList) > 0:
- # BcTargetList = ['strdefs']
- #else:
- # BcTargetList = []
- BcTargetList = []
-
- MakefileName = self._FILE_NAME_[self._FileType]
- LibraryMakeCommandList = []
- for D in self.LibraryBuildDirectoryList:
- Command = self._MAKE_TEMPLATE_[self._FileType] % {"file":os.path.join(D, MakefileName)}
- LibraryMakeCommandList.append(Command)
-
- MakefileTemplateDict = {
- "makefile_header" : self._FILE_HEADER_[self._FileType],
- "makefile_path" : os.path.join("$(MODULE_BUILD_DIR)", MakefileName),
- "makefile_name" : MakefileName,
- "platform_name" : self.PlatformInfo.Name,
- "platform_guid" : self.PlatformInfo.Guid,
- "platform_version" : self.PlatformInfo.Version,
- "platform_relative_directory": self.PlatformInfo.SourceDir,
- "platform_output_directory" : self.PlatformInfo.OutputDir,
-
- "module_name" : self._AutoGenObject.Name,
- "module_guid" : self._AutoGenObject.Guid,
- "module_version" : self._AutoGenObject.Version,
- "module_type" : self._AutoGenObject.ModuleType,
- "module_file" : self._AutoGenObject.MetaFile.Name,
- "module_file_base_name" : self._AutoGenObject.MetaFile.BaseName,
- "module_relative_directory" : self._AutoGenObject.SourceDir,
- "module_extra_defines" : ["%s = %s" % (k, v) for k,v in self._AutoGenObject.Module.Defines.iteritems()],
-
- "architecture" : self._AutoGenObject.Arch,
- "toolchain_tag" : self._AutoGenObject.ToolChain,
- "build_target" : self._AutoGenObject.BuildTarget,
-
- "platform_build_directory" : self.PlatformInfo.BuildDir,
- "module_build_directory" : self._AutoGenObject.BuildDir,
- "module_output_directory" : self._AutoGenObject.OutputDir,
- "module_debug_directory" : self._AutoGenObject.DebugDir,
-
- "separator" : Separator,
- "module_tool_definitions" : ToolsDef,
-
- "shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),
- "shell_command" : self._SHELL_CMD_[self._FileType].values(),
-
- "module_entry_point" : ModuleEntryPoint,
- "image_entry_point" : ImageEntryPoint,
- "arch_entry_point" : ArchEntryPoint,
- "remaining_build_target" : self.ResultFileList,
- "common_dependency_file" : self.CommonFileDependency,
- "create_directory_command" : self.GetCreateDirectoryCommand(self.IntermediateDirectoryList),
- "clean_command" : self.GetRemoveDirectoryCommand(["$(OUTPUT_DIR)"]),
- "cleanall_command" : self.GetRemoveDirectoryCommand(["$(DEBUG_DIR)", "$(OUTPUT_DIR)"]),
- "dependent_library_build_directory" : self.LibraryBuildDirectoryList,
- "library_build_command" : LibraryMakeCommandList,
- "file_macro" : FileMacroList,
- "file_build_target" : self.BuildTargetList,
- "backward_compatible_target": BcTargetList,
- }
-
- return MakefileTemplateDict
-
- def ProcessBuildTargetList(self):
- #
- # Search dependency file list for each source file
- #
- ForceIncludedFile = []
- for File in self._AutoGenObject.AutoGenFileList:
- if File.Ext == '.h':
- ForceIncludedFile.append(File)
- SourceFileList = []
- for Target in self._AutoGenObject.IntroTargetList:
- SourceFileList.extend(Target.Inputs)
-
- self.FileDependency = self.GetFileDependency(
- SourceFileList,
- ForceIncludedFile,
- self._AutoGenObject.IncludePathList + self._AutoGenObject.BuildOptionIncPathList
- )
- DepSet = None
- for File in self.FileDependency:
- if not self.FileDependency[File]:
- self.FileDependency[File] = ['$(FORCE_REBUILD)']
- continue
- # skip non-C files
- if File.Ext not in [".c", ".C"] or File.Name == "AutoGen.c":
- continue
- elif DepSet == None:
- DepSet = set(self.FileDependency[File])
- else:
- DepSet &= set(self.FileDependency[File])
- # in case nothing in SourceFileList
- if DepSet == None:
- DepSet = set()
- #
- # Extract common files list in the dependency files
- #
- for File in DepSet:
- self.CommonFileDependency.append(self.PlaceMacro(File.Path, self.Macros))
-
- for File in self.FileDependency:
- # skip non-C files
- if File.Ext not in [".c", ".C"] or File.Name == "AutoGen.c":
- continue
- NewDepSet = set(self.FileDependency[File])
- NewDepSet -= DepSet
- self.FileDependency[File] = ["$(COMMON_DEPS)"] + list(NewDepSet)
-
- # Convert target description object to target string in makefile
- for Type in self._AutoGenObject.Targets:
- for T in self._AutoGenObject.Targets[Type]:
- # Generate related macros if needed
- if T.GenFileListMacro and T.FileListMacro not in self.FileListMacros:
- self.FileListMacros[T.FileListMacro] = []
- if T.GenListFile and T.ListFileMacro not in self.ListFileMacros:
- self.ListFileMacros[T.ListFileMacro] = []
- if T.GenIncListFile and T.IncListFileMacro not in self.ListFileMacros:
- self.ListFileMacros[T.IncListFileMacro] = []
-
- Deps = []
- # Add force-dependencies
- for Dep in T.Dependencies:
- Deps.append(self.PlaceMacro(str(Dep), self.Macros))
- # Add inclusion-dependencies
- if len(T.Inputs) == 1 and T.Inputs[0] in self.FileDependency:
- for F in self.FileDependency[T.Inputs[0]]:
- Deps.append(self.PlaceMacro(str(F), self.Macros))
- # Add source-dependencies
- for F in T.Inputs:
- NewFile = self.PlaceMacro(str(F), self.Macros)
- # In order to use file list macro as dependency
- if T.GenListFile:
- self.ListFileMacros[T.ListFileMacro].append(str(F))
- self.FileListMacros[T.FileListMacro].append(NewFile)
- elif T.GenFileListMacro:
- self.FileListMacros[T.FileListMacro].append(NewFile)
- else:
- Deps.append(NewFile)
-
- # Use file list macro as dependency
- if T.GenFileListMacro:
- Deps.append("$(%s)" % T.FileListMacro)
-
- TargetDict = {
- "target" : self.PlaceMacro(T.Target.Path, self.Macros),
- "cmd" : "\n\t".join(T.Commands),
- "deps" : Deps
- }
- self.BuildTargetList.append(self._BUILD_TARGET_TEMPLATE.Replace(TargetDict))
-
- ## For creating makefile targets for dependent libraries
- def ProcessDependentLibrary(self):
- for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
- self.LibraryBuildDirectoryList.append(self.PlaceMacro(LibraryAutoGen.BuildDir, self.Macros))
-
- ## Return a list containing source file's dependencies
- #
- # @param FileList The list of source files
- # @param ForceInculeList The list of files which will be included forcely
- # @param SearchPathList The list of search path
- #
- # @retval dict The mapping between source file path and its dependencies
- #
- def GetFileDependency(self, FileList, ForceInculeList, SearchPathList):
- Dependency = {}
- for F in FileList:
- Dependency[F] = self.GetDependencyList(F, ForceInculeList, SearchPathList)
- return Dependency
-
- ## Find dependencies for one source file
- #
- # By searching recursively "#include" directive in file, find out all the
- # files needed by given source file. The dependecies will be only searched
- # in given search path list.
- #
- # @param File The source file
- # @param ForceInculeList The list of files which will be included forcely
- # @param SearchPathList The list of search path
- #
- # @retval list The list of files the given source file depends on
- #
- def GetDependencyList(self, File, ForceList, SearchPathList):
- EdkLogger.debug(EdkLogger.DEBUG_1, "Try to get dependency files for %s" % File)
- FileStack = [File] + ForceList
- DependencySet = set()
-
- if self._AutoGenObject.Arch not in gDependencyDatabase:
- gDependencyDatabase[self._AutoGenObject.Arch] = {}
- DepDb = gDependencyDatabase[self._AutoGenObject.Arch]
-
- while len(FileStack) > 0:
- F = FileStack.pop()
-
- FullPathDependList = []
- if F in self.FileCache:
- for CacheFile in self.FileCache[F]:
- FullPathDependList.append(CacheFile)
- if CacheFile not in DependencySet:
- FileStack.append(CacheFile)
- DependencySet.update(FullPathDependList)
- continue
-
- CurrentFileDependencyList = []
- if F in DepDb:
- CurrentFileDependencyList = DepDb[F]
- else:
- try:
- Fd = open(F.Path, 'r')
- except BaseException, X:
- EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=F.Path+"\n\t"+str(X))
-
- FileContent = Fd.read()
- Fd.close()
- if len(FileContent) == 0:
- continue
-
- if FileContent[0] == 0xff or FileContent[0] == 0xfe:
- FileContent = unicode(FileContent, "utf-16")
- IncludedFileList = gIncludePattern.findall(FileContent)
-
- for Inc in IncludedFileList:
- Inc = Inc.strip()
- # if there's macro used to reference header file, expand it
- HeaderList = gMacroPattern.findall(Inc)
- if len(HeaderList) == 1 and len(HeaderList[0]) == 2:
- HeaderType = HeaderList[0][0]
- HeaderKey = HeaderList[0][1]
- if HeaderType in gIncludeMacroConversion:
- Inc = gIncludeMacroConversion[HeaderType] % {"HeaderKey" : HeaderKey}
- else:
- # not known macro used in #include, always build the file by
- # returning a empty dependency
- self.FileCache[File] = []
- return []
- Inc = os.path.normpath(Inc)
- CurrentFileDependencyList.append(Inc)
- DepDb[F] = CurrentFileDependencyList
-
- CurrentFilePath = F.Dir
- PathList = [CurrentFilePath] + SearchPathList
- for Inc in CurrentFileDependencyList:
- for SearchPath in PathList:
- FilePath = os.path.join(SearchPath, Inc)
- if FilePath in gIsFileMap:
- if not gIsFileMap[FilePath]:
- continue
- # If isfile is called too many times, the performance is slow down.
- elif not os.path.isfile(FilePath):
- gIsFileMap[FilePath] = False
- continue
- else:
- gIsFileMap[FilePath] = True
- FilePath = PathClass(FilePath)
- FullPathDependList.append(FilePath)
- if FilePath not in DependencySet:
- FileStack.append(FilePath)
- break
- else:
- EdkLogger.debug(EdkLogger.DEBUG_9, "%s included by %s was not found "\
- "in any given path:\n\t%s" % (Inc, F, "\n\t".join(SearchPathList)))
-
- self.FileCache[F] = FullPathDependList
- DependencySet.update(FullPathDependList)
-
- DependencySet.update(ForceList)
- if File in DependencySet:
- DependencySet.remove(File)
- DependencyList = list(DependencySet) # remove duplicate ones
-
- return DependencyList
-
- _TemplateDict = property(_CreateTemplateDict)
-
-## CustomMakefile class
-#
-# This class encapsules makefie and its generation for module. It uses template to generate
-# the content of makefile. The content of makefile will be got from ModuleAutoGen object.
-#
-class CustomMakefile(BuildFile):
- ## template used to generate the makefile for module with custom makefile
- _TEMPLATE_ = TemplateString('''\
-${makefile_header}
-
-#
-# Platform Macro Definition
-#
-PLATFORM_NAME = ${platform_name}
-PLATFORM_GUID = ${platform_guid}
-PLATFORM_VERSION = ${platform_version}
-PLATFORM_RELATIVE_DIR = ${platform_relative_directory}
-PLATFORM_DIR = $(WORKSPACE)${separator}${platform_relative_directory}
-PLATFORM_OUTPUT_DIR = ${platform_output_directory}
-
-#
-# Module Macro Definition
-#
-MODULE_NAME = ${module_name}
-MODULE_GUID = ${module_guid}
-MODULE_VERSION = ${module_version}
-MODULE_TYPE = ${module_type}
-MODULE_FILE = ${module_file}
-MODULE_FILE_BASE_NAME = ${module_file_base_name}
-BASE_NAME = $(MODULE_NAME)
-MODULE_RELATIVE_DIR = ${module_relative_directory}
-MODULE_DIR = $(WORKSPACE)${separator}${module_relative_directory}
-
-#
-# Build Configuration Macro Definition
-#
-ARCH = ${architecture}
-TOOLCHAIN = ${toolchain_tag}
-TOOLCHAIN_TAG = ${toolchain_tag}
-TARGET = ${build_target}
-
-#
-# Build Directory Macro Definition
-#
-# PLATFORM_BUILD_DIR = ${platform_build_directory}
-BUILD_DIR = ${platform_build_directory}
-BIN_DIR = $(BUILD_DIR)${separator}${architecture}
-LIB_DIR = $(BIN_DIR)
-MODULE_BUILD_DIR = ${module_build_directory}
-OUTPUT_DIR = ${module_output_directory}
-DEBUG_DIR = ${module_debug_directory}
-DEST_DIR_OUTPUT = $(OUTPUT_DIR)
-DEST_DIR_DEBUG = $(DEBUG_DIR)
-
-#
-# Tools definitions specific to this module
-#
-${BEGIN}${module_tool_definitions}
-${END}
-MAKE_FILE = ${makefile_path}
-
-#
-# Shell Command Macro
-#
-${BEGIN}${shell_command_code} = ${shell_command}
-${END}
-
-${custom_makefile_content}
-
-#
-# Target used when called from platform makefile, which will bypass the build of dependent libraries
-#
-
-pbuild: init all
-
-
-#
-# ModuleTarget
-#
-
-mbuild: init all
-
-#
-# Build Target used in multi-thread build mode, which no init target is needed
-#
-
-tbuild: all
-
-#
-# Initialization target: print build information and create necessary directories
-#
-init:
-\t-@echo Building ... $(MODULE_DIR)${separator}$(MODULE_FILE) [$(ARCH)]
-${BEGIN}\t-@${create_directory_command}\n${END}\
-
-''')
-
- ## Constructor of CustomMakefile
- #
- # @param ModuleAutoGen Object of ModuleAutoGen class
- #
- def __init__(self, ModuleAutoGen):
- BuildFile.__init__(self, ModuleAutoGen)
- self.PlatformInfo = self._AutoGenObject.PlatformInfo
- self.IntermediateDirectoryList = ["$(DEBUG_DIR)", "$(OUTPUT_DIR)"]
-
- # Compose a dict object containing information used to do replacement in template
- def _CreateTemplateDict(self):
- Separator = self._SEP_[self._FileType]
- if self._FileType not in self._AutoGenObject.CustomMakefile:
- EdkLogger.error('build', OPTION_NOT_SUPPORTED, "No custom makefile for %s" % self._FileType,
- ExtraData="[%s]" % str(self._AutoGenObject))
- MakefilePath = os.path.join(
- self._AutoGenObject.WorkspaceDir,
- self._AutoGenObject.CustomMakefile[self._FileType]
- )
- try:
- CustomMakefile = open(MakefilePath, 'r').read()
- except:
- EdkLogger.error('build', FILE_OPEN_FAILURE, File=str(self._AutoGenObject),
- ExtraData=self._AutoGenObject.CustomMakefile[self._FileType])
-
- # tools definitions
- ToolsDef = []
- for Tool in self._AutoGenObject.BuildOption:
- # Don't generate MAKE_FLAGS in makefile. It's put in environment variable.
- if Tool == "MAKE":
- continue
- for Attr in self._AutoGenObject.BuildOption[Tool]:
- if Attr == "FAMILY":
- continue
- elif Attr == "PATH":
- ToolsDef.append("%s = %s" % (Tool, self._AutoGenObject.BuildOption[Tool][Attr]))
- else:
- ToolsDef.append("%s_%s = %s" % (Tool, Attr, self._AutoGenObject.BuildOption[Tool][Attr]))
- ToolsDef.append("")
-
- MakefileName = self._FILE_NAME_[self._FileType]
- MakefileTemplateDict = {
- "makefile_header" : self._FILE_HEADER_[self._FileType],
- "makefile_path" : os.path.join("$(MODULE_BUILD_DIR)", MakefileName),
- "platform_name" : self.PlatformInfo.Name,
- "platform_guid" : self.PlatformInfo.Guid,
- "platform_version" : self.PlatformInfo.Version,
- "platform_relative_directory": self.PlatformInfo.SourceDir,
- "platform_output_directory" : self.PlatformInfo.OutputDir,
-
- "module_name" : self._AutoGenObject.Name,
- "module_guid" : self._AutoGenObject.Guid,
- "module_version" : self._AutoGenObject.Version,
- "module_type" : self._AutoGenObject.ModuleType,
- "module_file" : self._AutoGenObject.MetaFile,
- "module_file_base_name" : self._AutoGenObject.MetaFile.BaseName,
- "module_relative_directory" : self._AutoGenObject.SourceDir,
-
- "architecture" : self._AutoGenObject.Arch,
- "toolchain_tag" : self._AutoGenObject.ToolChain,
- "build_target" : self._AutoGenObject.BuildTarget,
-
- "platform_build_directory" : self.PlatformInfo.BuildDir,
- "module_build_directory" : self._AutoGenObject.BuildDir,
- "module_output_directory" : self._AutoGenObject.OutputDir,
- "module_debug_directory" : self._AutoGenObject.DebugDir,
-
- "separator" : Separator,
- "module_tool_definitions" : ToolsDef,
-
- "shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),
- "shell_command" : self._SHELL_CMD_[self._FileType].values(),
-
- "create_directory_command" : self.GetCreateDirectoryCommand(self.IntermediateDirectoryList),
- "custom_makefile_content" : CustomMakefile
- }
-
- return MakefileTemplateDict
-
- _TemplateDict = property(_CreateTemplateDict)
-
-## PlatformMakefile class
-#
-# This class encapsules makefie and its generation for platform. It uses
-# template to generate the content of makefile. The content of makefile will be
-# got from PlatformAutoGen object.
-#
-class PlatformMakefile(BuildFile):
- ## template used to generate the makefile for platform
- _TEMPLATE_ = TemplateString('''\
-${makefile_header}
-
-#
-# Platform Macro Definition
-#
-PLATFORM_NAME = ${platform_name}
-PLATFORM_GUID = ${platform_guid}
-PLATFORM_VERSION = ${platform_version}
-PLATFORM_FILE = ${platform_file}
-PLATFORM_DIR = $(WORKSPACE)${separator}${platform_relative_directory}
-PLATFORM_OUTPUT_DIR = ${platform_output_directory}
-
-#
-# Build Configuration Macro Definition
-#
-TOOLCHAIN = ${toolchain_tag}
-TOOLCHAIN_TAG = ${toolchain_tag}
-TARGET = ${build_target}
-
-#
-# Build Directory Macro Definition
-#
-BUILD_DIR = ${platform_build_directory}
-FV_DIR = ${platform_build_directory}${separator}FV
-
-#
-# Shell Command Macro
-#
-${BEGIN}${shell_command_code} = ${shell_command}
-${END}
-
-MAKE = ${make_path}
-MAKE_FILE = ${makefile_path}
-
-#
-# Default target
-#
-all: init build_libraries build_modules
-
-#
-# Initialization target: print build information and create necessary directories
-#
-init:
-\t-@echo Building ... $(PLATFORM_FILE) [${build_architecture_list}]
-\t${BEGIN}-@${create_directory_command}
-\t${END}
-#
-# library build target
-#
-libraries: init build_libraries
-
-#
-# module build target
-#
-modules: init build_libraries build_modules
-
-#
-# Build all libraries:
-#
-build_libraries:
-${BEGIN}\t@"$(MAKE)" $(MAKE_FLAGS) -f ${library_makefile_list} pbuild
-${END}\t@cd $(BUILD_DIR)
-
-#
-# Build all modules:
-#
-build_modules:
-${BEGIN}\t@"$(MAKE)" $(MAKE_FLAGS) -f ${module_makefile_list} pbuild
-${END}\t@cd $(BUILD_DIR)
-
-#
-# Clean intermediate files
-#
-clean:
-\t${BEGIN}-@${library_build_command} clean
-\t${END}${BEGIN}-@${module_build_command} clean
-\t${END}@cd $(BUILD_DIR)
-
-#
-# Clean all generated files except to makefile
-#
-cleanall:
-${BEGIN}\t${cleanall_command}
-${END}
-
-#
-# Clean all library files
-#
-cleanlib:
-\t${BEGIN}-@${library_build_command} cleanall
-\t${END}@cd $(BUILD_DIR)\n
-''')
-
- ## Constructor of PlatformMakefile
- #
- # @param ModuleAutoGen Object of PlatformAutoGen class
- #
- def __init__(self, PlatformAutoGen):
- BuildFile.__init__(self, PlatformAutoGen)
- self.ModuleBuildCommandList = []
- self.ModuleMakefileList = []
- self.IntermediateDirectoryList = []
- self.ModuleBuildDirectoryList = []
- self.LibraryBuildDirectoryList = []
-
- # Compose a dict object containing information used to do replacement in template
- def _CreateTemplateDict(self):
- Separator = self._SEP_[self._FileType]
-
- PlatformInfo = self._AutoGenObject
- if "MAKE" not in PlatformInfo.ToolDefinition or "PATH" not in PlatformInfo.ToolDefinition["MAKE"]:
- EdkLogger.error("build", OPTION_MISSING, "No MAKE command defined. Please check your tools_def.txt!",
- ExtraData="[%s]" % str(self._AutoGenObject))
-
- self.IntermediateDirectoryList = ["$(BUILD_DIR)"]
- self.ModuleBuildDirectoryList = self.GetModuleBuildDirectoryList()
- self.LibraryBuildDirectoryList = self.GetLibraryBuildDirectoryList()
-
- MakefileName = self._FILE_NAME_[self._FileType]
- LibraryMakefileList = []
- LibraryMakeCommandList = []
- for D in self.LibraryBuildDirectoryList:
- D = self.PlaceMacro(D, {"BUILD_DIR":PlatformInfo.BuildDir})
- Makefile = os.path.join(D, MakefileName)
- Command = self._MAKE_TEMPLATE_[self._FileType] % {"file":Makefile}
- LibraryMakefileList.append(Makefile)
- LibraryMakeCommandList.append(Command)
-
- ModuleMakefileList = []
- ModuleMakeCommandList = []
- for D in self.ModuleBuildDirectoryList:
- D = self.PlaceMacro(D, {"BUILD_DIR":PlatformInfo.BuildDir})
- Makefile = os.path.join(D, MakefileName)
- Command = self._MAKE_TEMPLATE_[self._FileType] % {"file":Makefile}
- ModuleMakefileList.append(Makefile)
- ModuleMakeCommandList.append(Command)
-
- MakefileTemplateDict = {
- "makefile_header" : self._FILE_HEADER_[self._FileType],
- "makefile_path" : os.path.join("$(BUILD_DIR)", MakefileName),
- "make_path" : PlatformInfo.ToolDefinition["MAKE"]["PATH"],
- "makefile_name" : MakefileName,
- "platform_name" : PlatformInfo.Name,
- "platform_guid" : PlatformInfo.Guid,
- "platform_version" : PlatformInfo.Version,
- "platform_file" : self._AutoGenObject.MetaFile,
- "platform_relative_directory": PlatformInfo.SourceDir,
- "platform_output_directory" : PlatformInfo.OutputDir,
- "platform_build_directory" : PlatformInfo.BuildDir,
-
- "toolchain_tag" : PlatformInfo.ToolChain,
- "build_target" : PlatformInfo.BuildTarget,
- "shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),
- "shell_command" : self._SHELL_CMD_[self._FileType].values(),
- "build_architecture_list" : self._AutoGenObject.Arch,
- "architecture" : self._AutoGenObject.Arch,
- "separator" : Separator,
- "create_directory_command" : self.GetCreateDirectoryCommand(self.IntermediateDirectoryList),
- "cleanall_command" : self.GetRemoveDirectoryCommand(self.IntermediateDirectoryList),
- "library_makefile_list" : LibraryMakefileList,
- "module_makefile_list" : ModuleMakefileList,
- "library_build_command" : LibraryMakeCommandList,
- "module_build_command" : ModuleMakeCommandList,
- }
-
- return MakefileTemplateDict
-
- ## Get the root directory list for intermediate files of all modules build
- #
- # @retval list The list of directory
- #
- def GetModuleBuildDirectoryList(self):
- DirList = []
- for ModuleAutoGen in self._AutoGenObject.ModuleAutoGenList:
- DirList.append(os.path.join(self._AutoGenObject.BuildDir, ModuleAutoGen.BuildDir))
- return DirList
-
- ## Get the root directory list for intermediate files of all libraries build
- #
- # @retval list The list of directory
- #
- def GetLibraryBuildDirectoryList(self):
- DirList = []
- for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
- DirList.append(os.path.join(self._AutoGenObject.BuildDir, LibraryAutoGen.BuildDir))
- return DirList
-
- _TemplateDict = property(_CreateTemplateDict)
-
-## TopLevelMakefile class
-#
-# This class encapsules makefie and its generation for entrance makefile. It
-# uses template to generate the content of makefile. The content of makefile
-# will be got from WorkspaceAutoGen object.
-#
-class TopLevelMakefile(BuildFile):
- ## template used to generate toplevel makefile
- _TEMPLATE_ = TemplateString('''\
-${makefile_header}
-
-#
-# Platform Macro Definition
-#
-PLATFORM_NAME = ${platform_name}
-PLATFORM_GUID = ${platform_guid}
-PLATFORM_VERSION = ${platform_version}
-
-#
-# Build Configuration Macro Definition
-#
-TOOLCHAIN = ${toolchain_tag}
-TOOLCHAIN_TAG = ${toolchain_tag}
-TARGET = ${build_target}
-
-#
-# Build Directory Macro Definition
-#
-BUILD_DIR = ${platform_build_directory}
-FV_DIR = ${platform_build_directory}${separator}FV
-
-#
-# Shell Command Macro
-#
-${BEGIN}${shell_command_code} = ${shell_command}
-${END}
-
-MAKE = ${make_path}
-MAKE_FILE = ${makefile_path}
-
-#
-# Default target
-#
-all: modules fds
-
-#
-# Initialization target: print build information and create necessary directories
-#
-init:
-\t-@
-\t${BEGIN}-@${create_directory_command}
-\t${END}
-#
-# library build target
-#
-libraries: init
-${BEGIN}\t@cd $(BUILD_DIR)${separator}${arch} && "$(MAKE)" $(MAKE_FLAGS) libraries
-${END}\t@cd $(BUILD_DIR)
-
-#
-# module build target
-#
-modules: init
-${BEGIN}\t@cd $(BUILD_DIR)${separator}${arch} && "$(MAKE)" $(MAKE_FLAGS) modules
-${END}\t@cd $(BUILD_DIR)
-
-#
-# Flash Device Image Target
-#
-fds: init
-\t-@cd $(FV_DIR)
-${BEGIN}\tGenFds -f ${fdf_file} -o $(BUILD_DIR) -t $(TOOLCHAIN) -b $(TARGET) -p ${active_platform} -a ${build_architecture_list} ${extra_options}${END}${BEGIN} -r ${fd} ${END}${BEGIN} -i ${fv} ${END}${BEGIN} -C ${cap} ${END}${BEGIN} -D ${macro} ${END}
-
-#
-# run command for emulator platform only
-#
-run:
-\tcd $(BUILD_DIR)${separator}IA32 && ".${separator}SecMain"
-\tcd $(BUILD_DIR)
-
-#
-# Clean intermediate files
-#
-clean:
-${BEGIN}\t-@${sub_build_command} clean
-${END}\t@cd $(BUILD_DIR)
-
-#
-# Clean all generated files except to makefile
-#
-cleanall:
-${BEGIN}\t${cleanall_command}
-${END}
-
-#
-# Clean all library files
-#
-cleanlib:
-${BEGIN}\t-@${sub_build_command} cleanlib
-${END}\t@cd $(BUILD_DIR)\n
-''')
-
- ## Constructor of TopLevelMakefile
- #
- # @param Workspace Object of WorkspaceAutoGen class
- #
- def __init__(self, Workspace):
- BuildFile.__init__(self, Workspace)
- self.IntermediateDirectoryList = []
-
- # Compose a dict object containing information used to do replacement in template
- def _CreateTemplateDict(self):
- Separator = self._SEP_[self._FileType]
-
- # any platform autogen object is ok because we just need common information
- PlatformInfo = self._AutoGenObject
-
- if "MAKE" not in PlatformInfo.ToolDefinition or "PATH" not in PlatformInfo.ToolDefinition["MAKE"]:
- EdkLogger.error("build", OPTION_MISSING, "No MAKE command defined. Please check your tools_def.txt!",
- ExtraData="[%s]" % str(self._AutoGenObject))
-
- for Arch in PlatformInfo.ArchList:
- self.IntermediateDirectoryList.append(Separator.join(["$(BUILD_DIR)", Arch]))
- self.IntermediateDirectoryList.append("$(FV_DIR)")
-
- # TRICK: for not generating GenFds call in makefile if no FDF file
- MacroList = []
- if PlatformInfo.FdfFile != None and PlatformInfo.FdfFile != "":
- FdfFileList = [PlatformInfo.FdfFile]
- # macros passed to GenFds
- MacroList.append('"%s=%s"' % ("EFI_SOURCE", GlobalData.gEfiSource.replace('\\', '\\\\')))
- MacroList.append('"%s=%s"' % ("EDK_SOURCE", GlobalData.gEdkSource.replace('\\', '\\\\')))
- MacroDict = {}
- MacroDict.update(GlobalData.gGlobalDefines)
- MacroDict.update(GlobalData.gCommandLineDefines)
- MacroDict.pop("EFI_SOURCE", "dummy")
- MacroDict.pop("EDK_SOURCE", "dummy")
- for MacroName in MacroDict:
- if MacroDict[MacroName] != "":
- MacroList.append('"%s=%s"' % (MacroName, MacroDict[MacroName].replace('\\', '\\\\')))
- else:
- MacroList.append('"%s"' % MacroName)
- else:
- FdfFileList = []
-
- # pass extra common options to external program called in makefile, currently GenFds.exe
- ExtraOption = ''
- LogLevel = EdkLogger.GetLevel()
- if LogLevel == EdkLogger.VERBOSE:
- ExtraOption += " -v"
- elif LogLevel <= EdkLogger.DEBUG_9:
- ExtraOption += " -d %d" % (LogLevel - 1)
- elif LogLevel == EdkLogger.QUIET:
- ExtraOption += " -q"
-
- if GlobalData.gCaseInsensitive:
- ExtraOption += " -c"
-
- MakefileName = self._FILE_NAME_[self._FileType]
- SubBuildCommandList = []
- for A in PlatformInfo.ArchList:
- Command = self._MAKE_TEMPLATE_[self._FileType] % {"file":os.path.join("$(BUILD_DIR)", A, MakefileName)}
- SubBuildCommandList.append(Command)
-
- MakefileTemplateDict = {
- "makefile_header" : self._FILE_HEADER_[self._FileType],
- "makefile_path" : os.path.join("$(BUILD_DIR)", MakefileName),
- "make_path" : PlatformInfo.ToolDefinition["MAKE"]["PATH"],
- "platform_name" : PlatformInfo.Name,
- "platform_guid" : PlatformInfo.Guid,
- "platform_version" : PlatformInfo.Version,
- "platform_build_directory" : PlatformInfo.BuildDir,
-
- "toolchain_tag" : PlatformInfo.ToolChain,
- "build_target" : PlatformInfo.BuildTarget,
- "shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),
- "shell_command" : self._SHELL_CMD_[self._FileType].values(),
- 'arch' : list(PlatformInfo.ArchList),
- "build_architecture_list" : ','.join(PlatformInfo.ArchList),
- "separator" : Separator,
- "create_directory_command" : self.GetCreateDirectoryCommand(self.IntermediateDirectoryList),
- "cleanall_command" : self.GetRemoveDirectoryCommand(self.IntermediateDirectoryList),
- "sub_build_command" : SubBuildCommandList,
- "fdf_file" : FdfFileList,
- "active_platform" : str(PlatformInfo),
- "fd" : PlatformInfo.FdTargetList,
- "fv" : PlatformInfo.FvTargetList,
- "cap" : PlatformInfo.CapTargetList,
- "extra_options" : ExtraOption,
- "macro" : MacroList,
- }
-
- return MakefileTemplateDict
-
- ## Get the root directory list for intermediate files of all modules build
- #
- # @retval list The list of directory
- #
- def GetModuleBuildDirectoryList(self):
- DirList = []
- for ModuleAutoGen in self._AutoGenObject.ModuleAutoGenList:
- DirList.append(os.path.join(self._AutoGenObject.BuildDir, ModuleAutoGen.BuildDir))
- return DirList
-
- ## Get the root directory list for intermediate files of all libraries build
- #
- # @retval list The list of directory
- #
- def GetLibraryBuildDirectoryList(self):
- DirList = []
- for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
- DirList.append(os.path.join(self._AutoGenObject.BuildDir, LibraryAutoGen.BuildDir))
- return DirList
-
- _TemplateDict = property(_CreateTemplateDict)
-
-# This acts like the main() function for the script, unless it is 'import'ed into another script.
-if __name__ == '__main__':
- pass
-
diff --git a/BaseTools/Source/Python/AutoGen/StrGather.py b/BaseTools/Source/Python/AutoGen/StrGather.py
deleted file mode 100644
index b84d9f90aa..0000000000
--- a/BaseTools/Source/Python/AutoGen/StrGather.py
+++ /dev/null
@@ -1,655 +0,0 @@
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-#
-#This file is used to parse a strings file and create or add to a string database file.
-#
-
-##
-# Import Modules
-#
-import re
-import Common.EdkLogger as EdkLogger
-from Common.BuildToolError import *
-from UniClassObject import *
-from StringIO import StringIO
-from struct import pack
-
-##
-# Static definitions
-#
-EFI_HII_SIBT_END = '0x00'
-EFI_HII_SIBT_STRING_SCSU = '0x10'
-EFI_HII_SIBT_STRING_SCSU_FONT = '0x11'
-EFI_HII_SIBT_STRINGS_SCSU = '0x12'
-EFI_HII_SIBT_STRINGS_SCSU_FONT = '0x13'
-EFI_HII_SIBT_STRING_UCS2 = '0x14'
-EFI_HII_SIBT_STRING_UCS2_FONT = '0x15'
-EFI_HII_SIBT_STRINGS_UCS2 = '0x16'
-EFI_HII_SIBT_STRINGS_UCS2_FONT = '0x17'
-EFI_HII_SIBT_DUPLICATE = '0x20'
-EFI_HII_SIBT_SKIP2 = '0x21'
-EFI_HII_SIBT_SKIP1 = '0x22'
-EFI_HII_SIBT_EXT1 = '0x30'
-EFI_HII_SIBT_EXT2 = '0x31'
-EFI_HII_SIBT_EXT4 = '0x32'
-EFI_HII_SIBT_FONT = '0x40'
-
-EFI_HII_PACKAGE_STRINGS = '0x04'
-EFI_HII_PACKAGE_FORM = '0x02'
-
-StringPackageType = EFI_HII_PACKAGE_STRINGS
-StringPackageForm = EFI_HII_PACKAGE_FORM
-StringBlockType = EFI_HII_SIBT_STRING_UCS2
-StringSkipType = EFI_HII_SIBT_SKIP2
-
-HexHeader = '0x'
-
-COMMENT = '// '
-DEFINE_STR = '#define'
-COMMENT_DEFINE_STR = COMMENT + DEFINE_STR
-NOT_REFERENCED = 'not referenced'
-COMMENT_NOT_REFERENCED = ' ' + COMMENT + NOT_REFERENCED
-CHAR_ARRAY_DEFIN = 'unsigned char'
-COMMON_FILE_NAME = 'Strings'
-OFFSET = 'offset'
-STRING = 'string'
-TO = 'to'
-STRING_TOKEN = re.compile('STRING_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)
-COMPATIBLE_STRING_TOKEN = re.compile('STRING_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)
-
-EFI_HII_ARRAY_SIZE_LENGTH = 4
-EFI_HII_PACKAGE_HEADER_LENGTH = 4
-EFI_HII_HDR_SIZE_LENGTH = 4
-EFI_HII_STRING_OFFSET_LENGTH = 4
-EFI_STRING_ID = 1
-EFI_STRING_ID_LENGTH = 2
-EFI_HII_LANGUAGE_WINDOW = 0
-EFI_HII_LANGUAGE_WINDOW_LENGTH = 2
-EFI_HII_LANGUAGE_WINDOW_NUMBER = 16
-EFI_HII_STRING_PACKAGE_HDR_LENGTH = EFI_HII_PACKAGE_HEADER_LENGTH + EFI_HII_HDR_SIZE_LENGTH + EFI_HII_STRING_OFFSET_LENGTH + EFI_HII_LANGUAGE_WINDOW_LENGTH * EFI_HII_LANGUAGE_WINDOW_NUMBER + EFI_STRING_ID_LENGTH
-
-H_C_FILE_HEADER = ['//', \
- '// DO NOT EDIT -- auto-generated file', \
- '//', \
- '// This file is generated by the StrGather utility', \
- '//']
-LANGUAGE_NAME_STRING_NAME = '$LANGUAGE_NAME'
-PRINTABLE_LANGUAGE_NAME_STRING_NAME = '$PRINTABLE_LANGUAGE_NAME'
-
-## Convert a dec number to a hex string
-#
-# Convert a dec number to a formatted hex string in length digit
-# The digit is set to default 8
-# The hex string starts with "0x"
-# DecToHexStr(1000) is '0x000003E8'
-# DecToHexStr(1000, 6) is '0x0003E8'
-#
-# @param Dec: The number in dec format
-# @param Digit: The needed digit of hex string
-#
-# @retval: The formatted hex string
-#
-def DecToHexStr(Dec, Digit = 8):
- return eval("'0x%0" + str(Digit) + "X' % int(Dec)")
-
-## Convert a dec number to a hex list
-#
-# Convert a dec number to a formatted hex list in size digit
-# The digit is set to default 8
-# DecToHexList(1000) is ['0xE8', '0x03', '0x00', '0x00']
-# DecToHexList(1000, 6) is ['0xE8', '0x03', '0x00']
-#
-# @param Dec: The number in dec format
-# @param Digit: The needed digit of hex list
-#
-# @retval: A list for formatted hex string
-#
-def DecToHexList(Dec, Digit = 8):
- Hex = eval("'%0" + str(Digit) + "X' % int(Dec)" )
- List = []
- for Bit in range(Digit - 2, -1, -2):
- List.append(HexHeader + Hex[Bit:Bit + 2])
- return List
-
-## Convert a acsii string to a hex list
-#
-# Convert a acsii string to a formatted hex list
-# AscToHexList('en-US') is ['0x65', '0x6E', '0x2D', '0x55', '0x53']
-#
-# @param Ascii: The acsii string
-#
-# @retval: A list for formatted hex string
-#
-def AscToHexList(Ascii):
- List = []
- for Item in Ascii:
- List.append('0x%2X' % ord(Item))
-
- return List
-
-## Create header of .h file
-#
-# Create a header of .h file
-#
-# @param BaseName: The basename of strings
-#
-# @retval Str: A string for .h file header
-#
-def CreateHFileHeader(BaseName):
- Str = ''
- for Item in H_C_FILE_HEADER:
- Str = WriteLine(Str, Item)
- Str = WriteLine(Str, '#ifndef _' + BaseName.upper() + '_STRINGS_DEFINE_H_')
- Str = WriteLine(Str, '#define _' + BaseName.upper() + '_STRINGS_DEFINE_H_')
- return Str
-
-## Create content of .h file
-#
-# Create content of .h file
-#
-# @param BaseName: The basename of strings
-# @param UniObjectClass A UniObjectClass instance
-# @param IsCompatibleMode Compatible mode
-# @param UniGenCFlag UniString is generated into AutoGen C file when it is set to True
-#
-# @retval Str: A string of .h file content
-#
-def CreateHFileContent(BaseName, UniObjectClass, IsCompatibleMode, UniGenCFlag):
- Str = ''
- ValueStartPtr = 60
- Line = COMMENT_DEFINE_STR + ' ' + LANGUAGE_NAME_STRING_NAME + ' ' * (ValueStartPtr - len(DEFINE_STR + LANGUAGE_NAME_STRING_NAME)) + DecToHexStr(0, 4) + COMMENT_NOT_REFERENCED
- Str = WriteLine(Str, Line)
- Line = COMMENT_DEFINE_STR + ' ' + PRINTABLE_LANGUAGE_NAME_STRING_NAME + ' ' * (ValueStartPtr - len(DEFINE_STR + PRINTABLE_LANGUAGE_NAME_STRING_NAME)) + DecToHexStr(1, 4) + COMMENT_NOT_REFERENCED
- Str = WriteLine(Str, Line)
- UnusedStr = ''
-
- #Group the referred/Unused STRING token together.
- for Index in range(2, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]])):
- StringItem = UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[0][0]][Index]
- Name = StringItem.StringName
- Token = StringItem.Token
- Referenced = StringItem.Referenced
- if Name != None:
- Line = ''
- if Referenced == True:
- if (ValueStartPtr - len(DEFINE_STR + Name)) <= 0:
- Line = DEFINE_STR + ' ' + Name + ' ' + DecToHexStr(Token, 4)
- else:
- Line = DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4)
- Str = WriteLine(Str, Line)
- else:
- if (ValueStartPtr - len(DEFINE_STR + Name)) <= 0:
- Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED
- else:
- Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED
- UnusedStr = WriteLine(UnusedStr, Line)
-
- Str = ''.join([Str,UnusedStr])
-
- Str = WriteLine(Str, '')
- if IsCompatibleMode or UniGenCFlag:
- Str = WriteLine(Str, 'extern unsigned char ' + BaseName + 'Strings[];')
- return Str
-
-## Create a complete .h file
-#
-# Create a complet .h file with file header and file content
-#
-# @param BaseName: The basename of strings
-# @param UniObjectClass A UniObjectClass instance
-# @param IsCompatibleMode Compatible mode
-# @param UniGenCFlag UniString is generated into AutoGen C file when it is set to True
-#
-# @retval Str: A string of complete .h file
-#
-def CreateHFile(BaseName, UniObjectClass, IsCompatibleMode, UniGenCFlag):
- HFile = WriteLine('', CreateHFileContent(BaseName, UniObjectClass, IsCompatibleMode, UniGenCFlag))
-
- return HFile
-
-## Create header of .c file
-#
-# Create a header of .c file
-#
-# @retval Str: A string for .c file header
-#
-def CreateCFileHeader():
- Str = ''
- for Item in H_C_FILE_HEADER:
- Str = WriteLine(Str, Item)
-
- return Str
-
-## Create a buffer to store all items in an array
-#
-# @param BinBuffer Buffer to contain Binary data.
-# @param Array: The array need to be formatted
-#
-def CreateBinBuffer(BinBuffer, Array):
- for Item in Array:
- BinBuffer.write(pack("B", int(Item,16)))
-
-## Create a formatted string all items in an array
-#
-# Use ',' to join each item in an array, and break an new line when reaching the width (default is 16)
-#
-# @param Array: The array need to be formatted
-# @param Width: The line length, the default value is set to 16
-#
-# @retval ArrayItem: A string for all formatted array items
-#
-def CreateArrayItem(Array, Width = 16):
- MaxLength = Width
- Index = 0
- Line = ' '
- ArrayItem = ''
-
- for Item in Array:
- if Index < MaxLength:
- Line = Line + Item + ', '
- Index = Index + 1
- else:
- ArrayItem = WriteLine(ArrayItem, Line)
- Line = ' ' + Item + ', '
- Index = 1
- ArrayItem = Write(ArrayItem, Line.rstrip())
-
- return ArrayItem
-
-## CreateCFileStringValue
-#
-# Create a line with string value
-#
-# @param Value: Value of the string
-#
-# @retval Str: A formatted string with string value
-#
-
-def CreateCFileStringValue(Value):
- Value = [StringBlockType] + Value
- Str = WriteLine('', CreateArrayItem(Value))
-
- return Str
-
-## GetFilteredLanguage
-#
-# apply get best language rules to the UNI language code list
-#
-# @param UniLanguageList: language code definition list in *.UNI file
-# @param LanguageFilterList: language code filter list of RFC4646 format in DSC file
-#
-# @retval UniLanguageListFiltered: the filtered language code
-#
-def GetFilteredLanguage(UniLanguageList, LanguageFilterList):
- UniLanguageListFiltered = []
- # if filter list is empty, then consider there is no filter
- if LanguageFilterList == []:
- UniLanguageListFiltered = UniLanguageList
- return UniLanguageListFiltered
- for Language in LanguageFilterList:
- # first check for exact match
- if Language in UniLanguageList:
- if Language not in UniLanguageListFiltered:
- UniLanguageListFiltered += [Language]
- # find the first one with the same/equivalent primary tag
- else:
- if Language.find('-') != -1:
- PrimaryTag = Language[0:Language.find('-')].lower()
- else:
- PrimaryTag = Language
-
- if len(PrimaryTag) == 3:
- PrimaryTag = LangConvTable.get(PrimaryTag)
-
- for UniLanguage in UniLanguageList:
- if UniLanguage.find('-') != -1:
- UniLanguagePrimaryTag = UniLanguage[0:UniLanguage.find('-')].lower()
- else:
- UniLanguagePrimaryTag = UniLanguage
-
- if len(UniLanguagePrimaryTag) == 3:
- UniLanguagePrimaryTag = LangConvTable.get(UniLanguagePrimaryTag)
-
- if PrimaryTag == UniLanguagePrimaryTag:
- if UniLanguage not in UniLanguageListFiltered:
- UniLanguageListFiltered += [UniLanguage]
- break
- else:
- # Here is rule 3 for "get best language"
- # If tag is not listed in the Unicode file, the default ("en") tag should be used for that language
- # for better processing, find the one that best suit for it.
- DefaultTag = 'en'
- if DefaultTag not in UniLanguageListFiltered:
- # check whether language code with primary code equivalent with DefaultTag already in the list, if so, use that
- for UniLanguage in UniLanguageList:
- if UniLanguage.startswith('en-') or UniLanguage.startswith('eng-'):
- if UniLanguage not in UniLanguageListFiltered:
- UniLanguageListFiltered += [UniLanguage]
- break
- else:
- UniLanguageListFiltered += [DefaultTag]
- return UniLanguageListFiltered
-
-
-## Create content of .c file
-#
-# Create content of .c file
-#
-# @param BaseName: The basename of strings
-# @param UniObjectClass A UniObjectClass instance
-# @param IsCompatibleMode Compatible mode
-# @param UniBinBuffer UniBinBuffer to contain UniBinary data.
-# @param FilterInfo Platform language filter information
-#
-# @retval Str: A string of .c file content
-#
-def CreateCFileContent(BaseName, UniObjectClass, IsCompatibleMode, UniBinBuffer, FilterInfo):
- #
- # Init array length
- #
- TotalLength = EFI_HII_ARRAY_SIZE_LENGTH
- Str = ''
- Offset = 0
-
- EDK2Module = FilterInfo[0]
- if EDK2Module:
- LanguageFilterList = FilterInfo[1]
- else:
- # EDK module is using ISO639-2 format filter, convert to the RFC4646 format
- LanguageFilterList = [LangConvTable.get(F.lower()) for F in FilterInfo[1]]
-
- UniLanguageList = []
- for IndexI in range(len(UniObjectClass.LanguageDef)):
- UniLanguageList += [UniObjectClass.LanguageDef[IndexI][0]]
-
- UniLanguageListFiltered = GetFilteredLanguage(UniLanguageList, LanguageFilterList)
-
-
- #
- # Create lines for each language's strings
- #
- for IndexI in range(len(UniObjectClass.LanguageDef)):
- Language = UniObjectClass.LanguageDef[IndexI][0]
- if Language not in UniLanguageListFiltered:
- continue
-
- StringBuffer = StringIO()
- StrStringValue = ''
- ArrayLength = 0
- NumberOfUseOtherLangDef = 0
- Index = 0
- for IndexJ in range(1, len(UniObjectClass.OrderedStringList[UniObjectClass.LanguageDef[IndexI][0]])):
- Item = UniObjectClass.OrderedStringListByToken[Language][IndexJ]
-
- Name = Item.StringName
- Value = Item.StringValueByteList
- Referenced = Item.Referenced
- Token = Item.Token
- UseOtherLangDef = Item.UseOtherLangDef
-
- if UseOtherLangDef != '' and Referenced:
- NumberOfUseOtherLangDef = NumberOfUseOtherLangDef + 1
- Index = Index + 1
- else:
- if NumberOfUseOtherLangDef > 0:
- StrStringValue = WriteLine(StrStringValue, CreateArrayItem([StringSkipType] + DecToHexList(NumberOfUseOtherLangDef, 4)))
- CreateBinBuffer (StringBuffer, ([StringSkipType] + DecToHexList(NumberOfUseOtherLangDef, 4)))
- NumberOfUseOtherLangDef = 0
- ArrayLength = ArrayLength + 3
- if Referenced and Item.Token > 0:
- Index = Index + 1
- StrStringValue = WriteLine(StrStringValue, "// %s: %s:%s" % (DecToHexStr(Index, 4), Name, DecToHexStr(Token, 4)))
- StrStringValue = Write(StrStringValue, CreateCFileStringValue(Value))
- CreateBinBuffer (StringBuffer, [StringBlockType] + Value)
- ArrayLength = ArrayLength + Item.Length + 1 # 1 is for the length of string type
-
- #
- # EFI_HII_PACKAGE_HEADER
- #
- Offset = EFI_HII_STRING_PACKAGE_HDR_LENGTH + len(Language) + 1
- ArrayLength = Offset + ArrayLength + 1
-
- #
- # Create PACKAGE HEADER
- #
- Str = WriteLine(Str, '// PACKAGE HEADER\n')
- TotalLength = TotalLength + ArrayLength
-
- List = DecToHexList(ArrayLength, 6) + \
- [StringPackageType] + \
- DecToHexList(Offset) + \
- DecToHexList(Offset) + \
- DecToHexList(EFI_HII_LANGUAGE_WINDOW, EFI_HII_LANGUAGE_WINDOW_LENGTH * 2) * EFI_HII_LANGUAGE_WINDOW_NUMBER + \
- DecToHexList(EFI_STRING_ID, 4) + \
- AscToHexList(Language) + \
- DecToHexList(0, 2)
- Str = WriteLine(Str, CreateArrayItem(List, 16) + '\n')
-
- #
- # Create PACKAGE DATA
- #
- Str = WriteLine(Str, '// PACKAGE DATA\n')
- Str = Write(Str, StrStringValue)
-
- #
- # Add an EFI_HII_SIBT_END at last
- #
- Str = WriteLine(Str, ' ' + EFI_HII_SIBT_END + ",")
-
- #
- # Create binary UNI string
- #
- if UniBinBuffer:
- CreateBinBuffer (UniBinBuffer, List)
- UniBinBuffer.write (StringBuffer.getvalue())
- UniBinBuffer.write (pack("B", int(EFI_HII_SIBT_END,16)))
- StringBuffer.close()
-
- #
- # Create line for string variable name
- # "unsigned char $(BaseName)Strings[] = {"
- #
- AllStr = WriteLine('', CHAR_ARRAY_DEFIN + ' ' + BaseName + COMMON_FILE_NAME + '[] = {\n' )
-
- if IsCompatibleMode:
- #
- # Create FRAMEWORK_EFI_HII_PACK_HEADER in compatible mode
- #
- AllStr = WriteLine(AllStr, '// FRAMEWORK PACKAGE HEADER Length')
- AllStr = WriteLine(AllStr, CreateArrayItem(DecToHexList(TotalLength + 2)) + '\n')
- AllStr = WriteLine(AllStr, '// FRAMEWORK PACKAGE HEADER Type')
- AllStr = WriteLine(AllStr, CreateArrayItem(DecToHexList(2, 4)) + '\n')
- else:
- #
- # Create whole array length in UEFI mode
- #
- AllStr = WriteLine(AllStr, '// STRGATHER_OUTPUT_HEADER')
- AllStr = WriteLine(AllStr, CreateArrayItem(DecToHexList(TotalLength)) + '\n')
-
- #
- # Join package data
- #
- AllStr = Write(AllStr, Str)
-
- return AllStr
-
-## Create end of .c file
-#
-# Create end of .c file
-#
-# @retval Str: A string of .h file end
-#
-def CreateCFileEnd():
- Str = Write('', '};')
- return Str
-
-## Create a .c file
-#
-# Create a complete .c file
-#
-# @param BaseName: The basename of strings
-# @param UniObjectClass A UniObjectClass instance
-# @param IsCompatibleMode Compatible Mode
-# @param FilterInfo Platform language filter information
-#
-# @retval CFile: A string of complete .c file
-#
-def CreateCFile(BaseName, UniObjectClass, IsCompatibleMode, FilterInfo):
- CFile = ''
- #CFile = WriteLine(CFile, CreateCFileHeader())
- CFile = WriteLine(CFile, CreateCFileContent(BaseName, UniObjectClass, IsCompatibleMode, None, FilterInfo))
- CFile = WriteLine(CFile, CreateCFileEnd())
- return CFile
-
-## GetFileList
-#
-# Get a list for all files
-#
-# @param IncludeList: A list of all path to be searched
-# @param SkipList: A list of all types of file could be skipped
-#
-# @retval FileList: A list of all files found
-#
-def GetFileList(SourceFileList, IncludeList, SkipList):
- if IncludeList == None:
- EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, "Include path for unicode file is not defined")
-
- FileList = []
- if SkipList == None:
- SkipList = []
-
- for File in SourceFileList:
- for Dir in IncludeList:
- if not os.path.exists(Dir):
- continue
- File = os.path.join(Dir, File.Path)
- #
- # Ignore Dir
- #
- if os.path.isfile(File) != True:
- continue
- #
- # Ignore file listed in skip list
- #
- IsSkip = False
- for Skip in SkipList:
- if os.path.splitext(File)[1].upper() == Skip.upper():
- EdkLogger.verbose("Skipped %s for string token uses search" % File)
- IsSkip = True
- break
-
- if not IsSkip:
- FileList.append(File)
-
- break
-
- return FileList
-
-## SearchString
-#
-# Search whether all string defined in UniObjectClass are referenced
-# All string used should be set to Referenced
-#
-# @param UniObjectClass: Input UniObjectClass
-# @param FileList: Search path list
-# @param IsCompatibleMode Compatible Mode
-#
-# @retval UniObjectClass: UniObjectClass after searched
-#
-def SearchString(UniObjectClass, FileList, IsCompatibleMode):
- if FileList == []:
- return UniObjectClass
-
- for File in FileList:
- if os.path.isfile(File):
- Lines = open(File, 'r')
- for Line in Lines:
- if not IsCompatibleMode:
- StringTokenList = STRING_TOKEN.findall(Line)
- else:
- StringTokenList = COMPATIBLE_STRING_TOKEN.findall(Line)
- for StrName in StringTokenList:
- EdkLogger.debug(EdkLogger.DEBUG_5, "Found string identifier: " + StrName)
- UniObjectClass.SetStringReferenced(StrName)
-
- UniObjectClass.ReToken()
-
- return UniObjectClass
-
-## GetStringFiles
-#
-# This function is used for UEFI2.1 spec
-#
-#
-def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathList, SkipList, BaseName, IsCompatibleMode = False, ShellMode = False, UniGenCFlag = True, UniGenBinBuffer = None, FilterInfo = [True, []]):
- if len(UniFilList) > 0:
- if ShellMode:
- #
- # support ISO 639-2 codes in .UNI files of EDK Shell
- #
- Uni = UniFileClassObject(sorted (UniFilList), True, IncludePathList)
- else:
- Uni = UniFileClassObject(sorted (UniFilList), IsCompatibleMode, IncludePathList)
- else:
- EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 'No unicode files given')
-
- FileList = GetFileList(SourceFileList, IncludeList, SkipList)
-
- Uni = SearchString(Uni, sorted (FileList), IsCompatibleMode)
-
- HFile = CreateHFile(BaseName, Uni, IsCompatibleMode, UniGenCFlag)
- CFile = None
- if IsCompatibleMode or UniGenCFlag:
- CFile = CreateCFile(BaseName, Uni, IsCompatibleMode, FilterInfo)
- if UniGenBinBuffer:
- CreateCFileContent(BaseName, Uni, IsCompatibleMode, UniGenBinBuffer, FilterInfo)
-
- return HFile, CFile
-
-#
-# Write an item
-#
-def Write(Target, Item):
- return ''.join([Target,Item])
-
-#
-# Write an item with a break line
-#
-def WriteLine(Target, Item):
- return ''.join([Target,Item,'\n'])
-
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-if __name__ == '__main__':
- EdkLogger.info('start')
-
- UniFileList = [
- r'C:\\Edk\\Strings2.uni',
- r'C:\\Edk\\Strings.uni'
- ]
-
- SrcFileList = []
- for Root, Dirs, Files in os.walk('C:\\Edk'):
- for File in Files:
- SrcFileList.append(File)
-
- IncludeList = [
- r'C:\\Edk'
- ]
-
- SkipList = ['.inf', '.uni']
- BaseName = 'DriverSample'
- (h, c) = GetStringFiles(UniFileList, SrcFileList, IncludeList, SkipList, BaseName, True)
- hfile = open('unistring.h', 'w')
- cfile = open('unistring.c', 'w')
- hfile.write(h)
- cfile.write(c)
-
- EdkLogger.info('end')
diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py
deleted file mode 100644
index 7b1ce72ea7..0000000000
--- a/BaseTools/Source/Python/AutoGen/UniClassObject.py
+++ /dev/null
@@ -1,612 +0,0 @@
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-#
-#This file is used to collect all defined strings in multiple uni files
-#
-
-##
-# Import Modules
-#
-import os, codecs, re
-import distutils.util
-import Common.EdkLogger as EdkLogger
-from Common.BuildToolError import *
-from Common.String import GetLineNo
-from Common.Misc import PathClass
-
-##
-# Static definitions
-#
-UNICODE_WIDE_CHAR = u'\\wide'
-UNICODE_NARROW_CHAR = u'\\narrow'
-UNICODE_NON_BREAKING_CHAR = u'\\nbr'
-UNICODE_UNICODE_CR = '\r'
-UNICODE_UNICODE_LF = '\n'
-
-NARROW_CHAR = u'\uFFF0'
-WIDE_CHAR = u'\uFFF1'
-NON_BREAKING_CHAR = u'\uFFF2'
-CR = u'\u000D'
-LF = u'\u000A'
-NULL = u'\u0000'
-TAB = u'\t'
-BACK_SPLASH = u'\\'
-DOBULE_QUOTED_SPLASH = u'\\"'
-SIGLE_QUOTED_SPLASH = u"\\'"
-TAB_BACK_SLASH = u"\\/"
-
-gIncludePattern = re.compile("^#include +[\"<]+([^\"< >]+)[>\"]+$", re.MULTILINE | re.UNICODE)
-
-## Convert a python unicode string to a normal string
-#
-# Convert a python unicode string to a normal string
-# UniToStr(u'I am a string') is 'I am a string'
-#
-# @param Uni: The python unicode string
-#
-# @retval: The formatted normal string
-#
-def UniToStr(Uni):
- return repr(Uni)[2:-1]
-
-## Convert a unicode string to a Hex list
-#
-# Convert a unicode string to a Hex list
-# UniToHexList('ABC') is ['0x41', '0x00', '0x42', '0x00', '0x43', '0x00']
-#
-# @param Uni: The python unicode string
-#
-# @retval List: The formatted hex list
-#
-def UniToHexList(Uni):
- List = []
- for Item in Uni:
- Temp = '%04X' % ord(Item)
- List.append('0x' + Temp[2:4])
- List.append('0x' + Temp[0:2])
- return List
-
-LangConvTable = {'eng':'en', 'fra':'fr', \
- 'aar':'aa', 'abk':'ab', 'ave':'ae', 'afr':'af', 'aka':'ak', 'amh':'am', \
- 'arg':'an', 'ara':'ar', 'asm':'as', 'ava':'av', 'aym':'ay', 'aze':'az', \
- 'bak':'ba', 'bel':'be', 'bul':'bg', 'bih':'bh', 'bis':'bi', 'bam':'bm', \
- 'ben':'bn', 'bod':'bo', 'bre':'br', 'bos':'bs', 'cat':'ca', 'che':'ce', \
- 'cha':'ch', 'cos':'co', 'cre':'cr', 'ces':'cs', 'chu':'cu', 'chv':'cv', \
- 'cym':'cy', 'dan':'da', 'deu':'de', 'div':'dv', 'dzo':'dz', 'ewe':'ee', \
- 'ell':'el', 'epo':'eo', 'spa':'es', 'est':'et', 'eus':'eu', 'fas':'fa', \
- 'ful':'ff', 'fin':'fi', 'fij':'fj', 'fao':'fo', 'fry':'fy', 'gle':'ga', \
- 'gla':'gd', 'glg':'gl', 'grn':'gn', 'guj':'gu', 'glv':'gv', 'hau':'ha', \
- 'heb':'he', 'hin':'hi', 'hmo':'ho', 'hrv':'hr', 'hat':'ht', 'hun':'hu', \
- 'hye':'hy', 'her':'hz', 'ina':'ia', 'ind':'id', 'ile':'ie', 'ibo':'ig', \
- 'iii':'ii', 'ipk':'ik', 'ido':'io', 'isl':'is', 'ita':'it', 'iku':'iu', \
- 'jpn':'ja', 'jav':'jv', 'kat':'ka', 'kon':'kg', 'kik':'ki', 'kua':'kj', \
- 'kaz':'kk', 'kal':'kl', 'khm':'km', 'kan':'kn', 'kor':'ko', 'kau':'kr', \
- 'kas':'ks', 'kur':'ku', 'kom':'kv', 'cor':'kw', 'kir':'ky', 'lat':'la', \
- 'ltz':'lb', 'lug':'lg', 'lim':'li', 'lin':'ln', 'lao':'lo', 'lit':'lt', \
- 'lub':'lu', 'lav':'lv', 'mlg':'mg', 'mah':'mh', 'mri':'mi', 'mkd':'mk', \
- 'mal':'ml', 'mon':'mn', 'mar':'mr', 'msa':'ms', 'mlt':'mt', 'mya':'my', \
- 'nau':'na', 'nob':'nb', 'nde':'nd', 'nep':'ne', 'ndo':'ng', 'nld':'nl', \
- 'nno':'nn', 'nor':'no', 'nbl':'nr', 'nav':'nv', 'nya':'ny', 'oci':'oc', \
- 'oji':'oj', 'orm':'om', 'ori':'or', 'oss':'os', 'pan':'pa', 'pli':'pi', \
- 'pol':'pl', 'pus':'ps', 'por':'pt', 'que':'qu', 'roh':'rm', 'run':'rn', \
- 'ron':'ro', 'rus':'ru', 'kin':'rw', 'san':'sa', 'srd':'sc', 'snd':'sd', \
- 'sme':'se', 'sag':'sg', 'sin':'si', 'slk':'sk', 'slv':'sl', 'smo':'sm', \
- 'sna':'sn', 'som':'so', 'sqi':'sq', 'srp':'sr', 'ssw':'ss', 'sot':'st', \
- 'sun':'su', 'swe':'sv', 'swa':'sw', 'tam':'ta', 'tel':'te', 'tgk':'tg', \
- 'tha':'th', 'tir':'ti', 'tuk':'tk', 'tgl':'tl', 'tsn':'tn', 'ton':'to', \
- 'tur':'tr', 'tso':'ts', 'tat':'tt', 'twi':'tw', 'tah':'ty', 'uig':'ug', \
- 'ukr':'uk', 'urd':'ur', 'uzb':'uz', 'ven':'ve', 'vie':'vi', 'vol':'vo', \
- 'wln':'wa', 'wol':'wo', 'xho':'xh', 'yid':'yi', 'yor':'yo', 'zha':'za', \
- 'zho':'zh', 'zul':'zu'}
-
-## GetLanguageCode
-#
-# Check the language code read from .UNI file and convert ISO 639-2 codes to RFC 4646 codes if appropriate
-# ISO 639-2 language codes supported in compatiblity mode
-# RFC 4646 language codes supported in native mode
-#
-# @param LangName: Language codes read from .UNI file
-#
-# @retval LangName: Valid lanugage code in RFC 4646 format or None
-#
-def GetLanguageCode(LangName, IsCompatibleMode, File):
- global LangConvTable
-
- length = len(LangName)
- if IsCompatibleMode:
- if length == 3 and LangName.isalpha():
- TempLangName = LangConvTable.get(LangName.lower())
- if TempLangName != None:
- return TempLangName
- return LangName
- else:
- EdkLogger.error("Unicode File Parser", FORMAT_INVALID, "Invalid ISO 639-2 language code : %s" % LangName, File)
-
- if (LangName[0] == 'X' or LangName[0] == 'x') and LangName[1] == '-':
- return LangName
- if length == 2:
- if LangName.isalpha():
- return LangName
- elif length == 3:
- if LangName.isalpha() and LangConvTable.get(LangName.lower()) == None:
- return LangName
- elif length == 5:
- if LangName[0:2].isalpha() and LangName[2] == '-':
- return LangName
- elif length >= 6:
- if LangName[0:2].isalpha() and LangName[2] == '-':
- return LangName
- if LangName[0:3].isalpha() and LangConvTable.get(LangName.lower()) == None and LangName[3] == '-':
- return LangName
-
- EdkLogger.error("Unicode File Parser", FORMAT_INVALID, "Invalid RFC 4646 language code : %s" % LangName, File)
-
-## StringDefClassObject
-#
-# A structure for language definition
-#
-class StringDefClassObject(object):
- def __init__(self, Name = None, Value = None, Referenced = False, Token = None, UseOtherLangDef = ''):
- self.StringName = ''
- self.StringNameByteList = []
- self.StringValue = ''
- self.StringValueByteList = ''
- self.Token = 0
- self.Referenced = Referenced
- self.UseOtherLangDef = UseOtherLangDef
- self.Length = 0
-
- if Name != None:
- self.StringName = Name
- self.StringNameByteList = UniToHexList(Name)
- if Value != None:
- self.StringValue = Value + u'\x00' # Add a NULL at string tail
- self.StringValueByteList = UniToHexList(self.StringValue)
- self.Length = len(self.StringValueByteList)
- if Token != None:
- self.Token = Token
-
- def __str__(self):
- return repr(self.StringName) + ' ' + \
- repr(self.Token) + ' ' + \
- repr(self.Referenced) + ' ' + \
- repr(self.StringValue) + ' ' + \
- repr(self.UseOtherLangDef)
-
- def UpdateValue(self, Value = None):
- if Value != None:
- self.StringValue = Value + u'\x00' # Add a NULL at string tail
- self.StringValueByteList = UniToHexList(self.StringValue)
- self.Length = len(self.StringValueByteList)
-
-## UniFileClassObject
-#
-# A structure for .uni file definition
-#
-class UniFileClassObject(object):
- def __init__(self, FileList = [], IsCompatibleMode = False, IncludePathList = []):
- self.FileList = FileList
- self.Token = 2
- self.LanguageDef = [] #[ [u'LanguageIdentifier', u'PrintableName'], ... ]
- self.OrderedStringList = {} #{ u'LanguageIdentifier' : [StringDefClassObject] }
- self.OrderedStringDict = {} #{ u'LanguageIdentifier' : {StringName:(IndexInList)} }
- self.OrderedStringListByToken = {} #{ u'LanguageIdentifier' : {Token: StringDefClassObject} }
- self.IsCompatibleMode = IsCompatibleMode
- self.IncludePathList = IncludePathList
- if len(self.FileList) > 0:
- self.LoadUniFiles(FileList)
-
- #
- # Get Language definition
- #
- def GetLangDef(self, File, Line):
- Lang = distutils.util.split_quoted((Line.split(u"//")[0]))
- if len(Lang) != 3:
- try:
- FileIn = codecs.open(File.Path, mode='rb', encoding='utf-16').read()
- except UnicodeError, X:
- EdkLogger.error("build", FILE_READ_FAILURE, "File read failure: %s" % str(X), ExtraData=File);
- except:
- EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=File);
- LineNo = GetLineNo(FileIn, Line, False)
- EdkLogger.error("Unicode File Parser", PARSER_ERROR, "Wrong language definition",
- ExtraData="""%s\n\t*Correct format is like '#langdef en-US "English"'""" % Line, File = File, Line = LineNo)
- else:
- LangName = GetLanguageCode(Lang[1], self.IsCompatibleMode, self.File)
- LangPrintName = Lang[2]
-
- IsLangInDef = False
- for Item in self.LanguageDef:
- if Item[0] == LangName:
- IsLangInDef = True
- break;
-
- if not IsLangInDef:
- self.LanguageDef.append([LangName, LangPrintName])
-
- #
- # Add language string
- #
- self.AddStringToList(u'$LANGUAGE_NAME', LangName, LangName, 0, True, Index=0)
- self.AddStringToList(u'$PRINTABLE_LANGUAGE_NAME', LangName, LangPrintName, 1, True, Index=1)
-
- if not IsLangInDef:
- #
- # The found STRING tokens will be added into new language string list
- # so that the unique STRING identifier is reserved for all languages in the package list.
- #
- FirstLangName = self.LanguageDef[0][0]
- if LangName != FirstLangName:
- for Index in range (2, len (self.OrderedStringList[FirstLangName])):
- Item = self.OrderedStringList[FirstLangName][Index]
- if Item.UseOtherLangDef != '':
- OtherLang = Item.UseOtherLangDef
- else:
- OtherLang = FirstLangName
- self.OrderedStringList[LangName].append (StringDefClassObject(Item.StringName, '', Item.Referenced, Item.Token, OtherLang))
- self.OrderedStringDict[LangName][Item.StringName] = len(self.OrderedStringList[LangName]) - 1
- return True
-
- #
- # Get String name and value
- #
- def GetStringObject(self, Item):
- Language = ''
- Value = ''
-
- Name = Item.split()[1]
- # Check the string name is the upper character
- if Name != '':
- MatchString = re.match('[A-Z0-9_]+', Name, re.UNICODE)
- if MatchString == None or MatchString.end(0) != len(Name):
- EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid lower case character.' %(Name, self.File))
- LanguageList = Item.split(u'#language ')
- for IndexI in range(len(LanguageList)):
- if IndexI == 0:
- continue
- else:
- Language = LanguageList[IndexI].split()[0]
- Value = LanguageList[IndexI][LanguageList[IndexI].find(u'\"') + len(u'\"') : LanguageList[IndexI].rfind(u'\"')] #.replace(u'\r\n', u'')
- Language = GetLanguageCode(Language, self.IsCompatibleMode, self.File)
- self.AddStringToList(Name, Language, Value)
-
- #
- # Get include file list and load them
- #
- def GetIncludeFile(self, Item, Dir):
- FileName = Item[Item.find(u'#include ') + len(u'#include ') :Item.find(u' ', len(u'#include '))][1:-1]
- self.LoadUniFile(FileName)
-
- #
- # Pre-process before parse .uni file
- #
- def PreProcess(self, File):
- if not os.path.exists(File.Path) or not os.path.isfile(File.Path):
- EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND, ExtraData=File.Path)
-
- try:
- FileIn = codecs.open(File.Path, mode='rb', encoding='utf-16').readlines()
- except UnicodeError, X:
- EdkLogger.error("build", FILE_READ_FAILURE, "File read failure: %s" % str(X), ExtraData=File.Path);
- except:
- EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=File.Path);
-
- Lines = []
- #
- # Use unique identifier
- #
- FindFlag = -1
- LineCount = 0
- for Line in FileIn:
- Line = FileIn[LineCount]
- LineCount += 1
- Line = Line.strip()
- #
- # Ignore comment line and empty line
- #
- if Line == u'' or Line.startswith(u'//'):
- continue
-
- #
- # Process comment embeded in string define lines
- #
- FindFlag = Line.find(u'//')
- if FindFlag != -1:
- Line = Line.replace(Line[FindFlag:], u' ')
- if FileIn[LineCount].strip().startswith('#language'):
- Line = Line + FileIn[LineCount]
- FileIn[LineCount-1] = Line
- FileIn[LineCount] = os.linesep
- LineCount -= 1
- for Index in xrange (LineCount + 1, len (FileIn) - 1):
- if (Index == len(FileIn) -1):
- FileIn[Index] = os.linesep
- else:
- FileIn[Index] = FileIn[Index + 1]
- continue
-
- Line = Line.replace(u'/langdef', u'#langdef')
- Line = Line.replace(u'/string', u'#string')
- Line = Line.replace(u'/language', u'#language')
- Line = Line.replace(u'/include', u'#include')
-
- Line = Line.replace(u'\\\\', u'\u0006')
- Line = Line.replace(UNICODE_WIDE_CHAR, WIDE_CHAR)
- Line = Line.replace(UNICODE_NARROW_CHAR, NARROW_CHAR)
- Line = Line.replace(UNICODE_NON_BREAKING_CHAR, NON_BREAKING_CHAR)
-
- Line = Line.replace(u'\\r\\n', CR + LF)
- Line = Line.replace(u'\\n', CR + LF)
- Line = Line.replace(u'\\r', CR)
- Line = Line.replace(u'\\t', u'\t')
- Line = Line.replace(u'''\"''', u'''"''')
- Line = Line.replace(u'\t', u' ')
- Line = Line.replace(u'\u0006', u'\\')
- Line = Line.replace(DOBULE_QUOTED_SPLASH, u'"')
- Line = Line.replace(SIGLE_QUOTED_SPLASH, u"'")
- Line = Line.replace(TAB_BACK_SLASH, u"/")
-
-# if Line.find(u'\\x'):
-# hex = Line[Line.find(u'\\x') + 2 : Line.find(u'\\x') + 6]
-# hex = "u'\\u" + hex + "'"
-
- IncList = gIncludePattern.findall(Line)
- if len(IncList) == 1:
- for Dir in [File.Dir] + self.IncludePathList:
- IncFile = PathClass(str(IncList[0]), Dir)
- if os.path.isfile(IncFile.Path):
- Lines.extend(self.PreProcess(IncFile))
- break
- else:
- EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND, Message="Cannot find include file", ExtraData=str(IncList[0]))
- continue
-
- Lines.append(Line)
-
- return Lines
-
- #
- # Load a .uni file
- #
- def LoadUniFile(self, File = None):
- if File == None:
- EdkLogger.error("Unicode File Parser", PARSER_ERROR, 'No unicode file is given')
- self.File = File
- #
- # Process special char in file
- #
- Lines = self.PreProcess(File)
-
- #
- # Get Unicode Information
- #
- for IndexI in range(len(Lines)):
- Line = Lines[IndexI]
- if (IndexI + 1) < len(Lines):
- SecondLine = Lines[IndexI + 1]
- if (IndexI + 2) < len(Lines):
- ThirdLine = Lines[IndexI + 2]
-
- #
- # Get Language def information
- #
- if Line.find(u'#langdef ') >= 0:
- self.GetLangDef(File, Line)
- continue
-
- Name = ''
- Language = ''
- Value = ''
- #
- # Get string def information format 1 as below
- #
- # #string MY_STRING_1
- # #language eng
- # My first English string line 1
- # My first English string line 2
- # #string MY_STRING_1
- # #language spa
- # Mi segunda secuencia 1
- # Mi segunda secuencia 2
- #
- if Line.find(u'#string ') >= 0 and Line.find(u'#language ') < 0 and \
- SecondLine.find(u'#string ') < 0 and SecondLine.find(u'#language ') >= 0 and \
- ThirdLine.find(u'#string ') < 0 and ThirdLine.find(u'#language ') < 0:
- Name = Line[Line.find(u'#string ') + len(u'#string ') : ].strip(' ')
- Language = SecondLine[SecondLine.find(u'#language ') + len(u'#language ') : ].strip(' ')
- for IndexJ in range(IndexI + 2, len(Lines)):
- if Lines[IndexJ].find(u'#string ') < 0 and Lines[IndexJ].find(u'#language ') < 0:
- Value = Value + Lines[IndexJ]
- else:
- IndexI = IndexJ
- break
- # Value = Value.replace(u'\r\n', u'')
- Language = GetLanguageCode(Language, self.IsCompatibleMode, self.File)
- # Check the string name is the upper character
- if not self.IsCompatibleMode and Name != '':
- MatchString = re.match('[A-Z0-9_]+', Name, re.UNICODE)
- if MatchString == None or MatchString.end(0) != len(Name):
- EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid lower case character.' %(Name, self.File))
- self.AddStringToList(Name, Language, Value)
- continue
-
- #
- # Get string def information format 2 as below
- #
- # #string MY_STRING_1 #language eng "My first English string line 1"
- # "My first English string line 2"
- # #language spa "Mi segunda secuencia 1"
- # "Mi segunda secuencia 2"
- # #string MY_STRING_2 #language eng "My first English string line 1"
- # "My first English string line 2"
- # #string MY_STRING_2 #language spa "Mi segunda secuencia 1"
- # "Mi segunda secuencia 2"
- #
- if Line.find(u'#string ') >= 0 and Line.find(u'#language ') >= 0:
- StringItem = Line
- for IndexJ in range(IndexI + 1, len(Lines)):
- if Lines[IndexJ].find(u'#string ') >= 0 and Lines[IndexJ].find(u'#language ') >= 0:
- IndexI = IndexJ
- break
- elif Lines[IndexJ].find(u'#string ') < 0 and Lines[IndexJ].find(u'#language ') >= 0:
- StringItem = StringItem + Lines[IndexJ]
- elif Lines[IndexJ].count(u'\"') >= 2:
- StringItem = StringItem[ : StringItem.rfind(u'\"')] + Lines[IndexJ][Lines[IndexJ].find(u'\"') + len(u'\"') : ]
- self.GetStringObject(StringItem)
- continue
-
- #
- # Load multiple .uni files
- #
- def LoadUniFiles(self, FileList):
- if len(FileList) > 0:
- for File in FileList:
- self.LoadUniFile(File)
-
- #
- # Add a string to list
- #
- def AddStringToList(self, Name, Language, Value, Token = None, Referenced = False, UseOtherLangDef = '', Index = -1):
- for LangNameItem in self.LanguageDef:
- if Language == LangNameItem[0]:
- break
- else:
- EdkLogger.error('Unicode File Parser', FORMAT_NOT_SUPPORTED, "The language '%s' for %s is not defined in Unicode file %s." \
- % (Language, Name, self.File))
-
- if Language not in self.OrderedStringList:
- self.OrderedStringList[Language] = []
- self.OrderedStringDict[Language] = {}
-
- IsAdded = True
- if Name in self.OrderedStringDict[Language]:
- IsAdded = False
- if Value != None:
- ItemIndexInList = self.OrderedStringDict[Language][Name]
- Item = self.OrderedStringList[Language][ItemIndexInList]
- Item.UpdateValue(Value)
- Item.UseOtherLangDef = ''
-
- if IsAdded:
- Token = len(self.OrderedStringList[Language])
- if Index == -1:
- self.OrderedStringList[Language].append(StringDefClassObject(Name, Value, Referenced, Token, UseOtherLangDef))
- self.OrderedStringDict[Language][Name] = Token
- for LangName in self.LanguageDef:
- #
- # New STRING token will be added into all language string lists.
- # so that the unique STRING identifier is reserved for all languages in the package list.
- #
- if LangName[0] != Language:
- if UseOtherLangDef != '':
- OtherLangDef = UseOtherLangDef
- else:
- OtherLangDef = Language
- self.OrderedStringList[LangName[0]].append(StringDefClassObject(Name, '', Referenced, Token, OtherLangDef))
- self.OrderedStringDict[LangName[0]][Name] = len(self.OrderedStringList[LangName[0]]) - 1
- else:
- self.OrderedStringList[Language].insert(Index, StringDefClassObject(Name, Value, Referenced, Token, UseOtherLangDef))
- self.OrderedStringDict[Language][Name] = Index
-
- #
- # Set the string as referenced
- #
- def SetStringReferenced(self, Name):
- #
- # String stoken are added in the same order in all language string lists.
- # So, only update the status of string stoken in first language string list.
- #
- Lang = self.LanguageDef[0][0]
- if Name in self.OrderedStringDict[Lang]:
- ItemIndexInList = self.OrderedStringDict[Lang][Name]
- Item = self.OrderedStringList[Lang][ItemIndexInList]
- Item.Referenced = True
-
- #
- # Search the string in language definition by Name
- #
- def FindStringValue(self, Name, Lang):
- if Name in self.OrderedStringDict[Lang]:
- ItemIndexInList = self.OrderedStringDict[Lang][Name]
- return self.OrderedStringList[Lang][ItemIndexInList]
-
- return None
-
- #
- # Search the string in language definition by Token
- #
- def FindByToken(self, Token, Lang):
- for Item in self.OrderedStringList[Lang]:
- if Item.Token == Token:
- return Item
-
- return None
-
- #
- # Re-order strings and re-generate tokens
- #
- def ReToken(self):
- #
- # Retoken all language strings according to the status of string stoken in the first language string.
- #
- FirstLangName = self.LanguageDef[0][0]
-
- # Convert the OrderedStringList to be OrderedStringListByToken in order to faciliate future search by token
- for LangNameItem in self.LanguageDef:
- self.OrderedStringListByToken[LangNameItem[0]] = {}
-
- #
- # Use small token for all referred string stoken.
- #
- RefToken = 0
- for Index in range (0, len (self.OrderedStringList[FirstLangName])):
- FirstLangItem = self.OrderedStringList[FirstLangName][Index]
- if FirstLangItem.Referenced == True:
- for LangNameItem in self.LanguageDef:
- LangName = LangNameItem[0]
- OtherLangItem = self.OrderedStringList[LangName][Index]
- OtherLangItem.Referenced = True
- OtherLangItem.Token = RefToken
- self.OrderedStringListByToken[LangName][OtherLangItem.Token] = OtherLangItem
- RefToken = RefToken + 1
-
- #
- # Use big token for all unreferred string stoken.
- #
- UnRefToken = 0
- for Index in range (0, len (self.OrderedStringList[FirstLangName])):
- FirstLangItem = self.OrderedStringList[FirstLangName][Index]
- if FirstLangItem.Referenced == False:
- for LangNameItem in self.LanguageDef:
- LangName = LangNameItem[0]
- OtherLangItem = self.OrderedStringList[LangName][Index]
- OtherLangItem.Token = RefToken + UnRefToken
- self.OrderedStringListByToken[LangName][OtherLangItem.Token] = OtherLangItem
- UnRefToken = UnRefToken + 1
-
- #
- # Show the instance itself
- #
- def ShowMe(self):
- print self.LanguageDef
- #print self.OrderedStringList
- for Item in self.OrderedStringList:
- print Item
- for Member in self.OrderedStringList[Item]:
- print str(Member)
-
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-if __name__ == '__main__':
- EdkLogger.Initialize()
- EdkLogger.SetLevel(EdkLogger.DEBUG_0)
- a = UniFileClassObject([PathClass("C:\\Edk\\Strings.uni"), PathClass("C:\\Edk\\Strings2.uni")])
- a.ReToken()
- a.ShowMe()
diff --git a/BaseTools/Source/Python/AutoGen/__init__.py b/BaseTools/Source/Python/AutoGen/__init__.py
deleted file mode 100644
index d2de425732..0000000000
--- a/BaseTools/Source/Python/AutoGen/__init__.py
+++ /dev/null
@@ -1,17 +0,0 @@
-## @file
-# Python 'AutoGen' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-__all__ = ["AutoGen"]
diff --git a/BaseTools/Source/Python/BPDG/BPDG.py b/BaseTools/Source/Python/BPDG/BPDG.py
deleted file mode 100644
index 284eed65c7..0000000000
--- a/BaseTools/Source/Python/BPDG/BPDG.py
+++ /dev/null
@@ -1,159 +0,0 @@
-## @file
-# Intel Binary Product Data Generation Tool (Intel BPDG).
-# This tool provide a simple process for the creation of a binary file containing read-only
-# configuration data for EDK II platforms that contain Dynamic and DynamicEx PCDs described
-# in VPD sections. It also provide an option for specifying an alternate name for a mapping
-# file of PCD layout for use during the build when the platform integrator selects to use
-# automatic offset calculation.
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import sys
-import encodings.ascii
-
-from optparse import OptionParser
-from Common import EdkLogger
-from Common.BuildToolError import *
-from Common.BuildVersion import gBUILD_VERSION
-
-import StringTable as st
-import GenVpd
-
-PROJECT_NAME = st.LBL_BPDG_LONG_UNI
-VERSION = (st.LBL_BPDG_VERSION + " " + gBUILD_VERSION)
-
-## Tool entrance method
-#
-# This method mainly dispatch specific methods per the command line options.
-# If no error found, return zero value so the caller of this tool can know
-# if it's executed successfully or not.
-#
-# @retval 0 Tool was successful
-# @retval 1 Tool failed
-#
-def main():
- global Options, Args
-
- # Initialize log system
- EdkLogger.Initialize()
- Options, Args = MyOptionParser()
-
- ReturnCode = 0
-
- if Options.opt_verbose:
- EdkLogger.SetLevel(EdkLogger.VERBOSE)
- elif Options.opt_quiet:
- EdkLogger.SetLevel(EdkLogger.QUIET)
- elif Options.debug_level != None:
- EdkLogger.SetLevel(Options.debug_level + 1)
- else:
- EdkLogger.SetLevel(EdkLogger.INFO)
-
- if Options.bin_filename == None:
- EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -o option to specify the file name for the VPD binary file")
- if Options.filename == None:
- EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -m option to specify the file name for the mapping file")
-
- Force = False
- if Options.opt_force != None:
- Force = True
-
- if (Args[0] != None) :
- StartBpdg(Args[0], Options.filename, Options.bin_filename, Force)
- else :
- EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please specify the file which contain the VPD pcd info.",
- None)
-
- return ReturnCode
-
-
-## Parse command line options
-#
-# Using standard Python module optparse to parse command line option of this tool.
-#
-# @retval options A optparse.Values object containing the parsed options
-# @retval args Target of BPDG command
-#
-def MyOptionParser():
- #
- # Process command line firstly.
- #
- parser = OptionParser(version="%s - Version %s\n" % (PROJECT_NAME, VERSION),
- description='',
- prog='BPDG',
- usage=st.LBL_BPDG_USAGE
- )
- parser.add_option('-d', '--debug', action='store', type="int", dest='debug_level',
- help=st.MSG_OPTION_DEBUG_LEVEL)
- parser.add_option('-v', '--verbose', action='store_true', dest='opt_verbose',
- help=st.MSG_OPTION_VERBOSE)
- parser.add_option('-q', '--quiet', action='store_true', dest='opt_quiet', default=False,
- help=st.MSG_OPTION_QUIET)
- parser.add_option('-o', '--vpd-filename', action='store', dest='bin_filename',
- help=st.MSG_OPTION_VPD_FILENAME)
- parser.add_option('-m', '--map-filename', action='store', dest='filename',
- help=st.MSG_OPTION_MAP_FILENAME)
- parser.add_option('-f', '--force', action='store_true', dest='opt_force',
- help=st.MSG_OPTION_FORCE)
-
- (options, args) = parser.parse_args()
- if len(args) == 0:
- EdkLogger.info("Please specify the filename.txt file which contain the VPD pcd info!")
- EdkLogger.info(parser.usage)
- sys.exit(1)
- return options, args
-
-
-## Start BPDG and call the main functions
-#
-# This method mainly focus on call GenVPD class member functions to complete
-# BPDG's target. It will process VpdFile override, and provide the interface file
-# information.
-#
-# @Param InputFileName The filename include the vpd type pcd information
-# @param MapFileName The filename of map file that stores vpd type pcd information.
-# This file will be generated by the BPDG tool after fix the offset
-# and adjust the offset to make the pcd data aligned.
-# @param VpdFileName The filename of Vpd file that hold vpd pcd information.
-# @param Force Override the exist Vpdfile or not.
-#
-def StartBpdg(InputFileName, MapFileName, VpdFileName, Force):
- if os.path.exists(VpdFileName) and not Force:
- print "\nFile %s already exist, Overwrite(Yes/No)?[Y]: " % VpdFileName
- choice = sys.stdin.readline()
- if choice.strip().lower() not in ['y', 'yes', '']:
- return
-
- GenVPD = GenVpd.GenVPD (InputFileName, MapFileName, VpdFileName)
-
- EdkLogger.info('%-24s = %s' % ("VPD input data file: ", InputFileName))
- EdkLogger.info('%-24s = %s' % ("VPD output map file: ", MapFileName))
- EdkLogger.info('%-24s = %s' % ("VPD output binary file: ", VpdFileName))
-
- GenVPD.ParserInputFile()
- GenVPD.FormatFileLine()
- GenVPD.FixVpdOffset()
- GenVPD.GenerateVpdFile(MapFileName, VpdFileName)
-
- EdkLogger.info("- Vpd pcd fixed done! -")
-
-if __name__ == '__main__':
- r = main()
- ## 0-127 is a safe return range, and 1 is a standard default error
- if r < 0 or r > 127: r = 1
- sys.exit(r)
-
-
diff --git a/BaseTools/Source/Python/BPDG/GenVpd.py b/BaseTools/Source/Python/BPDG/GenVpd.py
deleted file mode 100644
index cc4985062e..0000000000
--- a/BaseTools/Source/Python/BPDG/GenVpd.py
+++ /dev/null
@@ -1,662 +0,0 @@
-## @file
-# This file include GenVpd class for fix the Vpd type PCD offset, and PcdEntry for describe
-# and process each entry of vpd type PCD.
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-import os
-import StringIO
-import StringTable as st
-import array
-import re
-
-from struct import *
-import Common.EdkLogger as EdkLogger
-import Common.BuildToolError as BuildToolError
-
-_FORMAT_CHAR = {1: 'B',
- 2: 'H',
- 4: 'I',
- 8: 'Q'
- }
-
-## The VPD PCD data structure for store and process each VPD PCD entry.
-#
-# This class contain method to format and pack pcd's value.
-#
-class PcdEntry:
- def __init__(self, PcdCName, PcdOffset, PcdSize, PcdValue, Lineno=None, FileName=None, PcdUnpackValue=None,
- PcdBinOffset=None, PcdBinSize=None):
- self.PcdCName = PcdCName.strip()
- self.PcdOffset = PcdOffset.strip()
- self.PcdSize = PcdSize.strip()
- self.PcdValue = PcdValue.strip()
- self.Lineno = Lineno.strip()
- self.FileName = FileName.strip()
- self.PcdUnpackValue = PcdUnpackValue
- self.PcdBinOffset = PcdBinOffset
- self.PcdBinSize = PcdBinSize
-
- if self.PcdValue == '' :
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid PCD format(Name: %s File: %s line: %s) , no Value specified!" %(self.PcdCName, self.FileName, self.Lineno))
-
- if self.PcdOffset == '' :
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid PCD format(Name: %s File: %s Line: %s) , no Offset specified!" %(self.PcdCName, self.FileName, self.Lineno))
-
- if self.PcdSize == '' :
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid PCD format(Name: %s File: %s Line: %s), no PcdSize specified!" %(self.PcdCName, self.FileName, self.Lineno))
-
- self._GenOffsetValue ()
-
- ## Analyze the string value to judge the PCD's datum type euqal to Boolean or not.
- #
- # @param ValueString PCD's value
- # @param Size PCD's size
- #
- # @retval True PCD's datum type is Boolean
- # @retval False PCD's datum type is not Boolean.
- #
- def _IsBoolean(self, ValueString, Size):
- if (Size == "1"):
- if ValueString.upper() in ["TRUE", "FALSE"]:
- return True
- elif ValueString in ["0", "1", "0x0", "0x1", "0x00", "0x01"]:
- return True
-
- return False
-
- ## Convert the PCD's value from string to integer.
- #
- # This function will try to convert the Offset value form string to integer
- # for both hexadecimal and decimal.
- #
- def _GenOffsetValue(self):
- if self.PcdOffset != "*" :
- try:
- self.PcdBinOffset = int (self.PcdOffset)
- except:
- try:
- self.PcdBinOffset = int(self.PcdOffset, 16)
- except:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid offset value %s for PCD %s (File: %s Line: %s)" % (self.PcdOffset, self.PcdCName, self.FileName, self.Lineno))
-
- ## Pack Boolean type VPD PCD's value form string to binary type.
- #
- # @param ValueString The boolean type string for pack.
- #
- #
- def _PackBooleanValue(self, ValueString):
- if ValueString.upper() == "TRUE" or ValueString in ["1", "0x1", "0x01"]:
- try:
- self.PcdValue = pack(_FORMAT_CHAR[1], 1)
- except:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid size or value for PCD %s to pack(File: %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))
- else:
- try:
- self.PcdValue = pack(_FORMAT_CHAR[1], 0)
- except:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid size or value for PCD %s to pack(File: %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))
-
- ## Pack Integer type VPD PCD's value form string to binary type.
- #
- # @param ValueString The Integer type string for pack.
- #
- #
- def _PackIntValue(self, IntValue, Size):
- if Size not in _FORMAT_CHAR.keys():
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid size %d for PCD %s in integer datum size(File: %s Line: %s)." % (Size, self.PcdCName, self.FileName, self.Lineno))
-
- if Size == 1:
- if IntValue < 0:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "PCD can't be set to negative value %d for PCD %s in UINT8 datum type(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
- elif IntValue >= 0x100:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Too large PCD value %d for datum type UINT8 for PCD %s(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
- elif Size == 2:
- if IntValue < 0:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "PCD can't be set to negative value %d for PCD %s in UINT16 datum type(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
- elif IntValue >= 0x10000:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Too large PCD value %d for datum type UINT16 for PCD %s(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
- elif Size == 4:
- if IntValue < 0:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "PCD can't be set to negative value %d for PCD %s in UINT32 datum type(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
- elif IntValue >= 0x100000000:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Too large PCD value %d for datum type UINT32 for PCD %s(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
- elif Size == 8:
- if IntValue < 0:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "PCD can't be set to negative value %d for PCD %s in UINT32 datum type(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
- elif IntValue >= 0x10000000000000000:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Too large PCD value %d for datum type UINT32 for PCD %s(File: %s Line: %s)." % (IntValue, self.PcdCName, self.FileName, self.Lineno))
- else:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid size %d for PCD %s in integer datum size(File: %s Line: %s)." % (Size, self.PcdCName, self.FileName, self.Lineno))
-
- try:
- self.PcdValue = pack(_FORMAT_CHAR[Size], IntValue)
- except:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid size or value for PCD %s to pack(File: %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))
-
- ## Pack VOID* type VPD PCD's value form string to binary type.
- #
- # The VOID* type of string divided into 3 sub-type:
- # 1: L"String", Unicode type string.
- # 2: "String", Ascii type string.
- # 3: {bytearray}, only support byte-array.
- #
- # @param ValueString The Integer type string for pack.
- #
- def _PackPtrValue(self, ValueString, Size):
- if ValueString.startswith('L"'):
- self._PackUnicode(ValueString, Size)
- elif ValueString.startswith('{') and ValueString.endswith('}'):
- self._PackByteArray(ValueString, Size)
- elif ValueString.startswith('"') and ValueString.endswith('"'):
- self._PackString(ValueString, Size)
- else:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid VOID* type PCD %s value %s (File: %s Line: %s)" % (self.PcdCName, ValueString, self.FileName, self.Lineno))
-
- ## Pack an Ascii PCD value.
- #
- # An Ascii string for a PCD should be in format as "".
- #
- def _PackString(self, ValueString, Size):
- if (Size < 0):
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid parameter Size %s of PCD %s!(File: %s Line: %s)" % (self.PcdBinSize, self.PcdCName, self.FileName, self.Lineno))
- if (ValueString == ""):
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid parameter ValueString %s of PCD %s!(File: %s Line: %s)" % (self.PcdUnpackValue, self.PcdCName, self.FileName, self.Lineno))
- if (len(ValueString) < 2):
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "For PCD: %s ,ASCII string %s at least contains two!(File: %s Line: %s)" % (self.PcdCName, self.PcdUnpackValue, self.FileName, self.Lineno))
-
- ValueString = ValueString[1:-1]
- if len(ValueString) + 1 > Size:
- EdkLogger.error("BPDG", BuildToolError.RESOURCE_OVERFLOW,
- "PCD value string %s is exceed to size %d(File: %s Line: %s)" % (ValueString, Size, self.FileName, self.Lineno))
- try:
- self.PcdValue= pack('%ds' % Size, ValueString)
- except:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid size or value for PCD %s to pack(File: %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))
-
- ## Pack a byte-array PCD value.
- #
- # A byte-array for a PCD should be in format as {0x01, 0x02, ...}.
- #
- def _PackByteArray(self, ValueString, Size):
- if (Size < 0):
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid parameter Size %s of PCD %s!(File: %s Line: %s)" % (self.PcdBinSize, self.PcdCName, self.FileName, self.Lineno))
- if (ValueString == ""):
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid parameter ValueString %s of PCD %s!(File: %s Line: %s)" % (self.PcdUnpackValue, self.PcdCName, self.FileName, self.Lineno))
-
- ValueString = ValueString.strip()
- ValueString = ValueString.lstrip('{').strip('}')
- ValueList = ValueString.split(',')
- ValueList = [item.strip() for item in ValueList]
-
- if len(ValueList) > Size:
- EdkLogger.error("BPDG", BuildToolError.RESOURCE_OVERFLOW,
- "The byte array %s is too large for size %d(File: %s Line: %s)" % (ValueString, Size, self.FileName, self.Lineno))
-
- ReturnArray = array.array('B')
-
- for Index in xrange(len(ValueList)):
- Value = None
- if ValueList[Index].lower().startswith('0x'):
- # translate hex value
- try:
- Value = int(ValueList[Index], 16)
- except:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "The value item %s in byte array %s is an invalid HEX value.(File: %s Line: %s)" % \
- (ValueList[Index], ValueString, self.FileName, self.Lineno))
- else:
- # translate decimal value
- try:
- Value = int(ValueList[Index], 10)
- except:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "The value item %s in byte array %s is an invalid DECIMAL value.(File: %s Line: %s)" % \
- (ValueList[Index], ValueString, self.FileName, self.Lineno))
-
- if Value > 255:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "The value item %s in byte array %s do not in range 0 ~ 0xFF(File: %s Line: %s)" %\
- (ValueList[Index], ValueString, self.FileName, self.Lineno))
-
- ReturnArray.append(Value)
-
- for Index in xrange(len(ValueList), Size):
- ReturnArray.append(0)
-
- self.PcdValue = ReturnArray.tolist()
-
- ## Pack a unicode PCD value into byte array.
- #
- # A unicode string for a PCD should be in format as L"".
- #
- def _PackUnicode(self, UnicodeString, Size):
- if (Size < 0):
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid parameter Size %s of PCD %s!(File: %s Line: %s)" %\
- (self.PcdBinSize, self.PcdCName, self.FileName, self.Lineno))
- if (len(UnicodeString) < 3):
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "For PCD: %s ,ASCII string %s at least contains two!(File: %s Line: %s)" %\
- (self.PcdCName, self.PcdUnpackValue, self.FileName, self.Lineno))
-
- UnicodeString = UnicodeString[2:-1]
-
- if (len(UnicodeString) + 1) * 2 > Size:
- EdkLogger.error("BPDG", BuildToolError.RESOURCE_OVERFLOW,
- "The size of unicode string %s is too larger for size %s(File: %s Line: %s)" % \
- (UnicodeString, Size, self.FileName, self.Lineno))
-
- ReturnArray = array.array('B')
- for Value in UnicodeString:
- try:
- ReturnArray.append(ord(Value))
- ReturnArray.append(0)
- except:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,
- "Invalid unicode character %s in unicode string %s(File: %s Line: %s)" % \
- (Value, UnicodeString, self.FileName, self.Lineno))
-
- for Index in range(len(UnicodeString) * 2, Size):
- ReturnArray.append(0)
-
- self.PcdValue = ReturnArray.tolist()
-
-
-
-## The class implementing the BPDG VPD PCD offset fix process
-#
-# The VPD PCD offset fix process includes:
-# 1. Parse the input guided.txt file and store it in the data structure;
-# 2. Format the input file data to remove unused lines;
-# 3. Fixed offset if needed;
-# 4. Generate output file, including guided.map and guided.bin file;
-#
-class GenVPD :
- ## Constructor of DscBuildData
- #
- # Initialize object of GenVPD
- # @Param InputFileName The filename include the vpd type pcd information
- # @param MapFileName The filename of map file that stores vpd type pcd information.
- # This file will be generated by the BPDG tool after fix the offset
- # and adjust the offset to make the pcd data aligned.
- # @param VpdFileName The filename of Vpd file that hold vpd pcd information.
- #
- def __init__(self, InputFileName, MapFileName, VpdFileName):
- self.InputFileName = InputFileName
- self.MapFileName = MapFileName
- self.VpdFileName = VpdFileName
- self.FileLinesList = []
- self.PcdFixedOffsetSizeList = []
- self.PcdUnknownOffsetList = []
- try:
- fInputfile = open(InputFileName, "r", 0)
- try:
- self.FileLinesList = fInputfile.readlines()
- except:
- EdkLogger.error("BPDG", BuildToolError.FILE_READ_FAILURE, "File read failed for %s" %InputFileName,None)
- finally:
- fInputfile.close()
- except:
- EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" %InputFileName,None)
-
- ##
- # Parser the input file which is generated by the build tool. Convert the value of each pcd's
- # from string to it's real format. Also remove the useless line in the input file.
- #
- def ParserInputFile (self):
- count = 0
- for line in self.FileLinesList:
- # Strip "\r\n" generated by readlines ().
- line = line.strip()
- line = line.rstrip(os.linesep)
-
- # Skip the comment line
- if (not line.startswith("#")) and len(line) > 1 :
- #
- # Enhanced for support "|" character in the string.
- #
- ValueList = ['', '', '', '']
-
- ValueRe = re.compile(r'\s*L?\".*\|.*\"\s*$')
- PtrValue = ValueRe.findall(line)
-
- ValueUpdateFlag = False
-
- if len(PtrValue) >= 1:
- line = re.sub(ValueRe, '', line)
- ValueUpdateFlag = True
-
- TokenList = line.split('|')
- ValueList[0:len(TokenList)] = TokenList
-
- if ValueUpdateFlag:
- ValueList[3] = PtrValue[0]
- self.FileLinesList[count] = ValueList
- # Store the line number
- self.FileLinesList[count].append(str(count+1))
- elif len(line) <= 1 :
- # Set the blank line to "None"
- self.FileLinesList[count] = None
- else :
- # Set the comment line to "None"
- self.FileLinesList[count] = None
- count += 1
-
- # The line count contain usage information
- count = 0
- # Delete useless lines
- while (True) :
- try :
- if (self.FileLinesList[count] == None) :
- del(self.FileLinesList[count])
- else :
- count += 1
- except :
- break
- #
- # After remove the useless line, if there are no data remain in the file line list,
- # Report warning messages to user's.
- #
- if len(self.FileLinesList) == 0 :
- EdkLogger.warn('BPDG', BuildToolError.RESOURCE_NOT_AVAILABLE,
- "There are no VPD type pcds defined in DSC file, Please check it.")
-
- # Process the pcds one by one base on the pcd's value and size
- count = 0
- for line in self.FileLinesList:
- if line != None :
- PCD = PcdEntry(line[0], line[1], line[2], line[3], line[4], self.InputFileName)
- # Strip the space char
- PCD.PcdCName = PCD.PcdCName.strip(' ')
- PCD.PcdOffset = PCD.PcdOffset.strip(' ')
- PCD.PcdSize = PCD.PcdSize.strip(' ')
- PCD.PcdValue = PCD.PcdValue.strip(' ')
- PCD.Lineno = PCD.Lineno.strip(' ')
-
- #
- # Store the original pcd value.
- # This information will be useful while generate the output map file.
- #
- PCD.PcdUnpackValue = str(PCD.PcdValue)
-
- #
- # Translate PCD size string to an integer value.
- PackSize = None
- try:
- PackSize = int(PCD.PcdSize, 10)
- PCD.PcdBinSize = PackSize
- except:
- try:
- PackSize = int(PCD.PcdSize, 16)
- PCD.PcdBinSize = PackSize
- except:
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid PCD size value %s at file: %s line: %s" % (PCD.PcdSize, self.InputFileName, PCD.Lineno))
-
- if PCD._IsBoolean(PCD.PcdValue, PCD.PcdSize):
- PCD._PackBooleanValue(PCD.PcdValue)
- self.FileLinesList[count] = PCD
- count += 1
- continue
- #
- # Try to translate value to an integer firstly.
- #
- IsInteger = True
- PackValue = None
- try:
- PackValue = int(PCD.PcdValue)
- except:
- try:
- PackValue = int(PCD.PcdValue, 16)
- except:
- IsInteger = False
-
- if IsInteger:
- PCD._PackIntValue(PackValue, PackSize)
- else:
- PCD._PackPtrValue(PCD.PcdValue, PackSize)
-
- self.FileLinesList[count] = PCD
- count += 1
- else :
- continue
-
- ##
- # This function used to create a clean list only contain useful information and reorganized to make it
- # easy to be sorted
- #
- def FormatFileLine (self) :
-
- for eachPcd in self.FileLinesList :
- if eachPcd.PcdOffset != '*' :
- # Use pcd's Offset value as key, and pcd's Value as value
- self.PcdFixedOffsetSizeList.append(eachPcd)
- else :
- # Use pcd's CName as key, and pcd's Size as value
- self.PcdUnknownOffsetList.append(eachPcd)
-
-
- ##
- # This function is use to fix the offset value which the not specified in the map file.
- # Usually it use the star (meaning any offset) character in the offset field
- #
- def FixVpdOffset (self):
- # At first, the offset should start at 0
- # Sort fixed offset list in order to find out where has free spaces for the pcd's offset
- # value is "*" to insert into.
-
- self.PcdFixedOffsetSizeList.sort(lambda x,y: cmp(x.PcdBinOffset, y.PcdBinOffset))
-
- #
- # Sort the un-fixed pcd's offset by it's size.
- #
- self.PcdUnknownOffsetList.sort(lambda x,y: cmp(x.PcdBinSize, y.PcdBinSize))
-
- #
- # Process all Offset value are "*"
- #
- if (len(self.PcdFixedOffsetSizeList) == 0) and (len(self.PcdUnknownOffsetList) != 0) :
- # The offset start from 0
- NowOffset = 0
- for Pcd in self.PcdUnknownOffsetList :
- Pcd.PcdBinOffset = NowOffset
- Pcd.PcdOffset = str(hex(Pcd.PcdBinOffset))
- NowOffset += Pcd.PcdBinSize
-
- self.PcdFixedOffsetSizeList = self.PcdUnknownOffsetList
- return
-
- # Check the offset of VPD type pcd's offset start from 0.
- if self.PcdFixedOffsetSizeList[0].PcdBinOffset != 0 :
- EdkLogger.warn("BPDG", "The offset of VPD type pcd should start with 0, please check it.",
- None)
-
- # Judge whether the offset in fixed pcd offset list is overlapped or not.
- lenOfList = len(self.PcdFixedOffsetSizeList)
- count = 0
- while (count < lenOfList - 1) :
- PcdNow = self.PcdFixedOffsetSizeList[count]
- PcdNext = self.PcdFixedOffsetSizeList[count+1]
- # Two pcd's offset is same
- if PcdNow.PcdBinOffset == PcdNext.PcdBinOffset :
- EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_GET_FAILURE,
- "The offset of %s at line: %s is same with %s at line: %s in file %s" %\
- (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.PcdCName, PcdNext.Lineno, PcdNext.FileName),
- None)
-
- # Overlapped
- if PcdNow.PcdBinOffset + PcdNow.PcdBinSize > PcdNext.PcdBinOffset :
- EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_GET_FAILURE,
- "The offset of %s at line: %s is overlapped with %s at line: %s in file %s" %\
- (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.PcdCName, PcdNext.Lineno, PcdNext.FileName),
- None)
-
- # Has free space, raise a warning message
- if PcdNow.PcdBinOffset + PcdNow.PcdBinSize < PcdNext.PcdBinOffset :
- EdkLogger.warn("BPDG", BuildToolError.ATTRIBUTE_GET_FAILURE,
- "The offsets have free space of between %s at line: %s and %s at line: %s in file %s" %\
- (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.PcdCName, PcdNext.Lineno, PcdNext.FileName),
- None)
- count += 1
-
- LastOffset = self.PcdFixedOffsetSizeList[0].PcdBinOffset
- FixOffsetSizeListCount = 0
- lenOfList = len(self.PcdFixedOffsetSizeList)
- lenOfUnfixedList = len(self.PcdUnknownOffsetList)
-
- ##
- # Insert the un-fixed offset pcd's list into fixed offset pcd's list if has free space between those pcds.
- #
- while (FixOffsetSizeListCount < lenOfList) :
-
- eachFixedPcd = self.PcdFixedOffsetSizeList[FixOffsetSizeListCount]
- NowOffset = eachFixedPcd.PcdBinOffset
-
- # Has free space
- if LastOffset < NowOffset :
- if lenOfUnfixedList != 0 :
- countOfUnfixedList = 0
- while(countOfUnfixedList < lenOfUnfixedList) :
- eachUnfixedPcd = self.PcdUnknownOffsetList[countOfUnfixedList]
- needFixPcdSize = eachUnfixedPcd.PcdBinSize
- # Not been fixed
- if eachUnfixedPcd.PcdOffset == '*' :
- # The offset un-fixed pcd can write into this free space
- if needFixPcdSize <= (NowOffset - LastOffset) :
- # Change the offset value of un-fixed pcd
- eachUnfixedPcd.PcdOffset = str(hex(LastOffset))
- eachUnfixedPcd.PcdBinOffset = LastOffset
- # Insert this pcd into fixed offset pcd list.
- self.PcdFixedOffsetSizeList.insert(FixOffsetSizeListCount,eachUnfixedPcd)
-
- # Delete the item's offset that has been fixed and added into fixed offset list
- self.PcdUnknownOffsetList.pop(countOfUnfixedList)
-
- # After item added, should enlarge the length of fixed pcd offset list
- lenOfList += 1
- FixOffsetSizeListCount += 1
-
- # Decrease the un-fixed pcd offset list's length
- lenOfUnfixedList -= 1
-
- # Modify the last offset value
- LastOffset += needFixPcdSize
- else :
- # It can not insert into those two pcds, need to check still has other space can store it.
- LastOffset = NowOffset + self.PcdFixedOffsetSizeList[FixOffsetSizeListCount].PcdBinSize
- FixOffsetSizeListCount += 1
- break
-
- # Set the FixOffsetSizeListCount = lenOfList for quit the loop
- else :
- FixOffsetSizeListCount = lenOfList
-
- # No free space, smoothly connect with previous pcd.
- elif LastOffset == NowOffset :
- LastOffset = NowOffset + eachFixedPcd.PcdBinSize
- FixOffsetSizeListCount += 1
- # Usually it will not enter into this thunk, if so, means it overlapped.
- else :
- EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_NOT_AVAILABLE,
- "The offset value definition has overlapped at pcd: %s, it's offset is: %s, in file: %s line: %s" %\
- (eachFixedPcd.PcdCName, eachFixedPcd.PcdOffset, eachFixedPcd.InputFileName, eachFixedPcd.Lineno),
- None)
- FixOffsetSizeListCount += 1
-
- # Continue to process the un-fixed offset pcd's list, add this time, just append them behind the fixed pcd's offset list.
- lenOfUnfixedList = len(self.PcdUnknownOffsetList)
- lenOfList = len(self.PcdFixedOffsetSizeList)
- while (lenOfUnfixedList > 0) :
- # Still has items need to process
- # The last pcd instance
- LastPcd = self.PcdFixedOffsetSizeList[lenOfList-1]
- NeedFixPcd = self.PcdUnknownOffsetList[0]
-
- NeedFixPcd.PcdBinOffset = LastPcd.PcdBinOffset + LastPcd.PcdBinSize
- NeedFixPcd.PcdOffset = str(hex(NeedFixPcd.PcdBinOffset))
-
- # Insert this pcd into fixed offset pcd list's tail.
- self.PcdFixedOffsetSizeList.insert(lenOfList, NeedFixPcd)
- # Delete the item's offset that has been fixed and added into fixed offset list
- self.PcdUnknownOffsetList.pop(0)
-
- lenOfList += 1
- lenOfUnfixedList -= 1
- ##
- # Write the final data into output files.
- #
- def GenerateVpdFile (self, MapFileName, BinFileName):
- #Open an VPD file to process
-
- try:
- fVpdFile = open (BinFileName, "wb", 0)
- except:
- # Open failed
- EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" %self.VpdFileName,None)
-
- try :
- fMapFile = open (MapFileName, "w", 0)
- except:
- # Open failed
- EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "File open failed for %s" %self.MapFileName,None)
-
- # Use a instance of StringIO to cache data
- fStringIO = StringIO.StringIO('')
-
- # Write the header of map file.
- try :
- fMapFile.write (st.MAP_FILE_COMMENT_TEMPLATE + "\n")
- except:
- EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %self.MapFileName,None)
-
- for eachPcd in self.PcdFixedOffsetSizeList :
- # write map file
- try :
- fMapFile.write("%s | %s | %s | %s \n" % (eachPcd.PcdCName, eachPcd.PcdOffset, eachPcd.PcdSize,eachPcd.PcdUnpackValue))
- except:
- EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %self.MapFileName,None)
-
- # Write Vpd binary file
- fStringIO.seek (eachPcd.PcdBinOffset)
- if isinstance(eachPcd.PcdValue, list):
- ValueList = [chr(Item) for Item in eachPcd.PcdValue]
- fStringIO.write(''.join(ValueList))
- else:
- fStringIO.write (eachPcd.PcdValue)
-
- try :
- fVpdFile.write (fStringIO.getvalue())
- except:
- EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %self.VpdFileName,None)
-
- fStringIO.close ()
- fVpdFile.close ()
- fMapFile.close ()
-
diff --git a/BaseTools/Source/Python/BPDG/StringTable.py b/BaseTools/Source/Python/BPDG/StringTable.py
deleted file mode 100644
index a661da0f94..0000000000
--- a/BaseTools/Source/Python/BPDG/StringTable.py
+++ /dev/null
@@ -1,78 +0,0 @@
-## @file
-# This file is used to define strings used in the BPDG tool
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-##
-
-
-#string table starts here...
-
-#strings are classified as following types
-# MSG_...: it is a message string
-# ERR_...: it is a error string
-# WRN_...: it is a warning string
-# LBL_...: it is a UI label (window title, control label, etc.)
-# MNU_...: it is a menu item label
-# HLP_...: it is a help string
-# CFG_...: it is a config string used in module. Do not need to translate it.
-# XRC_...: it is a user visible string from xrc file
-
-MAP_FILE_COMMENT_TEMPLATE = \
-"""
-## @file
-#
-# THIS IS AUTO-GENERATED FILE BY BPDG TOOLS AND PLEASE DO NOT MAKE MODIFICATION.
-#
-# This file lists all VPD informations for a platform fixed/adjusted by BPDG tool.
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-"""
-
-
-
-LBL_BPDG_LONG_UNI = (u"Intel(r) Binary Product Data Generation Tool (Intel(r) BPDG)")
-LBL_BPDG_VERSION = (u"0.1")
-LBL_BPDG_USAGE = \
-(
-"""
-BPDG options -o Filename.bin -m Filename.map Filename.txt
-Intel(r) Binary Product Data Generation Tool (Intel(r) BPDG)
-Copyright (c) 2010 Intel Corporation All Rights Reserved.
-
-Required Flags:
- -o BIN_FILENAME, --vpd-filename=BIN_FILENAME
- Specify the file name for the VPD binary file
- -m FILENAME, --map-filename=FILENAME
- Generate file name for consumption during the build that contains
- the mapping of Pcd name, offset, datum size and value derived
- from the input file and any automatic calculations.
-"""
-)
-
-MSG_OPTION_HELP = ("Show this help message and exit.")
-MSG_OPTION_DEBUG_LEVEL = ("Print DEBUG statements, where DEBUG_LEVEL is 0-9.")
-MSG_OPTION_VERBOSE = ("Print informational statements.")
-MSG_OPTION_QUIET = ("Returns the exit code and will display only error messages.")
-MSG_OPTION_VPD_FILENAME = ("Specify the file name for the VPD binary file.")
-MSG_OPTION_MAP_FILENAME = ("Generate file name for consumption during the build that contains the mapping of Pcd name, offset, datum size and value derived from the input file and any automatic calculations.")
-MSG_OPTION_FORCE = ("Will force overwriting existing output files rather than returning an error message.")
-
-ERR_INVALID_DEBUG_LEVEL = ("Invalid level for debug message. Only "
- "'DEBUG', 'INFO', 'WARNING', 'ERROR', "
- "'CRITICAL' are supported for debugging "
- "messages.")
diff --git a/BaseTools/Source/Python/BPDG/__init__.py b/BaseTools/Source/Python/BPDG/__init__.py
deleted file mode 100644
index 358945c063..0000000000
--- a/BaseTools/Source/Python/BPDG/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'BPDG' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/Common/BuildToolError.py b/BaseTools/Source/Python/Common/BuildToolError.py
deleted file mode 100644
index 4d4e07bd70..0000000000
--- a/BaseTools/Source/Python/Common/BuildToolError.py
+++ /dev/null
@@ -1,154 +0,0 @@
-## @file
-# Standardized Error Hanlding infrastructures.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-FILE_OPEN_FAILURE = 1
-FILE_WRITE_FAILURE = 2
-FILE_PARSE_FAILURE = 3
-FILE_READ_FAILURE = 4
-FILE_CREATE_FAILURE = 5
-FILE_CHECKSUM_FAILURE = 6
-FILE_COMPRESS_FAILURE = 7
-FILE_DECOMPRESS_FAILURE = 8
-FILE_MOVE_FAILURE = 9
-FILE_DELETE_FAILURE = 10
-FILE_COPY_FAILURE = 11
-FILE_POSITIONING_FAILURE = 12
-FILE_ALREADY_EXIST = 13
-FILE_NOT_FOUND = 14
-FILE_TYPE_MISMATCH = 15
-FILE_CASE_MISMATCH = 16
-FILE_DUPLICATED = 17
-FILE_UNKNOWN_ERROR = 0x0FFF
-
-OPTION_UNKNOWN = 0x1000
-OPTION_MISSING = 0x1001
-OPTION_CONFLICT = 0x1002
-OPTION_VALUE_INVALID = 0x1003
-OPTION_DEPRECATED = 0x1004
-OPTION_NOT_SUPPORTED = 0x1005
-OPTION_UNKNOWN_ERROR = 0x1FFF
-
-PARAMETER_INVALID = 0x2000
-PARAMETER_MISSING = 0x2001
-PARAMETER_UNKNOWN_ERROR =0x2FFF
-
-FORMAT_INVALID = 0x3000
-FORMAT_NOT_SUPPORTED = 0x3001
-FORMAT_UNKNOWN = 0x3002
-FORMAT_UNKNOWN_ERROR = 0x3FFF
-
-RESOURCE_NOT_AVAILABLE = 0x4000
-RESOURCE_ALLOCATE_FAILURE = 0x4001
-RESOURCE_FULL = 0x4002
-RESOURCE_OVERFLOW = 0x4003
-RESOURCE_UNDERRUN = 0x4004
-RESOURCE_UNKNOWN_ERROR = 0x4FFF
-
-ATTRIBUTE_NOT_AVAILABLE = 0x5000
-ATTRIBUTE_GET_FAILURE = 0x5001
-ATTRIBUTE_SET_FAILURE = 0x5002
-ATTRIBUTE_UPDATE_FAILURE = 0x5003
-ATTRIBUTE_ACCESS_DENIED = 0x5004
-ATTRIBUTE_UNKNOWN_ERROR = 0x5FFF
-
-IO_NOT_READY = 0x6000
-IO_BUSY = 0x6001
-IO_TIMEOUT = 0x6002
-IO_UNKNOWN_ERROR = 0x6FFF
-
-COMMAND_FAILURE = 0x7000
-
-PERMISSION_FAILURE = 0x8000
-
-CODE_ERROR = 0xC0DE
-
-AUTOGEN_ERROR = 0xF000
-PARSER_ERROR = 0xF001
-BUILD_ERROR = 0xF002
-GENFDS_ERROR = 0xF003
-ECC_ERROR = 0xF004
-EOT_ERROR = 0xF005
-DDC_ERROR = 0xF009
-WARNING_AS_ERROR = 0xF006
-MIGRATION_ERROR = 0xF010
-ABORT_ERROR = 0xFFFE
-UNKNOWN_ERROR = 0xFFFF
-
-## Error message of each error code
-gErrorMessage = {
- FILE_NOT_FOUND : "File/directory not found in workspace",
- FILE_OPEN_FAILURE : "File open failure",
- FILE_WRITE_FAILURE : "File write failure",
- FILE_PARSE_FAILURE : "File parse failure",
- FILE_READ_FAILURE : "File read failure",
- FILE_CREATE_FAILURE : "File create failure",
- FILE_CHECKSUM_FAILURE : "Invalid checksum of file",
- FILE_COMPRESS_FAILURE : "File compress failure",
- FILE_DECOMPRESS_FAILURE : "File decompress failure",
- FILE_MOVE_FAILURE : "File move failure",
- FILE_DELETE_FAILURE : "File delete failure",
- FILE_COPY_FAILURE : "File copy failure",
- FILE_POSITIONING_FAILURE: "Failed to seeking position",
- FILE_ALREADY_EXIST : "File or directory already exists",
- FILE_TYPE_MISMATCH : "Incorrect file type",
- FILE_CASE_MISMATCH : "File name case mismatch",
- FILE_DUPLICATED : "Duplicated file found",
- FILE_UNKNOWN_ERROR : "Unknown error encountered on file",
-
- OPTION_UNKNOWN : "Unknown option",
- OPTION_MISSING : "Missing option",
- OPTION_CONFLICT : "Conflict options",
- OPTION_VALUE_INVALID : "Invalid value of option",
- OPTION_DEPRECATED : "Deprecated option",
- OPTION_NOT_SUPPORTED : "Unsupported option",
- OPTION_UNKNOWN_ERROR : "Unknown error when processing options",
-
- PARAMETER_INVALID : "Invalid parameter",
- PARAMETER_MISSING : "Missing parameter",
- PARAMETER_UNKNOWN_ERROR : "Unknown error in parameters",
-
- FORMAT_INVALID : "Invalid syntax/format",
- FORMAT_NOT_SUPPORTED : "Not supported syntax/format",
- FORMAT_UNKNOWN : "Unknown format",
- FORMAT_UNKNOWN_ERROR : "Unknown error in syntax/format ",
-
- RESOURCE_NOT_AVAILABLE : "Not available",
- RESOURCE_ALLOCATE_FAILURE : "Allocate failure",
- RESOURCE_FULL : "Full",
- RESOURCE_OVERFLOW : "Overflow",
- RESOURCE_UNDERRUN : "Underrun",
- RESOURCE_UNKNOWN_ERROR : "Unknown error",
-
- ATTRIBUTE_NOT_AVAILABLE : "Not available",
- ATTRIBUTE_GET_FAILURE : "Failed to retrieve",
- ATTRIBUTE_SET_FAILURE : "Failed to set",
- ATTRIBUTE_UPDATE_FAILURE: "Failed to update",
- ATTRIBUTE_ACCESS_DENIED : "Access denied",
- ATTRIBUTE_UNKNOWN_ERROR : "Unknown error when accessing",
-
- COMMAND_FAILURE : "Failed to execute command",
-
- IO_NOT_READY : "Not ready",
- IO_BUSY : "Busy",
- IO_TIMEOUT : "Timeout",
- IO_UNKNOWN_ERROR : "Unknown error in IO operation",
-
- UNKNOWN_ERROR : "Unknown error",
-}
-
-## Exception indicating a fatal error
-class FatalError(Exception):
- pass
-
-if __name__ == "__main__":
- pass
diff --git a/BaseTools/Source/Python/Common/BuildVersion.py b/BaseTools/Source/Python/Common/BuildVersion.py
deleted file mode 100644
index 7414d30f49..0000000000
--- a/BaseTools/Source/Python/Common/BuildVersion.py
+++ /dev/null
@@ -1,16 +0,0 @@
-## @file
-#
-# This file is for build version number auto generation
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-gBUILD_VERSION = ""
diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/Python/Common/DataType.py
deleted file mode 100644
index 3a82362100..0000000000
--- a/BaseTools/Source/Python/Common/DataType.py
+++ /dev/null
@@ -1,497 +0,0 @@
-## @file
-# This file is used to define common static strings used by INF/DEC/DSC files
-#
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
-# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-##
-# Common Definitions
-#
-TAB_SPLIT = '.'
-TAB_COMMENT_EDK_START = '/*'
-TAB_COMMENT_EDK_END = '*/'
-TAB_COMMENT_EDK_SPLIT = '//'
-TAB_COMMENT_SPLIT = '#'
-TAB_SPECIAL_COMMENT = '##'
-TAB_EQUAL_SPLIT = '='
-TAB_VALUE_SPLIT = '|'
-TAB_COMMA_SPLIT = ','
-TAB_SPACE_SPLIT = ' '
-TAB_SEMI_COLON_SPLIT = ';'
-TAB_SECTION_START = '['
-TAB_SECTION_END = ']'
-TAB_OPTION_START = '<'
-TAB_OPTION_END = '>'
-TAB_SLASH = '\\'
-TAB_BACK_SLASH = '/'
-TAB_LINE_BREAK = '\n'
-TAB_PRINTCHAR_VT = '\x0b'
-TAB_PRINTCHAR_BS = '\b'
-TAB_PRINTCHAR_NUL = '\0'
-TAB_UINT8 = 'UINT8'
-TAB_UINT16 = 'UINT16'
-TAB_UINT32 = 'UINT32'
-TAB_UINT64 = 'UINT64'
-TAB_VOID = 'VOID*'
-
-TAB_EDK_SOURCE = '$(EDK_SOURCE)'
-TAB_EFI_SOURCE = '$(EFI_SOURCE)'
-TAB_WORKSPACE = '$(WORKSPACE)'
-
-TAB_ARCH_NULL = ''
-TAB_ARCH_COMMON = 'COMMON'
-TAB_ARCH_IA32 = 'IA32'
-TAB_ARCH_X64 = 'X64'
-TAB_ARCH_IPF = 'IPF'
-TAB_ARCH_ARM = 'ARM'
-TAB_ARCH_EBC = 'EBC'
-TAB_ARCH_AARCH64 = 'AARCH64'
-
-ARCH_LIST = [TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM, TAB_ARCH_EBC, TAB_ARCH_AARCH64]
-ARCH_LIST_FULL = [TAB_ARCH_COMMON] + ARCH_LIST
-
-SUP_MODULE_BASE = 'BASE'
-SUP_MODULE_SEC = 'SEC'
-SUP_MODULE_PEI_CORE = 'PEI_CORE'
-SUP_MODULE_PEIM = 'PEIM'
-SUP_MODULE_DXE_CORE = 'DXE_CORE'
-SUP_MODULE_DXE_DRIVER = 'DXE_DRIVER'
-SUP_MODULE_DXE_RUNTIME_DRIVER = 'DXE_RUNTIME_DRIVER'
-SUP_MODULE_DXE_SAL_DRIVER = 'DXE_SAL_DRIVER'
-SUP_MODULE_DXE_SMM_DRIVER = 'DXE_SMM_DRIVER'
-SUP_MODULE_UEFI_DRIVER = 'UEFI_DRIVER'
-SUP_MODULE_UEFI_APPLICATION = 'UEFI_APPLICATION'
-SUP_MODULE_USER_DEFINED = 'USER_DEFINED'
-SUP_MODULE_SMM_CORE = 'SMM_CORE'
-
-SUP_MODULE_LIST = [SUP_MODULE_BASE, SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM, SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DRIVER, \
- SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVER, SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_UEFI_DRIVER, \
- SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED, SUP_MODULE_SMM_CORE]
-SUP_MODULE_LIST_STRING = TAB_VALUE_SPLIT.join(l for l in SUP_MODULE_LIST)
-
-EDK_COMPONENT_TYPE_LIBRARY = 'LIBRARY'
-EDK_COMPONENT_TYPE_SECUARITY_CORE = 'SECUARITY_CORE'
-EDK_COMPONENT_TYPE_PEI_CORE = 'PEI_CORE'
-EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER = 'COMBINED_PEIM_DRIVER'
-EDK_COMPONENT_TYPE_PIC_PEIM = 'PIC_PEIM'
-EDK_COMPONENT_TYPE_RELOCATABLE_PEIM = 'RELOCATABLE_PEIM'
-EDK_COMPONENT_TYPE_BS_DRIVER = 'BS_DRIVER'
-EDK_COMPONENT_TYPE_RT_DRIVER = 'RT_DRIVER'
-EDK_COMPONENT_TYPE_SAL_RT_DRIVER = 'SAL_RT_DRIVER'
-EDK_COMPONENT_TYPE_APPLICATION = 'APPLICATION'
-EDK_NAME = 'EDK'
-EDKII_NAME = 'EDKII'
-
-BINARY_FILE_TYPE_FW = 'FW'
-BINARY_FILE_TYPE_GUID = 'GUID'
-BINARY_FILE_TYPE_PREEFORM = 'PREEFORM'
-BINARY_FILE_TYPE_UEFI_APP = 'UEFI_APP'
-BINARY_FILE_TYPE_UNI_UI = 'UNI_UI'
-BINARY_FILE_TYPE_UNI_VER = 'UNI_VER'
-BINARY_FILE_TYPE_LIB = 'LIB'
-BINARY_FILE_TYPE_PE32 = 'PE32'
-BINARY_FILE_TYPE_PIC = 'PIC'
-BINARY_FILE_TYPE_PEI_DEPEX = 'PEI_DEPEX'
-BINARY_FILE_TYPE_DXE_DEPEX = 'DXE_DEPEX'
-BINARY_FILE_TYPE_SMM_DEPEX = 'SMM_DEPEX'
-BINARY_FILE_TYPE_TE = 'TE'
-BINARY_FILE_TYPE_VER = 'VER'
-BINARY_FILE_TYPE_UI = 'UI'
-BINARY_FILE_TYPE_BIN = 'BIN'
-BINARY_FILE_TYPE_FV = 'FV'
-
-PLATFORM_COMPONENT_TYPE_LIBRARY = 'LIBRARY'
-PLATFORM_COMPONENT_TYPE_LIBRARY_CLASS = 'LIBRARY_CLASS'
-PLATFORM_COMPONENT_TYPE_MODULE = 'MODULE'
-
-TAB_LIBRARIES = 'Libraries'
-
-TAB_SOURCES = 'Sources'
-TAB_SOURCES_COMMON = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_SOURCES_IA32 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_SOURCES_X64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_X64
-TAB_SOURCES_IPF = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_SOURCES_ARM = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_SOURCES_EBC = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_SOURCES_AARCH64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_BINARIES = 'Binaries'
-TAB_BINARIES_COMMON = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_BINARIES_IA32 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_BINARIES_X64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_X64
-TAB_BINARIES_IPF = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_BINARIES_ARM = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_BINARIES_EBC = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_BINARIES_AARCH64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_INCLUDES = 'Includes'
-TAB_INCLUDES_COMMON = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_INCLUDES_IA32 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_INCLUDES_X64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_X64
-TAB_INCLUDES_IPF = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_INCLUDES_ARM = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_INCLUDES_EBC = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_INCLUDES_AARCH64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_GUIDS = 'Guids'
-TAB_GUIDS_COMMON = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_GUIDS_IA32 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_IA32
-TAB_GUIDS_X64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_X64
-TAB_GUIDS_IPF = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_IPF
-TAB_GUIDS_ARM = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_ARM
-TAB_GUIDS_EBC = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_EBC
-TAB_GUIDS_AARCH64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PROTOCOLS = 'Protocols'
-TAB_PROTOCOLS_COMMON = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PROTOCOLS_IA32 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PROTOCOLS_X64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_X64
-TAB_PROTOCOLS_IPF = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PROTOCOLS_ARM = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PROTOCOLS_EBC = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PROTOCOLS_AARCH64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PPIS = 'Ppis'
-TAB_PPIS_COMMON = TAB_PPIS + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PPIS_IA32 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PPIS_X64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_X64
-TAB_PPIS_IPF = TAB_PPIS + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PPIS_ARM = TAB_PPIS + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PPIS_EBC = TAB_PPIS + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PPIS_AARCH64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_LIBRARY_CLASSES = 'LibraryClasses'
-TAB_LIBRARY_CLASSES_COMMON = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_LIBRARY_CLASSES_IA32 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_LIBRARY_CLASSES_X64 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_X64
-TAB_LIBRARY_CLASSES_IPF = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_LIBRARY_CLASSES_ARM = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_LIBRARY_CLASSES_EBC = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_LIBRARY_CLASSES_AARCH64 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PACKAGES = 'Packages'
-TAB_PACKAGES_COMMON = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PACKAGES_IA32 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PACKAGES_X64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_X64
-TAB_PACKAGES_IPF = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PACKAGES_ARM = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PACKAGES_EBC = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PACKAGES_AARCH64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PCDS = 'Pcds'
-TAB_PCDS_FIXED_AT_BUILD = 'FixedAtBuild'
-TAB_PCDS_PATCHABLE_IN_MODULE = 'PatchableInModule'
-TAB_PCDS_FEATURE_FLAG = 'FeatureFlag'
-TAB_PCDS_DYNAMIC_EX = 'DynamicEx'
-TAB_PCDS_DYNAMIC_EX_DEFAULT = 'DynamicExDefault'
-TAB_PCDS_DYNAMIC_EX_VPD = 'DynamicExVpd'
-TAB_PCDS_DYNAMIC_EX_HII = 'DynamicExHii'
-TAB_PCDS_DYNAMIC = 'Dynamic'
-TAB_PCDS_DYNAMIC_DEFAULT = 'DynamicDefault'
-TAB_PCDS_DYNAMIC_VPD = 'DynamicVpd'
-TAB_PCDS_DYNAMIC_HII = 'DynamicHii'
-
-PCD_DYNAMIC_TYPE_LIST = [TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_DEFAULT, TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_HII]
-PCD_DYNAMIC_EX_TYPE_LIST = [TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFAULT, TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII]
-
-## Dynamic-ex PCD types
-gDynamicExPcd = [TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFAULT, TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII]
-
-TAB_PCDS_FIXED_AT_BUILD_NULL = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD
-TAB_PCDS_FIXED_AT_BUILD_COMMON = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PCDS_FIXED_AT_BUILD_IA32 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PCDS_FIXED_AT_BUILD_X64 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_X64
-TAB_PCDS_FIXED_AT_BUILD_IPF = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PCDS_FIXED_AT_BUILD_ARM = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PCDS_FIXED_AT_BUILD_EBC = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PCDS_FIXED_AT_BUILD_AARCH64 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PCDS_PATCHABLE_IN_MODULE_NULL = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE
-TAB_PCDS_PATCHABLE_IN_MODULE_COMMON = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PCDS_PATCHABLE_IN_MODULE_IA32 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PCDS_PATCHABLE_IN_MODULE_X64 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_X64
-TAB_PCDS_PATCHABLE_IN_MODULE_IPF = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PCDS_PATCHABLE_IN_MODULE_ARM = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PCDS_PATCHABLE_IN_MODULE_EBC = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PCDS_PATCHABLE_IN_MODULE_AARCH64 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PCDS_FEATURE_FLAG_NULL = TAB_PCDS + TAB_PCDS_FEATURE_FLAG
-TAB_PCDS_FEATURE_FLAG_COMMON = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PCDS_FEATURE_FLAG_IA32 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PCDS_FEATURE_FLAG_X64 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_X64
-TAB_PCDS_FEATURE_FLAG_IPF = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PCDS_FEATURE_FLAG_ARM = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PCDS_FEATURE_FLAG_EBC = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PCDS_FEATURE_FLAG_AARCH64 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PCDS_DYNAMIC_EX_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX
-TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_DEFAULT
-TAB_PCDS_DYNAMIC_EX_HII_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_HII
-TAB_PCDS_DYNAMIC_EX_VPD_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_VPD
-TAB_PCDS_DYNAMIC_EX_COMMON = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PCDS_DYNAMIC_EX_IA32 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PCDS_DYNAMIC_EX_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_X64
-TAB_PCDS_DYNAMIC_EX_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PCDS_DYNAMIC_EX_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PCDS_DYNAMIC_EX_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PCDS_DYNAMIC_EX_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PCDS_DYNAMIC_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC
-TAB_PCDS_DYNAMIC_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_DEFAULT
-TAB_PCDS_DYNAMIC_HII_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_HII
-TAB_PCDS_DYNAMIC_VPD_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_VPD
-TAB_PCDS_DYNAMIC_COMMON = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PCDS_DYNAMIC_IA32 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PCDS_DYNAMIC_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_X64
-TAB_PCDS_DYNAMIC_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PCDS_DYNAMIC_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PCDS_DYNAMIC_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PCDS_DYNAMIC_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PCD_DYNAMIC_TYPE_LIST = [TAB_PCDS_DYNAMIC_DEFAULT_NULL, TAB_PCDS_DYNAMIC_VPD_NULL, TAB_PCDS_DYNAMIC_HII_NULL]
-TAB_PCD_DYNAMIC_EX_TYPE_LIST = [TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL, TAB_PCDS_DYNAMIC_EX_VPD_NULL, TAB_PCDS_DYNAMIC_EX_HII_NULL]
-
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE = 'PcdLoadFixAddressPeiCodePageNumber'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE = 'UINT32'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE = 'PcdLoadFixAddressBootTimeCodePageNumber'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE_DATA_TYPE = 'UINT32'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE = 'PcdLoadFixAddressRuntimeCodePageNumber'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE = 'UINT32'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE = 'PcdLoadFixAddressSmmCodePageNumber'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE = 'UINT32'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST = [TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE, \
- TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE, \
- TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE, \
- TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE]
-
-TAB_DEPEX = 'Depex'
-TAB_DEPEX_COMMON = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_DEPEX_IA32 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_IA32
-TAB_DEPEX_X64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_X64
-TAB_DEPEX_IPF = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_IPF
-TAB_DEPEX_ARM = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_ARM
-TAB_DEPEX_EBC = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_EBC
-TAB_DEPEX_AARCH64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_SKUIDS = 'SkuIds'
-
-TAB_LIBRARIES = 'Libraries'
-TAB_LIBRARIES_COMMON = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_LIBRARIES_IA32 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_LIBRARIES_X64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_X64
-TAB_LIBRARIES_IPF = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_LIBRARIES_ARM = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_LIBRARIES_EBC = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_LIBRARIES_AARCH64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_COMPONENTS = 'Components'
-TAB_COMPONENTS_COMMON = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_COMPONENTS_IA32 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IA32
-TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_X64
-TAB_COMPONENTS_IPF = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IPF
-TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_ARM
-TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_EBC
-TAB_COMPONENTS_AARCH64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_COMPONENTS_SOURCE_OVERRIDE_PATH = 'SOURCE_OVERRIDE_PATH'
-
-TAB_BUILD_OPTIONS = 'BuildOptions'
-
-TAB_DEFINE = 'DEFINE'
-TAB_NMAKE = 'Nmake'
-TAB_USER_EXTENSIONS = 'UserExtensions'
-TAB_INCLUDE = '!include'
-
-#
-# Common Define
-#
-TAB_COMMON_DEFINES = 'Defines'
-
-#
-# Inf Definitions
-#
-TAB_INF_DEFINES = TAB_COMMON_DEFINES
-TAB_INF_DEFINES_INF_VERSION = 'INF_VERSION'
-TAB_INF_DEFINES_BASE_NAME = 'BASE_NAME'
-TAB_INF_DEFINES_FILE_GUID = 'FILE_GUID'
-TAB_INF_DEFINES_MODULE_TYPE = 'MODULE_TYPE'
-TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION = 'EFI_SPECIFICATION_VERSION'
-TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION = 'UEFI_SPECIFICATION_VERSION'
-TAB_INF_DEFINES_PI_SPECIFICATION_VERSION = 'PI_SPECIFICATION_VERSION'
-TAB_INF_DEFINES_EDK_RELEASE_VERSION = 'EDK_RELEASE_VERSION'
-TAB_INF_DEFINES_BINARY_MODULE = 'BINARY_MODULE'
-TAB_INF_DEFINES_LIBRARY_CLASS = 'LIBRARY_CLASS'
-TAB_INF_DEFINES_COMPONENT_TYPE = 'COMPONENT_TYPE'
-TAB_INF_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME'
-TAB_INF_DEFINES_DPX_SOURCE = 'DPX_SOURCE'
-TAB_INF_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER'
-TAB_INF_DEFINES_BUILD_TYPE = 'BUILD_TYPE'
-TAB_INF_DEFINES_FFS_EXT = 'FFS_EXT'
-TAB_INF_DEFINES_FV_EXT = 'FV_EXT'
-TAB_INF_DEFINES_SOURCE_FV = 'SOURCE_FV'
-TAB_INF_DEFINES_VERSION_NUMBER = 'VERSION_NUMBER'
-TAB_INF_DEFINES_VERSION = 'VERSION' # for Edk inf, the same as VERSION_NUMBER
-TAB_INF_DEFINES_VERSION_STRING = 'VERSION_STRING'
-TAB_INF_DEFINES_PCD_IS_DRIVER = 'PCD_IS_DRIVER'
-TAB_INF_DEFINES_TIANO_EDK_FLASHMAP_H = 'TIANO_EDK_FLASHMAP_H'
-TAB_INF_DEFINES_ENTRY_POINT = 'ENTRY_POINT'
-TAB_INF_DEFINES_UNLOAD_IMAGE = 'UNLOAD_IMAGE'
-TAB_INF_DEFINES_CONSTRUCTOR = 'CONSTRUCTOR'
-TAB_INF_DEFINES_DESTRUCTOR = 'DESTRUCTOR'
-TAB_INF_DEFINES_DEFINE = 'DEFINE'
-TAB_INF_DEFINES_SPEC = 'SPEC'
-TAB_INF_DEFINES_CUSTOM_MAKEFILE = 'CUSTOM_MAKEFILE'
-TAB_INF_DEFINES_MACRO = '__MACROS__'
-TAB_INF_DEFINES_SHADOW = 'SHADOW'
-TAB_INF_FIXED_PCD = 'FixedPcd'
-TAB_INF_FEATURE_PCD = 'FeaturePcd'
-TAB_INF_PATCH_PCD = 'PatchPcd'
-TAB_INF_PCD = 'Pcd'
-TAB_INF_PCD_EX = 'PcdEx'
-TAB_INF_USAGE_PRO = 'PRODUCES'
-TAB_INF_USAGE_SOME_PRO = 'SOMETIMES_PRODUCES'
-TAB_INF_USAGE_CON = 'CONSUMES'
-TAB_INF_USAGE_SOME_CON = 'SOMETIMES_CONSUMES'
-TAB_INF_USAGE_NOTIFY = 'NOTIFY'
-TAB_INF_USAGE_TO_START = 'TO_START'
-TAB_INF_USAGE_BY_START = 'BY_START'
-TAB_INF_GUIDTYPE_EVENT = 'Event'
-TAB_INF_GUIDTYPE_FILE = 'File'
-TAB_INF_GUIDTYPE_FV = 'FV'
-TAB_INF_GUIDTYPE_GUID = 'GUID'
-TAB_INF_GUIDTYPE_HII = 'HII'
-TAB_INF_GUIDTYPE_HOB = 'HOB'
-TAB_INF_GUIDTYPE_ST = 'SystemTable'
-TAB_INF_GUIDTYPE_TSG = 'TokenSpaceGuid'
-TAB_INF_GUIDTYPE_VAR = 'Variable'
-TAB_INF_GUIDTYPE_PROTOCOL = 'PROTOCOL'
-TAB_INF_GUIDTYPE_PPI = 'PPI'
-TAB_INF_GUIDTYPE_UNDEFINED = 'UNDEFINED'
-
-#
-# Dec Definitions
-#
-TAB_DEC_DEFINES = TAB_COMMON_DEFINES
-TAB_DEC_DEFINES_DEC_SPECIFICATION = 'DEC_SPECIFICATION'
-TAB_DEC_DEFINES_PACKAGE_NAME = 'PACKAGE_NAME'
-TAB_DEC_DEFINES_PACKAGE_GUID = 'PACKAGE_GUID'
-TAB_DEC_DEFINES_PACKAGE_VERSION = 'PACKAGE_VERSION'
-TAB_DEC_DEFINES_PKG_UNI_FILE = 'PKG_UNI_FILE'
-
-#
-# Dsc Definitions
-#
-TAB_DSC_DEFINES = TAB_COMMON_DEFINES
-TAB_DSC_DEFINES_PLATFORM_NAME = 'PLATFORM_NAME'
-TAB_DSC_DEFINES_PLATFORM_GUID = 'PLATFORM_GUID'
-TAB_DSC_DEFINES_PLATFORM_VERSION = 'PLATFORM_VERSION'
-TAB_DSC_DEFINES_DSC_SPECIFICATION = 'DSC_SPECIFICATION'
-TAB_DSC_DEFINES_OUTPUT_DIRECTORY = 'OUTPUT_DIRECTORY'
-TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES = 'SUPPORTED_ARCHITECTURES'
-TAB_DSC_DEFINES_BUILD_TARGETS = 'BUILD_TARGETS'
-TAB_DSC_DEFINES_SKUID_IDENTIFIER = 'SKUID_IDENTIFIER'
-TAB_DSC_DEFINES_FLASH_DEFINITION = 'FLASH_DEFINITION'
-TAB_DSC_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER'
-TAB_DSC_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME'
-TAB_DSC_DEFINES_BS_BASE_ADDRESS = 'BsBaseAddress'
-TAB_DSC_DEFINES_RT_BASE_ADDRESS = 'RtBaseAddress'
-TAB_DSC_DEFINES_RFC_LANGUAGES = 'RFC_LANGUAGES'
-TAB_DSC_DEFINES_ISO_LANGUAGES = 'ISO_LANGUAGES'
-TAB_DSC_DEFINES_DEFINE = 'DEFINE'
-TAB_DSC_DEFINES_VPD_TOOL_GUID = 'VPD_TOOL_GUID'
-TAB_FIX_LOAD_TOP_MEMORY_ADDRESS = 'FIX_LOAD_TOP_MEMORY_ADDRESS'
-TAB_DSC_DEFINES_EDKGLOBAL = 'EDK_GLOBAL'
-
-#
-# TargetTxt Definitions
-#
-TAB_TAT_DEFINES_ACTIVE_PLATFORM = 'ACTIVE_PLATFORM'
-TAB_TAT_DEFINES_ACTIVE_MODULE = 'ACTIVE_MODULE'
-TAB_TAT_DEFINES_TOOL_CHAIN_CONF = 'TOOL_CHAIN_CONF'
-TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER = 'MAX_CONCURRENT_THREAD_NUMBER'
-TAB_TAT_DEFINES_TARGET = 'TARGET'
-TAB_TAT_DEFINES_TOOL_CHAIN_TAG = 'TOOL_CHAIN_TAG'
-TAB_TAT_DEFINES_TARGET_ARCH = 'TARGET_ARCH'
-TAB_TAT_DEFINES_BUILD_RULE_CONF = "BUILD_RULE_CONF"
-
-#
-# ToolDef Definitions
-#
-TAB_TOD_DEFINES_TARGET = 'TARGET'
-TAB_TOD_DEFINES_TOOL_CHAIN_TAG = 'TOOL_CHAIN_TAG'
-TAB_TOD_DEFINES_TARGET_ARCH = 'TARGET_ARCH'
-TAB_TOD_DEFINES_COMMAND_TYPE = 'COMMAND_TYPE'
-TAB_TOD_DEFINES_FAMILY = 'FAMILY'
-TAB_TOD_DEFINES_BUILDRULEFAMILY = 'BUILDRULEFAMILY'
-
-#
-# Conditional Statements
-#
-TAB_IF = '!if'
-TAB_END_IF = '!endif'
-TAB_ELSE_IF = '!elseif'
-TAB_ELSE = '!else'
-TAB_IF_DEF = '!ifdef'
-TAB_IF_N_DEF = '!ifndef'
-TAB_IF_EXIST = '!if exist'
-
-#
-# Unknown section
-#
-TAB_UNKNOWN = 'UNKNOWN'
-
-#
-# Build database path
-#
-DATABASE_PATH = ":memory:" #"BuildDatabase.db"
-
-# used by ECC
-MODIFIER_LIST = ['IN', 'OUT', 'OPTIONAL', 'UNALIGNED', 'EFI_RUNTIMESERVICE', 'EFI_BOOTSERVICE', 'EFIAPI']
-
-# Dependency Expression
-DEPEX_SUPPORTED_OPCODE = ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", "END", "SOR", "TRUE", "FALSE", '(', ')']
-
-TAB_STATIC_LIBRARY = "STATIC-LIBRARY-FILE"
-TAB_DYNAMIC_LIBRARY = "DYNAMIC-LIBRARY-FILE"
-TAB_FRAMEWORK_IMAGE = "EFI-IMAGE-FILE"
-TAB_C_CODE_FILE = "C-CODE-FILE"
-TAB_C_HEADER_FILE = "C-HEADER-FILE"
-TAB_UNICODE_FILE = "UNICODE-TEXT-FILE"
-TAB_DEPENDENCY_EXPRESSION_FILE = "DEPENDENCY-EXPRESSION-FILE"
-TAB_UNKNOWN_FILE = "UNKNOWN-TYPE-FILE"
-TAB_DEFAULT_BINARY_FILE = "_BINARY_FILE_"
-
-# used by BRG
-TAB_BRG_PCD = 'PCD'
-TAB_BRG_LIBRARY = 'Library'
-
-#
-# Build Rule File Version Definition
-#
-TAB_BUILD_RULE_VERSION = "build_rule_version"
-
-# section name for PCDs
-PCDS_DYNAMIC_DEFAULT = "PcdsDynamicDefault"
-PCDS_DYNAMIC_VPD = "PcdsDynamicVpd"
-PCDS_DYNAMIC_HII = "PcdsDynamicHii"
-PCDS_DYNAMICEX_DEFAULT = "PcdsDynamicExDefault"
-PCDS_DYNAMICEX_VPD = "PcdsDynamicExVpd"
-PCDS_DYNAMICEX_HII = "PcdsDynamicExHii"
-
-# Section allowed to have items after arch
-SECTIONS_HAVE_ITEM_AFTER_ARCH = [TAB_LIBRARY_CLASSES.upper(), TAB_DEPEX.upper(), TAB_USER_EXTENSIONS.upper(),
- PCDS_DYNAMIC_DEFAULT.upper(),
- PCDS_DYNAMIC_VPD.upper(),
- PCDS_DYNAMIC_HII.upper(),
- PCDS_DYNAMICEX_DEFAULT.upper(),
- PCDS_DYNAMICEX_VPD.upper(),
- PCDS_DYNAMICEX_HII.upper(),
- TAB_BUILD_OPTIONS.upper(),
- TAB_INCLUDES.upper()]
diff --git a/BaseTools/Source/Python/Common/Database.py b/BaseTools/Source/Python/Common/Database.py
deleted file mode 100644
index 5c0a79f291..0000000000
--- a/BaseTools/Source/Python/Common/Database.py
+++ /dev/null
@@ -1,120 +0,0 @@
-## @file
-# This file is used to create a database used by ECC tool
-#
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import sqlite3
-import os
-
-import EdkLogger as EdkLogger
-from CommonDataClass.DataClass import *
-from String import *
-from DataType import *
-
-from Table.TableDataModel import TableDataModel
-from Table.TableFile import TableFile
-from Table.TableInf import TableInf
-from Table.TableDec import TableDec
-from Table.TableDsc import TableDsc
-
-## Database
-#
-# This class defined the build databse
-# During the phase of initialization, the database will create all tables and
-# insert all records of table DataModel
-#
-# @param object: Inherited from object class
-# @param DbPath: A string for the path of the ECC database
-#
-# @var Conn: Connection of the ECC database
-# @var Cur: Cursor of the connection
-# @var TblDataModel: Local instance for TableDataModel
-#
-class Database(object):
- def __init__(self, DbPath):
- if os.path.exists(DbPath):
- os.remove(DbPath)
- self.Conn = sqlite3.connect(DbPath, isolation_level = 'DEFERRED')
- self.Conn.execute("PRAGMA page_size=8192")
- self.Conn.execute("PRAGMA synchronous=OFF")
- self.Cur = self.Conn.cursor()
- self.TblDataModel = TableDataModel(self.Cur)
- self.TblFile = TableFile(self.Cur)
- self.TblInf = TableInf(self.Cur)
- self.TblDec = TableDec(self.Cur)
- self.TblDsc = TableDsc(self.Cur)
-
- ## Initialize build database
- #
- # 1. Delete all old existing tables
- # 2. Create new tables
- # 3. Initialize table DataModel
- #
- def InitDatabase(self):
- EdkLogger.verbose("\nInitialize ECC database started ...")
- #
- # Drop all old existing tables
- #
-# self.TblDataModel.Drop()
-# self.TblDsc.Drop()
-# self.TblFile.Drop()
-
- #
- # Create new tables
- #
- self.TblDataModel.Create()
- self.TblFile.Create()
- self.TblInf.Create()
- self.TblDec.Create()
- self.TblDsc.Create()
-
- #
- # Initialize table DataModel
- #
- self.TblDataModel.InitTable()
- EdkLogger.verbose("Initialize ECC database ... DONE!")
-
- ## Query a table
- #
- # @param Table: The instance of the table to be queried
- #
- def QueryTable(self, Table):
- Table.Query()
-
- ## Close entire database
- #
- # Commit all first
- # Close the connection and cursor
- #
- def Close(self):
- self.Conn.commit()
- self.Cur.close()
- self.Conn.close()
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- EdkLogger.Initialize()
- EdkLogger.SetLevel(EdkLogger.DEBUG_0)
-
- Db = Database(DATABASE_PATH)
- Db.InitDatabase()
- Db.QueryTable(Db.TblDataModel)
- Db.QueryTable(Db.TblFile)
- Db.QueryTable(Db.TblDsc)
- Db.Close()
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/Common/DecClassObject.py b/BaseTools/Source/Python/Common/DecClassObject.py
deleted file mode 100644
index 5b39bcd4ce..0000000000
--- a/BaseTools/Source/Python/Common/DecClassObject.py
+++ /dev/null
@@ -1,563 +0,0 @@
-## @file
-# This file is used to define each component of DEC file
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-from String import *
-from DataType import *
-from Identification import *
-from Dictionary import *
-from CommonDataClass.PackageClass import *
-from CommonDataClass.CommonClass import PcdClass
-from BuildToolError import *
-from Table.TableDec import TableDec
-import Database
-from Parsing import *
-import GlobalData
-
-#
-# Global variable
-#
-Section = {TAB_UNKNOWN.upper() : MODEL_UNKNOWN,
- TAB_DEC_DEFINES.upper() : MODEL_META_DATA_HEADER,
- TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,
- TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,
- TAB_COMPONENTS.upper() : MODEL_META_DATA_COMPONENT,
- TAB_GUIDS.upper() : MODEL_EFI_GUID,
- TAB_PROTOCOLS.upper() : MODEL_EFI_PROTOCOL,
- TAB_PPIS.upper() : MODEL_EFI_PPI,
- TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : MODEL_PCD_FIXED_AT_BUILD,
- TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,
- TAB_PCDS_FEATURE_FLAG_NULL.upper() : MODEL_PCD_FEATURE_FLAG,
- TAB_PCDS_DYNAMIC_EX_NULL.upper() : MODEL_PCD_DYNAMIC_EX,
- TAB_PCDS_DYNAMIC_NULL.upper() : MODEL_PCD_DYNAMIC,
- TAB_USER_EXTENSIONS.upper() : MODEL_META_DATA_USER_EXTENSION
- }
-
-
-## DecObject
-#
-# This class defined basic Dec object which is used by inheriting
-#
-# @param object: Inherited from object class
-#
-class DecObject(object):
- def __init__(self):
- object.__init__()
-
-## Dec
-#
-# This class defined the structure used in Dec object
-#
-# @param DecObject: Inherited from DecObject class
-# @param Filename: Input value for Filename of Dec file, default is None
-# @param IsMergeAllArches: Input value for IsMergeAllArches
-# True is to merge all arches
-# Fales is not to merge all arches
-# default is False
-# @param IsToPackage: Input value for IsToPackage
-# True is to transfer to PackageObject automatically
-# False is not to transfer to PackageObject automatically
-# default is False
-# @param WorkspaceDir: Input value for current workspace directory, default is None
-#
-# @var Identification: To store value for Identification, it is a structure as Identification
-# @var Defines: To store value for Defines, it is a structure as DecDefines
-# @var UserExtensions: To store value for UserExtensions
-# @var Package: To store value for Package, it is a structure as PackageClass
-# @var WorkspaceDir: To store value for WorkspaceDir
-# @var Contents: To store value for Contents, it is a structure as DecContents
-# @var KeyList: To store value for KeyList, a list for all Keys used in Dec
-#
-class Dec(DecObject):
- def __init__(self, Filename=None, IsToDatabase=False, IsToPackage=False, WorkspaceDir=None, Database=None, SupArchList=DataType.ARCH_LIST):
- self.Identification = Identification()
- self.Package = PackageClass()
- self.UserExtensions = ''
- self.WorkspaceDir = WorkspaceDir
- self.SupArchList = SupArchList
- self.IsToDatabase = IsToDatabase
-
- self.Cur = Database.Cur
- self.TblFile = Database.TblFile
- self.TblDec = Database.TblDec
- self.FileID = -1
-
- self.KeyList = [
- TAB_INCLUDES, TAB_GUIDS, TAB_PROTOCOLS, TAB_PPIS, TAB_LIBRARY_CLASSES, \
- TAB_PCDS_FIXED_AT_BUILD_NULL, TAB_PCDS_PATCHABLE_IN_MODULE_NULL, TAB_PCDS_FEATURE_FLAG_NULL, \
- TAB_PCDS_DYNAMIC_NULL, TAB_PCDS_DYNAMIC_EX_NULL, TAB_DEC_DEFINES
- ]
- #
- # Upper all KEYs to ignore case sensitive when parsing
- #
- self.KeyList = map(lambda c: c.upper(), self.KeyList)
-
- #
- # Init RecordSet
- #
- self.RecordSet = {}
- for Key in self.KeyList:
- self.RecordSet[Section[Key]] = []
-
- #
- # Load Dec file if filename is not None
- #
- if Filename != None:
- self.LoadDecFile(Filename)
-
- #
- # Transfer to Package Object if IsToPackage is True
- #
- if IsToPackage:
- self.DecToPackage()
-
- ## Load Dec file
- #
- # Load the file if it exists
- #
- # @param Filename: Input value for filename of Dec file
- #
- def LoadDecFile(self, Filename):
- #
- # Insert a record for file
- #
- Filename = NormPath(Filename)
- self.Identification.FileFullPath = Filename
- (self.Identification.FileRelativePath, self.Identification.FileName) = os.path.split(Filename)
- self.FileID = self.TblFile.InsertFile(Filename, MODEL_FILE_DEC)
-
- #
- # Init DecTable
- #
- #self.TblDec.Table = "Dec%s" % self.FileID
- #self.TblDec.Create()
-
- #
- # Init common datas
- #
- IfDefList, SectionItemList, CurrentSection, ArchList, ThirdList, IncludeFiles = \
- [], [], TAB_UNKNOWN, [], [], []
- LineNo = 0
-
- #
- # Parse file content
- #
- IsFindBlockComment = False
- ReservedLine = ''
- for Line in open(Filename, 'r'):
- LineNo = LineNo + 1
- #
- # Remove comment block
- #
- if Line.find(TAB_COMMENT_EDK_START) > -1:
- ReservedLine = GetSplitList(Line, TAB_COMMENT_EDK_START, 1)[0]
- IsFindBlockComment = True
- if Line.find(TAB_COMMENT_EDK_END) > -1:
- Line = ReservedLine + GetSplitList(Line, TAB_COMMENT_EDK_END, 1)[1]
- ReservedLine = ''
- IsFindBlockComment = False
- if IsFindBlockComment:
- continue
-
- #
- # Remove comments at tail and remove spaces again
- #
- Line = CleanString(Line)
- if Line == '':
- continue
-
- #
- # Find a new section tab
- # First insert previous section items
- # And then parse the content of the new section
- #
- if Line.startswith(TAB_SECTION_START) and Line.endswith(TAB_SECTION_END):
- #
- # Insert items data of previous section
- #
- Model = Section[CurrentSection.upper()]
- InsertSectionItemsIntoDatabase(self.TblDec, self.FileID, Filename, Model, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList, self.RecordSet)
-
- #
- # Parse the new section
- #
- SectionItemList = []
- ArchList = []
- ThirdList = []
-
- CurrentSection = ''
- LineList = GetSplitValueList(Line[len(TAB_SECTION_START):len(Line) - len(TAB_SECTION_END)], TAB_COMMA_SPLIT)
- for Item in LineList:
- ItemList = GetSplitValueList(Item, TAB_SPLIT)
- if CurrentSection == '':
- CurrentSection = ItemList[0]
- else:
- if CurrentSection != ItemList[0]:
- EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
- if CurrentSection.upper() not in self.KeyList:
- RaiseParserError(Line, CurrentSection, Filename, '', LineNo)
- ItemList.append('')
- ItemList.append('')
- if len(ItemList) > 5:
- RaiseParserError(Line, CurrentSection, Filename, '', LineNo)
- else:
- if ItemList[1] != '' and ItemList[1].upper() not in ARCH_LIST_FULL:
- EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
- ArchList.append(ItemList[1].upper())
- ThirdList.append(ItemList[2])
-
- continue
-
- #
- # Not in any defined section
- #
- if CurrentSection == TAB_UNKNOWN:
- ErrorMsg = "%s is not in any defined section" % Line
- EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
-
- #
- # Add a section item
- #
- SectionItemList.append([Line, LineNo])
- # End of parse
- #End of For
-
- #
- # Insert items data of last section
- #
- Model = Section[CurrentSection.upper()]
- InsertSectionItemsIntoDatabase(self.TblDec, self.FileID, Filename, Model, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList, self.RecordSet)
-
- #
- # Replace all DEFINE macros with its actual values
- #
- ParseDefineMacro2(self.TblDec, self.RecordSet, GlobalData.gGlobalDefines)
-
- ## Transfer to Package Object
- #
- # Transfer all contents of a Dec file to a standard Package Object
- #
- def DecToPackage(self):
- #
- # Init global information for the file
- #
- ContainerFile = self.Identification.FileFullPath
-
- #
- # Generate Package Header
- #
- self.GenPackageHeader(ContainerFile)
-
- #
- # Generate Includes
- #
- self.GenIncludes(ContainerFile)
-
- #
- # Generate Guids
- #
- self.GenGuidProtocolPpis(DataType.TAB_GUIDS, ContainerFile)
-
- #
- # Generate Protocols
- #
- self.GenGuidProtocolPpis(DataType.TAB_PROTOCOLS, ContainerFile)
-
- #
- # Generate Ppis
- #
- self.GenGuidProtocolPpis(DataType.TAB_PPIS, ContainerFile)
-
- #
- # Generate LibraryClasses
- #
- self.GenLibraryClasses(ContainerFile)
-
- #
- # Generate Pcds
- #
- self.GenPcds(ContainerFile)
-
- ## Get Package Header
- #
- # Gen Package Header of Dec as <Key> = <Value>
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenPackageHeader(self, ContainerFile):
- EdkLogger.debug(2, "Generate PackageHeader ...")
- #
- # Update all defines item in database
- #
- RecordSet = self.RecordSet[MODEL_META_DATA_HEADER]
- for Record in RecordSet:
- ValueList = GetSplitValueList(Record[0], TAB_EQUAL_SPLIT)
- if len(ValueList) != 2:
- RaiseParserError(Record[0], 'Defines', ContainerFile, '<Key> = <Value>', Record[2])
- ID, Value1, Value2, Arch, LineNo = Record[3], ValueList[0], ValueList[1], Record[1], Record[2]
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s'
- where ID = %s""" % (self.TblDec.Table, ConvertToSqlString2(Value1), ConvertToSqlString2(Value2), ID)
- self.TblDec.Exec(SqlCommand)
-
- #
- # Get detailed information
- #
- for Arch in self.SupArchList:
- PackageHeader = PackageHeaderClass()
-
- PackageHeader.Name = QueryDefinesItem(self.TblDec, TAB_DEC_DEFINES_PACKAGE_NAME, Arch, self.FileID)[0]
- PackageHeader.Guid = QueryDefinesItem(self.TblDec, TAB_DEC_DEFINES_PACKAGE_GUID, Arch, self.FileID)[0]
- PackageHeader.Version = QueryDefinesItem(self.TblDec, TAB_DEC_DEFINES_PACKAGE_VERSION, Arch, self.FileID)[0]
- PackageHeader.FileName = self.Identification.FileName
- PackageHeader.FullPath = self.Identification.FileFullPath
- PackageHeader.DecSpecification = QueryDefinesItem(self.TblDec, TAB_DEC_DEFINES_DEC_SPECIFICATION, Arch, self.FileID)[0]
-
- self.Package.Header[Arch] = PackageHeader
-
- ## GenIncludes
- #
- # Gen Includes of Dec
- #
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenIncludes(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_INCLUDES)
- Includes = {}
- #
- # Get all Includes
- #
- RecordSet = self.RecordSet[MODEL_EFI_INCLUDE]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- MergeArches(Includes, Record[0], Arch)
-
- for Key in Includes.keys():
- Include = IncludeClass()
- Include.FilePath = NormPath(Key)
- Include.SupArchList = Includes[Key]
- self.Package.Includes.append(Include)
-
- ## GenPpis
- #
- # Gen Ppis of Dec
- # <CName>=<GuidValue>
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenGuidProtocolPpis(self, Type, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % Type)
- Lists = {}
- #
- # Get all Items
- #
- RecordSet = self.RecordSet[Section[Type.upper()]]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (Name, Value) = GetGuidsProtocolsPpisOfDec(Record[0], Type, ContainerFile, Record[2])
- MergeArches(Lists, (Name, Value), Arch)
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s'
- where ID = %s""" % (self.TblDec.Table, ConvertToSqlString2(Name), ConvertToSqlString2(Value), Record[3])
- self.TblDec.Exec(SqlCommand)
-
- ListMember = None
- if Type == TAB_GUIDS:
- ListMember = self.Package.GuidDeclarations
- elif Type == TAB_PROTOCOLS:
- ListMember = self.Package.ProtocolDeclarations
- elif Type == TAB_PPIS:
- ListMember = self.Package.PpiDeclarations
-
- for Key in Lists.keys():
- ListClass = GuidProtocolPpiCommonClass()
- ListClass.CName = Key[0]
- ListClass.Guid = Key[1]
- ListClass.SupArchList = Lists[Key]
- ListMember.append(ListClass)
-
-
- ## GenLibraryClasses
- #
- # Gen LibraryClasses of Dec
- # <CName>=<GuidValue>
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenLibraryClasses(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARY_CLASSES)
- LibraryClasses = {}
- #
- # Get all Guids
- #
- RecordSet = self.RecordSet[MODEL_EFI_LIBRARY_CLASS]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- List = GetSplitValueList(Record[0], DataType.TAB_VALUE_SPLIT)
- if len(List) != 2:
- RaiseParserError(Record[0], 'LibraryClasses', ContainerFile, '<LibraryClassName>|<LibraryClassInstanceFilename>', Record[2])
- else:
- CheckFileExist(self.Identification.FileRelativePath, List[1], ContainerFile, 'LibraryClasses', Record[0])
- MergeArches(LibraryClasses, (List[0], List[1]), Arch)
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s', Value3 = '%s'
- where ID = %s""" % (self.TblDec.Table, ConvertToSqlString2(List[0]), ConvertToSqlString2(List[1]), SUP_MODULE_LIST_STRING, Record[3])
- self.TblDec.Exec(SqlCommand)
-
-
- for Key in LibraryClasses.keys():
- LibraryClass = LibraryClassClass()
- LibraryClass.LibraryClass = Key[0]
- LibraryClass.RecommendedInstance = NormPath(Key[1])
- LibraryClass.SupModuleList = SUP_MODULE_LIST
- LibraryClass.SupArchList = LibraryClasses[Key]
- self.Package.LibraryClassDeclarations.append(LibraryClass)
-
- ## GenPcds
- #
- # Gen Pcds of Dec
- # <TokenSpcCName>.<TokenCName>|<Value>|<DatumType>|<Token>
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenPcds(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_PCDS)
- Pcds = {}
- PcdToken = {}
- #
- # Get all Guids
- #
- RecordSet1 = self.RecordSet[MODEL_PCD_FIXED_AT_BUILD]
- RecordSet2 = self.RecordSet[MODEL_PCD_PATCHABLE_IN_MODULE]
- RecordSet3 = self.RecordSet[MODEL_PCD_FEATURE_FLAG]
- RecordSet4 = self.RecordSet[MODEL_PCD_DYNAMIC_EX]
- RecordSet5 = self.RecordSet[MODEL_PCD_DYNAMIC]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet1:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (TokenGuidCName, TokenName, Value, DatumType, Token, Type) = GetPcdOfDec(Record[0], TAB_PCDS_FIXED_AT_BUILD, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenGuidCName, TokenName, Value, DatumType, Token, Type), Arch)
- PcdToken[Record[3]] = (TokenGuidCName, TokenName)
- for Record in RecordSet2:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (TokenGuidCName, TokenName, Value, DatumType, Token, Type) = GetPcdOfDec(Record[0], TAB_PCDS_PATCHABLE_IN_MODULE, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenGuidCName, TokenName, Value, DatumType, Token, Type), Arch)
- PcdToken[Record[3]] = (TokenGuidCName, TokenName)
- for Record in RecordSet3:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (TokenGuidCName, TokenName, Value, DatumType, Token, Type) = GetPcdOfDec(Record[0], TAB_PCDS_FEATURE_FLAG, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenGuidCName, TokenName, Value, DatumType, Token, Type), Arch)
- PcdToken[Record[3]] = (TokenGuidCName, TokenName)
- for Record in RecordSet4:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (TokenGuidCName, TokenName, Value, DatumType, Token, Type) = GetPcdOfDec(Record[0], TAB_PCDS_DYNAMIC_EX, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenGuidCName, TokenName, Value, DatumType, Token, Type), Arch)
- PcdToken[Record[3]] = (TokenGuidCName, TokenName)
- for Record in RecordSet5:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (TokenGuidCName, TokenName, Value, DatumType, Token, Type) = GetPcdOfDec(Record[0], TAB_PCDS_DYNAMIC, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenGuidCName, TokenName, Value, DatumType, Token, Type), Arch)
- PcdToken[Record[3]] = (TokenGuidCName, TokenName)
- #
- # Update to database
- #
- if self.IsToDatabase:
- for Key in PcdToken.keys():
- SqlCommand = """update %s set Value2 = '%s' where ID = %s""" % (self.TblDec.Table, ".".join((PcdToken[Key][0], PcdToken[Key][1])), Key)
- self.TblDec.Exec(SqlCommand)
-
- for Key in Pcds.keys():
- Pcd = PcdClass()
- Pcd.CName = Key[1]
- Pcd.Token = Key[4]
- Pcd.TokenSpaceGuidCName = Key[0]
- Pcd.DatumType = Key[3]
- Pcd.DefaultValue = Key[2]
- Pcd.ItemType = Key[5]
- Pcd.SupArchList = Pcds[Key]
- self.Package.PcdDeclarations.append(Pcd)
-
- ## Show detailed information of Package
- #
- # Print all members and their values of Package class
- #
- def ShowPackage(self):
- M = self.Package
- for Arch in M.Header.keys():
- print '\nArch =', Arch
- print 'Filename =', M.Header[Arch].FileName
- print 'FullPath =', M.Header[Arch].FullPath
- print 'BaseName =', M.Header[Arch].Name
- print 'Guid =', M.Header[Arch].Guid
- print 'Version =', M.Header[Arch].Version
- print 'DecSpecification =', M.Header[Arch].DecSpecification
- print '\nIncludes =', M.Includes
- for Item in M.Includes:
- print Item.FilePath, Item.SupArchList
- print '\nGuids =', M.GuidDeclarations
- for Item in M.GuidDeclarations:
- print Item.CName, Item.Guid, Item.SupArchList
- print '\nProtocols =', M.ProtocolDeclarations
- for Item in M.ProtocolDeclarations:
- print Item.CName, Item.Guid, Item.SupArchList
- print '\nPpis =', M.PpiDeclarations
- for Item in M.PpiDeclarations:
- print Item.CName, Item.Guid, Item.SupArchList
- print '\nLibraryClasses =', M.LibraryClassDeclarations
- for Item in M.LibraryClassDeclarations:
- print Item.LibraryClass, Item.RecommendedInstance, Item.SupModuleList, Item.SupArchList
- print '\nPcds =', M.PcdDeclarations
- for Item in M.PcdDeclarations:
- print 'CName=', Item.CName, 'TokenSpaceGuidCName=', Item.TokenSpaceGuidCName, 'DefaultValue=', Item.DefaultValue, 'ItemType=', Item.ItemType, 'Token=', Item.Token, 'DatumType=', Item.DatumType, Item.SupArchList
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- EdkLogger.Initialize()
- EdkLogger.SetLevel(EdkLogger.DEBUG_0)
-
- W = os.getenv('WORKSPACE')
- F = os.path.join(W, 'Nt32Pkg/Nt32Pkg.dec')
-
- Db = Database.Database('Dec.db')
- Db.InitDatabase()
-
- P = Dec(os.path.normpath(F), True, True, W, Db)
- P.ShowPackage()
-
- Db.Close()
diff --git a/BaseTools/Source/Python/Common/Dictionary.py b/BaseTools/Source/Python/Common/Dictionary.py
deleted file mode 100644
index de3556b892..0000000000
--- a/BaseTools/Source/Python/Common/Dictionary.py
+++ /dev/null
@@ -1,75 +0,0 @@
-## @file
-# Define a dictionary structure
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import EdkLogger
-from DataType import *
-
-## Convert a text file to a dictionary
-#
-# Convert a text file to a dictionary of (name:value) pairs.
-#
-# @retval 0 Convert successful
-# @retval 1 Open file failed
-#
-def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
- try:
- F = open(FileName,'r')
- Keys = []
- for Line in F:
- if Line.startswith(CommentCharacter):
- continue
- LineList = Line.split(KeySplitCharacter,1)
- if len(LineList) >= 2:
- Key = LineList[0].split()
- if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] not in Keys:
- if ValueSplitFlag:
- Dictionary[Key[0]] = LineList[1].replace('\\','/').split(ValueSplitCharacter)
- else:
- Dictionary[Key[0]] = LineList[1].strip().replace('\\','/')
- Keys += [Key[0]]
- F.close()
- return 0
- except:
- EdkLogger.info('Open file failed')
- return 1
-
-## Print the dictionary
-#
-# Print all items of dictionary one by one
-#
-# @param Dict: The dictionary to be printed
-#
-def printDict(Dict):
- if Dict != None:
- KeyList = Dict.keys()
- for Key in KeyList:
- if Dict[Key] != '':
- print Key + ' = ' + str(Dict[Key])
-
-## Print the dictionary
-#
-# Print the items of dictionary which matched with input key
-#
-# @param list: The dictionary to be printed
-# @param key: The key of the item to be printed
-#
-def printList(Key, List):
- if type(List) == type([]):
- if len(List) > 0:
- if Key.find(TAB_SPLIT) != -1:
- print "\n" + Key
- for Item in List:
- print Item
diff --git a/BaseTools/Source/Python/Common/DscClassObject.py b/BaseTools/Source/Python/Common/DscClassObject.py
deleted file mode 100644
index 3d06288e9a..0000000000
--- a/BaseTools/Source/Python/Common/DscClassObject.py
+++ /dev/null
@@ -1,1439 +0,0 @@
-## @file
-# This file is used to define each component of DSC file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import EdkLogger as EdkLogger
-import Database
-from String import *
-from Parsing import *
-from DataType import *
-from Identification import *
-from Dictionary import *
-from CommonDataClass.PlatformClass import *
-from CommonDataClass.CommonClass import SkuInfoClass
-from BuildToolError import *
-from Misc import sdict
-import GlobalData
-from Table.TableDsc import TableDsc
-
-#
-# Global variable
-#
-Section = {TAB_UNKNOWN.upper() : MODEL_UNKNOWN,
- TAB_DSC_DEFINES.upper() : MODEL_META_DATA_HEADER,
- TAB_BUILD_OPTIONS.upper() : MODEL_META_DATA_BUILD_OPTION,
- TAB_SKUIDS.upper() : MODEL_EFI_SKU_ID,
- TAB_LIBRARIES.upper() : MODEL_EFI_LIBRARY_INSTANCE,
- TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,
- TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : MODEL_PCD_FIXED_AT_BUILD,
- TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,
- TAB_PCDS_FEATURE_FLAG_NULL.upper() : MODEL_PCD_FEATURE_FLAG,
- TAB_PCDS_DYNAMIC_EX_NULL.upper() : MODEL_PCD_DYNAMIC_EX,
- TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper() : MODEL_PCD_DYNAMIC_EX_DEFAULT,
- TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper() : MODEL_PCD_DYNAMIC_EX_VPD,
- TAB_PCDS_DYNAMIC_EX_HII_NULL.upper() : MODEL_PCD_DYNAMIC_EX_HII,
- TAB_PCDS_DYNAMIC_NULL.upper() : MODEL_PCD_DYNAMIC,
- TAB_PCDS_DYNAMIC_DEFAULT_NULL.upper() : MODEL_PCD_DYNAMIC_DEFAULT,
- TAB_PCDS_DYNAMIC_VPD_NULL.upper() : MODEL_PCD_DYNAMIC_VPD,
- TAB_PCDS_DYNAMIC_HII_NULL.upper() : MODEL_PCD_DYNAMIC_HII,
- TAB_COMPONENTS.upper() : MODEL_META_DATA_COMPONENT,
- TAB_USER_EXTENSIONS.upper() : MODEL_META_DATA_USER_EXTENSION
- }
-
-## DscObject
-#
-# This class defined basic Dsc object which is used by inheriting
-#
-# @param object: Inherited from object class
-#
-class DscObject(object):
- def __init__(self):
- object.__init__()
-
-## Dsc
-#
-# This class defined the structure used in Dsc object
-#
-# @param DscObject: Inherited from InfObject class
-# @param Ffilename: Input value for Ffilename of Inf file, default is None
-# @param IsMergeAllArches: Input value for IsMergeAllArches
-# True is to merge all arches
-# Fales is not to merge all arches
-# default is False
-# @param IsToPlatform: Input value for IsToPlatform
-# True is to transfer to ModuleObject automatically
-# False is not to transfer to ModuleObject automatically
-# default is False
-# @param WorkspaceDir: Input value for current workspace directory, default is None
-#
-# @var _NullClassIndex: To store value for _NullClassIndex, default is 0
-# @var Identification: To store value for Identification, it is a structure as Identification
-# @var Defines: To store value for Defines, it is a structure as DscDefines
-# @var Contents: To store value for Contents, it is a structure as DscContents
-# @var UserExtensions: To store value for UserExtensions
-# @var Platform: To store value for Platform, it is a structure as PlatformClass
-# @var WorkspaceDir: To store value for WorkspaceDir
-# @var KeyList: To store value for KeyList, a list for all Keys used in Dec
-#
-class Dsc(DscObject):
- _NullClassIndex = 0
-
- def __init__(self, Filename=None, IsToDatabase=False, IsToPlatform=False, WorkspaceDir=None, Database=None):
- self.Identification = Identification()
- self.Platform = PlatformClass()
- self.UserExtensions = ''
- self.WorkspaceDir = WorkspaceDir
- self.IsToDatabase = IsToDatabase
-
- self.Cur = Database.Cur
- self.TblFile = Database.TblFile
- self.TblDsc = Database.TblDsc
-
-
- self.KeyList = [
- TAB_SKUIDS, TAB_LIBRARIES, TAB_LIBRARY_CLASSES, TAB_BUILD_OPTIONS, TAB_PCDS_FIXED_AT_BUILD_NULL, \
- TAB_PCDS_PATCHABLE_IN_MODULE_NULL, TAB_PCDS_FEATURE_FLAG_NULL, \
- TAB_PCDS_DYNAMIC_DEFAULT_NULL, TAB_PCDS_DYNAMIC_HII_NULL, TAB_PCDS_DYNAMIC_VPD_NULL, \
- TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL, TAB_PCDS_DYNAMIC_EX_HII_NULL, TAB_PCDS_DYNAMIC_EX_VPD_NULL, \
- TAB_COMPONENTS, TAB_DSC_DEFINES
- ]
-
- self.PcdToken = {}
-
- #
- # Upper all KEYs to ignore case sensitive when parsing
- #
- self.KeyList = map(lambda c: c.upper(), self.KeyList)
-
- #
- # Init RecordSet
- #
-# self.RecordSet = {}
-# for Key in self.KeyList:
-# self.RecordSet[Section[Key]] = []
-
- #
- # Load Dsc file if filename is not None
- #
- if Filename != None:
- self.LoadDscFile(Filename)
-
- #
- # Transfer to Platform Object if IsToPlatform is True
- #
- if IsToPlatform:
- self.DscToPlatform()
-
- ## Transfer to Platform Object
- #
- # Transfer all contents of an Inf file to a standard Module Object
- #
- def DscToPlatform(self):
- #
- # Init global information for the file
- #
- ContainerFile = self.Identification.FileFullPath
-
- #
- # Generate Platform Header
- #
- self.GenPlatformHeader(ContainerFile)
-
- #
- # Generate BuildOptions
- #
- self.GenBuildOptions(ContainerFile)
-
- #
- # Generate SkuInfos
- #
- self.GenSkuInfos(ContainerFile)
-
- #
- # Generate Libraries
- #
- self.GenLibraries(ContainerFile)
-
- #
- # Generate LibraryClasses
- #
- self.GenLibraryClasses(ContainerFile)
-
- #
- # Generate Pcds
- #
- self.GenPcds(DataType.TAB_PCDS_FIXED_AT_BUILD, ContainerFile)
- self.GenPcds(DataType.TAB_PCDS_PATCHABLE_IN_MODULE, ContainerFile)
- self.GenFeatureFlagPcds(DataType.TAB_PCDS_FEATURE_FLAG, ContainerFile)
- self.GenDynamicDefaultPcds(DataType.TAB_PCDS_DYNAMIC_DEFAULT, ContainerFile)
- self.GenDynamicDefaultPcds(DataType.TAB_PCDS_DYNAMIC_EX_DEFAULT, ContainerFile)
- self.GenDynamicHiiPcds(DataType.TAB_PCDS_DYNAMIC_HII, ContainerFile)
- self.GenDynamicHiiPcds(DataType.TAB_PCDS_DYNAMIC_EX_HII, ContainerFile)
- self.GenDynamicVpdPcds(DataType.TAB_PCDS_DYNAMIC_VPD, ContainerFile)
- self.GenDynamicVpdPcds(DataType.TAB_PCDS_DYNAMIC_EX_VPD, ContainerFile)
-
- #
- # Generate Components
- #
- self.GenComponents(ContainerFile)
-
- #
- # Update to database
- #
- if self.IsToDatabase:
- for Key in self.PcdToken.keys():
- SqlCommand = """update %s set Value2 = '%s' where ID = %s""" % (self.TblDsc.Table, ".".join((self.PcdToken[Key][0], self.PcdToken[Key][1])), Key)
- self.TblDsc.Exec(SqlCommand)
- #End of DscToPlatform
-
- ## Get Platform Header
- #
- # Gen Platform Header of Dsc as <Key> = <Value>
- #
- # @param ContainerFile: The Dsc file full path
- #
- def GenPlatformHeader(self, ContainerFile):
- EdkLogger.debug(2, "Generate PlatformHeader ...")
- #
- # Update all defines item in database
- #
- SqlCommand = """select ID, Value1, Arch, StartLine from %s
- where Model = %s
- and BelongsToFile = %s
- and Enabled > -1""" % (self.TblDsc.Table, MODEL_META_DATA_HEADER, self.FileID)
- RecordSet = self.TblDsc.Exec(SqlCommand)
- for Record in RecordSet:
- ValueList = GetSplitValueList(Record[1], TAB_EQUAL_SPLIT)
- if len(ValueList) != 2:
- RaiseParserError(Record[1], 'Defines', ContainerFile, '<Key> = <Value>', Record[3])
- ID, Value1, Value2, Arch = Record[0], ValueList[0], ValueList[1], Record[2]
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s'
- where ID = %s""" % (self.TblDsc.Table, ConvertToSqlString2(Value1), ConvertToSqlString2(Value2), ID)
- self.TblDsc.Exec(SqlCommand)
-
- #
- # Get detailed information
- #
- for Arch in DataType.ARCH_LIST:
- PlatformHeader = PlatformHeaderClass()
-
- PlatformHeader.Name = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_PLATFORM_NAME, Arch, self.FileID)[0]
- PlatformHeader.Guid = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_PLATFORM_GUID, Arch, self.FileID)[0]
- PlatformHeader.Version = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_PLATFORM_VERSION, Arch, self.FileID)[0]
- PlatformHeader.FileName = self.Identification.FileName
- PlatformHeader.FullPath = self.Identification.FileFullPath
- PlatformHeader.DscSpecification = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_DSC_SPECIFICATION, Arch, self.FileID)[0]
-
- PlatformHeader.SkuIdName = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_SKUID_IDENTIFIER, Arch, self.FileID)
- PlatformHeader.SupArchList = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES, Arch, self.FileID)
- PlatformHeader.BuildTargets = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_BUILD_TARGETS, Arch, self.FileID)
- PlatformHeader.OutputDirectory = NormPath(QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_OUTPUT_DIRECTORY, Arch, self.FileID)[0])
- PlatformHeader.BuildNumber = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_BUILD_NUMBER, Arch, self.FileID)[0]
- PlatformHeader.MakefileName = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_MAKEFILE_NAME, Arch, self.FileID)[0]
-
- PlatformHeader.BsBaseAddress = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_BS_BASE_ADDRESS, Arch, self.FileID)[0]
- PlatformHeader.RtBaseAddress = QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_RT_BASE_ADDRESS, Arch, self.FileID)[0]
-
- self.Platform.Header[Arch] = PlatformHeader
- Fdf = PlatformFlashDefinitionFileClass()
- Fdf.FilePath = NormPath(QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_FLASH_DEFINITION, Arch, self.FileID)[0])
- self.Platform.FlashDefinitionFile = Fdf
-
- ## GenBuildOptions
- #
- # Gen BuildOptions of Dsc
- # [<Family>:]<ToolFlag>=Flag
- #
- # @param ContainerFile: The Dsc file full path
- #
- def GenBuildOptions(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_BUILD_OPTIONS)
- BuildOptions = {}
- #
- # Get all include files
- #
- IncludeFiles = QueryDscItem(self.TblDsc, MODEL_META_DATA_INCLUDE, MODEL_META_DATA_BUILD_OPTION, self.FileID)
-
- #
- # Get all BuildOptions
- #
- RecordSet = QueryDscItem(self.TblDsc, MODEL_META_DATA_BUILD_OPTION, -1, self.FileID)
-
- #
- # Go through each arch
- #
- for Arch in DataType.ARCH_LIST:
- for IncludeFile in IncludeFiles:
- if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
- Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, TAB_BUILD_OPTIONS, '', IncludeFile[2])
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- (Family, ToolChain, Flag) = GetBuildOption(NewItem, Filename, -1)
- MergeArches(BuildOptions, (Family, ToolChain, Flag), Arch)
-
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
- (Family, ToolChain, Flag) = GetBuildOption(Record[0], ContainerFile, Record[2])
- MergeArches(BuildOptions, (Family, ToolChain, Flag), Arch)
- #
- # Update to Database
- #
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s', Value3 = '%s'
- where ID = %s""" % (self.TblDsc.Table, ConvertToSqlString2(Family), ConvertToSqlString2(ToolChain), ConvertToSqlString2(Flag), Record[3])
- self.TblDsc.Exec(SqlCommand)
-
- for Key in BuildOptions.keys():
- BuildOption = BuildOptionClass(Key[0], Key[1], Key[2])
- BuildOption.SupArchList = BuildOptions[Key]
- self.Platform.BuildOptions.BuildOptionList.append(BuildOption)
-
- ## GenSkuInfos
- #
- # Gen SkuInfos of Dsc
- # <Integer>|<UiName>
- #
- # @param ContainerFile: The Dsc file full path
- #
- def GenSkuInfos(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_SKUIDS)
- #
- # SkuIds
- # <Integer>|<UiName>
- #
- self.Platform.SkuInfos.SkuInfoList['DEFAULT'] = '0'
-
- #
- # Get all include files
- #
- IncludeFiles = QueryDscItem(self.TblDsc, MODEL_META_DATA_INCLUDE, MODEL_EFI_SKU_ID, self.FileID)
-
- #
- # Get all SkuInfos
- #
- RecordSet = QueryDscItem(self.TblDsc, MODEL_EFI_SKU_ID, -1, self.FileID)
-
- #
- # Go through each arch
- #
- for Arch in DataType.ARCH_LIST:
- for IncludeFile in IncludeFiles:
- if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
- Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, TAB_SKUIDS, '', IncludeFile[2])
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- List = GetSplitValueList(NewItem)
- if len(List) != 2:
- RaiseParserError(NewItem, TAB_SKUIDS, Filename, '<Integer>|<UiName>')
- else:
- self.Platform.SkuInfos.SkuInfoList[List[1]] = List[0]
-
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
- List = GetSplitValueList(Record[0])
- if len(List) != 2:
- RaiseParserError(Record[0], TAB_SKUIDS, ContainerFile, '<Integer>|<UiName>')
- else:
- self.Platform.SkuInfos.SkuInfoList[List[1]] = List[0]
- #
- # Update to Database
- #
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s'
- where ID = %s""" % (self.TblDsc.Table, ConvertToSqlString2(List[0]), ConvertToSqlString2(List[1]), Record[3])
- self.TblDsc.Exec(SqlCommand)
-
- ## GenLibraries
- #
- # Gen Libraries of Dsc
- # <PathAndFilename>
- #
- # @param ContainerFile: The Dsc file full path
- #
- def GenLibraries(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARIES)
- Libraries = {}
- #
- # Get all include files
- #
- IncludeFiles = QueryDscItem(self.TblDsc, MODEL_META_DATA_INCLUDE, MODEL_EFI_LIBRARY_INSTANCE, self.FileID)
-
- #
- # Get all Libraries
- #
- RecordSet = QueryDscItem(self.TblDsc, MODEL_EFI_LIBRARY_INSTANCE, -1, self.FileID)
-
- #
- # Go through each arch
- #
- for Arch in DataType.ARCH_LIST:
- for IncludeFile in IncludeFiles:
- if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
- Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, TAB_LIBRARIES, '', IncludeFile[2])
- if os.path.exists(Filename):
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- MergeArches(Libraries, NewItem, Arch)
-
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
- MergeArches(Libraries, Record[0], Arch)
-
- for Key in Libraries.keys():
- Library = PlatformLibraryClass()
- Library.FilePath = NormPath(Key)
- Library.SupArchList = Libraries[Key]
- self.Platform.Libraries.LibraryList.append(Library)
-
- ## GenLibraryClasses
- #
- # Get LibraryClasses of Dsc
- # <LibraryClassKeyWord>|<LibraryInstance>
- #
- # @param ContainerFile: The Dsc file full path
- #
- def GenLibraryClasses(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARY_CLASSES)
- LibraryClasses = {}
- #
- # Get all include files
- #
- IncludeFiles = QueryDscItem(self.TblDsc, MODEL_META_DATA_INCLUDE, MODEL_EFI_LIBRARY_CLASS, self.FileID)
-
- #
- # Get all LibraryClasses
- #
- RecordSet = QueryDscItem(self.TblDsc, MODEL_EFI_LIBRARY_CLASS, -1, self.FileID)
-
- #
- # Go through each arch
- #
- for Arch in DataType.ARCH_LIST:
- for IncludeFile in IncludeFiles:
- if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
- Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, TAB_LIBRARY_CLASSES, '', IncludeFile[2])
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- MergeArches(LibraryClasses, GetLibraryClass([NewItem, IncludeFile[4]], Filename, self.WorkspaceDir, -1), Arch)
-
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
- (LibClassName, LibClassIns, SupModelList) = GetLibraryClass([Record[0], Record[4]], ContainerFile, self.WorkspaceDir, Record[2])
- MergeArches(LibraryClasses, (LibClassName, LibClassIns, SupModelList), Arch)
- #
- # Update to Database
- #
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s', Value3 = '%s'
- where ID = %s""" % (self.TblDsc.Table, ConvertToSqlString2(LibClassName), ConvertToSqlString2(LibClassIns), ConvertToSqlString2(SupModelList), Record[3])
- self.TblDsc.Exec(SqlCommand)
-
- for Key in LibraryClasses.keys():
- Library = PlatformLibraryClass()
- Library.Name = Key[0]
- Library.FilePath = NormPath(Key[1])
- Library.SupModuleList = GetSplitValueList(Key[2])
- Library.SupArchList = LibraryClasses[Key]
- self.Platform.LibraryClasses.LibraryList.append(Library)
-
- ## Gen Pcds
- #
- # Gen Pcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<Type>|<MaximumDatumSize>]
- #
- # @param Type: The type of Pcd
- # @param ContainerFile: The file which describes the pcd, used for error report
- #
- def GenPcds(self, Type='', ContainerFile=''):
- Pcds = {}
- if Type == DataType.TAB_PCDS_PATCHABLE_IN_MODULE:
- Model = MODEL_PCD_PATCHABLE_IN_MODULE
- elif Type == DataType.TAB_PCDS_FIXED_AT_BUILD:
- Model = MODEL_PCD_FIXED_AT_BUILD
- else:
- pass
- EdkLogger.debug(2, "Generate %s ..." % Type)
-
- #
- # Get all include files
- #
- IncludeFiles = QueryDscItem(self.TblDsc, MODEL_META_DATA_INCLUDE, Model, self.FileID)
-
- #
- # Get all Pcds
- #
- RecordSet = QueryDscItem(self.TblDsc, Model, -1, self.FileID)
-
- #
- # Go through each arch
- #
- for Arch in DataType.ARCH_LIST:
- for IncludeFile in IncludeFiles:
- if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
- Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, Type, '', IncludeFile[2])
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- (TokenName, TokenGuidCName, Value, DatumType, MaxDatumSize, Type) = GetPcd(NewItem, Type, Filename, -1)
- MergeArches(Pcds, (TokenName, TokenGuidCName, Value, DatumType, MaxDatumSize, Type), Arch)
- self.PcdToken[Record[3]] = (TokenGuidCName, TokenName)
-
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
- (TokenName, TokenGuidCName, Value, DatumType, MaxDatumSize, Type) = GetPcd(Record[0], Type, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenName, TokenGuidCName, Value, DatumType, MaxDatumSize, Type), Arch)
- self.PcdToken[Record[3]] = (TokenGuidCName, TokenName)
-
- for Key in Pcds:
- Pcd = PcdClass(Key[0], '', Key[1], Key[3], Key[4], Key[2], Key[5], [], {}, [])
- Pcd.SupArchList = Pcds[Key]
- self.Platform.DynamicPcdBuildDefinitions.append(Pcd)
-
- ## Gen FeatureFlagPcds
- #
- # Gen FeatureFlagPcds of Dsc file as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE
- #
- # @param Type: The type of Pcd
- # @param ContainerFile: The file which describes the pcd, used for error report
- #
- def GenFeatureFlagPcds(self, Type='', ContainerFile=''):
- Pcds = {}
- if Type == DataType.TAB_PCDS_FEATURE_FLAG:
- Model = MODEL_PCD_FEATURE_FLAG
- else:
- pass
- EdkLogger.debug(2, "Generate %s ..." % Type)
-
- #
- # Get all include files
- #
- IncludeFiles = QueryDscItem(self.TblDsc, MODEL_META_DATA_INCLUDE, Model, self.FileID)
-
- #
- # Get all FeatureFlagPcds
- #
- RecordSet = QueryDscItem(self.TblDsc, Model, -1, self.FileID)
-
- #
- # Go through each arch
- #
- for Arch in DataType.ARCH_LIST:
- for IncludeFile in IncludeFiles:
- if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
- Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, Type, '', IncludeFile[2])
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- (TokenName, TokenGuidCName, Value, Type) = GetFeatureFlagPcd(NewItem, Type, Filename, -1)
- MergeArches(Pcds, (TokenName, TokenGuidCName, Value, Type), Arch)
- self.PcdToken[Record[3]] = (TokenGuidCName, TokenName)
-
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
- (TokenName, TokenGuidCName, Value, Type) = GetFeatureFlagPcd(Record[0], Type, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenName, TokenGuidCName, Value, Type), Arch)
- self.PcdToken[Record[3]] = (TokenGuidCName, TokenName)
-
- for Key in Pcds:
- Pcd = PcdClass(Key[0], '', Key[1], '', '', Key[2], Key[3], [], {}, [])
- Pcd.SupArchList = Pcds[Key]
- self.Platform.DynamicPcdBuildDefinitions.append(Pcd)
-
- ## Gen DynamicDefaultPcds
- #
- # Gen DynamicDefaultPcds of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<DatumTyp>[|<MaxDatumSize>]]
- #
- # @param Type: The type of Pcd
- # @param ContainerFile: The file which describes the pcd, used for error report
- #
- def GenDynamicDefaultPcds(self, Type='', ContainerFile=''):
- Pcds = {}
- SkuInfoList = {}
- if Type == DataType.TAB_PCDS_DYNAMIC_DEFAULT:
- Model = MODEL_PCD_DYNAMIC_DEFAULT
- elif Type == DataType.TAB_PCDS_DYNAMIC_EX_DEFAULT:
- Model = MODEL_PCD_DYNAMIC_EX_DEFAULT
- else:
- pass
- EdkLogger.debug(2, "Generate %s ..." % Type)
-
- #
- # Get all include files
- #
- IncludeFiles = QueryDscItem(self.TblDsc, MODEL_META_DATA_INCLUDE, Model, self.FileID)
-
- #
- # Get all DynamicDefaultPcds
- #
- RecordSet = QueryDscItem(self.TblDsc, Model, -1, self.FileID)
-
- #
- # Go through each arch
- #
- for Arch in DataType.ARCH_LIST:
- for IncludeFile in IncludeFiles:
- if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
- Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, Type, '', IncludeFile[2])
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- (K1, K2, K3, K4, K5, K6) = GetDynamicDefaultPcd(NewItem, Type, Filename, -1)
- MergeArches(Pcds, (K1, K2, K3, K4, K5, K6, IncludeFile[4]), Arch)
- self.PcdToken[Record[3]] = (K2, K1)
-
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
- (K1, K2, K3, K4, K5, K6) = GetDynamicDefaultPcd(Record[0], Type, ContainerFile, Record[2])
- MergeArches(Pcds, (K1, K2, K3, K4, K5, K6, Record[4]), Arch)
- self.PcdToken[Record[3]] = (K2, K1)
-
- for Key in Pcds:
- (Status, SkuInfoList) = self.GenSkuInfoList(Key[6], self.Platform.SkuInfos.SkuInfoList, '', '', '', '', '', Key[2])
- if Status == False:
- ErrorMsg = "The SKUID '%s' used in section '%s' is not defined in section [SkuIds]" % (SkuInfoList, Type)
- EdkLogger.error("DSC File Parser", PARSER_ERROR, ErrorMsg, ContainerFile, RaiseError=EdkLogger.IsRaiseError)
- Pcd = PcdClass(Key[0], '', Key[1], Key[3], Key[4], Key[2], Key[5], [], SkuInfoList, [])
- Pcd.SupArchList = Pcds[Key]
- self.Platform.DynamicPcdBuildDefinitions.append(Pcd)
-
- ## Gen DynamicHiiPcds
- #
- # Gen DynamicHiiPcds of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<String>|<VariableGuidCName>|<VariableOffset>[|<DefaultValue>[|<MaximumDatumSize>]]
- #
- # @param Type: The type of Pcd
- # @param ContainerFile: The file which describes the pcd, used for error report
- #
- def GenDynamicHiiPcds(self, Type='', ContainerFile=''):
- Pcds = {}
- SkuInfoList = {}
- if Type == DataType.TAB_PCDS_DYNAMIC_HII:
- Model = MODEL_PCD_DYNAMIC_HII
- elif Type == DataType.TAB_PCDS_DYNAMIC_EX_HII:
- Model = MODEL_PCD_DYNAMIC_EX_HII
- else:
- pass
- EdkLogger.debug(2, "Generate %s ..." % Type)
-
- #
- # Get all include files
- #
- IncludeFiles = QueryDscItem(self.TblDsc, MODEL_META_DATA_INCLUDE, Model, self.FileID)
-
- #
- # Get all DynamicHiiPcds
- #
- RecordSet = QueryDscItem(self.TblDsc, Model, -1, self.FileID)
-
- #
- # Go through each arch
- #
- for Arch in DataType.ARCH_LIST:
- for IncludeFile in IncludeFiles:
- if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
- Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, Type, '', IncludeFile[2])
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- (K1, K2, K3, K4, K5, K6, K7, K8) = GetDynamicHiiPcd(NewItem, Type, Filename, -1)
- MergeArches(Pcds, (K1, K2, K3, K4, K5, K6, K7, K8, IncludeFile[4]), Arch)
- self.PcdToken[Record[3]] = (K2, K1)
-
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
- (K1, K2, K3, K4, K5, K6, K7, K8) = GetDynamicHiiPcd(Record[0], Type, ContainerFile, Record[2])
- MergeArches(Pcds, (K1, K2, K3, K4, K5, K6, K7, K8, Record[4]), Arch)
- self.PcdToken[Record[3]] = (K2, K1)
-
- for Key in Pcds:
- (Status, SkuInfoList) = self.GenSkuInfoList(Key[8], self.Platform.SkuInfos.SkuInfoList, Key[2], Key[3], Key[4], Key[5], '', '')
- if Status == False:
- ErrorMsg = "The SKUID '%s' used in section '%s' is not defined in section [SkuIds]" % (SkuInfoList, Type)
- EdkLogger.error("DSC File Parser", PARSER_ERROR, ErrorMsg, ContainerFile, RaiseError=EdkLogger.IsRaiseError)
- Pcd = PcdClass(Key[0], '', Key[1], '', Key[6], Key[5], Key[7], [], SkuInfoList, [])
- Pcd.SupArchList = Pcds[Key]
- self.Platform.DynamicPcdBuildDefinitions.append(Pcd)
-
- ## Gen DynamicVpdPcds
- #
- # Gen DynamicVpdPcds of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<VpdOffset>[|<MaximumDatumSize>]
- #
- # @param Type: The type of Pcd
- # @param ContainerFile: The file which describes the pcd, used for error report
- #
- def GenDynamicVpdPcds(self, Type='', ContainerFile=''):
- Pcds = {}
- SkuInfoList = {}
- if Type == DataType.TAB_PCDS_DYNAMIC_VPD:
- Model = MODEL_PCD_DYNAMIC_VPD
- elif Type == DataType.TAB_PCDS_DYNAMIC_EX_VPD:
- Model = MODEL_PCD_DYNAMIC_EX_VPD
- else:
- pass
- EdkLogger.debug(2, "Generate %s ..." % Type)
-
- #
- # Get all include files
- #
- IncludeFiles = QueryDscItem(self.TblDsc, MODEL_META_DATA_INCLUDE, Model, self.FileID)
-
- #
- # Get all DynamicVpdPcds
- #
- RecordSet = QueryDscItem(self.TblDsc, Model, -1, self.FileID)
-
- #
- # Go through each arch
- #
- for Arch in DataType.ARCH_LIST:
- for IncludeFile in IncludeFiles:
- if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
- Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, Type, '', IncludeFile[2])
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- (K1, K2, K3, K4, K5) = GetDynamicVpdPcd(NewItem, Type, Filename, -1)
- MergeArches(Pcds, (K1, K2, K3, K4, K5, IncludeFile[4]), Arch)
- self.PcdToken[Record[3]] = (K2, K1)
-
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
- (K1, K2, K3, K4, K5) = GetDynamicVpdPcd(Record[0], Type, ContainerFile, Record[2])
- MergeArches(Pcds, (K1, K2, K3, K4, K5, Record[4]), Arch)
- self.PcdToken[Record[3]] = (K2, K1)
-
- for Key in Pcds:
- (Status, SkuInfoList) = self.GenSkuInfoList(Key[5], self.Platform.SkuInfos.SkuInfoList, '', '', '', '', Key[2], '')
- if Status == False:
- ErrorMsg = "The SKUID '%s' used in section '%s' is not defined in section [SkuIds]" % (SkuInfoList, Type)
- EdkLogger.error("DSC File Parser", PARSER_ERROR, ErrorMsg, ContainerFile, RaiseError=EdkLogger.IsRaiseError)
- Pcd = PcdClass(Key[0], '', Key[1], '', Key[3], '', Key[4], [], SkuInfoList, [])
- Pcd.SupArchList = Pcds[Key]
- self.Platform.DynamicPcdBuildDefinitions.append(Pcd)
-
-
- ## Get Component
- #
- # Get Component section defined in Dsc file
- #
- # @param ContainerFile: The file which describes the Components, used for error report
- #
- # @retval PlatformModuleClass() A instance for PlatformModuleClass
- #
- def GenComponents(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_COMPONENTS)
- Components = sdict()
- #
- # Get all include files
- #
- IncludeFiles = QueryDscItem(self.TblDsc, MODEL_META_DATA_INCLUDE, MODEL_META_DATA_COMPONENT, self.FileID)
-
- #
- # Get all Components
- #
- RecordSet = QueryDscItem(self.TblDsc, MODEL_META_DATA_COMPONENT, -1, self.FileID)
-
- #
- # Go through each arch
- #
- for Arch in DataType.ARCH_LIST:
- for IncludeFile in IncludeFiles:
- if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():
- Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, TAB_COMPONENTS, '', IncludeFile[2])
- for NewItem in open(Filename, 'r').readlines():
- if CleanString(NewItem) == '':
- continue
- NewItems = []
- GetComponents(open(Filename, 'r').read(), TAB_COMPONENTS, NewItems, TAB_COMMENT_SPLIT)
- for NewComponent in NewItems:
- MergeArches(Components, self.GenComponent(NewComponent, Filename), Arch)
-
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():
- Lib, Bo, Pcd = [], [], []
-
- SubLibSet = QueryDscItem(self.TblDsc, MODEL_EFI_LIBRARY_CLASS, Record[3], self.FileID)
- for SubLib in SubLibSet:
- Lib.append(TAB_VALUE_SPLIT.join([SubLib[0], SubLib[4]]))
-
- SubBoSet = QueryDscItem(self.TblDsc, MODEL_META_DATA_BUILD_OPTION, Record[3], self.FileID)
- for SubBo in SubBoSet:
- Bo.append(SubBo[0])
-
- SubPcdSet1 = QueryDscItem(self.TblDsc, MODEL_PCD_FIXED_AT_BUILD, Record[3], self.FileID)
- SubPcdSet2 = QueryDscItem(self.TblDsc, MODEL_PCD_PATCHABLE_IN_MODULE, Record[3], self.FileID)
- SubPcdSet3 = QueryDscItem(self.TblDsc, MODEL_PCD_FEATURE_FLAG, Record[3], self.FileID)
- SubPcdSet4 = QueryDscItem(self.TblDsc, MODEL_PCD_DYNAMIC_EX_DEFAULT, Record[3], self.FileID)
- SubPcdSet5 = QueryDscItem(self.TblDsc, MODEL_PCD_DYNAMIC_DEFAULT, Record[3], self.FileID)
- for SubPcd in SubPcdSet1:
- Pcd.append([DataType.TAB_PCDS_FIXED_AT_BUILD, SubPcd[0], SubPcd[3]])
- for SubPcd in SubPcdSet2:
- Pcd.append([DataType.TAB_PCDS_PATCHABLE_IN_MODULE, SubPcd[0], SubPcd[3]])
- for SubPcd in SubPcdSet3:
- Pcd.append([DataType.TAB_PCDS_FEATURE_FLAG, SubPcd[0], SubPcd[3]])
- for SubPcd in SubPcdSet4:
- Pcd.append([DataType.TAB_PCDS_DYNAMIC_EX, SubPcd[0], SubPcd[3]])
- for SubPcd in SubPcdSet5:
- Pcd.append([DataType.TAB_PCDS_DYNAMIC, SubPcd[0], SubPcd[3]])
- Item = [Record[0], Lib, Bo, Pcd]
- MergeArches(Components, self.GenComponent(Item, ContainerFile), Arch)
-
- for Key in Components.keys():
- Key.SupArchList = Components[Key]
- self.Platform.Modules.ModuleList.append(Key)
-
- ## Get Component
- #
- # Get Component section defined in Dsc file
- #
- # @param Item: Contents includes a component block
- # @param ContainerFile: The file which describes the library class, used for error report
- #
- # @retval PlatformModuleClass() A instance for PlatformModuleClass
- #
- def GenComponent(self, Item, ContainerFile, LineNo= -1):
- (InfFilename, ExecFilename) = GetExec(Item[0])
- LibraryClasses = Item[1]
- BuildOptions = Item[2]
- Pcds = Item[3]
- Component = PlatformModuleClass()
- Component.FilePath = NormPath(InfFilename)
- Component.ExecFilePath = NormPath(ExecFilename)
- CheckFileType(Component.FilePath, '.Inf', ContainerFile, 'component name', Item[0], LineNo)
- CheckFileExist(self.WorkspaceDir, Component.FilePath, ContainerFile, 'component', Item[0], LineNo)
- for Lib in LibraryClasses:
- List = GetSplitValueList(Lib)
- if len(List) != 2:
- RaiseParserError(Lib, 'LibraryClasses', ContainerFile, '<ClassName>|<InfFilename>')
- LibName = List[0]
- LibFile = NormPath(List[1])
- if LibName == "" or LibName == "NULL":
- LibName = "NULL%d" % self._NullClassIndex
- self._NullClassIndex += 1
- CheckFileType(List[1], '.Inf', ContainerFile, 'library instance of component ', Lib, LineNo)
- CheckFileExist(self.WorkspaceDir, LibFile, ContainerFile, 'library instance of component', Lib, LineNo)
- Component.LibraryClasses.LibraryList.append(PlatformLibraryClass(LibName, LibFile))
- for BuildOption in BuildOptions:
- Key = GetBuildOption(BuildOption, ContainerFile)
- Component.ModuleSaBuildOption.BuildOptionList.append(BuildOptionClass(Key[0], Key[1], Key[2]))
- for Pcd in Pcds:
- Type = Pcd[0]
- List = GetSplitValueList(Pcd[1])
- PcdId = Pcd[2]
-
- TokenInfo = None
- #
- # For FeatureFlag
- #
- if Type == DataType.TAB_PCDS_FEATURE_FLAG:
- if len(List) != 2:
- RaiseParserError(Pcd[1], 'Components', ContainerFile, '<PcdTokenSpaceGuidCName>.<PcdTokenName>|TRUE/FALSE')
-
- CheckPcdTokenInfo(List[0], 'Components', ContainerFile)
- TokenInfo = GetSplitValueList(List[0], DataType.TAB_SPLIT)
- Component.PcdBuildDefinitions.append(PcdClass(TokenInfo[1], '', TokenInfo[0], '', '', List[1], Type, [], {}, []))
- #
- # For FixedAtBuild or PatchableInModule
- #
- if Type == DataType.TAB_PCDS_FIXED_AT_BUILD or Type == DataType.TAB_PCDS_PATCHABLE_IN_MODULE:
- List.append('')
- if len(List) != 3 and len(List) != 4:
- RaiseParserError(Pcd[1], 'Components', ContainerFile, '<PcdTokenSpaceGuidCName>.<PcdTokenName>|<Value>[|<MaxDatumSize>]')
-
- CheckPcdTokenInfo(List[0], 'Components', ContainerFile)
- TokenInfo = GetSplitValueList(List[0], DataType.TAB_SPLIT)
- Component.PcdBuildDefinitions.append(PcdClass(TokenInfo[1], '', TokenInfo[0], '', List[2], List[1], Type, [], {}, []))
-
- #
- # For Dynamic or DynamicEx
- #
- if Type == DataType.TAB_PCDS_DYNAMIC or Type == DataType.TAB_PCDS_DYNAMIC_EX:
- if len(List) != 1:
- RaiseParserError(Pcd[1], 'Components', ContainerFile, '<PcdTokenSpaceGuidCName>.<PcdTokenName>')
-
- CheckPcdTokenInfo(List[0], 'Components', ContainerFile)
- TokenInfo = GetSplitValueList(List[0], DataType.TAB_SPLIT)
- Component.PcdBuildDefinitions.append(PcdClass(TokenInfo[1], '', TokenInfo[0], '', '', '', Type, [], {}, []))
-
- #
- # Add to PcdToken
- #
- self.PcdToken[PcdId] = (TokenInfo[0], TokenInfo[1])
-
- return Component
- #End of GenComponent
-
- ## Gen SkuInfoList
- #
- # Gen SkuInfoList section defined in Dsc file
- #
- # @param SkuNameList: Input value for SkuNameList
- # @param SkuInfo: Input value for SkuInfo
- # @param VariableName: Input value for VariableName
- # @param VariableGuid: Input value for VariableGuid
- # @param VariableOffset: Input value for VariableOffset
- # @param HiiDefaultValue: Input value for HiiDefaultValue
- # @param VpdOffset: Input value for VpdOffset
- # @param DefaultValue: Input value for DefaultValue
- #
- # @retval (False, SkuName) Not found in section SkuId Dsc file
- # @retval (True, SkuInfoList) Found in section SkuId of Dsc file
- #
- def GenSkuInfoList(self, SkuNameList, SkuInfo, VariableName='', VariableGuid='', VariableOffset='', HiiDefaultValue='', VpdOffset='', DefaultValue=''):
- SkuNameList = GetSplitValueList(SkuNameList)
- if SkuNameList == None or SkuNameList == [] or SkuNameList == ['']:
- SkuNameList = ['DEFAULT']
- SkuInfoList = {}
- for Item in SkuNameList:
- if Item not in SkuInfo:
- return False, Item
- Sku = SkuInfoClass(Item, SkuInfo[Item], VariableName, VariableGuid, VariableOffset, HiiDefaultValue, VpdOffset, DefaultValue)
- SkuInfoList[Item] = Sku
-
- return True, SkuInfoList
-
- ## Parse Include statement
- #
- # Get include file path
- #
- # 1. Insert a record into TblFile ???
- # 2. Insert a record into TblDsc
- # Value1: IncludeFilePath
- #
- # @param LineValue: The line of incude statement
- def ParseInclude(self, LineValue, StartLine, Table, FileID, Filename, SectionName, Model, Arch):
- EdkLogger.debug(EdkLogger.DEBUG_2, "!include statement '%s' found in section %s" % (LineValue, SectionName))
- SectionModel = Section[SectionName.upper()]
- IncludeFile = CleanString(LineValue[LineValue.upper().find(DataType.TAB_INCLUDE.upper() + ' ') + len(DataType.TAB_INCLUDE + ' ') : ])
- Table.Insert(Model, IncludeFile, '', '', Arch, SectionModel, FileID, StartLine, -1, StartLine, -1, 0)
-
- ## Parse DEFINE statement
- #
- # Get DEFINE macros
- #
- # 1. Insert a record into TblDsc
- # Value1: Macro Name
- # Value2: Macro Value
- #
- def ParseDefine(self, LineValue, StartLine, Table, FileID, Filename, SectionName, Model, Arch):
- EdkLogger.debug(EdkLogger.DEBUG_2, "DEFINE statement '%s' found in section %s" % (LineValue, SectionName))
- SectionModel = Section[SectionName.upper()]
- Define = GetSplitValueList(CleanString(LineValue[LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') + len(DataType.TAB_DEFINE + ' ') : ]), TAB_EQUAL_SPLIT, 1)
- Table.Insert(Model, Define[0], Define[1], '', Arch, SectionModel, FileID, StartLine, -1, StartLine, -1, 0)
-
- ## Parse Defines section
- #
- # Get one item in defines section
- #
- # Value1: Item Name
- # Value2: Item Value
- #
- def ParseDefinesSection(self, LineValue, StartLine, Table, FileID, Filename, SectionName, Model, Arch):
- EdkLogger.debug(EdkLogger.DEBUG_2, "Parse '%s' found in section %s" % (LineValue, SectionName))
- Defines = GetSplitValueList(LineValue, TAB_EQUAL_SPLIT, 1)
- if len(Defines) != 2:
- RaiseParserError(LineValue, SectionName, Filename, '', StartLine)
- self.TblDsc.Insert(Model, Defines[0], Defines[1], '', Arch, -1, FileID, StartLine, -1, StartLine, -1, 0)
-
- ## Insert conditional statements
- #
- # Pop an item from IfDefList
- # Insert conditional statements to database
- #
- # @param Filename: Path of parsing file
- # @param IfDefList: A list stored current conditional statements
- # @param EndLine: The end line no
- # @param ArchList: Support arch list
- #
- def InsertConditionalStatement(self, Filename, FileID, BelongsToItem, IfDefList, EndLine, ArchList):
- (Value1, Value2, Value3, Model, StartColumn, EndColumn, Enabled) = ('', '', '', -1, -1, -1, 0)
- if IfDefList == []:
- ErrorMsg = 'Not suited conditional statement in file %s' % Filename
- EdkLogger.error("DSC File Parser", PARSER_ERROR, ErrorMsg, Filename, RaiseError=EdkLogger.IsRaiseError)
- else:
- #
- # Get New Dsc item ID
- #
- DscID = self.TblDsc.GetCount() + 1
-
- #
- # Pop the conditional statements which is closed
- #
- PreviousIf = IfDefList.pop()
- EdkLogger.debug(EdkLogger.DEBUG_5, 'Previous IfDef: ' + str(PreviousIf))
-
- #
- # !ifdef and !ifndef
- #
- if PreviousIf[2] in (MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF, MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF):
- Value1 = PreviousIf[0]
- Model = PreviousIf[2]
- self.TblDsc.Insert(Model, Value1, Value2, Value3, ArchList, BelongsToItem, self.FileID, PreviousIf[1], StartColumn, EndLine, EndColumn, Enabled)
- #
- # !if and !elseif
- #
- elif PreviousIf[2] in (MODEL_META_DATA_CONDITIONAL_STATEMENT_IF, Model):
- List = PreviousIf[0].split(' ')
- Value1, Value2, Value3 = '', '==', '0'
- if len(List) == 3:
- Value1 = List[0]
- Value2 = List[1]
- Value3 = List[2]
- Value3 = SplitString(Value3)
- if len(List) == 1:
- Value1 = List[0]
- Model = PreviousIf[2]
- self.TblDsc.Insert(Model, Value1, Value2, Value3, ArchList, BelongsToItem, self.FileID, PreviousIf[1], StartColumn, EndLine, EndColumn, Enabled)
- #
- # !else
- #
- elif PreviousIf[2] in (MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE, Model):
- Value1 = PreviousIf[0].strip()
- Model = PreviousIf[2]
- self.TblDsc.Insert(Model, Value1, Value2, Value3, ArchList, BelongsToItem, self.FileID, PreviousIf[1], StartColumn, EndLine, EndColumn, Enabled)
-
- ## Load Dsc file
- #
- # Load the file if it exists
- #
- # @param Filename: Input value for filename of Dsc file
- #
- def LoadDscFile(self, Filename):
- #
- # Insert a record for file
- #
- Filename = NormPath(Filename)
- self.Identification.FileFullPath = Filename
- (self.Identification.FileRelativePath, self.Identification.FileName) = os.path.split(Filename)
- self.FileID = self.TblFile.InsertFile(Filename, MODEL_FILE_DSC)
-
- #
- # Init DscTable
- #
- #self.TblDsc.Table = "Dsc%s" % FileID
- #self.TblDsc.Create()
-
- #
- # Init common datas
- #
- IfDefList, SectionItemList, CurrentSection, ArchList, ThirdList, IncludeFiles = \
- [], [], TAB_UNKNOWN, [], [], []
- LineNo = 0
-
- #
- # Parse file content
- #
- IsFindBlockComment = False
- ReservedLine = ''
- for Line in open(Filename, 'r'):
- LineNo = LineNo + 1
- #
- # Remove comment block
- #
- if Line.find(TAB_COMMENT_EDK_START) > -1:
- ReservedLine = GetSplitList(Line, TAB_COMMENT_EDK_START, 1)[0]
- IsFindBlockComment = True
- if Line.find(TAB_COMMENT_EDK_END) > -1:
- Line = ReservedLine + GetSplitList(Line, TAB_COMMENT_EDK_END, 1)[1]
- ReservedLine = ''
- IsFindBlockComment = False
- if IsFindBlockComment:
- continue
-
- #
- # Remove comments at tail and remove spaces again
- #
- Line = CleanString(Line)
- if Line == '':
- continue
-
- #
- # Find a new section tab
- # First insert previous section items
- # And then parse the content of the new section
- #
- if Line.startswith(TAB_SECTION_START) and Line.endswith(TAB_SECTION_END):
- #
- # Insert items data of previous section
- #
- self.InsertSectionItemsIntoDatabase(self.FileID, Filename, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList)
- #
- # Parse the new section
- #
- SectionItemList = []
- ArchList = []
- ThirdList = []
-
- CurrentSection = ''
- LineList = GetSplitValueList(Line[len(TAB_SECTION_START):len(Line) - len(TAB_SECTION_END)], TAB_COMMA_SPLIT)
- for Item in LineList:
- ItemList = GetSplitValueList(Item, TAB_SPLIT)
- if CurrentSection == '':
- CurrentSection = ItemList[0]
- else:
- if CurrentSection != ItemList[0]:
- EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
- if CurrentSection.upper() not in self.KeyList:
- RaiseParserError(Line, CurrentSection, Filename, '', LineNo)
- CurrentSection = TAB_UNKNOWN
- continue
- ItemList.append('')
- ItemList.append('')
- if len(ItemList) > 5:
- RaiseParserError(Line, CurrentSection, Filename, '', LineNo)
- else:
- if ItemList[1] != '' and ItemList[1].upper() not in ARCH_LIST_FULL:
- EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
- ArchList.append(ItemList[1].upper())
- ThirdList.append(ItemList[2])
-
- continue
-
- #
- # Not in any defined section
- #
- if CurrentSection == TAB_UNKNOWN:
- ErrorMsg = "%s is not in any defined section" % Line
- EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
-
- #
- # Add a section item
- #
- SectionItemList.append([Line, LineNo])
- # End of parse
- #End of For
-
- #
- # Insert items data of last section
- #
- self.InsertSectionItemsIntoDatabase(self.FileID, Filename, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList)
-
- #
- # Parse conditional statements
- #
- self.ParseConditionalStatement()
-
- #
- # Replace all DEFINE macros with its actual values
- #
- #ParseDefineMacro2(self.TblDsc, self.RecordSet, GlobalData.gGlobalDefines)
- ParseDefineMacro(self.TblDsc, GlobalData.gGlobalDefines)
-
-
- ## ParseConditionalStatement
- #
- # Search all conditional statement and disable no match records
- #
- def ParseConditionalStatement(self):
- #
- # Disabled all !if/!elif/!ifdef statements without DEFINE
- #
- SqlCommand = """select A.StartLine, A.EndLine from %s as A
- where A.Model in (%s, %s, %s)
- and A.Enabled = 0
- and A.BelongsToFile = %s
- and A.Value1 not in (select B.Value1 from %s as B
- where B.Model = %s
- and B.Enabled = 0
- and A.StartLine > B.StartLine
- and A.Arch = B.Arch
- and A.BelongsToItem = B.BelongsToItem
- and A.BelongsToFile = B.BelongsToFile) """ % \
- (self.TblDsc.Table, \
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IF, MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE, MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF, \
- self.FileID, \
- self.TblDsc.Table, \
- MODEL_META_DATA_DEFINE)
- RecordSet = self.TblDsc.Exec(SqlCommand)
- for Record in RecordSet:
- SqlCommand = """Update %s set Enabled = -1 where StartLine >= %s and EndLine <= %s""" % (self.TblDsc.Table, Record[0], Record[1])
- self.TblDsc.Exec(SqlCommand)
-
- #
- # Disabled !ifndef with DEFINE
- #
- SqlCommand = """select A.StartLine, A.EndLine from %s as A
- where A.Model = %s
- and A.Enabled = 0
- and A.BelongsToFile = %s
- and A.Value1 in (select B.Value1 from %s as B
- where B.Model = %s
- and B.Enabled = 0
- and A.StartLine > B.StartLine
- and A.Arch = B.Arch
- and A.BelongsToItem = B.BelongsToItem
- and A.BelongsToFile = B.BelongsToFile)""" % \
- (self.TblDsc.Table, \
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF, \
- self.FileID, \
- self.TblDsc.Table, \
- MODEL_META_DATA_DEFINE)
- RecordSet = self.TblDsc.Exec(SqlCommand)
- for Record in RecordSet:
- SqlCommand = """Update %s set Enabled = -1 where StartLine >= %s and EndLine <= %s""" % (self.TblDsc.Table, Record[0], Record[1])
- EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)
- self.Cur.execute(SqlCommand)
-
- #
- # Disabled !if, !elif and !else with un-match value
- #
- SqlCommand = """select A.Model, A.Value1, A.Value2, A.Value3, A.StartLine, A.EndLine, B.Value2 from %s as A join %s as B
- where A.Model in (%s, %s)
- and A.Enabled = 0
- and A.BelongsToFile = %s
- and B.Enabled = 0
- and B.Model = %s
- and A.Value1 = B.Value1
- and A.StartLine > B.StartLine
- and A.BelongsToItem = B.BelongsToItem
- and A.BelongsToFile = B.BelongsToFile""" % \
- (self.TblDsc.Table, self.TblDsc.Table, \
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IF, MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE, \
- self.FileID, MODEL_META_DATA_DEFINE)
- RecordSet = self.TblDsc.Exec(SqlCommand)
- DisabledList = []
- for Record in RecordSet:
- if Record[0] == MODEL_META_DATA_CONDITIONAL_STATEMENT_IF:
- if not self.Compare(Record[6], Record[2], Record[3]):
- SqlCommand = """Update %s set Enabled = -1 where StartLine >= %s and EndLine <= %s""" % (self.TblDsc.Table, Record[4], Record[5])
- self.TblDsc.Exec(SqlCommand)
- else:
- DisabledList.append(Record[1])
- continue
- if Record[0] == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE and Record[1] in DisabledList:
- SqlCommand = """Update %s set Enabled = -1 where StartLine >= %s and EndLine <= %s""" % (self.TblDsc.Table, Record[4], Record[5])
- self.TblDsc.Exec(SqlCommand)
-
- ## Compare
- #
- # Compare two values
- # @param Value1:
- # @param CompareType:
- # @param Value2:
- #
- def Compare(self, Value1, CompareType, Value2):
- Command = """Value1 %s Value2""" % CompareType
- return eval(Command)
-
- ## First time to insert records to database
- #
- # Insert item data of a section to database
- # @param FileID: The ID of belonging file
- # @param Filename: The name of belonging file
- # @param CurrentSection: The name of currect section
- # @param SectionItemList: A list of items of the section
- # @param ArchList: A list of arches
- # @param ThirdList: A list of third parameters, ModuleType for LibraryClass and SkuId for Dynamic Pcds
- # @param IfDefList: A list of all conditional statements
- #
- def InsertSectionItemsIntoDatabase(self, FileID, Filename, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList):
- #
- # Insert each item data of a section
- #
- for Index in range(0, len(ArchList)):
- Arch = ArchList[Index]
- Third = ThirdList[Index]
- if Arch == '':
- Arch = TAB_ARCH_COMMON.upper()
-
- Model = Section[CurrentSection.upper()]
- #Records = self.RecordSet[Model]
-
- for SectionItem in SectionItemList:
- BelongsToItem, EndLine, EndColumn = -1, -1, -1
- LineValue, StartLine, EndLine = SectionItem[0], SectionItem[1], SectionItem[1]
-
-
- EdkLogger.debug(4, "Parsing %s ..." % LineValue)
- #
- # Parse '!ifdef'
- #
- if LineValue.upper().find(TAB_IF_DEF.upper()) > -1:
- IfDefList.append((LineValue[len(TAB_IF_N_DEF):].strip(), StartLine, MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF))
- continue
-
- #
- # Parse '!ifndef'
- #
- if LineValue.upper().find(TAB_IF_N_DEF.upper()) > -1:
- IfDefList.append((LineValue[len(TAB_IF_N_DEF):].strip(), StartLine, MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF))
- continue
-
- #
- # Parse '!endif'
- #
- if LineValue.upper().find(TAB_END_IF.upper()) > -1:
- self.InsertConditionalStatement(Filename, FileID, Model, IfDefList, StartLine, Arch)
- continue
- #
- # Parse '!if'
- #
- if LineValue.upper().find(TAB_IF.upper()) > -1:
- IfDefList.append((LineValue[len(TAB_IF):].strip(), StartLine, MODEL_META_DATA_CONDITIONAL_STATEMENT_IF))
- continue
-
- #
- # Parse '!elseif'
- #
- if LineValue.upper().find(TAB_ELSE_IF.upper()) > -1:
- self.InsertConditionalStatement(Filename, FileID, Model, IfDefList, StartLine - 1, Arch)
- IfDefList.append((LineValue[len(TAB_ELSE_IF):].strip(), StartLine, MODEL_META_DATA_CONDITIONAL_STATEMENT_IF))
- continue
-
- #
- # Parse '!else'
- #
- if LineValue.upper().find(TAB_ELSE.upper()) > -1:
- Key = IfDefList[-1][0].split(' ' , 1)[0].strip()
- self.InsertConditionalStatement(Filename, FileID, Model, IfDefList, StartLine, Arch)
- IfDefList.append((Key, StartLine, MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE))
- continue
-
- #
- # Parse !include statement first
- #
- if LineValue.upper().find(DataType.TAB_INCLUDE.upper() + ' ') > -1:
- self.ParseInclude(LineValue, StartLine, self.TblDsc, FileID, Filename, CurrentSection, MODEL_META_DATA_INCLUDE, Arch)
- continue
-
- #
- # And then parse DEFINE statement
- #
- if LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') > -1:
- self.ParseDefine(LineValue, StartLine, self.TblDsc, FileID, Filename, CurrentSection, MODEL_META_DATA_DEFINE, Arch)
- continue
-
- #
- # At last parse other sections
- #
- if CurrentSection == TAB_LIBRARY_CLASSES or CurrentSection in TAB_PCD_DYNAMIC_TYPE_LIST or CurrentSection in TAB_PCD_DYNAMIC_EX_TYPE_LIST:
- ID = self.TblDsc.Insert(Model, LineValue, Third, '', Arch, -1, FileID, StartLine, -1, StartLine, -1, 0)
- #Records.append([LineValue, Arch, StartLine, ID, Third])
- continue
- elif CurrentSection != TAB_COMPONENTS:
- ID = self.TblDsc.Insert(Model, LineValue, '', '', Arch, -1, FileID, StartLine, -1, StartLine, -1, 0)
- #Records.append([LineValue, Arch, StartLine, ID, Third])
- continue
-
- #
- # Parse COMPONENT section
- #
- if CurrentSection == TAB_COMPONENTS:
- Components = []
- GetComponent(SectionItemList, Components)
- for Component in Components:
- EdkLogger.debug(4, "Parsing component %s ..." % Component)
- DscItmeID = self.TblDsc.Insert(MODEL_META_DATA_COMPONENT, Component[0], '', '', Arch, -1, FileID, StartLine, -1, StartLine, -1, 0)
- for Item in Component[1]:
- List = GetSplitValueList(Item, MaxSplit=2)
- LibName, LibIns = '', ''
- if len(List) == 2:
- LibName = List[0]
- LibIns = List[1]
- else:
- LibName = List[0]
- self.TblDsc.Insert(MODEL_EFI_LIBRARY_CLASS, LibName, LibIns, '', Arch, DscItmeID, FileID, StartLine, -1, StartLine, -1, 0)
- for Item in Component[2]:
- self.TblDsc.Insert(MODEL_META_DATA_BUILD_OPTION, Item, '', '', Arch, DscItmeID, FileID, StartLine, -1, StartLine, -1, 0)
- for Item in Component[3]:
- Model = Section[Item[0].upper()]
- self.TblDsc.Insert(Model, Item[1], '', '', Arch, DscItmeID, FileID, StartLine, -1, StartLine, -1, 0)
-
- ## Show detailed information of Dsc
- #
- # Print all members and their values of Dsc class
- #
- def ShowDsc(self):
- print TAB_SECTION_START + TAB_INF_DEFINES + TAB_SECTION_END
- printDict(self.Defines.DefinesDictionary)
-
- for Key in self.KeyList:
- for Arch in DataType.ARCH_LIST_FULL:
- Command = "printList(TAB_SECTION_START + '" + \
- Key + DataType.TAB_SPLIT + Arch + \
- "' + TAB_SECTION_END, self.Contents[arch]." + Key + ')'
- eval(Command)
-
- ## Show detailed information of Platform
- #
- # Print all members and their values of Platform class
- #
- def ShowPlatform(self):
- M = self.Platform
- for Arch in M.Header.keys():
- print '\nArch =', Arch
- print 'Filename =', M.Header[Arch].FileName
- print 'FullPath =', M.Header[Arch].FullPath
- print 'BaseName =', M.Header[Arch].Name
- print 'Guid =', M.Header[Arch].Guid
- print 'Version =', M.Header[Arch].Version
- print 'DscSpecification =', M.Header[Arch].DscSpecification
- print 'SkuId =', M.Header[Arch].SkuIdName
- print 'SupArchList =', M.Header[Arch].SupArchList
- print 'BuildTargets =', M.Header[Arch].BuildTargets
- print 'OutputDirectory =', M.Header[Arch].OutputDirectory
- print 'BuildNumber =', M.Header[Arch].BuildNumber
- print 'MakefileName =', M.Header[Arch].MakefileName
- print 'BsBaseAddress =', M.Header[Arch].BsBaseAddress
- print 'RtBaseAddress =', M.Header[Arch].RtBaseAddress
- print 'Define =', M.Header[Arch].Define
- print 'Fdf =', M.FlashDefinitionFile.FilePath
- print '\nBuildOptions =', M.BuildOptions, M.BuildOptions.IncludeFiles
- for Item in M.BuildOptions.BuildOptionList:
- print '\t', 'ToolChainFamily =', Item.ToolChainFamily, 'ToolChain =', Item.ToolChain, 'Option =', Item.Option, 'Arch =', Item.SupArchList
- print '\nSkuIds =', M.SkuInfos.SkuInfoList, M.SkuInfos.IncludeFiles
- print '\nLibraries =', M.Libraries, M.Libraries.IncludeFiles
- for Item in M.Libraries.LibraryList:
- print '\t', Item.FilePath, Item.SupArchList, Item.Define
- print '\nLibraryClasses =', M.LibraryClasses, M.LibraryClasses.IncludeFiles
- for Item in M.LibraryClasses.LibraryList:
- print '\t', Item.Name, Item.FilePath, Item.SupModuleList, Item.SupArchList, Item.Define
- print '\nPcds =', M.DynamicPcdBuildDefinitions
- for Item in M.DynamicPcdBuildDefinitions:
- print '\tCname=', Item.CName, 'TSG=', Item.TokenSpaceGuidCName, 'Value=', Item.DefaultValue, 'Token=', Item.Token, 'Type=', Item.ItemType, 'Datum=', Item.DatumType, 'Size=', Item.MaxDatumSize, 'Arch=', Item.SupArchList, Item.SkuInfoList
- for Sku in Item.SkuInfoList.values():
- print '\t\t', str(Sku)
- print '\nComponents =', M.Modules.ModuleList, M.Modules.IncludeFiles
- for Item in M.Modules.ModuleList:
- print '\t', Item.FilePath, Item.ExecFilePath, Item.SupArchList
- for Lib in Item.LibraryClasses.LibraryList:
- print '\t\tLib:', Lib.Name, Lib.FilePath
- for Bo in Item.ModuleSaBuildOption.BuildOptionList:
- print '\t\tBuildOption:', Bo.ToolChainFamily, Bo.ToolChain, Bo.Option
- for Pcd in Item.PcdBuildDefinitions:
- print '\t\tPcd:', Pcd.CName, Pcd.TokenSpaceGuidCName, Pcd.MaxDatumSize, Pcd.DefaultValue, Pcd.ItemType
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- EdkLogger.Initialize()
- EdkLogger.SetLevel(EdkLogger.DEBUG_0)
-
- W = os.getenv('WORKSPACE')
- F = os.path.join(W, 'Nt32Pkg/Nt32Pkg.dsc')
-
- Db = Database.Database('Dsc.db')
- Db.InitDatabase()
-
- P = Dsc(os.path.normpath(F), True, True, W, Db)
- P.ShowPlatform()
-
- Db.Close()
diff --git a/BaseTools/Source/Python/Common/EdkIIWorkspace.py b/BaseTools/Source/Python/Common/EdkIIWorkspace.py
deleted file mode 100644
index d041b35411..0000000000
--- a/BaseTools/Source/Python/Common/EdkIIWorkspace.py
+++ /dev/null
@@ -1,318 +0,0 @@
-## @file
-# This is the base class for applications that operate on an EDK II Workspace
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os, sys, time
-from DataType import *
-
-## EdkIIWorkspace
-#
-# Collect WorkspaceDir from the environment, the Verbose command line flag, and detect an icon bitmap file.
-#
-# @var StartTime: Time of build system starting
-# @var PrintRunTime: Printable time of build system running
-# @var PrintRunStatus: Printable status of build system running
-# @var RunStatus: Status of build system running
-#
-class EdkIIWorkspace:
- def __init__(self):
- self.StartTime = time.time()
- self.PrintRunTime = False
- self.PrintRunStatus = False
- self.RunStatus = ''
-
- #
- # Check environment valiable 'WORKSPACE'
- #
- if os.environ.get('WORKSPACE') == None:
- print 'ERROR: WORKSPACE not defined. Please run EdkSetup from the EDK II install directory.'
- return False
-
- self.CurrentWorkingDir = os.getcwd()
-
- self.WorkspaceDir = os.path.realpath(os.environ.get('WORKSPACE'))
- (Drive, Path) = os.path.splitdrive(self.WorkspaceDir)
- if Drive == '':
- (Drive, CwdPath) = os.path.splitdrive(self.CurrentWorkingDir)
- if Drive != '':
- self.WorkspaceDir = Drive + Path
- else:
- self.WorkspaceDir = Drive.upper() + Path
-
- self.WorkspaceRelativeWorkingDir = self.WorkspaceRelativePath (self.CurrentWorkingDir)
-
- try:
- #
- # Load TianoCoreOrgLogo, used for GUI tool
- #
- self.Icon = wx.Icon(self.WorkspaceFile('tools/Python/TianoCoreOrgLogo.gif'),wx.BITMAP_TYPE_GIF)
- except:
- self.Icon = None
-
- self.Verbose = False
- for Arg in sys.argv:
- if Arg.lower() == '-v':
- self.Verbose = True
-
- ## Close build system
- #
- # Close build system and print running time and status
- #
- def Close(self):
- if self.PrintRunTime:
- Seconds = int(time.time() - self.StartTime)
- if Seconds < 60:
- print 'Run Time: %d seconds' % (Seconds)
- else:
- Minutes = Seconds / 60
- Seconds = Seconds % 60
- if Minutes < 60:
- print 'Run Time: %d minutes %d seconds' % (Minutes, Seconds)
- else:
- Hours = Minutes / 60
- Minutes = Minutes % 60
- print 'Run Time: %d hours %d minutes %d seconds' % (Hours, Minutes, Seconds)
- if self.RunStatus != '':
- print self.RunStatus
-
- ## Convert to a workspace relative filename
- #
- # Convert a full path filename to a workspace relative filename.
- #
- # @param FileName: The filename to be Converted
- #
- # @retval None Workspace dir is not found in the full path
- # @retval string The relative filename
- #
- def WorkspaceRelativePath(self, FileName):
- FileName = os.path.realpath(FileName)
- if FileName.find(self.WorkspaceDir) != 0:
- return None
- return FileName.replace (self.WorkspaceDir, '').strip('\\').strip('/')
-
- ## Convert to a full path filename
- #
- # Convert a workspace relative filename to a full path filename.
- #
- # @param FileName: The filename to be Converted
- #
- # @retval string The full path filename
- #
- def WorkspaceFile(self, FileName):
- return os.path.realpath(os.path.join(self.WorkspaceDir,FileName))
-
- ## Convert to a real path filename
- #
- # Convert ${WORKSPACE} to real path
- #
- # @param FileName: The filename to be Converted
- #
- # @retval string The full path filename
- #
- def WorkspacePathConvert(self, FileName):
- return os.path.realpath(FileName.replace(TAB_WORKSPACE, self.WorkspaceDir))
-
- ## Convert XML into a DOM
- #
- # Parse an XML file into a DOM and return the DOM.
- #
- # @param FileName: The filename to be parsed
- #
- # @retval XmlParseFile (self.WorkspaceFile(FileName))
- #
- def XmlParseFile (self, FileName):
- if self.Verbose:
- print FileName
- return XmlParseFile (self.WorkspaceFile(FileName))
-
- ## Convert a XML section
- #
- # Parse a section of an XML file into a DOM(Document Object Model) and return the DOM.
- #
- # @param FileName: The filename to be parsed
- # @param SectionTag: The tag name of the section to be parsed
- #
- # @retval XmlParseFileSection (self.WorkspaceFile(FileName), SectionTag)
- #
- def XmlParseFileSection (self, FileName, SectionTag):
- if self.Verbose:
- print FileName
- return XmlParseFileSection (self.WorkspaceFile(FileName), SectionTag)
-
- ## Save a XML file
- #
- # Save a DOM(Document Object Model) into an XML file.
- #
- # @param Dom: The Dom to be saved
- # @param FileName: The filename
- #
- # @retval XmlSaveFile (Dom, self.WorkspaceFile(FileName))
- #
- def XmlSaveFile (self, Dom, FileName):
- if self.Verbose:
- print FileName
- return XmlSaveFile (Dom, self.WorkspaceFile(FileName))
-
- ## Convert Text File To Dictionary
- #
- # Convert a workspace relative text file to a dictionary of (name:value) pairs.
- #
- # @param FileName: Text filename
- # @param Dictionary: Dictionary to store data
- # @param CommentCharacter: Comment char, be used to ignore comment content
- # @param KeySplitCharacter: Key split char, between key name and key value. Key1 = Value1, '=' is the key split char
- # @param ValueSplitFlag: Value split flag, be used to decide if has multiple values
- # @param ValueSplitCharacter: Value split char, be used to split multiple values. Key1 = Value1|Value2, '|' is the value split char
- #
- # @retval ConvertTextFileToDictionary(self.WorkspaceFile(FileName), Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter)
- #
- def ConvertTextFileToDictionary(self, FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
- if self.Verbose:
- print FileName
- return ConvertTextFileToDictionary(self.WorkspaceFile(FileName), Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter)
-
- ## Convert Dictionary To Text File
- #
- # Convert a dictionary of (name:value) pairs to a workspace relative text file.
- #
- # @param FileName: Text filename
- # @param Dictionary: Dictionary to store data
- # @param CommentCharacter: Comment char, be used to ignore comment content
- # @param KeySplitCharacter: Key split char, between key name and key value. Key1 = Value1, '=' is the key split char
- # @param ValueSplitFlag: Value split flag, be used to decide if has multiple values
- # @param ValueSplitCharacter: Value split char, be used to split multiple values. Key1 = Value1|Value2, '|' is the value split char
- #
- # @retval ConvertDictionaryToTextFile(self.WorkspaceFile(FileName), Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter)
- #
- def ConvertDictionaryToTextFile(self, FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
- if self.Verbose:
- print FileName
- return ConvertDictionaryToTextFile(self.WorkspaceFile(FileName), Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter)
-
-## Convert Text File To Dictionary
-#
-# Convert a text file to a dictionary of (name:value) pairs.
-#
-# @param FileName: Text filename
-# @param Dictionary: Dictionary to store data
-# @param CommentCharacter: Comment char, be used to ignore comment content
-# @param KeySplitCharacter: Key split char, between key name and key value. Key1 = Value1, '=' is the key split char
-# @param ValueSplitFlag: Value split flag, be used to decide if has multiple values
-# @param ValueSplitCharacter: Value split char, be used to split multiple values. Key1 = Value1|Value2, '|' is the value split char
-#
-# @retval True Convert successfully
-# @retval False Open file failed
-#
-def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
- try:
- F = open(FileName,'r')
- except:
- return False
- Keys = []
- for Line in F:
- LineList = Line.split(KeySplitCharacter,1)
- if len(LineList) >= 2:
- Key = LineList[0].split()
- if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] not in Keys:
- if ValueSplitFlag:
- Dictionary[Key[0]] = LineList[1].replace('\\','/').split(ValueSplitCharacter)
- else:
- Dictionary[Key[0]] = LineList[1].strip().replace('\\','/')
- Keys += [Key[0]]
- F.close()
- return True
-
-## Convert Dictionary To Text File
-#
-# Convert a dictionary of (name:value) pairs to a text file.
-#
-# @param FileName: Text filename
-# @param Dictionary: Dictionary to store data
-# @param CommentCharacter: Comment char, be used to ignore comment content
-# @param KeySplitCharacter: Key split char, between key name and key value. Key1 = Value1, '=' is the key split char
-# @param ValueSplitFlag: Value split flag, be used to decide if has multiple values
-# @param ValueSplitCharacter: Value split char, be used to split multiple values. Key1 = Value1|Value2, '|' is the value split char
-#
-# @retval True Convert successfully
-# @retval False Open file failed
-#
-def ConvertDictionaryToTextFile(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
- try:
- F = open(FileName,'r')
- Lines = []
- Lines = F.readlines()
- F.close()
- except:
- Lines = []
- Keys = Dictionary.keys()
- MaxLength = 0
- for Key in Keys:
- if len(Key) > MaxLength:
- MaxLength = len(Key)
- Index = 0
- for Line in Lines:
- LineList = Line.split(KeySplitCharacter,1)
- if len(LineList) >= 2:
- Key = LineList[0].split()
- if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] in Dictionary:
- if ValueSplitFlag:
- Line = '%-*s %c %s\n' % (MaxLength, Key[0], KeySplitCharacter, ' '.join(Dictionary[Key[0]]))
- else:
- Line = '%-*s %c %s\n' % (MaxLength, Key[0], KeySplitCharacter, Dictionary[Key[0]])
- Lines.pop(Index)
- if Key[0] in Keys:
- Lines.insert(Index,Line)
- Keys.remove(Key[0])
- Index += 1
- for RemainingKey in Keys:
- if ValueSplitFlag:
- Line = '%-*s %c %s\n' % (MaxLength, RemainingKey, KeySplitCharacter,' '.join(Dictionary[RemainingKey]))
- else:
- Line = '%-*s %c %s\n' % (MaxLength, RemainingKey, KeySplitCharacter, Dictionary[RemainingKey])
- Lines.append(Line)
- try:
- F = open(FileName,'w')
- except:
- return False
- F.writelines(Lines)
- F.close()
- return True
-
-## Create a new directory
-#
-# @param Directory: Directory to be created
-#
-def CreateDirectory(Directory):
- if not os.access(Directory, os.F_OK):
- os.makedirs (Directory)
-
-## Create a new file
-#
-# @param Directory: Directory to be created
-# @param FileName: Filename to be created
-# @param Mode: The mode of open file, defautl is 'w'
-#
-def CreateFile(Directory, FileName, Mode='w'):
- CreateDirectory (Directory)
- return open(os.path.join(Directory, FileName), Mode)
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- # Nothing to do here. Could do some unit tests
- pass \ No newline at end of file
diff --git a/BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py b/BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py
deleted file mode 100644
index 2b5990ebe7..0000000000
--- a/BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py
+++ /dev/null
@@ -1,1670 +0,0 @@
-## @file
-# This file is used to define each component of the build database
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os, string, copy, pdb, copy
-import EdkLogger
-import DataType
-from InfClassObject import *
-from DecClassObject import *
-from DscClassObject import *
-from String import *
-from BuildToolError import *
-from Misc import sdict
-import Database as Database
-import time as time
-
-## PcdClassObject
-#
-# This Class is used for PcdObject
-#
-# @param object: Inherited from object class
-# @param Name: Input value for Name of Pcd, default is None
-# @param Guid: Input value for Guid of Pcd, default is None
-# @param Type: Input value for Type of Pcd, default is None
-# @param DatumType: Input value for DatumType of Pcd, default is None
-# @param Value: Input value for Value of Pcd, default is None
-# @param Token: Input value for Token of Pcd, default is None
-# @param MaxDatumSize: Input value for MaxDatumSize of Pcd, default is None
-# @param SkuInfoList: Input value for SkuInfoList of Pcd, default is {}
-# @param IsOverrided: Input value for IsOverrided of Pcd, default is False
-#
-# @var TokenCName: To store value for TokenCName
-# @var TokenSpaceGuidCName: To store value for TokenSpaceGuidCName
-# @var Type: To store value for Type
-# @var DatumType: To store value for DatumType
-# @var TokenValue: To store value for TokenValue
-# @var MaxDatumSize: To store value for MaxDatumSize
-# @var SkuInfoList: To store value for SkuInfoList
-# @var IsOverrided: To store value for IsOverrided
-# @var Phase: To store value for Phase, default is "DXE"
-#
-class PcdClassObject(object):
- def __init__(self, Name = None, Guid = None, Type = None, DatumType = None, Value = None, Token = None, MaxDatumSize = None, SkuInfoList = {}, IsOverrided = False):
- self.TokenCName = Name
- self.TokenSpaceGuidCName = Guid
- self.Type = Type
- self.DatumType = DatumType
- self.DefaultValue = Value
- self.TokenValue = Token
- self.MaxDatumSize = MaxDatumSize
- self.SkuInfoList = SkuInfoList
- self.IsOverrided = IsOverrided
- self.Phase = "DXE"
-
- ## Convert the class to a string
- #
- # Convert each member of the class to string
- # Organize to a signle line format string
- #
- # @retval Rtn Formatted String
- #
- def __str__(self):
- Rtn = '\tTokenCName=' + str(self.TokenCName) + ', ' + \
- 'TokenSpaceGuidCName=' + str(self.TokenSpaceGuidCName) + ', ' + \
- 'Type=' + str(self.Type) + ', ' + \
- 'DatumType=' + str(self.DatumType) + ', ' + \
- 'DefaultValue=' + str(self.DefaultValue) + ', ' + \
- 'TokenValue=' + str(self.TokenValue) + ', ' + \
- 'MaxDatumSize=' + str(self.MaxDatumSize) + ', '
- for Item in self.SkuInfoList.values():
- Rtn = Rtn + 'SkuId=' + Item.SkuId + ', ' + 'SkuIdName=' + Item.SkuIdName
- Rtn = Rtn + str(self.IsOverrided)
-
- return Rtn
-
- ## Override __eq__ function
- #
- # Check whether pcds are the same
- #
- # @retval False The two pcds are different
- # @retval True The two pcds are the same
- #
- def __eq__(self, Other):
- return Other != None and self.TokenCName == Other.TokenCName and self.TokenSpaceGuidCName == Other.TokenSpaceGuidCName
-
- ## Override __hash__ function
- #
- # Use (TokenCName, TokenSpaceGuidCName) as key in hash table
- #
- # @retval truple() Key for hash table
- #
- def __hash__(self):
- return hash((self.TokenCName, self.TokenSpaceGuidCName))
-
-## LibraryClassObject
-#
-# This Class defines LibraryClassObject used in BuildDatabase
-#
-# @param object: Inherited from object class
-# @param Name: Input value for LibraryClassName, default is None
-# @param SupModList: Input value for SupModList, default is []
-# @param Type: Input value for Type, default is None
-#
-# @var LibraryClass: To store value for LibraryClass
-# @var SupModList: To store value for SupModList
-# @var Type: To store value for Type
-#
-class LibraryClassObject(object):
- def __init__(self, Name = None, SupModList = [], Type = None):
- self.LibraryClass = Name
- self.SupModList = SupModList
- if Type != None:
- self.SupModList = CleanString(Type).split(DataType.TAB_SPACE_SPLIT)
-
-## ModuleBuildClassObject
-#
-# This Class defines ModuleBuildClass
-#
-# @param object: Inherited from object class
-#
-# @var DescFilePath: To store value for DescFilePath
-# @var BaseName: To store value for BaseName
-# @var ModuleType: To store value for ModuleType
-# @var Guid: To store value for Guid
-# @var Version: To store value for Version
-# @var PcdIsDriver: To store value for PcdIsDriver
-# @var BinaryModule: To store value for BinaryModule
-# @var CustomMakefile: To store value for CustomMakefile
-# @var Specification: To store value for Specification
-# @var Shadow To store value for Shadow
-# @var LibraryClass: To store value for LibraryClass, it is a list structure as
-# [ LibraryClassObject, ...]
-# @var ModuleEntryPointList: To store value for ModuleEntryPointList
-# @var ModuleUnloadImageList: To store value for ModuleUnloadImageList
-# @var ConstructorList: To store value for ConstructorList
-# @var DestructorList: To store value for DestructorList
-# @var Binaries: To store value for Binaries, it is a list structure as
-# [ ModuleBinaryClassObject, ...]
-# @var Sources: To store value for Sources, it is a list structure as
-# [ ModuleSourceFilesClassObject, ... ]
-# @var LibraryClasses: To store value for LibraryClasses, it is a set structure as
-# { [LibraryClassName, ModuleType] : LibraryClassInfFile }
-# @var Protocols: To store value for Protocols, it is a list structure as
-# [ ProtocolName, ... ]
-# @var Ppis: To store value for Ppis, it is a list structure as
-# [ PpiName, ... ]
-# @var Guids: To store value for Guids, it is a list structure as
-# [ GuidName, ... ]
-# @var Includes: To store value for Includes, it is a list structure as
-# [ IncludePath, ... ]
-# @var Packages: To store value for Packages, it is a list structure as
-# [ DecFileName, ... ]
-# @var Pcds: To store value for Pcds, it is a set structure as
-# { [(PcdCName, PcdGuidCName)] : PcdClassObject}
-# @var BuildOptions: To store value for BuildOptions, it is a set structure as
-# { [BuildOptionKey] : BuildOptionValue}
-# @var Depex: To store value for Depex
-#
-class ModuleBuildClassObject(object):
- def __init__(self):
- self.AutoGenVersion = 0
- self.DescFilePath = ''
- self.BaseName = ''
- self.ModuleType = ''
- self.Guid = ''
- self.Version = ''
- self.PcdIsDriver = ''
- self.BinaryModule = ''
- self.Shadow = ''
- self.CustomMakefile = {}
- self.Specification = {}
- self.LibraryClass = []
- self.ModuleEntryPointList = []
- self.ModuleUnloadImageList = []
- self.ConstructorList = []
- self.DestructorList = []
-
- self.Binaries = []
- self.Sources = []
- self.LibraryClasses = sdict()
- self.Libraries = []
- self.Protocols = []
- self.Ppis = []
- self.Guids = []
- self.Includes = []
- self.Packages = []
- self.Pcds = {}
- self.BuildOptions = {}
- self.Depex = ''
-
- ## Convert the class to a string
- #
- # Convert member DescFilePath of the class to a string
- #
- # @retval string Formatted String
- #
- def __str__(self):
- return self.DescFilePath
-
- ## Override __eq__ function
- #
- # Check whether ModuleBuildClassObjects are the same
- #
- # @retval False The two ModuleBuildClassObjects are different
- # @retval True The two ModuleBuildClassObjects are the same
- #
- def __eq__(self, Other):
- return self.DescFilePath == str(Other)
-
- ## Override __hash__ function
- #
- # Use DescFilePath as key in hash table
- #
- # @retval string Key for hash table
- #
- def __hash__(self):
- return hash(self.DescFilePath)
-
-## PackageBuildClassObject
-#
-# This Class defines PackageBuildClass
-#
-# @param object: Inherited from object class
-#
-# @var DescFilePath: To store value for DescFilePath
-# @var PackageName: To store value for PackageName
-# @var Guid: To store value for Guid
-# @var Version: To store value for Version
-# @var Protocols: To store value for Protocols, it is a set structure as
-# { [ProtocolName] : Protocol Guid, ... }
-# @var Ppis: To store value for Ppis, it is a set structure as
-# { [PpiName] : Ppi Guid, ... }
-# @var Guids: To store value for Guids, it is a set structure as
-# { [GuidName] : Guid, ... }
-# @var Includes: To store value for Includes, it is a list structure as
-# [ IncludePath, ... ]
-# @var LibraryClasses: To store value for LibraryClasses, it is a set structure as
-# { [LibraryClassName] : LibraryClassInfFile }
-# @var Pcds: To store value for Pcds, it is a set structure as
-# { [(PcdCName, PcdGuidCName)] : PcdClassObject}
-#
-class PackageBuildClassObject(object):
- def __init__(self):
- self.DescFilePath = ''
- self.PackageName = ''
- self.Guid = ''
- self.Version = ''
-
- self.Protocols = {}
- self.Ppis = {}
- self.Guids = {}
- self.Includes = []
- self.LibraryClasses = {}
- self.Pcds = {}
-
- ## Convert the class to a string
- #
- # Convert member DescFilePath of the class to a string
- #
- # @retval string Formatted String
- #
- def __str__(self):
- return self.DescFilePath
-
- ## Override __eq__ function
- #
- # Check whether PackageBuildClassObjects are the same
- #
- # @retval False The two PackageBuildClassObjects are different
- # @retval True The two PackageBuildClassObjects are the same
- #
- def __eq__(self, Other):
- return self.DescFilePath == str(Other)
-
- ## Override __hash__ function
- #
- # Use DescFilePath as key in hash table
- #
- # @retval string Key for hash table
- #
- def __hash__(self):
- return hash(self.DescFilePath)
-
-## PlatformBuildClassObject
-#
-# This Class defines PlatformBuildClass
-#
-# @param object: Inherited from object class
-#
-# @var DescFilePath: To store value for DescFilePath
-# @var PlatformName: To store value for PlatformName
-# @var Guid: To store value for Guid
-# @var Version: To store value for Version
-# @var DscSpecification: To store value for DscSpecification
-# @var OutputDirectory: To store value for OutputDirectory
-# @var FlashDefinition: To store value for FlashDefinition
-# @var BuildNumber: To store value for BuildNumber
-# @var MakefileName: To store value for MakefileName
-# @var SkuIds: To store value for SkuIds, it is a set structure as
-# { 'SkuName' : SkuId, '!include' : includefilename, ...}
-# @var Modules: To store value for Modules, it is a list structure as
-# [ InfFileName, ... ]
-# @var Libraries: To store value for Libraries, it is a list structure as
-# [ InfFileName, ... ]
-# @var LibraryClasses: To store value for LibraryClasses, it is a set structure as
-# { (LibraryClassName, ModuleType) : LibraryClassInfFile }
-# @var Pcds: To store value for Pcds, it is a set structure as
-# { [(PcdCName, PcdGuidCName)] : PcdClassObject }
-# @var BuildOptions: To store value for BuildOptions, it is a set structure as
-# { [BuildOptionKey] : BuildOptionValue }
-#
-class PlatformBuildClassObject(object):
- def __init__(self):
- self.DescFilePath = ''
- self.PlatformName = ''
- self.Guid = ''
- self.Version = ''
- self.DscSpecification = ''
- self.OutputDirectory = ''
- self.FlashDefinition = ''
- self.BuildNumber = ''
- self.MakefileName = ''
-
- self.SkuIds = {}
- self.Modules = []
- self.LibraryInstances = []
- self.LibraryClasses = {}
- self.Libraries = {}
- self.Pcds = {}
- self.BuildOptions = {}
-
- ## Convert the class to a string
- #
- # Convert member DescFilePath of the class to a string
- #
- # @retval string Formatted String
- #
- def __str__(self):
- return self.DescFilePath
-
- ## Override __eq__ function
- #
- # Check whether PlatformBuildClassObjects are the same
- #
- # @retval False The two PlatformBuildClassObjects are different
- # @retval True The two PlatformBuildClassObjects are the same
- #
- def __eq__(self, other):
- return self.DescFilePath == str(other)
-
- ## Override __hash__ function
- #
- # Use DescFilePath as key in hash table
- #
- # @retval string Key for hash table
- #
- def __hash__(self):
- return hash(self.DescFilePath)
-
-## ItemBuild
-#
-# This Class defines Module/Platform/Package databases for build system
-#
-# @param object: Inherited from object class
-# @param Arch: Build arch
-# @param Platform: Build Platform
-# @param Package: Build Package
-# @param Module: Build Module
-#
-# @var Arch: To store value for Build Arch
-# @var PlatformDatabase: To store value for PlatformDatabase, it is a set structure as
-# { [DscFileName] : PlatformBuildClassObject, ...}
-# @var PackageDatabase: To store value for PackageDatabase, it is a set structure as
-# { [DecFileName] : PacakgeBuildClassObject, ...}
-# @var ModuleDatabase: To store value for ModuleDatabase, it is a list structure as
-# { [InfFileName] : ModuleBuildClassObject, ...}
-#
-class ItemBuild(object):
- def __init__(self, Arch, Platform = None, Package = None, Module = None):
- self.Arch = Arch
- self.PlatformDatabase = {}
- self.PackageDatabase = {}
- self.ModuleDatabase = {}
-
-## WorkspaceBuild
-#
-# This class is used to parse active platform to init all inf/dec/dsc files
-# Generate module/package/platform databases for build
-#
-# @param object: Inherited from object class
-# @param ActivePlatform: Input value for current active platform
-# @param WorkspaceDir: Input value for current WorkspaceDir
-#
-# @var WorkspaceDir: To store value for WorkspaceDir
-# @var SupArchList: To store value for SupArchList, selection scope is in below list
-# EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64
-# @var BuildTarget: To store value for WorkspaceDir, selection scope is in below list
-# RELEASE | DEBUG
-# @var SkuId: To store value for SkuId
-# @var Fdf: To store value for Fdf
-# @var FdTargetList: To store value for FdTargetList
-# @var FvTargetList: To store value for FvTargetList
-# @var TargetTxt: To store value for TargetTxt, it is a set structure as
-# TargetTxtClassObject
-# @var ToolDef: To store value for ToolDef, it is a set structure as
-# ToolDefClassObject
-# @var InfDatabase: To store value for InfDatabase, it is a set structure as
-# { [InfFileName] : InfClassObject}
-# @var DecDatabase: To store value for DecDatabase, it is a set structure as
-# { [DecFileName] : DecClassObject}
-# @var DscDatabase: To store value for DscDatabase, it is a set structure as
-# { [DscFileName] : DscClassObject}
-# @var Build: To store value for DscDatabase, it is a set structure as
-# ItemBuild
-# @var DscFileName: To store value for Active Platform
-# @var UnFoundPcdInDsc: To store values for the pcds defined in INF/DEC but not found in DSC, it is a set structure as
-# { (PcdGuid, PcdCName, Arch) : DecFileName }
-#
-class WorkspaceBuild(object):
- def __init__(self, ActivePlatform, WorkspaceDir):
- self.WorkspaceDir = NormPath(WorkspaceDir)
- self.SupArchList = []
- self.BuildTarget = []
- self.SkuId = ''
- self.Fdf = ''
- self.FdTargetList = []
- self.FvTargetList = []
- self.TargetTxt = None
- self.ToolDef = None
-
- self.InfDatabase = {}
- self.DecDatabase = {}
- self.DscDatabase = {}
-
- self.UnFoundPcdInDsc = {}
-
- #
- # Init build for all arches
- #
- self.Build = {}
- for Arch in DataType.ARCH_LIST:
- self.Build[Arch] = ItemBuild(Arch)
-
- #
- # Init build database
- #
- self.Db = Database.Database(DATABASE_PATH)
- self.Db.InitDatabase()
-
- #
- # Get active platform
- #
- self.DscFileName = NormPath(ActivePlatform)
- File = self.WorkspaceFile(self.DscFileName)
- if os.path.exists(File) and os.path.isfile(File):
- self.DscDatabase[self.DscFileName] = Dsc(File, False, True, self.WorkspaceDir, self.Db)
- else:
- EdkLogger.error("AutoGen", FILE_NOT_FOUND, ExtraData = File)
-
- #
- # Parse platform to get module
- #
- for DscFile in self.DscDatabase.keys():
- Platform = self.DscDatabase[DscFile].Platform
-
- #
- # Get global information
- #
- Tmp = set()
- for Arch in DataType.ARCH_LIST:
- for Item in Platform.Header[Arch].SupArchList:
- Tmp.add(Item)
- self.SupArchList = list(Tmp)
- Tmp = set()
- for Arch in DataType.ARCH_LIST:
- for Item in Platform.Header[Arch].BuildTargets:
- Tmp.add(Item)
- self.BuildTarget = list(Tmp)
- for Arch in self.SupArchList:
- self.SkuId = Platform.Header[Arch].SkuIdName
- self.Fdf = Platform.FlashDefinitionFile.FilePath
-
- #
- # Get all inf files
- #
- for Item in Platform.LibraryClasses.LibraryList:
- for Arch in Item.SupArchList:
- self.AddToInfDatabase(Item.FilePath)
-
- for Item in Platform.Libraries.LibraryList:
- for Arch in Item.SupArchList:
- self.AddToInfDatabase(Item.FilePath)
-
- for Item in Platform.Modules.ModuleList:
- for Arch in Item.SupArchList:
- #
- # Add modules
- #
- Module = Item.FilePath
- self.AddToInfDatabase(Module)
- #
- # Add library used in modules
- #
- for Lib in Item.LibraryClasses.LibraryList:
- self.AddToInfDatabase(Lib.FilePath)
- self.UpdateLibraryClassOfModule(Module, Lib.Name, Arch, Lib.FilePath)
-
- #
- # Parse module to get package
- #
- for InfFile in self.InfDatabase.keys():
- Module = self.InfDatabase[InfFile].Module
- #
- # Get all dec
- #
- for Item in Module.PackageDependencies:
- for Arch in Item.SupArchList:
- self.AddToDecDatabase(Item.FilePath)
- # End of self.Init()
-
- ## Generate PlatformDatabase
- #
- # Go through each arch to get all items in DscDatabase to PlatformDatabase
- #
- def GenPlatformDatabase(self, PcdsSet={}):
- for Dsc in self.DscDatabase.keys():
- Platform = self.DscDatabase[Dsc].Platform
- for Arch in self.SupArchList:
- Pb = PlatformBuildClassObject()
-
- #
- # Defines
- #
- Pb.DescFilePath = Dsc
- Pb.PlatformName = Platform.Header[Arch].Name
- if Pb.PlatformName == '':
- EdkLogger.error("AutoGen", PARSER_ERROR, "The BaseName of platform %s is not defined for arch %s" % (Dsc, Arch))
- Pb.Guid = Platform.Header[Arch].Guid
- Pb.Version = Platform.Header[Arch].Version
- Pb.DscSpecification = Platform.Header[Arch].DscSpecification
- Pb.OutputDirectory = Platform.Header[Arch].OutputDirectory
- Pb.FlashDefinition = Platform.FlashDefinitionFile.FilePath
- Pb.BuildNumber = Platform.Header[Arch].BuildNumber
-
- #
- # SkuId
- #
- for Key in Platform.SkuInfos.SkuInfoList.keys():
- Pb.SkuIds[Key] = Platform.SkuInfos.SkuInfoList[Key]
-
- #
- # Module
- #
- for Item in Platform.Modules.ModuleList:
- if Arch in Item.SupArchList:
- Pb.Modules.append(Item.FilePath)
-
- #
- # BuildOptions
- #
- for Item in Platform.BuildOptions.BuildOptionList:
- if Arch in Item.SupArchList:
- Pb.BuildOptions[(Item.ToolChainFamily, Item.ToolChain)] = Item.Option
-
- #
- # LibraryClass
- #
- for Item in Platform.LibraryClasses.LibraryList:
- SupModuleList = self.FindSupModuleListOfLibraryClass(Item, Platform.LibraryClasses.LibraryList, Arch)
- if Arch in Item.SupArchList:
- for ModuleType in SupModuleList:
- Pb.LibraryClasses[(Item.Name, ModuleType)] = Item.FilePath
-
- #
- # Libraries
- #
- for Item in Platform.Libraries.LibraryList:
- for ItemArch in Item.SupArchList:
- Library = self.InfDatabase[Item.FilePath]
- if ItemArch not in Library.Module.Header:
- continue
- Pb.Libraries[Library.Module.Header[ItemArch].Name] = Item.FilePath
-
- #
- # Pcds
- #
- for Item in Platform.DynamicPcdBuildDefinitions:
- if Arch in Item.SupArchList:
- Name = Item.CName
- Guid = Item.TokenSpaceGuidCName
- Type = Item.ItemType
- DatumType = Item.DatumType
- Value = Item.DefaultValue
- Token = Item.Token
- MaxDatumSize = Item.MaxDatumSize
- SkuInfoList = Item.SkuInfoList
- Pb.Pcds[(Name, Guid)] = PcdClassObject(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, False)
-
- for (Name, Guid) in PcdsSet:
- Value = PcdsSet[Name, Guid]
- for PcdType in ["FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic", "DynamicEx"]:
- for Dec in self.Build[Arch].PackageDatabase:
- Pcds = self.Build[Arch].PackageDatabase[Dec].Pcds
- if (Name, Guid, PcdType) in Pcds:
- Pcd = Pcds[(Name, Guid, PcdType)]
- Type = PcdType
- DatumType = Pcd.DatumType
- Token = Pcd.TokenValue
- MaxDatumSize = Pcd.MaxDatumSize
- SkuInfoList = Pcd.SkuInfoList
- Pb.Pcds[(Name, Guid)] = PcdClassObject(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, False)
- break
- else:
- # nothing found
- continue
- # found in one package, find next PCD
- break
- else:
- EdkLogger.error("AutoGen", PARSER_ERROR, "PCD is not found in any package", ExtraData="%s.%s" % (Guid, Name))
- #
- # Add to database
- #
- self.Build[Arch].PlatformDatabase[Dsc] = Pb
- Pb = None
-
- ## Generate PackageDatabase
- #
- # Go through each arch to get all items in DecDatabase to PackageDatabase
- #
- def GenPackageDatabase(self):
- for Dec in self.DecDatabase.keys():
- Package = self.DecDatabase[Dec].Package
-
- for Arch in self.SupArchList:
- Pb = PackageBuildClassObject()
-
- #
- # Defines
- #
- Pb.DescFilePath = Dec
- Pb.PackageName = Package.Header[Arch].Name
- if Pb.PackageName == '':
- EdkLogger.error("AutoGen", PARSER_ERROR, "The BaseName of package %s is not defined for arch %s" % (Dec, Arch))
-
- Pb.Guid = Package.Header[Arch].Guid
- Pb.Version = Package.Header[Arch].Version
-
- #
- # Protocols
- #
- for Item in Package.ProtocolDeclarations:
- if Arch in Item.SupArchList:
- Pb.Protocols[Item.CName] = Item.Guid
-
- #
- # Ppis
- #
- for Item in Package.PpiDeclarations:
- if Arch in Item.SupArchList:
- Pb.Ppis[Item.CName] = Item.Guid
-
- #
- # Guids
- #
- for Item in Package.GuidDeclarations:
- if Arch in Item.SupArchList:
- Pb.Guids[Item.CName] = Item.Guid
-
- #
- # Includes
- #
- for Item in Package.Includes:
- if Arch in Item.SupArchList:
- Pb.Includes.append(Item.FilePath)
-
- #
- # LibraryClasses
- #
- for Item in Package.LibraryClassDeclarations:
- if Arch in Item.SupArchList:
- Pb.LibraryClasses[Item.LibraryClass] = Item.RecommendedInstance
-
- #
- # Pcds
- #
- for Item in Package.PcdDeclarations:
- if Arch in Item.SupArchList:
- Name = Item.CName
- Guid = Item.TokenSpaceGuidCName
- Type = Item.ItemType
- DatumType = Item.DatumType
- Value = Item.DefaultValue
- Token = Item.Token
- MaxDatumSize = Item.MaxDatumSize
- SkuInfoList = Item.SkuInfoList
- Pb.Pcds[(Name, Guid, Type)] = PcdClassObject(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, False)
-
- #
- # Add to database
- #
- self.Build[Arch].PackageDatabase[Dec] = Pb
- Pb = None
-
- ## Generate ModuleDatabase
- #
- # Go through each arch to get all items in InfDatabase to ModuleDatabase
- #
- def GenModuleDatabase(self, InfList = []):
- for Inf in self.InfDatabase.keys():
- Module = self.InfDatabase[Inf].Module
-
- for Arch in self.SupArchList:
- if not self.IsModuleDefinedInPlatform(Inf, Arch, InfList) or Arch not in Module.Header:
- continue
-
- ModuleHeader = Module.Header[Arch]
- Pb = ModuleBuildClassObject()
-
- #
- # Defines
- #
- Pb.DescFilePath = Inf
- Pb.BaseName = ModuleHeader.Name
- if Pb.BaseName == '':
- EdkLogger.error("AutoGen", PARSER_ERROR, "The BaseName of module %s is not defined for arch %s" % (Inf, Arch))
- Pb.Guid = ModuleHeader.Guid
- Pb.Version = ModuleHeader.Version
- Pb.ModuleType = ModuleHeader.ModuleType
- Pb.PcdIsDriver = ModuleHeader.PcdIsDriver
- Pb.BinaryModule = ModuleHeader.BinaryModule
- Pb.CustomMakefile = ModuleHeader.CustomMakefile
- Pb.Shadow = ModuleHeader.Shadow
-
- #
- # Specs os Defines
- #
- Pb.Specification = ModuleHeader.Specification
- Pb.Specification[TAB_INF_DEFINES_EDK_RELEASE_VERSION] = ModuleHeader.EdkReleaseVersion
- Pb.Specification[TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION] = ModuleHeader.UefiSpecificationVersion
- Pb.Specification[TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION] = ModuleHeader.UefiSpecificationVersion
- Pb.AutoGenVersion = int(ModuleHeader.InfVersion, 0)
-
- #
- # LibraryClass of Defines
- #
- for Item in ModuleHeader.LibraryClass:
- Pb.LibraryClass.append(LibraryClassObject(Item.LibraryClass, Item.SupModuleList, None))
-
- #
- # Module image and library of Defines
- #
- for Item in Module.ExternImages:
- if Item.ModuleEntryPoint != '' and Item.ModuleEntryPoint not in Pb.ModuleEntryPointList:
- Pb.ModuleEntryPointList.append(Item.ModuleEntryPoint)
- if Item.ModuleUnloadImage != '' and Item.ModuleUnloadImage not in Pb.ModuleUnloadImageList:
- Pb.ModuleUnloadImageList.append(Item.ModuleUnloadImage)
- for Item in Module.ExternLibraries:
- if Item.Constructor != '' and Item.Constructor not in Pb.ConstructorList:
- Pb.ConstructorList.append(Item.Constructor)
- if Item.Destructor != '' and Item.Destructor not in Pb.DestructorList:
- Pb.DestructorList.append(Item.Destructor)
-
- #
- # Binaries
- #
- for Item in Module.Binaries:
- if Arch in Item.SupArchList:
- FileName = Item.BinaryFile
- FileType = Item.FileType
- Target = Item.Target
- FeatureFlag = Item.FeatureFlag
- Pb.Binaries.append(ModuleBinaryFileClass(FileName, FileType, Target, FeatureFlag, Arch.split()))
-
- #
- # Sources
- #
- for Item in Module.Sources:
- if Arch in Item.SupArchList:
- SourceFile = Item.SourceFile
- TagName = Item.TagName
- ToolCode = Item.ToolCode
- ToolChainFamily = Item.ToolChainFamily
- FeatureFlag = Item.FeatureFlag
- Pb.Sources.append(ModuleSourceFileClass(SourceFile, TagName, ToolCode, ToolChainFamily, FeatureFlag))
-
- #
- # Protocols
- #
- for Item in Module.Protocols:
- if Arch in Item.SupArchList:
- Pb.Protocols.append(Item.CName)
-
- #
- # Ppis
- #
- for Item in Module.Ppis:
- if Arch in Item.SupArchList:
- Pb.Ppis.append(Item.CName)
-
- #
- # Guids
- #
- for Item in Module.Guids:
- if Arch in Item.SupArchList:
- Pb.Ppis.append(Item.CName)
-
- #
- # Includes
- #
- for Item in Module.Includes:
- if Arch in Item.SupArchList:
- Pb.Includes.append(Item.FilePath)
-
- #
- # Packages
- #
- for Item in Module.PackageDependencies:
- if Arch in Item.SupArchList:
- Pb.Packages.append(Item.FilePath)
-
- #
- # BuildOptions
- #
- for Item in Module.BuildOptions:
- if Arch in Item.SupArchList:
- if (Item.ToolChainFamily, Item.ToolChain) not in Pb.BuildOptions:
- Pb.BuildOptions[(Item.ToolChainFamily, Item.ToolChain)] = Item.Option
- else:
- OptionString = Pb.BuildOptions[(Item.ToolChainFamily, Item.ToolChain)]
- Pb.BuildOptions[(Item.ToolChainFamily, Item.ToolChain)] = OptionString + " " + Item.Option
- self.FindBuildOptions(Arch, Inf, Pb.BuildOptions)
-
- #
- # Depex
- #
- for Item in Module.Depex:
- if Arch in Item.SupArchList:
- Pb.Depex = Pb.Depex + Item.Depex + ' '
- Pb.Depex = Pb.Depex.strip()
-
- #
- # LibraryClasses
- #
- for Item in Module.LibraryClasses:
- if Arch in Item.SupArchList:
- Lib = Item.LibraryClass
- RecommendedInstance = Item.RecommendedInstance
- if Pb.LibraryClass != []:
- #
- # For Library
- #
- for Libs in Pb.LibraryClass:
- for Type in Libs.SupModList:
- Instance = self.FindLibraryClassInstanceOfLibrary(Lib, Arch, Type)
- if Instance == None:
- Instance = RecommendedInstance
- Pb.LibraryClasses[(Lib, Type)] = Instance
- else:
- #
- # For Module
- #
- Instance = self.FindLibraryClassInstanceOfModule(Lib, Arch, Pb.ModuleType, Inf)
- if Instance == None:
- Instance = RecommendedInstance
- Pb.LibraryClasses[(Lib, Pb.ModuleType)] = Instance
-
- #
- # Libraries
- #
- for Item in Module.Libraries:
- if Arch in Item.SupArchList:
- Pb.Libraries.append(Item.Library)
-
- #
- # Pcds
- #
- for Item in Module.PcdCodes:
- if Arch in Item.SupArchList:
- Name = Item.CName
- Guid = Item.TokenSpaceGuidCName
- Type = Item.ItemType
- Pb.Pcds[(Name, Guid)] = self.FindPcd(Arch, Inf, Name, Guid, Type)
-
- #
- # Add to database
- #
- self.Build[Arch].ModuleDatabase[Inf] = Pb
- Pb = None
-
- ## Update Libraries Of Platform Database
- #
- # @param InfList: A list for all inf files
- #
- def UpdateLibrariesOfPlatform(self, InfList = []):
- for Arch in self.SupArchList:
- PlatformDatabase = self.Build[Arch].PlatformDatabase
- for Dsc in PlatformDatabase:
- Platform = PlatformDatabase[Dsc]
- for Inf in Platform.Modules:
- if not self.IsModuleDefinedInPlatform(Inf, Arch, InfList):
- continue
- Module = self.Build[Arch].ModuleDatabase[Inf]
- if Module.LibraryClass == None or Module.LibraryClass == []:
- self.UpdateLibrariesOfModule(Platform, Module, Arch)
- for Key in Module.LibraryClasses:
- Lib = Module.LibraryClasses[Key]
- if Lib not in Platform.LibraryInstances:
- Platform.LibraryInstances.append(Lib)
-
-
- ## Update Libraries Of Module Database
- #
- # @param Module: The module need to be updated libraries
- # @param Arch: The supportted arch of the module
- #
- def UpdateLibrariesOfModule(self, Platform, Module, Arch):
- ModuleDatabase = self.Build[Arch].ModuleDatabase
- ModuleType = Module.ModuleType
-
- # check Edk module
- if Module.AutoGenVersion < 0x00010005:
- EdkLogger.verbose("")
- EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(Module), Arch))
- LibraryConsumerList = [Module]
-
- # "CompilerStub" is a must for Edk modules
- Module.Libraries.append("CompilerStub")
- while len(LibraryConsumerList) > 0:
- M = LibraryConsumerList.pop()
- for LibraryName in M.Libraries:
- if LibraryName not in Platform.Libraries:
- EdkLogger.warn("AutoGen", "Library [%s] is not found" % LibraryName,
- ExtraData="\t%s [%s]" % (str(Module), Arch))
- continue
-
- LibraryFile = Platform.Libraries[LibraryName]
- if (LibraryName, ModuleType) not in Module.LibraryClasses:
- Module.LibraryClasses[LibraryName, ModuleType] = LibraryFile
- LibraryConsumerList.append(ModuleDatabase[LibraryFile])
- EdkLogger.verbose("\t" + LibraryName + " : " + LibraryFile)
- return
-
- # EdkII module
- LibraryConsumerList = [Module]
- Constructor = []
- ConsumedByList = sdict()
- LibraryInstance = sdict()
-
- EdkLogger.verbose("")
- EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(Module), Arch))
- while len(LibraryConsumerList) > 0:
- M = LibraryConsumerList.pop()
- for Key, LibraryPath in M.LibraryClasses.iteritems():
- # The "Key" is in format of (library_class_name, supported_module_type)
- if ModuleType != "USER_DEFINED" and ModuleType not in Key:
- EdkLogger.debug(EdkLogger.DEBUG_3, "%s for module type %s is not supported (%s)" % (Key + (LibraryPath,)))
- continue
-
- LibraryClassName = Key[0]
- if LibraryClassName not in LibraryInstance or LibraryInstance[LibraryClassName] == None:
- if LibraryPath == None or LibraryPath == "":
- LibraryInstance[LibraryClassName] = None
- continue
- LibraryModule = ModuleDatabase[LibraryPath]
- LibraryInstance[LibraryClassName] = LibraryModule
- LibraryConsumerList.append(LibraryModule)
- EdkLogger.verbose("\t" + LibraryClassName + " : " + str(LibraryModule))
- elif LibraryPath == None or LibraryPath == "":
- continue
- else:
- LibraryModule = LibraryInstance[LibraryClassName]
-
- if LibraryModule.ConstructorList != [] and LibraryModule not in Constructor:
- Constructor.append(LibraryModule)
-
- if LibraryModule not in ConsumedByList:
- ConsumedByList[LibraryModule] = []
- if M != Module:
- if M in ConsumedByList[LibraryModule]:
- continue
- ConsumedByList[LibraryModule].append(M)
- #
- # Initialize the sorted output list to the empty set
- #
- SortedLibraryList = []
- #
- # Q <- Set of all nodes with no incoming edges
- #
- LibraryList = [] #LibraryInstance.values()
- Q = []
- for LibraryClassName in LibraryInstance:
- M = LibraryInstance[LibraryClassName]
- if M == None:
- EdkLogger.error("AutoGen", AUTOGEN_ERROR,
- "Library instance for library class [%s] is not found" % LibraryClassName,
- ExtraData="\t%s [%s]" % (str(Module), Arch))
- LibraryList.append(M)
- #
- # check if there're duplicate library classes
- #
- for Lc in M.LibraryClass:
- if Lc.SupModList != None and ModuleType not in Lc.SupModList:
- EdkLogger.error("AutoGen", AUTOGEN_ERROR,
- "Module type [%s] is not supported by library instance [%s]" % (ModuleType, str(M)),
- ExtraData="\t%s" % str(Module))
-
- if Lc.LibraryClass in LibraryInstance and str(M) != str(LibraryInstance[Lc.LibraryClass]):
- EdkLogger.error("AutoGen", AUTOGEN_ERROR,
- "More than one library instance found for library class [%s] in module [%s]" % (Lc.LibraryClass, Module),
- ExtraData="\t%s\n\t%s" % (LibraryInstance[Lc.LibraryClass], str(M))
- )
- if ConsumedByList[M] == []:
- Q.insert(0, M)
- #
- # while Q is not empty do
- #
- while Q != []:
- #
- # remove node from Q
- #
- Node = Q.pop()
- #
- # output Node
- #
- SortedLibraryList.append(Node)
- #
- # for each node Item with an edge e from Node to Item do
- #
- for Item in LibraryList:
- if Node not in ConsumedByList[Item]:
- continue
- #
- # remove edge e from the graph
- #
- ConsumedByList[Item].remove(Node)
- #
- # If Item has no other incoming edges then
- #
- if ConsumedByList[Item] == []:
- #
- # insert Item into Q
- #
- Q.insert(0, Item)
-
- EdgeRemoved = True
- while Q == [] and EdgeRemoved:
- EdgeRemoved = False
- #
- # for each node Item with a Constructor
- #
- for Item in LibraryList:
- if Item in Constructor:
- #
- # for each Node without a constructor with an edge e from Item to Node
- #
- for Node in ConsumedByList[Item]:
- if Node not in Constructor:
- #
- # remove edge e from the graph
- #
- ConsumedByList[Item].remove(Node)
- EdgeRemoved = True
- if ConsumedByList[Item] == []:
- #
- # insert Item into Q
- #
- Q.insert(0, Item)
- break
- if Q != []:
- break
-
- #
- # if any remaining node Item in the graph has a constructor and an incoming edge, then the graph has a cycle
- #
- for Item in LibraryList:
- if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:
- ErrorMessage = 'Library [%s] with constructors has a cycle' % str(Item)
- EdkLogger.error("AutoGen", AUTOGEN_ERROR, ErrorMessage,
- "\tconsumed by " + "\n\tconsumed by ".join([str(L) for L in ConsumedByList[Item]]))
- if Item not in SortedLibraryList:
- SortedLibraryList.append(Item)
-
- #
- # Build the list of constructor and destructir names
- # The DAG Topo sort produces the destructor order, so the list of constructors must generated in the reverse order
- #
- SortedLibraryList.reverse()
- Module.LibraryClasses = sdict()
- for L in SortedLibraryList:
- for Lc in L.LibraryClass:
- Module.LibraryClasses[Lc.LibraryClass, ModuleType] = str(L)
- #
- # Merge PCDs from library instance
- #
- for Key in L.Pcds:
- if Key not in Module.Pcds:
- LibPcd = L.Pcds[Key]
- Module.Pcds[Key] = self.FindPcd(Arch, str(Module), LibPcd.TokenCName, LibPcd.TokenSpaceGuidCName, LibPcd.Type)
- #
- # Merge GUIDs from library instance
- #
- for CName in L.Guids:
- if CName not in Module.Guids:
- Module.Guids.append(CName)
- #
- # Merge Protocols from library instance
- #
- for CName in L.Protocols:
- if CName not in Module.Protocols:
- Module.Protocols.append(CName)
- #
- # Merge Ppis from library instance
- #
- for CName in L.Ppis:
- if CName not in Module.Ppis:
- Module.Ppis.append(CName)
-
- ## GenBuildDatabase
- #
- # Generate build database for all arches
- #
- # @param PcdsSet: Pcd list for override from Fdf parse result
- # @param InfList: Inf list for override from Fdf parse result
- #
- def GenBuildDatabase(self, PcdsSet = {}, InfList = []):
- #
- # Add additional inf file defined in Fdf file
- #
- for InfFile in InfList:
- self.AddToInfDatabase(NormPath(InfFile))
-
- #
- # Generate PlatformDatabase, PackageDatabase and ModuleDatabase
- #
- self.GenPackageDatabase()
- self.GenPlatformDatabase(PcdsSet)
- self.GenModuleDatabase(InfList)
-
- self.Db.Close()
-
- #
- # Update Libraries Of Platform
- #
- self.UpdateLibrariesOfPlatform(InfList)
-
- #
- # Output used Pcds not found in DSC file
- #
- self.ShowUnFoundPcds()
-
- ## ShowUnFoundPcds()
- #
- # If there is any pcd used but not defined in DSC
- # Print warning message on screen and output a list of pcds
- #
- def ShowUnFoundPcds(self):
- if self.UnFoundPcdInDsc != {}:
- WrnMessage = '**** WARNING ****\n'
- WrnMessage += 'The following Pcds were not defined in the DSC file: %s\n' % self.DscFileName
- WrnMessage += 'The default values were obtained from the DEC file that declares the PCD and the PCD default value\n'
- for (Guid, Name, Type, Arch) in self.UnFoundPcdInDsc:
- Dec = self.UnFoundPcdInDsc[(Guid, Name, Type, Arch)]
- Pcds = self.Build[Arch].PackageDatabase[Dec].Pcds
- if (Name, Guid, Type) in Pcds:
- Pcd = Pcds[(Name, Guid, Type)]
- PcdItemTypeUsed = Pcd.Type
- DefaultValue = Pcd.DefaultValue
- WrnMessage += '%s.%s: Defined in file %s, PcdItemType is Pcds%s, DefaultValue is %s\n' % (Guid, Name, Dec, PcdItemTypeUsed, DefaultValue)
- EdkLogger.verbose(WrnMessage)
-
- ## Create a full path with workspace dir
- #
- # Convert Filename with workspace dir to create a full path
- #
- # @param Filename: The filename need to be added workspace dir
- #
- # @retval string Full path
- #
- def WorkspaceFile(self, Filename):
- return WorkspaceFile(self.WorkspaceDir, Filename)
-
- ## Update LibraryClass of Module
- #
- # If a module of a platform has its own override libraryclass but the libraryclass not defined in the module
- # Add this libraryclass to the module
- #
- # @param InfFileName: InfFileName specificed in platform
- # @param LibraryClass: LibraryClass specificed in platform
- # @param Arch: Supportted Arch
- # @param InstanceFilePath: InstanceFilePath specificed in platform
- #
- def UpdateLibraryClassOfModule(self, InfFileName, LibraryClass, Arch, InstanceFilePath):
- #
- # Update the library instance itself to add this libraryclass name
- #
- LibraryModule = self.InfDatabase[InstanceFilePath].Module
- LibList = LibraryModule.Header[Arch].LibraryClass
- NotFound = True
- for Lib in LibList:
- #
- # Find this LibraryClass
- #
- if Lib.LibraryClass == LibraryClass:
- NotFound = False;
- break;
- if NotFound:
- NewLib = LibraryClassClass()
- NewLib.LibraryClass = LibraryClass
- NewLib.SupModuleList = DataType.SUP_MODULE_LIST # LibraryModule.Header[Arch].ModuleType.split()
- LibraryModule.Header[Arch].LibraryClass.append(NewLib)
-
- #
- # Add it to LibraryClasses Section for the module which is using the library
- #
- Module = self.InfDatabase[InfFileName].Module
- LibList = Module.LibraryClasses
- NotFound = True
- for Lib in LibList:
- #
- # Find this LibraryClass
- #
- if Lib.LibraryClass == LibraryClass:
- if Arch in Lib.SupArchList:
- return
- else:
- Lib.SupArchList.append(Arch)
- return
- if NotFound:
- Lib = LibraryClassClass()
- Lib.LibraryClass = LibraryClass
- Lib.SupArchList = [Arch]
- Module.LibraryClasses.append(Lib)
-
- ## Add Inf file to InfDatabase
- #
- # Create a Inf instance for input inf file and add it to InfDatabase
- #
- # @param InfFileName: The InfFileName need to be added to database
- #
- def AddToInfDatabase(self, InfFileName):
- File = self.WorkspaceFile(InfFileName)
- if os.path.exists(File) and os.path.isfile(File):
- if InfFileName not in self.InfDatabase:
- self.InfDatabase[InfFileName] = Inf(File, False, True, self.WorkspaceDir, self.Db, self.SupArchList)
- else:
- EdkLogger.error("AutoGen", FILE_NOT_FOUND, ExtraData=File)
-
- ## Add Dec file to DecDatabase
- #
- # Create a Dec instance for input dec file and add it to DecDatabase
- #
- # @param DecFileName: The DecFileName need to be added to database
- #
- def AddToDecDatabase(self, DecFileName):
- File = self.WorkspaceFile(DecFileName)
- if os.path.exists(File) and os.path.isfile(File):
- if DecFileName not in self.DecDatabase:
- self.DecDatabase[DecFileName] = Dec(File, False, True, self.WorkspaceDir, self.Db, self.SupArchList)
- else:
- EdkLogger.error("AutoGen", FILE_NOT_FOUND, ExtraData=File)
-
- ## Search LibraryClass Instance for Module
- #
- # Search PlatformBuildDatabase to find LibraryClass Instance for Module
- # Return the instance if found
- #
- # @param Lib: Input value for Library Class Name
- # @param Arch: Supportted Arch
- # @param ModuleType: Supportted ModuleType
- # @param ModuleName: Input value for Module Name
- #
- # @retval string Found LibraryClass Instance file path
- #
- def FindLibraryClassInstanceOfModule(self, Lib, Arch, ModuleType, ModuleName):
- #
- # First find if exist in <LibraryClass> of <Components> from dsc file
- #
- for Dsc in self.DscDatabase.keys():
- Platform = self.DscDatabase[Dsc].Platform
- for Module in Platform.Modules.ModuleList:
- if Arch in Module.SupArchList:
- if Module.FilePath == ModuleName:
- for LibraryClass in Module.LibraryClasses.LibraryList:
- if LibraryClass.Name == Lib:
- return LibraryClass.FilePath
- #
- #Second find if exist in <LibraryClass> of <LibraryClasses> from dsc file
- #
- return self.FindLibraryClassInstanceOfLibrary(Lib, Arch, ModuleType)
-
- ## Search LibraryClass Instance for Library
- #
- # Search PlatformBuildDatabase to find LibraryClass Instance for Library
- # Return the instance if found
- #
- # @param Lib: Input value for Library Class Name
- # @param Arch: Supportted Arch
- # @param Type: Supportted Library Usage Type
- #
- # @retval string Found LibraryClass Instance file path
- # @retval None Not Found
- #
- def FindLibraryClassInstanceOfLibrary(self, Lib, Arch, Type):
- for Dsc in self.DscDatabase.keys():
- Platform = self.DscDatabase[Dsc].Platform
- if (Lib, Type) in self.Build[Arch].PlatformDatabase[Dsc].LibraryClasses:
- return self.Build[Arch].PlatformDatabase[Dsc].LibraryClasses[(Lib, Type)]
- elif (Lib, '') in self.Build[Arch].PlatformDatabase[Dsc].LibraryClasses:
- return self.Build[Arch].PlatformDatabase[Dsc].LibraryClasses[(Lib, '')]
- return None
-
- ## Find BuildOptions
- #
- # Search DscDatabase to find component definition of ModuleName
- # Override BuildOption if it is defined in component
- #
- # @param Arch: Supportted Arch
- # @param ModuleName: The module which has buildoption definition in component of platform
- # @param BuildOptions: The set of all buildopitons
- #
- def FindBuildOptions(self, Arch, ModuleName, BuildOptions):
- for Dsc in self.DscDatabase.keys():
- #
- # First find if exist in <BuildOptions> of <Components> from dsc file
- # if find, use that override the one defined in inf file
- #
- Platform = self.DscDatabase[Dsc].Platform
- for Module in Platform.Modules.ModuleList:
- if Arch in Module.SupArchList:
- if Module.FilePath == ModuleName:
- for BuildOption in Module.ModuleSaBuildOption.BuildOptionList:
- #
- # Add to BuildOptions
- #
- BuildOptions[(BuildOption.ToolChainFamily, BuildOption.ToolChain)] = BuildOption.Option
-
- ## Find Pcd
- #
- # Search platform database, package database, module database and PcdsSet from Fdf
- # Return found Pcd
- #
- # @param Arch: Supportted Arch
- # @param ModuleName: The module which has pcd definition in component of platform
- # @param Name: Name of Pcd
- # @param Guid: Guid of Pcd
- # @param Type: Type of Pcd
- #
- # @retval PcdClassObject An instance for PcdClassObject with all members filled
- #
- def FindPcd(self, Arch, ModuleName, Name, Guid, Type):
- NewType = ''
- DatumType = ''
- Value = ''
- Token = ''
- MaxDatumSize = ''
- SkuInfoList = {}
- IsOverrided = False
- IsFoundInDsc = False
- IsFoundInDec = False
- FoundInDecFile = ''
-
- #
- # Second get information from platform database
- #
- OwnerPlatform = ''
- for Dsc in self.Build[Arch].PlatformDatabase.keys():
- Pcds = self.Build[Arch].PlatformDatabase[Dsc].Pcds
- if (Name, Guid) in Pcds:
- OwnerPlatform = Dsc
- Pcd = Pcds[(Name, Guid)]
- if Pcd.Type != '' and Pcd.Type != None:
- NewType = Pcd.Type
- if NewType in DataType.PCD_DYNAMIC_TYPE_LIST:
- NewType = DataType.TAB_PCDS_DYNAMIC
- elif NewType in DataType.PCD_DYNAMIC_EX_TYPE_LIST:
- NewType = DataType.TAB_PCDS_DYNAMIC_EX
- else:
- NewType = Type
-
- if Type != '' and Type != NewType:
- ErrorMsg = "PCD %s.%s is declared as [%s] in module\n\t%s\n\n"\
- " But it's used as [%s] in platform\n\t%s"\
- % (Guid, Name, Type, ModuleName, NewType, OwnerPlatform)
- EdkLogger.error("AutoGen", PARSER_ERROR, ErrorMsg)
-
-
- if Pcd.DatumType != '' and Pcd.DatumType != None:
- DatumType = Pcd.DatumType
- if Pcd.TokenValue != '' and Pcd.TokenValue != None:
- Token = Pcd.TokenValue
- if Pcd.DefaultValue != '' and Pcd.DefaultValue != None:
- Value = Pcd.DefaultValue
- if Pcd.MaxDatumSize != '' and Pcd.MaxDatumSize != None:
- MaxDatumSize = Pcd.MaxDatumSize
- SkuInfoList = Pcd.SkuInfoList
-
- IsOverrided = True
- IsFoundInDsc = True
- break
-
- #
- # Third get information from <Pcd> of <Compontents> from module database
- #
- for Dsc in self.DscDatabase.keys():
- for Module in self.DscDatabase[Dsc].Platform.Modules.ModuleList:
- if Arch in Module.SupArchList:
- if Module.FilePath == ModuleName:
- for Pcd in Module.PcdBuildDefinitions:
- if (Name, Guid) == (Pcd.CName, Pcd.TokenSpaceGuidCName):
- if Pcd.DefaultValue != '':
- Value = Pcd.DefaultValue
- if Pcd.MaxDatumSize != '':
- MaxDatumSize = Pcd.MaxDatumSize
-
- IsFoundInDsc = True
- IsOverrided = True
- break
-
- #
- # First get information from package database
- #
- Pcd = None
- if NewType == '':
- if Type != '':
- PcdTypeList = [Type]
- else:
- PcdTypeList = ["FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic", "DynamicEx"]
-
- for Dec in self.Build[Arch].PackageDatabase.keys():
- Pcds = self.Build[Arch].PackageDatabase[Dec].Pcds
- for PcdType in PcdTypeList:
- if (Name, Guid, PcdType) in Pcds:
- Pcd = Pcds[(Name, Guid, PcdType)]
- NewType = PcdType
- IsOverrided = True
- IsFoundInDec = True
- FoundInDecFile = Dec
- break
- else:
- continue
- break
- else:
- for Dec in self.Build[Arch].PackageDatabase.keys():
- Pcds = self.Build[Arch].PackageDatabase[Dec].Pcds
- if (Name, Guid, NewType) in Pcds:
- Pcd = Pcds[(Name, Guid, NewType)]
- IsOverrided = True
- IsFoundInDec = True
- FoundInDecFile = Dec
- break
-
- if not IsFoundInDec:
- ErrorMsg = "Pcd '%s.%s [%s]' defined in module '%s' is not found in any package for Arch '%s'" % (Guid, Name, NewType, ModuleName, Arch)
- EdkLogger.error("AutoGen", PARSER_ERROR, ErrorMsg)
-
- #
- # Not found in any platform and fdf
- #
- if not IsFoundInDsc:
- Value = Pcd.DefaultValue
- if NewType.startswith("Dynamic") and SkuInfoList == {}:
- SkuIds = self.Build[Arch].PlatformDatabase.values()[0].SkuIds
- SkuInfoList['DEFAULT'] = SkuInfoClass(SkuIdName='DEFAULT', SkuId=SkuIds['DEFAULT'], DefaultValue=Value)
- self.UnFoundPcdInDsc[(Guid, Name, NewType, Arch)] = FoundInDecFile
- #elif Type != '' and NewType.startswith("Dynamic"):
- # NewType = Pcd.Type
- DatumType = Pcd.DatumType
- if Token in [None, '']:
- Token = Pcd.TokenValue
- if DatumType == "VOID*" and MaxDatumSize in ['', None]:
- EdkLogger.verbose("No MaxDatumSize specified for PCD %s.%s in module [%s]" % (Guid, Name, ModuleName))
- if Value[0] == 'L':
- MaxDatumSize = str(len(Value) * 2)
- elif Value[0] == '{':
- MaxDatumSize = str(len(Value.split(',')))
- else:
- MaxDatumSize = str(len(Value))
-
- return PcdClassObject(Name, Guid, NewType, DatumType, Value, Token, MaxDatumSize, SkuInfoList, IsOverrided)
-
- ## Find Supportted Module List Of LibraryClass
- #
- # Search in InfDatabase, find the supmodulelist of the libraryclass
- #
- # @param LibraryClass: LibraryClass name for search
- # @param OverridedLibraryClassList: A list of all LibraryClass
- # @param Arch: Supportted Arch
- #
- # @retval list SupModuleList
- #
- def FindSupModuleListOfLibraryClass(self, LibraryClass, OverridedLibraryClassList, Arch):
- Name = LibraryClass.Name
- FilePath = LibraryClass.FilePath
- SupModuleList = copy.copy(LibraryClass.SupModuleList)
-
- #
- # If the SupModuleList means all, remove overrided module types of platform
- #
- if SupModuleList == DataType.SUP_MODULE_LIST:
- EdkLogger.debug(EdkLogger.DEBUG_3, "\tLibraryClass %s supports all module types" % Name)
- for Item in OverridedLibraryClassList:
- #
- # Find a library class (Item) with the same name
- #
- if Item.Name == Name:
- #
- # Do nothing if it is itself
- #
- if Item.SupModuleList == DataType.SUP_MODULE_LIST:
- continue
- #
- # If not itself, check arch first
- #
- if Arch in LibraryClass.SupArchList:
- #
- # If arch is supportted, remove all related module type
- #
- if Arch in Item.SupArchList:
- for ModuleType in Item.SupModuleList:
- EdkLogger.debug(EdkLogger.DEBUG_3, "\tLibraryClass %s has specific defined module types" % Name)
- if ModuleType in SupModuleList:
- SupModuleList.remove(ModuleType)
-
- return SupModuleList
-
- ## Find Module inf Platform
- #
- # Check if the module is defined in <Compentent> of <Platform>
- #
- # @param Inf: Inf file (Module) need to be searched
- # @param Arch: Supportted Arch
- # @param InfList: A list for all Inf file
- #
- # @retval True Mudule Found
- # @retval Flase Module Not Found
- #
- def IsModuleDefinedInPlatform(self, Inf, Arch, InfList):
- for Dsc in self.DscDatabase.values():
- for LibraryClass in Dsc.Platform.LibraryClasses.LibraryList:
- if Inf == LibraryClass.FilePath and Arch in LibraryClass.SupArchList:
- return True
- for Module in Dsc.Platform.Modules.ModuleList:
- if Inf == Module.FilePath and Arch in Module.SupArchList:
- return True
- for Item in Module.LibraryClasses.LibraryList:
- if Inf == Item.FilePath:
- return True
- for Library in Dsc.Platform.Libraries.LibraryList:
- if Inf == Library.FilePath and Arch in Library.SupArchList:
- return True
-
- return False
-
- ## Show all content of the workspacebuild
- #
- # Print each item of the workspacebuild with (Key = Value) pair
- #
- def ShowWorkspaceBuild(self):
- print self.DscDatabase
- print self.InfDatabase
- print self.DecDatabase
- print 'SupArchList', self.SupArchList
- print 'BuildTarget', self.BuildTarget
- print 'SkuId', self.SkuId
-
- for Arch in self.SupArchList:
- print Arch
- print 'Platform'
- for Platform in self.Build[Arch].PlatformDatabase.keys():
- P = self.Build[Arch].PlatformDatabase[Platform]
- print 'DescFilePath = ', P.DescFilePath
- print 'PlatformName = ', P.PlatformName
- print 'Guid = ', P.Guid
- print 'Version = ', P.Version
- print 'OutputDirectory = ', P.OutputDirectory
- print 'FlashDefinition = ', P.FlashDefinition
- print 'SkuIds = ', P.SkuIds
- print 'Modules = ', P.Modules
- print 'LibraryClasses = ', P.LibraryClasses
- print 'Pcds = ', P.Pcds
- for item in P.Pcds.keys():
- print P.Pcds[item]
- print 'BuildOptions = ', P.BuildOptions
- print ''
- # End of Platform
-
- print 'package'
- for Package in self.Build[Arch].PackageDatabase.keys():
- P = self.Build[Arch].PackageDatabase[Package]
- print 'DescFilePath = ', P.DescFilePath
- print 'PackageName = ', P.PackageName
- print 'Guid = ', P.Guid
- print 'Version = ', P.Version
- print 'Protocols = ', P.Protocols
- print 'Ppis = ', P.Ppis
- print 'Guids = ', P.Guids
- print 'Includes = ', P.Includes
- print 'LibraryClasses = ', P.LibraryClasses
- print 'Pcds = ', P.Pcds
- for item in P.Pcds.keys():
- print P.Pcds[item]
- print ''
- # End of Package
-
- print 'module'
- for Module in self.Build[Arch].ModuleDatabase.keys():
- P = self.Build[Arch].ModuleDatabase[Module]
- print 'DescFilePath = ', P.DescFilePath
- print 'BaseName = ', P.BaseName
- print 'ModuleType = ', P.ModuleType
- print 'Guid = ', P.Guid
- print 'Version = ', P.Version
- print 'CustomMakefile = ', P.CustomMakefile
- print 'Specification = ', P.Specification
- print 'Shadow = ', P.Shadow
- print 'PcdIsDriver = ', P.PcdIsDriver
- for Lib in P.LibraryClass:
- print 'LibraryClassDefinition = ', Lib.LibraryClass, 'SupModList = ', Lib.SupModList
- print 'ModuleEntryPointList = ', P.ModuleEntryPointList
- print 'ModuleUnloadImageList = ', P.ModuleUnloadImageList
- print 'ConstructorList = ', P.ConstructorList
- print 'DestructorList = ', P.DestructorList
-
- print 'Binaries = '
- for item in P.Binaries:
- print item.BinaryFile, item.FeatureFlag, item.SupArchList
- print 'Sources = '
- for item in P.Sources:
- print item.SourceFile
- print 'LibraryClasses = ', P.LibraryClasses
- print 'Protocols = ', P.Protocols
- print 'Ppis = ', P.Ppis
- print 'Guids = ', P.Guids
- print 'Includes = ', P.Includes
- print 'Packages = ', P.Packages
- print 'Pcds = ', P.Pcds
- for item in P.Pcds.keys():
- print P.Pcds[item]
- print 'BuildOptions = ', P.BuildOptions
- print 'Depex = ', P.Depex
- print ''
- # End of Module
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- print 'Start!', time.strftime('%H:%M:%S', time.localtime())
- EdkLogger.Initialize()
- EdkLogger.SetLevel(EdkLogger.QUIET)
-
- W = os.getenv('WORKSPACE')
- Ewb = WorkspaceBuild('Nt32Pkg/Nt32Pkg.dsc', W)
- Ewb.GenBuildDatabase({('PcdDevicePathSupportDevicePathFromText', 'gEfiMdeModulePkgTokenSpaceGuid') : 'KKKKKKKKKKKKKKKKKKKKK'}, ['Test.Inf'])
- print 'Done!', time.strftime('%H:%M:%S', time.localtime())
- Ewb.ShowWorkspaceBuild()
diff --git a/BaseTools/Source/Python/Common/EdkLogger.py b/BaseTools/Source/Python/Common/EdkLogger.py
deleted file mode 100644
index a3bcb3a147..0000000000
--- a/BaseTools/Source/Python/Common/EdkLogger.py
+++ /dev/null
@@ -1,269 +0,0 @@
-## @file
-# This file implements the log mechanism for Python tools.
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-## Import modules
-import sys, os, logging
-import traceback
-from BuildToolError import *
-
-## Log level constants
-DEBUG_0 = 1
-DEBUG_1 = 2
-DEBUG_2 = 3
-DEBUG_3 = 4
-DEBUG_4 = 5
-DEBUG_5 = 6
-DEBUG_6 = 7
-DEBUG_7 = 8
-DEBUG_8 = 9
-DEBUG_9 = 10
-VERBOSE = 15
-INFO = 20
-WARN = 30
-QUIET = 40
-ERROR = 50
-
-IsRaiseError = True
-
-# Tool name
-_ToolName = os.path.basename(sys.argv[0])
-
-# For validation purpose
-_LogLevels = [DEBUG_0, DEBUG_1, DEBUG_2, DEBUG_3, DEBUG_4, DEBUG_5, DEBUG_6, DEBUG_7, DEBUG_8, DEBUG_9, VERBOSE, WARN, INFO, ERROR, QUIET]
-
-# For DEBUG level (All DEBUG_0~9 are applicable)
-_DebugLogger = logging.getLogger("tool_debug")
-_DebugFormatter = logging.Formatter("[%(asctime)s.%(msecs)d]: %(message)s", datefmt="%H:%M:%S")
-
-# For VERBOSE, INFO, WARN level
-_InfoLogger = logging.getLogger("tool_info")
-_InfoFormatter = logging.Formatter("%(message)s")
-
-# For ERROR level
-_ErrorLogger = logging.getLogger("tool_error")
-_ErrorFormatter = logging.Formatter("%(message)s")
-
-# String templates for ERROR/WARN/DEBUG log message
-_ErrorMessageTemplate = '\n\n%(tool)s...\n%(file)s(%(line)s): error %(errorcode)04X: %(msg)s\n\t%(extra)s'
-_ErrorMessageTemplateWithoutFile = '\n\n%(tool)s...\n : error %(errorcode)04X: %(msg)s\n\t%(extra)s'
-_WarningMessageTemplate = '%(tool)s...\n%(file)s(%(line)s): warning: %(msg)s'
-_WarningMessageTemplateWithoutFile = '%(tool)s: : warning: %(msg)s'
-_DebugMessageTemplate = '%(file)s(%(line)s): debug: \n %(msg)s'
-
-#
-# Flag used to take WARN as ERROR.
-# By default, only ERROR message will break the tools execution.
-#
-_WarningAsError = False
-
-## Log debug message
-#
-# @param Level DEBUG level (DEBUG0~9)
-# @param Message Debug information
-# @param ExtraData More information associated with "Message"
-#
-def debug(Level, Message, ExtraData=None):
- if _DebugLogger.level > Level:
- return
- if Level > DEBUG_9:
- return
-
- # Find out the caller method information
- CallerStack = traceback.extract_stack()[-2]
- TemplateDict = {
- "file" : CallerStack[0],
- "line" : CallerStack[1],
- "msg" : Message,
- }
-
- if ExtraData != None:
- LogText = _DebugMessageTemplate % TemplateDict + "\n %s" % ExtraData
- else:
- LogText = _DebugMessageTemplate % TemplateDict
-
- _DebugLogger.log(Level, LogText)
-
-## Log verbose message
-#
-# @param Message Verbose information
-#
-def verbose(Message):
- return _InfoLogger.log(VERBOSE, Message)
-
-## Log warning message
-#
-# Warning messages are those which might be wrong but won't fail the tool.
-#
-# @param ToolName The name of the tool. If not given, the name of caller
-# method will be used.
-# @param Message Warning information
-# @param File The name of file which caused the warning.
-# @param Line The line number in the "File" which caused the warning.
-# @param ExtraData More information associated with "Message"
-#
-def warn(ToolName, Message, File=None, Line=None, ExtraData=None):
- if _InfoLogger.level > WARN:
- return
-
- # if no tool name given, use caller's source file name as tool name
- if ToolName == None or ToolName == "":
- ToolName = os.path.basename(traceback.extract_stack()[-2][0])
-
- if Line == None:
- Line = "..."
- else:
- Line = "%d" % Line
-
- TemplateDict = {
- "tool" : ToolName,
- "file" : File,
- "line" : Line,
- "msg" : Message,
- }
-
- if File != None:
- LogText = _WarningMessageTemplate % TemplateDict
- else:
- LogText = _WarningMessageTemplateWithoutFile % TemplateDict
-
- if ExtraData != None:
- LogText += "\n %s" % ExtraData
-
- _InfoLogger.log(WARN, LogText)
-
- # Raise an execption if indicated
- if _WarningAsError == True:
- raise FatalError(WARNING_AS_ERROR)
-
-## Log INFO message
-info = _InfoLogger.info
-
-## Log ERROR message
-#
-# Once an error messages is logged, the tool's execution will be broken by raising
-# an execption. If you don't want to break the execution later, you can give
-# "RaiseError" with "False" value.
-#
-# @param ToolName The name of the tool. If not given, the name of caller
-# method will be used.
-# @param ErrorCode The error code
-# @param Message Warning information
-# @param File The name of file which caused the error.
-# @param Line The line number in the "File" which caused the warning.
-# @param ExtraData More information associated with "Message"
-# @param RaiseError Raise an exception to break the tool's executuion if
-# it's True. This is the default behavior.
-#
-def error(ToolName, ErrorCode, Message=None, File=None, Line=None, ExtraData=None, RaiseError=IsRaiseError):
- if Line == None:
- Line = "..."
- else:
- Line = "%d" % Line
-
- if Message == None:
- if ErrorCode in gErrorMessage:
- Message = gErrorMessage[ErrorCode]
- else:
- Message = gErrorMessage[UNKNOWN_ERROR]
-
- if ExtraData == None:
- ExtraData = ""
-
- TemplateDict = {
- "tool" : _ToolName,
- "file" : File,
- "line" : Line,
- "errorcode" : ErrorCode,
- "msg" : Message,
- "extra" : ExtraData
- }
-
- if File != None:
- LogText = _ErrorMessageTemplate % TemplateDict
- else:
- LogText = _ErrorMessageTemplateWithoutFile % TemplateDict
-
- _ErrorLogger.log(ERROR, LogText)
- if RaiseError:
- raise FatalError(ErrorCode)
-
-# Log information which should be always put out
-quiet = _ErrorLogger.error
-
-## Initialize log system
-def Initialize():
- #
- # Since we use different format to log different levels of message into different
- # place (stdout or stderr), we have to use different "Logger" objects to do this.
- #
- # For DEBUG level (All DEBUG_0~9 are applicable)
- _DebugLogger.setLevel(INFO)
- _DebugChannel = logging.StreamHandler(sys.stdout)
- _DebugChannel.setFormatter(_DebugFormatter)
- _DebugLogger.addHandler(_DebugChannel)
-
- # For VERBOSE, INFO, WARN level
- _InfoLogger.setLevel(INFO)
- _InfoChannel = logging.StreamHandler(sys.stdout)
- _InfoChannel.setFormatter(_InfoFormatter)
- _InfoLogger.addHandler(_InfoChannel)
-
- # For ERROR level
- _ErrorLogger.setLevel(INFO)
- _ErrorCh = logging.StreamHandler(sys.stderr)
- _ErrorCh.setFormatter(_ErrorFormatter)
- _ErrorLogger.addHandler(_ErrorCh)
-
-## Set log level
-#
-# @param Level One of log level in _LogLevel
-def SetLevel(Level):
- if Level not in _LogLevels:
- info("Not supported log level (%d). Use default level instead." % Level)
- Level = INFO
- _DebugLogger.setLevel(Level)
- _InfoLogger.setLevel(Level)
- _ErrorLogger.setLevel(Level)
-
-## Get current log level
-def GetLevel():
- return _InfoLogger.getEffectiveLevel()
-
-## Raise up warning as error
-def SetWarningAsError():
- global _WarningAsError
- _WarningAsError = True
-
-## Specify a file to store the log message as well as put on console
-#
-# @param LogFile The file path used to store the log message
-#
-def SetLogFile(LogFile):
- if os.path.exists(LogFile):
- os.remove(LogFile)
-
- _Ch = logging.FileHandler(LogFile)
- _Ch.setFormatter(_DebugFormatter)
- _DebugLogger.addHandler(_Ch)
-
- _Ch= logging.FileHandler(LogFile)
- _Ch.setFormatter(_InfoFormatter)
- _InfoLogger.addHandler(_Ch)
-
- _Ch = logging.FileHandler(LogFile)
- _Ch.setFormatter(_ErrorFormatter)
- _ErrorLogger.addHandler(_Ch)
-
-if __name__ == '__main__':
- pass
-
diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py
deleted file mode 100644
index 3c8d14e6ce..0000000000
--- a/BaseTools/Source/Python/Common/Expression.py
+++ /dev/null
@@ -1,630 +0,0 @@
-## @file
-# This file is used to parse and evaluate expression in directive or PCD value.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-## Import Modules
-#
-from Common.GlobalData import *
-from CommonDataClass.Exceptions import BadExpression
-from CommonDataClass.Exceptions import WrnExpression
-from Misc import GuidStringToGuidStructureString
-
-ERR_STRING_EXPR = 'This operator cannot be used in string expression: [%s].'
-ERR_SNYTAX = 'Syntax error, the rest of expression cannot be evaluated: [%s].'
-ERR_MATCH = 'No matching right parenthesis.'
-ERR_STRING_TOKEN = 'Bad string token: [%s].'
-ERR_MACRO_TOKEN = 'Bad macro token: [%s].'
-ERR_EMPTY_TOKEN = 'Empty token is not allowed.'
-ERR_PCD_RESOLVE = 'PCD token cannot be resolved: [%s].'
-ERR_VALID_TOKEN = 'No more valid token found from rest of string: [%s].'
-ERR_EXPR_TYPE = 'Different types found in expression.'
-ERR_OPERATOR_UNSUPPORT = 'Unsupported operator: [%s]'
-ERR_REL_NOT_IN = 'Expect "IN" after "not" operator.'
-WRN_BOOL_EXPR = 'Operand of boolean type cannot be used in arithmetic expression.'
-WRN_EQCMP_STR_OTHERS = '== Comparison between Operand of string type and Boolean/Number Type always return False.'
-WRN_NECMP_STR_OTHERS = '!= Comparison between Operand of string type and Boolean/Number Type always return True.'
-ERR_RELCMP_STR_OTHERS = 'Operator taking Operand of string type and Boolean/Number Type is not allowed: [%s].'
-ERR_STRING_CMP = 'Unicode string and general string cannot be compared: [%s %s %s]'
-ERR_ARRAY_TOKEN = 'Bad C array or C format GUID token: [%s].'
-ERR_ARRAY_ELE = 'This must be HEX value for NList or Array: [%s].'
-ERR_EMPTY_EXPR = 'Empty expression is not allowed.'
-ERR_IN_OPERAND = 'Macro after IN operator can only be: $(FAMILY), $(ARCH), $(TOOL_CHAIN_TAG) and $(TARGET).'
-
-## SplitString
-# Split string to list according double quote
-# For example: abc"de\"f"ghi"jkl"mn will be: ['abc', '"de\"f"', 'ghi', '"jkl"', 'mn']
-#
-def SplitString(String):
- # There might be escaped quote: "abc\"def\\\"ghi"
- Str = String.replace('\\\\', '//').replace('\\\"', '\\\'')
- RetList = []
- InQuote = False
- Item = ''
- for i, ch in enumerate(Str):
- if ch == '"':
- InQuote = not InQuote
- if not InQuote:
- Item += String[i]
- RetList.append(Item)
- Item = ''
- continue
- if Item:
- RetList.append(Item)
- Item = ''
- Item += String[i]
- if InQuote:
- raise BadExpression(ERR_STRING_TOKEN % Item)
- if Item:
- RetList.append(Item)
- return RetList
-
-## ReplaceExprMacro
-#
-def ReplaceExprMacro(String, Macros, ExceptionList = None):
- StrList = SplitString(String)
- for i, String in enumerate(StrList):
- InQuote = False
- if String.startswith('"'):
- InQuote = True
- MacroStartPos = String.find('$(')
- if MacroStartPos < 0:
- continue
- RetStr = ''
- while MacroStartPos >= 0:
- RetStr = String[0:MacroStartPos]
- MacroEndPos = String.find(')', MacroStartPos)
- if MacroEndPos < 0:
- raise BadExpression(ERR_MACRO_TOKEN % String[MacroStartPos:])
- Macro = String[MacroStartPos+2:MacroEndPos]
- if Macro not in Macros:
- # From C reference manual:
- # If an undefined macro name appears in the constant-expression of
- # !if or !elif, it is replaced by the integer constant 0.
- RetStr += '0'
- elif not InQuote:
- Tklst = RetStr.split()
- if Tklst and Tklst[-1] in ['IN', 'in'] and ExceptionList and Macro not in ExceptionList:
- raise BadExpression(ERR_IN_OPERAND)
- # Make sure the macro in exception list is encapsulated by double quote
- # For example: DEFINE ARCH = IA32 X64
- # $(ARCH) is replaced with "IA32 X64"
- if ExceptionList and Macro in ExceptionList:
- RetStr += '"' + Macros[Macro] + '"'
- elif Macros[Macro].strip():
- RetStr += Macros[Macro]
- else:
- RetStr += '""'
- else:
- RetStr += Macros[Macro]
- RetStr += String[MacroEndPos+1:]
- String = RetStr
- MacroStartPos = String.find('$(')
- StrList[i] = RetStr
- return ''.join(StrList)
-
-SupportedInMacroList = ['TARGET', 'TOOL_CHAIN_TAG', 'ARCH', 'FAMILY']
-
-class ValueExpression(object):
- # Logical operator mapping
- LogicalOperators = {
- '&&' : 'and', '||' : 'or',
- '!' : 'not', 'AND': 'and',
- 'OR' : 'or' , 'NOT': 'not',
- 'XOR': '^' , 'xor': '^',
- 'EQ' : '==' , 'NE' : '!=',
- 'GT' : '>' , 'LT' : '<',
- 'GE' : '>=' , 'LE' : '<=',
- 'IN' : 'in'
- }
-
- NonLetterOpLst = ['+', '-', '&', '|', '^', '!', '=', '>', '<']
-
- PcdPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*\.[_a-zA-Z][0-9A-Za-z_]*$')
- HexPattern = re.compile(r'0[xX][0-9a-fA-F]+$')
- RegGuidPattern = re.compile(r'[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}')
-
- SymbolPattern = re.compile("("
- "\$\([A-Z][A-Z0-9_]*\)|\$\(\w+\.\w+\)|\w+\.\w+|"
- "&&|\|\||!(?!=)|"
- "(?<=\W)AND(?=\W)|(?<=\W)OR(?=\W)|(?<=\W)NOT(?=\W)|(?<=\W)XOR(?=\W)|"
- "(?<=\W)EQ(?=\W)|(?<=\W)NE(?=\W)|(?<=\W)GT(?=\W)|(?<=\W)LT(?=\W)|(?<=\W)GE(?=\W)|(?<=\W)LE(?=\W)"
- ")")
-
- @staticmethod
- def Eval(Operator, Oprand1, Oprand2 = None):
- WrnExp = None
-
- if Operator not in ["==", "!=", ">=", "<=", ">", "<", "in", "not in"] and \
- (type(Oprand1) == type('') or type(Oprand2) == type('')):
- raise BadExpression(ERR_STRING_EXPR % Operator)
-
- TypeDict = {
- type(0) : 0,
- type(0L) : 0,
- type('') : 1,
- type(True) : 2
- }
-
- EvalStr = ''
- if Operator in ["!", "NOT", "not"]:
- if type(Oprand1) == type(''):
- raise BadExpression(ERR_STRING_EXPR % Operator)
- EvalStr = 'not Oprand1'
- else:
- if Operator in ["+", "-"] and (type(True) in [type(Oprand1), type(Oprand2)]):
- # Boolean in '+'/'-' will be evaluated but raise warning
- WrnExp = WrnExpression(WRN_BOOL_EXPR)
- elif type('') in [type(Oprand1), type(Oprand2)] and type(Oprand1)!= type(Oprand2):
- # == between string and number/boolean will always return False, != return True
- if Operator == "==":
- WrnExp = WrnExpression(WRN_EQCMP_STR_OTHERS)
- WrnExp.result = False
- raise WrnExp
- elif Operator == "!=":
- WrnExp = WrnExpression(WRN_NECMP_STR_OTHERS)
- WrnExp.result = True
- raise WrnExp
- else:
- raise BadExpression(ERR_RELCMP_STR_OTHERS % Operator)
- elif TypeDict[type(Oprand1)] != TypeDict[type(Oprand2)]:
- if Operator in ["==", "!=", ">=", "<=", ">", "<"] and set((TypeDict[type(Oprand1)], TypeDict[type(Oprand2)])) == set((TypeDict[type(True)], TypeDict[type(0)])):
- # comparison between number and boolean is allowed
- pass
- elif Operator in ['&', '|', '^', "and", "or"] and set((TypeDict[type(Oprand1)], TypeDict[type(Oprand2)])) == set((TypeDict[type(True)], TypeDict[type(0)])):
- # bitwise and logical operation between number and boolean is allowed
- pass
- else:
- raise BadExpression(ERR_EXPR_TYPE)
- if type(Oprand1) == type('') and type(Oprand2) == type(''):
- if (Oprand1.startswith('L"') and not Oprand2.startswith('L"')) or \
- (not Oprand1.startswith('L"') and Oprand2.startswith('L"')):
- raise BadExpression(ERR_STRING_CMP % (Oprand1, Operator, Oprand2))
- if 'in' in Operator and type(Oprand2) == type(''):
- Oprand2 = Oprand2.split()
- EvalStr = 'Oprand1 ' + Operator + ' Oprand2'
-
- # Local symbols used by built in eval function
- Dict = {
- 'Oprand1' : Oprand1,
- 'Oprand2' : Oprand2
- }
- try:
- Val = eval(EvalStr, {}, Dict)
- except Exception, Excpt:
- raise BadExpression(str(Excpt))
-
- if Operator in ['and', 'or']:
- if Val:
- Val = True
- else:
- Val = False
-
- if WrnExp:
- WrnExp.result = Val
- raise WrnExp
- return Val
-
- def __init__(self, Expression, SymbolTable={}):
- self._NoProcess = False
- if type(Expression) != type(''):
- self._Expr = Expression
- self._NoProcess = True
- return
-
- self._Expr = ReplaceExprMacro(Expression.strip(),
- SymbolTable,
- SupportedInMacroList)
-
- if not self._Expr.strip():
- raise BadExpression(ERR_EMPTY_EXPR)
-
- #
- # The symbol table including PCD and macro mapping
- #
- self._Symb = SymbolTable
- self._Symb.update(self.LogicalOperators)
- self._Idx = 0
- self._Len = len(self._Expr)
- self._Token = ''
- self._WarnExcept = None
-
- # Literal token without any conversion
- self._LiteralToken = ''
-
- # Public entry for this class
- # @param RealValue: False: only evaluate if the expression is true or false, used for conditional expression
- # True : return the evaluated str(value), used for PCD value
- #
- # @return: True or False if RealValue is False
- # Evaluated value of string format if RealValue is True
- #
- def __call__(self, RealValue=False, Depth=0):
- if self._NoProcess:
- return self._Expr
-
- self._Depth = Depth
-
- self._Expr = self._Expr.strip()
- if RealValue and Depth == 0:
- self._Token = self._Expr
- if self.__IsNumberToken():
- return self._Expr
-
- try:
- Token = self._GetToken()
- if type(Token) == type('') and Token.startswith('{') and Token.endswith('}') and self._Idx >= self._Len:
- return self._Expr
- except BadExpression:
- pass
-
- self._Idx = 0
- self._Token = ''
-
- Val = self._OrExpr()
- RealVal = Val
- if type(Val) == type(''):
- if Val == 'L""':
- Val = False
- elif not Val:
- Val = False
- RealVal = '""'
- elif not Val.startswith('L"') and not Val.startswith('{'):
- Val = True
- RealVal = '"' + RealVal + '"'
-
- # The expression has been parsed, but the end of expression is not reached
- # It means the rest does not comply EBNF of <Expression>
- if self._Idx != self._Len:
- raise BadExpression(ERR_SNYTAX % self._Expr[self._Idx:])
-
- if RealValue:
- RetVal = str(RealVal)
- elif Val:
- RetVal = True
- else:
- RetVal = False
-
- if self._WarnExcept:
- self._WarnExcept.result = RetVal
- raise self._WarnExcept
- else:
- return RetVal
-
- # Template function to parse binary operators which have same precedence
- # Expr [Operator Expr]*
- def _ExprFuncTemplate(self, EvalFunc, OpLst):
- Val = EvalFunc()
- while self._IsOperator(OpLst):
- Op = self._Token
- try:
- Val = self.Eval(Op, Val, EvalFunc())
- except WrnExpression, Warn:
- self._WarnExcept = Warn
- Val = Warn.result
- return Val
-
- # A [|| B]*
- def _OrExpr(self):
- return self._ExprFuncTemplate(self._AndExpr, ["OR", "or", "||"])
-
- # A [&& B]*
- def _AndExpr(self):
- return self._ExprFuncTemplate(self._BitOr, ["AND", "and", "&&"])
-
- # A [ | B]*
- def _BitOr(self):
- return self._ExprFuncTemplate(self._BitXor, ["|"])
-
- # A [ ^ B]*
- def _BitXor(self):
- return self._ExprFuncTemplate(self._BitAnd, ["XOR", "xor", "^"])
-
- # A [ & B]*
- def _BitAnd(self):
- return self._ExprFuncTemplate(self._EqExpr, ["&"])
-
- # A [ == B]*
- def _EqExpr(self):
- Val = self._RelExpr()
- while self._IsOperator(["==", "!=", "EQ", "NE", "IN", "in", "!", "NOT", "not"]):
- Op = self._Token
- if Op in ["!", "NOT", "not"]:
- if not self._IsOperator(["IN", "in"]):
- raise BadExpression(ERR_REL_NOT_IN)
- Op += ' ' + self._Token
- try:
- Val = self.Eval(Op, Val, self._RelExpr())
- except WrnExpression, Warn:
- self._WarnExcept = Warn
- Val = Warn.result
- return Val
-
- # A [ > B]*
- def _RelExpr(self):
- return self._ExprFuncTemplate(self._AddExpr, ["<=", ">=", "<", ">", "LE", "GE", "LT", "GT"])
-
- # A [ + B]*
- def _AddExpr(self):
- return self._ExprFuncTemplate(self._UnaryExpr, ["+", "-"])
-
- # [!]*A
- def _UnaryExpr(self):
- if self._IsOperator(["!", "NOT", "not"]):
- Val = self._UnaryExpr()
- try:
- return self.Eval('not', Val)
- except WrnExpression, Warn:
- self._WarnExcept = Warn
- return Warn.result
- return self._IdenExpr()
-
- # Parse identifier or encapsulated expression
- def _IdenExpr(self):
- Tk = self._GetToken()
- if Tk == '(':
- Val = self._OrExpr()
- try:
- # _GetToken may also raise BadExpression
- if self._GetToken() != ')':
- raise BadExpression(ERR_MATCH)
- except BadExpression:
- raise BadExpression(ERR_MATCH)
- return Val
- return Tk
-
- # Skip whitespace or tab
- def __SkipWS(self):
- for Char in self._Expr[self._Idx:]:
- if Char not in ' \t':
- break
- self._Idx += 1
-
- # Try to convert string to number
- def __IsNumberToken(self):
- Radix = 10
- if self._Token.lower()[0:2] == '0x' and len(self._Token) > 2:
- Radix = 16
- try:
- self._Token = int(self._Token, Radix)
- return True
- except ValueError:
- return False
- except TypeError:
- return False
-
- # Parse array: {...}
- def __GetArray(self):
- Token = '{'
- self._Idx += 1
- self.__GetNList(True)
- Token += self._LiteralToken
- if self._Idx >= self._Len or self._Expr[self._Idx] != '}':
- raise BadExpression(ERR_ARRAY_TOKEN % Token)
- Token += '}'
-
- # All whitespace and tabs in array are already stripped.
- IsArray = IsGuid = False
- if len(Token.split(',')) == 11 and len(Token.split(',{')) == 2 \
- and len(Token.split('},')) == 1:
- HexLen = [11,6,6,5,4,4,4,4,4,4,6]
- HexList= Token.split(',')
- if HexList[3].startswith('{') and \
- not [Index for Index, Hex in enumerate(HexList) if len(Hex) > HexLen[Index]]:
- IsGuid = True
- if Token.lstrip('{').rstrip('}').find('{') == -1:
- if not [Hex for Hex in Token.lstrip('{').rstrip('}').split(',') if len(Hex) > 4]:
- IsArray = True
- if not IsArray and not IsGuid:
- raise BadExpression(ERR_ARRAY_TOKEN % Token)
- self._Idx += 1
- self._Token = self._LiteralToken = Token
- return self._Token
-
- # Parse string, the format must be: "..."
- def __GetString(self):
- Idx = self._Idx
-
- # Skip left quote
- self._Idx += 1
-
- # Replace escape \\\", \"
- Expr = self._Expr[self._Idx:].replace('\\\\', '//').replace('\\\"', '\\\'')
- for Ch in Expr:
- self._Idx += 1
- if Ch == '"':
- break
- self._Token = self._LiteralToken = self._Expr[Idx:self._Idx]
- if not self._Token.endswith('"'):
- raise BadExpression(ERR_STRING_TOKEN % self._Token)
- self._Token = self._Token[1:-1]
- return self._Token
-
- # Get token that is comprised by alphanumeric, underscore or dot(used by PCD)
- # @param IsAlphaOp: Indicate if parsing general token or script operator(EQ, NE...)
- def __GetIdToken(self, IsAlphaOp = False):
- IdToken = ''
- for Ch in self._Expr[self._Idx:]:
- if not self.__IsIdChar(Ch):
- break
- self._Idx += 1
- IdToken += Ch
-
- self._Token = self._LiteralToken = IdToken
- if not IsAlphaOp:
- self.__ResolveToken()
- return self._Token
-
- # Try to resolve token
- def __ResolveToken(self):
- if not self._Token:
- raise BadExpression(ERR_EMPTY_TOKEN)
-
- # PCD token
- if self.PcdPattern.match(self._Token):
- if self._Token not in self._Symb:
- Ex = BadExpression(ERR_PCD_RESOLVE % self._Token)
- Ex.Pcd = self._Token
- raise Ex
- self._Token = ValueExpression(self._Symb[self._Token], self._Symb)(True, self._Depth+1)
- if type(self._Token) != type(''):
- self._LiteralToken = hex(self._Token)
- return
-
- if self._Token.startswith('"'):
- self._Token = self._Token[1:-1]
- elif self._Token in ["FALSE", "false", "False"]:
- self._Token = False
- elif self._Token in ["TRUE", "true", "True"]:
- self._Token = True
- else:
- self.__IsNumberToken()
-
- def __GetNList(self, InArray=False):
- self._GetSingleToken()
- if not self.__IsHexLiteral():
- if InArray:
- raise BadExpression(ERR_ARRAY_ELE % self._Token)
- return self._Token
-
- self.__SkipWS()
- Expr = self._Expr[self._Idx:]
- if not Expr.startswith(','):
- return self._Token
-
- NList = self._LiteralToken
- while Expr.startswith(','):
- NList += ','
- self._Idx += 1
- self.__SkipWS()
- self._GetSingleToken()
- if not self.__IsHexLiteral():
- raise BadExpression(ERR_ARRAY_ELE % self._Token)
- NList += self._LiteralToken
- self.__SkipWS()
- Expr = self._Expr[self._Idx:]
- self._Token = self._LiteralToken = NList
- return self._Token
-
- def __IsHexLiteral(self):
- if self._LiteralToken.startswith('{') and \
- self._LiteralToken.endswith('}'):
- return True
-
- if self.HexPattern.match(self._LiteralToken):
- Token = self._LiteralToken[2:]
- Token = Token.lstrip('0')
- if not Token:
- self._LiteralToken = '0x0'
- else:
- self._LiteralToken = '0x' + Token.lower()
- return True
- return False
-
- def _GetToken(self):
- return self.__GetNList()
-
- @staticmethod
- def __IsIdChar(Ch):
- return Ch in '._/:' or Ch.isalnum()
-
- # Parse operand
- def _GetSingleToken(self):
- self.__SkipWS()
- Expr = self._Expr[self._Idx:]
- if Expr.startswith('L"'):
- # Skip L
- self._Idx += 1
- UStr = self.__GetString()
- self._Token = 'L"' + UStr + '"'
- return self._Token
-
- self._Token = ''
- if Expr:
- Ch = Expr[0]
- Match = self.RegGuidPattern.match(Expr)
- if Match and not Expr[Match.end():Match.end()+1].isalnum() \
- and Expr[Match.end():Match.end()+1] != '_':
- self._Idx += Match.end()
- self._Token = ValueExpression(GuidStringToGuidStructureString(Expr[0:Match.end()]))(True, self._Depth+1)
- return self._Token
- elif self.__IsIdChar(Ch):
- return self.__GetIdToken()
- elif Ch == '"':
- return self.__GetString()
- elif Ch == '{':
- return self.__GetArray()
- elif Ch == '(' or Ch == ')':
- self._Idx += 1
- self._Token = Ch
- return self._Token
-
- raise BadExpression(ERR_VALID_TOKEN % Expr)
-
- # Parse operator
- def _GetOperator(self):
- self.__SkipWS()
- LegalOpLst = ['&&', '||', '!=', '==', '>=', '<='] + self.NonLetterOpLst
-
- self._Token = ''
- Expr = self._Expr[self._Idx:]
-
- # Reach end of expression
- if not Expr:
- return ''
-
- # Script operator: LT, GT, LE, GE, EQ, NE, and, or, xor, not
- if Expr[0].isalpha():
- return self.__GetIdToken(True)
-
- # Start to get regular operator: +, -, <, > ...
- if Expr[0] not in self.NonLetterOpLst:
- return ''
-
- OpToken = ''
- for Ch in Expr:
- if Ch in self.NonLetterOpLst:
- if '!' == Ch and OpToken:
- break
- self._Idx += 1
- OpToken += Ch
- else:
- break
-
- if OpToken not in LegalOpLst:
- raise BadExpression(ERR_OPERATOR_UNSUPPORT % OpToken)
- self._Token = OpToken
- return OpToken
-
- # Check if current token matches the operators given from OpList
- def _IsOperator(self, OpList):
- Idx = self._Idx
- self._GetOperator()
- if self._Token in OpList:
- if self._Token in self.LogicalOperators:
- self._Token = self.LogicalOperators[self._Token]
- return True
- self._Idx = Idx
- return False
-
-if __name__ == '__main__':
- pass
- while True:
- input = raw_input('Input expr: ')
- if input in 'qQ':
- break
- try:
- print ValueExpression(input)(True)
- print ValueExpression(input)(False)
- except WrnExpression, Ex:
- print Ex.result
- print str(Ex)
- except Exception, Ex:
- print str(Ex)
diff --git a/BaseTools/Source/Python/Common/FdfClassObject.py b/BaseTools/Source/Python/Common/FdfClassObject.py
deleted file mode 100644
index 3e7d44954c..0000000000
--- a/BaseTools/Source/Python/Common/FdfClassObject.py
+++ /dev/null
@@ -1,116 +0,0 @@
-## @file
-# This file is used to define each component of FDF file
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from FdfParserLite import FdfParser
-from Table.TableFdf import TableFdf
-from CommonDataClass.DataClass import MODEL_FILE_FDF, MODEL_PCD, MODEL_META_DATA_COMPONENT
-from String import NormPath
-
-## FdfObject
-#
-# This class defined basic Fdf object which is used by inheriting
-#
-# @param object: Inherited from object class
-#
-class FdfObject(object):
- def __init__(self):
- object.__init__()
-
-## Fdf
-#
-# This class defined the structure used in Fdf object
-#
-# @param FdfObject: Inherited from FdfObject class
-# @param Filename: Input value for Ffilename of Fdf file, default is None
-# @param WorkspaceDir: Input value for current workspace directory, default is None
-#
-class Fdf(FdfObject):
- def __init__(self, Filename = None, IsToDatabase = False, WorkspaceDir = None, Database = None):
- self.WorkspaceDir = WorkspaceDir
- self.IsToDatabase = IsToDatabase
-
- self.Cur = Database.Cur
- self.TblFile = Database.TblFile
- self.TblFdf = Database.TblFdf
- self.FileID = -1
- self.FileList = {}
-
- #
- # Load Fdf file if filename is not None
- #
- if Filename != None:
- self.LoadFdfFile(Filename)
-
- #
- # Insert a FDF file record into database
- #
- def InsertFile(self, Filename):
- FileID = -1
- Filename = NormPath(Filename)
- if Filename not in self.FileList:
- FileID = self.TblFile.InsertFile(Filename, MODEL_FILE_FDF)
- self.FileList[Filename] = FileID
-
- return self.FileList[Filename]
-
-
- ## Load Fdf file
- #
- # Load the file if it exists
- #
- # @param Filename: Input value for filename of Fdf file
- #
- def LoadFdfFile(self, Filename):
- FileList = []
- #
- # Parse Fdf file
- #
- Filename = NormPath(Filename)
- Fdf = FdfParser(Filename)
- Fdf.ParseFile()
-
- #
- # Insert inf file and pcd information
- #
- if self.IsToDatabase:
- (Model, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled) = \
- (0, '', '', '', 'COMMON', -1, -1, -1, -1, -1, -1, 0)
- for Index in range(0, len(Fdf.Profile.PcdDict)):
- pass
- for Key in Fdf.Profile.PcdDict.keys():
- Model = MODEL_PCD
- Value1 = ''
- Value2 = ".".join((Key[1], Key[0]))
- FileName = Fdf.Profile.PcdFileLineDict[Key][0]
- StartLine = Fdf.Profile.PcdFileLineDict[Key][1]
- BelongsToFile = self.InsertFile(FileName)
- self.TblFdf.Insert(Model, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
- for Index in range(0, len(Fdf.Profile.InfList)):
- Model = MODEL_META_DATA_COMPONENT
- Value1 = Fdf.Profile.InfList[Index]
- Value2 = ''
- FileName = Fdf.Profile.InfFileLineList[Index][0]
- StartLine = Fdf.Profile.InfFileLineList[Index][1]
- BelongsToFile = self.InsertFile(FileName)
- self.TblFdf.Insert(Model, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- pass
diff --git a/BaseTools/Source/Python/Common/FdfParserLite.py b/BaseTools/Source/Python/Common/FdfParserLite.py
deleted file mode 100644
index 031dc15bc7..0000000000
--- a/BaseTools/Source/Python/Common/FdfParserLite.py
+++ /dev/null
@@ -1,3665 +0,0 @@
-## @file
-# parse FDF file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import re
-import os
-
-import CommonDataClass.FdfClass
-
-##define T_CHAR_SPACE ' '
-##define T_CHAR_NULL '\0'
-##define T_CHAR_CR '\r'
-##define T_CHAR_TAB '\t'
-##define T_CHAR_LF '\n'
-##define T_CHAR_SLASH '/'
-##define T_CHAR_BACKSLASH '\\'
-##define T_CHAR_DOUBLE_QUOTE '\"'
-##define T_CHAR_SINGLE_QUOTE '\''
-##define T_CHAR_STAR '*'
-##define T_CHAR_HASH '#'
-
-(T_CHAR_SPACE, T_CHAR_NULL, T_CHAR_CR, T_CHAR_TAB, T_CHAR_LF, T_CHAR_SLASH, \
-T_CHAR_BACKSLASH, T_CHAR_DOUBLE_QUOTE, T_CHAR_SINGLE_QUOTE, T_CHAR_STAR, T_CHAR_HASH) = \
-(' ', '\0', '\r', '\t', '\n', '/', '\\', '\"', '\'', '*', '#')
-
-SEPERATOR_TUPLE = ('=', '|', ',', '{', '}')
-
-IncludeFileList = []
-# Macro passed from command line, which has greatest priority and can NOT be overridden by those in FDF
-InputMacroDict = {}
-# All Macro values when parsing file, not replace existing Macro
-AllMacroList = []
-
-def GetRealFileLine (File, Line):
-
- InsertedLines = 0
- for Profile in IncludeFileList:
- if Line >= Profile.InsertStartLineNumber and Line < Profile.InsertStartLineNumber + Profile.InsertAdjust + len(Profile.FileLinesList):
- return (Profile.FileName, Line - Profile.InsertStartLineNumber + 1)
- if Line >= Profile.InsertStartLineNumber + Profile.InsertAdjust + len(Profile.FileLinesList):
- InsertedLines += Profile.InsertAdjust + len(Profile.FileLinesList)
-
- return (File, Line - InsertedLines)
-
-## The exception class that used to report error messages when parsing FDF
-#
-# Currently the "ToolName" is set to be "FDF Parser".
-#
-class Warning (Exception):
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param File The FDF name
- # @param Line The Line number that error occurs
- #
- def __init__(self, Str, File = None, Line = None):
-
- FileLineTuple = GetRealFileLine(File, Line)
- self.FileName = FileLineTuple[0]
- self.LineNumber = FileLineTuple[1]
- self.message = Str + str(self.LineNumber)
- self.ToolName = 'FDF Parser'
-
-## The MACRO class that used to record macro value data when parsing include file
-#
-#
-class MacroProfile :
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName, Line):
- self.FileName = FileName
- self.DefinedAtLine = Line
- self.MacroName = None
- self.MacroValue = None
-
-## The Include file content class that used to record file data when parsing include file
-#
-# May raise Exception when opening file.
-#
-class IncludeFileProfile :
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName):
- self.FileName = FileName
- self.FileLinesList = []
- try:
- fsock = open(FileName, "rb", 0)
- try:
- self.FileLinesList = fsock.readlines()
- finally:
- fsock.close()
-
- except IOError:
- raise Warning("Error when opening file %s" % FileName)
-
- self.InsertStartLineNumber = None
- self.InsertAdjust = 0
-
-## The FDF content class that used to record file data when parsing FDF
-#
-# May raise Exception when opening file.
-#
-class FileProfile :
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName):
- self.FileLinesList = []
- try:
- fsock = open(FileName, "rb", 0)
- try:
- self.FileLinesList = fsock.readlines()
- finally:
- fsock.close()
-
- except IOError:
- raise Warning("Error when opening file %s" % FileName)
-
- self.PcdDict = {}
- self.InfList = []
-
- self.PcdFileLineDict = {}
- self.InfFileLineList = []
-
- self.FdDict = {}
- self.FvDict = {}
- self.CapsuleList = []
-# self.VtfList = []
-# self.RuleDict = {}
-
-## The syntax parser for FDF
-#
-# PreprocessFile method should be called prior to ParseFile
-# CycleReferenceCheck method can detect cycles in FDF contents
-#
-# GetNext*** procedures mean these procedures will get next token first, then make judgement.
-# Get*** procedures mean these procedures will make judgement on current token only.
-#
-class FdfParser(object):
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName):
- self.Profile = FileProfile(FileName)
- self.FileName = FileName
- self.CurrentLineNumber = 1
- self.CurrentOffsetWithinLine = 0
- self.CurrentFdName = None
- self.CurrentFvName = None
- self.__Token = ""
- self.__SkippedChars = ""
-
- self.__WipeOffArea = []
-
- ## __IsWhiteSpace() method
- #
- # Whether char at current FileBufferPos is whitespace
- #
- # @param self The object pointer
- # @param Char The char to test
- # @retval True The char is a kind of white space
- # @retval False The char is NOT a kind of white space
- #
- def __IsWhiteSpace(self, Char):
- if Char in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_SPACE, T_CHAR_TAB, T_CHAR_LF):
- return True
- else:
- return False
-
- ## __SkipWhiteSpace() method
- #
- # Skip white spaces from current char, return number of chars skipped
- #
- # @param self The object pointer
- # @retval Count The number of chars skipped
- #
- def __SkipWhiteSpace(self):
- Count = 0
- while not self.__EndOfFile():
- Count += 1
- if self.__CurrentChar() in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_LF, T_CHAR_SPACE, T_CHAR_TAB):
- self.__SkippedChars += str(self.__CurrentChar())
- self.__GetOneChar()
-
- else:
- Count = Count - 1
- return Count
-
- ## __EndOfFile() method
- #
- # Judge current buffer pos is at file end
- #
- # @param self The object pointer
- # @retval True Current File buffer position is at file end
- # @retval False Current File buffer position is NOT at file end
- #
- def __EndOfFile(self):
- NumberOfLines = len(self.Profile.FileLinesList)
- SizeOfLastLine = len(self.Profile.FileLinesList[-1])
- if self.CurrentLineNumber == NumberOfLines and self.CurrentOffsetWithinLine >= SizeOfLastLine - 1:
- return True
- elif self.CurrentLineNumber > NumberOfLines:
- return True
- else:
- return False
-
- ## __EndOfLine() method
- #
- # Judge current buffer pos is at line end
- #
- # @param self The object pointer
- # @retval True Current File buffer position is at line end
- # @retval False Current File buffer position is NOT at line end
- #
- def __EndOfLine(self):
- if self.CurrentLineNumber > len(self.Profile.FileLinesList):
- return True
- SizeOfCurrentLine = len(self.Profile.FileLinesList[self.CurrentLineNumber - 1])
- if self.CurrentOffsetWithinLine >= SizeOfCurrentLine:
- return True
- else:
- return False
-
- ## Rewind() method
- #
- # Reset file data buffer to the initial state
- #
- # @param self The object pointer
- #
- def Rewind(self):
- self.CurrentLineNumber = 1
- self.CurrentOffsetWithinLine = 0
-
- ## __UndoOneChar() method
- #
- # Go back one char in the file buffer
- #
- # @param self The object pointer
- # @retval True Successfully go back one char
- # @retval False Not able to go back one char as file beginning reached
- #
- def __UndoOneChar(self):
-
- if self.CurrentLineNumber == 1 and self.CurrentOffsetWithinLine == 0:
- return False
- elif self.CurrentOffsetWithinLine == 0:
- self.CurrentLineNumber -= 1
- self.CurrentOffsetWithinLine = len(self.__CurrentLine()) - 1
- else:
- self.CurrentOffsetWithinLine -= 1
- return True
-
- ## __GetOneChar() method
- #
- # Move forward one char in the file buffer
- #
- # @param self The object pointer
- #
- def __GetOneChar(self):
- if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
- else:
- self.CurrentOffsetWithinLine += 1
-
- ## __CurrentChar() method
- #
- # Get the char pointed to by the file buffer pointer
- #
- # @param self The object pointer
- # @retval Char Current char
- #
- def __CurrentChar(self):
- return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine]
-
- ## __NextChar() method
- #
- # Get the one char pass the char pointed to by the file buffer pointer
- #
- # @param self The object pointer
- # @retval Char Next char
- #
- def __NextChar(self):
- if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
- return self.Profile.FileLinesList[self.CurrentLineNumber][0]
- else:
- return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine + 1]
-
- ## __SetCurrentCharValue() method
- #
- # Modify the value of current char
- #
- # @param self The object pointer
- # @param Value The new value of current char
- #
- def __SetCurrentCharValue(self, Value):
- self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine] = Value
-
- ## __CurrentLine() method
- #
- # Get the list that contains current line contents
- #
- # @param self The object pointer
- # @retval List current line contents
- #
- def __CurrentLine(self):
- return self.Profile.FileLinesList[self.CurrentLineNumber - 1]
-
- def __StringToList(self):
- self.Profile.FileLinesList = [list(s) for s in self.Profile.FileLinesList]
- self.Profile.FileLinesList[-1].append(' ')
-
- def __ReplaceMacros(self, Str, File, Line):
- MacroEnd = 0
- while Str.find('$(', MacroEnd) >= 0:
- MacroStart = Str.find('$(', MacroEnd)
- if Str.find(')', MacroStart) > 0:
- MacroEnd = Str.find(')', MacroStart)
- Name = Str[MacroStart + 2 : MacroEnd]
- Value = None
- if Name in InputMacroDict:
- Value = InputMacroDict[Name]
-
- else:
- for Profile in AllMacroList:
- if Profile.FileName == File and Profile.MacroName == Name and Profile.DefinedAtLine <= Line:
- Value = Profile.MacroValue
-
- if Value != None:
- Str = Str.replace('$(' + Name + ')', Value)
- MacroEnd = MacroStart + len(Value)
-
- else:
- raise Warning("Macro not complete At Line ", self.FileName, self.CurrentLineNumber)
- return Str
-
- def __ReplaceFragment(self, StartPos, EndPos, Value = ' '):
- if StartPos[0] == EndPos[0]:
- Offset = StartPos[1]
- while Offset <= EndPos[1]:
- self.Profile.FileLinesList[StartPos[0]][Offset] = Value
- Offset += 1
- return
-
- Offset = StartPos[1]
- while self.Profile.FileLinesList[StartPos[0]][Offset] not in ('\r', '\n'):
- self.Profile.FileLinesList[StartPos[0]][Offset] = Value
- Offset += 1
-
- Line = StartPos[0]
- while Line < EndPos[0]:
- Offset = 0
- while self.Profile.FileLinesList[Line][Offset] not in ('\r', '\n'):
- self.Profile.FileLinesList[Line][Offset] = Value
- Offset += 1
- Line += 1
-
- Offset = 0
- while Offset <= EndPos[1]:
- self.Profile.FileLinesList[EndPos[0]][Offset] = Value
- Offset += 1
-
-
- def __GetMacroName(self):
- if not self.__GetNextToken():
- raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)
- MacroName = self.__Token
- NotFlag = False
- if MacroName.startswith('!'):
- NotFlag = True
- MacroName = MacroName[1:].strip()
-
- if not MacroName.startswith('$(') or not MacroName.endswith(')'):
- raise Warning("Macro name expected(Please use '$(%(Token)s)' if '%(Token)s' is a macro.)" % {"Token" : MacroName},
- self.FileName, self.CurrentLineNumber)
- MacroName = MacroName[2:-1]
- return MacroName, NotFlag
-
- ## PreprocessFile() method
- #
- # Preprocess file contents, replace comments with spaces.
- # In the end, rewind the file buffer pointer to the beginning
- # BUGBUG: No !include statement processing contained in this procedure
- # !include statement should be expanded at the same FileLinesList[CurrentLineNumber - 1]
- #
- # @param self The object pointer
- #
- def PreprocessFile(self):
-
- self.Rewind()
- InComment = False
- DoubleSlashComment = False
- HashComment = False
- # HashComment in quoted string " " is ignored.
- InString = False
-
- while not self.__EndOfFile():
-
- if self.__CurrentChar() == T_CHAR_DOUBLE_QUOTE and not InComment:
- InString = not InString
- # meet new line, then no longer in a comment for // and '#'
- if self.__CurrentChar() == T_CHAR_LF:
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
- if InComment and DoubleSlashComment:
- InComment = False
- DoubleSlashComment = False
- if InComment and HashComment:
- InComment = False
- HashComment = False
- # check for */ comment end
- elif InComment and not DoubleSlashComment and not HashComment and self.__CurrentChar() == T_CHAR_STAR and self.__NextChar() == T_CHAR_SLASH:
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- InComment = False
- # set comments to spaces
- elif InComment:
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- # check for // comment
- elif self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_SLASH and not self.__EndOfLine():
- InComment = True
- DoubleSlashComment = True
- # check for '#' comment
- elif self.__CurrentChar() == T_CHAR_HASH and not self.__EndOfLine() and not InString:
- InComment = True
- HashComment = True
- # check for /* comment start
- elif self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_STAR:
- self.__SetCurrentCharValue( T_CHAR_SPACE)
- self.__GetOneChar()
- self.__SetCurrentCharValue( T_CHAR_SPACE)
- self.__GetOneChar()
- InComment = True
- else:
- self.__GetOneChar()
-
- # restore from ListOfList to ListOfString
- self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList]
- self.Rewind()
-
- ## PreprocessIncludeFile() method
- #
- # Preprocess file contents, replace !include statements with file contents.
- # In the end, rewind the file buffer pointer to the beginning
- #
- # @param self The object pointer
- #
- def PreprocessIncludeFile(self):
-
- while self.__GetNextToken():
-
- if self.__Token == '!include':
- IncludeLine = self.CurrentLineNumber
- IncludeOffset = self.CurrentOffsetWithinLine - len('!include')
- if not self.__GetNextToken():
- raise Warning("expected include file name At Line ", self.FileName, self.CurrentLineNumber)
- IncFileName = self.__Token
- if not os.path.isabs(IncFileName):
- if IncFileName.startswith('$(WORKSPACE)'):
- Str = IncFileName.replace('$(WORKSPACE)', os.environ.get('WORKSPACE'))
- if os.path.exists(Str):
- if not os.path.isabs(Str):
- Str = os.path.abspath(Str)
- IncFileName = Str
- else:
- # file is in the same dir with FDF file
- FullFdf = self.FileName
- if not os.path.isabs(self.FileName):
- FullFdf = os.path.join(os.environ.get('WORKSPACE'), self.FileName)
-
- IncFileName = os.path.join(os.path.dirname(FullFdf), IncFileName)
-
- if not os.path.exists(os.path.normpath(IncFileName)):
- raise Warning("Include file not exists At Line ", self.FileName, self.CurrentLineNumber)
-
- IncFileProfile = IncludeFileProfile(os.path.normpath(IncFileName))
-
- CurrentLine = self.CurrentLineNumber
- CurrentOffset = self.CurrentOffsetWithinLine
- # list index of the insertion, note that line number is 'CurrentLine + 1'
- InsertAtLine = CurrentLine
- IncFileProfile.InsertStartLineNumber = InsertAtLine + 1
- # deal with remaining portions after "!include filename", if exists.
- if self.__GetNextToken():
- if self.CurrentLineNumber == CurrentLine:
- RemainingLine = self.__CurrentLine()[CurrentOffset:]
- self.Profile.FileLinesList.insert(self.CurrentLineNumber, RemainingLine)
- IncFileProfile.InsertAdjust += 1
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
-
- for Line in IncFileProfile.FileLinesList:
- self.Profile.FileLinesList.insert(InsertAtLine, Line)
- self.CurrentLineNumber += 1
- InsertAtLine += 1
-
- IncludeFileList.append(IncFileProfile)
-
- # comment out the processed include file statement
- TempList = list(self.Profile.FileLinesList[IncludeLine - 1])
- TempList.insert(IncludeOffset, '#')
- self.Profile.FileLinesList[IncludeLine - 1] = ''.join(TempList)
-
- self.Rewind()
-
- ## PreprocessIncludeFile() method
- #
- # Preprocess file contents, replace !include statements with file contents.
- # In the end, rewind the file buffer pointer to the beginning
- #
- # @param self The object pointer
- #
- def PreprocessConditionalStatement(self):
- # IfList is a stack of if branches with elements of list [Pos, CondSatisfied, BranchDetermined]
- IfList = []
- while self.__GetNextToken():
- if self.__Token == 'DEFINE':
- DefineLine = self.CurrentLineNumber - 1
- DefineOffset = self.CurrentOffsetWithinLine - len('DEFINE')
- if not self.__GetNextToken():
- raise Warning("expected Macro name At Line ", self.FileName, self.CurrentLineNumber)
- Macro = self.__Token
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__GetStringData():
- pass
- Value = self.__Token
- if not Macro in InputMacroDict:
- FileLineTuple = GetRealFileLine(self.FileName, DefineLine + 1)
- MacProfile = MacroProfile(FileLineTuple[0], FileLineTuple[1])
- MacProfile.MacroName = Macro
- MacProfile.MacroValue = Value
- AllMacroList.append(MacProfile)
- self.__WipeOffArea.append(((DefineLine, DefineOffset), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
-
- elif self.__Token in ('!ifdef', '!ifndef', '!if'):
- IfStartPos = (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - len(self.__Token))
- IfList.append([IfStartPos, None, None])
- CondLabel = self.__Token
-
- MacroName, NotFlag = self.__GetMacroName()
- NotDefineFlag = False
- if CondLabel == '!ifndef':
- NotDefineFlag = True
- if CondLabel == '!ifdef' or CondLabel == '!ifndef':
- if NotFlag:
- raise Warning("'NOT' operation not allowed for Macro name At Line ", self.FileName, self.CurrentLineNumber)
-
- if CondLabel == '!if':
-
- if not self.__GetNextOp():
- raise Warning("expected !endif At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__Token in ('!=', '==', '>', '<', '>=', '<='):
- Op = self.__Token
- if not self.__GetNextToken():
- raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
- if self.__GetStringData():
- pass
- MacroValue = self.__Token
- ConditionSatisfied = self.__EvaluateConditional(MacroName, IfList[-1][0][0] + 1, Op, MacroValue)
- if NotFlag:
- ConditionSatisfied = not ConditionSatisfied
- BranchDetermined = ConditionSatisfied
- else:
- self.CurrentOffsetWithinLine -= len(self.__Token)
- ConditionSatisfied = self.__EvaluateConditional(MacroName, IfList[-1][0][0] + 1, None, 'Bool')
- if NotFlag:
- ConditionSatisfied = not ConditionSatisfied
- BranchDetermined = ConditionSatisfied
- IfList[-1] = [IfList[-1][0], ConditionSatisfied, BranchDetermined]
- if ConditionSatisfied:
- self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
-
- else:
- ConditionSatisfied = self.__EvaluateConditional(MacroName, IfList[-1][0][0] + 1)
- if NotDefineFlag:
- ConditionSatisfied = not ConditionSatisfied
- BranchDetermined = ConditionSatisfied
- IfList[-1] = [IfList[-1][0], ConditionSatisfied, BranchDetermined]
- if ConditionSatisfied:
- self.__WipeOffArea.append((IfStartPos, (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
-
- elif self.__Token in ('!elseif', '!else'):
- ElseStartPos = (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - len(self.__Token))
- if len(IfList) <= 0:
- raise Warning("Missing !if statement At Line ", self.FileName, self.CurrentLineNumber)
- if IfList[-1][1]:
- IfList[-1] = [ElseStartPos, False, True]
- self.__WipeOffArea.append((ElseStartPos, (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
- else:
- self.__WipeOffArea.append((IfList[-1][0], ElseStartPos))
- IfList[-1] = [ElseStartPos, True, IfList[-1][2]]
- if self.__Token == '!elseif':
- MacroName, NotFlag = self.__GetMacroName()
- if not self.__GetNextOp():
- raise Warning("expected !endif At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__Token in ('!=', '==', '>', '<', '>=', '<='):
- Op = self.__Token
- if not self.__GetNextToken():
- raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
- if self.__GetStringData():
- pass
- MacroValue = self.__Token
- ConditionSatisfied = self.__EvaluateConditional(MacroName, IfList[-1][0][0] + 1, Op, MacroValue)
- if NotFlag:
- ConditionSatisfied = not ConditionSatisfied
-
- else:
- self.CurrentOffsetWithinLine -= len(self.__Token)
- ConditionSatisfied = self.__EvaluateConditional(MacroName, IfList[-1][0][0] + 1, None, 'Bool')
- if NotFlag:
- ConditionSatisfied = not ConditionSatisfied
-
- IfList[-1] = [IfList[-1][0], ConditionSatisfied, IfList[-1][2]]
-
- if IfList[-1][1]:
- if IfList[-1][2]:
- IfList[-1][1] = False
- else:
- IfList[-1][2] = True
- self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
-
-
- elif self.__Token == '!endif':
- if IfList[-1][1]:
- self.__WipeOffArea.append(((self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - len('!endif')), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
- else:
- self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
-
- IfList.pop()
-
-
- if len(IfList) > 0:
- raise Warning("Missing !endif At Line ", self.FileName, self.CurrentLineNumber)
- self.Rewind()
-
- def __EvaluateConditional(self, Name, Line, Op = None, Value = None):
-
- FileLineTuple = GetRealFileLine(self.FileName, Line)
- if Name in InputMacroDict:
- MacroValue = InputMacroDict[Name]
- if Op == None:
- if Value == 'Bool' and MacroValue == None or MacroValue.upper() == 'FALSE':
- return False
- return True
- elif Op == '!=':
- if Value != MacroValue:
- return True
- else:
- return False
- elif Op == '==':
- if Value == MacroValue:
- return True
- else:
- return False
- else:
- if (self.__IsHex(Value) or Value.isdigit()) and (self.__IsHex(MacroValue) or (MacroValue != None and MacroValue.isdigit())):
- InputVal = long(Value, 0)
- MacroVal = long(MacroValue, 0)
- if Op == '>':
- if MacroVal > InputVal:
- return True
- else:
- return False
- elif Op == '>=':
- if MacroVal >= InputVal:
- return True
- else:
- return False
- elif Op == '<':
- if MacroVal < InputVal:
- return True
- else:
- return False
- elif Op == '<=':
- if MacroVal <= InputVal:
- return True
- else:
- return False
- else:
- return False
- else:
- raise Warning("Value %s is not a number At Line ", self.FileName, Line)
-
- for Profile in AllMacroList:
- if Profile.FileName == FileLineTuple[0] and Profile.MacroName == Name and Profile.DefinedAtLine <= FileLineTuple[1]:
- if Op == None:
- if Value == 'Bool' and Profile.MacroValue == None or Profile.MacroValue.upper() == 'FALSE':
- return False
- return True
- elif Op == '!=':
- if Value != Profile.MacroValue:
- return True
- else:
- return False
- elif Op == '==':
- if Value == Profile.MacroValue:
- return True
- else:
- return False
- else:
- if (self.__IsHex(Value) or Value.isdigit()) and (self.__IsHex(Profile.MacroValue) or (Profile.MacroValue != None and Profile.MacroValue.isdigit())):
- InputVal = long(Value, 0)
- MacroVal = long(Profile.MacroValue, 0)
- if Op == '>':
- if MacroVal > InputVal:
- return True
- else:
- return False
- elif Op == '>=':
- if MacroVal >= InputVal:
- return True
- else:
- return False
- elif Op == '<':
- if MacroVal < InputVal:
- return True
- else:
- return False
- elif Op == '<=':
- if MacroVal <= InputVal:
- return True
- else:
- return False
- else:
- return False
- else:
- raise Warning("Value %s is not a number At Line ", self.FileName, Line)
-
- return False
-
- ## __IsToken() method
- #
- # Check whether input string is found from current char position along
- # If found, the string value is put into self.__Token
- #
- # @param self The object pointer
- # @param String The string to search
- # @param IgnoreCase Indicate case sensitive/non-sensitive search, default is case sensitive
- # @retval True Successfully find string, file buffer pointer moved forward
- # @retval False Not able to find string, file buffer pointer not changed
- #
- def __IsToken(self, String, IgnoreCase = False):
- self.__SkipWhiteSpace()
-
- # Only consider the same line, no multi-line token allowed
- StartPos = self.CurrentOffsetWithinLine
- index = -1
- if IgnoreCase:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].upper().find(String.upper())
- else:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].find(String)
- if index == 0:
- self.CurrentOffsetWithinLine += len(String)
- self.__Token = self.__CurrentLine()[StartPos : self.CurrentOffsetWithinLine]
- return True
- return False
-
- ## __IsKeyword() method
- #
- # Check whether input keyword is found from current char position along, whole word only!
- # If found, the string value is put into self.__Token
- #
- # @param self The object pointer
- # @param Keyword The string to search
- # @param IgnoreCase Indicate case sensitive/non-sensitive search, default is case sensitive
- # @retval True Successfully find string, file buffer pointer moved forward
- # @retval False Not able to find string, file buffer pointer not changed
- #
- def __IsKeyword(self, KeyWord, IgnoreCase = False):
- self.__SkipWhiteSpace()
-
- # Only consider the same line, no multi-line token allowed
- StartPos = self.CurrentOffsetWithinLine
- index = -1
- if IgnoreCase:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].upper().find(KeyWord.upper())
- else:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].find(KeyWord)
- if index == 0:
- followingChar = self.__CurrentLine()[self.CurrentOffsetWithinLine + len(KeyWord)]
- if not str(followingChar).isspace() and followingChar not in SEPERATOR_TUPLE:
- return False
- self.CurrentOffsetWithinLine += len(KeyWord)
- self.__Token = self.__CurrentLine()[StartPos : self.CurrentOffsetWithinLine]
- return True
- return False
-
- ## __GetNextWord() method
- #
- # Get next C name from file lines
- # If found, the string value is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a C name string, file buffer pointer moved forward
- # @retval False Not able to find a C name string, file buffer pointer not changed
- #
- def __GetNextWord(self):
- self.__SkipWhiteSpace()
- if self.__EndOfFile():
- return False
-
- TempChar = self.__CurrentChar()
- StartPos = self.CurrentOffsetWithinLine
- if (TempChar >= 'a' and TempChar <= 'z') or (TempChar >= 'A' and TempChar <= 'Z') or TempChar == '_':
- self.__GetOneChar()
- while not self.__EndOfLine():
- TempChar = self.__CurrentChar()
- if (TempChar >= 'a' and TempChar <= 'z') or (TempChar >= 'A' and TempChar <= 'Z') \
- or (TempChar >= '0' and TempChar <= '9') or TempChar == '_' or TempChar == '-':
- self.__GetOneChar()
-
- else:
- break
-
- self.__Token = self.__CurrentLine()[StartPos : self.CurrentOffsetWithinLine]
- return True
-
- return False
-
- ## __GetNextToken() method
- #
- # Get next token unit before a seperator
- # If found, the string value is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a token unit, file buffer pointer moved forward
- # @retval False Not able to find a token unit, file buffer pointer not changed
- #
- def __GetNextToken(self):
- # Skip leading spaces, if exist.
- self.__SkipWhiteSpace()
- if self.__EndOfFile():
- return False
- # Record the token start position, the position of the first non-space char.
- StartPos = self.CurrentOffsetWithinLine
- StartLine = self.CurrentLineNumber
- while not self.__EndOfLine():
- TempChar = self.__CurrentChar()
- # Try to find the end char that is not a space and not in seperator tuple.
- # That is, when we got a space or any char in the tuple, we got the end of token.
- if not str(TempChar).isspace() and TempChar not in SEPERATOR_TUPLE:
- self.__GetOneChar()
- # if we happen to meet a seperator as the first char, we must proceed to get it.
- # That is, we get a token that is a seperator char. nomally it is the boundary of other tokens.
- elif StartPos == self.CurrentOffsetWithinLine and TempChar in SEPERATOR_TUPLE:
- self.__GetOneChar()
- break
- else:
- break
-# else:
-# return False
-
- EndPos = self.CurrentOffsetWithinLine
- if self.CurrentLineNumber != StartLine:
- EndPos = len(self.Profile.FileLinesList[StartLine-1])
- self.__Token = self.Profile.FileLinesList[StartLine-1][StartPos : EndPos]
- if StartPos != self.CurrentOffsetWithinLine:
- return True
- else:
- return False
-
- def __GetNextOp(self):
- # Skip leading spaces, if exist.
- self.__SkipWhiteSpace()
- if self.__EndOfFile():
- return False
- # Record the token start position, the position of the first non-space char.
- StartPos = self.CurrentOffsetWithinLine
- while not self.__EndOfLine():
- TempChar = self.__CurrentChar()
- # Try to find the end char that is not a space
- if not str(TempChar).isspace():
- self.__GetOneChar()
- else:
- break
- else:
- return False
-
- if StartPos != self.CurrentOffsetWithinLine:
- self.__Token = self.__CurrentLine()[StartPos : self.CurrentOffsetWithinLine]
- return True
- else:
- return False
- ## __GetNextGuid() method
- #
- # Get next token unit before a seperator
- # If found, the GUID string is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a registry format GUID, file buffer pointer moved forward
- # @retval False Not able to find a registry format GUID, file buffer pointer not changed
- #
- def __GetNextGuid(self):
-
- if not self.__GetNextToken():
- return False
- p = re.compile('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}')
- if p.match(self.__Token) != None:
- return True
- else:
- self.__UndoToken()
- return False
-
- ## __UndoToken() method
- #
- # Go back one token unit in file buffer
- #
- # @param self The object pointer
- #
- def __UndoToken(self):
- self.__UndoOneChar()
- while self.__CurrentChar().isspace():
- if not self.__UndoOneChar():
- self.__GetOneChar()
- return
-
-
- StartPos = self.CurrentOffsetWithinLine
- CurrentLine = self.CurrentLineNumber
- while CurrentLine == self.CurrentLineNumber:
-
- TempChar = self.__CurrentChar()
- # Try to find the end char that is not a space and not in seperator tuple.
- # That is, when we got a space or any char in the tuple, we got the end of token.
- if not str(TempChar).isspace() and not TempChar in SEPERATOR_TUPLE:
- if not self.__UndoOneChar():
- break
- # if we happen to meet a seperator as the first char, we must proceed to get it.
- # That is, we get a token that is a seperator char. nomally it is the boundary of other tokens.
- elif StartPos == self.CurrentOffsetWithinLine and TempChar in SEPERATOR_TUPLE:
- return
- else:
- break
-
- self.__GetOneChar()
-
- ## __HexDigit() method
- #
- # Whether char input is a Hex data bit
- #
- # @param self The object pointer
- # @param TempChar The char to test
- # @retval True The char is a Hex data bit
- # @retval False The char is NOT a Hex data bit
- #
- def __HexDigit(self, TempChar):
- if (TempChar >= 'a' and TempChar <= 'f') or (TempChar >= 'A' and TempChar <= 'F') \
- or (TempChar >= '0' and TempChar <= '9'):
- return True
- else:
- return False
-
- def __IsHex(self, HexStr):
- if not HexStr.upper().startswith("0X"):
- return False
- if len(self.__Token) <= 2:
- return False
- charList = [c for c in HexStr[2 : ] if not self.__HexDigit( c)]
- if len(charList) == 0:
- return True
- else:
- return False
- ## __GetNextHexNumber() method
- #
- # Get next HEX data before a seperator
- # If found, the HEX data is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a HEX data, file buffer pointer moved forward
- # @retval False Not able to find a HEX data, file buffer pointer not changed
- #
- def __GetNextHexNumber(self):
- if not self.__GetNextToken():
- return False
- if self.__IsHex(self.__Token):
- return True
- else:
- self.__UndoToken()
- return False
-
- ## __GetNextDecimalNumber() method
- #
- # Get next decimal data before a seperator
- # If found, the decimal data is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a decimal data, file buffer pointer moved forward
- # @retval False Not able to find a decimal data, file buffer pointer not changed
- #
- def __GetNextDecimalNumber(self):
- if not self.__GetNextToken():
- return False
- if self.__Token.isdigit():
- return True
- else:
- self.__UndoToken()
- return False
-
- ## __GetNextPcdName() method
- #
- # Get next PCD token space C name and PCD C name pair before a seperator
- # If found, the decimal data is put into self.__Token
- #
- # @param self The object pointer
- # @retval Tuple PCD C name and PCD token space C name pair
- #
- def __GetNextPcdName(self):
- if not self.__GetNextWord():
- raise Warning("expected PcdTokenSpaceCName.PcdCName At Line ", self.FileName, self.CurrentLineNumber)
- pcdTokenSpaceCName = self.__Token
-
- if not self.__IsToken( "."):
- raise Warning("expected PcdTokenSpaceCName.PcdCName At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextWord():
- raise Warning("expected PcdTokenSpaceCName.PcdCName At Line ", self.FileName, self.CurrentLineNumber)
- pcdCName = self.__Token
-
- return (pcdCName, pcdTokenSpaceCName)
-
- ## __GetStringData() method
- #
- # Get string contents quoted in ""
- # If found, the decimal data is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a string data, file buffer pointer moved forward
- # @retval False Not able to find a string data, file buffer pointer not changed
- #
- def __GetStringData(self):
- if self.__Token.startswith("\"") or self.__Token.startswith("L\""):
- self.__UndoToken()
- self.__SkipToToken("\"")
- currentLineNumber = self.CurrentLineNumber
-
- if not self.__SkipToToken("\""):
- raise Warning("Missing Quote \" for String At Line ", self.FileName, self.CurrentLineNumber)
- if currentLineNumber != self.CurrentLineNumber:
- raise Warning("Missing Quote \" for String At Line ", self.FileName, self.CurrentLineNumber)
- self.__Token = self.__SkippedChars.rstrip('\"')
- return True
-
- elif self.__Token.startswith("\'") or self.__Token.startswith("L\'"):
- self.__UndoToken()
- self.__SkipToToken("\'")
- currentLineNumber = self.CurrentLineNumber
-
- if not self.__SkipToToken("\'"):
- raise Warning("Missing Quote \' for String At Line ", self.FileName, self.CurrentLineNumber)
- if currentLineNumber != self.CurrentLineNumber:
- raise Warning("Missing Quote \' for String At Line ", self.FileName, self.CurrentLineNumber)
- self.__Token = self.__SkippedChars.rstrip('\'')
- return True
-
- else:
- return False
-
- ## __SkipToToken() method
- #
- # Search forward in file buffer for the string
- # The skipped chars are put into self.__SkippedChars
- #
- # @param self The object pointer
- # @param String The string to search
- # @param IgnoreCase Indicate case sensitive/non-sensitive search, default is case sensitive
- # @retval True Successfully find the string, file buffer pointer moved forward
- # @retval False Not able to find the string, file buffer pointer not changed
- #
- def __SkipToToken(self, String, IgnoreCase = False):
- StartPos = self.GetFileBufferPos()
-
- self.__SkippedChars = ""
- while not self.__EndOfFile():
- index = -1
- if IgnoreCase:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].upper().find(String.upper())
- else:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].find(String)
- if index == 0:
- self.CurrentOffsetWithinLine += len(String)
- self.__SkippedChars += String
- return True
- self.__SkippedChars += str(self.__CurrentChar())
- self.__GetOneChar()
-
- self.SetFileBufferPos( StartPos)
- self.__SkippedChars = ""
- return False
-
- ## GetFileBufferPos() method
- #
- # Return the tuple of current line and offset within the line
- #
- # @param self The object pointer
- # @retval Tuple Line number and offset pair
- #
- def GetFileBufferPos(self):
- return (self.CurrentLineNumber, self.CurrentOffsetWithinLine)
-
- ## SetFileBufferPos() method
- #
- # Restore the file buffer position
- #
- # @param self The object pointer
- # @param Pos The new file buffer position
- #
- def SetFileBufferPos(self, Pos):
- (self.CurrentLineNumber, self.CurrentOffsetWithinLine) = Pos
-
- ## ParseFile() method
- #
- # Parse the file profile buffer to extract fd, fv ... information
- # Exception will be raised if syntax error found
- #
- # @param self The object pointer
- #
- def ParseFile(self):
-
- try:
- self.__StringToList()
- self.PreprocessFile()
- self.PreprocessIncludeFile()
- self.__StringToList()
- self.PreprocessFile()
- self.PreprocessConditionalStatement()
- self.__StringToList()
- for Pos in self.__WipeOffArea:
- self.__ReplaceFragment(Pos[0], Pos[1])
- self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList]
-
- while self.__GetDefines():
- pass
-
- Index = 0
- while Index < len(self.Profile.FileLinesList):
- FileLineTuple = GetRealFileLine(self.FileName, Index + 1)
- self.Profile.FileLinesList[Index] = self.__ReplaceMacros(self.Profile.FileLinesList[Index], FileLineTuple[0], FileLineTuple[1])
- Index += 1
-
- while self.__GetFd():
- pass
-
- while self.__GetFv():
- pass
-
- while self.__GetCapsule():
- pass
-
-# while self.__GetVtf():
-# pass
-#
-# while self.__GetRule():
-# pass
-
-
- except Warning, X:
- self.__UndoToken()
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- X.message += '\nGot Token: \"%s\" from File %s\n' % (self.__Token, FileLineTuple[0]) + \
- 'Previous Token: \"%s\" At line: %d, Offset Within Line: %d\n' \
- % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :].rstrip('\n').rstrip('\r'), FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise
-
- ## __GetDefines() method
- #
- # Get Defines section contents and store its data into AllMacrosList
- #
- # @param self The object pointer
- # @retval True Successfully find a Defines
- # @retval False Not able to find a Defines
- #
- def __GetDefines(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[DEFINES"):
- if not S.startswith("[FD.") and not S.startswith("[FV.") and not S.startswith("[CAPSULE.") \
- and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [DEFINES], [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
-
- self.__UndoToken()
- if not self.__IsToken("[DEFINES", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- # % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("expected [DEFINES", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']'", self.FileName, self.CurrentLineNumber)
-
- while self.__GetNextWord():
- Macro = self.__Token
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken() or self.__Token.startswith('['):
- raise Warning("expected MACRO value", self.FileName, self.CurrentLineNumber)
- Value = self.__Token
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- MacProfile = MacroProfile(FileLineTuple[0], FileLineTuple[1])
- MacProfile.MacroName = Macro
- MacProfile.MacroValue = Value
- AllMacroList.append(MacProfile)
-
- return False
-
- ## __GetFd() method
- #
- # Get FD section contents and store its data into FD dictionary of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a FD
- # @retval False Not able to find a FD
- #
- def __GetFd(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[FD."):
- if not S.startswith("[FV.") and not S.startswith("[CAPSULE.") \
- and not S.startswith("[VTF.") and not S.startswith("[RULE."):
- raise Warning("Unknown section At Line ", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
-
- self.__UndoToken()
- if not self.__IsToken("[FD.", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("expected [FD.] At Line ", self.FileName, self.CurrentLineNumber)
-
- FdName = self.__GetUiName()
- self.CurrentFdName = FdName.upper()
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']' At Line ", self.FileName, self.CurrentLineNumber)
-
- FdObj = CommonDataClass.FdfClass.FDClassObject()
- FdObj.FdUiName = self.CurrentFdName
- self.Profile.FdDict[self.CurrentFdName] = FdObj
- Status = self.__GetCreateFile(FdObj)
- if not Status:
- raise Warning("FD name error At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetTokenStatements(FdObj):
- return False
-
- self.__GetDefineStatements(FdObj)
-
- self.__GetSetStatements(FdObj)
-
- if not self.__GetRegionLayout(FdObj):
- raise Warning("expected region layout At Line ", self.FileName, self.CurrentLineNumber)
-
- while self.__GetRegionLayout(FdObj):
- pass
- return True
-
- ## __GetUiName() method
- #
- # Return the UI name of a section
- #
- # @param self The object pointer
- # @retval FdName UI name
- #
- def __GetUiName(self):
- FdName = ""
- if self.__GetNextWord():
- FdName = self.__Token
-
- return FdName
-
- ## __GetCreateFile() method
- #
- # Return the output file name of object
- #
- # @param self The object pointer
- # @param Obj object whose data will be stored in file
- # @retval FdName UI name
- #
- def __GetCreateFile(self, Obj):
-
- if self.__IsKeyword( "CREATE_FILE"):
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected file name At Line ", self.FileName, self.CurrentLineNumber)
-
- FileName = self.__Token
- Obj.CreateFileName = FileName
-
- return True
-
- ## __GetTokenStatements() method
- #
- # Get token statements
- #
- # @param self The object pointer
- # @param Obj for whom token statement is got
- # @retval True Successfully find a token statement
- # @retval False Not able to find a token statement
- #
- def __GetTokenStatements(self, Obj):
- if not self.__IsKeyword( "BaseAddress"):
- raise Warning("BaseAddress missing At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex base address At Line ", self.FileName, self.CurrentLineNumber)
-
- Obj.BaseAddress = self.__Token
-
- if self.__IsToken( "|"):
- pcdPair = self.__GetNextPcdName()
- Obj.BaseAddressPcd = pcdPair
- self.Profile.PcdDict[pcdPair] = long(Obj.BaseAddress, 0)
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[pcdPair] = FileLineTuple
-
- if not self.__IsKeyword( "Size"):
- raise Warning("Size missing At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex size At Line ", self.FileName, self.CurrentLineNumber)
-
-
- Obj.Size = long(self.__Token, 0)
-
- if self.__IsToken( "|"):
- pcdPair = self.__GetNextPcdName()
- Obj.SizePcd = pcdPair
- self.Profile.PcdDict[pcdPair] = Obj.Size
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[pcdPair] = FileLineTuple
-
- if not self.__IsKeyword( "ErasePolarity"):
- raise Warning("ErasePolarity missing At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Erase Polarity At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__Token != "1" and self.__Token != "0":
- raise Warning("expected 1 or 0 Erase Polarity At Line ", self.FileName, self.CurrentLineNumber)
-
- Obj.ErasePolarity = self.__Token
-
- Status = self.__GetBlockStatements(Obj)
- return Status
-
- ## __GetAddressStatements() method
- #
- # Get address statements
- #
- # @param self The object pointer
- # @param Obj for whom address statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetAddressStatements(self, Obj):
-
- if self.__IsKeyword("BsBaseAddress"):
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextDecimalNumber() and not self.__GetNextHexNumber():
- raise Warning("expected address At Line ", self.FileName, self.CurrentLineNumber)
-
- BsAddress = long(self.__Token, 0)
- Obj.BsBaseAddress = BsAddress
-
- if self.__IsKeyword("RtBaseAddress"):
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextDecimalNumber() and not self.__GetNextHexNumber():
- raise Warning("expected address At Line ", self.FileName, self.CurrentLineNumber)
-
- RtAddress = long(self.__Token, 0)
- Obj.RtBaseAddress = RtAddress
-
- ## __GetBlockStatements() method
- #
- # Get block statements
- #
- # @param self The object pointer
- # @param Obj for whom block statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetBlockStatements(self, Obj):
-
- if not self.__GetBlockStatement(Obj):
- #set default block size is 1
- Obj.BlockSizeList.append((1, Obj.Size, None))
- return True
-
- while self.__GetBlockStatement(Obj):
- pass
-
- for Item in Obj.BlockSizeList:
- if Item[0] == None or Item[1] == None:
- raise Warning("expected block statement for Fd Section", self.FileName, self.CurrentLineNumber)
-
- return True
-
- ## __GetBlockStatement() method
- #
- # Get block statement
- #
- # @param self The object pointer
- # @param Obj for whom block statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetBlockStatement(self, Obj):
- if not self.__IsKeyword( "BlockSize"):
- return False
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber() and not self.__GetNextDecimalNumber():
- raise Warning("expected Hex block size At Line ", self.FileName, self.CurrentLineNumber)
-
- BlockSize = long(self.__Token, 0)
- BlockSizePcd = None
- if self.__IsToken( "|"):
- PcdPair = self.__GetNextPcdName()
- BlockSizePcd = PcdPair
- self.Profile.PcdDict[PcdPair] = BlockSize
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[pcdPair] = FileLineTuple
-
- BlockNumber = None
- if self.__IsKeyword( "NumBlocks"):
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextDecimalNumber() and not self.__GetNextHexNumber():
- raise Warning("expected block numbers At Line ", self.FileName, self.CurrentLineNumber)
-
- BlockNumber = long(self.__Token, 0)
-
- Obj.BlockSizeList.append((BlockSize, BlockNumber, BlockSizePcd))
- return True
-
- ## __GetDefineStatements() method
- #
- # Get define statements
- #
- # @param self The object pointer
- # @param Obj for whom define statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetDefineStatements(self, Obj):
- while self.__GetDefineStatement( Obj):
- pass
-
- ## __GetDefineStatement() method
- #
- # Get define statement
- #
- # @param self The object pointer
- # @param Obj for whom define statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetDefineStatement(self, Obj):
- if self.__IsKeyword("DEFINE"):
- self.__GetNextToken()
- Macro = self.__Token
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
-
- Value = self.__Token
- Macro = '$(' + Macro + ')'
- Obj.DefineVarDict[Macro] = Value
- return True
-
- return False
-
- ## __GetSetStatements() method
- #
- # Get set statements
- #
- # @param self The object pointer
- # @param Obj for whom set statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetSetStatements(self, Obj):
- while self.__GetSetStatement(Obj):
- pass
-
- ## __GetSetStatement() method
- #
- # Get set statement
- #
- # @param self The object pointer
- # @param Obj for whom set statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetSetStatement(self, Obj):
- if self.__IsKeyword("SET"):
- PcdPair = self.__GetNextPcdName()
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
-
- Value = self.__Token
- if Value.startswith("{"):
- # deal with value with {}
- if not self.__SkipToToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
- Value += self.__SkippedChars
-
- Obj.SetVarDict[PcdPair] = Value
- self.Profile.PcdDict[PcdPair] = Value
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[PcdPair] = FileLineTuple
- return True
-
- return False
-
- ## __GetRegionLayout() method
- #
- # Get region layout for FD
- #
- # @param self The object pointer
- # @param Fd for whom region is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetRegionLayout(self, Fd):
- if not self.__GetNextHexNumber():
- return False
-
- RegionObj = CommonDataClass.FdfClass.RegionClassObject()
- RegionObj.Offset = long(self.__Token, 0)
- Fd.RegionList.append(RegionObj)
-
- if not self.__IsToken( "|"):
- raise Warning("expected '|' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber():
- raise Warning("expected Region Size At Line ", self.FileName, self.CurrentLineNumber)
- RegionObj.Size = long(self.__Token, 0)
-
- if not self.__GetNextWord():
- return True
-
- if not self.__Token in ("SET", "FV", "FILE", "DATA", "CAPSULE"):
- self.__UndoToken()
- RegionObj.PcdOffset = self.__GetNextPcdName()
- self.Profile.PcdDict[RegionObj.PcdOffset] = RegionObj.Offset + long(Fd.BaseAddress, 0)
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[RegionObj.PcdOffset] = FileLineTuple
- if self.__IsToken( "|"):
- RegionObj.PcdSize = self.__GetNextPcdName()
- self.Profile.PcdDict[RegionObj.PcdSize] = RegionObj.Size
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[RegionObj.PcdSize] = FileLineTuple
-
- if not self.__GetNextWord():
- return True
-
- if self.__Token == "SET":
- self.__UndoToken()
- self.__GetSetStatements( RegionObj)
- if not self.__GetNextWord():
- return True
-
- elif self.__Token == "FV":
- self.__UndoToken()
- self.__GetRegionFvType( RegionObj)
-
- elif self.__Token == "CAPSULE":
- self.__UndoToken()
- self.__GetRegionCapType( RegionObj)
-
- elif self.__Token == "FILE":
- self.__UndoToken()
- self.__GetRegionFileType( RegionObj)
-
- else:
- self.__UndoToken()
- self.__GetRegionDataType( RegionObj)
-
- return True
-
- ## __GetRegionFvType() method
- #
- # Get region fv data for region
- #
- # @param self The object pointer
- # @param RegionObj for whom region data is got
- #
- def __GetRegionFvType(self, RegionObj):
-
- if not self.__IsKeyword( "FV"):
- raise Warning("expected Keyword 'FV' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FV name At Line ", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionType = "FV"
- RegionObj.RegionDataList.append(self.__Token)
-
- while self.__IsKeyword( "FV"):
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FV name At Line ", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionDataList.append(self.__Token)
-
- ## __GetRegionCapType() method
- #
- # Get region capsule data for region
- #
- # @param self The object pointer
- # @param RegionObj for whom region data is got
- #
- def __GetRegionCapType(self, RegionObj):
-
- if not self.__IsKeyword("CAPSULE"):
- raise Warning("expected Keyword 'CAPSULE' at line", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' at line", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected CAPSULE name at line", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionType = "CAPSULE"
- RegionObj.RegionDataList.append(self.__Token)
-
- while self.__IsKeyword("CAPSULE"):
-
- if not self.__IsToken("="):
- raise Warning("expected '=' at line", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected CAPSULE name at line", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionDataList.append(self.__Token)
-
- ## __GetRegionFileType() method
- #
- # Get region file data for region
- #
- # @param self The object pointer
- # @param RegionObj for whom region data is got
- #
- def __GetRegionFileType(self, RegionObj):
-
- if not self.__IsKeyword( "FILE"):
- raise Warning("expected Keyword 'FILE' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected File name At Line ", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionType = "FILE"
- RegionObj.RegionDataList.append( self.__Token)
-
- while self.__IsKeyword( "FILE"):
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FILE name At Line ", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionDataList.append(self.__Token)
-
- ## __GetRegionDataType() method
- #
- # Get region array data for region
- #
- # @param self The object pointer
- # @param RegionObj for whom region data is got
- #
- def __GetRegionDataType(self, RegionObj):
-
- if not self.__IsKeyword( "DATA"):
- raise Warning("expected Region Data type At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "{"):
- raise Warning("expected '{' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex byte At Line ", self.FileName, self.CurrentLineNumber)
-
- if len(self.__Token) > 18:
- raise Warning("Hex string can't be converted to a valid UINT64 value", self.FileName, self.CurrentLineNumber)
-
- DataString = self.__Token
- DataString += ","
-
- while self.__IsToken(","):
- if not self.__GetNextHexNumber():
- raise Warning("Invalid Hex number At Line ", self.FileName, self.CurrentLineNumber)
- if len(self.__Token) > 4:
- raise Warning("Hex byte(must be 2 digits) too long At Line ", self.FileName, self.CurrentLineNumber)
- DataString += self.__Token
- DataString += ","
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
-
- DataString = DataString.rstrip(",")
- RegionObj.RegionType = "DATA"
- RegionObj.RegionDataList.append( DataString)
-
- while self.__IsKeyword( "DATA"):
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "{"):
- raise Warning("expected '{' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex byte At Line ", self.FileName, self.CurrentLineNumber)
-
- if len(self.__Token) > 18:
- raise Warning("Hex string can't be converted to a valid UINT64 value", self.FileName, self.CurrentLineNumber)
-
- DataString = self.__Token
- DataString += ","
-
- while self.__IsToken(","):
- self.__GetNextHexNumber()
- if len(self.__Token) > 4:
- raise Warning("Hex byte(must be 2 digits) too long At Line ", self.FileName, self.CurrentLineNumber)
- DataString += self.__Token
- DataString += ","
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
-
- DataString = DataString.rstrip(",")
- RegionObj.RegionDataList.append( DataString)
-
- ## __GetFv() method
- #
- # Get FV section contents and store its data into FV dictionary of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a FV
- # @retval False Not able to find a FV
- #
- def __GetFv(self):
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[FV."):
- if not S.startswith("[CAPSULE.") \
- and not S.startswith("[VTF.") and not S.startswith("[RULE."):
- raise Warning("Unknown section or section appear sequence error \n(The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.]) At Line ", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
-
- self.__UndoToken()
- if not self.__IsToken("[FV.", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("Unknown Keyword At Line ", self.FileName, self.CurrentLineNumber)
-
- FvName = self.__GetUiName()
- self.CurrentFvName = FvName.upper()
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']' At Line ", self.FileName, self.CurrentLineNumber)
-
- FvObj = CommonDataClass.FdfClass.FvClassObject()
- FvObj.UiFvName = self.CurrentFvName
- self.Profile.FvDict[self.CurrentFvName] = FvObj
-
- Status = self.__GetCreateFile(FvObj)
- if not Status:
- raise Warning("FV name error At Line ", self.FileName, self.CurrentLineNumber)
-
- self.__GetDefineStatements(FvObj)
-
- self.__GetAddressStatements(FvObj)
-
- self.__GetBlockStatement(FvObj)
-
- self.__GetSetStatements(FvObj)
-
- self.__GetFvAlignment(FvObj)
-
- self.__GetFvAttributes(FvObj)
-
- self.__GetFvNameGuid(FvObj)
-
- self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy())
- self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy())
-
- while True:
- isInf = self.__GetInfStatement(FvObj, MacroDict = FvObj.DefineVarDict.copy())
- isFile = self.__GetFileStatement(FvObj, MacroDict = FvObj.DefineVarDict.copy())
- if not isInf and not isFile:
- break
-
- return True
-
- ## __GetFvAlignment() method
- #
- # Get alignment for FV
- #
- # @param self The object pointer
- # @param Obj for whom alignment is got
- # @retval True Successfully find a alignment statement
- # @retval False Not able to find a alignment statement
- #
- def __GetFvAlignment(self, Obj):
-
- if not self.__IsKeyword( "FvAlignment"):
- return False
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected alignment value At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__Token.upper() not in ("1", "2", "4", "8", "16", "32", "64", "128", "256", "512", \
- "1K", "2K", "4K", "8K", "16K", "32K", "64K", "128K", "256K", "512K", \
- "1M", "2M", "4M", "8M", "16M", "32M", "64M", "128M", "256M", "512M", \
- "1G", "2G"):
- raise Warning("Unknown alignment value At Line ", self.FileName, self.CurrentLineNumber)
- Obj.FvAlignment = self.__Token
- return True
-
- ## __GetFvAttributes() method
- #
- # Get attributes for FV
- #
- # @param self The object pointer
- # @param Obj for whom attribute is got
- # @retval None
- #
- def __GetFvAttributes(self, FvObj):
-
- while self.__GetNextWord():
- name = self.__Token
- if name not in ("ERASE_POLARITY", "MEMORY_MAPPED", \
- "STICKY_WRITE", "LOCK_CAP", "LOCK_STATUS", "WRITE_ENABLED_CAP", \
- "WRITE_DISABLED_CAP", "WRITE_STATUS", "READ_ENABLED_CAP", \
- "READ_DISABLED_CAP", "READ_STATUS", "READ_LOCK_CAP", \
- "READ_LOCK_STATUS", "WRITE_LOCK_CAP", "WRITE_LOCK_STATUS", \
- "WRITE_POLICY_RELIABLE"):
- self.__UndoToken()
- return
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken() or self.__Token.upper() not in ("TRUE", "FALSE", "1", "0"):
- raise Warning("expected TRUE/FALSE (1/0) At Line ", self.FileName, self.CurrentLineNumber)
-
- FvObj.FvAttributeDict[name] = self.__Token
-
- return
-
- ## __GetFvNameGuid() method
- #
- # Get FV GUID for FV
- #
- # @param self The object pointer
- # @param Obj for whom GUID is got
- # @retval None
- #
- def __GetFvNameGuid(self, FvObj):
-
- if not self.__IsKeyword( "FvNameGuid"):
- return
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextGuid():
- raise Warning("expected FV GUID value", self.FileName, self.CurrentLineNumber)
-
- FvObj.FvNameGuid = self.__Token
-
- return
-
- ## __GetAprioriSection() method
- #
- # Get token statements
- #
- # @param self The object pointer
- # @param FvObj for whom apriori is got
- # @param MacroDict dictionary used to replace macro
- # @retval True Successfully find apriori statement
- # @retval False Not able to find apriori statement
- #
- def __GetAprioriSection(self, FvObj, MacroDict = {}):
-
- if not self.__IsKeyword( "APRIORI"):
- return False
-
- if not self.__IsKeyword("PEI") and not self.__IsKeyword("DXE"):
- raise Warning("expected Apriori file type At Line ", self.FileName, self.CurrentLineNumber)
- AprType = self.__Token
-
- if not self.__IsToken( "{"):
- raise Warning("expected '{' At Line ", self.FileName, self.CurrentLineNumber)
-
- AprSectionObj = CommonDataClass.FdfClass.AprioriSectionClassObject()
- AprSectionObj.AprioriType = AprType
-
- self.__GetDefineStatements(AprSectionObj)
- MacroDict.update(AprSectionObj.DefineVarDict)
-
- while True:
- IsInf = self.__GetInfStatement( AprSectionObj, MacroDict = MacroDict)
- IsFile = self.__GetFileStatement( AprSectionObj)
- if not IsInf and not IsFile:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
-
- FvObj.AprioriSectionList.append(AprSectionObj)
- return True
-
- ## __GetInfStatement() method
- #
- # Get INF statements
- #
- # @param self The object pointer
- # @param Obj for whom inf statement is got
- # @param MacroDict dictionary used to replace macro
- # @retval True Successfully find inf statement
- # @retval False Not able to find inf statement
- #
- def __GetInfStatement(self, Obj, ForCapsule = False, MacroDict = {}):
-
- if not self.__IsKeyword( "INF"):
- return False
-
- ffsInf = CommonDataClass.FdfClass.FfsInfStatementClassObject()
- self.__GetInfOptions( ffsInf)
-
- if not self.__GetNextToken():
- raise Warning("expected INF file path At Line ", self.FileName, self.CurrentLineNumber)
- ffsInf.InfFileName = self.__Token
-
-# if ffsInf.InfFileName.find('$') >= 0:
-# ffsInf.InfFileName = GenFdsGlobalVariable.GenFdsGlobalVariable.MacroExtend(ffsInf.InfFileName, MacroDict)
-
- if not ffsInf.InfFileName in self.Profile.InfList:
- self.Profile.InfList.append(ffsInf.InfFileName)
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.InfFileLineList.append(FileLineTuple)
-
- if self.__IsToken('|'):
- if self.__IsKeyword('RELOCS_STRIPPED'):
- ffsInf.KeepReloc = False
- elif self.__IsKeyword('RELOCS_RETAINED'):
- ffsInf.KeepReloc = True
- else:
- raise Warning("Unknown reloc strip flag At Line ", self.FileName, self.CurrentLineNumber)
-
- if ForCapsule:
- capsuleFfs = CapsuleData.CapsuleFfs()
- capsuleFfs.Ffs = ffsInf
- Obj.CapsuleDataList.append(capsuleFfs)
- else:
- Obj.FfsList.append(ffsInf)
- return True
-
- ## __GetInfOptions() method
- #
- # Get options for INF
- #
- # @param self The object pointer
- # @param FfsInfObj for whom option is got
- #
- def __GetInfOptions(self, FfsInfObj):
-
- if self.__IsKeyword( "RuleOverride"):
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected Rule name At Line ", self.FileName, self.CurrentLineNumber)
- FfsInfObj.Rule = self.__Token
-
- if self.__IsKeyword( "VERSION"):
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected Version At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__GetStringData():
- FfsInfObj.Version = self.__Token
-
- if self.__IsKeyword( "UI"):
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected UI name At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__GetStringData():
- FfsInfObj.Ui = self.__Token
-
- if self.__IsKeyword( "USE"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected ARCH name", self.FileName, self.CurrentLineNumber)
- FfsInfObj.UseArch = self.__Token
-
-
- if self.__GetNextToken():
- p = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
- if p.match(self.__Token):
- FfsInfObj.KeyStringList.append(self.__Token)
- if not self.__IsToken(","):
- return
- else:
- self.__UndoToken()
- return
-
- while self.__GetNextToken():
- if not p.match(self.__Token):
- raise Warning("expected KeyString \"Target_Tag_Arch\" At Line ", self.FileName, self.CurrentLineNumber)
- FfsInfObj.KeyStringList.append(self.__Token)
-
- if not self.__IsToken(","):
- break
-
- ## __GetFileStatement() method
- #
- # Get FILE statements
- #
- # @param self The object pointer
- # @param Obj for whom FILE statement is got
- # @param MacroDict dictionary used to replace macro
- # @retval True Successfully find FILE statement
- # @retval False Not able to find FILE statement
- #
- def __GetFileStatement(self, Obj, ForCapsule = False, MacroDict = {}):
-
- if not self.__IsKeyword( "FILE"):
- return False
-
- FfsFileObj = CommonDataClass.FdfClass.FileStatementClassObject()
-
- if not self.__GetNextWord():
- raise Warning("expected FFS type At Line ", self.FileName, self.CurrentLineNumber)
- FfsFileObj.FvFileType = self.__Token
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextGuid():
- if not self.__GetNextWord():
- raise Warning("expected File GUID", self.FileName, self.CurrentLineNumber)
- if self.__Token == 'PCD':
- if not self.__IsToken( "("):
- raise Warning("expected '('", self.FileName, self.CurrentLineNumber)
- PcdPair = self.__GetNextPcdName()
- if not self.__IsToken( ")"):
- raise Warning("expected ')'", self.FileName, self.CurrentLineNumber)
- self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'
-
- FfsFileObj.NameGuid = self.__Token
-
- self.__GetFilePart( FfsFileObj, MacroDict.copy())
-
- if ForCapsule:
- capsuleFfs = CapsuleData.CapsuleFfs()
- capsuleFfs.Ffs = FfsFileObj
- Obj.CapsuleDataList.append(capsuleFfs)
- else:
- Obj.FfsList.append(FfsFileObj)
-
- return True
-
- ## __FileCouldHaveRelocFlag() method
- #
- # Check whether reloc strip flag can be set for a file type.
- #
- # @param self The object pointer
- # @param FileType The file type to check with
- # @retval True This type could have relocation strip flag
- # @retval False No way to have it
- #
-
- def __FileCouldHaveRelocFlag (self, FileType):
- if FileType in ('SEC', 'PEI_CORE', 'PEIM', 'PEI_DXE_COMBO'):
- return True
- else:
- return False
-
- ## __SectionCouldHaveRelocFlag() method
- #
- # Check whether reloc strip flag can be set for a section type.
- #
- # @param self The object pointer
- # @param SectionType The section type to check with
- # @retval True This type could have relocation strip flag
- # @retval False No way to have it
- #
-
- def __SectionCouldHaveRelocFlag (self, SectionType):
- if SectionType in ('TE', 'PE32'):
- return True
- else:
- return False
-
- ## __GetFilePart() method
- #
- # Get components for FILE statement
- #
- # @param self The object pointer
- # @param FfsFileObj for whom component is got
- # @param MacroDict dictionary used to replace macro
- #
- def __GetFilePart(self, FfsFileObj, MacroDict = {}):
-
- self.__GetFileOpts( FfsFileObj)
-
- if not self.__IsToken("{"):
-# if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
-# if self.__FileCouldHaveRelocFlag(FfsFileObj.FvFileType):
-# if self.__Token == 'RELOCS_STRIPPED':
-# FfsFileObj.KeepReloc = False
-# else:
-# FfsFileObj.KeepReloc = True
-# else:
-# raise Warning("File type %s could not have reloc strip flag At Line %d" % (FfsFileObj.FvFileType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-#
-# if not self.__IsToken("{"):
- raise Warning("expected '{' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected File name or section data At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__Token == "FV":
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected FV name At Line ", self.FileName, self.CurrentLineNumber)
- FfsFileObj.FvName = self.__Token
-
- elif self.__Token == "FD":
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected FD name At Line ", self.FileName, self.CurrentLineNumber)
- FfsFileObj.FdName = self.__Token
-
- elif self.__Token in ("DEFINE", "APRIORI", "SECTION"):
- self.__UndoToken()
- self.__GetSectionData( FfsFileObj, MacroDict)
- else:
- FfsFileObj.FileName = self.__Token
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
-
- ## __GetFileOpts() method
- #
- # Get options for FILE statement
- #
- # @param self The object pointer
- # @param FfsFileObj for whom options is got
- #
- def __GetFileOpts(self, FfsFileObj):
-
- if self.__GetNextToken():
- Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
- if Pattern.match(self.__Token):
- FfsFileObj.KeyStringList.append(self.__Token)
- if self.__IsToken(","):
- while self.__GetNextToken():
- if not Pattern.match(self.__Token):
- raise Warning("expected KeyString \"Target_Tag_Arch\" At Line ", self.FileName, self.CurrentLineNumber)
- FfsFileObj.KeyStringList.append(self.__Token)
-
- if not self.__IsToken(","):
- break
-
- else:
- self.__UndoToken()
-
- if self.__IsKeyword( "FIXED", True):
- FfsFileObj.Fixed = True
-
- if self.__IsKeyword( "CHECKSUM", True):
- FfsFileObj.CheckSum = True
-
- if self.__GetAlignment():
- FfsFileObj.Alignment = self.__Token
-
-
-
- ## __GetAlignment() method
- #
- # Return the alignment value
- #
- # @param self The object pointer
- # @retval True Successfully find alignment
- # @retval False Not able to find alignment
- #
- def __GetAlignment(self):
- if self.__IsKeyword( "Align", True):
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected alignment value At Line ", self.FileName, self.CurrentLineNumber)
- return True
-
- return False
-
- ## __GetFilePart() method
- #
- # Get section data for FILE statement
- #
- # @param self The object pointer
- # @param FfsFileObj for whom section is got
- # @param MacroDict dictionary used to replace macro
- #
- def __GetSectionData(self, FfsFileObj, MacroDict = {}):
- Dict = {}
- Dict.update(MacroDict)
-
- self.__GetDefineStatements(FfsFileObj)
-
- Dict.update(FfsFileObj.DefineVarDict)
- self.__GetAprioriSection(FfsFileObj, Dict.copy())
- self.__GetAprioriSection(FfsFileObj, Dict.copy())
-
- while True:
- IsLeafSection = self.__GetLeafSection(FfsFileObj, Dict)
- IsEncapSection = self.__GetEncapsulationSec(FfsFileObj)
- if not IsLeafSection and not IsEncapSection:
- break
-
- ## __GetLeafSection() method
- #
- # Get leaf section for Obj
- #
- # @param self The object pointer
- # @param Obj for whom leaf section is got
- # @param MacroDict dictionary used to replace macro
- # @retval True Successfully find section statement
- # @retval False Not able to find section statement
- #
- def __GetLeafSection(self, Obj, MacroDict = {}):
-
- OldPos = self.GetFileBufferPos()
-
- if not self.__IsKeyword( "SECTION"):
- if len(Obj.SectionList) == 0:
- raise Warning("expected SECTION At Line ", self.FileName, self.CurrentLineNumber)
- else:
- return False
-
- AlignValue = None
- if self.__GetAlignment():
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- AlignValue = self.__Token
-
- BuildNum = None
- if self.__IsKeyword( "BUILD_NUM"):
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Build number value At Line ", self.FileName, self.CurrentLineNumber)
-
- BuildNum = self.__Token
-
- if self.__IsKeyword( "VERSION"):
- if AlignValue == 'Auto':
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected version At Line ", self.FileName, self.CurrentLineNumber)
- VerSectionObj = CommonDataClass.FdfClass.VerSectionClassObject()
- VerSectionObj.Alignment = AlignValue
- VerSectionObj.BuildNum = BuildNum
- if self.__GetStringData():
- VerSectionObj.StringData = self.__Token
- else:
- VerSectionObj.FileName = self.__Token
- Obj.SectionList.append(VerSectionObj)
-
- elif self.__IsKeyword( "UI"):
- if AlignValue == 'Auto':
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected UI At Line ", self.FileName, self.CurrentLineNumber)
- UiSectionObj = CommonDataClass.FdfClass.UiSectionClassObject()
- UiSectionObj.Alignment = AlignValue
- if self.__GetStringData():
- UiSectionObj.StringData = self.__Token
- else:
- UiSectionObj.FileName = self.__Token
- Obj.SectionList.append(UiSectionObj)
-
- elif self.__IsKeyword( "FV_IMAGE"):
- if AlignValue == 'Auto':
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextWord():
- raise Warning("expected FV name At Line ", self.FileName, self.CurrentLineNumber)
-
- FvName = self.__Token.upper()
- FvObj = None
-
- if self.__IsToken( "{"):
- FvObj = Fv.FV()
- FvObj.UiFvName = FvName
- self.__GetDefineStatements(FvObj)
- MacroDict.update(FvObj.DefineVarDict)
- self.__GetBlockStatement(FvObj)
- self.__GetSetStatements(FvObj)
- self.__GetFvAlignment(FvObj)
- self.__GetFvAttributes(FvObj)
- self.__GetAprioriSection(FvObj, MacroDict.copy())
- self.__GetAprioriSection(FvObj, MacroDict.copy())
-
- while True:
- IsInf = self.__GetInfStatement(FvObj, MacroDict.copy())
- IsFile = self.__GetFileStatement(FvObj, MacroDict.copy())
- if not IsInf and not IsFile:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
-
- FvImageSectionObj = CommonDataClass.FdfClass.FvImageSectionClassObject()
- FvImageSectionObj.Alignment = AlignValue
- if FvObj != None:
- FvImageSectionObj.Fv = FvObj
- FvImageSectionObj.FvName = None
- else:
- FvImageSectionObj.FvName = FvName
-
- Obj.SectionList.append(FvImageSectionObj)
-
- elif self.__IsKeyword("PEI_DEPEX_EXP") or self.__IsKeyword("DXE_DEPEX_EXP") or self.__IsKeyword("SMM_DEPEX_EXP"):
- if AlignValue == 'Auto':
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- DepexSectionObj = CommonDataClass.FdfClass.DepexSectionClassObject()
- DepexSectionObj.Alignment = AlignValue
- DepexSectionObj.DepexType = self.__Token
-
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__IsToken( "{"):
- raise Warning("expected '{' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__SkipToToken( "}"):
- raise Warning("expected Depex expression ending '}' At Line ", self.FileName, self.CurrentLineNumber)
-
- DepexSectionObj.Expression = self.__SkippedChars.rstrip('}')
- Obj.SectionList.append(DepexSectionObj)
-
- else:
-
- if not self.__GetNextWord():
- raise Warning("expected section type At Line ", self.FileName, self.CurrentLineNumber)
-
- # Encapsulation section appear, UndoToken and return
- if self.__Token == "COMPRESS" or self.__Token == "GUIDED":
- self.SetFileBufferPos(OldPos)
- return False
-
- if self.__Token not in ("COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
- "UI", "VERSION", "PEI_DEPEX", "SUBTYPE_GUID", "SMM_DEPEX"):
- raise Warning("Unknown section type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- if AlignValue == 'Auto'and (not self.__Token == 'PE32') and (not self.__Token == 'TE'):
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- # DataSection
- DataSectionObj = CommonDataClass.FdfClass.DataSectionClassObject()
- DataSectionObj.Alignment = AlignValue
- DataSectionObj.SecType = self.__Token
-
- if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
- if self.__FileCouldHaveRelocFlag(Obj.FvFileType) and self.__SectionCouldHaveRelocFlag(DataSectionObj.SecType):
- if self.__Token == 'RELOCS_STRIPPED':
- DataSectionObj.KeepReloc = False
- else:
- DataSectionObj.KeepReloc = True
- else:
- raise Warning("File type %s, section type %s, could not have reloc strip flag At Line %d" % (Obj.FvFileType, DataSectionObj.SecType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- if self.__IsToken("="):
- if not self.__GetNextToken():
- raise Warning("expected section file path At Line ", self.FileName, self.CurrentLineNumber)
- DataSectionObj.SectFileName = self.__Token
- else:
- if not self.__GetCglSection(DataSectionObj):
- return False
-
- Obj.SectionList.append(DataSectionObj)
-
- return True
-
- ## __GetCglSection() method
- #
- # Get compressed or GUIDed section for Obj
- #
- # @param self The object pointer
- # @param Obj for whom leaf section is got
- # @param AlignValue alignment value for complex section
- # @retval True Successfully find section statement
- # @retval False Not able to find section statement
- #
- def __GetCglSection(self, Obj, AlignValue = None):
-
- if self.__IsKeyword( "COMPRESS"):
- type = "PI_STD"
- if self.__IsKeyword("PI_STD") or self.__IsKeyword("PI_NONE"):
- type = self.__Token
-
- if not self.__IsToken("{"):
- raise Warning("expected '{' At Line ", self.FileName, self.CurrentLineNumber)
-
- CompressSectionObj = CommonDataClass.FdfClass.CompressSectionClassObject()
- CompressSectionObj.Alignment = AlignValue
- CompressSectionObj.CompType = type
- # Recursive sections...
- while True:
- IsLeafSection = self.__GetLeafSection(CompressSectionObj)
- IsEncapSection = self.__GetEncapsulationSec(CompressSectionObj)
- if not IsLeafSection and not IsEncapSection:
- break
-
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
- Obj.SectionList.append(CompressSectionObj)
-
-# else:
-# raise Warning("Compress type not known At Line ")
-
- return True
-
- elif self.__IsKeyword( "GUIDED"):
- GuidValue = None
- if self.__GetNextGuid():
- GuidValue = self.__Token
-
- AttribDict = self.__GetGuidAttrib()
- if not self.__IsToken("{"):
- raise Warning("expected '{' At Line ", self.FileName, self.CurrentLineNumber)
- GuidSectionObj = CommonDataClass.FdfClass.GuidSectionClassObject()
- GuidSectionObj.Alignment = AlignValue
- GuidSectionObj.NameGuid = GuidValue
- GuidSectionObj.SectionType = "GUIDED"
- GuidSectionObj.ProcessRequired = AttribDict["PROCESSING_REQUIRED"]
- GuidSectionObj.AuthStatusValid = AttribDict["AUTH_STATUS_VALID"]
- # Recursive sections...
- while True:
- IsLeafSection = self.__GetLeafSection(GuidSectionObj)
- IsEncapSection = self.__GetEncapsulationSec(GuidSectionObj)
- if not IsLeafSection and not IsEncapSection:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
- Obj.SectionList.append(GuidSectionObj)
-
- return True
-
- return False
-
- ## __GetGuidAttri() method
- #
- # Get attributes for GUID section
- #
- # @param self The object pointer
- # @retval AttribDict Dictionary of key-value pair of section attributes
- #
- def __GetGuidAttrib(self):
-
- AttribDict = {}
- AttribDict["PROCESSING_REQUIRED"] = False
- AttribDict["AUTH_STATUS_VALID"] = False
- if self.__IsKeyword("PROCESSING_REQUIRED") or self.__IsKeyword("AUTH_STATUS_VALID"):
- AttribKey = self.__Token
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken() or self.__Token.upper() not in ("TRUE", "FALSE", "1", "0"):
- raise Warning("expected TRUE/FALSE (1/0) At Line ", self.FileName, self.CurrentLineNumber)
- AttribDict[AttribKey] = self.__Token
-
- if self.__IsKeyword("PROCESSING_REQUIRED") or self.__IsKeyword("AUTH_STATUS_VALID"):
- AttribKey = self.__Token
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ")
-
- if not self.__GetNextToken() or self.__Token.upper() not in ("TRUE", "FALSE", "1", "0"):
- raise Warning("expected TRUE/FALSE (1/0) At Line ", self.FileName, self.CurrentLineNumber)
- AttribDict[AttribKey] = self.__Token
-
- return AttribDict
-
- ## __GetEncapsulationSec() method
- #
- # Get encapsulation section for FILE
- #
- # @param self The object pointer
- # @param FfsFile for whom section is got
- # @retval True Successfully find section statement
- # @retval False Not able to find section statement
- #
- def __GetEncapsulationSec(self, FfsFileObj):
-
- OldPos = self.GetFileBufferPos()
- if not self.__IsKeyword( "SECTION"):
- if len(FfsFileObj.SectionList) == 0:
- raise Warning("expected SECTION At Line ", self.FileName, self.CurrentLineNumber)
- else:
- return False
-
- AlignValue = None
- if self.__GetAlignment():
- if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- AlignValue = self.__Token
-
- if not self.__GetCglSection(FfsFileObj, AlignValue):
- self.SetFileBufferPos(OldPos)
- return False
- else:
- return True
-
- ## __GetCapsule() method
- #
- # Get capsule section contents and store its data into capsule list of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a capsule
- # @retval False Not able to find a capsule
- #
- def __GetCapsule(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[CAPSULE."):
- if not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
-
- self.__UndoToken()
- if not self.__IsToken("[CAPSULE.", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("expected [Capsule.] At Line ", self.FileName, self.CurrentLineNumber)
-
- CapsuleObj = CommonDataClass.FdfClass.CapsuleClassObject()
-
- CapsuleName = self.__GetUiName()
- if not CapsuleName:
- raise Warning("expected capsule name At line ", self.FileName, self.CurrentLineNumber)
-
- CapsuleObj.UiCapsuleName = CapsuleName.upper()
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']' At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__IsKeyword("CREATE_FILE"):
- if not self.__IsToken( "="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected file name At Line ", self.FileName, self.CurrentLineNumber)
-
- CapsuleObj.CreateFile = self.__Token
-
- self.__GetCapsuleStatements(CapsuleObj)
- self.Profile.CapsuleList.append(CapsuleObj)
- return True
-
- ## __GetCapsuleStatements() method
- #
- # Get statements for capsule
- #
- # @param self The object pointer
- # @param Obj for whom statements are got
- #
- def __GetCapsuleStatements(self, Obj):
- self.__GetCapsuleTokens(Obj)
- self.__GetDefineStatements(Obj)
- self.__GetSetStatements(Obj)
-
- self.__GetCapsuleData(Obj)
-
- ## __GetCapsuleStatements() method
- #
- # Get token statements for capsule
- #
- # @param self The object pointer
- # @param Obj for whom token statements are got
- #
- def __GetCapsuleTokens(self, Obj):
-
- if not self.__IsKeyword("CAPSULE_GUID"):
- raise Warning("expected 'CAPSULE_GUID' At Line ", self.FileName, self.CurrentLineNumber)
-
- while self.__CurrentLine().find("=") != -1:
- NameValue = self.__CurrentLine().split("=")
- Obj.TokensDict[NameValue[0].strip()] = NameValue[1].strip()
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
-
- ## __GetCapsuleData() method
- #
- # Get capsule data for capsule
- #
- # @param self The object pointer
- # @param Obj for whom capsule data are got
- #
- def __GetCapsuleData(self, Obj):
-
- while True:
- IsInf = self.__GetInfStatement(Obj, True)
- IsFile = self.__GetFileStatement(Obj, True)
- IsFv = self.__GetFvStatement(Obj)
- if not IsInf and not IsFile and not IsFv:
- break
-
- ## __GetFvStatement() method
- #
- # Get FV for capsule
- #
- # @param self The object pointer
- # @param CapsuleObj for whom FV is got
- # @retval True Successfully find a FV statement
- # @retval False Not able to find a FV statement
- #
- def __GetFvStatement(self, CapsuleObj):
-
- if not self.__IsKeyword("FV"):
- return False
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FV name At Line ", self.FileName, self.CurrentLineNumber)
-
-# CapsuleFv = CapsuleData.CapsuleFv()
-# CapsuleFv.FvName = self.__Token
-# CapsuleObj.CapsuleDataList.append(CapsuleFv)
- return True
-
- ## __GetRule() method
- #
- # Get Rule section contents and store its data into rule list of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a Rule
- # @retval False Not able to find a Rule
- #
- def __GetRule(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[RULE."):
- if not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
- self.__UndoToken()
- if not self.__IsToken("[Rule.", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("expected [Rule.] At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__SkipToToken("."):
- raise Warning("expected '.' At Line ", self.FileName, self.CurrentLineNumber)
-
- Arch = self.__SkippedChars.rstrip(".")
- if Arch.upper() not in ("IA32", "X64", "IPF", "EBC", "ARM", "AARCH64", "COMMON"):
- raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)
-
- ModuleType = self.__GetModuleType()
-
- TemplateName = ""
- if self.__IsToken("."):
- if not self.__GetNextWord():
- raise Warning("expected template name At Line ", self.FileName, self.CurrentLineNumber)
- TemplateName = self.__Token
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']' At Line ", self.FileName, self.CurrentLineNumber)
-
- RuleObj = self.__GetRuleFileStatements()
- RuleObj.Arch = Arch.upper()
- RuleObj.ModuleType = ModuleType
- RuleObj.TemplateName = TemplateName
- if TemplateName == '' :
- self.Profile.RuleDict['RULE' + \
- '.' + \
- Arch.upper() + \
- '.' + \
- ModuleType.upper() ] = RuleObj
- else :
- self.Profile.RuleDict['RULE' + \
- '.' + \
- Arch.upper() + \
- '.' + \
- ModuleType.upper() + \
- '.' + \
- TemplateName.upper() ] = RuleObj
-# self.Profile.RuleList.append(rule)
- return True
-
- ## __GetModuleType() method
- #
- # Return the module type
- #
- # @param self The object pointer
- # @retval string module type
- #
- def __GetModuleType(self):
-
- if not self.__GetNextWord():
- raise Warning("expected Module type At Line ", self.FileName, self.CurrentLineNumber)
- if self.__Token.upper() not in ("SEC", "PEI_CORE", "PEIM", "DXE_CORE", \
- "DXE_DRIVER", "DXE_SAL_DRIVER", \
- "DXE_SMM_DRIVER", "DXE_RUNTIME_DRIVER", \
- "UEFI_DRIVER", "UEFI_APPLICATION", "USER_DEFINED", "DEFAULT", "BASE", \
- "SECURITY_CORE", "COMBINED_PEIM_DRIVER", "PIC_PEIM", "RELOCATABLE_PEIM", \
- "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", "SMM_CORE"):
- raise Warning("Unknown Module type At line ", self.FileName, self.CurrentLineNumber)
- return self.__Token
-
- ## __GetFileExtension() method
- #
- # Return the file extension
- #
- # @param self The object pointer
- # @retval string file name extension
- #
- def __GetFileExtension(self):
- if not self.__IsToken("."):
- raise Warning("expected '.' At Line ", self.FileName, self.CurrentLineNumber)
-
- Ext = ""
- if self.__GetNextToken():
- Pattern = re.compile(r'([a-zA-Z][a-zA-Z0-9]*)')
- if Pattern.match(self.__Token):
- Ext = self.__Token
- return '.' + Ext
- else:
- raise Warning("Unknown file extension At Line ", self.FileName, self.CurrentLineNumber)
-
- else:
- raise Warning("expected file extension At Line ", self.FileName, self.CurrentLineNumber)
-
- ## __GetRuleFileStatement() method
- #
- # Get rule contents
- #
- # @param self The object pointer
- # @retval Rule Rule object
- #
- def __GetRuleFileStatements(self):
-
- if not self.__IsKeyword("FILE"):
- raise Warning("expected FILE At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextWord():
- raise Warning("expected FFS type At Line ", self.FileName, self.CurrentLineNumber)
-
- Type = self.__Token.strip().upper()
- if Type not in ("RAW", "FREEFORM", "SEC", "PEI_CORE", "PEIM",\
- "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE", "SMM", "SMM_CORE"):
- raise Warning("Unknown FV type At line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsKeyword("$(NAMED_GUID)"):
- if not self.__GetNextWord():
- raise Warning("expected $(NAMED_GUID)", self.FileName, self.CurrentLineNumber)
- if self.__Token == 'PCD':
- if not self.__IsToken( "("):
- raise Warning("expected '('", self.FileName, self.CurrentLineNumber)
- PcdPair = self.__GetNextPcdName()
- if not self.__IsToken( ")"):
- raise Warning("expected ')'", self.FileName, self.CurrentLineNumber)
- self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'
-
- NameGuid = self.__Token
-
- KeepReloc = None
- if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
- if self.__FileCouldHaveRelocFlag(Type):
- if self.__Token == 'RELOCS_STRIPPED':
- KeepReloc = False
- else:
- KeepReloc = True
- else:
- raise Warning("File type %s could not have reloc strip flag At Line %d" % (Type, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- KeyStringList = []
- if self.__GetNextToken():
- Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
- if Pattern.match(self.__Token):
- KeyStringList.append(self.__Token)
- if self.__IsToken(","):
- while self.__GetNextToken():
- if not Pattern.match(self.__Token):
- raise Warning("expected KeyString \"Target_Tag_Arch\" At Line ", self.FileName, self.CurrentLineNumber)
- KeyStringList.append(self.__Token)
-
- if not self.__IsToken(","):
- break
-
- else:
- self.__UndoToken()
-
-
- Fixed = False
- if self.__IsKeyword("Fixed", True):
- Fixed = True
-
- CheckSum = False
- if self.__IsKeyword("CheckSum", True):
- CheckSum = True
-
- AlignValue = ""
- if self.__GetAlignment():
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment At Line ", self.FileName, self.CurrentLineNumber)
- AlignValue = self.__Token
-
- if self.__IsToken("{"):
- # Complex file rule expected
- Rule = RuleComplexFile.RuleComplexFile()
- Rule.FvFileType = Type
- Rule.NameGuid = NameGuid
- Rule.Alignment = AlignValue
- Rule.CheckSum = CheckSum
- Rule.Fixed = Fixed
- Rule.KeyStringList = KeyStringList
- if KeepReloc != None:
- Rule.KeepReloc = KeepReloc
-
- while True:
- IsEncapsulate = self.__GetRuleEncapsulationSection(Rule)
- IsLeaf = self.__GetEfiSection(Rule)
- if not IsEncapsulate and not IsLeaf:
- break
-
- if not self.__IsToken("}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
-
- return Rule
-
- elif self.__IsToken("|"):
- # Ext rule expected
- Ext = self.__GetFileExtension()
-
- Rule = RuleSimpleFile.RuleSimpleFile()
-
- Rule.FvFileType = Type
- Rule.NameGuid = NameGuid
- Rule.Alignment = AlignValue
- Rule.CheckSum = CheckSum
- Rule.Fixed = Fixed
- Rule.FileExtension = Ext
- Rule.KeyStringList = KeyStringList
- if KeepReloc != None:
- Rule.KeepReloc = KeepReloc
-
- return Rule
-
- else:
- # Simple file rule expected
- if not self.__GetNextWord():
- raise Warning("expected leaf section type At Line ", self.FileName, self.CurrentLineNumber)
-
- SectionName = self.__Token
-
- if SectionName not in ("COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
- "UI", "PEI_DEPEX", "VERSION", "SUBTYPE_GUID", "SMM_DEPEX"):
- raise Warning("Unknown leaf section name '%s'" % SectionName, self.FileName, self.CurrentLineNumber)
-
-
- if self.__IsKeyword("Fixed", True):
- Fixed = True
-
- if self.__IsKeyword("CheckSum", True):
- CheckSum = True
-
- if self.__GetAlignment():
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment At Line ", self.FileName, self.CurrentLineNumber)
- if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- AlignValue = self.__Token
-
- if not self.__GetNextToken():
- raise Warning("expected File name At Line ", self.FileName, self.CurrentLineNumber)
-
- Rule = RuleSimpleFile.RuleSimpleFile()
- Rule.SectionType = SectionName
- Rule.FvFileType = Type
- Rule.NameGuid = NameGuid
- Rule.Alignment = AlignValue
- Rule.CheckSum = CheckSum
- Rule.Fixed = Fixed
- Rule.FileName = self.__Token
- Rule.KeyStringList = KeyStringList
- if KeepReloc != None:
- Rule.KeepReloc = KeepReloc
- return Rule
-
- ## __GetEfiSection() method
- #
- # Get section list for Rule
- #
- # @param self The object pointer
- # @param Obj for whom section is got
- # @retval True Successfully find section statement
- # @retval False Not able to find section statement
- #
- def __GetEfiSection(self, Obj):
-
- OldPos = self.GetFileBufferPos()
- if not self.__GetNextWord():
- return False
- SectionName = self.__Token
-
- if SectionName not in ("COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
- "UI", "VERSION", "PEI_DEPEX", "GUID", "SMM_DEPEX"):
- self.__UndoToken()
- return False
-
- if SectionName == "FV_IMAGE":
- FvImageSectionObj = FvImageSection.FvImageSection()
- if self.__IsKeyword("FV_IMAGE"):
- pass
- if self.__IsToken( "{"):
- FvObj = Fv.FV()
- self.__GetDefineStatements(FvObj)
- self.__GetBlockStatement(FvObj)
- self.__GetSetStatements(FvObj)
- self.__GetFvAlignment(FvObj)
- self.__GetFvAttributes(FvObj)
- self.__GetAprioriSection(FvObj)
- self.__GetAprioriSection(FvObj)
-
- while True:
- IsInf = self.__GetInfStatement(FvObj)
- IsFile = self.__GetFileStatement(FvObj)
- if not IsInf and not IsFile:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
- FvImageSectionObj.Fv = FvObj
- FvImageSectionObj.FvName = None
-
- else:
- if not self.__IsKeyword("FV"):
- raise Warning("expected 'FV' At Line ", self.FileName, self.CurrentLineNumber)
- FvImageSectionObj.FvFileType = self.__Token
-
- if self.__GetAlignment():
- if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment At Line ", self.FileName, self.CurrentLineNumber)
- FvImageSectionObj.Alignment = self.__Token
-
- if self.__IsToken('|'):
- FvImageSectionObj.FvFileExtension = self.__GetFileExtension()
- elif self.__GetNextToken():
- if self.__Token not in ("}", "COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
- "UI", "VERSION", "PEI_DEPEX", "GUID", "SMM_DEPEX"):
- FvImageSectionObj.FvFileName = self.__Token
- else:
- self.__UndoToken()
- else:
- raise Warning("expected FV file name At Line ", self.FileName, self.CurrentLineNumber)
-
- Obj.SectionList.append(FvImageSectionObj)
- return True
-
- EfiSectionObj = EfiSection.EfiSection()
- EfiSectionObj.SectionType = SectionName
-
- if not self.__GetNextToken():
- raise Warning("expected file type At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__Token == "STRING":
- if not self.__RuleSectionCouldHaveString(EfiSectionObj.SectionType):
- raise Warning("%s section could NOT have string data At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken('='):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Quoted String At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__GetStringData():
- EfiSectionObj.StringData = self.__Token
-
- if self.__IsKeyword("BUILD_NUM"):
- if not self.__RuleSectionCouldHaveBuildNum(EfiSectionObj.SectionType):
- raise Warning("%s section could NOT have BUILD_NUM At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected Build number At Line ", self.FileName, self.CurrentLineNumber)
- EfiSectionObj.BuildNum = self.__Token
-
- else:
- EfiSectionObj.FileType = self.__Token
- self.__CheckRuleSectionFileType(EfiSectionObj.SectionType, EfiSectionObj.FileType)
-
- if self.__IsKeyword("Optional"):
- if not self.__RuleSectionCouldBeOptional(EfiSectionObj.SectionType):
- raise Warning("%s section could NOT be optional At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
- EfiSectionObj.Optional = True
-
- if self.__IsKeyword("BUILD_NUM"):
- if not self.__RuleSectionCouldHaveBuildNum(EfiSectionObj.SectionType):
- raise Warning("%s section could NOT have BUILD_NUM At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected Build number At Line ", self.FileName, self.CurrentLineNumber)
- EfiSectionObj.BuildNum = self.__Token
-
- if self.__GetAlignment():
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- EfiSectionObj.Alignment = self.__Token
-
- if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
- if self.__SectionCouldHaveRelocFlag(EfiSectionObj.SectionType):
- if self.__Token == 'RELOCS_STRIPPED':
- EfiSectionObj.KeepReloc = False
- else:
- EfiSectionObj.KeepReloc = True
- if Obj.KeepReloc != None and Obj.KeepReloc != EfiSectionObj.KeepReloc:
- raise Warning("Section type %s has reloc strip flag conflict with Rule At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
- else:
- raise Warning("Section type %s could not have reloc strip flag At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
-
- if self.__IsToken('|'):
- EfiSectionObj.FileExtension = self.__GetFileExtension()
- elif self.__GetNextToken():
- if self.__Token not in ("}", "COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
- "UI", "VERSION", "PEI_DEPEX", "GUID", "SMM_DEPEX"):
-
- if self.__Token.startswith('PCD'):
- self.__UndoToken()
- self.__GetNextWord()
-
- if self.__Token == 'PCD':
- if not self.__IsToken( "("):
- raise Warning("expected '('", self.FileName, self.CurrentLineNumber)
- PcdPair = self.__GetNextPcdName()
- if not self.__IsToken( ")"):
- raise Warning("expected ')'", self.FileName, self.CurrentLineNumber)
- self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'
-
- EfiSectionObj.FileName = self.__Token
-
- else:
- self.__UndoToken()
- else:
- raise Warning("expected section file name At Line ", self.FileName, self.CurrentLineNumber)
-
- Obj.SectionList.append(EfiSectionObj)
- return True
-
- ## __RuleSectionCouldBeOptional() method
- #
- # Get whether a section could be optional
- #
- # @param self The object pointer
- # @param SectionType The section type to check
- # @retval True section could be optional
- # @retval False section never optional
- #
- def __RuleSectionCouldBeOptional(self, SectionType):
- if SectionType in ("DXE_DEPEX", "UI", "VERSION", "PEI_DEPEX", "RAW", "SMM_DEPEX"):
- return True
- else:
- return False
-
- ## __RuleSectionCouldHaveBuildNum() method
- #
- # Get whether a section could have build number information
- #
- # @param self The object pointer
- # @param SectionType The section type to check
- # @retval True section could have build number information
- # @retval False section never have build number information
- #
- def __RuleSectionCouldHaveBuildNum(self, SectionType):
- if SectionType in ("VERSION"):
- return True
- else:
- return False
-
- ## __RuleSectionCouldHaveString() method
- #
- # Get whether a section could have string
- #
- # @param self The object pointer
- # @param SectionType The section type to check
- # @retval True section could have string
- # @retval False section never have string
- #
- def __RuleSectionCouldHaveString(self, SectionType):
- if SectionType in ("UI", "VERSION"):
- return True
- else:
- return False
-
- ## __CheckRuleSectionFileType() method
- #
- # Get whether a section matches a file type
- #
- # @param self The object pointer
- # @param SectionType The section type to check
- # @param FileType The file type to check
- #
- def __CheckRuleSectionFileType(self, SectionType, FileType):
- if SectionType == "COMPAT16":
- if FileType not in ("COMPAT16", "SEC_COMPAT16"):
- raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
- elif SectionType == "PE32":
- if FileType not in ("PE32", "SEC_PE32"):
- raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
- elif SectionType == "PIC":
- if FileType not in ("PIC", "PIC"):
- raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
- elif SectionType == "TE":
- if FileType not in ("TE", "SEC_TE"):
- raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
- elif SectionType == "RAW":
- if FileType not in ("BIN", "SEC_BIN", "RAW", "ASL", "ACPI"):
- raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
- elif SectionType == "DXE_DEPEX" or SectionType == "SMM_DEPEX":
- if FileType not in ("DXE_DEPEX", "SEC_DXE_DEPEX", "SMM_DEPEX"):
- raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
- elif SectionType == "UI":
- if FileType not in ("UI", "SEC_UI"):
- raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
- elif SectionType == "VERSION":
- if FileType not in ("VERSION", "SEC_VERSION"):
- raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
- elif SectionType == "PEI_DEPEX":
- if FileType not in ("PEI_DEPEX", "SEC_PEI_DEPEX"):
- raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
- elif SectionType == "GUID":
- if FileType not in ("PE32", "SEC_GUID"):
- raise Warning("Incorrect section file type At Line ", self.FileName, self.CurrentLineNumber)
-
- ## __GetRuleEncapsulationSection() method
- #
- # Get encapsulation section for Rule
- #
- # @param self The object pointer
- # @param Rule for whom section is got
- # @retval True Successfully find section statement
- # @retval False Not able to find section statement
- #
- def __GetRuleEncapsulationSection(self, Rule):
-
- if self.__IsKeyword( "COMPRESS"):
- Type = "PI_STD"
- if self.__IsKeyword("PI_STD") or self.__IsKeyword("PI_NONE"):
- Type = self.__Token
-
- if not self.__IsToken("{"):
- raise Warning("expected '{' At Line ", self.FileName, self.CurrentLineNumber)
-
- CompressSectionObj = CompressSection.CompressSection()
-
- CompressSectionObj.CompType = Type
- # Recursive sections...
- while True:
- IsEncapsulate = self.__GetRuleEncapsulationSection(CompressSectionObj)
- IsLeaf = self.__GetEfiSection(CompressSectionObj)
- if not IsEncapsulate and not IsLeaf:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
- Rule.SectionList.append(CompressSectionObj)
-
- return True
-
- elif self.__IsKeyword( "GUIDED"):
- GuidValue = None
- if self.__GetNextGuid():
- GuidValue = self.__Token
-
- if self.__IsKeyword( "$(NAMED_GUID)"):
- GuidValue = self.__Token
-
- AttribDict = self.__GetGuidAttrib()
-
- if not self.__IsToken("{"):
- raise Warning("expected '{' At Line ", self.FileName, self.CurrentLineNumber)
- GuidSectionObj = GuidSection.GuidSection()
- GuidSectionObj.NameGuid = GuidValue
- GuidSectionObj.SectionType = "GUIDED"
- GuidSectionObj.ProcessRequired = AttribDict["PROCESSING_REQUIRED"]
- GuidSectionObj.AuthStatusValid = AttribDict["AUTH_STATUS_VALID"]
-
- # Efi sections...
- while True:
- IsEncapsulate = self.__GetRuleEncapsulationSection(GuidSectionObj)
- IsLeaf = self.__GetEfiSection(GuidSectionObj)
- if not IsEncapsulate and not IsLeaf:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}' At Line ", self.FileName, self.CurrentLineNumber)
- Rule.SectionList.append(GuidSectionObj)
-
- return True
-
- return False
-
- ## __GetVtf() method
- #
- # Get VTF section contents and store its data into VTF list of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a VTF
- # @retval False Not able to find a VTF
- #
- def __GetVtf(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[VTF."):
- if not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
-
- self.__UndoToken()
- if not self.__IsToken("[VTF.", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("expected [VTF.] At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__SkipToToken("."):
- raise Warning("expected '.' At Line ", self.FileName, self.CurrentLineNumber)
-
- Arch = self.__SkippedChars.rstrip(".").upper()
- if Arch not in ("IA32", "X64", "IPF", "ARM", "AARCH64"):
- raise Warning("Unknown Arch At line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextWord():
- raise Warning("expected VTF name At Line ", self.FileName, self.CurrentLineNumber)
- Name = self.__Token.upper()
-
- VtfObj = Vtf.Vtf()
- VtfObj.UiName = Name
- VtfObj.KeyArch = Arch
-
- if self.__IsToken(","):
- if not self.__GetNextWord():
- raise Warning("expected Arch list At Line ", self.FileName, self.CurrentLineNumber)
- if self.__Token.upper() not in ("IA32", "X64", "IPF", "ARM", "AARCH64"):
- raise Warning("Unknown Arch At line ", self.FileName, self.CurrentLineNumber)
- VtfObj.ArchList = self.__Token.upper()
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']' At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__IsKeyword("IA32_RST_BIN"):
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Reset file At Line ", self.FileName, self.CurrentLineNumber)
-
- VtfObj.ResetBin = self.__Token
-
- while self.__GetComponentStatement(VtfObj):
- pass
-
- self.Profile.VtfList.append(VtfObj)
- return True
-
- ## __GetComponentStatement() method
- #
- # Get components in VTF
- #
- # @param self The object pointer
- # @param VtfObj for whom component is got
- # @retval True Successfully find a component
- # @retval False Not able to find a component
- #
- def __GetComponentStatement(self, VtfObj):
-
- if not self.__IsKeyword("COMP_NAME"):
- return False
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextWord():
- raise Warning("expected Component Name At Line ", self.FileName, self.CurrentLineNumber)
-
- CompStatementObj = ComponentStatement.ComponentStatement()
- CompStatementObj.CompName = self.__Token
-
- if not self.__IsKeyword("COMP_LOC"):
- raise Warning("expected COMP_LOC At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- CompStatementObj.CompLoc = ""
- if self.__GetNextWord():
- CompStatementObj.CompLoc = self.__Token
- if self.__IsToken('|'):
- if not self.__GetNextWord():
- raise Warning("Expected Region Name At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__Token not in ("F", "N", "S"): #, "H", "L", "PH", "PL"): not support
- raise Warning("Unknown location type At line ", self.FileName, self.CurrentLineNumber)
-
- CompStatementObj.FilePos = self.__Token
- else:
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
-
- if not self.__IsKeyword("COMP_TYPE"):
- raise Warning("expected COMP_TYPE At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Component type At Line ", self.FileName, self.CurrentLineNumber)
- if self.__Token not in ("FIT", "PAL_B", "PAL_A", "OEM"):
- if not self.__Token.startswith("0x") or len(self.__Token) < 3 or len(self.__Token) > 4 or \
- not self.__HexDigit(self.__Token[2]) or not self.__HexDigit(self.__Token[-1]):
- raise Warning("Unknown location type At line ", self.FileName, self.CurrentLineNumber)
- CompStatementObj.CompType = self.__Token
-
- if not self.__IsKeyword("COMP_VER"):
- raise Warning("expected COMP_VER At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Component version At Line ", self.FileName, self.CurrentLineNumber)
-
- Pattern = re.compile('-$|[0-9]{0,1}[0-9]{1}\.[0-9]{0,1}[0-9]{1}')
- if Pattern.match(self.__Token) == None:
- raise Warning("Unknown version format At line ", self.FileName, self.CurrentLineNumber)
- CompStatementObj.CompVer = self.__Token
-
- if not self.__IsKeyword("COMP_CS"):
- raise Warning("expected COMP_CS At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Component CS At Line ", self.FileName, self.CurrentLineNumber)
- if self.__Token not in ("1", "0"):
- raise Warning("Unknown Component CS At line ", self.FileName, self.CurrentLineNumber)
- CompStatementObj.CompCs = self.__Token
-
-
- if not self.__IsKeyword("COMP_BIN"):
- raise Warning("expected COMP_BIN At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Component file At Line ", self.FileName, self.CurrentLineNumber)
-
- CompStatementObj.CompBin = self.__Token
-
- if not self.__IsKeyword("COMP_SYM"):
- raise Warning("expected COMP_SYM At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Component symbol file At Line ", self.FileName, self.CurrentLineNumber)
-
- CompStatementObj.CompSym = self.__Token
-
- if not self.__IsKeyword("COMP_SIZE"):
- raise Warning("expected COMP_SIZE At Line ", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
-
- if self.__IsToken("-"):
- CompStatementObj.CompSize = self.__Token
- elif self.__GetNextDecimalNumber():
- CompStatementObj.CompSize = self.__Token
- elif self.__GetNextHexNumber():
- CompStatementObj.CompSize = self.__Token
- else:
- raise Warning("Unknown size At line ", self.FileName, self.CurrentLineNumber)
-
- VtfObj.ComponentStatementList.append(CompStatementObj)
- return True
-
- ## __GetFvInFd() method
- #
- # Get FV list contained in FD
- #
- # @param self The object pointer
- # @param FdName FD name
- # @retval FvList list of FV in FD
- #
- def __GetFvInFd (self, FdName):
-
- FvList = []
- if FdName.upper() in self.Profile.FdDict.keys():
- FdObj = self.Profile.FdDict[FdName.upper()]
- for elementRegion in FdObj.RegionList:
- if elementRegion.RegionType == 'FV':
- for elementRegionData in elementRegion.RegionDataList:
- if elementRegionData != None and elementRegionData.upper() not in FvList:
- FvList.append(elementRegionData.upper())
- return FvList
-
- ## __GetReferencedFdFvTuple() method
- #
- # Get FD and FV list referenced by a FFS file
- #
- # @param self The object pointer
- # @param FfsFile contains sections to be searched
- # @param RefFdList referenced FD by section
- # @param RefFvList referenced FV by section
- #
- def __GetReferencedFdFvTuple(self, FvObj, RefFdList = [], RefFvList = []):
-
- for FfsObj in FvObj.FfsList:
- if isinstance(FfsObj, FfsFileStatement.FileStatement):
- if FfsObj.FvName != None and FfsObj.FvName.upper() not in RefFvList:
- RefFvList.append(FfsObj.FvName.upper())
- elif FfsObj.FdName != None and FfsObj.FdName.upper() not in RefFdList:
- RefFdList.append(FfsObj.FdName.upper())
- else:
- self.__GetReferencedFdFvTupleFromSection(FfsObj, RefFdList, RefFvList)
-
- ## __GetReferencedFdFvTupleFromSection() method
- #
- # Get FD and FV list referenced by a FFS section
- #
- # @param self The object pointer
- # @param FfsFile contains sections to be searched
- # @param FdList referenced FD by section
- # @param FvList referenced FV by section
- #
- def __GetReferencedFdFvTupleFromSection(self, FfsFile, FdList = [], FvList = []):
-
- SectionStack = []
- SectionStack.extend(FfsFile.SectionList)
- while SectionStack != []:
- SectionObj = SectionStack.pop()
- if isinstance(SectionObj, FvImageSection.FvImageSection):
- if SectionObj.FvName != None and SectionObj.FvName.upper() not in FvList:
- FvList.append(SectionObj.FvName.upper())
- if SectionObj.Fv != None and SectionObj.Fv.UiFvName != None and SectionObj.Fv.UiFvName.upper() not in FvList:
- FvList.append(SectionObj.Fv.UiFvName.upper())
- self.__GetReferencedFdFvTuple(SectionObj.Fv, FdList, FvList)
-
- if isinstance(SectionObj, CompressSection.CompressSection) or isinstance(SectionObj, GuidSection.GuidSection):
- SectionStack.extend(SectionObj.SectionList)
-
- ## CycleReferenceCheck() method
- #
- # Check whether cycle reference exists in FDF
- #
- # @param self The object pointer
- # @retval True cycle reference exists
- # @retval False Not exists cycle reference
- #
- def CycleReferenceCheck(self):
-
- CycleRefExists = False
-
- try:
- for FvName in self.Profile.FvDict.keys():
- LogStr = "Cycle Reference Checking for FV: %s\n" % FvName
- RefFvStack = []
- RefFvStack.append(FvName)
- FdAnalyzedList = []
-
- while RefFvStack != []:
- FvNameFromStack = RefFvStack.pop()
- if FvNameFromStack.upper() in self.Profile.FvDict.keys():
- FvObj = self.Profile.FvDict[FvNameFromStack.upper()]
- else:
- continue
-
- RefFdList = []
- RefFvList = []
- self.__GetReferencedFdFvTuple(FvObj, RefFdList, RefFvList)
-
- for RefFdName in RefFdList:
- if RefFdName in FdAnalyzedList:
- continue
-
- LogStr += "FD %s is referenced by FV %s\n" % (RefFdName, FvNameFromStack)
- FvInFdList = self.__GetFvInFd(RefFdName)
- if FvInFdList != []:
- LogStr += "FD %s contains FV: " % RefFdName
- for FvObj in FvInFdList:
- LogStr += FvObj
- LogStr += ' \n'
- if FvObj not in RefFvStack:
- RefFvStack.append(FvObj)
-
- if FvName in RefFvStack:
- CycleRefExists = True
- raise Warning(LogStr)
- FdAnalyzedList.append(RefFdName)
-
- for RefFvName in RefFvList:
- LogStr += "FV %s is referenced by FV %s\n" % (RefFvName, FvNameFromStack)
- if RefFvName not in RefFvStack:
- RefFvStack.append(RefFvName)
-
- if FvName in RefFvStack:
- CycleRefExists = True
- raise Warning(LogStr)
-
- except Warning:
- print LogStr
-
- finally:
- return CycleRefExists
-
-if __name__ == "__main__":
- import sys
- try:
- test_file = sys.argv[1]
- except IndexError, v:
- print "Usage: %s filename" % sys.argv[0]
- sys.exit(1)
-
- parser = FdfParser(test_file)
- try:
- parser.ParseFile()
- parser.CycleReferenceCheck()
- except Warning, X:
- print X.message
- else:
- print "Success!"
-
diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py
deleted file mode 100644
index d566a57844..0000000000
--- a/BaseTools/Source/Python/Common/GlobalData.py
+++ /dev/null
@@ -1,52 +0,0 @@
-## @file
-# This file is used to define common static strings used by INF/DEC/DSC files
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-import re
-
-gIsWindows = None
-
-gEdkCompatibilityPkg = "EdkCompatibilityPkg"
-gWorkspace = "."
-gEdkSource = "EdkCompatibilityPkg"
-gEfiSource = "."
-gEcpSource = "EdkCompatibilityPkg"
-
-gOptions = None
-gCaseInsensitive = False
-gAllFiles = None
-
-gGlobalDefines = {}
-gPlatformDefines = {}
-# PCD name and value pair for fixed at build and feature flag
-gPlatformPcds = {}
-# PCDs with type that are not fixed at build and feature flag
-gPlatformOtherPcds = {}
-gActivePlatform = None
-gCommandLineDefines = {}
-gEdkGlobal = {}
-gOverrideDir = {}
-
-# for debug trace purpose when problem occurs
-gProcessingFile = ''
-gBuildingModule = ''
-
-## Regular expression for matching macro used in DSC/DEC/INF file inclusion
-gMacroRefPattern = re.compile("\$\(([A-Z][_A-Z0-9]*)\)", re.UNICODE)
-gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")
-gMacroNamePattern = re.compile("^[A-Z][A-Z0-9_]*$")
-# C-style wide string pattern
-gWideStringPattern = re.compile('(\W|\A)L"')
-#
-# A global variable for whether current build in AutoGen phase or not.
-#
-gAutoGenPhase = False
-
diff --git a/BaseTools/Source/Python/Common/Identification.py b/BaseTools/Source/Python/Common/Identification.py
deleted file mode 100644
index f43150dfc1..0000000000
--- a/BaseTools/Source/Python/Common/Identification.py
+++ /dev/null
@@ -1,58 +0,0 @@
-## @file
-# This file is used to define the identification of INF/DEC/DSC files
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-## Identification
-#
-# This class defined basic Identification information structure which is used by INF/DEC/DSC files
-#
-# @param object: Inherited from object class
-#
-# @var FileName: To store data for Filename
-# @var FileFullPath: To store data for full path of the file
-# @var FileRelativePath: To store data for relative path of the file
-# @var RunStatus: Status of build system running
-#
-class Identification(object):
- def __init__(self):
- self.FileName = ''
- self.FileFullPath = ''
- self.FileRelativePath = ''
- self.PackagePath = ''
-
- ## GetFileName
- #
- # Reserved
- #
- def GetFileName(self, FileFullPath, FileRelativePath):
- pass
-
- ## GetFileName
- #
- # Reserved
- #
- def GetFileFullPath(self, FileName, FileRelativePath):
- pass
-
- ## GetFileName
- #
- # Reserved
- #
- def GetFileRelativePath(self, FileName, FileFullPath):
- pass
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- id = Identification()
diff --git a/BaseTools/Source/Python/Common/InfClassObject.py b/BaseTools/Source/Python/Common/InfClassObject.py
deleted file mode 100644
index 7ea0c39297..0000000000
--- a/BaseTools/Source/Python/Common/InfClassObject.py
+++ /dev/null
@@ -1,1115 +0,0 @@
-## @file
-# This file is used to define each component of INF file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import re
-import EdkLogger
-from CommonDataClass.CommonClass import LibraryClassClass
-from CommonDataClass.ModuleClass import *
-from String import *
-from DataType import *
-from Identification import *
-from Dictionary import *
-from BuildToolError import *
-from Misc import sdict
-import GlobalData
-from Table.TableInf import TableInf
-import Database
-from Parsing import *
-
-#
-# Global variable
-#
-Section = {TAB_UNKNOWN.upper() : MODEL_UNKNOWN,
- TAB_INF_DEFINES.upper() : MODEL_META_DATA_HEADER,
- TAB_BUILD_OPTIONS.upper() : MODEL_META_DATA_BUILD_OPTION,
- TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,
- TAB_LIBRARIES.upper() : MODEL_EFI_LIBRARY_INSTANCE,
- TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,
- TAB_PACKAGES.upper() : MODEL_META_DATA_PACKAGE,
- TAB_NMAKE.upper() : MODEL_META_DATA_NMAKE,
- TAB_INF_FIXED_PCD.upper() : MODEL_PCD_FIXED_AT_BUILD,
- TAB_INF_PATCH_PCD.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,
- TAB_INF_FEATURE_PCD.upper() : MODEL_PCD_FEATURE_FLAG,
- TAB_INF_PCD_EX.upper() : MODEL_PCD_DYNAMIC_EX,
- TAB_INF_PCD.upper() : MODEL_PCD_DYNAMIC,
- TAB_SOURCES.upper() : MODEL_EFI_SOURCE_FILE,
- TAB_GUIDS.upper() : MODEL_EFI_GUID,
- TAB_PROTOCOLS.upper() : MODEL_EFI_PROTOCOL,
- TAB_PPIS.upper() : MODEL_EFI_PPI,
- TAB_DEPEX.upper() : MODEL_EFI_DEPEX,
- TAB_BINARIES.upper() : MODEL_EFI_BINARY_FILE,
- TAB_USER_EXTENSIONS.upper() : MODEL_META_DATA_USER_EXTENSION
- }
-
-gComponentType2ModuleType = {
- "LIBRARY" : "BASE",
- "SECURITY_CORE" : "SEC",
- "PEI_CORE" : "PEI_CORE",
- "COMBINED_PEIM_DRIVER" : "PEIM",
- "PIC_PEIM" : "PEIM",
- "RELOCATABLE_PEIM" : "PEIM",
- "PE32_PEIM" : "PEIM",
- "BS_DRIVER" : "DXE_DRIVER",
- "RT_DRIVER" : "DXE_RUNTIME_DRIVER",
- "SAL_RT_DRIVER" : "DXE_SAL_DRIVER",
- "APPLICATION" : "UEFI_APPLICATION",
- "LOGO" : "BASE",
-}
-
-gNmakeFlagPattern = re.compile("(?:EBC_)?([A-Z]+)_(?:STD_|PROJ_|ARCH_)?FLAGS(?:_DLL|_ASL|_EXE)?", re.UNICODE)
-gNmakeFlagName2ToolCode = {
- "C" : "CC",
- "LIB" : "SLINK",
- "LINK" : "DLINK",
-}
-
-class InfHeader(ModuleHeaderClass):
- _Mapping_ = {
- #
- # Required Fields
- #
- TAB_INF_DEFINES_BASE_NAME : "Name",
- TAB_INF_DEFINES_FILE_GUID : "Guid",
- TAB_INF_DEFINES_MODULE_TYPE : "ModuleType",
- TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION : "UefiSpecificationVersion",
- TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION : "UefiSpecificationVersion",
- TAB_INF_DEFINES_EDK_RELEASE_VERSION : "EdkReleaseVersion",
- #
- # Optional Fields
- #
- TAB_INF_DEFINES_INF_VERSION : "InfVersion",
- TAB_INF_DEFINES_BINARY_MODULE : "BinaryModule",
- TAB_INF_DEFINES_COMPONENT_TYPE : "ComponentType",
- TAB_INF_DEFINES_MAKEFILE_NAME : "MakefileName",
- TAB_INF_DEFINES_BUILD_NUMBER : "BuildNumber",
- TAB_INF_DEFINES_BUILD_TYPE : "BuildType",
- TAB_INF_DEFINES_FFS_EXT : "FfsExt",
- TAB_INF_DEFINES_FV_EXT : "FvExt",
- TAB_INF_DEFINES_SOURCE_FV : "SourceFv",
- TAB_INF_DEFINES_VERSION_NUMBER : "VersionNumber",
- TAB_INF_DEFINES_VERSION_STRING : "VersionString",
- TAB_INF_DEFINES_VERSION : "Version",
- TAB_INF_DEFINES_PCD_IS_DRIVER : "PcdIsDriver",
- TAB_INF_DEFINES_TIANO_EDK_FLASHMAP_H : "TianoEdkFlashMap_h",
- TAB_INF_DEFINES_SHADOW : "Shadow",
-# TAB_INF_DEFINES_LIBRARY_CLASS : "LibraryClass",
-# TAB_INF_DEFINES_ENTRY_POINT : "ExternImages",
-# TAB_INF_DEFINES_UNLOAD_IMAGE : "ExternImages",
-# TAB_INF_DEFINES_CONSTRUCTOR : ,
-# TAB_INF_DEFINES_DESTRUCTOR : ,
-# TAB_INF_DEFINES_DEFINE : "Define",
-# TAB_INF_DEFINES_SPEC : "Specification",
-# TAB_INF_DEFINES_CUSTOM_MAKEFILE : "CustomMakefile",
-# TAB_INF_DEFINES_MACRO :
- }
-
- def __init__(self):
- ModuleHeaderClass.__init__(self)
- self.VersionNumber = ''
- self.VersionString = ''
- #print self.__dict__
- def __setitem__(self, key, value):
- self.__dict__[self._Mapping_[key]] = value
- def __getitem__(self, key):
- return self.__dict__[self._Mapping_[key]]
- ## "in" test support
- def __contains__(self, key):
- return key in self._Mapping_
-
-## InfObject
-#
-# This class defined basic Inf object which is used by inheriting
-#
-# @param object: Inherited from object class
-#
-class InfObject(object):
- def __init__(self):
- object.__init__()
-
-## Inf
-#
-# This class defined the structure used in Inf object
-#
-# @param InfObject: Inherited from InfObject class
-# @param Ffilename: Input value for Ffilename of Inf file, default is None
-# @param IsMergeAllArches: Input value for IsMergeAllArches
-# True is to merge all arches
-# Fales is not to merge all arches
-# default is False
-# @param IsToModule: Input value for IsToModule
-# True is to transfer to ModuleObject automatically
-# False is not to transfer to ModuleObject automatically
-# default is False
-# @param WorkspaceDir: Input value for current workspace directory, default is None
-#
-# @var Identification: To store value for Identification, it is a structure as Identification
-# @var UserExtensions: To store value for UserExtensions
-# @var Module: To store value for Module, it is a structure as ModuleClass
-# @var WorkspaceDir: To store value for WorkspaceDir
-# @var KeyList: To store value for KeyList, a list for all Keys used in Inf
-#
-class Inf(InfObject):
- def __init__(self, Filename=None, IsToDatabase=False, IsToModule=False, WorkspaceDir=None, Database=None, SupArchList=DataType.ARCH_LIST):
- self.Identification = Identification()
- self.Module = ModuleClass()
- self.UserExtensions = ''
- self.WorkspaceDir = WorkspaceDir
- self.SupArchList = SupArchList
- self.IsToDatabase = IsToDatabase
-
- self.Cur = Database.Cur
- self.TblFile = Database.TblFile
- self.TblInf = Database.TblInf
- self.FileID = -1
- #self.TblInf = TableInf(Database.Cur)
-
- self.KeyList = [
- TAB_SOURCES, TAB_BUILD_OPTIONS, TAB_BINARIES, TAB_INCLUDES, TAB_GUIDS,
- TAB_PROTOCOLS, TAB_PPIS, TAB_LIBRARY_CLASSES, TAB_PACKAGES, TAB_LIBRARIES,
- TAB_INF_FIXED_PCD, TAB_INF_PATCH_PCD, TAB_INF_FEATURE_PCD, TAB_INF_PCD,
- TAB_INF_PCD_EX, TAB_DEPEX, TAB_NMAKE, TAB_INF_DEFINES
- ]
- #
- # Upper all KEYs to ignore case sensitive when parsing
- #
- self.KeyList = map(lambda c: c.upper(), self.KeyList)
-
- #
- # Init RecordSet
- #
- self.RecordSet = {}
- for Key in self.KeyList:
- self.RecordSet[Section[Key]] = []
-
- #
- # Load Inf file if filename is not None
- #
- if Filename != None:
- self.LoadInfFile(Filename)
-
- #
- # Transfer to Module Object if IsToModule is True
- #
- if IsToModule:
- self.InfToModule()
-
- ## Transfer to Module Object
- #
- # Transfer all contents of an Inf file to a standard Module Object
- #
- def InfToModule(self):
- #
- # Init global information for the file
- #
- ContainerFile = self.Identification.FileFullPath
-
- #
- # Generate Package Header
- #
- self.GenModuleHeader(ContainerFile)
-
- #
- # Generate BuildOptions
- #
- self.GenBuildOptions(ContainerFile)
-
- #
- # Generate Includes
- #
- self.GenIncludes(ContainerFile)
-
- #
- # Generate Libraries
- #
- self.GenLibraries(ContainerFile)
-
- #
- # Generate LibraryClasses
- #
- self.GenLibraryClasses(ContainerFile)
-
- #
- # Generate Packages
- #
- self.GenPackages(ContainerFile)
-
- #
- # Generate Nmakes
- #
- self.GenNmakes(ContainerFile)
-
- #
- # Generate Pcds
- #
- self.GenPcds(ContainerFile)
-
- #
- # Generate Sources
- #
- self.GenSources(ContainerFile)
-
- #
- # Generate UserExtensions
- #
- self.GenUserExtensions(ContainerFile)
-
- #
- # Generate Guids
- #
- self.GenGuidProtocolPpis(DataType.TAB_GUIDS, ContainerFile)
-
- #
- # Generate Protocols
- #
- self.GenGuidProtocolPpis(DataType.TAB_PROTOCOLS, ContainerFile)
-
- #
- # Generate Ppis
- #
- self.GenGuidProtocolPpis(DataType.TAB_PPIS, ContainerFile)
-
- #
- # Generate Depexes
- #
- self.GenDepexes(ContainerFile)
-
- #
- # Generate Binaries
- #
- self.GenBinaries(ContainerFile)
-
- ## Parse [Defines] section
- #
- # Parse [Defines] section into InfDefines object
- #
- # @param InfFile The path of the INF file
- # @param Section The title of "Defines" section
- # @param Lines The content of "Defines" section
- #
- def ParseDefines(self, InfFile, Section, Lines):
- TokenList = Section.split(TAB_SPLIT)
- if len(TokenList) == 3:
- RaiseParserError(Section, "Defines", InfFile, "[xx.yy.%s] format (with platform) is not supported")
- if len(TokenList) == 2:
- Arch = TokenList[1].upper()
- else:
- Arch = TAB_ARCH_COMMON
-
- if Arch not in self.Defines:
- self.Defines[Arch] = InfDefines()
- GetSingleValueOfKeyFromLines(Lines, self.Defines[Arch].DefinesDictionary,
- TAB_COMMENT_SPLIT, TAB_EQUAL_SPLIT, False, None)
-
- ## Load Inf file
- #
- # Load the file if it exists
- #
- # @param Filename: Input value for filename of Inf file
- #
- def LoadInfFile(self, Filename):
- #
- # Insert a record for file
- #
- Filename = NormPath(Filename)
- self.Identification.FileFullPath = Filename
- (self.Identification.FileRelativePath, self.Identification.FileName) = os.path.split(Filename)
- self.FileID = self.TblFile.InsertFile(Filename, MODEL_FILE_INF)
-
- #
- # Init InfTable
- #
- #self.TblInf.Table = "Inf%s" % self.FileID
- #self.TblInf.Create()
-
- #
- # Init common datas
- #
- IfDefList, SectionItemList, CurrentSection, ArchList, ThirdList, IncludeFiles = \
- [], [], TAB_UNKNOWN, [], [], []
- LineNo = 0
-
- #
- # Parse file content
- #
- IsFindBlockComment = False
- ReservedLine = ''
- for Line in open(Filename, 'r'):
- LineNo = LineNo + 1
- #
- # Remove comment block
- #
- if Line.find(TAB_COMMENT_EDK_START) > -1:
- ReservedLine = GetSplitList(Line, TAB_COMMENT_EDK_START, 1)[0]
- IsFindBlockComment = True
- if Line.find(TAB_COMMENT_EDK_END) > -1:
- Line = ReservedLine + GetSplitList(Line, TAB_COMMENT_EDK_END, 1)[1]
- ReservedLine = ''
- IsFindBlockComment = False
- if IsFindBlockComment:
- continue
-
- #
- # Remove comments at tail and remove spaces again
- #
- Line = CleanString(Line)
- if Line == '':
- continue
-
- #
- # Find a new section tab
- # First insert previous section items
- # And then parse the content of the new section
- #
- if Line.startswith(TAB_SECTION_START) and Line.endswith(TAB_SECTION_END):
- if Line[1:3] == "--":
- continue
- Model = Section[CurrentSection.upper()]
- #
- # Insert items data of previous section
- #
- InsertSectionItemsIntoDatabase(self.TblInf, self.FileID, Filename, Model, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList, self.RecordSet)
- #
- # Parse the new section
- #
- SectionItemList = []
- ArchList = []
- ThirdList = []
-
- CurrentSection = ''
- LineList = GetSplitValueList(Line[len(TAB_SECTION_START):len(Line) - len(TAB_SECTION_END)], TAB_COMMA_SPLIT)
- for Item in LineList:
- ItemList = GetSplitValueList(Item, TAB_SPLIT)
- if CurrentSection == '':
- CurrentSection = ItemList[0]
- else:
- if CurrentSection != ItemList[0]:
- EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
- if CurrentSection.upper() not in self.KeyList:
- RaiseParserError(Line, CurrentSection, Filename, '', LineNo)
- CurrentSection = TAB_UNKNOWN
- continue
- ItemList.append('')
- ItemList.append('')
- if len(ItemList) > 5:
- RaiseParserError(Line, CurrentSection, Filename, '', LineNo)
- else:
- if ItemList[1] != '' and ItemList[1].upper() not in ARCH_LIST_FULL:
- EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
- ArchList.append(ItemList[1].upper())
- ThirdList.append(ItemList[2])
-
- continue
-
- #
- # Not in any defined section
- #
- if CurrentSection == TAB_UNKNOWN:
- ErrorMsg = "%s is not in any defined section" % Line
- EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
-
- #
- # Add a section item
- #
- SectionItemList.append([Line, LineNo])
- # End of parse
- #End of For
-
- #
- # Insert items data of last section
- #
- Model = Section[CurrentSection.upper()]
- InsertSectionItemsIntoDatabase(self.TblInf, self.FileID, Filename, Model, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList, self.RecordSet)
-
- #
- # Replace all DEFINE macros with its actual values
- #
- ParseDefineMacro2(self.TblInf, self.RecordSet, GlobalData.gGlobalDefines)
-
- ## Show detailed information of Module
- #
- # Print all members and their values of Module class
- #
- def ShowModule(self):
- M = self.Module
- for Arch in M.Header.keys():
- print '\nArch =', Arch
- print 'Filename =', M.Header[Arch].FileName
- print 'FullPath =', M.Header[Arch].FullPath
- print 'BaseName =', M.Header[Arch].Name
- print 'Guid =', M.Header[Arch].Guid
- print 'Version =', M.Header[Arch].Version
- print 'InfVersion =', M.Header[Arch].InfVersion
- print 'UefiSpecificationVersion =', M.Header[Arch].UefiSpecificationVersion
- print 'EdkReleaseVersion =', M.Header[Arch].EdkReleaseVersion
- print 'ModuleType =', M.Header[Arch].ModuleType
- print 'BinaryModule =', M.Header[Arch].BinaryModule
- print 'ComponentType =', M.Header[Arch].ComponentType
- print 'MakefileName =', M.Header[Arch].MakefileName
- print 'BuildNumber =', M.Header[Arch].BuildNumber
- print 'BuildType =', M.Header[Arch].BuildType
- print 'FfsExt =', M.Header[Arch].FfsExt
- print 'FvExt =', M.Header[Arch].FvExt
- print 'SourceFv =', M.Header[Arch].SourceFv
- print 'PcdIsDriver =', M.Header[Arch].PcdIsDriver
- print 'TianoEdkFlashMap_h =', M.Header[Arch].TianoEdkFlashMap_h
- print 'Shadow =', M.Header[Arch].Shadow
- print 'LibraryClass =', M.Header[Arch].LibraryClass
- for Item in M.Header[Arch].LibraryClass:
- print Item.LibraryClass, DataType.TAB_VALUE_SPLIT.join(Item.SupModuleList)
- print 'CustomMakefile =', M.Header[Arch].CustomMakefile
- print 'Define =', M.Header[Arch].Define
- print 'Specification =', M.Header[Arch].Specification
- for Item in self.Module.ExternImages:
- print '\nEntry_Point = %s, UnloadImage = %s' % (Item.ModuleEntryPoint, Item.ModuleUnloadImage)
- for Item in self.Module.ExternLibraries:
- print 'Constructor = %s, Destructor = %s' % (Item.Constructor, Item.Destructor)
- print '\nBuildOptions =', M.BuildOptions
- for Item in M.BuildOptions:
- print Item.ToolChainFamily, Item.ToolChain, Item.Option, Item.SupArchList
- print '\nIncludes =', M.Includes
- for Item in M.Includes:
- print Item.FilePath, Item.SupArchList
- print '\nLibraries =', M.Libraries
- for Item in M.Libraries:
- print Item.Library, Item.SupArchList
- print '\nLibraryClasses =', M.LibraryClasses
- for Item in M.LibraryClasses:
- print Item.LibraryClass, Item.RecommendedInstance, Item.FeatureFlag, Item.SupModuleList, Item.SupArchList, Item.Define
- print '\nPackageDependencies =', M.PackageDependencies
- for Item in M.PackageDependencies:
- print Item.FilePath, Item.SupArchList, Item.FeatureFlag
- print '\nNmake =', M.Nmake
- for Item in M.Nmake:
- print Item.Name, Item.Value, Item.SupArchList
- print '\nPcds =', M.PcdCodes
- for Item in M.PcdCodes:
- print '\tCName=', Item.CName, 'TokenSpaceGuidCName=', Item.TokenSpaceGuidCName, 'DefaultValue=', Item.DefaultValue, 'ItemType=', Item.ItemType, Item.SupArchList
- print '\nSources =', M.Sources
- for Source in M.Sources:
- print Source.SourceFile, 'Fam=', Source.ToolChainFamily, 'Pcd=', Source.FeatureFlag, 'Tag=', Source.TagName, 'ToolCode=', Source.ToolCode, Source.SupArchList
- print '\nUserExtensions =', M.UserExtensions
- for UserExtension in M.UserExtensions:
- print UserExtension.UserID, UserExtension.Identifier, UserExtension.Content
- print '\nGuids =', M.Guids
- for Item in M.Guids:
- print Item.CName, Item.SupArchList, Item.FeatureFlag
- print '\nProtocols =', M.Protocols
- for Item in M.Protocols:
- print Item.CName, Item.SupArchList, Item.FeatureFlag
- print '\nPpis =', M.Ppis
- for Item in M.Ppis:
- print Item.CName, Item.SupArchList, Item.FeatureFlag
- print '\nDepex =', M.Depex
- for Item in M.Depex:
- print Item.Depex, Item.SupArchList, Item.Define
- print '\nBinaries =', M.Binaries
- for Binary in M.Binaries:
- print 'Type=', Binary.FileType, 'Target=', Binary.Target, 'Name=', Binary.BinaryFile, 'FeatureFlag=', Binary.FeatureFlag, 'SupArchList=', Binary.SupArchList
-
- ## Convert [Defines] section content to ModuleHeaderClass
- #
- # Convert [Defines] section content to ModuleHeaderClass
- #
- # @param Defines The content under [Defines] section
- # @param ModuleHeader An object of ModuleHeaderClass
- # @param Arch The supported ARCH
- #
- def GenModuleHeader(self, ContainerFile):
- EdkLogger.debug(2, "Generate ModuleHeader ...")
- File = self.Identification.FileFullPath
- #
- # Update all defines item in database
- #
- RecordSet = self.RecordSet[MODEL_META_DATA_HEADER]
- for Record in RecordSet:
- ValueList = GetSplitValueList(Record[0], TAB_EQUAL_SPLIT)
- if len(ValueList) != 2:
- RaiseParserError(Record[0], 'Defines', ContainerFile, '<Key> = <Value>', Record[2])
- ID, Value1, Value2, Arch, LineNo = Record[3], ValueList[0], ValueList[1], Record[1], Record[2]
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s'
- where ID = %s""" % (self.TblInf.Table, ConvertToSqlString2(Value1), ConvertToSqlString2(Value2), ID)
- self.TblInf.Exec(SqlCommand)
-
- for Arch in DataType.ARCH_LIST:
- ModuleHeader = InfHeader()
- ModuleHeader.FileName = self.Identification.FileName
- ModuleHeader.FullPath = self.Identification.FileFullPath
- DefineList = QueryDefinesItem2(self.TblInf, Arch, self.FileID)
-
- NotProcessedDefineList = []
- for D in DefineList:
- if D[0] in ModuleHeader:
- ModuleHeader[D[0]] = GetSplitValueList(D[1])[0]
- else:
- NotProcessedDefineList.append(D)
-
- if ModuleHeader.ComponentType == "LIBRARY":
- Lib = LibraryClassClass()
- Lib.LibraryClass = ModuleHeader.Name
- Lib.SupModuleList = DataType.SUP_MODULE_LIST
- ModuleHeader.LibraryClass.append(Lib)
-
- # we need to make some key defines resolved first
- for D in NotProcessedDefineList:
- if D[0] == TAB_INF_DEFINES_LIBRARY_CLASS:
- List = GetSplitValueList(D[1], DataType.TAB_VALUE_SPLIT, 1)
- Lib = LibraryClassClass()
- Lib.LibraryClass = CleanString(List[0])
- if len(List) == 1:
- Lib.SupModuleList = DataType.SUP_MODULE_LIST
- elif len(List) == 2:
- Lib.SupModuleList = GetSplitValueList(CleanString(List[1]), ' ')
- ModuleHeader.LibraryClass.append(Lib)
- elif D[0] == TAB_INF_DEFINES_CUSTOM_MAKEFILE:
- List = D[1].split(DataType.TAB_VALUE_SPLIT)
- if len(List) == 2:
- ModuleHeader.CustomMakefile[CleanString(List[0])] = CleanString(List[1])
- else:
- RaiseParserError(D[1], 'CUSTOM_MAKEFILE of Defines', File, 'CUSTOM_MAKEFILE=<Family>|<Filename>', D[2])
- elif D[0] == TAB_INF_DEFINES_ENTRY_POINT:
- Image = ModuleExternImageClass()
- Image.ModuleEntryPoint = CleanString(D[1])
- self.Module.ExternImages.append(Image)
- elif D[0] == TAB_INF_DEFINES_UNLOAD_IMAGE:
- Image = ModuleExternImageClass()
- Image.ModuleUnloadImage = CleanString(D[1])
- self.Module.ExternImages.append(Image)
- elif D[0] == TAB_INF_DEFINES_CONSTRUCTOR:
- LibraryClass = ModuleExternLibraryClass()
- LibraryClass.Constructor = CleanString(D[1])
- self.Module.ExternLibraries.append(LibraryClass)
- elif D[0] == TAB_INF_DEFINES_DESTRUCTOR:
- LibraryClass = ModuleExternLibraryClass()
- LibraryClass.Destructor = CleanString(D[1])
- self.Module.ExternLibraries.append(LibraryClass)
- elif D[0] == TAB_INF_DEFINES_DEFINE:
- List = D[1].split(DataType.TAB_EQUAL_SPLIT)
- if len(List) != 2:
- RaiseParserError(Item, 'DEFINE of Defines', File, 'DEFINE <Word> = <Word>', D[2])
- else:
- ModuleHeader.Define[CleanString(List[0])] = CleanString(List[1])
- elif D[0] == TAB_INF_DEFINES_SPEC:
- List = D[1].split(DataType.TAB_EQUAL_SPLIT)
- if len(List) != 2:
- RaiseParserError(Item, 'SPEC of Defines', File, 'SPEC <Word> = <Version>', D[2])
- else:
- ModuleHeader.Specification[CleanString(List[0])] = CleanString(List[1])
-
- #
- # Get version of INF
- #
- if ModuleHeader.InfVersion != "":
- # EdkII inf
- VersionNumber = ModuleHeader.VersionNumber
- VersionString = ModuleHeader.VersionString
- if len(VersionNumber) > 0 and len(VersionString) == 0:
- EdkLogger.warn(2000, 'VERSION_NUMBER depricated; INF file %s should be modified to use VERSION_STRING instead.' % self.Identification.FileFullPath)
- ModuleHeader.Version = VersionNumber
- if len(VersionString) > 0:
- if len(VersionNumber) > 0:
- EdkLogger.warn(2001, 'INF file %s defines both VERSION_NUMBER and VERSION_STRING, using VERSION_STRING' % self.Identification.FileFullPath)
- ModuleHeader.Version = VersionString
- else:
- # Edk inf
- ModuleHeader.InfVersion = "0x00010000"
- if ModuleHeader.ComponentType in gComponentType2ModuleType:
- ModuleHeader.ModuleType = gComponentType2ModuleType[ModuleHeader.ComponentType]
- elif ModuleHeader.ComponentType != '':
- EdkLogger.error("Parser", PARSER_ERROR, "Unsupported Edk component type [%s]" % ModuleHeader.ComponentType, ExtraData=File, RaiseError=EdkLogger.IsRaiseError)
-
- self.Module.Header[Arch] = ModuleHeader
-
-
- ## GenBuildOptions
- #
- # Gen BuildOptions of Inf
- # [<Family>:]<ToolFlag>=Flag
- #
- # @param ContainerFile: The Inf file full path
- #
- def GenBuildOptions(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_BUILD_OPTIONS)
- BuildOptions = {}
- #
- # Get all BuildOptions
- #
- RecordSet = self.RecordSet[MODEL_META_DATA_BUILD_OPTION]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (Family, ToolChain, Flag) = GetBuildOption(Record[0], ContainerFile, Record[2])
- MergeArches(BuildOptions, (Family, ToolChain, Flag), Arch)
- #
- # Update to Database
- #
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s', Value3 = '%s'
- where ID = %s""" % (self.TblInf.Table, ConvertToSqlString2(Family), ConvertToSqlString2(ToolChain), ConvertToSqlString2(Flag), Record[3])
- self.TblInf.Exec(SqlCommand)
-
- for Key in BuildOptions.keys():
- BuildOption = BuildOptionClass(Key[0], Key[1], Key[2])
- BuildOption.SupArchList = BuildOptions[Key]
- self.Module.BuildOptions.append(BuildOption)
-
- ## GenIncludes
- #
- # Gen Includes of Inf
- #
- #
- # @param ContainerFile: The Inf file full path
- #
- def GenIncludes(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_INCLUDES)
- Includes = sdict()
- #
- # Get all Includes
- #
- RecordSet = self.RecordSet[MODEL_EFI_INCLUDE]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- MergeArches(Includes, Record[0], Arch)
-
- for Key in Includes.keys():
- Include = IncludeClass()
- Include.FilePath = NormPath(Key)
- Include.SupArchList = Includes[Key]
- self.Module.Includes.append(Include)
-
- ## GenLibraries
- #
- # Gen Libraries of Inf
- #
- #
- # @param ContainerFile: The Inf file full path
- #
- def GenLibraries(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARIES)
- Libraries = sdict()
- #
- # Get all Includes
- #
- RecordSet = self.RecordSet[MODEL_EFI_LIBRARY_INSTANCE]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- MergeArches(Libraries, Record[0], Arch)
-
- for Key in Libraries.keys():
- Library = ModuleLibraryClass()
- # replace macro and remove file extension
- Library.Library = Key.rsplit('.', 1)[0]
- Library.SupArchList = Libraries[Key]
- self.Module.Libraries.append(Library)
-
- ## GenLibraryClasses
- #
- # Get LibraryClass of Inf
- # <LibraryClassKeyWord>|<LibraryInstance>
- #
- # @param ContainerFile: The Inf file full path
- #
- def GenLibraryClasses(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARY_CLASSES)
- LibraryClasses = {}
- #
- # Get all LibraryClasses
- #
- RecordSet = self.RecordSet[MODEL_EFI_LIBRARY_CLASS]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (LibClassName, LibClassIns, Pcd, SupModelList) = GetLibraryClassOfInf([Record[0], Record[4]], ContainerFile, self.WorkspaceDir, Record[2])
- MergeArches(LibraryClasses, (LibClassName, LibClassIns, Pcd, SupModelList), Arch)
- #
- # Update to Database
- #
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s', Value3 = '%s'
- where ID = %s""" % (self.TblInf.Table, ConvertToSqlString2(LibClassName), ConvertToSqlString2(LibClassIns), ConvertToSqlString2(SupModelList), Record[3])
- self.TblInf.Exec(SqlCommand)
-
- for Key in LibraryClasses.keys():
- KeyList = Key[0].split(DataType.TAB_VALUE_SPLIT)
- LibraryClass = LibraryClassClass()
- LibraryClass.LibraryClass = Key[0]
- LibraryClass.RecommendedInstance = NormPath(Key[1])
- LibraryClass.FeatureFlag = Key[2]
- LibraryClass.SupArchList = LibraryClasses[Key]
- LibraryClass.SupModuleList = GetSplitValueList(Key[3])
- self.Module.LibraryClasses.append(LibraryClass)
-
- ## GenPackages
- #
- # Gen Packages of Inf
- #
- #
- # @param ContainerFile: The Inf file full path
- #
- def GenPackages(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_PACKAGES)
- Packages = {}
- #
- # Get all Packages
- #
- RecordSet = self.RecordSet[MODEL_META_DATA_PACKAGE]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (Package, Pcd) = GetPackage(Record[0], ContainerFile, self.WorkspaceDir, Record[2])
- MergeArches(Packages, (Package, Pcd), Arch)
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s'
- where ID = %s""" % (self.TblInf.Table, ConvertToSqlString2(Package), ConvertToSqlString2(Pcd), Record[3])
- self.TblInf.Exec(SqlCommand)
-
-
- for Key in Packages.keys():
- Package = ModulePackageDependencyClass()
- Package.FilePath = NormPath(Key[0])
- Package.SupArchList = Packages[Key]
- Package.FeatureFlag = Key[1]
- self.Module.PackageDependencies.append(Package)
-
- ## GenNmakes
- #
- # Gen Nmakes of Inf
- #
- #
- # @param ContainerFile: The Inf file full path
- #
- def GenNmakes(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_NMAKE)
- Nmakes = sdict()
- #
- # Get all Nmakes
- #
- RecordSet = self.RecordSet[MODEL_META_DATA_NMAKE]
-
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- MergeArches(Nmakes, Record[0], Arch)
-
- for Key in Nmakes.keys():
- List = GetSplitValueList(Key, DataType.TAB_EQUAL_SPLIT, MaxSplit=1)
- if len(List) != 2:
- RaiseParserError(Key, 'Nmake', ContainerFile, '<MacroName> = <Value>')
- continue
- Nmake = ModuleNmakeClass()
- Nmake.Name = List[0]
- Nmake.Value = List[1]
- Nmake.SupArchList = Nmakes[Key]
- self.Module.Nmake.append(Nmake)
-
- # convert Edk format to EdkII format
- if Nmake.Name == "IMAGE_ENTRY_POINT":
- Image = ModuleExternImageClass()
- Image.ModuleEntryPoint = Nmake.Value
- self.Module.ExternImages.append(Image)
- elif Nmake.Name == "DPX_SOURCE":
- Source = ModuleSourceFileClass(NormPath(Nmake.Value), "", "", "", "", Nmake.SupArchList)
- self.Module.Sources.append(Source)
- else:
- ToolList = gNmakeFlagPattern.findall(Nmake.Name)
- if len(ToolList) == 0 or len(ToolList) != 1:
- EdkLogger.warn("\nParser", "Don't know how to do with MACRO: %s" % Nmake.Name,
- ExtraData=ContainerFile)
- else:
- if ToolList[0] in gNmakeFlagName2ToolCode:
- Tool = gNmakeFlagName2ToolCode[ToolList[0]]
- else:
- Tool = ToolList[0]
- BuildOption = BuildOptionClass("MSFT", "*_*_*_%s_FLAGS" % Tool, Nmake.Value)
- BuildOption.SupArchList = Nmake.SupArchList
- self.Module.BuildOptions.append(BuildOption)
-
- ## GenPcds
- #
- # Gen Pcds of Inf
- # <TokenSpaceGuidCName>.<PcdCName>[|<Value>]
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenPcds(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_PCDS)
- Pcds = {}
- PcdToken = {}
-
- #
- # Get all Guids
- #
- RecordSet1 = self.RecordSet[MODEL_PCD_FIXED_AT_BUILD]
- RecordSet2 = self.RecordSet[MODEL_PCD_PATCHABLE_IN_MODULE]
- RecordSet3 = self.RecordSet[MODEL_PCD_FEATURE_FLAG]
- RecordSet4 = self.RecordSet[MODEL_PCD_DYNAMIC_EX]
- RecordSet5 = self.RecordSet[MODEL_PCD_DYNAMIC]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet1:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- if self.Module.Header[Arch].LibraryClass != {}:
- pass
- (TokenGuidCName, TokenName, Value, Type) = GetPcdOfInf(Record[0], TAB_PCDS_FIXED_AT_BUILD, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenGuidCName, TokenName, Value, Type), Arch)
- PcdToken[Record[3]] = (TokenGuidCName, TokenName)
- for Record in RecordSet2:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (TokenGuidCName, TokenName, Value, Type) = GetPcdOfInf(Record[0], TAB_PCDS_PATCHABLE_IN_MODULE, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenGuidCName, TokenName, Value, Type), Arch)
- PcdToken[Record[3]] = (TokenGuidCName, TokenName)
- for Record in RecordSet3:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (TokenGuidCName, TokenName, Value, Type) = GetPcdOfInf(Record[0], TAB_PCDS_FEATURE_FLAG, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenGuidCName, TokenName, Value, Type), Arch)
- PcdToken[Record[3]] = (TokenGuidCName, TokenName)
- for Record in RecordSet4:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (TokenGuidCName, TokenName, Value, Type) = GetPcdOfInf(Record[0], TAB_PCDS_DYNAMIC_EX, ContainerFile, Record[2])
- MergeArches(Pcds, (TokenGuidCName, TokenName, Value, Type), Arch)
- PcdToken[Record[3]] = (TokenGuidCName, TokenName)
- for Record in RecordSet5:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (TokenGuidCName, TokenName, Value, Type) = GetPcdOfInf(Record[0], "", ContainerFile, Record[2])
- MergeArches(Pcds, (TokenGuidCName, TokenName, Value, Type), Arch)
- PcdToken[Record[3]] = (TokenGuidCName, TokenName)
- #
- # Update to database
- #
- if self.IsToDatabase:
- for Key in PcdToken.keys():
- SqlCommand = """update %s set Value2 = '%s' where ID = %s""" % (self.TblInf.Table, ".".join((PcdToken[Key][0], PcdToken[Key][1])), Key)
- self.TblInf.Exec(SqlCommand)
-
- for Key in Pcds.keys():
- Pcd = PcdClass()
- Pcd.CName = Key[1]
- Pcd.TokenSpaceGuidCName = Key[0]
- Pcd.DefaultValue = Key[2]
- Pcd.ItemType = Key[3]
- Pcd.SupArchList = Pcds[Key]
- self.Module.PcdCodes.append(Pcd)
-
- ## GenSources
- #
- # Gen Sources of Inf
- # <Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenSources(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_SOURCES)
- Sources = {}
-
- #
- # Get all Nmakes
- #
- RecordSet = self.RecordSet[MODEL_EFI_SOURCE_FILE]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (Filename, Family, TagName, ToolCode, Pcd) = GetSource(Record[0], ContainerFile, self.Identification.FileRelativePath, Record[2])
- MergeArches(Sources, (Filename, Family, TagName, ToolCode, Pcd), Arch)
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s', Value3 = '%s', Value4 = '%s', Value5 = '%s'
- where ID = %s""" % (self.TblInf.Table, ConvertToSqlString2(Filename), ConvertToSqlString2(Family), ConvertToSqlString2(TagName), ConvertToSqlString2(ToolCode), ConvertToSqlString2(Pcd), Record[3])
- self.TblInf.Exec(SqlCommand)
-
- for Key in Sources.keys():
- Source = ModuleSourceFileClass(Key[0], Key[2], Key[3], Key[1], Key[4], Sources[Key])
- self.Module.Sources.append(Source)
-
- ## GenUserExtensions
- #
- # Gen UserExtensions of Inf
- #
- def GenUserExtensions(self, ContainerFile):
-# #
-# # UserExtensions
-# #
-# if self.UserExtensions != '':
-# UserExtension = UserExtensionsClass()
-# Lines = self.UserExtensions.splitlines()
-# List = GetSplitValueList(Lines[0], DataType.TAB_SPLIT, 2)
-# if len(List) != 3:
-# RaiseParserError(Lines[0], 'UserExtensions', File, "UserExtensions.UserId.'Identifier'")
-# else:
-# UserExtension.UserID = List[1]
-# UserExtension.Identifier = List[2][0:-1].replace("'", '').replace('\"', '')
-# for Line in Lines[1:]:
-# UserExtension.Content = UserExtension.Content + CleanString(Line) + '\n'
-# self.Module.UserExtensions.append(UserExtension)
- pass
-
- ## GenDepexes
- #
- # Gen Depex of Inf
- #
- # @param ContainerFile: The Inf file full path
- #
- def GenDepexes(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_DEPEX)
- Depex = {}
- #
- # Get all Depexes
- #
- RecordSet = self.RecordSet[MODEL_EFI_DEPEX]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- Line = ''
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- Line = Line + Record[0] + ' '
- if Line != '':
- MergeArches(Depex, Line, Arch)
-
- for Key in Depex.keys():
- Dep = ModuleDepexClass()
- Dep.Depex = Key
- Dep.SupArchList = Depex[Key]
- self.Module.Depex.append(Dep)
-
- ## GenBinaries
- #
- # Gen Binary of Inf
- # <FileType>|<Filename>|<Target>[|<TokenSpaceGuidCName>.<PcdCName>]
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenBinaries(self, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % TAB_BINARIES)
- Binaries = {}
-
- #
- # Get all Guids
- #
- RecordSet = self.RecordSet[MODEL_EFI_BINARY_FILE]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (FileType, Filename, Target, Pcd) = GetBinary(Record[0], ContainerFile, self.Identification.FileRelativePath, Record[2])
- MergeArches(Binaries, (FileType, Filename, Target, Pcd), Arch)
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s', Value3 = '%s', Value4 = '%s'
- where ID = %s""" % (self.TblInf.Table, ConvertToSqlString2(FileType), ConvertToSqlString2(Filename), ConvertToSqlString2(Target), ConvertToSqlString2(Pcd), Record[3])
- self.TblInf.Exec(SqlCommand)
-
- for Key in Binaries.keys():
- Binary = ModuleBinaryFileClass(NormPath(Key[1]), Key[0], Key[2], Key[3], Binaries[Key])
- self.Module.Binaries.append(Binary)
-
- ## GenGuids
- #
- # Gen Guids of Inf
- # <CName>=<GuidValue>
- #
- # @param ContainerFile: The Inf file full path
- #
- def GenGuidProtocolPpis(self, Type, ContainerFile):
- EdkLogger.debug(2, "Generate %s ..." % Type)
- Lists = {}
- #
- # Get all Items
- #
- RecordSet = self.RecordSet[Section[Type.upper()]]
-
- #
- # Go through each arch
- #
- for Arch in self.SupArchList:
- for Record in RecordSet:
- if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
- (Name, Value) = GetGuidsProtocolsPpisOfInf(Record[0], Type, ContainerFile, Record[2])
- MergeArches(Lists, (Name, Value), Arch)
- if self.IsToDatabase:
- SqlCommand = """update %s set Value1 = '%s', Value2 = '%s'
- where ID = %s""" % (self.TblInf.Table, ConvertToSqlString2(Name), ConvertToSqlString2(Value), Record[3])
- self.TblInf.Exec(SqlCommand)
-
- ListMember = None
- if Type == TAB_GUIDS:
- ListMember = self.Module.Guids
- elif Type == TAB_PROTOCOLS:
- ListMember = self.Module.Protocols
- elif Type == TAB_PPIS:
- ListMember = self.Module.Ppis
-
- for Key in Lists.keys():
- ListClass = GuidProtocolPpiCommonClass()
- ListClass.CName = Key[0]
- ListClass.SupArchList = Lists[Key]
- ListClass.FeatureFlag = Key[1]
- ListMember.append(ListClass)
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- EdkLogger.Initialize()
- EdkLogger.SetLevel(EdkLogger.DEBUG_0)
-
- W = os.getenv('WORKSPACE')
- F = os.path.join(W, 'MdeModulePkg/Application/HelloWorld/HelloWorld.inf')
-
- Db = Database.Database('Inf.db')
- Db.InitDatabase()
-
- P = Inf(os.path.normpath(F), True, True, W, Db)
- P.ShowModule()
-
- Db.Close()
diff --git a/BaseTools/Source/Python/Common/MigrationUtilities.py b/BaseTools/Source/Python/Common/MigrationUtilities.py
deleted file mode 100644
index 7c69704596..0000000000
--- a/BaseTools/Source/Python/Common/MigrationUtilities.py
+++ /dev/null
@@ -1,567 +0,0 @@
-## @file
-# Contains several utilitities shared by migration tools.
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import re
-import EdkLogger
-from optparse import OptionParser
-from Common.BuildToolError import *
-from XmlRoutines import *
-from CommonDataClass.CommonClass import *
-
-## Set all fields of CommonClass object.
-#
-# Set all attributes of CommonClass object from XML Dom object of XmlCommon.
-#
-# @param Common The destine CommonClass object.
-# @param XmlCommon The source XML Dom object.
-#
-def SetCommon(Common, XmlCommon):
- XmlTag = "Usage"
- Common.Usage = XmlAttribute(XmlCommon, XmlTag).split()
-
- XmlTag = "FeatureFlag"
- Common.FeatureFlag = XmlAttribute(XmlCommon, XmlTag)
-
- XmlTag = "SupArchList"
- Common.SupArchList = XmlAttribute(XmlCommon, XmlTag).split()
-
- XmlTag = XmlNodeName(XmlCommon) + "/" + "HelpText"
- Common.HelpText = XmlElement(XmlCommon, XmlTag)
-
-
-## Set some fields of CommonHeaderClass object.
-#
-# Set Name, Guid, FileName and FullPath fields of CommonHeaderClass object from
-# XML Dom object of XmlCommonHeader, NameTag and FileName.
-#
-# @param CommonHeader The destine CommonClass object.
-# @param XmlCommonHeader The source XML Dom object.
-# @param NameTag The name tag in XML Dom object.
-# @param FileName The file name of the XML file.
-#
-def SetIdentification(CommonHeader, XmlCommonHeader, NameTag, FileName):
- XmlParentTag = XmlNodeName(XmlCommonHeader)
-
- XmlTag = XmlParentTag + "/" + NameTag
- CommonHeader.Name = XmlElement(XmlCommonHeader, XmlTag)
-
- XmlTag = XmlParentTag + "/" + "GuidValue"
- CommonHeader.Guid = XmlElement(XmlCommonHeader, XmlTag)
-
- XmlTag = XmlParentTag + "/" + "Version"
- CommonHeader.Version = XmlElement(XmlCommonHeader, XmlTag)
-
- CommonHeader.FileName = os.path.basename(FileName)
- CommonHeader.FullPath = os.path.abspath(FileName)
-
-
-## Regular expression to match specification and value.
-mReSpecification = re.compile(r"(?P<Specification>\w+)\s+(?P<Value>\w*)")
-
-## Add specification to specification dictionary.
-#
-# Abstract specification name, value pair from Specification String and add them
-# to specification dictionary.
-#
-# @param SpecificationDict The destine Specification dictionary.
-# @param SpecificationString The source Specification String from which the
-# specification name and value pair is abstracted.
-#
-def AddToSpecificationDict(SpecificationDict, SpecificationString):
- """Abstract specification name, value pair from Specification String"""
- for SpecificationMatch in mReSpecification.finditer(SpecificationString):
- Specification = SpecificationMatch.group("Specification")
- Value = SpecificationMatch.group("Value")
- SpecificationDict[Specification] = Value
-
-## Set all fields of CommonHeaderClass object.
-#
-# Set all attributes of CommonHeaderClass object from XML Dom object of
-# XmlCommonHeader, NameTag and FileName.
-#
-# @param CommonHeader The destine CommonClass object.
-# @param XmlCommonHeader The source XML Dom object.
-# @param NameTag The name tag in XML Dom object.
-# @param FileName The file name of the XML file.
-#
-def SetCommonHeader(CommonHeader, XmlCommonHeader):
- """Set all attributes of CommonHeaderClass object from XmlCommonHeader"""
- XmlParent = XmlNodeName(XmlCommonHeader)
-
- XmlTag = XmlParent + "/" + "Abstract"
- CommonHeader.Abstract = XmlElement(XmlCommonHeader, XmlTag)
-
- XmlTag = XmlParent + "/" + "Description"
- CommonHeader.Description = XmlElement(XmlCommonHeader, XmlTag)
-
- XmlTag = XmlParent + "/" + "Copyright"
- CommonHeader.Copyright = XmlElement(XmlCommonHeader, XmlTag)
-
- XmlTag = XmlParent + "/" + "License"
- CommonHeader.License = XmlElement(XmlCommonHeader, XmlTag)
-
- XmlTag = XmlParent + "/" + "Specification"
- Specification = XmlElement(XmlCommonHeader, XmlTag)
-
- AddToSpecificationDict(CommonHeader.Specification, Specification)
-
- XmlTag = XmlParent + "/" + "ModuleType"
- CommonHeader.ModuleType = XmlElement(XmlCommonHeader, XmlTag)
-
-
-## Load a new Cloned Record class object.
-#
-# Read an input XML ClonedRecord DOM object and return an object of Cloned Record
-# contained in the DOM object.
-#
-# @param XmlCloned A child XML DOM object in a Common XML DOM.
-#
-# @retvel ClonedRecord A new Cloned Record object created by XmlCloned.
-#
-def LoadClonedRecord(XmlCloned):
- ClonedRecord = ClonedRecordClass()
-
- XmlTag = "Id"
- ClonedRecord.Id = int(XmlAttribute(XmlCloned, XmlTag))
-
- XmlTag = "FarGuid"
- ClonedRecord.FarGuid = XmlAttribute(XmlCloned, XmlTag)
-
- XmlTag = "Cloned/PackageGuid"
- ClonedRecord.PackageGuid = XmlElement(XmlCloned, XmlTag)
-
- XmlTag = "Cloned/PackageVersion"
- ClonedRecord.PackageVersion = XmlElement(XmlCloned, XmlTag)
-
- XmlTag = "Cloned/ModuleGuid"
- ClonedRecord.ModuleGuid = XmlElement(XmlCloned, XmlTag)
-
- XmlTag = "Cloned/ModuleVersion"
- ClonedRecord.ModuleVersion = XmlElement(XmlCloned, XmlTag)
-
- return ClonedRecord
-
-
-## Load a new Guid/Protocol/Ppi common class object.
-#
-# Read an input XML Guid/Protocol/Ppi DOM object and return an object of
-# Guid/Protocol/Ppi contained in the DOM object.
-#
-# @param XmlGuidProtocolPpiCommon A child XML DOM object in a Common XML DOM.
-#
-# @retvel GuidProtocolPpiCommon A new GuidProtocolPpiCommon class object
-# created by XmlGuidProtocolPpiCommon.
-#
-def LoadGuidProtocolPpiCommon(XmlGuidProtocolPpiCommon):
- GuidProtocolPpiCommon = GuidProtocolPpiCommonClass()
-
- XmlTag = "Name"
- GuidProtocolPpiCommon.Name = XmlAttribute(XmlGuidProtocolPpiCommon, XmlTag)
-
- XmlParent = XmlNodeName(XmlGuidProtocolPpiCommon)
- if XmlParent == "Entry":
- XmlTag = "%s/C_Name" % XmlParent
- elif XmlParent == "GuidCNames":
- XmlTag = "%s/GuidCName" % XmlParent
- else:
- XmlTag = "%s/%sCName" % (XmlParent, XmlParent)
-
- GuidProtocolPpiCommon.CName = XmlElement(XmlGuidProtocolPpiCommon, XmlTag)
-
- XmlTag = XmlParent + "/" + "GuidValue"
- GuidProtocolPpiCommon.Guid = XmlElement(XmlGuidProtocolPpiCommon, XmlTag)
-
- if XmlParent.endswith("Notify"):
- GuidProtocolPpiCommon.Notify = True
-
- XmlTag = "GuidTypeList"
- GuidTypes = XmlAttribute(XmlGuidProtocolPpiCommon, XmlTag)
- GuidProtocolPpiCommon.GuidTypeList = GuidTypes.split()
-
- XmlTag = "SupModuleList"
- SupModules = XmlAttribute(XmlGuidProtocolPpiCommon, XmlTag)
- GuidProtocolPpiCommon.SupModuleList = SupModules.split()
-
- SetCommon(GuidProtocolPpiCommon, XmlGuidProtocolPpiCommon)
-
- return GuidProtocolPpiCommon
-
-
-## Load a new Pcd class object.
-#
-# Read an input XML Pcd DOM object and return an object of Pcd
-# contained in the DOM object.
-#
-# @param XmlPcd A child XML DOM object in a Common XML DOM.
-#
-# @retvel Pcd A new Pcd object created by XmlPcd.
-#
-def LoadPcd(XmlPcd):
- """Return a new PcdClass object equivalent to XmlPcd"""
- Pcd = PcdClass()
-
- XmlTag = "PcdEntry/C_Name"
- Pcd.CName = XmlElement(XmlPcd, XmlTag)
-
- XmlTag = "PcdEntry/Token"
- Pcd.Token = XmlElement(XmlPcd, XmlTag)
-
- XmlTag = "PcdEntry/TokenSpaceGuidCName"
- Pcd.TokenSpaceGuidCName = XmlElement(XmlPcd, XmlTag)
-
- XmlTag = "PcdEntry/DatumType"
- Pcd.DatumType = XmlElement(XmlPcd, XmlTag)
-
- XmlTag = "PcdEntry/MaxDatumSize"
- Pcd.MaxDatumSize = XmlElement(XmlPcd, XmlTag)
-
- XmlTag = "PcdEntry/DefaultValue"
- Pcd.DefaultValue = XmlElement(XmlPcd, XmlTag)
-
- XmlTag = "PcdItemType"
- Pcd.ItemType = XmlAttribute(XmlPcd, XmlTag)
-
- XmlTag = "PcdEntry/ValidUsage"
- Pcd.ValidUsage = XmlElement(XmlPcd, XmlTag).split()
-
- XmlTag = "SupModuleList"
- Pcd.SupModuleList = XmlAttribute(XmlPcd, XmlTag).split()
-
- SetCommon(Pcd, XmlPcd)
-
- return Pcd
-
-
-## Load a new LibraryClass class object.
-#
-# Read an input XML LibraryClass DOM object and return an object of LibraryClass
-# contained in the DOM object.
-#
-# @param XmlLibraryClass A child XML DOM object in a Common XML DOM.
-#
-# @retvel LibraryClass A new LibraryClass object created by XmlLibraryClass.
-#
-def LoadLibraryClass(XmlLibraryClass):
- LibraryClass = LibraryClassClass()
-
- XmlTag = "LibraryClass/Keyword"
- LibraryClass.LibraryClass = XmlElement(XmlLibraryClass, XmlTag)
- if LibraryClass.LibraryClass == "":
- XmlTag = "Name"
- LibraryClass.LibraryClass = XmlAttribute(XmlLibraryClass, XmlTag)
-
- XmlTag = "LibraryClass/IncludeHeader"
- LibraryClass.IncludeHeader = XmlElement(XmlLibraryClass, XmlTag)
-
- XmlTag = "RecommendedInstanceVersion"
- RecommendedInstanceVersion = XmlAttribute(XmlLibraryClass, XmlTag)
- LibraryClass.RecommendedInstanceVersion = RecommendedInstanceVersion
-
- XmlTag = "RecommendedInstanceGuid"
- RecommendedInstanceGuid = XmlAttribute(XmlLibraryClass, XmlTag)
- LibraryClass.RecommendedInstanceGuid = RecommendedInstanceGuid
-
- XmlTag = "SupModuleList"
- SupModules = XmlAttribute(XmlLibraryClass, XmlTag)
- LibraryClass.SupModuleList = SupModules.split()
-
- SetCommon(LibraryClass, XmlLibraryClass)
-
- return LibraryClass
-
-
-## Load a new Build Option class object.
-#
-# Read an input XML BuildOption DOM object and return an object of Build Option
-# contained in the DOM object.
-#
-# @param XmlBuildOption A child XML DOM object in a Common XML DOM.
-#
-# @retvel BuildOption A new Build Option object created by XmlBuildOption.
-#
-def LoadBuildOption(XmlBuildOption):
- """Return a new BuildOptionClass object equivalent to XmlBuildOption"""
- BuildOption = BuildOptionClass()
-
- BuildOption.Option = XmlElementData(XmlBuildOption)
-
- XmlTag = "BuildTargets"
- BuildOption.BuildTargetList = XmlAttribute(XmlBuildOption, XmlTag).split()
-
- XmlTag = "ToolChainFamily"
- BuildOption.ToolChainFamily = XmlAttribute(XmlBuildOption, XmlTag)
-
- XmlTag = "TagName"
- BuildOption.TagName = XmlAttribute(XmlBuildOption, XmlTag)
-
- XmlTag = "ToolCode"
- BuildOption.ToolCode = XmlAttribute(XmlBuildOption, XmlTag)
-
- XmlTag = "SupArchList"
- BuildOption.SupArchList = XmlAttribute(XmlBuildOption, XmlTag).split()
-
- return BuildOption
-
-
-## Load a new User Extensions class object.
-#
-# Read an input XML UserExtensions DOM object and return an object of User
-# Extensions contained in the DOM object.
-#
-# @param XmlUserExtensions A child XML DOM object in a Common XML DOM.
-#
-# @retvel UserExtensions A new User Extensions object created by
-# XmlUserExtensions.
-#
-def LoadUserExtensions(XmlUserExtensions):
- UserExtensions = UserExtensionsClass()
-
- XmlTag = "UserID"
- UserExtensions.UserID = XmlAttribute(XmlUserExtensions, XmlTag)
-
- XmlTag = "Identifier"
- UserExtensions.Identifier = XmlAttribute(XmlUserExtensions, XmlTag)
-
- UserExtensions.Content = XmlElementData(XmlUserExtensions)
-
- return UserExtensions
-
-
-## Store content to a text file object.
-#
-# Write some text file content to a text file object. The contents may echo
-# in screen in a verbose way.
-#
-# @param TextFile The text file object.
-# @param Content The string object to be written to a text file.
-#
-def StoreTextFile(TextFile, Content):
- EdkLogger.verbose(Content)
- TextFile.write(Content)
-
-
-## Add item to a section.
-#
-# Add an Item with specific CPU architecture to section dictionary.
-# The possible duplication is ensured to be removed.
-#
-# @param Section Section dictionary indexed by CPU architecture.
-# @param Arch CPU architecture: Ia32, X64, Ipf, ARM, AARCH64, Ebc or Common.
-# @param Item The Item to be added to section dictionary.
-#
-def AddToSection(Section, Arch, Item):
- SectionArch = Section.get(Arch, [])
- if Item not in SectionArch:
- SectionArch.append(Item)
- Section[Arch] = SectionArch
-
-
-## Get section contents.
-#
-# Return the content of section named SectionName.
-# the contents is based on Methods and ObjectLists.
-#
-# @param SectionName The name of the section.
-# @param Method A function returning a string item of an object.
-# @param ObjectList The list of object.
-#
-# @retval Section The string content of a section.
-#
-def GetSection(SectionName, Method, ObjectList):
- SupportedArches = ["common", "Ia32", "X64", "Ipf", "Ebc", "ARM", "AARCH64"]
- SectionDict = {}
- for Object in ObjectList:
- Item = Method(Object)
- if Item == "":
- continue
- Item = " %s" % Item
- Arches = Object.SupArchList
- if len(Arches) == 0:
- AddToSection(SectionDict, "common", Item)
- else:
- for Arch in SupportedArches:
- if Arch.upper() in Arches:
- AddToSection(SectionDict, Arch, Item)
-
- Section = ""
- for Arch in SupportedArches:
- SectionArch = "\n".join(SectionDict.get(Arch, []))
- if SectionArch != "":
- Section += "[%s.%s]\n%s\n" % (SectionName, Arch, SectionArch)
- Section += "\n"
- if Section != "":
- Section += "\n"
- return Section
-
-
-## Store file header to a text file.
-#
-# Write standard file header to a text file. The content includes copyright,
-# abstract, description and license extracted from CommonHeader class object.
-#
-# @param TextFile The text file object.
-# @param CommonHeader The source CommonHeader class object.
-#
-def StoreHeader(TextFile, CommonHeader):
- CopyRight = CommonHeader.Copyright
- Abstract = CommonHeader.Abstract
- Description = CommonHeader.Description
- License = CommonHeader.License
-
- Header = "#/** @file\n#\n"
- Header += "# " + Abstract + "\n#\n"
- Header += "# " + Description.strip().replace("\n", "\n# ") + "\n"
- Header += "# " + CopyRight + "\n#\n"
- Header += "# " + License.replace("\n", "\n# ").replace(" ", " ")
- Header += "\n#\n#**/\n\n"
-
- StoreTextFile(TextFile, Header)
-
-## Store file header to a text file.
-#
-# Write Defines section to a text file. DefinesTupleList determines the content.
-#
-# @param TextFile The text file object.
-# @param DefinesTupleList The list of (Tag, Value) to be added as one item.
-#
-def StoreDefinesSection(TextFile, DefinesTupleList):
- Section = "[Defines]\n"
- for DefineItem in DefinesTupleList:
- Section += " %-30s = %s\n" % DefineItem
-
- Section += "\n\n"
- StoreTextFile(TextFile, Section)
-
-
-## Return one User Extension section.
-#
-# Read the input UserExtentsions class object and return one section.
-#
-# @param UserExtensions An input UserExtensions class object.
-#
-# @retval UserExtensionSection A section representing UserExtensions object.
-#
-def GetUserExtensions(UserExtensions):
- UserId = UserExtensions.UserID
- Identifier = UserExtensions.Identifier
- Content = UserExtensions.Content
-
- return "[UserExtensions.%s.%s]\n %s\n\n" % (UserId, Identifier, Content)
-
-## Regular expression to match an equation.
-mReEquation = re.compile(r"\s*(\S+)\s*=\s*(\S*)\s*")
-
-## Return a value tuple matching information in a text fle.
-#
-# Parse the text file and return a value tuple corresponding to an input tag
-# tuple. In case of any error, an tuple of empty strings is returned.
-#
-# @param FileName The file name of the text file.
-# @param TagTuple A tuple of tags as the key to the value.
-#
-# @param ValueTupe The returned tuple corresponding to the tag tuple.
-#
-def GetTextFileInfo(FileName, TagTuple):
- ValueTuple = [""] * len(TagTuple)
- try:
- for Line in open(FileName):
- Line = Line.split("#", 1)[0]
- MatchEquation = mReEquation.match(Line)
- if MatchEquation:
- Tag = MatchEquation.group(1).upper()
- Value = MatchEquation.group(2)
- for Index in range(len(TagTuple)):
- if TagTuple[Index] == Tag:
- ValueTuple[Index] = Value
- except:
- EdkLogger.info("IO Error in reading file %s" % FileName)
-
- return ValueTuple
-
-
-## Return a value tuple matching information in an XML fle.
-#
-# Parse the XML file and return a value tuple corresponding to an input tag
-# tuple. In case of any error, an tuple of empty strings is returned.
-#
-# @param FileName The file name of the XML file.
-# @param TagTuple A tuple of tags as the key to the value.
-#
-# @param ValueTupe The returned tuple corresponding to the tag tuple.
-#
-def GetXmlFileInfo(FileName, TagTuple):
- XmlDom = XmlParseFile(FileName)
- return tuple([XmlElement(XmlDom, XmlTag) for XmlTag in TagTuple])
-
-
-## Parse migration command line options
-#
-# Use standard Python module optparse to parse command line option of this tool.
-#
-# @param Source The source file type.
-# @param Destinate The destinate file type.
-#
-# @retval Options A optparse object containing the parsed options.
-# @retval InputFile Path of an source file to be migrated.
-#
-def MigrationOptionParser(Source, Destinate, ToolName, VersionNumber = 1.0):
- # use clearer usage to override default usage message
- UsageString = "%s [-a] [-v|-q] [-o <output_file>] <input_file>" % ToolName
- Version = "%s Version %.2f" % (ToolName, VersionNumber)
- Copyright = "Copyright (c) 2007, Intel Corporation. All rights reserved."
-
- Parser = OptionParser(description=Copyright, version=Version, usage=UsageString)
- Parser.add_option("-o", "--output", dest="OutputFile", help="The name of the %s file to be created." % Destinate)
- Parser.add_option("-a", "--auto", dest="AutoWrite", action="store_true", default=False, help="Automatically create the %s file using the name of the %s file and replacing file extension" % (Source, Destinate))
- Parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")
- Parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed.")
-
- Options, Args = Parser.parse_args()
-
- # Set logging level
- if Options.verbose:
- EdkLogger.setLevel(EdkLogger.VERBOSE)
- elif Options.quiet:
- EdkLogger.setLevel(EdkLogger.QUIET)
- else:
- EdkLogger.setLevel(EdkLogger.INFO)
-
- # error check
- if len(Args) == 0:
- raise MigrationError(PARAMETER_MISSING, name="Input file", usage=Parser.get_usage())
- if len(Args) > 1:
- raise MigrationError(PARAMETER_INVALID, name="Too many input files", usage=Parser.get_usage())
-
- InputFile = Args[0]
- if not os.path.exists(InputFile):
- raise MigrationError(FILE_NOT_FOUND, name=InputFile)
-
- if Options.OutputFile:
- if Options.AutoWrite:
- raise MigrationError(OPTION_CONFLICT, arg1="-o", arg2="-a", usage=Parser.get_usage())
- else:
- if Options.AutoWrite:
- Options.OutputFile = os.path.splitext(InputFile)[0] + "." + Destinate.lower()
- else:
- raise MigrationError(OPTION_MISSING, name="-o", usage=Parser.get_usage())
-
- return Options, InputFile
-
-# This acts like the main() function for the script, unless it is 'import'ed
-# into another script.
-if __name__ == '__main__':
- pass
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
deleted file mode 100644
index afdfb93ad6..0000000000
--- a/BaseTools/Source/Python/Common/Misc.py
+++ /dev/null
@@ -1,1690 +0,0 @@
-## @file
-# Common routines used by all tools
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import sys
-import string
-import thread
-import threading
-import time
-import re
-import cPickle
-import array
-from UserDict import IterableUserDict
-from UserList import UserList
-
-from Common import EdkLogger as EdkLogger
-from Common import GlobalData as GlobalData
-from DataType import *
-from BuildToolError import *
-from CommonDataClass.DataClass import *
-
-## Regular expression used to find out place holders in string template
-gPlaceholderPattern = re.compile("\$\{([^$()\s]+)\}", re.MULTILINE|re.UNICODE)
-
-## Dictionary used to store file time stamp for quick re-access
-gFileTimeStampCache = {} # {file path : file time stamp}
-
-## Dictionary used to store dependencies of files
-gDependencyDatabase = {} # arch : {file path : [dependent files list]}
-
-## callback routine for processing variable option
-#
-# This function can be used to process variable number of option values. The
-# typical usage of it is specify architecure list on command line.
-# (e.g. <tool> -a IA32 X64 IPF)
-#
-# @param Option Standard callback function parameter
-# @param OptionString Standard callback function parameter
-# @param Value Standard callback function parameter
-# @param Parser Standard callback function parameter
-#
-# @retval
-#
-def ProcessVariableArgument(Option, OptionString, Value, Parser):
- assert Value is None
- Value = []
- RawArgs = Parser.rargs
- while RawArgs:
- Arg = RawArgs[0]
- if (Arg[:2] == "--" and len(Arg) > 2) or \
- (Arg[:1] == "-" and len(Arg) > 1 and Arg[1] != "-"):
- break
- Value.append(Arg)
- del RawArgs[0]
- setattr(Parser.values, Option.dest, Value)
-
-## Convert GUID string in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx style to C structure style
-#
-# @param Guid The GUID string
-#
-# @retval string The GUID string in C structure style
-#
-def GuidStringToGuidStructureString(Guid):
- GuidList = Guid.split('-')
- Result = '{'
- for Index in range(0,3,1):
- Result = Result + '0x' + GuidList[Index] + ', '
- Result = Result + '{0x' + GuidList[3][0:2] + ', 0x' + GuidList[3][2:4]
- for Index in range(0,12,2):
- Result = Result + ', 0x' + GuidList[4][Index:Index+2]
- Result += '}}'
- return Result
-
-## Convert GUID structure in byte array to xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
-#
-# @param GuidValue The GUID value in byte array
-#
-# @retval string The GUID value in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format
-#
-def GuidStructureByteArrayToGuidString(GuidValue):
- guidValueString = GuidValue.lower().replace("{", "").replace("}", "").replace(" ", "").replace(";", "")
- guidValueList = guidValueString.split(",")
- if len(guidValueList) != 16:
- return ''
- #EdkLogger.error(None, None, "Invalid GUID value string %s" % GuidValue)
- try:
- return "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x" % (
- int(guidValueList[3], 16),
- int(guidValueList[2], 16),
- int(guidValueList[1], 16),
- int(guidValueList[0], 16),
- int(guidValueList[5], 16),
- int(guidValueList[4], 16),
- int(guidValueList[7], 16),
- int(guidValueList[6], 16),
- int(guidValueList[8], 16),
- int(guidValueList[9], 16),
- int(guidValueList[10], 16),
- int(guidValueList[11], 16),
- int(guidValueList[12], 16),
- int(guidValueList[13], 16),
- int(guidValueList[14], 16),
- int(guidValueList[15], 16)
- )
- except:
- return ''
-
-## Convert GUID string in C structure style to xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
-#
-# @param GuidValue The GUID value in C structure format
-#
-# @retval string The GUID value in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format
-#
-def GuidStructureStringToGuidString(GuidValue):
- guidValueString = GuidValue.lower().replace("{", "").replace("}", "").replace(" ", "").replace(";", "")
- guidValueList = guidValueString.split(",")
- if len(guidValueList) != 11:
- return ''
- #EdkLogger.error(None, None, "Invalid GUID value string %s" % GuidValue)
- try:
- return "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" % (
- int(guidValueList[0], 16),
- int(guidValueList[1], 16),
- int(guidValueList[2], 16),
- int(guidValueList[3], 16),
- int(guidValueList[4], 16),
- int(guidValueList[5], 16),
- int(guidValueList[6], 16),
- int(guidValueList[7], 16),
- int(guidValueList[8], 16),
- int(guidValueList[9], 16),
- int(guidValueList[10], 16)
- )
- except:
- return ''
-
-## Convert GUID string in C structure style to xxxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx
-#
-# @param GuidValue The GUID value in C structure format
-#
-# @retval string The GUID value in xxxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx format
-#
-def GuidStructureStringToGuidValueName(GuidValue):
- guidValueString = GuidValue.lower().replace("{", "").replace("}", "").replace(" ", "")
- guidValueList = guidValueString.split(",")
- if len(guidValueList) != 11:
- EdkLogger.error(None, FORMAT_INVALID, "Invalid GUID value string [%s]" % GuidValue)
- return "%08x_%04x_%04x_%02x%02x_%02x%02x%02x%02x%02x%02x" % (
- int(guidValueList[0], 16),
- int(guidValueList[1], 16),
- int(guidValueList[2], 16),
- int(guidValueList[3], 16),
- int(guidValueList[4], 16),
- int(guidValueList[5], 16),
- int(guidValueList[6], 16),
- int(guidValueList[7], 16),
- int(guidValueList[8], 16),
- int(guidValueList[9], 16),
- int(guidValueList[10], 16)
- )
-
-## Create directories
-#
-# @param Directory The directory name
-#
-def CreateDirectory(Directory):
- if Directory == None or Directory.strip() == "":
- return True
- try:
- if not os.access(Directory, os.F_OK):
- os.makedirs(Directory)
- except:
- return False
- return True
-
-## Remove directories, including files and sub-directories in it
-#
-# @param Directory The directory name
-#
-def RemoveDirectory(Directory, Recursively=False):
- if Directory == None or Directory.strip() == "" or not os.path.exists(Directory):
- return
- if Recursively:
- CurrentDirectory = os.getcwd()
- os.chdir(Directory)
- for File in os.listdir("."):
- if os.path.isdir(File):
- RemoveDirectory(File, Recursively)
- else:
- os.remove(File)
- os.chdir(CurrentDirectory)
- os.rmdir(Directory)
-
-## Check if given file is changed or not
-#
-# This method is used to check if a file is changed or not between two build
-# actions. It makes use a cache to store files timestamp.
-#
-# @param File The path of file
-#
-# @retval True If the given file is changed, doesn't exist, or can't be
-# found in timestamp cache
-# @retval False If the given file is changed
-#
-def IsChanged(File):
- if not os.path.exists(File):
- return True
-
- FileState = os.stat(File)
- TimeStamp = FileState[-2]
-
- if File in gFileTimeStampCache and TimeStamp == gFileTimeStampCache[File]:
- FileChanged = False
- else:
- FileChanged = True
- gFileTimeStampCache[File] = TimeStamp
-
- return FileChanged
-
-## Store content in file
-#
-# This method is used to save file only when its content is changed. This is
-# quite useful for "make" system to decide what will be re-built and what won't.
-#
-# @param File The path of file
-# @param Content The new content of the file
-# @param IsBinaryFile The flag indicating if the file is binary file or not
-#
-# @retval True If the file content is changed and the file is renewed
-# @retval False If the file content is the same
-#
-def SaveFileOnChange(File, Content, IsBinaryFile=True):
- if not IsBinaryFile:
- Content = Content.replace("\n", os.linesep)
-
- if os.path.exists(File):
- try:
- if Content == open(File, "rb").read():
- return False
- except:
- EdkLogger.error(None, FILE_OPEN_FAILURE, ExtraData=File)
-
- DirName = os.path.dirname(File)
- if not CreateDirectory(DirName):
- EdkLogger.error(None, FILE_CREATE_FAILURE, "Could not create directory %s" % DirName)
- else:
- if DirName == '':
- DirName = os.getcwd()
- if not os.access(DirName, os.W_OK):
- EdkLogger.error(None, PERMISSION_FAILURE, "Do not have write permission on directory %s" % DirName)
-
- try:
- if GlobalData.gIsWindows:
- try:
- from PyUtility import SaveFileToDisk
- if not SaveFileToDisk(File, Content):
- EdkLogger.error(None, FILE_CREATE_FAILURE, ExtraData=File)
- except:
- Fd = open(File, "wb")
- Fd.write(Content)
- Fd.close()
- else:
- Fd = open(File, "wb")
- Fd.write(Content)
- Fd.close()
- except IOError, X:
- EdkLogger.error(None, FILE_CREATE_FAILURE, ExtraData='IOError %s'%X)
-
- return True
-
-## Make a Python object persistent on file system
-#
-# @param Data The object to be stored in file
-# @param File The path of file to store the object
-#
-def DataDump(Data, File):
- Fd = None
- try:
- Fd = open(File, 'wb')
- cPickle.dump(Data, Fd, cPickle.HIGHEST_PROTOCOL)
- except:
- EdkLogger.error("", FILE_OPEN_FAILURE, ExtraData=File, RaiseError=False)
- finally:
- if Fd != None:
- Fd.close()
-
-## Restore a Python object from a file
-#
-# @param File The path of file stored the object
-#
-# @retval object A python object
-# @retval None If failure in file operation
-#
-def DataRestore(File):
- Data = None
- Fd = None
- try:
- Fd = open(File, 'rb')
- Data = cPickle.load(Fd)
- except Exception, e:
- EdkLogger.verbose("Failed to load [%s]\n\t%s" % (File, str(e)))
- Data = None
- finally:
- if Fd != None:
- Fd.close()
- return Data
-
-## Retrieve and cache the real path name in file system
-#
-# @param Root The root directory of path relative to
-#
-# @retval str The path string if the path exists
-# @retval None If path doesn't exist
-#
-class DirCache:
- _CACHE_ = set()
- _UPPER_CACHE_ = {}
-
- def __init__(self, Root):
- self._Root = Root
- for F in os.listdir(Root):
- self._CACHE_.add(F)
- self._UPPER_CACHE_[F.upper()] = F
-
- # =[] operator
- def __getitem__(self, Path):
- Path = Path[len(os.path.commonprefix([Path, self._Root])):]
- if not Path:
- return self._Root
- if Path and Path[0] == os.path.sep:
- Path = Path[1:]
- if Path in self._CACHE_:
- return os.path.join(self._Root, Path)
- UpperPath = Path.upper()
- if UpperPath in self._UPPER_CACHE_:
- return os.path.join(self._Root, self._UPPER_CACHE_[UpperPath])
-
- IndexList = []
- LastSepIndex = -1
- SepIndex = Path.find(os.path.sep)
- while SepIndex > -1:
- Parent = UpperPath[:SepIndex]
- if Parent not in self._UPPER_CACHE_:
- break
- LastSepIndex = SepIndex
- SepIndex = Path.find(os.path.sep, LastSepIndex + 1)
-
- if LastSepIndex == -1:
- return None
-
- Cwd = os.getcwd()
- os.chdir(self._Root)
- SepIndex = LastSepIndex
- while SepIndex > -1:
- Parent = Path[:SepIndex]
- ParentKey = UpperPath[:SepIndex]
- if ParentKey not in self._UPPER_CACHE_:
- os.chdir(Cwd)
- return None
-
- if Parent in self._CACHE_:
- ParentDir = Parent
- else:
- ParentDir = self._UPPER_CACHE_[ParentKey]
- for F in os.listdir(ParentDir):
- Dir = os.path.join(ParentDir, F)
- self._CACHE_.add(Dir)
- self._UPPER_CACHE_[Dir.upper()] = Dir
-
- SepIndex = Path.find(os.path.sep, SepIndex + 1)
-
- os.chdir(Cwd)
- if Path in self._CACHE_:
- return os.path.join(self._Root, Path)
- elif UpperPath in self._UPPER_CACHE_:
- return os.path.join(self._Root, self._UPPER_CACHE_[UpperPath])
- return None
-
-## Get all files of a directory
-#
-# @param Root: Root dir
-# @param SkipList : The files need be skipped
-#
-# @retval A list of all files
-#
-def GetFiles(Root, SkipList=None, FullPath = True):
- OriPath = Root
- FileList = []
- for Root, Dirs, Files in os.walk(Root):
- if SkipList:
- for Item in SkipList:
- if Item in Dirs:
- Dirs.remove(Item)
-
- for File in Files:
- File = os.path.normpath(os.path.join(Root, File))
- if not FullPath:
- File = File[len(OriPath) + 1:]
- FileList.append(File)
-
- return FileList
-
-## Check if gvien file exists or not
-#
-# @param File File name or path to be checked
-# @param Dir The directory the file is relative to
-#
-# @retval True if file exists
-# @retval False if file doesn't exists
-#
-def ValidFile(File, Ext=None):
- if Ext != None:
- Dummy, FileExt = os.path.splitext(File)
- if FileExt.lower() != Ext.lower():
- return False
- if not os.path.exists(File):
- return False
- return True
-
-def RealPath(File, Dir='', OverrideDir=''):
- NewFile = os.path.normpath(os.path.join(Dir, File))
- NewFile = GlobalData.gAllFiles[NewFile]
- if not NewFile and OverrideDir:
- NewFile = os.path.normpath(os.path.join(OverrideDir, File))
- NewFile = GlobalData.gAllFiles[NewFile]
- return NewFile
-
-def RealPath2(File, Dir='', OverrideDir=''):
- if OverrideDir:
- NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))]
- if NewFile:
- if OverrideDir[-1] == os.path.sep:
- return NewFile[len(OverrideDir):], NewFile[0:len(OverrideDir)]
- else:
- return NewFile[len(OverrideDir)+1:], NewFile[0:len(OverrideDir)]
- if GlobalData.gAllFiles:
- NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(Dir, File))]
- else:
- NewFile = os.path.normpath(os.path.join(Dir, File))
- if NewFile:
- if Dir:
- if Dir[-1] == os.path.sep:
- return NewFile[len(Dir):], NewFile[0:len(Dir)]
- else:
- return NewFile[len(Dir)+1:], NewFile[0:len(Dir)]
- else:
- return NewFile, ''
-
- return None, None
-
-## Check if gvien file exists or not
-#
-#
-def ValidFile2(AllFiles, File, Ext=None, Workspace='', EfiSource='', EdkSource='', Dir='.', OverrideDir=''):
- NewFile = File
- if Ext != None:
- Dummy, FileExt = os.path.splitext(File)
- if FileExt.lower() != Ext.lower():
- return False, File
-
- # Replace the Edk macros
- if OverrideDir != '' and OverrideDir != None:
- if OverrideDir.find('$(EFI_SOURCE)') > -1:
- OverrideDir = OverrideDir.replace('$(EFI_SOURCE)', EfiSource)
- if OverrideDir.find('$(EDK_SOURCE)') > -1:
- OverrideDir = OverrideDir.replace('$(EDK_SOURCE)', EdkSource)
-
- # Replace the default dir to current dir
- if Dir == '.':
- Dir = os.getcwd()
- Dir = Dir[len(Workspace)+1:]
-
- # First check if File has Edk definition itself
- if File.find('$(EFI_SOURCE)') > -1 or File.find('$(EDK_SOURCE)') > -1:
- NewFile = File.replace('$(EFI_SOURCE)', EfiSource)
- NewFile = NewFile.replace('$(EDK_SOURCE)', EdkSource)
- NewFile = AllFiles[os.path.normpath(NewFile)]
- if NewFile != None:
- return True, NewFile
-
- # Second check the path with override value
- if OverrideDir != '' and OverrideDir != None:
- NewFile = AllFiles[os.path.normpath(os.path.join(OverrideDir, File))]
- if NewFile != None:
- return True, NewFile
-
- # Last check the path with normal definitions
- File = os.path.join(Dir, File)
- NewFile = AllFiles[os.path.normpath(File)]
- if NewFile != None:
- return True, NewFile
-
- return False, File
-
-## Check if gvien file exists or not
-#
-#
-def ValidFile3(AllFiles, File, Workspace='', EfiSource='', EdkSource='', Dir='.', OverrideDir=''):
- # Replace the Edk macros
- if OverrideDir != '' and OverrideDir != None:
- if OverrideDir.find('$(EFI_SOURCE)') > -1:
- OverrideDir = OverrideDir.replace('$(EFI_SOURCE)', EfiSource)
- if OverrideDir.find('$(EDK_SOURCE)') > -1:
- OverrideDir = OverrideDir.replace('$(EDK_SOURCE)', EdkSource)
-
- # Replace the default dir to current dir
- # Dir is current module dir related to workspace
- if Dir == '.':
- Dir = os.getcwd()
- Dir = Dir[len(Workspace)+1:]
-
- NewFile = File
- RelaPath = AllFiles[os.path.normpath(Dir)]
- NewRelaPath = RelaPath
-
- while(True):
- # First check if File has Edk definition itself
- if File.find('$(EFI_SOURCE)') > -1 or File.find('$(EDK_SOURCE)') > -1:
- File = File.replace('$(EFI_SOURCE)', EfiSource)
- File = File.replace('$(EDK_SOURCE)', EdkSource)
- NewFile = AllFiles[os.path.normpath(File)]
- if NewFile != None:
- NewRelaPath = os.path.dirname(NewFile)
- File = os.path.basename(NewFile)
- #NewRelaPath = NewFile[:len(NewFile) - len(File.replace("..\\", '').replace("../", '')) - 1]
- break
-
- # Second check the path with override value
- if OverrideDir != '' and OverrideDir != None:
- NewFile = AllFiles[os.path.normpath(os.path.join(OverrideDir, File))]
- if NewFile != None:
- #NewRelaPath = os.path.dirname(NewFile)
- NewRelaPath = NewFile[:len(NewFile) - len(File.replace("..\\", '').replace("../", '')) - 1]
- break
-
- # Last check the path with normal definitions
- NewFile = AllFiles[os.path.normpath(os.path.join(Dir, File))]
- if NewFile != None:
- break
-
- # No file found
- break
-
- return NewRelaPath, RelaPath, File
-
-
-def GetRelPath(Path1, Path2):
- FileName = os.path.basename(Path2)
- L1 = os.path.normpath(Path1).split(os.path.normpath('/'))
- L2 = os.path.normpath(Path2).split(os.path.normpath('/'))
- for Index in range(0, len(L1)):
- if L1[Index] != L2[Index]:
- FileName = '../' * (len(L1) - Index)
- for Index2 in range(Index, len(L2)):
- FileName = os.path.join(FileName, L2[Index2])
- break
- return os.path.normpath(FileName)
-
-
-## Get GUID value from given packages
-#
-# @param CName The CName of the GUID
-# @param PackageList List of packages looking-up in
-#
-# @retval GuidValue if the CName is found in any given package
-# @retval None if the CName is not found in all given packages
-#
-def GuidValue(CName, PackageList):
- for P in PackageList:
- if CName in P.Guids:
- return P.Guids[CName]
- return None
-
-## Get Protocol value from given packages
-#
-# @param CName The CName of the GUID
-# @param PackageList List of packages looking-up in
-#
-# @retval GuidValue if the CName is found in any given package
-# @retval None if the CName is not found in all given packages
-#
-def ProtocolValue(CName, PackageList):
- for P in PackageList:
- if CName in P.Protocols:
- return P.Protocols[CName]
- return None
-
-## Get PPI value from given packages
-#
-# @param CName The CName of the GUID
-# @param PackageList List of packages looking-up in
-#
-# @retval GuidValue if the CName is found in any given package
-# @retval None if the CName is not found in all given packages
-#
-def PpiValue(CName, PackageList):
- for P in PackageList:
- if CName in P.Ppis:
- return P.Ppis[CName]
- return None
-
-## A string template class
-#
-# This class implements a template for string replacement. A string template
-# looks like following
-#
-# ${BEGIN} other_string ${placeholder_name} other_string ${END}
-#
-# The string between ${BEGIN} and ${END} will be repeated as many times as the
-# length of "placeholder_name", which is a list passed through a dict. The
-# "placeholder_name" is the key name of the dict. The ${BEGIN} and ${END} can
-# be not used and, in this case, the "placeholder_name" must not a list and it
-# will just be replaced once.
-#
-class TemplateString(object):
- _REPEAT_START_FLAG = "BEGIN"
- _REPEAT_END_FLAG = "END"
-
- class Section(object):
- _LIST_TYPES = [type([]), type(set()), type((0,))]
-
- def __init__(self, TemplateSection, PlaceHolderList):
- self._Template = TemplateSection
- self._PlaceHolderList = []
-
- # Split the section into sub-sections according to the position of placeholders
- if PlaceHolderList:
- self._SubSectionList = []
- SubSectionStart = 0
- #
- # The placeholders passed in must be in the format of
- #
- # PlaceHolderName, PlaceHolderStartPoint, PlaceHolderEndPoint
- #
- for PlaceHolder,Start,End in PlaceHolderList:
- self._SubSectionList.append(TemplateSection[SubSectionStart:Start])
- self._SubSectionList.append(TemplateSection[Start:End])
- self._PlaceHolderList.append(PlaceHolder)
- SubSectionStart = End
- if SubSectionStart < len(TemplateSection):
- self._SubSectionList.append(TemplateSection[SubSectionStart:])
- else:
- self._SubSectionList = [TemplateSection]
-
- def __str__(self):
- return self._Template + " : " + str(self._PlaceHolderList)
-
- def Instantiate(self, PlaceHolderValues):
- RepeatTime = -1
- RepeatPlaceHolders = {}
- NonRepeatPlaceHolders = {}
-
- for PlaceHolder in self._PlaceHolderList:
- if PlaceHolder not in PlaceHolderValues:
- continue
- Value = PlaceHolderValues[PlaceHolder]
- if type(Value) in self._LIST_TYPES:
- if RepeatTime < 0:
- RepeatTime = len(Value)
- elif RepeatTime != len(Value):
- EdkLogger.error(
- "TemplateString",
- PARAMETER_INVALID,
- "${%s} has different repeat time from others!" % PlaceHolder,
- ExtraData=str(self._Template)
- )
- RepeatPlaceHolders["${%s}" % PlaceHolder] = Value
- else:
- NonRepeatPlaceHolders["${%s}" % PlaceHolder] = Value
-
- if NonRepeatPlaceHolders:
- StringList = []
- for S in self._SubSectionList:
- if S not in NonRepeatPlaceHolders:
- StringList.append(S)
- else:
- StringList.append(str(NonRepeatPlaceHolders[S]))
- else:
- StringList = self._SubSectionList
-
- if RepeatPlaceHolders:
- TempStringList = []
- for Index in range(RepeatTime):
- for S in StringList:
- if S not in RepeatPlaceHolders:
- TempStringList.append(S)
- else:
- TempStringList.append(str(RepeatPlaceHolders[S][Index]))
- StringList = TempStringList
-
- return "".join(StringList)
-
- ## Constructor
- def __init__(self, Template=None):
- self.String = ''
- self.IsBinary = False
- self._Template = Template
- self._TemplateSectionList = self._Parse(Template)
-
- ## str() operator
- #
- # @retval string The string replaced
- #
- def __str__(self):
- return self.String
-
- ## Split the template string into fragments per the ${BEGIN} and ${END} flags
- #
- # @retval list A list of TemplateString.Section objects
- #
- def _Parse(self, Template):
- SectionStart = 0
- SearchFrom = 0
- MatchEnd = 0
- PlaceHolderList = []
- TemplateSectionList = []
- while Template:
- MatchObj = gPlaceholderPattern.search(Template, SearchFrom)
- if not MatchObj:
- if MatchEnd <= len(Template):
- TemplateSection = TemplateString.Section(Template[SectionStart:], PlaceHolderList)
- TemplateSectionList.append(TemplateSection)
- break
-
- MatchString = MatchObj.group(1)
- MatchStart = MatchObj.start()
- MatchEnd = MatchObj.end()
-
- if MatchString == self._REPEAT_START_FLAG:
- if MatchStart > SectionStart:
- TemplateSection = TemplateString.Section(Template[SectionStart:MatchStart], PlaceHolderList)
- TemplateSectionList.append(TemplateSection)
- SectionStart = MatchEnd
- PlaceHolderList = []
- elif MatchString == self._REPEAT_END_FLAG:
- TemplateSection = TemplateString.Section(Template[SectionStart:MatchStart], PlaceHolderList)
- TemplateSectionList.append(TemplateSection)
- SectionStart = MatchEnd
- PlaceHolderList = []
- else:
- PlaceHolderList.append((MatchString, MatchStart - SectionStart, MatchEnd - SectionStart))
- SearchFrom = MatchEnd
- return TemplateSectionList
-
- ## Replace the string template with dictionary of placeholders and append it to previous one
- #
- # @param AppendString The string template to append
- # @param Dictionary The placeholder dictionaries
- #
- def Append(self, AppendString, Dictionary=None):
- if Dictionary:
- SectionList = self._Parse(AppendString)
- self.String += "".join([S.Instantiate(Dictionary) for S in SectionList])
- else:
- self.String += AppendString
-
- ## Replace the string template with dictionary of placeholders
- #
- # @param Dictionary The placeholder dictionaries
- #
- # @retval str The string replaced with placeholder values
- #
- def Replace(self, Dictionary=None):
- return "".join([S.Instantiate(Dictionary) for S in self._TemplateSectionList])
-
-## Progress indicator class
-#
-# This class makes use of thread to print progress on console.
-#
-class Progressor:
- # for avoiding deadloop
- _StopFlag = None
- _ProgressThread = None
- _CheckInterval = 0.25
-
- ## Constructor
- #
- # @param OpenMessage The string printed before progress charaters
- # @param CloseMessage The string printed after progress charaters
- # @param ProgressChar The charater used to indicate the progress
- # @param Interval The interval in seconds between two progress charaters
- #
- def __init__(self, OpenMessage="", CloseMessage="", ProgressChar='.', Interval=1.0):
- self.PromptMessage = OpenMessage
- self.CodaMessage = CloseMessage
- self.ProgressChar = ProgressChar
- self.Interval = Interval
- if Progressor._StopFlag == None:
- Progressor._StopFlag = threading.Event()
-
- ## Start to print progress charater
- #
- # @param OpenMessage The string printed before progress charaters
- #
- def Start(self, OpenMessage=None):
- if OpenMessage != None:
- self.PromptMessage = OpenMessage
- Progressor._StopFlag.clear()
- if Progressor._ProgressThread == None:
- Progressor._ProgressThread = threading.Thread(target=self._ProgressThreadEntry)
- Progressor._ProgressThread.setDaemon(False)
- Progressor._ProgressThread.start()
-
- ## Stop printing progress charater
- #
- # @param CloseMessage The string printed after progress charaters
- #
- def Stop(self, CloseMessage=None):
- OriginalCodaMessage = self.CodaMessage
- if CloseMessage != None:
- self.CodaMessage = CloseMessage
- self.Abort()
- self.CodaMessage = OriginalCodaMessage
-
- ## Thread entry method
- def _ProgressThreadEntry(self):
- sys.stdout.write(self.PromptMessage + " ")
- sys.stdout.flush()
- TimeUp = 0.0
- while not Progressor._StopFlag.isSet():
- if TimeUp <= 0.0:
- sys.stdout.write(self.ProgressChar)
- sys.stdout.flush()
- TimeUp = self.Interval
- time.sleep(self._CheckInterval)
- TimeUp -= self._CheckInterval
- sys.stdout.write(" " + self.CodaMessage + "\n")
- sys.stdout.flush()
-
- ## Abort the progress display
- @staticmethod
- def Abort():
- if Progressor._StopFlag != None:
- Progressor._StopFlag.set()
- if Progressor._ProgressThread != None:
- Progressor._ProgressThread.join()
- Progressor._ProgressThread = None
-
-## A dict which can access its keys and/or values orderly
-#
-# The class implements a new kind of dict which its keys or values can be
-# accessed in the order they are added into the dict. It guarantees the order
-# by making use of an internal list to keep a copy of keys.
-#
-class sdict(IterableUserDict):
- ## Constructor
- def __init__(self):
- IterableUserDict.__init__(self)
- self._key_list = []
-
- ## [] operator
- def __setitem__(self, key, value):
- if key not in self._key_list:
- self._key_list.append(key)
- IterableUserDict.__setitem__(self, key, value)
-
- ## del operator
- def __delitem__(self, key):
- self._key_list.remove(key)
- IterableUserDict.__delitem__(self, key)
-
- ## used in "for k in dict" loop to ensure the correct order
- def __iter__(self):
- return self.iterkeys()
-
- ## len() support
- def __len__(self):
- return len(self._key_list)
-
- ## "in" test support
- def __contains__(self, key):
- return key in self._key_list
-
- ## indexof support
- def index(self, key):
- return self._key_list.index(key)
-
- ## insert support
- def insert(self, key, newkey, newvalue, order):
- index = self._key_list.index(key)
- if order == 'BEFORE':
- self._key_list.insert(index, newkey)
- IterableUserDict.__setitem__(self, newkey, newvalue)
- elif order == 'AFTER':
- self._key_list.insert(index + 1, newkey)
- IterableUserDict.__setitem__(self, newkey, newvalue)
-
- ## append support
- def append(self, sdict):
- for key in sdict:
- if key not in self._key_list:
- self._key_list.append(key)
- IterableUserDict.__setitem__(self, key, sdict[key])
-
- def has_key(self, key):
- return key in self._key_list
-
- ## Empty the dict
- def clear(self):
- self._key_list = []
- IterableUserDict.clear(self)
-
- ## Return a copy of keys
- def keys(self):
- keys = []
- for key in self._key_list:
- keys.append(key)
- return keys
-
- ## Return a copy of values
- def values(self):
- values = []
- for key in self._key_list:
- values.append(self[key])
- return values
-
- ## Return a copy of (key, value) list
- def items(self):
- items = []
- for key in self._key_list:
- items.append((key, self[key]))
- return items
-
- ## Iteration support
- def iteritems(self):
- return iter(self.items())
-
- ## Keys interation support
- def iterkeys(self):
- return iter(self.keys())
-
- ## Values interation support
- def itervalues(self):
- return iter(self.values())
-
- ## Return value related to a key, and remove the (key, value) from the dict
- def pop(self, key, *dv):
- value = None
- if key in self._key_list:
- value = self[key]
- self.__delitem__(key)
- elif len(dv) != 0 :
- value = kv[0]
- return value
-
- ## Return (key, value) pair, and remove the (key, value) from the dict
- def popitem(self):
- key = self._key_list[-1]
- value = self[key]
- self.__delitem__(key)
- return key, value
-
- def update(self, dict=None, **kwargs):
- if dict != None:
- for k, v in dict.items():
- self[k] = v
- if len(kwargs):
- for k, v in kwargs.items():
- self[k] = v
-
-## Dictionary with restricted keys
-#
-class rdict(dict):
- ## Constructor
- def __init__(self, KeyList):
- for Key in KeyList:
- dict.__setitem__(self, Key, "")
-
- ## []= operator
- def __setitem__(self, key, value):
- if key not in self:
- EdkLogger.error("RestrictedDict", ATTRIBUTE_SET_FAILURE, "Key [%s] is not allowed" % key,
- ExtraData=", ".join(dict.keys(self)))
- dict.__setitem__(self, key, value)
-
- ## =[] operator
- def __getitem__(self, key):
- if key not in self:
- return ""
- return dict.__getitem__(self, key)
-
- ## del operator
- def __delitem__(self, key):
- EdkLogger.error("RestrictedDict", ATTRIBUTE_ACCESS_DENIED, ExtraData="del")
-
- ## Empty the dict
- def clear(self):
- for Key in self:
- self.__setitem__(Key, "")
-
- ## Return value related to a key, and remove the (key, value) from the dict
- def pop(self, key, *dv):
- EdkLogger.error("RestrictedDict", ATTRIBUTE_ACCESS_DENIED, ExtraData="pop")
-
- ## Return (key, value) pair, and remove the (key, value) from the dict
- def popitem(self):
- EdkLogger.error("RestrictedDict", ATTRIBUTE_ACCESS_DENIED, ExtraData="popitem")
-
-## Dictionary using prioritized list as key
-#
-class tdict:
- _ListType = type([])
- _TupleType = type(())
- _Wildcard = 'COMMON'
- _ValidWildcardList = ['COMMON', 'DEFAULT', 'ALL', '*', 'PLATFORM']
-
- def __init__(self, _Single_=False, _Level_=2):
- self._Level_ = _Level_
- self.data = {}
- self._Single_ = _Single_
-
- # =[] operator
- def __getitem__(self, key):
- KeyType = type(key)
- RestKeys = None
- if KeyType == self._ListType or KeyType == self._TupleType:
- FirstKey = key[0]
- if len(key) > 1:
- RestKeys = key[1:]
- elif self._Level_ > 1:
- RestKeys = [self._Wildcard for i in range(0, self._Level_-1)]
- else:
- FirstKey = key
- if self._Level_ > 1:
- RestKeys = [self._Wildcard for i in range(0, self._Level_-1)]
-
- if FirstKey == None or str(FirstKey).upper() in self._ValidWildcardList:
- FirstKey = self._Wildcard
-
- if self._Single_:
- return self._GetSingleValue(FirstKey, RestKeys)
- else:
- return self._GetAllValues(FirstKey, RestKeys)
-
- def _GetSingleValue(self, FirstKey, RestKeys):
- Value = None
- #print "%s-%s" % (FirstKey, self._Level_) ,
- if self._Level_ > 1:
- if FirstKey == self._Wildcard:
- if FirstKey in self.data:
- Value = self.data[FirstKey][RestKeys]
- if Value == None:
- for Key in self.data:
- Value = self.data[Key][RestKeys]
- if Value != None: break
- else:
- if FirstKey in self.data:
- Value = self.data[FirstKey][RestKeys]
- if Value == None and self._Wildcard in self.data:
- #print "Value=None"
- Value = self.data[self._Wildcard][RestKeys]
- else:
- if FirstKey == self._Wildcard:
- if FirstKey in self.data:
- Value = self.data[FirstKey]
- if Value == None:
- for Key in self.data:
- Value = self.data[Key]
- if Value != None: break
- else:
- if FirstKey in self.data:
- Value = self.data[FirstKey]
- elif self._Wildcard in self.data:
- Value = self.data[self._Wildcard]
- return Value
-
- def _GetAllValues(self, FirstKey, RestKeys):
- Value = []
- if self._Level_ > 1:
- if FirstKey == self._Wildcard:
- for Key in self.data:
- Value += self.data[Key][RestKeys]
- else:
- if FirstKey in self.data:
- Value += self.data[FirstKey][RestKeys]
- if self._Wildcard in self.data:
- Value += self.data[self._Wildcard][RestKeys]
- else:
- if FirstKey == self._Wildcard:
- for Key in self.data:
- Value.append(self.data[Key])
- else:
- if FirstKey in self.data:
- Value.append(self.data[FirstKey])
- if self._Wildcard in self.data:
- Value.append(self.data[self._Wildcard])
- return Value
-
- ## []= operator
- def __setitem__(self, key, value):
- KeyType = type(key)
- RestKeys = None
- if KeyType == self._ListType or KeyType == self._TupleType:
- FirstKey = key[0]
- if len(key) > 1:
- RestKeys = key[1:]
- else:
- RestKeys = [self._Wildcard for i in range(0, self._Level_-1)]
- else:
- FirstKey = key
- if self._Level_ > 1:
- RestKeys = [self._Wildcard for i in range(0, self._Level_-1)]
-
- if FirstKey in self._ValidWildcardList:
- FirstKey = self._Wildcard
-
- if FirstKey not in self.data and self._Level_ > 0:
- self.data[FirstKey] = tdict(self._Single_, self._Level_ - 1)
-
- if self._Level_ > 1:
- self.data[FirstKey][RestKeys] = value
- else:
- self.data[FirstKey] = value
-
- def SetGreedyMode(self):
- self._Single_ = False
- if self._Level_ > 1:
- for Key in self.data:
- self.data[Key].SetGreedyMode()
-
- def SetSingleMode(self):
- self._Single_ = True
- if self._Level_ > 1:
- for Key in self.data:
- self.data[Key].SetSingleMode()
-
- def GetKeys(self, KeyIndex=0):
- assert KeyIndex >= 0
- if KeyIndex == 0:
- return set(self.data.keys())
- else:
- keys = set()
- for Key in self.data:
- keys |= self.data[Key].GetKeys(KeyIndex - 1)
- return keys
-
-## Boolean chain list
-#
-class Blist(UserList):
- def __init__(self, initlist=None):
- UserList.__init__(self, initlist)
- def __setitem__(self, i, item):
- if item not in [True, False]:
- if item == 0:
- item = False
- else:
- item = True
- self.data[i] = item
- def _GetResult(self):
- Value = True
- for item in self.data:
- Value &= item
- return Value
- Result = property(_GetResult)
-
-def ParseConsoleLog(Filename):
- Opr = open(os.path.normpath(Filename), 'r')
- Opw = open(os.path.normpath(Filename + '.New'), 'w+')
- for Line in Opr.readlines():
- if Line.find('.efi') > -1:
- Line = Line[Line.rfind(' ') : Line.rfind('.efi')].strip()
- Opw.write('%s\n' % Line)
-
- Opr.close()
- Opw.close()
-
-## AnalyzeDscPcd
-#
-# Analyze DSC PCD value, since there is no data type info in DSC
-# This fuction is used to match functions (AnalyzePcdData, AnalyzeHiiPcdData, AnalyzeVpdPcdData) used for retrieving PCD value from database
-# 1. Feature flag: TokenSpace.PcdCName|PcdValue
-# 2. Fix and Patch:TokenSpace.PcdCName|PcdValue[|MaxSize]
-# 3. Dynamic default:
-# TokenSpace.PcdCName|PcdValue[|VOID*[|MaxSize]]
-# TokenSpace.PcdCName|PcdValue
-# 4. Dynamic VPD:
-# TokenSpace.PcdCName|VpdOffset[|VpdValue]
-# TokenSpace.PcdCName|VpdOffset[|MaxSize[|VpdValue]]
-# 5. Dynamic HII:
-# TokenSpace.PcdCName|HiiString|VaiableGuid|VariableOffset[|HiiValue]
-# PCD value needs to be located in such kind of string, and the PCD value might be an expression in which
-# there might have "|" operator, also in string value.
-#
-# @param Setting: String contain information described above with "TokenSpace.PcdCName|" stripped
-# @param PcdType: PCD type: feature, fixed, dynamic default VPD HII
-# @param DataType: The datum type of PCD: VOID*, UNIT, BOOL
-# @retval:
-# ValueList: A List contain fields described above
-# IsValid: True if conforming EBNF, otherwise False
-# Index: The index where PcdValue is in ValueList
-#
-def AnalyzeDscPcd(Setting, PcdType, DataType=''):
- Setting = Setting.strip()
- # There might be escaped quote in a string: \", \\\"
- Data = Setting.replace('\\\\', '//').replace('\\\"', '\\\'')
- # There might be '|' in string and in ( ... | ... ), replace it with '-'
- NewStr = ''
- InStr = False
- Pair = 0
- for ch in Data:
- if ch == '"':
- InStr = not InStr
- elif ch == '(' and not InStr:
- Pair += 1
- elif ch == ')' and not InStr:
- Pair -= 1
-
- if (Pair > 0 or InStr) and ch == TAB_VALUE_SPLIT:
- NewStr += '-'
- else:
- NewStr += ch
- FieldList = []
- StartPos = 0
- while True:
- Pos = NewStr.find(TAB_VALUE_SPLIT, StartPos)
- if Pos < 0:
- FieldList.append(Setting[StartPos:].strip())
- break
- FieldList.append(Setting[StartPos:Pos].strip())
- StartPos = Pos + 1
-
- IsValid = True
- if PcdType in (MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_FEATURE_FLAG):
- Value = FieldList[0]
- Size = ''
- if len(FieldList) > 1:
- Size = FieldList[1]
- if DataType == 'VOID*':
- IsValid = (len(FieldList) <= 2)
- else:
- IsValid = (len(FieldList) <= 1)
- return [Value, '', Size], IsValid, 0
- elif PcdType in (MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT):
- Value = FieldList[0]
- Size = Type = ''
- if len(FieldList) > 1:
- Type = FieldList[1]
- if len(FieldList) > 2:
- Size = FieldList[2]
- if DataType == 'VOID*':
- IsValid = (len(FieldList) <= 3)
- else:
- IsValid = (len(FieldList) <= 1)
- return [Value, Type, Size], IsValid, 0
- elif PcdType in (MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_VPD):
- VpdOffset = FieldList[0]
- Value = Size = ''
- if not DataType == 'VOID*':
- if len(FieldList) > 1:
- Value = FieldList[1]
- else:
- if len(FieldList) > 1:
- Size = FieldList[1]
- if len(FieldList) > 2:
- Value = FieldList[2]
- if DataType == 'VOID*':
- IsValid = (len(FieldList) <= 3)
- else:
- IsValid = (len(FieldList) <= 2)
- return [VpdOffset, Size, Value], IsValid, 2
- elif PcdType in (MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_HII):
- HiiString = FieldList[0]
- Guid = Offset = Value = ''
- if len(FieldList) > 1:
- Guid = FieldList[1]
- if len(FieldList) > 2:
- Offset = FieldList[2]
- if len(FieldList) > 3:
- Value = FieldList[3]
- IsValid = (3 <= len(FieldList) <= 4)
- return [HiiString, Guid, Offset, Value], IsValid, 3
- return [], False, 0
-
-## AnalyzePcdData
-#
-# Analyze the pcd Value, Datum type and TokenNumber.
-# Used to avoid split issue while the value string contain "|" character
-#
-# @param[in] Setting: A String contain value/datum type/token number information;
-#
-# @retval ValueList: A List contain value, datum type and toke number.
-#
-def AnalyzePcdData(Setting):
- ValueList = ['', '', '']
-
- ValueRe = re.compile(r'^\s*L?\".*\|.*\"')
- PtrValue = ValueRe.findall(Setting)
-
- ValueUpdateFlag = False
-
- if len(PtrValue) >= 1:
- Setting = re.sub(ValueRe, '', Setting)
- ValueUpdateFlag = True
-
- TokenList = Setting.split(TAB_VALUE_SPLIT)
- ValueList[0:len(TokenList)] = TokenList
-
- if ValueUpdateFlag:
- ValueList[0] = PtrValue[0]
-
- return ValueList
-
-## AnalyzeHiiPcdData
-#
-# Analyze the pcd Value, variable name, variable Guid and variable offset.
-# Used to avoid split issue while the value string contain "|" character
-#
-# @param[in] Setting: A String contain VariableName, VariableGuid, VariableOffset, DefaultValue information;
-#
-# @retval ValueList: A List contaian VariableName, VariableGuid, VariableOffset, DefaultValue.
-#
-def AnalyzeHiiPcdData(Setting):
- ValueList = ['', '', '', '']
-
- ValueRe = re.compile(r'^\s*L?\".*\|.*\"')
- PtrValue = ValueRe.findall(Setting)
-
- ValueUpdateFlag = False
-
- if len(PtrValue) >= 1:
- Setting = re.sub(ValueRe, '', Setting)
- ValueUpdateFlag = True
-
- TokenList = Setting.split(TAB_VALUE_SPLIT)
- ValueList[0:len(TokenList)] = TokenList
-
- if ValueUpdateFlag:
- ValueList[0] = PtrValue[0]
-
- return ValueList
-
-## AnalyzeVpdPcdData
-#
-# Analyze the vpd pcd VpdOffset, MaxDatumSize and InitialValue.
-# Used to avoid split issue while the value string contain "|" character
-#
-# @param[in] Setting: A String contain VpdOffset/MaxDatumSize/InitialValue information;
-#
-# @retval ValueList: A List contain VpdOffset, MaxDatumSize and InitialValue.
-#
-def AnalyzeVpdPcdData(Setting):
- ValueList = ['', '', '']
-
- ValueRe = re.compile(r'\s*L?\".*\|.*\"\s*$')
- PtrValue = ValueRe.findall(Setting)
-
- ValueUpdateFlag = False
-
- if len(PtrValue) >= 1:
- Setting = re.sub(ValueRe, '', Setting)
- ValueUpdateFlag = True
-
- TokenList = Setting.split(TAB_VALUE_SPLIT)
- ValueList[0:len(TokenList)] = TokenList
-
- if ValueUpdateFlag:
- ValueList[2] = PtrValue[0]
-
- return ValueList
-
-## check format of PCD value against its the datum type
-#
-# For PCD value setting
-#
-def CheckPcdDatum(Type, Value):
- if Type == "VOID*":
- ValueRe = re.compile(r'\s*L?\".*\"\s*$')
- if not (((Value.startswith('L"') or Value.startswith('"')) and Value.endswith('"'))
- or (Value.startswith('{') and Value.endswith('}'))
- ):
- return False, "Invalid value [%s] of type [%s]; must be in the form of {...} for array"\
- ", or \"...\" for string, or L\"...\" for unicode string" % (Value, Type)
- elif ValueRe.match(Value):
- # Check the chars in UnicodeString or CString is printable
- if Value.startswith("L"):
- Value = Value[2:-1]
- else:
- Value = Value[1:-1]
- Printset = set(string.printable)
- Printset.remove(TAB_PRINTCHAR_VT)
- Printset.add(TAB_PRINTCHAR_BS)
- Printset.add(TAB_PRINTCHAR_NUL)
- if not set(Value).issubset(Printset):
- PrintList = list(Printset)
- PrintList.sort()
- return False, "Invalid PCD string value of type [%s]; must be printable chars %s." % (Type, PrintList)
- elif Type == 'BOOLEAN':
- if Value not in ['TRUE', 'True', 'true', '0x1', '0x01', '1', 'FALSE', 'False', 'false', '0x0', '0x00', '0']:
- return False, "Invalid value [%s] of type [%s]; must be one of TRUE, True, true, 0x1, 0x01, 1"\
- ", FALSE, False, false, 0x0, 0x00, 0" % (Value, Type)
- elif Type in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64]:
- try:
- Value = long(Value, 0)
- except:
- return False, "Invalid value [%s] of type [%s];"\
- " must be a hexadecimal, decimal or octal in C language format." % (Value, Type)
- else:
- return False, "Invalid type [%s]; must be one of VOID*, BOOLEAN, UINT8, UINT16, UINT32, UINT64." % (Type)
-
- return True, ""
-
-## Split command line option string to list
-#
-# subprocess.Popen needs the args to be a sequence. Otherwise there's problem
-# in non-windows platform to launch command
-#
-def SplitOption(OptionString):
- OptionList = []
- LastChar = " "
- OptionStart = 0
- QuotationMark = ""
- for Index in range(0, len(OptionString)):
- CurrentChar = OptionString[Index]
- if CurrentChar in ['"', "'"]:
- if QuotationMark == CurrentChar:
- QuotationMark = ""
- elif QuotationMark == "":
- QuotationMark = CurrentChar
- continue
- elif QuotationMark:
- continue
-
- if CurrentChar in ["/", "-"] and LastChar in [" ", "\t", "\r", "\n"]:
- if Index > OptionStart:
- OptionList.append(OptionString[OptionStart:Index-1])
- OptionStart = Index
- LastChar = CurrentChar
- OptionList.append(OptionString[OptionStart:])
- return OptionList
-
-def CommonPath(PathList):
- P1 = min(PathList).split(os.path.sep)
- P2 = max(PathList).split(os.path.sep)
- for Index in xrange(min(len(P1), len(P2))):
- if P1[Index] != P2[Index]:
- return os.path.sep.join(P1[:Index])
- return os.path.sep.join(P1)
-
-class PathClass(object):
- def __init__(self, File='', Root='', AlterRoot='', Type='', IsBinary=False,
- Arch='COMMON', ToolChainFamily='', Target='', TagName='', ToolCode=''):
- self.Arch = Arch
- self.File = str(File)
- if os.path.isabs(self.File):
- self.Root = ''
- self.AlterRoot = ''
- else:
- self.Root = str(Root)
- self.AlterRoot = str(AlterRoot)
-
- # Remove any '.' and '..' in path
- if self.Root:
- self.Path = os.path.normpath(os.path.join(self.Root, self.File))
- self.Root = os.path.normpath(CommonPath([self.Root, self.Path]))
- # eliminate the side-effect of 'C:'
- if self.Root[-1] == ':':
- self.Root += os.path.sep
- # file path should not start with path separator
- if self.Root[-1] == os.path.sep:
- self.File = self.Path[len(self.Root):]
- else:
- self.File = self.Path[len(self.Root)+1:]
- else:
- self.Path = os.path.normpath(self.File)
-
- self.SubDir, self.Name = os.path.split(self.File)
- self.BaseName, self.Ext = os.path.splitext(self.Name)
-
- if self.Root:
- if self.SubDir:
- self.Dir = os.path.join(self.Root, self.SubDir)
- else:
- self.Dir = self.Root
- else:
- self.Dir = self.SubDir
-
- if IsBinary:
- self.Type = Type
- else:
- self.Type = self.Ext.lower()
-
- self.IsBinary = IsBinary
- self.Target = Target
- self.TagName = TagName
- self.ToolCode = ToolCode
- self.ToolChainFamily = ToolChainFamily
-
- self._Key = None
-
- ## Convert the object of this class to a string
- #
- # Convert member Path of the class to a string
- #
- # @retval string Formatted String
- #
- def __str__(self):
- return self.Path
-
- ## Override __eq__ function
- #
- # Check whether PathClass are the same
- #
- # @retval False The two PathClass are different
- # @retval True The two PathClass are the same
- #
- def __eq__(self, Other):
- if type(Other) == type(self):
- return self.Path == Other.Path
- else:
- return self.Path == str(Other)
-
- ## Override __cmp__ function
- #
- # Customize the comparsion operation of two PathClass
- #
- # @retval 0 The two PathClass are different
- # @retval -1 The first PathClass is less than the second PathClass
- # @retval 1 The first PathClass is Bigger than the second PathClass
- def __cmp__(self, Other):
- if type(Other) == type(self):
- OtherKey = Other.Path
- else:
- OtherKey = str(Other)
-
- SelfKey = self.Path
- if SelfKey == OtherKey:
- return 0
- elif SelfKey > OtherKey:
- return 1
- else:
- return -1
-
- ## Override __hash__ function
- #
- # Use Path as key in hash table
- #
- # @retval string Key for hash table
- #
- def __hash__(self):
- return hash(self.Path)
-
- def _GetFileKey(self):
- if self._Key == None:
- self._Key = self.Path.upper() # + self.ToolChainFamily + self.TagName + self.ToolCode + self.Target
- return self._Key
-
- def _GetTimeStamp(self):
- return os.stat(self.Path)[8]
-
- def Validate(self, Type='', CaseSensitive=True):
- if GlobalData.gCaseInsensitive:
- CaseSensitive = False
- if Type and Type.lower() != self.Type:
- return FILE_TYPE_MISMATCH, '%s (expect %s but got %s)' % (self.File, Type, self.Type)
-
- RealFile, RealRoot = RealPath2(self.File, self.Root, self.AlterRoot)
- if not RealRoot and not RealFile:
- RealFile = self.File
- if self.AlterRoot:
- RealFile = os.path.join(self.AlterRoot, self.File)
- elif self.Root:
- RealFile = os.path.join(self.Root, self.File)
- return FILE_NOT_FOUND, os.path.join(self.AlterRoot, RealFile)
-
- ErrorCode = 0
- ErrorInfo = ''
- if RealRoot != self.Root or RealFile != self.File:
- if CaseSensitive and (RealFile != self.File or (RealRoot != self.Root and RealRoot != self.AlterRoot)):
- ErrorCode = FILE_CASE_MISMATCH
- ErrorInfo = self.File + '\n\t' + RealFile + " [in file system]"
-
- self.SubDir, self.Name = os.path.split(RealFile)
- self.BaseName, self.Ext = os.path.splitext(self.Name)
- if self.SubDir:
- self.Dir = os.path.join(RealRoot, self.SubDir)
- else:
- self.Dir = RealRoot
- self.File = RealFile
- self.Root = RealRoot
- self.Path = os.path.join(RealRoot, RealFile)
- return ErrorCode, ErrorInfo
-
- Key = property(_GetFileKey)
- TimeStamp = property(_GetTimeStamp)
-
-## Parse PE image to get the required PE informaion.
-#
-class PeImageClass():
- ## Constructor
- #
- # @param File FilePath of PeImage
- #
- def __init__(self, PeFile):
- self.FileName = PeFile
- self.IsValid = False
- self.Size = 0
- self.EntryPoint = 0
- self.SectionAlignment = 0
- self.SectionHeaderList = []
- self.ErrorInfo = ''
- try:
- PeObject = open(PeFile, 'rb')
- except:
- self.ErrorInfo = self.FileName + ' can not be found\n'
- return
- # Read DOS header
- ByteArray = array.array('B')
- ByteArray.fromfile(PeObject, 0x3E)
- ByteList = ByteArray.tolist()
- # DOS signature should be 'MZ'
- if self._ByteListToStr (ByteList[0x0:0x2]) != 'MZ':
- self.ErrorInfo = self.FileName + ' has no valid DOS signature MZ'
- return
-
- # Read 4 byte PE Signature
- PeOffset = self._ByteListToInt(ByteList[0x3C:0x3E])
- PeObject.seek(PeOffset)
- ByteArray = array.array('B')
- ByteArray.fromfile(PeObject, 4)
- # PE signature should be 'PE\0\0'
- if ByteArray.tostring() != 'PE\0\0':
- self.ErrorInfo = self.FileName + ' has no valid PE signature PE00'
- return
-
- # Read PE file header
- ByteArray = array.array('B')
- ByteArray.fromfile(PeObject, 0x14)
- ByteList = ByteArray.tolist()
- SecNumber = self._ByteListToInt(ByteList[0x2:0x4])
- if SecNumber == 0:
- self.ErrorInfo = self.FileName + ' has no section header'
- return
-
- # Read PE optional header
- OptionalHeaderSize = self._ByteListToInt(ByteArray[0x10:0x12])
- ByteArray = array.array('B')
- ByteArray.fromfile(PeObject, OptionalHeaderSize)
- ByteList = ByteArray.tolist()
- self.EntryPoint = self._ByteListToInt(ByteList[0x10:0x14])
- self.SectionAlignment = self._ByteListToInt(ByteList[0x20:0x24])
- self.Size = self._ByteListToInt(ByteList[0x38:0x3C])
-
- # Read each Section Header
- for Index in range(SecNumber):
- ByteArray = array.array('B')
- ByteArray.fromfile(PeObject, 0x28)
- ByteList = ByteArray.tolist()
- SecName = self._ByteListToStr(ByteList[0:8])
- SecVirtualSize = self._ByteListToInt(ByteList[8:12])
- SecRawAddress = self._ByteListToInt(ByteList[20:24])
- SecVirtualAddress = self._ByteListToInt(ByteList[12:16])
- self.SectionHeaderList.append((SecName, SecVirtualAddress, SecRawAddress, SecVirtualSize))
- self.IsValid = True
- PeObject.close()
-
- def _ByteListToStr(self, ByteList):
- String = ''
- for index in range(len(ByteList)):
- if ByteList[index] == 0:
- break
- String += chr(ByteList[index])
- return String
-
- def _ByteListToInt(self, ByteList):
- Value = 0
- for index in range(len(ByteList) - 1, -1, -1):
- Value = (Value << 8) | int(ByteList[index])
- return Value
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- pass
-
diff --git a/BaseTools/Source/Python/Common/Parsing.py b/BaseTools/Source/Python/Common/Parsing.py
deleted file mode 100644
index 5bea6941fd..0000000000
--- a/BaseTools/Source/Python/Common/Parsing.py
+++ /dev/null
@@ -1,879 +0,0 @@
-## @file
-# This file is used to define common parsing related functions used in parsing INF/DEC/DSC process
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from String import *
-from CommonDataClass.DataClass import *
-from DataType import *
-
-## ParseDefineMacro
-#
-# Search whole table to find all defined Macro and replaced them with the real values
-#
-def ParseDefineMacro2(Table, RecordSets, GlobalMacro):
- Macros = {}
- #
- # Find all DEFINE macros in section [Header] and its section
- #
- SqlCommand = """select Value1, Value2, BelongsToItem, StartLine, Arch from %s
- where Model = %s
- and Enabled > -1""" % (Table.Table, MODEL_META_DATA_DEFINE)
- RecordSet = Table.Exec(SqlCommand)
- for Record in RecordSet:
- Macros[Record[0]] = Record[1]
-
- #
- # Overrided by Global Macros
- #
- for Key in GlobalMacro.keys():
- Macros[Key] = GlobalMacro[Key]
-
- #
- # Replace the Macros
- #
- for Key in RecordSets.keys():
- if RecordSets[Key] != []:
- for Item in RecordSets[Key]:
- Item[0] = ReplaceMacro(Item[0], Macros)
-
-## ParseDefineMacro
-#
-# Search whole table to find all defined Macro and replaced them with the real values
-#
-def ParseDefineMacro(Table, GlobalMacro):
- Macros = {}
- #
- # Find all DEFINE macros
- #
- SqlCommand = """select Value1, Value2, BelongsToItem, StartLine, Arch from %s
- where Model = %s
- and Enabled > -1""" % (Table.Table, MODEL_META_DATA_DEFINE)
- RecordSet = Table.Exec(SqlCommand)
- for Record in RecordSet:
-#***************************************************************************************************************************************************
-# The follow SqlCommand (expr replace) is not supported in Sqlite 3.3.4 which is used in Python 2.5 *
-# Reserved Only *
-# SqlCommand = """update %s set Value1 = replace(Value1, '%s', '%s') *
-# where ID in (select ID from %s *
-# where Model = %s *
-# and Value1 like '%%%s%%' *
-# and StartLine > %s *
-# and Enabled > -1 *
-# and Arch = '%s')""" % \ *
-# (self.TblDsc.Table, Record[0], Record[1], self.TblDsc.Table, Record[2], Record[1], Record[3], Record[4]) *
-#***************************************************************************************************************************************************
- Macros[Record[0]] = Record[1]
-
- #
- # Overrided by Global Macros
- #
- for Key in GlobalMacro.keys():
- Macros[Key] = GlobalMacro[Key]
-
- #
- # Found all defined macro and replaced
- #
- SqlCommand = """select ID, Value1 from %s
- where Model != %s
- and Value1 like '%%$(%%' and Value1 like '%%)%%'
- and Enabled > -1""" % (Table.Table, MODEL_META_DATA_DEFINE)
- FoundRecords = Table.Exec(SqlCommand)
- for FoundRecord in FoundRecords:
- NewValue = ReplaceMacro(FoundRecord[1], Macros)
- SqlCommand = """update %s set Value1 = '%s'
- where ID = %s""" % (Table.Table, ConvertToSqlString2(NewValue), FoundRecord[0])
- Table.Exec(SqlCommand)
-
-##QueryDefinesItem
-#
-# Search item of section [Defines] by name, return its values
-#
-# @param Table: The Table to be executed
-# @param Name: The Name of item of section [Defines]
-# @param Arch: The Arch of item of section [Defines]
-#
-# @retval RecordSet: A list of all matched records
-#
-def QueryDefinesItem(Table, Name, Arch, BelongsToFile):
- SqlCommand = """select Value2 from %s
- where Model = %s
- and Value1 = '%s'
- and Arch = '%s'
- and BelongsToFile = %s
- and Enabled > -1""" % (Table.Table, MODEL_META_DATA_HEADER, ConvertToSqlString2(Name), ConvertToSqlString2(Arch), BelongsToFile)
- RecordSet = Table.Exec(SqlCommand)
- if len(RecordSet) < 1:
- SqlCommand = """select Value2 from %s
- where Model = %s
- and Value1 = '%s'
- and Arch = '%s'
- and BelongsToFile = %s
- and Enabled > -1""" % (Table.Table, MODEL_META_DATA_HEADER, ConvertToSqlString2(Name), ConvertToSqlString2(TAB_ARCH_COMMON.upper()), BelongsToFile)
- RecordSet = Table.Exec(SqlCommand)
- if len(RecordSet) == 1:
- if Name == TAB_INF_DEFINES_LIBRARY_CLASS:
- return [RecordSet[0][0]]
- else:
- return GetSplitValueList(RecordSet[0][0])
- elif len(RecordSet) < 1:
- return ['']
- elif len(RecordSet) > 1:
- RetVal = []
- for Record in RecordSet:
- if Name == TAB_INF_DEFINES_LIBRARY_CLASS:
- RetVal.append(Record[0])
- else:
- Items = GetSplitValueList(Record[0])
- for Item in Items:
- RetVal.append(Item)
- return RetVal
-
-##QueryDefinesItem
-#
-# Search item of section [Defines] by name, return its values
-#
-# @param Table: The Table to be executed
-# @param Name: The Name of item of section [Defines]
-# @param Arch: The Arch of item of section [Defines]
-#
-# @retval RecordSet: A list of all matched records
-#
-def QueryDefinesItem2(Table, Arch, BelongsToFile):
- SqlCommand = """select Value1, Value2, StartLine from %s
- where Model = %s
- and Arch = '%s'
- and BelongsToFile = %s
- and Enabled > -1""" % (Table.Table, MODEL_META_DATA_HEADER, ConvertToSqlString2(Arch), BelongsToFile)
- RecordSet = Table.Exec(SqlCommand)
- if len(RecordSet) < 1:
- SqlCommand = """select Value1, Value2, StartLine from %s
- where Model = %s
- and Arch = '%s'
- and BelongsToFile = %s
- and Enabled > -1""" % (Table.Table, MODEL_META_DATA_HEADER, ConvertToSqlString2(TAB_ARCH_COMMON), BelongsToFile)
- RecordSet = Table.Exec(SqlCommand)
-
- return RecordSet
-
-##QueryDscItem
-#
-# Search all dsc item for a specific section
-#
-# @param Table: The Table to be executed
-# @param Model: The type of section
-#
-# @retval RecordSet: A list of all matched records
-#
-def QueryDscItem(Table, Model, BelongsToItem, BelongsToFile):
- SqlCommand = """select Value1, Arch, StartLine, ID, Value2 from %s
- where Model = %s
- and BelongsToItem = %s
- and BelongsToFile = %s
- and Enabled > -1""" % (Table.Table, Model, BelongsToItem, BelongsToFile)
- return Table.Exec(SqlCommand)
-
-##QueryDecItem
-#
-# Search all dec item for a specific section
-#
-# @param Table: The Table to be executed
-# @param Model: The type of section
-#
-# @retval RecordSet: A list of all matched records
-#
-def QueryDecItem(Table, Model, BelongsToItem):
- SqlCommand = """select Value1, Arch, StartLine, ID, Value2 from %s
- where Model = %s
- and BelongsToItem = %s
- and Enabled > -1""" % (Table.Table, Model, BelongsToItem)
- return Table.Exec(SqlCommand)
-
-##QueryInfItem
-#
-# Search all dec item for a specific section
-#
-# @param Table: The Table to be executed
-# @param Model: The type of section
-#
-# @retval RecordSet: A list of all matched records
-#
-def QueryInfItem(Table, Model, BelongsToItem):
- SqlCommand = """select Value1, Arch, StartLine, ID, Value2 from %s
- where Model = %s
- and BelongsToItem = %s
- and Enabled > -1""" % (Table.Table, Model, BelongsToItem)
- return Table.Exec(SqlCommand)
-
-## GetBuildOption
-#
-# Parse a string with format "[<Family>:]<ToolFlag>=Flag"
-# Return (Family, ToolFlag, Flag)
-#
-# @param String: String with BuildOption statement
-# @param File: The file which defines build option, used in error report
-#
-# @retval truple() A truple structure as (Family, ToolChain, Flag)
-#
-def GetBuildOption(String, File, LineNo = -1):
- (Family, ToolChain, Flag) = ('', '', '')
- if String.find(TAB_EQUAL_SPLIT) < 0:
- RaiseParserError(String, 'BuildOptions', File, '[<Family>:]<ToolFlag>=Flag', LineNo)
- else:
- List = GetSplitValueList(String, TAB_EQUAL_SPLIT, MaxSplit = 1)
- if List[0].find(':') > -1:
- Family = List[0][ : List[0].find(':')].strip()
- ToolChain = List[0][List[0].find(':') + 1 : ].strip()
- else:
- ToolChain = List[0].strip()
- Flag = List[1].strip()
- return (Family, ToolChain, Flag)
-
-## Get Library Class
-#
-# Get Library of Dsc as <LibraryClassKeyWord>|<LibraryInstance>
-#
-# @param Item: String as <LibraryClassKeyWord>|<LibraryInstance>
-# @param ContainerFile: The file which describes the library class, used for error report
-#
-# @retval (LibraryClassKeyWord, LibraryInstance, [SUP_MODULE_LIST]) Formatted Library Item
-#
-def GetLibraryClass(Item, ContainerFile, WorkspaceDir, LineNo = -1):
- List = GetSplitValueList(Item[0])
- SupMod = SUP_MODULE_LIST_STRING
- if len(List) != 2:
- RaiseParserError(Item[0], 'LibraryClasses', ContainerFile, '<LibraryClassKeyWord>|<LibraryInstance>')
- else:
- CheckFileType(List[1], '.Inf', ContainerFile, 'library class instance', Item[0], LineNo)
- CheckFileExist(WorkspaceDir, List[1], ContainerFile, 'LibraryClasses', Item[0], LineNo)
- if Item[1] != '':
- SupMod = Item[1]
-
- return (List[0], List[1], SupMod)
-
-## Get Library Class
-#
-# Get Library of Dsc as <LibraryClassKeyWord>[|<LibraryInstance>][|<TokenSpaceGuidCName>.<PcdCName>]
-#
-# @param Item: String as <LibraryClassKeyWord>|<LibraryInstance>
-# @param ContainerFile: The file which describes the library class, used for error report
-#
-# @retval (LibraryClassKeyWord, LibraryInstance, [SUP_MODULE_LIST]) Formatted Library Item
-#
-def GetLibraryClassOfInf(Item, ContainerFile, WorkspaceDir, LineNo = -1):
- ItemList = GetSplitValueList((Item[0] + DataType.TAB_VALUE_SPLIT * 2))
- SupMod = SUP_MODULE_LIST_STRING
-
- if len(ItemList) > 5:
- RaiseParserError(Item[0], 'LibraryClasses', ContainerFile, '<LibraryClassKeyWord>[|<LibraryInstance>][|<TokenSpaceGuidCName>.<PcdCName>]')
- else:
- CheckFileType(ItemList[1], '.Inf', ContainerFile, 'LibraryClasses', Item[0], LineNo)
- CheckFileExist(WorkspaceDir, ItemList[1], ContainerFile, 'LibraryClasses', Item[0], LineNo)
- if ItemList[2] != '':
- CheckPcdTokenInfo(ItemList[2], 'LibraryClasses', ContainerFile, LineNo)
- if Item[1] != '':
- SupMod = Item[1]
-
- return (ItemList[0], ItemList[1], ItemList[2], SupMod)
-
-## CheckPcdTokenInfo
-#
-# Check if PcdTokenInfo is following <TokenSpaceGuidCName>.<PcdCName>
-#
-# @param TokenInfoString: String to be checked
-# @param Section: Used for error report
-# @param File: Used for error report
-#
-# @retval True PcdTokenInfo is in correct format
-#
-def CheckPcdTokenInfo(TokenInfoString, Section, File, LineNo = -1):
- Format = '<TokenSpaceGuidCName>.<PcdCName>'
- if TokenInfoString != '' and TokenInfoString != None:
- TokenInfoList = GetSplitValueList(TokenInfoString, TAB_SPLIT)
- if len(TokenInfoList) == 2:
- return True
-
- RaiseParserError(TokenInfoString, Section, File, Format, LineNo)
-
-## Get Pcd
-#
-# Get Pcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<Type>|<MaximumDatumSize>]
-#
-# @param Item: String as <PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<Type>|<MaximumDatumSize>]
-# @param ContainerFile: The file which describes the pcd, used for error report
-#
-# @retval (TokenInfo[1], TokenInfo[0], List[1], List[2], List[3], Type)
-#
-def GetPcd(Item, Type, ContainerFile, LineNo = -1):
- TokenGuid, TokenName, Value, MaximumDatumSize, Token = '', '', '', '', ''
- List = GetSplitValueList(Item + TAB_VALUE_SPLIT * 2)
-
- if len(List) < 4 or len(List) > 6:
- RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '<PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<Type>|<MaximumDatumSize>]', LineNo)
- else:
- Value = List[1]
- MaximumDatumSize = List[2]
- Token = List[3]
-
- if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):
- (TokenGuid, TokenName) = GetSplitValueList(List[0], TAB_SPLIT)
-
- return (TokenName, TokenGuid, Value, MaximumDatumSize, Token, Type)
-
-## Get FeatureFlagPcd
-#
-# Get FeatureFlagPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE
-#
-# @param Item: String as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE
-# @param ContainerFile: The file which describes the pcd, used for error report
-#
-# @retval (TokenInfo[1], TokenInfo[0], List[1], Type)
-#
-def GetFeatureFlagPcd(Item, Type, ContainerFile, LineNo = -1):
- TokenGuid, TokenName, Value = '', '', ''
- List = GetSplitValueList(Item)
- if len(List) != 2:
- RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '<PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE', LineNo)
- else:
- Value = List[1]
- if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):
- (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)
-
- return (TokenName, TokenGuid, Value, Type)
-
-## Get DynamicDefaultPcd
-#
-# Get DynamicDefaultPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<DatumTyp>[|<MaxDatumSize>]]
-#
-# @param Item: String as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE
-# @param ContainerFile: The file which describes the pcd, used for error report
-#
-# @retval (TokenInfo[1], TokenInfo[0], List[1], List[2], List[3], Type)
-#
-def GetDynamicDefaultPcd(Item, Type, ContainerFile, LineNo = -1):
- TokenGuid, TokenName, Value, DatumTyp, MaxDatumSize = '', '', '', '', ''
- List = GetSplitValueList(Item + TAB_VALUE_SPLIT * 2)
- if len(List) < 4 or len(List) > 8:
- RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '<PcdTokenSpaceGuidCName>.<TokenCName>|<Value>[|<DatumTyp>[|<MaxDatumSize>]]', LineNo)
- else:
- Value = List[1]
- DatumTyp = List[2]
- MaxDatumSize = List[3]
- if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):
- (TokenGuid, TokenName) = GetSplitValueList(List[0], TAB_SPLIT)
-
- return (TokenName, TokenGuid, Value, DatumTyp, MaxDatumSize, Type)
-
-## Get DynamicHiiPcd
-#
-# Get DynamicHiiPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<String>|<VariableGuidCName>|<VariableOffset>[|<DefaultValue>[|<MaximumDatumSize>]]
-#
-# @param Item: String as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE
-# @param ContainerFile: The file which describes the pcd, used for error report
-#
-# @retval (TokenInfo[1], TokenInfo[0], List[1], List[2], List[3], List[4], List[5], Type)
-#
-def GetDynamicHiiPcd(Item, Type, ContainerFile, LineNo = -1):
- TokenGuid, TokenName, L1, L2, L3, L4, L5 = '', '', '', '', '', '', ''
- List = GetSplitValueList(Item + TAB_VALUE_SPLIT * 2)
- if len(List) < 6 or len(List) > 8:
- RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '<PcdTokenSpaceGuidCName>.<TokenCName>|<String>|<VariableGuidCName>|<VariableOffset>[|<DefaultValue>[|<MaximumDatumSize>]]', LineNo)
- else:
- L1, L2, L3, L4, L5 = List[1], List[2], List[3], List[4], List[5]
- if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):
- (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)
-
- return (TokenName, TokenGuid, L1, L2, L3, L4, L5, Type)
-
-## Get DynamicVpdPcd
-#
-# Get DynamicVpdPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<VpdOffset>[|<MaximumDatumSize>]
-#
-# @param Item: String as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE
-# @param ContainerFile: The file which describes the pcd, used for error report
-#
-# @retval (TokenInfo[1], TokenInfo[0], List[1], List[2], Type)
-#
-def GetDynamicVpdPcd(Item, Type, ContainerFile, LineNo = -1):
- TokenGuid, TokenName, L1, L2 = '', '', '', ''
- List = GetSplitValueList(Item + TAB_VALUE_SPLIT)
- if len(List) < 3 or len(List) > 4:
- RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '<PcdTokenSpaceGuidCName>.<TokenCName>|<VpdOffset>[|<MaximumDatumSize>]', LineNo)
- else:
- L1, L2 = List[1], List[2]
- if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):
- (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)
-
- return (TokenName, TokenGuid, L1, L2, Type)
-
-## GetComponent
-#
-# Parse block of the components defined in dsc file
-# Set KeyValues as [ ['component name', [lib1, lib2, lib3], [bo1, bo2, bo3], [pcd1, pcd2, pcd3]], ...]
-#
-# @param Lines: The content to be parsed
-# @param KeyValues: To store data after parsing
-#
-# @retval True Get component successfully
-#
-def GetComponent(Lines, KeyValues):
- (findBlock, findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, False, False, False, False)
- ListItem = None
- LibraryClassItem = []
- BuildOption = []
- Pcd = []
-
- for Line in Lines:
- Line = Line[0]
-
- #
- # Ignore !include statement
- #
- if Line.upper().find(TAB_INCLUDE.upper() + ' ') > -1 or Line.upper().find(TAB_DEFINE + ' ') > -1:
- continue
-
- if findBlock == False:
- ListItem = Line
- #
- # find '{' at line tail
- #
- if Line.endswith('{'):
- findBlock = True
- ListItem = CleanString(Line.rsplit('{', 1)[0], DataType.TAB_COMMENT_SPLIT)
-
- #
- # Parse a block content
- #
- if findBlock:
- if Line.find('<LibraryClasses>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (True, False, False, False, False, False, False)
- continue
- if Line.find('<BuildOptions>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, True, False, False, False, False, False)
- continue
- if Line.find('<PcdsFeatureFlag>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, True, False, False, False, False)
- continue
- if Line.find('<PcdsPatchableInModule>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, True, False, False, False)
- continue
- if Line.find('<PcdsFixedAtBuild>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, True, False, False)
- continue
- if Line.find('<PcdsDynamic>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, False, True, False)
- continue
- if Line.find('<PcdsDynamicEx>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, False, False, True)
- continue
- if Line.endswith('}'):
- #
- # find '}' at line tail
- #
- KeyValues.append([ListItem, LibraryClassItem, BuildOption, Pcd])
- (findBlock, findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, False, False, False, False)
- LibraryClassItem, BuildOption, Pcd = [], [], []
- continue
-
- if findBlock:
- if findLibraryClass:
- LibraryClassItem.append(Line)
- elif findBuildOption:
- BuildOption.append(Line)
- elif findPcdsFeatureFlag:
- Pcd.append((DataType.TAB_PCDS_FEATURE_FLAG_NULL, Line))
- elif findPcdsPatchableInModule:
- Pcd.append((DataType.TAB_PCDS_PATCHABLE_IN_MODULE_NULL, Line))
- elif findPcdsFixedAtBuild:
- Pcd.append((DataType.TAB_PCDS_FIXED_AT_BUILD_NULL, Line))
- elif findPcdsDynamic:
- Pcd.append((DataType.TAB_PCDS_DYNAMIC_DEFAULT_NULL, Line))
- elif findPcdsDynamicEx:
- Pcd.append((DataType.TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL, Line))
- else:
- KeyValues.append([ListItem, [], [], []])
-
- return True
-
-## GetExec
-#
-# Parse a string with format "InfFilename [EXEC = ExecFilename]"
-# Return (InfFilename, ExecFilename)
-#
-# @param String: String with EXEC statement
-#
-# @retval truple() A pair as (InfFilename, ExecFilename)
-#
-def GetExec(String):
- InfFilename = ''
- ExecFilename = ''
- if String.find('EXEC') > -1:
- InfFilename = String[ : String.find('EXEC')].strip()
- ExecFilename = String[String.find('EXEC') + len('EXEC') : ].strip()
- else:
- InfFilename = String.strip()
-
- return (InfFilename, ExecFilename)
-
-## GetComponents
-#
-# Parse block of the components defined in dsc file
-# Set KeyValues as [ ['component name', [lib1, lib2, lib3], [bo1, bo2, bo3], [pcd1, pcd2, pcd3]], ...]
-#
-# @param Lines: The content to be parsed
-# @param Key: Reserved
-# @param KeyValues: To store data after parsing
-# @param CommentCharacter: Comment char, used to ignore comment content
-#
-# @retval True Get component successfully
-#
-def GetComponents(Lines, Key, KeyValues, CommentCharacter):
- if Lines.find(DataType.TAB_SECTION_END) > -1:
- Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
- (findBlock, findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, False, False, False, False)
- ListItem = None
- LibraryClassItem = []
- BuildOption = []
- Pcd = []
-
- LineList = Lines.split('\n')
- for Line in LineList:
- Line = CleanString(Line, CommentCharacter)
- if Line == None or Line == '':
- continue
-
- if findBlock == False:
- ListItem = Line
- #
- # find '{' at line tail
- #
- if Line.endswith('{'):
- findBlock = True
- ListItem = CleanString(Line.rsplit('{', 1)[0], CommentCharacter)
-
- #
- # Parse a block content
- #
- if findBlock:
- if Line.find('<LibraryClasses>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (True, False, False, False, False, False, False)
- continue
- if Line.find('<BuildOptions>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, True, False, False, False, False, False)
- continue
- if Line.find('<PcdsFeatureFlag>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, True, False, False, False, False)
- continue
- if Line.find('<PcdsPatchableInModule>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, True, False, False, False)
- continue
- if Line.find('<PcdsFixedAtBuild>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, True, False, False)
- continue
- if Line.find('<PcdsDynamic>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, False, True, False)
- continue
- if Line.find('<PcdsDynamicEx>') != -1:
- (findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, False, False, True)
- continue
- if Line.endswith('}'):
- #
- # find '}' at line tail
- #
- KeyValues.append([ListItem, LibraryClassItem, BuildOption, Pcd])
- (findBlock, findLibraryClass, findBuildOption, findPcdsFeatureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDynamicEx) = (False, False, False, False, False, False, False, False)
- LibraryClassItem, BuildOption, Pcd = [], [], []
- continue
-
- if findBlock:
- if findLibraryClass:
- LibraryClassItem.append(Line)
- elif findBuildOption:
- BuildOption.append(Line)
- elif findPcdsFeatureFlag:
- Pcd.append((DataType.TAB_PCDS_FEATURE_FLAG, Line))
- elif findPcdsPatchableInModule:
- Pcd.append((DataType.TAB_PCDS_PATCHABLE_IN_MODULE, Line))
- elif findPcdsFixedAtBuild:
- Pcd.append((DataType.TAB_PCDS_FIXED_AT_BUILD, Line))
- elif findPcdsDynamic:
- Pcd.append((DataType.TAB_PCDS_DYNAMIC, Line))
- elif findPcdsDynamicEx:
- Pcd.append((DataType.TAB_PCDS_DYNAMIC_EX, Line))
- else:
- KeyValues.append([ListItem, [], [], []])
-
- return True
-
-## Get Source
-#
-# Get Source of Inf as <Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]
-#
-# @param Item: String as <Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]
-# @param ContainerFile: The file which describes the library class, used for error report
-#
-# @retval (List[0], List[1], List[2], List[3], List[4])
-#
-def GetSource(Item, ContainerFile, FileRelativePath, LineNo = -1):
- ItemNew = Item + DataType.TAB_VALUE_SPLIT * 4
- List = GetSplitValueList(ItemNew)
- if len(List) < 5 or len(List) > 9:
- RaiseParserError(Item, 'Sources', ContainerFile, '<Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]', LineNo)
- List[0] = NormPath(List[0])
- CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Sources', Item, LineNo)
- if List[4] != '':
- CheckPcdTokenInfo(List[4], 'Sources', ContainerFile, LineNo)
-
- return (List[0], List[1], List[2], List[3], List[4])
-
-## Get Binary
-#
-# Get Binary of Inf as <Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]
-#
-# @param Item: String as <Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]
-# @param ContainerFile: The file which describes the library class, used for error report
-#
-# @retval (List[0], List[1], List[2], List[3])
-# @retval List
-#
-def GetBinary(Item, ContainerFile, FileRelativePath, LineNo = -1):
- ItemNew = Item + DataType.TAB_VALUE_SPLIT
- List = GetSplitValueList(ItemNew)
- if len(List) != 4 and len(List) != 5:
- RaiseParserError(Item, 'Binaries', ContainerFile, "<FileType>|<Filename>|<Target>[|<TokenSpaceGuidCName>.<PcdCName>]", LineNo)
- else:
- if List[3] != '':
- CheckPcdTokenInfo(List[3], 'Binaries', ContainerFile, LineNo)
-
- if len(List) == 4:
- return (List[0], List[1], List[2], List[3])
- elif len(List) == 3:
- return (List[0], List[1], List[2], '')
- elif len(List) == 2:
- return (List[0], List[1], '', '')
- elif len(List) == 1:
- return (List[0], '', '', '')
-
-## Get Guids/Protocols/Ppis
-#
-# Get Guids/Protocols/Ppis of Inf as <GuidCName>[|<PcdFeatureFlag>]
-#
-# @param Item: String as <GuidCName>[|<PcdFeatureFlag>]
-# @param Type: Type of parsing string
-# @param ContainerFile: The file which describes the library class, used for error report
-#
-# @retval (List[0], List[1])
-#
-def GetGuidsProtocolsPpisOfInf(Item, Type, ContainerFile, LineNo = -1):
- ItemNew = Item + TAB_VALUE_SPLIT
- List = GetSplitValueList(ItemNew)
- if List[1] != '':
- CheckPcdTokenInfo(List[1], Type, ContainerFile, LineNo)
-
- return (List[0], List[1])
-
-## Get Guids/Protocols/Ppis
-#
-# Get Guids/Protocols/Ppis of Dec as <GuidCName>=<GuidValue>
-#
-# @param Item: String as <GuidCName>=<GuidValue>
-# @param Type: Type of parsing string
-# @param ContainerFile: The file which describes the library class, used for error report
-#
-# @retval (List[0], List[1])
-#
-def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerFile, LineNo = -1):
- List = GetSplitValueList(Item, DataType.TAB_EQUAL_SPLIT)
- if len(List) != 2:
- RaiseParserError(Item, Type, ContainerFile, '<CName>=<GuidValue>', LineNo)
-
- return (List[0], List[1])
-
-## GetPackage
-#
-# Get Package of Inf as <PackagePath>[|<PcdFeatureFlag>]
-#
-# @param Item: String as <PackagePath>[|<PcdFeatureFlag>]
-# @param Type: Type of parsing string
-# @param ContainerFile: The file which describes the library class, used for error report
-#
-# @retval (List[0], List[1])
-#
-def GetPackage(Item, ContainerFile, FileRelativePath, LineNo = -1):
- ItemNew = Item + TAB_VALUE_SPLIT
- List = GetSplitValueList(ItemNew)
- CheckFileType(List[0], '.Dec', ContainerFile, 'package', List[0], LineNo)
- CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Packages', List[0], LineNo)
-
- if List[1] != '':
- CheckPcdTokenInfo(List[1], 'Packages', ContainerFile, LineNo)
-
- return (List[0], List[1])
-
-## Get Pcd Values of Inf
-#
-# Get Pcd of Inf as <TokenSpaceGuidCName>.<PcdCName>[|<Value>]
-#
-# @param Item: The string describes pcd
-# @param Type: The type of Pcd
-# @param File: The file which describes the pcd, used for error report
-#
-# @retval (TokenSpcCName, TokenCName, Value, ItemType) Formatted Pcd Item
-#
-def GetPcdOfInf(Item, Type, File, LineNo):
- Format = '<TokenSpaceGuidCName>.<PcdCName>[|<Value>]'
- TokenGuid, TokenName, Value, InfType = '', '', '', ''
-
- if Type == TAB_PCDS_FIXED_AT_BUILD:
- InfType = TAB_INF_FIXED_PCD
- elif Type == TAB_PCDS_PATCHABLE_IN_MODULE:
- InfType = TAB_INF_PATCH_PCD
- elif Type == TAB_PCDS_FEATURE_FLAG:
- InfType = TAB_INF_FEATURE_PCD
- elif Type == TAB_PCDS_DYNAMIC_EX:
- InfType = TAB_INF_PCD_EX
- elif Type == TAB_PCDS_DYNAMIC:
- InfType = TAB_INF_PCD
- List = GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT)
- if len(List) < 2 or len(List) > 3:
- RaiseParserError(Item, InfType, File, Format, LineNo)
- else:
- Value = List[1]
- TokenInfo = GetSplitValueList(List[0], DataType.TAB_SPLIT)
- if len(TokenInfo) != 2:
- RaiseParserError(Item, InfType, File, Format, LineNo)
- else:
- TokenGuid = TokenInfo[0]
- TokenName = TokenInfo[1]
-
- return (TokenGuid, TokenName, Value, Type)
-
-
-## Get Pcd Values of Dec
-#
-# Get Pcd of Dec as <TokenSpcCName>.<TokenCName>|<Value>|<DatumType>|<Token>
-# @retval (TokenSpcCName, TokenCName, Value, DatumType, Token, ItemType) Formatted Pcd Item
-#
-def GetPcdOfDec(Item, Type, File, LineNo = -1):
- Format = '<TokenSpaceGuidCName>.<PcdCName>|<Value>|<DatumType>|<Token>'
- TokenGuid, TokenName, Value, DatumType, Token = '', '', '', '', ''
- List = GetSplitValueList(Item)
- if len(List) != 4:
- RaiseParserError(Item, 'Pcds' + Type, File, Format, LineNo)
- else:
- Value = List[1]
- DatumType = List[2]
- Token = List[3]
- TokenInfo = GetSplitValueList(List[0], DataType.TAB_SPLIT)
- if len(TokenInfo) != 2:
- RaiseParserError(Item, 'Pcds' + Type, File, Format, LineNo)
- else:
- TokenGuid = TokenInfo[0]
- TokenName = TokenInfo[1]
-
- return (TokenGuid, TokenName, Value, DatumType, Token, Type)
-
-## Parse DEFINE statement
-#
-# Get DEFINE macros
-#
-# 1. Insert a record into TblDec
-# Value1: Macro Name
-# Value2: Macro Value
-#
-def ParseDefine(LineValue, StartLine, Table, FileID, Filename, SectionName, SectionModel, Arch):
- EdkLogger.debug(EdkLogger.DEBUG_2, "DEFINE statement '%s' found in section %s" % (LineValue, SectionName))
- Define = GetSplitValueList(CleanString(LineValue[LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') + len(DataType.TAB_DEFINE + ' ') : ]), TAB_EQUAL_SPLIT, 1)
- Table.Insert(MODEL_META_DATA_DEFINE, Define[0], Define[1], '', '', '', Arch, SectionModel, FileID, StartLine, -1, StartLine, -1, 0)
-
-## InsertSectionItems
-#
-# Insert item data of a section to a dict
-#
-def InsertSectionItems(Model, CurrentSection, SectionItemList, ArchList, ThirdList, RecordSet):
- # Insert each item data of a section
- for Index in range(0, len(ArchList)):
- Arch = ArchList[Index]
- Third = ThirdList[Index]
- if Arch == '':
- Arch = TAB_ARCH_COMMON
-
- Records = RecordSet[Model]
- for SectionItem in SectionItemList:
- BelongsToItem, EndLine, EndColumn = -1, -1, -1
- LineValue, StartLine, EndLine, Comment = SectionItem[0], SectionItem[1], SectionItem[1], SectionItem[2]
-
- EdkLogger.debug(4, "Parsing %s ..." %LineValue)
- # And then parse DEFINE statement
- if LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') > -1:
- continue
-
- # At last parse other sections
- ID = -1
- Records.append([LineValue, Arch, StartLine, ID, Third, Comment])
-
- if RecordSet != {}:
- RecordSet[Model] = Records
-
-## Insert records to database
-#
-# Insert item data of a section to database
-# @param Table: The Table to be inserted
-# @param FileID: The ID of belonging file
-# @param Filename: The name of belonging file
-# @param CurrentSection: The name of currect section
-# @param SectionItemList: A list of items of the section
-# @param ArchList: A list of arches
-# @param ThirdList: A list of third parameters, ModuleType for LibraryClass and SkuId for Dynamic Pcds
-# @param IfDefList: A list of all conditional statements
-# @param RecordSet: A dict of all parsed records
-#
-def InsertSectionItemsIntoDatabase(Table, FileID, Filename, Model, CurrentSection, SectionItemList, ArchList, ThirdList, IfDefList, RecordSet):
- #
- # Insert each item data of a section
- #
- for Index in range(0, len(ArchList)):
- Arch = ArchList[Index]
- Third = ThirdList[Index]
- if Arch == '':
- Arch = TAB_ARCH_COMMON
-
- Records = RecordSet[Model]
- for SectionItem in SectionItemList:
- BelongsToItem, EndLine, EndColumn = -1, -1, -1
- LineValue, StartLine, EndLine = SectionItem[0], SectionItem[1], SectionItem[1]
-
- EdkLogger.debug(4, "Parsing %s ..." %LineValue)
- #
- # And then parse DEFINE statement
- #
- if LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') > -1:
- ParseDefine(LineValue, StartLine, Table, FileID, Filename, CurrentSection, Model, Arch)
- continue
-
- #
- # At last parse other sections
- #
- ID = Table.Insert(Model, LineValue, Third, Third, '', '', Arch, -1, FileID, StartLine, -1, StartLine, -1, 0)
- Records.append([LineValue, Arch, StartLine, ID, Third])
-
- if RecordSet != {}:
- RecordSet[Model] = Records
-
-## GenMetaDatSectionItem
-def GenMetaDatSectionItem(Key, Value, List):
- if Key not in List:
- List[Key] = [Value]
- else:
- List[Key].append(Value)
diff --git a/BaseTools/Source/Python/Common/PyUtility.pyd b/BaseTools/Source/Python/Common/PyUtility.pyd
deleted file mode 100644
index 856b508e4e..0000000000
--- a/BaseTools/Source/Python/Common/PyUtility.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Source/Python/Common/String.py b/BaseTools/Source/Python/Common/String.py
deleted file mode 100644
index c282326677..0000000000
--- a/BaseTools/Source/Python/Common/String.py
+++ /dev/null
@@ -1,856 +0,0 @@
-## @file
-# This file is used to define common string related functions used in parsing process
-#
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import re
-import DataType
-import os.path
-import string
-import EdkLogger as EdkLogger
-
-import GlobalData
-from BuildToolError import *
-from CommonDataClass.Exceptions import *
-
-gHexVerPatt = re.compile('0x[a-f0-9]{4}[a-f0-9]{4}$', re.IGNORECASE)
-gHumanReadableVerPatt = re.compile(r'([1-9][0-9]*|0)\.[0-9]{1,2}$')
-
-## GetSplitValueList
-#
-# Get a value list from a string with multiple values splited with SplitTag
-# The default SplitTag is DataType.TAB_VALUE_SPLIT
-# 'AAA|BBB|CCC' -> ['AAA', 'BBB', 'CCC']
-#
-# @param String: The input string to be splitted
-# @param SplitTag: The split key, default is DataType.TAB_VALUE_SPLIT
-# @param MaxSplit: The max number of split values, default is -1
-#
-# @retval list() A list for splitted string
-#
-def GetSplitValueList(String, SplitTag=DataType.TAB_VALUE_SPLIT, MaxSplit= -1):
- ValueList = []
- Last = 0
- Escaped = False
- InString = False
- for Index in range(0, len(String)):
- Char = String[Index]
-
- if not Escaped:
- # Found a splitter not in a string, split it
- if not InString and Char == SplitTag:
- ValueList.append(String[Last:Index].strip())
- Last = Index + 1
- if MaxSplit > 0 and len(ValueList) >= MaxSplit:
- break
-
- if Char == '\\' and InString:
- Escaped = True
- elif Char == '"':
- if not InString:
- InString = True
- else:
- InString = False
- else:
- Escaped = False
-
- if Last < len(String):
- ValueList.append(String[Last:].strip())
- elif Last == len(String):
- ValueList.append('')
-
- return ValueList
-
-## GetSplitList
-#
-# Get a value list from a string with multiple values splited with SplitString
-# The default SplitTag is DataType.TAB_VALUE_SPLIT
-# 'AAA|BBB|CCC' -> ['AAA', 'BBB', 'CCC']
-#
-# @param String: The input string to be splitted
-# @param SplitStr: The split key, default is DataType.TAB_VALUE_SPLIT
-# @param MaxSplit: The max number of split values, default is -1
-#
-# @retval list() A list for splitted string
-#
-def GetSplitList(String, SplitStr=DataType.TAB_VALUE_SPLIT, MaxSplit= -1):
- return map(lambda l: l.strip(), String.split(SplitStr, MaxSplit))
-
-## MergeArches
-#
-# Find a key's all arches in dict, add the new arch to the list
-# If not exist any arch, set the arch directly
-#
-# @param Dict: The input value for Dict
-# @param Key: The input value for Key
-# @param Arch: The Arch to be added or merged
-#
-def MergeArches(Dict, Key, Arch):
- if Key in Dict.keys():
- Dict[Key].append(Arch)
- else:
- Dict[Key] = Arch.split()
-
-## GenDefines
-#
-# Parse a string with format "DEFINE <VarName> = <PATH>"
-# Generate a map Defines[VarName] = PATH
-# Return False if invalid format
-#
-# @param String: String with DEFINE statement
-# @param Arch: Supportted Arch
-# @param Defines: DEFINE statement to be parsed
-#
-# @retval 0 DEFINE statement found, and valid
-# @retval 1 DEFINE statement found, but not valid
-# @retval -1 DEFINE statement not found
-#
-def GenDefines(String, Arch, Defines):
- if String.find(DataType.TAB_DEFINE + ' ') > -1:
- List = String.replace(DataType.TAB_DEFINE + ' ', '').split(DataType.TAB_EQUAL_SPLIT)
- if len(List) == 2:
- Defines[(CleanString(List[0]), Arch)] = CleanString(List[1])
- return 0
- else:
- return -1
-
- return 1
-
-## GenInclude
-#
-# Parse a string with format "!include <Filename>"
-# Return the file path
-# Return False if invalid format or NOT FOUND
-#
-# @param String: String with INCLUDE statement
-# @param IncludeFiles: INCLUDE statement to be parsed
-# @param Arch: Supportted Arch
-#
-# @retval True
-# @retval False
-#
-def GenInclude(String, IncludeFiles, Arch):
- if String.upper().find(DataType.TAB_INCLUDE.upper() + ' ') > -1:
- IncludeFile = CleanString(String[String.upper().find(DataType.TAB_INCLUDE.upper() + ' ') + len(DataType.TAB_INCLUDE + ' ') : ])
- MergeArches(IncludeFiles, IncludeFile, Arch)
- return True
- else:
- return False
-
-## GetLibraryClassesWithModuleType
-#
-# Get Library Class definition when no module type defined
-#
-# @param Lines: The content to be parsed
-# @param Key: Reserved
-# @param KeyValues: To store data after parsing
-# @param CommentCharacter: Comment char, used to ignore comment content
-#
-# @retval True Get library classes successfully
-#
-def GetLibraryClassesWithModuleType(Lines, Key, KeyValues, CommentCharacter):
- newKey = SplitModuleType(Key)
- Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
- LineList = Lines.splitlines()
- for Line in LineList:
- Line = CleanString(Line, CommentCharacter)
- if Line != '' and Line[0] != CommentCharacter:
- KeyValues.append([CleanString(Line, CommentCharacter), newKey[1]])
-
- return True
-
-## GetDynamics
-#
-# Get Dynamic Pcds
-#
-# @param Lines: The content to be parsed
-# @param Key: Reserved
-# @param KeyValues: To store data after parsing
-# @param CommentCharacter: Comment char, used to ignore comment content
-#
-# @retval True Get Dynamic Pcds successfully
-#
-def GetDynamics(Lines, Key, KeyValues, CommentCharacter):
- #
- # Get SkuId Name List
- #
- SkuIdNameList = SplitModuleType(Key)
-
- Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
- LineList = Lines.splitlines()
- for Line in LineList:
- Line = CleanString(Line, CommentCharacter)
- if Line != '' and Line[0] != CommentCharacter:
- KeyValues.append([CleanString(Line, CommentCharacter), SkuIdNameList[1]])
-
- return True
-
-## SplitModuleType
-#
-# Split ModuleType out of section defien to get key
-# [LibraryClass.Arch.ModuleType|ModuleType|ModuleType] -> [ 'LibraryClass.Arch', ['ModuleType', 'ModuleType', 'ModuleType'] ]
-#
-# @param Key: String to be parsed
-#
-# @retval ReturnValue A list for module types
-#
-def SplitModuleType(Key):
- KeyList = Key.split(DataType.TAB_SPLIT)
- #
- # Fill in for arch
- #
- KeyList.append('')
- #
- # Fill in for moduletype
- #
- KeyList.append('')
- ReturnValue = []
- KeyValue = KeyList[0]
- if KeyList[1] != '':
- KeyValue = KeyValue + DataType.TAB_SPLIT + KeyList[1]
- ReturnValue.append(KeyValue)
- ReturnValue.append(GetSplitValueList(KeyList[2]))
-
- return ReturnValue
-
-## Replace macro in strings list
-#
-# This method replace macros used in a given string list. The macros are
-# given in a dictionary.
-#
-# @param StringList StringList to be processed
-# @param MacroDefinitions The macro definitions in the form of dictionary
-# @param SelfReplacement To decide whether replace un-defined macro to ''
-#
-# @retval NewList A new string list whose macros are replaced
-#
-def ReplaceMacros(StringList, MacroDefinitions={}, SelfReplacement=False):
- NewList = []
- for String in StringList:
- if type(String) == type(''):
- NewList.append(ReplaceMacro(String, MacroDefinitions, SelfReplacement))
- else:
- NewList.append(String)
-
- return NewList
-
-## Replace macro in string
-#
-# This method replace macros used in given string. The macros are given in a
-# dictionary.
-#
-# @param String String to be processed
-# @param MacroDefinitions The macro definitions in the form of dictionary
-# @param SelfReplacement To decide whether replace un-defined macro to ''
-#
-# @retval string The string whose macros are replaced
-#
-def ReplaceMacro(String, MacroDefinitions={}, SelfReplacement=False, RaiseError=False):
- LastString = String
- while String and MacroDefinitions:
- MacroUsed = GlobalData.gMacroRefPattern.findall(String)
- # no macro found in String, stop replacing
- if len(MacroUsed) == 0:
- break
-
- for Macro in MacroUsed:
- if Macro not in MacroDefinitions:
- if RaiseError:
- raise SymbolNotFound("%s not defined" % Macro)
- if SelfReplacement:
- String = String.replace("$(%s)" % Macro, '')
- continue
- String = String.replace("$(%s)" % Macro, MacroDefinitions[Macro])
- # in case there's macro not defined
- if String == LastString:
- break
- LastString = String
-
- return String
-
-## NormPath
-#
-# Create a normal path
-# And replace DFEINE in the path
-#
-# @param Path: The input value for Path to be converted
-# @param Defines: A set for DEFINE statement
-#
-# @retval Path Formatted path
-#
-def NormPath(Path, Defines={}):
- IsRelativePath = False
- if Path:
- if Path[0] == '.':
- IsRelativePath = True
- #
- # Replace with Define
- #
- if Defines:
- Path = ReplaceMacro(Path, Defines)
- #
- # To local path format
- #
- Path = os.path.normpath(Path)
-
- if IsRelativePath and Path[0] != '.':
- Path = os.path.join('.', Path)
-
- return Path
-
-## CleanString
-#
-# Remove comments in a string
-# Remove spaces
-#
-# @param Line: The string to be cleaned
-# @param CommentCharacter: Comment char, used to ignore comment content, default is DataType.TAB_COMMENT_SPLIT
-#
-# @retval Path Formatted path
-#
-def CleanString(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyleComment=False, BuildOption=False):
- #
- # remove whitespace
- #
- Line = Line.strip();
- #
- # Replace Edk's comment character
- #
- if AllowCppStyleComment:
- Line = Line.replace(DataType.TAB_COMMENT_EDK_SPLIT, CommentCharacter)
- #
- # remove comments, but we should escape comment character in string
- #
- InString = False
- CommentInString = False
- for Index in range(0, len(Line)):
- if Line[Index] == '"':
- InString = not InString
- elif Line[Index] == CommentCharacter and InString :
- CommentInString = True
- elif Line[Index] == CommentCharacter and not InString :
- Line = Line[0: Index]
- break
-
- if CommentInString and BuildOption:
- Line = Line.replace('"', '')
- ChIndex = Line.find('#')
- while ChIndex >= 0:
- if GlobalData.gIsWindows:
- if ChIndex == 0 or Line[ChIndex - 1] != '^':
- Line = Line[0:ChIndex] + '^' + Line[ChIndex:]
- ChIndex = Line.find('#', ChIndex + 2)
- else:
- ChIndex = Line.find('#', ChIndex + 1)
- else:
- if ChIndex == 0 or Line[ChIndex - 1] != '\\':
- Line = Line[0:ChIndex] + '\\' + Line[ChIndex:]
- ChIndex = Line.find('#', ChIndex + 2)
- else:
- ChIndex = Line.find('#', ChIndex + 1)
- #
- # remove whitespace again
- #
- Line = Line.strip();
-
- return Line
-
-## CleanString2
-#
-# Split statement with comments in a string
-# Remove spaces
-#
-# @param Line: The string to be cleaned
-# @param CommentCharacter: Comment char, used to ignore comment content, default is DataType.TAB_COMMENT_SPLIT
-#
-# @retval Path Formatted path
-#
-def CleanString2(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyleComment=False):
- #
- # remove whitespace
- #
- Line = Line.strip();
- #
- # Replace Edk's comment character
- #
- if AllowCppStyleComment:
- Line = Line.replace(DataType.TAB_COMMENT_EDK_SPLIT, CommentCharacter)
- #
- # separate comments and statements, but we should escape comment character in string
- #
- InString = False
- CommentInString = False
- Comment = ''
- for Index in range(0, len(Line)):
- if Line[Index] == '"':
- InString = not InString
- elif Line[Index] == CommentCharacter and InString:
- CommentInString = True
- elif Line[Index] == CommentCharacter and not InString:
- Comment = Line[Index:].strip()
- Line = Line[0:Index].strip()
- break
- if Comment:
- # Remove prefixed and trailing comment characters
- Start = 0
- End = len(Comment)
- while Start < End and Comment.startswith(CommentCharacter, Start, End):
- Start += 1
- while End >= 0 and Comment.endswith(CommentCharacter, Start, End):
- End -= 1
- Comment = Comment[Start:End]
- Comment = Comment.strip()
-
- return Line, Comment
-
-## GetMultipleValuesOfKeyFromLines
-#
-# Parse multiple strings to clean comment and spaces
-# The result is saved to KeyValues
-#
-# @param Lines: The content to be parsed
-# @param Key: Reserved
-# @param KeyValues: To store data after parsing
-# @param CommentCharacter: Comment char, used to ignore comment content
-#
-# @retval True Successfully executed
-#
-def GetMultipleValuesOfKeyFromLines(Lines, Key, KeyValues, CommentCharacter):
- Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
- LineList = Lines.split('\n')
- for Line in LineList:
- Line = CleanString(Line, CommentCharacter)
- if Line != '' and Line[0] != CommentCharacter:
- KeyValues += [Line]
-
- return True
-
-## GetDefineValue
-#
-# Parse a DEFINE statement to get defined value
-# DEFINE Key Value
-#
-# @param String: The content to be parsed
-# @param Key: The key of DEFINE statement
-# @param CommentCharacter: Comment char, used to ignore comment content
-#
-# @retval string The defined value
-#
-def GetDefineValue(String, Key, CommentCharacter):
- String = CleanString(String)
- return String[String.find(Key + ' ') + len(Key + ' ') : ]
-
-## GetHexVerValue
-#
-# Get a Hex Version Value
-#
-# @param VerString: The version string to be parsed
-#
-#
-# @retval: If VerString is incorrectly formatted, return "None" which will break the build.
-# If VerString is correctly formatted, return a Hex value of the Version Number (0xmmmmnnnn)
-# where mmmm is the major number and nnnn is the adjusted minor number.
-#
-def GetHexVerValue(VerString):
- VerString = CleanString(VerString)
-
- if gHumanReadableVerPatt.match(VerString):
- ValueList = VerString.split('.')
- Major = ValueList[0]
- Minor = ValueList[1]
- if len(Minor) == 1:
- Minor += '0'
- DeciValue = (int(Major) << 16) + int(Minor);
- return "0x%08x" % DeciValue
- elif gHexVerPatt.match(VerString):
- return VerString
- else:
- return None
-
-
-## GetSingleValueOfKeyFromLines
-#
-# Parse multiple strings as below to get value of each definition line
-# Key1 = Value1
-# Key2 = Value2
-# The result is saved to Dictionary
-#
-# @param Lines: The content to be parsed
-# @param Dictionary: To store data after parsing
-# @param CommentCharacter: Comment char, be used to ignore comment content
-# @param KeySplitCharacter: Key split char, between key name and key value. Key1 = Value1, '=' is the key split char
-# @param ValueSplitFlag: Value split flag, be used to decide if has multiple values
-# @param ValueSplitCharacter: Value split char, be used to split multiple values. Key1 = Value1|Value2, '|' is the value split char
-#
-# @retval True Successfully executed
-#
-def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
- Lines = Lines.split('\n')
- Keys = []
- Value = ''
- DefineValues = ['']
- SpecValues = ['']
-
- for Line in Lines:
- #
- # Handle DEFINE and SPEC
- #
- if Line.find(DataType.TAB_INF_DEFINES_DEFINE + ' ') > -1:
- if '' in DefineValues:
- DefineValues.remove('')
- DefineValues.append(GetDefineValue(Line, DataType.TAB_INF_DEFINES_DEFINE, CommentCharacter))
- continue
- if Line.find(DataType.TAB_INF_DEFINES_SPEC + ' ') > -1:
- if '' in SpecValues:
- SpecValues.remove('')
- SpecValues.append(GetDefineValue(Line, DataType.TAB_INF_DEFINES_SPEC, CommentCharacter))
- continue
-
- #
- # Handle Others
- #
- LineList = Line.split(KeySplitCharacter, 1)
- if len(LineList) >= 2:
- Key = LineList[0].split()
- if len(Key) == 1 and Key[0][0] != CommentCharacter:
- #
- # Remove comments and white spaces
- #
- LineList[1] = CleanString(LineList[1], CommentCharacter)
- if ValueSplitFlag:
- Value = map(string.strip, LineList[1].split(ValueSplitCharacter))
- else:
- Value = CleanString(LineList[1], CommentCharacter).splitlines()
-
- if Key[0] in Dictionary:
- if Key[0] not in Keys:
- Dictionary[Key[0]] = Value
- Keys.append(Key[0])
- else:
- Dictionary[Key[0]].extend(Value)
- else:
- Dictionary[DataType.TAB_INF_DEFINES_MACRO][Key[0]] = Value[0]
-
- if DefineValues == []:
- DefineValues = ['']
- if SpecValues == []:
- SpecValues = ['']
- Dictionary[DataType.TAB_INF_DEFINES_DEFINE] = DefineValues
- Dictionary[DataType.TAB_INF_DEFINES_SPEC] = SpecValues
-
- return True
-
-## The content to be parsed
-#
-# Do pre-check for a file before it is parsed
-# Check $()
-# Check []
-#
-# @param FileName: Used for error report
-# @param FileContent: File content to be parsed
-# @param SupSectionTag: Used for error report
-#
-def PreCheck(FileName, FileContent, SupSectionTag):
- LineNo = 0
- IsFailed = False
- NewFileContent = ''
- for Line in FileContent.splitlines():
- LineNo = LineNo + 1
- #
- # Clean current line
- #
- Line = CleanString(Line)
-
- #
- # Remove commented line
- #
- if Line.find(DataType.TAB_COMMA_SPLIT) == 0:
- Line = ''
- #
- # Check $()
- #
- if Line.find('$') > -1:
- if Line.find('$(') < 0 or Line.find(')') < 0:
- EdkLogger.error("Parser", FORMAT_INVALID, Line=LineNo, File=FileName, RaiseError=EdkLogger.IsRaiseError)
-
- #
- # Check []
- #
- if Line.find('[') > -1 or Line.find(']') > -1:
- #
- # Only get one '[' or one ']'
- #
- if not (Line.find('[') > -1 and Line.find(']') > -1):
- EdkLogger.error("Parser", FORMAT_INVALID, Line=LineNo, File=FileName, RaiseError=EdkLogger.IsRaiseError)
-
- #
- # Regenerate FileContent
- #
- NewFileContent = NewFileContent + Line + '\r\n'
-
- if IsFailed:
- EdkLogger.error("Parser", FORMAT_INVALID, Line=LineNo, File=FileName, RaiseError=EdkLogger.IsRaiseError)
-
- return NewFileContent
-
-## CheckFileType
-#
-# Check if the Filename is including ExtName
-# Return True if it exists
-# Raise a error message if it not exists
-#
-# @param CheckFilename: Name of the file to be checked
-# @param ExtName: Ext name of the file to be checked
-# @param ContainerFilename: The container file which describes the file to be checked, used for error report
-# @param SectionName: Used for error report
-# @param Line: The line in container file which defines the file to be checked
-#
-# @retval True The file type is correct
-#
-def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, Line, LineNo= -1):
- if CheckFilename != '' and CheckFilename != None:
- (Root, Ext) = os.path.splitext(CheckFilename)
- if Ext.upper() != ExtName.upper():
- ContainerFile = open(ContainerFilename, 'r').read()
- if LineNo == -1:
- LineNo = GetLineNo(ContainerFile, Line)
- ErrorMsg = "Invalid %s. '%s' is found, but '%s' file is needed" % (SectionName, CheckFilename, ExtName)
- EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, Line=LineNo,
- File=ContainerFilename, RaiseError=EdkLogger.IsRaiseError)
-
- return True
-
-## CheckFileExist
-#
-# Check if the file exists
-# Return True if it exists
-# Raise a error message if it not exists
-#
-# @param CheckFilename: Name of the file to be checked
-# @param WorkspaceDir: Current workspace dir
-# @param ContainerFilename: The container file which describes the file to be checked, used for error report
-# @param SectionName: Used for error report
-# @param Line: The line in container file which defines the file to be checked
-#
-# @retval The file full path if the file exists
-#
-def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, SectionName, Line, LineNo= -1):
- CheckFile = ''
- if CheckFilename != '' and CheckFilename != None:
- CheckFile = WorkspaceFile(WorkspaceDir, CheckFilename)
- if not os.path.isfile(CheckFile):
- ContainerFile = open(ContainerFilename, 'r').read()
- if LineNo == -1:
- LineNo = GetLineNo(ContainerFile, Line)
- ErrorMsg = "Can't find file '%s' defined in section '%s'" % (CheckFile, SectionName)
- EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg,
- File=ContainerFilename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
-
- return CheckFile
-
-## GetLineNo
-#
-# Find the index of a line in a file
-#
-# @param FileContent: Search scope
-# @param Line: Search key
-#
-# @retval int Index of the line
-# @retval -1 The line is not found
-#
-def GetLineNo(FileContent, Line, IsIgnoreComment=True):
- LineList = FileContent.splitlines()
- for Index in range(len(LineList)):
- if LineList[Index].find(Line) > -1:
- #
- # Ignore statement in comment
- #
- if IsIgnoreComment:
- if LineList[Index].strip()[0] == DataType.TAB_COMMENT_SPLIT:
- continue
- return Index + 1
-
- return -1
-
-## RaiseParserError
-#
-# Raise a parser error
-#
-# @param Line: String which has error
-# @param Section: Used for error report
-# @param File: File which has the string
-# @param Format: Correct format
-#
-def RaiseParserError(Line, Section, File, Format='', LineNo= -1):
- if LineNo == -1:
- LineNo = GetLineNo(open(os.path.normpath(File), 'r').read(), Line)
- ErrorMsg = "Invalid statement '%s' is found in section '%s'" % (Line, Section)
- if Format != '':
- Format = "Correct format is " + Format
- EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=File, Line=LineNo, ExtraData=Format, RaiseError=EdkLogger.IsRaiseError)
-
-## WorkspaceFile
-#
-# Return a full path with workspace dir
-#
-# @param WorkspaceDir: Workspace dir
-# @param Filename: Relative file name
-#
-# @retval string A full path
-#
-def WorkspaceFile(WorkspaceDir, Filename):
- return os.path.join(NormPath(WorkspaceDir), NormPath(Filename))
-
-## Split string
-#
-# Revmove '"' which startswith and endswith string
-#
-# @param String: The string need to be splited
-#
-# @retval String: The string after removed '""'
-#
-def SplitString(String):
- if String.startswith('\"'):
- String = String[1:]
- if String.endswith('\"'):
- String = String[:-1]
-
- return String
-
-## Convert To Sql String
-#
-# 1. Replace "'" with "''" in each item of StringList
-#
-# @param StringList: A list for strings to be converted
-#
-def ConvertToSqlString(StringList):
- return map(lambda s: s.replace("'", "''") , StringList)
-
-## Convert To Sql String
-#
-# 1. Replace "'" with "''" in the String
-#
-# @param String: A String to be converted
-#
-def ConvertToSqlString2(String):
- return String.replace("'", "''")
-
-#
-# Remove comment block
-#
-def RemoveBlockComment(Lines):
- IsFindBlockComment = False
- IsFindBlockCode = False
- ReservedLine = ''
- NewLines = []
-
- for Line in Lines:
- Line = Line.strip()
- #
- # Remove comment block
- #
- if Line.find(DataType.TAB_COMMENT_EDK_START) > -1:
- ReservedLine = GetSplitList(Line, DataType.TAB_COMMENT_EDK_START, 1)[0]
- IsFindBlockComment = True
- if Line.find(DataType.TAB_COMMENT_EDK_END) > -1:
- Line = ReservedLine + GetSplitList(Line, DataType.TAB_COMMENT_EDK_END, 1)[1]
- ReservedLine = ''
- IsFindBlockComment = False
- if IsFindBlockComment:
- NewLines.append('')
- continue
-
- NewLines.append(Line)
- return NewLines
-
-#
-# Get String of a List
-#
-def GetStringOfList(List, Split=' '):
- if type(List) != type([]):
- return List
- Str = ''
- for Item in List:
- Str = Str + Item + Split
-
- return Str.strip()
-
-#
-# Get HelpTextList from HelpTextClassList
-#
-def GetHelpTextList(HelpTextClassList):
- List = []
- if HelpTextClassList:
- for HelpText in HelpTextClassList:
- if HelpText.String.endswith('\n'):
- HelpText.String = HelpText.String[0: len(HelpText.String) - len('\n')]
- List.extend(HelpText.String.split('\n'))
-
- return List
-
-def StringToArray(String):
- if isinstance(String, unicode):
- if len(unicode) == 0:
- return "{0x00, 0x00}"
- return "{%s, 0x00, 0x00}" % ", ".join(["0x%02x, 0x00" % ord(C) for C in String])
- elif String.startswith('L"'):
- if String == "L\"\"":
- return "{0x00, 0x00}"
- else:
- return "{%s, 0x00, 0x00}" % ", ".join(["0x%02x, 0x00" % ord(C) for C in String[2:-1]])
- elif String.startswith('"'):
- if String == "\"\"":
- return "{0x00}";
- else:
- return "{%s, 0x00}" % ", ".join(["0x%02x" % ord(C) for C in String[1:-1]])
- else:
- return '{%s, 0}' % ', '.join(String.split())
-
-def StringArrayLength(String):
- if isinstance(String, unicode):
- return (len(String) + 1) * 2 + 1;
- elif String.startswith('L"'):
- return (len(String) - 3 + 1) * 2
- elif String.startswith('"'):
- return (len(String) - 2 + 1)
- else:
- return len(String.split()) + 1
-
-def RemoveDupOption(OptionString, Which="/I", Against=None):
- OptionList = OptionString.split()
- ValueList = []
- if Against:
- ValueList += Against
- for Index in range(len(OptionList)):
- Opt = OptionList[Index]
- if not Opt.startswith(Which):
- continue
- if len(Opt) > len(Which):
- Val = Opt[len(Which):]
- else:
- Val = ""
- if Val in ValueList:
- OptionList[Index] = ""
- else:
- ValueList.append(Val)
- return " ".join(OptionList)
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- pass
-
diff --git a/BaseTools/Source/Python/Common/TargetTxtClassObject.py b/BaseTools/Source/Python/Common/TargetTxtClassObject.py
deleted file mode 100644
index a7dec65a25..0000000000
--- a/BaseTools/Source/Python/Common/TargetTxtClassObject.py
+++ /dev/null
@@ -1,167 +0,0 @@
-## @file
-# This file is used to define each component of Target.txt file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import EdkLogger
-import DataType
-from BuildToolError import *
-import GlobalData
-
-gDefaultTargetTxtFile = "Conf/target.txt"
-
-## TargetTxtClassObject
-#
-# This class defined content used in file target.txt
-#
-# @param object: Inherited from object class
-# @param Filename: Input value for full path of target.txt
-#
-# @var TargetTxtDictionary: To store keys and values defined in target.txt
-#
-class TargetTxtClassObject(object):
- def __init__(self, Filename = None):
- self.TargetTxtDictionary = {
- DataType.TAB_TAT_DEFINES_ACTIVE_PLATFORM : '',
- DataType.TAB_TAT_DEFINES_ACTIVE_MODULE : '',
- DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF : '',
- DataType.TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER : '',
- DataType.TAB_TAT_DEFINES_TARGET : [],
- DataType.TAB_TAT_DEFINES_TOOL_CHAIN_TAG : [],
- DataType.TAB_TAT_DEFINES_TARGET_ARCH : [],
- DataType.TAB_TAT_DEFINES_BUILD_RULE_CONF : '',
- }
- if Filename != None:
- self.LoadTargetTxtFile(Filename)
-
- ## LoadTargetTxtFile
- #
- # Load target.txt file and parse it, return a set structure to store keys and values
- #
- # @param Filename: Input value for full path of target.txt
- #
- # @retval set() A set structure to store keys and values
- # @retval 1 Error happenes in parsing
- #
- def LoadTargetTxtFile(self, Filename):
- if os.path.exists(Filename) and os.path.isfile(Filename):
- return self.ConvertTextFileToDict(Filename, '#', '=')
- else:
- EdkLogger.error("Target.txt Parser", FILE_NOT_FOUND, ExtraData=Filename)
- return 1
-
- ## ConvertTextFileToDict
- #
- # Convert a text file to a dictionary of (name:value) pairs.
- # The data is saved to self.TargetTxtDictionary
- #
- # @param FileName: Text filename
- # @param CommentCharacter: Comment char, be used to ignore comment content
- # @param KeySplitCharacter: Key split char, between key name and key value. Key1 = Value1, '=' is the key split char
- #
- # @retval 0 Convert successfully
- # @retval 1 Open file failed
- #
- def ConvertTextFileToDict(self, FileName, CommentCharacter, KeySplitCharacter):
- F = None
- try:
- F = open(FileName,'r')
- except:
- EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=FileName)
- if F != None:
- F.close()
-
- for Line in F:
- Line = Line.strip()
- if Line.startswith(CommentCharacter) or Line == '':
- continue
-
- LineList = Line.split(KeySplitCharacter, 1)
- Key = LineList[0].strip()
- if len(LineList) == 2:
- Value = LineList[1].strip()
- else:
- Value = ""
-
- if Key in [DataType.TAB_TAT_DEFINES_ACTIVE_PLATFORM, DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF, \
- DataType.TAB_TAT_DEFINES_ACTIVE_MODULE, DataType.TAB_TAT_DEFINES_BUILD_RULE_CONF]:
- self.TargetTxtDictionary[Key] = Value.replace('\\', '/')
- elif Key in [DataType.TAB_TAT_DEFINES_TARGET, DataType.TAB_TAT_DEFINES_TARGET_ARCH, \
- DataType.TAB_TAT_DEFINES_TOOL_CHAIN_TAG]:
- self.TargetTxtDictionary[Key] = Value.split()
- elif Key == DataType.TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER:
- try:
- V = int(Value, 0)
- except:
- EdkLogger.error("build", FORMAT_INVALID, "Invalid number of [%s]: %s." % (Key, Value),
- File=FileName)
- self.TargetTxtDictionary[Key] = Value
- #elif Key not in GlobalData.gGlobalDefines:
- # GlobalData.gGlobalDefines[Key] = Value
-
- F.close()
- return 0
-
- ## Print the dictionary
- #
- # Print all items of dictionary one by one
- #
- # @param Dict: The dictionary to be printed
- #
- def printDict(Dict):
- if Dict != None:
- KeyList = Dict.keys()
- for Key in KeyList:
- if Dict[Key] != '':
- print Key + ' = ' + str(Dict[Key])
-
- ## Print the dictionary
- #
- # Print the items of dictionary which matched with input key
- #
- # @param list: The dictionary to be printed
- # @param key: The key of the item to be printed
- #
- def printList(Key, List):
- if type(List) == type([]):
- if len(List) > 0:
- if Key.find(TAB_SPLIT) != -1:
- print "\n" + Key
- for Item in List:
- print Item
-## TargetTxtDict
-#
-# Load target.txt in input workspace dir
-#
-# @param WorkSpace: Workspace dir
-#
-# @retval Target An instance of TargetTxtClassObject() with loaded target.txt
-#
-def TargetTxtDict(WorkSpace):
- Target = TargetTxtClassObject()
- Target.LoadTargetTxtFile(os.path.normpath(os.path.join(WorkSpace, gDefaultTargetTxtFile)))
- return Target
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- pass
- Target = TargetTxtDict(os.getenv("WORKSPACE"))
- print Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER]
- print Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TARGET]
- print Target.TargetTxtDictionary
diff --git a/BaseTools/Source/Python/Common/ToolDefClassObject.py b/BaseTools/Source/Python/Common/ToolDefClassObject.py
deleted file mode 100644
index 0f49457449..0000000000
--- a/BaseTools/Source/Python/Common/ToolDefClassObject.py
+++ /dev/null
@@ -1,219 +0,0 @@
-## @file
-# This file is used to define each component of tools_def.txt file
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import re
-import EdkLogger
-
-from Dictionary import *
-from BuildToolError import *
-from TargetTxtClassObject import *
-
-##
-# Static variables used for pattern
-#
-gMacroRefPattern = re.compile('(DEF\([^\(\)]+\))')
-gEnvRefPattern = re.compile('(ENV\([^\(\)]+\))')
-gMacroDefPattern = re.compile("DEFINE\s+([^\s]+)")
-gDefaultToolsDefFile = "Conf/tools_def.txt"
-
-## ToolDefClassObject
-#
-# This class defined content used in file tools_def.txt
-#
-# @param object: Inherited from object class
-# @param Filename: Input value for full path of tools_def.txt
-#
-# @var ToolsDefTxtDictionary: To store keys and values defined in target.txt
-# @var MacroDictionary: To store keys and values defined in DEFINE statement
-#
-class ToolDefClassObject(object):
- def __init__(self, FileName = None):
- self.ToolsDefTxtDictionary = {}
- self.MacroDictionary = {}
- for Env in os.environ:
- self.MacroDictionary["ENV(%s)" % Env] = os.environ[Env]
-
- if FileName != None:
- self.LoadToolDefFile(FileName)
-
- ## LoadToolDefFile
- #
- # Load target.txt file and parse it, return a set structure to store keys and values
- #
- # @param Filename: Input value for full path of tools_def.txt
- #
- def LoadToolDefFile(self, FileName):
- FileContent = []
- if os.path.isfile(FileName):
- try:
- F = open(FileName,'r')
- FileContent = F.readlines()
- except:
- EdkLogger.error("tools_def.txt parser", FILE_OPEN_FAILURE, ExtraData=FileName)
- else:
- EdkLogger.error("tools_def.txt parser", FILE_NOT_FOUND, ExtraData=FileName)
-
- self.ToolsDefTxtDatabase = {
- TAB_TOD_DEFINES_TARGET : [],
- TAB_TOD_DEFINES_TOOL_CHAIN_TAG : [],
- TAB_TOD_DEFINES_TARGET_ARCH : [],
- TAB_TOD_DEFINES_COMMAND_TYPE : []
- }
-
- for Index in range(len(FileContent)):
- Line = FileContent[Index].strip()
- if Line == "" or Line[0] == '#':
- continue
- NameValuePair = Line.split("=", 1)
- if len(NameValuePair) != 2:
- EdkLogger.warn("tools_def.txt parser", "Line %d: not correct assignment statement, skipped" % (Index + 1))
- continue
-
- Name = NameValuePair[0].strip()
- Value = NameValuePair[1].strip()
-
- if Name == "IDENTIFIER":
- EdkLogger.debug(EdkLogger.DEBUG_8, "Line %d: Found identifier statement, skipped: %s" % ((Index + 1), Value))
- continue
-
- MacroDefinition = gMacroDefPattern.findall(Name)
- if MacroDefinition != []:
- Done, Value = self.ExpandMacros(Value)
- if not Done:
- EdkLogger.error("tools_def.txt parser", ATTRIBUTE_NOT_AVAILABLE,
- "Macro or Environment has not been defined",
- ExtraData=Value[4:-1], File=FileName, Line=Index+1)
-
- MacroName = MacroDefinition[0].strip()
- self.MacroDictionary["DEF(%s)" % MacroName] = Value
- EdkLogger.debug(EdkLogger.DEBUG_8, "Line %d: Found macro: %s = %s" % ((Index + 1), MacroName, Value))
- continue
-
- Done, Value = self.ExpandMacros(Value)
- if not Done:
- EdkLogger.error("tools_def.txt parser", ATTRIBUTE_NOT_AVAILABLE,
- "Macro or Environment has not been defined",
- ExtraData=Value[4:-1], File=FileName, Line=Index+1)
-
- List = Name.split('_')
- if len(List) != 5:
- EdkLogger.verbose("Line %d: Not a valid name of definition: %s" % ((Index + 1), Name))
- continue
- elif List[4] == '*':
- EdkLogger.verbose("Line %d: '*' is not allowed in last field: %s" % ((Index + 1), Name))
- continue
- else:
- self.ToolsDefTxtDictionary[Name] = Value
- if List[0] != '*':
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET] += [List[0]]
- if List[1] != '*':
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_TAG] += [List[1]]
- if List[2] != '*':
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET_ARCH] += [List[2]]
- if List[3] != '*':
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_COMMAND_TYPE] += [List[3]]
- if List[4] == TAB_TOD_DEFINES_FAMILY and List[2] == '*' and List[3] == '*':
- if TAB_TOD_DEFINES_FAMILY not in self.ToolsDefTxtDatabase:
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY] = {}
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY][List[1]] = Value
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_BUILDRULEFAMILY] = {}
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_BUILDRULEFAMILY][List[1]] = Value
- elif List[1] not in self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY]:
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY][List[1]] = Value
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_BUILDRULEFAMILY][List[1]] = Value
- elif self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY][List[1]] != Value:
- EdkLogger.verbose("Line %d: No override allowed for the family of a tool chain: %s" % ((Index + 1), Name))
- if List[4] == TAB_TOD_DEFINES_BUILDRULEFAMILY and List[2] == '*' and List[3] == '*':
- if TAB_TOD_DEFINES_BUILDRULEFAMILY not in self.ToolsDefTxtDatabase \
- or List[1] not in self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY]:
- EdkLogger.verbose("Line %d: The family is not specified, but BuildRuleFamily is specified for the tool chain: %s" % ((Index + 1), Name))
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_BUILDRULEFAMILY][List[1]] = Value
-
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET] = list(set(self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET]))
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_TAG] = list(set(self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_TAG]))
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET_ARCH] = list(set(self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET_ARCH]))
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_COMMAND_TYPE] = list(set(self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_COMMAND_TYPE]))
-
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET].sort()
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_TAG].sort()
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET_ARCH].sort()
- self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_COMMAND_TYPE].sort()
-
- KeyList = [TAB_TOD_DEFINES_TARGET, TAB_TOD_DEFINES_TOOL_CHAIN_TAG, TAB_TOD_DEFINES_TARGET_ARCH, TAB_TOD_DEFINES_COMMAND_TYPE]
- for Index in range(3,-1,-1):
- for Key in dict(self.ToolsDefTxtDictionary):
- List = Key.split('_')
- if List[Index] == '*':
- for String in self.ToolsDefTxtDatabase[KeyList[Index]]:
- List[Index] = String
- NewKey = '%s_%s_%s_%s_%s' % tuple(List)
- if NewKey not in self.ToolsDefTxtDictionary:
- self.ToolsDefTxtDictionary[NewKey] = self.ToolsDefTxtDictionary[Key]
- continue
- del self.ToolsDefTxtDictionary[Key]
- elif List[Index] not in self.ToolsDefTxtDatabase[KeyList[Index]]:
- del self.ToolsDefTxtDictionary[Key]
-
- ## ExpandMacros
- #
- # Replace defined macros with real value
- #
- # @param Value: The string with unreplaced macros
- #
- # @retval Value: The string which has been replaced with real value
- #
- def ExpandMacros(self, Value):
- EnvReference = gEnvRefPattern.findall(Value)
- for Ref in EnvReference:
- if Ref not in self.MacroDictionary:
- Value = Value.replace(Ref, "")
- else:
- Value = Value.replace(Ref, self.MacroDictionary[Ref])
-
-
- MacroReference = gMacroRefPattern.findall(Value)
- for Ref in MacroReference:
- if Ref not in self.MacroDictionary:
- return False, Ref
- Value = Value.replace(Ref, self.MacroDictionary[Ref])
-
- return True, Value
-
-## ToolDefDict
-#
-# Load tools_def.txt in input workspace dir
-#
-# @param WorkSpace: Workspace dir
-#
-# @retval ToolDef An instance of ToolDefClassObject() with loaded tools_def.txt
-#
-def ToolDefDict(WorkSpace):
- Target = TargetTxtDict(WorkSpace)
- ToolDef = ToolDefClassObject()
- if DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF in Target.TargetTxtDictionary:
- gDefaultToolsDefFile = Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
- ToolDef.LoadToolDefFile(os.path.normpath(os.path.join(WorkSpace, gDefaultToolsDefFile)))
- return ToolDef
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- ToolDef = ToolDefDict(os.getenv("WORKSPACE"))
- pass
diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/Source/Python/Common/VpdInfoFile.py
deleted file mode 100644
index 207cc8735b..0000000000
--- a/BaseTools/Source/Python/Common/VpdInfoFile.py
+++ /dev/null
@@ -1,256 +0,0 @@
-## @file
-#
-# This package manage the VPD PCD information file which will be generated
-# by build tool's autogen.
-# The VPD PCD information file will be input for third-party BPDG tool which
-# is pointed by *_*_*_VPD_TOOL_GUID in conf/tools_def.txt
-#
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-import os
-import re
-import Common.EdkLogger as EdkLogger
-import Common.BuildToolError as BuildToolError
-import subprocess
-
-FILE_COMMENT_TEMPLATE = \
-"""
-## @file
-#
-# THIS IS AUTO-GENERATED FILE BY BUILD TOOLS AND PLEASE DO NOT MAKE MODIFICATION.
-#
-# This file lists all VPD informations for a platform collected by build.exe.
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-"""
-
-## The class manage VpdInfoFile.
-#
-# This file contains an ordered (based on position in the DSC file) list of the PCDs specified in the platform description file (DSC). The Value field that will be assigned to the PCD comes from the DSC file, INF file (if not defined in the DSC file) or the DEC file (if not defined in the INF file). This file is used as an input to the BPDG tool.
-# Format for this file (using EBNF notation) is:
-# <File> :: = [<CommentBlock>]
-# [<PcdEntry>]*
-# <CommentBlock> ::= ["#" <String> <EOL>]*
-# <PcdEntry> ::= <PcdName> "|" <Offset> "|" <Size> "|" <Value> <EOL>
-# <PcdName> ::= <TokenSpaceCName> "." <PcdCName>
-# <TokenSpaceCName> ::= C Variable Name of the Token Space GUID
-# <PcdCName> ::= C Variable Name of the PCD
-# <Offset> ::= {"*"} {<HexNumber>}
-# <HexNumber> ::= "0x" (a-fA-F0-9){1,8}
-# <Size> ::= <HexNumber>
-# <Value> ::= {<HexNumber>} {<NonNegativeInt>} {<QString>} {<Array>}
-# <NonNegativeInt> ::= (0-9)+
-# <QString> ::= ["L"] <DblQuote> <String> <DblQuote>
-# <DblQuote> ::= 0x22
-# <Array> ::= {<CArray>} {<NList>}
-# <CArray> ::= "{" <HexNumber> ["," <HexNumber>]* "}"
-# <NList> ::= <HexNumber> ["," <HexNumber>]*
-#
-class VpdInfoFile:
-
- ## The mapping dictionary from datum type to size string.
- _MAX_SIZE_TYPE = {"BOOLEAN":"1", "UINT8":"1", "UINT16":"2", "UINT32":"4", "UINT64":"8"}
- _rVpdPcdLine = None
- ## Constructor
- def __init__(self):
- ## Dictionary for VPD in following format
- #
- # Key : PcdClassObject instance.
- # @see BuildClassObject.PcdClassObject
- # Value : offset in different SKU such as [sku1_offset, sku2_offset]
- self._VpdArray = {}
-
- ## Add a VPD PCD collected from platform's autogen when building.
- #
- # @param vpds The list of VPD PCD collected for a platform.
- # @see BuildClassObject.PcdClassObject
- #
- # @param offset integer value for VPD's offset in specific SKU.
- #
- def Add(self, Vpd, Offset):
- if (Vpd == None):
- EdkLogger.error("VpdInfoFile", BuildToolError.ATTRIBUTE_UNKNOWN_ERROR, "Invalid VPD PCD entry.")
-
- if not (Offset >= 0 or Offset == "*"):
- EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALID, "Invalid offset parameter: %s." % Offset)
-
- if Vpd.DatumType == "VOID*":
- if Vpd.MaxDatumSize <= 0:
- EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALID,
- "Invalid max datum size for VPD PCD %s.%s" % (Vpd.TokenSpaceGuidCName, Vpd.TokenCName))
- elif Vpd.DatumType in ["BOOLEAN", "UINT8", "UINT16", "UINT32", "UINT64"]:
- if Vpd.MaxDatumSize == None or Vpd.MaxDatumSize == "":
- Vpd.MaxDatumSize = VpdInfoFile._MAX_SIZE_TYPE[Vpd.DatumType]
- else:
- EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALID,
- "Invalid DatumType %s for VPD PCD %s.%s" % (Vpd.DatumType, Vpd.TokenSpaceGuidCName, Vpd.TokenCName))
-
- if Vpd not in self._VpdArray.keys():
- #
- # If there is no Vpd instance in dict, that imply this offset for a given SKU is a new one
- #
- self._VpdArray[Vpd] = [Offset]
- else:
- #
- # If there is an offset for a specific SKU in dict, then append this offset for other sku to array.
- #
- self._VpdArray[Vpd].append(Offset)
-
-
- ## Generate VPD PCD information into a text file
- #
- # If parameter FilePath is invalid, then assert.
- # If
- # @param FilePath The given file path which would hold VPD information
- def Write(self, FilePath):
- if not (FilePath != None or len(FilePath) != 0):
- EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALID,
- "Invalid parameter FilePath: %s." % FilePath)
- try:
- fd = open(FilePath, "w")
- except:
- EdkLogger.error("VpdInfoFile",
- BuildToolError.FILE_OPEN_FAILURE,
- "Fail to open file %s for written." % FilePath)
-
- try:
- # write file header
- fd.write(FILE_COMMENT_TEMPLATE)
-
- # write each of PCD in VPD type
- Pcds = self._VpdArray.keys()
- Pcds.sort()
- for Pcd in Pcds:
- for Offset in self._VpdArray[Pcd]:
- PcdValue = str(Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]].DefaultValue).strip()
- if PcdValue == "" :
- PcdValue = Pcd.DefaultValue
-
- fd.write("%s.%s|%s|%s|%s \n" % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, str(Offset).strip(), str(Pcd.MaxDatumSize).strip(),PcdValue))
- except:
- EdkLogger.error("VpdInfoFile",
- BuildToolError.FILE_WRITE_FAILURE,
- "Fail to write file %s" % FilePath)
- fd.close()
-
- ## Read an existing VPD PCD info file.
- #
- # This routine will read VPD PCD information from existing file and construct
- # internal PcdClassObject array.
- # This routine could be used by third-party tool to parse VPD info file content.
- #
- # @param FilePath The full path string for existing VPD PCD info file.
- def Read(self, FilePath):
- try:
- fd = open(FilePath, "r")
- except:
- EdkLogger.error("VpdInfoFile",
- BuildToolError.FILE_OPEN_FAILURE,
- "Fail to open file %s for written." % FilePath)
- Lines = fd.readlines()
- for Line in Lines:
- Line = Line.strip()
- if len(Line) == 0 or Line.startswith("#"):
- continue
-
- #
- # the line must follow output format defined in BPDG spec.
- #
- try:
- PcdName, Offset, Size, Value = Line.split("#")[0].split("|")
- TokenSpaceName, PcdTokenName = PcdName.split(".")
- except:
- EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR, "Fail to parse VPD information file %s" % FilePath)
-
- Found = False
- for VpdObject in self._VpdArray.keys():
- if VpdObject.TokenSpaceGuidCName == TokenSpaceName and VpdObject.TokenCName == PcdTokenName.strip():
- if self._VpdArray[VpdObject][0] == "*":
- if Offset == "*":
- EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "The offset of %s has not been fixed up by third-party BPDG tool." % PcdName)
-
- self._VpdArray[VpdObject][0] = Offset
- Found = True
- break
- if not Found:
- EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR, "Can not find PCD defined in VPD guid file.")
-
- ## Get count of VPD PCD collected from platform's autogen when building.
- #
- # @return The integer count value
- def GetCount(self):
- Count = 0
- for OffsetList in self._VpdArray.values():
- Count += len(OffsetList)
-
- return Count
-
- ## Get an offset value for a given VPD PCD
- #
- # Because BPDG only support one Sku, so only return offset for SKU default.
- #
- # @param vpd A given VPD PCD
- def GetOffset(self, vpd):
- if not self._VpdArray.has_key(vpd):
- return None
-
- if len(self._VpdArray[vpd]) == 0:
- return None
-
- return self._VpdArray[vpd]
-
-## Call external BPDG tool to process VPD file
-#
-# @param ToolPath The string path name for BPDG tool
-# @param VpdFileName The string path name for VPD information guid.txt
-#
-def CallExtenalBPDGTool(ToolPath, VpdFileName):
- assert ToolPath != None, "Invalid parameter ToolPath"
- assert VpdFileName != None and os.path.exists(VpdFileName), "Invalid parameter VpdFileName"
-
- OutputDir = os.path.dirname(VpdFileName)
- FileName = os.path.basename(VpdFileName)
- BaseName, ext = os.path.splitext(FileName)
- OutputMapFileName = os.path.join(OutputDir, "%s.map" % BaseName)
- OutputBinFileName = os.path.join(OutputDir, "%s.bin" % BaseName)
-
- try:
- PopenObject = subprocess.Popen([ToolPath,
- '-o', OutputBinFileName,
- '-m', OutputMapFileName,
- '-q',
- '-f',
- VpdFileName],
- stdout=subprocess.PIPE,
- stderr= subprocess.PIPE)
- except Exception, X:
- EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, ExtraData="%s" % (str(X)))
- (out, error) = PopenObject.communicate()
- print out
- while PopenObject.returncode == None :
- PopenObject.wait()
-
- if PopenObject.returncode != 0:
- if PopenObject.returncode != 0:
- EdkLogger.debug(EdkLogger.DEBUG_1, "Fail to call BPDG tool", str(error))
- EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, "Fail to execute BPDG tool with exit code: %d, the error message is: \n %s" % \
- (PopenObject.returncode, str(error)))
-
- return PopenObject.returncode
diff --git a/BaseTools/Source/Python/Common/__init__.py b/BaseTools/Source/Python/Common/__init__.py
deleted file mode 100644
index d8a96f9bfb..0000000000
--- a/BaseTools/Source/Python/Common/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'Common' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/CommonDataClass/CommonClass.py b/BaseTools/Source/Python/CommonDataClass/CommonClass.py
deleted file mode 100644
index bb4b434af8..0000000000
--- a/BaseTools/Source/Python/CommonDataClass/CommonClass.py
+++ /dev/null
@@ -1,473 +0,0 @@
-## @file
-# This file is used to define common items of class object
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
-#
-# Generate help text
-#
-def GenerateHelpText(Text, Lang):
- if Text:
- Ht = HelpTextClass()
- Ht.Lang = Lang
- Ht.String = Text
-
- return Ht
-
- return None
-
-## CommonClass
-#
-# This class defined common items used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-# @param Usage: Input value for Usage, default is []
-# @param FeatureFlag: Input value for FeatureFalg, default is ''
-# @param SupArchList: Input value for SupArchList, default is []
-# @param HelpText: Input value for HelpText, default is ''
-#
-# @var Usage: To store value for Usage, selection scope is in below list
-# ALWAYS_CONSUMED | SOMETIMES_CONSUMED | ALWAYS_PRODUCED | SOMETIMES_PRODUCED | TO_START | BY_START | PRIVATE
-# @var FeatureFlag: To store value for FeatureFlag
-# @var SupArchList: To store value for SupArchList, selection scope is in below list
-# EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64
-# @var HelpText: To store value for HelpText
-#
-class CommonClass(object):
- def __init__(self, Usage = None, FeatureFlag = '', SupArchList = None, HelpText = ''):
- self.Usage = Usage
- if self.Usage == None:
- self.Usage = []
- self.FeatureFlag = FeatureFlag
- self.SupArchList = SupArchList
- if self.SupArchList == None:
- self.SupArchList = []
- self.HelpText = HelpText
- self.HelpTextList = []
-
-## CommonHeaderClass
-#
-# This class defined common items used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-#
-# @var Abstract: To store value for Abstract
-# @var Description: To store value for Description
-# @var Copyright: To store value for Copyright
-# @var License: To store value for License
-# @var Specification: To store value for Specification
-#
-class CommonHeaderClass(object):
- def __init__(self):
- self.Abstract = ''
- self.Description = ''
- self.Copyright = ''
- self.License = ''
- self.Specification = {}
-
-## HelpTextClass
-#
-# This class defined HelpText item used in PKG file
-#
-# @param object: Inherited from object class
-#
-# @var Lang: To store value for Lang
-# @var String: To store value for String
-#
-class HelpTextClass(object):
- def __init__(self):
- self.Lang = ''
- self.String = ''
-
-## DefineClass
-#
-# This class defined item DEFINE used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-#
-# @var Define: To store value for Define, it is a set structure as
-# { (DefineName, Arch) : DefineValue, ... }
-#
-class DefineClass(object):
- def __init__(self):
- self.Define = {}
-
-## ClonedRecordClass
-#
-# This class defined ClonedRecord items used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-#
-# @var Id: To store value for Id
-# @var FarGuid: To store value for FarGuid
-# @var PackageGuid: To store value for PackageGuid
-# @var PackageVersion: To store value for PackageVersion
-# @var ModuleGuid: To store value for ModuleGuid
-# @var ModuleVersion: To store value for ModuleVersion
-#
-class ClonedRecordClass(object):
- def __init__(self):
- self.Id = 0
- self.FarGuid = ''
- self.PackageGuid = ''
- self.PackageVersion = ''
- self.ModuleGuid = ''
- self.ModuleVersion = ''
-
-## IdentificationClass
-#
-# This class defined Identification items used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-#
-# @var Name: To store value for Name
-# ModuleName(Inf) / PackageName(Dec) / PlatformName(Dsc)
-# @var Guid: To store value for Guid
-# @var Version: To store value for Version
-# @var FileName: To store value for FileName
-# @var FullPath: To store value for FullPath
-#
-class IdentificationClass(object):
- def __init__(self):
- self.Name = ''
- self.BaseName = ''
- self.Guid = ''
- self.Version = ''
- self.FileName = ''
- self.FullPath = ''
- self.RelaPath = ''
- self.PackagePath = ''
- self.ModulePath = ''
- self.CombinePath = ''
-
-## IncludeStatementClass
-#
-# This class defined IncludeFiles item used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-#
-# @var IncludeFiles: To store value for IncludeFiles
-# It is a set structure as { IncludeFile : [Arch1, Arch2, ...], ... }
-#
-class IncludeStatementClass(object):
- def __init__(self):
- self.IncludeFiles = {}
-
-## GuidProtocolPpiCommonClass
-#
-# This class defined Guid, Protocol and Ppi like items used in Module/Platform/Package files
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var Name: To store value for Name
-# @var CName: To store value for CName
-# @var Guid: To store value for Guid
-# @var Notify: To store value for Notify
-# @var GuidTypeList: To store value for GuidTypeList, selection scope is in below list
-# DATA_HUB_RECORD | EFI_EVENT | EFI_SYSTEM_CONFIGURATION_TABLE | EFI_VARIABLE | GUID | HII_PACKAGE_LIST | HOB | TOKEN_SPACE_GUID
-# @var SupModuleList: To store value for SupModuleList, selection scope is in below list
-# BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED | SMM_CORE
-#
-class GuidProtocolPpiCommonClass(CommonClass):
- def __init__(self):
- self.Name = ''
- self.CName = ''
- self.Guid = ''
- self.VariableName = ''
- self.Notify = False
- self.GuidTypeList = []
- self.GuidTypeLists = []
- self.SupModuleList = []
- CommonClass.__init__(self)
-
-## LibraryClassClass
-#
-# This class defined Library item used in Module/Platform/Package files
-#
-# @param CommonClass: Inherited from CommonClass class
-# @param DefineClass: Inherited from DefineClass class
-#
-# @var LibraryClass: To store value for LibraryClass
-# @var IncludeHeader: To store value for IncludeHeader
-# @var RecommendedInstanceVersion: To store value for RecommendedInstanceVersion
-# @var RecommendedInstanceGuid: To store value for RecommendedInstanceGuid
-# @var RecommendedInstance: To store value for RecommendedInstance, selection scope is in below list
-# DATA_HUB_RECORD | EFI_EVENT | EFI_SYSTEM_CONFIGURATION_TABLE | EFI_VARIABLE | GUID | HII_PACKAGE_LIST | HOB | TOKEN_SPACE_GUID
-# @var SupModuleList: To store value for SupModuleList, selection scope is in below list
-# BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED | SMM_CORE
-#
-class LibraryClassClass(CommonClass, DefineClass):
- def __init__(self):
- self.LibraryClass = ''
- self.IncludeHeader = ''
- self.RecommendedInstanceVersion = ''
- self.RecommendedInstanceGuid = ''
- self.RecommendedInstance = ''
- self.SupModuleList = []
- CommonClass.__init__(self)
- DefineClass.__init__(self)
-
-## GuidClass
-#
-# This class defined Guid item used in Module/Platform/Package files
-#
-# @param GuidProtocolPpiCommonClass: Inherited from GuidProtocolPpiCommonClass class
-#
-class GuidClass(GuidProtocolPpiCommonClass):
- def __init__(self):
- GuidProtocolPpiCommonClass.__init__(self)
-
-## ProtocolClass
-#
-# This class defined Protocol item used in Module/Platform/Package files
-#
-# @param GuidProtocolPpiCommonClass: Inherited from GuidProtocolPpiCommonClass class
-#
-class ProtocolClass(GuidProtocolPpiCommonClass):
- def __init__(self):
- GuidProtocolPpiCommonClass.__init__(self)
-
-## PpiClass
-#
-# This class defined Ppi item used in Module/Platform/Package files
-#
-# @param GuidProtocolPpiCommonClass: Inherited from GuidProtocolPpiCommonClass class
-#
-class PpiClass(GuidProtocolPpiCommonClass):
- def __init__(self):
- GuidProtocolPpiCommonClass.__init__(self)
-
-## SkuInfoClass
-#
-# This class defined SkuInfo item used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-# @param SkuIdName: Input value for SkuIdName, default is ''
-# @param SkuId: Input value for SkuId, default is ''
-# @param VariableName: Input value for VariableName, default is ''
-# @param VariableGuid: Input value for VariableGuid, default is ''
-# @param VariableOffset: Input value for VariableOffset, default is ''
-# @param HiiDefaultValue: Input value for HiiDefaultValue, default is ''
-# @param VpdOffset: Input value for VpdOffset, default is ''
-# @param DefaultValue: Input value for DefaultValue, default is ''
-#
-# @var SkuIdName: To store value for SkuIdName
-# @var SkuId: To store value for SkuId
-# @var VariableName: To store value for VariableName
-# @var VariableGuid: To store value for VariableGuid
-# @var VariableOffset: To store value for VariableOffset
-# @var HiiDefaultValue: To store value for HiiDefaultValue
-# @var VpdOffset: To store value for VpdOffset
-# @var DefaultValue: To store value for DefaultValue
-#
-class SkuInfoClass(object):
- def __init__(self, SkuIdName = '', SkuId = '', VariableName = '', VariableGuid = '', VariableOffset = '',
- HiiDefaultValue = '', VpdOffset = '', DefaultValue = '', VariableGuidValue = ''):
- self.SkuIdName = SkuIdName
- self.SkuId = SkuId
-
- #
- # Used by Hii
- #
- self.VariableName = VariableName
- self.VariableGuid = VariableGuid
- self.VariableGuidValue = VariableGuidValue
- self.VariableOffset = VariableOffset
- self.HiiDefaultValue = HiiDefaultValue
-
- #
- # Used by Vpd
- #
- self.VpdOffset = VpdOffset
-
- #
- # Used by Default
- #
- self.DefaultValue = DefaultValue
-
- ## Convert the class to a string
- #
- # Convert each member of the class to string
- # Organize to a signle line format string
- #
- # @retval Rtn Formatted String
- #
- def __str__(self):
- Rtn = 'SkuId = ' + str(self.SkuId) + "," + \
- 'SkuIdName = ' + str(self.SkuIdName) + "," + \
- 'VariableName = ' + str(self.VariableName) + "," + \
- 'VariableGuid = ' + str(self.VariableGuid) + "," + \
- 'VariableOffset = ' + str(self.VariableOffset) + "," + \
- 'HiiDefaultValue = ' + str(self.HiiDefaultValue) + "," + \
- 'VpdOffset = ' + str(self.VpdOffset) + "," + \
- 'DefaultValue = ' + str(self.DefaultValue) + ","
- return Rtn
-## PcdErrorClass
-#
-#
-#
-class PcdErrorClass(object):
- def __init__(self):
- self.ValidValueList = ''
- self.ValidValueListLang = ''
- self.ValidValueRange = ''
- self.Expression = ''
- self.ErrorNumber = ''
- self.ErrorMessage = []
-
-## PcdClass
-#
-# This class defined Pcd item used in Module/Platform/Package files
-#
-# @param CommonClass: Inherited from CommonClass class
-# @param CName: Input value for CName, default is ''
-# @param Token: Input value for Token, default is ''
-# @param TokenSpaceGuidCName: Input value for TokenSpaceGuidCName, default is ''
-# @param DatumType: Input value for DatumType, default is ''
-# @param MaxDatumSize: Input value for MaxDatumSize, default is ''
-# @param DefaultValue: Input value for DefaultValue, default is ''
-# @param ItemType: Input value for ItemType, default is ''
-# @param ValidUsage: Input value for ValidUsage, default is []
-# @param SkuInfoList: Input value for SkuInfoList, default is {}
-# @param SupModuleList: Input value for SupModuleList, default is []
-#
-# @var CName: To store value for CName
-# @var Token: To store value for Token
-# @var TokenSpaceGuidCName: To store value for TokenSpaceGuidCName
-# @var DatumType: To store value for DatumType, selection scope is in below list
-# UINT8 | UINT16 | UINT32 | UINT64 | VOID* | BOOLEAN
-# @var MaxDatumSize: To store value for MaxDatumSize
-# @var DefaultValue: To store value for DefaultValue
-# @var ItemType: To store value for ItemType, selection scope is in below list
-# FEATURE_FLAG | FIXED_AT_BUILD | PATCHABLE_IN_MODULE | DYNAMIC | DYNAMIC_EX
-# @var ValidUsage: To store value for ValidUsage, selection scope is in below list
-# FEATURE_FLAG | FIXED_AT_BUILD | PATCHABLE_IN_MODULE | DYNAMIC | DYNAMIC_EX
-# @var SkuInfoList: To store value for SkuInfoList
-# It is a set structure as { [SkuIdName] : SkuInfoClass }
-# @var SupModuleList: To store value for SupModuleList, selection scope is in below list
-# BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED | SMM_CORE
-#
-class PcdClass(CommonClass):
- def __init__(self, CName = '', Token = '', TokenSpaceGuidCName = '', DatumType = '', MaxDatumSize = '', DefaultValue = '', ItemType = '', ValidUsage = None, SkuInfoList = None, SupModuleList = None):
- self.CName = CName
- self.Token = Token
- self.TokenSpaceGuidCName = TokenSpaceGuidCName
- self.DatumType = DatumType
- self.MaxDatumSize = MaxDatumSize
- self.DefaultValue = DefaultValue
- self.ItemType = ItemType
- self.ValidUsage = ValidUsage
- self.PcdItemType = ''
- self.TokenSpaceGuidValue = ''
- self.PcdUsage = ''
- self.PcdCName = ''
- self.Value = ''
- self.Offset = ''
- if self.ValidUsage == None:
- self.ValidUsage = []
- self.SkuInfoList = SkuInfoList
- if self.SkuInfoList == None:
- self.SkuInfoList = {}
- self.SupModuleList = SupModuleList
- if self.SupModuleList == None:
- self.SupModuleList = []
- CommonClass.__init__(self)
- self.PcdErrors = []
-
-## BuildOptionClass
-#
-# This class defined BuildOption item used in Module/Platform/Package files
-#
-# @param IncludeStatementClass: Inherited from IncludeStatementClass class
-# @param ToolChainFamily: Input value for ToolChainFamily, default is ''
-# @param ToolChain: Input value for ToolChain, default is ''
-# @param Option: Input value for Option, default is ''
-#
-# @var Statement: To store value for Statement
-# It is a string in a special format as "Family:Target_TagName_Tarch_ToolCode_FLAGS = String"
-# @var ToolChainFamily: To store value for ToolChainFamily
-# @var ToolChain: To store value for ToolChain
-# @var Option: To store value for Option
-# @var BuildTarget: To store value for BuildTarget
-# @var TagName: To store value for TagName
-# @var ToolCode: To store value for ToolCode
-# @var SupArchList: To store value for SupArchList, selection scope is in below list
-# EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64
-#
-class BuildOptionClass(IncludeStatementClass):
- def __init__(self, ToolChainFamily = '', ToolChain = '', Option = ''):
- IncludeStatementClass.__init__(self)
- self.Statement = ''
- self.ToolChainFamily = ToolChainFamily
- self.ToolChain = ToolChain
- self.Option = Option
- self.BuildTarget = ''
- self.TagName = ''
- self.ToolCode = ''
- self.SupArchList = []
-
-## IncludeClass
-#
-# This class defined Include item used in Module/Platform/Package files
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var FilePath: To store value for FilePath
-# @var ModuleType: To store value for ModuleType
-# @var Comment: To store value for Comment
-#
-class IncludeClass(CommonClass):
- def __init__(self):
- self.FilePath = ''
- self.ModuleType = ''
- self.SupModuleList = []
- self.Comment = ''
- CommonClass.__init__(self)
-
-## FileClass
-#
-#
-class FileClass(CommonClass):
- def __init__(self):
- self.Filename = ''
- self.Executable = ''
- self.Family = ''
- self.FileType = ''
- CommonClass.__init__(self)
-
-
-## MiscFileClass
-#
-#
-class MiscFileClass(CommonHeaderClass):
- def __init__(self):
- CommonHeaderClass.__init__(self)
- self.Name = ''
- self.Files = []
-
-
-## UserExtensionsClass
-#
-# This class defined UserExtensions item used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-#
-# @var UserID: To store value for UserID
-# @var Identifier: To store value for Identifier
-# @var Content: To store value for Content
-#
-class UserExtensionsClass(object):
- def __init__(self):
- self.UserID = ''
- self.Identifier = 0
- self.Content = ''
- self.Defines = []
- self.BuildOptions = []
diff --git a/BaseTools/Source/Python/CommonDataClass/DataClass.py b/BaseTools/Source/Python/CommonDataClass/DataClass.py
deleted file mode 100644
index 3d971c84cd..0000000000
--- a/BaseTools/Source/Python/CommonDataClass/DataClass.py
+++ /dev/null
@@ -1,361 +0,0 @@
-## @file
-# This file is used to define class for data structure used in ECC
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-
-##
-# Static values for data models
-#
-MODEL_UNKNOWN = 0
-
-MODEL_FILE_C = 1001
-MODEL_FILE_H = 1002
-MODEL_FILE_ASM = 1003
-MODEL_FILE_INF = 1011
-MODEL_FILE_DEC = 1012
-MODEL_FILE_DSC = 1013
-MODEL_FILE_FDF = 1014
-MODEL_FILE_INC = 1015
-MODEL_FILE_CIF = 1016
-MODEL_FILE_OTHERS = 1099
-
-MODEL_IDENTIFIER_FILE_HEADER = 2001
-MODEL_IDENTIFIER_FUNCTION_HEADER = 2002
-MODEL_IDENTIFIER_COMMENT = 2003
-MODEL_IDENTIFIER_PARAMETER = 2004
-MODEL_IDENTIFIER_STRUCTURE = 2005
-MODEL_IDENTIFIER_VARIABLE = 2006
-MODEL_IDENTIFIER_INCLUDE = 2007
-MODEL_IDENTIFIER_PREDICATE_EXPRESSION = 2008
-MODEL_IDENTIFIER_ENUMERATE = 2009
-MODEL_IDENTIFIER_PCD = 2010
-MODEL_IDENTIFIER_UNION = 2011
-MODEL_IDENTIFIER_MACRO_IFDEF = 2012
-MODEL_IDENTIFIER_MACRO_IFNDEF = 2013
-MODEL_IDENTIFIER_MACRO_DEFINE = 2014
-MODEL_IDENTIFIER_MACRO_ENDIF = 2015
-MODEL_IDENTIFIER_MACRO_PROGMA = 2016
-MODEL_IDENTIFIER_FUNCTION_CALLING = 2018
-MODEL_IDENTIFIER_TYPEDEF = 2017
-MODEL_IDENTIFIER_FUNCTION_DECLARATION = 2019
-MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION = 2020
-
-MODEL_EFI_PROTOCOL = 3001
-MODEL_EFI_PPI = 3002
-MODEL_EFI_GUID = 3003
-MODEL_EFI_LIBRARY_CLASS = 3004
-MODEL_EFI_LIBRARY_INSTANCE = 3005
-MODEL_EFI_PCD = 3006
-MODEL_EFI_SOURCE_FILE = 3007
-MODEL_EFI_BINARY_FILE = 3008
-MODEL_EFI_SKU_ID = 3009
-MODEL_EFI_INCLUDE = 3010
-MODEL_EFI_DEPEX = 3011
-
-MODEL_PCD = 4000
-MODEL_PCD_FIXED_AT_BUILD = 4001
-MODEL_PCD_PATCHABLE_IN_MODULE = 4002
-MODEL_PCD_FEATURE_FLAG = 4003
-MODEL_PCD_DYNAMIC_EX = 4004
-MODEL_PCD_DYNAMIC_EX_DEFAULT = 4005
-MODEL_PCD_DYNAMIC_EX_VPD = 4006
-MODEL_PCD_DYNAMIC_EX_HII = 4007
-MODEL_PCD_DYNAMIC = 4008
-MODEL_PCD_DYNAMIC_DEFAULT = 4009
-MODEL_PCD_DYNAMIC_VPD = 4010
-MODEL_PCD_DYNAMIC_HII = 4011
-
-MODEL_META_DATA_HEADER = 5001
-MODEL_META_DATA_INCLUDE = 5002
-MODEL_META_DATA_DEFINE = 5003
-MODEL_META_DATA_CONDITIONAL_STATEMENT_IF = 5004
-MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE = 5005
-MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF = 5006
-MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF = 5007
-MODEL_META_DATA_BUILD_OPTION = 5008
-MODEL_META_DATA_COMPONENT = 5009
-MODEL_META_DATA_USER_EXTENSION = 5010
-MODEL_META_DATA_PACKAGE = 5011
-MODEL_META_DATA_NMAKE = 5012
-MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF = 5013
-MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF = 5014
-MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH = 5015
-MODEL_META_DATA_COMMENT = 5016
-MODEL_META_DATA_GLOBAL_DEFINE = 5017
-MODEL_META_DATA_SECTION_HEADER = 5100
-MODEL_META_DATA_SUBSECTION_HEADER = 5200
-
-MODEL_EXTERNAL_DEPENDENCY = 10000
-
-MODEL_LIST = [('MODEL_UNKNOWN', MODEL_UNKNOWN),
- ('MODEL_FILE_C', MODEL_FILE_C),
- ('MODEL_FILE_H', MODEL_FILE_H),
- ('MODEL_FILE_ASM', MODEL_FILE_ASM),
- ('MODEL_FILE_INF', MODEL_FILE_INF),
- ('MODEL_FILE_DEC', MODEL_FILE_DEC),
- ('MODEL_FILE_DSC', MODEL_FILE_DSC),
- ('MODEL_FILE_FDF', MODEL_FILE_FDF),
- ('MODEL_FILE_INC', MODEL_FILE_INC),
- ('MODEL_FILE_CIF', MODEL_FILE_CIF),
- ('MODEL_FILE_OTHERS', MODEL_FILE_OTHERS),
- ('MODEL_IDENTIFIER_FILE_HEADER', MODEL_IDENTIFIER_FILE_HEADER),
- ('MODEL_IDENTIFIER_FUNCTION_HEADER', MODEL_IDENTIFIER_FUNCTION_HEADER),
- ('MODEL_IDENTIFIER_COMMENT', MODEL_IDENTIFIER_COMMENT),
- ('MODEL_IDENTIFIER_PARAMETER', MODEL_IDENTIFIER_PARAMETER),
- ('MODEL_IDENTIFIER_STRUCTURE', MODEL_IDENTIFIER_STRUCTURE),
- ('MODEL_IDENTIFIER_VARIABLE', MODEL_IDENTIFIER_VARIABLE),
- ('MODEL_IDENTIFIER_INCLUDE', MODEL_IDENTIFIER_INCLUDE),
- ('MODEL_IDENTIFIER_PREDICATE_EXPRESSION', MODEL_IDENTIFIER_PREDICATE_EXPRESSION),
- ('MODEL_IDENTIFIER_ENUMERATE', MODEL_IDENTIFIER_ENUMERATE),
- ('MODEL_IDENTIFIER_PCD', MODEL_IDENTIFIER_PCD),
- ('MODEL_IDENTIFIER_UNION', MODEL_IDENTIFIER_UNION),
- ('MODEL_IDENTIFIER_MACRO_IFDEF', MODEL_IDENTIFIER_MACRO_IFDEF),
- ('MODEL_IDENTIFIER_MACRO_IFNDEF', MODEL_IDENTIFIER_MACRO_IFNDEF),
- ('MODEL_IDENTIFIER_MACRO_DEFINE', MODEL_IDENTIFIER_MACRO_DEFINE),
- ('MODEL_IDENTIFIER_MACRO_ENDIF', MODEL_IDENTIFIER_MACRO_ENDIF),
- ('MODEL_IDENTIFIER_MACRO_PROGMA', MODEL_IDENTIFIER_MACRO_PROGMA),
- ('MODEL_IDENTIFIER_FUNCTION_CALLING', MODEL_IDENTIFIER_FUNCTION_CALLING),
- ('MODEL_IDENTIFIER_TYPEDEF', MODEL_IDENTIFIER_TYPEDEF),
- ('MODEL_IDENTIFIER_FUNCTION_DECLARATION', MODEL_IDENTIFIER_FUNCTION_DECLARATION),
- ('MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION', MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION),
- ('MODEL_EFI_PROTOCOL', MODEL_EFI_PROTOCOL),
- ('MODEL_EFI_PPI', MODEL_EFI_PPI),
- ('MODEL_EFI_GUID', MODEL_EFI_GUID),
- ('MODEL_EFI_LIBRARY_CLASS', MODEL_EFI_LIBRARY_CLASS),
- ('MODEL_EFI_LIBRARY_INSTANCE', MODEL_EFI_LIBRARY_INSTANCE),
- ('MODEL_EFI_PCD', MODEL_EFI_PCD),
- ('MODEL_EFI_SKU_ID', MODEL_EFI_SKU_ID),
- ('MODEL_EFI_INCLUDE', MODEL_EFI_INCLUDE),
- ('MODEL_EFI_DEPEX', MODEL_EFI_DEPEX),
- ('MODEL_IDENTIFIER_UNION', MODEL_IDENTIFIER_UNION),
- ('MODEL_EFI_SOURCE_FILE', MODEL_EFI_SOURCE_FILE),
- ('MODEL_EFI_BINARY_FILE', MODEL_EFI_BINARY_FILE),
- ('MODEL_PCD', MODEL_PCD),
- ('MODEL_PCD_FIXED_AT_BUILD', MODEL_PCD_FIXED_AT_BUILD),
- ('MODEL_PCD_PATCHABLE_IN_MODULE', MODEL_PCD_PATCHABLE_IN_MODULE),
- ('MODEL_PCD_FEATURE_FLAG', MODEL_PCD_FEATURE_FLAG),
- ('MODEL_PCD_DYNAMIC_EX', MODEL_PCD_DYNAMIC_EX),
- ('MODEL_PCD_DYNAMIC_EX_DEFAULT', MODEL_PCD_DYNAMIC_EX_DEFAULT),
- ('MODEL_PCD_DYNAMIC_EX_VPD', MODEL_PCD_DYNAMIC_EX_VPD),
- ('MODEL_PCD_DYNAMIC_EX_HII', MODEL_PCD_DYNAMIC_EX_HII),
- ('MODEL_PCD_DYNAMIC', MODEL_PCD_DYNAMIC),
- ('MODEL_PCD_DYNAMIC_DEFAULT', MODEL_PCD_DYNAMIC_DEFAULT),
- ('MODEL_PCD_DYNAMIC_VPD', MODEL_PCD_DYNAMIC_VPD),
- ('MODEL_PCD_DYNAMIC_HII', MODEL_PCD_DYNAMIC_HII),
- ("MODEL_META_DATA_HEADER", MODEL_META_DATA_HEADER),
- ("MODEL_META_DATA_INCLUDE", MODEL_META_DATA_INCLUDE),
- ("MODEL_META_DATA_DEFINE", MODEL_META_DATA_DEFINE),
- ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IF", MODEL_META_DATA_CONDITIONAL_STATEMENT_IF),
- ("MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE", MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE),
- ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF", MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF),
- ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF", MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF),
- ("MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH", MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH),
- ("MODEL_META_DATA_BUILD_OPTION", MODEL_META_DATA_BUILD_OPTION),
- ("MODEL_META_DATA_COMPONENT", MODEL_META_DATA_COMPONENT),
- ('MODEL_META_DATA_USER_EXTENSION', MODEL_META_DATA_USER_EXTENSION),
- ('MODEL_META_DATA_PACKAGE', MODEL_META_DATA_PACKAGE),
- ('MODEL_META_DATA_NMAKE', MODEL_META_DATA_NMAKE),
- ('MODEL_META_DATA_COMMENT', MODEL_META_DATA_COMMENT)
- ]
-
-## FunctionClass
-#
-# This class defines a structure of a function
-#
-# @param ID: ID of a Function
-# @param Header: Header of a Function
-# @param Modifier: Modifier of a Function
-# @param Name: Name of a Function
-# @param ReturnStatement: ReturnStatement of a Funciont
-# @param StartLine: StartLine of a Function
-# @param StartColumn: StartColumn of a Function
-# @param EndLine: EndLine of a Function
-# @param EndColumn: EndColumn of a Function
-# @param BodyStartLine: BodyStartLine of a Function Body
-# @param BodyStartColumn: BodyStartColumn of a Function Body
-# @param BelongsToFile: The Function belongs to which file
-# @param IdentifierList: IdentifierList of a File
-# @param PcdList: PcdList of a File
-#
-# @var ID: ID of a Function
-# @var Header: Header of a Function
-# @var Modifier: Modifier of a Function
-# @var Name: Name of a Function
-# @var ReturnStatement: ReturnStatement of a Funciont
-# @var StartLine: StartLine of a Function
-# @var StartColumn: StartColumn of a Function
-# @var EndLine: EndLine of a Function
-# @var EndColumn: EndColumn of a Function
-# @var BodyStartLine: StartLine of a Function Body
-# @var BodyStartColumn: StartColumn of a Function Body
-# @var BelongsToFile: The Function belongs to which file
-# @var IdentifierList: IdentifierList of a File
-# @var PcdList: PcdList of a File
-#
-class FunctionClass(object):
- def __init__(self, ID = -1, Header = '', Modifier = '', Name = '', ReturnStatement = '', \
- StartLine = -1, StartColumn = -1, EndLine = -1, EndColumn = -1, \
- BodyStartLine = -1, BodyStartColumn = -1, BelongsToFile = -1, \
- IdentifierList = [], PcdList = [], \
- FunNameStartLine = -1, FunNameStartColumn = -1):
- self.ID = ID
- self.Header = Header
- self.Modifier = Modifier
- self.Name = Name
- self.ReturnStatement = ReturnStatement
- self.StartLine = StartLine
- self.StartColumn = StartColumn
- self.EndLine = EndLine
- self.EndColumn = EndColumn
- self.BodyStartLine = BodyStartLine
- self.BodyStartColumn = BodyStartColumn
- self.BelongsToFile = BelongsToFile
- self.FunNameStartLine = FunNameStartLine
- self.FunNameStartColumn = FunNameStartColumn
-
- self.IdentifierList = IdentifierList
- self.PcdList = PcdList
-
-## IdentifierClass
-#
-# This class defines a structure of a variable
-#
-# @param ID: ID of a Identifier
-# @param Modifier: Modifier of a Identifier
-# @param Type: Type of a Identifier
-# @param Name: Name of a Identifier
-# @param Value: Value of a Identifier
-# @param Model: Model of a Identifier
-# @param BelongsToFile: The Identifier belongs to which file
-# @param BelongsToFunction: The Identifier belongs to which function
-# @param StartLine: StartLine of a Identifier
-# @param StartColumn: StartColumn of a Identifier
-# @param EndLine: EndLine of a Identifier
-# @param EndColumn: EndColumn of a Identifier
-#
-# @var ID: ID of a Identifier
-# @var Modifier: Modifier of a Identifier
-# @var Type: Type of a Identifier
-# @var Name: Name of a Identifier
-# @var Value: Value of a Identifier
-# @var Model: Model of a Identifier
-# @var BelongsToFile: The Identifier belongs to which file
-# @var BelongsToFunction: The Identifier belongs to which function
-# @var StartLine: StartLine of a Identifier
-# @var StartColumn: StartColumn of a Identifier
-# @var EndLine: EndLine of a Identifier
-# @var EndColumn: EndColumn of a Identifier
-#
-class IdentifierClass(object):
- def __init__(self, ID = -1, Modifier = '', Type = '', Name = '', Value = '', Model = MODEL_UNKNOWN, \
- BelongsToFile = -1, BelongsToFunction = -1, StartLine = -1, StartColumn = -1, EndLine = -1, EndColumn = -1):
- self.ID = ID
- self.Modifier = Modifier
- self.Type = Type
- self.Name = Name
- self.Value = Value
- self.Model = Model
- self.BelongsToFile = BelongsToFile
- self.BelongsToFunction = BelongsToFunction
- self.StartLine = StartLine
- self.StartColumn = StartColumn
- self.EndLine = EndLine
- self.EndColumn = EndColumn
-
-## PcdClass
-#
-# This class defines a structure of a Pcd
-#
-# @param ID: ID of a Pcd
-# @param CName: CName of a Pcd
-# @param TokenSpaceGuidCName: TokenSpaceGuidCName of a Pcd
-# @param Token: Token of a Pcd
-# @param DatumType: DatumType of a Pcd
-# @param Model: Model of a Pcd
-# @param BelongsToFile: The Pcd belongs to which file
-# @param BelongsToFunction: The Pcd belongs to which function
-# @param StartLine: StartLine of a Pcd
-# @param StartColumn: StartColumn of a Pcd
-# @param EndLine: EndLine of a Pcd
-# @param EndColumn: EndColumn of a Pcd
-#
-# @var ID: ID of a Pcd
-# @var CName: CName of a Pcd
-# @var TokenSpaceGuidCName: TokenSpaceGuidCName of a Pcd
-# @var Token: Token of a Pcd
-# @var DatumType: DatumType of a Pcd
-# @var Model: Model of a Pcd
-# @var BelongsToFile: The Pcd belongs to which file
-# @var BelongsToFunction: The Pcd belongs to which function
-# @var StartLine: StartLine of a Pcd
-# @var StartColumn: StartColumn of a Pcd
-# @var EndLine: EndLine of a Pcd
-# @var EndColumn: EndColumn of a Pcd
-#
-class PcdDataClass(object):
- def __init__(self, ID = -1, CName = '', TokenSpaceGuidCName = '', Token = '', DatumType = '', Model = MODEL_UNKNOWN, \
- BelongsToFile = -1, BelongsToFunction = -1, StartLine = -1, StartColumn = -1, EndLine = -1, EndColumn = -1):
- self.ID = ID
- self.CName = CName
- self.TokenSpaceGuidCName = TokenSpaceGuidCName
- self.Token = Token
- self.DatumType = DatumType
- self.BelongsToFile = BelongsToFile
- self.BelongsToFunction = BelongsToFunction
- self.StartLine = StartLine
- self.StartColumn = StartColumn
- self.EndLine = EndLine
- self.EndColumn = EndColumn
-
-## FileClass
-#
-# This class defines a structure of a file
-#
-# @param ID: ID of a File
-# @param Name: Name of a File
-# @param ExtName: ExtName of a File
-# @param Path: Path of a File
-# @param FullPath: FullPath of a File
-# @param Model: Model of a File
-# @param TimeStamp: TimeStamp of a File
-# @param FunctionList: FunctionList of a File
-# @param IdentifierList: IdentifierList of a File
-# @param PcdList: PcdList of a File
-#
-# @var ID: ID of a File
-# @var Name: Name of a File
-# @var ExtName: ExtName of a File
-# @var Path: Path of a File
-# @var FullPath: FullPath of a File
-# @var Model: Model of a File
-# @var TimeStamp: TimeStamp of a File
-# @var FunctionList: FunctionList of a File
-# @var IdentifierList: IdentifierList of a File
-# @var PcdList: PcdList of a File
-#
-class FileClass(object):
- def __init__(self, ID = -1, Name = '', ExtName = '', Path = '', FullPath = '', Model = MODEL_UNKNOWN, TimeStamp = '', \
- FunctionList = [], IdentifierList = [], PcdList = []):
- self.ID = ID
- self.Name = Name
- self.ExtName = ExtName
- self.Path = Path
- self.FullPath = FullPath
- self.Model = Model
- self.TimeStamp = TimeStamp
-
- self.FunctionList = FunctionList
- self.IdentifierList = IdentifierList
- self.PcdList = PcdList
diff --git a/BaseTools/Source/Python/CommonDataClass/Exceptions.py b/BaseTools/Source/Python/CommonDataClass/Exceptions.py
deleted file mode 100644
index 50541e80f2..0000000000
--- a/BaseTools/Source/Python/CommonDataClass/Exceptions.py
+++ /dev/null
@@ -1,29 +0,0 @@
-## @file
-# This file is used to define common Exceptions class used in python tools
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-## Exceptions used in Expression
-class EvaluationException(Exception):
- pass
-
-class BadExpression(EvaluationException):
- pass
-
-class WrnExpression(Exception):
- pass
-
-## Exceptions used in macro replacements
-class MacroException(Exception):
- pass
-
-class SymbolNotFound(MacroException):
- pass
-
diff --git a/BaseTools/Source/Python/CommonDataClass/FdfClass.py b/BaseTools/Source/Python/CommonDataClass/FdfClass.py
deleted file mode 100644
index 996468d6aa..0000000000
--- a/BaseTools/Source/Python/CommonDataClass/FdfClass.py
+++ /dev/null
@@ -1,409 +0,0 @@
-## @file
-# classes represent data in FDF
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-## FD data in FDF
-#
-#
-class FDClassObject:
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.FdUiName = ''
- self.CreateFileName = None
- self.BaseAddress = None
- self.BaseAddressPcd = None
- self.Size = None
- self.SizePcd = None
- self.ErasePolarity = '1'
- # 3-tuple list (blockSize, numBlocks, pcd)
- self.BlockSizeList = []
- # DefineVarDict[var] = value
- self.DefineVarDict = {}
- # SetVarDict[var] = value
- self.SetVarDict = {}
- self.RegionList = []
- self.vtfRawDict = {}
-
-## FV data in FDF
-#
-#
-class FvClassObject:
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.UiFvName = None
- self.CreateFileName = None
- # 3-tuple list (blockSize, numBlocks, pcd)
- self.BlockSizeList = []
- # DefineVarDict[var] = value
- self.DefineVarDict = {}
- # SetVarDict[var] = value
- self.SetVarDict = {}
- self.FvAlignment = None
- # FvAttributeDict[attribute] = TRUE/FALSE (1/0)
- self.FvAttributeDict = {}
- self.FvNameGuid = None
- self.AprioriSectionList = []
- self.FfsList = []
- self.BsBaseAddress = None
- self.RtBaseAddress = None
-
-## Region data in FDF
-#
-#
-class RegionClassObject:
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.Offset = None # The begin position of the Region
- self.Size = None # The Size of the Region
- self.PcdOffset = None
- self.PcdSize = None
- self.SetVarDict = {}
- self.RegionType = None
- self.RegionDataList = []
-
-## FFS data in FDF
-#
-#
-class FfsClassObject:
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.NameGuid = None
- self.Fixed = False
- self.CheckSum = False
- self.Alignment = None
- self.SectionList = []
-
-## FILE statement data in FDF
-#
-#
-class FileStatementClassObject (FfsClassObject) :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- FfsClassObject.__init__(self)
- self.FvFileType = None
- self.FileName = None
- self.KeyStringList = []
- self.FvName = None
- self.FdName = None
- self.DefineVarDict = {}
- self.AprioriSection = None
- self.KeepReloc = None
-
-## INF statement data in FDF
-#
-#
-class FfsInfStatementClassObject(FfsClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- FfsClassObject.__init__(self)
- self.Rule = None
- self.Version = None
- self.Ui = None
- self.InfFileName = None
- self.BuildNum = ''
- self.KeyStringList = []
- self.KeepReloc = None
- self.UseArch = None
-
-## APRIORI section data in FDF
-#
-#
-class AprioriSectionClassObject:
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- # DefineVarDict[var] = value
- self.DefineVarDict = {}
- self.FfsList = []
-
-## section data in FDF
-#
-#
-class SectionClassObject:
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.Alignment = None
-
-## Depex expression section in FDF
-#
-#
-class DepexSectionClassObject (SectionClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.DepexType = None
- self.Expression = None
- self.ExpressionProcessed = False
-
-## Compress section data in FDF
-#
-#
-class CompressSectionClassObject (SectionClassObject) :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- SectionClassObject.__init__(self)
- self.CompType = None
- self.SectionList = []
-
-## Data section data in FDF
-#
-#
-class DataSectionClassObject (SectionClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- SectionClassObject.__init__(self)
- self.SecType = None
- self.SectFileName = None
- self.SectionList = []
- self.KeepReloc = True
-
-## Rule section data in FDF
-#
-#
-class EfiSectionClassObject (SectionClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- SectionClassObject.__init__(self)
- self.SectionType = None
- self.Optional = False
- self.FileType = None
- self.StringData = None
- self.FileName = None
- self.FileExtension = None
- self.BuildNum = None
- self.KeepReloc = None
-
-## FV image section data in FDF
-#
-#
-class FvImageSectionClassObject (SectionClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- SectionClassObject.__init__(self)
- self.Fv = None
- self.FvName = None
- self.FvFileType = None
- self.FvFileName = None
- self.FvFileExtension = None
- self.FvAddr = None
-
-## GUIDed section data in FDF
-#
-#
-class GuidSectionClassObject (SectionClassObject) :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- SectionClassObject.__init__(self)
- self.NameGuid = None
- self.SectionList = []
- self.SectionType = None
- self.ProcessRequired = False
- self.AuthStatusValid = False
- self.ExtraHeaderSize = -1
- self.FvAddr = []
- self.FvParentAddr = None
- self.IncludeFvSection = False
-
-## UI section data in FDF
-#
-#
-class UiSectionClassObject (SectionClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- SectionClassObject.__init__(self)
- self.StringData = None
- self.FileName = None
-
-## Version section data in FDF
-#
-#
-class VerSectionClassObject (SectionClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- SectionClassObject.__init__(self)
- self.BuildNum = None
- self.StringData = None
- self.FileName = None
-
-## Rule data in FDF
-#
-#
-class RuleClassObject :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.Arch = None
- self.ModuleType = None # For Module Type
- self.TemplateName = None
- self.NameGuid = None
- self.Fixed = False
- self.Alignment = None
- self.SectAlignment = None
- self.CheckSum = False
- self.FvFileType = None # for Ffs File Type
- self.KeyStringList = []
- self.KeepReloc = None
-
-## Complex rule data in FDF
-#
-#
-class RuleComplexFileClassObject(RuleClassObject) :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- RuleClassObject.__init__(self)
- self.SectionList = []
-
-## Simple rule data in FDF
-#
-#
-class RuleSimpleFileClassObject(RuleClassObject) :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- RuleClassObject.__init__(self)
- self.FileName = None
- self.SectionType = ''
- self.FileExtension = None
-
-## File extension rule data in FDF
-#
-#
-class RuleFileExtensionClassObject(RuleClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- RuleClassObject.__init__(self)
- self.FileExtension = None
-
-## Capsule data in FDF
-#
-#
-class CapsuleClassObject :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.SpecName = None
- self.UiCapsuleName = None
- self.CreateFile = None
- self.GroupIdNumber = None
- # DefineVarDict[var] = value
- self.DefineVarDict = {}
- # SetVarDict[var] = value
- self.SetVarDict = {}
- # TokensDict[var] = value
- self.TokensDict = {}
- self.CapsuleDataList = []
-
-## VTF data in FDF
-#
-#
-class VtfClassObject :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.KeyArch = None
- self.ArchList = None
- self.UiName = None
- self.ResetBin = None
- self.ComponentStatementList = []
-
-## VTF component data in FDF
-#
-#
-class ComponentStatementClassObject :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.CompName = None
- self.CompLoc = None
- self.CompType = None
- self.CompVer = None
- self.CompCs = None
- self.CompBin = None
- self.CompSym = None
- self.CompSize = None
- self.FilePos = None
-
-## OptionROM data in FDF
-#
-#
-class OptionRomClassObject:
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.DriverName = None
- self.FfsList = []
-
diff --git a/BaseTools/Source/Python/CommonDataClass/ModuleClass.py b/BaseTools/Source/Python/CommonDataClass/ModuleClass.py
deleted file mode 100644
index c5ea15af5b..0000000000
--- a/BaseTools/Source/Python/CommonDataClass/ModuleClass.py
+++ /dev/null
@@ -1,485 +0,0 @@
-## @file
-# This file is used to define a class object to describe a module
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-##
-# Import Modules
-#
-from CommonClass import *
-
-## ModuleHeaderClass
-#
-# This class defined header items used in Module file
-#
-# @param IdentificationClass: Inherited from IdentificationClass class
-# @param CommonHeaderClass: Inherited from CommonHeaderClass class
-# @param DefineClass: Inherited from DefineClass class
-#
-# @var ModuleType: To store value for ModuleType
-# @var SupArchList: To store value for SupArchList, selection scope is in below list
-# EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64
-# @var BinaryModule: To store value for BinaryModule
-# @var OutputFileBasename: To store value for OutputFileBasename
-# @var ClonedFrom: To store value for ClonedFrom, it is a set structure as
-# [ ClonedRecordClass, ... ]
-# @var PcdIsDriver: To store value for PcdIsDriver, selection scope is in below list
-# PEI_PCD_DRIVER | DXE_PCD_DRIVER
-# @var TianoEdkFlashMap_h: To store value for TianoEdkFlashMap_h
-# @var InfVersion: To store value for InfVersion
-# @var UefiSpecificationVersion: To store value for UefiSpecificationVersion
-# @var EdkReleaseVersion: To store value for EdkReleaseVersion
-# @var LibraryClass: To store value for LibraryClass, it is a set structure as
-# [ LibraryClassClass, ...]
-# @var ComponentType: To store value for ComponentType, selection scope is in below list
-# LIBRARY | SECURITY_CORE | PEI_CORE | COMBINED_PEIM_DRIVER | PIC_PEIM | RELOCATABLE_PEIM | BS_DRIVER | RT_DRIVER | SAL_RT_DRIVER | APPLICATION
-# @var MakefileName: To store value for MakefileName
-# @var BuildNumber: To store value for BuildNumber
-# @var BuildType: To store value for BuildType
-# @var FfsExt: To store value for FfsExt
-# @var FvExt: To store value for FvExt
-# @var SourceFv: To store value for SourceFv
-# @var CustomMakefile: To store value for CustomMakefile, it is a set structure as
-# { Family : Filename, ... }
-# @var Shadow: To store value for Shadow
-# @var MacroDefines To store the defined macros
-#
-class ModuleHeaderClass(IdentificationClass, CommonHeaderClass, DefineClass):
- def __init__(self):
- IdentificationClass.__init__(self)
- CommonHeaderClass.__init__(self)
- DefineClass.__init__(self)
- self.ModuleType = ''
- self.SupModuleList = []
- self.SupArchList = []
- self.BinaryModule = False
- self.OutputFileBasename = ''
- self.ClonedFrom = []
- self.PcdIsDriver = ''
- self.TianoEdkFlashMap_h = False
- self.InfVersion = ''
- self.PiSpecificationVersion = ''
- self.UefiSpecificationVersion = ''
- self.EdkReleaseVersion = ''
- self.LibraryClass = []
- self.ComponentType = ''
- self.MakefileName = ''
- self.BuildNumber = ''
- self.BuildType = ''
- self.FfsExt = ''
- self.FvExt = ''
- self.SourceFv = ''
- self.CustomMakefile = {}
- self.Shadow = ''
- self.MacroDefines = {}
- self.SourceOverridePath = ''
- self.Specification = []
-
-## ModuleSourceFileClass
-#
-# This class defined source file item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-# @param SourceFile: Input value for SourceFile, default is ''
-# @param TagName: Input value for TagName, default is ''
-# @param ToolCode: Input value for ToolCode, default is ''
-# @param ToolChainFamily: Input value for ToolChainFamily, default is ''
-# @param FeatureFlag: Input value for FeatureFlag, default is ''
-# @param SupArchList: Input value for SupArchList, default is []
-#
-# @var SourceFile: To store value for SourceFile
-# @var TagName: To store value for TagName
-# @var ToolCode: To store value for ToolCode
-# @var ToolChainFamily: To store value for ToolChainFamily
-#
-class ModuleSourceFileClass(CommonClass):
- def __init__(self, SourceFile = '', TagName = '', ToolCode = '', ToolChainFamily = '', FeatureFlag = '', SupArchList = None):
- self.SourceFile = SourceFile
- self.TagName = TagName
- self.ToolCode = ToolCode
- self.ToolChainFamily = ToolChainFamily
- self.FileType = ''
- CommonClass.__init__(self, FeatureFlag = FeatureFlag, SupArchList = SupArchList)
-
-## ModuleBinaryFileClass
-#
-# This class defined binary file item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-# @param BinaryFile: Input value for BinaryFile, default is ''
-# @param FileType: Input value for FileType, default is ''
-# @param FeatureFlag: Input value for FeatureFlag, default is ''
-# @param SupArchList: Input value for SupArchList, default is []
-#
-# @var BinaryFile: To store value for BinaryFile
-# @var FileType: To store value for FileType, selection scope is in below list
-# FW | GUID | PREEFORM | UEFI_APP | UNI_UI | UNI_VER | LIB | PE32 | PIC | PEI_DEPEX | DXE_DEPEX | SMM_DEPEX| TE | VER | UI | BIN | FV
-# @var Target: To store value for Target
-# @var ToolChainFamily: To store value for ToolChainFamily
-#
-class ModuleBinaryFileClass(CommonClass):
- def __init__(self, BinaryFile = '', FileType = '', Target = '', FeatureFlag = '', SupArchList = None):
- self.BinaryFile = BinaryFile
- self.FileType = FileType
- self.Target = Target
- CommonClass.__init__(self, FeatureFlag = FeatureFlag, SupArchList = SupArchList)
- self.Filenames = []
- self.PatchPcdValues = []
- self.PcdExValues = []
- self.LibraryInstances = []
- self.BuildFlags = []
-
-## ModulePackageDependencyClass
-#
-# This class defined package dependency item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-# @param DefineClass: Input value for DefineClass class
-#
-# @var FilePath: To store value for FilePath
-# @var PackageName: To store value for PackageName
-# @var PackageVersion: To store value for PackageVersion
-# @var PackageGuid: To store value for PackageGuid
-#
-class ModulePackageDependencyClass(CommonClass, DefineClass):
- def __init__(self):
- self.FilePath = ''
- self.PackageName = ''
- self.PackageVersion = ''
- self.PackageGuid = ''
- self.Description = ''
- CommonClass.__init__(self)
- DefineClass.__init__(self)
-
-## ModuleLibraryClass
-#
-# This class defined library item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var Library: To store value for Library
-#
-class ModuleLibraryClass(CommonClass):
- def __init__(self):
- self.Library = ''
- CommonClass.__init__(self)
-
-## ModuleEventClass
-#
-# This class defined event item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var CName: To store value for CName
-# @var GuidCName: To store value for GuidCName
-# @var Type: To store value for Type, selection scope is in below list
-# CREATE_EVENT | SIGNAL_EVENT
-#
-class ModuleEventClass(CommonClass):
- def __init__(self):
- self.CName = ''
- self.GuidCName = ''
- self.Type = ''
- CommonClass.__init__(self)
-
-## ModuleHobClass
-#
-# This class defined hob item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var GuidCName: To store value for GuidCName
-# @var Type: To store value for Type, selection scope is in below list
-# PHIT | MEMORY_ALLOCATION | RESOURCE_DESCRIPTOR | GUID_EXTENSION | FIRMWARE_VOLUME | CPU | POOL | CAPSULE_VOLUME
-#
-class ModuleHobClass(CommonClass):
- def __init__(self):
- self.Type = ''
- self.GuidCName = ''
- CommonClass.__init__(self)
-
-## ModuleVariableClass
-#
-# This class defined variable item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var GuidCName: To store value for GuidCName
-# @var Name: To store value for Name
-#
-class ModuleVariableClass(CommonClass):
- def __init__(self):
- self.Name = ''
- self.GuidCName = ''
- CommonClass.__init__(self)
-
-## ModuleBootModeClass
-#
-# This class defined boot mode item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var Name: To store value for Name, selection scope is in below list
-# FULL | MINIMAL | NO_CHANGE | DIAGNOSTICS | DEFAULT | S2_RESUME | S3_RESUME | S4_RESUME | S5_RESUME | FLASH_UPDATE | RECOVERY_FULL | RECOVERY_MINIMAL | RECOVERY_NO_CHANGE | RECOVERY_DIAGNOSTICS | RECOVERY_DEFAULT | RECOVERY_S2_RESUME | RECOVERY_S3_RESUME | RECOVERY_S4_RESUME | RECOVERY_S5_RESUME | RECOVERY_FLASH_UPDATE
-#
-class ModuleBootModeClass(CommonClass):
- def __init__(self):
- self.Name = ''
- CommonClass.__init__(self)
-
-## ModuleSystemTableClass
-#
-# This class defined system table item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var CName: To store value for CName
-#
-class ModuleSystemTableClass(CommonClass):
- def __init__(self):
- self.CName = ''
- CommonClass.__init__(self)
-
-## ModuleDataHubClass
-#
-# This class defined data hub item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var CName: To store value for CName
-#
-class ModuleDataHubClass(CommonClass):
- def __init__(self):
- self.CName = ''
- CommonClass.__init__(self)
-
-## ModuleHiiPackageClass
-#
-# This class defined Hii package item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var CName: To store value for CName
-#
-class ModuleHiiPackageClass(CommonClass):
- def __init__(self):
- self.CName = ''
- CommonClass.__init__(self)
-
-## ModuleExternImageClass
-#
-# This class defined Extern Image item used in Module file
-#
-# @param object: Inherited from object class
-#
-# @var ModuleEntryPoint: To store value for ModuleEntryPoint
-# @var ModuleUnloadImage: To store value for ModuleUnloadImage
-#
-class ModuleExternImageClass(object):
- def __init__(self):
- self.ModuleEntryPoint = ''
- self.ModuleUnloadImage = ''
-
-## ModuleExternLibraryClass
-#
-# This class defined Extern Library item used in Module file
-#
-# @param object: Inherited from object class
-#
-# @var Constructor: To store value for Constructor
-# @var Destructor: To store value for Destructor
-#
-class ModuleExternLibraryClass(object):
- def __init__(self):
- self.Constructor = ''
- self.Destructor = ''
-
-## ModuleExternDriverClass
-#
-# This class defined Extern Driver item used in Module file
-#
-# @param object: Inherited from object class
-#
-# @var DriverBinding: To store value for DriverBinding
-# @var ComponentName: To store value for ComponentName
-# @var DriverConfig: To store value for DriverConfig
-# @var DriverDiag: To store value for DriverDiag
-#
-class ModuleExternDriverClass(object):
- def __init__(self):
- self.DriverBinding= ''
- self.ComponentName = ''
- self.DriverConfig = ''
- self.DriverDiag = ''
-
-## ModuleExternCallBackClass
-#
-# This class defined Extern Call Back item used in Module file
-#
-# @param object: Inherited from object class
-#
-# @var SetVirtualAddressMapCallBack: To store value for SetVirtualAddressMapCallBack
-# @var ExitBootServicesCallBack: To store value for ExitBootServicesCallBack
-#
-class ModuleExternCallBackClass(object):
- def __init__(self):
- self.SetVirtualAddressMapCallBack = ''
- self.ExitBootServicesCallBack = ''
-
-## ModuleExternClass
-#
-# This class defined Extern used in Module file
-#
-# @param object: Inherited from object class
-#
-#
-class ModuleExternClass(CommonClass):
- def __init__(self):
- self.EntryPoint = ''
- self.UnloadImage = ''
- self.Constructor = ''
- self.Destructor = ''
- CommonClass.__init__(self)
-
-## ModuleDepexClass
-#
-# This class defined depex item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-# @param DefineClass: Input value for DefineClass class
-#
-# @var Depex: To store value for Depex
-#
-class ModuleDepexClass(CommonClass, DefineClass):
- def __init__(self):
- CommonClass.__init__(self)
- DefineClass.__init__(self)
- self.Depex = ''
-
-## ModuleNmakeClass
-#
-# This class defined nmake item used in Module file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var Name: To store value for Name
-# @var Value: To store value for Value
-#
-class ModuleNmakeClass(CommonClass):
- def __init__(self):
- CommonClass.__init__(self)
- self.Name = ''
- self.Value = ''
-
-## ModuleClass
-#
-# This class defined a complete module item
-#
-# @param object: Inherited from object class
-#
-# @var Header: To store value for Header, it is a structure as
-# {Arch : ModuleHeaderClass}
-# @var LibraryClasses: To store value for LibraryClasses, it is a list structure as
-# [ LibraryClassClass, ...]
-# @var Libraries: To store value for Libraries, it is a list structure as
-# [ ModuleLibraryClass, ...]
-# @var Sources: To store value for Sources, it is a list structure as
-# [ ModuleSourceFileClass, ...]
-# @var Binaries: To store value for Binaries, it is a list structure as
-# [ ModuleBinaryFileClass, ...]
-# @var NonProcessedFiles: To store value for NonProcessedFiles, it is a list structure as
-# [ '', '', ...]
-# @var PackageDependencies: To store value for PackageDependencies, it is a list structure as
-# [ ModulePackageDependencyClass, ... ]
-# @var Nmake: To store value for Nmake, it is a list structure as
-# [ ModuleNmakeClass, ... ]
-# @var Depex: To store value for Depex, it is a list structure as
-# [ ModuleDepexClass, ... ]
-# @var Includes: To store value for Includes, it is a list structure as
-# [ IncludeClass, ...]
-# @var Protocols: To store value for Protocols, it is a list structure as
-# [ ProtocolClass, ...]
-# @var Ppis: To store value for Ppis, it is a list structure as
-# [ PpiClass, ...]
-# @var Events: To store value for Events, it is a list structure as
-# [ ModuleEventClass, ...]
-# @var Hobs: To store value for Hobs, it is a list structure as
-# [ ModuleHobClass, ...]
-# @var Variables: To store value for Variables, it is a list structure as
-# [ ModuleVariableClass, ...]
-# @var BootModes: To store value for BootModes, it is a list structure as
-# [ ModuleBootModeClass, ...]
-# @var SystemTables: To store value for SystemTables, it is a list structure as
-# [ ModuleSystemTableClass, ...]
-# @var DataHubs: To store value for DataHubs, it is a list structure as
-# [ ModuleDataHubClass, ...]
-# @var HiiPackages: To store value for HiiPackages, it is a list structure as
-# [ ModuleHiiPackageClass, ...]
-# @var Guids: To store value for Guids, it is a list structure as
-# [ GuidClass, ...]
-# @var PcdCodes: To store value for PcdCodes, it is a list structure as
-# [ PcdClass, ...]
-# @var ExternImages: To store value for ExternImages, it is a list structure as
-# [ ModuleExternImageClass, ...]
-# @var ExternLibraries: To store value for ExternLibraries, it is a list structure as
-# [ ModuleExternLibraryClass, ...]
-# @var ExternDrivers: To store value for ExternDrivers, it is a list structure as
-# [ ModuleExternDriverClass, ...]
-# @var ExternCallBacks: To store value for ExternCallBacks, it is a list structure as
-# [ ModuleExternCallBackClass, ...]
-# @var BuildOptions: To store value for BuildOptions, it is a list structure as
-# [ BuildOptionClass, ...]
-# @var UserExtensions: To store value for UserExtensions, it is a list structure as
-# [ UserExtensionsClass, ...]
-#
-class ModuleClass(object):
- def __init__(self):
- self.Header = {}
- self.ModuleHeader = ModuleHeaderClass()
- self.LibraryClasses = []
- self.Libraries = []
- self.Sources = []
- self.Binaries = []
- self.NonProcessedFiles = []
- self.PackageDependencies = []
- self.Nmake = []
- self.Depex = []
- self.PeiDepex = None
- self.DxeDepex = None
- self.SmmDepex = None
- self.Includes = []
- self.Protocols = []
- self.Ppis = []
- self.Events = []
- self.Hobs = []
- self.Variables = []
- self.BootModes = []
- self.SystemTables = []
- self.DataHubs = []
- self.HiiPackages = []
- self.Guids = []
- self.PcdCodes = []
- self.ExternImages = []
- self.ExternLibraries = []
- self.ExternDrivers = []
- self.ExternCallBacks = []
- self.Externs = []
- self.BuildOptions = []
- self.UserExtensions = None
- self.MiscFiles = None
- self.FileList = []
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- M = ModuleClass()
diff --git a/BaseTools/Source/Python/CommonDataClass/PackageClass.py b/BaseTools/Source/Python/CommonDataClass/PackageClass.py
deleted file mode 100644
index 82e7394ced..0000000000
--- a/BaseTools/Source/Python/CommonDataClass/PackageClass.py
+++ /dev/null
@@ -1,127 +0,0 @@
-## @file
-# This file is used to define a class object to describe a package
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-##
-# Import Modules
-#
-from CommonClass import *
-from Common.Misc import sdict
-
-## PackageHeaderClass
-#
-# This class defined header items used in Package file
-#
-# @param IdentificationClass: Inherited from IdentificationClass class
-# @param CommonHeaderClass: Inherited from CommonHeaderClass class
-#
-# @var DecSpecification: To store value for DecSpecification
-# @var ReadOnly: To store value for ReadOnly
-# @var RePackage: To store value for RePackage
-# @var ClonedFrom: To store value for ClonedFrom, it is a set structure as
-# [ ClonedRecordClass, ...]
-#
-class PackageHeaderClass(IdentificationClass, CommonHeaderClass):
- def __init__(self):
- IdentificationClass.__init__(self)
- CommonHeaderClass.__init__(self)
- self.DecSpecification = ''
- self.ReadOnly = False
- self.RePackage = False
- self.PackagePath = ''
- self.ClonedFrom = []
-
-## PackageIndustryStdHeaderClass
-#
-# This class defined industry std header items used in Package file
-#
-# @param CommonHeaderClass: Inherited from CommonHeaderClass class
-#
-# @var Name: To store value for Name
-# @var IncludeHeader: To store value for IncludeHeader
-#
-class PackageIndustryStdHeaderClass(CommonClass):
- def __init__(self):
- self.Name = ''
- self.IncludeHeader = ''
- CommonClass.__init__(self)
-
-## PackageIncludePkgHeaderClass
-#
-# This class defined include Pkg header items used in Package file
-#
-# @param object: Inherited from object class
-#
-# @var IncludeHeader: To store value for IncludeHeader
-# @var ModuleType: To store value for ModuleType, it is a set structure as
-# BASE | SEC | PEI_CORE | PEIM | DXE_CORE | DXE_DRIVER | DXE_RUNTIME_DRIVER | DXE_SAL_DRIVER | DXE_SMM_DRIVER | TOOL | UEFI_DRIVER | UEFI_APPLICATION | USER_DEFINED | SMM_CORE
-#
-class PackageIncludePkgHeaderClass(object):
- def __init__(self):
- self.IncludeHeader = ''
- self.ModuleType = []
-
-## PackageClass
-#
-# This class defined a complete package item
-#
-# @param object: Inherited from object class
-#
-# @var Header: To store value for Header, it is a structure as
-# {Arch : PackageHeaderClass}
-# @var Includes: To store value for Includes, it is a list structure as
-# [ IncludeClass, ...]
-# @var LibraryClassDeclarations: To store value for LibraryClassDeclarations, it is a list structure as
-# [ LibraryClassClass, ...]
-# @var IndustryStdHeaders: To store value for IndustryStdHeaders, it is a list structure as
-# [ PackageIndustryStdHeader, ...]
-# @var ModuleFiles: To store value for ModuleFiles, it is a list structure as
-# [ '', '', ...]
-# @var PackageIncludePkgHeaders: To store value for PackageIncludePkgHeaders, it is a list structure as
-# [ PackageIncludePkgHeader, ...]
-# @var GuidDeclarations: To store value for GuidDeclarations, it is a list structure as
-# [ GuidClass, ...]
-# @var ProtocolDeclarations: To store value for ProtocolDeclarations, it is a list structure as
-# [ ProtocolClass, ...]
-# @var PpiDeclarations: To store value for PpiDeclarations, it is a list structure as
-# [ PpiClass, ...]
-# @var PcdDeclarations: To store value for PcdDeclarations, it is a list structure as
-# [ PcdClass, ...]
-# @var UserExtensions: To store value for UserExtensions, it is a list structure as
-# [ UserExtensionsClass, ...]
-#
-class PackageClass(object):
- def __init__(self):
- self.PackageHeader = PackageHeaderClass()
- self.Header = {}
- self.Includes = []
- self.LibraryClassDeclarations = []
- self.IndustryStdHeaders = []
- self.ModuleFiles = []
- # {[Guid, Value, Path(relative to WORKSPACE)]: ModuleClassObj}
- self.Modules = sdict()
- self.PackageIncludePkgHeaders = []
- self.GuidDeclarations = []
- self.ProtocolDeclarations = []
- self.PpiDeclarations = []
- self.PcdDeclarations = []
- self.PcdChecks = []
- self.UserExtensions = UserExtensionsClass()
- self.MiscFiles = MiscFileClass()
- self.FileList = []
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- P = PackageClass()
diff --git a/BaseTools/Source/Python/CommonDataClass/PlatformClass.py b/BaseTools/Source/Python/CommonDataClass/PlatformClass.py
deleted file mode 100644
index a95ec068b1..0000000000
--- a/BaseTools/Source/Python/CommonDataClass/PlatformClass.py
+++ /dev/null
@@ -1,432 +0,0 @@
-## @file
-# This file is used to define a class object to describe a platform
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-##
-# Import Modules
-#
-from CommonClass import *
-
-## SkuInfoListClass
-#
-# This class defined sku info list item used in platform file
-#
-# @param IncludeStatementClass: Inherited from IncludeStatementClass class
-#
-# @var SkuInfoList: To store value for SkuInfoList, it is a set structure as
-# { SkuName : SkuId }
-#
-class SkuInfoListClass(IncludeStatementClass):
- def __init__(self):
- IncludeStatementClass.__init__(self)
- self.SkuInfoList = {}
-
-## PlatformHeaderClass
-#
-# This class defined header items used in Platform file
-#
-# @param IdentificationClass: Inherited from IdentificationClass class
-# @param CommonHeaderClass: Inherited from CommonHeaderClass class
-# @param DefineClass: Inherited from DefineClass class
-#
-# @var DscSpecification: To store value for DscSpecification
-# @var SupArchList: To store value for SupArchList, selection scope is in below list
-# EBC | IA32 | X64 | IPF | ARM | PPC | AARCH64
-# @var BuildTargets: To store value for BuildTargets, selection scope is in below list
-# RELEASE | DEBUG
-# @var IntermediateDirectories: To store value for IntermediateDirectories, selection scope is in below list
-# MODULE | UNIFIED
-# @var OutputDirectory: To store value for OutputDirectory
-# @var ForceDebugTarget: To store value for ForceDebugTarget
-# @var SkuIdName: To store value for SkuIdName
-# @var BuildNumber: To store value for BuildNumber
-# @var MakefileName: To store value for MakefileName
-# @var ClonedFrom: To store value for ClonedFrom, it is a list structure as
-# [ ClonedRecordClass, ... ]
-#
-class PlatformHeaderClass(IdentificationClass, CommonHeaderClass, DefineClass):
- def __init__(self):
- IdentificationClass.__init__(self)
- CommonHeaderClass.__init__(self)
- DefineClass.__init__(self)
- self.DscSpecification = ''
- self.SupArchList = []
- self.BuildTargets = []
- self.IntermediateDirectories = ''
- self.OutputDirectory = ''
- self.ForceDebugTarget = ''
- self.SkuIdName = []
- self.BuildNumber = ''
- self.MakefileName = ''
- self.ClonedFrom = []
-
-## PlatformFlashDefinitionFileClass
-#
-# This class defined FlashDefinitionFile item used in platform file
-#
-# @param object: Inherited from object class
-#
-# @var Id: To store value for Id
-# @var UiName: To store value for UiName
-# @var Preferred: To store value for Preferred
-# @var FilePath: To store value for FilePath
-#
-class PlatformFlashDefinitionFileClass(object):
- def __init__(self):
- self.Id = ''
- self.UiName = ''
- self.Preferred = False
- self.FilePath = ''
-
-## PlatformFvImageOptionClass
-#
-# This class defined FvImageOption item used in platform file
-#
-# @param object: Inherited from object class
-#
-# @var FvImageOptionName: To store value for FvImageOptionName
-# @var FvImageOptionValues: To store value for FvImageOptionValues
-#
-class PlatformFvImageOptionClass(object):
- def __init__(self):
- self.FvImageOptionName = ''
- self.FvImageOptionValues = []
-
-## PlatformFvImageClass
-#
-# This class defined FvImage item used in platform file
-#
-# @param object: Inherited from object class
-#
-# @var Name: To store value for Name
-# @var Value: To store value for Value
-# @var Type: To store value for Type, selection scope is in below list
-# Attributes | Options | Components | ImageName
-# @var FvImageNames: To store value for FvImageNames
-# @var FvImageOptions: To store value for FvImageOptions, it is a list structure as
-# [ PlatformFvImageOption, ...]
-#
-class PlatformFvImageClass(object):
- def __init__(self):
- self.Name = ''
- self.Value = ''
- self.Type = ''
- self.FvImageNames = []
- self.FvImageOptions = []
-
-## PlatformFvImageNameClass
-#
-# This class defined FvImageName item used in platform file
-#
-# @param object: Inherited from object class
-#
-# @var Name: To store value for Name
-# @var Type: To store value for Type, selection scope is in below list
-# FV_MAIN | FV_MAIN_COMPACT | NV_STORAGE | FV_RECOVERY | FV_RECOVERY_FLOPPY | FV_FILE | CAPSULE_CARGO | NULL | USER_DEFINED
-# @var FvImageOptions: To store value for FvImageOptions, it is a list structure as
-# [ PlatformFvImageOption, ...]
-#
-class PlatformFvImageNameClass(object):
- def __init__(self):
- self.Name = ''
- self.Type = ''
- self.FvImageOptions = []
-
-## PlatformFvImagesClass
-#
-# This class defined FvImages item used in platform file
-#
-# @param object: Inherited from object class
-#
-# @var FvImages: To store value for FvImages
-#
-class PlatformFvImagesClass(object):
- def __init__(self):
- self.FvImages = []
-
-## PlatformAntTaskClass
-#
-# This class defined AntTask item used in platform file
-#
-# @param object: Inherited from object class
-#
-# @var Id: To store value for Id
-# @var AntCmdOptions: To store value for AntCmdOptions
-# @var FilePath: To store value for FilePath
-#
-class PlatformAntTaskClass(object):
- def __init__(self):
- self.Id = ''
- self.AntCmdOptions = ''
- self.FilePath = ''
-
-## PlatformFfsSectionClass
-#
-# This class defined FfsSection item used in platform file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var BindingOrder: To store value for BindingOrder
-# @var Compressible: To store value for Compressible
-# @var SectionType: To store value for SectionType
-# @var EncapsulationType: To store value for EncapsulationType
-# @var ToolName: To store value for ToolName
-# @var Filenames: To store value for Filenames
-# @var Args: To store value for Args
-# @var OutFile: To store value for OutFile
-# @var OutputFileExtension: To store value for OutputFileExtension
-# @var ToolNameElement: To store value for ToolNameElement
-#
-class PlatformFfsSectionClass(CommonClass):
- def __init__(self):
- CommonClass.__init__(self)
- self.BindingOrder = ''
- self.Compressible = ''
- self.SectionType = ''
- self.EncapsulationType = ''
- self.ToolName = ''
- self.Filenames = []
- self.Args = ''
- self.OutFile = ''
- self.OutputFileExtension = ''
- self.ToolNameElement = ''
-
-## PlatformFfsSectionsClass
-#
-# This class defined FfsSections item used in platform file
-#
-# @param CommonClass: Inherited from CommonClass class
-#
-# @var BindingOrder: To store value for BindingOrder
-# @var Compressible: To store value for Compressible
-# @var SectionType: To store value for SectionType
-# @var EncapsulationType: To store value for EncapsulationType
-# @var ToolName: To store value for ToolName
-# @var Section: To store value for Section, it is a list structure as
-# [ PlatformFfsSectionClass, ... ]
-# @var Sections: To store value for Sections, it is a list structure as
-# [ PlatformFfsSectionsClass, ...]
-#
-class PlatformFfsSectionsClass(CommonClass):
- def __init__(self):
- CommonClass.__init__(self)
- self.BindingOrder = ''
- self.Compressible = ''
- self.SectionType = ''
- self.EncapsulationType = ''
- self.ToolName = ''
- self.Section = []
- self.Sections = []
-
-## PlatformFfsClass
-#
-# This class defined Ffs item used in platform file
-#
-# @param object: Inherited from object class
-#
-# @var Attribute: To store value for Attribute, it is a set structure as
-# { [(Name, PlatformFfsSectionsClass)] : Value}
-# @var Sections: To store value for Sections, it is a list structure as
-# [ PlatformFfsSectionsClass]
-# @var ToolName: To store value for ToolName
-#
-class PlatformFfsClass(object):
- def __init__(self):
- self.Attribute = {}
- self.Sections = []
- self.Key = ''
-
-## PlatformBuildOptionClass
-#
-# This class defined BuildOption item used in platform file
-#
-# @param object: Inherited from object class
-#
-# @var UserDefinedAntTasks: To store value for UserDefinedAntTasks, it is a set structure as
-# { [Id] : PlatformAntTaskClass, ...}
-# @var Options: To store value for Options, it is a list structure as
-# [ BuildOptionClass, ...]
-# @var UserExtensions: To store value for UserExtensions, it is a set structure as
-# { [(UserID, Identifier)] : UserExtensionsClass, ...}
-# @var FfsKeyList: To store value for FfsKeyList, it is a set structure as
-# { [FfsKey]: PlatformFfsClass, ...}
-#
-class PlatformBuildOptionClass(object):
- def __init__(self):
- self.UserDefinedAntTasks = {}
- self.Options = []
- self.UserExtensions = {}
- self.FfsKeyList = {}
-
-## PlatformBuildOptionClasses
-#
-# This class defined BuildOption item list used in platform file
-#
-# @param IncludeStatementClass: Inherited from IncludeStatementClass class
-#
-# @var FvBinding: To store value for FvBinding
-# @var FfsFileNameGuid: To store value for FfsFileNameGuid
-# @var FfsFormatKey: To store value for FfsFormatKey
-# @var BuildOptionList: To store value for BuildOptionList, it is a list structure as
-# [ BuildOptionClass, ... ]
-#
-class PlatformBuildOptionClasses(IncludeStatementClass):
- def __init__(self):
- IncludeStatementClass.__init__(self)
- self.FvBinding = ''
- self.FfsFileNameGuid = ''
- self.FfsFormatKey = ''
- self.BuildOptionList = []
-
-## PlatformLibraryClass
-#
-# This class defined Library item used in platform file
-#
-# @param CommonClass: Inherited from CommonClass class
-# @param DefineClass: Inherited from DefineClass class
-# @param Name: Input value for Name, default is ''
-# @param FilePath: Input value for FilePath, default is ''
-#
-# @var Name: To store value for Name
-# @var FilePath: To store value for FilePath
-# @var ModuleType: To store value for ModuleType
-# @var SupModuleList: To store value for SupModuleList
-# @var ModuleGuid: To store value for ModuleGuid
-# @var ModuleVersion: To store value for ModuleVersion
-# @var PackageGuid: To store value for PackageGuid
-# @var PackageVersion: To store value for PackageVersion
-#
-class PlatformLibraryClass(CommonClass, DefineClass):
- def __init__(self, Name = '', FilePath = ''):
- CommonClass.__init__(self)
- DefineClass.__init__(self)
- self.Name = Name
- self.FilePath = FilePath
- self.ModuleType = []
- self.SupModuleList = []
- self.ModuleGuid = ''
- self.ModuleVersion = ''
- self.PackageGuid = ''
- self.PackageVersion = ''
-
-## PlatformLibraryClasses
-#
-# This class defined Library item list used in platform file
-#
-# @param IncludeStatementClass: Inherited from IncludeStatementClass class
-#
-# @var LibraryList: To store value for LibraryList, it is a list structure as
-# [ PlatformLibraryClass, ... ]
-#
-class PlatformLibraryClasses(IncludeStatementClass):
- def __init__(self):
- IncludeStatementClass.__init__(self)
- self.LibraryList = []
-
-## PlatformModuleClass
-#
-# This class defined Module item used in platform file
-#
-# @param CommonClass: Inherited from CommonClass class
-# @param DefineClass: Inherited from DefineClass class
-# @param IncludeStatementClass: Inherited from IncludeStatementClass class
-#
-# @var Name: To store value for Name (Library name or libraryclass name or module name)
-# @var FilePath: To store value for FilePath
-# @var Type: To store value for Type, selection scope is in below list
-# LIBRARY | LIBRARY_CLASS | MODULE
-# @var ModuleType: To store value for ModuleType
-# @var ExecFilePath: To store value for ExecFilePath
-# @var LibraryClasses: To store value for LibraryClasses, it is a structure as
-# PlatformLibraryClasses
-# @var PcdBuildDefinitions: To store value for PcdBuildDefinitions, it is a list structure as
-# [ PcdClass, ...]
-# @var ModuleSaBuildOption: To store value for ModuleSaBuildOption, it is a structure as
-# PlatformBuildOptionClasses
-# @var Specifications: To store value for Specifications, it is a list structure as
-# [ '', '', ...]
-#
-class PlatformModuleClass(CommonClass, DefineClass, IncludeStatementClass):
- def __init__(self):
- CommonClass.__init__(self)
- DefineClass.__init__(self)
- self.Name = ''
- self.FilePath = ''
- self.Type = ''
- self.ModuleType = ''
- self.ExecFilePath = ''
- self.LibraryClasses = PlatformLibraryClasses()
- self.PcdBuildDefinitions = []
- self.ModuleSaBuildOption = PlatformBuildOptionClasses()
- self.Specifications = []
- self.SourceOverridePath = ''
-
-## PlatformModuleClasses
-#
-# This class defined Module item list used in platform file
-#
-# @param IncludeStatementClass: Inherited from IncludeStatementClass class
-#
-# @var ModuleList: To store value for ModuleList, it is a list structure as
-# [ PlatformModuleClass, ... ]
-#
-class PlatformModuleClasses(IncludeStatementClass):
- def __init__(self):
- IncludeStatementClass.__init__(self)
- self.ModuleList = []
-
-## PlatformClass
-#
-# This class defined a complete platform item
-#
-# @param object: Inherited from object class
-#
-# @var Header: To store value for Header, it is a structure as
-# {Arch : PlatformHeaderClass()}
-# @var SkuInfos: To store value for SkuInfos, it is a structure as
-# SkuInfoListClass
-# @var Libraries: To store value for Libraries, it is a structure as
-# PlatformLibraryClasses
-# @var LibraryClasses: To store value for LibraryClasses, it is a structure as
-# PlatformLibraryClasses
-# @var Modules: To store value for Modules, it is a structure as
-# PlatformModuleClasses
-# @var FlashDefinitionFile: To store value for FlashDefinitionFile, it is a structure as
-# PlatformFlashDefinitionFileClass
-# @var BuildOptions: To store value for BuildOptions, it is a structure as
-# PlatformBuildOptionClasses
-# @var DynamicPcdBuildDefinitions: To store value for DynamicPcdBuildDefinitions, it is a list structure as
-# [ PcdClass, ...]
-# @var Fdf: To store value for Fdf, it is a list structure as
-# [ FdfClass, ...]
-# @var UserExtensions: To store value for UserExtensions, it is a list structure as
-# [ UserExtensionsClass, ...]
-#
-class PlatformClass(object):
- def __init__(self):
- self.Header = {}
- self.SkuInfos = SkuInfoListClass()
- self.Libraries = PlatformLibraryClasses()
- self.LibraryClasses = PlatformLibraryClasses()
- self.Modules = PlatformModuleClasses()
- self.FlashDefinitionFile = PlatformFlashDefinitionFileClass()
- self.BuildOptions = PlatformBuildOptionClasses()
- self.DynamicPcdBuildDefinitions = []
- self.Fdf = []
- self.UserExtensions = []
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- P = PlatformClass()
diff --git a/BaseTools/Source/Python/CommonDataClass/__init__.py b/BaseTools/Source/Python/CommonDataClass/__init__.py
deleted file mode 100644
index 5c565408bf..0000000000
--- a/BaseTools/Source/Python/CommonDataClass/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'CommonDataClass' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/Ecc/C.g b/BaseTools/Source/Python/Ecc/C.g
deleted file mode 100644
index e344088f36..0000000000
--- a/BaseTools/Source/Python/Ecc/C.g
+++ /dev/null
@@ -1,679 +0,0 @@
-/* @file
- This file is used to be the grammar file of ECC tool
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-*/
-
-grammar C;
-options {
- language=Python;
- backtrack=true;
- memoize=true;
- k=2;
-}
-
-@lexer::header{
-## @file
-# The file defines the Lexer for C source files.
-#
-# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
-# This file is generated by running:
-# java org.antlr.Tool C.g
-#
-# Copyright (c) 2009 - 2010, Intel Corporation All rights reserved.
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at:
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-}
-
-@header {
-## @file
-# The file defines the parser for C source files.
-#
-# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
-# This file is generated by running:
-# java org.antlr.Tool C.g
-#
-# Copyright (c) 2009 - 2010, Intel Corporation All rights reserved.
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at:
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-import CodeFragment
-import FileProfile
-}
-
-@members {
-
- def printTokenInfo(self, line, offset, tokenText):
- print str(line)+ ',' + str(offset) + ':' + str(tokenText)
-
- def StorePredicateExpression(self, StartLine, StartOffset, EndLine, EndOffset, Text):
- PredExp = CodeFragment.PredicateExpression(Text, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.PredicateExpressionList.append(PredExp)
-
- def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):
- EnumDef = CodeFragment.EnumerationDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.EnumerationDefinitionList.append(EnumDef)
-
- def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):
- SUDef = CodeFragment.StructUnionDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.StructUnionDefinitionList.append(SUDef)
-
- def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndOffset, FromText, ToText):
- Tdef = CodeFragment.TypedefDefinition(FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.TypedefDefinitionList.append(Tdef)
-
- def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, DeclOffset):
- FuncDef = CodeFragment.FunctionDefinition(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLine, DeclOffset))
- FileProfile.FunctionDefinitionList.append(FuncDef)
-
- def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText):
- VarDecl = CodeFragment.VariableDeclaration(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.VariableDeclarationList.append(VarDecl)
-
- def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOffset, FuncName, ParamList):
- FuncCall = CodeFragment.FunctionCalling(FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.FunctionCallingList.append(FuncCall)
-
-}
-
-translation_unit
- : external_declaration*
- ;
-
-
-/*function_declaration
-@after{
- print $function_declaration.text
-}
- : declaration_specifiers IDENTIFIER '(' parameter_list ')' ';'
- ;
-*/
-external_declaration
-options {k=1;}
-/*@after{
- print $external_declaration.text
-}*/
- : ( declaration_specifiers? declarator declaration* '{' )=> function_definition
- | declaration
- | macro_statement (';')?
- ;
-
-
-
-function_definition
-scope {
- ModifierText;
- DeclText;
- LBLine;
- LBOffset;
- DeclLine;
- DeclOffset;
-}
-@init {
- $function_definition::ModifierText = '';
- $function_definition::DeclText = '';
- $function_definition::LBLine = 0;
- $function_definition::LBOffset = 0;
- $function_definition::DeclLine = 0;
- $function_definition::DeclOffset = 0;
-}
-@after{
- self.StoreFunctionDefinition($function_definition.start.line, $function_definition.start.charPositionInLine, $function_definition.stop.line, $function_definition.stop.charPositionInLine, $function_definition::ModifierText, $function_definition::DeclText, $function_definition::LBLine, $function_definition::LBOffset, $function_definition::DeclLine, $function_definition::DeclOffset)
-}
- : d=declaration_specifiers? declarator
- ( declaration+ a=compound_statement // K&R style
- | b=compound_statement // ANSI style
- ) {
- if d != None:
- $function_definition::ModifierText = $declaration_specifiers.text
- else:
- $function_definition::ModifierText = ''
- $function_definition::DeclText = $declarator.text
- $function_definition::DeclLine = $declarator.start.line
- $function_definition::DeclOffset = $declarator.start.charPositionInLine
- if a != None:
- $function_definition::LBLine = $a.start.line
- $function_definition::LBOffset = $a.start.charPositionInLine
- else:
- $function_definition::LBLine = $b.start.line
- $function_definition::LBOffset = $b.start.charPositionInLine
- }
- ;
-
-declaration
- : a='typedef' b=declaration_specifiers?
- c=init_declarator_list d=';'
- {
- if b != None:
- self.StoreTypedefDefinition($a.line, $a.charPositionInLine, $d.line, $d.charPositionInLine, $b.text, $c.text)
- else:
- self.StoreTypedefDefinition($a.line, $a.charPositionInLine, $d.line, $d.charPositionInLine, '', $c.text)
- }
- | s=declaration_specifiers t=init_declarator_list? e=';'
- {
- if t != None:
- self.StoreVariableDeclaration($s.start.line, $s.start.charPositionInLine, $t.start.line, $t.start.charPositionInLine, $s.text, $t.text)
- }
- ;
-
-declaration_specifiers
- : ( storage_class_specifier
- | type_specifier
- | type_qualifier
- )+
- ;
-
-init_declarator_list
- : init_declarator (',' init_declarator)*
- ;
-
-init_declarator
- : declarator ('=' initializer)?
- ;
-
-storage_class_specifier
- : 'extern'
- | 'static'
- | 'auto'
- | 'register'
- | 'STATIC'
- ;
-
-type_specifier
- : 'void'
- | 'char'
- | 'short'
- | 'int'
- | 'long'
- | 'float'
- | 'double'
- | 'signed'
- | 'unsigned'
- | s=struct_or_union_specifier
- {
- if s.stop != None:
- self.StoreStructUnionDefinition($s.start.line, $s.start.charPositionInLine, $s.stop.line, $s.stop.charPositionInLine, $s.text)
- }
- | e=enum_specifier
- {
- if e.stop != None:
- self.StoreEnumerationDefinition($e.start.line, $e.start.charPositionInLine, $e.stop.line, $e.stop.charPositionInLine, $e.text)
- }
- | (IDENTIFIER type_qualifier* declarator)=> type_id
- ;
-
-type_id
- : IDENTIFIER
- //{self.printTokenInfo($a.line, $a.pos, $a.text)}
- ;
-
-struct_or_union_specifier
-options {k=3;}
- : struct_or_union IDENTIFIER? '{' struct_declaration_list '}'
- | struct_or_union IDENTIFIER
- ;
-
-struct_or_union
- : 'struct'
- | 'union'
- ;
-
-struct_declaration_list
- : struct_declaration+
- ;
-
-struct_declaration
- : specifier_qualifier_list struct_declarator_list ';'
- ;
-
-specifier_qualifier_list
- : ( type_qualifier | type_specifier )+
- ;
-
-struct_declarator_list
- : struct_declarator (',' struct_declarator)*
- ;
-
-struct_declarator
- : declarator (':' constant_expression)?
- | ':' constant_expression
- ;
-
-enum_specifier
-options {k=3;}
- : 'enum' '{' enumerator_list ','? '}'
- | 'enum' IDENTIFIER '{' enumerator_list ','? '}'
- | 'enum' IDENTIFIER
- ;
-
-enumerator_list
- : enumerator (',' enumerator)*
- ;
-
-enumerator
- : IDENTIFIER ('=' constant_expression)?
- ;
-
-type_qualifier
- : 'const'
- | 'volatile'
- | 'IN'
- | 'OUT'
- | 'OPTIONAL'
- | 'CONST'
- | 'UNALIGNED'
- | 'VOLATILE'
- | 'GLOBAL_REMOVE_IF_UNREFERENCED'
- | 'EFIAPI'
- | 'EFI_BOOTSERVICE'
- | 'EFI_RUNTIMESERVICE'
- | 'PACKED'
- ;
-
-declarator
- : pointer? ('EFIAPI')? ('EFI_BOOTSERVICE')? ('EFI_RUNTIMESERVICE')? direct_declarator
-// | ('EFIAPI')? ('EFI_BOOTSERVICE')? ('EFI_RUNTIMESERVICE')? pointer? direct_declarator
- | pointer
- ;
-
-direct_declarator
- : IDENTIFIER declarator_suffix*
- | '(' ('EFIAPI')? declarator ')' declarator_suffix+
- ;
-
-declarator_suffix
- : '[' constant_expression ']'
- | '[' ']'
- | '(' parameter_type_list ')'
- | '(' identifier_list ')'
- | '(' ')'
- ;
-
-pointer
- : '*' type_qualifier+ pointer?
- | '*' pointer
- | '*'
- ;
-
-parameter_type_list
- : parameter_list (',' ('OPTIONAL')? '...')?
- ;
-
-parameter_list
- : parameter_declaration (',' ('OPTIONAL')? parameter_declaration)*
- ;
-
-parameter_declaration
- : declaration_specifiers (declarator|abstract_declarator)* ('OPTIONAL')?
- //accomerdate user-defined type only, no declarator follow.
- | pointer* IDENTIFIER
- ;
-
-identifier_list
- : IDENTIFIER
- (',' IDENTIFIER)*
- ;
-
-type_name
- : specifier_qualifier_list abstract_declarator?
- | type_id
- ;
-
-abstract_declarator
- : pointer direct_abstract_declarator?
- | direct_abstract_declarator
- ;
-
-direct_abstract_declarator
- : ( '(' abstract_declarator ')' | abstract_declarator_suffix ) abstract_declarator_suffix*
- ;
-
-abstract_declarator_suffix
- : '[' ']'
- | '[' constant_expression ']'
- | '(' ')'
- | '(' parameter_type_list ')'
- ;
-
-initializer
-
- : assignment_expression
- | '{' initializer_list ','? '}'
- ;
-
-initializer_list
- : initializer (',' initializer )*
- ;
-
-// E x p r e s s i o n s
-
-argument_expression_list
- : assignment_expression ('OPTIONAL')? (',' assignment_expression ('OPTIONAL')?)*
- ;
-
-additive_expression
- : (multiplicative_expression) ('+' multiplicative_expression | '-' multiplicative_expression)*
- ;
-
-multiplicative_expression
- : (cast_expression) ('*' cast_expression | '/' cast_expression | '%' cast_expression)*
- ;
-
-cast_expression
- : '(' type_name ')' cast_expression
- | unary_expression
- ;
-
-unary_expression
- : postfix_expression
- | '++' unary_expression
- | '--' unary_expression
- | unary_operator cast_expression
- | 'sizeof' unary_expression
- | 'sizeof' '(' type_name ')'
- ;
-
-postfix_expression
-scope {
- FuncCallText;
-}
-@init {
- $postfix_expression::FuncCallText = '';
-}
- : p=primary_expression {$postfix_expression::FuncCallText += $p.text}
- ( '[' expression ']'
- | '(' a=')'{self.StoreFunctionCalling($p.start.line, $p.start.charPositionInLine, $a.line, $a.charPositionInLine, $postfix_expression::FuncCallText, '')}
- | '(' c=argument_expression_list b=')' {self.StoreFunctionCalling($p.start.line, $p.start.charPositionInLine, $b.line, $b.charPositionInLine, $postfix_expression::FuncCallText, $c.text)}
- | '(' macro_parameter_list ')'
- | '.' x=IDENTIFIER {$postfix_expression::FuncCallText += '.' + $x.text}
- | '*' y=IDENTIFIER {$postfix_expression::FuncCallText = $y.text}
- | '->' z=IDENTIFIER {$postfix_expression::FuncCallText += '->' + $z.text}
- | '++'
- | '--'
- )*
- ;
-
-macro_parameter_list
- : parameter_declaration (',' parameter_declaration)*
- ;
-
-unary_operator
- : '&'
- | '*'
- | '+'
- | '-'
- | '~'
- | '!'
- ;
-
-primary_expression
- : IDENTIFIER
- | constant
- | '(' expression ')'
- ;
-
-constant
- : HEX_LITERAL
- | OCTAL_LITERAL
- | DECIMAL_LITERAL
- | CHARACTER_LITERAL
- | (IDENTIFIER* STRING_LITERAL+)+ IDENTIFIER*
- | FLOATING_POINT_LITERAL
- ;
-
-/////
-
-expression
- : assignment_expression (',' assignment_expression)*
- ;
-
-constant_expression
- : conditional_expression
- ;
-
-assignment_expression
- : lvalue assignment_operator assignment_expression
- | conditional_expression
- ;
-
-lvalue
- : unary_expression
- ;
-
-assignment_operator
- : '='
- | '*='
- | '/='
- | '%='
- | '+='
- | '-='
- | '<<='
- | '>>='
- | '&='
- | '^='
- | '|='
- ;
-
-conditional_expression
- : e=logical_or_expression ('?' expression ':' conditional_expression {self.StorePredicateExpression($e.start.line, $e.start.charPositionInLine, $e.stop.line, $e.stop.charPositionInLine, $e.text)})?
- ;
-
-logical_or_expression
- : logical_and_expression ('||' logical_and_expression)*
- ;
-
-logical_and_expression
- : inclusive_or_expression ('&&' inclusive_or_expression)*
- ;
-
-inclusive_or_expression
- : exclusive_or_expression ('|' exclusive_or_expression)*
- ;
-
-exclusive_or_expression
- : and_expression ('^' and_expression)*
- ;
-
-and_expression
- : equality_expression ('&' equality_expression)*
- ;
-equality_expression
- : relational_expression (('=='|'!=') relational_expression )*
- ;
-
-relational_expression
- : shift_expression (('<'|'>'|'<='|'>=') shift_expression)*
- ;
-
-shift_expression
- : additive_expression (('<<'|'>>') additive_expression)*
- ;
-
-// S t a t e m e n t s
-
-statement
- : labeled_statement
- | compound_statement
- | expression_statement
- | selection_statement
- | iteration_statement
- | jump_statement
- | macro_statement
- | asm2_statement
- | asm1_statement
- | asm_statement
- | declaration
- ;
-
-asm2_statement
- : '__asm__'? IDENTIFIER '(' (~(';'))* ')' ';'
- ;
-
-asm1_statement
- : '_asm' '{' (~('}'))* '}'
- ;
-
-asm_statement
- : '__asm' '{' (~('}'))* '}'
- ;
-
-macro_statement
- : IDENTIFIER '(' declaration* statement_list? expression? ')'
- ;
-
-labeled_statement
- : IDENTIFIER ':' statement
- | 'case' constant_expression ':' statement
- | 'default' ':' statement
- ;
-
-compound_statement
- : '{' declaration* statement_list? '}'
- ;
-
-statement_list
- : statement+
- ;
-
-expression_statement
- : ';'
- | expression ';'
- ;
-
-selection_statement
- : 'if' '(' e=expression ')' {self.StorePredicateExpression($e.start.line, $e.start.charPositionInLine, $e.stop.line, $e.stop.charPositionInLine, $e.text)} statement (options {k=1; backtrack=false;}:'else' statement)?
- | 'switch' '(' expression ')' statement
- ;
-
-iteration_statement
- : 'while' '(' e=expression ')' statement {self.StorePredicateExpression($e.start.line, $e.start.charPositionInLine, $e.stop.line, $e.stop.charPositionInLine, $e.text)}
- | 'do' statement 'while' '(' e=expression ')' ';' {self.StorePredicateExpression($e.start.line, $e.start.charPositionInLine, $e.stop.line, $e.stop.charPositionInLine, $e.text)}
- | 'for' '(' expression_statement e=expression_statement expression? ')' statement {self.StorePredicateExpression($e.start.line, $e.start.charPositionInLine, $e.stop.line, $e.stop.charPositionInLine, $e.text)}
- ;
-
-jump_statement
- : 'goto' IDENTIFIER ';'
- | 'continue' ';'
- | 'break' ';'
- | 'return' ';'
- | 'return' expression ';'
- ;
-
-IDENTIFIER
- : LETTER (LETTER|'0'..'9')*
- ;
-
-fragment
-LETTER
- : '$'
- | 'A'..'Z'
- | 'a'..'z'
- | '_'
- ;
-
-CHARACTER_LITERAL
- : ('L')? '\'' ( EscapeSequence | ~('\''|'\\') ) '\''
- ;
-
-STRING_LITERAL
- : ('L')? '"' ( EscapeSequence | ~('\\'|'"') )* '"'
- ;
-
-HEX_LITERAL : '0' ('x'|'X') HexDigit+ IntegerTypeSuffix? ;
-
-DECIMAL_LITERAL : ('0' | '1'..'9' '0'..'9'*) IntegerTypeSuffix? ;
-
-OCTAL_LITERAL : '0' ('0'..'7')+ IntegerTypeSuffix? ;
-
-fragment
-HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ;
-
-fragment
-IntegerTypeSuffix
- : ('u'|'U')
- | ('l'|'L')
- | ('u'|'U') ('l'|'L')
- | ('u'|'U') ('l'|'L') ('l'|'L')
- ;
-
-FLOATING_POINT_LITERAL
- : ('0'..'9')+ '.' ('0'..'9')* Exponent? FloatTypeSuffix?
- | '.' ('0'..'9')+ Exponent? FloatTypeSuffix?
- | ('0'..'9')+ Exponent FloatTypeSuffix?
- | ('0'..'9')+ Exponent? FloatTypeSuffix
- ;
-
-fragment
-Exponent : ('e'|'E') ('+'|'-')? ('0'..'9')+ ;
-
-fragment
-FloatTypeSuffix : ('f'|'F'|'d'|'D') ;
-
-fragment
-EscapeSequence
- : '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')
- | OctalEscape
- ;
-
-fragment
-OctalEscape
- : '\\' ('0'..'3') ('0'..'7') ('0'..'7')
- | '\\' ('0'..'7') ('0'..'7')
- | '\\' ('0'..'7')
- ;
-
-fragment
-UnicodeEscape
- : '\\' 'u' HexDigit HexDigit HexDigit HexDigit
- ;
-
-WS : (' '|'\r'|'\t'|'\u000C'|'\n') {$channel=HIDDEN;}
- ;
-
-// ingore '\' of line concatenation
-BS : ('\\') {$channel=HIDDEN;}
- ;
-
-// ingore function modifiers
-//FUNC_MODIFIERS : 'EFIAPI' {$channel=HIDDEN;}
-// ;
-
-UnicodeVocabulary
- : '\u0003'..'\uFFFE'
- ;
-COMMENT
- : '/*' ( options {greedy=false;} : . )* '*/' {$channel=HIDDEN;}
- ;
-
-
-LINE_COMMENT
- : '//' ~('\n'|'\r')* '\r'? '\n' {$channel=HIDDEN;}
- ;
-
-// ignore #line info for now
-LINE_COMMAND
- : '#' ~('\n'|'\r')* '\r'? '\n' {$channel=HIDDEN;}
- ;
diff --git a/BaseTools/Source/Python/Ecc/CLexer.py b/BaseTools/Source/Python/Ecc/CLexer.py
deleted file mode 100644
index a72d4ee3c2..0000000000
--- a/BaseTools/Source/Python/Ecc/CLexer.py
+++ /dev/null
@@ -1,4947 +0,0 @@
-# $ANTLR 3.0.1 C.g 2010-02-23 09:58:53
-
-from antlr3 import *
-from antlr3.compat import set, frozenset
-
-## @file
-# The file defines the Lexer for C source files.
-#
-# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
-# This file is generated by running:
-# java org.antlr.Tool C.g
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at:
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-
-
-# for convenience in actions
-HIDDEN = BaseRecognizer.HIDDEN
-
-# token types
-T114=114
-T115=115
-T116=116
-T117=117
-FloatTypeSuffix=16
-LETTER=11
-T29=29
-T28=28
-T27=27
-T26=26
-T25=25
-EOF=-1
-STRING_LITERAL=9
-FLOATING_POINT_LITERAL=10
-T38=38
-T37=37
-T39=39
-T34=34
-COMMENT=22
-T33=33
-T36=36
-T35=35
-T30=30
-T32=32
-T31=31
-LINE_COMMENT=23
-IntegerTypeSuffix=14
-CHARACTER_LITERAL=8
-T49=49
-T48=48
-T100=100
-T43=43
-T42=42
-T102=102
-T41=41
-T101=101
-T40=40
-T47=47
-T46=46
-T45=45
-T44=44
-T109=109
-T107=107
-T108=108
-T105=105
-WS=19
-T106=106
-T103=103
-T104=104
-T50=50
-LINE_COMMAND=24
-T59=59
-T113=113
-T52=52
-T112=112
-T51=51
-T111=111
-T54=54
-T110=110
-EscapeSequence=12
-DECIMAL_LITERAL=7
-T53=53
-T56=56
-T55=55
-T58=58
-T57=57
-T75=75
-T76=76
-T73=73
-T74=74
-T79=79
-T77=77
-T78=78
-Exponent=15
-HexDigit=13
-T72=72
-T71=71
-T70=70
-T62=62
-T63=63
-T64=64
-T65=65
-T66=66
-T67=67
-T68=68
-T69=69
-IDENTIFIER=4
-UnicodeVocabulary=21
-HEX_LITERAL=5
-T61=61
-T60=60
-T99=99
-T97=97
-BS=20
-T98=98
-T95=95
-T96=96
-OCTAL_LITERAL=6
-T94=94
-Tokens=118
-T93=93
-T92=92
-T91=91
-T90=90
-T88=88
-T89=89
-T84=84
-T85=85
-T86=86
-T87=87
-UnicodeEscape=18
-T81=81
-T80=80
-T83=83
-OctalEscape=17
-T82=82
-
-class CLexer(Lexer):
-
- grammarFileName = "C.g"
-
- def __init__(self, input=None):
- Lexer.__init__(self, input)
- self.dfa25 = self.DFA25(
- self, 25,
- eot = self.DFA25_eot,
- eof = self.DFA25_eof,
- min = self.DFA25_min,
- max = self.DFA25_max,
- accept = self.DFA25_accept,
- special = self.DFA25_special,
- transition = self.DFA25_transition
- )
- self.dfa35 = self.DFA35(
- self, 35,
- eot = self.DFA35_eot,
- eof = self.DFA35_eof,
- min = self.DFA35_min,
- max = self.DFA35_max,
- accept = self.DFA35_accept,
- special = self.DFA35_special,
- transition = self.DFA35_transition
- )
-
-
-
-
-
-
- # $ANTLR start T25
- def mT25(self, ):
-
- try:
- self.type = T25
-
- # C.g:27:5: ( ';' )
- # C.g:27:7: ';'
- self.match(u';')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T25
-
-
-
- # $ANTLR start T26
- def mT26(self, ):
-
- try:
- self.type = T26
-
- # C.g:28:5: ( 'typedef' )
- # C.g:28:7: 'typedef'
- self.match("typedef")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T26
-
-
-
- # $ANTLR start T27
- def mT27(self, ):
-
- try:
- self.type = T27
-
- # C.g:29:5: ( ',' )
- # C.g:29:7: ','
- self.match(u',')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T27
-
-
-
- # $ANTLR start T28
- def mT28(self, ):
-
- try:
- self.type = T28
-
- # C.g:30:5: ( '=' )
- # C.g:30:7: '='
- self.match(u'=')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T28
-
-
-
- # $ANTLR start T29
- def mT29(self, ):
-
- try:
- self.type = T29
-
- # C.g:31:5: ( 'extern' )
- # C.g:31:7: 'extern'
- self.match("extern")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T29
-
-
-
- # $ANTLR start T30
- def mT30(self, ):
-
- try:
- self.type = T30
-
- # C.g:32:5: ( 'static' )
- # C.g:32:7: 'static'
- self.match("static")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T30
-
-
-
- # $ANTLR start T31
- def mT31(self, ):
-
- try:
- self.type = T31
-
- # C.g:33:5: ( 'auto' )
- # C.g:33:7: 'auto'
- self.match("auto")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T31
-
-
-
- # $ANTLR start T32
- def mT32(self, ):
-
- try:
- self.type = T32
-
- # C.g:34:5: ( 'register' )
- # C.g:34:7: 'register'
- self.match("register")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T32
-
-
-
- # $ANTLR start T33
- def mT33(self, ):
-
- try:
- self.type = T33
-
- # C.g:35:5: ( 'STATIC' )
- # C.g:35:7: 'STATIC'
- self.match("STATIC")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T33
-
-
-
- # $ANTLR start T34
- def mT34(self, ):
-
- try:
- self.type = T34
-
- # C.g:36:5: ( 'void' )
- # C.g:36:7: 'void'
- self.match("void")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T34
-
-
-
- # $ANTLR start T35
- def mT35(self, ):
-
- try:
- self.type = T35
-
- # C.g:37:5: ( 'char' )
- # C.g:37:7: 'char'
- self.match("char")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T35
-
-
-
- # $ANTLR start T36
- def mT36(self, ):
-
- try:
- self.type = T36
-
- # C.g:38:5: ( 'short' )
- # C.g:38:7: 'short'
- self.match("short")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T36
-
-
-
- # $ANTLR start T37
- def mT37(self, ):
-
- try:
- self.type = T37
-
- # C.g:39:5: ( 'int' )
- # C.g:39:7: 'int'
- self.match("int")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T37
-
-
-
- # $ANTLR start T38
- def mT38(self, ):
-
- try:
- self.type = T38
-
- # C.g:40:5: ( 'long' )
- # C.g:40:7: 'long'
- self.match("long")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T38
-
-
-
- # $ANTLR start T39
- def mT39(self, ):
-
- try:
- self.type = T39
-
- # C.g:41:5: ( 'float' )
- # C.g:41:7: 'float'
- self.match("float")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T39
-
-
-
- # $ANTLR start T40
- def mT40(self, ):
-
- try:
- self.type = T40
-
- # C.g:42:5: ( 'double' )
- # C.g:42:7: 'double'
- self.match("double")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T40
-
-
-
- # $ANTLR start T41
- def mT41(self, ):
-
- try:
- self.type = T41
-
- # C.g:43:5: ( 'signed' )
- # C.g:43:7: 'signed'
- self.match("signed")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T41
-
-
-
- # $ANTLR start T42
- def mT42(self, ):
-
- try:
- self.type = T42
-
- # C.g:44:5: ( 'unsigned' )
- # C.g:44:7: 'unsigned'
- self.match("unsigned")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T42
-
-
-
- # $ANTLR start T43
- def mT43(self, ):
-
- try:
- self.type = T43
-
- # C.g:45:5: ( '{' )
- # C.g:45:7: '{'
- self.match(u'{')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T43
-
-
-
- # $ANTLR start T44
- def mT44(self, ):
-
- try:
- self.type = T44
-
- # C.g:46:5: ( '}' )
- # C.g:46:7: '}'
- self.match(u'}')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T44
-
-
-
- # $ANTLR start T45
- def mT45(self, ):
-
- try:
- self.type = T45
-
- # C.g:47:5: ( 'struct' )
- # C.g:47:7: 'struct'
- self.match("struct")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T45
-
-
-
- # $ANTLR start T46
- def mT46(self, ):
-
- try:
- self.type = T46
-
- # C.g:48:5: ( 'union' )
- # C.g:48:7: 'union'
- self.match("union")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T46
-
-
-
- # $ANTLR start T47
- def mT47(self, ):
-
- try:
- self.type = T47
-
- # C.g:49:5: ( ':' )
- # C.g:49:7: ':'
- self.match(u':')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T47
-
-
-
- # $ANTLR start T48
- def mT48(self, ):
-
- try:
- self.type = T48
-
- # C.g:50:5: ( 'enum' )
- # C.g:50:7: 'enum'
- self.match("enum")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T48
-
-
-
- # $ANTLR start T49
- def mT49(self, ):
-
- try:
- self.type = T49
-
- # C.g:51:5: ( 'const' )
- # C.g:51:7: 'const'
- self.match("const")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T49
-
-
-
- # $ANTLR start T50
- def mT50(self, ):
-
- try:
- self.type = T50
-
- # C.g:52:5: ( 'volatile' )
- # C.g:52:7: 'volatile'
- self.match("volatile")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T50
-
-
-
- # $ANTLR start T51
- def mT51(self, ):
-
- try:
- self.type = T51
-
- # C.g:53:5: ( 'IN' )
- # C.g:53:7: 'IN'
- self.match("IN")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T51
-
-
-
- # $ANTLR start T52
- def mT52(self, ):
-
- try:
- self.type = T52
-
- # C.g:54:5: ( 'OUT' )
- # C.g:54:7: 'OUT'
- self.match("OUT")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T52
-
-
-
- # $ANTLR start T53
- def mT53(self, ):
-
- try:
- self.type = T53
-
- # C.g:55:5: ( 'OPTIONAL' )
- # C.g:55:7: 'OPTIONAL'
- self.match("OPTIONAL")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T53
-
-
-
- # $ANTLR start T54
- def mT54(self, ):
-
- try:
- self.type = T54
-
- # C.g:56:5: ( 'CONST' )
- # C.g:56:7: 'CONST'
- self.match("CONST")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T54
-
-
-
- # $ANTLR start T55
- def mT55(self, ):
-
- try:
- self.type = T55
-
- # C.g:57:5: ( 'UNALIGNED' )
- # C.g:57:7: 'UNALIGNED'
- self.match("UNALIGNED")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T55
-
-
-
- # $ANTLR start T56
- def mT56(self, ):
-
- try:
- self.type = T56
-
- # C.g:58:5: ( 'VOLATILE' )
- # C.g:58:7: 'VOLATILE'
- self.match("VOLATILE")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T56
-
-
-
- # $ANTLR start T57
- def mT57(self, ):
-
- try:
- self.type = T57
-
- # C.g:59:5: ( 'GLOBAL_REMOVE_IF_UNREFERENCED' )
- # C.g:59:7: 'GLOBAL_REMOVE_IF_UNREFERENCED'
- self.match("GLOBAL_REMOVE_IF_UNREFERENCED")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T57
-
-
-
- # $ANTLR start T58
- def mT58(self, ):
-
- try:
- self.type = T58
-
- # C.g:60:5: ( 'EFIAPI' )
- # C.g:60:7: 'EFIAPI'
- self.match("EFIAPI")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T58
-
-
-
- # $ANTLR start T59
- def mT59(self, ):
-
- try:
- self.type = T59
-
- # C.g:61:5: ( 'EFI_BOOTSERVICE' )
- # C.g:61:7: 'EFI_BOOTSERVICE'
- self.match("EFI_BOOTSERVICE")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T59
-
-
-
- # $ANTLR start T60
- def mT60(self, ):
-
- try:
- self.type = T60
-
- # C.g:62:5: ( 'EFI_RUNTIMESERVICE' )
- # C.g:62:7: 'EFI_RUNTIMESERVICE'
- self.match("EFI_RUNTIMESERVICE")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T60
-
-
-
- # $ANTLR start T61
- def mT61(self, ):
-
- try:
- self.type = T61
-
- # C.g:63:5: ( 'PACKED' )
- # C.g:63:7: 'PACKED'
- self.match("PACKED")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T61
-
-
-
- # $ANTLR start T62
- def mT62(self, ):
-
- try:
- self.type = T62
-
- # C.g:64:5: ( '(' )
- # C.g:64:7: '('
- self.match(u'(')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T62
-
-
-
- # $ANTLR start T63
- def mT63(self, ):
-
- try:
- self.type = T63
-
- # C.g:65:5: ( ')' )
- # C.g:65:7: ')'
- self.match(u')')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T63
-
-
-
- # $ANTLR start T64
- def mT64(self, ):
-
- try:
- self.type = T64
-
- # C.g:66:5: ( '[' )
- # C.g:66:7: '['
- self.match(u'[')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T64
-
-
-
- # $ANTLR start T65
- def mT65(self, ):
-
- try:
- self.type = T65
-
- # C.g:67:5: ( ']' )
- # C.g:67:7: ']'
- self.match(u']')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T65
-
-
-
- # $ANTLR start T66
- def mT66(self, ):
-
- try:
- self.type = T66
-
- # C.g:68:5: ( '*' )
- # C.g:68:7: '*'
- self.match(u'*')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T66
-
-
-
- # $ANTLR start T67
- def mT67(self, ):
-
- try:
- self.type = T67
-
- # C.g:69:5: ( '...' )
- # C.g:69:7: '...'
- self.match("...")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T67
-
-
-
- # $ANTLR start T68
- def mT68(self, ):
-
- try:
- self.type = T68
-
- # C.g:70:5: ( '+' )
- # C.g:70:7: '+'
- self.match(u'+')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T68
-
-
-
- # $ANTLR start T69
- def mT69(self, ):
-
- try:
- self.type = T69
-
- # C.g:71:5: ( '-' )
- # C.g:71:7: '-'
- self.match(u'-')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T69
-
-
-
- # $ANTLR start T70
- def mT70(self, ):
-
- try:
- self.type = T70
-
- # C.g:72:5: ( '/' )
- # C.g:72:7: '/'
- self.match(u'/')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T70
-
-
-
- # $ANTLR start T71
- def mT71(self, ):
-
- try:
- self.type = T71
-
- # C.g:73:5: ( '%' )
- # C.g:73:7: '%'
- self.match(u'%')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T71
-
-
-
- # $ANTLR start T72
- def mT72(self, ):
-
- try:
- self.type = T72
-
- # C.g:74:5: ( '++' )
- # C.g:74:7: '++'
- self.match("++")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T72
-
-
-
- # $ANTLR start T73
- def mT73(self, ):
-
- try:
- self.type = T73
-
- # C.g:75:5: ( '--' )
- # C.g:75:7: '--'
- self.match("--")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T73
-
-
-
- # $ANTLR start T74
- def mT74(self, ):
-
- try:
- self.type = T74
-
- # C.g:76:5: ( 'sizeof' )
- # C.g:76:7: 'sizeof'
- self.match("sizeof")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T74
-
-
-
- # $ANTLR start T75
- def mT75(self, ):
-
- try:
- self.type = T75
-
- # C.g:77:5: ( '.' )
- # C.g:77:7: '.'
- self.match(u'.')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T75
-
-
-
- # $ANTLR start T76
- def mT76(self, ):
-
- try:
- self.type = T76
-
- # C.g:78:5: ( '->' )
- # C.g:78:7: '->'
- self.match("->")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T76
-
-
-
- # $ANTLR start T77
- def mT77(self, ):
-
- try:
- self.type = T77
-
- # C.g:79:5: ( '&' )
- # C.g:79:7: '&'
- self.match(u'&')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T77
-
-
-
- # $ANTLR start T78
- def mT78(self, ):
-
- try:
- self.type = T78
-
- # C.g:80:5: ( '~' )
- # C.g:80:7: '~'
- self.match(u'~')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T78
-
-
-
- # $ANTLR start T79
- def mT79(self, ):
-
- try:
- self.type = T79
-
- # C.g:81:5: ( '!' )
- # C.g:81:7: '!'
- self.match(u'!')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T79
-
-
-
- # $ANTLR start T80
- def mT80(self, ):
-
- try:
- self.type = T80
-
- # C.g:82:5: ( '*=' )
- # C.g:82:7: '*='
- self.match("*=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T80
-
-
-
- # $ANTLR start T81
- def mT81(self, ):
-
- try:
- self.type = T81
-
- # C.g:83:5: ( '/=' )
- # C.g:83:7: '/='
- self.match("/=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T81
-
-
-
- # $ANTLR start T82
- def mT82(self, ):
-
- try:
- self.type = T82
-
- # C.g:84:5: ( '%=' )
- # C.g:84:7: '%='
- self.match("%=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T82
-
-
-
- # $ANTLR start T83
- def mT83(self, ):
-
- try:
- self.type = T83
-
- # C.g:85:5: ( '+=' )
- # C.g:85:7: '+='
- self.match("+=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T83
-
-
-
- # $ANTLR start T84
- def mT84(self, ):
-
- try:
- self.type = T84
-
- # C.g:86:5: ( '-=' )
- # C.g:86:7: '-='
- self.match("-=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T84
-
-
-
- # $ANTLR start T85
- def mT85(self, ):
-
- try:
- self.type = T85
-
- # C.g:87:5: ( '<<=' )
- # C.g:87:7: '<<='
- self.match("<<=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T85
-
-
-
- # $ANTLR start T86
- def mT86(self, ):
-
- try:
- self.type = T86
-
- # C.g:88:5: ( '>>=' )
- # C.g:88:7: '>>='
- self.match(">>=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T86
-
-
-
- # $ANTLR start T87
- def mT87(self, ):
-
- try:
- self.type = T87
-
- # C.g:89:5: ( '&=' )
- # C.g:89:7: '&='
- self.match("&=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T87
-
-
-
- # $ANTLR start T88
- def mT88(self, ):
-
- try:
- self.type = T88
-
- # C.g:90:5: ( '^=' )
- # C.g:90:7: '^='
- self.match("^=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T88
-
-
-
- # $ANTLR start T89
- def mT89(self, ):
-
- try:
- self.type = T89
-
- # C.g:91:5: ( '|=' )
- # C.g:91:7: '|='
- self.match("|=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T89
-
-
-
- # $ANTLR start T90
- def mT90(self, ):
-
- try:
- self.type = T90
-
- # C.g:92:5: ( '?' )
- # C.g:92:7: '?'
- self.match(u'?')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T90
-
-
-
- # $ANTLR start T91
- def mT91(self, ):
-
- try:
- self.type = T91
-
- # C.g:93:5: ( '||' )
- # C.g:93:7: '||'
- self.match("||")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T91
-
-
-
- # $ANTLR start T92
- def mT92(self, ):
-
- try:
- self.type = T92
-
- # C.g:94:5: ( '&&' )
- # C.g:94:7: '&&'
- self.match("&&")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T92
-
-
-
- # $ANTLR start T93
- def mT93(self, ):
-
- try:
- self.type = T93
-
- # C.g:95:5: ( '|' )
- # C.g:95:7: '|'
- self.match(u'|')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T93
-
-
-
- # $ANTLR start T94
- def mT94(self, ):
-
- try:
- self.type = T94
-
- # C.g:96:5: ( '^' )
- # C.g:96:7: '^'
- self.match(u'^')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T94
-
-
-
- # $ANTLR start T95
- def mT95(self, ):
-
- try:
- self.type = T95
-
- # C.g:97:5: ( '==' )
- # C.g:97:7: '=='
- self.match("==")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T95
-
-
-
- # $ANTLR start T96
- def mT96(self, ):
-
- try:
- self.type = T96
-
- # C.g:98:5: ( '!=' )
- # C.g:98:7: '!='
- self.match("!=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T96
-
-
-
- # $ANTLR start T97
- def mT97(self, ):
-
- try:
- self.type = T97
-
- # C.g:99:5: ( '<' )
- # C.g:99:7: '<'
- self.match(u'<')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T97
-
-
-
- # $ANTLR start T98
- def mT98(self, ):
-
- try:
- self.type = T98
-
- # C.g:100:5: ( '>' )
- # C.g:100:7: '>'
- self.match(u'>')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T98
-
-
-
- # $ANTLR start T99
- def mT99(self, ):
-
- try:
- self.type = T99
-
- # C.g:101:5: ( '<=' )
- # C.g:101:7: '<='
- self.match("<=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T99
-
-
-
- # $ANTLR start T100
- def mT100(self, ):
-
- try:
- self.type = T100
-
- # C.g:102:6: ( '>=' )
- # C.g:102:8: '>='
- self.match(">=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T100
-
-
-
- # $ANTLR start T101
- def mT101(self, ):
-
- try:
- self.type = T101
-
- # C.g:103:6: ( '<<' )
- # C.g:103:8: '<<'
- self.match("<<")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T101
-
-
-
- # $ANTLR start T102
- def mT102(self, ):
-
- try:
- self.type = T102
-
- # C.g:104:6: ( '>>' )
- # C.g:104:8: '>>'
- self.match(">>")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T102
-
-
-
- # $ANTLR start T103
- def mT103(self, ):
-
- try:
- self.type = T103
-
- # C.g:105:6: ( '__asm__' )
- # C.g:105:8: '__asm__'
- self.match("__asm__")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T103
-
-
-
- # $ANTLR start T104
- def mT104(self, ):
-
- try:
- self.type = T104
-
- # C.g:106:6: ( '_asm' )
- # C.g:106:8: '_asm'
- self.match("_asm")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T104
-
-
-
- # $ANTLR start T105
- def mT105(self, ):
-
- try:
- self.type = T105
-
- # C.g:107:6: ( '__asm' )
- # C.g:107:8: '__asm'
- self.match("__asm")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T105
-
-
-
- # $ANTLR start T106
- def mT106(self, ):
-
- try:
- self.type = T106
-
- # C.g:108:6: ( 'case' )
- # C.g:108:8: 'case'
- self.match("case")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T106
-
-
-
- # $ANTLR start T107
- def mT107(self, ):
-
- try:
- self.type = T107
-
- # C.g:109:6: ( 'default' )
- # C.g:109:8: 'default'
- self.match("default")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T107
-
-
-
- # $ANTLR start T108
- def mT108(self, ):
-
- try:
- self.type = T108
-
- # C.g:110:6: ( 'if' )
- # C.g:110:8: 'if'
- self.match("if")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T108
-
-
-
- # $ANTLR start T109
- def mT109(self, ):
-
- try:
- self.type = T109
-
- # C.g:111:6: ( 'else' )
- # C.g:111:8: 'else'
- self.match("else")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T109
-
-
-
- # $ANTLR start T110
- def mT110(self, ):
-
- try:
- self.type = T110
-
- # C.g:112:6: ( 'switch' )
- # C.g:112:8: 'switch'
- self.match("switch")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T110
-
-
-
- # $ANTLR start T111
- def mT111(self, ):
-
- try:
- self.type = T111
-
- # C.g:113:6: ( 'while' )
- # C.g:113:8: 'while'
- self.match("while")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T111
-
-
-
- # $ANTLR start T112
- def mT112(self, ):
-
- try:
- self.type = T112
-
- # C.g:114:6: ( 'do' )
- # C.g:114:8: 'do'
- self.match("do")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T112
-
-
-
- # $ANTLR start T113
- def mT113(self, ):
-
- try:
- self.type = T113
-
- # C.g:115:6: ( 'for' )
- # C.g:115:8: 'for'
- self.match("for")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T113
-
-
-
- # $ANTLR start T114
- def mT114(self, ):
-
- try:
- self.type = T114
-
- # C.g:116:6: ( 'goto' )
- # C.g:116:8: 'goto'
- self.match("goto")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T114
-
-
-
- # $ANTLR start T115
- def mT115(self, ):
-
- try:
- self.type = T115
-
- # C.g:117:6: ( 'continue' )
- # C.g:117:8: 'continue'
- self.match("continue")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T115
-
-
-
- # $ANTLR start T116
- def mT116(self, ):
-
- try:
- self.type = T116
-
- # C.g:118:6: ( 'break' )
- # C.g:118:8: 'break'
- self.match("break")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T116
-
-
-
- # $ANTLR start T117
- def mT117(self, ):
-
- try:
- self.type = T117
-
- # C.g:119:6: ( 'return' )
- # C.g:119:8: 'return'
- self.match("return")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T117
-
-
-
- # $ANTLR start IDENTIFIER
- def mIDENTIFIER(self, ):
-
- try:
- self.type = IDENTIFIER
-
- # C.g:586:2: ( LETTER ( LETTER | '0' .. '9' )* )
- # C.g:586:4: LETTER ( LETTER | '0' .. '9' )*
- self.mLETTER()
-
- # C.g:586:11: ( LETTER | '0' .. '9' )*
- while True: #loop1
- alt1 = 2
- LA1_0 = self.input.LA(1)
-
- if (LA1_0 == u'$' or (u'0' <= LA1_0 <= u'9') or (u'A' <= LA1_0 <= u'Z') or LA1_0 == u'_' or (u'a' <= LA1_0 <= u'z')) :
- alt1 = 1
-
-
- if alt1 == 1:
- # C.g:
- if self.input.LA(1) == u'$' or (u'0' <= self.input.LA(1) <= u'9') or (u'A' <= self.input.LA(1) <= u'Z') or self.input.LA(1) == u'_' or (u'a' <= self.input.LA(1) <= u'z'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- else:
- break #loop1
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end IDENTIFIER
-
-
-
- # $ANTLR start LETTER
- def mLETTER(self, ):
-
- try:
- # C.g:591:2: ( '$' | 'A' .. 'Z' | 'a' .. 'z' | '_' )
- # C.g:
- if self.input.LA(1) == u'$' or (u'A' <= self.input.LA(1) <= u'Z') or self.input.LA(1) == u'_' or (u'a' <= self.input.LA(1) <= u'z'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end LETTER
-
-
-
- # $ANTLR start CHARACTER_LITERAL
- def mCHARACTER_LITERAL(self, ):
-
- try:
- self.type = CHARACTER_LITERAL
-
- # C.g:598:5: ( ( 'L' )? '\\'' ( EscapeSequence | ~ ( '\\'' | '\\\\' ) ) '\\'' )
- # C.g:598:9: ( 'L' )? '\\'' ( EscapeSequence | ~ ( '\\'' | '\\\\' ) ) '\\''
- # C.g:598:9: ( 'L' )?
- alt2 = 2
- LA2_0 = self.input.LA(1)
-
- if (LA2_0 == u'L') :
- alt2 = 1
- if alt2 == 1:
- # C.g:598:10: 'L'
- self.match(u'L')
-
-
-
-
- self.match(u'\'')
-
- # C.g:598:21: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )
- alt3 = 2
- LA3_0 = self.input.LA(1)
-
- if (LA3_0 == u'\\') :
- alt3 = 1
- elif ((u'\u0000' <= LA3_0 <= u'&') or (u'(' <= LA3_0 <= u'[') or (u']' <= LA3_0 <= u'\uFFFE')) :
- alt3 = 2
- else:
- nvae = NoViableAltException("598:21: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )", 3, 0, self.input)
-
- raise nvae
-
- if alt3 == 1:
- # C.g:598:23: EscapeSequence
- self.mEscapeSequence()
-
-
-
- elif alt3 == 2:
- # C.g:598:40: ~ ( '\\'' | '\\\\' )
- if (u'\u0000' <= self.input.LA(1) <= u'&') or (u'(' <= self.input.LA(1) <= u'[') or (u']' <= self.input.LA(1) <= u'\uFFFE'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
- self.match(u'\'')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end CHARACTER_LITERAL
-
-
-
- # $ANTLR start STRING_LITERAL
- def mSTRING_LITERAL(self, ):
-
- try:
- self.type = STRING_LITERAL
-
- # C.g:602:5: ( ( 'L' )? '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' )
- # C.g:602:8: ( 'L' )? '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"'
- # C.g:602:8: ( 'L' )?
- alt4 = 2
- LA4_0 = self.input.LA(1)
-
- if (LA4_0 == u'L') :
- alt4 = 1
- if alt4 == 1:
- # C.g:602:9: 'L'
- self.match(u'L')
-
-
-
-
- self.match(u'"')
-
- # C.g:602:19: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )*
- while True: #loop5
- alt5 = 3
- LA5_0 = self.input.LA(1)
-
- if (LA5_0 == u'\\') :
- alt5 = 1
- elif ((u'\u0000' <= LA5_0 <= u'!') or (u'#' <= LA5_0 <= u'[') or (u']' <= LA5_0 <= u'\uFFFE')) :
- alt5 = 2
-
-
- if alt5 == 1:
- # C.g:602:21: EscapeSequence
- self.mEscapeSequence()
-
-
-
- elif alt5 == 2:
- # C.g:602:38: ~ ( '\\\\' | '\"' )
- if (u'\u0000' <= self.input.LA(1) <= u'!') or (u'#' <= self.input.LA(1) <= u'[') or (u']' <= self.input.LA(1) <= u'\uFFFE'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- else:
- break #loop5
-
-
- self.match(u'"')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end STRING_LITERAL
-
-
-
- # $ANTLR start HEX_LITERAL
- def mHEX_LITERAL(self, ):
-
- try:
- self.type = HEX_LITERAL
-
- # C.g:605:13: ( '0' ( 'x' | 'X' ) ( HexDigit )+ ( IntegerTypeSuffix )? )
- # C.g:605:15: '0' ( 'x' | 'X' ) ( HexDigit )+ ( IntegerTypeSuffix )?
- self.match(u'0')
-
- if self.input.LA(1) == u'X' or self.input.LA(1) == u'x':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- # C.g:605:29: ( HexDigit )+
- cnt6 = 0
- while True: #loop6
- alt6 = 2
- LA6_0 = self.input.LA(1)
-
- if ((u'0' <= LA6_0 <= u'9') or (u'A' <= LA6_0 <= u'F') or (u'a' <= LA6_0 <= u'f')) :
- alt6 = 1
-
-
- if alt6 == 1:
- # C.g:605:29: HexDigit
- self.mHexDigit()
-
-
-
- else:
- if cnt6 >= 1:
- break #loop6
-
- eee = EarlyExitException(6, self.input)
- raise eee
-
- cnt6 += 1
-
-
- # C.g:605:39: ( IntegerTypeSuffix )?
- alt7 = 2
- LA7_0 = self.input.LA(1)
-
- if (LA7_0 == u'L' or LA7_0 == u'U' or LA7_0 == u'l' or LA7_0 == u'u') :
- alt7 = 1
- if alt7 == 1:
- # C.g:605:39: IntegerTypeSuffix
- self.mIntegerTypeSuffix()
-
-
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end HEX_LITERAL
-
-
-
- # $ANTLR start DECIMAL_LITERAL
- def mDECIMAL_LITERAL(self, ):
-
- try:
- self.type = DECIMAL_LITERAL
-
- # C.g:607:17: ( ( '0' | '1' .. '9' ( '0' .. '9' )* ) ( IntegerTypeSuffix )? )
- # C.g:607:19: ( '0' | '1' .. '9' ( '0' .. '9' )* ) ( IntegerTypeSuffix )?
- # C.g:607:19: ( '0' | '1' .. '9' ( '0' .. '9' )* )
- alt9 = 2
- LA9_0 = self.input.LA(1)
-
- if (LA9_0 == u'0') :
- alt9 = 1
- elif ((u'1' <= LA9_0 <= u'9')) :
- alt9 = 2
- else:
- nvae = NoViableAltException("607:19: ( '0' | '1' .. '9' ( '0' .. '9' )* )", 9, 0, self.input)
-
- raise nvae
-
- if alt9 == 1:
- # C.g:607:20: '0'
- self.match(u'0')
-
-
-
- elif alt9 == 2:
- # C.g:607:26: '1' .. '9' ( '0' .. '9' )*
- self.matchRange(u'1', u'9')
-
- # C.g:607:35: ( '0' .. '9' )*
- while True: #loop8
- alt8 = 2
- LA8_0 = self.input.LA(1)
-
- if ((u'0' <= LA8_0 <= u'9')) :
- alt8 = 1
-
-
- if alt8 == 1:
- # C.g:607:35: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- break #loop8
-
-
-
-
-
- # C.g:607:46: ( IntegerTypeSuffix )?
- alt10 = 2
- LA10_0 = self.input.LA(1)
-
- if (LA10_0 == u'L' or LA10_0 == u'U' or LA10_0 == u'l' or LA10_0 == u'u') :
- alt10 = 1
- if alt10 == 1:
- # C.g:607:46: IntegerTypeSuffix
- self.mIntegerTypeSuffix()
-
-
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end DECIMAL_LITERAL
-
-
-
- # $ANTLR start OCTAL_LITERAL
- def mOCTAL_LITERAL(self, ):
-
- try:
- self.type = OCTAL_LITERAL
-
- # C.g:609:15: ( '0' ( '0' .. '7' )+ ( IntegerTypeSuffix )? )
- # C.g:609:17: '0' ( '0' .. '7' )+ ( IntegerTypeSuffix )?
- self.match(u'0')
-
- # C.g:609:21: ( '0' .. '7' )+
- cnt11 = 0
- while True: #loop11
- alt11 = 2
- LA11_0 = self.input.LA(1)
-
- if ((u'0' <= LA11_0 <= u'7')) :
- alt11 = 1
-
-
- if alt11 == 1:
- # C.g:609:22: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
- else:
- if cnt11 >= 1:
- break #loop11
-
- eee = EarlyExitException(11, self.input)
- raise eee
-
- cnt11 += 1
-
-
- # C.g:609:33: ( IntegerTypeSuffix )?
- alt12 = 2
- LA12_0 = self.input.LA(1)
-
- if (LA12_0 == u'L' or LA12_0 == u'U' or LA12_0 == u'l' or LA12_0 == u'u') :
- alt12 = 1
- if alt12 == 1:
- # C.g:609:33: IntegerTypeSuffix
- self.mIntegerTypeSuffix()
-
-
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end OCTAL_LITERAL
-
-
-
- # $ANTLR start HexDigit
- def mHexDigit(self, ):
-
- try:
- # C.g:612:10: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
- # C.g:612:12: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )
- if (u'0' <= self.input.LA(1) <= u'9') or (u'A' <= self.input.LA(1) <= u'F') or (u'a' <= self.input.LA(1) <= u'f'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end HexDigit
-
-
-
- # $ANTLR start IntegerTypeSuffix
- def mIntegerTypeSuffix(self, ):
-
- try:
- # C.g:616:2: ( ( 'u' | 'U' ) | ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) )
- alt13 = 4
- LA13_0 = self.input.LA(1)
-
- if (LA13_0 == u'U' or LA13_0 == u'u') :
- LA13_1 = self.input.LA(2)
-
- if (LA13_1 == u'L' or LA13_1 == u'l') :
- LA13_3 = self.input.LA(3)
-
- if (LA13_3 == u'L' or LA13_3 == u'l') :
- alt13 = 4
- else:
- alt13 = 3
- else:
- alt13 = 1
- elif (LA13_0 == u'L' or LA13_0 == u'l') :
- alt13 = 2
- else:
- nvae = NoViableAltException("614:1: fragment IntegerTypeSuffix : ( ( 'u' | 'U' ) | ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) );", 13, 0, self.input)
-
- raise nvae
-
- if alt13 == 1:
- # C.g:616:4: ( 'u' | 'U' )
- if self.input.LA(1) == u'U' or self.input.LA(1) == u'u':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- elif alt13 == 2:
- # C.g:617:4: ( 'l' | 'L' )
- if self.input.LA(1) == u'L' or self.input.LA(1) == u'l':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- elif alt13 == 3:
- # C.g:618:4: ( 'u' | 'U' ) ( 'l' | 'L' )
- if self.input.LA(1) == u'U' or self.input.LA(1) == u'u':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- if self.input.LA(1) == u'L' or self.input.LA(1) == u'l':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- elif alt13 == 4:
- # C.g:619:4: ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' )
- if self.input.LA(1) == u'U' or self.input.LA(1) == u'u':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- if self.input.LA(1) == u'L' or self.input.LA(1) == u'l':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- if self.input.LA(1) == u'L' or self.input.LA(1) == u'l':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end IntegerTypeSuffix
-
-
-
- # $ANTLR start FLOATING_POINT_LITERAL
- def mFLOATING_POINT_LITERAL(self, ):
-
- try:
- self.type = FLOATING_POINT_LITERAL
-
- # C.g:623:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? | '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? | ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? | ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix )
- alt25 = 4
- alt25 = self.dfa25.predict(self.input)
- if alt25 == 1:
- # C.g:623:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )?
- # C.g:623:9: ( '0' .. '9' )+
- cnt14 = 0
- while True: #loop14
- alt14 = 2
- LA14_0 = self.input.LA(1)
-
- if ((u'0' <= LA14_0 <= u'9')) :
- alt14 = 1
-
-
- if alt14 == 1:
- # C.g:623:10: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- if cnt14 >= 1:
- break #loop14
-
- eee = EarlyExitException(14, self.input)
- raise eee
-
- cnt14 += 1
-
-
- self.match(u'.')
-
- # C.g:623:25: ( '0' .. '9' )*
- while True: #loop15
- alt15 = 2
- LA15_0 = self.input.LA(1)
-
- if ((u'0' <= LA15_0 <= u'9')) :
- alt15 = 1
-
-
- if alt15 == 1:
- # C.g:623:26: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- break #loop15
-
-
- # C.g:623:37: ( Exponent )?
- alt16 = 2
- LA16_0 = self.input.LA(1)
-
- if (LA16_0 == u'E' or LA16_0 == u'e') :
- alt16 = 1
- if alt16 == 1:
- # C.g:623:37: Exponent
- self.mExponent()
-
-
-
-
- # C.g:623:47: ( FloatTypeSuffix )?
- alt17 = 2
- LA17_0 = self.input.LA(1)
-
- if (LA17_0 == u'D' or LA17_0 == u'F' or LA17_0 == u'd' or LA17_0 == u'f') :
- alt17 = 1
- if alt17 == 1:
- # C.g:623:47: FloatTypeSuffix
- self.mFloatTypeSuffix()
-
-
-
-
-
-
- elif alt25 == 2:
- # C.g:624:9: '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )?
- self.match(u'.')
-
- # C.g:624:13: ( '0' .. '9' )+
- cnt18 = 0
- while True: #loop18
- alt18 = 2
- LA18_0 = self.input.LA(1)
-
- if ((u'0' <= LA18_0 <= u'9')) :
- alt18 = 1
-
-
- if alt18 == 1:
- # C.g:624:14: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- if cnt18 >= 1:
- break #loop18
-
- eee = EarlyExitException(18, self.input)
- raise eee
-
- cnt18 += 1
-
-
- # C.g:624:25: ( Exponent )?
- alt19 = 2
- LA19_0 = self.input.LA(1)
-
- if (LA19_0 == u'E' or LA19_0 == u'e') :
- alt19 = 1
- if alt19 == 1:
- # C.g:624:25: Exponent
- self.mExponent()
-
-
-
-
- # C.g:624:35: ( FloatTypeSuffix )?
- alt20 = 2
- LA20_0 = self.input.LA(1)
-
- if (LA20_0 == u'D' or LA20_0 == u'F' or LA20_0 == u'd' or LA20_0 == u'f') :
- alt20 = 1
- if alt20 == 1:
- # C.g:624:35: FloatTypeSuffix
- self.mFloatTypeSuffix()
-
-
-
-
-
-
- elif alt25 == 3:
- # C.g:625:9: ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )?
- # C.g:625:9: ( '0' .. '9' )+
- cnt21 = 0
- while True: #loop21
- alt21 = 2
- LA21_0 = self.input.LA(1)
-
- if ((u'0' <= LA21_0 <= u'9')) :
- alt21 = 1
-
-
- if alt21 == 1:
- # C.g:625:10: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- if cnt21 >= 1:
- break #loop21
-
- eee = EarlyExitException(21, self.input)
- raise eee
-
- cnt21 += 1
-
-
- self.mExponent()
-
- # C.g:625:30: ( FloatTypeSuffix )?
- alt22 = 2
- LA22_0 = self.input.LA(1)
-
- if (LA22_0 == u'D' or LA22_0 == u'F' or LA22_0 == u'd' or LA22_0 == u'f') :
- alt22 = 1
- if alt22 == 1:
- # C.g:625:30: FloatTypeSuffix
- self.mFloatTypeSuffix()
-
-
-
-
-
-
- elif alt25 == 4:
- # C.g:626:9: ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix
- # C.g:626:9: ( '0' .. '9' )+
- cnt23 = 0
- while True: #loop23
- alt23 = 2
- LA23_0 = self.input.LA(1)
-
- if ((u'0' <= LA23_0 <= u'9')) :
- alt23 = 1
-
-
- if alt23 == 1:
- # C.g:626:10: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- if cnt23 >= 1:
- break #loop23
-
- eee = EarlyExitException(23, self.input)
- raise eee
-
- cnt23 += 1
-
-
- # C.g:626:21: ( Exponent )?
- alt24 = 2
- LA24_0 = self.input.LA(1)
-
- if (LA24_0 == u'E' or LA24_0 == u'e') :
- alt24 = 1
- if alt24 == 1:
- # C.g:626:21: Exponent
- self.mExponent()
-
-
-
-
- self.mFloatTypeSuffix()
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end FLOATING_POINT_LITERAL
-
-
-
- # $ANTLR start Exponent
- def mExponent(self, ):
-
- try:
- # C.g:630:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
- # C.g:630:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
- if self.input.LA(1) == u'E' or self.input.LA(1) == u'e':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- # C.g:630:22: ( '+' | '-' )?
- alt26 = 2
- LA26_0 = self.input.LA(1)
-
- if (LA26_0 == u'+' or LA26_0 == u'-') :
- alt26 = 1
- if alt26 == 1:
- # C.g:
- if self.input.LA(1) == u'+' or self.input.LA(1) == u'-':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
- # C.g:630:33: ( '0' .. '9' )+
- cnt27 = 0
- while True: #loop27
- alt27 = 2
- LA27_0 = self.input.LA(1)
-
- if ((u'0' <= LA27_0 <= u'9')) :
- alt27 = 1
-
-
- if alt27 == 1:
- # C.g:630:34: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- if cnt27 >= 1:
- break #loop27
-
- eee = EarlyExitException(27, self.input)
- raise eee
-
- cnt27 += 1
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end Exponent
-
-
-
- # $ANTLR start FloatTypeSuffix
- def mFloatTypeSuffix(self, ):
-
- try:
- # C.g:633:17: ( ( 'f' | 'F' | 'd' | 'D' ) )
- # C.g:633:19: ( 'f' | 'F' | 'd' | 'D' )
- if self.input.LA(1) == u'D' or self.input.LA(1) == u'F' or self.input.LA(1) == u'd' or self.input.LA(1) == u'f':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end FloatTypeSuffix
-
-
-
- # $ANTLR start EscapeSequence
- def mEscapeSequence(self, ):
-
- try:
- # C.g:637:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape )
- alt28 = 2
- LA28_0 = self.input.LA(1)
-
- if (LA28_0 == u'\\') :
- LA28_1 = self.input.LA(2)
-
- if (LA28_1 == u'"' or LA28_1 == u'\'' or LA28_1 == u'\\' or LA28_1 == u'b' or LA28_1 == u'f' or LA28_1 == u'n' or LA28_1 == u'r' or LA28_1 == u't') :
- alt28 = 1
- elif ((u'0' <= LA28_1 <= u'7')) :
- alt28 = 2
- else:
- nvae = NoViableAltException("635:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 28, 1, self.input)
-
- raise nvae
-
- else:
- nvae = NoViableAltException("635:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 28, 0, self.input)
-
- raise nvae
-
- if alt28 == 1:
- # C.g:637:8: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
- self.match(u'\\')
-
- if self.input.LA(1) == u'"' or self.input.LA(1) == u'\'' or self.input.LA(1) == u'\\' or self.input.LA(1) == u'b' or self.input.LA(1) == u'f' or self.input.LA(1) == u'n' or self.input.LA(1) == u'r' or self.input.LA(1) == u't':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- elif alt28 == 2:
- # C.g:638:9: OctalEscape
- self.mOctalEscape()
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end EscapeSequence
-
-
-
- # $ANTLR start OctalEscape
- def mOctalEscape(self, ):
-
- try:
- # C.g:643:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
- alt29 = 3
- LA29_0 = self.input.LA(1)
-
- if (LA29_0 == u'\\') :
- LA29_1 = self.input.LA(2)
-
- if ((u'0' <= LA29_1 <= u'3')) :
- LA29_2 = self.input.LA(3)
-
- if ((u'0' <= LA29_2 <= u'7')) :
- LA29_4 = self.input.LA(4)
-
- if ((u'0' <= LA29_4 <= u'7')) :
- alt29 = 1
- else:
- alt29 = 2
- else:
- alt29 = 3
- elif ((u'4' <= LA29_1 <= u'7')) :
- LA29_3 = self.input.LA(3)
-
- if ((u'0' <= LA29_3 <= u'7')) :
- alt29 = 2
- else:
- alt29 = 3
- else:
- nvae = NoViableAltException("641:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 29, 1, self.input)
-
- raise nvae
-
- else:
- nvae = NoViableAltException("641:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 29, 0, self.input)
-
- raise nvae
-
- if alt29 == 1:
- # C.g:643:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
- self.match(u'\\')
-
- # C.g:643:14: ( '0' .. '3' )
- # C.g:643:15: '0' .. '3'
- self.matchRange(u'0', u'3')
-
-
-
-
- # C.g:643:25: ( '0' .. '7' )
- # C.g:643:26: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
-
- # C.g:643:36: ( '0' .. '7' )
- # C.g:643:37: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
-
-
-
- elif alt29 == 2:
- # C.g:644:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
- self.match(u'\\')
-
- # C.g:644:14: ( '0' .. '7' )
- # C.g:644:15: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
-
- # C.g:644:25: ( '0' .. '7' )
- # C.g:644:26: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
-
-
-
- elif alt29 == 3:
- # C.g:645:9: '\\\\' ( '0' .. '7' )
- self.match(u'\\')
-
- # C.g:645:14: ( '0' .. '7' )
- # C.g:645:15: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end OctalEscape
-
-
-
- # $ANTLR start UnicodeEscape
- def mUnicodeEscape(self, ):
-
- try:
- # C.g:650:5: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit )
- # C.g:650:9: '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit
- self.match(u'\\')
-
- self.match(u'u')
-
- self.mHexDigit()
-
- self.mHexDigit()
-
- self.mHexDigit()
-
- self.mHexDigit()
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end UnicodeEscape
-
-
-
- # $ANTLR start WS
- def mWS(self, ):
-
- try:
- self.type = WS
-
- # C.g:653:5: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) )
- # C.g:653:8: ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' )
- if (u'\t' <= self.input.LA(1) <= u'\n') or (u'\f' <= self.input.LA(1) <= u'\r') or self.input.LA(1) == u' ':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- #action start
- self.channel=HIDDEN;
- #action end
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end WS
-
-
-
- # $ANTLR start BS
- def mBS(self, ):
-
- try:
- self.type = BS
-
- # C.g:657:5: ( ( '\\\\' ) )
- # C.g:657:7: ( '\\\\' )
- # C.g:657:7: ( '\\\\' )
- # C.g:657:8: '\\\\'
- self.match(u'\\')
-
-
-
-
- #action start
- self.channel=HIDDEN;
- #action end
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end BS
-
-
-
- # $ANTLR start UnicodeVocabulary
- def mUnicodeVocabulary(self, ):
-
- try:
- self.type = UnicodeVocabulary
-
- # C.g:665:5: ( '\\u0003' .. '\\uFFFE' )
- # C.g:665:7: '\\u0003' .. '\\uFFFE'
- self.matchRange(u'\u0003', u'\uFFFE')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end UnicodeVocabulary
-
-
-
- # $ANTLR start COMMENT
- def mCOMMENT(self, ):
-
- try:
- self.type = COMMENT
-
- # C.g:668:5: ( '/*' ( options {greedy=false; } : . )* '*/' )
- # C.g:668:9: '/*' ( options {greedy=false; } : . )* '*/'
- self.match("/*")
-
-
- # C.g:668:14: ( options {greedy=false; } : . )*
- while True: #loop30
- alt30 = 2
- LA30_0 = self.input.LA(1)
-
- if (LA30_0 == u'*') :
- LA30_1 = self.input.LA(2)
-
- if (LA30_1 == u'/') :
- alt30 = 2
- elif ((u'\u0000' <= LA30_1 <= u'.') or (u'0' <= LA30_1 <= u'\uFFFE')) :
- alt30 = 1
-
-
- elif ((u'\u0000' <= LA30_0 <= u')') or (u'+' <= LA30_0 <= u'\uFFFE')) :
- alt30 = 1
-
-
- if alt30 == 1:
- # C.g:668:42: .
- self.matchAny()
-
-
-
- else:
- break #loop30
-
-
- self.match("*/")
-
-
- #action start
- self.channel=HIDDEN;
- #action end
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end COMMENT
-
-
-
- # $ANTLR start LINE_COMMENT
- def mLINE_COMMENT(self, ):
-
- try:
- self.type = LINE_COMMENT
-
- # C.g:673:5: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
- # C.g:673:7: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
- self.match("//")
-
-
- # C.g:673:12: (~ ( '\\n' | '\\r' ) )*
- while True: #loop31
- alt31 = 2
- LA31_0 = self.input.LA(1)
-
- if ((u'\u0000' <= LA31_0 <= u'\t') or (u'\u000B' <= LA31_0 <= u'\f') or (u'\u000E' <= LA31_0 <= u'\uFFFE')) :
- alt31 = 1
-
-
- if alt31 == 1:
- # C.g:673:12: ~ ( '\\n' | '\\r' )
- if (u'\u0000' <= self.input.LA(1) <= u'\t') or (u'\u000B' <= self.input.LA(1) <= u'\f') or (u'\u000E' <= self.input.LA(1) <= u'\uFFFE'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- else:
- break #loop31
-
-
- # C.g:673:26: ( '\\r' )?
- alt32 = 2
- LA32_0 = self.input.LA(1)
-
- if (LA32_0 == u'\r') :
- alt32 = 1
- if alt32 == 1:
- # C.g:673:26: '\\r'
- self.match(u'\r')
-
-
-
-
- self.match(u'\n')
-
- #action start
- self.channel=HIDDEN;
- #action end
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end LINE_COMMENT
-
-
-
- # $ANTLR start LINE_COMMAND
- def mLINE_COMMAND(self, ):
-
- try:
- self.type = LINE_COMMAND
-
- # C.g:678:5: ( '#' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
- # C.g:678:7: '#' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
- self.match(u'#')
-
- # C.g:678:11: (~ ( '\\n' | '\\r' ) )*
- while True: #loop33
- alt33 = 2
- LA33_0 = self.input.LA(1)
-
- if ((u'\u0000' <= LA33_0 <= u'\t') or (u'\u000B' <= LA33_0 <= u'\f') or (u'\u000E' <= LA33_0 <= u'\uFFFE')) :
- alt33 = 1
-
-
- if alt33 == 1:
- # C.g:678:11: ~ ( '\\n' | '\\r' )
- if (u'\u0000' <= self.input.LA(1) <= u'\t') or (u'\u000B' <= self.input.LA(1) <= u'\f') or (u'\u000E' <= self.input.LA(1) <= u'\uFFFE'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- else:
- break #loop33
-
-
- # C.g:678:25: ( '\\r' )?
- alt34 = 2
- LA34_0 = self.input.LA(1)
-
- if (LA34_0 == u'\r') :
- alt34 = 1
- if alt34 == 1:
- # C.g:678:25: '\\r'
- self.match(u'\r')
-
-
-
-
- self.match(u'\n')
-
- #action start
- self.channel=HIDDEN;
- #action end
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end LINE_COMMAND
-
-
-
- def mTokens(self):
- # C.g:1:8: ( T25 | T26 | T27 | T28 | T29 | T30 | T31 | T32 | T33 | T34 | T35 | T36 | T37 | T38 | T39 | T40 | T41 | T42 | T43 | T44 | T45 | T46 | T47 | T48 | T49 | T50 | T51 | T52 | T53 | T54 | T55 | T56 | T57 | T58 | T59 | T60 | T61 | T62 | T63 | T64 | T65 | T66 | T67 | T68 | T69 | T70 | T71 | T72 | T73 | T74 | T75 | T76 | T77 | T78 | T79 | T80 | T81 | T82 | T83 | T84 | T85 | T86 | T87 | T88 | T89 | T90 | T91 | T92 | T93 | T94 | T95 | T96 | T97 | T98 | T99 | T100 | T101 | T102 | T103 | T104 | T105 | T106 | T107 | T108 | T109 | T110 | T111 | T112 | T113 | T114 | T115 | T116 | T117 | IDENTIFIER | CHARACTER_LITERAL | STRING_LITERAL | HEX_LITERAL | DECIMAL_LITERAL | OCTAL_LITERAL | FLOATING_POINT_LITERAL | WS | BS | UnicodeVocabulary | COMMENT | LINE_COMMENT | LINE_COMMAND )
- alt35 = 106
- alt35 = self.dfa35.predict(self.input)
- if alt35 == 1:
- # C.g:1:10: T25
- self.mT25()
-
-
-
- elif alt35 == 2:
- # C.g:1:14: T26
- self.mT26()
-
-
-
- elif alt35 == 3:
- # C.g:1:18: T27
- self.mT27()
-
-
-
- elif alt35 == 4:
- # C.g:1:22: T28
- self.mT28()
-
-
-
- elif alt35 == 5:
- # C.g:1:26: T29
- self.mT29()
-
-
-
- elif alt35 == 6:
- # C.g:1:30: T30
- self.mT30()
-
-
-
- elif alt35 == 7:
- # C.g:1:34: T31
- self.mT31()
-
-
-
- elif alt35 == 8:
- # C.g:1:38: T32
- self.mT32()
-
-
-
- elif alt35 == 9:
- # C.g:1:42: T33
- self.mT33()
-
-
-
- elif alt35 == 10:
- # C.g:1:46: T34
- self.mT34()
-
-
-
- elif alt35 == 11:
- # C.g:1:50: T35
- self.mT35()
-
-
-
- elif alt35 == 12:
- # C.g:1:54: T36
- self.mT36()
-
-
-
- elif alt35 == 13:
- # C.g:1:58: T37
- self.mT37()
-
-
-
- elif alt35 == 14:
- # C.g:1:62: T38
- self.mT38()
-
-
-
- elif alt35 == 15:
- # C.g:1:66: T39
- self.mT39()
-
-
-
- elif alt35 == 16:
- # C.g:1:70: T40
- self.mT40()
-
-
-
- elif alt35 == 17:
- # C.g:1:74: T41
- self.mT41()
-
-
-
- elif alt35 == 18:
- # C.g:1:78: T42
- self.mT42()
-
-
-
- elif alt35 == 19:
- # C.g:1:82: T43
- self.mT43()
-
-
-
- elif alt35 == 20:
- # C.g:1:86: T44
- self.mT44()
-
-
-
- elif alt35 == 21:
- # C.g:1:90: T45
- self.mT45()
-
-
-
- elif alt35 == 22:
- # C.g:1:94: T46
- self.mT46()
-
-
-
- elif alt35 == 23:
- # C.g:1:98: T47
- self.mT47()
-
-
-
- elif alt35 == 24:
- # C.g:1:102: T48
- self.mT48()
-
-
-
- elif alt35 == 25:
- # C.g:1:106: T49
- self.mT49()
-
-
-
- elif alt35 == 26:
- # C.g:1:110: T50
- self.mT50()
-
-
-
- elif alt35 == 27:
- # C.g:1:114: T51
- self.mT51()
-
-
-
- elif alt35 == 28:
- # C.g:1:118: T52
- self.mT52()
-
-
-
- elif alt35 == 29:
- # C.g:1:122: T53
- self.mT53()
-
-
-
- elif alt35 == 30:
- # C.g:1:126: T54
- self.mT54()
-
-
-
- elif alt35 == 31:
- # C.g:1:130: T55
- self.mT55()
-
-
-
- elif alt35 == 32:
- # C.g:1:134: T56
- self.mT56()
-
-
-
- elif alt35 == 33:
- # C.g:1:138: T57
- self.mT57()
-
-
-
- elif alt35 == 34:
- # C.g:1:142: T58
- self.mT58()
-
-
-
- elif alt35 == 35:
- # C.g:1:146: T59
- self.mT59()
-
-
-
- elif alt35 == 36:
- # C.g:1:150: T60
- self.mT60()
-
-
-
- elif alt35 == 37:
- # C.g:1:154: T61
- self.mT61()
-
-
-
- elif alt35 == 38:
- # C.g:1:158: T62
- self.mT62()
-
-
-
- elif alt35 == 39:
- # C.g:1:162: T63
- self.mT63()
-
-
-
- elif alt35 == 40:
- # C.g:1:166: T64
- self.mT64()
-
-
-
- elif alt35 == 41:
- # C.g:1:170: T65
- self.mT65()
-
-
-
- elif alt35 == 42:
- # C.g:1:174: T66
- self.mT66()
-
-
-
- elif alt35 == 43:
- # C.g:1:178: T67
- self.mT67()
-
-
-
- elif alt35 == 44:
- # C.g:1:182: T68
- self.mT68()
-
-
-
- elif alt35 == 45:
- # C.g:1:186: T69
- self.mT69()
-
-
-
- elif alt35 == 46:
- # C.g:1:190: T70
- self.mT70()
-
-
-
- elif alt35 == 47:
- # C.g:1:194: T71
- self.mT71()
-
-
-
- elif alt35 == 48:
- # C.g:1:198: T72
- self.mT72()
-
-
-
- elif alt35 == 49:
- # C.g:1:202: T73
- self.mT73()
-
-
-
- elif alt35 == 50:
- # C.g:1:206: T74
- self.mT74()
-
-
-
- elif alt35 == 51:
- # C.g:1:210: T75
- self.mT75()
-
-
-
- elif alt35 == 52:
- # C.g:1:214: T76
- self.mT76()
-
-
-
- elif alt35 == 53:
- # C.g:1:218: T77
- self.mT77()
-
-
-
- elif alt35 == 54:
- # C.g:1:222: T78
- self.mT78()
-
-
-
- elif alt35 == 55:
- # C.g:1:226: T79
- self.mT79()
-
-
-
- elif alt35 == 56:
- # C.g:1:230: T80
- self.mT80()
-
-
-
- elif alt35 == 57:
- # C.g:1:234: T81
- self.mT81()
-
-
-
- elif alt35 == 58:
- # C.g:1:238: T82
- self.mT82()
-
-
-
- elif alt35 == 59:
- # C.g:1:242: T83
- self.mT83()
-
-
-
- elif alt35 == 60:
- # C.g:1:246: T84
- self.mT84()
-
-
-
- elif alt35 == 61:
- # C.g:1:250: T85
- self.mT85()
-
-
-
- elif alt35 == 62:
- # C.g:1:254: T86
- self.mT86()
-
-
-
- elif alt35 == 63:
- # C.g:1:258: T87
- self.mT87()
-
-
-
- elif alt35 == 64:
- # C.g:1:262: T88
- self.mT88()
-
-
-
- elif alt35 == 65:
- # C.g:1:266: T89
- self.mT89()
-
-
-
- elif alt35 == 66:
- # C.g:1:270: T90
- self.mT90()
-
-
-
- elif alt35 == 67:
- # C.g:1:274: T91
- self.mT91()
-
-
-
- elif alt35 == 68:
- # C.g:1:278: T92
- self.mT92()
-
-
-
- elif alt35 == 69:
- # C.g:1:282: T93
- self.mT93()
-
-
-
- elif alt35 == 70:
- # C.g:1:286: T94
- self.mT94()
-
-
-
- elif alt35 == 71:
- # C.g:1:290: T95
- self.mT95()
-
-
-
- elif alt35 == 72:
- # C.g:1:294: T96
- self.mT96()
-
-
-
- elif alt35 == 73:
- # C.g:1:298: T97
- self.mT97()
-
-
-
- elif alt35 == 74:
- # C.g:1:302: T98
- self.mT98()
-
-
-
- elif alt35 == 75:
- # C.g:1:306: T99
- self.mT99()
-
-
-
- elif alt35 == 76:
- # C.g:1:310: T100
- self.mT100()
-
-
-
- elif alt35 == 77:
- # C.g:1:315: T101
- self.mT101()
-
-
-
- elif alt35 == 78:
- # C.g:1:320: T102
- self.mT102()
-
-
-
- elif alt35 == 79:
- # C.g:1:325: T103
- self.mT103()
-
-
-
- elif alt35 == 80:
- # C.g:1:330: T104
- self.mT104()
-
-
-
- elif alt35 == 81:
- # C.g:1:335: T105
- self.mT105()
-
-
-
- elif alt35 == 82:
- # C.g:1:340: T106
- self.mT106()
-
-
-
- elif alt35 == 83:
- # C.g:1:345: T107
- self.mT107()
-
-
-
- elif alt35 == 84:
- # C.g:1:350: T108
- self.mT108()
-
-
-
- elif alt35 == 85:
- # C.g:1:355: T109
- self.mT109()
-
-
-
- elif alt35 == 86:
- # C.g:1:360: T110
- self.mT110()
-
-
-
- elif alt35 == 87:
- # C.g:1:365: T111
- self.mT111()
-
-
-
- elif alt35 == 88:
- # C.g:1:370: T112
- self.mT112()
-
-
-
- elif alt35 == 89:
- # C.g:1:375: T113
- self.mT113()
-
-
-
- elif alt35 == 90:
- # C.g:1:380: T114
- self.mT114()
-
-
-
- elif alt35 == 91:
- # C.g:1:385: T115
- self.mT115()
-
-
-
- elif alt35 == 92:
- # C.g:1:390: T116
- self.mT116()
-
-
-
- elif alt35 == 93:
- # C.g:1:395: T117
- self.mT117()
-
-
-
- elif alt35 == 94:
- # C.g:1:400: IDENTIFIER
- self.mIDENTIFIER()
-
-
-
- elif alt35 == 95:
- # C.g:1:411: CHARACTER_LITERAL
- self.mCHARACTER_LITERAL()
-
-
-
- elif alt35 == 96:
- # C.g:1:429: STRING_LITERAL
- self.mSTRING_LITERAL()
-
-
-
- elif alt35 == 97:
- # C.g:1:444: HEX_LITERAL
- self.mHEX_LITERAL()
-
-
-
- elif alt35 == 98:
- # C.g:1:456: DECIMAL_LITERAL
- self.mDECIMAL_LITERAL()
-
-
-
- elif alt35 == 99:
- # C.g:1:472: OCTAL_LITERAL
- self.mOCTAL_LITERAL()
-
-
-
- elif alt35 == 100:
- # C.g:1:486: FLOATING_POINT_LITERAL
- self.mFLOATING_POINT_LITERAL()
-
-
-
- elif alt35 == 101:
- # C.g:1:509: WS
- self.mWS()
-
-
-
- elif alt35 == 102:
- # C.g:1:512: BS
- self.mBS()
-
-
-
- elif alt35 == 103:
- # C.g:1:515: UnicodeVocabulary
- self.mUnicodeVocabulary()
-
-
-
- elif alt35 == 104:
- # C.g:1:533: COMMENT
- self.mCOMMENT()
-
-
-
- elif alt35 == 105:
- # C.g:1:541: LINE_COMMENT
- self.mLINE_COMMENT()
-
-
-
- elif alt35 == 106:
- # C.g:1:554: LINE_COMMAND
- self.mLINE_COMMAND()
-
-
-
-
-
-
-
-
- # lookup tables for DFA #25
-
- DFA25_eot = DFA.unpack(
- u"\7\uffff\1\10\2\uffff"
- )
-
- DFA25_eof = DFA.unpack(
- u"\12\uffff"
- )
-
- DFA25_min = DFA.unpack(
- u"\2\56\2\uffff\1\53\1\uffff\2\60\2\uffff"
- )
-
- DFA25_max = DFA.unpack(
- u"\1\71\1\146\2\uffff\1\71\1\uffff\1\71\1\146\2\uffff"
- )
-
- DFA25_accept = DFA.unpack(
- u"\2\uffff\1\2\1\1\1\uffff\1\4\2\uffff\2\3"
- )
-
- DFA25_special = DFA.unpack(
- u"\12\uffff"
- )
-
-
- DFA25_transition = [
- DFA.unpack(u"\1\2\1\uffff\12\1"),
- DFA.unpack(u"\1\3\1\uffff\12\1\12\uffff\1\5\1\4\1\5\35\uffff\1\5"
- u"\1\4\1\5"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\6\1\uffff\1\6\2\uffff\12\7"),
- DFA.unpack(u""),
- DFA.unpack(u"\12\7"),
- DFA.unpack(u"\12\7\12\uffff\1\11\1\uffff\1\11\35\uffff\1\11\1\uffff"
- u"\1\11"),
- DFA.unpack(u""),
- DFA.unpack(u"")
- ]
-
- # class definition for DFA #25
-
- DFA25 = DFA
- # lookup tables for DFA #35
-
- DFA35_eot = DFA.unpack(
- u"\2\uffff\1\76\1\uffff\1\101\14\76\3\uffff\10\76\4\uffff\1\151\1"
- u"\153\1\157\1\163\1\167\1\171\1\174\1\uffff\1\177\1\u0082\1\u0085"
- u"\1\u0087\1\u008a\1\uffff\5\76\1\uffff\2\73\2\u0095\2\uffff\1\73"
- u"\2\uffff\1\76\4\uffff\16\76\1\u00ad\5\76\1\u00b4\1\76\3\uffff\1"
- u"\u00b7\10\76\34\uffff\1\u00c1\2\uffff\1\u00c3\10\uffff\5\76\3\uffff"
- u"\1\u00c9\1\uffff\1\u0095\3\uffff\23\76\1\uffff\1\u00de\1\76\1\u00e0"
- u"\3\76\1\uffff\2\76\1\uffff\1\76\1\u00e7\6\76\4\uffff\5\76\1\uffff"
- u"\1\76\1\u00f5\1\76\1\u00f7\6\76\1\u00fe\4\76\1\u0103\1\u0104\2"
- u"\76\1\u0107\1\uffff\1\u0108\1\uffff\6\76\1\uffff\10\76\1\u0118"
- u"\1\76\1\u011a\2\76\1\uffff\1\76\1\uffff\5\76\1\u0123\1\uffff\4"
- u"\76\2\uffff\1\76\1\u0129\2\uffff\1\u012a\3\76\1\u012e\1\76\1\u0130"
- u"\7\76\1\u0139\1\uffff\1\u013a\1\uffff\1\u013b\1\76\1\u013d\1\u013e"
- u"\1\u013f\1\u0140\1\u0141\1\u0142\1\uffff\1\76\1\u0144\1\u0145\2"
- u"\76\2\uffff\1\76\1\u0149\1\76\1\uffff\1\76\1\uffff\5\76\1\u0151"
- u"\1\u0152\1\76\3\uffff\1\u0154\6\uffff\1\76\2\uffff\2\76\1\u0158"
- u"\1\uffff\7\76\2\uffff\1\u0160\1\uffff\1\u0161\1\u0162\1\u0163\1"
- u"\uffff\1\u0164\1\u0165\1\76\1\u0167\3\76\6\uffff\1\u016b\1\uffff"
- u"\3\76\1\uffff\21\76\1\u0180\2\76\1\uffff\3\76\1\u0186\1\76\1\uffff"
- u"\11\76\1\u0191\1\uffff"
- )
-
- DFA35_eof = DFA.unpack(
- u"\u0192\uffff"
- )
-
- DFA35_min = DFA.unpack(
- u"\1\3\1\uffff\1\171\1\uffff\1\75\1\154\1\150\1\165\1\145\1\124\1"
- u"\157\1\141\1\146\1\157\1\154\1\145\1\156\3\uffff\1\116\1\120\1"
- u"\117\1\116\1\117\1\114\1\106\1\101\4\uffff\1\75\1\56\1\53\1\55"
- u"\1\52\1\75\1\46\1\uffff\1\75\1\74\3\75\1\uffff\1\137\1\150\1\157"
- u"\1\162\1\42\1\uffff\2\0\2\56\2\uffff\1\0\2\uffff\1\160\4\uffff"
- u"\1\163\1\164\1\165\1\151\1\141\1\147\1\157\1\164\1\147\1\101\1"
- u"\151\1\163\1\156\1\141\1\44\1\164\1\156\1\162\1\157\1\146\1\44"
- u"\1\151\3\uffff\1\44\2\124\1\116\1\101\1\114\1\117\1\111\1\103\34"
- u"\uffff\1\75\2\uffff\1\75\10\uffff\1\141\1\163\1\151\1\164\1\145"
- u"\3\uffff\1\56\1\uffff\1\56\3\uffff\3\145\1\155\2\164\1\165\1\145"
- u"\1\156\1\162\1\157\1\151\1\165\1\124\1\141\1\144\1\145\1\163\1"
- u"\162\1\uffff\1\44\1\147\1\44\2\141\1\142\1\uffff\1\151\1\157\1"
- u"\uffff\1\111\1\44\1\123\1\114\1\101\1\102\1\101\1\113\4\uffff\1"
- u"\163\1\155\1\154\1\157\1\141\1\uffff\1\144\1\44\1\162\1\44\1\143"
- u"\1\151\1\143\1\157\1\145\1\164\1\44\1\163\1\162\1\111\1\164\2\44"
- u"\1\151\1\164\1\44\1\uffff\1\44\1\uffff\1\164\1\165\1\154\1\147"
- u"\1\156\1\117\1\uffff\1\124\1\111\1\124\1\101\1\102\1\120\1\105"
- u"\1\155\1\44\1\145\1\44\1\153\1\145\1\uffff\1\156\1\uffff\1\150"
- u"\1\143\1\164\1\146\1\144\1\44\1\uffff\1\164\1\156\1\103\1\151\2"
- u"\uffff\1\156\1\44\2\uffff\1\44\1\154\1\145\1\156\1\44\1\116\1\44"
- u"\1\107\1\111\1\114\1\125\1\117\1\111\1\104\1\44\1\uffff\1\44\1"
- u"\uffff\1\44\1\146\6\44\1\uffff\1\145\2\44\1\154\1\165\2\uffff\1"
- u"\164\1\44\1\145\1\uffff\1\101\1\uffff\1\116\1\114\1\137\1\116\1"
- u"\117\2\44\1\137\3\uffff\1\44\6\uffff\1\162\2\uffff\2\145\1\44\1"
- u"\uffff\1\144\1\114\2\105\1\122\2\124\2\uffff\1\44\1\uffff\3\44"
- u"\1\uffff\2\44\1\104\1\44\1\105\1\111\1\123\6\uffff\1\44\1\uffff"
- u"\2\115\1\105\1\uffff\1\117\1\105\1\122\1\126\1\123\1\126\2\105"
- u"\1\111\1\137\1\122\1\103\1\111\1\126\1\105\1\106\1\111\1\44\1\137"
- u"\1\103\1\uffff\1\125\1\105\1\116\1\44\1\122\1\uffff\1\105\1\106"
- u"\1\105\1\122\1\105\1\116\1\103\1\105\1\104\1\44\1\uffff"
- )
-
- DFA35_max = DFA.unpack(
- u"\1\ufffe\1\uffff\1\171\1\uffff\1\75\1\170\1\167\1\165\1\145\1\124"
- u"\2\157\1\156\3\157\1\156\3\uffff\1\116\1\125\1\117\1\116\1\117"
- u"\1\114\1\106\1\101\4\uffff\1\75\1\71\1\75\1\76\3\75\1\uffff\2\75"
- u"\1\76\1\75\1\174\1\uffff\1\141\1\150\1\157\1\162\1\47\1\uffff\2"
- u"\ufffe\1\170\1\146\2\uffff\1\ufffe\2\uffff\1\160\4\uffff\1\163"
- u"\1\164\1\165\1\151\1\162\1\172\1\157\2\164\1\101\1\154\1\163\1"
- u"\156\1\141\1\172\1\164\1\156\1\162\1\157\1\146\1\172\1\163\3\uffff"
- u"\1\172\2\124\1\116\1\101\1\114\1\117\1\111\1\103\34\uffff\1\75"
- u"\2\uffff\1\75\10\uffff\1\141\1\163\1\151\1\164\1\145\3\uffff\1"
- u"\146\1\uffff\1\146\3\uffff\3\145\1\155\2\164\1\165\1\145\1\156"
- u"\1\162\1\157\1\151\1\165\1\124\1\141\1\144\1\145\1\164\1\162\1"
- u"\uffff\1\172\1\147\1\172\2\141\1\142\1\uffff\1\151\1\157\1\uffff"
- u"\1\111\1\172\1\123\1\114\1\101\1\102\1\137\1\113\4\uffff\1\163"
- u"\1\155\1\154\1\157\1\141\1\uffff\1\144\1\172\1\162\1\172\1\143"
- u"\1\151\1\143\1\157\1\145\1\164\1\172\1\163\1\162\1\111\1\164\2"
- u"\172\1\151\1\164\1\172\1\uffff\1\172\1\uffff\1\164\1\165\1\154"
- u"\1\147\1\156\1\117\1\uffff\1\124\1\111\1\124\1\101\1\122\1\120"
- u"\1\105\1\155\1\172\1\145\1\172\1\153\1\145\1\uffff\1\156\1\uffff"
- u"\1\150\1\143\1\164\1\146\1\144\1\172\1\uffff\1\164\1\156\1\103"
- u"\1\151\2\uffff\1\156\1\172\2\uffff\1\172\1\154\1\145\1\156\1\172"
- u"\1\116\1\172\1\107\1\111\1\114\1\125\1\117\1\111\1\104\1\172\1"
- u"\uffff\1\172\1\uffff\1\172\1\146\6\172\1\uffff\1\145\2\172\1\154"
- u"\1\165\2\uffff\1\164\1\172\1\145\1\uffff\1\101\1\uffff\1\116\1"
- u"\114\1\137\1\116\1\117\2\172\1\137\3\uffff\1\172\6\uffff\1\162"
- u"\2\uffff\2\145\1\172\1\uffff\1\144\1\114\2\105\1\122\2\124\2\uffff"
- u"\1\172\1\uffff\3\172\1\uffff\2\172\1\104\1\172\1\105\1\111\1\123"
- u"\6\uffff\1\172\1\uffff\2\115\1\105\1\uffff\1\117\1\105\1\122\1"
- u"\126\1\123\1\126\2\105\1\111\1\137\1\122\1\103\1\111\1\126\1\105"
- u"\1\106\1\111\1\172\1\137\1\103\1\uffff\1\125\1\105\1\116\1\172"
- u"\1\122\1\uffff\1\105\1\106\1\105\1\122\1\105\1\116\1\103\1\105"
- u"\1\104\1\172\1\uffff"
- )
-
- DFA35_accept = DFA.unpack(
- u"\1\uffff\1\1\1\uffff\1\3\15\uffff\1\23\1\24\1\27\10\uffff\1\46"
- u"\1\47\1\50\1\51\7\uffff\1\66\5\uffff\1\102\5\uffff\1\136\4\uffff"
- u"\1\145\1\146\1\uffff\1\147\1\1\1\uffff\1\136\1\3\1\107\1\4\26\uffff"
- u"\1\23\1\24\1\27\11\uffff\1\46\1\47\1\50\1\51\1\70\1\52\1\53\1\63"
- u"\1\144\1\73\1\60\1\54\1\74\1\64\1\61\1\55\1\150\1\151\1\71\1\56"
- u"\1\72\1\57\1\77\1\104\1\65\1\66\1\110\1\67\1\uffff\1\113\1\111"
- u"\1\uffff\1\114\1\112\1\100\1\106\1\103\1\101\1\105\1\102\5\uffff"
- u"\1\140\1\137\1\141\1\uffff\1\142\1\uffff\1\145\1\146\1\152\23\uffff"
- u"\1\124\6\uffff\1\130\2\uffff\1\33\10\uffff\1\75\1\115\1\76\1\116"
- u"\5\uffff\1\143\24\uffff\1\15\1\uffff\1\131\6\uffff\1\34\15\uffff"
- u"\1\125\1\uffff\1\30\6\uffff\1\7\4\uffff\1\12\1\122\2\uffff\1\13"
- u"\1\16\17\uffff\1\120\1\uffff\1\132\10\uffff\1\14\5\uffff\1\31\1"
- u"\17\3\uffff\1\26\1\uffff\1\36\10\uffff\1\121\1\127\1\134\1\uffff"
- u"\1\5\1\126\1\6\1\25\1\62\1\21\1\uffff\1\135\1\11\3\uffff\1\20\7"
- u"\uffff\1\42\1\45\1\uffff\1\2\3\uffff\1\123\7\uffff\1\117\1\10\1"
- u"\32\1\133\1\22\1\35\1\uffff\1\40\3\uffff\1\37\24\uffff\1\43\5\uffff"
- u"\1\44\12\uffff\1\41"
- )
-
- DFA35_special = DFA.unpack(
- u"\u0192\uffff"
- )
-
-
- DFA35_transition = [
- DFA.unpack(u"\6\73\2\70\1\73\2\70\22\73\1\70\1\50\1\65\1\72\1\63"
- u"\1\45\1\46\1\64\1\34\1\35\1\40\1\42\1\3\1\43\1\41\1\44\1\66\11"
- u"\67\1\23\1\1\1\51\1\4\1\52\1\55\1\73\2\63\1\26\1\63\1\32\1\63\1"
- u"\31\1\63\1\24\2\63\1\62\2\63\1\25\1\33\2\63\1\11\1\63\1\27\1\30"
- u"\4\63\1\36\1\71\1\37\1\53\1\56\1\73\1\7\1\61\1\13\1\17\1\5\1\16"
- u"\1\60\1\63\1\14\2\63\1\15\5\63\1\10\1\6\1\2\1\20\1\12\1\57\3\63"
- u"\1\21\1\54\1\22\1\47\uff80\73"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\75"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\100"),
- DFA.unpack(u"\1\102\1\uffff\1\104\11\uffff\1\103"),
- DFA.unpack(u"\1\110\1\107\12\uffff\1\106\2\uffff\1\105"),
- DFA.unpack(u"\1\111"),
- DFA.unpack(u"\1\112"),
- DFA.unpack(u"\1\113"),
- DFA.unpack(u"\1\114"),
- DFA.unpack(u"\1\115\6\uffff\1\117\6\uffff\1\116"),
- DFA.unpack(u"\1\120\7\uffff\1\121"),
- DFA.unpack(u"\1\122"),
- DFA.unpack(u"\1\124\2\uffff\1\123"),
- DFA.unpack(u"\1\125\11\uffff\1\126"),
- DFA.unpack(u"\1\127"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\133"),
- DFA.unpack(u"\1\134\4\uffff\1\135"),
- DFA.unpack(u"\1\136"),
- DFA.unpack(u"\1\137"),
- DFA.unpack(u"\1\140"),
- DFA.unpack(u"\1\141"),
- DFA.unpack(u"\1\142"),
- DFA.unpack(u"\1\143"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\150"),
- DFA.unpack(u"\1\152\1\uffff\12\154"),
- DFA.unpack(u"\1\156\21\uffff\1\155"),
- DFA.unpack(u"\1\162\17\uffff\1\160\1\161"),
- DFA.unpack(u"\1\164\4\uffff\1\165\15\uffff\1\166"),
- DFA.unpack(u"\1\170"),
- DFA.unpack(u"\1\173\26\uffff\1\172"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\176"),
- DFA.unpack(u"\1\u0080\1\u0081"),
- DFA.unpack(u"\1\u0084\1\u0083"),
- DFA.unpack(u"\1\u0086"),
- DFA.unpack(u"\1\u0089\76\uffff\1\u0088"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u008c\1\uffff\1\u008d"),
- DFA.unpack(u"\1\u008e"),
- DFA.unpack(u"\1\u008f"),
- DFA.unpack(u"\1\u0090"),
- DFA.unpack(u"\1\u0091\4\uffff\1\u0092"),
- DFA.unpack(u""),
- DFA.unpack(u"\47\u0092\1\uffff\uffd7\u0092"),
- DFA.unpack(u"\uffff\u0091"),
- DFA.unpack(u"\1\154\1\uffff\10\u0094\2\154\12\uffff\3\154\21\uffff"
- u"\1\u0093\13\uffff\3\154\21\uffff\1\u0093"),
- DFA.unpack(u"\1\154\1\uffff\12\u0096\12\uffff\3\154\35\uffff\3\154"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\uffff\u0099"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u009a"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u009b"),
- DFA.unpack(u"\1\u009c"),
- DFA.unpack(u"\1\u009d"),
- DFA.unpack(u"\1\u009e"),
- DFA.unpack(u"\1\u009f\20\uffff\1\u00a0"),
- DFA.unpack(u"\1\u00a2\22\uffff\1\u00a1"),
- DFA.unpack(u"\1\u00a3"),
- DFA.unpack(u"\1\u00a4"),
- DFA.unpack(u"\1\u00a5\14\uffff\1\u00a6"),
- DFA.unpack(u"\1\u00a7"),
- DFA.unpack(u"\1\u00a9\2\uffff\1\u00a8"),
- DFA.unpack(u"\1\u00aa"),
- DFA.unpack(u"\1\u00ab"),
- DFA.unpack(u"\1\u00ac"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00ae"),
- DFA.unpack(u"\1\u00af"),
- DFA.unpack(u"\1\u00b0"),
- DFA.unpack(u"\1\u00b1"),
- DFA.unpack(u"\1\u00b2"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\24\76\1\u00b3\5\76"),
- DFA.unpack(u"\1\u00b6\11\uffff\1\u00b5"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00b8"),
- DFA.unpack(u"\1\u00b9"),
- DFA.unpack(u"\1\u00ba"),
- DFA.unpack(u"\1\u00bb"),
- DFA.unpack(u"\1\u00bc"),
- DFA.unpack(u"\1\u00bd"),
- DFA.unpack(u"\1\u00be"),
- DFA.unpack(u"\1\u00bf"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00c0"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00c2"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00c4"),
- DFA.unpack(u"\1\u00c5"),
- DFA.unpack(u"\1\u00c6"),
- DFA.unpack(u"\1\u00c7"),
- DFA.unpack(u"\1\u00c8"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\154\1\uffff\10\u0094\2\154\12\uffff\3\154\35\uffff"
- u"\3\154"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\154\1\uffff\12\u0096\12\uffff\3\154\35\uffff\3\154"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00ca"),
- DFA.unpack(u"\1\u00cb"),
- DFA.unpack(u"\1\u00cc"),
- DFA.unpack(u"\1\u00cd"),
- DFA.unpack(u"\1\u00ce"),
- DFA.unpack(u"\1\u00cf"),
- DFA.unpack(u"\1\u00d0"),
- DFA.unpack(u"\1\u00d1"),
- DFA.unpack(u"\1\u00d2"),
- DFA.unpack(u"\1\u00d3"),
- DFA.unpack(u"\1\u00d4"),
- DFA.unpack(u"\1\u00d5"),
- DFA.unpack(u"\1\u00d6"),
- DFA.unpack(u"\1\u00d7"),
- DFA.unpack(u"\1\u00d8"),
- DFA.unpack(u"\1\u00d9"),
- DFA.unpack(u"\1\u00da"),
- DFA.unpack(u"\1\u00dc\1\u00db"),
- DFA.unpack(u"\1\u00dd"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00df"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00e1"),
- DFA.unpack(u"\1\u00e2"),
- DFA.unpack(u"\1\u00e3"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00e4"),
- DFA.unpack(u"\1\u00e5"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00e6"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00e8"),
- DFA.unpack(u"\1\u00e9"),
- DFA.unpack(u"\1\u00ea"),
- DFA.unpack(u"\1\u00eb"),
- DFA.unpack(u"\1\u00ed\35\uffff\1\u00ec"),
- DFA.unpack(u"\1\u00ee"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00ef"),
- DFA.unpack(u"\1\u00f0"),
- DFA.unpack(u"\1\u00f1"),
- DFA.unpack(u"\1\u00f2"),
- DFA.unpack(u"\1\u00f3"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00f4"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00f6"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00f8"),
- DFA.unpack(u"\1\u00f9"),
- DFA.unpack(u"\1\u00fa"),
- DFA.unpack(u"\1\u00fb"),
- DFA.unpack(u"\1\u00fc"),
- DFA.unpack(u"\1\u00fd"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00ff"),
- DFA.unpack(u"\1\u0100"),
- DFA.unpack(u"\1\u0101"),
- DFA.unpack(u"\1\u0102"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0105"),
- DFA.unpack(u"\1\u0106"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0109"),
- DFA.unpack(u"\1\u010a"),
- DFA.unpack(u"\1\u010b"),
- DFA.unpack(u"\1\u010c"),
- DFA.unpack(u"\1\u010d"),
- DFA.unpack(u"\1\u010e"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u010f"),
- DFA.unpack(u"\1\u0110"),
- DFA.unpack(u"\1\u0111"),
- DFA.unpack(u"\1\u0112"),
- DFA.unpack(u"\1\u0114\17\uffff\1\u0113"),
- DFA.unpack(u"\1\u0115"),
- DFA.unpack(u"\1\u0116"),
- DFA.unpack(u"\1\u0117"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0119"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u011b"),
- DFA.unpack(u"\1\u011c"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u011d"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u011e"),
- DFA.unpack(u"\1\u011f"),
- DFA.unpack(u"\1\u0120"),
- DFA.unpack(u"\1\u0121"),
- DFA.unpack(u"\1\u0122"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0124"),
- DFA.unpack(u"\1\u0125"),
- DFA.unpack(u"\1\u0126"),
- DFA.unpack(u"\1\u0127"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0128"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u012b"),
- DFA.unpack(u"\1\u012c"),
- DFA.unpack(u"\1\u012d"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u012f"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0131"),
- DFA.unpack(u"\1\u0132"),
- DFA.unpack(u"\1\u0133"),
- DFA.unpack(u"\1\u0134"),
- DFA.unpack(u"\1\u0135"),
- DFA.unpack(u"\1\u0136"),
- DFA.unpack(u"\1\u0137"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\u0138\1"
- u"\uffff\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u013c"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0143"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0146"),
- DFA.unpack(u"\1\u0147"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0148"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u014a"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u014b"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u014c"),
- DFA.unpack(u"\1\u014d"),
- DFA.unpack(u"\1\u014e"),
- DFA.unpack(u"\1\u014f"),
- DFA.unpack(u"\1\u0150"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0153"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0155"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0156"),
- DFA.unpack(u"\1\u0157"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0159"),
- DFA.unpack(u"\1\u015a"),
- DFA.unpack(u"\1\u015b"),
- DFA.unpack(u"\1\u015c"),
- DFA.unpack(u"\1\u015d"),
- DFA.unpack(u"\1\u015e"),
- DFA.unpack(u"\1\u015f"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0166"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0168"),
- DFA.unpack(u"\1\u0169"),
- DFA.unpack(u"\1\u016a"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u016c"),
- DFA.unpack(u"\1\u016d"),
- DFA.unpack(u"\1\u016e"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u016f"),
- DFA.unpack(u"\1\u0170"),
- DFA.unpack(u"\1\u0171"),
- DFA.unpack(u"\1\u0172"),
- DFA.unpack(u"\1\u0173"),
- DFA.unpack(u"\1\u0174"),
- DFA.unpack(u"\1\u0175"),
- DFA.unpack(u"\1\u0176"),
- DFA.unpack(u"\1\u0177"),
- DFA.unpack(u"\1\u0178"),
- DFA.unpack(u"\1\u0179"),
- DFA.unpack(u"\1\u017a"),
- DFA.unpack(u"\1\u017b"),
- DFA.unpack(u"\1\u017c"),
- DFA.unpack(u"\1\u017d"),
- DFA.unpack(u"\1\u017e"),
- DFA.unpack(u"\1\u017f"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0181"),
- DFA.unpack(u"\1\u0182"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0183"),
- DFA.unpack(u"\1\u0184"),
- DFA.unpack(u"\1\u0185"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0187"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0188"),
- DFA.unpack(u"\1\u0189"),
- DFA.unpack(u"\1\u018a"),
- DFA.unpack(u"\1\u018b"),
- DFA.unpack(u"\1\u018c"),
- DFA.unpack(u"\1\u018d"),
- DFA.unpack(u"\1\u018e"),
- DFA.unpack(u"\1\u018f"),
- DFA.unpack(u"\1\u0190"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"")
- ]
-
- # class definition for DFA #35
-
- DFA35 = DFA
-
-
diff --git a/BaseTools/Source/Python/Ecc/CParser.py b/BaseTools/Source/Python/Ecc/CParser.py
deleted file mode 100644
index 511d429f26..0000000000
--- a/BaseTools/Source/Python/Ecc/CParser.py
+++ /dev/null
@@ -1,18844 +0,0 @@
-# $ANTLR 3.0.1 C.g 2010-02-23 09:58:53
-
-from antlr3 import *
-from antlr3.compat import set, frozenset
-
-## @file
-# The file defines the parser for C source files.
-#
-# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
-# This file is generated by running:
-# java org.antlr.Tool C.g
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at:
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-import CodeFragment
-import FileProfile
-
-
-
-# for convenience in actions
-HIDDEN = BaseRecognizer.HIDDEN
-
-# token types
-BS=20
-LINE_COMMENT=23
-FloatTypeSuffix=16
-IntegerTypeSuffix=14
-LETTER=11
-OCTAL_LITERAL=6
-CHARACTER_LITERAL=8
-Exponent=15
-EOF=-1
-HexDigit=13
-STRING_LITERAL=9
-WS=19
-FLOATING_POINT_LITERAL=10
-IDENTIFIER=4
-UnicodeEscape=18
-LINE_COMMAND=24
-UnicodeVocabulary=21
-HEX_LITERAL=5
-COMMENT=22
-DECIMAL_LITERAL=7
-EscapeSequence=12
-OctalEscape=17
-
-# token names
-tokenNames = [
- "<invalid>", "<EOR>", "<DOWN>", "<UP>",
- "IDENTIFIER", "HEX_LITERAL", "OCTAL_LITERAL", "DECIMAL_LITERAL", "CHARACTER_LITERAL",
- "STRING_LITERAL", "FLOATING_POINT_LITERAL", "LETTER", "EscapeSequence",
- "HexDigit", "IntegerTypeSuffix", "Exponent", "FloatTypeSuffix", "OctalEscape",
- "UnicodeEscape", "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COMMENT",
- "LINE_COMMAND", "';'", "'typedef'", "','", "'='", "'extern'", "'static'",
- "'auto'", "'register'", "'STATIC'", "'void'", "'char'", "'short'", "'int'",
- "'long'", "'float'", "'double'", "'signed'", "'unsigned'", "'{'", "'}'",
- "'struct'", "'union'", "':'", "'enum'", "'const'", "'volatile'", "'IN'",
- "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'", "'VOLATILE'", "'GLOBAL_REMOVE_IF_UNREFERENCED'",
- "'EFIAPI'", "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED'",
- "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'", "'-'", "'/'", "'%'",
- "'++'", "'--'", "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*='",
- "'/='", "'%='", "'+='", "'-='", "'<<='", "'>>='", "'&='", "'^='", "'|='",
- "'?'", "'||'", "'&&'", "'|'", "'^'", "'=='", "'!='", "'<'", "'>'", "'<='",
- "'>='", "'<<'", "'>>'", "'__asm__'", "'_asm'", "'__asm'", "'case'",
- "'default'", "'if'", "'else'", "'switch'", "'while'", "'do'", "'for'",
- "'goto'", "'continue'", "'break'", "'return'"
-]
-
-
-class function_definition_scope(object):
- def __init__(self):
- self.ModifierText = None
- self.DeclText = None
- self.LBLine = None
- self.LBOffset = None
- self.DeclLine = None
- self.DeclOffset = None
-class postfix_expression_scope(object):
- def __init__(self):
- self.FuncCallText = None
-
-
-class CParser(Parser):
- grammarFileName = "C.g"
- tokenNames = tokenNames
-
- def __init__(self, input):
- Parser.__init__(self, input)
- self.ruleMemo = {}
-
- self.function_definition_stack = []
- self.postfix_expression_stack = []
-
-
-
-
-
-
-
-
- def printTokenInfo(self, line, offset, tokenText):
- print str(line)+ ',' + str(offset) + ':' + str(tokenText)
-
- def StorePredicateExpression(self, StartLine, StartOffset, EndLine, EndOffset, Text):
- PredExp = CodeFragment.PredicateExpression(Text, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.PredicateExpressionList.append(PredExp)
-
- def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):
- EnumDef = CodeFragment.EnumerationDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.EnumerationDefinitionList.append(EnumDef)
-
- def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):
- SUDef = CodeFragment.StructUnionDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.StructUnionDefinitionList.append(SUDef)
-
- def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndOffset, FromText, ToText):
- Tdef = CodeFragment.TypedefDefinition(FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.TypedefDefinitionList.append(Tdef)
-
- def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, DeclOffset):
- FuncDef = CodeFragment.FunctionDefinition(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLine, DeclOffset))
- FileProfile.FunctionDefinitionList.append(FuncDef)
-
- def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText):
- VarDecl = CodeFragment.VariableDeclaration(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.VariableDeclarationList.append(VarDecl)
-
- def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOffset, FuncName, ParamList):
- FuncCall = CodeFragment.FunctionCalling(FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.FunctionCallingList.append(FuncCall)
-
-
-
-
- # $ANTLR start translation_unit
- # C.g:102:1: translation_unit : ( external_declaration )* ;
- def translation_unit(self, ):
-
- translation_unit_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 1):
- return
-
- # C.g:103:2: ( ( external_declaration )* )
- # C.g:103:4: ( external_declaration )*
- # C.g:103:4: ( external_declaration )*
- while True: #loop1
- alt1 = 2
- LA1_0 = self.input.LA(1)
-
- if (LA1_0 == IDENTIFIER or LA1_0 == 26 or (29 <= LA1_0 <= 42) or (45 <= LA1_0 <= 46) or (48 <= LA1_0 <= 62) or LA1_0 == 66) :
- alt1 = 1
-
-
- if alt1 == 1:
- # C.g:0:0: external_declaration
- self.following.append(self.FOLLOW_external_declaration_in_translation_unit74)
- self.external_declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop1
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 1, translation_unit_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end translation_unit
-
-
- # $ANTLR start external_declaration
- # C.g:114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );
- def external_declaration(self, ):
-
- external_declaration_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 2):
- return
-
- # C.g:119:2: ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? )
- alt3 = 3
- LA3_0 = self.input.LA(1)
-
- if ((29 <= LA3_0 <= 33)) :
- LA3_1 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 1, self.input)
-
- raise nvae
-
- elif (LA3_0 == 34) :
- LA3_2 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 2, self.input)
-
- raise nvae
-
- elif (LA3_0 == 35) :
- LA3_3 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 3, self.input)
-
- raise nvae
-
- elif (LA3_0 == 36) :
- LA3_4 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 4, self.input)
-
- raise nvae
-
- elif (LA3_0 == 37) :
- LA3_5 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 5, self.input)
-
- raise nvae
-
- elif (LA3_0 == 38) :
- LA3_6 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 6, self.input)
-
- raise nvae
-
- elif (LA3_0 == 39) :
- LA3_7 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 7, self.input)
-
- raise nvae
-
- elif (LA3_0 == 40) :
- LA3_8 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 8, self.input)
-
- raise nvae
-
- elif (LA3_0 == 41) :
- LA3_9 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 9, self.input)
-
- raise nvae
-
- elif (LA3_0 == 42) :
- LA3_10 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 10, self.input)
-
- raise nvae
-
- elif ((45 <= LA3_0 <= 46)) :
- LA3_11 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 11, self.input)
-
- raise nvae
-
- elif (LA3_0 == 48) :
- LA3_12 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 12, self.input)
-
- raise nvae
-
- elif (LA3_0 == IDENTIFIER) :
- LA3_13 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- elif (True) :
- alt3 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 13, self.input)
-
- raise nvae
-
- elif (LA3_0 == 58) :
- LA3_14 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 14, self.input)
-
- raise nvae
-
- elif (LA3_0 == 66) and (self.synpred4()):
- alt3 = 1
- elif (LA3_0 == 59) :
- LA3_16 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 16, self.input)
-
- raise nvae
-
- elif (LA3_0 == 60) :
- LA3_17 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 17, self.input)
-
- raise nvae
-
- elif ((49 <= LA3_0 <= 57) or LA3_0 == 61) :
- LA3_18 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 18, self.input)
-
- raise nvae
-
- elif (LA3_0 == 62) and (self.synpred4()):
- alt3 = 1
- elif (LA3_0 == 26) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 0, self.input)
-
- raise nvae
-
- if alt3 == 1:
- # C.g:119:4: ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition
- self.following.append(self.FOLLOW_function_definition_in_external_declaration113)
- self.function_definition()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt3 == 2:
- # C.g:120:4: declaration
- self.following.append(self.FOLLOW_declaration_in_external_declaration118)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt3 == 3:
- # C.g:121:4: macro_statement ( ';' )?
- self.following.append(self.FOLLOW_macro_statement_in_external_declaration123)
- self.macro_statement()
- self.following.pop()
- if self.failed:
- return
- # C.g:121:20: ( ';' )?
- alt2 = 2
- LA2_0 = self.input.LA(1)
-
- if (LA2_0 == 25) :
- alt2 = 1
- if alt2 == 1:
- # C.g:121:21: ';'
- self.match(self.input, 25, self.FOLLOW_25_in_external_declaration126)
- if self.failed:
- return
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 2, external_declaration_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end external_declaration
-
- class function_definition_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start function_definition
- # C.g:126:1: function_definition : (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement ) ;
- def function_definition(self, ):
- self.function_definition_stack.append(function_definition_scope())
- retval = self.function_definition_return()
- retval.start = self.input.LT(1)
- function_definition_StartIndex = self.input.index()
- d = None
-
- a = None
-
- b = None
-
- declarator1 = None
-
-
-
- self.function_definition_stack[-1].ModifierText = ''
- self.function_definition_stack[-1].DeclText = ''
- self.function_definition_stack[-1].LBLine = 0
- self.function_definition_stack[-1].LBOffset = 0
- self.function_definition_stack[-1].DeclLine = 0
- self.function_definition_stack[-1].DeclOffset = 0
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 3):
- return retval
-
- # C.g:146:2: ( (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement ) )
- # C.g:146:4: (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement )
- # C.g:146:5: (d= declaration_specifiers )?
- alt4 = 2
- LA4 = self.input.LA(1)
- if LA4 == 29 or LA4 == 30 or LA4 == 31 or LA4 == 32 or LA4 == 33 or LA4 == 34 or LA4 == 35 or LA4 == 36 or LA4 == 37 or LA4 == 38 or LA4 == 39 or LA4 == 40 or LA4 == 41 or LA4 == 42 or LA4 == 45 or LA4 == 46 or LA4 == 48 or LA4 == 49 or LA4 == 50 or LA4 == 51 or LA4 == 52 or LA4 == 53 or LA4 == 54 or LA4 == 55 or LA4 == 56 or LA4 == 57 or LA4 == 61:
- alt4 = 1
- elif LA4 == IDENTIFIER:
- LA4 = self.input.LA(2)
- if LA4 == 66:
- alt4 = 1
- elif LA4 == 58:
- LA4_21 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 59:
- LA4_22 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 60:
- LA4_23 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == IDENTIFIER:
- LA4_24 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 62:
- LA4_25 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 29 or LA4 == 30 or LA4 == 31 or LA4 == 32 or LA4 == 33:
- LA4_26 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 34:
- LA4_27 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 35:
- LA4_28 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 36:
- LA4_29 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 37:
- LA4_30 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 38:
- LA4_31 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 39:
- LA4_32 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 40:
- LA4_33 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 41:
- LA4_34 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 42:
- LA4_35 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 45 or LA4 == 46:
- LA4_36 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 48:
- LA4_37 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 49 or LA4 == 50 or LA4 == 51 or LA4 == 52 or LA4 == 53 or LA4 == 54 or LA4 == 55 or LA4 == 56 or LA4 == 57 or LA4 == 61:
- LA4_38 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 58:
- LA4_14 = self.input.LA(2)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 59:
- LA4_16 = self.input.LA(2)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 60:
- LA4_17 = self.input.LA(2)
-
- if (self.synpred7()) :
- alt4 = 1
- if alt4 == 1:
- # C.g:0:0: d= declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_function_definition157)
- d = self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return retval
-
-
-
- self.following.append(self.FOLLOW_declarator_in_function_definition160)
- declarator1 = self.declarator()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:147:3: ( ( declaration )+ a= compound_statement | b= compound_statement )
- alt6 = 2
- LA6_0 = self.input.LA(1)
-
- if (LA6_0 == IDENTIFIER or LA6_0 == 26 or (29 <= LA6_0 <= 42) or (45 <= LA6_0 <= 46) or (48 <= LA6_0 <= 61)) :
- alt6 = 1
- elif (LA6_0 == 43) :
- alt6 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("147:3: ( ( declaration )+ a= compound_statement | b= compound_statement )", 6, 0, self.input)
-
- raise nvae
-
- if alt6 == 1:
- # C.g:147:5: ( declaration )+ a= compound_statement
- # C.g:147:5: ( declaration )+
- cnt5 = 0
- while True: #loop5
- alt5 = 2
- LA5_0 = self.input.LA(1)
-
- if (LA5_0 == IDENTIFIER or LA5_0 == 26 or (29 <= LA5_0 <= 42) or (45 <= LA5_0 <= 46) or (48 <= LA5_0 <= 61)) :
- alt5 = 1
-
-
- if alt5 == 1:
- # C.g:0:0: declaration
- self.following.append(self.FOLLOW_declaration_in_function_definition166)
- self.declaration()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- if cnt5 >= 1:
- break #loop5
-
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- eee = EarlyExitException(5, self.input)
- raise eee
-
- cnt5 += 1
-
-
- self.following.append(self.FOLLOW_compound_statement_in_function_definition171)
- a = self.compound_statement()
- self.following.pop()
- if self.failed:
- return retval
-
-
- elif alt6 == 2:
- # C.g:148:5: b= compound_statement
- self.following.append(self.FOLLOW_compound_statement_in_function_definition180)
- b = self.compound_statement()
- self.following.pop()
- if self.failed:
- return retval
-
-
-
- if self.backtracking == 0:
-
- if d != None:
- self.function_definition_stack[-1].ModifierText = self.input.toString(d.start,d.stop)
- else:
- self.function_definition_stack[-1].ModifierText = ''
- self.function_definition_stack[-1].DeclText = self.input.toString(declarator1.start,declarator1.stop)
- self.function_definition_stack[-1].DeclLine = declarator1.start.line
- self.function_definition_stack[-1].DeclOffset = declarator1.start.charPositionInLine
- if a != None:
- self.function_definition_stack[-1].LBLine = a.start.line
- self.function_definition_stack[-1].LBOffset = a.start.charPositionInLine
- else:
- self.function_definition_stack[-1].LBLine = b.start.line
- self.function_definition_stack[-1].LBOffset = b.start.charPositionInLine
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
- if self.backtracking == 0:
-
- self.StoreFunctionDefinition(retval.start.line, retval.start.charPositionInLine, retval.stop.line, retval.stop.charPositionInLine, self.function_definition_stack[-1].ModifierText, self.function_definition_stack[-1].DeclText, self.function_definition_stack[-1].LBLine, self.function_definition_stack[-1].LBOffset, self.function_definition_stack[-1].DeclLine, self.function_definition_stack[-1].DeclOffset)
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 3, function_definition_StartIndex)
-
- self.function_definition_stack.pop()
- pass
-
- return retval
-
- # $ANTLR end function_definition
-
-
- # $ANTLR start declaration
- # C.g:166:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );
- def declaration(self, ):
-
- declaration_StartIndex = self.input.index()
- a = None
- d = None
- e = None
- b = None
-
- c = None
-
- s = None
-
- t = None
-
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 4):
- return
-
- # C.g:167:2: (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' )
- alt9 = 2
- LA9_0 = self.input.LA(1)
-
- if (LA9_0 == 26) :
- alt9 = 1
- elif (LA9_0 == IDENTIFIER or (29 <= LA9_0 <= 42) or (45 <= LA9_0 <= 46) or (48 <= LA9_0 <= 61)) :
- alt9 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("166:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );", 9, 0, self.input)
-
- raise nvae
-
- if alt9 == 1:
- # C.g:167:4: a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';'
- a = self.input.LT(1)
- self.match(self.input, 26, self.FOLLOW_26_in_declaration203)
- if self.failed:
- return
- # C.g:167:17: (b= declaration_specifiers )?
- alt7 = 2
- LA7 = self.input.LA(1)
- if LA7 == 29 or LA7 == 30 or LA7 == 31 or LA7 == 32 or LA7 == 33 or LA7 == 34 or LA7 == 35 or LA7 == 36 or LA7 == 37 or LA7 == 38 or LA7 == 39 or LA7 == 40 or LA7 == 41 or LA7 == 42 or LA7 == 45 or LA7 == 46 or LA7 == 48 or LA7 == 49 or LA7 == 50 or LA7 == 51 or LA7 == 52 or LA7 == 53 or LA7 == 54 or LA7 == 55 or LA7 == 56 or LA7 == 57 or LA7 == 61:
- alt7 = 1
- elif LA7 == IDENTIFIER:
- LA7_13 = self.input.LA(2)
-
- if (LA7_13 == 62) :
- LA7_21 = self.input.LA(3)
-
- if (self.synpred10()) :
- alt7 = 1
- elif (LA7_13 == IDENTIFIER or (29 <= LA7_13 <= 42) or (45 <= LA7_13 <= 46) or (48 <= LA7_13 <= 61) or LA7_13 == 66) :
- alt7 = 1
- elif LA7 == 58:
- LA7_14 = self.input.LA(2)
-
- if (self.synpred10()) :
- alt7 = 1
- elif LA7 == 59:
- LA7_16 = self.input.LA(2)
-
- if (self.synpred10()) :
- alt7 = 1
- elif LA7 == 60:
- LA7_17 = self.input.LA(2)
-
- if (self.synpred10()) :
- alt7 = 1
- if alt7 == 1:
- # C.g:0:0: b= declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_declaration207)
- b = self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_init_declarator_list_in_declaration216)
- c = self.init_declarator_list()
- self.following.pop()
- if self.failed:
- return
- d = self.input.LT(1)
- self.match(self.input, 25, self.FOLLOW_25_in_declaration220)
- if self.failed:
- return
- if self.backtracking == 0:
-
- if b != None:
- self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, self.input.toString(b.start,b.stop), self.input.toString(c.start,c.stop))
- else:
- self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start,c.stop))
-
-
-
-
- elif alt9 == 2:
- # C.g:175:4: s= declaration_specifiers (t= init_declarator_list )? e= ';'
- self.following.append(self.FOLLOW_declaration_specifiers_in_declaration234)
- s = self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
- # C.g:175:30: (t= init_declarator_list )?
- alt8 = 2
- LA8_0 = self.input.LA(1)
-
- if (LA8_0 == IDENTIFIER or (58 <= LA8_0 <= 60) or LA8_0 == 62 or LA8_0 == 66) :
- alt8 = 1
- if alt8 == 1:
- # C.g:0:0: t= init_declarator_list
- self.following.append(self.FOLLOW_init_declarator_list_in_declaration238)
- t = self.init_declarator_list()
- self.following.pop()
- if self.failed:
- return
-
-
-
- e = self.input.LT(1)
- self.match(self.input, 25, self.FOLLOW_25_in_declaration243)
- if self.failed:
- return
- if self.backtracking == 0:
-
- if t != None:
- self.StoreVariableDeclaration(s.start.line, s.start.charPositionInLine, t.start.line, t.start.charPositionInLine, self.input.toString(s.start,s.stop), self.input.toString(t.start,t.stop))
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 4, declaration_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end declaration
-
- class declaration_specifiers_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start declaration_specifiers
- # C.g:182:1: declaration_specifiers : ( storage_class_specifier | type_specifier | type_qualifier )+ ;
- def declaration_specifiers(self, ):
-
- retval = self.declaration_specifiers_return()
- retval.start = self.input.LT(1)
- declaration_specifiers_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 5):
- return retval
-
- # C.g:183:2: ( ( storage_class_specifier | type_specifier | type_qualifier )+ )
- # C.g:183:6: ( storage_class_specifier | type_specifier | type_qualifier )+
- # C.g:183:6: ( storage_class_specifier | type_specifier | type_qualifier )+
- cnt10 = 0
- while True: #loop10
- alt10 = 4
- LA10 = self.input.LA(1)
- if LA10 == 58:
- LA10_2 = self.input.LA(2)
-
- if (self.synpred15()) :
- alt10 = 3
-
-
- elif LA10 == 59:
- LA10_3 = self.input.LA(2)
-
- if (self.synpred15()) :
- alt10 = 3
-
-
- elif LA10 == 60:
- LA10_4 = self.input.LA(2)
-
- if (self.synpred15()) :
- alt10 = 3
-
-
- elif LA10 == IDENTIFIER:
- LA10_5 = self.input.LA(2)
-
- if (self.synpred14()) :
- alt10 = 2
-
-
- elif LA10 == 53:
- LA10_9 = self.input.LA(2)
-
- if (self.synpred15()) :
- alt10 = 3
-
-
- elif LA10 == 29 or LA10 == 30 or LA10 == 31 or LA10 == 32 or LA10 == 33:
- alt10 = 1
- elif LA10 == 34 or LA10 == 35 or LA10 == 36 or LA10 == 37 or LA10 == 38 or LA10 == 39 or LA10 == 40 or LA10 == 41 or LA10 == 42 or LA10 == 45 or LA10 == 46 or LA10 == 48:
- alt10 = 2
- elif LA10 == 49 or LA10 == 50 or LA10 == 51 or LA10 == 52 or LA10 == 54 or LA10 == 55 or LA10 == 56 or LA10 == 57 or LA10 == 61:
- alt10 = 3
-
- if alt10 == 1:
- # C.g:183:10: storage_class_specifier
- self.following.append(self.FOLLOW_storage_class_specifier_in_declaration_specifiers264)
- self.storage_class_specifier()
- self.following.pop()
- if self.failed:
- return retval
-
-
- elif alt10 == 2:
- # C.g:184:7: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_declaration_specifiers272)
- self.type_specifier()
- self.following.pop()
- if self.failed:
- return retval
-
-
- elif alt10 == 3:
- # C.g:185:13: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_declaration_specifiers286)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- if cnt10 >= 1:
- break #loop10
-
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- eee = EarlyExitException(10, self.input)
- raise eee
-
- cnt10 += 1
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 5, declaration_specifiers_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end declaration_specifiers
-
- class init_declarator_list_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start init_declarator_list
- # C.g:189:1: init_declarator_list : init_declarator ( ',' init_declarator )* ;
- def init_declarator_list(self, ):
-
- retval = self.init_declarator_list_return()
- retval.start = self.input.LT(1)
- init_declarator_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 6):
- return retval
-
- # C.g:190:2: ( init_declarator ( ',' init_declarator )* )
- # C.g:190:4: init_declarator ( ',' init_declarator )*
- self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list308)
- self.init_declarator()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:190:20: ( ',' init_declarator )*
- while True: #loop11
- alt11 = 2
- LA11_0 = self.input.LA(1)
-
- if (LA11_0 == 27) :
- alt11 = 1
-
-
- if alt11 == 1:
- # C.g:190:21: ',' init_declarator
- self.match(self.input, 27, self.FOLLOW_27_in_init_declarator_list311)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list313)
- self.init_declarator()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- break #loop11
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 6, init_declarator_list_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end init_declarator_list
-
-
- # $ANTLR start init_declarator
- # C.g:193:1: init_declarator : declarator ( '=' initializer )? ;
- def init_declarator(self, ):
-
- init_declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 7):
- return
-
- # C.g:194:2: ( declarator ( '=' initializer )? )
- # C.g:194:4: declarator ( '=' initializer )?
- self.following.append(self.FOLLOW_declarator_in_init_declarator326)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
- # C.g:194:15: ( '=' initializer )?
- alt12 = 2
- LA12_0 = self.input.LA(1)
-
- if (LA12_0 == 28) :
- alt12 = 1
- if alt12 == 1:
- # C.g:194:16: '=' initializer
- self.match(self.input, 28, self.FOLLOW_28_in_init_declarator329)
- if self.failed:
- return
- self.following.append(self.FOLLOW_initializer_in_init_declarator331)
- self.initializer()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 7, init_declarator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end init_declarator
-
-
- # $ANTLR start storage_class_specifier
- # C.g:197:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' | 'register' | 'STATIC' );
- def storage_class_specifier(self, ):
-
- storage_class_specifier_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 8):
- return
-
- # C.g:198:2: ( 'extern' | 'static' | 'auto' | 'register' | 'STATIC' )
- # C.g:
- if (29 <= self.input.LA(1) <= 33):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_storage_class_specifier0
- )
- raise mse
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 8, storage_class_specifier_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end storage_class_specifier
-
-
- # $ANTLR start type_specifier
- # C.g:205:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id );
- def type_specifier(self, ):
-
- type_specifier_StartIndex = self.input.index()
- s = None
-
- e = None
-
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 9):
- return
-
- # C.g:206:2: ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id )
- alt13 = 12
- LA13_0 = self.input.LA(1)
-
- if (LA13_0 == 34) :
- alt13 = 1
- elif (LA13_0 == 35) :
- alt13 = 2
- elif (LA13_0 == 36) :
- alt13 = 3
- elif (LA13_0 == 37) :
- alt13 = 4
- elif (LA13_0 == 38) :
- alt13 = 5
- elif (LA13_0 == 39) :
- alt13 = 6
- elif (LA13_0 == 40) :
- alt13 = 7
- elif (LA13_0 == 41) :
- alt13 = 8
- elif (LA13_0 == 42) :
- alt13 = 9
- elif ((45 <= LA13_0 <= 46)) :
- alt13 = 10
- elif (LA13_0 == 48) :
- alt13 = 11
- elif (LA13_0 == IDENTIFIER) and (self.synpred34()):
- alt13 = 12
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("205:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id );", 13, 0, self.input)
-
- raise nvae
-
- if alt13 == 1:
- # C.g:206:4: 'void'
- self.match(self.input, 34, self.FOLLOW_34_in_type_specifier376)
- if self.failed:
- return
-
-
- elif alt13 == 2:
- # C.g:207:4: 'char'
- self.match(self.input, 35, self.FOLLOW_35_in_type_specifier381)
- if self.failed:
- return
-
-
- elif alt13 == 3:
- # C.g:208:4: 'short'
- self.match(self.input, 36, self.FOLLOW_36_in_type_specifier386)
- if self.failed:
- return
-
-
- elif alt13 == 4:
- # C.g:209:4: 'int'
- self.match(self.input, 37, self.FOLLOW_37_in_type_specifier391)
- if self.failed:
- return
-
-
- elif alt13 == 5:
- # C.g:210:4: 'long'
- self.match(self.input, 38, self.FOLLOW_38_in_type_specifier396)
- if self.failed:
- return
-
-
- elif alt13 == 6:
- # C.g:211:4: 'float'
- self.match(self.input, 39, self.FOLLOW_39_in_type_specifier401)
- if self.failed:
- return
-
-
- elif alt13 == 7:
- # C.g:212:4: 'double'
- self.match(self.input, 40, self.FOLLOW_40_in_type_specifier406)
- if self.failed:
- return
-
-
- elif alt13 == 8:
- # C.g:213:4: 'signed'
- self.match(self.input, 41, self.FOLLOW_41_in_type_specifier411)
- if self.failed:
- return
-
-
- elif alt13 == 9:
- # C.g:214:4: 'unsigned'
- self.match(self.input, 42, self.FOLLOW_42_in_type_specifier416)
- if self.failed:
- return
-
-
- elif alt13 == 10:
- # C.g:215:4: s= struct_or_union_specifier
- self.following.append(self.FOLLOW_struct_or_union_specifier_in_type_specifier423)
- s = self.struct_or_union_specifier()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
-
- if s.stop != None:
- self.StoreStructUnionDefinition(s.start.line, s.start.charPositionInLine, s.stop.line, s.stop.charPositionInLine, self.input.toString(s.start,s.stop))
-
-
-
-
- elif alt13 == 11:
- # C.g:220:4: e= enum_specifier
- self.following.append(self.FOLLOW_enum_specifier_in_type_specifier433)
- e = self.enum_specifier()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
-
- if e.stop != None:
- self.StoreEnumerationDefinition(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
-
-
-
- elif alt13 == 12:
- # C.g:225:4: ( IDENTIFIER ( type_qualifier )* declarator )=> type_id
- self.following.append(self.FOLLOW_type_id_in_type_specifier451)
- self.type_id()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 9, type_specifier_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end type_specifier
-
-
- # $ANTLR start type_id
- # C.g:228:1: type_id : IDENTIFIER ;
- def type_id(self, ):
-
- type_id_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 10):
- return
-
- # C.g:229:5: ( IDENTIFIER )
- # C.g:229:9: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_type_id467)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 10, type_id_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end type_id
-
- class struct_or_union_specifier_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start struct_or_union_specifier
- # C.g:233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );
- def struct_or_union_specifier(self, ):
-
- retval = self.struct_or_union_specifier_return()
- retval.start = self.input.LT(1)
- struct_or_union_specifier_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 11):
- return retval
-
- # C.g:235:2: ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER )
- alt15 = 2
- LA15_0 = self.input.LA(1)
-
- if ((45 <= LA15_0 <= 46)) :
- LA15_1 = self.input.LA(2)
-
- if (LA15_1 == IDENTIFIER) :
- LA15_2 = self.input.LA(3)
-
- if (LA15_2 == 43) :
- alt15 = 1
- elif (LA15_2 == EOF or LA15_2 == IDENTIFIER or LA15_2 == 25 or LA15_2 == 27 or (29 <= LA15_2 <= 42) or (45 <= LA15_2 <= 64) or LA15_2 == 66) :
- alt15 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 2, self.input)
-
- raise nvae
-
- elif (LA15_1 == 43) :
- alt15 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 1, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 0, self.input)
-
- raise nvae
-
- if alt15 == 1:
- # C.g:235:4: struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}'
- self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier494)
- self.struct_or_union()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:235:20: ( IDENTIFIER )?
- alt14 = 2
- LA14_0 = self.input.LA(1)
-
- if (LA14_0 == IDENTIFIER) :
- alt14 = 1
- if alt14 == 1:
- # C.g:0:0: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier496)
- if self.failed:
- return retval
-
-
-
- self.match(self.input, 43, self.FOLLOW_43_in_struct_or_union_specifier499)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_struct_declaration_list_in_struct_or_union_specifier501)
- self.struct_declaration_list()
- self.following.pop()
- if self.failed:
- return retval
- self.match(self.input, 44, self.FOLLOW_44_in_struct_or_union_specifier503)
- if self.failed:
- return retval
-
-
- elif alt15 == 2:
- # C.g:236:4: struct_or_union IDENTIFIER
- self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier508)
- self.struct_or_union()
- self.following.pop()
- if self.failed:
- return retval
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier510)
- if self.failed:
- return retval
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 11, struct_or_union_specifier_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end struct_or_union_specifier
-
-
- # $ANTLR start struct_or_union
- # C.g:239:1: struct_or_union : ( 'struct' | 'union' );
- def struct_or_union(self, ):
-
- struct_or_union_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 12):
- return
-
- # C.g:240:2: ( 'struct' | 'union' )
- # C.g:
- if (45 <= self.input.LA(1) <= 46):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_struct_or_union0
- )
- raise mse
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 12, struct_or_union_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end struct_or_union
-
-
- # $ANTLR start struct_declaration_list
- # C.g:244:1: struct_declaration_list : ( struct_declaration )+ ;
- def struct_declaration_list(self, ):
-
- struct_declaration_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 13):
- return
-
- # C.g:245:2: ( ( struct_declaration )+ )
- # C.g:245:4: ( struct_declaration )+
- # C.g:245:4: ( struct_declaration )+
- cnt16 = 0
- while True: #loop16
- alt16 = 2
- LA16_0 = self.input.LA(1)
-
- if (LA16_0 == IDENTIFIER or (34 <= LA16_0 <= 42) or (45 <= LA16_0 <= 46) or (48 <= LA16_0 <= 61)) :
- alt16 = 1
-
-
- if alt16 == 1:
- # C.g:0:0: struct_declaration
- self.following.append(self.FOLLOW_struct_declaration_in_struct_declaration_list537)
- self.struct_declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt16 >= 1:
- break #loop16
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(16, self.input)
- raise eee
-
- cnt16 += 1
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 13, struct_declaration_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end struct_declaration_list
-
-
- # $ANTLR start struct_declaration
- # C.g:248:1: struct_declaration : specifier_qualifier_list struct_declarator_list ';' ;
- def struct_declaration(self, ):
-
- struct_declaration_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 14):
- return
-
- # C.g:249:2: ( specifier_qualifier_list struct_declarator_list ';' )
- # C.g:249:4: specifier_qualifier_list struct_declarator_list ';'
- self.following.append(self.FOLLOW_specifier_qualifier_list_in_struct_declaration549)
- self.specifier_qualifier_list()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_struct_declarator_list_in_struct_declaration551)
- self.struct_declarator_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_struct_declaration553)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 14, struct_declaration_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end struct_declaration
-
-
- # $ANTLR start specifier_qualifier_list
- # C.g:252:1: specifier_qualifier_list : ( type_qualifier | type_specifier )+ ;
- def specifier_qualifier_list(self, ):
-
- specifier_qualifier_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 15):
- return
-
- # C.g:253:2: ( ( type_qualifier | type_specifier )+ )
- # C.g:253:4: ( type_qualifier | type_specifier )+
- # C.g:253:4: ( type_qualifier | type_specifier )+
- cnt17 = 0
- while True: #loop17
- alt17 = 3
- LA17 = self.input.LA(1)
- if LA17 == 58:
- LA17_2 = self.input.LA(2)
-
- if (self.synpred39()) :
- alt17 = 1
-
-
- elif LA17 == 59:
- LA17_3 = self.input.LA(2)
-
- if (self.synpred39()) :
- alt17 = 1
-
-
- elif LA17 == 60:
- LA17_4 = self.input.LA(2)
-
- if (self.synpred39()) :
- alt17 = 1
-
-
- elif LA17 == IDENTIFIER:
- LA17 = self.input.LA(2)
- if LA17 == EOF or LA17 == IDENTIFIER or LA17 == 34 or LA17 == 35 or LA17 == 36 or LA17 == 37 or LA17 == 38 or LA17 == 39 or LA17 == 40 or LA17 == 41 or LA17 == 42 or LA17 == 45 or LA17 == 46 or LA17 == 48 or LA17 == 49 or LA17 == 50 or LA17 == 51 or LA17 == 52 or LA17 == 53 or LA17 == 54 or LA17 == 55 or LA17 == 56 or LA17 == 57 or LA17 == 58 or LA17 == 59 or LA17 == 60 or LA17 == 61 or LA17 == 63 or LA17 == 66:
- alt17 = 2
- elif LA17 == 62:
- LA17_94 = self.input.LA(3)
-
- if (self.synpred40()) :
- alt17 = 2
-
-
- elif LA17 == 47:
- LA17_95 = self.input.LA(3)
-
- if (self.synpred40()) :
- alt17 = 2
-
-
- elif LA17 == 64:
- LA17_96 = self.input.LA(3)
-
- if (self.synpred40()) :
- alt17 = 2
-
-
-
- elif LA17 == 49 or LA17 == 50 or LA17 == 51 or LA17 == 52 or LA17 == 53 or LA17 == 54 or LA17 == 55 or LA17 == 56 or LA17 == 57 or LA17 == 61:
- alt17 = 1
- elif LA17 == 34 or LA17 == 35 or LA17 == 36 or LA17 == 37 or LA17 == 38 or LA17 == 39 or LA17 == 40 or LA17 == 41 or LA17 == 42 or LA17 == 45 or LA17 == 46 or LA17 == 48:
- alt17 = 2
-
- if alt17 == 1:
- # C.g:253:6: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_specifier_qualifier_list566)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt17 == 2:
- # C.g:253:23: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_specifier_qualifier_list570)
- self.type_specifier()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt17 >= 1:
- break #loop17
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(17, self.input)
- raise eee
-
- cnt17 += 1
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 15, specifier_qualifier_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end specifier_qualifier_list
-
-
- # $ANTLR start struct_declarator_list
- # C.g:256:1: struct_declarator_list : struct_declarator ( ',' struct_declarator )* ;
- def struct_declarator_list(self, ):
-
- struct_declarator_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 16):
- return
-
- # C.g:257:2: ( struct_declarator ( ',' struct_declarator )* )
- # C.g:257:4: struct_declarator ( ',' struct_declarator )*
- self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list584)
- self.struct_declarator()
- self.following.pop()
- if self.failed:
- return
- # C.g:257:22: ( ',' struct_declarator )*
- while True: #loop18
- alt18 = 2
- LA18_0 = self.input.LA(1)
-
- if (LA18_0 == 27) :
- alt18 = 1
-
-
- if alt18 == 1:
- # C.g:257:23: ',' struct_declarator
- self.match(self.input, 27, self.FOLLOW_27_in_struct_declarator_list587)
- if self.failed:
- return
- self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list589)
- self.struct_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop18
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 16, struct_declarator_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end struct_declarator_list
-
-
- # $ANTLR start struct_declarator
- # C.g:260:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );
- def struct_declarator(self, ):
-
- struct_declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 17):
- return
-
- # C.g:261:2: ( declarator ( ':' constant_expression )? | ':' constant_expression )
- alt20 = 2
- LA20_0 = self.input.LA(1)
-
- if (LA20_0 == IDENTIFIER or (58 <= LA20_0 <= 60) or LA20_0 == 62 or LA20_0 == 66) :
- alt20 = 1
- elif (LA20_0 == 47) :
- alt20 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("260:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );", 20, 0, self.input)
-
- raise nvae
-
- if alt20 == 1:
- # C.g:261:4: declarator ( ':' constant_expression )?
- self.following.append(self.FOLLOW_declarator_in_struct_declarator602)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
- # C.g:261:15: ( ':' constant_expression )?
- alt19 = 2
- LA19_0 = self.input.LA(1)
-
- if (LA19_0 == 47) :
- alt19 = 1
- if alt19 == 1:
- # C.g:261:16: ':' constant_expression
- self.match(self.input, 47, self.FOLLOW_47_in_struct_declarator605)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_struct_declarator607)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- elif alt20 == 2:
- # C.g:262:4: ':' constant_expression
- self.match(self.input, 47, self.FOLLOW_47_in_struct_declarator614)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_struct_declarator616)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 17, struct_declarator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end struct_declarator
-
- class enum_specifier_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start enum_specifier
- # C.g:265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );
- def enum_specifier(self, ):
-
- retval = self.enum_specifier_return()
- retval.start = self.input.LT(1)
- enum_specifier_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 18):
- return retval
-
- # C.g:267:2: ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER )
- alt23 = 3
- LA23_0 = self.input.LA(1)
-
- if (LA23_0 == 48) :
- LA23_1 = self.input.LA(2)
-
- if (LA23_1 == IDENTIFIER) :
- LA23_2 = self.input.LA(3)
-
- if (LA23_2 == 43) :
- alt23 = 2
- elif (LA23_2 == EOF or LA23_2 == IDENTIFIER or LA23_2 == 25 or LA23_2 == 27 or (29 <= LA23_2 <= 42) or (45 <= LA23_2 <= 64) or LA23_2 == 66) :
- alt23 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 2, self.input)
-
- raise nvae
-
- elif (LA23_1 == 43) :
- alt23 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 1, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 0, self.input)
-
- raise nvae
-
- if alt23 == 1:
- # C.g:267:4: 'enum' '{' enumerator_list ( ',' )? '}'
- self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier634)
- if self.failed:
- return retval
- self.match(self.input, 43, self.FOLLOW_43_in_enum_specifier636)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier638)
- self.enumerator_list()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:267:31: ( ',' )?
- alt21 = 2
- LA21_0 = self.input.LA(1)
-
- if (LA21_0 == 27) :
- alt21 = 1
- if alt21 == 1:
- # C.g:0:0: ','
- self.match(self.input, 27, self.FOLLOW_27_in_enum_specifier640)
- if self.failed:
- return retval
-
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_enum_specifier643)
- if self.failed:
- return retval
-
-
- elif alt23 == 2:
- # C.g:268:4: 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}'
- self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier648)
- if self.failed:
- return retval
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier650)
- if self.failed:
- return retval
- self.match(self.input, 43, self.FOLLOW_43_in_enum_specifier652)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier654)
- self.enumerator_list()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:268:42: ( ',' )?
- alt22 = 2
- LA22_0 = self.input.LA(1)
-
- if (LA22_0 == 27) :
- alt22 = 1
- if alt22 == 1:
- # C.g:0:0: ','
- self.match(self.input, 27, self.FOLLOW_27_in_enum_specifier656)
- if self.failed:
- return retval
-
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_enum_specifier659)
- if self.failed:
- return retval
-
-
- elif alt23 == 3:
- # C.g:269:4: 'enum' IDENTIFIER
- self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier664)
- if self.failed:
- return retval
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier666)
- if self.failed:
- return retval
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 18, enum_specifier_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end enum_specifier
-
-
- # $ANTLR start enumerator_list
- # C.g:272:1: enumerator_list : enumerator ( ',' enumerator )* ;
- def enumerator_list(self, ):
-
- enumerator_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 19):
- return
-
- # C.g:273:2: ( enumerator ( ',' enumerator )* )
- # C.g:273:4: enumerator ( ',' enumerator )*
- self.following.append(self.FOLLOW_enumerator_in_enumerator_list677)
- self.enumerator()
- self.following.pop()
- if self.failed:
- return
- # C.g:273:15: ( ',' enumerator )*
- while True: #loop24
- alt24 = 2
- LA24_0 = self.input.LA(1)
-
- if (LA24_0 == 27) :
- LA24_1 = self.input.LA(2)
-
- if (LA24_1 == IDENTIFIER) :
- alt24 = 1
-
-
-
-
- if alt24 == 1:
- # C.g:273:16: ',' enumerator
- self.match(self.input, 27, self.FOLLOW_27_in_enumerator_list680)
- if self.failed:
- return
- self.following.append(self.FOLLOW_enumerator_in_enumerator_list682)
- self.enumerator()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop24
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 19, enumerator_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end enumerator_list
-
-
- # $ANTLR start enumerator
- # C.g:276:1: enumerator : IDENTIFIER ( '=' constant_expression )? ;
- def enumerator(self, ):
-
- enumerator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 20):
- return
-
- # C.g:277:2: ( IDENTIFIER ( '=' constant_expression )? )
- # C.g:277:4: IDENTIFIER ( '=' constant_expression )?
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enumerator695)
- if self.failed:
- return
- # C.g:277:15: ( '=' constant_expression )?
- alt25 = 2
- LA25_0 = self.input.LA(1)
-
- if (LA25_0 == 28) :
- alt25 = 1
- if alt25 == 1:
- # C.g:277:16: '=' constant_expression
- self.match(self.input, 28, self.FOLLOW_28_in_enumerator698)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_enumerator700)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 20, enumerator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end enumerator
-
-
- # $ANTLR start type_qualifier
- # C.g:280:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTIONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' );
- def type_qualifier(self, ):
-
- type_qualifier_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 21):
- return
-
- # C.g:281:2: ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTIONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' )
- # C.g:
- if (49 <= self.input.LA(1) <= 61):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_type_qualifier0
- )
- raise mse
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 21, type_qualifier_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end type_qualifier
-
- class declarator_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start declarator
- # C.g:296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );
- def declarator(self, ):
-
- retval = self.declarator_return()
- retval.start = self.input.LT(1)
- declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 22):
- return retval
-
- # C.g:297:2: ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer )
- alt30 = 2
- LA30_0 = self.input.LA(1)
-
- if (LA30_0 == 66) :
- LA30_1 = self.input.LA(2)
-
- if (self.synpred66()) :
- alt30 = 1
- elif (True) :
- alt30 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );", 30, 1, self.input)
-
- raise nvae
-
- elif (LA30_0 == IDENTIFIER or (58 <= LA30_0 <= 60) or LA30_0 == 62) :
- alt30 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );", 30, 0, self.input)
-
- raise nvae
-
- if alt30 == 1:
- # C.g:297:4: ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator
- # C.g:297:4: ( pointer )?
- alt26 = 2
- LA26_0 = self.input.LA(1)
-
- if (LA26_0 == 66) :
- alt26 = 1
- if alt26 == 1:
- # C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_declarator784)
- self.pointer()
- self.following.pop()
- if self.failed:
- return retval
-
-
-
- # C.g:297:13: ( 'EFIAPI' )?
- alt27 = 2
- LA27_0 = self.input.LA(1)
-
- if (LA27_0 == 58) :
- alt27 = 1
- if alt27 == 1:
- # C.g:297:14: 'EFIAPI'
- self.match(self.input, 58, self.FOLLOW_58_in_declarator788)
- if self.failed:
- return retval
-
-
-
- # C.g:297:25: ( 'EFI_BOOTSERVICE' )?
- alt28 = 2
- LA28_0 = self.input.LA(1)
-
- if (LA28_0 == 59) :
- alt28 = 1
- if alt28 == 1:
- # C.g:297:26: 'EFI_BOOTSERVICE'
- self.match(self.input, 59, self.FOLLOW_59_in_declarator793)
- if self.failed:
- return retval
-
-
-
- # C.g:297:46: ( 'EFI_RUNTIMESERVICE' )?
- alt29 = 2
- LA29_0 = self.input.LA(1)
-
- if (LA29_0 == 60) :
- alt29 = 1
- if alt29 == 1:
- # C.g:297:47: 'EFI_RUNTIMESERVICE'
- self.match(self.input, 60, self.FOLLOW_60_in_declarator798)
- if self.failed:
- return retval
-
-
-
- self.following.append(self.FOLLOW_direct_declarator_in_declarator802)
- self.direct_declarator()
- self.following.pop()
- if self.failed:
- return retval
-
-
- elif alt30 == 2:
- # C.g:299:4: pointer
- self.following.append(self.FOLLOW_pointer_in_declarator808)
- self.pointer()
- self.following.pop()
- if self.failed:
- return retval
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 22, declarator_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end declarator
-
-
- # $ANTLR start direct_declarator
- # C.g:302:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );
- def direct_declarator(self, ):
-
- direct_declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 23):
- return
-
- # C.g:303:2: ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ )
- alt34 = 2
- LA34_0 = self.input.LA(1)
-
- if (LA34_0 == IDENTIFIER) :
- alt34 = 1
- elif (LA34_0 == 62) :
- alt34 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("302:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );", 34, 0, self.input)
-
- raise nvae
-
- if alt34 == 1:
- # C.g:303:4: IDENTIFIER ( declarator_suffix )*
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_direct_declarator819)
- if self.failed:
- return
- # C.g:303:15: ( declarator_suffix )*
- while True: #loop31
- alt31 = 2
- LA31_0 = self.input.LA(1)
-
- if (LA31_0 == 62) :
- LA31 = self.input.LA(2)
- if LA31 == 63:
- LA31_30 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 58:
- LA31_31 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 66:
- LA31_32 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 59:
- LA31_33 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 60:
- LA31_34 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == IDENTIFIER:
- LA31_35 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 29 or LA31 == 30 or LA31 == 31 or LA31 == 32 or LA31 == 33:
- LA31_37 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 34:
- LA31_38 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 35:
- LA31_39 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 36:
- LA31_40 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 37:
- LA31_41 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 38:
- LA31_42 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 39:
- LA31_43 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 40:
- LA31_44 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 41:
- LA31_45 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 42:
- LA31_46 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 45 or LA31 == 46:
- LA31_47 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 48:
- LA31_48 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 49 or LA31 == 50 or LA31 == 51 or LA31 == 52 or LA31 == 53 or LA31 == 54 or LA31 == 55 or LA31 == 56 or LA31 == 57 or LA31 == 61:
- LA31_49 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
-
- elif (LA31_0 == 64) :
- LA31 = self.input.LA(2)
- if LA31 == 65:
- LA31_51 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 62:
- LA31_52 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == IDENTIFIER:
- LA31_53 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == HEX_LITERAL:
- LA31_54 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == OCTAL_LITERAL:
- LA31_55 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == DECIMAL_LITERAL:
- LA31_56 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == CHARACTER_LITERAL:
- LA31_57 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == STRING_LITERAL:
- LA31_58 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == FLOATING_POINT_LITERAL:
- LA31_59 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 72:
- LA31_60 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 73:
- LA31_61 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 66 or LA31 == 68 or LA31 == 69 or LA31 == 77 or LA31 == 78 or LA31 == 79:
- LA31_62 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 74:
- LA31_63 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
-
-
-
- if alt31 == 1:
- # C.g:0:0: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator821)
- self.declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop31
-
-
-
-
- elif alt34 == 2:
- # C.g:304:4: '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+
- self.match(self.input, 62, self.FOLLOW_62_in_direct_declarator827)
- if self.failed:
- return
- # C.g:304:8: ( 'EFIAPI' )?
- alt32 = 2
- LA32_0 = self.input.LA(1)
-
- if (LA32_0 == 58) :
- LA32_1 = self.input.LA(2)
-
- if (self.synpred69()) :
- alt32 = 1
- if alt32 == 1:
- # C.g:304:9: 'EFIAPI'
- self.match(self.input, 58, self.FOLLOW_58_in_direct_declarator830)
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_declarator_in_direct_declarator834)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_direct_declarator836)
- if self.failed:
- return
- # C.g:304:35: ( declarator_suffix )+
- cnt33 = 0
- while True: #loop33
- alt33 = 2
- LA33_0 = self.input.LA(1)
-
- if (LA33_0 == 62) :
- LA33 = self.input.LA(2)
- if LA33 == 63:
- LA33_30 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 58:
- LA33_31 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 66:
- LA33_32 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 59:
- LA33_33 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 60:
- LA33_34 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == IDENTIFIER:
- LA33_35 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 29 or LA33 == 30 or LA33 == 31 or LA33 == 32 or LA33 == 33:
- LA33_37 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 34:
- LA33_38 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 35:
- LA33_39 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 36:
- LA33_40 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 37:
- LA33_41 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 38:
- LA33_42 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 39:
- LA33_43 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 40:
- LA33_44 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 41:
- LA33_45 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 42:
- LA33_46 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 45 or LA33 == 46:
- LA33_47 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 48:
- LA33_48 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 49 or LA33 == 50 or LA33 == 51 or LA33 == 52 or LA33 == 53 or LA33 == 54 or LA33 == 55 or LA33 == 56 or LA33 == 57 or LA33 == 61:
- LA33_49 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
-
- elif (LA33_0 == 64) :
- LA33 = self.input.LA(2)
- if LA33 == 65:
- LA33_51 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 62:
- LA33_52 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == IDENTIFIER:
- LA33_53 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == HEX_LITERAL:
- LA33_54 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == OCTAL_LITERAL:
- LA33_55 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == DECIMAL_LITERAL:
- LA33_56 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == CHARACTER_LITERAL:
- LA33_57 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == STRING_LITERAL:
- LA33_58 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == FLOATING_POINT_LITERAL:
- LA33_59 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 72:
- LA33_60 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 73:
- LA33_61 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 66 or LA33 == 68 or LA33 == 69 or LA33 == 77 or LA33 == 78 or LA33 == 79:
- LA33_62 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 74:
- LA33_63 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
-
-
-
- if alt33 == 1:
- # C.g:0:0: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator838)
- self.declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt33 >= 1:
- break #loop33
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(33, self.input)
- raise eee
-
- cnt33 += 1
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 23, direct_declarator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end direct_declarator
-
-
- # $ANTLR start declarator_suffix
- # C.g:307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );
- def declarator_suffix(self, ):
-
- declarator_suffix_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 24):
- return
-
- # C.g:308:2: ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' )
- alt35 = 5
- LA35_0 = self.input.LA(1)
-
- if (LA35_0 == 64) :
- LA35_1 = self.input.LA(2)
-
- if (LA35_1 == 65) :
- alt35 = 2
- elif ((IDENTIFIER <= LA35_1 <= FLOATING_POINT_LITERAL) or LA35_1 == 62 or LA35_1 == 66 or (68 <= LA35_1 <= 69) or (72 <= LA35_1 <= 74) or (77 <= LA35_1 <= 79)) :
- alt35 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 1, self.input)
-
- raise nvae
-
- elif (LA35_0 == 62) :
- LA35 = self.input.LA(2)
- if LA35 == 63:
- alt35 = 5
- elif LA35 == 29 or LA35 == 30 or LA35 == 31 or LA35 == 32 or LA35 == 33 or LA35 == 34 or LA35 == 35 or LA35 == 36 or LA35 == 37 or LA35 == 38 or LA35 == 39 or LA35 == 40 or LA35 == 41 or LA35 == 42 or LA35 == 45 or LA35 == 46 or LA35 == 48 or LA35 == 49 or LA35 == 50 or LA35 == 51 or LA35 == 52 or LA35 == 53 or LA35 == 54 or LA35 == 55 or LA35 == 56 or LA35 == 57 or LA35 == 58 or LA35 == 59 or LA35 == 60 or LA35 == 61 or LA35 == 66:
- alt35 = 3
- elif LA35 == IDENTIFIER:
- LA35_29 = self.input.LA(3)
-
- if (self.synpred73()) :
- alt35 = 3
- elif (self.synpred74()) :
- alt35 = 4
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 29, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 2, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 0, self.input)
-
- raise nvae
-
- if alt35 == 1:
- # C.g:308:6: '[' constant_expression ']'
- self.match(self.input, 64, self.FOLLOW_64_in_declarator_suffix852)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_declarator_suffix854)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 65, self.FOLLOW_65_in_declarator_suffix856)
- if self.failed:
- return
-
-
- elif alt35 == 2:
- # C.g:309:9: '[' ']'
- self.match(self.input, 64, self.FOLLOW_64_in_declarator_suffix866)
- if self.failed:
- return
- self.match(self.input, 65, self.FOLLOW_65_in_declarator_suffix868)
- if self.failed:
- return
-
-
- elif alt35 == 3:
- # C.g:310:9: '(' parameter_type_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_declarator_suffix878)
- if self.failed:
- return
- self.following.append(self.FOLLOW_parameter_type_list_in_declarator_suffix880)
- self.parameter_type_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_declarator_suffix882)
- if self.failed:
- return
-
-
- elif alt35 == 4:
- # C.g:311:9: '(' identifier_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_declarator_suffix892)
- if self.failed:
- return
- self.following.append(self.FOLLOW_identifier_list_in_declarator_suffix894)
- self.identifier_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_declarator_suffix896)
- if self.failed:
- return
-
-
- elif alt35 == 5:
- # C.g:312:9: '(' ')'
- self.match(self.input, 62, self.FOLLOW_62_in_declarator_suffix906)
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_declarator_suffix908)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 24, declarator_suffix_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end declarator_suffix
-
-
- # $ANTLR start pointer
- # C.g:315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );
- def pointer(self, ):
-
- pointer_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 25):
- return
-
- # C.g:316:2: ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' )
- alt38 = 3
- LA38_0 = self.input.LA(1)
-
- if (LA38_0 == 66) :
- LA38 = self.input.LA(2)
- if LA38 == 66:
- LA38_2 = self.input.LA(3)
-
- if (self.synpred78()) :
- alt38 = 2
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 2, self.input)
-
- raise nvae
-
- elif LA38 == 58:
- LA38_3 = self.input.LA(3)
-
- if (self.synpred77()) :
- alt38 = 1
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 3, self.input)
-
- raise nvae
-
- elif LA38 == 59:
- LA38_4 = self.input.LA(3)
-
- if (self.synpred77()) :
- alt38 = 1
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 4, self.input)
-
- raise nvae
-
- elif LA38 == 60:
- LA38_5 = self.input.LA(3)
-
- if (self.synpred77()) :
- alt38 = 1
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 5, self.input)
-
- raise nvae
-
- elif LA38 == EOF or LA38 == IDENTIFIER or LA38 == 25 or LA38 == 26 or LA38 == 27 or LA38 == 28 or LA38 == 29 or LA38 == 30 or LA38 == 31 or LA38 == 32 or LA38 == 33 or LA38 == 34 or LA38 == 35 or LA38 == 36 or LA38 == 37 or LA38 == 38 or LA38 == 39 or LA38 == 40 or LA38 == 41 or LA38 == 42 or LA38 == 43 or LA38 == 45 or LA38 == 46 or LA38 == 47 or LA38 == 48 or LA38 == 62 or LA38 == 63 or LA38 == 64:
- alt38 = 3
- elif LA38 == 53:
- LA38_21 = self.input.LA(3)
-
- if (self.synpred77()) :
- alt38 = 1
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 21, self.input)
-
- raise nvae
-
- elif LA38 == 49 or LA38 == 50 or LA38 == 51 or LA38 == 52 or LA38 == 54 or LA38 == 55 or LA38 == 56 or LA38 == 57 or LA38 == 61:
- LA38_29 = self.input.LA(3)
-
- if (self.synpred77()) :
- alt38 = 1
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 29, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 1, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 0, self.input)
-
- raise nvae
-
- if alt38 == 1:
- # C.g:316:4: '*' ( type_qualifier )+ ( pointer )?
- self.match(self.input, 66, self.FOLLOW_66_in_pointer919)
- if self.failed:
- return
- # C.g:316:8: ( type_qualifier )+
- cnt36 = 0
- while True: #loop36
- alt36 = 2
- LA36 = self.input.LA(1)
- if LA36 == 58:
- LA36_2 = self.input.LA(2)
-
- if (self.synpred75()) :
- alt36 = 1
-
-
- elif LA36 == 59:
- LA36_3 = self.input.LA(2)
-
- if (self.synpred75()) :
- alt36 = 1
-
-
- elif LA36 == 60:
- LA36_4 = self.input.LA(2)
-
- if (self.synpred75()) :
- alt36 = 1
-
-
- elif LA36 == 53:
- LA36_20 = self.input.LA(2)
-
- if (self.synpred75()) :
- alt36 = 1
-
-
- elif LA36 == 49 or LA36 == 50 or LA36 == 51 or LA36 == 52 or LA36 == 54 or LA36 == 55 or LA36 == 56 or LA36 == 57 or LA36 == 61:
- LA36_28 = self.input.LA(2)
-
- if (self.synpred75()) :
- alt36 = 1
-
-
-
- if alt36 == 1:
- # C.g:0:0: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_pointer921)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt36 >= 1:
- break #loop36
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(36, self.input)
- raise eee
-
- cnt36 += 1
-
-
- # C.g:316:24: ( pointer )?
- alt37 = 2
- LA37_0 = self.input.LA(1)
-
- if (LA37_0 == 66) :
- LA37_1 = self.input.LA(2)
-
- if (self.synpred76()) :
- alt37 = 1
- if alt37 == 1:
- # C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_pointer924)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- elif alt38 == 2:
- # C.g:317:4: '*' pointer
- self.match(self.input, 66, self.FOLLOW_66_in_pointer930)
- if self.failed:
- return
- self.following.append(self.FOLLOW_pointer_in_pointer932)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt38 == 3:
- # C.g:318:4: '*'
- self.match(self.input, 66, self.FOLLOW_66_in_pointer937)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 25, pointer_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end pointer
-
-
- # $ANTLR start parameter_type_list
- # C.g:321:1: parameter_type_list : parameter_list ( ',' ( 'OPTIONAL' )? '...' )? ;
- def parameter_type_list(self, ):
-
- parameter_type_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 26):
- return
-
- # C.g:322:2: ( parameter_list ( ',' ( 'OPTIONAL' )? '...' )? )
- # C.g:322:4: parameter_list ( ',' ( 'OPTIONAL' )? '...' )?
- self.following.append(self.FOLLOW_parameter_list_in_parameter_type_list948)
- self.parameter_list()
- self.following.pop()
- if self.failed:
- return
- # C.g:322:19: ( ',' ( 'OPTIONAL' )? '...' )?
- alt40 = 2
- LA40_0 = self.input.LA(1)
-
- if (LA40_0 == 27) :
- alt40 = 1
- if alt40 == 1:
- # C.g:322:20: ',' ( 'OPTIONAL' )? '...'
- self.match(self.input, 27, self.FOLLOW_27_in_parameter_type_list951)
- if self.failed:
- return
- # C.g:322:24: ( 'OPTIONAL' )?
- alt39 = 2
- LA39_0 = self.input.LA(1)
-
- if (LA39_0 == 53) :
- alt39 = 1
- if alt39 == 1:
- # C.g:322:25: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_parameter_type_list954)
- if self.failed:
- return
-
-
-
- self.match(self.input, 67, self.FOLLOW_67_in_parameter_type_list958)
- if self.failed:
- return
-
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 26, parameter_type_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end parameter_type_list
-
-
- # $ANTLR start parameter_list
- # C.g:325:1: parameter_list : parameter_declaration ( ',' ( 'OPTIONAL' )? parameter_declaration )* ;
- def parameter_list(self, ):
-
- parameter_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 27):
- return
-
- # C.g:326:2: ( parameter_declaration ( ',' ( 'OPTIONAL' )? parameter_declaration )* )
- # C.g:326:4: parameter_declaration ( ',' ( 'OPTIONAL' )? parameter_declaration )*
- self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list971)
- self.parameter_declaration()
- self.following.pop()
- if self.failed:
- return
- # C.g:326:26: ( ',' ( 'OPTIONAL' )? parameter_declaration )*
- while True: #loop42
- alt42 = 2
- LA42_0 = self.input.LA(1)
-
- if (LA42_0 == 27) :
- LA42_1 = self.input.LA(2)
-
- if (LA42_1 == 53) :
- LA42_3 = self.input.LA(3)
-
- if (self.synpred82()) :
- alt42 = 1
-
-
- elif (LA42_1 == IDENTIFIER or (29 <= LA42_1 <= 42) or (45 <= LA42_1 <= 46) or (48 <= LA42_1 <= 52) or (54 <= LA42_1 <= 61) or LA42_1 == 66) :
- alt42 = 1
-
-
-
-
- if alt42 == 1:
- # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declaration
- self.match(self.input, 27, self.FOLLOW_27_in_parameter_list974)
- if self.failed:
- return
- # C.g:326:31: ( 'OPTIONAL' )?
- alt41 = 2
- LA41_0 = self.input.LA(1)
-
- if (LA41_0 == 53) :
- LA41_1 = self.input.LA(2)
-
- if (self.synpred81()) :
- alt41 = 1
- if alt41 == 1:
- # C.g:326:32: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_parameter_list977)
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list981)
- self.parameter_declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop42
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 27, parameter_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end parameter_list
-
-
- # $ANTLR start parameter_declaration
- # C.g:329:1: parameter_declaration : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );
- def parameter_declaration(self, ):
-
- parameter_declaration_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 28):
- return
-
- # C.g:330:2: ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER )
- alt46 = 2
- LA46 = self.input.LA(1)
- if LA46 == 29 or LA46 == 30 or LA46 == 31 or LA46 == 32 or LA46 == 33 or LA46 == 34 or LA46 == 35 or LA46 == 36 or LA46 == 37 or LA46 == 38 or LA46 == 39 or LA46 == 40 or LA46 == 41 or LA46 == 42 or LA46 == 45 or LA46 == 46 or LA46 == 48 or LA46 == 49 or LA46 == 50 or LA46 == 51 or LA46 == 52 or LA46 == 53 or LA46 == 54 or LA46 == 55 or LA46 == 56 or LA46 == 57 or LA46 == 58 or LA46 == 59 or LA46 == 60 or LA46 == 61:
- alt46 = 1
- elif LA46 == IDENTIFIER:
- LA46_13 = self.input.LA(2)
-
- if (self.synpred86()) :
- alt46 = 1
- elif (True) :
- alt46 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("329:1: parameter_declaration : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 13, self.input)
-
- raise nvae
-
- elif LA46 == 66:
- alt46 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("329:1: parameter_declaration : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 0, self.input)
-
- raise nvae
-
- if alt46 == 1:
- # C.g:330:4: declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )?
- self.following.append(self.FOLLOW_declaration_specifiers_in_parameter_declaration994)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
- # C.g:330:27: ( declarator | abstract_declarator )*
- while True: #loop43
- alt43 = 3
- LA43 = self.input.LA(1)
- if LA43 == 66:
- LA43_5 = self.input.LA(2)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == IDENTIFIER or LA43 == 58 or LA43 == 59 or LA43 == 60:
- alt43 = 1
- elif LA43 == 62:
- LA43 = self.input.LA(2)
- if LA43 == 29 or LA43 == 30 or LA43 == 31 or LA43 == 32 or LA43 == 33 or LA43 == 34 or LA43 == 35 or LA43 == 36 or LA43 == 37 or LA43 == 38 or LA43 == 39 or LA43 == 40 or LA43 == 41 or LA43 == 42 or LA43 == 45 or LA43 == 46 or LA43 == 48 or LA43 == 49 or LA43 == 50 or LA43 == 51 or LA43 == 52 or LA43 == 53 or LA43 == 54 or LA43 == 55 or LA43 == 56 or LA43 == 57 or LA43 == 61 or LA43 == 63 or LA43 == 64:
- alt43 = 2
- elif LA43 == IDENTIFIER:
- LA43_37 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == 58:
- LA43_38 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == 66:
- LA43_39 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == 59:
- LA43_40 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == 60:
- LA43_41 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == 62:
- LA43_43 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
-
- elif LA43 == 64:
- alt43 = 2
-
- if alt43 == 1:
- # C.g:330:28: declarator
- self.following.append(self.FOLLOW_declarator_in_parameter_declaration997)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt43 == 2:
- # C.g:330:39: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_parameter_declaration999)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop43
-
-
- # C.g:330:61: ( 'OPTIONAL' )?
- alt44 = 2
- LA44_0 = self.input.LA(1)
-
- if (LA44_0 == 53) :
- alt44 = 1
- if alt44 == 1:
- # C.g:330:62: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_parameter_declaration1004)
- if self.failed:
- return
-
-
-
-
-
- elif alt46 == 2:
- # C.g:332:4: ( pointer )* IDENTIFIER
- # C.g:332:4: ( pointer )*
- while True: #loop45
- alt45 = 2
- LA45_0 = self.input.LA(1)
-
- if (LA45_0 == 66) :
- alt45 = 1
-
-
- if alt45 == 1:
- # C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_parameter_declaration1013)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop45
-
-
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_parameter_declaration1016)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 28, parameter_declaration_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end parameter_declaration
-
-
- # $ANTLR start identifier_list
- # C.g:335:1: identifier_list : IDENTIFIER ( ',' IDENTIFIER )* ;
- def identifier_list(self, ):
-
- identifier_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 29):
- return
-
- # C.g:336:2: ( IDENTIFIER ( ',' IDENTIFIER )* )
- # C.g:336:4: IDENTIFIER ( ',' IDENTIFIER )*
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list1027)
- if self.failed:
- return
- # C.g:337:2: ( ',' IDENTIFIER )*
- while True: #loop47
- alt47 = 2
- LA47_0 = self.input.LA(1)
-
- if (LA47_0 == 27) :
- alt47 = 1
-
-
- if alt47 == 1:
- # C.g:337:3: ',' IDENTIFIER
- self.match(self.input, 27, self.FOLLOW_27_in_identifier_list1031)
- if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list1033)
- if self.failed:
- return
-
-
- else:
- break #loop47
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 29, identifier_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end identifier_list
-
-
- # $ANTLR start type_name
- # C.g:340:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );
- def type_name(self, ):
-
- type_name_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 30):
- return
-
- # C.g:341:2: ( specifier_qualifier_list ( abstract_declarator )? | type_id )
- alt49 = 2
- LA49_0 = self.input.LA(1)
-
- if ((34 <= LA49_0 <= 42) or (45 <= LA49_0 <= 46) or (48 <= LA49_0 <= 61)) :
- alt49 = 1
- elif (LA49_0 == IDENTIFIER) :
- LA49_13 = self.input.LA(2)
-
- if (self.synpred90()) :
- alt49 = 1
- elif (True) :
- alt49 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("340:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 13, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("340:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 0, self.input)
-
- raise nvae
-
- if alt49 == 1:
- # C.g:341:4: specifier_qualifier_list ( abstract_declarator )?
- self.following.append(self.FOLLOW_specifier_qualifier_list_in_type_name1046)
- self.specifier_qualifier_list()
- self.following.pop()
- if self.failed:
- return
- # C.g:341:29: ( abstract_declarator )?
- alt48 = 2
- LA48_0 = self.input.LA(1)
-
- if (LA48_0 == 62 or LA48_0 == 64 or LA48_0 == 66) :
- alt48 = 1
- if alt48 == 1:
- # C.g:0:0: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_type_name1048)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- elif alt49 == 2:
- # C.g:342:4: type_id
- self.following.append(self.FOLLOW_type_id_in_type_name1054)
- self.type_id()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 30, type_name_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end type_name
-
-
- # $ANTLR start abstract_declarator
- # C.g:345:1: abstract_declarator : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator );
- def abstract_declarator(self, ):
-
- abstract_declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 31):
- return
-
- # C.g:346:2: ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator )
- alt51 = 2
- LA51_0 = self.input.LA(1)
-
- if (LA51_0 == 66) :
- alt51 = 1
- elif (LA51_0 == 62 or LA51_0 == 64) :
- alt51 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("345:1: abstract_declarator : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator );", 51, 0, self.input)
-
- raise nvae
-
- if alt51 == 1:
- # C.g:346:4: pointer ( direct_abstract_declarator )?
- self.following.append(self.FOLLOW_pointer_in_abstract_declarator1065)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
- # C.g:346:12: ( direct_abstract_declarator )?
- alt50 = 2
- LA50_0 = self.input.LA(1)
-
- if (LA50_0 == 62) :
- LA50 = self.input.LA(2)
- if LA50 == 63:
- LA50_12 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 58:
- LA50_13 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 66:
- LA50_14 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 59:
- LA50_15 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 60:
- LA50_16 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == IDENTIFIER:
- LA50_17 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 62:
- LA50_18 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 64:
- LA50_19 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 29 or LA50 == 30 or LA50 == 31 or LA50 == 32 or LA50 == 33:
- LA50_20 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 34:
- LA50_21 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 35:
- LA50_22 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 36:
- LA50_23 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 37:
- LA50_24 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 38:
- LA50_25 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 39:
- LA50_26 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 40:
- LA50_27 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 41:
- LA50_28 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 42:
- LA50_29 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 45 or LA50 == 46:
- LA50_30 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 48:
- LA50_31 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 49 or LA50 == 50 or LA50 == 51 or LA50 == 52 or LA50 == 53 or LA50 == 54 or LA50 == 55 or LA50 == 56 or LA50 == 57 or LA50 == 61:
- LA50_32 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif (LA50_0 == 64) :
- LA50 = self.input.LA(2)
- if LA50 == 65:
- LA50_33 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 62:
- LA50_34 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == IDENTIFIER:
- LA50_35 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == HEX_LITERAL:
- LA50_36 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == OCTAL_LITERAL:
- LA50_37 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == DECIMAL_LITERAL:
- LA50_38 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == CHARACTER_LITERAL:
- LA50_39 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == STRING_LITERAL:
- LA50_40 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == FLOATING_POINT_LITERAL:
- LA50_41 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 72:
- LA50_42 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 73:
- LA50_43 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 66 or LA50 == 68 or LA50 == 69 or LA50 == 77 or LA50 == 78 or LA50 == 79:
- LA50_44 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 74:
- LA50_45 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- if alt50 == 1:
- # C.g:0:0: direct_abstract_declarator
- self.following.append(self.FOLLOW_direct_abstract_declarator_in_abstract_declarator1067)
- self.direct_abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- elif alt51 == 2:
- # C.g:347:4: direct_abstract_declarator
- self.following.append(self.FOLLOW_direct_abstract_declarator_in_abstract_declarator1073)
- self.direct_abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 31, abstract_declarator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end abstract_declarator
-
-
- # $ANTLR start direct_abstract_declarator
- # C.g:350:1: direct_abstract_declarator : ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* ;
- def direct_abstract_declarator(self, ):
-
- direct_abstract_declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 32):
- return
-
- # C.g:351:2: ( ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* )
- # C.g:351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )*
- # C.g:351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )
- alt52 = 2
- LA52_0 = self.input.LA(1)
-
- if (LA52_0 == 62) :
- LA52 = self.input.LA(2)
- if LA52 == IDENTIFIER or LA52 == 29 or LA52 == 30 or LA52 == 31 or LA52 == 32 or LA52 == 33 or LA52 == 34 or LA52 == 35 or LA52 == 36 or LA52 == 37 or LA52 == 38 or LA52 == 39 or LA52 == 40 or LA52 == 41 or LA52 == 42 or LA52 == 45 or LA52 == 46 or LA52 == 48 or LA52 == 49 or LA52 == 50 or LA52 == 51 or LA52 == 52 or LA52 == 53 or LA52 == 54 or LA52 == 55 or LA52 == 56 or LA52 == 57 or LA52 == 58 or LA52 == 59 or LA52 == 60 or LA52 == 61 or LA52 == 63:
- alt52 = 2
- elif LA52 == 66:
- LA52_18 = self.input.LA(3)
-
- if (self.synpred93()) :
- alt52 = 1
- elif (True) :
- alt52 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 52, 18, self.input)
-
- raise nvae
-
- elif LA52 == 62 or LA52 == 64:
- alt52 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 52, 1, self.input)
-
- raise nvae
-
- elif (LA52_0 == 64) :
- alt52 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 52, 0, self.input)
-
- raise nvae
-
- if alt52 == 1:
- # C.g:351:6: '(' abstract_declarator ')'
- self.match(self.input, 62, self.FOLLOW_62_in_direct_abstract_declarator1086)
- if self.failed:
- return
- self.following.append(self.FOLLOW_abstract_declarator_in_direct_abstract_declarator1088)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_direct_abstract_declarator1090)
- if self.failed:
- return
-
-
- elif alt52 == 2:
- # C.g:351:36: abstract_declarator_suffix
- self.following.append(self.FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1094)
- self.abstract_declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
-
- # C.g:351:65: ( abstract_declarator_suffix )*
- while True: #loop53
- alt53 = 2
- LA53_0 = self.input.LA(1)
-
- if (LA53_0 == 62) :
- LA53 = self.input.LA(2)
- if LA53 == 63:
- LA53_12 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 58:
- LA53_13 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 66:
- LA53_14 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 59:
- LA53_15 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 60:
- LA53_16 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == IDENTIFIER:
- LA53_17 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 29 or LA53 == 30 or LA53 == 31 or LA53 == 32 or LA53 == 33:
- LA53_19 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 34:
- LA53_20 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 35:
- LA53_21 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 36:
- LA53_22 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 37:
- LA53_23 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 38:
- LA53_24 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 39:
- LA53_25 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 40:
- LA53_26 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 41:
- LA53_27 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 42:
- LA53_28 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 45 or LA53 == 46:
- LA53_29 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 48:
- LA53_30 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 49 or LA53 == 50 or LA53 == 51 or LA53 == 52 or LA53 == 53 or LA53 == 54 or LA53 == 55 or LA53 == 56 or LA53 == 57 or LA53 == 61:
- LA53_31 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
-
- elif (LA53_0 == 64) :
- LA53 = self.input.LA(2)
- if LA53 == 65:
- LA53_33 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 62:
- LA53_34 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == IDENTIFIER:
- LA53_35 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == HEX_LITERAL:
- LA53_36 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == OCTAL_LITERAL:
- LA53_37 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == DECIMAL_LITERAL:
- LA53_38 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == CHARACTER_LITERAL:
- LA53_39 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == STRING_LITERAL:
- LA53_40 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == FLOATING_POINT_LITERAL:
- LA53_41 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 72:
- LA53_42 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 73:
- LA53_43 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 66 or LA53 == 68 or LA53 == 69 or LA53 == 77 or LA53 == 78 or LA53 == 79:
- LA53_44 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 74:
- LA53_45 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
-
-
-
- if alt53 == 1:
- # C.g:0:0: abstract_declarator_suffix
- self.following.append(self.FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1098)
- self.abstract_declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop53
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 32, direct_abstract_declarator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end direct_abstract_declarator
-
-
- # $ANTLR start abstract_declarator_suffix
- # C.g:354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );
- def abstract_declarator_suffix(self, ):
-
- abstract_declarator_suffix_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 33):
- return
-
- # C.g:355:2: ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' )
- alt54 = 4
- LA54_0 = self.input.LA(1)
-
- if (LA54_0 == 64) :
- LA54_1 = self.input.LA(2)
-
- if (LA54_1 == 65) :
- alt54 = 1
- elif ((IDENTIFIER <= LA54_1 <= FLOATING_POINT_LITERAL) or LA54_1 == 62 or LA54_1 == 66 or (68 <= LA54_1 <= 69) or (72 <= LA54_1 <= 74) or (77 <= LA54_1 <= 79)) :
- alt54 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54, 1, self.input)
-
- raise nvae
-
- elif (LA54_0 == 62) :
- LA54_2 = self.input.LA(2)
-
- if (LA54_2 == 63) :
- alt54 = 3
- elif (LA54_2 == IDENTIFIER or (29 <= LA54_2 <= 42) or (45 <= LA54_2 <= 46) or (48 <= LA54_2 <= 61) or LA54_2 == 66) :
- alt54 = 4
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54, 2, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54, 0, self.input)
-
- raise nvae
-
- if alt54 == 1:
- # C.g:355:4: '[' ']'
- self.match(self.input, 64, self.FOLLOW_64_in_abstract_declarator_suffix1110)
- if self.failed:
- return
- self.match(self.input, 65, self.FOLLOW_65_in_abstract_declarator_suffix1112)
- if self.failed:
- return
-
-
- elif alt54 == 2:
- # C.g:356:4: '[' constant_expression ']'
- self.match(self.input, 64, self.FOLLOW_64_in_abstract_declarator_suffix1117)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_abstract_declarator_suffix1119)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 65, self.FOLLOW_65_in_abstract_declarator_suffix1121)
- if self.failed:
- return
-
-
- elif alt54 == 3:
- # C.g:357:4: '(' ')'
- self.match(self.input, 62, self.FOLLOW_62_in_abstract_declarator_suffix1126)
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_abstract_declarator_suffix1128)
- if self.failed:
- return
-
-
- elif alt54 == 4:
- # C.g:358:4: '(' parameter_type_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_abstract_declarator_suffix1133)
- if self.failed:
- return
- self.following.append(self.FOLLOW_parameter_type_list_in_abstract_declarator_suffix1135)
- self.parameter_type_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_abstract_declarator_suffix1137)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 33, abstract_declarator_suffix_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end abstract_declarator_suffix
-
-
- # $ANTLR start initializer
- # C.g:361:1: initializer : ( assignment_expression | '{' initializer_list ( ',' )? '}' );
- def initializer(self, ):
-
- initializer_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 34):
- return
-
- # C.g:363:2: ( assignment_expression | '{' initializer_list ( ',' )? '}' )
- alt56 = 2
- LA56_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA56_0 <= FLOATING_POINT_LITERAL) or LA56_0 == 62 or LA56_0 == 66 or (68 <= LA56_0 <= 69) or (72 <= LA56_0 <= 74) or (77 <= LA56_0 <= 79)) :
- alt56 = 1
- elif (LA56_0 == 43) :
- alt56 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("361:1: initializer : ( assignment_expression | '{' initializer_list ( ',' )? '}' );", 56, 0, self.input)
-
- raise nvae
-
- if alt56 == 1:
- # C.g:363:4: assignment_expression
- self.following.append(self.FOLLOW_assignment_expression_in_initializer1150)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt56 == 2:
- # C.g:364:4: '{' initializer_list ( ',' )? '}'
- self.match(self.input, 43, self.FOLLOW_43_in_initializer1155)
- if self.failed:
- return
- self.following.append(self.FOLLOW_initializer_list_in_initializer1157)
- self.initializer_list()
- self.following.pop()
- if self.failed:
- return
- # C.g:364:25: ( ',' )?
- alt55 = 2
- LA55_0 = self.input.LA(1)
-
- if (LA55_0 == 27) :
- alt55 = 1
- if alt55 == 1:
- # C.g:0:0: ','
- self.match(self.input, 27, self.FOLLOW_27_in_initializer1159)
- if self.failed:
- return
-
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_initializer1162)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 34, initializer_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end initializer
-
-
- # $ANTLR start initializer_list
- # C.g:367:1: initializer_list : initializer ( ',' initializer )* ;
- def initializer_list(self, ):
-
- initializer_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 35):
- return
-
- # C.g:368:2: ( initializer ( ',' initializer )* )
- # C.g:368:4: initializer ( ',' initializer )*
- self.following.append(self.FOLLOW_initializer_in_initializer_list1173)
- self.initializer()
- self.following.pop()
- if self.failed:
- return
- # C.g:368:16: ( ',' initializer )*
- while True: #loop57
- alt57 = 2
- LA57_0 = self.input.LA(1)
-
- if (LA57_0 == 27) :
- LA57_1 = self.input.LA(2)
-
- if ((IDENTIFIER <= LA57_1 <= FLOATING_POINT_LITERAL) or LA57_1 == 43 or LA57_1 == 62 or LA57_1 == 66 or (68 <= LA57_1 <= 69) or (72 <= LA57_1 <= 74) or (77 <= LA57_1 <= 79)) :
- alt57 = 1
-
-
-
-
- if alt57 == 1:
- # C.g:368:17: ',' initializer
- self.match(self.input, 27, self.FOLLOW_27_in_initializer_list1176)
- if self.failed:
- return
- self.following.append(self.FOLLOW_initializer_in_initializer_list1178)
- self.initializer()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop57
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 35, initializer_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end initializer_list
-
- class argument_expression_list_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start argument_expression_list
- # C.g:373:1: argument_expression_list : assignment_expression ( 'OPTIONAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )* ;
- def argument_expression_list(self, ):
-
- retval = self.argument_expression_list_return()
- retval.start = self.input.LT(1)
- argument_expression_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 36):
- return retval
-
- # C.g:374:2: ( assignment_expression ( 'OPTIONAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )* )
- # C.g:374:6: assignment_expression ( 'OPTIONAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )*
- self.following.append(self.FOLLOW_assignment_expression_in_argument_expression_list1196)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:374:28: ( 'OPTIONAL' )?
- alt58 = 2
- LA58_0 = self.input.LA(1)
-
- if (LA58_0 == 53) :
- alt58 = 1
- if alt58 == 1:
- # C.g:374:29: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_argument_expression_list1199)
- if self.failed:
- return retval
-
-
-
- # C.g:374:42: ( ',' assignment_expression ( 'OPTIONAL' )? )*
- while True: #loop60
- alt60 = 2
- LA60_0 = self.input.LA(1)
-
- if (LA60_0 == 27) :
- alt60 = 1
-
-
- if alt60 == 1:
- # C.g:374:43: ',' assignment_expression ( 'OPTIONAL' )?
- self.match(self.input, 27, self.FOLLOW_27_in_argument_expression_list1204)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_assignment_expression_in_argument_expression_list1206)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:374:69: ( 'OPTIONAL' )?
- alt59 = 2
- LA59_0 = self.input.LA(1)
-
- if (LA59_0 == 53) :
- alt59 = 1
- if alt59 == 1:
- # C.g:374:70: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_argument_expression_list1209)
- if self.failed:
- return retval
-
-
-
-
-
- else:
- break #loop60
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 36, argument_expression_list_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end argument_expression_list
-
-
- # $ANTLR start additive_expression
- # C.g:377:1: additive_expression : ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )* ;
- def additive_expression(self, ):
-
- additive_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 37):
- return
-
- # C.g:378:2: ( ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )* )
- # C.g:378:4: ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )*
- # C.g:378:4: ( multiplicative_expression )
- # C.g:378:5: multiplicative_expression
- self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1225)
- self.multiplicative_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- # C.g:378:32: ( '+' multiplicative_expression | '-' multiplicative_expression )*
- while True: #loop61
- alt61 = 3
- LA61_0 = self.input.LA(1)
-
- if (LA61_0 == 68) :
- alt61 = 1
- elif (LA61_0 == 69) :
- alt61 = 2
-
-
- if alt61 == 1:
- # C.g:378:33: '+' multiplicative_expression
- self.match(self.input, 68, self.FOLLOW_68_in_additive_expression1229)
- if self.failed:
- return
- self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1231)
- self.multiplicative_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt61 == 2:
- # C.g:378:65: '-' multiplicative_expression
- self.match(self.input, 69, self.FOLLOW_69_in_additive_expression1235)
- if self.failed:
- return
- self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1237)
- self.multiplicative_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop61
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 37, additive_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end additive_expression
-
-
- # $ANTLR start multiplicative_expression
- # C.g:381:1: multiplicative_expression : ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )* ;
- def multiplicative_expression(self, ):
-
- multiplicative_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 38):
- return
-
- # C.g:382:2: ( ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )* )
- # C.g:382:4: ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )*
- # C.g:382:4: ( cast_expression )
- # C.g:382:5: cast_expression
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1251)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- # C.g:382:22: ( '*' cast_expression | '/' cast_expression | '%' cast_expression )*
- while True: #loop62
- alt62 = 4
- LA62 = self.input.LA(1)
- if LA62 == 66:
- alt62 = 1
- elif LA62 == 70:
- alt62 = 2
- elif LA62 == 71:
- alt62 = 3
-
- if alt62 == 1:
- # C.g:382:23: '*' cast_expression
- self.match(self.input, 66, self.FOLLOW_66_in_multiplicative_expression1255)
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1257)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt62 == 2:
- # C.g:382:45: '/' cast_expression
- self.match(self.input, 70, self.FOLLOW_70_in_multiplicative_expression1261)
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1263)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt62 == 3:
- # C.g:382:67: '%' cast_expression
- self.match(self.input, 71, self.FOLLOW_71_in_multiplicative_expression1267)
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1269)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop62
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 38, multiplicative_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end multiplicative_expression
-
-
- # $ANTLR start cast_expression
- # C.g:385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );
- def cast_expression(self, ):
-
- cast_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 39):
- return
-
- # C.g:386:2: ( '(' type_name ')' cast_expression | unary_expression )
- alt63 = 2
- LA63_0 = self.input.LA(1)
-
- if (LA63_0 == 62) :
- LA63 = self.input.LA(2)
- if LA63 == 34 or LA63 == 35 or LA63 == 36 or LA63 == 37 or LA63 == 38 or LA63 == 39 or LA63 == 40 or LA63 == 41 or LA63 == 42 or LA63 == 45 or LA63 == 46 or LA63 == 48 or LA63 == 49 or LA63 == 50 or LA63 == 51 or LA63 == 52 or LA63 == 53 or LA63 == 54 or LA63 == 55 or LA63 == 56 or LA63 == 57 or LA63 == 58 or LA63 == 59 or LA63 == 60 or LA63 == 61:
- alt63 = 1
- elif LA63 == IDENTIFIER:
- LA63_25 = self.input.LA(3)
-
- if (self.synpred109()) :
- alt63 = 1
- elif (True) :
- alt63 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 25, self.input)
-
- raise nvae
-
- elif LA63 == HEX_LITERAL or LA63 == OCTAL_LITERAL or LA63 == DECIMAL_LITERAL or LA63 == CHARACTER_LITERAL or LA63 == STRING_LITERAL or LA63 == FLOATING_POINT_LITERAL or LA63 == 62 or LA63 == 66 or LA63 == 68 or LA63 == 69 or LA63 == 72 or LA63 == 73 or LA63 == 74 or LA63 == 77 or LA63 == 78 or LA63 == 79:
- alt63 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 1, self.input)
-
- raise nvae
-
- elif ((IDENTIFIER <= LA63_0 <= FLOATING_POINT_LITERAL) or LA63_0 == 66 or (68 <= LA63_0 <= 69) or (72 <= LA63_0 <= 74) or (77 <= LA63_0 <= 79)) :
- alt63 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 0, self.input)
-
- raise nvae
-
- if alt63 == 1:
- # C.g:386:4: '(' type_name ')' cast_expression
- self.match(self.input, 62, self.FOLLOW_62_in_cast_expression1282)
- if self.failed:
- return
- self.following.append(self.FOLLOW_type_name_in_cast_expression1284)
- self.type_name()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_cast_expression1286)
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_cast_expression1288)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt63 == 2:
- # C.g:387:4: unary_expression
- self.following.append(self.FOLLOW_unary_expression_in_cast_expression1293)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 39, cast_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end cast_expression
-
-
- # $ANTLR start unary_expression
- # C.g:390:1: unary_expression : ( postfix_expression | '++' unary_expression | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );
- def unary_expression(self, ):
-
- unary_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 40):
- return
-
- # C.g:391:2: ( postfix_expression | '++' unary_expression | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' )
- alt64 = 6
- LA64 = self.input.LA(1)
- if LA64 == IDENTIFIER or LA64 == HEX_LITERAL or LA64 == OCTAL_LITERAL or LA64 == DECIMAL_LITERAL or LA64 == CHARACTER_LITERAL or LA64 == STRING_LITERAL or LA64 == FLOATING_POINT_LITERAL or LA64 == 62:
- alt64 = 1
- elif LA64 == 72:
- alt64 = 2
- elif LA64 == 73:
- alt64 = 3
- elif LA64 == 66 or LA64 == 68 or LA64 == 69 or LA64 == 77 or LA64 == 78 or LA64 == 79:
- alt64 = 4
- elif LA64 == 74:
- LA64_12 = self.input.LA(2)
-
- if (LA64_12 == 62) :
- LA64_13 = self.input.LA(3)
-
- if (self.synpred114()) :
- alt64 = 5
- elif (True) :
- alt64 = 6
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("390:1: unary_expression : ( postfix_expression | '++' unary_expression | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 64, 13, self.input)
-
- raise nvae
-
- elif ((IDENTIFIER <= LA64_12 <= FLOATING_POINT_LITERAL) or LA64_12 == 66 or (68 <= LA64_12 <= 69) or (72 <= LA64_12 <= 74) or (77 <= LA64_12 <= 79)) :
- alt64 = 5
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("390:1: unary_expression : ( postfix_expression | '++' unary_expression | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 64, 12, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("390:1: unary_expression : ( postfix_expression | '++' unary_expression | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 64, 0, self.input)
-
- raise nvae
-
- if alt64 == 1:
- # C.g:391:4: postfix_expression
- self.following.append(self.FOLLOW_postfix_expression_in_unary_expression1304)
- self.postfix_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt64 == 2:
- # C.g:392:4: '++' unary_expression
- self.match(self.input, 72, self.FOLLOW_72_in_unary_expression1309)
- if self.failed:
- return
- self.following.append(self.FOLLOW_unary_expression_in_unary_expression1311)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt64 == 3:
- # C.g:393:4: '--' unary_expression
- self.match(self.input, 73, self.FOLLOW_73_in_unary_expression1316)
- if self.failed:
- return
- self.following.append(self.FOLLOW_unary_expression_in_unary_expression1318)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt64 == 4:
- # C.g:394:4: unary_operator cast_expression
- self.following.append(self.FOLLOW_unary_operator_in_unary_expression1323)
- self.unary_operator()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_unary_expression1325)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt64 == 5:
- # C.g:395:4: 'sizeof' unary_expression
- self.match(self.input, 74, self.FOLLOW_74_in_unary_expression1330)
- if self.failed:
- return
- self.following.append(self.FOLLOW_unary_expression_in_unary_expression1332)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt64 == 6:
- # C.g:396:4: 'sizeof' '(' type_name ')'
- self.match(self.input, 74, self.FOLLOW_74_in_unary_expression1337)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_unary_expression1339)
- if self.failed:
- return
- self.following.append(self.FOLLOW_type_name_in_unary_expression1341)
- self.type_name()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_unary_expression1343)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 40, unary_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end unary_expression
-
-
- # $ANTLR start postfix_expression
- # C.g:399:1: postfix_expression : p= primary_expression ( '[' expression ']' | '(' a= ')' | '(' c= argument_expression_list b= ')' | '(' macro_parameter_list ')' | '.' x= IDENTIFIER | '*' y= IDENTIFIER | '->' z= IDENTIFIER | '++' | '--' )* ;
- def postfix_expression(self, ):
- self.postfix_expression_stack.append(postfix_expression_scope())
- postfix_expression_StartIndex = self.input.index()
- a = None
- b = None
- x = None
- y = None
- z = None
- p = None
-
- c = None
-
-
-
- self.postfix_expression_stack[-1].FuncCallText = ''
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 41):
- return
-
- # C.g:406:2: (p= primary_expression ( '[' expression ']' | '(' a= ')' | '(' c= argument_expression_list b= ')' | '(' macro_parameter_list ')' | '.' x= IDENTIFIER | '*' y= IDENTIFIER | '->' z= IDENTIFIER | '++' | '--' )* )
- # C.g:406:6: p= primary_expression ( '[' expression ']' | '(' a= ')' | '(' c= argument_expression_list b= ')' | '(' macro_parameter_list ')' | '.' x= IDENTIFIER | '*' y= IDENTIFIER | '->' z= IDENTIFIER | '++' | '--' )*
- self.following.append(self.FOLLOW_primary_expression_in_postfix_expression1367)
- p = self.primary_expression()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
- self.postfix_expression_stack[-1].FuncCallText += self.input.toString(p.start,p.stop)
-
- # C.g:407:9: ( '[' expression ']' | '(' a= ')' | '(' c= argument_expression_list b= ')' | '(' macro_parameter_list ')' | '.' x= IDENTIFIER | '*' y= IDENTIFIER | '->' z= IDENTIFIER | '++' | '--' )*
- while True: #loop65
- alt65 = 10
- LA65 = self.input.LA(1)
- if LA65 == 66:
- LA65_1 = self.input.LA(2)
-
- if (LA65_1 == IDENTIFIER) :
- LA65_30 = self.input.LA(3)
-
- if (self.synpred120()) :
- alt65 = 6
-
-
-
-
- elif LA65 == 64:
- alt65 = 1
- elif LA65 == 62:
- LA65 = self.input.LA(2)
- if LA65 == 63:
- alt65 = 2
- elif LA65 == 29 or LA65 == 30 or LA65 == 31 or LA65 == 32 or LA65 == 33 or LA65 == 34 or LA65 == 35 or LA65 == 36 or LA65 == 37 or LA65 == 38 or LA65 == 39 or LA65 == 40 or LA65 == 41 or LA65 == 42 or LA65 == 45 or LA65 == 46 or LA65 == 48 or LA65 == 49 or LA65 == 50 or LA65 == 51 or LA65 == 52 or LA65 == 53 or LA65 == 54 or LA65 == 55 or LA65 == 56 or LA65 == 57 or LA65 == 58 or LA65 == 59 or LA65 == 60 or LA65 == 61:
- alt65 = 4
- elif LA65 == IDENTIFIER:
- LA65_55 = self.input.LA(3)
-
- if (self.synpred117()) :
- alt65 = 3
- elif (self.synpred118()) :
- alt65 = 4
-
-
- elif LA65 == 66:
- LA65_57 = self.input.LA(3)
-
- if (self.synpred117()) :
- alt65 = 3
- elif (self.synpred118()) :
- alt65 = 4
-
-
- elif LA65 == HEX_LITERAL or LA65 == OCTAL_LITERAL or LA65 == DECIMAL_LITERAL or LA65 == CHARACTER_LITERAL or LA65 == STRING_LITERAL or LA65 == FLOATING_POINT_LITERAL or LA65 == 62 or LA65 == 68 or LA65 == 69 or LA65 == 72 or LA65 == 73 or LA65 == 74 or LA65 == 77 or LA65 == 78 or LA65 == 79:
- alt65 = 3
-
- elif LA65 == 75:
- alt65 = 5
- elif LA65 == 76:
- alt65 = 7
- elif LA65 == 72:
- alt65 = 8
- elif LA65 == 73:
- alt65 = 9
-
- if alt65 == 1:
- # C.g:407:13: '[' expression ']'
- self.match(self.input, 64, self.FOLLOW_64_in_postfix_expression1383)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_postfix_expression1385)
- self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 65, self.FOLLOW_65_in_postfix_expression1387)
- if self.failed:
- return
-
-
- elif alt65 == 2:
- # C.g:408:13: '(' a= ')'
- self.match(self.input, 62, self.FOLLOW_62_in_postfix_expression1401)
- if self.failed:
- return
- a = self.input.LT(1)
- self.match(self.input, 63, self.FOLLOW_63_in_postfix_expression1405)
- if self.failed:
- return
- if self.backtracking == 0:
- self.StoreFunctionCalling(p.start.line, p.start.charPositionInLine, a.line, a.charPositionInLine, self.postfix_expression_stack[-1].FuncCallText, '')
-
-
-
- elif alt65 == 3:
- # C.g:409:13: '(' c= argument_expression_list b= ')'
- self.match(self.input, 62, self.FOLLOW_62_in_postfix_expression1420)
- if self.failed:
- return
- self.following.append(self.FOLLOW_argument_expression_list_in_postfix_expression1424)
- c = self.argument_expression_list()
- self.following.pop()
- if self.failed:
- return
- b = self.input.LT(1)
- self.match(self.input, 63, self.FOLLOW_63_in_postfix_expression1428)
- if self.failed:
- return
- if self.backtracking == 0:
- self.StoreFunctionCalling(p.start.line, p.start.charPositionInLine, b.line, b.charPositionInLine, self.postfix_expression_stack[-1].FuncCallText, self.input.toString(c.start,c.stop))
-
-
-
- elif alt65 == 4:
- # C.g:410:13: '(' macro_parameter_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_postfix_expression1444)
- if self.failed:
- return
- self.following.append(self.FOLLOW_macro_parameter_list_in_postfix_expression1446)
- self.macro_parameter_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_postfix_expression1448)
- if self.failed:
- return
-
-
- elif alt65 == 5:
- # C.g:411:13: '.' x= IDENTIFIER
- self.match(self.input, 75, self.FOLLOW_75_in_postfix_expression1462)
- if self.failed:
- return
- x = self.input.LT(1)
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_postfix_expression1466)
- if self.failed:
- return
- if self.backtracking == 0:
- self.postfix_expression_stack[-1].FuncCallText += '.' + x.text
-
-
-
- elif alt65 == 6:
- # C.g:412:13: '*' y= IDENTIFIER
- self.match(self.input, 66, self.FOLLOW_66_in_postfix_expression1482)
- if self.failed:
- return
- y = self.input.LT(1)
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_postfix_expression1486)
- if self.failed:
- return
- if self.backtracking == 0:
- self.postfix_expression_stack[-1].FuncCallText = y.text
-
-
-
- elif alt65 == 7:
- # C.g:413:13: '->' z= IDENTIFIER
- self.match(self.input, 76, self.FOLLOW_76_in_postfix_expression1502)
- if self.failed:
- return
- z = self.input.LT(1)
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_postfix_expression1506)
- if self.failed:
- return
- if self.backtracking == 0:
- self.postfix_expression_stack[-1].FuncCallText += '->' + z.text
-
-
-
- elif alt65 == 8:
- # C.g:414:13: '++'
- self.match(self.input, 72, self.FOLLOW_72_in_postfix_expression1522)
- if self.failed:
- return
-
-
- elif alt65 == 9:
- # C.g:415:13: '--'
- self.match(self.input, 73, self.FOLLOW_73_in_postfix_expression1536)
- if self.failed:
- return
-
-
- else:
- break #loop65
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 41, postfix_expression_StartIndex)
-
- self.postfix_expression_stack.pop()
- pass
-
- return
-
- # $ANTLR end postfix_expression
-
-
- # $ANTLR start macro_parameter_list
- # C.g:419:1: macro_parameter_list : parameter_declaration ( ',' parameter_declaration )* ;
- def macro_parameter_list(self, ):
-
- macro_parameter_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 42):
- return
-
- # C.g:420:2: ( parameter_declaration ( ',' parameter_declaration )* )
- # C.g:420:4: parameter_declaration ( ',' parameter_declaration )*
- self.following.append(self.FOLLOW_parameter_declaration_in_macro_parameter_list1559)
- self.parameter_declaration()
- self.following.pop()
- if self.failed:
- return
- # C.g:420:26: ( ',' parameter_declaration )*
- while True: #loop66
- alt66 = 2
- LA66_0 = self.input.LA(1)
-
- if (LA66_0 == 27) :
- alt66 = 1
-
-
- if alt66 == 1:
- # C.g:420:27: ',' parameter_declaration
- self.match(self.input, 27, self.FOLLOW_27_in_macro_parameter_list1562)
- if self.failed:
- return
- self.following.append(self.FOLLOW_parameter_declaration_in_macro_parameter_list1564)
- self.parameter_declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop66
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 42, macro_parameter_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end macro_parameter_list
-
-
- # $ANTLR start unary_operator
- # C.g:423:1: unary_operator : ( '&' | '*' | '+' | '-' | '~' | '!' );
- def unary_operator(self, ):
-
- unary_operator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 43):
- return
-
- # C.g:424:2: ( '&' | '*' | '+' | '-' | '~' | '!' )
- # C.g:
- if self.input.LA(1) == 66 or (68 <= self.input.LA(1) <= 69) or (77 <= self.input.LA(1) <= 79):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_unary_operator0
- )
- raise mse
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 43, unary_operator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end unary_operator
-
- class primary_expression_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start primary_expression
- # C.g:432:1: primary_expression : ( IDENTIFIER | constant | '(' expression ')' );
- def primary_expression(self, ):
-
- retval = self.primary_expression_return()
- retval.start = self.input.LT(1)
- primary_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 44):
- return retval
-
- # C.g:433:2: ( IDENTIFIER | constant | '(' expression ')' )
- alt67 = 3
- LA67 = self.input.LA(1)
- if LA67 == IDENTIFIER:
- LA67_1 = self.input.LA(2)
-
- if (LA67_1 == EOF or LA67_1 == 25 or (27 <= LA67_1 <= 28) or LA67_1 == 44 or LA67_1 == 47 or LA67_1 == 53 or (62 <= LA67_1 <= 66) or (68 <= LA67_1 <= 73) or (75 <= LA67_1 <= 77) or (80 <= LA67_1 <= 102)) :
- alt67 = 1
- elif (LA67_1 == IDENTIFIER or LA67_1 == STRING_LITERAL) :
- alt67 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("432:1: primary_expression : ( IDENTIFIER | constant | '(' expression ')' );", 67, 1, self.input)
-
- raise nvae
-
- elif LA67 == HEX_LITERAL or LA67 == OCTAL_LITERAL or LA67 == DECIMAL_LITERAL or LA67 == CHARACTER_LITERAL or LA67 == STRING_LITERAL or LA67 == FLOATING_POINT_LITERAL:
- alt67 = 2
- elif LA67 == 62:
- alt67 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("432:1: primary_expression : ( IDENTIFIER | constant | '(' expression ')' );", 67, 0, self.input)
-
- raise nvae
-
- if alt67 == 1:
- # C.g:433:4: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_primary_expression1613)
- if self.failed:
- return retval
-
-
- elif alt67 == 2:
- # C.g:434:4: constant
- self.following.append(self.FOLLOW_constant_in_primary_expression1618)
- self.constant()
- self.following.pop()
- if self.failed:
- return retval
-
-
- elif alt67 == 3:
- # C.g:435:4: '(' expression ')'
- self.match(self.input, 62, self.FOLLOW_62_in_primary_expression1623)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_expression_in_primary_expression1625)
- self.expression()
- self.following.pop()
- if self.failed:
- return retval
- self.match(self.input, 63, self.FOLLOW_63_in_primary_expression1627)
- if self.failed:
- return retval
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 44, primary_expression_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end primary_expression
-
-
- # $ANTLR start constant
- # C.g:438:1: constant : ( HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITERAL | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIFIER )* | FLOATING_POINT_LITERAL );
- def constant(self, ):
-
- constant_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 45):
- return
-
- # C.g:439:5: ( HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITERAL | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIFIER )* | FLOATING_POINT_LITERAL )
- alt72 = 6
- LA72 = self.input.LA(1)
- if LA72 == HEX_LITERAL:
- alt72 = 1
- elif LA72 == OCTAL_LITERAL:
- alt72 = 2
- elif LA72 == DECIMAL_LITERAL:
- alt72 = 3
- elif LA72 == CHARACTER_LITERAL:
- alt72 = 4
- elif LA72 == IDENTIFIER or LA72 == STRING_LITERAL:
- alt72 = 5
- elif LA72 == FLOATING_POINT_LITERAL:
- alt72 = 6
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("438:1: constant : ( HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITERAL | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIFIER )* | FLOATING_POINT_LITERAL );", 72, 0, self.input)
-
- raise nvae
-
- if alt72 == 1:
- # C.g:439:9: HEX_LITERAL
- self.match(self.input, HEX_LITERAL, self.FOLLOW_HEX_LITERAL_in_constant1643)
- if self.failed:
- return
-
-
- elif alt72 == 2:
- # C.g:440:9: OCTAL_LITERAL
- self.match(self.input, OCTAL_LITERAL, self.FOLLOW_OCTAL_LITERAL_in_constant1653)
- if self.failed:
- return
-
-
- elif alt72 == 3:
- # C.g:441:9: DECIMAL_LITERAL
- self.match(self.input, DECIMAL_LITERAL, self.FOLLOW_DECIMAL_LITERAL_in_constant1663)
- if self.failed:
- return
-
-
- elif alt72 == 4:
- # C.g:442:7: CHARACTER_LITERAL
- self.match(self.input, CHARACTER_LITERAL, self.FOLLOW_CHARACTER_LITERAL_in_constant1671)
- if self.failed:
- return
-
-
- elif alt72 == 5:
- # C.g:443:7: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIFIER )*
- # C.g:443:7: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+
- cnt70 = 0
- while True: #loop70
- alt70 = 2
- LA70_0 = self.input.LA(1)
-
- if (LA70_0 == IDENTIFIER) :
- LA70_1 = self.input.LA(2)
-
- if (LA70_1 == STRING_LITERAL) :
- alt70 = 1
- elif (LA70_1 == IDENTIFIER) :
- LA70_33 = self.input.LA(3)
-
- if (self.synpred138()) :
- alt70 = 1
-
-
-
-
- elif (LA70_0 == STRING_LITERAL) :
- alt70 = 1
-
-
- if alt70 == 1:
- # C.g:443:8: ( IDENTIFIER )* ( STRING_LITERAL )+
- # C.g:443:8: ( IDENTIFIER )*
- while True: #loop68
- alt68 = 2
- LA68_0 = self.input.LA(1)
-
- if (LA68_0 == IDENTIFIER) :
- alt68 = 1
-
-
- if alt68 == 1:
- # C.g:0:0: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_constant1680)
- if self.failed:
- return
-
-
- else:
- break #loop68
-
-
- # C.g:443:20: ( STRING_LITERAL )+
- cnt69 = 0
- while True: #loop69
- alt69 = 2
- LA69_0 = self.input.LA(1)
-
- if (LA69_0 == STRING_LITERAL) :
- LA69_31 = self.input.LA(2)
-
- if (self.synpred137()) :
- alt69 = 1
-
-
-
-
- if alt69 == 1:
- # C.g:0:0: STRING_LITERAL
- self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_LITERAL_in_constant1683)
- if self.failed:
- return
-
-
- else:
- if cnt69 >= 1:
- break #loop69
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(69, self.input)
- raise eee
-
- cnt69 += 1
-
-
-
-
- else:
- if cnt70 >= 1:
- break #loop70
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(70, self.input)
- raise eee
-
- cnt70 += 1
-
-
- # C.g:443:38: ( IDENTIFIER )*
- while True: #loop71
- alt71 = 2
- LA71_0 = self.input.LA(1)
-
- if (LA71_0 == IDENTIFIER) :
- alt71 = 1
-
-
- if alt71 == 1:
- # C.g:0:0: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_constant1688)
- if self.failed:
- return
-
-
- else:
- break #loop71
-
-
-
-
- elif alt72 == 6:
- # C.g:444:9: FLOATING_POINT_LITERAL
- self.match(self.input, FLOATING_POINT_LITERAL, self.FOLLOW_FLOATING_POINT_LITERAL_in_constant1699)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 45, constant_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end constant
-
- class expression_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start expression
- # C.g:449:1: expression : assignment_expression ( ',' assignment_expression )* ;
- def expression(self, ):
-
- retval = self.expression_return()
- retval.start = self.input.LT(1)
- expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 46):
- return retval
-
- # C.g:450:2: ( assignment_expression ( ',' assignment_expression )* )
- # C.g:450:4: assignment_expression ( ',' assignment_expression )*
- self.following.append(self.FOLLOW_assignment_expression_in_expression1715)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:450:26: ( ',' assignment_expression )*
- while True: #loop73
- alt73 = 2
- LA73_0 = self.input.LA(1)
-
- if (LA73_0 == 27) :
- alt73 = 1
-
-
- if alt73 == 1:
- # C.g:450:27: ',' assignment_expression
- self.match(self.input, 27, self.FOLLOW_27_in_expression1718)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_assignment_expression_in_expression1720)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- break #loop73
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 46, expression_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end expression
-
-
- # $ANTLR start constant_expression
- # C.g:453:1: constant_expression : conditional_expression ;
- def constant_expression(self, ):
-
- constant_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 47):
- return
-
- # C.g:454:2: ( conditional_expression )
- # C.g:454:4: conditional_expression
- self.following.append(self.FOLLOW_conditional_expression_in_constant_expression1733)
- self.conditional_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 47, constant_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end constant_expression
-
-
- # $ANTLR start assignment_expression
- # C.g:457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );
- def assignment_expression(self, ):
-
- assignment_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 48):
- return
-
- # C.g:458:2: ( lvalue assignment_operator assignment_expression | conditional_expression )
- alt74 = 2
- LA74 = self.input.LA(1)
- if LA74 == IDENTIFIER:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_13 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 13, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_14 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 14, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_15 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 15, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_16 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 16, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_17 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 17, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_18 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 18, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_19 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 19, self.input)
-
- raise nvae
-
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- elif LA74 == STRING_LITERAL:
- LA74_21 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 21, self.input)
-
- raise nvae
-
- elif LA74 == IDENTIFIER:
- LA74_22 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 22, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 1, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_44 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 44, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_45 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 45, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_46 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 46, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_47 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 47, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_48 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 48, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_49 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 49, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_50 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 50, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 2, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_73 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 73, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_74 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 74, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_75 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 75, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_76 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 76, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_77 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 77, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_78 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 78, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_79 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 79, self.input)
-
- raise nvae
-
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 3, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_102 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 102, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_103 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 103, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_104 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 104, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_105 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 105, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_106 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 106, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_107 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 107, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_108 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 108, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 4, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_131 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 131, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_132 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 132, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_133 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 133, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_134 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 134, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_135 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 135, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_136 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 136, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_137 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 137, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 5, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == IDENTIFIER:
- LA74_160 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 160, self.input)
-
- raise nvae
-
- elif LA74 == 64:
- LA74_161 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 161, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_162 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 162, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_163 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 163, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_164 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 164, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_165 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 165, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_166 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 166, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_167 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 167, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- elif LA74 == STRING_LITERAL:
- LA74_189 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 189, self.input)
-
- raise nvae
-
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 6, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_191 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 191, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_192 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 192, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_193 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 193, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_194 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 194, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_195 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 195, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_196 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 196, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_197 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 197, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 7, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74 = self.input.LA(2)
- if LA74 == IDENTIFIER:
- LA74_220 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 220, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74_221 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 221, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74_222 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 222, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74_223 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 223, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74_224 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 224, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74_225 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 225, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74_226 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 226, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_227 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 227, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_228 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 228, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_229 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 229, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74_230 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 230, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74_231 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 231, self.input)
-
- raise nvae
-
- elif LA74 == 34 or LA74 == 35 or LA74 == 36 or LA74 == 37 or LA74 == 38 or LA74 == 39 or LA74 == 40 or LA74 == 41 or LA74 == 42 or LA74 == 45 or LA74 == 46 or LA74 == 48 or LA74 == 49 or LA74 == 50 or LA74 == 51 or LA74 == 52 or LA74 == 53 or LA74 == 54 or LA74 == 55 or LA74 == 56 or LA74 == 57 or LA74 == 58 or LA74 == 59 or LA74 == 60 or LA74 == 61:
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 8, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74 = self.input.LA(2)
- if LA74 == IDENTIFIER:
- LA74_244 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 244, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74_245 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 245, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74_246 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 246, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74_247 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 247, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74_248 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 248, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74_249 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 249, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74_250 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 250, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_251 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 251, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_252 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 252, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_253 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 253, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74_254 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 254, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74_255 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 255, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 9, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74 = self.input.LA(2)
- if LA74 == IDENTIFIER:
- LA74_256 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 256, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74_257 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 257, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74_258 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 258, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74_259 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 259, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74_260 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 260, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74_261 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 261, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74_262 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 262, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_263 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 263, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_264 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 264, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_265 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 265, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74_266 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 266, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74_267 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 267, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 10, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74 = self.input.LA(2)
- if LA74 == 62:
- LA74_268 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 268, self.input)
-
- raise nvae
-
- elif LA74 == IDENTIFIER:
- LA74_269 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 269, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74_270 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 270, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74_271 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 271, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74_272 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 272, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74_273 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 273, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74_274 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 274, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74_275 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 275, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_276 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 276, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_277 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 277, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74_278 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 278, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74_279 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 279, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 11, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74 = self.input.LA(2)
- if LA74 == 62:
- LA74_280 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 280, self.input)
-
- raise nvae
-
- elif LA74 == IDENTIFIER:
- LA74_281 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 281, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74_282 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 282, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74_283 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 283, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74_284 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 284, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74_285 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 285, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74_286 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 286, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74_287 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 287, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_288 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 288, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_289 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 289, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74_290 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 290, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74_291 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 291, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 12, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 0, self.input)
-
- raise nvae
-
- if alt74 == 1:
- # C.g:458:4: lvalue assignment_operator assignment_expression
- self.following.append(self.FOLLOW_lvalue_in_assignment_expression1744)
- self.lvalue()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_assignment_operator_in_assignment_expression1746)
- self.assignment_operator()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_assignment_expression_in_assignment_expression1748)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt74 == 2:
- # C.g:459:4: conditional_expression
- self.following.append(self.FOLLOW_conditional_expression_in_assignment_expression1753)
- self.conditional_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 48, assignment_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end assignment_expression
-
-
- # $ANTLR start lvalue
- # C.g:462:1: lvalue : unary_expression ;
- def lvalue(self, ):
-
- lvalue_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 49):
- return
-
- # C.g:463:2: ( unary_expression )
- # C.g:463:4: unary_expression
- self.following.append(self.FOLLOW_unary_expression_in_lvalue1765)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 49, lvalue_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end lvalue
-
-
- # $ANTLR start assignment_operator
- # C.g:466:1: assignment_operator : ( '=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '&=' | '^=' | '|=' );
- def assignment_operator(self, ):
-
- assignment_operator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 50):
- return
-
- # C.g:467:2: ( '=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '&=' | '^=' | '|=' )
- # C.g:
- if self.input.LA(1) == 28 or (80 <= self.input.LA(1) <= 89):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_assignment_operator0
- )
- raise mse
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 50, assignment_operator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end assignment_operator
-
-
- # $ANTLR start conditional_expression
- # C.g:480:1: conditional_expression : e= logical_or_expression ( '?' expression ':' conditional_expression )? ;
- def conditional_expression(self, ):
-
- conditional_expression_StartIndex = self.input.index()
- e = None
-
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 51):
- return
-
- # C.g:481:2: (e= logical_or_expression ( '?' expression ':' conditional_expression )? )
- # C.g:481:4: e= logical_or_expression ( '?' expression ':' conditional_expression )?
- self.following.append(self.FOLLOW_logical_or_expression_in_conditional_expression1839)
- e = self.logical_or_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:481:28: ( '?' expression ':' conditional_expression )?
- alt75 = 2
- LA75_0 = self.input.LA(1)
-
- if (LA75_0 == 90) :
- alt75 = 1
- if alt75 == 1:
- # C.g:481:29: '?' expression ':' conditional_expression
- self.match(self.input, 90, self.FOLLOW_90_in_conditional_expression1842)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_conditional_expression1844)
- self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 47, self.FOLLOW_47_in_conditional_expression1846)
- if self.failed:
- return
- self.following.append(self.FOLLOW_conditional_expression_in_conditional_expression1848)
- self.conditional_expression()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
- self.StorePredicateExpression(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
-
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 51, conditional_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end conditional_expression
-
- class logical_or_expression_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start logical_or_expression
- # C.g:484:1: logical_or_expression : logical_and_expression ( '||' logical_and_expression )* ;
- def logical_or_expression(self, ):
-
- retval = self.logical_or_expression_return()
- retval.start = self.input.LT(1)
- logical_or_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 52):
- return retval
-
- # C.g:485:2: ( logical_and_expression ( '||' logical_and_expression )* )
- # C.g:485:4: logical_and_expression ( '||' logical_and_expression )*
- self.following.append(self.FOLLOW_logical_and_expression_in_logical_or_expression1863)
- self.logical_and_expression()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:485:27: ( '||' logical_and_expression )*
- while True: #loop76
- alt76 = 2
- LA76_0 = self.input.LA(1)
-
- if (LA76_0 == 91) :
- alt76 = 1
-
-
- if alt76 == 1:
- # C.g:485:28: '||' logical_and_expression
- self.match(self.input, 91, self.FOLLOW_91_in_logical_or_expression1866)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_logical_and_expression_in_logical_or_expression1868)
- self.logical_and_expression()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- break #loop76
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 52, logical_or_expression_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end logical_or_expression
-
-
- # $ANTLR start logical_and_expression
- # C.g:488:1: logical_and_expression : inclusive_or_expression ( '&&' inclusive_or_expression )* ;
- def logical_and_expression(self, ):
-
- logical_and_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 53):
- return
-
- # C.g:489:2: ( inclusive_or_expression ( '&&' inclusive_or_expression )* )
- # C.g:489:4: inclusive_or_expression ( '&&' inclusive_or_expression )*
- self.following.append(self.FOLLOW_inclusive_or_expression_in_logical_and_expression1881)
- self.inclusive_or_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:489:28: ( '&&' inclusive_or_expression )*
- while True: #loop77
- alt77 = 2
- LA77_0 = self.input.LA(1)
-
- if (LA77_0 == 92) :
- alt77 = 1
-
-
- if alt77 == 1:
- # C.g:489:29: '&&' inclusive_or_expression
- self.match(self.input, 92, self.FOLLOW_92_in_logical_and_expression1884)
- if self.failed:
- return
- self.following.append(self.FOLLOW_inclusive_or_expression_in_logical_and_expression1886)
- self.inclusive_or_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop77
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 53, logical_and_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end logical_and_expression
-
-
- # $ANTLR start inclusive_or_expression
- # C.g:492:1: inclusive_or_expression : exclusive_or_expression ( '|' exclusive_or_expression )* ;
- def inclusive_or_expression(self, ):
-
- inclusive_or_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 54):
- return
-
- # C.g:493:2: ( exclusive_or_expression ( '|' exclusive_or_expression )* )
- # C.g:493:4: exclusive_or_expression ( '|' exclusive_or_expression )*
- self.following.append(self.FOLLOW_exclusive_or_expression_in_inclusive_or_expression1899)
- self.exclusive_or_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:493:28: ( '|' exclusive_or_expression )*
- while True: #loop78
- alt78 = 2
- LA78_0 = self.input.LA(1)
-
- if (LA78_0 == 93) :
- alt78 = 1
-
-
- if alt78 == 1:
- # C.g:493:29: '|' exclusive_or_expression
- self.match(self.input, 93, self.FOLLOW_93_in_inclusive_or_expression1902)
- if self.failed:
- return
- self.following.append(self.FOLLOW_exclusive_or_expression_in_inclusive_or_expression1904)
- self.exclusive_or_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop78
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 54, inclusive_or_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end inclusive_or_expression
-
-
- # $ANTLR start exclusive_or_expression
- # C.g:496:1: exclusive_or_expression : and_expression ( '^' and_expression )* ;
- def exclusive_or_expression(self, ):
-
- exclusive_or_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 55):
- return
-
- # C.g:497:2: ( and_expression ( '^' and_expression )* )
- # C.g:497:4: and_expression ( '^' and_expression )*
- self.following.append(self.FOLLOW_and_expression_in_exclusive_or_expression1917)
- self.and_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:497:19: ( '^' and_expression )*
- while True: #loop79
- alt79 = 2
- LA79_0 = self.input.LA(1)
-
- if (LA79_0 == 94) :
- alt79 = 1
-
-
- if alt79 == 1:
- # C.g:497:20: '^' and_expression
- self.match(self.input, 94, self.FOLLOW_94_in_exclusive_or_expression1920)
- if self.failed:
- return
- self.following.append(self.FOLLOW_and_expression_in_exclusive_or_expression1922)
- self.and_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop79
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 55, exclusive_or_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end exclusive_or_expression
-
-
- # $ANTLR start and_expression
- # C.g:500:1: and_expression : equality_expression ( '&' equality_expression )* ;
- def and_expression(self, ):
-
- and_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 56):
- return
-
- # C.g:501:2: ( equality_expression ( '&' equality_expression )* )
- # C.g:501:4: equality_expression ( '&' equality_expression )*
- self.following.append(self.FOLLOW_equality_expression_in_and_expression1935)
- self.equality_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:501:24: ( '&' equality_expression )*
- while True: #loop80
- alt80 = 2
- LA80_0 = self.input.LA(1)
-
- if (LA80_0 == 77) :
- alt80 = 1
-
-
- if alt80 == 1:
- # C.g:501:25: '&' equality_expression
- self.match(self.input, 77, self.FOLLOW_77_in_and_expression1938)
- if self.failed:
- return
- self.following.append(self.FOLLOW_equality_expression_in_and_expression1940)
- self.equality_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop80
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 56, and_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end and_expression
-
-
- # $ANTLR start equality_expression
- # C.g:503:1: equality_expression : relational_expression ( ( '==' | '!=' ) relational_expression )* ;
- def equality_expression(self, ):
-
- equality_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 57):
- return
-
- # C.g:504:2: ( relational_expression ( ( '==' | '!=' ) relational_expression )* )
- # C.g:504:4: relational_expression ( ( '==' | '!=' ) relational_expression )*
- self.following.append(self.FOLLOW_relational_expression_in_equality_expression1952)
- self.relational_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:504:26: ( ( '==' | '!=' ) relational_expression )*
- while True: #loop81
- alt81 = 2
- LA81_0 = self.input.LA(1)
-
- if ((95 <= LA81_0 <= 96)) :
- alt81 = 1
-
-
- if alt81 == 1:
- # C.g:504:27: ( '==' | '!=' ) relational_expression
- if (95 <= self.input.LA(1) <= 96):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_equality_expression1955
- )
- raise mse
-
-
- self.following.append(self.FOLLOW_relational_expression_in_equality_expression1961)
- self.relational_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop81
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 57, equality_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end equality_expression
-
-
- # $ANTLR start relational_expression
- # C.g:507:1: relational_expression : shift_expression ( ( '<' | '>' | '<=' | '>=' ) shift_expression )* ;
- def relational_expression(self, ):
-
- relational_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 58):
- return
-
- # C.g:508:2: ( shift_expression ( ( '<' | '>' | '<=' | '>=' ) shift_expression )* )
- # C.g:508:4: shift_expression ( ( '<' | '>' | '<=' | '>=' ) shift_expression )*
- self.following.append(self.FOLLOW_shift_expression_in_relational_expression1975)
- self.shift_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:508:21: ( ( '<' | '>' | '<=' | '>=' ) shift_expression )*
- while True: #loop82
- alt82 = 2
- LA82_0 = self.input.LA(1)
-
- if ((97 <= LA82_0 <= 100)) :
- alt82 = 1
-
-
- if alt82 == 1:
- # C.g:508:22: ( '<' | '>' | '<=' | '>=' ) shift_expression
- if (97 <= self.input.LA(1) <= 100):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_relational_expression1978
- )
- raise mse
-
-
- self.following.append(self.FOLLOW_shift_expression_in_relational_expression1988)
- self.shift_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop82
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 58, relational_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end relational_expression
-
-
- # $ANTLR start shift_expression
- # C.g:511:1: shift_expression : additive_expression ( ( '<<' | '>>' ) additive_expression )* ;
- def shift_expression(self, ):
-
- shift_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 59):
- return
-
- # C.g:512:2: ( additive_expression ( ( '<<' | '>>' ) additive_expression )* )
- # C.g:512:4: additive_expression ( ( '<<' | '>>' ) additive_expression )*
- self.following.append(self.FOLLOW_additive_expression_in_shift_expression2001)
- self.additive_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:512:24: ( ( '<<' | '>>' ) additive_expression )*
- while True: #loop83
- alt83 = 2
- LA83_0 = self.input.LA(1)
-
- if ((101 <= LA83_0 <= 102)) :
- alt83 = 1
-
-
- if alt83 == 1:
- # C.g:512:25: ( '<<' | '>>' ) additive_expression
- if (101 <= self.input.LA(1) <= 102):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_shift_expression2004
- )
- raise mse
-
-
- self.following.append(self.FOLLOW_additive_expression_in_shift_expression2010)
- self.additive_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop83
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 59, shift_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end shift_expression
-
-
- # $ANTLR start statement
- # C.g:517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );
- def statement(self, ):
-
- statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 60):
- return
-
- # C.g:518:2: ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration )
- alt84 = 11
- LA84 = self.input.LA(1)
- if LA84 == IDENTIFIER:
- LA84 = self.input.LA(2)
- if LA84 == 62:
- LA84_43 = self.input.LA(3)
-
- if (self.synpred169()) :
- alt84 = 3
- elif (self.synpred173()) :
- alt84 = 7
- elif (self.synpred174()) :
- alt84 = 8
- elif (True) :
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 43, self.input)
-
- raise nvae
-
- elif LA84 == 47:
- alt84 = 1
- elif LA84 == STRING_LITERAL or LA84 == 27 or LA84 == 28 or LA84 == 64 or LA84 == 68 or LA84 == 69 or LA84 == 70 or LA84 == 71 or LA84 == 72 or LA84 == 73 or LA84 == 75 or LA84 == 76 or LA84 == 77 or LA84 == 80 or LA84 == 81 or LA84 == 82 or LA84 == 83 or LA84 == 84 or LA84 == 85 or LA84 == 86 or LA84 == 87 or LA84 == 88 or LA84 == 89 or LA84 == 90 or LA84 == 91 or LA84 == 92 or LA84 == 93 or LA84 == 94 or LA84 == 95 or LA84 == 96 or LA84 == 97 or LA84 == 98 or LA84 == 99 or LA84 == 100 or LA84 == 101 or LA84 == 102:
- alt84 = 3
- elif LA84 == 66:
- LA84_47 = self.input.LA(3)
-
- if (self.synpred169()) :
- alt84 = 3
- elif (True) :
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 47, self.input)
-
- raise nvae
-
- elif LA84 == IDENTIFIER:
- LA84_53 = self.input.LA(3)
-
- if (self.synpred169()) :
- alt84 = 3
- elif (True) :
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 53, self.input)
-
- raise nvae
-
- elif LA84 == 25:
- LA84_68 = self.input.LA(3)
-
- if (self.synpred169()) :
- alt84 = 3
- elif (True) :
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 68, self.input)
-
- raise nvae
-
- elif LA84 == 29 or LA84 == 30 or LA84 == 31 or LA84 == 32 or LA84 == 33 or LA84 == 34 or LA84 == 35 or LA84 == 36 or LA84 == 37 or LA84 == 38 or LA84 == 39 or LA84 == 40 or LA84 == 41 or LA84 == 42 or LA84 == 45 or LA84 == 46 or LA84 == 48 or LA84 == 49 or LA84 == 50 or LA84 == 51 or LA84 == 52 or LA84 == 53 or LA84 == 54 or LA84 == 55 or LA84 == 56 or LA84 == 57 or LA84 == 58 or LA84 == 59 or LA84 == 60 or LA84 == 61:
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 1, self.input)
-
- raise nvae
-
- elif LA84 == 106 or LA84 == 107:
- alt84 = 1
- elif LA84 == 43:
- alt84 = 2
- elif LA84 == HEX_LITERAL or LA84 == OCTAL_LITERAL or LA84 == DECIMAL_LITERAL or LA84 == CHARACTER_LITERAL or LA84 == STRING_LITERAL or LA84 == FLOATING_POINT_LITERAL or LA84 == 25 or LA84 == 62 or LA84 == 66 or LA84 == 68 or LA84 == 69 or LA84 == 72 or LA84 == 73 or LA84 == 74 or LA84 == 77 or LA84 == 78 or LA84 == 79:
- alt84 = 3
- elif LA84 == 108 or LA84 == 110:
- alt84 = 4
- elif LA84 == 111 or LA84 == 112 or LA84 == 113:
- alt84 = 5
- elif LA84 == 114 or LA84 == 115 or LA84 == 116 or LA84 == 117:
- alt84 = 6
- elif LA84 == 103:
- alt84 = 8
- elif LA84 == 104:
- alt84 = 9
- elif LA84 == 105:
- alt84 = 10
- elif LA84 == 26 or LA84 == 29 or LA84 == 30 or LA84 == 31 or LA84 == 32 or LA84 == 33 or LA84 == 34 or LA84 == 35 or LA84 == 36 or LA84 == 37 or LA84 == 38 or LA84 == 39 or LA84 == 40 or LA84 == 41 or LA84 == 42 or LA84 == 45 or LA84 == 46 or LA84 == 48 or LA84 == 49 or LA84 == 50 or LA84 == 51 or LA84 == 52 or LA84 == 53 or LA84 == 54 or LA84 == 55 or LA84 == 56 or LA84 == 57 or LA84 == 58 or LA84 == 59 or LA84 == 60 or LA84 == 61:
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 0, self.input)
-
- raise nvae
-
- if alt84 == 1:
- # C.g:518:4: labeled_statement
- self.following.append(self.FOLLOW_labeled_statement_in_statement2025)
- self.labeled_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 2:
- # C.g:519:4: compound_statement
- self.following.append(self.FOLLOW_compound_statement_in_statement2030)
- self.compound_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 3:
- # C.g:520:4: expression_statement
- self.following.append(self.FOLLOW_expression_statement_in_statement2035)
- self.expression_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 4:
- # C.g:521:4: selection_statement
- self.following.append(self.FOLLOW_selection_statement_in_statement2040)
- self.selection_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 5:
- # C.g:522:4: iteration_statement
- self.following.append(self.FOLLOW_iteration_statement_in_statement2045)
- self.iteration_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 6:
- # C.g:523:4: jump_statement
- self.following.append(self.FOLLOW_jump_statement_in_statement2050)
- self.jump_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 7:
- # C.g:524:4: macro_statement
- self.following.append(self.FOLLOW_macro_statement_in_statement2055)
- self.macro_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 8:
- # C.g:525:4: asm2_statement
- self.following.append(self.FOLLOW_asm2_statement_in_statement2060)
- self.asm2_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 9:
- # C.g:526:4: asm1_statement
- self.following.append(self.FOLLOW_asm1_statement_in_statement2065)
- self.asm1_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 10:
- # C.g:527:4: asm_statement
- self.following.append(self.FOLLOW_asm_statement_in_statement2070)
- self.asm_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 11:
- # C.g:528:4: declaration
- self.following.append(self.FOLLOW_declaration_in_statement2075)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 60, statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end statement
-
-
- # $ANTLR start asm2_statement
- # C.g:531:1: asm2_statement : ( '__asm__' )? IDENTIFIER '(' (~ ( ';' ) )* ')' ';' ;
- def asm2_statement(self, ):
-
- asm2_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 61):
- return
-
- # C.g:532:2: ( ( '__asm__' )? IDENTIFIER '(' (~ ( ';' ) )* ')' ';' )
- # C.g:532:4: ( '__asm__' )? IDENTIFIER '(' (~ ( ';' ) )* ')' ';'
- # C.g:532:4: ( '__asm__' )?
- alt85 = 2
- LA85_0 = self.input.LA(1)
-
- if (LA85_0 == 103) :
- alt85 = 1
- if alt85 == 1:
- # C.g:0:0: '__asm__'
- self.match(self.input, 103, self.FOLLOW_103_in_asm2_statement2086)
- if self.failed:
- return
-
-
-
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_asm2_statement2089)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_asm2_statement2091)
- if self.failed:
- return
- # C.g:532:30: (~ ( ';' ) )*
- while True: #loop86
- alt86 = 2
- LA86_0 = self.input.LA(1)
-
- if (LA86_0 == 63) :
- LA86_1 = self.input.LA(2)
-
- if ((IDENTIFIER <= LA86_1 <= LINE_COMMAND) or (26 <= LA86_1 <= 117)) :
- alt86 = 1
-
-
- elif ((IDENTIFIER <= LA86_0 <= LINE_COMMAND) or (26 <= LA86_0 <= 62) or (64 <= LA86_0 <= 117)) :
- alt86 = 1
-
-
- if alt86 == 1:
- # C.g:532:31: ~ ( ';' )
- if (IDENTIFIER <= self.input.LA(1) <= LINE_COMMAND) or (26 <= self.input.LA(1) <= 117):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_asm2_statement2094
- )
- raise mse
-
-
-
-
- else:
- break #loop86
-
-
- self.match(self.input, 63, self.FOLLOW_63_in_asm2_statement2101)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_asm2_statement2103)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 61, asm2_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end asm2_statement
-
-
- # $ANTLR start asm1_statement
- # C.g:535:1: asm1_statement : '_asm' '{' (~ ( '}' ) )* '}' ;
- def asm1_statement(self, ):
-
- asm1_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 62):
- return
-
- # C.g:536:2: ( '_asm' '{' (~ ( '}' ) )* '}' )
- # C.g:536:4: '_asm' '{' (~ ( '}' ) )* '}'
- self.match(self.input, 104, self.FOLLOW_104_in_asm1_statement2115)
- if self.failed:
- return
- self.match(self.input, 43, self.FOLLOW_43_in_asm1_statement2117)
- if self.failed:
- return
- # C.g:536:15: (~ ( '}' ) )*
- while True: #loop87
- alt87 = 2
- LA87_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA87_0 <= 43) or (45 <= LA87_0 <= 117)) :
- alt87 = 1
-
-
- if alt87 == 1:
- # C.g:536:16: ~ ( '}' )
- if (IDENTIFIER <= self.input.LA(1) <= 43) or (45 <= self.input.LA(1) <= 117):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_asm1_statement2120
- )
- raise mse
-
-
-
-
- else:
- break #loop87
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_asm1_statement2127)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 62, asm1_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end asm1_statement
-
-
- # $ANTLR start asm_statement
- # C.g:539:1: asm_statement : '__asm' '{' (~ ( '}' ) )* '}' ;
- def asm_statement(self, ):
-
- asm_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 63):
- return
-
- # C.g:540:2: ( '__asm' '{' (~ ( '}' ) )* '}' )
- # C.g:540:4: '__asm' '{' (~ ( '}' ) )* '}'
- self.match(self.input, 105, self.FOLLOW_105_in_asm_statement2138)
- if self.failed:
- return
- self.match(self.input, 43, self.FOLLOW_43_in_asm_statement2140)
- if self.failed:
- return
- # C.g:540:16: (~ ( '}' ) )*
- while True: #loop88
- alt88 = 2
- LA88_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA88_0 <= 43) or (45 <= LA88_0 <= 117)) :
- alt88 = 1
-
-
- if alt88 == 1:
- # C.g:540:17: ~ ( '}' )
- if (IDENTIFIER <= self.input.LA(1) <= 43) or (45 <= self.input.LA(1) <= 117):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_asm_statement2143
- )
- raise mse
-
-
-
-
- else:
- break #loop88
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_asm_statement2150)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 63, asm_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end asm_statement
-
-
- # $ANTLR start macro_statement
- # C.g:543:1: macro_statement : IDENTIFIER '(' ( declaration )* ( statement_list )? ( expression )? ')' ;
- def macro_statement(self, ):
-
- macro_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 64):
- return
-
- # C.g:544:2: ( IDENTIFIER '(' ( declaration )* ( statement_list )? ( expression )? ')' )
- # C.g:544:4: IDENTIFIER '(' ( declaration )* ( statement_list )? ( expression )? ')'
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_macro_statement2162)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_macro_statement2164)
- if self.failed:
- return
- # C.g:544:19: ( declaration )*
- while True: #loop89
- alt89 = 2
- LA89 = self.input.LA(1)
- if LA89 == IDENTIFIER:
- LA89 = self.input.LA(2)
- if LA89 == 62:
- LA89_45 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_47 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 66:
- LA89_50 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_68 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_71 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_72 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_73 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_74 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_75 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_76 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_77 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_78 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_79 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_80 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_81 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_82 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_83 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_84 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_85 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_86 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 26:
- LA89 = self.input.LA(2)
- if LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_87 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_88 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_89 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_90 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_91 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_92 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_93 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_94 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_95 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_96 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_97 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_98 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_99 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_100 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 66:
- LA89_101 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_102 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_103 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_104 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_105 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_106 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_107 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_108 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_109 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_110 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_111 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_112 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_113 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_114 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_115 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_116 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_117 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_118 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_119 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_120 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_121 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_122 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_123 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_124 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_125 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 34:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_126 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_127 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_128 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_129 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_130 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_131 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_132 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_133 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_134 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_135 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_136 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_137 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_138 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_139 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_140 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_141 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_142 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_143 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_144 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_145 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 35:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_146 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_147 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_148 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_149 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_150 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_151 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_152 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_153 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_154 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_155 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_156 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_157 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_158 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_159 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_160 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_161 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_162 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_163 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_164 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_165 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 36:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_166 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_167 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_168 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_169 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_170 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_171 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_172 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_173 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_174 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_175 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_176 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_177 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_178 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_179 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_180 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_181 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_182 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_183 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_184 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_185 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 37:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_186 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_187 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_188 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_189 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_190 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_191 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_192 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_193 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_194 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_195 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_196 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_197 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_198 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_199 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_200 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_201 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_202 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_203 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_204 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_205 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 38:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_206 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_207 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_208 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_209 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_210 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_211 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_212 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_213 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_214 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_215 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_216 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_217 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_218 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_219 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_220 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_221 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_222 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_223 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_224 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_225 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 39:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_226 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_227 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_228 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_229 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_230 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_231 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_232 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_233 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_234 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_235 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_236 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_237 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_238 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_239 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_240 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_241 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_242 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_243 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_244 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_245 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 40:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_246 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_247 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_248 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_249 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_250 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_251 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_252 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_253 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_254 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_255 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_256 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_257 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_258 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_259 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_260 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_261 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_262 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_263 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_264 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_265 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 41:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_266 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_267 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_268 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_269 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_270 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_271 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_272 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_273 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_274 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_275 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_276 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_277 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_278 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_279 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_280 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_281 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_282 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_283 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_284 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_285 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 42:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_286 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_287 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_288 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_289 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_290 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_291 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_292 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_293 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_294 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_295 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_296 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_297 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_298 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_299 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_300 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_301 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_302 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_303 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_304 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_305 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_40 = self.input.LA(2)
-
- if (LA89_40 == IDENTIFIER) :
- LA89_306 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif (LA89_40 == 43) :
- LA89_307 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
-
- elif LA89 == 48:
- LA89_41 = self.input.LA(2)
-
- if (LA89_41 == 43) :
- LA89_308 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif (LA89_41 == IDENTIFIER) :
- LA89_309 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 58 or LA89 == 59 or LA89 == 60 or LA89 == 61:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_310 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_311 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_312 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_313 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_314 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_315 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_316 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_317 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_318 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_319 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_320 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_321 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_322 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_323 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_324 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_325 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_326 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_327 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_328 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_329 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
-
- if alt89 == 1:
- # C.g:0:0: declaration
- self.following.append(self.FOLLOW_declaration_in_macro_statement2166)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop89
-
-
- # C.g:544:33: ( statement_list )?
- alt90 = 2
- LA90 = self.input.LA(1)
- if LA90 == IDENTIFIER:
- LA90 = self.input.LA(2)
- if LA90 == 25 or LA90 == 29 or LA90 == 30 or LA90 == 31 or LA90 == 32 or LA90 == 33 or LA90 == 34 or LA90 == 35 or LA90 == 36 or LA90 == 37 or LA90 == 38 or LA90 == 39 or LA90 == 40 or LA90 == 41 or LA90 == 42 or LA90 == 45 or LA90 == 46 or LA90 == 47 or LA90 == 48 or LA90 == 49 or LA90 == 50 or LA90 == 51 or LA90 == 52 or LA90 == 53 or LA90 == 54 or LA90 == 55 or LA90 == 56 or LA90 == 57 or LA90 == 58 or LA90 == 59 or LA90 == 60 or LA90 == 61:
- alt90 = 1
- elif LA90 == 62:
- LA90_45 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_46 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == IDENTIFIER:
- LA90_47 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 64:
- LA90_48 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_49 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_50 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_51 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_52 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_53 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_54 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_55 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_56 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_57 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_58 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_59 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_60 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_61 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_62 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_63 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_64 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_65 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_66 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_67 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_70 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25 or LA90 == 26 or LA90 == 29 or LA90 == 30 or LA90 == 31 or LA90 == 32 or LA90 == 33 or LA90 == 34 or LA90 == 35 or LA90 == 36 or LA90 == 37 or LA90 == 38 or LA90 == 39 or LA90 == 40 or LA90 == 41 or LA90 == 42 or LA90 == 43 or LA90 == 45 or LA90 == 46 or LA90 == 48 or LA90 == 49 or LA90 == 50 or LA90 == 51 or LA90 == 52 or LA90 == 53 or LA90 == 54 or LA90 == 55 or LA90 == 56 or LA90 == 57 or LA90 == 58 or LA90 == 59 or LA90 == 60 or LA90 == 61 or LA90 == 103 or LA90 == 104 or LA90 == 105 or LA90 == 106 or LA90 == 107 or LA90 == 108 or LA90 == 110 or LA90 == 111 or LA90 == 112 or LA90 == 113 or LA90 == 114 or LA90 == 115 or LA90 == 116 or LA90 == 117:
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == 64:
- LA90_87 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_88 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_89 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_90 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_91 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_92 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_93 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_94 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_95 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_96 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_97 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_98 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_99 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_100 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_101 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_102 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_103 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_104 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_105 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_106 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_107 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_108 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == 64:
- LA90_111 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_112 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_113 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_114 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_115 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_116 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_117 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_118 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_119 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_120 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_121 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_122 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_123 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_124 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_125 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_126 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_127 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_128 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_129 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_130 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_131 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_134 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == 64:
- LA90_135 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_136 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_137 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_138 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_139 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_140 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_141 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_142 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_143 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_144 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_145 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_146 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_147 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_148 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_149 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_150 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_151 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_152 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_153 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_154 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_155 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_156 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == 64:
- LA90_159 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_160 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_161 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_162 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_163 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_164 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_165 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_166 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_167 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_168 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_169 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_170 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_171 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_172 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_173 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_174 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_175 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_176 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_177 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_178 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_179 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_181 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == IDENTIFIER:
- LA90_183 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 64:
- LA90_184 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_185 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_186 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_187 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_188 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_189 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_190 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_191 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_192 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_193 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_194 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_195 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_196 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_197 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_198 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_199 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_200 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_201 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_202 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_203 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_204 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_205 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_206 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == 64:
- LA90_209 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_210 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_211 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_212 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_213 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_214 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_215 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_216 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_217 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_218 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_219 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_220 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_221 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_222 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_223 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_224 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_225 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_226 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_227 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_228 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_229 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_230 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == 62:
- LA90 = self.input.LA(2)
- if LA90 == IDENTIFIER:
- LA90_233 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90_234 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90_235 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90_236 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90_237 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_238 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90_239 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_240 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_241 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_242 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90_243 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90_244 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 49 or LA90 == 50 or LA90 == 51 or LA90 == 52 or LA90 == 53 or LA90 == 54 or LA90 == 55 or LA90 == 56 or LA90 == 57 or LA90 == 58 or LA90 == 59 or LA90 == 60 or LA90 == 61:
- LA90_245 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 34:
- LA90_246 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 35:
- LA90_247 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 36:
- LA90_248 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 37:
- LA90_249 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 38:
- LA90_250 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 39:
- LA90_251 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 40:
- LA90_252 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 41:
- LA90_253 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 42:
- LA90_254 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 45 or LA90 == 46:
- LA90_255 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 48:
- LA90_256 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90 = self.input.LA(2)
- if LA90 == IDENTIFIER:
- LA90_257 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90_258 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90_259 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90_260 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90_261 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_262 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90_263 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_264 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_265 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_266 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90_267 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90_268 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90 = self.input.LA(2)
- if LA90 == IDENTIFIER:
- LA90_269 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90_270 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90_271 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90_272 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90_273 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_274 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90_275 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_276 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_277 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_278 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90_279 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90_280 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90 = self.input.LA(2)
- if LA90 == 62:
- LA90_281 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == IDENTIFIER:
- LA90_282 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90_283 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90_284 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90_285 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90_286 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_287 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90_288 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_289 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_290 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90_291 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90_292 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90 = self.input.LA(2)
- if LA90 == 62:
- LA90_293 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == IDENTIFIER:
- LA90_294 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90_295 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90_296 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90_297 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90_298 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_299 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90_300 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_301 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_302 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90_303 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90_304 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- if alt90 == 1:
- # C.g:0:0: statement_list
- self.following.append(self.FOLLOW_statement_list_in_macro_statement2170)
- self.statement_list()
- self.following.pop()
- if self.failed:
- return
-
-
-
- # C.g:544:49: ( expression )?
- alt91 = 2
- LA91_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA91_0 <= FLOATING_POINT_LITERAL) or LA91_0 == 62 or LA91_0 == 66 or (68 <= LA91_0 <= 69) or (72 <= LA91_0 <= 74) or (77 <= LA91_0 <= 79)) :
- alt91 = 1
- if alt91 == 1:
- # C.g:0:0: expression
- self.following.append(self.FOLLOW_expression_in_macro_statement2173)
- self.expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- self.match(self.input, 63, self.FOLLOW_63_in_macro_statement2176)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 64, macro_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end macro_statement
-
-
- # $ANTLR start labeled_statement
- # C.g:547:1: labeled_statement : ( IDENTIFIER ':' statement | 'case' constant_expression ':' statement | 'default' ':' statement );
- def labeled_statement(self, ):
-
- labeled_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 65):
- return
-
- # C.g:548:2: ( IDENTIFIER ':' statement | 'case' constant_expression ':' statement | 'default' ':' statement )
- alt92 = 3
- LA92 = self.input.LA(1)
- if LA92 == IDENTIFIER:
- alt92 = 1
- elif LA92 == 106:
- alt92 = 2
- elif LA92 == 107:
- alt92 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("547:1: labeled_statement : ( IDENTIFIER ':' statement | 'case' constant_expression ':' statement | 'default' ':' statement );", 92, 0, self.input)
-
- raise nvae
-
- if alt92 == 1:
- # C.g:548:4: IDENTIFIER ':' statement
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_labeled_statement2188)
- if self.failed:
- return
- self.match(self.input, 47, self.FOLLOW_47_in_labeled_statement2190)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_labeled_statement2192)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt92 == 2:
- # C.g:549:4: 'case' constant_expression ':' statement
- self.match(self.input, 106, self.FOLLOW_106_in_labeled_statement2197)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_labeled_statement2199)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 47, self.FOLLOW_47_in_labeled_statement2201)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_labeled_statement2203)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt92 == 3:
- # C.g:550:4: 'default' ':' statement
- self.match(self.input, 107, self.FOLLOW_107_in_labeled_statement2208)
- if self.failed:
- return
- self.match(self.input, 47, self.FOLLOW_47_in_labeled_statement2210)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_labeled_statement2212)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 65, labeled_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end labeled_statement
-
- class compound_statement_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start compound_statement
- # C.g:553:1: compound_statement : '{' ( declaration )* ( statement_list )? '}' ;
- def compound_statement(self, ):
-
- retval = self.compound_statement_return()
- retval.start = self.input.LT(1)
- compound_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 66):
- return retval
-
- # C.g:554:2: ( '{' ( declaration )* ( statement_list )? '}' )
- # C.g:554:4: '{' ( declaration )* ( statement_list )? '}'
- self.match(self.input, 43, self.FOLLOW_43_in_compound_statement2223)
- if self.failed:
- return retval
- # C.g:554:8: ( declaration )*
- while True: #loop93
- alt93 = 2
- LA93 = self.input.LA(1)
- if LA93 == IDENTIFIER:
- LA93 = self.input.LA(2)
- if LA93 == 62:
- LA93_44 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_47 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 66:
- LA93_48 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_49 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_50 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_51 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_52 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_53 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_54 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_55 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_56 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_57 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_58 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_59 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_60 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_61 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_62 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_63 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_64 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_65 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 26:
- LA93 = self.input.LA(2)
- if LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_86 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_87 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_88 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_89 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_90 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_91 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_92 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_93 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_94 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_95 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_96 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_97 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_98 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_99 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 66:
- LA93_100 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_101 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_102 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_103 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_104 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_105 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_106 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_107 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_108 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_109 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_110 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_111 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_112 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_113 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_114 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_115 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_116 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_117 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_118 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_119 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_120 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_121 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_122 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_123 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_124 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 34:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_125 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_126 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_127 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_128 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_129 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_130 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_131 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_132 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_133 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_134 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_135 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_136 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_137 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_138 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_139 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_140 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_141 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_142 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_143 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_144 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 35:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_145 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_146 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_147 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_148 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_149 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_150 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_151 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_152 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_153 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_154 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_155 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_156 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_157 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_158 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_159 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_160 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_161 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_162 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_163 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_164 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 36:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_165 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_166 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_167 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_168 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_169 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_170 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_171 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_172 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_173 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_174 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_175 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_176 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_177 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_178 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_179 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_180 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_181 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_182 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_183 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_184 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 37:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_185 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_186 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_187 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_188 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_189 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_190 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_191 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_192 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_193 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_194 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_195 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_196 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_197 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_198 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_199 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_200 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_201 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_202 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_203 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_204 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 38:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_205 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_206 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_207 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_208 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_209 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_210 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_211 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_212 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_213 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_214 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_215 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_216 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_217 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_218 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_219 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_220 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_221 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_222 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_223 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_224 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 39:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_225 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_226 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_227 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_228 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_229 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_230 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_231 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_232 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_233 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_234 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_235 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_236 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_237 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_238 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_239 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_240 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_241 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_242 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_243 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_244 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 40:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_245 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_246 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_247 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_248 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_249 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_250 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_251 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_252 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_253 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_254 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_255 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_256 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_257 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_258 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_259 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_260 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_261 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_262 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_263 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_264 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 41:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_265 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_266 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_267 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_268 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_269 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_270 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_271 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_272 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_273 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_274 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_275 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_276 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_277 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_278 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_279 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_280 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_281 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_282 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_283 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_284 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 42:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_285 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_286 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_287 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_288 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_289 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_290 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_291 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_292 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_293 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_294 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_295 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_296 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_297 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_298 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_299 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_300 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_301 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_302 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_303 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_304 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_40 = self.input.LA(2)
-
- if (LA93_40 == IDENTIFIER) :
- LA93_305 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif (LA93_40 == 43) :
- LA93_306 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
-
- elif LA93 == 48:
- LA93_41 = self.input.LA(2)
-
- if (LA93_41 == 43) :
- LA93_307 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif (LA93_41 == IDENTIFIER) :
- LA93_308 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 58 or LA93 == 59 or LA93 == 60 or LA93 == 61:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_309 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_310 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_311 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_312 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_313 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_314 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_315 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_316 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_317 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_318 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_319 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_320 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_321 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_322 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_323 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_324 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_325 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_326 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_327 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_328 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
-
- if alt93 == 1:
- # C.g:0:0: declaration
- self.following.append(self.FOLLOW_declaration_in_compound_statement2225)
- self.declaration()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- break #loop93
-
-
- # C.g:554:21: ( statement_list )?
- alt94 = 2
- LA94_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA94_0 <= FLOATING_POINT_LITERAL) or (25 <= LA94_0 <= 26) or (29 <= LA94_0 <= 43) or (45 <= LA94_0 <= 46) or (48 <= LA94_0 <= 62) or LA94_0 == 66 or (68 <= LA94_0 <= 69) or (72 <= LA94_0 <= 74) or (77 <= LA94_0 <= 79) or (103 <= LA94_0 <= 108) or (110 <= LA94_0 <= 117)) :
- alt94 = 1
- if alt94 == 1:
- # C.g:0:0: statement_list
- self.following.append(self.FOLLOW_statement_list_in_compound_statement2228)
- self.statement_list()
- self.following.pop()
- if self.failed:
- return retval
-
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_compound_statement2231)
- if self.failed:
- return retval
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 66, compound_statement_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end compound_statement
-
-
- # $ANTLR start statement_list
- # C.g:557:1: statement_list : ( statement )+ ;
- def statement_list(self, ):
-
- statement_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 67):
- return
-
- # C.g:558:2: ( ( statement )+ )
- # C.g:558:4: ( statement )+
- # C.g:558:4: ( statement )+
- cnt95 = 0
- while True: #loop95
- alt95 = 2
- LA95 = self.input.LA(1)
- if LA95 == IDENTIFIER:
- LA95 = self.input.LA(2)
- if LA95 == 62:
- LA95_46 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25 or LA95 == 29 or LA95 == 30 or LA95 == 31 or LA95 == 32 or LA95 == 33 or LA95 == 34 or LA95 == 35 or LA95 == 36 or LA95 == 37 or LA95 == 38 or LA95 == 39 or LA95 == 40 or LA95 == 41 or LA95 == 42 or LA95 == 45 or LA95 == 46 or LA95 == 47 or LA95 == 48 or LA95 == 49 or LA95 == 50 or LA95 == 51 or LA95 == 52 or LA95 == 53 or LA95 == 54 or LA95 == 55 or LA95 == 56 or LA95 == 57 or LA95 == 58 or LA95 == 59 or LA95 == 60 or LA95 == 61:
- alt95 = 1
- elif LA95 == STRING_LITERAL:
- LA95_48 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == IDENTIFIER:
- LA95_49 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 64:
- LA95_50 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_51 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_52 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_53 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_54 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_55 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_56 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_57 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_58 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_59 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_60 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_61 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_62 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_63 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_64 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_65 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_66 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_67 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_68 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_69 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_88 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == HEX_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == 64:
- LA95_89 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_90 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_91 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_92 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_93 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_94 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_95 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_96 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_97 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_98 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_99 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_100 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_101 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_102 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_103 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_104 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_105 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_106 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_107 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_108 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_109 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_110 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
-
- elif LA95 == OCTAL_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == 64:
- LA95_113 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_114 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_115 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_116 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_117 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_118 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_119 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_120 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_121 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_122 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_123 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_124 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_125 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_126 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_127 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_128 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_129 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_130 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_131 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_132 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_133 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_135 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
-
- elif LA95 == DECIMAL_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == 64:
- LA95_137 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_138 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_139 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_140 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_141 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_142 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_143 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_144 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_145 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_146 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_147 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_148 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_149 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_150 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_151 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_152 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_153 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_154 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_155 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_156 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_157 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_158 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
-
- elif LA95 == CHARACTER_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == 64:
- LA95_161 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_162 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_163 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_164 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_165 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_166 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_167 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_168 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_169 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_170 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_171 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_172 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_173 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_174 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_175 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_176 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_177 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_178 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_179 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_180 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_181 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_182 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
-
- elif LA95 == STRING_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == IDENTIFIER:
- LA95_185 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 64:
- LA95_186 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_187 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_188 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_189 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_190 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_191 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_192 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_193 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_194 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_195 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_196 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_197 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_198 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_199 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_200 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_201 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_202 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_203 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_204 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_205 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_206 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
- elif LA95 == STRING_LITERAL:
- LA95_208 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_209 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == 64:
- LA95_211 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_212 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_213 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_214 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_215 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_216 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_217 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_218 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_219 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_220 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_221 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_222 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_223 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_224 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_225 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_226 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_227 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_228 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_229 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_230 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_231 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_234 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 62:
- LA95 = self.input.LA(2)
- if LA95 == IDENTIFIER:
- LA95_235 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == HEX_LITERAL:
- LA95_236 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == OCTAL_LITERAL:
- LA95_237 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == DECIMAL_LITERAL:
- LA95_238 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == CHARACTER_LITERAL:
- LA95_239 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == STRING_LITERAL:
- LA95_240 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95_241 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_242 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_243 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_244 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95_245 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 74:
- LA95_246 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 49 or LA95 == 50 or LA95 == 51 or LA95 == 52 or LA95 == 53 or LA95 == 54 or LA95 == 55 or LA95 == 56 or LA95 == 57 or LA95 == 58 or LA95 == 59 or LA95 == 60 or LA95 == 61:
- LA95_247 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 34:
- LA95_248 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 35:
- LA95_249 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 36:
- LA95_250 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 37:
- LA95_251 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 38:
- LA95_252 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 39:
- LA95_253 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 40:
- LA95_254 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 41:
- LA95_255 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 42:
- LA95_256 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 45 or LA95 == 46:
- LA95_257 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 48:
- LA95_258 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 72:
- LA95 = self.input.LA(2)
- if LA95 == IDENTIFIER:
- LA95_259 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == HEX_LITERAL:
- LA95_260 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == OCTAL_LITERAL:
- LA95_261 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == DECIMAL_LITERAL:
- LA95_262 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == CHARACTER_LITERAL:
- LA95_263 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == STRING_LITERAL:
- LA95_264 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95_265 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_266 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_267 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_268 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95_269 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 74:
- LA95_270 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 73:
- LA95 = self.input.LA(2)
- if LA95 == IDENTIFIER:
- LA95_271 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == HEX_LITERAL:
- LA95_272 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == OCTAL_LITERAL:
- LA95_273 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == DECIMAL_LITERAL:
- LA95_274 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == CHARACTER_LITERAL:
- LA95_275 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == STRING_LITERAL:
- LA95_276 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95_277 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_278 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_279 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_280 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95_281 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 74:
- LA95_282 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95 = self.input.LA(2)
- if LA95 == 62:
- LA95_283 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == IDENTIFIER:
- LA95_284 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == HEX_LITERAL:
- LA95_285 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == OCTAL_LITERAL:
- LA95_286 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == DECIMAL_LITERAL:
- LA95_287 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == CHARACTER_LITERAL:
- LA95_288 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == STRING_LITERAL:
- LA95_289 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95_290 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_291 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_292 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95_293 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 74:
- LA95_294 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 74:
- LA95 = self.input.LA(2)
- if LA95 == 62:
- LA95_295 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == IDENTIFIER:
- LA95_296 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == HEX_LITERAL:
- LA95_297 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == OCTAL_LITERAL:
- LA95_298 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == DECIMAL_LITERAL:
- LA95_299 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == CHARACTER_LITERAL:
- LA95_300 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == STRING_LITERAL:
- LA95_301 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95_302 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_303 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_304 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95_305 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 74:
- LA95_306 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 25 or LA95 == 26 or LA95 == 29 or LA95 == 30 or LA95 == 31 or LA95 == 32 or LA95 == 33 or LA95 == 34 or LA95 == 35 or LA95 == 36 or LA95 == 37 or LA95 == 38 or LA95 == 39 or LA95 == 40 or LA95 == 41 or LA95 == 42 or LA95 == 43 or LA95 == 45 or LA95 == 46 or LA95 == 48 or LA95 == 49 or LA95 == 50 or LA95 == 51 or LA95 == 52 or LA95 == 53 or LA95 == 54 or LA95 == 55 or LA95 == 56 or LA95 == 57 or LA95 == 58 or LA95 == 59 or LA95 == 60 or LA95 == 61 or LA95 == 103 or LA95 == 104 or LA95 == 105 or LA95 == 106 or LA95 == 107 or LA95 == 108 or LA95 == 110 or LA95 == 111 or LA95 == 112 or LA95 == 113 or LA95 == 114 or LA95 == 115 or LA95 == 116 or LA95 == 117:
- alt95 = 1
-
- if alt95 == 1:
- # C.g:0:0: statement
- self.following.append(self.FOLLOW_statement_in_statement_list2242)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt95 >= 1:
- break #loop95
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(95, self.input)
- raise eee
-
- cnt95 += 1
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 67, statement_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end statement_list
-
- class expression_statement_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start expression_statement
- # C.g:561:1: expression_statement : ( ';' | expression ';' );
- def expression_statement(self, ):
-
- retval = self.expression_statement_return()
- retval.start = self.input.LT(1)
- expression_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 68):
- return retval
-
- # C.g:562:2: ( ';' | expression ';' )
- alt96 = 2
- LA96_0 = self.input.LA(1)
-
- if (LA96_0 == 25) :
- alt96 = 1
- elif ((IDENTIFIER <= LA96_0 <= FLOATING_POINT_LITERAL) or LA96_0 == 62 or LA96_0 == 66 or (68 <= LA96_0 <= 69) or (72 <= LA96_0 <= 74) or (77 <= LA96_0 <= 79)) :
- alt96 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("561:1: expression_statement : ( ';' | expression ';' );", 96, 0, self.input)
-
- raise nvae
-
- if alt96 == 1:
- # C.g:562:4: ';'
- self.match(self.input, 25, self.FOLLOW_25_in_expression_statement2254)
- if self.failed:
- return retval
-
-
- elif alt96 == 2:
- # C.g:563:4: expression ';'
- self.following.append(self.FOLLOW_expression_in_expression_statement2259)
- self.expression()
- self.following.pop()
- if self.failed:
- return retval
- self.match(self.input, 25, self.FOLLOW_25_in_expression_statement2261)
- if self.failed:
- return retval
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 68, expression_statement_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end expression_statement
-
-
- # $ANTLR start selection_statement
- # C.g:566:1: selection_statement : ( 'if' '(' e= expression ')' statement ( options {k=1; backtrack=false; } : 'else' statement )? | 'switch' '(' expression ')' statement );
- def selection_statement(self, ):
-
- selection_statement_StartIndex = self.input.index()
- e = None
-
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 69):
- return
-
- # C.g:567:2: ( 'if' '(' e= expression ')' statement ( options {k=1; backtrack=false; } : 'else' statement )? | 'switch' '(' expression ')' statement )
- alt98 = 2
- LA98_0 = self.input.LA(1)
-
- if (LA98_0 == 108) :
- alt98 = 1
- elif (LA98_0 == 110) :
- alt98 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("566:1: selection_statement : ( 'if' '(' e= expression ')' statement ( options {k=1; backtrack=false; } : 'else' statement )? | 'switch' '(' expression ')' statement );", 98, 0, self.input)
-
- raise nvae
-
- if alt98 == 1:
- # C.g:567:4: 'if' '(' e= expression ')' statement ( options {k=1; backtrack=false; } : 'else' statement )?
- self.match(self.input, 108, self.FOLLOW_108_in_selection_statement2272)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_selection_statement2274)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_selection_statement2278)
- e = self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_selection_statement2280)
- if self.failed:
- return
- if self.backtracking == 0:
- self.StorePredicateExpression(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
- self.following.append(self.FOLLOW_statement_in_selection_statement2284)
- self.statement()
- self.following.pop()
- if self.failed:
- return
- # C.g:567:167: ( options {k=1; backtrack=false; } : 'else' statement )?
- alt97 = 2
- LA97_0 = self.input.LA(1)
-
- if (LA97_0 == 109) :
- alt97 = 1
- if alt97 == 1:
- # C.g:567:200: 'else' statement
- self.match(self.input, 109, self.FOLLOW_109_in_selection_statement2299)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_selection_statement2301)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- elif alt98 == 2:
- # C.g:568:4: 'switch' '(' expression ')' statement
- self.match(self.input, 110, self.FOLLOW_110_in_selection_statement2308)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_selection_statement2310)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_selection_statement2312)
- self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_selection_statement2314)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_selection_statement2316)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 69, selection_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end selection_statement
-
-
- # $ANTLR start iteration_statement
- # C.g:571:1: iteration_statement : ( 'while' '(' e= expression ')' statement | 'do' statement 'while' '(' e= expression ')' ';' | 'for' '(' expression_statement e= expression_statement ( expression )? ')' statement );
- def iteration_statement(self, ):
-
- iteration_statement_StartIndex = self.input.index()
- e = None
-
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 70):
- return
-
- # C.g:572:2: ( 'while' '(' e= expression ')' statement | 'do' statement 'while' '(' e= expression ')' ';' | 'for' '(' expression_statement e= expression_statement ( expression )? ')' statement )
- alt100 = 3
- LA100 = self.input.LA(1)
- if LA100 == 111:
- alt100 = 1
- elif LA100 == 112:
- alt100 = 2
- elif LA100 == 113:
- alt100 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("571:1: iteration_statement : ( 'while' '(' e= expression ')' statement | 'do' statement 'while' '(' e= expression ')' ';' | 'for' '(' expression_statement e= expression_statement ( expression )? ')' statement );", 100, 0, self.input)
-
- raise nvae
-
- if alt100 == 1:
- # C.g:572:4: 'while' '(' e= expression ')' statement
- self.match(self.input, 111, self.FOLLOW_111_in_iteration_statement2327)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_iteration_statement2329)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_iteration_statement2333)
- e = self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_iteration_statement2335)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_iteration_statement2337)
- self.statement()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
- self.StorePredicateExpression(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
-
-
- elif alt100 == 2:
- # C.g:573:4: 'do' statement 'while' '(' e= expression ')' ';'
- self.match(self.input, 112, self.FOLLOW_112_in_iteration_statement2344)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_iteration_statement2346)
- self.statement()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 111, self.FOLLOW_111_in_iteration_statement2348)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_iteration_statement2350)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_iteration_statement2354)
- e = self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_iteration_statement2356)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_iteration_statement2358)
- if self.failed:
- return
- if self.backtracking == 0:
- self.StorePredicateExpression(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
-
-
- elif alt100 == 3:
- # C.g:574:4: 'for' '(' expression_statement e= expression_statement ( expression )? ')' statement
- self.match(self.input, 113, self.FOLLOW_113_in_iteration_statement2365)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_iteration_statement2367)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_statement_in_iteration_statement2369)
- self.expression_statement()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_statement_in_iteration_statement2373)
- e = self.expression_statement()
- self.following.pop()
- if self.failed:
- return
- # C.g:574:58: ( expression )?
- alt99 = 2
- LA99_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA99_0 <= FLOATING_POINT_LITERAL) or LA99_0 == 62 or LA99_0 == 66 or (68 <= LA99_0 <= 69) or (72 <= LA99_0 <= 74) or (77 <= LA99_0 <= 79)) :
- alt99 = 1
- if alt99 == 1:
- # C.g:0:0: expression
- self.following.append(self.FOLLOW_expression_in_iteration_statement2375)
- self.expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- self.match(self.input, 63, self.FOLLOW_63_in_iteration_statement2378)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_iteration_statement2380)
- self.statement()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
- self.StorePredicateExpression(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 70, iteration_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end iteration_statement
-
-
- # $ANTLR start jump_statement
- # C.g:577:1: jump_statement : ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' );
- def jump_statement(self, ):
-
- jump_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 71):
- return
-
- # C.g:578:2: ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' )
- alt101 = 5
- LA101 = self.input.LA(1)
- if LA101 == 114:
- alt101 = 1
- elif LA101 == 115:
- alt101 = 2
- elif LA101 == 116:
- alt101 = 3
- elif LA101 == 117:
- LA101_4 = self.input.LA(2)
-
- if (LA101_4 == 25) :
- alt101 = 4
- elif ((IDENTIFIER <= LA101_4 <= FLOATING_POINT_LITERAL) or LA101_4 == 62 or LA101_4 == 66 or (68 <= LA101_4 <= 69) or (72 <= LA101_4 <= 74) or (77 <= LA101_4 <= 79)) :
- alt101 = 5
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("577:1: jump_statement : ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' );", 101, 4, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("577:1: jump_statement : ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' );", 101, 0, self.input)
-
- raise nvae
-
- if alt101 == 1:
- # C.g:578:4: 'goto' IDENTIFIER ';'
- self.match(self.input, 114, self.FOLLOW_114_in_jump_statement2393)
- if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_jump_statement2395)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_jump_statement2397)
- if self.failed:
- return
-
-
- elif alt101 == 2:
- # C.g:579:4: 'continue' ';'
- self.match(self.input, 115, self.FOLLOW_115_in_jump_statement2402)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_jump_statement2404)
- if self.failed:
- return
-
-
- elif alt101 == 3:
- # C.g:580:4: 'break' ';'
- self.match(self.input, 116, self.FOLLOW_116_in_jump_statement2409)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_jump_statement2411)
- if self.failed:
- return
-
-
- elif alt101 == 4:
- # C.g:581:4: 'return' ';'
- self.match(self.input, 117, self.FOLLOW_117_in_jump_statement2416)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_jump_statement2418)
- if self.failed:
- return
-
-
- elif alt101 == 5:
- # C.g:582:4: 'return' expression ';'
- self.match(self.input, 117, self.FOLLOW_117_in_jump_statement2423)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_jump_statement2425)
- self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_jump_statement2427)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 71, jump_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end jump_statement
-
- # $ANTLR start synpred2
- def synpred2_fragment(self, ):
- # C.g:119:6: ( declaration_specifiers )
- # C.g:119:6: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_synpred2100)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred2
-
-
-
- # $ANTLR start synpred4
- def synpred4_fragment(self, ):
- # C.g:119:4: ( ( declaration_specifiers )? declarator ( declaration )* '{' )
- # C.g:119:6: ( declaration_specifiers )? declarator ( declaration )* '{'
- # C.g:119:6: ( declaration_specifiers )?
- alt102 = 2
- LA102 = self.input.LA(1)
- if LA102 == 29 or LA102 == 30 or LA102 == 31 or LA102 == 32 or LA102 == 33 or LA102 == 34 or LA102 == 35 or LA102 == 36 or LA102 == 37 or LA102 == 38 or LA102 == 39 or LA102 == 40 or LA102 == 41 or LA102 == 42 or LA102 == 45 or LA102 == 46 or LA102 == 48 or LA102 == 49 or LA102 == 50 or LA102 == 51 or LA102 == 52 or LA102 == 53 or LA102 == 54 or LA102 == 55 or LA102 == 56 or LA102 == 57 or LA102 == 61:
- alt102 = 1
- elif LA102 == IDENTIFIER:
- LA102 = self.input.LA(2)
- if LA102 == 62:
- LA102_21 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 29 or LA102 == 30 or LA102 == 31 or LA102 == 32 or LA102 == 33:
- LA102_23 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 34:
- LA102_24 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 35:
- LA102_25 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 36:
- LA102_26 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 37:
- LA102_27 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 38:
- LA102_28 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 39:
- LA102_29 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 40:
- LA102_30 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 41:
- LA102_31 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 42:
- LA102_32 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 45 or LA102 == 46:
- LA102_33 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 48:
- LA102_34 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == IDENTIFIER:
- LA102_35 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 58:
- LA102_36 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 66:
- alt102 = 1
- elif LA102 == 59:
- LA102_39 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 60:
- LA102_40 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 49 or LA102 == 50 or LA102 == 51 or LA102 == 52 or LA102 == 53 or LA102 == 54 or LA102 == 55 or LA102 == 56 or LA102 == 57 or LA102 == 61:
- LA102_41 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 58:
- LA102_14 = self.input.LA(2)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 59:
- LA102_16 = self.input.LA(2)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 60:
- LA102_17 = self.input.LA(2)
-
- if (self.synpred2()) :
- alt102 = 1
- if alt102 == 1:
- # C.g:0:0: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_synpred4100)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_declarator_in_synpred4103)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
- # C.g:119:41: ( declaration )*
- while True: #loop103
- alt103 = 2
- LA103_0 = self.input.LA(1)
-
- if (LA103_0 == IDENTIFIER or LA103_0 == 26 or (29 <= LA103_0 <= 42) or (45 <= LA103_0 <= 46) or (48 <= LA103_0 <= 61)) :
- alt103 = 1
-
-
- if alt103 == 1:
- # C.g:0:0: declaration
- self.following.append(self.FOLLOW_declaration_in_synpred4105)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop103
-
-
- self.match(self.input, 43, self.FOLLOW_43_in_synpred4108)
- if self.failed:
- return
-
-
- # $ANTLR end synpred4
-
-
-
- # $ANTLR start synpred5
- def synpred5_fragment(self, ):
- # C.g:120:4: ( declaration )
- # C.g:120:4: declaration
- self.following.append(self.FOLLOW_declaration_in_synpred5118)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred5
-
-
-
- # $ANTLR start synpred7
- def synpred7_fragment(self, ):
- # C.g:146:6: ( declaration_specifiers )
- # C.g:146:6: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_synpred7157)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred7
-
-
-
- # $ANTLR start synpred10
- def synpred10_fragment(self, ):
- # C.g:167:18: ( declaration_specifiers )
- # C.g:167:18: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_synpred10207)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred10
-
-
-
- # $ANTLR start synpred14
- def synpred14_fragment(self, ):
- # C.g:184:7: ( type_specifier )
- # C.g:184:7: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_synpred14272)
- self.type_specifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred14
-
-
-
- # $ANTLR start synpred15
- def synpred15_fragment(self, ):
- # C.g:185:13: ( type_qualifier )
- # C.g:185:13: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred15286)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred15
-
-
-
- # $ANTLR start synpred33
- def synpred33_fragment(self, ):
- # C.g:225:16: ( type_qualifier )
- # C.g:225:16: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred33444)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred33
-
-
-
- # $ANTLR start synpred34
- def synpred34_fragment(self, ):
- # C.g:225:4: ( IDENTIFIER ( type_qualifier )* declarator )
- # C.g:225:5: IDENTIFIER ( type_qualifier )* declarator
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpred34442)
- if self.failed:
- return
- # C.g:225:16: ( type_qualifier )*
- while True: #loop106
- alt106 = 2
- LA106 = self.input.LA(1)
- if LA106 == 58:
- LA106_2 = self.input.LA(2)
-
- if (self.synpred33()) :
- alt106 = 1
-
-
- elif LA106 == 59:
- LA106_3 = self.input.LA(2)
-
- if (self.synpred33()) :
- alt106 = 1
-
-
- elif LA106 == 60:
- LA106_4 = self.input.LA(2)
-
- if (self.synpred33()) :
- alt106 = 1
-
-
- elif LA106 == 49 or LA106 == 50 or LA106 == 51 or LA106 == 52 or LA106 == 53 or LA106 == 54 or LA106 == 55 or LA106 == 56 or LA106 == 57 or LA106 == 61:
- alt106 = 1
-
- if alt106 == 1:
- # C.g:0:0: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred34444)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop106
-
-
- self.following.append(self.FOLLOW_declarator_in_synpred34447)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred34
-
-
-
- # $ANTLR start synpred39
- def synpred39_fragment(self, ):
- # C.g:253:6: ( type_qualifier )
- # C.g:253:6: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred39566)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred39
-
-
-
- # $ANTLR start synpred40
- def synpred40_fragment(self, ):
- # C.g:253:23: ( type_specifier )
- # C.g:253:23: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_synpred40570)
- self.type_specifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred40
-
-
-
- # $ANTLR start synpred66
- def synpred66_fragment(self, ):
- # C.g:297:4: ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator )
- # C.g:297:4: ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator
- # C.g:297:4: ( pointer )?
- alt111 = 2
- LA111_0 = self.input.LA(1)
-
- if (LA111_0 == 66) :
- alt111 = 1
- if alt111 == 1:
- # C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_synpred66784)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
-
- # C.g:297:13: ( 'EFIAPI' )?
- alt112 = 2
- LA112_0 = self.input.LA(1)
-
- if (LA112_0 == 58) :
- alt112 = 1
- if alt112 == 1:
- # C.g:297:14: 'EFIAPI'
- self.match(self.input, 58, self.FOLLOW_58_in_synpred66788)
- if self.failed:
- return
-
-
-
- # C.g:297:25: ( 'EFI_BOOTSERVICE' )?
- alt113 = 2
- LA113_0 = self.input.LA(1)
-
- if (LA113_0 == 59) :
- alt113 = 1
- if alt113 == 1:
- # C.g:297:26: 'EFI_BOOTSERVICE'
- self.match(self.input, 59, self.FOLLOW_59_in_synpred66793)
- if self.failed:
- return
-
-
-
- # C.g:297:46: ( 'EFI_RUNTIMESERVICE' )?
- alt114 = 2
- LA114_0 = self.input.LA(1)
-
- if (LA114_0 == 60) :
- alt114 = 1
- if alt114 == 1:
- # C.g:297:47: 'EFI_RUNTIMESERVICE'
- self.match(self.input, 60, self.FOLLOW_60_in_synpred66798)
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_direct_declarator_in_synpred66802)
- self.direct_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred66
-
-
-
- # $ANTLR start synpred67
- def synpred67_fragment(self, ):
- # C.g:303:15: ( declarator_suffix )
- # C.g:303:15: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_synpred67821)
- self.declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred67
-
-
-
- # $ANTLR start synpred69
- def synpred69_fragment(self, ):
- # C.g:304:9: ( 'EFIAPI' )
- # C.g:304:9: 'EFIAPI'
- self.match(self.input, 58, self.FOLLOW_58_in_synpred69830)
- if self.failed:
- return
-
-
- # $ANTLR end synpred69
-
-
-
- # $ANTLR start synpred70
- def synpred70_fragment(self, ):
- # C.g:304:35: ( declarator_suffix )
- # C.g:304:35: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_synpred70838)
- self.declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred70
-
-
-
- # $ANTLR start synpred73
- def synpred73_fragment(self, ):
- # C.g:310:9: ( '(' parameter_type_list ')' )
- # C.g:310:9: '(' parameter_type_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_synpred73878)
- if self.failed:
- return
- self.following.append(self.FOLLOW_parameter_type_list_in_synpred73880)
- self.parameter_type_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred73882)
- if self.failed:
- return
-
-
- # $ANTLR end synpred73
-
-
-
- # $ANTLR start synpred74
- def synpred74_fragment(self, ):
- # C.g:311:9: ( '(' identifier_list ')' )
- # C.g:311:9: '(' identifier_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_synpred74892)
- if self.failed:
- return
- self.following.append(self.FOLLOW_identifier_list_in_synpred74894)
- self.identifier_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred74896)
- if self.failed:
- return
-
-
- # $ANTLR end synpred74
-
-
-
- # $ANTLR start synpred75
- def synpred75_fragment(self, ):
- # C.g:316:8: ( type_qualifier )
- # C.g:316:8: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred75921)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred75
-
-
-
- # $ANTLR start synpred76
- def synpred76_fragment(self, ):
- # C.g:316:24: ( pointer )
- # C.g:316:24: pointer
- self.following.append(self.FOLLOW_pointer_in_synpred76924)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred76
-
-
-
- # $ANTLR start synpred77
- def synpred77_fragment(self, ):
- # C.g:316:4: ( '*' ( type_qualifier )+ ( pointer )? )
- # C.g:316:4: '*' ( type_qualifier )+ ( pointer )?
- self.match(self.input, 66, self.FOLLOW_66_in_synpred77919)
- if self.failed:
- return
- # C.g:316:8: ( type_qualifier )+
- cnt116 = 0
- while True: #loop116
- alt116 = 2
- LA116_0 = self.input.LA(1)
-
- if ((49 <= LA116_0 <= 61)) :
- alt116 = 1
-
-
- if alt116 == 1:
- # C.g:0:0: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred77921)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt116 >= 1:
- break #loop116
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(116, self.input)
- raise eee
-
- cnt116 += 1
-
-
- # C.g:316:24: ( pointer )?
- alt117 = 2
- LA117_0 = self.input.LA(1)
-
- if (LA117_0 == 66) :
- alt117 = 1
- if alt117 == 1:
- # C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_synpred77924)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- # $ANTLR end synpred77
-
-
-
- # $ANTLR start synpred78
- def synpred78_fragment(self, ):
- # C.g:317:4: ( '*' pointer )
- # C.g:317:4: '*' pointer
- self.match(self.input, 66, self.FOLLOW_66_in_synpred78930)
- if self.failed:
- return
- self.following.append(self.FOLLOW_pointer_in_synpred78932)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred78
-
-
-
- # $ANTLR start synpred81
- def synpred81_fragment(self, ):
- # C.g:326:32: ( 'OPTIONAL' )
- # C.g:326:32: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_synpred81977)
- if self.failed:
- return
-
-
- # $ANTLR end synpred81
-
-
-
- # $ANTLR start synpred82
- def synpred82_fragment(self, ):
- # C.g:326:27: ( ',' ( 'OPTIONAL' )? parameter_declaration )
- # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declaration
- self.match(self.input, 27, self.FOLLOW_27_in_synpred82974)
- if self.failed:
- return
- # C.g:326:31: ( 'OPTIONAL' )?
- alt119 = 2
- LA119_0 = self.input.LA(1)
-
- if (LA119_0 == 53) :
- LA119_1 = self.input.LA(2)
-
- if (self.synpred81()) :
- alt119 = 1
- if alt119 == 1:
- # C.g:326:32: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_synpred82977)
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_parameter_declaration_in_synpred82981)
- self.parameter_declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred82
-
-
-
- # $ANTLR start synpred83
- def synpred83_fragment(self, ):
- # C.g:330:28: ( declarator )
- # C.g:330:28: declarator
- self.following.append(self.FOLLOW_declarator_in_synpred83997)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred83
-
-
-
- # $ANTLR start synpred84
- def synpred84_fragment(self, ):
- # C.g:330:39: ( abstract_declarator )
- # C.g:330:39: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_synpred84999)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred84
-
-
-
- # $ANTLR start synpred86
- def synpred86_fragment(self, ):
- # C.g:330:4: ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? )
- # C.g:330:4: declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )?
- self.following.append(self.FOLLOW_declaration_specifiers_in_synpred86994)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
- # C.g:330:27: ( declarator | abstract_declarator )*
- while True: #loop120
- alt120 = 3
- LA120 = self.input.LA(1)
- if LA120 == 66:
- LA120_3 = self.input.LA(2)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == IDENTIFIER or LA120 == 58 or LA120 == 59 or LA120 == 60:
- alt120 = 1
- elif LA120 == 62:
- LA120 = self.input.LA(2)
- if LA120 == 29 or LA120 == 30 or LA120 == 31 or LA120 == 32 or LA120 == 33 or LA120 == 34 or LA120 == 35 or LA120 == 36 or LA120 == 37 or LA120 == 38 or LA120 == 39 or LA120 == 40 or LA120 == 41 or LA120 == 42 or LA120 == 45 or LA120 == 46 or LA120 == 48 or LA120 == 49 or LA120 == 50 or LA120 == 51 or LA120 == 52 or LA120 == 53 or LA120 == 54 or LA120 == 55 or LA120 == 56 or LA120 == 57 or LA120 == 61 or LA120 == 63 or LA120 == 64:
- alt120 = 2
- elif LA120 == 58:
- LA120_21 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == 66:
- LA120_22 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == 59:
- LA120_23 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == 60:
- LA120_24 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == IDENTIFIER:
- LA120_25 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == 62:
- LA120_26 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
-
- elif LA120 == 64:
- alt120 = 2
-
- if alt120 == 1:
- # C.g:330:28: declarator
- self.following.append(self.FOLLOW_declarator_in_synpred86997)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt120 == 2:
- # C.g:330:39: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_synpred86999)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop120
-
-
- # C.g:330:61: ( 'OPTIONAL' )?
- alt121 = 2
- LA121_0 = self.input.LA(1)
-
- if (LA121_0 == 53) :
- alt121 = 1
- if alt121 == 1:
- # C.g:330:62: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_synpred861004)
- if self.failed:
- return
-
-
-
-
-
- # $ANTLR end synpred86
-
-
-
- # $ANTLR start synpred90
- def synpred90_fragment(self, ):
- # C.g:341:4: ( specifier_qualifier_list ( abstract_declarator )? )
- # C.g:341:4: specifier_qualifier_list ( abstract_declarator )?
- self.following.append(self.FOLLOW_specifier_qualifier_list_in_synpred901046)
- self.specifier_qualifier_list()
- self.following.pop()
- if self.failed:
- return
- # C.g:341:29: ( abstract_declarator )?
- alt122 = 2
- LA122_0 = self.input.LA(1)
-
- if (LA122_0 == 62 or LA122_0 == 64 or LA122_0 == 66) :
- alt122 = 1
- if alt122 == 1:
- # C.g:0:0: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_synpred901048)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- # $ANTLR end synpred90
-
-
-
- # $ANTLR start synpred91
- def synpred91_fragment(self, ):
- # C.g:346:12: ( direct_abstract_declarator )
- # C.g:346:12: direct_abstract_declarator
- self.following.append(self.FOLLOW_direct_abstract_declarator_in_synpred911067)
- self.direct_abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred91
-
-
-
- # $ANTLR start synpred93
- def synpred93_fragment(self, ):
- # C.g:351:6: ( '(' abstract_declarator ')' )
- # C.g:351:6: '(' abstract_declarator ')'
- self.match(self.input, 62, self.FOLLOW_62_in_synpred931086)
- if self.failed:
- return
- self.following.append(self.FOLLOW_abstract_declarator_in_synpred931088)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred931090)
- if self.failed:
- return
-
-
- # $ANTLR end synpred93
-
-
-
- # $ANTLR start synpred94
- def synpred94_fragment(self, ):
- # C.g:351:65: ( abstract_declarator_suffix )
- # C.g:351:65: abstract_declarator_suffix
- self.following.append(self.FOLLOW_abstract_declarator_suffix_in_synpred941098)
- self.abstract_declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred94
-
-
-
- # $ANTLR start synpred109
- def synpred109_fragment(self, ):
- # C.g:386:4: ( '(' type_name ')' cast_expression )
- # C.g:386:4: '(' type_name ')' cast_expression
- self.match(self.input, 62, self.FOLLOW_62_in_synpred1091282)
- if self.failed:
- return
- self.following.append(self.FOLLOW_type_name_in_synpred1091284)
- self.type_name()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred1091286)
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_synpred1091288)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred109
-
-
-
- # $ANTLR start synpred114
- def synpred114_fragment(self, ):
- # C.g:395:4: ( 'sizeof' unary_expression )
- # C.g:395:4: 'sizeof' unary_expression
- self.match(self.input, 74, self.FOLLOW_74_in_synpred1141330)
- if self.failed:
- return
- self.following.append(self.FOLLOW_unary_expression_in_synpred1141332)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred114
-
-
-
- # $ANTLR start synpred117
- def synpred117_fragment(self, ):
- # C.g:409:13: ( '(' argument_expression_list ')' )
- # C.g:409:13: '(' argument_expression_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_synpred1171420)
- if self.failed:
- return
- self.following.append(self.FOLLOW_argument_expression_list_in_synpred1171424)
- self.argument_expression_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred1171428)
- if self.failed:
- return
-
-
- # $ANTLR end synpred117
-
-
-
- # $ANTLR start synpred118
- def synpred118_fragment(self, ):
- # C.g:410:13: ( '(' macro_parameter_list ')' )
- # C.g:410:13: '(' macro_parameter_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_synpred1181444)
- if self.failed:
- return
- self.following.append(self.FOLLOW_macro_parameter_list_in_synpred1181446)
- self.macro_parameter_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred1181448)
- if self.failed:
- return
-
-
- # $ANTLR end synpred118
-
-
-
- # $ANTLR start synpred120
- def synpred120_fragment(self, ):
- # C.g:412:13: ( '*' IDENTIFIER )
- # C.g:412:13: '*' IDENTIFIER
- self.match(self.input, 66, self.FOLLOW_66_in_synpred1201482)
- if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpred1201486)
- if self.failed:
- return
-
-
- # $ANTLR end synpred120
-
-
-
- # $ANTLR start synpred137
- def synpred137_fragment(self, ):
- # C.g:443:20: ( STRING_LITERAL )
- # C.g:443:20: STRING_LITERAL
- self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_LITERAL_in_synpred1371683)
- if self.failed:
- return
-
-
- # $ANTLR end synpred137
-
-
-
- # $ANTLR start synpred138
- def synpred138_fragment(self, ):
- # C.g:443:8: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )
- # C.g:443:8: ( IDENTIFIER )* ( STRING_LITERAL )+
- # C.g:443:8: ( IDENTIFIER )*
- while True: #loop125
- alt125 = 2
- LA125_0 = self.input.LA(1)
-
- if (LA125_0 == IDENTIFIER) :
- alt125 = 1
-
-
- if alt125 == 1:
- # C.g:0:0: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpred1381680)
- if self.failed:
- return
-
-
- else:
- break #loop125
-
-
- # C.g:443:20: ( STRING_LITERAL )+
- cnt126 = 0
- while True: #loop126
- alt126 = 2
- LA126_0 = self.input.LA(1)
-
- if (LA126_0 == STRING_LITERAL) :
- alt126 = 1
-
-
- if alt126 == 1:
- # C.g:0:0: STRING_LITERAL
- self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_LITERAL_in_synpred1381683)
- if self.failed:
- return
-
-
- else:
- if cnt126 >= 1:
- break #loop126
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(126, self.input)
- raise eee
-
- cnt126 += 1
-
-
-
-
- # $ANTLR end synpred138
-
-
-
- # $ANTLR start synpred142
- def synpred142_fragment(self, ):
- # C.g:458:4: ( lvalue assignment_operator assignment_expression )
- # C.g:458:4: lvalue assignment_operator assignment_expression
- self.following.append(self.FOLLOW_lvalue_in_synpred1421744)
- self.lvalue()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_assignment_operator_in_synpred1421746)
- self.assignment_operator()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_assignment_expression_in_synpred1421748)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred142
-
-
-
- # $ANTLR start synpred169
- def synpred169_fragment(self, ):
- # C.g:520:4: ( expression_statement )
- # C.g:520:4: expression_statement
- self.following.append(self.FOLLOW_expression_statement_in_synpred1692035)
- self.expression_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred169
-
-
-
- # $ANTLR start synpred173
- def synpred173_fragment(self, ):
- # C.g:524:4: ( macro_statement )
- # C.g:524:4: macro_statement
- self.following.append(self.FOLLOW_macro_statement_in_synpred1732055)
- self.macro_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred173
-
-
-
- # $ANTLR start synpred174
- def synpred174_fragment(self, ):
- # C.g:525:4: ( asm2_statement )
- # C.g:525:4: asm2_statement
- self.following.append(self.FOLLOW_asm2_statement_in_synpred1742060)
- self.asm2_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred174
-
-
-
- # $ANTLR start synpred181
- def synpred181_fragment(self, ):
- # C.g:544:19: ( declaration )
- # C.g:544:19: declaration
- self.following.append(self.FOLLOW_declaration_in_synpred1812166)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred181
-
-
-
- # $ANTLR start synpred182
- def synpred182_fragment(self, ):
- # C.g:544:33: ( statement_list )
- # C.g:544:33: statement_list
- self.following.append(self.FOLLOW_statement_list_in_synpred1822170)
- self.statement_list()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred182
-
-
-
- # $ANTLR start synpred186
- def synpred186_fragment(self, ):
- # C.g:554:8: ( declaration )
- # C.g:554:8: declaration
- self.following.append(self.FOLLOW_declaration_in_synpred1862225)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred186
-
-
-
- # $ANTLR start synpred188
- def synpred188_fragment(self, ):
- # C.g:558:4: ( statement )
- # C.g:558:4: statement
- self.following.append(self.FOLLOW_statement_in_synpred1882242)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred188
-
-
-
- def synpred69(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred69_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred81(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred81_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred82(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred82_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred66(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred66_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred83(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred83_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred84(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred84_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred67(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred67_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred86(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred86_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred120(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred120_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred40(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred40_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred142(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred142_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred182(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred182_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred109(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred109_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred181(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred181_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred186(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred186_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred188(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred188_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred169(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred169_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred117(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred117_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred70(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred70_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred118(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred118_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred34(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred34_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred33(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred33_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred94(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred94_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred39(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred39_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred74(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred74_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred114(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred114_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred93(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred93_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred75(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred75_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred137(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred137_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred90(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred90_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred138(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred138_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred91(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred91_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred73(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred73_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred5(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred5_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred78(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred78_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred7(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred7_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred76(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred76_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred77(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred77_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred2(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred2_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred4(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred4_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred174(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred174_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred173(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred173_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred14(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred14_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred15(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred15_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred10(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred10_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
-
-
-
-
- FOLLOW_external_declaration_in_translation_unit74 = frozenset([1, 4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])
- FOLLOW_function_definition_in_external_declaration113 = frozenset([1])
- FOLLOW_declaration_in_external_declaration118 = frozenset([1])
- FOLLOW_macro_statement_in_external_declaration123 = frozenset([1, 25])
- FOLLOW_25_in_external_declaration126 = frozenset([1])
- FOLLOW_declaration_specifiers_in_function_definition157 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_declarator_in_function_definition160 = frozenset([4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_declaration_in_function_definition166 = frozenset([4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_compound_statement_in_function_definition171 = frozenset([1])
- FOLLOW_compound_statement_in_function_definition180 = frozenset([1])
- FOLLOW_26_in_declaration203 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])
- FOLLOW_declaration_specifiers_in_declaration207 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_init_declarator_list_in_declaration216 = frozenset([25])
- FOLLOW_25_in_declaration220 = frozenset([1])
- FOLLOW_declaration_specifiers_in_declaration234 = frozenset([4, 25, 58, 59, 60, 62, 66])
- FOLLOW_init_declarator_list_in_declaration238 = frozenset([25])
- FOLLOW_25_in_declaration243 = frozenset([1])
- FOLLOW_storage_class_specifier_in_declaration_specifiers264 = frozenset([1, 4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_specifier_in_declaration_specifiers272 = frozenset([1, 4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_qualifier_in_declaration_specifiers286 = frozenset([1, 4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_init_declarator_in_init_declarator_list308 = frozenset([1, 27])
- FOLLOW_27_in_init_declarator_list311 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_init_declarator_in_init_declarator_list313 = frozenset([1, 27])
- FOLLOW_declarator_in_init_declarator326 = frozenset([1, 28])
- FOLLOW_28_in_init_declarator329 = frozenset([4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_initializer_in_init_declarator331 = frozenset([1])
- FOLLOW_set_in_storage_class_specifier0 = frozenset([1])
- FOLLOW_34_in_type_specifier376 = frozenset([1])
- FOLLOW_35_in_type_specifier381 = frozenset([1])
- FOLLOW_36_in_type_specifier386 = frozenset([1])
- FOLLOW_37_in_type_specifier391 = frozenset([1])
- FOLLOW_38_in_type_specifier396 = frozenset([1])
- FOLLOW_39_in_type_specifier401 = frozenset([1])
- FOLLOW_40_in_type_specifier406 = frozenset([1])
- FOLLOW_41_in_type_specifier411 = frozenset([1])
- FOLLOW_42_in_type_specifier416 = frozenset([1])
- FOLLOW_struct_or_union_specifier_in_type_specifier423 = frozenset([1])
- FOLLOW_enum_specifier_in_type_specifier433 = frozenset([1])
- FOLLOW_type_id_in_type_specifier451 = frozenset([1])
- FOLLOW_IDENTIFIER_in_type_id467 = frozenset([1])
- FOLLOW_struct_or_union_in_struct_or_union_specifier494 = frozenset([4, 43])
- FOLLOW_IDENTIFIER_in_struct_or_union_specifier496 = frozenset([43])
- FOLLOW_43_in_struct_or_union_specifier499 = frozenset([4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_struct_declaration_list_in_struct_or_union_specifier501 = frozenset([44])
- FOLLOW_44_in_struct_or_union_specifier503 = frozenset([1])
- FOLLOW_struct_or_union_in_struct_or_union_specifier508 = frozenset([4])
- FOLLOW_IDENTIFIER_in_struct_or_union_specifier510 = frozenset([1])
- FOLLOW_set_in_struct_or_union0 = frozenset([1])
- FOLLOW_struct_declaration_in_struct_declaration_list537 = frozenset([1, 4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_specifier_qualifier_list_in_struct_declaration549 = frozenset([4, 47, 58, 59, 60, 62, 66])
- FOLLOW_struct_declarator_list_in_struct_declaration551 = frozenset([25])
- FOLLOW_25_in_struct_declaration553 = frozenset([1])
- FOLLOW_type_qualifier_in_specifier_qualifier_list566 = frozenset([1, 4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_specifier_in_specifier_qualifier_list570 = frozenset([1, 4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_struct_declarator_in_struct_declarator_list584 = frozenset([1, 27])
- FOLLOW_27_in_struct_declarator_list587 = frozenset([4, 47, 58, 59, 60, 62, 66])
- FOLLOW_struct_declarator_in_struct_declarator_list589 = frozenset([1, 27])
- FOLLOW_declarator_in_struct_declarator602 = frozenset([1, 47])
- FOLLOW_47_in_struct_declarator605 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_struct_declarator607 = frozenset([1])
- FOLLOW_47_in_struct_declarator614 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_struct_declarator616 = frozenset([1])
- FOLLOW_48_in_enum_specifier634 = frozenset([43])
- FOLLOW_43_in_enum_specifier636 = frozenset([4])
- FOLLOW_enumerator_list_in_enum_specifier638 = frozenset([27, 44])
- FOLLOW_27_in_enum_specifier640 = frozenset([44])
- FOLLOW_44_in_enum_specifier643 = frozenset([1])
- FOLLOW_48_in_enum_specifier648 = frozenset([4])
- FOLLOW_IDENTIFIER_in_enum_specifier650 = frozenset([43])
- FOLLOW_43_in_enum_specifier652 = frozenset([4])
- FOLLOW_enumerator_list_in_enum_specifier654 = frozenset([27, 44])
- FOLLOW_27_in_enum_specifier656 = frozenset([44])
- FOLLOW_44_in_enum_specifier659 = frozenset([1])
- FOLLOW_48_in_enum_specifier664 = frozenset([4])
- FOLLOW_IDENTIFIER_in_enum_specifier666 = frozenset([1])
- FOLLOW_enumerator_in_enumerator_list677 = frozenset([1, 27])
- FOLLOW_27_in_enumerator_list680 = frozenset([4])
- FOLLOW_enumerator_in_enumerator_list682 = frozenset([1, 27])
- FOLLOW_IDENTIFIER_in_enumerator695 = frozenset([1, 28])
- FOLLOW_28_in_enumerator698 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_enumerator700 = frozenset([1])
- FOLLOW_set_in_type_qualifier0 = frozenset([1])
- FOLLOW_pointer_in_declarator784 = frozenset([4, 58, 59, 60, 62])
- FOLLOW_58_in_declarator788 = frozenset([4, 59, 60, 62])
- FOLLOW_59_in_declarator793 = frozenset([4, 60, 62])
- FOLLOW_60_in_declarator798 = frozenset([4, 62])
- FOLLOW_direct_declarator_in_declarator802 = frozenset([1])
- FOLLOW_pointer_in_declarator808 = frozenset([1])
- FOLLOW_IDENTIFIER_in_direct_declarator819 = frozenset([1, 62, 64])
- FOLLOW_declarator_suffix_in_direct_declarator821 = frozenset([1, 62, 64])
- FOLLOW_62_in_direct_declarator827 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_58_in_direct_declarator830 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_declarator_in_direct_declarator834 = frozenset([63])
- FOLLOW_63_in_direct_declarator836 = frozenset([62, 64])
- FOLLOW_declarator_suffix_in_direct_declarator838 = frozenset([1, 62, 64])
- FOLLOW_64_in_declarator_suffix852 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_declarator_suffix854 = frozenset([65])
- FOLLOW_65_in_declarator_suffix856 = frozenset([1])
- FOLLOW_64_in_declarator_suffix866 = frozenset([65])
- FOLLOW_65_in_declarator_suffix868 = frozenset([1])
- FOLLOW_62_in_declarator_suffix878 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_type_list_in_declarator_suffix880 = frozenset([63])
- FOLLOW_63_in_declarator_suffix882 = frozenset([1])
- FOLLOW_62_in_declarator_suffix892 = frozenset([4])
- FOLLOW_identifier_list_in_declarator_suffix894 = frozenset([63])
- FOLLOW_63_in_declarator_suffix896 = frozenset([1])
- FOLLOW_62_in_declarator_suffix906 = frozenset([63])
- FOLLOW_63_in_declarator_suffix908 = frozenset([1])
- FOLLOW_66_in_pointer919 = frozenset([49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_qualifier_in_pointer921 = frozenset([1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_pointer_in_pointer924 = frozenset([1])
- FOLLOW_66_in_pointer930 = frozenset([66])
- FOLLOW_pointer_in_pointer932 = frozenset([1])
- FOLLOW_66_in_pointer937 = frozenset([1])
- FOLLOW_parameter_list_in_parameter_type_list948 = frozenset([1, 27])
- FOLLOW_27_in_parameter_type_list951 = frozenset([53, 67])
- FOLLOW_53_in_parameter_type_list954 = frozenset([67])
- FOLLOW_67_in_parameter_type_list958 = frozenset([1])
- FOLLOW_parameter_declaration_in_parameter_list971 = frozenset([1, 27])
- FOLLOW_27_in_parameter_list974 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_53_in_parameter_list977 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_declaration_in_parameter_list981 = frozenset([1, 27])
- FOLLOW_declaration_specifiers_in_parameter_declaration994 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_declarator_in_parameter_declaration997 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_abstract_declarator_in_parameter_declaration999 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_53_in_parameter_declaration1004 = frozenset([1])
- FOLLOW_pointer_in_parameter_declaration1013 = frozenset([4, 66])
- FOLLOW_IDENTIFIER_in_parameter_declaration1016 = frozenset([1])
- FOLLOW_IDENTIFIER_in_identifier_list1027 = frozenset([1, 27])
- FOLLOW_27_in_identifier_list1031 = frozenset([4])
- FOLLOW_IDENTIFIER_in_identifier_list1033 = frozenset([1, 27])
- FOLLOW_specifier_qualifier_list_in_type_name1046 = frozenset([1, 62, 64, 66])
- FOLLOW_abstract_declarator_in_type_name1048 = frozenset([1])
- FOLLOW_type_id_in_type_name1054 = frozenset([1])
- FOLLOW_pointer_in_abstract_declarator1065 = frozenset([1, 62, 64])
- FOLLOW_direct_abstract_declarator_in_abstract_declarator1067 = frozenset([1])
- FOLLOW_direct_abstract_declarator_in_abstract_declarator1073 = frozenset([1])
- FOLLOW_62_in_direct_abstract_declarator1086 = frozenset([62, 64, 66])
- FOLLOW_abstract_declarator_in_direct_abstract_declarator1088 = frozenset([63])
- FOLLOW_63_in_direct_abstract_declarator1090 = frozenset([1, 62, 64])
- FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1094 = frozenset([1, 62, 64])
- FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1098 = frozenset([1, 62, 64])
- FOLLOW_64_in_abstract_declarator_suffix1110 = frozenset([65])
- FOLLOW_65_in_abstract_declarator_suffix1112 = frozenset([1])
- FOLLOW_64_in_abstract_declarator_suffix1117 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_abstract_declarator_suffix1119 = frozenset([65])
- FOLLOW_65_in_abstract_declarator_suffix1121 = frozenset([1])
- FOLLOW_62_in_abstract_declarator_suffix1126 = frozenset([63])
- FOLLOW_63_in_abstract_declarator_suffix1128 = frozenset([1])
- FOLLOW_62_in_abstract_declarator_suffix1133 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_type_list_in_abstract_declarator_suffix1135 = frozenset([63])
- FOLLOW_63_in_abstract_declarator_suffix1137 = frozenset([1])
- FOLLOW_assignment_expression_in_initializer1150 = frozenset([1])
- FOLLOW_43_in_initializer1155 = frozenset([4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_initializer_list_in_initializer1157 = frozenset([27, 44])
- FOLLOW_27_in_initializer1159 = frozenset([44])
- FOLLOW_44_in_initializer1162 = frozenset([1])
- FOLLOW_initializer_in_initializer_list1173 = frozenset([1, 27])
- FOLLOW_27_in_initializer_list1176 = frozenset([4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_initializer_in_initializer_list1178 = frozenset([1, 27])
- FOLLOW_assignment_expression_in_argument_expression_list1196 = frozenset([1, 27, 53])
- FOLLOW_53_in_argument_expression_list1199 = frozenset([1, 27])
- FOLLOW_27_in_argument_expression_list1204 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_assignment_expression_in_argument_expression_list1206 = frozenset([1, 27, 53])
- FOLLOW_53_in_argument_expression_list1209 = frozenset([1, 27])
- FOLLOW_multiplicative_expression_in_additive_expression1225 = frozenset([1, 68, 69])
- FOLLOW_68_in_additive_expression1229 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_multiplicative_expression_in_additive_expression1231 = frozenset([1, 68, 69])
- FOLLOW_69_in_additive_expression1235 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_multiplicative_expression_in_additive_expression1237 = frozenset([1, 68, 69])
- FOLLOW_cast_expression_in_multiplicative_expression1251 = frozenset([1, 66, 70, 71])
- FOLLOW_66_in_multiplicative_expression1255 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_multiplicative_expression1257 = frozenset([1, 66, 70, 71])
- FOLLOW_70_in_multiplicative_expression1261 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_multiplicative_expression1263 = frozenset([1, 66, 70, 71])
- FOLLOW_71_in_multiplicative_expression1267 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_multiplicative_expression1269 = frozenset([1, 66, 70, 71])
- FOLLOW_62_in_cast_expression1282 = frozenset([4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_name_in_cast_expression1284 = frozenset([63])
- FOLLOW_63_in_cast_expression1286 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_cast_expression1288 = frozenset([1])
- FOLLOW_unary_expression_in_cast_expression1293 = frozenset([1])
- FOLLOW_postfix_expression_in_unary_expression1304 = frozenset([1])
- FOLLOW_72_in_unary_expression1309 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_unary_expression_in_unary_expression1311 = frozenset([1])
- FOLLOW_73_in_unary_expression1316 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_unary_expression_in_unary_expression1318 = frozenset([1])
- FOLLOW_unary_operator_in_unary_expression1323 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_unary_expression1325 = frozenset([1])
- FOLLOW_74_in_unary_expression1330 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_unary_expression_in_unary_expression1332 = frozenset([1])
- FOLLOW_74_in_unary_expression1337 = frozenset([62])
- FOLLOW_62_in_unary_expression1339 = frozenset([4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_name_in_unary_expression1341 = frozenset([63])
- FOLLOW_63_in_unary_expression1343 = frozenset([1])
- FOLLOW_primary_expression_in_postfix_expression1367 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_64_in_postfix_expression1383 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_postfix_expression1385 = frozenset([65])
- FOLLOW_65_in_postfix_expression1387 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_62_in_postfix_expression1401 = frozenset([63])
- FOLLOW_63_in_postfix_expression1405 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_62_in_postfix_expression1420 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_argument_expression_list_in_postfix_expression1424 = frozenset([63])
- FOLLOW_63_in_postfix_expression1428 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_62_in_postfix_expression1444 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_macro_parameter_list_in_postfix_expression1446 = frozenset([63])
- FOLLOW_63_in_postfix_expression1448 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_75_in_postfix_expression1462 = frozenset([4])
- FOLLOW_IDENTIFIER_in_postfix_expression1466 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_66_in_postfix_expression1482 = frozenset([4])
- FOLLOW_IDENTIFIER_in_postfix_expression1486 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_76_in_postfix_expression1502 = frozenset([4])
- FOLLOW_IDENTIFIER_in_postfix_expression1506 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_72_in_postfix_expression1522 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_73_in_postfix_expression1536 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_parameter_declaration_in_macro_parameter_list1559 = frozenset([1, 27])
- FOLLOW_27_in_macro_parameter_list1562 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_declaration_in_macro_parameter_list1564 = frozenset([1, 27])
- FOLLOW_set_in_unary_operator0 = frozenset([1])
- FOLLOW_IDENTIFIER_in_primary_expression1613 = frozenset([1])
- FOLLOW_constant_in_primary_expression1618 = frozenset([1])
- FOLLOW_62_in_primary_expression1623 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_primary_expression1625 = frozenset([63])
- FOLLOW_63_in_primary_expression1627 = frozenset([1])
- FOLLOW_HEX_LITERAL_in_constant1643 = frozenset([1])
- FOLLOW_OCTAL_LITERAL_in_constant1653 = frozenset([1])
- FOLLOW_DECIMAL_LITERAL_in_constant1663 = frozenset([1])
- FOLLOW_CHARACTER_LITERAL_in_constant1671 = frozenset([1])
- FOLLOW_IDENTIFIER_in_constant1680 = frozenset([4, 9])
- FOLLOW_STRING_LITERAL_in_constant1683 = frozenset([1, 4, 9])
- FOLLOW_IDENTIFIER_in_constant1688 = frozenset([1, 4])
- FOLLOW_FLOATING_POINT_LITERAL_in_constant1699 = frozenset([1])
- FOLLOW_assignment_expression_in_expression1715 = frozenset([1, 27])
- FOLLOW_27_in_expression1718 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_assignment_expression_in_expression1720 = frozenset([1, 27])
- FOLLOW_conditional_expression_in_constant_expression1733 = frozenset([1])
- FOLLOW_lvalue_in_assignment_expression1744 = frozenset([28, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89])
- FOLLOW_assignment_operator_in_assignment_expression1746 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_assignment_expression_in_assignment_expression1748 = frozenset([1])
- FOLLOW_conditional_expression_in_assignment_expression1753 = frozenset([1])
- FOLLOW_unary_expression_in_lvalue1765 = frozenset([1])
- FOLLOW_set_in_assignment_operator0 = frozenset([1])
- FOLLOW_logical_or_expression_in_conditional_expression1839 = frozenset([1, 90])
- FOLLOW_90_in_conditional_expression1842 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_conditional_expression1844 = frozenset([47])
- FOLLOW_47_in_conditional_expression1846 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_conditional_expression_in_conditional_expression1848 = frozenset([1])
- FOLLOW_logical_and_expression_in_logical_or_expression1863 = frozenset([1, 91])
- FOLLOW_91_in_logical_or_expression1866 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_logical_and_expression_in_logical_or_expression1868 = frozenset([1, 91])
- FOLLOW_inclusive_or_expression_in_logical_and_expression1881 = frozenset([1, 92])
- FOLLOW_92_in_logical_and_expression1884 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_inclusive_or_expression_in_logical_and_expression1886 = frozenset([1, 92])
- FOLLOW_exclusive_or_expression_in_inclusive_or_expression1899 = frozenset([1, 93])
- FOLLOW_93_in_inclusive_or_expression1902 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_exclusive_or_expression_in_inclusive_or_expression1904 = frozenset([1, 93])
- FOLLOW_and_expression_in_exclusive_or_expression1917 = frozenset([1, 94])
- FOLLOW_94_in_exclusive_or_expression1920 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_and_expression_in_exclusive_or_expression1922 = frozenset([1, 94])
- FOLLOW_equality_expression_in_and_expression1935 = frozenset([1, 77])
- FOLLOW_77_in_and_expression1938 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_equality_expression_in_and_expression1940 = frozenset([1, 77])
- FOLLOW_relational_expression_in_equality_expression1952 = frozenset([1, 95, 96])
- FOLLOW_set_in_equality_expression1955 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_relational_expression_in_equality_expression1961 = frozenset([1, 95, 96])
- FOLLOW_shift_expression_in_relational_expression1975 = frozenset([1, 97, 98, 99, 100])
- FOLLOW_set_in_relational_expression1978 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_shift_expression_in_relational_expression1988 = frozenset([1, 97, 98, 99, 100])
- FOLLOW_additive_expression_in_shift_expression2001 = frozenset([1, 101, 102])
- FOLLOW_set_in_shift_expression2004 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_additive_expression_in_shift_expression2010 = frozenset([1, 101, 102])
- FOLLOW_labeled_statement_in_statement2025 = frozenset([1])
- FOLLOW_compound_statement_in_statement2030 = frozenset([1])
- FOLLOW_expression_statement_in_statement2035 = frozenset([1])
- FOLLOW_selection_statement_in_statement2040 = frozenset([1])
- FOLLOW_iteration_statement_in_statement2045 = frozenset([1])
- FOLLOW_jump_statement_in_statement2050 = frozenset([1])
- FOLLOW_macro_statement_in_statement2055 = frozenset([1])
- FOLLOW_asm2_statement_in_statement2060 = frozenset([1])
- FOLLOW_asm1_statement_in_statement2065 = frozenset([1])
- FOLLOW_asm_statement_in_statement2070 = frozenset([1])
- FOLLOW_declaration_in_statement2075 = frozenset([1])
- FOLLOW_103_in_asm2_statement2086 = frozenset([4])
- FOLLOW_IDENTIFIER_in_asm2_statement2089 = frozenset([62])
- FOLLOW_62_in_asm2_statement2091 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_set_in_asm2_statement2094 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_63_in_asm2_statement2101 = frozenset([25])
- FOLLOW_25_in_asm2_statement2103 = frozenset([1])
- FOLLOW_104_in_asm1_statement2115 = frozenset([43])
- FOLLOW_43_in_asm1_statement2117 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_set_in_asm1_statement2120 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_44_in_asm1_statement2127 = frozenset([1])
- FOLLOW_105_in_asm_statement2138 = frozenset([43])
- FOLLOW_43_in_asm_statement2140 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_set_in_asm_statement2143 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_44_in_asm_statement2150 = frozenset([1])
- FOLLOW_IDENTIFIER_in_macro_statement2162 = frozenset([62])
- FOLLOW_62_in_macro_statement2164 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_declaration_in_macro_statement2166 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_list_in_macro_statement2170 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_macro_statement2173 = frozenset([63])
- FOLLOW_63_in_macro_statement2176 = frozenset([1])
- FOLLOW_IDENTIFIER_in_labeled_statement2188 = frozenset([47])
- FOLLOW_47_in_labeled_statement2190 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_labeled_statement2192 = frozenset([1])
- FOLLOW_106_in_labeled_statement2197 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_labeled_statement2199 = frozenset([47])
- FOLLOW_47_in_labeled_statement2201 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_labeled_statement2203 = frozenset([1])
- FOLLOW_107_in_labeled_statement2208 = frozenset([47])
- FOLLOW_47_in_labeled_statement2210 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_labeled_statement2212 = frozenset([1])
- FOLLOW_43_in_compound_statement2223 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_declaration_in_compound_statement2225 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_list_in_compound_statement2228 = frozenset([44])
- FOLLOW_44_in_compound_statement2231 = frozenset([1])
- FOLLOW_statement_in_statement_list2242 = frozenset([1, 4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_25_in_expression_statement2254 = frozenset([1])
- FOLLOW_expression_in_expression_statement2259 = frozenset([25])
- FOLLOW_25_in_expression_statement2261 = frozenset([1])
- FOLLOW_108_in_selection_statement2272 = frozenset([62])
- FOLLOW_62_in_selection_statement2274 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_selection_statement2278 = frozenset([63])
- FOLLOW_63_in_selection_statement2280 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_selection_statement2284 = frozenset([1, 109])
- FOLLOW_109_in_selection_statement2299 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_selection_statement2301 = frozenset([1])
- FOLLOW_110_in_selection_statement2308 = frozenset([62])
- FOLLOW_62_in_selection_statement2310 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_selection_statement2312 = frozenset([63])
- FOLLOW_63_in_selection_statement2314 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_selection_statement2316 = frozenset([1])
- FOLLOW_111_in_iteration_statement2327 = frozenset([62])
- FOLLOW_62_in_iteration_statement2329 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_iteration_statement2333 = frozenset([63])
- FOLLOW_63_in_iteration_statement2335 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_iteration_statement2337 = frozenset([1])
- FOLLOW_112_in_iteration_statement2344 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_iteration_statement2346 = frozenset([111])
- FOLLOW_111_in_iteration_statement2348 = frozenset([62])
- FOLLOW_62_in_iteration_statement2350 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_iteration_statement2354 = frozenset([63])
- FOLLOW_63_in_iteration_statement2356 = frozenset([25])
- FOLLOW_25_in_iteration_statement2358 = frozenset([1])
- FOLLOW_113_in_iteration_statement2365 = frozenset([62])
- FOLLOW_62_in_iteration_statement2367 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_statement_in_iteration_statement2369 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_statement_in_iteration_statement2373 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_iteration_statement2375 = frozenset([63])
- FOLLOW_63_in_iteration_statement2378 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_iteration_statement2380 = frozenset([1])
- FOLLOW_114_in_jump_statement2393 = frozenset([4])
- FOLLOW_IDENTIFIER_in_jump_statement2395 = frozenset([25])
- FOLLOW_25_in_jump_statement2397 = frozenset([1])
- FOLLOW_115_in_jump_statement2402 = frozenset([25])
- FOLLOW_25_in_jump_statement2404 = frozenset([1])
- FOLLOW_116_in_jump_statement2409 = frozenset([25])
- FOLLOW_25_in_jump_statement2411 = frozenset([1])
- FOLLOW_117_in_jump_statement2416 = frozenset([25])
- FOLLOW_25_in_jump_statement2418 = frozenset([1])
- FOLLOW_117_in_jump_statement2423 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_jump_statement2425 = frozenset([25])
- FOLLOW_25_in_jump_statement2427 = frozenset([1])
- FOLLOW_declaration_specifiers_in_synpred2100 = frozenset([1])
- FOLLOW_declaration_specifiers_in_synpred4100 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_declarator_in_synpred4103 = frozenset([4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_declaration_in_synpred4105 = frozenset([4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_43_in_synpred4108 = frozenset([1])
- FOLLOW_declaration_in_synpred5118 = frozenset([1])
- FOLLOW_declaration_specifiers_in_synpred7157 = frozenset([1])
- FOLLOW_declaration_specifiers_in_synpred10207 = frozenset([1])
- FOLLOW_type_specifier_in_synpred14272 = frozenset([1])
- FOLLOW_type_qualifier_in_synpred15286 = frozenset([1])
- FOLLOW_type_qualifier_in_synpred33444 = frozenset([1])
- FOLLOW_IDENTIFIER_in_synpred34442 = frozenset([4, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])
- FOLLOW_type_qualifier_in_synpred34444 = frozenset([4, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])
- FOLLOW_declarator_in_synpred34447 = frozenset([1])
- FOLLOW_type_qualifier_in_synpred39566 = frozenset([1])
- FOLLOW_type_specifier_in_synpred40570 = frozenset([1])
- FOLLOW_pointer_in_synpred66784 = frozenset([4, 58, 59, 60, 62])
- FOLLOW_58_in_synpred66788 = frozenset([4, 59, 60, 62])
- FOLLOW_59_in_synpred66793 = frozenset([4, 60, 62])
- FOLLOW_60_in_synpred66798 = frozenset([4, 62])
- FOLLOW_direct_declarator_in_synpred66802 = frozenset([1])
- FOLLOW_declarator_suffix_in_synpred67821 = frozenset([1])
- FOLLOW_58_in_synpred69830 = frozenset([1])
- FOLLOW_declarator_suffix_in_synpred70838 = frozenset([1])
- FOLLOW_62_in_synpred73878 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_type_list_in_synpred73880 = frozenset([63])
- FOLLOW_63_in_synpred73882 = frozenset([1])
- FOLLOW_62_in_synpred74892 = frozenset([4])
- FOLLOW_identifier_list_in_synpred74894 = frozenset([63])
- FOLLOW_63_in_synpred74896 = frozenset([1])
- FOLLOW_type_qualifier_in_synpred75921 = frozenset([1])
- FOLLOW_pointer_in_synpred76924 = frozenset([1])
- FOLLOW_66_in_synpred77919 = frozenset([49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_qualifier_in_synpred77921 = frozenset([1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_pointer_in_synpred77924 = frozenset([1])
- FOLLOW_66_in_synpred78930 = frozenset([66])
- FOLLOW_pointer_in_synpred78932 = frozenset([1])
- FOLLOW_53_in_synpred81977 = frozenset([1])
- FOLLOW_27_in_synpred82974 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_53_in_synpred82977 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_declaration_in_synpred82981 = frozenset([1])
- FOLLOW_declarator_in_synpred83997 = frozenset([1])
- FOLLOW_abstract_declarator_in_synpred84999 = frozenset([1])
- FOLLOW_declaration_specifiers_in_synpred86994 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_declarator_in_synpred86997 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_abstract_declarator_in_synpred86999 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_53_in_synpred861004 = frozenset([1])
- FOLLOW_specifier_qualifier_list_in_synpred901046 = frozenset([1, 62, 64, 66])
- FOLLOW_abstract_declarator_in_synpred901048 = frozenset([1])
- FOLLOW_direct_abstract_declarator_in_synpred911067 = frozenset([1])
- FOLLOW_62_in_synpred931086 = frozenset([62, 64, 66])
- FOLLOW_abstract_declarator_in_synpred931088 = frozenset([63])
- FOLLOW_63_in_synpred931090 = frozenset([1])
- FOLLOW_abstract_declarator_suffix_in_synpred941098 = frozenset([1])
- FOLLOW_62_in_synpred1091282 = frozenset([4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_name_in_synpred1091284 = frozenset([63])
- FOLLOW_63_in_synpred1091286 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_synpred1091288 = frozenset([1])
- FOLLOW_74_in_synpred1141330 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_unary_expression_in_synpred1141332 = frozenset([1])
- FOLLOW_62_in_synpred1171420 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_argument_expression_list_in_synpred1171424 = frozenset([63])
- FOLLOW_63_in_synpred1171428 = frozenset([1])
- FOLLOW_62_in_synpred1181444 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_macro_parameter_list_in_synpred1181446 = frozenset([63])
- FOLLOW_63_in_synpred1181448 = frozenset([1])
- FOLLOW_66_in_synpred1201482 = frozenset([4])
- FOLLOW_IDENTIFIER_in_synpred1201486 = frozenset([1])
- FOLLOW_STRING_LITERAL_in_synpred1371683 = frozenset([1])
- FOLLOW_IDENTIFIER_in_synpred1381680 = frozenset([4, 9])
- FOLLOW_STRING_LITERAL_in_synpred1381683 = frozenset([1, 9])
- FOLLOW_lvalue_in_synpred1421744 = frozenset([28, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89])
- FOLLOW_assignment_operator_in_synpred1421746 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_assignment_expression_in_synpred1421748 = frozenset([1])
- FOLLOW_expression_statement_in_synpred1692035 = frozenset([1])
- FOLLOW_macro_statement_in_synpred1732055 = frozenset([1])
- FOLLOW_asm2_statement_in_synpred1742060 = frozenset([1])
- FOLLOW_declaration_in_synpred1812166 = frozenset([1])
- FOLLOW_statement_list_in_synpred1822170 = frozenset([1])
- FOLLOW_declaration_in_synpred1862225 = frozenset([1])
- FOLLOW_statement_in_synpred1882242 = frozenset([1])
-
diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python/Ecc/Check.py
deleted file mode 100644
index c1ac07e852..0000000000
--- a/BaseTools/Source/Python/Ecc/Check.py
+++ /dev/null
@@ -1,1090 +0,0 @@
-## @file
-# This file is used to define checkpoints used by ECC tool
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-import os
-import re
-from CommonDataClass.DataClass import *
-from Common.DataType import SUP_MODULE_LIST_STRING, TAB_VALUE_SPLIT
-from EccToolError import *
-from MetaDataParser import ParseHeaderCommentSection
-import EccGlobalData
-import c
-
-## Check
-#
-# This class is to define checkpoints used by ECC tool
-#
-# @param object: Inherited from object class
-#
-class Check(object):
- def __init__(self):
- pass
-
- # Check all required checkpoints
- def Check(self):
- self.GeneralCheck()
- self.MetaDataFileCheck()
- self.DoxygenCheck()
- self.IncludeFileCheck()
- self.PredicateExpressionCheck()
- self.DeclAndDataTypeCheck()
- self.FunctionLayoutCheck()
- self.NamingConventionCheck()
-
- # General Checking
- def GeneralCheck(self):
- self.GeneralCheckNonAcsii()
-
- # Check whether file has non ACSII char
- def GeneralCheckNonAcsii(self):
- if EccGlobalData.gConfig.GeneralCheckNonAcsii == '1' or EccGlobalData.gConfig.GeneralCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking Non-ACSII char in file ...")
- SqlCommand = """select ID, FullPath, ExtName from File"""
- RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- if Record[2].upper() not in EccGlobalData.gConfig.BinaryExtList:
- op = open(Record[1]).readlines()
- IndexOfLine = 0
- for Line in op:
- IndexOfLine += 1
- IndexOfChar = 0
- for Char in Line:
- IndexOfChar += 1
- if ord(Char) > 126:
- OtherMsg = "File %s has Non-ASCII char at line %s column %s" % (Record[1], IndexOfLine, IndexOfChar)
- EccGlobalData.gDb.TblReport.Insert(ERROR_GENERAL_CHECK_NON_ACSII, OtherMsg=OtherMsg, BelongsToTable='File', BelongsToItem=Record[0])
-
- # C Function Layout Checking
- def FunctionLayoutCheck(self):
- self.FunctionLayoutCheckReturnType()
- self.FunctionLayoutCheckModifier()
- self.FunctionLayoutCheckName()
- self.FunctionLayoutCheckPrototype()
- self.FunctionLayoutCheckBody()
- self.FunctionLayoutCheckLocalVariable()
-
- def WalkTree(self):
- IgnoredPattern = c.GetIgnoredDirListPattern()
- for Dirpath, Dirnames, Filenames in os.walk(EccGlobalData.gTarget):
- for Dir in Dirnames:
- Dirname = os.path.join(Dirpath, Dir)
- if os.path.islink(Dirname):
- Dirname = os.path.realpath(Dirname)
- if os.path.isdir(Dirname):
- # symlinks to directories are treated as directories
- Dirnames.remove(Dir)
- Dirnames.append(Dirname)
- if IgnoredPattern.match(Dirpath.upper()):
- continue
- yield (Dirpath, Dirnames, Filenames)
-
- # Check whether return type exists and in the first line
- def FunctionLayoutCheckReturnType(self):
- if EccGlobalData.gConfig.CFunctionLayoutCheckReturnType == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking function layout return type ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.c', '.h'):
-# FullName = os.path.join(Dirpath, F)
-# c.CheckFuncLayoutReturnType(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- c.CheckFuncLayoutReturnType(FullName)
-
- # Check whether any optional functional modifiers exist and next to the return type
- def FunctionLayoutCheckModifier(self):
- if EccGlobalData.gConfig.CFunctionLayoutCheckOptionalFunctionalModifier == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking function layout modifier ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.c', '.h'):
-# FullName = os.path.join(Dirpath, F)
-# c.CheckFuncLayoutModifier(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- c.CheckFuncLayoutModifier(FullName)
-
- # Check whether the next line contains the function name, left justified, followed by the beginning of the parameter list
- # Check whether the closing parenthesis is on its own line and also indented two spaces
- def FunctionLayoutCheckName(self):
- if EccGlobalData.gConfig.CFunctionLayoutCheckFunctionName == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking function layout function name ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.c', '.h'):
-# FullName = os.path.join(Dirpath, F)
-# c.CheckFuncLayoutName(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- c.CheckFuncLayoutName(FullName)
-
- # Check whether the function prototypes in include files have the same form as function definitions
- def FunctionLayoutCheckPrototype(self):
- if EccGlobalData.gConfig.CFunctionLayoutCheckFunctionPrototype == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking function layout function prototype ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.c'):
-# FullName = os.path.join(Dirpath, F)
-# EdkLogger.quiet("[PROTOTYPE]" + FullName)
-# c.CheckFuncLayoutPrototype(FullName)
- for FullName in EccGlobalData.gCFileList:
- EdkLogger.quiet("[PROTOTYPE]" + FullName)
- c.CheckFuncLayoutPrototype(FullName)
-
- # Check whether the body of a function is contained by open and close braces that must be in the first column
- def FunctionLayoutCheckBody(self):
- if EccGlobalData.gConfig.CFunctionLayoutCheckFunctionBody == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking function layout function body ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.c'):
-# FullName = os.path.join(Dirpath, F)
-# c.CheckFuncLayoutBody(FullName)
- for FullName in EccGlobalData.gCFileList:
- c.CheckFuncLayoutBody(FullName)
-
- # Check whether the data declarations is the first code in a module.
- # self.CFunctionLayoutCheckDataDeclaration = 1
- # Check whether no initialization of a variable as part of its declaration
- def FunctionLayoutCheckLocalVariable(self):
- if EccGlobalData.gConfig.CFunctionLayoutCheckNoInitOfVariable == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking function layout local variables ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.c'):
-# FullName = os.path.join(Dirpath, F)
-# c.CheckFuncLayoutLocalVariable(FullName)
-
- for FullName in EccGlobalData.gCFileList:
- c.CheckFuncLayoutLocalVariable(FullName)
-
- # Check whether no use of STATIC for functions
- # self.CFunctionLayoutCheckNoStatic = 1
-
- # Declarations and Data Types Checking
- def DeclAndDataTypeCheck(self):
- self.DeclCheckNoUseCType()
- self.DeclCheckInOutModifier()
- self.DeclCheckEFIAPIModifier()
- self.DeclCheckEnumeratedType()
- self.DeclCheckStructureDeclaration()
- self.DeclCheckSameStructure()
- self.DeclCheckUnionType()
-
-
- # Check whether no use of int, unsigned, char, void, static, long in any .c, .h or .asl files.
- def DeclCheckNoUseCType(self):
- if EccGlobalData.gConfig.DeclarationDataTypeCheckNoUseCType == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking Declaration No use C type ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.h', '.c'):
-# FullName = os.path.join(Dirpath, F)
-# c.CheckDeclNoUseCType(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- c.CheckDeclNoUseCType(FullName)
-
- # Check whether the modifiers IN, OUT, OPTIONAL, and UNALIGNED are used only to qualify arguments to a function and should not appear in a data type declaration
- def DeclCheckInOutModifier(self):
- if EccGlobalData.gConfig.DeclarationDataTypeCheckInOutModifier == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking Declaration argument modifier ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.h', '.c'):
-# FullName = os.path.join(Dirpath, F)
-# c.CheckDeclArgModifier(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- c.CheckDeclArgModifier(FullName)
-
- # Check whether the EFIAPI modifier should be used at the entry of drivers, events, and member functions of protocols
- def DeclCheckEFIAPIModifier(self):
- if EccGlobalData.gConfig.DeclarationDataTypeCheckEFIAPIModifier == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- pass
-
- # Check whether Enumerated Type has a 'typedef' and the name is capital
- def DeclCheckEnumeratedType(self):
- if EccGlobalData.gConfig.DeclarationDataTypeCheckEnumeratedType == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking Declaration enum typedef ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.h', '.c'):
-# FullName = os.path.join(Dirpath, F)
-# EdkLogger.quiet("[ENUM]" + FullName)
-# c.CheckDeclEnumTypedef(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- EdkLogger.quiet("[ENUM]" + FullName)
- c.CheckDeclEnumTypedef(FullName)
-
- # Check whether Structure Type has a 'typedef' and the name is capital
- def DeclCheckStructureDeclaration(self):
- if EccGlobalData.gConfig.DeclarationDataTypeCheckStructureDeclaration == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking Declaration struct typedef ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.h', '.c'):
-# FullName = os.path.join(Dirpath, F)
-# EdkLogger.quiet("[STRUCT]" + FullName)
-# c.CheckDeclStructTypedef(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- EdkLogger.quiet("[STRUCT]" + FullName)
- c.CheckDeclStructTypedef(FullName)
-
- # Check whether having same Structure
- def DeclCheckSameStructure(self):
- if EccGlobalData.gConfig.DeclarationDataTypeCheckSameStructure == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking same struct ...")
- AllStructure = {}
- for IdentifierTable in EccGlobalData.gIdentifierTableList:
- SqlCommand = """select ID, Name, BelongsToFile from %s where Model = %s""" % (IdentifierTable, MODEL_IDENTIFIER_STRUCTURE)
- RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- if Record[1] != '':
- if Record[1] not in AllStructure.keys():
- AllStructure[Record[1]] = Record[2]
- else:
- ID = AllStructure[Record[1]]
- SqlCommand = """select FullPath from File where ID = %s """ % ID
- NewRecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- OtherMsg = "The structure name '%s' is duplicate" % Record[1]
- if NewRecordSet != []:
- OtherMsg = "The structure name [%s] is duplicate with the one defined in %s, maybe struct NOT typedefed or the typedef new type NOT used to qualify variables" % (Record[1], NewRecordSet[0][0])
- if not EccGlobalData.gException.IsException(ERROR_DECLARATION_DATA_TYPE_CHECK_SAME_STRUCTURE, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_DECLARATION_DATA_TYPE_CHECK_SAME_STRUCTURE, OtherMsg=OtherMsg, BelongsToTable=IdentifierTable, BelongsToItem=Record[0])
-
- # Check whether Union Type has a 'typedef' and the name is capital
- def DeclCheckUnionType(self):
- if EccGlobalData.gConfig.DeclarationDataTypeCheckUnionType == '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking Declaration union typedef ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.h', '.c'):
-# FullName = os.path.join(Dirpath, F)
-# EdkLogger.quiet("[UNION]" + FullName)
-# c.CheckDeclUnionTypedef(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- EdkLogger.quiet("[UNION]" + FullName)
- c.CheckDeclUnionTypedef(FullName)
-
- # Predicate Expression Checking
- def PredicateExpressionCheck(self):
- self.PredicateExpressionCheckBooleanValue()
- self.PredicateExpressionCheckNonBooleanOperator()
- self.PredicateExpressionCheckComparisonNullType()
-
- # Check whether Boolean values, variable type BOOLEAN not use explicit comparisons to TRUE or FALSE
- def PredicateExpressionCheckBooleanValue(self):
- if EccGlobalData.gConfig.PredicateExpressionCheckBooleanValue == '1' or EccGlobalData.gConfig.PredicateExpressionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking predicate expression Boolean value ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.c'):
-# FullName = os.path.join(Dirpath, F)
-# EdkLogger.quiet("[BOOLEAN]" + FullName)
-# c.CheckBooleanValueComparison(FullName)
- for FullName in EccGlobalData.gCFileList:
- EdkLogger.quiet("[BOOLEAN]" + FullName)
- c.CheckBooleanValueComparison(FullName)
-
- # Check whether Non-Boolean comparisons use a compare operator (==, !=, >, < >=, <=).
- def PredicateExpressionCheckNonBooleanOperator(self):
- if EccGlobalData.gConfig.PredicateExpressionCheckNonBooleanOperator == '1' or EccGlobalData.gConfig.PredicateExpressionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking predicate expression Non-Boolean variable...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.c'):
-# FullName = os.path.join(Dirpath, F)
-# EdkLogger.quiet("[NON-BOOLEAN]" + FullName)
-# c.CheckNonBooleanValueComparison(FullName)
- for FullName in EccGlobalData.gCFileList:
- EdkLogger.quiet("[NON-BOOLEAN]" + FullName)
- c.CheckNonBooleanValueComparison(FullName)
-
- # Check whether a comparison of any pointer to zero must be done via the NULL type
- def PredicateExpressionCheckComparisonNullType(self):
- if EccGlobalData.gConfig.PredicateExpressionCheckComparisonNullType == '1' or EccGlobalData.gConfig.PredicateExpressionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking predicate expression NULL pointer ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.c'):
-# FullName = os.path.join(Dirpath, F)
-# EdkLogger.quiet("[POINTER]" + FullName)
-# c.CheckPointerNullComparison(FullName)
- for FullName in EccGlobalData.gCFileList:
- EdkLogger.quiet("[POINTER]" + FullName)
- c.CheckPointerNullComparison(FullName)
-
- # Include file checking
- def IncludeFileCheck(self):
- self.IncludeFileCheckIfndef()
- self.IncludeFileCheckData()
- self.IncludeFileCheckSameName()
-
- # Check whether having include files with same name
- def IncludeFileCheckSameName(self):
- if EccGlobalData.gConfig.IncludeFileCheckSameName == '1' or EccGlobalData.gConfig.IncludeFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking same header file name ...")
- SqlCommand = """select ID, FullPath from File
- where Model = 1002 order by Name """
- RecordDict = {}
- RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- List = Record[1].replace('/', '\\').split('\\')
- if len(List) >= 2:
- Key = List[-2] + '\\' + List[-1]
- else:
- Key = List[0]
- if Key not in RecordDict:
- RecordDict[Key] = [Record]
- else:
- RecordDict[Key].append(Record)
-
- for Key in RecordDict:
- if len(RecordDict[Key]) > 1:
- for Item in RecordDict[Key]:
- Path = Item[1].replace(EccGlobalData.gWorkspace, '')
- if Path.startswith('\\') or Path.startswith('/'):
- Path = Path[1:]
- if not EccGlobalData.gException.IsException(ERROR_INCLUDE_FILE_CHECK_NAME, Path):
- EccGlobalData.gDb.TblReport.Insert(ERROR_INCLUDE_FILE_CHECK_NAME, OtherMsg="The file name for [%s] is duplicate" % Path, BelongsToTable='File', BelongsToItem=Item[0])
-
- # Check whether all include file contents is guarded by a #ifndef statement.
- def IncludeFileCheckIfndef(self):
- if EccGlobalData.gConfig.IncludeFileCheckIfndefStatement == '1' or EccGlobalData.gConfig.IncludeFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking header file ifndef ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.h'):
-# FullName = os.path.join(Dirpath, F)
-# MsgList = c.CheckHeaderFileIfndef(FullName)
- for FullName in EccGlobalData.gHFileList:
- MsgList = c.CheckHeaderFileIfndef(FullName)
-
- # Check whether include files NOT contain code or define data variables
- def IncludeFileCheckData(self):
- if EccGlobalData.gConfig.IncludeFileCheckData == '1' or EccGlobalData.gConfig.IncludeFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking header file data ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.h'):
-# FullName = os.path.join(Dirpath, F)
-# MsgList = c.CheckHeaderFileData(FullName)
- for FullName in EccGlobalData.gHFileList:
- MsgList = c.CheckHeaderFileData(FullName)
-
- # Doxygen document checking
- def DoxygenCheck(self):
- self.DoxygenCheckFileHeader()
- self.DoxygenCheckFunctionHeader()
- self.DoxygenCheckCommentDescription()
- self.DoxygenCheckCommentFormat()
- self.DoxygenCheckCommand()
-
- # Check whether the file headers are followed Doxygen special documentation blocks in section 2.3.5
- def DoxygenCheckFileHeader(self):
- if EccGlobalData.gConfig.DoxygenCheckFileHeader == '1' or EccGlobalData.gConfig.DoxygenCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking Doxygen file header ...")
-
- for Dirpath, Dirnames, Filenames in self.WalkTree():
- for F in Filenames:
- Ext = os.path.splitext(F)[1]
- if Ext in ('.h', '.c'):
- FullName = os.path.join(Dirpath, F)
- MsgList = c.CheckFileHeaderDoxygenComments(FullName)
- elif Ext in ('.inf', '.dec', '.dsc', '.fdf'):
- FullName = os.path.join(Dirpath, F)
- op = open(FullName).readlines()
- FileLinesList = op
- LineNo = 0
- CurrentSection = MODEL_UNKNOWN
- HeaderSectionLines = []
- HeaderCommentStart = False
- HeaderCommentEnd = False
-
- for Line in FileLinesList:
- LineNo = LineNo + 1
- Line = Line.strip()
- if (LineNo < len(FileLinesList) - 1):
- NextLine = FileLinesList[LineNo].strip()
-
- #
- # blank line
- #
- if (Line == '' or not Line) and LineNo == len(FileLinesList):
- LastSectionFalg = True
-
- #
- # check whether file header comment section started
- #
- if Line.startswith('#') and \
- (Line.find('@file') > -1) and \
- not HeaderCommentStart:
- if CurrentSection != MODEL_UNKNOWN:
- SqlStatement = """ select ID from File where FullPath like '%s'""" % FullName
- ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- Msg = 'INF/DEC/DSC/FDF file header comment should begin with ""## @file"" or ""# @file""at the very top file'
- EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
-
- else:
- CurrentSection = MODEL_IDENTIFIER_FILE_HEADER
- #
- # Append the first line to section lines.
- #
- HeaderSectionLines.append((Line, LineNo))
- HeaderCommentStart = True
- continue
-
- #
- # Collect Header content.
- #
- if (Line.startswith('#') and CurrentSection == MODEL_IDENTIFIER_FILE_HEADER) and\
- HeaderCommentStart and not Line.startswith('##') and not\
- HeaderCommentEnd and NextLine != '':
- HeaderSectionLines.append((Line, LineNo))
- continue
- #
- # Header content end
- #
- if (Line.startswith('##') or not Line.strip().startswith("#")) and HeaderCommentStart \
- and not HeaderCommentEnd:
- if Line.startswith('##'):
- HeaderCommentEnd = True
- HeaderSectionLines.append((Line, LineNo))
- ParseHeaderCommentSection(HeaderSectionLines, FullName)
- break
- if HeaderCommentStart == False:
- SqlStatement = """ select ID from File where FullPath like '%s'""" % FullName
- ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- Msg = 'INF/DEC/DSC/FDF file header comment should begin with ""## @file"" or ""# @file"" at the very top file'
- EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
- if HeaderCommentEnd == False:
- SqlStatement = """ select ID from File where FullPath like '%s'""" % FullName
- ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- Msg = 'INF/DEC/DSC/FDF file header comment should end with ""##"" at the end of file header comment block'
- # Check whether File header Comment End with '##'
- if EccGlobalData.gConfig.HeaderCheckFileCommentEnd == '1' or EccGlobalData.gConfig.HeaderCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
-
-
-
- # Check whether the function headers are followed Doxygen special documentation blocks in section 2.3.5
- def DoxygenCheckFunctionHeader(self):
- if EccGlobalData.gConfig.DoxygenCheckFunctionHeader == '1' or EccGlobalData.gConfig.DoxygenCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking Doxygen function header ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.h', '.c'):
-# FullName = os.path.join(Dirpath, F)
-# MsgList = c.CheckFuncHeaderDoxygenComments(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- MsgList = c.CheckFuncHeaderDoxygenComments(FullName)
-
-
- # Check whether the first line of text in a comment block is a brief description of the element being documented.
- # The brief description must end with a period.
- def DoxygenCheckCommentDescription(self):
- if EccGlobalData.gConfig.DoxygenCheckCommentDescription == '1' or EccGlobalData.gConfig.DoxygenCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- pass
-
- # Check whether comment lines with '///< ... text ...' format, if it is used, it should be after the code section.
- def DoxygenCheckCommentFormat(self):
- if EccGlobalData.gConfig.DoxygenCheckCommentFormat == '1' or EccGlobalData.gConfig.DoxygenCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking Doxygen comment ///< ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.h', '.c'):
-# FullName = os.path.join(Dirpath, F)
-# MsgList = c.CheckDoxygenTripleForwardSlash(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- MsgList = c.CheckDoxygenTripleForwardSlash(FullName)
-
- # Check whether only Doxygen commands allowed to mark the code are @bug and @todo.
- def DoxygenCheckCommand(self):
- if EccGlobalData.gConfig.DoxygenCheckCommand == '1' or EccGlobalData.gConfig.DoxygenCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking Doxygen command ...")
-
-# for Dirpath, Dirnames, Filenames in self.WalkTree():
-# for F in Filenames:
-# if os.path.splitext(F)[1] in ('.h', '.c'):
-# FullName = os.path.join(Dirpath, F)
-# MsgList = c.CheckDoxygenCommand(FullName)
- for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFileList:
- MsgList = c.CheckDoxygenCommand(FullName)
-
- # Meta-Data File Processing Checking
- def MetaDataFileCheck(self):
- self.MetaDataFileCheckPathName()
- self.MetaDataFileCheckGenerateFileList()
- self.MetaDataFileCheckLibraryInstance()
- self.MetaDataFileCheckLibraryInstanceDependent()
- self.MetaDataFileCheckLibraryInstanceOrder()
- self.MetaDataFileCheckLibraryNoUse()
- self.MetaDataFileCheckBinaryInfInFdf()
- self.MetaDataFileCheckPcdDuplicate()
- self.MetaDataFileCheckPcdFlash()
- self.MetaDataFileCheckPcdNoUse()
- self.MetaDataFileCheckGuidDuplicate()
- self.MetaDataFileCheckModuleFileNoUse()
- self.MetaDataFileCheckPcdType()
- self.MetaDataFileCheckModuleFileGuidDuplication()
-
- # Check whether each file defined in meta-data exists
- def MetaDataFileCheckPathName(self):
- if EccGlobalData.gConfig.MetaDataFileCheckPathName == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- # This item is covered when parsing Inf/Dec/Dsc files
- pass
-
- # Generate a list for all files defined in meta-data files
- def MetaDataFileCheckGenerateFileList(self):
- if EccGlobalData.gConfig.MetaDataFileCheckGenerateFileList == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- # This item is covered when parsing Inf/Dec/Dsc files
- pass
-
- # Check whether all Library Instances defined for a given module (or dependent library instance) match the module's type.
- # Each Library Instance must specify the Supported Module Types in its Inf file,
- # and any module specifying the library instance must be one of the supported types.
- def MetaDataFileCheckLibraryInstance(self):
- if EccGlobalData.gConfig.MetaDataFileCheckLibraryInstance == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking for library instance type issue ...")
- SqlCommand = """select A.ID, A.Value3, B.Value3 from Inf as A left join Inf as B
- where A.Value2 = 'LIBRARY_CLASS' and A.Model = %s
- and B.Value2 = 'MODULE_TYPE' and B.Model = %s and A.BelongsToFile = B.BelongsToFile
- group by A.BelongsToFile""" % (MODEL_META_DATA_HEADER, MODEL_META_DATA_HEADER)
- RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
- LibraryClasses = {}
- for Record in RecordSet:
- List = Record[1].split('|', 1)
- SupModType = []
- if len(List) == 1:
- SupModType = SUP_MODULE_LIST_STRING.split(TAB_VALUE_SPLIT)
- elif len(List) == 2:
- SupModType = List[1].split()
-
- if List[0] not in LibraryClasses:
- LibraryClasses[List[0]] = SupModType
- else:
- for Item in SupModType:
- if Item not in LibraryClasses[List[0]]:
- LibraryClasses[List[0]].append(Item)
-
- if Record[2] != 'BASE' and Record[2] not in SupModType:
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_2, OtherMsg="The Library Class '%s' does not specify its supported module types" % (List[0]), BelongsToTable='Inf', BelongsToItem=Record[0])
-
- SqlCommand = """select A.ID, A.Value1, B.Value3 from Inf as A left join Inf as B
- where A.Model = %s and B.Value2 = '%s' and B.Model = %s
- and B.BelongsToFile = A.BelongsToFile""" \
- % (MODEL_EFI_LIBRARY_CLASS, 'MODULE_TYPE', MODEL_META_DATA_HEADER)
- RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
- # Merge all LibraryClasses' supmodlist
- RecordDict = {}
- for Record in RecordSet:
- if Record[1] not in RecordDict:
- RecordDict[Record[1]] = [str(Record[2])]
- else:
- if Record[2] not in RecordDict[Record[1]]:
- RecordDict[Record[1]].append(Record[2])
-
- for Record in RecordSet:
- if Record[1] in LibraryClasses:
- if Record[2] not in LibraryClasses[Record[1]] and 'BASE' not in RecordDict[Record[1]]:
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1, OtherMsg="The type of Library Class [%s] defined in Inf file does not match the type of the module" % (Record[1]), BelongsToTable='Inf', BelongsToItem=Record[0])
- else:
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1, OtherMsg="The type of Library Class [%s] defined in Inf file does not match the type of the module" % (Record[1]), BelongsToTable='Inf', BelongsToItem=Record[0])
-
- # Check whether a Library Instance has been defined for all dependent library classes
- def MetaDataFileCheckLibraryInstanceDependent(self):
- if EccGlobalData.gConfig.MetaDataFileCheckLibraryInstanceDependent == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking for library instance dependent issue ...")
- SqlCommand = """select ID, Value1, Value2 from Dsc where Model = %s""" % MODEL_EFI_LIBRARY_CLASS
- LibraryClasses = EccGlobalData.gDb.TblDsc.Exec(SqlCommand)
- for LibraryClass in LibraryClasses:
- if LibraryClass[1].upper() == 'NULL' or LibraryClass[1].startswith('!ifdef') or LibraryClass[1].startswith('!ifndef') or LibraryClass[1].endswith('!endif'):
- continue
- else:
- LibraryIns = os.path.normpath(os.path.join(EccGlobalData.gWorkspace, LibraryClass[2]))
- SqlCommand = """select Value3 from Inf where BelongsToFile =
- (select ID from File where lower(FullPath) = lower('%s'))
- and Value2 = '%s'""" % (LibraryIns, 'LIBRARY_CLASS')
- RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
- IsFound = False
- for Record in RecordSet:
- LibName = Record[0].split('|', 1)[0]
- if LibraryClass[1] == LibName:
- IsFound = True
- if not IsFound:
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_DEPENDENT, LibraryClass[1]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_DEPENDENT, OtherMsg="The Library Class [%s] is not specified in '%s'" % (LibraryClass[1], LibraryClass[2]), BelongsToTable='Dsc', BelongsToItem=LibraryClass[0])
-
- # Check whether the Library Instances specified by the LibraryClasses sections are listed in order of dependencies
- def MetaDataFileCheckLibraryInstanceOrder(self):
- if EccGlobalData.gConfig.MetaDataFileCheckLibraryInstanceOrder == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- # This checkpoint is not necessary for Ecc check
- pass
-
- # Check whether the unnecessary inclusion of library classes in the Inf file
- # Check whether the unnecessary duplication of library classe names in the DSC file
- def MetaDataFileCheckLibraryNoUse(self):
- if EccGlobalData.gConfig.MetaDataFileCheckLibraryNoUse == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking for library instance not used ...")
- SqlCommand = """select ID, Value1 from Inf as A where A.Model = %s and A.Value1 not in (select B.Value1 from Dsc as B where Model = %s)""" % (MODEL_EFI_LIBRARY_CLASS, MODEL_EFI_LIBRARY_CLASS)
- RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
- for Record in RecordSet:
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE, OtherMsg="The Library Class [%s] is not used in any platform" % (Record[1]), BelongsToTable='Inf', BelongsToItem=Record[0])
- SqlCommand = """
- select A.ID, A.Value1, A.BelongsToFile, A.StartLine, B.StartLine from Dsc as A left join Dsc as B
- where A.Model = %s and B.Model = %s and A.Scope1 = B.Scope1 and A.Scope2 = B.Scope2 and A.ID <> B.ID
- and A.Value1 = B.Value1 and A.Value2 <> B.Value2 and A.BelongsToItem = -1 and B.BelongsToItem = -1 and A.StartLine <> B.StartLine and B.BelongsToFile = A.BelongsToFile""" \
- % (MODEL_EFI_LIBRARY_CLASS, MODEL_EFI_LIBRARY_CLASS)
- RecordSet = EccGlobalData.gDb.TblDsc.Exec(SqlCommand)
- for Record in RecordSet:
- if Record[3] and Record[4] and Record[3] != Record[4]:
- SqlCommand = """select FullPath from File where ID = %s""" % (Record[2])
- FilePathList = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for FilePath in FilePathList:
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE, OtherMsg="The Library Class [%s] is duplicated in '%s' line %s and line %s." % (Record[1], FilePath, Record[3], Record[4]), BelongsToTable='Dsc', BelongsToItem=Record[0])
-
- # Check whether an Inf file is specified in the FDF file, but not in the Dsc file, then the Inf file must be for a Binary module only
- def MetaDataFileCheckBinaryInfInFdf(self):
- if EccGlobalData.gConfig.MetaDataFileCheckBinaryInfInFdf == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking for non-binary modules defined in FDF files ...")
- SqlCommand = """select A.ID, A.Value1 from Fdf as A
- where A.Model = %s
- and A.Enabled > -1
- and A.Value1 not in
- (select B.Value1 from Dsc as B
- where B.Model = %s
- and B.Enabled > -1)""" % (MODEL_META_DATA_COMPONENT, MODEL_META_DATA_COMPONENT)
- RecordSet = EccGlobalData.gDb.TblFdf.Exec(SqlCommand)
- for Record in RecordSet:
- FdfID = Record[0]
- FilePath = Record[1]
- FilePath = os.path.normpath(os.path.join(EccGlobalData.gWorkspace, FilePath))
- SqlCommand = """select ID from Inf where Model = %s and BelongsToFile = (select ID from File where FullPath like '%s')
- """ % (MODEL_EFI_SOURCE_FILE, FilePath)
- NewRecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- if NewRecordSet != []:
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_BINARY_INF_IN_FDF, FilePath):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_BINARY_INF_IN_FDF, OtherMsg="File [%s] defined in FDF file and not in DSC file must be a binary module" % (FilePath), BelongsToTable='Fdf', BelongsToItem=FdfID)
-
- # Check whether a PCD is set in a Dsc file or the FDF file, but not in both.
- def MetaDataFileCheckPcdDuplicate(self):
- if EccGlobalData.gConfig.MetaDataFileCheckPcdDuplicate == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking for duplicate PCDs defined in both DSC and FDF files ...")
- SqlCommand = """
- select A.ID, A.Value1, A.Value2, A.BelongsToFile, B.ID, B.Value1, B.Value2, B.BelongsToFile from Dsc as A, Fdf as B
- where A.Model >= %s and A.Model < %s
- and B.Model >= %s and B.Model < %s
- and A.Value1 = B.Value1
- and A.Value2 = B.Value2
- and A.Enabled > -1
- and B.Enabled > -1
- group by A.ID
- """ % (MODEL_PCD, MODEL_META_DATA_HEADER, MODEL_PCD, MODEL_META_DATA_HEADER)
- RecordSet = EccGlobalData.gDb.TblDsc.Exec(SqlCommand)
- for Record in RecordSet:
- SqlCommand1 = """select Name from File where ID = %s""" % Record[3]
- SqlCommand2 = """select Name from File where ID = %s""" % Record[7]
- DscFileName = os.path.splitext(EccGlobalData.gDb.TblDsc.Exec(SqlCommand1)[0][0])[0]
- FdfFileName = os.path.splitext(EccGlobalData.gDb.TblDsc.Exec(SqlCommand2)[0][0])[0]
- if DscFileName != FdfFileName:
- continue
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE, Record[1] + '.' + Record[2]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE, OtherMsg="The PCD [%s] is defined in both FDF file and DSC file" % (Record[1] + '.' + Record[2]), BelongsToTable='Dsc', BelongsToItem=Record[0])
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE, Record[5] + '.' + Record[6]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE, OtherMsg="The PCD [%s] is defined in both FDF file and DSC file" % (Record[5] + '.' + Record[6]), BelongsToTable='Fdf', BelongsToItem=Record[4])
-
- EdkLogger.quiet("Checking for duplicate PCDs defined in DEC files ...")
- SqlCommand = """
- select A.ID, A.Value1, A.Value2, A.Model, B.Model from Dec as A left join Dec as B
- where A.Model >= %s and A.Model < %s
- and B.Model >= %s and B.Model < %s
- and A.Value1 = B.Value1
- and A.Value2 = B.Value2
- and A.Scope1 = B.Scope1
- and A.ID <> B.ID
- and A.Model = B.Model
- and A.Enabled > -1
- and B.Enabled > -1
- and A.BelongsToFile = B.BelongsToFile
- group by A.ID
- """ % (MODEL_PCD, MODEL_META_DATA_HEADER, MODEL_PCD, MODEL_META_DATA_HEADER)
- RecordSet = EccGlobalData.gDb.TblDec.Exec(SqlCommand)
- for Record in RecordSet:
- RecordCat = Record[1] + '.' + Record[2]
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE, RecordCat):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE, OtherMsg="The PCD [%s] is defined duplicated in DEC file" % RecordCat, BelongsToTable='Dec', BelongsToItem=Record[0])
-
- # Check whether PCD settings in the FDF file can only be related to flash.
- def MetaDataFileCheckPcdFlash(self):
- if EccGlobalData.gConfig.MetaDataFileCheckPcdFlash == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking only Flash related PCDs are used in FDF ...")
- SqlCommand = """
- select ID, Value1, Value2, BelongsToFile from Fdf as A
- where A.Model >= %s and Model < %s
- and A.Enabled > -1
- and A.Value2 not like '%%Flash%%'
- """ % (MODEL_PCD, MODEL_META_DATA_HEADER)
- RecordSet = EccGlobalData.gDb.TblFdf.Exec(SqlCommand)
- for Record in RecordSet:
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_PCD_FLASH, Record[1] + '.' + Record[2]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_PCD_FLASH, OtherMsg="The PCD [%s] defined in FDF file is not related to Flash" % (Record[1] + '.' + Record[2]), BelongsToTable='Fdf', BelongsToItem=Record[0])
-
- # Check whether PCDs used in Inf files but not specified in Dsc or FDF files
- def MetaDataFileCheckPcdNoUse(self):
- if EccGlobalData.gConfig.MetaDataFileCheckPcdNoUse == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking for non-specified PCDs ...")
- SqlCommand = """
- select ID, Value1, Value2, BelongsToFile from Inf as A
- where A.Model >= %s and Model < %s
- and A.Enabled > -1
- and (A.Value1, A.Value2) not in
- (select Value1, Value2 from Dsc as B
- where B.Model >= %s and B.Model < %s
- and B.Enabled > -1)
- and (A.Value1, A.Value2) not in
- (select Value1, Value2 from Fdf as C
- where C.Model >= %s and C.Model < %s
- and C.Enabled > -1)
- """ % (MODEL_PCD, MODEL_META_DATA_HEADER, MODEL_PCD, MODEL_META_DATA_HEADER, MODEL_PCD, MODEL_META_DATA_HEADER)
- RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
- for Record in RecordSet:
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_PCD_NO_USE, Record[1] + '.' + Record[2]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_PCD_NO_USE, OtherMsg="The PCD [%s] defined in INF file is not specified in either DSC or FDF files" % (Record[1] + '.' + Record[2]), BelongsToTable='Inf', BelongsToItem=Record[0])
-
- # Check whether having duplicate guids defined for Guid/Protocol/Ppi
- def MetaDataFileCheckGuidDuplicate(self):
- if EccGlobalData.gConfig.MetaDataFileCheckGuidDuplicate == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking for duplicate GUID/PPI/PROTOCOL ...")
- # Check Guid
- self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE_GUID, MODEL_EFI_GUID, EccGlobalData.gDb.TblDec)
- self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE_GUID, MODEL_EFI_GUID, EccGlobalData.gDb.TblDsc)
- self.CheckGuidProtocolPpiValue(ERROR_META_DATA_FILE_CHECK_DUPLICATE_GUID, MODEL_EFI_GUID)
- # Check protocol
- self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE_PROTOCOL, MODEL_EFI_PROTOCOL, EccGlobalData.gDb.TblDec)
- self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE_PROTOCOL, MODEL_EFI_PROTOCOL, EccGlobalData.gDb.TblDsc)
- self.CheckGuidProtocolPpiValue(ERROR_META_DATA_FILE_CHECK_DUPLICATE_PROTOCOL, MODEL_EFI_PROTOCOL)
- # Check ppi
- self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE_PPI, MODEL_EFI_PPI, EccGlobalData.gDb.TblDec)
- self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE_PPI, MODEL_EFI_PPI, EccGlobalData.gDb.TblDsc)
- self.CheckGuidProtocolPpiValue(ERROR_META_DATA_FILE_CHECK_DUPLICATE_PPI, MODEL_EFI_PPI)
-
- # Check whether all files under module directory are described in INF files
- def MetaDataFileCheckModuleFileNoUse(self):
- if EccGlobalData.gConfig.MetaDataFileCheckModuleFileNoUse == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking for no used module files ...")
- SqlCommand = """
- select upper(Path) from File where ID in (select BelongsToFile from Inf where BelongsToFile != -1)
- """
- InfPathSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
- InfPathList = []
- for Item in InfPathSet:
- if Item[0] not in InfPathList:
- InfPathList.append(Item[0])
- SqlCommand = """
- select ID, Path, FullPath from File where upper(FullPath) not in
- (select upper(A.Path) || '\\' || upper(B.Value1) from File as A, INF as B
- where A.ID in (select BelongsToFile from INF where Model = %s group by BelongsToFile) and
- B.BelongsToFile = A.ID and B.Model = %s)
- and (Model = %s or Model = %s)
- """ % (MODEL_EFI_SOURCE_FILE, MODEL_EFI_SOURCE_FILE, MODEL_FILE_C, MODEL_FILE_H)
- RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
- for Record in RecordSet:
- Path = Record[1]
- Path = Path.upper().replace('\X64', '').replace('\IA32', '').replace('\EBC', '').replace('\IPF', '').replace('\ARM', '').replace('\AARCH64', '')
- if Path in InfPathList:
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE, Record[2]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE, OtherMsg="The source file [%s] is existing in module directory but it is not described in INF file." % (Record[2]), BelongsToTable='File', BelongsToItem=Record[0])
-
- # Check whether the PCD is correctly used in C function via its type
- def MetaDataFileCheckPcdType(self):
- if EccGlobalData.gConfig.MetaDataFileCheckPcdType == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking for pcd type in c code function usage ...")
- SqlCommand = """
- select ID, Model, Value1, Value2, BelongsToFile from INF where Model > %s and Model < %s
- """ % (MODEL_PCD, MODEL_META_DATA_HEADER)
- PcdSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
- for Pcd in PcdSet:
- Model = Pcd[1]
- PcdName = Pcd[2]
- if Pcd[3]:
- PcdName = Pcd[3]
- BelongsToFile = Pcd[4]
- SqlCommand = """
- select ID from File where FullPath in
- (select B.Path || '\\' || A.Value1 from INF as A, File as B where A.Model = %s and A.BelongsToFile = %s
- and B.ID = %s and (B.Model = %s or B.Model = %s))
- """ % (MODEL_EFI_SOURCE_FILE, BelongsToFile, BelongsToFile, MODEL_FILE_C, MODEL_FILE_H)
- TableSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Tbl in TableSet:
- TblName = 'Identifier' + str(Tbl[0])
- SqlCommand = """
- select Name, ID from %s where value like '%s' and Model = %s
- """ % (TblName, PcdName, MODEL_IDENTIFIER_FUNCTION_CALLING)
- RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
- TblNumber = TblName.replace('Identifier', '')
- for Record in RecordSet:
- FunName = Record[0]
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_PCD_TYPE, FunName):
- if Model in [MODEL_PCD_FIXED_AT_BUILD] and not FunName.startswith('FixedPcdGet'):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_PCD_TYPE, OtherMsg="The pcd '%s' is defined as a FixPcd but now it is called by c function [%s]" % (PcdName, FunName), BelongsToTable=TblName, BelongsToItem=Record[1])
- if Model in [MODEL_PCD_FEATURE_FLAG] and (not FunName.startswith('FeaturePcdGet') and not FunName.startswith('FeaturePcdSet')):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_PCD_TYPE, OtherMsg="The pcd '%s' is defined as a FeaturePcd but now it is called by c function [%s]" % (PcdName, FunName), BelongsToTable=TblName, BelongsToItem=Record[1])
- if Model in [MODEL_PCD_PATCHABLE_IN_MODULE] and (not FunName.startswith('PatchablePcdGet') and not FunName.startswith('PatchablePcdSet')):
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_PCD_TYPE, OtherMsg="The pcd '%s' is defined as a PatchablePcd but now it is called by c function [%s]" % (PcdName, FunName), BelongsToTable=TblName, BelongsToItem=Record[1])
-
- #ERROR_META_DATA_FILE_CHECK_PCD_TYPE
- pass
-
- # Internal worker function to get the INF workspace relative path from FileID
- def GetInfFilePathFromID(self, FileID):
- Table = EccGlobalData.gDb.TblFile
- SqlCommand = """select A.FullPath from %s as A where A.ID = %s""" % (Table.Table, FileID)
- RecordSet = Table.Exec(SqlCommand)
- Path = ""
- for Record in RecordSet:
- Path = Record[0].replace(EccGlobalData.gWorkspace, '')
- if Path.startswith('\\') or Path.startswith('/'):
- Path = Path[1:]
- return Path
-
- # Check whether two module INFs under one workspace has the same FILE_GUID value
- def MetaDataFileCheckModuleFileGuidDuplication(self):
- if EccGlobalData.gConfig.MetaDataFileCheckModuleFileGuidDuplication == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking for pcd type in c code function usage ...")
- Table = EccGlobalData.gDb.TblInf
- SqlCommand = """
- select A.ID, A.Value3, A.BelongsToFile, B.BelongsToFile from %s as A, %s as B
- where A.Value2 = 'FILE_GUID' and B.Value2 = 'FILE_GUID' and
- A.Value3 = B.Value3 and A.ID <> B.ID group by A.ID
- """ % (Table.Table, Table.Table)
- RecordSet = Table.Exec(SqlCommand)
- for Record in RecordSet:
- InfPath1 = self.GetInfFilePathFromID(Record[2])
- InfPath2 = self.GetInfFilePathFromID(Record[3])
- if InfPath1 and InfPath2:
- if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_MODULE_FILE_GUID_DUPLICATION, InfPath1):
- Msg = "The FILE_GUID of INF file [%s] is duplicated with that of %s" % (InfPath1, InfPath2)
- EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_MODULE_FILE_GUID_DUPLICATION, OtherMsg=Msg, BelongsToTable=Table.Table, BelongsToItem=Record[0])
-
-
- # Check whether these is duplicate Guid/Ppi/Protocol name
- def CheckGuidProtocolPpi(self, ErrorID, Model, Table):
- Name = ''
- if Model == MODEL_EFI_GUID:
- Name = 'guid'
- if Model == MODEL_EFI_PROTOCOL:
- Name = 'protocol'
- if Model == MODEL_EFI_PPI:
- Name = 'ppi'
- SqlCommand = """
- select A.ID, A.Value1 from %s as A, %s as B
- where A.Model = %s and B.Model = %s
- and A.Value1 = B.Value1 and A.ID <> B.ID
- and A.Scope1 = B.Scope1
- and A.Enabled > -1
- and B.Enabled > -1
- group by A.ID
- """ % (Table.Table, Table.Table, Model, Model)
- RecordSet = Table.Exec(SqlCommand)
- for Record in RecordSet:
- if not EccGlobalData.gException.IsException(ErrorID, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ErrorID, OtherMsg="The %s name [%s] is defined more than one time" % (Name.upper(), Record[1]), BelongsToTable=Table.Table, BelongsToItem=Record[0])
-
- # Check whether these is duplicate Guid/Ppi/Protocol value
- def CheckGuidProtocolPpiValue(self, ErrorID, Model):
- Name = ''
- Table = EccGlobalData.gDb.TblDec
- if Model == MODEL_EFI_GUID:
- Name = 'guid'
- if Model == MODEL_EFI_PROTOCOL:
- Name = 'protocol'
- if Model == MODEL_EFI_PPI:
- Name = 'ppi'
- SqlCommand = """
- select A.ID, A.Value1, A.Value2 from %s as A, %s as B
- where A.Model = %s and B.Model = %s
- and A.Value2 = B.Value2 and A.ID <> B.ID
- and A.Scope1 = B.Scope1 and A.Value1 <> B.Value1
- group by A.ID
- """ % (Table.Table, Table.Table, Model, Model)
- RecordSet = Table.Exec(SqlCommand)
- for Record in RecordSet:
- if not EccGlobalData.gException.IsException(ErrorID, Record[1] + ':' + Record[2]):
- EccGlobalData.gDb.TblReport.Insert(ErrorID, OtherMsg="The %s value [%s] is used more than one time" % (Name.upper(), Record[2]), BelongsToTable=Table.Table, BelongsToItem=Record[0])
-
- # Naming Convention Check
- def NamingConventionCheck(self):
- if EccGlobalData.gConfig.NamingConventionCheckDefineStatement == '1' \
- or EccGlobalData.gConfig.NamingConventionCheckTypedefStatement == '1' \
- or EccGlobalData.gConfig.NamingConventionCheckIfndefStatement == '1' \
- or EccGlobalData.gConfig.NamingConventionCheckVariableName == '1' \
- or EccGlobalData.gConfig.NamingConventionCheckSingleCharacterVariable == '1' \
- or EccGlobalData.gConfig.NamingConventionCheckAll == '1'\
- or EccGlobalData.gConfig.CheckAll == '1':
- for Dirpath, Dirnames, Filenames in self.WalkTree():
- for F in Filenames:
- if os.path.splitext(F)[1] in ('.h', '.c'):
- FullName = os.path.join(Dirpath, F)
- Id = c.GetTableID(FullName)
- if Id < 0:
- continue
- FileTable = 'Identifier' + str(Id)
- self.NamingConventionCheckDefineStatement(FileTable)
- self.NamingConventionCheckTypedefStatement(FileTable)
- self.NamingConventionCheckIfndefStatement(FileTable)
- self.NamingConventionCheckVariableName(FileTable)
- self.NamingConventionCheckSingleCharacterVariable(FileTable)
-
- self.NamingConventionCheckPathName()
- self.NamingConventionCheckFunctionName()
-
- # Check whether only capital letters are used for #define declarations
- def NamingConventionCheckDefineStatement(self, FileTable):
- if EccGlobalData.gConfig.NamingConventionCheckDefineStatement == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking naming covention of #define statement ...")
-
- SqlCommand = """select ID, Value from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_MACRO_DEFINE)
- RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- Name = Record[1].strip().split()[1]
- if Name.find('(') != -1:
- Name = Name[0:Name.find('(')]
- if Name.upper() != Name:
- if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_DEFINE_STATEMENT, Name):
- EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_DEFINE_STATEMENT, OtherMsg="The #define name [%s] does not follow the rules" % (Name), BelongsToTable=FileTable, BelongsToItem=Record[0])
-
- # Check whether only capital letters are used for typedef declarations
- def NamingConventionCheckTypedefStatement(self, FileTable):
- if EccGlobalData.gConfig.NamingConventionCheckTypedefStatement == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking naming covention of #typedef statement ...")
-
- SqlCommand = """select ID, Name from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_TYPEDEF)
- RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- Name = Record[1].strip()
- if Name != '' and Name != None:
- if Name[0] == '(':
- Name = Name[1:Name.find(')')]
- if Name.find('(') > -1:
- Name = Name[Name.find('(') + 1 : Name.find(')')]
- Name = Name.replace('WINAPI', '')
- Name = Name.replace('*', '').strip()
- if Name.upper() != Name:
- if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_TYPEDEF_STATEMENT, Name):
- EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_TYPEDEF_STATEMENT, OtherMsg="The #typedef name [%s] does not follow the rules" % (Name), BelongsToTable=FileTable, BelongsToItem=Record[0])
-
- # Check whether the #ifndef at the start of an include file uses both prefix and postfix underscore characters, '_'.
- def NamingConventionCheckIfndefStatement(self, FileTable):
- if EccGlobalData.gConfig.NamingConventionCheckTypedefStatement == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking naming covention of #ifndef statement ...")
-
- SqlCommand = """select ID, Value from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_MACRO_IFNDEF)
- RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- Name = Record[1].replace('#ifndef', '').strip()
- if Name[0] != '_' or Name[-1] != '_':
- if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT, Name):
- EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT, OtherMsg="The #ifndef name [%s] does not follow the rules" % (Name), BelongsToTable=FileTable, BelongsToItem=Record[0])
-
- # Rule for path name, variable name and function name
- # 1. First character should be upper case
- # 2. Existing lower case in a word
- # 3. No space existence
- # Check whether the path name followed the rule
- def NamingConventionCheckPathName(self):
- if EccGlobalData.gConfig.NamingConventionCheckPathName == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking naming covention of file path name ...")
- Pattern = re.compile(r'^[A-Z]+\S*[a-z]\S*$')
- SqlCommand = """select ID, Name from File"""
- RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- if not Pattern.match(Record[1]):
- if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_PATH_NAME, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_PATH_NAME, OtherMsg="The file path [%s] does not follow the rules" % (Record[1]), BelongsToTable='File', BelongsToItem=Record[0])
-
- # Rule for path name, variable name and function name
- # 1. First character should be upper case
- # 2. Existing lower case in a word
- # 3. No space existence
- # 4. Global variable name must start with a 'g'
- # Check whether the variable name followed the rule
- def NamingConventionCheckVariableName(self, FileTable):
- if EccGlobalData.gConfig.NamingConventionCheckVariableName == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking naming covention of variable name ...")
- Pattern = re.compile(r'^[A-Zgm]+\S*[a-z]\S*$')
-
- SqlCommand = """select ID, Name from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)
- RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- if not Pattern.match(Record[1]):
- if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, OtherMsg="The variable name [%s] does not follow the rules" % (Record[1]), BelongsToTable=FileTable, BelongsToItem=Record[0])
-
- # Rule for path name, variable name and function name
- # 1. First character should be upper case
- # 2. Existing lower case in a word
- # 3. No space existence
- # Check whether the function name followed the rule
- def NamingConventionCheckFunctionName(self):
- if EccGlobalData.gConfig.NamingConventionCheckFunctionName == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking naming covention of function name ...")
- Pattern = re.compile(r'^[A-Z]+\S*[a-z]\S*$')
- SqlCommand = """select ID, Name from Function"""
- RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- if not Pattern.match(Record[1]):
- if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_FUNCTION_NAME, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_FUNCTION_NAME, OtherMsg="The function name [%s] does not follow the rules" % (Record[1]), BelongsToTable='Function', BelongsToItem=Record[0])
-
- # Check whether NO use short variable name with single character
- def NamingConventionCheckSingleCharacterVariable(self, FileTable):
- if EccGlobalData.gConfig.NamingConventionCheckSingleCharacterVariable == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- EdkLogger.quiet("Checking naming covention of single character variable name ...")
-
- SqlCommand = """select ID, Name from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)
- RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- Variable = Record[1].replace('*', '')
- if len(Variable) == 1:
- if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_SINGLE_CHARACTER_VARIABLE, Record[1]):
- EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_SINGLE_CHARACTER_VARIABLE, OtherMsg="The variable name [%s] does not follow the rules" % (Record[1]), BelongsToTable=FileTable, BelongsToItem=Record[0])
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- Check = Check()
- Check.Check()
diff --git a/BaseTools/Source/Python/Ecc/CodeFragment.py b/BaseTools/Source/Python/Ecc/CodeFragment.py
deleted file mode 100644
index 3bf1c45150..0000000000
--- a/BaseTools/Source/Python/Ecc/CodeFragment.py
+++ /dev/null
@@ -1,165 +0,0 @@
-## @file
-# fragments of source file
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-
-## The description of comment contents and start & end position
-#
-#
-class Comment :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- # @param CommentType The type of comment (T_COMMENT_TWO_SLASH or T_COMMENT_SLASH_STAR).
- #
- def __init__(self, Str, Begin, End, CommentType):
- self.Content = Str
- self.StartPos = Begin
- self.EndPos = End
- self.Type = CommentType
-
-## The description of preprocess directives and start & end position
-#
-#
-class PP_Directive :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Str, Begin, End):
- self.Content = Str
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of predicate expression and start & end position
-#
-#
-class PredicateExpression :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Str, Begin, End):
- self.Content = Str
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of function definition and start & end position
-#
-#
-class FunctionDefinition :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- # @param LBPos The left brace position tuple.
- #
- def __init__(self, ModifierStr, DeclStr, Begin, End, LBPos, NamePos):
- self.Modifier = ModifierStr
- self.Declarator = DeclStr
- self.StartPos = Begin
- self.EndPos = End
- self.LeftBracePos = LBPos
- self.NamePos = NamePos
-
-## The description of variable declaration and start & end position
-#
-#
-class VariableDeclaration :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param NamePos The name position tuple.
- #
- def __init__(self, ModifierStr, DeclStr, Begin, NamePos):
- self.Modifier = ModifierStr
- self.Declarator = DeclStr
- self.StartPos = Begin
- self.NameStartPos = NamePos
-
-## The description of enum definition and start & end position
-#
-#
-class EnumerationDefinition :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Str, Begin, End):
- self.Content = Str
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of struct/union definition and start & end position
-#
-#
-class StructUnionDefinition :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Str, Begin, End):
- self.Content = Str
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of 'Typedef' definition and start & end position
-#
-#
-class TypedefDefinition :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, FromStr, ToStr, Begin, End):
- self.FromType = FromStr
- self.ToType = ToStr
- self.StartPos = Begin
- self.EndPos = End
-
-class FunctionCalling:
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Name, Param, Begin, End):
- self.FuncName = Name
- self.ParamList = Param
- self.StartPos = Begin
- self.EndPos = End
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py b/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py
deleted file mode 100644
index 134b15f81e..0000000000
--- a/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py
+++ /dev/null
@@ -1,624 +0,0 @@
-## @file
-# preprocess source file
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-
-import re
-import os
-import sys
-
-import antlr3
-from CLexer import CLexer
-from CParser import CParser
-
-import FileProfile
-from CodeFragment import Comment
-from CodeFragment import PP_Directive
-from ParserWarning import Warning
-
-
-##define T_CHAR_SPACE ' '
-##define T_CHAR_NULL '\0'
-##define T_CHAR_CR '\r'
-##define T_CHAR_TAB '\t'
-##define T_CHAR_LF '\n'
-##define T_CHAR_SLASH '/'
-##define T_CHAR_BACKSLASH '\\'
-##define T_CHAR_DOUBLE_QUOTE '\"'
-##define T_CHAR_SINGLE_QUOTE '\''
-##define T_CHAR_STAR '*'
-##define T_CHAR_HASH '#'
-
-(T_CHAR_SPACE, T_CHAR_NULL, T_CHAR_CR, T_CHAR_TAB, T_CHAR_LF, T_CHAR_SLASH, \
-T_CHAR_BACKSLASH, T_CHAR_DOUBLE_QUOTE, T_CHAR_SINGLE_QUOTE, T_CHAR_STAR, T_CHAR_HASH) = \
-(' ', '\0', '\r', '\t', '\n', '/', '\\', '\"', '\'', '*', '#')
-
-SEPERATOR_TUPLE = ('=', '|', ',', '{', '}')
-
-(T_COMMENT_TWO_SLASH, T_COMMENT_SLASH_STAR) = (0, 1)
-
-(T_PP_INCLUDE, T_PP_DEFINE, T_PP_OTHERS) = (0, 1, 2)
-
-## The collector for source code fragments.
-#
-# PreprocessFile method should be called prior to ParseFile
-#
-# GetNext*** procedures mean these procedures will get next token first, then make judgement.
-# Get*** procedures mean these procedures will make judgement on current token only.
-#
-class CodeFragmentCollector:
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName):
- self.Profile = FileProfile.FileProfile(FileName)
- self.Profile.FileLinesList.append(T_CHAR_LF)
- self.FileName = FileName
- self.CurrentLineNumber = 1
- self.CurrentOffsetWithinLine = 0
-
- self.__Token = ""
- self.__SkippedChars = ""
-
- ## __IsWhiteSpace() method
- #
- # Whether char at current FileBufferPos is whitespace
- #
- # @param self The object pointer
- # @param Char The char to test
- # @retval True The char is a kind of white space
- # @retval False The char is NOT a kind of white space
- #
- def __IsWhiteSpace(self, Char):
- if Char in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_SPACE, T_CHAR_TAB, T_CHAR_LF):
- return True
- else:
- return False
-
- ## __SkipWhiteSpace() method
- #
- # Skip white spaces from current char, return number of chars skipped
- #
- # @param self The object pointer
- # @retval Count The number of chars skipped
- #
- def __SkipWhiteSpace(self):
- Count = 0
- while not self.__EndOfFile():
- Count += 1
- if self.__CurrentChar() in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_LF, T_CHAR_SPACE, T_CHAR_TAB):
- self.__SkippedChars += str(self.__CurrentChar())
- self.__GetOneChar()
-
- else:
- Count = Count - 1
- return Count
-
- ## __EndOfFile() method
- #
- # Judge current buffer pos is at file end
- #
- # @param self The object pointer
- # @retval True Current File buffer position is at file end
- # @retval False Current File buffer position is NOT at file end
- #
- def __EndOfFile(self):
- NumberOfLines = len(self.Profile.FileLinesList)
- SizeOfLastLine = NumberOfLines
- if NumberOfLines > 0:
- SizeOfLastLine = len(self.Profile.FileLinesList[-1])
-
- if self.CurrentLineNumber == NumberOfLines and self.CurrentOffsetWithinLine >= SizeOfLastLine - 1:
- return True
- elif self.CurrentLineNumber > NumberOfLines:
- return True
- else:
- return False
-
- ## __EndOfLine() method
- #
- # Judge current buffer pos is at line end
- #
- # @param self The object pointer
- # @retval True Current File buffer position is at line end
- # @retval False Current File buffer position is NOT at line end
- #
- def __EndOfLine(self):
- SizeOfCurrentLine = len(self.Profile.FileLinesList[self.CurrentLineNumber - 1])
- if self.CurrentOffsetWithinLine >= SizeOfCurrentLine - 1:
- return True
- else:
- return False
-
- ## Rewind() method
- #
- # Reset file data buffer to the initial state
- #
- # @param self The object pointer
- #
- def Rewind(self):
- self.CurrentLineNumber = 1
- self.CurrentOffsetWithinLine = 0
-
- ## __UndoOneChar() method
- #
- # Go back one char in the file buffer
- #
- # @param self The object pointer
- # @retval True Successfully go back one char
- # @retval False Not able to go back one char as file beginning reached
- #
- def __UndoOneChar(self):
-
- if self.CurrentLineNumber == 1 and self.CurrentOffsetWithinLine == 0:
- return False
- elif self.CurrentOffsetWithinLine == 0:
- self.CurrentLineNumber -= 1
- self.CurrentOffsetWithinLine = len(self.__CurrentLine()) - 1
- else:
- self.CurrentOffsetWithinLine -= 1
- return True
-
- ## __GetOneChar() method
- #
- # Move forward one char in the file buffer
- #
- # @param self The object pointer
- #
- def __GetOneChar(self):
- if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
- else:
- self.CurrentOffsetWithinLine += 1
-
- ## __CurrentChar() method
- #
- # Get the char pointed to by the file buffer pointer
- #
- # @param self The object pointer
- # @retval Char Current char
- #
- def __CurrentChar(self):
- CurrentChar = self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine]
-# if CurrentChar > 255:
-# raise Warning("Non-Ascii char found At Line %d, offset %d" % (self.CurrentLineNumber, self.CurrentOffsetWithinLine), self.FileName, self.CurrentLineNumber)
- return CurrentChar
-
- ## __NextChar() method
- #
- # Get the one char pass the char pointed to by the file buffer pointer
- #
- # @param self The object pointer
- # @retval Char Next char
- #
- def __NextChar(self):
- if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
- return self.Profile.FileLinesList[self.CurrentLineNumber][0]
- else:
- return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine + 1]
-
- ## __SetCurrentCharValue() method
- #
- # Modify the value of current char
- #
- # @param self The object pointer
- # @param Value The new value of current char
- #
- def __SetCurrentCharValue(self, Value):
- self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine] = Value
-
- ## __SetCharValue() method
- #
- # Modify the value of current char
- #
- # @param self The object pointer
- # @param Value The new value of current char
- #
- def __SetCharValue(self, Line, Offset, Value):
- self.Profile.FileLinesList[Line - 1][Offset] = Value
-
- ## __CurrentLine() method
- #
- # Get the list that contains current line contents
- #
- # @param self The object pointer
- # @retval List current line contents
- #
- def __CurrentLine(self):
- return self.Profile.FileLinesList[self.CurrentLineNumber - 1]
-
- ## __InsertComma() method
- #
- # Insert ',' to replace PP
- #
- # @param self The object pointer
- # @retval List current line contents
- #
- def __InsertComma(self, Line):
-
-
- if self.Profile.FileLinesList[Line - 1][0] != T_CHAR_HASH:
- BeforeHashPart = str(self.Profile.FileLinesList[Line - 1]).split(T_CHAR_HASH)[0]
- if BeforeHashPart.rstrip().endswith(T_CHAR_COMMA) or BeforeHashPart.rstrip().endswith(';'):
- return
-
- if Line - 2 >= 0 and str(self.Profile.FileLinesList[Line - 2]).rstrip().endswith(','):
- return
-
- if Line - 2 >= 0 and str(self.Profile.FileLinesList[Line - 2]).rstrip().endswith(';'):
- return
-
- if str(self.Profile.FileLinesList[Line]).lstrip().startswith(',') or str(self.Profile.FileLinesList[Line]).lstrip().startswith(';'):
- return
-
- self.Profile.FileLinesList[Line - 1].insert(self.CurrentOffsetWithinLine, ',')
-
- ## PreprocessFile() method
- #
- # Preprocess file contents, replace comments with spaces.
- # In the end, rewind the file buffer pointer to the beginning
- # BUGBUG: No !include statement processing contained in this procedure
- # !include statement should be expanded at the same FileLinesList[CurrentLineNumber - 1]
- #
- # @param self The object pointer
- #
- def PreprocessFile(self):
-
- self.Rewind()
- InComment = False
- DoubleSlashComment = False
- HashComment = False
- PPExtend = False
- CommentObj = None
- PPDirectiveObj = None
- # HashComment in quoted string " " is ignored.
- InString = False
- InCharLiteral = False
-
- self.Profile.FileLinesList = [list(s) for s in self.Profile.FileLinesListFromFile]
- while not self.__EndOfFile():
-
- if not InComment and self.__CurrentChar() == T_CHAR_DOUBLE_QUOTE:
- InString = not InString
-
- if not InComment and self.__CurrentChar() == T_CHAR_SINGLE_QUOTE:
- InCharLiteral = not InCharLiteral
- # meet new line, then no longer in a comment for // and '#'
- if self.__CurrentChar() == T_CHAR_LF:
- if HashComment and PPDirectiveObj != None:
- if PPDirectiveObj.Content.rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):
- PPDirectiveObj.Content += T_CHAR_LF
- PPExtend = True
- else:
- PPExtend = False
-
- EndLinePos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine)
-
- if InComment and DoubleSlashComment:
- InComment = False
- DoubleSlashComment = False
- CommentObj.Content += T_CHAR_LF
- CommentObj.EndPos = EndLinePos
- FileProfile.CommentList.append(CommentObj)
- CommentObj = None
- if InComment and HashComment and not PPExtend:
- InComment = False
- HashComment = False
- PPDirectiveObj.Content += T_CHAR_LF
- PPDirectiveObj.EndPos = EndLinePos
- FileProfile.PPDirectiveList.append(PPDirectiveObj)
- PPDirectiveObj = None
-
- if InString or InCharLiteral:
- CurrentLine = "".join(self.__CurrentLine())
- if CurrentLine.rstrip(T_CHAR_LF).rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):
- SlashIndex = CurrentLine.rindex(T_CHAR_BACKSLASH)
- self.__SetCharValue(self.CurrentLineNumber, SlashIndex, T_CHAR_SPACE)
-
- if InComment and not DoubleSlashComment and not HashComment:
- CommentObj.Content += T_CHAR_LF
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
- # check for */ comment end
- elif InComment and not DoubleSlashComment and not HashComment and self.__CurrentChar() == T_CHAR_STAR and self.__NextChar() == T_CHAR_SLASH:
- CommentObj.Content += self.__CurrentChar()
-# self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- CommentObj.Content += self.__CurrentChar()
-# self.__SetCurrentCharValue(T_CHAR_SPACE)
- CommentObj.EndPos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine)
- FileProfile.CommentList.append(CommentObj)
- CommentObj = None
- self.__GetOneChar()
- InComment = False
- # set comments to spaces
- elif InComment:
- if HashComment:
- # // follows hash PP directive
- if self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_SLASH:
- InComment = False
- HashComment = False
- PPDirectiveObj.EndPos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine - 1)
- FileProfile.PPDirectiveList.append(PPDirectiveObj)
- PPDirectiveObj = None
- continue
- else:
- PPDirectiveObj.Content += self.__CurrentChar()
- if PPExtend:
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- else:
- CommentObj.Content += self.__CurrentChar()
-# self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- # check for // comment
- elif self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_SLASH:
- InComment = True
- DoubleSlashComment = True
- CommentObj = Comment('', (self.CurrentLineNumber, self.CurrentOffsetWithinLine), None, T_COMMENT_TWO_SLASH)
- # check for '#' comment
- elif self.__CurrentChar() == T_CHAR_HASH and not InString and not InCharLiteral:
- InComment = True
- HashComment = True
- PPDirectiveObj = PP_Directive('', (self.CurrentLineNumber, self.CurrentOffsetWithinLine), None)
- # check for /* comment start
- elif self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_STAR:
- CommentObj = Comment('', (self.CurrentLineNumber, self.CurrentOffsetWithinLine), None, T_COMMENT_SLASH_STAR)
- CommentObj.Content += self.__CurrentChar()
-# self.__SetCurrentCharValue( T_CHAR_SPACE)
- self.__GetOneChar()
- CommentObj.Content += self.__CurrentChar()
-# self.__SetCurrentCharValue( T_CHAR_SPACE)
- self.__GetOneChar()
- InComment = True
- else:
- self.__GetOneChar()
-
- EndLinePos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine)
-
- if InComment and DoubleSlashComment:
- CommentObj.EndPos = EndLinePos
- FileProfile.CommentList.append(CommentObj)
- if InComment and HashComment and not PPExtend:
- PPDirectiveObj.EndPos = EndLinePos
- FileProfile.PPDirectiveList.append(PPDirectiveObj)
-
- self.Rewind()
-
- def PreprocessFileWithClear(self):
-
- self.Rewind()
- InComment = False
- DoubleSlashComment = False
- HashComment = False
- PPExtend = False
- CommentObj = None
- PPDirectiveObj = None
- # HashComment in quoted string " " is ignored.
- InString = False
- InCharLiteral = False
-
- self.Profile.FileLinesList = [list(s) for s in self.Profile.FileLinesListFromFile]
- while not self.__EndOfFile():
-
- if not InComment and self.__CurrentChar() == T_CHAR_DOUBLE_QUOTE:
- InString = not InString
-
- if not InComment and self.__CurrentChar() == T_CHAR_SINGLE_QUOTE:
- InCharLiteral = not InCharLiteral
- # meet new line, then no longer in a comment for // and '#'
- if self.__CurrentChar() == T_CHAR_LF:
- if HashComment and PPDirectiveObj != None:
- if PPDirectiveObj.Content.rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):
- PPDirectiveObj.Content += T_CHAR_LF
- PPExtend = True
- else:
- PPExtend = False
-
- EndLinePos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine)
-
- if InComment and DoubleSlashComment:
- InComment = False
- DoubleSlashComment = False
- CommentObj.Content += T_CHAR_LF
- CommentObj.EndPos = EndLinePos
- FileProfile.CommentList.append(CommentObj)
- CommentObj = None
- if InComment and HashComment and not PPExtend:
- InComment = False
- HashComment = False
- PPDirectiveObj.Content += T_CHAR_LF
- PPDirectiveObj.EndPos = EndLinePos
- FileProfile.PPDirectiveList.append(PPDirectiveObj)
- PPDirectiveObj = None
-
- if InString or InCharLiteral:
- CurrentLine = "".join(self.__CurrentLine())
- if CurrentLine.rstrip(T_CHAR_LF).rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):
- SlashIndex = CurrentLine.rindex(T_CHAR_BACKSLASH)
- self.__SetCharValue(self.CurrentLineNumber, SlashIndex, T_CHAR_SPACE)
-
- if InComment and not DoubleSlashComment and not HashComment:
- CommentObj.Content += T_CHAR_LF
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
- # check for */ comment end
- elif InComment and not DoubleSlashComment and not HashComment and self.__CurrentChar() == T_CHAR_STAR and self.__NextChar() == T_CHAR_SLASH:
- CommentObj.Content += self.__CurrentChar()
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- CommentObj.Content += self.__CurrentChar()
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- CommentObj.EndPos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine)
- FileProfile.CommentList.append(CommentObj)
- CommentObj = None
- self.__GetOneChar()
- InComment = False
- # set comments to spaces
- elif InComment:
- if HashComment:
- # // follows hash PP directive
- if self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_SLASH:
- InComment = False
- HashComment = False
- PPDirectiveObj.EndPos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine - 1)
- FileProfile.PPDirectiveList.append(PPDirectiveObj)
- PPDirectiveObj = None
- continue
- else:
- PPDirectiveObj.Content += self.__CurrentChar()
-# if PPExtend:
-# self.__SetCurrentCharValue(T_CHAR_SPACE)
- else:
- CommentObj.Content += self.__CurrentChar()
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- # check for // comment
- elif self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_SLASH:
- InComment = True
- DoubleSlashComment = True
- CommentObj = Comment('', (self.CurrentLineNumber, self.CurrentOffsetWithinLine), None, T_COMMENT_TWO_SLASH)
- # check for '#' comment
- elif self.__CurrentChar() == T_CHAR_HASH and not InString and not InCharLiteral:
- InComment = True
- HashComment = True
- PPDirectiveObj = PP_Directive('', (self.CurrentLineNumber, self.CurrentOffsetWithinLine), None)
- # check for /* comment start
- elif self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_STAR:
- CommentObj = Comment('', (self.CurrentLineNumber, self.CurrentOffsetWithinLine), None, T_COMMENT_SLASH_STAR)
- CommentObj.Content += self.__CurrentChar()
- self.__SetCurrentCharValue( T_CHAR_SPACE)
- self.__GetOneChar()
- CommentObj.Content += self.__CurrentChar()
- self.__SetCurrentCharValue( T_CHAR_SPACE)
- self.__GetOneChar()
- InComment = True
- else:
- self.__GetOneChar()
-
- EndLinePos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine)
-
- if InComment and DoubleSlashComment:
- CommentObj.EndPos = EndLinePos
- FileProfile.CommentList.append(CommentObj)
- if InComment and HashComment and not PPExtend:
- PPDirectiveObj.EndPos = EndLinePos
- FileProfile.PPDirectiveList.append(PPDirectiveObj)
- self.Rewind()
-
- ## ParseFile() method
- #
- # Parse the file profile buffer to extract fd, fv ... information
- # Exception will be raised if syntax error found
- #
- # @param self The object pointer
- #
- def ParseFile(self):
- self.PreprocessFile()
- # restore from ListOfList to ListOfString
- self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList]
- FileStringContents = ''
- for fileLine in self.Profile.FileLinesList:
- FileStringContents += fileLine
- cStream = antlr3.StringStream(FileStringContents)
- lexer = CLexer(cStream)
- tStream = antlr3.CommonTokenStream(lexer)
- parser = CParser(tStream)
- parser.translation_unit()
-
- def ParseFileWithClearedPPDirective(self):
- self.PreprocessFileWithClear()
- # restore from ListOfList to ListOfString
- self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList]
- FileStringContents = ''
- for fileLine in self.Profile.FileLinesList:
- FileStringContents += fileLine
- cStream = antlr3.StringStream(FileStringContents)
- lexer = CLexer(cStream)
- tStream = antlr3.CommonTokenStream(lexer)
- parser = CParser(tStream)
- parser.translation_unit()
-
- def CleanFileProfileBuffer(self):
- FileProfile.CommentList = []
- FileProfile.PPDirectiveList = []
- FileProfile.PredicateExpressionList = []
- FileProfile.FunctionDefinitionList = []
- FileProfile.VariableDeclarationList = []
- FileProfile.EnumerationDefinitionList = []
- FileProfile.StructUnionDefinitionList = []
- FileProfile.TypedefDefinitionList = []
- FileProfile.FunctionCallingList = []
-
- def PrintFragments(self):
-
- print '################# ' + self.FileName + '#####################'
-
- print '/****************************************/'
- print '/*************** COMMENTS ***************/'
- print '/****************************************/'
- for comment in FileProfile.CommentList:
- print str(comment.StartPos) + comment.Content
-
- print '/****************************************/'
- print '/********* PREPROCESS DIRECTIVES ********/'
- print '/****************************************/'
- for pp in FileProfile.PPDirectiveList:
- print str(pp.StartPos) + pp.Content
-
- print '/****************************************/'
- print '/********* VARIABLE DECLARATIONS ********/'
- print '/****************************************/'
- for var in FileProfile.VariableDeclarationList:
- print str(var.StartPos) + var.Modifier + ' '+ var.Declarator
-
- print '/****************************************/'
- print '/********* FUNCTION DEFINITIONS *********/'
- print '/****************************************/'
- for func in FileProfile.FunctionDefinitionList:
- print str(func.StartPos) + func.Modifier + ' '+ func.Declarator + ' ' + str(func.NamePos)
-
- print '/****************************************/'
- print '/************ ENUMERATIONS **************/'
- print '/****************************************/'
- for enum in FileProfile.EnumerationDefinitionList:
- print str(enum.StartPos) + enum.Content
-
- print '/****************************************/'
- print '/*********** STRUCTS/UNIONS *************/'
- print '/****************************************/'
- for su in FileProfile.StructUnionDefinitionList:
- print str(su.StartPos) + su.Content
-
- print '/****************************************/'
- print '/********* PREDICATE EXPRESSIONS ********/'
- print '/****************************************/'
- for predexp in FileProfile.PredicateExpressionList:
- print str(predexp.StartPos) + predexp.Content
-
- print '/****************************************/'
- print '/************** TYPEDEFS ****************/'
- print '/****************************************/'
- for typedef in FileProfile.TypedefDefinitionList:
- print str(typedef.StartPos) + typedef.ToType
-
-if __name__ == "__main__":
-
- collector = CodeFragmentCollector(sys.argv[1])
- collector.PreprocessFile()
- print "For Test."
diff --git a/BaseTools/Source/Python/Ecc/Configuration.py b/BaseTools/Source/Python/Ecc/Configuration.py
deleted file mode 100644
index 0ba8d732d7..0000000000
--- a/BaseTools/Source/Python/Ecc/Configuration.py
+++ /dev/null
@@ -1,281 +0,0 @@
-## @file
-# This file is used to define class Configuration
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import Common.EdkLogger as EdkLogger
-from Common.DataType import *
-from Common.String import *
-
-## Configuration
-#
-# This class is used to define all items in configuration file
-#
-# @param Filename: The name of configuration file, the default is config.ini
-#
-class Configuration(object):
- def __init__(self, Filename):
- self.Filename = Filename
-
- self.Version = 0.1
-
- ## Identify to if check all items
- # 1 - Check all items and ignore all other detailed items
- # 0 - Not check all items, the tool will go through all other detailed items to decide to check or not
- #
- self.CheckAll = 0
-
- ## Identify to if automatically correct mistakes
- # 1 - Automatically correct
- # 0 - Not automatically correct
- # Only the following check points can be automatically corrected, others not listed below are not supported even it is 1
- #
- # GeneralCheckTab
- # GeneralCheckIndentation
- # GeneralCheckLine
- # GeneralCheckCarriageReturn
- # SpaceCheckAll
- #
- self.AutoCorrect = 0
-
- # List customized Modifer here, split with ','
- # Defaultly use the definition in class DataType
- self.ModifierList = MODIFIER_LIST
-
- ## General Checking
- self.GeneralCheckAll = 0
-
- # Check whether NO Tab is used, replaced with spaces
- self.GeneralCheckNoTab = 1
- # The width of Tab
- self.GeneralCheckTabWidth = 2
- # Check whether the indentation is followed coding style
- self.GeneralCheckIndentation = 1
- # The width of indentation
- self.GeneralCheckIndentationWidth = 2
- # Check whether no line is exceeding defined widty
- self.GeneralCheckLine = 1
- # The width of a line
- self.GeneralCheckLineWidth = 120
- # Check whether no use of _asm in the source file
- self.GeneralCheckNo_Asm = 1
- # Check whether no use of "#progma" in source file except "#pragma pack(#)".
- self.GeneralCheckNoProgma = 1
- # Check whether there is a carriage return at the end of the file
- self.GeneralCheckCarriageReturn = 1
- # Check whether the file exists
- self.GeneralCheckFileExistence = 1
- # Check whether file has non ACSII char
- self.GeneralCheckNonAcsii = 1
-
- ## Space Checking
- self.SpaceCheckAll = 1
-
- ## Predicate Expression Checking
- self.PredicateExpressionCheckAll = 0
-
- # Check whether Boolean values, variable type BOOLEAN not use explicit comparisons to TRUE or FALSE
- self.PredicateExpressionCheckBooleanValue = 1
- # Check whether Non-Boolean comparisons use a compare operator (==, !=, >, < >=, <=).
- self.PredicateExpressionCheckNonBooleanOperator = 1
- # Check whether a comparison of any pointer to zero must be done via the NULL type
- self.PredicateExpressionCheckComparisonNullType = 1
-
- ## Headers Checking
- self.HeaderCheckAll = 0
-
- # Check whether File header exists
- self.HeaderCheckFile = 1
- # Check whether Function header exists
- self.HeaderCheckFunction = 1
- # Check whether Meta data File header Comment End with '##'
- self.HeaderCheckFileCommentEnd = 1
- # Check whether C File header Comment content start with two spaces
- self.HeaderCheckCFileCommentStartSpacesNum = 1
- # Check whether C File header Comment's each reference at list should begin with a bullet character '-'
- self.HeaderCheckCFileCommentReferenceFormat = 1
- # Check whether C File header Comment have the License immediately after the ""Copyright"" line
- self.HeaderCheckCFileCommentLicenseFormat = 1
-
- ## C Function Layout Checking
- self.CFunctionLayoutCheckAll = 0
-
- # Check whether return type exists and in the first line
- self.CFunctionLayoutCheckReturnType = 1
- # Check whether any optional functional modifiers exist and next to the return type
- self.CFunctionLayoutCheckOptionalFunctionalModifier = 1
- # Check whether the next line contains the function name, left justified, followed by the beginning of the parameter list
- # Check whether the closing parenthesis is on its own line and also indented two spaces
- self.CFunctionLayoutCheckFunctionName = 1
- # Check whether the function prototypes in include files have the same form as function definitions
- self.CFunctionLayoutCheckFunctionPrototype = 1
- # Check whether the body of a function is contained by open and close braces that must be in the first column
- self.CFunctionLayoutCheckFunctionBody = 1
- # Check whether the data declarations is the first code in a module.
- self.CFunctionLayoutCheckDataDeclaration = 1
- # Check whether no initialization of a variable as part of its declaration
- self.CFunctionLayoutCheckNoInitOfVariable = 1
- # Check whether no use of STATIC for functions
- self.CFunctionLayoutCheckNoStatic = 1
-
- ## Include Files Checking
- self.IncludeFileCheckAll = 0
-
- #Check whether having include files with same name
- self.IncludeFileCheckSameName = 1
- # Check whether all include file contents is guarded by a #ifndef statement.
- # the #ifndef must be the first line of code following the file header comment
- # the #endif must appear on the last line in the file
- self.IncludeFileCheckIfndefStatement = 1
- # Check whether include files contain only public or only private data
- # Check whether include files NOT contain code or define data variables
- self.IncludeFileCheckData = 1
-
- ## Declarations and Data Types Checking
- self.DeclarationDataTypeCheckAll = 0
-
- # Check whether no use of int, unsigned, char, void, static, long in any .c, .h or .asl files.
- self.DeclarationDataTypeCheckNoUseCType = 1
- # Check whether the modifiers IN, OUT, OPTIONAL, and UNALIGNED are used only to qualify arguments to a function and should not appear in a data type declaration
- self.DeclarationDataTypeCheckInOutModifier = 1
- # Check whether the EFIAPI modifier should be used at the entry of drivers, events, and member functions of protocols
- self.DeclarationDataTypeCheckEFIAPIModifier = 1
- # Check whether Enumerated Type has a 'typedef' and the name is capital
- self.DeclarationDataTypeCheckEnumeratedType = 1
- # Check whether Structure Type has a 'typedef' and the name is capital
- self.DeclarationDataTypeCheckStructureDeclaration = 1
- # Check whether having same Structure
- self.DeclarationDataTypeCheckSameStructure = 1
- # Check whether Union Type has a 'typedef' and the name is capital
- self.DeclarationDataTypeCheckUnionType = 1
-
- ## Naming Conventions Checking
- self.NamingConventionCheckAll = 0
-
- # Check whether only capital letters are used for #define declarations
- self.NamingConventionCheckDefineStatement = 1
- # Check whether only capital letters are used for typedef declarations
- self.NamingConventionCheckTypedefStatement = 1
- # Check whether the #ifndef at the start of an include file uses both prefix and postfix underscore characters, '_'.
- self.NamingConventionCheckIfndefStatement = 1
- # Rule for path name, variable name and function name
- # 1. First character should be upper case
- # 2. Existing lower case in a word
- # 3. No space existence
- # Check whether the path name followed the rule
- self.NamingConventionCheckPathName = 1
- # Check whether the variable name followed the rule
- self.NamingConventionCheckVariableName = 1
- # Check whether the function name followed the rule
- self.NamingConventionCheckFunctionName = 1
- # Check whether NO use short variable name with single character
- self.NamingConventionCheckSingleCharacterVariable = 1
-
- ## Doxygen Checking
- self.DoxygenCheckAll = 0
-
- # Check whether the file headers are followed Doxygen special documentation blocks in section 2.3.5
- self.DoxygenCheckFileHeader = 1
- # Check whether the function headers are followed Doxygen special documentation blocks in section 2.3.5
- self.DoxygenCheckFunctionHeader = 1
- # Check whether the first line of text in a comment block is a brief description of the element being documented.
- # The brief description must end with a period.
- self.DoxygenCheckCommentDescription = 1
- # Check whether comment lines with '///< ... text ...' format, if it is used, it should be after the code section.
- self.DoxygenCheckCommentFormat = 1
- # Check whether only Doxygen commands allowed to mark the code are @bug and @todo.
- self.DoxygenCheckCommand = 1
-
- ## Meta-Data File Processing Checking
- self.MetaDataFileCheckAll = 0
-
- # Check whether each file defined in meta-data exists
- self.MetaDataFileCheckPathName = 1
- # Generate a list for all files defined in meta-data files
- self.MetaDataFileCheckGenerateFileList = 1
- # The path of log file
- self.MetaDataFileCheckPathOfGenerateFileList = 'File.log'
- # Check whether all Library Instances defined for a given module (or dependent library instance) match the module's type.
- # Each Library Instance must specify the Supported Module Types in its INF file,
- # and any module specifying the library instance must be one of the supported types.
- self.MetaDataFileCheckLibraryInstance = 1
- # Check whether a Library Instance has been defined for all dependent library classes
- self.MetaDataFileCheckLibraryInstanceDependent = 1
- # Check whether the Library Instances specified by the LibraryClasses sections are listed in order of dependencies
- self.MetaDataFileCheckLibraryInstanceOrder = 1
- # Check whether the unnecessary inclusion of library classes in the INF file
- self.MetaDataFileCheckLibraryNoUse = 1
- # Check whether an INF file is specified in the FDF file, but not in the DSC file, then the INF file must be for a Binary module only
- self.MetaDataFileCheckBinaryInfInFdf = 1
- # Not to report error and warning related OS include file such as "windows.h" and "stdio.h"
- # Check whether a PCD is set in a DSC file or the FDF file, but not in both.
- self.MetaDataFileCheckPcdDuplicate = 1
- # Check whether PCD settings in the FDF file can only be related to flash.
- self.MetaDataFileCheckPcdFlash = 1
- # Check whether PCDs used in INF files but not specified in DSC or FDF files
- self.MetaDataFileCheckPcdNoUse = 1
- # Check whether having duplicate guids defined for Guid/Protocol/Ppi
- self.MetaDataFileCheckGuidDuplicate = 1
- # Check whether all files under module directory are described in INF files
- self.MetaDataFileCheckModuleFileNoUse = 1
- # Check whether the PCD is correctly used in C function via its type
- self.MetaDataFileCheckPcdType = 1
- # Check whether there are FILE_GUID duplication among different INF files
- self.MetaDataFileCheckModuleFileGuidDuplication = 1
-
- #
- # The check points in this section are reserved
- #
- # GotoStatementCheckAll = 0
- #
- self.SpellingCheckAll = 0
-
- # The directory listed here will not be parsed, split with ','
- self.SkipDirList = []
-
- # A list for binary file ext name
- self.BinaryExtList = []
-
- self.ParseConfig()
-
- def ParseConfig(self):
- Filepath = os.path.normpath(self.Filename)
- if not os.path.isfile(Filepath):
- ErrorMsg = "Can't find configuration file '%s'" % Filepath
- EdkLogger.error("Ecc", EdkLogger.ECC_ERROR, ErrorMsg, File = Filepath)
-
- LineNo = 0
- for Line in open(Filepath, 'r'):
- LineNo = LineNo + 1
- Line = CleanString(Line)
- if Line != '':
- List = GetSplitValueList(Line, TAB_EQUAL_SPLIT)
- if List[0] not in self.__dict__:
- ErrorMsg = "Invalid configuration option '%s' was found" % List[0]
- EdkLogger.error("Ecc", EdkLogger.ECC_ERROR, ErrorMsg, File = Filepath, Line = LineNo)
- if List[0] == 'ModifierList':
- List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)
- if List[0] == 'MetaDataFileCheckPathOfGenerateFileList' and List[1] == "":
- continue
- if List[0] == 'SkipDirList':
- List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)
- if List[0] == 'BinaryExtList':
- List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)
- self.__dict__[List[0]] = List[1]
-
- def ShowMe(self):
- print self.Filename
- for Key in self.__dict__.keys():
- print Key, '=', self.__dict__[Key]
diff --git a/BaseTools/Source/Python/Ecc/Database.py b/BaseTools/Source/Python/Ecc/Database.py
deleted file mode 100644
index f3e2b5934a..0000000000
--- a/BaseTools/Source/Python/Ecc/Database.py
+++ /dev/null
@@ -1,345 +0,0 @@
-## @file
-# This file is used to create a database used by ECC tool
-#
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import sqlite3
-import os, time
-
-import Common.EdkLogger as EdkLogger
-import CommonDataClass.DataClass as DataClass
-
-from Table.TableDataModel import TableDataModel
-from Table.TableFile import TableFile
-from Table.TableFunction import TableFunction
-from Table.TablePcd import TablePcd
-from Table.TableIdentifier import TableIdentifier
-from Table.TableReport import TableReport
-from MetaFileWorkspace.MetaFileTable import ModuleTable
-from MetaFileWorkspace.MetaFileTable import PackageTable
-from MetaFileWorkspace.MetaFileTable import PlatformTable
-from Table.TableFdf import TableFdf
-
-##
-# Static definitions
-#
-DATABASE_PATH = "Ecc.db"
-
-## Database
-#
-# This class defined the ECC databse
-# During the phase of initialization, the database will create all tables and
-# insert all records of table DataModel
-#
-# @param object: Inherited from object class
-# @param DbPath: A string for the path of the ECC database
-#
-# @var Conn: Connection of the ECC database
-# @var Cur: Cursor of the connection
-# @var TblDataModel: Local instance for TableDataModel
-#
-class Database(object):
- def __init__(self, DbPath):
- self.DbPath = DbPath
- self.Conn = None
- self.Cur = None
- self.TblDataModel = None
- self.TblFile = None
- self.TblFunction = None
- self.TblIdentifier = None
- self.TblPcd = None
- self.TblReport = None
- self.TblInf = None
- self.TblDec = None
- self.TblDsc = None
- self.TblFdf = None
-
- ## Initialize ECC database
- #
- # 1. Delete all old existing tables
- # 2. Create new tables
- # 3. Initialize table DataModel
- #
- def InitDatabase(self, NewDatabase = True):
- EdkLogger.verbose("\nInitialize ECC database started ...")
- #
- # Drop all old existing tables
- #
- if NewDatabase:
- if os.path.exists(self.DbPath):
- os.remove(self.DbPath)
- self.Conn = sqlite3.connect(self.DbPath, isolation_level = 'DEFERRED')
- self.Conn.execute("PRAGMA page_size=4096")
- self.Conn.execute("PRAGMA synchronous=OFF")
- # to avoid non-ascii charater conversion error
- self.Conn.text_factory = str
- self.Cur = self.Conn.cursor()
-
- self.TblDataModel = TableDataModel(self.Cur)
- self.TblFile = TableFile(self.Cur)
- self.TblFunction = TableFunction(self.Cur)
- self.TblIdentifier = TableIdentifier(self.Cur)
- self.TblPcd = TablePcd(self.Cur)
- self.TblReport = TableReport(self.Cur)
- self.TblInf = ModuleTable(self.Cur)
- self.TblDec = PackageTable(self.Cur)
- self.TblDsc = PlatformTable(self.Cur)
- self.TblFdf = TableFdf(self.Cur)
-
- #
- # Create new tables
- #
- if NewDatabase:
- self.TblDataModel.Create()
- self.TblFile.Create()
- self.TblFunction.Create()
- self.TblPcd.Create()
- self.TblReport.Create()
- self.TblInf.Create()
- self.TblDec.Create()
- self.TblDsc.Create()
- self.TblFdf.Create()
-
- #
- # Init each table's ID
- #
- self.TblDataModel.InitID()
- self.TblFile.InitID()
- self.TblFunction.InitID()
- self.TblPcd.InitID()
- self.TblReport.InitID()
- self.TblInf.InitID()
- self.TblDec.InitID()
- self.TblDsc.InitID()
- self.TblFdf.InitID()
-
- #
- # Initialize table DataModel
- #
- if NewDatabase:
- self.TblDataModel.InitTable()
-
- EdkLogger.verbose("Initialize ECC database ... DONE!")
-
- ## Query a table
- #
- # @param Table: The instance of the table to be queried
- #
- def QueryTable(self, Table):
- Table.Query()
-
- ## Close entire database
- #
- # Commit all first
- # Close the connection and cursor
- #
- def Close(self):
- #
- # Commit to file
- #
- self.Conn.commit()
-
- #
- # Close connection and cursor
- #
- self.Cur.close()
- self.Conn.close()
-
- ## Insert one file information
- #
- # Insert one file's information to the database
- # 1. Create a record in TableFile
- # 2. Create functions one by one
- # 2.1 Create variables of function one by one
- # 2.2 Create pcds of function one by one
- # 3. Create variables one by one
- # 4. Create pcds one by one
- #
- def InsertOneFile(self, File):
- #
- # Insert a record for file
- #
- FileID = self.TblFile.Insert(File.Name, File.ExtName, File.Path, File.FullPath, Model = File.Model, TimeStamp = File.TimeStamp)
-
- if File.Model == DataClass.MODEL_FILE_C or File.Model == DataClass.MODEL_FILE_H:
- IdTable = TableIdentifier(self.Cur)
- IdTable.Table = "Identifier%s" % FileID
- IdTable.Create()
- #
- # Insert function of file
- #
- for Function in File.FunctionList:
- FunctionID = self.TblFunction.Insert(Function.Header, Function.Modifier, Function.Name, Function.ReturnStatement, \
- Function.StartLine, Function.StartColumn, Function.EndLine, Function.EndColumn, \
- Function.BodyStartLine, Function.BodyStartColumn, FileID, \
- Function.FunNameStartLine, Function.FunNameStartColumn)
- #
- # Insert Identifier of function
- #
- for Identifier in Function.IdentifierList:
- IdentifierID = IdTable.Insert(Identifier.Modifier, Identifier.Type, Identifier.Name, Identifier.Value, Identifier.Model, \
- FileID, FunctionID, Identifier.StartLine, Identifier.StartColumn, Identifier.EndLine, Identifier.EndColumn)
- #
- # Insert Pcd of function
- #
- for Pcd in Function.PcdList:
- PcdID = self.TblPcd.Insert(Pcd.CName, Pcd.TokenSpaceGuidCName, Pcd.Token, Pcd.DatumType, Pcd.Model, \
- FileID, FunctionID, Pcd.StartLine, Pcd.StartColumn, Pcd.EndLine, Pcd.EndColumn)
- #
- # Insert Identifier of file
- #
- for Identifier in File.IdentifierList:
- IdentifierID = IdTable.Insert(Identifier.Modifier, Identifier.Type, Identifier.Name, Identifier.Value, Identifier.Model, \
- FileID, -1, Identifier.StartLine, Identifier.StartColumn, Identifier.EndLine, Identifier.EndColumn)
- #
- # Insert Pcd of file
- #
- for Pcd in File.PcdList:
- PcdID = self.TblPcd.Insert(Pcd.CName, Pcd.TokenSpaceGuidCName, Pcd.Token, Pcd.DatumType, Pcd.Model, \
- FileID, -1, Pcd.StartLine, Pcd.StartColumn, Pcd.EndLine, Pcd.EndColumn)
-
- EdkLogger.verbose("Insert information from file %s ... DONE!" % File.FullPath)
-
- ## UpdateIdentifierBelongsToFunction
- #
- # Update the field "BelongsToFunction" for each Indentifier
- #
- #
- def UpdateIdentifierBelongsToFunction_disabled(self):
- EdkLogger.verbose("Update 'BelongsToFunction' for Identifiers started ...")
-
- SqlCommand = """select ID, BelongsToFile, StartLine, EndLine, Model from Identifier"""
- EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)
- self.Cur.execute(SqlCommand)
- Records = self.Cur.fetchall()
- for Record in Records:
- IdentifierID = Record[0]
- BelongsToFile = Record[1]
- StartLine = Record[2]
- EndLine = Record[3]
- Model = Record[4]
-
- #
- # Check whether an identifier belongs to a function
- #
- EdkLogger.debug(4, "For common identifiers ... ")
- SqlCommand = """select ID from Function
- where StartLine < %s and EndLine > %s
- and BelongsToFile = %s""" % (StartLine, EndLine, BelongsToFile)
- EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)
- self.Cur.execute(SqlCommand)
- IDs = self.Cur.fetchall()
- for ID in IDs:
- SqlCommand = """Update Identifier set BelongsToFunction = %s where ID = %s""" % (ID[0], IdentifierID)
- EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)
- self.Cur.execute(SqlCommand)
-
- #
- # Check whether the identifier is a function header
- #
- EdkLogger.debug(4, "For function headers ... ")
- if Model == DataClass.MODEL_IDENTIFIER_COMMENT:
- SqlCommand = """select ID from Function
- where StartLine = %s + 1
- and BelongsToFile = %s""" % (EndLine, BelongsToFile)
- EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)
- self.Cur.execute(SqlCommand)
- IDs = self.Cur.fetchall()
- for ID in IDs:
- SqlCommand = """Update Identifier set BelongsToFunction = %s, Model = %s where ID = %s""" % (ID[0], DataClass.MODEL_IDENTIFIER_FUNCTION_HEADER, IdentifierID)
- EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)
- self.Cur.execute(SqlCommand)
-
- EdkLogger.verbose("Update 'BelongsToFunction' for Identifiers ... DONE")
-
-
- ## UpdateIdentifierBelongsToFunction
- #
- # Update the field "BelongsToFunction" for each Indentifier
- #
- #
- def UpdateIdentifierBelongsToFunction(self):
- EdkLogger.verbose("Update 'BelongsToFunction' for Identifiers started ...")
-
- SqlCommand = """select ID, BelongsToFile, StartLine, EndLine from Function"""
- Records = self.TblFunction.Exec(SqlCommand)
- Data1 = []
- Data2 = []
- for Record in Records:
- FunctionID = Record[0]
- BelongsToFile = Record[1]
- StartLine = Record[2]
- EndLine = Record[3]
- #Data1.append(("'file%s'" % BelongsToFile, FunctionID, BelongsToFile, StartLine, EndLine))
- #Data2.append(("'file%s'" % BelongsToFile, FunctionID, DataClass.MODEL_IDENTIFIER_FUNCTION_HEADER, BelongsToFile, DataClass.MODEL_IDENTIFIER_COMMENT, StartLine - 1))
-
- SqlCommand = """Update Identifier%s set BelongsToFunction = %s where BelongsToFile = %s and StartLine > %s and EndLine < %s""" % \
- (BelongsToFile, FunctionID, BelongsToFile, StartLine, EndLine)
- self.TblIdentifier.Exec(SqlCommand)
-
- SqlCommand = """Update Identifier%s set BelongsToFunction = %s, Model = %s where BelongsToFile = %s and Model = %s and EndLine = %s""" % \
- (BelongsToFile, FunctionID, DataClass.MODEL_IDENTIFIER_FUNCTION_HEADER, BelongsToFile, DataClass.MODEL_IDENTIFIER_COMMENT, StartLine - 1)
- self.TblIdentifier.Exec(SqlCommand)
-# #
-# # Check whether an identifier belongs to a function
-# #
-# print Data1
-# SqlCommand = """Update ? set BelongsToFunction = ? where BelongsToFile = ? and StartLine > ? and EndLine < ?"""
-# print SqlCommand
-# EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)
-# self.Cur.executemany(SqlCommand, Data1)
-#
-# #
-# # Check whether the identifier is a function header
-# #
-# EdkLogger.debug(4, "For function headers ... ")
-# SqlCommand = """Update ? set BelongsToFunction = ?, Model = ? where BelongsToFile = ? and Model = ? and EndLine = ?"""
-# EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)
-# self.Cur.executemany(SqlCommand, Data2)
-#
-# EdkLogger.verbose("Update 'BelongsToFunction' for Identifiers ... DONE")
-
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- EdkLogger.Initialize()
- #EdkLogger.SetLevel(EdkLogger.VERBOSE)
- EdkLogger.SetLevel(EdkLogger.DEBUG_0)
- EdkLogger.verbose("Start at " + time.strftime('%H:%M:%S', time.localtime()))
-
- Db = Database(DATABASE_PATH)
- Db.InitDatabase()
- Db.QueryTable(Db.TblDataModel)
-
- identifier1 = DataClass.IdentifierClass(-1, '', '', "i''1", 'aaa', DataClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 32, 43, 54, 43)
- identifier2 = DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa', DataClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 15, 43, 20, 43)
- identifier3 = DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa', DataClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 55, 43, 58, 43)
- identifier4 = DataClass.IdentifierClass(-1, '', '', "i1'", 'aaa', DataClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 77, 43, 88, 43)
- fun1 = DataClass.FunctionClass(-1, '', '', 'fun1', '', 21, 2, 60, 45, 1, 23, 0, [], [])
- file = DataClass.FileClass(-1, 'F1', 'c', 'C:\\', 'C:\\F1.exe', DataClass.MODEL_FILE_C, '2007-12-28', [fun1], [identifier1, identifier2, identifier3, identifier4], [])
- Db.InsertOneFile(file)
- Db.UpdateIdentifierBelongsToFunction()
-
- Db.QueryTable(Db.TblFile)
- Db.QueryTable(Db.TblFunction)
- Db.QueryTable(Db.TblPcd)
- Db.QueryTable(Db.TblIdentifier)
-
- Db.Close()
- EdkLogger.verbose("End at " + time.strftime('%H:%M:%S', time.localtime()))
-
diff --git a/BaseTools/Source/Python/Ecc/Ecc.py b/BaseTools/Source/Python/Ecc/Ecc.py
deleted file mode 100644
index b1a0ab8272..0000000000
--- a/BaseTools/Source/Python/Ecc/Ecc.py
+++ /dev/null
@@ -1,395 +0,0 @@
-## @file
-# This file is used to be the main entrance of ECC tool
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os, time, glob, sys
-import Common.EdkLogger as EdkLogger
-import Database
-import EccGlobalData
-from MetaDataParser import *
-from optparse import OptionParser
-from Configuration import Configuration
-from Check import Check
-import Common.GlobalData as GlobalData
-
-from Common.String import NormPath
-from Common.BuildVersion import gBUILD_VERSION
-from Common import BuildToolError
-from Common.Misc import PathClass
-from Common.Misc import DirCache
-from MetaFileWorkspace.MetaFileParser import DscParser
-from MetaFileWorkspace.MetaFileParser import DecParser
-from MetaFileWorkspace.MetaFileParser import InfParser
-from MetaFileWorkspace.MetaFileParser import Fdf
-from MetaFileWorkspace.MetaFileTable import MetaFileStorage
-import c
-import re, string
-from Exception import *
-
-## Ecc
-#
-# This class is used to define Ecc main entrance
-#
-# @param object: Inherited from object class
-#
-class Ecc(object):
- def __init__(self):
- # Version and Copyright
- self.VersionNumber = ("0.01" + " " + gBUILD_VERSION)
- self.Version = "%prog Version " + self.VersionNumber
- self.Copyright = "Copyright (c) 2009 - 2010, Intel Corporation All rights reserved."
-
- self.InitDefaultConfigIni()
- self.OutputFile = 'output.txt'
- self.ReportFile = 'Report.csv'
- self.ExceptionFile = 'exception.xml'
- self.IsInit = True
- self.ScanSourceCode = True
- self.ScanMetaData = True
- self.MetaFile = ''
-
- # Parse the options and args
- self.ParseOption()
-
- #
- # Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always point to ECP
- #
- WorkspaceDir = os.path.normcase(os.path.normpath(os.environ["WORKSPACE"]))
- os.environ["WORKSPACE"] = WorkspaceDir
- if "ECP_SOURCE" not in os.environ:
- os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg)
- if "EFI_SOURCE" not in os.environ:
- os.environ["EFI_SOURCE"] = os.environ["ECP_SOURCE"]
- if "EDK_SOURCE" not in os.environ:
- os.environ["EDK_SOURCE"] = os.environ["ECP_SOURCE"]
-
- #
- # Unify case of characters on case-insensitive systems
- #
- EfiSourceDir = os.path.normcase(os.path.normpath(os.environ["EFI_SOURCE"]))
- EdkSourceDir = os.path.normcase(os.path.normpath(os.environ["EDK_SOURCE"]))
- EcpSourceDir = os.path.normcase(os.path.normpath(os.environ["ECP_SOURCE"]))
-
- os.environ["EFI_SOURCE"] = EfiSourceDir
- os.environ["EDK_SOURCE"] = EdkSourceDir
- os.environ["ECP_SOURCE"] = EcpSourceDir
-
- GlobalData.gWorkspace = WorkspaceDir
- GlobalData.gEfiSource = EfiSourceDir
- GlobalData.gEdkSource = EdkSourceDir
- GlobalData.gEcpSource = EcpSourceDir
-
- GlobalData.gGlobalDefines["WORKSPACE"] = WorkspaceDir
- GlobalData.gGlobalDefines["EFI_SOURCE"] = EfiSourceDir
- GlobalData.gGlobalDefines["EDK_SOURCE"] = EdkSourceDir
- GlobalData.gGlobalDefines["ECP_SOURCE"] = EcpSourceDir
-
-
- # Generate checkpoints list
- EccGlobalData.gConfig = Configuration(self.ConfigFile)
-
- # Generate exception list
- EccGlobalData.gException = ExceptionCheck(self.ExceptionFile)
-
- # Init Ecc database
- EccGlobalData.gDb = Database.Database(Database.DATABASE_PATH)
- EccGlobalData.gDb.InitDatabase(self.IsInit)
-
- #
- # Get files real name in workspace dir
- #
- GlobalData.gAllFiles = DirCache(GlobalData.gWorkspace)
-
- # Build ECC database
- self.BuildDatabase()
-
- # Start to check
- self.Check()
-
- # Show report
- self.GenReport()
-
- # Close Database
- EccGlobalData.gDb.Close()
-
- def InitDefaultConfigIni(self):
- paths = map(lambda p: os.path.join(p, 'Ecc', 'config.ini'), sys.path)
- paths = (os.path.realpath('config.ini'),) + tuple(paths)
- for path in paths:
- if os.path.exists(path):
- self.ConfigFile = path
- return
- self.ConfigFile = 'config.ini'
-
- ## BuildDatabase
- #
- # Build the database for target
- #
- def BuildDatabase(self):
- # Clean report table
- EccGlobalData.gDb.TblReport.Drop()
- EccGlobalData.gDb.TblReport.Create()
-
- # Build database
- if self.IsInit:
- if self.ScanMetaData:
- EdkLogger.quiet("Building database for Meta Data File ...")
- self.BuildMetaDataFileDatabase()
- if self.ScanSourceCode:
- EdkLogger.quiet("Building database for Meta Data File Done!")
- c.CollectSourceCodeDataIntoDB(EccGlobalData.gTarget)
-
- EccGlobalData.gIdentifierTableList = GetTableList((MODEL_FILE_C, MODEL_FILE_H), 'Identifier', EccGlobalData.gDb)
- EccGlobalData.gCFileList = GetFileList(MODEL_FILE_C, EccGlobalData.gDb)
- EccGlobalData.gHFileList = GetFileList(MODEL_FILE_H, EccGlobalData.gDb)
-
- ## BuildMetaDataFileDatabase
- #
- # Build the database for meta data files
- #
- def BuildMetaDataFileDatabase(self):
- EdkLogger.quiet("Building database for meta data files ...")
- Op = open(EccGlobalData.gConfig.MetaDataFileCheckPathOfGenerateFileList, 'w+')
- #SkipDirs = Read from config file
- SkipDirs = EccGlobalData.gConfig.SkipDirList
- SkipDirString = string.join(SkipDirs, '|')
- p = re.compile(r'.*[\\/](?:%s)[\\/]?.*' % SkipDirString)
- for Root, Dirs, Files in os.walk(EccGlobalData.gTarget):
- if p.match(Root.upper()):
- continue
- for Dir in Dirs:
- Dirname = os.path.join(Root, Dir)
- if os.path.islink(Dirname):
- Dirname = os.path.realpath(Dirname)
- if os.path.isdir(Dirname):
- # symlinks to directories are treated as directories
- Dirs.remove(Dir)
- Dirs.append(Dirname)
-
- for File in Files:
- if len(File) > 4 and File[-4:].upper() == ".DEC":
- Filename = os.path.normpath(os.path.join(Root, File))
- EdkLogger.quiet("Parsing %s" % Filename)
- Op.write("%s\r" % Filename)
- #Dec(Filename, True, True, EccGlobalData.gWorkspace, EccGlobalData.gDb)
- self.MetaFile = DecParser(Filename, MODEL_FILE_DEC, EccGlobalData.gDb.TblDec)
- self.MetaFile.Start()
- continue
- if len(File) > 4 and File[-4:].upper() == ".DSC":
- Filename = os.path.normpath(os.path.join(Root, File))
- EdkLogger.quiet("Parsing %s" % Filename)
- Op.write("%s\r" % Filename)
- #Dsc(Filename, True, True, EccGlobalData.gWorkspace, EccGlobalData.gDb)
- self.MetaFile = DscParser(PathClass(Filename, Root), MODEL_FILE_DSC, MetaFileStorage(EccGlobalData.gDb.TblDsc.Cur, Filename, MODEL_FILE_DSC, True))
- # alwasy do post-process, in case of macros change
- self.MetaFile.DoPostProcess()
- self.MetaFile.Start()
- self.MetaFile._PostProcess()
- continue
- if len(File) > 4 and File[-4:].upper() == ".INF":
- Filename = os.path.normpath(os.path.join(Root, File))
- EdkLogger.quiet("Parsing %s" % Filename)
- Op.write("%s\r" % Filename)
- #Inf(Filename, True, True, EccGlobalData.gWorkspace, EccGlobalData.gDb)
- self.MetaFile = InfParser(Filename, MODEL_FILE_INF, EccGlobalData.gDb.TblInf)
- self.MetaFile.Start()
- continue
- if len(File) > 4 and File[-4:].upper() == ".FDF":
- Filename = os.path.normpath(os.path.join(Root, File))
- EdkLogger.quiet("Parsing %s" % Filename)
- Op.write("%s\r" % Filename)
- Fdf(Filename, True, EccGlobalData.gWorkspace, EccGlobalData.gDb)
- continue
- Op.close()
-
- # Commit to database
- EccGlobalData.gDb.Conn.commit()
-
- EdkLogger.quiet("Building database for meta data files done!")
-
- ##
- #
- # Check each checkpoint
- #
- def Check(self):
- EdkLogger.quiet("Checking ...")
- EccCheck = Check()
- EccCheck.Check()
- EdkLogger.quiet("Checking done!")
-
- ##
- #
- # Generate the scan report
- #
- def GenReport(self):
- EdkLogger.quiet("Generating report ...")
- EccGlobalData.gDb.TblReport.ToCSV(self.ReportFile)
- EdkLogger.quiet("Generating report done!")
-
- def GetRealPathCase(self, path):
- TmpPath = path.rstrip(os.sep)
- PathParts = TmpPath.split(os.sep)
- if len(PathParts) == 0:
- return path
- if len(PathParts) == 1:
- if PathParts[0].strip().endswith(':'):
- return PathParts[0].upper()
- # Relative dir, list . current dir
- Dirs = os.listdir('.')
- for Dir in Dirs:
- if Dir.upper() == PathParts[0].upper():
- return Dir
-
- if PathParts[0].strip().endswith(':'):
- PathParts[0] = PathParts[0].upper()
- ParentDir = PathParts[0]
- RealPath = ParentDir
- if PathParts[0] == '':
- RealPath = os.sep
- ParentDir = os.sep
-
- PathParts.remove(PathParts[0]) # need to remove the parent
- for Part in PathParts:
- Dirs = os.listdir(ParentDir + os.sep)
- for Dir in Dirs:
- if Dir.upper() == Part.upper():
- RealPath += os.sep
- RealPath += Dir
- break
- ParentDir += os.sep
- ParentDir += Dir
-
- return RealPath
-
- ## ParseOption
- #
- # Parse options
- #
- def ParseOption(self):
- EdkLogger.quiet("Loading ECC configuration ... done")
- (Options, Target) = self.EccOptionParser()
-
- if Options.Workspace:
- os.environ["WORKSPACE"] = Options.Workspace
-
- # Check workspace envirnoment
- if "WORKSPACE" not in os.environ:
- EdkLogger.error("ECC", BuildToolError.ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
- ExtraData="WORKSPACE")
- else:
- EccGlobalData.gWorkspace = os.path.normpath(os.getenv("WORKSPACE"))
- if not os.path.exists(EccGlobalData.gWorkspace):
- EdkLogger.error("ECC", BuildToolError.FILE_NOT_FOUND, ExtraData="WORKSPACE = %s" % EccGlobalData.gWorkspace)
- os.environ["WORKSPACE"] = EccGlobalData.gWorkspace
- # Set log level
- self.SetLogLevel(Options)
-
- # Set other options
- if Options.ConfigFile != None:
- self.ConfigFile = Options.ConfigFile
- if Options.OutputFile != None:
- self.OutputFile = Options.OutputFile
- if Options.ReportFile != None:
- self.ReportFile = Options.ReportFile
- if Options.ExceptionFile != None:
- self.ExceptionFile = Options.ExceptionFile
- if Options.Target != None:
- if not os.path.isdir(Options.Target):
- EdkLogger.error("ECC", BuildToolError.OPTION_VALUE_INVALID, ExtraData="Target [%s] does NOT exist" % Options.Target)
- else:
- EccGlobalData.gTarget = self.GetRealPathCase(os.path.normpath(Options.Target))
- else:
- EdkLogger.warn("Ecc", EdkLogger.ECC_ERROR, "The target source tree was not specified, using current WORKSPACE instead!")
- EccGlobalData.gTarget = os.path.normpath(os.getenv("WORKSPACE"))
- if Options.keepdatabase != None:
- self.IsInit = False
- if Options.metadata != None and Options.sourcecode != None:
- EdkLogger.error("ECC", BuildToolError.OPTION_CONFLICT, ExtraData="-m and -s can't be specified at one time")
- if Options.metadata != None:
- self.ScanSourceCode = False
- if Options.sourcecode != None:
- self.ScanMetaData = False
-
- ## SetLogLevel
- #
- # Set current log level of the tool based on args
- #
- # @param Option: The option list including log level setting
- #
- def SetLogLevel(self, Option):
- if Option.verbose != None:
- EdkLogger.SetLevel(EdkLogger.VERBOSE)
- elif Option.quiet != None:
- EdkLogger.SetLevel(EdkLogger.QUIET)
- elif Option.debug != None:
- EdkLogger.SetLevel(Option.debug + 1)
- else:
- EdkLogger.SetLevel(EdkLogger.INFO)
-
- ## Parse command line options
- #
- # Using standard Python module optparse to parse command line option of this tool.
- #
- # @retval Opt A optparse.Values object containing the parsed options
- # @retval Args Target of build command
- #
- def EccOptionParser(self):
- Parser = OptionParser(description = self.Copyright, version = self.Version, prog = "Ecc.exe", usage = "%prog [options]")
- Parser.add_option("-t", "--target sourcepath", action="store", type="string", dest='Target',
- help="Check all files under the target workspace.")
- Parser.add_option("-c", "--config filename", action="store", type="string", dest="ConfigFile",
- help="Specify a configuration file. Defaultly use config.ini under ECC tool directory.")
- Parser.add_option("-o", "--outfile filename", action="store", type="string", dest="OutputFile",
- help="Specify the name of an output file, if and only if one filename was specified.")
- Parser.add_option("-r", "--reportfile filename", action="store", type="string", dest="ReportFile",
- help="Specify the name of an report file, if and only if one filename was specified.")
- Parser.add_option("-e", "--exceptionfile filename", action="store", type="string", dest="ExceptionFile",
- help="Specify the name of an exception file, if and only if one filename was specified.")
- Parser.add_option("-m", "--metadata", action="store_true", type=None, help="Only scan meta-data files information if this option is specified.")
- Parser.add_option("-s", "--sourcecode", action="store_true", type=None, help="Only scan source code files information if this option is specified.")
- Parser.add_option("-k", "--keepdatabase", action="store_true", type=None, help="The existing Ecc database will not be cleaned except report information if this option is specified.")
- Parser.add_option("-l", "--log filename", action="store", dest="LogFile", help="""If specified, the tool should emit the changes that
- were made by the tool after printing the result message.
- If filename, the emit to the file, otherwise emit to
- standard output. If no modifications were made, then do not
- create a log file, or output a log message.""")
- Parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")
- Parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed, "\
- "including library instances selected, final dependency expression, "\
- "and warning messages, etc.")
- Parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.")
- Parser.add_option("-w", "--workspace", action="store", type="string", dest='Workspace', help="Specify workspace.")
-
- (Opt, Args)=Parser.parse_args()
-
- return (Opt, Args)
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- # Initialize log system
- EdkLogger.Initialize()
- EdkLogger.IsRaiseError = False
- EdkLogger.quiet(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime()) + "[00:00]" + "\n")
-
- StartTime = time.clock()
- Ecc = Ecc()
- FinishTime = time.clock()
-
- BuildDuration = time.strftime("%M:%S", time.gmtime(int(round(FinishTime - StartTime))))
- EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d %Y", time.localtime()), BuildDuration))
diff --git a/BaseTools/Source/Python/Ecc/EccGlobalData.py b/BaseTools/Source/Python/Ecc/EccGlobalData.py
deleted file mode 100644
index 5226e4a7d1..0000000000
--- a/BaseTools/Source/Python/Ecc/EccGlobalData.py
+++ /dev/null
@@ -1,26 +0,0 @@
-## @file
-# This file is used to save global datas used by ECC tool
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-
-gWorkspace = ''
-gTarget = ''
-gConfig = None
-gDb = None
-gIdentifierTableList = []
-gCFileList = []
-gHFileList = []
-gException = None \ No newline at end of file
diff --git a/BaseTools/Source/Python/Ecc/EccToolError.py b/BaseTools/Source/Python/Ecc/EccToolError.py
deleted file mode 100644
index 4039f57bc6..0000000000
--- a/BaseTools/Source/Python/Ecc/EccToolError.py
+++ /dev/null
@@ -1,188 +0,0 @@
-## @file
-# Standardized Error Hanlding infrastructures.
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-ERROR_GENERAL_CHECK_ALL = 1000
-ERROR_GENERAL_CHECK_NO_TAB = 1001
-ERROR_GENERAL_CHECK_INDENTATION = 1002
-ERROR_GENERAL_CHECK_LINE = 1003
-ERROR_GENERAL_CHECK_NO_ASM = 1004
-ERROR_GENERAL_CHECK_NO_PROGMA = 1005
-ERROR_GENERAL_CHECK_CARRIAGE_RETURN = 1006
-ERROR_GENERAL_CHECK_FILE_EXISTENCE = 1007
-ERROR_GENERAL_CHECK_NON_ACSII = 1008
-
-ERROR_SPACE_CHECK_ALL = 2000
-
-ERROR_PREDICATE_EXPRESSION_CHECK_ALL = 3000
-ERROR_PREDICATE_EXPRESSION_CHECK_BOOLEAN_VALUE = 3001
-ERROR_PREDICATE_EXPRESSION_CHECK_NO_BOOLEAN_OPERATOR = 3002
-ERROR_PREDICATE_EXPRESSION_CHECK_COMPARISON_NULL_TYPE = 3003
-
-ERROR_HEADER_CHECK_ALL = 4000
-ERROR_HEADER_CHECK_FILE = 4001
-ERROR_HEADER_CHECK_FUNCTION = 4002
-
-ERROR_C_FUNCTION_LAYOUT_CHECK_ALL = 5000
-ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE = 5001
-ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONAL_MODIFIER = 5002
-ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME = 5003
-ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE = 5004
-ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY = 5005
-ERROR_C_FUNCTION_LAYOUT_CHECK_DATA_DECLARATION = 5006
-ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VARIABLE = 5007
-ERROR_C_FUNCTION_LAYOUT_CHECK_NO_STATIC = 5008
-ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_2 = 5009
-ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_3 = 5010
-
-ERROR_INCLUDE_FILE_CHECK_ALL = 6000
-ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_1 = 6001
-ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_2 = 6002
-ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_3 = 6003
-ERROR_INCLUDE_FILE_CHECK_DATA = 6004
-ERROR_INCLUDE_FILE_CHECK_NAME = 6005
-
-ERROR_DECLARATION_DATA_TYPE_CHECK_ALL = 7000
-ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE = 7001
-ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MODIFIER = 7002
-ERROR_DECLARATION_DATA_TYPE_CHECK_EFI_API_MODIFIER = 7003
-ERROR_DECLARATION_DATA_TYPE_CHECK_ENUMERATED_TYPE = 7004
-ERROR_DECLARATION_DATA_TYPE_CHECK_STRUCTURE_DECLARATION = 7005
-ERROR_DECLARATION_DATA_TYPE_CHECK_SAME_STRUCTURE = 7007
-ERROR_DECLARATION_DATA_TYPE_CHECK_UNION_TYPE = 7006
-ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE = 7008
-
-ERROR_NAMING_CONVENTION_CHECK_ALL = 8000
-ERROR_NAMING_CONVENTION_CHECK_DEFINE_STATEMENT = 8001
-ERROR_NAMING_CONVENTION_CHECK_TYPEDEF_STATEMENT = 8002
-ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT = 8003
-ERROR_NAMING_CONVENTION_CHECK_PATH_NAME = 8004
-ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME = 8005
-ERROR_NAMING_CONVENTION_CHECK_FUNCTION_NAME = 8006
-ERROR_NAMING_CONVENTION_CHECK_SINGLE_CHARACTER_VARIABLE = 8007
-
-ERROR_DOXYGEN_CHECK_ALL = 9000
-ERROR_DOXYGEN_CHECK_FILE_HEADER = 9001
-ERROR_DOXYGEN_CHECK_FUNCTION_HEADER = 9002
-ERROR_DOXYGEN_CHECK_COMMENT_DESCRIPTION = 9003
-ERROR_DOXYGEN_CHECK_COMMENT_FORMAT = 9004
-ERROR_DOXYGEN_CHECK_COMMAND = 9005
-
-ERROR_META_DATA_FILE_CHECK_ALL = 10000
-ERROR_META_DATA_FILE_CHECK_PATH_NAME = 10001
-ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1 = 10002
-ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_2 = 10003
-ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_DEPENDENT = 10004
-ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_ORDER = 10005
-ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE = 10006
-ERROR_META_DATA_FILE_CHECK_BINARY_INF_IN_FDF = 10007
-ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE = 10008
-ERROR_META_DATA_FILE_CHECK_PCD_FLASH = 10009
-ERROR_META_DATA_FILE_CHECK_PCD_NO_USE = 10010
-ERROR_META_DATA_FILE_CHECK_DUPLICATE_GUID = 10011
-ERROR_META_DATA_FILE_CHECK_DUPLICATE_PROTOCOL = 10012
-ERROR_META_DATA_FILE_CHECK_DUPLICATE_PPI = 10013
-ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE = 10014
-ERROR_META_DATA_FILE_CHECK_PCD_TYPE = 10015
-ERROR_META_DATA_FILE_CHECK_MODULE_FILE_GUID_DUPLICATION = 10016
-ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE = 10017
-
-ERROR_SPELLING_CHECK_ALL = 11000
-
-gEccErrorMessage = {
- ERROR_GENERAL_CHECK_ALL : "",
- ERROR_GENERAL_CHECK_NO_TAB : "'TAB' character is not allowed in source code, please replace each 'TAB' with two spaces",
- ERROR_GENERAL_CHECK_INDENTATION : "Indentation does not follow coding style",
- ERROR_GENERAL_CHECK_LINE : "The width of each line does not follow coding style",
- ERROR_GENERAL_CHECK_NO_ASM : "There should be no use of _asm in the source file",
- ERROR_GENERAL_CHECK_NO_PROGMA : """There should be no use of "#progma" in source file except "#pragma pack(#)\"""",
- ERROR_GENERAL_CHECK_CARRIAGE_RETURN : "There should be a carriage return at the end of the file",
- ERROR_GENERAL_CHECK_FILE_EXISTENCE : "File not found",
- ERROR_GENERAL_CHECK_NON_ACSII : "File has invalid Non-ACSII char",
-
- ERROR_SPACE_CHECK_ALL : "",
-
- ERROR_PREDICATE_EXPRESSION_CHECK_ALL : "",
- ERROR_PREDICATE_EXPRESSION_CHECK_BOOLEAN_VALUE : "Boolean values and variable type BOOLEAN should not use explicit comparisons to TRUE or FALSE",
- ERROR_PREDICATE_EXPRESSION_CHECK_NO_BOOLEAN_OPERATOR : "Non-Boolean comparisons should use a compare operator (==, !=, >, < >=, <=)",
- ERROR_PREDICATE_EXPRESSION_CHECK_COMPARISON_NULL_TYPE : "A comparison of any pointer to zero must be done via the NULL type",
-
- ERROR_HEADER_CHECK_ALL : "",
- ERROR_HEADER_CHECK_FILE : "File header doesn't exist",
- ERROR_HEADER_CHECK_FUNCTION : "Function header doesn't exist",
-
- ERROR_C_FUNCTION_LAYOUT_CHECK_ALL : "",
- ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE : "Return type of a function should exist and in the first line",
- ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONAL_MODIFIER : "Any optional functional modifiers should exist and next to the return type",
- ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME : """Function name should be left justified, followed by the beginning of the parameter list, with the closing parenthesis on its own line, indented two spaces""",
- ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE : "Function prototypes in include files have the same form as function definitions",
- ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_2 : "Function prototypes in include files have different parameter number with function definitions",
- ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_3 : "Function prototypes in include files have different parameter modifier with function definitions",
- ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY : "The body of a function should be contained by open and close braces that must be in the first column",
- ERROR_C_FUNCTION_LAYOUT_CHECK_DATA_DECLARATION : "The data declarations should be the first code in a module",
- ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VARIABLE : "There should be no initialization of a variable as part of its declaration",
- ERROR_C_FUNCTION_LAYOUT_CHECK_NO_STATIC : "There should be no use of STATIC for functions",
-
- ERROR_INCLUDE_FILE_CHECK_ALL : "",
- ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_1 : "All include file contents should be guarded by a #ifndef statement.",
- ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_2 : "The #ifndef must be the first line of code following the file header comment",
- ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_3 : "The #endif must appear on the last line in the file",
- ERROR_INCLUDE_FILE_CHECK_DATA : "Include files should contain only public or only private data and cannot contain code or define data variables",
- ERROR_INCLUDE_FILE_CHECK_NAME : "No permission for the inlcude file with same names",
-
- ERROR_DECLARATION_DATA_TYPE_CHECK_ALL : "",
- ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE : "There should be no use of int, unsigned, char, void, static, long in any .c, .h or .asl files",
- ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MODIFIER : """The modifiers IN, OUT, OPTIONAL, and UNALIGNED should be used only to qualify arguments to a function and should not appear in a data type declaration""",
- ERROR_DECLARATION_DATA_TYPE_CHECK_EFI_API_MODIFIER : "The EFIAPI modifier should be used at the entry of drivers, events, and member functions of protocols",
- ERROR_DECLARATION_DATA_TYPE_CHECK_ENUMERATED_TYPE : "Enumerated Type should have a 'typedef' and the name must be in capital letters",
- ERROR_DECLARATION_DATA_TYPE_CHECK_STRUCTURE_DECLARATION : "Structure Type should have a 'typedef' and the name must be in capital letters",
- ERROR_DECLARATION_DATA_TYPE_CHECK_SAME_STRUCTURE : "No permission for the structure with same names",
- ERROR_DECLARATION_DATA_TYPE_CHECK_UNION_TYPE : "Union Type should have a 'typedef' and the name must be in capital letters",
- ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE : "Complex types should be typedef-ed",
-
- ERROR_NAMING_CONVENTION_CHECK_ALL : "",
- ERROR_NAMING_CONVENTION_CHECK_DEFINE_STATEMENT : "Only capital letters are allowed to be used for #define declarations",
- ERROR_NAMING_CONVENTION_CHECK_TYPEDEF_STATEMENT : "Only capital letters are allowed to be used for typedef declarations",
- ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT : "The #ifndef at the start of an include file should use both prefix and postfix underscore characters, '_'",
- ERROR_NAMING_CONVENTION_CHECK_PATH_NAME : """Path name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters""",
- ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME : """Variable name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters 4. Global variable name must start with a 'g'""",
- ERROR_NAMING_CONVENTION_CHECK_FUNCTION_NAME : """Function name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters""",
- ERROR_NAMING_CONVENTION_CHECK_SINGLE_CHARACTER_VARIABLE : "There should be no use of short (single character) variable names",
-
- ERROR_DOXYGEN_CHECK_ALL : "",
- ERROR_DOXYGEN_CHECK_FILE_HEADER : "The file headers should follow Doxygen special documentation blocks in section 2.3.5",
- ERROR_DOXYGEN_CHECK_FUNCTION_HEADER : "The function headers should follow Doxygen special documentation blocks in section 2.3.5",
- ERROR_DOXYGEN_CHECK_COMMENT_DESCRIPTION : """The first line of text in a comment block should be a brief description of the element being documented and the brief description must end with a period.""",
- ERROR_DOXYGEN_CHECK_COMMENT_FORMAT : "For comment line with '///< ... text ...' format, if it is used, it should be after the code section",
- ERROR_DOXYGEN_CHECK_COMMAND : "Only Doxygen commands '@bug', '@todo', '@example', '@file', '@attention', '@param', '@post', '@pre', '@retval', '@return', '@sa', '@since', '@test', '@note', '@par' are allowed to mark the code",
-
- ERROR_META_DATA_FILE_CHECK_ALL : "",
- ERROR_META_DATA_FILE_CHECK_PATH_NAME : "The file defined in meta-data does not exist",
- ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1 : "A library instances defined for a given module (or dependent library instance) doesn't match the module's type.",
- ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_2 : "A library instance must specify the Supported Module Types in its INF file",
- ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_DEPENDENT : "A library instance must be defined for all dependent library classes",
- ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_ORDER : "The library Instances specified by the LibraryClasses sections should be listed in order of dependencies",
- ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE : "There should be no unnecessary inclusion of library classes in the INF file",
- ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE : "Duplicate Library Class Name found",
- ERROR_META_DATA_FILE_CHECK_BINARY_INF_IN_FDF : "An INF file is specified in the FDF file, but not in the DSC file, therefore the INF file must be for a Binary module only",
- ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE : "Duplicate PCDs found",
- ERROR_META_DATA_FILE_CHECK_PCD_FLASH : "PCD settings in the FDF file should only be related to flash",
- ERROR_META_DATA_FILE_CHECK_PCD_NO_USE : "There should be no PCDs declared in INF files that are not specified in in either a DSC or FDF file",
- ERROR_META_DATA_FILE_CHECK_DUPLICATE_GUID : "Duplicate GUID found",
- ERROR_META_DATA_FILE_CHECK_DUPLICATE_PROTOCOL : "Duplicate PROTOCOL found",
- ERROR_META_DATA_FILE_CHECK_DUPLICATE_PPI : "Duplicate PPI found",
- ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE : "No used module files found",
- ERROR_META_DATA_FILE_CHECK_PCD_TYPE : "Wrong C code function used for this kind of PCD",
- ERROR_META_DATA_FILE_CHECK_MODULE_FILE_GUID_DUPLICATION : "Module file has FILE_GUID collision with other module file",
- ERROR_SPELLING_CHECK_ALL : "",
- }
-
diff --git a/BaseTools/Source/Python/Ecc/Exception.py b/BaseTools/Source/Python/Ecc/Exception.py
deleted file mode 100644
index ffbb62b3b0..0000000000
--- a/BaseTools/Source/Python/Ecc/Exception.py
+++ /dev/null
@@ -1,87 +0,0 @@
-## @file
-# This file is used to parse exception items found by ECC tool
-#
-# Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from Xml.XmlRoutines import *
-import os.path
-
-# ExceptionXml to parse Exception Node of XML file
-class ExceptionXml(object):
- def __init__(self):
- self.KeyWord = ''
- self.ErrorID = ''
- self.FilePath = ''
-
- def FromXml(self, Item, Key):
- self.KeyWord = XmlElement(Item, '%s/KeyWord' % Key)
- self.ErrorID = XmlElement(Item, '%s/ErrorID' % Key)
- self.FilePath = os.path.normpath(XmlElement(Item, '%s/FilePath' % Key))
-
- def __str__(self):
- return 'ErrorID = %s KeyWord = %s FilePath = %s' %(self.ErrorID, self.KeyWord, self.FilePath)
-
-# ExceptionListXml to parse Exception Node List of XML file
-class ExceptionListXml(object):
- def __init__(self):
- self.List = []
-
- def FromXmlFile(self, FilePath):
- XmlContent = XmlParseFile(FilePath)
- for Item in XmlList(XmlContent, '/ExceptionList/Exception'):
- Exp = ExceptionXml()
- Exp.FromXml(Item, 'Exception')
- self.List.append(Exp)
-
- def ToList(self):
- RtnList = []
- for Item in self.List:
- #RtnList.append((Item.ErrorID, Item.KeyWord, Item.FilePath))
- RtnList.append((Item.ErrorID, Item.KeyWord))
-
- return RtnList
-
- def __str__(self):
- RtnStr = ''
- if self.List:
- for Item in self.List:
- RtnStr = RtnStr + str(Item) + '\n'
- return RtnStr
-
-# A class to check exception
-class ExceptionCheck(object):
- def __init__(self, FilePath = None):
- self.ExceptionList = []
- self.ExceptionListXml = ExceptionListXml()
- self.LoadExceptionListXml(FilePath)
-
- def LoadExceptionListXml(self, FilePath):
- if FilePath and os.path.isfile(FilePath):
- self.ExceptionListXml.FromXmlFile(FilePath)
- self.ExceptionList = self.ExceptionListXml.ToList()
-
- def IsException(self, ErrorID, KeyWord, FileID=-1):
- if (str(ErrorID), KeyWord) in self.ExceptionList:
- return True
- else:
- return False
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- El = ExceptionCheck('C:\\Hess\\Project\\BuildTool\\src\\Ecc\\exception.xml')
- print El.ExceptionList
diff --git a/BaseTools/Source/Python/Ecc/FileProfile.py b/BaseTools/Source/Python/Ecc/FileProfile.py
deleted file mode 100644
index 689aee0975..0000000000
--- a/BaseTools/Source/Python/Ecc/FileProfile.py
+++ /dev/null
@@ -1,57 +0,0 @@
-## @file
-# fragments of source file
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-
-import re
-import os
-from ParserWarning import Warning
-
-CommentList = []
-PPDirectiveList = []
-PredicateExpressionList = []
-FunctionDefinitionList = []
-VariableDeclarationList = []
-EnumerationDefinitionList = []
-StructUnionDefinitionList = []
-TypedefDefinitionList = []
-FunctionCallingList = []
-
-## record file data when parsing source
-#
-# May raise Exception when opening file.
-#
-class FileProfile :
-
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName):
- self.FileLinesList = []
- self.FileLinesListFromFile = []
- try:
- fsock = open(FileName, "rb", 0)
- try:
- self.FileLinesListFromFile = fsock.readlines()
- finally:
- fsock.close()
-
- except IOError:
- raise Warning("Error when opening file %s" % FileName)
-
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/Ecc/MetaDataParser.py b/BaseTools/Source/Python/Ecc/MetaDataParser.py
deleted file mode 100644
index bbafa00ddd..0000000000
--- a/BaseTools/Source/Python/Ecc/MetaDataParser.py
+++ /dev/null
@@ -1,264 +0,0 @@
-## @file
-# This file is used to define common parser functions for meta-data
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-import os
-from CommonDataClass.DataClass import *
-from EccToolError import *
-import EccGlobalData
-import re
-## Get the inlcude path list for a source file
-#
-# 1. Find the source file belongs to which inf file
-# 2. Find the inf's package
-# 3. Return the include path list of the package
-#
-def GetIncludeListOfFile(WorkSpace, Filepath, Db):
- IncludeList = []
- Filepath = os.path.normpath(Filepath)
- SqlCommand = """
- select Value1, FullPath from Inf, File where Inf.Model = %s and Inf.BelongsToFile in(
- select distinct B.BelongsToFile from File as A left join Inf as B
- where A.ID = B.BelongsToFile and B.Model = %s and (A.Path || '%s' || B.Value1) = '%s')
- and Inf.BelongsToFile = File.ID""" \
- % (MODEL_META_DATA_PACKAGE, MODEL_EFI_SOURCE_FILE, '\\', Filepath)
- RecordSet = Db.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- DecFullPath = os.path.normpath(os.path.join(WorkSpace, Record[0]))
- InfFullPath = os.path.normpath(os.path.join(WorkSpace, Record[1]))
- (DecPath, DecName) = os.path.split(DecFullPath)
- (InfPath, InfName) = os.path.split(InfFullPath)
- SqlCommand = """select Value1 from Dec where BelongsToFile =
- (select ID from File where FullPath = '%s') and Model = %s""" \
- % (DecFullPath, MODEL_EFI_INCLUDE)
- NewRecordSet = Db.TblDec.Exec(SqlCommand)
- if InfPath not in IncludeList:
- IncludeList.append(InfPath)
- for NewRecord in NewRecordSet:
- IncludePath = os.path.normpath(os.path.join(DecPath, NewRecord[0]))
- if IncludePath not in IncludeList:
- IncludeList.append(IncludePath)
-
- return IncludeList
-
-## Get the file list
-#
-# Search table file and find all specific type files
-#
-def GetFileList(FileModel, Db):
- FileList = []
- SqlCommand = """select FullPath from File where Model = %s""" % str(FileModel)
- RecordSet = Db.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- FileList.append(Record[0])
-
- return FileList
-
-## Get the table list
-#
-# Search table file and find all small tables
-#
-def GetTableList(FileModelList, Table, Db):
- TableList = []
- SqlCommand = """select ID from File where Model in %s""" % str(FileModelList)
- RecordSet = Db.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- TableName = Table + str(Record[0])
- TableList.append(TableName)
-
- return TableList
-
-## ParseHeaderCommentSection
-#
-# Parse Header comment section lines, extract Abstract, Description, Copyright
-# , License lines
-#
-# @param CommentList: List of (Comment, LineNumber)
-# @param FileName: FileName of the comment
-#
-def ParseHeaderCommentSection(CommentList, FileName = None):
-
- Abstract = ''
- Description = ''
- Copyright = ''
- License = ''
- EndOfLine = "\n"
- STR_HEADER_COMMENT_START = "@file"
-
- #
- # used to indicate the state of processing header comment section of dec,
- # inf files
- #
- HEADER_COMMENT_NOT_STARTED = -1
- HEADER_COMMENT_STARTED = 0
- HEADER_COMMENT_FILE = 1
- HEADER_COMMENT_ABSTRACT = 2
- HEADER_COMMENT_DESCRIPTION = 3
- HEADER_COMMENT_COPYRIGHT = 4
- HEADER_COMMENT_LICENSE = 5
- HEADER_COMMENT_END = 6
- #
- # first find the last copyright line
- #
- Last = 0
- HeaderCommentStage = HEADER_COMMENT_NOT_STARTED
- for Index in xrange(len(CommentList)-1, 0, -1):
- Line = CommentList[Index][0]
- if _IsCopyrightLine(Line):
- Last = Index
- break
-
- for Item in CommentList:
- Line = Item[0]
- LineNo = Item[1]
-
- if not Line.startswith('#') and Line:
- SqlStatement = """ select ID from File where FullPath like '%s'""" % FileName
- ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- Msg = 'Comment must start with #'
- EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
- Comment = CleanString2(Line)[1]
- Comment = Comment.strip()
- #
- # if there are blank lines between License or Description, keep them as they would be
- # indication of different block; or in the position that Abstract should be, also keep it
- # as it indicates that no abstract
- #
- if not Comment and HeaderCommentStage not in [HEADER_COMMENT_LICENSE, \
- HEADER_COMMENT_DESCRIPTION, HEADER_COMMENT_ABSTRACT]:
- continue
-
- if HeaderCommentStage == HEADER_COMMENT_NOT_STARTED:
- if Comment.startswith(STR_HEADER_COMMENT_START):
- HeaderCommentStage = HEADER_COMMENT_ABSTRACT
- else:
- License += Comment + EndOfLine
- else:
- if HeaderCommentStage == HEADER_COMMENT_ABSTRACT:
- #
- # in case there is no abstract and description
- #
- if not Comment:
- Abstract = ''
- HeaderCommentStage = HEADER_COMMENT_DESCRIPTION
- elif _IsCopyrightLine(Comment):
- Copyright += Comment + EndOfLine
- HeaderCommentStage = HEADER_COMMENT_COPYRIGHT
- else:
- Abstract += Comment + EndOfLine
- HeaderCommentStage = HEADER_COMMENT_DESCRIPTION
- elif HeaderCommentStage == HEADER_COMMENT_DESCRIPTION:
- #
- # in case there is no description
- #
- if _IsCopyrightLine(Comment):
- Copyright += Comment + EndOfLine
- HeaderCommentStage = HEADER_COMMENT_COPYRIGHT
- else:
- Description += Comment + EndOfLine
- elif HeaderCommentStage == HEADER_COMMENT_COPYRIGHT:
- if _IsCopyrightLine(Comment):
- Copyright += Comment + EndOfLine
- else:
- #
- # Contents after copyright line are license, those non-copyright lines in between
- # copyright line will be discarded
- #
- if LineNo > Last:
- if License:
- License += EndOfLine
- License += Comment + EndOfLine
- HeaderCommentStage = HEADER_COMMENT_LICENSE
- else:
- if not Comment and not License:
- continue
- License += Comment + EndOfLine
-
- if not Copyright:
- SqlStatement = """ select ID from File where FullPath like '%s'""" % FileName
- ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- Msg = 'Header comment section must have copyright information'
- EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
-
- if not License:
- SqlStatement = """ select ID from File where FullPath like '%s'""" % FileName
- ResultSet = EccGlobalData.gDb.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- Msg = 'Header comment section must have license information'
- EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])
-
- return Abstract.strip(), Description.strip(), Copyright.strip(), License.strip()
-
-## _IsCopyrightLine
-# check whether current line is copyright line, the criteria is whether there is case insensitive keyword "Copyright"
-# followed by zero or more white space characters followed by a "(" character
-#
-# @param LineContent: the line need to be checked
-# @return: True if current line is copyright line, False else
-#
-def _IsCopyrightLine (LineContent):
- LineContent = LineContent.upper()
- Result = False
-
- ReIsCopyrightRe = re.compile(r"""(^|\s)COPYRIGHT *\(""", re.DOTALL)
- if ReIsCopyrightRe.search(LineContent):
- Result = True
-
- return Result
-
-
-## CleanString2
-#
-# Split comments in a string
-# Remove spaces
-#
-# @param Line: The string to be cleaned
-# @param CommentCharacter: Comment char, used to ignore comment content,
-# default is DataType.TAB_COMMENT_SPLIT
-#
-def CleanString2(Line, CommentCharacter='#', AllowCppStyleComment=False):
- #
- # remove whitespace
- #
- Line = Line.strip()
- #
- # Replace EDK1's comment character
- #
- if AllowCppStyleComment:
- Line = Line.replace('//', CommentCharacter)
- #
- # separate comments and statements
- #
- LineParts = Line.split(CommentCharacter, 1)
- #
- # remove whitespace again
- #
- Line = LineParts[0].strip()
- if len(LineParts) > 1:
- Comment = LineParts[1].strip()
- #
- # Remove prefixed and trailing comment characters
- #
- Start = 0
- End = len(Comment)
- while Start < End and Comment.startswith(CommentCharacter, Start, End):
- Start += 1
- while End >= 0 and Comment.endswith(CommentCharacter, Start, End):
- End -= 1
- Comment = Comment[Start:End]
- Comment = Comment.strip()
- else:
- Comment = ''
-
- return Line, Comment
diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py
deleted file mode 100644
index 643c228665..0000000000
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py
+++ /dev/null
@@ -1,218 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for files
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-
-import Common.EdkLogger as EdkLogger
-from CommonDataClass import DataClass
-from CommonDataClass.DataClass import FileClass
-
-## Convert to SQL required string format
-def ConvertToSqlString(StringList):
- return map(lambda s: "'" + s.replace("'", "''") + "'", StringList)
-
-## TableFile
-#
-# This class defined a common table
-#
-# @param object: Inherited from object class
-#
-# @param Cursor: Cursor of the database
-# @param TableName: Name of the table
-#
-class Table(object):
- _COLUMN_ = ''
- _ID_STEP_ = 1
- _ID_MAX_ = 0x80000000
- _DUMMY_ = 0
-
- def __init__(self, Cursor, Name='', IdBase=0, Temporary=False):
- self.Cur = Cursor
- self.Table = Name
- self.IdBase = int(IdBase)
- self.ID = int(IdBase)
- self.Temporary = Temporary
-
- def __str__(self):
- return self.Table
-
- ## Create table
- #
- # Create a table
- #
- def Create(self, NewTable=True):
- if NewTable:
- self.Drop()
-
- if self.Temporary:
- SqlCommand = """create temp table IF NOT EXISTS %s (%s)""" % (self.Table, self._COLUMN_)
- else:
- SqlCommand = """create table IF NOT EXISTS %s (%s)""" % (self.Table, self._COLUMN_)
- EdkLogger.debug(EdkLogger.DEBUG_8, SqlCommand)
- self.Cur.execute(SqlCommand)
- self.ID = self.GetId()
-
- ## Insert table
- #
- # Insert a record into a table
- #
- def Insert(self, *Args):
- self.ID = self.ID + self._ID_STEP_
- if self.ID >= (self.IdBase + self._ID_MAX_):
- self.ID = self.IdBase + self._ID_STEP_
- Values = ", ".join([str(Arg) for Arg in Args])
- SqlCommand = "insert into %s values(%s, %s)" % (self.Table, self.ID, Values)
- EdkLogger.debug(EdkLogger.DEBUG_5, SqlCommand)
- self.Cur.execute(SqlCommand)
- return self.ID
-
- ## Query table
- #
- # Query all records of the table
- #
- def Query(self):
- SqlCommand = """select * from %s""" % self.Table
- self.Cur.execute(SqlCommand)
- for Rs in self.Cur:
- EdkLogger.verbose(str(Rs))
- TotalCount = self.GetId()
-
- ## Drop a table
- #
- # Drop the table
- #
- def Drop(self):
- SqlCommand = """drop table IF EXISTS %s""" % self.Table
- try:
- self.Cur.execute(SqlCommand)
- except sqlite3.Error, e:
- print "An error occurred when Drop a table:", e.args[0]
-
- ## Get count
- #
- # Get a count of all records of the table
- #
- # @retval Count: Total count of all records
- #
- def GetCount(self):
- SqlCommand = """select count(ID) from %s""" % self.Table
- Record = self.Cur.execute(SqlCommand).fetchall()
- return Record[0][0]
-
- def GetId(self):
- SqlCommand = """select max(ID) from %s""" % self.Table
- Record = self.Cur.execute(SqlCommand).fetchall()
- Id = Record[0][0]
- if Id == None:
- Id = self.IdBase
- return Id
-
- ## Init the ID of the table
- #
- # Init the ID of the table
- #
- def InitID(self):
- self.ID = self.GetId()
-
- ## Exec
- #
- # Exec Sql Command, return result
- #
- # @param SqlCommand: The SqlCommand to be executed
- #
- # @retval RecordSet: The result after executed
- #
- def Exec(self, SqlCommand):
- EdkLogger.debug(EdkLogger.DEBUG_5, SqlCommand)
- self.Cur.execute(SqlCommand)
- RecordSet = self.Cur.fetchall()
- return RecordSet
-
- def SetEndFlag(self):
- pass
-
- def IsIntegral(self):
- Result = self.Exec("select min(ID) from %s" % (self.Table))
- if Result[0][0] != -1:
- return False
- return True
-
- def GetAll(self):
- return self.Exec("select * from %s where ID > 0 order by ID" % (self.Table))
-
-
-## TableDataModel
-#
-# This class defined a table used for data model
-#
-# @param object: Inherited from object class
-#
-#
-class TableDataModel(Table):
- _COLUMN_ = """
- ID INTEGER PRIMARY KEY,
- CrossIndex INTEGER NOT NULL,
- Name VARCHAR NOT NULL,
- Description VARCHAR
- """
- def __init__(self, Cursor):
- Table.__init__(self, Cursor, 'DataModel')
-
- ## Insert table
- #
- # Insert a record into table DataModel
- #
- # @param ID: ID of a ModelType
- # @param CrossIndex: CrossIndex of a ModelType
- # @param Name: Name of a ModelType
- # @param Description: Description of a ModelType
- #
- def Insert(self, CrossIndex, Name, Description):
- (Name, Description) = ConvertToSqlString((Name, Description))
- return Table.Insert(self, CrossIndex, Name, Description)
-
- ## Init table
- #
- # Create all default records of table DataModel
- #
- def InitTable(self):
- EdkLogger.verbose("\nInitialize table DataModel started ...")
- Count = self.GetCount()
- if Count != None and Count != 0:
- return
- for Item in DataClass.MODEL_LIST:
- CrossIndex = Item[1]
- Name = Item[0]
- Description = Item[0]
- self.Insert(CrossIndex, Name, Description)
- EdkLogger.verbose("Initialize table DataModel ... DONE!")
-
- ## Get CrossIndex
- #
- # Get a model's cross index from its name
- #
- # @param ModelName: Name of the model
- # @retval CrossIndex: CrossIndex of the model
- #
- def GetCrossIndex(self, ModelName):
- CrossIndex = -1
- SqlCommand = """select CrossIndex from DataModel where name = '""" + ModelName + """'"""
- self.Cur.execute(SqlCommand)
- for Item in self.Cur:
- CrossIndex = Item[0]
-
- return CrossIndex
-
diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
deleted file mode 100644
index d10265e973..0000000000
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
+++ /dev/null
@@ -1,1852 +0,0 @@
-## @file
-# This file is used to parse meta files
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import re
-import time
-import copy
-
-import Common.EdkLogger as EdkLogger
-import Common.GlobalData as GlobalData
-import EccGlobalData
-
-from CommonDataClass.DataClass import *
-from Common.DataType import *
-from Common.String import *
-from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData
-from Common.Expression import *
-from CommonDataClass.Exceptions import *
-
-from MetaFileTable import MetaFileStorage
-from GenFds.FdfParser import FdfParser
-
-## A decorator used to parse macro definition
-def ParseMacro(Parser):
- def MacroParser(self):
- Match = gMacroDefPattern.match(self._CurrentLine)
- if not Match:
- # Not 'DEFINE/EDK_GLOBAL' statement, call decorated method
- Parser(self)
- return
-
- TokenList = GetSplitValueList(self._CurrentLine[Match.end(1):], TAB_EQUAL_SPLIT, 1)
- # Syntax check
- if not TokenList[0]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No macro name given",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- if len(TokenList) < 2:
- TokenList.append('')
-
- Type = Match.group(1)
- Name, Value = TokenList
- # Global macros can be only defined via environment variable
- if Name in GlobalData.gGlobalDefines:
- EdkLogger.error('Parser', FORMAT_INVALID, "%s can only be defined via environment variable" % Name,
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- # Only upper case letters, digit and '_' are allowed
- if not gMacroNamePattern.match(Name):
- EdkLogger.error('Parser', FORMAT_INVALID, "The macro name must be in the pattern [A-Z][A-Z0-9_]*",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
-
- Value = ReplaceMacro(Value, self._Macros)
- self._ItemType = MODEL_META_DATA_DEFINE
- # DEFINE defined macros
- if Type == TAB_DSC_DEFINES_DEFINE:
- if type(self) == DecParser:
- if MODEL_META_DATA_HEADER in self._SectionType:
- self._FileLocalMacros[Name] = Value
- else:
- for Scope in self._Scope:
- self._SectionsMacroDict.setdefault((Scope[2], Scope[0], Scope[1]), {})[Name] = Value
- elif self._SectionType == MODEL_META_DATA_HEADER:
- self._FileLocalMacros[Name] = Value
- else:
- SectionDictKey = self._SectionType, self._Scope[0][0], self._Scope[0][1]
- if SectionDictKey not in self._SectionsMacroDict:
- self._SectionsMacroDict[SectionDictKey] = {}
- SectionLocalMacros = self._SectionsMacroDict[SectionDictKey]
- SectionLocalMacros[Name] = Value
- # EDK_GLOBAL defined macros
- elif type(self) != DscParser:
- EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL can only be used in .dsc file",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- elif self._SectionType != MODEL_META_DATA_HEADER:
- EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL can only be used under [Defines] section",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- elif (Name in self._FileLocalMacros) and (self._FileLocalMacros[Name] != Value):
- EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL defined a macro with the same name and different value as one defined by 'DEFINE'",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
-
- self._ValueList = [Type, Name, Value]
-
- return MacroParser
-
-## Base class of parser
-#
-# This class is used for derivation purpose. The specific parser for one kind
-# type file must derive this class and implement some public interfaces.
-#
-# @param FilePath The path of platform description file
-# @param FileType The raw data of DSC file
-# @param Table Database used to retrieve module/package information
-# @param Macros Macros used for replacement in file
-# @param Owner Owner ID (for sub-section parsing)
-# @param From ID from which the data comes (for !INCLUDE directive)
-#
-class MetaFileParser(object):
- # data type (file content) for specific file type
- DataType = {}
-
- # Parser objects used to implement singleton
- MetaFiles = {}
-
- ## Factory method
- #
- # One file, one parser object. This factory method makes sure that there's
- # only one object constructed for one meta file.
- #
- # @param Class class object of real AutoGen class
- # (InfParser, DecParser or DscParser)
- # @param FilePath The path of meta file
- # @param *args The specific class related parameters
- # @param **kwargs The specific class related dict parameters
- #
- def __new__(Class, FilePath, *args, **kwargs):
- if FilePath in Class.MetaFiles:
- return Class.MetaFiles[FilePath]
- else:
- ParserObject = super(MetaFileParser, Class).__new__(Class)
- Class.MetaFiles[FilePath] = ParserObject
- return ParserObject
-
- ## Constructor of MetaFileParser
- #
- # Initialize object of MetaFileParser
- #
- # @param FilePath The path of platform description file
- # @param FileType The raw data of DSC file
- # @param Table Database used to retrieve module/package information
- # @param Macros Macros used for replacement in file
- # @param Owner Owner ID (for sub-section parsing)
- # @param From ID from which the data comes (for !INCLUDE directive)
- #
- def __init__(self, FilePath, FileType, Table, Owner=-1, From=-1):
- self._Table = Table
- self._RawTable = Table
- self._FileType = FileType
- self.MetaFile = FilePath
- self._Defines = {}
- self._FileLocalMacros = {}
- self._SectionsMacroDict = {}
-
- # for recursive parsing
- self._Owner = [Owner]
- self._From = From
-
- # parsr status for parsing
- self._ValueList = ['', '', '', '', '']
- self._Scope = []
- self._LineIndex = 0
- self._CurrentLine = ''
- self._SectionType = MODEL_UNKNOWN
- self._SectionName = ''
- self._InSubsection = False
- self._SubsectionType = MODEL_UNKNOWN
- self._SubsectionName = ''
- self._ItemType = MODEL_UNKNOWN
- self._LastItem = -1
- self._Enabled = 0
- self._Finished = False
- self._PostProcessed = False
- # Different version of meta-file has different way to parse.
- self._Version = 0
-
- ## Store the parsed data in table
- def _Store(self, *Args):
- return self._Table.Insert(*Args)
-
- ## Virtual method for starting parse
- def Start(self):
- raise NotImplementedError
-
- ## Notify a post-process is needed
- def DoPostProcess(self):
- self._PostProcessed = False
-
- ## Set parsing complete flag in both class and table
- def _Done(self):
- self._Finished = True
- ## Do not set end flag when processing included files
- if self._From == -1:
- self._Table.SetEndFlag()
-
- def _PostProcess(self):
- self._PostProcessed = True
-
- ## Get the parse complete flag
- def _GetFinished(self):
- return self._Finished
-
- ## Set the complete flag
- def _SetFinished(self, Value):
- self._Finished = Value
-
- ## Use [] style to query data in table, just for readability
- #
- # DataInfo = [data_type, scope1(arch), scope2(platform/moduletype)]
- #
- def __getitem__(self, DataInfo):
- if type(DataInfo) != type(()):
- DataInfo = (DataInfo,)
-
- # Parse the file first, if necessary
- if not self._Finished:
- if self._RawTable.IsIntegrity():
- self._Finished = True
- else:
- self._Table = self._RawTable
- self._PostProcessed = False
- self.Start()
-
- # No specific ARCH or Platform given, use raw data
- if self._RawTable and (len(DataInfo) == 1 or DataInfo[1] == None):
- return self._RawTable.Query(*DataInfo)
-
- # Do post-process if necessary
- if not self._PostProcessed:
- self._PostProcess()
-
- return self._Table.Query(*DataInfo)
-
- ## Data parser for the common format in different type of file
- #
- # The common format in the meatfile is like
- #
- # xxx1 | xxx2 | xxx3
- #
- @ParseMacro
- def _CommonParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- self._ValueList[0:len(TokenList)] = TokenList
-
- ## Data parser for the format in which there's path
- #
- # Only path can have macro used. So we need to replace them before use.
- #
- @ParseMacro
- def _PathParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- self._ValueList[0:len(TokenList)] = TokenList
- # Don't do macro replacement for dsc file at this point
- if type(self) != DscParser:
- Macros = self._Macros
- self._ValueList = [ReplaceMacro(Value, Macros) for Value in self._ValueList]
-
- ## Skip unsupported data
- def _Skip(self):
- EdkLogger.warn("Parser", "Unrecognized content", File=self.MetaFile,
- Line=self._LineIndex+1, ExtraData=self._CurrentLine);
- self._ValueList[0:1] = [self._CurrentLine]
-
- ## Section header parser
- #
- # The section header is always in following format:
- #
- # [section_name.arch<.platform|module_type>]
- #
- def _SectionHeaderParser(self):
- self._Scope = []
- self._SectionName = ''
- ArchList = set()
- for Item in GetSplitValueList(self._CurrentLine[1:-1], TAB_COMMA_SPLIT):
- if Item == '':
- continue
- ItemList = GetSplitValueList(Item, TAB_SPLIT)
- # different section should not mix in one section
- if self._SectionName != '' and self._SectionName != ItemList[0].upper():
- EdkLogger.error('Parser', FORMAT_INVALID, "Different section names in the same section",
- File=self.MetaFile, Line=self._LineIndex+1, ExtraData=self._CurrentLine)
- self._SectionName = ItemList[0].upper()
- if self._SectionName in self.DataType:
- self._SectionType = self.DataType[self._SectionName]
- else:
- self._SectionType = MODEL_UNKNOWN
- EdkLogger.warn("Parser", "Unrecognized section", File=self.MetaFile,
- Line=self._LineIndex+1, ExtraData=self._CurrentLine)
- # S1 is always Arch
- if len(ItemList) > 1:
- S1 = ItemList[1].upper()
- else:
- S1 = 'COMMON'
- ArchList.add(S1)
- # S2 may be Platform or ModuleType
- if len(ItemList) > 2:
- S2 = ItemList[2].upper()
- else:
- S2 = 'COMMON'
- self._Scope.append([S1, S2])
-
- # 'COMMON' must not be used with specific ARCHs at the same section
- if 'COMMON' in ArchList and len(ArchList) > 1:
- EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
- File=self.MetaFile, Line=self._LineIndex+1, ExtraData=self._CurrentLine)
- # If the section information is needed later, it should be stored in database
- self._ValueList[0] = self._SectionName
-
- ## [defines] section parser
- @ParseMacro
- def _DefineParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- self._ValueList[1:len(TokenList)] = TokenList
- if not self._ValueList[1]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No name specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- if not self._ValueList[2]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No value specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
-
- self._ValueList = [ReplaceMacro(Value, self._Macros) for Value in self._ValueList]
- Name, Value = self._ValueList[1], self._ValueList[2]
- # Sometimes, we need to make differences between EDK and EDK2 modules
- if Name == 'INF_VERSION':
- try:
- self._Version = int(Value, 0)
- except:
- EdkLogger.error('Parser', FORMAT_INVALID, "Invalid version number",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
-
- if type(self) == InfParser and self._Version < 0x00010005:
- # EDK module allows using defines as macros
- self._FileLocalMacros[Name] = Value
- self._Defines[Name] = Value
-
- ## [BuildOptions] section parser
- @ParseMacro
- def _BuildOptionParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- TokenList2 = GetSplitValueList(TokenList[0], ':', 1)
- if len(TokenList2) == 2:
- self._ValueList[0] = TokenList2[0] # toolchain family
- self._ValueList[1] = TokenList2[1] # keys
- else:
- self._ValueList[1] = TokenList[0]
- if len(TokenList) == 2 and type(self) != DscParser: # value
- self._ValueList[2] = ReplaceMacro(TokenList[1], self._Macros)
-
- if self._ValueList[1].count('_') != 4:
- EdkLogger.error(
- 'Parser',
- FORMAT_INVALID,
- "'%s' must be in format of <TARGET>_<TOOLCHAIN>_<ARCH>_<TOOL>_FLAGS" % self._ValueList[1],
- ExtraData=self._CurrentLine,
- File=self.MetaFile,
- Line=self._LineIndex+1
- )
-
- def _GetMacros(self):
- Macros = {}
- Macros.update(self._FileLocalMacros)
- Macros.update(self._GetApplicableSectionMacro())
- return Macros
-
-
- ## Get section Macros that are applicable to current line, which may come from other sections
- ## that share the same name while scope is wider
- def _GetApplicableSectionMacro(self):
- Macros = {}
- for Scope1, Scope2 in [("COMMON", "COMMON"), ("COMMON", self._Scope[0][1]),
- (self._Scope[0][0], "COMMON"), (self._Scope[0][0], self._Scope[0][1])]:
- if (self._SectionType, Scope1, Scope2) in self._SectionsMacroDict:
- Macros.update(self._SectionsMacroDict[(self._SectionType, Scope1, Scope2)])
- return Macros
-
- _SectionParser = {}
- Finished = property(_GetFinished, _SetFinished)
- _Macros = property(_GetMacros)
-
-
-## INF file parser class
-#
-# @param FilePath The path of platform description file
-# @param FileType The raw data of DSC file
-# @param Table Database used to retrieve module/package information
-# @param Macros Macros used for replacement in file
-#
-class InfParser(MetaFileParser):
- # INF file supported data types (one type per section)
- DataType = {
- TAB_UNKNOWN.upper() : MODEL_UNKNOWN,
- TAB_INF_DEFINES.upper() : MODEL_META_DATA_HEADER,
- TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DEFINE,
- TAB_BUILD_OPTIONS.upper() : MODEL_META_DATA_BUILD_OPTION,
- TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,
- TAB_LIBRARIES.upper() : MODEL_EFI_LIBRARY_INSTANCE,
- TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,
- TAB_PACKAGES.upper() : MODEL_META_DATA_PACKAGE,
- TAB_NMAKE.upper() : MODEL_META_DATA_NMAKE,
- TAB_INF_FIXED_PCD.upper() : MODEL_PCD_FIXED_AT_BUILD,
- TAB_INF_PATCH_PCD.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,
- TAB_INF_FEATURE_PCD.upper() : MODEL_PCD_FEATURE_FLAG,
- TAB_INF_PCD_EX.upper() : MODEL_PCD_DYNAMIC_EX,
- TAB_INF_PCD.upper() : MODEL_PCD_DYNAMIC,
- TAB_SOURCES.upper() : MODEL_EFI_SOURCE_FILE,
- TAB_GUIDS.upper() : MODEL_EFI_GUID,
- TAB_PROTOCOLS.upper() : MODEL_EFI_PROTOCOL,
- TAB_PPIS.upper() : MODEL_EFI_PPI,
- TAB_DEPEX.upper() : MODEL_EFI_DEPEX,
- TAB_BINARIES.upper() : MODEL_EFI_BINARY_FILE,
- TAB_USER_EXTENSIONS.upper() : MODEL_META_DATA_USER_EXTENSION
- }
-
- ## Constructor of InfParser
- #
- # Initialize object of InfParser
- #
- # @param FilePath The path of module description file
- # @param FileType The raw data of DSC file
- # @param Table Database used to retrieve module/package information
- # @param Macros Macros used for replacement in file
- #
- def __init__(self, FilePath, FileType, Table):
- # prevent re-initialization
- if hasattr(self, "_Table"):
- return
- MetaFileParser.__init__(self, FilePath, FileType, Table)
- self.TblFile = EccGlobalData.gDb.TblFile
- self.FileID = -1
-
- ## Parser starter
- def Start(self):
- NmakeLine = ''
- Content = ''
- try:
- Content = open(str(self.MetaFile), 'r').readlines()
- except:
- EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=self.MetaFile)
- #
- # Insert a record for file
- #
- Filename = NormPath(self.MetaFile)
- FileID = self.TblFile.GetFileId(Filename)
- if FileID:
- self.FileID = FileID
- else:
- self.FileID = self.TblFile.InsertFile(Filename, MODEL_FILE_INF)
-
- # parse the file line by line
- IsFindBlockComment = False
-
- for Index in range(0, len(Content)):
- # skip empty, commented, block commented lines
- Line = CleanString(Content[Index], AllowCppStyleComment=True)
- NextLine = ''
- if Index + 1 < len(Content):
- NextLine = CleanString(Content[Index + 1])
- if Line == '':
- continue
- if Line.find(DataType.TAB_COMMENT_EDK_START) > -1:
- IsFindBlockComment = True
- continue
- if Line.find(DataType.TAB_COMMENT_EDK_END) > -1:
- IsFindBlockComment = False
- continue
- if IsFindBlockComment:
- continue
-
- self._LineIndex = Index
- self._CurrentLine = Line
-
- # section header
- if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
- self._SectionHeaderParser()
- # Check invalid sections
- if self._Version < 0x00010005:
- if self._SectionType in [MODEL_META_DATA_BUILD_OPTION,
- MODEL_EFI_LIBRARY_CLASS,
- MODEL_META_DATA_PACKAGE,
- MODEL_PCD_FIXED_AT_BUILD,
- MODEL_PCD_PATCHABLE_IN_MODULE,
- MODEL_PCD_FEATURE_FLAG,
- MODEL_PCD_DYNAMIC_EX,
- MODEL_PCD_DYNAMIC,
- MODEL_EFI_GUID,
- MODEL_EFI_PROTOCOL,
- MODEL_EFI_PPI,
- MODEL_META_DATA_USER_EXTENSION]:
- EdkLogger.error('Parser', FORMAT_INVALID,
- "Section [%s] is not allowed in inf file without version" % (self._SectionName),
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- elif self._SectionType in [MODEL_EFI_INCLUDE,
- MODEL_EFI_LIBRARY_INSTANCE,
- MODEL_META_DATA_NMAKE]:
- EdkLogger.error('Parser', FORMAT_INVALID,
- "Section [%s] is not allowed in inf file with version 0x%08x" % (self._SectionName, self._Version),
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- continue
- # merge two lines specified by '\' in section NMAKE
- elif self._SectionType == MODEL_META_DATA_NMAKE:
- if Line[-1] == '\\':
- if NextLine == '':
- self._CurrentLine = NmakeLine + Line[0:-1]
- NmakeLine = ''
- else:
- if NextLine[0] == TAB_SECTION_START and NextLine[-1] == TAB_SECTION_END:
- self._CurrentLine = NmakeLine + Line[0:-1]
- NmakeLine = ''
- else:
- NmakeLine = NmakeLine + ' ' + Line[0:-1]
- continue
- else:
- self._CurrentLine = NmakeLine + Line
- NmakeLine = ''
-
- # section content
- self._ValueList = ['','','']
- # parse current line, result will be put in self._ValueList
- self._SectionParser[self._SectionType](self)
- if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:
- self._ItemType = -1
- continue
- #
- # Model, Value1, Value2, Value3, Arch, Platform, BelongsToItem=-1,
- # LineBegin=-1, ColumnBegin=-1, LineEnd=-1, ColumnEnd=-1, Enabled=-1
- #
- self._ValueList[0] = self._ValueList[0].replace('/', '\\')
- for Arch, Platform in self._Scope:
- self._Store(self._SectionType,
- self._ValueList[0],
- self._ValueList[1],
- self._ValueList[2],
- Arch,
- Platform,
- self._Owner[-1],
- self.FileID,
- self._LineIndex+1,
- -1,
- self._LineIndex+1,
- -1,
- 0
- )
- if IsFindBlockComment:
- EdkLogger.error("Parser", FORMAT_INVALID, "Open block comments (starting with /*) are expected to end with */",
- File=self.MetaFile)
- self._Done()
-
- ## Data parser for the format in which there's path
- #
- # Only path can have macro used. So we need to replace them before use.
- #
- def _IncludeParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- self._ValueList[0:len(TokenList)] = TokenList
- Macros = self._Macros
- if Macros:
- for Index in range(0, len(self._ValueList)):
- Value = self._ValueList[Index]
- if not Value:
- continue
-
- if Value.upper().find('$(EFI_SOURCE)\Edk'.upper()) > -1 or Value.upper().find('$(EFI_SOURCE)/Edk'.upper()) > -1:
- Value = '$(EDK_SOURCE)' + Value[17:]
- if Value.find('$(EFI_SOURCE)') > -1 or Value.find('$(EDK_SOURCE)') > -1:
- pass
- elif Value.startswith('.'):
- pass
- elif Value.startswith('$('):
- pass
- else:
- Value = '$(EFI_SOURCE)/' + Value
-
- self._ValueList[Index] = ReplaceMacro(Value, Macros)
-
- ## Parse [Sources] section
- #
- # Only path can have macro used. So we need to replace them before use.
- #
- @ParseMacro
- def _SourceFileParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- self._ValueList[0:len(TokenList)] = TokenList
- Macros = self._Macros
- # For Acpi tables, remove macro like ' TABLE_NAME=Sata1'
- if 'COMPONENT_TYPE' in Macros:
- if self._Defines['COMPONENT_TYPE'].upper() == 'ACPITABLE':
- self._ValueList[0] = GetSplitValueList(self._ValueList[0], ' ', 1)[0]
- if self._Defines['BASE_NAME'] == 'Microcode':
- pass
- self._ValueList = [ReplaceMacro(Value, Macros) for Value in self._ValueList]
-
- ## Parse [Binaries] section
- #
- # Only path can have macro used. So we need to replace them before use.
- #
- @ParseMacro
- def _BinaryFileParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 2)
- if len(TokenList) < 2:
- EdkLogger.error('Parser', FORMAT_INVALID, "No file type or path specified",
- ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
- File=self.MetaFile, Line=self._LineIndex+1)
- if not TokenList[0]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No file type specified",
- ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
- File=self.MetaFile, Line=self._LineIndex+1)
- if not TokenList[1]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No file path specified",
- ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
- File=self.MetaFile, Line=self._LineIndex+1)
- self._ValueList[0:len(TokenList)] = TokenList
- self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros)
-
- ## [nmake] section parser (Edk.x style only)
- def _NmakeParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- self._ValueList[0:len(TokenList)] = TokenList
- # remove macros
- self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros)
- # remove self-reference in macro setting
- #self._ValueList[1] = ReplaceMacro(self._ValueList[1], {self._ValueList[0]:''})
-
- ## [FixedPcd], [FeaturePcd], [PatchPcd], [Pcd] and [PcdEx] sections parser
- @ParseMacro
- def _PcdParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
- ValueList = GetSplitValueList(TokenList[0], TAB_SPLIT)
- if len(ValueList) != 2:
- EdkLogger.error('Parser', FORMAT_INVALID, "Illegal token space GUID and PCD name format",
- ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- self._ValueList[0:1] = ValueList
- if len(TokenList) > 1:
- self._ValueList[2] = TokenList[1]
- if self._ValueList[0] == '' or self._ValueList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
- ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
- File=self.MetaFile, Line=self._LineIndex+1)
-
- # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
- if self._ValueList[2] != '':
- InfPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
- if InfPcdValueList[0] in ['True', 'true', 'TRUE']:
- self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '1', 1);
- elif InfPcdValueList[0] in ['False', 'false', 'FALSE']:
- self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '0', 1);
-
- ## [depex] section parser
- @ParseMacro
- def _DepexParser(self):
- self._ValueList[0:1] = [self._CurrentLine]
-
- _SectionParser = {
- MODEL_UNKNOWN : MetaFileParser._Skip,
- MODEL_META_DATA_HEADER : MetaFileParser._DefineParser,
- MODEL_META_DATA_BUILD_OPTION : MetaFileParser._BuildOptionParser,
- MODEL_EFI_INCLUDE : _IncludeParser, # for Edk.x modules
- MODEL_EFI_LIBRARY_INSTANCE : MetaFileParser._CommonParser, # for Edk.x modules
- MODEL_EFI_LIBRARY_CLASS : MetaFileParser._PathParser,
- MODEL_META_DATA_PACKAGE : MetaFileParser._PathParser,
- MODEL_META_DATA_NMAKE : _NmakeParser, # for Edk.x modules
- MODEL_PCD_FIXED_AT_BUILD : _PcdParser,
- MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,
- MODEL_PCD_FEATURE_FLAG : _PcdParser,
- MODEL_PCD_DYNAMIC_EX : _PcdParser,
- MODEL_PCD_DYNAMIC : _PcdParser,
- MODEL_EFI_SOURCE_FILE : _SourceFileParser,
- MODEL_EFI_GUID : MetaFileParser._CommonParser,
- MODEL_EFI_PROTOCOL : MetaFileParser._CommonParser,
- MODEL_EFI_PPI : MetaFileParser._CommonParser,
- MODEL_EFI_DEPEX : _DepexParser,
- MODEL_EFI_BINARY_FILE : _BinaryFileParser,
- MODEL_META_DATA_USER_EXTENSION : MetaFileParser._Skip,
- }
-
-## DSC file parser class
-#
-# @param FilePath The path of platform description file
-# @param FileType The raw data of DSC file
-# @param Table Database used to retrieve module/package information
-# @param Macros Macros used for replacement in file
-# @param Owner Owner ID (for sub-section parsing)
-# @param From ID from which the data comes (for !INCLUDE directive)
-#
-class DscParser(MetaFileParser):
- # DSC file supported data types (one type per section)
- DataType = {
- TAB_SKUIDS.upper() : MODEL_EFI_SKU_ID,
- TAB_LIBRARIES.upper() : MODEL_EFI_LIBRARY_INSTANCE,
- TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,
- TAB_BUILD_OPTIONS.upper() : MODEL_META_DATA_BUILD_OPTION,
- TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : MODEL_PCD_FIXED_AT_BUILD,
- TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,
- TAB_PCDS_FEATURE_FLAG_NULL.upper() : MODEL_PCD_FEATURE_FLAG,
- TAB_PCDS_DYNAMIC_DEFAULT_NULL.upper() : MODEL_PCD_DYNAMIC_DEFAULT,
- TAB_PCDS_DYNAMIC_HII_NULL.upper() : MODEL_PCD_DYNAMIC_HII,
- TAB_PCDS_DYNAMIC_VPD_NULL.upper() : MODEL_PCD_DYNAMIC_VPD,
- TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper() : MODEL_PCD_DYNAMIC_EX_DEFAULT,
- TAB_PCDS_DYNAMIC_EX_HII_NULL.upper() : MODEL_PCD_DYNAMIC_EX_HII,
- TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper() : MODEL_PCD_DYNAMIC_EX_VPD,
- TAB_COMPONENTS.upper() : MODEL_META_DATA_COMPONENT,
- TAB_COMPONENTS_SOURCE_OVERRIDE_PATH.upper() : MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH,
- TAB_DSC_DEFINES.upper() : MODEL_META_DATA_HEADER,
- TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DEFINE,
- TAB_DSC_DEFINES_EDKGLOBAL : MODEL_META_DATA_GLOBAL_DEFINE,
- TAB_INCLUDE.upper() : MODEL_META_DATA_INCLUDE,
- TAB_IF.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
- TAB_IF_DEF.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,
- TAB_IF_N_DEF.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF,
- TAB_ELSE_IF.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF,
- TAB_ELSE.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE,
- TAB_END_IF.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF,
- }
-
- # Valid names in define section
- DefineKeywords = [
- "DSC_SPECIFICATION",
- "PLATFORM_NAME",
- "PLATFORM_GUID",
- "PLATFORM_VERSION",
- "SKUID_IDENTIFIER",
- "SUPPORTED_ARCHITECTURES",
- "BUILD_TARGETS",
- "OUTPUT_DIRECTORY",
- "FLASH_DEFINITION",
- "BUILD_NUMBER",
- "RFC_LANGUAGES",
- "ISO_LANGUAGES",
- "TIME_STAMP_FILE",
- "VPD_TOOL_GUID",
- "FIX_LOAD_TOP_MEMORY_ADDRESS"
- ]
-
- SymbolPattern = ValueExpression.SymbolPattern
-
- ## Constructor of DscParser
- #
- # Initialize object of DscParser
- #
- # @param FilePath The path of platform description file
- # @param FileType The raw data of DSC file
- # @param Table Database used to retrieve module/package information
- # @param Macros Macros used for replacement in file
- # @param Owner Owner ID (for sub-section parsing)
- # @param From ID from which the data comes (for !INCLUDE directive)
- #
- def __init__(self, FilePath, FileType, Table, Owner=-1, From=-1):
- # prevent re-initialization
- if hasattr(self, "_Table"):
- return
- MetaFileParser.__init__(self, FilePath, FileType, Table, Owner, From)
- self._Version = 0x00010005 # Only EDK2 dsc file is supported
- # to store conditional directive evaluation result
- self._DirectiveStack = []
- self._DirectiveEvalStack = []
- self._Enabled = 1
-
- # Final valid replacable symbols
- self._Symbols = {}
- #
- # Map the ID between the original table and new table to track
- # the owner item
- #
- self._IdMapping = {-1:-1}
-
- self.TblFile = EccGlobalData.gDb.TblFile
- self.FileID = -1
-
- ## Parser starter
- def Start(self):
- Content = ''
- try:
- Content = open(str(self.MetaFile.Path), 'r').readlines()
- except:
- EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=self.MetaFile)
- #
- # Insert a record for file
- #
- Filename = NormPath(self.MetaFile.Path)
- FileID = self.TblFile.GetFileId(Filename)
- if FileID:
- self.FileID = FileID
- else:
- self.FileID = self.TblFile.InsertFile(Filename, MODEL_FILE_DSC)
-
-
- for Index in range(0, len(Content)):
- Line = CleanString(Content[Index])
- # skip empty line
- if Line == '':
- continue
-
- self._CurrentLine = Line
- self._LineIndex = Index
- if self._InSubsection and self._Owner[-1] == -1:
- self._Owner.append(self._LastItem)
-
- # section header
- if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
- self._SectionType = MODEL_META_DATA_SECTION_HEADER
- # subsection ending
- elif Line[0] == '}' and self._InSubsection:
- self._InSubsection = False
- self._SubsectionType = MODEL_UNKNOWN
- self._SubsectionName = ''
- self._Owner[-1] = -1
- continue
- # subsection header
- elif Line[0] == TAB_OPTION_START and Line[-1] == TAB_OPTION_END:
- self._SubsectionType = MODEL_META_DATA_SUBSECTION_HEADER
- # directive line
- elif Line[0] == '!':
- self._DirectiveParser()
- continue
-
- if self._InSubsection:
- SectionType = self._SubsectionType
- else:
- SectionType = self._SectionType
- self._ItemType = SectionType
-
- self._ValueList = ['', '', '']
- self._SectionParser[SectionType](self)
- if self._ValueList == None:
- continue
- #
- # Model, Value1, Value2, Value3, Arch, ModuleType, BelongsToItem=-1, BelongsToFile=-1,
- # LineBegin=-1, ColumnBegin=-1, LineEnd=-1, ColumnEnd=-1, Enabled=-1
- #
- for Arch, ModuleType in self._Scope:
- self._LastItem = self._Store(
- self._ItemType,
- self._ValueList[0],
- self._ValueList[1],
- self._ValueList[2],
- Arch,
- ModuleType,
- self._Owner[-1],
- self.FileID,
- self._From,
- self._LineIndex+1,
- -1,
- self._LineIndex+1,
- -1,
- self._Enabled
- )
-
- if self._DirectiveStack:
- Type, Line, Text = self._DirectiveStack[-1]
- EdkLogger.error('Parser', FORMAT_INVALID, "No matching '!endif' found",
- ExtraData=Text, File=self.MetaFile, Line=Line)
- self._Done()
-
- ## <subsection_header> parser
- def _SubsectionHeaderParser(self):
- self._SubsectionName = self._CurrentLine[1:-1].upper()
- if self._SubsectionName in self.DataType:
- self._SubsectionType = self.DataType[self._SubsectionName]
- else:
- self._SubsectionType = MODEL_UNKNOWN
- EdkLogger.warn("Parser", "Unrecognized sub-section", File=self.MetaFile,
- Line=self._LineIndex+1, ExtraData=self._CurrentLine)
- self._ValueList[0] = self._SubsectionName
-
- ## Directive statement parser
- def _DirectiveParser(self):
- self._ValueList = ['','','']
- TokenList = GetSplitValueList(self._CurrentLine, ' ', 1)
- self._ValueList[0:len(TokenList)] = TokenList
-
- # Syntax check
- DirectiveName = self._ValueList[0].upper()
- if DirectiveName not in self.DataType:
- EdkLogger.error("Parser", FORMAT_INVALID, "Unknown directive [%s]" % DirectiveName,
- File=self.MetaFile, Line=self._LineIndex+1)
- if DirectiveName in ['!IF', '!IFDEF', '!INCLUDE', '!IFNDEF', '!ELSEIF'] and self._ValueList[1] == '':
- EdkLogger.error("Parser", FORMAT_INVALID, "Missing expression",
- File=self.MetaFile, Line=self._LineIndex+1,
- ExtraData=self._CurrentLine)
-
- ItemType = self.DataType[DirectiveName]
- if ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF:
- # Remove all directives between !if and !endif, including themselves
- while self._DirectiveStack:
- # Remove any !else or !elseif
- DirectiveInfo = self._DirectiveStack.pop()
- if DirectiveInfo[0] in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF]:
- break
- else:
- EdkLogger.error("Parser", FORMAT_INVALID, "Redundant '!endif'",
- File=self.MetaFile, Line=self._LineIndex+1,
- ExtraData=self._CurrentLine)
- elif ItemType != MODEL_META_DATA_INCLUDE:
- # Break if there's a !else is followed by a !elseif
- if ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF and \
- self._DirectiveStack and \
- self._DirectiveStack[-1][0] == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE:
- EdkLogger.error("Parser", FORMAT_INVALID, "'!elseif' after '!else'",
- File=self.MetaFile, Line=self._LineIndex+1,
- ExtraData=self._CurrentLine)
- self._DirectiveStack.append((ItemType, self._LineIndex+1, self._CurrentLine))
- elif self._From > 0:
- EdkLogger.error('Parser', FORMAT_INVALID,
- "No '!include' allowed in included file",
- ExtraData=self._CurrentLine, File=self.MetaFile,
- Line=self._LineIndex+1)
-
- #
- # Model, Value1, Value2, Value3, Arch, ModuleType, BelongsToItem=-1, BelongsToFile=-1,
- # LineBegin=-1, ColumnBegin=-1, LineEnd=-1, ColumnEnd=-1, Enabled=-1
- #
- self._LastItem = self._Store(
- ItemType,
- self._ValueList[0],
- self._ValueList[1],
- self._ValueList[2],
- 'COMMON',
- 'COMMON',
- self._Owner[-1],
- self.FileID,
- self._From,
- self._LineIndex+1,
- -1,
- self._LineIndex+1,
- -1,
- 0
- )
-
- ## [defines] section parser
- @ParseMacro
- def _DefineParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- self._ValueList[1:len(TokenList)] = TokenList
-
- # Syntax check
- if not self._ValueList[1]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No name specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- if not self._ValueList[2]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No value specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- if not self._ValueList[1] in self.DefineKeywords:
- EdkLogger.error('Parser', FORMAT_INVALID,
- "Unknown keyword found: %s. "
- "If this is a macro you must "
- "add it as a DEFINE in the DSC" % self._ValueList[1],
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- self._Defines[self._ValueList[1]] = self._ValueList[2]
- self._ItemType = self.DataType[TAB_DSC_DEFINES.upper()]
-
- @ParseMacro
- def _SkuIdParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- if len(TokenList) != 2:
- EdkLogger.error('Parser', FORMAT_INVALID, "Correct format is '<Integer>|<UiName>'",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1)
- self._ValueList[0:len(TokenList)] = TokenList
-
- ## Parse Edk style of library modules
- def _LibraryInstanceParser(self):
- self._ValueList[0] = self._CurrentLine
-
- ## PCD sections parser
- #
- # [PcdsFixedAtBuild]
- # [PcdsPatchableInModule]
- # [PcdsFeatureFlag]
- # [PcdsDynamicEx
- # [PcdsDynamicExDefault]
- # [PcdsDynamicExVpd]
- # [PcdsDynamicExHii]
- # [PcdsDynamic]
- # [PcdsDynamicDefault]
- # [PcdsDynamicVpd]
- # [PcdsDynamicHii]
- #
- @ParseMacro
- def _PcdParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
- self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
- if len(TokenList) == 2:
- self._ValueList[2] = TokenList[1]
- if self._ValueList[0] == '' or self._ValueList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
- ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- if self._ValueList[2] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given",
- ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
- DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
- if DscPcdValueList[0] in ['True', 'true', 'TRUE']:
- self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '1', 1);
- elif DscPcdValueList[0] in ['False', 'false', 'FALSE']:
- self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '0', 1);
-
- ## [components] section parser
- @ParseMacro
- def _ComponentParser(self):
- if self._CurrentLine[-1] == '{':
- self._ValueList[0] = self._CurrentLine[0:-1].strip()
- self._InSubsection = True
- else:
- self._ValueList[0] = self._CurrentLine
-
- ## [LibraryClasses] section
- @ParseMacro
- def _LibraryClassParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- if len(TokenList) < 2:
- EdkLogger.error('Parser', FORMAT_INVALID, "No library class or instance specified",
- ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- if TokenList[0] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No library class specified",
- ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- if TokenList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No library instance specified",
- ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
- File=self.MetaFile, Line=self._LineIndex+1)
-
- self._ValueList[0:len(TokenList)] = TokenList
-
- def _CompponentSourceOverridePathParser(self):
- self._ValueList[0] = self._CurrentLine
-
- ## [BuildOptions] section parser
- @ParseMacro
- def _BuildOptionParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- TokenList2 = GetSplitValueList(TokenList[0], ':', 1)
- if len(TokenList2) == 2:
- self._ValueList[0] = TokenList2[0] # toolchain family
- self._ValueList[1] = TokenList2[1] # keys
- else:
- self._ValueList[1] = TokenList[0]
- if len(TokenList) == 2: # value
- self._ValueList[2] = TokenList[1]
-
- if self._ValueList[1].count('_') != 4:
- EdkLogger.error(
- 'Parser',
- FORMAT_INVALID,
- "'%s' must be in format of <TARGET>_<TOOLCHAIN>_<ARCH>_<TOOL>_FLAGS" % self._ValueList[1],
- ExtraData=self._CurrentLine,
- File=self.MetaFile,
- Line=self._LineIndex+1
- )
-
- ## Override parent's method since we'll do all macro replacements in parser
- def _GetMacros(self):
- Macros = {}
- Macros.update(self._FileLocalMacros)
- Macros.update(self._GetApplicableSectionMacro())
- Macros.update(GlobalData.gEdkGlobal)
- Macros.update(GlobalData.gPlatformDefines)
- Macros.update(GlobalData.gCommandLineDefines)
- # PCD cannot be referenced in macro definition
- if self._ItemType not in [MODEL_META_DATA_DEFINE, MODEL_META_DATA_GLOBAL_DEFINE]:
- Macros.update(self._Symbols)
- return Macros
-
- def _PostProcess(self):
- Processer = {
- MODEL_META_DATA_SECTION_HEADER : self.__ProcessSectionHeader,
- MODEL_META_DATA_SUBSECTION_HEADER : self.__ProcessSubsectionHeader,
- MODEL_META_DATA_HEADER : self.__ProcessDefine,
- MODEL_META_DATA_DEFINE : self.__ProcessDefine,
- MODEL_META_DATA_GLOBAL_DEFINE : self.__ProcessDefine,
- MODEL_META_DATA_INCLUDE : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IF : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF : self.__ProcessDirective,
- MODEL_EFI_SKU_ID : self.__ProcessSkuId,
- MODEL_EFI_LIBRARY_INSTANCE : self.__ProcessLibraryInstance,
- MODEL_EFI_LIBRARY_CLASS : self.__ProcessLibraryClass,
- MODEL_PCD_FIXED_AT_BUILD : self.__ProcessPcd,
- MODEL_PCD_PATCHABLE_IN_MODULE : self.__ProcessPcd,
- MODEL_PCD_FEATURE_FLAG : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_DEFAULT : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_HII : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_VPD : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_EX_DEFAULT : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_EX_HII : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_EX_VPD : self.__ProcessPcd,
- MODEL_META_DATA_COMPONENT : self.__ProcessComponent,
- MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH : self.__ProcessSourceOverridePath,
- MODEL_META_DATA_BUILD_OPTION : self.__ProcessBuildOption,
- MODEL_UNKNOWN : self._Skip,
- MODEL_META_DATA_USER_EXTENSION : self._Skip,
- }
-
- self._RawTable = self._Table
- self._Table = MetaFileStorage(self._RawTable.Cur, self.MetaFile, MODEL_FILE_DSC, True)
- self._DirectiveStack = []
- self._DirectiveEvalStack = []
- self._FileWithError = self.MetaFile
- self._FileLocalMacros = {}
- self._SectionsMacroDict = {}
- GlobalData.gPlatformDefines = {}
-
- # Get all macro and PCD which has straitforward value
- self.__RetrievePcdValue()
- self._Content = self._RawTable.GetAll()
- self._ContentIndex = 0
- while self._ContentIndex < len(self._Content) :
- Id, self._ItemType, V1, V2, V3, S1, S2, Owner, BelongsToFile, self._From, \
- LineStart, ColStart, LineEnd, ColEnd, Enabled = self._Content[self._ContentIndex]
-
- if self._From < 0:
- self._FileWithError = self.MetaFile
-
- self._ContentIndex += 1
-
- self._Scope = [[S1, S2]]
- self._LineIndex = LineStart - 1
- self._ValueList = [V1, V2, V3]
-
- try:
- Processer[self._ItemType]()
- except EvaluationException, Excpt:
- #
- # Only catch expression evaluation error here. We need to report
- # the precise number of line on which the error occurred
- #
- EdkLogger.error('Parser', FORMAT_INVALID, "Invalid expression: %s" % str(Excpt),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex+1)
- except MacroException, Excpt:
- EdkLogger.error('Parser', FORMAT_INVALID, str(Excpt),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex+1)
-
- if self._ValueList == None:
- continue
-
- NewOwner = self._IdMapping.get(Owner, -1)
- self._Enabled = int((not self._DirectiveEvalStack) or (False not in self._DirectiveEvalStack))
- self._LastItem = self._Store(
- self._ItemType,
- self._ValueList[0],
- self._ValueList[1],
- self._ValueList[2],
- S1,
- S2,
- NewOwner,
- BelongsToFile,
- self._From,
- self._LineIndex+1,
- -1,
- self._LineIndex+1,
- -1,
- self._Enabled
- )
- self._IdMapping[Id] = self._LastItem
-
- RecordList = self._Table.GetAll()
-
- self._RawTable.Drop()
- self._Table.Drop()
- for Record in RecordList:
- EccGlobalData.gDb.TblDsc.Insert(Record[1],Record[2],Record[3],Record[4],Record[5],Record[6],Record[7],Record[8],Record[9],Record[10],Record[11],Record[12],Record[13],Record[14])
- GlobalData.gPlatformDefines.update(self._FileLocalMacros)
- self._PostProcessed = True
- self._Content = None
-
- def __ProcessSectionHeader(self):
- self._SectionName = self._ValueList[0]
- if self._SectionName in self.DataType:
- self._SectionType = self.DataType[self._SectionName]
- else:
- self._SectionType = MODEL_UNKNOWN
-
- def __ProcessSubsectionHeader(self):
- self._SubsectionName = self._ValueList[0]
- if self._SubsectionName in self.DataType:
- self._SubsectionType = self.DataType[self._SubsectionName]
- else:
- self._SubsectionType = MODEL_UNKNOWN
-
- def __RetrievePcdValue(self):
- Records = self._RawTable.Query(MODEL_PCD_FEATURE_FLAG, BelongsToItem=-1.0)
- for TokenSpaceGuid,PcdName,Value,Dummy2,Dummy3,ID,Line in Records:
- Value, DatumType, MaxDatumSize = AnalyzePcdData(Value)
- # Only use PCD whose value is straitforward (no macro and PCD)
- if self.SymbolPattern.findall(Value):
- continue
- Name = TokenSpaceGuid + '.' + PcdName
- # Don't use PCD with different values.
- if Name in self._Symbols and self._Symbols[Name] != Value:
- self._Symbols.pop(Name)
- continue
- self._Symbols[Name] = Value
-
- Records = self._RawTable.Query(MODEL_PCD_FIXED_AT_BUILD, BelongsToItem=-1.0)
- for TokenSpaceGuid,PcdName,Value,Dummy2,Dummy3,ID,Line in Records:
- Value, DatumType, MaxDatumSize = AnalyzePcdData(Value)
- # Only use PCD whose value is straitforward (no macro and PCD)
- if self.SymbolPattern.findall(Value):
- continue
- Name = TokenSpaceGuid+'.'+PcdName
- # Don't use PCD with different values.
- if Name in self._Symbols and self._Symbols[Name] != Value:
- self._Symbols.pop(Name)
- continue
- self._Symbols[Name] = Value
-
- def __ProcessDefine(self):
- if not self._Enabled:
- return
-
- Type, Name, Value = self._ValueList
- Value = ReplaceMacro(Value, self._Macros, False)
- if self._ItemType == MODEL_META_DATA_DEFINE:
- if self._SectionType == MODEL_META_DATA_HEADER:
- self._FileLocalMacros[Name] = Value
- else:
- SectionDictKey = self._SectionType, self._Scope[0][0], self._Scope[0][1]
- if SectionDictKey not in self._SectionsMacroDict:
- self._SectionsMacroDict[SectionDictKey] = {}
- SectionLocalMacros = self._SectionsMacroDict[SectionDictKey]
- SectionLocalMacros[Name] = Value
- elif self._ItemType == MODEL_META_DATA_GLOBAL_DEFINE:
- GlobalData.gEdkGlobal[Name] = Value
-
- #
- # Keyword in [Defines] section can be used as Macros
- #
- if (self._ItemType == MODEL_META_DATA_HEADER) and (self._SectionType == MODEL_META_DATA_HEADER):
- self._FileLocalMacros[Name] = Value
-
- self._ValueList = [Type, Name, Value]
-
- def __ProcessDirective(self):
- Result = None
- if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF]:
- Macros = self._Macros
- Macros.update(GlobalData.gGlobalDefines)
- try:
- Result = ValueExpression(self._ValueList[1], Macros)()
- except SymbolNotFound, Exc:
- EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc), self._ValueList[1])
- Result = False
- except WrnExpression, Excpt:
- #
- # Catch expression evaluation warning here. We need to report
- # the precise number of line and return the evaluation result
- #
- EdkLogger.warn('Parser', "Suspicious expression: %s" % str(Excpt),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex+1)
- Result = Excpt.result
-
- if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF]:
- self._DirectiveStack.append(self._ItemType)
- if self._ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_IF:
- Result = bool(Result)
- else:
- Macro = self._ValueList[1]
- Macro = Macro[2:-1] if (Macro.startswith("$(") and Macro.endswith(")")) else Macro
- Result = Macro in self._Macros
- if self._ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF:
- Result = not Result
- self._DirectiveEvalStack.append(Result)
- elif self._ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF:
- self._DirectiveStack.append(self._ItemType)
- self._DirectiveEvalStack[-1] = not self._DirectiveEvalStack[-1]
- self._DirectiveEvalStack.append(bool(Result))
- elif self._ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE:
- self._DirectiveStack[-1] = self._ItemType
- self._DirectiveEvalStack[-1] = not self._DirectiveEvalStack[-1]
- elif self._ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF:
- # Back to the nearest !if/!ifdef/!ifndef
- while self._DirectiveStack:
- self._DirectiveEvalStack.pop()
- Directive = self._DirectiveStack.pop()
- if Directive in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF]:
- break
- elif self._ItemType == MODEL_META_DATA_INCLUDE:
- # The included file must be relative to workspace or same directory as DSC file
- __IncludeMacros = {}
- #
- # Allow using system environment variables in path after !include
- #
- __IncludeMacros['WORKSPACE'] = GlobalData.gGlobalDefines['WORKSPACE']
- if "ECP_SOURCE" in GlobalData.gGlobalDefines.keys():
- __IncludeMacros['ECP_SOURCE'] = GlobalData.gGlobalDefines['ECP_SOURCE']
- #
- # During GenFds phase call DSC parser, will go into this branch.
- #
- elif "ECP_SOURCE" in GlobalData.gCommandLineDefines.keys():
- __IncludeMacros['ECP_SOURCE'] = GlobalData.gCommandLineDefines['ECP_SOURCE']
-
- __IncludeMacros['EFI_SOURCE'] = GlobalData.gGlobalDefines['EFI_SOURCE']
- __IncludeMacros['EDK_SOURCE'] = GlobalData.gGlobalDefines['EDK_SOURCE']
- #
- # Allow using MACROs comes from [Defines] section to keep compatible.
- #
- __IncludeMacros.update(self._Macros)
-
- IncludedFile = NormPath(ReplaceMacro(self._ValueList[1], __IncludeMacros, RaiseError=True))
- #
- # First search the include file under the same directory as DSC file
- #
- IncludedFile1 = PathClass(IncludedFile, self.MetaFile.Dir)
- ErrorCode, ErrorInfo1 = IncludedFile1.Validate()
- if ErrorCode != 0:
- #
- # Also search file under the WORKSPACE directory
- #
- IncludedFile1 = PathClass(IncludedFile, GlobalData.gWorkspace)
- ErrorCode, ErrorInfo2 = IncludedFile1.Validate()
- if ErrorCode != 0:
- EdkLogger.error('parser', ErrorCode, File=self._FileWithError,
- Line=self._LineIndex+1, ExtraData=ErrorInfo1 + "\n"+ ErrorInfo2)
-
- self._FileWithError = IncludedFile1
-
- IncludedFileTable = MetaFileStorage(self._Table.Cur, IncludedFile1, MODEL_FILE_DSC, True)
- Owner = self._Content[self._ContentIndex-1][0]
- Parser = DscParser(IncludedFile1, self._FileType, IncludedFileTable,
- Owner=Owner, From=Owner)
-
- # set the parser status with current status
- Parser._SectionName = self._SectionName
- Parser._SectionType = self._SectionType
- Parser._Scope = self._Scope
- Parser._Enabled = self._Enabled
- # Parse the included file
- Parser.Start()
-
- # update current status with sub-parser's status
- self._SectionName = Parser._SectionName
- self._SectionType = Parser._SectionType
- self._Scope = Parser._Scope
- self._Enabled = Parser._Enabled
-
- # Insert all records in the table for the included file into dsc file table
- Records = IncludedFileTable.GetAll()
- if Records:
- self._Content[self._ContentIndex:self._ContentIndex] = Records
- self._Content.pop(self._ContentIndex-1)
- self._ValueList = None
- self._ContentIndex -= 1
-
- def __ProcessSkuId(self):
- self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=True)
- for Value in self._ValueList]
-
- def __ProcessLibraryInstance(self):
- self._ValueList = [ReplaceMacro(Value, self._Macros) for Value in self._ValueList]
-
- def __ProcessLibraryClass(self):
- self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros, RaiseError=True)
-
- def __ProcessPcd(self):
- ValueList = GetSplitValueList(self._ValueList[2])
- #
- # PCD value can be an expression
- #
- if len(ValueList) > 1 and ValueList[1] == 'VOID*':
- PcdValue = ValueList[0]
- try:
- ValueList[0] = ValueExpression(PcdValue, self._Macros)(True)
- except WrnExpression, Value:
- ValueList[0] = Value.result
- else:
- PcdValue = ValueList[-1]
- try:
- ValueList[-1] = ValueExpression(PcdValue, self._Macros)(True)
- except WrnExpression, Value:
- ValueList[-1] = Value.result
-
- if ValueList[-1] == 'True':
- ValueList[-1] = '1'
- if ValueList[-1] == 'False':
- ValueList[-1] = '0'
-
- self._ValueList[2] = '|'.join(ValueList)
-
- def __ProcessComponent(self):
- self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
-
- def __ProcessSourceOverridePath(self):
- self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
-
- def __ProcessBuildOption(self):
- self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=False)
- for Value in self._ValueList]
-
- _SectionParser = {
- MODEL_META_DATA_HEADER : _DefineParser,
- MODEL_EFI_SKU_ID : _SkuIdParser,
- MODEL_EFI_LIBRARY_INSTANCE : _LibraryInstanceParser,
- MODEL_EFI_LIBRARY_CLASS : _LibraryClassParser,
- MODEL_PCD_FIXED_AT_BUILD : _PcdParser,
- MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,
- MODEL_PCD_FEATURE_FLAG : _PcdParser,
- MODEL_PCD_DYNAMIC_DEFAULT : _PcdParser,
- MODEL_PCD_DYNAMIC_HII : _PcdParser,
- MODEL_PCD_DYNAMIC_VPD : _PcdParser,
- MODEL_PCD_DYNAMIC_EX_DEFAULT : _PcdParser,
- MODEL_PCD_DYNAMIC_EX_HII : _PcdParser,
- MODEL_PCD_DYNAMIC_EX_VPD : _PcdParser,
- MODEL_META_DATA_COMPONENT : _ComponentParser,
- MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH : _CompponentSourceOverridePathParser,
- MODEL_META_DATA_BUILD_OPTION : _BuildOptionParser,
- MODEL_UNKNOWN : MetaFileParser._Skip,
- MODEL_META_DATA_USER_EXTENSION : MetaFileParser._Skip,
- MODEL_META_DATA_SECTION_HEADER : MetaFileParser._SectionHeaderParser,
- MODEL_META_DATA_SUBSECTION_HEADER : _SubsectionHeaderParser,
- }
-
- _Macros = property(_GetMacros)
-
-## DEC file parser class
-#
-# @param FilePath The path of platform description file
-# @param FileType The raw data of DSC file
-# @param Table Database used to retrieve module/package information
-# @param Macros Macros used for replacement in file
-#
-class DecParser(MetaFileParser):
- # DEC file supported data types (one type per section)
- DataType = {
- TAB_DEC_DEFINES.upper() : MODEL_META_DATA_HEADER,
- TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DEFINE,
- TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,
- TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,
- TAB_GUIDS.upper() : MODEL_EFI_GUID,
- TAB_PPIS.upper() : MODEL_EFI_PPI,
- TAB_PROTOCOLS.upper() : MODEL_EFI_PROTOCOL,
- TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : MODEL_PCD_FIXED_AT_BUILD,
- TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,
- TAB_PCDS_FEATURE_FLAG_NULL.upper() : MODEL_PCD_FEATURE_FLAG,
- TAB_PCDS_DYNAMIC_NULL.upper() : MODEL_PCD_DYNAMIC,
- TAB_PCDS_DYNAMIC_EX_NULL.upper() : MODEL_PCD_DYNAMIC_EX,
- }
-
- ## Constructor of DecParser
- #
- # Initialize object of DecParser
- #
- # @param FilePath The path of platform description file
- # @param FileType The raw data of DSC file
- # @param Table Database used to retrieve module/package information
- # @param Macros Macros used for replacement in file
- #
- def __init__(self, FilePath, FileType, Table):
- # prevent re-initialization
- if hasattr(self, "_Table"):
- return
- MetaFileParser.__init__(self, FilePath, FileType, Table)
- self._Comments = []
- self._Version = 0x00010005 # Only EDK2 dec file is supported
- self.TblFile = EccGlobalData.gDb.TblFile
- self.FileID = -1
-
- ## Parser starter
- def Start(self):
- Content = ''
- try:
- Content = open(str(self.MetaFile), 'r').readlines()
- except:
- EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=self.MetaFile)
-
- #
- # Insert a record for file
- #
- Filename = NormPath(self.MetaFile)
- FileID = self.TblFile.GetFileId(Filename)
- if FileID:
- self.FileID = FileID
- else:
- self.FileID = self.TblFile.InsertFile(Filename, MODEL_FILE_DEC)
-
- for Index in range(0, len(Content)):
- Line, Comment = CleanString2(Content[Index])
- self._CurrentLine = Line
- self._LineIndex = Index
-
- # save comment for later use
- if Comment:
- self._Comments.append((Comment, self._LineIndex+1))
- # skip empty line
- if Line == '':
- continue
-
- # section header
- if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
- self._SectionHeaderParser()
- self._Comments = []
- continue
- elif len(self._SectionType) == 0:
- self._Comments = []
- continue
-
- # section content
- self._ValueList = ['','','']
- self._SectionParser[self._SectionType[0]](self)
- if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:
- self._ItemType = -1
- self._Comments = []
- continue
-
- #
- # Model, Value1, Value2, Value3, Arch, BelongsToItem=-1, LineBegin=-1,
- # ColumnBegin=-1, LineEnd=-1, ColumnEnd=-1, FeatureFlag='', Enabled=-1
- #
- for Arch, ModuleType, Type in self._Scope:
- self._LastItem = self._Store(
- Type,
- self._ValueList[0],
- self._ValueList[1],
- self._ValueList[2],
- Arch,
- ModuleType,
- self._Owner[-1],
- self.FileID,
- self._LineIndex+1,
- -1,
- self._LineIndex+1,
- -1,
- 0
- )
- for Comment, LineNo in self._Comments:
- self._Store(
- MODEL_META_DATA_COMMENT,
- Comment,
- self._ValueList[0],
- self._ValueList[1],
- Arch,
- ModuleType,
- self._LastItem,
- self.FileID,
- LineNo,
- -1,
- LineNo,
- -1,
- 0
- )
- self._Comments = []
- self._Done()
-
- def _GetApplicableSectionMacro(self):
- Macros = {}
- for S1, S2, SectionType in self._Scope:
- for Scope1, Scope2 in [("COMMON", "COMMON"), ("COMMON", S2), (S1, "COMMON"), (S1, S2)]:
- if (SectionType, Scope1, Scope2) in self._SectionsMacroDict:
- Macros.update(self._SectionsMacroDict[(SectionType, Scope1, Scope2)])
- return Macros
-
- ## Section header parser
- #
- # The section header is always in following format:
- #
- # [section_name.arch<.platform|module_type>]
- #
- def _SectionHeaderParser(self):
- self._Scope = []
- self._SectionName = ''
- self._SectionType = []
- ArchList = set()
- for Item in GetSplitValueList(self._CurrentLine[1:-1], TAB_COMMA_SPLIT):
- if Item == '':
- continue
- ItemList = GetSplitValueList(Item, TAB_SPLIT)
-
- # different types of PCD are permissible in one section
- self._SectionName = ItemList[0].upper()
- if self._SectionName in self.DataType:
- if self.DataType[self._SectionName] not in self._SectionType:
- self._SectionType.append(self.DataType[self._SectionName])
- else:
- EdkLogger.warn("Parser", "Unrecognized section", File=self.MetaFile,
- Line=self._LineIndex+1, ExtraData=self._CurrentLine)
- continue
-
- if MODEL_PCD_FEATURE_FLAG in self._SectionType and len(self._SectionType) > 1:
- EdkLogger.error(
- 'Parser',
- FORMAT_INVALID,
- "%s must not be in the same section of other types of PCD" % TAB_PCDS_FEATURE_FLAG_NULL,
- File=self.MetaFile,
- Line=self._LineIndex+1,
- ExtraData=self._CurrentLine
- )
- # S1 is always Arch
- if len(ItemList) > 1:
- S1 = ItemList[1].upper()
- else:
- S1 = 'COMMON'
- ArchList.add(S1)
- # S2 may be Platform or ModuleType
- if len(ItemList) > 2:
- S2 = ItemList[2].upper()
- else:
- S2 = 'COMMON'
- if [S1, S2, self.DataType[self._SectionName]] not in self._Scope:
- self._Scope.append([S1, S2, self.DataType[self._SectionName]])
-
- # 'COMMON' must not be used with specific ARCHs at the same section
- if 'COMMON' in ArchList and len(ArchList) > 1:
- EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
- File=self.MetaFile, Line=self._LineIndex+1, ExtraData=self._CurrentLine)
-
- ## [guids], [ppis] and [protocols] section parser
- @ParseMacro
- def _GuidParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- if len(TokenList) < 2:
- EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name or value specified",
- ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- if TokenList[0] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name specified",
- ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- if TokenList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No GUID value specified",
- ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- if TokenList[1][0] != '{' or TokenList[1][-1] != '}' or GuidStructureStringToGuidString(TokenList[1]) == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "Invalid GUID value format",
- ExtraData=self._CurrentLine + \
- " (<CName> = <GuidValueInCFormat:{8,4,4,{2,2,2,2,2,2,2,2}}>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- self._ValueList[0] = TokenList[0]
- #Parse the Guid value format
- GuidValueList = TokenList[1].strip(' {}').split(',')
- Index = 0
- HexList = []
- if len(GuidValueList) == 11:
- for GuidValue in GuidValueList:
- GuidValue = GuidValue.strip()
- if GuidValue.startswith('0x') or GuidValue.startswith('0X'):
- HexList.append('0x' + str(GuidValue[2:]))
- Index += 1
- continue
- else:
- if GuidValue.startswith('{'):
- HexList.append('0x' + str(GuidValue[3:]))
- Index += 1
- self._ValueList[1] = "{ %s, %s, %s, { %s, %s, %s, %s, %s, %s, %s, %s }}" % (HexList[0], HexList[1], HexList[2],HexList[3],HexList[4],HexList[5],HexList[6],HexList[7],HexList[8],HexList[9],HexList[10])
- else:
- EdkLogger.error('Parser', FORMAT_INVALID, "Invalid GUID value format",
- ExtraData=self._CurrentLine + \
- " (<CName> = <GuidValueInCFormat:{8,4,4,{2,2,2,2,2,2,2,2}}>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- self._ValueList[0] = ''
-
- ## PCD sections parser
- #
- # [PcdsFixedAtBuild]
- # [PcdsPatchableInModule]
- # [PcdsFeatureFlag]
- # [PcdsDynamicEx
- # [PcdsDynamic]
- #
- @ParseMacro
- def _PcdParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
- self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
- # check PCD information
- if self._ValueList[0] == '' or self._ValueList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- # check PCD datum information
- if len(TokenList) < 2 or TokenList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No PCD Datum information given",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
-
-
- ValueRe = re.compile(r'^\s*L?\".*\|.*\"')
- PtrValue = ValueRe.findall(TokenList[1])
-
- # Has VOID* type string, may contain "|" character in the string.
- if len(PtrValue) != 0:
- ptrValueList = re.sub(ValueRe, '', TokenList[1])
- ValueList = GetSplitValueList(ptrValueList)
- ValueList[0] = PtrValue[0]
- else:
- ValueList = GetSplitValueList(TokenList[1])
-
-
- # check if there's enough datum information given
- if len(ValueList) != 3:
- EdkLogger.error('Parser', FORMAT_INVALID, "Invalid PCD Datum information given",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- # check default value
- if ValueList[0] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "Missing DefaultValue in PCD Datum information",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- # check datum type
- if ValueList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "Missing DatumType in PCD Datum information",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- # check token of the PCD
- if ValueList[2] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "Missing Token in PCD Datum information",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex+1)
- # check format of default value against the datum type
- IsValid, Cause = CheckPcdDatum(ValueList[1], ValueList[0])
- if not IsValid:
- EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=self._CurrentLine,
- File=self.MetaFile, Line=self._LineIndex+1)
-
- if ValueList[0] in ['True', 'true', 'TRUE']:
- ValueList[0] = '1'
- elif ValueList[0] in ['False', 'false', 'FALSE']:
- ValueList[0] = '0'
-
- self._ValueList[2] = ValueList[0].strip() + '|' + ValueList[1].strip() + '|' + ValueList[2].strip()
-
- _SectionParser = {
- MODEL_META_DATA_HEADER : MetaFileParser._DefineParser,
- MODEL_EFI_INCLUDE : MetaFileParser._PathParser,
- MODEL_EFI_LIBRARY_CLASS : MetaFileParser._PathParser,
- MODEL_EFI_GUID : _GuidParser,
- MODEL_EFI_PPI : _GuidParser,
- MODEL_EFI_PROTOCOL : _GuidParser,
- MODEL_PCD_FIXED_AT_BUILD : _PcdParser,
- MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,
- MODEL_PCD_FEATURE_FLAG : _PcdParser,
- MODEL_PCD_DYNAMIC : _PcdParser,
- MODEL_PCD_DYNAMIC_EX : _PcdParser,
- MODEL_UNKNOWN : MetaFileParser._Skip,
- MODEL_META_DATA_USER_EXTENSION : MetaFileParser._Skip,
- }
-
-
-## FdfObject
-#
-# This class defined basic Fdf object which is used by inheriting
-#
-# @param object: Inherited from object class
-#
-class FdfObject(object):
- def __init__(self):
- object.__init__()
-
-## Fdf
-#
-# This class defined the structure used in Fdf object
-#
-# @param FdfObject: Inherited from FdfObject class
-# @param Filename: Input value for Ffilename of Fdf file, default is None
-# @param WorkspaceDir: Input value for current workspace directory, default is None
-#
-class Fdf(FdfObject):
- def __init__(self, Filename = None, IsToDatabase = False, WorkspaceDir = None, Database = None):
- self.WorkspaceDir = WorkspaceDir
- self.IsToDatabase = IsToDatabase
-
- self.Cur = Database.Cur
- self.TblFile = Database.TblFile
- self.TblFdf = Database.TblFdf
- self.FileID = -1
- self.FileList = {}
-
- #
- # Load Fdf file if filename is not None
- #
- if Filename != None:
- self.LoadFdfFile(Filename)
-
- #
- # Insert a FDF file record into database
- #
- def InsertFile(self, Filename):
- FileID = -1
- Filename = NormPath(Filename)
- if Filename not in self.FileList:
- FileID = self.TblFile.InsertFile(Filename, MODEL_FILE_FDF)
- self.FileList[Filename] = FileID
-
- return self.FileList[Filename]
-
-
- ## Load Fdf file
- #
- # Load the file if it exists
- #
- # @param Filename: Input value for filename of Fdf file
- #
- def LoadFdfFile(self, Filename):
- FileList = []
- #
- # Parse Fdf file
- #
- Filename = NormPath(Filename)
- Fdf = FdfParser(Filename)
- Fdf.ParseFile()
-
- #
- # Insert inf file and pcd information
- #
- if self.IsToDatabase:
- (Model, Value1, Value2, Value3, Scope1, Scope2, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled) = \
- (0, '', '', '', 'COMMON', 'COMMON', -1, -1, -1, -1, -1, -1, 0)
- for Index in range(0, len(Fdf.Profile.PcdDict)):
- pass
- for Key in Fdf.Profile.PcdDict.keys():
- Model = MODEL_PCD
- Value1 = Key[1]
- Value2 = Key[0]
- FileName = Fdf.Profile.PcdFileLineDict[Key][0]
- StartLine = Fdf.Profile.PcdFileLineDict[Key][1]
- BelongsToFile = self.InsertFile(FileName)
- self.TblFdf.Insert(Model, Value1, Value2, Value3, Scope1, Scope2, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
- for Index in range(0, len(Fdf.Profile.InfList)):
- Model = MODEL_META_DATA_COMPONENT
- Value1 = Fdf.Profile.InfList[Index]
- Value2 = ''
- FileName = Fdf.Profile.InfFileLineList[Index][0]
- StartLine = Fdf.Profile.InfFileLineList[Index][1]
- BelongsToFile = self.InsertFile(FileName)
- self.TblFdf.Insert(Model, Value1, Value2, Value3, Scope1, Scope2, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- pass
-
diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py
deleted file mode 100644
index 89bc7f262f..0000000000
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py
+++ /dev/null
@@ -1,332 +0,0 @@
-## @file
-# This file is used to create/update/query/erase a meta file table
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import uuid
-
-import Common.EdkLogger as EdkLogger
-import EccGlobalData
-
-from MetaDataTable import Table
-from MetaDataTable import ConvertToSqlString
-from CommonDataClass.DataClass import MODEL_FILE_DSC, MODEL_FILE_DEC, MODEL_FILE_INF, \
- MODEL_FILE_OTHERS
-
-class MetaFileTable(Table):
- ## Constructor
- def __init__(self, Cursor, MetaFile, FileType, TableName, Temporary = False):
- self.MetaFile = MetaFile
- self.TblFile = EccGlobalData.gDb.TblFile
- if (FileType == MODEL_FILE_INF):
- TableName = "Inf"
- if (FileType == MODEL_FILE_DSC):
- if Temporary:
- TableName = "_%s_%s" % ("Dsc", uuid.uuid4().hex)
- else:
- TableName = "Dsc"
- if (FileType == MODEL_FILE_DEC):
- TableName = "Dec"
-
- Table.__init__(self, Cursor, TableName, 0, Temporary)
- self.Create(False)
-
-
-## Python class representation of table storing module data
-class ModuleTable(MetaFileTable):
- _COLUMN_ = '''
- ID REAL PRIMARY KEY,
- Model INTEGER NOT NULL,
- Value1 TEXT NOT NULL,
- Value2 TEXT,
- Value3 TEXT,
- Scope1 TEXT,
- Scope2 TEXT,
- BelongsToItem REAL NOT NULL,
- BelongsToFile SINGLE NOT NULL,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- Enabled INTEGER DEFAULT 0
- '''
- # used as table end flag, in case the changes to database is not committed to db file
- _DUMMY_ = "-1, -1, '====', '====', '====', '====', '====', -1, -1, -1, -1, -1, -1, -1"
-
- ## Constructor
- def __init__(self, Cursor):
- MetaFileTable.__init__(self, Cursor, '', MODEL_FILE_INF, "Inf", False)
-
- ## Insert a record into table Inf
- #
- # @param Model: Model of a Inf item
- # @param Value1: Value1 of a Inf item
- # @param Value2: Value2 of a Inf item
- # @param Value3: Value3 of a Inf item
- # @param Scope1: Arch of a Inf item
- # @param Scope2 Platform os a Inf item
- # @param BelongsToItem: The item belongs to which another item
- # @param StartLine: StartLine of a Inf item
- # @param StartColumn: StartColumn of a Inf item
- # @param EndLine: EndLine of a Inf item
- # @param EndColumn: EndColumn of a Inf item
- # @param Enabled: If this item enabled
- #
- def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON',
- BelongsToItem=-1, BelongsToFile = -1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):
- (Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
- return Table.Insert(
- self,
- Model,
- Value1,
- Value2,
- Value3,
- Scope1,
- Scope2,
- BelongsToItem,
- BelongsToFile,
- StartLine,
- StartColumn,
- EndLine,
- EndColumn,
- Enabled
- )
-
- ## Query table
- #
- # @param Model: The Model of Record
- # @param Arch: The Arch attribute of Record
- # @param Platform The Platform attribute of Record
- #
- # @retval: A recordSet of all found records
- #
- def Query(self, Model, Arch=None, Platform=None):
- ConditionString = "Model=%s AND Enabled>=0" % Model
- ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"
-
- if Arch != None and Arch != 'COMMON':
- ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch
- if Platform != None and Platform != 'COMMON':
- ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Platform
-
- SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)
- return self.Exec(SqlCommand)
-
-## Python class representation of table storing package data
-class PackageTable(MetaFileTable):
- _COLUMN_ = '''
- ID REAL PRIMARY KEY,
- Model INTEGER NOT NULL,
- Value1 TEXT NOT NULL,
- Value2 TEXT,
- Value3 TEXT,
- Scope1 TEXT,
- Scope2 TEXT,
- BelongsToItem REAL NOT NULL,
- BelongsToFile SINGLE NOT NULL,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- Enabled INTEGER DEFAULT 0
- '''
- # used as table end flag, in case the changes to database is not committed to db file
- _DUMMY_ = "-1, -1, '====', '====', '====', '====', '====', -1, -1, -1, -1, -1, -1, -1"
-
- ## Constructor
- def __init__(self, Cursor):
- MetaFileTable.__init__(self, Cursor, '', MODEL_FILE_DEC, "Dec", False)
-
- ## Insert table
- #
- # Insert a record into table Dec
- #
- # @param Model: Model of a Dec item
- # @param Value1: Value1 of a Dec item
- # @param Value2: Value2 of a Dec item
- # @param Value3: Value3 of a Dec item
- # @param Scope1: Arch of a Dec item
- # @param Scope2: Module type of a Dec item
- # @param BelongsToItem: The item belongs to which another item
- # @param StartLine: StartLine of a Dec item
- # @param StartColumn: StartColumn of a Dec item
- # @param EndLine: EndLine of a Dec item
- # @param EndColumn: EndColumn of a Dec item
- # @param Enabled: If this item enabled
- #
- def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON',
- BelongsToItem=-1, BelongsToFile = -1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):
- (Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
- return Table.Insert(
- self,
- Model,
- Value1,
- Value2,
- Value3,
- Scope1,
- Scope2,
- BelongsToItem,
- BelongsToFile,
- StartLine,
- StartColumn,
- EndLine,
- EndColumn,
- Enabled
- )
-
- ## Query table
- #
- # @param Model: The Model of Record
- # @param Arch: The Arch attribute of Record
- #
- # @retval: A recordSet of all found records
- #
- def Query(self, Model, Arch=None):
- ConditionString = "Model=%s AND Enabled>=0" % Model
- ValueString = "Value1,Value2,Value3,Scope1,ID,StartLine"
-
- if Arch != None and Arch != 'COMMON':
- ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch
-
- SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)
- return self.Exec(SqlCommand)
-
-## Python class representation of table storing platform data
-class PlatformTable(MetaFileTable):
- _COLUMN_ = '''
- ID REAL PRIMARY KEY,
- Model INTEGER NOT NULL,
- Value1 TEXT NOT NULL,
- Value2 TEXT,
- Value3 TEXT,
- Scope1 TEXT,
- Scope2 TEXT,
- BelongsToItem REAL NOT NULL,
- BelongsToFile SINGLE NOT NULL,
- FromItem REAL NOT NULL,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- Enabled INTEGER DEFAULT 0
- '''
- # used as table end flag, in case the changes to database is not committed to db file
- _DUMMY_ = "-1, -1, '====', '====', '====', '====', '====', -1, -1, -1, -1, -1, -1, -1, -1"
-
- ## Constructor
- def __init__(self, Cursor, MetaFile = '', FileType = MODEL_FILE_DSC, Temporary = False):
- MetaFileTable.__init__(self, Cursor, MetaFile, FileType, "Dsc", Temporary)
-
- ## Insert table
- #
- # Insert a record into table Dsc
- #
- # @param Model: Model of a Dsc item
- # @param Value1: Value1 of a Dsc item
- # @param Value2: Value2 of a Dsc item
- # @param Value3: Value3 of a Dsc item
- # @param Scope1: Arch of a Dsc item
- # @param Scope2: Module type of a Dsc item
- # @param BelongsToItem: The item belongs to which another item
- # @param FromItem: The item belongs to which dsc file
- # @param StartLine: StartLine of a Dsc item
- # @param StartColumn: StartColumn of a Dsc item
- # @param EndLine: EndLine of a Dsc item
- # @param EndColumn: EndColumn of a Dsc item
- # @param Enabled: If this item enabled
- #
- def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON', BelongsToItem=-1, BelongsToFile = -1,
- FromItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=1):
- (Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
- return Table.Insert(
- self,
- Model,
- Value1,
- Value2,
- Value3,
- Scope1,
- Scope2,
- BelongsToItem,
- BelongsToFile,
- FromItem,
- StartLine,
- StartColumn,
- EndLine,
- EndColumn,
- Enabled
- )
-
- ## Query table
- #
- # @param Model: The Model of Record
- # @param Scope1: Arch of a Dsc item
- # @param Scope2: Module type of a Dsc item
- # @param BelongsToItem: The item belongs to which another item
- # @param FromItem: The item belongs to which dsc file
- #
- # @retval: A recordSet of all found records
- #
- def Query(self, Model, Scope1=None, Scope2=None, BelongsToItem=None, FromItem=None):
- ConditionString = "Model=%s AND Enabled>0" % Model
- ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"
-
- if Scope1 != None and Scope1 != 'COMMON':
- ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Scope1
- if Scope2 != None and Scope2 != 'COMMON':
- ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Scope2
-
- if BelongsToItem != None:
- ConditionString += " AND BelongsToItem=%s" % BelongsToItem
- else:
- ConditionString += " AND BelongsToItem<0"
-
- if FromItem != None:
- ConditionString += " AND FromItem=%s" % FromItem
-
- SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)
- return self.Exec(SqlCommand)
-
-## Factory class to produce different storage for different type of meta-file
-class MetaFileStorage(object):
- _FILE_TABLE_ = {
- MODEL_FILE_INF : ModuleTable,
- MODEL_FILE_DEC : PackageTable,
- MODEL_FILE_DSC : PlatformTable,
- MODEL_FILE_OTHERS : MetaFileTable,
- }
-
- _FILE_TYPE_ = {
- ".inf" : MODEL_FILE_INF,
- ".dec" : MODEL_FILE_DEC,
- ".dsc" : MODEL_FILE_DSC,
- }
-
- ## Constructor
- def __new__(Class, Cursor, MetaFile, FileType=None, Temporary=False):
- # no type given, try to find one
- if not FileType:
- if MetaFile.Type in self._FILE_TYPE_:
- FileType = Class._FILE_TYPE_[MetaFile.Type]
- else:
- FileType = MODEL_FILE_OTHERS
-
- # don't pass the type around if it's well known
- if FileType == MODEL_FILE_OTHERS:
- Args = (Cursor, MetaFile, FileType, Temporary)
- else:
- Args = (Cursor, MetaFile, FileType, Temporary)
-
- # create the storage object and return it to caller
- return Class._FILE_TABLE_[FileType](*Args)
-
diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/__init__.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/__init__.py
deleted file mode 100644
index 05cd34bad5..0000000000
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'Workspace' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/Ecc/ParserWarning.py b/BaseTools/Source/Python/Ecc/ParserWarning.py
deleted file mode 100644
index a52c78ec31..0000000000
--- a/BaseTools/Source/Python/Ecc/ParserWarning.py
+++ /dev/null
@@ -1,30 +0,0 @@
-## @file
-# This file is used to be the warning class of ECC tool
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-## The exception class that used to report error messages when preprocessing
-#
-# Currently the "ToolName" is set to be "ECC PP".
-#
-class Warning (Exception):
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param File The FDF name
- # @param Line The Line number that error occurs
- #
- def __init__(self, Str, File = None, Line = None):
- self.message = Str
- self.FileName = File
- self.LineNumber = Line
- self.ToolName = 'ECC PP' \ No newline at end of file
diff --git a/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py b/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py
deleted file mode 100644
index 5823067056..0000000000
--- a/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py
+++ /dev/null
@@ -1,228 +0,0 @@
-## @file
-# This is an XML API that uses a syntax similar to XPath, but it is written in
-# standard python so that no extra python packages are required to use it.
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import xml.dom.minidom
-
-## Create a element of XML
-#
-# @param Name
-# @param String
-# @param NodeList
-# @param AttributeList
-#
-# @revel Element
-#
-def CreateXmlElement(Name, String, NodeList, AttributeList):
- Doc = xml.dom.minidom.Document()
- Element = Doc.createElement(Name)
- if String != '' and String != None:
- Element.appendChild(Doc.createTextNode(String))
-
- for Item in NodeList:
- if type(Item) == type([]):
- Key = Item[0]
- Value = Item[1]
- if Key != '' and Key != None and Value != '' and Value != None:
- Node = Doc.createElement(Key)
- Node.appendChild(Doc.createTextNode(Value))
- Element.appendChild(Node)
- else:
- Element.appendChild(Item)
- for Item in AttributeList:
- Key = Item[0]
- Value = Item[1]
- if Key != '' and Key != None and Value != '' and Value != None:
- Element.setAttribute(Key, Value)
-
- return Element
-
-## Get a list of XML nodes using XPath style syntax.
-#
-# Return a list of XML DOM nodes from the root Dom specified by XPath String.
-# If the input Dom or String is not valid, then an empty list is returned.
-#
-# @param Dom The root XML DOM node.
-# @param String A XPath style path.
-#
-# @revel Nodes A list of XML nodes matching XPath style Sting.
-#
-def XmlList(Dom, String):
- if String == None or String == "" or Dom == None or Dom == "":
- return []
- if Dom.nodeType == Dom.DOCUMENT_NODE:
- Dom = Dom.documentElement
- if String[0] == "/":
- String = String[1:]
- TagList = String.split('/')
- Nodes = [Dom]
- Index = 0
- End = len(TagList) - 1
- while Index <= End:
- ChildNodes = []
- for Node in Nodes:
- if Node.nodeType == Node.ELEMENT_NODE and Node.tagName == TagList[Index]:
- if Index < End:
- ChildNodes.extend(Node.childNodes)
- else:
- ChildNodes.append(Node)
- Nodes = ChildNodes
- ChildNodes = []
- Index += 1
-
- return Nodes
-
-
-## Get a single XML node using XPath style syntax.
-#
-# Return a single XML DOM node from the root Dom specified by XPath String.
-# If the input Dom or String is not valid, then an empty string is returned.
-#
-# @param Dom The root XML DOM node.
-# @param String A XPath style path.
-#
-# @revel Node A single XML node matching XPath style Sting.
-#
-def XmlNode(Dom, String):
- if String == None or String == "" or Dom == None or Dom == "":
- return ""
- if Dom.nodeType == Dom.DOCUMENT_NODE:
- Dom = Dom.documentElement
- if String[0] == "/":
- String = String[1:]
- TagList = String.split('/')
- Index = 0
- End = len(TagList) - 1
- ChildNodes = [Dom]
- while Index <= End:
- for Node in ChildNodes:
- if Node.nodeType == Node.ELEMENT_NODE and Node.tagName == TagList[Index]:
- if Index < End:
- ChildNodes = Node.childNodes
- else:
- return Node
- break
- Index += 1
- return ""
-
-
-## Get a single XML element using XPath style syntax.
-#
-# Return a single XML element from the root Dom specified by XPath String.
-# If the input Dom or String is not valid, then an empty string is returned.
-#
-# @param Dom The root XML DOM object.
-# @param Strin A XPath style path.
-#
-# @revel Element An XML element matching XPath style Sting.
-#
-def XmlElement(Dom, String):
- try:
- return XmlNode(Dom, String).firstChild.data.strip()
- except:
- return ""
-
-
-## Get a single XML element of the current node.
-#
-# Return a single XML element specified by the current root Dom.
-# If the input Dom is not valid, then an empty string is returned.
-#
-# @param Dom The root XML DOM object.
-#
-# @revel Element An XML element in current root Dom.
-#
-def XmlElementData(Dom):
- try:
- return Dom.firstChild.data.strip()
- except:
- return ""
-
-
-## Get a list of XML elements using XPath style syntax.
-#
-# Return a list of XML elements from the root Dom specified by XPath String.
-# If the input Dom or String is not valid, then an empty list is returned.
-#
-# @param Dom The root XML DOM object.
-# @param String A XPath style path.
-#
-# @revel Elements A list of XML elements matching XPath style Sting.
-#
-def XmlElementList(Dom, String):
- return map(XmlElementData, XmlList(Dom, String))
-
-
-## Get the XML attribute of the current node.
-#
-# Return a single XML attribute named Attribute from the current root Dom.
-# If the input Dom or Attribute is not valid, then an empty string is returned.
-#
-# @param Dom The root XML DOM object.
-# @param Attribute The name of Attribute.
-#
-# @revel Element A single XML element matching XPath style Sting.
-#
-def XmlAttribute(Dom, Attribute):
- try:
- return Dom.getAttribute(Attribute).strip()
- except:
- return ''
-
-
-## Get the XML node name of the current node.
-#
-# Return a single XML node name from the current root Dom.
-# If the input Dom is not valid, then an empty string is returned.
-#
-# @param Dom The root XML DOM object.
-#
-# @revel Element A single XML element matching XPath style Sting.
-#
-def XmlNodeName(Dom):
- try:
- return Dom.nodeName.strip()
- except:
- return ''
-
-## Parse an XML file.
-#
-# Parse the input XML file named FileName and return a XML DOM it stands for.
-# If the input File is not a valid XML file, then an empty string is returned.
-#
-# @param FileName The XML file name.
-#
-# @revel Dom The Dom object achieved from the XML file.
-#
-def XmlParseFile(FileName):
- try:
- XmlFile = open(FileName)
- Dom = xml.dom.minidom.parse(XmlFile)
- XmlFile.close()
- return Dom
- except Exception, X:
- print X
- return ""
-
-# This acts like the main() function for the script, unless it is 'import'ed
-# into another script.
-if __name__ == '__main__':
- # Nothing to do here. Could do some unit tests.
- A = CreateXmlElement('AAA', 'CCC', [['AAA', '111'], ['BBB', '222']], [['A', '1'], ['B', '2']])
- B = CreateXmlElement('ZZZ', 'CCC', [['XXX', '111'], ['YYY', '222']], [['A', '1'], ['B', '2']])
- C = CreateXmlList('DDD', 'EEE', [A, B], ['FFF', 'GGG'])
- print C.toprettyxml(indent = " ")
- pass
diff --git a/BaseTools/Source/Python/Ecc/Xml/__init__.py b/BaseTools/Source/Python/Ecc/Xml/__init__.py
deleted file mode 100644
index 5d268d990b..0000000000
--- a/BaseTools/Source/Python/Ecc/Xml/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Library' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Xml
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/Ecc/__init__.py b/BaseTools/Source/Python/Ecc/__init__.py
deleted file mode 100644
index 880ad499f4..0000000000
--- a/BaseTools/Source/Python/Ecc/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'Ecc' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py
deleted file mode 100644
index ea7d99fecd..0000000000
--- a/BaseTools/Source/Python/Ecc/c.py
+++ /dev/null
@@ -1,2614 +0,0 @@
-## @file
-# This file is used to be the c coding style checking of ECC tool
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-import sys
-import os
-import re
-import string
-import CodeFragmentCollector
-import FileProfile
-from CommonDataClass import DataClass
-import Database
-from Common import EdkLogger
-from EccToolError import *
-import EccGlobalData
-import MetaDataParser
-
-IncludeFileListDict = {}
-AllIncludeFileListDict = {}
-IncludePathListDict = {}
-ComplexTypeDict = {}
-SUDict = {}
-IgnoredKeywordList = ['EFI_ERROR']
-
-def GetIgnoredDirListPattern():
- skipList = list(EccGlobalData.gConfig.SkipDirList) + ['.svn']
- DirString = string.join(skipList, '|')
- p = re.compile(r'.*[\\/](?:%s)[\\/]?.*' % DirString)
- return p
-
-def GetFuncDeclPattern():
- p = re.compile(r'(?:EFIAPI|EFI_BOOT_SERVICE|EFI_RUNTIME_SERVICE)?\s*[_\w]+\s*\(.*\)$', re.DOTALL)
- return p
-
-def GetArrayPattern():
- p = re.compile(r'[_\w]*\s*[\[.*\]]+')
- return p
-
-def GetTypedefFuncPointerPattern():
- p = re.compile('[_\w\s]*\([\w\s]*\*+\s*[_\w]+\s*\)\s*\(.*\)', re.DOTALL)
- return p
-
-def GetDB():
- return EccGlobalData.gDb
-
-def GetConfig():
- return EccGlobalData.gConfig
-
-def PrintErrorMsg(ErrorType, Msg, TableName, ItemId):
- Msg = Msg.replace('\n', '').replace('\r', '')
- MsgPartList = Msg.split()
- Msg = ''
- for Part in MsgPartList:
- Msg += Part
- Msg += ' '
- GetDB().TblReport.Insert(ErrorType, OtherMsg=Msg, BelongsToTable=TableName, BelongsToItem=ItemId)
-
-def GetIdType(Str):
- Type = DataClass.MODEL_UNKNOWN
- Str = Str.replace('#', '# ')
- List = Str.split()
- if List[1] == 'include':
- Type = DataClass.MODEL_IDENTIFIER_INCLUDE
- elif List[1] == 'define':
- Type = DataClass.MODEL_IDENTIFIER_MACRO_DEFINE
- elif List[1] == 'ifdef':
- Type = DataClass.MODEL_IDENTIFIER_MACRO_IFDEF
- elif List[1] == 'ifndef':
- Type = DataClass.MODEL_IDENTIFIER_MACRO_IFNDEF
- elif List[1] == 'endif':
- Type = DataClass.MODEL_IDENTIFIER_MACRO_ENDIF
- elif List[1] == 'pragma':
- Type = DataClass.MODEL_IDENTIFIER_MACRO_PROGMA
- else:
- Type = DataClass.MODEL_UNKNOWN
- return Type
-
-def SuOccurInTypedef (Su, TdList):
- for Td in TdList:
- if Su.StartPos[0] == Td.StartPos[0] and Su.EndPos[0] == Td.EndPos[0]:
- return True
- return False
-
-def GetIdentifierList():
- IdList = []
- for comment in FileProfile.CommentList:
- IdComment = DataClass.IdentifierClass(-1, '', '', '', comment.Content, DataClass.MODEL_IDENTIFIER_COMMENT, -1, -1, comment.StartPos[0], comment.StartPos[1], comment.EndPos[0], comment.EndPos[1])
- IdList.append(IdComment)
-
- for pp in FileProfile.PPDirectiveList:
- Type = GetIdType(pp.Content)
- IdPP = DataClass.IdentifierClass(-1, '', '', '', pp.Content, Type, -1, -1, pp.StartPos[0], pp.StartPos[1], pp.EndPos[0], pp.EndPos[1])
- IdList.append(IdPP)
-
- for pe in FileProfile.PredicateExpressionList:
- IdPE = DataClass.IdentifierClass(-1, '', '', '', pe.Content, DataClass.MODEL_IDENTIFIER_PREDICATE_EXPRESSION, -1, -1, pe.StartPos[0], pe.StartPos[1], pe.EndPos[0], pe.EndPos[1])
- IdList.append(IdPE)
-
- FuncDeclPattern = GetFuncDeclPattern()
- ArrayPattern = GetArrayPattern()
- for var in FileProfile.VariableDeclarationList:
- DeclText = var.Declarator.lstrip()
- FuncPointerPattern = GetTypedefFuncPointerPattern()
- if FuncPointerPattern.match(DeclText):
- continue
- VarNameStartLine = var.NameStartPos[0]
- VarNameStartColumn = var.NameStartPos[1]
- FirstChar = DeclText[0]
- while not FirstChar.isalpha() and FirstChar != '_':
- if FirstChar == '*':
- var.Modifier += '*'
- VarNameStartColumn += 1
- DeclText = DeclText.lstrip('*')
- elif FirstChar == '\r':
- DeclText = DeclText.lstrip('\r\n').lstrip('\r')
- VarNameStartLine += 1
- VarNameStartColumn = 0
- elif FirstChar == '\n':
- DeclText = DeclText.lstrip('\n')
- VarNameStartLine += 1
- VarNameStartColumn = 0
- elif FirstChar == ' ':
- DeclText = DeclText.lstrip(' ')
- VarNameStartColumn += 1
- elif FirstChar == '\t':
- DeclText = DeclText.lstrip('\t')
- VarNameStartColumn += 8
- else:
- DeclText = DeclText[1:]
- VarNameStartColumn += 1
- FirstChar = DeclText[0]
-
- var.Declarator = DeclText
- if FuncDeclPattern.match(var.Declarator):
- DeclSplitList = var.Declarator.split('(')
- FuncName = DeclSplitList[0].strip()
- FuncNamePartList = FuncName.split()
- if len(FuncNamePartList) > 1:
- FuncName = FuncNamePartList[-1].strip()
- NameStart = DeclSplitList[0].rfind(FuncName)
- var.Declarator = var.Declarator[NameStart:]
- if NameStart > 0:
- var.Modifier += ' ' + DeclSplitList[0][0:NameStart]
- Index = 0
- PreChar = ''
- while Index < NameStart:
- FirstChar = DeclSplitList[0][Index]
- if DeclSplitList[0][Index:].startswith('EFIAPI'):
- Index += 6
- VarNameStartColumn += 6
- PreChar = ''
- continue
- elif FirstChar == '\r':
- Index += 1
- VarNameStartLine += 1
- VarNameStartColumn = 0
- elif FirstChar == '\n':
- Index += 1
- if PreChar != '\r':
- VarNameStartLine += 1
- VarNameStartColumn = 0
- elif FirstChar == ' ':
- Index += 1
- VarNameStartColumn += 1
- elif FirstChar == '\t':
- Index += 1
- VarNameStartColumn += 8
- else:
- Index += 1
- VarNameStartColumn += 1
- PreChar = FirstChar
- IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', var.Declarator, FuncName, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine, VarNameStartColumn)
- IdList.append(IdVar)
- continue
-
- if var.Declarator.find('{') == -1:
- for decl in var.Declarator.split(','):
- DeclList = decl.split('=')
- Name = DeclList[0].strip()
- if ArrayPattern.match(Name):
- LSBPos = var.Declarator.find('[')
- var.Modifier += ' ' + Name[LSBPos:]
- Name = Name[0:LSBPos]
-
- IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine, VarNameStartColumn)
- IdList.append(IdVar)
- else:
- DeclList = var.Declarator.split('=')
- Name = DeclList[0].strip()
- if ArrayPattern.match(Name):
- LSBPos = var.Declarator.find('[')
- var.Modifier += ' ' + Name[LSBPos:]
- Name = Name[0:LSBPos]
- IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine, VarNameStartColumn)
- IdList.append(IdVar)
-
- for enum in FileProfile.EnumerationDefinitionList:
- LBPos = enum.Content.find('{')
- RBPos = enum.Content.find('}')
- Name = enum.Content[4:LBPos].strip()
- Value = enum.Content[LBPos + 1:RBPos]
- IdEnum = DataClass.IdentifierClass(-1, '', '', Name, Value, DataClass.MODEL_IDENTIFIER_ENUMERATE, -1, -1, enum.StartPos[0], enum.StartPos[1], enum.EndPos[0], enum.EndPos[1])
- IdList.append(IdEnum)
-
- for su in FileProfile.StructUnionDefinitionList:
- if SuOccurInTypedef(su, FileProfile.TypedefDefinitionList):
- continue
- Type = DataClass.MODEL_IDENTIFIER_STRUCTURE
- SkipLen = 6
- if su.Content.startswith('union'):
- Type = DataClass.MODEL_IDENTIFIER_UNION
- SkipLen = 5
- LBPos = su.Content.find('{')
- RBPos = su.Content.find('}')
- if LBPos == -1 or RBPos == -1:
- Name = su.Content[SkipLen:].strip()
- Value = ''
- else:
- Name = su.Content[SkipLen:LBPos].strip()
- Value = su.Content[LBPos:RBPos + 1]
- IdPE = DataClass.IdentifierClass(-1, '', '', Name, Value, Type, -1, -1, su.StartPos[0], su.StartPos[1], su.EndPos[0], su.EndPos[1])
- IdList.append(IdPE)
-
- TdFuncPointerPattern = GetTypedefFuncPointerPattern()
- for td in FileProfile.TypedefDefinitionList:
- Modifier = ''
- Name = td.ToType
- Value = td.FromType
- if TdFuncPointerPattern.match(td.ToType):
- Modifier = td.FromType
- LBPos = td.ToType.find('(')
- TmpStr = td.ToType[LBPos + 1:].strip()
- StarPos = TmpStr.find('*')
- if StarPos != -1:
- Modifier += ' ' + TmpStr[0:StarPos]
- while TmpStr[StarPos] == '*':
-# Modifier += ' ' + '*'
- StarPos += 1
- TmpStr = TmpStr[StarPos:].strip()
- RBPos = TmpStr.find(')')
- Name = TmpStr[0:RBPos]
- Value = 'FP' + TmpStr[RBPos + 1:]
- else:
- while Name.startswith('*'):
- Value += ' ' + '*'
- Name = Name.lstrip('*').strip()
-
- if Name.find('[') != -1:
- LBPos = Name.find('[')
- RBPos = Name.rfind(']')
- Value += Name[LBPos : RBPos + 1]
- Name = Name[0 : LBPos]
-
- IdTd = DataClass.IdentifierClass(-1, Modifier, '', Name, Value, DataClass.MODEL_IDENTIFIER_TYPEDEF, -1, -1, td.StartPos[0], td.StartPos[1], td.EndPos[0], td.EndPos[1])
- IdList.append(IdTd)
-
- for funcCall in FileProfile.FunctionCallingList:
- IdFC = DataClass.IdentifierClass(-1, '', '', funcCall.FuncName, funcCall.ParamList, DataClass.MODEL_IDENTIFIER_FUNCTION_CALLING, -1, -1, funcCall.StartPos[0], funcCall.StartPos[1], funcCall.EndPos[0], funcCall.EndPos[1])
- IdList.append(IdFC)
- return IdList
-
-def StripNonAlnumChars(Str):
- StrippedStr = ''
- for Char in Str:
- if Char.isalnum():
- StrippedStr += Char
- return StrippedStr
-
-def GetParamList(FuncDeclarator, FuncNameLine=0, FuncNameOffset=0):
- FuncDeclarator = StripComments(FuncDeclarator)
- ParamIdList = []
- #DeclSplitList = FuncDeclarator.split('(')
- LBPos = FuncDeclarator.find('(')
- #if len(DeclSplitList) < 2:
- if LBPos == -1:
- return ParamIdList
- #FuncName = DeclSplitList[0]
- FuncName = FuncDeclarator[0:LBPos]
- #ParamStr = DeclSplitList[1].rstrip(')')
- ParamStr = FuncDeclarator[LBPos + 1:].rstrip(')')
- LineSkipped = 0
- OffsetSkipped = 0
- TailChar = FuncName[-1]
- while not TailChar.isalpha() and TailChar != '_':
-
- if TailChar == '\n':
- FuncName = FuncName.rstrip('\r\n').rstrip('\n')
- LineSkipped += 1
- OffsetSkipped = 0
- elif TailChar == '\r':
- FuncName = FuncName.rstrip('\r')
- LineSkipped += 1
- OffsetSkipped = 0
- elif TailChar == ' ':
- FuncName = FuncName.rstrip(' ')
- OffsetSkipped += 1
- elif TailChar == '\t':
- FuncName = FuncName.rstrip('\t')
- OffsetSkipped += 8
- else:
- FuncName = FuncName[:-1]
- TailChar = FuncName[-1]
-
- OffsetSkipped += 1 #skip '('
-
- for p in ParamStr.split(','):
- ListP = p.split()
- if len(ListP) == 0:
- continue
- ParamName = ListP[-1]
- DeclText = ParamName.strip()
- RightSpacePos = p.rfind(ParamName)
- ParamModifier = p[0:RightSpacePos]
- if ParamName == 'OPTIONAL':
- if ParamModifier == '':
- ParamModifier += ' ' + 'OPTIONAL'
- DeclText = ''
- else:
- ParamName = ListP[-2]
- DeclText = ParamName.strip()
- RightSpacePos = p.rfind(ParamName)
- ParamModifier = p[0:RightSpacePos]
- ParamModifier += 'OPTIONAL'
- while DeclText.startswith('*'):
- ParamModifier += ' ' + '*'
- DeclText = DeclText.lstrip('*').strip()
- ParamName = DeclText
- # ignore array length if exists.
- LBIndex = ParamName.find('[')
- if LBIndex != -1:
- ParamName = ParamName[0:LBIndex]
-
- Start = RightSpacePos
- Index = 0
- PreChar = ''
- while Index < Start:
- FirstChar = p[Index]
-
- if FirstChar == '\r':
- Index += 1
- LineSkipped += 1
- OffsetSkipped = 0
- elif FirstChar == '\n':
- Index += 1
- if PreChar != '\r':
- LineSkipped += 1
- OffsetSkipped = 0
- elif FirstChar == ' ':
- Index += 1
- OffsetSkipped += 1
- elif FirstChar == '\t':
- Index += 1
- OffsetSkipped += 8
- else:
- Index += 1
- OffsetSkipped += 1
- PreChar = FirstChar
-
- ParamBeginLine = FuncNameLine + LineSkipped
- ParamBeginOffset = FuncNameOffset + OffsetSkipped
-
- Index = Start + len(ParamName)
- PreChar = ''
- while Index < len(p):
- FirstChar = p[Index]
-
- if FirstChar == '\r':
- Index += 1
- LineSkipped += 1
- OffsetSkipped = 0
- elif FirstChar == '\n':
- Index += 1
- if PreChar != '\r':
- LineSkipped += 1
- OffsetSkipped = 0
- elif FirstChar == ' ':
- Index += 1
- OffsetSkipped += 1
- elif FirstChar == '\t':
- Index += 1
- OffsetSkipped += 8
- else:
- Index += 1
- OffsetSkipped += 1
- PreChar = FirstChar
-
- ParamEndLine = FuncNameLine + LineSkipped
- ParamEndOffset = FuncNameOffset + OffsetSkipped
- if ParamName != '...':
- ParamName = StripNonAlnumChars(ParamName)
- IdParam = DataClass.IdentifierClass(-1, ParamModifier, '', ParamName, '', DataClass.MODEL_IDENTIFIER_PARAMETER, -1, -1, ParamBeginLine, ParamBeginOffset, ParamEndLine, ParamEndOffset)
- ParamIdList.append(IdParam)
-
- OffsetSkipped += 1 #skip ','
-
- return ParamIdList
-
-def GetFunctionList():
- FuncObjList = []
- for FuncDef in FileProfile.FunctionDefinitionList:
- ParamIdList = []
- DeclText = FuncDef.Declarator.lstrip()
- FuncNameStartLine = FuncDef.NamePos[0]
- FuncNameStartColumn = FuncDef.NamePos[1]
- FirstChar = DeclText[0]
- while not FirstChar.isalpha() and FirstChar != '_':
- if FirstChar == '*':
- FuncDef.Modifier += '*'
- FuncNameStartColumn += 1
- DeclText = DeclText.lstrip('*')
- elif FirstChar == '\r':
- DeclText = DeclText.lstrip('\r\n').lstrip('\r')
- FuncNameStartLine += 1
- FuncNameStartColumn = 0
- elif FirstChar == '\n':
- DeclText = DeclText.lstrip('\n')
- FuncNameStartLine += 1
- FuncNameStartColumn = 0
- elif FirstChar == ' ':
- DeclText = DeclText.lstrip(' ')
- FuncNameStartColumn += 1
- elif FirstChar == '\t':
- DeclText = DeclText.lstrip('\t')
- FuncNameStartColumn += 8
- else:
- DeclText = DeclText[1:]
- FuncNameStartColumn += 1
- FirstChar = DeclText[0]
-
- FuncDef.Declarator = DeclText
- DeclSplitList = FuncDef.Declarator.split('(')
- if len(DeclSplitList) < 2:
- continue
-
- FuncName = DeclSplitList[0]
- FuncNamePartList = FuncName.split()
- if len(FuncNamePartList) > 1:
- FuncName = FuncNamePartList[-1]
- NameStart = DeclSplitList[0].rfind(FuncName)
- if NameStart > 0:
- FuncDef.Modifier += ' ' + DeclSplitList[0][0:NameStart]
- Index = 0
- PreChar = ''
- while Index < NameStart:
- FirstChar = DeclSplitList[0][Index]
- if DeclSplitList[0][Index:].startswith('EFIAPI'):
- Index += 6
- FuncNameStartColumn += 6
- PreChar = ''
- continue
- elif FirstChar == '\r':
- Index += 1
- FuncNameStartLine += 1
- FuncNameStartColumn = 0
- elif FirstChar == '\n':
- Index += 1
- if PreChar != '\r':
- FuncNameStartLine += 1
- FuncNameStartColumn = 0
- elif FirstChar == ' ':
- Index += 1
- FuncNameStartColumn += 1
- elif FirstChar == '\t':
- Index += 1
- FuncNameStartColumn += 8
- else:
- Index += 1
- FuncNameStartColumn += 1
- PreChar = FirstChar
-
- FuncObj = DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDef.Modifier, FuncName.strip(), '', FuncDef.StartPos[0], FuncDef.StartPos[1], FuncDef.EndPos[0], FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.LeftBracePos[1], -1, ParamIdList, [], FuncNameStartLine, FuncNameStartColumn)
- FuncObjList.append(FuncObj)
-
- return FuncObjList
-
-def GetFileModificationTimeFromDB(FullFileName):
- TimeValue = 0.0
- Db = GetDB()
- SqlStatement = """ select TimeStamp
- from File
- where FullPath = \'%s\'
- """ % (FullFileName)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- TimeValue = Result[0]
- return TimeValue
-
-def CollectSourceCodeDataIntoDB(RootDir):
- FileObjList = []
- tuple = os.walk(RootDir)
- IgnoredPattern = GetIgnoredDirListPattern()
- ParseErrorFileList = []
-
- for dirpath, dirnames, filenames in tuple:
- if IgnoredPattern.match(dirpath.upper()):
- continue
-
- for Dir in dirnames:
- Dirname = os.path.join(dirpath, Dir)
- if os.path.islink(Dirname):
- Dirname = os.path.realpath(Dirname)
- if os.path.isdir(Dirname):
- # symlinks to directories are treated as directories
- dirnames.remove(Dir)
- dirnames.append(Dirname)
-
- for f in filenames:
- collector = None
- FullName = os.path.normpath(os.path.join(dirpath, f))
- model = DataClass.MODEL_FILE_OTHERS
- if os.path.splitext(f)[1] in ('.h', '.c'):
- EdkLogger.info("Parsing " + FullName)
- model = f.endswith('c') and DataClass.MODEL_FILE_C or DataClass.MODEL_FILE_H
- collector = CodeFragmentCollector.CodeFragmentCollector(FullName)
- try:
- collector.ParseFile()
- except UnicodeError:
- ParseErrorFileList.append(FullName)
- collector.CleanFileProfileBuffer()
- collector.ParseFileWithClearedPPDirective()
-# collector.PrintFragments()
- BaseName = os.path.basename(f)
- DirName = os.path.dirname(FullName)
- Ext = os.path.splitext(f)[1].lstrip('.')
- ModifiedTime = os.path.getmtime(FullName)
- FileObj = DataClass.FileClass(-1, BaseName, Ext, DirName, FullName, model, ModifiedTime, GetFunctionList(), GetIdentifierList(), [])
- FileObjList.append(FileObj)
- if collector:
- collector.CleanFileProfileBuffer()
-
- if len(ParseErrorFileList) > 0:
- EdkLogger.info("Found unrecoverable error during parsing:\n\t%s\n" % "\n\t".join(ParseErrorFileList))
-
- Db = GetDB()
- for file in FileObjList:
- if file.ExtName.upper() not in ['INF', 'DEC', 'DSC', 'FDF']:
- Db.InsertOneFile(file)
-
- Db.UpdateIdentifierBelongsToFunction()
-
-def GetTableID(FullFileName, ErrorMsgList=None):
- if ErrorMsgList == None:
- ErrorMsgList = []
-
- Db = GetDB()
- SqlStatement = """ select ID
- from File
- where FullPath like '%s'
- """ % FullFileName
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- FileID = -1
- for Result in ResultSet:
- if FileID != -1:
- ErrorMsgList.append('Duplicate file ID found in DB for file %s' % FullFileName)
- return - 2
- FileID = Result[0]
- if FileID == -1:
- ErrorMsgList.append('NO file ID found in DB for file %s' % FullFileName)
- return - 1
- return FileID
-
-def GetIncludeFileList(FullFileName):
- if os.path.splitext(FullFileName)[1].upper() not in ('.H'):
- return []
- IFList = IncludeFileListDict.get(FullFileName)
- if IFList != None:
- return IFList
-
- FileID = GetTableID(FullFileName)
- if FileID < 0:
- return []
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Value
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_INCLUDE)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- IncludeFileListDict[FullFileName] = ResultSet
- return ResultSet
-
-def GetFullPathOfIncludeFile(Str, IncludePathList):
- for IncludePath in IncludePathList:
- FullPath = os.path.join(IncludePath, Str)
- FullPath = os.path.normpath(FullPath)
- if os.path.exists(FullPath):
- return FullPath
- return None
-
-def GetAllIncludeFiles(FullFileName):
- if AllIncludeFileListDict.get(FullFileName) != None:
- return AllIncludeFileListDict.get(FullFileName)
-
- FileDirName = os.path.dirname(FullFileName)
- IncludePathList = IncludePathListDict.get(FileDirName)
- if IncludePathList == None:
- IncludePathList = MetaDataParser.GetIncludeListOfFile(EccGlobalData.gWorkspace, FullFileName, GetDB())
- if FileDirName not in IncludePathList:
- IncludePathList.insert(0, FileDirName)
- IncludePathListDict[FileDirName] = IncludePathList
- IncludeFileQueue = []
- for IncludeFile in GetIncludeFileList(FullFileName):
- FileName = IncludeFile[0].lstrip('#').strip()
- FileName = FileName.lstrip('include').strip()
- FileName = FileName.strip('\"')
- FileName = FileName.lstrip('<').rstrip('>').strip()
- FullPath = GetFullPathOfIncludeFile(FileName, IncludePathList)
- if FullPath != None:
- IncludeFileQueue.append(FullPath)
-
- i = 0
- while i < len(IncludeFileQueue):
- for IncludeFile in GetIncludeFileList(IncludeFileQueue[i]):
- FileName = IncludeFile[0].lstrip('#').strip()
- FileName = FileName.lstrip('include').strip()
- FileName = FileName.strip('\"')
- FileName = FileName.lstrip('<').rstrip('>').strip()
- FullPath = GetFullPathOfIncludeFile(FileName, IncludePathList)
- if FullPath != None and FullPath not in IncludeFileQueue:
- IncludeFileQueue.insert(i + 1, FullPath)
- i += 1
-
- AllIncludeFileListDict[FullFileName] = IncludeFileQueue
- return IncludeFileQueue
-
-def GetPredicateListFromPredicateExpStr(PES):
-
- PredicateList = []
- i = 0
- PredicateBegin = 0
- #PredicateEnd = 0
- LogicOpPos = -1
- p = GetFuncDeclPattern()
- while i < len(PES) - 1:
- if (PES[i].isalnum() or PES[i] == '_' or PES[i] == '*') and LogicOpPos > PredicateBegin:
- PredicateBegin = i
- if (PES[i] == '&' and PES[i + 1] == '&') or (PES[i] == '|' and PES[i + 1] == '|'):
- LogicOpPos = i
- Exp = PES[PredicateBegin:i].strip()
- # Exp may contain '.' or '->'
- TmpExp = Exp.replace('.', '').replace('->', '')
- if p.match(TmpExp):
- PredicateList.append(Exp)
- else:
- PredicateList.append(Exp.rstrip(';').rstrip(')').strip())
- i += 1
-
- if PredicateBegin > LogicOpPos:
- while PredicateBegin < len(PES):
- if PES[PredicateBegin].isalnum() or PES[PredicateBegin] == '_' or PES[PredicateBegin] == '*':
- break
- PredicateBegin += 1
- Exp = PES[PredicateBegin:len(PES)].strip()
- # Exp may contain '.' or '->'
- TmpExp = Exp.replace('.', '').replace('->', '')
- if p.match(TmpExp):
- PredicateList.append(Exp)
- else:
- PredicateList.append(Exp.rstrip(';').rstrip(')').strip())
- return PredicateList
-
-def GetCNameList(Lvalue, StarList=[]):
- Lvalue += ' '
- i = 0
- SearchBegin = 0
- VarStart = -1
- VarEnd = -1
- VarList = []
-
- while SearchBegin < len(Lvalue):
- while i < len(Lvalue):
- if Lvalue[i].isalnum() or Lvalue[i] == '_':
- if VarStart == -1:
- VarStart = i
- VarEnd = i
- i += 1
- elif VarEnd != -1:
- VarList.append(Lvalue[VarStart:VarEnd + 1])
- i += 1
- break
- else:
- if VarStart == -1 and Lvalue[i] == '*':
- StarList.append('*')
- i += 1
- if VarEnd == -1:
- break
-
-
- DotIndex = Lvalue[VarEnd:].find('.')
- ArrowIndex = Lvalue[VarEnd:].find('->')
- if DotIndex == -1 and ArrowIndex == -1:
- break
- elif DotIndex == -1 and ArrowIndex != -1:
- SearchBegin = VarEnd + ArrowIndex
- elif ArrowIndex == -1 and DotIndex != -1:
- SearchBegin = VarEnd + DotIndex
- else:
- SearchBegin = VarEnd + ((DotIndex < ArrowIndex) and DotIndex or ArrowIndex)
-
- i = SearchBegin
- VarStart = -1
- VarEnd = -1
-
- return VarList
-
-def SplitPredicateByOp(Str, Op, IsFuncCalling=False):
-
- Name = Str.strip()
- Value = None
-
- if IsFuncCalling:
- Index = 0
- LBFound = False
- UnmatchedLBCount = 0
- while Index < len(Str):
- while not LBFound and Str[Index] != '_' and not Str[Index].isalnum():
- Index += 1
-
- while not LBFound and (Str[Index].isalnum() or Str[Index] == '_'):
- Index += 1
- # maybe type-cast at the begining, skip it.
- RemainingStr = Str[Index:].lstrip()
- if RemainingStr.startswith(')') and not LBFound:
- Index += 1
- continue
-
- if RemainingStr.startswith('(') and not LBFound:
- LBFound = True
-
- if Str[Index] == '(':
- UnmatchedLBCount += 1
- Index += 1
- continue
-
- if Str[Index] == ')':
- UnmatchedLBCount -= 1
- Index += 1
- if UnmatchedLBCount == 0:
- break
- continue
-
- Index += 1
-
- if UnmatchedLBCount > 0:
- return [Name]
-
- IndexInRemainingStr = Str[Index:].find(Op)
- if IndexInRemainingStr == -1:
- return [Name]
-
- Name = Str[0:Index + IndexInRemainingStr].strip()
- Value = Str[Index + IndexInRemainingStr + len(Op):].strip().strip(')')
- return [Name, Value]
-
- TmpStr = Str.rstrip(';').rstrip(')')
- while True:
- Index = TmpStr.rfind(Op)
- if Index == -1:
- return [Name]
-
- if Str[Index - 1].isalnum() or Str[Index - 1].isspace() or Str[Index - 1] == ')' or Str[Index - 1] == ']':
- Name = Str[0:Index].strip()
- Value = Str[Index + len(Op):].strip()
- return [Name, Value]
-
- TmpStr = Str[0:Index - 1]
-
-def SplitPredicateStr(Str):
-
- Str = Str.lstrip('(')
- IsFuncCalling = False
- p = GetFuncDeclPattern()
- TmpStr = Str.replace('.', '').replace('->', '')
- if p.match(TmpStr):
- IsFuncCalling = True
-
- PredPartList = SplitPredicateByOp(Str, '==', IsFuncCalling)
- if len(PredPartList) > 1:
- return [PredPartList, '==']
-
- PredPartList = SplitPredicateByOp(Str, '!=', IsFuncCalling)
- if len(PredPartList) > 1:
- return [PredPartList, '!=']
-
- PredPartList = SplitPredicateByOp(Str, '>=', IsFuncCalling)
- if len(PredPartList) > 1:
- return [PredPartList, '>=']
-
- PredPartList = SplitPredicateByOp(Str, '<=', IsFuncCalling)
- if len(PredPartList) > 1:
- return [PredPartList, '<=']
-
- PredPartList = SplitPredicateByOp(Str, '>', IsFuncCalling)
- if len(PredPartList) > 1:
- return [PredPartList, '>']
-
- PredPartList = SplitPredicateByOp(Str, '<', IsFuncCalling)
- if len(PredPartList) > 1:
- return [PredPartList, '<']
-
- return [[Str, None], None]
-
-def GetFuncContainsPE(ExpLine, ResultSet):
- for Result in ResultSet:
- if Result[0] < ExpLine and Result[1] > ExpLine:
- return Result
- return None
-
-def PatternInModifier(Modifier, SubStr):
- PartList = Modifier.split()
- for Part in PartList:
- if Part == SubStr:
- return True
- return False
-
-def GetDataTypeFromModifier(ModifierStr):
- MList = ModifierStr.split()
- ReturnType = ''
- for M in MList:
- if M in EccGlobalData.gConfig.ModifierList:
- continue
- # remove array sufix
- if M.startswith('[') or M.endswith(']'):
- continue
- ReturnType += M + ' '
-
- ReturnType = ReturnType.strip()
- if len(ReturnType) == 0:
- ReturnType = 'VOID'
- return ReturnType
-
-def DiffModifier(Str1, Str2):
- PartList1 = Str1.split()
- PartList2 = Str2.split()
- if PartList1 == PartList2:
- return False
- else:
- return True
-
-def GetTypedefDict(FullFileName):
-
- Dict = ComplexTypeDict.get(FullFileName)
- if Dict != None:
- return Dict
-
- FileID = GetTableID(FullFileName)
- FileTable = 'Identifier' + str(FileID)
- Db = GetDB()
- SqlStatement = """ select Modifier, Name, Value, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_TYPEDEF)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- Dict = {}
- for Result in ResultSet:
- if len(Result[0]) == 0:
- Dict[Result[1]] = Result[2]
-
- IncludeFileList = GetAllIncludeFiles(FullFileName)
- for F in IncludeFileList:
- FileID = GetTableID(F)
- if FileID < 0:
- continue
-
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Modifier, Name, Value, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_TYPEDEF)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- for Result in ResultSet:
- if not Result[2].startswith('FP ('):
- Dict[Result[1]] = Result[2]
- else:
- if len(Result[0]) == 0:
- Dict[Result[1]] = 'VOID'
- else:
- Dict[Result[1]] = GetDataTypeFromModifier(Result[0])
-
- ComplexTypeDict[FullFileName] = Dict
- return Dict
-
-def GetSUDict(FullFileName):
-
- Dict = SUDict.get(FullFileName)
- if Dict != None:
- return Dict
-
- FileID = GetTableID(FullFileName)
- FileTable = 'Identifier' + str(FileID)
- Db = GetDB()
- SqlStatement = """ select Name, Value, ID
- from %s
- where Model = %d or Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_STRUCTURE, DataClass.MODEL_IDENTIFIER_UNION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- Dict = {}
- for Result in ResultSet:
- if len(Result[1]) > 0:
- Dict[Result[0]] = Result[1]
-
- IncludeFileList = GetAllIncludeFiles(FullFileName)
- for F in IncludeFileList:
- FileID = GetTableID(F)
- if FileID < 0:
- continue
-
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Name, Value, ID
- from %s
- where Model = %d or Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_STRUCTURE, DataClass.MODEL_IDENTIFIER_UNION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- for Result in ResultSet:
- if len(Result[1]) > 0:
- Dict[Result[0]] = Result[1]
-
- SUDict[FullFileName] = Dict
- return Dict
-
-def StripComments(Str):
- Str += ' '
- ListFromStr = list(Str)
-
- InComment = False
- DoubleSlashComment = False
- Index = 0
- while Index < len(ListFromStr):
- # meet new line, then no longer in a comment for //
- if ListFromStr[Index] == '\n':
- if InComment and DoubleSlashComment:
- InComment = False
- DoubleSlashComment = False
- Index += 1
- # check for */ comment end
- elif InComment and not DoubleSlashComment and ListFromStr[Index] == '*' and ListFromStr[Index + 1] == '/':
- ListFromStr[Index] = ' '
- Index += 1
- ListFromStr[Index] = ' '
- Index += 1
- InComment = False
- # set comments to spaces
- elif InComment:
- ListFromStr[Index] = ' '
- Index += 1
- # check for // comment
- elif ListFromStr[Index] == '/' and ListFromStr[Index + 1] == '/' and ListFromStr[Index + 2] != '\n':
- InComment = True
- DoubleSlashComment = True
-
- # check for /* comment start
- elif ListFromStr[Index] == '/' and ListFromStr[Index + 1] == '*':
- ListFromStr[Index] = ' '
- Index += 1
- ListFromStr[Index] = ' '
- Index += 1
- InComment = True
- else:
- Index += 1
-
- # restore from List to String
- Str = "".join(ListFromStr)
- Str = Str.rstrip(' ')
-
- return Str
-
-def GetFinalTypeValue(Type, FieldName, TypedefDict, SUDict):
- Value = TypedefDict.get(Type)
- if Value == None:
- Value = SUDict.get(Type)
- if Value == None:
- return None
-
- LBPos = Value.find('{')
- while LBPos == -1:
- FTList = Value.split()
- for FT in FTList:
- if FT not in ('struct', 'union'):
- Value = TypedefDict.get(FT)
- if Value == None:
- Value = SUDict.get(FT)
- break
-
- if Value == None:
- return None
-
- LBPos = Value.find('{')
-
-# RBPos = Value.find('}')
- Fields = Value[LBPos + 1:]
- Fields = StripComments(Fields)
- FieldsList = Fields.split(';')
- for Field in FieldsList:
- Field = Field.strip()
- Index = Field.rfind(FieldName)
- if Index < 1:
- continue
- if not Field[Index - 1].isalnum():
- if Index + len(FieldName) == len(Field):
- Type = GetDataTypeFromModifier(Field[0:Index])
- return Type.strip()
- else:
- # For the condition that the field in struct is an array with [] sufixes...
- if not Field[Index + len(FieldName)].isalnum():
- Type = GetDataTypeFromModifier(Field[0:Index])
- return Type.strip()
-
- return None
-
-def GetRealType(Type, TypedefDict, TargetType=None):
- if TargetType != None and Type == TargetType:
- return Type
- while TypedefDict.get(Type):
- Type = TypedefDict.get(Type)
- if TargetType != None and Type == TargetType:
- return Type
- return Type
-
-def GetTypeInfo(RefList, Modifier, FullFileName, TargetType=None):
- TypedefDict = GetTypedefDict(FullFileName)
- SUDict = GetSUDict(FullFileName)
- Type = GetDataTypeFromModifier(Modifier).replace('*', '').strip()
-
- Type = Type.split()[-1]
- Index = 0
- while Index < len(RefList):
- FieldName = RefList[Index]
- FromType = GetFinalTypeValue(Type, FieldName, TypedefDict, SUDict)
- if FromType == None:
- return None
- # we want to determine the exact type.
- if TargetType != None:
- Type = FromType.split()[0]
- # we only want to check if it is a pointer
- else:
- Type = FromType
- if Type.find('*') != -1 and Index == len(RefList) - 1:
- return Type
- Type = FromType.split()[0]
-
- Index += 1
-
- Type = GetRealType(Type, TypedefDict, TargetType)
-
- return Type
-
-def GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall=False, TargetType=None, StarList=None):
-
- PredVar = PredVarList[0]
- FileID = GetTableID(FullFileName)
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- # search variable in include files
-
- # it is a function call, search function declarations and definitions
- if IsFuncCall:
- SqlStatement = """ select Modifier, ID
- from %s
- where Model = %d and Value = \'%s\'
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION, PredVar)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- for Result in ResultSet:
- Type = GetDataTypeFromModifier(Result[0]).split()[-1]
- TypedefDict = GetTypedefDict(FullFileName)
- Type = GetRealType(Type, TypedefDict, TargetType)
- return Type
-
- IncludeFileList = GetAllIncludeFiles(FullFileName)
- for F in IncludeFileList:
- FileID = GetTableID(F)
- if FileID < 0:
- continue
-
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Modifier, ID
- from %s
- where Model = %d and Value = \'%s\'
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION, PredVar)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- for Result in ResultSet:
- Type = GetDataTypeFromModifier(Result[0]).split()[-1]
- TypedefDict = GetTypedefDict(FullFileName)
- Type = GetRealType(Type, TypedefDict, TargetType)
- return Type
-
- FileID = GetTableID(FullFileName)
- SqlStatement = """ select Modifier, ID
- from Function
- where BelongsToFile = %d and Name = \'%s\'
- """ % (FileID, PredVar)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- for Result in ResultSet:
- Type = GetDataTypeFromModifier(Result[0]).split()[-1]
- TypedefDict = GetTypedefDict(FullFileName)
- Type = GetRealType(Type, TypedefDict, TargetType)
- return Type
-
- for F in IncludeFileList:
- FileID = GetTableID(F)
- if FileID < 0:
- continue
-
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Modifier, ID
- from Function
- where BelongsToFile = %d and Name = \'%s\'
- """ % (FileID, PredVar)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- for Result in ResultSet:
- Type = GetDataTypeFromModifier(Result[0]).split()[-1]
- TypedefDict = GetTypedefDict(FullFileName)
- Type = GetRealType(Type, TypedefDict, TargetType)
- return Type
-
- return None
-
- # really variable, search local variable first
- SqlStatement = """ select Modifier, ID
- from %s
- where Model = %d and Name = \'%s\' and StartLine >= %d and StartLine <= %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE, PredVar, FuncRecord[0], FuncRecord[1])
- ResultSet = Db.TblFile.Exec(SqlStatement)
- VarFound = False
- for Result in ResultSet:
- if len(PredVarList) > 1:
- Type = GetTypeInfo(PredVarList[1:], Result[0], FullFileName, TargetType)
- return Type
- else:
-# Type = GetDataTypeFromModifier(Result[0]).split()[-1]
- TypeList = GetDataTypeFromModifier(Result[0]).split()
- Type = TypeList[-1]
- if len(TypeList) > 1 and StarList != None:
- for Star in StarList:
- Type = Type.strip()
- Type = Type.rstrip(Star)
- # Get real type after de-reference pointers.
- if len(Type.strip()) == 0:
- Type = TypeList[-2]
- TypedefDict = GetTypedefDict(FullFileName)
- Type = GetRealType(Type, TypedefDict, TargetType)
- return Type
-
- # search function parameters second
- ParamList = GetParamList(FuncRecord[2])
- for Param in ParamList:
- if Param.Name.strip() == PredVar:
- if len(PredVarList) > 1:
- Type = GetTypeInfo(PredVarList[1:], Param.Modifier, FullFileName, TargetType)
- return Type
- else:
- TypeList = GetDataTypeFromModifier(Param.Modifier).split()
- Type = TypeList[-1]
- if len(TypeList) > 1 and StarList != None:
- for Star in StarList:
- Type = Type.strip()
- Type = Type.rstrip(Star)
- # Get real type after de-reference pointers.
- if len(Type.strip()) == 0:
- Type = TypeList[-2]
- TypedefDict = GetTypedefDict(FullFileName)
- Type = GetRealType(Type, TypedefDict, TargetType)
- return Type
-
- # search global variable next
- SqlStatement = """ select Modifier, ID
- from %s
- where Model = %d and Name = \'%s\' and BelongsToFunction = -1
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE, PredVar)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- for Result in ResultSet:
- if len(PredVarList) > 1:
- Type = GetTypeInfo(PredVarList[1:], Result[0], FullFileName, TargetType)
- return Type
- else:
- TypeList = GetDataTypeFromModifier(Result[0]).split()
- Type = TypeList[-1]
- if len(TypeList) > 1 and StarList != None:
- for Star in StarList:
- Type = Type.strip()
- Type = Type.rstrip(Star)
- # Get real type after de-reference pointers.
- if len(Type.strip()) == 0:
- Type = TypeList[-2]
- TypedefDict = GetTypedefDict(FullFileName)
- Type = GetRealType(Type, TypedefDict, TargetType)
- return Type
-
- IncludeFileList = GetAllIncludeFiles(FullFileName)
- for F in IncludeFileList:
- FileID = GetTableID(F)
- if FileID < 0:
- continue
-
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Modifier, ID
- from %s
- where Model = %d and BelongsToFunction = -1 and Name = \'%s\'
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE, PredVar)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- for Result in ResultSet:
- if len(PredVarList) > 1:
- Type = GetTypeInfo(PredVarList[1:], Result[0], FullFileName, TargetType)
- return Type
- else:
- TypeList = GetDataTypeFromModifier(Result[0]).split()
- Type = TypeList[-1]
- if len(TypeList) > 1 and StarList != None:
- for Star in StarList:
- Type = Type.strip()
- Type = Type.rstrip(Star)
- # Get real type after de-reference pointers.
- if len(Type.strip()) == 0:
- Type = TypeList[-2]
- TypedefDict = GetTypedefDict(FullFileName)
- Type = GetRealType(Type, TypedefDict, TargetType)
- return Type
-
-def GetTypeFromArray(Type, Var):
- Count = Var.count('[')
-
- while Count > 0:
- Type = Type.strip()
- Type = Type.rstrip('*')
- Count = Count - 1
-
- return Type
-
-def CheckFuncLayoutReturnType(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Modifier, ID, StartLine, StartColumn, EndLine, Value
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- ReturnType = GetDataTypeFromModifier(Result[0])
- TypeStart = ReturnType.split()[0]
- FuncName = Result[5]
- if EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, FuncName):
- continue
- Index = Result[0].find(TypeStart)
- if Index != 0 or Result[3] != 0:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, '[%s] Return Type should appear at the start of line' % FuncName, FileTable, Result[1])
-
- if Result[2] == Result[4]:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, '[%s] Return Type should appear on its own line' % FuncName, FileTable, Result[1])
-
- SqlStatement = """ select Modifier, ID, StartLine, StartColumn, FunNameStartLine, Name
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- ReturnType = GetDataTypeFromModifier(Result[0])
- TypeStart = ReturnType.split()[0]
- FuncName = Result[5]
- if EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, FuncName):
- continue
- Index = Result[0].find(ReturnType)
- if Index != 0 or Result[3] != 0:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, '[%s] Return Type should appear at the start of line' % FuncName, 'Function', Result[1])
-
- if Result[2] == Result[4]:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, '[%s] Return Type should appear on its own line' % FuncName, 'Function', Result[1])
-
-def CheckFuncLayoutModifier(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Modifier, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- ReturnType = GetDataTypeFromModifier(Result[0])
- TypeStart = ReturnType.split()[0]
-# if len(ReturnType) == 0:
-# continue
- Index = Result[0].find(TypeStart)
- if Index != 0:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONAL_MODIFIER, '', FileTable, Result[1])
-
- SqlStatement = """ select Modifier, ID
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- ReturnType = GetDataTypeFromModifier(Result[0])
- TypeStart = ReturnType.split()[0]
-# if len(ReturnType) == 0:
-# continue
- Index = Result[0].find(TypeStart)
- if Index != 0:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONAL_MODIFIER, '', 'Function', Result[1])
-
-def CheckFuncLayoutName(FullFileName):
- ErrorMsgList = []
- # Parameter variable format pattern.
- Pattern = re.compile(r'^[A-Z]+\S*[a-z]\S*$')
- ParamIgnoreList = ('VOID', '...')
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Name, ID, EndColumn, Value
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- FuncName = Result[3]
- if EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, FuncName):
- continue
- if Result[2] != 0:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, 'Function name [%s] should appear at the start of a line' % FuncName, FileTable, Result[1])
- ParamList = GetParamList(Result[0])
- if len(ParamList) == 0:
- continue
- StartLine = 0
- for Param in ParamList:
- if Param.StartLine <= StartLine:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, 'Parameter %s should be in its own line.' % Param.Name, FileTable, Result[1])
- if Param.StartLine - StartLine > 1:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, 'Empty line appears before Parameter %s.' % Param.Name, FileTable, Result[1])
- if not Pattern.match(Param.Name) and not Param.Name in ParamIgnoreList and not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Param.Name):
- PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Parameter [%s] NOT follow naming convention.' % Param.Name, FileTable, Result[1])
- StartLine = Param.StartLine
-
- if not Result[0].endswith('\n )') and not Result[0].endswith('\r )'):
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, '\')\' should be on a new line and indented two spaces', FileTable, Result[1])
-
- SqlStatement = """ select Modifier, ID, FunNameStartColumn, Name
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- FuncName = Result[3]
- if EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, FuncName):
- continue
- if Result[2] != 0:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, 'Function name [%s] should appear at the start of a line' % FuncName, 'Function', Result[1])
- ParamList = GetParamList(Result[0])
- if len(ParamList) == 0:
- continue
- StartLine = 0
- for Param in ParamList:
- if Param.StartLine <= StartLine:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, 'Parameter %s should be in its own line.' % Param.Name, 'Function', Result[1])
- if Param.StartLine - StartLine > 1:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, 'Empty line appears before Parameter %s.' % Param.Name, 'Function', Result[1])
- if not Pattern.match(Param.Name) and not Param.Name in ParamIgnoreList and not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Param.Name):
- PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Parameter [%s] NOT follow naming convention.' % Param.Name, FileTable, Result[1])
- StartLine = Param.StartLine
- if not Result[0].endswith('\n )') and not Result[0].endswith('\r )'):
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, '\')\' should be on a new line and indented two spaces', 'Function', Result[1])
-
-def CheckFuncLayoutPrototype(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- FileTable = 'Identifier' + str(FileID)
- Db = GetDB()
- SqlStatement = """ select Modifier, Header, Name, ID
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- if len(ResultSet) == 0:
- return ErrorMsgList
-
- FuncDefList = []
- for Result in ResultSet:
- FuncDefList.append(Result)
-
- SqlStatement = """ select Modifier, Name, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- FuncDeclList = []
- for Result in ResultSet:
- FuncDeclList.append(Result)
-
- UndeclFuncList = []
- for FuncDef in FuncDefList:
- FuncName = FuncDef[2].strip()
- FuncModifier = FuncDef[0]
- FuncDefHeader = FuncDef[1]
- for FuncDecl in FuncDeclList:
- LBPos = FuncDecl[1].find('(')
- DeclName = FuncDecl[1][0:LBPos].strip()
- DeclModifier = FuncDecl[0]
- if DeclName == FuncName:
- if DiffModifier(FuncModifier, DeclModifier) and not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE, FuncName):
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE, 'Function [%s] modifier different with prototype.' % FuncName, 'Function', FuncDef[3])
- ParamListOfDef = GetParamList(FuncDefHeader)
- ParamListOfDecl = GetParamList(FuncDecl[1])
- if len(ParamListOfDef) != len(ParamListOfDecl) and not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_2, FuncName):
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_2, 'Parameter number different in function [%s].' % FuncName, 'Function', FuncDef[3])
- break
-
- Index = 0
- while Index < len(ParamListOfDef):
- if DiffModifier(ParamListOfDef[Index].Modifier, ParamListOfDecl[Index].Modifier) and not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_3, FuncName):
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_3, 'Parameter %s has different modifier with prototype in function [%s].' % (ParamListOfDef[Index].Name, FuncName), 'Function', FuncDef[3])
- Index += 1
- break
- else:
- UndeclFuncList.append(FuncDef)
-
- IncludeFileList = GetAllIncludeFiles(FullFileName)
- FuncDeclList = []
- for F in IncludeFileList:
- FileID = GetTableID(F, ErrorMsgList)
- if FileID < 0:
- continue
-
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Modifier, Name, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
-
- for Result in ResultSet:
- FuncDeclList.append(Result)
-
- for FuncDef in UndeclFuncList:
- FuncName = FuncDef[2].strip()
- FuncModifier = FuncDef[0]
- FuncDefHeader = FuncDef[1]
- for FuncDecl in FuncDeclList:
- LBPos = FuncDecl[1].find('(')
- DeclName = FuncDecl[1][0:LBPos].strip()
- DeclModifier = FuncDecl[0]
- if DeclName == FuncName:
- if DiffModifier(FuncModifier, DeclModifier) and not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE, FuncName):
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE, 'Function [%s] modifier different with prototype.' % FuncName, 'Function', FuncDef[3])
- ParamListOfDef = GetParamList(FuncDefHeader)
- ParamListOfDecl = GetParamList(FuncDecl[1])
- if len(ParamListOfDef) != len(ParamListOfDecl) and not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_2, FuncName):
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_2, 'Parameter number different in function [%s].' % FuncName, 'Function', FuncDef[3])
- break
-
- Index = 0
- while Index < len(ParamListOfDef):
- if DiffModifier(ParamListOfDef[Index].Modifier, ParamListOfDecl[Index].Modifier) and not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_3, FuncName):
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_3, 'Parameter %s has different modifier with prototype in function [%s].' % (ParamListOfDef[Index].Name, FuncName), 'Function', FuncDef[3])
- Index += 1
- break
-
-def CheckFuncLayoutBody(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- FileTable = 'Identifier' + str(FileID)
- Db = GetDB()
- SqlStatement = """ select BodyStartColumn, EndColumn, ID
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- if len(ResultSet) == 0:
- return ErrorMsgList
- for Result in ResultSet:
- if Result[0] != 0:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY, 'open brace should be at the very beginning of a line.', 'Function', Result[2])
- if Result[1] != 0:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY, 'close brace should be at the very beginning of a line.', 'Function', Result[2])
-
-def CheckFuncLayoutLocalVariable(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select ID
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- if len(ResultSet) == 0:
- return ErrorMsgList
- FL = []
- for Result in ResultSet:
- FL.append(Result)
-
- for F in FL:
- SqlStatement = """ select Name, Value, ID, Modifier
- from %s
- where Model = %d and BelongsToFunction = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE, F[0])
- ResultSet = Db.TblFile.Exec(SqlStatement)
- if len(ResultSet) == 0:
- continue
-
- for Result in ResultSet:
- if len(Result[1]) > 0 and 'CONST' not in Result[3]:
- PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VARIABLE, 'Variable Name: %s' % Result[0], FileTable, Result[2])
-
-def CheckMemberVariableFormat(Name, Value, FileTable, TdId, ModelId):
- ErrMsgList = []
- # Member variable format pattern.
- Pattern = re.compile(r'^[A-Z]+\S*[a-z]\S*$')
-
- LBPos = Value.find('{')
- RBPos = Value.rfind('}')
- if LBPos == -1 or RBPos == -1:
- return ErrMsgList
-
- Fields = Value[LBPos + 1 : RBPos]
- Fields = StripComments(Fields).strip()
- NestPos = Fields.find ('struct')
- if NestPos != -1 and (NestPos + len('struct') < len(Fields)):
- if not Fields[NestPos + len('struct') + 1].isalnum():
- if not EccGlobalData.gException.IsException(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE, Name):
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE, 'Nested struct in [%s].' % (Name), FileTable, TdId)
- return ErrMsgList
- NestPos = Fields.find ('union')
- if NestPos != -1 and (NestPos + len('union') < len(Fields)):
- if not Fields[NestPos + len('union') + 1].isalnum():
- if not EccGlobalData.gException.IsException(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE, Name):
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE, 'Nested union in [%s].' % (Name), FileTable, TdId)
- return ErrMsgList
- NestPos = Fields.find ('enum')
- if NestPos != -1 and (NestPos + len('enum') < len(Fields)):
- if not Fields[NestPos + len('enum') + 1].isalnum():
- if not EccGlobalData.gException.IsException(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE, Name):
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE, 'Nested enum in [%s].' % (Name), FileTable, TdId)
- return ErrMsgList
-
- if ModelId == DataClass.MODEL_IDENTIFIER_ENUMERATE:
- FieldsList = Fields.split(',')
- # deal with enum is pre-assigned a value by function call ( , , , ...)
- QuoteCount = 0
- Index = 0
- RemoveCurrentElement = False
- while Index < len(FieldsList):
- Field = FieldsList[Index]
-
- if Field.find('(') != -1:
- QuoteCount += 1
- RemoveCurrentElement = True
- Index += 1
- continue
-
- if Field.find(')') != -1 and QuoteCount > 0:
- QuoteCount -= 1
-
- if RemoveCurrentElement:
- FieldsList.remove(Field)
- if QuoteCount == 0:
- RemoveCurrentElement = False
- continue
-
- if QuoteCount == 0:
- RemoveCurrentElement = False
-
- Index += 1
- else:
- FieldsList = Fields.split(';')
-
- for Field in FieldsList:
- Field = Field.strip()
- if Field == '':
- continue
- # For the condition that the field in struct is an array with [] sufixes...
- if Field[-1] == ']':
- LBPos = Field.find('[')
- Field = Field[0:LBPos]
- # For the condition that bit field ": Number"
- if Field.find(':') != -1:
- ColonPos = Field.find(':')
- Field = Field[0:ColonPos]
-
- Field = Field.strip()
- if Field == '':
- continue
- # Enum could directly assign value to variable
- Field = Field.split('=')[0].strip()
- TokenList = Field.split()
- # Remove pointers before variable
- if not Pattern.match(TokenList[-1].lstrip('*')):
- ErrMsgList.append(TokenList[-1].lstrip('*'))
-
- return ErrMsgList
-
-def CheckDeclTypedefFormat(FullFileName, ModelId):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Name, StartLine, EndLine, ID, Value
- from %s
- where Model = %d
- """ % (FileTable, ModelId)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- ResultList = []
- for Result in ResultSet:
- ResultList.append(Result)
-
- ErrorType = ERROR_DECLARATION_DATA_TYPE_CHECK_ALL
- if ModelId == DataClass.MODEL_IDENTIFIER_STRUCTURE:
- ErrorType = ERROR_DECLARATION_DATA_TYPE_CHECK_STRUCTURE_DECLARATION
- elif ModelId == DataClass.MODEL_IDENTIFIER_ENUMERATE:
- ErrorType = ERROR_DECLARATION_DATA_TYPE_CHECK_ENUMERATED_TYPE
- elif ModelId == DataClass.MODEL_IDENTIFIER_UNION:
- ErrorType = ERROR_DECLARATION_DATA_TYPE_CHECK_UNION_TYPE
-
- SqlStatement = """ select Modifier, Name, Value, StartLine, EndLine, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_TYPEDEF)
- TdSet = Db.TblFile.Exec(SqlStatement)
- TdList = []
- for Td in TdSet:
- TdList.append(Td)
- # Check member variable name format that from typedefs of ONLY this file.
- for Td in TdList:
- Name = Td[1].strip()
- Value = Td[2].strip()
- if Value.startswith('enum'):
- ValueModelId = DataClass.MODEL_IDENTIFIER_ENUMERATE
- elif Value.startswith('struct'):
- ValueModelId = DataClass.MODEL_IDENTIFIER_STRUCTURE
- elif Value.startswith('union'):
- ValueModelId = DataClass.MODEL_IDENTIFIER_UNION
- else:
- continue
-
- if ValueModelId != ModelId:
- continue
- # Check member variable format.
- ErrMsgList = CheckMemberVariableFormat(Name, Value, FileTable, Td[5], ModelId)
- for ErrMsg in ErrMsgList:
- if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Name + '.' + ErrMsg):
- continue
- PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Member variable [%s] NOT follow naming convention.' % (Name + '.' + ErrMsg), FileTable, Td[5])
-
- # First check in current file to see whether struct/union/enum is typedef-ed.
- UntypedefedList = []
- for Result in ResultList:
- # Check member variable format.
- Name = Result[0].strip()
- Value = Result[4].strip()
- if Value.startswith('enum'):
- ValueModelId = DataClass.MODEL_IDENTIFIER_ENUMERATE
- elif Value.startswith('struct'):
- ValueModelId = DataClass.MODEL_IDENTIFIER_STRUCTURE
- elif Value.startswith('union'):
- ValueModelId = DataClass.MODEL_IDENTIFIER_UNION
- else:
- continue
-
- if ValueModelId != ModelId:
- continue
- ErrMsgList = CheckMemberVariableFormat(Name, Value, FileTable, Result[3], ModelId)
- for ErrMsg in ErrMsgList:
- if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Result[0] + '.' + ErrMsg):
- continue
- PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Member variable [%s] NOT follow naming convention.' % (Result[0] + '.' + ErrMsg), FileTable, Result[3])
- # Check whether it is typedefed.
- Found = False
- for Td in TdList:
- # skip function pointer
- if len(Td[0]) > 0:
- continue
- if Result[1] >= Td[3] and Td[4] >= Result[2]:
- Found = True
- if not Td[1].isupper():
- PrintErrorMsg(ErrorType, 'Typedef should be UPPER case', FileTable, Td[5])
- if Result[0] in Td[2].split():
- Found = True
- if not Td[1].isupper():
- PrintErrorMsg(ErrorType, 'Typedef should be UPPER case', FileTable, Td[5])
- if Found:
- break
-
- if not Found:
- UntypedefedList.append(Result)
- continue
-
- if len(UntypedefedList) == 0:
- return
-
- IncludeFileList = GetAllIncludeFiles(FullFileName)
- TdList = []
- for F in IncludeFileList:
- FileID = GetTableID(F, ErrorMsgList)
- if FileID < 0:
- continue
-
- IncludeFileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Modifier, Name, Value, StartLine, EndLine, ID
- from %s
- where Model = %d
- """ % (IncludeFileTable, DataClass.MODEL_IDENTIFIER_TYPEDEF)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- TdList.extend(ResultSet)
-
- for Result in UntypedefedList:
-
- # Check whether it is typedefed.
- Found = False
- for Td in TdList:
-
- if len(Td[0]) > 0:
- continue
- if Result[1] >= Td[3] and Td[4] >= Result[2]:
- Found = True
- if not Td[1].isupper():
- PrintErrorMsg(ErrorType, 'Typedef should be UPPER case', FileTable, Td[5])
- if Result[0] in Td[2].split():
- Found = True
- if not Td[1].isupper():
- PrintErrorMsg(ErrorType, 'Typedef should be UPPER case', FileTable, Td[5])
- if Found:
- break
-
- if not Found:
- PrintErrorMsg(ErrorType, 'No Typedef for %s' % Result[0], FileTable, Result[3])
- continue
-
-def CheckDeclStructTypedef(FullFileName):
- CheckDeclTypedefFormat(FullFileName, DataClass.MODEL_IDENTIFIER_STRUCTURE)
-
-def CheckDeclEnumTypedef(FullFileName):
- CheckDeclTypedefFormat(FullFileName, DataClass.MODEL_IDENTIFIER_ENUMERATE)
-
-def CheckDeclUnionTypedef(FullFileName):
- CheckDeclTypedefFormat(FullFileName, DataClass.MODEL_IDENTIFIER_UNION)
-
-def CheckDeclArgModifier(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Modifier, Name, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- ModifierTuple = ('IN', 'OUT', 'OPTIONAL', 'UNALIGNED')
- MAX_MODIFIER_LENGTH = 100
- for Result in ResultSet:
- for Modifier in ModifierTuple:
- if PatternInModifier(Result[0], Modifier) and len(Result[0]) < MAX_MODIFIER_LENGTH:
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MODIFIER, 'Variable Modifier %s' % Result[0], FileTable, Result[2])
- break
-
- SqlStatement = """ select Modifier, Name, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- for Modifier in ModifierTuple:
- if PatternInModifier(Result[0], Modifier):
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MODIFIER, 'Return Type Modifier %s' % Result[0], FileTable, Result[2])
- break
-
- SqlStatement = """ select Modifier, Header, ID
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- for Modifier in ModifierTuple:
- if PatternInModifier(Result[0], Modifier):
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MODIFIER, 'Return Type Modifier %s' % Result[0], FileTable, Result[2])
- break
-
-def CheckDeclNoUseCType(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Modifier, Name, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- CTypeTuple = ('int', 'unsigned', 'char', 'void', 'static', 'long')
- for Result in ResultSet:
- for Type in CTypeTuple:
- if PatternInModifier(Result[0], Type):
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE, 'Variable type %s' % Type, FileTable, Result[2])
- break
-
- SqlStatement = """ select Modifier, Name, ID, Value
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- ParamList = GetParamList(Result[1])
- FuncName = Result[3]
- if EccGlobalData.gException.IsException(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE, FuncName):
- continue
- for Type in CTypeTuple:
- if PatternInModifier(Result[0], Type):
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE, '%s Return type %s' % (FuncName, Result[0]), FileTable, Result[2])
-
- for Param in ParamList:
- if PatternInModifier(Param.Modifier, Type):
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE, 'Parameter %s' % Param.Name, FileTable, Result[2])
-
- SqlStatement = """ select Modifier, Header, ID, Name
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- ParamList = GetParamList(Result[1])
- FuncName = Result[3]
- if EccGlobalData.gException.IsException(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE, FuncName):
- continue
- for Type in CTypeTuple:
- if PatternInModifier(Result[0], Type):
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE, '[%s] Return type %s' % (FuncName, Result[0]), FileTable, Result[2])
-
- for Param in ParamList:
- if PatternInModifier(Param.Modifier, Type):
- PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE, 'Parameter %s' % Param.Name, FileTable, Result[2])
-
-
-def CheckPointerNullComparison(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- # cache the found function return type to accelerate later checking in this file.
- FuncReturnTypeDict = {}
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Value, StartLine, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_PREDICATE_EXPRESSION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- if len(ResultSet) == 0:
- return
- PSL = []
- for Result in ResultSet:
- PSL.append([Result[0], Result[1], Result[2]])
-
- SqlStatement = """ select BodyStartLine, EndLine, Header, Modifier, ID
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- FL = []
- for Result in ResultSet:
- FL.append([Result[0], Result[1], Result[2], Result[3], Result[4]])
-
- p = GetFuncDeclPattern()
- for Str in PSL:
- FuncRecord = GetFuncContainsPE(Str[1], FL)
- if FuncRecord == None:
- continue
-
- for Exp in GetPredicateListFromPredicateExpStr(Str[0]):
- PredInfo = SplitPredicateStr(Exp)
- if PredInfo[1] == None:
- PredVarStr = PredInfo[0][0].strip()
- IsFuncCall = False
- SearchInCache = False
- # PredVarStr may contain '.' or '->'
- TmpStr = PredVarStr.replace('.', '').replace('->', '')
- if p.match(TmpStr):
- PredVarStr = PredVarStr[0:PredVarStr.find('(')]
- SearchInCache = True
- # Only direct function call using IsFuncCall branch. Multi-level ref. function call is considered a variable.
- if TmpStr.startswith(PredVarStr):
- IsFuncCall = True
-
- if PredVarStr.strip() in IgnoredKeywordList:
- continue
- StarList = []
- PredVarList = GetCNameList(PredVarStr, StarList)
- # No variable found, maybe value first? like (0 == VarName)
- if len(PredVarList) == 0:
- continue
- if SearchInCache:
- Type = FuncReturnTypeDict.get(PredVarStr)
- if Type != None:
- if Type.find('*') != -1 and Type != 'BOOLEAN*':
- PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_COMPARISON_NULL_TYPE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])
- continue
-
- if PredVarStr in FuncReturnTypeDict:
- continue
-
- Type = GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall, None, StarList)
- if SearchInCache:
- FuncReturnTypeDict[PredVarStr] = Type
- if Type == None:
- continue
- Type = GetTypeFromArray(Type, PredVarStr)
- if Type.find('*') != -1 and Type != 'BOOLEAN*':
- PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_COMPARISON_NULL_TYPE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])
-
-def CheckNonBooleanValueComparison(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- # cache the found function return type to accelerate later checking in this file.
- FuncReturnTypeDict = {}
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Value, StartLine, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_PREDICATE_EXPRESSION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- if len(ResultSet) == 0:
- return
- PSL = []
- for Result in ResultSet:
- PSL.append([Result[0], Result[1], Result[2]])
-
- SqlStatement = """ select BodyStartLine, EndLine, Header, Modifier, ID
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- FL = []
- for Result in ResultSet:
- FL.append([Result[0], Result[1], Result[2], Result[3], Result[4]])
-
- p = GetFuncDeclPattern()
- for Str in PSL:
- FuncRecord = GetFuncContainsPE(Str[1], FL)
- if FuncRecord == None:
- continue
-
- for Exp in GetPredicateListFromPredicateExpStr(Str[0]):
- PredInfo = SplitPredicateStr(Exp)
- if PredInfo[1] == None:
- PredVarStr = PredInfo[0][0].strip()
- IsFuncCall = False
- SearchInCache = False
- # PredVarStr may contain '.' or '->'
- TmpStr = PredVarStr.replace('.', '').replace('->', '')
- if p.match(TmpStr):
- PredVarStr = PredVarStr[0:PredVarStr.find('(')]
- SearchInCache = True
- # Only direct function call using IsFuncCall branch. Multi-level ref. function call is considered a variable.
- if TmpStr.startswith(PredVarStr):
- IsFuncCall = True
-
- if PredVarStr.strip() in IgnoredKeywordList:
- continue
- StarList = []
- PredVarList = GetCNameList(PredVarStr, StarList)
- # No variable found, maybe value first? like (0 == VarName)
- if len(PredVarList) == 0:
- continue
-
- if SearchInCache:
- Type = FuncReturnTypeDict.get(PredVarStr)
- if Type != None:
- if Type.find('BOOLEAN') == -1:
- PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_NO_BOOLEAN_OPERATOR, 'Predicate Expression: %s' % Exp, FileTable, Str[2])
- continue
-
- if PredVarStr in FuncReturnTypeDict:
- continue
- Type = GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall, 'BOOLEAN', StarList)
- if SearchInCache:
- FuncReturnTypeDict[PredVarStr] = Type
- if Type == None:
- continue
- if Type.find('BOOLEAN') == -1:
- PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_NO_BOOLEAN_OPERATOR, 'Predicate Expression: %s' % Exp, FileTable, Str[2])
-
-
-def CheckBooleanValueComparison(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- # cache the found function return type to accelerate later checking in this file.
- FuncReturnTypeDict = {}
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Value, StartLine, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_PREDICATE_EXPRESSION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- if len(ResultSet) == 0:
- return
- PSL = []
- for Result in ResultSet:
- PSL.append([Result[0], Result[1], Result[2]])
-
- SqlStatement = """ select BodyStartLine, EndLine, Header, Modifier, ID
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- FL = []
- for Result in ResultSet:
- FL.append([Result[0], Result[1], Result[2], Result[3], Result[4]])
-
- p = GetFuncDeclPattern()
- for Str in PSL:
- FuncRecord = GetFuncContainsPE(Str[1], FL)
- if FuncRecord == None:
- continue
-
- for Exp in GetPredicateListFromPredicateExpStr(Str[0]):
- PredInfo = SplitPredicateStr(Exp)
- if PredInfo[1] in ('==', '!=') and PredInfo[0][1] in ('TRUE', 'FALSE'):
- PredVarStr = PredInfo[0][0].strip()
- IsFuncCall = False
- SearchInCache = False
- # PredVarStr may contain '.' or '->'
- TmpStr = PredVarStr.replace('.', '').replace('->', '')
- if p.match(TmpStr):
- PredVarStr = PredVarStr[0:PredVarStr.find('(')]
- SearchInCache = True
- # Only direct function call using IsFuncCall branch. Multi-level ref. function call is considered a variable.
- if TmpStr.startswith(PredVarStr):
- IsFuncCall = True
-
- if PredVarStr.strip() in IgnoredKeywordList:
- continue
- StarList = []
- PredVarList = GetCNameList(PredVarStr, StarList)
- # No variable found, maybe value first? like (0 == VarName)
- if len(PredVarList) == 0:
- continue
-
- if SearchInCache:
- Type = FuncReturnTypeDict.get(PredVarStr)
- if Type != None:
- if Type.find('BOOLEAN') != -1:
- PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_BOOLEAN_VALUE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])
- continue
-
- if PredVarStr in FuncReturnTypeDict:
- continue
-
- Type = GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall, 'BOOLEAN', StarList)
- if SearchInCache:
- FuncReturnTypeDict[PredVarStr] = Type
- if Type == None:
- continue
- if Type.find('BOOLEAN') != -1:
- PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_BOOLEAN_VALUE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])
-
-
-def CheckHeaderFileData(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select ID, Modifier
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_VARIABLE)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- if not Result[1].startswith('extern'):
- PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_DATA, 'Variable definition appears in header file', FileTable, Result[0])
-
- SqlStatement = """ select ID
- from Function
- where BelongsToFile = %d
- """ % FileID
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_DATA, 'Function definition appears in header file', 'Function', Result[0])
-
- return ErrorMsgList
-
-def CheckHeaderFileIfndef(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Value, StartLine
- from %s
- where Model = %d order by StartLine
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_MACRO_IFNDEF)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- if len(ResultSet) == 0:
- PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_1, '', 'File', FileID)
- return ErrorMsgList
- for Result in ResultSet:
- SqlStatement = """ select Value, EndLine
- from %s
- where EndLine < %d
- """ % (FileTable, Result[1])
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- if not Result[0].startswith('/*') and not Result[0].startswith('//'):
- PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_2, '', 'File', FileID)
- break
-
- SqlStatement = """ select Value
- from %s
- where StartLine > (select max(EndLine) from %s where Model = %d)
- """ % (FileTable, FileTable, DataClass.MODEL_IDENTIFIER_MACRO_ENDIF)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- if not Result[0].startswith('/*') and not Result[0].startswith('//'):
- PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_3, '', 'File', FileID)
- return ErrorMsgList
-
-def CheckDoxygenCommand(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Value, ID
- from %s
- where Model = %d or Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_COMMENT, DataClass.MODEL_IDENTIFIER_FUNCTION_HEADER)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- DoxygenCommandList = ['bug', 'todo', 'example', 'file', 'attention', 'param', 'post', 'pre', 'retval', 'return', 'sa', 'since', 'test', 'note', 'par']
- for Result in ResultSet:
- CommentStr = Result[0]
- CommentPartList = CommentStr.split()
- for Part in CommentPartList:
- if Part.upper() == 'BUGBUG':
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'Bug should be marked with doxygen tag @bug', FileTable, Result[1])
- if Part.upper() == 'TODO':
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'ToDo should be marked with doxygen tag @todo', FileTable, Result[1])
- if Part.startswith('@'):
- if EccGlobalData.gException.IsException(ERROR_DOXYGEN_CHECK_COMMAND, Part):
- continue
- if Part.lstrip('@').isalpha():
- if Part.lstrip('@') not in DoxygenCommandList:
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'Unknown doxygen command %s' % Part, FileTable, Result[1])
- else:
- Index = Part.find('[')
- if Index == -1:
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'Unknown doxygen command %s' % Part, FileTable, Result[1])
- RealCmd = Part[1:Index]
- if RealCmd not in DoxygenCommandList:
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'Unknown doxygen command %s' % Part, FileTable, Result[1])
-
-
-def CheckDoxygenTripleForwardSlash(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
-
- SqlStatement = """ select ID, BodyStartLine, BodyStartColumn, EndLine, EndColumn
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- if len(ResultSet) == 0:
- return
-
- FuncDefSet = []
- for Result in ResultSet:
- FuncDefSet.append(Result)
-
-
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Value, ID, StartLine, StartColumn, EndLine, EndColumn
- from %s
- where Model = %d
-
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_COMMENT)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- CommentSet = []
- try:
- for Result in ResultSet:
- CommentSet.append(Result)
- except:
- print 'Unrecognized chars in comment of file %s', FullFileName
-
-
- for Result in CommentSet:
- CommentStr = Result[0]
- StartLine = Result[2]
- StartColumn = Result[3]
- EndLine = Result[4]
- EndColumn = Result[5]
- if not CommentStr.startswith('///<'):
- continue
-
- Found = False
- for FuncDef in FuncDefSet:
- if StartLine == FuncDef[1] and StartColumn > FuncDef[2] and EndLine == FuncDef[3] and EndColumn < FuncDef[4]:
- Found = True
- break
- if StartLine > FuncDef[1] and EndLine < FuncDef[3]:
- Found = True
- break
- if StartLine == FuncDef[1] and StartColumn > FuncDef[2] and EndLine < FuncDef[3]:
- Found = True
- break
- if StartLine > FuncDef[1] and EndLine == FuncDef[3] and EndColumn < FuncDef[4]:
- Found = True
- break
- if Found:
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMENT_FORMAT, '', FileTable, Result[1])
-
-
-def CheckFileHeaderDoxygenComments(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Value, ID
- from %s
- where Model = %d and (StartLine = 1 or StartLine = 7 or StartLine = 8) and StartColumn = 0
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_COMMENT)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- if len(ResultSet) == 0:
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'No File License header appear at the very beginning of file.', 'File', FileID)
- return ErrorMsgList
-
- NoHeaderCommentStartFlag = True
- NoHeaderCommentEndFlag = True
- NoHeaderCommentPeriodFlag = True
- NoCopyrightFlag = True
- NoLicenseFlag = True
- NoRevReferFlag = True
- NextLineIndex = 0
- for Result in ResultSet:
- FileStartFlag = False
- CommentStrList = []
- CommentStr = Result[0].strip()
- CommentStrListTemp = CommentStr.split('\n')
- if (len(CommentStrListTemp) <= 1):
- # For Mac
- CommentStrListTemp = CommentStr.split('\r')
- # Skip the content before the file header
- for CommentLine in CommentStrListTemp:
- if CommentLine.strip().startswith('/** @file'):
- FileStartFlag = True
- if FileStartFlag == True:
- CommentStrList.append(CommentLine)
-
- ID = Result[1]
- Index = 0
- if CommentStrList and CommentStrList[0].strip().startswith('/** @file'):
- NoHeaderCommentStartFlag = False
- else:
- continue
- if CommentStrList and CommentStrList[-1].strip().endswith('**/'):
- NoHeaderCommentEndFlag = False
- else:
- continue
-
- for CommentLine in CommentStrList:
- Index = Index + 1
- NextLineIndex = Index
- if CommentLine.startswith('/** @file'):
- continue
- if CommentLine.startswith('**/'):
- break
- # Check whether C File header Comment content start with two spaces.
- if EccGlobalData.gConfig.HeaderCheckCFileCommentStartSpacesNum == '1' or EccGlobalData.gConfig.HeaderCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- if CommentLine.startswith('/** @file') == False and CommentLine.startswith('**/') == False and CommentLine.strip() and CommentLine.startswith(' ') == False:
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment content should start with two spaces at each line', FileTable, ID)
-
- CommentLine = CommentLine.strip()
- if CommentLine.startswith('Copyright'):
- NoCopyrightFlag = False
- if CommentLine.find('All rights reserved') == -1:
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, '""All rights reserved"" announcement should be following the ""Copyright"" at the same line', FileTable, ID)
- if CommentLine.endswith('<BR>') == -1:
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'The ""<BR>"" at the end of the Copyright line is required', FileTable, ID)
- if NextLineIndex < len(CommentStrList) and CommentStrList[NextLineIndex].strip().startswith('Copyright') == False and CommentStrList[NextLineIndex].strip():
- NoLicenseFlag = False
- if CommentLine.startswith('@par Revision Reference:'):
- NoRevReferFlag = False
- RefListFlag = False
- for RefLine in CommentStrList[NextLineIndex:]:
- if RefLine.strip() and (NextLineIndex + 1) < len(CommentStrList) and CommentStrList[NextLineIndex+1].strip() and CommentStrList[NextLineIndex+1].strip().startswith('**/') == False:
- RefListFlag = True
- if RefLine.strip() == False or RefLine.strip().startswith('**/'):
- RefListFlag = False
- break
- # Check whether C File header Comment's each reference at list should begin with a bullet character.
- if EccGlobalData.gConfig.HeaderCheckCFileCommentReferenceFormat == '1' or EccGlobalData.gConfig.HeaderCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- if RefListFlag == True:
- if RefLine.strip() and RefLine.strip().startswith('**/') == False and RefLine.startswith(' -') == False:
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'Each reference on a separate line should begin with a bullet character ""-"" ', FileTable, ID)
-
- if NoHeaderCommentStartFlag:
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FILE_HEADER, 'File header comment should begin with ""/** @file""', FileTable, ID)
- return
- if NoHeaderCommentEndFlag:
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment should end with ""**/""', FileTable, ID)
- return
- if NoCopyrightFlag:
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment missing the ""Copyright""', FileTable, ID)
- #Check whether C File header Comment have the License immediately after the ""Copyright"" line.
- if EccGlobalData.gConfig.HeaderCheckCFileCommentLicenseFormat == '1' or EccGlobalData.gConfig.HeaderCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
- if NoLicenseFlag:
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment should have the License immediately after the ""Copyright"" line', FileTable, ID)
-
-def CheckFuncHeaderDoxygenComments(FullFileName):
- ErrorMsgList = []
-
- FileID = GetTableID(FullFileName, ErrorMsgList)
- if FileID < 0:
- return ErrorMsgList
-
- Db = GetDB()
- FileTable = 'Identifier' + str(FileID)
- SqlStatement = """ select Value, StartLine, EndLine, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_COMMENT)
-
- ResultSet = Db.TblFile.Exec(SqlStatement)
- CommentSet = []
- try:
- for Result in ResultSet:
- CommentSet.append(Result)
- except:
- print 'Unrecognized chars in comment of file %s', FullFileName
-
- # Func Decl check
- SqlStatement = """ select Modifier, Name, StartLine, ID, Value
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- FuncName = Result[4]
- FunctionHeaderComment = CheckCommentImmediatelyPrecedeFunctionHeader(Result[1], Result[2], CommentSet)
- if FunctionHeaderComment:
- CheckFunctionHeaderConsistentWithDoxygenComment(Result[0], Result[1], Result[2], FunctionHeaderComment[0], FunctionHeaderComment[1], ErrorMsgList, FunctionHeaderComment[3], FileTable)
- else:
- if EccGlobalData.gException.IsException(ERROR_HEADER_CHECK_FUNCTION, FuncName):
- continue
- ErrorMsgList.append('Line %d :Function %s has NO comment immediately preceding it.' % (Result[2], Result[1]))
- PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'Function [%s] has NO comment immediately preceding it.' % (FuncName), FileTable, Result[3])
-
- # Func Def check
- SqlStatement = """ select Value, StartLine, EndLine, ID
- from %s
- where Model = %d
- """ % (FileTable, DataClass.MODEL_IDENTIFIER_FUNCTION_HEADER)
-
- ResultSet = Db.TblFile.Exec(SqlStatement)
- CommentSet = []
- try:
- for Result in ResultSet:
- CommentSet.append(Result)
- except:
- print 'Unrecognized chars in comment of file %s', FullFileName
-
- SqlStatement = """ select Modifier, Header, StartLine, ID, Name
- from Function
- where BelongsToFile = %d
- """ % (FileID)
- ResultSet = Db.TblFile.Exec(SqlStatement)
- for Result in ResultSet:
- FuncName = Result[4]
- FunctionHeaderComment = CheckCommentImmediatelyPrecedeFunctionHeader(Result[1], Result[2], CommentSet)
- if FunctionHeaderComment:
- CheckFunctionHeaderConsistentWithDoxygenComment(Result[0], Result[1], Result[2], FunctionHeaderComment[0], FunctionHeaderComment[1], ErrorMsgList, FunctionHeaderComment[3], FileTable)
- else:
- if EccGlobalData.gException.IsException(ERROR_HEADER_CHECK_FUNCTION, FuncName):
- continue
- ErrorMsgList.append('Line %d :Function [%s] has NO comment immediately preceding it.' % (Result[2], Result[1]))
- PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'Function [%s] has NO comment immediately preceding it.' % (FuncName), 'Function', Result[3])
- return ErrorMsgList
-
-def CheckCommentImmediatelyPrecedeFunctionHeader(FuncName, FuncStartLine, CommentSet):
-
- for Comment in CommentSet:
- if Comment[2] == FuncStartLine - 1:
- return Comment
- return None
-
-def GetDoxygenStrFromComment(Str):
- DoxygenStrList = []
- ParamTagList = Str.split('@param')
- if len(ParamTagList) > 1:
- i = 1
- while i < len(ParamTagList):
- DoxygenStrList.append('@param' + ParamTagList[i])
- i += 1
-
- Str = ParamTagList[0]
-
- RetvalTagList = ParamTagList[-1].split('@retval')
- if len(RetvalTagList) > 1:
- if len(ParamTagList) > 1:
- DoxygenStrList[-1] = '@param' + RetvalTagList[0]
- i = 1
- while i < len(RetvalTagList):
- DoxygenStrList.append('@retval' + RetvalTagList[i])
- i += 1
-
- ReturnTagList = RetvalTagList[-1].split('@return')
- if len(ReturnTagList) > 1:
- if len(RetvalTagList) > 1:
- DoxygenStrList[-1] = '@retval' + ReturnTagList[0]
- elif len(ParamTagList) > 1:
- DoxygenStrList[-1] = '@param' + ReturnTagList[0]
- i = 1
- while i < len(ReturnTagList):
- DoxygenStrList.append('@return' + ReturnTagList[i])
- i += 1
-
- if len(DoxygenStrList) > 0:
- DoxygenStrList[-1] = DoxygenStrList[-1].rstrip('--*/')
-
- return DoxygenStrList
-
-def CheckGeneralDoxygenCommentLayout(Str, StartLine, ErrorMsgList, CommentId= -1, TableName=''):
- #/** --*/ @retval after @param
- if not Str.startswith('/**'):
- ErrorMsgList.append('Line %d : Comment does NOT have prefix /** ' % StartLine)
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'Comment does NOT have prefix /** ', TableName, CommentId)
- if not Str.endswith('**/'):
- ErrorMsgList.append('Line %d : Comment does NOT have tail **/ ' % StartLine)
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'Comment does NOT have tail **/ ', TableName, CommentId)
- FirstRetvalIndex = Str.find('@retval')
- LastParamIndex = Str.rfind('@param')
- if (FirstRetvalIndex > 0) and (LastParamIndex > 0) and (FirstRetvalIndex < LastParamIndex):
- ErrorMsgList.append('Line %d : @retval appear before @param ' % StartLine)
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, @retval appear before @param ', TableName, CommentId)
-
-def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHeader, FuncStartLine, CommentStr, CommentStartLine, ErrorMsgList, CommentId= -1, TableName=''):
-
- ParamList = GetParamList(FuncHeader)
- CheckGeneralDoxygenCommentLayout(CommentStr, CommentStartLine, ErrorMsgList, CommentId, TableName)
- DescriptionStr = CommentStr
- DoxygenStrList = GetDoxygenStrFromComment(DescriptionStr)
- if DescriptionStr.find('.') == -1:
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMENT_DESCRIPTION, 'Comment description should end with period \'.\'', TableName, CommentId)
- DoxygenTagNumber = len(DoxygenStrList)
- ParamNumber = len(ParamList)
- for Param in ParamList:
- if Param.Name.upper() == 'VOID' and ParamNumber == 1:
- ParamNumber -= 1
- Index = 0
- if ParamNumber > 0 and DoxygenTagNumber > 0:
- while Index < ParamNumber and Index < DoxygenTagNumber:
- ParamModifier = ParamList[Index].Modifier
- ParamName = ParamList[Index].Name.strip()
- Tag = DoxygenStrList[Index].strip(' ')
- if (not Tag[-1] == ('\n')) and (not Tag[-1] == ('\r')):
- ErrorMsgList.append('Line %d : in Comment, <%s> does NOT end with new line ' % (CommentStartLine, Tag.replace('\n', '').replace('\r', '')))
- PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'in Comment, <%s> does NOT end with new line ' % (Tag.replace('\n', '').replace('\r', '')), TableName, CommentId)
- TagPartList = Tag.split()
- if len(TagPartList) < 2:
- ErrorMsgList.append('Line %d : in Comment, <%s> does NOT contain doxygen contents ' % (CommentStartLine, Tag.replace('\n', '').replace('\r', '')))
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT contain doxygen contents ' % (Tag.replace('\n', '').replace('\r', '')), TableName, CommentId)
- Index += 1
- continue
- LBPos = Tag.find('[')
- RBPos = Tag.find(']')
- ParamToLBContent = Tag[len('@param'):LBPos].strip()
- if LBPos > 0 and len(ParamToLBContent) == 0 and RBPos > LBPos:
- InOutStr = ''
- ModifierPartList = ParamModifier.split()
- for Part in ModifierPartList:
- if Part.strip() == 'IN':
- InOutStr += 'in'
- if Part.strip() == 'OUT':
- if InOutStr != '':
- InOutStr += ', out'
- else:
- InOutStr = 'out'
-
- if InOutStr != '':
- if Tag.find('[' + InOutStr + ']') == -1:
- if InOutStr != 'in, out':
- ErrorMsgList.append('Line %d : in Comment, <%s> does NOT have %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'))
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT have %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'), TableName, CommentId)
- else:
- if Tag.find('[in,out]') == -1:
- ErrorMsgList.append('Line %d : in Comment, <%s> does NOT have %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'))
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT have %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'), TableName, CommentId)
-
-
- if Tag.find(ParamName) == -1 and ParamName != 'VOID' and ParamName != 'void':
- ErrorMsgList.append('Line %d : in Comment, <%s> does NOT consistent with parameter name %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName))
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, <%s> does NOT consistent with parameter name %s ' % ((TagPartList[0] + ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName), TableName, CommentId)
- Index += 1
-
- if Index < ParamNumber:
- ErrorMsgList.append('Line %d : Number of doxygen tags in comment less than number of function parameters' % CommentStartLine)
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'Number of doxygen tags in comment less than number of function parameters ', TableName, CommentId)
- # VOID return type, NOT VOID*. VOID* should be matched with a doxygen tag.
- if (FuncModifier.find('VOID') != -1 or FuncModifier.find('void') != -1) and FuncModifier.find('*') == -1:
-
- # assume we allow a return description tag for void func. return. that's why 'DoxygenTagNumber - 1' is used instead of 'DoxygenTagNumber'
- if Index < DoxygenTagNumber - 1 or (Index < DoxygenTagNumber and DoxygenStrList[Index].startswith('@retval')):
- ErrorMsgList.append('Line %d : VOID return type need NO doxygen tags in comment' % CommentStartLine)
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'VOID return type need no doxygen tags in comment ', TableName, CommentId)
- else:
- if Index < DoxygenTagNumber and not DoxygenStrList[Index].startswith('@retval') and not DoxygenStrList[Index].startswith('@return'):
- ErrorMsgList.append('Line %d : Number of @param doxygen tags in comment does NOT match number of function parameters' % CommentStartLine)
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'Number of @param doxygen tags in comment does NOT match number of function parameters ', TableName, CommentId)
- else:
- if ParamNumber == 0 and DoxygenTagNumber != 0 and ((FuncModifier.find('VOID') != -1 or FuncModifier.find('void') != -1) and FuncModifier.find('*') == -1):
- ErrorMsgList.append('Line %d : VOID return type need NO doxygen tags in comment' % CommentStartLine)
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'VOID return type need NO doxygen tags in comment ', TableName, CommentId)
- if ParamNumber != 0 and DoxygenTagNumber == 0:
- ErrorMsgList.append('Line %d : No doxygen tags in comment' % CommentStartLine)
- PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'No doxygen tags in comment ', TableName, CommentId)
-
-if __name__ == '__main__':
-
-# EdkLogger.Initialize()
-# EdkLogger.SetLevel(EdkLogger.QUIET)
-# CollectSourceCodeDataIntoDB(sys.argv[1])
- try:
- test_file = sys.argv[1]
- except IndexError, v:
- print "Usage: %s filename" % sys.argv[0]
- sys.exit(1)
- MsgList = CheckFuncHeaderDoxygenComments(test_file)
- for Msg in MsgList:
- print Msg
- print 'Done!'
diff --git a/BaseTools/Source/Python/Ecc/config.ini b/BaseTools/Source/Python/Ecc/config.ini
deleted file mode 100644
index c55276fce7..0000000000
--- a/BaseTools/Source/Python/Ecc/config.ini
+++ /dev/null
@@ -1,257 +0,0 @@
-## @file
-# This file is used to set configuration of ECC tool
-# For the items listed below, 1 means valid, 0 means invalid
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-#
-# Identify the version of current configuration
-#
-Version = 0.1
-
-#
-# Identify to if check all items
-# 1 - Check all items and ignore all other detailed items
-# 0 - Not check all items, the tool will go through all other detailed items to decide to check or not
-#
-CheckAll = 0
-
-#
-# Identify to if automatically correct mistakes
-# 1 - Automatically correct
-# 0 - Not automatically correct
-# Only the following check points can be automatically corrected, others not listed below are not supported even it is 1
-#
-# GeneralCheckTab
-# GeneralCheckIndentation
-# GeneralCheckLine
-# GeneralCheckCarriageReturn
-# SpaceCheckAll
-#
-AutoCorrect = 1
-
-#
-# List customized Modifer here, split with ','
-#
-ModifierList = IN, OUT, OPTIONAL, UNALIGNED, EFI_RUNTIMESERVICE, EFI_BOOTSERVICE, EFIAPI, TPMINTERNALAPI
-
-#
-# General Checking
-#
-GeneralCheckAll = 0
-
-# Check whether NO Tab is used, replaced with spaces
-GeneralCheckNoTab = 1
-# The width of Tab
-GeneralCheckTabWidth = 2
-# Check whether the indentation is followed coding style
-GeneralCheckIndentation = 1
-# The width of indentation
-GeneralCheckIndentationWidth = 2
-# Check whether no line is exceeding defined widty
-GeneralCheckLine = 1
-# The width of a line
-GeneralCheckLineWidth = 120
-# Check whether no use of _asm in the source file
-GeneralCheckNo_Asm = 1
-# Check whether no use of "#progma" in source file except "#pragma pack(#)".
-GeneralCheckNoProgma = 1
-# Check whether there is a carriage return at the end of the file
-GeneralCheckCarriageReturn = 1
-# Check whether the file exists
-GeneralCheckFileExistence = 1
-# Check whether file has non ACSII char
-GeneralCheckNonAcsii = 1
-
-#
-# Space Checking
-#
-SpaceCheckAll = 1
-
-#
-# Predicate Expression Checking
-#
-PredicateExpressionCheckAll = 0
-
-# Check whether Boolean values, variable type BOOLEAN not use explicit comparisons to TRUE or FALSE
-PredicateExpressionCheckBooleanValue = 1
-# Check whether Non-Boolean comparisons use a compare operator (==, !=, >, < >=, <=).
-PredicateExpressionCheckNonBooleanOperator = 1
-# Check whether a comparison of any pointer to zero must be done via the NULL type
-PredicateExpressionCheckComparisonNullType = 1
-
-#
-# Headers Checking
-#
-HeaderCheckAll = 0
-
-# Check whether File header exists
-HeaderCheckFile = 1
-# Check whether Function header exists
-HeaderCheckFunction = 1
-# Check whether Meta data File header Comment End with '##'
-HeaderCheckFileCommentEnd = 0
-# Check whether C File header Comment content start with two spaces
-HeaderCheckCFileCommentStartSpacesNum = 0
-# Check whether C File header Comment's each reference at list should begin with a bullet character '-'
-HeaderCheckCFileCommentReferenceFormat = 0
-# Check whether C File header Comment have the License immediately after the ""Copyright"" line
-HeaderCheckCFileCommentLicenseFormat = 0
-
-#
-# C Function Layout Checking
-#
-CFunctionLayoutCheckAll = 0
-
-# Check whether return type exists and in the first line
-CFunctionLayoutCheckReturnType = 1
-# Check whether any optional functional modifiers exist and next to the return type
-CFunctionLayoutCheckOptionalFunctionalModifier = 1
-# Check whether the next line contains the function name, left justified, followed by the beginning of the parameter list
-# Check whether the closing parenthesis is on its own line and also indented two spaces
-CFunctionLayoutCheckFunctionName = 1
-# Check whether the function prototypes in include files have the same form as function definitions
-CFunctionLayoutCheckFunctionPrototype = 1
-# Check whether the body of a function is contained by open and close braces that must be in the first column
-CFunctionLayoutCheckFunctionBody = 1
-# Check whether the data declarations is the first code in a module.
-CFunctionLayoutCheckDataDeclaration = 1
-# Check whether no initialization of a variable as part of its declaration
-CFunctionLayoutCheckNoInitOfVariable = 1
-# Check whether no use of STATIC for functions
-CFunctionLayoutCheckNoStatic = 1
-
-#
-# Include Files Checking
-#
-IncludeFileCheckAll = 0
-
-#Check whether having include files with same name
-IncludeFileCheckSameName = 1
-# Check whether all include file contents is guarded by a #ifndef statement.
-# the #ifndef must be the first line of code following the file header comment
-# the #endif must appear on the last line in the file
-IncludeFileCheckIfndefStatement = 1
-# Check whether include files contain only public or only private data
-# Check whether include files NOT contain code or define data variables
-IncludeFileCheckData = 1
-
-#
-# Declarations and Data Types Checking
-#
-DeclarationDataTypeCheckAll = 0
-
-# Check whether no use of int, unsigned, char, void, static, long in any .c, .h or .asl files.
-DeclarationDataTypeCheckNoUseCType = 1
-# Check whether the modifiers IN, OUT, OPTIONAL, and UNALIGNED are used only to qualify arguments to a function and should not appear in a data type declaration
-DeclarationDataTypeCheckInOutModifier = 1
-# Check whether the EFIAPI modifier should be used at the entry of drivers, events, and member functions of protocols
-DeclarationDataTypeCheckEFIAPIModifier = 1
-# Check whether Enumerated Type has a 'typedef' and the name is capital
-DeclarationDataTypeCheckEnumeratedType = 1
-# Check whether Structure Type has a 'typedef' and the name is capital
-DeclarationDataTypeCheckStructureDeclaration = 1
-# Check whether having same Structure
-DeclarationDataTypeCheckSameStructure = 1
-# Check whether Union Type has a 'typedef' and the name is capital
-DeclarationDataTypeCheckUnionType = 1
-
-
-#
-# Naming Conventions Checking
-#
-NamingConventionCheckAll = 0
-
-# Check whether only capital letters are used for #define declarations
-NamingConventionCheckDefineStatement = 1
-# Check whether only capital letters are used for typedef declarations
-NamingConventionCheckTypedefStatement = 1
-# Check whether the #ifndef at the start of an include file uses both prefix and postfix underscore characters, '_'.
-NamingConventionCheckIfndefStatement = 1
-# Rule for path name, variable name and function name
-# 1. First character should be upper case
-# 2. Existing lower case in a word
-# 3. No space existence
-# 4. Global variable name must start by a 'g'
-# Check whether the path name followed the rule
-NamingConventionCheckPathName = 1
-# Check whether the variable name followed the rule
-NamingConventionCheckVariableName = 1
-# Check whether the function name followed the rule
-NamingConventionCheckFunctionName = 1
-# Check whether NO use short variable name with single character
-NamingConventionCheckSingleCharacterVariable = 1
-
-#
-# Doxygen Checking
-#
-DoxygenCheckAll = 0
-
-# Check whether the file headers are followed Doxygen special documentation blocks in section 2.3.5
-DoxygenCheckFileHeader = 1
-# Check whether the function headers are followed Doxygen special documentation blocks in section 2.3.5
-DoxygenCheckFunctionHeader = 1
-# Check whether the first line of text in a comment block is a brief description of the element being documented.
-# The brief description must end with a period.
-DoxygenCheckCommentDescription = 1
-# Check whether comment lines with '///< ... text ...' format, if it is used, it should be after the code section.
-DoxygenCheckCommentFormat = 1
-# Check whether only Doxygen commands allowed to mark the code are @bug and @todo.
-DoxygenCheckCommand = 1
-
-#
-# Meta-Data File Processing Checking
-#
-MetaDataFileCheckAll = 0
-
-# Check whether each file defined in meta-data exists
-MetaDataFileCheckPathName = 1
-# Generate a list for all files defined in meta-data files
-MetaDataFileCheckGenerateFileList = 1
-# The path of log file
-MetaDataFileCheckPathOfGenerateFileList = File.log
-# Check whether all Library Instances defined for a given module (or dependent library instance) match the module's type.
-# Each Library Instance must specify the Supported Module Types in its INF file,
-# and any module specifying the library instance must be one of the supported types.
-MetaDataFileCheckLibraryInstance = 1
-# Check whether a Library Instance has been defined for all dependent library classes
-MetaDataFileCheckLibraryInstanceDependent = 1
-# Check whether the Library Instances specified by the LibraryClasses sections are listed in order of dependencies
-MetaDataFileCheckLibraryInstanceOrder = 1
-# Check whether the unnecessary inclusion of library classes in the INF file
-MetaDataFileCheckLibraryNoUse = 1
-# Check whether an INF file is specified in the FDF file, but not in the DSC file, then the INF file must be for a Binary module only
-MetaDataFileCheckBinaryInfInFdf = 1
-# Not to report error and warning related OS include file such as "windows.h" and "stdio.h".
-# Check whether a PCD is set in a DSC file or the FDF file, but not in both.
-MetaDataFileCheckPcdDuplicate = 1
-# Check whether PCD settings in the FDF file can only be related to flash.
-MetaDataFileCheckPcdFlash = 1
-# Check whether PCDs used in INF files but not specified in DSC or FDF files
-MetaDataFileCheckPcdNoUse = 1
-# Check whether having duplicate guids defined for Guid/Protocol/Ppi
-MetaDataFileCheckGuidDuplicate = 1
-# Check whether all files under module directory are described in INF files
-MetaDataFileCheckModuleFileNoUse = 1
-# Check whether the PCD is correctly used in C function via its type
-MetaDataFileCheckPcdType = 1
-# Check whether there are FILE_GUID duplication among different INF files
-MetaDataFileCheckModuleFileGuidDuplication = 1
-
-#
-# The check points in this section are reserved
-#
-# GotoStatementCheckAll = 0
-# SpellingCheckAll = 0
-#
-
-# A list for binary file ext name
-BinaryExtList = EXE, EFI, FV, ROM, DLL, COM, BMP, GIF, PYD, CMP, BIN, JPG, UNI, RAW, COM2, LIB, DEPEX, SYS, DB
diff --git a/BaseTools/Source/Python/Ecc/exception.xml b/BaseTools/Source/Python/Ecc/exception.xml
deleted file mode 100644
index 9102de6fef..0000000000
--- a/BaseTools/Source/Python/Ecc/exception.xml
+++ /dev/null
@@ -1,319 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ExceptionList xmlns="http://www.uefi.org/2008/2.1" xmlns:xsi="http:/www.w3.org/2001/XMLSchema-instance">
- <Copyright>Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.</Copyright>
- <License>
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this distribution.
- The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES
- OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- </License>
- <Exception>
- <KeyWord>__debugbreak</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__readmsr</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__writemsr</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedCompareExchange</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedCompareExchange64</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedDecrement</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedIncrement</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_break</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inp</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inpw</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inpd</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outp</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outpw</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outpd</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_ReadWriteBarrier</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>InternalX86DisablePaging32</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>InternalX86EnablePaging32</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>InternalLongJump</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>SetJump</KeyWord>
- <ErrorID>4002</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__debugbreak</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__readmsr</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__writemsr</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedCompareExchange</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedCompareExchange64</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedDecrement</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedIncrement</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inp</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inpw</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inpd</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outp</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outpw</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outpd</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_ReadWriteBarrier</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>IoRead8</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>IoWrite8</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>IoRead16</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>IoWrite16</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>IoRead32</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>IoWrite32</KeyWord>
- <ErrorID>5001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__debugbreak</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__readmsr</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__writemsr</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedCompareExchange</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedCompareExchange64</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedDecrement</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedIncrement</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inp</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inpw</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inpd</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outp</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outpw</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outpd</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_ReadWriteBarrier</KeyWord>
- <ErrorID>5003</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__debugbreak</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__readmsr</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>__writemsr</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedCompareExchange</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedCompareExchange64</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedDecrement</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_InterlockedIncrement</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inp</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inpw</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_inpd</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outp</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outpw</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_outpd</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_ReadWriteBarrier</KeyWord>
- <ErrorID>7001</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>@</KeyWord>
- <ErrorID>9005</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>@R1</KeyWord>
- <ErrorID>9005</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>@R2</KeyWord>
- <ErrorID>9005</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>@Rx</KeyWord>
- <ErrorID>9005</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>@R2.</KeyWord>
- <ErrorID>9005</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>_DriverUnloadHandler</KeyWord>
- <ErrorID>8006</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>ASSERT</KeyWord>
- <ErrorID>10015</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>REPORT_STATUS_CODE</KeyWord>
- <ErrorID>10015</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>REPORT_STATUS_CODE_WITH_EXTENDED_DATA</KeyWord>
- <ErrorID>10015</ErrorID>
- </Exception>
- <Exception>
- <KeyWord>REPORT_STATUS_CODE_WITH_DEVICE_PATH</KeyWord>
- <ErrorID>10015</ErrorID>
- </Exception>
-</ExceptionList> \ No newline at end of file
diff --git a/BaseTools/Source/Python/Eot/CLexer.py b/BaseTools/Source/Python/Eot/CLexer.py
deleted file mode 100644
index a72d4ee3c2..0000000000
--- a/BaseTools/Source/Python/Eot/CLexer.py
+++ /dev/null
@@ -1,4947 +0,0 @@
-# $ANTLR 3.0.1 C.g 2010-02-23 09:58:53
-
-from antlr3 import *
-from antlr3.compat import set, frozenset
-
-## @file
-# The file defines the Lexer for C source files.
-#
-# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
-# This file is generated by running:
-# java org.antlr.Tool C.g
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at:
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-
-
-# for convenience in actions
-HIDDEN = BaseRecognizer.HIDDEN
-
-# token types
-T114=114
-T115=115
-T116=116
-T117=117
-FloatTypeSuffix=16
-LETTER=11
-T29=29
-T28=28
-T27=27
-T26=26
-T25=25
-EOF=-1
-STRING_LITERAL=9
-FLOATING_POINT_LITERAL=10
-T38=38
-T37=37
-T39=39
-T34=34
-COMMENT=22
-T33=33
-T36=36
-T35=35
-T30=30
-T32=32
-T31=31
-LINE_COMMENT=23
-IntegerTypeSuffix=14
-CHARACTER_LITERAL=8
-T49=49
-T48=48
-T100=100
-T43=43
-T42=42
-T102=102
-T41=41
-T101=101
-T40=40
-T47=47
-T46=46
-T45=45
-T44=44
-T109=109
-T107=107
-T108=108
-T105=105
-WS=19
-T106=106
-T103=103
-T104=104
-T50=50
-LINE_COMMAND=24
-T59=59
-T113=113
-T52=52
-T112=112
-T51=51
-T111=111
-T54=54
-T110=110
-EscapeSequence=12
-DECIMAL_LITERAL=7
-T53=53
-T56=56
-T55=55
-T58=58
-T57=57
-T75=75
-T76=76
-T73=73
-T74=74
-T79=79
-T77=77
-T78=78
-Exponent=15
-HexDigit=13
-T72=72
-T71=71
-T70=70
-T62=62
-T63=63
-T64=64
-T65=65
-T66=66
-T67=67
-T68=68
-T69=69
-IDENTIFIER=4
-UnicodeVocabulary=21
-HEX_LITERAL=5
-T61=61
-T60=60
-T99=99
-T97=97
-BS=20
-T98=98
-T95=95
-T96=96
-OCTAL_LITERAL=6
-T94=94
-Tokens=118
-T93=93
-T92=92
-T91=91
-T90=90
-T88=88
-T89=89
-T84=84
-T85=85
-T86=86
-T87=87
-UnicodeEscape=18
-T81=81
-T80=80
-T83=83
-OctalEscape=17
-T82=82
-
-class CLexer(Lexer):
-
- grammarFileName = "C.g"
-
- def __init__(self, input=None):
- Lexer.__init__(self, input)
- self.dfa25 = self.DFA25(
- self, 25,
- eot = self.DFA25_eot,
- eof = self.DFA25_eof,
- min = self.DFA25_min,
- max = self.DFA25_max,
- accept = self.DFA25_accept,
- special = self.DFA25_special,
- transition = self.DFA25_transition
- )
- self.dfa35 = self.DFA35(
- self, 35,
- eot = self.DFA35_eot,
- eof = self.DFA35_eof,
- min = self.DFA35_min,
- max = self.DFA35_max,
- accept = self.DFA35_accept,
- special = self.DFA35_special,
- transition = self.DFA35_transition
- )
-
-
-
-
-
-
- # $ANTLR start T25
- def mT25(self, ):
-
- try:
- self.type = T25
-
- # C.g:27:5: ( ';' )
- # C.g:27:7: ';'
- self.match(u';')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T25
-
-
-
- # $ANTLR start T26
- def mT26(self, ):
-
- try:
- self.type = T26
-
- # C.g:28:5: ( 'typedef' )
- # C.g:28:7: 'typedef'
- self.match("typedef")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T26
-
-
-
- # $ANTLR start T27
- def mT27(self, ):
-
- try:
- self.type = T27
-
- # C.g:29:5: ( ',' )
- # C.g:29:7: ','
- self.match(u',')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T27
-
-
-
- # $ANTLR start T28
- def mT28(self, ):
-
- try:
- self.type = T28
-
- # C.g:30:5: ( '=' )
- # C.g:30:7: '='
- self.match(u'=')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T28
-
-
-
- # $ANTLR start T29
- def mT29(self, ):
-
- try:
- self.type = T29
-
- # C.g:31:5: ( 'extern' )
- # C.g:31:7: 'extern'
- self.match("extern")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T29
-
-
-
- # $ANTLR start T30
- def mT30(self, ):
-
- try:
- self.type = T30
-
- # C.g:32:5: ( 'static' )
- # C.g:32:7: 'static'
- self.match("static")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T30
-
-
-
- # $ANTLR start T31
- def mT31(self, ):
-
- try:
- self.type = T31
-
- # C.g:33:5: ( 'auto' )
- # C.g:33:7: 'auto'
- self.match("auto")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T31
-
-
-
- # $ANTLR start T32
- def mT32(self, ):
-
- try:
- self.type = T32
-
- # C.g:34:5: ( 'register' )
- # C.g:34:7: 'register'
- self.match("register")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T32
-
-
-
- # $ANTLR start T33
- def mT33(self, ):
-
- try:
- self.type = T33
-
- # C.g:35:5: ( 'STATIC' )
- # C.g:35:7: 'STATIC'
- self.match("STATIC")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T33
-
-
-
- # $ANTLR start T34
- def mT34(self, ):
-
- try:
- self.type = T34
-
- # C.g:36:5: ( 'void' )
- # C.g:36:7: 'void'
- self.match("void")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T34
-
-
-
- # $ANTLR start T35
- def mT35(self, ):
-
- try:
- self.type = T35
-
- # C.g:37:5: ( 'char' )
- # C.g:37:7: 'char'
- self.match("char")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T35
-
-
-
- # $ANTLR start T36
- def mT36(self, ):
-
- try:
- self.type = T36
-
- # C.g:38:5: ( 'short' )
- # C.g:38:7: 'short'
- self.match("short")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T36
-
-
-
- # $ANTLR start T37
- def mT37(self, ):
-
- try:
- self.type = T37
-
- # C.g:39:5: ( 'int' )
- # C.g:39:7: 'int'
- self.match("int")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T37
-
-
-
- # $ANTLR start T38
- def mT38(self, ):
-
- try:
- self.type = T38
-
- # C.g:40:5: ( 'long' )
- # C.g:40:7: 'long'
- self.match("long")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T38
-
-
-
- # $ANTLR start T39
- def mT39(self, ):
-
- try:
- self.type = T39
-
- # C.g:41:5: ( 'float' )
- # C.g:41:7: 'float'
- self.match("float")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T39
-
-
-
- # $ANTLR start T40
- def mT40(self, ):
-
- try:
- self.type = T40
-
- # C.g:42:5: ( 'double' )
- # C.g:42:7: 'double'
- self.match("double")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T40
-
-
-
- # $ANTLR start T41
- def mT41(self, ):
-
- try:
- self.type = T41
-
- # C.g:43:5: ( 'signed' )
- # C.g:43:7: 'signed'
- self.match("signed")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T41
-
-
-
- # $ANTLR start T42
- def mT42(self, ):
-
- try:
- self.type = T42
-
- # C.g:44:5: ( 'unsigned' )
- # C.g:44:7: 'unsigned'
- self.match("unsigned")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T42
-
-
-
- # $ANTLR start T43
- def mT43(self, ):
-
- try:
- self.type = T43
-
- # C.g:45:5: ( '{' )
- # C.g:45:7: '{'
- self.match(u'{')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T43
-
-
-
- # $ANTLR start T44
- def mT44(self, ):
-
- try:
- self.type = T44
-
- # C.g:46:5: ( '}' )
- # C.g:46:7: '}'
- self.match(u'}')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T44
-
-
-
- # $ANTLR start T45
- def mT45(self, ):
-
- try:
- self.type = T45
-
- # C.g:47:5: ( 'struct' )
- # C.g:47:7: 'struct'
- self.match("struct")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T45
-
-
-
- # $ANTLR start T46
- def mT46(self, ):
-
- try:
- self.type = T46
-
- # C.g:48:5: ( 'union' )
- # C.g:48:7: 'union'
- self.match("union")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T46
-
-
-
- # $ANTLR start T47
- def mT47(self, ):
-
- try:
- self.type = T47
-
- # C.g:49:5: ( ':' )
- # C.g:49:7: ':'
- self.match(u':')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T47
-
-
-
- # $ANTLR start T48
- def mT48(self, ):
-
- try:
- self.type = T48
-
- # C.g:50:5: ( 'enum' )
- # C.g:50:7: 'enum'
- self.match("enum")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T48
-
-
-
- # $ANTLR start T49
- def mT49(self, ):
-
- try:
- self.type = T49
-
- # C.g:51:5: ( 'const' )
- # C.g:51:7: 'const'
- self.match("const")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T49
-
-
-
- # $ANTLR start T50
- def mT50(self, ):
-
- try:
- self.type = T50
-
- # C.g:52:5: ( 'volatile' )
- # C.g:52:7: 'volatile'
- self.match("volatile")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T50
-
-
-
- # $ANTLR start T51
- def mT51(self, ):
-
- try:
- self.type = T51
-
- # C.g:53:5: ( 'IN' )
- # C.g:53:7: 'IN'
- self.match("IN")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T51
-
-
-
- # $ANTLR start T52
- def mT52(self, ):
-
- try:
- self.type = T52
-
- # C.g:54:5: ( 'OUT' )
- # C.g:54:7: 'OUT'
- self.match("OUT")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T52
-
-
-
- # $ANTLR start T53
- def mT53(self, ):
-
- try:
- self.type = T53
-
- # C.g:55:5: ( 'OPTIONAL' )
- # C.g:55:7: 'OPTIONAL'
- self.match("OPTIONAL")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T53
-
-
-
- # $ANTLR start T54
- def mT54(self, ):
-
- try:
- self.type = T54
-
- # C.g:56:5: ( 'CONST' )
- # C.g:56:7: 'CONST'
- self.match("CONST")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T54
-
-
-
- # $ANTLR start T55
- def mT55(self, ):
-
- try:
- self.type = T55
-
- # C.g:57:5: ( 'UNALIGNED' )
- # C.g:57:7: 'UNALIGNED'
- self.match("UNALIGNED")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T55
-
-
-
- # $ANTLR start T56
- def mT56(self, ):
-
- try:
- self.type = T56
-
- # C.g:58:5: ( 'VOLATILE' )
- # C.g:58:7: 'VOLATILE'
- self.match("VOLATILE")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T56
-
-
-
- # $ANTLR start T57
- def mT57(self, ):
-
- try:
- self.type = T57
-
- # C.g:59:5: ( 'GLOBAL_REMOVE_IF_UNREFERENCED' )
- # C.g:59:7: 'GLOBAL_REMOVE_IF_UNREFERENCED'
- self.match("GLOBAL_REMOVE_IF_UNREFERENCED")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T57
-
-
-
- # $ANTLR start T58
- def mT58(self, ):
-
- try:
- self.type = T58
-
- # C.g:60:5: ( 'EFIAPI' )
- # C.g:60:7: 'EFIAPI'
- self.match("EFIAPI")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T58
-
-
-
- # $ANTLR start T59
- def mT59(self, ):
-
- try:
- self.type = T59
-
- # C.g:61:5: ( 'EFI_BOOTSERVICE' )
- # C.g:61:7: 'EFI_BOOTSERVICE'
- self.match("EFI_BOOTSERVICE")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T59
-
-
-
- # $ANTLR start T60
- def mT60(self, ):
-
- try:
- self.type = T60
-
- # C.g:62:5: ( 'EFI_RUNTIMESERVICE' )
- # C.g:62:7: 'EFI_RUNTIMESERVICE'
- self.match("EFI_RUNTIMESERVICE")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T60
-
-
-
- # $ANTLR start T61
- def mT61(self, ):
-
- try:
- self.type = T61
-
- # C.g:63:5: ( 'PACKED' )
- # C.g:63:7: 'PACKED'
- self.match("PACKED")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T61
-
-
-
- # $ANTLR start T62
- def mT62(self, ):
-
- try:
- self.type = T62
-
- # C.g:64:5: ( '(' )
- # C.g:64:7: '('
- self.match(u'(')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T62
-
-
-
- # $ANTLR start T63
- def mT63(self, ):
-
- try:
- self.type = T63
-
- # C.g:65:5: ( ')' )
- # C.g:65:7: ')'
- self.match(u')')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T63
-
-
-
- # $ANTLR start T64
- def mT64(self, ):
-
- try:
- self.type = T64
-
- # C.g:66:5: ( '[' )
- # C.g:66:7: '['
- self.match(u'[')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T64
-
-
-
- # $ANTLR start T65
- def mT65(self, ):
-
- try:
- self.type = T65
-
- # C.g:67:5: ( ']' )
- # C.g:67:7: ']'
- self.match(u']')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T65
-
-
-
- # $ANTLR start T66
- def mT66(self, ):
-
- try:
- self.type = T66
-
- # C.g:68:5: ( '*' )
- # C.g:68:7: '*'
- self.match(u'*')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T66
-
-
-
- # $ANTLR start T67
- def mT67(self, ):
-
- try:
- self.type = T67
-
- # C.g:69:5: ( '...' )
- # C.g:69:7: '...'
- self.match("...")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T67
-
-
-
- # $ANTLR start T68
- def mT68(self, ):
-
- try:
- self.type = T68
-
- # C.g:70:5: ( '+' )
- # C.g:70:7: '+'
- self.match(u'+')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T68
-
-
-
- # $ANTLR start T69
- def mT69(self, ):
-
- try:
- self.type = T69
-
- # C.g:71:5: ( '-' )
- # C.g:71:7: '-'
- self.match(u'-')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T69
-
-
-
- # $ANTLR start T70
- def mT70(self, ):
-
- try:
- self.type = T70
-
- # C.g:72:5: ( '/' )
- # C.g:72:7: '/'
- self.match(u'/')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T70
-
-
-
- # $ANTLR start T71
- def mT71(self, ):
-
- try:
- self.type = T71
-
- # C.g:73:5: ( '%' )
- # C.g:73:7: '%'
- self.match(u'%')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T71
-
-
-
- # $ANTLR start T72
- def mT72(self, ):
-
- try:
- self.type = T72
-
- # C.g:74:5: ( '++' )
- # C.g:74:7: '++'
- self.match("++")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T72
-
-
-
- # $ANTLR start T73
- def mT73(self, ):
-
- try:
- self.type = T73
-
- # C.g:75:5: ( '--' )
- # C.g:75:7: '--'
- self.match("--")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T73
-
-
-
- # $ANTLR start T74
- def mT74(self, ):
-
- try:
- self.type = T74
-
- # C.g:76:5: ( 'sizeof' )
- # C.g:76:7: 'sizeof'
- self.match("sizeof")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T74
-
-
-
- # $ANTLR start T75
- def mT75(self, ):
-
- try:
- self.type = T75
-
- # C.g:77:5: ( '.' )
- # C.g:77:7: '.'
- self.match(u'.')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T75
-
-
-
- # $ANTLR start T76
- def mT76(self, ):
-
- try:
- self.type = T76
-
- # C.g:78:5: ( '->' )
- # C.g:78:7: '->'
- self.match("->")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T76
-
-
-
- # $ANTLR start T77
- def mT77(self, ):
-
- try:
- self.type = T77
-
- # C.g:79:5: ( '&' )
- # C.g:79:7: '&'
- self.match(u'&')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T77
-
-
-
- # $ANTLR start T78
- def mT78(self, ):
-
- try:
- self.type = T78
-
- # C.g:80:5: ( '~' )
- # C.g:80:7: '~'
- self.match(u'~')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T78
-
-
-
- # $ANTLR start T79
- def mT79(self, ):
-
- try:
- self.type = T79
-
- # C.g:81:5: ( '!' )
- # C.g:81:7: '!'
- self.match(u'!')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T79
-
-
-
- # $ANTLR start T80
- def mT80(self, ):
-
- try:
- self.type = T80
-
- # C.g:82:5: ( '*=' )
- # C.g:82:7: '*='
- self.match("*=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T80
-
-
-
- # $ANTLR start T81
- def mT81(self, ):
-
- try:
- self.type = T81
-
- # C.g:83:5: ( '/=' )
- # C.g:83:7: '/='
- self.match("/=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T81
-
-
-
- # $ANTLR start T82
- def mT82(self, ):
-
- try:
- self.type = T82
-
- # C.g:84:5: ( '%=' )
- # C.g:84:7: '%='
- self.match("%=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T82
-
-
-
- # $ANTLR start T83
- def mT83(self, ):
-
- try:
- self.type = T83
-
- # C.g:85:5: ( '+=' )
- # C.g:85:7: '+='
- self.match("+=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T83
-
-
-
- # $ANTLR start T84
- def mT84(self, ):
-
- try:
- self.type = T84
-
- # C.g:86:5: ( '-=' )
- # C.g:86:7: '-='
- self.match("-=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T84
-
-
-
- # $ANTLR start T85
- def mT85(self, ):
-
- try:
- self.type = T85
-
- # C.g:87:5: ( '<<=' )
- # C.g:87:7: '<<='
- self.match("<<=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T85
-
-
-
- # $ANTLR start T86
- def mT86(self, ):
-
- try:
- self.type = T86
-
- # C.g:88:5: ( '>>=' )
- # C.g:88:7: '>>='
- self.match(">>=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T86
-
-
-
- # $ANTLR start T87
- def mT87(self, ):
-
- try:
- self.type = T87
-
- # C.g:89:5: ( '&=' )
- # C.g:89:7: '&='
- self.match("&=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T87
-
-
-
- # $ANTLR start T88
- def mT88(self, ):
-
- try:
- self.type = T88
-
- # C.g:90:5: ( '^=' )
- # C.g:90:7: '^='
- self.match("^=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T88
-
-
-
- # $ANTLR start T89
- def mT89(self, ):
-
- try:
- self.type = T89
-
- # C.g:91:5: ( '|=' )
- # C.g:91:7: '|='
- self.match("|=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T89
-
-
-
- # $ANTLR start T90
- def mT90(self, ):
-
- try:
- self.type = T90
-
- # C.g:92:5: ( '?' )
- # C.g:92:7: '?'
- self.match(u'?')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T90
-
-
-
- # $ANTLR start T91
- def mT91(self, ):
-
- try:
- self.type = T91
-
- # C.g:93:5: ( '||' )
- # C.g:93:7: '||'
- self.match("||")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T91
-
-
-
- # $ANTLR start T92
- def mT92(self, ):
-
- try:
- self.type = T92
-
- # C.g:94:5: ( '&&' )
- # C.g:94:7: '&&'
- self.match("&&")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T92
-
-
-
- # $ANTLR start T93
- def mT93(self, ):
-
- try:
- self.type = T93
-
- # C.g:95:5: ( '|' )
- # C.g:95:7: '|'
- self.match(u'|')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T93
-
-
-
- # $ANTLR start T94
- def mT94(self, ):
-
- try:
- self.type = T94
-
- # C.g:96:5: ( '^' )
- # C.g:96:7: '^'
- self.match(u'^')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T94
-
-
-
- # $ANTLR start T95
- def mT95(self, ):
-
- try:
- self.type = T95
-
- # C.g:97:5: ( '==' )
- # C.g:97:7: '=='
- self.match("==")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T95
-
-
-
- # $ANTLR start T96
- def mT96(self, ):
-
- try:
- self.type = T96
-
- # C.g:98:5: ( '!=' )
- # C.g:98:7: '!='
- self.match("!=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T96
-
-
-
- # $ANTLR start T97
- def mT97(self, ):
-
- try:
- self.type = T97
-
- # C.g:99:5: ( '<' )
- # C.g:99:7: '<'
- self.match(u'<')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T97
-
-
-
- # $ANTLR start T98
- def mT98(self, ):
-
- try:
- self.type = T98
-
- # C.g:100:5: ( '>' )
- # C.g:100:7: '>'
- self.match(u'>')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T98
-
-
-
- # $ANTLR start T99
- def mT99(self, ):
-
- try:
- self.type = T99
-
- # C.g:101:5: ( '<=' )
- # C.g:101:7: '<='
- self.match("<=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T99
-
-
-
- # $ANTLR start T100
- def mT100(self, ):
-
- try:
- self.type = T100
-
- # C.g:102:6: ( '>=' )
- # C.g:102:8: '>='
- self.match(">=")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T100
-
-
-
- # $ANTLR start T101
- def mT101(self, ):
-
- try:
- self.type = T101
-
- # C.g:103:6: ( '<<' )
- # C.g:103:8: '<<'
- self.match("<<")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T101
-
-
-
- # $ANTLR start T102
- def mT102(self, ):
-
- try:
- self.type = T102
-
- # C.g:104:6: ( '>>' )
- # C.g:104:8: '>>'
- self.match(">>")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T102
-
-
-
- # $ANTLR start T103
- def mT103(self, ):
-
- try:
- self.type = T103
-
- # C.g:105:6: ( '__asm__' )
- # C.g:105:8: '__asm__'
- self.match("__asm__")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T103
-
-
-
- # $ANTLR start T104
- def mT104(self, ):
-
- try:
- self.type = T104
-
- # C.g:106:6: ( '_asm' )
- # C.g:106:8: '_asm'
- self.match("_asm")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T104
-
-
-
- # $ANTLR start T105
- def mT105(self, ):
-
- try:
- self.type = T105
-
- # C.g:107:6: ( '__asm' )
- # C.g:107:8: '__asm'
- self.match("__asm")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T105
-
-
-
- # $ANTLR start T106
- def mT106(self, ):
-
- try:
- self.type = T106
-
- # C.g:108:6: ( 'case' )
- # C.g:108:8: 'case'
- self.match("case")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T106
-
-
-
- # $ANTLR start T107
- def mT107(self, ):
-
- try:
- self.type = T107
-
- # C.g:109:6: ( 'default' )
- # C.g:109:8: 'default'
- self.match("default")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T107
-
-
-
- # $ANTLR start T108
- def mT108(self, ):
-
- try:
- self.type = T108
-
- # C.g:110:6: ( 'if' )
- # C.g:110:8: 'if'
- self.match("if")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T108
-
-
-
- # $ANTLR start T109
- def mT109(self, ):
-
- try:
- self.type = T109
-
- # C.g:111:6: ( 'else' )
- # C.g:111:8: 'else'
- self.match("else")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T109
-
-
-
- # $ANTLR start T110
- def mT110(self, ):
-
- try:
- self.type = T110
-
- # C.g:112:6: ( 'switch' )
- # C.g:112:8: 'switch'
- self.match("switch")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T110
-
-
-
- # $ANTLR start T111
- def mT111(self, ):
-
- try:
- self.type = T111
-
- # C.g:113:6: ( 'while' )
- # C.g:113:8: 'while'
- self.match("while")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T111
-
-
-
- # $ANTLR start T112
- def mT112(self, ):
-
- try:
- self.type = T112
-
- # C.g:114:6: ( 'do' )
- # C.g:114:8: 'do'
- self.match("do")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T112
-
-
-
- # $ANTLR start T113
- def mT113(self, ):
-
- try:
- self.type = T113
-
- # C.g:115:6: ( 'for' )
- # C.g:115:8: 'for'
- self.match("for")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T113
-
-
-
- # $ANTLR start T114
- def mT114(self, ):
-
- try:
- self.type = T114
-
- # C.g:116:6: ( 'goto' )
- # C.g:116:8: 'goto'
- self.match("goto")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T114
-
-
-
- # $ANTLR start T115
- def mT115(self, ):
-
- try:
- self.type = T115
-
- # C.g:117:6: ( 'continue' )
- # C.g:117:8: 'continue'
- self.match("continue")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T115
-
-
-
- # $ANTLR start T116
- def mT116(self, ):
-
- try:
- self.type = T116
-
- # C.g:118:6: ( 'break' )
- # C.g:118:8: 'break'
- self.match("break")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T116
-
-
-
- # $ANTLR start T117
- def mT117(self, ):
-
- try:
- self.type = T117
-
- # C.g:119:6: ( 'return' )
- # C.g:119:8: 'return'
- self.match("return")
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end T117
-
-
-
- # $ANTLR start IDENTIFIER
- def mIDENTIFIER(self, ):
-
- try:
- self.type = IDENTIFIER
-
- # C.g:586:2: ( LETTER ( LETTER | '0' .. '9' )* )
- # C.g:586:4: LETTER ( LETTER | '0' .. '9' )*
- self.mLETTER()
-
- # C.g:586:11: ( LETTER | '0' .. '9' )*
- while True: #loop1
- alt1 = 2
- LA1_0 = self.input.LA(1)
-
- if (LA1_0 == u'$' or (u'0' <= LA1_0 <= u'9') or (u'A' <= LA1_0 <= u'Z') or LA1_0 == u'_' or (u'a' <= LA1_0 <= u'z')) :
- alt1 = 1
-
-
- if alt1 == 1:
- # C.g:
- if self.input.LA(1) == u'$' or (u'0' <= self.input.LA(1) <= u'9') or (u'A' <= self.input.LA(1) <= u'Z') or self.input.LA(1) == u'_' or (u'a' <= self.input.LA(1) <= u'z'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- else:
- break #loop1
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end IDENTIFIER
-
-
-
- # $ANTLR start LETTER
- def mLETTER(self, ):
-
- try:
- # C.g:591:2: ( '$' | 'A' .. 'Z' | 'a' .. 'z' | '_' )
- # C.g:
- if self.input.LA(1) == u'$' or (u'A' <= self.input.LA(1) <= u'Z') or self.input.LA(1) == u'_' or (u'a' <= self.input.LA(1) <= u'z'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end LETTER
-
-
-
- # $ANTLR start CHARACTER_LITERAL
- def mCHARACTER_LITERAL(self, ):
-
- try:
- self.type = CHARACTER_LITERAL
-
- # C.g:598:5: ( ( 'L' )? '\\'' ( EscapeSequence | ~ ( '\\'' | '\\\\' ) ) '\\'' )
- # C.g:598:9: ( 'L' )? '\\'' ( EscapeSequence | ~ ( '\\'' | '\\\\' ) ) '\\''
- # C.g:598:9: ( 'L' )?
- alt2 = 2
- LA2_0 = self.input.LA(1)
-
- if (LA2_0 == u'L') :
- alt2 = 1
- if alt2 == 1:
- # C.g:598:10: 'L'
- self.match(u'L')
-
-
-
-
- self.match(u'\'')
-
- # C.g:598:21: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )
- alt3 = 2
- LA3_0 = self.input.LA(1)
-
- if (LA3_0 == u'\\') :
- alt3 = 1
- elif ((u'\u0000' <= LA3_0 <= u'&') or (u'(' <= LA3_0 <= u'[') or (u']' <= LA3_0 <= u'\uFFFE')) :
- alt3 = 2
- else:
- nvae = NoViableAltException("598:21: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )", 3, 0, self.input)
-
- raise nvae
-
- if alt3 == 1:
- # C.g:598:23: EscapeSequence
- self.mEscapeSequence()
-
-
-
- elif alt3 == 2:
- # C.g:598:40: ~ ( '\\'' | '\\\\' )
- if (u'\u0000' <= self.input.LA(1) <= u'&') or (u'(' <= self.input.LA(1) <= u'[') or (u']' <= self.input.LA(1) <= u'\uFFFE'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
- self.match(u'\'')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end CHARACTER_LITERAL
-
-
-
- # $ANTLR start STRING_LITERAL
- def mSTRING_LITERAL(self, ):
-
- try:
- self.type = STRING_LITERAL
-
- # C.g:602:5: ( ( 'L' )? '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"' )
- # C.g:602:8: ( 'L' )? '\"' ( EscapeSequence | ~ ( '\\\\' | '\"' ) )* '\"'
- # C.g:602:8: ( 'L' )?
- alt4 = 2
- LA4_0 = self.input.LA(1)
-
- if (LA4_0 == u'L') :
- alt4 = 1
- if alt4 == 1:
- # C.g:602:9: 'L'
- self.match(u'L')
-
-
-
-
- self.match(u'"')
-
- # C.g:602:19: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )*
- while True: #loop5
- alt5 = 3
- LA5_0 = self.input.LA(1)
-
- if (LA5_0 == u'\\') :
- alt5 = 1
- elif ((u'\u0000' <= LA5_0 <= u'!') or (u'#' <= LA5_0 <= u'[') or (u']' <= LA5_0 <= u'\uFFFE')) :
- alt5 = 2
-
-
- if alt5 == 1:
- # C.g:602:21: EscapeSequence
- self.mEscapeSequence()
-
-
-
- elif alt5 == 2:
- # C.g:602:38: ~ ( '\\\\' | '\"' )
- if (u'\u0000' <= self.input.LA(1) <= u'!') or (u'#' <= self.input.LA(1) <= u'[') or (u']' <= self.input.LA(1) <= u'\uFFFE'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- else:
- break #loop5
-
-
- self.match(u'"')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end STRING_LITERAL
-
-
-
- # $ANTLR start HEX_LITERAL
- def mHEX_LITERAL(self, ):
-
- try:
- self.type = HEX_LITERAL
-
- # C.g:605:13: ( '0' ( 'x' | 'X' ) ( HexDigit )+ ( IntegerTypeSuffix )? )
- # C.g:605:15: '0' ( 'x' | 'X' ) ( HexDigit )+ ( IntegerTypeSuffix )?
- self.match(u'0')
-
- if self.input.LA(1) == u'X' or self.input.LA(1) == u'x':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- # C.g:605:29: ( HexDigit )+
- cnt6 = 0
- while True: #loop6
- alt6 = 2
- LA6_0 = self.input.LA(1)
-
- if ((u'0' <= LA6_0 <= u'9') or (u'A' <= LA6_0 <= u'F') or (u'a' <= LA6_0 <= u'f')) :
- alt6 = 1
-
-
- if alt6 == 1:
- # C.g:605:29: HexDigit
- self.mHexDigit()
-
-
-
- else:
- if cnt6 >= 1:
- break #loop6
-
- eee = EarlyExitException(6, self.input)
- raise eee
-
- cnt6 += 1
-
-
- # C.g:605:39: ( IntegerTypeSuffix )?
- alt7 = 2
- LA7_0 = self.input.LA(1)
-
- if (LA7_0 == u'L' or LA7_0 == u'U' or LA7_0 == u'l' or LA7_0 == u'u') :
- alt7 = 1
- if alt7 == 1:
- # C.g:605:39: IntegerTypeSuffix
- self.mIntegerTypeSuffix()
-
-
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end HEX_LITERAL
-
-
-
- # $ANTLR start DECIMAL_LITERAL
- def mDECIMAL_LITERAL(self, ):
-
- try:
- self.type = DECIMAL_LITERAL
-
- # C.g:607:17: ( ( '0' | '1' .. '9' ( '0' .. '9' )* ) ( IntegerTypeSuffix )? )
- # C.g:607:19: ( '0' | '1' .. '9' ( '0' .. '9' )* ) ( IntegerTypeSuffix )?
- # C.g:607:19: ( '0' | '1' .. '9' ( '0' .. '9' )* )
- alt9 = 2
- LA9_0 = self.input.LA(1)
-
- if (LA9_0 == u'0') :
- alt9 = 1
- elif ((u'1' <= LA9_0 <= u'9')) :
- alt9 = 2
- else:
- nvae = NoViableAltException("607:19: ( '0' | '1' .. '9' ( '0' .. '9' )* )", 9, 0, self.input)
-
- raise nvae
-
- if alt9 == 1:
- # C.g:607:20: '0'
- self.match(u'0')
-
-
-
- elif alt9 == 2:
- # C.g:607:26: '1' .. '9' ( '0' .. '9' )*
- self.matchRange(u'1', u'9')
-
- # C.g:607:35: ( '0' .. '9' )*
- while True: #loop8
- alt8 = 2
- LA8_0 = self.input.LA(1)
-
- if ((u'0' <= LA8_0 <= u'9')) :
- alt8 = 1
-
-
- if alt8 == 1:
- # C.g:607:35: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- break #loop8
-
-
-
-
-
- # C.g:607:46: ( IntegerTypeSuffix )?
- alt10 = 2
- LA10_0 = self.input.LA(1)
-
- if (LA10_0 == u'L' or LA10_0 == u'U' or LA10_0 == u'l' or LA10_0 == u'u') :
- alt10 = 1
- if alt10 == 1:
- # C.g:607:46: IntegerTypeSuffix
- self.mIntegerTypeSuffix()
-
-
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end DECIMAL_LITERAL
-
-
-
- # $ANTLR start OCTAL_LITERAL
- def mOCTAL_LITERAL(self, ):
-
- try:
- self.type = OCTAL_LITERAL
-
- # C.g:609:15: ( '0' ( '0' .. '7' )+ ( IntegerTypeSuffix )? )
- # C.g:609:17: '0' ( '0' .. '7' )+ ( IntegerTypeSuffix )?
- self.match(u'0')
-
- # C.g:609:21: ( '0' .. '7' )+
- cnt11 = 0
- while True: #loop11
- alt11 = 2
- LA11_0 = self.input.LA(1)
-
- if ((u'0' <= LA11_0 <= u'7')) :
- alt11 = 1
-
-
- if alt11 == 1:
- # C.g:609:22: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
- else:
- if cnt11 >= 1:
- break #loop11
-
- eee = EarlyExitException(11, self.input)
- raise eee
-
- cnt11 += 1
-
-
- # C.g:609:33: ( IntegerTypeSuffix )?
- alt12 = 2
- LA12_0 = self.input.LA(1)
-
- if (LA12_0 == u'L' or LA12_0 == u'U' or LA12_0 == u'l' or LA12_0 == u'u') :
- alt12 = 1
- if alt12 == 1:
- # C.g:609:33: IntegerTypeSuffix
- self.mIntegerTypeSuffix()
-
-
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end OCTAL_LITERAL
-
-
-
- # $ANTLR start HexDigit
- def mHexDigit(self, ):
-
- try:
- # C.g:612:10: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )
- # C.g:612:12: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )
- if (u'0' <= self.input.LA(1) <= u'9') or (u'A' <= self.input.LA(1) <= u'F') or (u'a' <= self.input.LA(1) <= u'f'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end HexDigit
-
-
-
- # $ANTLR start IntegerTypeSuffix
- def mIntegerTypeSuffix(self, ):
-
- try:
- # C.g:616:2: ( ( 'u' | 'U' ) | ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) )
- alt13 = 4
- LA13_0 = self.input.LA(1)
-
- if (LA13_0 == u'U' or LA13_0 == u'u') :
- LA13_1 = self.input.LA(2)
-
- if (LA13_1 == u'L' or LA13_1 == u'l') :
- LA13_3 = self.input.LA(3)
-
- if (LA13_3 == u'L' or LA13_3 == u'l') :
- alt13 = 4
- else:
- alt13 = 3
- else:
- alt13 = 1
- elif (LA13_0 == u'L' or LA13_0 == u'l') :
- alt13 = 2
- else:
- nvae = NoViableAltException("614:1: fragment IntegerTypeSuffix : ( ( 'u' | 'U' ) | ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) );", 13, 0, self.input)
-
- raise nvae
-
- if alt13 == 1:
- # C.g:616:4: ( 'u' | 'U' )
- if self.input.LA(1) == u'U' or self.input.LA(1) == u'u':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- elif alt13 == 2:
- # C.g:617:4: ( 'l' | 'L' )
- if self.input.LA(1) == u'L' or self.input.LA(1) == u'l':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- elif alt13 == 3:
- # C.g:618:4: ( 'u' | 'U' ) ( 'l' | 'L' )
- if self.input.LA(1) == u'U' or self.input.LA(1) == u'u':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- if self.input.LA(1) == u'L' or self.input.LA(1) == u'l':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- elif alt13 == 4:
- # C.g:619:4: ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' )
- if self.input.LA(1) == u'U' or self.input.LA(1) == u'u':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- if self.input.LA(1) == u'L' or self.input.LA(1) == u'l':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- if self.input.LA(1) == u'L' or self.input.LA(1) == u'l':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end IntegerTypeSuffix
-
-
-
- # $ANTLR start FLOATING_POINT_LITERAL
- def mFLOATING_POINT_LITERAL(self, ):
-
- try:
- self.type = FLOATING_POINT_LITERAL
-
- # C.g:623:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )? | '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )? | ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )? | ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix )
- alt25 = 4
- alt25 = self.dfa25.predict(self.input)
- if alt25 == 1:
- # C.g:623:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponent )? ( FloatTypeSuffix )?
- # C.g:623:9: ( '0' .. '9' )+
- cnt14 = 0
- while True: #loop14
- alt14 = 2
- LA14_0 = self.input.LA(1)
-
- if ((u'0' <= LA14_0 <= u'9')) :
- alt14 = 1
-
-
- if alt14 == 1:
- # C.g:623:10: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- if cnt14 >= 1:
- break #loop14
-
- eee = EarlyExitException(14, self.input)
- raise eee
-
- cnt14 += 1
-
-
- self.match(u'.')
-
- # C.g:623:25: ( '0' .. '9' )*
- while True: #loop15
- alt15 = 2
- LA15_0 = self.input.LA(1)
-
- if ((u'0' <= LA15_0 <= u'9')) :
- alt15 = 1
-
-
- if alt15 == 1:
- # C.g:623:26: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- break #loop15
-
-
- # C.g:623:37: ( Exponent )?
- alt16 = 2
- LA16_0 = self.input.LA(1)
-
- if (LA16_0 == u'E' or LA16_0 == u'e') :
- alt16 = 1
- if alt16 == 1:
- # C.g:623:37: Exponent
- self.mExponent()
-
-
-
-
- # C.g:623:47: ( FloatTypeSuffix )?
- alt17 = 2
- LA17_0 = self.input.LA(1)
-
- if (LA17_0 == u'D' or LA17_0 == u'F' or LA17_0 == u'd' or LA17_0 == u'f') :
- alt17 = 1
- if alt17 == 1:
- # C.g:623:47: FloatTypeSuffix
- self.mFloatTypeSuffix()
-
-
-
-
-
-
- elif alt25 == 2:
- # C.g:624:9: '.' ( '0' .. '9' )+ ( Exponent )? ( FloatTypeSuffix )?
- self.match(u'.')
-
- # C.g:624:13: ( '0' .. '9' )+
- cnt18 = 0
- while True: #loop18
- alt18 = 2
- LA18_0 = self.input.LA(1)
-
- if ((u'0' <= LA18_0 <= u'9')) :
- alt18 = 1
-
-
- if alt18 == 1:
- # C.g:624:14: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- if cnt18 >= 1:
- break #loop18
-
- eee = EarlyExitException(18, self.input)
- raise eee
-
- cnt18 += 1
-
-
- # C.g:624:25: ( Exponent )?
- alt19 = 2
- LA19_0 = self.input.LA(1)
-
- if (LA19_0 == u'E' or LA19_0 == u'e') :
- alt19 = 1
- if alt19 == 1:
- # C.g:624:25: Exponent
- self.mExponent()
-
-
-
-
- # C.g:624:35: ( FloatTypeSuffix )?
- alt20 = 2
- LA20_0 = self.input.LA(1)
-
- if (LA20_0 == u'D' or LA20_0 == u'F' or LA20_0 == u'd' or LA20_0 == u'f') :
- alt20 = 1
- if alt20 == 1:
- # C.g:624:35: FloatTypeSuffix
- self.mFloatTypeSuffix()
-
-
-
-
-
-
- elif alt25 == 3:
- # C.g:625:9: ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )?
- # C.g:625:9: ( '0' .. '9' )+
- cnt21 = 0
- while True: #loop21
- alt21 = 2
- LA21_0 = self.input.LA(1)
-
- if ((u'0' <= LA21_0 <= u'9')) :
- alt21 = 1
-
-
- if alt21 == 1:
- # C.g:625:10: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- if cnt21 >= 1:
- break #loop21
-
- eee = EarlyExitException(21, self.input)
- raise eee
-
- cnt21 += 1
-
-
- self.mExponent()
-
- # C.g:625:30: ( FloatTypeSuffix )?
- alt22 = 2
- LA22_0 = self.input.LA(1)
-
- if (LA22_0 == u'D' or LA22_0 == u'F' or LA22_0 == u'd' or LA22_0 == u'f') :
- alt22 = 1
- if alt22 == 1:
- # C.g:625:30: FloatTypeSuffix
- self.mFloatTypeSuffix()
-
-
-
-
-
-
- elif alt25 == 4:
- # C.g:626:9: ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix
- # C.g:626:9: ( '0' .. '9' )+
- cnt23 = 0
- while True: #loop23
- alt23 = 2
- LA23_0 = self.input.LA(1)
-
- if ((u'0' <= LA23_0 <= u'9')) :
- alt23 = 1
-
-
- if alt23 == 1:
- # C.g:626:10: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- if cnt23 >= 1:
- break #loop23
-
- eee = EarlyExitException(23, self.input)
- raise eee
-
- cnt23 += 1
-
-
- # C.g:626:21: ( Exponent )?
- alt24 = 2
- LA24_0 = self.input.LA(1)
-
- if (LA24_0 == u'E' or LA24_0 == u'e') :
- alt24 = 1
- if alt24 == 1:
- # C.g:626:21: Exponent
- self.mExponent()
-
-
-
-
- self.mFloatTypeSuffix()
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end FLOATING_POINT_LITERAL
-
-
-
- # $ANTLR start Exponent
- def mExponent(self, ):
-
- try:
- # C.g:630:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
- # C.g:630:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
- if self.input.LA(1) == u'E' or self.input.LA(1) == u'e':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- # C.g:630:22: ( '+' | '-' )?
- alt26 = 2
- LA26_0 = self.input.LA(1)
-
- if (LA26_0 == u'+' or LA26_0 == u'-') :
- alt26 = 1
- if alt26 == 1:
- # C.g:
- if self.input.LA(1) == u'+' or self.input.LA(1) == u'-':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
- # C.g:630:33: ( '0' .. '9' )+
- cnt27 = 0
- while True: #loop27
- alt27 = 2
- LA27_0 = self.input.LA(1)
-
- if ((u'0' <= LA27_0 <= u'9')) :
- alt27 = 1
-
-
- if alt27 == 1:
- # C.g:630:34: '0' .. '9'
- self.matchRange(u'0', u'9')
-
-
-
- else:
- if cnt27 >= 1:
- break #loop27
-
- eee = EarlyExitException(27, self.input)
- raise eee
-
- cnt27 += 1
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end Exponent
-
-
-
- # $ANTLR start FloatTypeSuffix
- def mFloatTypeSuffix(self, ):
-
- try:
- # C.g:633:17: ( ( 'f' | 'F' | 'd' | 'D' ) )
- # C.g:633:19: ( 'f' | 'F' | 'd' | 'D' )
- if self.input.LA(1) == u'D' or self.input.LA(1) == u'F' or self.input.LA(1) == u'd' or self.input.LA(1) == u'f':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end FloatTypeSuffix
-
-
-
- # $ANTLR start EscapeSequence
- def mEscapeSequence(self, ):
-
- try:
- # C.g:637:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape )
- alt28 = 2
- LA28_0 = self.input.LA(1)
-
- if (LA28_0 == u'\\') :
- LA28_1 = self.input.LA(2)
-
- if (LA28_1 == u'"' or LA28_1 == u'\'' or LA28_1 == u'\\' or LA28_1 == u'b' or LA28_1 == u'f' or LA28_1 == u'n' or LA28_1 == u'r' or LA28_1 == u't') :
- alt28 = 1
- elif ((u'0' <= LA28_1 <= u'7')) :
- alt28 = 2
- else:
- nvae = NoViableAltException("635:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 28, 1, self.input)
-
- raise nvae
-
- else:
- nvae = NoViableAltException("635:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 28, 0, self.input)
-
- raise nvae
-
- if alt28 == 1:
- # C.g:637:8: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
- self.match(u'\\')
-
- if self.input.LA(1) == u'"' or self.input.LA(1) == u'\'' or self.input.LA(1) == u'\\' or self.input.LA(1) == u'b' or self.input.LA(1) == u'f' or self.input.LA(1) == u'n' or self.input.LA(1) == u'r' or self.input.LA(1) == u't':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- elif alt28 == 2:
- # C.g:638:9: OctalEscape
- self.mOctalEscape()
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end EscapeSequence
-
-
-
- # $ANTLR start OctalEscape
- def mOctalEscape(self, ):
-
- try:
- # C.g:643:5: ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) )
- alt29 = 3
- LA29_0 = self.input.LA(1)
-
- if (LA29_0 == u'\\') :
- LA29_1 = self.input.LA(2)
-
- if ((u'0' <= LA29_1 <= u'3')) :
- LA29_2 = self.input.LA(3)
-
- if ((u'0' <= LA29_2 <= u'7')) :
- LA29_4 = self.input.LA(4)
-
- if ((u'0' <= LA29_4 <= u'7')) :
- alt29 = 1
- else:
- alt29 = 2
- else:
- alt29 = 3
- elif ((u'4' <= LA29_1 <= u'7')) :
- LA29_3 = self.input.LA(3)
-
- if ((u'0' <= LA29_3 <= u'7')) :
- alt29 = 2
- else:
- alt29 = 3
- else:
- nvae = NoViableAltException("641:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 29, 1, self.input)
-
- raise nvae
-
- else:
- nvae = NoViableAltException("641:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 29, 0, self.input)
-
- raise nvae
-
- if alt29 == 1:
- # C.g:643:9: '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' )
- self.match(u'\\')
-
- # C.g:643:14: ( '0' .. '3' )
- # C.g:643:15: '0' .. '3'
- self.matchRange(u'0', u'3')
-
-
-
-
- # C.g:643:25: ( '0' .. '7' )
- # C.g:643:26: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
-
- # C.g:643:36: ( '0' .. '7' )
- # C.g:643:37: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
-
-
-
- elif alt29 == 2:
- # C.g:644:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )
- self.match(u'\\')
-
- # C.g:644:14: ( '0' .. '7' )
- # C.g:644:15: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
-
- # C.g:644:25: ( '0' .. '7' )
- # C.g:644:26: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
-
-
-
- elif alt29 == 3:
- # C.g:645:9: '\\\\' ( '0' .. '7' )
- self.match(u'\\')
-
- # C.g:645:14: ( '0' .. '7' )
- # C.g:645:15: '0' .. '7'
- self.matchRange(u'0', u'7')
-
-
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end OctalEscape
-
-
-
- # $ANTLR start UnicodeEscape
- def mUnicodeEscape(self, ):
-
- try:
- # C.g:650:5: ( '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit )
- # C.g:650:9: '\\\\' 'u' HexDigit HexDigit HexDigit HexDigit
- self.match(u'\\')
-
- self.match(u'u')
-
- self.mHexDigit()
-
- self.mHexDigit()
-
- self.mHexDigit()
-
- self.mHexDigit()
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end UnicodeEscape
-
-
-
- # $ANTLR start WS
- def mWS(self, ):
-
- try:
- self.type = WS
-
- # C.g:653:5: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) )
- # C.g:653:8: ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' )
- if (u'\t' <= self.input.LA(1) <= u'\n') or (u'\f' <= self.input.LA(1) <= u'\r') or self.input.LA(1) == u' ':
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
- #action start
- self.channel=HIDDEN;
- #action end
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end WS
-
-
-
- # $ANTLR start BS
- def mBS(self, ):
-
- try:
- self.type = BS
-
- # C.g:657:5: ( ( '\\\\' ) )
- # C.g:657:7: ( '\\\\' )
- # C.g:657:7: ( '\\\\' )
- # C.g:657:8: '\\\\'
- self.match(u'\\')
-
-
-
-
- #action start
- self.channel=HIDDEN;
- #action end
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end BS
-
-
-
- # $ANTLR start UnicodeVocabulary
- def mUnicodeVocabulary(self, ):
-
- try:
- self.type = UnicodeVocabulary
-
- # C.g:665:5: ( '\\u0003' .. '\\uFFFE' )
- # C.g:665:7: '\\u0003' .. '\\uFFFE'
- self.matchRange(u'\u0003', u'\uFFFE')
-
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end UnicodeVocabulary
-
-
-
- # $ANTLR start COMMENT
- def mCOMMENT(self, ):
-
- try:
- self.type = COMMENT
-
- # C.g:668:5: ( '/*' ( options {greedy=false; } : . )* '*/' )
- # C.g:668:9: '/*' ( options {greedy=false; } : . )* '*/'
- self.match("/*")
-
-
- # C.g:668:14: ( options {greedy=false; } : . )*
- while True: #loop30
- alt30 = 2
- LA30_0 = self.input.LA(1)
-
- if (LA30_0 == u'*') :
- LA30_1 = self.input.LA(2)
-
- if (LA30_1 == u'/') :
- alt30 = 2
- elif ((u'\u0000' <= LA30_1 <= u'.') or (u'0' <= LA30_1 <= u'\uFFFE')) :
- alt30 = 1
-
-
- elif ((u'\u0000' <= LA30_0 <= u')') or (u'+' <= LA30_0 <= u'\uFFFE')) :
- alt30 = 1
-
-
- if alt30 == 1:
- # C.g:668:42: .
- self.matchAny()
-
-
-
- else:
- break #loop30
-
-
- self.match("*/")
-
-
- #action start
- self.channel=HIDDEN;
- #action end
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end COMMENT
-
-
-
- # $ANTLR start LINE_COMMENT
- def mLINE_COMMENT(self, ):
-
- try:
- self.type = LINE_COMMENT
-
- # C.g:673:5: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
- # C.g:673:7: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
- self.match("//")
-
-
- # C.g:673:12: (~ ( '\\n' | '\\r' ) )*
- while True: #loop31
- alt31 = 2
- LA31_0 = self.input.LA(1)
-
- if ((u'\u0000' <= LA31_0 <= u'\t') or (u'\u000B' <= LA31_0 <= u'\f') or (u'\u000E' <= LA31_0 <= u'\uFFFE')) :
- alt31 = 1
-
-
- if alt31 == 1:
- # C.g:673:12: ~ ( '\\n' | '\\r' )
- if (u'\u0000' <= self.input.LA(1) <= u'\t') or (u'\u000B' <= self.input.LA(1) <= u'\f') or (u'\u000E' <= self.input.LA(1) <= u'\uFFFE'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- else:
- break #loop31
-
-
- # C.g:673:26: ( '\\r' )?
- alt32 = 2
- LA32_0 = self.input.LA(1)
-
- if (LA32_0 == u'\r') :
- alt32 = 1
- if alt32 == 1:
- # C.g:673:26: '\\r'
- self.match(u'\r')
-
-
-
-
- self.match(u'\n')
-
- #action start
- self.channel=HIDDEN;
- #action end
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end LINE_COMMENT
-
-
-
- # $ANTLR start LINE_COMMAND
- def mLINE_COMMAND(self, ):
-
- try:
- self.type = LINE_COMMAND
-
- # C.g:678:5: ( '#' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
- # C.g:678:7: '#' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
- self.match(u'#')
-
- # C.g:678:11: (~ ( '\\n' | '\\r' ) )*
- while True: #loop33
- alt33 = 2
- LA33_0 = self.input.LA(1)
-
- if ((u'\u0000' <= LA33_0 <= u'\t') or (u'\u000B' <= LA33_0 <= u'\f') or (u'\u000E' <= LA33_0 <= u'\uFFFE')) :
- alt33 = 1
-
-
- if alt33 == 1:
- # C.g:678:11: ~ ( '\\n' | '\\r' )
- if (u'\u0000' <= self.input.LA(1) <= u'\t') or (u'\u000B' <= self.input.LA(1) <= u'\f') or (u'\u000E' <= self.input.LA(1) <= u'\uFFFE'):
- self.input.consume();
-
- else:
- mse = MismatchedSetException(None, self.input)
- self.recover(mse)
- raise mse
-
-
-
-
- else:
- break #loop33
-
-
- # C.g:678:25: ( '\\r' )?
- alt34 = 2
- LA34_0 = self.input.LA(1)
-
- if (LA34_0 == u'\r') :
- alt34 = 1
- if alt34 == 1:
- # C.g:678:25: '\\r'
- self.match(u'\r')
-
-
-
-
- self.match(u'\n')
-
- #action start
- self.channel=HIDDEN;
- #action end
-
-
-
-
- finally:
-
- pass
-
- # $ANTLR end LINE_COMMAND
-
-
-
- def mTokens(self):
- # C.g:1:8: ( T25 | T26 | T27 | T28 | T29 | T30 | T31 | T32 | T33 | T34 | T35 | T36 | T37 | T38 | T39 | T40 | T41 | T42 | T43 | T44 | T45 | T46 | T47 | T48 | T49 | T50 | T51 | T52 | T53 | T54 | T55 | T56 | T57 | T58 | T59 | T60 | T61 | T62 | T63 | T64 | T65 | T66 | T67 | T68 | T69 | T70 | T71 | T72 | T73 | T74 | T75 | T76 | T77 | T78 | T79 | T80 | T81 | T82 | T83 | T84 | T85 | T86 | T87 | T88 | T89 | T90 | T91 | T92 | T93 | T94 | T95 | T96 | T97 | T98 | T99 | T100 | T101 | T102 | T103 | T104 | T105 | T106 | T107 | T108 | T109 | T110 | T111 | T112 | T113 | T114 | T115 | T116 | T117 | IDENTIFIER | CHARACTER_LITERAL | STRING_LITERAL | HEX_LITERAL | DECIMAL_LITERAL | OCTAL_LITERAL | FLOATING_POINT_LITERAL | WS | BS | UnicodeVocabulary | COMMENT | LINE_COMMENT | LINE_COMMAND )
- alt35 = 106
- alt35 = self.dfa35.predict(self.input)
- if alt35 == 1:
- # C.g:1:10: T25
- self.mT25()
-
-
-
- elif alt35 == 2:
- # C.g:1:14: T26
- self.mT26()
-
-
-
- elif alt35 == 3:
- # C.g:1:18: T27
- self.mT27()
-
-
-
- elif alt35 == 4:
- # C.g:1:22: T28
- self.mT28()
-
-
-
- elif alt35 == 5:
- # C.g:1:26: T29
- self.mT29()
-
-
-
- elif alt35 == 6:
- # C.g:1:30: T30
- self.mT30()
-
-
-
- elif alt35 == 7:
- # C.g:1:34: T31
- self.mT31()
-
-
-
- elif alt35 == 8:
- # C.g:1:38: T32
- self.mT32()
-
-
-
- elif alt35 == 9:
- # C.g:1:42: T33
- self.mT33()
-
-
-
- elif alt35 == 10:
- # C.g:1:46: T34
- self.mT34()
-
-
-
- elif alt35 == 11:
- # C.g:1:50: T35
- self.mT35()
-
-
-
- elif alt35 == 12:
- # C.g:1:54: T36
- self.mT36()
-
-
-
- elif alt35 == 13:
- # C.g:1:58: T37
- self.mT37()
-
-
-
- elif alt35 == 14:
- # C.g:1:62: T38
- self.mT38()
-
-
-
- elif alt35 == 15:
- # C.g:1:66: T39
- self.mT39()
-
-
-
- elif alt35 == 16:
- # C.g:1:70: T40
- self.mT40()
-
-
-
- elif alt35 == 17:
- # C.g:1:74: T41
- self.mT41()
-
-
-
- elif alt35 == 18:
- # C.g:1:78: T42
- self.mT42()
-
-
-
- elif alt35 == 19:
- # C.g:1:82: T43
- self.mT43()
-
-
-
- elif alt35 == 20:
- # C.g:1:86: T44
- self.mT44()
-
-
-
- elif alt35 == 21:
- # C.g:1:90: T45
- self.mT45()
-
-
-
- elif alt35 == 22:
- # C.g:1:94: T46
- self.mT46()
-
-
-
- elif alt35 == 23:
- # C.g:1:98: T47
- self.mT47()
-
-
-
- elif alt35 == 24:
- # C.g:1:102: T48
- self.mT48()
-
-
-
- elif alt35 == 25:
- # C.g:1:106: T49
- self.mT49()
-
-
-
- elif alt35 == 26:
- # C.g:1:110: T50
- self.mT50()
-
-
-
- elif alt35 == 27:
- # C.g:1:114: T51
- self.mT51()
-
-
-
- elif alt35 == 28:
- # C.g:1:118: T52
- self.mT52()
-
-
-
- elif alt35 == 29:
- # C.g:1:122: T53
- self.mT53()
-
-
-
- elif alt35 == 30:
- # C.g:1:126: T54
- self.mT54()
-
-
-
- elif alt35 == 31:
- # C.g:1:130: T55
- self.mT55()
-
-
-
- elif alt35 == 32:
- # C.g:1:134: T56
- self.mT56()
-
-
-
- elif alt35 == 33:
- # C.g:1:138: T57
- self.mT57()
-
-
-
- elif alt35 == 34:
- # C.g:1:142: T58
- self.mT58()
-
-
-
- elif alt35 == 35:
- # C.g:1:146: T59
- self.mT59()
-
-
-
- elif alt35 == 36:
- # C.g:1:150: T60
- self.mT60()
-
-
-
- elif alt35 == 37:
- # C.g:1:154: T61
- self.mT61()
-
-
-
- elif alt35 == 38:
- # C.g:1:158: T62
- self.mT62()
-
-
-
- elif alt35 == 39:
- # C.g:1:162: T63
- self.mT63()
-
-
-
- elif alt35 == 40:
- # C.g:1:166: T64
- self.mT64()
-
-
-
- elif alt35 == 41:
- # C.g:1:170: T65
- self.mT65()
-
-
-
- elif alt35 == 42:
- # C.g:1:174: T66
- self.mT66()
-
-
-
- elif alt35 == 43:
- # C.g:1:178: T67
- self.mT67()
-
-
-
- elif alt35 == 44:
- # C.g:1:182: T68
- self.mT68()
-
-
-
- elif alt35 == 45:
- # C.g:1:186: T69
- self.mT69()
-
-
-
- elif alt35 == 46:
- # C.g:1:190: T70
- self.mT70()
-
-
-
- elif alt35 == 47:
- # C.g:1:194: T71
- self.mT71()
-
-
-
- elif alt35 == 48:
- # C.g:1:198: T72
- self.mT72()
-
-
-
- elif alt35 == 49:
- # C.g:1:202: T73
- self.mT73()
-
-
-
- elif alt35 == 50:
- # C.g:1:206: T74
- self.mT74()
-
-
-
- elif alt35 == 51:
- # C.g:1:210: T75
- self.mT75()
-
-
-
- elif alt35 == 52:
- # C.g:1:214: T76
- self.mT76()
-
-
-
- elif alt35 == 53:
- # C.g:1:218: T77
- self.mT77()
-
-
-
- elif alt35 == 54:
- # C.g:1:222: T78
- self.mT78()
-
-
-
- elif alt35 == 55:
- # C.g:1:226: T79
- self.mT79()
-
-
-
- elif alt35 == 56:
- # C.g:1:230: T80
- self.mT80()
-
-
-
- elif alt35 == 57:
- # C.g:1:234: T81
- self.mT81()
-
-
-
- elif alt35 == 58:
- # C.g:1:238: T82
- self.mT82()
-
-
-
- elif alt35 == 59:
- # C.g:1:242: T83
- self.mT83()
-
-
-
- elif alt35 == 60:
- # C.g:1:246: T84
- self.mT84()
-
-
-
- elif alt35 == 61:
- # C.g:1:250: T85
- self.mT85()
-
-
-
- elif alt35 == 62:
- # C.g:1:254: T86
- self.mT86()
-
-
-
- elif alt35 == 63:
- # C.g:1:258: T87
- self.mT87()
-
-
-
- elif alt35 == 64:
- # C.g:1:262: T88
- self.mT88()
-
-
-
- elif alt35 == 65:
- # C.g:1:266: T89
- self.mT89()
-
-
-
- elif alt35 == 66:
- # C.g:1:270: T90
- self.mT90()
-
-
-
- elif alt35 == 67:
- # C.g:1:274: T91
- self.mT91()
-
-
-
- elif alt35 == 68:
- # C.g:1:278: T92
- self.mT92()
-
-
-
- elif alt35 == 69:
- # C.g:1:282: T93
- self.mT93()
-
-
-
- elif alt35 == 70:
- # C.g:1:286: T94
- self.mT94()
-
-
-
- elif alt35 == 71:
- # C.g:1:290: T95
- self.mT95()
-
-
-
- elif alt35 == 72:
- # C.g:1:294: T96
- self.mT96()
-
-
-
- elif alt35 == 73:
- # C.g:1:298: T97
- self.mT97()
-
-
-
- elif alt35 == 74:
- # C.g:1:302: T98
- self.mT98()
-
-
-
- elif alt35 == 75:
- # C.g:1:306: T99
- self.mT99()
-
-
-
- elif alt35 == 76:
- # C.g:1:310: T100
- self.mT100()
-
-
-
- elif alt35 == 77:
- # C.g:1:315: T101
- self.mT101()
-
-
-
- elif alt35 == 78:
- # C.g:1:320: T102
- self.mT102()
-
-
-
- elif alt35 == 79:
- # C.g:1:325: T103
- self.mT103()
-
-
-
- elif alt35 == 80:
- # C.g:1:330: T104
- self.mT104()
-
-
-
- elif alt35 == 81:
- # C.g:1:335: T105
- self.mT105()
-
-
-
- elif alt35 == 82:
- # C.g:1:340: T106
- self.mT106()
-
-
-
- elif alt35 == 83:
- # C.g:1:345: T107
- self.mT107()
-
-
-
- elif alt35 == 84:
- # C.g:1:350: T108
- self.mT108()
-
-
-
- elif alt35 == 85:
- # C.g:1:355: T109
- self.mT109()
-
-
-
- elif alt35 == 86:
- # C.g:1:360: T110
- self.mT110()
-
-
-
- elif alt35 == 87:
- # C.g:1:365: T111
- self.mT111()
-
-
-
- elif alt35 == 88:
- # C.g:1:370: T112
- self.mT112()
-
-
-
- elif alt35 == 89:
- # C.g:1:375: T113
- self.mT113()
-
-
-
- elif alt35 == 90:
- # C.g:1:380: T114
- self.mT114()
-
-
-
- elif alt35 == 91:
- # C.g:1:385: T115
- self.mT115()
-
-
-
- elif alt35 == 92:
- # C.g:1:390: T116
- self.mT116()
-
-
-
- elif alt35 == 93:
- # C.g:1:395: T117
- self.mT117()
-
-
-
- elif alt35 == 94:
- # C.g:1:400: IDENTIFIER
- self.mIDENTIFIER()
-
-
-
- elif alt35 == 95:
- # C.g:1:411: CHARACTER_LITERAL
- self.mCHARACTER_LITERAL()
-
-
-
- elif alt35 == 96:
- # C.g:1:429: STRING_LITERAL
- self.mSTRING_LITERAL()
-
-
-
- elif alt35 == 97:
- # C.g:1:444: HEX_LITERAL
- self.mHEX_LITERAL()
-
-
-
- elif alt35 == 98:
- # C.g:1:456: DECIMAL_LITERAL
- self.mDECIMAL_LITERAL()
-
-
-
- elif alt35 == 99:
- # C.g:1:472: OCTAL_LITERAL
- self.mOCTAL_LITERAL()
-
-
-
- elif alt35 == 100:
- # C.g:1:486: FLOATING_POINT_LITERAL
- self.mFLOATING_POINT_LITERAL()
-
-
-
- elif alt35 == 101:
- # C.g:1:509: WS
- self.mWS()
-
-
-
- elif alt35 == 102:
- # C.g:1:512: BS
- self.mBS()
-
-
-
- elif alt35 == 103:
- # C.g:1:515: UnicodeVocabulary
- self.mUnicodeVocabulary()
-
-
-
- elif alt35 == 104:
- # C.g:1:533: COMMENT
- self.mCOMMENT()
-
-
-
- elif alt35 == 105:
- # C.g:1:541: LINE_COMMENT
- self.mLINE_COMMENT()
-
-
-
- elif alt35 == 106:
- # C.g:1:554: LINE_COMMAND
- self.mLINE_COMMAND()
-
-
-
-
-
-
-
-
- # lookup tables for DFA #25
-
- DFA25_eot = DFA.unpack(
- u"\7\uffff\1\10\2\uffff"
- )
-
- DFA25_eof = DFA.unpack(
- u"\12\uffff"
- )
-
- DFA25_min = DFA.unpack(
- u"\2\56\2\uffff\1\53\1\uffff\2\60\2\uffff"
- )
-
- DFA25_max = DFA.unpack(
- u"\1\71\1\146\2\uffff\1\71\1\uffff\1\71\1\146\2\uffff"
- )
-
- DFA25_accept = DFA.unpack(
- u"\2\uffff\1\2\1\1\1\uffff\1\4\2\uffff\2\3"
- )
-
- DFA25_special = DFA.unpack(
- u"\12\uffff"
- )
-
-
- DFA25_transition = [
- DFA.unpack(u"\1\2\1\uffff\12\1"),
- DFA.unpack(u"\1\3\1\uffff\12\1\12\uffff\1\5\1\4\1\5\35\uffff\1\5"
- u"\1\4\1\5"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\6\1\uffff\1\6\2\uffff\12\7"),
- DFA.unpack(u""),
- DFA.unpack(u"\12\7"),
- DFA.unpack(u"\12\7\12\uffff\1\11\1\uffff\1\11\35\uffff\1\11\1\uffff"
- u"\1\11"),
- DFA.unpack(u""),
- DFA.unpack(u"")
- ]
-
- # class definition for DFA #25
-
- DFA25 = DFA
- # lookup tables for DFA #35
-
- DFA35_eot = DFA.unpack(
- u"\2\uffff\1\76\1\uffff\1\101\14\76\3\uffff\10\76\4\uffff\1\151\1"
- u"\153\1\157\1\163\1\167\1\171\1\174\1\uffff\1\177\1\u0082\1\u0085"
- u"\1\u0087\1\u008a\1\uffff\5\76\1\uffff\2\73\2\u0095\2\uffff\1\73"
- u"\2\uffff\1\76\4\uffff\16\76\1\u00ad\5\76\1\u00b4\1\76\3\uffff\1"
- u"\u00b7\10\76\34\uffff\1\u00c1\2\uffff\1\u00c3\10\uffff\5\76\3\uffff"
- u"\1\u00c9\1\uffff\1\u0095\3\uffff\23\76\1\uffff\1\u00de\1\76\1\u00e0"
- u"\3\76\1\uffff\2\76\1\uffff\1\76\1\u00e7\6\76\4\uffff\5\76\1\uffff"
- u"\1\76\1\u00f5\1\76\1\u00f7\6\76\1\u00fe\4\76\1\u0103\1\u0104\2"
- u"\76\1\u0107\1\uffff\1\u0108\1\uffff\6\76\1\uffff\10\76\1\u0118"
- u"\1\76\1\u011a\2\76\1\uffff\1\76\1\uffff\5\76\1\u0123\1\uffff\4"
- u"\76\2\uffff\1\76\1\u0129\2\uffff\1\u012a\3\76\1\u012e\1\76\1\u0130"
- u"\7\76\1\u0139\1\uffff\1\u013a\1\uffff\1\u013b\1\76\1\u013d\1\u013e"
- u"\1\u013f\1\u0140\1\u0141\1\u0142\1\uffff\1\76\1\u0144\1\u0145\2"
- u"\76\2\uffff\1\76\1\u0149\1\76\1\uffff\1\76\1\uffff\5\76\1\u0151"
- u"\1\u0152\1\76\3\uffff\1\u0154\6\uffff\1\76\2\uffff\2\76\1\u0158"
- u"\1\uffff\7\76\2\uffff\1\u0160\1\uffff\1\u0161\1\u0162\1\u0163\1"
- u"\uffff\1\u0164\1\u0165\1\76\1\u0167\3\76\6\uffff\1\u016b\1\uffff"
- u"\3\76\1\uffff\21\76\1\u0180\2\76\1\uffff\3\76\1\u0186\1\76\1\uffff"
- u"\11\76\1\u0191\1\uffff"
- )
-
- DFA35_eof = DFA.unpack(
- u"\u0192\uffff"
- )
-
- DFA35_min = DFA.unpack(
- u"\1\3\1\uffff\1\171\1\uffff\1\75\1\154\1\150\1\165\1\145\1\124\1"
- u"\157\1\141\1\146\1\157\1\154\1\145\1\156\3\uffff\1\116\1\120\1"
- u"\117\1\116\1\117\1\114\1\106\1\101\4\uffff\1\75\1\56\1\53\1\55"
- u"\1\52\1\75\1\46\1\uffff\1\75\1\74\3\75\1\uffff\1\137\1\150\1\157"
- u"\1\162\1\42\1\uffff\2\0\2\56\2\uffff\1\0\2\uffff\1\160\4\uffff"
- u"\1\163\1\164\1\165\1\151\1\141\1\147\1\157\1\164\1\147\1\101\1"
- u"\151\1\163\1\156\1\141\1\44\1\164\1\156\1\162\1\157\1\146\1\44"
- u"\1\151\3\uffff\1\44\2\124\1\116\1\101\1\114\1\117\1\111\1\103\34"
- u"\uffff\1\75\2\uffff\1\75\10\uffff\1\141\1\163\1\151\1\164\1\145"
- u"\3\uffff\1\56\1\uffff\1\56\3\uffff\3\145\1\155\2\164\1\165\1\145"
- u"\1\156\1\162\1\157\1\151\1\165\1\124\1\141\1\144\1\145\1\163\1"
- u"\162\1\uffff\1\44\1\147\1\44\2\141\1\142\1\uffff\1\151\1\157\1"
- u"\uffff\1\111\1\44\1\123\1\114\1\101\1\102\1\101\1\113\4\uffff\1"
- u"\163\1\155\1\154\1\157\1\141\1\uffff\1\144\1\44\1\162\1\44\1\143"
- u"\1\151\1\143\1\157\1\145\1\164\1\44\1\163\1\162\1\111\1\164\2\44"
- u"\1\151\1\164\1\44\1\uffff\1\44\1\uffff\1\164\1\165\1\154\1\147"
- u"\1\156\1\117\1\uffff\1\124\1\111\1\124\1\101\1\102\1\120\1\105"
- u"\1\155\1\44\1\145\1\44\1\153\1\145\1\uffff\1\156\1\uffff\1\150"
- u"\1\143\1\164\1\146\1\144\1\44\1\uffff\1\164\1\156\1\103\1\151\2"
- u"\uffff\1\156\1\44\2\uffff\1\44\1\154\1\145\1\156\1\44\1\116\1\44"
- u"\1\107\1\111\1\114\1\125\1\117\1\111\1\104\1\44\1\uffff\1\44\1"
- u"\uffff\1\44\1\146\6\44\1\uffff\1\145\2\44\1\154\1\165\2\uffff\1"
- u"\164\1\44\1\145\1\uffff\1\101\1\uffff\1\116\1\114\1\137\1\116\1"
- u"\117\2\44\1\137\3\uffff\1\44\6\uffff\1\162\2\uffff\2\145\1\44\1"
- u"\uffff\1\144\1\114\2\105\1\122\2\124\2\uffff\1\44\1\uffff\3\44"
- u"\1\uffff\2\44\1\104\1\44\1\105\1\111\1\123\6\uffff\1\44\1\uffff"
- u"\2\115\1\105\1\uffff\1\117\1\105\1\122\1\126\1\123\1\126\2\105"
- u"\1\111\1\137\1\122\1\103\1\111\1\126\1\105\1\106\1\111\1\44\1\137"
- u"\1\103\1\uffff\1\125\1\105\1\116\1\44\1\122\1\uffff\1\105\1\106"
- u"\1\105\1\122\1\105\1\116\1\103\1\105\1\104\1\44\1\uffff"
- )
-
- DFA35_max = DFA.unpack(
- u"\1\ufffe\1\uffff\1\171\1\uffff\1\75\1\170\1\167\1\165\1\145\1\124"
- u"\2\157\1\156\3\157\1\156\3\uffff\1\116\1\125\1\117\1\116\1\117"
- u"\1\114\1\106\1\101\4\uffff\1\75\1\71\1\75\1\76\3\75\1\uffff\2\75"
- u"\1\76\1\75\1\174\1\uffff\1\141\1\150\1\157\1\162\1\47\1\uffff\2"
- u"\ufffe\1\170\1\146\2\uffff\1\ufffe\2\uffff\1\160\4\uffff\1\163"
- u"\1\164\1\165\1\151\1\162\1\172\1\157\2\164\1\101\1\154\1\163\1"
- u"\156\1\141\1\172\1\164\1\156\1\162\1\157\1\146\1\172\1\163\3\uffff"
- u"\1\172\2\124\1\116\1\101\1\114\1\117\1\111\1\103\34\uffff\1\75"
- u"\2\uffff\1\75\10\uffff\1\141\1\163\1\151\1\164\1\145\3\uffff\1"
- u"\146\1\uffff\1\146\3\uffff\3\145\1\155\2\164\1\165\1\145\1\156"
- u"\1\162\1\157\1\151\1\165\1\124\1\141\1\144\1\145\1\164\1\162\1"
- u"\uffff\1\172\1\147\1\172\2\141\1\142\1\uffff\1\151\1\157\1\uffff"
- u"\1\111\1\172\1\123\1\114\1\101\1\102\1\137\1\113\4\uffff\1\163"
- u"\1\155\1\154\1\157\1\141\1\uffff\1\144\1\172\1\162\1\172\1\143"
- u"\1\151\1\143\1\157\1\145\1\164\1\172\1\163\1\162\1\111\1\164\2"
- u"\172\1\151\1\164\1\172\1\uffff\1\172\1\uffff\1\164\1\165\1\154"
- u"\1\147\1\156\1\117\1\uffff\1\124\1\111\1\124\1\101\1\122\1\120"
- u"\1\105\1\155\1\172\1\145\1\172\1\153\1\145\1\uffff\1\156\1\uffff"
- u"\1\150\1\143\1\164\1\146\1\144\1\172\1\uffff\1\164\1\156\1\103"
- u"\1\151\2\uffff\1\156\1\172\2\uffff\1\172\1\154\1\145\1\156\1\172"
- u"\1\116\1\172\1\107\1\111\1\114\1\125\1\117\1\111\1\104\1\172\1"
- u"\uffff\1\172\1\uffff\1\172\1\146\6\172\1\uffff\1\145\2\172\1\154"
- u"\1\165\2\uffff\1\164\1\172\1\145\1\uffff\1\101\1\uffff\1\116\1"
- u"\114\1\137\1\116\1\117\2\172\1\137\3\uffff\1\172\6\uffff\1\162"
- u"\2\uffff\2\145\1\172\1\uffff\1\144\1\114\2\105\1\122\2\124\2\uffff"
- u"\1\172\1\uffff\3\172\1\uffff\2\172\1\104\1\172\1\105\1\111\1\123"
- u"\6\uffff\1\172\1\uffff\2\115\1\105\1\uffff\1\117\1\105\1\122\1"
- u"\126\1\123\1\126\2\105\1\111\1\137\1\122\1\103\1\111\1\126\1\105"
- u"\1\106\1\111\1\172\1\137\1\103\1\uffff\1\125\1\105\1\116\1\172"
- u"\1\122\1\uffff\1\105\1\106\1\105\1\122\1\105\1\116\1\103\1\105"
- u"\1\104\1\172\1\uffff"
- )
-
- DFA35_accept = DFA.unpack(
- u"\1\uffff\1\1\1\uffff\1\3\15\uffff\1\23\1\24\1\27\10\uffff\1\46"
- u"\1\47\1\50\1\51\7\uffff\1\66\5\uffff\1\102\5\uffff\1\136\4\uffff"
- u"\1\145\1\146\1\uffff\1\147\1\1\1\uffff\1\136\1\3\1\107\1\4\26\uffff"
- u"\1\23\1\24\1\27\11\uffff\1\46\1\47\1\50\1\51\1\70\1\52\1\53\1\63"
- u"\1\144\1\73\1\60\1\54\1\74\1\64\1\61\1\55\1\150\1\151\1\71\1\56"
- u"\1\72\1\57\1\77\1\104\1\65\1\66\1\110\1\67\1\uffff\1\113\1\111"
- u"\1\uffff\1\114\1\112\1\100\1\106\1\103\1\101\1\105\1\102\5\uffff"
- u"\1\140\1\137\1\141\1\uffff\1\142\1\uffff\1\145\1\146\1\152\23\uffff"
- u"\1\124\6\uffff\1\130\2\uffff\1\33\10\uffff\1\75\1\115\1\76\1\116"
- u"\5\uffff\1\143\24\uffff\1\15\1\uffff\1\131\6\uffff\1\34\15\uffff"
- u"\1\125\1\uffff\1\30\6\uffff\1\7\4\uffff\1\12\1\122\2\uffff\1\13"
- u"\1\16\17\uffff\1\120\1\uffff\1\132\10\uffff\1\14\5\uffff\1\31\1"
- u"\17\3\uffff\1\26\1\uffff\1\36\10\uffff\1\121\1\127\1\134\1\uffff"
- u"\1\5\1\126\1\6\1\25\1\62\1\21\1\uffff\1\135\1\11\3\uffff\1\20\7"
- u"\uffff\1\42\1\45\1\uffff\1\2\3\uffff\1\123\7\uffff\1\117\1\10\1"
- u"\32\1\133\1\22\1\35\1\uffff\1\40\3\uffff\1\37\24\uffff\1\43\5\uffff"
- u"\1\44\12\uffff\1\41"
- )
-
- DFA35_special = DFA.unpack(
- u"\u0192\uffff"
- )
-
-
- DFA35_transition = [
- DFA.unpack(u"\6\73\2\70\1\73\2\70\22\73\1\70\1\50\1\65\1\72\1\63"
- u"\1\45\1\46\1\64\1\34\1\35\1\40\1\42\1\3\1\43\1\41\1\44\1\66\11"
- u"\67\1\23\1\1\1\51\1\4\1\52\1\55\1\73\2\63\1\26\1\63\1\32\1\63\1"
- u"\31\1\63\1\24\2\63\1\62\2\63\1\25\1\33\2\63\1\11\1\63\1\27\1\30"
- u"\4\63\1\36\1\71\1\37\1\53\1\56\1\73\1\7\1\61\1\13\1\17\1\5\1\16"
- u"\1\60\1\63\1\14\2\63\1\15\5\63\1\10\1\6\1\2\1\20\1\12\1\57\3\63"
- u"\1\21\1\54\1\22\1\47\uff80\73"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\75"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\100"),
- DFA.unpack(u"\1\102\1\uffff\1\104\11\uffff\1\103"),
- DFA.unpack(u"\1\110\1\107\12\uffff\1\106\2\uffff\1\105"),
- DFA.unpack(u"\1\111"),
- DFA.unpack(u"\1\112"),
- DFA.unpack(u"\1\113"),
- DFA.unpack(u"\1\114"),
- DFA.unpack(u"\1\115\6\uffff\1\117\6\uffff\1\116"),
- DFA.unpack(u"\1\120\7\uffff\1\121"),
- DFA.unpack(u"\1\122"),
- DFA.unpack(u"\1\124\2\uffff\1\123"),
- DFA.unpack(u"\1\125\11\uffff\1\126"),
- DFA.unpack(u"\1\127"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\133"),
- DFA.unpack(u"\1\134\4\uffff\1\135"),
- DFA.unpack(u"\1\136"),
- DFA.unpack(u"\1\137"),
- DFA.unpack(u"\1\140"),
- DFA.unpack(u"\1\141"),
- DFA.unpack(u"\1\142"),
- DFA.unpack(u"\1\143"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\150"),
- DFA.unpack(u"\1\152\1\uffff\12\154"),
- DFA.unpack(u"\1\156\21\uffff\1\155"),
- DFA.unpack(u"\1\162\17\uffff\1\160\1\161"),
- DFA.unpack(u"\1\164\4\uffff\1\165\15\uffff\1\166"),
- DFA.unpack(u"\1\170"),
- DFA.unpack(u"\1\173\26\uffff\1\172"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\176"),
- DFA.unpack(u"\1\u0080\1\u0081"),
- DFA.unpack(u"\1\u0084\1\u0083"),
- DFA.unpack(u"\1\u0086"),
- DFA.unpack(u"\1\u0089\76\uffff\1\u0088"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u008c\1\uffff\1\u008d"),
- DFA.unpack(u"\1\u008e"),
- DFA.unpack(u"\1\u008f"),
- DFA.unpack(u"\1\u0090"),
- DFA.unpack(u"\1\u0091\4\uffff\1\u0092"),
- DFA.unpack(u""),
- DFA.unpack(u"\47\u0092\1\uffff\uffd7\u0092"),
- DFA.unpack(u"\uffff\u0091"),
- DFA.unpack(u"\1\154\1\uffff\10\u0094\2\154\12\uffff\3\154\21\uffff"
- u"\1\u0093\13\uffff\3\154\21\uffff\1\u0093"),
- DFA.unpack(u"\1\154\1\uffff\12\u0096\12\uffff\3\154\35\uffff\3\154"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\uffff\u0099"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u009a"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u009b"),
- DFA.unpack(u"\1\u009c"),
- DFA.unpack(u"\1\u009d"),
- DFA.unpack(u"\1\u009e"),
- DFA.unpack(u"\1\u009f\20\uffff\1\u00a0"),
- DFA.unpack(u"\1\u00a2\22\uffff\1\u00a1"),
- DFA.unpack(u"\1\u00a3"),
- DFA.unpack(u"\1\u00a4"),
- DFA.unpack(u"\1\u00a5\14\uffff\1\u00a6"),
- DFA.unpack(u"\1\u00a7"),
- DFA.unpack(u"\1\u00a9\2\uffff\1\u00a8"),
- DFA.unpack(u"\1\u00aa"),
- DFA.unpack(u"\1\u00ab"),
- DFA.unpack(u"\1\u00ac"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00ae"),
- DFA.unpack(u"\1\u00af"),
- DFA.unpack(u"\1\u00b0"),
- DFA.unpack(u"\1\u00b1"),
- DFA.unpack(u"\1\u00b2"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\24\76\1\u00b3\5\76"),
- DFA.unpack(u"\1\u00b6\11\uffff\1\u00b5"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00b8"),
- DFA.unpack(u"\1\u00b9"),
- DFA.unpack(u"\1\u00ba"),
- DFA.unpack(u"\1\u00bb"),
- DFA.unpack(u"\1\u00bc"),
- DFA.unpack(u"\1\u00bd"),
- DFA.unpack(u"\1\u00be"),
- DFA.unpack(u"\1\u00bf"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00c0"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00c2"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00c4"),
- DFA.unpack(u"\1\u00c5"),
- DFA.unpack(u"\1\u00c6"),
- DFA.unpack(u"\1\u00c7"),
- DFA.unpack(u"\1\u00c8"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\154\1\uffff\10\u0094\2\154\12\uffff\3\154\35\uffff"
- u"\3\154"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\154\1\uffff\12\u0096\12\uffff\3\154\35\uffff\3\154"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00ca"),
- DFA.unpack(u"\1\u00cb"),
- DFA.unpack(u"\1\u00cc"),
- DFA.unpack(u"\1\u00cd"),
- DFA.unpack(u"\1\u00ce"),
- DFA.unpack(u"\1\u00cf"),
- DFA.unpack(u"\1\u00d0"),
- DFA.unpack(u"\1\u00d1"),
- DFA.unpack(u"\1\u00d2"),
- DFA.unpack(u"\1\u00d3"),
- DFA.unpack(u"\1\u00d4"),
- DFA.unpack(u"\1\u00d5"),
- DFA.unpack(u"\1\u00d6"),
- DFA.unpack(u"\1\u00d7"),
- DFA.unpack(u"\1\u00d8"),
- DFA.unpack(u"\1\u00d9"),
- DFA.unpack(u"\1\u00da"),
- DFA.unpack(u"\1\u00dc\1\u00db"),
- DFA.unpack(u"\1\u00dd"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00df"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00e1"),
- DFA.unpack(u"\1\u00e2"),
- DFA.unpack(u"\1\u00e3"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00e4"),
- DFA.unpack(u"\1\u00e5"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00e6"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00e8"),
- DFA.unpack(u"\1\u00e9"),
- DFA.unpack(u"\1\u00ea"),
- DFA.unpack(u"\1\u00eb"),
- DFA.unpack(u"\1\u00ed\35\uffff\1\u00ec"),
- DFA.unpack(u"\1\u00ee"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00ef"),
- DFA.unpack(u"\1\u00f0"),
- DFA.unpack(u"\1\u00f1"),
- DFA.unpack(u"\1\u00f2"),
- DFA.unpack(u"\1\u00f3"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u00f4"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00f6"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00f8"),
- DFA.unpack(u"\1\u00f9"),
- DFA.unpack(u"\1\u00fa"),
- DFA.unpack(u"\1\u00fb"),
- DFA.unpack(u"\1\u00fc"),
- DFA.unpack(u"\1\u00fd"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u00ff"),
- DFA.unpack(u"\1\u0100"),
- DFA.unpack(u"\1\u0101"),
- DFA.unpack(u"\1\u0102"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0105"),
- DFA.unpack(u"\1\u0106"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0109"),
- DFA.unpack(u"\1\u010a"),
- DFA.unpack(u"\1\u010b"),
- DFA.unpack(u"\1\u010c"),
- DFA.unpack(u"\1\u010d"),
- DFA.unpack(u"\1\u010e"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u010f"),
- DFA.unpack(u"\1\u0110"),
- DFA.unpack(u"\1\u0111"),
- DFA.unpack(u"\1\u0112"),
- DFA.unpack(u"\1\u0114\17\uffff\1\u0113"),
- DFA.unpack(u"\1\u0115"),
- DFA.unpack(u"\1\u0116"),
- DFA.unpack(u"\1\u0117"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0119"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u011b"),
- DFA.unpack(u"\1\u011c"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u011d"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u011e"),
- DFA.unpack(u"\1\u011f"),
- DFA.unpack(u"\1\u0120"),
- DFA.unpack(u"\1\u0121"),
- DFA.unpack(u"\1\u0122"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0124"),
- DFA.unpack(u"\1\u0125"),
- DFA.unpack(u"\1\u0126"),
- DFA.unpack(u"\1\u0127"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0128"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u012b"),
- DFA.unpack(u"\1\u012c"),
- DFA.unpack(u"\1\u012d"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u012f"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0131"),
- DFA.unpack(u"\1\u0132"),
- DFA.unpack(u"\1\u0133"),
- DFA.unpack(u"\1\u0134"),
- DFA.unpack(u"\1\u0135"),
- DFA.unpack(u"\1\u0136"),
- DFA.unpack(u"\1\u0137"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\u0138\1"
- u"\uffff\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u013c"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0143"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0146"),
- DFA.unpack(u"\1\u0147"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0148"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u014a"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u014b"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u014c"),
- DFA.unpack(u"\1\u014d"),
- DFA.unpack(u"\1\u014e"),
- DFA.unpack(u"\1\u014f"),
- DFA.unpack(u"\1\u0150"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0153"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0155"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0156"),
- DFA.unpack(u"\1\u0157"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0159"),
- DFA.unpack(u"\1\u015a"),
- DFA.unpack(u"\1\u015b"),
- DFA.unpack(u"\1\u015c"),
- DFA.unpack(u"\1\u015d"),
- DFA.unpack(u"\1\u015e"),
- DFA.unpack(u"\1\u015f"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0166"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0168"),
- DFA.unpack(u"\1\u0169"),
- DFA.unpack(u"\1\u016a"),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u""),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u016c"),
- DFA.unpack(u"\1\u016d"),
- DFA.unpack(u"\1\u016e"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u016f"),
- DFA.unpack(u"\1\u0170"),
- DFA.unpack(u"\1\u0171"),
- DFA.unpack(u"\1\u0172"),
- DFA.unpack(u"\1\u0173"),
- DFA.unpack(u"\1\u0174"),
- DFA.unpack(u"\1\u0175"),
- DFA.unpack(u"\1\u0176"),
- DFA.unpack(u"\1\u0177"),
- DFA.unpack(u"\1\u0178"),
- DFA.unpack(u"\1\u0179"),
- DFA.unpack(u"\1\u017a"),
- DFA.unpack(u"\1\u017b"),
- DFA.unpack(u"\1\u017c"),
- DFA.unpack(u"\1\u017d"),
- DFA.unpack(u"\1\u017e"),
- DFA.unpack(u"\1\u017f"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0181"),
- DFA.unpack(u"\1\u0182"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0183"),
- DFA.unpack(u"\1\u0184"),
- DFA.unpack(u"\1\u0185"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"\1\u0187"),
- DFA.unpack(u""),
- DFA.unpack(u"\1\u0188"),
- DFA.unpack(u"\1\u0189"),
- DFA.unpack(u"\1\u018a"),
- DFA.unpack(u"\1\u018b"),
- DFA.unpack(u"\1\u018c"),
- DFA.unpack(u"\1\u018d"),
- DFA.unpack(u"\1\u018e"),
- DFA.unpack(u"\1\u018f"),
- DFA.unpack(u"\1\u0190"),
- DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uffff"
- u"\32\76"),
- DFA.unpack(u"")
- ]
-
- # class definition for DFA #35
-
- DFA35 = DFA
-
-
diff --git a/BaseTools/Source/Python/Eot/CParser.py b/BaseTools/Source/Python/Eot/CParser.py
deleted file mode 100644
index 511d429f26..0000000000
--- a/BaseTools/Source/Python/Eot/CParser.py
+++ /dev/null
@@ -1,18844 +0,0 @@
-# $ANTLR 3.0.1 C.g 2010-02-23 09:58:53
-
-from antlr3 import *
-from antlr3.compat import set, frozenset
-
-## @file
-# The file defines the parser for C source files.
-#
-# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
-# This file is generated by running:
-# java org.antlr.Tool C.g
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at:
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-import CodeFragment
-import FileProfile
-
-
-
-# for convenience in actions
-HIDDEN = BaseRecognizer.HIDDEN
-
-# token types
-BS=20
-LINE_COMMENT=23
-FloatTypeSuffix=16
-IntegerTypeSuffix=14
-LETTER=11
-OCTAL_LITERAL=6
-CHARACTER_LITERAL=8
-Exponent=15
-EOF=-1
-HexDigit=13
-STRING_LITERAL=9
-WS=19
-FLOATING_POINT_LITERAL=10
-IDENTIFIER=4
-UnicodeEscape=18
-LINE_COMMAND=24
-UnicodeVocabulary=21
-HEX_LITERAL=5
-COMMENT=22
-DECIMAL_LITERAL=7
-EscapeSequence=12
-OctalEscape=17
-
-# token names
-tokenNames = [
- "<invalid>", "<EOR>", "<DOWN>", "<UP>",
- "IDENTIFIER", "HEX_LITERAL", "OCTAL_LITERAL", "DECIMAL_LITERAL", "CHARACTER_LITERAL",
- "STRING_LITERAL", "FLOATING_POINT_LITERAL", "LETTER", "EscapeSequence",
- "HexDigit", "IntegerTypeSuffix", "Exponent", "FloatTypeSuffix", "OctalEscape",
- "UnicodeEscape", "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COMMENT",
- "LINE_COMMAND", "';'", "'typedef'", "','", "'='", "'extern'", "'static'",
- "'auto'", "'register'", "'STATIC'", "'void'", "'char'", "'short'", "'int'",
- "'long'", "'float'", "'double'", "'signed'", "'unsigned'", "'{'", "'}'",
- "'struct'", "'union'", "':'", "'enum'", "'const'", "'volatile'", "'IN'",
- "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'", "'VOLATILE'", "'GLOBAL_REMOVE_IF_UNREFERENCED'",
- "'EFIAPI'", "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED'",
- "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'", "'-'", "'/'", "'%'",
- "'++'", "'--'", "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*='",
- "'/='", "'%='", "'+='", "'-='", "'<<='", "'>>='", "'&='", "'^='", "'|='",
- "'?'", "'||'", "'&&'", "'|'", "'^'", "'=='", "'!='", "'<'", "'>'", "'<='",
- "'>='", "'<<'", "'>>'", "'__asm__'", "'_asm'", "'__asm'", "'case'",
- "'default'", "'if'", "'else'", "'switch'", "'while'", "'do'", "'for'",
- "'goto'", "'continue'", "'break'", "'return'"
-]
-
-
-class function_definition_scope(object):
- def __init__(self):
- self.ModifierText = None
- self.DeclText = None
- self.LBLine = None
- self.LBOffset = None
- self.DeclLine = None
- self.DeclOffset = None
-class postfix_expression_scope(object):
- def __init__(self):
- self.FuncCallText = None
-
-
-class CParser(Parser):
- grammarFileName = "C.g"
- tokenNames = tokenNames
-
- def __init__(self, input):
- Parser.__init__(self, input)
- self.ruleMemo = {}
-
- self.function_definition_stack = []
- self.postfix_expression_stack = []
-
-
-
-
-
-
-
-
- def printTokenInfo(self, line, offset, tokenText):
- print str(line)+ ',' + str(offset) + ':' + str(tokenText)
-
- def StorePredicateExpression(self, StartLine, StartOffset, EndLine, EndOffset, Text):
- PredExp = CodeFragment.PredicateExpression(Text, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.PredicateExpressionList.append(PredExp)
-
- def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):
- EnumDef = CodeFragment.EnumerationDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.EnumerationDefinitionList.append(EnumDef)
-
- def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, Text):
- SUDef = CodeFragment.StructUnionDefinition(Text, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.StructUnionDefinitionList.append(SUDef)
-
- def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndOffset, FromText, ToText):
- Tdef = CodeFragment.TypedefDefinition(FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.TypedefDefinitionList.append(Tdef)
-
- def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, DeclOffset):
- FuncDef = CodeFragment.FunctionDefinition(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLine, DeclOffset))
- FileProfile.FunctionDefinitionList.append(FuncDef)
-
- def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText):
- VarDecl = CodeFragment.VariableDeclaration(ModifierText, DeclText, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.VariableDeclarationList.append(VarDecl)
-
- def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOffset, FuncName, ParamList):
- FuncCall = CodeFragment.FunctionCalling(FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOffset))
- FileProfile.FunctionCallingList.append(FuncCall)
-
-
-
-
- # $ANTLR start translation_unit
- # C.g:102:1: translation_unit : ( external_declaration )* ;
- def translation_unit(self, ):
-
- translation_unit_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 1):
- return
-
- # C.g:103:2: ( ( external_declaration )* )
- # C.g:103:4: ( external_declaration )*
- # C.g:103:4: ( external_declaration )*
- while True: #loop1
- alt1 = 2
- LA1_0 = self.input.LA(1)
-
- if (LA1_0 == IDENTIFIER or LA1_0 == 26 or (29 <= LA1_0 <= 42) or (45 <= LA1_0 <= 46) or (48 <= LA1_0 <= 62) or LA1_0 == 66) :
- alt1 = 1
-
-
- if alt1 == 1:
- # C.g:0:0: external_declaration
- self.following.append(self.FOLLOW_external_declaration_in_translation_unit74)
- self.external_declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop1
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 1, translation_unit_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end translation_unit
-
-
- # $ANTLR start external_declaration
- # C.g:114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );
- def external_declaration(self, ):
-
- external_declaration_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 2):
- return
-
- # C.g:119:2: ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? )
- alt3 = 3
- LA3_0 = self.input.LA(1)
-
- if ((29 <= LA3_0 <= 33)) :
- LA3_1 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 1, self.input)
-
- raise nvae
-
- elif (LA3_0 == 34) :
- LA3_2 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 2, self.input)
-
- raise nvae
-
- elif (LA3_0 == 35) :
- LA3_3 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 3, self.input)
-
- raise nvae
-
- elif (LA3_0 == 36) :
- LA3_4 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 4, self.input)
-
- raise nvae
-
- elif (LA3_0 == 37) :
- LA3_5 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 5, self.input)
-
- raise nvae
-
- elif (LA3_0 == 38) :
- LA3_6 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 6, self.input)
-
- raise nvae
-
- elif (LA3_0 == 39) :
- LA3_7 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 7, self.input)
-
- raise nvae
-
- elif (LA3_0 == 40) :
- LA3_8 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 8, self.input)
-
- raise nvae
-
- elif (LA3_0 == 41) :
- LA3_9 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 9, self.input)
-
- raise nvae
-
- elif (LA3_0 == 42) :
- LA3_10 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 10, self.input)
-
- raise nvae
-
- elif ((45 <= LA3_0 <= 46)) :
- LA3_11 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 11, self.input)
-
- raise nvae
-
- elif (LA3_0 == 48) :
- LA3_12 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 12, self.input)
-
- raise nvae
-
- elif (LA3_0 == IDENTIFIER) :
- LA3_13 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- elif (True) :
- alt3 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 13, self.input)
-
- raise nvae
-
- elif (LA3_0 == 58) :
- LA3_14 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 14, self.input)
-
- raise nvae
-
- elif (LA3_0 == 66) and (self.synpred4()):
- alt3 = 1
- elif (LA3_0 == 59) :
- LA3_16 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 16, self.input)
-
- raise nvae
-
- elif (LA3_0 == 60) :
- LA3_17 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 17, self.input)
-
- raise nvae
-
- elif ((49 <= LA3_0 <= 57) or LA3_0 == 61) :
- LA3_18 = self.input.LA(2)
-
- if (self.synpred4()) :
- alt3 = 1
- elif (self.synpred5()) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 18, self.input)
-
- raise nvae
-
- elif (LA3_0 == 62) and (self.synpred4()):
- alt3 = 1
- elif (LA3_0 == 26) :
- alt3 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("114:1: external_declaration options {k=1; } : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition | declaration | macro_statement ( ';' )? );", 3, 0, self.input)
-
- raise nvae
-
- if alt3 == 1:
- # C.g:119:4: ( ( declaration_specifiers )? declarator ( declaration )* '{' )=> function_definition
- self.following.append(self.FOLLOW_function_definition_in_external_declaration113)
- self.function_definition()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt3 == 2:
- # C.g:120:4: declaration
- self.following.append(self.FOLLOW_declaration_in_external_declaration118)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt3 == 3:
- # C.g:121:4: macro_statement ( ';' )?
- self.following.append(self.FOLLOW_macro_statement_in_external_declaration123)
- self.macro_statement()
- self.following.pop()
- if self.failed:
- return
- # C.g:121:20: ( ';' )?
- alt2 = 2
- LA2_0 = self.input.LA(1)
-
- if (LA2_0 == 25) :
- alt2 = 1
- if alt2 == 1:
- # C.g:121:21: ';'
- self.match(self.input, 25, self.FOLLOW_25_in_external_declaration126)
- if self.failed:
- return
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 2, external_declaration_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end external_declaration
-
- class function_definition_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start function_definition
- # C.g:126:1: function_definition : (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement ) ;
- def function_definition(self, ):
- self.function_definition_stack.append(function_definition_scope())
- retval = self.function_definition_return()
- retval.start = self.input.LT(1)
- function_definition_StartIndex = self.input.index()
- d = None
-
- a = None
-
- b = None
-
- declarator1 = None
-
-
-
- self.function_definition_stack[-1].ModifierText = ''
- self.function_definition_stack[-1].DeclText = ''
- self.function_definition_stack[-1].LBLine = 0
- self.function_definition_stack[-1].LBOffset = 0
- self.function_definition_stack[-1].DeclLine = 0
- self.function_definition_stack[-1].DeclOffset = 0
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 3):
- return retval
-
- # C.g:146:2: ( (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement ) )
- # C.g:146:4: (d= declaration_specifiers )? declarator ( ( declaration )+ a= compound_statement | b= compound_statement )
- # C.g:146:5: (d= declaration_specifiers )?
- alt4 = 2
- LA4 = self.input.LA(1)
- if LA4 == 29 or LA4 == 30 or LA4 == 31 or LA4 == 32 or LA4 == 33 or LA4 == 34 or LA4 == 35 or LA4 == 36 or LA4 == 37 or LA4 == 38 or LA4 == 39 or LA4 == 40 or LA4 == 41 or LA4 == 42 or LA4 == 45 or LA4 == 46 or LA4 == 48 or LA4 == 49 or LA4 == 50 or LA4 == 51 or LA4 == 52 or LA4 == 53 or LA4 == 54 or LA4 == 55 or LA4 == 56 or LA4 == 57 or LA4 == 61:
- alt4 = 1
- elif LA4 == IDENTIFIER:
- LA4 = self.input.LA(2)
- if LA4 == 66:
- alt4 = 1
- elif LA4 == 58:
- LA4_21 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 59:
- LA4_22 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 60:
- LA4_23 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == IDENTIFIER:
- LA4_24 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 62:
- LA4_25 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 29 or LA4 == 30 or LA4 == 31 or LA4 == 32 or LA4 == 33:
- LA4_26 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 34:
- LA4_27 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 35:
- LA4_28 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 36:
- LA4_29 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 37:
- LA4_30 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 38:
- LA4_31 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 39:
- LA4_32 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 40:
- LA4_33 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 41:
- LA4_34 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 42:
- LA4_35 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 45 or LA4 == 46:
- LA4_36 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 48:
- LA4_37 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 49 or LA4 == 50 or LA4 == 51 or LA4 == 52 or LA4 == 53 or LA4 == 54 or LA4 == 55 or LA4 == 56 or LA4 == 57 or LA4 == 61:
- LA4_38 = self.input.LA(3)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 58:
- LA4_14 = self.input.LA(2)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 59:
- LA4_16 = self.input.LA(2)
-
- if (self.synpred7()) :
- alt4 = 1
- elif LA4 == 60:
- LA4_17 = self.input.LA(2)
-
- if (self.synpred7()) :
- alt4 = 1
- if alt4 == 1:
- # C.g:0:0: d= declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_function_definition157)
- d = self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return retval
-
-
-
- self.following.append(self.FOLLOW_declarator_in_function_definition160)
- declarator1 = self.declarator()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:147:3: ( ( declaration )+ a= compound_statement | b= compound_statement )
- alt6 = 2
- LA6_0 = self.input.LA(1)
-
- if (LA6_0 == IDENTIFIER or LA6_0 == 26 or (29 <= LA6_0 <= 42) or (45 <= LA6_0 <= 46) or (48 <= LA6_0 <= 61)) :
- alt6 = 1
- elif (LA6_0 == 43) :
- alt6 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("147:3: ( ( declaration )+ a= compound_statement | b= compound_statement )", 6, 0, self.input)
-
- raise nvae
-
- if alt6 == 1:
- # C.g:147:5: ( declaration )+ a= compound_statement
- # C.g:147:5: ( declaration )+
- cnt5 = 0
- while True: #loop5
- alt5 = 2
- LA5_0 = self.input.LA(1)
-
- if (LA5_0 == IDENTIFIER or LA5_0 == 26 or (29 <= LA5_0 <= 42) or (45 <= LA5_0 <= 46) or (48 <= LA5_0 <= 61)) :
- alt5 = 1
-
-
- if alt5 == 1:
- # C.g:0:0: declaration
- self.following.append(self.FOLLOW_declaration_in_function_definition166)
- self.declaration()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- if cnt5 >= 1:
- break #loop5
-
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- eee = EarlyExitException(5, self.input)
- raise eee
-
- cnt5 += 1
-
-
- self.following.append(self.FOLLOW_compound_statement_in_function_definition171)
- a = self.compound_statement()
- self.following.pop()
- if self.failed:
- return retval
-
-
- elif alt6 == 2:
- # C.g:148:5: b= compound_statement
- self.following.append(self.FOLLOW_compound_statement_in_function_definition180)
- b = self.compound_statement()
- self.following.pop()
- if self.failed:
- return retval
-
-
-
- if self.backtracking == 0:
-
- if d != None:
- self.function_definition_stack[-1].ModifierText = self.input.toString(d.start,d.stop)
- else:
- self.function_definition_stack[-1].ModifierText = ''
- self.function_definition_stack[-1].DeclText = self.input.toString(declarator1.start,declarator1.stop)
- self.function_definition_stack[-1].DeclLine = declarator1.start.line
- self.function_definition_stack[-1].DeclOffset = declarator1.start.charPositionInLine
- if a != None:
- self.function_definition_stack[-1].LBLine = a.start.line
- self.function_definition_stack[-1].LBOffset = a.start.charPositionInLine
- else:
- self.function_definition_stack[-1].LBLine = b.start.line
- self.function_definition_stack[-1].LBOffset = b.start.charPositionInLine
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
- if self.backtracking == 0:
-
- self.StoreFunctionDefinition(retval.start.line, retval.start.charPositionInLine, retval.stop.line, retval.stop.charPositionInLine, self.function_definition_stack[-1].ModifierText, self.function_definition_stack[-1].DeclText, self.function_definition_stack[-1].LBLine, self.function_definition_stack[-1].LBOffset, self.function_definition_stack[-1].DeclLine, self.function_definition_stack[-1].DeclOffset)
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 3, function_definition_StartIndex)
-
- self.function_definition_stack.pop()
- pass
-
- return retval
-
- # $ANTLR end function_definition
-
-
- # $ANTLR start declaration
- # C.g:166:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );
- def declaration(self, ):
-
- declaration_StartIndex = self.input.index()
- a = None
- d = None
- e = None
- b = None
-
- c = None
-
- s = None
-
- t = None
-
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 4):
- return
-
- # C.g:167:2: (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' )
- alt9 = 2
- LA9_0 = self.input.LA(1)
-
- if (LA9_0 == 26) :
- alt9 = 1
- elif (LA9_0 == IDENTIFIER or (29 <= LA9_0 <= 42) or (45 <= LA9_0 <= 46) or (48 <= LA9_0 <= 61)) :
- alt9 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("166:1: declaration : (a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';' | s= declaration_specifiers (t= init_declarator_list )? e= ';' );", 9, 0, self.input)
-
- raise nvae
-
- if alt9 == 1:
- # C.g:167:4: a= 'typedef' (b= declaration_specifiers )? c= init_declarator_list d= ';'
- a = self.input.LT(1)
- self.match(self.input, 26, self.FOLLOW_26_in_declaration203)
- if self.failed:
- return
- # C.g:167:17: (b= declaration_specifiers )?
- alt7 = 2
- LA7 = self.input.LA(1)
- if LA7 == 29 or LA7 == 30 or LA7 == 31 or LA7 == 32 or LA7 == 33 or LA7 == 34 or LA7 == 35 or LA7 == 36 or LA7 == 37 or LA7 == 38 or LA7 == 39 or LA7 == 40 or LA7 == 41 or LA7 == 42 or LA7 == 45 or LA7 == 46 or LA7 == 48 or LA7 == 49 or LA7 == 50 or LA7 == 51 or LA7 == 52 or LA7 == 53 or LA7 == 54 or LA7 == 55 or LA7 == 56 or LA7 == 57 or LA7 == 61:
- alt7 = 1
- elif LA7 == IDENTIFIER:
- LA7_13 = self.input.LA(2)
-
- if (LA7_13 == 62) :
- LA7_21 = self.input.LA(3)
-
- if (self.synpred10()) :
- alt7 = 1
- elif (LA7_13 == IDENTIFIER or (29 <= LA7_13 <= 42) or (45 <= LA7_13 <= 46) or (48 <= LA7_13 <= 61) or LA7_13 == 66) :
- alt7 = 1
- elif LA7 == 58:
- LA7_14 = self.input.LA(2)
-
- if (self.synpred10()) :
- alt7 = 1
- elif LA7 == 59:
- LA7_16 = self.input.LA(2)
-
- if (self.synpred10()) :
- alt7 = 1
- elif LA7 == 60:
- LA7_17 = self.input.LA(2)
-
- if (self.synpred10()) :
- alt7 = 1
- if alt7 == 1:
- # C.g:0:0: b= declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_declaration207)
- b = self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_init_declarator_list_in_declaration216)
- c = self.init_declarator_list()
- self.following.pop()
- if self.failed:
- return
- d = self.input.LT(1)
- self.match(self.input, 25, self.FOLLOW_25_in_declaration220)
- if self.failed:
- return
- if self.backtracking == 0:
-
- if b != None:
- self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, self.input.toString(b.start,b.stop), self.input.toString(c.start,c.stop))
- else:
- self.StoreTypedefDefinition(a.line, a.charPositionInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start,c.stop))
-
-
-
-
- elif alt9 == 2:
- # C.g:175:4: s= declaration_specifiers (t= init_declarator_list )? e= ';'
- self.following.append(self.FOLLOW_declaration_specifiers_in_declaration234)
- s = self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
- # C.g:175:30: (t= init_declarator_list )?
- alt8 = 2
- LA8_0 = self.input.LA(1)
-
- if (LA8_0 == IDENTIFIER or (58 <= LA8_0 <= 60) or LA8_0 == 62 or LA8_0 == 66) :
- alt8 = 1
- if alt8 == 1:
- # C.g:0:0: t= init_declarator_list
- self.following.append(self.FOLLOW_init_declarator_list_in_declaration238)
- t = self.init_declarator_list()
- self.following.pop()
- if self.failed:
- return
-
-
-
- e = self.input.LT(1)
- self.match(self.input, 25, self.FOLLOW_25_in_declaration243)
- if self.failed:
- return
- if self.backtracking == 0:
-
- if t != None:
- self.StoreVariableDeclaration(s.start.line, s.start.charPositionInLine, t.start.line, t.start.charPositionInLine, self.input.toString(s.start,s.stop), self.input.toString(t.start,t.stop))
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 4, declaration_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end declaration
-
- class declaration_specifiers_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start declaration_specifiers
- # C.g:182:1: declaration_specifiers : ( storage_class_specifier | type_specifier | type_qualifier )+ ;
- def declaration_specifiers(self, ):
-
- retval = self.declaration_specifiers_return()
- retval.start = self.input.LT(1)
- declaration_specifiers_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 5):
- return retval
-
- # C.g:183:2: ( ( storage_class_specifier | type_specifier | type_qualifier )+ )
- # C.g:183:6: ( storage_class_specifier | type_specifier | type_qualifier )+
- # C.g:183:6: ( storage_class_specifier | type_specifier | type_qualifier )+
- cnt10 = 0
- while True: #loop10
- alt10 = 4
- LA10 = self.input.LA(1)
- if LA10 == 58:
- LA10_2 = self.input.LA(2)
-
- if (self.synpred15()) :
- alt10 = 3
-
-
- elif LA10 == 59:
- LA10_3 = self.input.LA(2)
-
- if (self.synpred15()) :
- alt10 = 3
-
-
- elif LA10 == 60:
- LA10_4 = self.input.LA(2)
-
- if (self.synpred15()) :
- alt10 = 3
-
-
- elif LA10 == IDENTIFIER:
- LA10_5 = self.input.LA(2)
-
- if (self.synpred14()) :
- alt10 = 2
-
-
- elif LA10 == 53:
- LA10_9 = self.input.LA(2)
-
- if (self.synpred15()) :
- alt10 = 3
-
-
- elif LA10 == 29 or LA10 == 30 or LA10 == 31 or LA10 == 32 or LA10 == 33:
- alt10 = 1
- elif LA10 == 34 or LA10 == 35 or LA10 == 36 or LA10 == 37 or LA10 == 38 or LA10 == 39 or LA10 == 40 or LA10 == 41 or LA10 == 42 or LA10 == 45 or LA10 == 46 or LA10 == 48:
- alt10 = 2
- elif LA10 == 49 or LA10 == 50 or LA10 == 51 or LA10 == 52 or LA10 == 54 or LA10 == 55 or LA10 == 56 or LA10 == 57 or LA10 == 61:
- alt10 = 3
-
- if alt10 == 1:
- # C.g:183:10: storage_class_specifier
- self.following.append(self.FOLLOW_storage_class_specifier_in_declaration_specifiers264)
- self.storage_class_specifier()
- self.following.pop()
- if self.failed:
- return retval
-
-
- elif alt10 == 2:
- # C.g:184:7: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_declaration_specifiers272)
- self.type_specifier()
- self.following.pop()
- if self.failed:
- return retval
-
-
- elif alt10 == 3:
- # C.g:185:13: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_declaration_specifiers286)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- if cnt10 >= 1:
- break #loop10
-
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- eee = EarlyExitException(10, self.input)
- raise eee
-
- cnt10 += 1
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 5, declaration_specifiers_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end declaration_specifiers
-
- class init_declarator_list_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start init_declarator_list
- # C.g:189:1: init_declarator_list : init_declarator ( ',' init_declarator )* ;
- def init_declarator_list(self, ):
-
- retval = self.init_declarator_list_return()
- retval.start = self.input.LT(1)
- init_declarator_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 6):
- return retval
-
- # C.g:190:2: ( init_declarator ( ',' init_declarator )* )
- # C.g:190:4: init_declarator ( ',' init_declarator )*
- self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list308)
- self.init_declarator()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:190:20: ( ',' init_declarator )*
- while True: #loop11
- alt11 = 2
- LA11_0 = self.input.LA(1)
-
- if (LA11_0 == 27) :
- alt11 = 1
-
-
- if alt11 == 1:
- # C.g:190:21: ',' init_declarator
- self.match(self.input, 27, self.FOLLOW_27_in_init_declarator_list311)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_init_declarator_in_init_declarator_list313)
- self.init_declarator()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- break #loop11
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 6, init_declarator_list_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end init_declarator_list
-
-
- # $ANTLR start init_declarator
- # C.g:193:1: init_declarator : declarator ( '=' initializer )? ;
- def init_declarator(self, ):
-
- init_declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 7):
- return
-
- # C.g:194:2: ( declarator ( '=' initializer )? )
- # C.g:194:4: declarator ( '=' initializer )?
- self.following.append(self.FOLLOW_declarator_in_init_declarator326)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
- # C.g:194:15: ( '=' initializer )?
- alt12 = 2
- LA12_0 = self.input.LA(1)
-
- if (LA12_0 == 28) :
- alt12 = 1
- if alt12 == 1:
- # C.g:194:16: '=' initializer
- self.match(self.input, 28, self.FOLLOW_28_in_init_declarator329)
- if self.failed:
- return
- self.following.append(self.FOLLOW_initializer_in_init_declarator331)
- self.initializer()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 7, init_declarator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end init_declarator
-
-
- # $ANTLR start storage_class_specifier
- # C.g:197:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' | 'register' | 'STATIC' );
- def storage_class_specifier(self, ):
-
- storage_class_specifier_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 8):
- return
-
- # C.g:198:2: ( 'extern' | 'static' | 'auto' | 'register' | 'STATIC' )
- # C.g:
- if (29 <= self.input.LA(1) <= 33):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_storage_class_specifier0
- )
- raise mse
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 8, storage_class_specifier_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end storage_class_specifier
-
-
- # $ANTLR start type_specifier
- # C.g:205:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id );
- def type_specifier(self, ):
-
- type_specifier_StartIndex = self.input.index()
- s = None
-
- e = None
-
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 9):
- return
-
- # C.g:206:2: ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id )
- alt13 = 12
- LA13_0 = self.input.LA(1)
-
- if (LA13_0 == 34) :
- alt13 = 1
- elif (LA13_0 == 35) :
- alt13 = 2
- elif (LA13_0 == 36) :
- alt13 = 3
- elif (LA13_0 == 37) :
- alt13 = 4
- elif (LA13_0 == 38) :
- alt13 = 5
- elif (LA13_0 == 39) :
- alt13 = 6
- elif (LA13_0 == 40) :
- alt13 = 7
- elif (LA13_0 == 41) :
- alt13 = 8
- elif (LA13_0 == 42) :
- alt13 = 9
- elif ((45 <= LA13_0 <= 46)) :
- alt13 = 10
- elif (LA13_0 == 48) :
- alt13 = 11
- elif (LA13_0 == IDENTIFIER) and (self.synpred34()):
- alt13 = 12
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("205:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s= struct_or_union_specifier | e= enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator )=> type_id );", 13, 0, self.input)
-
- raise nvae
-
- if alt13 == 1:
- # C.g:206:4: 'void'
- self.match(self.input, 34, self.FOLLOW_34_in_type_specifier376)
- if self.failed:
- return
-
-
- elif alt13 == 2:
- # C.g:207:4: 'char'
- self.match(self.input, 35, self.FOLLOW_35_in_type_specifier381)
- if self.failed:
- return
-
-
- elif alt13 == 3:
- # C.g:208:4: 'short'
- self.match(self.input, 36, self.FOLLOW_36_in_type_specifier386)
- if self.failed:
- return
-
-
- elif alt13 == 4:
- # C.g:209:4: 'int'
- self.match(self.input, 37, self.FOLLOW_37_in_type_specifier391)
- if self.failed:
- return
-
-
- elif alt13 == 5:
- # C.g:210:4: 'long'
- self.match(self.input, 38, self.FOLLOW_38_in_type_specifier396)
- if self.failed:
- return
-
-
- elif alt13 == 6:
- # C.g:211:4: 'float'
- self.match(self.input, 39, self.FOLLOW_39_in_type_specifier401)
- if self.failed:
- return
-
-
- elif alt13 == 7:
- # C.g:212:4: 'double'
- self.match(self.input, 40, self.FOLLOW_40_in_type_specifier406)
- if self.failed:
- return
-
-
- elif alt13 == 8:
- # C.g:213:4: 'signed'
- self.match(self.input, 41, self.FOLLOW_41_in_type_specifier411)
- if self.failed:
- return
-
-
- elif alt13 == 9:
- # C.g:214:4: 'unsigned'
- self.match(self.input, 42, self.FOLLOW_42_in_type_specifier416)
- if self.failed:
- return
-
-
- elif alt13 == 10:
- # C.g:215:4: s= struct_or_union_specifier
- self.following.append(self.FOLLOW_struct_or_union_specifier_in_type_specifier423)
- s = self.struct_or_union_specifier()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
-
- if s.stop != None:
- self.StoreStructUnionDefinition(s.start.line, s.start.charPositionInLine, s.stop.line, s.stop.charPositionInLine, self.input.toString(s.start,s.stop))
-
-
-
-
- elif alt13 == 11:
- # C.g:220:4: e= enum_specifier
- self.following.append(self.FOLLOW_enum_specifier_in_type_specifier433)
- e = self.enum_specifier()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
-
- if e.stop != None:
- self.StoreEnumerationDefinition(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
-
-
-
- elif alt13 == 12:
- # C.g:225:4: ( IDENTIFIER ( type_qualifier )* declarator )=> type_id
- self.following.append(self.FOLLOW_type_id_in_type_specifier451)
- self.type_id()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 9, type_specifier_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end type_specifier
-
-
- # $ANTLR start type_id
- # C.g:228:1: type_id : IDENTIFIER ;
- def type_id(self, ):
-
- type_id_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 10):
- return
-
- # C.g:229:5: ( IDENTIFIER )
- # C.g:229:9: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_type_id467)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 10, type_id_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end type_id
-
- class struct_or_union_specifier_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start struct_or_union_specifier
- # C.g:233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );
- def struct_or_union_specifier(self, ):
-
- retval = self.struct_or_union_specifier_return()
- retval.start = self.input.LT(1)
- struct_or_union_specifier_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 11):
- return retval
-
- # C.g:235:2: ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER )
- alt15 = 2
- LA15_0 = self.input.LA(1)
-
- if ((45 <= LA15_0 <= 46)) :
- LA15_1 = self.input.LA(2)
-
- if (LA15_1 == IDENTIFIER) :
- LA15_2 = self.input.LA(3)
-
- if (LA15_2 == 43) :
- alt15 = 1
- elif (LA15_2 == EOF or LA15_2 == IDENTIFIER or LA15_2 == 25 or LA15_2 == 27 or (29 <= LA15_2 <= 42) or (45 <= LA15_2 <= 64) or LA15_2 == 66) :
- alt15 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 2, self.input)
-
- raise nvae
-
- elif (LA15_1 == 43) :
- alt15 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 1, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("233:1: struct_or_union_specifier options {k=3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 0, self.input)
-
- raise nvae
-
- if alt15 == 1:
- # C.g:235:4: struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}'
- self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier494)
- self.struct_or_union()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:235:20: ( IDENTIFIER )?
- alt14 = 2
- LA14_0 = self.input.LA(1)
-
- if (LA14_0 == IDENTIFIER) :
- alt14 = 1
- if alt14 == 1:
- # C.g:0:0: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier496)
- if self.failed:
- return retval
-
-
-
- self.match(self.input, 43, self.FOLLOW_43_in_struct_or_union_specifier499)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_struct_declaration_list_in_struct_or_union_specifier501)
- self.struct_declaration_list()
- self.following.pop()
- if self.failed:
- return retval
- self.match(self.input, 44, self.FOLLOW_44_in_struct_or_union_specifier503)
- if self.failed:
- return retval
-
-
- elif alt15 == 2:
- # C.g:236:4: struct_or_union IDENTIFIER
- self.following.append(self.FOLLOW_struct_or_union_in_struct_or_union_specifier508)
- self.struct_or_union()
- self.following.pop()
- if self.failed:
- return retval
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_struct_or_union_specifier510)
- if self.failed:
- return retval
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 11, struct_or_union_specifier_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end struct_or_union_specifier
-
-
- # $ANTLR start struct_or_union
- # C.g:239:1: struct_or_union : ( 'struct' | 'union' );
- def struct_or_union(self, ):
-
- struct_or_union_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 12):
- return
-
- # C.g:240:2: ( 'struct' | 'union' )
- # C.g:
- if (45 <= self.input.LA(1) <= 46):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_struct_or_union0
- )
- raise mse
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 12, struct_or_union_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end struct_or_union
-
-
- # $ANTLR start struct_declaration_list
- # C.g:244:1: struct_declaration_list : ( struct_declaration )+ ;
- def struct_declaration_list(self, ):
-
- struct_declaration_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 13):
- return
-
- # C.g:245:2: ( ( struct_declaration )+ )
- # C.g:245:4: ( struct_declaration )+
- # C.g:245:4: ( struct_declaration )+
- cnt16 = 0
- while True: #loop16
- alt16 = 2
- LA16_0 = self.input.LA(1)
-
- if (LA16_0 == IDENTIFIER or (34 <= LA16_0 <= 42) or (45 <= LA16_0 <= 46) or (48 <= LA16_0 <= 61)) :
- alt16 = 1
-
-
- if alt16 == 1:
- # C.g:0:0: struct_declaration
- self.following.append(self.FOLLOW_struct_declaration_in_struct_declaration_list537)
- self.struct_declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt16 >= 1:
- break #loop16
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(16, self.input)
- raise eee
-
- cnt16 += 1
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 13, struct_declaration_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end struct_declaration_list
-
-
- # $ANTLR start struct_declaration
- # C.g:248:1: struct_declaration : specifier_qualifier_list struct_declarator_list ';' ;
- def struct_declaration(self, ):
-
- struct_declaration_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 14):
- return
-
- # C.g:249:2: ( specifier_qualifier_list struct_declarator_list ';' )
- # C.g:249:4: specifier_qualifier_list struct_declarator_list ';'
- self.following.append(self.FOLLOW_specifier_qualifier_list_in_struct_declaration549)
- self.specifier_qualifier_list()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_struct_declarator_list_in_struct_declaration551)
- self.struct_declarator_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_struct_declaration553)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 14, struct_declaration_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end struct_declaration
-
-
- # $ANTLR start specifier_qualifier_list
- # C.g:252:1: specifier_qualifier_list : ( type_qualifier | type_specifier )+ ;
- def specifier_qualifier_list(self, ):
-
- specifier_qualifier_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 15):
- return
-
- # C.g:253:2: ( ( type_qualifier | type_specifier )+ )
- # C.g:253:4: ( type_qualifier | type_specifier )+
- # C.g:253:4: ( type_qualifier | type_specifier )+
- cnt17 = 0
- while True: #loop17
- alt17 = 3
- LA17 = self.input.LA(1)
- if LA17 == 58:
- LA17_2 = self.input.LA(2)
-
- if (self.synpred39()) :
- alt17 = 1
-
-
- elif LA17 == 59:
- LA17_3 = self.input.LA(2)
-
- if (self.synpred39()) :
- alt17 = 1
-
-
- elif LA17 == 60:
- LA17_4 = self.input.LA(2)
-
- if (self.synpred39()) :
- alt17 = 1
-
-
- elif LA17 == IDENTIFIER:
- LA17 = self.input.LA(2)
- if LA17 == EOF or LA17 == IDENTIFIER or LA17 == 34 or LA17 == 35 or LA17 == 36 or LA17 == 37 or LA17 == 38 or LA17 == 39 or LA17 == 40 or LA17 == 41 or LA17 == 42 or LA17 == 45 or LA17 == 46 or LA17 == 48 or LA17 == 49 or LA17 == 50 or LA17 == 51 or LA17 == 52 or LA17 == 53 or LA17 == 54 or LA17 == 55 or LA17 == 56 or LA17 == 57 or LA17 == 58 or LA17 == 59 or LA17 == 60 or LA17 == 61 or LA17 == 63 or LA17 == 66:
- alt17 = 2
- elif LA17 == 62:
- LA17_94 = self.input.LA(3)
-
- if (self.synpred40()) :
- alt17 = 2
-
-
- elif LA17 == 47:
- LA17_95 = self.input.LA(3)
-
- if (self.synpred40()) :
- alt17 = 2
-
-
- elif LA17 == 64:
- LA17_96 = self.input.LA(3)
-
- if (self.synpred40()) :
- alt17 = 2
-
-
-
- elif LA17 == 49 or LA17 == 50 or LA17 == 51 or LA17 == 52 or LA17 == 53 or LA17 == 54 or LA17 == 55 or LA17 == 56 or LA17 == 57 or LA17 == 61:
- alt17 = 1
- elif LA17 == 34 or LA17 == 35 or LA17 == 36 or LA17 == 37 or LA17 == 38 or LA17 == 39 or LA17 == 40 or LA17 == 41 or LA17 == 42 or LA17 == 45 or LA17 == 46 or LA17 == 48:
- alt17 = 2
-
- if alt17 == 1:
- # C.g:253:6: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_specifier_qualifier_list566)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt17 == 2:
- # C.g:253:23: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_specifier_qualifier_list570)
- self.type_specifier()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt17 >= 1:
- break #loop17
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(17, self.input)
- raise eee
-
- cnt17 += 1
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 15, specifier_qualifier_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end specifier_qualifier_list
-
-
- # $ANTLR start struct_declarator_list
- # C.g:256:1: struct_declarator_list : struct_declarator ( ',' struct_declarator )* ;
- def struct_declarator_list(self, ):
-
- struct_declarator_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 16):
- return
-
- # C.g:257:2: ( struct_declarator ( ',' struct_declarator )* )
- # C.g:257:4: struct_declarator ( ',' struct_declarator )*
- self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list584)
- self.struct_declarator()
- self.following.pop()
- if self.failed:
- return
- # C.g:257:22: ( ',' struct_declarator )*
- while True: #loop18
- alt18 = 2
- LA18_0 = self.input.LA(1)
-
- if (LA18_0 == 27) :
- alt18 = 1
-
-
- if alt18 == 1:
- # C.g:257:23: ',' struct_declarator
- self.match(self.input, 27, self.FOLLOW_27_in_struct_declarator_list587)
- if self.failed:
- return
- self.following.append(self.FOLLOW_struct_declarator_in_struct_declarator_list589)
- self.struct_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop18
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 16, struct_declarator_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end struct_declarator_list
-
-
- # $ANTLR start struct_declarator
- # C.g:260:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );
- def struct_declarator(self, ):
-
- struct_declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 17):
- return
-
- # C.g:261:2: ( declarator ( ':' constant_expression )? | ':' constant_expression )
- alt20 = 2
- LA20_0 = self.input.LA(1)
-
- if (LA20_0 == IDENTIFIER or (58 <= LA20_0 <= 60) or LA20_0 == 62 or LA20_0 == 66) :
- alt20 = 1
- elif (LA20_0 == 47) :
- alt20 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("260:1: struct_declarator : ( declarator ( ':' constant_expression )? | ':' constant_expression );", 20, 0, self.input)
-
- raise nvae
-
- if alt20 == 1:
- # C.g:261:4: declarator ( ':' constant_expression )?
- self.following.append(self.FOLLOW_declarator_in_struct_declarator602)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
- # C.g:261:15: ( ':' constant_expression )?
- alt19 = 2
- LA19_0 = self.input.LA(1)
-
- if (LA19_0 == 47) :
- alt19 = 1
- if alt19 == 1:
- # C.g:261:16: ':' constant_expression
- self.match(self.input, 47, self.FOLLOW_47_in_struct_declarator605)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_struct_declarator607)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- elif alt20 == 2:
- # C.g:262:4: ':' constant_expression
- self.match(self.input, 47, self.FOLLOW_47_in_struct_declarator614)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_struct_declarator616)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 17, struct_declarator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end struct_declarator
-
- class enum_specifier_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start enum_specifier
- # C.g:265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );
- def enum_specifier(self, ):
-
- retval = self.enum_specifier_return()
- retval.start = self.input.LT(1)
- enum_specifier_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 18):
- return retval
-
- # C.g:267:2: ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER )
- alt23 = 3
- LA23_0 = self.input.LA(1)
-
- if (LA23_0 == 48) :
- LA23_1 = self.input.LA(2)
-
- if (LA23_1 == IDENTIFIER) :
- LA23_2 = self.input.LA(3)
-
- if (LA23_2 == 43) :
- alt23 = 2
- elif (LA23_2 == EOF or LA23_2 == IDENTIFIER or LA23_2 == 25 or LA23_2 == 27 or (29 <= LA23_2 <= 42) or (45 <= LA23_2 <= 64) or LA23_2 == 66) :
- alt23 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 2, self.input)
-
- raise nvae
-
- elif (LA23_1 == 43) :
- alt23 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 1, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("265:1: enum_specifier options {k=3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 0, self.input)
-
- raise nvae
-
- if alt23 == 1:
- # C.g:267:4: 'enum' '{' enumerator_list ( ',' )? '}'
- self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier634)
- if self.failed:
- return retval
- self.match(self.input, 43, self.FOLLOW_43_in_enum_specifier636)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier638)
- self.enumerator_list()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:267:31: ( ',' )?
- alt21 = 2
- LA21_0 = self.input.LA(1)
-
- if (LA21_0 == 27) :
- alt21 = 1
- if alt21 == 1:
- # C.g:0:0: ','
- self.match(self.input, 27, self.FOLLOW_27_in_enum_specifier640)
- if self.failed:
- return retval
-
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_enum_specifier643)
- if self.failed:
- return retval
-
-
- elif alt23 == 2:
- # C.g:268:4: 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}'
- self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier648)
- if self.failed:
- return retval
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier650)
- if self.failed:
- return retval
- self.match(self.input, 43, self.FOLLOW_43_in_enum_specifier652)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_enumerator_list_in_enum_specifier654)
- self.enumerator_list()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:268:42: ( ',' )?
- alt22 = 2
- LA22_0 = self.input.LA(1)
-
- if (LA22_0 == 27) :
- alt22 = 1
- if alt22 == 1:
- # C.g:0:0: ','
- self.match(self.input, 27, self.FOLLOW_27_in_enum_specifier656)
- if self.failed:
- return retval
-
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_enum_specifier659)
- if self.failed:
- return retval
-
-
- elif alt23 == 3:
- # C.g:269:4: 'enum' IDENTIFIER
- self.match(self.input, 48, self.FOLLOW_48_in_enum_specifier664)
- if self.failed:
- return retval
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enum_specifier666)
- if self.failed:
- return retval
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 18, enum_specifier_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end enum_specifier
-
-
- # $ANTLR start enumerator_list
- # C.g:272:1: enumerator_list : enumerator ( ',' enumerator )* ;
- def enumerator_list(self, ):
-
- enumerator_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 19):
- return
-
- # C.g:273:2: ( enumerator ( ',' enumerator )* )
- # C.g:273:4: enumerator ( ',' enumerator )*
- self.following.append(self.FOLLOW_enumerator_in_enumerator_list677)
- self.enumerator()
- self.following.pop()
- if self.failed:
- return
- # C.g:273:15: ( ',' enumerator )*
- while True: #loop24
- alt24 = 2
- LA24_0 = self.input.LA(1)
-
- if (LA24_0 == 27) :
- LA24_1 = self.input.LA(2)
-
- if (LA24_1 == IDENTIFIER) :
- alt24 = 1
-
-
-
-
- if alt24 == 1:
- # C.g:273:16: ',' enumerator
- self.match(self.input, 27, self.FOLLOW_27_in_enumerator_list680)
- if self.failed:
- return
- self.following.append(self.FOLLOW_enumerator_in_enumerator_list682)
- self.enumerator()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop24
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 19, enumerator_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end enumerator_list
-
-
- # $ANTLR start enumerator
- # C.g:276:1: enumerator : IDENTIFIER ( '=' constant_expression )? ;
- def enumerator(self, ):
-
- enumerator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 20):
- return
-
- # C.g:277:2: ( IDENTIFIER ( '=' constant_expression )? )
- # C.g:277:4: IDENTIFIER ( '=' constant_expression )?
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_enumerator695)
- if self.failed:
- return
- # C.g:277:15: ( '=' constant_expression )?
- alt25 = 2
- LA25_0 = self.input.LA(1)
-
- if (LA25_0 == 28) :
- alt25 = 1
- if alt25 == 1:
- # C.g:277:16: '=' constant_expression
- self.match(self.input, 28, self.FOLLOW_28_in_enumerator698)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_enumerator700)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 20, enumerator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end enumerator
-
-
- # $ANTLR start type_qualifier
- # C.g:280:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTIONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' );
- def type_qualifier(self, ):
-
- type_qualifier_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 21):
- return
-
- # C.g:281:2: ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTIONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' )
- # C.g:
- if (49 <= self.input.LA(1) <= 61):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_type_qualifier0
- )
- raise mse
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 21, type_qualifier_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end type_qualifier
-
- class declarator_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start declarator
- # C.g:296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );
- def declarator(self, ):
-
- retval = self.declarator_return()
- retval.start = self.input.LT(1)
- declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 22):
- return retval
-
- # C.g:297:2: ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer )
- alt30 = 2
- LA30_0 = self.input.LA(1)
-
- if (LA30_0 == 66) :
- LA30_1 = self.input.LA(2)
-
- if (self.synpred66()) :
- alt30 = 1
- elif (True) :
- alt30 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );", 30, 1, self.input)
-
- raise nvae
-
- elif (LA30_0 == IDENTIFIER or (58 <= LA30_0 <= 60) or LA30_0 == 62) :
- alt30 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );", 30, 0, self.input)
-
- raise nvae
-
- if alt30 == 1:
- # C.g:297:4: ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator
- # C.g:297:4: ( pointer )?
- alt26 = 2
- LA26_0 = self.input.LA(1)
-
- if (LA26_0 == 66) :
- alt26 = 1
- if alt26 == 1:
- # C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_declarator784)
- self.pointer()
- self.following.pop()
- if self.failed:
- return retval
-
-
-
- # C.g:297:13: ( 'EFIAPI' )?
- alt27 = 2
- LA27_0 = self.input.LA(1)
-
- if (LA27_0 == 58) :
- alt27 = 1
- if alt27 == 1:
- # C.g:297:14: 'EFIAPI'
- self.match(self.input, 58, self.FOLLOW_58_in_declarator788)
- if self.failed:
- return retval
-
-
-
- # C.g:297:25: ( 'EFI_BOOTSERVICE' )?
- alt28 = 2
- LA28_0 = self.input.LA(1)
-
- if (LA28_0 == 59) :
- alt28 = 1
- if alt28 == 1:
- # C.g:297:26: 'EFI_BOOTSERVICE'
- self.match(self.input, 59, self.FOLLOW_59_in_declarator793)
- if self.failed:
- return retval
-
-
-
- # C.g:297:46: ( 'EFI_RUNTIMESERVICE' )?
- alt29 = 2
- LA29_0 = self.input.LA(1)
-
- if (LA29_0 == 60) :
- alt29 = 1
- if alt29 == 1:
- # C.g:297:47: 'EFI_RUNTIMESERVICE'
- self.match(self.input, 60, self.FOLLOW_60_in_declarator798)
- if self.failed:
- return retval
-
-
-
- self.following.append(self.FOLLOW_direct_declarator_in_declarator802)
- self.direct_declarator()
- self.following.pop()
- if self.failed:
- return retval
-
-
- elif alt30 == 2:
- # C.g:299:4: pointer
- self.following.append(self.FOLLOW_pointer_in_declarator808)
- self.pointer()
- self.following.pop()
- if self.failed:
- return retval
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 22, declarator_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end declarator
-
-
- # $ANTLR start direct_declarator
- # C.g:302:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );
- def direct_declarator(self, ):
-
- direct_declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 23):
- return
-
- # C.g:303:2: ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ )
- alt34 = 2
- LA34_0 = self.input.LA(1)
-
- if (LA34_0 == IDENTIFIER) :
- alt34 = 1
- elif (LA34_0 == 62) :
- alt34 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("302:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );", 34, 0, self.input)
-
- raise nvae
-
- if alt34 == 1:
- # C.g:303:4: IDENTIFIER ( declarator_suffix )*
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_direct_declarator819)
- if self.failed:
- return
- # C.g:303:15: ( declarator_suffix )*
- while True: #loop31
- alt31 = 2
- LA31_0 = self.input.LA(1)
-
- if (LA31_0 == 62) :
- LA31 = self.input.LA(2)
- if LA31 == 63:
- LA31_30 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 58:
- LA31_31 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 66:
- LA31_32 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 59:
- LA31_33 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 60:
- LA31_34 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == IDENTIFIER:
- LA31_35 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 29 or LA31 == 30 or LA31 == 31 or LA31 == 32 or LA31 == 33:
- LA31_37 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 34:
- LA31_38 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 35:
- LA31_39 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 36:
- LA31_40 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 37:
- LA31_41 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 38:
- LA31_42 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 39:
- LA31_43 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 40:
- LA31_44 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 41:
- LA31_45 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 42:
- LA31_46 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 45 or LA31 == 46:
- LA31_47 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 48:
- LA31_48 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 49 or LA31 == 50 or LA31 == 51 or LA31 == 52 or LA31 == 53 or LA31 == 54 or LA31 == 55 or LA31 == 56 or LA31 == 57 or LA31 == 61:
- LA31_49 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
-
- elif (LA31_0 == 64) :
- LA31 = self.input.LA(2)
- if LA31 == 65:
- LA31_51 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 62:
- LA31_52 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == IDENTIFIER:
- LA31_53 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == HEX_LITERAL:
- LA31_54 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == OCTAL_LITERAL:
- LA31_55 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == DECIMAL_LITERAL:
- LA31_56 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == CHARACTER_LITERAL:
- LA31_57 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == STRING_LITERAL:
- LA31_58 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == FLOATING_POINT_LITERAL:
- LA31_59 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 72:
- LA31_60 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 73:
- LA31_61 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 66 or LA31 == 68 or LA31 == 69 or LA31 == 77 or LA31 == 78 or LA31 == 79:
- LA31_62 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
- elif LA31 == 74:
- LA31_63 = self.input.LA(3)
-
- if (self.synpred67()) :
- alt31 = 1
-
-
-
-
-
- if alt31 == 1:
- # C.g:0:0: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator821)
- self.declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop31
-
-
-
-
- elif alt34 == 2:
- # C.g:304:4: '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+
- self.match(self.input, 62, self.FOLLOW_62_in_direct_declarator827)
- if self.failed:
- return
- # C.g:304:8: ( 'EFIAPI' )?
- alt32 = 2
- LA32_0 = self.input.LA(1)
-
- if (LA32_0 == 58) :
- LA32_1 = self.input.LA(2)
-
- if (self.synpred69()) :
- alt32 = 1
- if alt32 == 1:
- # C.g:304:9: 'EFIAPI'
- self.match(self.input, 58, self.FOLLOW_58_in_direct_declarator830)
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_declarator_in_direct_declarator834)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_direct_declarator836)
- if self.failed:
- return
- # C.g:304:35: ( declarator_suffix )+
- cnt33 = 0
- while True: #loop33
- alt33 = 2
- LA33_0 = self.input.LA(1)
-
- if (LA33_0 == 62) :
- LA33 = self.input.LA(2)
- if LA33 == 63:
- LA33_30 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 58:
- LA33_31 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 66:
- LA33_32 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 59:
- LA33_33 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 60:
- LA33_34 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == IDENTIFIER:
- LA33_35 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 29 or LA33 == 30 or LA33 == 31 or LA33 == 32 or LA33 == 33:
- LA33_37 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 34:
- LA33_38 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 35:
- LA33_39 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 36:
- LA33_40 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 37:
- LA33_41 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 38:
- LA33_42 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 39:
- LA33_43 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 40:
- LA33_44 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 41:
- LA33_45 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 42:
- LA33_46 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 45 or LA33 == 46:
- LA33_47 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 48:
- LA33_48 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 49 or LA33 == 50 or LA33 == 51 or LA33 == 52 or LA33 == 53 or LA33 == 54 or LA33 == 55 or LA33 == 56 or LA33 == 57 or LA33 == 61:
- LA33_49 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
-
- elif (LA33_0 == 64) :
- LA33 = self.input.LA(2)
- if LA33 == 65:
- LA33_51 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 62:
- LA33_52 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == IDENTIFIER:
- LA33_53 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == HEX_LITERAL:
- LA33_54 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == OCTAL_LITERAL:
- LA33_55 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == DECIMAL_LITERAL:
- LA33_56 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == CHARACTER_LITERAL:
- LA33_57 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == STRING_LITERAL:
- LA33_58 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == FLOATING_POINT_LITERAL:
- LA33_59 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 72:
- LA33_60 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 73:
- LA33_61 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 66 or LA33 == 68 or LA33 == 69 or LA33 == 77 or LA33 == 78 or LA33 == 79:
- LA33_62 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
- elif LA33 == 74:
- LA33_63 = self.input.LA(3)
-
- if (self.synpred70()) :
- alt33 = 1
-
-
-
-
-
- if alt33 == 1:
- # C.g:0:0: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_direct_declarator838)
- self.declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt33 >= 1:
- break #loop33
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(33, self.input)
- raise eee
-
- cnt33 += 1
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 23, direct_declarator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end direct_declarator
-
-
- # $ANTLR start declarator_suffix
- # C.g:307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );
- def declarator_suffix(self, ):
-
- declarator_suffix_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 24):
- return
-
- # C.g:308:2: ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' )
- alt35 = 5
- LA35_0 = self.input.LA(1)
-
- if (LA35_0 == 64) :
- LA35_1 = self.input.LA(2)
-
- if (LA35_1 == 65) :
- alt35 = 2
- elif ((IDENTIFIER <= LA35_1 <= FLOATING_POINT_LITERAL) or LA35_1 == 62 or LA35_1 == 66 or (68 <= LA35_1 <= 69) or (72 <= LA35_1 <= 74) or (77 <= LA35_1 <= 79)) :
- alt35 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 1, self.input)
-
- raise nvae
-
- elif (LA35_0 == 62) :
- LA35 = self.input.LA(2)
- if LA35 == 63:
- alt35 = 5
- elif LA35 == 29 or LA35 == 30 or LA35 == 31 or LA35 == 32 or LA35 == 33 or LA35 == 34 or LA35 == 35 or LA35 == 36 or LA35 == 37 or LA35 == 38 or LA35 == 39 or LA35 == 40 or LA35 == 41 or LA35 == 42 or LA35 == 45 or LA35 == 46 or LA35 == 48 or LA35 == 49 or LA35 == 50 or LA35 == 51 or LA35 == 52 or LA35 == 53 or LA35 == 54 or LA35 == 55 or LA35 == 56 or LA35 == 57 or LA35 == 58 or LA35 == 59 or LA35 == 60 or LA35 == 61 or LA35 == 66:
- alt35 = 3
- elif LA35 == IDENTIFIER:
- LA35_29 = self.input.LA(3)
-
- if (self.synpred73()) :
- alt35 = 3
- elif (self.synpred74()) :
- alt35 = 4
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 29, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 2, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("307:1: declarator_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );", 35, 0, self.input)
-
- raise nvae
-
- if alt35 == 1:
- # C.g:308:6: '[' constant_expression ']'
- self.match(self.input, 64, self.FOLLOW_64_in_declarator_suffix852)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_declarator_suffix854)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 65, self.FOLLOW_65_in_declarator_suffix856)
- if self.failed:
- return
-
-
- elif alt35 == 2:
- # C.g:309:9: '[' ']'
- self.match(self.input, 64, self.FOLLOW_64_in_declarator_suffix866)
- if self.failed:
- return
- self.match(self.input, 65, self.FOLLOW_65_in_declarator_suffix868)
- if self.failed:
- return
-
-
- elif alt35 == 3:
- # C.g:310:9: '(' parameter_type_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_declarator_suffix878)
- if self.failed:
- return
- self.following.append(self.FOLLOW_parameter_type_list_in_declarator_suffix880)
- self.parameter_type_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_declarator_suffix882)
- if self.failed:
- return
-
-
- elif alt35 == 4:
- # C.g:311:9: '(' identifier_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_declarator_suffix892)
- if self.failed:
- return
- self.following.append(self.FOLLOW_identifier_list_in_declarator_suffix894)
- self.identifier_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_declarator_suffix896)
- if self.failed:
- return
-
-
- elif alt35 == 5:
- # C.g:312:9: '(' ')'
- self.match(self.input, 62, self.FOLLOW_62_in_declarator_suffix906)
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_declarator_suffix908)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 24, declarator_suffix_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end declarator_suffix
-
-
- # $ANTLR start pointer
- # C.g:315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );
- def pointer(self, ):
-
- pointer_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 25):
- return
-
- # C.g:316:2: ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' )
- alt38 = 3
- LA38_0 = self.input.LA(1)
-
- if (LA38_0 == 66) :
- LA38 = self.input.LA(2)
- if LA38 == 66:
- LA38_2 = self.input.LA(3)
-
- if (self.synpred78()) :
- alt38 = 2
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 2, self.input)
-
- raise nvae
-
- elif LA38 == 58:
- LA38_3 = self.input.LA(3)
-
- if (self.synpred77()) :
- alt38 = 1
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 3, self.input)
-
- raise nvae
-
- elif LA38 == 59:
- LA38_4 = self.input.LA(3)
-
- if (self.synpred77()) :
- alt38 = 1
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 4, self.input)
-
- raise nvae
-
- elif LA38 == 60:
- LA38_5 = self.input.LA(3)
-
- if (self.synpred77()) :
- alt38 = 1
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 5, self.input)
-
- raise nvae
-
- elif LA38 == EOF or LA38 == IDENTIFIER or LA38 == 25 or LA38 == 26 or LA38 == 27 or LA38 == 28 or LA38 == 29 or LA38 == 30 or LA38 == 31 or LA38 == 32 or LA38 == 33 or LA38 == 34 or LA38 == 35 or LA38 == 36 or LA38 == 37 or LA38 == 38 or LA38 == 39 or LA38 == 40 or LA38 == 41 or LA38 == 42 or LA38 == 43 or LA38 == 45 or LA38 == 46 or LA38 == 47 or LA38 == 48 or LA38 == 62 or LA38 == 63 or LA38 == 64:
- alt38 = 3
- elif LA38 == 53:
- LA38_21 = self.input.LA(3)
-
- if (self.synpred77()) :
- alt38 = 1
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 21, self.input)
-
- raise nvae
-
- elif LA38 == 49 or LA38 == 50 or LA38 == 51 or LA38 == 52 or LA38 == 54 or LA38 == 55 or LA38 == 56 or LA38 == 57 or LA38 == 61:
- LA38_29 = self.input.LA(3)
-
- if (self.synpred77()) :
- alt38 = 1
- elif (True) :
- alt38 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 29, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 1, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 0, self.input)
-
- raise nvae
-
- if alt38 == 1:
- # C.g:316:4: '*' ( type_qualifier )+ ( pointer )?
- self.match(self.input, 66, self.FOLLOW_66_in_pointer919)
- if self.failed:
- return
- # C.g:316:8: ( type_qualifier )+
- cnt36 = 0
- while True: #loop36
- alt36 = 2
- LA36 = self.input.LA(1)
- if LA36 == 58:
- LA36_2 = self.input.LA(2)
-
- if (self.synpred75()) :
- alt36 = 1
-
-
- elif LA36 == 59:
- LA36_3 = self.input.LA(2)
-
- if (self.synpred75()) :
- alt36 = 1
-
-
- elif LA36 == 60:
- LA36_4 = self.input.LA(2)
-
- if (self.synpred75()) :
- alt36 = 1
-
-
- elif LA36 == 53:
- LA36_20 = self.input.LA(2)
-
- if (self.synpred75()) :
- alt36 = 1
-
-
- elif LA36 == 49 or LA36 == 50 or LA36 == 51 or LA36 == 52 or LA36 == 54 or LA36 == 55 or LA36 == 56 or LA36 == 57 or LA36 == 61:
- LA36_28 = self.input.LA(2)
-
- if (self.synpred75()) :
- alt36 = 1
-
-
-
- if alt36 == 1:
- # C.g:0:0: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_pointer921)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt36 >= 1:
- break #loop36
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(36, self.input)
- raise eee
-
- cnt36 += 1
-
-
- # C.g:316:24: ( pointer )?
- alt37 = 2
- LA37_0 = self.input.LA(1)
-
- if (LA37_0 == 66) :
- LA37_1 = self.input.LA(2)
-
- if (self.synpred76()) :
- alt37 = 1
- if alt37 == 1:
- # C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_pointer924)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- elif alt38 == 2:
- # C.g:317:4: '*' pointer
- self.match(self.input, 66, self.FOLLOW_66_in_pointer930)
- if self.failed:
- return
- self.following.append(self.FOLLOW_pointer_in_pointer932)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt38 == 3:
- # C.g:318:4: '*'
- self.match(self.input, 66, self.FOLLOW_66_in_pointer937)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 25, pointer_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end pointer
-
-
- # $ANTLR start parameter_type_list
- # C.g:321:1: parameter_type_list : parameter_list ( ',' ( 'OPTIONAL' )? '...' )? ;
- def parameter_type_list(self, ):
-
- parameter_type_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 26):
- return
-
- # C.g:322:2: ( parameter_list ( ',' ( 'OPTIONAL' )? '...' )? )
- # C.g:322:4: parameter_list ( ',' ( 'OPTIONAL' )? '...' )?
- self.following.append(self.FOLLOW_parameter_list_in_parameter_type_list948)
- self.parameter_list()
- self.following.pop()
- if self.failed:
- return
- # C.g:322:19: ( ',' ( 'OPTIONAL' )? '...' )?
- alt40 = 2
- LA40_0 = self.input.LA(1)
-
- if (LA40_0 == 27) :
- alt40 = 1
- if alt40 == 1:
- # C.g:322:20: ',' ( 'OPTIONAL' )? '...'
- self.match(self.input, 27, self.FOLLOW_27_in_parameter_type_list951)
- if self.failed:
- return
- # C.g:322:24: ( 'OPTIONAL' )?
- alt39 = 2
- LA39_0 = self.input.LA(1)
-
- if (LA39_0 == 53) :
- alt39 = 1
- if alt39 == 1:
- # C.g:322:25: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_parameter_type_list954)
- if self.failed:
- return
-
-
-
- self.match(self.input, 67, self.FOLLOW_67_in_parameter_type_list958)
- if self.failed:
- return
-
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 26, parameter_type_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end parameter_type_list
-
-
- # $ANTLR start parameter_list
- # C.g:325:1: parameter_list : parameter_declaration ( ',' ( 'OPTIONAL' )? parameter_declaration )* ;
- def parameter_list(self, ):
-
- parameter_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 27):
- return
-
- # C.g:326:2: ( parameter_declaration ( ',' ( 'OPTIONAL' )? parameter_declaration )* )
- # C.g:326:4: parameter_declaration ( ',' ( 'OPTIONAL' )? parameter_declaration )*
- self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list971)
- self.parameter_declaration()
- self.following.pop()
- if self.failed:
- return
- # C.g:326:26: ( ',' ( 'OPTIONAL' )? parameter_declaration )*
- while True: #loop42
- alt42 = 2
- LA42_0 = self.input.LA(1)
-
- if (LA42_0 == 27) :
- LA42_1 = self.input.LA(2)
-
- if (LA42_1 == 53) :
- LA42_3 = self.input.LA(3)
-
- if (self.synpred82()) :
- alt42 = 1
-
-
- elif (LA42_1 == IDENTIFIER or (29 <= LA42_1 <= 42) or (45 <= LA42_1 <= 46) or (48 <= LA42_1 <= 52) or (54 <= LA42_1 <= 61) or LA42_1 == 66) :
- alt42 = 1
-
-
-
-
- if alt42 == 1:
- # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declaration
- self.match(self.input, 27, self.FOLLOW_27_in_parameter_list974)
- if self.failed:
- return
- # C.g:326:31: ( 'OPTIONAL' )?
- alt41 = 2
- LA41_0 = self.input.LA(1)
-
- if (LA41_0 == 53) :
- LA41_1 = self.input.LA(2)
-
- if (self.synpred81()) :
- alt41 = 1
- if alt41 == 1:
- # C.g:326:32: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_parameter_list977)
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_parameter_declaration_in_parameter_list981)
- self.parameter_declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop42
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 27, parameter_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end parameter_list
-
-
- # $ANTLR start parameter_declaration
- # C.g:329:1: parameter_declaration : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );
- def parameter_declaration(self, ):
-
- parameter_declaration_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 28):
- return
-
- # C.g:330:2: ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER )
- alt46 = 2
- LA46 = self.input.LA(1)
- if LA46 == 29 or LA46 == 30 or LA46 == 31 or LA46 == 32 or LA46 == 33 or LA46 == 34 or LA46 == 35 or LA46 == 36 or LA46 == 37 or LA46 == 38 or LA46 == 39 or LA46 == 40 or LA46 == 41 or LA46 == 42 or LA46 == 45 or LA46 == 46 or LA46 == 48 or LA46 == 49 or LA46 == 50 or LA46 == 51 or LA46 == 52 or LA46 == 53 or LA46 == 54 or LA46 == 55 or LA46 == 56 or LA46 == 57 or LA46 == 58 or LA46 == 59 or LA46 == 60 or LA46 == 61:
- alt46 = 1
- elif LA46 == IDENTIFIER:
- LA46_13 = self.input.LA(2)
-
- if (self.synpred86()) :
- alt46 = 1
- elif (True) :
- alt46 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("329:1: parameter_declaration : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 13, self.input)
-
- raise nvae
-
- elif LA46 == 66:
- alt46 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("329:1: parameter_declaration : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 0, self.input)
-
- raise nvae
-
- if alt46 == 1:
- # C.g:330:4: declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )?
- self.following.append(self.FOLLOW_declaration_specifiers_in_parameter_declaration994)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
- # C.g:330:27: ( declarator | abstract_declarator )*
- while True: #loop43
- alt43 = 3
- LA43 = self.input.LA(1)
- if LA43 == 66:
- LA43_5 = self.input.LA(2)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == IDENTIFIER or LA43 == 58 or LA43 == 59 or LA43 == 60:
- alt43 = 1
- elif LA43 == 62:
- LA43 = self.input.LA(2)
- if LA43 == 29 or LA43 == 30 or LA43 == 31 or LA43 == 32 or LA43 == 33 or LA43 == 34 or LA43 == 35 or LA43 == 36 or LA43 == 37 or LA43 == 38 or LA43 == 39 or LA43 == 40 or LA43 == 41 or LA43 == 42 or LA43 == 45 or LA43 == 46 or LA43 == 48 or LA43 == 49 or LA43 == 50 or LA43 == 51 or LA43 == 52 or LA43 == 53 or LA43 == 54 or LA43 == 55 or LA43 == 56 or LA43 == 57 or LA43 == 61 or LA43 == 63 or LA43 == 64:
- alt43 = 2
- elif LA43 == IDENTIFIER:
- LA43_37 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == 58:
- LA43_38 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == 66:
- LA43_39 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == 59:
- LA43_40 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == 60:
- LA43_41 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
- elif LA43 == 62:
- LA43_43 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt43 = 1
- elif (self.synpred84()) :
- alt43 = 2
-
-
-
- elif LA43 == 64:
- alt43 = 2
-
- if alt43 == 1:
- # C.g:330:28: declarator
- self.following.append(self.FOLLOW_declarator_in_parameter_declaration997)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt43 == 2:
- # C.g:330:39: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_parameter_declaration999)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop43
-
-
- # C.g:330:61: ( 'OPTIONAL' )?
- alt44 = 2
- LA44_0 = self.input.LA(1)
-
- if (LA44_0 == 53) :
- alt44 = 1
- if alt44 == 1:
- # C.g:330:62: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_parameter_declaration1004)
- if self.failed:
- return
-
-
-
-
-
- elif alt46 == 2:
- # C.g:332:4: ( pointer )* IDENTIFIER
- # C.g:332:4: ( pointer )*
- while True: #loop45
- alt45 = 2
- LA45_0 = self.input.LA(1)
-
- if (LA45_0 == 66) :
- alt45 = 1
-
-
- if alt45 == 1:
- # C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_parameter_declaration1013)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop45
-
-
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_parameter_declaration1016)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 28, parameter_declaration_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end parameter_declaration
-
-
- # $ANTLR start identifier_list
- # C.g:335:1: identifier_list : IDENTIFIER ( ',' IDENTIFIER )* ;
- def identifier_list(self, ):
-
- identifier_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 29):
- return
-
- # C.g:336:2: ( IDENTIFIER ( ',' IDENTIFIER )* )
- # C.g:336:4: IDENTIFIER ( ',' IDENTIFIER )*
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list1027)
- if self.failed:
- return
- # C.g:337:2: ( ',' IDENTIFIER )*
- while True: #loop47
- alt47 = 2
- LA47_0 = self.input.LA(1)
-
- if (LA47_0 == 27) :
- alt47 = 1
-
-
- if alt47 == 1:
- # C.g:337:3: ',' IDENTIFIER
- self.match(self.input, 27, self.FOLLOW_27_in_identifier_list1031)
- if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_identifier_list1033)
- if self.failed:
- return
-
-
- else:
- break #loop47
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 29, identifier_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end identifier_list
-
-
- # $ANTLR start type_name
- # C.g:340:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );
- def type_name(self, ):
-
- type_name_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 30):
- return
-
- # C.g:341:2: ( specifier_qualifier_list ( abstract_declarator )? | type_id )
- alt49 = 2
- LA49_0 = self.input.LA(1)
-
- if ((34 <= LA49_0 <= 42) or (45 <= LA49_0 <= 46) or (48 <= LA49_0 <= 61)) :
- alt49 = 1
- elif (LA49_0 == IDENTIFIER) :
- LA49_13 = self.input.LA(2)
-
- if (self.synpred90()) :
- alt49 = 1
- elif (True) :
- alt49 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("340:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 13, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("340:1: type_name : ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 0, self.input)
-
- raise nvae
-
- if alt49 == 1:
- # C.g:341:4: specifier_qualifier_list ( abstract_declarator )?
- self.following.append(self.FOLLOW_specifier_qualifier_list_in_type_name1046)
- self.specifier_qualifier_list()
- self.following.pop()
- if self.failed:
- return
- # C.g:341:29: ( abstract_declarator )?
- alt48 = 2
- LA48_0 = self.input.LA(1)
-
- if (LA48_0 == 62 or LA48_0 == 64 or LA48_0 == 66) :
- alt48 = 1
- if alt48 == 1:
- # C.g:0:0: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_type_name1048)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- elif alt49 == 2:
- # C.g:342:4: type_id
- self.following.append(self.FOLLOW_type_id_in_type_name1054)
- self.type_id()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 30, type_name_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end type_name
-
-
- # $ANTLR start abstract_declarator
- # C.g:345:1: abstract_declarator : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator );
- def abstract_declarator(self, ):
-
- abstract_declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 31):
- return
-
- # C.g:346:2: ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator )
- alt51 = 2
- LA51_0 = self.input.LA(1)
-
- if (LA51_0 == 66) :
- alt51 = 1
- elif (LA51_0 == 62 or LA51_0 == 64) :
- alt51 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("345:1: abstract_declarator : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarator );", 51, 0, self.input)
-
- raise nvae
-
- if alt51 == 1:
- # C.g:346:4: pointer ( direct_abstract_declarator )?
- self.following.append(self.FOLLOW_pointer_in_abstract_declarator1065)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
- # C.g:346:12: ( direct_abstract_declarator )?
- alt50 = 2
- LA50_0 = self.input.LA(1)
-
- if (LA50_0 == 62) :
- LA50 = self.input.LA(2)
- if LA50 == 63:
- LA50_12 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 58:
- LA50_13 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 66:
- LA50_14 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 59:
- LA50_15 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 60:
- LA50_16 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == IDENTIFIER:
- LA50_17 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 62:
- LA50_18 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 64:
- LA50_19 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 29 or LA50 == 30 or LA50 == 31 or LA50 == 32 or LA50 == 33:
- LA50_20 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 34:
- LA50_21 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 35:
- LA50_22 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 36:
- LA50_23 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 37:
- LA50_24 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 38:
- LA50_25 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 39:
- LA50_26 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 40:
- LA50_27 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 41:
- LA50_28 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 42:
- LA50_29 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 45 or LA50 == 46:
- LA50_30 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 48:
- LA50_31 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 49 or LA50 == 50 or LA50 == 51 or LA50 == 52 or LA50 == 53 or LA50 == 54 or LA50 == 55 or LA50 == 56 or LA50 == 57 or LA50 == 61:
- LA50_32 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif (LA50_0 == 64) :
- LA50 = self.input.LA(2)
- if LA50 == 65:
- LA50_33 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 62:
- LA50_34 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == IDENTIFIER:
- LA50_35 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == HEX_LITERAL:
- LA50_36 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == OCTAL_LITERAL:
- LA50_37 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == DECIMAL_LITERAL:
- LA50_38 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == CHARACTER_LITERAL:
- LA50_39 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == STRING_LITERAL:
- LA50_40 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == FLOATING_POINT_LITERAL:
- LA50_41 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 72:
- LA50_42 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 73:
- LA50_43 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 66 or LA50 == 68 or LA50 == 69 or LA50 == 77 or LA50 == 78 or LA50 == 79:
- LA50_44 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- elif LA50 == 74:
- LA50_45 = self.input.LA(3)
-
- if (self.synpred91()) :
- alt50 = 1
- if alt50 == 1:
- # C.g:0:0: direct_abstract_declarator
- self.following.append(self.FOLLOW_direct_abstract_declarator_in_abstract_declarator1067)
- self.direct_abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- elif alt51 == 2:
- # C.g:347:4: direct_abstract_declarator
- self.following.append(self.FOLLOW_direct_abstract_declarator_in_abstract_declarator1073)
- self.direct_abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 31, abstract_declarator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end abstract_declarator
-
-
- # $ANTLR start direct_abstract_declarator
- # C.g:350:1: direct_abstract_declarator : ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* ;
- def direct_abstract_declarator(self, ):
-
- direct_abstract_declarator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 32):
- return
-
- # C.g:351:2: ( ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* )
- # C.g:351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix ) ( abstract_declarator_suffix )*
- # C.g:351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )
- alt52 = 2
- LA52_0 = self.input.LA(1)
-
- if (LA52_0 == 62) :
- LA52 = self.input.LA(2)
- if LA52 == IDENTIFIER or LA52 == 29 or LA52 == 30 or LA52 == 31 or LA52 == 32 or LA52 == 33 or LA52 == 34 or LA52 == 35 or LA52 == 36 or LA52 == 37 or LA52 == 38 or LA52 == 39 or LA52 == 40 or LA52 == 41 or LA52 == 42 or LA52 == 45 or LA52 == 46 or LA52 == 48 or LA52 == 49 or LA52 == 50 or LA52 == 51 or LA52 == 52 or LA52 == 53 or LA52 == 54 or LA52 == 55 or LA52 == 56 or LA52 == 57 or LA52 == 58 or LA52 == 59 or LA52 == 60 or LA52 == 61 or LA52 == 63:
- alt52 = 2
- elif LA52 == 66:
- LA52_18 = self.input.LA(3)
-
- if (self.synpred93()) :
- alt52 = 1
- elif (True) :
- alt52 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 52, 18, self.input)
-
- raise nvae
-
- elif LA52 == 62 or LA52 == 64:
- alt52 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 52, 1, self.input)
-
- raise nvae
-
- elif (LA52_0 == 64) :
- alt52 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("351:4: ( '(' abstract_declarator ')' | abstract_declarator_suffix )", 52, 0, self.input)
-
- raise nvae
-
- if alt52 == 1:
- # C.g:351:6: '(' abstract_declarator ')'
- self.match(self.input, 62, self.FOLLOW_62_in_direct_abstract_declarator1086)
- if self.failed:
- return
- self.following.append(self.FOLLOW_abstract_declarator_in_direct_abstract_declarator1088)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_direct_abstract_declarator1090)
- if self.failed:
- return
-
-
- elif alt52 == 2:
- # C.g:351:36: abstract_declarator_suffix
- self.following.append(self.FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1094)
- self.abstract_declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
-
- # C.g:351:65: ( abstract_declarator_suffix )*
- while True: #loop53
- alt53 = 2
- LA53_0 = self.input.LA(1)
-
- if (LA53_0 == 62) :
- LA53 = self.input.LA(2)
- if LA53 == 63:
- LA53_12 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 58:
- LA53_13 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 66:
- LA53_14 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 59:
- LA53_15 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 60:
- LA53_16 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == IDENTIFIER:
- LA53_17 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 29 or LA53 == 30 or LA53 == 31 or LA53 == 32 or LA53 == 33:
- LA53_19 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 34:
- LA53_20 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 35:
- LA53_21 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 36:
- LA53_22 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 37:
- LA53_23 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 38:
- LA53_24 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 39:
- LA53_25 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 40:
- LA53_26 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 41:
- LA53_27 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 42:
- LA53_28 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 45 or LA53 == 46:
- LA53_29 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 48:
- LA53_30 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 49 or LA53 == 50 or LA53 == 51 or LA53 == 52 or LA53 == 53 or LA53 == 54 or LA53 == 55 or LA53 == 56 or LA53 == 57 or LA53 == 61:
- LA53_31 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
-
- elif (LA53_0 == 64) :
- LA53 = self.input.LA(2)
- if LA53 == 65:
- LA53_33 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 62:
- LA53_34 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == IDENTIFIER:
- LA53_35 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == HEX_LITERAL:
- LA53_36 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == OCTAL_LITERAL:
- LA53_37 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == DECIMAL_LITERAL:
- LA53_38 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == CHARACTER_LITERAL:
- LA53_39 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == STRING_LITERAL:
- LA53_40 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == FLOATING_POINT_LITERAL:
- LA53_41 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 72:
- LA53_42 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 73:
- LA53_43 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 66 or LA53 == 68 or LA53 == 69 or LA53 == 77 or LA53 == 78 or LA53 == 79:
- LA53_44 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
- elif LA53 == 74:
- LA53_45 = self.input.LA(3)
-
- if (self.synpred94()) :
- alt53 = 1
-
-
-
-
-
- if alt53 == 1:
- # C.g:0:0: abstract_declarator_suffix
- self.following.append(self.FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1098)
- self.abstract_declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop53
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 32, direct_abstract_declarator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end direct_abstract_declarator
-
-
- # $ANTLR start abstract_declarator_suffix
- # C.g:354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );
- def abstract_declarator_suffix(self, ):
-
- abstract_declarator_suffix_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 33):
- return
-
- # C.g:355:2: ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' )
- alt54 = 4
- LA54_0 = self.input.LA(1)
-
- if (LA54_0 == 64) :
- LA54_1 = self.input.LA(2)
-
- if (LA54_1 == 65) :
- alt54 = 1
- elif ((IDENTIFIER <= LA54_1 <= FLOATING_POINT_LITERAL) or LA54_1 == 62 or LA54_1 == 66 or (68 <= LA54_1 <= 69) or (72 <= LA54_1 <= 74) or (77 <= LA54_1 <= 79)) :
- alt54 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54, 1, self.input)
-
- raise nvae
-
- elif (LA54_0 == 62) :
- LA54_2 = self.input.LA(2)
-
- if (LA54_2 == 63) :
- alt54 = 3
- elif (LA54_2 == IDENTIFIER or (29 <= LA54_2 <= 42) or (45 <= LA54_2 <= 46) or (48 <= LA54_2 <= 61) or LA54_2 == 66) :
- alt54 = 4
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54, 2, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54, 0, self.input)
-
- raise nvae
-
- if alt54 == 1:
- # C.g:355:4: '[' ']'
- self.match(self.input, 64, self.FOLLOW_64_in_abstract_declarator_suffix1110)
- if self.failed:
- return
- self.match(self.input, 65, self.FOLLOW_65_in_abstract_declarator_suffix1112)
- if self.failed:
- return
-
-
- elif alt54 == 2:
- # C.g:356:4: '[' constant_expression ']'
- self.match(self.input, 64, self.FOLLOW_64_in_abstract_declarator_suffix1117)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_abstract_declarator_suffix1119)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 65, self.FOLLOW_65_in_abstract_declarator_suffix1121)
- if self.failed:
- return
-
-
- elif alt54 == 3:
- # C.g:357:4: '(' ')'
- self.match(self.input, 62, self.FOLLOW_62_in_abstract_declarator_suffix1126)
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_abstract_declarator_suffix1128)
- if self.failed:
- return
-
-
- elif alt54 == 4:
- # C.g:358:4: '(' parameter_type_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_abstract_declarator_suffix1133)
- if self.failed:
- return
- self.following.append(self.FOLLOW_parameter_type_list_in_abstract_declarator_suffix1135)
- self.parameter_type_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_abstract_declarator_suffix1137)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 33, abstract_declarator_suffix_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end abstract_declarator_suffix
-
-
- # $ANTLR start initializer
- # C.g:361:1: initializer : ( assignment_expression | '{' initializer_list ( ',' )? '}' );
- def initializer(self, ):
-
- initializer_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 34):
- return
-
- # C.g:363:2: ( assignment_expression | '{' initializer_list ( ',' )? '}' )
- alt56 = 2
- LA56_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA56_0 <= FLOATING_POINT_LITERAL) or LA56_0 == 62 or LA56_0 == 66 or (68 <= LA56_0 <= 69) or (72 <= LA56_0 <= 74) or (77 <= LA56_0 <= 79)) :
- alt56 = 1
- elif (LA56_0 == 43) :
- alt56 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("361:1: initializer : ( assignment_expression | '{' initializer_list ( ',' )? '}' );", 56, 0, self.input)
-
- raise nvae
-
- if alt56 == 1:
- # C.g:363:4: assignment_expression
- self.following.append(self.FOLLOW_assignment_expression_in_initializer1150)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt56 == 2:
- # C.g:364:4: '{' initializer_list ( ',' )? '}'
- self.match(self.input, 43, self.FOLLOW_43_in_initializer1155)
- if self.failed:
- return
- self.following.append(self.FOLLOW_initializer_list_in_initializer1157)
- self.initializer_list()
- self.following.pop()
- if self.failed:
- return
- # C.g:364:25: ( ',' )?
- alt55 = 2
- LA55_0 = self.input.LA(1)
-
- if (LA55_0 == 27) :
- alt55 = 1
- if alt55 == 1:
- # C.g:0:0: ','
- self.match(self.input, 27, self.FOLLOW_27_in_initializer1159)
- if self.failed:
- return
-
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_initializer1162)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 34, initializer_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end initializer
-
-
- # $ANTLR start initializer_list
- # C.g:367:1: initializer_list : initializer ( ',' initializer )* ;
- def initializer_list(self, ):
-
- initializer_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 35):
- return
-
- # C.g:368:2: ( initializer ( ',' initializer )* )
- # C.g:368:4: initializer ( ',' initializer )*
- self.following.append(self.FOLLOW_initializer_in_initializer_list1173)
- self.initializer()
- self.following.pop()
- if self.failed:
- return
- # C.g:368:16: ( ',' initializer )*
- while True: #loop57
- alt57 = 2
- LA57_0 = self.input.LA(1)
-
- if (LA57_0 == 27) :
- LA57_1 = self.input.LA(2)
-
- if ((IDENTIFIER <= LA57_1 <= FLOATING_POINT_LITERAL) or LA57_1 == 43 or LA57_1 == 62 or LA57_1 == 66 or (68 <= LA57_1 <= 69) or (72 <= LA57_1 <= 74) or (77 <= LA57_1 <= 79)) :
- alt57 = 1
-
-
-
-
- if alt57 == 1:
- # C.g:368:17: ',' initializer
- self.match(self.input, 27, self.FOLLOW_27_in_initializer_list1176)
- if self.failed:
- return
- self.following.append(self.FOLLOW_initializer_in_initializer_list1178)
- self.initializer()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop57
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 35, initializer_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end initializer_list
-
- class argument_expression_list_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start argument_expression_list
- # C.g:373:1: argument_expression_list : assignment_expression ( 'OPTIONAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )* ;
- def argument_expression_list(self, ):
-
- retval = self.argument_expression_list_return()
- retval.start = self.input.LT(1)
- argument_expression_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 36):
- return retval
-
- # C.g:374:2: ( assignment_expression ( 'OPTIONAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )* )
- # C.g:374:6: assignment_expression ( 'OPTIONAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )*
- self.following.append(self.FOLLOW_assignment_expression_in_argument_expression_list1196)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:374:28: ( 'OPTIONAL' )?
- alt58 = 2
- LA58_0 = self.input.LA(1)
-
- if (LA58_0 == 53) :
- alt58 = 1
- if alt58 == 1:
- # C.g:374:29: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_argument_expression_list1199)
- if self.failed:
- return retval
-
-
-
- # C.g:374:42: ( ',' assignment_expression ( 'OPTIONAL' )? )*
- while True: #loop60
- alt60 = 2
- LA60_0 = self.input.LA(1)
-
- if (LA60_0 == 27) :
- alt60 = 1
-
-
- if alt60 == 1:
- # C.g:374:43: ',' assignment_expression ( 'OPTIONAL' )?
- self.match(self.input, 27, self.FOLLOW_27_in_argument_expression_list1204)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_assignment_expression_in_argument_expression_list1206)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:374:69: ( 'OPTIONAL' )?
- alt59 = 2
- LA59_0 = self.input.LA(1)
-
- if (LA59_0 == 53) :
- alt59 = 1
- if alt59 == 1:
- # C.g:374:70: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_argument_expression_list1209)
- if self.failed:
- return retval
-
-
-
-
-
- else:
- break #loop60
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 36, argument_expression_list_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end argument_expression_list
-
-
- # $ANTLR start additive_expression
- # C.g:377:1: additive_expression : ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )* ;
- def additive_expression(self, ):
-
- additive_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 37):
- return
-
- # C.g:378:2: ( ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )* )
- # C.g:378:4: ( multiplicative_expression ) ( '+' multiplicative_expression | '-' multiplicative_expression )*
- # C.g:378:4: ( multiplicative_expression )
- # C.g:378:5: multiplicative_expression
- self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1225)
- self.multiplicative_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- # C.g:378:32: ( '+' multiplicative_expression | '-' multiplicative_expression )*
- while True: #loop61
- alt61 = 3
- LA61_0 = self.input.LA(1)
-
- if (LA61_0 == 68) :
- alt61 = 1
- elif (LA61_0 == 69) :
- alt61 = 2
-
-
- if alt61 == 1:
- # C.g:378:33: '+' multiplicative_expression
- self.match(self.input, 68, self.FOLLOW_68_in_additive_expression1229)
- if self.failed:
- return
- self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1231)
- self.multiplicative_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt61 == 2:
- # C.g:378:65: '-' multiplicative_expression
- self.match(self.input, 69, self.FOLLOW_69_in_additive_expression1235)
- if self.failed:
- return
- self.following.append(self.FOLLOW_multiplicative_expression_in_additive_expression1237)
- self.multiplicative_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop61
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 37, additive_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end additive_expression
-
-
- # $ANTLR start multiplicative_expression
- # C.g:381:1: multiplicative_expression : ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )* ;
- def multiplicative_expression(self, ):
-
- multiplicative_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 38):
- return
-
- # C.g:382:2: ( ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )* )
- # C.g:382:4: ( cast_expression ) ( '*' cast_expression | '/' cast_expression | '%' cast_expression )*
- # C.g:382:4: ( cast_expression )
- # C.g:382:5: cast_expression
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1251)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- # C.g:382:22: ( '*' cast_expression | '/' cast_expression | '%' cast_expression )*
- while True: #loop62
- alt62 = 4
- LA62 = self.input.LA(1)
- if LA62 == 66:
- alt62 = 1
- elif LA62 == 70:
- alt62 = 2
- elif LA62 == 71:
- alt62 = 3
-
- if alt62 == 1:
- # C.g:382:23: '*' cast_expression
- self.match(self.input, 66, self.FOLLOW_66_in_multiplicative_expression1255)
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1257)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt62 == 2:
- # C.g:382:45: '/' cast_expression
- self.match(self.input, 70, self.FOLLOW_70_in_multiplicative_expression1261)
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1263)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt62 == 3:
- # C.g:382:67: '%' cast_expression
- self.match(self.input, 71, self.FOLLOW_71_in_multiplicative_expression1267)
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_multiplicative_expression1269)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop62
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 38, multiplicative_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end multiplicative_expression
-
-
- # $ANTLR start cast_expression
- # C.g:385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );
- def cast_expression(self, ):
-
- cast_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 39):
- return
-
- # C.g:386:2: ( '(' type_name ')' cast_expression | unary_expression )
- alt63 = 2
- LA63_0 = self.input.LA(1)
-
- if (LA63_0 == 62) :
- LA63 = self.input.LA(2)
- if LA63 == 34 or LA63 == 35 or LA63 == 36 or LA63 == 37 or LA63 == 38 or LA63 == 39 or LA63 == 40 or LA63 == 41 or LA63 == 42 or LA63 == 45 or LA63 == 46 or LA63 == 48 or LA63 == 49 or LA63 == 50 or LA63 == 51 or LA63 == 52 or LA63 == 53 or LA63 == 54 or LA63 == 55 or LA63 == 56 or LA63 == 57 or LA63 == 58 or LA63 == 59 or LA63 == 60 or LA63 == 61:
- alt63 = 1
- elif LA63 == IDENTIFIER:
- LA63_25 = self.input.LA(3)
-
- if (self.synpred109()) :
- alt63 = 1
- elif (True) :
- alt63 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 25, self.input)
-
- raise nvae
-
- elif LA63 == HEX_LITERAL or LA63 == OCTAL_LITERAL or LA63 == DECIMAL_LITERAL or LA63 == CHARACTER_LITERAL or LA63 == STRING_LITERAL or LA63 == FLOATING_POINT_LITERAL or LA63 == 62 or LA63 == 66 or LA63 == 68 or LA63 == 69 or LA63 == 72 or LA63 == 73 or LA63 == 74 or LA63 == 77 or LA63 == 78 or LA63 == 79:
- alt63 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 1, self.input)
-
- raise nvae
-
- elif ((IDENTIFIER <= LA63_0 <= FLOATING_POINT_LITERAL) or LA63_0 == 66 or (68 <= LA63_0 <= 69) or (72 <= LA63_0 <= 74) or (77 <= LA63_0 <= 79)) :
- alt63 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("385:1: cast_expression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 0, self.input)
-
- raise nvae
-
- if alt63 == 1:
- # C.g:386:4: '(' type_name ')' cast_expression
- self.match(self.input, 62, self.FOLLOW_62_in_cast_expression1282)
- if self.failed:
- return
- self.following.append(self.FOLLOW_type_name_in_cast_expression1284)
- self.type_name()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_cast_expression1286)
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_cast_expression1288)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt63 == 2:
- # C.g:387:4: unary_expression
- self.following.append(self.FOLLOW_unary_expression_in_cast_expression1293)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 39, cast_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end cast_expression
-
-
- # $ANTLR start unary_expression
- # C.g:390:1: unary_expression : ( postfix_expression | '++' unary_expression | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );
- def unary_expression(self, ):
-
- unary_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 40):
- return
-
- # C.g:391:2: ( postfix_expression | '++' unary_expression | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' )
- alt64 = 6
- LA64 = self.input.LA(1)
- if LA64 == IDENTIFIER or LA64 == HEX_LITERAL or LA64 == OCTAL_LITERAL or LA64 == DECIMAL_LITERAL or LA64 == CHARACTER_LITERAL or LA64 == STRING_LITERAL or LA64 == FLOATING_POINT_LITERAL or LA64 == 62:
- alt64 = 1
- elif LA64 == 72:
- alt64 = 2
- elif LA64 == 73:
- alt64 = 3
- elif LA64 == 66 or LA64 == 68 or LA64 == 69 or LA64 == 77 or LA64 == 78 or LA64 == 79:
- alt64 = 4
- elif LA64 == 74:
- LA64_12 = self.input.LA(2)
-
- if (LA64_12 == 62) :
- LA64_13 = self.input.LA(3)
-
- if (self.synpred114()) :
- alt64 = 5
- elif (True) :
- alt64 = 6
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("390:1: unary_expression : ( postfix_expression | '++' unary_expression | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 64, 13, self.input)
-
- raise nvae
-
- elif ((IDENTIFIER <= LA64_12 <= FLOATING_POINT_LITERAL) or LA64_12 == 66 or (68 <= LA64_12 <= 69) or (72 <= LA64_12 <= 74) or (77 <= LA64_12 <= 79)) :
- alt64 = 5
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("390:1: unary_expression : ( postfix_expression | '++' unary_expression | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 64, 12, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("390:1: unary_expression : ( postfix_expression | '++' unary_expression | '--' unary_expression | unary_operator cast_expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 64, 0, self.input)
-
- raise nvae
-
- if alt64 == 1:
- # C.g:391:4: postfix_expression
- self.following.append(self.FOLLOW_postfix_expression_in_unary_expression1304)
- self.postfix_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt64 == 2:
- # C.g:392:4: '++' unary_expression
- self.match(self.input, 72, self.FOLLOW_72_in_unary_expression1309)
- if self.failed:
- return
- self.following.append(self.FOLLOW_unary_expression_in_unary_expression1311)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt64 == 3:
- # C.g:393:4: '--' unary_expression
- self.match(self.input, 73, self.FOLLOW_73_in_unary_expression1316)
- if self.failed:
- return
- self.following.append(self.FOLLOW_unary_expression_in_unary_expression1318)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt64 == 4:
- # C.g:394:4: unary_operator cast_expression
- self.following.append(self.FOLLOW_unary_operator_in_unary_expression1323)
- self.unary_operator()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_unary_expression1325)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt64 == 5:
- # C.g:395:4: 'sizeof' unary_expression
- self.match(self.input, 74, self.FOLLOW_74_in_unary_expression1330)
- if self.failed:
- return
- self.following.append(self.FOLLOW_unary_expression_in_unary_expression1332)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt64 == 6:
- # C.g:396:4: 'sizeof' '(' type_name ')'
- self.match(self.input, 74, self.FOLLOW_74_in_unary_expression1337)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_unary_expression1339)
- if self.failed:
- return
- self.following.append(self.FOLLOW_type_name_in_unary_expression1341)
- self.type_name()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_unary_expression1343)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 40, unary_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end unary_expression
-
-
- # $ANTLR start postfix_expression
- # C.g:399:1: postfix_expression : p= primary_expression ( '[' expression ']' | '(' a= ')' | '(' c= argument_expression_list b= ')' | '(' macro_parameter_list ')' | '.' x= IDENTIFIER | '*' y= IDENTIFIER | '->' z= IDENTIFIER | '++' | '--' )* ;
- def postfix_expression(self, ):
- self.postfix_expression_stack.append(postfix_expression_scope())
- postfix_expression_StartIndex = self.input.index()
- a = None
- b = None
- x = None
- y = None
- z = None
- p = None
-
- c = None
-
-
-
- self.postfix_expression_stack[-1].FuncCallText = ''
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 41):
- return
-
- # C.g:406:2: (p= primary_expression ( '[' expression ']' | '(' a= ')' | '(' c= argument_expression_list b= ')' | '(' macro_parameter_list ')' | '.' x= IDENTIFIER | '*' y= IDENTIFIER | '->' z= IDENTIFIER | '++' | '--' )* )
- # C.g:406:6: p= primary_expression ( '[' expression ']' | '(' a= ')' | '(' c= argument_expression_list b= ')' | '(' macro_parameter_list ')' | '.' x= IDENTIFIER | '*' y= IDENTIFIER | '->' z= IDENTIFIER | '++' | '--' )*
- self.following.append(self.FOLLOW_primary_expression_in_postfix_expression1367)
- p = self.primary_expression()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
- self.postfix_expression_stack[-1].FuncCallText += self.input.toString(p.start,p.stop)
-
- # C.g:407:9: ( '[' expression ']' | '(' a= ')' | '(' c= argument_expression_list b= ')' | '(' macro_parameter_list ')' | '.' x= IDENTIFIER | '*' y= IDENTIFIER | '->' z= IDENTIFIER | '++' | '--' )*
- while True: #loop65
- alt65 = 10
- LA65 = self.input.LA(1)
- if LA65 == 66:
- LA65_1 = self.input.LA(2)
-
- if (LA65_1 == IDENTIFIER) :
- LA65_30 = self.input.LA(3)
-
- if (self.synpred120()) :
- alt65 = 6
-
-
-
-
- elif LA65 == 64:
- alt65 = 1
- elif LA65 == 62:
- LA65 = self.input.LA(2)
- if LA65 == 63:
- alt65 = 2
- elif LA65 == 29 or LA65 == 30 or LA65 == 31 or LA65 == 32 or LA65 == 33 or LA65 == 34 or LA65 == 35 or LA65 == 36 or LA65 == 37 or LA65 == 38 or LA65 == 39 or LA65 == 40 or LA65 == 41 or LA65 == 42 or LA65 == 45 or LA65 == 46 or LA65 == 48 or LA65 == 49 or LA65 == 50 or LA65 == 51 or LA65 == 52 or LA65 == 53 or LA65 == 54 or LA65 == 55 or LA65 == 56 or LA65 == 57 or LA65 == 58 or LA65 == 59 or LA65 == 60 or LA65 == 61:
- alt65 = 4
- elif LA65 == IDENTIFIER:
- LA65_55 = self.input.LA(3)
-
- if (self.synpred117()) :
- alt65 = 3
- elif (self.synpred118()) :
- alt65 = 4
-
-
- elif LA65 == 66:
- LA65_57 = self.input.LA(3)
-
- if (self.synpred117()) :
- alt65 = 3
- elif (self.synpred118()) :
- alt65 = 4
-
-
- elif LA65 == HEX_LITERAL or LA65 == OCTAL_LITERAL or LA65 == DECIMAL_LITERAL or LA65 == CHARACTER_LITERAL or LA65 == STRING_LITERAL or LA65 == FLOATING_POINT_LITERAL or LA65 == 62 or LA65 == 68 or LA65 == 69 or LA65 == 72 or LA65 == 73 or LA65 == 74 or LA65 == 77 or LA65 == 78 or LA65 == 79:
- alt65 = 3
-
- elif LA65 == 75:
- alt65 = 5
- elif LA65 == 76:
- alt65 = 7
- elif LA65 == 72:
- alt65 = 8
- elif LA65 == 73:
- alt65 = 9
-
- if alt65 == 1:
- # C.g:407:13: '[' expression ']'
- self.match(self.input, 64, self.FOLLOW_64_in_postfix_expression1383)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_postfix_expression1385)
- self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 65, self.FOLLOW_65_in_postfix_expression1387)
- if self.failed:
- return
-
-
- elif alt65 == 2:
- # C.g:408:13: '(' a= ')'
- self.match(self.input, 62, self.FOLLOW_62_in_postfix_expression1401)
- if self.failed:
- return
- a = self.input.LT(1)
- self.match(self.input, 63, self.FOLLOW_63_in_postfix_expression1405)
- if self.failed:
- return
- if self.backtracking == 0:
- self.StoreFunctionCalling(p.start.line, p.start.charPositionInLine, a.line, a.charPositionInLine, self.postfix_expression_stack[-1].FuncCallText, '')
-
-
-
- elif alt65 == 3:
- # C.g:409:13: '(' c= argument_expression_list b= ')'
- self.match(self.input, 62, self.FOLLOW_62_in_postfix_expression1420)
- if self.failed:
- return
- self.following.append(self.FOLLOW_argument_expression_list_in_postfix_expression1424)
- c = self.argument_expression_list()
- self.following.pop()
- if self.failed:
- return
- b = self.input.LT(1)
- self.match(self.input, 63, self.FOLLOW_63_in_postfix_expression1428)
- if self.failed:
- return
- if self.backtracking == 0:
- self.StoreFunctionCalling(p.start.line, p.start.charPositionInLine, b.line, b.charPositionInLine, self.postfix_expression_stack[-1].FuncCallText, self.input.toString(c.start,c.stop))
-
-
-
- elif alt65 == 4:
- # C.g:410:13: '(' macro_parameter_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_postfix_expression1444)
- if self.failed:
- return
- self.following.append(self.FOLLOW_macro_parameter_list_in_postfix_expression1446)
- self.macro_parameter_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_postfix_expression1448)
- if self.failed:
- return
-
-
- elif alt65 == 5:
- # C.g:411:13: '.' x= IDENTIFIER
- self.match(self.input, 75, self.FOLLOW_75_in_postfix_expression1462)
- if self.failed:
- return
- x = self.input.LT(1)
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_postfix_expression1466)
- if self.failed:
- return
- if self.backtracking == 0:
- self.postfix_expression_stack[-1].FuncCallText += '.' + x.text
-
-
-
- elif alt65 == 6:
- # C.g:412:13: '*' y= IDENTIFIER
- self.match(self.input, 66, self.FOLLOW_66_in_postfix_expression1482)
- if self.failed:
- return
- y = self.input.LT(1)
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_postfix_expression1486)
- if self.failed:
- return
- if self.backtracking == 0:
- self.postfix_expression_stack[-1].FuncCallText = y.text
-
-
-
- elif alt65 == 7:
- # C.g:413:13: '->' z= IDENTIFIER
- self.match(self.input, 76, self.FOLLOW_76_in_postfix_expression1502)
- if self.failed:
- return
- z = self.input.LT(1)
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_postfix_expression1506)
- if self.failed:
- return
- if self.backtracking == 0:
- self.postfix_expression_stack[-1].FuncCallText += '->' + z.text
-
-
-
- elif alt65 == 8:
- # C.g:414:13: '++'
- self.match(self.input, 72, self.FOLLOW_72_in_postfix_expression1522)
- if self.failed:
- return
-
-
- elif alt65 == 9:
- # C.g:415:13: '--'
- self.match(self.input, 73, self.FOLLOW_73_in_postfix_expression1536)
- if self.failed:
- return
-
-
- else:
- break #loop65
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 41, postfix_expression_StartIndex)
-
- self.postfix_expression_stack.pop()
- pass
-
- return
-
- # $ANTLR end postfix_expression
-
-
- # $ANTLR start macro_parameter_list
- # C.g:419:1: macro_parameter_list : parameter_declaration ( ',' parameter_declaration )* ;
- def macro_parameter_list(self, ):
-
- macro_parameter_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 42):
- return
-
- # C.g:420:2: ( parameter_declaration ( ',' parameter_declaration )* )
- # C.g:420:4: parameter_declaration ( ',' parameter_declaration )*
- self.following.append(self.FOLLOW_parameter_declaration_in_macro_parameter_list1559)
- self.parameter_declaration()
- self.following.pop()
- if self.failed:
- return
- # C.g:420:26: ( ',' parameter_declaration )*
- while True: #loop66
- alt66 = 2
- LA66_0 = self.input.LA(1)
-
- if (LA66_0 == 27) :
- alt66 = 1
-
-
- if alt66 == 1:
- # C.g:420:27: ',' parameter_declaration
- self.match(self.input, 27, self.FOLLOW_27_in_macro_parameter_list1562)
- if self.failed:
- return
- self.following.append(self.FOLLOW_parameter_declaration_in_macro_parameter_list1564)
- self.parameter_declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop66
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 42, macro_parameter_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end macro_parameter_list
-
-
- # $ANTLR start unary_operator
- # C.g:423:1: unary_operator : ( '&' | '*' | '+' | '-' | '~' | '!' );
- def unary_operator(self, ):
-
- unary_operator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 43):
- return
-
- # C.g:424:2: ( '&' | '*' | '+' | '-' | '~' | '!' )
- # C.g:
- if self.input.LA(1) == 66 or (68 <= self.input.LA(1) <= 69) or (77 <= self.input.LA(1) <= 79):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_unary_operator0
- )
- raise mse
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 43, unary_operator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end unary_operator
-
- class primary_expression_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start primary_expression
- # C.g:432:1: primary_expression : ( IDENTIFIER | constant | '(' expression ')' );
- def primary_expression(self, ):
-
- retval = self.primary_expression_return()
- retval.start = self.input.LT(1)
- primary_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 44):
- return retval
-
- # C.g:433:2: ( IDENTIFIER | constant | '(' expression ')' )
- alt67 = 3
- LA67 = self.input.LA(1)
- if LA67 == IDENTIFIER:
- LA67_1 = self.input.LA(2)
-
- if (LA67_1 == EOF or LA67_1 == 25 or (27 <= LA67_1 <= 28) or LA67_1 == 44 or LA67_1 == 47 or LA67_1 == 53 or (62 <= LA67_1 <= 66) or (68 <= LA67_1 <= 73) or (75 <= LA67_1 <= 77) or (80 <= LA67_1 <= 102)) :
- alt67 = 1
- elif (LA67_1 == IDENTIFIER or LA67_1 == STRING_LITERAL) :
- alt67 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("432:1: primary_expression : ( IDENTIFIER | constant | '(' expression ')' );", 67, 1, self.input)
-
- raise nvae
-
- elif LA67 == HEX_LITERAL or LA67 == OCTAL_LITERAL or LA67 == DECIMAL_LITERAL or LA67 == CHARACTER_LITERAL or LA67 == STRING_LITERAL or LA67 == FLOATING_POINT_LITERAL:
- alt67 = 2
- elif LA67 == 62:
- alt67 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("432:1: primary_expression : ( IDENTIFIER | constant | '(' expression ')' );", 67, 0, self.input)
-
- raise nvae
-
- if alt67 == 1:
- # C.g:433:4: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_primary_expression1613)
- if self.failed:
- return retval
-
-
- elif alt67 == 2:
- # C.g:434:4: constant
- self.following.append(self.FOLLOW_constant_in_primary_expression1618)
- self.constant()
- self.following.pop()
- if self.failed:
- return retval
-
-
- elif alt67 == 3:
- # C.g:435:4: '(' expression ')'
- self.match(self.input, 62, self.FOLLOW_62_in_primary_expression1623)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_expression_in_primary_expression1625)
- self.expression()
- self.following.pop()
- if self.failed:
- return retval
- self.match(self.input, 63, self.FOLLOW_63_in_primary_expression1627)
- if self.failed:
- return retval
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 44, primary_expression_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end primary_expression
-
-
- # $ANTLR start constant
- # C.g:438:1: constant : ( HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITERAL | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIFIER )* | FLOATING_POINT_LITERAL );
- def constant(self, ):
-
- constant_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 45):
- return
-
- # C.g:439:5: ( HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITERAL | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIFIER )* | FLOATING_POINT_LITERAL )
- alt72 = 6
- LA72 = self.input.LA(1)
- if LA72 == HEX_LITERAL:
- alt72 = 1
- elif LA72 == OCTAL_LITERAL:
- alt72 = 2
- elif LA72 == DECIMAL_LITERAL:
- alt72 = 3
- elif LA72 == CHARACTER_LITERAL:
- alt72 = 4
- elif LA72 == IDENTIFIER or LA72 == STRING_LITERAL:
- alt72 = 5
- elif LA72 == FLOATING_POINT_LITERAL:
- alt72 = 6
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("438:1: constant : ( HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITERAL | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIFIER )* | FLOATING_POINT_LITERAL );", 72, 0, self.input)
-
- raise nvae
-
- if alt72 == 1:
- # C.g:439:9: HEX_LITERAL
- self.match(self.input, HEX_LITERAL, self.FOLLOW_HEX_LITERAL_in_constant1643)
- if self.failed:
- return
-
-
- elif alt72 == 2:
- # C.g:440:9: OCTAL_LITERAL
- self.match(self.input, OCTAL_LITERAL, self.FOLLOW_OCTAL_LITERAL_in_constant1653)
- if self.failed:
- return
-
-
- elif alt72 == 3:
- # C.g:441:9: DECIMAL_LITERAL
- self.match(self.input, DECIMAL_LITERAL, self.FOLLOW_DECIMAL_LITERAL_in_constant1663)
- if self.failed:
- return
-
-
- elif alt72 == 4:
- # C.g:442:7: CHARACTER_LITERAL
- self.match(self.input, CHARACTER_LITERAL, self.FOLLOW_CHARACTER_LITERAL_in_constant1671)
- if self.failed:
- return
-
-
- elif alt72 == 5:
- # C.g:443:7: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIFIER )*
- # C.g:443:7: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+
- cnt70 = 0
- while True: #loop70
- alt70 = 2
- LA70_0 = self.input.LA(1)
-
- if (LA70_0 == IDENTIFIER) :
- LA70_1 = self.input.LA(2)
-
- if (LA70_1 == STRING_LITERAL) :
- alt70 = 1
- elif (LA70_1 == IDENTIFIER) :
- LA70_33 = self.input.LA(3)
-
- if (self.synpred138()) :
- alt70 = 1
-
-
-
-
- elif (LA70_0 == STRING_LITERAL) :
- alt70 = 1
-
-
- if alt70 == 1:
- # C.g:443:8: ( IDENTIFIER )* ( STRING_LITERAL )+
- # C.g:443:8: ( IDENTIFIER )*
- while True: #loop68
- alt68 = 2
- LA68_0 = self.input.LA(1)
-
- if (LA68_0 == IDENTIFIER) :
- alt68 = 1
-
-
- if alt68 == 1:
- # C.g:0:0: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_constant1680)
- if self.failed:
- return
-
-
- else:
- break #loop68
-
-
- # C.g:443:20: ( STRING_LITERAL )+
- cnt69 = 0
- while True: #loop69
- alt69 = 2
- LA69_0 = self.input.LA(1)
-
- if (LA69_0 == STRING_LITERAL) :
- LA69_31 = self.input.LA(2)
-
- if (self.synpred137()) :
- alt69 = 1
-
-
-
-
- if alt69 == 1:
- # C.g:0:0: STRING_LITERAL
- self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_LITERAL_in_constant1683)
- if self.failed:
- return
-
-
- else:
- if cnt69 >= 1:
- break #loop69
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(69, self.input)
- raise eee
-
- cnt69 += 1
-
-
-
-
- else:
- if cnt70 >= 1:
- break #loop70
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(70, self.input)
- raise eee
-
- cnt70 += 1
-
-
- # C.g:443:38: ( IDENTIFIER )*
- while True: #loop71
- alt71 = 2
- LA71_0 = self.input.LA(1)
-
- if (LA71_0 == IDENTIFIER) :
- alt71 = 1
-
-
- if alt71 == 1:
- # C.g:0:0: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_constant1688)
- if self.failed:
- return
-
-
- else:
- break #loop71
-
-
-
-
- elif alt72 == 6:
- # C.g:444:9: FLOATING_POINT_LITERAL
- self.match(self.input, FLOATING_POINT_LITERAL, self.FOLLOW_FLOATING_POINT_LITERAL_in_constant1699)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 45, constant_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end constant
-
- class expression_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start expression
- # C.g:449:1: expression : assignment_expression ( ',' assignment_expression )* ;
- def expression(self, ):
-
- retval = self.expression_return()
- retval.start = self.input.LT(1)
- expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 46):
- return retval
-
- # C.g:450:2: ( assignment_expression ( ',' assignment_expression )* )
- # C.g:450:4: assignment_expression ( ',' assignment_expression )*
- self.following.append(self.FOLLOW_assignment_expression_in_expression1715)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:450:26: ( ',' assignment_expression )*
- while True: #loop73
- alt73 = 2
- LA73_0 = self.input.LA(1)
-
- if (LA73_0 == 27) :
- alt73 = 1
-
-
- if alt73 == 1:
- # C.g:450:27: ',' assignment_expression
- self.match(self.input, 27, self.FOLLOW_27_in_expression1718)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_assignment_expression_in_expression1720)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- break #loop73
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 46, expression_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end expression
-
-
- # $ANTLR start constant_expression
- # C.g:453:1: constant_expression : conditional_expression ;
- def constant_expression(self, ):
-
- constant_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 47):
- return
-
- # C.g:454:2: ( conditional_expression )
- # C.g:454:4: conditional_expression
- self.following.append(self.FOLLOW_conditional_expression_in_constant_expression1733)
- self.conditional_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 47, constant_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end constant_expression
-
-
- # $ANTLR start assignment_expression
- # C.g:457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );
- def assignment_expression(self, ):
-
- assignment_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 48):
- return
-
- # C.g:458:2: ( lvalue assignment_operator assignment_expression | conditional_expression )
- alt74 = 2
- LA74 = self.input.LA(1)
- if LA74 == IDENTIFIER:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_13 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 13, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_14 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 14, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_15 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 15, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_16 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 16, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_17 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 17, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_18 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 18, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_19 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 19, self.input)
-
- raise nvae
-
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- elif LA74 == STRING_LITERAL:
- LA74_21 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 21, self.input)
-
- raise nvae
-
- elif LA74 == IDENTIFIER:
- LA74_22 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 22, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 1, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_44 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 44, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_45 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 45, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_46 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 46, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_47 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 47, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_48 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 48, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_49 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 49, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_50 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 50, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 2, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_73 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 73, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_74 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 74, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_75 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 75, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_76 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 76, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_77 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 77, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_78 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 78, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_79 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 79, self.input)
-
- raise nvae
-
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 3, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_102 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 102, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_103 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 103, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_104 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 104, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_105 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 105, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_106 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 106, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_107 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 107, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_108 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 108, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 4, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_131 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 131, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_132 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 132, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_133 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 133, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_134 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 134, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_135 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 135, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_136 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 136, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_137 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 137, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 5, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == IDENTIFIER:
- LA74_160 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 160, self.input)
-
- raise nvae
-
- elif LA74 == 64:
- LA74_161 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 161, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_162 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 162, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_163 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 163, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_164 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 164, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_165 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 165, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_166 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 166, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_167 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 167, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- elif LA74 == STRING_LITERAL:
- LA74_189 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 189, self.input)
-
- raise nvae
-
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 6, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74 = self.input.LA(2)
- if LA74 == 64:
- LA74_191 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 191, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_192 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 192, self.input)
-
- raise nvae
-
- elif LA74 == 75:
- LA74_193 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 193, self.input)
-
- raise nvae
-
- elif LA74 == 66:
- LA74_194 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 194, self.input)
-
- raise nvae
-
- elif LA74 == 76:
- LA74_195 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 195, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_196 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 196, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_197 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 197, self.input)
-
- raise nvae
-
- elif LA74 == EOF or LA74 == 25 or LA74 == 27 or LA74 == 44 or LA74 == 47 or LA74 == 53 or LA74 == 63 or LA74 == 65 or LA74 == 68 or LA74 == 69 or LA74 == 70 or LA74 == 71 or LA74 == 77 or LA74 == 90 or LA74 == 91 or LA74 == 92 or LA74 == 93 or LA74 == 94 or LA74 == 95 or LA74 == 96 or LA74 == 97 or LA74 == 98 or LA74 == 99 or LA74 == 100 or LA74 == 101 or LA74 == 102:
- alt74 = 2
- elif LA74 == 28 or LA74 == 80 or LA74 == 81 or LA74 == 82 or LA74 == 83 or LA74 == 84 or LA74 == 85 or LA74 == 86 or LA74 == 87 or LA74 == 88 or LA74 == 89:
- alt74 = 1
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 7, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74 = self.input.LA(2)
- if LA74 == IDENTIFIER:
- LA74_220 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 220, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74_221 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 221, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74_222 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 222, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74_223 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 223, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74_224 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 224, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74_225 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 225, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74_226 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 226, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_227 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 227, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_228 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 228, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_229 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 229, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74_230 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 230, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74_231 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 231, self.input)
-
- raise nvae
-
- elif LA74 == 34 or LA74 == 35 or LA74 == 36 or LA74 == 37 or LA74 == 38 or LA74 == 39 or LA74 == 40 or LA74 == 41 or LA74 == 42 or LA74 == 45 or LA74 == 46 or LA74 == 48 or LA74 == 49 or LA74 == 50 or LA74 == 51 or LA74 == 52 or LA74 == 53 or LA74 == 54 or LA74 == 55 or LA74 == 56 or LA74 == 57 or LA74 == 58 or LA74 == 59 or LA74 == 60 or LA74 == 61:
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 8, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74 = self.input.LA(2)
- if LA74 == IDENTIFIER:
- LA74_244 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 244, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74_245 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 245, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74_246 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 246, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74_247 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 247, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74_248 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 248, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74_249 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 249, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74_250 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 250, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_251 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 251, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_252 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 252, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_253 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 253, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74_254 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 254, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74_255 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 255, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 9, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74 = self.input.LA(2)
- if LA74 == IDENTIFIER:
- LA74_256 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 256, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74_257 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 257, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74_258 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 258, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74_259 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 259, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74_260 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 260, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74_261 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 261, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74_262 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 262, self.input)
-
- raise nvae
-
- elif LA74 == 62:
- LA74_263 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 263, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_264 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 264, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_265 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 265, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74_266 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 266, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74_267 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 267, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 10, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74 = self.input.LA(2)
- if LA74 == 62:
- LA74_268 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 268, self.input)
-
- raise nvae
-
- elif LA74 == IDENTIFIER:
- LA74_269 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 269, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74_270 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 270, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74_271 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 271, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74_272 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 272, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74_273 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 273, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74_274 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 274, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74_275 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 275, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_276 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 276, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_277 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 277, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74_278 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 278, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74_279 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 279, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 11, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74 = self.input.LA(2)
- if LA74 == 62:
- LA74_280 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 280, self.input)
-
- raise nvae
-
- elif LA74 == IDENTIFIER:
- LA74_281 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 281, self.input)
-
- raise nvae
-
- elif LA74 == HEX_LITERAL:
- LA74_282 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 282, self.input)
-
- raise nvae
-
- elif LA74 == OCTAL_LITERAL:
- LA74_283 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 283, self.input)
-
- raise nvae
-
- elif LA74 == DECIMAL_LITERAL:
- LA74_284 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 284, self.input)
-
- raise nvae
-
- elif LA74 == CHARACTER_LITERAL:
- LA74_285 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 285, self.input)
-
- raise nvae
-
- elif LA74 == STRING_LITERAL:
- LA74_286 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 286, self.input)
-
- raise nvae
-
- elif LA74 == FLOATING_POINT_LITERAL:
- LA74_287 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 287, self.input)
-
- raise nvae
-
- elif LA74 == 72:
- LA74_288 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 288, self.input)
-
- raise nvae
-
- elif LA74 == 73:
- LA74_289 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 289, self.input)
-
- raise nvae
-
- elif LA74 == 66 or LA74 == 68 or LA74 == 69 or LA74 == 77 or LA74 == 78 or LA74 == 79:
- LA74_290 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 290, self.input)
-
- raise nvae
-
- elif LA74 == 74:
- LA74_291 = self.input.LA(3)
-
- if (self.synpred142()) :
- alt74 = 1
- elif (True) :
- alt74 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 291, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 12, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("457:1: assignment_expression : ( lvalue assignment_operator assignment_expression | conditional_expression );", 74, 0, self.input)
-
- raise nvae
-
- if alt74 == 1:
- # C.g:458:4: lvalue assignment_operator assignment_expression
- self.following.append(self.FOLLOW_lvalue_in_assignment_expression1744)
- self.lvalue()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_assignment_operator_in_assignment_expression1746)
- self.assignment_operator()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_assignment_expression_in_assignment_expression1748)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt74 == 2:
- # C.g:459:4: conditional_expression
- self.following.append(self.FOLLOW_conditional_expression_in_assignment_expression1753)
- self.conditional_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 48, assignment_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end assignment_expression
-
-
- # $ANTLR start lvalue
- # C.g:462:1: lvalue : unary_expression ;
- def lvalue(self, ):
-
- lvalue_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 49):
- return
-
- # C.g:463:2: ( unary_expression )
- # C.g:463:4: unary_expression
- self.following.append(self.FOLLOW_unary_expression_in_lvalue1765)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 49, lvalue_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end lvalue
-
-
- # $ANTLR start assignment_operator
- # C.g:466:1: assignment_operator : ( '=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '&=' | '^=' | '|=' );
- def assignment_operator(self, ):
-
- assignment_operator_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 50):
- return
-
- # C.g:467:2: ( '=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '&=' | '^=' | '|=' )
- # C.g:
- if self.input.LA(1) == 28 or (80 <= self.input.LA(1) <= 89):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_assignment_operator0
- )
- raise mse
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 50, assignment_operator_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end assignment_operator
-
-
- # $ANTLR start conditional_expression
- # C.g:480:1: conditional_expression : e= logical_or_expression ( '?' expression ':' conditional_expression )? ;
- def conditional_expression(self, ):
-
- conditional_expression_StartIndex = self.input.index()
- e = None
-
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 51):
- return
-
- # C.g:481:2: (e= logical_or_expression ( '?' expression ':' conditional_expression )? )
- # C.g:481:4: e= logical_or_expression ( '?' expression ':' conditional_expression )?
- self.following.append(self.FOLLOW_logical_or_expression_in_conditional_expression1839)
- e = self.logical_or_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:481:28: ( '?' expression ':' conditional_expression )?
- alt75 = 2
- LA75_0 = self.input.LA(1)
-
- if (LA75_0 == 90) :
- alt75 = 1
- if alt75 == 1:
- # C.g:481:29: '?' expression ':' conditional_expression
- self.match(self.input, 90, self.FOLLOW_90_in_conditional_expression1842)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_conditional_expression1844)
- self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 47, self.FOLLOW_47_in_conditional_expression1846)
- if self.failed:
- return
- self.following.append(self.FOLLOW_conditional_expression_in_conditional_expression1848)
- self.conditional_expression()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
- self.StorePredicateExpression(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
-
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 51, conditional_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end conditional_expression
-
- class logical_or_expression_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start logical_or_expression
- # C.g:484:1: logical_or_expression : logical_and_expression ( '||' logical_and_expression )* ;
- def logical_or_expression(self, ):
-
- retval = self.logical_or_expression_return()
- retval.start = self.input.LT(1)
- logical_or_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 52):
- return retval
-
- # C.g:485:2: ( logical_and_expression ( '||' logical_and_expression )* )
- # C.g:485:4: logical_and_expression ( '||' logical_and_expression )*
- self.following.append(self.FOLLOW_logical_and_expression_in_logical_or_expression1863)
- self.logical_and_expression()
- self.following.pop()
- if self.failed:
- return retval
- # C.g:485:27: ( '||' logical_and_expression )*
- while True: #loop76
- alt76 = 2
- LA76_0 = self.input.LA(1)
-
- if (LA76_0 == 91) :
- alt76 = 1
-
-
- if alt76 == 1:
- # C.g:485:28: '||' logical_and_expression
- self.match(self.input, 91, self.FOLLOW_91_in_logical_or_expression1866)
- if self.failed:
- return retval
- self.following.append(self.FOLLOW_logical_and_expression_in_logical_or_expression1868)
- self.logical_and_expression()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- break #loop76
-
-
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 52, logical_or_expression_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end logical_or_expression
-
-
- # $ANTLR start logical_and_expression
- # C.g:488:1: logical_and_expression : inclusive_or_expression ( '&&' inclusive_or_expression )* ;
- def logical_and_expression(self, ):
-
- logical_and_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 53):
- return
-
- # C.g:489:2: ( inclusive_or_expression ( '&&' inclusive_or_expression )* )
- # C.g:489:4: inclusive_or_expression ( '&&' inclusive_or_expression )*
- self.following.append(self.FOLLOW_inclusive_or_expression_in_logical_and_expression1881)
- self.inclusive_or_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:489:28: ( '&&' inclusive_or_expression )*
- while True: #loop77
- alt77 = 2
- LA77_0 = self.input.LA(1)
-
- if (LA77_0 == 92) :
- alt77 = 1
-
-
- if alt77 == 1:
- # C.g:489:29: '&&' inclusive_or_expression
- self.match(self.input, 92, self.FOLLOW_92_in_logical_and_expression1884)
- if self.failed:
- return
- self.following.append(self.FOLLOW_inclusive_or_expression_in_logical_and_expression1886)
- self.inclusive_or_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop77
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 53, logical_and_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end logical_and_expression
-
-
- # $ANTLR start inclusive_or_expression
- # C.g:492:1: inclusive_or_expression : exclusive_or_expression ( '|' exclusive_or_expression )* ;
- def inclusive_or_expression(self, ):
-
- inclusive_or_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 54):
- return
-
- # C.g:493:2: ( exclusive_or_expression ( '|' exclusive_or_expression )* )
- # C.g:493:4: exclusive_or_expression ( '|' exclusive_or_expression )*
- self.following.append(self.FOLLOW_exclusive_or_expression_in_inclusive_or_expression1899)
- self.exclusive_or_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:493:28: ( '|' exclusive_or_expression )*
- while True: #loop78
- alt78 = 2
- LA78_0 = self.input.LA(1)
-
- if (LA78_0 == 93) :
- alt78 = 1
-
-
- if alt78 == 1:
- # C.g:493:29: '|' exclusive_or_expression
- self.match(self.input, 93, self.FOLLOW_93_in_inclusive_or_expression1902)
- if self.failed:
- return
- self.following.append(self.FOLLOW_exclusive_or_expression_in_inclusive_or_expression1904)
- self.exclusive_or_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop78
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 54, inclusive_or_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end inclusive_or_expression
-
-
- # $ANTLR start exclusive_or_expression
- # C.g:496:1: exclusive_or_expression : and_expression ( '^' and_expression )* ;
- def exclusive_or_expression(self, ):
-
- exclusive_or_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 55):
- return
-
- # C.g:497:2: ( and_expression ( '^' and_expression )* )
- # C.g:497:4: and_expression ( '^' and_expression )*
- self.following.append(self.FOLLOW_and_expression_in_exclusive_or_expression1917)
- self.and_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:497:19: ( '^' and_expression )*
- while True: #loop79
- alt79 = 2
- LA79_0 = self.input.LA(1)
-
- if (LA79_0 == 94) :
- alt79 = 1
-
-
- if alt79 == 1:
- # C.g:497:20: '^' and_expression
- self.match(self.input, 94, self.FOLLOW_94_in_exclusive_or_expression1920)
- if self.failed:
- return
- self.following.append(self.FOLLOW_and_expression_in_exclusive_or_expression1922)
- self.and_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop79
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 55, exclusive_or_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end exclusive_or_expression
-
-
- # $ANTLR start and_expression
- # C.g:500:1: and_expression : equality_expression ( '&' equality_expression )* ;
- def and_expression(self, ):
-
- and_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 56):
- return
-
- # C.g:501:2: ( equality_expression ( '&' equality_expression )* )
- # C.g:501:4: equality_expression ( '&' equality_expression )*
- self.following.append(self.FOLLOW_equality_expression_in_and_expression1935)
- self.equality_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:501:24: ( '&' equality_expression )*
- while True: #loop80
- alt80 = 2
- LA80_0 = self.input.LA(1)
-
- if (LA80_0 == 77) :
- alt80 = 1
-
-
- if alt80 == 1:
- # C.g:501:25: '&' equality_expression
- self.match(self.input, 77, self.FOLLOW_77_in_and_expression1938)
- if self.failed:
- return
- self.following.append(self.FOLLOW_equality_expression_in_and_expression1940)
- self.equality_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop80
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 56, and_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end and_expression
-
-
- # $ANTLR start equality_expression
- # C.g:503:1: equality_expression : relational_expression ( ( '==' | '!=' ) relational_expression )* ;
- def equality_expression(self, ):
-
- equality_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 57):
- return
-
- # C.g:504:2: ( relational_expression ( ( '==' | '!=' ) relational_expression )* )
- # C.g:504:4: relational_expression ( ( '==' | '!=' ) relational_expression )*
- self.following.append(self.FOLLOW_relational_expression_in_equality_expression1952)
- self.relational_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:504:26: ( ( '==' | '!=' ) relational_expression )*
- while True: #loop81
- alt81 = 2
- LA81_0 = self.input.LA(1)
-
- if ((95 <= LA81_0 <= 96)) :
- alt81 = 1
-
-
- if alt81 == 1:
- # C.g:504:27: ( '==' | '!=' ) relational_expression
- if (95 <= self.input.LA(1) <= 96):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_equality_expression1955
- )
- raise mse
-
-
- self.following.append(self.FOLLOW_relational_expression_in_equality_expression1961)
- self.relational_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop81
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 57, equality_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end equality_expression
-
-
- # $ANTLR start relational_expression
- # C.g:507:1: relational_expression : shift_expression ( ( '<' | '>' | '<=' | '>=' ) shift_expression )* ;
- def relational_expression(self, ):
-
- relational_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 58):
- return
-
- # C.g:508:2: ( shift_expression ( ( '<' | '>' | '<=' | '>=' ) shift_expression )* )
- # C.g:508:4: shift_expression ( ( '<' | '>' | '<=' | '>=' ) shift_expression )*
- self.following.append(self.FOLLOW_shift_expression_in_relational_expression1975)
- self.shift_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:508:21: ( ( '<' | '>' | '<=' | '>=' ) shift_expression )*
- while True: #loop82
- alt82 = 2
- LA82_0 = self.input.LA(1)
-
- if ((97 <= LA82_0 <= 100)) :
- alt82 = 1
-
-
- if alt82 == 1:
- # C.g:508:22: ( '<' | '>' | '<=' | '>=' ) shift_expression
- if (97 <= self.input.LA(1) <= 100):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_relational_expression1978
- )
- raise mse
-
-
- self.following.append(self.FOLLOW_shift_expression_in_relational_expression1988)
- self.shift_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop82
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 58, relational_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end relational_expression
-
-
- # $ANTLR start shift_expression
- # C.g:511:1: shift_expression : additive_expression ( ( '<<' | '>>' ) additive_expression )* ;
- def shift_expression(self, ):
-
- shift_expression_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 59):
- return
-
- # C.g:512:2: ( additive_expression ( ( '<<' | '>>' ) additive_expression )* )
- # C.g:512:4: additive_expression ( ( '<<' | '>>' ) additive_expression )*
- self.following.append(self.FOLLOW_additive_expression_in_shift_expression2001)
- self.additive_expression()
- self.following.pop()
- if self.failed:
- return
- # C.g:512:24: ( ( '<<' | '>>' ) additive_expression )*
- while True: #loop83
- alt83 = 2
- LA83_0 = self.input.LA(1)
-
- if ((101 <= LA83_0 <= 102)) :
- alt83 = 1
-
-
- if alt83 == 1:
- # C.g:512:25: ( '<<' | '>>' ) additive_expression
- if (101 <= self.input.LA(1) <= 102):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_shift_expression2004
- )
- raise mse
-
-
- self.following.append(self.FOLLOW_additive_expression_in_shift_expression2010)
- self.additive_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop83
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 59, shift_expression_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end shift_expression
-
-
- # $ANTLR start statement
- # C.g:517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );
- def statement(self, ):
-
- statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 60):
- return
-
- # C.g:518:2: ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration )
- alt84 = 11
- LA84 = self.input.LA(1)
- if LA84 == IDENTIFIER:
- LA84 = self.input.LA(2)
- if LA84 == 62:
- LA84_43 = self.input.LA(3)
-
- if (self.synpred169()) :
- alt84 = 3
- elif (self.synpred173()) :
- alt84 = 7
- elif (self.synpred174()) :
- alt84 = 8
- elif (True) :
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 43, self.input)
-
- raise nvae
-
- elif LA84 == 47:
- alt84 = 1
- elif LA84 == STRING_LITERAL or LA84 == 27 or LA84 == 28 or LA84 == 64 or LA84 == 68 or LA84 == 69 or LA84 == 70 or LA84 == 71 or LA84 == 72 or LA84 == 73 or LA84 == 75 or LA84 == 76 or LA84 == 77 or LA84 == 80 or LA84 == 81 or LA84 == 82 or LA84 == 83 or LA84 == 84 or LA84 == 85 or LA84 == 86 or LA84 == 87 or LA84 == 88 or LA84 == 89 or LA84 == 90 or LA84 == 91 or LA84 == 92 or LA84 == 93 or LA84 == 94 or LA84 == 95 or LA84 == 96 or LA84 == 97 or LA84 == 98 or LA84 == 99 or LA84 == 100 or LA84 == 101 or LA84 == 102:
- alt84 = 3
- elif LA84 == 66:
- LA84_47 = self.input.LA(3)
-
- if (self.synpred169()) :
- alt84 = 3
- elif (True) :
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 47, self.input)
-
- raise nvae
-
- elif LA84 == IDENTIFIER:
- LA84_53 = self.input.LA(3)
-
- if (self.synpred169()) :
- alt84 = 3
- elif (True) :
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 53, self.input)
-
- raise nvae
-
- elif LA84 == 25:
- LA84_68 = self.input.LA(3)
-
- if (self.synpred169()) :
- alt84 = 3
- elif (True) :
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 68, self.input)
-
- raise nvae
-
- elif LA84 == 29 or LA84 == 30 or LA84 == 31 or LA84 == 32 or LA84 == 33 or LA84 == 34 or LA84 == 35 or LA84 == 36 or LA84 == 37 or LA84 == 38 or LA84 == 39 or LA84 == 40 or LA84 == 41 or LA84 == 42 or LA84 == 45 or LA84 == 46 or LA84 == 48 or LA84 == 49 or LA84 == 50 or LA84 == 51 or LA84 == 52 or LA84 == 53 or LA84 == 54 or LA84 == 55 or LA84 == 56 or LA84 == 57 or LA84 == 58 or LA84 == 59 or LA84 == 60 or LA84 == 61:
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 1, self.input)
-
- raise nvae
-
- elif LA84 == 106 or LA84 == 107:
- alt84 = 1
- elif LA84 == 43:
- alt84 = 2
- elif LA84 == HEX_LITERAL or LA84 == OCTAL_LITERAL or LA84 == DECIMAL_LITERAL or LA84 == CHARACTER_LITERAL or LA84 == STRING_LITERAL or LA84 == FLOATING_POINT_LITERAL or LA84 == 25 or LA84 == 62 or LA84 == 66 or LA84 == 68 or LA84 == 69 or LA84 == 72 or LA84 == 73 or LA84 == 74 or LA84 == 77 or LA84 == 78 or LA84 == 79:
- alt84 = 3
- elif LA84 == 108 or LA84 == 110:
- alt84 = 4
- elif LA84 == 111 or LA84 == 112 or LA84 == 113:
- alt84 = 5
- elif LA84 == 114 or LA84 == 115 or LA84 == 116 or LA84 == 117:
- alt84 = 6
- elif LA84 == 103:
- alt84 = 8
- elif LA84 == 104:
- alt84 = 9
- elif LA84 == 105:
- alt84 = 10
- elif LA84 == 26 or LA84 == 29 or LA84 == 30 or LA84 == 31 or LA84 == 32 or LA84 == 33 or LA84 == 34 or LA84 == 35 or LA84 == 36 or LA84 == 37 or LA84 == 38 or LA84 == 39 or LA84 == 40 or LA84 == 41 or LA84 == 42 or LA84 == 45 or LA84 == 46 or LA84 == 48 or LA84 == 49 or LA84 == 50 or LA84 == 51 or LA84 == 52 or LA84 == 53 or LA84 == 54 or LA84 == 55 or LA84 == 56 or LA84 == 57 or LA84 == 58 or LA84 == 59 or LA84 == 60 or LA84 == 61:
- alt84 = 11
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("517:1: statement : ( labeled_statement | compound_statement | expression_statement | selection_statement | iteration_statement | jump_statement | macro_statement | asm2_statement | asm1_statement | asm_statement | declaration );", 84, 0, self.input)
-
- raise nvae
-
- if alt84 == 1:
- # C.g:518:4: labeled_statement
- self.following.append(self.FOLLOW_labeled_statement_in_statement2025)
- self.labeled_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 2:
- # C.g:519:4: compound_statement
- self.following.append(self.FOLLOW_compound_statement_in_statement2030)
- self.compound_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 3:
- # C.g:520:4: expression_statement
- self.following.append(self.FOLLOW_expression_statement_in_statement2035)
- self.expression_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 4:
- # C.g:521:4: selection_statement
- self.following.append(self.FOLLOW_selection_statement_in_statement2040)
- self.selection_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 5:
- # C.g:522:4: iteration_statement
- self.following.append(self.FOLLOW_iteration_statement_in_statement2045)
- self.iteration_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 6:
- # C.g:523:4: jump_statement
- self.following.append(self.FOLLOW_jump_statement_in_statement2050)
- self.jump_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 7:
- # C.g:524:4: macro_statement
- self.following.append(self.FOLLOW_macro_statement_in_statement2055)
- self.macro_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 8:
- # C.g:525:4: asm2_statement
- self.following.append(self.FOLLOW_asm2_statement_in_statement2060)
- self.asm2_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 9:
- # C.g:526:4: asm1_statement
- self.following.append(self.FOLLOW_asm1_statement_in_statement2065)
- self.asm1_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 10:
- # C.g:527:4: asm_statement
- self.following.append(self.FOLLOW_asm_statement_in_statement2070)
- self.asm_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt84 == 11:
- # C.g:528:4: declaration
- self.following.append(self.FOLLOW_declaration_in_statement2075)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 60, statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end statement
-
-
- # $ANTLR start asm2_statement
- # C.g:531:1: asm2_statement : ( '__asm__' )? IDENTIFIER '(' (~ ( ';' ) )* ')' ';' ;
- def asm2_statement(self, ):
-
- asm2_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 61):
- return
-
- # C.g:532:2: ( ( '__asm__' )? IDENTIFIER '(' (~ ( ';' ) )* ')' ';' )
- # C.g:532:4: ( '__asm__' )? IDENTIFIER '(' (~ ( ';' ) )* ')' ';'
- # C.g:532:4: ( '__asm__' )?
- alt85 = 2
- LA85_0 = self.input.LA(1)
-
- if (LA85_0 == 103) :
- alt85 = 1
- if alt85 == 1:
- # C.g:0:0: '__asm__'
- self.match(self.input, 103, self.FOLLOW_103_in_asm2_statement2086)
- if self.failed:
- return
-
-
-
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_asm2_statement2089)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_asm2_statement2091)
- if self.failed:
- return
- # C.g:532:30: (~ ( ';' ) )*
- while True: #loop86
- alt86 = 2
- LA86_0 = self.input.LA(1)
-
- if (LA86_0 == 63) :
- LA86_1 = self.input.LA(2)
-
- if ((IDENTIFIER <= LA86_1 <= LINE_COMMAND) or (26 <= LA86_1 <= 117)) :
- alt86 = 1
-
-
- elif ((IDENTIFIER <= LA86_0 <= LINE_COMMAND) or (26 <= LA86_0 <= 62) or (64 <= LA86_0 <= 117)) :
- alt86 = 1
-
-
- if alt86 == 1:
- # C.g:532:31: ~ ( ';' )
- if (IDENTIFIER <= self.input.LA(1) <= LINE_COMMAND) or (26 <= self.input.LA(1) <= 117):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_asm2_statement2094
- )
- raise mse
-
-
-
-
- else:
- break #loop86
-
-
- self.match(self.input, 63, self.FOLLOW_63_in_asm2_statement2101)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_asm2_statement2103)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 61, asm2_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end asm2_statement
-
-
- # $ANTLR start asm1_statement
- # C.g:535:1: asm1_statement : '_asm' '{' (~ ( '}' ) )* '}' ;
- def asm1_statement(self, ):
-
- asm1_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 62):
- return
-
- # C.g:536:2: ( '_asm' '{' (~ ( '}' ) )* '}' )
- # C.g:536:4: '_asm' '{' (~ ( '}' ) )* '}'
- self.match(self.input, 104, self.FOLLOW_104_in_asm1_statement2115)
- if self.failed:
- return
- self.match(self.input, 43, self.FOLLOW_43_in_asm1_statement2117)
- if self.failed:
- return
- # C.g:536:15: (~ ( '}' ) )*
- while True: #loop87
- alt87 = 2
- LA87_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA87_0 <= 43) or (45 <= LA87_0 <= 117)) :
- alt87 = 1
-
-
- if alt87 == 1:
- # C.g:536:16: ~ ( '}' )
- if (IDENTIFIER <= self.input.LA(1) <= 43) or (45 <= self.input.LA(1) <= 117):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_asm1_statement2120
- )
- raise mse
-
-
-
-
- else:
- break #loop87
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_asm1_statement2127)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 62, asm1_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end asm1_statement
-
-
- # $ANTLR start asm_statement
- # C.g:539:1: asm_statement : '__asm' '{' (~ ( '}' ) )* '}' ;
- def asm_statement(self, ):
-
- asm_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 63):
- return
-
- # C.g:540:2: ( '__asm' '{' (~ ( '}' ) )* '}' )
- # C.g:540:4: '__asm' '{' (~ ( '}' ) )* '}'
- self.match(self.input, 105, self.FOLLOW_105_in_asm_statement2138)
- if self.failed:
- return
- self.match(self.input, 43, self.FOLLOW_43_in_asm_statement2140)
- if self.failed:
- return
- # C.g:540:16: (~ ( '}' ) )*
- while True: #loop88
- alt88 = 2
- LA88_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA88_0 <= 43) or (45 <= LA88_0 <= 117)) :
- alt88 = 1
-
-
- if alt88 == 1:
- # C.g:540:17: ~ ( '}' )
- if (IDENTIFIER <= self.input.LA(1) <= 43) or (45 <= self.input.LA(1) <= 117):
- self.input.consume();
- self.errorRecovery = False
- self.failed = False
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- mse = MismatchedSetException(None, self.input)
- self.recoverFromMismatchedSet(
- self.input, mse, self.FOLLOW_set_in_asm_statement2143
- )
- raise mse
-
-
-
-
- else:
- break #loop88
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_asm_statement2150)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 63, asm_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end asm_statement
-
-
- # $ANTLR start macro_statement
- # C.g:543:1: macro_statement : IDENTIFIER '(' ( declaration )* ( statement_list )? ( expression )? ')' ;
- def macro_statement(self, ):
-
- macro_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 64):
- return
-
- # C.g:544:2: ( IDENTIFIER '(' ( declaration )* ( statement_list )? ( expression )? ')' )
- # C.g:544:4: IDENTIFIER '(' ( declaration )* ( statement_list )? ( expression )? ')'
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_macro_statement2162)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_macro_statement2164)
- if self.failed:
- return
- # C.g:544:19: ( declaration )*
- while True: #loop89
- alt89 = 2
- LA89 = self.input.LA(1)
- if LA89 == IDENTIFIER:
- LA89 = self.input.LA(2)
- if LA89 == 62:
- LA89_45 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_47 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 66:
- LA89_50 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_68 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_71 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_72 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_73 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_74 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_75 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_76 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_77 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_78 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_79 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_80 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_81 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_82 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_83 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_84 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_85 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_86 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 26:
- LA89 = self.input.LA(2)
- if LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_87 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_88 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_89 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_90 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_91 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_92 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_93 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_94 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_95 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_96 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_97 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_98 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_99 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_100 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 66:
- LA89_101 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_102 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_103 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_104 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_105 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_106 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_107 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_108 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_109 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_110 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_111 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_112 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_113 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_114 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_115 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_116 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_117 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_118 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_119 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_120 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_121 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_122 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_123 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_124 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_125 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 34:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_126 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_127 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_128 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_129 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_130 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_131 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_132 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_133 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_134 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_135 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_136 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_137 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_138 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_139 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_140 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_141 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_142 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_143 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_144 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_145 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 35:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_146 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_147 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_148 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_149 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_150 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_151 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_152 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_153 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_154 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_155 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_156 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_157 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_158 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_159 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_160 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_161 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_162 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_163 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_164 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_165 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 36:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_166 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_167 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_168 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_169 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_170 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_171 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_172 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_173 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_174 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_175 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_176 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_177 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_178 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_179 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_180 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_181 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_182 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_183 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_184 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_185 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 37:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_186 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_187 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_188 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_189 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_190 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_191 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_192 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_193 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_194 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_195 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_196 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_197 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_198 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_199 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_200 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_201 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_202 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_203 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_204 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_205 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 38:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_206 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_207 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_208 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_209 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_210 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_211 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_212 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_213 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_214 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_215 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_216 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_217 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_218 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_219 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_220 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_221 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_222 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_223 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_224 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_225 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 39:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_226 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_227 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_228 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_229 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_230 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_231 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_232 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_233 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_234 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_235 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_236 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_237 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_238 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_239 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_240 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_241 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_242 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_243 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_244 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_245 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 40:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_246 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_247 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_248 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_249 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_250 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_251 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_252 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_253 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_254 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_255 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_256 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_257 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_258 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_259 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_260 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_261 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_262 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_263 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_264 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_265 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 41:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_266 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_267 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_268 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_269 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_270 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_271 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_272 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_273 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_274 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_275 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_276 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_277 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_278 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_279 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_280 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_281 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_282 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_283 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_284 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_285 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 42:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_286 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_287 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_288 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_289 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_290 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_291 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_292 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_293 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_294 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_295 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_296 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_297 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_298 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_299 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_300 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_301 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_302 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_303 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_304 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_305 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_40 = self.input.LA(2)
-
- if (LA89_40 == IDENTIFIER) :
- LA89_306 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif (LA89_40 == 43) :
- LA89_307 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
-
- elif LA89 == 48:
- LA89_41 = self.input.LA(2)
-
- if (LA89_41 == 43) :
- LA89_308 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif (LA89_41 == IDENTIFIER) :
- LA89_309 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 58 or LA89 == 59 or LA89 == 60 or LA89 == 61:
- LA89 = self.input.LA(2)
- if LA89 == 66:
- LA89_310 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 58:
- LA89_311 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 59:
- LA89_312 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 60:
- LA89_313 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == IDENTIFIER:
- LA89_314 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 62:
- LA89_315 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 25:
- LA89_316 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 29 or LA89 == 30 or LA89 == 31 or LA89 == 32 or LA89 == 33:
- LA89_317 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 34:
- LA89_318 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 35:
- LA89_319 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 36:
- LA89_320 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 37:
- LA89_321 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 38:
- LA89_322 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 39:
- LA89_323 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 40:
- LA89_324 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 41:
- LA89_325 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 42:
- LA89_326 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 45 or LA89 == 46:
- LA89_327 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 48:
- LA89_328 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
- elif LA89 == 49 or LA89 == 50 or LA89 == 51 or LA89 == 52 or LA89 == 53 or LA89 == 54 or LA89 == 55 or LA89 == 56 or LA89 == 57 or LA89 == 61:
- LA89_329 = self.input.LA(3)
-
- if (self.synpred181()) :
- alt89 = 1
-
-
-
-
- if alt89 == 1:
- # C.g:0:0: declaration
- self.following.append(self.FOLLOW_declaration_in_macro_statement2166)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop89
-
-
- # C.g:544:33: ( statement_list )?
- alt90 = 2
- LA90 = self.input.LA(1)
- if LA90 == IDENTIFIER:
- LA90 = self.input.LA(2)
- if LA90 == 25 or LA90 == 29 or LA90 == 30 or LA90 == 31 or LA90 == 32 or LA90 == 33 or LA90 == 34 or LA90 == 35 or LA90 == 36 or LA90 == 37 or LA90 == 38 or LA90 == 39 or LA90 == 40 or LA90 == 41 or LA90 == 42 or LA90 == 45 or LA90 == 46 or LA90 == 47 or LA90 == 48 or LA90 == 49 or LA90 == 50 or LA90 == 51 or LA90 == 52 or LA90 == 53 or LA90 == 54 or LA90 == 55 or LA90 == 56 or LA90 == 57 or LA90 == 58 or LA90 == 59 or LA90 == 60 or LA90 == 61:
- alt90 = 1
- elif LA90 == 62:
- LA90_45 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_46 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == IDENTIFIER:
- LA90_47 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 64:
- LA90_48 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_49 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_50 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_51 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_52 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_53 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_54 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_55 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_56 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_57 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_58 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_59 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_60 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_61 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_62 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_63 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_64 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_65 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_66 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_67 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_70 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25 or LA90 == 26 or LA90 == 29 or LA90 == 30 or LA90 == 31 or LA90 == 32 or LA90 == 33 or LA90 == 34 or LA90 == 35 or LA90 == 36 or LA90 == 37 or LA90 == 38 or LA90 == 39 or LA90 == 40 or LA90 == 41 or LA90 == 42 or LA90 == 43 or LA90 == 45 or LA90 == 46 or LA90 == 48 or LA90 == 49 or LA90 == 50 or LA90 == 51 or LA90 == 52 or LA90 == 53 or LA90 == 54 or LA90 == 55 or LA90 == 56 or LA90 == 57 or LA90 == 58 or LA90 == 59 or LA90 == 60 or LA90 == 61 or LA90 == 103 or LA90 == 104 or LA90 == 105 or LA90 == 106 or LA90 == 107 or LA90 == 108 or LA90 == 110 or LA90 == 111 or LA90 == 112 or LA90 == 113 or LA90 == 114 or LA90 == 115 or LA90 == 116 or LA90 == 117:
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == 64:
- LA90_87 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_88 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_89 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_90 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_91 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_92 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_93 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_94 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_95 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_96 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_97 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_98 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_99 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_100 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_101 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_102 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_103 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_104 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_105 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_106 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_107 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_108 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == 64:
- LA90_111 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_112 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_113 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_114 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_115 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_116 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_117 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_118 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_119 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_120 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_121 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_122 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_123 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_124 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_125 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_126 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_127 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_128 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_129 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_130 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_131 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_134 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == 64:
- LA90_135 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_136 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_137 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_138 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_139 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_140 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_141 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_142 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_143 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_144 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_145 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_146 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_147 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_148 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_149 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_150 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_151 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_152 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_153 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_154 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_155 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_156 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == 64:
- LA90_159 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_160 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_161 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_162 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_163 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_164 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_165 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_166 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_167 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_168 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_169 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_170 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_171 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_172 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_173 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_174 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_175 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_176 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_177 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_178 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_179 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_181 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == IDENTIFIER:
- LA90_183 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 64:
- LA90_184 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_185 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_186 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_187 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_188 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_189 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_190 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_191 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_192 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_193 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_194 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_195 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_196 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_197 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_198 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_199 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_200 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_201 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_202 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_203 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_204 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_205 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_206 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90 = self.input.LA(2)
- if LA90 == 64:
- LA90_209 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_210 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 75:
- LA90_211 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66:
- LA90_212 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 76:
- LA90_213 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_214 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_215 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 28 or LA90 == 80 or LA90 == 81 or LA90 == 82 or LA90 == 83 or LA90 == 84 or LA90 == 85 or LA90 == 86 or LA90 == 87 or LA90 == 88 or LA90 == 89:
- LA90_216 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 70:
- LA90_217 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 71:
- LA90_218 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 68:
- LA90_219 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 69:
- LA90_220 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 101 or LA90 == 102:
- LA90_221 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 97 or LA90 == 98 or LA90 == 99 or LA90 == 100:
- LA90_222 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 95 or LA90 == 96:
- LA90_223 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 77:
- LA90_224 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 94:
- LA90_225 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 93:
- LA90_226 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 92:
- LA90_227 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 91:
- LA90_228 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 90:
- LA90_229 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 27:
- LA90_230 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 25:
- alt90 = 1
- elif LA90 == 62:
- LA90 = self.input.LA(2)
- if LA90 == IDENTIFIER:
- LA90_233 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90_234 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90_235 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90_236 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90_237 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_238 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90_239 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_240 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_241 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_242 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90_243 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90_244 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 49 or LA90 == 50 or LA90 == 51 or LA90 == 52 or LA90 == 53 or LA90 == 54 or LA90 == 55 or LA90 == 56 or LA90 == 57 or LA90 == 58 or LA90 == 59 or LA90 == 60 or LA90 == 61:
- LA90_245 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 34:
- LA90_246 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 35:
- LA90_247 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 36:
- LA90_248 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 37:
- LA90_249 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 38:
- LA90_250 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 39:
- LA90_251 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 40:
- LA90_252 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 41:
- LA90_253 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 42:
- LA90_254 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 45 or LA90 == 46:
- LA90_255 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 48:
- LA90_256 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90 = self.input.LA(2)
- if LA90 == IDENTIFIER:
- LA90_257 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90_258 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90_259 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90_260 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90_261 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_262 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90_263 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_264 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_265 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_266 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90_267 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90_268 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90 = self.input.LA(2)
- if LA90 == IDENTIFIER:
- LA90_269 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90_270 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90_271 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90_272 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90_273 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_274 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90_275 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 62:
- LA90_276 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_277 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_278 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90_279 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90_280 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90 = self.input.LA(2)
- if LA90 == 62:
- LA90_281 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == IDENTIFIER:
- LA90_282 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90_283 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90_284 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90_285 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90_286 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_287 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90_288 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_289 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_290 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90_291 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90_292 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90 = self.input.LA(2)
- if LA90 == 62:
- LA90_293 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == IDENTIFIER:
- LA90_294 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == HEX_LITERAL:
- LA90_295 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == OCTAL_LITERAL:
- LA90_296 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == DECIMAL_LITERAL:
- LA90_297 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == CHARACTER_LITERAL:
- LA90_298 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == STRING_LITERAL:
- LA90_299 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == FLOATING_POINT_LITERAL:
- LA90_300 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 72:
- LA90_301 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 73:
- LA90_302 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 66 or LA90 == 68 or LA90 == 69 or LA90 == 77 or LA90 == 78 or LA90 == 79:
- LA90_303 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- elif LA90 == 74:
- LA90_304 = self.input.LA(3)
-
- if (self.synpred182()) :
- alt90 = 1
- if alt90 == 1:
- # C.g:0:0: statement_list
- self.following.append(self.FOLLOW_statement_list_in_macro_statement2170)
- self.statement_list()
- self.following.pop()
- if self.failed:
- return
-
-
-
- # C.g:544:49: ( expression )?
- alt91 = 2
- LA91_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA91_0 <= FLOATING_POINT_LITERAL) or LA91_0 == 62 or LA91_0 == 66 or (68 <= LA91_0 <= 69) or (72 <= LA91_0 <= 74) or (77 <= LA91_0 <= 79)) :
- alt91 = 1
- if alt91 == 1:
- # C.g:0:0: expression
- self.following.append(self.FOLLOW_expression_in_macro_statement2173)
- self.expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- self.match(self.input, 63, self.FOLLOW_63_in_macro_statement2176)
- if self.failed:
- return
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 64, macro_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end macro_statement
-
-
- # $ANTLR start labeled_statement
- # C.g:547:1: labeled_statement : ( IDENTIFIER ':' statement | 'case' constant_expression ':' statement | 'default' ':' statement );
- def labeled_statement(self, ):
-
- labeled_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 65):
- return
-
- # C.g:548:2: ( IDENTIFIER ':' statement | 'case' constant_expression ':' statement | 'default' ':' statement )
- alt92 = 3
- LA92 = self.input.LA(1)
- if LA92 == IDENTIFIER:
- alt92 = 1
- elif LA92 == 106:
- alt92 = 2
- elif LA92 == 107:
- alt92 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("547:1: labeled_statement : ( IDENTIFIER ':' statement | 'case' constant_expression ':' statement | 'default' ':' statement );", 92, 0, self.input)
-
- raise nvae
-
- if alt92 == 1:
- # C.g:548:4: IDENTIFIER ':' statement
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_labeled_statement2188)
- if self.failed:
- return
- self.match(self.input, 47, self.FOLLOW_47_in_labeled_statement2190)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_labeled_statement2192)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt92 == 2:
- # C.g:549:4: 'case' constant_expression ':' statement
- self.match(self.input, 106, self.FOLLOW_106_in_labeled_statement2197)
- if self.failed:
- return
- self.following.append(self.FOLLOW_constant_expression_in_labeled_statement2199)
- self.constant_expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 47, self.FOLLOW_47_in_labeled_statement2201)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_labeled_statement2203)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt92 == 3:
- # C.g:550:4: 'default' ':' statement
- self.match(self.input, 107, self.FOLLOW_107_in_labeled_statement2208)
- if self.failed:
- return
- self.match(self.input, 47, self.FOLLOW_47_in_labeled_statement2210)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_labeled_statement2212)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 65, labeled_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end labeled_statement
-
- class compound_statement_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start compound_statement
- # C.g:553:1: compound_statement : '{' ( declaration )* ( statement_list )? '}' ;
- def compound_statement(self, ):
-
- retval = self.compound_statement_return()
- retval.start = self.input.LT(1)
- compound_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 66):
- return retval
-
- # C.g:554:2: ( '{' ( declaration )* ( statement_list )? '}' )
- # C.g:554:4: '{' ( declaration )* ( statement_list )? '}'
- self.match(self.input, 43, self.FOLLOW_43_in_compound_statement2223)
- if self.failed:
- return retval
- # C.g:554:8: ( declaration )*
- while True: #loop93
- alt93 = 2
- LA93 = self.input.LA(1)
- if LA93 == IDENTIFIER:
- LA93 = self.input.LA(2)
- if LA93 == 62:
- LA93_44 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_47 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 66:
- LA93_48 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_49 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_50 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_51 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_52 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_53 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_54 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_55 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_56 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_57 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_58 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_59 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_60 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_61 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_62 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_63 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_64 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_65 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 26:
- LA93 = self.input.LA(2)
- if LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_86 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_87 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_88 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_89 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_90 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_91 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_92 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_93 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_94 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_95 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_96 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_97 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_98 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_99 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 66:
- LA93_100 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_101 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_102 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_103 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_104 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_105 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_106 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_107 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_108 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_109 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_110 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_111 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_112 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_113 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_114 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_115 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_116 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_117 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_118 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_119 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_120 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_121 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_122 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_123 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_124 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 34:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_125 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_126 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_127 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_128 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_129 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_130 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_131 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_132 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_133 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_134 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_135 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_136 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_137 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_138 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_139 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_140 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_141 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_142 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_143 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_144 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 35:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_145 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_146 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_147 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_148 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_149 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_150 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_151 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_152 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_153 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_154 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_155 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_156 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_157 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_158 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_159 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_160 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_161 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_162 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_163 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_164 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 36:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_165 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_166 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_167 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_168 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_169 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_170 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_171 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_172 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_173 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_174 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_175 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_176 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_177 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_178 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_179 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_180 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_181 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_182 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_183 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_184 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 37:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_185 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_186 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_187 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_188 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_189 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_190 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_191 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_192 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_193 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_194 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_195 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_196 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_197 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_198 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_199 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_200 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_201 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_202 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_203 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_204 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 38:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_205 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_206 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_207 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_208 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_209 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_210 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_211 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_212 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_213 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_214 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_215 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_216 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_217 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_218 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_219 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_220 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_221 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_222 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_223 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_224 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 39:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_225 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_226 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_227 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_228 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_229 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_230 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_231 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_232 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_233 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_234 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_235 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_236 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_237 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_238 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_239 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_240 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_241 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_242 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_243 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_244 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 40:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_245 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_246 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_247 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_248 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_249 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_250 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_251 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_252 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_253 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_254 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_255 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_256 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_257 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_258 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_259 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_260 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_261 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_262 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_263 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_264 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 41:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_265 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_266 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_267 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_268 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_269 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_270 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_271 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_272 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_273 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_274 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_275 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_276 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_277 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_278 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_279 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_280 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_281 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_282 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_283 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_284 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 42:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_285 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_286 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_287 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_288 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_289 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_290 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_291 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_292 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_293 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_294 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_295 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_296 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_297 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_298 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_299 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_300 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_301 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_302 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_303 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_304 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_40 = self.input.LA(2)
-
- if (LA93_40 == IDENTIFIER) :
- LA93_305 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif (LA93_40 == 43) :
- LA93_306 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
-
- elif LA93 == 48:
- LA93_41 = self.input.LA(2)
-
- if (LA93_41 == 43) :
- LA93_307 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif (LA93_41 == IDENTIFIER) :
- LA93_308 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 58 or LA93 == 59 or LA93 == 60 or LA93 == 61:
- LA93 = self.input.LA(2)
- if LA93 == 66:
- LA93_309 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 58:
- LA93_310 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 59:
- LA93_311 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 60:
- LA93_312 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == IDENTIFIER:
- LA93_313 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 62:
- LA93_314 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 25:
- LA93_315 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 29 or LA93 == 30 or LA93 == 31 or LA93 == 32 or LA93 == 33:
- LA93_316 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 34:
- LA93_317 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 35:
- LA93_318 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 36:
- LA93_319 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 37:
- LA93_320 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 38:
- LA93_321 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 39:
- LA93_322 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 40:
- LA93_323 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 41:
- LA93_324 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 42:
- LA93_325 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 45 or LA93 == 46:
- LA93_326 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 48:
- LA93_327 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
- elif LA93 == 49 or LA93 == 50 or LA93 == 51 or LA93 == 52 or LA93 == 53 or LA93 == 54 or LA93 == 55 or LA93 == 56 or LA93 == 57 or LA93 == 61:
- LA93_328 = self.input.LA(3)
-
- if (self.synpred186()) :
- alt93 = 1
-
-
-
-
- if alt93 == 1:
- # C.g:0:0: declaration
- self.following.append(self.FOLLOW_declaration_in_compound_statement2225)
- self.declaration()
- self.following.pop()
- if self.failed:
- return retval
-
-
- else:
- break #loop93
-
-
- # C.g:554:21: ( statement_list )?
- alt94 = 2
- LA94_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA94_0 <= FLOATING_POINT_LITERAL) or (25 <= LA94_0 <= 26) or (29 <= LA94_0 <= 43) or (45 <= LA94_0 <= 46) or (48 <= LA94_0 <= 62) or LA94_0 == 66 or (68 <= LA94_0 <= 69) or (72 <= LA94_0 <= 74) or (77 <= LA94_0 <= 79) or (103 <= LA94_0 <= 108) or (110 <= LA94_0 <= 117)) :
- alt94 = 1
- if alt94 == 1:
- # C.g:0:0: statement_list
- self.following.append(self.FOLLOW_statement_list_in_compound_statement2228)
- self.statement_list()
- self.following.pop()
- if self.failed:
- return retval
-
-
-
- self.match(self.input, 44, self.FOLLOW_44_in_compound_statement2231)
- if self.failed:
- return retval
-
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 66, compound_statement_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end compound_statement
-
-
- # $ANTLR start statement_list
- # C.g:557:1: statement_list : ( statement )+ ;
- def statement_list(self, ):
-
- statement_list_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 67):
- return
-
- # C.g:558:2: ( ( statement )+ )
- # C.g:558:4: ( statement )+
- # C.g:558:4: ( statement )+
- cnt95 = 0
- while True: #loop95
- alt95 = 2
- LA95 = self.input.LA(1)
- if LA95 == IDENTIFIER:
- LA95 = self.input.LA(2)
- if LA95 == 62:
- LA95_46 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25 or LA95 == 29 or LA95 == 30 or LA95 == 31 or LA95 == 32 or LA95 == 33 or LA95 == 34 or LA95 == 35 or LA95 == 36 or LA95 == 37 or LA95 == 38 or LA95 == 39 or LA95 == 40 or LA95 == 41 or LA95 == 42 or LA95 == 45 or LA95 == 46 or LA95 == 47 or LA95 == 48 or LA95 == 49 or LA95 == 50 or LA95 == 51 or LA95 == 52 or LA95 == 53 or LA95 == 54 or LA95 == 55 or LA95 == 56 or LA95 == 57 or LA95 == 58 or LA95 == 59 or LA95 == 60 or LA95 == 61:
- alt95 = 1
- elif LA95 == STRING_LITERAL:
- LA95_48 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == IDENTIFIER:
- LA95_49 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 64:
- LA95_50 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_51 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_52 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_53 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_54 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_55 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_56 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_57 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_58 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_59 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_60 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_61 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_62 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_63 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_64 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_65 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_66 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_67 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_68 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_69 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_88 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == HEX_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == 64:
- LA95_89 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_90 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_91 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_92 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_93 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_94 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_95 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_96 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_97 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_98 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_99 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_100 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_101 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_102 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_103 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_104 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_105 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_106 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_107 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_108 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_109 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_110 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
-
- elif LA95 == OCTAL_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == 64:
- LA95_113 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_114 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_115 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_116 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_117 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_118 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_119 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_120 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_121 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_122 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_123 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_124 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_125 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_126 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_127 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_128 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_129 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_130 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_131 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_132 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_133 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_135 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
-
- elif LA95 == DECIMAL_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == 64:
- LA95_137 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_138 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_139 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_140 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_141 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_142 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_143 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_144 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_145 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_146 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_147 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_148 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_149 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_150 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_151 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_152 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_153 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_154 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_155 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_156 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_157 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_158 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
-
- elif LA95 == CHARACTER_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == 64:
- LA95_161 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_162 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_163 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_164 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_165 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_166 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_167 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_168 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_169 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_170 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_171 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_172 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_173 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_174 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_175 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_176 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_177 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_178 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_179 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_180 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_181 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_182 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
-
- elif LA95 == STRING_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == IDENTIFIER:
- LA95_185 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 64:
- LA95_186 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_187 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_188 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_189 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_190 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_191 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_192 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_193 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_194 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_195 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_196 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_197 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_198 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_199 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_200 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_201 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_202 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_203 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_204 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_205 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_206 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
- elif LA95 == STRING_LITERAL:
- LA95_208 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_209 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95 = self.input.LA(2)
- if LA95 == 64:
- LA95_211 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_212 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 75:
- LA95_213 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66:
- LA95_214 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 76:
- LA95_215 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_216 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_217 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 70:
- LA95_218 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 71:
- LA95_219 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 68:
- LA95_220 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 69:
- LA95_221 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 101 or LA95 == 102:
- LA95_222 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 97 or LA95 == 98 or LA95 == 99 or LA95 == 100:
- LA95_223 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 95 or LA95 == 96:
- LA95_224 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 77:
- LA95_225 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 94:
- LA95_226 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 93:
- LA95_227 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 92:
- LA95_228 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 91:
- LA95_229 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 90:
- LA95_230 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 27:
- LA95_231 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 25:
- alt95 = 1
- elif LA95 == 28 or LA95 == 80 or LA95 == 81 or LA95 == 82 or LA95 == 83 or LA95 == 84 or LA95 == 85 or LA95 == 86 or LA95 == 87 or LA95 == 88 or LA95 == 89:
- LA95_234 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 62:
- LA95 = self.input.LA(2)
- if LA95 == IDENTIFIER:
- LA95_235 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == HEX_LITERAL:
- LA95_236 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == OCTAL_LITERAL:
- LA95_237 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == DECIMAL_LITERAL:
- LA95_238 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == CHARACTER_LITERAL:
- LA95_239 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == STRING_LITERAL:
- LA95_240 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95_241 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_242 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_243 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_244 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95_245 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 74:
- LA95_246 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 49 or LA95 == 50 or LA95 == 51 or LA95 == 52 or LA95 == 53 or LA95 == 54 or LA95 == 55 or LA95 == 56 or LA95 == 57 or LA95 == 58 or LA95 == 59 or LA95 == 60 or LA95 == 61:
- LA95_247 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 34:
- LA95_248 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 35:
- LA95_249 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 36:
- LA95_250 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 37:
- LA95_251 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 38:
- LA95_252 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 39:
- LA95_253 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 40:
- LA95_254 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 41:
- LA95_255 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 42:
- LA95_256 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 45 or LA95 == 46:
- LA95_257 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 48:
- LA95_258 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 72:
- LA95 = self.input.LA(2)
- if LA95 == IDENTIFIER:
- LA95_259 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == HEX_LITERAL:
- LA95_260 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == OCTAL_LITERAL:
- LA95_261 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == DECIMAL_LITERAL:
- LA95_262 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == CHARACTER_LITERAL:
- LA95_263 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == STRING_LITERAL:
- LA95_264 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95_265 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_266 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_267 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_268 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95_269 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 74:
- LA95_270 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 73:
- LA95 = self.input.LA(2)
- if LA95 == IDENTIFIER:
- LA95_271 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == HEX_LITERAL:
- LA95_272 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == OCTAL_LITERAL:
- LA95_273 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == DECIMAL_LITERAL:
- LA95_274 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == CHARACTER_LITERAL:
- LA95_275 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == STRING_LITERAL:
- LA95_276 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95_277 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 62:
- LA95_278 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_279 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_280 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95_281 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 74:
- LA95_282 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95 = self.input.LA(2)
- if LA95 == 62:
- LA95_283 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == IDENTIFIER:
- LA95_284 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == HEX_LITERAL:
- LA95_285 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == OCTAL_LITERAL:
- LA95_286 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == DECIMAL_LITERAL:
- LA95_287 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == CHARACTER_LITERAL:
- LA95_288 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == STRING_LITERAL:
- LA95_289 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95_290 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_291 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_292 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95_293 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 74:
- LA95_294 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 74:
- LA95 = self.input.LA(2)
- if LA95 == 62:
- LA95_295 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == IDENTIFIER:
- LA95_296 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == HEX_LITERAL:
- LA95_297 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == OCTAL_LITERAL:
- LA95_298 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == DECIMAL_LITERAL:
- LA95_299 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == CHARACTER_LITERAL:
- LA95_300 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == STRING_LITERAL:
- LA95_301 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == FLOATING_POINT_LITERAL:
- LA95_302 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 72:
- LA95_303 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 73:
- LA95_304 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 66 or LA95 == 68 or LA95 == 69 or LA95 == 77 or LA95 == 78 or LA95 == 79:
- LA95_305 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
- elif LA95 == 74:
- LA95_306 = self.input.LA(3)
-
- if (self.synpred188()) :
- alt95 = 1
-
-
-
- elif LA95 == 25 or LA95 == 26 or LA95 == 29 or LA95 == 30 or LA95 == 31 or LA95 == 32 or LA95 == 33 or LA95 == 34 or LA95 == 35 or LA95 == 36 or LA95 == 37 or LA95 == 38 or LA95 == 39 or LA95 == 40 or LA95 == 41 or LA95 == 42 or LA95 == 43 or LA95 == 45 or LA95 == 46 or LA95 == 48 or LA95 == 49 or LA95 == 50 or LA95 == 51 or LA95 == 52 or LA95 == 53 or LA95 == 54 or LA95 == 55 or LA95 == 56 or LA95 == 57 or LA95 == 58 or LA95 == 59 or LA95 == 60 or LA95 == 61 or LA95 == 103 or LA95 == 104 or LA95 == 105 or LA95 == 106 or LA95 == 107 or LA95 == 108 or LA95 == 110 or LA95 == 111 or LA95 == 112 or LA95 == 113 or LA95 == 114 or LA95 == 115 or LA95 == 116 or LA95 == 117:
- alt95 = 1
-
- if alt95 == 1:
- # C.g:0:0: statement
- self.following.append(self.FOLLOW_statement_in_statement_list2242)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt95 >= 1:
- break #loop95
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(95, self.input)
- raise eee
-
- cnt95 += 1
-
-
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 67, statement_list_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end statement_list
-
- class expression_statement_return(object):
- def __init__(self):
- self.start = None
- self.stop = None
-
-
-
- # $ANTLR start expression_statement
- # C.g:561:1: expression_statement : ( ';' | expression ';' );
- def expression_statement(self, ):
-
- retval = self.expression_statement_return()
- retval.start = self.input.LT(1)
- expression_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 68):
- return retval
-
- # C.g:562:2: ( ';' | expression ';' )
- alt96 = 2
- LA96_0 = self.input.LA(1)
-
- if (LA96_0 == 25) :
- alt96 = 1
- elif ((IDENTIFIER <= LA96_0 <= FLOATING_POINT_LITERAL) or LA96_0 == 62 or LA96_0 == 66 or (68 <= LA96_0 <= 69) or (72 <= LA96_0 <= 74) or (77 <= LA96_0 <= 79)) :
- alt96 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return retval
-
- nvae = NoViableAltException("561:1: expression_statement : ( ';' | expression ';' );", 96, 0, self.input)
-
- raise nvae
-
- if alt96 == 1:
- # C.g:562:4: ';'
- self.match(self.input, 25, self.FOLLOW_25_in_expression_statement2254)
- if self.failed:
- return retval
-
-
- elif alt96 == 2:
- # C.g:563:4: expression ';'
- self.following.append(self.FOLLOW_expression_in_expression_statement2259)
- self.expression()
- self.following.pop()
- if self.failed:
- return retval
- self.match(self.input, 25, self.FOLLOW_25_in_expression_statement2261)
- if self.failed:
- return retval
-
-
- retval.stop = self.input.LT(-1)
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 68, expression_statement_StartIndex)
-
- pass
-
- return retval
-
- # $ANTLR end expression_statement
-
-
- # $ANTLR start selection_statement
- # C.g:566:1: selection_statement : ( 'if' '(' e= expression ')' statement ( options {k=1; backtrack=false; } : 'else' statement )? | 'switch' '(' expression ')' statement );
- def selection_statement(self, ):
-
- selection_statement_StartIndex = self.input.index()
- e = None
-
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 69):
- return
-
- # C.g:567:2: ( 'if' '(' e= expression ')' statement ( options {k=1; backtrack=false; } : 'else' statement )? | 'switch' '(' expression ')' statement )
- alt98 = 2
- LA98_0 = self.input.LA(1)
-
- if (LA98_0 == 108) :
- alt98 = 1
- elif (LA98_0 == 110) :
- alt98 = 2
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("566:1: selection_statement : ( 'if' '(' e= expression ')' statement ( options {k=1; backtrack=false; } : 'else' statement )? | 'switch' '(' expression ')' statement );", 98, 0, self.input)
-
- raise nvae
-
- if alt98 == 1:
- # C.g:567:4: 'if' '(' e= expression ')' statement ( options {k=1; backtrack=false; } : 'else' statement )?
- self.match(self.input, 108, self.FOLLOW_108_in_selection_statement2272)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_selection_statement2274)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_selection_statement2278)
- e = self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_selection_statement2280)
- if self.failed:
- return
- if self.backtracking == 0:
- self.StorePredicateExpression(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
- self.following.append(self.FOLLOW_statement_in_selection_statement2284)
- self.statement()
- self.following.pop()
- if self.failed:
- return
- # C.g:567:167: ( options {k=1; backtrack=false; } : 'else' statement )?
- alt97 = 2
- LA97_0 = self.input.LA(1)
-
- if (LA97_0 == 109) :
- alt97 = 1
- if alt97 == 1:
- # C.g:567:200: 'else' statement
- self.match(self.input, 109, self.FOLLOW_109_in_selection_statement2299)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_selection_statement2301)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- elif alt98 == 2:
- # C.g:568:4: 'switch' '(' expression ')' statement
- self.match(self.input, 110, self.FOLLOW_110_in_selection_statement2308)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_selection_statement2310)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_selection_statement2312)
- self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_selection_statement2314)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_selection_statement2316)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 69, selection_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end selection_statement
-
-
- # $ANTLR start iteration_statement
- # C.g:571:1: iteration_statement : ( 'while' '(' e= expression ')' statement | 'do' statement 'while' '(' e= expression ')' ';' | 'for' '(' expression_statement e= expression_statement ( expression )? ')' statement );
- def iteration_statement(self, ):
-
- iteration_statement_StartIndex = self.input.index()
- e = None
-
-
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 70):
- return
-
- # C.g:572:2: ( 'while' '(' e= expression ')' statement | 'do' statement 'while' '(' e= expression ')' ';' | 'for' '(' expression_statement e= expression_statement ( expression )? ')' statement )
- alt100 = 3
- LA100 = self.input.LA(1)
- if LA100 == 111:
- alt100 = 1
- elif LA100 == 112:
- alt100 = 2
- elif LA100 == 113:
- alt100 = 3
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("571:1: iteration_statement : ( 'while' '(' e= expression ')' statement | 'do' statement 'while' '(' e= expression ')' ';' | 'for' '(' expression_statement e= expression_statement ( expression )? ')' statement );", 100, 0, self.input)
-
- raise nvae
-
- if alt100 == 1:
- # C.g:572:4: 'while' '(' e= expression ')' statement
- self.match(self.input, 111, self.FOLLOW_111_in_iteration_statement2327)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_iteration_statement2329)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_iteration_statement2333)
- e = self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_iteration_statement2335)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_iteration_statement2337)
- self.statement()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
- self.StorePredicateExpression(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
-
-
- elif alt100 == 2:
- # C.g:573:4: 'do' statement 'while' '(' e= expression ')' ';'
- self.match(self.input, 112, self.FOLLOW_112_in_iteration_statement2344)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_iteration_statement2346)
- self.statement()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 111, self.FOLLOW_111_in_iteration_statement2348)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_iteration_statement2350)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_iteration_statement2354)
- e = self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_iteration_statement2356)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_iteration_statement2358)
- if self.failed:
- return
- if self.backtracking == 0:
- self.StorePredicateExpression(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
-
-
- elif alt100 == 3:
- # C.g:574:4: 'for' '(' expression_statement e= expression_statement ( expression )? ')' statement
- self.match(self.input, 113, self.FOLLOW_113_in_iteration_statement2365)
- if self.failed:
- return
- self.match(self.input, 62, self.FOLLOW_62_in_iteration_statement2367)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_statement_in_iteration_statement2369)
- self.expression_statement()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_statement_in_iteration_statement2373)
- e = self.expression_statement()
- self.following.pop()
- if self.failed:
- return
- # C.g:574:58: ( expression )?
- alt99 = 2
- LA99_0 = self.input.LA(1)
-
- if ((IDENTIFIER <= LA99_0 <= FLOATING_POINT_LITERAL) or LA99_0 == 62 or LA99_0 == 66 or (68 <= LA99_0 <= 69) or (72 <= LA99_0 <= 74) or (77 <= LA99_0 <= 79)) :
- alt99 = 1
- if alt99 == 1:
- # C.g:0:0: expression
- self.following.append(self.FOLLOW_expression_in_iteration_statement2375)
- self.expression()
- self.following.pop()
- if self.failed:
- return
-
-
-
- self.match(self.input, 63, self.FOLLOW_63_in_iteration_statement2378)
- if self.failed:
- return
- self.following.append(self.FOLLOW_statement_in_iteration_statement2380)
- self.statement()
- self.following.pop()
- if self.failed:
- return
- if self.backtracking == 0:
- self.StorePredicateExpression(e.start.line, e.start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start,e.stop))
-
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 70, iteration_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end iteration_statement
-
-
- # $ANTLR start jump_statement
- # C.g:577:1: jump_statement : ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' );
- def jump_statement(self, ):
-
- jump_statement_StartIndex = self.input.index()
- try:
- try:
- if self.backtracking > 0 and self.alreadyParsedRule(self.input, 71):
- return
-
- # C.g:578:2: ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' )
- alt101 = 5
- LA101 = self.input.LA(1)
- if LA101 == 114:
- alt101 = 1
- elif LA101 == 115:
- alt101 = 2
- elif LA101 == 116:
- alt101 = 3
- elif LA101 == 117:
- LA101_4 = self.input.LA(2)
-
- if (LA101_4 == 25) :
- alt101 = 4
- elif ((IDENTIFIER <= LA101_4 <= FLOATING_POINT_LITERAL) or LA101_4 == 62 or LA101_4 == 66 or (68 <= LA101_4 <= 69) or (72 <= LA101_4 <= 74) or (77 <= LA101_4 <= 79)) :
- alt101 = 5
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("577:1: jump_statement : ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' );", 101, 4, self.input)
-
- raise nvae
-
- else:
- if self.backtracking > 0:
- self.failed = True
- return
-
- nvae = NoViableAltException("577:1: jump_statement : ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' );", 101, 0, self.input)
-
- raise nvae
-
- if alt101 == 1:
- # C.g:578:4: 'goto' IDENTIFIER ';'
- self.match(self.input, 114, self.FOLLOW_114_in_jump_statement2393)
- if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_jump_statement2395)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_jump_statement2397)
- if self.failed:
- return
-
-
- elif alt101 == 2:
- # C.g:579:4: 'continue' ';'
- self.match(self.input, 115, self.FOLLOW_115_in_jump_statement2402)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_jump_statement2404)
- if self.failed:
- return
-
-
- elif alt101 == 3:
- # C.g:580:4: 'break' ';'
- self.match(self.input, 116, self.FOLLOW_116_in_jump_statement2409)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_jump_statement2411)
- if self.failed:
- return
-
-
- elif alt101 == 4:
- # C.g:581:4: 'return' ';'
- self.match(self.input, 117, self.FOLLOW_117_in_jump_statement2416)
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_jump_statement2418)
- if self.failed:
- return
-
-
- elif alt101 == 5:
- # C.g:582:4: 'return' expression ';'
- self.match(self.input, 117, self.FOLLOW_117_in_jump_statement2423)
- if self.failed:
- return
- self.following.append(self.FOLLOW_expression_in_jump_statement2425)
- self.expression()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 25, self.FOLLOW_25_in_jump_statement2427)
- if self.failed:
- return
-
-
-
- except RecognitionException, re:
- self.reportError(re)
- self.recover(self.input, re)
- finally:
- if self.backtracking > 0:
- self.memoize(self.input, 71, jump_statement_StartIndex)
-
- pass
-
- return
-
- # $ANTLR end jump_statement
-
- # $ANTLR start synpred2
- def synpred2_fragment(self, ):
- # C.g:119:6: ( declaration_specifiers )
- # C.g:119:6: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_synpred2100)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred2
-
-
-
- # $ANTLR start synpred4
- def synpred4_fragment(self, ):
- # C.g:119:4: ( ( declaration_specifiers )? declarator ( declaration )* '{' )
- # C.g:119:6: ( declaration_specifiers )? declarator ( declaration )* '{'
- # C.g:119:6: ( declaration_specifiers )?
- alt102 = 2
- LA102 = self.input.LA(1)
- if LA102 == 29 or LA102 == 30 or LA102 == 31 or LA102 == 32 or LA102 == 33 or LA102 == 34 or LA102 == 35 or LA102 == 36 or LA102 == 37 or LA102 == 38 or LA102 == 39 or LA102 == 40 or LA102 == 41 or LA102 == 42 or LA102 == 45 or LA102 == 46 or LA102 == 48 or LA102 == 49 or LA102 == 50 or LA102 == 51 or LA102 == 52 or LA102 == 53 or LA102 == 54 or LA102 == 55 or LA102 == 56 or LA102 == 57 or LA102 == 61:
- alt102 = 1
- elif LA102 == IDENTIFIER:
- LA102 = self.input.LA(2)
- if LA102 == 62:
- LA102_21 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 29 or LA102 == 30 or LA102 == 31 or LA102 == 32 or LA102 == 33:
- LA102_23 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 34:
- LA102_24 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 35:
- LA102_25 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 36:
- LA102_26 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 37:
- LA102_27 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 38:
- LA102_28 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 39:
- LA102_29 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 40:
- LA102_30 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 41:
- LA102_31 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 42:
- LA102_32 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 45 or LA102 == 46:
- LA102_33 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 48:
- LA102_34 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == IDENTIFIER:
- LA102_35 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 58:
- LA102_36 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 66:
- alt102 = 1
- elif LA102 == 59:
- LA102_39 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 60:
- LA102_40 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 49 or LA102 == 50 or LA102 == 51 or LA102 == 52 or LA102 == 53 or LA102 == 54 or LA102 == 55 or LA102 == 56 or LA102 == 57 or LA102 == 61:
- LA102_41 = self.input.LA(3)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 58:
- LA102_14 = self.input.LA(2)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 59:
- LA102_16 = self.input.LA(2)
-
- if (self.synpred2()) :
- alt102 = 1
- elif LA102 == 60:
- LA102_17 = self.input.LA(2)
-
- if (self.synpred2()) :
- alt102 = 1
- if alt102 == 1:
- # C.g:0:0: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_synpred4100)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_declarator_in_synpred4103)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
- # C.g:119:41: ( declaration )*
- while True: #loop103
- alt103 = 2
- LA103_0 = self.input.LA(1)
-
- if (LA103_0 == IDENTIFIER or LA103_0 == 26 or (29 <= LA103_0 <= 42) or (45 <= LA103_0 <= 46) or (48 <= LA103_0 <= 61)) :
- alt103 = 1
-
-
- if alt103 == 1:
- # C.g:0:0: declaration
- self.following.append(self.FOLLOW_declaration_in_synpred4105)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop103
-
-
- self.match(self.input, 43, self.FOLLOW_43_in_synpred4108)
- if self.failed:
- return
-
-
- # $ANTLR end synpred4
-
-
-
- # $ANTLR start synpred5
- def synpred5_fragment(self, ):
- # C.g:120:4: ( declaration )
- # C.g:120:4: declaration
- self.following.append(self.FOLLOW_declaration_in_synpred5118)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred5
-
-
-
- # $ANTLR start synpred7
- def synpred7_fragment(self, ):
- # C.g:146:6: ( declaration_specifiers )
- # C.g:146:6: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_synpred7157)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred7
-
-
-
- # $ANTLR start synpred10
- def synpred10_fragment(self, ):
- # C.g:167:18: ( declaration_specifiers )
- # C.g:167:18: declaration_specifiers
- self.following.append(self.FOLLOW_declaration_specifiers_in_synpred10207)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred10
-
-
-
- # $ANTLR start synpred14
- def synpred14_fragment(self, ):
- # C.g:184:7: ( type_specifier )
- # C.g:184:7: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_synpred14272)
- self.type_specifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred14
-
-
-
- # $ANTLR start synpred15
- def synpred15_fragment(self, ):
- # C.g:185:13: ( type_qualifier )
- # C.g:185:13: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred15286)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred15
-
-
-
- # $ANTLR start synpred33
- def synpred33_fragment(self, ):
- # C.g:225:16: ( type_qualifier )
- # C.g:225:16: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred33444)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred33
-
-
-
- # $ANTLR start synpred34
- def synpred34_fragment(self, ):
- # C.g:225:4: ( IDENTIFIER ( type_qualifier )* declarator )
- # C.g:225:5: IDENTIFIER ( type_qualifier )* declarator
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpred34442)
- if self.failed:
- return
- # C.g:225:16: ( type_qualifier )*
- while True: #loop106
- alt106 = 2
- LA106 = self.input.LA(1)
- if LA106 == 58:
- LA106_2 = self.input.LA(2)
-
- if (self.synpred33()) :
- alt106 = 1
-
-
- elif LA106 == 59:
- LA106_3 = self.input.LA(2)
-
- if (self.synpred33()) :
- alt106 = 1
-
-
- elif LA106 == 60:
- LA106_4 = self.input.LA(2)
-
- if (self.synpred33()) :
- alt106 = 1
-
-
- elif LA106 == 49 or LA106 == 50 or LA106 == 51 or LA106 == 52 or LA106 == 53 or LA106 == 54 or LA106 == 55 or LA106 == 56 or LA106 == 57 or LA106 == 61:
- alt106 = 1
-
- if alt106 == 1:
- # C.g:0:0: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred34444)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop106
-
-
- self.following.append(self.FOLLOW_declarator_in_synpred34447)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred34
-
-
-
- # $ANTLR start synpred39
- def synpred39_fragment(self, ):
- # C.g:253:6: ( type_qualifier )
- # C.g:253:6: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred39566)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred39
-
-
-
- # $ANTLR start synpred40
- def synpred40_fragment(self, ):
- # C.g:253:23: ( type_specifier )
- # C.g:253:23: type_specifier
- self.following.append(self.FOLLOW_type_specifier_in_synpred40570)
- self.type_specifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred40
-
-
-
- # $ANTLR start synpred66
- def synpred66_fragment(self, ):
- # C.g:297:4: ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator )
- # C.g:297:4: ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator
- # C.g:297:4: ( pointer )?
- alt111 = 2
- LA111_0 = self.input.LA(1)
-
- if (LA111_0 == 66) :
- alt111 = 1
- if alt111 == 1:
- # C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_synpred66784)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
-
- # C.g:297:13: ( 'EFIAPI' )?
- alt112 = 2
- LA112_0 = self.input.LA(1)
-
- if (LA112_0 == 58) :
- alt112 = 1
- if alt112 == 1:
- # C.g:297:14: 'EFIAPI'
- self.match(self.input, 58, self.FOLLOW_58_in_synpred66788)
- if self.failed:
- return
-
-
-
- # C.g:297:25: ( 'EFI_BOOTSERVICE' )?
- alt113 = 2
- LA113_0 = self.input.LA(1)
-
- if (LA113_0 == 59) :
- alt113 = 1
- if alt113 == 1:
- # C.g:297:26: 'EFI_BOOTSERVICE'
- self.match(self.input, 59, self.FOLLOW_59_in_synpred66793)
- if self.failed:
- return
-
-
-
- # C.g:297:46: ( 'EFI_RUNTIMESERVICE' )?
- alt114 = 2
- LA114_0 = self.input.LA(1)
-
- if (LA114_0 == 60) :
- alt114 = 1
- if alt114 == 1:
- # C.g:297:47: 'EFI_RUNTIMESERVICE'
- self.match(self.input, 60, self.FOLLOW_60_in_synpred66798)
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_direct_declarator_in_synpred66802)
- self.direct_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred66
-
-
-
- # $ANTLR start synpred67
- def synpred67_fragment(self, ):
- # C.g:303:15: ( declarator_suffix )
- # C.g:303:15: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_synpred67821)
- self.declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred67
-
-
-
- # $ANTLR start synpred69
- def synpred69_fragment(self, ):
- # C.g:304:9: ( 'EFIAPI' )
- # C.g:304:9: 'EFIAPI'
- self.match(self.input, 58, self.FOLLOW_58_in_synpred69830)
- if self.failed:
- return
-
-
- # $ANTLR end synpred69
-
-
-
- # $ANTLR start synpred70
- def synpred70_fragment(self, ):
- # C.g:304:35: ( declarator_suffix )
- # C.g:304:35: declarator_suffix
- self.following.append(self.FOLLOW_declarator_suffix_in_synpred70838)
- self.declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred70
-
-
-
- # $ANTLR start synpred73
- def synpred73_fragment(self, ):
- # C.g:310:9: ( '(' parameter_type_list ')' )
- # C.g:310:9: '(' parameter_type_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_synpred73878)
- if self.failed:
- return
- self.following.append(self.FOLLOW_parameter_type_list_in_synpred73880)
- self.parameter_type_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred73882)
- if self.failed:
- return
-
-
- # $ANTLR end synpred73
-
-
-
- # $ANTLR start synpred74
- def synpred74_fragment(self, ):
- # C.g:311:9: ( '(' identifier_list ')' )
- # C.g:311:9: '(' identifier_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_synpred74892)
- if self.failed:
- return
- self.following.append(self.FOLLOW_identifier_list_in_synpred74894)
- self.identifier_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred74896)
- if self.failed:
- return
-
-
- # $ANTLR end synpred74
-
-
-
- # $ANTLR start synpred75
- def synpred75_fragment(self, ):
- # C.g:316:8: ( type_qualifier )
- # C.g:316:8: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred75921)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred75
-
-
-
- # $ANTLR start synpred76
- def synpred76_fragment(self, ):
- # C.g:316:24: ( pointer )
- # C.g:316:24: pointer
- self.following.append(self.FOLLOW_pointer_in_synpred76924)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred76
-
-
-
- # $ANTLR start synpred77
- def synpred77_fragment(self, ):
- # C.g:316:4: ( '*' ( type_qualifier )+ ( pointer )? )
- # C.g:316:4: '*' ( type_qualifier )+ ( pointer )?
- self.match(self.input, 66, self.FOLLOW_66_in_synpred77919)
- if self.failed:
- return
- # C.g:316:8: ( type_qualifier )+
- cnt116 = 0
- while True: #loop116
- alt116 = 2
- LA116_0 = self.input.LA(1)
-
- if ((49 <= LA116_0 <= 61)) :
- alt116 = 1
-
-
- if alt116 == 1:
- # C.g:0:0: type_qualifier
- self.following.append(self.FOLLOW_type_qualifier_in_synpred77921)
- self.type_qualifier()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- if cnt116 >= 1:
- break #loop116
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(116, self.input)
- raise eee
-
- cnt116 += 1
-
-
- # C.g:316:24: ( pointer )?
- alt117 = 2
- LA117_0 = self.input.LA(1)
-
- if (LA117_0 == 66) :
- alt117 = 1
- if alt117 == 1:
- # C.g:0:0: pointer
- self.following.append(self.FOLLOW_pointer_in_synpred77924)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- # $ANTLR end synpred77
-
-
-
- # $ANTLR start synpred78
- def synpred78_fragment(self, ):
- # C.g:317:4: ( '*' pointer )
- # C.g:317:4: '*' pointer
- self.match(self.input, 66, self.FOLLOW_66_in_synpred78930)
- if self.failed:
- return
- self.following.append(self.FOLLOW_pointer_in_synpred78932)
- self.pointer()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred78
-
-
-
- # $ANTLR start synpred81
- def synpred81_fragment(self, ):
- # C.g:326:32: ( 'OPTIONAL' )
- # C.g:326:32: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_synpred81977)
- if self.failed:
- return
-
-
- # $ANTLR end synpred81
-
-
-
- # $ANTLR start synpred82
- def synpred82_fragment(self, ):
- # C.g:326:27: ( ',' ( 'OPTIONAL' )? parameter_declaration )
- # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declaration
- self.match(self.input, 27, self.FOLLOW_27_in_synpred82974)
- if self.failed:
- return
- # C.g:326:31: ( 'OPTIONAL' )?
- alt119 = 2
- LA119_0 = self.input.LA(1)
-
- if (LA119_0 == 53) :
- LA119_1 = self.input.LA(2)
-
- if (self.synpred81()) :
- alt119 = 1
- if alt119 == 1:
- # C.g:326:32: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_synpred82977)
- if self.failed:
- return
-
-
-
- self.following.append(self.FOLLOW_parameter_declaration_in_synpred82981)
- self.parameter_declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred82
-
-
-
- # $ANTLR start synpred83
- def synpred83_fragment(self, ):
- # C.g:330:28: ( declarator )
- # C.g:330:28: declarator
- self.following.append(self.FOLLOW_declarator_in_synpred83997)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred83
-
-
-
- # $ANTLR start synpred84
- def synpred84_fragment(self, ):
- # C.g:330:39: ( abstract_declarator )
- # C.g:330:39: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_synpred84999)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred84
-
-
-
- # $ANTLR start synpred86
- def synpred86_fragment(self, ):
- # C.g:330:4: ( declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? )
- # C.g:330:4: declaration_specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )?
- self.following.append(self.FOLLOW_declaration_specifiers_in_synpred86994)
- self.declaration_specifiers()
- self.following.pop()
- if self.failed:
- return
- # C.g:330:27: ( declarator | abstract_declarator )*
- while True: #loop120
- alt120 = 3
- LA120 = self.input.LA(1)
- if LA120 == 66:
- LA120_3 = self.input.LA(2)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == IDENTIFIER or LA120 == 58 or LA120 == 59 or LA120 == 60:
- alt120 = 1
- elif LA120 == 62:
- LA120 = self.input.LA(2)
- if LA120 == 29 or LA120 == 30 or LA120 == 31 or LA120 == 32 or LA120 == 33 or LA120 == 34 or LA120 == 35 or LA120 == 36 or LA120 == 37 or LA120 == 38 or LA120 == 39 or LA120 == 40 or LA120 == 41 or LA120 == 42 or LA120 == 45 or LA120 == 46 or LA120 == 48 or LA120 == 49 or LA120 == 50 or LA120 == 51 or LA120 == 52 or LA120 == 53 or LA120 == 54 or LA120 == 55 or LA120 == 56 or LA120 == 57 or LA120 == 61 or LA120 == 63 or LA120 == 64:
- alt120 = 2
- elif LA120 == 58:
- LA120_21 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == 66:
- LA120_22 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == 59:
- LA120_23 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == 60:
- LA120_24 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == IDENTIFIER:
- LA120_25 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
- elif LA120 == 62:
- LA120_26 = self.input.LA(3)
-
- if (self.synpred83()) :
- alt120 = 1
- elif (self.synpred84()) :
- alt120 = 2
-
-
-
- elif LA120 == 64:
- alt120 = 2
-
- if alt120 == 1:
- # C.g:330:28: declarator
- self.following.append(self.FOLLOW_declarator_in_synpred86997)
- self.declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- elif alt120 == 2:
- # C.g:330:39: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_synpred86999)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- else:
- break #loop120
-
-
- # C.g:330:61: ( 'OPTIONAL' )?
- alt121 = 2
- LA121_0 = self.input.LA(1)
-
- if (LA121_0 == 53) :
- alt121 = 1
- if alt121 == 1:
- # C.g:330:62: 'OPTIONAL'
- self.match(self.input, 53, self.FOLLOW_53_in_synpred861004)
- if self.failed:
- return
-
-
-
-
-
- # $ANTLR end synpred86
-
-
-
- # $ANTLR start synpred90
- def synpred90_fragment(self, ):
- # C.g:341:4: ( specifier_qualifier_list ( abstract_declarator )? )
- # C.g:341:4: specifier_qualifier_list ( abstract_declarator )?
- self.following.append(self.FOLLOW_specifier_qualifier_list_in_synpred901046)
- self.specifier_qualifier_list()
- self.following.pop()
- if self.failed:
- return
- # C.g:341:29: ( abstract_declarator )?
- alt122 = 2
- LA122_0 = self.input.LA(1)
-
- if (LA122_0 == 62 or LA122_0 == 64 or LA122_0 == 66) :
- alt122 = 1
- if alt122 == 1:
- # C.g:0:0: abstract_declarator
- self.following.append(self.FOLLOW_abstract_declarator_in_synpred901048)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
-
-
-
- # $ANTLR end synpred90
-
-
-
- # $ANTLR start synpred91
- def synpred91_fragment(self, ):
- # C.g:346:12: ( direct_abstract_declarator )
- # C.g:346:12: direct_abstract_declarator
- self.following.append(self.FOLLOW_direct_abstract_declarator_in_synpred911067)
- self.direct_abstract_declarator()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred91
-
-
-
- # $ANTLR start synpred93
- def synpred93_fragment(self, ):
- # C.g:351:6: ( '(' abstract_declarator ')' )
- # C.g:351:6: '(' abstract_declarator ')'
- self.match(self.input, 62, self.FOLLOW_62_in_synpred931086)
- if self.failed:
- return
- self.following.append(self.FOLLOW_abstract_declarator_in_synpred931088)
- self.abstract_declarator()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred931090)
- if self.failed:
- return
-
-
- # $ANTLR end synpred93
-
-
-
- # $ANTLR start synpred94
- def synpred94_fragment(self, ):
- # C.g:351:65: ( abstract_declarator_suffix )
- # C.g:351:65: abstract_declarator_suffix
- self.following.append(self.FOLLOW_abstract_declarator_suffix_in_synpred941098)
- self.abstract_declarator_suffix()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred94
-
-
-
- # $ANTLR start synpred109
- def synpred109_fragment(self, ):
- # C.g:386:4: ( '(' type_name ')' cast_expression )
- # C.g:386:4: '(' type_name ')' cast_expression
- self.match(self.input, 62, self.FOLLOW_62_in_synpred1091282)
- if self.failed:
- return
- self.following.append(self.FOLLOW_type_name_in_synpred1091284)
- self.type_name()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred1091286)
- if self.failed:
- return
- self.following.append(self.FOLLOW_cast_expression_in_synpred1091288)
- self.cast_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred109
-
-
-
- # $ANTLR start synpred114
- def synpred114_fragment(self, ):
- # C.g:395:4: ( 'sizeof' unary_expression )
- # C.g:395:4: 'sizeof' unary_expression
- self.match(self.input, 74, self.FOLLOW_74_in_synpred1141330)
- if self.failed:
- return
- self.following.append(self.FOLLOW_unary_expression_in_synpred1141332)
- self.unary_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred114
-
-
-
- # $ANTLR start synpred117
- def synpred117_fragment(self, ):
- # C.g:409:13: ( '(' argument_expression_list ')' )
- # C.g:409:13: '(' argument_expression_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_synpred1171420)
- if self.failed:
- return
- self.following.append(self.FOLLOW_argument_expression_list_in_synpred1171424)
- self.argument_expression_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred1171428)
- if self.failed:
- return
-
-
- # $ANTLR end synpred117
-
-
-
- # $ANTLR start synpred118
- def synpred118_fragment(self, ):
- # C.g:410:13: ( '(' macro_parameter_list ')' )
- # C.g:410:13: '(' macro_parameter_list ')'
- self.match(self.input, 62, self.FOLLOW_62_in_synpred1181444)
- if self.failed:
- return
- self.following.append(self.FOLLOW_macro_parameter_list_in_synpred1181446)
- self.macro_parameter_list()
- self.following.pop()
- if self.failed:
- return
- self.match(self.input, 63, self.FOLLOW_63_in_synpred1181448)
- if self.failed:
- return
-
-
- # $ANTLR end synpred118
-
-
-
- # $ANTLR start synpred120
- def synpred120_fragment(self, ):
- # C.g:412:13: ( '*' IDENTIFIER )
- # C.g:412:13: '*' IDENTIFIER
- self.match(self.input, 66, self.FOLLOW_66_in_synpred1201482)
- if self.failed:
- return
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpred1201486)
- if self.failed:
- return
-
-
- # $ANTLR end synpred120
-
-
-
- # $ANTLR start synpred137
- def synpred137_fragment(self, ):
- # C.g:443:20: ( STRING_LITERAL )
- # C.g:443:20: STRING_LITERAL
- self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_LITERAL_in_synpred1371683)
- if self.failed:
- return
-
-
- # $ANTLR end synpred137
-
-
-
- # $ANTLR start synpred138
- def synpred138_fragment(self, ):
- # C.g:443:8: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )
- # C.g:443:8: ( IDENTIFIER )* ( STRING_LITERAL )+
- # C.g:443:8: ( IDENTIFIER )*
- while True: #loop125
- alt125 = 2
- LA125_0 = self.input.LA(1)
-
- if (LA125_0 == IDENTIFIER) :
- alt125 = 1
-
-
- if alt125 == 1:
- # C.g:0:0: IDENTIFIER
- self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpred1381680)
- if self.failed:
- return
-
-
- else:
- break #loop125
-
-
- # C.g:443:20: ( STRING_LITERAL )+
- cnt126 = 0
- while True: #loop126
- alt126 = 2
- LA126_0 = self.input.LA(1)
-
- if (LA126_0 == STRING_LITERAL) :
- alt126 = 1
-
-
- if alt126 == 1:
- # C.g:0:0: STRING_LITERAL
- self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_LITERAL_in_synpred1381683)
- if self.failed:
- return
-
-
- else:
- if cnt126 >= 1:
- break #loop126
-
- if self.backtracking > 0:
- self.failed = True
- return
-
- eee = EarlyExitException(126, self.input)
- raise eee
-
- cnt126 += 1
-
-
-
-
- # $ANTLR end synpred138
-
-
-
- # $ANTLR start synpred142
- def synpred142_fragment(self, ):
- # C.g:458:4: ( lvalue assignment_operator assignment_expression )
- # C.g:458:4: lvalue assignment_operator assignment_expression
- self.following.append(self.FOLLOW_lvalue_in_synpred1421744)
- self.lvalue()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_assignment_operator_in_synpred1421746)
- self.assignment_operator()
- self.following.pop()
- if self.failed:
- return
- self.following.append(self.FOLLOW_assignment_expression_in_synpred1421748)
- self.assignment_expression()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred142
-
-
-
- # $ANTLR start synpred169
- def synpred169_fragment(self, ):
- # C.g:520:4: ( expression_statement )
- # C.g:520:4: expression_statement
- self.following.append(self.FOLLOW_expression_statement_in_synpred1692035)
- self.expression_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred169
-
-
-
- # $ANTLR start synpred173
- def synpred173_fragment(self, ):
- # C.g:524:4: ( macro_statement )
- # C.g:524:4: macro_statement
- self.following.append(self.FOLLOW_macro_statement_in_synpred1732055)
- self.macro_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred173
-
-
-
- # $ANTLR start synpred174
- def synpred174_fragment(self, ):
- # C.g:525:4: ( asm2_statement )
- # C.g:525:4: asm2_statement
- self.following.append(self.FOLLOW_asm2_statement_in_synpred1742060)
- self.asm2_statement()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred174
-
-
-
- # $ANTLR start synpred181
- def synpred181_fragment(self, ):
- # C.g:544:19: ( declaration )
- # C.g:544:19: declaration
- self.following.append(self.FOLLOW_declaration_in_synpred1812166)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred181
-
-
-
- # $ANTLR start synpred182
- def synpred182_fragment(self, ):
- # C.g:544:33: ( statement_list )
- # C.g:544:33: statement_list
- self.following.append(self.FOLLOW_statement_list_in_synpred1822170)
- self.statement_list()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred182
-
-
-
- # $ANTLR start synpred186
- def synpred186_fragment(self, ):
- # C.g:554:8: ( declaration )
- # C.g:554:8: declaration
- self.following.append(self.FOLLOW_declaration_in_synpred1862225)
- self.declaration()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred186
-
-
-
- # $ANTLR start synpred188
- def synpred188_fragment(self, ):
- # C.g:558:4: ( statement )
- # C.g:558:4: statement
- self.following.append(self.FOLLOW_statement_in_synpred1882242)
- self.statement()
- self.following.pop()
- if self.failed:
- return
-
-
- # $ANTLR end synpred188
-
-
-
- def synpred69(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred69_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred81(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred81_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred82(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred82_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred66(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred66_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred83(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred83_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred84(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred84_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred67(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred67_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred86(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred86_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred120(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred120_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred40(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred40_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred142(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred142_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred182(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred182_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred109(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred109_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred181(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred181_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred186(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred186_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred188(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred188_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred169(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred169_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred117(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred117_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred70(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred70_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred118(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred118_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred34(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred34_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred33(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred33_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred94(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred94_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred39(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred39_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred74(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred74_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred114(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred114_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred93(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred93_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred75(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred75_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred137(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred137_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred90(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred90_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred138(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred138_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred91(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred91_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred73(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred73_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred5(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred5_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred78(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred78_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred7(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred7_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred76(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred76_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred77(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred77_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred2(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred2_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred4(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred4_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred174(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred174_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred173(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred173_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred14(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred14_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred15(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred15_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
- def synpred10(self):
- self.backtracking += 1
- start = self.input.mark()
- self.synpred10_fragment()
- success = not self.failed
- self.input.rewind(start)
- self.backtracking -= 1
- self.failed = False
- return success
-
-
-
-
-
- FOLLOW_external_declaration_in_translation_unit74 = frozenset([1, 4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])
- FOLLOW_function_definition_in_external_declaration113 = frozenset([1])
- FOLLOW_declaration_in_external_declaration118 = frozenset([1])
- FOLLOW_macro_statement_in_external_declaration123 = frozenset([1, 25])
- FOLLOW_25_in_external_declaration126 = frozenset([1])
- FOLLOW_declaration_specifiers_in_function_definition157 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_declarator_in_function_definition160 = frozenset([4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_declaration_in_function_definition166 = frozenset([4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_compound_statement_in_function_definition171 = frozenset([1])
- FOLLOW_compound_statement_in_function_definition180 = frozenset([1])
- FOLLOW_26_in_declaration203 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])
- FOLLOW_declaration_specifiers_in_declaration207 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_init_declarator_list_in_declaration216 = frozenset([25])
- FOLLOW_25_in_declaration220 = frozenset([1])
- FOLLOW_declaration_specifiers_in_declaration234 = frozenset([4, 25, 58, 59, 60, 62, 66])
- FOLLOW_init_declarator_list_in_declaration238 = frozenset([25])
- FOLLOW_25_in_declaration243 = frozenset([1])
- FOLLOW_storage_class_specifier_in_declaration_specifiers264 = frozenset([1, 4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_specifier_in_declaration_specifiers272 = frozenset([1, 4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_qualifier_in_declaration_specifiers286 = frozenset([1, 4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_init_declarator_in_init_declarator_list308 = frozenset([1, 27])
- FOLLOW_27_in_init_declarator_list311 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_init_declarator_in_init_declarator_list313 = frozenset([1, 27])
- FOLLOW_declarator_in_init_declarator326 = frozenset([1, 28])
- FOLLOW_28_in_init_declarator329 = frozenset([4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_initializer_in_init_declarator331 = frozenset([1])
- FOLLOW_set_in_storage_class_specifier0 = frozenset([1])
- FOLLOW_34_in_type_specifier376 = frozenset([1])
- FOLLOW_35_in_type_specifier381 = frozenset([1])
- FOLLOW_36_in_type_specifier386 = frozenset([1])
- FOLLOW_37_in_type_specifier391 = frozenset([1])
- FOLLOW_38_in_type_specifier396 = frozenset([1])
- FOLLOW_39_in_type_specifier401 = frozenset([1])
- FOLLOW_40_in_type_specifier406 = frozenset([1])
- FOLLOW_41_in_type_specifier411 = frozenset([1])
- FOLLOW_42_in_type_specifier416 = frozenset([1])
- FOLLOW_struct_or_union_specifier_in_type_specifier423 = frozenset([1])
- FOLLOW_enum_specifier_in_type_specifier433 = frozenset([1])
- FOLLOW_type_id_in_type_specifier451 = frozenset([1])
- FOLLOW_IDENTIFIER_in_type_id467 = frozenset([1])
- FOLLOW_struct_or_union_in_struct_or_union_specifier494 = frozenset([4, 43])
- FOLLOW_IDENTIFIER_in_struct_or_union_specifier496 = frozenset([43])
- FOLLOW_43_in_struct_or_union_specifier499 = frozenset([4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_struct_declaration_list_in_struct_or_union_specifier501 = frozenset([44])
- FOLLOW_44_in_struct_or_union_specifier503 = frozenset([1])
- FOLLOW_struct_or_union_in_struct_or_union_specifier508 = frozenset([4])
- FOLLOW_IDENTIFIER_in_struct_or_union_specifier510 = frozenset([1])
- FOLLOW_set_in_struct_or_union0 = frozenset([1])
- FOLLOW_struct_declaration_in_struct_declaration_list537 = frozenset([1, 4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_specifier_qualifier_list_in_struct_declaration549 = frozenset([4, 47, 58, 59, 60, 62, 66])
- FOLLOW_struct_declarator_list_in_struct_declaration551 = frozenset([25])
- FOLLOW_25_in_struct_declaration553 = frozenset([1])
- FOLLOW_type_qualifier_in_specifier_qualifier_list566 = frozenset([1, 4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_specifier_in_specifier_qualifier_list570 = frozenset([1, 4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_struct_declarator_in_struct_declarator_list584 = frozenset([1, 27])
- FOLLOW_27_in_struct_declarator_list587 = frozenset([4, 47, 58, 59, 60, 62, 66])
- FOLLOW_struct_declarator_in_struct_declarator_list589 = frozenset([1, 27])
- FOLLOW_declarator_in_struct_declarator602 = frozenset([1, 47])
- FOLLOW_47_in_struct_declarator605 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_struct_declarator607 = frozenset([1])
- FOLLOW_47_in_struct_declarator614 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_struct_declarator616 = frozenset([1])
- FOLLOW_48_in_enum_specifier634 = frozenset([43])
- FOLLOW_43_in_enum_specifier636 = frozenset([4])
- FOLLOW_enumerator_list_in_enum_specifier638 = frozenset([27, 44])
- FOLLOW_27_in_enum_specifier640 = frozenset([44])
- FOLLOW_44_in_enum_specifier643 = frozenset([1])
- FOLLOW_48_in_enum_specifier648 = frozenset([4])
- FOLLOW_IDENTIFIER_in_enum_specifier650 = frozenset([43])
- FOLLOW_43_in_enum_specifier652 = frozenset([4])
- FOLLOW_enumerator_list_in_enum_specifier654 = frozenset([27, 44])
- FOLLOW_27_in_enum_specifier656 = frozenset([44])
- FOLLOW_44_in_enum_specifier659 = frozenset([1])
- FOLLOW_48_in_enum_specifier664 = frozenset([4])
- FOLLOW_IDENTIFIER_in_enum_specifier666 = frozenset([1])
- FOLLOW_enumerator_in_enumerator_list677 = frozenset([1, 27])
- FOLLOW_27_in_enumerator_list680 = frozenset([4])
- FOLLOW_enumerator_in_enumerator_list682 = frozenset([1, 27])
- FOLLOW_IDENTIFIER_in_enumerator695 = frozenset([1, 28])
- FOLLOW_28_in_enumerator698 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_enumerator700 = frozenset([1])
- FOLLOW_set_in_type_qualifier0 = frozenset([1])
- FOLLOW_pointer_in_declarator784 = frozenset([4, 58, 59, 60, 62])
- FOLLOW_58_in_declarator788 = frozenset([4, 59, 60, 62])
- FOLLOW_59_in_declarator793 = frozenset([4, 60, 62])
- FOLLOW_60_in_declarator798 = frozenset([4, 62])
- FOLLOW_direct_declarator_in_declarator802 = frozenset([1])
- FOLLOW_pointer_in_declarator808 = frozenset([1])
- FOLLOW_IDENTIFIER_in_direct_declarator819 = frozenset([1, 62, 64])
- FOLLOW_declarator_suffix_in_direct_declarator821 = frozenset([1, 62, 64])
- FOLLOW_62_in_direct_declarator827 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_58_in_direct_declarator830 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_declarator_in_direct_declarator834 = frozenset([63])
- FOLLOW_63_in_direct_declarator836 = frozenset([62, 64])
- FOLLOW_declarator_suffix_in_direct_declarator838 = frozenset([1, 62, 64])
- FOLLOW_64_in_declarator_suffix852 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_declarator_suffix854 = frozenset([65])
- FOLLOW_65_in_declarator_suffix856 = frozenset([1])
- FOLLOW_64_in_declarator_suffix866 = frozenset([65])
- FOLLOW_65_in_declarator_suffix868 = frozenset([1])
- FOLLOW_62_in_declarator_suffix878 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_type_list_in_declarator_suffix880 = frozenset([63])
- FOLLOW_63_in_declarator_suffix882 = frozenset([1])
- FOLLOW_62_in_declarator_suffix892 = frozenset([4])
- FOLLOW_identifier_list_in_declarator_suffix894 = frozenset([63])
- FOLLOW_63_in_declarator_suffix896 = frozenset([1])
- FOLLOW_62_in_declarator_suffix906 = frozenset([63])
- FOLLOW_63_in_declarator_suffix908 = frozenset([1])
- FOLLOW_66_in_pointer919 = frozenset([49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_qualifier_in_pointer921 = frozenset([1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_pointer_in_pointer924 = frozenset([1])
- FOLLOW_66_in_pointer930 = frozenset([66])
- FOLLOW_pointer_in_pointer932 = frozenset([1])
- FOLLOW_66_in_pointer937 = frozenset([1])
- FOLLOW_parameter_list_in_parameter_type_list948 = frozenset([1, 27])
- FOLLOW_27_in_parameter_type_list951 = frozenset([53, 67])
- FOLLOW_53_in_parameter_type_list954 = frozenset([67])
- FOLLOW_67_in_parameter_type_list958 = frozenset([1])
- FOLLOW_parameter_declaration_in_parameter_list971 = frozenset([1, 27])
- FOLLOW_27_in_parameter_list974 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_53_in_parameter_list977 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_declaration_in_parameter_list981 = frozenset([1, 27])
- FOLLOW_declaration_specifiers_in_parameter_declaration994 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_declarator_in_parameter_declaration997 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_abstract_declarator_in_parameter_declaration999 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_53_in_parameter_declaration1004 = frozenset([1])
- FOLLOW_pointer_in_parameter_declaration1013 = frozenset([4, 66])
- FOLLOW_IDENTIFIER_in_parameter_declaration1016 = frozenset([1])
- FOLLOW_IDENTIFIER_in_identifier_list1027 = frozenset([1, 27])
- FOLLOW_27_in_identifier_list1031 = frozenset([4])
- FOLLOW_IDENTIFIER_in_identifier_list1033 = frozenset([1, 27])
- FOLLOW_specifier_qualifier_list_in_type_name1046 = frozenset([1, 62, 64, 66])
- FOLLOW_abstract_declarator_in_type_name1048 = frozenset([1])
- FOLLOW_type_id_in_type_name1054 = frozenset([1])
- FOLLOW_pointer_in_abstract_declarator1065 = frozenset([1, 62, 64])
- FOLLOW_direct_abstract_declarator_in_abstract_declarator1067 = frozenset([1])
- FOLLOW_direct_abstract_declarator_in_abstract_declarator1073 = frozenset([1])
- FOLLOW_62_in_direct_abstract_declarator1086 = frozenset([62, 64, 66])
- FOLLOW_abstract_declarator_in_direct_abstract_declarator1088 = frozenset([63])
- FOLLOW_63_in_direct_abstract_declarator1090 = frozenset([1, 62, 64])
- FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1094 = frozenset([1, 62, 64])
- FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1098 = frozenset([1, 62, 64])
- FOLLOW_64_in_abstract_declarator_suffix1110 = frozenset([65])
- FOLLOW_65_in_abstract_declarator_suffix1112 = frozenset([1])
- FOLLOW_64_in_abstract_declarator_suffix1117 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_abstract_declarator_suffix1119 = frozenset([65])
- FOLLOW_65_in_abstract_declarator_suffix1121 = frozenset([1])
- FOLLOW_62_in_abstract_declarator_suffix1126 = frozenset([63])
- FOLLOW_63_in_abstract_declarator_suffix1128 = frozenset([1])
- FOLLOW_62_in_abstract_declarator_suffix1133 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_type_list_in_abstract_declarator_suffix1135 = frozenset([63])
- FOLLOW_63_in_abstract_declarator_suffix1137 = frozenset([1])
- FOLLOW_assignment_expression_in_initializer1150 = frozenset([1])
- FOLLOW_43_in_initializer1155 = frozenset([4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_initializer_list_in_initializer1157 = frozenset([27, 44])
- FOLLOW_27_in_initializer1159 = frozenset([44])
- FOLLOW_44_in_initializer1162 = frozenset([1])
- FOLLOW_initializer_in_initializer_list1173 = frozenset([1, 27])
- FOLLOW_27_in_initializer_list1176 = frozenset([4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_initializer_in_initializer_list1178 = frozenset([1, 27])
- FOLLOW_assignment_expression_in_argument_expression_list1196 = frozenset([1, 27, 53])
- FOLLOW_53_in_argument_expression_list1199 = frozenset([1, 27])
- FOLLOW_27_in_argument_expression_list1204 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_assignment_expression_in_argument_expression_list1206 = frozenset([1, 27, 53])
- FOLLOW_53_in_argument_expression_list1209 = frozenset([1, 27])
- FOLLOW_multiplicative_expression_in_additive_expression1225 = frozenset([1, 68, 69])
- FOLLOW_68_in_additive_expression1229 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_multiplicative_expression_in_additive_expression1231 = frozenset([1, 68, 69])
- FOLLOW_69_in_additive_expression1235 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_multiplicative_expression_in_additive_expression1237 = frozenset([1, 68, 69])
- FOLLOW_cast_expression_in_multiplicative_expression1251 = frozenset([1, 66, 70, 71])
- FOLLOW_66_in_multiplicative_expression1255 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_multiplicative_expression1257 = frozenset([1, 66, 70, 71])
- FOLLOW_70_in_multiplicative_expression1261 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_multiplicative_expression1263 = frozenset([1, 66, 70, 71])
- FOLLOW_71_in_multiplicative_expression1267 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_multiplicative_expression1269 = frozenset([1, 66, 70, 71])
- FOLLOW_62_in_cast_expression1282 = frozenset([4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_name_in_cast_expression1284 = frozenset([63])
- FOLLOW_63_in_cast_expression1286 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_cast_expression1288 = frozenset([1])
- FOLLOW_unary_expression_in_cast_expression1293 = frozenset([1])
- FOLLOW_postfix_expression_in_unary_expression1304 = frozenset([1])
- FOLLOW_72_in_unary_expression1309 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_unary_expression_in_unary_expression1311 = frozenset([1])
- FOLLOW_73_in_unary_expression1316 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_unary_expression_in_unary_expression1318 = frozenset([1])
- FOLLOW_unary_operator_in_unary_expression1323 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_unary_expression1325 = frozenset([1])
- FOLLOW_74_in_unary_expression1330 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_unary_expression_in_unary_expression1332 = frozenset([1])
- FOLLOW_74_in_unary_expression1337 = frozenset([62])
- FOLLOW_62_in_unary_expression1339 = frozenset([4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_name_in_unary_expression1341 = frozenset([63])
- FOLLOW_63_in_unary_expression1343 = frozenset([1])
- FOLLOW_primary_expression_in_postfix_expression1367 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_64_in_postfix_expression1383 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_postfix_expression1385 = frozenset([65])
- FOLLOW_65_in_postfix_expression1387 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_62_in_postfix_expression1401 = frozenset([63])
- FOLLOW_63_in_postfix_expression1405 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_62_in_postfix_expression1420 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_argument_expression_list_in_postfix_expression1424 = frozenset([63])
- FOLLOW_63_in_postfix_expression1428 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_62_in_postfix_expression1444 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_macro_parameter_list_in_postfix_expression1446 = frozenset([63])
- FOLLOW_63_in_postfix_expression1448 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_75_in_postfix_expression1462 = frozenset([4])
- FOLLOW_IDENTIFIER_in_postfix_expression1466 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_66_in_postfix_expression1482 = frozenset([4])
- FOLLOW_IDENTIFIER_in_postfix_expression1486 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_76_in_postfix_expression1502 = frozenset([4])
- FOLLOW_IDENTIFIER_in_postfix_expression1506 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_72_in_postfix_expression1522 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_73_in_postfix_expression1536 = frozenset([1, 62, 64, 66, 72, 73, 75, 76])
- FOLLOW_parameter_declaration_in_macro_parameter_list1559 = frozenset([1, 27])
- FOLLOW_27_in_macro_parameter_list1562 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_declaration_in_macro_parameter_list1564 = frozenset([1, 27])
- FOLLOW_set_in_unary_operator0 = frozenset([1])
- FOLLOW_IDENTIFIER_in_primary_expression1613 = frozenset([1])
- FOLLOW_constant_in_primary_expression1618 = frozenset([1])
- FOLLOW_62_in_primary_expression1623 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_primary_expression1625 = frozenset([63])
- FOLLOW_63_in_primary_expression1627 = frozenset([1])
- FOLLOW_HEX_LITERAL_in_constant1643 = frozenset([1])
- FOLLOW_OCTAL_LITERAL_in_constant1653 = frozenset([1])
- FOLLOW_DECIMAL_LITERAL_in_constant1663 = frozenset([1])
- FOLLOW_CHARACTER_LITERAL_in_constant1671 = frozenset([1])
- FOLLOW_IDENTIFIER_in_constant1680 = frozenset([4, 9])
- FOLLOW_STRING_LITERAL_in_constant1683 = frozenset([1, 4, 9])
- FOLLOW_IDENTIFIER_in_constant1688 = frozenset([1, 4])
- FOLLOW_FLOATING_POINT_LITERAL_in_constant1699 = frozenset([1])
- FOLLOW_assignment_expression_in_expression1715 = frozenset([1, 27])
- FOLLOW_27_in_expression1718 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_assignment_expression_in_expression1720 = frozenset([1, 27])
- FOLLOW_conditional_expression_in_constant_expression1733 = frozenset([1])
- FOLLOW_lvalue_in_assignment_expression1744 = frozenset([28, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89])
- FOLLOW_assignment_operator_in_assignment_expression1746 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_assignment_expression_in_assignment_expression1748 = frozenset([1])
- FOLLOW_conditional_expression_in_assignment_expression1753 = frozenset([1])
- FOLLOW_unary_expression_in_lvalue1765 = frozenset([1])
- FOLLOW_set_in_assignment_operator0 = frozenset([1])
- FOLLOW_logical_or_expression_in_conditional_expression1839 = frozenset([1, 90])
- FOLLOW_90_in_conditional_expression1842 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_conditional_expression1844 = frozenset([47])
- FOLLOW_47_in_conditional_expression1846 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_conditional_expression_in_conditional_expression1848 = frozenset([1])
- FOLLOW_logical_and_expression_in_logical_or_expression1863 = frozenset([1, 91])
- FOLLOW_91_in_logical_or_expression1866 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_logical_and_expression_in_logical_or_expression1868 = frozenset([1, 91])
- FOLLOW_inclusive_or_expression_in_logical_and_expression1881 = frozenset([1, 92])
- FOLLOW_92_in_logical_and_expression1884 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_inclusive_or_expression_in_logical_and_expression1886 = frozenset([1, 92])
- FOLLOW_exclusive_or_expression_in_inclusive_or_expression1899 = frozenset([1, 93])
- FOLLOW_93_in_inclusive_or_expression1902 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_exclusive_or_expression_in_inclusive_or_expression1904 = frozenset([1, 93])
- FOLLOW_and_expression_in_exclusive_or_expression1917 = frozenset([1, 94])
- FOLLOW_94_in_exclusive_or_expression1920 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_and_expression_in_exclusive_or_expression1922 = frozenset([1, 94])
- FOLLOW_equality_expression_in_and_expression1935 = frozenset([1, 77])
- FOLLOW_77_in_and_expression1938 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_equality_expression_in_and_expression1940 = frozenset([1, 77])
- FOLLOW_relational_expression_in_equality_expression1952 = frozenset([1, 95, 96])
- FOLLOW_set_in_equality_expression1955 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_relational_expression_in_equality_expression1961 = frozenset([1, 95, 96])
- FOLLOW_shift_expression_in_relational_expression1975 = frozenset([1, 97, 98, 99, 100])
- FOLLOW_set_in_relational_expression1978 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_shift_expression_in_relational_expression1988 = frozenset([1, 97, 98, 99, 100])
- FOLLOW_additive_expression_in_shift_expression2001 = frozenset([1, 101, 102])
- FOLLOW_set_in_shift_expression2004 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_additive_expression_in_shift_expression2010 = frozenset([1, 101, 102])
- FOLLOW_labeled_statement_in_statement2025 = frozenset([1])
- FOLLOW_compound_statement_in_statement2030 = frozenset([1])
- FOLLOW_expression_statement_in_statement2035 = frozenset([1])
- FOLLOW_selection_statement_in_statement2040 = frozenset([1])
- FOLLOW_iteration_statement_in_statement2045 = frozenset([1])
- FOLLOW_jump_statement_in_statement2050 = frozenset([1])
- FOLLOW_macro_statement_in_statement2055 = frozenset([1])
- FOLLOW_asm2_statement_in_statement2060 = frozenset([1])
- FOLLOW_asm1_statement_in_statement2065 = frozenset([1])
- FOLLOW_asm_statement_in_statement2070 = frozenset([1])
- FOLLOW_declaration_in_statement2075 = frozenset([1])
- FOLLOW_103_in_asm2_statement2086 = frozenset([4])
- FOLLOW_IDENTIFIER_in_asm2_statement2089 = frozenset([62])
- FOLLOW_62_in_asm2_statement2091 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_set_in_asm2_statement2094 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_63_in_asm2_statement2101 = frozenset([25])
- FOLLOW_25_in_asm2_statement2103 = frozenset([1])
- FOLLOW_104_in_asm1_statement2115 = frozenset([43])
- FOLLOW_43_in_asm1_statement2117 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_set_in_asm1_statement2120 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_44_in_asm1_statement2127 = frozenset([1])
- FOLLOW_105_in_asm_statement2138 = frozenset([43])
- FOLLOW_43_in_asm_statement2140 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_set_in_asm_statement2143 = frozenset([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_44_in_asm_statement2150 = frozenset([1])
- FOLLOW_IDENTIFIER_in_macro_statement2162 = frozenset([62])
- FOLLOW_62_in_macro_statement2164 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_declaration_in_macro_statement2166 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_list_in_macro_statement2170 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_macro_statement2173 = frozenset([63])
- FOLLOW_63_in_macro_statement2176 = frozenset([1])
- FOLLOW_IDENTIFIER_in_labeled_statement2188 = frozenset([47])
- FOLLOW_47_in_labeled_statement2190 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_labeled_statement2192 = frozenset([1])
- FOLLOW_106_in_labeled_statement2197 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_constant_expression_in_labeled_statement2199 = frozenset([47])
- FOLLOW_47_in_labeled_statement2201 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_labeled_statement2203 = frozenset([1])
- FOLLOW_107_in_labeled_statement2208 = frozenset([47])
- FOLLOW_47_in_labeled_statement2210 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_labeled_statement2212 = frozenset([1])
- FOLLOW_43_in_compound_statement2223 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_declaration_in_compound_statement2225 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_list_in_compound_statement2228 = frozenset([44])
- FOLLOW_44_in_compound_statement2231 = frozenset([1])
- FOLLOW_statement_in_statement_list2242 = frozenset([1, 4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_25_in_expression_statement2254 = frozenset([1])
- FOLLOW_expression_in_expression_statement2259 = frozenset([25])
- FOLLOW_25_in_expression_statement2261 = frozenset([1])
- FOLLOW_108_in_selection_statement2272 = frozenset([62])
- FOLLOW_62_in_selection_statement2274 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_selection_statement2278 = frozenset([63])
- FOLLOW_63_in_selection_statement2280 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_selection_statement2284 = frozenset([1, 109])
- FOLLOW_109_in_selection_statement2299 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_selection_statement2301 = frozenset([1])
- FOLLOW_110_in_selection_statement2308 = frozenset([62])
- FOLLOW_62_in_selection_statement2310 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_selection_statement2312 = frozenset([63])
- FOLLOW_63_in_selection_statement2314 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_selection_statement2316 = frozenset([1])
- FOLLOW_111_in_iteration_statement2327 = frozenset([62])
- FOLLOW_62_in_iteration_statement2329 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_iteration_statement2333 = frozenset([63])
- FOLLOW_63_in_iteration_statement2335 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_iteration_statement2337 = frozenset([1])
- FOLLOW_112_in_iteration_statement2344 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_iteration_statement2346 = frozenset([111])
- FOLLOW_111_in_iteration_statement2348 = frozenset([62])
- FOLLOW_62_in_iteration_statement2350 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_iteration_statement2354 = frozenset([63])
- FOLLOW_63_in_iteration_statement2356 = frozenset([25])
- FOLLOW_25_in_iteration_statement2358 = frozenset([1])
- FOLLOW_113_in_iteration_statement2365 = frozenset([62])
- FOLLOW_62_in_iteration_statement2367 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_statement_in_iteration_statement2369 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_statement_in_iteration_statement2373 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_iteration_statement2375 = frozenset([63])
- FOLLOW_63_in_iteration_statement2378 = frozenset([4, 5, 6, 7, 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])
- FOLLOW_statement_in_iteration_statement2380 = frozenset([1])
- FOLLOW_114_in_jump_statement2393 = frozenset([4])
- FOLLOW_IDENTIFIER_in_jump_statement2395 = frozenset([25])
- FOLLOW_25_in_jump_statement2397 = frozenset([1])
- FOLLOW_115_in_jump_statement2402 = frozenset([25])
- FOLLOW_25_in_jump_statement2404 = frozenset([1])
- FOLLOW_116_in_jump_statement2409 = frozenset([25])
- FOLLOW_25_in_jump_statement2411 = frozenset([1])
- FOLLOW_117_in_jump_statement2416 = frozenset([25])
- FOLLOW_25_in_jump_statement2418 = frozenset([1])
- FOLLOW_117_in_jump_statement2423 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_expression_in_jump_statement2425 = frozenset([25])
- FOLLOW_25_in_jump_statement2427 = frozenset([1])
- FOLLOW_declaration_specifiers_in_synpred2100 = frozenset([1])
- FOLLOW_declaration_specifiers_in_synpred4100 = frozenset([4, 58, 59, 60, 62, 66])
- FOLLOW_declarator_in_synpred4103 = frozenset([4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_declaration_in_synpred4105 = frozenset([4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_43_in_synpred4108 = frozenset([1])
- FOLLOW_declaration_in_synpred5118 = frozenset([1])
- FOLLOW_declaration_specifiers_in_synpred7157 = frozenset([1])
- FOLLOW_declaration_specifiers_in_synpred10207 = frozenset([1])
- FOLLOW_type_specifier_in_synpred14272 = frozenset([1])
- FOLLOW_type_qualifier_in_synpred15286 = frozenset([1])
- FOLLOW_type_qualifier_in_synpred33444 = frozenset([1])
- FOLLOW_IDENTIFIER_in_synpred34442 = frozenset([4, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])
- FOLLOW_type_qualifier_in_synpred34444 = frozenset([4, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])
- FOLLOW_declarator_in_synpred34447 = frozenset([1])
- FOLLOW_type_qualifier_in_synpred39566 = frozenset([1])
- FOLLOW_type_specifier_in_synpred40570 = frozenset([1])
- FOLLOW_pointer_in_synpred66784 = frozenset([4, 58, 59, 60, 62])
- FOLLOW_58_in_synpred66788 = frozenset([4, 59, 60, 62])
- FOLLOW_59_in_synpred66793 = frozenset([4, 60, 62])
- FOLLOW_60_in_synpred66798 = frozenset([4, 62])
- FOLLOW_direct_declarator_in_synpred66802 = frozenset([1])
- FOLLOW_declarator_suffix_in_synpred67821 = frozenset([1])
- FOLLOW_58_in_synpred69830 = frozenset([1])
- FOLLOW_declarator_suffix_in_synpred70838 = frozenset([1])
- FOLLOW_62_in_synpred73878 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_type_list_in_synpred73880 = frozenset([63])
- FOLLOW_63_in_synpred73882 = frozenset([1])
- FOLLOW_62_in_synpred74892 = frozenset([4])
- FOLLOW_identifier_list_in_synpred74894 = frozenset([63])
- FOLLOW_63_in_synpred74896 = frozenset([1])
- FOLLOW_type_qualifier_in_synpred75921 = frozenset([1])
- FOLLOW_pointer_in_synpred76924 = frozenset([1])
- FOLLOW_66_in_synpred77919 = frozenset([49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_qualifier_in_synpred77921 = frozenset([1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_pointer_in_synpred77924 = frozenset([1])
- FOLLOW_66_in_synpred78930 = frozenset([66])
- FOLLOW_pointer_in_synpred78932 = frozenset([1])
- FOLLOW_53_in_synpred81977 = frozenset([1])
- FOLLOW_27_in_synpred82974 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_53_in_synpred82977 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_parameter_declaration_in_synpred82981 = frozenset([1])
- FOLLOW_declarator_in_synpred83997 = frozenset([1])
- FOLLOW_abstract_declarator_in_synpred84999 = frozenset([1])
- FOLLOW_declaration_specifiers_in_synpred86994 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_declarator_in_synpred86997 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_abstract_declarator_in_synpred86999 = frozenset([1, 4, 53, 58, 59, 60, 62, 64, 66])
- FOLLOW_53_in_synpred861004 = frozenset([1])
- FOLLOW_specifier_qualifier_list_in_synpred901046 = frozenset([1, 62, 64, 66])
- FOLLOW_abstract_declarator_in_synpred901048 = frozenset([1])
- FOLLOW_direct_abstract_declarator_in_synpred911067 = frozenset([1])
- FOLLOW_62_in_synpred931086 = frozenset([62, 64, 66])
- FOLLOW_abstract_declarator_in_synpred931088 = frozenset([63])
- FOLLOW_63_in_synpred931090 = frozenset([1])
- FOLLOW_abstract_declarator_suffix_in_synpred941098 = frozenset([1])
- FOLLOW_62_in_synpred1091282 = frozenset([4, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])
- FOLLOW_type_name_in_synpred1091284 = frozenset([63])
- FOLLOW_63_in_synpred1091286 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_cast_expression_in_synpred1091288 = frozenset([1])
- FOLLOW_74_in_synpred1141330 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_unary_expression_in_synpred1141332 = frozenset([1])
- FOLLOW_62_in_synpred1171420 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_argument_expression_list_in_synpred1171424 = frozenset([63])
- FOLLOW_63_in_synpred1171428 = frozenset([1])
- FOLLOW_62_in_synpred1181444 = frozenset([4, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])
- FOLLOW_macro_parameter_list_in_synpred1181446 = frozenset([63])
- FOLLOW_63_in_synpred1181448 = frozenset([1])
- FOLLOW_66_in_synpred1201482 = frozenset([4])
- FOLLOW_IDENTIFIER_in_synpred1201486 = frozenset([1])
- FOLLOW_STRING_LITERAL_in_synpred1371683 = frozenset([1])
- FOLLOW_IDENTIFIER_in_synpred1381680 = frozenset([4, 9])
- FOLLOW_STRING_LITERAL_in_synpred1381683 = frozenset([1, 9])
- FOLLOW_lvalue_in_synpred1421744 = frozenset([28, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89])
- FOLLOW_assignment_operator_in_synpred1421746 = frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])
- FOLLOW_assignment_expression_in_synpred1421748 = frozenset([1])
- FOLLOW_expression_statement_in_synpred1692035 = frozenset([1])
- FOLLOW_macro_statement_in_synpred1732055 = frozenset([1])
- FOLLOW_asm2_statement_in_synpred1742060 = frozenset([1])
- FOLLOW_declaration_in_synpred1812166 = frozenset([1])
- FOLLOW_statement_list_in_synpred1822170 = frozenset([1])
- FOLLOW_declaration_in_synpred1862225 = frozenset([1])
- FOLLOW_statement_in_synpred1882242 = frozenset([1])
-
diff --git a/BaseTools/Source/Python/Eot/CodeFragment.py b/BaseTools/Source/Python/Eot/CodeFragment.py
deleted file mode 100644
index db5f40a6a4..0000000000
--- a/BaseTools/Source/Python/Eot/CodeFragment.py
+++ /dev/null
@@ -1,185 +0,0 @@
-## @file
-# fragments of source file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-
-## The description of comment contents and start & end position
-#
-#
-class Comment :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- # @param CommentType The type of comment (T_COMMENT_TWO_SLASH or T_COMMENT_SLASH_STAR).
- #
- def __init__(self, Str, Begin, End, CommentType):
- self.Content = Str
- self.StartPos = Begin
- self.EndPos = End
- self.Type = CommentType
-
-## The description of preprocess directives and start & end position
-#
-#
-class PP_Directive :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Str, Begin, End):
- self.Content = Str
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of assignment expression and start & end position
-#
-#
-class AssignmentExpression :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Lvalue, Op, Exp, Begin, End):
- self.Name = Lvalue
- self.Operator = Op
- self.Value = Exp
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of predicate expression and start & end position
-#
-#
-class PredicateExpression :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Str, Begin, End):
- self.Content = Str
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of function definition and start & end position
-#
-#
-class FunctionDefinition :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- # @param LBPos The left brace position tuple.
- #
- def __init__(self, ModifierStr, DeclStr, Begin, End, LBPos, NamePos):
- self.Modifier = ModifierStr
- self.Declarator = DeclStr
- self.StartPos = Begin
- self.EndPos = End
- self.LeftBracePos = LBPos
- self.NamePos = NamePos
-
-## The description of variable declaration and start & end position
-#
-#
-class VariableDeclaration :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, ModifierStr, DeclStr, Begin, End):
- self.Modifier = ModifierStr
- self.Declarator = DeclStr
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of enum definition and start & end position
-#
-#
-class EnumerationDefinition :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Str, Begin, End):
- self.Content = Str
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of struct/union definition and start & end position
-#
-#
-class StructUnionDefinition :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Str, Begin, End):
- self.Content = Str
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of 'Typedef' definition and start & end position
-#
-#
-class TypedefDefinition :
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, FromStr, ToStr, Begin, End):
- self.FromType = FromStr
- self.ToType = ToStr
- self.StartPos = Begin
- self.EndPos = End
-
-## The description of function calling definition and start & end position
-#
-#
-class FunctionCalling:
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param Begin The start position tuple.
- # @param End The end position tuple.
- #
- def __init__(self, Name, Param, Begin, End):
- self.FuncName = Name
- self.ParamList = Param
- self.StartPos = Begin
- self.EndPos = End
diff --git a/BaseTools/Source/Python/Eot/CodeFragmentCollector.py b/BaseTools/Source/Python/Eot/CodeFragmentCollector.py
deleted file mode 100644
index 4e8cef2c42..0000000000
--- a/BaseTools/Source/Python/Eot/CodeFragmentCollector.py
+++ /dev/null
@@ -1,467 +0,0 @@
-## @file
-# preprocess source file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import re
-import os
-import sys
-
-import antlr3
-from CLexer import CLexer
-from CParser import CParser
-
-import FileProfile
-from CodeFragment import PP_Directive
-from ParserWarning import Warning
-
-
-##define T_CHAR_SPACE ' '
-##define T_CHAR_NULL '\0'
-##define T_CHAR_CR '\r'
-##define T_CHAR_TAB '\t'
-##define T_CHAR_LF '\n'
-##define T_CHAR_SLASH '/'
-##define T_CHAR_BACKSLASH '\\'
-##define T_CHAR_DOUBLE_QUOTE '\"'
-##define T_CHAR_SINGLE_QUOTE '\''
-##define T_CHAR_STAR '*'
-##define T_CHAR_HASH '#'
-
-(T_CHAR_SPACE, T_CHAR_NULL, T_CHAR_CR, T_CHAR_TAB, T_CHAR_LF, T_CHAR_SLASH, \
-T_CHAR_BACKSLASH, T_CHAR_DOUBLE_QUOTE, T_CHAR_SINGLE_QUOTE, T_CHAR_STAR, T_CHAR_HASH) = \
-(' ', '\0', '\r', '\t', '\n', '/', '\\', '\"', '\'', '*', '#')
-
-SEPERATOR_TUPLE = ('=', '|', ',', '{', '}')
-
-(T_COMMENT_TWO_SLASH, T_COMMENT_SLASH_STAR) = (0, 1)
-
-(T_PP_INCLUDE, T_PP_DEFINE, T_PP_OTHERS) = (0, 1, 2)
-
-## The collector for source code fragments.
-#
-# PreprocessFile method should be called prior to ParseFile
-#
-# GetNext*** procedures mean these procedures will get next token first, then make judgement.
-# Get*** procedures mean these procedures will make judgement on current token only.
-#
-class CodeFragmentCollector:
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName):
- self.Profile = FileProfile.FileProfile(FileName)
- self.Profile.FileLinesList.append(T_CHAR_LF)
- self.FileName = FileName
- self.CurrentLineNumber = 1
- self.CurrentOffsetWithinLine = 0
-
- self.__Token = ""
- self.__SkippedChars = ""
-
- ## __IsWhiteSpace() method
- #
- # Whether char at current FileBufferPos is whitespace
- #
- # @param self The object pointer
- # @param Char The char to test
- # @retval True The char is a kind of white space
- # @retval False The char is NOT a kind of white space
- #
- def __IsWhiteSpace(self, Char):
- if Char in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_SPACE, T_CHAR_TAB, T_CHAR_LF):
- return True
- else:
- return False
-
- ## __SkipWhiteSpace() method
- #
- # Skip white spaces from current char, return number of chars skipped
- #
- # @param self The object pointer
- # @retval Count The number of chars skipped
- #
- def __SkipWhiteSpace(self):
- Count = 0
- while not self.__EndOfFile():
- Count += 1
- if self.__CurrentChar() in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_LF, T_CHAR_SPACE, T_CHAR_TAB):
- self.__SkippedChars += str(self.__CurrentChar())
- self.__GetOneChar()
-
- else:
- Count = Count - 1
- return Count
-
- ## __EndOfFile() method
- #
- # Judge current buffer pos is at file end
- #
- # @param self The object pointer
- # @retval True Current File buffer position is at file end
- # @retval False Current File buffer position is NOT at file end
- #
- def __EndOfFile(self):
- NumberOfLines = len(self.Profile.FileLinesList)
- SizeOfLastLine = len(self.Profile.FileLinesList[-1])
- if self.CurrentLineNumber == NumberOfLines and self.CurrentOffsetWithinLine >= SizeOfLastLine - 1:
- return True
- elif self.CurrentLineNumber > NumberOfLines:
- return True
- else:
- return False
-
- ## __EndOfLine() method
- #
- # Judge current buffer pos is at line end
- #
- # @param self The object pointer
- # @retval True Current File buffer position is at line end
- # @retval False Current File buffer position is NOT at line end
- #
- def __EndOfLine(self):
- SizeOfCurrentLine = len(self.Profile.FileLinesList[self.CurrentLineNumber - 1])
- if self.CurrentOffsetWithinLine >= SizeOfCurrentLine - 1:
- return True
- else:
- return False
-
- ## Rewind() method
- #
- # Reset file data buffer to the initial state
- #
- # @param self The object pointer
- #
- def Rewind(self):
- self.CurrentLineNumber = 1
- self.CurrentOffsetWithinLine = 0
-
- ## __UndoOneChar() method
- #
- # Go back one char in the file buffer
- #
- # @param self The object pointer
- # @retval True Successfully go back one char
- # @retval False Not able to go back one char as file beginning reached
- #
- def __UndoOneChar(self):
-
- if self.CurrentLineNumber == 1 and self.CurrentOffsetWithinLine == 0:
- return False
- elif self.CurrentOffsetWithinLine == 0:
- self.CurrentLineNumber -= 1
- self.CurrentOffsetWithinLine = len(self.__CurrentLine()) - 1
- else:
- self.CurrentOffsetWithinLine -= 1
- return True
-
- ## __GetOneChar() method
- #
- # Move forward one char in the file buffer
- #
- # @param self The object pointer
- #
- def __GetOneChar(self):
- if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
- else:
- self.CurrentOffsetWithinLine += 1
-
- ## __CurrentChar() method
- #
- # Get the char pointed to by the file buffer pointer
- #
- # @param self The object pointer
- # @retval Char Current char
- #
- def __CurrentChar(self):
- CurrentChar = self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine]
-
- return CurrentChar
-
- ## __NextChar() method
- #
- # Get the one char pass the char pointed to by the file buffer pointer
- #
- # @param self The object pointer
- # @retval Char Next char
- #
- def __NextChar(self):
- if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
- return self.Profile.FileLinesList[self.CurrentLineNumber][0]
- else:
- return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine + 1]
-
- ## __SetCurrentCharValue() method
- #
- # Modify the value of current char
- #
- # @param self The object pointer
- # @param Value The new value of current char
- #
- def __SetCurrentCharValue(self, Value):
- self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine] = Value
-
- ## __SetCharValue() method
- #
- # Modify the value of current char
- #
- # @param self The object pointer
- # @param Value The new value of current char
- #
- def __SetCharValue(self, Line, Offset, Value):
- self.Profile.FileLinesList[Line - 1][Offset] = Value
-
- ## __CurrentLine() method
- #
- # Get the list that contains current line contents
- #
- # @param self The object pointer
- # @retval List current line contents
- #
- def __CurrentLine(self):
- return self.Profile.FileLinesList[self.CurrentLineNumber - 1]
-
- ## __InsertComma() method
- #
- # Insert ',' to replace PP
- #
- # @param self The object pointer
- # @retval List current line contents
- #
- def __InsertComma(self, Line):
-
-
- if self.Profile.FileLinesList[Line - 1][0] != T_CHAR_HASH:
- BeforeHashPart = str(self.Profile.FileLinesList[Line - 1]).split(T_CHAR_HASH)[0]
- if BeforeHashPart.rstrip().endswith(T_CHAR_COMMA) or BeforeHashPart.rstrip().endswith(';'):
- return
-
- if Line - 2 >= 0 and str(self.Profile.FileLinesList[Line - 2]).rstrip().endswith(','):
- return
-
- if Line - 2 >= 0 and str(self.Profile.FileLinesList[Line - 2]).rstrip().endswith(';'):
- return
-
- if str(self.Profile.FileLinesList[Line]).lstrip().startswith(',') or str(self.Profile.FileLinesList[Line]).lstrip().startswith(';'):
- return
-
- self.Profile.FileLinesList[Line - 1].insert(self.CurrentOffsetWithinLine, ',')
-
- ## PreprocessFileWithClear() method
- #
- # Run a preprocess for the file to clean all comments
- #
- # @param self The object pointer
- #
- def PreprocessFileWithClear(self):
-
- self.Rewind()
- InComment = False
- DoubleSlashComment = False
- HashComment = False
- PPExtend = False
- PPDirectiveObj = None
- # HashComment in quoted string " " is ignored.
- InString = False
- InCharLiteral = False
-
- self.Profile.FileLinesList = [list(s) for s in self.Profile.FileLinesListFromFile]
- while not self.__EndOfFile():
-
- if not InComment and self.__CurrentChar() == T_CHAR_DOUBLE_QUOTE:
- InString = not InString
-
- if not InComment and self.__CurrentChar() == T_CHAR_SINGLE_QUOTE:
- InCharLiteral = not InCharLiteral
- # meet new line, then no longer in a comment for // and '#'
- if self.__CurrentChar() == T_CHAR_LF:
- if HashComment and PPDirectiveObj != None:
- if PPDirectiveObj.Content.rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):
- PPDirectiveObj.Content += T_CHAR_LF
- PPExtend = True
- else:
- PPExtend = False
-
- EndLinePos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine)
-
- if InComment and DoubleSlashComment:
- InComment = False
- DoubleSlashComment = False
-
- if InComment and HashComment and not PPExtend:
- InComment = False
- HashComment = False
- PPDirectiveObj.Content += T_CHAR_LF
- PPDirectiveObj.EndPos = EndLinePos
- FileProfile.PPDirectiveList.append(PPDirectiveObj)
- PPDirectiveObj = None
-
- if InString or InCharLiteral:
- CurrentLine = "".join(self.__CurrentLine())
- if CurrentLine.rstrip(T_CHAR_LF).rstrip(T_CHAR_CR).endswith(T_CHAR_BACKSLASH):
- SlashIndex = CurrentLine.rindex(T_CHAR_BACKSLASH)
- self.__SetCharValue(self.CurrentLineNumber, SlashIndex, T_CHAR_SPACE)
-
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
- # check for */ comment end
- elif InComment and not DoubleSlashComment and not HashComment and self.__CurrentChar() == T_CHAR_STAR and self.__NextChar() == T_CHAR_SLASH:
-
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- InComment = False
- # set comments to spaces
- elif InComment:
- if HashComment:
- # // follows hash PP directive
- if self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_SLASH:
- InComment = False
- HashComment = False
- PPDirectiveObj.EndPos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine - 1)
- FileProfile.PPDirectiveList.append(PPDirectiveObj)
- PPDirectiveObj = None
- continue
- else:
- PPDirectiveObj.Content += self.__CurrentChar()
-
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- # check for // comment
- elif self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_SLASH:
- InComment = True
- DoubleSlashComment = True
-
- # check for '#' comment
- elif self.__CurrentChar() == T_CHAR_HASH and not InString and not InCharLiteral:
- InComment = True
- HashComment = True
- PPDirectiveObj = PP_Directive('', (self.CurrentLineNumber, self.CurrentOffsetWithinLine), None)
- # check for /* comment start
- elif self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_STAR:
-
- self.__SetCurrentCharValue( T_CHAR_SPACE)
- self.__GetOneChar()
- self.__SetCurrentCharValue( T_CHAR_SPACE)
- self.__GetOneChar()
- InComment = True
- else:
- self.__GetOneChar()
-
- EndLinePos = (self.CurrentLineNumber, self.CurrentOffsetWithinLine)
-
- if InComment and HashComment and not PPExtend:
- PPDirectiveObj.EndPos = EndLinePos
- FileProfile.PPDirectiveList.append(PPDirectiveObj)
- self.Rewind()
-
- ## ParseFile() method
- #
- # Parse the file profile buffer to extract fd, fv ... information
- # Exception will be raised if syntax error found
- #
- # @param self The object pointer
- #
- def ParseFile(self):
- self.PreprocessFileWithClear()
- # restore from ListOfList to ListOfString
- self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList]
- FileStringContents = ''
- for fileLine in self.Profile.FileLinesList:
- FileStringContents += fileLine
- cStream = antlr3.StringStream(FileStringContents)
- lexer = CLexer(cStream)
- tStream = antlr3.CommonTokenStream(lexer)
- parser = CParser(tStream)
- parser.translation_unit()
-
- ## CleanFileProfileBuffer() method
- #
- # Reset all contents of the profile of a file
- #
- def CleanFileProfileBuffer(self):
-
- FileProfile.PPDirectiveList = []
- FileProfile.AssignmentExpressionList = []
- FileProfile.FunctionDefinitionList = []
- FileProfile.VariableDeclarationList = []
- FileProfile.EnumerationDefinitionList = []
- FileProfile.StructUnionDefinitionList = []
- FileProfile.TypedefDefinitionList = []
- FileProfile.FunctionCallingList = []
-
- ## PrintFragments() method
- #
- # Print the contents of the profile of a file
- #
- def PrintFragments(self):
-
- print '################# ' + self.FileName + '#####################'
-
- print '/****************************************/'
- print '/*************** ASSIGNMENTS ***************/'
- print '/****************************************/'
- for asign in FileProfile.AssignmentExpressionList:
- print str(asign.StartPos) + asign.Name + asign.Operator + asign.Value
-
- print '/****************************************/'
- print '/********* PREPROCESS DIRECTIVES ********/'
- print '/****************************************/'
- for pp in FileProfile.PPDirectiveList:
- print str(pp.StartPos) + pp.Content
-
- print '/****************************************/'
- print '/********* VARIABLE DECLARATIONS ********/'
- print '/****************************************/'
- for var in FileProfile.VariableDeclarationList:
- print str(var.StartPos) + var.Modifier + ' '+ var.Declarator
-
- print '/****************************************/'
- print '/********* FUNCTION DEFINITIONS *********/'
- print '/****************************************/'
- for func in FileProfile.FunctionDefinitionList:
- print str(func.StartPos) + func.Modifier + ' '+ func.Declarator + ' ' + str(func.NamePos)
-
- print '/****************************************/'
- print '/************ ENUMERATIONS **************/'
- print '/****************************************/'
- for enum in FileProfile.EnumerationDefinitionList:
- print str(enum.StartPos) + enum.Content
-
- print '/****************************************/'
- print '/*********** STRUCTS/UNIONS *************/'
- print '/****************************************/'
- for su in FileProfile.StructUnionDefinitionList:
- print str(su.StartPos) + su.Content
-
- print '/****************************************/'
- print '/************** TYPEDEFS ****************/'
- print '/****************************************/'
- for typedef in FileProfile.TypedefDefinitionList:
- print str(typedef.StartPos) + typedef.ToType
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == "__main__":
-
- print "For Test."
diff --git a/BaseTools/Source/Python/Eot/Database.py b/BaseTools/Source/Python/Eot/Database.py
deleted file mode 100644
index ce38a0fa92..0000000000
--- a/BaseTools/Source/Python/Eot/Database.py
+++ /dev/null
@@ -1,255 +0,0 @@
-## @file
-# This file is used to create a database used by EOT tool
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import sqlite3
-import os, time
-
-import Common.EdkLogger as EdkLogger
-import CommonDataClass.DataClass as DataClass
-
-from Table.TableDataModel import TableDataModel
-from Table.TableFile import TableFile
-from Table.TableFunction import TableFunction
-from Table.TableIdentifier import TableIdentifier
-from Table.TableEotReport import TableEotReport
-from Table.TableInf import TableInf
-from Table.TableDec import TableDec
-from Table.TableDsc import TableDsc
-from Table.TableFdf import TableFdf
-from Table.TableQuery import TableQuery
-
-##
-# Static definitions
-#
-DATABASE_PATH = "Eot.db"
-
-## Database class
-#
-# This class defined the EOT databse
-# During the phase of initialization, the database will create all tables and
-# insert all records of table DataModel
-#
-class Database(object):
- ## The constructor
- #
- # @param self: The object pointer
- # @param DbPath: The file path of the database
- #
- def __init__(self, DbPath):
- self.DbPath = DbPath
- self.Conn = None
- self.Cur = None
- self.TblDataModel = None
- self.TblFile = None
- self.TblFunction = None
- self.TblIdentifier = None
- self.TblReport = None
- self.TblInf = None
- self.TblDec = None
- self.TblDsc = None
- self.TblFdf = None
- self.TblQuery = None
- self.TblQuery2 = None
-
- ## InitDatabase() method
- # 1. Delete all old existing tables
- # 2. Create new tables
- # 3. Initialize table DataModel
- #
- # @param self: The object pointer
- # @param NewDatabase: Check if it needs to create a new database
- #
- def InitDatabase(self, NewDatabase = True):
- EdkLogger.verbose("\nInitialize EOT database started ...")
- #
- # Drop all old existing tables
- #
- if NewDatabase:
- if os.path.exists(self.DbPath):
- os.remove(self.DbPath)
- self.Conn = sqlite3.connect(self.DbPath, isolation_level = 'DEFERRED')
- self.Conn.execute("PRAGMA page_size=8192")
- self.Conn.execute("PRAGMA synchronous=OFF")
- # to avoid non-ascii charater conversion error
- self.Conn.text_factory = str
- self.Cur = self.Conn.cursor()
-
- self.TblDataModel = TableDataModel(self.Cur)
- self.TblFile = TableFile(self.Cur)
- self.TblFunction = TableFunction(self.Cur)
- self.TblIdentifier = TableIdentifier(self.Cur)
- self.TblReport = TableEotReport(self.Cur)
- self.TblInf = TableInf(self.Cur)
- self.TblDec = TableDec(self.Cur)
- self.TblDsc = TableDsc(self.Cur)
- self.TblFdf = TableFdf(self.Cur)
- self.TblQuery = TableQuery(self.Cur)
- self.TblQuery2 = TableQuery(self.Cur)
- self.TblQuery2.Table = 'Query2'
-
- # Create new tables
- if NewDatabase:
- self.TblDataModel.Create()
- self.TblFile.Create()
- self.TblFunction.Create()
- self.TblReport.Create()
- self.TblInf.Create()
- self.TblDec.Create()
- self.TblDsc.Create()
- self.TblFdf.Create()
- self.TblQuery.Create()
- self.TblQuery2.Create()
-
- # Init each table's ID
- self.TblDataModel.InitID()
- self.TblFile.InitID()
- self.TblFunction.InitID()
- self.TblReport.InitID()
- self.TblInf.InitID()
- self.TblDec.InitID()
- self.TblDsc.InitID()
- self.TblFdf.InitID()
- self.TblQuery.Drop()
- self.TblQuery.Create()
- self.TblQuery.InitID()
- self.TblQuery2.Drop()
- self.TblQuery2.Create()
- self.TblQuery2.InitID()
-
- # Initialize table DataModel
- if NewDatabase:
- self.TblDataModel.InitTable()
-
- EdkLogger.verbose("Initialize EOT database ... DONE!")
-
- ## QueryTable() method
- #
- # Query a table
- #
- # @param self: The object pointer
- # @param Table: The instance of the table to be queried
- #
- def QueryTable(self, Table):
- Table.Query()
-
- ## Close() method
- #
- # Commit all first
- # Close the connection and cursor
- #
- def Close(self):
- # Commit to file
- self.Conn.commit()
-
- # Close connection and cursor
- self.Cur.close()
- self.Conn.close()
-
- ## InsertOneFile() method
- #
- # Insert one file's information to the database
- # 1. Create a record in TableFile
- # 2. Create functions one by one
- # 2.1 Create variables of function one by one
- # 2.2 Create pcds of function one by one
- # 3. Create variables one by one
- # 4. Create pcds one by one
- #
- # @param self: The object pointer
- # @param File: The object of the file to be inserted
- #
- def InsertOneFile(self, File):
- # Insert a record for file
- FileID = self.TblFile.Insert(File.Name, File.ExtName, File.Path, File.FullPath, Model = File.Model, TimeStamp = File.TimeStamp)
- IdTable = TableIdentifier(self.Cur)
- IdTable.Table = "Identifier%s" % FileID
- IdTable.Create()
-
- # Insert function of file
- for Function in File.FunctionList:
- FunctionID = self.TblFunction.Insert(Function.Header, Function.Modifier, Function.Name, Function.ReturnStatement, \
- Function.StartLine, Function.StartColumn, Function.EndLine, Function.EndColumn, \
- Function.BodyStartLine, Function.BodyStartColumn, FileID, \
- Function.FunNameStartLine, Function.FunNameStartColumn)
-
- # Insert Identifier of function
- for Identifier in Function.IdentifierList:
- IdentifierID = IdTable.Insert(Identifier.Modifier, Identifier.Type, Identifier.Name, Identifier.Value, Identifier.Model, \
- FileID, FunctionID, Identifier.StartLine, Identifier.StartColumn, Identifier.EndLine, Identifier.EndColumn)
- # Insert Identifier of file
- for Identifier in File.IdentifierList:
- IdentifierID = IdTable.Insert(Identifier.Modifier, Identifier.Type, Identifier.Name, Identifier.Value, Identifier.Model, \
- FileID, -1, Identifier.StartLine, Identifier.StartColumn, Identifier.EndLine, Identifier.EndColumn)
-
- EdkLogger.verbose("Insert information from file %s ... DONE!" % File.FullPath)
-
- ## UpdateIdentifierBelongsToFunction() method
- #
- # Update the field "BelongsToFunction" for each Indentifier
- #
- # @param self: The object pointer
- #
- def UpdateIdentifierBelongsToFunction(self):
- EdkLogger.verbose("Update 'BelongsToFunction' for Identifiers started ...")
-
- SqlCommand = """select ID, BelongsToFile, StartLine, EndLine from Function"""
- Records = self.TblFunction.Exec(SqlCommand)
- Data1 = []
- Data2 = []
- for Record in Records:
- FunctionID = Record[0]
- BelongsToFile = Record[1]
- StartLine = Record[2]
- EndLine = Record[3]
-
- SqlCommand = """Update Identifier%s set BelongsToFunction = %s where BelongsToFile = %s and StartLine > %s and EndLine < %s""" % \
- (BelongsToFile, FunctionID, BelongsToFile, StartLine, EndLine)
- self.TblIdentifier.Exec(SqlCommand)
-
- SqlCommand = """Update Identifier%s set BelongsToFunction = %s, Model = %s where BelongsToFile = %s and Model = %s and EndLine = %s""" % \
- (BelongsToFile, FunctionID, DataClass.MODEL_IDENTIFIER_FUNCTION_HEADER, BelongsToFile, DataClass.MODEL_IDENTIFIER_COMMENT, StartLine - 1)
- self.TblIdentifier.Exec(SqlCommand)
-
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- EdkLogger.Initialize()
- EdkLogger.SetLevel(EdkLogger.DEBUG_0)
- EdkLogger.verbose("Start at " + time.strftime('%H:%M:%S', time.localtime()))
-
- Db = Database(DATABASE_PATH)
- Db.InitDatabase()
- Db.QueryTable(Db.TblDataModel)
-
- identifier1 = DataClass.IdentifierClass(-1, '', '', "i''1", 'aaa', DataClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 32, 43, 54, 43)
- identifier2 = DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa', DataClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 15, 43, 20, 43)
- identifier3 = DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa', DataClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 55, 43, 58, 43)
- identifier4 = DataClass.IdentifierClass(-1, '', '', "i1'", 'aaa', DataClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 77, 43, 88, 43)
- fun1 = DataClass.FunctionClass(-1, '', '', 'fun1', '', 21, 2, 60, 45, 1, 23, 0, [], [])
- file = DataClass.FileClass(-1, 'F1', 'c', 'C:\\', 'C:\\F1.exe', DataClass.MODEL_FILE_C, '2007-12-28', [fun1], [identifier1, identifier2, identifier3, identifier4], [])
- Db.InsertOneFile(file)
-
- Db.QueryTable(Db.TblFile)
- Db.QueryTable(Db.TblFunction)
- Db.QueryTable(Db.TblIdentifier)
-
- Db.Close()
- EdkLogger.verbose("End at " + time.strftime('%H:%M:%S', time.localtime()))
-
diff --git a/BaseTools/Source/Python/Eot/EfiCompressor.pyd b/BaseTools/Source/Python/Eot/EfiCompressor.pyd
deleted file mode 100644
index 9de9beb402..0000000000
--- a/BaseTools/Source/Python/Eot/EfiCompressor.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Source/Python/Eot/Eot.py b/BaseTools/Source/Python/Eot/Eot.py
deleted file mode 100644
index 029caedabc..0000000000
--- a/BaseTools/Source/Python/Eot/Eot.py
+++ /dev/null
@@ -1,648 +0,0 @@
-## @file
-# This file is used to be the main entrance of EOT tool
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os, time, glob
-import Common.EdkLogger as EdkLogger
-import EotGlobalData
-from optparse import OptionParser
-from Common.String import NormPath
-from Common import BuildToolError
-from Common.Misc import GuidStructureStringToGuidString
-from InfParserLite import *
-import c
-import Database
-from FvImage import *
-from array import array
-from Report import Report
-from Common.Misc import ParseConsoleLog
-from Common.BuildVersion import gBUILD_VERSION
-from Parser import ConvertGuid
-
-## Class Eot
-#
-# This class is used to define Eot main entrance
-#
-# @param object: Inherited from object class
-#
-class Eot(object):
- ## The constructor
- #
- # @param self: The object pointer
- #
- def __init__(self, CommandLineOption=True, IsInit=True, SourceFileList=None, \
- IncludeDirList=None, DecFileList=None, GuidList=None, LogFile=None,
- FvFileList="", MapFileList="", Report='Report.html', Dispatch=None):
- # Version and Copyright
- self.VersionNumber = ("0.02" + " " + gBUILD_VERSION)
- self.Version = "%prog Version " + self.VersionNumber
- self.Copyright = "Copyright (c) 2008 - 2010, Intel Corporation All rights reserved."
- self.Report = Report
-
- self.IsInit = IsInit
- self.SourceFileList = SourceFileList
- self.IncludeDirList = IncludeDirList
- self.DecFileList = DecFileList
- self.GuidList = GuidList
- self.LogFile = LogFile
- self.FvFileList = FvFileList
- self.MapFileList = MapFileList
- self.Dispatch = Dispatch
-
- # Check workspace environment
- if "EFI_SOURCE" not in os.environ:
- if "EDK_SOURCE" not in os.environ:
- pass
- else:
- EotGlobalData.gEDK_SOURCE = os.path.normpath(os.getenv("EDK_SOURCE"))
- else:
- EotGlobalData.gEFI_SOURCE = os.path.normpath(os.getenv("EFI_SOURCE"))
- EotGlobalData.gEDK_SOURCE = os.path.join(EotGlobalData.gEFI_SOURCE, 'Edk')
-
- if "WORKSPACE" not in os.environ:
- EdkLogger.error("EOT", BuildToolError.ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
- ExtraData="WORKSPACE")
- else:
- EotGlobalData.gWORKSPACE = os.path.normpath(os.getenv("WORKSPACE"))
-
- EotGlobalData.gMACRO['WORKSPACE'] = EotGlobalData.gWORKSPACE
- EotGlobalData.gMACRO['EFI_SOURCE'] = EotGlobalData.gEFI_SOURCE
- EotGlobalData.gMACRO['EDK_SOURCE'] = EotGlobalData.gEDK_SOURCE
-
- # Parse the options and args
- if CommandLineOption:
- self.ParseOption()
-
- if self.FvFileList:
- for FvFile in GetSplitValueList(self.FvFileList, ' '):
- FvFile = os.path.normpath(FvFile)
- if not os.path.isfile(FvFile):
- EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "Can not find file %s " % FvFile)
- EotGlobalData.gFV_FILE.append(FvFile)
- else:
- EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "The fv file list of target platform was not specified")
-
- if self.MapFileList:
- for MapFile in GetSplitValueList(self.MapFileList, ' '):
- MapFile = os.path.normpath(MapFile)
- if not os.path.isfile(MapFile):
- EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "Can not find file %s " % MapFile)
- EotGlobalData.gMAP_FILE.append(MapFile)
-
- # Generate source file list
- self.GenerateSourceFileList(self.SourceFileList, self.IncludeDirList)
-
- # Generate guid list of dec file list
- self.ParseDecFile(self.DecFileList)
-
- # Generate guid list from GUID list file
- self.ParseGuidList(self.GuidList)
-
- # Init Eot database
- EotGlobalData.gDb = Database.Database(Database.DATABASE_PATH)
- EotGlobalData.gDb.InitDatabase(self.IsInit)
-
- # Build ECC database
- self.BuildDatabase()
-
- # Parse Ppi/Protocol
- self.ParseExecutionOrder()
-
- # Merge Identifier tables
- self.GenerateQueryTable()
-
- # Generate report database
- self.GenerateReportDatabase()
-
- # Load Fv Info
- self.LoadFvInfo()
-
- # Load Map Info
- self.LoadMapInfo()
-
- # Generate Report
- self.GenerateReport()
-
- # Convert log file
- self.ConvertLogFile(self.LogFile)
-
- # DONE
- EdkLogger.quiet("EOT FINISHED!")
-
- # Close Database
- EotGlobalData.gDb.Close()
-
- ## ParseDecFile() method
- #
- # parse DEC file and get all GUID names with GUID values as {GuidName : GuidValue}
- # The Dict is stored in EotGlobalData.gGuidDict
- #
- # @param self: The object pointer
- # @param DecFileList: A list of all DEC files
- #
- def ParseDecFile(self, DecFileList):
- if DecFileList:
- path = os.path.normpath(DecFileList)
- lfr = open(path, 'rb')
- for line in lfr:
- path = os.path.normpath(os.path.join(EotGlobalData.gWORKSPACE, line.strip()))
- if os.path.exists(path):
- dfr = open(path, 'rb')
- for line in dfr:
- line = CleanString(line)
- list = line.split('=')
- if len(list) == 2:
- EotGlobalData.gGuidDict[list[0].strip()] = GuidStructureStringToGuidString(list[1].strip())
-
-
- ## ParseGuidList() method
- #
- # Parse Guid list and get all GUID names with GUID values as {GuidName : GuidValue}
- # The Dict is stored in EotGlobalData.gGuidDict
- #
- # @param self: The object pointer
- # @param GuidList: A list of all GUID and its value
- #
- def ParseGuidList(self, GuidList):
- Path = os.path.join(EotGlobalData.gWORKSPACE, GuidList)
- if os.path.isfile(Path):
- for Line in open(Path):
- (GuidName, GuidValue) = Line.split()
- EotGlobalData.gGuidDict[GuidName] = GuidValue
-
- ## ConvertLogFile() method
- #
- # Parse a real running log file to get real dispatch order
- # The result is saved to old file name + '.new'
- #
- # @param self: The object pointer
- # @param LogFile: A real running log file name
- #
- def ConvertLogFile(self, LogFile):
- newline = []
- lfr = None
- lfw = None
- if LogFile:
- lfr = open(LogFile, 'rb')
- lfw = open(LogFile + '.new', 'wb')
- for line in lfr:
- line = line.strip()
- line = line.replace('.efi', '')
- index = line.find("Loading PEIM at ")
- if index > -1:
- newline.append(line[index + 55 : ])
- continue
- index = line.find("Loading driver at ")
- if index > -1:
- newline.append(line[index + 57 : ])
- continue
-
- for line in newline:
- lfw.write(line + '\r\n')
-
- if lfr:
- lfr.close()
- if lfw:
- lfw.close()
-
- ## GenerateSourceFileList() method
- #
- # Generate a list of all source files
- # 1. Search the file list one by one
- # 2. Store inf file name with source file names under it like
- # { INF file name: [source file1, source file2, ...]}
- # 3. Search the include list to find all .h files
- # 4. Store source file list to EotGlobalData.gSOURCE_FILES
- # 5. Store INF file list to EotGlobalData.gINF_FILES
- #
- # @param self: The object pointer
- # @param SourceFileList: A list of all source files
- # @param IncludeFileList: A list of all include files
- #
- def GenerateSourceFileList(self, SourceFileList, IncludeFileList):
- EdkLogger.quiet("Generating source files list ... ")
- mSourceFileList = []
- mInfFileList = []
- mDecFileList = []
- mFileList = {}
- mCurrentInfFile = ''
- mCurrentSourceFileList = []
-
- if SourceFileList:
- sfl = open(SourceFileList, 'rb')
- for line in sfl:
- line = os.path.normpath(os.path.join(EotGlobalData.gWORKSPACE, line.strip()))
- if line[-2:].upper() == '.C' or line[-2:].upper() == '.H':
- if line not in mCurrentSourceFileList:
- mCurrentSourceFileList.append(line)
- mSourceFileList.append(line)
- EotGlobalData.gOP_SOURCE_FILES.write('%s\n' % line)
- if line[-4:].upper() == '.INF':
- if mCurrentInfFile != '':
- mFileList[mCurrentInfFile] = mCurrentSourceFileList
- mCurrentSourceFileList = []
- mCurrentInfFile = os.path.normpath(os.path.join(EotGlobalData.gWORKSPACE, line))
- EotGlobalData.gOP_INF.write('%s\n' % mCurrentInfFile)
- if mCurrentInfFile not in mFileList:
- mFileList[mCurrentInfFile] = mCurrentSourceFileList
-
- # Get all include files from packages
- if IncludeFileList:
- ifl = open(IncludeFileList, 'rb')
- for line in ifl:
- if not line.strip():
- continue
- newline = os.path.normpath(os.path.join(EotGlobalData.gWORKSPACE, line.strip()))
- for Root, Dirs, Files in os.walk(str(newline)):
- for File in Files:
- FullPath = os.path.normpath(os.path.join(Root, File))
- if FullPath not in mSourceFileList and File[-2:].upper() == '.H':
- mSourceFileList.append(FullPath)
- EotGlobalData.gOP_SOURCE_FILES.write('%s\n' % FullPath)
- if FullPath not in mDecFileList and File.upper().find('.DEC') > -1:
- mDecFileList.append(FullPath)
-
- EotGlobalData.gSOURCE_FILES = mSourceFileList
- EotGlobalData.gOP_SOURCE_FILES.close()
-
- EotGlobalData.gINF_FILES = mFileList
- EotGlobalData.gOP_INF.close()
-
- EotGlobalData.gDEC_FILES = mDecFileList
-
-
- ## GenerateReport() method
- #
- # Generate final HTML report
- #
- # @param self: The object pointer
- #
- def GenerateReport(self):
- EdkLogger.quiet("Generating report file ... ")
- Rep = Report(self.Report, EotGlobalData.gFV, self.Dispatch)
- Rep.GenerateReport()
-
- ## LoadMapInfo() method
- #
- # Load map files and parse them
- #
- # @param self: The object pointer
- #
- def LoadMapInfo(self):
- if EotGlobalData.gMAP_FILE != []:
- EdkLogger.quiet("Parsing Map file ... ")
- EotGlobalData.gMap = ParseMapFile(EotGlobalData.gMAP_FILE)
-
- ## LoadFvInfo() method
- #
- # Load FV binary files and parse them
- #
- # @param self: The object pointer
- #
- def LoadFvInfo(self):
- EdkLogger.quiet("Parsing FV file ... ")
- EotGlobalData.gFV = MultipleFv(EotGlobalData.gFV_FILE)
- EotGlobalData.gFV.Dispatch(EotGlobalData.gDb)
-
- for Protocol in EotGlobalData.gProtocolList:
- EotGlobalData.gOP_UN_MATCHED_IN_LIBRARY_CALLING.write('%s\n' %Protocol)
-
- ## GenerateReportDatabase() method
- #
- # Generate data for the information needed by report
- # 1. Update name, macro and value of all found PPI/PROTOCOL GUID
- # 2. Install hard coded PPI/PROTOCOL
- #
- # @param self: The object pointer
- #
- def GenerateReportDatabase(self):
- EdkLogger.quiet("Generating the cross-reference table of GUID for Ppi/Protocol ... ")
-
- # Update Protocol/Ppi Guid
- SqlCommand = """select DISTINCT GuidName from Report"""
- RecordSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- for Record in RecordSet:
- GuidName = Record[0]
- GuidMacro = ''
- GuidMacro2 = ''
- GuidValue = ''
-
- # Find value for hardcode guid macro
- if GuidName in EotGlobalData.gGuidMacroDict:
- GuidMacro = EotGlobalData.gGuidMacroDict[GuidName][0]
- GuidValue = EotGlobalData.gGuidMacroDict[GuidName][1]
- SqlCommand = """update Report set GuidMacro = '%s', GuidValue = '%s' where GuidName = '%s'""" %(GuidMacro, GuidValue, GuidName)
- EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- continue
-
- # Find guid value defined in Dec file
- if GuidName in EotGlobalData.gGuidDict:
- GuidValue = EotGlobalData.gGuidDict[GuidName]
- SqlCommand = """update Report set GuidMacro = '%s', GuidValue = '%s' where GuidName = '%s'""" %(GuidMacro, GuidValue, GuidName)
- EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- continue
-
- # Search defined Macros for guid name
- SqlCommand ="""select DISTINCT Value, Modifier from Query where Name like '%s'""" % GuidName
- GuidMacroSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- # Ignore NULL result
- if not GuidMacroSet:
- continue
- GuidMacro = GuidMacroSet[0][0].strip()
- if not GuidMacro:
- continue
- # Find Guid value of Guid Macro
- SqlCommand ="""select DISTINCT Value from Query2 where Value like '%%%s%%' and Model = %s""" % (GuidMacro, MODEL_IDENTIFIER_MACRO_DEFINE)
- GuidValueSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- if GuidValueSet != []:
- GuidValue = GuidValueSet[0][0]
- GuidValue = GuidValue[GuidValue.find(GuidMacro) + len(GuidMacro) :]
- GuidValue = GuidValue.lower().replace('\\', '').replace('\r', '').replace('\n', '').replace('l', '').strip()
- GuidValue = GuidStructureStringToGuidString(GuidValue)
- SqlCommand = """update Report set GuidMacro = '%s', GuidValue = '%s' where GuidName = '%s'""" %(GuidMacro, GuidValue, GuidName)
- EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- continue
-
- # Update Hard Coded Ppi/Protocol
- SqlCommand = """select DISTINCT GuidValue, ItemType from Report where ModuleID = -2 and ItemMode = 'Produced'"""
- RecordSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- for Record in RecordSet:
- if Record[1] == 'Ppi':
- EotGlobalData.gPpiList[Record[0].lower()] = -2
- if Record[1] == 'Protocol':
- EotGlobalData.gProtocolList[Record[0].lower()] = -2
-
- ## GenerateQueryTable() method
- #
- # Generate two tables improve query performance
- #
- # @param self: The object pointer
- #
- def GenerateQueryTable(self):
- EdkLogger.quiet("Generating temp query table for analysis ... ")
- for Identifier in EotGlobalData.gIdentifierTableList:
- SqlCommand = """insert into Query (Name, Modifier, Value, Model)
- select Name, Modifier, Value, Model from %s where (Model = %s or Model = %s)""" \
- % (Identifier[0], MODEL_IDENTIFIER_VARIABLE, MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION)
- EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- SqlCommand = """insert into Query2 (Name, Modifier, Value, Model)
- select Name, Modifier, Value, Model from %s where Model = %s""" \
- % (Identifier[0], MODEL_IDENTIFIER_MACRO_DEFINE)
- EotGlobalData.gDb.TblReport.Exec(SqlCommand)
-
- ## ParseExecutionOrder() method
- #
- # Get final execution order
- # 1. Search all PPI
- # 2. Search all PROTOCOL
- #
- # @param self: The object pointer
- #
- def ParseExecutionOrder(self):
- EdkLogger.quiet("Searching Ppi/Protocol ... ")
- for Identifier in EotGlobalData.gIdentifierTableList:
- ModuleID, ModuleName, ModuleGuid, SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, Enabled = \
- -1, '', '', -1, '', '', '', '', '', '', '', '', 0
-
- SourceFileID = Identifier[0].replace('Identifier', '')
- SourceFileFullPath = Identifier[1]
- Identifier = Identifier[0]
-
- # Find Ppis
- ItemMode = 'Produced'
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' or Name like '%%%s%%' or Name like '%%%s%%') and Model = %s""" \
- % (Identifier, '.InstallPpi', '->InstallPpi', 'PeiInstallPpi', MODEL_IDENTIFIER_FUNCTION_CALLING)
- SearchPpi(SqlCommand, Identifier, SourceFileID, SourceFileFullPath, ItemMode)
-
- ItemMode = 'Produced'
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' or Name like '%%%s%%') and Model = %s""" \
- % (Identifier, '.ReInstallPpi', '->ReInstallPpi', MODEL_IDENTIFIER_FUNCTION_CALLING)
- SearchPpi(SqlCommand, Identifier, SourceFileID, SourceFileFullPath, ItemMode, 2)
-
- SearchPpiCallFunction(Identifier, SourceFileID, SourceFileFullPath, ItemMode)
-
- ItemMode = 'Consumed'
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' or Name like '%%%s%%') and Model = %s""" \
- % (Identifier, '.LocatePpi', '->LocatePpi', MODEL_IDENTIFIER_FUNCTION_CALLING)
- SearchPpi(SqlCommand, Identifier, SourceFileID, SourceFileFullPath, ItemMode)
-
- SearchFunctionCalling(Identifier, SourceFileID, SourceFileFullPath, 'Ppi', ItemMode)
-
- ItemMode = 'Callback'
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' or Name like '%%%s%%') and Model = %s""" \
- % (Identifier, '.NotifyPpi', '->NotifyPpi', MODEL_IDENTIFIER_FUNCTION_CALLING)
- SearchPpi(SqlCommand, Identifier, SourceFileID, SourceFileFullPath, ItemMode)
-
- # Find Procotols
- ItemMode = 'Produced'
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' or Name like '%%%s%%' or Name like '%%%s%%' or Name like '%%%s%%') and Model = %s""" \
- % (Identifier, '.InstallProtocolInterface', '.ReInstallProtocolInterface', '->InstallProtocolInterface', '->ReInstallProtocolInterface', MODEL_IDENTIFIER_FUNCTION_CALLING)
- SearchProtocols(SqlCommand, Identifier, SourceFileID, SourceFileFullPath, ItemMode, 1)
-
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' or Name like '%%%s%%') and Model = %s""" \
- % (Identifier, '.InstallMultipleProtocolInterfaces', '->InstallMultipleProtocolInterfaces', MODEL_IDENTIFIER_FUNCTION_CALLING)
- SearchProtocols(SqlCommand, Identifier, SourceFileID, SourceFileFullPath, ItemMode, 2)
-
- SearchFunctionCalling(Identifier, SourceFileID, SourceFileFullPath, 'Protocol', ItemMode)
-
- ItemMode = 'Consumed'
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' or Name like '%%%s%%') and Model = %s""" \
- % (Identifier, '.LocateProtocol', '->LocateProtocol', MODEL_IDENTIFIER_FUNCTION_CALLING)
- SearchProtocols(SqlCommand, Identifier, SourceFileID, SourceFileFullPath, ItemMode, 0)
-
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' or Name like '%%%s%%') and Model = %s""" \
- % (Identifier, '.HandleProtocol', '->HandleProtocol', MODEL_IDENTIFIER_FUNCTION_CALLING)
- SearchProtocols(SqlCommand, Identifier, SourceFileID, SourceFileFullPath, ItemMode, 1)
-
- SearchFunctionCalling(Identifier, SourceFileID, SourceFileFullPath, 'Protocol', ItemMode)
-
- ItemMode = 'Callback'
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' or Name like '%%%s%%') and Model = %s""" \
- % (Identifier, '.RegisterProtocolNotify', '->RegisterProtocolNotify', MODEL_IDENTIFIER_FUNCTION_CALLING)
- SearchProtocols(SqlCommand, Identifier, SourceFileID, SourceFileFullPath, ItemMode, 0)
-
- SearchFunctionCalling(Identifier, SourceFileID, SourceFileFullPath, 'Protocol', ItemMode)
-
- # Hard Code
- EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', 'Produced', 'gEfiSecPlatformInformationPpiGuid', '', '', '', 0)
- EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', 'Produced', 'gEfiNtLoadAsDllPpiGuid', '', '', '', 0)
- EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', 'Produced', 'gNtPeiLoadFileGuid', '', '', '', 0)
- EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', 'Produced', 'gPeiNtAutoScanPpiGuid', '', '', '', 0)
- EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', 'Produced', 'gNtFwhPpiGuid', '', '', '', 0)
- EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', 'Produced', 'gPeiNtThunkPpiGuid', '', '', '', 0)
- EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', 'Produced', 'gPeiPlatformTypePpiGuid', '', '', '', 0)
- EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', 'Produced', 'gPeiFrequencySelectionCpuPpiGuid', '', '', '', 0)
- EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', 'Produced', 'gPeiCachePpiGuid', '', '', '', 0)
-
- EotGlobalData.gDb.Conn.commit()
-
-
- ## BuildDatabase() methoc
- #
- # Build the database for target
- #
- # @param self: The object pointer
- #
- def BuildDatabase(self):
- # Clean report table
- EotGlobalData.gDb.TblReport.Drop()
- EotGlobalData.gDb.TblReport.Create()
-
- # Build database
- if self.IsInit:
- self.BuildMetaDataFileDatabase(EotGlobalData.gINF_FILES)
- EdkLogger.quiet("Building database for source code ...")
- c.CreateCCodeDB(EotGlobalData.gSOURCE_FILES)
- EdkLogger.quiet("Building database for source code done!")
-
- EotGlobalData.gIdentifierTableList = GetTableList((MODEL_FILE_C, MODEL_FILE_H), 'Identifier', EotGlobalData.gDb)
-
- ## BuildMetaDataFileDatabase() method
- #
- # Build the database for meta data files
- #
- # @param self: The object pointer
- # @param Inf_Files: A list for all INF files
- #
- def BuildMetaDataFileDatabase(self, Inf_Files):
- EdkLogger.quiet("Building database for meta data files ...")
- for InfFile in Inf_Files:
- EdkLogger.quiet("Parsing %s ..." % str(InfFile))
- EdkInfParser(InfFile, EotGlobalData.gDb, Inf_Files[InfFile], '')
-
- EotGlobalData.gDb.Conn.commit()
- EdkLogger.quiet("Building database for meta data files done!")
-
- ## ParseOption() method
- #
- # Parse command line options
- #
- # @param self: The object pointer
- #
- def ParseOption(self):
- (Options, Target) = self.EotOptionParser()
-
- # Set log level
- self.SetLogLevel(Options)
-
- if Options.FvFileList:
- self.FvFileList = Options.FvFileList
-
- if Options.MapFileList:
- self.MapFileList = Options.FvMapFileList
-
- if Options.SourceFileList:
- self.SourceFileList = Options.SourceFileList
-
- if Options.IncludeDirList:
- self.IncludeDirList = Options.IncludeDirList
-
- if Options.DecFileList:
- self.DecFileList = Options.DecFileList
-
- if Options.GuidList:
- self.GuidList = Options.GuidList
-
- if Options.LogFile:
- self.LogFile = Options.LogFile
-
- if Options.keepdatabase:
- self.IsInit = False
-
- ## SetLogLevel() method
- #
- # Set current log level of the tool based on args
- #
- # @param self: The object pointer
- # @param Option: The option list including log level setting
- #
- def SetLogLevel(self, Option):
- if Option.verbose != None:
- EdkLogger.SetLevel(EdkLogger.VERBOSE)
- elif Option.quiet != None:
- EdkLogger.SetLevel(EdkLogger.QUIET)
- elif Option.debug != None:
- EdkLogger.SetLevel(Option.debug + 1)
- else:
- EdkLogger.SetLevel(EdkLogger.INFO)
-
- ## EotOptionParser() method
- #
- # Using standard Python module optparse to parse command line option of this tool.
- #
- # @param self: The object pointer
- #
- # @retval Opt A optparse.Values object containing the parsed options
- # @retval Args Target of build command
- #
- def EotOptionParser(self):
- Parser = OptionParser(description = self.Copyright, version = self.Version, prog = "Eot.exe", usage = "%prog [options]")
- Parser.add_option("-m", "--makefile filename", action="store", type="string", dest='MakeFile',
- help="Specify a makefile for the platform.")
- Parser.add_option("-c", "--dsc filename", action="store", type="string", dest="DscFile",
- help="Specify a dsc file for the platform.")
- Parser.add_option("-f", "--fv filename", action="store", type="string", dest="FvFileList",
- help="Specify fv file list, quoted by \"\".")
- Parser.add_option("-a", "--map filename", action="store", type="string", dest="MapFileList",
- help="Specify map file list, quoted by \"\".")
- Parser.add_option("-s", "--source files", action="store", type="string", dest="SourceFileList",
- help="Specify source file list by a file")
- Parser.add_option("-i", "--include dirs", action="store", type="string", dest="IncludeDirList",
- help="Specify include dir list by a file")
- Parser.add_option("-e", "--dec files", action="store", type="string", dest="DecFileList",
- help="Specify dec file list by a file")
- Parser.add_option("-g", "--guid list", action="store", type="string", dest="GuidList",
- help="Specify guid file list by a file")
- Parser.add_option("-l", "--log filename", action="store", type="string", dest="LogFile",
- help="Specify real execution log file")
-
- Parser.add_option("-k", "--keepdatabase", action="store_true", type=None, help="The existing Eot database will not be cleaned except report information if this option is specified.")
-
- Parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")
- Parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed, "\
- "including library instances selected, final dependency expression, "\
- "and warning messages, etc.")
- Parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.")
-
- (Opt, Args)=Parser.parse_args()
-
- return (Opt, Args)
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- # Initialize log system
- EdkLogger.Initialize()
- EdkLogger.IsRaiseError = False
- EdkLogger.quiet(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime()) + "[00:00]" + "\n")
-
- StartTime = time.clock()
- Eot = Eot()
- FinishTime = time.clock()
-
- BuildDuration = time.strftime("%M:%S", time.gmtime(int(round(FinishTime - StartTime))))
- EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d %Y", time.localtime()), BuildDuration))
diff --git a/BaseTools/Source/Python/Eot/EotGlobalData.py b/BaseTools/Source/Python/Eot/EotGlobalData.py
deleted file mode 100644
index 43fd57a8de..0000000000
--- a/BaseTools/Source/Python/Eot/EotGlobalData.py
+++ /dev/null
@@ -1,138 +0,0 @@
-## @file
-# This file is used to save global datas
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-from Common.Misc import sdict
-
-gEFI_SOURCE = ''
-gEDK_SOURCE = ''
-gWORKSPACE = ''
-gSHELL_INF = 'Application\Shell'
-gMAKE_FILE = ''
-gDSC_FILE = ''
-gFV_FILE = []
-gFV = []
-gMAP_FILE = []
-gMap = {}
-
-
-gDb = ''
-gIdentifierTableList = []
-
-# Global macro
-gMACRO = {}
-gMACRO['EFI_SOURCE'] = gEFI_SOURCE
-gMACRO['EDK_SOURCE'] = gEDK_SOURCE
-gMACRO['SHELL_INF'] = gSHELL_INF
-gMACRO['CAPSULE_INF'] = ''
-
-gNOT_FOUND_FILES = []
-gSOURCE_FILES = []
-gINF_FILES = {}
-gDEC_FILES = []
-
-# Log file for unmatched variables
-gUN_MATCHED_LOG = 'Log_UnMatched.log'
-gOP_UN_MATCHED = open(gUN_MATCHED_LOG, 'w+')
-
-# Log file for all INF files
-gINF_FILES = 'Log_Inf_File.log'
-gOP_INF = open(gINF_FILES, 'w+')
-
-# Log file for not dispatched PEIM/DRIVER
-gUN_DISPATCHED_LOG = 'Log_UnDispatched.log'
-gOP_UN_DISPATCHED = open(gUN_DISPATCHED_LOG, 'w+')
-
-# Log file for unmatched variables in function calling
-gUN_MATCHED_IN_LIBRARY_CALLING_LOG = 'Log_UnMatchedInLibraryCalling.log'
-gOP_UN_MATCHED_IN_LIBRARY_CALLING = open(gUN_MATCHED_IN_LIBRARY_CALLING_LOG, 'w+')
-
-# Log file for order of dispatched PEIM/DRIVER
-gDISPATCH_ORDER_LOG = 'Log_DispatchOrder.log'
-gOP_DISPATCH_ORDER = open(gDISPATCH_ORDER_LOG, 'w+')
-
-# Log file for source files not found
-gUN_FOUND_FILES = 'Log_UnFoundSourceFiles.log'
-gOP_UN_FOUND_FILES = open(gUN_FOUND_FILES, 'w+')
-
-# Log file for found source files
-gSOURCE_FILES = 'Log_SourceFiles.log'
-gOP_SOURCE_FILES = open(gSOURCE_FILES, 'w+')
-
-# Dict for GUID found in DEC files
-gGuidDict = sdict()
-
-# Dict for hard coded GUID Macros
-# {GuidName : [GuidMacro : GuidValue]}
-gGuidMacroDict = sdict()
-
-# Dict for PPI
-gPpiList = {}
-
-# Dict for PROTOCOL
-gProtocolList = {}
-
-# Dict for consumed PPI function calling
-gConsumedPpiLibrary = sdict()
-gConsumedPpiLibrary['EfiCommonLocateInterface'] = 0
-gConsumedPpiLibrary['PeiServicesLocatePpi'] = 0
-
-# Dict for produced PROTOCOL function calling
-gProducedProtocolLibrary = sdict()
-gProducedProtocolLibrary['RegisterEsalClass'] = 0
-gProducedProtocolLibrary['CoreInstallProtocolInterface'] = 1
-gProducedProtocolLibrary['CoreInstallMultipleProtocolInterfaces'] = -1
-gProducedProtocolLibrary['EfiInstallProtocolInterface'] = 1
-gProducedProtocolLibrary['EfiReinstallProtocolInterface'] = 1
-gProducedProtocolLibrary['EfiLibNamedEventSignal'] = 0
-gProducedProtocolLibrary['LibInstallProtocolInterfaces'] = 1
-gProducedProtocolLibrary['LibReinstallProtocolInterfaces'] = 1
-
-# Dict for consumed PROTOCOL function calling
-gConsumedProtocolLibrary = sdict()
-gConsumedProtocolLibrary['EfiHandleProtocol'] = 0
-gConsumedProtocolLibrary['EfiLocateProtocolHandleBuffers'] = 0
-gConsumedProtocolLibrary['EfiLocateProtocolInterface'] = 0
-gConsumedProtocolLibrary['EfiHandleProtocol'] = 1
-
-# Dict for callback PROTOCOL function callling
-gCallbackProtocolLibrary = sdict()
-gCallbackProtocolLibrary['EfiRegisterProtocolCallback'] = 2
-
-# Dict for ARCH PROTOCOL
-gArchProtocols = ['gEfiBdsArchProtocolGuid',
- 'gEfiCapsuleArchProtocolGuid',
- 'gEfiCpuArchProtocolGuid', #5053697e-2cbc-4819-90d9-0580deee5754
- 'gEfiMetronomeArchProtocolGuid',
- 'gEfiMonotonicCounterArchProtocolGuid',
- 'gEfiRealTimeClockArchProtocolGuid',
- 'gEfiResetArchProtocolGuid',
- 'gEfiRuntimeArchProtocolGuid',
- 'gEfiSecurityArchProtocolGuid',
- 'gEfiStatusCodeRuntimeProtocolGuid',
- 'gEfiTimerArchProtocolGuid',
- 'gEfiVariableArchProtocolGuid',
- 'gEfiVariableWriteArchProtocolGuid',
- 'gEfiWatchdogTimerArchProtocolGuid']
-gArchProtocolGuids = ['665e3ff6-46cc-11d4-9a38-0090273fc14d',
- '26baccb1-6f42-11d4-bce7-0080c73c8881',
- '26baccb2-6f42-11d4-bce7-0080c73c8881',
- '1da97072-bddc-4b30-99f1-72a0b56fff2a',
- '27cfac87-46cc-11d4-9a38-0090273fc14d',
- '27cfac88-46cc-11d4-9a38-0090273fc14d',
- 'b7dfb4e1-052f-449f-87be-9818fc91b733',
- 'a46423e3-4617-49f1-b9ff-d1bfa9115839',
- 'd2b2b828-0826-48a7-b3df-983c006024f0',
- '26baccb3-6f42-11d4-bce7-0080c73c8881',
- '1e5668e2-8481-11d4-bcf1-0080c73c8881',
- '6441f818-6362-4e44-b570-7dba31dd2453',
- '665e3ff5-46cc-11d4-9a38-0090273fc14d']
diff --git a/BaseTools/Source/Python/Eot/EotToolError.py b/BaseTools/Source/Python/Eot/EotToolError.py
deleted file mode 100644
index 0b3686a586..0000000000
--- a/BaseTools/Source/Python/Eot/EotToolError.py
+++ /dev/null
@@ -1,21 +0,0 @@
-## @file
-# Standardized Error Handling infrastructures.
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-# Error id
-ERROR_1 = 1000
-
-# Error message
-gEccErrorMessage = {
- ERROR_1 : "RESERVED"
- }
-
diff --git a/BaseTools/Source/Python/Eot/FileProfile.py b/BaseTools/Source/Python/Eot/FileProfile.py
deleted file mode 100644
index b377ef6f41..0000000000
--- a/BaseTools/Source/Python/Eot/FileProfile.py
+++ /dev/null
@@ -1,58 +0,0 @@
-## @file
-# fragments of source file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-
-import re
-import os
-from ParserWarning import Warning
-
-# Profile contents of a file
-PPDirectiveList = []
-AssignmentExpressionList = []
-PredicateExpressionList = []
-FunctionDefinitionList = []
-VariableDeclarationList = []
-EnumerationDefinitionList = []
-StructUnionDefinitionList = []
-TypedefDefinitionList = []
-FunctionCallingList = []
-
-## Class FileProfile
-#
-# record file data when parsing source
-#
-# May raise Exception when opening file.
-#
-class FileProfile :
-
- ## The constructor
- #
- # @param self: The object pointer
- # @param FileName: The file that to be parsed
- #
- def __init__(self, FileName):
- self.FileLinesList = []
- self.FileLinesListFromFile = []
- try:
- fsock = open(FileName, "rb", 0)
- try:
- self.FileLinesListFromFile = fsock.readlines()
- finally:
- fsock.close()
-
- except IOError:
- raise Warning("Error when opening file %s" % FileName)
diff --git a/BaseTools/Source/Python/Eot/FvImage.py b/BaseTools/Source/Python/Eot/FvImage.py
deleted file mode 100644
index d54c2233d8..0000000000
--- a/BaseTools/Source/Python/Eot/FvImage.py
+++ /dev/null
@@ -1,1453 +0,0 @@
-## @file
-# Parse FV image
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-## Import Modules
-#
-import os
-import re
-import sys
-import uuid
-import struct
-import codecs
-import copy
-
-from UserDict import IterableUserDict
-from cStringIO import StringIO
-from array import array
-
-from CommonDataClass import *
-from Common.Misc import sdict, GuidStructureStringToGuidString
-
-import Common.EdkLogger as EdkLogger
-
-import EotGlobalData
-
-# Global definiton
-gFfsPrintTitle = "%-36s %-21s %8s %8s %8s %-4s %-36s" % ("GUID", "TYPE", "OFFSET", "SIZE", "FREE", "ALIGN", "NAME")
-gFfsPrintFormat = "%36s %-21s %8X %8X %8X %4s %-36s"
-gGuidStringFormat = "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X"
-gPeiAprioriFileNameGuid = '1b45cc0a-156a-428a-af62-49864da0e6e6'
-gAprioriGuid = 'fc510ee7-ffdc-11d4-bd41-0080c73c8881'
-gIndention = -4
-
-## Image() class
-#
-# A class for Image
-#
-class Image(array):
- _HEADER_ = struct.Struct("")
- _HEADER_SIZE_ = _HEADER_.size
-
- def __new__(cls, *args, **kwargs):
- return array.__new__(cls, 'B')
-
- def __init__(m, ID=None):
- if ID == None:
- m._ID_ = str(uuid.uuid1()).upper()
- else:
- m._ID_ = ID
- m._BUF_ = None
- m._LEN_ = None
- m._OFF_ = None
-
- m._SubImages = sdict() # {offset: Image()}
-
- array.__init__(m, 'B')
-
- def __repr__(m):
- return m._ID_
-
- def __len__(m):
- Len = array.__len__(m)
- for Offset in m._SubImages:
- Len += len(m._SubImages[Offset])
- return Len
-
- def _Unpack(m):
- m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
- return len(m)
-
- def _Pack(m, PadByte=0xFF):
- raise NotImplementedError
-
- def frombuffer(m, Buffer, Offset=0, Size=None):
- m._BUF_ = Buffer
- m._OFF_ = Offset
- # we may need the Size information in advance if it's given
- m._LEN_ = Size
- m._LEN_ = m._Unpack()
-
- def empty(m):
- del m[0:]
-
- def GetField(m, FieldStruct, Offset=0):
- return FieldStruct.unpack_from(m, Offset)
-
- def SetField(m, FieldStruct, Offset, *args):
- # check if there's enough space
- Size = FieldStruct.size
- if Size > len(m):
- m.extend([0] * (Size - len(m)))
- FieldStruct.pack_into(m, Offset, *args)
-
- def _SetData(m, Data):
- if len(m) < m._HEADER_SIZE_:
- m.extend([0] * (m._HEADER_SIZE_ - len(m)))
- else:
- del m[m._HEADER_SIZE_:]
- m.extend(Data)
-
- def _GetData(m):
- if len(m) > m._HEADER_SIZE_:
- return m[m._HEADER_SIZE_:]
- return None
-
- Data = property(_GetData, _SetData)
-
-## FirmwareVolume() class
-#
-# A class for Firmware Volume
-#
-class FirmwareVolume(Image):
- # Read FvLength, Attributes, HeaderLength, Checksum
- _HEADER_ = struct.Struct("16x 1I2H8B 1Q 4x 1I 1H 1H")
- _HEADER_SIZE_ = _HEADER_.size
-
- _FfsGuid = "8C8CE578-8A3D-4F1C-9935-896185C32DD3"
-
- _GUID_ = struct.Struct("16x 1I2H8B")
- _LENGTH_ = struct.Struct("16x 16x 1Q")
- _SIG_ = struct.Struct("16x 16x 8x 1I")
- _ATTR_ = struct.Struct("16x 16x 8x 4x 1I")
- _HLEN_ = struct.Struct("16x 16x 8x 4x 4x 1H")
- _CHECKSUM_ = struct.Struct("16x 16x 8x 4x 4x 2x 1H")
-
- def __init__(self, Name=''):
- Image.__init__(self)
- self.Name = Name
- self.FfsDict = sdict()
- self.OrderedFfsDict = sdict()
- self.UnDispatchedFfsDict = sdict()
- self.NoDepexFfsDict = sdict()
- self.ProtocolList = sdict()
-
- def CheckArchProtocol(self):
- for Item in EotGlobalData.gArchProtocolGuids:
- if Item.lower() not in EotGlobalData.gProtocolList:
-
- return False
-
- return True
-
- def ParseDepex(self, Depex, Type):
- List = None
- if Type == 'Ppi':
- List = EotGlobalData.gPpiList
- if Type == 'Protocol':
- List = EotGlobalData.gProtocolList
- DepexStack = []
- DepexList = []
- DepexString = ''
- FileDepex = None
- CouldBeLoaded = True
- for Index in range(0, len(Depex.Expression)):
- Item = Depex.Expression[Index]
- if Item == 0x00:
- Index = Index + 1
- Guid = gGuidStringFormat % Depex.Expression[Index]
- if Guid in self.OrderedFfsDict and Depex.Expression[Index + 1] == 0x08:
- return (True, 'BEFORE %s' % Guid, [Guid, 'BEFORE'])
- elif Item == 0x01:
- Index = Index + 1
- Guid = gGuidStringFormat % Depex.Expression[Index]
- if Guid in self.OrderedFfsDict and Depex.Expression[Index + 1] == 0x08:
- return (True, 'AFTER %s' % Guid, [Guid, 'AFTER'])
- elif Item == 0x02:
- Index = Index + 1
- Guid = gGuidStringFormat % Depex.Expression[Index]
- if Guid.lower() in List:
- DepexStack.append(True)
- DepexList.append(Guid)
- else:
- DepexStack.append(False)
- DepexList.append(Guid)
- continue
- elif Item == 0x03 or Item == 0x04:
- DepexStack.append(eval(str(DepexStack.pop()) + ' ' + Depex._OPCODE_STRING_[Item].lower() + ' ' + str(DepexStack.pop())))
- DepexList.append(str(DepexList.pop()) + ' ' + Depex._OPCODE_STRING_[Item].upper() + ' ' + str(DepexList.pop()))
- elif Item == 0x05:
- DepexStack.append(eval(Depex._OPCODE_STRING_[Item].lower() + ' ' + str(DepexStack.pop())))
- DepexList.append(Depex._OPCODE_STRING_[Item].lower() + ' ' + str(DepexList.pop()))
- elif Item == 0x06:
- DepexStack.append(True)
- DepexList.append('TRUE')
- DepexString = DepexString + 'TRUE' + ' '
- elif Item == 0x07:
- DepexStack.append(False)
- DepexList.append('False')
- DepexString = DepexString + 'FALSE' + ' '
- elif Item == 0x08:
- if Index != len(Depex.Expression) - 1:
- CouldBeLoaded = False
- else:
- CouldBeLoaded = DepexStack.pop()
- else:
- CouldBeLoaded = False
- if DepexList != []:
- DepexString = DepexList[0].strip()
- return (CouldBeLoaded, DepexString, FileDepex)
-
- def Dispatch(self, Db = None):
- if Db == None:
- return False
- self.UnDispatchedFfsDict = copy.copy(self.FfsDict)
- # Find PeiCore, DexCore, PeiPriori, DxePriori first
- FfsSecCoreGuid = None
- FfsPeiCoreGuid = None
- FfsDxeCoreGuid = None
- FfsPeiPrioriGuid = None
- FfsDxePrioriGuid = None
- for FfsID in self.UnDispatchedFfsDict:
- Ffs = self.UnDispatchedFfsDict[FfsID]
- if Ffs.Type == 0x03:
- FfsSecCoreGuid = FfsID
- continue
- if Ffs.Type == 0x04:
- FfsPeiCoreGuid = FfsID
- continue
- if Ffs.Type == 0x05:
- FfsDxeCoreGuid = FfsID
- continue
- if Ffs.Guid.lower() == gPeiAprioriFileNameGuid:
- FfsPeiPrioriGuid = FfsID
- continue
- if Ffs.Guid.lower() == gAprioriGuid:
- FfsDxePrioriGuid = FfsID
- continue
-
- # Parse SEC_CORE first
- if FfsSecCoreGuid != None:
- self.OrderedFfsDict[FfsSecCoreGuid] = self.UnDispatchedFfsDict.pop(FfsSecCoreGuid)
- self.LoadPpi(Db, FfsSecCoreGuid)
-
- # Parse PEI first
- if FfsPeiCoreGuid != None:
- self.OrderedFfsDict[FfsPeiCoreGuid] = self.UnDispatchedFfsDict.pop(FfsPeiCoreGuid)
- self.LoadPpi(Db, FfsPeiCoreGuid)
- if FfsPeiPrioriGuid != None:
- # Load PEIM described in priori file
- FfsPeiPriori = self.UnDispatchedFfsDict.pop(FfsPeiPrioriGuid)
- if len(FfsPeiPriori.Sections) == 1:
- Section = FfsPeiPriori.Sections.popitem()[1]
- if Section.Type == 0x19:
- GuidStruct = struct.Struct('1I2H8B')
- Start = 4
- while len(Section) > Start:
- Guid = GuidStruct.unpack_from(Section[Start : Start + 16])
- GuidString = gGuidStringFormat % Guid
- Start = Start + 16
- if GuidString in self.UnDispatchedFfsDict:
- self.OrderedFfsDict[GuidString] = self.UnDispatchedFfsDict.pop(GuidString)
- self.LoadPpi(Db, GuidString)
-
- self.DisPatchPei(Db)
-
- # Parse DXE then
- if FfsDxeCoreGuid != None:
- self.OrderedFfsDict[FfsDxeCoreGuid] = self.UnDispatchedFfsDict.pop(FfsDxeCoreGuid)
- self.LoadProtocol(Db, FfsDxeCoreGuid)
- if FfsDxePrioriGuid != None:
- # Load PEIM described in priori file
- FfsDxePriori = self.UnDispatchedFfsDict.pop(FfsDxePrioriGuid)
- if len(FfsDxePriori.Sections) == 1:
- Section = FfsDxePriori.Sections.popitem()[1]
- if Section.Type == 0x19:
- GuidStruct = struct.Struct('1I2H8B')
- Start = 4
- while len(Section) > Start:
- Guid = GuidStruct.unpack_from(Section[Start : Start + 16])
- GuidString = gGuidStringFormat % Guid
- Start = Start + 16
- if GuidString in self.UnDispatchedFfsDict:
- self.OrderedFfsDict[GuidString] = self.UnDispatchedFfsDict.pop(GuidString)
- self.LoadProtocol(Db, GuidString)
-
- self.DisPatchDxe(Db)
-
- def DisPatchNoDepexFfs(self, Db):
- # Last Load Drivers without Depex
- for FfsID in self.NoDepexFfsDict:
- NewFfs = self.NoDepexFfsDict.pop(FfsID)
- self.OrderedFfsDict[FfsID] = NewFfs
- self.LoadProtocol(Db, FfsID)
-
- return True
-
- def LoadCallbackProtocol(self):
- IsLoad = True
- for Protocol in self.ProtocolList:
- for Callback in self.ProtocolList[Protocol][1]:
- if Callback[0] not in self.OrderedFfsDict.keys():
- IsLoad = False
- continue
- if IsLoad:
- EotGlobalData.gProtocolList[Protocol.lower()] = self.ProtocolList[Protocol][0]
- self.ProtocolList.pop(Protocol)
-
- def LoadProtocol(self, Db, ModuleGuid):
- SqlCommand = """select GuidValue from Report
- where SourceFileFullPath in
- (select Value1 from Inf where BelongsToFile =
- (select BelongsToFile from Inf
- where Value1 = 'FILE_GUID' and Value2 like '%s' and Model = %s)
- and Model = %s)
- and ItemType = 'Protocol' and ItemMode = 'Produced'""" \
- % (ModuleGuid, 5001, 3007)
- RecordSet = Db.TblReport.Exec(SqlCommand)
- for Record in RecordSet:
- SqlCommand = """select Value2 from Inf where BelongsToFile =
- (select DISTINCT BelongsToFile from Inf
- where Value1 =
- (select SourceFileFullPath from Report
- where GuidValue like '%s' and ItemMode = 'Callback'))
- and Value1 = 'FILE_GUID'""" % Record[0]
- CallBackSet = Db.TblReport.Exec(SqlCommand)
- if CallBackSet != []:
- EotGlobalData.gProtocolList[Record[0].lower()] = ModuleGuid
- else:
- EotGlobalData.gProtocolList[Record[0].lower()] = ModuleGuid
-
- def LoadPpi(self, Db, ModuleGuid):
- SqlCommand = """select GuidValue from Report
- where SourceFileFullPath in
- (select Value1 from Inf where BelongsToFile =
- (select BelongsToFile from Inf
- where Value1 = 'FILE_GUID' and Value2 like '%s' and Model = %s)
- and Model = %s)
- and ItemType = 'Ppi' and ItemMode = 'Produced'""" \
- % (ModuleGuid, 5001, 3007)
- RecordSet = Db.TblReport.Exec(SqlCommand)
- for Record in RecordSet:
- EotGlobalData.gPpiList[Record[0].lower()] = ModuleGuid
-
- def DisPatchDxe(self, Db):
- IsInstalled = False
- ScheduleList = sdict()
- for FfsID in self.UnDispatchedFfsDict:
- CouldBeLoaded = False
- DepexString = ''
- FileDepex = None
- Ffs = self.UnDispatchedFfsDict[FfsID]
- if Ffs.Type == 0x07:
- # Get Depex
- IsFoundDepex = False
- for Section in Ffs.Sections.values():
- # Find Depex
- if Section.Type == 0x13:
- IsFoundDepex = True
- CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(Section._SubImages[4], 'Protocol')
- break
- if Section.Type == 0x01:
- CompressSections = Section._SubImages[4]
- for CompressSection in CompressSections.Sections:
- if CompressSection.Type == 0x13:
- IsFoundDepex = True
- CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(CompressSection._SubImages[4], 'Protocol')
- break
- if CompressSection.Type == 0x02:
- NewSections = CompressSection._SubImages[4]
- for NewSection in NewSections.Sections:
- if NewSection.Type == 0x13:
- IsFoundDepex = True
- CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(NewSection._SubImages[4], 'Protocol')
- break
-
- # Not find Depex
- if not IsFoundDepex:
- CouldBeLoaded = self.CheckArchProtocol()
- DepexString = ''
- FileDepex = None
-
- # Append New Ffs
- if CouldBeLoaded:
- IsInstalled = True
- NewFfs = self.UnDispatchedFfsDict.pop(FfsID)
- NewFfs.Depex = DepexString
- if FileDepex != None:
- ScheduleList.insert.insert(FileDepex[1], FfsID, NewFfs, FileDepex[0])
- else:
- ScheduleList[FfsID] = NewFfs
- else:
- self.UnDispatchedFfsDict[FfsID].Depex = DepexString
-
- for FfsID in ScheduleList:
- NewFfs = ScheduleList.pop(FfsID)
- FfsName = 'UnKnown'
- self.OrderedFfsDict[FfsID] = NewFfs
- self.LoadProtocol(Db, FfsID)
-
- SqlCommand = """select Value2 from Inf
- where BelongsToFile = (select BelongsToFile from Inf where Value1 = 'FILE_GUID' and lower(Value2) = lower('%s') and Model = %s)
- and Model = %s and Value1='BASE_NAME'""" % (FfsID, 5001, 5001)
- RecordSet = Db.TblReport.Exec(SqlCommand)
- if RecordSet != []:
- FfsName = RecordSet[0][0]
-
- if IsInstalled:
- self.DisPatchDxe(Db)
-
- def DisPatchPei(self, Db):
- IsInstalled = False
- for FfsID in self.UnDispatchedFfsDict:
- CouldBeLoaded = True
- DepexString = ''
- FileDepex = None
- Ffs = self.UnDispatchedFfsDict[FfsID]
- if Ffs.Type == 0x06 or Ffs.Type == 0x08:
- # Get Depex
- for Section in Ffs.Sections.values():
- if Section.Type == 0x1B:
- CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(Section._SubImages[4], 'Ppi')
- break
-
- if Section.Type == 0x01:
- CompressSections = Section._SubImages[4]
- for CompressSection in CompressSections.Sections:
- if CompressSection.Type == 0x1B:
- CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(CompressSection._SubImages[4], 'Ppi')
- break
- if CompressSection.Type == 0x02:
- NewSections = CompressSection._SubImages[4]
- for NewSection in NewSections.Sections:
- if NewSection.Type == 0x1B:
- CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(NewSection._SubImages[4], 'Ppi')
- break
-
- # Append New Ffs
- if CouldBeLoaded:
- IsInstalled = True
- NewFfs = self.UnDispatchedFfsDict.pop(FfsID)
- NewFfs.Depex = DepexString
- self.OrderedFfsDict[FfsID] = NewFfs
- self.LoadPpi(Db, FfsID)
- else:
- self.UnDispatchedFfsDict[FfsID].Depex = DepexString
-
- if IsInstalled:
- self.DisPatchPei(Db)
-
-
- def __str__(self):
- global gIndention
- gIndention += 4
- FvInfo = '\n' + ' ' * gIndention
- FvInfo += "[FV:%s] file_system=%s size=%x checksum=%s\n" % (self.Name, self.FileSystemGuid, self.Size, self.Checksum)
- FfsInfo = "\n".join([str(self.FfsDict[FfsId]) for FfsId in self.FfsDict])
- gIndention -= 4
- return FvInfo + FfsInfo
-
- def _Unpack(self):
- Size = self._LENGTH_.unpack_from(self._BUF_, self._OFF_)[0]
- self.empty()
- self.extend(self._BUF_[self._OFF_:self._OFF_+Size])
-
- # traverse the FFS
- EndOfFv = Size
- FfsStartAddress = self.HeaderSize
- LastFfsObj = None
- while FfsStartAddress < EndOfFv:
- FfsObj = Ffs()
- FfsObj.frombuffer(self, FfsStartAddress)
- FfsId = repr(FfsObj)
- if ((self.Attributes & 0x00000800) != 0 and len(FfsObj) == 0xFFFFFF) \
- or ((self.Attributes & 0x00000800) == 0 and len(FfsObj) == 0):
- if LastFfsObj != None:
- LastFfsObj.FreeSpace = EndOfFv - LastFfsObj._OFF_ - len(LastFfsObj)
- else:
- if FfsId in self.FfsDict:
- EdkLogger.error("FV", 0, "Duplicate GUID in FFS",
- ExtraData="\t%s @ %s\n\t%s @ %s" \
- % (FfsObj.Guid, FfsObj.Offset,
- self.FfsDict[FfsId].Guid, self.FfsDict[FfsId].Offset))
- self.FfsDict[FfsId] = FfsObj
- if LastFfsObj != None:
- LastFfsObj.FreeSpace = FfsStartAddress - LastFfsObj._OFF_ - len(LastFfsObj)
-
- FfsStartAddress += len(FfsObj)
- #
- # align to next 8-byte aligned address: A = (A + 8 - 1) & (~(8 - 1))
- # The next FFS must be at the latest next 8-byte aligned address
- #
- FfsStartAddress = (FfsStartAddress + 7) & (~7)
- LastFfsObj = FfsObj
-
- def _GetAttributes(self):
- return self.GetField(self._ATTR_, 0)[0]
-
- def _GetSize(self):
- return self.GetField(self._LENGTH_, 0)[0]
-
- def _GetChecksum(self):
- return self.GetField(self._CHECKSUM_, 0)[0]
-
- def _GetHeaderLength(self):
- return self.GetField(self._HLEN_, 0)[0]
-
- def _GetFileSystemGuid(self):
- return gGuidStringFormat % self.GetField(self._GUID_, 0)
-
- Attributes = property(_GetAttributes)
- Size = property(_GetSize)
- Checksum = property(_GetChecksum)
- HeaderSize = property(_GetHeaderLength)
- FileSystemGuid = property(_GetFileSystemGuid)
-
-## CompressedImage() class
-#
-# A class for Compressed Image
-#
-class CompressedImage(Image):
- # UncompressedLength = 4-byte
- # CompressionType = 1-byte
- _HEADER_ = struct.Struct("1I 1B")
- _HEADER_SIZE_ = _HEADER_.size
-
- _ORIG_SIZE_ = struct.Struct("1I")
- _CMPRS_TYPE_ = struct.Struct("4x 1B")
-
- def __init__(m, CompressedData=None, CompressionType=None, UncompressedLength=None):
- Image.__init__(m)
- if UncompressedLength != None:
- m.UncompressedLength = UncompressedLength
- if CompressionType != None:
- m.CompressionType = CompressionType
- if CompressedData != None:
- m.Data = CompressedData
-
- def __str__(m):
- global gIndention
- S = "algorithm=%s uncompressed=%x" % (m.CompressionType, m.UncompressedLength)
- for Sec in m.Sections:
- S += '\n' + str(Sec)
-
- return S
-
- def _SetOriginalSize(m, Size):
- m.SetField(m._ORIG_SIZE_, 0, Size)
-
- def _GetOriginalSize(m):
- return m.GetField(m._ORIG_SIZE_)[0]
-
- def _SetCompressionType(m, Type):
- m.SetField(m._CMPRS_TYPE_, 0, Type)
-
- def _GetCompressionType(m):
- return m.GetField(m._CMPRS_TYPE_)[0]
-
- def _GetSections(m):
- try:
- import EfiCompressor
- TmpData = EfiCompressor.FrameworkDecompress(
- m[m._HEADER_SIZE_:],
- len(m) - m._HEADER_SIZE_
- )
- DecData = array('B')
- DecData.fromstring(TmpData)
- except:
- import EfiCompressor
- TmpData = EfiCompressor.UefiDecompress(
- m[m._HEADER_SIZE_:],
- len(m) - m._HEADER_SIZE_
- )
- DecData = array('B')
- DecData.fromstring(TmpData)
-
- SectionList = []
- Offset = 0
- while Offset < len(DecData):
- Sec = Section()
- try:
- Sec.frombuffer(DecData, Offset)
- Offset += Sec.Size
- # the section is aligned to 4-byte boundary
- except:
- break
- SectionList.append(Sec)
- return SectionList
-
- UncompressedLength = property(_GetOriginalSize, _SetOriginalSize)
- CompressionType = property(_GetCompressionType, _SetCompressionType)
- Sections = property(_GetSections)
-
-## GuidDefinedImage() class
-#
-# A class for GUID Defined Image
-#
-class GuidDefinedImage(Image):
- _HEADER_ = struct.Struct("1I2H8B 1H 1H")
- _HEADER_SIZE_ = _HEADER_.size
-
- _GUID_ = struct.Struct("1I2H8B")
- _DATA_OFFSET_ = struct.Struct("16x 1H")
- _ATTR_ = struct.Struct("18x 1H")
-
- CRC32_GUID = "FC1BCDB0-7D31-49AA-936A-A4600D9DD083"
- TIANO_COMPRESS_GUID = 'A31280AD-481E-41B6-95E8-127F4C984779'
- LZMA_COMPRESS_GUID = 'EE4E5898-3914-4259-9D6E-DC7BD79403CF'
-
- def __init__(m, SectionDefinitionGuid=None, DataOffset=None, Attributes=None, Data=None):
- Image.__init__(m)
- if SectionDefinitionGuid != None:
- m.SectionDefinitionGuid = SectionDefinitionGuid
- if DataOffset != None:
- m.DataOffset = DataOffset
- if Attributes != None:
- m.Attributes = Attributes
- if Data != None:
- m.Data = Data
-
- def __str__(m):
- S = "guid=%s" % (gGuidStringFormat % m.SectionDefinitionGuid)
- for Sec in m.Sections:
- S += "\n" + str(Sec)
- return S
-
- def _Unpack(m):
- # keep header in this Image object
- m.empty()
- m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
- return len(m)
-
- def _SetAttribute(m, Attribute):
- m.SetField(m._ATTR_, 0, Attribute)
-
- def _GetAttribute(m):
- return m.GetField(m._ATTR_)[0]
-
- def _SetGuid(m, Guid):
- m.SetField(m._GUID_, 0, Guid)
-
- def _GetGuid(m):
- return m.GetField(m._GUID_)
-
- def _SetDataOffset(m, Offset):
- m.SetField(m._DATA_OFFSET_, 0, Offset)
-
- def _GetDataOffset(m):
- return m.GetField(m._DATA_OFFSET_)[0]
-
- def _GetSections(m):
- SectionList = []
- Guid = gGuidStringFormat % m.SectionDefinitionGuid
- if Guid == m.CRC32_GUID:
- # skip the CRC32 value, we don't do CRC32 verification here
- Offset = m.DataOffset - 4
- while Offset < len(m):
- Sec = Section()
- try:
- Sec.frombuffer(m, Offset)
- Offset += Sec.Size
- # the section is aligned to 4-byte boundary
- Offset = (Offset + 3) & (~3)
- except:
- break
- SectionList.append(Sec)
- elif Guid == m.TIANO_COMPRESS_GUID:
- try:
- import EfiCompressor
- # skip the header
- Offset = m.DataOffset - 4
- TmpData = EfiCompressor.FrameworkDecompress(m[Offset:], len(m)-Offset)
- DecData = array('B')
- DecData.fromstring(TmpData)
- Offset = 0
- while Offset < len(DecData):
- Sec = Section()
- try:
- Sec.frombuffer(DecData, Offset)
- Offset += Sec.Size
- # the section is aligned to 4-byte boundary
- Offset = (Offset + 3) & (~3)
- except:
- break
- SectionList.append(Sec)
- except:
- pass
- elif Guid == m.LZMA_COMPRESS_GUID:
- try:
- import LzmaCompressor
- # skip the header
- Offset = m.DataOffset - 4
- TmpData = LzmaCompressor.LzmaDecompress(m[Offset:], len(m)-Offset)
- DecData = array('B')
- DecData.fromstring(TmpData)
- Offset = 0
- while Offset < len(DecData):
- Sec = Section()
- try:
- Sec.frombuffer(DecData, Offset)
- Offset += Sec.Size
- # the section is aligned to 4-byte boundary
- Offset = (Offset + 3) & (~3)
- except:
- break
- SectionList.append(Sec)
- except:
- pass
-
- return SectionList
-
- Attributes = property(_GetAttribute, _SetAttribute)
- SectionDefinitionGuid = property(_GetGuid, _SetGuid)
- DataOffset = property(_GetDataOffset, _SetDataOffset)
- Sections = property(_GetSections)
-
-## Depex() class
-#
-# A class for Depex
-#
-class Depex(Image):
- _HEADER_ = struct.Struct("")
- _HEADER_SIZE_ = 0
-
- _GUID_ = struct.Struct("1I2H8B")
- _OPCODE_ = struct.Struct("1B")
-
- _OPCODE_STRING_ = {
- 0x00 : "BEFORE",
- 0x01 : "AFTER",
- 0x02 : "PUSH",
- 0x03 : "AND",
- 0x04 : "OR",
- 0x05 : "NOT",
- 0x06 : "TRUE",
- 0x07 : "FALSE",
- 0x08 : "END",
- 0x09 : "SOR"
- }
-
- _NEXT_ = {
- -1 : _OPCODE_, # first one in depex must be an opcdoe
- 0x00 : _GUID_, #"BEFORE",
- 0x01 : _GUID_, #"AFTER",
- 0x02 : _GUID_, #"PUSH",
- 0x03 : _OPCODE_, #"AND",
- 0x04 : _OPCODE_, #"OR",
- 0x05 : _OPCODE_, #"NOT",
- 0x06 : _OPCODE_, #"TRUE",
- 0x07 : _OPCODE_, #"FALSE",
- 0x08 : None, #"END",
- 0x09 : _OPCODE_, #"SOR"
- }
-
- def __init__(m):
- Image.__init__(m)
- m._ExprList = []
-
- def __str__(m):
- global gIndention
- gIndention += 4
- Indention = ' ' * gIndention
- S = '\n'
- for T in m.Expression:
- if T in m._OPCODE_STRING_:
- S += Indention + m._OPCODE_STRING_[T]
- if T not in [0x00, 0x01, 0x02]:
- S += '\n'
- else:
- S += ' ' + gGuidStringFormat % T + '\n'
- gIndention -= 4
- return S
-
- def _Unpack(m):
- # keep header in this Image object
- m.empty()
- m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
- return len(m)
-
- def _GetExpression(m):
- if m._ExprList == []:
- Offset = 0
- CurrentData = m._OPCODE_
- while Offset < len(m):
- Token = CurrentData.unpack_from(m, Offset)
- Offset += CurrentData.size
- if len(Token) == 1:
- Token = Token[0]
- if Token in m._NEXT_:
- CurrentData = m._NEXT_[Token]
- else:
- CurrentData = m._GUID_
- else:
- CurrentData = m._OPCODE_
- m._ExprList.append(Token)
- if CurrentData == None:
- break
- return m._ExprList
-
- Expression = property(_GetExpression)
-
-## Ui() class
-#
-# A class for Ui
-#
-class Ui(Image):
- _HEADER_ = struct.Struct("")
- _HEADER_SIZE_ = 0
-
- def __init__(m):
- Image.__init__(m)
-
- def __str__(m):
- return m.String
-
- def _Unpack(m):
- # keep header in this Image object
- m.empty()
- m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
- return len(m)
-
- def _GetUiString(m):
- return codecs.utf_16_decode(m[0:-2].tostring())[0]
-
- String = property(_GetUiString)
-
-## Section() class
-#
-# A class for Section
-#
-class Section(Image):
- _TypeName = {
- 0x00 : "<unknown>",
- 0x01 : "COMPRESSION",
- 0x02 : "GUID_DEFINED",
- 0x10 : "PE32",
- 0x11 : "PIC",
- 0x12 : "TE",
- 0x13 : "DXE_DEPEX",
- 0x14 : "VERSION",
- 0x15 : "USER_INTERFACE",
- 0x16 : "COMPATIBILITY16",
- 0x17 : "FIRMWARE_VOLUME_IMAGE",
- 0x18 : "FREEFORM_SUBTYPE_GUID",
- 0x19 : "RAW",
- 0x1B : "PEI_DEPEX"
- }
-
- _SectionSubImages = {
- 0x01 : CompressedImage,
- 0x02 : GuidDefinedImage,
- 0x17 : FirmwareVolume,
- 0x13 : Depex,
- 0x1B : Depex,
- 0x15 : Ui
- }
-
- # Size = 3-byte
- # Type = 1-byte
- _HEADER_ = struct.Struct("3B 1B")
- _HEADER_SIZE_ = _HEADER_.size
-
- # SubTypeGuid
- # _FREE_FORM_SUBTYPE_GUID_HEADER_ = struct.Struct("1I2H8B")
-
- _SIZE_ = struct.Struct("3B")
- _TYPE_ = struct.Struct("3x 1B")
-
- def __init__(m, Type=None, Size=None):
- Image.__init__(m)
- m._Alignment = 1
- if Type != None:
- m.Type = Type
- if Size != None:
- m.Size = Size
-
- def __str__(m):
- global gIndention
- gIndention += 4
- SectionInfo = ' ' * gIndention
- if m.Type in m._TypeName:
- SectionInfo += "[SECTION:%s] offset=%x size=%x" % (m._TypeName[m.Type], m._OFF_, m.Size)
- else:
- SectionInfo += "[SECTION:%x<unknown>] offset=%x size=%x " % (m.Type, m._OFF_, m.Size)
- for Offset in m._SubImages:
- SectionInfo += ", " + str(m._SubImages[Offset])
- gIndention -= 4
- return SectionInfo
-
- def _Unpack(m):
- m.empty()
- Type, = m._TYPE_.unpack_from(m._BUF_, m._OFF_)
- Size1, Size2, Size3 = m._SIZE_.unpack_from(m._BUF_, m._OFF_)
- Size = Size1 + (Size2 << 8) + (Size3 << 16)
-
- if Type not in m._SectionSubImages:
- # no need to extract sub-image, keep all in this Image object
- m.extend(m._BUF_[m._OFF_ : m._OFF_ + Size])
- else:
- # keep header in this Image object
- m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._HEADER_SIZE_])
- #
- # use new Image object to represent payload, which may be another kind
- # of image such as PE32
- #
- PayloadOffset = m._HEADER_SIZE_
- PayloadLen = m.Size - m._HEADER_SIZE_
- Payload = m._SectionSubImages[m.Type]()
- Payload.frombuffer(m._BUF_, m._OFF_ + m._HEADER_SIZE_, PayloadLen)
- m._SubImages[PayloadOffset] = Payload
-
- return Size
-
- def _SetSize(m, Size):
- Size1 = Size & 0xFF
- Size2 = (Size & 0xFF00) >> 8
- Size3 = (Size & 0xFF0000) >> 16
- m.SetField(m._SIZE_, 0, Size1, Size2, Size3)
-
- def _GetSize(m):
- Size1, Size2, Size3 = m.GetField(m._SIZE_)
- return Size1 + (Size2 << 8) + (Size3 << 16)
-
- def _SetType(m, Type):
- m.SetField(m._TYPE_, 0, Type)
-
- def _GetType(m):
- return m.GetField(m._TYPE_)[0]
-
- def _GetAlignment(m):
- return m._Alignment
-
- def _SetAlignment(m, Alignment):
- m._Alignment = Alignment
- AlignmentMask = Alignment - 1
- # section alignment is actually for payload, so we need to add header size
- PayloadOffset = m._OFF_ + m._HEADER_SIZE_
- if (PayloadOffset & (~AlignmentMask)) == 0:
- return
- NewOffset = (PayloadOffset + AlignmentMask) & (~AlignmentMask)
- while (NewOffset - PayloadOffset) < m._HEADER_SIZE_:
- NewOffset += m._Alignment
-
- def tofile(m, f):
- m.Size = len(m)
- Image.tofile(m, f)
- for Offset in m._SubImages:
- m._SubImages[Offset].tofile(f)
-
- Type = property(_GetType, _SetType)
- Size = property(_GetSize, _SetSize)
- Alignment = property(_GetAlignment, _SetAlignment)
- # SubTypeGuid = property(_GetGuid, _SetGuid)
-
-## PadSection() class
-#
-# A class for Pad Section
-#
-class PadSection(Section):
- def __init__(m, Size):
- Section.__init__(m)
- m.Type = 0x19
- m.Size = Size
- m.Data = [0] * (Size - m._HEADER_SIZE_)
-
-## Ffs() class
-#
-# A class for Ffs Section
-#
-class Ffs(Image):
- _FfsFormat = "24B%(payload_size)sB"
- # skip IntegrityCheck
- _HEADER_ = struct.Struct("1I2H8B 2x 1B 1B 3B 1B")
- _HEADER_SIZE_ = _HEADER_.size
-
- _NAME_ = struct.Struct("1I2H8B")
- _INT_CHECK_ = struct.Struct("16x 1H")
- _TYPE_ = struct.Struct("18x 1B")
- _ATTR_ = struct.Struct("19x 1B")
- _SIZE_ = struct.Struct("20x 3B")
- _STATE_ = struct.Struct("23x 1B")
-
- VTF_GUID = "1BA0062E-C779-4582-8566-336AE8F78F09"
-
- FFS_ATTRIB_FIXED = 0x04
- FFS_ATTRIB_DATA_ALIGNMENT = 0x38
- FFS_ATTRIB_CHECKSUM = 0x40
-
- _TypeName = {
- 0x00 : "<unknown>",
- 0x01 : "RAW",
- 0x02 : "FREEFORM",
- 0x03 : "SECURITY_CORE",
- 0x04 : "PEI_CORE",
- 0x05 : "DXE_CORE",
- 0x06 : "PEIM",
- 0x07 : "DRIVER",
- 0x08 : "COMBINED_PEIM_DRIVER",
- 0x09 : "APPLICATION",
- 0x0A : "SMM",
- 0x0B : "FIRMWARE_VOLUME_IMAGE",
- 0x0C : "COMBINED_SMM_DXE",
- 0x0D : "SMM_CORE",
- 0xc0 : "OEM_MIN",
- 0xdf : "OEM_MAX",
- 0xe0 : "DEBUG_MIN",
- 0xef : "DEBUG_MAX",
- 0xf0 : "FFS_MIN",
- 0xff : "FFS_MAX",
- 0xf0 : "FFS_PAD",
- }
-
- def __init__(self):
- Image.__init__(self)
- self.FreeSpace = 0
-
- self.Sections = sdict()
- self.Depex = ''
-
- self.__ID__ = None
-
- def __str__(self):
- global gIndention
- gIndention += 4
- Indention = ' ' * gIndention
- FfsInfo = Indention
- FfsInfo += "[FFS:%s] offset=%x size=%x guid=%s free_space=%x alignment=%s\n" % \
- (Ffs._TypeName[self.Type], self._OFF_, self.Size, self.Guid, self.FreeSpace, self.Alignment)
- SectionInfo = '\n'.join([str(self.Sections[Offset]) for Offset in self.Sections])
- gIndention -= 4
- return FfsInfo + SectionInfo + "\n"
-
- def __len__(self):
- return self.Size
-
- def __repr__(self):
- return self.__ID__
-
- def _Unpack(self):
- Size1, Size2, Size3 = self._SIZE_.unpack_from(self._BUF_, self._OFF_)
- Size = Size1 + (Size2 << 8) + (Size3 << 16)
- self.empty()
- self.extend(self._BUF_[self._OFF_ : self._OFF_ + Size])
-
- # Pad FFS may use the same GUID. We need to avoid it.
- if self.Type == 0xf0:
- self.__ID__ = str(uuid.uuid1()).upper()
- else:
- self.__ID__ = self.Guid
-
- # Traverse the SECTION. RAW and PAD do not have sections
- if self.Type not in [0xf0, 0x01] and Size > 0 and Size < 0xFFFFFF:
- EndOfFfs = Size
- SectionStartAddress = self._HEADER_SIZE_
- while SectionStartAddress < EndOfFfs:
- SectionObj = Section()
- SectionObj.frombuffer(self, SectionStartAddress)
- #f = open(repr(SectionObj), 'wb')
- #SectionObj.Size = 0
- #SectionObj.tofile(f)
- #f.close()
- self.Sections[SectionStartAddress] = SectionObj
- SectionStartAddress += len(SectionObj)
- SectionStartAddress = (SectionStartAddress + 3) & (~3)
-
- def Pack(self):
- pass
-
- def SetFreeSpace(self, Size):
- self.FreeSpace = Size
-
- def _GetGuid(self):
- return gGuidStringFormat % self.Name
-
- def _SetName(self, Value):
- # Guid1, Guid2, Guid3, Guid4, Guid5, Guid6, Guid7, Guid8, Guid9, Guid10, Guid11
- self.SetField(self._NAME_, 0, Value)
-
- def _GetName(self):
- # Guid1, Guid2, Guid3, Guid4, Guid5, Guid6, Guid7, Guid8, Guid9, Guid10, Guid11
- return self.GetField(self._NAME_)
-
- def _SetSize(m, Size):
- Size1 = Size & 0xFF
- Size2 = (Size & 0xFF00) >> 8
- Size3 = (Size & 0xFF0000) >> 16
- m.SetField(m._SIZE_, 0, Size1, Size2, Size3)
-
- def _GetSize(m):
- Size1, Size2, Size3 = m.GetField(m._SIZE_)
- return Size1 + (Size2 << 8) + (Size3 << 16)
-
- def _SetType(m, Type):
- m.SetField(m._TYPE_, 0, Type)
-
- def _GetType(m):
- return m.GetField(m._TYPE_)[0]
-
- def _SetAttributes(self, Value):
- self.SetField(m._ATTR_, 0, Value)
-
- def _GetAttributes(self):
- return self.GetField(self._ATTR_)[0]
-
- def _GetFixed(self):
- if (self.Attributes & self.FFS_ATTRIB_FIXED) != 0:
- return True
- return False
-
- def _GetCheckSum(self):
- if (self.Attributes & self.FFS_ATTRIB_CHECKSUM) != 0:
- return True
- return False
-
- def _GetAlignment(self):
- return (self.Attributes & self.FFS_ATTRIB_DATA_ALIGNMENT) >> 3
-
- def _SetState(self, Value):
- self.SetField(m._STATE_, 0, Value)
-
- def _GetState(self):
- return self.GetField(m._STATE_)[0]
-
- Name = property(_GetName, _SetName)
- Guid = property(_GetGuid)
- Type = property(_GetType, _SetType)
- Size = property(_GetSize, _SetSize)
- Attributes = property(_GetAttributes, _SetAttributes)
- Fixed = property(_GetFixed)
- Checksum = property(_GetCheckSum)
- Alignment = property(_GetAlignment)
- State = property(_GetState, _SetState)
-
-## PeImage() class
-#
-# A class for PE Image
-#
-class PeImage:
- #
- # just extract e_lfanew
- #
- _DosHeaderFormat = "60x 1I"
- #
- # Machine
- # NumberOfSections
- # SizeOfOptionalHeader
- #
- _FileHeaderFormat = "4x 1H 1H 4x 4x 4x 1H 2x"
- #
- # Magic
- # SizeOfImage
- # SizeOfHeaders
- # CheckSum
- # NumberOfRvaAndSizes
- #
- _OptionalHeader32Format = "1H 54x 1I 1I 1I 24x 1I"
- _OptionalHeader64Format = ""
- def __init__(self, Buf, Offset, Size):
- self.Offset = Offset
- self.Size = Size
- self.Machine = 0x014c # IA32
- self.NumberOfSections = 0
- self.SizeOfImage = 0
- self.SizeOfOptionalHeader = 0
- self.Checksum = 0
- self._PeImageBuf = Buf
- self._SectionList = []
-
- self._DosHeader = struct.Struct(PeImage._DosHeaderFormat)
- self._FileHeader = struct.Struct(PeImage._FileHeaderFormat)
- self._OptionalHeader32 = struct.Struct(PeImage._OptionalHeader32Format)
-
- self.Buffer = None
-
- self._Unpack()
-
- def __str__(self):
- pass
-
- def __len__(self):
- return self.Size
-
- def _Unpack(self):
- # from DOS header, get the offset of PE header
- FileHeaderOffset, = self._DosHeader.unpack_from(self._PeImageBuf, self.Offset)
- if FileHeaderOffset < struct.calcsize(self._DosHeaderFormat):
- EdkLogger.error("PE+", 0, "Invalid offset of IMAGE_FILE_HEADER: %s" % FileHeaderOffset)
-
- # from FILE header, get the optional header size
- self.Machine, self.NumberOfSections, self.SizeOfOptionalHeader = \
- self._FileHeader.unpack_from(self._PeImageBuf, self.Offset + FileHeaderOffset)
-
- print "Machine=%x NumberOfSections=%x SizeOfOptionalHeader=%x" % (self.Machine, self.NumberOfSections, self.SizeOfOptionalHeader)
- # optional header follows the FILE header
- OptionalHeaderOffset = FileHeaderOffset + struct.calcsize(self._FileHeaderFormat)
- Magic, self.SizeOfImage, SizeOfHeaders, self.Checksum, NumberOfRvaAndSizes = \
- self._OptionalHeader32.unpack_from(self._PeImageBuf, self.Offset + OptionalHeaderOffset)
- print "Magic=%x SizeOfImage=%x SizeOfHeaders=%x, Checksum=%x, NumberOfRvaAndSizes=%x" % (Magic, self.SizeOfImage, SizeOfHeaders, self.Checksum, NumberOfRvaAndSizes)
-
- PeImageSectionTableOffset = OptionalHeaderOffset + self.SizeOfOptionalHeader
- PeSections = PeSectionTable(self._PeImageBuf, self.Offset + PeImageSectionTableOffset, self.NumberOfSections)
-
- print "%x" % PeSections.GetFileAddress(0x3920)
-
-## PeSectionTable() class
-#
-# A class for PE Section Table
-#
-class PeSectionTable:
- def __init__(self, Buf, Offset, NumberOfSections):
- self._SectionList = []
-
- SectionHeaderOffset = Offset
- for TableIndex in range(0, NumberOfSections):
- SectionHeader = PeSectionHeader(Buf, SectionHeaderOffset)
- self._SectionList.append(SectionHeader)
- SectionHeaderOffset += len(SectionHeader)
- print SectionHeader
-
- def GetFileAddress(self, Rva):
- for PeSection in self._SectionList:
- if Rva in PeSection:
- return PeSection[Rva]
-
-## PeSectionHeader() class
-#
-# A class for PE Section Header
-#
-class PeSectionHeader:
- #
- # VirtualAddress
- # SizeOfRawData
- # PointerToRawData
- #
- _HeaderFormat = "12x 1I 1I 1I 16x"
- _HeaderLength = struct.calcsize(_HeaderFormat)
-
- def __init__(self, Buf, Offset):
- self.VirtualAddressStart, self.SizeOfRawData, self.PointerToRawData = \
- struct.unpack_from(self._HeaderFormat, Buf, Offset)
- self.VirtualAddressEnd = self.VirtualAddressStart + self.SizeOfRawData - 1
-
- def __str__(self):
- return "VirtualAddress=%x, SizeOfRawData=%x, PointerToRawData=%x" % (self.VirtualAddressStart, self.SizeOfRawData, self.PointerToRawData)
-
- def __len__(self):
- return self._HeaderLength
-
- def __contains__(self, Rva):
- return Rva >= self.VirtualAddressStart and Rva <= self.VirtualAddressEnd
-
- def __getitem__(self, Rva):
- return Rva - self.VirtualAddressStart + self.PointerToRawData
-
-## LinkMap() class
-#
-# A class for Link Map
-#
-class LinkMap:
- _StartFlag = {
- "MSFT" : re.compile("Address +Publics by Value +Rva\+Base +Lib:Object"),
- "GCC" : re.compile("^\.(text|bss|data|edata)"),
- }
-
- _MappingFormat = {
- "MSFT" : re.compile("([0-9a-f]+):([0-9a-f]+)\s+_+([0-9A-Za-z]+)\s+([0-9a-f]+)\s+"),
- "GCC" : re.compile("^(\.\w)?\s+(0x[0-9a-f]+)\s+_+([0-9A-Za-z]+)"),
- }
-
- def __init__(self, MapFile, MapType="MSFT"):
- self.File = MapFile
- self.MapType = MapType
- self._Globals = {} # global:RVA
-
- self._Parse()
-
- def _Parse(self):
- MapFile = open(self.File, 'r')
- MappingTitle = self._StartFlag[self.MapType]
- MappingFormat = self._MappingFormat[self.MapType]
- MappingStart = False
- try:
- for Line in MapFile:
- Line = Line.strip()
- if not MappingStart:
- if MappingTitle.match(Line) != None:
- MappingStart = True
- continue
- ResultList = MappingFormat.findall(Line)
- if len(ResultList) == 0 or len(ResultList[0]) != 4:
- continue
- self._Globals[ResultList[2]] = int(ResultList[3], 16)
- EdkLogger.verbose(ResultList[0])
- finally:
- MapFile.close()
-
- def __contains__(self, Var):
- return Var in self._Globals
-
- def __getitem__(self, Var):
- if Var not in self._Globals:
- return None
- return self._Globals[Var]
-
-## MultipleFv() class
-#
-# A class for Multiple FV
-#
-class MultipleFv(FirmwareVolume):
- def __init__(self, FvList):
- FirmwareVolume.__init__(self)
- self.BasicInfo = []
- for FvPath in FvList:
- FvName = os.path.splitext(os.path.split(FvPath)[1])[0]
- Fd = open(FvPath, 'rb')
- Buf = array('B')
- try:
- Buf.fromfile(Fd, os.path.getsize(FvPath))
- except EOFError:
- pass
-
- Fv = FirmwareVolume(FvName)
- Fv.frombuffer(Buf, 0, len(Buf))
-
- self.BasicInfo.append([Fv.Name, Fv.FileSystemGuid, Fv.Size])
- self.FfsDict.append(Fv.FfsDict)
-
-# Version and Copyright
-__version_number__ = "0.01"
-__version__ = "%prog Version " + __version_number__
-__copyright__ = "Copyright (c) 2008, Intel Corporation. All rights reserved."
-
-## Parse command line options
-#
-# Using standard Python module optparse to parse command line option of this tool.
-#
-# @retval Options A optparse.Values object containing the parsed options
-# @retval InputFile Path of file to be trimmed
-#
-def GetOptions():
- OptionList = [
- make_option("-a", "--arch", dest="Arch",
- help="The input file is preprocessed source code, including C or assembly code"),
- make_option("-p", "--platform", dest="ActivePlatform",
- help="The input file is preprocessed VFR file"),
- make_option("-m", "--module", dest="ActiveModule",
- help="Convert standard hex format (0xabcd) to MASM format (abcdh)"),
- make_option("-f", "--FDF-file", dest="FdfFile",
- help="Convert standard hex format (0xabcd) to MASM format (abcdh)"),
- make_option("-o", "--output", dest="OutputDirectory",
- help="File to store the trimmed content"),
- make_option("-t", "--toolchain-tag", dest="ToolChain",
- help=""),
- make_option("-k", "--msft", dest="MakefileType", action="store_const", const="nmake",
- help=""),
- make_option("-g", "--gcc", dest="MakefileType", action="store_const", const="gmake",
- help=""),
- make_option("-v", "--verbose", dest="LogLevel", action="store_const", const=EdkLogger.VERBOSE,
- help="Run verbosely"),
- make_option("-d", "--debug", dest="LogLevel", type="int",
- help="Run with debug information"),
- make_option("-q", "--quiet", dest="LogLevel", action="store_const", const=EdkLogger.QUIET,
- help="Run quietly"),
- make_option("-?", action="help", help="show this help message and exit"),
- ]
-
- # use clearer usage to override default usage message
- UsageString = "%prog [-a ARCH] [-p PLATFORM] [-m MODULE] [-t TOOLCHAIN_TAG] [-k] [-g] [-v|-d <debug_level>|-q] [-o <output_directory>] [GenC|GenMake]"
-
- Parser = OptionParser(description=__copyright__, version=__version__, option_list=OptionList, usage=UsageString)
- Parser.set_defaults(Arch=[])
- Parser.set_defaults(ActivePlatform=None)
- Parser.set_defaults(ActiveModule=None)
- Parser.set_defaults(OutputDirectory="build")
- Parser.set_defaults(FdfFile=None)
- Parser.set_defaults(ToolChain="MYTOOLS")
- if sys.platform == "win32":
- Parser.set_defaults(MakefileType="nmake")
- else:
- Parser.set_defaults(MakefileType="gmake")
- Parser.set_defaults(LogLevel=EdkLogger.INFO)
-
- Options, Args = Parser.parse_args()
-
- # error check
- if len(Args) == 0:
- Options.Target = "genmake"
- sys.argv.append("genmake")
- elif len(Args) == 1:
- Options.Target = Args[0].lower()
- if Options.Target not in ["genc", "genmake"]:
- EdkLogger.error("AutoGen", OPTION_NOT_SUPPORTED, "Not supported target",
- ExtraData="%s\n\n%s" % (Options.Target, Parser.get_usage()))
- else:
- EdkLogger.error("AutoGen", OPTION_NOT_SUPPORTED, "Too many targets",
- ExtraData=Parser.get_usage())
-
- return Options
-
-## Entrance method
-#
-# This method mainly dispatch specific methods per the command line options.
-# If no error found, return zero value so the caller of this tool can know
-# if it's executed successfully or not.
-#
-# @retval 0 Tool was successful
-# @retval 1 Tool failed
-#
-def Main():
- from build import build
- try:
- Option = GetOptions()
- build.main()
- except Exception, e:
- print e
- return 1
-
- return 0
-
-# This acts like the main() function for the script, unless it is 'import'ed into another script.
-if __name__ == '__main__':
- EdkLogger.Initialize()
- # sys.exit(Main())
-
- if len(sys.argv) > 1:
- FilePath = sys.argv[1]
- if FilePath.lower().endswith(".fv"):
- fd = open(FilePath, 'rb')
- buf = array('B')
- try:
- buf.fromfile(fd, os.path.getsize(FilePath))
- except EOFError:
- pass
-
- fv = FirmwareVolume("FVRECOVERY")
- fv.frombuffer(buf, 0, len(buf))
- #fv.Dispatch(None)
- print fv
- elif FilePath.endswith(".efi"):
- fd = open(FilePath, 'rb')
- buf = array('B')
- Size = os.path.getsize(FilePath)
-
- try:
- buf.fromfile(fd, Size)
- except EOFError:
- pass
-
- PeSection = Section(Type=0x10)
- PeSection.Data = buf
- sf, ext = os.path.splitext(os.path.basename(FilePath))
- sf += ".sec"
- PeSection.tofile(open(sf, 'wb'))
- elif FilePath.endswith(".map"):
- mf = LinkMap(FilePath)
diff --git a/BaseTools/Source/Python/Eot/InfParserLite.py b/BaseTools/Source/Python/Eot/InfParserLite.py
deleted file mode 100644
index 6750f5a0c9..0000000000
--- a/BaseTools/Source/Python/Eot/InfParserLite.py
+++ /dev/null
@@ -1,171 +0,0 @@
-## @file
-# This file is used to parse INF file of EDK project
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import Common.EdkLogger as EdkLogger
-from Common.DataType import *
-from CommonDataClass.DataClass import *
-from Common.Identification import *
-from Common.String import *
-from Parser import *
-import Database
-
-## EdkInfParser() class
-#
-# This class defined basic INF object which is used by inheriting
-#
-# @param object: Inherited from object class
-#
-class EdkInfParser(object):
- ## The constructor
- #
- # @param self: The object pointer
- # @param Filename: INF file name
- # @param Database: Eot database
- # @param SourceFileList: A list for all source file belonging this INF file
- # @param SourceOverridePath: Override path for source file
- # @param Edk_Source: Envirnoment variable EDK_SOURCE
- # @param Efi_Source: Envirnoment variable EFI_SOURCE
- #
- def __init__(self, Filename = None, Database = None, SourceFileList = None, SourceOverridePath = None, Edk_Source = None, Efi_Source = None):
- self.Identification = Identification()
- self.Sources = []
- self.Macros = {}
-
- self.Cur = Database.Cur
- self.TblFile = Database.TblFile
- self.TblInf = Database.TblInf
- self.FileID = -1
- self.SourceOverridePath = SourceOverridePath
-
- # Load Inf file if filename is not None
- if Filename != None:
- self.LoadInfFile(Filename)
-
- if SourceFileList:
- for Item in SourceFileList:
- self.TblInf.Insert(MODEL_EFI_SOURCE_FILE, Item, '', '', '', '', 'COMMON', -1, self.FileID, -1, -1, -1, -1, 0)
-
-
- ## LoadInffile() method
- #
- # Load INF file and insert a record in database
- #
- # @param self: The object pointer
- # @param Filename: Input value for filename of Inf file
- #
- def LoadInfFile(self, Filename = None):
- # Insert a record for file
- Filename = NormPath(Filename)
- self.Identification.FileFullPath = Filename
- (self.Identification.FileRelativePath, self.Identification.FileName) = os.path.split(Filename)
-
- self.FileID = self.TblFile.InsertFile(Filename, MODEL_FILE_INF)
-
- self.ParseInf(PreProcess(Filename, False), self.Identification.FileRelativePath, Filename)
-
- ## ParserSource() method
- #
- # Parse Source section and insert records in database
- #
- # @param self: The object pointer
- # @param CurrentSection: current section name
- # @param SectionItemList: the item belonging current section
- # @param ArchList: A list for arch for this section
- # @param ThirdList: A list for third item for this section
- #
- def ParserSource(self, CurrentSection, SectionItemList, ArchList, ThirdList):
- for Index in range(0, len(ArchList)):
- Arch = ArchList[Index]
- Third = ThirdList[Index]
- if Arch == '':
- Arch = TAB_ARCH_COMMON
-
- for Item in SectionItemList:
- if CurrentSection.upper() == 'defines'.upper():
- (Name, Value) = AddToSelfMacro(self.Macros, Item[0])
- self.TblInf.Insert(MODEL_META_DATA_HEADER, Name, Value, Third, '', '', Arch, -1, self.FileID, Item[1], -1, Item[1], -1, 0)
-
- ## ParseInf() method
- #
- # Parse INF file and get sections information
- #
- # @param self: The object pointer
- # @param Lines: contents of INF file
- # @param FileRelativePath: relative path of the file
- # @param Filename: file name of INF file
- #
- def ParseInf(self, Lines = [], FileRelativePath = '', Filename = ''):
- IfDefList, SectionItemList, CurrentSection, ArchList, ThirdList, IncludeFiles = \
- [], [], TAB_UNKNOWN, [], [], []
- LineNo = 0
-
- for Line in Lines:
- LineNo = LineNo + 1
- if Line == '':
- continue
- if Line.startswith(TAB_SECTION_START) and Line.endswith(TAB_SECTION_END):
- self.ParserSource(CurrentSection, SectionItemList, ArchList, ThirdList)
-
- # Parse the new section
- SectionItemList = []
- ArchList = []
- ThirdList = []
- # Parse section name
- CurrentSection = ''
- LineList = GetSplitValueList(Line[len(TAB_SECTION_START):len(Line) - len(TAB_SECTION_END)], TAB_COMMA_SPLIT)
- for Item in LineList:
- ItemList = GetSplitValueList(Item, TAB_SPLIT)
- if CurrentSection == '':
- CurrentSection = ItemList[0]
- else:
- if CurrentSection != ItemList[0]:
- EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo)
- ItemList.append('')
- ItemList.append('')
- if len(ItemList) > 5:
- RaiseParserError(Line, CurrentSection, Filename, '', LineNo)
- else:
- ArchList.append(ItemList[1].upper())
- ThirdList.append(ItemList[2])
-
- continue
-
- # Add a section item
- SectionItemList.append([Line, LineNo])
- # End of parse
-
- self.ParserSource(CurrentSection, SectionItemList, ArchList, ThirdList)
- #End of For
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- EdkLogger.Initialize()
- EdkLogger.SetLevel(EdkLogger.QUIET)
-
- Db = Database.Database('Inf.db')
- Db.InitDatabase()
- P = EdkInfParser(os.path.normpath("C:\Framework\Edk\Sample\Platform\Nt32\Dxe\PlatformBds\PlatformBds.inf"), Db, '', '')
- for Inf in P.Sources:
- print Inf
- for Item in P.Macros:
- print Item, P.Macros[Item]
-
- Db.Close() \ No newline at end of file
diff --git a/BaseTools/Source/Python/Eot/LzmaCompressor.pyd b/BaseTools/Source/Python/Eot/LzmaCompressor.pyd
deleted file mode 100644
index 337c055e20..0000000000
--- a/BaseTools/Source/Python/Eot/LzmaCompressor.pyd
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Source/Python/Eot/Parser.py b/BaseTools/Source/Python/Eot/Parser.py
deleted file mode 100644
index d5419d0e06..0000000000
--- a/BaseTools/Source/Python/Eot/Parser.py
+++ /dev/null
@@ -1,848 +0,0 @@
-## @file
-# This file is used to define common parsing related functions used in parsing
-# Inf/Dsc/Makefile process
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os, re
-import Common.EdkLogger as EdkLogger
-from Common.DataType import *
-from CommonDataClass.DataClass import *
-from Common.String import CleanString, GetSplitValueList, ReplaceMacro
-import EotGlobalData
-from Common.Misc import sdict
-from Common.String import GetSplitList
-
-## PreProcess() method
-#
-# Pre process a file
-#
-# 1. Remove all comments
-# 2. Merge multiple lines code to one line
-#
-# @param Filename: Name of the file to be parsed
-# @param MergeMultipleLines: Switch for if merge multiple lines
-# @param LineNo: Default line no
-#
-# @return Lines: The file contents after remvoing comments
-#
-def PreProcess(Filename, MergeMultipleLines = True, LineNo = -1):
- Lines = []
- Filename = os.path.normpath(Filename)
- if not os.path.isfile(Filename):
- EdkLogger.error("Eot", EdkLogger.FILE_NOT_FOUND, ExtraData=Filename)
-
- IsFindBlockComment = False
- IsFindBlockCode = False
- ReservedLine = ''
- ReservedLineLength = 0
- for Line in open(Filename, 'r'):
- Line = Line.strip()
- # Remove comment block
- if Line.find(TAB_COMMENT_EDK_START) > -1:
- ReservedLine = GetSplitList(Line, TAB_COMMENT_EDK_START, 1)[0]
- IsFindBlockComment = True
- if Line.find(TAB_COMMENT_EDK_END) > -1:
- Line = ReservedLine + GetSplitList(Line, TAB_COMMENT_EDK_END, 1)[1]
- ReservedLine = ''
- IsFindBlockComment = False
- if IsFindBlockComment:
- Lines.append('')
- continue
-
- # Remove comments at tail and remove spaces again
- Line = CleanString(Line)
- if Line == '':
- Lines.append('')
- continue
-
- if MergeMultipleLines:
- # Add multiple lines to one line
- if IsFindBlockCode and Line[-1] != TAB_SLASH:
- ReservedLine = (ReservedLine + TAB_SPACE_SPLIT + Line).strip()
- Lines.append(ReservedLine)
- for Index in (0, ReservedLineLength):
- Lines.append('')
- ReservedLine = ''
- ReservedLineLength = 0
- IsFindBlockCode = False
- continue
- if Line[-1] == TAB_SLASH:
- ReservedLine = ReservedLine + TAB_SPACE_SPLIT + Line[0:-1].strip()
- ReservedLineLength = ReservedLineLength + 1
- IsFindBlockCode = True
- continue
-
- Lines.append(Line)
-
- return Lines
-
-## AddToGlobalMacro() method
-#
-# Add a macro to EotGlobalData.gMACRO
-#
-# @param Name: Name of the macro
-# @param Value: Value of the macro
-#
-def AddToGlobalMacro(Name, Value):
- Value = ReplaceMacro(Value, EotGlobalData.gMACRO, True)
- EotGlobalData.gMACRO[Name] = Value
-
-## AddToSelfMacro() method
-#
-# Parse a line of macro definition and add it to a macro set
-#
-# @param SelfMacro: The self macro set
-# @param Line: The line of a macro definition
-#
-# @return Name: Name of macro
-# @return Value: Value of macro
-#
-def AddToSelfMacro(SelfMacro, Line):
- Name, Value = '', ''
- List = GetSplitValueList(Line, TAB_EQUAL_SPLIT, 1)
- if len(List) == 2:
- Name = List[0]
- Value = List[1]
- Value = ReplaceMacro(Value, EotGlobalData.gMACRO, True)
- Value = ReplaceMacro(Value, SelfMacro, True)
- SelfMacro[Name] = Value
-
- return (Name, Value)
-
-## GetIncludeListOfFile() method
-#
-# Get the include path list for a source file
-#
-# 1. Find the source file belongs to which INF file
-# 2. Find the inf's package
-# 3. Return the include path list of the package
-#
-# @param WorkSpace: WORKSPACE path
-# @param Filepath: File path
-# @param Db: Eot database
-#
-# @return IncludeList: A list of include directories
-#
-def GetIncludeListOfFile(WorkSpace, Filepath, Db):
- IncludeList = []
- Filepath = os.path.normpath(Filepath)
- SqlCommand = """
- select Value1 from Inf where Model = %s and BelongsToFile in(
- select distinct B.BelongsToFile from File as A left join Inf as B
- where A.ID = B.BelongsToFile and B.Model = %s and (A.Path || '%s' || B.Value1) = '%s')""" \
- % (MODEL_META_DATA_PACKAGE, MODEL_EFI_SOURCE_FILE, '\\', Filepath)
- RecordSet = Db.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- DecFullPath = os.path.normpath(os.path.join(WorkSpace, Record[0]))
- (DecPath, DecName) = os.path.split(DecFullPath)
- SqlCommand = """select Value1 from Dec where BelongsToFile =
- (select ID from File where FullPath = '%s') and Model = %s""" \
- % (DecFullPath, MODEL_EFI_INCLUDE)
- NewRecordSet = Db.TblDec.Exec(SqlCommand)
- for NewRecord in NewRecordSet:
- IncludePath = os.path.normpath(os.path.join(DecPath, NewRecord[0]))
- if IncludePath not in IncludeList:
- IncludeList.append(IncludePath)
-
- return IncludeList
-
-## GetTableList() method
-#
-# Search table file and find all small tables
-#
-# @param FileModelList: Model code for the file list
-# @param Table: Table to insert records
-# @param Db: Eot database
-#
-# @return TableList: A list of tables
-#
-def GetTableList(FileModelList, Table, Db):
- TableList = []
- SqlCommand = """select ID, FullPath from File where Model in %s""" % str(FileModelList)
- RecordSet = Db.TblFile.Exec(SqlCommand)
- for Record in RecordSet:
- TableName = Table + str(Record[0])
- TableList.append([TableName, Record[1]])
-
- return TableList
-
-## GetAllIncludeDir() method
-#
-# Find all Include directories
-#
-# @param Db: Eot database
-#
-# @return IncludeList: A list of include directories
-#
-def GetAllIncludeDirs(Db):
- IncludeList = []
- SqlCommand = """select distinct Value1 from Inf where Model = %s order by Value1""" % MODEL_EFI_INCLUDE
- RecordSet = Db.TblInf.Exec(SqlCommand)
-
- for Record in RecordSet:
- IncludeList.append(Record[0])
-
- return IncludeList
-
-## GetAllIncludeFiles() method
-#
-# Find all Include files
-#
-# @param Db: Eot database
-#
-# @return IncludeFileList: A list of include files
-#
-def GetAllIncludeFiles(Db):
- IncludeList = GetAllIncludeDirs(Db)
- IncludeFileList = []
-
- for Dir in IncludeList:
- if os.path.isdir(Dir):
- SubDir = os.listdir(Dir)
- for Item in SubDir:
- if os.path.isfile(Item):
- IncludeFileList.append(Item)
-
- return IncludeFileList
-
-## GetAllSourceFiles() method
-#
-# Find all source files
-#
-# @param Db: Eot database
-#
-# @return SourceFileList: A list of source files
-#
-def GetAllSourceFiles(Db):
- SourceFileList = []
- SqlCommand = """select distinct Value1 from Inf where Model = %s order by Value1""" % MODEL_EFI_SOURCE_FILE
- RecordSet = Db.TblInf.Exec(SqlCommand)
-
- for Record in RecordSet:
- SourceFileList.append(Record[0])
-
- return SourceFileList
-
-## GetAllFiles() method
-#
-# Find all files, both source files and include files
-#
-# @param Db: Eot database
-#
-# @return FileList: A list of files
-#
-def GetAllFiles(Db):
- FileList = []
- IncludeFileList = GetAllIncludeFiles(Db)
- SourceFileList = GetAllSourceFiles(Db)
- for Item in IncludeFileList:
- if os.path.isfile(Item) and Item not in FileList:
- FileList.append(Item)
- for Item in SourceFileList:
- if os.path.isfile(Item) and Item not in FileList:
- FileList.append(Item)
-
- return FileList
-
-## ParseConditionalStatement() method
-#
-# Parse conditional statement
-#
-# @param Line: One line to be parsed
-# @param Macros: A set of all macro
-# @param StatusSet: A set of all status
-#
-# @retval True: Find keyword of conditional statement
-# @retval False: Not find keyword of conditional statement
-#
-def ParseConditionalStatement(Line, Macros, StatusSet):
- NewLine = Line.upper()
- if NewLine.find(TAB_IF_EXIST.upper()) > -1:
- IfLine = Line[NewLine.find(TAB_IF_EXIST) + len(TAB_IF_EXIST) + 1:].strip()
- IfLine = ReplaceMacro(IfLine, EotGlobalData.gMACRO, True)
- IfLine = ReplaceMacro(IfLine, Macros, True)
- IfLine = IfLine.replace("\"", '')
- IfLine = IfLine.replace("(", '')
- IfLine = IfLine.replace(")", '')
- Status = os.path.exists(os.path.normpath(IfLine))
- StatusSet.append([Status])
- return True
- if NewLine.find(TAB_IF_DEF.upper()) > -1:
- IfLine = Line[NewLine.find(TAB_IF_DEF) + len(TAB_IF_DEF) + 1:].strip()
- Status = False
- if IfLine in Macros or IfLine in EotGlobalData.gMACRO:
- Status = True
- StatusSet.append([Status])
- return True
- if NewLine.find(TAB_IF_N_DEF.upper()) > -1:
- IfLine = Line[NewLine.find(TAB_IF_N_DEF) + len(TAB_IF_N_DEF) + 1:].strip()
- Status = False
- if IfLine not in Macros and IfLine not in EotGlobalData.gMACRO:
- Status = True
- StatusSet.append([Status])
- return True
- if NewLine.find(TAB_IF.upper()) > -1:
- IfLine = Line[NewLine.find(TAB_IF) + len(TAB_IF) + 1:].strip()
- Status = ParseConditionalStatementMacros(IfLine, Macros)
- StatusSet.append([Status])
- return True
- if NewLine.find(TAB_ELSE_IF.upper()) > -1:
- IfLine = Line[NewLine.find(TAB_ELSE_IF) + len(TAB_ELSE_IF) + 1:].strip()
- Status = ParseConditionalStatementMacros(IfLine, Macros)
- StatusSet[-1].append(Status)
- return True
- if NewLine.find(TAB_ELSE.upper()) > -1:
- Status = False
- for Item in StatusSet[-1]:
- Status = Status or Item
- StatusSet[-1].append(not Status)
- return True
- if NewLine.find(TAB_END_IF.upper()) > -1:
- StatusSet.pop()
- return True
-
- return False
-
-## ParseConditionalStatement() method
-#
-# Parse conditional statement with Macros
-#
-# @param Line: One line to be parsed
-# @param Macros: A set of macros
-#
-# @return Line: New line after replacing macros
-#
-def ParseConditionalStatementMacros(Line, Macros):
- if Line.upper().find('DEFINED(') > -1 or Line.upper().find('EXIST') > -1:
- return False
- Line = ReplaceMacro(Line, EotGlobalData.gMACRO, True)
- Line = ReplaceMacro(Line, Macros, True)
- Line = Line.replace("&&", "and")
- Line = Line.replace("||", "or")
- return eval(Line)
-
-## GetConditionalStatementStatus() method
-#
-# 1. Assume the latest status as True
-# 2. Pop the top status of status set, previous status
-# 3. Compare the latest one and the previous one and get new status
-#
-# @param StatusSet: A set of all status
-#
-# @return Status: The final status
-#
-def GetConditionalStatementStatus(StatusSet):
- Status = True
- for Item in StatusSet:
- Status = Status and Item[-1]
-
- return Status
-
-## SearchBelongsToFunction() method
-#
-# Search all functions belong to the file
-#
-# @param BelongsToFile: File id
-# @param StartLine: Start line of search scope
-# @param EndLine: End line of search scope
-#
-# @return: The found function
-#
-def SearchBelongsToFunction(BelongsToFile, StartLine, EndLine):
- SqlCommand = """select ID, Name from Function where BelongsToFile = %s and StartLine <= %s and EndLine >= %s""" %(BelongsToFile, StartLine, EndLine)
- RecordSet = EotGlobalData.gDb.TblFunction.Exec(SqlCommand)
- if RecordSet != []:
- return RecordSet[0][0], RecordSet[0][1]
- else:
- return -1, ''
-
-## SearchPpiCallFunction() method
-#
-# Search all used PPI calling function 'PeiServicesReInstallPpi' and 'PeiServicesInstallPpi'
-# Store the result to database
-#
-# @param Identifier: Table id
-# @param SourceFileID: Source file id
-# @param SourceFileFullPath: Source file full path
-# @param ItemMode: Mode of the item
-#
-def SearchPpiCallFunction(Identifier, SourceFileID, SourceFileFullPath, ItemMode):
- ItemName, ItemType, GuidName, GuidMacro, GuidValue = '', 'Ppi', '', '', ''
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' and Model = %s)""" \
- % (Identifier, 'PeiServicesReInstallPpi', MODEL_IDENTIFIER_FUNCTION_CALLING)
- BelongsToFunctionID, BelongsToFunction = -1, ''
- Db = EotGlobalData.gDb.TblReport
- RecordSet = Db.Exec(SqlCommand)
- for Record in RecordSet:
- Index = 0
- BelongsToFile, StartLine, EndLine = Record[2], Record[3], Record[4]
- BelongsToFunctionID, BelongsToFunction = SearchBelongsToFunction(BelongsToFile, StartLine, EndLine)
- VariableList = Record[0].split(',')
- for Variable in VariableList:
- Variable = Variable.strip()
- # Get index of the variable
- if Variable.find('[') > -1:
- Index = int(Variable[Variable.find('[') + 1 : Variable.find(']')])
- Variable = Variable[:Variable.find('[')]
- # Get variable name
- if Variable.startswith('&'):
- Variable = Variable[1:]
- # Get variable value
- SqlCommand = """select Value from %s where (Name like '%%%s%%') and Model = %s""" \
- % (Identifier, Variable, MODEL_IDENTIFIER_VARIABLE)
- NewRecordSet = Db.Exec(SqlCommand)
- if NewRecordSet:
- NewRecord = NewRecordSet[0][0]
- VariableValueList = NewRecord.split('},')
- if len(VariableValueList) > Index:
- VariableValue = VariableValueList[Index]
- NewVariableValueList = VariableValue.split(',')
- if len(NewVariableValueList) > 1:
- NewVariableValue = NewVariableValueList[1].strip()
- if NewVariableValue.startswith('&'):
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, NewVariableValue[1:], GuidMacro, GuidValue, BelongsToFunction, 0)
- continue
- else:
- EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, NewParameter))
-
- ItemName, ItemType, GuidName, GuidMacro, GuidValue = '', 'Ppi', '', '', ''
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Value like '%%%s%%' and Model = %s)""" \
- % (Identifier, 'PeiServicesInstallPpi', MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION)
- BelongsToFunctionID, BelongsToFunction = -1, ''
- Db = EotGlobalData.gDb.TblReport
- RecordSet = Db.Exec(SqlCommand)
-
- SqlCommand = """select Value, Name, BelongsToFile, StartLine, EndLine from %s
- where (Name like '%%%s%%' and Model = %s)""" \
- % (Identifier, 'PeiServicesInstallPpi', MODEL_IDENTIFIER_FUNCTION_CALLING)
- Db = EotGlobalData.gDb.TblReport
- RecordSet2 = Db.Exec(SqlCommand)
-
- for Record in RecordSet + RecordSet2:
- if Record == []:
- continue
- Index = 0
- BelongsToFile, StartLine, EndLine = Record[2], Record[3], Record[4]
- BelongsToFunctionID, BelongsToFunction = SearchBelongsToFunction(BelongsToFile, StartLine, EndLine)
- Variable = Record[0].replace('PeiServicesInstallPpi', '').replace('(', '').replace(')', '').replace('&', '').strip()
- Variable = Variable[Variable.find(',') + 1:].strip()
- # Get index of the variable
- if Variable.find('[') > -1:
- Index = int(Variable[Variable.find('[') + 1 : Variable.find(']')])
- Variable = Variable[:Variable.find('[')]
- # Get variable name
- if Variable.startswith('&'):
- Variable = Variable[1:]
- # Get variable value
- SqlCommand = """select Value from %s where (Name like '%%%s%%') and Model = %s""" \
- % (Identifier, Variable, MODEL_IDENTIFIER_VARIABLE)
- NewRecordSet = Db.Exec(SqlCommand)
- if NewRecordSet:
- NewRecord = NewRecordSet[0][0]
- VariableValueList = NewRecord.split('},')
- for VariableValue in VariableValueList[Index:]:
- NewVariableValueList = VariableValue.split(',')
- if len(NewVariableValueList) > 1:
- NewVariableValue = NewVariableValueList[1].strip()
- if NewVariableValue.startswith('&'):
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, NewVariableValue[1:], GuidMacro, GuidValue, BelongsToFunction, 0)
- continue
- else:
- EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, NewParameter))
-
-## SearchPpis() method
-#
-# Search all used PPI calling function
-# Store the result to database
-#
-# @param SqlCommand: SQL command statement
-# @param Table: Table id
-# @param SourceFileID: Source file id
-# @param SourceFileFullPath: Source file full path
-# @param ItemMode: Mode of the item
-# @param PpiMode: Mode of PPI
-#
-def SearchPpi(SqlCommand, Table, SourceFileID, SourceFileFullPath, ItemMode, PpiMode = 1):
- ItemName, ItemType, GuidName, GuidMacro, GuidValue = '', 'Ppi', '', '', ''
- BelongsToFunctionID, BelongsToFunction = -1, ''
- Db = EotGlobalData.gDb.TblReport
- RecordSet = Db.Exec(SqlCommand)
- for Record in RecordSet:
- Parameter = GetPpiParameter(Record[0], PpiMode)
- BelongsToFile, StartLine, EndLine = Record[2], Record[3], Record[4]
- # Get BelongsToFunction
- BelongsToFunctionID, BelongsToFunction = SearchBelongsToFunction(BelongsToFile, StartLine, EndLine)
-
- # Default is Not Found
- IsFound = False
-
- # For Consumed Ppi
- if ItemMode == 'Consumed':
- if Parameter.startswith('g'):
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, Parameter, GuidMacro, GuidValue, BelongsToFunction, 0)
- else:
- EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, Parameter))
- continue
-
- # Direct Parameter.Guid
- SqlCommand = """select Value from %s where (Name like '%%%s.Guid%%' or Name like '%%%s->Guid%%') and Model = %s""" % (Table, Parameter, Parameter, MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION)
- NewRecordSet = Db.Exec(SqlCommand)
- for NewRecord in NewRecordSet:
- GuidName = GetParameterName(NewRecord[0])
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, 0)
- IsFound = True
-
- # Defined Parameter
- if not IsFound:
- Key = Parameter
- if Key.rfind(' ') > -1:
- Key = Key[Key.rfind(' ') : ].strip().replace('&', '')
- Value = FindKeyValue(EotGlobalData.gDb.TblFile, Table, Key)
- List = GetSplitValueList(Value.replace('\n', ''), TAB_COMMA_SPLIT)
- if len(List) > 1:
- GuidName = GetParameterName(List[1])
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, 0)
- IsFound = True
-
- # A list Parameter
- if not IsFound:
- Start = Parameter.find('[')
- End = Parameter.find(']')
- if Start > -1 and End > -1 and Start < End:
- try:
- Index = int(Parameter[Start + 1 : End])
- Parameter = Parameter[0 : Start]
- SqlCommand = """select Value from %s where Name = '%s' and Model = %s""" % (Table, Parameter, MODEL_IDENTIFIER_VARIABLE)
- NewRecordSet = Db.Exec(SqlCommand)
- for NewRecord in NewRecordSet:
- NewParameter = GetSplitValueList(NewRecord[0], '}')[Index]
- GuidName = GetPpiParameter(NewParameter[NewParameter.find('{') : ])
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, 0)
- IsFound = True
- except Exception:
- pass
-
- # A External Parameter
- if not IsFound:
- SqlCommand = """select File.ID from Inf, File
- where BelongsToFile = (select BelongsToFile from Inf where Value1 = '%s')
- and Inf.Model = %s and Inf.Value1 = File.FullPath and File.Model = %s""" % (SourceFileFullPath, MODEL_EFI_SOURCE_FILE, MODEL_FILE_C)
- NewRecordSet = Db.Exec(SqlCommand)
- for NewRecord in NewRecordSet:
- Table = 'Identifier' + str(NewRecord[0])
- SqlCommand = """select Value from %s where Name = '%s' and Modifier = 'EFI_PEI_PPI_DESCRIPTOR' and Model = %s""" % (Table, Parameter, MODEL_IDENTIFIER_VARIABLE)
- PpiSet = Db.Exec(SqlCommand)
- if PpiSet != []:
- GuidName = GetPpiParameter(PpiSet[0][0])
- if GuidName != '':
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, 0)
- IsFound = True
- break
-
- if not IsFound:
- EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, Parameter))
-
-## SearchProtocols() method
-#
-# Search all used PROTOCOL calling function
-# Store the result to database
-#
-# @param SqlCommand: SQL command statement
-# @param Table: Table id
-# @param SourceFileID: Source file id
-# @param SourceFileFullPath: Source file full path
-# @param ItemMode: Mode of the item
-# @param ProtocolMode: Mode of PROTOCOL
-#
-def SearchProtocols(SqlCommand, Table, SourceFileID, SourceFileFullPath, ItemMode, ProtocolMode):
- ItemName, ItemType, GuidName, GuidMacro, GuidValue = '', 'Protocol', '', '', ''
- BelongsToFunctionID, BelongsToFunction = -1, ''
- Db = EotGlobalData.gDb.TblReport
- RecordSet = Db.Exec(SqlCommand)
- for Record in RecordSet:
- Parameter = ''
- BelongsToFile, StartLine, EndLine = Record[2], Record[3], Record[4]
- # Get BelongsToFunction
- BelongsToFunctionID, BelongsToFunction = SearchBelongsToFunction(BelongsToFile, StartLine, EndLine)
-
- # Default is Not Found
- IsFound = False
-
- if ProtocolMode == 0 or ProtocolMode == 1:
- Parameter = GetProtocolParameter(Record[0], ProtocolMode)
- if Parameter.startswith('g') or Parameter.endswith('Guid') or Parameter == 'ShellEnvProtocol' or Parameter == 'ShellInterfaceProtocol':
- GuidName = GetParameterName(Parameter)
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, 0)
- IsFound = True
-
- if ProtocolMode == 2:
- Protocols = GetSplitValueList(Record[0], TAB_COMMA_SPLIT)
- for Protocol in Protocols:
- if Protocol.startswith('&') and Protocol.endswith('Guid'):
- GuidName = GetParameterName(Protocol)
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, 0)
- IsFound = True
- else:
- NewValue = FindKeyValue(EotGlobalData.gDb.TblFile, Table, Protocol)
- if Protocol != NewValue and NewValue.endswith('Guid'):
- GuidName = GetParameterName(NewValue)
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, 0)
- IsFound = True
-
- if not IsFound:
- if BelongsToFunction in EotGlobalData.gProducedProtocolLibrary or BelongsToFunction in EotGlobalData.gConsumedProtocolLibrary:
- EotGlobalData.gOP_UN_MATCHED_IN_LIBRARY_CALLING.write('%s, %s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, Parameter, BelongsToFunction))
- else:
- EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, Parameter))
-
-## SearchFunctionCalling() method
-#
-# Search all used PPI/PROTOCOL calling function by library
-# Store the result to database
-#
-# @param SqlCommand: SQL command statement
-# @param Table: Table id
-# @param SourceFileID: Source file id
-# @param SourceFileFullPath: Source file full path
-# @param ItemType: Type of the item, PPI or PROTOCOL
-# @param ItemMode: Mode of item
-#
-def SearchFunctionCalling(Table, SourceFileID, SourceFileFullPath, ItemType, ItemMode):
- LibraryList = sdict()
- Db = EotGlobalData.gDb.TblReport
- Parameters, ItemName, GuidName, GuidMacro, GuidValue, BelongsToFunction = [], '', '', '', '', ''
- if ItemType == 'Protocol' and ItemMode == 'Produced':
- LibraryList = EotGlobalData.gProducedProtocolLibrary
- elif ItemType == 'Protocol' and ItemMode == 'Consumed':
- LibraryList = EotGlobalData.gConsumedProtocolLibrary
- elif ItemType == 'Protocol' and ItemMode == 'Callback':
- LibraryList = EotGlobalData.gCallbackProtocolLibrary
- elif ItemType == 'Ppi' and ItemMode == 'Produced':
- LibraryList = EotGlobalData.gProducedPpiLibrary
- elif ItemType == 'Ppi' and ItemMode == 'Consumed':
- LibraryList = EotGlobalData.gConsumedPpiLibrary
-
- for Library in LibraryList:
- Index = LibraryList[Library]
- SqlCommand = """select Value, StartLine from %s
- where Name like '%%%s%%' and Model = %s""" \
- % (Table, Library, MODEL_IDENTIFIER_FUNCTION_CALLING)
- RecordSet = Db.Exec(SqlCommand)
- for Record in RecordSet:
- IsFound = False
- if Index == -1:
- ParameterList = GetSplitValueList(Record[0], TAB_COMMA_SPLIT)
- for Parameter in ParameterList:
- Parameters.append(GetParameterName(Parameter))
- else:
- Parameters = [GetProtocolParameter(Record[0], Index)]
- StartLine = Record[1]
- for Parameter in Parameters:
- if Parameter.startswith('g') or Parameter.endswith('Guid') or Parameter == 'ShellEnvProtocol' or Parameter == 'ShellInterfaceProtocol':
- GuidName = GetParameterName(Parameter)
- Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, 0)
- IsFound = True
-
- if not IsFound:
- EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, Parameter))
-
-## FindProtocols() method
-#
-# Find defined protocols
-#
-# @param SqlCommand: SQL command statement
-# @param Table: Table id
-# @param SourceFileID: Source file id
-# @param SourceFileFullPath: Source file full path
-# @param ItemName: String of protocol definition
-# @param ItemType: Type of the item, PPI or PROTOCOL
-# @param ItemMode: Mode of item
-#
-#def FindProtocols(Db, SqlCommand, Table, SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue):
-# BelongsToFunction = ''
-# RecordSet = Db.Exec(SqlCommand)
-# for Record in RecordSet:
-# IsFound = True
-# Parameter = GetProtocolParameter(Record[0])
-
-## GetProtocolParameter() method
-#
-# Parse string of protocol and find parameters
-#
-# @param Parameter: Parameter to be parsed
-# @param Index: The index of the parameter
-#
-# @return: call common GetParameter
-#
-def GetProtocolParameter(Parameter, Index = 1):
- return GetParameter(Parameter, Index)
-
-## GetPpiParameter() method
-#
-# Parse string of ppi and find parameters
-#
-# @param Parameter: Parameter to be parsed
-# @param Index: The index of the parameter
-#
-# @return: call common GetParameter
-#
-def GetPpiParameter(Parameter, Index = 1):
- return GetParameter(Parameter, Index)
-
-## GetParameter() method
-#
-# Get a parameter by index
-#
-# @param Parameter: Parameter to be parsed
-# @param Index: The index of the parameter
-#
-# @return Parameter: The found parameter
-#
-def GetParameter(Parameter, Index = 1):
- ParameterList = GetSplitValueList(Parameter, TAB_COMMA_SPLIT)
- if len(ParameterList) > Index:
- Parameter = GetParameterName(ParameterList[Index])
-
- return Parameter
-
- return ''
-
-## GetParameterName() method
-#
-# Get a parameter name
-#
-# @param Parameter: Parameter to be parsed
-#
-# @return: The name of parameter
-#
-def GetParameterName(Parameter):
- if type(Parameter) == type('') and Parameter.startswith('&'):
- return Parameter[1:].replace('{', '').replace('}', '').replace('\r', '').replace('\n', '').strip()
- else:
- return Parameter.strip()
-
-## FindKeyValue() method
-#
-# Find key value of a variable
-#
-# @param Db: Database to be searched
-# @param Table: Table to be searched
-# @param Key: The keyword
-#
-# @return Value: The value of the the keyword
-#
-def FindKeyValue(Db, Table, Key):
- SqlCommand = """select Value from %s where Name = '%s' and (Model = %s or Model = %s)""" % (Table, Key, MODEL_IDENTIFIER_VARIABLE, MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION)
- RecordSet = Db.Exec(SqlCommand)
- Value = ''
- for Record in RecordSet:
- if Record[0] != 'NULL':
- Value = FindKeyValue(Db, Table, GetParameterName(Record[0]))
-
- if Value != '':
- return Value
- else:
- return Key
-
-## ParseMapFile() method
-#
-# Parse map files to get a dict of 'ModuleName' : {FunName : FunAddress}
-#
-# @param Files: A list of map files
-#
-# @return AllMaps: An object of all map files
-#
-def ParseMapFile(Files):
- AllMaps = {}
- CurrentModule = ''
- CurrentMaps = {}
- for File in Files:
- Content = open(File, 'r').readlines()
- for Line in Content:
- Line = CleanString(Line)
- # skip empty line
- if Line == '':
- continue
-
- if Line.find('(') > -1 and Line.find(')') > -1:
- if CurrentModule != '' and CurrentMaps != {}:
- AllMaps[CurrentModule] = CurrentMaps
- CurrentModule = Line[:Line.find('(')]
- CurrentMaps = {}
- continue
- else:
- Name = ''
- Address = ''
- List = Line.split()
- Address = List[0]
- if List[1] == 'F' or List[1] == 'FS':
- Name = List[2]
- else:
- Name = List[1]
- CurrentMaps[Name] = Address
- continue
-
- return AllMaps
-
-## ConvertGuid
-#
-# Convert a GUID to a GUID with all upper letters
-#
-# @param guid: The GUID to be converted
-#
-# @param newGuid: The GUID with all upper letters.
-#
-def ConvertGuid(guid):
- numList = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
- newGuid = ''
- if guid.startswith('g'):
- guid = guid[1:]
- for i in guid:
- if i.upper() == i and i not in numList:
- newGuid = newGuid + ('_' + i)
- else:
- newGuid = newGuid + i.upper()
- if newGuid.startswith('_'):
- newGuid = newGuid[1:]
- if newGuid.endswith('_'):
- newGuid = newGuid[:-1]
-
- return newGuid
-
-## ConvertGuid2() method
-#
-# Convert a GUID to a GUID with new string instead of old string
-#
-# @param guid: The GUID to be converted
-# @param old: Old string to be replaced
-# @param new: New string to replace the old one
-#
-# @param newGuid: The GUID after replacement
-#
-def ConvertGuid2(guid, old, new):
- newGuid = ConvertGuid(guid)
- newGuid = newGuid.replace(old, new)
-
- return newGuid
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- pass
diff --git a/BaseTools/Source/Python/Eot/ParserWarning.py b/BaseTools/Source/Python/Eot/ParserWarning.py
deleted file mode 100644
index 2e3f5e4983..0000000000
--- a/BaseTools/Source/Python/Eot/ParserWarning.py
+++ /dev/null
@@ -1,26 +0,0 @@
-## @file
-# Warning information of Eot
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-class Warning (Exception):
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param File The FDF name
- # @param Line The Line number that error occurs
- #
- def __init__(self, Str, File = None, Line = None):
- self.message = Str
- self.FileName = File
- self.LineNumber = Line
- self.ToolName = 'EOT' \ No newline at end of file
diff --git a/BaseTools/Source/Python/Eot/Report.py b/BaseTools/Source/Python/Eot/Report.py
deleted file mode 100644
index 024f6d87be..0000000000
--- a/BaseTools/Source/Python/Eot/Report.py
+++ /dev/null
@@ -1,472 +0,0 @@
-## @file
-# This file is used to create report for Eot tool
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import EotGlobalData
-
-## Report() class
-#
-# This class defined Report
-#
-# @param object: Inherited from object class
-#
-class Report(object):
- ## The constructor
- #
- # @param self: The object pointer
- # @param ReportName: name of the report
- # @param FvObj: FV object after parsing FV images
- #
- def __init__(self, ReportName = 'Report.html', FvObj = None, DispatchName=None):
- self.ReportName = ReportName
- self.Op = open(ReportName, 'w+')
- self.DispatchList = None
- if DispatchName:
- self.DispatchList = open(DispatchName, 'w+')
- self.FvObj = FvObj
- self.FfsIndex = 0
- self.PpiIndex = 0
- self.ProtocolIndex = 0
- if EotGlobalData.gMACRO['EFI_SOURCE'] == '':
- EotGlobalData.gMACRO['EFI_SOURCE'] = EotGlobalData.gMACRO['EDK_SOURCE']
-
- ## WriteLn() method
- #
- # Write a line in the report
- #
- # @param self: The object pointer
- # @param Line: The lint to be written into
- #
- def WriteLn(self, Line):
- self.Op.write('%s\n' % Line)
-
- ## GenerateReport() method
- #
- # A caller to generate report
- #
- # @param self: The object pointer
- #
- def GenerateReport(self):
- self.GenerateHeader()
- self.GenerateFv()
- self.GenerateTail()
- self.Op.close()
- self.GenerateUnDispatchedList()
-
- ## GenerateUnDispatchedList() method
- #
- # Create a list for not dispatched items
- #
- # @param self: The object pointer
- #
- def GenerateUnDispatchedList(self):
- FvObj = self.FvObj
- EotGlobalData.gOP_UN_DISPATCHED.write('%s\n' % FvObj.Name)
- for Item in FvObj.UnDispatchedFfsDict:
- EotGlobalData.gOP_UN_DISPATCHED.write('%s\n' % FvObj.UnDispatchedFfsDict[Item])
-
- ## GenerateFv() method
- #
- # Generate FV information
- #
- # @param self: The object pointer
- #
- def GenerateFv(self):
- FvObj = self.FvObj
- Content = """ <tr>
- <td width="20%%"><strong>Name</strong></td>
- <td width="60%%"><strong>Guid</strong></td>
- <td width="20%%"><strong>Size</strong></td>
- </tr>"""
- self.WriteLn(Content)
-
- for Info in FvObj.BasicInfo:
- FvName = Info[0]
- FvGuid = Info[1]
- FvSize = Info[2]
-
- Content = """ <tr>
- <td>%s</td>
- <td>%s</td>
- <td>%s</td>
- </tr>""" % (FvName, FvGuid, FvSize)
- self.WriteLn(Content)
-
- Content = """ <td colspan="3"><table width="100%%" border="1">
- <tr>"""
- self.WriteLn(Content)
-
- EotGlobalData.gOP_DISPATCH_ORDER.write('Dispatched:\n')
- for FfsId in FvObj.OrderedFfsDict:
- self.GenerateFfs(FvObj.OrderedFfsDict[FfsId])
- Content = """ </table></td>
- </tr>"""
- self.WriteLn(Content)
-
- # For UnDispatched
- Content = """ <td colspan="3"><table width="100%%" border="1">
- <tr>
- <tr><strong>UnDispatched</strong></tr>"""
- self.WriteLn(Content)
-
- EotGlobalData.gOP_DISPATCH_ORDER.write('\nUnDispatched:\n')
- for FfsId in FvObj.UnDispatchedFfsDict:
- self.GenerateFfs(FvObj.UnDispatchedFfsDict[FfsId])
- Content = """ </table></td>
- </tr>"""
- self.WriteLn(Content)
-
- ## GenerateDepex() method
- #
- # Generate Depex information
- #
- # @param self: The object pointer
- # @param DepexString: A DEPEX string needed to be parsed
- #
- def GenerateDepex(self, DepexString):
- NonGuidList = ['AND', 'OR', 'NOT', 'BEFORE', 'AFTER', 'TRUE', 'FALSE']
- ItemList = DepexString.split(' ')
- DepexString = ''
- for Item in ItemList:
- if Item not in NonGuidList:
- SqlCommand = """select DISTINCT GuidName from Report where GuidValue like '%s' and ItemMode = 'Produced' group by GuidName""" % (Item)
- RecordSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- if RecordSet != []:
- Item = RecordSet[0][0]
- DepexString = DepexString + Item + ' '
- Content = """ <tr>
- <td width="5%%"></td>
- <td width="95%%">%s</td>
- </tr>""" % (DepexString)
- self.WriteLn(Content)
-
- ## GeneratePpi() method
- #
- # Generate PPI information
- #
- # @param self: The object pointer
- # @param Name: CName of a GUID
- # @param Guid: Value of a GUID
- # @param Type: Type of a GUID
- #
- def GeneratePpi(self, Name, Guid, Type):
- self.GeneratePpiProtocol('Ppi', Name, Guid, Type, self.PpiIndex)
-
- ## GenerateProtocol() method
- #
- # Generate PROTOCOL information
- #
- # @param self: The object pointer
- # @param Name: CName of a GUID
- # @param Guid: Value of a GUID
- # @param Type: Type of a GUID
- #
- def GenerateProtocol(self, Name, Guid, Type):
- self.GeneratePpiProtocol('Protocol', Name, Guid, Type, self.ProtocolIndex)
-
- ## GeneratePpiProtocol() method
- #
- # Generate PPI/PROTOCOL information
- #
- # @param self: The object pointer
- # @param Model: Model of a GUID, PPI or PROTOCOL
- # @param Name: Name of a GUID
- # @param Guid: Value of a GUID
- # @param Type: Type of a GUID
- # @param CName: CName(Index) of a GUID
- #
- def GeneratePpiProtocol(self, Model, Name, Guid, Type, CName):
- Content = """ <tr>
- <td width="5%%"></td>
- <td width="10%%">%s</td>
- <td width="85%%" colspan="3">%s</td>
- <!-- %s -->
- </tr>""" % (Model, Name, Guid)
- self.WriteLn(Content)
- if Type == 'Produced':
- SqlCommand = """select DISTINCT SourceFileFullPath, BelongsToFunction from Report where GuidName like '%s' and ItemMode = 'Callback'""" % Name
- RecordSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- for Record in RecordSet:
- SqlCommand = """select FullPath from File
- where ID = (
- select DISTINCT BelongsToFile from Inf
- where Value1 like '%s')""" % Record[0]
- ModuleSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- Inf = ModuleSet[0][0].replace(EotGlobalData.gMACRO['WORKSPACE'], '.')
- Function = Record[1]
- Address = ''
- for Item in EotGlobalData.gMap:
- if Function in EotGlobalData.gMap[Item]:
- Address = EotGlobalData.gMap[Item][Function]
- break
- if '_' + Function in EotGlobalData.gMap[Item]:
- Address = EotGlobalData.gMap[Item]['_' + Function]
- break
- Content = """ <tr>
- <td width="5%%"></td>
- <td width="10%%">%s</td>
- <td width="40%%">%s</td>
- <td width="35%%">%s</td>
- <td width="10%%">%s</td>
- </tr>""" % ('Callback', Inf, Function, Address)
- self.WriteLn(Content)
-
- ## GenerateFfs() method
- #
- # Generate FFS information
- #
- # @param self: The object pointer
- # @param FfsObj: FFS object after FV image is parsed
- #
- def GenerateFfs(self, FfsObj):
- self.FfsIndex = self.FfsIndex + 1
- if FfsObj != None and FfsObj.Type in [0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0xA]:
- FfsGuid = FfsObj.Guid
- FfsOffset = FfsObj._OFF_
- FfsName = 'Unknown-Module'
- FfsPath = FfsGuid
- FfsType = FfsObj._TypeName[FfsObj.Type]
-
- # Hard code for Binary INF
- if FfsGuid.upper() == '7BB28B99-61BB-11D5-9A5D-0090273FC14D':
- FfsName = 'Logo'
-
- if FfsGuid.upper() == '7E374E25-8E01-4FEE-87F2-390C23C606CD':
- FfsName = 'AcpiTables'
-
- if FfsGuid.upper() == '961578FE-B6B7-44C3-AF35-6BC705CD2B1F':
- FfsName = 'Fat'
-
- # Find FFS Path and Name
- SqlCommand = """select Value2 from Inf
- where BelongsToFile = (select BelongsToFile from Inf where Value1 = 'FILE_GUID' and lower(Value2) = lower('%s') and Model = %s)
- and Model = %s and Value1='BASE_NAME'""" % (FfsGuid, 5001, 5001)
- RecordSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- if RecordSet != []:
- FfsName = RecordSet[0][0]
-
- SqlCommand = """select FullPath from File
- where ID = (select BelongsToFile from Inf where Value1 = 'FILE_GUID' and lower(Value2) = lower('%s') and Model = %s)
- and Model = %s""" % (FfsGuid, 5001, 1011)
- RecordSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- if RecordSet != []:
- FfsPath = RecordSet[0][0]
-
- Content = """ <tr>
- <tr class='styleFfs' id='FfsHeader%s'>
- <td width="55%%"><span onclick="Display('FfsHeader%s', 'Ffs%s')" onMouseOver="funOnMouseOver()" onMouseOut="funOnMouseOut()">%s</span></td>
- <td width="15%%">%s</td>
- <!--<td width="20%%">%s</td>-->
- <!--<td width="20%%">%s</td>-->
- <td width="10%%">%s</td>
- </tr>
- <tr id='Ffs%s' style='display:none;'>
- <td colspan="4"><table width="100%%" border="1">""" % (self.FfsIndex, self.FfsIndex, self.FfsIndex, FfsPath, FfsName, FfsGuid, FfsOffset, FfsType, self.FfsIndex)
-
- if self.DispatchList:
- if FfsObj.Type in [0x04, 0x06]:
- self.DispatchList.write("%s %s %s %s\n" % (FfsGuid, "P", FfsName, FfsPath))
- if FfsObj.Type in [0x05, 0x07, 0x08, 0x0A]:
- self.DispatchList.write("%s %s %s %s\n" % (FfsGuid, "D", FfsName, FfsPath))
-
- self.WriteLn(Content)
-
- EotGlobalData.gOP_DISPATCH_ORDER.write('%s\n' %FfsName)
-
- if FfsObj.Depex != '':
- Content = """ <tr>
- <td><span id='DepexHeader%s' class="styleDepex" onclick="Display('DepexHeader%s', 'Depex%s')" onMouseOver="funOnMouseOver()" onMouseOut="funOnMouseOut()">&nbsp&nbspDEPEX expression</span></td>
- </tr>
- <tr id='Depex%s' style='display:none;'>
- <td><table width="100%%" border="1">""" % (self.FfsIndex, self.FfsIndex, self.FfsIndex, self.FfsIndex)
- self.WriteLn(Content)
- self.GenerateDepex(FfsObj.Depex)
- Content = """ </table></td>
- </tr>"""
- self.WriteLn(Content)
- # End of DEPEX
-
- # Find Consumed Ppi/Protocol
- SqlCommand = """select ModuleName, ItemType, GuidName, GuidValue, GuidMacro from Report
- where SourceFileFullPath in
- (select Value1 from Inf where BelongsToFile =
- (select BelongsToFile from Inf
- where Value1 = 'FILE_GUID' and Value2 like '%s' and Model = %s)
- and Model = %s)
- and ItemMode = 'Consumed' group by GuidName order by ItemType""" \
- % (FfsGuid, 5001, 3007)
-
- RecordSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- if RecordSet != []:
- Count = len(RecordSet)
- Content = """ <tr>
- <td><span id='ConsumedHeader%s' class="styleConsumed" onclick="Display('ConsumedHeader%s', 'Consumed%s')" onMouseOver="funOnMouseOver()" onMouseOut="funOnMouseOut()">&nbsp&nbspConsumed Ppis/Protocols List (%s)</span></td>
- </tr>
- <tr id='Consumed%s' style='display:none;'>
- <td><table width="100%%" border="1">""" % (self.FfsIndex, self.FfsIndex, self.FfsIndex, Count, self.FfsIndex)
- self.WriteLn(Content)
- self.ProtocolIndex = 0
- for Record in RecordSet:
- self.ProtocolIndex = self.ProtocolIndex + 1
- Name = Record[2]
- CName = Record[4]
- Guid = Record[3]
- Type = Record[1]
- self.GeneratePpiProtocol(Type, Name, Guid, 'Consumed', CName)
-
- Content = """ </table></td>
- </tr>"""
- self.WriteLn(Content)
- #End of Consumed Ppi/Portocol
-
- # Find Produced Ppi/Protocol
- SqlCommand = """select ModuleName, ItemType, GuidName, GuidValue, GuidMacro from Report
- where SourceFileFullPath in
- (select Value1 from Inf where BelongsToFile =
- (select BelongsToFile from Inf
- where Value1 = 'FILE_GUID' and Value2 like '%s' and Model = %s)
- and Model = %s)
- and ItemMode = 'Produced' group by GuidName order by ItemType""" \
- % (FfsGuid, 5001, 3007)
-
- RecordSet = EotGlobalData.gDb.TblReport.Exec(SqlCommand)
- if RecordSet != []:
- Count = len(RecordSet)
- Content = """ <tr>
- <td><span id='ProducedHeader%s' class="styleProduced" onclick="Display('ProducedHeader%s', 'Produced%s')" onMouseOver="funOnMouseOver()" onMouseOut="funOnMouseOut()">&nbsp&nbspProduced Ppis/Protocols List (%s)</span></td>
- </tr>
- <tr id='Produced%s' style='display:none;'>
- <td><table width="100%%" border="1">""" % (self.FfsIndex, self.FfsIndex, self.FfsIndex, Count, self.FfsIndex)
- self.WriteLn(Content)
- self.PpiIndex = 0
- for Record in RecordSet:
- self.PpiIndex = self.PpiIndex + 1
- Name = Record[2]
- CName = Record[4]
- Guid = Record[3]
- Type = Record[1]
- self.GeneratePpiProtocol(Type, Name, Guid, 'Produced', CName)
-
- Content = """ </table></td>
- </tr>"""
- self.WriteLn(Content)
- RecordSet = None
- # End of Produced Ppi/Protocol
-
- Content = """ </table></td>
- </tr>"""
- self.WriteLn(Content)
-
- ## GenerateTail() method
- #
- # Generate end tags of HTML report
- #
- # @param self: The object pointer
- #
- def GenerateTail(self):
- Tail = """</table>
-</body>
-</html>"""
- self.WriteLn(Tail)
-
- ## GenerateHeader() method
- #
- # Generate start tags of HTML report
- #
- # @param self: The object pointer
- #
- def GenerateHeader(self):
- Header = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Execution Order Tool Report</title>
-<meta http-equiv="Content-Type" content="text/html">
-<style type="text/css">
-<!--
-.styleFfs {
- color: #006600;
- font-weight: bold;
-}
-.styleDepex {
- color: #FF0066;
- font-weight: bold;
-}
-.styleProduced {
- color: #0000FF;
- font-weight: bold;
-}
-.styleConsumed {
- color: #FF00FF;
- font-weight: bold;
-}
--->
-</style>
-<Script type="text/javascript">
-function Display(ParentID, SubID)
-{
- SubItem = document.getElementById(SubID);
- ParentItem = document.getElementById(ParentID);
- if (SubItem.style.display == 'none')
- {
- SubItem.style.display = ''
- ParentItem.style.fontWeight = 'normal'
- }
- else
- {
- SubItem.style.display = 'none'
- ParentItem.style.fontWeight = 'bold'
- }
-
-}
-
-function funOnMouseOver()
-{
- document.body.style.cursor = "hand";
-}
-
-function funOnMouseOut()
-{
- document.body.style.cursor = "";
-}
-
-</Script>
-</head>
-
-<body>
-<table width="100%%" border="1">"""
- self.WriteLn(Header)
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- # Initialize log system
- FilePath = 'FVRECOVERYFLOPPY.fv'
- if FilePath.lower().endswith(".fv"):
- fd = open(FilePath, 'rb')
- buf = array('B')
- try:
- buf.fromfile(fd, os.path.getsize(FilePath))
- except EOFError:
- pass
-
- fv = FirmwareVolume("FVRECOVERY", buf, 0)
-
- report = Report('Report.html', fv)
- report.GenerateReport()
diff --git a/BaseTools/Source/Python/Eot/__init__.py b/BaseTools/Source/Python/Eot/__init__.py
deleted file mode 100644
index c184a687d8..0000000000
--- a/BaseTools/Source/Python/Eot/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'Eot' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/Eot/c.py b/BaseTools/Source/Python/Eot/c.py
deleted file mode 100644
index 02ff959958..0000000000
--- a/BaseTools/Source/Python/Eot/c.py
+++ /dev/null
@@ -1,387 +0,0 @@
-## @file
-# preprocess source file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import sys
-import os
-import re
-import CodeFragmentCollector
-import FileProfile
-from CommonDataClass import DataClass
-from Common import EdkLogger
-from EotToolError import *
-import EotGlobalData
-
-# Global Dicts
-IncludeFileListDict = {}
-IncludePathListDict = {}
-ComplexTypeDict = {}
-SUDict = {}
-
-## GetFuncDeclPattern() method
-#
-# Get the pattern of function declaration
-#
-# @return p: the pattern of function declaration
-#
-def GetFuncDeclPattern():
- p = re.compile(r'(EFIAPI|EFI_BOOT_SERVICE|EFI_RUNTIME_SERVICE)?\s*[_\w]+\s*\(.*\).*', re.DOTALL)
- return p
-
-## GetArrayPattern() method
-#
-# Get the pattern of array
-#
-# @return p: the pattern of array
-#
-def GetArrayPattern():
- p = re.compile(r'[_\w]*\s*[\[.*\]]+')
- return p
-
-## GetTypedefFuncPointerPattern() method
-#
-# Get the pattern of function pointer
-#
-# @return p: the pattern of function pointer
-#
-def GetTypedefFuncPointerPattern():
- p = re.compile('[_\w\s]*\([\w\s]*\*+\s*[_\w]+\s*\)\s*\(.*\)', re.DOTALL)
- return p
-
-## GetDB() method
-#
-# Get global database instance
-#
-# @return EotGlobalData.gDb: the global database instance
-#
-def GetDB():
- return EotGlobalData.gDb
-
-## PrintErrorMsg() method
-#
-# print error message
-#
-# @param ErrorType: Type of error
-# @param Msg: Error message
-# @param TableName: table name of error found
-# @param ItemId: id of item
-#
-def PrintErrorMsg(ErrorType, Msg, TableName, ItemId):
- Msg = Msg.replace('\n', '').replace('\r', '')
- MsgPartList = Msg.split()
- Msg = ''
- for Part in MsgPartList:
- Msg += Part
- Msg += ' '
- GetDB().TblReport.Insert(ErrorType, OtherMsg = Msg, BelongsToTable = TableName, BelongsToItem = ItemId)
-
-## GetIdType() method
-#
-# Find type of input string
-#
-# @param Str: String to be parsed
-#
-# @return Type: The type of the string
-#
-def GetIdType(Str):
- Type = DataClass.MODEL_UNKNOWN
- Str = Str.replace('#', '# ')
- List = Str.split()
- if List[1] == 'include':
- Type = DataClass.MODEL_IDENTIFIER_INCLUDE
- elif List[1] == 'define':
- Type = DataClass.MODEL_IDENTIFIER_MACRO_DEFINE
- elif List[1] == 'ifdef':
- Type = DataClass.MODEL_IDENTIFIER_MACRO_IFDEF
- elif List[1] == 'ifndef':
- Type = DataClass.MODEL_IDENTIFIER_MACRO_IFNDEF
- elif List[1] == 'endif':
- Type = DataClass.MODEL_IDENTIFIER_MACRO_ENDIF
- elif List[1] == 'pragma':
- Type = DataClass.MODEL_IDENTIFIER_MACRO_PROGMA
- else:
- Type = DataClass.MODEL_UNKNOWN
- return Type
-
-## GetIdentifierList() method
-#
-# Get id of all files
-#
-# @return IdList: The list of all id of files
-#
-def GetIdentifierList():
- IdList = []
-
- for pp in FileProfile.PPDirectiveList:
- Type = GetIdType(pp.Content)
- IdPP = DataClass.IdentifierClass(-1, '', '', '', pp.Content, Type, -1, -1, pp.StartPos[0],pp.StartPos[1],pp.EndPos[0],pp.EndPos[1])
- IdList.append(IdPP)
-
- for ae in FileProfile.AssignmentExpressionList:
- IdAE = DataClass.IdentifierClass(-1, ae.Operator, '', ae.Name, ae.Value, DataClass.MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION, -1, -1, ae.StartPos[0],ae.StartPos[1],ae.EndPos[0],ae.EndPos[1])
- IdList.append(IdAE)
-
- FuncDeclPattern = GetFuncDeclPattern()
- ArrayPattern = GetArrayPattern()
- for var in FileProfile.VariableDeclarationList:
- DeclText = var.Declarator.strip()
- while DeclText.startswith('*'):
- var.Modifier += '*'
- DeclText = DeclText.lstrip('*').strip()
- var.Declarator = DeclText
- if FuncDeclPattern.match(var.Declarator):
- DeclSplitList = var.Declarator.split('(')
- FuncName = DeclSplitList[0]
- FuncNamePartList = FuncName.split()
- if len(FuncNamePartList) > 1:
- FuncName = FuncNamePartList[-1]
- Index = 0
- while Index < len(FuncNamePartList) - 1:
- var.Modifier += ' ' + FuncNamePartList[Index]
- var.Declarator = var.Declarator.lstrip().lstrip(FuncNamePartList[Index])
- Index += 1
- IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', var.Declarator, '', DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION, -1, -1, var.StartPos[0],var.StartPos[1],var.EndPos[0],var.EndPos[1])
- IdList.append(IdVar)
- continue
-
- if var.Declarator.find('{') == -1:
- for decl in var.Declarator.split(','):
- DeclList = decl.split('=')
- Name = DeclList[0].strip()
- if ArrayPattern.match(Name):
- LSBPos = var.Declarator.find('[')
- var.Modifier += ' ' + Name[LSBPos:]
- Name = Name[0:LSBPos]
-
- IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0],var.StartPos[1],var.EndPos[0],var.EndPos[1])
- IdList.append(IdVar)
- else:
- DeclList = var.Declarator.split('=')
- Name = DeclList[0].strip()
- if ArrayPattern.match(Name):
- LSBPos = var.Declarator.find('[')
- var.Modifier += ' ' + Name[LSBPos:]
- Name = Name[0:LSBPos]
- IdVar = DataClass.IdentifierClass(-1, var.Modifier, '', Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFIER_VARIABLE, -1, -1, var.StartPos[0],var.StartPos[1],var.EndPos[0],var.EndPos[1])
- IdList.append(IdVar)
-
- for enum in FileProfile.EnumerationDefinitionList:
- LBPos = enum.Content.find('{')
- RBPos = enum.Content.find('}')
- Name = enum.Content[4:LBPos].strip()
- Value = enum.Content[LBPos+1:RBPos]
- IdEnum = DataClass.IdentifierClass(-1, '', '', Name, Value, DataClass.MODEL_IDENTIFIER_ENUMERATE, -1, -1, enum.StartPos[0],enum.StartPos[1],enum.EndPos[0],enum.EndPos[1])
- IdList.append(IdEnum)
-
- for su in FileProfile.StructUnionDefinitionList:
- Type = DataClass.MODEL_IDENTIFIER_STRUCTURE
- SkipLen = 6
- if su.Content.startswith('union'):
- Type = DataClass.MODEL_IDENTIFIER_UNION
- SkipLen = 5
- LBPos = su.Content.find('{')
- RBPos = su.Content.find('}')
- if LBPos == -1 or RBPos == -1:
- Name = su.Content[SkipLen:].strip()
- Value = ''
- else:
- Name = su.Content[SkipLen:LBPos].strip()
- Value = su.Content[LBPos+1:RBPos]
- IdPE = DataClass.IdentifierClass(-1, '', '', Name, Value, Type, -1, -1, su.StartPos[0],su.StartPos[1],su.EndPos[0],su.EndPos[1])
- IdList.append(IdPE)
-
- TdFuncPointerPattern = GetTypedefFuncPointerPattern()
- for td in FileProfile.TypedefDefinitionList:
- Modifier = ''
- Name = td.ToType
- Value = td.FromType
- if TdFuncPointerPattern.match(td.ToType):
- Modifier = td.FromType
- LBPos = td.ToType.find('(')
- TmpStr = td.ToType[LBPos+1:].strip()
- StarPos = TmpStr.find('*')
- if StarPos != -1:
- Modifier += ' ' + TmpStr[0:StarPos]
- while TmpStr[StarPos] == '*':
- Modifier += ' ' + '*'
- StarPos += 1
- TmpStr = TmpStr[StarPos:].strip()
- RBPos = TmpStr.find(')')
- Name = TmpStr[0:RBPos]
- Value = 'FP' + TmpStr[RBPos + 1:]
-
- IdTd = DataClass.IdentifierClass(-1, Modifier, '', Name, Value, DataClass.MODEL_IDENTIFIER_TYPEDEF, -1, -1, td.StartPos[0],td.StartPos[1],td.EndPos[0],td.EndPos[1])
- IdList.append(IdTd)
-
- for funcCall in FileProfile.FunctionCallingList:
- IdFC = DataClass.IdentifierClass(-1, '', '', funcCall.FuncName, funcCall.ParamList, DataClass.MODEL_IDENTIFIER_FUNCTION_CALLING, -1, -1, funcCall.StartPos[0],funcCall.StartPos[1],funcCall.EndPos[0],funcCall.EndPos[1])
- IdList.append(IdFC)
- return IdList
-
-## GetParamList() method
-#
-# Get a list of parameters
-#
-# @param FuncDeclarator: Function declarator
-# @param FuncNameLine: Line number of function name
-# @param FuncNameOffset: Offset of function name
-#
-# @return ParamIdList: A list of parameters
-#
-def GetParamList(FuncDeclarator, FuncNameLine = 0, FuncNameOffset = 0):
- ParamIdList = []
- DeclSplitList = FuncDeclarator.split('(')
- if len(DeclSplitList) < 2:
- return ParamIdList
- FuncName = DeclSplitList[0]
- ParamStr = DeclSplitList[1].rstrip(')')
- LineSkipped = 0
- OffsetSkipped = 0
- Start = 0
- while FuncName.find('\n', Start) != -1:
- LineSkipped += 1
- OffsetSkipped = 0
- Start += FuncName.find('\n', Start)
- Start += 1
- OffsetSkipped += len(FuncName[Start:])
- OffsetSkipped += 1 #skip '('
- ParamBeginLine = FuncNameLine + LineSkipped
- ParamBeginOffset = OffsetSkipped
- for p in ParamStr.split(','):
- ListP = p.split()
- if len(ListP) == 0:
- continue
- ParamName = ListP[-1]
- DeclText = ParamName.strip()
- RightSpacePos = p.rfind(ParamName)
- ParamModifier = p[0:RightSpacePos]
- if ParamName == 'OPTIONAL':
- if ParamModifier == '':
- ParamModifier += ' ' + 'OPTIONAL'
- DeclText = ''
- else:
- ParamName = ListP[-2]
- DeclText = ParamName.strip()
- RightSpacePos = p.rfind(ParamName)
- ParamModifier = p[0:RightSpacePos]
- ParamModifier += 'OPTIONAL'
- while DeclText.startswith('*'):
- ParamModifier += ' ' + '*'
- DeclText = DeclText.lstrip('*').strip()
- ParamName = DeclText
-
- Start = 0
- while p.find('\n', Start) != -1:
- LineSkipped += 1
- OffsetSkipped = 0
- Start += p.find('\n', Start)
- Start += 1
- OffsetSkipped += len(p[Start:])
-
- ParamEndLine = ParamBeginLine + LineSkipped
- ParamEndOffset = OffsetSkipped
- IdParam = DataClass.IdentifierClass(-1, ParamModifier, '', ParamName, '', DataClass.MODEL_IDENTIFIER_PARAMETER, -1, -1, ParamBeginLine, ParamBeginOffset, ParamEndLine, ParamEndOffset)
- ParamIdList.append(IdParam)
- ParamBeginLine = ParamEndLine
- ParamBeginOffset = OffsetSkipped + 1 #skip ','
-
- return ParamIdList
-
-## GetFunctionList()
-#
-# Get a list of functions
-#
-# @return FuncObjList: A list of function objects
-#
-def GetFunctionList():
- FuncObjList = []
- for FuncDef in FileProfile.FunctionDefinitionList:
- ParamIdList = []
- DeclText = FuncDef.Declarator.strip()
- while DeclText.startswith('*'):
- FuncDef.Modifier += '*'
- DeclText = DeclText.lstrip('*').strip()
-
- FuncDef.Declarator = FuncDef.Declarator.lstrip('*')
- DeclSplitList = FuncDef.Declarator.split('(')
- if len(DeclSplitList) < 2:
- continue
-
- FuncName = DeclSplitList[0]
- FuncNamePartList = FuncName.split()
- if len(FuncNamePartList) > 1:
- FuncName = FuncNamePartList[-1]
- Index = 0
- while Index < len(FuncNamePartList) - 1:
- FuncDef.Modifier += ' ' + FuncNamePartList[Index]
- Index += 1
-
- FuncObj = DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDef.Modifier, FuncName.strip(), '', FuncDef.StartPos[0],FuncDef.StartPos[1],FuncDef.EndPos[0],FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.LeftBracePos[1], -1, ParamIdList, [])
- FuncObjList.append(FuncObj)
-
- return FuncObjList
-
-## CreateCCodeDB() method
-#
-# Create database for all c code
-#
-# @param FileNameList: A list of all c code file names
-#
-def CreateCCodeDB(FileNameList):
- FileObjList = []
- ParseErrorFileList = []
- ParsedFiles = {}
- for FullName in FileNameList:
- if os.path.splitext(FullName)[1] in ('.h', '.c'):
- if FullName.lower() in ParsedFiles:
- continue
- ParsedFiles[FullName.lower()] = 1
- EdkLogger.info("Parsing " + FullName)
- model = FullName.endswith('c') and DataClass.MODEL_FILE_C or DataClass.MODEL_FILE_H
- collector = CodeFragmentCollector.CodeFragmentCollector(FullName)
- try:
- collector.ParseFile()
- except:
- ParseErrorFileList.append(FullName)
- BaseName = os.path.basename(FullName)
- DirName = os.path.dirname(FullName)
- Ext = os.path.splitext(BaseName)[1].lstrip('.')
- ModifiedTime = os.path.getmtime(FullName)
- FileObj = DataClass.FileClass(-1, BaseName, Ext, DirName, FullName, model, ModifiedTime, GetFunctionList(), GetIdentifierList(), [])
- FileObjList.append(FileObj)
- collector.CleanFileProfileBuffer()
-
- if len(ParseErrorFileList) > 0:
- EdkLogger.info("Found unrecoverable error during parsing:\n\t%s\n" % "\n\t".join(ParseErrorFileList))
-
- Db = EotGlobalData.gDb
- for file in FileObjList:
- Db.InsertOneFile(file)
-
- Db.UpdateIdentifierBelongsToFunction()
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
-
- EdkLogger.Initialize()
- EdkLogger.SetLevel(EdkLogger.QUIET)
- CollectSourceCodeDataIntoDB(sys.argv[1])
-
- print 'Done!'
diff --git a/BaseTools/Source/Python/GNUmakefile b/BaseTools/Source/Python/GNUmakefile
deleted file mode 100644
index ed00a7b178..0000000000
--- a/BaseTools/Source/Python/GNUmakefile
+++ /dev/null
@@ -1,18 +0,0 @@
-## @file
-# GNU/Linux makefile for Python tools build.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-all:
-
-clean:
- find . -name '*.pyc' -exec rm '{}' ';'
-
diff --git a/BaseTools/Source/Python/GenFds/AprioriSection.py b/BaseTools/Source/Python/GenFds/AprioriSection.py
deleted file mode 100644
index a6dace82a6..0000000000
--- a/BaseTools/Source/Python/GenFds/AprioriSection.py
+++ /dev/null
@@ -1,118 +0,0 @@
-## @file
-# process APRIORI file data and generate PEI/DXE APRIORI file
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from struct import *
-import os
-import StringIO
-import FfsFileStatement
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from CommonDataClass.FdfClass import AprioriSectionClassObject
-from Common.String import *
-from Common.Misc import SaveFileOnChange,PathClass
-from Common import EdkLogger
-from Common.BuildToolError import *
-
-## process APRIORI file data and generate PEI/DXE APRIORI file
-#
-#
-class AprioriSection (AprioriSectionClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- AprioriSectionClassObject.__init__(self)
- self.AprioriType = ""
-
- ## GenFfs() method
- #
- # Generate FFS for APRIORI file
- #
- # @param self The object pointer
- # @param FvName for whom apriori file generated
- # @param Dict dictionary contains macro and its value
- # @retval string Generated file name
- #
- def GenFfs (self, FvName, Dict = {}):
- DXE_GUID = "FC510EE7-FFDC-11D4-BD41-0080C73C8881"
- PEI_GUID = "1B45CC0A-156A-428A-AF62-49864DA0E6E6"
- Buffer = StringIO.StringIO('')
- AprioriFileGuid = DXE_GUID
- if self.AprioriType == "PEI":
- AprioriFileGuid = PEI_GUID
- OutputAprFilePath = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, \
- GenFdsGlobalVariable.FfsDir,\
- AprioriFileGuid + FvName)
- if not os.path.exists(OutputAprFilePath) :
- os.makedirs(OutputAprFilePath)
-
- OutputAprFileName = os.path.join( OutputAprFilePath, \
- AprioriFileGuid + FvName + '.Apri' )
- AprFfsFileName = os.path.join (OutputAprFilePath,\
- AprioriFileGuid + FvName + '.Ffs')
-
- Dict.update(self.DefineVarDict)
- for FfsObj in self.FfsList :
- Guid = ""
- if isinstance(FfsObj, FfsFileStatement.FileStatement):
- Guid = FfsObj.NameGuid
- else:
- InfFileName = NormPath(FfsObj.InfFileName)
- Arch = FfsObj.GetCurrentArch()
-
- if Arch != None:
- Dict['$(ARCH)'] = Arch
- InfFileName = GenFdsGlobalVariable.MacroExtend(InfFileName, Dict, Arch)
-
- if Arch != None:
- Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(InfFileName, GenFdsGlobalVariable.WorkSpaceDir), Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- Guid = Inf.Guid
-
- else:
- Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(InfFileName, GenFdsGlobalVariable.WorkSpaceDir), 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- Guid = Inf.Guid
-
- self.BinFileList = Inf.Module.Binaries
- if self.BinFileList == []:
- EdkLogger.error("GenFds", RESOURCE_NOT_AVAILABLE,
- "INF %s not found in build ARCH %s!" \
- % (InfFileName, GenFdsGlobalVariable.ArchList))
-
-
- GuidPart = Guid.split('-')
- Buffer.write(pack('I', long(GuidPart[0], 16)))
- Buffer.write(pack('H', int(GuidPart[1], 16)))
- Buffer.write(pack('H', int(GuidPart[2], 16)))
-
- for Num in range(2):
- Char = GuidPart[3][Num*2:Num*2+2]
- Buffer.write(pack('B', int(Char, 16)))
-
- for Num in range(6):
- Char = GuidPart[4][Num*2:Num*2+2]
- Buffer.write(pack('B', int(Char, 16)))
-
- SaveFileOnChange(OutputAprFileName, Buffer.getvalue())
-
- RawSectionFileName = os.path.join( OutputAprFilePath, \
- AprioriFileGuid + FvName + '.raw' )
- GenFdsGlobalVariable.GenerateSection(RawSectionFileName, [OutputAprFileName], 'EFI_SECTION_RAW')
- GenFdsGlobalVariable.GenerateFfs(AprFfsFileName, [RawSectionFileName],
- 'EFI_FV_FILETYPE_FREEFORM', AprioriFileGuid)
-
- return AprFfsFileName
-
diff --git a/BaseTools/Source/Python/GenFds/Attribute.py b/BaseTools/Source/Python/GenFds/Attribute.py
deleted file mode 100644
index 17761f2e24..0000000000
--- a/BaseTools/Source/Python/GenFds/Attribute.py
+++ /dev/null
@@ -1,28 +0,0 @@
-## @file
-# name value pair
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-
-## name value pair
-#
-#
-class Attribute:
- ## The constructor
- #
- # @param self The object pointer
- def __init__(self):
- self.Name = None
- self.Value = None \ No newline at end of file
diff --git a/BaseTools/Source/Python/GenFds/Capsule.py b/BaseTools/Source/Python/GenFds/Capsule.py
deleted file mode 100644
index fb9213b467..0000000000
--- a/BaseTools/Source/Python/GenFds/Capsule.py
+++ /dev/null
@@ -1,104 +0,0 @@
-## @file
-# generate capsule
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from CommonDataClass.FdfClass import CapsuleClassObject
-import os
-import subprocess
-import StringIO
-from Common.Misc import SaveFileOnChange
-from GenFds import GenFds
-
-
-T_CHAR_LF = '\n'
-
-## create inf file describes what goes into capsule and call GenFv to generate capsule
-#
-#
-class Capsule (CapsuleClassObject) :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- CapsuleClassObject.__init__(self)
- # For GenFv
- self.BlockSize = None
- # For GenFv
- self.BlockNum = None
- self.CapsuleName = None
-
- ## Generate capsule
- #
- # @param self The object pointer
- # @retval string Generated Capsule file path
- #
- def GenCapsule(self):
- if self.UiCapsuleName.upper() + 'cap' in GenFds.ImageBinDict.keys():
- return GenFds.ImageBinDict[self.UiCapsuleName.upper() + 'cap']
-
- GenFdsGlobalVariable.InfLogger( "\nGenerate %s Capsule" %self.UiCapsuleName)
- CapInfFile = self.GenCapInf()
- CapInfFile.writelines("[files]" + T_CHAR_LF)
- CapFileList = []
- for CapsuleDataObj in self.CapsuleDataList :
- CapsuleDataObj.CapsuleName = self.CapsuleName
- FileName = CapsuleDataObj.GenCapsuleSubItem()
- CapsuleDataObj.CapsuleName = None
- CapFileList.append(FileName)
- CapInfFile.writelines("EFI_FILE_NAME = " + \
- FileName + \
- T_CHAR_LF)
- SaveFileOnChange(self.CapInfFileName, CapInfFile.getvalue(), False)
- CapInfFile.close()
- #
- # Call GenFv tool to generate capsule
- #
- CapOutputFile = os.path.join(GenFdsGlobalVariable.FvDir, self.UiCapsuleName)
- CapOutputFile = CapOutputFile + '.Cap'
- GenFdsGlobalVariable.GenerateFirmwareVolume(
- CapOutputFile,
- [self.CapInfFileName],
- Capsule=True,
- FfsList=CapFileList
- )
-
- GenFdsGlobalVariable.VerboseLogger( "\nGenerate %s Capsule Successfully" %self.UiCapsuleName)
- GenFdsGlobalVariable.SharpCounter = 0
- GenFds.ImageBinDict[self.UiCapsuleName.upper() + 'cap'] = CapOutputFile
- return CapOutputFile
-
- ## Generate inf file for capsule
- #
- # @param self The object pointer
- # @retval file inf file object
- #
- def GenCapInf(self):
- self.CapInfFileName = os.path.join(GenFdsGlobalVariable.FvDir,
- self.UiCapsuleName + "_Cap" + '.inf')
- CapInfFile = StringIO.StringIO() #open (self.CapInfFileName , 'w+')
-
- CapInfFile.writelines("[options]" + T_CHAR_LF)
-
- for Item in self.TokensDict.keys():
- CapInfFile.writelines("EFI_" + \
- Item + \
- ' = ' + \
- self.TokensDict.get(Item) + \
- T_CHAR_LF)
-
- return CapInfFile
diff --git a/BaseTools/Source/Python/GenFds/CapsuleData.py b/BaseTools/Source/Python/GenFds/CapsuleData.py
deleted file mode 100644
index aef8df0e16..0000000000
--- a/BaseTools/Source/Python/GenFds/CapsuleData.py
+++ /dev/null
@@ -1,137 +0,0 @@
-## @file
-# generate capsule
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Ffs
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-import StringIO
-
-## base class for capsule data
-#
-#
-class CapsuleData:
- ## The constructor
- #
- # @param self The object pointer
- def __init__(self):
- pass
-
- ## generate capsule data
- #
- # @param self The object pointer
- def GenCapsuleSubItem(self):
- pass
-
-## FFS class for capsule data
-#
-#
-class CapsuleFfs (CapsuleData):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self) :
- self.Ffs = None
- self.FvName = None
-
- ## generate FFS capsule data
- #
- # @param self The object pointer
- # @retval string Generated file name
- #
- def GenCapsuleSubItem(self):
- FfsFile = self.Ffs.GenFfs()
- return FfsFile
-
-## FV class for capsule data
-#
-#
-class CapsuleFv (CapsuleData):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self) :
- self.Ffs = None
- self.FvName = None
- self.CapsuleName = None
-
- ## generate FV capsule data
- #
- # @param self The object pointer
- # @retval string Generated file name
- #
- def GenCapsuleSubItem(self):
- if self.FvName.find('.fv') == -1:
- if self.FvName.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():
- FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(self.FvName.upper())
- FdBuffer = StringIO.StringIO('')
- FvObj.CapsuleName = self.CapsuleName
- FvFile = FvObj.AddToBuffer(FdBuffer)
- FvObj.CapsuleName = None
- FdBuffer.close()
- return FvFile
- else:
- FvFile = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FvName)
- return FvFile
-
-## FD class for capsule data
-#
-#
-class CapsuleFd (CapsuleData):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self) :
- self.Ffs = None
- self.FdName = None
- self.CapsuleName = None
-
- ## generate FD capsule data
- #
- # @param self The object pointer
- # @retval string Generated file name
- #
- def GenCapsuleSubItem(self):
- if self.FdName.find('.fd') == -1:
- if self.FdName.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
- FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(self.FdName.upper())
- FdFile = FdObj.GenFd()
- return FdFile
- else:
- FdFile = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FdName)
- return FdFile
-
-## AnyFile class for capsule data
-#
-#
-class CapsuleAnyFile (CapsuleData):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self) :
- self.Ffs = None
- self.FileName = None
-
- ## generate AnyFile capsule data
- #
- # @param self The object pointer
- # @retval string Generated file name
- #
- def GenCapsuleSubItem(self):
- return self.FileName \ No newline at end of file
diff --git a/BaseTools/Source/Python/GenFds/ComponentStatement.py b/BaseTools/Source/Python/GenFds/ComponentStatement.py
deleted file mode 100644
index 1cf926155b..0000000000
--- a/BaseTools/Source/Python/GenFds/ComponentStatement.py
+++ /dev/null
@@ -1,29 +0,0 @@
-## @file
-# VTF components
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from CommonDataClass.FdfClass import ComponentStatementClassObject
-
-## VTF components
-#
-#
-class ComponentStatement (ComponentStatementClassObject) :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- ComponentStatementClassObject.__init__(self)
diff --git a/BaseTools/Source/Python/GenFds/CompressSection.py b/BaseTools/Source/Python/GenFds/CompressSection.py
deleted file mode 100644
index 4bcf286c23..0000000000
--- a/BaseTools/Source/Python/GenFds/CompressSection.py
+++ /dev/null
@@ -1,87 +0,0 @@
-## @file
-# process compress section generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from Ffs import Ffs
-import Section
-import subprocess
-import os
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from CommonDataClass.FdfClass import CompressSectionClassObject
-
-## generate compress section
-#
-#
-class CompressSection (CompressSectionClassObject) :
-
- ## compress types: PI standard and non PI standard
- CompTypeDict = {
- 'PI_STD' : 'PI_STD',
- 'PI_NONE' : 'PI_NONE'
- }
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- CompressSectionClassObject.__init__(self)
-
- ## GenSection() method
- #
- # Generate compressed section
- #
- # @param self The object pointer
- # @param OutputPath Where to place output file
- # @param ModuleName Which module this section belongs to
- # @param SecNum Index of section
- # @param KeyStringList Filter for inputs of section generation
- # @param FfsInf FfsInfStatement object that contains this section data
- # @param Dict dictionary contains macro and its value
- # @retval tuple (Generated file name, section alignment)
- #
- def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
-
- if FfsInf != None:
- self.CompType = FfsInf.__ExtendMacro__(self.CompType)
- self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)
-
- SectFiles = tuple()
- Index = 0
- for Sect in self.SectionList:
- Index = Index + 1
- SecIndex = '%s.%d' %(SecNum, Index)
- ReturnSectList, AlignValue = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, Dict)
- if ReturnSectList != []:
- for FileData in ReturnSectList:
- SectFiles += (FileData,)
-
-
- OutputFile = OutputPath + \
- os.sep + \
- ModuleName + \
- 'SEC' + \
- SecNum + \
- Ffs.SectionSuffix['COMPRESS']
- OutputFile = os.path.normpath(OutputFile)
-
- GenFdsGlobalVariable.GenerateSection(OutputFile, SectFiles, Section.Section.SectionType['COMPRESS'],
- CompressionType=self.CompTypeDict[self.CompType])
- OutputFileList = []
- OutputFileList.append(OutputFile)
- return OutputFileList, self.Alignment
-
-
diff --git a/BaseTools/Source/Python/GenFds/DataSection.py b/BaseTools/Source/Python/GenFds/DataSection.py
deleted file mode 100644
index 0f41953ad4..0000000000
--- a/BaseTools/Source/Python/GenFds/DataSection.py
+++ /dev/null
@@ -1,118 +0,0 @@
-## @file
-# process data section generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Section
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-import subprocess
-from Ffs import Ffs
-import os
-from CommonDataClass.FdfClass import DataSectionClassObject
-from Common.Misc import PeImageClass
-import shutil
-
-## generate data section
-#
-#
-class DataSection (DataSectionClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- DataSectionClassObject.__init__(self)
-
- ## GenSection() method
- #
- # Generate compressed section
- #
- # @param self The object pointer
- # @param OutputPath Where to place output file
- # @param ModuleName Which module this section belongs to
- # @param SecNum Index of section
- # @param KeyStringList Filter for inputs of section generation
- # @param FfsInf FfsInfStatement object that contains this section data
- # @param Dict dictionary contains macro and its value
- # @retval tuple (Generated file name list, section alignment)
- #
- def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}):
- #
- # Prepare the parameter of GenSection
- #
- if FfsFile != None:
- self.SectFileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.SectFileName)
- self.SectFileName = GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict, FfsFile.CurrentArch)
- else:
- self.SectFileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.SectFileName)
- self.SectFileName = GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)
-
- """Check Section file exist or not !"""
-
- if not os.path.exists(self.SectFileName):
- self.SectFileName = os.path.join (GenFdsGlobalVariable.WorkSpaceDir,
- self.SectFileName)
-
- """Copy Map file to Ffs output"""
- Filename = GenFdsGlobalVariable.MacroExtend(self.SectFileName)
- if Filename[(len(Filename)-4):] == '.efi':
- MapFile = Filename.replace('.efi', '.map')
- if os.path.exists(MapFile):
- CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')
- if not os.path.exists(CopyMapFile) or \
- (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):
- shutil.copyfile(MapFile, CopyMapFile)
-
- #Get PE Section alignment when align is set to AUTO
- if self.Alignment == 'Auto' and self.SecType in ('TE', 'PE32'):
- ImageObj = PeImageClass (Filename)
- if ImageObj.SectionAlignment < 0x400:
- self.Alignment = str (ImageObj.SectionAlignment)
- else:
- self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K'
-
- NoStrip = True
- if self.SecType in ('TE', 'PE32'):
- if self.KeepReloc != None:
- NoStrip = self.KeepReloc
-
- if not NoStrip:
- FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')
- if not os.path.exists(FileBeforeStrip) or \
- (os.path.getmtime(self.SectFileName) > os.path.getmtime(FileBeforeStrip)):
- shutil.copyfile(self.SectFileName, FileBeforeStrip)
- StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')
- GenFdsGlobalVariable.GenerateFirmwareImage(
- StrippedFile,
- [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)],
- Strip=True
- )
- self.SectFileName = StrippedFile
-
- if self.SecType == 'TE':
- TeFile = os.path.join( OutputPath, ModuleName + 'Te.raw')
- GenFdsGlobalVariable.GenerateFirmwareImage(
- TeFile,
- [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)],
- Type='te'
- )
- self.SectFileName = TeFile
-
- OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get(self.SecType))
- OutputFile = os.path.normpath(OutputFile)
-
- GenFdsGlobalVariable.GenerateSection(OutputFile, [self.SectFileName], Section.Section.SectionType.get(self.SecType))
- FileList = [OutputFile]
- return FileList, self.Alignment
diff --git a/BaseTools/Source/Python/GenFds/DepexSection.py b/BaseTools/Source/Python/GenFds/DepexSection.py
deleted file mode 100644
index b7b1ae7d93..0000000000
--- a/BaseTools/Source/Python/GenFds/DepexSection.py
+++ /dev/null
@@ -1,112 +0,0 @@
-## @file
-# process depex section generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Section
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-import subprocess
-from Ffs import Ffs
-import os
-from CommonDataClass.FdfClass import DepexSectionClassObject
-from AutoGen.GenDepex import DependencyExpression
-import shutil
-from Common import EdkLogger
-from Common.BuildToolError import *
-
-## generate data section
-#
-#
-class DepexSection (DepexSectionClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- DepexSectionClassObject.__init__(self)
-
- def __FindGuidValue(self, CName):
- for Arch in GenFdsGlobalVariable.ArchList:
- for PkgDb in GenFdsGlobalVariable.WorkSpace.GetPackageList(GenFdsGlobalVariable.ActivePlatform,
- Arch,
- GenFdsGlobalVariable.TargetName,
- GenFdsGlobalVariable.ToolChainTag):
- if CName in PkgDb.Ppis:
- return PkgDb.Ppis[CName]
- if CName in PkgDb.Protocols:
- return PkgDb.Protocols[CName]
- if CName in PkgDb.Guids:
- return PkgDb.Guids[CName]
- return None
-
- ## GenSection() method
- #
- # Generate compressed section
- #
- # @param self The object pointer
- # @param OutputPath Where to place output file
- # @param ModuleName Which module this section belongs to
- # @param SecNum Index of section
- # @param KeyStringList Filter for inputs of section generation
- # @param FfsInf FfsInfStatement object that contains this section data
- # @param Dict dictionary contains macro and its value
- # @retval tuple (Generated file name list, section alignment)
- #
- def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}):
-
- if self.ExpressionProcessed == False:
- self.Expression = self.Expression.replace("\n", " ").replace("\r", " ")
- ExpList = self.Expression.split()
- ExpGuidDict = {}
-
- for Exp in ExpList:
- if Exp.upper() not in ('AND', 'OR', 'NOT', 'TRUE', 'FALSE', 'SOR', 'BEFORE', 'AFTER', 'END'):
- GuidStr = self.__FindGuidValue(Exp)
- if GuidStr == None:
- EdkLogger.error("GenFds", RESOURCE_NOT_AVAILABLE,
- "Depex GUID %s could not be found in build DB! (ModuleName: %s)" % (Exp, ModuleName))
-
- ExpGuidDict[Exp] = GuidStr
-
- for Item in ExpGuidDict:
- self.Expression = self.Expression.replace(Item, ExpGuidDict[Item])
-
- self.Expression = self.Expression.strip()
- self.ExpressionProcessed = True
-
- if self.DepexType == 'PEI_DEPEX_EXP':
- ModuleType = 'PEIM'
- SecType = 'PEI_DEPEX'
- elif self.DepexType == 'DXE_DEPEX_EXP':
- ModuleType = 'DXE_DRIVER'
- SecType = 'DXE_DEPEX'
- elif self.DepexType == 'SMM_DEPEX_EXP':
- ModuleType = 'DXE_SMM_DRIVER'
- SecType = 'SMM_DEPEX'
- else:
- EdkLogger.error("GenFds", FORMAT_INVALID,
- "Depex type %s is not valid for module %s" % (self.DepexType, ModuleName))
-
- InputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.depex')
- InputFile = os.path.normpath(InputFile)
- Depex = DependencyExpression(self.Expression, ModuleType)
- Depex.Generate(InputFile)
-
- OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.dpx')
- OutputFile = os.path.normpath(OutputFile)
-
- GenFdsGlobalVariable.GenerateSection(OutputFile, [InputFile], Section.Section.SectionType.get (SecType))
- FileList = [OutputFile]
- return FileList, self.Alignment
diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Source/Python/GenFds/EfiSection.py
deleted file mode 100644
index 5419e11fce..0000000000
--- a/BaseTools/Source/Python/GenFds/EfiSection.py
+++ /dev/null
@@ -1,274 +0,0 @@
-## @file
-# process rule section generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from struct import *
-import Section
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-import subprocess
-from Ffs import Ffs
-import os
-from CommonDataClass.FdfClass import EfiSectionClassObject
-import shutil
-from Common import EdkLogger
-from Common.BuildToolError import *
-from Common.Misc import PeImageClass
-
-## generate rule section
-#
-#
-class EfiSection (EfiSectionClassObject):
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- EfiSectionClassObject.__init__(self)
-
- ## GenSection() method
- #
- # Generate rule section
- #
- # @param self The object pointer
- # @param OutputPath Where to place output file
- # @param ModuleName Which module this section belongs to
- # @param SecNum Index of section
- # @param KeyStringList Filter for inputs of section generation
- # @param FfsInf FfsInfStatement object that contains this section data
- # @param Dict dictionary contains macro and its value
- # @retval tuple (Generated file name list, section alignment)
- #
- def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}) :
-
- if self.FileName != None and self.FileName.startswith('PCD('):
- self.FileName = GenFdsGlobalVariable.GetPcdValue(self.FileName)
- """Prepare the parameter of GenSection"""
- if FfsInf != None :
- InfFileName = FfsInf.InfFileName
- SectionType = FfsInf.__ExtendMacro__(self.SectionType)
- Filename = FfsInf.__ExtendMacro__(self.FileName)
- BuildNum = FfsInf.__ExtendMacro__(self.BuildNum)
- StringData = FfsInf.__ExtendMacro__(self.StringData)
- NoStrip = True
- if FfsInf.ModuleType in ('SEC', 'PEI_CORE', 'PEIM') and SectionType in ('TE', 'PE32'):
- if FfsInf.KeepReloc != None:
- NoStrip = FfsInf.KeepReloc
- elif FfsInf.KeepRelocFromRule != None:
- NoStrip = FfsInf.KeepRelocFromRule
- elif self.KeepReloc != None:
- NoStrip = self.KeepReloc
- elif FfsInf.ShadowFromInfFile != None:
- NoStrip = FfsInf.ShadowFromInfFile
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s apply rule for None!" %ModuleName)
-
- """If the file name was pointed out, add it in FileList"""
- FileList = []
- if Filename != None:
- Filename = GenFdsGlobalVariable.MacroExtend(Filename, Dict)
- # check if the path is absolute or relative
- if os.path.isabs(Filename):
- Filename = os.path.normpath(Filename)
- else:
- Filename = os.path.normpath(os.path.join(FfsInf.EfiOutputPath, Filename))
-
- if not self.Optional:
- FileList.append(Filename)
- elif os.path.exists(Filename):
- FileList.append(Filename)
- else:
- FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FileType, self.FileExtension, Dict)
- if IsSect :
- return FileList, self.Alignment
-
- Index = 0
-
- """ If Section type is 'VERSION'"""
- OutputFileList = []
- if SectionType == 'VERSION':
-
- InfOverrideVerString = False
- if FfsInf.Version != None:
- #StringData = FfsInf.Version
- BuildNum = FfsInf.Version
- InfOverrideVerString = True
-
- if InfOverrideVerString:
- #VerTuple = ('-n', '"' + StringData + '"')
- if BuildNum != None and BuildNum != '':
- BuildNumTuple = ('-j', BuildNum)
- else:
- BuildNumTuple = tuple()
-
- Num = SecNum
- OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))
- GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_VERSION',
- #Ui=StringData,
- Ver=BuildNum)
- OutputFileList.append(OutputFile)
-
- elif FileList != []:
- for File in FileList:
- Index = Index + 1
- Num = '%s.%d' %(SecNum , Index)
- OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + Num + Ffs.SectionSuffix.get(SectionType))
- f = open(File, 'r')
- VerString = f.read()
- f.close()
- BuildNum = VerString
- if BuildNum != None and BuildNum != '':
- BuildNumTuple = ('-j', BuildNum)
- GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_VERSION',
- #Ui=VerString,
- Ver=BuildNum)
- OutputFileList.append(OutputFile)
-
- else:
- BuildNum = StringData
- if BuildNum != None and BuildNum != '':
- BuildNumTuple = ('-j', BuildNum)
- else:
- BuildNumTuple = tuple()
- BuildNumString = ' ' + ' '.join(BuildNumTuple)
-
- #if VerString == '' and
- if BuildNumString == '':
- if self.Optional == True :
- GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!")
- return [], None
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "File: %s miss Version Section value" %InfFileName)
- Num = SecNum
- OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))
- GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_VERSION',
- #Ui=VerString,
- Ver=BuildNum)
- OutputFileList.append(OutputFile)
-
- #
- # If Section Type is 'UI'
- #
- elif SectionType == 'UI':
-
- InfOverrideUiString = False
- if FfsInf.Ui != None:
- StringData = FfsInf.Ui
- InfOverrideUiString = True
-
- if InfOverrideUiString:
- Num = SecNum
- OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))
- GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',
- Ui=StringData)
- OutputFileList.append(OutputFile)
-
- elif FileList != []:
- for File in FileList:
- Index = Index + 1
- Num = '%s.%d' %(SecNum , Index)
- OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + Num + Ffs.SectionSuffix.get(SectionType))
- f = open(File, 'r')
- UiString = f.read()
- f.close()
- GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',
- Ui=UiString)
- OutputFileList.append(OutputFile)
- else:
- if StringData != None and len(StringData) > 0:
- UiTuple = ('-n', '"' + StringData + '"')
- else:
- UiTuple = tuple()
-
- if self.Optional == True :
- GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!")
- return '', None
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "File: %s miss UI Section value" %InfFileName)
-
- Num = SecNum
- OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))
- GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',
- Ui=StringData)
- OutputFileList.append(OutputFile)
-
-
- else:
- """If File List is empty"""
- if FileList == [] :
- if self.Optional == True:
- GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!")
- return [], None
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Output file for %s section could not be found for %s" % (SectionType, InfFileName))
-
- else:
- """Convert the File to Section file one by one """
- for File in FileList:
- """ Copy Map file to FFS output path """
- Index = Index + 1
- Num = '%s.%d' %(SecNum , Index)
- OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + Num + Ffs.SectionSuffix.get(SectionType))
- File = GenFdsGlobalVariable.MacroExtend(File, Dict)
-
- #Get PE Section alignment when align is set to AUTO
- if self.Alignment == 'Auto' and (SectionType == 'PE32' or SectionType == 'TE'):
- ImageObj = PeImageClass (File)
- if ImageObj.SectionAlignment < 0x400:
- self.Alignment = str (ImageObj.SectionAlignment)
- else:
- self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K'
-
- if File[(len(File)-4):] == '.efi':
- MapFile = File.replace('.efi', '.map')
- if os.path.exists(MapFile):
- CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')
- if not os.path.exists(CopyMapFile) or \
- (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):
- shutil.copyfile(MapFile, CopyMapFile)
-
- if not NoStrip:
- FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')
- if not os.path.exists(FileBeforeStrip) or \
- (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):
- shutil.copyfile(File, FileBeforeStrip)
- StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')
- GenFdsGlobalVariable.GenerateFirmwareImage(
- StrippedFile,
- [File],
- Strip=True
- )
- File = StrippedFile
-
- """For TE Section call GenFw to generate TE image"""
-
- if SectionType == 'TE':
- TeFile = os.path.join( OutputPath, ModuleName + 'Te.raw')
- GenFdsGlobalVariable.GenerateFirmwareImage(
- TeFile,
- [File],
- Type='te'
- )
- File = TeFile
-
- """Call GenSection"""
- GenFdsGlobalVariable.GenerateSection(OutputFile,
- [File],
- Section.Section.SectionType.get (SectionType)
- )
- OutputFileList.append(OutputFile)
-
- return OutputFileList, self.Alignment
diff --git a/BaseTools/Source/Python/GenFds/Fd.py b/BaseTools/Source/Python/GenFds/Fd.py
deleted file mode 100644
index 3716549cba..0000000000
--- a/BaseTools/Source/Python/GenFds/Fd.py
+++ /dev/null
@@ -1,199 +0,0 @@
-## @file
-# process FD generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Region
-import Fv
-import os
-import StringIO
-import sys
-from struct import *
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from CommonDataClass.FdfClass import FDClassObject
-from Common import EdkLogger
-from Common.BuildToolError import *
-from Common.Misc import SaveFileOnChange
-from GenFds import GenFds
-
-## generate FD
-#
-#
-class FD(FDClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- FDClassObject.__init__(self)
-
- ## GenFd() method
- #
- # Generate FD
- #
- # @retval string Generated FD file name
- #
- def GenFd (self):
- if self.FdUiName.upper() + 'fd' in GenFds.ImageBinDict.keys():
- return GenFds.ImageBinDict[self.FdUiName.upper() + 'fd']
-
- #
- # Print Information
- #
- GenFdsGlobalVariable.InfLogger("Fd File Name:%s" %self.FdUiName)
- Offset = 0x00
- for item in self.BlockSizeList:
- Offset = Offset + item[0] * item[1]
- if Offset != self.Size:
- EdkLogger.error("GenFds", GENFDS_ERROR, 'FD %s Size not consistent with block array' % self.FdUiName)
- GenFdsGlobalVariable.VerboseLogger('Following Fv will be add to Fd !!!')
- for FvObj in GenFdsGlobalVariable.FdfParser.Profile.FvDict:
- GenFdsGlobalVariable.VerboseLogger(FvObj)
-
- GenFdsGlobalVariable.VerboseLogger('################### Gen VTF ####################')
- self.GenVtfFile()
-
- TempFdBuffer = StringIO.StringIO('')
- PreviousRegionStart = -1
- PreviousRegionSize = 1
-
- for RegionObj in self.RegionList :
- if RegionObj.RegionType == 'CAPSULE':
- continue
- if RegionObj.Offset + RegionObj.Size <= PreviousRegionStart:
- pass
- elif RegionObj.Offset <= PreviousRegionStart or (RegionObj.Offset >=PreviousRegionStart and RegionObj.Offset < PreviousRegionStart + PreviousRegionSize):
- pass
- elif RegionObj.Offset > PreviousRegionStart + PreviousRegionSize:
- GenFdsGlobalVariable.InfLogger('Padding region starting from offset 0x%X, with size 0x%X' %(PreviousRegionStart + PreviousRegionSize, RegionObj.Offset - (PreviousRegionStart + PreviousRegionSize)))
- PadRegion = Region.Region()
- PadRegion.Offset = PreviousRegionStart + PreviousRegionSize
- PadRegion.Size = RegionObj.Offset - PadRegion.Offset
- PadRegion.AddToBuffer(TempFdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self.DefineVarDict)
- PreviousRegionStart = RegionObj.Offset
- PreviousRegionSize = RegionObj.Size
- #
- # Call each region's AddToBuffer function
- #
- if PreviousRegionSize > self.Size:
- pass
- GenFdsGlobalVariable.VerboseLogger('Call each region\'s AddToBuffer function')
- RegionObj.AddToBuffer (TempFdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self.DefineVarDict)
-
- FdBuffer = StringIO.StringIO('')
- PreviousRegionStart = -1
- PreviousRegionSize = 1
- for RegionObj in self.RegionList :
- if RegionObj.Offset + RegionObj.Size <= PreviousRegionStart:
- EdkLogger.error("GenFds", GENFDS_ERROR,
- 'Region offset 0x%X in wrong order with Region starting from 0x%X, size 0x%X\nRegions in FDF must have offsets appear in ascending order.'\
- % (RegionObj.Offset, PreviousRegionStart, PreviousRegionSize))
- elif RegionObj.Offset <= PreviousRegionStart or (RegionObj.Offset >=PreviousRegionStart and RegionObj.Offset < PreviousRegionStart + PreviousRegionSize):
- EdkLogger.error("GenFds", GENFDS_ERROR,
- 'Region offset 0x%X overlaps with Region starting from 0x%X, size 0x%X' \
- % (RegionObj.Offset, PreviousRegionStart, PreviousRegionSize))
- elif RegionObj.Offset > PreviousRegionStart + PreviousRegionSize:
- GenFdsGlobalVariable.InfLogger('Padding region starting from offset 0x%X, with size 0x%X' %(PreviousRegionStart + PreviousRegionSize, RegionObj.Offset - (PreviousRegionStart + PreviousRegionSize)))
- PadRegion = Region.Region()
- PadRegion.Offset = PreviousRegionStart + PreviousRegionSize
- PadRegion.Size = RegionObj.Offset - PadRegion.Offset
- PadRegion.AddToBuffer(FdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self.DefineVarDict)
- PreviousRegionStart = RegionObj.Offset
- PreviousRegionSize = RegionObj.Size
- #
- # Verify current region fits within allocated FD section Size
- #
- if PreviousRegionStart + PreviousRegionSize > self.Size:
- EdkLogger.error("GenFds", GENFDS_ERROR,
- 'FD %s size too small to fit region with offset 0x%X and size 0x%X'
- % (self.FdUiName, PreviousRegionStart, PreviousRegionSize))
- #
- # Call each region's AddToBuffer function
- #
- GenFdsGlobalVariable.VerboseLogger('Call each region\'s AddToBuffer function')
- RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, GenFds.ImageBinDict, self.vtfRawDict, self.DefineVarDict)
- #
- # Create a empty Fd file
- #
- GenFdsGlobalVariable.VerboseLogger ('Create an empty Fd file')
- FdFileName = os.path.join(GenFdsGlobalVariable.FvDir,self.FdUiName + '.fd')
- #
- # Write the buffer contents to Fd file
- #
- GenFdsGlobalVariable.VerboseLogger('Write the buffer contents to Fd file')
- SaveFileOnChange(FdFileName, FdBuffer.getvalue())
- FdBuffer.close();
- GenFds.ImageBinDict[self.FdUiName.upper() + 'fd'] = FdFileName
- return FdFileName
-
- ## generate VTF
- #
- # @param self The object pointer
- #
- def GenVtfFile (self) :
- #
- # Get this Fd's all Fv name
- #
- FvAddDict ={}
- FvList = []
- for RegionObj in self.RegionList:
- if RegionObj.RegionType == 'FV':
- if len(RegionObj.RegionDataList) == 1:
- RegionData = RegionObj.RegionDataList[0]
- FvList.append(RegionData.upper())
- FvAddDict[RegionData.upper()] = (int(self.BaseAddress,16) + \
- RegionObj.Offset, RegionObj.Size)
- else:
- Offset = RegionObj.Offset
- for RegionData in RegionObj.RegionDataList:
- FvList.append(RegionData.upper())
- FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(RegionData.upper())
- if len(FvObj.BlockSizeList) < 1:
- EdkLogger.error("GenFds", GENFDS_ERROR,
- 'FV.%s must point out FVs blocksize and Fv BlockNum' \
- % FvObj.UiFvName)
- else:
- Size = 0
- for blockStatement in FvObj.BlockSizeList:
- Size = Size + blockStatement[0] * blockStatement[1]
- FvAddDict[RegionData.upper()] = (int(self.BaseAddress,16) + \
- Offset, Size)
- Offset = Offset + Size
- #
- # Check whether this Fd need VTF
- #
- Flag = False
- for VtfObj in GenFdsGlobalVariable.FdfParser.Profile.VtfList:
- compLocList = VtfObj.GetFvList()
- if set(compLocList).issubset(FvList):
- Flag = True
- break
- if Flag == True:
- self.vtfRawDict = VtfObj.GenVtf(FvAddDict)
-
- ## generate flash map file
- #
- # @param self The object pointer
- #
- def GenFlashMap (self):
- pass
-
-
-
-
-
-
-
-
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
deleted file mode 100644
index a468a5ec99..0000000000
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ /dev/null
@@ -1,4407 +0,0 @@
-## @file
-# parse FDF file
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import re
-
-import Fd
-import Region
-import Fv
-import AprioriSection
-import FfsInfStatement
-import FfsFileStatement
-import VerSection
-import UiSection
-import FvImageSection
-import DataSection
-import DepexSection
-import CompressSection
-import GuidSection
-import Capsule
-import CapsuleData
-import Rule
-import RuleComplexFile
-import RuleSimpleFile
-import EfiSection
-import Vtf
-import ComponentStatement
-import OptionRom
-import OptRomInfStatement
-import OptRomFileStatement
-
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from Common.BuildToolError import *
-from Common import EdkLogger
-from Common.Misc import PathClass
-from Common.String import NormPath
-import Common.GlobalData as GlobalData
-from Common.Expression import *
-from Common import GlobalData
-from Common.String import ReplaceMacro
-
-from Common.Misc import tdict
-
-import re
-import os
-
-##define T_CHAR_SPACE ' '
-##define T_CHAR_NULL '\0'
-##define T_CHAR_CR '\r'
-##define T_CHAR_TAB '\t'
-##define T_CHAR_LF '\n'
-##define T_CHAR_SLASH '/'
-##define T_CHAR_BACKSLASH '\\'
-##define T_CHAR_DOUBLE_QUOTE '\"'
-##define T_CHAR_SINGLE_QUOTE '\''
-##define T_CHAR_STAR '*'
-##define T_CHAR_HASH '#'
-
-(T_CHAR_SPACE, T_CHAR_NULL, T_CHAR_CR, T_CHAR_TAB, T_CHAR_LF, T_CHAR_SLASH, \
-T_CHAR_BACKSLASH, T_CHAR_DOUBLE_QUOTE, T_CHAR_SINGLE_QUOTE, T_CHAR_STAR, T_CHAR_HASH) = \
-(' ', '\0', '\r', '\t', '\n', '/', '\\', '\"', '\'', '*', '#')
-
-SEPERATOR_TUPLE = ('=', '|', ',', '{', '}')
-
-RegionSizePattern = re.compile("\s*(?P<base>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<size>(?:0x|0X)?[a-fA-F0-9]+)\s*")
-RegionSizeGuidPattern = re.compile("\s*(?P<base>\w+\.\w+)\s*\|\s*(?P<size>\w+\.\w+)\s*")
-ShortcutPcdPattern = re.compile("\s*\w+\s*=\s*(?P<value>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<name>\w+\.\w+)\s*")
-
-IncludeFileList = []
-
-def GetRealFileLine (File, Line):
-
- InsertedLines = 0
- for Profile in IncludeFileList:
- if Line >= Profile.InsertStartLineNumber and Line < Profile.InsertStartLineNumber + Profile.InsertAdjust + len(Profile.FileLinesList):
- return (Profile.FileName, Line - Profile.InsertStartLineNumber + 1)
- if Line >= Profile.InsertStartLineNumber + Profile.InsertAdjust + len(Profile.FileLinesList):
- InsertedLines += Profile.InsertAdjust + len(Profile.FileLinesList)
-
- return (File, Line - InsertedLines)
-
-## The exception class that used to report error messages when parsing FDF
-#
-# Currently the "ToolName" is set to be "FDF Parser".
-#
-class Warning (Exception):
- ## The constructor
- #
- # @param self The object pointer
- # @param Str The message to record
- # @param File The FDF name
- # @param Line The Line number that error occurs
- #
- def __init__(self, Str, File = None, Line = None):
-
- FileLineTuple = GetRealFileLine(File, Line)
- self.FileName = FileLineTuple[0]
- self.LineNumber = FileLineTuple[1]
- self.Message = Str
- self.ToolName = 'FdfParser'
-
- def __str__(self):
- return self.Message
-
-## The MACRO class that used to record macro value data when parsing include file
-#
-#
-class MacroProfile :
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName, Line):
- self.FileName = FileName
- self.DefinedAtLine = Line
- self.MacroName = None
- self.MacroValue = None
-
-## The Include file content class that used to record file data when parsing include file
-#
-# May raise Exception when opening file.
-#
-class IncludeFileProfile :
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName):
- self.FileName = FileName
- self.FileLinesList = []
- try:
- fsock = open(FileName, "rb", 0)
- try:
- self.FileLinesList = fsock.readlines()
- finally:
- fsock.close()
-
- except:
- EdkLogger.error("FdfParser", FILE_OPEN_FAILURE, ExtraData=FileName)
-
- self.InsertStartLineNumber = None
- self.InsertAdjust = 0
-
-## The FDF content class that used to record file data when parsing FDF
-#
-# May raise Exception when opening file.
-#
-class FileProfile :
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName):
- self.FileLinesList = []
- try:
- fsock = open(FileName, "rb", 0)
- try:
- self.FileLinesList = fsock.readlines()
- finally:
- fsock.close()
-
- except:
- EdkLogger.error("FdfParser", FILE_OPEN_FAILURE, ExtraData=FileName)
-
-
- self.PcdDict = {}
- self.InfList = []
- # ECC will use this Dict and List information
- self.PcdFileLineDict = {}
- self.InfFileLineList = []
-
- self.FdDict = {}
- self.FdNameNotSet = False
- self.FvDict = {}
- self.CapsuleDict = {}
- self.VtfList = []
- self.RuleDict = {}
- self.OptRomDict = {}
-
-## The syntax parser for FDF
-#
-# PreprocessFile method should be called prior to ParseFile
-# CycleReferenceCheck method can detect cycles in FDF contents
-#
-# GetNext*** procedures mean these procedures will get next token first, then make judgement.
-# Get*** procedures mean these procedures will make judgement on current token only.
-#
-class FdfParser:
- ## The constructor
- #
- # @param self The object pointer
- # @param FileName The file that to be parsed
- #
- def __init__(self, FileName):
- self.Profile = FileProfile(FileName)
- self.FileName = FileName
- self.CurrentLineNumber = 1
- self.CurrentOffsetWithinLine = 0
- self.CurrentFdName = None
- self.CurrentFvName = None
- self.__Token = ""
- self.__SkippedChars = ""
-
- # Used to section info
- self.__CurSection = []
- # Key: [section name, UI name, arch]
- # Value: {MACRO_NAME : MACRO_VALUE}
- self.__MacroDict = tdict(True, 3)
- self.__PcdDict = {}
-
- self.__WipeOffArea = []
- if GenFdsGlobalVariable.WorkSpaceDir == '':
- GenFdsGlobalVariable.WorkSpaceDir = os.getenv("WORKSPACE")
-
- ## __IsWhiteSpace() method
- #
- # Whether char at current FileBufferPos is whitespace
- #
- # @param self The object pointer
- # @param Char The char to test
- # @retval True The char is a kind of white space
- # @retval False The char is NOT a kind of white space
- #
- def __IsWhiteSpace(self, Char):
- if Char in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_SPACE, T_CHAR_TAB, T_CHAR_LF):
- return True
- else:
- return False
-
- ## __SkipWhiteSpace() method
- #
- # Skip white spaces from current char, return number of chars skipped
- #
- # @param self The object pointer
- # @retval Count The number of chars skipped
- #
- def __SkipWhiteSpace(self):
- Count = 0
- while not self.__EndOfFile():
- Count += 1
- if self.__CurrentChar() in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_LF, T_CHAR_SPACE, T_CHAR_TAB):
- self.__SkippedChars += str(self.__CurrentChar())
- self.__GetOneChar()
-
- else:
- Count = Count - 1
- return Count
-
- ## __EndOfFile() method
- #
- # Judge current buffer pos is at file end
- #
- # @param self The object pointer
- # @retval True Current File buffer position is at file end
- # @retval False Current File buffer position is NOT at file end
- #
- def __EndOfFile(self):
- NumberOfLines = len(self.Profile.FileLinesList)
- SizeOfLastLine = len(self.Profile.FileLinesList[-1])
- if self.CurrentLineNumber == NumberOfLines and self.CurrentOffsetWithinLine >= SizeOfLastLine - 1:
- return True
- elif self.CurrentLineNumber > NumberOfLines:
- return True
- else:
- return False
-
- ## __EndOfLine() method
- #
- # Judge current buffer pos is at line end
- #
- # @param self The object pointer
- # @retval True Current File buffer position is at line end
- # @retval False Current File buffer position is NOT at line end
- #
- def __EndOfLine(self):
- if self.CurrentLineNumber > len(self.Profile.FileLinesList):
- return True
- SizeOfCurrentLine = len(self.Profile.FileLinesList[self.CurrentLineNumber - 1])
- if self.CurrentOffsetWithinLine >= SizeOfCurrentLine:
- return True
- else:
- return False
-
- ## Rewind() method
- #
- # Reset file data buffer to the initial state
- #
- # @param self The object pointer
- #
- def Rewind(self):
- self.CurrentLineNumber = 1
- self.CurrentOffsetWithinLine = 0
-
- ## __UndoOneChar() method
- #
- # Go back one char in the file buffer
- #
- # @param self The object pointer
- # @retval True Successfully go back one char
- # @retval False Not able to go back one char as file beginning reached
- #
- def __UndoOneChar(self):
-
- if self.CurrentLineNumber == 1 and self.CurrentOffsetWithinLine == 0:
- return False
- elif self.CurrentOffsetWithinLine == 0:
- self.CurrentLineNumber -= 1
- self.CurrentOffsetWithinLine = len(self.__CurrentLine()) - 1
- else:
- self.CurrentOffsetWithinLine -= 1
- return True
-
- ## __GetOneChar() method
- #
- # Move forward one char in the file buffer
- #
- # @param self The object pointer
- #
- def __GetOneChar(self):
- if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
- else:
- self.CurrentOffsetWithinLine += 1
-
- ## __CurrentChar() method
- #
- # Get the char pointed to by the file buffer pointer
- #
- # @param self The object pointer
- # @retval Char Current char
- #
- def __CurrentChar(self):
- return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine]
-
- ## __NextChar() method
- #
- # Get the one char pass the char pointed to by the file buffer pointer
- #
- # @param self The object pointer
- # @retval Char Next char
- #
- def __NextChar(self):
- if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
- return self.Profile.FileLinesList[self.CurrentLineNumber][0]
- else:
- return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine + 1]
-
- ## __SetCurrentCharValue() method
- #
- # Modify the value of current char
- #
- # @param self The object pointer
- # @param Value The new value of current char
- #
- def __SetCurrentCharValue(self, Value):
- self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine] = Value
-
- ## __CurrentLine() method
- #
- # Get the list that contains current line contents
- #
- # @param self The object pointer
- # @retval List current line contents
- #
- def __CurrentLine(self):
- return self.Profile.FileLinesList[self.CurrentLineNumber - 1]
-
- def __StringToList(self):
- self.Profile.FileLinesList = [list(s) for s in self.Profile.FileLinesList]
- self.Profile.FileLinesList[-1].append(' ')
-
- def __ReplaceFragment(self, StartPos, EndPos, Value = ' '):
- if StartPos[0] == EndPos[0]:
- Offset = StartPos[1]
- while Offset <= EndPos[1]:
- self.Profile.FileLinesList[StartPos[0]][Offset] = Value
- Offset += 1
- return
-
- Offset = StartPos[1]
- while self.Profile.FileLinesList[StartPos[0]][Offset] not in ('\r', '\n'):
- self.Profile.FileLinesList[StartPos[0]][Offset] = Value
- Offset += 1
-
- Line = StartPos[0]
- while Line < EndPos[0]:
- Offset = 0
- while self.Profile.FileLinesList[Line][Offset] not in ('\r', '\n'):
- self.Profile.FileLinesList[Line][Offset] = Value
- Offset += 1
- Line += 1
-
- Offset = 0
- while Offset <= EndPos[1]:
- self.Profile.FileLinesList[EndPos[0]][Offset] = Value
- Offset += 1
-
-
- def __GetMacroName(self):
- if not self.__GetNextToken():
- raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)
- MacroName = self.__Token
- NotFlag = False
- if MacroName.startswith('!'):
- NotFlag = True
- MacroName = MacroName[1:].strip()
-
- if not MacroName.startswith('$(') or not MacroName.endswith(')'):
- raise Warning("Macro name expected(Please use '$(%(Token)s)' if '%(Token)s' is a macro.)" % {"Token" : MacroName},
- self.FileName, self.CurrentLineNumber)
- MacroName = MacroName[2:-1]
- return MacroName, NotFlag
-
- def __SetMacroValue(self, Macro, Value):
- if not self.__CurSection:
- return
-
- MacroDict = {}
- if not self.__MacroDict[self.__CurSection[0], self.__CurSection[1], self.__CurSection[2]]:
- self.__MacroDict[self.__CurSection[0], self.__CurSection[1], self.__CurSection[2]] = MacroDict
- else:
- MacroDict = self.__MacroDict[self.__CurSection[0], self.__CurSection[1], self.__CurSection[2]]
- MacroDict[Macro] = Value
-
- def __GetMacroValue(self, Macro):
- # Highest priority
- if Macro in GlobalData.gCommandLineDefines:
- return GlobalData.gCommandLineDefines[Macro]
- if Macro in GlobalData.gGlobalDefines:
- return GlobalData.gGlobalDefines[Macro]
-
- if self.__CurSection:
- MacroDict = self.__MacroDict[
- self.__CurSection[0],
- self.__CurSection[1],
- self.__CurSection[2]
- ]
- if MacroDict and Macro in MacroDict:
- return MacroDict[Macro]
-
- # Lowest priority
- if Macro in GlobalData.gPlatformDefines:
- return GlobalData.gPlatformDefines[Macro]
- return None
-
- def __SectionHeaderParser(self, Section):
- # [Defines]
- # [FD.UiName]: use dummy instead if UI name is optional
- # [FV.UiName]
- # [Capsule.UiName]
- # [Rule]: don't take rule section into account, macro is not allowed in this section
- # [VTF.arch.UiName, arch]
- # [OptionRom.DriverName]
- self.__CurSection = []
- Section = Section.strip()[1:-1].upper().replace(' ', '').strip('.')
- ItemList = Section.split('.')
- Item = ItemList[0]
- if Item == '' or Item == 'RULE':
- return
-
- if Item == 'DEFINES':
- self.__CurSection = ['COMMON', 'COMMON', 'COMMON']
- elif Item == 'VTF' and len(ItemList) == 3:
- UiName = ItemList[2]
- Pos = UiName.find(',')
- if Pos != -1:
- UiName = UiName[:Pos]
- self.__CurSection = ['VTF', UiName, ItemList[1]]
- elif len(ItemList) > 1:
- self.__CurSection = [ItemList[0], ItemList[1], 'COMMON']
- elif len(ItemList) > 0:
- self.__CurSection = [ItemList[0], 'DUMMY', 'COMMON']
-
- ## PreprocessFile() method
- #
- # Preprocess file contents, replace comments with spaces.
- # In the end, rewind the file buffer pointer to the beginning
- # BUGBUG: No !include statement processing contained in this procedure
- # !include statement should be expanded at the same FileLinesList[CurrentLineNumber - 1]
- #
- # @param self The object pointer
- #
- def PreprocessFile(self):
-
- self.Rewind()
- InComment = False
- DoubleSlashComment = False
- HashComment = False
- # HashComment in quoted string " " is ignored.
- InString = False
-
- while not self.__EndOfFile():
-
- if self.__CurrentChar() == T_CHAR_DOUBLE_QUOTE and not InComment:
- InString = not InString
- # meet new line, then no longer in a comment for // and '#'
- if self.__CurrentChar() == T_CHAR_LF:
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
- if InComment and DoubleSlashComment:
- InComment = False
- DoubleSlashComment = False
- if InComment and HashComment:
- InComment = False
- HashComment = False
- # check for */ comment end
- elif InComment and not DoubleSlashComment and not HashComment and self.__CurrentChar() == T_CHAR_STAR and self.__NextChar() == T_CHAR_SLASH:
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- InComment = False
- # set comments to spaces
- elif InComment:
- self.__SetCurrentCharValue(T_CHAR_SPACE)
- self.__GetOneChar()
- # check for // comment
- elif self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_SLASH and not self.__EndOfLine():
- InComment = True
- DoubleSlashComment = True
- # check for '#' comment
- elif self.__CurrentChar() == T_CHAR_HASH and not self.__EndOfLine() and not InString:
- InComment = True
- HashComment = True
- # check for /* comment start
- elif self.__CurrentChar() == T_CHAR_SLASH and self.__NextChar() == T_CHAR_STAR:
- self.__SetCurrentCharValue( T_CHAR_SPACE)
- self.__GetOneChar()
- self.__SetCurrentCharValue( T_CHAR_SPACE)
- self.__GetOneChar()
- InComment = True
- else:
- self.__GetOneChar()
-
- # restore from ListOfList to ListOfString
- self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList]
- self.Rewind()
-
- ## PreprocessIncludeFile() method
- #
- # Preprocess file contents, replace !include statements with file contents.
- # In the end, rewind the file buffer pointer to the beginning
- #
- # @param self The object pointer
- #
- def PreprocessIncludeFile(self):
-
- while self.__GetNextToken():
-
- if self.__Token == '!include':
- IncludeLine = self.CurrentLineNumber
- IncludeOffset = self.CurrentOffsetWithinLine - len('!include')
- if not self.__GetNextToken():
- raise Warning("expected include file name", self.FileName, self.CurrentLineNumber)
- IncFileName = self.__Token
- __IncludeMacros = {}
- for Macro in ['WORKSPACE', 'ECP_SOURCE', 'EFI_SOURCE', 'EDK_SOURCE']:
- MacroVal = self.__GetMacroValue(Macro)
- if MacroVal:
- __IncludeMacros[Macro] = MacroVal
-
- try:
- IncludedFile = NormPath(ReplaceMacro(IncFileName, __IncludeMacros, RaiseError=True))
- except:
- raise Warning("only these system environment variables are permitted to start the path of the included file: "
- "$(WORKSPACE), $(ECP_SOURCE), $(EFI_SOURCE), $(EDK_SOURCE)",
- self.FileName, self.CurrentLineNumber)
- #
- # First search the include file under the same directory as FDF file
- #
- IncludedFile1 = PathClass(IncludedFile, os.path.dirname(self.FileName))
- ErrorCode = IncludedFile1.Validate()[0]
- if ErrorCode != 0:
- #
- # Then search the include file under the same directory as DSC file
- #
- PlatformDir = ''
- if GenFdsGlobalVariable.ActivePlatform:
- PlatformDir = GenFdsGlobalVariable.ActivePlatform.Dir
- elif GlobalData.gActivePlatform:
- PlatformDir = GlobalData.gActivePlatform.MetaFile.Dir
- IncludedFile1 = PathClass(IncludedFile, PlatformDir)
- ErrorCode = IncludedFile1.Validate()[0]
- if ErrorCode != 0:
- #
- # Also search file under the WORKSPACE directory
- #
- IncludedFile1 = PathClass(IncludedFile, GlobalData.gWorkspace)
- ErrorCode = IncludedFile1.Validate()[0]
- if ErrorCode != 0:
- raise Warning("The include file does not exist under below directories: \n%s\n%s\n%s\n"%(os.path.dirname(self.FileName), PlatformDir, GlobalData.gWorkspace),
- self.FileName, self.CurrentLineNumber)
-
- IncFileProfile = IncludeFileProfile(IncludedFile1.Path)
-
- CurrentLine = self.CurrentLineNumber
- CurrentOffset = self.CurrentOffsetWithinLine
- # list index of the insertion, note that line number is 'CurrentLine + 1'
- InsertAtLine = CurrentLine
- IncFileProfile.InsertStartLineNumber = InsertAtLine + 1
- # deal with remaining portions after "!include filename", if exists.
- if self.__GetNextToken():
- if self.CurrentLineNumber == CurrentLine:
- RemainingLine = self.__CurrentLine()[CurrentOffset:]
- self.Profile.FileLinesList.insert(self.CurrentLineNumber, RemainingLine)
- IncFileProfile.InsertAdjust += 1
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
-
- for Line in IncFileProfile.FileLinesList:
- self.Profile.FileLinesList.insert(InsertAtLine, Line)
- self.CurrentLineNumber += 1
- InsertAtLine += 1
-
- IncludeFileList.append(IncFileProfile)
-
- # comment out the processed include file statement
- TempList = list(self.Profile.FileLinesList[IncludeLine - 1])
- TempList.insert(IncludeOffset, '#')
- self.Profile.FileLinesList[IncludeLine - 1] = ''.join(TempList)
-
- self.Rewind()
-
- def __GetIfListCurrentItemStat(self, IfList):
- if len(IfList) == 0:
- return True
-
- for Item in IfList:
- if Item[1] == False:
- return False
-
- return True
-
- ## PreprocessConditionalStatement() method
- #
- # Preprocess conditional statement.
- # In the end, rewind the file buffer pointer to the beginning
- #
- # @param self The object pointer
- #
- def PreprocessConditionalStatement(self):
- # IfList is a stack of if branches with elements of list [Pos, CondSatisfied, BranchDetermined]
- IfList = []
- RegionLayoutLine = 0
- ReplacedLine = -1
- while self.__GetNextToken():
- # Determine section name and the location dependent macro
- if self.__GetIfListCurrentItemStat(IfList):
- if self.__Token.startswith('['):
- Header = self.__Token
- if not self.__Token.endswith(']'):
- self.__SkipToToken(']')
- Header += self.__SkippedChars
- if Header.find('$(') != -1:
- raise Warning("macro cannot be used in section header", self.FileName, self.CurrentLineNumber)
- self.__SectionHeaderParser(Header)
- continue
- # Replace macros except in RULE section or out of section
- elif self.__CurSection and ReplacedLine != self.CurrentLineNumber:
- ReplacedLine = self.CurrentLineNumber
- self.__UndoToken()
- CurLine = self.Profile.FileLinesList[ReplacedLine - 1]
- PreIndex = 0
- StartPos = CurLine.find('$(', PreIndex)
- EndPos = CurLine.find(')', StartPos+2)
- while StartPos != -1 and EndPos != -1 and self.__Token not in ['!ifdef', '!ifndef', '!if', '!elseif']:
- MacroName = CurLine[StartPos+2 : EndPos]
- MacorValue = self.__GetMacroValue(MacroName)
- if MacorValue != None:
- CurLine = CurLine.replace('$(' + MacroName + ')', MacorValue, 1)
- if MacorValue.find('$(') != -1:
- PreIndex = StartPos
- else:
- PreIndex = StartPos + len(MacorValue)
- else:
- PreIndex = EndPos + 1
- StartPos = CurLine.find('$(', PreIndex)
- EndPos = CurLine.find(')', StartPos+2)
- self.Profile.FileLinesList[ReplacedLine - 1] = CurLine
- continue
-
- if self.__Token == 'DEFINE':
- if self.__GetIfListCurrentItemStat(IfList):
- if not self.__CurSection:
- raise Warning("macro cannot be defined in Rule section or out of section", self.FileName, self.CurrentLineNumber)
- DefineLine = self.CurrentLineNumber - 1
- DefineOffset = self.CurrentOffsetWithinLine - len('DEFINE')
- if not self.__GetNextToken():
- raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)
- Macro = self.__Token
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- Value = self.__GetExpression()
- self.__SetMacroValue(Macro, Value)
- self.__WipeOffArea.append(((DefineLine, DefineOffset), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
- elif self.__Token == 'SET':
- SetLine = self.CurrentLineNumber - 1
- SetOffset = self.CurrentOffsetWithinLine - len('SET')
- PcdPair = self.__GetNextPcdName()
- PcdName = "%s.%s" % (PcdPair[1], PcdPair[0])
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- Value = self.__GetExpression()
- Value = self.__EvaluateConditional(Value, self.CurrentLineNumber, 'eval', True)
-
- self.__PcdDict[PcdName] = Value
-
- self.Profile.PcdDict[PcdPair] = Value
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[PcdPair] = FileLineTuple
-
- self.__WipeOffArea.append(((SetLine, SetOffset), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
- elif self.__Token in ('!ifdef', '!ifndef', '!if'):
- IfStartPos = (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - len(self.__Token))
- IfList.append([IfStartPos, None, None])
-
- CondLabel = self.__Token
- Expression = self.__GetExpression()
-
- if CondLabel == '!if':
- ConditionSatisfied = self.__EvaluateConditional(Expression, IfList[-1][0][0] + 1, 'eval')
- else:
- ConditionSatisfied = self.__EvaluateConditional(Expression, IfList[-1][0][0] + 1, 'in')
- if CondLabel == '!ifndef':
- ConditionSatisfied = not ConditionSatisfied
-
- BranchDetermined = ConditionSatisfied
- IfList[-1] = [IfList[-1][0], ConditionSatisfied, BranchDetermined]
- if ConditionSatisfied:
- self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
- elif self.__Token in ('!elseif', '!else'):
- ElseStartPos = (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - len(self.__Token))
- if len(IfList) <= 0:
- raise Warning("Missing !if statement", self.FileName, self.CurrentLineNumber)
-
- if IfList[-1][1]:
- IfList[-1] = [ElseStartPos, False, True]
- self.__WipeOffArea.append((ElseStartPos, (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
- else:
- self.__WipeOffArea.append((IfList[-1][0], ElseStartPos))
- IfList[-1] = [ElseStartPos, True, IfList[-1][2]]
- if self.__Token == '!elseif':
- Expression = self.__GetExpression()
- ConditionSatisfied = self.__EvaluateConditional(Expression, IfList[-1][0][0] + 1, 'eval')
- IfList[-1] = [IfList[-1][0], ConditionSatisfied, IfList[-1][2]]
-
- if IfList[-1][1]:
- if IfList[-1][2]:
- IfList[-1][1] = False
- else:
- IfList[-1][2] = True
- self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
- elif self.__Token == '!endif':
- if len(IfList) <= 0:
- raise Warning("Missing !if statement", self.FileName, self.CurrentLineNumber)
- if IfList[-1][1]:
- self.__WipeOffArea.append(((self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - len('!endif')), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
- else:
- self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
-
- IfList.pop()
- elif not IfList: # Don't use PCDs inside conditional directive
- if self.CurrentLineNumber <= RegionLayoutLine:
- # Don't try the same line twice
- continue
- SetPcd = ShortcutPcdPattern.match(self.Profile.FileLinesList[self.CurrentLineNumber - 1])
- if SetPcd:
- self.__PcdDict[SetPcd.group('name')] = SetPcd.group('value')
- RegionLayoutLine = self.CurrentLineNumber
- continue
- RegionSize = RegionSizePattern.match(self.Profile.FileLinesList[self.CurrentLineNumber - 1])
- if not RegionSize:
- RegionLayoutLine = self.CurrentLineNumber
- continue
- RegionSizeGuid = RegionSizeGuidPattern.match(self.Profile.FileLinesList[self.CurrentLineNumber])
- if not RegionSizeGuid:
- RegionLayoutLine = self.CurrentLineNumber + 1
- continue
- self.__PcdDict[RegionSizeGuid.group('base')] = RegionSize.group('base')
- self.__PcdDict[RegionSizeGuid.group('size')] = RegionSize.group('size')
- RegionLayoutLine = self.CurrentLineNumber + 1
-
- if IfList:
- raise Warning("Missing !endif", self.FileName, self.CurrentLineNumber)
- self.Rewind()
-
- def __CollectMacroPcd(self):
- MacroDict = {}
-
- # PCD macro
- MacroDict.update(GlobalData.gPlatformPcds)
- MacroDict.update(self.__PcdDict)
-
- # Lowest priority
- MacroDict.update(GlobalData.gPlatformDefines)
-
- if self.__CurSection:
- # Defines macro
- ScopeMacro = self.__MacroDict['COMMON', 'COMMON', 'COMMON']
- if ScopeMacro:
- MacroDict.update(ScopeMacro)
-
- # Section macro
- ScopeMacro = self.__MacroDict[
- self.__CurSection[0],
- self.__CurSection[1],
- self.__CurSection[2]
- ]
- if ScopeMacro:
- MacroDict.update(ScopeMacro)
-
- MacroDict.update(GlobalData.gGlobalDefines)
- MacroDict.update(GlobalData.gCommandLineDefines)
- # Highest priority
-
- return MacroDict
-
- def __EvaluateConditional(self, Expression, Line, Op = None, Value = None):
- FileLineTuple = GetRealFileLine(self.FileName, Line)
- MacroPcdDict = self.__CollectMacroPcd()
- if Op == 'eval':
- try:
- if Value:
- return ValueExpression(Expression, MacroPcdDict)(True)
- else:
- return ValueExpression(Expression, MacroPcdDict)()
- except WrnExpression, Excpt:
- #
- # Catch expression evaluation warning here. We need to report
- # the precise number of line and return the evaluation result
- #
- EdkLogger.warn('Parser', "Suspicious expression: %s" % str(Excpt),
- File=self.FileName, ExtraData=self.__CurrentLine(),
- Line=Line)
- return Excpt.result
- except Exception, Excpt:
- if hasattr(Excpt, 'Pcd'):
- if Excpt.Pcd in GlobalData.gPlatformOtherPcds:
- Info = GlobalData.gPlatformOtherPcds[Excpt.Pcd]
- raise Warning("Cannot use this PCD (%s) in an expression as"
- " it must be defined in a [PcdsFixedAtBuild] or [PcdsFeatureFlag] section"
- " of the DSC file (%s), and it is currently defined in this section:"
- " %s, line #: %d." % (Excpt.Pcd, GlobalData.gPlatformOtherPcds['DSCFILE'], Info[0], Info[1]),
- *FileLineTuple)
- else:
- raise Warning("PCD (%s) is not defined in DSC file (%s)" % (Excpt.Pcd, GlobalData.gPlatformOtherPcds['DSCFILE']),
- *FileLineTuple)
- else:
- raise Warning(str(Excpt), *FileLineTuple)
- else:
- if Expression.startswith('$(') and Expression[-1] == ')':
- Expression = Expression[2:-1]
- return Expression in MacroPcdDict
-
- ## __IsToken() method
- #
- # Check whether input string is found from current char position along
- # If found, the string value is put into self.__Token
- #
- # @param self The object pointer
- # @param String The string to search
- # @param IgnoreCase Indicate case sensitive/non-sensitive search, default is case sensitive
- # @retval True Successfully find string, file buffer pointer moved forward
- # @retval False Not able to find string, file buffer pointer not changed
- #
- def __IsToken(self, String, IgnoreCase = False):
- self.__SkipWhiteSpace()
-
- # Only consider the same line, no multi-line token allowed
- StartPos = self.CurrentOffsetWithinLine
- index = -1
- if IgnoreCase:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].upper().find(String.upper())
- else:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].find(String)
- if index == 0:
- self.CurrentOffsetWithinLine += len(String)
- self.__Token = self.__CurrentLine()[StartPos : self.CurrentOffsetWithinLine]
- return True
- return False
-
- ## __IsKeyword() method
- #
- # Check whether input keyword is found from current char position along, whole word only!
- # If found, the string value is put into self.__Token
- #
- # @param self The object pointer
- # @param Keyword The string to search
- # @param IgnoreCase Indicate case sensitive/non-sensitive search, default is case sensitive
- # @retval True Successfully find string, file buffer pointer moved forward
- # @retval False Not able to find string, file buffer pointer not changed
- #
- def __IsKeyword(self, KeyWord, IgnoreCase = False):
- self.__SkipWhiteSpace()
-
- # Only consider the same line, no multi-line token allowed
- StartPos = self.CurrentOffsetWithinLine
- index = -1
- if IgnoreCase:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].upper().find(KeyWord.upper())
- else:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].find(KeyWord)
- if index == 0:
- followingChar = self.__CurrentLine()[self.CurrentOffsetWithinLine + len(KeyWord)]
- if not str(followingChar).isspace() and followingChar not in SEPERATOR_TUPLE:
- return False
- self.CurrentOffsetWithinLine += len(KeyWord)
- self.__Token = self.__CurrentLine()[StartPos : self.CurrentOffsetWithinLine]
- return True
- return False
-
- def __GetExpression(self):
- Line = self.Profile.FileLinesList[self.CurrentLineNumber - 1]
- Index = len(Line) - 1
- while Line[Index] in ['\r', '\n']:
- Index -= 1
- ExpressionString = self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine:Index+1]
- self.CurrentOffsetWithinLine += len(ExpressionString)
- ExpressionString = ExpressionString.strip()
- return ExpressionString
-
- ## __GetNextWord() method
- #
- # Get next C name from file lines
- # If found, the string value is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a C name string, file buffer pointer moved forward
- # @retval False Not able to find a C name string, file buffer pointer not changed
- #
- def __GetNextWord(self):
- self.__SkipWhiteSpace()
- if self.__EndOfFile():
- return False
-
- TempChar = self.__CurrentChar()
- StartPos = self.CurrentOffsetWithinLine
- if (TempChar >= 'a' and TempChar <= 'z') or (TempChar >= 'A' and TempChar <= 'Z') or TempChar == '_':
- self.__GetOneChar()
- while not self.__EndOfLine():
- TempChar = self.__CurrentChar()
- if (TempChar >= 'a' and TempChar <= 'z') or (TempChar >= 'A' and TempChar <= 'Z') \
- or (TempChar >= '0' and TempChar <= '9') or TempChar == '_' or TempChar == '-':
- self.__GetOneChar()
-
- else:
- break
-
- self.__Token = self.__CurrentLine()[StartPos : self.CurrentOffsetWithinLine]
- return True
-
- return False
-
- ## __GetNextToken() method
- #
- # Get next token unit before a seperator
- # If found, the string value is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a token unit, file buffer pointer moved forward
- # @retval False Not able to find a token unit, file buffer pointer not changed
- #
- def __GetNextToken(self):
- # Skip leading spaces, if exist.
- self.__SkipWhiteSpace()
- if self.__EndOfFile():
- return False
- # Record the token start position, the position of the first non-space char.
- StartPos = self.CurrentOffsetWithinLine
- StartLine = self.CurrentLineNumber
- while StartLine == self.CurrentLineNumber:
- TempChar = self.__CurrentChar()
- # Try to find the end char that is not a space and not in seperator tuple.
- # That is, when we got a space or any char in the tuple, we got the end of token.
- if not str(TempChar).isspace() and TempChar not in SEPERATOR_TUPLE:
- self.__GetOneChar()
- # if we happen to meet a seperator as the first char, we must proceed to get it.
- # That is, we get a token that is a seperator char. nomally it is the boundary of other tokens.
- elif StartPos == self.CurrentOffsetWithinLine and TempChar in SEPERATOR_TUPLE:
- self.__GetOneChar()
- break
- else:
- break
-# else:
-# return False
-
- EndPos = self.CurrentOffsetWithinLine
- if self.CurrentLineNumber != StartLine:
- EndPos = len(self.Profile.FileLinesList[StartLine-1])
- self.__Token = self.Profile.FileLinesList[StartLine-1][StartPos : EndPos]
- if StartPos != self.CurrentOffsetWithinLine:
- return True
- else:
- return False
-
- def __GetNextOp(self):
- # Skip leading spaces, if exist.
- self.__SkipWhiteSpace()
- if self.__EndOfFile():
- return False
- # Record the token start position, the position of the first non-space char.
- StartPos = self.CurrentOffsetWithinLine
- while not self.__EndOfLine():
- TempChar = self.__CurrentChar()
- # Try to find the end char that is not a space
- if not str(TempChar).isspace():
- self.__GetOneChar()
- else:
- break
- else:
- return False
-
- if StartPos != self.CurrentOffsetWithinLine:
- self.__Token = self.__CurrentLine()[StartPos : self.CurrentOffsetWithinLine]
- return True
- else:
- return False
- ## __GetNextGuid() method
- #
- # Get next token unit before a seperator
- # If found, the GUID string is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a registry format GUID, file buffer pointer moved forward
- # @retval False Not able to find a registry format GUID, file buffer pointer not changed
- #
- def __GetNextGuid(self):
-
- if not self.__GetNextToken():
- return False
- p = re.compile('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}')
- if p.match(self.__Token) != None:
- return True
- else:
- self.__UndoToken()
- return False
-
- ## __UndoToken() method
- #
- # Go back one token unit in file buffer
- #
- # @param self The object pointer
- #
- def __UndoToken(self):
- self.__UndoOneChar()
- while self.__CurrentChar().isspace():
- if not self.__UndoOneChar():
- self.__GetOneChar()
- return
-
-
- StartPos = self.CurrentOffsetWithinLine
- CurrentLine = self.CurrentLineNumber
- while CurrentLine == self.CurrentLineNumber:
-
- TempChar = self.__CurrentChar()
- # Try to find the end char that is not a space and not in seperator tuple.
- # That is, when we got a space or any char in the tuple, we got the end of token.
- if not str(TempChar).isspace() and not TempChar in SEPERATOR_TUPLE:
- if not self.__UndoOneChar():
- return
- # if we happen to meet a seperator as the first char, we must proceed to get it.
- # That is, we get a token that is a seperator char. nomally it is the boundary of other tokens.
- elif StartPos == self.CurrentOffsetWithinLine and TempChar in SEPERATOR_TUPLE:
- return
- else:
- break
-
- self.__GetOneChar()
-
- ## __HexDigit() method
- #
- # Whether char input is a Hex data bit
- #
- # @param self The object pointer
- # @param TempChar The char to test
- # @retval True The char is a Hex data bit
- # @retval False The char is NOT a Hex data bit
- #
- def __HexDigit(self, TempChar):
- if (TempChar >= 'a' and TempChar <= 'f') or (TempChar >= 'A' and TempChar <= 'F') \
- or (TempChar >= '0' and TempChar <= '9'):
- return True
- else:
- return False
-
- def __IsHex(self, HexStr):
- if not HexStr.upper().startswith("0X"):
- return False
- if len(self.__Token) <= 2:
- return False
- charList = [c for c in HexStr[2 : ] if not self.__HexDigit( c)]
- if len(charList) == 0:
- return True
- else:
- return False
- ## __GetNextHexNumber() method
- #
- # Get next HEX data before a seperator
- # If found, the HEX data is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a HEX data, file buffer pointer moved forward
- # @retval False Not able to find a HEX data, file buffer pointer not changed
- #
- def __GetNextHexNumber(self):
- if not self.__GetNextToken():
- return False
- if self.__IsHex(self.__Token):
- return True
- else:
- self.__UndoToken()
- return False
-
- ## __GetNextDecimalNumber() method
- #
- # Get next decimal data before a seperator
- # If found, the decimal data is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a decimal data, file buffer pointer moved forward
- # @retval False Not able to find a decimal data, file buffer pointer not changed
- #
- def __GetNextDecimalNumber(self):
- if not self.__GetNextToken():
- return False
- if self.__Token.isdigit():
- return True
- else:
- self.__UndoToken()
- return False
-
- ## __GetNextPcdName() method
- #
- # Get next PCD token space C name and PCD C name pair before a seperator
- # If found, the decimal data is put into self.__Token
- #
- # @param self The object pointer
- # @retval Tuple PCD C name and PCD token space C name pair
- #
- def __GetNextPcdName(self):
- if not self.__GetNextWord():
- raise Warning("expected format of <PcdTokenSpaceCName>.<PcdCName>", self.FileName, self.CurrentLineNumber)
- pcdTokenSpaceCName = self.__Token
-
- if not self.__IsToken( "."):
- raise Warning("expected format of <PcdTokenSpaceCName>.<PcdCName>", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextWord():
- raise Warning("expected format of <PcdTokenSpaceCName>.<PcdCName>", self.FileName, self.CurrentLineNumber)
- pcdCName = self.__Token
-
- return (pcdCName, pcdTokenSpaceCName)
-
- ## __GetStringData() method
- #
- # Get string contents quoted in ""
- # If found, the decimal data is put into self.__Token
- #
- # @param self The object pointer
- # @retval True Successfully find a string data, file buffer pointer moved forward
- # @retval False Not able to find a string data, file buffer pointer not changed
- #
- def __GetStringData(self):
- if self.__Token.startswith("\"") or self.__Token.startswith("L\""):
- self.__UndoToken()
- self.__SkipToToken("\"")
- currentLineNumber = self.CurrentLineNumber
-
- if not self.__SkipToToken("\""):
- raise Warning("Missing Quote \" for String", self.FileName, self.CurrentLineNumber)
- if currentLineNumber != self.CurrentLineNumber:
- raise Warning("Missing Quote \" for String", self.FileName, self.CurrentLineNumber)
- self.__Token = self.__SkippedChars.rstrip('\"')
- return True
-
- elif self.__Token.startswith("\'") or self.__Token.startswith("L\'"):
- self.__UndoToken()
- self.__SkipToToken("\'")
- currentLineNumber = self.CurrentLineNumber
-
- if not self.__SkipToToken("\'"):
- raise Warning("Missing Quote \' for String", self.FileName, self.CurrentLineNumber)
- if currentLineNumber != self.CurrentLineNumber:
- raise Warning("Missing Quote \' for String", self.FileName, self.CurrentLineNumber)
- self.__Token = self.__SkippedChars.rstrip('\'')
- return True
-
- else:
- return False
-
- ## __SkipToToken() method
- #
- # Search forward in file buffer for the string
- # The skipped chars are put into self.__SkippedChars
- #
- # @param self The object pointer
- # @param String The string to search
- # @param IgnoreCase Indicate case sensitive/non-sensitive search, default is case sensitive
- # @retval True Successfully find the string, file buffer pointer moved forward
- # @retval False Not able to find the string, file buffer pointer not changed
- #
- def __SkipToToken(self, String, IgnoreCase = False):
- StartPos = self.GetFileBufferPos()
-
- self.__SkippedChars = ""
- while not self.__EndOfFile():
- index = -1
- if IgnoreCase:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].upper().find(String.upper())
- else:
- index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].find(String)
- if index == 0:
- self.CurrentOffsetWithinLine += len(String)
- self.__SkippedChars += String
- return True
- self.__SkippedChars += str(self.__CurrentChar())
- self.__GetOneChar()
-
- self.SetFileBufferPos( StartPos)
- self.__SkippedChars = ""
- return False
-
- ## GetFileBufferPos() method
- #
- # Return the tuple of current line and offset within the line
- #
- # @param self The object pointer
- # @retval Tuple Line number and offset pair
- #
- def GetFileBufferPos(self):
- return (self.CurrentLineNumber, self.CurrentOffsetWithinLine)
-
- ## SetFileBufferPos() method
- #
- # Restore the file buffer position
- #
- # @param self The object pointer
- # @param Pos The new file buffer position
- #
- def SetFileBufferPos(self, Pos):
- (self.CurrentLineNumber, self.CurrentOffsetWithinLine) = Pos
-
- ## Preprocess() method
- #
- # Preprocess comment, conditional directive, include directive, replace macro.
- # Exception will be raised if syntax error found
- #
- # @param self The object pointer
- #
- def Preprocess(self):
- self.__StringToList()
- self.PreprocessFile()
- self.PreprocessIncludeFile()
- self.__StringToList()
- self.PreprocessFile()
- self.PreprocessConditionalStatement()
- self.__StringToList()
- for Pos in self.__WipeOffArea:
- self.__ReplaceFragment(Pos[0], Pos[1])
- self.Profile.FileLinesList = ["".join(list) for list in self.Profile.FileLinesList]
-
- while self.__GetDefines():
- pass
-
- ## ParseFile() method
- #
- # Parse the file profile buffer to extract fd, fv ... information
- # Exception will be raised if syntax error found
- #
- # @param self The object pointer
- #
- def ParseFile(self):
-
- try:
- self.Preprocess()
- while self.__GetFd():
- pass
-
- while self.__GetFv():
- pass
-
- while self.__GetCapsule():
- pass
-
- while self.__GetVtf():
- pass
-
- while self.__GetRule():
- pass
-
- while self.__GetOptionRom():
- pass
-
- except Warning, X:
- self.__UndoToken()
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- #'\n\tGot Token: \"%s\" from File %s\n' % (self.__Token, FileLineTuple[0]) + \
- X.Message += ' near line %d, column %d: %s' \
- % (FileLineTuple[1], self.CurrentOffsetWithinLine + 1, self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :].rstrip('\n').rstrip('\r'))
- raise
-
- ## __GetDefines() method
- #
- # Get Defines section contents and store its data into AllMacrosList
- #
- # @param self The object pointer
- # @retval True Successfully find a Defines
- # @retval False Not able to find a Defines
- #
- def __GetDefines(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[DEFINES"):
- if not S.startswith("[FD.") and not S.startswith("[FV.") and not S.startswith("[CAPSULE.") \
- and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [DEFINES], [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
-
- self.__UndoToken()
- if not self.__IsToken("[DEFINES", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- # % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("expected [DEFINES", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']'", self.FileName, self.CurrentLineNumber)
-
- while self.__GetNextWord():
- # handle the SET statement
- if self.__Token == 'SET':
- self.__UndoToken()
- self.__GetSetStatement(None)
- continue
-
- Macro = self.__Token
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken() or self.__Token.startswith('['):
- raise Warning("expected MACRO value", self.FileName, self.CurrentLineNumber)
- Value = self.__Token
-
- return False
-
- ## __GetFd() method
- #
- # Get FD section contents and store its data into FD dictionary of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a FD
- # @retval False Not able to find a FD
- #
- def __GetFd(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[FD."):
- if not S.startswith("[FV.") and not S.startswith("[CAPSULE.") \
- and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
-
- self.__UndoToken()
- if not self.__IsToken("[FD.", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- # % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("expected [FD.]", self.FileName, self.CurrentLineNumber)
-
- FdName = self.__GetUiName()
- if FdName == "":
- if len (self.Profile.FdDict) == 0:
- FdName = GenFdsGlobalVariable.PlatformName
- if FdName == "" and GlobalData.gActivePlatform:
- FdName = GlobalData.gActivePlatform.PlatformName
- self.Profile.FdNameNotSet = True
- else:
- raise Warning("expected FdName in [FD.] section", self.FileName, self.CurrentLineNumber)
- self.CurrentFdName = FdName.upper()
-
- if self.CurrentFdName in self.Profile.FdDict:
- raise Warning("Unexpected the same FD name", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']'", self.FileName, self.CurrentLineNumber)
-
- FdObj = Fd.FD()
- FdObj.FdUiName = self.CurrentFdName
- self.Profile.FdDict[self.CurrentFdName] = FdObj
-
- if len (self.Profile.FdDict) > 1 and self.Profile.FdNameNotSet:
- raise Warning("expected all FDs have their name", self.FileName, self.CurrentLineNumber)
-
- Status = self.__GetCreateFile(FdObj)
- if not Status:
- raise Warning("FD name error", self.FileName, self.CurrentLineNumber)
-
- self.__GetTokenStatements(FdObj)
-
- self.__GetDefineStatements(FdObj)
-
- self.__GetSetStatements(FdObj)
-
- if not self.__GetRegionLayout(FdObj):
- raise Warning("expected region layout", self.FileName, self.CurrentLineNumber)
-
- while self.__GetRegionLayout(FdObj):
- pass
- return True
-
- ## __GetUiName() method
- #
- # Return the UI name of a section
- #
- # @param self The object pointer
- # @retval FdName UI name
- #
- def __GetUiName(self):
- Name = ""
- if self.__GetNextWord():
- Name = self.__Token
-
- return Name
-
- ## __GetCreateFile() method
- #
- # Return the output file name of object
- #
- # @param self The object pointer
- # @param Obj object whose data will be stored in file
- # @retval FdName UI name
- #
- def __GetCreateFile(self, Obj):
-
- if self.__IsKeyword( "CREATE_FILE"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected file name", self.FileName, self.CurrentLineNumber)
-
- FileName = self.__Token
- Obj.CreateFileName = FileName
-
- return True
-
- ## __GetTokenStatements() method
- #
- # Get token statements
- #
- # @param self The object pointer
- # @param Obj for whom token statement is got
- #
- def __GetTokenStatements(self, Obj):
- if not self.__IsKeyword( "BaseAddress"):
- raise Warning("BaseAddress missing", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex base address", self.FileName, self.CurrentLineNumber)
-
- Obj.BaseAddress = self.__Token
-
- if self.__IsToken( "|"):
- pcdPair = self.__GetNextPcdName()
- Obj.BaseAddressPcd = pcdPair
- self.Profile.PcdDict[pcdPair] = Obj.BaseAddress
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[pcdPair] = FileLineTuple
-
- if not self.__IsKeyword( "Size"):
- raise Warning("Size missing", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex size", self.FileName, self.CurrentLineNumber)
-
-
- Size = self.__Token
- if self.__IsToken( "|"):
- pcdPair = self.__GetNextPcdName()
- Obj.SizePcd = pcdPair
- self.Profile.PcdDict[pcdPair] = Size
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[pcdPair] = FileLineTuple
- Obj.Size = long(Size, 0)
-
- if not self.__IsKeyword( "ErasePolarity"):
- raise Warning("ErasePolarity missing", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Erase Polarity", self.FileName, self.CurrentLineNumber)
-
- if self.__Token != "1" and self.__Token != "0":
- raise Warning("expected 1 or 0 Erase Polarity", self.FileName, self.CurrentLineNumber)
-
- Obj.ErasePolarity = self.__Token
-
- self.__GetBlockStatements(Obj)
-
- ## __GetAddressStatements() method
- #
- # Get address statements
- #
- # @param self The object pointer
- # @param Obj for whom address statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetAddressStatements(self, Obj):
-
- if self.__IsKeyword("BsBaseAddress"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextDecimalNumber() and not self.__GetNextHexNumber():
- raise Warning("expected address", self.FileName, self.CurrentLineNumber)
-
- BsAddress = long(self.__Token, 0)
- Obj.BsBaseAddress = BsAddress
-
- if self.__IsKeyword("RtBaseAddress"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextDecimalNumber() and not self.__GetNextHexNumber():
- raise Warning("expected address", self.FileName, self.CurrentLineNumber)
-
- RtAddress = long(self.__Token, 0)
- Obj.RtBaseAddress = RtAddress
-
- ## __GetBlockStatements() method
- #
- # Get block statements
- #
- # @param self The object pointer
- # @param Obj for whom block statement is got
- #
- def __GetBlockStatements(self, Obj):
-
- if not self.__GetBlockStatement(Obj):
- #set default block size is 1
- Obj.BlockSizeList.append((1, Obj.Size, None))
- return
-
- while self.__GetBlockStatement(Obj):
- pass
-
- for Item in Obj.BlockSizeList:
- if Item[0] == None or Item[1] == None:
- raise Warning("expected block statement", self.FileName, self.CurrentLineNumber)
-
- ## __GetBlockStatement() method
- #
- # Get block statement
- #
- # @param self The object pointer
- # @param Obj for whom block statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetBlockStatement(self, Obj):
- if not self.__IsKeyword( "BlockSize"):
- return False
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber() and not self.__GetNextDecimalNumber():
- raise Warning("expected Hex or Integer block size", self.FileName, self.CurrentLineNumber)
-
- BlockSize = self.__Token
- BlockSizePcd = None
- if self.__IsToken( "|"):
- PcdPair = self.__GetNextPcdName()
- BlockSizePcd = PcdPair
- self.Profile.PcdDict[PcdPair] = BlockSize
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[PcdPair] = FileLineTuple
- BlockSize = long(BlockSize, 0)
-
- BlockNumber = None
- if self.__IsKeyword( "NumBlocks"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextDecimalNumber() and not self.__GetNextHexNumber():
- raise Warning("expected block numbers", self.FileName, self.CurrentLineNumber)
-
- BlockNumber = long(self.__Token, 0)
-
- Obj.BlockSizeList.append((BlockSize, BlockNumber, BlockSizePcd))
- return True
-
- ## __GetDefineStatements() method
- #
- # Get define statements
- #
- # @param self The object pointer
- # @param Obj for whom define statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetDefineStatements(self, Obj):
- while self.__GetDefineStatement( Obj):
- pass
-
- ## __GetDefineStatement() method
- #
- # Get define statement
- #
- # @param self The object pointer
- # @param Obj for whom define statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetDefineStatement(self, Obj):
- if self.__IsKeyword("DEFINE"):
- self.__GetNextToken()
- Macro = self.__Token
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected value", self.FileName, self.CurrentLineNumber)
-
- Value = self.__Token
- Macro = '$(' + Macro + ')'
- Obj.DefineVarDict[Macro] = Value
- return True
-
- return False
-
- ## __GetSetStatements() method
- #
- # Get set statements
- #
- # @param self The object pointer
- # @param Obj for whom set statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetSetStatements(self, Obj):
- while self.__GetSetStatement(Obj):
- pass
-
- ## __GetSetStatement() method
- #
- # Get set statement
- #
- # @param self The object pointer
- # @param Obj for whom set statement is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetSetStatement(self, Obj):
- if self.__IsKeyword("SET"):
- PcdPair = self.__GetNextPcdName()
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- Value = self.__GetExpression()
- Value = self.__EvaluateConditional(Value, self.CurrentLineNumber, 'eval', True)
-
- if Obj:
- Obj.SetVarDict[PcdPair] = Value
- self.Profile.PcdDict[PcdPair] = Value
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[PcdPair] = FileLineTuple
- return True
-
- return False
-
- ## __CalcRegionExpr(self)
- #
- # Calculate expression for offset or size of a region
- #
- # @return: None if invalid expression
- # Calculated number if successfully
- #
- def __CalcRegionExpr(self):
- StartPos = self.GetFileBufferPos()
- Expr = ''
- PairCount = 0
- while not self.__EndOfFile():
- CurCh = self.__CurrentChar()
- if CurCh == '(':
- PairCount += 1
- elif CurCh == ')':
- PairCount -= 1
-
- if CurCh in '|\r\n' and PairCount == 0:
- break
- Expr += CurCh
- self.__GetOneChar()
- try:
- return long(
- ValueExpression(Expr,
- dict(['%s.%s' % (Pcd[1], Pcd[0]), Val]
- for Pcd, Val in self.Profile.PcdDict.iteritems())
- )(True),0)
- except Exception:
- self.SetFileBufferPos(StartPos)
- return None
-
- ## __GetRegionLayout() method
- #
- # Get region layout for FD
- #
- # @param self The object pointer
- # @param Fd for whom region is got
- # @retval True Successfully find
- # @retval False Not able to find
- #
- def __GetRegionLayout(self, Fd):
- Offset = self.__CalcRegionExpr()
- if Offset == None:
- return False
-
- RegionObj = Region.Region()
- RegionObj.Offset = Offset
- Fd.RegionList.append(RegionObj)
-
- if not self.__IsToken( "|"):
- raise Warning("expected '|'", self.FileName, self.CurrentLineNumber)
-
- Size = self.__CalcRegionExpr()
- if Size == None:
- raise Warning("expected Region Size", self.FileName, self.CurrentLineNumber)
- RegionObj.Size = Size
-
- if not self.__GetNextWord():
- return True
-
- if not self.__Token in ("SET", "FV", "FILE", "DATA", "CAPSULE"):
- self.__UndoToken()
- RegionObj.PcdOffset = self.__GetNextPcdName()
- self.Profile.PcdDict[RegionObj.PcdOffset] = "0x%08X" % (RegionObj.Offset + long(Fd.BaseAddress, 0))
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[RegionObj.PcdOffset] = FileLineTuple
- if self.__IsToken( "|"):
- RegionObj.PcdSize = self.__GetNextPcdName()
- self.Profile.PcdDict[RegionObj.PcdSize] = "0x%08X" % RegionObj.Size
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[RegionObj.PcdSize] = FileLineTuple
-
- if not self.__GetNextWord():
- return True
-
- if self.__Token == "SET":
- self.__UndoToken()
- self.__GetSetStatements( RegionObj)
- if not self.__GetNextWord():
- return True
-
- elif self.__Token == "FV":
- self.__UndoToken()
- self.__GetRegionFvType( RegionObj)
-
- elif self.__Token == "CAPSULE":
- self.__UndoToken()
- self.__GetRegionCapType( RegionObj)
-
- elif self.__Token == "FILE":
- self.__UndoToken()
- self.__GetRegionFileType( RegionObj)
-
- elif self.__Token == "DATA":
- self.__UndoToken()
- self.__GetRegionDataType( RegionObj)
- else:
- raise Warning("A valid region type was not found. "
- "Valid types are [SET, FV, CAPSULE, FILE, DATA]. This error occurred",
- self.FileName, self.CurrentLineNumber)
-
- return True
-
- ## __GetRegionFvType() method
- #
- # Get region fv data for region
- #
- # @param self The object pointer
- # @param RegionObj for whom region data is got
- #
- def __GetRegionFvType(self, RegionObj):
-
- if not self.__IsKeyword( "FV"):
- raise Warning("expected Keyword 'FV'", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FV name", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionType = "FV"
- RegionObj.RegionDataList.append(self.__Token)
-
- while self.__IsKeyword( "FV"):
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FV name", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionDataList.append(self.__Token)
-
- ## __GetRegionCapType() method
- #
- # Get region capsule data for region
- #
- # @param self The object pointer
- # @param RegionObj for whom region data is got
- #
- def __GetRegionCapType(self, RegionObj):
-
- if not self.__IsKeyword("CAPSULE"):
- raise Warning("expected Keyword 'CAPSULE'", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected CAPSULE name", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionType = "CAPSULE"
- RegionObj.RegionDataList.append(self.__Token)
-
- while self.__IsKeyword("CAPSULE"):
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected CAPSULE name", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionDataList.append(self.__Token)
-
- ## __GetRegionFileType() method
- #
- # Get region file data for region
- #
- # @param self The object pointer
- # @param RegionObj for whom region data is got
- #
- def __GetRegionFileType(self, RegionObj):
-
- if not self.__IsKeyword( "FILE"):
- raise Warning("expected Keyword 'FILE'", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected File name", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionType = "FILE"
- RegionObj.RegionDataList.append( self.__Token)
-
- while self.__IsKeyword( "FILE"):
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FILE name", self.FileName, self.CurrentLineNumber)
-
- RegionObj.RegionDataList.append(self.__Token)
-
- ## __GetRegionDataType() method
- #
- # Get region array data for region
- #
- # @param self The object pointer
- # @param RegionObj for whom region data is got
- #
- def __GetRegionDataType(self, RegionObj):
-
- if not self.__IsKeyword( "DATA"):
- raise Warning("expected Region Data type", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex byte", self.FileName, self.CurrentLineNumber)
-
- if len(self.__Token) > 18:
- raise Warning("Hex string can't be converted to a valid UINT64 value", self.FileName, self.CurrentLineNumber)
-
- # convert hex string value to byte hex string array
- AllString = self.__Token
- AllStrLen = len (AllString)
- DataString = ""
- while AllStrLen > 4:
- DataString = DataString + "0x" + AllString[AllStrLen - 2: AllStrLen] + ","
- AllStrLen = AllStrLen - 2
- DataString = DataString + AllString[:AllStrLen] + ","
-
- # byte value array
- if len (self.__Token) <= 4:
- while self.__IsToken(","):
- if not self.__GetNextHexNumber():
- raise Warning("Invalid Hex number", self.FileName, self.CurrentLineNumber)
- if len(self.__Token) > 4:
- raise Warning("Hex byte(must be 2 digits) too long", self.FileName, self.CurrentLineNumber)
- DataString += self.__Token
- DataString += ","
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
-
- DataString = DataString.rstrip(",")
- RegionObj.RegionType = "DATA"
- RegionObj.RegionDataList.append( DataString)
-
- while self.__IsKeyword( "DATA"):
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex byte", self.FileName, self.CurrentLineNumber)
-
- if len(self.__Token) > 18:
- raise Warning("Hex string can't be converted to a valid UINT64 value", self.FileName, self.CurrentLineNumber)
-
- # convert hex string value to byte hex string array
- AllString = self.__Token
- AllStrLen = len (AllString)
- DataString = ""
- while AllStrLen > 4:
- DataString = DataString + "0x" + AllString[AllStrLen - 2: AllStrLen] + ","
- AllStrLen = AllStrLen - 2
- DataString = DataString + AllString[:AllStrLen] + ","
-
- # byte value array
- if len (self.__Token) <= 4:
- while self.__IsToken(","):
- if not self.__GetNextHexNumber():
- raise Warning("Invalid Hex number", self.FileName, self.CurrentLineNumber)
- if len(self.__Token) > 4:
- raise Warning("Hex byte(must be 2 digits) too long", self.FileName, self.CurrentLineNumber)
- DataString += self.__Token
- DataString += ","
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
-
- DataString = DataString.rstrip(",")
- RegionObj.RegionDataList.append( DataString)
-
- ## __GetFv() method
- #
- # Get FV section contents and store its data into FV dictionary of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a FV
- # @retval False Not able to find a FV
- #
- def __GetFv(self):
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[FV."):
- if not S.startswith("[CAPSULE.") \
- and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
-
- self.__UndoToken()
- if not self.__IsToken("[FV.", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- # % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("Unknown Keyword '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
-
- FvName = self.__GetUiName()
- self.CurrentFvName = FvName.upper()
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']'", self.FileName, self.CurrentLineNumber)
-
- FvObj = Fv.FV()
- FvObj.UiFvName = self.CurrentFvName
- self.Profile.FvDict[self.CurrentFvName] = FvObj
-
- Status = self.__GetCreateFile(FvObj)
- if not Status:
- raise Warning("FV name error", self.FileName, self.CurrentLineNumber)
-
- self.__GetDefineStatements(FvObj)
-
- self.__GetAddressStatements(FvObj)
-
- while self.__GetBlockStatement(FvObj):
- pass
-
- self.__GetSetStatements(FvObj)
-
- self.__GetFvBaseAddress(FvObj)
-
- self.__GetFvForceRebase(FvObj)
-
- self.__GetFvAlignment(FvObj)
-
- self.__GetFvAttributes(FvObj)
-
- self.__GetFvNameGuid(FvObj)
-
- FvObj.FvExtEntryTypeValue = []
- FvObj.FvExtEntryType = []
- FvObj.FvExtEntryData = []
- while True:
- isFvExtEntry = self.__GetFvExtEntryStatement(FvObj)
- if not isFvExtEntry:
- break
-
- self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy())
- self.__GetAprioriSection(FvObj, FvObj.DefineVarDict.copy())
-
- while True:
- isInf = self.__GetInfStatement(FvObj, MacroDict = FvObj.DefineVarDict.copy())
- isFile = self.__GetFileStatement(FvObj, MacroDict = FvObj.DefineVarDict.copy())
- if not isInf and not isFile:
- break
-
- return True
-
- ## __GetFvAlignment() method
- #
- # Get alignment for FV
- #
- # @param self The object pointer
- # @param Obj for whom alignment is got
- # @retval True Successfully find a alignment statement
- # @retval False Not able to find a alignment statement
- #
- def __GetFvAlignment(self, Obj):
-
- if not self.__IsKeyword( "FvAlignment"):
- return False
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected alignment value", self.FileName, self.CurrentLineNumber)
-
- if self.__Token.upper() not in ("1", "2", "4", "8", "16", "32", "64", "128", "256", "512", \
- "1K", "2K", "4K", "8K", "16K", "32K", "64K", "128K", "256K", "512K", \
- "1M", "2M", "4M", "8M", "16M", "32M", "64M", "128M", "256M", "512M", \
- "1G", "2G"):
- raise Warning("Unknown alignment value '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- Obj.FvAlignment = self.__Token
- return True
-
- ## __GetFvBaseAddress() method
- #
- # Get BaseAddress for FV
- #
- # @param self The object pointer
- # @param Obj for whom FvBaseAddress is got
- # @retval True Successfully find a FvBaseAddress statement
- # @retval False Not able to find a FvBaseAddress statement
- #
- def __GetFvBaseAddress(self, Obj):
-
- if not self.__IsKeyword("FvBaseAddress"):
- return False
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FV base address value", self.FileName, self.CurrentLineNumber)
-
- IsValidBaseAddrValue = re.compile('^0[x|X][0-9a-fA-F]+')
-
- if not IsValidBaseAddrValue.match(self.__Token.upper()):
- raise Warning("Unknown FV base address value '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- Obj.FvBaseAddress = self.__Token
- return True
-
- ## __GetFvForceRebase() method
- #
- # Get FvForceRebase for FV
- #
- # @param self The object pointer
- # @param Obj for whom FvForceRebase is got
- # @retval True Successfully find a FvForceRebase statement
- # @retval False Not able to find a FvForceRebase statement
- #
- def __GetFvForceRebase(self, Obj):
-
- if not self.__IsKeyword("FvForceRebase"):
- return False
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FvForceRebase value", self.FileName, self.CurrentLineNumber)
-
- if self.__Token.upper() not in ["TRUE", "FALSE", "0", "0X0", "0X00", "1", "0X1", "0X01"]:
- raise Warning("Unknown FvForceRebase value '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
-
- if self.__Token.upper() in ["TRUE", "1", "0X1", "0X01"]:
- Obj.FvForceRebase = True
- elif self.__Token.upper() in ["FALSE", "0", "0X0", "0X00"]:
- Obj.FvForceRebase = False
- else:
- Obj.FvForceRebase = None
-
- return True
-
-
- ## __GetFvAttributes() method
- #
- # Get attributes for FV
- #
- # @param self The object pointer
- # @param Obj for whom attribute is got
- # @retval None
- #
- def __GetFvAttributes(self, FvObj):
-
- while self.__GetNextWord():
- name = self.__Token
- if name not in ("ERASE_POLARITY", "MEMORY_MAPPED", \
- "STICKY_WRITE", "LOCK_CAP", "LOCK_STATUS", "WRITE_ENABLED_CAP", \
- "WRITE_DISABLED_CAP", "WRITE_STATUS", "READ_ENABLED_CAP", \
- "READ_DISABLED_CAP", "READ_STATUS", "READ_LOCK_CAP", \
- "READ_LOCK_STATUS", "WRITE_LOCK_CAP", "WRITE_LOCK_STATUS", \
- "WRITE_POLICY_RELIABLE"):
- self.__UndoToken()
- return
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken() or self.__Token.upper() not in ("TRUE", "FALSE", "1", "0"):
- raise Warning("expected TRUE/FALSE (1/0)", self.FileName, self.CurrentLineNumber)
-
- FvObj.FvAttributeDict[name] = self.__Token
-
- return
-
- ## __GetFvNameGuid() method
- #
- # Get FV GUID for FV
- #
- # @param self The object pointer
- # @param Obj for whom GUID is got
- # @retval None
- #
- def __GetFvNameGuid(self, FvObj):
-
- if not self.__IsKeyword( "FvNameGuid"):
- return
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextGuid():
- raise Warning("expected FV GUID value", self.FileName, self.CurrentLineNumber)
-
- FvObj.FvNameGuid = self.__Token
-
- return
-
- def __GetFvExtEntryStatement(self, FvObj):
-
- if not self.__IsKeyword( "FV_EXT_ENTRY"):
- return False
-
- if not self.__IsKeyword ("TYPE"):
- raise Warning("expected 'TYPE'", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber() and not self.__GetNextDecimalNumber():
- raise Warning("expected Hex FV extension entry type value At Line ", self.FileName, self.CurrentLineNumber)
-
- FvObj.FvExtEntryTypeValue += [self.__Token]
-
- if not self.__IsToken( "{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsKeyword ("FILE") and not self.__IsKeyword ("DATA"):
- raise Warning("expected 'FILE' or 'DATA'", self.FileName, self.CurrentLineNumber)
-
- FvObj.FvExtEntryType += [self.__Token]
-
- if self.__Token == 'DATA':
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex byte", self.FileName, self.CurrentLineNumber)
-
- if len(self.__Token) > 4:
- raise Warning("Hex byte(must be 2 digits) too long", self.FileName, self.CurrentLineNumber)
-
- DataString = self.__Token
- DataString += ","
-
- while self.__IsToken(","):
- if not self.__GetNextHexNumber():
- raise Warning("Invalid Hex number", self.FileName, self.CurrentLineNumber)
- if len(self.__Token) > 4:
- raise Warning("Hex byte(must be 2 digits) too long", self.FileName, self.CurrentLineNumber)
- DataString += self.__Token
- DataString += ","
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
-
- DataString = DataString.rstrip(",")
- FvObj.FvExtEntryData += [DataString]
-
- if self.__Token == 'FILE':
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FV Extension Entry file path At Line ", self.FileName, self.CurrentLineNumber)
-
- FvObj.FvExtEntryData += [self.__Token]
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
-
- return True
-
- ## __GetAprioriSection() method
- #
- # Get token statements
- #
- # @param self The object pointer
- # @param FvObj for whom apriori is got
- # @param MacroDict dictionary used to replace macro
- # @retval True Successfully find apriori statement
- # @retval False Not able to find apriori statement
- #
- def __GetAprioriSection(self, FvObj, MacroDict = {}):
-
- if not self.__IsKeyword( "APRIORI"):
- return False
-
- if not self.__IsKeyword("PEI") and not self.__IsKeyword("DXE"):
- raise Warning("expected Apriori file type", self.FileName, self.CurrentLineNumber)
- AprType = self.__Token
-
- if not self.__IsToken( "{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
-
- AprSectionObj = AprioriSection.AprioriSection()
- AprSectionObj.AprioriType = AprType
-
- self.__GetDefineStatements(AprSectionObj)
- MacroDict.update(AprSectionObj.DefineVarDict)
-
- while True:
- IsInf = self.__GetInfStatement( AprSectionObj, MacroDict = MacroDict)
- IsFile = self.__GetFileStatement( AprSectionObj)
- if not IsInf and not IsFile:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
-
- FvObj.AprioriSectionList.append(AprSectionObj)
- return True
-
- ## __GetInfStatement() method
- #
- # Get INF statements
- #
- # @param self The object pointer
- # @param Obj for whom inf statement is got
- # @param MacroDict dictionary used to replace macro
- # @retval True Successfully find inf statement
- # @retval False Not able to find inf statement
- #
- def __GetInfStatement(self, Obj, ForCapsule = False, MacroDict = {}):
-
- if not self.__IsKeyword( "INF"):
- return False
-
- ffsInf = FfsInfStatement.FfsInfStatement()
- self.__GetInfOptions( ffsInf)
-
- if not self.__GetNextToken():
- raise Warning("expected INF file path", self.FileName, self.CurrentLineNumber)
- ffsInf.InfFileName = self.__Token
-
- ffsInf.CurrentLineNum = self.CurrentLineNumber
- ffsInf.CurrentLineContent = self.__CurrentLine()
-
- if ffsInf.InfFileName.replace('$(WORKSPACE)', '').find('$') == -1:
- #do case sensitive check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(ffsInf.InfFileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
-
- if not ffsInf.InfFileName in self.Profile.InfList:
- self.Profile.InfList.append(ffsInf.InfFileName)
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.InfFileLineList.append(FileLineTuple)
-
- if self.__IsToken('|'):
- if self.__IsKeyword('RELOCS_STRIPPED'):
- ffsInf.KeepReloc = False
- elif self.__IsKeyword('RELOCS_RETAINED'):
- ffsInf.KeepReloc = True
- else:
- raise Warning("Unknown reloc strip flag '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
-
- if ForCapsule:
- capsuleFfs = CapsuleData.CapsuleFfs()
- capsuleFfs.Ffs = ffsInf
- Obj.CapsuleDataList.append(capsuleFfs)
- else:
- Obj.FfsList.append(ffsInf)
- return True
-
- ## __GetInfOptions() method
- #
- # Get options for INF
- #
- # @param self The object pointer
- # @param FfsInfObj for whom option is got
- #
- def __GetInfOptions(self, FfsInfObj):
-
- if self.__IsKeyword( "RuleOverride"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected Rule name", self.FileName, self.CurrentLineNumber)
- FfsInfObj.Rule = self.__Token
-
- if self.__IsKeyword( "VERSION"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected Version", self.FileName, self.CurrentLineNumber)
-
- if self.__GetStringData():
- FfsInfObj.Version = self.__Token
-
- if self.__IsKeyword( "UI"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected UI name", self.FileName, self.CurrentLineNumber)
-
- if self.__GetStringData():
- FfsInfObj.Ui = self.__Token
-
- if self.__IsKeyword( "USE"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected ARCH name", self.FileName, self.CurrentLineNumber)
- FfsInfObj.UseArch = self.__Token
-
-
- if self.__GetNextToken():
- p = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
- if p.match(self.__Token):
- FfsInfObj.KeyStringList.append(self.__Token)
- if not self.__IsToken(","):
- return
- else:
- self.__UndoToken()
- return
-
- while self.__GetNextToken():
- if not p.match(self.__Token):
- raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
- FfsInfObj.KeyStringList.append(self.__Token)
-
- if not self.__IsToken(","):
- break
-
- ## __GetFileStatement() method
- #
- # Get FILE statements
- #
- # @param self The object pointer
- # @param Obj for whom FILE statement is got
- # @param MacroDict dictionary used to replace macro
- # @retval True Successfully find FILE statement
- # @retval False Not able to find FILE statement
- #
- def __GetFileStatement(self, Obj, ForCapsule = False, MacroDict = {}):
-
- if not self.__IsKeyword( "FILE"):
- return False
-
- if not self.__GetNextWord():
- raise Warning("expected FFS type", self.FileName, self.CurrentLineNumber)
-
- if ForCapsule and self.__Token == 'DATA':
- self.__UndoToken()
- self.__UndoToken()
- return False
-
- FfsFileObj = FfsFileStatement.FileStatement()
- FfsFileObj.FvFileType = self.__Token
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextGuid():
- if not self.__GetNextWord():
- raise Warning("expected File GUID", self.FileName, self.CurrentLineNumber)
- if self.__Token == 'PCD':
- if not self.__IsToken( "("):
- raise Warning("expected '('", self.FileName, self.CurrentLineNumber)
- PcdPair = self.__GetNextPcdName()
- if not self.__IsToken( ")"):
- raise Warning("expected ')'", self.FileName, self.CurrentLineNumber)
- self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'
-
- FfsFileObj.NameGuid = self.__Token
-
- self.__GetFilePart( FfsFileObj, MacroDict.copy())
-
- if ForCapsule:
- capsuleFfs = CapsuleData.CapsuleFfs()
- capsuleFfs.Ffs = FfsFileObj
- Obj.CapsuleDataList.append(capsuleFfs)
- else:
- Obj.FfsList.append(FfsFileObj)
-
- return True
-
- ## __FileCouldHaveRelocFlag() method
- #
- # Check whether reloc strip flag can be set for a file type.
- #
- # @param self The object pointer
- # @param FileType The file type to check with
- # @retval True This type could have relocation strip flag
- # @retval False No way to have it
- #
-
- def __FileCouldHaveRelocFlag (self, FileType):
- if FileType in ('SEC', 'PEI_CORE', 'PEIM', 'PEI_DXE_COMBO'):
- return True
- else:
- return False
-
- ## __SectionCouldHaveRelocFlag() method
- #
- # Check whether reloc strip flag can be set for a section type.
- #
- # @param self The object pointer
- # @param SectionType The section type to check with
- # @retval True This type could have relocation strip flag
- # @retval False No way to have it
- #
-
- def __SectionCouldHaveRelocFlag (self, SectionType):
- if SectionType in ('TE', 'PE32'):
- return True
- else:
- return False
-
- ## __GetFilePart() method
- #
- # Get components for FILE statement
- #
- # @param self The object pointer
- # @param FfsFileObj for whom component is got
- # @param MacroDict dictionary used to replace macro
- #
- def __GetFilePart(self, FfsFileObj, MacroDict = {}):
-
- self.__GetFileOpts( FfsFileObj)
-
- if not self.__IsToken("{"):
- if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
- if self.__FileCouldHaveRelocFlag(FfsFileObj.FvFileType):
- if self.__Token == 'RELOCS_STRIPPED':
- FfsFileObj.KeepReloc = False
- else:
- FfsFileObj.KeepReloc = True
- else:
- raise Warning("File type %s could not have reloc strip flag%d" % (FfsFileObj.FvFileType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected File name or section data", self.FileName, self.CurrentLineNumber)
-
- if self.__Token == "FV":
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected FV name", self.FileName, self.CurrentLineNumber)
- FfsFileObj.FvName = self.__Token
-
- elif self.__Token == "FD":
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected FD name", self.FileName, self.CurrentLineNumber)
- FfsFileObj.FdName = self.__Token
-
- elif self.__Token in ("DEFINE", "APRIORI", "SECTION"):
- self.__UndoToken()
- self.__GetSectionData( FfsFileObj, MacroDict)
- else:
- FfsFileObj.CurrentLineNum = self.CurrentLineNumber
- FfsFileObj.CurrentLineContent = self.__CurrentLine()
- FfsFileObj.FileName = self.__Token
- if FfsFileObj.FileName.replace('$(WORKSPACE)', '').find('$') == -1:
- #
- # For file in OUTPUT_DIRECTORY will not check whether it exist or not at AutoGen phase.
- #
- if not GlobalData.gAutoGenPhase:
- #do case sensitive check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
- else:
- if not self.__GetMacroValue("OUTPUT_DIRECTORY") in FfsFileObj.FileName:
- #do case sensitive check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
-
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
-
- ## __GetFileOpts() method
- #
- # Get options for FILE statement
- #
- # @param self The object pointer
- # @param FfsFileObj for whom options is got
- #
- def __GetFileOpts(self, FfsFileObj):
-
- if self.__GetNextToken():
- Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
- if Pattern.match(self.__Token):
- FfsFileObj.KeyStringList.append(self.__Token)
- if self.__IsToken(","):
- while self.__GetNextToken():
- if not Pattern.match(self.__Token):
- raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
- FfsFileObj.KeyStringList.append(self.__Token)
-
- if not self.__IsToken(","):
- break
-
- else:
- self.__UndoToken()
-
- if self.__IsKeyword( "FIXED", True):
- FfsFileObj.Fixed = True
-
- if self.__IsKeyword( "CHECKSUM", True):
- FfsFileObj.CheckSum = True
-
- if self.__GetAlignment():
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- #For FFS, Auto is default option same to ""
- if not self.__Token == "Auto":
- FfsFileObj.Alignment = self.__Token
-
- ## __GetAlignment() method
- #
- # Return the alignment value
- #
- # @param self The object pointer
- # @retval True Successfully find alignment
- # @retval False Not able to find alignment
- #
- def __GetAlignment(self):
- if self.__IsKeyword( "Align", True):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected alignment value", self.FileName, self.CurrentLineNumber)
- return True
-
- return False
-
- ## __GetFilePart() method
- #
- # Get section data for FILE statement
- #
- # @param self The object pointer
- # @param FfsFileObj for whom section is got
- # @param MacroDict dictionary used to replace macro
- #
- def __GetSectionData(self, FfsFileObj, MacroDict = {}):
- Dict = {}
- Dict.update(MacroDict)
-
- self.__GetDefineStatements(FfsFileObj)
-
- Dict.update(FfsFileObj.DefineVarDict)
- self.__GetAprioriSection(FfsFileObj, Dict.copy())
- self.__GetAprioriSection(FfsFileObj, Dict.copy())
-
- while True:
- IsLeafSection = self.__GetLeafSection(FfsFileObj, Dict)
- IsEncapSection = self.__GetEncapsulationSec(FfsFileObj)
- if not IsLeafSection and not IsEncapSection:
- break
-
- ## __GetLeafSection() method
- #
- # Get leaf section for Obj
- #
- # @param self The object pointer
- # @param Obj for whom leaf section is got
- # @param MacroDict dictionary used to replace macro
- # @retval True Successfully find section statement
- # @retval False Not able to find section statement
- #
- def __GetLeafSection(self, Obj, MacroDict = {}):
-
- OldPos = self.GetFileBufferPos()
-
- if not self.__IsKeyword( "SECTION"):
- if len(Obj.SectionList) == 0:
- raise Warning("expected SECTION", self.FileName, self.CurrentLineNumber)
- else:
- return False
-
- AlignValue = None
- if self.__GetAlignment():
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- AlignValue = self.__Token
-
- BuildNum = None
- if self.__IsKeyword( "BUILD_NUM"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Build number value", self.FileName, self.CurrentLineNumber)
-
- BuildNum = self.__Token
-
- if self.__IsKeyword( "VERSION"):
- if AlignValue == 'Auto':
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected version", self.FileName, self.CurrentLineNumber)
- VerSectionObj = VerSection.VerSection()
- VerSectionObj.Alignment = AlignValue
- VerSectionObj.BuildNum = BuildNum
- if self.__GetStringData():
- VerSectionObj.StringData = self.__Token
- else:
- VerSectionObj.FileName = self.__Token
- Obj.SectionList.append(VerSectionObj)
-
- elif self.__IsKeyword( "UI"):
- if AlignValue == 'Auto':
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected UI", self.FileName, self.CurrentLineNumber)
- UiSectionObj = UiSection.UiSection()
- UiSectionObj.Alignment = AlignValue
- if self.__GetStringData():
- UiSectionObj.StringData = self.__Token
- else:
- UiSectionObj.FileName = self.__Token
- Obj.SectionList.append(UiSectionObj)
-
- elif self.__IsKeyword( "FV_IMAGE"):
- if AlignValue == 'Auto':
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected FV name or FV file path", self.FileName, self.CurrentLineNumber)
-
- FvName = self.__Token
- FvObj = None
-
- if self.__IsToken( "{"):
- FvObj = Fv.FV()
- FvObj.UiFvName = FvName.upper()
- self.__GetDefineStatements(FvObj)
- MacroDict.update(FvObj.DefineVarDict)
- self.__GetBlockStatement(FvObj)
- self.__GetSetStatements(FvObj)
- self.__GetFvAlignment(FvObj)
- self.__GetFvAttributes(FvObj)
- self.__GetAprioriSection(FvObj, MacroDict.copy())
- self.__GetAprioriSection(FvObj, MacroDict.copy())
-
- while True:
- IsInf = self.__GetInfStatement(FvObj, MacroDict.copy())
- IsFile = self.__GetFileStatement(FvObj, MacroDict.copy())
- if not IsInf and not IsFile:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
-
- FvImageSectionObj = FvImageSection.FvImageSection()
- FvImageSectionObj.Alignment = AlignValue
- if FvObj != None:
- FvImageSectionObj.Fv = FvObj
- FvImageSectionObj.FvName = None
- else:
- FvImageSectionObj.FvName = FvName.upper()
- FvImageSectionObj.FvFileName = FvName
-
- Obj.SectionList.append(FvImageSectionObj)
-
- elif self.__IsKeyword("PEI_DEPEX_EXP") or self.__IsKeyword("DXE_DEPEX_EXP") or self.__IsKeyword("SMM_DEPEX_EXP"):
- if AlignValue == 'Auto':
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- DepexSectionObj = DepexSection.DepexSection()
- DepexSectionObj.Alignment = AlignValue
- DepexSectionObj.DepexType = self.__Token
-
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__IsToken( "{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
- if not self.__SkipToToken( "}"):
- raise Warning("expected Depex expression ending '}'", self.FileName, self.CurrentLineNumber)
-
- DepexSectionObj.Expression = self.__SkippedChars.rstrip('}')
- Obj.SectionList.append(DepexSectionObj)
-
- else:
- if not self.__GetNextWord():
- raise Warning("expected section type", self.FileName, self.CurrentLineNumber)
-
- # Encapsulation section appear, UndoToken and return
- if self.__Token == "COMPRESS" or self.__Token == "GUIDED":
- self.SetFileBufferPos(OldPos)
- return False
-
- if self.__Token not in ("COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
- "UI", "VERSION", "PEI_DEPEX", "SUBTYPE_GUID", "SMM_DEPEX"):
- raise Warning("Unknown section type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- if AlignValue == 'Auto'and (not self.__Token == 'PE32') and (not self.__Token == 'TE'):
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
-
- # DataSection
- DataSectionObj = DataSection.DataSection()
- DataSectionObj.Alignment = AlignValue
- DataSectionObj.SecType = self.__Token
-
- if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
- if self.__FileCouldHaveRelocFlag(Obj.FvFileType) and self.__SectionCouldHaveRelocFlag(DataSectionObj.SecType):
- if self.__Token == 'RELOCS_STRIPPED':
- DataSectionObj.KeepReloc = False
- else:
- DataSectionObj.KeepReloc = True
- else:
- raise Warning("File type %s, section type %s, could not have reloc strip flag%d" % (Obj.FvFileType, DataSectionObj.SecType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- if self.__IsToken("="):
- if not self.__GetNextToken():
- raise Warning("expected section file path", self.FileName, self.CurrentLineNumber)
- DataSectionObj.SectFileName = self.__Token
- if DataSectionObj.SectFileName.replace('$(WORKSPACE)', '').find('$') == -1:
- #do case sensitive check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(DataSectionObj.SectFileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
- else:
- if not self.__GetCglSection(DataSectionObj):
- return False
-
- Obj.SectionList.append(DataSectionObj)
-
- return True
-
- ## __GetCglSection() method
- #
- # Get compressed or GUIDed section for Obj
- #
- # @param self The object pointer
- # @param Obj for whom leaf section is got
- # @param AlignValue alignment value for complex section
- # @retval True Successfully find section statement
- # @retval False Not able to find section statement
- #
- def __GetCglSection(self, Obj, AlignValue = None):
-
- if self.__IsKeyword( "COMPRESS"):
- type = "PI_STD"
- if self.__IsKeyword("PI_STD") or self.__IsKeyword("PI_NONE"):
- type = self.__Token
-
- if not self.__IsToken("{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
-
- CompressSectionObj = CompressSection.CompressSection()
- CompressSectionObj.Alignment = AlignValue
- CompressSectionObj.CompType = type
- # Recursive sections...
- while True:
- IsLeafSection = self.__GetLeafSection(CompressSectionObj)
- IsEncapSection = self.__GetEncapsulationSec(CompressSectionObj)
- if not IsLeafSection and not IsEncapSection:
- break
-
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
- Obj.SectionList.append(CompressSectionObj)
-
-# else:
-# raise Warning("Compress type not known")
-
- return True
-
- elif self.__IsKeyword( "GUIDED"):
- GuidValue = None
- if self.__GetNextGuid():
- GuidValue = self.__Token
-
- AttribDict = self.__GetGuidAttrib()
- if not self.__IsToken("{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
- GuidSectionObj = GuidSection.GuidSection()
- GuidSectionObj.Alignment = AlignValue
- GuidSectionObj.NameGuid = GuidValue
- GuidSectionObj.SectionType = "GUIDED"
- GuidSectionObj.ProcessRequired = AttribDict["PROCESSING_REQUIRED"]
- GuidSectionObj.AuthStatusValid = AttribDict["AUTH_STATUS_VALID"]
- GuidSectionObj.ExtraHeaderSize = AttribDict["EXTRA_HEADER_SIZE"]
- # Recursive sections...
- while True:
- IsLeafSection = self.__GetLeafSection(GuidSectionObj)
- IsEncapSection = self.__GetEncapsulationSec(GuidSectionObj)
- if not IsLeafSection and not IsEncapSection:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
- Obj.SectionList.append(GuidSectionObj)
-
- return True
-
- return False
-
- ## __GetGuidAttri() method
- #
- # Get attributes for GUID section
- #
- # @param self The object pointer
- # @retval AttribDict Dictionary of key-value pair of section attributes
- #
- def __GetGuidAttrib(self):
-
- AttribDict = {}
- AttribDict["PROCESSING_REQUIRED"] = "NONE"
- AttribDict["AUTH_STATUS_VALID"] = "NONE"
- AttribDict["EXTRA_HEADER_SIZE"] = -1
- while self.__IsKeyword("PROCESSING_REQUIRED") or self.__IsKeyword("AUTH_STATUS_VALID") \
- or self.__IsKeyword("EXTRA_HEADER_SIZE"):
- AttribKey = self.__Token
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected TRUE(1)/FALSE(0)/Number", self.FileName, self.CurrentLineNumber)
- elif AttribKey == "EXTRA_HEADER_SIZE":
- Base = 10
- if self.__Token[0:2].upper() == "0X":
- Base = 16
- try:
- AttribDict[AttribKey] = int(self.__Token, Base)
- continue
- except ValueError:
- raise Warning("expected Number", self.FileName, self.CurrentLineNumber)
- elif self.__Token.upper() not in ("TRUE", "FALSE", "1", "0"):
- raise Warning("expected TRUE/FALSE (1/0)", self.FileName, self.CurrentLineNumber)
- AttribDict[AttribKey] = self.__Token
-
- return AttribDict
-
- ## __GetEncapsulationSec() method
- #
- # Get encapsulation section for FILE
- #
- # @param self The object pointer
- # @param FfsFile for whom section is got
- # @retval True Successfully find section statement
- # @retval False Not able to find section statement
- #
- def __GetEncapsulationSec(self, FfsFileObj):
-
- OldPos = self.GetFileBufferPos()
- if not self.__IsKeyword( "SECTION"):
- if len(FfsFileObj.SectionList) == 0:
- raise Warning("expected SECTION", self.FileName, self.CurrentLineNumber)
- else:
- return False
-
- AlignValue = None
- if self.__GetAlignment():
- if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- AlignValue = self.__Token
-
- if not self.__GetCglSection(FfsFileObj, AlignValue):
- self.SetFileBufferPos(OldPos)
- return False
- else:
- return True
-
- ## __GetCapsule() method
- #
- # Get capsule section contents and store its data into capsule list of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a capsule
- # @retval False Not able to find a capsule
- #
- def __GetCapsule(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[CAPSULE."):
- if not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
-
- self.__UndoToken()
- if not self.__IsToken("[CAPSULE.", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- # % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("expected [Capsule.]", self.FileName, self.CurrentLineNumber)
-
- CapsuleObj = Capsule.Capsule()
-
- CapsuleName = self.__GetUiName()
- if not CapsuleName:
- raise Warning("expected capsule name", self.FileName, self.CurrentLineNumber)
-
- CapsuleObj.UiCapsuleName = CapsuleName.upper()
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']'", self.FileName, self.CurrentLineNumber)
-
- if self.__IsKeyword("CREATE_FILE"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected file name", self.FileName, self.CurrentLineNumber)
-
- CapsuleObj.CreateFile = self.__Token
-
- self.__GetCapsuleStatements(CapsuleObj)
- self.Profile.CapsuleDict[CapsuleObj.UiCapsuleName] = CapsuleObj
- return True
-
- ## __GetCapsuleStatements() method
- #
- # Get statements for capsule
- #
- # @param self The object pointer
- # @param Obj for whom statements are got
- #
- def __GetCapsuleStatements(self, Obj):
- self.__GetCapsuleTokens(Obj)
- self.__GetDefineStatements(Obj)
- self.__GetSetStatements(Obj)
- self.__GetCapsuleData(Obj)
-
- ## __GetCapsuleTokens() method
- #
- # Get token statements for capsule
- #
- # @param self The object pointer
- # @param Obj for whom token statements are got
- #
- def __GetCapsuleTokens(self, Obj):
- if not self.__GetNextToken():
- return False
- while self.__Token in ("CAPSULE_GUID", "CAPSULE_HEADER_SIZE", "CAPSULE_FLAGS"):
- Name = self.__Token.strip()
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected value", self.FileName, self.CurrentLineNumber)
- if Name == 'CAPSULE_FLAGS':
- if not self.__Token in ("PersistAcrossReset", "PopulateSystemTable", "InitiateReset"):
- raise Warning("expected PersistAcrossReset, PopulateSystemTable, or InitiateReset", self.FileName, self.CurrentLineNumber)
- Value = self.__Token.strip()
- while self.__IsToken(","):
- Value += ','
- if not self.__GetNextToken():
- raise Warning("expected value", self.FileName, self.CurrentLineNumber)
- if not self.__Token in ("PersistAcrossReset", "PopulateSystemTable", "InitiateReset"):
- raise Warning("expected PersistAcrossReset, PopulateSystemTable, or InitiateReset", self.FileName, self.CurrentLineNumber)
- Value += self.__Token.strip()
- else:
- Value = self.__Token.strip()
- Obj.TokensDict[Name] = Value
- if not self.__GetNextToken():
- return False
- self.__UndoToken()
-
- ## __GetCapsuleData() method
- #
- # Get capsule data for capsule
- #
- # @param self The object pointer
- # @param Obj for whom capsule data are got
- #
- def __GetCapsuleData(self, Obj):
-
- while True:
- IsInf = self.__GetInfStatement(Obj, True)
- IsFile = self.__GetFileStatement(Obj, True)
- IsFv = self.__GetFvStatement(Obj)
- IsFd = self.__GetFdStatement(Obj)
- IsAnyFile = self.__GetAnyFileStatement(Obj)
- if not (IsInf or IsFile or IsFv or IsFd or IsAnyFile):
- break
-
- ## __GetFvStatement() method
- #
- # Get FV for capsule
- #
- # @param self The object pointer
- # @param CapsuleObj for whom FV is got
- # @retval True Successfully find a FV statement
- # @retval False Not able to find a FV statement
- #
- def __GetFvStatement(self, CapsuleObj):
-
- if not self.__IsKeyword("FV"):
- return False
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FV name", self.FileName, self.CurrentLineNumber)
-
- if self.__Token.upper() not in self.Profile.FvDict.keys():
- raise Warning("FV name does not exist", self.FileName, self.CurrentLineNumber)
-
- CapsuleFv = CapsuleData.CapsuleFv()
- CapsuleFv.FvName = self.__Token
- CapsuleObj.CapsuleDataList.append(CapsuleFv)
- return True
-
- ## __GetFdStatement() method
- #
- # Get FD for capsule
- #
- # @param self The object pointer
- # @param CapsuleObj for whom FD is got
- # @retval True Successfully find a FD statement
- # @retval False Not able to find a FD statement
- #
- def __GetFdStatement(self, CapsuleObj):
-
- if not self.__IsKeyword("FD"):
- return False
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected FD name", self.FileName, self.CurrentLineNumber)
-
- if self.__Token.upper() not in self.Profile.FdDict.keys():
- raise Warning("FD name does not exist", self.FileName, self.CurrentLineNumber)
-
- CapsuleFd = CapsuleData.CapsuleFd()
- CapsuleFd.FdName = self.__Token
- CapsuleObj.CapsuleDataList.append(CapsuleFd)
- return True
-
- ## __GetAnyFileStatement() method
- #
- # Get AnyFile for capsule
- #
- # @param self The object pointer
- # @param CapsuleObj for whom AnyFile is got
- # @retval True Successfully find a Anyfile statement
- # @retval False Not able to find a AnyFile statement
- #
- def __GetAnyFileStatement(self, CapsuleObj):
-
- if not self.__IsKeyword("FILE"):
- return False
-
- if not self.__IsKeyword("DATA"):
- self.__UndoToken()
- return False
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected File name", self.FileName, self.CurrentLineNumber)
-
- AnyFileName = self.__Token
- AnyFileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(AnyFileName)
- if not os.path.exists(AnyFileName):
- raise Warning("File %s not exists"%AnyFileName, self.FileName, self.CurrentLineNumber)
-
- CapsuleAnyFile = CapsuleData.CapsuleAnyFile()
- CapsuleAnyFile.FileName = AnyFileName
- CapsuleObj.CapsuleDataList.append(CapsuleAnyFile)
- return True
-
- ## __GetRule() method
- #
- # Get Rule section contents and store its data into rule list of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a Rule
- # @retval False Not able to find a Rule
- #
- def __GetRule(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[RULE."):
- if not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
- self.__UndoToken()
- if not self.__IsToken("[Rule.", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- # % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("expected [Rule.]", self.FileName, self.CurrentLineNumber)
-
- if not self.__SkipToToken("."):
- raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)
-
- Arch = self.__SkippedChars.rstrip(".")
- if Arch.upper() not in ("IA32", "X64", "IPF", "EBC", "ARM", "AARCH64", "COMMON"):
- raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)
-
- ModuleType = self.__GetModuleType()
-
- TemplateName = ""
- if self.__IsToken("."):
- if not self.__GetNextWord():
- raise Warning("expected template name", self.FileName, self.CurrentLineNumber)
- TemplateName = self.__Token
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']'", self.FileName, self.CurrentLineNumber)
-
- RuleObj = self.__GetRuleFileStatements()
- RuleObj.Arch = Arch.upper()
- RuleObj.ModuleType = ModuleType
- RuleObj.TemplateName = TemplateName
- if TemplateName == '' :
- self.Profile.RuleDict['RULE' + \
- '.' + \
- Arch.upper() + \
- '.' + \
- ModuleType.upper() ] = RuleObj
- else :
- self.Profile.RuleDict['RULE' + \
- '.' + \
- Arch.upper() + \
- '.' + \
- ModuleType.upper() + \
- '.' + \
- TemplateName.upper() ] = RuleObj
-# self.Profile.RuleList.append(rule)
- return True
-
- ## __GetModuleType() method
- #
- # Return the module type
- #
- # @param self The object pointer
- # @retval string module type
- #
- def __GetModuleType(self):
-
- if not self.__GetNextWord():
- raise Warning("expected Module type", self.FileName, self.CurrentLineNumber)
- if self.__Token.upper() not in ("SEC", "PEI_CORE", "PEIM", "DXE_CORE", \
- "DXE_DRIVER", "DXE_SAL_DRIVER", \
- "DXE_SMM_DRIVER", "DXE_RUNTIME_DRIVER", \
- "UEFI_DRIVER", "UEFI_APPLICATION", "USER_DEFINED", "DEFAULT", "BASE", \
- "SECURITY_CORE", "COMBINED_PEIM_DRIVER", "PIC_PEIM", "RELOCATABLE_PEIM", \
- "PE32_PEIM", "BS_DRIVER", "RT_DRIVER", "SAL_RT_DRIVER", "APPLICATION", "ACPITABLE", "SMM_CORE"):
- raise Warning("Unknown Module type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- return self.__Token
-
- ## __GetFileExtension() method
- #
- # Return the file extension
- #
- # @param self The object pointer
- # @retval string file name extension
- #
- def __GetFileExtension(self):
- if not self.__IsToken("."):
- raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)
-
- Ext = ""
- if self.__GetNextToken():
- Pattern = re.compile(r'([a-zA-Z][a-zA-Z0-9]*)')
- if Pattern.match(self.__Token):
- Ext = self.__Token
- return '.' + Ext
- else:
- raise Warning("Unknown file extension '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
-
- else:
- raise Warning("expected file extension", self.FileName, self.CurrentLineNumber)
-
- ## __GetRuleFileStatement() method
- #
- # Get rule contents
- #
- # @param self The object pointer
- # @retval Rule Rule object
- #
- def __GetRuleFileStatements(self):
-
- if not self.__IsKeyword("FILE"):
- raise Warning("expected FILE", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextWord():
- raise Warning("expected FFS type", self.FileName, self.CurrentLineNumber)
-
- Type = self.__Token.strip().upper()
- if Type not in ("RAW", "FREEFORM", "SEC", "PEI_CORE", "PEIM",\
- "PEI_DXE_COMBO", "DRIVER", "DXE_CORE", "APPLICATION", "FV_IMAGE", "SMM", "SMM_CORE"):
- raise Warning("Unknown FV type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsKeyword("$(NAMED_GUID)"):
- if not self.__GetNextWord():
- raise Warning("expected $(NAMED_GUID)", self.FileName, self.CurrentLineNumber)
- if self.__Token == 'PCD':
- if not self.__IsToken( "("):
- raise Warning("expected '('", self.FileName, self.CurrentLineNumber)
- PcdPair = self.__GetNextPcdName()
- if not self.__IsToken( ")"):
- raise Warning("expected ')'", self.FileName, self.CurrentLineNumber)
- self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'
-
- NameGuid = self.__Token
-
- KeepReloc = None
- if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
- if self.__FileCouldHaveRelocFlag(Type):
- if self.__Token == 'RELOCS_STRIPPED':
- KeepReloc = False
- else:
- KeepReloc = True
- else:
- raise Warning("File type %s could not have reloc strip flag%d" % (Type, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- KeyStringList = []
- if self.__GetNextToken():
- Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
- if Pattern.match(self.__Token):
- KeyStringList.append(self.__Token)
- if self.__IsToken(","):
- while self.__GetNextToken():
- if not Pattern.match(self.__Token):
- raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
- KeyStringList.append(self.__Token)
-
- if not self.__IsToken(","):
- break
-
- else:
- self.__UndoToken()
-
-
- Fixed = False
- if self.__IsKeyword("Fixed", True):
- Fixed = True
-
- CheckSum = False
- if self.__IsKeyword("CheckSum", True):
- CheckSum = True
-
- AlignValue = ""
- if self.__GetAlignment():
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- #For FFS, Auto is default option same to ""
- if not self.__Token == "Auto":
- AlignValue = self.__Token
-
- if self.__IsToken("{"):
- # Complex file rule expected
- Rule = RuleComplexFile.RuleComplexFile()
- Rule.FvFileType = Type
- Rule.NameGuid = NameGuid
- Rule.Alignment = AlignValue
- Rule.CheckSum = CheckSum
- Rule.Fixed = Fixed
- Rule.KeyStringList = KeyStringList
- if KeepReloc != None:
- Rule.KeepReloc = KeepReloc
-
- while True:
- IsEncapsulate = self.__GetRuleEncapsulationSection(Rule)
- IsLeaf = self.__GetEfiSection(Rule)
- if not IsEncapsulate and not IsLeaf:
- break
-
- if not self.__IsToken("}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
-
- return Rule
-
- else:
- # Simple file rule expected
- if not self.__GetNextWord():
- raise Warning("expected leaf section type", self.FileName, self.CurrentLineNumber)
-
- SectionName = self.__Token
-
- if SectionName not in ("COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
- "UI", "PEI_DEPEX", "VERSION", "SUBTYPE_GUID", "SMM_DEPEX"):
- raise Warning("Unknown leaf section name '%s'" % SectionName, self.FileName, self.CurrentLineNumber)
-
-
- if self.__IsKeyword("Fixed", True):
- Fixed = True
-
- if self.__IsKeyword("CheckSum", True):
- CheckSum = True
-
- SectAlignment = ""
- if self.__GetAlignment():
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- SectAlignment = self.__Token
-
- Ext = None
- if self.__IsToken('|'):
- Ext = self.__GetFileExtension()
- elif not self.__GetNextToken():
- raise Warning("expected File name", self.FileName, self.CurrentLineNumber)
-
- Rule = RuleSimpleFile.RuleSimpleFile()
- Rule.SectionType = SectionName
- Rule.FvFileType = Type
- Rule.NameGuid = NameGuid
- Rule.Alignment = AlignValue
- Rule.SectAlignment = SectAlignment
- Rule.CheckSum = CheckSum
- Rule.Fixed = Fixed
- Rule.KeyStringList = KeyStringList
- if KeepReloc != None:
- Rule.KeepReloc = KeepReloc
- Rule.FileExtension = Ext
- Rule.FileName = self.__Token
- return Rule
-
- ## __GetEfiSection() method
- #
- # Get section list for Rule
- #
- # @param self The object pointer
- # @param Obj for whom section is got
- # @retval True Successfully find section statement
- # @retval False Not able to find section statement
- #
- def __GetEfiSection(self, Obj):
-
- OldPos = self.GetFileBufferPos()
- if not self.__GetNextWord():
- return False
- SectionName = self.__Token
-
- if SectionName not in ("COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
- "UI", "VERSION", "PEI_DEPEX", "GUID", "SMM_DEPEX"):
- self.__UndoToken()
- return False
-
- if SectionName == "FV_IMAGE":
- FvImageSectionObj = FvImageSection.FvImageSection()
- if self.__IsKeyword("FV_IMAGE"):
- pass
- if self.__IsToken( "{"):
- FvObj = Fv.FV()
- self.__GetDefineStatements(FvObj)
- self.__GetBlockStatement(FvObj)
- self.__GetSetStatements(FvObj)
- self.__GetFvAlignment(FvObj)
- self.__GetFvAttributes(FvObj)
- self.__GetAprioriSection(FvObj)
- self.__GetAprioriSection(FvObj)
-
- while True:
- IsInf = self.__GetInfStatement(FvObj)
- IsFile = self.__GetFileStatement(FvObj)
- if not IsInf and not IsFile:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
- FvImageSectionObj.Fv = FvObj
- FvImageSectionObj.FvName = None
-
- else:
- if not self.__IsKeyword("FV"):
- raise Warning("expected 'FV'", self.FileName, self.CurrentLineNumber)
- FvImageSectionObj.FvFileType = self.__Token
-
- if self.__GetAlignment():
- if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- FvImageSectionObj.Alignment = self.__Token
-
- if self.__IsToken('|'):
- FvImageSectionObj.FvFileExtension = self.__GetFileExtension()
- elif self.__GetNextToken():
- if self.__Token not in ("}", "COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
- "UI", "VERSION", "PEI_DEPEX", "GUID", "SMM_DEPEX"):
- FvImageSectionObj.FvFileName = self.__Token
- else:
- self.__UndoToken()
- else:
- raise Warning("expected FV file name", self.FileName, self.CurrentLineNumber)
-
- Obj.SectionList.append(FvImageSectionObj)
- return True
-
- EfiSectionObj = EfiSection.EfiSection()
- EfiSectionObj.SectionType = SectionName
-
- if not self.__GetNextToken():
- raise Warning("expected file type", self.FileName, self.CurrentLineNumber)
-
- if self.__Token == "STRING":
- if not self.__RuleSectionCouldHaveString(EfiSectionObj.SectionType):
- raise Warning("%s section could NOT have string data%d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken('='):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Quoted String", self.FileName, self.CurrentLineNumber)
-
- if self.__GetStringData():
- EfiSectionObj.StringData = self.__Token
-
- if self.__IsKeyword("BUILD_NUM"):
- if not self.__RuleSectionCouldHaveBuildNum(EfiSectionObj.SectionType):
- raise Warning("%s section could NOT have BUILD_NUM%d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected Build number", self.FileName, self.CurrentLineNumber)
- EfiSectionObj.BuildNum = self.__Token
-
- else:
- EfiSectionObj.FileType = self.__Token
- self.__CheckRuleSectionFileType(EfiSectionObj.SectionType, EfiSectionObj.FileType)
-
- if self.__IsKeyword("Optional"):
- if not self.__RuleSectionCouldBeOptional(EfiSectionObj.SectionType):
- raise Warning("%s section could NOT be optional%d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
- EfiSectionObj.Optional = True
-
- if self.__IsKeyword("BUILD_NUM"):
- if not self.__RuleSectionCouldHaveBuildNum(EfiSectionObj.SectionType):
- raise Warning("%s section could NOT have BUILD_NUM%d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected Build number", self.FileName, self.CurrentLineNumber)
- EfiSectionObj.BuildNum = self.__Token
-
- if self.__GetAlignment():
- if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
- raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):
- raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
- EfiSectionObj.Alignment = self.__Token
-
- if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
- if self.__SectionCouldHaveRelocFlag(EfiSectionObj.SectionType):
- if self.__Token == 'RELOCS_STRIPPED':
- EfiSectionObj.KeepReloc = False
- else:
- EfiSectionObj.KeepReloc = True
- if Obj.KeepReloc != None and Obj.KeepReloc != EfiSectionObj.KeepReloc:
- raise Warning("Section type %s has reloc strip flag conflict with Rule" % EfiSectionObj.SectionType, self.FileName, self.CurrentLineNumber)
- else:
- raise Warning("Section type %s could not have reloc strip flag" % EfiSectionObj.SectionType, self.FileName, self.CurrentLineNumber)
-
-
- if self.__IsToken('|'):
- EfiSectionObj.FileExtension = self.__GetFileExtension()
- elif self.__GetNextToken():
- if self.__Token not in ("}", "COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
- "UI", "VERSION", "PEI_DEPEX", "GUID", "SMM_DEPEX"):
-
- if self.__Token.startswith('PCD'):
- self.__UndoToken()
- self.__GetNextWord()
-
- if self.__Token == 'PCD':
- if not self.__IsToken( "("):
- raise Warning("expected '('", self.FileName, self.CurrentLineNumber)
- PcdPair = self.__GetNextPcdName()
- if not self.__IsToken( ")"):
- raise Warning("expected ')'", self.FileName, self.CurrentLineNumber)
- self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'
-
- EfiSectionObj.FileName = self.__Token
-
- else:
- self.__UndoToken()
- else:
- raise Warning("expected section file name", self.FileName, self.CurrentLineNumber)
-
- Obj.SectionList.append(EfiSectionObj)
- return True
-
- ## __RuleSectionCouldBeOptional() method
- #
- # Get whether a section could be optional
- #
- # @param self The object pointer
- # @param SectionType The section type to check
- # @retval True section could be optional
- # @retval False section never optional
- #
- def __RuleSectionCouldBeOptional(self, SectionType):
- if SectionType in ("DXE_DEPEX", "UI", "VERSION", "PEI_DEPEX", "RAW", "SMM_DEPEX"):
- return True
- else:
- return False
-
- ## __RuleSectionCouldHaveBuildNum() method
- #
- # Get whether a section could have build number information
- #
- # @param self The object pointer
- # @param SectionType The section type to check
- # @retval True section could have build number information
- # @retval False section never have build number information
- #
- def __RuleSectionCouldHaveBuildNum(self, SectionType):
- if SectionType in ("VERSION"):
- return True
- else:
- return False
-
- ## __RuleSectionCouldHaveString() method
- #
- # Get whether a section could have string
- #
- # @param self The object pointer
- # @param SectionType The section type to check
- # @retval True section could have string
- # @retval False section never have string
- #
- def __RuleSectionCouldHaveString(self, SectionType):
- if SectionType in ("UI", "VERSION"):
- return True
- else:
- return False
-
- ## __CheckRuleSectionFileType() method
- #
- # Get whether a section matches a file type
- #
- # @param self The object pointer
- # @param SectionType The section type to check
- # @param FileType The file type to check
- #
- def __CheckRuleSectionFileType(self, SectionType, FileType):
- if SectionType == "COMPAT16":
- if FileType not in ("COMPAT16", "SEC_COMPAT16"):
- raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
- elif SectionType == "PE32":
- if FileType not in ("PE32", "SEC_PE32"):
- raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
- elif SectionType == "PIC":
- if FileType not in ("PIC", "PIC"):
- raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
- elif SectionType == "TE":
- if FileType not in ("TE", "SEC_TE"):
- raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
- elif SectionType == "RAW":
- if FileType not in ("BIN", "SEC_BIN", "RAW", "ASL", "ACPI"):
- raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
- elif SectionType == "DXE_DEPEX" or SectionType == "SMM_DEPEX":
- if FileType not in ("DXE_DEPEX", "SEC_DXE_DEPEX", "SMM_DEPEX"):
- raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
- elif SectionType == "UI":
- if FileType not in ("UI", "SEC_UI"):
- raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
- elif SectionType == "VERSION":
- if FileType not in ("VERSION", "SEC_VERSION"):
- raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
- elif SectionType == "PEI_DEPEX":
- if FileType not in ("PEI_DEPEX", "SEC_PEI_DEPEX"):
- raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
- elif SectionType == "GUID":
- if FileType not in ("PE32", "SEC_GUID"):
- raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
-
- ## __GetRuleEncapsulationSection() method
- #
- # Get encapsulation section for Rule
- #
- # @param self The object pointer
- # @param Rule for whom section is got
- # @retval True Successfully find section statement
- # @retval False Not able to find section statement
- #
- def __GetRuleEncapsulationSection(self, Rule):
-
- if self.__IsKeyword( "COMPRESS"):
- Type = "PI_STD"
- if self.__IsKeyword("PI_STD") or self.__IsKeyword("PI_NONE"):
- Type = self.__Token
-
- if not self.__IsToken("{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
-
- CompressSectionObj = CompressSection.CompressSection()
-
- CompressSectionObj.CompType = Type
- # Recursive sections...
- while True:
- IsEncapsulate = self.__GetRuleEncapsulationSection(CompressSectionObj)
- IsLeaf = self.__GetEfiSection(CompressSectionObj)
- if not IsEncapsulate and not IsLeaf:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
- Rule.SectionList.append(CompressSectionObj)
-
- return True
-
- elif self.__IsKeyword( "GUIDED"):
- GuidValue = None
- if self.__GetNextGuid():
- GuidValue = self.__Token
-
- if self.__IsKeyword( "$(NAMED_GUID)"):
- GuidValue = self.__Token
-
- AttribDict = self.__GetGuidAttrib()
-
- if not self.__IsToken("{"):
- raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
- GuidSectionObj = GuidSection.GuidSection()
- GuidSectionObj.NameGuid = GuidValue
- GuidSectionObj.SectionType = "GUIDED"
- GuidSectionObj.ProcessRequired = AttribDict["PROCESSING_REQUIRED"]
- GuidSectionObj.AuthStatusValid = AttribDict["AUTH_STATUS_VALID"]
- GuidSectionObj.ExtraHeaderSize = AttribDict["EXTRA_HEADER_SIZE"]
-
- # Efi sections...
- while True:
- IsEncapsulate = self.__GetRuleEncapsulationSection(GuidSectionObj)
- IsLeaf = self.__GetEfiSection(GuidSectionObj)
- if not IsEncapsulate and not IsLeaf:
- break
-
- if not self.__IsToken( "}"):
- raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
- Rule.SectionList.append(GuidSectionObj)
-
- return True
-
- return False
-
- ## __GetVtf() method
- #
- # Get VTF section contents and store its data into VTF list of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a VTF
- # @retval False Not able to find a VTF
- #
- def __GetVtf(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[VTF."):
- if not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
- self.__UndoToken()
- return False
-
- self.__UndoToken()
- if not self.__IsToken("[VTF.", True):
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
- # % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
- raise Warning("expected [VTF.]", self.FileName, self.CurrentLineNumber)
-
- if not self.__SkipToToken("."):
- raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)
-
- Arch = self.__SkippedChars.rstrip(".").upper()
- if Arch not in ("IA32", "X64", "IPF", "ARM", "AARCH64"):
- raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextWord():
- raise Warning("expected VTF name", self.FileName, self.CurrentLineNumber)
- Name = self.__Token.upper()
-
- VtfObj = Vtf.Vtf()
- VtfObj.UiName = Name
- VtfObj.KeyArch = Arch
-
- if self.__IsToken(","):
- if not self.__GetNextWord():
- raise Warning("expected Arch list", self.FileName, self.CurrentLineNumber)
- if self.__Token.upper() not in ("IA32", "X64", "IPF", "ARM", "AARCH64"):
- raise Warning("Unknown Arch '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- VtfObj.ArchList = self.__Token.upper()
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']'", self.FileName, self.CurrentLineNumber)
-
- if self.__IsKeyword("IA32_RST_BIN"):
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Reset file", self.FileName, self.CurrentLineNumber)
-
- VtfObj.ResetBin = self.__Token
- if VtfObj.ResetBin.replace('$(WORKSPACE)', '').find('$') == -1:
- #check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(VtfObj.ResetBin), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
-
- while self.__GetComponentStatement(VtfObj):
- pass
-
- self.Profile.VtfList.append(VtfObj)
- return True
-
- ## __GetComponentStatement() method
- #
- # Get components in VTF
- #
- # @param self The object pointer
- # @param VtfObj for whom component is got
- # @retval True Successfully find a component
- # @retval False Not able to find a component
- #
- def __GetComponentStatement(self, VtfObj):
-
- if not self.__IsKeyword("COMP_NAME"):
- return False
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextWord():
- raise Warning("expected Component Name", self.FileName, self.CurrentLineNumber)
-
- CompStatementObj = ComponentStatement.ComponentStatement()
- CompStatementObj.CompName = self.__Token
-
- if not self.__IsKeyword("COMP_LOC"):
- raise Warning("expected COMP_LOC", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- CompStatementObj.CompLoc = ""
- if self.__GetNextWord():
- CompStatementObj.CompLoc = self.__Token
- if self.__IsToken('|'):
- if not self.__GetNextWord():
- raise Warning("Expected Region Name", self.FileName, self.CurrentLineNumber)
-
- if self.__Token not in ("F", "N", "S"): #, "H", "L", "PH", "PL"): not support
- raise Warning("Unknown location type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
-
- CompStatementObj.FilePos = self.__Token
- else:
- self.CurrentLineNumber += 1
- self.CurrentOffsetWithinLine = 0
-
- if not self.__IsKeyword("COMP_TYPE"):
- raise Warning("expected COMP_TYPE", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Component type", self.FileName, self.CurrentLineNumber)
- if self.__Token not in ("FIT", "PAL_B", "PAL_A", "OEM"):
- if not self.__Token.startswith("0x") or len(self.__Token) < 3 or len(self.__Token) > 4 or \
- not self.__HexDigit(self.__Token[2]) or not self.__HexDigit(self.__Token[-1]):
- raise Warning("Unknown location type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- CompStatementObj.CompType = self.__Token
-
- if not self.__IsKeyword("COMP_VER"):
- raise Warning("expected COMP_VER", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Component version", self.FileName, self.CurrentLineNumber)
-
- Pattern = re.compile('-$|[0-9a-fA-F]{1,2}\.[0-9a-fA-F]{1,2}$', re.DOTALL)
- if Pattern.match(self.__Token) == None:
- raise Warning("Unknown version format '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- CompStatementObj.CompVer = self.__Token
-
- if not self.__IsKeyword("COMP_CS"):
- raise Warning("expected COMP_CS", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Component CS", self.FileName, self.CurrentLineNumber)
- if self.__Token not in ("1", "0"):
- raise Warning("Unknown Component CS '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
- CompStatementObj.CompCs = self.__Token
-
-
- if not self.__IsKeyword("COMP_BIN"):
- raise Warning("expected COMP_BIN", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Component file", self.FileName, self.CurrentLineNumber)
-
- CompStatementObj.CompBin = self.__Token
- if CompStatementObj.CompBin != '-' and CompStatementObj.CompBin.replace('$(WORKSPACE)', '').find('$') == -1:
- #check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(CompStatementObj.CompBin), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
-
- if not self.__IsKeyword("COMP_SYM"):
- raise Warning("expected COMP_SYM", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if not self.__GetNextToken():
- raise Warning("expected Component symbol file", self.FileName, self.CurrentLineNumber)
-
- CompStatementObj.CompSym = self.__Token
- if CompStatementObj.CompSym != '-' and CompStatementObj.CompSym.replace('$(WORKSPACE)', '').find('$') == -1:
- #check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(CompStatementObj.CompSym), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
-
- if not self.__IsKeyword("COMP_SIZE"):
- raise Warning("expected COMP_SIZE", self.FileName, self.CurrentLineNumber)
-
- if not self.__IsToken("="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-
- if self.__IsToken("-"):
- CompStatementObj.CompSize = self.__Token
- elif self.__GetNextDecimalNumber():
- CompStatementObj.CompSize = self.__Token
- elif self.__GetNextHexNumber():
- CompStatementObj.CompSize = self.__Token
- else:
- raise Warning("Unknown size '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
-
- VtfObj.ComponentStatementList.append(CompStatementObj)
- return True
-
- ## __GetOptionRom() method
- #
- # Get OptionROM section contents and store its data into OptionROM list of self.Profile
- #
- # @param self The object pointer
- # @retval True Successfully find a OptionROM
- # @retval False Not able to find a OptionROM
- #
- def __GetOptionRom(self):
-
- if not self.__GetNextToken():
- return False
-
- S = self.__Token.upper()
- if S.startswith("[") and not S.startswith("[OPTIONROM."):
- raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
-
- self.__UndoToken()
- if not self.__IsToken("[OptionRom.", True):
- raise Warning("Unknown Keyword '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
-
- OptRomName = self.__GetUiName()
-
- if not self.__IsToken( "]"):
- raise Warning("expected ']'", self.FileName, self.CurrentLineNumber)
-
- OptRomObj = OptionRom.OPTIONROM()
- OptRomObj.DriverName = OptRomName
- self.Profile.OptRomDict[OptRomName] = OptRomObj
-
- while True:
- isInf = self.__GetOptRomInfStatement(OptRomObj)
- isFile = self.__GetOptRomFileStatement(OptRomObj)
- if not isInf and not isFile:
- break
-
- return True
-
- ## __GetOptRomInfStatement() method
- #
- # Get INF statements
- #
- # @param self The object pointer
- # @param Obj for whom inf statement is got
- # @retval True Successfully find inf statement
- # @retval False Not able to find inf statement
- #
- def __GetOptRomInfStatement(self, Obj):
-
- if not self.__IsKeyword( "INF"):
- return False
-
- ffsInf = OptRomInfStatement.OptRomInfStatement()
- self.__GetInfOptions( ffsInf)
-
- if not self.__GetNextToken():
- raise Warning("expected INF file path", self.FileName, self.CurrentLineNumber)
- ffsInf.InfFileName = self.__Token
- if ffsInf.InfFileName.replace('$(WORKSPACE)', '').find('$') == -1:
- #check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(ffsInf.InfFileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
-
- if not ffsInf.InfFileName in self.Profile.InfList:
- self.Profile.InfList.append(ffsInf.InfFileName)
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.InfFileLineList.append(FileLineTuple)
-
-
- self.__GetOptRomOverrides (ffsInf)
-
- Obj.FfsList.append(ffsInf)
- return True
-
- ## __GetOptRomOverrides() method
- #
- # Get overrides for OptROM INF & FILE
- #
- # @param self The object pointer
- # @param FfsInfObj for whom overrides is got
- #
- def __GetOptRomOverrides(self, Obj):
- if self.__IsToken('{'):
- Overrides = OptionRom.OverrideAttribs()
- while True:
- if self.__IsKeyword( "PCI_VENDOR_ID"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex vendor id", self.FileName, self.CurrentLineNumber)
- Overrides.PciVendorId = self.__Token
- continue
-
- if self.__IsKeyword( "PCI_CLASS_CODE"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex class code", self.FileName, self.CurrentLineNumber)
- Overrides.PciClassCode = self.__Token
- continue
-
- if self.__IsKeyword( "PCI_DEVICE_ID"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex device id", self.FileName, self.CurrentLineNumber)
-
- Overrides.PciDeviceId = self.__Token
- continue
-
- if self.__IsKeyword( "PCI_REVISION"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextHexNumber():
- raise Warning("expected Hex revision", self.FileName, self.CurrentLineNumber)
- Overrides.PciRevision = self.__Token
- continue
-
- if self.__IsKeyword( "PCI_COMPRESS"):
- if not self.__IsToken( "="):
- raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
- if not self.__GetNextToken():
- raise Warning("expected TRUE/FALSE for compress", self.FileName, self.CurrentLineNumber)
- Overrides.NeedCompress = self.__Token.upper() == 'TRUE'
- continue
-
- if self.__IsToken( "}"):
- break
- else:
- EdkLogger.error("FdfParser", FORMAT_INVALID, File=self.FileName, Line=self.CurrentLineNumber)
-
- Obj.OverrideAttribs = Overrides
-
- ## __GetOptRomFileStatement() method
- #
- # Get FILE statements
- #
- # @param self The object pointer
- # @param Obj for whom FILE statement is got
- # @retval True Successfully find FILE statement
- # @retval False Not able to find FILE statement
- #
- def __GetOptRomFileStatement(self, Obj):
-
- if not self.__IsKeyword( "FILE"):
- return False
-
- FfsFileObj = OptRomFileStatement.OptRomFileStatement()
-
- if not self.__IsKeyword("EFI") and not self.__IsKeyword("BIN"):
- raise Warning("expected Binary type (EFI/BIN)", self.FileName, self.CurrentLineNumber)
- FfsFileObj.FileType = self.__Token
-
- if not self.__GetNextToken():
- raise Warning("expected File path", self.FileName, self.CurrentLineNumber)
- FfsFileObj.FileName = self.__Token
- if FfsFileObj.FileName.replace('$(WORKSPACE)', '').find('$') == -1:
- #check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
-
- if FfsFileObj.FileType == 'EFI':
- self.__GetOptRomOverrides(FfsFileObj)
-
- Obj.FfsList.append(FfsFileObj)
-
- return True
-
- ## __GetCapInFd() method
- #
- # Get Cap list contained in FD
- #
- # @param self The object pointer
- # @param FdName FD name
- # @retval CapList List of Capsule in FD
- #
- def __GetCapInFd (self, FdName):
-
- CapList = []
- if FdName.upper() in self.Profile.FdDict.keys():
- FdObj = self.Profile.FdDict[FdName.upper()]
- for elementRegion in FdObj.RegionList:
- if elementRegion.RegionType == 'CAPSULE':
- for elementRegionData in elementRegion.RegionDataList:
- if elementRegionData.endswith(".cap"):
- continue
- if elementRegionData != None and elementRegionData.upper() not in CapList:
- CapList.append(elementRegionData.upper())
- return CapList
-
- ## __GetReferencedFdCapTuple() method
- #
- # Get FV and FD list referenced by a capsule image
- #
- # @param self The object pointer
- # @param CapObj Capsule section to be searched
- # @param RefFdList referenced FD by section
- # @param RefFvList referenced FV by section
- #
- def __GetReferencedFdCapTuple(self, CapObj, RefFdList = [], RefFvList = []):
-
- for CapsuleDataObj in CapObj.CapsuleDataList :
- if hasattr(CapsuleDataObj, 'FvName') and CapsuleDataObj.FvName != None and CapsuleDataObj.FvName.upper() not in RefFvList:
- RefFvList.append (CapsuleDataObj.FvName.upper())
- elif hasattr(CapsuleDataObj, 'FdName') and CapsuleDataObj.FdName != None and CapsuleDataObj.FdName.upper() not in RefFdList:
- RefFdList.append (CapsuleDataObj.FdName.upper())
- elif CapsuleDataObj.Ffs != None:
- if isinstance(CapsuleDataObj.Ffs, FfsFileStatement.FileStatement):
- if CapsuleDataObj.Ffs.FvName != None and CapsuleDataObj.Ffs.FvName.upper() not in RefFvList:
- RefFvList.append(CapsuleDataObj.Ffs.FvName.upper())
- elif CapsuleDataObj.Ffs.FdName != None and CapsuleDataObj.Ffs.FdName.upper() not in RefFdList:
- RefFdList.append(CapsuleDataObj.Ffs.FdName.upper())
- else:
- self.__GetReferencedFdFvTupleFromSection(CapsuleDataObj.Ffs, RefFdList, RefFvList)
-
- ## __GetFvInFd() method
- #
- # Get FV list contained in FD
- #
- # @param self The object pointer
- # @param FdName FD name
- # @retval FvList list of FV in FD
- #
- def __GetFvInFd (self, FdName):
-
- FvList = []
- if FdName.upper() in self.Profile.FdDict.keys():
- FdObj = self.Profile.FdDict[FdName.upper()]
- for elementRegion in FdObj.RegionList:
- if elementRegion.RegionType == 'FV':
- for elementRegionData in elementRegion.RegionDataList:
- if elementRegionData.endswith(".fv"):
- continue
- if elementRegionData != None and elementRegionData.upper() not in FvList:
- FvList.append(elementRegionData.upper())
- return FvList
-
- ## __GetReferencedFdFvTuple() method
- #
- # Get FD and FV list referenced by a FFS file
- #
- # @param self The object pointer
- # @param FfsFile contains sections to be searched
- # @param RefFdList referenced FD by section
- # @param RefFvList referenced FV by section
- #
- def __GetReferencedFdFvTuple(self, FvObj, RefFdList = [], RefFvList = []):
-
- for FfsObj in FvObj.FfsList:
- if isinstance(FfsObj, FfsFileStatement.FileStatement):
- if FfsObj.FvName != None and FfsObj.FvName.upper() not in RefFvList:
- RefFvList.append(FfsObj.FvName.upper())
- elif FfsObj.FdName != None and FfsObj.FdName.upper() not in RefFdList:
- RefFdList.append(FfsObj.FdName.upper())
- else:
- self.__GetReferencedFdFvTupleFromSection(FfsObj, RefFdList, RefFvList)
-
- ## __GetReferencedFdFvTupleFromSection() method
- #
- # Get FD and FV list referenced by a FFS section
- #
- # @param self The object pointer
- # @param FfsFile contains sections to be searched
- # @param FdList referenced FD by section
- # @param FvList referenced FV by section
- #
- def __GetReferencedFdFvTupleFromSection(self, FfsFile, FdList = [], FvList = []):
-
- SectionStack = []
- SectionStack.extend(FfsFile.SectionList)
- while SectionStack != []:
- SectionObj = SectionStack.pop()
- if isinstance(SectionObj, FvImageSection.FvImageSection):
- if SectionObj.FvName != None and SectionObj.FvName.upper() not in FvList:
- FvList.append(SectionObj.FvName.upper())
- if SectionObj.Fv != None and SectionObj.Fv.UiFvName != None and SectionObj.Fv.UiFvName.upper() not in FvList:
- FvList.append(SectionObj.Fv.UiFvName.upper())
- self.__GetReferencedFdFvTuple(SectionObj.Fv, FdList, FvList)
-
- if isinstance(SectionObj, CompressSection.CompressSection) or isinstance(SectionObj, GuidSection.GuidSection):
- SectionStack.extend(SectionObj.SectionList)
-
- ## CycleReferenceCheck() method
- #
- # Check whether cycle reference exists in FDF
- #
- # @param self The object pointer
- # @retval True cycle reference exists
- # @retval False Not exists cycle reference
- #
- def CycleReferenceCheck(self):
- #
- # Check the cycle between FV and FD image
- #
- MaxLength = len (self.Profile.FvDict)
- for FvName in self.Profile.FvDict.keys():
- LogStr = "\nCycle Reference Checking for FV: %s\n" % FvName
- RefFvStack = []
- RefFvStack.append(FvName)
- FdAnalyzedList = []
-
- Index = 0
- while RefFvStack != [] and Index < MaxLength:
- Index = Index + 1
- FvNameFromStack = RefFvStack.pop()
- if FvNameFromStack.upper() in self.Profile.FvDict.keys():
- FvObj = self.Profile.FvDict[FvNameFromStack.upper()]
- else:
- continue
-
- RefFdList = []
- RefFvList = []
- self.__GetReferencedFdFvTuple(FvObj, RefFdList, RefFvList)
-
- for RefFdName in RefFdList:
- if RefFdName in FdAnalyzedList:
- continue
-
- LogStr += "FV %s contains FD %s\n" % (FvNameFromStack, RefFdName)
- FvInFdList = self.__GetFvInFd(RefFdName)
- if FvInFdList != []:
- for FvNameInFd in FvInFdList:
- LogStr += "FD %s contains FV %s\n" % (RefFdName,FvNameInFd)
- if FvNameInFd not in RefFvStack:
- RefFvStack.append(FvNameInFd)
-
- if FvName in RefFvStack or FvNameFromStack in RefFvStack:
- EdkLogger.info(LogStr)
- return True
- FdAnalyzedList.append(RefFdName)
-
- for RefFvName in RefFvList:
- LogStr += "FV %s contains FV %s\n" % (FvNameFromStack, RefFvName)
- if RefFvName not in RefFvStack:
- RefFvStack.append(RefFvName)
-
- if FvName in RefFvStack or FvNameFromStack in RefFvStack:
- EdkLogger.info(LogStr)
- return True
-
- #
- # Check the cycle between Capsule and FD image
- #
- MaxLength = len (self.Profile.CapsuleDict)
- for CapName in self.Profile.CapsuleDict.keys():
- #
- # Capsule image to be checked.
- #
- LogStr = "\n\n\nCycle Reference Checking for Capsule: %s\n" % CapName
- RefCapStack = []
- RefCapStack.append(CapName)
- FdAnalyzedList = []
- FvAnalyzedList = []
-
- Index = 0
- while RefCapStack != [] and Index < MaxLength:
- Index = Index + 1
- CapNameFromStack = RefCapStack.pop()
- if CapNameFromStack.upper() in self.Profile.CapsuleDict.keys():
- CapObj = self.Profile.CapsuleDict[CapNameFromStack.upper()]
- else:
- continue
-
- RefFvList = []
- RefFdList = []
- self.__GetReferencedFdCapTuple(CapObj, RefFdList, RefFvList)
-
- FvListLength = 0
- FdListLength = 0
- while FvListLength < len (RefFvList) or FdListLength < len (RefFdList):
- for RefFdName in RefFdList:
- if RefFdName in FdAnalyzedList:
- continue
-
- LogStr += "Capsule %s contains FD %s\n" % (CapNameFromStack, RefFdName)
- CapInFdList = self.__GetCapInFd(RefFdName)
- if CapInFdList != []:
- for CapNameInFd in CapInFdList:
- LogStr += "FD %s contains Capsule %s\n" % (RefFdName,CapNameInFd)
- if CapNameInFd not in RefCapStack:
- RefCapStack.append(CapNameInFd)
-
- if CapName in RefCapStack or CapNameFromStack in RefCapStack:
- EdkLogger.info(LogStr)
- return True
-
- FvInFdList = self.__GetFvInFd(RefFdName)
- if FvInFdList != []:
- for FvNameInFd in FvInFdList:
- LogStr += "FD %s contains FV %s\n" % (RefFdName,FvNameInFd)
- if FvNameInFd not in RefFvList:
- RefFvList.append(FvNameInFd)
-
- FdAnalyzedList.append(RefFdName)
- #
- # the number of the parsed FV and FD image
- #
- FvListLength = len (RefFvList)
- FdListLength = len (RefFdList)
- for RefFvName in RefFvList:
- if RefFvName in FvAnalyzedList:
- continue
- LogStr += "Capsule %s contains FV %s\n" % (CapNameFromStack, RefFvName)
- if RefFvName.upper() in self.Profile.FvDict.keys():
- FvObj = self.Profile.FvDict[RefFvName.upper()]
- else:
- continue
- self.__GetReferencedFdFvTuple(FvObj, RefFdList, RefFvList)
- FvAnalyzedList.append(RefFvName)
-
- return False
-
-if __name__ == "__main__":
- import sys
- try:
- test_file = sys.argv[1]
- except IndexError, v:
- print "Usage: %s filename" % sys.argv[0]
- sys.exit(1)
-
- parser = FdfParser(test_file)
- try:
- parser.ParseFile()
- parser.CycleReferenceCheck()
- except Warning, X:
- print str(X)
- else:
- print "Success!"
-
diff --git a/BaseTools/Source/Python/GenFds/Ffs.py b/BaseTools/Source/Python/GenFds/Ffs.py
deleted file mode 100644
index c8c5a6e861..0000000000
--- a/BaseTools/Source/Python/GenFds/Ffs.py
+++ /dev/null
@@ -1,80 +0,0 @@
-## @file
-# process FFS generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from CommonDataClass.FdfClass import FDClassObject
-
-## generate FFS
-#
-#
-class Ffs(FDClassObject):
-
- # mapping between MODULE type in FDF (from INF) and file type for GenFfs
- ModuleTypeToFileType = {
- 'SEC' : 'EFI_FV_FILETYPE_SECURITY_CORE',
- 'PEI_CORE' : 'EFI_FV_FILETYPE_PEI_CORE',
- 'PEIM' : 'EFI_FV_FILETYPE_PEIM',
- 'DXE_CORE' : 'EFI_FV_FILETYPE_DXE_CORE',
- 'DXE_DRIVER' : 'EFI_FV_FILETYPE_DRIVER',
- 'DXE_SAL_DRIVER' : 'EFI_FV_FILETYPE_DRIVER',
- 'DXE_SMM_DRIVER' : 'EFI_FV_FILETYPE_DRIVER',
- 'DXE_RUNTIME_DRIVER': 'EFI_FV_FILETYPE_DRIVER',
- 'UEFI_DRIVER' : 'EFI_FV_FILETYPE_DRIVER',
- 'UEFI_APPLICATION' : 'EFI_FV_FILETYPE_APPLICATION',
- 'SMM_CORE' : 'EFI_FV_FILETYPE_SMM_CORE'
- }
-
- # mapping between FILE type in FDF and file type for GenFfs
- FdfFvFileTypeToFileType = {
- 'SEC' : 'EFI_FV_FILETYPE_SECURITY_CORE',
- 'PEI_CORE' : 'EFI_FV_FILETYPE_PEI_CORE',
- 'PEIM' : 'EFI_FV_FILETYPE_PEIM',
- 'DXE_CORE' : 'EFI_FV_FILETYPE_DXE_CORE',
- 'FREEFORM' : 'EFI_FV_FILETYPE_FREEFORM',
- 'DRIVER' : 'EFI_FV_FILETYPE_DRIVER',
- 'APPLICATION' : 'EFI_FV_FILETYPE_APPLICATION',
- 'FV_IMAGE' : 'EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE',
- 'RAW' : 'EFI_FV_FILETYPE_RAW',
- 'PEI_DXE_COMBO' : 'EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER',
- 'SMM' : 'EFI_FV_FILETYPE_SMM',
- 'SMM_CORE' : 'EFI_FV_FILETYPE_SMM_CORE'
- }
-
- # mapping between section type in FDF and file suffix
- SectionSuffix = {
- 'PE32' : '.pe32',
- 'PIC' : '.pic',
- 'TE' : '.te',
- 'DXE_DEPEX' : '.dpx',
- 'VERSION' : '.ver',
- 'UI' : '.ui',
- 'COMPAT16' : '.com16',
- 'RAW' : '.raw',
- 'FREEFORM_SUBTYPE_GUID': '.guid',
- 'SUBTYPE_GUID' : '.guid',
- 'FV_IMAGE' : 'fv.sec',
- 'COMPRESS' : '.com',
- 'GUIDED' : '.guided',
- 'PEI_DEPEX' : '.dpx',
- 'SMM_DEPEX' : '.dpx'
- }
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- FfsClassObject.__init__(self)
diff --git a/BaseTools/Source/Python/GenFds/FfsFileStatement.py b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
deleted file mode 100644
index d0dec380fb..0000000000
--- a/BaseTools/Source/Python/GenFds/FfsFileStatement.py
+++ /dev/null
@@ -1,137 +0,0 @@
-## @file
-# process FFS generation from FILE statement
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Ffs
-import Rule
-import os
-import StringIO
-import subprocess
-
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from CommonDataClass.FdfClass import FileStatementClassObject
-from Common import EdkLogger
-from Common.BuildToolError import *
-from Common.Misc import GuidStructureByteArrayToGuidString
-from GuidSection import GuidSection
-from FvImageSection import FvImageSection
-
-## generate FFS from FILE
-#
-#
-class FileStatement (FileStatementClassObject) :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- FileStatementClassObject.__init__(self)
- self.CurrentLineNum = None
- self.CurrentLineContent = None
- self.FileName = None
- self.InfFileName = None
-
- ## GenFfs() method
- #
- # Generate FFS
- #
- # @param self The object pointer
- # @param Dict dictionary contains macro and value pair
- # @param FvChildAddr Array of the inside FvImage base address
- # @param FvParentAddr Parent Fv base address
- # @retval string Generated FFS file name
- #
- def GenFfs(self, Dict = {}, FvChildAddr=[], FvParentAddr=None):
-
- if self.NameGuid != None and self.NameGuid.startswith('PCD('):
- PcdValue = GenFdsGlobalVariable.GetPcdValue(self.NameGuid)
- if len(PcdValue) == 0:
- EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.' \
- % (self.NameGuid))
- if PcdValue.startswith('{'):
- PcdValue = GuidStructureByteArrayToGuidString(PcdValue)
- RegistryGuidStr = PcdValue
- if len(RegistryGuidStr) == 0:
- EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %s in wrong format.' \
- % (self.NameGuid))
- self.NameGuid = RegistryGuidStr
-
- OutputDir = os.path.join(GenFdsGlobalVariable.FfsDir, self.NameGuid)
- if not os.path.exists(OutputDir):
- os.makedirs(OutputDir)
-
- Dict.update(self.DefineVarDict)
- SectionAlignments = None
- if self.FvName != None :
- Buffer = StringIO.StringIO('')
- if self.FvName.upper() not in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():
- EdkLogger.error("GenFds", GENFDS_ERROR, "FV (%s) is NOT described in FDF file!" % (self.FvName))
- Fv = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(self.FvName.upper())
- FileName = Fv.AddToBuffer(Buffer)
- SectionFiles = [FileName]
-
- elif self.FdName != None:
- if self.FdName.upper() not in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
- EdkLogger.error("GenFds", GENFDS_ERROR, "FD (%s) is NOT described in FDF file!" % (self.FdName))
- Fd = GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(self.FdName.upper())
- FileName = Fd.GenFd()
- SectionFiles = [FileName]
-
- elif self.FileName != None:
- self.FileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FileName)
- SectionFiles = [GenFdsGlobalVariable.MacroExtend(self.FileName, Dict)]
-
- else:
- SectionFiles = []
- Index = 0
- SectionAlignments = []
- for section in self.SectionList :
- Index = Index + 1
- SecIndex = '%d' %Index
- # process the inside FvImage from FvSection or GuidSection
- if FvChildAddr != []:
- if isinstance(section, FvImageSection):
- section.FvAddr = FvChildAddr.pop(0)
- elif isinstance(section, GuidSection):
- section.FvAddr = FvChildAddr
- if FvParentAddr != None and isinstance(section, GuidSection):
- section.FvParentAddr = FvParentAddr
-
- if self.KeepReloc == False:
- section.KeepReloc = False
- sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex, self.KeyStringList, None, Dict)
- if sectList != []:
- for sect in sectList:
- SectionFiles.append(sect)
- SectionAlignments.append(align)
-
- #
- # Prepare the parameter
- #
- FfsFileOutput = os.path.join(OutputDir, self.NameGuid + '.ffs')
- GenFdsGlobalVariable.GenerateFfs(FfsFileOutput, SectionFiles,
- Ffs.Ffs.FdfFvFileTypeToFileType.get(self.FvFileType),
- self.NameGuid,
- Fixed=self.Fixed,
- CheckSum=self.CheckSum,
- Align=self.Alignment,
- SectionAlign=SectionAlignments
- )
-
- return FfsFileOutput
-
-
-
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
deleted file mode 100644
index 71acd2992c..0000000000
--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
+++ /dev/null
@@ -1,917 +0,0 @@
-## @file
-# process FFS generation from INF statement
-#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Rule
-import os
-import shutil
-import StringIO
-from struct import *
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-import Ffs
-import subprocess
-import sys
-import Section
-import RuleSimpleFile
-import RuleComplexFile
-from CommonDataClass.FdfClass import FfsInfStatementClassObject
-from Common.String import *
-from Common.Misc import PathClass
-from Common.Misc import GuidStructureByteArrayToGuidString
-from Common import EdkLogger
-from Common.BuildToolError import *
-from GuidSection import GuidSection
-from FvImageSection import FvImageSection
-from Common.Misc import PeImageClass
-from AutoGen.GenDepex import DependencyExpression
-
-## generate FFS from INF
-#
-#
-class FfsInfStatement(FfsInfStatementClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- FfsInfStatementClassObject.__init__(self)
- self.TargetOverrideList = []
- self.ShadowFromInfFile = None
- self.KeepRelocFromRule = None
- self.InDsc = True
- self.OptRomDefs = {}
- self.PiSpecVersion = '0x00000000'
- self.InfModule = None
- self.FinalTargetSuffixMap = {}
- self.CurrentLineNum = None
- self.CurrentLineContent = None
- self.FileName = None
- self.InfFileName = None
-
- ## GetFinalTargetSuffixMap() method
- #
- # Get final build target list
- def GetFinalTargetSuffixMap(self):
- if not self.InfModule or not self.CurrentArch:
- return []
- if not self.FinalTargetSuffixMap:
- FinalBuildTargetList = GenFdsGlobalVariable.GetModuleCodaTargetList(self.InfModule, self.CurrentArch)
- for File in FinalBuildTargetList:
- self.FinalTargetSuffixMap.setdefault(os.path.splitext(File)[1], []).append(File)
-
- # Check if current INF module has DEPEX
- if '.depex' not in self.FinalTargetSuffixMap and self.InfModule.ModuleType != "USER_DEFINED" \
- and not self.InfModule.DxsFile and not self.InfModule.LibraryClass:
- ModuleType = self.InfModule.ModuleType
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
-
- if ModuleType != DataType.SUP_MODULE_USER_DEFINED:
- for LibraryClass in PlatformDataBase.LibraryClasses.GetKeys():
- if LibraryClass.startswith("NULL") and PlatformDataBase.LibraryClasses[LibraryClass, ModuleType]:
- self.InfModule.LibraryClasses[LibraryClass] = PlatformDataBase.LibraryClasses[LibraryClass, ModuleType]
-
- StrModule = str(self.InfModule)
- PlatformModule = None
- if StrModule in PlatformDataBase.Modules:
- PlatformModule = PlatformDataBase.Modules[StrModule]
- for LibraryClass in PlatformModule.LibraryClasses:
- if LibraryClass.startswith("NULL"):
- self.InfModule.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]
-
- DependencyList = [self.InfModule]
- LibraryInstance = {}
- DepexList = []
- while len(DependencyList) > 0:
- Module = DependencyList.pop(0)
- if not Module:
- continue
- for Dep in Module.Depex[self.CurrentArch, ModuleType]:
- if DepexList != []:
- DepexList.append('AND')
- DepexList.append('(')
- DepexList.extend(Dep)
- if DepexList[-1] == 'END': # no need of a END at this time
- DepexList.pop()
- DepexList.append(')')
- if 'BEFORE' in DepexList or 'AFTER' in DepexList:
- break
- for LibName in Module.LibraryClasses:
- if LibName in LibraryInstance:
- continue
- if PlatformModule and LibName in PlatformModule.LibraryClasses:
- LibraryPath = PlatformModule.LibraryClasses[LibName]
- else:
- LibraryPath = PlatformDataBase.LibraryClasses[LibName, ModuleType]
- if not LibraryPath:
- LibraryPath = Module.LibraryClasses[LibName]
- if not LibraryPath:
- continue
- LibraryModule = GenFdsGlobalVariable.WorkSpace.BuildObject[LibraryPath, self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- LibraryInstance[LibName] = LibraryModule
- DependencyList.append(LibraryModule)
- if DepexList:
- Dpx = DependencyExpression(DepexList, ModuleType, True)
- if len(Dpx.PostfixNotation) != 0:
- # It means this module has DEPEX
- self.FinalTargetSuffixMap['.depex'] = [os.path.join(self.EfiOutputPath, self.BaseName) + '.depex']
- return self.FinalTargetSuffixMap
-
- ## __InfParse() method
- #
- # Parse inf file to get module information
- #
- # @param self The object pointer
- # @param Dict dictionary contains macro and value pair
- #
- def __InfParse__(self, Dict = {}):
-
- GenFdsGlobalVariable.VerboseLogger( " Begine parsing INf file : %s" %self.InfFileName)
-
- self.InfFileName = self.InfFileName.replace('$(WORKSPACE)', '')
- if self.InfFileName[0] == '\\' or self.InfFileName[0] == '/' :
- self.InfFileName = self.InfFileName[1:]
-
- if self.InfFileName.find('$') == -1:
- InfPath = NormPath(self.InfFileName)
- if not os.path.exists(InfPath):
- InfPath = GenFdsGlobalVariable.ReplaceWorkspaceMacro(InfPath)
- if not os.path.exists(InfPath):
- EdkLogger.error("GenFds", GENFDS_ERROR, "Non-existant Module %s !" % (self.InfFileName))
-
- self.CurrentArch = self.GetCurrentArch()
- #
- # Get the InfClass object
- #
-
- PathClassObj = PathClass(self.InfFileName, GenFdsGlobalVariable.WorkSpaceDir)
- ErrorCode, ErrorInfo = PathClassObj.Validate(".inf")
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
-
- if self.CurrentArch != None:
-
- Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassObj, self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- #
- # Set Ffs BaseName, MdouleGuid, ModuleType, Version, OutputPath
- #
- self.BaseName = Inf.BaseName
- self.ModuleGuid = Inf.Guid
- self.ModuleType = Inf.ModuleType
- if Inf.Specification != None and 'PI_SPECIFICATION_VERSION' in Inf.Specification:
- self.PiSpecVersion = Inf.Specification['PI_SPECIFICATION_VERSION']
- if Inf.AutoGenVersion < 0x00010005:
- self.ModuleType = Inf.ComponentType
- self.VersionString = Inf.Version
- self.BinFileList = Inf.Binaries
- self.SourceFileList = Inf.Sources
- if self.KeepReloc == None and Inf.Shadow:
- self.ShadowFromInfFile = Inf.Shadow
-
- else:
- Inf = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassObj, 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- self.BaseName = Inf.BaseName
- self.ModuleGuid = Inf.Guid
- self.ModuleType = Inf.ModuleType
- if Inf.Specification != None and 'PI_SPECIFICATION_VERSION' in Inf.Specification:
- self.PiSpecVersion = Inf.Specification['PI_SPECIFICATION_VERSION']
- self.VersionString = Inf.Version
- self.BinFileList = Inf.Binaries
- self.SourceFileList = Inf.Sources
- if self.BinFileList == []:
- EdkLogger.error("GenFds", GENFDS_ERROR,
- "INF %s specified in FDF could not be found in build ARCH %s!" \
- % (self.InfFileName, GenFdsGlobalVariable.ArchList))
-
- if len(self.SourceFileList) != 0 and not self.InDsc:
- EdkLogger.warn("GenFds", GENFDS_ERROR, "Module %s NOT found in DSC file; Is it really a binary module?" % (self.InfFileName))
-
- if self.ModuleType == 'SMM_CORE' and int(self.PiSpecVersion, 16) < 0x0001000A:
- EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "SMM_CORE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=self.InfFileName)
-
- if Inf._Defs != None and len(Inf._Defs) > 0:
- self.OptRomDefs.update(Inf._Defs)
-
- self.InfModule = Inf
-
- GenFdsGlobalVariable.VerboseLogger( "BaseName : %s" %self.BaseName)
- GenFdsGlobalVariable.VerboseLogger("ModuleGuid : %s" %self.ModuleGuid)
- GenFdsGlobalVariable.VerboseLogger("ModuleType : %s" %self.ModuleType)
- GenFdsGlobalVariable.VerboseLogger("VersionString : %s" %self.VersionString)
- GenFdsGlobalVariable.VerboseLogger("InfFileName :%s" %self.InfFileName)
-
- #
- # Set OutputPath = ${WorkSpace}\Build\Fv\Ffs\${ModuleGuid}+ ${MdouleName}\
- #
-
- self.OutputPath = os.path.join(GenFdsGlobalVariable.FfsDir, \
- self.ModuleGuid + self.BaseName)
- if not os.path.exists(self.OutputPath) :
- os.makedirs(self.OutputPath)
-
- self.EfiOutputPath = self.__GetEFIOutPutPath__()
- GenFdsGlobalVariable.VerboseLogger( "ModuelEFIPath: " + self.EfiOutputPath)
-
- ## GenFfs() method
- #
- # Generate FFS
- #
- # @param self The object pointer
- # @param Dict dictionary contains macro and value pair
- # @param FvChildAddr Array of the inside FvImage base address
- # @param FvParentAddr Parent Fv base address
- # @retval string Generated FFS file name
- #
- def GenFfs(self, Dict = {}, FvChildAddr = [], FvParentAddr=None):
- #
- # Parse Inf file get Module related information
- #
-
- self.__InfParse__(Dict)
-
- #
- # Allow binary type module not specify override rule in FDF file.
- #
- if len(self.BinFileList) >0 and not self.InDsc:
- if self.Rule == None or self.Rule == "":
- self.Rule = "BINARY"
-
- #
- # Get the rule of how to generate Ffs file
- #
- Rule = self.__GetRule__()
- GenFdsGlobalVariable.VerboseLogger( "Packing binaries from inf file : %s" %self.InfFileName)
- #
- # Convert Fv File Type for PI1.1 SMM driver.
- #
- if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) >= 0x0001000A:
- if Rule.FvFileType == 'DRIVER':
- Rule.FvFileType = 'SMM'
- #
- # Framework SMM Driver has no SMM FV file type
- #
- if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) < 0x0001000A:
- if Rule.FvFileType == 'SMM' or Rule.FvFileType == 'SMM_CORE':
- EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM or SMM_CORE FV file type", File=self.InfFileName)
- #
- # For the rule only has simpleFile
- #
- if isinstance (Rule, RuleSimpleFile.RuleSimpleFile) :
- SectionOutputList = self.__GenSimpleFileSection__(Rule)
- FfsOutput = self.__GenSimpleFileFfs__(Rule, SectionOutputList)
- return FfsOutput
- #
- # For Rule has ComplexFile
- #
- elif isinstance(Rule, RuleComplexFile.RuleComplexFile):
- InputSectList, InputSectAlignments = self.__GenComplexFileSection__(Rule, FvChildAddr, FvParentAddr)
- FfsOutput = self.__GenComplexFileFfs__(Rule, InputSectList, InputSectAlignments)
-
- return FfsOutput
-
- ## __ExtendMacro__() method
- #
- # Replace macro with its value
- #
- # @param self The object pointer
- # @param String The string to be replaced
- # @retval string Macro replaced string
- #
- def __ExtendMacro__ (self, String):
- MacroDict = {
- '$(INF_OUTPUT)' : self.EfiOutputPath,
- '$(MODULE_NAME)' : self.BaseName,
- '$(BUILD_NUMBER)': self.BuildNum,
- '$(INF_VERSION)' : self.VersionString,
- '$(NAMED_GUID)' : self.ModuleGuid
- }
- String = GenFdsGlobalVariable.MacroExtend(String, MacroDict)
- return String
-
- ## __GetRule__() method
- #
- # Get correct rule for generating FFS for this INF
- #
- # @param self The object pointer
- # @retval Rule Rule object
- #
- def __GetRule__ (self) :
- CurrentArchList = []
- if self.CurrentArch == None:
- CurrentArchList = ['common']
- else:
- CurrentArchList.append(self.CurrentArch)
-
- for CurrentArch in CurrentArchList:
- RuleName = 'RULE' + \
- '.' + \
- CurrentArch.upper() + \
- '.' + \
- self.ModuleType.upper()
- if self.Rule != None:
- RuleName = RuleName + \
- '.' + \
- self.Rule.upper()
-
- Rule = GenFdsGlobalVariable.FdfParser.Profile.RuleDict.get(RuleName)
- if Rule != None:
- GenFdsGlobalVariable.VerboseLogger ("Want To Find Rule Name is : " + RuleName)
- return Rule
-
- RuleName = 'RULE' + \
- '.' + \
- 'COMMON' + \
- '.' + \
- self.ModuleType.upper()
-
- if self.Rule != None:
- RuleName = RuleName + \
- '.' + \
- self.Rule.upper()
-
- GenFdsGlobalVariable.VerboseLogger ('Trying to apply common rule %s for INF %s' % (RuleName, self.InfFileName))
-
- Rule = GenFdsGlobalVariable.FdfParser.Profile.RuleDict.get(RuleName)
- if Rule != None:
- GenFdsGlobalVariable.VerboseLogger ("Want To Find Rule Name is : " + RuleName)
- return Rule
-
- if Rule == None :
- EdkLogger.error("GenFds", GENFDS_ERROR, 'Don\'t Find common rule %s for INF %s' \
- % (RuleName, self.InfFileName))
-
- ## __GetPlatformArchList__() method
- #
- # Get Arch list this INF built under
- #
- # @param self The object pointer
- # @retval list Arch list
- #
- def __GetPlatformArchList__(self):
-
- InfFileKey = os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName))
- DscArchList = []
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'IA32', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in PlatformDataBase.Modules:
- DscArchList.append ('IA32')
-
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'X64', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in PlatformDataBase.Modules:
- DscArchList.append ('X64')
-
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'IPF', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in (PlatformDataBase.Modules):
- DscArchList.append ('IPF')
-
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'ARM', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in (PlatformDataBase.Modules):
- DscArchList.append ('ARM')
-
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'EBC', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in (PlatformDataBase.Modules):
- DscArchList.append ('EBC')
-
- PlatformDataBase = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'AARCH64', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- if PlatformDataBase != None:
- if InfFileKey in (PlatformDataBase.Modules):
- DscArchList.append ('AARCH64')
-
- return DscArchList
-
- ## GetCurrentArch() method
- #
- # Get Arch list of the module from this INF is to be placed into flash
- #
- # @param self The object pointer
- # @retval list Arch list
- #
- def GetCurrentArch(self) :
-
- TargetArchList = GenFdsGlobalVariable.ArchList
-
- PlatformArchList = self.__GetPlatformArchList__()
-
- CurArchList = TargetArchList
- if PlatformArchList != []:
- CurArchList = list(set (TargetArchList) & set (PlatformArchList))
- GenFdsGlobalVariable.VerboseLogger ("Valid target architecture(s) is : " + " ".join(CurArchList))
-
- ArchList = []
- if self.KeyStringList != []:
- for Key in self.KeyStringList:
- Key = GenFdsGlobalVariable.MacroExtend(Key)
- Target, Tag, Arch = Key.split('_')
- if Arch in CurArchList:
- ArchList.append(Arch)
- if Target not in self.TargetOverrideList:
- self.TargetOverrideList.append(Target)
- else:
- ArchList = CurArchList
-
- UseArchList = TargetArchList
- if self.UseArch != None:
- UseArchList = []
- UseArchList.append(self.UseArch)
- ArchList = list(set (UseArchList) & set (ArchList))
-
- self.InfFileName = NormPath(self.InfFileName)
- if len(PlatformArchList) == 0:
- self.InDsc = False
- PathClassObj = PathClass(self.InfFileName, GenFdsGlobalVariable.WorkSpaceDir)
- ErrorCode, ErrorInfo = PathClassObj.Validate(".inf")
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
- if len(ArchList) == 1:
- Arch = ArchList[0]
- return Arch
- elif len(ArchList) > 1:
- if len(PlatformArchList) == 0:
- EdkLogger.error("GenFds", GENFDS_ERROR, "GenFds command line option has multiple ARCHs %s. Not able to determine which ARCH is valid for Module %s !" % (str(ArchList), self.InfFileName))
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Module built under multiple ARCHs %s. Not able to determine which output to put into flash for Module %s !" % (str(ArchList), self.InfFileName))
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s appears under ARCH %s in platform %s, but current deduced ARCH is %s, so NO build output could be put into flash." \
- % (self.InfFileName, str(PlatformArchList), GenFdsGlobalVariable.ActivePlatform, str(set (UseArchList) & set (TargetArchList))))
-
- ## __GetEFIOutPutPath__() method
- #
- # Get the output path for generated files
- #
- # @param self The object pointer
- # @retval string Path that output files from this INF go to
- #
- def __GetEFIOutPutPath__(self):
- Arch = ''
- OutputPath = ''
- (ModulePath, FileName) = os.path.split(self.InfFileName)
- Index = FileName.rfind('.')
- FileName = FileName[0:Index]
- Arch = "NoneArch"
- if self.CurrentArch != None:
- Arch = self.CurrentArch
-
- OutputPath = os.path.join(GenFdsGlobalVariable.OutputDirDict[Arch],
- Arch ,
- ModulePath,
- FileName,
- 'OUTPUT'
- )
- OutputPath = os.path.realpath(OutputPath)
- return OutputPath
-
- ## __GenSimpleFileSection__() method
- #
- # Generate section by specified file name or a list of files with file extension
- #
- # @param self The object pointer
- # @param Rule The rule object used to generate section
- # @retval string File name of the generated section file
- #
- def __GenSimpleFileSection__(self, Rule):
- #
- # Prepare the parameter of GenSection
- #
- FileList = []
- OutputFileList = []
- GenSecInputFile = None
- if Rule.FileName != None:
- GenSecInputFile = self.__ExtendMacro__(Rule.FileName)
- if os.path.isabs(GenSecInputFile):
- GenSecInputFile = os.path.normpath(GenSecInputFile)
- else:
- GenSecInputFile = os.path.normpath(os.path.join(self.EfiOutputPath, GenSecInputFile))
- else:
- FileList, IsSect = Section.Section.GetFileList(self, '', Rule.FileExtension)
-
- Index = 1
- SectionType = Rule.SectionType
- #
- # Convert Fv Section Type for PI1.1 SMM driver.
- #
- if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) >= 0x0001000A:
- if SectionType == 'DXE_DEPEX':
- SectionType = 'SMM_DEPEX'
- #
- # Framework SMM Driver has no SMM_DEPEX section type
- #
- if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) < 0x0001000A:
- if SectionType == 'SMM_DEPEX':
- EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM_DEPEX section type", File=self.InfFileName)
- NoStrip = True
- if self.ModuleType in ('SEC', 'PEI_CORE', 'PEIM'):
- if self.KeepReloc != None:
- NoStrip = self.KeepReloc
- elif Rule.KeepReloc != None:
- NoStrip = Rule.KeepReloc
- elif self.ShadowFromInfFile != None:
- NoStrip = self.ShadowFromInfFile
-
- if FileList != [] :
- for File in FileList:
-
- SecNum = '%d' %Index
- GenSecOutputFile= self.__ExtendMacro__(Rule.NameGuid) + \
- Ffs.Ffs.SectionSuffix[SectionType] + 'SEC' + SecNum
- Index = Index + 1
- OutputFile = os.path.join(self.OutputPath, GenSecOutputFile)
- File = GenFdsGlobalVariable.MacroExtend(File, Dict, self.CurrentArch)
-
- #Get PE Section alignment when align is set to AUTO
- if self.Alignment == 'Auto' and (SectionType == 'PE32' or SectionType == 'TE'):
- ImageObj = PeImageClass (File)
- if ImageObj.SectionAlignment < 0x400:
- self.Alignment = str (ImageObj.SectionAlignment)
- else:
- self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K'
-
- if not NoStrip:
- FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')
- if not os.path.exists(FileBeforeStrip) or \
- (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):
- shutil.copyfile(File, FileBeforeStrip)
- StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')
- GenFdsGlobalVariable.GenerateFirmwareImage(
- StrippedFile,
- [File],
- Strip=True
- )
- File = StrippedFile
-
- if SectionType == 'TE':
- TeFile = os.path.join( self.OutputPath, self.ModuleGuid + 'Te.raw')
- GenFdsGlobalVariable.GenerateFirmwareImage(
- TeFile,
- [File],
- Type='te'
- )
- File = TeFile
-
- GenFdsGlobalVariable.GenerateSection(OutputFile, [File], Section.Section.SectionType[SectionType])
- OutputFileList.append(OutputFile)
- else:
- SecNum = '%d' %Index
- GenSecOutputFile= self.__ExtendMacro__(Rule.NameGuid) + \
- Ffs.Ffs.SectionSuffix[SectionType] + 'SEC' + SecNum
- OutputFile = os.path.join(self.OutputPath, GenSecOutputFile)
- GenSecInputFile = GenFdsGlobalVariable.MacroExtend(GenSecInputFile, Dict, self.CurrentArch)
-
- #Get PE Section alignment when align is set to AUTO
- if self.Alignment == 'Auto' and (SectionType == 'PE32' or SectionType == 'TE'):
- ImageObj = PeImageClass (GenSecInputFile)
- if ImageObj.SectionAlignment < 0x400:
- self.Alignment = str (ImageObj.SectionAlignment)
- else:
- self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K'
-
- if not NoStrip:
- FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')
- if not os.path.exists(FileBeforeStrip) or \
- (os.path.getmtime(GenSecInputFile) > os.path.getmtime(FileBeforeStrip)):
- shutil.copyfile(GenSecInputFile, FileBeforeStrip)
- StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')
- GenFdsGlobalVariable.GenerateFirmwareImage(
- StrippedFile,
- [GenSecInputFile],
- Strip=True
- )
- GenSecInputFile = StrippedFile
-
- if SectionType == 'TE':
- TeFile = os.path.join( self.OutputPath, self.ModuleGuid + 'Te.raw')
- GenFdsGlobalVariable.GenerateFirmwareImage(
- TeFile,
- [GenSecInputFile],
- Type='te'
- )
- GenSecInputFile = TeFile
-
- GenFdsGlobalVariable.GenerateSection(OutputFile, [GenSecInputFile], Section.Section.SectionType[SectionType])
- OutputFileList.append(OutputFile)
-
- return OutputFileList
-
- ## __GenSimpleFileFfs__() method
- #
- # Generate FFS
- #
- # @param self The object pointer
- # @param Rule The rule object used to generate section
- # @param InputFileList The output file list from GenSection
- # @retval string Generated FFS file name
- #
- def __GenSimpleFileFfs__(self, Rule, InputFileList):
- FfsOutput = self.OutputPath + \
- os.sep + \
- self.__ExtendMacro__(Rule.NameGuid) + \
- '.ffs'
-
- GenFdsGlobalVariable.VerboseLogger(self.__ExtendMacro__(Rule.NameGuid))
- InputSection = []
- SectionAlignments = []
- for InputFile in InputFileList:
- InputSection.append(InputFile)
- SectionAlignments.append(Rule.SectAlignment)
-
- if Rule.NameGuid != None and Rule.NameGuid.startswith('PCD('):
- PcdValue = GenFdsGlobalVariable.GetPcdValue(Rule.NameGuid)
- if len(PcdValue) == 0:
- EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.' \
- % (Rule.NameGuid))
- if PcdValue.startswith('{'):
- PcdValue = GuidStructureByteArrayToGuidString(PcdValue)
- RegistryGuidStr = PcdValue
- if len(RegistryGuidStr) == 0:
- EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %s in wrong format.' \
- % (Rule.NameGuid))
- self.ModuleGuid = RegistryGuidStr
-
- GenFdsGlobalVariable.GenerateFfs(FfsOutput, InputSection,
- Ffs.Ffs.FdfFvFileTypeToFileType[Rule.FvFileType],
- self.ModuleGuid, Fixed=Rule.Fixed,
- CheckSum=Rule.CheckSum, Align=Rule.Alignment,
- SectionAlign=SectionAlignments
- )
- return FfsOutput
-
- ## __GenComplexFileSection__() method
- #
- # Generate section by sections in Rule
- #
- # @param self The object pointer
- # @param Rule The rule object used to generate section
- # @param FvChildAddr Array of the inside FvImage base address
- # @param FvParentAddr Parent Fv base address
- # @retval string File name of the generated section file
- #
- def __GenComplexFileSection__(self, Rule, FvChildAddr, FvParentAddr):
- if self.ModuleType in ('SEC', 'PEI_CORE', 'PEIM'):
- if Rule.KeepReloc != None:
- self.KeepRelocFromRule = Rule.KeepReloc
- SectFiles = []
- SectAlignments = []
- Index = 1
- HasGneratedFlag = False
- for Sect in Rule.SectionList:
- SecIndex = '%d' %Index
- SectList = []
- #
- # Convert Fv Section Type for PI1.1 SMM driver.
- #
- if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) >= 0x0001000A:
- if Sect.SectionType == 'DXE_DEPEX':
- Sect.SectionType = 'SMM_DEPEX'
- #
- # Framework SMM Driver has no SMM_DEPEX section type
- #
- if self.ModuleType == 'DXE_SMM_DRIVER' and int(self.PiSpecVersion, 16) < 0x0001000A:
- if Sect.SectionType == 'SMM_DEPEX':
- EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework SMM module doesn't support SMM_DEPEX section type", File=self.InfFileName)
- #
- # process the inside FvImage from FvSection or GuidSection
- #
- if FvChildAddr != []:
- if isinstance(Sect, FvImageSection):
- Sect.FvAddr = FvChildAddr.pop(0)
- elif isinstance(Sect, GuidSection):
- Sect.FvAddr = FvChildAddr
- if FvParentAddr != None and isinstance(Sect, GuidSection):
- Sect.FvParentAddr = FvParentAddr
-
- if Rule.KeyStringList != []:
- SectList, Align = Sect.GenSection(self.OutputPath , self.ModuleGuid, SecIndex, Rule.KeyStringList, self)
- else :
- SectList, Align = Sect.GenSection(self.OutputPath , self.ModuleGuid, SecIndex, self.KeyStringList, self)
-
- if not HasGneratedFlag:
- UniVfrOffsetFileSection = ""
- ModuleFileName = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName)
- InfData = GenFdsGlobalVariable.WorkSpace.BuildObject[PathClass(ModuleFileName), self.CurrentArch]
- #
- # Search the source list in InfData to find if there are .vfr file exist.
- #
- VfrUniBaseName = {}
- VfrUniOffsetList = []
- for SourceFile in InfData.Sources:
- if SourceFile.Type.upper() == ".VFR" :
- #
- # search the .map file to find the offset of vfr binary in the PE32+/TE file.
- #
- VfrUniBaseName[SourceFile.BaseName] = (SourceFile.BaseName + "Bin")
- if SourceFile.Type.upper() == ".UNI" :
- #
- # search the .map file to find the offset of Uni strings binary in the PE32+/TE file.
- #
- VfrUniBaseName["UniOffsetName"] = (self.BaseName + "Strings")
-
-
- if len(VfrUniBaseName) > 0:
- VfrUniOffsetList = self.__GetBuildOutputMapFileVfrUniInfo(VfrUniBaseName)
- #
- # Generate the Raw data of raw section
- #
- os.path.join( self.OutputPath, self.BaseName + '.offset')
- UniVfrOffsetFileName = os.path.join( self.OutputPath, self.BaseName + '.offset')
- UniVfrOffsetFileSection = os.path.join( self.OutputPath, self.BaseName + 'Offset' + '.raw')
-
- self.__GenUniVfrOffsetFile (VfrUniOffsetList, UniVfrOffsetFileName)
-
- UniVfrOffsetFileNameList = []
- UniVfrOffsetFileNameList.append(UniVfrOffsetFileName)
- """Call GenSection"""
- GenFdsGlobalVariable.GenerateSection(UniVfrOffsetFileSection,
- UniVfrOffsetFileNameList,
- "EFI_SECTION_RAW"
- )
- os.remove(UniVfrOffsetFileName)
- SectList.append(UniVfrOffsetFileSection)
- HasGneratedFlag = True
-
- for SecName in SectList :
- SectFiles.append(SecName)
- SectAlignments.append(Align)
- Index = Index + 1
- return SectFiles, SectAlignments
-
- ## __GenComplexFileFfs__() method
- #
- # Generate FFS
- #
- # @param self The object pointer
- # @param Rule The rule object used to generate section
- # @param InputFileList The output file list from GenSection
- # @retval string Generated FFS file name
- #
- def __GenComplexFileFfs__(self, Rule, InputFile, Alignments):
-
- if Rule.NameGuid != None and Rule.NameGuid.startswith('PCD('):
- PcdValue = GenFdsGlobalVariable.GetPcdValue(Rule.NameGuid)
- if len(PcdValue) == 0:
- EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.' \
- % (Rule.NameGuid))
- if PcdValue.startswith('{'):
- PcdValue = GuidStructureByteArrayToGuidString(PcdValue)
- RegistryGuidStr = PcdValue
- if len(RegistryGuidStr) == 0:
- EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %s in wrong format.' \
- % (Rule.NameGuid))
- self.ModuleGuid = RegistryGuidStr
-
- FfsOutput = os.path.join( self.OutputPath, self.ModuleGuid + '.ffs')
- GenFdsGlobalVariable.GenerateFfs(FfsOutput, InputFile,
- Ffs.Ffs.FdfFvFileTypeToFileType[Rule.FvFileType],
- self.ModuleGuid, Fixed=Rule.Fixed,
- CheckSum=Rule.CheckSum, Align=Rule.Alignment,
- SectionAlign=Alignments
- )
- return FfsOutput
-
- ## __GetGenFfsCmdParameter__() method
- #
- # Create parameter string for GenFfs
- #
- # @param self The object pointer
- # @param Rule The rule object used to generate section
- # @retval tuple (FileType, Fixed, CheckSum, Alignment)
- #
- def __GetGenFfsCmdParameter__(self, Rule):
- result = tuple()
- result += ('-t', Ffs.Ffs.FdfFvFileTypeToFileType[Rule.FvFileType])
- if Rule.Fixed != False:
- result += ('-x',)
- if Rule.CheckSum != False:
- result += ('-s',)
-
- if Rule.Alignment != None and Rule.Alignment != '':
- result += ('-a', Rule.Alignment)
-
- return result
-
- ## __GetBuildOutputMapFileVfrUniInfo() method
- #
- # Find the offset of UNI/INF object offset in the EFI image file.
- #
- # @param self The object pointer
- # @param VfrUniBaseName A name list contain the UNI/INF object name.
- # @retval RetValue A list contain offset of UNI/INF object.
- #
- def __GetBuildOutputMapFileVfrUniInfo(self, VfrUniBaseName):
-
- RetValue = []
-
- MapFileName = os.path.join(self.EfiOutputPath, self.BaseName + ".map")
- try:
- fInputfile = open(MapFileName, "r", 0)
- try:
- FileLinesList = fInputfile.readlines()
- except:
- EdkLogger.error("GenFds", FILE_READ_FAILURE, "File read failed for %s" %MapFileName,None)
- finally:
- fInputfile.close()
- except:
- EdkLogger.error("GenFds", FILE_OPEN_FAILURE, "File open failed for %s" %MapFileName,None)
-
- IsHex = False
- for eachLine in FileLinesList:
- for eachName in VfrUniBaseName.values():
- if eachLine.find(eachName) != -1:
- eachLine = eachLine.strip()
- Element = eachLine.split()
- #
- # MSFT/ICC/EBC map file
- #
- if (len(Element) == 4):
- try:
- int (Element[2], 16)
- IsHex = True
- except:
- IsHex = False
-
- if IsHex:
- RetValue.append((eachName, Element[2]))
- IsHex = False
- #
- # GCC map file
- #
- elif (len(Element) == 2) and Element[0].startswith("0x"):
- RetValue.append((eachName, Element[0]))
-
- return RetValue
-
- ## __GenUniVfrOffsetFile() method
- #
- # Generate the offset file for the module which contain VFR or UNI file.
- #
- # @param self The object pointer
- # @param VfrUniOffsetList A list contain the VFR/UNI offsets in the EFI image file.
- # @param UniVfrOffsetFileName The output offset file name.
- #
- def __GenUniVfrOffsetFile(self, VfrUniOffsetList, UniVfrOffsetFileName):
-
- try:
- fInputfile = open(UniVfrOffsetFileName, "wb+", 0)
- except:
- EdkLogger.error("GenFds", FILE_OPEN_FAILURE, "File open failed for %s" %UniVfrOffsetFileName,None)
-
- # Use a instance of StringIO to cache data
- fStringIO = StringIO.StringIO('')
-
- for Item in VfrUniOffsetList:
- if (Item[0].find("Strings") != -1):
- #
- # UNI offset in image.
- # GUID + Offset
- # { 0x8913c5e0, 0x33f6, 0x4d86, { 0x9b, 0xf1, 0x43, 0xef, 0x89, 0xfc, 0x6, 0x66 } }
- #
- UniGuid = [0xe0, 0xc5, 0x13, 0x89, 0xf6, 0x33, 0x86, 0x4d, 0x9b, 0xf1, 0x43, 0xef, 0x89, 0xfc, 0x6, 0x66]
- UniGuid = [chr(ItemGuid) for ItemGuid in UniGuid]
- fStringIO.write(''.join(UniGuid))
- UniValue = pack ('Q', int (Item[1], 16))
- fStringIO.write (UniValue)
- else:
- #
- # VFR binary offset in image.
- # GUID + Offset
- # { 0xd0bc7cb4, 0x6a47, 0x495f, { 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2 } };
- #
- VfrGuid = [0xb4, 0x7c, 0xbc, 0xd0, 0x47, 0x6a, 0x5f, 0x49, 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2]
- VfrGuid = [chr(ItemGuid) for ItemGuid in VfrGuid]
- fStringIO.write(''.join(VfrGuid))
- type (Item[1])
- VfrValue = pack ('Q', int (Item[1], 16))
- fStringIO.write (VfrValue)
-
- #
- # write data into file.
- #
- try :
- fInputfile.write (fStringIO.getvalue())
- except:
- EdkLogger.error("GenFds", FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the file been locked or using by other applications." %UniVfrOffsetFileName,None)
-
- fStringIO.close ()
- fInputfile.close ()
-
-
-
-
-
-
-
-
diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python/GenFds/Fv.py
deleted file mode 100644
index 6c7a0503cf..0000000000
--- a/BaseTools/Source/Python/GenFds/Fv.py
+++ /dev/null
@@ -1,358 +0,0 @@
-## @file
-# process FV generation
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import shutil
-import subprocess
-import StringIO
-from struct import *
-
-import Ffs
-import AprioriSection
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from GenFds import GenFds
-from CommonDataClass.FdfClass import FvClassObject
-from Common.Misc import SaveFileOnChange
-
-T_CHAR_LF = '\n'
-
-## generate FV
-#
-#
-class FV (FvClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- FvClassObject.__init__(self)
- self.FvInfFile = None
- self.FvAddressFile = None
- self.BaseAddress = None
- self.InfFileName = None
- self.FvAddressFileName = None
- self.CapsuleName = None
- self.FvBaseAddress = None
- self.FvForceRebase = None
-
- ## AddToBuffer()
- #
- # Generate Fv and add it to the Buffer
- #
- # @param self The object pointer
- # @param Buffer The buffer generated FV data will be put
- # @param BaseAddress base address of FV
- # @param BlockSize block size of FV
- # @param BlockNum How many blocks in FV
- # @param ErasePolarity Flash erase polarity
- # @param VtfDict VTF objects
- # @param MacroDict macro value pair
- # @retval string Generated FV file path
- #
- def AddToBuffer (self, Buffer, BaseAddress=None, BlockSize= None, BlockNum=None, ErasePloarity='1', VtfDict=None, MacroDict = {}) :
-
- if BaseAddress == None and self.UiFvName.upper() + 'fv' in GenFds.ImageBinDict.keys():
- return GenFds.ImageBinDict[self.UiFvName.upper() + 'fv']
-
- #
- # Check whether FV in Capsule is in FD flash region.
- # If yes, return error. Doesn't support FV in Capsule image is also in FD flash region.
- #
- if self.CapsuleName != None:
- for FdName in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
- FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[FdName]
- for RegionObj in FdObj.RegionList:
- if RegionObj.RegionType == 'FV':
- for RegionData in RegionObj.RegionDataList:
- if RegionData.endswith(".fv"):
- continue
- elif RegionData.upper() + 'fv' in GenFds.ImageBinDict.keys():
- continue
- elif self.UiFvName.upper() == RegionData.upper():
- GenFdsGlobalVariable.ErrorLogger("Capsule %s in FD region can't contain a FV %s in FD region." % (self.CapsuleName, self.UiFvName.upper()))
-
- GenFdsGlobalVariable.InfLogger( "\nGenerating %s FV" %self.UiFvName)
-
- if self.FvBaseAddress != None:
- BaseAddress = self.FvBaseAddress
-
- self.__InitializeInf__(BaseAddress, BlockSize, BlockNum, ErasePloarity, VtfDict)
- #
- # First Process the Apriori section
- #
- MacroDict.update(self.DefineVarDict)
-
- GenFdsGlobalVariable.VerboseLogger('First generate Apriori file !')
- FfsFileList = []
- for AprSection in self.AprioriSectionList:
- FileName = AprSection.GenFfs (self.UiFvName, MacroDict)
- FfsFileList.append(FileName)
- # Add Apriori file name to Inf file
- self.FvInfFile.writelines("EFI_FILE_NAME = " + \
- FileName + \
- T_CHAR_LF)
-
- # Process Modules in FfsList
- for FfsFile in self.FfsList :
- FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress)
- FfsFileList.append(FileName)
- self.FvInfFile.writelines("EFI_FILE_NAME = " + \
- FileName + \
- T_CHAR_LF)
-
- SaveFileOnChange(self.InfFileName, self.FvInfFile.getvalue(), False)
- self.FvInfFile.close()
- #
- # Call GenFv tool
- #
- FvOutputFile = os.path.join(GenFdsGlobalVariable.FvDir, self.UiFvName)
- FvOutputFile = FvOutputFile + '.Fv'
- # BUGBUG: FvOutputFile could be specified from FDF file (FV section, CreateFile statement)
- if self.CreateFileName != None:
- FvOutputFile = self.CreateFileName
-
- FvInfoFileName = os.path.join(GenFdsGlobalVariable.FfsDir, self.UiFvName + '.inf')
- shutil.copy(GenFdsGlobalVariable.FvAddressFileName, FvInfoFileName)
- OrigFvInfo = None
- if os.path.exists (FvInfoFileName):
- OrigFvInfo = open(FvInfoFileName, 'r').read()
- GenFdsGlobalVariable.GenerateFirmwareVolume(
- FvOutputFile,
- [self.InfFileName],
- AddressFile=FvInfoFileName,
- FfsList=FfsFileList,
- ForceRebase=self.FvForceRebase
- )
-
- NewFvInfo = None
- if os.path.exists (FvInfoFileName):
- NewFvInfo = open(FvInfoFileName, 'r').read()
- if NewFvInfo != None and NewFvInfo != OrigFvInfo:
- FvChildAddr = []
- AddFileObj = open(FvInfoFileName, 'r')
- AddrStrings = AddFileObj.readlines()
- AddrKeyFound = False
- for AddrString in AddrStrings:
- if AddrKeyFound:
- #get base address for the inside FvImage
- FvChildAddr.append (AddrString)
- elif AddrString.find ("[FV_BASE_ADDRESS]") != -1:
- AddrKeyFound = True
- AddFileObj.close()
-
- if FvChildAddr != []:
- # Update Ffs again
- for FfsFile in self.FfsList :
- FileName = FfsFile.GenFfs(MacroDict, FvChildAddr, BaseAddress)
-
- #Update GenFv again
- GenFdsGlobalVariable.GenerateFirmwareVolume(
- FvOutputFile,
- [self.InfFileName],
- AddressFile=FvInfoFileName,
- FfsList=FfsFileList,
- ForceRebase=self.FvForceRebase
- )
-
- #
- # Write the Fv contents to Buffer
- #
- FvFileObj = open ( FvOutputFile,'r+b')
-
- GenFdsGlobalVariable.VerboseLogger( "\nGenerate %s FV Successfully" %self.UiFvName)
- GenFdsGlobalVariable.SharpCounter = 0
-
- Buffer.write(FvFileObj.read())
- FvFileObj.seek(0)
- # PI FvHeader is 0x48 byte
- FvHeaderBuffer = FvFileObj.read(0x48)
- # FV alignment position.
- FvAlignmentValue = 1 << (ord (FvHeaderBuffer[0x2E]) & 0x1F)
- # FvAlignmentValue is larger than or equal to 1K
- if FvAlignmentValue >= 0x400:
- if FvAlignmentValue >= 0x10000:
- #The max alignment supported by FFS is 64K.
- self.FvAlignment = "64K"
- else:
- self.FvAlignment = str (FvAlignmentValue / 0x400) + "K"
- else:
- # FvAlignmentValue is less than 1K
- self.FvAlignment = str (FvAlignmentValue)
- FvFileObj.close()
- GenFds.ImageBinDict[self.UiFvName.upper() + 'fv'] = FvOutputFile
- return FvOutputFile
-
- ## __InitializeInf__()
- #
- # Initilize the inf file to create FV
- #
- # @param self The object pointer
- # @param BaseAddress base address of FV
- # @param BlockSize block size of FV
- # @param BlockNum How many blocks in FV
- # @param ErasePolarity Flash erase polarity
- # @param VtfDict VTF objects
- #
- def __InitializeInf__ (self, BaseAddress = None, BlockSize= None, BlockNum = None, ErasePloarity='1', VtfDict=None) :
- #
- # Create FV inf file
- #
- self.InfFileName = os.path.join(GenFdsGlobalVariable.FvDir,
- self.UiFvName + '.inf')
- self.FvInfFile = StringIO.StringIO()
-
- #
- # Add [Options]
- #
- self.FvInfFile.writelines("[options]" + T_CHAR_LF)
- if BaseAddress != None :
- self.FvInfFile.writelines("EFI_BASE_ADDRESS = " + \
- BaseAddress + \
- T_CHAR_LF)
-
- if BlockSize != None:
- self.FvInfFile.writelines("EFI_BLOCK_SIZE = " + \
- '0x%X' %BlockSize + \
- T_CHAR_LF)
- if BlockNum != None:
- self.FvInfFile.writelines("EFI_NUM_BLOCKS = " + \
- ' 0x%X' %BlockNum + \
- T_CHAR_LF)
- else:
- if self.BlockSizeList == []:
- #set default block size is 1
- self.FvInfFile.writelines("EFI_BLOCK_SIZE = 0x1" + T_CHAR_LF)
-
- for BlockSize in self.BlockSizeList :
- if BlockSize[0] != None:
- self.FvInfFile.writelines("EFI_BLOCK_SIZE = " + \
- '0x%X' %BlockSize[0] + \
- T_CHAR_LF)
-
- if BlockSize[1] != None:
- self.FvInfFile.writelines("EFI_NUM_BLOCKS = " + \
- ' 0x%X' %BlockSize[1] + \
- T_CHAR_LF)
-
- if self.BsBaseAddress != None:
- self.FvInfFile.writelines('EFI_BOOT_DRIVER_BASE_ADDRESS = ' + \
- '0x%X' %self.BsBaseAddress)
- if self.RtBaseAddress != None:
- self.FvInfFile.writelines('EFI_RUNTIME_DRIVER_BASE_ADDRESS = ' + \
- '0x%X' %self.RtBaseAddress)
- #
- # Add attribute
- #
- self.FvInfFile.writelines("[attributes]" + T_CHAR_LF)
-
- self.FvInfFile.writelines("EFI_ERASE_POLARITY = " + \
- ' %s' %ErasePloarity + \
- T_CHAR_LF)
- if not (self.FvAttributeDict == None):
- for FvAttribute in self.FvAttributeDict.keys() :
- self.FvInfFile.writelines("EFI_" + \
- FvAttribute + \
- ' = ' + \
- self.FvAttributeDict[FvAttribute] + \
- T_CHAR_LF )
- if self.FvAlignment != None:
- self.FvInfFile.writelines("EFI_FVB2_ALIGNMENT_" + \
- self.FvAlignment.strip() + \
- " = TRUE" + \
- T_CHAR_LF)
-
- #
- # Generate FV extension header file
- #
- if self.FvNameGuid == None or self.FvNameGuid == '':
- if len(self.FvExtEntryType) > 0:
- GenFdsGlobalVariable.ErrorLogger("FV Extension Header Entries declared for %s with no FvNameGuid declaration." % (self.UiFvName))
-
- if self.FvNameGuid <> None and self.FvNameGuid <> '':
- TotalSize = 16 + 4
- Buffer = ''
- for Index in range (0, len(self.FvExtEntryType)):
- if self.FvExtEntryType[Index] == 'FILE':
- # check if the path is absolute or relative
- if os.path.isabs(self.FvExtEntryData[Index]):
- FileFullPath = os.path.normpath(self.FvExtEntryData[Index])
- else:
- FileFullPath = os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, self.FvExtEntryData[Index]))
- # check if the file path exists or not
- if not os.path.isfile(FileFullPath):
- GenFdsGlobalVariable.ErrorLogger("Error opening FV Extension Header Entry file %s." % (self.FvExtEntryData[Index]))
- FvExtFile = open (FileFullPath,'rb')
- FvExtFile.seek(0,2)
- Size = FvExtFile.tell()
- if Size >= 0x10000:
- GenFdsGlobalVariable.ErrorLogger("The size of FV Extension Header Entry file %s exceeds 0x10000." % (self.FvExtEntryData[Index]))
- TotalSize += (Size + 4)
- FvExtFile.seek(0)
- Buffer += pack('HH', (Size + 4), int(self.FvExtEntryTypeValue[Index], 16))
- Buffer += FvExtFile.read()
- FvExtFile.close()
- if self.FvExtEntryType[Index] == 'DATA':
- ByteList = self.FvExtEntryData[Index].split(',')
- Size = len (ByteList)
- if Size >= 0x10000:
- GenFdsGlobalVariable.ErrorLogger("The size of FV Extension Header Entry data %s exceeds 0x10000." % (self.FvExtEntryData[Index]))
- TotalSize += (Size + 4)
- Buffer += pack('HH', (Size + 4), int(self.FvExtEntryTypeValue[Index], 16))
- for Index1 in range (0, Size):
- Buffer += pack('B', int(ByteList[Index1], 16))
-
- Guid = self.FvNameGuid.split('-')
- Buffer = pack('=LHHBBBBBBBBL',
- int(Guid[0], 16),
- int(Guid[1], 16),
- int(Guid[2], 16),
- int(Guid[3][-4:-2], 16),
- int(Guid[3][-2:], 16),
- int(Guid[4][-12:-10], 16),
- int(Guid[4][-10:-8], 16),
- int(Guid[4][-8:-6], 16),
- int(Guid[4][-6:-4], 16),
- int(Guid[4][-4:-2], 16),
- int(Guid[4][-2:], 16),
- TotalSize
- ) + Buffer
-
- #
- # Generate FV extension header file if the total size is not zero
- #
- if TotalSize > 0:
- FvExtHeaderFileName = os.path.join(GenFdsGlobalVariable.FvDir, self.UiFvName + '.ext')
- FvExtHeaderFile = StringIO.StringIO()
- FvExtHeaderFile.write(Buffer)
- Changed = SaveFileOnChange(FvExtHeaderFileName, FvExtHeaderFile.getvalue(), True)
- FvExtHeaderFile.close()
- if Changed:
- if os.path.exists (self.InfFileName):
- os.remove (self.InfFileName)
- self.FvInfFile.writelines("EFI_FV_EXT_HEADER_FILE_NAME = " + \
- FvExtHeaderFileName + \
- T_CHAR_LF)
-
-
- #
- # Add [Files]
- #
- self.FvInfFile.writelines("[files]" + T_CHAR_LF)
- if VtfDict != None and self.UiFvName in VtfDict.keys():
- self.FvInfFile.writelines("EFI_FILE_NAME = " + \
- VtfDict.get(self.UiFvName) + \
- T_CHAR_LF)
diff --git a/BaseTools/Source/Python/GenFds/FvImageSection.py b/BaseTools/Source/Python/GenFds/FvImageSection.py
deleted file mode 100644
index f5d3f4f9a5..0000000000
--- a/BaseTools/Source/Python/GenFds/FvImageSection.py
+++ /dev/null
@@ -1,96 +0,0 @@
-## @file
-# process FV image section generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Section
-import StringIO
-from Ffs import Ffs
-import subprocess
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-import os
-from CommonDataClass.FdfClass import FvImageSectionClassObject
-from Common import EdkLogger
-from Common.BuildToolError import *
-
-## generate FV image section
-#
-#
-class FvImageSection(FvImageSectionClassObject):
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- FvImageSectionClassObject.__init__(self)
-
- ## GenSection() method
- #
- # Generate FV image section
- #
- # @param self The object pointer
- # @param OutputPath Where to place output file
- # @param ModuleName Which module this section belongs to
- # @param SecNum Index of section
- # @param KeyStringList Filter for inputs of section generation
- # @param FfsInf FfsInfStatement object that contains this section data
- # @param Dict dictionary contains macro and its value
- # @retval tuple (Generated file name, section alignment)
- #
- def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
-
- OutputFileList = []
- if self.FvFileType != None:
- FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FvFileType, self.FvFileExtension)
- if IsSect :
- return FileList, self.Alignment
-
- Num = SecNum
-
- for FileName in FileList:
- OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + Num + Ffs.SectionSuffix.get("FV_IMAGE"))
- GenFdsGlobalVariable.GenerateSection(OutputFile, [FvFileName], 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE')
- OutputFileList.append(OutputFile)
- return OutputFileList, self.Alignment
- #
- # Generate Fv
- #
- if self.FvName != None:
- Buffer = StringIO.StringIO('')
- Fv = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(self.FvName)
- if Fv != None:
- self.Fv = Fv
- FvFileName = Fv.AddToBuffer(Buffer, self.FvAddr, MacroDict = Dict)
- if Fv.FvAlignment != None:
- if self.Alignment == None:
- self.Alignment = Fv.FvAlignment
- else:
- if GenFdsGlobalVariable.GetAlignment (Fv.FvAlignment) > GenFdsGlobalVariable.GetAlignment (self.Alignment):
- self.Alignment = Fv.FvAlignment
- else:
- if self.FvFileName != None:
- FvFileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FvFileName)
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "FvImageSection Failed! %s NOT found in FDF" % self.FvName)
-
- #
- # Prepare the parameter of GenSection
- #
- OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get("FV_IMAGE"))
- GenFdsGlobalVariable.GenerateSection(OutputFile, [FvFileName], 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE')
- OutputFileList.append(OutputFile)
-
- return OutputFileList, self.Alignment
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
deleted file mode 100644
index 400008e815..0000000000
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ /dev/null
@@ -1,538 +0,0 @@
-## @file
-# generate flash image
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from optparse import OptionParser
-import sys
-import os
-import linecache
-import FdfParser
-import Common.BuildToolError as BuildToolError
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from Workspace.WorkspaceDatabase import WorkspaceDatabase
-from Workspace.BuildClassObject import PcdClassObject
-from Workspace.BuildClassObject import ModuleBuildClassObject
-import RuleComplexFile
-from EfiSection import EfiSection
-import StringIO
-import Common.TargetTxtClassObject as TargetTxtClassObject
-import Common.ToolDefClassObject as ToolDefClassObject
-import Common.DataType
-import Common.GlobalData as GlobalData
-from Common import EdkLogger
-from Common.String import *
-from Common.Misc import DirCache,PathClass
-from Common.Misc import SaveFileOnChange
-from Common.BuildVersion import gBUILD_VERSION
-
-## Version and Copyright
-versionNumber = "1.0" + ' ' + gBUILD_VERSION
-__version__ = "%prog Version " + versionNumber
-__copyright__ = "Copyright (c) 2007 - 2010, Intel Corporation All rights reserved."
-
-## Tool entrance method
-#
-# This method mainly dispatch specific methods per the command line options.
-# If no error found, return zero value so the caller of this tool can know
-# if it's executed successfully or not.
-#
-# @retval 0 Tool was successful
-# @retval 1 Tool failed
-#
-def main():
- global Options
- Options = myOptionParser()
-
- global Workspace
- Workspace = ""
- ArchList = None
- ReturnCode = 0
-
- EdkLogger.Initialize()
- try:
- if Options.verbose != None:
- EdkLogger.SetLevel(EdkLogger.VERBOSE)
- GenFdsGlobalVariable.VerboseMode = True
-
- if Options.FixedAddress != None:
- GenFdsGlobalVariable.FixedLoadAddress = True
-
- if Options.quiet != None:
- EdkLogger.SetLevel(EdkLogger.QUIET)
- if Options.debug != None:
- EdkLogger.SetLevel(Options.debug + 1)
- GenFdsGlobalVariable.DebugLevel = Options.debug
- else:
- EdkLogger.SetLevel(EdkLogger.INFO)
-
- if (Options.Workspace == None):
- EdkLogger.error("GenFds", OPTION_MISSING, "WORKSPACE not defined",
- ExtraData="Please use '-w' switch to pass it or set the WORKSPACE environment variable.")
- elif not os.path.exists(Options.Workspace):
- EdkLogger.error("GenFds", PARAMETER_INVALID, "WORKSPACE is invalid",
- ExtraData="Please use '-w' switch to pass it or set the WORKSPACE environment variable.")
- else:
- Workspace = os.path.normcase(Options.Workspace)
- GenFdsGlobalVariable.WorkSpaceDir = Workspace
- if 'EDK_SOURCE' in os.environ.keys():
- GenFdsGlobalVariable.EdkSourceDir = os.path.normcase(os.environ['EDK_SOURCE'])
- if (Options.debug):
- GenFdsGlobalVariable.VerboseLogger( "Using Workspace:" + Workspace)
- os.chdir(GenFdsGlobalVariable.WorkSpaceDir)
-
- if (Options.filename):
- FdfFilename = Options.filename
- FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename)
-
- if FdfFilename[0:2] == '..':
- FdfFilename = os.path.realpath(FdfFilename)
- if not os.path.isabs (FdfFilename):
- FdfFilename = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
- if not os.path.exists(FdfFilename):
- EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=FdfFilename)
- if os.path.normcase (FdfFilename).find(Workspace) != 0:
- EdkLogger.error("GenFds", FILE_NOT_FOUND, "FdfFile doesn't exist in Workspace!")
-
- GenFdsGlobalVariable.FdfFile = FdfFilename
- GenFdsGlobalVariable.FdfFileTimeStamp = os.path.getmtime(FdfFilename)
- else:
- EdkLogger.error("GenFds", OPTION_MISSING, "Missing FDF filename")
-
- if (Options.BuildTarget):
- GenFdsGlobalVariable.TargetName = Options.BuildTarget
- else:
- EdkLogger.error("GenFds", OPTION_MISSING, "Missing build target")
-
- if (Options.ToolChain):
- GenFdsGlobalVariable.ToolChainTag = Options.ToolChain
- else:
- EdkLogger.error("GenFds", OPTION_MISSING, "Missing tool chain tag")
-
- if (Options.activePlatform):
- ActivePlatform = Options.activePlatform
- ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform)
-
- if ActivePlatform[0:2] == '..':
- ActivePlatform = os.path.realpath(ActivePlatform)
-
- if not os.path.isabs (ActivePlatform):
- ActivePlatform = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)
-
- if not os.path.exists(ActivePlatform) :
- EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist!")
-
- if os.path.normcase (ActivePlatform).find(Workspace) != 0:
- EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist in Workspace!")
-
- ActivePlatform = ActivePlatform[len(Workspace):]
- if len(ActivePlatform) > 0 :
- if ActivePlatform[0] == '\\' or ActivePlatform[0] == '/':
- ActivePlatform = ActivePlatform[1:]
- else:
- EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform doesn't exist!")
- else:
- EdkLogger.error("GenFds", OPTION_MISSING, "Missing active platform")
-
- GenFdsGlobalVariable.ActivePlatform = PathClass(NormPath(ActivePlatform), Workspace)
-
- BuildConfigurationFile = os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, "Conf/target.txt"))
- if os.path.isfile(BuildConfigurationFile) == True:
- TargetTxtClassObject.TargetTxtClassObject(BuildConfigurationFile)
- else:
- EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=BuildConfigurationFile)
-
- if Options.Macros:
- for Pair in Options.Macros:
- Pair.strip('"')
- List = Pair.split('=')
- if len(List) == 2:
- if List[0].strip() == "EFI_SOURCE":
- GlobalData.gEfiSource = List[1].strip()
- GlobalData.gGlobalDefines["EFI_SOURCE"] = GlobalData.gEfiSource
- continue
- elif List[0].strip() == "EDK_SOURCE":
- GlobalData.gEdkSource = List[1].strip()
- GlobalData.gGlobalDefines["EDK_SOURCE"] = GlobalData.gEdkSource
- continue
- elif List[0].strip() in ["WORKSPACE", "TARGET", "TOOLCHAIN"]:
- GlobalData.gGlobalDefines[List[0].strip()] = List[1].strip()
- else:
- GlobalData.gCommandLineDefines[List[0].strip()] = List[1].strip()
- else:
- GlobalData.gCommandLineDefines[List[0].strip()] = "TRUE"
- os.environ["WORKSPACE"] = Workspace
-
- """call Workspace build create database"""
- BuildWorkSpace = WorkspaceDatabase(None)
- BuildWorkSpace.InitDatabase()
-
- #
- # Get files real name in workspace dir
- #
- GlobalData.gAllFiles = DirCache(Workspace)
- GlobalData.gWorkspace = Workspace
-
- if (Options.archList) :
- ArchList = Options.archList.split(',')
- else:
-# EdkLogger.error("GenFds", OPTION_MISSING, "Missing build ARCH")
- ArchList = BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON', Options.BuildTarget, Options.ToolChain].SupArchList
-
- TargetArchList = set(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON', Options.BuildTarget, Options.ToolChain].SupArchList) & set(ArchList)
- if len(TargetArchList) == 0:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Target ARCH %s not in platform supported ARCH %s" % (str(ArchList), str(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, 'COMMON'].SupArchList)))
-
- for Arch in ArchList:
- GenFdsGlobalVariable.OutputDirFromDscDict[Arch] = NormPath(BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, Options.BuildTarget, Options.ToolChain].OutputDirectory)
- GenFdsGlobalVariable.PlatformName = BuildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, Options.BuildTarget, Options.ToolChain].PlatformName
-
- if (Options.outputDir):
- OutputDirFromCommandLine = GenFdsGlobalVariable.ReplaceWorkspaceMacro(Options.outputDir)
- if not os.path.isabs (OutputDirFromCommandLine):
- OutputDirFromCommandLine = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, OutputDirFromCommandLine)
- for Arch in ArchList:
- GenFdsGlobalVariable.OutputDirDict[Arch] = OutputDirFromCommandLine
- else:
- for Arch in ArchList:
- GenFdsGlobalVariable.OutputDirDict[Arch] = os.path.join(GenFdsGlobalVariable.OutputDirFromDscDict[Arch], GenFdsGlobalVariable.TargetName + '_' + GenFdsGlobalVariable.ToolChainTag)
-
- for Key in GenFdsGlobalVariable.OutputDirDict:
- OutputDir = GenFdsGlobalVariable.OutputDirDict[Key]
- if OutputDir[0:2] == '..':
- OutputDir = os.path.realpath(OutputDir)
-
- if OutputDir[1] != ':':
- OutputDir = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, OutputDir)
-
- if not os.path.exists(OutputDir):
- EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=OutputDir)
- GenFdsGlobalVariable.OutputDirDict[Key] = OutputDir
-
- """ Parse Fdf file, has to place after build Workspace as FDF may contain macros from DSC file """
- FdfParserObj = FdfParser.FdfParser(FdfFilename)
- FdfParserObj.ParseFile()
-
- if FdfParserObj.CycleReferenceCheck():
- EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Cycle Reference Detected in FDF file")
-
- if (Options.uiFdName) :
- if Options.uiFdName.upper() in FdfParserObj.Profile.FdDict.keys():
- GenFds.OnlyGenerateThisFd = Options.uiFdName
- else:
- EdkLogger.error("GenFds", OPTION_VALUE_INVALID,
- "No such an FD in FDF file: %s" % Options.uiFdName)
-
- if (Options.uiFvName) :
- if Options.uiFvName.upper() in FdfParserObj.Profile.FvDict.keys():
- GenFds.OnlyGenerateThisFv = Options.uiFvName
- else:
- EdkLogger.error("GenFds", OPTION_VALUE_INVALID,
- "No such an FV in FDF file: %s" % Options.uiFvName)
-
- if (Options.uiCapName) :
- if Options.uiCapName.upper() in FdfParserObj.Profile.CapsuleDict.keys():
- GenFds.OnlyGenerateThisCap = Options.uiCapName
- else:
- EdkLogger.error("GenFds", OPTION_VALUE_INVALID,
- "No such a Capsule in FDF file: %s" % Options.uiCapName)
-
- """Modify images from build output if the feature of loading driver at fixed address is on."""
- if GenFdsGlobalVariable.FixedLoadAddress:
- GenFds.PreprocessImage(BuildWorkSpace, GenFdsGlobalVariable.ActivePlatform)
- """Call GenFds"""
- GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)
-
- """Generate GUID cross reference file"""
- GenFds.GenerateGuidXRefFile(BuildWorkSpace, ArchList)
-
- """Display FV space info."""
- GenFds.DisplayFvSpaceInfo(FdfParserObj)
-
- except FdfParser.Warning, X:
- EdkLogger.error(X.ToolName, FORMAT_INVALID, File=X.FileName, Line=X.LineNumber, ExtraData=X.Message, RaiseError = False)
- ReturnCode = FORMAT_INVALID
- except FatalError, X:
- if Options.debug != None:
- import traceback
- EdkLogger.quiet(traceback.format_exc())
- ReturnCode = X.args[0]
- except:
- import traceback
- EdkLogger.error(
- "\nPython",
- CODE_ERROR,
- "Tools code failure",
- ExtraData="Please send email to edk2-buildtools-devel@lists.sourceforge.net for help, attaching following call stack trace!\n",
- RaiseError=False
- )
- EdkLogger.quiet(traceback.format_exc())
- ReturnCode = CODE_ERROR
- return ReturnCode
-
-gParamCheck = []
-def SingleCheckCallback(option, opt_str, value, parser):
- if option not in gParamCheck:
- setattr(parser.values, option.dest, value)
- gParamCheck.append(option)
- else:
- parser.error("Option %s only allows one instance in command line!" % option)
-
-## Parse command line options
-#
-# Using standard Python module optparse to parse command line option of this tool.
-#
-# @retval Opt A optparse.Values object containing the parsed options
-# @retval Args Target of build command
-#
-def myOptionParser():
- usage = "%prog [options] -f input_file -a arch_list -b build_target -p active_platform -t tool_chain_tag -D \"MacroName [= MacroValue]\""
- Parser = OptionParser(usage=usage,description=__copyright__,version="%prog " + str(versionNumber))
- Parser.add_option("-f", "--file", dest="filename", type="string", help="Name of FDF file to convert", action="callback", callback=SingleCheckCallback)
- Parser.add_option("-a", "--arch", dest="archList", help="comma separated list containing one or more of: IA32, X64, IPF, ARM, AARCH64 or EBC which should be built, overrides target.txt?s TARGET_ARCH")
- Parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")
- Parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed.")
- Parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.")
- Parser.add_option("-p", "--platform", type="string", dest="activePlatform", help="Set the ACTIVE_PLATFORM, overrides target.txt ACTIVE_PLATFORM setting.",
- action="callback", callback=SingleCheckCallback)
- Parser.add_option("-w", "--workspace", type="string", dest="Workspace", default=os.environ.get('WORKSPACE'), help="Set the WORKSPACE",
- action="callback", callback=SingleCheckCallback)
- Parser.add_option("-o", "--outputDir", type="string", dest="outputDir", help="Name of Build Output directory",
- action="callback", callback=SingleCheckCallback)
- Parser.add_option("-r", "--rom_image", dest="uiFdName", help="Build the image using the [FD] section named by FdUiName.")
- Parser.add_option("-i", "--FvImage", dest="uiFvName", help="Build the FV image using the [FV] section named by UiFvName")
- Parser.add_option("-C", "--CapsuleImage", dest="uiCapName", help="Build the Capsule image using the [Capsule] section named by UiCapName")
- Parser.add_option("-b", "--buildtarget", type="string", dest="BuildTarget", help="Set the build TARGET, overrides target.txt TARGET setting.",
- action="callback", callback=SingleCheckCallback)
- Parser.add_option("-t", "--tagname", type="string", dest="ToolChain", help="Using the tools: TOOL_CHAIN_TAG name to build the platform.",
- action="callback", callback=SingleCheckCallback)
- Parser.add_option("-D", "--define", action="append", type="string", dest="Macros", help="Macro: \"Name [= Value]\".")
- Parser.add_option("-s", "--specifyaddress", dest="FixedAddress", action="store_true", type=None, help="Specify driver load address.")
- (Options, args) = Parser.parse_args()
- return Options
-
-## The class implementing the EDK2 flash image generation process
-#
-# This process includes:
-# 1. Collect workspace information, includes platform and module information
-# 2. Call methods of Fd class to generate FD
-# 3. Call methods of Fv class to generate FV that not belong to FD
-#
-class GenFds :
- FdfParsef = None
- # FvName, FdName, CapName in FDF, Image file name
- ImageBinDict = {}
- OnlyGenerateThisFd = None
- OnlyGenerateThisFv = None
- OnlyGenerateThisCap = None
-
- ## GenFd()
- #
- # @param OutputDir Output directory
- # @param FdfParser FDF contents parser
- # @param Workspace The directory of workspace
- # @param ArchList The Arch list of platform
- #
- def GenFd (OutputDir, FdfParser, WorkSpace, ArchList):
- GenFdsGlobalVariable.SetDir ('', FdfParser, WorkSpace, ArchList)
-
- GenFdsGlobalVariable.VerboseLogger(" Generate all Fd images and their required FV and Capsule images!")
- if GenFds.OnlyGenerateThisCap != None and GenFds.OnlyGenerateThisCap.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():
- CapsuleObj = GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.get(GenFds.OnlyGenerateThisCap.upper())
- if CapsuleObj != None:
- CapsuleObj.GenCapsule()
- return
-
- if GenFds.OnlyGenerateThisFd != None and GenFds.OnlyGenerateThisFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
- FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(GenFds.OnlyGenerateThisFd.upper())
- if FdObj != None:
- FdObj.GenFd()
- return
- elif GenFds.OnlyGenerateThisFd == None and GenFds.OnlyGenerateThisFv == None:
- for FdName in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
- FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[FdName]
- FdObj.GenFd()
-
- GenFdsGlobalVariable.VerboseLogger("\n Generate other FV images! ")
- if GenFds.OnlyGenerateThisFv != None and GenFds.OnlyGenerateThisFv.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():
- FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(GenFds.OnlyGenerateThisFv.upper())
- if FvObj != None:
- Buffer = StringIO.StringIO()
- FvObj.AddToBuffer(Buffer)
- Buffer.close()
- return
- elif GenFds.OnlyGenerateThisFv == None:
- for FvName in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():
- Buffer = StringIO.StringIO('')
- FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict[FvName]
- FvObj.AddToBuffer(Buffer)
- Buffer.close()
-
- if GenFds.OnlyGenerateThisFv == None and GenFds.OnlyGenerateThisFd == None and GenFds.OnlyGenerateThisCap == None:
- if GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict != {}:
- GenFdsGlobalVariable.VerboseLogger("\n Generate other Capsule images!")
- for CapsuleName in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():
- CapsuleObj = GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict[CapsuleName]
- CapsuleObj.GenCapsule()
-
- if GenFdsGlobalVariable.FdfParser.Profile.OptRomDict != {}:
- GenFdsGlobalVariable.VerboseLogger("\n Generate all Option ROM!")
- for DriverName in GenFdsGlobalVariable.FdfParser.Profile.OptRomDict.keys():
- OptRomObj = GenFdsGlobalVariable.FdfParser.Profile.OptRomDict[DriverName]
- OptRomObj.AddToBuffer(None)
-
- ## GetFvBlockSize()
- #
- # @param FvObj Whose block size to get
- # @retval int Block size value
- #
- def GetFvBlockSize(FvObj):
- DefaultBlockSize = 0x1
- FdObj = None
- if GenFds.OnlyGenerateThisFd != None and GenFds.OnlyGenerateThisFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():
- FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[GenFds.OnlyGenerateThisFd.upper()]
- if FdObj == None:
- for ElementFd in GenFdsGlobalVariable.FdfParser.Profile.FdDict.values():
- for ElementRegion in ElementFd.RegionList:
- if ElementRegion.RegionType == 'FV':
- for ElementRegionData in ElementRegion.RegionDataList:
- if ElementRegionData != None and ElementRegionData.upper() == FvObj.UiFvName:
- if FvObj.BlockSizeList != []:
- return FvObj.BlockSizeList[0][0]
- else:
- return ElementRegion.BlockSizeOfRegion(ElementFd.BlockSizeList)
- if FvObj.BlockSizeList != []:
- return FvObj.BlockSizeList[0][0]
- return DefaultBlockSize
- else:
- for ElementRegion in FdObj.RegionList:
- if ElementRegion.RegionType == 'FV':
- for ElementRegionData in ElementRegion.RegionDataList:
- if ElementRegionData != None and ElementRegionData.upper() == FvObj.UiFvName:
- if FvObj.BlockSizeList != []:
- return FvObj.BlockSizeList[0][0]
- else:
- return ElementRegion.BlockSizeOfRegion(ElementFd.BlockSizeList)
- return DefaultBlockSize
-
- ## DisplayFvSpaceInfo()
- #
- # @param FvObj Whose block size to get
- # @retval None
- #
- def DisplayFvSpaceInfo(FdfParser):
-
- FvSpaceInfoList = []
- MaxFvNameLength = 0
- for FvName in FdfParser.Profile.FvDict:
- if len(FvName) > MaxFvNameLength:
- MaxFvNameLength = len(FvName)
- FvSpaceInfoFileName = os.path.join(GenFdsGlobalVariable.FvDir, FvName.upper() + '.Fv.map')
- if os.path.exists(FvSpaceInfoFileName):
- FileLinesList = linecache.getlines(FvSpaceInfoFileName)
- TotalFound = False
- Total = ''
- UsedFound = False
- Used = ''
- FreeFound = False
- Free = ''
- for Line in FileLinesList:
- NameValue = Line.split('=')
- if len(NameValue) == 2:
- if NameValue[0].strip() == 'EFI_FV_TOTAL_SIZE':
- TotalFound = True
- Total = NameValue[1].strip()
- if NameValue[0].strip() == 'EFI_FV_TAKEN_SIZE':
- UsedFound = True
- Used = NameValue[1].strip()
- if NameValue[0].strip() == 'EFI_FV_SPACE_SIZE':
- FreeFound = True
- Free = NameValue[1].strip()
-
- if TotalFound and UsedFound and FreeFound:
- FvSpaceInfoList.append((FvName, Total, Used, Free))
-
- GenFdsGlobalVariable.InfLogger('\nFV Space Information')
- for FvSpaceInfo in FvSpaceInfoList:
- Name = FvSpaceInfo[0]
- TotalSizeValue = long(FvSpaceInfo[1], 0)
- UsedSizeValue = long(FvSpaceInfo[2], 0)
- FreeSizeValue = long(FvSpaceInfo[3], 0)
- if UsedSizeValue == TotalSizeValue:
- Percentage = '100'
- else:
- Percentage = str((UsedSizeValue+0.0)/TotalSizeValue)[0:4].lstrip('0.')
-
- GenFdsGlobalVariable.InfLogger(Name + ' ' + '[' + Percentage + '%Full] ' + str(TotalSizeValue) + ' total, ' + str(UsedSizeValue) + ' used, ' + str(FreeSizeValue) + ' free')
-
- ## PreprocessImage()
- #
- # @param BuildDb Database from build meta data files
- # @param DscFile modules from dsc file will be preprocessed
- # @retval None
- #
- def PreprocessImage(BuildDb, DscFile):
- PcdDict = BuildDb.BuildObject[DscFile, 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].Pcds
- PcdValue = ''
- for Key in PcdDict:
- PcdObj = PcdDict[Key]
- if PcdObj.TokenCName == 'PcdBsBaseAddress':
- PcdValue = PcdObj.DefaultValue
- break
-
- if PcdValue == '':
- return
-
- Int64PcdValue = long(PcdValue, 0)
- if Int64PcdValue == 0 or Int64PcdValue < -1:
- return
-
- TopAddress = 0
- if Int64PcdValue > 0:
- TopAddress = Int64PcdValue
-
- ModuleDict = BuildDb.BuildObject[DscFile, 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].Modules
- for Key in ModuleDict:
- ModuleObj = BuildDb.BuildObject[Key, 'COMMON', GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- print ModuleObj.BaseName + ' ' + ModuleObj.ModuleType
-
- def GenerateGuidXRefFile(BuildDb, ArchList):
- GuidXRefFileName = os.path.join(GenFdsGlobalVariable.FvDir, "Guid.xref")
- GuidXRefFile = StringIO.StringIO('')
- for Arch in ArchList:
- PlatformDataBase = BuildDb.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- for ModuleFile in PlatformDataBase.Modules:
- Module = BuildDb.BuildObject[ModuleFile, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- GuidXRefFile.write("%s %s\n" % (Module.Guid, Module.BaseName))
- if GuidXRefFile.getvalue():
- SaveFileOnChange(GuidXRefFileName, GuidXRefFile.getvalue(), False)
- GenFdsGlobalVariable.InfLogger("\nGUID cross reference file can be found at %s" % GuidXRefFileName)
- elif os.path.exists(GuidXRefFileName):
- os.remove(GuidXRefFileName)
- GuidXRefFile.close()
-
- ##Define GenFd as static function
- GenFd = staticmethod(GenFd)
- GetFvBlockSize = staticmethod(GetFvBlockSize)
- DisplayFvSpaceInfo = staticmethod(DisplayFvSpaceInfo)
- PreprocessImage = staticmethod(PreprocessImage)
- GenerateGuidXRefFile = staticmethod(GenerateGuidXRefFile)
-
-if __name__ == '__main__':
- r = main()
- ## 0-127 is a safe return range, and 1 is a standard default error
- if r < 0 or r > 127: r = 1
- sys.exit(r)
-
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
deleted file mode 100644
index 2fa4cb8c0d..0000000000
--- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
+++ /dev/null
@@ -1,705 +0,0 @@
-## @file
-# Global variables for GenFds
-#
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import sys
-import subprocess
-import struct
-import array
-
-from Common.BuildToolError import *
-from Common import EdkLogger
-from Common.Misc import SaveFileOnChange
-
-from Common.TargetTxtClassObject import TargetTxtClassObject
-from Common.ToolDefClassObject import ToolDefClassObject
-from AutoGen.BuildEngine import BuildRule
-import Common.DataType as DataType
-from Common.Misc import PathClass
-
-## Global variables
-#
-#
-class GenFdsGlobalVariable:
- FvDir = ''
- OutputDirDict = {}
- BinDir = ''
- # will be FvDir + os.sep + 'Ffs'
- FfsDir = ''
- FdfParser = None
- LibDir = ''
- WorkSpace = None
- WorkSpaceDir = ''
- EdkSourceDir = ''
- OutputDirFromDscDict = {}
- TargetName = ''
- ToolChainTag = ''
- RuleDict = {}
- ArchList = None
- VtfDict = {}
- ActivePlatform = None
- FvAddressFileName = ''
- VerboseMode = False
- DebugLevel = -1
- SharpCounter = 0
- SharpNumberPerLine = 40
- FdfFile = ''
- FdfFileTimeStamp = 0
- FixedLoadAddress = False
- PlatformName = ''
-
- BuildRuleFamily = "MSFT"
- ToolChainFamily = "MSFT"
- __BuildRuleDatabase = None
-
- SectionHeader = struct.Struct("3B 1B")
-
- ## LoadBuildRule
- #
- @staticmethod
- def __LoadBuildRule():
- if GenFdsGlobalVariable.__BuildRuleDatabase:
- return GenFdsGlobalVariable.__BuildRuleDatabase
- BuildConfigurationFile = os.path.normpath(os.path.join(GenFdsGlobalVariable.WorkSpaceDir, "Conf/target.txt"))
- TargetTxt = TargetTxtClassObject()
- if os.path.isfile(BuildConfigurationFile) == True:
- TargetTxt.LoadTargetTxtFile(BuildConfigurationFile)
- if DataType.TAB_TAT_DEFINES_BUILD_RULE_CONF in TargetTxt.TargetTxtDictionary:
- BuildRuleFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_BUILD_RULE_CONF]
- if BuildRuleFile in [None, '']:
- BuildRuleFile = 'Conf/build_rule.txt'
- GenFdsGlobalVariable.__BuildRuleDatabase = BuildRule(BuildRuleFile)
- ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
- if ToolDefinitionFile == '':
- ToolDefinitionFile = "Conf/tools_def.txt"
- if os.path.isfile(ToolDefinitionFile):
- ToolDef = ToolDefClassObject()
- ToolDef.LoadToolDefFile(ToolDefinitionFile)
- ToolDefinition = ToolDef.ToolsDefTxtDatabase
- if DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY in ToolDefinition \
- and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY] \
- and ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainTag]:
- GenFdsGlobalVariable.BuildRuleFamily = ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainTag]
-
- if DataType.TAB_TOD_DEFINES_FAMILY in ToolDefinition \
- and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY] \
- and ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY][GenFdsGlobalVariable.ToolChainTag]:
- GenFdsGlobalVariable.ToolChainFamily = ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY][GenFdsGlobalVariable.ToolChainTag]
- return GenFdsGlobalVariable.__BuildRuleDatabase
-
- ## GetBuildRules
- # @param Inf: object of InfBuildData
- # @param Arch: current arch
- #
- @staticmethod
- def GetBuildRules(Inf, Arch):
- if not Arch:
- Arch = 'COMMON'
-
- if not Arch in GenFdsGlobalVariable.OutputDirDict:
- return {}
-
- BuildRuleDatabase = GenFdsGlobalVariable.__LoadBuildRule()
- if not BuildRuleDatabase:
- return {}
-
- PathClassObj = PathClass(Inf.MetaFile.File,
- GenFdsGlobalVariable.WorkSpaceDir)
- Macro = {}
- Macro["WORKSPACE" ] = GenFdsGlobalVariable.WorkSpaceDir
- Macro["MODULE_NAME" ] = Inf.BaseName
- Macro["MODULE_GUID" ] = Inf.Guid
- Macro["MODULE_VERSION" ] = Inf.Version
- Macro["MODULE_TYPE" ] = Inf.ModuleType
- Macro["MODULE_FILE" ] = str(PathClassObj)
- Macro["MODULE_FILE_BASE_NAME" ] = PathClassObj.BaseName
- Macro["MODULE_RELATIVE_DIR" ] = PathClassObj.SubDir
- Macro["MODULE_DIR" ] = PathClassObj.SubDir
-
- Macro["BASE_NAME" ] = Inf.BaseName
-
- Macro["ARCH" ] = Arch
- Macro["TOOLCHAIN" ] = GenFdsGlobalVariable.ToolChainTag
- Macro["TOOLCHAIN_TAG" ] = GenFdsGlobalVariable.ToolChainTag
- Macro["TOOL_CHAIN_TAG" ] = GenFdsGlobalVariable.ToolChainTag
- Macro["TARGET" ] = GenFdsGlobalVariable.TargetName
-
- Macro["BUILD_DIR" ] = GenFdsGlobalVariable.OutputDirDict[Arch]
- Macro["BIN_DIR" ] = os.path.join(GenFdsGlobalVariable.OutputDirDict[Arch], Arch)
- Macro["LIB_DIR" ] = os.path.join(GenFdsGlobalVariable.OutputDirDict[Arch], Arch)
- BuildDir = os.path.join(
- GenFdsGlobalVariable.OutputDirDict[Arch],
- Arch,
- PathClassObj.SubDir,
- PathClassObj.BaseName
- )
- Macro["MODULE_BUILD_DIR" ] = BuildDir
- Macro["OUTPUT_DIR" ] = os.path.join(BuildDir, "OUTPUT")
- Macro["DEBUG_DIR" ] = os.path.join(BuildDir, "DEBUG")
-
- BuildRules = {}
- for Type in BuildRuleDatabase.FileTypeList:
- #first try getting build rule by BuildRuleFamily
- RuleObject = BuildRuleDatabase[Type, Inf.BuildType, Arch, GenFdsGlobalVariable.BuildRuleFamily]
- if not RuleObject:
- # build type is always module type, but ...
- if Inf.ModuleType != Inf.BuildType:
- RuleObject = BuildRuleDatabase[Type, Inf.ModuleType, Arch, GenFdsGlobalVariable.BuildRuleFamily]
- #second try getting build rule by ToolChainFamily
- if not RuleObject:
- RuleObject = BuildRuleDatabase[Type, Inf.BuildType, Arch, GenFdsGlobalVariable.ToolChainFamily]
- if not RuleObject:
- # build type is always module type, but ...
- if Inf.ModuleType != Inf.BuildType:
- RuleObject = BuildRuleDatabase[Type, Inf.ModuleType, Arch, GenFdsGlobalVariable.ToolChainFamily]
- if not RuleObject:
- continue
- RuleObject = RuleObject.Instantiate(Macro)
- BuildRules[Type] = RuleObject
- for Ext in RuleObject.SourceFileExtList:
- BuildRules[Ext] = RuleObject
- return BuildRules
-
- ## GetModuleCodaTargetList
- #
- # @param Inf: object of InfBuildData
- # @param Arch: current arch
- #
- @staticmethod
- def GetModuleCodaTargetList(Inf, Arch):
- BuildRules = GenFdsGlobalVariable.GetBuildRules(Inf, Arch)
- if not BuildRules:
- return []
-
- TargetList = set()
- FileList = []
- for File in Inf.Sources:
- if File.TagName in ("", "*", GenFdsGlobalVariable.ToolChainTag) and \
- File.ToolChainFamily in ("", "*", GenFdsGlobalVariable.ToolChainFamily):
- FileList.append((File, DataType.TAB_UNKNOWN_FILE))
-
- for File in Inf.Binaries:
- if File.Target in ['COMMON', '*', GenFdsGlobalVariable.TargetName]:
- FileList.append((File, File.Type))
-
- for File, FileType in FileList:
- LastTarget = None
- RuleChain = []
- SourceList = [File]
- Index = 0
- while Index < len(SourceList):
- Source = SourceList[Index]
- Index = Index + 1
-
- if File.IsBinary and File == Source and Inf.Binaries != None and File in Inf.Binaries:
- # Skip all files that are not binary libraries
- if not Inf.LibraryClass:
- continue
- RuleObject = BuildRules[DataType.TAB_DEFAULT_BINARY_FILE]
- elif FileType in BuildRules:
- RuleObject = BuildRules[FileType]
- elif Source.Ext in BuildRules:
- RuleObject = BuildRules[Source.Ext]
- else:
- # stop at no more rules
- if LastTarget:
- TargetList.add(str(LastTarget))
- break
-
- FileType = RuleObject.SourceFileType
-
- # stop at STATIC_LIBRARY for library
- if Inf.LibraryClass and FileType == DataType.TAB_STATIC_LIBRARY:
- if LastTarget:
- TargetList.add(str(LastTarget))
- break
-
- Target = RuleObject.Apply(Source)
- if not Target:
- if LastTarget:
- TargetList.add(str(LastTarget))
- break
- elif not Target.Outputs:
- # Only do build for target with outputs
- TargetList.add(str(Target))
-
- # to avoid cyclic rule
- if FileType in RuleChain:
- break
-
- RuleChain.append(FileType)
- SourceList.extend(Target.Outputs)
- LastTarget = Target
- FileType = DataType.TAB_UNKNOWN_FILE
-
- return list(TargetList)
-
- ## SetDir()
- #
- # @param OutputDir Output directory
- # @param FdfParser FDF contents parser
- # @param Workspace The directory of workspace
- # @param ArchList The Arch list of platform
- #
- def SetDir (OutputDir, FdfParser, WorkSpace, ArchList):
- GenFdsGlobalVariable.VerboseLogger( "GenFdsGlobalVariable.OutputDir :%s" %OutputDir)
-# GenFdsGlobalVariable.OutputDirDict = OutputDir
- GenFdsGlobalVariable.FdfParser = FdfParser
- GenFdsGlobalVariable.WorkSpace = WorkSpace
- GenFdsGlobalVariable.FvDir = os.path.join(GenFdsGlobalVariable.OutputDirDict[ArchList[0]], 'FV')
- if not os.path.exists(GenFdsGlobalVariable.FvDir) :
- os.makedirs(GenFdsGlobalVariable.FvDir)
- GenFdsGlobalVariable.FfsDir = os.path.join(GenFdsGlobalVariable.FvDir, 'Ffs')
- if not os.path.exists(GenFdsGlobalVariable.FfsDir) :
- os.makedirs(GenFdsGlobalVariable.FfsDir)
- if ArchList != None:
- GenFdsGlobalVariable.ArchList = ArchList
-
- T_CHAR_LF = '\n'
- #
- # Create FV Address inf file
- #
- GenFdsGlobalVariable.FvAddressFileName = os.path.join(GenFdsGlobalVariable.FfsDir, 'FvAddress.inf')
- FvAddressFile = open (GenFdsGlobalVariable.FvAddressFileName, 'w')
- #
- # Add [Options]
- #
- FvAddressFile.writelines("[options]" + T_CHAR_LF)
- BsAddress = '0'
- for Arch in ArchList:
- if GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].BsBaseAddress:
- BsAddress = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].BsBaseAddress
- break
-
- FvAddressFile.writelines("EFI_BOOT_DRIVER_BASE_ADDRESS = " + \
- BsAddress + \
- T_CHAR_LF)
-
- RtAddress = '0'
- for Arch in ArchList:
- if GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].RtBaseAddress:
- RtAddress = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].RtBaseAddress
-
- FvAddressFile.writelines("EFI_RUNTIME_DRIVER_BASE_ADDRESS = " + \
- RtAddress + \
- T_CHAR_LF)
-
- FvAddressFile.close()
-
- ## ReplaceWorkspaceMacro()
- #
- # @param String String that may contain macro
- #
- def ReplaceWorkspaceMacro(String):
- Str = String.replace('$(WORKSPACE)', GenFdsGlobalVariable.WorkSpaceDir)
- if os.path.exists(Str):
- if not os.path.isabs(Str):
- Str = os.path.abspath(Str)
- else:
- Str = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, String)
- return os.path.normpath(Str)
-
- ## Check if the input files are newer than output files
- #
- # @param Output Path of output file
- # @param Input Path list of input files
- #
- # @retval True if Output doesn't exist, or any Input is newer
- # @retval False if all Input is older than Output
- #
- @staticmethod
- def NeedsUpdate(Output, Input):
- if not os.path.exists(Output):
- return True
- # always update "Output" if no "Input" given
- if Input == None or len(Input) == 0:
- return True
-
- # if fdf file is changed after the 'Output" is generated, update the 'Output'
- OutputTime = os.path.getmtime(Output)
- if GenFdsGlobalVariable.FdfFileTimeStamp > OutputTime:
- return True
-
- for F in Input:
- # always update "Output" if any "Input" doesn't exist
- if not os.path.exists(F):
- return True
- # always update "Output" if any "Input" is newer than "Output"
- if os.path.getmtime(F) > OutputTime:
- return True
- return False
-
- @staticmethod
- def GenerateSection(Output, Input, Type=None, CompressionType=None, Guid=None,
- GuidHdrLen=None, GuidAttr=[], Ui=None, Ver=None, InputAlign=None, BuildNumber=None):
- Cmd = ["GenSec"]
- if Type not in [None, '']:
- Cmd += ["-s", Type]
- if CompressionType not in [None, '']:
- Cmd += ["-c", CompressionType]
- if Guid != None:
- Cmd += ["-g", Guid]
- if GuidHdrLen not in [None, '']:
- Cmd += ["-l", GuidHdrLen]
- if len(GuidAttr) != 0:
- #Add each guided attribute
- for Attr in GuidAttr:
- Cmd += ["-r", Attr]
- if InputAlign != None:
- #Section Align is only for dummy section without section type
- for SecAlign in InputAlign:
- Cmd += ["--sectionalign", SecAlign]
-
- CommandFile = Output + '.txt'
- if Ui not in [None, '']:
- #Cmd += ["-n", '"' + Ui + '"']
- SectionData = array.array('B', [0,0,0,0])
- SectionData.fromstring(Ui.encode("utf_16_le"))
- SectionData.append(0)
- SectionData.append(0)
- Len = len(SectionData)
- GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & 0xff, (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x15)
- SaveFileOnChange(Output, SectionData.tostring())
- elif Ver not in [None, '']:
- Cmd += ["-n", Ver]
- if BuildNumber:
- Cmd += ["-j", BuildNumber]
- Cmd += ["-o", Output]
-
- SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
- if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]):
- return
-
- GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate section")
- else:
- Cmd += ["-o", Output]
- Cmd += Input
-
- SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
- if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]):
- return
- GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
-
- GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate section")
-
- @staticmethod
- def GetAlignment (AlignString):
- if AlignString == None:
- return 0
- if AlignString in ("1K", "2K", "4K", "8K", "16K", "32K", "64K"):
- return int (AlignString.rstrip('K')) * 1024
- else:
- return int (AlignString)
-
- @staticmethod
- def GenerateFfs(Output, Input, Type, Guid, Fixed=False, CheckSum=False, Align=None,
- SectionAlign=None):
- Cmd = ["GenFfs", "-t", Type, "-g", Guid]
- if Fixed == True:
- Cmd += ["-x"]
- if CheckSum:
- Cmd += ["-s"]
- if Align not in [None, '']:
- Cmd += ["-a", Align]
-
- Cmd += ["-o", Output]
- for I in range(0, len(Input)):
- Cmd += ("-i", Input[I])
- if SectionAlign not in [None, '', []] and SectionAlign[I] not in [None, '']:
- Cmd += ("-n", SectionAlign[I])
-
- CommandFile = Output + '.txt'
- SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
- if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]):
- return
- GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
-
- GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate FFS")
-
- @staticmethod
- def GenerateFirmwareVolume(Output, Input, BaseAddress=None, ForceRebase=None, Capsule=False, Dump=False,
- AddressFile=None, MapFile=None, FfsList=[]):
- if not GenFdsGlobalVariable.NeedsUpdate(Output, Input+FfsList):
- return
- GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
-
- Cmd = ["GenFv"]
- if BaseAddress not in [None, '']:
- Cmd += ["-r", BaseAddress]
-
- if ForceRebase == False:
- Cmd +=["-F", "FALSE"]
- elif ForceRebase == True:
- Cmd +=["-F", "TRUE"]
-
- if Capsule:
- Cmd += ["-c"]
- if Dump:
- Cmd += ["-p"]
- if AddressFile not in [None, '']:
- Cmd += ["-a", AddressFile]
- if MapFile not in [None, '']:
- Cmd += ["-m", MapFile]
- Cmd += ["-o", Output]
- for I in Input:
- Cmd += ["-i", I]
-
- GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate FV")
-
- @staticmethod
- def GenerateVtf(Output, Input, BaseAddress=None, FvSize=None):
- if not GenFdsGlobalVariable.NeedsUpdate(Output, Input):
- return
- GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
-
- Cmd = ["GenVtf"]
- if BaseAddress not in [None, ''] and FvSize not in [None, ''] \
- and len(BaseAddress) == len(FvSize):
- for I in range(0, len(BaseAddress)):
- Cmd += ["-r", BaseAddress[I], "-s", FvSize[I]]
- Cmd += ["-o", Output]
- for F in Input:
- Cmd += ["-f", F]
-
- GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate VTF")
-
- @staticmethod
- def GenerateFirmwareImage(Output, Input, Type="efi", SubType=None, Zero=False,
- Strip=False, Replace=False, TimeStamp=None, Join=False,
- Align=None, Padding=None, Convert=False):
- if not GenFdsGlobalVariable.NeedsUpdate(Output, Input):
- return
- GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
-
- Cmd = ["GenFw"]
- if Type.lower() == "te":
- Cmd += ["-t"]
- if SubType not in [None, '']:
- Cmd += ["-e", SubType]
- if TimeStamp not in [None, '']:
- Cmd += ["-s", TimeStamp]
- if Align not in [None, '']:
- Cmd += ["-a", Align]
- if Padding not in [None, '']:
- Cmd += ["-p", Padding]
- if Zero:
- Cmd += ["-z"]
- if Strip:
- Cmd += ["-l"]
- if Replace:
- Cmd += ["-r"]
- if Join:
- Cmd += ["-j"]
- if Convert:
- Cmd += ["-m"]
- Cmd += ["-o", Output]
- Cmd += Input
-
- GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate firmware image")
-
- @staticmethod
- def GenerateOptionRom(Output, EfiInput, BinaryInput, Compress=False, ClassCode=None,
- Revision=None, DeviceId=None, VendorId=None):
- InputList = []
- Cmd = ["EfiRom"]
- if len(EfiInput) > 0:
-
- if Compress:
- Cmd += ["-ec"]
- else:
- Cmd += ["-e"]
-
- for EfiFile in EfiInput:
- Cmd += [EfiFile]
- InputList.append (EfiFile)
-
- if len(BinaryInput) > 0:
- Cmd += ["-b"]
- for BinFile in BinaryInput:
- Cmd += [BinFile]
- InputList.append (BinFile)
-
- # Check List
- if not GenFdsGlobalVariable.NeedsUpdate(Output, InputList):
- return
- GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, InputList))
-
- if ClassCode != None:
- Cmd += ["-l", ClassCode]
- if Revision != None:
- Cmd += ["-r", Revision]
- if DeviceId != None:
- Cmd += ["-i", DeviceId]
- if VendorId != None:
- Cmd += ["-f", VendorId]
-
- Cmd += ["-o", Output]
- GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate option rom")
-
- @staticmethod
- def GuidTool(Output, Input, ToolPath, Options='', returnValue=[]):
- if not GenFdsGlobalVariable.NeedsUpdate(Output, Input):
- return
- GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
-
- Cmd = [ToolPath, ]
- Cmd += Options.split(' ')
- Cmd += ["-o", Output]
- Cmd += Input
-
- GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to call " + ToolPath, returnValue)
-
- def CallExternalTool (cmd, errorMess, returnValue=[]):
-
- if type(cmd) not in (tuple, list):
- GenFdsGlobalVariable.ErrorLogger("ToolError! Invalid parameter type in call to CallExternalTool")
-
- if GenFdsGlobalVariable.DebugLevel != -1:
- cmd += ('--debug', str(GenFdsGlobalVariable.DebugLevel))
- GenFdsGlobalVariable.InfLogger (cmd)
-
- if GenFdsGlobalVariable.VerboseMode:
- cmd += ('-v',)
- GenFdsGlobalVariable.InfLogger (cmd)
- else:
- sys.stdout.write ('#')
- sys.stdout.flush()
- GenFdsGlobalVariable.SharpCounter = GenFdsGlobalVariable.SharpCounter + 1
- if GenFdsGlobalVariable.SharpCounter % GenFdsGlobalVariable.SharpNumberPerLine == 0:
- sys.stdout.write('\n')
-
- try:
- PopenObject = subprocess.Popen(' '.join(cmd), stdout=subprocess.PIPE, stderr= subprocess.PIPE, shell=True)
- except Exception, X:
- EdkLogger.error("GenFds", COMMAND_FAILURE, ExtraData="%s: %s" % (str(X), cmd[0]))
- (out, error) = PopenObject.communicate()
-
- while PopenObject.returncode == None :
- PopenObject.wait()
- if returnValue != [] and returnValue[0] != 0:
- #get command return value
- returnValue[0] = PopenObject.returncode
- return
- if PopenObject.returncode != 0 or GenFdsGlobalVariable.VerboseMode or GenFdsGlobalVariable.DebugLevel != -1:
- GenFdsGlobalVariable.InfLogger ("Return Value = %d" %PopenObject.returncode)
- GenFdsGlobalVariable.InfLogger (out)
- GenFdsGlobalVariable.InfLogger (error)
- if PopenObject.returncode != 0:
- print "###", cmd
- EdkLogger.error("GenFds", COMMAND_FAILURE, errorMess)
-
- def VerboseLogger (msg):
- EdkLogger.verbose(msg)
-
- def InfLogger (msg):
- EdkLogger.info(msg)
-
- def ErrorLogger (msg, File = None, Line = None, ExtraData = None):
- EdkLogger.error('GenFds', GENFDS_ERROR, msg, File, Line, ExtraData)
-
- def DebugLogger (Level, msg):
- EdkLogger.debug(Level, msg)
-
- ## ReplaceWorkspaceMacro()
- #
- # @param Str String that may contain macro
- # @param MacroDict Dictionary that contains macro value pair
- #
- def MacroExtend (Str, MacroDict = {}, Arch = 'COMMON'):
- if Str == None :
- return None
-
- Dict = {'$(WORKSPACE)' : GenFdsGlobalVariable.WorkSpaceDir,
- '$(EDK_SOURCE)' : GenFdsGlobalVariable.EdkSourceDir,
-# '$(OUTPUT_DIRECTORY)': GenFdsGlobalVariable.OutputDirFromDsc,
- '$(TARGET)' : GenFdsGlobalVariable.TargetName,
- '$(TOOL_CHAIN_TAG)' : GenFdsGlobalVariable.ToolChainTag
- }
- OutputDir = GenFdsGlobalVariable.OutputDirFromDscDict[GenFdsGlobalVariable.ArchList[0]]
- if Arch != 'COMMON' and Arch in GenFdsGlobalVariable.ArchList:
- OutputDir = GenFdsGlobalVariable.OutputDirFromDscDict[Arch]
-
- Dict['$(OUTPUT_DIRECTORY)'] = OutputDir
-
- if MacroDict != None and len (MacroDict) != 0:
- Dict.update(MacroDict)
-
- for key in Dict.keys():
- if Str.find(key) >= 0 :
- Str = Str.replace (key, Dict[key])
-
- if Str.find('$(ARCH)') >= 0:
- if len(GenFdsGlobalVariable.ArchList) == 1:
- Str = Str.replace('$(ARCH)', GenFdsGlobalVariable.ArchList[0])
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "No way to determine $(ARCH) for %s" % Str)
-
- return Str
-
- ## GetPcdValue()
- #
- # @param PcdPattern pattern that labels a PCD.
- #
- def GetPcdValue (PcdPattern):
- if PcdPattern == None :
- return None
- PcdPair = PcdPattern.lstrip('PCD(').rstrip(')').strip().split('.')
- TokenSpace = PcdPair[0]
- TokenCName = PcdPair[1]
-
- PcdValue = ''
- for Arch in GenFdsGlobalVariable.ArchList:
- Platform = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
- PcdDict = Platform.Pcds
- for Key in PcdDict:
- PcdObj = PcdDict[Key]
- if (PcdObj.TokenCName == TokenCName) and (PcdObj.TokenSpaceGuidCName == TokenSpace):
- if PcdObj.Type != 'FixedAtBuild':
- EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not FixedAtBuild type." % PcdPattern)
- if PcdObj.DatumType != 'VOID*':
- EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not VOID* datum type." % PcdPattern)
-
- PcdValue = PcdObj.DefaultValue
- return PcdValue
-
- for Package in GenFdsGlobalVariable.WorkSpace.GetPackageList(GenFdsGlobalVariable.ActivePlatform,
- Arch,
- GenFdsGlobalVariable.TargetName,
- GenFdsGlobalVariable.ToolChainTag):
- PcdDict = Package.Pcds
- for Key in PcdDict:
- PcdObj = PcdDict[Key]
- if (PcdObj.TokenCName == TokenCName) and (PcdObj.TokenSpaceGuidCName == TokenSpace):
- if PcdObj.Type != 'FixedAtBuild':
- EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not FixedAtBuild type." % PcdPattern)
- if PcdObj.DatumType != 'VOID*':
- EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not VOID* datum type." % PcdPattern)
-
- PcdValue = PcdObj.DefaultValue
- return PcdValue
-
- return PcdValue
-
- SetDir = staticmethod(SetDir)
- ReplaceWorkspaceMacro = staticmethod(ReplaceWorkspaceMacro)
- CallExternalTool = staticmethod(CallExternalTool)
- VerboseLogger = staticmethod(VerboseLogger)
- InfLogger = staticmethod(InfLogger)
- ErrorLogger = staticmethod(ErrorLogger)
- DebugLogger = staticmethod(DebugLogger)
- MacroExtend = staticmethod (MacroExtend)
- GetPcdValue = staticmethod(GetPcdValue)
diff --git a/BaseTools/Source/Python/GenFds/GuidSection.py b/BaseTools/Source/Python/GenFds/GuidSection.py
deleted file mode 100644
index 36ad4f58ef..0000000000
--- a/BaseTools/Source/Python/GenFds/GuidSection.py
+++ /dev/null
@@ -1,290 +0,0 @@
-## @file
-# process GUIDed section generation
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Section
-import subprocess
-from Ffs import Ffs
-import os
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from CommonDataClass.FdfClass import GuidSectionClassObject
-from Common import ToolDefClassObject
-import sys
-from Common import EdkLogger
-from Common.BuildToolError import *
-from FvImageSection import FvImageSection
-
-## generate GUIDed section
-#
-#
-class GuidSection(GuidSectionClassObject) :
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- GuidSectionClassObject.__init__(self)
-
- ## GenSection() method
- #
- # Generate GUIDed section
- #
- # @param self The object pointer
- # @param OutputPath Where to place output file
- # @param ModuleName Which module this section belongs to
- # @param SecNum Index of section
- # @param KeyStringList Filter for inputs of section generation
- # @param FfsInf FfsInfStatement object that contains this section data
- # @param Dict dictionary contains macro and its value
- # @retval tuple (Generated file name, section alignment)
- #
- def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
- #
- # Generate all section
- #
- self.KeyStringList = KeyStringList
- self.CurrentArchList = GenFdsGlobalVariable.ArchList
- if FfsInf != None:
- self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)
- self.NameGuid = FfsInf.__ExtendMacro__(self.NameGuid)
- self.SectionType = FfsInf.__ExtendMacro__(self.SectionType)
- self.CurrentArchList = [FfsInf.CurrentArch]
-
- SectFile = tuple()
- SectAlign = []
- Index = 0
- MaxAlign = None
- if self.FvAddr != []:
- FvAddrIsSet = True
- else:
- FvAddrIsSet = False
-
- if self.ProcessRequired in ("TRUE", "1"):
- if self.FvAddr != []:
- #no use FvAddr when the image is processed.
- self.FvAddr = []
- if self.FvParentAddr != None:
- #no use Parent Addr when the image is processed.
- self.FvParentAddr = None
-
- for Sect in self.SectionList:
- Index = Index + 1
- SecIndex = '%s.%d' %(SecNum,Index)
- # set base address for inside FvImage
- if isinstance(Sect, FvImageSection):
- if self.FvAddr != []:
- Sect.FvAddr = self.FvAddr.pop(0)
- self.IncludeFvSection = True
- elif isinstance(Sect, GuidSection):
- Sect.FvAddr = self.FvAddr
- Sect.FvParentAddr = self.FvParentAddr
- ReturnSectList, align = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList,FfsInf, Dict)
- if isinstance(Sect, GuidSection):
- if Sect.IncludeFvSection:
- self.IncludeFvSection = Sect.IncludeFvSection
-
- if align != None:
- if MaxAlign == None:
- MaxAlign = align
- if GenFdsGlobalVariable.GetAlignment (align) > GenFdsGlobalVariable.GetAlignment (MaxAlign):
- MaxAlign = align
- if ReturnSectList != []:
- if align == None:
- align = "1"
- for file in ReturnSectList:
- SectFile += (file,)
- SectAlign.append(align)
-
- if MaxAlign != None:
- if self.Alignment == None:
- self.Alignment = MaxAlign
- else:
- if GenFdsGlobalVariable.GetAlignment (MaxAlign) > GenFdsGlobalVariable.GetAlignment (self.Alignment):
- self.Alignment = MaxAlign
-
- OutputFile = OutputPath + \
- os.sep + \
- ModuleName + \
- 'SEC' + \
- SecNum + \
- Ffs.SectionSuffix['GUIDED']
- OutputFile = os.path.normpath(OutputFile)
-
- ExternalTool = None
- ExternalOption = None
- if self.NameGuid != None:
- ExternalTool, ExternalOption = self.__FindExtendTool__()
-
- #
- # If not have GUID , call default
- # GENCRC32 section
- #
- if self.NameGuid == None :
- GenFdsGlobalVariable.VerboseLogger( "Use GenSection function Generate CRC32 Section")
- GenFdsGlobalVariable.GenerateSection(OutputFile, SectFile, Section.Section.SectionType[self.SectionType], InputAlign=SectAlign)
- OutputFileList = []
- OutputFileList.append(OutputFile)
- return OutputFileList, self.Alignment
- #or GUID not in External Tool List
- elif ExternalTool == None:
- EdkLogger.error("GenFds", GENFDS_ERROR, "No tool found with GUID %s" % self.NameGuid)
- else:
- DummyFile = OutputFile+".dummy"
- #
- # Call GenSection with DUMMY section type.
- #
- GenFdsGlobalVariable.GenerateSection(DummyFile, SectFile, InputAlign=SectAlign)
- #
- # Use external tool process the Output
- #
- TempFile = OutputPath + \
- os.sep + \
- ModuleName + \
- 'SEC' + \
- SecNum + \
- '.tmp'
- TempFile = os.path.normpath(TempFile)
-
- FirstCall = False
- CmdOption = '-e'
- if ExternalOption != None:
- CmdOption = CmdOption + ' ' + ExternalOption
- if self.ProcessRequired not in ("TRUE", "1") and self.IncludeFvSection and not FvAddrIsSet and self.FvParentAddr != None:
- #FirstCall is only set for the encapsulated flash FV image without process required attribute.
- FirstCall = True
- #
- # Call external tool
- #
- ReturnValue = [1]
- if FirstCall:
- #first try to call the guided tool with -z option and CmdOption for the no process required guided tool.
- GenFdsGlobalVariable.GuidTool(TempFile, [DummyFile], ExternalTool, '-z' + ' ' + CmdOption, ReturnValue)
-
- #
- # when no call or first call failed, ReturnValue are not 1.
- # Call the guided tool with CmdOption
- #
- if ReturnValue[0] != 0:
- FirstCall = False
- ReturnValue[0] = 0
- GenFdsGlobalVariable.GuidTool(TempFile, [DummyFile], ExternalTool, CmdOption)
-
- FileHandleIn = open(DummyFile,'rb')
- FileHandleIn.seek(0,2)
- InputFileSize = FileHandleIn.tell()
-
- FileHandleOut = open(TempFile,'rb')
- FileHandleOut.seek(0,2)
- TempFileSize = FileHandleOut.tell()
-
- Attribute = []
- HeaderLength = None
- if self.ExtraHeaderSize != -1:
- HeaderLength = str(self.ExtraHeaderSize)
-
- if self.ProcessRequired == "NONE" and HeaderLength == None:
- if TempFileSize > InputFileSize and TempFileSize % 4 == 0:
- FileHandleIn.seek(0)
- BufferIn = FileHandleIn.read()
- FileHandleOut.seek(0)
- BufferOut = FileHandleOut.read()
- if BufferIn == BufferOut[TempFileSize - InputFileSize:]:
- HeaderLength = str(TempFileSize - InputFileSize)
- #auto sec guided attribute with process required
- if HeaderLength == None:
- Attribute.append('PROCESSING_REQUIRED')
-
- FileHandleIn.close()
- FileHandleOut.close()
-
- if FirstCall and 'PROCESSING_REQUIRED' in Attribute:
- # Guided data by -z option on first call is the process required data. Call the guided tool with the real option.
- GenFdsGlobalVariable.GuidTool(TempFile, [DummyFile], ExternalTool, CmdOption)
-
- #
- # Call Gensection Add Section Header
- #
- if self.ProcessRequired in ("TRUE", "1"):
- if 'PROCESSING_REQUIRED' not in Attribute:
- Attribute.append('PROCESSING_REQUIRED')
-
- if self.AuthStatusValid in ("TRUE", "1"):
- Attribute.append('AUTH_STATUS_VALID')
- GenFdsGlobalVariable.GenerateSection(OutputFile, [TempFile], Section.Section.SectionType['GUIDED'],
- Guid=self.NameGuid, GuidAttr=Attribute, GuidHdrLen=HeaderLength)
- OutputFileList = []
- OutputFileList.append(OutputFile)
- if 'PROCESSING_REQUIRED' in Attribute:
- # reset guided section alignment to none for the processed required guided data
- self.Alignment = None
- self.IncludeFvSection = False
- self.ProcessRequired = "TRUE"
- return OutputFileList, self.Alignment
-
- ## __FindExtendTool()
- #
- # Find location of tools to process section data
- #
- # @param self The object pointer
- #
- def __FindExtendTool__(self):
- # if user not specify filter, try to deduce it from global data.
- if self.KeyStringList == None or self.KeyStringList == []:
- Target = GenFdsGlobalVariable.TargetName
- ToolChain = GenFdsGlobalVariable.ToolChainTag
- ToolDb = ToolDefClassObject.ToolDefDict(GenFdsGlobalVariable.WorkSpaceDir).ToolsDefTxtDatabase
- if ToolChain not in ToolDb['TOOL_CHAIN_TAG']:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Can not find external tool because tool tag %s is not defined in tools_def.txt!" % ToolChain)
- self.KeyStringList = [Target+'_'+ToolChain+'_'+self.CurrentArchList[0]]
- for Arch in self.CurrentArchList:
- if Target+'_'+ToolChain+'_'+Arch not in self.KeyStringList:
- self.KeyStringList.append(Target+'_'+ToolChain+'_'+Arch)
-
- ToolDefinition = ToolDefClassObject.ToolDefDict(GenFdsGlobalVariable.WorkSpaceDir).ToolsDefTxtDictionary
- ToolPathTmp = None
- for ToolDef in ToolDefinition.items():
- if self.NameGuid == ToolDef[1]:
- KeyList = ToolDef[0].split('_')
- Key = KeyList[0] + \
- '_' + \
- KeyList[1] + \
- '_' + \
- KeyList[2]
- if Key in self.KeyStringList and KeyList[4] == 'GUID':
-
- ToolPath = ToolDefinition.get( Key + \
- '_' + \
- KeyList[3] + \
- '_' + \
- 'PATH')
-
- ToolOption = ToolDefinition.get( Key + \
- '_' + \
- KeyList[3] + \
- '_' + \
- 'FLAGS')
- if ToolPathTmp == None:
- ToolPathTmp = ToolPath
- else:
- if ToolPathTmp != ToolPath:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Don't know which tool to use, %s or %s ?" % (ToolPathTmp, ToolPath))
-
-
- return ToolPathTmp, ToolOption
-
-
-
diff --git a/BaseTools/Source/Python/GenFds/OptRomFileStatement.py b/BaseTools/Source/Python/GenFds/OptRomFileStatement.py
deleted file mode 100644
index a98d208e1d..0000000000
--- a/BaseTools/Source/Python/GenFds/OptRomFileStatement.py
+++ /dev/null
@@ -1,50 +0,0 @@
-## @file
-# process OptionROM generation from FILE statement
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-##
-#
-#
-class OptRomFileStatement:
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- self.FileName = None
- self.FileType = None
- self.OverrideAttribs = None
-
- ## GenFfs() method
- #
- # Generate FFS
- #
- # @param self The object pointer
- # @param Dict dictionary contains macro and value pair
- # @retval string Generated FFS file name
- #
- def GenFfs(self, Dict = {}):
-
- if self.FileName != None:
- self.FileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FileName)
-
- return self.FileName
-
-
-
diff --git a/BaseTools/Source/Python/GenFds/OptRomInfStatement.py b/BaseTools/Source/Python/GenFds/OptRomInfStatement.py
deleted file mode 100644
index 069414df5b..0000000000
--- a/BaseTools/Source/Python/GenFds/OptRomInfStatement.py
+++ /dev/null
@@ -1,155 +0,0 @@
-## @file
-# process OptionROM generation from INF statement
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import RuleSimpleFile
-import RuleComplexFile
-import Section
-import OptionRom
-import Common.GlobalData as GlobalData
-
-from Common.DataType import *
-from Common.String import *
-from FfsInfStatement import FfsInfStatement
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-
-##
-#
-#
-class OptRomInfStatement (FfsInfStatement):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- FfsInfStatement.__init__(self)
- self.OverrideAttribs = None
-
- ## __GetOptRomParams() method
- #
- # Parse inf file to get option ROM related parameters
- #
- # @param self The object pointer
- #
- def __GetOptRomParams(self):
-
- if self.OverrideAttribs == None:
- self.OverrideAttribs = OptionRom.OverrideAttribs()
-
- if self.OverrideAttribs.NeedCompress == None:
- self.OverrideAttribs.NeedCompress = self.OptRomDefs.get ('PCI_COMPRESS')
- if self.OverrideAttribs.NeedCompress is not None:
- if self.OverrideAttribs.NeedCompress.upper() not in ('TRUE', 'FALSE'):
- GenFdsGlobalVariable.ErrorLogger( "Expected TRUE/FALSE for PCI_COMPRESS: %s" %self.InfFileName)
- self.OverrideAttribs.NeedCompress = \
- self.OverrideAttribs.NeedCompress.upper() == 'TRUE'
-
- if self.OverrideAttribs.PciVendorId == None:
- self.OverrideAttribs.PciVendorId = self.OptRomDefs.get ('PCI_VENDOR_ID')
-
- if self.OverrideAttribs.PciClassCode == None:
- self.OverrideAttribs.PciClassCode = self.OptRomDefs.get ('PCI_CLASS_CODE')
-
- if self.OverrideAttribs.PciDeviceId == None:
- self.OverrideAttribs.PciDeviceId = self.OptRomDefs.get ('PCI_DEVICE_ID')
-
- if self.OverrideAttribs.PciRevision == None:
- self.OverrideAttribs.PciRevision = self.OptRomDefs.get ('PCI_REVISION')
-
-# InfObj = GenFdsGlobalVariable.WorkSpace.BuildObject[self.PathClassObj, self.CurrentArch]
-# RecordList = InfObj._RawData[MODEL_META_DATA_HEADER, InfObj._Arch, InfObj._Platform]
-# for Record in RecordList:
-# Record = ReplaceMacros(Record, GlobalData.gEdkGlobal, False)
-# Name = Record[0]
- ## GenFfs() method
- #
- # Generate FFS
- #
- # @param self The object pointer
- # @retval string Generated .efi file name
- #
- def GenFfs(self):
- #
- # Parse Inf file get Module related information
- #
-
- self.__InfParse__()
- self.__GetOptRomParams()
- #
- # Get the rule of how to generate Ffs file
- #
- Rule = self.__GetRule__()
- GenFdsGlobalVariable.VerboseLogger( "Packing binaries from inf file : %s" %self.InfFileName)
- #FileType = Ffs.Ffs.ModuleTypeToFileType[Rule.ModuleType]
- #
- # For the rule only has simpleFile
- #
- if isinstance (Rule, RuleSimpleFile.RuleSimpleFile) :
- EfiOutputList = self.__GenSimpleFileSection__(Rule)
- return EfiOutputList
- #
- # For Rule has ComplexFile
- #
- elif isinstance(Rule, RuleComplexFile.RuleComplexFile):
- EfiOutputList = self.__GenComplexFileSection__(Rule)
- return EfiOutputList
-
- ## __GenSimpleFileSection__() method
- #
- # Get .efi files according to simple rule.
- #
- # @param self The object pointer
- # @param Rule The rule object used to generate section
- # @retval string File name of the generated section file
- #
- def __GenSimpleFileSection__(self, Rule):
- #
- # Prepare the parameter of GenSection
- #
-
- OutputFileList = []
- if Rule.FileName != None:
- GenSecInputFile = self.__ExtendMacro__(Rule.FileName)
- OutputFileList.append(GenSecInputFile)
- else:
- OutputFileList, IsSect = Section.Section.GetFileList(self, '', Rule.FileExtension)
-
- return OutputFileList
-
-
- ## __GenComplexFileSection__() method
- #
- # Get .efi by sections in complex Rule
- #
- # @param self The object pointer
- # @param Rule The rule object used to generate section
- # @retval string File name of the generated section file
- #
- def __GenComplexFileSection__(self, Rule):
-
- OutputFileList = []
- for Sect in Rule.SectionList:
- if Sect.SectionType == 'PE32':
- if Sect.FileName != None:
- GenSecInputFile = self.__ExtendMacro__(Sect.FileName)
- OutputFileList.append(GenSecInputFile)
- else:
- FileList, IsSect = Section.Section.GetFileList(self, '', Sect.FileExtension)
- OutputFileList.extend(FileList)
-
- return OutputFileList
-
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/GenFds/OptionRom.py b/BaseTools/Source/Python/GenFds/OptionRom.py
deleted file mode 100644
index ce46413bf6..0000000000
--- a/BaseTools/Source/Python/GenFds/OptionRom.py
+++ /dev/null
@@ -1,140 +0,0 @@
-## @file
-# process OptionROM generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import shutil
-import subprocess
-import StringIO
-
-import OptRomInfStatement
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from GenFds import GenFds
-from CommonDataClass.FdfClass import OptionRomClassObject
-from Common.Misc import SaveFileOnChange
-from Common import EdkLogger
-from Common.BuildToolError import *
-
-T_CHAR_LF = '\n'
-
-##
-#
-#
-class OPTIONROM (OptionRomClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- OptionRomClassObject.__init__(self)
-
-
- ## AddToBuffer()
- #
- # Generate Option ROM
- #
- # @param self The object pointer
- # @param Buffer The buffer generated OptROM data will be put
- # @retval string Generated OptROM file path
- #
- def AddToBuffer (self, Buffer) :
-
- GenFdsGlobalVariable.InfLogger( "\nGenerating %s Option ROM ..." %self.DriverName)
-
- EfiFileList = []
- BinFileList = []
-
- # Process Modules in FfsList
- for FfsFile in self.FfsList :
-
- if isinstance(FfsFile, OptRomInfStatement.OptRomInfStatement):
- FilePathNameList = FfsFile.GenFfs()
- if len(FilePathNameList) == 0:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s not produce .efi files, so NO file could be put into option ROM." % (FfsFile.InfFileName))
- if FfsFile.OverrideAttribs == None:
- EfiFileList.extend(FilePathNameList)
- else:
- FileName = os.path.basename(FilePathNameList[0])
- TmpOutputDir = os.path.join(GenFdsGlobalVariable.FvDir, self.DriverName)
- if not os.path.exists(TmpOutputDir) :
- os.makedirs(TmpOutputDir)
- TmpOutputFile = os.path.join(TmpOutputDir, FileName+'.tmp')
-
- GenFdsGlobalVariable.GenerateOptionRom(TmpOutputFile,
- FilePathNameList,
- [],
- FfsFile.OverrideAttribs.NeedCompress,
- FfsFile.OverrideAttribs.PciClassCode,
- FfsFile.OverrideAttribs.PciRevision,
- FfsFile.OverrideAttribs.PciDeviceId,
- FfsFile.OverrideAttribs.PciVendorId)
- BinFileList.append(TmpOutputFile)
- else:
- FilePathName = FfsFile.GenFfs()
- if FfsFile.OverrideAttribs != None:
- FileName = os.path.basename(FilePathName)
- TmpOutputDir = os.path.join(GenFdsGlobalVariable.FvDir, self.DriverName)
- if not os.path.exists(TmpOutputDir) :
- os.makedirs(TmpOutputDir)
- TmpOutputFile = os.path.join(TmpOutputDir, FileName+'.tmp')
-
- GenFdsGlobalVariable.GenerateOptionRom(TmpOutputFile,
- [FilePathName],
- [],
- FfsFile.OverrideAttribs.NeedCompress,
- FfsFile.OverrideAttribs.PciClassCode,
- FfsFile.OverrideAttribs.PciRevision,
- FfsFile.OverrideAttribs.PciDeviceId,
- FfsFile.OverrideAttribs.PciVendorId)
- BinFileList.append(TmpOutputFile)
- else:
- if FfsFile.FileType == 'EFI':
- EfiFileList.append(FilePathName)
- else:
- BinFileList.append(FilePathName)
-
- #
- # Call EfiRom tool
- #
- OutputFile = os.path.join(GenFdsGlobalVariable.FvDir, self.DriverName)
- OutputFile = OutputFile + '.rom'
-
- GenFdsGlobalVariable.GenerateOptionRom(
- OutputFile,
- EfiFileList,
- BinFileList
- )
-
- GenFdsGlobalVariable.InfLogger( "\nGenerate %s Option ROM Successfully" %self.DriverName)
- GenFdsGlobalVariable.SharpCounter = 0
-
- return OutputFile
-
-class OverrideAttribs:
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
-
- self.PciVendorId = None
- self.PciClassCode = None
- self.PciDeviceId = None
- self.PciRevision = None
- self.NeedCompress = None
-
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/GenFds/Region.py b/BaseTools/Source/Python/GenFds/Region.py
deleted file mode 100644
index 7879a9e29c..0000000000
--- a/BaseTools/Source/Python/GenFds/Region.py
+++ /dev/null
@@ -1,354 +0,0 @@
-## @file
-# process FD Region generation
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from struct import *
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-import StringIO
-from CommonDataClass.FdfClass import RegionClassObject
-import os
-from stat import *
-from Common import EdkLogger
-from Common.BuildToolError import *
-
-## generate Region
-#
-#
-class Region(RegionClassObject):
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- RegionClassObject.__init__(self)
-
-
- ## AddToBuffer()
- #
- # Add region data to the Buffer
- #
- # @param self The object pointer
- # @param Buffer The buffer generated region data will be put
- # @param BaseAddress base address of region
- # @param BlockSize block size of region
- # @param BlockNum How many blocks in region
- # @param ErasePolarity Flash erase polarity
- # @param VtfDict VTF objects
- # @param MacroDict macro value pair
- # @retval string Generated FV file path
- #
-
- def AddToBuffer(self, Buffer, BaseAddress, BlockSizeList, ErasePolarity, ImageBinDict, vtfDict = None, MacroDict = {}):
- Size = self.Size
- GenFdsGlobalVariable.InfLogger('\nGenerate Region at Offset 0x%X' % self.Offset)
- GenFdsGlobalVariable.InfLogger(" Region Size = 0x%X" %Size)
- GenFdsGlobalVariable.SharpCounter = 0
-
- if self.RegionType == 'FV':
- #
- # Get Fv from FvDict
- #
- self.FvAddress = int(BaseAddress, 16) + self.Offset
- FvBaseAddress = '0x%X' %self.FvAddress
- FvOffset = 0
- for RegionData in self.RegionDataList:
- FileName = None
- if RegionData.endswith(".fv"):
- RegionData = GenFdsGlobalVariable.MacroExtend(RegionData, MacroDict)
- GenFdsGlobalVariable.InfLogger(' Region FV File Name = .fv : %s'%RegionData)
- if RegionData[1] != ':' :
- RegionData = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, RegionData)
- if not os.path.exists(RegionData):
- EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=RegionData)
-
- FileName = RegionData
- elif RegionData.upper() + 'fv' in ImageBinDict.keys():
- GenFdsGlobalVariable.InfLogger(' Region Name = FV')
- FileName = ImageBinDict[RegionData.upper() + 'fv']
- else:
- #
- # Generate FvImage.
- #
- FvObj = None
- if RegionData.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():
- FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(RegionData.upper())
-
- if FvObj != None :
- GenFdsGlobalVariable.InfLogger(' Region Name = FV')
- #
- # Call GenFv tool
- #
- self.BlockInfoOfRegion(BlockSizeList, FvObj)
- self.FvAddress = self.FvAddress + FvOffset
- FvAlignValue = self.GetFvAlignValue(FvObj.FvAlignment)
- if self.FvAddress % FvAlignValue != 0:
- EdkLogger.error("GenFds", GENFDS_ERROR,
- "FV (%s) is NOT %s Aligned!" % (FvObj.UiFvName, FvObj.FvAlignment))
- FvBuffer = StringIO.StringIO('')
- FvBaseAddress = '0x%X' %self.FvAddress
- BlockSize = None
- BlockNum = None
- FvObj.AddToBuffer(FvBuffer, FvBaseAddress, BlockSize, BlockNum, ErasePolarity, vtfDict)
- if FvBuffer.len > Size:
- FvBuffer.close()
- EdkLogger.error("GenFds", GENFDS_ERROR,
- "Size of FV (%s) is larger than Region Size 0x%X specified." % (RegionData, Size))
- #
- # Put the generated image into FD buffer.
- #
- Buffer.write(FvBuffer.getvalue())
- FvBuffer.close()
- FvOffset = FvOffset + FvBuffer.len
- Size = Size - FvBuffer.len
- continue
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "FV (%s) is NOT described in FDF file!" % (RegionData))
- #
- # Add the exist Fv image into FD buffer
- #
- if FileName != None:
- FileLength = os.stat(FileName)[ST_SIZE]
- if FileLength > Size:
- EdkLogger.error("GenFds", GENFDS_ERROR,
- "Size of FV File (%s) is larger than Region Size 0x%X specified." \
- % (RegionData, Size))
- BinFile = open (FileName, 'r+b')
- Buffer.write(BinFile.read())
- BinFile.close()
- Size = Size - FileLength
- #
- # Pad the left buffer
- #
- if Size > 0:
- if (ErasePolarity == '1') :
- PadData = 0xFF
- else :
- PadData = 0
- for i in range(0, Size):
- Buffer.write(pack('B', PadData))
-
- if self.RegionType == 'CAPSULE':
- #
- # Get Capsule from Capsule Dict
- #
- for RegionData in self.RegionDataList:
- if RegionData.endswith(".cap"):
- RegionData = GenFdsGlobalVariable.MacroExtend(RegionData, MacroDict)
- GenFdsGlobalVariable.InfLogger(' Region CAPSULE Image Name = .cap : %s'%RegionData)
- if RegionData[1] != ':' :
- RegionData = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, RegionData)
- if not os.path.exists(RegionData):
- EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=RegionData)
-
- FileName = RegionData
- elif RegionData.upper() + 'cap' in ImageBinDict.keys():
- GenFdsGlobalVariable.InfLogger(' Region Name = CAPSULE')
- FileName = ImageBinDict[RegionData.upper() + 'cap']
- else:
- #
- # Generate Capsule image and Put it into FD buffer
- #
- CapsuleObj = None
- if RegionData.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():
- CapsuleObj = GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict[RegionData.upper()]
-
- if CapsuleObj != None :
- CapsuleObj.CapsuleName = RegionData.upper()
- GenFdsGlobalVariable.InfLogger(' Region Name = CAPSULE')
- #
- # Call GenFv tool to generate Capsule Image
- #
- FileName = CapsuleObj.GenCapsule()
- CapsuleObj.CapsuleName = None
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Capsule (%s) is NOT described in FDF file!" % (RegionData))
-
- #
- # Add the capsule image into FD buffer
- #
- FileLength = os.stat(FileName)[ST_SIZE]
- if FileLength > Size:
- EdkLogger.error("GenFds", GENFDS_ERROR,
- "Size 0x%X of Capsule File (%s) is larger than Region Size 0x%X specified." \
- % (FileLength, RegionData, Size))
- BinFile = open (FileName, 'r+b')
- Buffer.write(BinFile.read())
- BinFile.close()
- Size = Size - FileLength
- #
- # Pad the left buffer
- #
- if Size > 0:
- if (ErasePolarity == '1') :
- PadData = 0xFF
- else :
- PadData = 0
- for i in range(0, Size):
- Buffer.write(pack('B', PadData))
-
- if self.RegionType == 'FILE':
- for RegionData in self.RegionDataList:
- RegionData = GenFdsGlobalVariable.MacroExtend(RegionData, MacroDict)
- if RegionData[1] != ':' :
- RegionData = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, RegionData)
- if not os.path.exists(RegionData):
- EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=RegionData)
- #
- # Add the file image into FD buffer
- #
- FileLength = os.stat(RegionData)[ST_SIZE]
- if FileLength > Size:
- EdkLogger.error("GenFds", GENFDS_ERROR,
- "Size of File (%s) is larger than Region Size 0x%X specified." \
- % (RegionData, Size))
- GenFdsGlobalVariable.InfLogger(' Region File Name = %s'%RegionData)
- BinFile = open (RegionData, 'rb')
- Buffer.write(BinFile.read())
- BinFile.close()
- Size = Size - FileLength
- #
- # Pad the left buffer
- #
- if Size > 0:
- if (ErasePolarity == '1') :
- PadData = 0xFF
- else :
- PadData = 0
- for i in range(0, Size):
- Buffer.write(pack('B', PadData))
-
- if self.RegionType == 'DATA' :
- GenFdsGlobalVariable.InfLogger(' Region Name = DATA')
- DataSize = 0
- for RegionData in self.RegionDataList:
- Data = RegionData.split(',')
- DataSize = DataSize + len(Data)
- if DataSize > Size:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Size of DATA is larger than Region Size ")
- else:
- for item in Data :
- Buffer.write(pack('B', int(item, 16)))
- Size = Size - DataSize
- #
- # Pad the left buffer
- #
- if Size > 0:
- if (ErasePolarity == '1') :
- PadData = 0xFF
- else :
- PadData = 0
- for i in range(0, Size):
- Buffer.write(pack('B', PadData))
-
- if self.RegionType == None:
- GenFdsGlobalVariable.InfLogger(' Region Name = None')
- if (ErasePolarity == '1') :
- PadData = 0xFF
- else :
- PadData = 0
- for i in range(0, Size):
- Buffer.write(pack('B', PadData))
-
- def GetFvAlignValue(self, Str):
- AlignValue = 1
- Granu = 1
- Str = Str.strip().upper()
- if Str.endswith('K'):
- Granu = 1024
- Str = Str[:-1]
- elif Str.endswith('M'):
- Granu = 1024*1024
- Str = Str[:-1]
- elif Str.endswith('G'):
- Granu = 1024*1024*1024
- Str = Str[:-1]
- else:
- pass
-
- AlignValue = int(Str)*Granu
- return AlignValue
-
- ## BlockSizeOfRegion()
- #
- # @param BlockSizeList List of block information
- # @param FvObj The object for FV
- #
- def BlockInfoOfRegion(self, BlockSizeList, FvObj):
- Start = 0
- End = 0
- RemindingSize = self.Size
- ExpectedList = []
- for (BlockSize, BlockNum, pcd) in BlockSizeList:
- End = Start + BlockSize * BlockNum
- # region not started yet
- if self.Offset >= End:
- Start = End
- continue
- # region located in current blocks
- else:
- # region ended within current blocks
- if self.Offset + self.Size <= End:
- ExpectedList.append((BlockSize, (RemindingSize + BlockSize - 1)/BlockSize))
- break
- # region not ended yet
- else:
- # region not started in middle of current blocks
- if self.Offset <= Start:
- UsedBlockNum = BlockNum
- # region started in middle of current blocks
- else:
- UsedBlockNum = (End - self.Offset)/BlockSize
- Start = End
- ExpectedList.append((BlockSize, UsedBlockNum))
- RemindingSize -= BlockSize * UsedBlockNum
-
- if FvObj.BlockSizeList == []:
- FvObj.BlockSizeList = ExpectedList
- else:
- # first check whether FvObj.BlockSizeList items have only "BlockSize" or "NumBlocks",
- # if so, use ExpectedList
- for Item in FvObj.BlockSizeList:
- if Item[0] == None or Item[1] == None:
- FvObj.BlockSizeList = ExpectedList
- break
- # make sure region size is no smaller than the summed block size in FV
- Sum = 0
- for Item in FvObj.BlockSizeList:
- Sum += Item[0] * Item[1]
- if self.Size < Sum:
- EdkLogger.error("GenFds", GENFDS_ERROR, "Total Size of FV %s 0x%x is larger than Region Size 0x%x "
- %(FvObj.UiFvName, Sum, self.Size))
- # check whether the BlockStatements in FV section is appropriate
- ExpectedListData = ''
- for Item in ExpectedList:
- ExpectedListData += "BlockSize = 0x%x\n\tNumBlocks = 0x%x\n\t"%Item
- Index = 0
- for Item in FvObj.BlockSizeList:
- if Item[0] != ExpectedList[Index][0]:
- EdkLogger.error("GenFds", GENFDS_ERROR, "BlockStatements of FV %s are not align with FD's, suggested FV BlockStatement"
- %FvObj.UiFvName, ExtraData = ExpectedListData)
- elif Item[1] != ExpectedList[Index][1]:
- if (Item[1] < ExpectedList[Index][1]) and (Index == len(FvObj.BlockSizeList) - 1):
- break;
- else:
- EdkLogger.error("GenFds", GENFDS_ERROR, "BlockStatements of FV %s are not align with FD's, suggested FV BlockStatement"
- %FvObj.UiFvName, ExtraData = ExpectedListData)
- else:
- Index += 1
-
-
-
diff --git a/BaseTools/Source/Python/GenFds/Rule.py b/BaseTools/Source/Python/GenFds/Rule.py
deleted file mode 100644
index 0e112cf15e..0000000000
--- a/BaseTools/Source/Python/GenFds/Rule.py
+++ /dev/null
@@ -1,29 +0,0 @@
-## @file
-# Rule object for generating FFS
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from CommonDataClass.FdfClass import RuleClassObject
-
-## Rule base class
-#
-#
-class Rule(RuleClassObject):
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- RuleClassObject.__init__(self)
diff --git a/BaseTools/Source/Python/GenFds/RuleComplexFile.py b/BaseTools/Source/Python/GenFds/RuleComplexFile.py
deleted file mode 100644
index 36c483fbb2..0000000000
--- a/BaseTools/Source/Python/GenFds/RuleComplexFile.py
+++ /dev/null
@@ -1,30 +0,0 @@
-## @file
-# Complex Rule object for generating FFS
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Rule
-from CommonDataClass.FdfClass import RuleComplexFileClassObject
-
-## complex rule
-#
-#
-class RuleComplexFile(RuleComplexFileClassObject) :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- RuleComplexFileClassObject.__init__(self)
diff --git a/BaseTools/Source/Python/GenFds/RuleSimpleFile.py b/BaseTools/Source/Python/GenFds/RuleSimpleFile.py
deleted file mode 100644
index 061f984e6a..0000000000
--- a/BaseTools/Source/Python/GenFds/RuleSimpleFile.py
+++ /dev/null
@@ -1,30 +0,0 @@
-## @file
-# Simple Rule object for generating FFS
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Rule
-from CommonDataClass.FdfClass import RuleSimpleFileClassObject
-
-## simple rule
-#
-#
-class RuleSimpleFile (RuleSimpleFileClassObject) :
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- RuleSimpleFileClassObject.__init__(self)
diff --git a/BaseTools/Source/Python/GenFds/Section.py b/BaseTools/Source/Python/GenFds/Section.py
deleted file mode 100644
index 6f57ad5681..0000000000
--- a/BaseTools/Source/Python/GenFds/Section.py
+++ /dev/null
@@ -1,152 +0,0 @@
-## @file
-# section base class
-#
-# Copyright (c) 2007-2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from CommonDataClass.FdfClass import SectionClassObject
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-import os, glob
-from Common import EdkLogger
-from Common.BuildToolError import *
-
-## section base class
-#
-#
-class Section (SectionClassObject):
- SectionType = {
- 'RAW' : 'EFI_SECTION_RAW',
- 'FREEFORM' : 'EFI_SECTION_FREEFORM_SUBTYPE_GUID',
- 'PE32' : 'EFI_SECTION_PE32',
- 'PIC' : 'EFI_SECTION_PIC',
- 'TE' : 'EFI_SECTION_TE',
- 'FV_IMAGE' : 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE',
- 'DXE_DEPEX' : 'EFI_SECTION_DXE_DEPEX',
- 'PEI_DEPEX' : 'EFI_SECTION_PEI_DEPEX',
- 'GUIDED' : 'EFI_SECTION_GUID_DEFINED',
- 'COMPRESS' : 'EFI_SECTION_COMPRESSION',
- 'UI' : 'EFI_SECTION_USER_INTERFACE',
- 'SMM_DEPEX' : 'EFI_SECTION_SMM_DEPEX'
- }
-
- BinFileType = {
- 'GUID' : '.guid',
- 'ACPI' : '.acpi',
- 'ASL' : '.asl' ,
- 'UEFI_APP' : '.app',
- 'LIB' : '.lib',
- 'PE32' : '.pe32',
- 'PIC' : '.pic',
- 'PEI_DEPEX' : '.depex',
- 'SEC_PEI_DEPEX' : '.depex',
- 'TE' : '.te',
- 'UNI_VER' : '.ver',
- 'VER' : '.ver',
- 'UNI_UI' : '.ui',
- 'UI' : '.ui',
- 'BIN' : '.bin',
- 'RAW' : '.raw',
- 'COMPAT16' : '.comp16',
- 'FV' : '.fv'
- }
-
- SectFileType = {
- 'SEC_GUID' : '.sec' ,
- 'SEC_PE32' : '.sec' ,
- 'SEC_PIC' : '.sec',
- 'SEC_TE' : '.sec',
- 'SEC_VER' : '.sec',
- 'SEC_UI' : '.sec',
- 'SEC_COMPAT16' : '.sec',
- 'SEC_BIN' : '.sec'
- }
-
- ToolGuid = {
- '0xa31280ad-0x481e-0x41b6-0x95e8-0x127f-0x4c984779' : 'TianoCompress',
- '0xee4e5898-0x3914-0x4259-0x9d6e-0xdc7b-0xd79403cf' : 'LzmaCompress'
- }
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- SectionClassObject.__init__(self)
-
- ## GenSection() method
- #
- # virtual function
- #
- # @param self The object pointer
- # @param OutputPath Where to place output file
- # @param ModuleName Which module this section belongs to
- # @param SecNum Index of section
- # @param KeyStringList Filter for inputs of section generation
- # @param FfsInf FfsInfStatement object that contains this section data
- # @param Dict dictionary contains macro and its value
- #
- def GenSection(self, OutputPath, GuidName, SecNum, keyStringList, FfsInf = None, Dict = {}):
- pass
-
- ## GetFileList() method
- #
- # Generate compressed section
- #
- # @param self The object pointer
- # @param FfsInf FfsInfStatement object that contains file list
- # @param FileType File type to get
- # @param FileExtension File extension to get
- # @param Dict dictionary contains macro and its value
- # @retval tuple (File list, boolean)
- #
- def GetFileList(FfsInf, FileType, FileExtension, Dict = {}):
- if FileType in Section.SectFileType.keys() :
- IsSect = True
- else :
- IsSect = False
-
- if FileExtension != None:
- Suffix = FileExtension
- elif IsSect :
- Suffix = Section.SectionType.get(FileType)
- else:
- Suffix = Section.BinFileType.get(FileType)
- if FfsInf == None:
- EdkLogger.error("GenFds", GENFDS_ERROR, 'Inf File does not exist!')
-
- FileList = []
- if FileType != None:
- for File in FfsInf.BinFileList:
- if File.Arch == "COMMON" or FfsInf.CurrentArch == File.Arch:
- if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A and FileType == 'DXE_DPEX'and File.Type == 'SMM_DEPEX'):
- if '*' in FfsInf.TargetOverrideList or File.Target == '*' or File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList == []:
- FileList.append(File.Path)
- else:
- GenFdsGlobalVariable.InfLogger ("\nBuild Target \'%s\' of File %s is not in the Scope of %s specified by INF %s in FDF" %(File.Target, File.File, FfsInf.TargetOverrideList, FfsInf.InfFileName))
- else:
- GenFdsGlobalVariable.VerboseLogger ("\nFile Type \'%s\' of File %s in %s is not same with file type \'%s\' from Rule in FDF" %(File.Type, File.File, FfsInf.InfFileName, FileType))
- else:
- GenFdsGlobalVariable.InfLogger ("\nCurrent ARCH \'%s\' of File %s is not in the Support Arch Scope of %s specified by INF %s in FDF" %(FfsInf.CurrentArch, File.File, File.Arch, FfsInf.InfFileName))
-
- if Suffix != None:
- SuffixMap = FfsInf.GetFinalTargetSuffixMap()
- if Suffix in SuffixMap:
- FileList.extend(SuffixMap[Suffix])
-
- #Process the file lists is alphabetical for a same section type
- if len (FileList) > 1:
- FileList.sort()
-
- return FileList, IsSect
- GetFileList = staticmethod(GetFileList)
diff --git a/BaseTools/Source/Python/GenFds/UiSection.py b/BaseTools/Source/Python/GenFds/UiSection.py
deleted file mode 100644
index e1b69ed133..0000000000
--- a/BaseTools/Source/Python/GenFds/UiSection.py
+++ /dev/null
@@ -1,77 +0,0 @@
-## @file
-# process UI section generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Section
-from Ffs import Ffs
-import subprocess
-import os
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from CommonDataClass.FdfClass import UiSectionClassObject
-
-## generate UI section
-#
-#
-class UiSection (UiSectionClassObject):
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- UiSectionClassObject.__init__(self)
-
- ## GenSection() method
- #
- # Generate UI section
- #
- # @param self The object pointer
- # @param OutputPath Where to place output file
- # @param ModuleName Which module this section belongs to
- # @param SecNum Index of section
- # @param KeyStringList Filter for inputs of section generation
- # @param FfsInf FfsInfStatement object that contains this section data
- # @param Dict dictionary contains macro and its value
- # @retval tuple (Generated file name, section alignment)
- #
- def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
- #
- # Prepare the parameter of GenSection
- #
- if FfsInf != None:
- self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)
- self.StringData = FfsInf.__ExtendMacro__(self.StringData)
- self.FileName = FfsInf.__ExtendMacro__(self.FileName)
-
- OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get('UI'))
-
- if self.StringData != None :
- NameString = self.StringData
- elif self.FileName != None:
- FileNameStr = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FileName)
- FileNameStr = GenFdsGlobalVariable.MacroExtend(FileNameStr, Dict)
- FileObj = open(FileNameStr, 'r')
- NameString = FileObj.read()
- NameString = '\"' + NameString + "\""
- FileObj.close()
- else:
- NameString = ''
-
- GenFdsGlobalVariable.GenerateSection(OutputFile, None, 'EFI_SECTION_USER_INTERFACE', Ui=NameString)
-
- OutputFileList = []
- OutputFileList.append(OutputFile)
- return OutputFileList, self.Alignment
diff --git a/BaseTools/Source/Python/GenFds/VerSection.py b/BaseTools/Source/Python/GenFds/VerSection.py
deleted file mode 100644
index 8f6da9624f..0000000000
--- a/BaseTools/Source/Python/GenFds/VerSection.py
+++ /dev/null
@@ -1,82 +0,0 @@
-## @file
-# process Version section generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from Ffs import Ffs
-import Section
-import os
-import subprocess
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-from CommonDataClass.FdfClass import VerSectionClassObject
-
-## generate version section
-#
-#
-class VerSection (VerSectionClassObject):
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- VerSectionClassObject.__init__(self)
-
- ## GenSection() method
- #
- # Generate version section
- #
- # @param self The object pointer
- # @param OutputPath Where to place output file
- # @param ModuleName Which module this section belongs to
- # @param SecNum Index of section
- # @param KeyStringList Filter for inputs of section generation
- # @param FfsInf FfsInfStatement object that contains this section data
- # @param Dict dictionary contains macro and its value
- # @retval tuple (Generated file name, section alignment)
- #
- def GenSection(self,OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
- #
- # Prepare the parameter of GenSection
- #
- if FfsInf != None:
- self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)
- self.BuildNum = FfsInf.__ExtendMacro__(self.BuildNum)
- self.StringData = FfsInf.__ExtendMacro__(self.StringData)
- self.FileName = FfsInf.__ExtendMacro__(self.FileName)
-
- OutputFile = os.path.join(OutputPath,
- ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get('VERSION'))
- OutputFile = os.path.normpath(OutputFile)
-
- # Get String Data
- StringData = ''
- if self.StringData != None:
- StringData = self.StringData
- elif self.FileName != None:
- FileNameStr = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FileName)
- FileNameStr = GenFdsGlobalVariable.MacroExtend(FileNameStr, Dict)
- FileObj = open(FileNameStr, 'r')
- StringData = FileObj.read()
- StringData = '"' + StringData + '"'
- FileObj.close()
- else:
- StringData = ''
-
- GenFdsGlobalVariable.GenerateSection(OutputFile, None, 'EFI_SECTION_VERSION',
- Ver=StringData, BuildNumber=self.BuildNum)
- OutputFileList = []
- OutputFileList.append(OutputFile)
- return OutputFileList, self.Alignment
diff --git a/BaseTools/Source/Python/GenFds/Vtf.py b/BaseTools/Source/Python/GenFds/Vtf.py
deleted file mode 100644
index e7e36491db..0000000000
--- a/BaseTools/Source/Python/GenFds/Vtf.py
+++ /dev/null
@@ -1,196 +0,0 @@
-## @file
-# process VTF generation
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-from GenFdsGlobalVariable import GenFdsGlobalVariable
-import os
-from CommonDataClass.FdfClass import VtfClassObject
-T_CHAR_LF = '\n'
-
-## generate VTF
-#
-#
-class Vtf (VtfClassObject):
-
- ## The constructor
- #
- # @param self The object pointer
- #
- def __init__(self):
- VtfClassObject.__init__(self)
-
- ## GenVtf() method
- #
- # Generate VTF
- #
- # @param self The object pointer
- # @param FdAddressDict dictionary contains FV name and its base address
- # @retval Dict FV and corresponding VTF file name
- #
- def GenVtf(self, FdAddressDict) :
- self.GenBsfInf()
- OutputFile = os.path.join(GenFdsGlobalVariable.FvDir, self.UiName + '.Vtf')
- BaseAddArg = self.GetBaseAddressArg(FdAddressDict)
- OutputArg, VtfRawDict = self.GenOutputArg()
-
- Cmd = (
- 'GenVtf',
- ) + OutputArg + (
- '-f', self.BsfInfName,
- ) + BaseAddArg
-
- GenFdsGlobalVariable.CallExternalTool(Cmd, "GenFv -Vtf Failed!")
- GenFdsGlobalVariable.SharpCounter = 0
-
- return VtfRawDict
-
- ## GenBsfInf() method
- #
- # Generate inf used to generate VTF
- #
- # @param self The object pointer
- #
- def GenBsfInf (self):
- FvList = self.GetFvList()
- self.BsfInfName = os.path.join(GenFdsGlobalVariable.FvDir, self.UiName + '.inf')
- BsfInf = open (self.BsfInfName, 'w+')
- if self.ResetBin != None:
- BsfInf.writelines ("[OPTIONS]" + T_CHAR_LF)
- BsfInf.writelines ("IA32_RST_BIN" + \
- " = " + \
- GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.ResetBin)) + \
- T_CHAR_LF )
- BsfInf.writelines (T_CHAR_LF )
-
- BsfInf.writelines ("[COMPONENTS]" + T_CHAR_LF)
-
- for ComponentObj in self.ComponentStatementList :
- BsfInf.writelines ("COMP_NAME" + \
- " = " + \
- ComponentObj.CompName + \
- T_CHAR_LF )
- if ComponentObj.CompLoc.upper() == 'NONE':
- BsfInf.writelines ("COMP_LOC" + \
- " = " + \
- 'N' + \
- T_CHAR_LF )
-
- elif ComponentObj.FilePos != None:
- BsfInf.writelines ("COMP_LOC" + \
- " = " + \
- ComponentObj.FilePos + \
- T_CHAR_LF )
- else:
- Index = FvList.index(ComponentObj.CompLoc.upper())
- if Index == 0:
- BsfInf.writelines ("COMP_LOC" + \
- " = " + \
- 'F' + \
- T_CHAR_LF )
- elif Index == 1:
- BsfInf.writelines ("COMP_LOC" + \
- " = " + \
- 'S' + \
- T_CHAR_LF )
-
- BsfInf.writelines ("COMP_TYPE" + \
- " = " + \
- ComponentObj.CompType + \
- T_CHAR_LF )
- BsfInf.writelines ("COMP_VER" + \
- " = " + \
- ComponentObj.CompVer + \
- T_CHAR_LF )
- BsfInf.writelines ("COMP_CS" + \
- " = " + \
- ComponentObj.CompCs + \
- T_CHAR_LF )
-
- BinPath = ComponentObj.CompBin
- if BinPath != '-':
- BinPath = GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMacro(BinPath))
- BsfInf.writelines ("COMP_BIN" + \
- " = " + \
- BinPath + \
- T_CHAR_LF )
-
- SymPath = ComponentObj.CompSym
- if SymPath != '-':
- SymPath = GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMacro(SymPath))
- BsfInf.writelines ("COMP_SYM" + \
- " = " + \
- SymPath + \
- T_CHAR_LF )
- BsfInf.writelines ("COMP_SIZE" + \
- " = " + \
- ComponentObj.CompSize + \
- T_CHAR_LF )
- BsfInf.writelines (T_CHAR_LF )
-
- BsfInf.close()
-
- ## GenFvList() method
- #
- # Get FV list referenced by VTF components
- #
- # @param self The object pointer
- #
- def GetFvList(self):
- FvList = []
- for component in self.ComponentStatementList :
- if component.CompLoc.upper() != 'NONE' and not (component.CompLoc.upper() in FvList):
- FvList.append(component.CompLoc.upper())
-
- return FvList
-
- ## GetBaseAddressArg() method
- #
- # Get base address arguments for GenVtf
- #
- # @param self The object pointer
- #
- def GetBaseAddressArg(self, FdAddressDict):
- FvList = self.GetFvList()
- CmdStr = tuple()
- for i in FvList:
- (BaseAddress, Size) = FdAddressDict.get(i)
- CmdStr += (
- '-r', '0x%x' % BaseAddress,
- '-s', '0x%x' %Size,
- )
- return CmdStr
-
- ## GenOutputArg() method
- #
- # Get output arguments for GenVtf
- #
- # @param self The object pointer
- #
- def GenOutputArg(self):
- FvVtfDict = {}
- OutputFileName = ''
- FvList = self.GetFvList()
- Index = 0
- Arg = tuple()
- for FvObj in FvList:
- Index = Index + 1
- OutputFileName = 'Vtf%d.raw' % Index
- OutputFileName = os.path.join(GenFdsGlobalVariable.FvDir, OutputFileName)
- Arg += ('-o', OutputFileName)
- FvVtfDict[FvObj.upper()] = OutputFileName
-
- return Arg, FvVtfDict
-
diff --git a/BaseTools/Source/Python/GenFds/__init__.py b/BaseTools/Source/Python/GenFds/__init__.py
deleted file mode 100644
index 6ba4ed4431..0000000000
--- a/BaseTools/Source/Python/GenFds/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'GenFds' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
deleted file mode 100644
index ca4440f9a2..0000000000
--- a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
+++ /dev/null
@@ -1,190 +0,0 @@
-## @file
-# Generate PCD table for 'Patchable In Module' type PCD with given .map file.
-# The Patch PCD table like:
-#
-# PCD Name Offset in binary
-# ======== ================
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-
-#====================================== External Libraries ========================================
-import optparse
-import os
-import re
-import array
-
-from Common.BuildToolError import *
-import Common.EdkLogger as EdkLogger
-from Common.Misc import PeImageClass
-from Common.BuildVersion import gBUILD_VERSION
-
-# Version and Copyright
-__version_number__ = ("0.10" + " " + gBUILD_VERSION)
-__version__ = "%prog Version " + __version_number__
-__copyright__ = "Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved."
-
-#====================================== Internal Libraries ========================================
-
-#============================================== Code ===============================================
-secRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\da-fA-F]+)[Hh]? +([.\w\$]+) +(\w+)', re.UNICODE)
-symRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.:\\\\\w\?@\$]+) +([\da-fA-F]+)', re.UNICODE)
-
-def parsePcdInfoFromMapFile(mapfilepath, efifilepath):
- """ Parse map file to get binary patch pcd information
- @param path Map file absolution path
-
- @return a list which element hold (PcdName, Offset, SectionName)
- """
- lines = []
- try:
- f = open(mapfilepath, 'r')
- lines = f.readlines()
- f.close()
- except:
- return None
-
- if len(lines) == 0: return None
- if lines[0].strip().find("Archive member included because of file (symbol)") != -1:
- return _parseForGCC(lines)
- return _parseGeneral(lines, efifilepath)
-
-def _parseForGCC(lines):
- """ Parse map file generated by GCC linker """
- status = 0
- imageBase = -1
- lastSectionName = None
- pcds = []
- for line in lines:
- line = line.strip()
- # status machine transection
- if status == 0 and line == "Linker script and memory map":
- status = 1
- continue
- elif status == 1 and line == 'START GROUP':
- status = 2
- continue
-
- # status handler:
- if status == 1:
- m = re.match('^[\da-fA-FxhH]+ +__image_base__ += +([\da-fA-FhxH]+)', line)
- if m != None:
- imageBase = int(m.groups(0)[0], 16)
- if status == 2:
- m = re.match('^([\w_\.]+) +([\da-fA-Fx]+) +([\da-fA-Fx]+)', line)
- if m != None:
- lastSectionName = m.groups(0)[0]
- if status == 2:
- m = re.match("^([\da-fA-Fx]+) +[_]+gPcd_BinaryPatch_([\w_\d]+)", line)
- if m != None:
- assert imageBase != -1, "Fail to get Binary PCD offsest for unknown image base address"
- pcds.append((m.groups(0)[1], int(m.groups(0)[0], 16) - imageBase, lastSectionName))
- return pcds
-
-def _parseGeneral(lines, efifilepath):
- """ For MSFT, ICC, EBC
- @param lines line array for map file
-
- @return a list which element hold (PcdName, Offset, SectionName)
- """
- status = 0 #0 - beginning of file; 1 - PE section definition; 2 - symbol table
- secs = [] # key = section name
- bPcds = []
-
-
- for line in lines:
- line = line.strip()
- if re.match("^Start[' ']+Length[' ']+Name[' ']+Class", line):
- status = 1
- continue
- if re.match("^Address[' ']+Publics by Value[' ']+Rva\+Base", line):
- status = 2
- continue
- if re.match("^entry point at", line):
- status = 3
- continue
- if status == 1 and len(line) != 0:
- m = secRe.match(line)
- assert m != None, "Fail to parse the section in map file , line is %s" % line
- sec_no, sec_start, sec_length, sec_name, sec_class = m.groups(0)
- secs.append([int(sec_no, 16), int(sec_start, 16), int(sec_length, 16), sec_name, sec_class])
- if status == 2 and len(line) != 0:
- m = symRe.match(line)
- assert m != None, "Fail to parse the symbol in map file, line is %s" % line
- sec_no, sym_offset, sym_name, vir_addr = m.groups(0)
- sec_no = int(sec_no, 16)
- sym_offset = int(sym_offset, 16)
- vir_addr = int(vir_addr, 16)
- m2 = re.match('^[_]+gPcd_BinaryPatch_([\w]+)', sym_name)
- if m2 != None:
- # fond a binary pcd entry in map file
- for sec in secs:
- if sec[0] == sec_no and (sym_offset >= sec[1] and sym_offset < sec[1] + sec[2]):
- bPcds.append([m2.groups(0)[0], sec[3], sym_offset, vir_addr, sec_no])
-
- if len(bPcds) == 0: return None
-
- # get section information from efi file
- efisecs = PeImageClass(efifilepath).SectionHeaderList
- if efisecs == None or len(efisecs) == 0:
- return None
-
- pcds = []
- for pcd in bPcds:
- index = 0
- for efisec in efisecs:
- index = index + 1
- if pcd[1].strip() == efisec[0].strip():
- pcds.append([pcd[0], efisec[2] + pcd[2], efisec[0]])
- elif pcd[4] == index:
- pcds.append([pcd[0], efisec[2] + pcd[2], efisec[0]])
- return pcds
-
-def generatePcdTable(list, pcdpath):
- try:
- f = open(pcdpath, 'w')
- except:
- pass
-
- f.write('PCD Name Offset Section Name\r\n')
-
- for pcditem in list:
- f.write('%-30s 0x%-08X %-6s\r\n' % (pcditem[0], pcditem[1], pcditem[2]))
- f.close()
-
- #print 'Success to generate Binary Patch PCD table at %s!' % pcdpath
-
-if __name__ == '__main__':
- UsageString = "%prog -m <MapFile> -e <EfiFile> -o <OutFile>"
- AdditionalNotes = "\nPCD table is generated in file name with .BinaryPcdTable.txt postfix"
- parser = optparse.OptionParser(description=__copyright__, version=__version__, usage=UsageString)
- parser.add_option('-m', '--mapfile', action='store', dest='mapfile',
- help='Absolute path of module map file.')
- parser.add_option('-e', '--efifile', action='store', dest='efifile',
- help='Absolute path of EFI binary file.')
- parser.add_option('-o', '--outputfile', action='store', dest='outfile',
- help='Absolute path of output file to store the got patchable PCD table.')
-
- (options, args) = parser.parse_args()
-
- if options.mapfile == None or options.efifile == None:
- print parser.get_usage()
- elif os.path.exists(options.mapfile) and os.path.exists(options.efifile):
- list = parsePcdInfoFromMapFile(options.mapfile, options.efifile)
- if list != None:
- if options.outfile != None:
- generatePcdTable(list, options.outfile)
- else:
- generatePcdTable(list, options.mapfile.replace('.map', '.BinaryPcdTable.txt'))
- else:
- print 'Fail to generate Patch PCD Table based on map file and efi file'
- else:
- print 'Fail to generate Patch PCD Table for fail to find map file or efi file!'
diff --git a/BaseTools/Source/Python/GenPatchPcdTable/__init__.py b/BaseTools/Source/Python/GenPatchPcdTable/__init__.py
deleted file mode 100644
index 58a5b1d630..0000000000
--- a/BaseTools/Source/Python/GenPatchPcdTable/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'GenPatchPcdTable' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/Makefile b/BaseTools/Source/Python/Makefile
deleted file mode 100644
index a3a537c352..0000000000
--- a/BaseTools/Source/Python/Makefile
+++ /dev/null
@@ -1,108 +0,0 @@
-## @file
-# Windows makefile for Python tools build.
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-!IFNDEF PYTHON_FREEZER_PATH
-!ERROR PYTHON_FREEZER_PATH must be defined!
-!ENDIF
-
-!IF EXIST ($(PYTHON_FREEZER_PATH)\cxfreeze)
-# Using cx_Freeze 4.2.3 with Python 2.7.2
-FREEZE=$(PYTHON_FREEZER_PATH)\cxfreeze
-!ELSE
-# Using cx_Freeze 3.0.3 with Python 2.5.4
-FREEZE=$(PYTHON_FREEZER_PATH)\FreezePython.exe
-!ENDIF
-
-MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,encodings.utf_16_le,encodings.latin_1,encodings.ascii
-
-BIN_DIR=$(EDK_TOOLS_PATH)\Bin\Win32
-
-APPLICATIONS=$(BIN_DIR)\build.exe $(BIN_DIR)\GenFds.exe $(BIN_DIR)\Trim.exe $(BIN_DIR)\TargetTool.exe $(BIN_DIR)\GenDepex.exe $(BIN_DIR)\GenPatchPcdTable.exe $(BIN_DIR)\PatchPcdValue.exe $(BIN_DIR)\BPDG.exe $(BIN_DIR)\UPT.exe
-
-COMMON_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\Common\BuildToolError.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\Database.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\DataType.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\DecClassObject.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\Dictionary.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\DscClassObject.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\EdkIIWorkspace.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\EdkIIWorkspaceBuild.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\EdkLogger.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\FdfClassObject.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\FdfParserLite.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\GlobalData.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\Identification.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\InfClassObject.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\MigrationUtilities.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\Misc.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\Parsing.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\String.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\TargetTxtClassObject.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\ToolDefClassObject.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\VpdInfoFile.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\__init__.py \
- $(BASE_TOOLS_PATH)\Source\Python\Common\BuildVersion.py \
- $(BASE_TOOLS_PATH)\Source\Python\Workspace\BuildClassObject.py \
- $(BASE_TOOLS_PATH)\Source\Python\Workspace\MetaDataTable.py \
- $(BASE_TOOLS_PATH)\Source\Python\Workspace\MetaFileParser.py \
- $(BASE_TOOLS_PATH)\Source\Python\Workspace\MetaFileTable.py \
- $(BASE_TOOLS_PATH)\Source\Python\Workspace\WorkspaceDatabase.py \
- $(BASE_TOOLS_PATH)\Source\Python\Workspace\__init__.py \
- $(BASE_TOOLS_PATH)\Source\Python\Autogen\AutoGen.py \
- $(BASE_TOOLS_PATH)\Source\Python\Autogen\BuildEngine.py \
- $(BASE_TOOLS_PATH)\Source\Python\Autogen\GenC.py \
- $(BASE_TOOLS_PATH)\Source\Python\Autogen\GenDepex.py \
- $(BASE_TOOLS_PATH)\Source\Python\Autogen\GenMake.py \
- $(BASE_TOOLS_PATH)\Source\Python\Autogen\StrGather.py \
- $(BASE_TOOLS_PATH)\Source\Python\Autogen\UniClassObject.py \
- $(BASE_TOOLS_PATH)\Source\Python\Autogen\__init__.py
-
-UPT_BUILDVERSION_PYTHON=$(BASE_TOOLS_PATH)\Source\Python\UPT\BuildVersion.py
-
-all: SetPythonPath $(APPLICATIONS)
-
-SetPythonPath:
- set PYTHONPATH=$(BASE_TOOLS_PATH)\Source\Python
-
-$(BIN_DIR)\build.exe: $(BASE_TOOLS_PATH)\Source\Python\build\build.py $(COMMON_PYTHON)
- @pushd . & @cd build & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) build.py & @popd
-
-$(BIN_DIR)\GenFds.exe: $(BASE_TOOLS_PATH)\Source\Python\GenFds\GenFds.py $(COMMON_PYTHON)
- @pushd . & @cd GenFds & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) GenFds.py & @popd
-
-$(BIN_DIR)\Trim.exe: $(BASE_TOOLS_PATH)\Source\Python\Trim\Trim.py $(COMMON_PYTHON)
- @pushd . & @cd Trim & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) Trim.py & @popd
-
-$(BIN_DIR)\GenDepex.exe: $(BASE_TOOLS_PATH)\Source\Python\AutoGen\GenDepex.py $(COMMON_PYTHON)
- @pushd . & @cd AutoGen & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) GenDepex.py & @popd
-
-$(BIN_DIR)\TargetTool.exe: $(BASE_TOOLS_PATH)\Source\Python\TargetTool\TargetTool.py $(COMMON_PYTHON)
- @pushd . & @cd TargetTool & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) TargetTool.py & @popd
-
-$(BIN_DIR)\GenPatchPcdTable.exe: $(BASE_TOOLS_PATH)\Source\Python\GenPatchPcdTable\GenPatchPcdTable.py $(COMMON_PYTHON)
- @pushd . & @cd GenPatchPcdTable & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) GenPatchPcdTable.py & @popd
-
-$(BIN_DIR)\PatchPcdValue.exe: $(BASE_TOOLS_PATH)\Source\Python\PatchPcdValue\PatchPcdValue.py $(COMMON_PYTHON)
- @pushd . & @cd PatchPcdValue & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) PatchPcdValue.py & @popd
-
-$(BIN_DIR)\BPDG.exe: $(BASE_TOOLS_PATH)\Source\Python\BPDG\BPDG.py $(COMMON_PYTHON)
- @pushd . & @cd BPDG & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) BPDG.py & @popd
-
-$(BIN_DIR)\UPT.exe: $(BASE_TOOLS_PATH)\Source\Python\UPT\UPT.py $(UPT_BUILDVERSION_PYTHON)
- @pushd . & @cd UPT & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) UPT.py & @popd
-
-clean:
-cleanall:
- @del /f /q $(BIN_DIR)\*.pyd $(BIN_DIR)\*.dll
- @for %%i in ($(APPLICATIONS)) do @del /f /q %%i
-
diff --git a/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py b/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py
deleted file mode 100644
index 3f6c575128..0000000000
--- a/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py
+++ /dev/null
@@ -1,288 +0,0 @@
-## @file
-# Patch value into the binary file.
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import sys
-import re
-
-from optparse import OptionParser
-from optparse import make_option
-from Common.BuildToolError import *
-import Common.EdkLogger as EdkLogger
-from Common.BuildVersion import gBUILD_VERSION
-import array
-
-# Version and Copyright
-__version_number__ = ("0.10" + " " + gBUILD_VERSION)
-__version__ = "%prog Version " + __version_number__
-__copyright__ = "Copyright (c) 2010, Intel Corporation. All rights reserved."
-
-## PatchBinaryFile method
-#
-# This method mainly patches the data into binary file.
-#
-# @param FileName File path of the binary file
-# @param ValueOffset Offset value
-# @param TypeName DataType Name
-# @param Value Value String
-# @param MaxSize MaxSize value
-#
-# @retval 0 File is updated successfully.
-# @retval not 0 File is updated failed.
-#
-def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
- #
- # Length of Binary File
- #
- FileHandle = open (FileName, 'rb')
- FileHandle.seek (0, 2)
- FileLength = FileHandle.tell()
- FileHandle.close()
- #
- # Unify string to upper string
- #
- TypeName = TypeName.upper()
- #
- # Get PCD value data length
- #
- ValueLength = 0
- if TypeName == 'BOOLEAN':
- ValueLength = 1
- elif TypeName == 'UINT8':
- ValueLength = 1
- elif TypeName == 'UINT16':
- ValueLength = 2
- elif TypeName == 'UINT32':
- ValueLength = 4
- elif TypeName == 'UINT64':
- ValueLength = 8
- elif TypeName == 'VOID*':
- if MaxSize == 0:
- return OPTION_MISSING, "PcdMaxSize is not specified for VOID* type PCD."
- ValueLength = MaxSize
- else:
- return PARAMETER_INVALID, "PCD type %s is not valid." %(CommandOptions.PcdTypeName)
- #
- # Check PcdValue is in the input binary file.
- #
- if ValueOffset + ValueLength > FileLength:
- return PARAMETER_INVALID, "PcdOffset + PcdMaxSize(DataType) is larger than the input file size."
- #
- # Read binary file into array
- #
- FileHandle = open (FileName, 'rb')
- ByteArray = array.array('B')
- ByteArray.fromfile(FileHandle, FileLength)
- FileHandle.close()
- OrigByteList = ByteArray.tolist()
- ByteList = ByteArray.tolist()
- #
- # Clear the data in file
- #
- for Index in range(ValueLength):
- ByteList[ValueOffset + Index] = 0
- #
- # Patch value into offset
- #
- ValueString = ValueString.upper()
- ValueNumber = 0
- if TypeName == 'BOOLEAN':
- #
- # Get PCD value for BOOLEAN data type
- #
- try:
- if ValueString == 'TRUE':
- ValueNumber = 1
- elif ValueString == 'FALSE':
- ValueNumber = 0
- elif ValueString.startswith('0X'):
- ValueNumber = int (Value, 16)
- else:
- ValueNumber = int (Value)
- if ValueNumber != 0:
- ValueNumber = 1
- except:
- return PARAMETER_INVALID, "PCD Value %s is not valid dec or hex string." %(ValueString)
- #
- # Set PCD value into binary data
- #
- ByteList[ValueOffset] = ValueNumber
- elif TypeName in ['UINT8', 'UINT16', 'UINT32', 'UINT64']:
- #
- # Get PCD value for UINT* data type
- #
- try:
- if ValueString.startswith('0X'):
- ValueNumber = int (ValueString, 16)
- else:
- ValueNumber = int (ValueString)
- except:
- return PARAMETER_INVALID, "PCD Value %s is not valid dec or hex string." %(ValueString)
- #
- # Set PCD value into binary data
- #
- for Index in range(ValueLength):
- ByteList[ValueOffset + Index] = ValueNumber % 0x100
- ValueNumber = ValueNumber / 0x100
- elif TypeName == 'VOID*':
- if ValueString.startswith("L "):
- #
- # Patch Unicode String
- #
- Index = 0
- for ByteString in ValueString[2:]:
- #
- # Reserve zero as unicode tail
- #
- if Index + 2 >= ValueLength:
- break
- #
- # Set string value one by one
- #
- ByteList[ValueOffset + Index] = ord(ByteString)
- Index = Index + 2
- elif ValueString.startswith("{") and ValueString.endswith("}"):
- #
- # Patch {0x1, 0x2, ...} byte by byte
- #
- ValueList = ValueString[1 : len(ValueString) - 1].split(', ')
- Index = 0
- try:
- for ByteString in ValueList:
- if ByteString.upper().startswith('0X'):
- ByteValue = int(ByteString, 16)
- else:
- ByteValue = int(ByteString)
- ByteList[ValueOffset + Index] = ByteValue % 0x100
- Index = Index + 1
- if Index >= ValueLength:
- break
- except:
- return PARAMETER_INVALID, "PCD Value %s is not valid dec or hex string array." %(ValueString)
- else:
- #
- # Patch ascii string
- #
- Index = 0
- for ByteString in ValueString:
- #
- # Reserve zero as string tail
- #
- if Index + 1 >= ValueLength:
- break
- #
- # Set string value one by one
- #
- ByteList[ValueOffset + Index] = ord(ByteString)
- Index = Index + 1
- #
- # Update new data into input file.
- #
- if ByteList != OrigByteList:
- ByteArray = array.array('B')
- ByteArray.fromlist(ByteList)
- FileHandle = open (FileName, 'wb')
- ByteArray.tofile(FileHandle)
- FileHandle.close()
- return 0, "Patch Value into File %s successfully." %(FileName)
-
-## Parse command line options
-#
-# Using standard Python module optparse to parse command line option of this tool.
-#
-# @retval Options A optparse.Values object containing the parsed options
-# @retval InputFile Path of file to be trimmed
-#
-def Options():
- OptionList = [
- make_option("-f", "--offset", dest="PcdOffset", action="store", type="int",
- help="Start offset to the image is used to store PCD value."),
- make_option("-u", "--value", dest="PcdValue", action="store",
- help="PCD value will be updated into the image."),
- make_option("-t", "--type", dest="PcdTypeName", action="store",
- help="The name of PCD data type may be one of VOID*,BOOLEAN, UINT8, UINT16, UINT32, UINT64."),
- make_option("-s", "--maxsize", dest="PcdMaxSize", action="store", type="int",
- help="Max size of data buffer is taken by PCD value.It must be set when PCD type is VOID*."),
- make_option("-v", "--verbose", dest="LogLevel", action="store_const", const=EdkLogger.VERBOSE,
- help="Run verbosely"),
- make_option("-d", "--debug", dest="LogLevel", type="int",
- help="Run with debug information"),
- make_option("-q", "--quiet", dest="LogLevel", action="store_const", const=EdkLogger.QUIET,
- help="Run quietly"),
- make_option("-?", action="help", help="show this help message and exit"),
- ]
-
- # use clearer usage to override default usage message
- UsageString = "%prog -f Offset -u Value -t Type [-s MaxSize] <input_file>"
-
- Parser = OptionParser(description=__copyright__, version=__version__, option_list=OptionList, usage=UsageString)
- Parser.set_defaults(LogLevel=EdkLogger.INFO)
-
- Options, Args = Parser.parse_args()
-
- # error check
- if len(Args) == 0:
- EdkLogger.error("PatchPcdValue", PARAMETER_INVALID, ExtraData=Parser.get_usage())
-
- InputFile = Args[len(Args) - 1]
- return Options, InputFile
-
-## Entrance method
-#
-# This method mainly dispatch specific methods per the command line options.
-# If no error found, return zero value so the caller of this tool can know
-# if it's executed successfully or not.
-#
-# @retval 0 Tool was successful
-# @retval 1 Tool failed
-#
-def Main():
- try:
- #
- # Check input parameter
- #
- EdkLogger.Initialize()
- CommandOptions, InputFile = Options()
- if CommandOptions.LogLevel < EdkLogger.DEBUG_9:
- EdkLogger.SetLevel(CommandOptions.LogLevel + 1)
- else:
- EdkLogger.SetLevel(CommandOptions.LogLevel)
- if not os.path.exists (InputFile):
- EdkLogger.error("PatchPcdValue", FILE_NOT_FOUND, ExtraData=InputFile)
- return 1
- if CommandOptions.PcdOffset == None or CommandOptions.PcdValue == None or CommandOptions.PcdTypeName == None:
- EdkLogger.error("PatchPcdValue", OPTION_MISSING, ExtraData="PcdOffset or PcdValue of PcdTypeName is not specified.")
- return 1
- if CommandOptions.PcdTypeName.upper() not in ["BOOLEAN", "UINT8", "UINT16", "UINT32", "UINT64", "VOID*"]:
- EdkLogger.error("PatchPcdValue", PARAMETER_INVALID, ExtraData="PCD type %s is not valid." %(CommandOptions.PcdTypeName))
- return 1
- if CommandOptions.PcdTypeName.upper() == "VOID*" and CommandOptions.PcdMaxSize == None:
- EdkLogger.error("PatchPcdValue", OPTION_MISSING, ExtraData="PcdMaxSize is not specified for VOID* type PCD.")
- return 1
- #
- # Patch value into binary image.
- #
- ReturnValue, ErrorInfo = PatchBinaryFile (InputFile, CommandOptions.PcdOffset, CommandOptions.PcdTypeName, CommandOptions.PcdValue, CommandOptions.PcdMaxSize)
- if ReturnValue != 0:
- EdkLogger.error("PatchPcdValue", ReturnValue, ExtraData=ErrorInfo)
- return 1
- return 0
- except:
- return 1
-
-if __name__ == '__main__':
- r = Main()
- sys.exit(r)
diff --git a/BaseTools/Source/Python/PatchPcdValue/__init__.py b/BaseTools/Source/Python/PatchPcdValue/__init__.py
deleted file mode 100644
index a17d05f6b9..0000000000
--- a/BaseTools/Source/Python/PatchPcdValue/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'PatchPcdValue' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/Table/Table.py b/BaseTools/Source/Python/Table/Table.py
deleted file mode 100644
index c311df91c2..0000000000
--- a/BaseTools/Source/Python/Table/Table.py
+++ /dev/null
@@ -1,120 +0,0 @@
-## @file
-# This file is used to create/update/query/erase a common table
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-
-## TableFile
-#
-# This class defined a common table
-#
-# @param object: Inherited from object class
-#
-# @param Cursor: Cursor of the database
-# @param TableName: Name of the table
-#
-class Table(object):
- def __init__(self, Cursor):
- self.Cur = Cursor
- self.Table = ''
- self.ID = 0
-
- ## Create table
- #
- # Create a table
- #
- def Create(self, SqlCommand):
- self.Cur.execute(SqlCommand)
- self.ID = 0
- EdkLogger.verbose(SqlCommand + " ... DONE!")
-
- ## Insert table
- #
- # Insert a record into a table
- #
- def Insert(self, SqlCommand):
- self.Exec(SqlCommand)
-
- ## Query table
- #
- # Query all records of the table
- #
- def Query(self):
- EdkLogger.verbose("\nQuery tabel %s started ..." % self.Table)
- SqlCommand = """select * from %s""" % self.Table
- self.Cur.execute(SqlCommand)
- for Rs in self.Cur:
- EdkLogger.verbose(str(Rs))
-
- TotalCount = self.GetCount()
- EdkLogger.verbose("*** Total %s records in table %s ***" % (TotalCount, self.Table) )
- EdkLogger.verbose("Query tabel %s DONE!" % self.Table)
-
- ## Drop a table
- #
- # Drop the table
- #
- def Drop(self):
- SqlCommand = """drop table IF EXISTS %s""" % self.Table
- self.Cur.execute(SqlCommand)
- EdkLogger.verbose("Drop tabel %s ... DONE!" % self.Table)
-
- ## Get count
- #
- # Get a count of all records of the table
- #
- # @retval Count: Total count of all records
- #
- def GetCount(self):
- SqlCommand = """select count(ID) from %s""" % self.Table
- self.Cur.execute(SqlCommand)
- for Item in self.Cur:
- return Item[0]
-
- ## Generate ID
- #
- # Generate an ID if input ID is -1
- #
- # @param ID: Input ID
- #
- # @retval ID: New generated ID
- #
- def GenerateID(self, ID):
- if ID == -1:
- self.ID = self.ID + 1
-
- return self.ID
-
- ## Init the ID of the table
- #
- # Init the ID of the table
- #
- def InitID(self):
- self.ID = self.GetCount()
-
- ## Exec
- #
- # Exec Sql Command, return result
- #
- # @param SqlCommand: The SqlCommand to be executed
- #
- # @retval RecordSet: The result after executed
- #
- def Exec(self, SqlCommand):
- EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)
- self.Cur.execute(SqlCommand)
- RecordSet = self.Cur.fetchall()
- EdkLogger.debug(4, "RecordSet: %s" % RecordSet)
- return RecordSet
diff --git a/BaseTools/Source/Python/Table/TableDataModel.py b/BaseTools/Source/Python/Table/TableDataModel.py
deleted file mode 100644
index 9c3d7bd934..0000000000
--- a/BaseTools/Source/Python/Table/TableDataModel.py
+++ /dev/null
@@ -1,95 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for data models
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-import CommonDataClass.DataClass as DataClass
-from Table import Table
-from Common.String import ConvertToSqlString
-
-## TableDataModel
-#
-# This class defined a table used for data model
-#
-# @param object: Inherited from object class
-#
-#
-class TableDataModel(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'DataModel'
-
- ## Create table
- #
- # Create table DataModel
- #
- # @param ID: ID of a ModelType
- # @param CrossIndex: CrossIndex of a ModelType
- # @param Name: Name of a ModelType
- # @param Description: Description of a ModelType
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
- CrossIndex INTEGER NOT NULL,
- Name VARCHAR NOT NULL,
- Description VARCHAR
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table DataModel
- #
- # @param ID: ID of a ModelType
- # @param CrossIndex: CrossIndex of a ModelType
- # @param Name: Name of a ModelType
- # @param Description: Description of a ModelType
- #
- def Insert(self, CrossIndex, Name, Description):
- self.ID = self.ID + 1
- (Name, Description) = ConvertToSqlString((Name, Description))
- SqlCommand = """insert into %s values(%s, %s, '%s', '%s')""" % (self.Table, self.ID, CrossIndex, Name, Description)
- Table.Insert(self, SqlCommand)
-
- return self.ID
-
- ## Init table
- #
- # Create all default records of table DataModel
- #
- def InitTable(self):
- EdkLogger.verbose("\nInitialize table DataModel started ...")
- for Item in DataClass.MODEL_LIST:
- CrossIndex = Item[1]
- Name = Item[0]
- Description = Item[0]
- self.Insert(CrossIndex, Name, Description)
- EdkLogger.verbose("Initialize table DataModel ... DONE!")
-
- ## Get CrossIndex
- #
- # Get a model's cross index from its name
- #
- # @param ModelName: Name of the model
- # @retval CrossIndex: CrossIndex of the model
- #
- def GetCrossIndex(self, ModelName):
- CrossIndex = -1
- SqlCommand = """select CrossIndex from DataModel where name = '""" + ModelName + """'"""
- self.Cur.execute(SqlCommand)
- for Item in self.Cur:
- CrossIndex = Item[0]
-
- return CrossIndex
diff --git a/BaseTools/Source/Python/Table/TableDec.py b/BaseTools/Source/Python/Table/TableDec.py
deleted file mode 100644
index 6b7d22c938..0000000000
--- a/BaseTools/Source/Python/Table/TableDec.py
+++ /dev/null
@@ -1,108 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for dec datas
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-import CommonDataClass.DataClass as DataClass
-from Table import Table
-from Common.String import ConvertToSqlString
-
-## TableDec
-#
-# This class defined a table used for data model
-#
-# @param object: Inherited from object class
-#
-#
-class TableDec(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'Dec'
-
- ## Create table
- #
- # Create table Dec
- #
- # @param ID: ID of a Dec item
- # @param Model: Model of a Dec item
- # @param Value1: Value1 of a Dec item
- # @param Value2: Value2 of a Dec item
- # @param Value3: Value3 of a Dec item
- # @param Arch: Arch of a Dec item
- # @param BelongsToItem: The item belongs to which another item
- # @param BelongsToFile: The item belongs to which dsc file
- # @param StartLine: StartLine of a Dec item
- # @param StartColumn: StartColumn of a Dec item
- # @param EndLine: EndLine of a Dec item
- # @param EndColumn: EndColumn of a Dec item
- # @param Enabled: If this item enabled
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
- Model INTEGER NOT NULL,
- Value1 VARCHAR NOT NULL,
- Value2 VARCHAR,
- Value3 VARCHAR,
- Arch VarCHAR,
- BelongsToItem SINGLE NOT NULL,
- BelongsToFile SINGLE NOT NULL,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- Enabled INTEGER DEFAULT 0
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table Dec
- #
- # @param ID: ID of a Dec item
- # @param Model: Model of a Dec item
- # @param Value1: Value1 of a Dec item
- # @param Value2: Value2 of a Dec item
- # @param Value3: Value3 of a Dec item
- # @param Arch: Arch of a Dec item
- # @param BelongsToItem: The item belongs to which another item
- # @param BelongsToFile: The item belongs to which dsc file
- # @param StartLine: StartLine of a Dec item
- # @param StartColumn: StartColumn of a Dec item
- # @param EndLine: EndLine of a Dec item
- # @param EndColumn: EndColumn of a Dec item
- # @param Enabled: If this item enabled
- #
- def Insert(self, Model, Value1, Value2, Value3, Value4, Value5, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled):
- self.ID = self.ID + 1
- (Value1, Value2, Value3, Arch) = ConvertToSqlString((Value1, Value2, Value3, Arch))
- SqlCommand = """insert into %s values(%s, %s, '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \
- % (self.Table, self.ID, Model, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
- Table.Insert(self, SqlCommand)
-
- return self.ID
-
- ## Query table
- #
- # @param Model: The Model of Record
- #
- # @retval: A recordSet of all found records
- #
- def Query(self, Model):
- SqlCommand = """select ID, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine from %s
- where Model = %s
- and Enabled > -1""" % (self.Table, Model)
- EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)
- self.Cur.execute(SqlCommand)
- return self.Cur.fetchall()
diff --git a/BaseTools/Source/Python/Table/TableDsc.py b/BaseTools/Source/Python/Table/TableDsc.py
deleted file mode 100644
index 69477d544d..0000000000
--- a/BaseTools/Source/Python/Table/TableDsc.py
+++ /dev/null
@@ -1,108 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for dsc datas
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-import CommonDataClass.DataClass as DataClass
-from Table import Table
-from Common.String import ConvertToSqlString
-
-## TableDsc
-#
-# This class defined a table used for data model
-#
-# @param object: Inherited from object class
-#
-#
-class TableDsc(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'Dsc'
-
- ## Create table
- #
- # Create table Dsc
- #
- # @param ID: ID of a Dsc item
- # @param Model: Model of a Dsc item
- # @param Value1: Value1 of a Dsc item
- # @param Value2: Value2 of a Dsc item
- # @param Value3: Value3 of a Dsc item
- # @param Arch: Arch of a Dsc item
- # @param BelongsToItem: The item belongs to which another item
- # @param BelongsToFile: The item belongs to which dsc file
- # @param StartLine: StartLine of a Dsc item
- # @param StartColumn: StartColumn of a Dsc item
- # @param EndLine: EndLine of a Dsc item
- # @param EndColumn: EndColumn of a Dsc item
- # @param Enabled: If this item enabled
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
- Model INTEGER NOT NULL,
- Value1 VARCHAR NOT NULL,
- Value2 VARCHAR,
- Value3 VARCHAR,
- Arch VarCHAR,
- BelongsToItem SINGLE NOT NULL,
- BelongsToFile SINGLE NOT NULL,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- Enabled INTEGER DEFAULT 0
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table Dsc
- #
- # @param ID: ID of a Dsc item
- # @param Model: Model of a Dsc item
- # @param Value1: Value1 of a Dsc item
- # @param Value2: Value2 of a Dsc item
- # @param Value3: Value3 of a Dsc item
- # @param Arch: Arch of a Dsc item
- # @param BelongsToItem: The item belongs to which another item
- # @param BelongsToFile: The item belongs to which dsc file
- # @param StartLine: StartLine of a Dsc item
- # @param StartColumn: StartColumn of a Dsc item
- # @param EndLine: EndLine of a Dsc item
- # @param EndColumn: EndColumn of a Dsc item
- # @param Enabled: If this item enabled
- #
- def Insert(self, Model, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled):
- self.ID = self.ID + 1
- (Value1, Value2, Value3, Arch) = ConvertToSqlString((Value1, Value2, Value3, Arch))
- SqlCommand = """insert into %s values(%s, %s, '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \
- % (self.Table, self.ID, Model, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
- Table.Insert(self, SqlCommand)
-
- return self.ID
-
- ## Query table
- #
- # @param Model: The Model of Record
- #
- # @retval: A recordSet of all found records
- #
- def Query(self, Model):
- SqlCommand = """select ID, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine from %s
- where Model = %s
- and Enabled > -1""" % (self.Table, Model)
- EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)
- self.Cur.execute(SqlCommand)
- return self.Cur.fetchall()
diff --git a/BaseTools/Source/Python/Table/TableEotReport.py b/BaseTools/Source/Python/Table/TableEotReport.py
deleted file mode 100644
index dd465b68b2..0000000000
--- a/BaseTools/Source/Python/Table/TableEotReport.py
+++ /dev/null
@@ -1,76 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for ECC reports
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-import os, time
-from Table import Table
-from Common.String import ConvertToSqlString2
-import Eot.EotToolError as EotToolError
-import Eot.EotGlobalData as EotGlobalData
-
-## TableReport
-#
-# This class defined a table used for data model
-#
-# @param object: Inherited from object class
-#
-#
-class TableEotReport(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'Report'
-
- ## Create table
- #
- # Create table report
- #
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
- ModuleID INTEGER DEFAULT -1,
- ModuleName TEXT DEFAULT '',
- ModuleGuid TEXT DEFAULT '',
- SourceFileID INTEGER DEFAULT -1,
- SourceFileFullPath TEXT DEFAULT '',
- ItemName TEXT DEFAULT '',
- ItemType TEXT DEFAULT '',
- ItemMode TEXT DEFAULT '',
- GuidName TEXT DEFAULT '',
- GuidMacro TEXT DEFAULT '',
- GuidValue TEXT DEFAULT '',
- BelongsToFunction TEXT DEFAULT '',
- Enabled INTEGER DEFAULT 0
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table report
- #
- #
- def Insert(self, ModuleID = -1, ModuleName = '', ModuleGuid = '', SourceFileID = -1, SourceFileFullPath = '', \
- ItemName = '', ItemType = '', ItemMode = '', GuidName = '', GuidMacro = '', GuidValue = '', BelongsToFunction = '', Enabled = 0):
- self.ID = self.ID + 1
- SqlCommand = """insert into %s values(%s, %s, '%s', '%s', %s, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %s)""" \
- % (self.Table, self.ID, ModuleID, ModuleName, ModuleGuid, SourceFileID, SourceFileFullPath, \
- ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, Enabled)
- Table.Insert(self, SqlCommand)
-
- def GetMaxID(self):
- SqlCommand = """select max(ID) from %s""" % self.Table
- self.Cur.execute(SqlCommand)
- for Item in self.Cur:
- return Item[0] \ No newline at end of file
diff --git a/BaseTools/Source/Python/Table/TableFdf.py b/BaseTools/Source/Python/Table/TableFdf.py
deleted file mode 100644
index 927b5d1a3b..0000000000
--- a/BaseTools/Source/Python/Table/TableFdf.py
+++ /dev/null
@@ -1,109 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for fdf datas
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-import CommonDataClass.DataClass as DataClass
-from Table import Table
-from Common.String import ConvertToSqlString
-
-## TableFdf
-#
-# This class defined a table used for data model
-#
-# @param object: Inherited from object class
-#
-#
-class TableFdf(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'Fdf'
-
- ## Create table
- #
- # Create table Fdf
- #
- # @param ID: ID of a Fdf item
- # @param Model: Model of a Fdf item
- # @param Value1: Value1 of a Fdf item
- # @param Value2: Value2 of a Fdf item
- # @param Value3: Value3 of a Fdf item
- # @param Arch: Arch of a Fdf item
- # @param BelongsToItem: The item belongs to which another item
- # @param BelongsToFile: The item belongs to which fdf file
- # @param StartLine: StartLine of a Fdf item
- # @param StartColumn: StartColumn of a Fdf item
- # @param EndLine: EndLine of a Fdf item
- # @param EndColumn: EndColumn of a Fdf item
- # @param Enabled: If this item enabled
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
- Model INTEGER NOT NULL,
- Value1 VARCHAR NOT NULL,
- Value2 VARCHAR,
- Value3 VARCHAR,
- Scope1 VarCHAR,
- Scope2 VarCHAR,
- BelongsToItem SINGLE NOT NULL,
- BelongsToFile SINGLE NOT NULL,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- Enabled INTEGER DEFAULT 0
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table Fdf
- #
- # @param ID: ID of a Fdf item
- # @param Model: Model of a Fdf item
- # @param Value1: Value1 of a Fdf item
- # @param Value2: Value2 of a Fdf item
- # @param Value3: Value3 of a Fdf item
- # @param Arch: Arch of a Fdf item
- # @param BelongsToItem: The item belongs to which another item
- # @param BelongsToFile: The item belongs to which fdf file
- # @param StartLine: StartLine of a Fdf item
- # @param StartColumn: StartColumn of a Fdf item
- # @param EndLine: EndLine of a Fdf item
- # @param EndColumn: EndColumn of a Fdf item
- # @param Enabled: If this item enabled
- #
- def Insert(self, Model, Value1, Value2, Value3, Scope1, Scope2, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled):
- self.ID = self.ID + 1
- (Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
- SqlCommand = """insert into %s values(%s, %s, '%s', '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \
- % (self.Table, self.ID, Model, Value1, Value2, Value3, Scope1, Scope2, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
- Table.Insert(self, SqlCommand)
-
- return self.ID
-
- ## Query table
- #
- # @param Model: The Model of Record
- #
- # @retval: A recordSet of all found records
- #
- def Query(self, Model):
- SqlCommand = """select ID, Value1, Value2, Value3, Scope1, Scope2, BelongsToItem, BelongsToFile, StartLine from %s
- where Model = %s
- and Enabled > -1""" % (self.Table, Model)
- EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)
- self.Cur.execute(SqlCommand)
- return self.Cur.fetchall()
diff --git a/BaseTools/Source/Python/Table/TableFile.py b/BaseTools/Source/Python/Table/TableFile.py
deleted file mode 100644
index e43802ef25..0000000000
--- a/BaseTools/Source/Python/Table/TableFile.py
+++ /dev/null
@@ -1,104 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for files
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-from Table import Table
-from Common.String import ConvertToSqlString
-import os
-from CommonDataClass.DataClass import FileClass
-
-## TableFile
-#
-# This class defined a table used for file
-#
-# @param object: Inherited from object class
-#
-class TableFile(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'File'
-
- ## Create table
- #
- # Create table File
- #
- # @param ID: ID of a File
- # @param Name: Name of a File
- # @param ExtName: ExtName of a File
- # @param Path: Path of a File
- # @param FullPath: FullPath of a File
- # @param Model: Model of a File
- # @param TimeStamp: TimeStamp of a File
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
- Name VARCHAR NOT NULL,
- ExtName VARCHAR,
- Path VARCHAR,
- FullPath VARCHAR NOT NULL,
- Model INTEGER DEFAULT 0,
- TimeStamp VARCHAR NOT NULL
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table File
- #
- # @param ID: ID of a File
- # @param Name: Name of a File
- # @param ExtName: ExtName of a File
- # @param Path: Path of a File
- # @param FullPath: FullPath of a File
- # @param Model: Model of a File
- # @param TimeStamp: TimeStamp of a File
- #
- def Insert(self, Name, ExtName, Path, FullPath, Model, TimeStamp):
- self.ID = self.ID + 1
- (Name, ExtName, Path, FullPath) = ConvertToSqlString((Name, ExtName, Path, FullPath))
- SqlCommand = """insert into %s values(%s, '%s', '%s', '%s', '%s', %s, '%s')""" \
- % (self.Table, self.ID, Name, ExtName, Path, FullPath, Model, TimeStamp)
- Table.Insert(self, SqlCommand)
-
- return self.ID
- ## InsertFile
- #
- # Insert one file to table
- #
- # @param FileFullPath: The full path of the file
- # @param Model: The model of the file
- #
- # @retval FileID: The ID after record is inserted
- #
- def InsertFile(self, FileFullPath, Model):
- (Filepath, Name) = os.path.split(FileFullPath)
- (Root, Ext) = os.path.splitext(FileFullPath)
- TimeStamp = os.stat(FileFullPath)[8]
- File = FileClass(-1, Name, Ext, Filepath, FileFullPath, Model, '', [], [], [])
- return self.Insert(File.Name, File.ExtName, File.Path, File.FullPath, File.Model, TimeStamp)
-
- ## Get ID of a given file
- #
- # @param FilePath Path of file
- #
- # @retval ID ID value of given file in the table
- #
- def GetFileId(self, File):
- QueryScript = "select ID from %s where FullPath = '%s'" % (self.Table, str(File))
- RecordList = self.Exec(QueryScript)
- if len(RecordList) == 0:
- return None
- return RecordList[0][0]
diff --git a/BaseTools/Source/Python/Table/TableFunction.py b/BaseTools/Source/Python/Table/TableFunction.py
deleted file mode 100644
index 3d7c2d0ea5..0000000000
--- a/BaseTools/Source/Python/Table/TableFunction.py
+++ /dev/null
@@ -1,95 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for functions
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-from Table import Table
-from Common.String import ConvertToSqlString
-
-## TableFunction
-#
-# This class defined a table used for function
-#
-# @param Table: Inherited from Table class
-#
-class TableFunction(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'Function'
-
- ## Create table
- #
- # Create table Function
- #
- # @param ID: ID of a Function
- # @param Header: Header of a Function
- # @param Modifier: Modifier of a Function
- # @param Name: Name of a Function
- # @param ReturnStatement: ReturnStatement of a Funciont
- # @param StartLine: StartLine of a Function
- # @param StartColumn: StartColumn of a Function
- # @param EndLine: EndLine of a Function
- # @param EndColumn: EndColumn of a Function
- # @param BodyStartLine: StartLine of a Function body
- # @param BodyStartColumn: StartColumn of a Function body
- # @param BelongsToFile: The Function belongs to which file
- # @param FunNameStartLine: StartLine of a Function name
- # @param FunNameStartColumn: StartColumn of a Function name
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
- Header TEXT,
- Modifier VARCHAR,
- Name VARCHAR NOT NULL,
- ReturnStatement VARCHAR,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- BodyStartLine INTEGER NOT NULL,
- BodyStartColumn INTEGER NOT NULL,
- BelongsToFile SINGLE NOT NULL,
- FunNameStartLine INTEGER NOT NULL,
- FunNameStartColumn INTEGER NOT NULL
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table Function
- #
- # @param ID: ID of a Function
- # @param Header: Header of a Function
- # @param Modifier: Modifier of a Function
- # @param Name: Name of a Function
- # @param ReturnStatement: ReturnStatement of a Funciont
- # @param StartLine: StartLine of a Function
- # @param StartColumn: StartColumn of a Function
- # @param EndLine: EndLine of a Function
- # @param EndColumn: EndColumn of a Function
- # @param BodyStartLine: StartLine of a Function body
- # @param BodyStartColumn: StartColumn of a Function body
- # @param BelongsToFile: The Function belongs to which file
- # @param FunNameStartLine: StartLine of a Function name
- # @param FunNameStartColumn: StartColumn of a Function name
- #
- def Insert(self, Header, Modifier, Name, ReturnStatement, StartLine, StartColumn, EndLine, EndColumn, BodyStartLine, BodyStartColumn, BelongsToFile, FunNameStartLine, FunNameStartColumn):
- self.ID = self.ID + 1
- (Header, Modifier, Name, ReturnStatement) = ConvertToSqlString((Header, Modifier, Name, ReturnStatement))
- SqlCommand = """insert into %s values(%s, '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s, %s, %s)""" \
- % (self.Table, self.ID, Header, Modifier, Name, ReturnStatement, StartLine, StartColumn, EndLine, EndColumn, BodyStartLine, BodyStartColumn, BelongsToFile, FunNameStartLine, FunNameStartColumn)
- Table.Insert(self, SqlCommand)
-
- return self.ID
diff --git a/BaseTools/Source/Python/Table/TableIdentifier.py b/BaseTools/Source/Python/Table/TableIdentifier.py
deleted file mode 100644
index bcd6d6e1c1..0000000000
--- a/BaseTools/Source/Python/Table/TableIdentifier.py
+++ /dev/null
@@ -1,90 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for Identifiers
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-from Common.String import ConvertToSqlString
-from Table import Table
-
-## TableIdentifier
-#
-# This class defined a table used for Identifier
-#
-# @param object: Inherited from object class
-#
-#
-class TableIdentifier(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'Identifier'
-
- ## Create table
- #
- # Create table Identifier
- #
- # @param ID: ID of a Identifier
- # @param Modifier: Modifier of a Identifier
- # @param Type: Type of a Identifier
- # @param Name: Name of a Identifier
- # @param Value: Value of a Identifier
- # @param Model: Model of a Identifier
- # @param BelongsToFile: The Identifier belongs to which file
- # @param BelongsToFunction: The Identifier belongs to which function
- # @param StartLine: StartLine of a Identifier
- # @param StartColumn: StartColumn of a Identifier
- # @param EndLine: EndLine of a Identifier
- # @param EndColumn: EndColumn of a Identifier
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s(ID INTEGER PRIMARY KEY,
- Modifier VARCHAR,
- Type VARCHAR,
- Name VARCHAR NOT NULL,
- Value VARCHAR NOT NULL,
- Model INTEGER NOT NULL,
- BelongsToFile SINGLE NOT NULL,
- BelongsToFunction SINGLE DEFAULT -1,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table Identifier
- #
- # @param ID: ID of a Identifier
- # @param Modifier: Modifier of a Identifier
- # @param Type: Type of a Identifier
- # @param Name: Name of a Identifier
- # @param Value: Value of a Identifier
- # @param Model: Model of a Identifier
- # @param BelongsToFile: The Identifier belongs to which file
- # @param BelongsToFunction: The Identifier belongs to which function
- # @param StartLine: StartLine of a Identifier
- # @param StartColumn: StartColumn of a Identifier
- # @param EndLine: EndLine of a Identifier
- # @param EndColumn: EndColumn of a Identifier
- #
- def Insert(self, Modifier, Type, Name, Value, Model, BelongsToFile, BelongsToFunction, StartLine, StartColumn, EndLine, EndColumn):
- self.ID = self.ID + 1
- (Modifier, Type, Name, Value) = ConvertToSqlString((Modifier, Type, Name, Value))
- SqlCommand = """insert into %s values(%s, '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \
- % (self.Table, self.ID, Modifier, Type, Name, Value, Model, BelongsToFile, BelongsToFunction, StartLine, StartColumn, EndLine, EndColumn)
- Table.Insert(self, SqlCommand)
-
- return self.ID \ No newline at end of file
diff --git a/BaseTools/Source/Python/Table/TableInf.py b/BaseTools/Source/Python/Table/TableInf.py
deleted file mode 100644
index b6e300b150..0000000000
--- a/BaseTools/Source/Python/Table/TableInf.py
+++ /dev/null
@@ -1,114 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for inf datas
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-import CommonDataClass.DataClass as DataClass
-from Table import Table
-from Common.String import ConvertToSqlString
-
-## TableInf
-#
-# This class defined a table used for data model
-#
-# @param object: Inherited from object class
-#
-#
-class TableInf(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'Inf'
-
- ## Create table
- #
- # Create table Inf
- #
- # @param ID: ID of a Inf item
- # @param Model: Model of a Inf item
- # @param Value1: Value1 of a Inf item
- # @param Value2: Value2 of a Inf item
- # @param Value3: Value3 of a Inf item
- # @param Value4: Value4 of a Inf item
- # @param Value5: Value5 of a Inf item
- # @param Arch: Arch of a Inf item
- # @param BelongsToItem: The item belongs to which another item
- # @param BelongsToFile: The item belongs to which dsc file
- # @param StartLine: StartLine of a Inf item
- # @param StartColumn: StartColumn of a Inf item
- # @param EndLine: EndLine of a Inf item
- # @param EndColumn: EndColumn of a Inf item
- # @param Enabled: If this item enabled
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
- Model INTEGER NOT NULL,
- Value1 VARCHAR NOT NULL,
- Value2 VARCHAR,
- Value3 VARCHAR,
- Value4 VARCHAR,
- Value5 VARCHAR,
- Arch VarCHAR,
- BelongsToItem SINGLE NOT NULL,
- BelongsToFile SINGLE NOT NULL,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- Enabled INTEGER DEFAULT 0
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table Inf
- #
- # @param ID: ID of a Inf item
- # @param Model: Model of a Inf item
- # @param Value1: Value1 of a Inf item
- # @param Value2: Value2 of a Inf item
- # @param Value3: Value3 of a Inf item
- # @param Value4: Value4 of a Inf item
- # @param Value5: Value5 of a Inf item
- # @param Arch: Arch of a Inf item
- # @param BelongsToItem: The item belongs to which another item
- # @param BelongsToFile: The item belongs to which dsc file
- # @param StartLine: StartLine of a Inf item
- # @param StartColumn: StartColumn of a Inf item
- # @param EndLine: EndLine of a Inf item
- # @param EndColumn: EndColumn of a Inf item
- # @param Enabled: If this item enabled
- #
- def Insert(self, Model, Value1, Value2, Value3, Value4, Value5, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled):
- self.ID = self.ID + 1
- (Value1, Value2, Value3, Value4, Value5, Arch) = ConvertToSqlString((Value1, Value2, Value3, Value4, Value5, Arch))
- SqlCommand = """insert into %s values(%s, %s, '%s', '%s', '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \
- % (self.Table, self.ID, Model, Value1, Value2, Value3, Value4, Value5, Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled)
- Table.Insert(self, SqlCommand)
-
- return self.ID
-
- ## Query table
- #
- # @param Model: The Model of Record
- #
- # @retval: A recordSet of all found records
- #
- def Query(self, Model):
- SqlCommand = """select ID, Value1, Value2, Value3, Arch, BelongsToItem, BelongsToFile, StartLine from %s
- where Model = %s
- and Enabled > -1""" % (self.Table, Model)
- EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)
- self.Cur.execute(SqlCommand)
- return self.Cur.fetchall()
diff --git a/BaseTools/Source/Python/Table/TablePcd.py b/BaseTools/Source/Python/Table/TablePcd.py
deleted file mode 100644
index 19623f98f4..0000000000
--- a/BaseTools/Source/Python/Table/TablePcd.py
+++ /dev/null
@@ -1,90 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for pcds
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-from Table import Table
-from Common.String import ConvertToSqlString
-
-## TablePcd
-#
-# This class defined a table used for pcds
-#
-# @param object: Inherited from object class
-#
-#
-class TablePcd(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'Pcd'
-
- ## Create table
- #
- # Create table Pcd
- #
- # @param ID: ID of a Pcd
- # @param CName: CName of a Pcd
- # @param TokenSpaceGuidCName: TokenSpaceGuidCName of a Pcd
- # @param Token: Token of a Pcd
- # @param DatumType: DatumType of a Pcd
- # @param Model: Model of a Pcd
- # @param BelongsToFile: The Pcd belongs to which file
- # @param BelongsToFunction: The Pcd belongs to which function
- # @param StartLine: StartLine of a Pcd
- # @param StartColumn: StartColumn of a Pcd
- # @param EndLine: EndLine of a Pcd
- # @param EndColumn: EndColumn of a Pcd
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
- CName VARCHAR NOT NULL,
- TokenSpaceGuidCName VARCHAR NOT NULL,
- Token INTEGER,
- DatumType VARCHAR,
- Model INTEGER NOT NULL,
- BelongsToFile SINGLE NOT NULL,
- BelongsToFunction SINGLE DEFAULT -1,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table Pcd
- #
- # @param ID: ID of a Pcd
- # @param CName: CName of a Pcd
- # @param TokenSpaceGuidCName: TokenSpaceGuidCName of a Pcd
- # @param Token: Token of a Pcd
- # @param DatumType: DatumType of a Pcd
- # @param Model: Model of a Pcd
- # @param BelongsToFile: The Pcd belongs to which file
- # @param BelongsToFunction: The Pcd belongs to which function
- # @param StartLine: StartLine of a Pcd
- # @param StartColumn: StartColumn of a Pcd
- # @param EndLine: EndLine of a Pcd
- # @param EndColumn: EndColumn of a Pcd
- #
- def Insert(self, CName, TokenSpaceGuidCName, Token, DatumType, Model, BelongsToFile, BelongsToFunction, StartLine, StartColumn, EndLine, EndColumn):
- self.ID = self.ID + 1
- (CName, TokenSpaceGuidCName, DatumType) = ConvertToSqlString((CName, TokenSpaceGuidCName, DatumType))
- SqlCommand = """insert into %s values(%s, '%s', '%s', %s, '%s', %s, %s, %s, %s, %s, %s, %s)""" \
- % (self.Table, self.ID, CName, TokenSpaceGuidCName, Token, DatumType, Model, BelongsToFile, BelongsToFunction, StartLine, StartColumn, EndLine, EndColumn)
- Table.Insert(self, SqlCommand)
-
- return self.ID \ No newline at end of file
diff --git a/BaseTools/Source/Python/Table/TableQuery.py b/BaseTools/Source/Python/Table/TableQuery.py
deleted file mode 100644
index e1d2537394..0000000000
--- a/BaseTools/Source/Python/Table/TableQuery.py
+++ /dev/null
@@ -1,68 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for Queries
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-from Common.String import ConvertToSqlString
-from Table import Table
-
-## TableQuery
-#
-# This class defined a table used for Query
-#
-# @param object: Inherited from object class
-#
-#
-class TableQuery(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'Query'
-
- ## Create table
- #
- # Create table Query
- #
- # @param ID: ID of a Query
- # @param Name: Name of a Query
- # @param Modifer: Modifier of a Query
- # @param Value: Type of a Query
- # @param Model: Model of a Query
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s(ID INTEGER PRIMARY KEY,
- Name TEXT DEFAULT '',
- Modifier TEXT DEFAULT '',
- Value TEXT DEFAULT '',
- Model INTEGER DEFAULT 0
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table Query
- #
- # @param ID: ID of a Query
- # @param Name: Name of a Query
- # @param Modifier: Modifier of a Query
- # @param Value: Value of a Query
- # @param Model: Model of a Query
- #
- def Insert(self, Name, Modifier, Value, Model):
- self.ID = self.ID + 1
- SqlCommand = """insert into %s values(%s, '%s', '%s', '%s', %s)""" \
- % (self.Table, self.ID, Name, Modifier, Value, Model)
- Table.Insert(self, SqlCommand)
-
- return self.ID
diff --git a/BaseTools/Source/Python/Table/TableReport.py b/BaseTools/Source/Python/Table/TableReport.py
deleted file mode 100644
index 2e7fd539f7..0000000000
--- a/BaseTools/Source/Python/Table/TableReport.py
+++ /dev/null
@@ -1,124 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for ECC reports
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import Common.EdkLogger as EdkLogger
-import os, time
-from Table import Table
-from Common.String import ConvertToSqlString2
-import EccToolError as EccToolError
-import EccGlobalData as EccGlobalData
-
-## TableReport
-#
-# This class defined a table used for data model
-#
-# @param object: Inherited from object class
-#
-#
-class TableReport(Table):
- def __init__(self, Cursor):
- Table.__init__(self, Cursor)
- self.Table = 'Report'
-
- ## Create table
- #
- # Create table report
- #
- # @param ID: ID of an Error
- # @param ErrorID: ID of an Error TypeModel of a Report item
- # @param OtherMsg: Other error message besides the standard error message
- # @param BelongsToItem: The error belongs to which item
- # @param Enabled: If this error enabled
- # @param Corrected: if this error corrected
- #
- def Create(self):
- SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
- ErrorID INTEGER NOT NULL,
- OtherMsg TEXT,
- BelongsToTable TEXT NOT NULL,
- BelongsToItem SINGLE NOT NULL,
- Enabled INTEGER DEFAULT 0,
- Corrected INTEGER DEFAULT -1
- )""" % self.Table
- Table.Create(self, SqlCommand)
-
- ## Insert table
- #
- # Insert a record into table report
- #
- # @param ID: ID of an Error
- # @param ErrorID: ID of an Error TypeModel of a report item
- # @param OtherMsg: Other error message besides the standard error message
- # @param BelongsToTable: The error item belongs to which table
- # @param BelongsToItem: The error belongs to which item
- # @param Enabled: If this error enabled
- # @param Corrected: if this error corrected
- #
- def Insert(self, ErrorID, OtherMsg = '', BelongsToTable = '', BelongsToItem = -1, Enabled = 0, Corrected = -1):
- self.ID = self.ID + 1
- SqlCommand = """insert into %s values(%s, %s, '%s', '%s', %s, %s, %s)""" \
- % (self.Table, self.ID, ErrorID, ConvertToSqlString2(OtherMsg), BelongsToTable, BelongsToItem, Enabled, Corrected)
- Table.Insert(self, SqlCommand)
-
- return self.ID
-
- ## Query table
- #
- # @retval: A recordSet of all found records
- #
- def Query(self):
- SqlCommand = """select ID, ErrorID, OtherMsg, BelongsToTable, BelongsToItem, Corrected from %s
- where Enabled > -1 order by ErrorID, BelongsToItem""" % (self.Table)
- return self.Exec(SqlCommand)
-
- ## Convert to CSV
- #
- # Get all enabled records from table report and save them to a .csv file
- #
- # @param Filename: To filename to save the report content
- #
- def ToCSV(self, Filename = 'Report.csv'):
- try:
- File = open(Filename, 'w+')
- File.write("""No, Error Code, Error Message, File, LineNo, Other Error Message\n""")
- RecordSet = self.Query()
- Index = 0
- for Record in RecordSet:
- Index = Index + 1
- ErrorID = Record[1]
- OtherMsg = Record[2]
- BelongsToTable = Record[3]
- BelongsToItem = Record[4]
- IsCorrected = Record[5]
- SqlCommand = ''
- if BelongsToTable == 'File':
- SqlCommand = """select 1, FullPath from %s where ID = %s
- """ % (BelongsToTable, BelongsToItem)
- else:
- SqlCommand = """select A.StartLine, B.FullPath from %s as A, File as B
- where A.ID = %s and B.ID = A.BelongsToFile
- """ % (BelongsToTable, BelongsToItem)
- NewRecord = self.Exec(SqlCommand)
- if NewRecord != []:
- File.write("""%s,%s,"%s",%s,%s,"%s"\n""" % (Index, ErrorID, EccToolError.gEccErrorMessage[ErrorID], NewRecord[0][1], NewRecord[0][0], OtherMsg))
- EdkLogger.quiet("%s(%s): [%s]%s %s" % (NewRecord[0][1], NewRecord[0][0], ErrorID, EccToolError.gEccErrorMessage[ErrorID], OtherMsg))
-
- File.close()
- except IOError:
- NewFilename = 'Report_' + time.strftime("%Y%m%d_%H%M%S.csv", time.localtime())
- EdkLogger.warn("ECC", "The report file %s is locked by other progress, use %s instead!" % (Filename, NewFilename))
- self.ToCSV(NewFilename)
-
diff --git a/BaseTools/Source/Python/Table/__init__.py b/BaseTools/Source/Python/Table/__init__.py
deleted file mode 100644
index c6424a5933..0000000000
--- a/BaseTools/Source/Python/Table/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'Table' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/TargetTool/TargetTool.py b/BaseTools/Source/Python/TargetTool/TargetTool.py
deleted file mode 100644
index 8126aac59c..0000000000
--- a/BaseTools/Source/Python/TargetTool/TargetTool.py
+++ /dev/null
@@ -1,257 +0,0 @@
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-import os
-import sys
-import traceback
-from optparse import OptionParser
-
-import Common.EdkLogger as EdkLogger
-import Common.BuildToolError as BuildToolError
-from Common.DataType import *
-from Common.BuildVersion import gBUILD_VERSION
-
-# To Do 1.set clean, 2. add item, if the line is disabled.
-
-class TargetTool():
- def __init__(self, opt, args):
- self.WorkSpace = os.path.normpath(os.getenv('WORKSPACE'))
- self.Opt = opt
- self.Arg = args[0]
- self.FileName = os.path.normpath(os.path.join(self.WorkSpace, 'Conf', 'target.txt'))
- if os.path.isfile(self.FileName) == False:
- print "%s does not exist." % self.FileName
- sys.exit(1)
- self.TargetTxtDictionary = {
- TAB_TAT_DEFINES_ACTIVE_PLATFORM : None,
- TAB_TAT_DEFINES_TOOL_CHAIN_CONF : None,
- TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER : None,
- TAB_TAT_DEFINES_TARGET : None,
- TAB_TAT_DEFINES_TOOL_CHAIN_TAG : None,
- TAB_TAT_DEFINES_TARGET_ARCH : None,
- TAB_TAT_DEFINES_BUILD_RULE_CONF : None,
- }
- self.LoadTargetTxtFile(self.FileName)
-
- def LoadTargetTxtFile(self, filename):
- if os.path.exists(filename) and os.path.isfile(filename):
- return self.ConvertTextFileToDict(filename, '#', '=')
- else:
- raise ParseError('LoadTargetTxtFile() : No Target.txt file exists.')
- return 1
-
-#
-# Convert a text file to a dictionary
-#
- def ConvertTextFileToDict(self, FileName, CommentCharacter, KeySplitCharacter):
- """Convert a text file to a dictionary of (name:value) pairs."""
- try:
- f = open(FileName,'r')
- for Line in f:
- if Line.startswith(CommentCharacter) or Line.strip() == '':
- continue
- LineList = Line.split(KeySplitCharacter,1)
- if len(LineList) >= 2:
- Key = LineList[0].strip()
- if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary.keys():
- if Key == TAB_TAT_DEFINES_ACTIVE_PLATFORM or Key == TAB_TAT_DEFINES_TOOL_CHAIN_CONF \
- or Key == TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER \
- or Key == TAB_TAT_DEFINES_ACTIVE_MODULE:
- self.TargetTxtDictionary[Key] = LineList[1].replace('\\', '/').strip()
- elif Key == TAB_TAT_DEFINES_TARGET or Key == TAB_TAT_DEFINES_TARGET_ARCH \
- or Key == TAB_TAT_DEFINES_TOOL_CHAIN_TAG or Key == TAB_TAT_DEFINES_BUILD_RULE_CONF:
- self.TargetTxtDictionary[Key] = LineList[1].split()
- f.close()
- return 0
- except:
- last_type, last_value, last_tb = sys.exc_info()
- traceback.print_exception(last_type, last_value, last_tb)
-
- def Print(self):
- KeyList = self.TargetTxtDictionary.keys()
- errMsg = ''
- for Key in KeyList:
- if type(self.TargetTxtDictionary[Key]) == type([]):
- print "%-30s = %s" % (Key, ''.join(elem + ' ' for elem in self.TargetTxtDictionary[Key]))
- elif self.TargetTxtDictionary[Key] == None:
- errMsg += " Missing %s configuration information, please use TargetTool to set value!" % Key + os.linesep
- else:
- print "%-30s = %s" % (Key, self.TargetTxtDictionary[Key])
-
- if errMsg != '':
- print os.linesep + 'Warning:' + os.linesep + errMsg
-
- def RWFile(self, CommentCharacter, KeySplitCharacter, Num):
- try:
- fr = open(self.FileName, 'r')
- fw = open(os.path.normpath(os.path.join(self.WorkSpace, 'Conf\\targetnew.txt')), 'w')
-
- existKeys = []
- for Line in fr:
- if Line.startswith(CommentCharacter) or Line.strip() == '':
- fw.write(Line)
- else:
- LineList = Line.split(KeySplitCharacter,1)
- if len(LineList) >= 2:
- Key = LineList[0].strip()
- if Key.startswith(CommentCharacter) == False and Key in self.TargetTxtDictionary.keys():
- if Key not in existKeys:
- existKeys.append(Key)
- else:
- print "Warning: Found duplicate key item in original configuration files!"
-
- if Num == 0:
- Line = "%-30s = \n" % Key
- else:
- ret = GetConfigureKeyValue(self, Key)
- if ret != None:
- Line = ret
- fw.write(Line)
- for key in self.TargetTxtDictionary.keys():
- if key not in existKeys:
- print "Warning: %s does not exist in original configuration file" % key
- Line = GetConfigureKeyValue(self, key)
- if Line == None:
- Line = "%-30s = " % key
- fw.write(Line)
-
- fr.close()
- fw.close()
- os.remove(self.FileName)
- os.rename(os.path.normpath(os.path.join(self.WorkSpace, 'Conf\\targetnew.txt')), self.FileName)
-
- except:
- last_type, last_value, last_tb = sys.exc_info()
- traceback.print_exception(last_type, last_value, last_tb)
-
-def GetConfigureKeyValue(self, Key):
- Line = None
- if Key == TAB_TAT_DEFINES_ACTIVE_PLATFORM and self.Opt.DSCFILE != None:
- dscFullPath = os.path.join(self.WorkSpace, self.Opt.DSCFILE)
- if os.path.exists(dscFullPath):
- Line = "%-30s = %s\n" % (Key, self.Opt.DSCFILE)
- else:
- EdkLogger.error("TagetTool", BuildToolError.FILE_NOT_FOUND,
- "DSC file %s does not exist!" % self.Opt.DSCFILE, RaiseError=False)
- elif Key == TAB_TAT_DEFINES_TOOL_CHAIN_CONF and self.Opt.TOOL_DEFINITION_FILE != None:
- tooldefFullPath = os.path.join(self.WorkSpace, self.Opt.TOOL_DEFINITION_FILE)
- if os.path.exists(tooldefFullPath):
- Line = "%-30s = %s\n" % (Key, self.Opt.TOOL_DEFINITION_FILE)
- else:
- EdkLogger.error("TagetTool", BuildToolError.FILE_NOT_FOUND,
- "Tooldef file %s does not exist!" % self.Opt.TOOL_DEFINITION_FILE, RaiseError=False)
-
- elif self.Opt.NUM >= 2:
- Line = "%-30s = %s\n" % (Key, 'Enable')
- elif self.Opt.NUM <= 1:
- Line = "%-30s = %s\n" % (Key, 'Disable')
- elif Key == TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER and self.Opt.NUM != None:
- Line = "%-30s = %s\n" % (Key, str(self.Opt.NUM))
- elif Key == TAB_TAT_DEFINES_TARGET and self.Opt.TARGET != None:
- Line = "%-30s = %s\n" % (Key, ''.join(elem + ' ' for elem in self.Opt.TARGET))
- elif Key == TAB_TAT_DEFINES_TARGET_ARCH and self.Opt.TARGET_ARCH != None:
- Line = "%-30s = %s\n" % (Key, ''.join(elem + ' ' for elem in self.Opt.TARGET_ARCH))
- elif Key == TAB_TAT_DEFINES_TOOL_CHAIN_TAG and self.Opt.TOOL_CHAIN_TAG != None:
- Line = "%-30s = %s\n" % (Key, self.Opt.TOOL_CHAIN_TAG)
- elif Key == TAB_TAT_DEFINES_BUILD_RULE_CONF and self.Opt.BUILD_RULE_FILE != None:
- buildruleFullPath = os.path.join(self.WorkSpace, self.Opt.BUILD_RULE_FILE)
- if os.path.exists(buildruleFullPath):
- Line = "%-30s = %s\n" % (Key, self.Opt.BUILD_RULE_FILE)
- else:
- EdkLogger.error("TagetTool", BuildToolError.FILE_NOT_FOUND,
- "Build rule file %s does not exist!" % self.Opt.BUILD_RULE_FILE, RaiseError=False)
- return Line
-
-VersionNumber = ("0.01" + " " + gBUILD_VERSION)
-__version__ = "%prog Version " + VersionNumber
-__copyright__ = "Copyright (c) 2007 - 2010, Intel Corporation All rights reserved."
-__usage__ = "%prog [options] {args} \
-\nArgs: \
-\n Clean clean the all default configuration of target.txt. \
-\n Print print the all default configuration of target.txt. \
-\n Set replace the default configuration with expected value specified by option."
-
-gParamCheck = []
-def SingleCheckCallback(option, opt_str, value, parser):
- if option not in gParamCheck:
- setattr(parser.values, option.dest, value)
- gParamCheck.append(option)
- else:
- parser.error("Option %s only allows one instance in command line!" % option)
-
-def RangeCheckCallback(option, opt_str, value, parser):
- if option not in gParamCheck:
- gParamCheck.append(option)
- if value < 1 or value > 8:
- parser.error("The count of multi-thread is not in valid range of 1 ~ 8.")
- else:
- setattr(parser.values, option.dest, value)
- else:
- parser.error("Option %s only allows one instance in command line!" % option)
-
-def MyOptionParser():
- parser = OptionParser(version=__version__,prog="TargetTool.exe",usage=__usage__,description=__copyright__)
- parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32','X64','IPF','EBC', 'ARM', 'AARCH64','0'], dest="TARGET_ARCH",
- help="ARCHS is one of list: IA32, X64, IPF, ARM, AARCH64 or EBC, which replaces target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option. 0 will clear this setting in target.txt and can't combine with other value.")
- parser.add_option("-p", "--platform", action="callback", type="string", dest="DSCFILE", callback=SingleCheckCallback,
- help="Specify a DSC file, which replace target.txt's ACTIVE_PLATFORM definition. 0 will clear this setting in target.txt and can't combine with other value.")
- parser.add_option("-c", "--tooldef", action="callback", type="string", dest="TOOL_DEFINITION_FILE", callback=SingleCheckCallback,
- help="Specify the WORKSPACE relative path of tool_def.txt file, which replace target.txt's TOOL_CHAIN_CONF definition. 0 will clear this setting in target.txt and can't combine with other value.")
- parser.add_option("-t", "--target", action="append", type="choice", choices=['DEBUG','RELEASE','0'], dest="TARGET",
- help="TARGET is one of list: DEBUG, RELEASE, which replaces target.txt's TARGET definition. To specify more TARGET, please repeat this option. 0 will clear this setting in target.txt and can't combine with other value.")
- parser.add_option("-n", "--tagname", action="callback", type="string", dest="TOOL_CHAIN_TAG", callback=SingleCheckCallback,
- help="Specify the Tool Chain Tagname, which replaces target.txt's TOOL_CHAIN_TAG definition. 0 will clear this setting in target.txt and can't combine with other value.")
- parser.add_option("-r", "--buildrule", action="callback", type="string", dest="BUILD_RULE_FILE", callback=SingleCheckCallback,
- help="Specify the build rule configure file, which replaces target.txt's BUILD_RULE_CONF definition. If not specified, the default value Conf/build_rule.txt will be set.")
- parser.add_option("-m", "--multithreadnum", action="callback", type="int", dest="NUM", callback=RangeCheckCallback,
- help="Specify the multi-thread number which replace target.txt's MAX_CONCURRENT_THREAD_NUMBER. If the value is less than 2, MULTIPLE_THREAD will be disabled. If the value is larger than 1, MULTIPLE_THREAD will be enabled.")
- (opt, args)=parser.parse_args()
- return (opt, args)
-
-if __name__ == '__main__':
- EdkLogger.Initialize()
- EdkLogger.SetLevel(EdkLogger.QUIET)
- if os.getenv('WORKSPACE') == None:
- print "ERROR: WORKSPACE should be specified or edksetup script should be executed before run TargetTool"
- sys.exit(1)
-
- (opt, args) = MyOptionParser()
- if len(args) != 1 or (args[0].lower() != 'print' and args[0].lower() != 'clean' and args[0].lower() != 'set'):
- print "The number of args isn't 1 or the value of args is invalid."
- sys.exit(1)
- if opt.NUM != None and opt.NUM < 1:
- print "The MAX_CONCURRENT_THREAD_NUMBER must be larger than 0."
- sys.exit(1)
- if opt.TARGET != None and len(opt.TARGET) > 1:
- for elem in opt.TARGET:
- if elem == '0':
- print "0 will clear the TARGET setting in target.txt and can't combine with other value."
- sys.exit(1)
- if opt.TARGET_ARCH != None and len(opt.TARGET_ARCH) > 1:
- for elem in opt.TARGET_ARCH:
- if elem == '0':
- print "0 will clear the TARGET_ARCH setting in target.txt and can't combine with other value."
- sys.exit(1)
-
- try:
- FileHandle = TargetTool(opt, args)
- if FileHandle.Arg.lower() == 'print':
- FileHandle.Print()
- sys.exit(0)
- elif FileHandle.Arg.lower() == 'clean':
- FileHandle.RWFile('#', '=', 0)
- else:
- FileHandle.RWFile('#', '=', 1)
- except Exception, e:
- last_type, last_value, last_tb = sys.exc_info()
- traceback.print_exception(last_type, last_value, last_tb)
-
diff --git a/BaseTools/Source/Python/TargetTool/__init__.py b/BaseTools/Source/Python/TargetTool/__init__.py
deleted file mode 100644
index 0187a7a74a..0000000000
--- a/BaseTools/Source/Python/TargetTool/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'TargetTool' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python/Trim/Trim.py
deleted file mode 100644
index 0416ecdcac..0000000000
--- a/BaseTools/Source/Python/Trim/Trim.py
+++ /dev/null
@@ -1,609 +0,0 @@
-## @file
-# Trim files preprocessed by compiler
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import sys
-import re
-
-from optparse import OptionParser
-from optparse import make_option
-from Common.BuildToolError import *
-from Common.Misc import *
-from Common.BuildVersion import gBUILD_VERSION
-import Common.EdkLogger as EdkLogger
-
-# Version and Copyright
-__version_number__ = ("0.10" + " " + gBUILD_VERSION)
-__version__ = "%prog Version " + __version_number__
-__copyright__ = "Copyright (c) 2007-2010, Intel Corporation. All rights reserved."
-
-## Regular expression for matching Line Control directive like "#line xxx"
-gLineControlDirective = re.compile('^\s*#(?:line)?\s+([0-9]+)\s+"*([^"]*)"')
-## Regular expression for matching "typedef struct"
-gTypedefPattern = re.compile("^\s*typedef\s+struct(\s+\w+)?\s*[{]*$", re.MULTILINE)
-## Regular expression for matching "#pragma pack"
-gPragmaPattern = re.compile("^\s*#pragma\s+pack", re.MULTILINE)
-
-#
-# The following number pattern match will only match if following criteria is met:
-# There is leading non-(alphanumeric or _) character, and no following alphanumeric or _
-# as the pattern is greedily match, so it is ok for the gDecNumberPattern or gHexNumberPattern to grab the maximum match
-#
-## Regular expression for matching HEX number
-gHexNumberPattern = re.compile("(?<=[^a-zA-Z0-9_])(0[xX])([0-9a-fA-F]+)(U(?=$|[^a-zA-Z0-9_]))?")
-## Regular expression for matching decimal number with 'U' postfix
-gDecNumberPattern = re.compile("(?<=[^a-zA-Z0-9_])([0-9]+)U(?=$|[^a-zA-Z0-9_])")
-## Regular expression for matching constant with 'ULL' 'LL' postfix
-gLongNumberPattern = re.compile("(?<=[^a-zA-Z0-9_])(0[xX][0-9a-fA-F]+|[0-9]+)U?LL(?=$|[^a-zA-Z0-9_])")
-
-## Regular expression for matching "Include ()" in asl file
-gAslIncludePattern = re.compile("^(\s*)[iI]nclude\s*\(\"?([^\"\(\)]+)\"\)", re.MULTILINE)
-## Regular expression for matching C style #include "XXX.asl" in asl file
-gAslCIncludePattern = re.compile(r'^(\s*)#include\s*[<"]\s*([-\\/\w.]+)\s*([>"])', re.MULTILINE)
-## Patterns used to convert EDK conventions to EDK2 ECP conventions
-gImportCodePatterns = [
- [
- re.compile('^(\s*)\(\*\*PeiServices\)\.PciCfg\s*=\s*([^;\s]+);', re.MULTILINE),
- '''\\1{
-\\1 STATIC EFI_PEI_PPI_DESCRIPTOR gEcpPeiPciCfgPpiList = {
-\\1 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
-\\1 &gEcpPeiPciCfgPpiGuid,
-\\1 \\2
-\\1 };
-\\1 (**PeiServices).InstallPpi (PeiServices, &gEcpPeiPciCfgPpiList);
-\\1}'''
- ],
-
- [
- re.compile('^(\s*)\(\*PeiServices\)->PciCfg\s*=\s*([^;\s]+);', re.MULTILINE),
- '''\\1{
-\\1 STATIC EFI_PEI_PPI_DESCRIPTOR gEcpPeiPciCfgPpiList = {
-\\1 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
-\\1 &gEcpPeiPciCfgPpiGuid,
-\\1 \\2
-\\1 };
-\\1 (**PeiServices).InstallPpi (PeiServices, &gEcpPeiPciCfgPpiList);
-\\1}'''
- ],
-
- [
- re.compile("(\s*).+->Modify[\s\n]*\(", re.MULTILINE),
- '\\1PeiLibPciCfgModify ('
- ],
-
- [
- re.compile("(\W*)gRT->ReportStatusCode[\s\n]*\(", re.MULTILINE),
- '\\1EfiLibReportStatusCode ('
- ],
-
- [
- re.compile('#include\s+EFI_GUID_DEFINITION\s*\(FirmwareFileSystem\)', re.MULTILINE),
- '#include EFI_GUID_DEFINITION (FirmwareFileSystem)\n#include EFI_GUID_DEFINITION (FirmwareFileSystem2)'
- ],
-
- [
- re.compile('gEfiFirmwareFileSystemGuid', re.MULTILINE),
- 'gEfiFirmwareFileSystem2Guid'
- ],
-
- [
- re.compile('EFI_FVH_REVISION', re.MULTILINE),
- 'EFI_FVH_PI_REVISION'
- ],
-
- [
- re.compile("(\s*)\S*CreateEvent\s*\([\s\n]*EFI_EVENT_SIGNAL_READY_TO_BOOT[^,]*,((?:[^;]+\n)+)(\s*\));", re.MULTILINE),
- '\\1EfiCreateEventReadyToBoot (\\2\\3;'
- ],
-
- [
- re.compile("(\s*)\S*CreateEvent\s*\([\s\n]*EFI_EVENT_SIGNAL_LEGACY_BOOT[^,]*,((?:[^;]+\n)+)(\s*\));", re.MULTILINE),
- '\\1EfiCreateEventLegacyBoot (\\2\\3;'
- ],
-# [
-# re.compile("(\W)(PEI_PCI_CFG_PPI)(\W)", re.MULTILINE),
-# '\\1ECP_\\2\\3'
-# ]
-]
-
-## file cache to avoid circular include in ASL file
-gIncludedAslFile = []
-
-## Trim preprocessed source code
-#
-# Remove extra content made by preprocessor. The preprocessor must enable the
-# line number generation option when preprocessing.
-#
-# @param Source File to be trimmed
-# @param Target File to store the trimmed content
-# @param Convert If True, convert standard HEX format to MASM format
-#
-def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
- CreateDirectory(os.path.dirname(Target))
- try:
- f = open (Source, 'r')
- except:
- EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
-
- # read whole file
- Lines = f.readlines()
- f.close()
-
- PreprocessedFile = ""
- InjectedFile = ""
- LineIndexOfOriginalFile = None
- NewLines = []
- LineControlDirectiveFound = False
- for Index in range(len(Lines)):
- Line = Lines[Index]
- #
- # Find out the name of files injected by preprocessor from the lines
- # with Line Control directive
- #
- MatchList = gLineControlDirective.findall(Line)
- if MatchList != []:
- MatchList = MatchList[0]
- if len(MatchList) == 2:
- LineNumber = int(MatchList[0], 0)
- InjectedFile = MatchList[1]
- # The first injetcted file must be the preprocessed file itself
- if PreprocessedFile == "":
- PreprocessedFile = InjectedFile
- LineControlDirectiveFound = True
- continue
- elif PreprocessedFile == "" or InjectedFile != PreprocessedFile:
- continue
-
- if LineIndexOfOriginalFile == None:
- #
- # Any non-empty lines must be from original preprocessed file.
- # And this must be the first one.
- #
- LineIndexOfOriginalFile = Index
- EdkLogger.verbose("Found original file content starting from line %d"
- % (LineIndexOfOriginalFile + 1))
-
- # convert HEX number format if indicated
- if ConvertHex:
- Line = gHexNumberPattern.sub(r"0\2h", Line)
- else:
- Line = gHexNumberPattern.sub(r"\1\2", Line)
- if TrimLong:
- Line = gLongNumberPattern.sub(r"\1", Line)
-
- # convert Decimal number format
- Line = gDecNumberPattern.sub(r"\1", Line)
-
- if LineNumber != None:
- EdkLogger.verbose("Got line directive: line=%d" % LineNumber)
- # in case preprocessor removed some lines, like blank or comment lines
- if LineNumber <= len(NewLines):
- # possible?
- NewLines[LineNumber - 1] = Line
- else:
- if LineNumber > (len(NewLines) + 1):
- for LineIndex in range(len(NewLines), LineNumber-1):
- NewLines.append(os.linesep)
- NewLines.append(Line)
- LineNumber = None
- EdkLogger.verbose("Now we have lines: %d" % len(NewLines))
- else:
- NewLines.append(Line)
-
- # in case there's no line directive or linemarker found
- if (not LineControlDirectiveFound) and NewLines == []:
- NewLines = Lines
-
- # save to file
- try:
- f = open (Target, 'wb')
- except:
- EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
- f.writelines(NewLines)
- f.close()
-
-## Trim preprocessed VFR file
-#
-# Remove extra content made by preprocessor. The preprocessor doesn't need to
-# enable line number generation option when preprocessing.
-#
-# @param Source File to be trimmed
-# @param Target File to store the trimmed content
-#
-def TrimPreprocessedVfr(Source, Target):
- CreateDirectory(os.path.dirname(Target))
-
- try:
- f = open (Source,'r')
- except:
- EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
- # read whole file
- Lines = f.readlines()
- f.close()
-
- FoundTypedef = False
- Brace = 0
- TypedefStart = 0
- TypedefEnd = 0
- for Index in range(len(Lines)):
- Line = Lines[Index]
- # don't trim the lines from "formset" definition to the end of file
- if Line.strip() == 'formset':
- break
-
- if FoundTypedef == False and (Line.find('#line') == 0 or Line.find('# ') == 0):
- # empty the line number directive if it's not aomong "typedef struct"
- Lines[Index] = "\n"
- continue
-
- if FoundTypedef == False and gTypedefPattern.search(Line) == None:
- # keep "#pragram pack" directive
- if gPragmaPattern.search(Line) == None:
- Lines[Index] = "\n"
- continue
- elif FoundTypedef == False:
- # found "typedef struct", keept its position and set a flag
- FoundTypedef = True
- TypedefStart = Index
-
- # match { and } to find the end of typedef definition
- if Line.find("{") >= 0:
- Brace += 1
- elif Line.find("}") >= 0:
- Brace -= 1
-
- # "typedef struct" must end with a ";"
- if Brace == 0 and Line.find(";") >= 0:
- FoundTypedef = False
- TypedefEnd = Index
- # keep all "typedef struct" except to GUID, EFI_PLABEL and PAL_CALL_RETURN
- if Line.strip("} ;\r\n") in ["GUID", "EFI_PLABEL", "PAL_CALL_RETURN"]:
- for i in range(TypedefStart, TypedefEnd+1):
- Lines[i] = "\n"
-
- # save all lines trimmed
- try:
- f = open (Target,'w')
- except:
- EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
- f.writelines(Lines)
- f.close()
-
-## Read the content ASL file, including ASL included, recursively
-#
-# @param Source File to be read
-# @param Indent Spaces before the Include() statement
-# @param IncludePathList The list of external include file
-# @param LocalSearchPath If LocalSearchPath is specified, this path will be searched
-# first for the included file; otherwise, only the path specified
-# in the IncludePathList will be searched.
-#
-def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
- NewFileContent = []
-
- try:
- #
- # Search LocalSearchPath first if it is specified.
- #
- if LocalSearchPath:
- SearchPathList = [LocalSearchPath] + IncludePathList
- else:
- SearchPathList = IncludePathList
-
- for IncludePath in SearchPathList:
- IncludeFile = os.path.join(IncludePath, Source)
- if os.path.isfile(IncludeFile):
- F = open(IncludeFile, "r")
- break
- else:
- EdkLogger.error("Trim", "Failed to find include file %s" % Source)
- except:
- EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
-
-
- # avoid A "include" B and B "include" A
- IncludeFile = os.path.abspath(os.path.normpath(IncludeFile))
- if IncludeFile in gIncludedAslFile:
- EdkLogger.warn("Trim", "Circular include",
- ExtraData= "%s -> %s" % (" -> ".join(gIncludedAslFile), IncludeFile))
- return []
- gIncludedAslFile.append(IncludeFile)
-
- for Line in F:
- LocalSearchPath = None
- Result = gAslIncludePattern.findall(Line)
- if len(Result) == 0:
- Result = gAslCIncludePattern.findall(Line)
- if len(Result) == 0 or os.path.splitext(Result[0][1])[1].lower() not in [".asl", ".asi"]:
- NewFileContent.append("%s%s" % (Indent, Line))
- continue
- #
- # We should first search the local directory if current file are using pattern #include "XXX"
- #
- if Result[0][2] == '"':
- LocalSearchPath = os.path.dirname(IncludeFile)
- CurrentIndent = Indent + Result[0][0]
- IncludedFile = Result[0][1]
- NewFileContent.extend(DoInclude(IncludedFile, CurrentIndent, IncludePathList, LocalSearchPath))
- NewFileContent.append("\n")
-
- gIncludedAslFile.pop()
- F.close()
-
- return NewFileContent
-
-
-## Trim ASL file
-#
-# Replace ASL include statement with the content the included file
-#
-# @param Source File to be trimmed
-# @param Target File to store the trimmed content
-# @param IncludePathFile The file to log the external include path
-#
-def TrimAslFile(Source, Target, IncludePathFile):
- CreateDirectory(os.path.dirname(Target))
-
- SourceDir = os.path.dirname(Source)
- if SourceDir == '':
- SourceDir = '.'
-
- #
- # Add source directory as the first search directory
- #
- IncludePathList = [SourceDir]
-
- #
- # If additional include path file is specified, append them all
- # to the search directory list.
- #
- if IncludePathFile:
- try:
- LineNum = 0
- for Line in open(IncludePathFile,'r'):
- LineNum += 1
- if Line.startswith("/I") or Line.startswith ("-I"):
- IncludePathList.append(Line[2:].strip())
- else:
- EdkLogger.warn("Trim", "Invalid include line in include list file.", IncludePathFile, LineNum)
- except:
- EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=IncludePathFile)
-
- Lines = DoInclude(Source, '', IncludePathList)
-
- #
- # Undef MIN and MAX to avoid collision in ASL source code
- #
- Lines.insert(0, "#undef MIN\n#undef MAX\n")
-
- # save all lines trimmed
- try:
- f = open (Target,'w')
- except:
- EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
-
- f.writelines(Lines)
- f.close()
-
-## Trim EDK source code file(s)
-#
-#
-# @param Source File or directory to be trimmed
-# @param Target File or directory to store the trimmed content
-#
-def TrimEdkSources(Source, Target):
- if os.path.isdir(Source):
- for CurrentDir, Dirs, Files in os.walk(Source):
- if '.svn' in Dirs:
- Dirs.remove('.svn')
- elif "CVS" in Dirs:
- Dirs.remove("CVS")
-
- for FileName in Files:
- Dummy, Ext = os.path.splitext(FileName)
- if Ext.upper() not in ['.C', '.H']: continue
- if Target == None or Target == '':
- TrimEdkSourceCode(
- os.path.join(CurrentDir, FileName),
- os.path.join(CurrentDir, FileName)
- )
- else:
- TrimEdkSourceCode(
- os.path.join(CurrentDir, FileName),
- os.path.join(Target, CurrentDir[len(Source)+1:], FileName)
- )
- else:
- TrimEdkSourceCode(Source, Target)
-
-## Trim one EDK source code file
-#
-# Do following replacement:
-#
-# (**PeiServices\).PciCfg = <*>;
-# => {
-# STATIC EFI_PEI_PPI_DESCRIPTOR gEcpPeiPciCfgPpiList = {
-# (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
-# &gEcpPeiPciCfgPpiGuid,
-# <*>
-# };
-# (**PeiServices).InstallPpi (PeiServices, &gEcpPeiPciCfgPpiList);
-#
-# <*>Modify(<*>)
-# => PeiLibPciCfgModify (<*>)
-#
-# gRT->ReportStatusCode (<*>)
-# => EfiLibReportStatusCode (<*>)
-#
-# #include <LoadFile\.h>
-# => #include <FvLoadFile.h>
-#
-# CreateEvent (EFI_EVENT_SIGNAL_READY_TO_BOOT, <*>)
-# => EfiCreateEventReadyToBoot (<*>)
-#
-# CreateEvent (EFI_EVENT_SIGNAL_LEGACY_BOOT, <*>)
-# => EfiCreateEventLegacyBoot (<*>)
-#
-# @param Source File to be trimmed
-# @param Target File to store the trimmed content
-#
-def TrimEdkSourceCode(Source, Target):
- EdkLogger.verbose("\t%s -> %s" % (Source, Target))
- CreateDirectory(os.path.dirname(Target))
-
- try:
- f = open (Source,'rb')
- except:
- EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
- # read whole file
- Lines = f.read()
- f.close()
-
- NewLines = None
- for Re,Repl in gImportCodePatterns:
- if NewLines == None:
- NewLines = Re.sub(Repl, Lines)
- else:
- NewLines = Re.sub(Repl, NewLines)
-
- # save all lines if trimmed
- if Source == Target and NewLines == Lines:
- return
-
- try:
- f = open (Target,'wb')
- except:
- EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
- f.write(NewLines)
- f.close()
-
-
-## Parse command line options
-#
-# Using standard Python module optparse to parse command line option of this tool.
-#
-# @retval Options A optparse.Values object containing the parsed options
-# @retval InputFile Path of file to be trimmed
-#
-def Options():
- OptionList = [
- make_option("-s", "--source-code", dest="FileType", const="SourceCode", action="store_const",
- help="The input file is preprocessed source code, including C or assembly code"),
- make_option("-r", "--vfr-file", dest="FileType", const="Vfr", action="store_const",
- help="The input file is preprocessed VFR file"),
- make_option("-a", "--asl-file", dest="FileType", const="Asl", action="store_const",
- help="The input file is ASL file"),
- make_option("-8", "--Edk-source-code", dest="FileType", const="EdkSourceCode", action="store_const",
- help="The input file is source code for Edk to be trimmed for ECP"),
-
- make_option("-c", "--convert-hex", dest="ConvertHex", action="store_true",
- help="Convert standard hex format (0xabcd) to MASM format (abcdh)"),
-
- make_option("-l", "--trim-long", dest="TrimLong", action="store_true",
- help="Remove postfix of long number"),
- make_option("-i", "--include-path-file", dest="IncludePathFile",
- help="The input file is include path list to search for ASL include file"),
- make_option("-o", "--output", dest="OutputFile",
- help="File to store the trimmed content"),
- make_option("-v", "--verbose", dest="LogLevel", action="store_const", const=EdkLogger.VERBOSE,
- help="Run verbosely"),
- make_option("-d", "--debug", dest="LogLevel", type="int",
- help="Run with debug information"),
- make_option("-q", "--quiet", dest="LogLevel", action="store_const", const=EdkLogger.QUIET,
- help="Run quietly"),
- make_option("-?", action="help", help="show this help message and exit"),
- ]
-
- # use clearer usage to override default usage message
- UsageString = "%prog [-s|-r|-a] [-c] [-v|-d <debug_level>|-q] [-i <include_path_file>] [-o <output_file>] <input_file>"
-
- Parser = OptionParser(description=__copyright__, version=__version__, option_list=OptionList, usage=UsageString)
- Parser.set_defaults(FileType="Vfr")
- Parser.set_defaults(ConvertHex=False)
- Parser.set_defaults(LogLevel=EdkLogger.INFO)
-
- Options, Args = Parser.parse_args()
-
- # error check
- if len(Args) == 0:
- EdkLogger.error("Trim", OPTION_MISSING, ExtraData=Parser.get_usage())
- if len(Args) > 1:
- EdkLogger.error("Trim", OPTION_NOT_SUPPORTED, ExtraData=Parser.get_usage())
-
- InputFile = Args[0]
- return Options, InputFile
-
-## Entrance method
-#
-# This method mainly dispatch specific methods per the command line options.
-# If no error found, return zero value so the caller of this tool can know
-# if it's executed successfully or not.
-#
-# @retval 0 Tool was successful
-# @retval 1 Tool failed
-#
-def Main():
- try:
- EdkLogger.Initialize()
- CommandOptions, InputFile = Options()
- if CommandOptions.LogLevel < EdkLogger.DEBUG_9:
- EdkLogger.SetLevel(CommandOptions.LogLevel + 1)
- else:
- EdkLogger.SetLevel(CommandOptions.LogLevel)
- except FatalError, X:
- return 1
-
- try:
- if CommandOptions.FileType == "Vfr":
- if CommandOptions.OutputFile == None:
- CommandOptions.OutputFile = os.path.splitext(InputFile)[0] + '.iii'
- TrimPreprocessedVfr(InputFile, CommandOptions.OutputFile)
- elif CommandOptions.FileType == "Asl":
- if CommandOptions.OutputFile == None:
- CommandOptions.OutputFile = os.path.splitext(InputFile)[0] + '.iii'
- TrimAslFile(InputFile, CommandOptions.OutputFile, CommandOptions.IncludePathFile)
- elif CommandOptions.FileType == "EdkSourceCode":
- TrimEdkSources(InputFile, CommandOptions.OutputFile)
- else :
- if CommandOptions.OutputFile == None:
- CommandOptions.OutputFile = os.path.splitext(InputFile)[0] + '.iii'
- TrimPreprocessedFile(InputFile, CommandOptions.OutputFile, CommandOptions.ConvertHex, CommandOptions.TrimLong)
- except FatalError, X:
- import platform
- import traceback
- if CommandOptions != None and CommandOptions.LogLevel <= EdkLogger.DEBUG_9:
- EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
- return 1
- except:
- import traceback
- import platform
- EdkLogger.error(
- "\nTrim",
- CODE_ERROR,
- "Unknown fatal error when trimming [%s]" % InputFile,
- ExtraData="\n(Please send email to edk2-buildtools-devel@lists.sourceforge.net for help, attaching following call stack trace!)\n",
- RaiseError=False
- )
- EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
- return 1
-
- return 0
-
-if __name__ == '__main__':
- r = Main()
- ## 0-127 is a safe return range, and 1 is a standard default error
- if r < 0 or r > 127: r = 1
- sys.exit(r)
-
diff --git a/BaseTools/Source/Python/UPT/BuildVersion.py b/BaseTools/Source/Python/UPT/BuildVersion.py
deleted file mode 100644
index edd4696753..0000000000
--- a/BaseTools/Source/Python/UPT/BuildVersion.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-#
-# This file is for build version number auto generation
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Build version information
-'''
-
-gBUILD_VERSION = ""
diff --git a/BaseTools/Source/Python/UPT/Core/DependencyRules.py b/BaseTools/Source/Python/UPT/Core/DependencyRules.py
deleted file mode 100644
index 752d8e8f41..0000000000
--- a/BaseTools/Source/Python/UPT/Core/DependencyRules.py
+++ /dev/null
@@ -1,293 +0,0 @@
-## @file
-# This file is for installed package information database operations
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Dependency
-'''
-
-##
-# Import Modules
-#
-from os import getenv
-from os import environ
-from os.path import dirname
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Library.Parsing import GetWorkspacePackage
-from Library.Parsing import GetWorkspaceModule
-from PomAdapter.InfPomAlignment import InfPomAlignment
-from Logger.ToolError import FatalError
-from Logger.ToolError import EDK1_INF_ERROR
-from Logger.ToolError import UNKNOWN_ERROR
-(DEPEX_CHECK_SUCCESS, DEPEX_CHECK_MODULE_NOT_FOUND, \
-DEPEX_CHECK_PACKAGE_NOT_FOUND, DEPEX_CHECK_DP_NOT_FOUND) = (0, 1, 2, 3)
-
-
-## IpiDb
-#
-# This class represents the installed package information database
-# Add/Remove/Get installed distribution package information here.
-#
-#
-# @param object: Inherited from object class
-#
-class DependencyRules(object):
- def __init__(self, Datab):
- self.IpiDb = Datab
- self.WsPkgList = GetWorkspacePackage()
- self.WsModuleList = GetWorkspaceModule()
-
- ## Check whether a module exists in current workspace.
- #
- # @param Guid: Guid of a module
- # @param Version: Version of a module
- #
- def CheckModuleExists(self, Guid, Version, Name, Path, ReturnCode=DEPEX_CHECK_SUCCESS):
- if ReturnCode:
- pass
- Logger.Verbose(ST.MSG_CHECK_MODULE_EXIST)
- ModuleList = self.IpiDb.GetModInPackage(Guid, Version, Name, Path)
- ModuleList.extend(self.IpiDb.GetStandaloneModule(Guid, Version, Name, Path))
- Logger.Verbose(ST.MSG_CHECK_MODULE_EXIST_FINISH)
- if len(ModuleList) > 0:
- return True
- else:
- return False
-
- ## Check whether a module depex satisfied by current workspace or dist.
- #
- # @param ModuleObj: A module object
- # @param DpObj: A depex object
- #
- def CheckModuleDepexSatisfied(self, ModuleObj, DpObj=None, \
- ReturnCode=DEPEX_CHECK_SUCCESS):
- if ReturnCode:
- pass
- Logger.Verbose(ST.MSG_CHECK_MODULE_DEPEX_START)
- Result = True
- Dep = None
- if ModuleObj.GetPackageDependencyList():
- Dep = ModuleObj.GetPackageDependencyList()[0]
- for Dep in ModuleObj.GetPackageDependencyList():
- #
- # first check whether the dependency satisfied by current workspace
- #
- Exist = self.CheckPackageExists(Dep.GetGuid(), Dep.GetVersion())
- #
- # check whether satisfied by current distribution
- #
- if not Exist:
- if DpObj == None:
- Result = False
- break
- for GuidVerPair in DpObj.PackageSurfaceArea.keys():
- if Dep.GetGuid() == GuidVerPair[0]:
- if Dep.GetVersion() == None or \
- len(Dep.GetVersion()) == 0:
- Result = True
- break
- if Dep.GetVersion() == GuidVerPair[1]:
- Result = True
- break
- else:
- Result = False
- break
-
- if not Result:
- Logger.Error("CheckModuleDepex", UNKNOWN_ERROR, \
- ST.ERR_DEPENDENCY_NOT_MATCH % (ModuleObj.GetName(), \
- Dep.GetPackageFilePath(), \
- Dep.GetGuid(), \
- Dep.GetVersion()))
- return Result
-
- ## Check whether a package exists in current workspace.
- #
- # @param Guid: Guid of a package
- # @param Version: Version of a package
- #
- def CheckPackageExists(self, Guid, Version):
- Logger.Verbose(ST.MSG_CHECK_PACKAGE_START)
- for (PkgName, PkgGuid, PkgVer, PkgPath) in self.WsPkgList:
- if PkgName or PkgPath:
- pass
- if (PkgGuid == Guid):
- #
- # if version is not empty and not equal, then not match
- #
- if Version and (PkgVer != Version):
- return False
- else:
- return True
- else:
- return False
-
- Logger.Verbose(ST.MSG_CHECK_PACKAGE_FINISH)
-
- ## Check whether a package depex satisfied by current workspace.
- #
- # @param PkgObj: A package object
- # @param DpObj: A package depex object
- #
- def CheckPackageDepexSatisfied(self, PkgObj, DpObj=None, \
- ReturnCode=DEPEX_CHECK_SUCCESS):
-
- ModuleDict = PkgObj.GetModuleDict()
- for ModKey in ModuleDict.keys():
- ModObj = ModuleDict[ModKey]
- if self.CheckModuleDepexSatisfied(ModObj, DpObj, ReturnCode):
- continue
- else:
- return False
- return True
-
- ## Check whether a DP exists in current workspace.
- #
- # @param Guid: Guid of a module
- # @param Version: Version of a module
- #
- def CheckDpExists(self, Guid, Version, ReturnCode=DEPEX_CHECK_SUCCESS):
- if ReturnCode:
- pass
- Logger.Verbose(ST.MSG_CHECK_DP_START)
- DpList = self.IpiDb.GetDp(Guid, Version)
- if len(DpList) > 0:
- return True
- else:
- return False
-
- Logger.Verbose(ST.MSG_CHECK_DP_FINISH)
-
- ## Check whether a DP depex satisfied by current workspace.
- #
- # @param DpObj: Depex object
- # @param ReturnCode: ReturnCode
- #
- def CheckDpDepexSatisfied(self, DpObj, ReturnCode=DEPEX_CHECK_SUCCESS):
-
- for PkgKey in DpObj.PackageSurfaceArea.keys():
- PkgObj = DpObj.PackageSurfaceArea[PkgKey]
- if self.CheckPackageDepexSatisfied(PkgObj, DpObj, ReturnCode):
- continue
- else:
- return False
-
- for ModKey in DpObj.ModuleSurfaceArea.keys():
- ModObj = DpObj.ModuleSurfaceArea[ModKey]
- if self.CheckModuleDepexSatisfied(ModObj, DpObj, ReturnCode):
- continue
- else:
- return False
-
- return True
-
- ## Check whether a DP depex satisfied by current workspace. Return False
- # if Can not remove (there is dependency), True else
- #
- # @param DpGuid: File's guid
- # @param DpVersion: File's version
- # @param ReturnCode: ReturnCode
- #
- def CheckDpDepexForRemove(self, DpGuid, DpVersion, \
- ReturnCode=DEPEX_CHECK_SUCCESS):
- if ReturnCode:
- pass
- Removable = True
- DependModuleList = []
- WsModuleList = self.WsModuleList
- #
- # remove modules that included in current DP
- # List of item (FilePath)
- DpModuleList = self.IpiDb.GetDpModuleList(DpGuid, DpVersion)
- for Module in DpModuleList:
- if Module in WsModuleList:
- WsModuleList.remove(Module)
- else:
- Logger.Warn("UPT\n",
- ST.ERR_MODULE_NOT_INSTALLED % Module)
- #
- # get packages in current Dp and find the install path
- # List of item (PkgGuid, PkgVersion, InstallPath)
- DpPackageList = self.IpiDb.GetPackageListFromDp(DpGuid, DpVersion)
- DpPackagePathList = []
- WorkSP = environ["WORKSPACE"]
- for (PkgName, PkgGuid, PkgVersion, DecFile) in self.WsPkgList:
- if PkgName:
- pass
- DecPath = dirname(DecFile)
- if DecPath.find(WorkSP) > -1:
- InstallPath = DecPath[DecPath.find(WorkSP) + len(WorkSP) + 1:]
- DecFileRelaPath = \
- DecFile[DecFile.find(WorkSP) + len(WorkSP) + 1:]
- else:
- InstallPath = DecPath
- DecFileRelaPath = DecFile
-
- if (PkgGuid, PkgVersion, InstallPath) in DpPackageList:
- DpPackagePathList.append(DecFileRelaPath)
- DpPackageList.remove((PkgGuid, PkgVersion, InstallPath))
-
- #
- # the left items in DpPackageList are the packages that installed but not found anymore
- #
- for (PkgGuid, PkgVersion, InstallPath) in DpPackageList:
- Logger.Warn("UPT",
- ST.WARN_INSTALLED_PACKAGE_NOT_FOUND%(PkgGuid, PkgVersion, InstallPath))
-
- #
- # check modules to see if has dependency on package of current DP
- #
- for Module in WsModuleList:
- if (CheckModuleDependFromInf(Module, DpPackagePathList)):
- Removable = False
- DependModuleList.append(Module)
- return (Removable, DependModuleList)
-
-
-## check whether module depends on packages in DpPackagePathList, return True
-# if found, False else
-#
-# @param Path: a module path
-# @param DpPackagePathList: a list of Package Paths
-#
-def CheckModuleDependFromInf(Path, DpPackagePathList):
-
- #
- # use InfParser to parse inf, then get the information for now,
- # later on, may consider only parse to get the package dependency info
- # (Need to take care how to deal wit Macros)
- #
- WorkSP = getenv('WORKSPACE')
-
- try:
- PomAli = InfPomAlignment(Path, WorkSP, Skip=True)
-
- for Item in PomAli.GetPackageDependencyList():
- if Item.GetPackageFilePath() in DpPackagePathList:
- Logger.Info(ST.MSG_MODULE_DEPEND_ON % (Path, Item.GetPackageFilePath()))
- return True
- else:
- return False
- except FatalError, ErrCode:
- if ErrCode.message == EDK1_INF_ERROR:
- Logger.Warn("UPT",
- ST.WRN_EDK1_INF_FOUND%Path)
- return False
- else:
- return False
-
-
-
diff --git a/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py b/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py
deleted file mode 100644
index 8ac8d4ed52..0000000000
--- a/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py
+++ /dev/null
@@ -1,230 +0,0 @@
-## @file
-# This file is used to define a class object to describe a distribution package
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-DistributionPackageClass
-'''
-
-##
-# Import Modules
-#
-import os.path
-
-from Library.Misc import Sdict
-from Library.Misc import GetNonMetaDataFiles
-from PomAdapter.InfPomAlignment import InfPomAlignment
-from PomAdapter.DecPomAlignment import DecPomAlignment
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import OPTION_VALUE_INVALID
-from Logger.ToolError import FatalError
-from Logger.ToolError import EDK1_INF_ERROR
-from Object.POM.CommonObject import IdentificationObject
-from Object.POM.CommonObject import CommonHeaderObject
-from Object.POM.CommonObject import MiscFileObject
-
-## DistributionPackageHeaderClass
-#
-# @param IdentificationObject: Identification Object
-# @param CommonHeaderObject: Common Header Object
-#
-class DistributionPackageHeaderObject(IdentificationObject, \
- CommonHeaderObject):
- def __init__(self):
- IdentificationObject.__init__(self)
- CommonHeaderObject.__init__(self)
- self.ReadOnly = ''
- self.RePackage = ''
- self.Vendor = ''
- self.Date = ''
- self.Signature = 'Md5Sum'
- self.XmlSpecification = ''
-
- def GetReadOnly(self):
- return self.ReadOnly
-
- def SetReadOnly(self, ReadOnly):
- self.ReadOnly = ReadOnly
-
- def GetRePackage(self):
- return self.RePackage
-
- def SetRePackage(self, RePackage):
- self.RePackage = RePackage
-
- def GetVendor(self):
- return self.Vendor
-
- def SetDate(self, Date):
- self.Date = Date
-
- def GetDate(self):
- return self.Date
-
- def SetSignature(self, Signature):
- self.Signature = Signature
-
- def GetSignature(self):
- return self.Signature
-
- def SetXmlSpecification(self, XmlSpecification):
- self.XmlSpecification = XmlSpecification
-
- def GetXmlSpecification(self):
- return self.XmlSpecification
-
-## DistributionPackageClass
-#
-# @param object: DistributionPackageClass
-#
-class DistributionPackageClass(object):
- def __init__(self):
- self.Header = DistributionPackageHeaderObject()
- #
- # {(Guid, Version, Path) : PackageObj}
- #
- self.PackageSurfaceArea = Sdict()
- #
- # {(Guid, Version, Name, Path) : ModuleObj}
- #
- self.ModuleSurfaceArea = Sdict()
- self.Tools = MiscFileObject()
- self.MiscellaneousFiles = MiscFileObject()
- self.UserExtensions = []
- self.FileList = []
-
- ## Get all included packages and modules for a distribution package
- #
- # @param WorkspaceDir: WorkspaceDir
- # @param PackageList: A list of all packages
- # @param ModuleList: A list of all modules
- #
- def GetDistributionPackage(self, WorkspaceDir, PackageList, ModuleList):
- #
- # Get Packages
- #
- if PackageList:
- for PackageFile in PackageList:
- PackageFileFullPath = \
- os.path.normpath(os.path.join(WorkspaceDir, PackageFile))
- DecObj = DecPomAlignment(PackageFileFullPath, WorkspaceDir, CheckMulDec = True)
- PackageObj = DecObj
- #
- # Parser inf file one bye one
- #
- ModuleInfFileList = PackageObj.GetModuleFileList()
- for File in ModuleInfFileList:
- WsRelPath = os.path.join(PackageObj.GetPackagePath(), File)
- WsRelPath = os.path.normpath(WsRelPath)
- if ModuleList and WsRelPath in ModuleList:
- Logger.Error("UPT",
- OPTION_VALUE_INVALID,
- ST.ERR_NOT_STANDALONE_MODULE_ERROR%\
- (WsRelPath, PackageFile))
- Filename = os.path.normpath\
- (os.path.join(PackageObj.GetRelaPath(), File))
- os.path.splitext(Filename)
- #
- # Call INF parser to generate Inf Object.
- # Actually, this call is not directly call, but wrapped by
- # Inf class in InfPomAlignment.
- #
- try:
- ModuleObj = InfPomAlignment(Filename, WorkspaceDir, \
- PackageObj.GetPackagePath())
-
- #
- # Add module to package
- #
- ModuleDict = PackageObj.GetModuleDict()
- ModuleDict[(ModuleObj.GetGuid(), \
- ModuleObj.GetVersion(), \
- ModuleObj.GetName(), \
- ModuleObj.GetCombinePath())] = ModuleObj
- PackageObj.SetModuleDict(ModuleDict)
- except FatalError, ErrCode:
- if ErrCode.message == EDK1_INF_ERROR:
- Logger.Warn("UPT",
- ST.WRN_EDK1_INF_FOUND%Filename)
- else:
- raise
-
- self.PackageSurfaceArea\
- [(PackageObj.GetGuid(), PackageObj.GetVersion(), \
- PackageObj.GetCombinePath())] = PackageObj
-
- #
- # Get Modules
- #
- if ModuleList:
- for ModuleFile in ModuleList:
- ModuleFileFullPath = \
- os.path.normpath(os.path.join(WorkspaceDir, ModuleFile))
- try:
- ModuleObj = InfPomAlignment(ModuleFileFullPath,
- WorkspaceDir)
- ModuleKey = (ModuleObj.GetGuid(),
- ModuleObj.GetVersion(),
- ModuleObj.GetName(),
- ModuleObj.GetCombinePath())
- self.ModuleSurfaceArea[ModuleKey] = ModuleObj
- except FatalError, ErrCode:
- if ErrCode.message == EDK1_INF_ERROR:
- Logger.Error("UPT",
- EDK1_INF_ERROR,
- ST.WRN_EDK1_INF_FOUND%ModuleFileFullPath,
- ExtraData=ST.ERR_NOT_SUPPORTED_SA_MODULE)
- else:
- raise
-
- ## Get all files included for a distribution package, except tool/misc of
- # distribution level
- #
- # @retval DistFileList A list of filepath for NonMetaDataFile, relative to workspace
- # @retval MetaDataFileList A list of filepath for MetaDataFile, relative to workspace
- #
- def GetDistributionFileList(self):
- MetaDataFileList = []
-
- for Guid, Version, Path in self.PackageSurfaceArea:
- Package = self.PackageSurfaceArea[Guid, Version, Path]
- PackagePath = Package.GetPackagePath()
- FullPath = Package.GetFullPath()
- MetaDataFileList.append(Path)
- IncludePathList = Package.GetIncludePathList()
- for IncludePath in IncludePathList:
- SearchPath = os.path.normpath(os.path.join(os.path.dirname(FullPath), IncludePath))
- AddPath = os.path.normpath(os.path.join(PackagePath, IncludePath))
- self.FileList += GetNonMetaDataFiles(SearchPath, ['CVS', '.svn'], False, AddPath)
-
- Module = None
- ModuleDict = Package.GetModuleDict()
- for Guid, Version, Name, Path in ModuleDict:
- Module = ModuleDict[Guid, Version, Name, Path]
- ModulePath = Module.GetModulePath()
- FullPath = Module.GetFullPath()
- PkgRelPath = os.path.normpath(os.path.join(PackagePath, ModulePath))
- MetaDataFileList.append(Path)
- self.FileList += GetNonMetaDataFiles(os.path.dirname(FullPath), ['CVS', '.svn'], False, PkgRelPath)
-
- for Guid, Version, Name, Path in self.ModuleSurfaceArea:
- Module = self.ModuleSurfaceArea[Guid, Version, Name, Path]
- ModulePath = Module.GetModulePath()
- FullPath = Module.GetFullPath()
- MetaDataFileList.append(Path)
- self.FileList += GetNonMetaDataFiles(os.path.dirname(FullPath), ['CVS', '.svn'], False, ModulePath)
-
- return self.FileList, MetaDataFileList
-
-
-
diff --git a/BaseTools/Source/Python/UPT/Core/IpiDb.py b/BaseTools/Source/Python/UPT/Core/IpiDb.py
deleted file mode 100644
index e45acb7d48..0000000000
--- a/BaseTools/Source/Python/UPT/Core/IpiDb.py
+++ /dev/null
@@ -1,887 +0,0 @@
-## @file
-# This file is for installed package information database operations
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-IpiDb
-'''
-
-##
-# Import Modules
-#
-import sqlite3
-import os.path
-import time
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import UPT_ALREADY_RUNNING_ERROR
-from Logger.ToolError import UPT_DB_UPDATE_ERROR
-
-## IpiDb
-#
-# This class represents the installed package information database
-# Add/Remove/Get installed distribution package information here.
-#
-#
-# @param object: Inherited from object class
-# @param DbPath: A string for the path of the database
-#
-#
-class IpiDatabase(object):
- def __init__(self, DbPath):
- Dir = os.path.dirname(DbPath)
- if not os.path.isdir(Dir):
- os.mkdir(Dir)
- self.Conn = sqlite3.connect(DbPath, isolation_level='DEFERRED')
- self.Conn.execute("PRAGMA page_size=4096")
- self.Conn.execute("PRAGMA synchronous=OFF")
- self.Cur = self.Conn.cursor()
- self.DpTable = 'DpInfo'
- self.PkgTable = 'PkgInfo'
- self.ModInPkgTable = 'ModInPkgInfo'
- self.StandaloneModTable = 'StandaloneModInfo'
- self.ModDepexTable = 'ModDepexInfo'
- self.DpFileListTable = 'DpFileListInfo'
- self.DummyTable = 'Dummy'
-
- ## Initialize build database
- #
- #
- def InitDatabase(self, SkipLock = False):
- Logger.Verbose(ST.MSG_INIT_IPI_START)
- if not SkipLock:
- try:
- #
- # Create a dummy table, if already existed,
- # then UPT is already running
- #
- SqlCommand = """
- create table %s (
- Dummy TEXT NOT NULL,
- PRIMARY KEY (Dummy)
- )""" % self.DummyTable
- self.Cur.execute(SqlCommand)
- self.Conn.commit()
- except sqlite3.OperationalError:
- Logger.Error("UPT",
- UPT_ALREADY_RUNNING_ERROR,
- ST.ERR_UPT_ALREADY_RUNNING_ERROR
- )
-
- #
- # Create new table
- #
- SqlCommand = """
- create table IF NOT EXISTS %s (
- DpGuid TEXT NOT NULL,DpVersion TEXT NOT NULL,
- InstallTime REAL NOT NULL,
- NewPkgFileName TEXT NOT NULL,
- PkgFileName TEXT NOT NULL,
- RePackage TEXT NOT NULL,
- PRIMARY KEY (DpGuid, DpVersion)
- )""" % self.DpTable
- self.Cur.execute(SqlCommand)
-
- SqlCommand = """
- create table IF NOT EXISTS %s (
- FilePath TEXT NOT NULL,
- DpGuid TEXT,
- DpVersion TEXT,
- Md5Sum TEXT,
- PRIMARY KEY (FilePath)
- )""" % self.DpFileListTable
- self.Cur.execute(SqlCommand)
-
- SqlCommand = """
- create table IF NOT EXISTS %s (
- PackageGuid TEXT NOT NULL,
- PackageVersion TEXT NOT NULL,
- InstallTime REAL NOT NULL,
- DpGuid TEXT,
- DpVersion TEXT,
- InstallPath TEXT NOT NULL,
- PRIMARY KEY (PackageGuid, PackageVersion, InstallPath)
- )""" % self.PkgTable
- self.Cur.execute(SqlCommand)
-
- SqlCommand = """
- create table IF NOT EXISTS %s (
- ModuleGuid TEXT NOT NULL,
- ModuleVersion TEXT NOT NULL,
- ModuleName TEXT NOT NULL,
- InstallTime REAL NOT NULL,
- PackageGuid TEXT,
- PackageVersion TEXT,
- InstallPath TEXT NOT NULL,
- PRIMARY KEY (ModuleGuid, ModuleVersion, ModuleName, InstallPath)
- )""" % self.ModInPkgTable
- self.Cur.execute(SqlCommand)
-
- SqlCommand = """
- create table IF NOT EXISTS %s (
- ModuleGuid TEXT NOT NULL,
- ModuleVersion TEXT NOT NULL,
- ModuleName TEXT NOT NULL,
- InstallTime REAL NOT NULL,
- DpGuid TEXT,
- DpVersion TEXT,
- InstallPath TEXT NOT NULL,
- PRIMARY KEY (ModuleGuid, ModuleVersion, ModuleName, InstallPath)
- )""" % self.StandaloneModTable
- self.Cur.execute(SqlCommand)
-
- SqlCommand = """
- create table IF NOT EXISTS %s (
- ModuleGuid TEXT NOT NULL,
- ModuleVersion TEXT NOT NULL,
- ModuleName TEXT NOT NULL,
- InstallPath TEXT NOT NULL,
- DepexGuid TEXT,
- DepexVersion TEXT
- )""" % self.ModDepexTable
- self.Cur.execute(SqlCommand)
-
- self.Conn.commit()
-
- Logger.Verbose(ST.MSG_INIT_IPI_FINISH)
-
- ## Add a distribution install information from DpObj
- #
- # @param DpObj:
- # @param NewDpPkgFileName: New DpPkg File Name
- # @param DpPkgFileName: DpPkg File Name
- # @param RePackage: A RePackage
- #
- def AddDPObject(self, DpObj, NewDpPkgFileName, DpPkgFileName, RePackage):
- try:
- for PkgKey in DpObj.PackageSurfaceArea.keys():
- PkgGuid = PkgKey[0]
- PkgVersion = PkgKey[1]
- PkgInstallPath = PkgKey[2]
- self._AddPackage(PkgGuid, PkgVersion, DpObj.Header.GetGuid(), \
- DpObj.Header.GetVersion(), PkgInstallPath)
- PkgObj = DpObj.PackageSurfaceArea[PkgKey]
- for ModKey in PkgObj.GetModuleDict().keys():
- ModGuid = ModKey[0]
- ModVersion = ModKey[1]
- ModName = ModKey[2]
- ModInstallPath = ModKey[3]
- ModInstallPath = \
- os.path.normpath(os.path.join(PkgInstallPath, ModInstallPath))
- self._AddModuleInPackage(ModGuid, ModVersion, ModName, PkgGuid, \
- PkgVersion, ModInstallPath)
- ModObj = PkgObj.GetModuleDict()[ModKey]
- for Dep in ModObj.GetPackageDependencyList():
- DepexGuid = Dep.GetGuid()
- DepexVersion = Dep.GetVersion()
- self._AddModuleDepex(ModGuid, ModVersion, ModName, ModInstallPath, \
- DepexGuid, DepexVersion)
- for (FilePath, Md5Sum) in PkgObj.FileList:
- self._AddDpFilePathList(DpObj.Header.GetGuid(), \
- DpObj.Header.GetVersion(), FilePath, \
- Md5Sum)
-
- for ModKey in DpObj.ModuleSurfaceArea.keys():
- ModGuid = ModKey[0]
- ModVersion = ModKey[1]
- ModName = ModKey[2]
- ModInstallPath = ModKey[3]
- self._AddStandaloneModule(ModGuid, ModVersion, ModName, \
- DpObj.Header.GetGuid(), \
- DpObj.Header.GetVersion(), \
- ModInstallPath)
- ModObj = DpObj.ModuleSurfaceArea[ModKey]
- for Dep in ModObj.GetPackageDependencyList():
- DepexGuid = Dep.GetGuid()
- DepexVersion = Dep.GetVersion()
- self._AddModuleDepex(ModGuid, ModVersion, ModName, ModInstallPath, \
- DepexGuid, DepexVersion)
- for (Path, Md5Sum) in ModObj.FileList:
- self._AddDpFilePathList(DpObj.Header.GetGuid(), \
- DpObj.Header.GetVersion(), \
- Path, Md5Sum)
-
- #
- # add tool/misc files
- #
- for (Path, Md5Sum) in DpObj.FileList:
- self._AddDpFilePathList(DpObj.Header.GetGuid(), \
- DpObj.Header.GetVersion(), Path, Md5Sum)
-
- self._AddDp(DpObj.Header.GetGuid(), DpObj.Header.GetVersion(), \
- NewDpPkgFileName, DpPkgFileName, RePackage)
-
- self.Conn.commit()
- except sqlite3.IntegrityError, DetailMsg:
- Logger.Error("UPT",
- UPT_DB_UPDATE_ERROR,
- ST.ERR_UPT_DB_UPDATE_ERROR,
- ExtraData = DetailMsg
- )
-
- ## Add a distribution install information
- #
- # @param Guid Guid of the distribution package
- # @param Version Version of the distribution package
- # @param NewDpFileName the saved filename of distribution package file
- # @param DistributionFileName the filename of distribution package file
- #
- def _AddDp(self, Guid, Version, NewDpFileName, DistributionFileName, \
- RePackage):
-
- if Version == None or len(Version.strip()) == 0:
- Version = 'N/A'
-
- #
- # Add newly installed DP information to DB.
- #
- if NewDpFileName == None or len(NewDpFileName.strip()) == 0:
- PkgFileName = 'N/A'
- else:
- PkgFileName = NewDpFileName
- CurrentTime = time.time()
- SqlCommand = \
- """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" % \
- (self.DpTable, Guid, Version, CurrentTime, PkgFileName, \
- DistributionFileName, str(RePackage).upper())
- self.Cur.execute(SqlCommand)
-
-
- ## Add a file list from DP
- #
- # @param DpGuid: A DpGuid
- # @param DpVersion: A DpVersion
- # @param Path: A Path
- # @param Path: A Md5Sum
- #
- def _AddDpFilePathList(self, DpGuid, DpVersion, Path, Md5Sum):
-
- SqlCommand = """insert into %s values('%s', '%s', '%s', '%s')""" % \
- (self.DpFileListTable, Path, DpGuid, DpVersion, Md5Sum)
-
- self.Cur.execute(SqlCommand)
-
- ## Add a package install information
- #
- # @param Guid: A package guid
- # @param Version: A package version
- # @param DpGuid: A DpGuid
- # @param DpVersion: A DpVersion
- # @param Path: A Path
- #
- def _AddPackage(self, Guid, Version, DpGuid=None, DpVersion=None, Path=''):
-
- if Version == None or len(Version.strip()) == 0:
- Version = 'N/A'
-
- if DpGuid == None or len(DpGuid.strip()) == 0:
- DpGuid = 'N/A'
-
- if DpVersion == None or len(DpVersion.strip()) == 0:
- DpVersion = 'N/A'
-
- #
- # Add newly installed package information to DB.
- #
- CurrentTime = time.time()
- SqlCommand = \
- """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" % \
- (self.PkgTable, Guid, Version, CurrentTime, DpGuid, DpVersion, Path)
- self.Cur.execute(SqlCommand)
-
- ## Add a module that from a package install information
- #
- # @param Guid: Module Guid
- # @param Version: Module version
- # @param Name: Module Name
- # @param PkgGuid: Package Guid
- # @param PkgVersion: Package version
- # @param Path: Package relative path that module installs
- #
- def _AddModuleInPackage(self, Guid, Version, Name, PkgGuid=None, \
- PkgVersion=None, Path=''):
-
- if Version == None or len(Version.strip()) == 0:
- Version = 'N/A'
-
- if PkgGuid == None or len(PkgGuid.strip()) == 0:
- PkgGuid = 'N/A'
-
- if PkgVersion == None or len(PkgVersion.strip()) == 0:
- PkgVersion = 'N/A'
-
- #
- # Add module from package information to DB.
- #
- CurrentTime = time.time()
- SqlCommand = \
- """insert into %s values('%s', '%s', '%s', %s, '%s', '%s', '%s')""" % \
- (self.ModInPkgTable, Guid, Version, Name, CurrentTime, PkgGuid, PkgVersion, \
- Path)
- self.Cur.execute(SqlCommand)
-
- ## Add a module that is standalone install information
- #
- # @param Guid: a module Guid
- # @param Version: a module Version
- # @param Name: a module name
- # @param DpGuid: a DpGuid
- # @param DpVersion: a DpVersion
- # @param Path: path
- #
- def _AddStandaloneModule(self, Guid, Version, Name, DpGuid=None, \
- DpVersion=None, Path=''):
-
- if Version == None or len(Version.strip()) == 0:
- Version = 'N/A'
-
- if DpGuid == None or len(DpGuid.strip()) == 0:
- DpGuid = 'N/A'
-
- if DpVersion == None or len(DpVersion.strip()) == 0:
- DpVersion = 'N/A'
-
- #
- # Add module standalone information to DB.
- #
- CurrentTime = time.time()
- SqlCommand = \
- """insert into %s values('%s', '%s', '%s', %s, '%s', '%s', '%s')""" % \
- (self.StandaloneModTable, Guid, Version, Name, CurrentTime, DpGuid, \
- DpVersion, Path)
- self.Cur.execute(SqlCommand)
-
- ## Add a module depex
- #
- # @param Guid: a module Guid
- # @param Version: a module Version
- # @param Name: a module name
- # @param DepexGuid: a module DepexGuid
- # @param DepexVersion: a module DepexVersion
- #
- def _AddModuleDepex(self, Guid, Version, Name, Path, DepexGuid=None, \
- DepexVersion=None):
-
- if DepexGuid == None or len(DepexGuid.strip()) == 0:
- DepexGuid = 'N/A'
-
- if DepexVersion == None or len(DepexVersion.strip()) == 0:
- DepexVersion = 'N/A'
-
- #
- # Add module depex information to DB.
- #
- SqlCommand = """insert into %s values('%s', '%s', '%s', '%s', '%s', '%s')"""\
- % (self.ModDepexTable, Guid, Version, Name, Path, DepexGuid, DepexVersion)
- self.Cur.execute(SqlCommand)
-
- ## Remove a distribution install information, if no version specified,
- # remove all DPs with this Guid.
- #
- # @param DpGuid: guid of dpex
- # @param DpVersion: version of dpex
- #
- def RemoveDpObj(self, DpGuid, DpVersion):
-
- PkgList = self.GetPackageListFromDp(DpGuid, DpVersion)
- #
- # delete from ModDepex the standalone module's dependency
- #
- SqlCommand = \
- """delete from ModDepexInfo where ModDepexInfo.ModuleGuid in
- (select ModuleGuid from StandaloneModInfo as B where B.DpGuid = '%s'
- and B.DpVersion = '%s')
- and ModDepexInfo.ModuleVersion in
- (select ModuleVersion from StandaloneModInfo as B
- where B.DpGuid = '%s' and B.DpVersion = '%s')
- and ModDepexInfo.ModuleName in
- (select ModuleName from StandaloneModInfo as B
- where B.DpGuid = '%s' and B.DpVersion = '%s')
- and ModDepexInfo.InstallPath in
- (select InstallPath from StandaloneModInfo as B
- where B.DpGuid = '%s' and B.DpVersion = '%s') """ % \
- (DpGuid, DpVersion, DpGuid, DpVersion, DpGuid, DpVersion, DpGuid, DpVersion)
-
- self.Cur.execute(SqlCommand)
- #
- # delete from ModDepex the from pkg module's dependency
- #
- for Pkg in PkgList:
-
- SqlCommand = \
- """delete from ModDepexInfo where ModDepexInfo.ModuleGuid in
- (select ModuleGuid from ModInPkgInfo
- where ModInPkgInfo.PackageGuid ='%s' and
- ModInPkgInfo.PackageVersion = '%s')
- and ModDepexInfo.ModuleVersion in
- (select ModuleVersion from ModInPkgInfo
- where ModInPkgInfo.PackageGuid ='%s' and
- ModInPkgInfo.PackageVersion = '%s')
- and ModDepexInfo.ModuleName in
- (select ModuleName from ModInPkgInfo
- where ModInPkgInfo.PackageGuid ='%s' and
- ModInPkgInfo.PackageVersion = '%s')
- and ModDepexInfo.InstallPath in
- (select InstallPath from ModInPkgInfo where
- ModInPkgInfo.PackageGuid ='%s'
- and ModInPkgInfo.PackageVersion = '%s')""" \
- % (Pkg[0], Pkg[1], Pkg[0], Pkg[1], Pkg[0], Pkg[1],Pkg[0], Pkg[1])
-
- self.Cur.execute(SqlCommand)
- #
- # delete the standalone module
- #
- SqlCommand = \
- """delete from %s where DpGuid ='%s' and DpVersion = '%s'""" % \
- (self.StandaloneModTable, DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
- #
- # delete the from pkg module
- #
- for Pkg in PkgList:
- SqlCommand = \
- """delete from %s where %s.PackageGuid ='%s'
- and %s.PackageVersion = '%s'""" % \
- (self.ModInPkgTable, self.ModInPkgTable, Pkg[0], \
- self.ModInPkgTable, Pkg[1])
- self.Cur.execute(SqlCommand)
- #
- # delete packages
- #
- SqlCommand = \
- """delete from %s where DpGuid ='%s' and DpVersion = '%s'""" % \
- (self.PkgTable, DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
- #
- # delete file list from DP
- #
- SqlCommand = \
- """delete from %s where DpGuid ='%s' and DpVersion = '%s'""" % \
- (self.DpFileListTable, DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
- #
- # delete DP
- #
- SqlCommand = \
- """delete from %s where DpGuid ='%s' and DpVersion = '%s'""" % \
- (self.DpTable, DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
-
- self.Conn.commit()
-
- ## Get a list of distribution install information.
- #
- # @param Guid: distribution package guid
- # @param Version: distribution package version
- #
- def GetDp(self, Guid, Version):
-
- if Version == None or len(Version.strip()) == 0:
- Version = 'N/A'
- Logger.Verbose(ST.MSG_GET_DP_INSTALL_LIST)
- (DpGuid, DpVersion) = (Guid, Version)
- SqlCommand = """select * from %s where DpGuid ='%s'""" % \
- (self.DpTable, DpGuid)
- self.Cur.execute(SqlCommand)
-
- else:
- Logger.Verbose(ST.MSG_GET_DP_INSTALL_INFO_START)
- (DpGuid, DpVersion) = (Guid, Version)
- SqlCommand = \
- """select * from %s where DpGuid ='%s' and DpVersion = '%s'""" % \
- (self.DpTable, DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
-
- DpList = []
- for DpInfo in self.Cur:
- DpGuid = DpInfo[0]
- DpVersion = DpInfo[1]
- InstallTime = DpInfo[2]
- PkgFileName = DpInfo[3]
- DpList.append((DpGuid, DpVersion, InstallTime, PkgFileName))
-
- Logger.Verbose(ST.MSG_GET_DP_INSTALL_INFO_FINISH)
- return DpList
-
- ## Get a list of distribution install dirs
- #
- # @param Guid: distribution package guid
- # @param Version: distribution package version
- #
- def GetDpInstallDirList(self, Guid, Version):
- SqlCommand = """select InstallPath from PkgInfo where DpGuid = '%s' and DpVersion = '%s'""" % (Guid, Version)
- self.Cur.execute(SqlCommand)
- DirList = []
- for Result in self.Cur:
- if Result[0] not in DirList:
- DirList.append(Result[0])
-
- SqlCommand = """select InstallPath from StandaloneModInfo where DpGuid = '%s' and DpVersion = '%s'""" % \
- (Guid, Version)
- self.Cur.execute(SqlCommand)
- for Result in self.Cur:
- if Result[0] not in DirList:
- DirList.append(Result[0])
-
- return DirList
-
-
- ## Get a list of distribution install file path information.
- #
- # @param Guid: distribution package guid
- # @param Version: distribution package version
- #
- def GetDpFileList(self, Guid, Version):
-
- (DpGuid, DpVersion) = (Guid, Version)
- SqlCommand = \
- """select * from %s where DpGuid ='%s' and DpVersion = '%s'""" % \
- (self.DpFileListTable, DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
-
- PathList = []
- for Result in self.Cur:
- Path = Result[0]
- Md5Sum = Result[3]
- PathList.append((Path, Md5Sum))
-
- return PathList
-
- ## Get files' repackage attribute if present that are installed into current workspace
- #
- # @retval FileDict: a Dict of file, key is file path, value is (DpGuid, DpVersion, NewDpFileName, RePackage)
- #
- def GetRePkgDict(self):
- SqlCommand = """select * from %s """ % (self.DpTable)
- self.Cur.execute(SqlCommand)
-
- DpInfoList = []
- for Result in self.Cur:
- DpInfoList.append(Result)
-
- FileDict = {}
- for Result in DpInfoList:
- DpGuid = Result[0]
- DpVersion = Result[1]
- NewDpFileName = Result[3]
- RePackage = Result[5]
- if RePackage == 'TRUE':
- RePackage = True
- else:
- RePackage = False
- for FileInfo in self.GetDpFileList(DpGuid, DpVersion):
- PathInfo = FileInfo[0]
- FileDict[PathInfo] = DpGuid, DpVersion, NewDpFileName, RePackage
-
- return FileDict
-
- ## Get (Guid, Version) from distribution file name information.
- #
- # @param DistributionFile: Distribution File
- #
- def GetDpByName(self, DistributionFile):
- SqlCommand = """select * from %s where NewPkgFileName like '%s'""" % \
- (self.DpTable, '%' + DistributionFile)
- self.Cur.execute(SqlCommand)
-
- for Result in self.Cur:
- DpGuid = Result[0]
- DpVersion = Result[1]
- NewDpFileName = Result[3]
-
- return (DpGuid, DpVersion, NewDpFileName)
- else:
- return (None, None, None)
-
- ## Get a list of package information.
- #
- # @param Guid: package guid
- # @param Version: package version
- #
- def GetPackage(self, Guid, Version, DpGuid='', DpVersion=''):
-
- if DpVersion == '' or DpGuid == '':
-
- (PackageGuid, PackageVersion) = (Guid, Version)
- SqlCommand = """select * from %s where PackageGuid ='%s'
- and PackageVersion = '%s'""" % (self.PkgTable, PackageGuid, \
- PackageVersion)
- self.Cur.execute(SqlCommand)
-
- elif Version == None or len(Version.strip()) == 0:
-
- SqlCommand = """select * from %s where PackageGuid ='%s'""" % \
- (self.PkgTable, Guid)
- self.Cur.execute(SqlCommand)
- else:
- (PackageGuid, PackageVersion) = (Guid, Version)
- SqlCommand = """select * from %s where PackageGuid ='%s' and
- PackageVersion = '%s'
- and DpGuid = '%s' and DpVersion = '%s'""" % \
- (self.PkgTable, PackageGuid, PackageVersion, \
- DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
-
- PkgList = []
- for PkgInfo in self.Cur:
- PkgGuid = PkgInfo[0]
- PkgVersion = PkgInfo[1]
- InstallTime = PkgInfo[2]
- InstallPath = PkgInfo[5]
- PkgList.append((PkgGuid, PkgVersion, InstallTime, DpGuid, \
- DpVersion, InstallPath))
-
- return PkgList
-
-
- ## Get a list of module in package information.
- #
- # @param Guid: A module guid
- # @param Version: A module version
- #
- def GetModInPackage(self, Guid, Version, Name, Path, PkgGuid='', PkgVersion=''):
- (ModuleGuid, ModuleVersion, ModuleName, InstallPath) = (Guid, Version, Name, Path)
- if PkgVersion == '' or PkgGuid == '':
- SqlCommand = """select * from %s where ModuleGuid ='%s' and
- ModuleVersion = '%s' and InstallPath = '%s'
- and ModuleName = '%s'""" % (self.ModInPkgTable, ModuleGuid, \
- ModuleVersion, InstallPath, ModuleName)
- self.Cur.execute(SqlCommand)
- else:
- SqlCommand = """select * from %s where ModuleGuid ='%s' and
- ModuleVersion = '%s' and InstallPath = '%s'
- and ModuleName = '%s' and PackageGuid ='%s'
- and PackageVersion = '%s'
- """ % (self.ModInPkgTable, ModuleGuid, \
- ModuleVersion, InstallPath, ModuleName, PkgGuid, PkgVersion)
- self.Cur.execute(SqlCommand)
-
- ModList = []
- for ModInfo in self.Cur:
- ModGuid = ModInfo[0]
- ModVersion = ModInfo[1]
- InstallTime = ModInfo[2]
- InstallPath = ModInfo[5]
- ModList.append((ModGuid, ModVersion, InstallTime, PkgGuid, \
- PkgVersion, InstallPath))
-
- return ModList
-
- ## Get a list of module standalone.
- #
- # @param Guid: A module guid
- # @param Version: A module version
- #
- def GetStandaloneModule(self, Guid, Version, Name, Path, DpGuid='', DpVersion=''):
- (ModuleGuid, ModuleVersion, ModuleName, InstallPath) = (Guid, Version, Name, Path)
- if DpGuid == '':
- SqlCommand = """select * from %s where ModuleGuid ='%s' and
- ModuleVersion = '%s' and InstallPath = '%s'
- and ModuleName = '%s'""" % (self.StandaloneModTable, ModuleGuid, \
- ModuleVersion, InstallPath, ModuleName)
- self.Cur.execute(SqlCommand)
-
- else:
- SqlCommand = """select * from %s where ModuleGuid ='%s' and
- ModuleVersion = '%s' and InstallPath = '%s' and ModuleName = '%s' and DpGuid ='%s' and DpVersion = '%s'
- """ % (self.StandaloneModTable, ModuleGuid, \
- ModuleVersion, ModuleName, InstallPath, DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
-
- ModList = []
- for ModInfo in self.Cur:
- ModGuid = ModInfo[0]
- ModVersion = ModInfo[1]
- InstallTime = ModInfo[2]
- InstallPath = ModInfo[5]
- ModList.append((ModGuid, ModVersion, InstallTime, DpGuid, \
- DpVersion, InstallPath))
-
- return ModList
-
- ## Get a list of module information that comes from DP.
- #
- # @param DpGuid: A Distrabution Guid
- # @param DpVersion: A Distrabution version
- #
- def GetSModInsPathListFromDp(self, DpGuid, DpVersion):
-
- PathList = []
- SqlCommand = """select InstallPath from %s where DpGuid ='%s'
- and DpVersion = '%s'
- """ % (self.StandaloneModTable, DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
-
- for Result in self.Cur:
- InstallPath = Result[0]
- PathList.append(InstallPath)
-
- return PathList
-
- ## Get a list of package information.
- #
- # @param DpGuid: A Distrabution Guid
- # @param DpVersion: A Distrabution version
- #
- def GetPackageListFromDp(self, DpGuid, DpVersion):
-
- SqlCommand = """select * from %s where DpGuid ='%s' and
- DpVersion = '%s' """ % (self.PkgTable, DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
-
- PkgList = []
- for PkgInfo in self.Cur:
- PkgGuid = PkgInfo[0]
- PkgVersion = PkgInfo[1]
- InstallPath = PkgInfo[5]
- PkgList.append((PkgGuid, PkgVersion, InstallPath))
-
- return PkgList
-
- ## Get a list of modules that depends on package information from a DP.
- #
- # @param DpGuid: A Distrabution Guid
- # @param DpVersion: A Distrabution version
- #
- def GetDpDependentModuleList(self, DpGuid, DpVersion):
-
- ModList = []
- PkgList = self.GetPackageListFromDp(DpGuid, DpVersion)
- if len(PkgList) > 0:
- return ModList
-
- for Pkg in PkgList:
- #
- # get all in-package modules that depends on current
- # Pkg (Guid match, Version match or NA) but not belong to
- # current Pkg
- #
- SqlCommand = """select t1.ModuleGuid, t1.ModuleVersion,
- t1.InstallPath from %s as t1, %s as t2 where
- t1.ModuleGuid = t2.ModuleGuid and
- t1.ModuleVersion = t2.ModuleVersion and t2.DepexGuid ='%s'
- and (t2.DepexVersion = '%s' or t2.DepexVersion = 'N/A') and
- t1.PackageGuid != '%s' and t1.PackageVersion != '%s'
- """ % (self.ModInPkgTable, \
- self.ModDepexTable, Pkg[0], Pkg[1], Pkg[0], \
- Pkg[1])
- self.Cur.execute(SqlCommand)
- for ModInfo in self.Cur:
- ModGuid = ModInfo[0]
- ModVersion = ModInfo[1]
- InstallPath = ModInfo[2]
- ModList.append((ModGuid, ModVersion, InstallPath))
-
- #
- # get all modules from standalone modules that depends on current
- #Pkg (Guid match, Version match or NA) but not in current dp
- #
- SqlCommand = \
- """select t1.ModuleGuid, t1.ModuleVersion, t1.InstallPath
- from %s as t1, %s as t2 where t1.ModuleGuid = t2.ModuleGuid and
- t1.ModuleVersion = t2.ModuleVersion and t2.DepexGuid ='%s'
- and (t2.DepexVersion = '%s' or t2.DepexVersion = 'N/A') and
- t1.DpGuid != '%s' and t1.DpVersion != '%s'
- """ % \
- (self.StandaloneModTable, self.ModDepexTable, Pkg[0], \
- Pkg[1], DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
- for ModInfo in self.Cur:
- ModGuid = ModInfo[0]
- ModVersion = ModInfo[1]
- InstallPath = ModInfo[2]
- ModList.append((ModGuid, ModVersion, InstallPath))
-
-
- return ModList
-
- ## Get Dp's list of modules.
- #
- # @param DpGuid: A Distrabution Guid
- # @param DpVersion: A Distrabution version
- #
- def GetDpModuleList(self, DpGuid, DpVersion):
- ModList = []
- #
- # get Dp module list from the DpFileList table
- #
- SqlCommand = """select FilePath
- from %s
- where DpGuid = '%s' and DpVersion = '%s' and
- FilePath like '%%.inf'
- """ % (self.DpFileListTable, DpGuid, DpVersion)
- self.Cur.execute(SqlCommand)
- for ModuleInfo in self.Cur:
- FilePath = ModuleInfo[0]
- ModList.append(FilePath)
-
- return ModList
-
-
- ## Get a module depex
- #
- # @param DpGuid: A module Guid
- # @param DpVersion: A module version
- # @param Path:
- #
- def GetModuleDepex(self, Guid, Version, Path):
-
- #
- # Get module depex information to DB.
- #
- SqlCommand = """select * from %s where ModuleGuid ='%s' and
- ModuleVersion = '%s' and InstallPath ='%s'
- """ % (self.ModDepexTable, Guid, Version, Path)
- self.Cur.execute(SqlCommand)
- self.Conn.commit()
-
- DepexList = []
- for DepInfo in self.Cur:
- DepexGuid = DepInfo[3]
- DepexVersion = DepInfo[4]
- DepexList.append((DepexGuid, DepexVersion))
-
- return DepexList
-
- ## Close entire database
- #
- # Close the connection and cursor
- #
- def CloseDb(self):
- #
- # drop the dummy table
- #
- SqlCommand = """
- drop table IF EXISTS %s
- """ % self.DummyTable
- self.Cur.execute(SqlCommand)
- self.Conn.commit()
-
- self.Cur.close()
- self.Conn.close()
-
- ## Convert To Sql String
- #
- # 1. Replace "'" with "''" in each item of StringList
- #
- # @param StringList: A list for strings to be converted
- #
- def __ConvertToSqlString(self, StringList):
- if self.DpTable:
- pass
- return map(lambda s: s.replace("'", "''") , StringList)
-
-
-
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Core/PackageFile.py b/BaseTools/Source/Python/UPT/Core/PackageFile.py
deleted file mode 100644
index 04c5d4e8d0..0000000000
--- a/BaseTools/Source/Python/UPT/Core/PackageFile.py
+++ /dev/null
@@ -1,249 +0,0 @@
-## @file
-#
-# PackageFile class represents the zip file of a distribution package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-PackageFile
-'''
-
-##
-# Import Modules
-#
-import os.path
-import zipfile
-import tempfile
-import platform
-
-from Logger.ToolError import FILE_OPEN_FAILURE
-from Logger.ToolError import FILE_CHECKSUM_FAILURE
-from Logger.ToolError import FILE_NOT_FOUND
-from Logger.ToolError import FILE_DECOMPRESS_FAILURE
-from Logger.ToolError import FILE_UNKNOWN_ERROR
-from Logger.ToolError import FILE_WRITE_FAILURE
-from Logger.ToolError import FILE_COMPRESS_FAILURE
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Library.Misc import CreateDirectory
-from Library.Misc import RemoveDirectory
-
-
-
-class PackageFile:
- def __init__(self, FileName, Mode="r"):
- self._FileName = FileName
- if Mode not in ["r", "w", "a"]:
- Mode = "r"
- try:
- self._ZipFile = zipfile.ZipFile(FileName, Mode, \
- zipfile.ZIP_DEFLATED)
- self._Files = {}
- for Filename in self._ZipFile.namelist():
- self._Files[os.path.normpath(Filename)] = Filename
- except BaseException, Xstr:
- Logger.Error("PackagingTool", FILE_OPEN_FAILURE,
- ExtraData="%s (%s)" % (FileName, str(Xstr)))
-
- BadFile = self._ZipFile.testzip()
- if BadFile != None:
- Logger.Error("PackagingTool", FILE_CHECKSUM_FAILURE,
- ExtraData="[%s] in %s" % (BadFile, FileName))
-
- def GetZipFile(self):
- return self._ZipFile
-
- ## Get file name
- #
- def __str__(self):
- return self._FileName
-
- ## Extract the file
- #
- # @param To: the destination file
- #
- def Unpack(self, ToDest):
- for FileN in self._ZipFile.namelist():
- ToFile = os.path.normpath(os.path.join(ToDest, FileN))
- Msg = "%s -> %s" % (FileN, ToFile)
- Logger.Info(Msg)
- self.Extract(FileN, ToFile)
-
- ## Extract the file
- #
- # @param File: the extracted file
- # @param ToFile: the destination file
- #
- def UnpackFile(self, File, ToFile):
- File = File.replace('\\', '/')
- if File in self._ZipFile.namelist():
- Msg = "%s -> %s" % (File, ToFile)
- Logger.Info(Msg)
- self.Extract(File, ToFile)
- return ToFile
-
- return ''
-
- ## Extract the file
- #
- # @param Which: the source path
- # @param To: the destination path
- #
- def Extract(self, Which, ToDest):
- Which = os.path.normpath(Which)
- if Which not in self._Files:
- Logger.Error("PackagingTool", FILE_NOT_FOUND,
- ExtraData="[%s] in %s" % (Which, self._FileName))
- try:
- FileContent = self._ZipFile.read(self._Files[Which])
- except BaseException, Xstr:
- Logger.Error("PackagingTool", FILE_DECOMPRESS_FAILURE,
- ExtraData="[%s] in %s (%s)" % (Which, \
- self._FileName, \
- str(Xstr)))
- try:
- CreateDirectory(os.path.dirname(ToDest))
- if os.path.exists(ToDest) and not os.access(ToDest, os.W_OK):
- Logger.Warn("PackagingTool", \
- ST.WRN_FILE_NOT_OVERWRITTEN % ToDest)
- return
- ToFile = open(ToDest, "wb")
- except BaseException, Xstr:
- Logger.Error("PackagingTool", FILE_OPEN_FAILURE,
- ExtraData="%s (%s)" % (ToDest, str(Xstr)))
-
- try:
- ToFile.write(FileContent)
- ToFile.close()
- except BaseException, Xstr:
- Logger.Error("PackagingTool", FILE_WRITE_FAILURE,
- ExtraData="%s (%s)" % (ToDest, str(Xstr)))
-
- ## Remove the file
- #
- # @param Files: the removed files
- #
- def Remove(self, Files):
- TmpDir = os.path.join(tempfile.gettempdir(), ".packaging")
- if os.path.exists(TmpDir):
- RemoveDirectory(TmpDir, True)
-
- os.mkdir(TmpDir)
- self.Unpack(TmpDir)
- for SinF in Files:
- SinF = os.path.normpath(SinF)
- if SinF not in self._Files:
- Logger.Error("PackagingTool", FILE_NOT_FOUND,
- ExtraData="%s is not in %s!" % \
- (SinF, self._FileName))
- self._Files.pop(SinF)
- self._ZipFile.close()
-
- self._ZipFile = zipfile.ZipFile(self._FileName, "w", \
- zipfile.ZIP_DEFLATED)
- Cwd = os.getcwd()
- os.chdir(TmpDir)
- self.PackFiles(self._Files)
- os.chdir(Cwd)
- RemoveDirectory(TmpDir, True)
-
- ## Pack the files under Top directory, the directory shown in the zipFile start from BaseDir,
- # BaseDir should be the parent directory of the Top directory, for example,
- # Pack(Workspace\Dir1, Workspace) will pack files under Dir1, and the path in the zipfile will
- # start from Workspace
- #
- # @param Top: the top directory
- # @param BaseDir: the base directory
- #
- def Pack(self, Top, BaseDir):
- if not os.path.isdir(Top):
- Logger.Error("PackagingTool", FILE_UNKNOWN_ERROR, \
- "%s is not a directory!" %Top)
-
- FilesToPack = []
- Cwd = os.getcwd()
- os.chdir(BaseDir)
- RelaDir = Top[Top.upper().find(BaseDir.upper()).\
- join(len(BaseDir).join(1)):]
-
- for Root, Dirs, Files in os.walk(RelaDir):
- if 'CVS' in Dirs:
- Dirs.remove('CVS')
- if '.svn' in Dirs:
- Dirs.remove('.svn')
-
- for Dir in Dirs:
- if Dir.startswith('.'):
- Dirs.remove(Dir)
- for File1 in Files:
- if File1.startswith('.'):
- continue
- ExtName = os.path.splitext(File1)[1]
- #
- # skip '.dec', '.inf', '.dsc', '.fdf' files
- #
- if ExtName.lower() in ['.dec', '.inf', '.dsc', '.fdf']:
- continue
- FilesToPack.append(os.path.join(Root, File1))
- self.PackFiles(FilesToPack)
- os.chdir(Cwd)
-
- ## Pack the file
- #
- # @param Files: the files to pack
- #
- def PackFiles(self, Files):
- for File1 in Files:
- self.PackFile(File1)
-
- ## Pack the file
- #
- # @param File: the files to pack
- # @param ArcName: the Arc Name
- #
- def PackFile(self, File, ArcName=None):
- try:
- #
- # avoid packing same file multiple times
- #
- if platform.system() != 'Windows':
- File = File.replace('\\', '/')
- ZipedFilesNameList = self._ZipFile.namelist()
- for ZipedFile in ZipedFilesNameList:
- if File == os.path.normpath(ZipedFile):
- return
- Logger.Info("packing ..." + File)
- self._ZipFile.write(File, ArcName)
- except BaseException, Xstr:
- Logger.Error("PackagingTool", FILE_COMPRESS_FAILURE,
- ExtraData="%s (%s)" % (File, str(Xstr)))
-
- ## Write data to the packed file
- #
- # @param Data: data to write
- # @param ArcName: the Arc Name
- #
- def PackData(self, Data, ArcName):
- try:
- self._ZipFile.writestr(ArcName, Data)
- except BaseException, Xstr:
- Logger.Error("PackagingTool", FILE_COMPRESS_FAILURE,
- ExtraData="%s (%s)" % (ArcName, str(Xstr)))
-
- ## Close file
- #
- #
- def Close(self):
- self._ZipFile.close()
-
-
-
diff --git a/BaseTools/Source/Python/UPT/Core/__init__.py b/BaseTools/Source/Python/UPT/Core/__init__.py
deleted file mode 100644
index 39c78e8ecf..0000000000
--- a/BaseTools/Source/Python/UPT/Core/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Library' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Core init file
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Dll/sqlite3.dll b/BaseTools/Source/Python/UPT/Dll/sqlite3.dll
deleted file mode 100644
index c99ef993cf..0000000000
--- a/BaseTools/Source/Python/UPT/Dll/sqlite3.dll
+++ /dev/null
Binary files differ
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
deleted file mode 100644
index 575c216e58..0000000000
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
+++ /dev/null
@@ -1,367 +0,0 @@
-## @file GenDecFile.py
-#
-# This file contained the logical of transfer package object to DEC files.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-GenDEC
-'''
-
-from Library.Parsing import GenSection
-from Library.CommentGenerating import GenHeaderCommentSection
-from Library.CommentGenerating import GenGenericCommentF
-from Library.CommentGenerating import GenDecTailComment
-from Library.CommentGenerating import _GetHelpStr
-from Library.Misc import GuidStringToGuidStructureString
-from Library.Misc import SaveFileOnChange
-from Library.Misc import ConvertPath
-from Library.DataType import TAB_SPACE_SPLIT
-from Library.DataType import TAB_COMMA_SPLIT
-from Library.DataType import TAB_ARCH_COMMON
-from Library.DataType import TAB_DEC_DEFINES_DEC_SPECIFICATION
-from Library.DataType import TAB_DEC_DEFINES_PACKAGE_NAME
-from Library.DataType import TAB_DEC_DEFINES_PACKAGE_GUID
-from Library.DataType import TAB_DEC_DEFINES_PACKAGE_VERSION
-
-
-def GenPcd(Package, Content):
- #
- # generate [Pcd] section
- # <TokenSpcCName>.<TokenCName>|<Value>|<DatumType>|<Token>
- #
- ValidUsageDict = {}
- for Pcd in Package.GetPcdList():
- #
- # Generate generic comment
- #
- HelpTextList = Pcd.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
- CommentStr = GenGenericCommentF(HelpStr, 2)
-
- PcdErrList = Pcd.GetPcdErrorsList()
- if PcdErrList:
- CommentStr += GenPcdErrComment(PcdErrList[0])
- Statement = CommentStr
-
- CName = Pcd.GetCName()
- TokenSpaceGuidCName = Pcd.GetTokenSpaceGuidCName()
- DefaultValue = Pcd.GetDefaultValue()
- DatumType = Pcd.GetDatumType()
- Token = Pcd.GetToken()
- ValidUsage = Pcd.GetValidUsage()
-
- if ValidUsage == 'FeaturePcd':
- ValidUsage = 'PcdsFeatureFlag'
- elif ValidUsage == 'PatchPcd':
- ValidUsage = 'PcdsPatchableInModule'
- elif ValidUsage == 'FixedPcd':
- ValidUsage = 'PcdsFixedAtBuild'
- elif ValidUsage == 'Pcd':
- ValidUsage = 'PcdsDynamic'
- elif ValidUsage == 'PcdEx':
- ValidUsage = 'PcdsDynamicEx'
-
- if ValidUsage in ValidUsageDict:
- NewSectionDict = ValidUsageDict[ValidUsage]
- else:
- NewSectionDict = {}
- ValidUsageDict[ValidUsage] = NewSectionDict
- Statement += TokenSpaceGuidCName + '.' + CName
- Statement += '|' + DefaultValue
- Statement += '|' + DatumType
- Statement += '|' + Token
- #
- # generate tail comment
- #
- if Pcd.GetSupModuleList():
- Statement += GenDecTailComment(Pcd.GetSupModuleList())
-
- ArchList = Pcd.GetSupArchList()
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = \
- NewSectionDict[SortedArch] + [Statement]
- else:
- NewSectionDict[SortedArch] = [Statement]
-
- for ValidUsage in ValidUsageDict:
- Content += GenSection(ValidUsage, ValidUsageDict[ValidUsage])
-
- return Content
-
-def GenGuidProtocolPpi(Package, Content):
- #
- # generate [Guids] section
- #
- NewSectionDict = {}
- for Guid in Package.GetGuidList():
- #
- # Generate generic comment
- #
- HelpTextList = Guid.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
- CommentStr = GenGenericCommentF(HelpStr, 2)
-
- Statement = CommentStr
- CName = Guid.GetCName()
- Value = GuidStringToGuidStructureString(Guid.GetGuid())
- Statement += CName + ' = ' + Value
- #
- # generate tail comment
- #
- if Guid.GetSupModuleList():
- Statement += GenDecTailComment(Guid.GetSupModuleList())
- ArchList = Guid.GetSupArchList()
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = \
- NewSectionDict[SortedArch] + [Statement]
- else:
- NewSectionDict[SortedArch] = [Statement]
-
- Content += GenSection('Guids', NewSectionDict)
-
- #
- # generate [Protocols] section
- #
- NewSectionDict = {}
- for Protocol in Package.GetProtocolList():
- #
- # Generate generic comment
- #
- HelpTextList = Protocol.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
- CommentStr = GenGenericCommentF(HelpStr, 2)
-
- Statement = CommentStr
- CName = Protocol.GetCName()
- Value = GuidStringToGuidStructureString(Protocol.GetGuid())
- Statement += CName + ' = ' + Value
-
- #
- # generate tail comment
- #
- if Protocol.GetSupModuleList():
- Statement += GenDecTailComment(Protocol.GetSupModuleList())
- ArchList = Protocol.GetSupArchList()
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = \
- NewSectionDict[SortedArch] + [Statement]
- else:
- NewSectionDict[SortedArch] = [Statement]
-
- Content += GenSection('Protocols', NewSectionDict)
-
- #
- # generate [Ppis] section
- #
- NewSectionDict = {}
- for Ppi in Package.GetPpiList():
- #
- # Generate generic comment
- #
- HelpTextList = Ppi.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
- CommentStr = GenGenericCommentF(HelpStr, 2)
-
- Statement = CommentStr
- CName = Ppi.GetCName()
- Value = GuidStringToGuidStructureString(Ppi.GetGuid())
- Statement += CName + ' = ' + Value
-
- #
- # generate tail comment
- #
- if Ppi.GetSupModuleList():
- Statement += GenDecTailComment(Ppi.GetSupModuleList())
- ArchList = Ppi.GetSupArchList()
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = \
- NewSectionDict[SortedArch] + [Statement]
- else:
- NewSectionDict[SortedArch] = [Statement]
-
- Content += GenSection('Ppis', NewSectionDict)
-
- return Content
-
-## Transfer Package Object to Dec files
-#
-# Transfer all contents of a standard Package Object to a Dec file
-#
-# @param Package: A Package
-#
-def PackageToDec(Package):
- #
- # Init global information for the file
- #
- ContainerFile = Package.GetFullPath()
-
- Content = ''
- #
- # generate header comment section
- #
- Content += GenHeaderCommentSection(Package.GetAbstract(), \
- Package.GetDescription(), \
- Package.GetCopyright(), \
- Package.GetLicense())
-
- #
- # for each section, maintain a dict, sorted arch will be its key,
- #statement list will be its data
- # { 'Arch1 Arch2 Arch3': [statement1, statement2],
- # 'Arch1' : [statement1, statement3]
- # }
- #
-
- #
- # generate [Defines] section
- #
- NewSectionDict = {TAB_ARCH_COMMON : []}
- SpecialItemList = []
-
- Statement = '%s = %s' % (TAB_DEC_DEFINES_DEC_SPECIFICATION, '0x00010017')
- SpecialItemList.append(Statement)
-
- BaseName = Package.GetBaseName()
- if BaseName.startswith('.') or BaseName.startswith('-'):
- BaseName = '_' + BaseName
- Statement = '%s = %s' % (TAB_DEC_DEFINES_PACKAGE_NAME, BaseName)
- SpecialItemList.append(Statement)
- Statement = '%s = %s' % (TAB_DEC_DEFINES_PACKAGE_VERSION, Package.GetVersion())
- SpecialItemList.append(Statement)
- Statement = '%s = %s' % (TAB_DEC_DEFINES_PACKAGE_GUID, Package.GetGuid())
- SpecialItemList.append(Statement)
- for SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = \
- NewSectionDict[SortedArch] + SpecialItemList
- Content += GenSection('Defines', NewSectionDict)
-
- #
- # generate [Includes] section
- #
- NewSectionDict = {}
- IncludeArchList = Package.GetIncludeArchList()
- if IncludeArchList:
- for Path, ArchList in IncludeArchList:
- Statement = Path
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = \
- NewSectionDict[SortedArch] + [ConvertPath(Statement)]
- else:
- NewSectionDict[SortedArch] = [ConvertPath(Statement)]
-
- Content += GenSection('Includes', NewSectionDict)
-
- Content = GenGuidProtocolPpi(Package, Content)
-
- #
- # generate [LibraryClasses] section
- #
- NewSectionDict = {}
- for LibraryClass in Package.GetLibraryClassList():
- #
- # Generate generic comment
- #
- HelpTextList = LibraryClass.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
- if HelpStr:
- HelpStr = '@libraryclass ' + HelpStr
- CommentStr = GenGenericCommentF(HelpStr, 2)
-
- Statement = CommentStr
- Name = LibraryClass.GetLibraryClass()
- IncludeHeader = LibraryClass.GetIncludeHeader()
- Statement += Name + '|' + ConvertPath(IncludeHeader)
- #
- # generate tail comment
- #
- if LibraryClass.GetSupModuleList():
- Statement += \
- GenDecTailComment(LibraryClass.GetSupModuleList())
- ArchList = LibraryClass.GetSupArchList()
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = \
- NewSectionDict[SortedArch] + [Statement]
- else:
- NewSectionDict[SortedArch] = [Statement]
-
- Content += GenSection('LibraryClasses', NewSectionDict)
-
- Content = GenPcd(Package, Content)
-
- #
- # generate [UserExtensions] section
- #
- NewSectionDict = {}
- for UserExtension in Package.GetUserExtensionList():
- Statement = UserExtension.GetStatement()
- if not Statement:
- continue
-
- SectionList = []
- SectionName = 'UserExtensions'
- UserId = UserExtension.GetUserID()
- if UserId:
- if '.' in UserId:
- UserId = '"' + UserId + '"'
- SectionName += '.' + UserId
- if UserExtension.GetIdentifier():
- SectionName += '.' + '"' + UserExtension.GetIdentifier() + '"'
- if not UserExtension.GetSupArchList():
- SectionList.append(SectionName)
- else:
- for Arch in UserExtension.GetSupArchList():
- SectionList.append(SectionName + '.' + Arch)
- SectionName = ', '.join(SectionList)
- SectionName = ''.join(['[', SectionName, ']\n'])
- Content += '\n\n' + SectionName + Statement
-
- SaveFileOnChange(ContainerFile, Content, False)
- return ContainerFile
-
-## GenPcdErrComment
-#
-# @param PcdErrObject: PcdErrorObject
-#
-# @retval CommentStr: Generated comment lines, with prefix "#"
-#
-def GenPcdErrComment (PcdErrObject):
- EndOfLine = "\n"
- ValidValueRange = PcdErrObject.GetValidValueRange()
- if ValidValueRange:
- CommentStr = "# @ValidRange " + ValidValueRange + EndOfLine
-
- ValidValue = PcdErrObject.GetValidValue()
- if ValidValue:
- ValidValueList = \
- [Value for Value in ValidValue.split(TAB_SPACE_SPLIT) if Value]
- CommentStr = \
- "# @ValidList " + TAB_COMMA_SPLIT.join(ValidValueList) + EndOfLine
-
- Expression = PcdErrObject.GetExpression()
- if Expression:
- CommentStr = "# @Expression " + Expression + EndOfLine
-
- return CommentStr
-
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
deleted file mode 100644
index 78bb6ea4f1..0000000000
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
+++ /dev/null
@@ -1,988 +0,0 @@
-## @file GenInfFile.py
-#
-# This file contained the logical of transfer package object to INF files.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-'''
-GenInf
-'''
-from os import getenv
-from Library.String import GetSplitValueList
-from Library.Parsing import GenSection
-from Library.Parsing import GetWorkspacePackage
-from Library.Parsing import ConvertArchForInstall
-from Library.Misc import SaveFileOnChange
-from Library.Misc import IsAllModuleList
-from Library.Misc import Sdict
-from Library.Misc import ConvertPath
-from Library.Misc import ConvertSpec
-from Library.CommentGenerating import GenHeaderCommentSection
-from Library.CommentGenerating import GenGenericCommentF
-from Library.CommentGenerating import _GetHelpStr
-from Library import GlobalData
-from Logger import StringTable as ST
-from Logger import ToolError
-import Logger.Log as Logger
-from Library import DataType as DT
-from GenMetaFile import GenMetaFileMisc
-
-## Transfer Module Object to Inf files
-#
-# Transfer all contents of a standard Module Object to an Inf file
-# @param ModuleObject: A Module Object
-#
-def ModuleToInf(ModuleObject):
- if not GlobalData.gWSPKG_LIST:
- GlobalData.gWSPKG_LIST = GetWorkspacePackage()
-
- #
- # Init global information for the file
- #
- ContainerFile = ModuleObject.GetFullPath()
- Content = ''
- #
- # generate header comment section
- #
- Content += GenHeaderCommentSection(ModuleObject.GetAbstract(),
- ModuleObject.GetDescription(),
- ModuleObject.GetCopyright(),
- ModuleObject.GetLicense())
-
- #
- # Judge whether the INF file is an AsBuild INF.
- #
- if ModuleObject.BinaryModule:
- GlobalData.gIS_BINARY_INF = True
- else:
- GlobalData.gIS_BINARY_INF = False
-
- #
- # for each section, maintain a dict, sorted arch will be its key,
- # statement list will be its data
- # { 'Arch1 Arch2 Arch3': [statement1, statement2],
- # 'Arch1' : [statement1, statement3]
- # }
- #
-
- #
- # Gen section contents
- #
- Content += GenDefines(ModuleObject)
- Content += GenBuildOptions(ModuleObject)
- Content += GenLibraryClasses(ModuleObject)
- Content += GenPackages(ModuleObject)
- Content += GenPcdSections(ModuleObject)
- Content += GenSources(ModuleObject)
- Content += GenProtocolPPiSections(ModuleObject.GetProtocolList(), True)
- Content += GenProtocolPPiSections(ModuleObject.GetPpiList(), False)
- Content += GenGuidSections(ModuleObject.GetGuidList())
- Content += GenBinaries(ModuleObject)
- Content += GenDepex(ModuleObject)
- Content += GenUserExtensions(ModuleObject)
-
- if ModuleObject.GetEventList() or ModuleObject.GetBootModeList() or ModuleObject.GetHobList():
- Content += '\n\n'
- #
- # generate [Event], [BootMode], [Hob] section
- #
- Content += GenSpecialSections(ModuleObject.GetEventList(), 'Event')
- Content += GenSpecialSections(ModuleObject.GetBootModeList(), 'BootMode')
- Content += GenSpecialSections(ModuleObject.GetHobList(), 'Hob')
-
- SaveFileOnChange(ContainerFile, Content, False)
- return ContainerFile
-
-def GenDefines(ModuleObject):
- #
- # generate [Defines] section
- #
- Content = ''
- NewSectionDict = {}
- for UserExtension in ModuleObject.GetUserExtensionList():
- DefinesDict = UserExtension.GetDefinesDict()
- if not DefinesDict:
- continue
-
- for Statement in DefinesDict:
- SortedArch = DT.TAB_ARCH_COMMON
- if Statement.strip().startswith(DT.TAB_INF_DEFINES_CUSTOM_MAKEFILE):
- pos = Statement.find(DT.TAB_VALUE_SPLIT)
- if pos == -1:
- pos = Statement.find(DT.TAB_EQUAL_SPLIT)
- Makefile = ConvertPath(Statement[pos + 1:].strip())
- Statement = Statement[:pos + 1] + ' ' + Makefile
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = NewSectionDict[SortedArch] + [Statement]
- else:
- NewSectionDict[SortedArch] = [Statement]
-
- SpecialStatementList = []
-
- #
- # Add INF_VERSION statement firstly
- #
- Statement = 'INF_VERSION = 0x00010017'
- SpecialStatementList.append(Statement)
-
- BaseName = ModuleObject.GetBaseName()
- if BaseName.startswith('.') or BaseName.startswith('-'):
- BaseName = '_' + BaseName
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_BASE_NAME, BaseName)
- SpecialStatementList.append(Statement)
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_FILE_GUID, ModuleObject.GetGuid())
- SpecialStatementList.append(Statement)
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_VERSION_STRING, ModuleObject.GetVersion())
- SpecialStatementList.append(Statement)
-
- if ModuleObject.GetModuleType():
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_MODULE_TYPE, ModuleObject.GetModuleType())
- SpecialStatementList.append(Statement)
- if ModuleObject.GetPcdIsDriver():
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_PCD_IS_DRIVER, ModuleObject.GetPcdIsDriver())
- SpecialStatementList.append(Statement)
- if ModuleObject.GetUefiSpecificationVersion():
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION, \
- ModuleObject.GetUefiSpecificationVersion())
- SpecialStatementList.append(Statement)
- if ModuleObject.GetPiSpecificationVersion():
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSION, ModuleObject.GetPiSpecificationVersion())
- SpecialStatementList.append(Statement)
- for LibraryClass in ModuleObject.GetLibraryClassList():
- if LibraryClass.GetUsage() == DT.USAGE_ITEM_PRODUCES or \
- LibraryClass.GetUsage() == DT.USAGE_ITEM_SOMETIMES_PRODUCES:
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_LIBRARY_CLASS, LibraryClass.GetLibraryClass())
- if LibraryClass.GetSupModuleList():
- Statement += '|' + DT.TAB_SPACE_SPLIT.join(l for l in LibraryClass.GetSupModuleList())
- SpecialStatementList.append(Statement)
- for SpecItem in ModuleObject.GetSpecList():
- Spec, Version = SpecItem
- Spec = ConvertSpec(Spec)
- Statement = '%s %s = %s' % (DT.TAB_INF_DEFINES_SPEC, Spec, Version)
- SpecialStatementList.append(Statement)
-
- ExternList = []
- for Extern in ModuleObject.GetExternList():
- ArchList = Extern.GetSupArchList()
- EntryPoint = Extern.GetEntryPoint()
- UnloadImage = Extern.GetUnloadImage()
- Constructor = Extern.GetConstructor()
- Destructor = Extern.GetDestructor()
- HelpStringList = Extern.GetHelpTextList()
- FFE = Extern.GetFeatureFlag()
- ExternList.append([ArchList, EntryPoint, UnloadImage, Constructor, Destructor, FFE, HelpStringList])
-
- #
- # Add VALID_ARCHITECTURES information
- #
- ValidArchStatement = None
- if ModuleObject.SupArchList:
- ValidArchStatement = '# ' + '\n'
- ValidArchStatement += '# The following information is for reference only and not required by the build tools.\n'
- ValidArchStatement += '# ' + '\n'
- ValidArchStatement += '# VALID_ARCHITECTURES = %s' % (' '.join(ModuleObject.SupArchList)) + '\n'
- ValidArchStatement += '# ' + '\n'
-
- if DT.TAB_ARCH_COMMON not in NewSectionDict:
- NewSectionDict[DT.TAB_ARCH_COMMON] = []
- NewSectionDict[DT.TAB_ARCH_COMMON] = NewSectionDict[DT.TAB_ARCH_COMMON] + SpecialStatementList
- GenMetaFileMisc.AddExternToDefineSec(NewSectionDict, DT.TAB_ARCH_COMMON, ExternList)
- if ValidArchStatement is not None:
- NewSectionDict[DT.TAB_ARCH_COMMON] = NewSectionDict[DT.TAB_ARCH_COMMON] + [ValidArchStatement]
-
- Content += GenSection('Defines', NewSectionDict)
-
- return Content
-
-def GenLibraryClasses(ModuleObject):
- #
- # generate [LibraryClasses] section
- #
- Content = ''
- NewSectionDict = {}
- if not GlobalData.gIS_BINARY_INF:
- for LibraryClass in ModuleObject.GetLibraryClassList():
- if LibraryClass.GetUsage() == DT.USAGE_ITEM_PRODUCES:
- continue
- #
- # Generate generic comment
- #
- HelpTextList = LibraryClass.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
- CommentStr = GenGenericCommentF(HelpStr)
- Statement = CommentStr
- Name = LibraryClass.GetLibraryClass()
- FFE = LibraryClass.GetFeatureFlag()
- Statement += Name
- if FFE:
- Statement += '|' + FFE
- ModuleList = LibraryClass.GetSupModuleList()
- ArchList = LibraryClass.GetSupArchList()
- for Index in xrange(0, len(ArchList)):
- ArchList[Index] = ConvertArchForInstall(ArchList[Index])
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
-
- KeyList = []
- if not ModuleList or IsAllModuleList(ModuleList):
- KeyList = [SortedArch]
- else:
- ModuleString = DT.TAB_VALUE_SPLIT.join(l for l in ModuleList)
- if not ArchList:
- SortedArch = DT.TAB_ARCH_COMMON
- KeyList = [SortedArch + '.' + ModuleString]
- else:
- KeyList = [Arch + '.' + ModuleString for Arch in ArchList]
-
- for Key in KeyList:
- if Key in NewSectionDict:
- NewSectionDict[Key] = NewSectionDict[Key] + [Statement]
- else:
- NewSectionDict[Key] = [Statement]
- Content += GenSection('LibraryClasses', NewSectionDict)
- else:
- LibraryClassDict = {}
- for BinaryFile in ModuleObject.GetBinaryFileList():
- if not BinaryFile.AsBuiltList:
- continue
- for LibraryItem in BinaryFile.AsBuiltList[0].LibraryInstancesList:
- Statement = '# Guid: ' + LibraryItem.Guid + ' Version: ' + LibraryItem.Version
- if len(BinaryFile.SupArchList) == 0:
- if LibraryClassDict.has_key('COMMON'):
- LibraryClassDict['COMMON'].append(Statement)
- else:
- LibraryClassDict['COMMON'] = ['## @LIB_INSTANCES']
- LibraryClassDict['COMMON'].append(Statement)
- else:
- for Arch in BinaryFile.SupArchList:
- if LibraryClassDict.has_key(Arch):
- LibraryClassDict[Arch].append(Statement)
- else:
- LibraryClassDict[Arch] = ['## @LIB_INSTANCES']
- LibraryClassDict[Arch].append(Statement)
-
- Content += GenSection('LibraryClasses', LibraryClassDict)
-
- return Content
-
-def GenPackages(ModuleObject):
- Content = ''
- #
- # generate [Packages] section
- #
- NewSectionDict = Sdict()
- WorkspaceDir = getenv('WORKSPACE')
- for PackageDependency in ModuleObject.GetPackageDependencyList():
- #
- # Generate generic comment
- #
- CommentStr = ''
- HelpText = PackageDependency.GetHelpText()
- if HelpText:
- HelpStr = HelpText.GetString()
- CommentStr = GenGenericCommentF(HelpStr)
- Statement = CommentStr
- Guid = PackageDependency.GetGuid()
- Version = PackageDependency.GetVersion()
- FFE = PackageDependency.GetFeatureFlag()
- #
- # find package path/name
- #
- for PkgInfo in GlobalData.gWSPKG_LIST:
- if Guid == PkgInfo[1]:
- if (not Version) or (Version == PkgInfo[2]):
- Path = PkgInfo[3]
- break
- #
- # get relative path
- #
- RelaPath = Path[Path.upper().find(WorkspaceDir.upper()) + len(WorkspaceDir) + 1:]
- Statement += RelaPath.replace('\\', '/')
- if FFE:
- Statement += '|' + FFE
- ArchList = PackageDependency.GetSupArchList()
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = NewSectionDict[SortedArch] + [Statement]
- else:
- NewSectionDict[SortedArch] = [Statement]
-
- Content += GenSection('Packages', NewSectionDict)
-
- return Content
-
-def GenSources(ModuleObject):
- #
- # generate [Sources] section
- #
- Content = ''
- NewSectionDict = {}
-
- for Source in ModuleObject.GetSourceFileList():
- SourceFile = Source.GetSourceFile()
- Family = Source.GetFamily()
- FeatureFlag = Source.GetFeatureFlag()
- SupArchList = Source.GetSupArchList()
- SupArchList.sort()
- SortedArch = ' '.join(SupArchList)
-
- Statement = GenSourceStatement(ConvertPath(SourceFile), Family, FeatureFlag)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = NewSectionDict[SortedArch] + [Statement]
- else:
- NewSectionDict[SortedArch] = [Statement]
-
- Content += GenSection('Sources', NewSectionDict)
-
- return Content
-
-def GenDepex(ModuleObject):
- #
- # generate [Depex] section
- #
- NewSectionDict = Sdict()
- Content = ''
- for Depex in ModuleObject.GetPeiDepex() + ModuleObject.GetDxeDepex() + ModuleObject.GetSmmDepex():
- HelpTextList = Depex.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
- CommentStr = GenGenericCommentF(HelpStr)
- SupArchList = Depex.GetSupArchList()
- SupModList = Depex.GetModuleType()
- Expression = Depex.GetDepex()
- Statement = CommentStr + Expression
-
- SupArchList.sort()
- KeyList = []
- if not SupArchList:
- SupArchList.append(DT.TAB_ARCH_COMMON.lower())
- if not SupModList:
- KeyList = SupArchList
- else:
- for ModuleType in SupModList:
- for Arch in SupArchList:
- KeyList.append(ConvertArchForInstall(Arch) + '.' + ModuleType)
-
- for Key in KeyList:
- if Key in NewSectionDict:
- NewSectionDict[Key] = NewSectionDict[Key] + [Statement]
- else:
- NewSectionDict[Key] = [Statement]
-
- Content += GenSection('Depex', NewSectionDict, False)
-
- return Content
-
-## GenUserExtensions
-#
-# GenUserExtensions
-#
-def GenUserExtensions(ModuleObject):
- NewSectionDict = {}
- for UserExtension in ModuleObject.GetUserExtensionList():
- if UserExtension.GetIdentifier() == 'Depex':
- continue
- Statement = UserExtension.GetStatement()
- if not Statement:
- continue
-
- ArchList = UserExtension.GetSupArchList()
- for Index in xrange(0, len(ArchList)):
- ArchList[Index] = ConvertArchForInstall(ArchList[Index])
- ArchList.sort()
-
- KeyList = []
- CommonPreFix = ''
- if UserExtension.GetUserID():
- CommonPreFix = UserExtension.GetUserID()
- if CommonPreFix.find('.') > -1:
- CommonPreFix = '"' + CommonPreFix + '"'
- if UserExtension.GetIdentifier():
- CommonPreFix += '.' + '"' + UserExtension.GetIdentifier() + '"'
- if ArchList:
- KeyList = [CommonPreFix + '.' + Arch for Arch in ArchList]
- else:
- KeyList = [CommonPreFix]
-
- for Key in KeyList:
- if Key in NewSectionDict:
- NewSectionDict[Key] = NewSectionDict[Key] + [Statement]
- else:
- NewSectionDict[Key] = [Statement]
- Content = GenSection('UserExtensions', NewSectionDict, False)
-
- return Content
-
-# GenSourceStatement
-#
-# @param SourceFile: string of source file path/name
-# @param Family: string of source file family field
-# @param FeatureFlag: string of source file FeatureFlag field
-# @param TagName: string of source file TagName field
-# @param ToolCode: string of source file ToolCode field
-# @param HelpStr: string of source file HelpStr field
-#
-# @retval Statement: The generated statement for source
-#
-def GenSourceStatement(SourceFile, Family, FeatureFlag, TagName=None,
- ToolCode=None, HelpStr=None):
- Statement = ''
- if HelpStr:
- Statement += GenGenericCommentF(HelpStr)
- #
- # format of SourceFile|Family|TagName|ToolCode|FeatureFlag
- #
- Statement += SourceFile
-
- if TagName == None:
- TagName = ''
- if ToolCode == None:
- ToolCode = ''
- if HelpStr == None:
- HelpStr = ''
-
- if FeatureFlag:
- Statement += '|' + Family + '|' + TagName + '|' + ToolCode + '|' + FeatureFlag
- elif ToolCode:
- Statement += '|' + Family + '|' + TagName + '|' + ToolCode
- elif TagName:
- Statement += '|' + Family + '|' + TagName
- elif Family:
- Statement += '|' + Family
-
- return Statement
-
-# GenBinaryStatement
-#
-# @param Key: (FileName, FileType, FFE, SortedArch)
-# @param Value: (Target, Family, TagName, Comment)
-#
-#
-def GenBinaryStatement(Key, Value):
- (FileName, FileType, FFE, SortedArch) = Key
- if SortedArch:
- pass
- if Value:
- (Target, Family, TagName, Comment) = Value
- else:
- Target = ''
- Family = ''
- TagName = ''
- Comment = ''
-
- if Comment:
- Statement = GenGenericCommentF(Comment)
- else:
- Statement = ''
-
- Statement += FileType + '|' + FileName
-
- if FileType in DT.BINARY_FILE_TYPE_UI_LIST + DT.BINARY_FILE_TYPE_VER_LIST:
- if FFE:
- Statement += '|' + Target + '|' + FFE
- elif Target:
- Statement += '|' + Target
- else:
- if FFE:
- Statement += '|' + Target + '|' + Family + '|' + TagName + '|' + FFE
- elif TagName:
- Statement += '|' + Target + '|' + Family + '|' + TagName
- elif Family:
- Statement += '|' + Target + '|' + Family
- elif Target:
- Statement += '|' + Target
-
- return Statement
-
-## GenGuidSections
-#
-# @param GuidObjList: List of GuidObject
-# @retVal Content: The generated section contents
-#
-def GenGuidSections(GuidObjList):
- #
- # generate [Guids] section
- #
- Content = ''
- GuidDict = Sdict()
-
- for Guid in GuidObjList:
- HelpTextList = Guid.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
-
- CName = Guid.GetCName()
- FFE = Guid.GetFeatureFlag()
- Statement = CName
- if FFE:
- Statement += '|' + FFE
-
- Usage = Guid.GetUsage()
- GuidType = Guid.GetGuidTypeList()[0]
- VariableName = Guid.GetVariableName()
-
- #
- # we need to differentiate the generic comment and usage comment
- # as multiple generic comment need to be put at first
- #
- if Usage == DT.ITEM_UNDEFINED and GuidType == DT.ITEM_UNDEFINED:
- # generate list of generic comment
- Comment = GenGenericCommentF(HelpStr)
- else:
- # generate list of other comment
- Comment = HelpStr.replace('\n', ' ')
- Comment = Comment.strip()
- if Comment:
- Comment = ' # ' + Comment
- else:
- Comment = ''
-
- if Usage != DT.ITEM_UNDEFINED and GuidType == DT.ITEM_UNDEFINED:
- Comment = '## ' + Usage + Comment
- elif GuidType == 'Variable':
- Comment = '## ' + Usage + ' ## ' + GuidType + ':' + VariableName + Comment
- else:
- Comment = '## ' + Usage + ' ## ' + GuidType + Comment
-
- if Comment:
- Comment += '\n'
-
- #
- # merge duplicate items
- #
- ArchList = Guid.GetSupArchList()
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
- if (Statement, SortedArch) in GuidDict:
- PreviousComment = GuidDict[Statement, SortedArch]
- Comment = PreviousComment + Comment
- GuidDict[Statement, SortedArch] = Comment
-
-
- NewSectionDict = GenMetaFileMisc.TransferDict(GuidDict)
-
- #
- # generate the section contents
- #
- if NewSectionDict:
- Content = GenSection('Guids', NewSectionDict)
-
- return Content
-
-## GenProtocolPPiSections
-#
-# @param ObjList: List of ProtocolObject or Ppi Object
-# @retVal Content: The generated section contents
-#
-def GenProtocolPPiSections(ObjList, IsProtocol):
- Content = ''
- Dict = Sdict()
- for Object in ObjList:
- HelpTextList = Object.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
-
- CName = Object.GetCName()
- FFE = Object.GetFeatureFlag()
- Statement = CName
- if FFE:
- Statement += '|' + FFE
-
- Usage = Object.GetUsage()
- Notify = Object.GetNotify()
-
- #
- # we need to differentiate the generic comment and usage comment
- # as consecutive generic comment need to be put together
- #
- if Usage == DT.ITEM_UNDEFINED and Notify == '':
- # generate list of generic comment
- Comment = GenGenericCommentF(HelpStr)
- else:
- # generate list of other comment
- Comment = HelpStr.replace('\n', ' ')
- Comment = Comment.strip()
- if Comment:
- Comment = ' # ' + Comment
- else:
- Comment = ''
-
- if Usage == DT.ITEM_UNDEFINED and not Comment and Notify == '':
- Comment = ''
- else:
- if Notify:
- Comment = '## ' + Usage + ' ## ' + 'NOTIFY' + Comment
- else:
- Comment = '## ' + Usage + Comment
-
- if Comment:
- Comment += '\n'
-
- #
- # merge duplicate items
- #
- ArchList = Object.GetSupArchList()
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
- if (Statement, SortedArch) in Dict:
- PreviousComment = Dict[Statement, SortedArch]
- Comment = PreviousComment + Comment
- Dict[Statement, SortedArch] = Comment
-
- NewSectionDict = GenMetaFileMisc.TransferDict(Dict)
-
- #
- # generate the section contents
- #
- if NewSectionDict:
- if IsProtocol:
- Content = GenSection('Protocols', NewSectionDict)
- else:
- Content = GenSection('Ppis', NewSectionDict)
-
- return Content
-
-## GenPcdSections
-#
-#
-def GenPcdSections(ModuleObject):
- Content = ''
- if not GlobalData.gIS_BINARY_INF:
- #
- # for each Pcd Itemtype, maintain a dict so the same type will be grouped
- # together
- #
- ItemTypeDict = {}
- for Pcd in ModuleObject.GetPcdList():
- HelpTextList = Pcd.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
-
- Statement = ''
- CName = Pcd.GetCName()
- TokenSpaceGuidCName = Pcd.GetTokenSpaceGuidCName()
- DefaultValue = Pcd.GetDefaultValue()
- ItemType = Pcd.GetItemType()
- if ItemType in ItemTypeDict:
- Dict = ItemTypeDict[ItemType]
- else:
- Dict = Sdict()
- ItemTypeDict[ItemType] = Dict
-
- FFE = Pcd.GetFeatureFlag()
- Statement += TokenSpaceGuidCName + '.' + CName
- if DefaultValue:
- Statement += '|' + DefaultValue
- if FFE:
- Statement += '|' + FFE
- elif FFE:
- Statement += '||' + FFE
-
- #
- # Generate comment
- #
- Usage = Pcd.GetValidUsage()
-
- #
- # if FeatureFlag Pcd, then assume all Usage is CONSUMES
- #
- if ItemType == DT.TAB_INF_FEATURE_PCD:
- Usage = DT.USAGE_ITEM_CONSUMES
- if Usage == DT.ITEM_UNDEFINED or (ItemType == DT.TAB_INF_FEATURE_PCD):
- # generate list of generic comment
- Comment = GenGenericCommentF(HelpStr)
- else:
- # generate list of other comment
- Comment = HelpStr.replace('\n', ' ')
- Comment = Comment.strip()
- if Comment:
- Comment = ' # ' + Comment
- else:
- Comment = ''
-
- Comment = '## ' + Usage + Comment
-
- if Comment:
- Comment += '\n'
-
- #
- # Merge duplicate entries
- #
- ArchList = Pcd.GetSupArchList()
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
- if (Statement, SortedArch) in Dict:
- PreviousComment = Dict[Statement, SortedArch]
- Comment = PreviousComment + Comment
- Dict[Statement, SortedArch] = Comment
-
- for ItemType in ItemTypeDict:
- #
- # First we need to transfer the Dict to use SortedArch as key
- #
- Dict = ItemTypeDict[ItemType]
- NewSectionDict = GenMetaFileMisc.TransferDict(Dict)
-
- if NewSectionDict:
- Content += GenSection(ItemType, NewSectionDict)
- #
- # For AsBuild INF files
- #
- else:
- Content += GenAsBuiltPacthPcdSections(ModuleObject)
- Content += GenAsBuiltPcdExSections(ModuleObject)
-
- return Content
-
-## GenPcdSections
-#
-#
-def GenAsBuiltPacthPcdSections(ModuleObject):
- PatchPcdDict = {}
- for BinaryFile in ModuleObject.GetBinaryFileList():
- if not BinaryFile.AsBuiltList:
- continue
- for PatchPcd in BinaryFile.AsBuiltList[0].PatchPcdList:
- TokenSpaceName = ''
- PcdCName = PatchPcd.CName
- PcdValue = PatchPcd.DefaultValue
- PcdOffset = PatchPcd.Offset
- TokenSpaceGuidValue = PatchPcd.TokenSpaceGuidValue
- Token = PatchPcd.Token
- HelpTextList = PatchPcd.HelpTextList
- HelpString = ''
- for HelpStringItem in HelpTextList:
- for HelpLine in GetSplitValueList(HelpStringItem.String, '\n'):
- HelpString += '# ' + HelpLine + '\n'
-
- TokenSpaceName, PcdCName = GenMetaFileMisc.ObtainPcdName(ModuleObject.PackageDependencyList,
- TokenSpaceGuidValue,
- Token)
- if TokenSpaceName == '' or PcdCName == '':
- Logger.Error("Upt",
- ToolError.RESOURCE_NOT_AVAILABLE,
- ST.ERR_INSTALL_FILE_DEC_FILE_ERROR%(TokenSpaceGuidValue, Token),
- File=ModuleObject.GetFullPath())
- Statement = HelpString[:-3] + TokenSpaceName + '.' + PcdCName + ' | ' + PcdValue + ' | ' + PcdOffset
-
- if len(BinaryFile.SupArchList) == 0:
- if PatchPcdDict.has_key('COMMON'):
- PatchPcdDict['COMMON'].append(Statement)
- else:
- PatchPcdDict['COMMON'] = [Statement]
- else:
- for Arch in BinaryFile.SupArchList:
- if PatchPcdDict.has_key(Arch):
- PatchPcdDict[Arch].append(Statement)
- else:
- PatchPcdDict[Arch] = [Statement]
- return GenSection('PatchPcd', PatchPcdDict)
-
-## GenPcdSections
-#
-#
-def GenAsBuiltPcdExSections(ModuleObject):
- PcdExDict = {}
- for BinaryFile in ModuleObject.GetBinaryFileList():
- if not BinaryFile.AsBuiltList:
- continue
- for PcdExItem in BinaryFile.AsBuiltList[0].PcdExValueList:
- TokenSpaceName = ''
- PcdCName = PcdExItem.CName
- PcdValue = PcdExItem.DefaultValue
- TokenSpaceGuidValue = PcdExItem.TokenSpaceGuidValue
- Token = PcdExItem.Token
- HelpTextList = PcdExItem.HelpTextList
- HelpString = ''
- for HelpStringItem in HelpTextList:
- for HelpLine in GetSplitValueList(HelpStringItem.String, '\n'):
- HelpString += '# ' + HelpLine + '\n'
- TokenSpaceName, PcdCName = GenMetaFileMisc.ObtainPcdName(ModuleObject.PackageDependencyList,
- TokenSpaceGuidValue, Token)
-
- if TokenSpaceName == '' or PcdCName == '':
- Logger.Error("Upt",
- ToolError.RESOURCE_NOT_AVAILABLE,
- ST.ERR_INSTALL_FILE_DEC_FILE_ERROR%(TokenSpaceGuidValue, Token),
- File=ModuleObject.GetFullPath())
-
- Statement = HelpString[:-3] + TokenSpaceName + '.' + PcdCName + ' | ' + PcdValue
-
- if len(BinaryFile.SupArchList) == 0:
- if PcdExDict.has_key('COMMON'):
- PcdExDict['COMMON'].append(Statement)
- else:
- PcdExDict['COMMON'] = [Statement]
- else:
- for Arch in BinaryFile.SupArchList:
- if PcdExDict.has_key(Arch):
- PcdExDict[Arch].append(Statement)
- else:
- PcdExDict[Arch] = [Statement]
- return GenSection('PcdEx', PcdExDict)
-
-## GenSpecialSections
-# generate special sections for Event/BootMode/Hob
-#
-def GenSpecialSections(ObjectList, SectionName):
- #
- # generate section
- #
- Content = ''
- NewSectionDict = {}
- for Obj in ObjectList:
- #
- # Generate comment
- #
- CommentStr = ''
- HelpTextList = Obj.GetHelpTextList()
- HelpStr = _GetHelpStr(HelpTextList)
- CommentStr = GenGenericCommentF(HelpStr)
-
- if SectionName == 'Hob':
- Type = Obj.GetHobType()
- elif SectionName == 'Event':
- Type = Obj.GetEventType()
- elif SectionName == 'BootMode':
- Type = Obj.GetSupportedBootModes()
- else:
- assert(SectionName)
-
- Usage = Obj.GetUsage()
- Statement = ' ' + Type + ' ## ' + Usage
-
- if CommentStr in ['#\n', '#\n#\n']:
- CommentStr = '#\n#\n#\n'
- #
- # the first head comment line should start with '##\n',
- # if it starts with '#\n', then add one '#'
- # else add '##\n' to meet the format defined in INF spec
- #
- if CommentStr.startswith('#\n'):
- CommentStr = '#' + CommentStr
- elif CommentStr:
- CommentStr = '##\n' + CommentStr
-
- if CommentStr and not CommentStr.endswith('\n#\n'):
- CommentStr = CommentStr + '#\n'
-
- NewStateMent = CommentStr + Statement
- SupArch = Obj.GetSupArchList()
- SupArch.sort()
- SortedArch = ' '.join(SupArch)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = NewSectionDict[SortedArch] + [NewStateMent]
- else:
- NewSectionDict[SortedArch] = [NewStateMent]
-
- SectionContent = GenSection(SectionName, NewSectionDict)
- SectionContent = SectionContent.strip()
- if SectionContent:
- Content = '# ' + ('\n' + '# ').join(GetSplitValueList(SectionContent, '\n'))
- Content = Content.lstrip()
- #
- # add two empty line after the generated section content to differentiate
- # it between other possible sections
- #
- if Content:
- Content += '\n#\n#\n'
- return Content
-
-## GenBuildOptions
-#
-#
-def GenBuildOptions(ModuleObject):
- Content = ''
- if not ModuleObject.BinaryModule:
- #
- # generate [BuildOptions] section
- #
- NewSectionDict = {}
- for UserExtension in ModuleObject.GetUserExtensionList():
- BuildOptionDict = UserExtension.GetBuildOptionDict()
- if not BuildOptionDict:
- continue
- for Arch in BuildOptionDict:
- if Arch in NewSectionDict:
- NewSectionDict[Arch] = NewSectionDict[Arch] + [BuildOptionDict[Arch]]
- else:
- NewSectionDict[Arch] = [BuildOptionDict[Arch]]
-
- Content = GenSection('BuildOptions', NewSectionDict)
- else:
- BuildOptionDict = {}
- for BinaryFile in ModuleObject.GetBinaryFileList():
- if not BinaryFile.AsBuiltList:
- continue
- for BuilOptionItem in BinaryFile.AsBuiltList[0].BinaryBuildFlagList:
- Statement = '#' + BuilOptionItem.AsBuiltOptionFlags
- if len(BinaryFile.SupArchList) == 0:
- if BuildOptionDict.has_key('COMMON'):
- if Statement not in BuildOptionDict['COMMON']:
- BuildOptionDict['COMMON'].append(Statement)
- else:
- BuildOptionDict['COMMON'] = ['## @AsBuilt']
- BuildOptionDict['COMMON'].append(Statement)
- else:
- for Arch in BinaryFile.SupArchList:
- if BuildOptionDict.has_key(Arch):
- if Statement not in BuildOptionDict[Arch]:
- BuildOptionDict[Arch].append(Statement)
- else:
- BuildOptionDict[Arch] = ['## @AsBuilt']
- BuildOptionDict[Arch].append(Statement)
-
- Content = GenSection('BuildOptions', BuildOptionDict)
-
- return Content
-
-## GenBinaries
-#
-#
-def GenBinaries(ModuleObject):
- NewSectionDict = {}
- BinariesDict = []
- for UserExtension in ModuleObject.GetUserExtensionList():
- BinariesDict = UserExtension.GetBinariesDict()
- if BinariesDict:
- break
-
- for BinaryFile in ModuleObject.GetBinaryFileList():
- FileNameObjList = BinaryFile.GetFileNameList()
- for FileNameObj in FileNameObjList:
- FileName = ConvertPath(FileNameObj.GetFilename())
- FileType = FileNameObj.GetFileType()
- FFE = FileNameObj.GetFeatureFlag()
- ArchList = FileNameObj.GetSupArchList()
- ArchList.sort()
- SortedArch = ' '.join(ArchList)
-
- Key = (FileName, FileType, FFE, SortedArch)
-
- if Key in BinariesDict:
- ValueList = BinariesDict[Key]
- for ValueItem in ValueList:
- Statement = GenBinaryStatement(Key, ValueItem)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = NewSectionDict[SortedArch] + [Statement]
- else:
- NewSectionDict[SortedArch] = [Statement]
- #
- # as we already generated statement for this DictKey
- # here set the Valuelist to be empty to avoid generate duplicate entries
- # as the DictKey may have multiple entries
- #
- BinariesDict[Key] = []
- else:
- Statement = GenBinaryStatement(Key, None)
- if SortedArch in NewSectionDict:
- NewSectionDict[SortedArch] = NewSectionDict[SortedArch] + [Statement]
- else:
- NewSectionDict[SortedArch] = [Statement]
-
- return GenSection('Binaries', NewSectionDict) \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py
deleted file mode 100644
index 54c113a9d0..0000000000
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py
+++ /dev/null
@@ -1,155 +0,0 @@
-## @file GenMetaFileMisc.py
-#
-# This file contained the miscellaneous routines for GenMetaFile usage.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-GenMetaFileMisc
-'''
-
-from Library import DataType as DT
-from Library import GlobalData
-from Parser.DecParser import Dec
-
-# AddExternToDefineSec
-#
-# @param SectionDict: string of source file path/name
-# @param Arch: string of source file family field
-# @param ExternList: string of source file FeatureFlag field
-#
-def AddExternToDefineSec(SectionDict, Arch, ExternList):
- for ArchList, EntryPoint, UnloadImage, Constructor, Destructor, FFE, HelpStringList in ExternList:
- if Arch or ArchList:
- if EntryPoint:
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_ENTRY_POINT, EntryPoint)
- if FFE:
- Statement += ' | %s' % FFE
- if len(HelpStringList) > 0:
- Statement = HelpStringList[0].GetString() + '\n' + Statement
- if len(HelpStringList) > 1:
- Statement = Statement + HelpStringList[1].GetString()
- SectionDict[Arch] = SectionDict[Arch] + [Statement]
- if UnloadImage:
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_UNLOAD_IMAGE, UnloadImage)
- if FFE:
- Statement += ' | %s' % FFE
-
- if len(HelpStringList) > 0:
- Statement = HelpStringList[0].GetString() + '\n' + Statement
- if len(HelpStringList) > 1:
- Statement = Statement + HelpStringList[1].GetString()
- SectionDict[Arch] = SectionDict[Arch] + [Statement]
- if Constructor:
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_CONSTRUCTOR, Constructor)
- if FFE:
- Statement += ' | %s' % FFE
-
- if len(HelpStringList) > 0:
- Statement = HelpStringList[0].GetString() + '\n' + Statement
- if len(HelpStringList) > 1:
- Statement = Statement + HelpStringList[1].GetString()
- SectionDict[Arch] = SectionDict[Arch] + [Statement]
- if Destructor:
- Statement = '%s = %s' % (DT.TAB_INF_DEFINES_DESTRUCTOR, Destructor)
- if FFE:
- Statement += ' | %s' % FFE
-
- if len(HelpStringList) > 0:
- Statement = HelpStringList[0].GetString() + '\n' + Statement
- if len(HelpStringList) > 1:
- Statement = Statement + HelpStringList[1].GetString()
- SectionDict[Arch] = SectionDict[Arch] + [Statement]
-
-## ObtainPcdName
-#
-# Using TokenSpaceGuidValue and Token to obtain PcdName from DEC file
-#
-def ObtainPcdName(Packages, TokenSpaceGuidValue, Token):
- for PackageDependency in Packages:
- #
- # Generate generic comment
- #
- Guid = PackageDependency.GetGuid()
- Version = PackageDependency.GetVersion()
-
- #
- # find package path/name
- #
- for PkgInfo in GlobalData.gWSPKG_LIST:
- if Guid == PkgInfo[1]:
- if (not Version) or (Version == PkgInfo[2]):
- Path = PkgInfo[3]
- break
-
- DecFile = Dec(Path)
- DecGuidsDict = DecFile.GetGuidSectionObject().ValueDict
- DecPcdsDict = DecFile.GetPcdSectionObject().ValueDict
-
- TokenSpaceGuidName = ''
- PcdCName = ''
- TokenSpaceGuidNameFound = False
- PcdCNameFound = False
-
- #
- # Get TokenSpaceGuidCName from Guids section
- #
- for GuidKey in DecGuidsDict:
- GuidList = DecGuidsDict[GuidKey]
- if TokenSpaceGuidNameFound:
- break
- for GuidItem in GuidList:
- if TokenSpaceGuidValue == GuidItem.GuidString:
- TokenSpaceGuidName = GuidItem.GuidCName
- TokenSpaceGuidNameFound = True
- break
-
- #
- # Retrieve PcdCName from Pcds Section
- #
- for PcdKey in DecPcdsDict:
- PcdList = DecPcdsDict[PcdKey]
- if PcdCNameFound:
- break
- for PcdItem in PcdList:
- if TokenSpaceGuidName == PcdItem.TokenSpaceGuidCName and Token == PcdItem.TokenValue:
- PcdCName = PcdItem.TokenCName
- PcdCNameFound = True
- break
-
- return TokenSpaceGuidName, PcdCName
-
-## _TransferDict
-# transfer dict that using (Statement, SortedArch) as key,
-# (GenericComment, UsageComment) as value into a dict that using SortedArch as
-# key and NewStatement as value
-#
-def TransferDict(OrigDict):
- NewDict = {}
-
- for Statement, SortedArch in OrigDict:
- Comment = OrigDict[Statement, SortedArch]
- #
- # apply the NComment/1Comment rule
- #
- if Comment.find('\n') != len(Comment) - 1:
- NewStateMent = Comment + Statement
- else:
- NewStateMent = Statement + ' ' + Comment.rstrip('\n')
-
- if SortedArch in NewDict:
- NewDict[SortedArch] = NewDict[SortedArch] + [NewStateMent]
- else:
- NewDict[SortedArch] = [NewStateMent]
-
- return NewDict
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py
deleted file mode 100644
index b1f427723c..0000000000
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py
+++ /dev/null
@@ -1,18 +0,0 @@
-## @file GenXmlFile.py
-#
-# This file contained the logical of generate XML files.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-GenXmlFile
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py b/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py
deleted file mode 100644
index 0f6ce81579..0000000000
--- a/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Library' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-GenMetaFile
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/InstallPkg.py b/BaseTools/Source/Python/UPT/InstallPkg.py
deleted file mode 100644
index 776196e8ea..0000000000
--- a/BaseTools/Source/Python/UPT/InstallPkg.py
+++ /dev/null
@@ -1,770 +0,0 @@
-## @file
-# Install distribution package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-"""
-Install a distribution package
-"""
-##
-# Import Modules
-#
-import os.path
-from os import chmod
-from os import SEEK_SET
-from os import SEEK_END
-import stat
-import md5
-from sys import stdin
-from sys import platform
-from shutil import rmtree
-from shutil import copyfile
-from traceback import format_exc
-from platform import python_version
-
-from Logger import StringTable as ST
-from Logger.ToolError import UNKNOWN_ERROR
-from Logger.ToolError import FILE_UNKNOWN_ERROR
-from Logger.ToolError import OPTION_MISSING
-from Logger.ToolError import UPT_ALREADY_INSTALLED_ERROR
-from Logger.ToolError import FatalError
-from Logger.ToolError import ABORT_ERROR
-from Logger.ToolError import CODE_ERROR
-from Logger.ToolError import FORMAT_INVALID
-from Logger.ToolError import FILE_TYPE_MISMATCH
-import Logger.Log as Logger
-
-from Library.Misc import CheckEnvVariable
-from Library.Misc import Sdict
-from Library.Misc import ConvertPath
-from Library.ParserValidate import IsValidInstallPath
-from Xml.XmlParser import DistributionPackageXml
-from GenMetaFile.GenDecFile import PackageToDec
-from GenMetaFile.GenInfFile import ModuleToInf
-from Core.PackageFile import PackageFile
-from Core.PackageFile import FILE_NOT_FOUND
-from Core.PackageFile import FILE_CHECKSUM_FAILURE
-from Core.PackageFile import CreateDirectory
-from Core.DependencyRules import DependencyRules
-from Library import GlobalData
-
-## InstallNewPackage
-#
-# @param WorkspaceDir: Workspace Directory
-# @param Path: Package Path
-# @param CustomPath: whether need to customize path at first
-#
-def InstallNewPackage(WorkspaceDir, Path, CustomPath = False):
- if os.path.isabs(Path):
- Logger.Info(ST.MSG_RELATIVE_PATH_ONLY%Path)
- elif CustomPath:
- Logger.Info(ST.MSG_NEW_PKG_PATH)
- else:
- Path = ConvertPath(Path)
- Path = os.path.normpath(Path)
- FullPath = os.path.normpath(os.path.join(WorkspaceDir, Path))
- if os.path.exists(FullPath):
- Logger.Info(ST.ERR_DIR_ALREADY_EXIST%FullPath)
- else:
- return Path
-
- Input = stdin.readline()
- Input = Input.replace('\r', '').replace('\n', '')
- if Input == '':
- Logger.Error("InstallPkg", UNKNOWN_ERROR, ST.ERR_USER_INTERRUPT)
- Input = Input.replace('\r', '').replace('\n', '')
- return InstallNewPackage(WorkspaceDir, Input, False)
-
-
-## InstallNewModule
-#
-# @param WorkspaceDir: Workspace Directory
-# @param Path: Standalone Module Path
-# @param PathList: The already installed standalone module Path list
-#
-def InstallNewModule(WorkspaceDir, Path, PathList = None):
- if PathList == None:
- PathList = []
- Path = ConvertPath(Path)
- Path = os.path.normpath(Path)
- FullPath = os.path.normpath(os.path.join(WorkspaceDir, Path))
- if os.path.exists(FullPath) and FullPath not in PathList:
- Logger.Info(ST.ERR_DIR_ALREADY_EXIST%Path)
- elif Path == FullPath:
- Logger.Info(ST.MSG_RELATIVE_PATH_ONLY%FullPath)
- else:
- return Path
-
- Input = stdin.readline()
- Input = Input.replace('\r', '').replace('\n', '')
- if Input == '':
- Logger.Error("InstallPkg", UNKNOWN_ERROR, ST.ERR_USER_INTERRUPT)
- Input = Input.replace('\r', '').replace('\n', '')
- return InstallNewModule(WorkspaceDir, Input, PathList)
-
-
-## InstallNewFile
-#
-# @param WorkspaceDir: Workspace Direction
-# @param File: File
-#
-def InstallNewFile(WorkspaceDir, File):
- FullPath = os.path.normpath(os.path.join(WorkspaceDir, File))
- if os.path.exists(FullPath):
- Logger.Info(ST.ERR_FILE_ALREADY_EXIST %File)
- Input = stdin.readline()
- Input = Input.replace('\r', '').replace('\n', '')
- if Input == '':
- Logger.Error("InstallPkg", UNKNOWN_ERROR, ST.ERR_USER_INTERRUPT)
- Input = Input.replace('\r', '').replace('\n', '')
- return InstallNewFile(WorkspaceDir, Input)
- else:
- return File
-
-## UnZipDp
-#
-# UnZipDp
-#
-def UnZipDp(WorkspaceDir, Options, DataBase):
- ContentZipFile = None
- Logger.Quiet(ST.MSG_UZIP_PARSE_XML)
- DpPkgFileName = Options.PackageFile
- DistFile = PackageFile(DpPkgFileName)
-
- DpDescFileName, ContentFileName = GetDPFile(DistFile.GetZipFile())
-
- GlobalData.gUNPACK_DIR = os.path.normpath(os.path.join(WorkspaceDir, ".tmp"))
- DistPkgFile = DistFile.UnpackFile(DpDescFileName,
- os.path.normpath(os.path.join(GlobalData.gUNPACK_DIR, DpDescFileName)))
- if not DistPkgFile:
- Logger.Error("InstallPkg", FILE_NOT_FOUND, ST.ERR_FILE_BROKEN %DpDescFileName)
-
- #
- # Generate distpkg
- #
- DistPkgObj = DistributionPackageXml()
- DistPkg = DistPkgObj.FromXml(DistPkgFile)
- if DistPkg.Header.RePackage == '':
- DistPkg.Header.RePackage = False
- if DistPkg.Header.ReadOnly == '':
- DistPkg.Header.ReadOnly = False
-
- #
- # prepare check dependency
- #
- Dep = DependencyRules(DataBase)
- #
- # Check distribution package installed or not
- #
- if Dep.CheckDpExists(DistPkg.Header.GetGuid(),
- DistPkg.Header.GetVersion()):
- Logger.Error("InstallPkg", UPT_ALREADY_INSTALLED_ERROR,
- ST.WRN_DIST_PKG_INSTALLED)
- #
- # Check distribution dependency (all module dependency should be
- # satisfied)
- #
- if not Dep.CheckDpDepexSatisfied(DistPkg):
- Logger.Error("InstallPkg", UNKNOWN_ERROR,
- ST.ERR_PACKAGE_NOT_MATCH_DEPENDENCY,
- ExtraData=DistPkg.Header.Name)
- #
- # unzip contents.zip file
- #
- ContentFile = DistFile.UnpackFile(ContentFileName,
- os.path.normpath(os.path.join(GlobalData.gUNPACK_DIR, ContentFileName)))
- if not ContentFile:
- Logger.Error("InstallPkg", FILE_NOT_FOUND,
- ST.ERR_FILE_BROKEN % ContentFileName)
-
- FilePointer = open(ContentFile, "rb")
- #
- # Assume no archive comment.
- #
- FilePointer.seek(0, SEEK_SET)
- FilePointer.seek(0, SEEK_END)
- #
- # Get file size
- #
- FileSize = FilePointer.tell()
- FilePointer.close()
-
- if FileSize != 0:
- ContentZipFile = PackageFile(ContentFile)
-
- #
- # verify MD5 signature when existed
- #
- if DistPkg.Header.Signature != '':
- Md5Sigature = md5.new(open(ContentFile, 'rb').read())
- if DistPkg.Header.Signature != Md5Sigature.hexdigest():
- ContentZipFile.Close()
- Logger.Error("InstallPkg", FILE_CHECKSUM_FAILURE,
- ExtraData=ContentFile)
-
- return DistPkg, Dep, ContentZipFile, DpPkgFileName
-
-## GetPackageList
-#
-# GetPackageList
-#
-def GetPackageList(DistPkg, Dep, WorkspaceDir, Options, ContentZipFile, ModuleList, PackageList):
- NewDict = Sdict()
- for Guid, Version, Path in DistPkg.PackageSurfaceArea:
- PackagePath = Path
- Package = DistPkg.PackageSurfaceArea[Guid, Version, Path]
- Logger.Info(ST.MSG_INSTALL_PACKAGE % Package.GetName())
- if Dep.CheckPackageExists(Guid, Version):
- Logger.Info(ST.WRN_PACKAGE_EXISTED %(Guid, Version))
- NewPackagePath = InstallNewPackage(WorkspaceDir, PackagePath, Options.CustomPath)
- InstallPackageContent(PackagePath, NewPackagePath, Package, ContentZipFile, Dep, WorkspaceDir, ModuleList,
- DistPkg.Header.ReadOnly)
- PackageList.append(Package)
-
- NewDict[Guid, Version, Package.GetPackagePath()] = Package
-
- #
- # Now generate meta-data files, first generate all dec for package
- # dec should be generated before inf, and inf should be generated after
- # all packages installed, else hard to resolve modules' package
- # dependency (Hard to get the location of the newly installed package)
- #
- for Package in PackageList:
- FilePath = PackageToDec(Package)
- Md5Sigature = md5.new(open(str(FilePath), 'rb').read())
- Md5Sum = Md5Sigature.hexdigest()
- if (FilePath, Md5Sum) not in Package.FileList:
- Package.FileList.append((FilePath, Md5Sum))
-
- return NewDict
-
-## GetModuleList
-#
-# GetModuleList
-#
-def GetModuleList(DistPkg, Dep, WorkspaceDir, ContentZipFile, ModuleList):
- #
- # ModulePathList will keep track of the standalone module path that
- # we just installed. If a new module's path in that list
- # (only multiple INF in one directory will be so), we will
- # install them directly. If not, we will try to create a new directory
- # for it.
- #
- ModulePathList = []
-
- #
- # Check module exist and install
- #
- Module = None
- NewDict = Sdict()
- for Guid, Version, Name, Path in DistPkg.ModuleSurfaceArea:
- ModulePath = Path
- Module = DistPkg.ModuleSurfaceArea[Guid, Version, Name, Path]
- Logger.Info(ST.MSG_INSTALL_MODULE % Module.GetName())
- if Dep.CheckModuleExists(Guid, Version, Name, Path):
- Logger.Quiet(ST.WRN_MODULE_EXISTED %Path)
- #
- # here check for the multiple inf share the same module path cases:
- # they should be installed into the same directory
- #
- ModuleFullPath = \
- os.path.normpath(os.path.join(WorkspaceDir, ModulePath))
- if ModuleFullPath not in ModulePathList:
- NewModulePath = InstallNewModule(WorkspaceDir, ModulePath, ModulePathList)
- NewModuleFullPath = os.path.normpath(os.path.join(WorkspaceDir, NewModulePath))
- ModulePathList.append(NewModuleFullPath)
- else:
- NewModulePath = ModulePath
-
- InstallModuleContent(ModulePath, NewModulePath, '', Module, ContentZipFile, WorkspaceDir, ModuleList, None,
- DistPkg.Header.ReadOnly)
- #
- # Update module
- #
- Module.SetModulePath(Module.GetModulePath().replace(Path, NewModulePath, 1))
-
- NewDict[Guid, Version, Name, Module.GetModulePath()] = Module
-
- #
- # generate all inf for modules
- #
- for (Module, Package) in ModuleList:
- FilePath = ModuleToInf(Module)
- Md5Sigature = md5.new(open(str(FilePath), 'rb').read())
- Md5Sum = Md5Sigature.hexdigest()
- if Package:
- if (FilePath, Md5Sum) not in Package.FileList:
- Package.FileList.append((FilePath, Md5Sum))
- else:
- if (FilePath, Md5Sum) not in Module.FileList:
- Module.FileList.append((FilePath, Md5Sum))
-
- return NewDict
-
-## GenToolMisc
-#
-# GenToolMisc
-#
-#
-def GenToolMisc(DistPkg, WorkspaceDir, ContentZipFile):
- ToolObject = DistPkg.Tools
- MiscObject = DistPkg.MiscellaneousFiles
- DistPkg.FileList = []
- FileList = []
- ToolFileNum = 0
- FileNum = 0
- RootDir = WorkspaceDir
-
- #
- # FileList stores both tools files and misc files
- # Misc file list must be appended to FileList *AFTER* Tools file list
- #
- if ToolObject:
- FileList += ToolObject.GetFileList()
- ToolFileNum = len(ToolObject.GetFileList())
- if 'EDK_TOOLS_PATH' in os.environ:
- RootDir = os.environ['EDK_TOOLS_PATH']
- if MiscObject:
- FileList += MiscObject.GetFileList()
- for FileObject in FileList:
- FileNum += 1
- if FileNum > ToolFileNum:
- #
- # Misc files, root should be changed to WORKSPACE
- #
- RootDir = WorkspaceDir
- File = ConvertPath(FileObject.GetURI())
- ToFile = os.path.normpath(os.path.join(RootDir, File))
- if os.path.exists(ToFile):
- Logger.Info( ST.WRN_FILE_EXISTED % ToFile )
- #
- # ask for user input the new file name
- #
- Logger.Info( ST.MSG_NEW_FILE_NAME)
- Input = stdin.readline()
- Input = Input.replace('\r', '').replace('\n', '')
- OrigPath = os.path.split(ToFile)[0]
- ToFile = os.path.normpath(os.path.join(OrigPath, Input))
- FromFile = os.path.join(FileObject.GetURI())
- Md5Sum = InstallFile(ContentZipFile, FromFile, ToFile, DistPkg.Header.ReadOnly, FileObject.GetExecutable())
- DistPkg.FileList.append((ToFile, Md5Sum))
-
-## Tool entrance method
-#
-# This method mainly dispatch specific methods per the command line options.
-# If no error found, return zero value so the caller of this tool can know
-# if it's executed successfully or not.
-#
-# @param Options: command Options
-#
-def Main(Options = None):
- ContentZipFile, DistFile = None, None
-
- try:
- DataBase = GlobalData.gDB
- CheckEnvVariable()
- WorkspaceDir = GlobalData.gWORKSPACE
- if not Options.PackageFile:
- Logger.Error("InstallPkg", OPTION_MISSING, ExtraData=ST.ERR_SPECIFY_PACKAGE)
-
- #
- # unzip dist.pkg file
- #
- DistPkg, Dep, ContentZipFile, DpPkgFileName = UnZipDp(WorkspaceDir, Options, DataBase)
-
- #
- # PackageList, ModuleList record the information for the meta-data
- # files that need to be generated later
- #
- PackageList = []
- ModuleList = []
- DistPkg.PackageSurfaceArea = GetPackageList(DistPkg, Dep, WorkspaceDir, Options,
- ContentZipFile, ModuleList, PackageList)
-
- DistPkg.ModuleSurfaceArea = GetModuleList(DistPkg, Dep, WorkspaceDir, ContentZipFile, ModuleList)
-
-
- GenToolMisc(DistPkg, WorkspaceDir, ContentZipFile)
-
- #
- # copy "Distribution File" to directory $(WORKSPACE)/conf/upt
- #
- DistFileName = os.path.split(DpPkgFileName)[1]
- DestDir = os.path.normpath(os.path.join(WorkspaceDir, GlobalData.gUPT_DIR))
- CreateDirectory(DestDir)
- DestFile = os.path.normpath(os.path.join(DestDir, DistFileName))
- if os.path.exists(DestFile):
- FileName, Ext = os.path.splitext(DistFileName)
- NewFileName = FileName + '_' + DistPkg.Header.GetGuid() + '_' + DistPkg.Header.GetVersion() + Ext
- DestFile = os.path.normpath(os.path.join(DestDir, NewFileName))
- if os.path.exists(DestFile):
- #
- # ask for user input the new file name
- #
- Logger.Info( ST.MSG_NEW_FILE_NAME_FOR_DIST)
- Input = stdin.readline()
- Input = Input.replace('\r', '').replace('\n', '')
- DestFile = os.path.normpath(os.path.join(DestDir, Input))
- copyfile(DpPkgFileName, DestFile)
- NewDpPkgFileName = DestFile[DestFile.find(DestDir) + len(DestDir) + 1:]
-
- #
- # update database
- #
- Logger.Quiet(ST.MSG_UPDATE_PACKAGE_DATABASE)
- DataBase.AddDPObject(DistPkg, NewDpPkgFileName, DistFileName,
- DistPkg.Header.RePackage)
-
- ReturnCode = 0
-
- except FatalError, XExcept:
- ReturnCode = XExcept.args[0]
- if Logger.GetLevel() <= Logger.DEBUG_9:
- Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),
- platform) + format_exc())
- except KeyboardInterrupt:
- ReturnCode = ABORT_ERROR
- if Logger.GetLevel() <= Logger.DEBUG_9:
- Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),
- platform) + format_exc())
- except:
- ReturnCode = CODE_ERROR
- Logger.Error(
- "\nInstallPkg",
- CODE_ERROR,
- ST.ERR_UNKNOWN_FATAL_INSTALL_ERR % Options.PackageFile,
- ExtraData=ST.MSG_SEARCH_FOR_HELP,
- RaiseError=False
- )
- Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),
- platform) + format_exc())
-
- finally:
- Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_STARTED)
- if DistFile:
- DistFile.Close()
- if ContentZipFile:
- ContentZipFile.Close()
- if GlobalData.gUNPACK_DIR:
- rmtree(GlobalData.gUNPACK_DIR)
- GlobalData.gUNPACK_DIR = None
- Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_DONE)
-
- if ReturnCode == 0:
- Logger.Quiet(ST.MSG_FINISH)
-
- return ReturnCode
-
-## InstallModuleContent method
-#
-# If this is standalone module, then Package should be none,
-# ModulePath should be ''
-# @param FromPath: FromPath
-# @param NewPath: NewPath
-# @param ModulePath: ModulePath
-# @param Module: Module
-# @param ContentZipFile: ContentZipFile
-# @param WorkspaceDir: WorkspaceDir
-# @param ModuleList: ModuleList
-# @param Package: Package
-#
-def InstallModuleContent(FromPath, NewPath, ModulePath, Module, ContentZipFile,
- WorkspaceDir, ModuleList, Package = None, ReadOnly = False):
-
- if NewPath.startswith("\\") or NewPath.startswith("/"):
- NewPath = NewPath[1:]
-
- if not IsValidInstallPath(NewPath):
- Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%NewPath)
-
- NewModuleFullPath = os.path.normpath(os.path.join(WorkspaceDir, NewPath,
- ConvertPath(ModulePath)))
- Module.SetFullPath(os.path.normpath(os.path.join(NewModuleFullPath,
- ConvertPath(Module.GetName()) + '.inf')))
- Module.FileList = []
-
- for MiscFile in Module.GetMiscFileList():
- if not MiscFile:
- continue
- for Item in MiscFile.GetFileList():
- File = Item.GetURI()
- if File.startswith("\\") or File.startswith("/"):
- File = File[1:]
-
- if not IsValidInstallPath(File):
- Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%File)
-
- FromFile = os.path.join(FromPath, ModulePath, File)
- Executable = Item.GetExecutable()
- ToFile = os.path.normpath(os.path.join(NewModuleFullPath, ConvertPath(File)))
- Md5Sum = InstallFile(ContentZipFile, FromFile, ToFile, ReadOnly, Executable)
- if Package and ((ToFile, Md5Sum) not in Package.FileList):
- Package.FileList.append((ToFile, Md5Sum))
- elif Package:
- continue
- elif (ToFile, Md5Sum) not in Module.FileList:
- Module.FileList.append((ToFile, Md5Sum))
- for Item in Module.GetSourceFileList():
- File = Item.GetSourceFile()
- if File.startswith("\\") or File.startswith("/"):
- File = File[1:]
-
- if not IsValidInstallPath(File):
- Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%File)
-
- FromFile = os.path.join(FromPath, ModulePath, File)
- ToFile = os.path.normpath(os.path.join(NewModuleFullPath, ConvertPath(File)))
- Md5Sum = InstallFile(ContentZipFile, FromFile, ToFile, ReadOnly)
- if Package and ((ToFile, Md5Sum) not in Package.FileList):
- Package.FileList.append((ToFile, Md5Sum))
- elif Package:
- continue
- elif (ToFile, Md5Sum) not in Module.FileList:
- Module.FileList.append((ToFile, Md5Sum))
- for Item in Module.GetBinaryFileList():
- FileNameList = Item.GetFileNameList()
- for FileName in FileNameList:
- File = FileName.GetFilename()
- if File.startswith("\\") or File.startswith("/"):
- File = File[1:]
-
- if not IsValidInstallPath(File):
- Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%File)
-
- FromFile = os.path.join(FromPath, ModulePath, File)
- ToFile = os.path.normpath(os.path.join(NewModuleFullPath, ConvertPath(File)))
- Md5Sum = InstallFile(ContentZipFile, FromFile, ToFile, ReadOnly)
- if Package and ((ToFile, Md5Sum) not in Package.FileList):
- Package.FileList.append((ToFile, Md5Sum))
- elif Package:
- continue
- elif (ToFile, Md5Sum) not in Module.FileList:
- Module.FileList.append((ToFile, Md5Sum))
-
- InstallModuleContentZipFile(ContentZipFile, FromPath, ModulePath, WorkspaceDir, NewPath, Module, Package, ReadOnly,
- ModuleList)
-
-## InstallModuleContentZipFile
-#
-# InstallModuleContentZipFile
-#
-def InstallModuleContentZipFile(ContentZipFile, FromPath, ModulePath, WorkspaceDir, NewPath, Module, Package, ReadOnly,
- ModuleList):
- #
- # Extract other files under current module path in content Zip file but not listed in the description
- #
- if ContentZipFile:
- for FileName in ContentZipFile.GetZipFile().namelist():
- FileName = os.path.normpath(FileName)
- CheckPath = os.path.normpath(os.path.join(FromPath, ModulePath))
- if FileUnderPath(FileName, CheckPath):
- if FileName.startswith("\\") or FileName.startswith("/"):
- FileName = FileName[1:]
-
- if not IsValidInstallPath(FileName):
- Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%FileName)
-
- FromFile = FileName
- ToFile = os.path.normpath(os.path.join(WorkspaceDir,
- ConvertPath(FileName.replace(FromPath, NewPath, 1))))
- CheckList = Module.FileList
- if Package:
- CheckList += Package.FileList
- for Item in CheckList:
- if Item[0] == ToFile:
- break
- else:
- Md5Sum = InstallFile(ContentZipFile, FromFile, ToFile, ReadOnly)
- if Package and ((ToFile, Md5Sum) not in Package.FileList):
- Package.FileList.append((ToFile, Md5Sum))
- elif Package:
- continue
- elif (ToFile, Md5Sum) not in Module.FileList:
- Module.FileList.append((ToFile, Md5Sum))
-
- ModuleList.append((Module, Package))
-
-## FileUnderPath
-# Check whether FileName started with directory specified by CheckPath
-#
-# @param FileName: the FileName need to be checked
-# @param CheckPath: the path need to be checked against
-# @return: True or False
-#
-def FileUnderPath(FileName, CheckPath):
- FileName = FileName.replace('\\', '/')
- FileName = os.path.normpath(FileName)
- CheckPath = CheckPath.replace('\\', '/')
- CheckPath = os.path.normpath(CheckPath)
- if FileName.startswith(CheckPath):
- RemainingPath = os.path.normpath(FileName.replace(CheckPath, '', 1))
- while RemainingPath.startswith('\\') or RemainingPath.startswith('/'):
- RemainingPath = RemainingPath[1:]
- if FileName == os.path.normpath(os.path.join(CheckPath, RemainingPath)):
- return True
-
- return False
-
-## InstallFile
-# Extract File from Zipfile, set file attribute, and return the Md5Sum
-#
-# @return: True or False
-#
-def InstallFile(ContentZipFile, FromFile, ToFile, ReadOnly, Executable=False):
- if not ContentZipFile or not ContentZipFile.UnpackFile(FromFile, ToFile):
- Logger.Error("UPT", FILE_NOT_FOUND, ST.ERR_INSTALL_FILE_FROM_EMPTY_CONTENT%FromFile)
-
- if ReadOnly:
- if not Executable:
- chmod(ToFile, stat.S_IREAD)
- else:
- chmod(ToFile, stat.S_IREAD|stat.S_IEXEC)
- elif Executable:
- chmod(ToFile, stat.S_IREAD|stat.S_IWRITE|stat.S_IEXEC)
- else:
- chmod(ToFile, stat.S_IREAD|stat.S_IWRITE)
-
- Md5Sigature = md5.new(open(str(ToFile), 'rb').read())
- Md5Sum = Md5Sigature.hexdigest()
- return Md5Sum
-
-## InstallPackageContent method
-#
-# @param FromPath: FromPath
-# @param ToPath: ToPath
-# @param Package: Package
-# @param ContentZipFile: ContentZipFile
-# @param Dep: Dep
-# @param WorkspaceDir: WorkspaceDir
-# @param ModuleList: ModuleList
-#
-def InstallPackageContent(FromPath, ToPath, Package, ContentZipFile, Dep,
- WorkspaceDir, ModuleList, ReadOnly = False):
- if Dep:
- pass
- Package.FileList = []
-
- if ToPath.startswith("\\") or ToPath.startswith("/"):
- ToPath = ToPath[1:]
-
- if not IsValidInstallPath(ToPath):
- Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%ToPath)
-
- if FromPath.startswith("\\") or FromPath.startswith("/"):
- FromPath = FromPath[1:]
-
- if not IsValidInstallPath(FromPath):
- Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%FromPath)
-
- PackageFullPath = os.path.normpath(os.path.join(WorkspaceDir, ToPath))
- for MiscFile in Package.GetMiscFileList():
- for Item in MiscFile.GetFileList():
- FileName = Item.GetURI()
- if FileName.startswith("\\") or FileName.startswith("/"):
- FileName = FileName[1:]
-
- if not IsValidInstallPath(FileName):
- Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%FileName)
-
- FromFile = os.path.join(FromPath, FileName)
- Executable = Item.GetExecutable()
- ToFile = (os.path.join(PackageFullPath, ConvertPath(FileName)))
- Md5Sum = InstallFile(ContentZipFile, FromFile, ToFile, ReadOnly, Executable)
- if (ToFile, Md5Sum) not in Package.FileList:
- Package.FileList.append((ToFile, Md5Sum))
- PackageIncludeArchList = []
- for Item in Package.GetPackageIncludeFileList():
- FileName = Item.GetFilePath()
- if FileName.startswith("\\") or FileName.startswith("/"):
- FileName = FileName[1:]
-
- if not IsValidInstallPath(FileName):
- Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%FileName)
-
- FromFile = os.path.join(FromPath, FileName)
- ToFile = os.path.normpath(os.path.join(PackageFullPath, ConvertPath(FileName)))
- RetFile = ContentZipFile.UnpackFile(FromFile, ToFile)
- if RetFile == '':
- #
- # a non-exist path in Zipfile will return '', which means an include directory in our case
- # save the information for later DEC creation usage and also create the directory
- #
- PackageIncludeArchList.append([Item.GetFilePath(), Item.GetSupArchList()])
- CreateDirectory(ToFile)
- continue
- if ReadOnly:
- chmod(ToFile, stat.S_IREAD)
- else:
- chmod(ToFile, stat.S_IREAD|stat.S_IWRITE)
- Md5Sigature = md5.new(open(str(ToFile), 'rb').read())
- Md5Sum = Md5Sigature.hexdigest()
- if (ToFile, Md5Sum) not in Package.FileList:
- Package.FileList.append((ToFile, Md5Sum))
- Package.SetIncludeArchList(PackageIncludeArchList)
-
- for Item in Package.GetStandardIncludeFileList():
- FileName = Item.GetFilePath()
- if FileName.startswith("\\") or FileName.startswith("/"):
- FileName = FileName[1:]
-
- if not IsValidInstallPath(FileName):
- Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%FileName)
-
- FromFile = os.path.join(FromPath, FileName)
- ToFile = os.path.normpath(os.path.join(PackageFullPath, ConvertPath(FileName)))
- Md5Sum = InstallFile(ContentZipFile, FromFile, ToFile, ReadOnly)
- if (ToFile, Md5Sum) not in Package.FileList:
- Package.FileList.append((ToFile, Md5Sum))
-
- #
- # Update package
- #
- Package.SetPackagePath(Package.GetPackagePath().replace(FromPath,
- ToPath, 1))
- Package.SetFullPath(os.path.normpath(os.path.join(PackageFullPath,
- ConvertPath(Package.GetName()) + '.dec')))
-
- #
- # Install files in module
- #
- Module = None
- ModuleDict = Package.GetModuleDict()
- for ModuleGuid, ModuleVersion, ModuleName, ModulePath in ModuleDict:
- Module = ModuleDict[ModuleGuid, ModuleVersion, ModuleName, ModulePath]
- InstallModuleContent(FromPath, ToPath, ModulePath, Module,
- ContentZipFile, WorkspaceDir, ModuleList, Package, ReadOnly)
-
-## GetDPFile method
-#
-# @param ZipFile: A ZipFile
-#
-def GetDPFile(ZipFile):
- ContentFile = ''
- DescFile = ''
- for FileName in ZipFile.namelist():
- if FileName.endswith('.content'):
- if not ContentFile:
- ContentFile = FileName
- continue
- elif FileName.endswith('.pkg'):
- if not DescFile:
- DescFile = FileName
- continue
- else:
- continue
-
- Logger.Error("PackagingTool", FILE_TYPE_MISMATCH,
- ExtraData=ST.ERR_DIST_FILE_TOOMANY)
- if not DescFile or not ContentFile:
- Logger.Error("PackagingTool", FILE_UNKNOWN_ERROR,
- ExtraData=ST.ERR_DIST_FILE_TOOFEW)
- return DescFile, ContentFile
-
diff --git a/BaseTools/Source/Python/UPT/Library/CommentGenerating.py b/BaseTools/Source/Python/UPT/Library/CommentGenerating.py
deleted file mode 100644
index 06da61b3e9..0000000000
--- a/BaseTools/Source/Python/UPT/Library/CommentGenerating.py
+++ /dev/null
@@ -1,217 +0,0 @@
-## @file
-# This file is used to define comment generating interface
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-CommentGenerating
-'''
-
-##
-# Import Modules
-#
-from Library.String import GetSplitValueList
-from Library.DataType import TAB_SPACE_SPLIT
-from Library.DataType import TAB_INF_GUIDTYPE_VAR
-from Library.DataType import USAGE_ITEM_NOTIFY
-from Library.DataType import ITEM_UNDEFINED
-from Library.DataType import LANGUAGE_EN_US
-
-## GenTailCommentLines
-#
-# @param TailCommentLines: the tail comment lines that need to be generated
-# @param LeadingSpaceNum: the number of leading space needed for non-first
-# line tail comment
-#
-def GenTailCommentLines (TailCommentLines, LeadingSpaceNum = 0):
- EndOfLine = "\n"
- TailCommentLines = TailCommentLines.rstrip(EndOfLine)
- CommentStr = " ## " + (EndOfLine + LeadingSpaceNum * TAB_SPACE_SPLIT + \
- " ## ").join(GetSplitValueList(TailCommentLines, \
- EndOfLine))
- return CommentStr
-
-## GenGenericComment
-#
-# @param CommentLines: Generic comment Text, maybe Multiple Lines
-#
-def GenGenericComment (CommentLines):
- if not CommentLines:
- return ''
- EndOfLine = "\n"
- CommentLines = CommentLines.rstrip(EndOfLine)
- CommentStr = '## ' + (EndOfLine + '# ').join\
- (GetSplitValueList(CommentLines, EndOfLine)) + EndOfLine
- return CommentStr
-
-## GenGenericCommentF
-#
-# similar to GenGenericComment but will remove <EOL> at end of comment once,
-# and for line with only <EOL>, '#\n' will be generated instead of '# \n'
-#
-# @param CommentLines: Generic comment Text, maybe Multiple Lines
-# @return CommentStr: Generated comment line
-#
-def GenGenericCommentF (CommentLines, NumOfPound=1):
- if not CommentLines:
- return ''
- EndOfLine = "\n"
- #
- # if comment end with '\n', then remove it to prevent one extra line
- # generate later on
- #
- if CommentLines.endswith(EndOfLine):
- CommentLines = CommentLines[:-1]
- CommentLineList = GetSplitValueList(CommentLines, EndOfLine)
- CommentStr = ''
- for Line in CommentLineList:
- if Line == '':
- CommentStr += '#' * NumOfPound + '\n'
- else:
- CommentStr += '#' * NumOfPound + ' ' + Line + '\n'
-
- return CommentStr
-
-
-## GenHeaderCommentSection
-#
-# Generate Header comment sections
-#
-# @param Abstract One line of abstract
-# @param Description multiple lines of Description
-# @param Copyright possible multiple copyright lines
-# @param License possible multiple license lines
-#
-def GenHeaderCommentSection(Abstract, Description, Copyright, License):
- EndOfLine = '\n'
- Content = ''
-
- Content += '## @file' + EndOfLine
- if Abstract:
- Abstract = Abstract.rstrip(EndOfLine)
- Content += '# ' + Abstract + EndOfLine
- Content += '#' + EndOfLine
- else:
- Content += '#' + EndOfLine
-
- if Description:
- Description = Description.rstrip(EndOfLine)
- Content += '# ' + (EndOfLine + '# ').join(GetSplitValueList\
- (Description, '\n'))
- Content += EndOfLine + '#' + EndOfLine
-
- #
- # There is no '#\n' line to separate multiple copyright lines in code base
- #
- if Copyright:
- Copyright = Copyright.rstrip(EndOfLine)
- Content += '# ' + (EndOfLine + '# ').join\
- (GetSplitValueList(Copyright, '\n'))
- Content += EndOfLine + '#' + EndOfLine
-
- if License:
- License = License.rstrip(EndOfLine)
- Content += '# ' + (EndOfLine + '# ').join(GetSplitValueList\
- (License, '\n'))
- Content += EndOfLine + '#' + EndOfLine
-
- Content += '##' + EndOfLine
-
- return Content
-
-
-## GenInfPcdTailComment
-# Generate Pcd tail comment for Inf, this would be one line comment
-#
-# @param Usage: Usage type
-# @param TailCommentText: Comment text for tail comment
-#
-def GenInfPcdTailComment (Usage, TailCommentText):
- if (Usage == ITEM_UNDEFINED) and (not TailCommentText):
- return ''
-
- CommentLine = TAB_SPACE_SPLIT.join([Usage, TailCommentText])
- return GenTailCommentLines(CommentLine)
-
-## GenInfProtocolPPITailComment
-# Generate Protocol/PPI tail comment for Inf
-#
-# @param Usage: Usage type
-# @param TailCommentText: Comment text for tail comment
-#
-def GenInfProtocolPPITailComment (Usage, Notify, TailCommentText):
- if (not Notify) and (Usage == ITEM_UNDEFINED) and (not TailCommentText):
- return ''
-
- if Notify:
- CommentLine = USAGE_ITEM_NOTIFY + " ## "
- else:
- CommentLine = ''
-
- CommentLine += TAB_SPACE_SPLIT.join([Usage, TailCommentText])
- return GenTailCommentLines(CommentLine)
-
-## GenInfGuidTailComment
-# Generate Guid tail comment for Inf
-#
-# @param Usage: Usage type
-# @param TailCommentText: Comment text for tail comment
-#
-def GenInfGuidTailComment (Usage, GuidTypeList, VariableName, TailCommentText):
- GuidType = GuidTypeList[0]
- if (Usage == ITEM_UNDEFINED) and (GuidType == ITEM_UNDEFINED) and \
- (not TailCommentText):
- return ''
-
- FirstLine = Usage + " ## " + GuidType
- if GuidType == TAB_INF_GUIDTYPE_VAR:
- FirstLine += ":" + VariableName
-
- CommentLine = TAB_SPACE_SPLIT.join([FirstLine, TailCommentText])
- return GenTailCommentLines(CommentLine)
-
-## GenDecGuidTailComment
-#
-# @param SupModuleList: Supported module type list
-#
-def GenDecTailComment (SupModuleList):
- CommentLine = TAB_SPACE_SPLIT.join(SupModuleList)
- return GenTailCommentLines(CommentLine)
-
-
-## _GetHelpStr
-# get HelpString from a list of HelpTextObject, the priority refer to
-# related HLD
-#
-# @param HelpTextObjList: List of HelpTextObject
-#
-# @return HelpStr: the help text string found, '' means no help text found
-#
-def _GetHelpStr(HelpTextObjList):
- HelpStr = ''
-
- for HelpObj in HelpTextObjList:
- if HelpObj and HelpObj.GetLang() == LANGUAGE_EN_US:
- HelpStr = HelpObj.GetString()
- return HelpStr
-
- for HelpObj in HelpTextObjList:
- if HelpObj and HelpObj.GetLang().startswith('en'):
- HelpStr = HelpObj.GetString()
- return HelpStr
-
- for HelpObj in HelpTextObjList:
- if HelpObj and not HelpObj.GetLang():
- HelpStr = HelpObj.GetString()
- return HelpStr
-
- return HelpStr \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Library/CommentParsing.py b/BaseTools/Source/Python/UPT/Library/CommentParsing.py
deleted file mode 100644
index 5c07f34a74..0000000000
--- a/BaseTools/Source/Python/UPT/Library/CommentParsing.py
+++ /dev/null
@@ -1,451 +0,0 @@
-## @file
-# This file is used to define comment parsing interface
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-CommentParsing
-'''
-
-##
-# Import Modules
-#
-import re
-
-from Library.String import GetSplitValueList
-from Library.String import CleanString2
-from Library.DataType import HEADER_COMMENT_NOT_STARTED
-from Library.DataType import TAB_COMMENT_SPLIT
-from Library.DataType import HEADER_COMMENT_LICENSE
-from Library.DataType import HEADER_COMMENT_ABSTRACT
-from Library.DataType import HEADER_COMMENT_COPYRIGHT
-from Library.DataType import HEADER_COMMENT_DESCRIPTION
-from Library.DataType import TAB_SPACE_SPLIT
-from Library.DataType import TAB_COMMA_SPLIT
-from Library.DataType import SUP_MODULE_LIST
-from Object.POM.CommonObject import TextObject
-from Object.POM.CommonObject import PcdErrorObject
-import Logger.Log as Logger
-from Logger.ToolError import FORMAT_INVALID
-from Logger.ToolError import FORMAT_NOT_SUPPORTED
-from Logger import StringTable as ST
-
-## ParseHeaderCommentSection
-#
-# Parse Header comment section lines, extract Abstract, Description, Copyright
-# , License lines
-#
-# @param CommentList: List of (Comment, LineNumber)
-# @param FileName: FileName of the comment
-#
-def ParseHeaderCommentSection(CommentList, FileName = None):
- Abstract = ''
- Description = ''
- Copyright = ''
- License = ''
- EndOfLine = "\n"
- STR_HEADER_COMMENT_START = "@file"
- HeaderCommentStage = HEADER_COMMENT_NOT_STARTED
-
- #
- # first find the last copyright line
- #
- Last = 0
- for Index in xrange(len(CommentList)-1, 0, -1):
- Line = CommentList[Index][0]
- if _IsCopyrightLine(Line):
- Last = Index
- break
-
- for Item in CommentList:
- Line = Item[0]
- LineNo = Item[1]
-
- if not Line.startswith(TAB_COMMENT_SPLIT) and Line:
- Logger.Error("\nUPT", FORMAT_INVALID, ST.ERR_INVALID_COMMENT_FORMAT, FileName, Item[1])
- Comment = CleanString2(Line)[1]
- Comment = Comment.strip()
- #
- # if there are blank lines between License or Description, keep them as they would be
- # indication of different block; or in the position that Abstract should be, also keep it
- # as it indicates that no abstract
- #
- if not Comment and HeaderCommentStage not in [HEADER_COMMENT_LICENSE, \
- HEADER_COMMENT_DESCRIPTION, HEADER_COMMENT_ABSTRACT]:
- continue
-
- if HeaderCommentStage == HEADER_COMMENT_NOT_STARTED:
- if Comment.startswith(STR_HEADER_COMMENT_START):
- HeaderCommentStage = HEADER_COMMENT_ABSTRACT
- else:
- License += Comment + EndOfLine
- else:
- if HeaderCommentStage == HEADER_COMMENT_ABSTRACT:
- #
- # in case there is no abstract and description
- #
- if not Comment:
- Abstract = ''
- HeaderCommentStage = HEADER_COMMENT_DESCRIPTION
- elif _IsCopyrightLine(Comment):
- Result, ErrMsg = _ValidateCopyright(Comment)
- ValidateCopyright(Result, ST.WRN_INVALID_COPYRIGHT, FileName, LineNo, ErrMsg)
- Copyright += Comment + EndOfLine
- HeaderCommentStage = HEADER_COMMENT_COPYRIGHT
- else:
- Abstract += Comment + EndOfLine
- HeaderCommentStage = HEADER_COMMENT_DESCRIPTION
- elif HeaderCommentStage == HEADER_COMMENT_DESCRIPTION:
- #
- # in case there is no description
- #
- if _IsCopyrightLine(Comment):
- Result, ErrMsg = _ValidateCopyright(Comment)
- ValidateCopyright(Result, ST.WRN_INVALID_COPYRIGHT, FileName, LineNo, ErrMsg)
- Copyright += Comment + EndOfLine
- HeaderCommentStage = HEADER_COMMENT_COPYRIGHT
- else:
- Description += Comment + EndOfLine
- elif HeaderCommentStage == HEADER_COMMENT_COPYRIGHT:
- if _IsCopyrightLine(Comment):
- Result, ErrMsg = _ValidateCopyright(Comment)
- ValidateCopyright(Result, ST.WRN_INVALID_COPYRIGHT, FileName, LineNo, ErrMsg)
- Copyright += Comment + EndOfLine
- else:
- #
- # Contents after copyright line are license, those non-copyright lines in between
- # copyright line will be discarded
- #
- if LineNo > Last:
- if License:
- License += EndOfLine
- License += Comment + EndOfLine
- HeaderCommentStage = HEADER_COMMENT_LICENSE
- else:
- if not Comment and not License:
- continue
- License += Comment + EndOfLine
-
- if not Copyright:
- Logger.Error("\nUPT", FORMAT_INVALID, ST.ERR_COPYRIGHT_MISSING, \
- FileName)
-
- if not License:
- Logger.Error("\nUPT", FORMAT_INVALID, ST.ERR_LICENSE_MISSING, FileName)
-
- return Abstract.strip(), Description.strip(), Copyright.strip(), License.strip()
-
-## _IsCopyrightLine
-# check whether current line is copyright line, the criteria is whether there is case insensitive keyword "Copyright"
-# followed by zero or more white space characters followed by a "(" character
-#
-# @param LineContent: the line need to be checked
-# @return: True if current line is copyright line, False else
-#
-def _IsCopyrightLine (LineContent):
- LineContent = LineContent.upper()
- Result = False
-
- ReIsCopyrightRe = re.compile(r"""(^|\s)COPYRIGHT *\(""", re.DOTALL)
- if ReIsCopyrightRe.search(LineContent):
- Result = True
-
- return Result
-
-## ParseGenericComment
-#
-# @param GenericComment: Generic comment list, element of
-# (CommentLine, LineNum)
-# @param ContainerFile: Input value for filename of Dec file
-#
-def ParseGenericComment (GenericComment, ContainerFile=None, SkipTag=None):
- if ContainerFile:
- pass
- HelpTxt = None
- HelpStr = ''
-
- for Item in GenericComment:
- CommentLine = Item[0]
- Comment = CleanString2(CommentLine)[1]
- if SkipTag is not None and Comment.startswith(SkipTag):
- Comment = Comment.replace(SkipTag, '', 1)
- HelpStr += Comment + '\n'
-
- if HelpStr:
- HelpTxt = TextObject()
- if HelpStr.endswith('\n') and not HelpStr.endswith('\n\n') and HelpStr != '\n':
- HelpStr = HelpStr[:-1]
- HelpTxt.SetString(HelpStr)
-
- return HelpTxt
-
-
-## ParseDecPcdGenericComment
-#
-# @param GenericComment: Generic comment list, element of (CommentLine,
-# LineNum)
-# @param ContainerFile: Input value for filename of Dec file
-#
-def ParseDecPcdGenericComment (GenericComment, ContainerFile):
- HelpStr = ''
- PcdErr = None
-
- for (CommentLine, LineNum) in GenericComment:
- Comment = CleanString2(CommentLine)[1]
- if Comment.startswith("@ValidRange"):
- if PcdErr:
- Logger.Error('Parser',
- FORMAT_NOT_SUPPORTED,
- ST.WRN_MULTI_PCD_RANGES,
- File = ContainerFile,
- Line = LineNum)
- ValidRange = Comment.replace("@ValidRange", "", 1)
- if _CheckRangeExpression(ValidRange):
- PcdErr = PcdErrorObject()
- PcdErr.SetValidValueRange(ValidRange)
- elif Comment.startswith("@ValidList"):
- if PcdErr:
- Logger.Error('Parser',
- FORMAT_NOT_SUPPORTED,
- ST.WRN_MULTI_PCD_RANGES,
- File = ContainerFile,
- Line = LineNum)
- ValidValue = Comment.replace("@ValidList", "", 1).replace(TAB_COMMA_SPLIT, TAB_SPACE_SPLIT)
- PcdErr = PcdErrorObject()
- PcdErr.SetValidValue(ValidValue)
- elif Comment.startswith("@Expression"):
- if PcdErr:
- Logger.Error('Parser',
- FORMAT_NOT_SUPPORTED,
- ST.WRN_MULTI_PCD_RANGES,
- File = ContainerFile,
- Line = LineNum)
- Expression = Comment.replace("@Expression", "", 1)
- if _CheckRangeExpression(Expression):
- PcdErr = PcdErrorObject()
- PcdErr.SetExpression(Expression)
- else:
- HelpStr += Comment + '\n'
-
- #
- # remove the last EOL if the comment is of format 'FOO\n'
- #
- if HelpStr.endswith('\n'):
- if HelpStr != '\n' and not HelpStr.endswith('\n\n'):
- HelpStr = HelpStr[:-1]
-
- return HelpStr, PcdErr
-
-## ParseDecPcdTailComment
-#
-# @param TailCommentList: Tail comment list of Pcd, item of format (Comment, LineNum)
-# @param ContainerFile: Input value for filename of Dec file
-# @retVal SupModuleList: The supported module type list detected
-# @retVal HelpStr: The generic help text string detected
-#
-def ParseDecPcdTailComment (TailCommentList, ContainerFile):
- assert(len(TailCommentList) == 1)
- TailComment = TailCommentList[0][0]
- LineNum = TailCommentList[0][1]
-
- Comment = TailComment.lstrip(" #")
-
- ReFindFirstWordRe = re.compile(r"""^([^ #]*)""", re.DOTALL)
-
- #
- # get first word and compare with SUP_MODULE_LIST
- #
- MatchObject = ReFindFirstWordRe.match(Comment)
- if not (MatchObject and MatchObject.group(1) in SUP_MODULE_LIST):
- return None, Comment
-
- #
- # parse line, it must have supported module type specified
- #
- if Comment.find(TAB_COMMENT_SPLIT) == -1:
- Comment += TAB_COMMENT_SPLIT
- SupMode, HelpStr = GetSplitValueList(Comment, TAB_COMMENT_SPLIT, 1)
- SupModuleList = []
- for Mod in GetSplitValueList(SupMode, TAB_SPACE_SPLIT):
- if not Mod:
- continue
- elif Mod not in SUP_MODULE_LIST:
- Logger.Error("UPT",
- FORMAT_INVALID,
- ST.WRN_INVALID_MODULE_TYPE%Mod,
- ContainerFile,
- LineNum)
- else:
- SupModuleList.append(Mod)
-
- return SupModuleList, HelpStr
-
-
-## _CheckRangeExpression
-#
-# @param Expression: Pcd range expression
-#
-def _CheckRangeExpression(Expression):
- #
- # check grammar for Pcd range expression is not required yet
- #
- if Expression:
- pass
- return True
-
-## ValidateCopyright
-#
-#
-#
-def ValidateCopyright(Result, ErrType, FileName, LineNo, ErrMsg):
- if not Result:
- Logger.Warn("\nUPT", ErrType, FileName, LineNo, ErrMsg)
-
-## _ValidateCopyright
-#
-# @param Line: Line that contains copyright information, # stripped
-#
-# @retval Result: True if line is conformed to Spec format, False else
-# @retval ErrMsg: the detailed error description
-#
-def _ValidateCopyright(Line):
- if Line:
- pass
- Result = True
- ErrMsg = ''
-
- return Result, ErrMsg
-
-def GenerateTokenList (Comment):
- #
- # Tokenize Comment using '#' and ' ' as token seperators
- #
- RelplacedComment = None
- while Comment != RelplacedComment:
- RelplacedComment = Comment
- Comment = Comment.replace('##', '#').replace(' ', ' ').replace(' ', '#').strip('# ')
- return Comment.split('#')
-
-
-#
-# Comment - Comment to parse
-# TypeTokens - A dictionary of type token synonyms
-# RemoveTokens - A list of tokens to remove from help text
-# ParseVariable - True for parsing [Guids]. Otherwise False
-#
-def ParseComment (Comment, UsageTokens, TypeTokens, RemoveTokens, ParseVariable):
- #
- # Initialize return values
- #
- Usage = None
- Type = None
- String = None
- HelpText = None
-
- Comment = Comment[0]
-
- NumTokens = 2
- if ParseVariable:
- #
- # Remove white space around first instance of ':' from Comment if 'Variable'
- # is in front of ':' and Variable is the 1st or 2nd token in Comment.
- #
- List = Comment.split(':', 1)
- if len(List) > 1:
- SubList = GenerateTokenList (List[0].strip())
- if len(SubList) in [1, 2] and SubList[-1] == 'Variable':
- if List[1].strip().find('L"') == 0:
- Comment = List[0].strip() + ':' + List[1].strip()
-
- #
- # Remove first instance of L"<VariableName> from Comment and put into String
- # if and only if L"<VariableName>" is the 1st token, the 2nd token. Or
- # L"<VariableName>" is the third token immediately following 'Variable:'.
- #
- End = -1
- Start = Comment.find('Variable:L"')
- if Start >= 0:
- String = Comment[Start + 9:]
- End = String[2:].find('"')
- else:
- Start = Comment.find('L"')
- if Start >= 0:
- String = Comment[Start:]
- End = String[2:].find('"')
- if End >= 0:
- SubList = GenerateTokenList (Comment[:Start])
- if len(SubList) < 2:
- Comment = Comment[:Start] + String[End + 3:]
- String = String[:End + 3]
- Type = 'Variable'
- NumTokens = 1
-
- #
- # Initialze HelpText to Comment.
- # Content will be remove from HelpText as matching tokens are found
- #
- HelpText = Comment
-
- #
- # Tokenize Comment using '#' and ' ' as token seperators
- #
- List = GenerateTokenList (Comment)
-
- #
- # Search first two tokens for Usage and Type and remove any matching tokens
- # from HelpText
- #
- for Token in List[0:NumTokens]:
- if Usage == None and Token in UsageTokens:
- Usage = UsageTokens[Token]
- HelpText = HelpText.replace(Token, '')
- if Usage != None or not ParseVariable:
- for Token in List[0:NumTokens]:
- if Type == None and Token in TypeTokens:
- Type = TypeTokens[Token]
- HelpText = HelpText.replace(Token, '')
- if Usage != None:
- for Token in List[0:NumTokens]:
- if Token in RemoveTokens:
- HelpText = HelpText.replace(Token, '')
-
- #
- # If no Usage token is present and set Usage to UNDEFINED
- #
- if Usage == None:
- Usage = 'UNDEFINED'
-
- #
- # If no Type token is present and set Type to UNDEFINED
- #
- if Type == None:
- Type = 'UNDEFINED'
-
- #
- # If Type is not 'Variable:', then set String to None
- #
- if Type != 'Variable':
- String = None
-
- #
- # Strip ' ' and '#' from the beginning of HelpText
- # If HelpText is an empty string after all parsing is
- # complete then set HelpText to None
- #
- HelpText = HelpText.lstrip('# ')
- if HelpText == '':
- HelpText = None
-
- #
- # Return parsing results
- #
- return Usage, Type, String, HelpText
diff --git a/BaseTools/Source/Python/UPT/Library/DataType.py b/BaseTools/Source/Python/UPT/Library/DataType.py
deleted file mode 100644
index de3c7092ad..0000000000
--- a/BaseTools/Source/Python/UPT/Library/DataType.py
+++ /dev/null
@@ -1,940 +0,0 @@
-## @file
-# This file is used to define class for data type structure
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-DataType
-'''
-
-##
-# Module List Items
-#
-MODULE_LIST = ["BASE",
- "SEC",
- "PEI_CORE",
- "PEIM",
- "DXE_CORE",
- "DXE_DRIVER",
- "SMM_CORE",
- "DXE_RUNTIME_DRIVER",
- "DXE_SAL_DRIVER",
- "DXE_SMM_DRIVER",
- "UEFI_DRIVER",
- "UEFI_APPLICATION",
- "USER_DEFINED"]
-
-VALID_DEPEX_MODULE_TYPE_LIST = ["PEIM",
- "DXE_DRIVER",
- "DXE_SMM_DRIVER",
- "DXE_RUNTIME_DRIVER",
- "DXE_SAL_DRIVER",
- "UEFI_DRIVER",
- ]
-##
-# Usage List Items
-#
-USAGE_LIST = ["CONSUMES",
- "SOMETIMES_CONSUMES",
- "PRODUCES",
- "SOMETIMES_PRODUCES"]
-
-LANGUAGE_EN_US = 'en-US'
-
-USAGE_ITEM_PRODUCES = 'PRODUCES'
-USAGE_ITEM_SOMETIMES_PRODUCES = 'SOMETIMES_PRODUCES'
-USAGE_ITEM_CONSUMES = 'CONSUMES'
-USAGE_ITEM_SOMETIMES_CONSUMES = 'SOMETIMES_CONSUMES'
-USAGE_ITEM_TO_START = 'TO_START'
-USAGE_ITEM_BY_START = 'BY_START'
-USAGE_ITEM_NOTIFY = 'NOTIFY'
-USAGE_ITEM_UNDEFINED = 'UNDEFINED'
-
-USAGE_CONSUMES_LIST = [USAGE_ITEM_CONSUMES,
- 'CONSUMED',
- 'ALWAYS_CONSUMED',
- 'ALWAYS_CONSUMES'
- ]
-
-USAGE_PRODUCES_LIST = [USAGE_ITEM_PRODUCES,
- 'PRODUCED',
- 'ALWAYS_PRODUCED',
- 'ALWAYS_PRODUCES'
- ]
-
-USAGE_SOMETIMES_PRODUCES_LIST = [USAGE_ITEM_SOMETIMES_PRODUCES,
- 'SOMETIMES_PRODUCED'
- ]
-
-USAGE_SOMETIMES_CONSUMES_LIST = [USAGE_ITEM_SOMETIMES_CONSUMES,
- 'SOMETIMES_CONSUMED'
- ]
-
-ITEM_UNDEFINED = 'UNDEFINED'
-
-
-#
-# Dictionary of usage tokens and their synonmys
-#
-ALL_USAGE_TOKENS = {
- "PRODUCES" : "PRODUCES",
- "PRODUCED" : "PRODUCES",
- "ALWAYS_PRODUCES" : "PRODUCES",
- "ALWAYS_PRODUCED" : "PRODUCES",
- "SOMETIMES_PRODUCES" : "SOMETIMES_PRODUCES",
- "SOMETIMES_PRODUCED" : "SOMETIMES_PRODUCES",
- "CONSUMES" : "CONSUMES",
- "CONSUMED" : "CONSUMES",
- "ALWAYS_CONSUMES" : "CONSUMES",
- "ALWAYS_CONSUMED" : "CONSUMES",
- "SOMETIMES_CONSUMES" : "SOMETIMES_CONSUMES",
- "SOMETIMES_CONSUMED" : "SOMETIMES_CONSUMES",
- "SOMETIME_CONSUMES" : "SOMETIMES_CONSUMES",
- "UNDEFINED" : "UNDEFINED"
- }
-
-PROTOCOL_USAGE_TOKENS = {
- "TO_START" : "TO_START",
- "BY_START" : "BY_START"
- }
-
-PROTOCOL_USAGE_TOKENS.update (ALL_USAGE_TOKENS)
-
-#
-# Dictionary of GUID type tokens
-#
-GUID_TYPE_TOKENS = {
- "Event" : "Event",
- "File" : "File",
- "FV" : "FV",
- "GUID" : "GUID",
- "Guid" : "GUID",
- "HII" : "HII",
- "HOB" : "HOB",
- "Hob" : "HOB",
- "Hob:" : "HOB",
- "SystemTable" : "SystemTable",
- "TokenSpaceGuid" : "TokenSpaceGuid",
- "UNDEFINED" : "UNDEFINED"
- }
-
-#
-# Dictionary of Protocol Notify tokens and their synonyms
-#
-PROTOCOL_NOTIFY_TOKENS = {
- "NOTIFY" : "NOTIFY",
- "PROTOCOL_NOTIFY" : "NOTIFY",
- "UNDEFINED" : "UNDEFINED"
- }
-
-#
-# Dictionary of PPI Notify tokens and their synonyms
-#
-PPI_NOTIFY_TOKENS = {
- "NOTIFY" : "NOTIFY",
- "PPI_NOTIFY" : "NOTIFY",
- "UNDEFINED" : "UNDEFINED"
- }
-
-EVENT_TOKENS = {
- "EVENT_TYPE_PERIODIC_TIMER" : "EVENT_TYPE_PERIODIC_TIMER",
- "EVENT_TYPE_RELATIVE_TIMER" : "EVENT_TYPE_RELATIVE_TIMER",
- "UNDEFINED" : "UNDEFINED"
- }
-
-BOOTMODE_TOKENS = {
- "FULL" : "FULL",
- "MINIMAL" : "MINIMAL",
- "NO_CHANGE" : "NO_CHANGE",
- "DIAGNOSTICS" : "DIAGNOSTICS",
- "DEFAULT" : "DEFAULT",
- "S2_RESUME" : "S2_RESUME",
- "S3_RESUME" : "S3_RESUME",
- "S4_RESUME" : "S4_RESUME",
- "S5_RESUME" : "S5_RESUME",
- "FLASH_UPDATE" : "FLASH_UPDATE",
- "RECOVERY_FULL" : "RECOVERY_FULL",
- "RECOVERY_MINIMAL" : "RECOVERY_MINIMAL",
- "RECOVERY_NO_CHANGE" : "RECOVERY_NO_CHANGE",
- "RECOVERY_DIAGNOSTICS" : "RECOVERY_DIAGNOSTICS",
- "RECOVERY_DEFAULT" : "RECOVERY_DEFAULT",
- "RECOVERY_S2_RESUME" : "RECOVERY_S2_RESUME",
- "RECOVERY_S3_RESUME" : "RECOVERY_S3_RESUME",
- "RECOVERY_S4_RESUME" : "RECOVERY_S4_RESUME",
- "RECOVERY_S5_RESUME" : "RECOVERY_S5_RESUME",
- "RECOVERY_FLASH_UPDATE" : "RECOVERY_FLASH_UPDATE",
- "UNDEFINED" : "UNDEFINED"
- }
-
-HOB_TOKENS = {
- "PHIT" : "PHIT",
- "MEMORY_ALLOCATION" : "MEMORY_ALLOCATION",
- "LOAD_PEIM" : "LOAD_PEIM",
- "RESOURCE_DESCRIPTOR" : "RESOURCE_DESCRIPTOR",
- "FIRMWARE_VOLUME" : "FIRMWARE_VOLUME",
- "UNDEFINED" : "UNDEFINED"
- }
-
-##
-# Usage List Items for Protocol
-#
-PROTOCOL_USAGE_LIST = USAGE_LIST + ["TO_START", "BY_START"]
-
-##
-# End of Line
-# Use this but not os.linesep for os.linesep has bug in it.
-#
-END_OF_LINE = '\n'
-
-##
-# Arch List Items
-#
-ARCH_LIST = ["IA32",
- "X64",
- "IPF",
- "EBC",
- "COMMON"]
-##
-# PCD driver type list items
-#
-PCD_DIRVER_TYPE_LIST = ["PEI_PCD_DRIVER", "DXE_PCD_DRIVER"]
-
-##
-# Boot Mode List Items
-#
-BOOT_MODE_LIST = ["FULL",
- "MINIMAL",
- "NO_CHANGE",
- "DIAGNOSTICS",
- "DEFAULT",
- "S2_RESUME",
- "S3_RESUME",
- "S4_RESUME",
- "S5_RESUME",
- "FLASH_UPDATE",
- "RECOVERY_FULL",
- "RECOVERY_MINIMAL",
- "RECOVERY_NO_CHANGE",
- "RECOVERY_DIAGNOSTICS",
- "RECOVERY_DEFAULT",
- "RECOVERY_S2_RESUME",
- "RECOVERY_S3_RESUME",
- "RECOVERY_S4_RESUME",
- "RECOVERY_S5_RESUME",
- "RECOVERY_FLASH_UPDATE"]
-
-##
-# Event Type List Items
-#
-EVENT_TYPE_LIST = ["EVENT_TYPE_PERIODIC_TIMER",
- "EVENT_TYPE_RELATIVE_TIMER"]
-
-##
-# Hob Type List Items
-#
-HOB_TYPE_LIST = ["PHIT",
- "MEMORY_ALLOCATION",
- "RESOURCE_DESCRIPTOR",
- "FIRMWARE_VOLUME",
- "LOAD_PEIM"]
-
-##
-# GUID_TYPE_LIST
-#
-GUID_TYPE_LIST = ["Event", "File", "FV", "GUID", "HII", "HOB",
- "SystemTable", "TokenSpaceGuid", "Variable"]
-##
-# PCD Usage Type List of Package
-#
-PCD_USAGE_TYPE_LIST_OF_PACKAGE = ["FeatureFlag", "PatchableInModule",
- "FixedAtBuild", "Dynamic", "DynamicEx"]
-
-##
-# PCD Usage Type List of Module
-#
-PCD_USAGE_TYPE_LIST_OF_MODULE = ["FEATUREPCD", "PATCHPCD", "FIXEDPCD", "PCD", "PCDEX"]
-##
-# PCD Usage Type List of UPT
-#
-PCD_USAGE_TYPE_LIST_OF_UPT = PCD_USAGE_TYPE_LIST_OF_MODULE
-
-##
-# Binary File Type List
-#
-BINARY_FILE_TYPE_LIST = ["GUID", "PE32", "PIC", "TE", "DXE_DEPEX", "VER", "UI", "COMPAT16", "FV", "BIN", "RAW",
- "ACPI", "ASL",
- "PEI_DEPEX",
- "SMM_DEPEX",
- "SUBTYPE_GUID"
- ]
-BINARY_FILE_TYPE_LIST_IN_UDP = \
- ["GUID", "FREEFORM",
- "UEFI_IMAGE", "PE32", "PIC",
- "PEI_DEPEX",
- "DXE_DEPEX",
- "SMM_DEPEX",
- "FV", "TE",
- "BIN", "VER", "UI"
- ]
-
-##
-# Possible values for COMPONENT_TYPE, and their descriptions, are listed in
-# the table,
-# "Component (module) Types." For each component, the BASE_NAME and
-# COMPONENT_TYPE
-# are required. The COMPONENT_TYPE definition is case sensitive.
-#
-COMPONENT_TYPE_LIST = [
- "APPLICATION",
- "ACPITABLE",
- "APRIORI",
- "BINARY",
- "BS_DRIVER",
- "CONFIG",
- "FILE",
- "FVIMAGEFILE",
- "LIBRARY",
- "LOGO",
- "LEGACY16",
- "MICROCODE",
- "PE32_PEIM",
- "PEI_CORE",
- "RAWFILE",
- "RT_DRIVER",
- "SAL_RT_DRIVER",
- "SECURITY_CORE",
- "COMBINED_PEIM_DRIVER",
- "PIC_PEIM",
- "RELOCATABLE_PEIM"
- ]
-
-##
-# Common Definitions
-#
-TAB_SPLIT = '.'
-TAB_COMMENT_EDK1_START = '/*'
-TAB_COMMENT_EDK1_END = '*/'
-TAB_COMMENT_EDK1_SPLIT = '//'
-TAB_COMMENT_SPLIT = '#'
-TAB_EQUAL_SPLIT = '='
-TAB_DEQUAL_SPLIT = '=='
-TAB_VALUE_SPLIT = '|'
-TAB_COMMA_SPLIT = ','
-TAB_SPACE_SPLIT = ' '
-TAB_UNDERLINE_SPLIT = '_'
-TAB_SEMI_COLON_SPLIT = ';'
-TAB_COLON_SPLIT = ':'
-TAB_SECTION_START = '['
-TAB_SECTION_END = ']'
-TAB_OPTION_START = '<'
-TAB_OPTION_END = '>'
-TAB_SLASH = '\\'
-TAB_BACK_SLASH = '/'
-TAB_SPECIAL_COMMENT = '##'
-TAB_HEADER_COMMENT = '@file'
-TAB_STAR = "*"
-
-TAB_EDK_SOURCE = '$(EDK_SOURCE)'
-TAB_EFI_SOURCE = '$(EFI_SOURCE)'
-TAB_WORKSPACE = '$(WORKSPACE)'
-
-TAB_ARCH_NULL = ''
-TAB_ARCH_COMMON = 'COMMON'
-TAB_ARCH_IA32 = 'IA32'
-TAB_ARCH_X64 = 'X64'
-TAB_ARCH_IPF = 'IPF'
-TAB_ARCH_ARM = 'ARM'
-TAB_ARCH_EBC = 'EBC'
-TAB_ARCH_AARCH64 = 'AARCH64'
-
-ARCH_LIST = \
-[TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM, TAB_ARCH_EBC, TAB_ARCH_AARCH64]
-
-SUP_MODULE_BASE = 'BASE'
-SUP_MODULE_SEC = 'SEC'
-SUP_MODULE_PEI_CORE = 'PEI_CORE'
-SUP_MODULE_PEIM = 'PEIM'
-SUP_MODULE_DXE_CORE = 'DXE_CORE'
-SUP_MODULE_DXE_DRIVER = 'DXE_DRIVER'
-SUP_MODULE_DXE_RUNTIME_DRIVER = 'DXE_RUNTIME_DRIVER'
-SUP_MODULE_DXE_SAL_DRIVER = 'DXE_SAL_DRIVER'
-SUP_MODULE_DXE_SMM_DRIVER = 'DXE_SMM_DRIVER'
-SUP_MODULE_UEFI_DRIVER = 'UEFI_DRIVER'
-SUP_MODULE_UEFI_APPLICATION = 'UEFI_APPLICATION'
-SUP_MODULE_USER_DEFINED = 'USER_DEFINED'
-SUP_MODULE_SMM_CORE = 'SMM_CORE'
-
-SUP_MODULE_LIST = \
-[SUP_MODULE_BASE, SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM, \
-SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DRIVER, \
- SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVER, \
- SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_UEFI_DRIVER, \
- SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED, \
- SUP_MODULE_SMM_CORE]
-SUP_MODULE_LIST_STRING = TAB_VALUE_SPLIT.join(l for l in SUP_MODULE_LIST)
-
-EDK_COMPONENT_TYPE_LIBRARY = 'LIBRARY'
-EDK_COMPONENT_TYPE_SECUARITY_CORE = 'SECUARITY_CORE'
-EDK_COMPONENT_TYPE_PEI_CORE = 'PEI_CORE'
-EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER = 'COMBINED_PEIM_DRIVER'
-EDK_COMPONENT_TYPE_PIC_PEIM = 'PIC_PEIM'
-EDK_COMPONENT_TYPE_RELOCATABLE_PEIM = 'RELOCATABLE_PEIM'
-EDK_COMPONENT_TYPE_BS_DRIVER = 'BS_DRIVER'
-EDK_COMPONENT_TYPE_RT_DRIVER = 'RT_DRIVER'
-EDK_COMPONENT_TYPE_SAL_RT_DRIVER = 'SAL_RT_DRIVER'
-EDK_COMPONENT_TYPE_APPLICATION = 'APPLICATION'
-EDK_NAME = 'EDK'
-EDKII_NAME = 'EDKII'
-
-BINARY_FILE_TYPE_FW = 'FW'
-BINARY_FILE_TYPE_GUID = 'GUID'
-BINARY_FILE_TYPE_PREEFORM = 'PREEFORM'
-BINARY_FILE_TYPE_UEFI_APP = 'UEFI_APP'
-BINARY_FILE_TYPE_UNI_UI = 'UNI_UI'
-BINARY_FILE_TYPE_SEC_UI = 'SEC_UI'
-BINARY_FILE_TYPE_UNI_VER = 'UNI_VER'
-BINARY_FILE_TYPE_SEC_VER = 'SEC_VER'
-BINARY_FILE_TYPE_LIB = 'LIB'
-BINARY_FILE_TYPE_PE32 = 'PE32'
-BINARY_FILE_TYPE_PIC = 'PIC'
-BINARY_FILE_TYPE_PEI_DEPEX = 'PEI_DEPEX'
-BINARY_FILE_TYPE_DXE_DEPEX = 'DXE_DEPEX'
-BINARY_FILE_TYPE_SMM_DEPEX = 'SMM_DEPEX'
-BINARY_FILE_TYPE_TE = 'TE'
-BINARY_FILE_TYPE_VER = 'VER'
-BINARY_FILE_TYPE_UI = 'UI'
-BINARY_FILE_TYPE_BIN = 'BIN'
-BINARY_FILE_TYPE_FV = 'FV'
-BINARY_FILE_TYPE_UI_LIST = [BINARY_FILE_TYPE_UNI_UI,
- BINARY_FILE_TYPE_SEC_UI,
- BINARY_FILE_TYPE_UI
- ]
-BINARY_FILE_TYPE_VER_LIST = [BINARY_FILE_TYPE_UNI_VER,
- BINARY_FILE_TYPE_SEC_VER,
- BINARY_FILE_TYPE_VER
- ]
-
-DEPEX_SECTION_LIST = ['<PEI_DEPEX>',
- '<DXE_DEPEX>',
- '<SMM_DEPEX>'
- ]
-
-PLATFORM_COMPONENT_TYPE_LIBRARY = 'LIBRARY'
-PLATFORM_COMPONENT_TYPE_LIBRARY_CLASS = 'LIBRARY_CLASS'
-PLATFORM_COMPONENT_TYPE_MODULE = 'MODULE'
-
-TAB_LIBRARIES = 'Libraries'
-
-TAB_SOURCE = 'Source'
-TAB_SOURCES = 'Sources'
-TAB_SOURCES_COMMON = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_SOURCES_IA32 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_SOURCES_X64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_X64
-TAB_SOURCES_IPF = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_SOURCES_ARM = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_SOURCES_EBC = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_SOURCES_AARCH64 = TAB_SOURCES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_BINARIES = 'Binaries'
-TAB_BINARIES_COMMON = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_BINARIES_IA32 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_BINARIES_X64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_X64
-TAB_BINARIES_IPF = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_BINARIES_ARM = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_BINARIES_EBC = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_BINARIES_AARCH64 = TAB_BINARIES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_INCLUDES = 'Includes'
-TAB_INCLUDES_COMMON = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_INCLUDES_IA32 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_INCLUDES_X64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_X64
-TAB_INCLUDES_IPF = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_INCLUDES_ARM = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_INCLUDES_EBC = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_INCLUDES_AARCH64 = TAB_INCLUDES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_GUIDS = 'Guids'
-TAB_GUIDS_COMMON = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_GUIDS_IA32 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_IA32
-TAB_GUIDS_X64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_X64
-TAB_GUIDS_IPF = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_IPF
-TAB_GUIDS_ARM = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_ARM
-TAB_GUIDS_EBC = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_EBC
-TAB_GUIDS_AARCH64 = TAB_GUIDS + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PROTOCOLS = 'Protocols'
-TAB_PROTOCOLS_COMMON = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PROTOCOLS_IA32 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PROTOCOLS_X64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_X64
-TAB_PROTOCOLS_IPF = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PROTOCOLS_ARM = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PROTOCOLS_EBC = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PROTOCOLS_AARCH64 = TAB_PROTOCOLS + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PPIS = 'Ppis'
-TAB_PPIS_COMMON = TAB_PPIS + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PPIS_IA32 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PPIS_X64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_X64
-TAB_PPIS_IPF = TAB_PPIS + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PPIS_ARM = TAB_PPIS + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PPIS_EBC = TAB_PPIS + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PPIS_AARCH64 = TAB_PPIS + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_LIBRARY_CLASSES = 'LibraryClasses'
-TAB_LIBRARY_CLASSES_COMMON = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_LIBRARY_CLASSES_IA32 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_LIBRARY_CLASSES_X64 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_X64
-TAB_LIBRARY_CLASSES_IPF = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_LIBRARY_CLASSES_ARM = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_LIBRARY_CLASSES_EBC = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_LIBRARY_CLASSES_AARCH64 = TAB_LIBRARY_CLASSES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PACKAGES = 'Packages'
-TAB_PACKAGES_COMMON = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PACKAGES_IA32 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PACKAGES_X64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_X64
-TAB_PACKAGES_IPF = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PACKAGES_ARM = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PACKAGES_EBC = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PACKAGES_AARCH64 = TAB_PACKAGES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PCDS = 'Pcds'
-TAB_PCDS_FIXED_AT_BUILD = 'FixedAtBuild'
-TAB_PCDS_PATCHABLE_IN_MODULE = 'PatchableInModule'
-TAB_PCDS_FEATURE_FLAG = 'FeatureFlag'
-TAB_PCDS_DYNAMIC_EX = 'DynamicEx'
-TAB_PCDS_DYNAMIC_EX_DEFAULT = 'DynamicExDefault'
-TAB_PCDS_DYNAMIC_EX_VPD = 'DynamicExVpd'
-TAB_PCDS_DYNAMIC_EX_HII = 'DynamicExHii'
-TAB_PCDS_DYNAMIC = 'Dynamic'
-TAB_PCDS_DYNAMIC_DEFAULT = 'DynamicDefault'
-TAB_PCDS_DYNAMIC_VPD = 'DynamicVpd'
-TAB_PCDS_DYNAMIC_HII = 'DynamicHii'
-
-TAB_PTR_TYPE_PCD = 'VOID*'
-
-PCD_DYNAMIC_TYPE_LIST = [TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_DEFAULT, \
- TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_HII]
-PCD_DYNAMIC_EX_TYPE_LIST = [TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFAULT, \
- TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII]
-
-## Dynamic-ex PCD types
-#
-gDYNAMIC_EX_PCD = [TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFAULT, \
- TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII]
-
-TAB_PCDS_FIXED_AT_BUILD_NULL = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD
-TAB_PCDS_FIXED_AT_BUILD_COMMON = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \
-TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PCDS_FIXED_AT_BUILD_IA32 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \
-TAB_SPLIT + TAB_ARCH_IA32
-TAB_PCDS_FIXED_AT_BUILD_X64 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \
-TAB_SPLIT + TAB_ARCH_X64
-TAB_PCDS_FIXED_AT_BUILD_IPF = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \
-TAB_SPLIT + TAB_ARCH_IPF
-TAB_PCDS_FIXED_AT_BUILD_ARM = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \
-TAB_SPLIT + TAB_ARCH_ARM
-TAB_PCDS_FIXED_AT_BUILD_EBC = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \
-TAB_SPLIT + TAB_ARCH_EBC
-TAB_PCDS_FIXED_AT_BUILD_AARCH64 = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \
-TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PCDS_PATCHABLE_IN_MODULE_NULL = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE
-TAB_PCDS_PATCHABLE_IN_MODULE_COMMON = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE \
-+ TAB_SPLIT + TAB_ARCH_COMMON
-TAB_PCDS_PATCHABLE_IN_MODULE_IA32 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + \
-TAB_SPLIT + TAB_ARCH_IA32
-TAB_PCDS_PATCHABLE_IN_MODULE_X64 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + \
-TAB_SPLIT + TAB_ARCH_X64
-TAB_PCDS_PATCHABLE_IN_MODULE_IPF = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + \
-TAB_SPLIT + TAB_ARCH_IPF
-TAB_PCDS_PATCHABLE_IN_MODULE_ARM = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + \
-TAB_SPLIT + TAB_ARCH_ARM
-TAB_PCDS_PATCHABLE_IN_MODULE_EBC = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + \
-TAB_SPLIT + TAB_ARCH_EBC
-TAB_PCDS_PATCHABLE_IN_MODULE_AARCH64 = TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODULE + \
-TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PCDS_FEATURE_FLAG_NULL = TAB_PCDS + TAB_PCDS_FEATURE_FLAG
-TAB_PCDS_FEATURE_FLAG_COMMON = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT \
-+ TAB_ARCH_COMMON
-TAB_PCDS_FEATURE_FLAG_IA32 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \
-TAB_ARCH_IA32
-TAB_PCDS_FEATURE_FLAG_X64 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \
-TAB_ARCH_X64
-TAB_PCDS_FEATURE_FLAG_IPF = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \
-TAB_ARCH_IPF
-TAB_PCDS_FEATURE_FLAG_ARM = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \
-TAB_ARCH_ARM
-TAB_PCDS_FEATURE_FLAG_EBC = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \
-TAB_ARCH_EBC
-TAB_PCDS_FEATURE_FLAG_AARCH64 = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + \
-TAB_ARCH_AARCH64
-
-TAB_PCDS_DYNAMIC_EX_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX
-TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_DEFAULT
-TAB_PCDS_DYNAMIC_EX_HII_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_HII
-TAB_PCDS_DYNAMIC_EX_VPD_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_VPD
-TAB_PCDS_DYNAMIC_EX_COMMON = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \
-TAB_ARCH_COMMON
-TAB_PCDS_DYNAMIC_EX_IA32 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \
-TAB_ARCH_IA32
-TAB_PCDS_DYNAMIC_EX_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \
-TAB_ARCH_X64
-TAB_PCDS_DYNAMIC_EX_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \
-TAB_ARCH_IPF
-TAB_PCDS_DYNAMIC_EX_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \
-TAB_ARCH_ARM
-TAB_PCDS_DYNAMIC_EX_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \
-TAB_ARCH_EBC
-TAB_PCDS_DYNAMIC_EX_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \
-TAB_ARCH_AARCH64
-
-TAB_PCDS_DYNAMIC_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC
-TAB_PCDS_DYNAMIC_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_DEFAULT
-TAB_PCDS_DYNAMIC_HII_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_HII
-TAB_PCDS_DYNAMIC_VPD_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_VPD
-TAB_PCDS_DYNAMIC_COMMON = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + \
-TAB_ARCH_COMMON
-TAB_PCDS_DYNAMIC_IA32 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_IA32
-TAB_PCDS_DYNAMIC_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_X64
-TAB_PCDS_DYNAMIC_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_IPF
-TAB_PCDS_DYNAMIC_ARM = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_ARM
-TAB_PCDS_DYNAMIC_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_EBC
-TAB_PCDS_DYNAMIC_AARCH64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_PCD_DYNAMIC_TYPE_LIST = [TAB_PCDS_DYNAMIC_DEFAULT_NULL, \
- TAB_PCDS_DYNAMIC_VPD_NULL, \
- TAB_PCDS_DYNAMIC_HII_NULL]
-TAB_PCD_DYNAMIC_EX_TYPE_LIST = [TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL, \
- TAB_PCDS_DYNAMIC_EX_VPD_NULL, \
- TAB_PCDS_DYNAMIC_EX_HII_NULL]
-
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE = \
-'PcdLoadFixAddressPeiCodePageNumber'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE = 'UINT32'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE = \
-'PcdLoadFixAddressBootTimeCodePageNumber'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE_DATA_TYPE = 'UINT32'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE = \
-'PcdLoadFixAddressRuntimeCodePageNumber'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE = 'UINT32'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE = \
-'PcdLoadFixAddressSmmCodePageNumber'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE = 'UINT32'
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST = \
-[TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE, \
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE, \
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE, \
-TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE]
-PCD_SECTION_LIST = [TAB_PCDS_FIXED_AT_BUILD_NULL.upper(), \
- TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper(), \
- TAB_PCDS_FEATURE_FLAG_NULL.upper(), \
- TAB_PCDS_DYNAMIC_EX_NULL.upper(), \
- TAB_PCDS_DYNAMIC_NULL.upper()]
-INF_PCD_SECTION_LIST = ["FixedPcd".upper(), "FeaturePcd".upper(), \
- "PatchPcd".upper(), "Pcd".upper(), "PcdEx".upper()]
-
-TAB_DEPEX = 'Depex'
-TAB_DEPEX_COMMON = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_DEPEX_IA32 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_IA32
-TAB_DEPEX_X64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_X64
-TAB_DEPEX_IPF = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_IPF
-TAB_DEPEX_ARM = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_ARM
-TAB_DEPEX_EBC = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_EBC
-TAB_DEPEX_AARCH64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_SKUIDS = 'SkuIds'
-
-TAB_LIBRARIES = 'Libraries'
-TAB_LIBRARIES_COMMON = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_LIBRARIES_IA32 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_IA32
-TAB_LIBRARIES_X64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_X64
-TAB_LIBRARIES_IPF = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_IPF
-TAB_LIBRARIES_ARM = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_ARM
-TAB_LIBRARIES_EBC = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_EBC
-TAB_LIBRARIES_AARCH64 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_COMPONENTS = 'Components'
-TAB_COMPONENTS_COMMON = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_COMMON
-TAB_COMPONENTS_IA32 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IA32
-TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_X64
-TAB_COMPONENTS_IPF = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IPF
-TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_ARM
-TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_EBC
-TAB_COMPONENTS_AARCH64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_AARCH64
-
-TAB_COMPONENTS_SOURCE_OVERRIDE_PATH = 'SOURCE_OVERRIDE_PATH'
-
-TAB_BUILD_OPTIONS = 'BuildOptions'
-
-TAB_DEFINE = 'DEFINE'
-TAB_NMAKE = 'Nmake'
-TAB_USER_EXTENSIONS = 'UserExtensions'
-TAB_INCLUDE = '!include'
-
-#
-# Common Define
-#
-TAB_COMMON_DEFINES = 'Defines'
-
-#
-# Inf Definitions
-#
-TAB_INF_DEFINES = TAB_COMMON_DEFINES
-TAB_INF_DEFINES_INF_VERSION = 'INF_VERSION'
-TAB_INF_DEFINES_BASE_NAME = 'BASE_NAME'
-TAB_INF_DEFINES_FILE_GUID = 'FILE_GUID'
-TAB_INF_DEFINES_MODULE_TYPE = 'MODULE_TYPE'
-TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION = 'EFI_SPECIFICATION_VERSION'
-TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION = 'UEFI_SPECIFICATION_VERSION'
-TAB_INF_DEFINES_PI_SPECIFICATION_VERSION = 'PI_SPECIFICATION_VERSION'
-TAB_INF_DEFINES_EDK_RELEASE_VERSION = 'EDK_RELEASE_VERSION'
-TAB_INF_DEFINES_BINARY_MODULE = 'BINARY_MODULE'
-TAB_INF_DEFINES_LIBRARY_CLASS = 'LIBRARY_CLASS'
-TAB_INF_DEFINES_COMPONENT_TYPE = 'COMPONENT_TYPE'
-TAB_INF_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME'
-TAB_INF_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER'
-TAB_INF_DEFINES_BUILD_TYPE = 'BUILD_TYPE'
-TAB_INF_DEFINES_FFS_EXT = 'FFS_EXT'
-TAB_INF_DEFINES_FV_EXT = 'FV_EXT'
-TAB_INF_DEFINES_SOURCE_FV = 'SOURCE_FV'
-TAB_INF_DEFINES_PACKAGE = 'PACKAGE'
-TAB_INF_DEFINES_VERSION_NUMBER = 'VERSION_NUMBER'
-TAB_INF_DEFINES_VERSION = 'VERSION'
-TAB_INF_DEFINES_VERSION_STRING = 'VERSION_STRING'
-TAB_INF_DEFINES_PCD_IS_DRIVER = 'PCD_IS_DRIVER'
-TAB_INF_DEFINES_TIANO_EDK1_FLASHMAP_H = 'TIANO_EDK1_FLASHMAP_H'
-TAB_INF_DEFINES_ENTRY_POINT = 'ENTRY_POINT'
-TAB_INF_DEFINES_UNLOAD_IMAGE = 'UNLOAD_IMAGE'
-TAB_INF_DEFINES_CONSTRUCTOR = 'CONSTRUCTOR'
-TAB_INF_DEFINES_DESTRUCTOR = 'DESTRUCTOR'
-TAB_INF_DEFINES_PCI_VENDOR_ID = 'PCI_VENDOR_ID'
-TAB_INF_DEFINES_PCI_DEVICE_ID = 'PCI_DEVICE_ID'
-TAB_INF_DEFINES_PCI_CLASS_CODE = 'PCI_CLASS_CODE'
-TAB_INF_DEFINES_PCI_REVISION = 'PCI_REVISION'
-TAB_INF_DEFINES_PCI_COMPRESS = 'PCI_COMPRESS'
-TAB_INF_DEFINES_DEFINE = 'DEFINE'
-TAB_INF_DEFINES_SPEC = 'SPEC'
-TAB_INF_DEFINES_UEFI_HII_RESOURCE_SECTION = 'UEFI_HII_RESOURCE_SECTION'
-TAB_INF_DEFINES_CUSTOM_MAKEFILE = 'CUSTOM_MAKEFILE'
-TAB_INF_DEFINES_MACRO = '__MACROS__'
-TAB_INF_DEFINES_SHADOW = 'SHADOW'
-TAB_INF_DEFINES_DPX_SOURCE = 'DPX_SOURCE'
-TAB_INF_FIXED_PCD = 'FixedPcd'
-TAB_INF_FEATURE_PCD = 'FeaturePcd'
-TAB_INF_PATCH_PCD = 'PatchPcd'
-TAB_INF_PCD = 'Pcd'
-TAB_INF_PCD_EX = 'PcdEx'
-TAB_INF_GUIDTYPE_VAR = 'Variable'
-
-#
-# Dec Definitions
-#
-TAB_DEC_DEFINES = TAB_COMMON_DEFINES
-TAB_DEC_DEFINES_DEC_SPECIFICATION = 'DEC_SPECIFICATION'
-TAB_DEC_DEFINES_PACKAGE_NAME = 'PACKAGE_NAME'
-TAB_DEC_DEFINES_PACKAGE_GUID = 'PACKAGE_GUID'
-TAB_DEC_DEFINES_PACKAGE_VERSION = 'PACKAGE_VERSION'
-TAB_DEC_DEFINES_PKG_UNI_FILE = 'PKG_UNI_FILE'
-
-#
-# Dsc Definitions
-#
-TAB_DSC_DEFINES = TAB_COMMON_DEFINES
-TAB_DSC_DEFINES_PLATFORM_NAME = 'PLATFORM_NAME'
-TAB_DSC_DEFINES_PLATFORM_GUID = 'PLATFORM_GUID'
-TAB_DSC_DEFINES_PLATFORM_VERSION = 'PLATFORM_VERSION'
-TAB_DSC_DEFINES_DSC_SPECIFICATION = 'DSC_SPECIFICATION'
-TAB_DSC_DEFINES_OUTPUT_DIRECTORY = 'OUTPUT_DIRECTORY'
-TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES = 'SUPPORTED_ARCHITECTURES'
-TAB_DSC_DEFINES_BUILD_TARGETS = 'BUILD_TARGETS'
-TAB_DSC_DEFINES_SKUID_IDENTIFIER = 'SKUID_IDENTIFIER'
-TAB_DSC_DEFINES_FLASH_DEFINITION = 'FLASH_DEFINITION'
-TAB_DSC_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER'
-TAB_DSC_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME'
-TAB_DSC_DEFINES_BS_BASE_ADDRESS = 'BsBaseAddress'
-TAB_DSC_DEFINES_RT_BASE_ADDRESS = 'RtBaseAddress'
-TAB_DSC_DEFINES_DEFINE = 'DEFINE'
-TAB_FIX_LOAD_TOP_MEMORY_ADDRESS = 'FIX_LOAD_TOP_MEMORY_ADDRESS'
-
-#
-# TargetTxt Definitions
-#
-TAB_TAT_DEFINES_ACTIVE_PLATFORM = 'ACTIVE_PLATFORM'
-TAB_TAT_DEFINES_ACTIVE_MODULE = 'ACTIVE_MODULE'
-TAB_TAT_DEFINES_TOOL_CHAIN_CONF = 'TOOL_CHAIN_CONF'
-TAB_TAT_DEFINES_MULTIPLE_THREAD = 'MULTIPLE_THREAD'
-TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER = 'MAX_CONCURRENT_THREAD_NUMBER'
-TAB_TAT_DEFINES_TARGET = 'TARGET'
-TAB_TAT_DEFINES_TOOL_CHAIN_TAG = 'TOOL_CHAIN_TAG'
-TAB_TAT_DEFINES_TARGET_ARCH = 'TARGET_ARCH'
-TAB_TAT_DEFINES_BUILD_RULE_CONF = "BUILD_RULE_CONF"
-
-#
-# ToolDef Definitions
-#
-TAB_TOD_DEFINES_TARGET = 'TARGET'
-TAB_TOD_DEFINES_TOOL_CHAIN_TAG = 'TOOL_CHAIN_TAG'
-TAB_TOD_DEFINES_TARGET_ARCH = 'TARGET_ARCH'
-TAB_TOD_DEFINES_COMMAND_TYPE = 'COMMAND_TYPE'
-TAB_TOD_DEFINES_FAMILY = 'FAMILY'
-TAB_TOD_DEFINES_BUILDRULEFAMILY = 'BUILDRULEFAMILY'
-
-#
-# Conditional Statements
-#
-TAB_IF = '!if'
-TAB_END_IF = '!endif'
-TAB_ELSE_IF = '!elseif'
-TAB_ELSE = '!else'
-TAB_IF_DEF = '!ifdef'
-TAB_IF_N_DEF = '!ifndef'
-TAB_IF_EXIST = '!if exist'
-
-#
-# Unknown section
-#
-TAB_UNKNOWN = 'UNKNOWN'
-
-#
-# Header section (virtual section for abstract, description, copyright,
-# license)
-#
-TAB_HEADER = 'Header'
-TAB_HEADER_ABSTRACT = 'Abstract'
-TAB_HEADER_DESCRIPTION = 'Description'
-TAB_HEADER_COPYRIGHT = 'Copyright'
-TAB_HEADER_LICENSE = 'License'
-#
-# Build database path
-#
-DATABASE_PATH = ":memory:"
-#
-# used by ECC
-#
-MODIFIER_LIST = ['IN', 'OUT', 'OPTIONAL', 'UNALIGNED', 'EFI_RUNTIMESERVICE', \
- 'EFI_BOOTSERVICE', 'EFIAPI']
-#
-# Dependency Expression
-#
-DEPEX_SUPPORTED_OPCODE = ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", \
- "END", "SOR", "TRUE", "FALSE", '(', ')']
-
-TAB_STATIC_LIBRARY = "STATIC-LIBRARY-FILE"
-TAB_DYNAMIC_LIBRARY = "DYNAMIC-LIBRARY-FILE"
-TAB_FRAMEWORK_IMAGE = "EFI-IMAGE-FILE"
-TAB_C_CODE_FILE = "C-CODE-FILE"
-TAB_C_HEADER_FILE = "C-HEADER-FILE"
-TAB_UNICODE_FILE = "UNICODE-TEXT-FILE"
-TAB_DEPENDENCY_EXPRESSION_FILE = "DEPENDENCY-EXPRESSION-FILE"
-TAB_UNKNOWN_FILE = "UNKNOWN-TYPE-FILE"
-TAB_DEFAULT_BINARY_FILE = "_BINARY_FILE_"
-#
-# used to indicate the state of processing header comment section of dec,
-# inf files
-#
-HEADER_COMMENT_NOT_STARTED = -1
-HEADER_COMMENT_STARTED = 0
-HEADER_COMMENT_FILE = 1
-HEADER_COMMENT_ABSTRACT = 2
-HEADER_COMMENT_DESCRIPTION = 3
-HEADER_COMMENT_COPYRIGHT = 4
-HEADER_COMMENT_LICENSE = 5
-HEADER_COMMENT_END = 6
-
-#
-# Static values for data models
-#
-MODEL_UNKNOWN = 0
-
-MODEL_FILE_C = 1001
-MODEL_FILE_H = 1002
-MODEL_FILE_ASM = 1003
-MODEL_FILE_INF = 1011
-MODEL_FILE_DEC = 1012
-MODEL_FILE_DSC = 1013
-MODEL_FILE_FDF = 1014
-MODEL_FILE_INC = 1015
-MODEL_FILE_CIF = 1016
-
-MODEL_IDENTIFIER_FILE_HEADER = 2001
-MODEL_IDENTIFIER_FUNCTION_HEADER = 2002
-MODEL_IDENTIFIER_COMMENT = 2003
-MODEL_IDENTIFIER_PARAMETER = 2004
-MODEL_IDENTIFIER_STRUCTURE = 2005
-MODEL_IDENTIFIER_VARIABLE = 2006
-MODEL_IDENTIFIER_INCLUDE = 2007
-MODEL_IDENTIFIER_PREDICATE_EXPRESSION = 2008
-MODEL_IDENTIFIER_ENUMERATE = 2009
-MODEL_IDENTIFIER_PCD = 2010
-MODEL_IDENTIFIER_UNION = 2011
-MODEL_IDENTIFIER_MACRO_IFDEF = 2012
-MODEL_IDENTIFIER_MACRO_IFNDEF = 2013
-MODEL_IDENTIFIER_MACRO_DEFINE = 2014
-MODEL_IDENTIFIER_MACRO_ENDIF = 2015
-MODEL_IDENTIFIER_MACRO_PROGMA = 2016
-MODEL_IDENTIFIER_FUNCTION_CALLING = 2018
-MODEL_IDENTIFIER_TYPEDEF = 2017
-MODEL_IDENTIFIER_FUNCTION_DECLARATION = 2019
-MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION = 2020
-
-MODEL_EFI_PROTOCOL = 3001
-MODEL_EFI_PPI = 3002
-MODEL_EFI_GUID = 3003
-MODEL_EFI_LIBRARY_CLASS = 3004
-MODEL_EFI_LIBRARY_INSTANCE = 3005
-MODEL_EFI_PCD = 3006
-MODEL_EFI_SOURCE_FILE = 3007
-MODEL_EFI_BINARY_FILE = 3008
-MODEL_EFI_SKU_ID = 3009
-MODEL_EFI_INCLUDE = 3010
-MODEL_EFI_DEPEX = 3011
-
-MODEL_PCD = 4000
-MODEL_PCD_FIXED_AT_BUILD = 4001
-MODEL_PCD_PATCHABLE_IN_MODULE = 4002
-MODEL_PCD_FEATURE_FLAG = 4003
-MODEL_PCD_DYNAMIC_EX = 4004
-MODEL_PCD_DYNAMIC_EX_DEFAULT = 4005
-MODEL_PCD_DYNAMIC_EX_VPD = 4006
-MODEL_PCD_DYNAMIC_EX_HII = 4007
-MODEL_PCD_DYNAMIC = 4008
-MODEL_PCD_DYNAMIC_DEFAULT = 4009
-MODEL_PCD_DYNAMIC_VPD = 4010
-MODEL_PCD_DYNAMIC_HII = 4011
-
-MODEL_META_DATA_FILE_HEADER = 5000
-MODEL_META_DATA_HEADER = 5001
-MODEL_META_DATA_INCLUDE = 5002
-MODEL_META_DATA_DEFINE = 5003
-MODEL_META_DATA_CONDITIONAL_STATEMENT_IF = 5004
-MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE = 5005
-MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF = 5006
-MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF = 5007
-MODEL_META_DATA_BUILD_OPTION = 5008
-MODEL_META_DATA_COMPONENT = 5009
-MODEL_META_DATA_USER_EXTENSION = 5010
-MODEL_META_DATA_PACKAGE = 5011
-MODEL_META_DATA_NMAKE = 5012
-MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF = 50013
-MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF = 5014
-MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH = 5015
-
-TOOL_FAMILY_LIST = ["MSFT",
- "INTEL",
- "GCC",
- "RVCT"
- ]
-
-TYPE_HOB_SECTION = 'HOB'
-TYPE_EVENT_SECTION = 'EVENT'
-TYPE_BOOTMODE_SECTION = 'BOOTMODE'
diff --git a/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py b/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py
deleted file mode 100644
index 91041c7a64..0000000000
--- a/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py
+++ /dev/null
@@ -1,489 +0,0 @@
-## @file
-# This file is used to check PCD logical expression
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-ExpressionValidate
-'''
-
-##
-# Import Modules
-#
-import re
-from Logger import StringTable as ST
-
-## IsValidBareCString
-#
-# Check if String is comprised by whitespace(0x20), !(0x21), 0x23 - 0x7E
-# or '\n', '\t', '\f', '\r', '\b', '\0', '\\'
-#
-# @param String: string to be checked
-#
-def IsValidBareCString(String):
- EscapeList = ['n', 't', 'f', 'r', 'b', '0', '\\', '"']
- PreChar = ''
- LastChar = ''
- for Char in String:
- LastChar = Char
- if PreChar == '\\':
- if Char not in EscapeList:
- return False
- if Char == '\\':
- PreChar = ''
- continue
- else:
- IntChar = ord(Char)
- if IntChar != 0x20 and IntChar != 0x09 and IntChar != 0x21 \
- and (IntChar < 0x23 or IntChar > 0x7e):
- return False
- PreChar = Char
-
- # Last char cannot be \ if PreChar is not \
- if LastChar == '\\' and PreChar == LastChar:
- return False
- return True
-
-def _ValidateToken(Token):
- Token = Token.strip()
- Index = Token.find("\"")
- if Index != -1:
- return IsValidBareCString(Token[Index+1:-1])
- return True
-
-## _ExprError
-#
-# @param Exception: Exception
-#
-class _ExprError(Exception):
- def __init__(self, Error = ''):
- Exception.__init__(self)
- self.Error = Error
-
-## _ExprBase
-#
-class _ExprBase:
- HEX_PATTERN = '[\t\s]*0[xX][a-fA-F0-9]+'
- INT_PATTERN = '[\t\s]*[0-9]+'
- MACRO_PATTERN = '[\t\s]*\$\(([A-Z][_A-Z0-9]*)\)'
- PCD_PATTERN = \
- '[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*\.[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*'
- QUOTED_PATTERN = '[\t\s]*L?"[^"]*"'
- BOOL_PATTERN = '[\t\s]*(true|True|TRUE|false|False|FALSE)'
- def __init__(self, Token):
- self.Token = Token
- self.Index = 0
- self.Len = len(Token)
-
- ## SkipWhitespace
- #
- def SkipWhitespace(self):
- for Char in self.Token[self.Index:]:
- if Char not in ' \t':
- break
- self.Index += 1
-
- ## IsCurrentOp
- #
- # @param OpList: option list
- #
- def IsCurrentOp(self, OpList):
- self.SkipWhitespace()
- LetterOp = ["EQ", "NE", "GE", "LE", "GT", "LT", "NOT", "and", "AND",
- "or", "OR", "XOR"]
- OpMap = {
- '|' : '|',
- '&' : '&',
- '!' : '=',
- '>' : '=',
- '<' : '='
- }
- for Operator in OpList:
- if not self.Token[self.Index:].startswith(Operator):
- continue
- self.Index += len(Operator)
- Char = self.Token[self.Index : self.Index + 1]
- if (Operator in LetterOp and (Char == '_' or Char.isalnum())) \
- or (Operator in OpMap and OpMap[Operator] == Char):
- self.Index -= len(Operator)
- break
- return True
- return False
-
-## _LogicalExpressionParser
-#
-# @param _ExprBase: _ExprBase object
-#
-class _LogicalExpressionParser(_ExprBase):
- #
- # STRINGITEM can only be logical field according to spec
- #
- STRINGITEM = -1
-
- #
- # Evaluate to True or False
- #
- LOGICAL = 0
- REALLOGICAL = 2
-
- #
- # Just arithmetic expression
- #
- ARITH = 1
-
- def __init__(self, Token):
- _ExprBase.__init__(self, Token)
- self.Parens = 0
-
- def _CheckToken(self, MatchList):
- for Match in MatchList:
- if Match and Match.start() == 0:
- if not _ValidateToken(
- self.Token[self.Index:self.Index+Match.end()]
- ):
- return False
-
- self.Index += Match.end()
- if self.Token[self.Index - 1] == '"':
- return True
- if self.Token[self.Index:self.Index+1] == '_' or \
- self.Token[self.Index:self.Index+1].isalnum():
- self.Index -= Match.end()
- return False
-
- Token = self.Token[self.Index - Match.end():self.Index]
- if Token.strip() in ["EQ", "NE", "GE", "LE", "GT", "LT",
- "NOT", "and", "AND", "or", "OR", "XOR"]:
- self.Index -= Match.end()
- return False
-
- return True
- return False
-
- def IsAtomicNumVal(self):
- #
- # Hex number
- #
- Match1 = re.compile(self.HEX_PATTERN).match(self.Token[self.Index:])
-
- #
- # Number
- #
- Match2 = re.compile(self.INT_PATTERN).match(self.Token[self.Index:])
-
- #
- # Macro
- #
- Match3 = re.compile(self.MACRO_PATTERN).match(self.Token[self.Index:])
-
- #
- # PcdName
- #
- Match4 = re.compile(self.PCD_PATTERN).match(self.Token[self.Index:])
-
- return self._CheckToken([Match1, Match2, Match3, Match4])
-
-
- def IsAtomicItem(self):
- #
- # Macro
- #
- Match1 = re.compile(self.MACRO_PATTERN).match(self.Token[self.Index:])
-
- #
- # PcdName
- #
- Match2 = re.compile(self.PCD_PATTERN).match(self.Token[self.Index:])
-
- #
- # Quoted string
- #
- Match3 = re.compile(self.QUOTED_PATTERN).\
- match(self.Token[self.Index:].replace('\\\\', '//').\
- replace('\\\"', '\\\''))
-
- return self._CheckToken([Match1, Match2, Match3])
-
- ## A || B
- #
- def LogicalExpression(self):
- Ret = self.SpecNot()
- while self.IsCurrentOp(['||', 'OR', 'or', '&&', 'AND', 'and', 'XOR']):
- if self.Token[self.Index-1] == '|' and self.Parens <= 0:
- raise _ExprError(ST.ERR_EXPR_OR)
- if Ret == self.ARITH:
- raise _ExprError(ST.ERR_EXPR_LOGICAL % self.Token)
- Ret = self.SpecNot()
- if Ret == self.ARITH:
- raise _ExprError(ST.ERR_EXPR_LOGICAL % self.Token)
- Ret = self.REALLOGICAL
- return Ret
-
- def SpecNot(self):
- if self.IsCurrentOp(["NOT", "!"]):
- return self.SpecNot()
- return self.Rel()
-
- ## A < B, A > B, A <= B, A >= b
- #
- def Rel(self):
- Ret = self.Expr()
- if self.IsCurrentOp(["<=", ">=", ">", "<", "GT", "LT", "GE", "LE",
- "==", "EQ", "!=", "NE"]):
- if Ret == self.STRINGITEM or Ret == self.REALLOGICAL:
- raise _ExprError(ST.ERR_EXPR_LOGICAL % self.Token)
- Ret = self.Expr()
- if Ret == self.STRINGITEM or Ret == self.REALLOGICAL:
- raise _ExprError(ST.ERR_EXPR_LOGICAL % self.Token)
- Ret = self.REALLOGICAL
- return Ret
-
- ## A + B, A - B
- #
- def Expr(self):
- Ret = self.Factor()
- while self.IsCurrentOp(["+", "-", "&", "|", "^"]):
- if self.Token[self.Index-1] == '|' and self.Parens <= 0:
- raise _ExprError(ST.ERR_EXPR_OR)
- if Ret == self.STRINGITEM or Ret == self.REALLOGICAL:
- raise _ExprError(ST.ERR_EXPR_LOGICAL % self.Token)
- Ret = self.Factor()
- if Ret == self.STRINGITEM or Ret == self.REALLOGICAL:
- raise _ExprError(ST.ERR_EXPR_LOGICAL % self.Token)
- Ret = self.ARITH
- return Ret
-
- ## Factor
- #
- def Factor(self):
- if self.IsCurrentOp(["("]):
- self.Parens += 1
- Ret = self.LogicalExpression()
- if not self.IsCurrentOp([")"]):
- raise _ExprError(ST.ERR_EXPR_RIGHT_PAREN % \
- (self.Token, self.Token[self.Index:]))
- self.Parens -= 1
- return Ret
-
- if self.IsAtomicItem():
- if self.Token[self.Index - 1] == '"':
- return self.STRINGITEM
- return self.LOGICAL
- elif self.IsAtomicNumVal():
- return self.ARITH
- else:
- raise _ExprError(ST.ERR_EXPR_FACTOR % \
- (self.Token, self.Token[self.Index:]))
-
- ## IsValidLogicalExpression
- #
- def IsValidLogicalExpression(self):
- if self.Len == 0:
- return False, ST.ERR_EXPR_EMPTY
- try:
- if self.LogicalExpression() == self.ARITH:
- return False, ST.ERR_EXPR_LOGICAL % self.Token
- except _ExprError, XExcept:
- return False, XExcept.Error
- self.SkipWhitespace()
- if self.Index != self.Len:
- return False, (ST.ERR_EXPR_BOOLEAN % \
- (self.Token[self.Index:], self.Token))
- return True, ''
-
-## _ValidRangeExpressionParser
-#
-class _ValidRangeExpressionParser(_ExprBase):
- INT_RANGE_PATTERN = '[\t\s]*[0-9]+[\t\s]*-[\t\s]*[0-9]+'
- HEX_RANGE_PATTERN = \
- '[\t\s]*0[xX][a-fA-F0-9]+[\t\s]*-[\t\s]*0[xX][a-fA-F0-9]+'
- def __init__(self, Token):
- _ExprBase.__init__(self, Token)
-
- ## IsValidRangeExpression
- #
- def IsValidRangeExpression(self):
- if self.Len == 0:
- return False
- try:
- self.RangeExpression()
- except _ExprError:
- return False
- self.SkipWhitespace()
- if self.Index != self.Len:
- return False
- return True
-
- ## RangeExpression
- #
- def RangeExpression(self):
- self.Unary()
- while self.IsCurrentOp(['OR', 'AND', 'XOR']):
- self.Unary()
-
- ## Unary
- #
- def Unary(self):
- if self.IsCurrentOp(["NOT", "-"]):
- return self.Unary()
- return self.ValidRange()
-
- ## ValidRange
- #
- def ValidRange(self):
- if self.IsCurrentOp(["("]):
- self.RangeExpression()
- if not self.IsCurrentOp([")"]):
- raise _ExprError('')
- return
-
- if self.IsCurrentOp(["LT", "GT", "LE", "GE", "EQ"]):
- IntMatch = \
- re.compile(self.INT_PATTERN).match(self.Token[self.Index:])
- HexMatch = \
- re.compile(self.HEX_PATTERN).match(self.Token[self.Index:])
- if HexMatch and HexMatch.start() == 0:
- self.Index += HexMatch.end()
- elif IntMatch and IntMatch.start() == 0:
- self.Index += IntMatch.end()
- else:
- raise _ExprError('')
- else:
- IntRangeMatch = re.compile(
- self.INT_RANGE_PATTERN).match(self.Token[self.Index:]
- )
- HexRangeMatch = re.compile(
- self.HEX_RANGE_PATTERN).match(self.Token[self.Index:]
- )
- if HexRangeMatch and HexRangeMatch.start() == 0:
- self.Index += HexRangeMatch.end()
- elif IntRangeMatch and IntRangeMatch.start() == 0:
- self.Index += IntRangeMatch.end()
- else:
- raise _ExprError('')
-
- if self.Token[self.Index:self.Index+1] == '_' or \
- self.Token[self.Index:self.Index+1].isalnum():
- raise _ExprError('')
-
-## _StringTestParser
-#
-class _StringTestParser(_ExprBase):
- def __init__(self, Token):
- _ExprBase.__init__(self, Token)
-
- ## IsValidStringTest
- #
- def IsValidStringTest(self):
- if self.Len == 0:
- return False, ST.ERR_EXPR_EMPTY
- try:
- self.StringTest()
- except _ExprError, XExcept:
- return False, XExcept.Error
- return True, ''
-
- ## StringItem
- #
- def StringItem(self):
- Match1 = re.compile(self.QUOTED_PATTERN)\
- .match(self.Token[self.Index:].replace('\\\\', '//')\
- .replace('\\\"', '\\\''))
- Match2 = re.compile(self.MACRO_PATTERN).match(self.Token[self.Index:])
- Match3 = re.compile(self.PCD_PATTERN).match(self.Token[self.Index:])
- MatchList = [Match1, Match2, Match3]
- for Match in MatchList:
- if Match and Match.start() == 0:
- if not _ValidateToken(
- self.Token[self.Index:self.Index+Match.end()]
- ):
- raise _ExprError(ST.ERR_EXPR_STRING_ITEM % \
- (self.Token, self.Token[self.Index:]))
- self.Index += Match.end()
- Token = self.Token[self.Index - Match.end():self.Index]
- if Token.strip() in ["EQ", "NE"]:
- raise _ExprError(ST.ERR_EXPR_STRING_ITEM % \
- (self.Token, self.Token[self.Index:]))
- return
- else:
- raise _ExprError(ST.ERR_EXPR_STRING_ITEM % \
- (self.Token, self.Token[self.Index:]))
-
- ## StringTest
- #
- def StringTest(self):
- self.StringItem()
- if not self.IsCurrentOp(["==", "EQ", "!=", "NE"]):
- raise _ExprError(ST.ERR_EXPR_EQUALITY % \
- (self.Token, self.Token[self.Index:]))
- self.StringItem()
- if self.Index != self.Len:
- raise _ExprError(ST.ERR_EXPR_BOOLEAN % \
- (self.Token[self.Index:], self.Token))
-
-##
-# Check syntax of logical expression
-#
-# @param Token: expression token
-#
-def IsValidLogicalExpr(Token, Flag=False):
- #
- # Not do the check right now, keep the implementation for future enhancement.
- #
- if not Flag:
- return True, ""
- return _LogicalExpressionParser(Token).IsValidLogicalExpression()
-
-##
-# Check syntax of string test
-#
-# @param Token: string test token
-#
-def IsValidStringTest(Token, Flag=False):
- #
- # Not do the check right now, keep the implementation for future enhancement.
- #
- if not Flag:
- return True, ""
- return _StringTestParser(Token).IsValidStringTest()
-
-##
-# Check syntax of range expression
-#
-# @param Token: range expression token
-#
-def IsValidRangeExpr(Token):
- return _ValidRangeExpressionParser(Token).IsValidRangeExpression()
-
-##
-# Check whether the feature flag expression is valid or not
-#
-# @param Token: feature flag expression
-#
-def IsValidFeatureFlagExp(Token, Flag=False):
- #
- # Not do the check right now, keep the implementation for future enhancement.
- #
- if not Flag:
- return True, "", Token
- else:
- if Token in ['TRUE', 'FALSE', 'true', 'false', 'True', 'False',
- '0x1', '0x01', '0x0', '0x00']:
- return True, ""
- Valid, Cause = IsValidStringTest(Token, Flag)
- if not Valid:
- Valid, Cause = IsValidLogicalExpr(Token, Flag)
- if not Valid:
- return False, Cause
- return True, ""
-
-if __name__ == '__main__':
- print _LogicalExpressionParser('a ^ b > a + b').IsValidLogicalExpression()
diff --git a/BaseTools/Source/Python/UPT/Library/GlobalData.py b/BaseTools/Source/Python/UPT/Library/GlobalData.py
deleted file mode 100644
index 3f72f22738..0000000000
--- a/BaseTools/Source/Python/UPT/Library/GlobalData.py
+++ /dev/null
@@ -1,99 +0,0 @@
-## @file
-# This file is used to define common static strings and global data used by UPT
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-GlobalData
-'''
-
-#
-# The workspace directory
-#
-gWORKSPACE = '.'
-
-#
-# INF module directory
-#
-gINF_MODULE_DIR = "."
-gINF_MODULE_NAME = ''
-
-#
-# the directory to holds upt related files
-#
-gUPT_DIR = r"Conf/upt/"
-
-#
-# Log file for invalid meta-data files during force removing
-#
-gINVALID_MODULE_FILE = gUPT_DIR + r"Invalid_Modules.log"
-
-#
-# File name for content zip file in the distribution
-#
-gCONTENT_FILE = "dist.content"
-
-#
-# File name for XML file in the distibution
-#
-gDESC_FILE = 'dist.pkg'
-
-#
-# Case Insensitive flag
-#
-gCASE_INSENSITIVE = ''
-
-#
-# All Files dictionary
-#
-gALL_FILES = {}
-
-#
-# Database instance
-#
-gDB = None
-
-#
-# list for files that are found in module level but not in INF files,
-# items are (File, ModulePath), all these should be relative to $(WORKSPACE)
-#
-gMISS_FILE_IN_MODLIST = []
-
-#
-# Global Current Line
-#
-gINF_CURRENT_LINE = None
-
-#
-# Global pkg list
-#
-gWSPKG_LIST = []
-
-#
-# Flag used to take WARN as ERROR.
-# By default, only ERROR message will break the tools execution.
-#
-gWARNING_AS_ERROR = False
-
-#
-# Used to specify the temp directory to hold the unpacked distribution files
-#
-gUNPACK_DIR = None
-
-#
-# Flag used to mark whether the INF file is Binary INF or not.
-#
-gIS_BINARY_INF = False
-#
-# Used by Library instance parser
-# {FilePath: FileObj}
-#
-gLIBINSTANCEDICT = {} \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Library/Misc.py b/BaseTools/Source/Python/UPT/Library/Misc.py
deleted file mode 100644
index 889b777d19..0000000000
--- a/BaseTools/Source/Python/UPT/Library/Misc.py
+++ /dev/null
@@ -1,974 +0,0 @@
-## @file
-# Common routines used by all tools
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Misc
-'''
-
-##
-# Import Modules
-#
-import os.path
-from os import access
-from os import F_OK
-from os import makedirs
-from os import getcwd
-from os import chdir
-from os import listdir
-from os import remove
-from os import rmdir
-from os import linesep
-from os import walk
-from os import environ
-import re
-from UserDict import IterableUserDict
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger import ToolError
-from Library import GlobalData
-from Library.DataType import SUP_MODULE_LIST
-from Library.DataType import END_OF_LINE
-from Library.DataType import TAB_SPLIT
-from Library.DataType import LANGUAGE_EN_US
-from Library.String import GetSplitValueList
-from Library.ParserValidate import IsValidHexVersion
-from Library.ParserValidate import IsValidPath
-from Object.POM.CommonObject import TextObject
-
-## Convert GUID string in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx style to C
-# structure style
-#
-# @param Guid: The GUID string
-#
-def GuidStringToGuidStructureString(Guid):
- GuidList = Guid.split('-')
- Result = '{'
- for Index in range(0, 3, 1):
- Result = Result + '0x' + GuidList[Index] + ', '
- Result = Result + '{0x' + GuidList[3][0:2] + ', 0x' + GuidList[3][2:4]
- for Index in range(0, 12, 2):
- Result = Result + ', 0x' + GuidList[4][Index:Index + 2]
- Result += '}}'
- return Result
-
-## Check whether GUID string is of format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
-#
-# @param GuidValue: The GUID value
-#
-def CheckGuidRegFormat(GuidValue):
- ## Regular expression used to find out register format of GUID
- #
- RegFormatGuidPattern = re.compile("^\s*([0-9a-fA-F]){8}-"
- "([0-9a-fA-F]){4}-"
- "([0-9a-fA-F]){4}-"
- "([0-9a-fA-F]){4}-"
- "([0-9a-fA-F]){12}\s*$")
-
- if RegFormatGuidPattern.match(GuidValue):
- return True
- else:
- return False
-
-
-## Convert GUID string in C structure style to
-# xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
-#
-# @param GuidValue: The GUID value in C structure format
-#
-def GuidStructureStringToGuidString(GuidValue):
- GuidValueString = GuidValue.lower().replace("{", "").replace("}", "").\
- replace(" ", "").replace(";", "")
- GuidValueList = GuidValueString.split(",")
- if len(GuidValueList) != 11:
- return ''
- try:
- return "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" % (
- int(GuidValueList[0], 16),
- int(GuidValueList[1], 16),
- int(GuidValueList[2], 16),
- int(GuidValueList[3], 16),
- int(GuidValueList[4], 16),
- int(GuidValueList[5], 16),
- int(GuidValueList[6], 16),
- int(GuidValueList[7], 16),
- int(GuidValueList[8], 16),
- int(GuidValueList[9], 16),
- int(GuidValueList[10], 16)
- )
- except BaseException:
- return ''
-
-## Create directories
-#
-# @param Directory: The directory name
-#
-def CreateDirectory(Directory):
- if Directory == None or Directory.strip() == "":
- return True
- try:
- if not access(Directory, F_OK):
- makedirs(Directory)
- except BaseException:
- return False
- return True
-
-## Remove directories, including files and sub-directories in it
-#
-# @param Directory: The directory name
-#
-def RemoveDirectory(Directory, Recursively=False):
- if Directory == None or Directory.strip() == "" or not \
- os.path.exists(Directory):
- return
- if Recursively:
- CurrentDirectory = getcwd()
- chdir(Directory)
- for File in listdir("."):
- if os.path.isdir(File):
- RemoveDirectory(File, Recursively)
- else:
- remove(File)
- chdir(CurrentDirectory)
- rmdir(Directory)
-
-## Store content in file
-#
-# This method is used to save file only when its content is changed. This is
-# quite useful for "make" system to decide what will be re-built and what
-# won't.
-#
-# @param File: The path of file
-# @param Content: The new content of the file
-# @param IsBinaryFile: The flag indicating if the file is binary file
-# or not
-#
-def SaveFileOnChange(File, Content, IsBinaryFile=True):
- if not IsBinaryFile:
- Content = Content.replace("\n", linesep)
-
- if os.path.exists(File):
- try:
- if Content == open(File, "rb").read():
- return False
- except BaseException:
- Logger.Error(None, ToolError.FILE_OPEN_FAILURE, ExtraData=File)
-
- CreateDirectory(os.path.dirname(File))
- try:
- FileFd = open(File, "wb")
- FileFd.write(Content)
- FileFd.close()
- except BaseException:
- Logger.Error(None, ToolError.FILE_CREATE_FAILURE, ExtraData=File)
-
- return True
-
-## Get all files of a directory
-#
-# @param Root: Root dir
-# @param SkipList : The files need be skipped
-#
-def GetFiles(Root, SkipList=None, FullPath=True):
- OriPath = os.path.normpath(Root)
- FileList = []
- for Root, Dirs, Files in walk(Root):
- if SkipList:
- for Item in SkipList:
- if Item in Dirs:
- Dirs.remove(Item)
- for Dir in Dirs:
- if Dir.startswith('.'):
- Dirs.remove(Dir)
-
- for File in Files:
- if File.startswith('.'):
- continue
- File = os.path.normpath(os.path.join(Root, File))
- if not FullPath:
- File = File[len(OriPath) + 1:]
- FileList.append(File)
-
- return FileList
-
-## Get all non-metadata files of a directory
-#
-# @param Root: Root Dir
-# @param SkipList : List of path need be skipped
-# @param FullPath: True if the returned file should be full path
-# @param PrefixPath: the path that need to be added to the files found
-# @return: the list of files found
-#
-def GetNonMetaDataFiles(Root, SkipList, FullPath, PrefixPath):
- FileList = GetFiles(Root, SkipList, FullPath)
- NewFileList = []
- for File in FileList:
- ExtName = os.path.splitext(File)[1]
- #
- # skip '.dec', '.inf', '.dsc', '.fdf' files
- #
- if ExtName.lower() not in ['.dec', '.inf', '.dsc', '.fdf']:
- NewFileList.append(os.path.normpath(os.path.join(PrefixPath, File)))
-
- return NewFileList
-
-## Check if given file exists or not
-#
-# @param File: File name or path to be checked
-# @param Dir: The directory the file is relative to
-#
-def ValidFile(File, Ext=None):
- File = File.replace('\\', '/')
- if Ext != None:
- FileExt = os.path.splitext(File)[1]
- if FileExt.lower() != Ext.lower():
- return False
- if not os.path.exists(File):
- return False
- return True
-
-## RealPath
-#
-# @param File: File name or path to be checked
-# @param Dir: The directory the file is relative to
-# @param OverrideDir: The override directory
-#
-def RealPath(File, Dir='', OverrideDir=''):
- NewFile = os.path.normpath(os.path.join(Dir, File))
- NewFile = GlobalData.gALL_FILES[NewFile]
- if not NewFile and OverrideDir:
- NewFile = os.path.normpath(os.path.join(OverrideDir, File))
- NewFile = GlobalData.gALL_FILES[NewFile]
- return NewFile
-
-## RealPath2
-#
-# @param File: File name or path to be checked
-# @param Dir: The directory the file is relative to
-# @param OverrideDir: The override directory
-#
-def RealPath2(File, Dir='', OverrideDir=''):
- if OverrideDir:
- NewFile = GlobalData.gALL_FILES[os.path.normpath(os.path.join\
- (OverrideDir, File))]
- if NewFile:
- if OverrideDir[-1] == os.path.sep:
- return NewFile[len(OverrideDir):], NewFile[0:len(OverrideDir)]
- else:
- return NewFile[len(OverrideDir) + 1:], \
- NewFile[0:len(OverrideDir)]
-
- NewFile = GlobalData.gALL_FILES[os.path.normpath(os.path.join(Dir, File))]
- if NewFile:
- if Dir:
- if Dir[-1] == os.path.sep:
- return NewFile[len(Dir):], NewFile[0:len(Dir)]
- else:
- return NewFile[len(Dir) + 1:], NewFile[0:len(Dir)]
- else:
- return NewFile, ''
-
- return None, None
-
-## A dict which can access its keys and/or values orderly
-#
-# The class implements a new kind of dict which its keys or values can be
-# accessed in the order they are added into the dict. It guarantees the order
-# by making use of an internal list to keep a copy of keys.
-#
-class Sdict(IterableUserDict):
- ## Constructor
- #
- def __init__(self):
- IterableUserDict.__init__(self)
- self._key_list = []
-
- ## [] operator
- #
- def __setitem__(self, Key, Value):
- if Key not in self._key_list:
- self._key_list.append(Key)
- IterableUserDict.__setitem__(self, Key, Value)
-
- ## del operator
- #
- def __delitem__(self, Key):
- self._key_list.remove(Key)
- IterableUserDict.__delitem__(self, Key)
-
- ## used in "for k in dict" loop to ensure the correct order
- #
- def __iter__(self):
- return self.iterkeys()
-
- ## len() support
- #
- def __len__(self):
- return len(self._key_list)
-
- ## "in" test support
- #
- def __contains__(self, Key):
- return Key in self._key_list
-
- ## indexof support
- #
- def index(self, Key):
- return self._key_list.index(Key)
-
- ## insert support
- #
- def insert(self, Key, Newkey, Newvalue, Order):
- Index = self._key_list.index(Key)
- if Order == 'BEFORE':
- self._key_list.insert(Index, Newkey)
- IterableUserDict.__setitem__(self, Newkey, Newvalue)
- elif Order == 'AFTER':
- self._key_list.insert(Index + 1, Newkey)
- IterableUserDict.__setitem__(self, Newkey, Newvalue)
-
- ## append support
- #
- def append(self, Sdict2):
- for Key in Sdict2:
- if Key not in self._key_list:
- self._key_list.append(Key)
- IterableUserDict.__setitem__(self, Key, Sdict2[Key])
- ## hash key
- #
- def has_key(self, Key):
- return Key in self._key_list
-
- ## Empty the dict
- #
- def clear(self):
- self._key_list = []
- IterableUserDict.clear(self)
-
- ## Return a copy of keys
- #
- def keys(self):
- Keys = []
- for Key in self._key_list:
- Keys.append(Key)
- return Keys
-
- ## Return a copy of values
- #
- def values(self):
- Values = []
- for Key in self._key_list:
- Values.append(self[Key])
- return Values
-
- ## Return a copy of (key, value) list
- #
- def items(self):
- Items = []
- for Key in self._key_list:
- Items.append((Key, self[Key]))
- return Items
-
- ## Iteration support
- #
- def iteritems(self):
- return iter(self.items())
-
- ## Keys interation support
- #
- def iterkeys(self):
- return iter(self.keys())
-
- ## Values interation support
- #
- def itervalues(self):
- return iter(self.values())
-
- ## Return value related to a key, and remove the (key, value) from the dict
- #
- def pop(self, Key, *Dv):
- Value = None
- if Key in self._key_list:
- Value = self[Key]
- self.__delitem__(Key)
- elif len(Dv) != 0 :
- Value = Dv[0]
- return Value
-
- ## Return (key, value) pair, and remove the (key, value) from the dict
- #
- def popitem(self):
- Key = self._key_list[-1]
- Value = self[Key]
- self.__delitem__(Key)
- return Key, Value
- ## update method
- #
- def update(self, Dict=None, **Kwargs):
- if Dict != None:
- for Key1, Val1 in Dict.items():
- self[Key1] = Val1
- if len(Kwargs):
- for Key1, Val1 in Kwargs.items():
- self[Key1] = Val1
-
-## CommonPath
-#
-# @param PathList: PathList
-#
-def CommonPath(PathList):
- Path1 = min(PathList).split(os.path.sep)
- Path2 = max(PathList).split(os.path.sep)
- for Index in xrange(min(len(Path1), len(Path2))):
- if Path1[Index] != Path2[Index]:
- return os.path.sep.join(Path1[:Index])
- return os.path.sep.join(Path1)
-
-## PathClass
-#
-class PathClass(object):
- def __init__(self, File='', Root='', AlterRoot='', Type='', IsBinary=False,
- Arch='COMMON', ToolChainFamily='', Target='', TagName='', \
- ToolCode=''):
- self.Arch = Arch
- self.File = str(File)
- if os.path.isabs(self.File):
- self.Root = ''
- self.AlterRoot = ''
- else:
- self.Root = str(Root)
- self.AlterRoot = str(AlterRoot)
-
- #
- # Remove any '.' and '..' in path
- #
- if self.Root:
- self.Path = os.path.normpath(os.path.join(self.Root, self.File))
- self.Root = os.path.normpath(CommonPath([self.Root, self.Path]))
- #
- # eliminate the side-effect of 'C:'
- #
- if self.Root[-1] == ':':
- self.Root += os.path.sep
- #
- # file path should not start with path separator
- #
- if self.Root[-1] == os.path.sep:
- self.File = self.Path[len(self.Root):]
- else:
- self.File = self.Path[len(self.Root) + 1:]
- else:
- self.Path = os.path.normpath(self.File)
-
- self.SubDir, self.Name = os.path.split(self.File)
- self.BaseName, self.Ext = os.path.splitext(self.Name)
-
- if self.Root:
- if self.SubDir:
- self.Dir = os.path.join(self.Root, self.SubDir)
- else:
- self.Dir = self.Root
- else:
- self.Dir = self.SubDir
-
- if IsBinary:
- self.Type = Type
- else:
- self.Type = self.Ext.lower()
-
- self.IsBinary = IsBinary
- self.Target = Target
- self.TagName = TagName
- self.ToolCode = ToolCode
- self.ToolChainFamily = ToolChainFamily
-
- self._Key = None
-
- ## Convert the object of this class to a string
- #
- # Convert member Path of the class to a string
- #
- def __str__(self):
- return self.Path
-
- ## Override __eq__ function
- #
- # Check whether PathClass are the same
- #
- def __eq__(self, Other):
- if type(Other) == type(self):
- return self.Path == Other.Path
- else:
- return self.Path == str(Other)
-
- ## Override __hash__ function
- #
- # Use Path as key in hash table
- #
- def __hash__(self):
- return hash(self.Path)
-
- ## _GetFileKey
- #
- def _GetFileKey(self):
- if self._Key == None:
- self._Key = self.Path.upper()
- return self._Key
- ## Validate
- #
- def Validate(self, Type='', CaseSensitive=True):
- if GlobalData.gCASE_INSENSITIVE:
- CaseSensitive = False
- if Type and Type.lower() != self.Type:
- return ToolError.FILE_TYPE_MISMATCH, '%s (expect %s but got %s)' % \
- (self.File, Type, self.Type)
-
- RealFile, RealRoot = RealPath2(self.File, self.Root, self.AlterRoot)
- if not RealRoot and not RealFile:
- RealFile = self.File
- if self.AlterRoot:
- RealFile = os.path.join(self.AlterRoot, self.File)
- elif self.Root:
- RealFile = os.path.join(self.Root, self.File)
- return ToolError.FILE_NOT_FOUND, os.path.join(self.AlterRoot, RealFile)
-
- ErrorCode = 0
- ErrorInfo = ''
- if RealRoot != self.Root or RealFile != self.File:
- if CaseSensitive and (RealFile != self.File or \
- (RealRoot != self.Root and RealRoot != \
- self.AlterRoot)):
- ErrorCode = ToolError.FILE_CASE_MISMATCH
- ErrorInfo = self.File + '\n\t' + RealFile + \
- " [in file system]"
-
- self.SubDir, self.Name = os.path.split(RealFile)
- self.BaseName, self.Ext = os.path.splitext(self.Name)
- if self.SubDir:
- self.Dir = os.path.join(RealRoot, self.SubDir)
- else:
- self.Dir = RealRoot
- self.File = RealFile
- self.Root = RealRoot
- self.Path = os.path.join(RealRoot, RealFile)
- return ErrorCode, ErrorInfo
-
- Key = property(_GetFileKey)
-
-## Check environment variables
-#
-# Check environment variables that must be set for build. Currently they are
-#
-# WORKSPACE The directory all packages/platforms start from
-# EDK_TOOLS_PATH The directory contains all tools needed by the build
-# PATH $(EDK_TOOLS_PATH)/Bin/<sys> must be set in PATH
-#
-# If any of above environment variable is not set or has error, the build
-# will be broken.
-#
-def CheckEnvVariable():
- #
- # check WORKSPACE
- #
- if "WORKSPACE" not in environ:
- Logger.Error("UPT",
- ToolError.UPT_ENVIRON_MISSING_ERROR,
- ST.ERR_NOT_FOUND_ENVIRONMENT,
- ExtraData="WORKSPACE")
-
- WorkspaceDir = os.path.normpath(environ["WORKSPACE"])
- if not os.path.exists(WorkspaceDir):
- Logger.Error("UPT",
- ToolError.UPT_ENVIRON_MISSING_ERROR,
- ST.ERR_WORKSPACE_NOTEXIST,
- ExtraData="%s" % WorkspaceDir)
- elif ' ' in WorkspaceDir:
- Logger.Error("UPT",
- ToolError.FORMAT_NOT_SUPPORTED,
- ST.ERR_SPACE_NOTALLOWED,
- ExtraData=WorkspaceDir)
-
-## Check whether all module types are in list
-#
-# check whether all module types (SUP_MODULE_LIST) are in list
-#
-# @param ModuleList: a list of ModuleType
-#
-def IsAllModuleList(ModuleList):
- NewModuleList = [Module.upper() for Module in ModuleList]
- for Module in SUP_MODULE_LIST:
- if Module not in NewModuleList:
- return False
- else:
- return True
-
-## Dictionary that use comment(GenericComment, TailComment) as value,
-# if a new comment which key already in the dic is inserted, then the
-# comment will be merged.
-# Key is (Statement, SupArch), when TailComment is added, it will ident
-# according to Statement
-#
-class MergeCommentDict(dict):
- ## []= operator
- #
- def __setitem__(self, Key, CommentVal):
- GenericComment, TailComment = CommentVal
- if Key in self:
- OrigVal1, OrigVal2 = dict.__getitem__(self, Key)
- Statement = Key[0]
- dict.__setitem__(self, Key, (OrigVal1 + GenericComment, OrigVal2 \
- + len(Statement) * ' ' + TailComment))
- else:
- dict.__setitem__(self, Key, (GenericComment, TailComment))
-
- ## =[] operator
- #
- def __getitem__(self, Key):
- return dict.__getitem__(self, Key)
-
-
-## GenDummyHelpTextObj
-#
-# @retval HelpTxt: Generated dummy help text object
-#
-def GenDummyHelpTextObj():
- HelpTxt = TextObject()
- HelpTxt.SetLang(LANGUAGE_EN_US)
- HelpTxt.SetString(' ')
- return HelpTxt
-
-## ConvertVersionToDecimal, the minor version should be within 0 - 99
-# <HexVersion> ::= "0x" <Major> <Minor>
-# <Major> ::= (a-fA-F0-9){4}
-# <Minor> ::= (a-fA-F0-9){4}
-# <DecVersion> ::= (0-65535) ["." (0-99)]
-#
-# @param StringIn: The string contains version defined in INF file.
-# It can be Decimal or Hex
-#
-def ConvertVersionToDecimal(StringIn):
- if IsValidHexVersion(StringIn):
- Value = int(StringIn, 16)
- Major = Value >> 16
- Minor = Value & 0xFFFF
- MinorStr = str(Minor)
- if len(MinorStr) == 1:
- MinorStr = '0' + MinorStr
- return str(Major) + '.' + MinorStr
- else:
- if StringIn.find(TAB_SPLIT) != -1:
- return StringIn
- elif StringIn:
- return StringIn + '.0'
- else:
- #
- # when StringIn is '', return it directly
- #
- return StringIn
-
-## GetHelpStringByRemoveHashKey
-#
-# Remove hash key at the header of string and return the remain.
-#
-# @param String: The string need to be processed.
-#
-def GetHelpStringByRemoveHashKey(String):
- ReturnString = ''
- PattenRemoveHashKey = re.compile(r"^[#+\s]+", re.DOTALL)
- String = String.strip()
- if String == '':
- return String
-
- LineList = GetSplitValueList(String, END_OF_LINE)
- for Line in LineList:
- ValueList = PattenRemoveHashKey.split(Line)
- if len(ValueList) == 1:
- ReturnString += ValueList[0] + END_OF_LINE
- else:
- ReturnString += ValueList[1] + END_OF_LINE
-
- if ReturnString.endswith('\n') and not ReturnString.endswith('\n\n') and ReturnString != '\n':
- ReturnString = ReturnString[:-1]
-
- return ReturnString
-
-## ConvPathFromAbsToRel
-#
-# Get relative file path from absolute path.
-#
-# @param Path: The string contain file absolute path.
-# @param Root: The string contain the parent path of Path in.
-#
-#
-def ConvPathFromAbsToRel(Path, Root):
- Path = os.path.normpath(Path)
- Root = os.path.normpath(Root)
- FullPath = os.path.normpath(os.path.join(Root, Path))
-
- #
- # If Path is absolute path.
- # It should be in Root.
- #
- if os.path.isabs(Path):
- return FullPath[FullPath.find(Root) + len(Root) + 1:]
-
- else:
- return Path
-
-## ConvertPath
-#
-# Convert special characters to '_', '\' to '/'
-# return converted path: Test!1.inf -> Test_1.inf
-#
-# @param Path: Path to be converted
-#
-def ConvertPath(Path):
- RetPath = ''
- for Char in Path.strip():
- if Char.isalnum() or Char in '.-_/':
- RetPath = RetPath + Char
- elif Char == '\\':
- RetPath = RetPath + '/'
- else:
- RetPath = RetPath + '_'
- return RetPath
-
-## ConvertSpec
-#
-# during install, convert the Spec string extract from UPD into INF allowable definition,
-# the difference is period is allowed in the former (not the first letter) but not in the latter.
-# return converted Spec string
-#
-# @param SpecStr: SpecStr to be converted
-#
-def ConvertSpec(SpecStr):
- RetStr = ''
- for Char in SpecStr:
- if Char.isalnum() or Char == '_':
- RetStr = RetStr + Char
- else:
- RetStr = RetStr + '_'
-
- return RetStr
-
-
-## IsEqualList
-#
-# Judge two lists are identical(contain same item).
-# The rule is elements in List A are in List B and elements in List B are in List A.
-#
-# @param ListA, ListB Lists need to be judged.
-#
-# @return True ListA and ListB are identical
-# @return False ListA and ListB are different with each other
-#
-def IsEqualList(ListA, ListB):
- if ListA == ListB:
- return True
-
- for ItemA in ListA:
- if not ItemA in ListB:
- return False
-
- for ItemB in ListB:
- if not ItemB in ListA:
- return False
-
- return True
-
-## ConvertArchList
-#
-# Convert item in ArchList if the start character is lower case.
-# In UDP spec, Arch is only allowed as: [A-Z]([a-zA-Z0-9])*
-#
-# @param ArchList The ArchList need to be converted.
-#
-# @return NewList The ArchList been converted.
-#
-def ConvertArchList(ArchList):
- NewArchList = []
- if not ArchList:
- return NewArchList
-
- if type(ArchList) == list:
- for Arch in ArchList:
- Arch = Arch.upper()
- NewArchList.append(Arch)
- elif type(ArchList) == str:
- ArchList = ArchList.upper()
- NewArchList.append(ArchList)
-
- return NewArchList
-
-## ProcessLineExtender
-#
-# Process the LineExtender of Line in LineList.
-# If one line ends with a line extender, then it will be combined together with next line.
-#
-# @param LineList The LineList need to be processed.
-#
-# @return NewList The ArchList been processed.
-#
-def ProcessLineExtender(LineList):
- NewList = []
- Count = 0
- while Count < len(LineList):
- if LineList[Count].strip().endswith("\\") and Count + 1 < len(LineList):
- NewList.append(LineList[Count].strip()[:-2] + LineList[Count + 1])
- Count = Count + 1
- else:
- NewList.append(LineList[Count])
-
- Count = Count + 1
-
- return NewList
-
-## ProcessEdkComment
-#
-# Process EDK style comment in LineList: c style /* */ comment or cpp style // comment
-#
-#
-# @param LineList The LineList need to be processed.
-#
-# @return LineList The LineList been processed.
-# @return FirstPos Where Edk comment is first found, -1 if not found
-#
-def ProcessEdkComment(LineList):
- FindEdkBlockComment = False
- Count = 0
- StartPos = -1
- EndPos = -1
- FirstPos = -1
-
- while(Count < len(LineList)):
- Line = LineList[Count].strip()
- if Line.startswith("/*"):
- #
- # handling c style comment
- #
- StartPos = Count
- while Count < len(LineList):
- Line = LineList[Count].strip()
- if Line.endswith("*/"):
- if (Count == StartPos) and Line.strip() == '/*/':
- Count = Count + 1
- continue
- EndPos = Count
- FindEdkBlockComment = True
- break
- Count = Count + 1
-
- if FindEdkBlockComment:
- if FirstPos == -1:
- FirstPos = StartPos
- for Index in xrange(StartPos, EndPos+1):
- LineList[Index] = ''
- FindEdkBlockComment = False
- elif Line.find("//") != -1 and not Line.startswith("#"):
- #
- # handling cpp style comment
- #
- LineList[Count] = Line.replace("//", '#')
- if FirstPos == -1:
- FirstPos = Count
-
- Count = Count + 1
-
- return LineList, FirstPos
-
-## GetLibInstanceInfo
-#
-# Get the information from Library Instance INF file.
-#
-# @param string. A string start with # and followed by INF file path
-# @param WorkSpace. The WorkSpace directory used to combined with INF file path.
-#
-# @return GUID, Version
-def GetLibInstanceInfo(String, WorkSpace, LineNo):
-
- FileGuidString = ""
- VerString = ""
-
- OrignalString = String
- String = String.strip()
- if not String:
- return None, None
- #
- # Remove "#" characters at the beginning
- #
- String = GetHelpStringByRemoveHashKey(String)
- String = String.strip()
-
- #
- # Validate file name exist.
- #
- FullFileName = os.path.normpath(os.path.realpath(os.path.join(WorkSpace, String)))
- if not (ValidFile(FullFileName)):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_FILELIST_EXIST % (String),
- File=GlobalData.gINF_MODULE_NAME,
- Line=LineNo,
- ExtraData=OrignalString)
-
- #
- # Validate file exist/format.
- #
- if IsValidPath(String, WorkSpace):
- IsValidFileFlag = True
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID % (String),
- File=GlobalData.gINF_MODULE_NAME,
- Line=LineNo,
- ExtraData=OrignalString)
- return False
- if IsValidFileFlag:
- FileLinesList = []
-
- try:
- FInputfile = open(FullFileName, "rb", 0)
- try:
- FileLinesList = FInputfile.readlines()
- except BaseException:
- Logger.Error("InfParser",
- ToolError.FILE_READ_FAILURE,
- ST.ERR_FILE_OPEN_FAILURE,
- File=FullFileName)
- finally:
- FInputfile.close()
- except BaseException:
- Logger.Error("InfParser",
- ToolError.FILE_READ_FAILURE,
- ST.ERR_FILE_OPEN_FAILURE,
- File=FullFileName)
-
- ReFileGuidPattern = re.compile("^\s*FILE_GUID\s*=.*$")
- ReVerStringPattern = re.compile("^\s*VERSION_STRING\s*=.*$")
-
- FileLinesList = ProcessLineExtender(FileLinesList)
-
- for Line in FileLinesList:
- if ReFileGuidPattern.match(Line):
- FileGuidString = Line
- if ReVerStringPattern.match(Line):
- VerString = Line
-
- if FileGuidString:
- FileGuidString = GetSplitValueList(FileGuidString, '=', 1)[1]
- if VerString:
- VerString = GetSplitValueList(VerString, '=', 1)[1]
-
- return FileGuidString, VerString
diff --git a/BaseTools/Source/Python/UPT/Library/ParserValidate.py b/BaseTools/Source/Python/UPT/Library/ParserValidate.py
deleted file mode 100644
index 860fb4f1dc..0000000000
--- a/BaseTools/Source/Python/UPT/Library/ParserValidate.py
+++ /dev/null
@@ -1,723 +0,0 @@
-## @file ParserValidate.py
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-PaserValidate
-'''
-
-import os.path
-import re
-import platform
-
-from Library.DataType import MODULE_LIST
-from Library.DataType import COMPONENT_TYPE_LIST
-from Library.DataType import PCD_USAGE_TYPE_LIST_OF_MODULE
-from Library.DataType import TAB_SPACE_SPLIT
-from Library.String import GetSplitValueList
-from Library.ExpressionValidate import IsValidBareCString
-from Library.ExpressionValidate import IsValidFeatureFlagExp
-
-## __HexDigit() method
-#
-# Whether char input is a Hex data bit
-#
-# @param TempChar: The char to test
-#
-def __HexDigit(TempChar):
- if (TempChar >= 'a' and TempChar <= 'f') or \
- (TempChar >= 'A' and TempChar <= 'F') \
- or (TempChar >= '0' and TempChar <= '9'):
- return True
- else:
- return False
-
-## IsValidHex() method
-#
-# Whether char input is a Hex data.
-#
-# @param TempChar: The char to test
-#
-def IsValidHex(HexStr):
- if not HexStr.upper().startswith("0X"):
- return False
- CharList = [c for c in HexStr[2:] if not __HexDigit(c)]
- if len(CharList) == 0:
- return True
- else:
- return False
-
-## Judge the input string is valid bool type or not.
-#
-# <TRUE> ::= {"TRUE"} {"true"} {"True"} {"0x1"} {"0x01"}
-# <FALSE> ::= {"FALSE"} {"false"} {"False"} {"0x0"} {"0x00"}
-# <BoolType> ::= {<TRUE>} {<FALSE>}
-#
-# @param BoolString: A string contained the value need to be judged.
-#
-def IsValidBoolType(BoolString):
- #
- # Valid Ture
- #
- if BoolString == 'TRUE' or \
- BoolString == 'True' or \
- BoolString == 'true' or \
- BoolString == '0x1' or \
- BoolString == '0x01':
- return True
- #
- # Valid False
- #
- elif BoolString == 'FALSE' or \
- BoolString == 'False' or \
- BoolString == 'false' or \
- BoolString == '0x0' or \
- BoolString == '0x00':
- return True
- #
- # Invalid bool type
- #
- else:
- return False
-
-## Is Valid Module Type List or not
-#
-# @param ModuleTypeList: A list contain ModuleType strings need to be
-# judged.
-#
-def IsValidInfMoudleTypeList(ModuleTypeList):
- for ModuleType in ModuleTypeList:
- return IsValidInfMoudleType(ModuleType)
-
-## Is Valid Module Type or not
-#
-# @param ModuleType: A string contain ModuleType need to be judged.
-#
-def IsValidInfMoudleType(ModuleType):
- if ModuleType in MODULE_LIST:
- return True
- else:
- return False
-
-## Is Valid Component Type or not
-#
-# @param ComponentType: A string contain ComponentType need to be judged.
-#
-def IsValidInfComponentType(ComponentType):
- if ComponentType.upper() in COMPONENT_TYPE_LIST:
- return True
- else:
- return False
-
-
-## Is valid Tool Family or not
-#
-# @param ToolFamily: A string contain Tool Family need to be judged.
-# Famlily := [A-Z]([a-zA-Z0-9])*
-#
-def IsValidToolFamily(ToolFamily):
- ReIsValieFamily = re.compile(r"^[A-Z]+[A-Za-z0-9]{0,}$", re.DOTALL)
- if ReIsValieFamily.match(ToolFamily) == None:
- return False
- return True
-
-## Is valid Tool TagName or not
-#
-# The TagName sample is MYTOOLS and VS2005.
-#
-# @param TagName: A string contain Tool TagName need to be judged.
-#
-def IsValidToolTagName(TagName):
- if TagName.strip() == '':
- return True
- if TagName.strip() == '*':
- return True
- if not IsValidWord(TagName):
- return False
- return True
-
-## Is valid arch or not
-#
-# @param Arch The arch string need to be validated
-# <OA> ::= (a-zA-Z)(A-Za-z0-9){0,}
-# <arch> ::= {"IA32"} {"X64"} {"IPF"} {"EBC"} {<OA>}
-# {"common"}
-# @param Arch: Input arch
-#
-def IsValidArch(Arch):
- if Arch == 'common':
- return True
- ReIsValieArch = re.compile(r"^[a-zA-Z]+[a-zA-Z0-9]{0,}$", re.DOTALL)
- if ReIsValieArch.match(Arch) == None:
- return False
- return True
-
-## Is valid family or not
-#
-# <Family> ::= {"MSFT"} {"GCC"} {"INTEL"} {<Usr>} {"*"}
-# <Usr> ::= [A-Z][A-Za-z0-9]{0,}
-#
-# @param family: The family string need to be validated
-#
-def IsValidFamily(Family):
- Family = Family.strip()
- if Family == '*':
- return True
-
- if Family == '':
- return True
-
- ReIsValidFamily = re.compile(r"^[A-Z]+[A-Za-z0-9]{0,}$", re.DOTALL)
- if ReIsValidFamily.match(Family) == None:
- return False
- return True
-
-## Is valid build option name or not
-#
-# @param BuildOptionName: The BuildOptionName string need to be validated
-#
-def IsValidBuildOptionName(BuildOptionName):
- if not BuildOptionName:
- return False
-
- ToolOptionList = GetSplitValueList(BuildOptionName, '_', 4)
-
- if len(ToolOptionList) != 5:
- return False
-
- ReIsValidBuildOption1 = re.compile(r"^\s*(\*)|([A-Z][a-zA-Z0-9]*)$")
- ReIsValidBuildOption2 = re.compile(r"^\s*(\*)|([a-zA-Z][a-zA-Z0-9]*)$")
-
- if ReIsValidBuildOption1.match(ToolOptionList[0]) == None:
- return False
-
- if ReIsValidBuildOption1.match(ToolOptionList[1]) == None:
- return False
-
- if ReIsValidBuildOption2.match(ToolOptionList[2]) == None:
- return False
-
- if ToolOptionList[3] == "*" and ToolOptionList[4] not in ['FAMILY', 'DLL', 'DPATH']:
- return False
-
- return True
-
-## IsValidToken
-#
-# Check if pattern string matches total token
-#
-# @param ReString: regular string
-# @param Token: Token to be matched
-#
-def IsValidToken(ReString, Token):
- Match = re.compile(ReString).match(Token)
- return Match and Match.start() == 0 and Match.end() == len(Token)
-
-## IsValidPath
-#
-# Check if path exist
-#
-# @param Path: Absolute path or relative path to be checked
-# @param Root: Root path
-#
-def IsValidPath(Path, Root):
- Path = Path.strip()
- OrigPath = Path.replace('\\', '/')
-
- Path = os.path.normpath(Path).replace('\\', '/')
- Root = os.path.normpath(Root).replace('\\', '/')
- FullPath = os.path.normpath(os.path.join(Root, Path)).replace('\\', '/')
-
- if not os.path.exists(FullPath):
- return False
-
- #
- # If Path is absolute path.
- # It should be in Root.
- #
- if os.path.isabs(Path):
- if not Path.startswith(Root):
- return False
- return True
-
- #
- # Check illegal character
- #
- for Rel in ['/', './', '../']:
- if OrigPath.startswith(Rel):
- return False
- for Rel in ['//', '/./', '/../']:
- if Rel in OrigPath:
- return False
- for Rel in ['/.', '/..', '/']:
- if OrigPath.endswith(Rel):
- return False
-
- Path = Path.rstrip('/')
-
- #
- # Check relative path
- #
- for Word in Path.split('/'):
- if not IsValidWord(Word):
- return False
-
- return True
-
-## IsValidInstallPath
-#
-# Check if an install path valid or not.
-#
-# Absolute path or path starts with '.' or path contains '..' are invalid.
-#
-# @param Path: path to be checked
-#
-def IsValidInstallPath(Path):
- if platform.platform().find("Windows") >= 0:
- if os.path.isabs(Path):
- return False
- else:
- if Path[1:2] == ':':
- return False
- if os.path.isabs(Path):
- return False
- if Path.startswith('.'):
- return False
-
- if Path.find('..') != -1:
- return False
-
- return True
-
-
-## IsValidCFormatGuid
-#
-# Check if GUID format has the from of {8,4,4,{2,2,2,2,2,2,2,2}}
-#
-# @param Guid: Guid to be checked
-#
-def IsValidCFormatGuid(Guid):
- #
- # Valid: { 0xf0b11735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38,
- # 0xaf, 0x48, 0xce }}
- # Invalid: { 0xf0b11735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38,
- # 0xaf, 0x48, 0xce }} 0x123
- # Invalid: { 0xf0b1 1735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38,
- # 0xaf, 0x48, 0xce }}
- #
- List = ['{', 10, ',', 6, ',', 6, ',{', 4, ',', 4, ',', 4,
- ',', 4, ',', 4, ',', 4, ',', 4, ',', 4, '}}']
- Index = 0
- Value = ''
- SepValue = ''
- for Char in Guid:
- if Char not in '{},\t ':
- Value += Char
- continue
- if Value:
- try:
- #
- # Index may out of bound
- #
- if not SepValue or SepValue != List[Index]:
- return False
- Index += 1
- SepValue = ''
-
- if not Value.startswith('0x') and not Value.startswith('0X'):
- return False
-
- #
- # Index may out of bound
- #
- if type(List[Index]) != type(1) or \
- len(Value) > List[Index] or len(Value) < 3:
- return False
-
- #
- # Check if string can be converted to integer
- # Throw exception if not
- #
- int(Value, 16)
- except BaseException:
- #
- # Exception caught means invalid format
- #
- return False
- Value = ''
- Index += 1
- if Char in '{},':
- SepValue += Char
-
- return SepValue == '}}' and Value == ''
-
-## IsValidPcdType
-#
-# Check whether the PCD type is valid
-#
-# @param PcdTypeString: The PcdType string need to be checked.
-#
-def IsValidPcdType(PcdTypeString):
- if PcdTypeString.upper() in PCD_USAGE_TYPE_LIST_OF_MODULE:
- return True
- else:
- return False
-
-## IsValidWord
-#
-# Check whether the word is valid.
-# <Word> ::= (a-zA-Z0-9_)(a-zA-Z0-9_-){0,} Alphanumeric characters with
-# optional
-# dash "-" and/or underscore "_" characters. No whitespace
-# characters are permitted.
-#
-# @param Word: The word string need to be checked.
-#
-def IsValidWord(Word):
- if not Word:
- return False
- #
- # The first char should be alpha, _ or Digit.
- #
- if not Word[0].isalnum() and \
- not Word[0] == '_' and \
- not Word[0].isdigit():
- return False
-
- LastChar = ''
- for Char in Word[1:]:
- if (not Char.isalpha()) and \
- (not Char.isdigit()) and \
- Char != '-' and \
- Char != '_' and \
- Char != '.':
- return False
- if Char == '.' and LastChar == '.':
- return False
- LastChar = Char
-
- return True
-
-
-## IsValidSimpleWord
-#
-# Check whether the SimpleWord is valid.
-# <SimpleWord> ::= (a-zA-Z0-9)(a-zA-Z0-9_-){0,}
-# A word that cannot contain a period character.
-#
-# @param Word: The word string need to be checked.
-#
-def IsValidSimpleWord(Word):
- ReIsValidSimpleWord = \
- re.compile(r"^[0-9A-Za-z][0-9A-Za-z\-_]*$", re.DOTALL)
- Word = Word.strip()
- if not Word:
- return False
-
- if not ReIsValidSimpleWord.match(Word):
- return False
-
- return True
-
-## IsValidDecVersion
-#
-# Check whether the decimal version is valid.
-# <DecVersion> ::= (0-9){1,} ["." (0-9){1,}]
-#
-# @param Word: The word string need to be checked.
-#
-def IsValidDecVersion(Word):
- if Word.find('.') > -1:
- ReIsValidDecVersion = re.compile(r"[0-9]+\.?[0-9]+$")
- else:
- ReIsValidDecVersion = re.compile(r"[0-9]+$")
- if ReIsValidDecVersion.match(Word) == None:
- return False
- return True
-
-## IsValidHexVersion
-#
-# Check whether the hex version is valid.
-# <HexVersion> ::= "0x" <Major> <Minor>
-# <Major> ::= <HexDigit>{4}
-# <Minor> ::= <HexDigit>{4}
-#
-# @param Word: The word string need to be checked.
-#
-def IsValidHexVersion(Word):
- ReIsValidHexVersion = re.compile(r"[0][xX][0-9A-Fa-f]{8}$", re.DOTALL)
- if ReIsValidHexVersion.match(Word) == None:
- return False
-
- return True
-
-## IsValidBuildNumber
-#
-# Check whether the BUILD_NUMBER is valid.
-# ["BUILD_NUMBER" "=" <Integer>{1,4} <EOL>]
-#
-# @param Word: The BUILD_NUMBER string need to be checked.
-#
-def IsValidBuildNumber(Word):
- ReIsValieBuildNumber = re.compile(r"[0-9]{1,4}$", re.DOTALL)
- if ReIsValieBuildNumber.match(Word) == None:
- return False
-
- return True
-
-## IsValidDepex
-#
-# Check whether the Depex is valid.
-#
-# @param Word: The Depex string need to be checked.
-#
-def IsValidDepex(Word):
- Index = Word.upper().find("PUSH")
- if Index > -1:
- return IsValidCFormatGuid(Word[Index+4:].strip())
-
- ReIsValidCName = re.compile(r"^[A-Za-z_][0-9A-Za-z_\s\.]*$", re.DOTALL)
- if ReIsValidCName.match(Word) == None:
- return False
-
- return True
-
-## IsValidNormalizedString
-#
-# Check
-# <NormalizedString> ::= <DblQuote> [{<Word>} {<Space>}]{1,} <DblQuote>
-# <Space> ::= 0x20
-#
-# @param String: string to be checked
-#
-def IsValidNormalizedString(String):
- if String == '':
- return True
-
- for Char in String:
- if Char == '\t':
- return False
-
- StringList = GetSplitValueList(String, TAB_SPACE_SPLIT)
-
- for Item in StringList:
- if not Item:
- continue
- if not IsValidWord(Item):
- return False
-
- return True
-
-## IsValidIdString
-#
-# Check whether the IdString is valid.
-#
-# @param IdString: The IdString need to be checked.
-#
-def IsValidIdString(String):
- if IsValidSimpleWord(String.strip()):
- return True
-
- if String.strip().startswith('"') and \
- String.strip().endswith('"'):
- String = String[1:-1]
- if String.strip() == "":
- return True
- if IsValidNormalizedString(String):
- return True
-
- return False
-
-## IsValidVersionString
-#
-# Check whether the VersionString is valid.
-# <AsciiString> ::= [ [<WhiteSpace>]{0,} [<AsciiChars>]{0,} ] {0,}
-# <WhiteSpace> ::= {<Tab>} {<Space>}
-# <Tab> ::= 0x09
-# <Space> ::= 0x20
-# <AsciiChars> ::= (0x21 - 0x7E)
-#
-# @param VersionString: The VersionString need to be checked.
-#
-def IsValidVersionString(VersionString):
- VersionString = VersionString.strip()
- for Char in VersionString:
- if not (Char >= 0x21 and Char <= 0x7E):
- return False
-
- return True
-
-## IsValidPcdValue
-#
-# Check whether the PcdValue is valid.
-#
-# @param VersionString: The PcdValue need to be checked.
-#
-def IsValidPcdValue(PcdValue):
- for Char in PcdValue:
- if Char == '\n' or Char == '\t' or Char == '\f':
- return False
-
- #
- # <Boolean>
- #
- if IsValidFeatureFlagExp(PcdValue, True)[0]:
- return True
-
- #
- # <Number> ::= {<Integer>} {<HexNumber>}
- # <Integer> ::= {(0-9)} {(1-9)(0-9){1,}}
- # <HexNumber> ::= "0x" <HexDigit>{1,}
- # <HexDigit> ::= (a-fA-F0-9)
- #
- if IsValidHex(PcdValue):
- return True
-
- ReIsValidIntegerSingle = re.compile(r"^\s*[0-9]\s*$", re.DOTALL)
- if ReIsValidIntegerSingle.match(PcdValue) != None:
- return True
-
- ReIsValidIntegerMulti = re.compile(r"^\s*[1-9][0-9]+\s*$", re.DOTALL)
- if ReIsValidIntegerMulti.match(PcdValue) != None:
- return True
-
-
- #
- # <StringVal> ::= {<StringType>} {<Array>} {"$(" <MACRO> ")"}
- # <StringType> ::= {<UnicodeString>} {<CString>}
- #
- ReIsValidStringType = re.compile(r"^\s*[\"L].*[\"]\s*$")
- if ReIsValidStringType.match(PcdValue):
- IsTrue = False
- if PcdValue.strip().startswith('L\"'):
- StringValue = PcdValue.strip().lstrip('L\"').rstrip('\"')
- if IsValidBareCString(StringValue):
- IsTrue = True
- elif PcdValue.strip().startswith('\"'):
- StringValue = PcdValue.strip().lstrip('\"').rstrip('\"')
- if IsValidBareCString(StringValue):
- IsTrue = True
- if IsTrue:
- return IsTrue
-
- #
- # <Array> ::= {<CArray>} {<NList>} {<CFormatGUID>}
- # <CArray> ::= "{" [<NList>] <CArray>{0,} "}"
- # <NList> ::= <HexByte> ["," <HexByte>]{0,}
- # <HexDigit> ::= (a-fA-F0-9)
- # <HexByte> ::= "0x" <HexDigit>{1,2}
- #
- if IsValidCFormatGuid(PcdValue):
- return True
-
- ReIsValidByteHex = re.compile(r"^\s*0x[0-9a-fA-F]{1,2}\s*$", re.DOTALL)
- if PcdValue.strip().startswith('{') and PcdValue.strip().endswith('}') :
- StringValue = PcdValue.strip().lstrip('{').rstrip('}')
- ValueList = StringValue.split(',')
- AllValidFlag = True
- for ValueItem in ValueList:
- if not ReIsValidByteHex.match(ValueItem.strip()):
- AllValidFlag = False
-
- if AllValidFlag:
- return True
-
- #
- # NList
- #
- AllValidFlag = True
- ValueList = PcdValue.split(',')
- for ValueItem in ValueList:
- if not ReIsValidByteHex.match(ValueItem.strip()):
- AllValidFlag = False
-
- if AllValidFlag:
- return True
-
- return False
-
-## IsValidCVariableName
-#
-# Check whether the PcdValue is valid.
-#
-# @param VersionString: The PcdValue need to be checked.
-#
-def IsValidCVariableName(CName):
- ReIsValidCName = re.compile(r"^[A-Za-z_][0-9A-Za-z_]*$", re.DOTALL)
- if ReIsValidCName.match(CName) == None:
- return False
-
- return True
-
-## IsValidIdentifier
-#
-# <Identifier> ::= <NonDigit> <Chars>{0,}
-# <Chars> ::= (a-zA-Z0-9_)
-# <NonDigit> ::= (a-zA-Z_)
-#
-# @param Ident: identifier to be checked
-#
-def IsValidIdentifier(Ident):
- ReIdent = re.compile(r"^[A-Za-z_][0-9A-Za-z_]*$", re.DOTALL)
- if ReIdent.match(Ident) == None:
- return False
-
- return True
-
-## IsValidDecVersionVal
-#
-# {(0-9){1,} "." (0-99)}
-#
-# @param Ver: version to be checked
-#
-def IsValidDecVersionVal(Ver):
- ReVersion = re.compile(r"[0-9]+(\.[0-9]{1,2})$")
-
- if ReVersion.match(Ver) == None:
- return False
-
- return True
-
-
-## IsValidLibName
-#
-# (A-Z)(a-zA-Z0-9){0,} and could not be "NULL"
-#
-def IsValidLibName(LibName):
- if LibName == 'NULL':
- return False
- ReLibName = re.compile("^[A-Z]+[a-zA-Z0-9]*$")
- if not ReLibName.match(LibName):
- return False
-
- return True
-
-# IsValidUserId
-#
-# <UserId> ::= (a-zA-Z)(a-zA-Z0-9_.){0,}
-# Words that contain period "." must be encapsulated in double quotation marks.
-#
-def IsValidUserId(UserId):
- UserId = UserId.strip()
- Quoted = False
- if UserId.startswith('"') and UserId.endswith('"'):
- Quoted = True
- UserId = UserId[1:-1]
- if not UserId or not UserId[0].isalpha():
- return False
- for Char in UserId[1:]:
- if not Char.isalnum() and not Char in '_.':
- return False
- if Char == '.' and not Quoted:
- return False
- return True
-
diff --git a/BaseTools/Source/Python/UPT/Library/Parsing.py b/BaseTools/Source/Python/UPT/Library/Parsing.py
deleted file mode 100644
index 95c51406b2..0000000000
--- a/BaseTools/Source/Python/UPT/Library/Parsing.py
+++ /dev/null
@@ -1,993 +0,0 @@
-## @file
-# This file is used to define common parsing related functions used in parsing
-# INF/DEC/DSC process
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Parsing
-'''
-
-##
-# Import Modules
-#
-import os.path
-import re
-
-from Library.String import RaiseParserError
-from Library.String import GetSplitValueList
-from Library.String import CheckFileType
-from Library.String import CheckFileExist
-from Library.String import CleanString
-from Library.String import NormPath
-
-from Logger.ToolError import FILE_NOT_FOUND
-from Logger.ToolError import FatalError
-from Logger.ToolError import FORMAT_INVALID
-
-from Library import DataType
-
-from Library.Misc import GuidStructureStringToGuidString
-from Library.Misc import CheckGuidRegFormat
-from Logger import StringTable as ST
-import Logger.Log as Logger
-
-from Parser.DecParser import Dec
-
-gPKG_INFO_DICT = {}
-
-## GetBuildOption
-#
-# Parse a string with format "[<Family>:]<ToolFlag>=Flag"
-# Return (Family, ToolFlag, Flag)
-#
-# @param String: String with BuildOption statement
-# @param File: The file which defines build option, used in error report
-#
-def GetBuildOption(String, File, LineNo=-1):
- (Family, ToolChain, Flag) = ('', '', '')
- if String.find(DataType.TAB_EQUAL_SPLIT) < 0:
- RaiseParserError(String, 'BuildOptions', File, \
- '[<Family>:]<ToolFlag>=Flag', LineNo)
- else:
- List = GetSplitValueList(String, DataType.TAB_EQUAL_SPLIT, MaxSplit=1)
- if List[0].find(':') > -1:
- Family = List[0][ : List[0].find(':')].strip()
- ToolChain = List[0][List[0].find(':') + 1 : ].strip()
- else:
- ToolChain = List[0].strip()
- Flag = List[1].strip()
- return (Family, ToolChain, Flag)
-
-## Get Library Class
-#
-# Get Library of Dsc as <LibraryClassKeyWord>|<LibraryInstance>
-#
-# @param Item: String as <LibraryClassKeyWord>|<LibraryInstance>
-# @param ContainerFile: The file which describes the library class, used for
-# error report
-#
-def GetLibraryClass(Item, ContainerFile, WorkspaceDir, LineNo=-1):
- List = GetSplitValueList(Item[0])
- SupMod = DataType.SUP_MODULE_LIST_STRING
- if len(List) != 2:
- RaiseParserError(Item[0], 'LibraryClasses', ContainerFile, \
- '<LibraryClassKeyWord>|<LibraryInstance>')
- else:
- CheckFileType(List[1], '.Inf', ContainerFile, \
- 'library class instance', Item[0], LineNo)
- CheckFileExist(WorkspaceDir, List[1], ContainerFile, \
- 'LibraryClasses', Item[0], LineNo)
- if Item[1] != '':
- SupMod = Item[1]
-
- return (List[0], List[1], SupMod)
-
-## Get Library Class
-#
-# Get Library of Dsc as <LibraryClassKeyWord>[|<LibraryInstance>]
-# [|<TokenSpaceGuidCName>.<PcdCName>]
-#
-# @param Item: String as <LibraryClassKeyWord>|<LibraryInstance>
-# @param ContainerFile: The file which describes the library class, used for
-# error report
-#
-def GetLibraryClassOfInf(Item, ContainerFile, WorkspaceDir, LineNo = -1):
- ItemList = GetSplitValueList((Item[0] + DataType.TAB_VALUE_SPLIT * 2))
- SupMod = DataType.SUP_MODULE_LIST_STRING
-
- if len(ItemList) > 5:
- RaiseParserError\
- (Item[0], 'LibraryClasses', ContainerFile, \
- '<LibraryClassKeyWord>[|<LibraryInstance>]\
- [|<TokenSpaceGuidCName>.<PcdCName>]')
- else:
- CheckFileType(ItemList[1], '.Inf', ContainerFile, 'LibraryClasses', \
- Item[0], LineNo)
- CheckFileExist(WorkspaceDir, ItemList[1], ContainerFile, \
- 'LibraryClasses', Item[0], LineNo)
- if ItemList[2] != '':
- CheckPcdTokenInfo(ItemList[2], 'LibraryClasses', \
- ContainerFile, LineNo)
- if Item[1] != '':
- SupMod = Item[1]
-
- return (ItemList[0], ItemList[1], ItemList[2], SupMod)
-
-## CheckPcdTokenInfo
-#
-# Check if PcdTokenInfo is following <TokenSpaceGuidCName>.<PcdCName>
-#
-# @param TokenInfoString: String to be checked
-# @param Section: Used for error report
-# @param File: Used for error report
-#
-def CheckPcdTokenInfo(TokenInfoString, Section, File, LineNo=-1):
- Format = '<TokenSpaceGuidCName>.<PcdCName>'
- if TokenInfoString != '' and TokenInfoString != None:
- TokenInfoList = GetSplitValueList(TokenInfoString, DataType.TAB_SPLIT)
- if len(TokenInfoList) == 2:
- return True
-
- RaiseParserError(TokenInfoString, Section, File, Format, LineNo)
-
-## Get Pcd
-#
-# Get Pcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<Value>
-# [|<Type>|<MaximumDatumSize>]
-#
-# @param Item: String as <PcdTokenSpaceGuidCName>.<TokenCName>|
-# <Value>[|<Type>|<MaximumDatumSize>]
-# @param ContainerFile: The file which describes the pcd, used for error
-# report
-
-#
-def GetPcd(Item, Type, ContainerFile, LineNo=-1):
- TokenGuid, TokenName, Value, MaximumDatumSize, Token = '', '', '', '', ''
- List = GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT * 2)
-
- if len(List) < 4 or len(List) > 6:
- RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \
- '<PcdTokenSpaceGuidCName>.<TokenCName>|<Value>\
- [|<Type>|<MaximumDatumSize>]', LineNo)
- else:
- Value = List[1]
- MaximumDatumSize = List[2]
- Token = List[3]
-
- if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):
- (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)
-
- return (TokenName, TokenGuid, Value, MaximumDatumSize, Token, Type)
-
-## Get FeatureFlagPcd
-#
-# Get FeatureFlagPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE
-#
-# @param Item: String as <PcdTokenSpaceGuidCName>
-# .<TokenCName>|TRUE/FALSE
-# @param ContainerFile: The file which describes the pcd, used for error
-# report
-#
-def GetFeatureFlagPcd(Item, Type, ContainerFile, LineNo=-1):
- TokenGuid, TokenName, Value = '', '', ''
- List = GetSplitValueList(Item)
- if len(List) != 2:
- RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \
- '<PcdTokenSpaceGuidCName>.<TokenCName>|TRUE/FALSE', \
- LineNo)
- else:
- Value = List[1]
- if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):
- (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)
-
- return (TokenName, TokenGuid, Value, Type)
-
-## Get DynamicDefaultPcd
-#
-# Get DynamicDefaultPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>
-# |<Value>[|<DatumTyp>[|<MaxDatumSize>]]
-#
-# @param Item: String as <PcdTokenSpaceGuidCName>.<TokenCName>|
-# TRUE/FALSE
-# @param ContainerFile: The file which describes the pcd, used for error
-# report
-#
-def GetDynamicDefaultPcd(Item, Type, ContainerFile, LineNo=-1):
- TokenGuid, TokenName, Value, DatumTyp, MaxDatumSize = '', '', '', '', ''
- List = GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT * 2)
- if len(List) < 4 or len(List) > 8:
- RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \
- '<PcdTokenSpaceGuidCName>.<TokenCName>|<Value>\
- [|<DatumTyp>[|<MaxDatumSize>]]', LineNo)
- else:
- Value = List[1]
- DatumTyp = List[2]
- MaxDatumSize = List[3]
- if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):
- (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)
-
- return (TokenName, TokenGuid, Value, DatumTyp, MaxDatumSize, Type)
-
-## Get DynamicHiiPcd
-#
-# Get DynamicHiiPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|<String>|
-# <VariableGuidCName>|<VariableOffset>[|<DefaultValue>[|<MaximumDatumSize>]]
-#
-# @param Item: String as <PcdTokenSpaceGuidCName>.<TokenCName>|
-# TRUE/FALSE
-# @param ContainerFile: The file which describes the pcd, used for error
-# report
-#
-def GetDynamicHiiPcd(Item, Type, ContainerFile, LineNo = -1):
- TokenGuid, TokenName, List1, List2, List3, List4, List5 = \
- '', '', '', '', '', '', ''
- List = GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT * 2)
- if len(List) < 6 or len(List) > 8:
- RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \
- '<PcdTokenSpaceGuidCName>.<TokenCName>|<String>|\
- <VariableGuidCName>|<VariableOffset>[|<DefaultValue>\
- [|<MaximumDatumSize>]]', LineNo)
- else:
- List1, List2, List3, List4, List5 = \
- List[1], List[2], List[3], List[4], List[5]
- if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):
- (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)
-
- return (TokenName, TokenGuid, List1, List2, List3, List4, List5, Type)
-
-## Get DynamicVpdPcd
-#
-# Get DynamicVpdPcd of Dsc as <PcdTokenSpaceGuidCName>.<TokenCName>|
-# <VpdOffset>[|<MaximumDatumSize>]
-#
-# @param Item: String as <PcdTokenSpaceGuidCName>.<TokenCName>
-# |TRUE/FALSE
-# @param ContainerFile: The file which describes the pcd, used for error
-# report
-#
-def GetDynamicVpdPcd(Item, Type, ContainerFile, LineNo=-1):
- TokenGuid, TokenName, List1, List2 = '', '', '', ''
- List = GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT)
- if len(List) < 3 or len(List) > 4:
- RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \
- '<PcdTokenSpaceGuidCName>.<TokenCName>|<VpdOffset>\
- [|<MaximumDatumSize>]', LineNo)
- else:
- List1, List2 = List[1], List[2]
- if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):
- (TokenGuid, TokenName) = GetSplitValueList(List[0], DataType.TAB_SPLIT)
-
- return (TokenName, TokenGuid, List1, List2, Type)
-
-## GetComponent
-#
-# Parse block of the components defined in dsc file
-# Set KeyValues as [ ['component name', [lib1, lib2, lib3],
-# [bo1, bo2, bo3], [pcd1, pcd2, pcd3]], ...]
-#
-# @param Lines: The content to be parsed
-# @param KeyValues: To store data after parsing
-#
-def GetComponent(Lines, KeyValues):
- (FindBlock, FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, FindPcdsDynamic, \
- FindPcdsDynamicEx) = (False, False, False, False, False, False, False, \
- False)
- ListItem = None
- LibraryClassItem = []
- BuildOption = []
- Pcd = []
-
- for Line in Lines:
- Line = Line[0]
- #
- # Ignore !include statement
- #
- if Line.upper().find(DataType.TAB_INCLUDE.upper() + ' ') > -1 or \
- Line.upper().find(DataType.TAB_DEFINE + ' ') > -1:
- continue
-
- if FindBlock == False:
- ListItem = Line
- #
- # find '{' at line tail
- #
- if Line.endswith('{'):
- FindBlock = True
- ListItem = CleanString(Line.rsplit('{', 1)[0], \
- DataType.TAB_COMMENT_SPLIT)
-
- #
- # Parse a block content
- #
- if FindBlock:
- if Line.find('<LibraryClasses>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (True, False, False, False, False, False, False)
- continue
- if Line.find('<BuildOptions>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, True, False, False, False, False, False)
- continue
- if Line.find('<PcdsFeatureFlag>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, True, False, False, False, False)
- continue
- if Line.find('<PcdsPatchableInModule>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, False, True, False, False, False)
- continue
- if Line.find('<PcdsFixedAtBuild>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, False, False, True, False, False)
- continue
- if Line.find('<PcdsDynamic>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, False, False, False, True, False)
- continue
- if Line.find('<PcdsDynamicEx>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, False, False, False, False, True)
- continue
- if Line.endswith('}'):
- #
- # find '}' at line tail
- #
- KeyValues.append([ListItem, LibraryClassItem, \
- BuildOption, Pcd])
- (FindBlock, FindLibraryClass, FindBuildOption, \
- FindPcdsFeatureFlag, FindPcdsPatchableInModule, \
- FindPcdsFixedAtBuild, FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, False, False, False, False, False, False)
- LibraryClassItem, BuildOption, Pcd = [], [], []
- continue
-
- if FindBlock:
- if FindLibraryClass:
- LibraryClassItem.append(Line)
- elif FindBuildOption:
- BuildOption.append(Line)
- elif FindPcdsFeatureFlag:
- Pcd.append((DataType.TAB_PCDS_FEATURE_FLAG_NULL, Line))
- elif FindPcdsPatchableInModule:
- Pcd.append((DataType.TAB_PCDS_PATCHABLE_IN_MODULE_NULL, Line))
- elif FindPcdsFixedAtBuild:
- Pcd.append((DataType.TAB_PCDS_FIXED_AT_BUILD_NULL, Line))
- elif FindPcdsDynamic:
- Pcd.append((DataType.TAB_PCDS_DYNAMIC_DEFAULT_NULL, Line))
- elif FindPcdsDynamicEx:
- Pcd.append((DataType.TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL, Line))
- else:
- KeyValues.append([ListItem, [], [], []])
-
- return True
-
-## GetExec
-#
-# Parse a string with format "InfFilename [EXEC = ExecFilename]"
-# Return (InfFilename, ExecFilename)
-#
-# @param String: String with EXEC statement
-#
-def GetExec(String):
- InfFilename = ''
- ExecFilename = ''
- if String.find('EXEC') > -1:
- InfFilename = String[ : String.find('EXEC')].strip()
- ExecFilename = String[String.find('EXEC') + len('EXEC') : ].strip()
- else:
- InfFilename = String.strip()
-
- return (InfFilename, ExecFilename)
-
-## GetComponents
-#
-# Parse block of the components defined in dsc file
-# Set KeyValues as [ ['component name', [lib1, lib2, lib3], [bo1, bo2, bo3],
-# [pcd1, pcd2, pcd3]], ...]
-#
-# @param Lines: The content to be parsed
-# @param Key: Reserved
-# @param KeyValues: To store data after parsing
-# @param CommentCharacter: Comment char, used to ignore comment content
-#
-# @retval True Get component successfully
-#
-def GetComponents(Lines, KeyValues, CommentCharacter):
- if Lines.find(DataType.TAB_SECTION_END) > -1:
- Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
- (FindBlock, FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, FindPcdsDynamic, \
- FindPcdsDynamicEx) = \
- (False, False, False, False, False, False, False, False)
- ListItem = None
- LibraryClassItem = []
- BuildOption = []
- Pcd = []
-
- LineList = Lines.split('\n')
- for Line in LineList:
- Line = CleanString(Line, CommentCharacter)
- if Line == None or Line == '':
- continue
-
- if FindBlock == False:
- ListItem = Line
- #
- # find '{' at line tail
- #
- if Line.endswith('{'):
- FindBlock = True
- ListItem = CleanString(Line.rsplit('{', 1)[0], CommentCharacter)
-
- #
- # Parse a block content
- #
- if FindBlock:
- if Line.find('<LibraryClasses>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (True, False, False, False, False, False, False)
- continue
- if Line.find('<BuildOptions>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, True, False, False, False, False, False)
- continue
- if Line.find('<PcdsFeatureFlag>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, True, False, False, False, False)
- continue
- if Line.find('<PcdsPatchableInModule>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, False, True, False, False, False)
- continue
- if Line.find('<PcdsFixedAtBuild>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, False, False, True, False, False)
- continue
- if Line.find('<PcdsDynamic>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, False, False, False, True, False)
- continue
- if Line.find('<PcdsDynamicEx>') != -1:
- (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
- FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \
- FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, False, False, False, False, True)
- continue
- if Line.endswith('}'):
- #
- # find '}' at line tail
- #
- KeyValues.append([ListItem, LibraryClassItem, BuildOption, \
- Pcd])
- (FindBlock, FindLibraryClass, FindBuildOption, \
- FindPcdsFeatureFlag, FindPcdsPatchableInModule, \
- FindPcdsFixedAtBuild, FindPcdsDynamic, FindPcdsDynamicEx) = \
- (False, False, False, False, False, False, False, False)
- LibraryClassItem, BuildOption, Pcd = [], [], []
- continue
-
- if FindBlock:
- if FindLibraryClass:
- LibraryClassItem.append(Line)
- elif FindBuildOption:
- BuildOption.append(Line)
- elif FindPcdsFeatureFlag:
- Pcd.append((DataType.TAB_PCDS_FEATURE_FLAG, Line))
- elif FindPcdsPatchableInModule:
- Pcd.append((DataType.TAB_PCDS_PATCHABLE_IN_MODULE, Line))
- elif FindPcdsFixedAtBuild:
- Pcd.append((DataType.TAB_PCDS_FIXED_AT_BUILD, Line))
- elif FindPcdsDynamic:
- Pcd.append((DataType.TAB_PCDS_DYNAMIC, Line))
- elif FindPcdsDynamicEx:
- Pcd.append((DataType.TAB_PCDS_DYNAMIC_EX, Line))
- else:
- KeyValues.append([ListItem, [], [], []])
-
- return True
-
-## Get Source
-#
-# Get Source of Inf as <Filename>[|<Family>[|<TagName>[|<ToolCode>
-# [|<PcdFeatureFlag>]]]]
-#
-# @param Item: String as <Filename>[|<Family>[|<TagName>[|<ToolCode>
-# [|<PcdFeatureFlag>]]]]
-# @param ContainerFile: The file which describes the library class, used
-# for error report
-#
-def GetSource(Item, ContainerFile, FileRelativePath, LineNo=-1):
- ItemNew = Item + DataType.TAB_VALUE_SPLIT * 4
- List = GetSplitValueList(ItemNew)
- if len(List) < 5 or len(List) > 9:
- RaiseParserError(Item, 'Sources', ContainerFile, \
- '<Filename>[|<Family>[|<TagName>[|<ToolCode>\
- [|<PcdFeatureFlag>]]]]', LineNo)
- List[0] = NormPath(List[0])
- CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Sources', \
- Item, LineNo)
- if List[4] != '':
- CheckPcdTokenInfo(List[4], 'Sources', ContainerFile, LineNo)
-
- return (List[0], List[1], List[2], List[3], List[4])
-
-## Get Binary
-#
-# Get Binary of Inf as <Filename>[|<Family>[|<TagName>[|<ToolCode>
-# [|<PcdFeatureFlag>]]]]
-#
-# @param Item: String as <Filename>[|<Family>[|<TagName>
-# [|<ToolCode>[|<PcdFeatureFlag>]]]]
-# @param ContainerFile: The file which describes the library class,
-# used for error report
-#
-def GetBinary(Item, ContainerFile, LineNo=-1):
- ItemNew = Item + DataType.TAB_VALUE_SPLIT
- List = GetSplitValueList(ItemNew)
- if len(List) < 3 or len(List) > 5:
- RaiseParserError(Item, 'Binaries', ContainerFile, \
- "<FileType>|<Filename>[|<Target>\
- [|<TokenSpaceGuidCName>.<PcdCName>]]", LineNo)
-
- if len(List) >= 4:
- if List[3] != '':
- CheckPcdTokenInfo(List[3], 'Binaries', ContainerFile, LineNo)
- return (List[0], List[1], List[2], List[3])
- elif len(List) == 3:
- return (List[0], List[1], List[2], '')
-
-## Get Guids/Protocols/Ppis
-#
-# Get Guids/Protocols/Ppis of Inf as <GuidCName>[|<PcdFeatureFlag>]
-#
-# @param Item: String as <GuidCName>[|<PcdFeatureFlag>]
-# @param Type: Type of parsing string
-# @param ContainerFile: The file which describes the library class,
-# used for error report
-#
-def GetGuidsProtocolsPpisOfInf(Item):
- ItemNew = Item + DataType.TAB_VALUE_SPLIT
- List = GetSplitValueList(ItemNew)
- return (List[0], List[1])
-
-## Get Guids/Protocols/Ppis
-#
-# Get Guids/Protocols/Ppis of Dec as <GuidCName>=<GuidValue>
-#
-# @param Item: String as <GuidCName>=<GuidValue>
-# @param Type: Type of parsing string
-# @param ContainerFile: The file which describes the library class,
-# used for error report
-#
-def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerFile, LineNo=-1):
- List = GetSplitValueList(Item, DataType.TAB_EQUAL_SPLIT)
- if len(List) != 2:
- RaiseParserError(Item, Type, ContainerFile, '<CName>=<GuidValue>', \
- LineNo)
- #
- #convert C-Format Guid to Register Format
- #
- if List[1][0] == '{' and List[1][-1] == '}':
- RegisterFormatGuid = GuidStructureStringToGuidString(List[1])
- if RegisterFormatGuid == '':
- RaiseParserError(Item, Type, ContainerFile, \
- 'CFormat or RegisterFormat', LineNo)
- else:
- if CheckGuidRegFormat(List[1]):
- RegisterFormatGuid = List[1]
- else:
- RaiseParserError(Item, Type, ContainerFile, \
- 'CFormat or RegisterFormat', LineNo)
-
- return (List[0], RegisterFormatGuid)
-
-## GetPackage
-#
-# Get Package of Inf as <PackagePath>[|<PcdFeatureFlag>]
-#
-# @param Item: String as <PackagePath>[|<PcdFeatureFlag>]
-# @param Type: Type of parsing string
-# @param ContainerFile: The file which describes the library class,
-# used for error report
-#
-def GetPackage(Item, ContainerFile, FileRelativePath, LineNo=-1):
- ItemNew = Item + DataType.TAB_VALUE_SPLIT
- List = GetSplitValueList(ItemNew)
- CheckFileType(List[0], '.Dec', ContainerFile, 'package', List[0], LineNo)
- CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Packages', \
- List[0], LineNo)
- if List[1] != '':
- CheckPcdTokenInfo(List[1], 'Packages', ContainerFile, LineNo)
-
- return (List[0], List[1])
-
-## Get Pcd Values of Inf
-#
-# Get Pcd of Inf as <TokenSpaceGuidCName>.<PcdCName>[|<Value>]
-#
-# @param Item: The string describes pcd
-# @param Type: The type of Pcd
-# @param File: The file which describes the pcd, used for error report
-#
-def GetPcdOfInf(Item, Type, File, LineNo):
- Format = '<TokenSpaceGuidCName>.<PcdCName>[|<Value>]'
- TokenGuid, TokenName, Value, InfType = '', '', '', ''
-
- if Type == DataType.TAB_PCDS_FIXED_AT_BUILD:
- InfType = DataType.TAB_INF_FIXED_PCD
- elif Type == DataType.TAB_PCDS_PATCHABLE_IN_MODULE:
- InfType = DataType.TAB_INF_PATCH_PCD
- elif Type == DataType.TAB_PCDS_FEATURE_FLAG:
- InfType = DataType.TAB_INF_FEATURE_PCD
- elif Type == DataType.TAB_PCDS_DYNAMIC_EX:
- InfType = DataType.TAB_INF_PCD_EX
- elif Type == DataType.TAB_PCDS_DYNAMIC:
- InfType = DataType.TAB_INF_PCD
- List = GetSplitValueList(Item, DataType.TAB_VALUE_SPLIT, 1)
- TokenInfo = GetSplitValueList(List[0], DataType.TAB_SPLIT)
- if len(TokenInfo) != 2:
- RaiseParserError(Item, InfType, File, Format, LineNo)
- else:
- TokenGuid = TokenInfo[0]
- TokenName = TokenInfo[1]
-
- if len(List) > 1:
- Value = List[1]
- else:
- Value = None
- return (TokenGuid, TokenName, Value, InfType)
-
-
-## Get Pcd Values of Dec
-#
-# Get Pcd of Dec as <TokenSpcCName>.<TokenCName>|<Value>|<DatumType>|<Token>
-# @param Item: Pcd item
-# @param Type: Pcd type
-# @param File: Dec file
-# @param LineNo: Line number
-#
-def GetPcdOfDec(Item, Type, File, LineNo=-1):
- Format = '<TokenSpaceGuidCName>.<PcdCName>|<Value>|<DatumType>|<Token>'
- TokenGuid, TokenName, Value, DatumType, Token = '', '', '', '', ''
- List = GetSplitValueList(Item)
- if len(List) != 4:
- RaiseParserError(Item, 'Pcds' + Type, File, Format, LineNo)
- else:
- Value = List[1]
- DatumType = List[2]
- Token = List[3]
- TokenInfo = GetSplitValueList(List[0], DataType.TAB_SPLIT)
- if len(TokenInfo) != 2:
- RaiseParserError(Item, 'Pcds' + Type, File, Format, LineNo)
- else:
- TokenGuid = TokenInfo[0]
- TokenName = TokenInfo[1]
-
- return (TokenGuid, TokenName, Value, DatumType, Token, Type)
-
-## Parse DEFINE statement
-#
-# Get DEFINE macros
-#
-# @param LineValue: A DEFINE line value
-# @param StartLine: A DEFINE start line
-# @param Table: A table
-# @param FileID: File ID
-# @param Filename: File name
-# @param SectionName: DEFINE section name
-# @param SectionModel: DEFINE section model
-# @param Arch: DEFINE arch
-#
-def ParseDefine(LineValue, StartLine, Table, FileID, SectionName, \
- SectionModel, Arch):
- Logger.Debug(Logger.DEBUG_2, ST.MSG_DEFINE_STATEMENT_FOUND % (LineValue, \
- SectionName))
- Define = \
- GetSplitValueList(CleanString\
- (LineValue[LineValue.upper().\
- find(DataType.TAB_DEFINE.upper() + ' ') + \
- len(DataType.TAB_DEFINE + ' ') : ]), \
- DataType.TAB_EQUAL_SPLIT, 1)
- Table.Insert(DataType.MODEL_META_DATA_DEFINE, Define[0], Define[1], '', \
- '', '', Arch, SectionModel, FileID, StartLine, -1, \
- StartLine, -1, 0)
-
-## InsertSectionItems
-#
-# Insert item data of a section to a dict
-#
-# @param Model: A model
-# @param CurrentSection: Current section
-# @param SectionItemList: Section item list
-# @param ArchList: Arch list
-# @param ThirdList: Third list
-# @param RecordSet: Record set
-#
-def InsertSectionItems(Model, SectionItemList, ArchList, \
- ThirdList, RecordSet):
- #
- # Insert each item data of a section
- #
- for Index in range(0, len(ArchList)):
- Arch = ArchList[Index]
- Third = ThirdList[Index]
- if Arch == '':
- Arch = DataType.TAB_ARCH_COMMON
-
- Records = RecordSet[Model]
- for SectionItem in SectionItemList:
- LineValue, StartLine, Comment = SectionItem[0], \
- SectionItem[1], SectionItem[2]
-
- Logger.Debug(4, ST.MSG_PARSING %LineValue)
- #
- # And then parse DEFINE statement
- #
- if LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') > -1:
- continue
- #
- # At last parse other sections
- #
- IdNum = -1
- Records.append([LineValue, Arch, StartLine, IdNum, Third, Comment])
-
- if RecordSet != {}:
- RecordSet[Model] = Records
-
-## GenMetaDatSectionItem
-#
-# @param Key: A key
-# @param Value: A value
-# @param List: A list
-#
-def GenMetaDatSectionItem(Key, Value, List):
- if Key not in List:
- List[Key] = [Value]
- else:
- List[Key].append(Value)
-
-## GetPkgInfoFromDec
-#
-# get package name, guid, version info from dec files
-#
-# @param Path: File path
-#
-def GetPkgInfoFromDec(Path):
- PkgName = None
- PkgGuid = None
- PkgVersion = None
-
- Path = Path.replace('\\', '/')
-
- if not os.path.exists(Path):
- Logger.Error("\nUPT", FILE_NOT_FOUND, File = Path)
-
- if Path in gPKG_INFO_DICT:
- return gPKG_INFO_DICT[Path]
-
- try:
- DecParser = Dec(Path)
- PkgName = DecParser.GetPackageName()
- PkgGuid = DecParser.GetPackageGuid()
- PkgVersion = DecParser.GetPackageVersion()
- gPKG_INFO_DICT[Path] = (PkgName, PkgGuid, PkgVersion)
- return PkgName, PkgGuid, PkgVersion
- except FatalError:
- return None, None, None
-
-
-## GetWorkspacePackage
-#
-# Get a list of workspace package information.
-#
-def GetWorkspacePackage():
- DecFileList = []
- WorkspaceDir = os.environ["WORKSPACE"]
- for Root, Dirs, Files in os.walk(WorkspaceDir):
- if 'CVS' in Dirs:
- Dirs.remove('CVS')
- if '.svn' in Dirs:
- Dirs.remove('.svn')
- for Dir in Dirs:
- if Dir.startswith('.'):
- Dirs.remove(Dir)
- for FileSp in Files:
- if FileSp.startswith('.'):
- continue
- Ext = os.path.splitext(FileSp)[1]
- if Ext.lower() in ['.dec']:
- DecFileList.append\
- (os.path.normpath(os.path.join(Root, FileSp)))
- #
- # abstract package guid, version info from DecFile List
- #
- PkgList = []
- for DecFile in DecFileList:
- (PkgName, PkgGuid, PkgVersion) = GetPkgInfoFromDec(DecFile)
- if PkgName and PkgGuid and PkgVersion:
- PkgList.append((PkgName, PkgGuid, PkgVersion, DecFile))
-
- return PkgList
-
-## GetWorkspaceModule
-#
-# Get a list of workspace modules.
-#
-def GetWorkspaceModule():
- InfFileList = []
- WorkspaceDir = os.environ["WORKSPACE"]
- for Root, Dirs, Files in os.walk(WorkspaceDir):
- if 'CVS' in Dirs:
- Dirs.remove('CVS')
- if '.svn' in Dirs:
- Dirs.remove('.svn')
- if 'Build' in Dirs:
- Dirs.remove('Build')
- for Dir in Dirs:
- if Dir.startswith('.'):
- Dirs.remove(Dir)
- for FileSp in Files:
- if FileSp.startswith('.'):
- continue
- Ext = os.path.splitext(FileSp)[1]
- if Ext.lower() in ['.inf']:
- InfFileList.append\
- (os.path.normpath(os.path.join(Root, FileSp)))
-
- return InfFileList
-
-## MacroParser used to parse macro definition
-#
-# @param Line: The content contain linestring and line number
-# @param FileName: The meta-file file name
-# @param SectionType: Section for the Line belong to
-# @param FileLocalMacros: A list contain Macro defined in [Defines] section.
-#
-def MacroParser(Line, FileName, SectionType, FileLocalMacros):
- MacroDefPattern = re.compile("^(DEFINE)[ \t]+")
- LineContent = Line[0]
- LineNo = Line[1]
- Match = MacroDefPattern.match(LineContent)
- if not Match:
- #
- # Not 'DEFINE/EDK_GLOBAL' statement, call decorated method
- #
- return None, None
-
- TokenList = GetSplitValueList(LineContent[Match.end(1):], \
- DataType.TAB_EQUAL_SPLIT, 1)
- #
- # Syntax check
- #
- if not TokenList[0]:
- Logger.Error('Parser', FORMAT_INVALID, ST.ERR_MACRONAME_NOGIVEN,
- ExtraData=LineContent, File=FileName, Line=LineNo)
- if len(TokenList) < 2:
- Logger.Error('Parser', FORMAT_INVALID, ST.ERR_MACROVALUE_NOGIVEN,
- ExtraData=LineContent, File=FileName, Line=LineNo)
-
- Name, Value = TokenList
-
- #
- # DEFINE defined macros
- #
- if SectionType == DataType.MODEL_META_DATA_HEADER:
- FileLocalMacros[Name] = Value
-
- ReIsValidMacroName = re.compile(r"^[A-Z][A-Z0-9_]*$", re.DOTALL)
- if ReIsValidMacroName.match(Name) == None:
- Logger.Error('Parser',
- FORMAT_INVALID,
- ST.ERR_MACRONAME_INVALID%(Name),
- ExtraData=LineContent,
- File=FileName,
- Line=LineNo)
-
- # Validate MACRO Value
- #
- # <MacroDefinition> ::= [<Comments>]{0,}
- # "DEFINE" <MACRO> "=" [{<PATH>} {<VALUE>}] <EOL>
- # <Value> ::= {<NumVal>} {<Boolean>} {<AsciiString>} {<GUID>}
- # {<CString>} {<UnicodeString>} {<CArray>}
- #
- # The definition of <NumVal>, <PATH>, <Boolean>, <GUID>, <CString>,
- # <UnicodeString>, <CArray> are subset of <AsciiString>.
- #
- ReIsValidMacroValue = re.compile(r"^[\x20-\x7e]*$", re.DOTALL)
- if ReIsValidMacroValue.match(Value) == None:
- Logger.Error('Parser',
- FORMAT_INVALID,
- ST.ERR_MACROVALUE_INVALID%(Value),
- ExtraData=LineContent,
- File=FileName,
- Line=LineNo)
-
- return Name, Value
-
-## GenSection
-#
-# generate section contents
-#
-# @param SectionName: indicate the name of the section, details refer to
-# INF, DEC specs
-# @param SectionDict: section statement dict, key is SectionAttrs(arch,
-# moduletype or platform may exist as needed) list
-# seperated by space,
-# value is statement
-#
-def GenSection(SectionName, SectionDict, SplitArch=True):
- Content = ''
- for SectionAttrs in SectionDict:
- StatementList = SectionDict[SectionAttrs]
- if SectionAttrs and SectionName != 'Defines' and SectionAttrs.strip().upper() != DataType.TAB_ARCH_COMMON:
- if SplitArch:
- ArchList = GetSplitValueList(SectionAttrs, DataType.TAB_SPACE_SPLIT)
- else:
- if SectionName != 'UserExtensions':
- ArchList = GetSplitValueList(SectionAttrs, DataType.TAB_COMMENT_SPLIT)
- else:
- ArchList = [SectionAttrs]
- for Index in xrange(0, len(ArchList)):
- ArchList[Index] = ConvertArchForInstall(ArchList[Index])
- Section = '[' + SectionName + '.' + (', ' + SectionName + '.').join(ArchList) + ']'
- else:
- Section = '[' + SectionName + ']'
- Content += '\n\n' + Section + '\n'
- if StatementList != None:
- for Statement in StatementList:
- Content += Statement + '\n'
-
- return Content
-
-## ConvertArchForInstall
-# if Arch.upper() is in "IA32", "X64", "IPF", and "EBC", it must be upper case. "common" must be lower case.
-# Anything else, the case must be preserved
-#
-# @param Arch: the arch string that need to be converted, it should be stripped before pass in
-# @return: the arch string that get converted
-#
-def ConvertArchForInstall(Arch):
- if Arch.upper() in [DataType.TAB_ARCH_IA32, DataType.TAB_ARCH_X64,
- DataType.TAB_ARCH_IPF, DataType.TAB_ARCH_EBC]:
- Arch = Arch.upper()
- elif Arch.upper() == DataType.TAB_ARCH_COMMON:
- Arch = Arch.lower()
-
- return Arch
diff --git a/BaseTools/Source/Python/UPT/Library/String.py b/BaseTools/Source/Python/UPT/Library/String.py
deleted file mode 100644
index 0953e47cb1..0000000000
--- a/BaseTools/Source/Python/UPT/Library/String.py
+++ /dev/null
@@ -1,939 +0,0 @@
-## @file
-# This file is used to define common string related functions used in parsing
-# process
-#
-# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-'''
-String
-'''
-##
-# Import Modules
-#
-import re
-import os.path
-from string import strip
-import Logger.Log as Logger
-import Library.DataType as DataType
-from Logger.ToolError import FORMAT_INVALID
-from Logger.ToolError import PARSER_ERROR
-from Logger import StringTable as ST
-
-#
-# Regular expression for matching macro used in DSC/DEC/INF file inclusion
-#
-gMACRO_PATTERN = re.compile("\$\(([_A-Z][_A-Z0-9]*)\)", re.UNICODE)
-
-## GetSplitValueList
-#
-# Get a value list from a string with multiple values splited with SplitTag
-# The default SplitTag is DataType.TAB_VALUE_SPLIT
-# 'AAA|BBB|CCC' -> ['AAA', 'BBB', 'CCC']
-#
-# @param String: The input string to be splitted
-# @param SplitTag: The split key, default is DataType.TAB_VALUE_SPLIT
-# @param MaxSplit: The max number of split values, default is -1
-#
-#
-def GetSplitValueList(String, SplitTag=DataType.TAB_VALUE_SPLIT, MaxSplit=-1):
- return map(lambda l: l.strip(), String.split(SplitTag, MaxSplit))
-
-## MergeArches
-#
-# Find a key's all arches in dict, add the new arch to the list
-# If not exist any arch, set the arch directly
-#
-# @param Dict: The input value for Dict
-# @param Key: The input value for Key
-# @param Arch: The Arch to be added or merged
-#
-def MergeArches(Dict, Key, Arch):
- if Key in Dict.keys():
- Dict[Key].append(Arch)
- else:
- Dict[Key] = Arch.split()
-
-## GenDefines
-#
-# Parse a string with format "DEFINE <VarName> = <PATH>"
-# Generate a map Defines[VarName] = PATH
-# Return False if invalid format
-#
-# @param String: String with DEFINE statement
-# @param Arch: Supportted Arch
-# @param Defines: DEFINE statement to be parsed
-#
-def GenDefines(String, Arch, Defines):
- if String.find(DataType.TAB_DEFINE + ' ') > -1:
- List = String.replace(DataType.TAB_DEFINE + ' ', '').\
- split(DataType.TAB_EQUAL_SPLIT)
- if len(List) == 2:
- Defines[(CleanString(List[0]), Arch)] = CleanString(List[1])
- return 0
- else:
- return -1
- return 1
-
-## GetLibraryClassesWithModuleType
-#
-# Get Library Class definition when no module type defined
-#
-# @param Lines: The content to be parsed
-# @param Key: Reserved
-# @param KeyValues: To store data after parsing
-# @param CommentCharacter: Comment char, used to ignore comment content
-#
-def GetLibraryClassesWithModuleType(Lines, Key, KeyValues, CommentCharacter):
- NewKey = SplitModuleType(Key)
- Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
- LineList = Lines.splitlines()
- for Line in LineList:
- Line = CleanString(Line, CommentCharacter)
- if Line != '' and Line[0] != CommentCharacter:
- KeyValues.append([CleanString(Line, CommentCharacter), NewKey[1]])
-
- return True
-
-## GetDynamics
-#
-# Get Dynamic Pcds
-#
-# @param Lines: The content to be parsed
-# @param Key: Reserved
-# @param KeyValues: To store data after parsing
-# @param CommentCharacter: Comment char, used to ignore comment content
-#
-def GetDynamics(Lines, Key, KeyValues, CommentCharacter):
- #
- # Get SkuId Name List
- #
- SkuIdNameList = SplitModuleType(Key)
-
- Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
- LineList = Lines.splitlines()
- for Line in LineList:
- Line = CleanString(Line, CommentCharacter)
- if Line != '' and Line[0] != CommentCharacter:
- KeyValues.append([CleanString(Line, CommentCharacter), SkuIdNameList[1]])
-
- return True
-
-## SplitModuleType
-#
-# Split ModuleType out of section defien to get key
-# [LibraryClass.Arch.ModuleType|ModuleType|ModuleType] -> [
-# 'LibraryClass.Arch', ['ModuleType', 'ModuleType', 'ModuleType'] ]
-#
-# @param Key: String to be parsed
-#
-def SplitModuleType(Key):
- KeyList = Key.split(DataType.TAB_SPLIT)
- #
- # Fill in for arch
- #
- KeyList.append('')
- #
- # Fill in for moduletype
- #
- KeyList.append('')
- ReturnValue = []
- KeyValue = KeyList[0]
- if KeyList[1] != '':
- KeyValue = KeyValue + DataType.TAB_SPLIT + KeyList[1]
- ReturnValue.append(KeyValue)
- ReturnValue.append(GetSplitValueList(KeyList[2]))
-
- return ReturnValue
-
-## Replace macro in string
-#
-# This method replace macros used in given string. The macros are given in a
-# dictionary.
-#
-# @param String String to be processed
-# @param MacroDefinitions The macro definitions in the form of dictionary
-# @param SelfReplacement To decide whether replace un-defined macro to ''
-# @param Line: The content contain line string and line number
-# @param FileName: The meta-file file name
-#
-def ReplaceMacro(String, MacroDefinitions = None, SelfReplacement = False, Line = None, FileName = None, Flag = False):
- LastString = String
- if MacroDefinitions == None:
- MacroDefinitions = {}
- while MacroDefinitions:
- QuotedStringList = []
- HaveQuotedMacroFlag = False
- if not Flag:
- MacroUsed = gMACRO_PATTERN.findall(String)
- else:
- ReQuotedString = re.compile('\"')
- QuotedStringList = ReQuotedString.split(String)
- if len(QuotedStringList) >= 3:
- HaveQuotedMacroFlag = True
- Count = 0
- MacroString = ""
- for QuotedStringItem in QuotedStringList:
- Count += 1
- if Count % 2 != 0:
- MacroString += QuotedStringItem
-
- if Count == len(QuotedStringList) and Count%2 == 0:
- MacroString += QuotedStringItem
-
- MacroUsed = gMACRO_PATTERN.findall(MacroString)
- #
- # no macro found in String, stop replacing
- #
- if len(MacroUsed) == 0:
- break
- for Macro in MacroUsed:
- if Macro not in MacroDefinitions:
- if SelfReplacement:
- String = String.replace("$(%s)" % Macro, '')
- Logger.Debug(5, "Delete undefined MACROs in file %s line %d: %s!" %(FileName, Line[1], Line[0]))
- continue
- if not HaveQuotedMacroFlag:
- String = String.replace("$(%s)" % Macro, MacroDefinitions[Macro])
- else:
- Count = 0
- for QuotedStringItem in QuotedStringList:
- Count += 1
- if Count % 2 != 0:
- QuotedStringList[Count-1] = QuotedStringList[Count-1].replace("$(%s)" % Macro,
- MacroDefinitions[Macro])
- elif Count == len(QuotedStringList) and Count%2 == 0:
- QuotedStringList[Count-1] = QuotedStringList[Count-1].replace("$(%s)" % Macro,
- MacroDefinitions[Macro])
-
- RetString = ''
- if HaveQuotedMacroFlag:
- Count = 0
- for QuotedStringItem in QuotedStringList:
- Count += 1
- if Count != len(QuotedStringList):
- RetString += QuotedStringList[Count-1] + "\""
- else:
- RetString += QuotedStringList[Count-1]
-
- String = RetString
-
- #
- # in case there's macro not defined
- #
- if String == LastString:
- break
- LastString = String
-
- return String
-
-## NormPath
-#
-# Create a normal path
-# And replace DFEINE in the path
-#
-# @param Path: The input value for Path to be converted
-# @param Defines: A set for DEFINE statement
-#
-def NormPath(Path, Defines = None):
- IsRelativePath = False
- if Defines == None:
- Defines = {}
- if Path:
- if Path[0] == '.':
- IsRelativePath = True
- #
- # Replace with Define
- #
- if Defines:
- Path = ReplaceMacro(Path, Defines)
- #
- # To local path format
- #
- Path = os.path.normpath(Path)
-
- if IsRelativePath and Path[0] != '.':
- Path = os.path.join('.', Path)
- return Path
-
-## CleanString
-#
-# Remove comments in a string
-# Remove spaces
-#
-# @param Line: The string to be cleaned
-# @param CommentCharacter: Comment char, used to ignore comment content,
-# default is DataType.TAB_COMMENT_SPLIT
-#
-def CleanString(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyleComment=False):
- #
- # remove whitespace
- #
- Line = Line.strip()
- #
- # Replace EDK1's comment character
- #
- if AllowCppStyleComment:
- Line = Line.replace(DataType.TAB_COMMENT_EDK1_SPLIT, CommentCharacter)
- #
- # remove comments, but we should escape comment character in string
- #
- InString = False
- for Index in range(0, len(Line)):
- if Line[Index] == '"':
- InString = not InString
- elif Line[Index] == CommentCharacter and not InString:
- Line = Line[0: Index]
- break
- #
- # remove whitespace again
- #
- Line = Line.strip()
-
- return Line
-
-## CleanString2
-#
-# Split comments in a string
-# Remove spaces
-#
-# @param Line: The string to be cleaned
-# @param CommentCharacter: Comment char, used to ignore comment content,
-# default is DataType.TAB_COMMENT_SPLIT
-#
-def CleanString2(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyleComment=False):
- #
- # remove whitespace
- #
- Line = Line.strip()
- #
- # Replace EDK1's comment character
- #
- if AllowCppStyleComment:
- Line = Line.replace(DataType.TAB_COMMENT_EDK1_SPLIT, CommentCharacter)
- #
- # separate comments and statements
- #
- LineParts = Line.split(CommentCharacter, 1)
- #
- # remove whitespace again
- #
- Line = LineParts[0].strip()
- if len(LineParts) > 1:
- Comment = LineParts[1].strip()
- #
- # Remove prefixed and trailing comment characters
- #
- Start = 0
- End = len(Comment)
- while Start < End and Comment.startswith(CommentCharacter, Start, End):
- Start += 1
- while End >= 0 and Comment.endswith(CommentCharacter, Start, End):
- End -= 1
- Comment = Comment[Start:End]
- Comment = Comment.strip()
- else:
- Comment = ''
-
- return Line, Comment
-
-## GetMultipleValuesOfKeyFromLines
-#
-# Parse multiple strings to clean comment and spaces
-# The result is saved to KeyValues
-#
-# @param Lines: The content to be parsed
-# @param Key: Reserved
-# @param KeyValues: To store data after parsing
-# @param CommentCharacter: Comment char, used to ignore comment content
-#
-def GetMultipleValuesOfKeyFromLines(Lines, Key, KeyValues, CommentCharacter):
- if Key:
- pass
- if KeyValues:
- pass
- Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
- LineList = Lines.split('\n')
- for Line in LineList:
- Line = CleanString(Line, CommentCharacter)
- if Line != '' and Line[0] != CommentCharacter:
- KeyValues += [Line]
- return True
-
-## GetDefineValue
-#
-# Parse a DEFINE statement to get defined value
-# DEFINE Key Value
-#
-# @param String: The content to be parsed
-# @param Key: The key of DEFINE statement
-# @param CommentCharacter: Comment char, used to ignore comment content
-#
-def GetDefineValue(String, Key, CommentCharacter):
- if CommentCharacter:
- pass
- String = CleanString(String)
- return String[String.find(Key + ' ') + len(Key + ' ') : ]
-
-## GetSingleValueOfKeyFromLines
-#
-# Parse multiple strings as below to get value of each definition line
-# Key1 = Value1
-# Key2 = Value2
-# The result is saved to Dictionary
-#
-# @param Lines: The content to be parsed
-# @param Dictionary: To store data after parsing
-# @param CommentCharacter: Comment char, be used to ignore comment content
-# @param KeySplitCharacter: Key split char, between key name and key value.
-# Key1 = Value1, '=' is the key split char
-# @param ValueSplitFlag: Value split flag, be used to decide if has
-# multiple values
-# @param ValueSplitCharacter: Value split char, be used to split multiple
-# values. Key1 = Value1|Value2, '|' is the value
-# split char
-#
-def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCharacter, \
- ValueSplitFlag, ValueSplitCharacter):
- Lines = Lines.split('\n')
- Keys = []
- Value = ''
- DefineValues = ['']
- SpecValues = ['']
-
- for Line in Lines:
- #
- # Handle DEFINE and SPEC
- #
- if Line.find(DataType.TAB_INF_DEFINES_DEFINE + ' ') > -1:
- if '' in DefineValues:
- DefineValues.remove('')
- DefineValues.append(GetDefineValue(Line, DataType.TAB_INF_DEFINES_DEFINE, CommentCharacter))
- continue
- if Line.find(DataType.TAB_INF_DEFINES_SPEC + ' ') > -1:
- if '' in SpecValues:
- SpecValues.remove('')
- SpecValues.append(GetDefineValue(Line, DataType.TAB_INF_DEFINES_SPEC, CommentCharacter))
- continue
-
- #
- # Handle Others
- #
- LineList = Line.split(KeySplitCharacter, 1)
- if len(LineList) >= 2:
- Key = LineList[0].split()
- if len(Key) == 1 and Key[0][0] != CommentCharacter:
- #
- # Remove comments and white spaces
- #
- LineList[1] = CleanString(LineList[1], CommentCharacter)
- if ValueSplitFlag:
- Value = map(strip, LineList[1].split(ValueSplitCharacter))
- else:
- Value = CleanString(LineList[1], CommentCharacter).splitlines()
-
- if Key[0] in Dictionary:
- if Key[0] not in Keys:
- Dictionary[Key[0]] = Value
- Keys.append(Key[0])
- else:
- Dictionary[Key[0]].extend(Value)
- else:
- Dictionary[DataType.TAB_INF_DEFINES_MACRO][Key[0]] = Value[0]
-
- if DefineValues == []:
- DefineValues = ['']
- if SpecValues == []:
- SpecValues = ['']
- Dictionary[DataType.TAB_INF_DEFINES_DEFINE] = DefineValues
- Dictionary[DataType.TAB_INF_DEFINES_SPEC] = SpecValues
-
- return True
-
-## The content to be parsed
-#
-# Do pre-check for a file before it is parsed
-# Check $()
-# Check []
-#
-# @param FileName: Used for error report
-# @param FileContent: File content to be parsed
-# @param SupSectionTag: Used for error report
-#
-def PreCheck(FileName, FileContent, SupSectionTag):
- if SupSectionTag:
- pass
- LineNo = 0
- IsFailed = False
- NewFileContent = ''
- for Line in FileContent.splitlines():
- LineNo = LineNo + 1
- #
- # Clean current line
- #
- Line = CleanString(Line)
- #
- # Remove commented line
- #
- if Line.find(DataType.TAB_COMMA_SPLIT) == 0:
- Line = ''
- #
- # Check $()
- #
- if Line.find('$') > -1:
- if Line.find('$(') < 0 or Line.find(')') < 0:
- Logger.Error("Parser", FORMAT_INVALID, Line=LineNo, File=FileName, RaiseError = Logger.IS_RAISE_ERROR)
- #
- # Check []
- #
- if Line.find('[') > -1 or Line.find(']') > -1:
- #
- # Only get one '[' or one ']'
- #
- if not (Line.find('[') > -1 and Line.find(']') > -1):
- Logger.Error("Parser", FORMAT_INVALID, Line=LineNo, File=FileName, RaiseError = Logger.IS_RAISE_ERROR)
- #
- # Regenerate FileContent
- #
- NewFileContent = NewFileContent + Line + '\r\n'
-
- if IsFailed:
- Logger.Error("Parser", FORMAT_INVALID, Line=LineNo, File=FileName, RaiseError = Logger.IS_RAISE_ERROR)
-
- return NewFileContent
-
-## CheckFileType
-#
-# Check if the Filename is including ExtName
-# Return True if it exists
-# Raise a error message if it not exists
-#
-# @param CheckFilename: Name of the file to be checked
-# @param ExtName: Ext name of the file to be checked
-# @param ContainerFilename: The container file which describes the file to be
-# checked, used for error report
-# @param SectionName: Used for error report
-# @param Line: The line in container file which defines the file
-# to be checked
-#
-def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, Line, LineNo=-1):
- if CheckFilename != '' and CheckFilename != None:
- (Root, Ext) = os.path.splitext(CheckFilename)
- if Ext.upper() != ExtName.upper() and Root:
- ContainerFile = open(ContainerFilename, 'r').read()
- if LineNo == -1:
- LineNo = GetLineNo(ContainerFile, Line)
- ErrorMsg = ST.ERR_SECTIONNAME_INVALID % (SectionName, CheckFilename, ExtName)
- Logger.Error("Parser", PARSER_ERROR, ErrorMsg, Line=LineNo, \
- File=ContainerFilename, RaiseError=Logger.IS_RAISE_ERROR)
-
- return True
-
-## CheckFileExist
-#
-# Check if the file exists
-# Return True if it exists
-# Raise a error message if it not exists
-#
-# @param CheckFilename: Name of the file to be checked
-# @param WorkspaceDir: Current workspace dir
-# @param ContainerFilename: The container file which describes the file to
-# be checked, used for error report
-# @param SectionName: Used for error report
-# @param Line: The line in container file which defines the
-# file to be checked
-#
-def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, SectionName, Line, LineNo=-1):
- CheckFile = ''
- if CheckFilename != '' and CheckFilename != None:
- CheckFile = WorkspaceFile(WorkspaceDir, CheckFilename)
- if not os.path.isfile(CheckFile):
- ContainerFile = open(ContainerFilename, 'r').read()
- if LineNo == -1:
- LineNo = GetLineNo(ContainerFile, Line)
- ErrorMsg = ST.ERR_CHECKFILE_NOTFOUND % (CheckFile, SectionName)
- Logger.Error("Parser", PARSER_ERROR, ErrorMsg,
- File=ContainerFilename, Line = LineNo, RaiseError=Logger.IS_RAISE_ERROR)
- return CheckFile
-
-## GetLineNo
-#
-# Find the index of a line in a file
-#
-# @param FileContent: Search scope
-# @param Line: Search key
-#
-def GetLineNo(FileContent, Line, IsIgnoreComment=True):
- LineList = FileContent.splitlines()
- for Index in range(len(LineList)):
- if LineList[Index].find(Line) > -1:
- #
- # Ignore statement in comment
- #
- if IsIgnoreComment:
- if LineList[Index].strip()[0] == DataType.TAB_COMMENT_SPLIT:
- continue
- return Index + 1
-
- return -1
-
-## RaiseParserError
-#
-# Raise a parser error
-#
-# @param Line: String which has error
-# @param Section: Used for error report
-# @param File: File which has the string
-# @param Format: Correct format
-#
-def RaiseParserError(Line, Section, File, Format='', LineNo=-1):
- if LineNo == -1:
- LineNo = GetLineNo(open(os.path.normpath(File), 'r').read(), Line)
- ErrorMsg = ST.ERR_INVALID_NOTFOUND % (Line, Section)
- if Format != '':
- Format = "Correct format is " + Format
- Logger.Error("Parser", PARSER_ERROR, ErrorMsg, File=File, Line=LineNo, \
- ExtraData=Format, RaiseError=Logger.IS_RAISE_ERROR)
-
-## WorkspaceFile
-#
-# Return a full path with workspace dir
-#
-# @param WorkspaceDir: Workspace dir
-# @param Filename: Relative file name
-#
-def WorkspaceFile(WorkspaceDir, Filename):
- return os.path.join(NormPath(WorkspaceDir), NormPath(Filename))
-
-## Split string
-#
-# Revmove '"' which startswith and endswith string
-#
-# @param String: The string need to be splited
-#
-def SplitString(String):
- if String.startswith('\"'):
- String = String[1:]
- if String.endswith('\"'):
- String = String[:-1]
- return String
-
-## Convert To Sql String
-#
-# Replace "'" with "''" in each item of StringList
-#
-# @param StringList: A list for strings to be converted
-#
-def ConvertToSqlString(StringList):
- return map(lambda s: s.replace("'", "''") , StringList)
-
-## Convert To Sql String
-#
-# Replace "'" with "''" in the String
-#
-# @param String: A String to be converted
-#
-def ConvertToSqlString2(String):
- return String.replace("'", "''")
-
-## GetStringOfList
-#
-# Get String of a List
-#
-# @param Lines: string list
-# @param Split: split character
-#
-def GetStringOfList(List, Split = ' '):
- if type(List) != type([]):
- return List
- Str = ''
- for Item in List:
- Str = Str + Item + Split
- return Str.strip()
-
-## Get HelpTextList
-#
-# Get HelpTextList from HelpTextClassList
-#
-# @param HelpTextClassList: Help Text Class List
-#
-def GetHelpTextList(HelpTextClassList):
- List = []
- if HelpTextClassList:
- for HelpText in HelpTextClassList:
- if HelpText.String.endswith('\n'):
- HelpText.String = HelpText.String[0: len(HelpText.String) - len('\n')]
- List.extend(HelpText.String.split('\n'))
- return List
-
-## Get String Array Length
-#
-# Get String Array Length
-#
-# @param String: the source string
-#
-def StringArrayLength(String):
- if isinstance(String, unicode):
- return (len(String) + 1) * 2 + 1
- elif String.startswith('L"'):
- return (len(String) - 3 + 1) * 2
- elif String.startswith('"'):
- return (len(String) - 2 + 1)
- else:
- return len(String.split()) + 1
-
-## RemoveDupOption
-#
-# Remove Dup Option
-#
-# @param OptionString: the option string
-# @param Which: Which flag
-# @param Against: Against flag
-#
-def RemoveDupOption(OptionString, Which="/I", Against=None):
- OptionList = OptionString.split()
- ValueList = []
- if Against:
- ValueList += Against
- for Index in range(len(OptionList)):
- Opt = OptionList[Index]
- if not Opt.startswith(Which):
- continue
- if len(Opt) > len(Which):
- Val = Opt[len(Which):]
- else:
- Val = ""
- if Val in ValueList:
- OptionList[Index] = ""
- else:
- ValueList.append(Val)
- return " ".join(OptionList)
-
-## Check if the string is HexDgit
-#
-# Return true if all characters in the string are digits and there is at
-# least one character
-# or valid Hexs (started with 0x, following by hexdigit letters)
-# , false otherwise.
-# @param string: input string
-#
-def IsHexDigit(Str):
- try:
- int(Str, 10)
- return True
- except ValueError:
- if len(Str) > 2 and Str.upper().startswith('0X'):
- try:
- int(Str, 16)
- return True
- except ValueError:
- return False
- return False
-
-## Check if the string is HexDgit and its integer value within limit of UINT32
-#
-# Return true if all characters in the string are digits and there is at
-# least one character
-# or valid Hexs (started with 0x, following by hexdigit letters)
-# , false otherwise.
-# @param string: input string
-#
-def IsHexDigitUINT32(Str):
- try:
- Value = int(Str, 10)
- if (Value <= 0xFFFFFFFF) and (Value >= 0):
- return True
- except ValueError:
- if len(Str) > 2 and Str.upper().startswith('0X'):
- try:
- Value = int(Str, 16)
- if (Value <= 0xFFFFFFFF) and (Value >= 0):
- return True
- except ValueError:
- return False
- return False
-
-## CleanSpecialChar
-#
-# The ASCII text files of type INF, DEC, INI are edited by developers,
-# and may contain characters that cannot be directly translated to strings that
-# are conformant with the UDP XML Schema. Any characters in this category
-# (0x00-0x08, TAB [0x09], 0x0B, 0x0C, 0x0E-0x1F, 0x80-0xFF)
-# must be converted to a space character[0x20] as part of the parsing process.
-#
-def ConvertSpecialChar(Lines):
- RetLines = []
- for line in Lines:
- ReMatchSpecialChar = re.compile(r"[\x00-\x08]|\x09|\x0b|\x0c|[\x0e-\x1f]|[\x7f-\xff]")
- RetLines.append(ReMatchSpecialChar.sub(' ', line))
-
- return RetLines
-
-## __GetTokenList
-#
-# Assume Str is a valid feature flag expression.
-# Return a list which contains tokens: alpha numeric token and other token
-# Whitespace are not stripped
-#
-def __GetTokenList(Str):
- InQuote = False
- Token = ''
- TokenOP = ''
- PreChar = ''
- List = []
- for Char in Str:
- if InQuote:
- Token += Char
- if Char == '"' and PreChar != '\\':
- InQuote = not InQuote
- List.append(Token)
- Token = ''
- continue
- if Char == '"':
- if Token and Token != 'L':
- List.append(Token)
- Token = ''
- if TokenOP:
- List.append(TokenOP)
- TokenOP = ''
- InQuote = not InQuote
- Token += Char
- continue
-
- if not (Char.isalnum() or Char in '_'):
- TokenOP += Char
- if Token:
- List.append(Token)
- Token = ''
- else:
- Token += Char
- if TokenOP:
- List.append(TokenOP)
- TokenOP = ''
-
- if PreChar == '\\' and Char == '\\':
- PreChar = ''
- else:
- PreChar = Char
- if Token:
- List.append(Token)
- if TokenOP:
- List.append(TokenOP)
- return List
-
-## ConvertNEToNOTEQ
-#
-# Convert NE operator to NOT EQ
-# For example: 1 NE 2 -> 1 NOT EQ 2
-#
-# @param Expr: Feature flag expression to be converted
-#
-def ConvertNEToNOTEQ(Expr):
- List = __GetTokenList(Expr)
- for Index in range(len(List)):
- if List[Index] == 'NE':
- List[Index] = 'NOT EQ'
- return ''.join(List)
-
-## ConvertNOTEQToNE
-#
-# Convert NOT EQ operator to NE
-# For example: 1 NOT NE 2 -> 1 NE 2
-#
-# @param Expr: Feature flag expression to be converted
-#
-def ConvertNOTEQToNE(Expr):
- List = __GetTokenList(Expr)
- HasNOT = False
- RetList = []
- for Token in List:
- if HasNOT and Token == 'EQ':
- # At least, 'NOT' is in the list
- while not RetList[-1].strip():
- RetList.pop()
- RetList[-1] = 'NE'
- HasNOT = False
- continue
- if Token == 'NOT':
- HasNOT = True
- elif Token.strip():
- HasNOT = False
- RetList.append(Token)
-
- return ''.join(RetList)
-
-## SplitPcdEntry
-#
-# Split an PCD entry string to Token.CName and PCD value and FFE.
-# NOTE: PCD Value and FFE can contain "|" in it's expression. And in INF specification, have below rule.
-# When using the characters "|" or "||" in an expression, the expression must be encapsulated in
-# open "(" and close ")" parenthesis.
-#
-# @param String An PCD entry string need to be split.
-#
-# @return List [PcdTokenCName, Value, FFE]
-#
-def SplitPcdEntry(String):
- if not String:
- return ['', '',''], False
-
- PcdTokenCName = ''
- PcdValue = ''
- PcdFeatureFlagExp = ''
-
- ValueList = GetSplitValueList(String, "|", 1)
-
- #
- # Only contain TokenCName
- #
- if len(ValueList) == 1:
- return [ValueList[0]], True
-
- NewValueList = []
-
- if len(ValueList) == 2:
- PcdTokenCName = ValueList[0]
- ValueList = GetSplitValueList(ValueList[1], "|")
-
- RemainCount = 0
- for Item in ValueList:
- ParenthesisCount = 0
- for Char in Item:
- if Char == "(":
- ParenthesisCount += 1
- if Char == ")":
- ParenthesisCount -= 1
-
- #
- # An individual item
- #
- if RemainCount == 0 and ParenthesisCount >= 0:
- NewValueList.append(Item)
- RemainCount = ParenthesisCount
- elif RemainCount > 0 and RemainCount + ParenthesisCount >= 0:
- NewValueList[-1] = NewValueList[-1] + '|' + Item
- RemainCount = RemainCount + ParenthesisCount
- elif RemainCount > 0 and RemainCount + ParenthesisCount < 0:
- #
- # ERROR, return
- #
- return ['', '', ''], False
-
- if len(NewValueList) == 1:
- PcdValue = NewValueList[0]
- return [PcdTokenCName, PcdValue], True
- elif len(NewValueList) == 2:
- PcdValue = NewValueList[0]
- PcdFeatureFlagExp = NewValueList[1]
- return [PcdTokenCName, PcdValue, PcdFeatureFlagExp], True
- else:
- return ['', '', ''], False
-
- return ['', '', ''], False
diff --git a/BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py b/BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py
deleted file mode 100644
index 7029e59889..0000000000
--- a/BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py
+++ /dev/null
@@ -1,228 +0,0 @@
-## @file
-# This is an XML API that uses a syntax similar to XPath, but it is written in
-# standard python so that no extra python packages are required to use it.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-XmlRoutines
-'''
-
-##
-# Import Modules
-#
-import xml.dom.minidom
-import re
-from Logger.ToolError import PARSER_ERROR
-import Logger.Log as Logger
-
-## Create a element of XML
-#
-# @param Name
-# @param String
-# @param NodeList
-# @param AttributeList
-#
-def CreateXmlElement(Name, String, NodeList, AttributeList):
- Doc = xml.dom.minidom.Document()
- Element = Doc.createElement(Name)
- if String != '' and String != None:
- Element.appendChild(Doc.createTextNode(String))
-
- for Item in NodeList:
- if type(Item) == type([]):
- Key = Item[0]
- Value = Item[1]
- if Key != '' and Key != None and Value != '' and Value != None:
- Node = Doc.createElement(Key)
- Node.appendChild(Doc.createTextNode(Value))
- Element.appendChild(Node)
- else:
- Element.appendChild(Item)
- for Item in AttributeList:
- Key = Item[0]
- Value = Item[1]
- if Key != '' and Key != None and Value != '' and Value != None:
- Element.setAttribute(Key, Value)
-
- return Element
-
-## Get a list of XML nodes using XPath style syntax.
-#
-# Return a list of XML DOM nodes from the root Dom specified by XPath String.
-# If the input Dom or String is not valid, then an empty list is returned.
-#
-# @param Dom The root XML DOM node.
-# @param String A XPath style path.
-#
-def XmlList(Dom, String):
- if String == None or String == "" or Dom == None or Dom == "":
- return []
- if Dom.nodeType == Dom.DOCUMENT_NODE:
- Dom = Dom.documentElement
- if String[0] == "/":
- String = String[1:]
- TagList = String.split('/')
- Nodes = [Dom]
- Index = 0
- End = len(TagList) - 1
- while Index <= End:
- ChildNodes = []
- for Node in Nodes:
- if Node.nodeType == Node.ELEMENT_NODE and Node.tagName == \
- TagList[Index]:
- if Index < End:
- ChildNodes.extend(Node.childNodes)
- else:
- ChildNodes.append(Node)
- Nodes = ChildNodes
- ChildNodes = []
- Index += 1
-
- return Nodes
-
-
-## Get a single XML node using XPath style syntax.
-#
-# Return a single XML DOM node from the root Dom specified by XPath String.
-# If the input Dom or String is not valid, then an empty string is returned.
-#
-# @param Dom The root XML DOM node.
-# @param String A XPath style path.
-#
-def XmlNode(Dom, String):
- if String == None or String == "" or Dom == None or Dom == "":
- return None
- if Dom.nodeType == Dom.DOCUMENT_NODE:
- Dom = Dom.documentElement
- if String[0] == "/":
- String = String[1:]
- TagList = String.split('/')
- Index = 0
- End = len(TagList) - 1
- ChildNodes = [Dom]
- while Index <= End:
- for Node in ChildNodes:
- if Node.nodeType == Node.ELEMENT_NODE and \
- Node.tagName == TagList[Index]:
- if Index < End:
- ChildNodes = Node.childNodes
- else:
- return Node
- break
- Index += 1
- return None
-
-
-## Get a single XML element using XPath style syntax.
-#
-# Return a single XML element from the root Dom specified by XPath String.
-# If the input Dom or String is not valid, then an empty string is returned.
-#
-# @param Dom The root XML DOM object.
-# @param Strin A XPath style path.
-#
-def XmlElement(Dom, String):
- try:
- return XmlNode(Dom, String).firstChild.data.strip()
- except BaseException:
- return ""
-
-## Get a single XML element using XPath style syntax.
-#
-# Similar with XmlElement, but do not strip all the leading and tailing space
-# and newline, instead just remove the newline and spaces introduced by
-# toprettyxml()
-#
-# @param Dom The root XML DOM object.
-# @param Strin A XPath style path.
-#
-def XmlElement2(Dom, String):
- try:
- HelpStr = XmlNode(Dom, String).firstChild.data
- gRemovePrettyRe = re.compile(r"""(?:(\n *) )(.*)\1""", re.DOTALL)
- HelpStr = re.sub(gRemovePrettyRe, r"\2", HelpStr)
- return HelpStr
- except BaseException:
- return ""
-
-
-## Get a single XML element of the current node.
-#
-# Return a single XML element specified by the current root Dom.
-# If the input Dom is not valid, then an empty string is returned.
-#
-# @param Dom The root XML DOM object.
-#
-def XmlElementData(Dom):
- try:
- return Dom.firstChild.data.strip()
- except BaseException:
- return ""
-
-
-## Get a list of XML elements using XPath style syntax.
-#
-# Return a list of XML elements from the root Dom specified by XPath String.
-# If the input Dom or String is not valid, then an empty list is returned.
-#
-# @param Dom The root XML DOM object.
-# @param String A XPath style path.
-#
-def XmlElementList(Dom, String):
- return map(XmlElementData, XmlList(Dom, String))
-
-
-## Get the XML attribute of the current node.
-#
-# Return a single XML attribute named Attribute from the current root Dom.
-# If the input Dom or Attribute is not valid, then an empty string is returned.
-#
-# @param Dom The root XML DOM object.
-# @param Attribute The name of Attribute.
-#
-def XmlAttribute(Dom, Attribute):
- try:
- return Dom.getAttribute(Attribute)
- except BaseException:
- return ''
-
-
-## Get the XML node name of the current node.
-#
-# Return a single XML node name from the current root Dom.
-# If the input Dom is not valid, then an empty string is returned.
-#
-# @param Dom The root XML DOM object.
-#
-def XmlNodeName(Dom):
- try:
- return Dom.nodeName.strip()
- except BaseException:
- return ''
-
-## Parse an XML file.
-#
-# Parse the input XML file named FileName and return a XML DOM it stands for.
-# If the input File is not a valid XML file, then an empty string is returned.
-#
-# @param FileName The XML file name.
-#
-def XmlParseFile(FileName):
- try:
- XmlFile = open(FileName)
- Dom = xml.dom.minidom.parse(XmlFile)
- XmlFile.close()
- return Dom
- except BaseException, XExcept:
- XmlFile.close()
- Logger.Error('\nUPT', PARSER_ERROR, XExcept, File=FileName, RaiseError=True)
diff --git a/BaseTools/Source/Python/UPT/Library/Xml/__init__.py b/BaseTools/Source/Python/UPT/Library/Xml/__init__.py
deleted file mode 100644
index 5d268d990b..0000000000
--- a/BaseTools/Source/Python/UPT/Library/Xml/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Library' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Xml
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Library/__init__.py b/BaseTools/Source/Python/UPT/Library/__init__.py
deleted file mode 100644
index b265bc873c..0000000000
--- a/BaseTools/Source/Python/UPT/Library/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Library' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Library
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Logger/Log.py b/BaseTools/Source/Python/UPT/Logger/Log.py
deleted file mode 100644
index 0915bb7263..0000000000
--- a/BaseTools/Source/Python/UPT/Logger/Log.py
+++ /dev/null
@@ -1,325 +0,0 @@
-## @file
-# This file implements the log mechanism for Python tools.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Logger
-'''
-
-## Import modules
-from sys import argv
-from sys import stdout
-from sys import stderr
-import os.path
-from os import remove
-from logging import getLogger
-from logging import Formatter
-from logging import StreamHandler
-from logging import FileHandler
-from traceback import extract_stack
-
-from Logger.ToolError import FatalError
-from Logger.ToolError import WARNING_AS_ERROR
-from Logger.ToolError import gERROR_MESSAGE
-from Logger.ToolError import UNKNOWN_ERROR
-from Library import GlobalData
-
-#
-# Log level constants
-#
-DEBUG_0 = 1
-DEBUG_1 = 2
-DEBUG_2 = 3
-DEBUG_3 = 4
-DEBUG_4 = 5
-DEBUG_5 = 6
-DEBUG_6 = 7
-DEBUG_7 = 8
-DEBUG_8 = 9
-DEBUG_9 = 10
-VERBOSE = 15
-INFO = 20
-WARN = 30
-QUIET = 40
-QUIET_1 = 41
-ERROR = 50
-SILENT = 60
-
-IS_RAISE_ERROR = True
-SUPRESS_ERROR = False
-
-#
-# Tool name
-#
-_TOOL_NAME = os.path.basename(argv[0])
-#
-# For validation purpose
-#
-_LOG_LEVELS = [DEBUG_0, DEBUG_1, DEBUG_2, DEBUG_3, DEBUG_4, DEBUG_5, DEBUG_6, \
- DEBUG_7, DEBUG_8, DEBUG_9, VERBOSE, WARN, INFO, ERROR, QUIET, \
- QUIET_1, SILENT]
-#
-# For DEBUG level (All DEBUG_0~9 are applicable)
-#
-_DEBUG_LOGGER = getLogger("tool_debug")
-_DEBUG_FORMATTER = Formatter("[%(asctime)s.%(msecs)d]: %(message)s", \
- datefmt="%H:%M:%S")
-#
-# For VERBOSE, INFO, WARN level
-#
-_INFO_LOGGER = getLogger("tool_info")
-_INFO_FORMATTER = Formatter("%(message)s")
-#
-# For ERROR level
-#
-_ERROR_LOGGER = getLogger("tool_error")
-_ERROR_FORMATTER = Formatter("%(message)s")
-
-#
-# String templates for ERROR/WARN/DEBUG log message
-#
-_ERROR_MESSAGE_TEMPLATE = \
-('\n\n%(tool)s...\n%(file)s(%(line)s): error %(errorcode)04X: %(msg)s\n\t%(extra)s')
-
-__ERROR_MESSAGE_TEMPLATE_WITHOUT_FILE = \
-'\n\n%(tool)s...\n : error %(errorcode)04X: %(msg)s\n\t%(extra)s'
-
-_WARNING_MESSAGE_TEMPLATE = '%(tool)s...\n%(file)s(%(line)s): warning: %(msg)s'
-_WARNING_MESSAGE_TEMPLATE_WITHOUT_FILE = '%(tool)s: : warning: %(msg)s'
-_DEBUG_MESSAGE_TEMPLATE = '%(file)s(%(line)s): debug: \n %(msg)s'
-
-
-#
-# Log INFO message
-#
-#Info = _INFO_LOGGER.info
-
-def Info(msg, *args, **kwargs):
- _INFO_LOGGER.info(msg, *args, **kwargs)
-
-#
-# Log information which should be always put out
-#
-def Quiet(msg, *args, **kwargs):
- _ERROR_LOGGER.error(msg, *args, **kwargs)
-
-## Log debug message
-#
-# @param Level DEBUG level (DEBUG0~9)
-# @param Message Debug information
-# @param ExtraData More information associated with "Message"
-#
-def Debug(Level, Message, ExtraData=None):
- if _DEBUG_LOGGER.level > Level:
- return
- if Level > DEBUG_9:
- return
- #
- # Find out the caller method information
- #
- CallerStack = extract_stack()[-2]
- TemplateDict = {
- "file" : CallerStack[0],
- "line" : CallerStack[1],
- "msg" : Message,
- }
-
- if ExtraData != None:
- LogText = _DEBUG_MESSAGE_TEMPLATE % TemplateDict + "\n %s" % ExtraData
- else:
- LogText = _DEBUG_MESSAGE_TEMPLATE % TemplateDict
-
- _DEBUG_LOGGER.log(Level, LogText)
-
-## Log verbose message
-#
-# @param Message Verbose information
-#
-def Verbose(Message):
- return _INFO_LOGGER.log(VERBOSE, Message)
-
-## Log warning message
-#
-# Warning messages are those which might be wrong but won't fail the tool.
-#
-# @param ToolName The name of the tool. If not given, the name of caller
-# method will be used.
-# @param Message Warning information
-# @param File The name of file which caused the warning.
-# @param Line The line number in the "File" which caused the warning.
-# @param ExtraData More information associated with "Message"
-#
-def Warn(ToolName, Message, File=None, Line=None, ExtraData=None):
- if _INFO_LOGGER.level > WARN:
- return
- #
- # if no tool name given, use caller's source file name as tool name
- #
- if ToolName == None or ToolName == "":
- ToolName = os.path.basename(extract_stack()[-2][0])
-
- if Line == None:
- Line = "..."
- else:
- Line = "%d" % Line
-
- TemplateDict = {
- "tool" : ToolName,
- "file" : File,
- "line" : Line,
- "msg" : Message,
- }
-
- if File != None:
- LogText = _WARNING_MESSAGE_TEMPLATE % TemplateDict
- else:
- LogText = _WARNING_MESSAGE_TEMPLATE_WITHOUT_FILE % TemplateDict
-
- if ExtraData != None:
- LogText += "\n %s" % ExtraData
-
- _INFO_LOGGER.log(WARN, LogText)
- #
- # Raise an execption if indicated
- #
- if GlobalData.gWARNING_AS_ERROR == True:
- raise FatalError(WARNING_AS_ERROR)
-
-## Log ERROR message
-#
-# Once an error messages is logged, the tool's execution will be broken by
-# raising an execption. If you don't want to break the execution later, you
-# can give "RaiseError" with "False" value.
-#
-# @param ToolName The name of the tool. If not given, the name of caller
-# method will be used.
-# @param ErrorCode The error code
-# @param Message Warning information
-# @param File The name of file which caused the error.
-# @param Line The line number in the "File" which caused the warning.
-# @param ExtraData More information associated with "Message"
-# @param RaiseError Raise an exception to break the tool's executuion if
-# it's True. This is the default behavior.
-#
-def Error(ToolName, ErrorCode, Message=None, File=None, Line=None, \
- ExtraData=None, RaiseError=IS_RAISE_ERROR):
- if ToolName:
- pass
- if Line == None:
- Line = "..."
- else:
- Line = "%d" % Line
-
- if Message == None:
- if ErrorCode in gERROR_MESSAGE:
- Message = gERROR_MESSAGE[ErrorCode]
- else:
- Message = gERROR_MESSAGE[UNKNOWN_ERROR]
-
- if ExtraData == None:
- ExtraData = ""
-
- TemplateDict = {
- "tool" : _TOOL_NAME,
- "file" : File,
- "line" : Line,
- "errorcode" : ErrorCode,
- "msg" : Message,
- "extra" : ExtraData
- }
-
- if File != None:
- LogText = _ERROR_MESSAGE_TEMPLATE % TemplateDict
- else:
- LogText = __ERROR_MESSAGE_TEMPLATE_WITHOUT_FILE % TemplateDict
-
- if not SUPRESS_ERROR:
- _ERROR_LOGGER.log(ERROR, LogText)
- if RaiseError:
- raise FatalError(ErrorCode)
-
-
-## Initialize log system
-#
-def Initialize():
- #
- # Since we use different format to log different levels of message into
- # different place (stdout or stderr), we have to use different "Logger"
- # objects to do this.
- #
- # For DEBUG level (All DEBUG_0~9 are applicable)
- _DEBUG_LOGGER.setLevel(INFO)
- _DebugChannel = StreamHandler(stdout)
- _DebugChannel.setFormatter(_DEBUG_FORMATTER)
- _DEBUG_LOGGER.addHandler(_DebugChannel)
- #
- # For VERBOSE, INFO, WARN level
- #
- _INFO_LOGGER.setLevel(INFO)
- _InfoChannel = StreamHandler(stdout)
- _InfoChannel.setFormatter(_INFO_FORMATTER)
- _INFO_LOGGER.addHandler(_InfoChannel)
- #
- # For ERROR level
- #
- _ERROR_LOGGER.setLevel(INFO)
- _ErrorCh = StreamHandler(stderr)
- _ErrorCh.setFormatter(_ERROR_FORMATTER)
- _ERROR_LOGGER.addHandler(_ErrorCh)
-
-
-## Set log level
-#
-# @param Level One of log level in _LogLevel
-#
-def SetLevel(Level):
- if Level not in _LOG_LEVELS:
- Info("Not supported log level (%d). Use default level instead." % \
- Level)
- Level = INFO
- _DEBUG_LOGGER.setLevel(Level)
- _INFO_LOGGER.setLevel(Level)
- _ERROR_LOGGER.setLevel(Level)
-
-## Get current log level
-#
-def GetLevel():
- return _INFO_LOGGER.getEffectiveLevel()
-
-## Raise up warning as error
-#
-def SetWarningAsError():
- GlobalData.gWARNING_AS_ERROR = True
-
-## Specify a file to store the log message as well as put on console
-#
-# @param LogFile The file path used to store the log message
-#
-def SetLogFile(LogFile):
- if os.path.exists(LogFile):
- remove(LogFile)
-
- _Ch = FileHandler(LogFile)
- _Ch.setFormatter(_DEBUG_FORMATTER)
- _DEBUG_LOGGER.addHandler(_Ch)
-
- _Ch = FileHandler(LogFile)
- _Ch.setFormatter(_INFO_FORMATTER)
- _INFO_LOGGER.addHandler(_Ch)
-
- _Ch = FileHandler(LogFile)
- _Ch.setFormatter(_ERROR_FORMATTER)
- _ERROR_LOGGER.addHandler(_Ch)
-
-
-
diff --git a/BaseTools/Source/Python/UPT/Logger/StringTable.py b/BaseTools/Source/Python/UPT/Logger/StringTable.py
deleted file mode 100644
index 8a94d71046..0000000000
--- a/BaseTools/Source/Python/UPT/Logger/StringTable.py
+++ /dev/null
@@ -1,770 +0,0 @@
-## @file
-# This file is used to define strings used in the UPT tool
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-##
-"""
-This file contains user visible strings in a format that can be used for
-localization
-"""
-
-import gettext
-
-#
-# string table starts here...
-#
-
-## strings are classified as following types
-# MSG_...: it is a message string
-# ERR_...: it is a error string
-# WRN_...: it is a warning string
-# HLP_...: it is a help string
-#
-
-_ = gettext.gettext
-
-MSG_USAGE_STRING = _("\n"
- "Intel(r) UEFI Packaging Tool (Intel(r) UEFIPT)\n"
- "%prog [options]"
- )
-
-##
-# Version and Copyright
-#
-MSG_VERSION_NUMBER = _("1.0")
-MSG_VERSION = _("Intel(r) UEFI Packaging Tool (Intel(r) UEFIPT) - Revision " + \
- MSG_VERSION_NUMBER)
-MSG_COPYRIGHT = _("Copyright (c) 2011 Intel Corporation All Rights Reserved.")
-MSG_VERSION_COPYRIGHT = _("\n %s\n %s" % (MSG_VERSION, MSG_COPYRIGHT))
-MSG_USAGE = _("%s [options]\n%s" % ("upt.exe", MSG_VERSION_COPYRIGHT))
-MSG_DESCRIPTION = _("The Intel(r) UEFIUPT is used to create, " + \
- "install or remove a UEFI Distribution Package.")
-
-
-#
-# INF Parser related strings.
-#
-ERR_INF_PARSER_HEADER_FILE = _(
- "The Header comment section should start with an @file at the top.")
-ERR_INF_PARSER_HEADER_MISSGING = _(
- "The Header comment is missing. It must be corrected before continuing.")
-ERR_INF_PARSER_UNKNOWN_SECTION = _("An unknown section was found. "
- "It must be corrected before continuing. ")
-ERR_INF_PARSER_NO_SECTION_ERROR = _("No section was found. "
- "A section must be included before continuing.")
-ERR_INF_PARSER_BUILD_OPTION_FORMAT_INVALID = \
- _("Build Option format incorrect.")
-ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID = _(
- "The format of binary %s item is incorrect. "
- "It should contain at least 2 elements.")
-ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_MAX = _(
- "The format of binary %s item is invalid, "
- "it should contain not more than %d elements.")
-ERR_INF_PARSER_BINARY_ITEM_INVALID_FILETYPE = _(
- "The Binary FileType is incorrect. It should in %s")
-ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST = _(
- "The Binary File: %s not exist.")
-ERR_INF_PARSER_BINARY_VER_TYPE = _(
- "Only this type is allowed: \"%s\".")
-ERR_INF_PARSER_MULTI_DEFINE_SECTION = \
- _("Multiple define sections found. "
- "It must be corrected before continuing.")
-ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND = \
- _("More then 1 %s is defined in DEFINES section. "
- "It must be corrected before continuing.")
-ERR_INF_PARSER_DEFINE_NAME_INVALID = \
- _("Incorrect name format for : %s")
-ERR_INF_PARSER_DEFINE_GUID_INVALID = \
- _("The format of this GUID is incorrect: %s")
-ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID = _("Incorrect MODULE_TYPE: %s")
-ERR_INF_PARSER_DEFINE_FROMAT_INVALID = _("Incorrect format: %s")
-ERR_INF_PARSER_FILE_NOT_EXIST = _("This file does not exist: %s")
-ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID = \
- _("The file does not exist or has an incorrect file name or not in "
- "sub-directories of the directory containing the INF file: %s. "
- "It must be corrected before continuing")
-ERR_INF_PARSER_DEFINE_SHADOW_INVALID = \
- _("The SHADOW keyword is only valid for"
- " SEC, PEI_CORE and PEIM module types.")
-ERR_INF_PARSER_DEFINE_SECTION_HEADER_INVALID = \
- _("The format of the section header is incorrect")
-ERR_INF_PARSER_DEPEX_SECTION_INVALID = \
- _("A module can't have a Depex section when its module type is %s")
-ERR_INF_PARSER_DEPEX_SECTION_INVALID_FOR_LIBRARY_CLASS = \
- _("A library class can't have a Depex section when its supported module type list is not defined.")
-ERR_INF_PARSER_DEPEX_SECTION_INVALID_FOR_DRIVER = \
- _("A driver can't have a Depex section when its module type is UEFI_DRIVER.")
-ERR_INF_PARSER_DEPEX_SECTION_NOT_DETERMINED = \
- _("Cannot determine the module's Depex type. The Depex's module types are conflict")
-ERR_INF_PARSER_DEFINE_SECTION_MUST_ITEM_NOT_EXIST = _(
- "No %s found in INF file, please check it.")
-ERR_INF_PARSER_DEPEX_SECTION_MODULE_TYPE_ERROR = \
- _("The module type of [Depex] section is invalid, not support type of %s")
-ERR_INF_PARSER_DEPEX_SECTION_CONTENT_MISSING = \
- _("Missing content in: %s")
-ERR_INF_PARSER_DEPEX_SECTION_CONTENT_ERROR = \
- _("The [Depex] section contains invalid content: %s")
-ERR_INF_PARSER_DEPEX_SECTION_SEC_TYPE_ERROR = \
- _("The format is incorrect. The section type keyword of the content in the"
- " [Depex] section is only for 'PEI_DEPEX', 'DXE_DEPEX', 'SMM_DEPEX', "
- "it does not support type: %s")
-ERR_INF_PARSER_UE_SECTION_USER_ID_ERROR = \
- _("This format is incorrect. "
- "The UserID: %s in [UserExtension] section is incorrect.")
-ERR_INF_PARSER_UE_SECTION_ID_STRING_ERROR = \
- _("This format is incorrect. "
- "IdString: %s in [UserExtension] section is incorrect.")
-ERR_INF_PARSER_LIBRARY_SECTION_CONTENT_ERROR = \
- _("The format is incorrect. "
- "You can only have a Library name and a Feature flag in one line.")
-ERR_INF_PARSER_LIBRARY_SECTION_LIBNAME_MISSING = \
- _("Format invalid. Please specify a library name.")
-ERR_INF_PARSER_SOURCES_SECTION_CONTENT_ERROR = \
- _("The format is incorrect. It should be formated as follows: "
- "FileName, Family | TagName | ToolCode | FeatureFlagExpr.")
-ERR_INF_PARSER_PCD_SECTION_TYPE_ERROR = \
- _("The PCD section type is incorrect. The value should be this list: %s")
-ERR_INF_PARSER_PCD_SECTION_CONTENT_ERROR = \
- _("PcdName format invalid."
- "Should like following: PcdName | Value | FeatureFlag.")
-ERR_INF_PARSER_PCD_NAME_FORMAT_ERROR = \
- _("Format invalid."
- "Should like following: <TokenSpaceGuidCName>.<PcdCName> ")
-ERR_INF_PARSER_GUID_PPI_PROTOCOL_SECTION_CONTENT_ERROR = \
- _("The format is incorrect. "
- "It should be formated as follows: CName | FeatureFlag.")
-ERR_INF_PARSER_PACKAGE_SECTION_CONTENT_ERROR = \
- _("The format is incorrect. "
- "It should be formated as follows: <TokenSpaceGuidCName>.<PcdCName>")
-ERR_INF_PARSER_PCD_TAIL_COMMENTS_INVALID = \
- _("The format is incorrect. "
- "Multiple usage descriptions must be described on subsequent lines.")
-ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR = \
- _("This section format is incorrect: %s.")
-ERR_INF_PARSER_SECTION_NAME_DUPLICATE = \
- _("This section has multiple section names, "
- "only one section name is permitted.")
-ERR_INF_PARSER_SECTION_ARCH_CONFLICT = \
- _("The 'common' ARCH must not be used with the specified ARCHs.")
-ERR_INF_PARSER_SOURCE_SECTION_TAGNAME_INVALID = \
- _("This TagName is incorrect: %s. "
- "It must be corrected before continuing.")
-ERR_INF_PARSER_TAGNAME_NOT_PERMITTED = \
- _("TagName is not permitted: %s. "
- "It must be corrected before continuing.")
-ERR_INF_PARSER_TOOLCODE_NOT_PERMITTED = \
- _("ToolCode is not permitted: %s. "
- "It must be corrected before continuing.")
-ERR_INF_PARSER_SOURCE_SECTION_FAMILY_INVALID = \
- _("This family is incorrect: %s. "
- "It must be corrected before continuing. ")
-ERR_INF_PARSER_SOURCE_SECTION_SECTIONNAME_INVALID = \
- _("This SectionName is incorrect: %s. "
- "It must be corrected before continuing.")
-ERR_INF_PARSER_PCD_CVAR_GUID = \
- _("TokenSpaceGuidCName must be valid C variable format.")
-ERR_INF_PARSER_PCD_CVAR_PCDCNAME = \
- _("PcdCName must be valid C variable format.")
-ERR_INF_PARSER_PCD_VALUE_INVALID = \
- _("The PCD value is incorrect. It must be corrected before continuing.")
-ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID = \
- _("Incorrect feature flag expression: %s")
-ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING = \
- _("The feature flag expression is missing. Please specify a feature flag.")
-ERR_INF_PARSER_INVALID_CNAME = \
- _("Incorrect CName: %s. You must specify a valid C variable name.")
-ERR_INF_PARSER_CNAME_MISSING = \
- _("Missing CName. Specify a valid C variable name.")
-ERR_INF_PARSER_DEFINE_SECTION_KEYWORD_INVALID = \
- _("The Define section contains an invalid keyword: \"%s\"."
- "It must be corrected before continuing.")
-ERR_INF_PARSER_FILE_MISS_DEFINE = \
- _("The following file listed in the module "
- "directory is not listed in the INF: %s")
-ERR_INF_PARSER_VERSION_NUMBER_DEPRICATED = \
- _("VERSION_NUMBER depricated. "
- "The INF file %s should be modified to use the VERSION_STRING instead.")
-ERR_INF_PARSER_VER_EXIST_BOTH_NUM_STR = \
- _("The INF file %s defines both VERSION_NUMBER and VERSION_STRING, "
- "using VERSION_STRING")
-ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF = _("EDKI INF is not supported")
-ERR_INF_PARSER_EDKI_COMMENT_IN_EDKII = _("The EDKI style comment is not supported in EDKII modules")
-
-ERR_INF_PARSER_FEATUREPCD_USAGE_INVALID = _("The usage for FeaturePcd can only"
- " be type of \"CONSUMES\".")
-
-ERR_INF_PARSER_DEFINE_ITEM_NO_NAME = _("No name specified")
-ERR_INF_PARSER_DEFINE_ITEM_NO_VALUE = _("No value specified")
-
-ERR_INF_PARSER_MODULETYPE_INVALID = _("Drivers and applications are not allowed to have a MODULE_TYPE of \"BASE\". "
-"Only libraries are permitted to a have a MODULE_TYPE of \"BASE\".")
-ERR_INF_GET_PKG_DEPENDENCY_FAIL = _("Failed to get PackageDependencies information from file %s")
-ERR_INF_NO_PKG_DEPENDENCY_INFO = _("There are no packages defined that use the AsBuilt PCD information.")
-
-#
-# Item duplicate
-#
-ERR_INF_PARSER_ITEM_DUPLICATE = _("%s define duplicated! "
- "It must be corrected before continuing.")
-ERR_INF_PARSER_ITEM_DUPLICATE_COMMON = _("%s define duplicated! Item listed"
-"in an architectural section must not be listed in the common architectural"
-"section.It must be corrected before continuing.")
-ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR = \
-_("%s define duplicated! Each UserExtensions section header must have a "
- "unique set of UserId, IdString and Arch values. "
- "It must be corrected before continuing.")
-
-ERR_INF_PARSER_DEFINE_LIB_NAME_INVALID = \
-_("The name 'NULL' for LibraryClass is a reserved word."
-"Please don't use it.")
-
-ERR_GLOBAL_MARCO_INVALID = \
-_("Using global MACRO in INF/DEC is not permitted: %s . "
-"It must be corrected before continuing.")
-
-ERR_MARCO_DEFINITION_MISS_ERROR = \
-_("MACRO expand incorrectly, can not find the MACRO definition. "
-"It must be corrected before continuing.")
-
-#
-# AsBuilt related
-#
-ERR_LIB_CONTATIN_ASBUILD_AND_COMMON = _("A binary INF file should not contain both AsBuilt LIB_INSTANCES information "
- "and a common library entry.")
-ERR_LIB_INSTANCE_MISS_GUID = _("Could not get FILE_GUID definition from instance INF file.")
-
-ERR_BO_CONTATIN_ASBUILD_AND_COMMON = _("A binary INF file should contain either AsBuilt information "
- "or a common build option entry, not both.")
-
-ERR_ASBUILD_PCD_SECTION_TYPE = _("The AsBuilt INF file contains a PCD section type that is not permitted: %s.")
-ERR_ASBUILD_PATCHPCD_FORMAT_INVALID = _("The AsBuilt PatchPcd entry must contain 3 elements: PcdName|Value|Offset")
-ERR_ASBUILD_PCDEX_FORMAT_INVALID = _("The AsBuilt PcdEx entry must contain 2 elements: PcdName|Value")
-ERR_ASBUILD_PCD_VALUE_INVALID = \
- _("The AsBuilt PCD value %s is incorrect or not align with it's datum type %s. "
- "It must be corrected before continuing.")
-ERR_ASBUILD_PCD_TOKENSPACE_GUID_VALUE_MISS = _("Package file value could not be retrieved for %s.")
-ERR_ASBUILD_PCD_DECLARITION_MISS = _("PCD Declaration in DEC files could not be found for: %s.")
-ERR_ASBUILD_PCD_OFFSET_FORMAT_INVALID = _("PCD offset format invalid, number of (0-4294967295) or"
-"Hex number of UINT32 allowed : %s.")
-
-#
-# XML parser related strings
-#
-ERR_XML_PARSER_REQUIRED_ITEM_MISSING = \
- _("The XML section/attribute '%s' is required under %s, it can't be missing or empty")
-ERR_XML_INVALID_VARIABLENAME = \
- _("The VariableName of the GUID in the XML tree does not conform to the packaging specification. "
- "Only a Hex Byte Array of UCS-2 format or L\"string\" is allowed): %s %s %s")
-ERR_XML_INVALID_LIB_SUPMODLIST = _("The LIBRARY_CLASS entry %s must have the list appended using the format as: \n"
-"BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER SMM_CORE DXE_SMM_DRIVER DXE_RUNTIME_DRIVER "
-"DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION USER_DEFINED\n Current is %s.")
-ERR_XML_INVALID_EXTERN_SUPARCHLIST = \
- _("There is a mismatch of SupArchList %s between the EntryPoint, UnloadImage, Constructor, "
- "and Destructor elements in the ModuleSurfaceArea.ModuleProperties: SupArchList: %s. ")
-ERR_XML_INVALID_EXTERN_SUPMODLIST = _("The SupModList attribute of the CONSTRUCTOR or DESTRUCTOR element: %s does not "
-"match the Supported Module Types listed after LIBRARY_CLASS = <Keyword> | %s")
-ERR_XML_INVALID_EXTERN_SUPMODLIST_NOT_LIB = _("The module is not a library module. "
- "The MODULE_TYPE : %s listed in the ModuleSurfaceArea.Header "
- "must match the SupModList attribute %s")
-ERR_XML_INVALID_BINARY_FILE_TYPE = _("Invalid binary file type %s.")
-
-#
-# Verbosity related strings.
-#
-MSG_DISTRIBUTION_PACKAGE_FILE_EXISTS = _(
- "The distribution package file %s already exists.\nPress Y to override it."
- " To exit the application, press any other key.")
-MSG_CHECK_MODULE_EXIST = _(
- "\nChecking to see if module exists in workspace started ...")
-MSG_CHECK_MODULE_EXIST_FINISH = \
- _("Checking to see if module exists in workspace ... Done.")
-MSG_CHECK_MODULE_DEPEX_START = _(
- "\nChecking to see if module depex met by workspace started ...")
-MSG_CHECK_MODULE_DEPEX_FINISH = _(
- "Checking to see if module depex met by workspace ... Done.")
-MSG_CHECK_PACKAGE_START = _(
- "\nChecking to see if package exists in workspace started ...")
-MSG_CHECK_PACKAGE_FINISH = _(
- "Checking to see if package exists in workspace ... Done.")
-MSG_CHECK_DP_START = \
- _("\nChecking to see if DP exists in workspace ... Done.")
-MSG_CHECK_DP_FINISH = _("Check DP exists in workspace ... Done.")
-MSG_MODULE_DEPEND_ON = _("Module %s depends on Package %s")
-MSG_INIT_IPI_START = _("\nInitialize IPI database started ...")
-MSG_INIT_IPI_FINISH = _("Initialize IPI database ... Done.")
-MSG_GET_DP_INSTALL_LIST = _(
- "\nGetting list of DP install information started ...")
-MSG_GET_DP_INSTALL_INFO_START = _(
- "\nGetting list of DP install information started ...")
-MSG_GET_DP_INSTALL_INFO_FINISH = _("Getting DP install information ... Done.")
-MSG_UZIP_PARSE_XML = _(
- "Unzipping and parsing distribution package XML file ... ")
-MSG_INSTALL_PACKAGE = _("Installing package ... %s")
-MSG_INSTALL_MODULE = _("Installing module ... %s")
-MSG_NEW_FILE_NAME_FOR_DIST = _(
- "Provide new filename for distribution file to be saved:\n")
-MSG_UPDATE_PACKAGE_DATABASE = _("Update Distribution Package Database ...")
-MSG_PYTHON_ON = _("(Python %s on %s) ")
-MSG_SEARCH_FOR_HELP = _(
- "\n(Please send email to edk2-buildtools-devel@lists.sourceforge.net for\n"
- " help, attach the following call stack trace.)\n")
-MSG_REMOVE_TEMP_FILE_STARTED = _("Removing temp files started ... ")
-MSG_REMOVE_TEMP_FILE_DONE = _("Removing temp files ... Done.")
-MSG_FINISH = _("Successfully Done.")
-MSG_COMPRESS_DISTRIBUTION_PKG = _("Compressing Distribution Package File ...")
-MSG_CONFIRM_REMOVE = _(
- "Some packages or modules depend on this distribution package.\n"
- "Do you really want to remove it?")
-MSG_CONFIRM_REMOVE2 = _(
- "This file has been modified: %s. Do you want to remove it?"
- "Press Y to remove or other key to keep it")
-MSG_CONFIRM_REMOVE3 = _(
- "This is a newly created file: %s. Are you sure you want to remove it? "
- "Press Y to remove or any other key to keep it")
-MSG_USER_DELETE_OP = _(
- "Press Y to delete all files or press any other key to quit:")
-MSG_REMOVE_FILE = _("Removing file: %s ...")
-
-MSG_INITIALIZE_ECC_STARTED = _("\nInitialize ECC database started ...")
-MSG_INITIALIZE_ECC_DONE = _("Initialize ECC database ... Done.")
-MSG_DEFINE_STATEMENT_FOUND = _("DEFINE statement '%s' found in section %s")
-MSG_PARSING = _("Parsing %s ...")
-
-MSG_REPKG_CONFLICT = \
-_("Repackaging is not allowed on this file: %s. "
- "It was installed from distribution %s(Guid %s Version %s).")
-
-MSG_INVALID_MODULE_INTRODUCED = _("Some modules are not valid after removal.")
-MSG_CHECK_LOG_FILE = _("Please check log file %s for full list")
-MSG_NEW_FILE_NAME = _(
- "Provide new filename:\n")
-MSG_RELATIVE_PATH_ONLY = _("Please specify a relative path, full path is not allowed: %s")
-MSG_NEW_PKG_PATH = _(
- "Select package location. To quit with no input, press [Enter].")
-
-#
-# Error related strings.
-#
-
-ERR_DEPENDENCY_NOT_MATCH = _(
- "Module %s's dependency on package %s (GUID %s Version %s) "
- "cannot be satisfied")
-ERR_MODULE_NOT_INSTALLED = _(
- "This module is not installed in the workspace: %s\n")
-ERR_DIR_ALREADY_EXIST = _(
- "This directory already exists: %s.\n"
- "Select another location. Press [Enter] with no input to quit:")
-ERR_USER_INTERRUPT = _("The user has paused the application")
-ERR_DIST_FILE_TOOMANY = _(
- "Only one .content and one .pkg file in ZIP file are allowed.")
-ERR_DIST_FILE_TOOFEW = _(
- "Must have one .content and one .pkg file in the ZIP file.")
-ERR_FILE_ALREADY_EXIST = _(
- "This file already exists: %s.\n"
- "Select another path to continue. To quit with no input press [Enter]:")
-ERR_SPECIFY_PACKAGE = _(
- "One distribution package must be specified")
-ERR_FILE_BROKEN = _(
- "This file is invalid in the distribution package: %s")
-ERR_PACKAGE_NOT_MATCH_DEPENDENCY = _(
- "This distribution package does not meet the dependency requirements")
-ERR_UNKNOWN_FATAL_INSTALL_ERR = \
-_("Unknown unrecoverable error when installing: %s")
-ERR_OPTION_NOT_FOUND = _("Options not found")
-ERR_INVALID_PACKAGE_NAME = _("Incorrect package name: %s. ")
-ERR_INVALID_PACKAGE_PATH = \
-_("Incorrect package path: %s. The path must be a relative path.")
-ERR_NOT_FOUND = _("This was not found: %s")
-ERR_INVALID_MODULE_NAME = _("This is not a valid module name: %s")
-ERR_INVALID_METAFILE_PATH = _('This file must be in sub-directory of WORKSPACE: %s.')
-ERR_INVALID_MODULE_PATH = \
-_("Incorrect module path: %s. The path must be a relative path.")
-ERR_UNKNOWN_FATAL_CREATING_ERR = _("Unknown error when creating: %s")
-ERR_PACKAGE_NOT_INSTALLED = _(
- "This distribution package not installed: %s")
-ERR_DISTRIBUTION_NOT_INSTALLED = _(
- "The distribution package is not installed.")
-ERR_UNKNOWN_FATAL_REMOVING_ERR = _("Unknown error when removing package")
-ERR_NOT_CONFIGURE_WORKSPACE_ENV = _(
- "The WORKSPACE environment variable must be configured.")
-ERR_NO_TEMPLATE_FILE = _("This package information data file is not found: %s")
-ERR_DEBUG_LEVEL = _(
- "Not supported debug level. Use default level instead.")
-ERR_REQUIRE_T_OPTION = _(
- "Option -t is required during distribution creation.")
-ERR_REQUIRE_I_C_R_OPTION = _(
- "Options -i, -c and -r are mutually exclusive.")
-ERR_I_C_EXCLUSIVE = \
-_("Option -c and -i are mutually exclusive.")
-ERR_I_R_EXCLUSIVE = \
-_("Option -i and -r are mutually exclusive.")
-ERR_C_R_EXCLUSIVE = \
-_("Option -c and -r are mutually exclusive.")
-
-ERR_FAILED_LOAD = _("Failed to load %s\n\t%s")
-ERR_PLACEHOLDER_DIFFERENT_REPEAT = _(
- "${%s} has different repeat time from others.")
-ERR_KEY_NOTALLOWED = _("This keyword is not allowed: %s")
-ERR_NOT_FOUND_ENVIRONMENT = _("Environment variable not found")
-ERR_WORKSPACE_NOTEXIST = _("WORKSPACE doesn't exist")
-ERR_SPACE_NOTALLOWED = _(
- "Whitespace characters are not allowed in the WORKSPACE path. ")
-ERR_MACRONAME_NOGIVEN = _("No MACRO name given")
-ERR_MACROVALUE_NOGIVEN = _("No MACRO value given")
-ERR_MACRONAME_INVALID = _("Incorrect MACRO name: %s")
-ERR_MACROVALUE_INVALID = _("Incorrect MACRO value: %s")
-ERR_NAME_ONLY_DEFINE = _(
- "This variable can only be defined via environment variable: %s")
-ERR_EDK_GLOBAL_SAMENAME = _(
- "EDK_GLOBAL defined a macro with the same name as one defined by 'DEFINE'")
-ERR_SECTIONNAME_INVALID = _(
- "An incorrect section name was found: %s. 'The correct file is '%s' .")
-ERR_CHECKFILE_NOTFOUND = _(
- "Can't find file '%s' defined in section '%s'")
-ERR_INVALID_NOTFOUND = _(
- "Incorrect statement '%s' was found in section '%s'")
-ERR_TEMPLATE_NOTFOUND = _("This package information data file is not found: %s")
-ERR_SECTION_NAME_INVALID = _('Incorrect section name: %s')
-ERR_SECTION_REDEFINE = _(
- "This section already defined: %s.")
-ERR_SECTION_NAME_NONE = \
- _('The section needs to be specified first.')
-ERR_KEYWORD_INVALID = _('Invalid keyword: %s')
-ERR_VALUE_INVALID = _("Invalid \"%s\" value in section [%s].")
-ERR_FILELIST_LOCATION = _(
- 'The directory "%s" must contain this file: "%s".')
-ERR_KEYWORD_REDEFINE = _(
- "Keyword in this section can only be used once: %s.")
-ERR_FILELIST_EXIST = _(
- 'This file does not exist: %s.')
-ERR_COPYRIGHT_CONTENT = _(
- "The copyright content must contain the word \"Copyright\" (case insensitive).")
-ERR_WRONG_FILELIST_FORMAT = \
-_('File list format is incorrect.'
- 'The correct format is: filename|key=value[|key=value]')
-ERR_FILELIST_ATTR = _(
- "The value of attribute \"%s\" includes illegal character.")
-ERR_UNKNOWN_FILELIST_ATTR = _(
- 'Unknown attribute name: %s.')
-ERR_EMPTY_VALUE = _("Empty value is not allowed")
-ERR_KEYWORD_MANDATORY = _('This keyword is mandatory: %s')
-ERR_BOOLEAN_VALUE = _(
- 'Value of key [%s] must be true or false, current: [%s]')
-ERR_GUID_VALUE = _(
- 'GUID must have the format of 8-4-4-4-12 with HEX value. '
- 'Current value: [%s]')
-ERR_VERSION_VALUE = _(
- 'The value of key [%s] must be a decimal number. Found: [%s]')
-ERR_VERSION_XMLSPEC = _(
- 'XmlSpecification value must be 1.1, current: %s.')
-
-ERR_INVALID_GUID = _("Incorrect GUID value string: %s")
-
-ERR_FILE_NOT_FOUND = \
- _("File or directory not found in workspace")
-ERR_FILE_OPEN_FAILURE = _("Could not open file")
-ERR_FILE_WRITE_FAILURE = _("Could not write file.")
-ERR_FILE_PARSE_FAILURE = _("Could not parse file")
-ERR_FILE_READ_FAILURE = _("Could not read file")
-ERR_FILE_CREATE_FAILURE = _("Could not create file")
-ERR_FILE_CHECKSUM_FAILURE = _("Checksum of file is incorrect")
-ERR_FILE_COMPRESS_FAILURE = _("File compression did not correctly")
-ERR_FILE_DECOMPRESS_FAILURE = \
- _("File decompression did not complete correctly")
-ERR_FILE_MOVE_FAILURE = _("Move file did not complete successfully")
-ERR_FILE_DELETE_FAILURE = _("File could not be deleted")
-ERR_FILE_COPY_FAILURE = _("File did not copy correctly")
-ERR_FILE_POSITIONING_FAILURE = _("Could not find file seek position")
-ERR_FILE_TYPE_MISMATCH = _("Incorrect file type")
-ERR_FILE_CASE_MISMATCH = _("File name case mismatch")
-ERR_FILE_DUPLICATED = _("Duplicate file found")
-ERR_FILE_UNKNOWN_ERROR = _("Unknown error encountered on file")
-ERR_FILE_NAME_INVALIDE = _("This file name is invalid, it must not be an absolute path or "
- "contain a period \".\" or \"..\": %s.")
-ERR_OPTION_UNKNOWN = _("Unknown option")
-ERR_OPTION_MISSING = _("Missing option")
-ERR_OPTION_CONFLICT = _("Options conflict")
-ERR_OPTION_VALUE_INVALID = _("Invalid option value")
-ERR_OPTION_DEPRECATED = _("Deprecated option")
-ERR_OPTION_NOT_SUPPORTED = _("Unsupported option")
-ERR_OPTION_UNKNOWN_ERROR = _("Unknown error when processing options")
-ERR_PARAMETER_INVALID = _("Invalid parameter")
-ERR_PARAMETER_MISSING = _("Missing parameter")
-ERR_PARAMETER_UNKNOWN_ERROR = _("Unknown error in parameters")
-ERR_FORMAT_INVALID = _("Invalid syntax/format")
-ERR_FORMAT_NOT_SUPPORTED = _("Syntax/format not supported")
-ERR_FORMAT_UNKNOWN = _("Unknown format")
-ERR_FORMAT_UNKNOWN_ERROR = _("Unknown error in syntax/format ")
-ERR_RESOURCE_NOT_AVAILABLE = _("Not available")
-ERR_RESOURCE_ALLOCATE_FAILURE = _("A resource allocation has failed")
-ERR_RESOURCE_FULL = _("Full")
-ERR_RESOURCE_OVERFLOW = _("Overflow")
-ERR_RESOURCE_UNDERRUN = _("Underrun")
-ERR_RESOURCE_UNKNOWN_ERROR = _("Unknown error")
-ERR_ATTRIBUTE_NOT_AVAILABLE = _("Not available")
-ERR_ATTRIBUTE_RETRIEVE_FAILURE = _("Unable to retrieve")
-ERR_ATTRIBUTE_SET_FAILURE = _("Unable to set")
-ERR_ATTRIBUTE_UPDATE_FAILURE = _("Unable to update")
-ERR_ATTRIBUTE_ACCESS_DENIED = _("Access denied")
-ERR_ATTRIBUTE_UNKNOWN_ERROR = _("Unknown error when accessing")
-ERR_COMMAND_FAILURE = _("Unable to execute command")
-ERR_IO_NOT_READY = _("Not ready")
-ERR_IO_BUSY = _("Busy")
-ERR_IO_TIMEOUT = _("Timeout")
-ERR_IO_UNKNOWN_ERROR = _("Unknown error in IO operation")
-ERR_UNKNOWN_ERROR = _("Unknown error")
-ERR_UPT_ALREADY_INSTALLED_ERROR = _("Already installed")
-ERR_UPT_ENVIRON_MISSING_ERROR = _("Environ missing")
-ERR_UPT_REPKG_ERROR = _("File not allowed for RePackage")
-ERR_UPT_DB_UPDATE_ERROR = _("Update database did not complete successfully")
-ERR_UPT_INI_PARSE_ERROR = _("INI file parse error")
-ERR_COPYRIGHT_MISSING = \
-_("Header comment section must have copyright information")
-ERR_LICENSE_MISSING = \
-_("Header comment section must have license information")
-ERR_INVALID_COMMENT_FORMAT = _("Comment must start with #")
-ERR_USER_ABORT = _("User has stopped the application")
-ERR_DIST_EXT_ERROR = \
-_("Distribution file extension should be '.dist'. Current given: '%s'.")
-ERR_DIST_FILENAME_ONLY_FOR_REMOVE = \
-_("Only distribution filename without path allowed during remove. Current given: '%s'.")
-ERR_NOT_STANDALONE_MODULE_ERROR = \
- _("Module %s is not a standalone module (found in Package %s)")
-ERR_UPT_ALREADY_RUNNING_ERROR = \
- _("UPT is already running, only one instance is allowed")
-ERR_MUL_DEC_ERROR = _("Multiple DEC files found within one package directory tree %s: %s, %s")
-ERR_INSTALL_FILE_FROM_EMPTY_CONTENT = _("Error file to be installed is not found in content file: %s")
-ERR_INSTALL_FILE_DEC_FILE_ERROR = _("Could not obtain the TokenSpaceGuidCName and the PcdCName from the DEC files "
-"that the package depends on for this pcd entry: TokenValue: %s Token: %s")
-ERR_NOT_SUPPORTED_SA_MODULE = _("Stand-alone module distribution does not allow EDK 1 INF")
-ERR_INSTALL_DIST_NOT_FOUND = \
-_("Distribution file to be installed is not found in current working directory or workspace: %s")
-
-#
-# Expression error message
-#
-ERR_EXPR_RIGHT_PAREN = \
-_('Expected ")" in feature flag expression [%s]. Found: [%s].')
-ERR_EXPR_FACTOR = \
-_('Expected HEX, integer, macro, quoted string or PcdName in '
- 'feature flag expression [%s]. Found: [%s].')
-ERR_EXPR_STRING_ITEM = \
-_('Expected quoted string, macro name or PcdName in feature flag '
- 'expression [%s]. Found: [%s].')
-ERR_EXPR_EQUALITY = \
-_('Expected ==, EQ, != or NE in feature flag expression [%s]. Found: [%s].')
-ERR_EXPR_BOOLEAN = \
-_('The rest of string [%s] in feature flag '
- 'expression [%s] cannot be evaluated.')
-ERR_EXPR_EMPTY = _('Boolean value cannot be empty.')
-ERR_EXPR_LOGICAL = \
-_('The following cannot be evaluated as a logical expression: [%s].')
-ERR_EXPR_OR = _('The expression must be encapsulated in open "(" and close ")" '
- 'parenthesis when using | or ||.')
-
-#
-# DEC parser error message
-#
-ERR_DECPARSE_STATEMENT_EMPTY = \
-_('Must have at least one statement in section %s.')
-ERR_DECPARSE_DEFINE_DEFINED = \
-_('%s already defined in define section.')
-ERR_DECPARSE_DEFINE_SECNAME = \
-_('No arch and others can be followed for define section.')
-ERR_DECPARSE_DEFINE_MULTISEC = \
-_('The DEC file does not allow multiple define sections.')
-ERR_DECPARSE_DEFINE_REQUIRED = \
-_("Field [%s] is required in define section.")
-ERR_DECPARSE_DEFINE_FORMAT = \
-_("Wrong define section format, must be KEY = Value.")
-ERR_DECPARSE_DEFINE_UNKNOWKEY = \
-_("Unknown key [%s] in define section.")
-ERR_DECPARSE_DEFINE_SPEC = \
-_("Specification value must be HEX numbers.")
-ERR_DECPARSE_DEFINE_PKGNAME = \
-_("Package name must be AlphaNumeric characters.")
-ERR_DECPARSE_DEFINE_PKGGUID = \
-_("GUID format error, must be HEX value with form 8-4-4-4-12.")
-ERR_DECPARSE_DEFINE_PKGVERSION = \
-_("Version number must be decimal number.")
-ERR_DECPARSE_DEFINE_PKGVUNI = \
-_("UNI file name format error or file does not exist.")
-ERR_DECPARSE_INCLUDE = \
-_("Incorrect path: [%s].")
-ERR_DECPARSE_LIBCLASS_SPLIT = \
-_("Library class format error, must be Libraryclass|Headerpath.")
-ERR_DECPARSE_LIBCLASS_EMPTY = \
-_("Class name or file name must not be empty.")
-ERR_DECPARSE_LIBCLASS_LIB = \
-_("Class name format error, must start with upper case letter followed with "
- "zero or more alphanumeric characters.")
-ERR_DECPARSE_LIBCLASS_PATH_EXT = _("File name must be end with .h.")
-ERR_DECPARSE_LIBCLASS_PATH_DOT = _("Path must not include '..'.")
-ERR_DECPARSE_LIBCLASS_PATH_EXIST = _("File name [%s] does not exist.")
-ERR_DECPARSE_PCD_CVAR_GUID = \
-_("TokenSpaceGuidCName must be valid C variable format.")
-ERR_DECPARSE_PCD_SPLIT = \
-_("Incorrect PcdName. The format must be TokenSpaceGuidCName.PcdCName"
- "|PcdData|PcdType|Token.")
-ERR_DECPARSE_PCD_NAME = \
-_("Incorrect PCD name. The correct format must be "
- "<TokenSpaceGuidCName>.<PcdCName>.")
-ERR_DECPARSE_PCD_CVAR_PCDCNAME = \
-_("PcdCName must be valid C variable format.")
-ERR_DECPARSE_PCD_TYPE = \
-_('Incorrect PCD data type. A PCD data type must be one of '
- '"UINT8", "UINT16", "UINT32", "UINT64", "VOID*", "BOOLEAN".')
-ERR_DECPARSE_PCD_VOID = \
-_("Incorrect value [%s] of type [%s]. Value must be printable and in the "
- "form of{...} for array, or ""..."" for string, or L""..."""
- "for unicode string.")
-ERR_DECPARSE_PCD_BOOL = \
-_("Invalid value [%s] of type [%s]; must be expression, TRUE, FALSE, 0 or 1.")
-ERR_DECPARSE_PCD_INT = _("Incorrect value [%s] of type [%s]."\
-" Value must be a hexadecimal, decimal or octal in C language format.")
-ERR_DECPARSE_PCD_INT_NEGTIVE = _("Incorrect value [%s] of type [%s];"
- " must not be signed number.")
-ERR_DECPARSE_PCD_INT_EXCEED = _("Incorrect value [%s] of type [%s]; "
- "the number is too long for this type.")
-ERR_DECPARSE_PCD_FEATUREFLAG = \
-_("PcdFeatureFlag only allow BOOLEAN type.")
-ERR_DECPARSE_PCD_TOKEN = \
-_("An incorrect PCD token found: [%s]. "
- "It must start with 0x followed by 1 - 8 hexadecimal. ")
-ERR_DECPARSE_PCD_TOKEN_INT = _("Incorrect token number [%s]. "
- "This token number exceeds the maximal value of unsigned 32.")
-ERR_DECPARSE_PCD_TOKEN_UNIQUE = _("Token number must be unique to the token space: %s.")
-ERR_DECPARSE_CGUID = \
-_("No GUID name or value specified, must be <CName> = <GuidValueInCFormat>.")
-ERR_DECPARSE_CGUID_NAME = \
-_("No GUID name specified, must be <CName> = <GuidValueInCFormat>.")
-ERR_DECPARSE_CGUID_GUID = \
-_("No GUID value specified, must be <CName> = <GuidValueInCFormat>.")
-ERR_DECPARSE_CGUID_GUIDFORMAT = \
-_("Incorrect GUID value format, must be <GuidValueInCFormat:"
- "{8,4,4,{2,2,2,2,2,2,2,2}}>.")
-ERR_DECPARSE_FILEOPEN = _("Unable to open: [%s].")
-ERR_DECPARSE_SECTION_EMPTY = _("Empty sections are not allowed.")
-ERR_DECPARSE_SECTION_UE = _("Incorrect UserExtentions format. "
- "Must be UserExtenxions.UserId.IdString[.Arch]+.")
-ERR_DECPARSE_SECTION_UE_USERID = _("Invalid UserId, must be underscore"
- "or alphanumeric characters.")
-ERR_DECPARSE_SECTION_UE_IDSTRING = \
- _("Incorrect IdString, must be \" ... \".")
-ERR_DECPARSE_ARCH = \
-_("Unknown arch, must be 'common' or start with upper case letter followed by"
- " zero or more upper case letters and numbers.")
-ERR_DECPARSE_SECTION_COMMA = _("Section cannot end with comma.")
-ERR_DECPARSE_SECTION_COMMON = \
-_("'COMMON' must not be used with specific ARCHs in the same section.")
-ERR_DECPARSE_SECTION_IDENTIFY = \
-_("Section header must start with and end with brackets[].")
-ERR_DECPARSE_SECTION_SUBEMPTY = \
-_("Missing a sub-section name in section: [%s]. "
- "All sub-sections need to have names. ")
-ERR_DECPARSE_SECTION_SUBTOOMANY = _("Too many DOT splits in [%s].")
-ERR_DECPARSE_SECTION_UNKNOW = _("Section name [%s] unknown.")
-ERR_DECPARSE_SECTION_FEATUREFLAG = \
-_("[%s] must not be in the same section as other types of PCD.")
-ERR_DECPARSE_MACRO_PAIR = _("No macro name/value given.")
-ERR_DECPARSE_MACRO_NAME = _("No macro name given.")
-ERR_DECPARSE_MACRO_NAME_UPPER = \
-_("Macro name must start with upper case letter followed "
-"by zero or more upper case letters or numbers. Current macro name is: [%s].")
-ERR_DECPARSE_SECTION_NAME = \
-_('Cannot mix different section names %s.')
-ERR_DECPARSE_BACKSLASH = \
-_('Backslash must be the last character on a line and '
- 'preceded by a space character.')
-ERR_DECPARSE_BACKSLASH_EMPTY = \
-_('Empty line after previous line that has backslash is not allowed.')
-ERR_DECPARSE_REDEFINE = _(
- "\"%s\" already defined in line %d.")
-ERR_DECPARSE_MACRO_RESOLVE = _("Macro %s in %s cannot be resolved.")
-ERR_DECPARSE_UE_DUPLICATE = \
- _("Duplicated UserExtensions header found.")
-
-#
-# Used to print the current line content which cause error raise.
-# Be attached to the end of every error message above.
-#
-ERR_DECPARSE_LINE = _(" Parsing line: \"%s\".")
-
-#
-# Warning related strings.
-#
-WRN_PACKAGE_EXISTED = _(
- "A package with this GUID and Version already exists: "
- "GUID %s, Version %s.")
-WRN_MODULE_EXISTED = _("This module already exists: %s")
-WRN_FILE_EXISTED = _("This file already exists: %s")
-WRN_FILE_NOT_OVERWRITTEN = \
-_("This file already exist and cannot be overwritten: %s")
-WRN_DIST_PKG_INSTALLED = _("This distribution package has been installed")
-WRN_DIST_NOT_FOUND = _(
- "Distribution is not found at location %s")
-WRN_MULTI_PCD_RANGES = _(
- "A PCD can only have one each of @ValidRange, @ValidList, "
- "and @Expression comment")
-WRN_MISSING_USAGE = _("Missing usage")
-WRN_INVALID_GUID_TYPE = _("This is and incorrect Guid type: %s")
-WRN_MISSING_GUID_TYPE = _("Missing Guid Type")
-WRN_INVALID_USAGE = _("This is an incorrect Usage: %s")
-WRN_INF_PARSER_MODULE_INVALID_HOB_TYPE = \
- _("This is an incorrect HOB type: %s")
-WRN_INF_PARSER_MODULE_INVALID_EVENT_TYPE = \
- _("This is an incorrect EVENT type: %s")
-WRN_INF_PARSER_MODULE_INVALID_BOOTMODE_TYPE = \
- _("This is an incorrect BOOTMODE type: %s")
-WRN_INVALID_MODULE_TYPE = \
- _("This is an incorrect Module type: %s")
-WRN_MODULE_PARSE_FAILED = \
- _("Parsing of this module did not complete correctly: %s.")
-WRN_EDK1_INF_FOUND = \
- _("EDK 1 module file found: %s")
-WRN_INVALID_COPYRIGHT = \
- _("Copyright information is not right")
-WARN_SPECIAL_SECTION_LOCATION_WRONG = _("Warning. A special section should be "
- "at the end of a file or at the end of a section.")
-WARN_INSTALLED_PACKAGE_NOT_FOUND = \
- _("File not found. The DEC file for a package cannot be found in GUID/Version/Install path: %s %s %s")
-
-#
-# Help related strings.
-#
-HLP_PRINT_DEBUG_INFO = _(
- "Print DEBUG statements, where DEBUG_LEVEL is 0-9")
-HLP_PRINT_INFORMATIONAL_STATEMENT = _("Print informational statements")
-HLP_RETURN_NO_DISPLAY = _(
- "Returns only the exit code, informational and error messages are"
- " not displayed")
-HLP_RETURN_AND_DISPLAY = _(
- "Returns the exit code and displays error messages only")
-HLP_SPECIFY_PACKAGE_NAME_INSTALL = _(
- "Specify the UEFI Distribution Package filename to install")
-HLP_SPECIFY_PACKAGE_NAME_CREATE = _(
- "Specify the UEFI Distribution Package filename to create")
-HLP_SPECIFY_PACKAGE_NAME_REMOVE = _(
- "Specify the UEFI Distribution Package filename to remove")
-HLP_SPECIFY_TEMPLATE_NAME_CREATE = _(
- "Specify Package Information Data filename to create package")
-HLP_SPECIFY_DEC_NAME_CREATE = _(
- "Specify dec file names to create package")
-HLP_SPECIFY_INF_NAME_CREATE = _(
- "Specify inf file names to create package")
-HLP_NO_SUPPORT_GUI = _(
- "Starting the tool in graphical mode is not supported in this version")
-HLP_DISABLE_PROMPT = _(
- "Disable all user prompts")
-HLP_CUSTOM_PATH_PROMPT = _(
- "Enable user prompting for alternate installation directories")
-HLP_SKIP_LOCK_CHECK = _(
- "Skip the check for multiple instances")
diff --git a/BaseTools/Source/Python/UPT/Logger/ToolError.py b/BaseTools/Source/Python/UPT/Logger/ToolError.py
deleted file mode 100644
index 906d03337c..0000000000
--- a/BaseTools/Source/Python/UPT/Logger/ToolError.py
+++ /dev/null
@@ -1,177 +0,0 @@
-## @file
-# Standardized Error Hanlding infrastructures.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-ToolError
-'''
-
-import Logger.StringTable as ST
-
-FILE_OPEN_FAILURE = 1
-FILE_WRITE_FAILURE = 2
-FILE_PARSE_FAILURE = 3
-FILE_READ_FAILURE = 4
-FILE_CREATE_FAILURE = 5
-FILE_CHECKSUM_FAILURE = 6
-FILE_COMPRESS_FAILURE = 7
-FILE_DECOMPRESS_FAILURE = 8
-FILE_MOVE_FAILURE = 9
-FILE_DELETE_FAILURE = 10
-FILE_COPY_FAILURE = 11
-FILE_POSITIONING_FAILURE = 12
-FILE_ALREADY_EXIST = 13
-FILE_NOT_FOUND = 14
-FILE_TYPE_MISMATCH = 15
-FILE_CASE_MISMATCH = 16
-FILE_DUPLICATED = 17
-FILE_UNKNOWN_ERROR = 0x0FFF
-
-OPTION_UNKNOWN = 0x1000
-OPTION_MISSING = 0x1001
-OPTION_CONFLICT = 0x1002
-OPTION_VALUE_INVALID = 0x1003
-OPTION_DEPRECATED = 0x1004
-OPTION_NOT_SUPPORTED = 0x1005
-OPTION_UNKNOWN_ERROR = 0x1FFF
-
-PARAMETER_INVALID = 0x2000
-PARAMETER_MISSING = 0x2001
-PARAMETER_UNKNOWN_ERROR = 0x2FFF
-
-FORMAT_INVALID = 0x3000
-FORMAT_NOT_SUPPORTED = 0x3001
-FORMAT_UNKNOWN = 0x3002
-FORMAT_UNKNOWN_ERROR = 0x3FFF
-
-RESOURCE_NOT_AVAILABLE = 0x4000
-RESOURCE_ALLOCATE_FAILURE = 0x4001
-RESOURCE_FULL = 0x4002
-RESOURCE_OVERFLOW = 0x4003
-RESOURCE_UNDERRUN = 0x4004
-RESOURCE_UNKNOWN_ERROR = 0x4FFF
-
-ATTRIBUTE_NOT_AVAILABLE = 0x5000
-ATTRIBUTE_GET_FAILURE = 0x5001
-ATTRIBUTE_SET_FAILURE = 0x5002
-ATTRIBUTE_UPDATE_FAILURE = 0x5003
-ATTRIBUTE_ACCESS_DENIED = 0x5004
-ATTRIBUTE_RETRIEVE_FAILURE = 0x5005
-ATTRIBUTE_UNKNOWN_ERROR = 0x5FFF
-ATTRIBUTE_RETRIEVE_FAILURE = 0x5F00
-
-IO_NOT_READY = 0x6000
-IO_BUSY = 0x6001
-IO_TIMEOUT = 0x6002
-IO_UNKNOWN_ERROR = 0x6FFF
-
-COMMAND_FAILURE = 0x7000
-
-CODE_ERROR = 0xC0DE
-
-AUTOGEN_ERROR = 0xF000
-PARSER_ERROR = 0xF001
-BUILD_ERROR = 0xF002
-GENFDS_ERROR = 0xF003
-ECC_ERROR = 0xF004
-EOT_ERROR = 0xF005
-DDC_ERROR = 0xF009
-WARNING_AS_ERROR = 0xF006
-MIGRATION_ERROR = 0xF010
-EDK1_INF_ERROR = 0xF011
-ABORT_ERROR = 0xFFFE
-UNKNOWN_ERROR = 0xFFFF
-
-UPT_ALREADY_INSTALLED_ERROR = 0xD000
-UPT_ENVIRON_MISSING_ERROR = 0xD001
-UPT_REPKG_ERROR = 0xD002
-UPT_ALREADY_RUNNING_ERROR = 0xD003
-UPT_MUL_DEC_ERROR = 0xD004
-UPT_DB_UPDATE_ERROR = 0xD005
-UPT_INI_PARSE_ERROR = 0xE000
-
-## Error message of each error code
-#
-gERROR_MESSAGE = {
- FILE_NOT_FOUND : ST.ERR_FILE_NOT_FOUND,
- FILE_OPEN_FAILURE : ST.ERR_FILE_OPEN_FAILURE,
- FILE_WRITE_FAILURE : ST.ERR_FILE_WRITE_FAILURE,
- FILE_PARSE_FAILURE : ST.ERR_FILE_PARSE_FAILURE,
- FILE_READ_FAILURE : ST.ERR_FILE_READ_FAILURE,
- FILE_CREATE_FAILURE : ST.ERR_FILE_CREATE_FAILURE,
- FILE_CHECKSUM_FAILURE : ST.ERR_FILE_CHECKSUM_FAILURE,
- FILE_COMPRESS_FAILURE : ST.ERR_FILE_COMPRESS_FAILURE,
- FILE_DECOMPRESS_FAILURE : ST.ERR_FILE_DECOMPRESS_FAILURE,
- FILE_MOVE_FAILURE : ST.ERR_FILE_MOVE_FAILURE,
- FILE_DELETE_FAILURE : ST.ERR_FILE_DELETE_FAILURE,
- FILE_COPY_FAILURE : ST.ERR_FILE_COPY_FAILURE,
- FILE_POSITIONING_FAILURE: ST.ERR_FILE_POSITIONING_FAILURE,
- FILE_ALREADY_EXIST : ST.ERR_FILE_ALREADY_EXIST,
- FILE_TYPE_MISMATCH : ST.ERR_FILE_TYPE_MISMATCH ,
- FILE_CASE_MISMATCH : ST.ERR_FILE_CASE_MISMATCH,
- FILE_DUPLICATED : ST.ERR_FILE_DUPLICATED,
- FILE_UNKNOWN_ERROR : ST.ERR_FILE_UNKNOWN_ERROR,
-
- OPTION_UNKNOWN : ST.ERR_OPTION_UNKNOWN,
- OPTION_MISSING : ST.ERR_OPTION_MISSING,
- OPTION_CONFLICT : ST.ERR_OPTION_CONFLICT,
- OPTION_VALUE_INVALID : ST.ERR_OPTION_VALUE_INVALID,
- OPTION_DEPRECATED : ST.ERR_OPTION_DEPRECATED,
- OPTION_NOT_SUPPORTED : ST.ERR_OPTION_NOT_SUPPORTED,
- OPTION_UNKNOWN_ERROR : ST.ERR_OPTION_UNKNOWN_ERROR,
-
- PARAMETER_INVALID : ST.ERR_PARAMETER_INVALID,
- PARAMETER_MISSING : ST.ERR_PARAMETER_MISSING,
- PARAMETER_UNKNOWN_ERROR : ST.ERR_PARAMETER_UNKNOWN_ERROR,
-
- FORMAT_INVALID : ST.ERR_FORMAT_INVALID,
- FORMAT_NOT_SUPPORTED : ST.ERR_FORMAT_NOT_SUPPORTED,
- FORMAT_UNKNOWN : ST.ERR_FORMAT_UNKNOWN,
- FORMAT_UNKNOWN_ERROR : ST.ERR_FORMAT_UNKNOWN_ERROR,
-
- RESOURCE_NOT_AVAILABLE : ST.ERR_RESOURCE_NOT_AVAILABLE,
- RESOURCE_ALLOCATE_FAILURE : ST.ERR_RESOURCE_ALLOCATE_FAILURE,
- RESOURCE_FULL : ST.ERR_RESOURCE_FULL,
- RESOURCE_OVERFLOW : ST.ERR_RESOURCE_OVERFLOW,
- RESOURCE_UNDERRUN : ST.ERR_RESOURCE_UNDERRUN,
- RESOURCE_UNKNOWN_ERROR : ST.ERR_RESOURCE_UNKNOWN_ERROR,
-
- ATTRIBUTE_NOT_AVAILABLE : ST.ERR_ATTRIBUTE_NOT_AVAILABLE,
- ATTRIBUTE_RETRIEVE_FAILURE : ST.ERR_ATTRIBUTE_RETRIEVE_FAILURE,
- ATTRIBUTE_SET_FAILURE : ST.ERR_ATTRIBUTE_SET_FAILURE,
- ATTRIBUTE_UPDATE_FAILURE: ST.ERR_ATTRIBUTE_UPDATE_FAILURE,
- ATTRIBUTE_ACCESS_DENIED : ST.ERR_ATTRIBUTE_ACCESS_DENIED,
- ATTRIBUTE_UNKNOWN_ERROR : ST.ERR_ATTRIBUTE_UNKNOWN_ERROR,
-
- COMMAND_FAILURE : ST.ERR_COMMAND_FAILURE,
-
- IO_NOT_READY : ST.ERR_IO_NOT_READY,
- IO_BUSY : ST.ERR_IO_BUSY,
- IO_TIMEOUT : ST.ERR_IO_TIMEOUT,
- IO_UNKNOWN_ERROR : ST.ERR_IO_UNKNOWN_ERROR,
-
- UNKNOWN_ERROR : ST.ERR_UNKNOWN_ERROR,
-
- UPT_ALREADY_INSTALLED_ERROR : ST.ERR_UPT_ALREADY_INSTALLED_ERROR,
- UPT_ENVIRON_MISSING_ERROR : ST.ERR_UPT_ENVIRON_MISSING_ERROR,
- UPT_REPKG_ERROR : ST.ERR_UPT_REPKG_ERROR,
- UPT_ALREADY_RUNNING_ERROR : ST.ERR_UPT_ALREADY_RUNNING_ERROR,
- UPT_MUL_DEC_ERROR : ST.ERR_MUL_DEC_ERROR,
- UPT_INI_PARSE_ERROR : ST.ERR_UPT_INI_PARSE_ERROR,
-}
-
-## Exception indicating a fatal error
-#
-class FatalError(Exception):
- pass
-
diff --git a/BaseTools/Source/Python/UPT/Logger/__init__.py b/BaseTools/Source/Python/UPT/Logger/__init__.py
deleted file mode 100644
index 2881ac7711..0000000000
--- a/BaseTools/Source/Python/UPT/Logger/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Logger' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Logger
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Makefile b/BaseTools/Source/Python/UPT/Makefile
deleted file mode 100644
index d4eef45196..0000000000
--- a/BaseTools/Source/Python/UPT/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-## @file
-# Windows makefile for UPT tools build.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-!IFNDEF PYTHON_FREEZER_PATH
-!ERROR PYTHON_FREEZER_PATH must be defined!
-!ENDIF
-
-FREEZE=$(PYTHON_FREEZER_PATH)\FreezePython.exe
-
-MODULES=encodings.cp437,encodings.gbk,encodings.utf_16,encodings.utf_8,encodings.utf_16_le,encodings.latin_1,encodings.ascii
-
-BIN_DIR = .\Bin
-SOURCES_PATH = .
-
-APPLICATIONS=$(BIN_DIR)\UPT.exe
-
-UPT_BUILDVERSION_PYTHON=$(SOURCES_PATH)\BuildVersion.py
-
-all: SetPythonPath $(APPLICATIONS)
-
-SetPythonPath:
- set PYTHONPATH= $(SOURCES_PATH)
-
-$(BIN_DIR)\UPT.exe: $(SOURCES_PATH)\UPT.py $(UPT_BUILDVERSION_PYTHON)
- @pushd . & @cd build & @$(FREEZE) --include-modules=$(MODULES) --install-dir=$(BIN_DIR) UPT.py & @popd
- @pushd . & @copy .\Dll\sqlite3.dll .\Bin\Sqlite3.dll & @popd
-clean:
-cleanall:
- @del /f /q $(BIN_DIR)\*.pyd $(BIN_DIR)\*.dll
- @for %%i in ($(APPLICATIONS)) do @del /f /q %%i
-
diff --git a/BaseTools/Source/Python/UPT/MkPkg.py b/BaseTools/Source/Python/UPT/MkPkg.py
deleted file mode 100644
index b8b78e4515..0000000000
--- a/BaseTools/Source/Python/UPT/MkPkg.py
+++ /dev/null
@@ -1,281 +0,0 @@
-## @file
-# Install distribution package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-MkPkg
-'''
-
-##
-# Import Modules
-#
-from os import remove
-from os import getcwd
-from os import chdir
-import os.path
-from sys import stdin
-from sys import platform
-from traceback import format_exc
-from platform import python_version
-import md5
-from time import strftime
-from time import localtime
-from uuid import uuid4
-
-from Logger import StringTable as ST
-from Logger.ToolError import OPTION_UNKNOWN_ERROR
-from Logger.ToolError import OPTION_VALUE_INVALID
-from Logger.ToolError import ABORT_ERROR
-from Logger.ToolError import UPT_REPKG_ERROR
-from Logger.ToolError import CODE_ERROR
-from Logger.ToolError import FatalError
-from Logger.ToolError import FILE_NOT_FOUND
-import Logger.Log as Logger
-
-from Xml.XmlParser import DistributionPackageXml
-from Xml.IniToXml import IniToXml
-
-from Library.Misc import CheckEnvVariable
-from Library import GlobalData
-from Library.ParserValidate import IsValidPath
-
-from Core.DistributionPackageClass import DistributionPackageClass
-from Core.PackageFile import PackageFile
-
-## CheckForExistingDp
-#
-# Check if there is a same name DP file existing
-# @param Path: The path to be checked
-#
-def CheckForExistingDp(Path):
- if os.path.exists(Path):
- Logger.Info(ST.MSG_DISTRIBUTION_PACKAGE_FILE_EXISTS % Path)
- Input = stdin.readline()
- Input = Input.replace('\r', '').replace('\n', '')
- if Input.upper() != "Y":
- Logger.Error("\nMkPkg", ABORT_ERROR, ST.ERR_USER_ABORT, RaiseError=True)
-
-## Tool entrance method
-#
-# This method mainly dispatch specific methods per the command line options.
-# If no error found, return zero value so the caller of this tool can know
-# if it's executed successfully or not.
-#
-#
-def Main(Options = None):
- if Options == None:
- Logger.Error("\nMkPkg", OPTION_UNKNOWN_ERROR, ST.ERR_OPTION_NOT_FOUND)
- try:
- DataBase = GlobalData.gDB
- ContentFileClosed = True
- CheckEnvVariable()
- WorkspaceDir = GlobalData.gWORKSPACE
-
- #
- # Init PackFileToCreate
- #
- if not Options.PackFileToCreate:
- Logger.Error("\nMkPkg", OPTION_UNKNOWN_ERROR, ST.ERR_OPTION_NOT_FOUND)
-
- #
- # Handle if the distribution package file already exists
- #
- CheckForExistingDp(Options.PackFileToCreate)
-
- #
- # Check package file existing and valid
- #
- CheckFileList('.DEC', Options.PackageFileList, ST.ERR_INVALID_PACKAGE_NAME, ST.ERR_INVALID_PACKAGE_PATH)
- #
- # Check module file existing and valid
- #
- CheckFileList('.INF', Options.ModuleFileList, ST.ERR_INVALID_MODULE_NAME, ST.ERR_INVALID_MODULE_PATH)
-
- #
- # Get list of files that installed with RePackage attribute available
- #
- RePkgDict = DataBase.GetRePkgDict()
-
- ContentFile = PackageFile(GlobalData.gCONTENT_FILE, "w")
- ContentFileClosed = False
-
- #
- # Add temp distribution header
- #
- if Options.PackageInformationDataFile:
- XmlFile = IniToXml(Options.PackageInformationDataFile)
- DistPkg = DistributionPackageXml().FromXml(XmlFile)
- remove(XmlFile)
-
- #
- # add distribution level tool/misc files
- # before pack, current dir should be workspace dir, else the full
- # path will be in the pack file
- #
- Cwd = getcwd()
- chdir(WorkspaceDir)
- ToolObject = DistPkg.Tools
- MiscObject = DistPkg.MiscellaneousFiles
- FileList = []
- if ToolObject:
- FileList += ToolObject.GetFileList()
- if MiscObject:
- FileList += MiscObject.GetFileList()
- for FileObject in FileList:
- #
- # If you have unicode file names, please convert them to byte
- # strings in your desired encoding before passing them to
- # write().
- #
- FromFile = os.path.normpath(FileObject.GetURI()).encode('utf_8')
- FileFullPath = os.path.normpath(os.path.join(WorkspaceDir, FromFile))
- if FileFullPath in RePkgDict:
- (DpGuid, DpVersion, DpName, Repackage) = RePkgDict[FileFullPath]
- if not Repackage:
- Logger.Error("\nMkPkg",
- UPT_REPKG_ERROR,
- ST.ERR_UPT_REPKG_ERROR,
- ExtraData=ST.MSG_REPKG_CONFLICT %\
- (FileFullPath, DpGuid, DpVersion, DpName)
- )
- else:
- DistPkg.Header.RePackage = True
- ContentFile.PackFile(FromFile)
- chdir(Cwd)
-
- #
- # Add init dp information
- #
- else:
- DistPkg = DistributionPackageClass()
- DistPkg.Header.Name = 'Distribution Package'
- DistPkg.Header.Guid = str(uuid4())
- DistPkg.Header.Version = '1.0'
-
- DistPkg.GetDistributionPackage(WorkspaceDir, Options.PackageFileList, \
- Options.ModuleFileList)
- FileList, MetaDataFileList = DistPkg.GetDistributionFileList()
- for File in FileList + MetaDataFileList:
- FileFullPath = os.path.normpath(os.path.join(WorkspaceDir, File))
- #
- # check whether file was included in a distribution that can not
- # be repackaged
- #
- if FileFullPath in RePkgDict:
- (DpGuid, DpVersion, DpName, Repackage) = RePkgDict[FileFullPath]
- if not Repackage:
- Logger.Error("\nMkPkg",
- UPT_REPKG_ERROR,
- ST.ERR_UPT_REPKG_ERROR,
- ExtraData = \
- ST.MSG_REPKG_CONFLICT %(FileFullPath, DpName, \
- DpGuid, DpVersion)
- )
- else:
- DistPkg.Header.RePackage = True
-
- Cwd = getcwd()
- chdir(WorkspaceDir)
- ContentFile.PackFiles(FileList)
- chdir(Cwd)
-
- Logger.Verbose(ST.MSG_COMPRESS_DISTRIBUTION_PKG)
-
- ContentFile.Close()
- ContentFileClosed = True
-
- #
- # Add Md5Sigature
- #
- DistPkg.Header.Signature = md5.new(open(str(ContentFile), 'rb').read()).hexdigest()
- #
- # Add current Date
- #
- DistPkg.Header.Date = str(strftime("%Y-%m-%dT%H:%M:%S", localtime()))
-
- #
- # Finish final dp file
- #
- DistPkgFile = PackageFile(Options.PackFileToCreate, "w")
- DistPkgFile.PackFile(str(ContentFile))
- DistPkgXml = DistributionPackageXml()
- DistPkgFile.PackData(DistPkgXml.ToXml(DistPkg), GlobalData.gDESC_FILE)
- DistPkgFile.Close()
- Logger.Quiet(ST.MSG_FINISH)
- ReturnCode = 0
-
- except FatalError, XExcept:
- ReturnCode = XExcept.args[0]
- if Logger.GetLevel() <= Logger.DEBUG_9:
- Logger.Quiet(ST.MSG_PYTHON_ON % \
- (python_version(), platform) + format_exc())
- except KeyboardInterrupt:
- ReturnCode = ABORT_ERROR
- if Logger.GetLevel() <= Logger.DEBUG_9:
- Logger.Quiet(ST.MSG_PYTHON_ON % \
- (python_version(), platform) + format_exc())
- except OSError:
- pass
- except:
- Logger.Error(
- "\nMkPkg",
- CODE_ERROR,
- ST.ERR_UNKNOWN_FATAL_CREATING_ERR % \
- Options.PackFileToCreate,
- ExtraData=ST.MSG_SEARCH_FOR_HELP,
- RaiseError=False
- )
- Logger.Quiet(ST.MSG_PYTHON_ON % \
- (python_version(), platform) + format_exc())
- ReturnCode = CODE_ERROR
- finally:
- if os.path.exists(GlobalData.gCONTENT_FILE):
- if not ContentFileClosed:
- ContentFile.Close()
- os.remove(GlobalData.gCONTENT_FILE)
-
- return ReturnCode
-
-
-## CheckFileList
-#
-# @param QualifiedExt: QualifiedExt
-# @param FileList: FileList
-# @param ErrorStringExt: ErrorStringExt
-# @param ErrorStringFullPath: ErrorStringFullPath
-#
-def CheckFileList(QualifiedExt, FileList, ErrorStringExt, ErrorStringFullPath):
- if not FileList:
- return
- WorkspaceDir = GlobalData.gWORKSPACE
- WorkspaceDir = os.path.normpath(WorkspaceDir)
- for Item in FileList:
- Ext = os.path.splitext(Item)[1]
- if Ext.upper() != QualifiedExt.upper():
- Logger.Error("\nMkPkg", OPTION_VALUE_INVALID, \
- ErrorStringExt % Item)
-
- Item = os.path.normpath(Item)
- Path = os.path.normpath(os.path.join(WorkspaceDir, Item))
- if not os.path.exists(Path):
- Logger.Error("\nMkPkg", FILE_NOT_FOUND, ST.ERR_NOT_FOUND % Item)
- elif Item == Path:
- Logger.Error("\nMkPkg", OPTION_VALUE_INVALID,
- ErrorStringFullPath % Item)
- elif not IsValidPath(Item, WorkspaceDir):
- Logger.Error("\nMkPkg", OPTION_VALUE_INVALID, \
- ErrorStringExt % Item)
-
- if not os.path.split(Item)[0]:
- Logger.Error("\nMkPkg", OPTION_VALUE_INVALID, \
- ST.ERR_INVALID_METAFILE_PATH % Item)
diff --git a/BaseTools/Source/Python/UPT/Object/POM/CommonObject.py b/BaseTools/Source/Python/UPT/Object/POM/CommonObject.py
deleted file mode 100644
index 1418a2f4bd..0000000000
--- a/BaseTools/Source/Python/UPT/Object/POM/CommonObject.py
+++ /dev/null
@@ -1,789 +0,0 @@
-## @file
-# This file is used to define common items of class object
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-Common Object
-'''
-from Library.DataType import LANGUAGE_EN_US
-
-## HelpTextObject
-#
-# @param object: Inherited from object class
-#
-class HelpTextObject(object):
- def __init__(self):
- self.HelpText = TextObject()
-
- def SetHelpText(self, HelpText):
- self.HelpText = HelpText
-
- def GetHelpText(self):
- return self.HelpText
-
-## HelpTextListObject
-#
-# @param object: Inherited from object class
-#
-class HelpTextListObject(object):
- def __init__(self):
- self.HelpTextList = []
-
- def SetHelpTextList(self, HelpTextList):
- self.HelpTextList = HelpTextList
-
- def GetHelpTextList(self):
- return self.HelpTextList
-
-## CommonPropertiesObject
-#
-# This class defined common attribution used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-# @param Usage: Input value for Usage, default is []
-# @param FeatureFlag: Input value for FeatureFalg, default is ''
-# @param SupArchList: Input value for SupArchList, default is []
-# @param HelpText: Input value for HelpText, default is ''
-# @param HelpTextList: Input value for HelpTextList, default is []
-#
-class CommonPropertiesObject(HelpTextObject, HelpTextListObject):
- def __init__(self):
- self.Usage = []
- self.FeatureFlag = ''
- self.SupArchList = []
- HelpTextObject.__init__(self)
- HelpTextListObject.__init__(self)
-
- def SetUsage(self, Usage):
- self.Usage = Usage
-
- def GetUsage(self):
- return self.Usage
-
- def SetFeatureFlag(self, FeatureFlag):
- self.FeatureFlag = FeatureFlag
-
- def GetFeatureFlag(self):
- return self.FeatureFlag
-
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
-
- def GetSupArchList(self):
- return self.SupArchList
-
-## CommonHeaderObject
-#
-# This class defined common header items used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-#
-class CommonHeaderObject(object):
- def __init__(self):
- self.Abstract = ''
- self.Description = ''
- self.Copyright = ''
- self.License = ''
-
- def SetAbstract(self, Abstract):
- self.Abstract = Abstract
-
- def GetAbstract(self):
- return self.Abstract
-
- def SetDescription(self, Description):
- self.Description = Description
-
- def GetDescription(self):
- return self.Description
-
- def SetCopyright(self, Copyright):
- self.Copyright = Copyright
-
- def GetCopyright(self):
- return self.Copyright
-
- def SetLicense(self, License):
- self.License = License
-
- def GetLicense(self):
- return self.License
-
-## ClonedRecordObject
-#
-# This class defined ClonedRecord items used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-#
-class ClonedRecordObject(object):
- def __init__(self):
- self.IdNum = 0
- self.FarGuid = ''
- self.PackageGuid = ''
- self.PackageVersion = ''
- self.ModuleGuid = ''
- self.ModuleVersion = ''
-
- def SetId(self, IdNo):
- self.IdNum = IdNo
-
- def GetId(self):
- return self.IdNum
-
- def SetFarGuid(self, FarGuid):
- self.FarGuid = FarGuid
-
- def GetFarGuid(self):
- return self.FarGuid
-
- def SetPackageGuid(self, PackageGuid):
- self.PackageGuid = PackageGuid
-
- def GetPackageGuid(self):
- return self.PackageGuid
-
- def SetPackageVersion(self, PackageVersion):
- self.PackageVersion = PackageVersion
-
- def GetPackageVersion(self):
- return self.PackageVersion
-
- def SetModuleGuid(self, ModuleGuid):
- self.ModuleGuid = ModuleGuid
-
- def GetModuleGuid(self):
- return self.ModuleGuid
-
- def SetModuleVersion(self, ModuleVersion):
- self.ModuleVersion = ModuleVersion
-
- def GetModuleVersion(self):
- return self.ModuleVersion
-
-## TextObject
-#
-# This class defined Text item used in PKG file
-#
-# @param object: Inherited from object class
-#
-class TextObject(object):
- def __init__(self):
- self.Lang = LANGUAGE_EN_US
- self.String = ''
-
- def SetLang(self, Lang):
- self.Lang = Lang
-
- def GetLang(self):
- return self.Lang
-
- def SetString(self, String):
- self.String = String
-
- def GetString(self):
- return self.String
-
-## FileNameObject
-#
-# This class defined File item used in module, for binary files
-#
-# @param CommonPropertiesObject: Inherited from CommonPropertiesObject class
-#
-class FileNameObject(CommonPropertiesObject):
- def __init__(self):
- self.FileType = ''
- self.Filename = ''
- CommonPropertiesObject.__init__(self)
-
- def SetFileType(self, FileType):
- self.FileType = FileType
-
- def GetFileType(self):
- return self.FileType
-
- def SetFilename(self, Filename):
- self.Filename = Filename
-
- def GetFilename(self):
- return self.Filename
-
-## FileObject
-#
-# This class defined File item used in PKG file
-#
-# @param object: Inherited from object class
-#
-class FileObject(object):
- def __init__(self):
- self.Executable = ''
- self.Uri = ''
- self.OsType = ''
-
- def SetExecutable(self, Executable):
- self.Executable = Executable
-
- def GetExecutable(self):
- return self.Executable
-
- def SetURI(self, URI):
- self.Uri = URI
-
- def GetURI(self):
- return self.Uri
-
- def SetOS(self, OsType):
- self.OsType = OsType
-
- def GetOS(self):
- return self.OsType
-
-##
-# MiscFileObject is used for xml
-#
-# @param CommonHeaderObject: Inherited from CommonHeaderObject class
-#
-class MiscFileObject(CommonHeaderObject):
- def __init__(self):
- self.Name = ''
- self.FileList = []
- CommonHeaderObject.__init__(self)
-
- def SetName(self, Name):
- self.Name = Name
-
- def GetName(self):
- return self.Name
-
- def SetFileList(self, FileList):
- self.FileList = FileList
-
- def GetFileList(self):
- return self.FileList
-
-##
-# ToolsObject
-#
-class ToolsObject(MiscFileObject):
- pass
-
-## GuidVersionObject
-#
-# This class defined GUID/Version items used in PKG file
-#
-# @param object: Inherited from object class
-#
-class GuidVersionObject(object):
- def __init__(self):
- self.Guid = ''
- self.Version = ''
-
- def SetGuid(self, Guid):
- self.Guid = Guid
-
- def GetGuid(self):
- return self.Guid
-
- def SetVersion(self, Version):
- self.Version = Version
-
- def GetVersion(self):
- return self.Version
-
-## IdentificationObject
-#
-# This class defined Identification items used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-#
-class IdentificationObject(GuidVersionObject):
- def __init__(self):
- self.Name = ''
- self.BaseName = ''
- self.FileName = ''
- self.FullPath = ''
- self.RelaPath = ''
- self.PackagePath = ''
- self.ModulePath = ''
- self.CombinePath = ''
- GuidVersionObject.__init__(self)
-
- def SetName(self, Name):
- self.Name = Name
-
- def GetName(self):
- return self.Name
-
- def SetBaseName(self, BaseName):
- self.BaseName = BaseName
-
- def GetBaseName(self):
- return self.BaseName
-
- def SetFileName(self, FileName):
- self.FileName = FileName
-
- def GetFileName(self):
- return self.FileName
-
- def SetFullPath(self, FullPath):
- self.FullPath = FullPath
-
- def GetFullPath(self):
- return self.FullPath
-
- def SetRelaPath(self, RelaPath):
- self.RelaPath = RelaPath
-
- def GetRelaPath(self):
- return self.RelaPath
-
- def SetPackagePath(self, PackagePath):
- self.PackagePath = PackagePath
-
- def GetPackagePath(self):
- return self.PackagePath
-
- def SetModulePath(self, ModulePath):
- self.ModulePath = ModulePath
-
- def GetModulePath(self):
- return self.ModulePath
-
- def SetCombinePath(self, CombinePath):
- self.CombinePath = CombinePath
-
- def GetCombinePath(self):
- return self.CombinePath
-
-## GuidProtocolPpiCommonObject
-#
-# This class defined Guid, Protocol and Ppi like items used in
-# Module/Platform/Package files
-#
-# @param CommonPropertiesObject: Inherited from CommonPropertiesObject class
-#
-class GuidProtocolPpiCommonObject(CommonPropertiesObject):
- def __init__(self):
- self.Name = ''
- self.CName = ''
- self.Guid = ''
- self.SupModuleList = []
- CommonPropertiesObject.__init__(self)
-
- def SetName(self, Name):
- self.Name = Name
-
- def GetName(self):
- return self.Name
-
- def SetCName(self, CName):
- self.CName = CName
-
- def GetCName(self):
- return self.CName
-
- def SetGuid(self, Guid):
- self.Guid = Guid
-
- def GetGuid(self):
- return self.Guid
-
- def SetSupModuleList(self, SupModuleList):
- self.SupModuleList = SupModuleList
-
- def GetSupModuleList(self):
- return self.SupModuleList
-
-## GuidObject
-#
-# This class defined Guid item used in Module/Platform/Package files
-#
-# @param GuidProtocolPpiCommonObject: GuidProtocolPpiCommonObject
-#
-class GuidObject(GuidProtocolPpiCommonObject):
- def __init__(self):
- self.VariableName = ''
- self.GuidTypeList = []
- GuidProtocolPpiCommonObject.__init__(self)
- def SetVariableName(self, VariableName):
- self.VariableName = VariableName
-
- def GetVariableName(self):
- return self.VariableName
-
- def SetGuidTypeList(self, GuidTypeList):
- self.GuidTypeList = GuidTypeList
-
- def GetGuidTypeList(self):
- return self.GuidTypeList
-
-## ProtocolObject
-#
-# This class defined Protocol item used in Module/Platform/Package files
-#
-# @param GuidProtocolPpiCommonObject: Inherited from
-# GuidProtocolPpiCommonObject
-#
-class ProtocolObject(GuidProtocolPpiCommonObject):
- def __init__(self):
- self.Notify = False
- GuidProtocolPpiCommonObject.__init__(self)
- def SetNotify(self, Notify):
- self.Notify = Notify
-
- def GetNotify(self):
- return self.Notify
-
-## PpiObject
-#
-# This class defined Ppi item used in Module/Platform/Package files
-#
-# @param GuidProtocolPpiCommonObject: Inherited from
-# GuidProtocolPpiCommonObject
-#
-class PpiObject(GuidProtocolPpiCommonObject):
- def __init__(self):
- self.Notify = False
- GuidProtocolPpiCommonObject.__init__(self)
- def SetNotify(self, Notify):
- self.Notify = Notify
-
- def GetNotify(self):
- return self.Notify
-
-## DefineObject
-#
-# This class defined item DEFINE used in Module/Platform/Package files
-#
-# @param object: Inherited from object class
-#
-class DefineClass(object):
- def __init__(self):
- self.Define = {}
-
-## UserExtensionObject
-#
-# @param object: Inherited from object class
-#
-class UserExtensionObject(object):
- def __init__(self):
- self.UserID = ''
- self.Identifier = ''
- #
- # { Statement : Arch , ... }
- #
- self.DefinesDict = {}
- #
- # { Arch : Statement , ... }
- #
- self.BuildOptionDict = {}
- self.IncludesDict = {}
- self.SourcesDict = {}
- self.BinariesDict = {}
- #
- # UserExtension statement from meta-data file [UserExtension] section
- #
- self.Statement = ''
- self.SupArchList = []
-
- def SetStatement(self, Statement):
- self.Statement = Statement
-
- def GetStatement(self):
- return self.Statement
-
- def SetSupArchList(self, ArchList):
- self.SupArchList = ArchList
-
- def GetSupArchList(self):
- return self.SupArchList
-
- def SetUserID(self, UserID):
- self.UserID = UserID
-
- def GetUserID(self):
- return self.UserID
-
- def SetIdentifier(self, Identifier):
- self.Identifier = Identifier
-
- def GetIdentifier(self):
- return self.Identifier
-
- def SetDefinesDict(self, DefinesDict):
- self.DefinesDict = DefinesDict
-
- def GetDefinesDict(self):
- return self.DefinesDict
-
- def SetBuildOptionDict(self, BuildOptionDict):
- self.BuildOptionDict = BuildOptionDict
-
- def GetBuildOptionDict(self):
- return self.BuildOptionDict
-
- def SetIncludesDict(self, IncludesDict):
- self.IncludesDict = IncludesDict
-
- def GetIncludesDict(self):
- return self.IncludesDict
-
- def SetSourcesDict(self, SourcesDict):
- self.SourcesDict = SourcesDict
-
- def GetSourcesDict(self):
- return self.SourcesDict
-
- def SetBinariesDict(self, BinariesDict):
- self.BinariesDict = BinariesDict
-
- def GetBinariesDict(self):
- return self.BinariesDict
-
-## LibraryClassObject
-#
-# This class defined Library item used in Module/Platform/Package files
-#
-# @param CommonPropertiesObject: Inherited from CommonPropertiesObject class
-#
-class LibraryClassObject(CommonPropertiesObject):
- def __init__(self):
- self.LibraryClass = ''
- self.IncludeHeader = ''
- self.SupModuleList = []
- self.RecommendedInstance = GuidVersionObject()
- CommonPropertiesObject.__init__(self)
-
- def SetLibraryClass(self, LibraryClass):
- self.LibraryClass = LibraryClass
-
- def GetLibraryClass(self):
- return self.LibraryClass
-
- def SetSupModuleList(self, SupModuleList):
- self.SupModuleList = SupModuleList
-
- def GetSupModuleList(self):
- return self.SupModuleList
-
- def SetIncludeHeader(self, IncludeHeader):
- self.IncludeHeader = IncludeHeader
-
- def GetIncludeHeader(self):
- return self.IncludeHeader
-
- def SetRecommendedInstance(self, RecommendedInstance):
- self.RecommendedInstance = RecommendedInstance
-
- def GetRecommendedInstance(self):
- return self.RecommendedInstance
-
-
-## PcdErrorObject
-#
-# @param object: Inherited from object class
-#
-class PcdErrorObject(object):
- def __init__(self):
- self.ValidValue = ''
- self.ValidValueLang = ''
- self.ValidValueRange = ''
- self.Expression = ''
- self.ErrorNumber = ''
- self.ErrorMessageList = []
-
- def SetValidValue(self, ValidValue):
- self.ValidValue = ValidValue
-
- def GetValidValue(self):
- return self.ValidValue
-
- def SetValidValueLang(self, ValidValueLang):
- self.ValidValueLang = ValidValueLang
-
- def GetValidValueLang(self):
- return self.ValidValueLang
-
- def SetValidValueRange(self, ValidValueRange):
- self.ValidValueRange = ValidValueRange
-
- def GetValidValueRange(self):
- return self.ValidValueRange
-
- def SetExpression(self, Expression):
- self.Expression = Expression
-
- def GetExpression(self):
- return self.Expression
-
- def SetErrorNumber(self, ErrorNumber):
- self.ErrorNumber = ErrorNumber
-
- def GetErrorNumber(self):
- return self.ErrorNumber
-
- def SetErrorMessageList(self, ErrorMessageList):
- self.ErrorMessageList = ErrorMessageList
-
- def GetErrorMessageList(self):
- return self.ErrorMessageList
-
-
-## IncludeObject
-#
-# This class defined Include item used in Module/Platform/Package files
-#
-# @param CommonPropertiesObject: Inherited from CommonPropertiesObject class
-#
-class IncludeObject(CommonPropertiesObject):
- def __init__(self):
- self.FilePath = ''
- self.ModuleType = ''
- self.SupModuleList = []
- self.Comment = ''
- CommonPropertiesObject.__init__(self)
-
- def SetFilePath(self, FilePath):
- self.FilePath = FilePath
-
- def GetFilePath(self):
- return self.FilePath
-
- def SetModuleType(self, ModuleType):
- self.ModuleType = ModuleType
-
- def GetModuleType(self):
- return self.ModuleType
-
- def SetSupModuleList(self, SupModuleList):
- self.SupModuleList = SupModuleList
-
- def GetSupModuleList(self):
- return self.SupModuleList
-
- def SetComment(self, Comment):
- self.Comment = Comment
-
- def GetComment(self):
- return self.Comment
-
-## PcdObject
-#
-# This class defined Pcd item used in Module/Platform/Package files
-#
-# @param CName: Input value for CName, default is ''
-# @param Token: Input value for Token, default is ''
-# @param TokenSpaceGuidCName: Input value for TokenSpaceGuidCName, default is
-# ''
-# @param DatumType: Input value for DatumType, default is ''
-# @param MaxDatumSize: Input value for MaxDatumSize, default is ''
-# @param DefaultValue: Input value for DefaultValue, default is ''
-# @param ItemType: Input value for ItemType, default is ''
-# @param ValidUsage: Input value for ValidUsage, default is []
-# @param SkuInfoList: Input value for SkuInfoList, default is {}
-# @param SupModuleList: Input value for SupModuleList, default is []
-#
-class PcdObject(CommonPropertiesObject, HelpTextListObject):
- def __init__(self):
- self.PcdCName = ''
- self.CName = ''
- self.Token = ''
- self.TokenSpaceGuidCName = ''
- self.TokenSpaceGuidValue = ''
- self.DatumType = ''
- self.MaxDatumSize = ''
- self.DefaultValue = ''
- self.Offset = ''
- self.ValidUsage = ''
- self.ItemType = ''
- self.PcdErrorsList = []
- self.SupModuleList = []
- CommonPropertiesObject.__init__(self)
- HelpTextListObject.__init__(self)
-
- def SetPcdCName(self, PcdCName):
- self.PcdCName = PcdCName
-
- def GetPcdCName(self):
- return self.PcdCName
-
- def SetCName(self, CName):
- self.CName = CName
-
- def GetCName(self):
- return self.CName
-
- def SetToken(self, Token):
- self.Token = Token
-
- def GetOffset(self):
- return self.Offset
-
- def SetOffset(self, Offset):
- self.Offset = Offset
-
- def GetToken(self):
- return self.Token
-
- def SetTokenSpaceGuidCName(self, TokenSpaceGuidCName):
- self.TokenSpaceGuidCName = TokenSpaceGuidCName
-
- def GetTokenSpaceGuidCName(self):
- return self.TokenSpaceGuidCName
-
- def SetTokenSpaceGuidValue(self, TokenSpaceGuidValue):
- self.TokenSpaceGuidValue = TokenSpaceGuidValue
-
- def GetTokenSpaceGuidValue(self):
- return self.TokenSpaceGuidValue
-
- def SetDatumType(self, DatumType):
- self.DatumType = DatumType
-
- def GetDatumType(self):
- return self.DatumType
-
- def SetMaxDatumSize(self, MaxDatumSize):
- self.MaxDatumSize = MaxDatumSize
-
- def GetMaxDatumSize(self):
- return self.MaxDatumSize
-
- def SetDefaultValue(self, DefaultValue):
- self.DefaultValue = DefaultValue
-
- def GetDefaultValue(self):
- return self.DefaultValue
-
- def SetValidUsage(self, ValidUsage):
- self.ValidUsage = ValidUsage
-
- def GetValidUsage(self):
- return self.ValidUsage
-
- def SetPcdErrorsList(self, PcdErrorsList):
- self.PcdErrorsList = PcdErrorsList
-
- def GetPcdErrorsList(self):
- return self.PcdErrorsList
-
- def SetItemType(self, ItemType):
- self.ItemType = ItemType
-
- def GetItemType(self):
- return self.ItemType
-
- def SetSupModuleList(self, SupModuleList):
- self.SupModuleList = SupModuleList
-
- def GetSupModuleList(self):
- return self.SupModuleList
diff --git a/BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py b/BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py
deleted file mode 100644
index 620bbb411f..0000000000
--- a/BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py
+++ /dev/null
@@ -1,645 +0,0 @@
-## @file
-# This file is used to define a class object to describe a module
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-ModuleObject
-'''
-
-##
-# Import Modules
-#
-from Object.POM.CommonObject import CommonPropertiesObject
-from Object.POM.CommonObject import IdentificationObject
-from Object.POM.CommonObject import CommonHeaderObject
-from Object.POM.CommonObject import HelpTextListObject
-from Object.POM.CommonObject import GuidVersionObject
-
-
-##
-# BootModeObject
-#
-class BootModeObject(CommonPropertiesObject, HelpTextListObject):
- def __init__(self):
- self.SupportedBootModes = ''
- CommonPropertiesObject.__init__(self)
- HelpTextListObject.__init__(self)
-
- def SetSupportedBootModes(self, SupportedBootModes):
- self.SupportedBootModes = SupportedBootModes
-
- def GetSupportedBootModes(self):
- return self.SupportedBootModes
-
-##
-# EventObject
-#
-class EventObject(CommonPropertiesObject, HelpTextListObject):
- def __init__(self):
- self.EventType = ''
- CommonPropertiesObject.__init__(self)
- HelpTextListObject.__init__(self)
-
- def SetEventType(self, EventType):
- self.EventType = EventType
-
- def GetEventType(self):
- return self.EventType
-
-##
-# HobObject
-#
-class HobObject(CommonPropertiesObject, HelpTextListObject):
- def __init__(self):
- self.HobType = ''
- CommonPropertiesObject.__init__(self)
- HelpTextListObject.__init__(self)
-
- def SetHobType(self, HobType):
- self.HobType = HobType
-
- def GetHobType(self):
- return self.HobType
-
-##
-# SpecObject
-#
-class SpecObject(object):
- def __init__(self):
- self.Spec = ''
- self.Version = ''
-
- def SetSpec(self, Spec):
- self.Spec = Spec
-
- def GetSpec(self):
- return self.Spec
-
- def SetVersion(self, Version):
- self.Version = Version
-
- def GetVersion(self):
- return self.Version
-
-## ModuleHeaderObject
-#
-# This class defined header items used in Module file
-#
-class ModuleHeaderObject(IdentificationObject, CommonHeaderObject):
- def __init__(self):
- self.IsLibrary = False
- self.IsLibraryModList = []
- self.ModuleType = ''
- self.BinaryModule = False
- self.PcdIsDriver = ''
- self.PiSpecificationVersion = ''
- self.UefiSpecificationVersion = ''
- #
- # SpecObject
- #
- self.SpecList = []
- #
- # BootModeObject
- #
- self.BootModeList = []
- #
- # EventObject
- #
- self.EventList = []
- #
- # HobObject
- #
- self.HobList = []
- #
- # LibraryClassObject
- #
- self.LibraryClassList = []
- self.SupArchList = []
- IdentificationObject.__init__(self)
- CommonHeaderObject.__init__(self)
-
- def SetIsLibrary(self, IsLibrary):
- self.IsLibrary = IsLibrary
-
- def GetIsLibrary(self):
- return self.IsLibrary
-
- def SetIsLibraryModList(self, IsLibraryModList):
- self.IsLibraryModList = IsLibraryModList
-
- def GetIsLibraryModList(self):
- return self.IsLibraryModList
-
- def SetModuleType(self, ModuleType):
- self.ModuleType = ModuleType
-
- def GetModuleType(self):
- return self.ModuleType
-
- def SetBinaryModule(self, BinaryModule):
- self.BinaryModule = BinaryModule
-
- def GetBinaryModule(self):
- return self.BinaryModule
-
- def SetPcdIsDriver(self, PcdIsDriver):
- self.PcdIsDriver = PcdIsDriver
-
- def GetPcdIsDriver(self):
- return self.PcdIsDriver
-
- def SetPiSpecificationVersion(self, PiSpecificationVersion):
- self.PiSpecificationVersion = PiSpecificationVersion
-
- def GetPiSpecificationVersion(self):
- return self.PiSpecificationVersion
-
- def SetUefiSpecificationVersion(self, UefiSpecificationVersion):
- self.UefiSpecificationVersion = UefiSpecificationVersion
-
- def GetUefiSpecificationVersion(self):
- return self.UefiSpecificationVersion
-
- def SetSpecList(self, SpecList):
- self.SpecList = SpecList
-
- def GetSpecList(self):
- return self.SpecList
-
- def SetBootModeList(self, BootModeList):
- self.BootModeList = BootModeList
-
- def GetBootModeList(self):
- return self.BootModeList
-
- def SetEventList(self, EventList):
- self.EventList = EventList
-
- def GetEventList(self):
- return self.EventList
-
- def SetHobList(self, HobList):
- self.HobList = HobList
-
- def GetHobList(self):
- return self.HobList
-
- def SetLibraryClassList(self, LibraryClassList):
- self.LibraryClassList = LibraryClassList
-
- def GetLibraryClassList(self):
- return self.LibraryClassList
-
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
-
- def GetSupArchList(self):
- return self.SupArchList
-
-##
-# SourceFileObject
-#
-class SourceFileObject(CommonPropertiesObject):
- def __init__(self):
- CommonPropertiesObject.__init__(self)
- self.SourceFile = ''
- self.TagName = ''
- self.ToolCode = ''
- self.Family = ''
- self.FileType = ''
-
- def SetSourceFile(self, SourceFile):
- self.SourceFile = SourceFile
-
- def GetSourceFile(self):
- return self.SourceFile
-
- def SetTagName(self, TagName):
- self.TagName = TagName
-
- def GetTagName(self):
- return self.TagName
-
- def SetToolCode(self, ToolCode):
- self.ToolCode = ToolCode
-
- def GetToolCode(self):
- return self.ToolCode
-
- def SetFamily(self, Family):
- self.Family = Family
-
- def GetFamily(self):
- return self.Family
-
- def SetFileType(self, FileType):
- self.FileType = FileType
-
- def GetFileType(self):
- return self.FileType
-
-
-##
-# BinaryFileObject
-#
-class BinaryFileObject(CommonPropertiesObject):
- def __init__(self):
- self.FileNamList = []
- self.AsBuiltList = []
- CommonPropertiesObject.__init__(self)
-
- def SetFileNameList(self, FileNamList):
- self.FileNamList = FileNamList
-
- def GetFileNameList(self):
- return self.FileNamList
-
- def SetAsBuiltList(self, AsBuiltList):
- self.AsBuiltList = AsBuiltList
-
- def GetAsBuiltList(self):
- return self.AsBuiltList
-
-
-##
-# AsBuildLibraryClassObject
-#
-class AsBuildLibraryClassObject(object):
- def __init__(self):
- self.LibGuid = ''
- self.LibVersion = ''
-
- def SetLibGuid(self, LibGuid):
- self.LibGuid = LibGuid
- def GetLibGuid(self):
- return self.LibGuid
-
- def SetLibVersion(self, LibVersion):
- self.LibVersion = LibVersion
- def GetLibVersion(self):
- return self.LibVersion
-
-##
-# AsBuiltObject
-#
-class AsBuiltObject(object):
- def __init__(self):
- #
- # list of PcdObject
- #
- self.PatchPcdList = []
- #
- # list of PcdObject
- #
- self.PcdExValueList = []
- #
- # list of GuidVersionObject
- #
- self.LibraryInstancesList = []
- #
- # List of BinaryBuildFlag object
- #
- self.BinaryBuildFlagList = ''
-
- def SetPatchPcdList(self, PatchPcdList):
- self.PatchPcdList = PatchPcdList
-
- def GetPatchPcdList(self):
- return self.PatchPcdList
-
- def SetPcdExList(self, PcdExValueList):
- self.PcdExValueList = PcdExValueList
-
- def GetPcdExList(self):
- return self.PcdExValueList
-
- def SetLibraryInstancesList(self, LibraryInstancesList):
- self.LibraryInstancesList = LibraryInstancesList
-
- def GetLibraryInstancesList(self):
- return self.LibraryInstancesList
-
- def SetBuildFlagsList(self, BinaryBuildFlagList):
- self.BinaryBuildFlagList = BinaryBuildFlagList
-
- def GetBuildFlagsList(self):
- return self.BinaryBuildFlagList
-
-##
-# BinaryBuildFlag, this object will include those fields that are not
-# covered by the UPT Spec BinaryFile field
-#
-class BinaryBuildFlagObject(object):
- def __init__(self):
- self.Target = ''
- self.TagName = ''
- self.Family = ''
- self.AsBuiltOptionFlags = ''
-
- def SetTarget(self, Target):
- self.Target = Target
-
- def GetTarget(self):
- return self.Target
-
- def SetTagName(self, TagName):
- self.TagName = TagName
-
- def GetTagName(self):
- return self.TagName
-
- def SetFamily(self, Family):
- self.Family = Family
-
- def GetFamily(self):
- return self.Family
-
- def SetAsBuiltOptionFlags(self, AsBuiltOptionFlags):
- self.AsBuiltOptionFlags = AsBuiltOptionFlags
- def GetAsBuiltOptionFlags(self):
- return self.AsBuiltOptionFlags
-
-##
-# ExternObject
-#
-class ExternObject(CommonPropertiesObject):
- def __init__(self):
- self.EntryPoint = ''
- self.UnloadImage = ''
- self.Constructor = ''
- self.Destructor = ''
- self.SupModList = []
- CommonPropertiesObject.__init__(self)
-
- def SetEntryPoint(self, EntryPoint):
- self.EntryPoint = EntryPoint
-
- def GetEntryPoint(self):
- return self.EntryPoint
-
- def SetUnloadImage(self, UnloadImage):
- self.UnloadImage = UnloadImage
-
- def GetUnloadImage(self):
- return self.UnloadImage
-
- def SetConstructor(self, Constructor):
- self.Constructor = Constructor
-
- def GetConstructor(self):
- return self.Constructor
-
- def SetDestructor(self, Destructor):
- self.Destructor = Destructor
-
- def GetDestructor(self):
- return self.Destructor
-
- def SetSupModList(self, SupModList):
- self.SupModList = SupModList
- def GetSupModList(self):
- return self.SupModList
-
-##
-# DepexObject
-#
-class DepexObject(CommonPropertiesObject):
- def __init__(self):
- self.Depex = ''
- self.ModuelType = ''
- CommonPropertiesObject.__init__(self)
-
- def SetDepex(self, Depex):
- self.Depex = Depex
-
- def GetDepex(self):
- return self.Depex
-
- def SetModuleType(self, ModuleType):
- self.ModuelType = ModuleType
-
- def GetModuleType(self):
- return self.ModuelType
-
-##
-# PackageDependencyObject
-#
-class PackageDependencyObject(GuidVersionObject, CommonPropertiesObject):
- def __init__(self):
- self.Package = ''
- self.PackageFilePath = ''
- GuidVersionObject.__init__(self)
- CommonPropertiesObject.__init__(self)
-
- def SetPackageFilePath(self, PackageFilePath):
- self.PackageFilePath = PackageFilePath
-
- def GetPackageFilePath(self):
- return self.PackageFilePath
-
- def SetPackage(self, Package):
- self.Package = Package
-
- def GetPackage(self):
- return self.Package
-
-##
-# BuildOptionObject
-#
-class BuildOptionObject(CommonPropertiesObject):
- def __init__(self):
- CommonPropertiesObject.__init__(self)
- self.BuildOption = ''
-
- def SetBuildOption(self, BuildOption):
- self.BuildOption = BuildOption
-
- def GetBuildOption(self):
- return self.BuildOption
-
-##
-# ModuleObject
-#
-class ModuleObject(ModuleHeaderObject):
- def __init__(self):
- #
- # {Arch : ModuleHeaderObject}
- #
- self.HeaderDict = {}
- #
- # LibraryClassObject
- #
- self.LibraryClassList = []
- #
- # SourceFileObject
- #
- self.SourceFileList = []
- #
- # BinaryFileObject
- #
- self.BinaryFileList = []
- #
- # PackageDependencyObject
- #
- self.PackageDependencyList = []
- #
- # DepexObject
- #
- self.PeiDepex = []
- #
- # DepexObject
- #
- self.DxeDepex = []
- #
- # DepexObject
- #
- self.SmmDepex = []
- #
- # ProtocolObject
- #
- self.ProtocolList = []
- #
- # PpiObject
- #
- self.PpiList = []
- #
- # GuidObject
- #
- self.GuidList = []
- #
- # PcdObject
- #
- self.PcdList = []
- #
- # ExternObject
- #
- self.ExternList = []
- #
- # BuildOptionObject
- #
- self.BuildOptionList = []
- #
- # UserExtensionObject
- #
- self.UserExtensionList = []
- #
- # MiscFileObject
- #
- self.MiscFileList = []
- #
- # ClonedFromObject
- #
- self.ClonedFrom = None
-
- ModuleHeaderObject.__init__(self)
-
- def SetHeaderDict(self, HeaderDict):
- self.HeaderDict = HeaderDict
-
- def GetHeaderDict(self):
- return self.HeaderDict
-
- def SetLibraryClassList(self, LibraryClassList):
- self.LibraryClassList = LibraryClassList
-
- def GetLibraryClassList(self):
- return self.LibraryClassList
-
- def SetSourceFileList(self, SourceFileList):
- self.SourceFileList = SourceFileList
-
- def GetSourceFileList(self):
- return self.SourceFileList
-
- def SetBinaryFileList(self, BinaryFileList):
- self.BinaryFileList = BinaryFileList
-
- def GetBinaryFileList(self):
- return self.BinaryFileList
-
- def SetPackageDependencyList(self, PackageDependencyList):
- self.PackageDependencyList = PackageDependencyList
-
- def GetPackageDependencyList(self):
- return self.PackageDependencyList
-
- def SetPeiDepex(self, PeiDepex):
- self.PeiDepex = PeiDepex
-
- def GetPeiDepex(self):
- return self.PeiDepex
-
- def SetDxeDepex(self, DxeDepex):
- self.DxeDepex = DxeDepex
-
- def GetDxeDepex(self):
- return self.DxeDepex
-
- def SetSmmDepex(self, SmmDepex):
- self.SmmDepex = SmmDepex
-
- def GetSmmDepex(self):
- return self.SmmDepex
-
- def SetPpiList(self, PpiList):
- self.PpiList = PpiList
-
- def GetPpiList(self):
- return self.PpiList
-
- def SetProtocolList(self, ProtocolList):
- self.ProtocolList = ProtocolList
-
- def GetProtocolList(self):
- return self.ProtocolList
-
- def SetPcdList(self, PcdList):
- self.PcdList = PcdList
-
- def GetPcdList(self):
- return self.PcdList
-
- def SetGuidList(self, GuidList):
- self.GuidList = GuidList
-
- def GetGuidList(self):
- return self.GuidList
-
- def SetExternList(self, ExternList):
- self.ExternList = ExternList
-
- def GetExternList(self):
- return self.ExternList
-
- def SetBuildOptionList(self, BuildOptionList):
- self.BuildOptionList = BuildOptionList
-
- def GetBuildOptionList(self):
- return self.BuildOptionList
-
- def SetUserExtensionList(self, UserExtensionList):
- self.UserExtensionList = UserExtensionList
-
- def GetUserExtensionList(self):
- return self.UserExtensionList
-
- def SetMiscFileList(self, MiscFileList):
- self.MiscFileList = MiscFileList
-
- def GetMiscFileList(self):
- return self.MiscFileList
-
- def SetClonedFrom(self, ClonedFrom):
- self.ClonedFrom = ClonedFrom
-
- def GetClonedFrom(self):
- return self.ClonedFrom
diff --git a/BaseTools/Source/Python/UPT/Object/POM/PackageObject.py b/BaseTools/Source/Python/UPT/Object/POM/PackageObject.py
deleted file mode 100644
index 098954d4ed..0000000000
--- a/BaseTools/Source/Python/UPT/Object/POM/PackageObject.py
+++ /dev/null
@@ -1,190 +0,0 @@
-## @file
-# This file is used to define a class object to describe a package
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-PackageObject
-'''
-
-##
-# Import Modules
-#
-from Object.POM.CommonObject import CommonPropertiesObject
-from Object.POM.CommonObject import IdentificationObject
-from Object.POM.CommonObject import CommonHeaderObject
-from Library.Misc import Sdict
-
-## StandardIncludeFileObject
-#
-class StandardIncludeFileObject(CommonPropertiesObject):
- def __init__(self):
- CommonPropertiesObject.__init__(self)
- self.IncludeFile = ''
-
- def SetIncludeFile(self, IncludeFile):
- self.IncludeFile = IncludeFile
-
- def GetIncludeFile(self):
- return self.IncludeFile
-
-## PackageIncludeFileObject
-#
-class PackageIncludeFileObject(StandardIncludeFileObject):
- pass
-
-##
-# PackageObject
-#
-class PackageObject(IdentificationObject, CommonHeaderObject):
- def __init__(self):
- IdentificationObject.__init__(self)
- CommonHeaderObject.__init__(self)
- #
- # LibraryClassObject
- #
- self.LibraryClassList = []
- #
- # FileObject
- #
- self.IncludePathList = []
- #
- # StandardIncludeFileObject
- #
- self.StandardIncludeFileList = []
- #
- # PackageIncludeFileObject
- #
- self.PackageIncludeFileList = []
- #
- # Include and Arch List, item is (IncludePath, SupArchList-List of Arch), used during install package
- #
- self.IncludeArchList = []
- #
- # ProtocolObject
- #
- self.ProtocolList = []
- #
- # PpiObject
- #
- self.PpiList = []
- #
- # GuidObject
- #
- self.GuidList = []
- #
- # (PcdObject, PcdErrorObject)
- #
- self.PcdList = []
- #
- # UserExtensionObject
- #
- self.UserExtensionList = []
- #
- # MiscFileObject
- #
- self.MiscFileList = []
- self.ModuleDict = Sdict()
- #
- # ClonedRecordObject
- #
- self.ClonedFromList = []
- #
- # string object
- #
- self.ModuleFileList = []
-
- self.PcdChecks = []
-
- def SetLibraryClassList(self, LibraryClassList):
- self.LibraryClassList = LibraryClassList
-
- def GetLibraryClassList(self):
- return self.LibraryClassList
-
- def SetIncludePathList(self, IncludePathList):
- self.IncludePathList = IncludePathList
-
- def GetIncludePathList(self):
- return self.IncludePathList
-
- def SetIncludeArchList(self, IncludeArchList):
- self.IncludeArchList = IncludeArchList
-
- def GetIncludeArchList(self):
- return self.IncludeArchList
-
- def SetStandardIncludeFileList(self, StandardIncludeFileList):
- self.StandardIncludeFileList = StandardIncludeFileList
-
- def GetStandardIncludeFileList(self):
- return self.StandardIncludeFileList
-
- def SetPackageIncludeFileList(self, PackageIncludeFileList):
- self.PackageIncludeFileList = PackageIncludeFileList
-
- def GetPackageIncludeFileList(self):
- return self.PackageIncludeFileList
-
- def SetProtocolList(self, ProtocolList):
- self.ProtocolList = ProtocolList
-
- def GetProtocolList(self):
- return self.ProtocolList
-
- def SetPpiList(self, PpiList):
- self.PpiList = PpiList
-
- def GetPpiList(self):
- return self.PpiList
-
- def SetGuidList(self, GuidList):
- self.GuidList = GuidList
-
- def GetGuidList(self):
- return self.GuidList
-
- def SetPcdList(self, PcdList):
- self.PcdList = PcdList
-
- def GetPcdList(self):
- return self.PcdList
-
- def SetUserExtensionList(self, UserExtensionList):
- self.UserExtensionList = UserExtensionList
-
- def GetUserExtensionList(self):
- return self.UserExtensionList
-
- def SetMiscFileList(self, MiscFileList):
- self.MiscFileList = MiscFileList
-
- def GetMiscFileList(self):
- return self.MiscFileList
-
- def SetModuleDict(self, ModuleDict):
- self.ModuleDict = ModuleDict
-
- def GetModuleDict(self):
- return self.ModuleDict
-
- def SetClonedFromList(self, ClonedFromList):
- self.ClonedFromList = ClonedFromList
-
- def GetClonedFromList(self):
- return self.ClonedFromList
-
- def SetModuleFileList(self, ModuleFileList):
- self.ModuleFileList = ModuleFileList
-
- def GetModuleFileList(self):
- return self.ModuleFileList
-
diff --git a/BaseTools/Source/Python/UPT/Object/POM/__init__.py b/BaseTools/Source/Python/UPT/Object/POM/__init__.py
deleted file mode 100644
index e2235f1bf0..0000000000
--- a/BaseTools/Source/Python/UPT/Object/POM/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Object' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-POM
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/DecObject.py b/BaseTools/Source/Python/UPT/Object/Parser/DecObject.py
deleted file mode 100644
index 6336a90fb9..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/DecObject.py
+++ /dev/null
@@ -1,611 +0,0 @@
-## @file
-# This file is used to define class objects for DEC file. It will consumed by
-#DecParser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-DecObject
-'''
-
-## Import modules
-#
-import os.path
-
-from Library.Misc import Sdict
-from Library.DataType import TAB_GUIDS
-from Library.DataType import TAB_PPIS
-from Library.DataType import TAB_PROTOCOLS
-from Library.DataType import TAB_DEC_DEFINES
-from Library.DataType import TAB_INCLUDES
-from Library.DataType import TAB_LIBRARY_CLASSES
-from Library.DataType import TAB_USER_EXTENSIONS
-from Library.DataType import TAB_PCDS
-from Library.DataType import TAB_ARCH_COMMON
-
-## _DecComments
-#
-# Base class for all data objects which have head and tail comments
-#
-class _DecComments:
-
- ##constructor
- #
- def __init__(self):
- self._HeadComment = []
- self._TailComment = []
-
- ## GetComments
- #
- def GetComments(self):
- return self._HeadComment, self._TailComment
-
- ## GetHeadComment
- #
- def GetHeadComment(self):
- return self._HeadComment
-
- ## SetHeadComment
- #
- # @param Comment: comment content
- #
- def SetHeadComment(self, Comment):
- self._HeadComment = Comment
-
- ## GetTailComment
- #
- def GetTailComment(self):
- return self._TailComment
-
- ## SetTailComment
- #
- # @param Comment: comment content
- #
- def SetTailComment(self, Comment):
- self._TailComment = Comment
-
-## _DecBaseObject
-#
-# Base class that hold common info
-#
-class _DecBaseObject(_DecComments):
- def __init__(self, PkgFullName):
- _DecComments.__init__(self)
- #
- # Key is combined with (Arch, SectionType)
- # Default is common
- #
- self.ValueDict = Sdict()
- self._PkgFullName = PkgFullName
- self._PackagePath, self._FileName = os.path.split(PkgFullName)
- self._SecName = ''
-
- ## GetSectionName
- #
- def GetSectionName(self):
- return self._SecName
-
- ## GetPackagePath
- #
- def GetPackagePath(self):
- return self._PackagePath
-
- ## GetPackageFile
- #
- def GetPackageFile(self):
- return self._FileName
-
- ## GetPackageFullName
- #
- def GetPackageFullName(self):
- return self._PkgFullName
-
- ## AddItem
- # Add sub-item to current object, sub-class should override it if needed
- #
- # @param Item: Sub-item to be added
- # @param Scope: A list store section name and arch info
- #
- def AddItem(self, Item, Scope):
- if not Scope:
- return
- if not Item:
- return
- ArchModule = []
- for Ele in Scope:
- if Ele[1] in self.ValueDict:
- self.ValueDict[Ele[1]].append(Item)
- else:
- self.ValueDict[Ele[1]] = [Item]
- ArchModule.append(Ele[1])
- Item.ArchAndModuleType = ArchModule
-
- ## _GetItemByArch
- # Helper class used by sub-class
- # @param Arch: arch
- #
- def _GetItemByArch(self, Arch):
- Arch = Arch.upper()
- if Arch not in self.ValueDict:
- return []
- return self.ValueDict[Arch]
-
- ## _GetAllItems
- # Get all items, union all arches, items in returned list are unique
- #
- def _GetAllItems(self):
- Retlst = []
- for Arch in self.ValueDict:
- for Item in self.ValueDict[Arch]:
- if Item not in Retlst:
- Retlst.append(Item)
- return Retlst
-
-## _DecItemBaseObject
-#
-# Module type and arch the item belongs to
-#
-class _DecItemBaseObject(_DecComments):
- def __init__(self):
- _DecComments.__init__(self)
- #
- # Item's arch, if PCD, also include PCD type
- #
- self.ArchAndModuleType = []
-
- ## GetArchList
- #
- def GetArchList(self):
- ArchSet = set()
- for Arch in self.ArchAndModuleType:
- ArchSet.add(Arch)
- return list(ArchSet)
-
-## DecDefineObject
-#
-# Class to hold define section infomation
-#
-class DecDefineObject(_DecBaseObject):
- def __init__(self, PkgFullName):
- _DecBaseObject.__init__(self, PkgFullName)
- self._SecName = TAB_DEC_DEFINES.upper()
- self._DecSpec = ''
- self._PkgName = ''
- self._PkgGuid = ''
- self._PkgVersion = ''
- self._PkgUniFile = ''
-
- ## GetPackageSpecification
- #
- def GetPackageSpecification(self):
- return self._DecSpec
-
- def SetPackageSpecification(self, DecSpec):
- self._DecSpec = DecSpec
-
- ## GetPackageName
- #
- def GetPackageName(self):
- return self._PkgName
-
- def SetPackageName(self, PkgName):
- self._PkgName = PkgName
-
- ## GetPackageGuid
- #
- def GetPackageGuid(self):
- return self._PkgGuid
-
- def SetPackageGuid(self, PkgGuid):
- self._PkgGuid = PkgGuid
-
- ## GetPackageVersion
- #
- def GetPackageVersion(self):
- return self._PkgVersion
-
- def SetPackageVersion(self, PkgVersion):
- self._PkgVersion = PkgVersion
-
- ## GetPackageUniFile
- #
- def GetPackageUniFile(self):
- return self._PkgUniFile
-
- def SetPackageUniFile(self, PkgUniFile):
- self._PkgUniFile = PkgUniFile
-
- ## GetDefines
- #
- def GetDefines(self):
- return self._GetItemByArch(TAB_ARCH_COMMON)
-
- ## GetAllDefines
- #
- def GetAllDefines(self):
- return self._GetAllItems()
-
-## DecDefineItemObject
-#
-# Each item of define section
-#
-class DecDefineItemObject(_DecItemBaseObject):
- def __init__(self):
- _DecItemBaseObject.__init__(self)
- self.Key = ''
- self.Value = ''
-
- ## __hash__
- #
- def __hash__(self):
- return hash(self.Key + self.Value)
-
- ## __eq__
- #
- def __eq__(self, Other):
- return id(self) == id(Other)
-
- ## __str__
- #
- def __str__(self):
- return str(self.ArchAndModuleType) + '\n' + self.Key + \
- ' = ' + self.Value
-
-## DecIncludeObject
-#
-# Class to hold include section info
-#
-class DecIncludeObject(_DecBaseObject):
- def __init__(self, PkgFullName):
- _DecBaseObject.__init__(self, PkgFullName)
- self._SecName = TAB_INCLUDES.upper()
-
- ## GetIncludes
- #
- def GetIncludes(self, Arch=TAB_ARCH_COMMON):
- return self._GetItemByArch(Arch)
-
- ## GetAllIncludes
- #
- def GetAllIncludes(self):
- return self._GetAllItems()
-
-## DecIncludeItemObject
-#
-# Item of include section
-#
-class DecIncludeItemObject(_DecItemBaseObject):
- def __init__(self, File, Root):
- self.File = File
- self.Root = Root
- _DecItemBaseObject.__init__(self)
-
- ## __hash__
- #
- def __hash__(self):
- return hash(self.File)
-
- ## __eq__
- #
- def __eq__(self, Other):
- return id(self) == id(Other)
-
- ## __str__
- #
- def __str__(self):
- return self.File
-
-## DecLibraryclassObject
-#
-# Class to hold library class section info
-#
-class DecLibraryclassObject(_DecBaseObject):
- def __init__(self, PkgFullName):
- _DecBaseObject.__init__(self, PkgFullName)
- self._PackagePath, self._FileName = os.path.split(PkgFullName)
- self._SecName = TAB_LIBRARY_CLASSES.upper()
-
- ## GetLibraryclasses
- #
- def GetLibraryclasses(self, Arch=TAB_ARCH_COMMON):
- return self._GetItemByArch(Arch)
-
- ## GetAllLibraryclasses
- #
- def GetAllLibraryclasses(self):
- return self._GetAllItems()
-
-## DecLibraryclassItemObject
-# Item of library class section
-#
-class DecLibraryclassItemObject(_DecItemBaseObject):
- def __init__(self, Libraryclass, File, Root):
- _DecItemBaseObject.__init__(self)
- self.File = File
- self.Root = Root
- self.Libraryclass = Libraryclass
-
- ## __hash__
- #
- def __hash__(self):
- return hash(self.Libraryclass + self.File)
-
- ## __eq__
- #
- def __eq__(self, Other):
- return id(self) == id(Other)
-
- ## __str__
- #
- def __str__(self):
- return self.Libraryclass + '|' + self.File
-
-## DecPcdObject
-# Class to hold PCD section
-#
-class DecPcdObject(_DecBaseObject):
- def __init__(self, PkgFullName):
- _DecBaseObject.__init__(self, PkgFullName)
- self._SecName = TAB_PCDS.upper()
-
- ## AddItem
- #
- # Diff from base class
- #
- # @param Item: Item
- # @param Scope: Scope
- #
- def AddItem(self, Item, Scope):
- if not Scope:
- return
- if not Item:
- return
- ArchModule = []
- for Type, Arch in Scope:
- if (Type, Arch) in self.ValueDict:
- self.ValueDict[Type, Arch].append(Item)
- else:
- self.ValueDict[Type, Arch] = [Item]
- ArchModule.append([Type, Arch])
- Item.ArchAndModuleType = ArchModule
-
- ## GetPcds
- #
- # @param PcdType: PcdType
- # @param Arch: Arch
- #
- def GetPcds(self, PcdType, Arch=TAB_ARCH_COMMON):
- PcdType = PcdType.upper()
- Arch = Arch.upper()
- if (PcdType, Arch) not in self.ValueDict:
- return []
- return self.ValueDict[PcdType, Arch]
-
- ## GetPcdsByType
- #
- # @param PcdType: PcdType
- #
- def GetPcdsByType(self, PcdType):
- PcdType = PcdType.upper()
- Retlst = []
- for TypeInDict, Arch in self.ValueDict:
- if TypeInDict != PcdType:
- continue
- for Item in self.ValueDict[PcdType, Arch]:
- if Item not in Retlst:
- Retlst.append(Item)
- return Retlst
-
-## DecPcdItemObject
-#
-# Item of PCD section
-#
-# @param _DecItemBaseObject: _DecItemBaseObject object
-#
-class DecPcdItemObject(_DecItemBaseObject):
- def __init__(self, Guid, Name, Value, DatumType,
- Token, MaxDatumSize=''):
- _DecItemBaseObject.__init__(self)
- self.TokenCName = Name
- self.TokenSpaceGuidCName = Guid
- self.DatumType = DatumType
- self.DefaultValue = Value
- self.TokenValue = Token
- self.MaxDatumSize = MaxDatumSize
-
- ## __hash__
- #
- def __hash__(self):
- return hash(self.TokenSpaceGuidCName + self.TokenCName)
-
- ## __eq__
- #
- def __eq__(self, Other):
- return id(self) == id(Other)
-
- ## GetArchListOfType
- #
- # @param PcdType: PcdType
- #
- def GetArchListOfType(self, PcdType):
- ItemSet = set()
- PcdType = PcdType.upper()
- for Type, Arch in self.ArchAndModuleType:
- if Type != PcdType:
- continue
- ItemSet.add(Arch)
- return list(ItemSet)
-
-## DecGuidObjectBase
-#
-# Base class for PPI, Protocol, and GUID.
-# Hold same data but has different method for clarification in sub-class
-#
-# @param _DecBaseObject: Dec Base Object
-#
-class DecGuidObjectBase(_DecBaseObject):
- def __init__(self, PkgFullName):
- _DecBaseObject.__init__(self, PkgFullName)
-
- ## GetGuidStyleItems
- #
- # @param Arch: Arch
- #
- def GetGuidStyleItems(self, Arch=TAB_ARCH_COMMON):
- return self._GetItemByArch(Arch)
-
- ## GetGuidStyleAllItems
- #
- def GetGuidStyleAllItems(self):
- return self._GetAllItems()
-
-## DecGuidItemObject
-#
-# Item of GUID, PPI and Protocol section
-#
-# @param _DecItemBaseObject: Dec Item Base Object
-#
-class DecGuidItemObject(_DecItemBaseObject):
- def __init__(self, CName, GuidCValue, GuidString):
- _DecItemBaseObject.__init__(self)
- self.GuidCName = CName
- self.GuidCValue = GuidCValue
- self.GuidString = GuidString
-
- ## __hash__
- #
- def __hash__(self):
- return hash(self.GuidCName)
-
- ## __eq__
- #
- def __eq__(self, Other):
- return id(self) == id(Other)
-
- ## __str__
- #
- def __str__(self):
- return self.GuidCName + ' = ' + self.GuidCValue
-
-## DecGuidObject
-#
-# Class for GUID section
-#
-# @param DecGuidObjectBase: Dec Guid Object Base
-#
-class DecGuidObject(DecGuidObjectBase):
- def __init__(self, PkgFullName):
- DecGuidObjectBase.__init__(self, PkgFullName)
- self._SecName = TAB_GUIDS.upper()
-
- ## GetGuids
- #
- # @param Arch: Arch
- #
- def GetGuids(self, Arch=TAB_ARCH_COMMON):
- return self._GetItemByArch(Arch)
-
- ## GetAllGuids
- #
- def GetAllGuids(self):
- return self._GetAllItems()
-
-## DecPpiObject
-#
-# Class for PPI seciont
-#
-# @param DecGuidObjectBase: Dec Guid Object Base
-#
-class DecPpiObject(DecGuidObjectBase):
- def __init__(self, PkgFullName):
- DecGuidObjectBase.__init__(self, PkgFullName)
- self._SecName = TAB_PPIS.upper()
-
- ## GetPpis
- #
- # @param Arch: Arch
- #
- def GetPpis(self, Arch=TAB_ARCH_COMMON):
- return self._GetItemByArch(Arch)
-
- ## GetAllPpis
- #
- def GetAllPpis(self):
- return self._GetAllItems()
-
-## DecProtocolObject
-#
-# Class for protocol section
-#
-# @param DecGuidObjectBase: Dec Guid Object Base
-#
-class DecProtocolObject(DecGuidObjectBase):
- def __init__(self, PkgFullName):
- DecGuidObjectBase.__init__(self, PkgFullName)
- self._SecName = TAB_PROTOCOLS.upper()
-
- ## GetProtocols
- #
- # @param Arch: Arch
- #
- def GetProtocols(self, Arch=TAB_ARCH_COMMON):
- return self._GetItemByArch(Arch)
-
- ## GetAllProtocols
- #
- def GetAllProtocols(self):
- return self._GetAllItems()
-
-## DecUserExtensionObject
-#
-# Class for user extension section
-#
-# @param _DecBaseObject: Dec Guid Object Base
-#
-class DecUserExtensionObject(_DecBaseObject):
- def __init__(self, PkgFullName):
- _DecBaseObject.__init__(self, PkgFullName)
- self._SecName = TAB_USER_EXTENSIONS.upper()
- self.ItemList = []
-
- ## GetProtocols
- #
- # @param Item: Item
- # @param Scope: Scope
- #
- def AddItem(self, Item, Scope):
- if not Scope:
- pass
- if not Item:
- return
- self.ItemList.append(Item)
-
- ## GetAllUserExtensions
- #
- def GetAllUserExtensions(self):
- return self.ItemList
-
-
-## DecUserExtensionItemObject
-# Item for user extension section
-#
-# @param _DecItemBaseObject: Dec Item Base Object
-#
-class DecUserExtensionItemObject(_DecItemBaseObject):
- def __init__(self):
- _DecItemBaseObject.__init__(self)
- self.UserString = ''
- self.UserId = ''
- self.IdString = ''
-
-
-
-
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py
deleted file mode 100644
index 3685fedd5c..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py
+++ /dev/null
@@ -1,621 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [Binaries] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfBinaryObject
-'''
-
-import os
-
-from copy import deepcopy
-from Library import DataType as DT
-from Library import GlobalData
-import Logger.Log as Logger
-from Logger import ToolError
-from Logger import StringTable as ST
-from Library.Misc import Sdict
-
-from Object.Parser.InfCommonObject import InfSectionCommonDef
-from Object.Parser.InfCommonObject import CurrentLine
-from Library.Misc import ConvPathFromAbsToRel
-from Library.ExpressionValidate import IsValidFeatureFlagExp
-from Library.Misc import ValidFile
-from Library.ParserValidate import IsValidPath
-
-
-class InfBianryItem():
- def __init__(self):
- self.FileName = ''
- self.Target = ''
- self.FeatureFlagExp = ''
- self.HelpString = ''
- self.Type = ''
- self.SupArchList = []
-
- def SetFileName(self, FileName):
- self.FileName = FileName
- def GetFileName(self):
- return self.FileName
-
- def SetTarget(self, Target):
- self.Target = Target
- def GetTarget(self):
- return self.Target
-
- def SetFeatureFlagExp(self, FeatureFlagExp):
- self.FeatureFlagExp = FeatureFlagExp
- def GetFeatureFlagExp(self):
- return self.FeatureFlagExp
-
- def SetHelpString(self, HelpString):
- self.HelpString = HelpString
- def GetHelpString(self):
- return self.HelpString
-
- def SetType(self, Type):
- self.Type = Type
- def GetType(self):
- return self.Type
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
- def GetSupArchList(self):
- return self.SupArchList
-
-class InfBianryVerItem(InfBianryItem, CurrentLine):
- def __init__(self):
- InfBianryItem.__init__(self)
- CurrentLine.__init__(self)
- self.VerTypeName = ''
-
- def SetVerTypeName(self, VerTypeName):
- self.VerTypeName = VerTypeName
- def GetVerTypeName(self):
- return self.VerTypeName
-
-class InfBianryUiItem(InfBianryItem, CurrentLine):
- def __init__(self):
- InfBianryItem.__init__(self)
- CurrentLine.__init__(self)
- self.UiTypeName = ''
-
- def SetUiTypeName(self, UiTypeName):
- self.UiTypeName = UiTypeName
- def GetVerTypeName(self):
- return self.UiTypeName
-
-class InfBianryCommonItem(InfBianryItem, CurrentLine):
- def __init__(self):
- self.CommonType = ''
- self.TagName = ''
- self.Family = ''
- InfBianryItem.__init__(self)
- CurrentLine.__init__(self)
-
- def SetCommonType(self, CommonType):
- self.CommonType = CommonType
- def GetCommonType(self):
- return self.CommonType
-
- def SetTagName(self, TagName):
- self.TagName = TagName
- def GetTagName(self):
- return self.TagName
-
- def SetFamily(self, Family):
- self.Family = Family
- def GetFamily(self):
- return self.Family
-
-##
-#
-#
-#
-class InfBinariesObject(InfSectionCommonDef):
- def __init__(self):
- self.Binaries = Sdict()
- #
- # Macro defined in this section should be only used in this section.
- #
- self.Macros = {}
- InfSectionCommonDef.__init__(self)
-
- ## CheckVer
- #
- #
- def CheckVer(self, Ver, __SupArchList):
- #
- # Check Ver
- #
- for VerItem in Ver:
- IsValidFileFlag = False
- VerContent = VerItem[0]
- VerComment = VerItem[1]
- VerCurrentLine = VerItem[2]
- GlobalData.gINF_CURRENT_LINE = VerCurrentLine
- InfBianryVerItemObj = None
- #
- # Should not less than 2 elements
- #
- if len(VerContent) < 2:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (VerContent[0]),
- File=VerCurrentLine.GetFileName(),
- Line=VerCurrentLine.GetLineNo(),
- ExtraData=VerCurrentLine.GetLineString())
- return False
- if len(VerContent) > 4:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_MAX % (VerContent[0], 4),
- File=VerCurrentLine.GetFileName(),
- Line=VerCurrentLine.GetLineNo(),
- ExtraData=VerCurrentLine.GetLineString())
- return False
- if len(VerContent) >= 2:
- #
- # Create a Ver Object.
- #
- InfBianryVerItemObj = InfBianryVerItem()
-
- if VerContent[0] != DT.BINARY_FILE_TYPE_VER:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_VER_TYPE % DT.BINARY_FILE_TYPE_VER,
- File=VerCurrentLine.GetFileName(),
- Line=VerCurrentLine.GetLineNo(),
- ExtraData=VerCurrentLine.GetLineString())
-
- InfBianryVerItemObj.SetVerTypeName(VerContent[0])
- InfBianryVerItemObj.SetType(VerContent[0])
- #
- # Verify File exist or not
- #
- FullFileName = os.path.normpath(os.path.realpath(os.path.join(GlobalData.gINF_MODULE_DIR,
- VerContent[1])))
- if not (ValidFile(FullFileName) or ValidFile(VerContent[1])):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST % (VerContent[1]),
- File=VerCurrentLine.GetFileName(),
- Line=VerCurrentLine.GetLineNo(),
- ExtraData=VerCurrentLine.GetLineString())
- #
- # Validate file exist/format.
- #
- if IsValidPath(VerContent[1], GlobalData.gINF_MODULE_DIR):
- IsValidFileFlag = True
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID % (VerContent[1]),
- File=VerCurrentLine.GetFileName(),
- Line=VerCurrentLine.GetLineNo(),
- ExtraData=VerCurrentLine.GetLineString())
- return False
- if IsValidFileFlag:
- VerContent[0] = ConvPathFromAbsToRel(VerContent[0],
- GlobalData.gINF_MODULE_DIR)
- InfBianryVerItemObj.SetFileName(VerContent[1])
- if len(VerContent) >= 3:
- #
- # Add Target information
- #
- InfBianryVerItemObj.SetTarget(VerContent[2])
- if len(VerContent) == 4:
- if VerContent[3].strip() == '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
- File=VerCurrentLine.GetFileName(),
- Line=VerCurrentLine.GetLineNo(),
- ExtraData=VerCurrentLine.GetLineString())
- #
- # Validate Feature Flag Express
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(VerContent[3].\
- strip())
- if not FeatureFlagRtv[0]:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID % (FeatureFlagRtv[1]),
- File=VerCurrentLine.GetFileName(),
- Line=VerCurrentLine.GetLineNo(),
- ExtraData=VerCurrentLine.GetLineString())
- InfBianryVerItemObj.SetFeatureFlagExp(VerContent[3])
-
- InfBianryVerItemObj.SetSupArchList(__SupArchList)
-
- #
- # Determine binary file name duplicate. Follow below rule:
- #
- # A binary filename must not be duplicated within
- # a [Binaries] section. A binary filename may appear in
- # multiple architectural [Binaries] sections. A binary
- # filename listed in an architectural [Binaries] section
- # must not be listed in the common architectural
- # [Binaries] section.
- #
- # NOTE: This check will not report error now.
- #
- for Item in self.Binaries:
- if Item.GetFileName() == InfBianryVerItemObj.GetFileName():
- ItemSupArchList = Item.GetSupArchList()
- for ItemArch in ItemSupArchList:
- for VerItemObjArch in __SupArchList:
- if ItemArch == VerItemObjArch:
- #
- # ST.ERR_INF_PARSER_ITEM_DUPLICATE
- #
- pass
- if ItemArch.upper() == 'COMMON' or VerItemObjArch.upper() == 'COMMON':
- #
- # ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
- #
- pass
-
- if InfBianryVerItemObj != None:
- if self.Binaries.has_key((InfBianryVerItemObj)):
- BinariesList = self.Binaries[InfBianryVerItemObj]
- BinariesList.append((InfBianryVerItemObj, VerComment))
- self.Binaries[InfBianryVerItemObj] = BinariesList
- else:
- BinariesList = []
- BinariesList.append((InfBianryVerItemObj, VerComment))
- self.Binaries[InfBianryVerItemObj] = BinariesList
-
- ## ParseCommonBinary
- #
- # ParseCommonBinary
- #
- def ParseCommonBinary(self, CommonBinary, __SupArchList):
- #
- # Check common binary definitions
- # Type | FileName | Target | Family | TagName | FeatureFlagExp
- #
- for Item in CommonBinary:
- IsValidFileFlag = False
- ItemContent = Item[0]
- ItemComment = Item[1]
- CurrentLineOfItem = Item[2]
- GlobalData.gINF_CURRENT_LINE = CurrentLineOfItem
- InfBianryCommonItemObj = None
- if len(ItemContent) < 2:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (ItemContent[0]),
- File=CurrentLineOfItem.GetFileName(),
- Line=CurrentLineOfItem.GetLineNo(),
- ExtraData=CurrentLineOfItem.GetLineString())
- return False
- if len(ItemContent) > 6:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_MAX % (ItemContent[0], 6),
- File=CurrentLineOfItem.GetFileName(),
- Line=CurrentLineOfItem.GetLineNo(),
- ExtraData=CurrentLineOfItem.GetLineString())
- return False
- if len(ItemContent) >= 2:
- #
- # Create a Common Object.
- #
- InfBianryCommonItemObj = InfBianryCommonItem()
- #
- # Convert Binary type.
- #
- BinaryFileType = ItemContent[0].strip()
- if BinaryFileType == 'RAW' or BinaryFileType == 'ACPI' or BinaryFileType == 'ASL':
- BinaryFileType = 'BIN'
-
- if BinaryFileType not in DT.BINARY_FILE_TYPE_LIST:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_INVALID_FILETYPE % \
- (DT.BINARY_FILE_TYPE_LIST.__str__()),
- File=CurrentLineOfItem.GetFileName(),
- Line=CurrentLineOfItem.GetLineNo(),
- ExtraData=CurrentLineOfItem.GetLineString())
-
- if BinaryFileType == 'SUBTYPE_GUID':
- BinaryFileType = 'FREEFORM'
-
- if BinaryFileType == 'LIB' or BinaryFileType == 'UEFI_APP':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_INVALID_FILETYPE % \
- (DT.BINARY_FILE_TYPE_LIST.__str__()),
- File=CurrentLineOfItem.GetFileName(),
- Line=CurrentLineOfItem.GetLineNo(),
- ExtraData=CurrentLineOfItem.GetLineString())
-
- InfBianryCommonItemObj.SetType(BinaryFileType)
- InfBianryCommonItemObj.SetCommonType(ItemContent[0])
- #
- # Verify File exist or not
- #
- FullFileName = os.path.normpath(os.path.realpath(os.path.join(GlobalData.gINF_MODULE_DIR,
- ItemContent[1])))
- if not (ValidFile(FullFileName) or ValidFile(ItemContent[1])):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST % (ItemContent[1]),
- File=CurrentLineOfItem.GetFileName(),
- Line=CurrentLineOfItem.GetLineNo(),
- ExtraData=CurrentLineOfItem.GetLineString())
- #
- # Validate file exist/format.
- #
- if IsValidPath(ItemContent[1], GlobalData.gINF_MODULE_DIR):
- IsValidFileFlag = True
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID % (ItemContent[1]),
- File=CurrentLineOfItem.GetFileName(),
- Line=CurrentLineOfItem.GetLineNo(),
- ExtraData=CurrentLineOfItem.GetLineString())
- return False
- if IsValidFileFlag:
- ItemContent[0] = ConvPathFromAbsToRel(ItemContent[0], GlobalData.gINF_MODULE_DIR)
- InfBianryCommonItemObj.SetFileName(ItemContent[1])
- if len(ItemContent) >= 3:
- #
- # Add Target information
- #
- InfBianryCommonItemObj.SetTarget(ItemContent[2])
- if len(ItemContent) >= 4:
- #
- # Add Family information
- #
- InfBianryCommonItemObj.SetFamily(ItemContent[3])
- if len(ItemContent) >= 5:
- #
- # TagName entries are build system specific. If there
- # is content in the entry, the tool must exit
- # gracefully with an error message that indicates build
- # system specific content cannot be distributed using
- # the UDP
- #
- if ItemContent[4].strip() != '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITTED % (ItemContent[4]),
- File=CurrentLineOfItem.GetFileName(),
- Line=CurrentLineOfItem.GetLineNo(),
- ExtraData=CurrentLineOfItem.GetLineString())
- if len(ItemContent) == 6:
- #
- # Add FeatureFlagExp
- #
- if ItemContent[5].strip() == '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
- File=CurrentLineOfItem.GetFileName(),
- Line=CurrentLineOfItem.GetLineNo(),
- ExtraData=CurrentLineOfItem.GetLineString())
- #
- # Validate Feature Flag Express
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(ItemContent[5].strip())
- if not FeatureFlagRtv[0]:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID % (FeatureFlagRtv[1]),
- File=CurrentLineOfItem.GetFileName(),
- Line=CurrentLineOfItem.GetLineNo(),
- ExtraData=CurrentLineOfItem.GetLineString())
- InfBianryCommonItemObj.SetFeatureFlagExp(ItemContent[5])
-
- InfBianryCommonItemObj.SetSupArchList(__SupArchList)
-
- #
- # Determine binary file name duplicate. Follow below rule:
- #
- # A binary filename must not be duplicated within
- # a [Binaries] section. A binary filename may appear in
- # multiple architectural [Binaries] sections. A binary
- # filename listed in an architectural [Binaries] section
- # must not be listed in the common architectural
- # [Binaries] section.
- #
- # NOTE: This check will not report error now.
- #
-# for Item in self.Binaries:
-# if Item.GetFileName() == InfBianryCommonItemObj.GetFileName():
-# ItemSupArchList = Item.GetSupArchList()
-# for ItemArch in ItemSupArchList:
-# for ComItemObjArch in __SupArchList:
-# if ItemArch == ComItemObjArch:
-# #
-# # ST.ERR_INF_PARSER_ITEM_DUPLICATE
-# #
-# pass
-#
-# if ItemArch.upper() == 'COMMON' or ComItemObjArch.upper() == 'COMMON':
-# #
-# # ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
-# #
-# pass
-
- if InfBianryCommonItemObj != None:
- if self.Binaries.has_key((InfBianryCommonItemObj)):
- BinariesList = self.Binaries[InfBianryCommonItemObj]
- BinariesList.append((InfBianryCommonItemObj, ItemComment))
- self.Binaries[InfBianryCommonItemObj] = BinariesList
- else:
- BinariesList = []
- BinariesList.append((InfBianryCommonItemObj, ItemComment))
- self.Binaries[InfBianryCommonItemObj] = BinariesList
-
- def SetBinary(self, UiInf=None, Ver=None, CommonBinary=None, ArchList=None):
-
- __SupArchList = []
- for ArchItem in ArchList:
- #
- # Validate Arch
- #
- if (ArchItem == '' or ArchItem == None):
- ArchItem = 'COMMON'
- __SupArchList.append(ArchItem)
-
- if UiInf != None:
- if len(UiInf) > 0:
- #
- # Check UI
- #
- for UiItem in UiInf:
- IsValidFileFlag = False
- InfBianryUiItemObj = None
- UiContent = UiItem[0]
- UiComment = UiItem[1]
- UiCurrentLine = UiItem[2]
- GlobalData.gINF_CURRENT_LINE = deepcopy(UiItem[2])
- #
- # Should not less than 2 elements
- #
- if len(UiContent) < 2:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (UiContent[0]),
- File=UiCurrentLine.GetFileName(),
- Line=UiCurrentLine.GetLineNo(),
- ExtraData=UiCurrentLine.GetLineString())
- return False
-
- if len(UiContent) > 4:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_MAX % (UiContent[0], 4),
- File=UiCurrentLine.GetFileName(),
- Line=UiCurrentLine.GetLineNo(),
- ExtraData=UiCurrentLine.GetLineString())
- return False
- if len(UiContent) >= 2:
- #
- # Create an Ui Object.
- #
- InfBianryUiItemObj = InfBianryUiItem()
- if UiContent[0] != 'UI':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_VER_TYPE % ('UI'),
- File=UiCurrentLine.GetFileName(),
- Line=UiCurrentLine.GetLineNo(),
- ExtraData=UiCurrentLine.GetLineString())
- InfBianryUiItemObj.SetUiTypeName(UiContent[0])
- InfBianryUiItemObj.SetType(UiContent[0])
- #
- # Verify File exist or not
- #
- FullFileName = os.path.normpath(os.path.realpath(os.path.join(GlobalData.gINF_MODULE_DIR,
- UiContent[1])))
- if not (ValidFile(FullFileName) or ValidFile(UiContent[1])):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST % (UiContent[1]),
- File=UiCurrentLine.GetFileName(),
- Line=UiCurrentLine.GetLineNo(),
- ExtraData=UiCurrentLine.GetLineString())
- #
- # Validate file exist/format.
- #
- if IsValidPath(UiContent[1], GlobalData.gINF_MODULE_DIR):
- IsValidFileFlag = True
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID % (UiContent[1]),
- File=UiCurrentLine.GetFileName(),
- Line=UiCurrentLine.GetLineNo(),
- ExtraData=UiCurrentLine.GetLineString())
- return False
- if IsValidFileFlag:
- UiContent[0] = ConvPathFromAbsToRel(UiContent[0], GlobalData.gINF_MODULE_DIR)
- InfBianryUiItemObj.SetFileName(UiContent[1])
- if len(UiContent) >= 3:
- #
- # Add Target information
- #
- InfBianryUiItemObj.SetTarget(UiContent[2])
- if len(UiContent) == 4:
- if UiContent[3].strip() == '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
- File=UiCurrentLine.GetFileName(),
- Line=UiCurrentLine.GetLineNo(),
- ExtraData=UiCurrentLine.GetLineString())
- #
- # Validate Feature Flag Express
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(UiContent[3].strip())
- if not FeatureFlagRtv[0]:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID % (FeatureFlagRtv[1]),
- File=UiCurrentLine.GetFileName(),
- Line=UiCurrentLine.GetLineNo(),
- ExtraData=UiCurrentLine.GetLineString())
- InfBianryUiItemObj.SetFeatureFlagExp(UiContent[3])
-
- InfBianryUiItemObj.SetSupArchList(__SupArchList)
-
- #
- # Determine binary file name duplicate. Follow below rule:
- #
- # A binary filename must not be duplicated within
- # a [Binaries] section. A binary filename may appear in
- # multiple architectural [Binaries] sections. A binary
- # filename listed in an architectural [Binaries] section
- # must not be listed in the common architectural
- # [Binaries] section.
- #
- # NOTE: This check will not report error now.
- #
-# for Item in self.Binaries:
-# if Item.GetFileName() == InfBianryUiItemObj.GetFileName():
-# ItemSupArchList = Item.GetSupArchList()
-# for ItemArch in ItemSupArchList:
-# for UiItemObjArch in __SupArchList:
-# if ItemArch == UiItemObjArch:
-# #
-# # ST.ERR_INF_PARSER_ITEM_DUPLICATE
-# #
-# pass
-# if ItemArch.upper() == 'COMMON' or UiItemObjArch.upper() == 'COMMON':
-# #
-# # ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
-# #
-# pass
-
- if InfBianryUiItemObj != None:
- if self.Binaries.has_key((InfBianryUiItemObj)):
- BinariesList = self.Binaries[InfBianryUiItemObj]
- BinariesList.append((InfBianryUiItemObj, UiComment))
- self.Binaries[InfBianryUiItemObj] = BinariesList
- else:
- BinariesList = []
- BinariesList.append((InfBianryUiItemObj, UiComment))
- self.Binaries[InfBianryUiItemObj] = BinariesList
- if Ver != None and len(Ver) > 0:
- self.CheckVer(Ver, __SupArchList)
- if CommonBinary and len(CommonBinary) > 0:
- self.ParseCommonBinary(CommonBinary, __SupArchList)
-
- return True
-
- def GetBinary(self):
- return self.Binaries
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfBuildOptionObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfBuildOptionObject.py
deleted file mode 100644
index 5549525a6c..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfBuildOptionObject.py
+++ /dev/null
@@ -1,93 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [BuildOptions] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfBuildOptionObject
-'''
-
-from Library import GlobalData
-
-from Object.Parser.InfCommonObject import InfSectionCommonDef
-
-class InfBuildOptionItem():
- def __init__(self):
- self.Content = ''
- self.SupArchList = []
- self.AsBuildList = []
-
- def SetContent(self, Content):
- self.Content = Content
- def GetContent(self):
- return self.Content
-
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
- def GetSupArchList(self):
- return self.SupArchList
-
- #
- # AsBuild Information
- #
- def SetAsBuildList(self, AsBuildList):
- self.AsBuildList = AsBuildList
- def GetAsBuildList(self):
- return self.AsBuildList
-
-
-## INF BuildOption section
-# Macro define is not permitted for this section.
-#
-#
-class InfBuildOptionsObject(InfSectionCommonDef):
- def __init__(self):
- self.BuildOptions = []
- InfSectionCommonDef.__init__(self)
- ## SetBuildOptions function
- #
- # For BuildOptionName, need to validate it's format
- # For BuildOptionValue, just ignore it.
- #
- # @param Arch Indicated which arch of build options belong to.
- # @param BuildOptCont A list contain BuildOption related information.
- # The element in the list contain 3 members.
- # BuildOptionName, BuildOptionValue and IsReplace
- # flag.
- #
- # @return True Build options set/validate successfully
- # @return False Build options set/validate failed
- #
- def SetBuildOptions(self, BuildOptCont, ArchList = None, SectionContent = ''):
-
- if not GlobalData.gIS_BINARY_INF:
-
- if SectionContent.strip() != '':
- InfBuildOptionItemObj = InfBuildOptionItem()
- InfBuildOptionItemObj.SetContent(SectionContent)
- InfBuildOptionItemObj.SetSupArchList(ArchList)
-
- self.BuildOptions.append(InfBuildOptionItemObj)
- else:
- #
- # For AsBuild INF file
- #
- if len(BuildOptCont) >= 1:
- InfBuildOptionItemObj = InfBuildOptionItem()
- InfBuildOptionItemObj.SetAsBuildList(BuildOptCont)
- self.BuildOptions.append(InfBuildOptionItemObj)
-
-
- return True
-
- def GetBuildOptions(self):
- return self.BuildOptions \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py
deleted file mode 100644
index 217b0941da..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py
+++ /dev/null
@@ -1,162 +0,0 @@
-## @file
-# This file is used to define common class objects for INF file.
-# It will consumed by InfParser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfCommonObject
-'''
-
-## InfLineCommentObject
-#
-# Comment Object for any line in the INF file
-#
-# #
-# # HeaderComment
-# #
-# Line # TailComment
-#
-class InfLineCommentObject():
- def __init__(self):
- self.HeaderComments = ''
- self.TailComments = ''
-
- def SetHeaderComments(self, HeaderComments):
- self.HeaderComments = HeaderComments
-
- def GetHeaderComments(self):
- return self.HeaderComments
-
- def SetTailComments(self, TailComments):
- self.TailComments = TailComments
-
- def GetTailComments(self):
- return self.TailComments
-
-## CurrentLine
-#
-class CurrentLine():
- def __init__(self):
- self.LineNo = ''
- self.LineString = ''
- self.FileName = ''
-
- ## SetLineNo
- #
- # @param LineNo: LineNo
- #
- def SetLineNo(self, LineNo):
- self.LineNo = LineNo
-
- ## GetLineNo
- #
- def GetLineNo(self):
- return self.LineNo
-
- ## SetLineString
- #
- # @param LineString: Line String content
- #
- def SetLineString(self, LineString):
- self.LineString = LineString
-
- ## GetLineString
- #
- def GetLineString(self):
- return self.LineString
-
- ## SetFileName
- #
- # @param FileName: File Name
- #
- def SetFileName(self, FileName):
- self.FileName = FileName
-
- ## GetFileName
- #
- def GetFileName(self):
- return self.FileName
-
-##
-# Inf Section common data
-#
-class InfSectionCommonDef():
- def __init__(self):
- #
- # #
- # # HeaderComments at here
- # #
- # [xxSection] TailComments at here
- # data
- #
- self.HeaderComments = ''
- self.TailComments = ''
- #
- # The support arch list of this section
- #
- self.SupArchList = []
-
- #
- # Store all section content
- # Key is supported Arch
- #
- self.AllContent = {}
-
- ## SetHeaderComments
- #
- # @param HeaderComments: HeaderComments
- #
- def SetHeaderComments(self, HeaderComments):
- self.HeaderComments = HeaderComments
-
- ## GetHeaderComments
- #
- def GetHeaderComments(self):
- return self.HeaderComments
-
- ## SetTailComments
- #
- # @param TailComments: TailComments
- #
- def SetTailComments(self, TailComments):
- self.TailComments = TailComments
-
- ## GetTailComments
- #
- def GetTailComments(self):
- return self.TailComments
-
- ## SetSupArchList
- #
- # @param Arch: Arch
- #
- def SetSupArchList(self, Arch):
- if Arch not in self.SupArchList:
- self.SupArchList.append(Arch)
-
- ## GetSupArchList
- #
- def GetSupArchList(self):
- return self.SupArchList
-
- ## SetAllContent
- #
- # @param ArchList: ArchList
- # @param Content: Content
- #
- def SetAllContent(self, Content):
- self.AllContent = Content
-
- ## GetAllContent
- #
- def GetAllContent(self):
- return self.AllContent
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfDefineCommonObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfDefineCommonObject.py
deleted file mode 100644
index d565e65a65..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfDefineCommonObject.py
+++ /dev/null
@@ -1,89 +0,0 @@
-## @file
-# This file is used to define common class objects of [Defines] section for INF file.
-# It will consumed by InfParser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfDefineCommonObject
-'''
-
-from Object.Parser.InfCommonObject import InfLineCommentObject
-
-## InfDefineImageExeParamItem
-#
-class InfDefineImageExeParamItem():
- def __init__(self):
- self.CName = ''
- self.FeatureFlagExp = ''
- self.Comments = InfLineCommentObject()
-
- def SetCName(self, CName):
- self.CName = CName
- def GetCName(self):
- return self.CName
- def SetFeatureFlagExp(self, FeatureFlagExp):
- self.FeatureFlagExp = FeatureFlagExp
- def GetFeatureFlagExp(self):
- return self.FeatureFlagExp
-
-## InfDefineEntryPointItem
-#
-class InfDefineEntryPointItem(InfDefineImageExeParamItem):
- def __init__(self):
- InfDefineImageExeParamItem.__init__(self)
-
-## InfDefineUnloadImageItem
-#
-class InfDefineUnloadImageItem(InfDefineImageExeParamItem):
- def __init__(self):
- InfDefineImageExeParamItem.__init__(self)
-
-## InfDefineConstructorItem
-#
-class InfDefineConstructorItem(InfDefineImageExeParamItem):
- def __init__(self):
- InfDefineImageExeParamItem.__init__(self)
- self.SupModList = []
-
- def SetSupModList(self, SupModList):
- self.SupModList = SupModList
- def GetSupModList(self):
- return self.SupModList
-
-## InfDefineDestructorItem
-#
-class InfDefineDestructorItem(InfDefineImageExeParamItem):
- def __init__(self):
- InfDefineImageExeParamItem.__init__(self)
- self.SupModList = []
-
- def SetSupModList(self, SupModList):
- self.SupModList = SupModList
- def GetSupModList(self):
- return self.SupModList
-
-## InfDefineLibraryItem
-#
-class InfDefineLibraryItem():
- def __init__(self):
- self.LibraryName = ''
- self.Types = []
- self.Comments = InfLineCommentObject()
-
- def SetLibraryName(self, Name):
- self.LibraryName = Name
- def GetLibraryName(self):
- return self.LibraryName
- def SetTypes(self, Type):
- self.Types = Type
- def GetTypes(self):
- return self.Types \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py
deleted file mode 100644
index c7883e6980..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py
+++ /dev/null
@@ -1,995 +0,0 @@
-## @file
-# This file is used to define class objects of [Defines] section for INF file.
-# It will consumed by InfParser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfDefineObject
-'''
-
-import os
-import re
-
-from Logger import StringTable as ST
-from Logger import ToolError
-from Library import GlobalData
-from Library import DataType as DT
-from Library.String import GetSplitValueList
-from Library.Misc import CheckGuidRegFormat
-from Library.Misc import Sdict
-from Library.Misc import ConvPathFromAbsToRel
-from Library.ExpressionValidate import IsValidFeatureFlagExp
-from Library.ParserValidate import IsValidWord
-from Library.ParserValidate import IsValidInfMoudleType
-from Library.ParserValidate import IsValidHex
-from Library.ParserValidate import IsValidHexVersion
-from Library.ParserValidate import IsValidDecVersion
-from Library.ParserValidate import IsValidCVariableName
-from Library.ParserValidate import IsValidBoolType
-from Library.ParserValidate import IsValidPath
-from Library.ParserValidate import IsValidFamily
-from Library.ParserValidate import IsValidIdentifier
-from Library.ParserValidate import IsValidDecVersionVal
-from Object.Parser.InfCommonObject import InfLineCommentObject
-from Object.Parser.InfCommonObject import CurrentLine
-from Object.Parser.InfCommonObject import InfSectionCommonDef
-from Object.Parser.InfMisc import ErrorInInf
-from Object.Parser.InfDefineCommonObject import InfDefineLibraryItem
-from Object.Parser.InfDefineCommonObject import InfDefineEntryPointItem
-from Object.Parser.InfDefineCommonObject import InfDefineUnloadImageItem
-from Object.Parser.InfDefineCommonObject import InfDefineConstructorItem
-from Object.Parser.InfDefineCommonObject import InfDefineDestructorItem
-
-class InfDefSectionOptionRomInfo():
- def __init__(self):
- self.PciVendorId = None
- self.PciDeviceId = None
- self.PciClassCode = None
- self.PciRevision = None
- self.PciCompress = None
- self.CurrentLine = ['', -1, '']
- def SetPciVendorId(self, PciVendorId, Comments):
- #
- # Value has been set before.
- #
- if self.PciVendorId != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(DT.TAB_INF_DEFINES_PCI_VENDOR_ID),
- LineInfo=self.CurrentLine)
- return False
- #
- # The PciVendorId should be hex string.
- #
- if (IsValidHex(PciVendorId)):
- self.PciVendorId = InfDefMember()
- self.PciVendorId.SetValue(PciVendorId)
- self.PciVendorId.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(PciVendorId),
- LineInfo=self.CurrentLine)
- return False
-
- def GetPciVendorId(self):
- return self.PciVendorId
-
- def SetPciDeviceId(self, PciDeviceId, Comments):
- #
- # Value has been set before.
- #
- if self.PciDeviceId != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(DT.TAB_INF_DEFINES_PCI_DEVICE_ID),
- LineInfo=self.CurrentLine)
- return False
- #
- # The PciDeviceId should be hex string.
- #
- if (IsValidHex(PciDeviceId)):
- self.PciDeviceId = InfDefMember()
- self.PciDeviceId.SetValue(PciDeviceId)
- self.PciDeviceId.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(PciDeviceId),
- LineInfo=self.CurrentLine)
- return False
-
- def GetPciDeviceId(self):
- return self.PciDeviceId
-
- def SetPciClassCode(self, PciClassCode, Comments):
- #
- # Value has been set before.
- #
- if self.PciClassCode != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(DT.TAB_INF_DEFINES_PCI_CLASS_CODE),
- LineInfo=self.CurrentLine)
- return False
- #
- # The PciClassCode should be 4 bytes hex string.
- #
- if (IsValidHex(PciClassCode)):
- self.PciClassCode = InfDefMember()
- self.PciClassCode.SetValue(PciClassCode)
- self.PciClassCode.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%\
- (PciClassCode),
- LineInfo=self.CurrentLine)
- return False
-
- def GetPciClassCode(self):
- return self.PciClassCode
-
- def SetPciRevision(self, PciRevision, Comments):
- #
- # Value has been set before.
- #
- if self.PciRevision != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(DT.TAB_INF_DEFINES_PCI_REVISION),
- LineInfo=self.CurrentLine)
- return False
- #
- # The PciRevision should be 4 bytes hex string.
- #
- if (IsValidHex(PciRevision)):
- self.PciRevision = InfDefMember()
- self.PciRevision.SetValue(PciRevision)
- self.PciRevision.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(PciRevision),
- LineInfo=self.CurrentLine)
- return False
-
- def GetPciRevision(self):
- return self.PciRevision
-
- def SetPciCompress(self, PciCompress, Comments):
- #
- # Value has been set before.
- #
- if self.PciCompress != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(DT.TAB_INF_DEFINES_PCI_COMPRESS),
- LineInfo=self.CurrentLine)
- return False
-
- #
- # The PciCompress should be 'TRUE' or 'FALSE'.
- #
- if (PciCompress == 'TRUE' or PciCompress == 'FALSE'):
- self.PciCompress = InfDefMember()
- self.PciCompress.SetValue(PciCompress)
- self.PciCompress.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(PciCompress),
- LineInfo=self.CurrentLine)
- return False
- def GetPciCompress(self):
- return self.PciCompress
-##
-# INF [Define] section Object
-#
-class InfDefSection(InfDefSectionOptionRomInfo):
- def __init__(self):
- self.BaseName = None
- self.FileGuid = None
- self.ModuleType = None
- self.InfVersion = None
- self.EdkReleaseVersion = None
- self.UefiSpecificationVersion = None
- self.PiSpecificationVersion = None
- self.LibraryClass = []
- self.Package = None
- self.VersionString = None
- self.PcdIsDriver = None
- self.EntryPoint = []
- self.UnloadImages = []
- self.Constructor = []
- self.Destructor = []
- self.Shadow = None
- self.CustomMakefile = []
- self.Specification = []
- self.UefiHiiResourceSection = None
- self.DpxSource = []
- self.CurrentLine = ['', -1, '']
- InfDefSectionOptionRomInfo.__init__(self)
-
- ## SetHeadComment
- #
- # @param BaseName: BaseName
- #
- def SetBaseName(self, BaseName, Comments):
- #
- # Value has been set before.
- #
- if self.BaseName != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(DT.TAB_INF_DEFINES_BASE_NAME),
- LineInfo=self.CurrentLine)
- return False
-
- if not (BaseName == '' or BaseName == None):
- if IsValidWord(BaseName) and not BaseName.startswith("_"):
- self.BaseName = InfDefMember()
- self.BaseName.SetValue(BaseName)
- self.BaseName.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_NAME_INVALID%(BaseName),
- LineInfo=self.CurrentLine)
- return False
-
- ## GetBaseName
- #
- def GetBaseName(self):
- return self.BaseName
-
- ## SetFileGuid
- #
- # @param FileGuid: FileGuid
- #
- def SetFileGuid(self, FileGuid, Comments):
- #
- # Value has been set before.
- #
- if self.FileGuid != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
- %(DT.TAB_INF_DEFINES_FILE_GUID),
- LineInfo=self.CurrentLine)
- return False
- #
- # Do verification of GUID content/format
- #
- if (CheckGuidRegFormat(FileGuid)):
- self.FileGuid = InfDefMember()
- self.FileGuid.SetValue(FileGuid)
- self.FileGuid.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_GUID_INVALID%(FileGuid),
- LineInfo=self.CurrentLine)
- return False
-
- ## GetFileGuid
- #
- def GetFileGuid(self):
- return self.FileGuid
-
- ## SetModuleType
- #
- # @param ModuleType: ModuleType
- #
- def SetModuleType(self, ModuleType, Comments):
- #
- # Value has been set before.
- #
- if self.ModuleType != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
- %(DT.TAB_INF_DEFINES_MODULE_TYPE),
- LineInfo=self.CurrentLine)
- return False
- #
- # Valid Module Type or not
- #
- if (IsValidInfMoudleType(ModuleType)):
- self.ModuleType = InfDefMember()
- self.ModuleType.SetValue(ModuleType)
- self.ModuleType.CurrentLine = CurrentLine()
- self.ModuleType.CurrentLine.SetLineNo(self.CurrentLine[1])
- self.ModuleType.CurrentLine.SetLineString(self.CurrentLine[2])
- self.ModuleType.CurrentLine.SetFileName(self.CurrentLine[0])
- self.ModuleType.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID%\
- (ModuleType),
- LineInfo=self.CurrentLine)
- return False
-
- ## GetModuleType
- #
- def GetModuleType(self):
- return self.ModuleType
-
- ## SetInfVersion
- #
- # @param InfVersion: InfVersion
- #
- def SetInfVersion(self, InfVersion, Comments):
- #
- # Value has been set before.
- #
- if self.InfVersion != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
- %(DT.TAB_INF_DEFINES_INF_VERSION),
- LineInfo=self.CurrentLine)
- return False
- #
- # The InfVersion should be 4 bytes hex string.
- #
- if (IsValidHex(InfVersion)):
- if (InfVersion < '0x00010005'):
- ErrorInInf(ST.ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF,
- ErrorCode=ToolError.EDK1_INF_ERROR,
- LineInfo=self.CurrentLine)
-
- self.InfVersion = InfDefMember()
- self.InfVersion.SetValue(InfVersion)
- self.InfVersion.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(InfVersion),
- LineInfo=self.CurrentLine)
- return False
-
- ## GetInfVersion
- #
- def GetInfVersion(self):
- return self.InfVersion
-
- ## SetEdkReleaseVersion
- #
- # @param EdkReleaseVersion: EdkReleaseVersion
- #
- def SetEdkReleaseVersion(self, EdkReleaseVersion, Comments):
- #
- # Value has been set before.
- #
- if self.EdkReleaseVersion != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
- %(DT.TAB_INF_DEFINES_EDK_RELEASE_VERSION),
- LineInfo=self.CurrentLine)
- return False
- #
- # The EdkReleaseVersion should be 4 bytes hex string.
- #
- if IsValidHexVersion(EdkReleaseVersion) or \
- IsValidDecVersionVal(EdkReleaseVersion):
- self.EdkReleaseVersion = InfDefMember()
- self.EdkReleaseVersion.SetValue(EdkReleaseVersion)
- self.EdkReleaseVersion.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID\
- %(EdkReleaseVersion),
- LineInfo=self.CurrentLine)
- return False
-
- ## GetEdkReleaseVersion
- #
- def GetEdkReleaseVersion(self):
- return self.EdkReleaseVersion
-
- ## SetUefiSpecificationVersion
- #
- # @param UefiSpecificationVersion: UefiSpecificationVersion
- #
- def SetUefiSpecificationVersion(self, UefiSpecificationVersion, Comments):
- #
- # Value has been set before.
- #
- if self.UefiSpecificationVersion != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
- %(DT.TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION),
- LineInfo=self.CurrentLine)
- return False
- #
- # The EdkReleaseVersion should be 4 bytes hex string.
- #
- if IsValidHexVersion(UefiSpecificationVersion) or \
- IsValidDecVersionVal(UefiSpecificationVersion):
- self.UefiSpecificationVersion = InfDefMember()
- self.UefiSpecificationVersion.SetValue(UefiSpecificationVersion)
- self.UefiSpecificationVersion.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID\
- %(UefiSpecificationVersion),
- LineInfo=self.CurrentLine)
- return False
-
- ## GetUefiSpecificationVersion
- #
- def GetUefiSpecificationVersion(self):
- return self.UefiSpecificationVersion
-
- ## SetPiSpecificationVersion
- #
- # @param PiSpecificationVersion: PiSpecificationVersion
- #
- def SetPiSpecificationVersion(self, PiSpecificationVersion, Comments):
- #
- # Value has been set before.
- #
- if self.PiSpecificationVersion != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
- %(DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSION),
- LineInfo=self.CurrentLine)
- return False
- #
- # The EdkReleaseVersion should be 4 bytes hex string.
- #
- if IsValidHexVersion(PiSpecificationVersion) or \
- IsValidDecVersionVal(PiSpecificationVersion):
- self.PiSpecificationVersion = InfDefMember()
- self.PiSpecificationVersion.SetValue(PiSpecificationVersion)
- self.PiSpecificationVersion.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID\
- %(PiSpecificationVersion),
- LineInfo=self.CurrentLine)
- return False
-
- ## GetPiSpecificationVersion
- #
- def GetPiSpecificationVersion(self):
- return self.PiSpecificationVersion
-
- ## SetLibraryClass
- #
- # @param LibraryClass: LibraryClass
- #
- def SetLibraryClass(self, LibraryClass, Comments):
- ValueList = GetSplitValueList(LibraryClass)
- Name = ValueList[0]
- if IsValidWord(Name):
- InfDefineLibraryItemObj = InfDefineLibraryItem()
- InfDefineLibraryItemObj.SetLibraryName(Name)
- InfDefineLibraryItemObj.Comments = Comments
- if len(ValueList) == 2:
- Type = ValueList[1]
- TypeList = GetSplitValueList(Type, ' ')
- TypeList = [Type for Type in TypeList if Type != '']
- for Item in TypeList:
- if Item not in DT.MODULE_LIST:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Item),
- LineInfo=self.CurrentLine)
- return False
- InfDefineLibraryItemObj.SetTypes(TypeList)
- self.LibraryClass.append(InfDefineLibraryItemObj)
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Name),
- LineInfo=self.CurrentLine)
- return False
-
- return True
-
- def GetLibraryClass(self):
- return self.LibraryClass
-
- def SetVersionString(self, VersionString, Comments):
- #
- # Value has been set before.
- #
- if self.VersionString != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
- %(DT.TAB_INF_DEFINES_VERSION_STRING),
- LineInfo=self.CurrentLine)
- return False
- if not IsValidDecVersion(VersionString):
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID\
- %(VersionString),
- LineInfo=self.CurrentLine)
- self.VersionString = InfDefMember()
- self.VersionString.SetValue(VersionString)
- self.VersionString.Comments = Comments
- return True
-
-
- def GetVersionString(self):
- return self.VersionString
-
- def SetPcdIsDriver(self, PcdIsDriver, Comments):
- #
- # Value has been set before.
- #
- if self.PcdIsDriver != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\
- %(DT.TAB_INF_DEFINES_PCD_IS_DRIVER),
- LineInfo=self.CurrentLine)
- return False
- if PcdIsDriver == 'PEI_PCD_DRIVER' or PcdIsDriver == 'DXE_PCD_DRIVER':
- self.PcdIsDriver = InfDefMember()
- self.PcdIsDriver.SetValue(PcdIsDriver)
- self.PcdIsDriver.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(PcdIsDriver),
- LineInfo=self.CurrentLine)
- return False
-
- def GetPcdIsDriver(self):
- return self.PcdIsDriver
-
- #
- # SetEntryPoint
- #
- def SetEntryPoint(self, EntryPoint, Comments):
- #
- # It can be a list
- #
- ValueList = []
-
- TokenList = GetSplitValueList(EntryPoint, DT.TAB_VALUE_SPLIT)
- ValueList[0:len(TokenList)] = TokenList
-
- InfDefineEntryPointItemObj = InfDefineEntryPointItem()
- if not IsValidCVariableName(ValueList[0]):
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%\
- (ValueList[0]),
- LineInfo=self.CurrentLine)
- InfDefineEntryPointItemObj.SetCName(ValueList[0])
- if len(ValueList) == 2:
- if ValueList[1].strip() == '':
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%\
- (ValueList[1]),
- LineInfo=self.CurrentLine)
- #
- # Validate FFE
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(ValueList[1].strip())
- if not FeatureFlagRtv[0]:
- ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%\
- (FeatureFlagRtv[1]),
- LineInfo=self.CurrentLine)
-
- InfDefineEntryPointItemObj.SetFeatureFlagExp(ValueList[1])
- if len(ValueList) > 2:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(EntryPoint),
- LineInfo=self.CurrentLine)
-
- InfDefineEntryPointItemObj.Comments = Comments
- self.EntryPoint.append(InfDefineEntryPointItemObj)
-
- def GetEntryPoint(self):
- return self.EntryPoint
-
- #
- # SetUnloadImages
- #
- def SetUnloadImages(self, UnloadImages, Comments):
- #
- # It can be a list
- #
- ValueList = []
-
- TokenList = GetSplitValueList(UnloadImages, DT.TAB_VALUE_SPLIT)
- ValueList[0:len(TokenList)] = TokenList
-
- InfDefineUnloadImageItemObj = InfDefineUnloadImageItem()
- if not IsValidCVariableName(ValueList[0]):
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[0]),
- LineInfo=self.CurrentLine)
- InfDefineUnloadImageItemObj.SetCName(ValueList[0])
- if len(ValueList) == 2:
- if ValueList[1].strip() == '':
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[1]),
- LineInfo=self.CurrentLine)
- #
- # Validate FFE
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(ValueList[1].strip())
- if not FeatureFlagRtv[0]:
- ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%(FeatureFlagRtv[1]),
- LineInfo=self.CurrentLine)
- InfDefineUnloadImageItemObj.SetFeatureFlagExp(ValueList[1])
-
- if len(ValueList) > 2:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(UnloadImages),
- LineInfo=self.CurrentLine)
-
- InfDefineUnloadImageItemObj.Comments = Comments
- self.UnloadImages.append(InfDefineUnloadImageItemObj)
-
- def GetUnloadImages(self):
- return self.UnloadImages
-
- #
- # SetConstructor
- #
- def SetConstructor(self, Constructor, Comments):
- #
- # It can be a list
- #
- ValueList = []
-
- TokenList = GetSplitValueList(Constructor, DT.TAB_VALUE_SPLIT)
- ValueList[0:len(TokenList)] = TokenList
-
- InfDefineConstructorItemObj = InfDefineConstructorItem()
- if not IsValidCVariableName(ValueList[0]):
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[0]),
- LineInfo=self.CurrentLine)
- InfDefineConstructorItemObj.SetCName(ValueList[0])
- if len(ValueList) >= 2:
- ModList = GetSplitValueList(ValueList[1], ' ')
- if ValueList[1].strip() == '':
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[1]),
- LineInfo=self.CurrentLine)
- for ModItem in ModList:
- if ModItem not in DT.MODULE_LIST:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID%(ModItem),
- LineInfo=self.CurrentLine)
- InfDefineConstructorItemObj.SetSupModList(ModList)
- if len(ValueList) == 3:
- if ValueList[2].strip() == '':
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[2]),
- LineInfo=self.CurrentLine)
- #
- # Validate FFE
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(ValueList[2].strip())
- if not FeatureFlagRtv[0]:
- ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%(FeatureFlagRtv[2]),
- LineInfo=self.CurrentLine)
- InfDefineConstructorItemObj.SetFeatureFlagExp(ValueList[2])
-
- if len(ValueList) > 3:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Constructor),
- LineInfo=self.CurrentLine)
-
- InfDefineConstructorItemObj.Comments = Comments
- self.Constructor.append(InfDefineConstructorItemObj)
-
- def GetConstructor(self):
- return self.Constructor
-
- #
- # SetDestructor
- #
- def SetDestructor(self, Destructor, Comments):
- #
- # It can be a list and only 1 set to TRUE
- #
- ValueList = []
-
- TokenList = GetSplitValueList(Destructor, DT.TAB_VALUE_SPLIT)
- ValueList[0:len(TokenList)] = TokenList
-
- InfDefineDestructorItemObj = InfDefineDestructorItem()
- if not IsValidCVariableName(ValueList[0]):
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[0]),
- LineInfo=self.CurrentLine)
- InfDefineDestructorItemObj.SetCName(ValueList[0])
- if len(ValueList) >= 2:
- ModList = GetSplitValueList(ValueList[1].strip(), ' ')
- if ValueList[1].strip() == '':
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[1]),
- LineInfo=self.CurrentLine)
- for ModItem in ModList:
- if ModItem not in DT.MODULE_LIST:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID%(ModItem),
- LineInfo=self.CurrentLine)
- InfDefineDestructorItemObj.SetSupModList(ModList)
- if len(ValueList) == 3:
- if ValueList[2].strip() == '':
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[2]),
- LineInfo=self.CurrentLine)
- #
- # Validate FFE
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(ValueList[2].strip())
- if not FeatureFlagRtv[0]:
- ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%(FeatureFlagRtv[1]),
- LineInfo=self.CurrentLine)
- InfDefineDestructorItemObj.SetFeatureFlagExp(ValueList[2])
-
- if len(ValueList) > 3:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Destructor),
- LineInfo=self.CurrentLine)
-
- InfDefineDestructorItemObj.Comments = Comments
- self.Destructor.append(InfDefineDestructorItemObj)
-
- def GetDestructor(self):
- return self.Destructor
-
- def SetShadow(self, Shadow, Comments):
- #
- # Value has been set before.
- #
- if self.Shadow != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(DT.TAB_INF_DEFINES_SHADOW),
- LineInfo=self.CurrentLine)
- return False
- if (IsValidBoolType(Shadow)):
- self.Shadow = InfDefMember()
- self.Shadow.SetValue(Shadow)
- self.Shadow.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Shadow),
- LineInfo=self.CurrentLine)
- return False
- def GetShadow(self):
- return self.Shadow
-
-
-
- #
- # <Family> ::= {"MSFT"} {"GCC"}
- # <CustomMake> ::= [<Family> "|"] <Filename>
- #
- def SetCustomMakefile(self, CustomMakefile, Comments):
- if not (CustomMakefile == '' or CustomMakefile == None):
- ValueList = GetSplitValueList(CustomMakefile)
- if len(ValueList) == 1:
- FileName = ValueList[0]
- Family = ''
- else:
- Family = ValueList[0]
- FileName = ValueList[1]
- Family = Family.strip()
- if Family != '':
- if not IsValidFamily(Family):
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Family),
- LineInfo=self.CurrentLine)
- return False
- #
- # The MakefileName specified file should exist
- #
- IsValidFileFlag = False
- ModulePath = os.path.split(self.CurrentLine[0])[0]
- if IsValidPath(FileName, ModulePath):
- IsValidFileFlag = True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID%(FileName),
- LineInfo=self.CurrentLine)
- return False
- if IsValidFileFlag:
- FileName = ConvPathFromAbsToRel(FileName, GlobalData.gINF_MODULE_DIR)
- self.CustomMakefile.append((Family, FileName, Comments))
- IsValidFileFlag = False
- return True
- else:
- return False
-
- def GetCustomMakefile(self):
- return self.CustomMakefile
-
- #
- # ["SPEC" <Spec> <EOL>]*{0,}
- # <Spec> ::= <Word> "=" <VersionVal>
- # <VersionVal> ::= {<HexVersion>] {<DecVersion>}
- # <HexNumber> ::= "0x" [<HexDigit>]{1,}
- # <DecVersion> ::= (0-9){1,} ["." (0-9){1,2}]
- #
- def SetSpecification(self, Specification, Comments):
- #
- # Valid the value of Specification
- #
- __ValueList = []
- TokenList = GetSplitValueList(Specification, DT.TAB_EQUAL_SPLIT, 1)
- __ValueList[0:len(TokenList)] = TokenList
- if len(__ValueList) != 2:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_NO_NAME + ' Or ' + ST.ERR_INF_PARSER_DEFINE_ITEM_NO_VALUE,
- LineInfo=self.CurrentLine)
- Name = __ValueList[0].strip()
- Version = __ValueList[1].strip()
- if IsValidIdentifier(Name):
- if IsValidDecVersion(Version):
- self.Specification.append((Name, Version, Comments))
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Version),
- LineInfo=self.CurrentLine)
- return False
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Name),
- LineInfo=self.CurrentLine)
- return False
-
- return True
-
- def GetSpecification(self):
- return self.Specification
-
- #
- # [<UefiHiiResource> <EOL>]{0,1}
- # <UefiHiiResource> ::= "UEFI_HII_RESOURCE_SECTION" "=" <BoolType>
- #
- def SetUefiHiiResourceSection(self, UefiHiiResourceSection, Comments):
- #
- # Value has been set before.
- #
- if self.UefiHiiResourceSection != None:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND
- %(DT.TAB_INF_DEFINES_UEFI_HII_RESOURCE_SECTION),
- LineInfo=self.CurrentLine)
- return False
- if not (UefiHiiResourceSection == '' or UefiHiiResourceSection == None):
- if (IsValidBoolType(UefiHiiResourceSection)):
- self.UefiHiiResourceSection = InfDefMember()
- self.UefiHiiResourceSection.SetValue(UefiHiiResourceSection)
- self.UefiHiiResourceSection.Comments = Comments
- return True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(UefiHiiResourceSection),
- LineInfo=self.CurrentLine)
- return False
- else:
- return False
-
- def GetUefiHiiResourceSection(self):
- return self.UefiHiiResourceSection
-
- def SetDpxSource(self, DpxSource, Comments):
- #
- # The MakefileName specified file should exist
- #
- IsValidFileFlag = False
- ModulePath = os.path.split(self.CurrentLine[0])[0]
- if IsValidPath(DpxSource, ModulePath):
- IsValidFileFlag = True
- else:
- ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID%(DpxSource),
- LineInfo=self.CurrentLine)
- return False
- if IsValidFileFlag:
- DpxSource = ConvPathFromAbsToRel(DpxSource,
- GlobalData.gINF_MODULE_DIR)
- self.DpxSource.append((DpxSource, Comments))
- IsValidFileFlag = False
- return True
-
- def GetDpxSource(self):
- return self.DpxSource
-
-gFUNCTION_MAPPING_FOR_DEFINE_SECTION = {
- #
- # Required Fields
- #
- DT.TAB_INF_DEFINES_BASE_NAME : InfDefSection.SetBaseName,
- DT.TAB_INF_DEFINES_FILE_GUID : InfDefSection.SetFileGuid,
- DT.TAB_INF_DEFINES_MODULE_TYPE : InfDefSection.SetModuleType,
- #
- # Required by EDKII style INF file
- #
- DT.TAB_INF_DEFINES_INF_VERSION : InfDefSection.SetInfVersion,
- #
- # Optional Fields
- #
- DT.TAB_INF_DEFINES_EDK_RELEASE_VERSION : InfDefSection.SetEdkReleaseVersion,
- DT.TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION : InfDefSection.SetUefiSpecificationVersion,
- DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSION : InfDefSection.SetPiSpecificationVersion,
- DT.TAB_INF_DEFINES_LIBRARY_CLASS : InfDefSection.SetLibraryClass,
- DT.TAB_INF_DEFINES_VERSION_STRING : InfDefSection.SetVersionString,
- DT.TAB_INF_DEFINES_PCD_IS_DRIVER : InfDefSection.SetPcdIsDriver,
- DT.TAB_INF_DEFINES_ENTRY_POINT : InfDefSection.SetEntryPoint,
- DT.TAB_INF_DEFINES_UNLOAD_IMAGE : InfDefSection.SetUnloadImages,
- DT.TAB_INF_DEFINES_CONSTRUCTOR : InfDefSection.SetConstructor,
- DT.TAB_INF_DEFINES_DESTRUCTOR : InfDefSection.SetDestructor,
- DT.TAB_INF_DEFINES_SHADOW : InfDefSection.SetShadow,
- DT.TAB_INF_DEFINES_PCI_VENDOR_ID : InfDefSection.SetPciVendorId,
- DT.TAB_INF_DEFINES_PCI_DEVICE_ID : InfDefSection.SetPciDeviceId,
- DT.TAB_INF_DEFINES_PCI_CLASS_CODE : InfDefSection.SetPciClassCode,
- DT.TAB_INF_DEFINES_PCI_REVISION : InfDefSection.SetPciRevision,
- DT.TAB_INF_DEFINES_PCI_COMPRESS : InfDefSection.SetPciCompress,
- DT.TAB_INF_DEFINES_CUSTOM_MAKEFILE : InfDefSection.SetCustomMakefile,
- DT.TAB_INF_DEFINES_SPEC : InfDefSection.SetSpecification,
- DT.TAB_INF_DEFINES_UEFI_HII_RESOURCE_SECTION : InfDefSection.SetUefiHiiResourceSection,
- DT.TAB_INF_DEFINES_DPX_SOURCE : InfDefSection.SetDpxSource
-}
-
-## InfDefMember
-#
-#
-class InfDefMember():
- def __init__(self, Name='', Value=''):
- self.Comments = InfLineCommentObject()
- self.Name = Name
- self.Value = Value
- self.CurrentLine = CurrentLine()
-
- def GetName(self):
- return self.Name
- def SetName(self, Name):
- self.Name = Name
- def GetValue(self):
- return self.Value
- def SetValue(self, Value):
- self.Value = Value
-
-## InfDefObject
-#
-#
-class InfDefObject(InfSectionCommonDef):
- def __init__(self):
- self.Defines = Sdict()
- InfSectionCommonDef.__init__(self)
- def SetDefines(self, DefineContent, Arch = None):
- #
- # Validate Arch
- #
- HasFoundInfVersionFalg = False
- LineInfo = ['', -1, '']
- ArchListString = ' '.join(Arch)
-
- #
- # Parse Define items.
- #
- for InfDefMemberObj in DefineContent:
- ProcessFunc = None
- Name = InfDefMemberObj.GetName()
- Value = InfDefMemberObj.GetValue()
- InfLineCommentObj = InfLineCommentObject()
- InfLineCommentObj.SetHeaderComments(InfDefMemberObj.Comments.GetHeaderComments())
- InfLineCommentObj.SetTailComments(InfDefMemberObj.Comments.GetTailComments())
- if Name == 'COMPONENT_TYPE':
- ErrorInInf(ST.ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF,
- ErrorCode=ToolError.EDK1_INF_ERROR,
- RaiseError=True)
- if Name == DT.TAB_INF_DEFINES_INF_VERSION:
- HasFoundInfVersionFalg = True
-
- if not (Name == '' or Name == None):
- #
- # Process "SPEC" Keyword definition.
- #
- ReName = re.compile(r"SPEC ", re.DOTALL)
- if ReName.match(Name):
- SpecValue = Name[Name.find("SPEC") + len("SPEC"):].strip()
- Name = "SPEC"
- Value = SpecValue + " = " + Value
- if self.Defines.has_key(ArchListString):
- DefineList = self.Defines[ArchListString]
- LineInfo[0] = InfDefMemberObj.CurrentLine.GetFileName()
- LineInfo[1] = InfDefMemberObj.CurrentLine.GetLineNo()
- LineInfo[2] = InfDefMemberObj.CurrentLine.GetLineString()
- DefineList.CurrentLine = LineInfo
- #
- # Found the process function from mapping table.
- #
- if Name not in gFUNCTION_MAPPING_FOR_DEFINE_SECTION.keys():
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_SECTION_KEYWORD_INVALID%(Name),
- LineInfo=LineInfo)
-
- else:
- ProcessFunc = gFUNCTION_MAPPING_FOR_DEFINE_SECTION[Name]
- if (ProcessFunc != None):
- ProcessFunc(DefineList, Value, InfLineCommentObj)
- self.Defines[ArchListString] = DefineList
- else:
- DefineList = InfDefSection()
- LineInfo[0] = InfDefMemberObj.CurrentLine.GetFileName()
- LineInfo[1] = InfDefMemberObj.CurrentLine.GetLineNo()
- LineInfo[2] = InfDefMemberObj.CurrentLine.GetLineString()
- DefineList.CurrentLine = LineInfo
- #
- # Found the process function from mapping table.
- #
- if Name not in gFUNCTION_MAPPING_FOR_DEFINE_SECTION.keys():
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_SECTION_KEYWORD_INVALID%(Name),
- LineInfo=LineInfo)
- #
- # Found the process function from mapping table.
- #
- else:
- ProcessFunc = gFUNCTION_MAPPING_FOR_DEFINE_SECTION[Name]
- if (ProcessFunc != None):
- ProcessFunc(DefineList, Value, InfLineCommentObj)
- self.Defines[ArchListString] = DefineList
-
- #
- # After set, check whether INF_VERSION defined.
- #
- if not HasFoundInfVersionFalg:
- ErrorInInf(ST.ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF,
- ErrorCode=ToolError.EDK1_INF_ERROR,
- RaiseError=True)
- return True
-
- def GetDefines(self):
- return self.Defines
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py
deleted file mode 100644
index 55d6bbc69e..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py
+++ /dev/null
@@ -1,166 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [Depex] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfDepexObject
-'''
-
-from Library import DataType as DT
-from Library import GlobalData
-import Logger.Log as Logger
-from Logger import ToolError
-from Logger import StringTable as ST
-
-from Object.Parser.InfCommonObject import InfSectionCommonDef
-from Library.ParserValidate import IsValidArch
-
-class InfDepexContentItem():
- def __init__(self):
- self.SectionType = ''
- self.SectionString = ''
-
- def SetSectionType(self, SectionType):
- self.SectionType = SectionType
- def GetSectionType(self):
- return self.SectionType
-
- def SetSectionString(self, SectionString):
- self.SectionString = SectionString
- def GetSectionString(self):
- return self.SectionString
-
-
-class InfDepexItem():
- def __init__(self):
- self.DepexContent = ''
- self.ModuleType = ''
- self.SupArch = ''
- self.HelpString = ''
- self.FeatureFlagExp = ''
- self.InfDepexContentItemList = []
-
- def SetFeatureFlagExp(self, FeatureFlagExp):
- self.FeatureFlagExp = FeatureFlagExp
- def GetFeatureFlagExp(self):
- return self.FeatureFlagExp
-
- def SetSupArch(self, Arch):
- self.SupArch = Arch
- def GetSupArch(self):
- return self.SupArch
-
- def SetHelpString(self, HelpString):
- self.HelpString = HelpString
- def GetHelpString(self):
- return self.HelpString
-
- def SetModuleType(self, Type):
- self.ModuleType = Type
- def GetModuleType(self):
- return self.ModuleType
-
- def SetDepexConent(self, Content):
- self.DepexContent = Content
- def GetDepexContent(self):
- return self.DepexContent
-
- def SetInfDepexContentItemList(self, InfDepexContentItemList):
- self.InfDepexContentItemList = InfDepexContentItemList
- def GetInfDepexContentItemList(self):
- return self.InfDepexContentItemList
-
-## InfDepexObject
-#
-#
-#
-class InfDepexObject(InfSectionCommonDef):
- def __init__(self):
- self.Depex = []
- self.AllContent = ''
- self.SectionContent = ''
- InfSectionCommonDef.__init__(self)
-
- def SetDepex(self, DepexContent, KeyList=None, CommentList=None):
- for KeyItem in KeyList:
- Arch = KeyItem[0]
- ModuleType = KeyItem[1]
- InfDepexItemIns = InfDepexItem()
-
- #
- # Validate Arch
- #
- if IsValidArch(Arch.strip().upper()):
- InfDepexItemIns.SetSupArch(Arch)
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_NAME_INVALID % (Arch),
- File=GlobalData.gINF_MODULE_NAME,
- Line=KeyItem[2])
-
- #
- # Validate Module Type
- #
- if ModuleType and ModuleType != 'COMMON':
- if ModuleType in DT.VALID_DEPEX_MODULE_TYPE_LIST:
- InfDepexItemIns.SetModuleType(ModuleType)
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEPEX_SECTION_MODULE_TYPE_ERROR % (ModuleType),
- File=GlobalData.gINF_MODULE_NAME,
- Line=KeyItem[2])
-
- #
- # Parser content in [Depex] section.
- #
- DepexString = ''
- HelpString = ''
- #
- # Get Depex Expression
- #
- for Line in DepexContent:
- LineContent = Line[0].strip()
- if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- LineContent = LineContent[:LineContent.find(DT.TAB_COMMENT_SPLIT)]
- if LineContent:
- DepexString = DepexString + LineContent + DT.END_OF_LINE
- continue
-
- if DepexString.endswith(DT.END_OF_LINE):
- DepexString = DepexString[:-1]
-
- if not DepexString.strip():
- continue
-
- #
- # Get Help Text
- #
- for HelpLine in CommentList:
- HelpString = HelpString + HelpLine + DT.END_OF_LINE
- if HelpString.endswith(DT.END_OF_LINE):
- HelpString = HelpString[:-1]
-
- InfDepexItemIns.SetDepexConent(DepexString)
- InfDepexItemIns.SetHelpString(HelpString)
-
- self.Depex.append(InfDepexItemIns)
-
- return True
-
- def GetDepex(self):
- return self.Depex
-
- def GetAllContent(self):
- return self.AllContent
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py
deleted file mode 100644
index 4f1a3f4e81..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py
+++ /dev/null
@@ -1,350 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [Guids] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfGuidObject
-'''
-
-from Library.ParserValidate import IsValidCVariableName
-from Library.CommentParsing import ParseComment
-from Library.ExpressionValidate import IsValidFeatureFlagExp
-
-from Library.Misc import Sdict
-from Library import DataType as DT
-import Logger.Log as Logger
-from Logger import ToolError
-from Logger import StringTable as ST
-
-class InfGuidItemCommentContent():
- def __init__(self):
- #
- # ## SOMETIMES_CONSUMES ## Variable:L"MemoryTypeInformation"
- # TailString.
- #
- #
- # SOMETIMES_CONSUMES
- #
- self.UsageItem = ''
- #
- # Variable
- #
- self.GuidTypeItem = ''
- #
- # MemoryTypeInformation
- #
- self.VariableNameItem = ''
- #
- # TailString
- #
- self.HelpStringItem = ''
-
- def SetUsageItem(self, UsageItem):
- self.UsageItem = UsageItem
- def GetUsageItem(self):
- return self.UsageItem
-
- def SetGuidTypeItem(self, GuidTypeItem):
- self.GuidTypeItem = GuidTypeItem
- def GetGuidTypeItem(self):
- return self.GuidTypeItem
-
- def SetVariableNameItem(self, VariableNameItem):
- self.VariableNameItem = VariableNameItem
- def GetVariableNameItem(self):
- return self.VariableNameItem
-
- def SetHelpStringItem(self, HelpStringItem):
- self.HelpStringItem = HelpStringItem
- def GetHelpStringItem(self):
- return self.HelpStringItem
-
-class InfGuidItem():
- def __init__(self):
- self.Name = ''
- self.FeatureFlagExp = ''
- #
- # A list contain instance of InfGuidItemCommentContent
- #
- self.CommentList = []
- self.SupArchList = []
-
- def SetName(self, Name):
- self.Name = Name
- def GetName(self):
- return self.Name
-
- def SetFeatureFlagExp(self, FeatureFlagExp):
- self.FeatureFlagExp = FeatureFlagExp
- def GetFeatureFlagExp(self):
- return self.FeatureFlagExp
-
- def SetCommentList(self, CommentList):
- self.CommentList = CommentList
- def GetCommentList(self):
- return self.CommentList
-
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
- def GetSupArchList(self):
- return self.SupArchList
-
-## ParseComment
-#
-# ParseComment
-#
-def ParseGuidComment(CommentsList, InfGuidItemObj):
- #
- # Get/Set Usage and HelpString
- #
- if CommentsList != None and len(CommentsList) != 0 :
- CommentInsList = []
- PreUsage = None
- PreGuidType = None
- PreHelpText = ''
- BlockFlag = -1
- Count = 0
- for CommentItem in CommentsList:
- Count = Count + 1
- CommentItemUsage, \
- CommentItemGuidType, \
- CommentItemVarString, \
- CommentItemHelpText = \
- ParseComment(CommentItem,
- DT.ALL_USAGE_TOKENS,
- DT.GUID_TYPE_TOKENS,
- [],
- True)
-
- if CommentItemHelpText == None:
- CommentItemHelpText = ''
- if Count == len(CommentsList) and CommentItemUsage == CommentItemGuidType == DT.ITEM_UNDEFINED:
- CommentItemHelpText = DT.END_OF_LINE
-
- if Count == len(CommentsList):
- if BlockFlag == 1 or BlockFlag == 2:
- if CommentItemUsage == CommentItemGuidType == DT.ITEM_UNDEFINED:
- BlockFlag = 4
- else:
- BlockFlag = 3
- if BlockFlag == -1:
- BlockFlag = 4
- if BlockFlag == -1 or BlockFlag == 1 or BlockFlag == 2:
- if CommentItemUsage == CommentItemGuidType == DT.ITEM_UNDEFINED:
- if BlockFlag == -1:
- BlockFlag = 1
- elif BlockFlag == 1:
- BlockFlag = 2
- else:
- if BlockFlag == 1 or BlockFlag == 2:
- BlockFlag = 3
- elif BlockFlag == -1:
- BlockFlag = 4
-
- #
- # Combine two comment line if they are generic comment
- #
- if CommentItemUsage == CommentItemGuidType == PreUsage == PreGuidType == DT.ITEM_UNDEFINED:
- CommentItemHelpText = PreHelpText + DT.END_OF_LINE + CommentItemHelpText
-
- PreHelpText = CommentItemHelpText
-
- if BlockFlag == 4:
- CommentItemIns = InfGuidItemCommentContent()
- CommentItemIns.SetUsageItem(CommentItemUsage)
- CommentItemIns.SetGuidTypeItem(CommentItemGuidType)
- CommentItemIns.SetVariableNameItem(CommentItemVarString)
- CommentItemIns.SetHelpStringItem(CommentItemHelpText)
- CommentInsList.append(CommentItemIns)
-
- BlockFlag = -1
- PreUsage = None
- PreGuidType = None
- PreHelpText = ''
-
- elif BlockFlag == 3:
- #
- # Add previous help string
- #
- CommentItemIns = InfGuidItemCommentContent()
- CommentItemIns.SetUsageItem(DT.ITEM_UNDEFINED)
- CommentItemIns.SetGuidTypeItem(DT.ITEM_UNDEFINED)
- if PreHelpText == '' or PreHelpText.endswith(DT.END_OF_LINE):
- PreHelpText += DT.END_OF_LINE
- CommentItemIns.SetHelpStringItem(PreHelpText)
- CommentInsList.append(CommentItemIns)
- #
- # Add Current help string
- #
- CommentItemIns = InfGuidItemCommentContent()
- CommentItemIns.SetUsageItem(CommentItemUsage)
- CommentItemIns.SetGuidTypeItem(CommentItemGuidType)
- CommentItemIns.SetVariableNameItem(CommentItemVarString)
- CommentItemIns.SetHelpStringItem(CommentItemHelpText)
- CommentInsList.append(CommentItemIns)
-
- BlockFlag = -1
- PreUsage = None
- PreGuidType = None
- PreHelpText = ''
-
- else:
- PreUsage = CommentItemUsage
- PreGuidType = CommentItemGuidType
- PreHelpText = CommentItemHelpText
-
- InfGuidItemObj.SetCommentList(CommentInsList)
- else:
- #
- # Still need to set the USAGE/GUIDTYPE to undefined.
- #
- CommentItemIns = InfGuidItemCommentContent()
- CommentItemIns.SetUsageItem(DT.ITEM_UNDEFINED)
- CommentItemIns.SetGuidTypeItem(DT.ITEM_UNDEFINED)
- InfGuidItemObj.SetCommentList([CommentItemIns])
-
- return InfGuidItemObj
-
-## InfGuidObject
-#
-# InfGuidObject
-#
-class InfGuidObject():
- def __init__(self):
- self.Guids = Sdict()
- #
- # Macro defined in this section should be only used in this section.
- #
- self.Macros = {}
-
- def SetGuid(self, GuidList, Arch = None):
- __SupportArchList = []
- for ArchItem in Arch:
- #
- # Validate Arch
- #
- if (ArchItem == '' or ArchItem == None):
- ArchItem = 'COMMON'
-
- __SupportArchList.append(ArchItem)
-
- for Item in GuidList:
- #
- # Get Comment content of this protocol
- #
- CommentsList = None
- if len(Item) == 3:
- CommentsList = Item[1]
- CurrentLineOfItem = Item[2]
- Item = Item[0]
- InfGuidItemObj = InfGuidItem()
- if len(Item) >= 1 and len(Item) <= 2:
- #
- # Only GuildName contained
- #
- if not IsValidCVariableName(Item[0]):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_INVALID_CNAME%(Item[0]),
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- if (Item[0] != ''):
- InfGuidItemObj.SetName(Item[0])
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_CNAME_MISSING,
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- if len(Item) == 2:
- #
- # Contained CName and Feature Flag Express
- # <statements> ::= <CName> ["|" <FeatureFlagExpress>]
- # For GUID entry.
- #
- if Item[1].strip() == '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- #
- # Validate Feature Flag Express
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(Item[1].strip())
- if not FeatureFlagRtv[0]:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%(FeatureFlagRtv[1]),
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- InfGuidItemObj.SetFeatureFlagExp(Item[1])
- if len(Item) != 1 and len(Item) != 2:
- #
- # Invalid format of GUID statement
- #
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_GUID_PPI_PROTOCOL_SECTION_CONTENT_ERROR,
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
-
- InfGuidItemObj = ParseGuidComment(CommentsList, InfGuidItemObj)
- InfGuidItemObj.SetSupArchList(__SupportArchList)
-
- #
- # Determine GUID name duplicate. Follow below rule:
- #
- # A GUID must not be duplicated within a [Guids] section.
- # A GUID may appear in multiple architectural [Guids]
- # sections. A GUID listed in an architectural [Guids]
- # section must not be listed in the common architectural
- # [Guids] section.
- #
- # NOTE: This check will not report error now.
- #
- for Item in self.Guids:
- if Item.GetName() == InfGuidItemObj.GetName():
- ItemSupArchList = Item.GetSupArchList()
- for ItemArch in ItemSupArchList:
- for GuidItemObjArch in __SupportArchList:
- if ItemArch == GuidItemObjArch:
- #
- # ST.ERR_INF_PARSER_ITEM_DUPLICATE
- #
- pass
-
- if ItemArch.upper() == 'COMMON' or GuidItemObjArch.upper() == 'COMMON':
- #
- # ST.ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
- #
- pass
-
- if self.Guids.has_key((InfGuidItemObj)):
- GuidList = self.Guids[InfGuidItemObj]
- GuidList.append(InfGuidItemObj)
- self.Guids[InfGuidItemObj] = GuidList
- else:
- GuidList = []
- GuidList.append(InfGuidItemObj)
- self.Guids[InfGuidItemObj] = GuidList
-
- return True
-
- def GetGuid(self):
- return self.Guids \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py
deleted file mode 100644
index 45fba31aaa..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py
+++ /dev/null
@@ -1,119 +0,0 @@
-## @file
-# This file is used to define class objects of INF file header.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfHeaderObject
-'''
-
-## INF file header object
-#
-# A sample file header
-#
-# ## @file xxx.inf FileName
-# # Abstract
-# #
-# # Description
-# #
-# # Copyright
-# #
-# # License
-# #
-#
-class InfHeaderObject():
- def __init__(self):
- self.FileName = ''
- self.Abstract = ''
- self.Description = ''
- self.Copyright = ''
- self.License = ''
-
- ## SetFileName
- #
- # @param FileName: File Name
- #
- def SetFileName(self, FileName):
- if not (FileName == '' or FileName == None):
- self.FileName = FileName
- return True
- else:
- return False
-
- ## GetFileName
- #
- def GetFileName(self):
- return self.FileName
-
- ## SetAbstract
- #
- # @param Abstract: Abstract
- #
- def SetAbstract(self, Abstract):
- if not (Abstract == '' or Abstract == None):
- self.Abstract = Abstract
- return True
- else:
- return False
-
- ## GetAbstract
- #
- def GetAbstract(self):
- return self.Abstract
-
- ## SetDescription
- #
- # @param Description: Description content
- #
- def SetDescription(self, Description):
- if not (Description == '' or Description == None):
- self.Description = Description
- return True
- else:
- return False
-
- ## GetAbstract
- #
- def GetDescription(self):
- return self.Description
-
- ## SetCopyright
- #
- # @param Copyright: Copyright content
- #
- def SetCopyright(self, Copyright):
- if not (Copyright == '' or Copyright == None):
- self.Copyright = Copyright
- return True
- else:
- return False
-
- ## GetCopyright
- #
- def GetCopyright(self):
- return self.Copyright
-
- ## SetCopyright
- #
- # @param License: License content
- #
- def SetLicense(self, License):
- if not (License == '' or License == None):
- self.License = License
- return True
- else:
- return False
-
- ## GetLicense
- #
- def GetLicense(self):
- return self.License \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.py
deleted file mode 100644
index a37692ee23..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.py
+++ /dev/null
@@ -1,252 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [LibraryClasses] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfLibraryClassesObject
-'''
-
-from Logger import StringTable as ST
-from Logger import ToolError
-import Logger.Log as Logger
-from Library import GlobalData
-
-from Library.Misc import Sdict
-from Object.Parser.InfCommonObject import CurrentLine
-from Library.ExpressionValidate import IsValidFeatureFlagExp
-from Library.ParserValidate import IsValidLibName
-
-## GetArchModuleType
-#
-# Get Arch List and ModuleType List
-#
-def GetArchModuleType(KeyList):
- __SupArchList = []
- __SupModuleList = []
-
- for (ArchItem, ModuleItem) in KeyList:
- #
- # Validate Arch
- #
- if (ArchItem == '' or ArchItem == None):
- ArchItem = 'COMMON'
-
- if (ModuleItem == '' or ModuleItem == None):
- ModuleItem = 'COMMON'
-
- if ArchItem not in __SupArchList:
- __SupArchList.append(ArchItem)
-
- List = ModuleItem.split('|')
- for Entry in List:
- if Entry not in __SupModuleList:
- __SupModuleList.append(Entry)
-
- return (__SupArchList, __SupModuleList)
-
-
-class InfLibraryClassItem():
- def __init__(self, LibName='', FeatureFlagExp='', HelpString=None):
- self.LibName = LibName
- self.FeatureFlagExp = FeatureFlagExp
- self.HelpString = HelpString
- self.CurrentLine = CurrentLine()
- self.SupArchList = []
- self.SupModuleList = []
- self.FileGuid = ''
- self.Version = ''
-
- def SetLibName(self, LibName):
- self.LibName = LibName
- def GetLibName(self):
- return self.LibName
-
- def SetHelpString(self, HelpString):
- self.HelpString = HelpString
- def GetHelpString(self):
- return self.HelpString
-
- def SetFeatureFlagExp(self, FeatureFlagExp):
- self.FeatureFlagExp = FeatureFlagExp
- def GetFeatureFlagExp(self):
- return self.FeatureFlagExp
-
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
- def GetSupArchList(self):
- return self.SupArchList
-
- def SetSupModuleList(self, SupModuleList):
- self.SupModuleList = SupModuleList
- def GetSupModuleList(self):
- return self.SupModuleList
-
- #
- # As Build related information
- #
- def SetFileGuid(self, FileGuid):
- self.FileGuid = FileGuid
- def GetFileGuid(self):
- return self.FileGuid
-
- def SetVersion(self, Version):
- self.Version = Version
- def GetVersion(self):
- return self.Version
-
-## INF LibraryClass Section
-#
-#
-#
-class InfLibraryClassObject():
- def __init__(self):
- self.LibraryClasses = Sdict()
- #
- # Macro defined in this section should be only used in this section.
- #
- self.Macros = {}
-
- ##SetLibraryClasses
- #
- #
- # @param HelpString: It can be a common comment or contain a recommend
- # instance.
- #
- def SetLibraryClasses(self, LibContent, KeyList=None):
- #
- # Validate Arch
- #
- (__SupArchList, __SupModuleList) = GetArchModuleType(KeyList)
-
- for LibItem in LibContent:
- LibItemObj = InfLibraryClassItem()
- if not GlobalData.gIS_BINARY_INF:
- HelpStringObj = LibItem[1]
- LibItemObj.CurrentLine.SetFileName(LibItem[2][2])
- LibItemObj.CurrentLine.SetLineNo(LibItem[2][1])
- LibItemObj.CurrentLine.SetLineString(LibItem[2][0])
- LibItem = LibItem[0]
- if HelpStringObj != None:
- LibItemObj.SetHelpString(HelpStringObj)
- if len(LibItem) >= 1:
- if LibItem[0].strip() != '':
- if IsValidLibName(LibItem[0].strip()):
- if LibItem[0].strip() != 'NULL':
- LibItemObj.SetLibName(LibItem[0])
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_LIB_NAME_INVALID,
- File=GlobalData.gINF_MODULE_NAME,
- Line=LibItemObj.CurrentLine.GetLineNo(),
- ExtraData=LibItemObj.CurrentLine.GetLineString())
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (LibItem[0]),
- File=GlobalData.gINF_MODULE_NAME,
- Line=LibItemObj.CurrentLine.GetLineNo(),
- ExtraData=LibItemObj.CurrentLine.GetLineString())
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_LIBRARY_SECTION_LIBNAME_MISSING,
- File=GlobalData.gINF_MODULE_NAME,
- Line=LibItemObj.CurrentLine.GetLineNo(),
- ExtraData=LibItemObj.CurrentLine.GetLineString())
- if len(LibItem) == 2:
- if LibItem[1].strip() == '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
- File=GlobalData.gINF_MODULE_NAME,
- Line=LibItemObj.CurrentLine.GetLineNo(),
- ExtraData=LibItemObj.CurrentLine.GetLineString())
- #
- # Validate FFE
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(LibItem[1].strip())
- if not FeatureFlagRtv[0]:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID % (FeatureFlagRtv[1]),
- File=GlobalData.gINF_MODULE_NAME,
- Line=LibItemObj.CurrentLine.GetLineNo(),
- ExtraData=LibItemObj.CurrentLine.GetLineString())
- LibItemObj.SetFeatureFlagExp(LibItem[1].strip())
-
- #
- # Invalid strings
- #
- if len(LibItem) < 1 or len(LibItem) > 2:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_LIBRARY_SECTION_CONTENT_ERROR,
- File=GlobalData.gINF_MODULE_NAME,
- Line=LibItemObj.CurrentLine.GetLineNo(),
- ExtraData=LibItemObj.CurrentLine.GetLineString())
-
- LibItemObj.SetSupArchList(__SupArchList)
- LibItemObj.SetSupModuleList(__SupModuleList)
-
- #
- # Determine Library class duplicate. Follow below rule:
- #
- # A library class keyword must not be duplicated within a
- # [LibraryClasses] section. Library class keywords may appear in
- # multiple architectural and module type [LibraryClasses] sections.
- # A library class keyword listed in an architectural or module type
- # [LibraryClasses] section must not be listed in the common
- # architectural or module type [LibraryClasses] section.
- #
- # NOTE: This check will not report error now. But keep code for future enhancement.
- #
-# for Item in self.LibraryClasses:
-# if Item.GetLibName() == LibItemObj.GetLibName():
-# ItemSupArchList = Item.GetSupArchList()
-# ItemSupModuleList = Item.GetSupModuleList()
-# for ItemArch in ItemSupArchList:
-# for ItemModule in ItemSupModuleList:
-# for LibItemObjArch in __SupArchList:
-# for LibItemObjModule in __SupModuleList:
-# if ItemArch == LibItemObjArch and LibItemObjModule == ItemModule:
-# #
-# # ERR_INF_PARSER_ITEM_DUPLICATE
-# #
-# pass
-# if (ItemArch.upper() == 'COMMON' or LibItemObjArch.upper() == 'COMMON') \
-# and LibItemObjModule == ItemModule:
-# #
-# # ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
-# #
-# pass
- else:
- #
- # Assume the file GUID is well formatted.
- #
- LibItemObj.SetFileGuid(LibItem[0])
- LibItemObj.SetVersion(LibItem[1])
-
- if self.LibraryClasses.has_key((LibItemObj)):
- LibraryList = self.LibraryClasses[LibItemObj]
- LibraryList.append(LibItemObj)
- self.LibraryClasses[LibItemObj] = LibraryList
- else:
- LibraryList = []
- LibraryList.append(LibItemObj)
- self.LibraryClasses[LibItemObj] = LibraryList
-
- return True
-
- def GetLibraryClasses(self):
- return self.LibraryClasses
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfMisc.py b/BaseTools/Source/Python/UPT/Object/Parser/InfMisc.py
deleted file mode 100644
index 74099e2088..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfMisc.py
+++ /dev/null
@@ -1,148 +0,0 @@
-## @file
-# This file is used to define class objects of INF file miscellaneous.
-# Include BootMode/HOB/Event and others. It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfMisc
-'''
-
-import Logger.Log as Logger
-from Logger import ToolError
-
-from Library import DataType as DT
-from Object.Parser.InfCommonObject import InfSectionCommonDef
-from Library.Misc import Sdict
-
-##
-# BootModeObject
-#
-class InfBootModeObject():
- def __init__(self):
- self.SupportedBootModes = ''
- self.HelpString = ''
- self.Usage = ''
-
- def SetSupportedBootModes(self, SupportedBootModes):
- self.SupportedBootModes = SupportedBootModes
- def GetSupportedBootModes(self):
- return self.SupportedBootModes
-
- def SetHelpString(self, HelpString):
- self.HelpString = HelpString
- def GetHelpString(self):
- return self.HelpString
-
- def SetUsage(self, Usage):
- self.Usage = Usage
- def GetUsage(self):
- return self.Usage
-##
-# EventObject
-#
-class InfEventObject():
- def __init__(self):
- self.EventType = ''
- self.HelpString = ''
- self.Usage = ''
-
- def SetEventType(self, EventType):
- self.EventType = EventType
-
- def GetEventType(self):
- return self.EventType
-
- def SetHelpString(self, HelpString):
- self.HelpString = HelpString
- def GetHelpString(self):
- return self.HelpString
-
- def SetUsage(self, Usage):
- self.Usage = Usage
- def GetUsage(self):
- return self.Usage
-##
-# HobObject
-#
-class InfHobObject():
- def __init__(self):
- self.HobType = ''
- self.Usage = ''
- self.SupArchList = []
- self.HelpString = ''
-
- def SetHobType(self, HobType):
- self.HobType = HobType
-
- def GetHobType(self):
- return self.HobType
-
- def SetUsage(self, Usage):
- self.Usage = Usage
- def GetUsage(self):
- return self.Usage
-
- def SetSupArchList(self, ArchList):
- self.SupArchList = ArchList
- def GetSupArchList(self):
- return self.SupArchList
-
- def SetHelpString(self, HelpString):
- self.HelpString = HelpString
- def GetHelpString(self):
- return self.HelpString
-
-##
-# InfSpecialCommentObject
-#
-class InfSpecialCommentObject(InfSectionCommonDef):
- def __init__(self):
- self.SpecialComments = Sdict()
- InfSectionCommonDef.__init__(self)
-
- def SetSpecialComments(self, SepcialSectionList = None, Type = ''):
- if Type == DT.TYPE_HOB_SECTION or \
- Type == DT.TYPE_EVENT_SECTION or \
- Type == DT.TYPE_BOOTMODE_SECTION:
- for Item in SepcialSectionList:
- if self.SpecialComments.has_key(Type):
- ObjList = self.SpecialComments[Type]
- ObjList.append(Item)
- self.SpecialComments[Type] = ObjList
- else:
- ObjList = []
- ObjList.append(Item)
- self.SpecialComments[Type] = ObjList
-
- return True
-
- def GetSpecialComments(self):
- return self.SpecialComments
-
-
-
-## ErrorInInf
-#
-# An encapsulate of Error for INF parser.
-#
-def ErrorInInf(Message=None, ErrorCode=None, LineInfo=None, RaiseError=True):
- if ErrorCode == None:
- ErrorCode = ToolError.FORMAT_INVALID
- if LineInfo == None:
- LineInfo = ['', -1, '']
- Logger.Error("InfParser",
- ErrorCode,
- Message=Message,
- File=LineInfo[0],
- Line=LineInfo[1],
- ExtraData=LineInfo[2],
- RaiseError=RaiseError) \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py
deleted file mode 100644
index 37399134db..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py
+++ /dev/null
@@ -1,187 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [Packages] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfPackageObject
-'''
-
-from Logger import StringTable as ST
-from Logger import ToolError
-import Logger.Log as Logger
-from Library import GlobalData
-
-from Library.Misc import Sdict
-from Library.ParserValidate import IsValidPath
-from Library.ExpressionValidate import IsValidFeatureFlagExp
-
-class InfPackageItem():
- def __init__(self,
- PackageName = '',
- FeatureFlagExp = '',
- HelpString = ''):
- self.PackageName = PackageName
- self.FeatureFlagExp = FeatureFlagExp
- self.HelpString = HelpString
- self.SupArchList = []
-
- def SetPackageName(self, PackageName):
- self.PackageName = PackageName
- def GetPackageName(self):
- return self.PackageName
-
- def SetFeatureFlagExp(self, FeatureFlagExp):
- self.FeatureFlagExp = FeatureFlagExp
- def GetFeatureFlagExp(self):
- return self.FeatureFlagExp
-
- def SetHelpString(self, HelpString):
- self.HelpString = HelpString
- def GetHelpString(self):
- return self.HelpString
-
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
- def GetSupArchList(self):
- return self.SupArchList
-
-
-## INF package section
-#
-#
-#
-class InfPackageObject():
- def __init__(self):
- self.Packages = Sdict()
- #
- # Macro defined in this section should be only used in this section.
- #
- self.Macros = {}
-
- def SetPackages(self, PackageData, Arch = None):
- IsValidFileFlag = False
- SupArchList = []
- for ArchItem in Arch:
- #
- # Validate Arch
- #
- if (ArchItem == '' or ArchItem == None):
- ArchItem = 'COMMON'
- SupArchList.append(ArchItem)
-
- for PackageItem in PackageData:
- PackageItemObj = InfPackageItem()
- HelpStringObj = PackageItem[1]
- CurrentLineOfPackItem = PackageItem[2]
- PackageItem = PackageItem[0]
- if HelpStringObj != None:
- HelpString = HelpStringObj.HeaderComments + HelpStringObj.TailComments
- PackageItemObj.SetHelpString(HelpString)
- if len(PackageItem) >= 1:
- #
- # Validate file exist/format.
- #
- if IsValidPath(PackageItem[0], ''):
- IsValidFileFlag = True
- elif IsValidPath(PackageItem[0], GlobalData.gINF_MODULE_DIR):
- IsValidFileFlag = True
- elif IsValidPath(PackageItem[0], GlobalData.gWORKSPACE):
- IsValidFileFlag = True
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID%(PackageItem[0]),
- File=CurrentLineOfPackItem[2],
- Line=CurrentLineOfPackItem[1],
- ExtraData=CurrentLineOfPackItem[0])
- return False
- if IsValidFileFlag:
- PackageItemObj.SetPackageName(PackageItem[0])
- if len(PackageItem) == 2:
- #
- # Validate Feature Flag Express
- #
- if PackageItem[1].strip() == '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
- File=CurrentLineOfPackItem[2],
- Line=CurrentLineOfPackItem[1],
- ExtraData=CurrentLineOfPackItem[0])
- #
- # Validate FFE
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(PackageItem[1].strip())
- if not FeatureFlagRtv[0]:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%(FeatureFlagRtv[1]),
- File=CurrentLineOfPackItem[2],
- Line=CurrentLineOfPackItem[1],
- ExtraData=CurrentLineOfPackItem[0])
-
- PackageItemObj.SetFeatureFlagExp(PackageItem[1].strip())
-
- if len(PackageItem) > 2:
- #
- # Invalid format of Package statement
- #
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_PACKAGE_SECTION_CONTENT_ERROR,
- File=CurrentLineOfPackItem[2],
- Line=CurrentLineOfPackItem[1],
- ExtraData=CurrentLineOfPackItem[0])
- PackageItemObj.SetSupArchList(SupArchList)
-
- #
- # Determine package file name duplicate. Follow below rule:
- #
- # A package filename must not be duplicated within a [Packages]
- # section. Package filenames may appear in multiple architectural
- # [Packages] sections. A package filename listed in an
- # architectural [Packages] section must not be listed in the common
- # architectural [Packages] section.
- #
- # NOTE: This check will not report error now.
- #
- for Item in self.Packages:
- if Item.GetPackageName() == PackageItemObj.GetPackageName():
- ItemSupArchList = Item.GetSupArchList()
- for ItemArch in ItemSupArchList:
- for PackageItemObjArch in SupArchList:
- if ItemArch == PackageItemObjArch:
- #
- # ST.ERR_INF_PARSER_ITEM_DUPLICATE
- #
- pass
- if ItemArch.upper() == 'COMMON' or PackageItemObjArch.upper() == 'COMMON':
- #
- # ST.ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
- #
- pass
-
- if self.Packages.has_key((PackageItemObj)):
- PackageList = self.Packages[PackageItemObj]
- PackageList.append(PackageItemObj)
- self.Packages[PackageItemObj] = PackageList
- else:
- PackageList = []
- PackageList.append(PackageItemObj)
- self.Packages[PackageItemObj] = PackageList
-
- return True
-
- def GetPackages(self, Arch = None):
- if Arch == None:
- return self.Packages \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py
deleted file mode 100644
index fc5227451a..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py
+++ /dev/null
@@ -1,640 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [Pcds] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfPcdObject
-'''
-import os
-import re
-
-from Logger import StringTable as ST
-from Logger import ToolError
-import Logger.Log as Logger
-from Library import GlobalData
-from Library import DataType as DT
-
-from Library.Misc import Sdict
-from Library.Misc import GetHelpStringByRemoveHashKey
-from Library.ParserValidate import IsValidPcdType
-from Library.ParserValidate import IsValidCVariableName
-from Library.ParserValidate import IsValidPcdValue
-from Library.ParserValidate import IsValidArch
-from Library.CommentParsing import ParseComment
-from Library.String import GetSplitValueList
-from Library.String import IsHexDigitUINT32
-from Library.ExpressionValidate import IsValidFeatureFlagExp
-from Parser.InfAsBuiltProcess import GetPackageListInfo
-from Parser.DecParser import Dec
-
-from Object.Parser.InfPackagesObject import InfPackageItem
-
-def ValidateArch(ArchItem, PcdTypeItem1, LineNo, SupArchDict, SupArchList):
- #
- # Validate Arch
- #
- if (ArchItem == '' or ArchItem == None):
- ArchItem = 'COMMON'
-
- if PcdTypeItem1.upper != DT.TAB_INF_FEATURE_PCD.upper():
- ArchList = GetSplitValueList(ArchItem, ' ')
- for ArchItemNew in ArchList:
- if not IsValidArch(ArchItemNew):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ArchItemNew),
- File=GlobalData.gINF_MODULE_NAME,
- Line=LineNo,
- ExtraData=ArchItemNew)
- SupArchDict[PcdTypeItem1] = ArchList
- else:
- SupArchList.append(ArchItem)
-
- return SupArchList, SupArchDict
-
-def ParsePcdComment(CommentList, PcdTypeItem, PcdItemObj):
- CommentInsList = []
- PreUsage = None
- PreHelpText = ''
- BlockFlag = -1
- FFEHelpText = ''
- CommentItemHelpText = ''
- Count = 0
- for CommentItem in CommentList:
- Count = Count + 1
- CommentItemUsage, CommentType, CommentString, CommentItemHelpText = ParseComment(CommentItem,
- DT.ALL_USAGE_TOKENS,
- {},
- [],
- False)
- if CommentType and CommentString:
- pass
-
- if PcdTypeItem == 'FeaturePcd':
- CommentItemUsage = DT.USAGE_ITEM_CONSUMES
- if CommentItemHelpText == None:
- CommentItemHelpText = ''
-
- if Count == 1:
- FFEHelpText = CommentItemHelpText
- else:
- FFEHelpText = FFEHelpText + DT.END_OF_LINE + CommentItemHelpText
-
- if Count == len(CommentList):
- CommentItemHelpText = FFEHelpText
- BlockFlag = 4
- else:
- continue
-
- if CommentItemHelpText == None:
- CommentItemHelpText = ''
- if Count == len(CommentList) and CommentItemUsage == DT.ITEM_UNDEFINED:
- CommentItemHelpText = DT.END_OF_LINE
-
- if Count == len(CommentList) and (BlockFlag == 1 or BlockFlag == 2):
- if CommentItemUsage == DT.ITEM_UNDEFINED:
- BlockFlag = 4
- else:
- BlockFlag = 3
- elif BlockFlag == -1 and Count == len(CommentList):
- BlockFlag = 4
-
- if BlockFlag == -1 or BlockFlag == 1 or BlockFlag == 2:
- if CommentItemUsage == DT.ITEM_UNDEFINED:
- if BlockFlag == -1:
- BlockFlag = 1
- elif BlockFlag == 1:
- BlockFlag = 2
- else:
- if BlockFlag == 1 or BlockFlag == 2:
- BlockFlag = 3
- elif BlockFlag == -1:
- BlockFlag = 4
- #
- # Combine two comment line if they are generic comment
- #
- if CommentItemUsage == PreUsage == DT.ITEM_UNDEFINED:
- CommentItemHelpText = PreHelpText + DT.END_OF_LINE + CommentItemHelpText
-
- PreHelpText = CommentItemHelpText
-
- if BlockFlag == 4:
- CommentItemIns = InfPcdItemCommentContent()
- CommentItemIns.SetUsageItem(CommentItemUsage)
- CommentItemIns.SetHelpStringItem(CommentItemHelpText)
- CommentInsList.append(CommentItemIns)
-
- BlockFlag = -1
- PreUsage = None
- PreHelpText = ''
-
- elif BlockFlag == 3:
- #
- # Add previous help string
- #
- CommentItemIns = InfPcdItemCommentContent()
- CommentItemIns.SetUsageItem(DT.ITEM_UNDEFINED)
- if PreHelpText == '' or PreHelpText.endswith(DT.END_OF_LINE):
- PreHelpText += DT.END_OF_LINE
- CommentItemIns.SetHelpStringItem(PreHelpText)
- CommentInsList.append(CommentItemIns)
- #
- # Add Current help string
- #
- CommentItemIns = InfPcdItemCommentContent()
- CommentItemIns.SetUsageItem(CommentItemUsage)
- CommentItemIns.SetHelpStringItem(CommentItemHelpText)
- CommentInsList.append(CommentItemIns)
-
- BlockFlag = -1
- PreUsage = None
- PreHelpText = ''
-
- else:
- PreUsage = CommentItemUsage
- PreHelpText = CommentItemHelpText
-
- PcdItemObj.SetHelpStringList(CommentInsList)
-
- return PcdItemObj
-
-class InfPcdItemCommentContent():
- def __init__(self):
- #
- # ## SOMETIMES_CONSUMES ## HelpString
- #
- self.UsageItem = ''
- #
- # Help String
- #
- self.HelpStringItem = ''
-
- def SetUsageItem(self, UsageItem):
- self.UsageItem = UsageItem
- def GetUsageItem(self):
- return self.UsageItem
-
- def SetHelpStringItem(self, HelpStringItem):
- self.HelpStringItem = HelpStringItem
- def GetHelpStringItem(self):
- return self.HelpStringItem
-
-## InfPcdItem
-#
-# This class defined Pcd item used in Module files
-#
-# @param CName: Input value for CName, default is ''
-# @param Token: Input value for Token, default is ''
-# @param TokenSpaceGuidCName: Input value for TokenSpaceGuidCName, default
-# is ''
-# @param DatumType: Input value for DatumType, default is ''
-# @param MaxDatumSize: Input value for MaxDatumSize, default is ''
-# @param DefaultValue: Input value for DefaultValue, default is ''
-# @param ItemType: Input value for ItemType, default is ''
-# @param ValidUsage: Input value for ValidUsage, default is []
-# @param SkuInfoList: Input value for SkuInfoList, default is {}
-# @param SupModuleList: Input value for SupModuleList, default is []
-#
-class InfPcdItem():
- def __init__(self):
- self.CName = ''
- self.Token = ''
- self.TokenSpaceGuidCName = ''
- self.TokenSpaceGuidValue = ''
- self.DatumType = ''
- self.MaxDatumSize = ''
- self.DefaultValue = ''
- self.Offset = ''
- self.ValidUsage = ''
- self.ItemType = ''
- self.SupModuleList = []
- self.HelpStringList = []
- self.FeatureFlagExp = ''
- self.SupArchList = []
- self.PcdErrorsList = []
-
- def SetCName(self, CName):
- self.CName = CName
- def GetCName(self):
- return self.CName
-
- def SetToken(self, Token):
- self.Token = Token
- def GetToken(self):
- return self.Token
-
- def SetTokenSpaceGuidCName(self, TokenSpaceGuidCName):
- self.TokenSpaceGuidCName = TokenSpaceGuidCName
- def GetTokenSpaceGuidCName(self):
- return self.TokenSpaceGuidCName
-
- def SetTokenSpaceGuidValue(self, TokenSpaceGuidValue):
- self.TokenSpaceGuidValue = TokenSpaceGuidValue
- def GetTokenSpaceGuidValue(self):
- return self.TokenSpaceGuidValue
-
- def SetDatumType(self, DatumType):
- self.DatumType = DatumType
- def GetDatumType(self):
- return self.DatumType
-
- def SetMaxDatumSize(self, MaxDatumSize):
- self.MaxDatumSize = MaxDatumSize
- def GetMaxDatumSize(self):
- return self.MaxDatumSize
-
- def SetDefaultValue(self, DefaultValue):
- self.DefaultValue = DefaultValue
- def GetDefaultValue(self):
- return self.DefaultValue
-
- def SetPcdErrorsList(self, PcdErrorsList):
- self.PcdErrorsList = PcdErrorsList
- def GetPcdErrorsList(self):
- return self.PcdErrorsList
-
- def SetItemType(self, ItemType):
- self.ItemType = ItemType
- def GetItemType(self):
- return self.ItemType
-
- def SetSupModuleList(self, SupModuleList):
- self.SupModuleList = SupModuleList
- def GetSupModuleList(self):
- return self.SupModuleList
-
- def SetHelpStringList(self, HelpStringList):
- self.HelpStringList = HelpStringList
- def GetHelpStringList(self):
- return self.HelpStringList
-
- def SetFeatureFlagExp(self, FeatureFlagExp):
- self.FeatureFlagExp = FeatureFlagExp
- def GetFeatureFlagExp(self):
- return self.FeatureFlagExp
-
- def SetSupportArchList(self, ArchList):
- self.SupArchList = ArchList
- def GetSupportArchList(self):
- return self.SupArchList
-
- def SetOffset(self, Offset):
- self.Offset = Offset
- def GetOffset(self):
- return self.Offset
-
-##
-#
-#
-#
-class InfPcdObject():
- def __init__(self, FileName):
- self.Pcds = Sdict()
- self.FileName = FileName
-
- def SetPcds(self, PcdContent, KeysList = None, PackageInfo = None):
-
- if GlobalData.gIS_BINARY_INF:
- self.SetAsBuildPcds(PcdContent, KeysList, PackageInfo)
- return True
-
- #
- # Validate Arch
- #
- SupArchList = []
- SupArchDict = {}
- PcdTypeItem = ''
- for (PcdTypeItem1, ArchItem, LineNo) in KeysList:
- SupArchList, SupArchDict = ValidateArch(ArchItem, PcdTypeItem1, LineNo, SupArchDict, SupArchList)
-
- #
- # Validate PcdType
- #
- if (PcdTypeItem1 == '' or PcdTypeItem1 == None):
- return False
- else:
- if not IsValidPcdType(PcdTypeItem1):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_PCD_SECTION_TYPE_ERROR%(DT.PCD_USAGE_TYPE_LIST_OF_MODULE),
- File=GlobalData.gINF_MODULE_NAME,
- Line=LineNo,
- ExtraData=PcdTypeItem1)
- return False
-
- PcdTypeItem = PcdTypeItem1
-
- for PcdItem in PcdContent:
- PcdItemObj = InfPcdItem()
- CommentList = PcdItem[1]
- CurrentLineOfPcdItem = PcdItem[2]
- PcdItem = PcdItem[0]
-
- if CommentList != None and len(CommentList) != 0:
- PcdItemObj = ParsePcdComment(CommentList, PcdTypeItem, PcdItemObj)
- else:
- CommentItemIns = InfPcdItemCommentContent()
- CommentItemIns.SetUsageItem(DT.ITEM_UNDEFINED)
- PcdItemObj.SetHelpStringList([CommentItemIns])
-
- if len(PcdItem) >= 1 and len(PcdItem) <= 3:
- PcdItemObj = SetPcdName(PcdItem, CurrentLineOfPcdItem, PcdItemObj)
-
- if len(PcdItem) >= 2 and len(PcdItem) <= 3:
- #
- # Contain PcdName and Value, validate value.
- #
- if IsValidPcdValue(PcdItem[1]) or PcdItem[1].strip() == "":
- PcdItemObj.SetDefaultValue(PcdItem[1])
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_PCD_VALUE_INVALID,
- File=CurrentLineOfPcdItem[2],
- Line=CurrentLineOfPcdItem[1],
- ExtraData=PcdItem[1])
-
- if len(PcdItem) == 3:
- #
- # Contain PcdName, value, and FeatureFlag express
- #
- #
- # Validate Feature Flag Express
- #
- if PcdItem[2].strip() == '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
- File=CurrentLineOfPcdItem[2],
- Line=CurrentLineOfPcdItem[1],
- ExtraData=CurrentLineOfPcdItem[0])
- #
- # Validate FFE
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(PcdItem[2].strip())
- if not FeatureFlagRtv[0]:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%(FeatureFlagRtv[1]),
- File=CurrentLineOfPcdItem[2],
- Line=CurrentLineOfPcdItem[1],
- ExtraData=CurrentLineOfPcdItem[0])
- PcdItemObj.SetFeatureFlagExp(PcdItem[2])
-
- if len(PcdItem) < 1 or len(PcdItem) > 3:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_PCD_SECTION_CONTENT_ERROR,
- File=CurrentLineOfPcdItem[2],
- Line=CurrentLineOfPcdItem[1],
- ExtraData=CurrentLineOfPcdItem[0])
- return False
-
- if PcdTypeItem.upper != DT.TAB_INF_FEATURE_PCD.upper():
- PcdItemObj.SetSupportArchList(SupArchDict[PcdTypeItem])
- else:
- PcdItemObj.SetSupportArchList(SupArchList)
-
- if self.Pcds.has_key((PcdTypeItem, PcdItemObj)):
- PcdsList = self.Pcds[PcdTypeItem, PcdItemObj]
- PcdsList.append(PcdItemObj)
- self.Pcds[PcdTypeItem, PcdItemObj] = PcdsList
- else:
- PcdsList = []
- PcdsList.append(PcdItemObj)
- self.Pcds[PcdTypeItem, PcdItemObj] = PcdsList
-
- return True
-
- def SetAsBuildPcds(self, PcdContent, KeysList = None, PackageInfo = None):
- for PcdItem in PcdContent:
- PcdItemObj = InfPcdItem()
- CommentList = PcdItem[1]
- CurrentLineOfPcdItem = PcdItem[2]
- PcdItem = PcdItem[0]
- CommentString = ''
- for CommmentLine in CommentList:
- CommentString += GetHelpStringByRemoveHashKey(CommmentLine)
-
- PcdItemObj.SetHelpStringList(CommentString)
- PcdItemObj.SetItemType(KeysList[0][0])
- #
- # Set PcdTokenSpaceCName and CName
- #
- PcdItemObj = SetPcdName(PcdItem, CurrentLineOfPcdItem, PcdItemObj)
- #
- # Set Value/DatumType/MaxDatumSize/Token
- #
- PcdItemObj = SetValueDatumTypeMaxSizeToken(PcdItem,
- CurrentLineOfPcdItem,
- PcdItemObj,
- KeysList[0][1],
- PackageInfo)
-
- PcdTypeItem = KeysList[0][0]
- if self.Pcds.has_key((PcdTypeItem, PcdItemObj)):
- PcdsList = self.Pcds[PcdTypeItem, PcdItemObj]
- PcdsList.append(PcdItemObj)
- self.Pcds[PcdTypeItem, PcdItemObj] = PcdsList
- else:
- PcdsList = []
- PcdsList.append(PcdItemObj)
- self.Pcds[PcdTypeItem, PcdItemObj] = PcdsList
-
- def GetPcds(self):
- return self.Pcds
-
-def ParserPcdInfoInDec(String):
- ValueList = GetSplitValueList(String, DT.TAB_VALUE_SPLIT, 3)
-
- #
- # DatumType, Token
- #
- return ValueList[2], ValueList[3]
-
-def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLineOfPcdItem, PcdItemObj, Arch, PackageInfo = None):
- #
- # Package information not been generated currently, we need to parser INF file to get information.
- #
- if not PackageInfo:
- PackageInfo = []
- InfFileName = CurrentLineOfPcdItem[2]
- PackageInfoList = GetPackageListInfo(InfFileName, GlobalData.gWORKSPACE, -1)
- for PackageInfoListItem in PackageInfoList:
- PackageInfoIns = InfPackageItem()
- PackageInfoIns.SetPackageName(PackageInfoListItem)
- PackageInfo.append(PackageInfoIns)
-
- PcdInfoInDecHasFound = False
- for PackageItem in PackageInfo:
- if PcdInfoInDecHasFound:
- break
- PackageName = PackageItem.PackageName
- #
- # Open DEC file to get information
- #
- FullFileName = os.path.normpath(os.path.realpath(os.path.join(GlobalData.gWORKSPACE, PackageName)))
-
- DecParser = Dec(FullFileName)
- #
- # Find PCD information.
- #
- DecPcdsDict = DecParser.GetPcdSectionObject().ValueDict
- for Key in DecPcdsDict.keys():
- if (Key[0] == 'PCDSDYNAMICEX' and PcdItemObj.GetItemType() == 'PcdEx') and \
- (Key[1] == 'COMMON' or Key[1] == Arch):
- for PcdInDec in DecPcdsDict[Key]:
- if PcdInDec.TokenCName == PcdItemObj.CName and \
- PcdInDec.TokenSpaceGuidCName == PcdItemObj.TokenSpaceGuidCName:
- PcdItemObj.SetToken(PcdInDec.TokenValue)
- PcdItemObj.SetDatumType(PcdInDec.DatumType)
- PcdItemObj.SetSupportArchList([Arch])
-
- if (Key[0] == 'PCDSPATCHABLEINMODULE' and PcdItemObj.GetItemType() == 'PatchPcd') and \
- (Key[1] == 'COMMON' or Key[1] == Arch):
- for PcdInDec in DecPcdsDict[Key]:
- if PcdInDec.TokenCName == PcdItemObj.CName and \
- PcdInDec.TokenSpaceGuidCName == PcdItemObj.TokenSpaceGuidCName:
- PcdItemObj.SetToken(PcdInDec.TokenValue)
- PcdItemObj.SetDatumType(PcdInDec.DatumType)
- PcdItemObj.SetSupportArchList([Arch])
-
- if PcdItemObj.GetDatumType() == 'VOID*':
- PcdItemObj.SetMaxDatumSize('%s'%(len(GetSplitValueList(PcdItem[1], DT.TAB_COMMA_SPLIT))))
-
- DecGuidsDict = DecParser.GetGuidSectionObject().ValueDict
- for Key in DecGuidsDict.keys():
- if Key == 'COMMON' or Key == Arch:
- for GuidInDec in DecGuidsDict[Key]:
- if GuidInDec.GuidCName == PcdItemObj.TokenSpaceGuidCName:
- PcdItemObj.SetTokenSpaceGuidValue(GuidInDec.GuidString)
-
- #
- # Validate Value.
- #
- if ValidatePcdValueOnDatumType(PcdItem[1], PcdItemObj.GetDatumType()):
- PcdItemObj.SetDefaultValue(PcdItem[1])
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_ASBUILD_PCD_VALUE_INVALID%("\"" + PcdItem[1] + "\"", "\"" +
- PcdItemObj.GetDatumType() + "\""),
- File=CurrentLineOfPcdItem[2],
- Line=CurrentLineOfPcdItem[1],
- ExtraData=CurrentLineOfPcdItem[0])
- #
- # validate offset
- #
- if PcdItemObj.GetItemType().upper() == DT.TAB_INF_PATCH_PCD.upper():
- if not IsHexDigitUINT32(PcdItem[2]):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_ASBUILD_PCD_OFFSET_FORMAT_INVALID%("\"" + PcdItem[2] + "\""),
- File=CurrentLineOfPcdItem[2],
- Line=CurrentLineOfPcdItem[1],
- ExtraData=CurrentLineOfPcdItem[0])
- PcdItemObj.SetOffset(PcdItem[2])
-
- if PcdItemObj.GetToken() == '' or PcdItemObj.GetDatumType() == '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_ASBUILD_PCD_DECLARITION_MISS%("\"" + PcdItem[0] + "\""),
- File=CurrentLineOfPcdItem[2],
- Line=CurrentLineOfPcdItem[1],
- ExtraData=CurrentLineOfPcdItem[0])
-
- return PcdItemObj
-
-def ValidatePcdValueOnDatumType(Value, Type):
-
- Value = Value.strip()
- #
- # Boolean type only allow 0x00 or 0x01 as value per INF spec
- #
- if Type == 'BOOLEAN':
- if not (Value == '0x00' or Value == '0x01'):
- return False
- elif Type == 'VOID*':
- if not Value.startswith("{"):
- return False
- if not Value.endswith("}"):
- return False
- #
- # Strip "{" at head and "}" at tail.
- #
- Value = Value[1:-1]
- ValueList = GetSplitValueList(Value, DT.TAB_COMMA_SPLIT)
-
- ReIsValidHexByte = re.compile("^0x[0-9a-f]{1,2}$", re.IGNORECASE)
- for ValueItem in ValueList:
- if not ReIsValidHexByte.match(ValueItem):
- return False
-
- elif Type == 'UINT8' or Type == 'UINT16' or Type == 'UINT32' or Type == 'UINT64':
-
- ReIsValidUint8z = re.compile('^0[x|X][a-fA-F0-9]{2}$')
- ReIsValidUint16z = re.compile('^0[x|X][a-fA-F0-9]{4}$')
- ReIsValidUint32z = re.compile('^0[x|X][a-fA-F0-9]{8}$')
- ReIsValidUint64z = re.compile('^0[x|X][a-fA-F0-9]{16}$')
-
- if not ReIsValidUint8z.match(Value) and Type == 'UINT8':
- return False
- elif not ReIsValidUint16z.match(Value) and Type == 'UINT16':
- return False
- elif not ReIsValidUint32z.match(Value) and Type == 'UINT32':
- return False
- elif not ReIsValidUint64z.match(Value) and Type == 'UINT64':
- return False
- else:
- #
- # Since we assume the DEC file always correct, should never go to here.
- #
- pass
-
- return True
-
-def SetPcdName(PcdItem, CurrentLineOfPcdItem, PcdItemObj):
- #
- # Only PCD Name specified
- # <PcdName> ::= <TokenSpaceGuidCName> "." <TokenCName>
- #
- PcdId = GetSplitValueList(PcdItem[0], DT.TAB_SPLIT)
- if len(PcdId) != 2:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_PCD_NAME_FORMAT_ERROR,
- File=CurrentLineOfPcdItem[2],
- Line=CurrentLineOfPcdItem[1],
- ExtraData=CurrentLineOfPcdItem[0])
- else:
- #
- # Validate PcdTokenSpaceGuidCName
- #
- if not IsValidCVariableName(PcdId[0]):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_PCD_CVAR_GUID,
- File=CurrentLineOfPcdItem[2],
- Line=CurrentLineOfPcdItem[1],
- ExtraData=PcdId[0])
- if not IsValidCVariableName(PcdId[1]):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_PCD_CVAR_PCDCNAME,
- File=CurrentLineOfPcdItem[2],
- Line=CurrentLineOfPcdItem[1],
- ExtraData=PcdId[1])
- PcdItemObj.SetTokenSpaceGuidCName(PcdId[0])
- PcdItemObj.SetCName(PcdId[1])
-
- return PcdItemObj \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py
deleted file mode 100644
index 4df62bb459..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py
+++ /dev/null
@@ -1,343 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [Ppis] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfPpiObject
-'''
-
-from Library.ParserValidate import IsValidCVariableName
-from Library.CommentParsing import ParseComment
-from Library.ExpressionValidate import IsValidFeatureFlagExp
-
-from Library.Misc import Sdict
-from Library import DataType as DT
-import Logger.Log as Logger
-from Logger import ToolError
-from Logger import StringTable as ST
-
-def ParsePpiComment(CommentsList, InfPpiItemObj):
- PreNotify = None
- PreUsage = None
- PreHelpText = ''
- BlockFlag = -1
- CommentInsList = []
- Count = 0
- for CommentItem in CommentsList:
- Count = Count + 1
- CommentItemUsage, \
- CommentItemNotify, \
- CommentItemString, \
- CommentItemHelpText = \
- ParseComment(CommentItem,
- DT.ALL_USAGE_TOKENS,
- DT.PPI_NOTIFY_TOKENS,
- ['PPI'],
- False)
-
- #
- # To avoid PyLint error
- #
- if CommentItemString:
- pass
-
- if CommentItemHelpText == None:
- CommentItemHelpText = ''
- if Count == len(CommentsList) and CommentItemUsage == CommentItemNotify == DT.ITEM_UNDEFINED:
- CommentItemHelpText = DT.END_OF_LINE
- #
- # For the Last comment Item, set BlockFlag.
- #
- if Count == len(CommentsList):
- if BlockFlag == 1 or BlockFlag == 2:
- if CommentItemUsage == CommentItemNotify == DT.ITEM_UNDEFINED:
- BlockFlag = 4
- else:
- BlockFlag = 3
- elif BlockFlag == -1:
- BlockFlag = 4
-
- #
- # Comment USAGE and NOTIFY information are "UNDEFINED"
- #
- if BlockFlag == -1 or BlockFlag == 1 or BlockFlag == 2:
- if CommentItemUsage == CommentItemNotify == DT.ITEM_UNDEFINED:
- if BlockFlag == -1:
- BlockFlag = 1
- elif BlockFlag == 1:
- BlockFlag = 2
- else:
- if BlockFlag == 1 or BlockFlag == 2:
- BlockFlag = 3
- #
- # An item have Usage or Notify information and the first time get this information
- #
- elif BlockFlag == -1:
- BlockFlag = 4
-
- #
- # Combine two comment line if they are generic comment
- #
- if CommentItemUsage == CommentItemNotify == PreUsage == PreNotify == DT.ITEM_UNDEFINED:
- CommentItemHelpText = PreHelpText + DT.END_OF_LINE + CommentItemHelpText
- #
- # Store this information for next line may still need combine operation.
- #
- PreHelpText = CommentItemHelpText
-
- if BlockFlag == 4:
- CommentItemIns = InfPpiItemCommentContent()
- CommentItemIns.SetUsage(CommentItemUsage)
- CommentItemIns.SetNotify(CommentItemNotify)
- CommentItemIns.SetHelpStringItem(CommentItemHelpText)
- CommentInsList.append(CommentItemIns)
-
- BlockFlag = -1
- PreUsage = None
- PreNotify = None
- PreHelpText = ''
-
- elif BlockFlag == 3:
- #
- # Add previous help string
- #
- CommentItemIns = InfPpiItemCommentContent()
- CommentItemIns.SetUsage(DT.ITEM_UNDEFINED)
- CommentItemIns.SetNotify(DT.ITEM_UNDEFINED)
- if PreHelpText == '' or PreHelpText.endswith(DT.END_OF_LINE):
- PreHelpText += DT.END_OF_LINE
- CommentItemIns.SetHelpStringItem(PreHelpText)
- CommentInsList.append(CommentItemIns)
- #
- # Add Current help string
- #
- CommentItemIns = InfPpiItemCommentContent()
- CommentItemIns.SetUsage(CommentItemUsage)
- CommentItemIns.SetNotify(CommentItemNotify)
- CommentItemIns.SetHelpStringItem(CommentItemHelpText)
- CommentInsList.append(CommentItemIns)
-
- BlockFlag = -1
- PreUsage = None
- PreNotify = None
- PreHelpText = ''
- else:
- PreUsage = CommentItemUsage
- PreNotify = CommentItemNotify
- PreHelpText = CommentItemHelpText
-
- InfPpiItemObj.SetCommentList(CommentInsList)
-
- return InfPpiItemObj
-
-class InfPpiItemCommentContent():
- def __init__(self):
- #
- # ## SOMETIMES_CONSUMES ## HelpString
- #
- self.UsageItem = ''
- #
- # Help String
- #
- self.HelpStringItem = ''
- self.Notify = ''
- self.CommentList = []
-
- def SetUsage(self, UsageItem):
- self.UsageItem = UsageItem
- def GetUsage(self):
- return self.UsageItem
-
- def SetNotify(self, Notify):
- if Notify != DT.ITEM_UNDEFINED:
- self.Notify = 'true'
- def GetNotify(self):
- return self.Notify
-
- def SetHelpStringItem(self, HelpStringItem):
- self.HelpStringItem = HelpStringItem
- def GetHelpStringItem(self):
- return self.HelpStringItem
-
-class InfPpiItem():
- def __init__(self):
- self.Name = ''
- self.FeatureFlagExp = ''
- self.SupArchList = []
- self.CommentList = []
-
- def SetName(self, Name):
- self.Name = Name
- def GetName(self):
- return self.Name
-
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
- def GetSupArchList(self):
- return self.SupArchList
-
- def SetCommentList(self, CommentList):
- self.CommentList = CommentList
- def GetCommentList(self):
- return self.CommentList
-
- def SetFeatureFlagExp(self, FeatureFlagExp):
- self.FeatureFlagExp = FeatureFlagExp
- def GetFeatureFlagExp(self):
- return self.FeatureFlagExp
-##
-#
-#
-#
-class InfPpiObject():
- def __init__(self):
- self.Ppis = Sdict()
- #
- # Macro defined in this section should be only used in this section.
- #
- self.Macros = {}
-
- def SetPpi(self, PpiList, Arch = None):
- __SupArchList = []
- for ArchItem in Arch:
- #
- # Validate Arch
- #
- if (ArchItem == '' or ArchItem == None):
- ArchItem = 'COMMON'
- __SupArchList.append(ArchItem)
-
- for Item in PpiList:
- #
- # Get Comment content of this protocol
- #
- CommentsList = None
- if len(Item) == 3:
- CommentsList = Item[1]
- CurrentLineOfItem = Item[2]
- Item = Item[0]
- InfPpiItemObj = InfPpiItem()
- if len(Item) >= 1 and len(Item) <= 2:
- #
- # Only CName contained
- #
- if not IsValidCVariableName(Item[0]):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_INVALID_CNAME%(Item[0]),
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- if (Item[0] != ''):
- InfPpiItemObj.SetName(Item[0])
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_CNAME_MISSING,
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- #
- # Have FeatureFlag information
- #
- if len(Item) == 2:
- #
- # Contained CName and Feature Flag Express
- # <statements> ::= <CName> ["|" <FeatureFlagExpress>]
- # Item[1] should not be empty
- #
- if Item[1].strip() == '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- #
- # Validate Feature Flag Express for PPI entry
- # Item[1] contain FFE information
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(Item[1].strip())
- if not FeatureFlagRtv[0]:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%(FeatureFlagRtv[1]),
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- InfPpiItemObj.SetFeatureFlagExp(Item[1])
- if len(Item) != 1 and len(Item) != 2:
- #
- # Invalid format of Ppi statement
- #
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_GUID_PPI_PROTOCOL_SECTION_CONTENT_ERROR,
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
-
- #
- # Get/Set Usage and HelpString for PPI entry
- #
- if CommentsList != None and len(CommentsList) != 0:
- InfPpiItemObj = ParsePpiComment(CommentsList, InfPpiItemObj)
- else:
- CommentItemIns = InfPpiItemCommentContent()
- CommentItemIns.SetUsage(DT.ITEM_UNDEFINED)
- CommentItemIns.SetNotify(DT.ITEM_UNDEFINED)
- InfPpiItemObj.SetCommentList([CommentItemIns])
-
- InfPpiItemObj.SetSupArchList(__SupArchList)
-
- #
- # Determine PPI name duplicate. Follow below rule:
- #
- # A PPI must not be duplicated within a [Ppis] section.
- # A PPI may appear in multiple architectural [Ppis]
- # sections. A PPI listed in an architectural [Ppis]
- # section must not be listed in the common architectural
- # [Ppis] section.
- #
- # NOTE: This check will not report error now.
- #
- for Item in self.Ppis:
- if Item.GetName() == InfPpiItemObj.GetName():
- ItemSupArchList = Item.GetSupArchList()
- for ItemArch in ItemSupArchList:
- for PpiItemObjArch in __SupArchList:
- if ItemArch == PpiItemObjArch:
- #
- # ST.ERR_INF_PARSER_ITEM_DUPLICATE
- #
- pass
- if ItemArch.upper() == 'COMMON' or PpiItemObjArch.upper() == 'COMMON':
- #
- # ST.ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
- #
- pass
-
- if self.Ppis.has_key((InfPpiItemObj)):
- PpiList = self.Ppis[InfPpiItemObj]
- PpiList.append(InfPpiItemObj)
- self.Ppis[InfPpiItemObj] = PpiList
- else:
- PpiList = []
- PpiList.append(InfPpiItemObj)
- self.Ppis[InfPpiItemObj] = PpiList
-
- return True
-
-
- def GetPpi(self):
- return self.Ppis \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py
deleted file mode 100644
index c94e53c98f..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py
+++ /dev/null
@@ -1,311 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [Protocols] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfProtocolObject
-'''
-
-from Library.ParserValidate import IsValidCVariableName
-from Library.CommentParsing import ParseComment
-from Library.ExpressionValidate import IsValidFeatureFlagExp
-
-from Library.Misc import Sdict
-
-from Object.Parser.InfMisc import ErrorInInf
-
-from Library import DataType as DT
-from Logger import StringTable as ST
-
-def ParseProtocolComment(CommentsList, InfProtocolItemObj):
- CommentInsList = []
- PreUsage = None
- PreNotify = None
- PreHelpText = ''
- BlockFlag = -1
- Count = 0
- for CommentItem in CommentsList:
- Count = Count + 1
- CommentItemUsage, \
- CommentItemNotify, \
- CommentItemString, \
- CommentItemHelpText = \
- ParseComment(CommentItem,
- DT.PROTOCOL_USAGE_TOKENS,
- DT.PROTOCOL_NOTIFY_TOKENS,
- ['PROTOCOL'],
- False)
-
- if CommentItemString:
- pass
-
- if CommentItemHelpText == None:
- CommentItemHelpText = ''
- if Count == len(CommentsList) and CommentItemUsage == CommentItemNotify == DT.ITEM_UNDEFINED:
- CommentItemHelpText = DT.END_OF_LINE
-
- if Count == len(CommentsList):
- if BlockFlag == 1 or BlockFlag == 2:
- if CommentItemUsage == CommentItemNotify == DT.ITEM_UNDEFINED:
- BlockFlag = 4
- else:
- BlockFlag = 3
- elif BlockFlag == -1:
- BlockFlag = 4
-
- if BlockFlag == -1 or BlockFlag == 1 or BlockFlag == 2:
- if CommentItemUsage == CommentItemNotify == DT.ITEM_UNDEFINED:
- if BlockFlag == -1:
- BlockFlag = 1
- elif BlockFlag == 1:
- BlockFlag = 2
- else:
- if BlockFlag == 1 or BlockFlag == 2:
- BlockFlag = 3
- elif BlockFlag == -1:
- BlockFlag = 4
-
- #
- # Combine two comment line if they are generic comment
- #
- if CommentItemUsage == CommentItemNotify == PreUsage == PreNotify == DT.ITEM_UNDEFINED:
- CommentItemHelpText = PreHelpText + DT.END_OF_LINE + CommentItemHelpText
-
- PreHelpText = CommentItemHelpText
-
- if BlockFlag == 4:
- CommentItemIns = InfProtocolItemCommentContent()
- CommentItemIns.SetUsageItem(CommentItemUsage)
- CommentItemIns.SetNotify(CommentItemNotify)
- CommentItemIns.SetHelpStringItem(CommentItemHelpText)
- CommentInsList.append(CommentItemIns)
-
- BlockFlag = -1
- PreUsage = None
- PreNotify = None
- PreHelpText = ''
-
- elif BlockFlag == 3:
- #
- # Add previous help string
- #
- CommentItemIns = InfProtocolItemCommentContent()
- CommentItemIns.SetUsageItem(DT.ITEM_UNDEFINED)
- CommentItemIns.SetNotify(DT.ITEM_UNDEFINED)
- if PreHelpText == '' or PreHelpText.endswith(DT.END_OF_LINE):
- PreHelpText += DT.END_OF_LINE
- CommentItemIns.SetHelpStringItem(PreHelpText)
- CommentInsList.append(CommentItemIns)
- #
- # Add Current help string
- #
- CommentItemIns = InfProtocolItemCommentContent()
- CommentItemIns.SetUsageItem(CommentItemUsage)
- CommentItemIns.SetNotify(CommentItemNotify)
- CommentItemIns.SetHelpStringItem(CommentItemHelpText)
- CommentInsList.append(CommentItemIns)
-
- BlockFlag = -1
- PreUsage = None
- PreNotify = None
- PreHelpText = ''
-
- else:
- PreUsage = CommentItemUsage
- PreNotify = CommentItemNotify
- PreHelpText = CommentItemHelpText
-
- InfProtocolItemObj.SetCommentList(CommentInsList)
-
- return InfProtocolItemObj
-
-class InfProtocolItemCommentContent():
- def __init__(self):
- #
- # ## SOMETIMES_CONSUMES ## HelpString
- #
- self.UsageItem = ''
- #
- # Help String
- #
- self.HelpStringItem = ''
- self.Notify = ''
- self.CommentList = []
-
- def SetUsageItem(self, UsageItem):
- self.UsageItem = UsageItem
- def GetUsageItem(self):
- return self.UsageItem
-
- def SetNotify(self, Notify):
- if Notify != DT.ITEM_UNDEFINED:
- self.Notify = 'true'
- def GetNotify(self):
- return self.Notify
-
- def SetHelpStringItem(self, HelpStringItem):
- self.HelpStringItem = HelpStringItem
- def GetHelpStringItem(self):
- return self.HelpStringItem
-
-class InfProtocolItem():
- def __init__(self):
- self.Name = ''
- self.FeatureFlagExp = ''
- self.SupArchList = []
- self.CommentList = []
-
- def SetName(self, Name):
- self.Name = Name
- def GetName(self):
- return self.Name
-
- def SetFeatureFlagExp(self, FeatureFlagExp):
- self.FeatureFlagExp = FeatureFlagExp
- def GetFeatureFlagExp(self):
- return self.FeatureFlagExp
-
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
- def GetSupArchList(self):
- return self.SupArchList
-
- def SetCommentList(self, CommentList):
- self.CommentList = CommentList
- def GetCommentList(self):
- return self.CommentList
-
-##
-#
-#
-#
-class InfProtocolObject():
- def __init__(self):
- self.Protocols = Sdict()
- #
- # Macro defined in this section should be only used in this section.
- #
- self.Macros = {}
-
- def SetProtocol(self, ProtocolContent, Arch = None,):
- __SupArchList = []
- for ArchItem in Arch:
- #
- # Validate Arch
- #
- if (ArchItem == '' or ArchItem == None):
- ArchItem = 'COMMON'
- __SupArchList.append(ArchItem)
-
- for Item in ProtocolContent:
- #
- # Get Comment content of this protocol
- #
- CommentsList = None
- if len(Item) == 3:
- CommentsList = Item[1]
- CurrentLineOfItem = Item[2]
- LineInfo = (CurrentLineOfItem[2], CurrentLineOfItem[1], CurrentLineOfItem[0])
- Item = Item[0]
- InfProtocolItemObj = InfProtocolItem()
- if len(Item) >= 1 and len(Item) <= 2:
- #
- # Only CName contained
- #
- if not IsValidCVariableName(Item[0]):
- ErrorInInf(ST.ERR_INF_PARSER_INVALID_CNAME%(Item[0]),
- LineInfo=LineInfo)
- if (Item[0] != ''):
- InfProtocolItemObj.SetName(Item[0])
- else:
- ErrorInInf(ST.ERR_INF_PARSER_CNAME_MISSING,
- LineInfo=LineInfo)
- if len(Item) == 2:
- #
- # Contained CName and Feature Flag Express
- # <statements> ::= <CName> ["|"
- # <FeatureFlagExpress>]
- # For Protocol Object
- #
- if Item[1].strip() == '':
- ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
- LineInfo=LineInfo)
- #
- # Validate Feature Flag Express for Item[1]
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(Item[1].strip())
- if not FeatureFlagRtv[0]:
- ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%(FeatureFlagRtv[1]),
- LineInfo=LineInfo)
- InfProtocolItemObj.SetFeatureFlagExp(Item[1])
-
- if len(Item) < 1 or len(Item) > 2:
- #
- # Invalid format of Protocols statement
- #
- ErrorInInf(ST.ERR_INF_PARSER_GUID_PPI_PROTOCOL_SECTION_CONTENT_ERROR,
- LineInfo=LineInfo)
-
- #
- # Get/Set Usage and HelpString for Protocol entry
- #
- if CommentsList != None and len(CommentsList) != 0:
- InfProtocolItemObj = ParseProtocolComment(CommentsList, InfProtocolItemObj)
- else:
- CommentItemIns = InfProtocolItemCommentContent()
- CommentItemIns.SetUsageItem(DT.ITEM_UNDEFINED)
- CommentItemIns.SetNotify(DT.ITEM_UNDEFINED)
- InfProtocolItemObj.SetCommentList([CommentItemIns])
-
- InfProtocolItemObj.SetSupArchList(__SupArchList)
-
- #
- # Determine protocol name duplicate. Follow below rule:
- #
- # A protocol must not be duplicated within a [Protocols] section.
- # A protocol may appear in multiple architectural [Protocols]
- # sections. A protocol listed in an architectural [Protocols]
- # section must not be listed in the common architectural
- # [Protocols] section.
- #
- # NOTE: This check will not report error now.
- #
- for Item in self.Protocols:
- if Item.GetName() == InfProtocolItemObj.GetName():
- ItemSupArchList = Item.GetSupArchList()
- for ItemArch in ItemSupArchList:
- for ProtocolItemObjArch in __SupArchList:
- if ItemArch == ProtocolItemObjArch:
- #
- # ST.ERR_INF_PARSER_ITEM_DUPLICATE
- #
- pass
- if ItemArch.upper() == 'COMMON' or ProtocolItemObjArch.upper() == 'COMMON':
- #
- # ST.ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
- #
- pass
-
- if self.Protocols.has_key((InfProtocolItemObj)):
- ProcotolList = self.Protocols[InfProtocolItemObj]
- ProcotolList.append(InfProtocolItemObj)
- self.Protocols[InfProtocolItemObj] = ProcotolList
- else:
- ProcotolList = []
- ProcotolList.append(InfProtocolItemObj)
- self.Protocols[InfProtocolItemObj] = ProcotolList
-
- return True
-
- def GetProtocol(self):
- return self.Protocols
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py
deleted file mode 100644
index 9988f8ecfe..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py
+++ /dev/null
@@ -1,240 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [Sources] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfSourcesObject
-'''
-
-import os
-
-from Logger import StringTable as ST
-from Logger import ToolError
-import Logger.Log as Logger
-from Library import GlobalData
-
-from Library.Misc import Sdict
-from Library.ExpressionValidate import IsValidFeatureFlagExp
-from Object.Parser.InfCommonObject import InfSectionCommonDef
-from Library.Misc import ValidFile
-from Library.ParserValidate import IsValidFamily
-from Library.ParserValidate import IsValidPath
-
-## __GenSourceInstance
-#
-#
-def GenSourceInstance(Item, CurrentLineOfItem, ItemObj):
-
- IsValidFileFlag = False
-
- if len(Item) < 6 and len(Item) >= 1:
- #
- # File | Family | TagName | ToolCode | FeatureFlagExpr
- #
- if len(Item) == 5:
- #
- # Validate Feature Flag Express
- #
- if Item[4].strip() == '':
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- #
- # Validate FFE
- #
- FeatureFlagRtv = IsValidFeatureFlagExp(Item[4].strip())
- if not FeatureFlagRtv[0]:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%(FeatureFlagRtv[1]),
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- ItemObj.SetFeatureFlagExp(Item[4])
- if len(Item) >= 4:
- if Item[3].strip() == '':
- ItemObj.SetToolCode(Item[3])
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_TOOLCODE_NOT_PERMITTED%(Item[2]),
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- if len(Item) >= 3:
- if Item[2].strip() == '':
- ItemObj.SetTagName(Item[2])
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITTED%(Item[2]),
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- if len(Item) >= 2:
- if IsValidFamily(Item[1].strip()):
- #
- # To align with UDP specification. "*" is not permitted in UDP specification
- #
- if Item[1].strip() == "*":
- Item[1] = ""
- ItemObj.SetFamily(Item[1])
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_SOURCE_SECTION_FAMILY_INVALID%(Item[1]),
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- if len(Item) >= 1:
- #
- # Validate file name exist.
- #
- FullFileName = os.path.normpath(os.path.realpath(os.path.join(GlobalData.gINF_MODULE_DIR, Item[0])))
- if not (ValidFile(FullFileName) or ValidFile(Item[0])):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_FILELIST_EXIST%(Item[0]),
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
-
- #
- # Validate file exist/format.
- #
-
- if IsValidPath(Item[0], GlobalData.gINF_MODULE_DIR):
- IsValidFileFlag = True
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID%(Item[0]),
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
- return False
- if IsValidFileFlag:
- ItemObj.SetSourceFileName(Item[0])
- else:
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_SOURCES_SECTION_CONTENT_ERROR,
- File=CurrentLineOfItem[2],
- Line=CurrentLineOfItem[1],
- ExtraData=CurrentLineOfItem[0])
-
- return ItemObj
-
-## InfSourcesItemObject()
-#
-#
-class InfSourcesItemObject():
- def __init__(self, \
- SourceFileName = '', \
- Family = '', \
- TagName = '', \
- ToolCode = '', \
- FeatureFlagExp = ''):
- self.SourceFileName = SourceFileName
- self.Family = Family
- self.TagName = TagName
- self.ToolCode = ToolCode
- self.FeatureFlagExp = FeatureFlagExp
- self.HeaderString = ''
- self.TailString = ''
- self.SupArchList = []
-
- def SetSourceFileName(self, SourceFilename):
- self.SourceFileName = SourceFilename
- def GetSourceFileName(self):
- return self.SourceFileName
-
- def SetFamily(self, Family):
- self.Family = Family
- def GetFamily(self):
- return self.Family
-
- def SetTagName(self, TagName):
- self.TagName = TagName
- def GetTagName(self):
- return self.TagName
-
- def SetToolCode(self, ToolCode):
- self.ToolCode = ToolCode
- def GetToolCode(self):
- return self.ToolCode
-
- def SetFeatureFlagExp(self, FeatureFlagExp):
- self.FeatureFlagExp = FeatureFlagExp
- def GetFeatureFlagExp(self):
- return self.FeatureFlagExp
-
- def SetHeaderString(self, HeaderString):
- self.HeaderString = HeaderString
- def GetHeaderString(self):
- return self.HeaderString
-
- def SetTailString(self, TailString):
- self.TailString = TailString
- def GetTailString(self):
- return self.TailString
-
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
- def GetSupArchList(self):
- return self.SupArchList
-##
-#
-#
-#
-class InfSourcesObject(InfSectionCommonDef):
- def __init__(self):
- self.Sources = Sdict()
- InfSectionCommonDef.__init__(self)
-
- def SetSources(self, SourceList, Arch = None):
- __SupArchList = []
- for ArchItem in Arch:
- #
- # Validate Arch
- #
- if (ArchItem == '' or ArchItem == None):
- ArchItem = 'COMMON'
- __SupArchList.append(ArchItem)
-
- for Item in SourceList:
- ItemObj = InfSourcesItemObject()
- CurrentLineOfItem = Item[2]
- Item = Item[0]
-
- ItemObj = GenSourceInstance(Item, CurrentLineOfItem, ItemObj)
-
- ItemObj.SetSupArchList(__SupArchList)
-
- if self.Sources.has_key((ItemObj)):
- SourceContent = self.Sources[ItemObj]
- SourceContent.append(ItemObj)
- self.Sources[ItemObj] = SourceContent
- else:
- SourceContent = []
- SourceContent.append(ItemObj)
- self.Sources[ItemObj] = SourceContent
-
- return True
-
- def GetSources(self):
- return self.Sources
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py b/BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py
deleted file mode 100644
index 27a1c6ad25..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py
+++ /dev/null
@@ -1,133 +0,0 @@
-## @file
-# This file is used to define class objects of INF file [UserExtension] section.
-# It will consumed by InfParser.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-InfUserExtensionsObject
-'''
-
-from Logger import StringTable as ST
-from Logger import ToolError
-import Logger.Log as Logger
-from Library import GlobalData
-
-from Library.Misc import Sdict
-
-class InfUserExtensionItem():
- def __init__(self,
- Content = '',
- UserId = '',
- IdString = ''):
- self.Content = Content
- self.UserId = UserId
- self.IdString = IdString
- self.SupArchList = []
-
- def SetContent(self, Content):
- self.Content = Content
- def GetContent(self):
- return self.Content
-
- def SetUserId(self, UserId):
- self.UserId = UserId
- def GetUserId(self):
- return self.UserId
-
- def SetIdString(self, IdString):
- self.IdString = IdString
- def GetIdString(self):
- return self.IdString
-
- def SetSupArchList(self, SupArchList):
- self.SupArchList = SupArchList
- def GetSupArchList(self):
- return self.SupArchList
-
-##
-#
-#
-#
-class InfUserExtensionObject():
- def __init__(self):
- self.UserExtension = Sdict()
-
- def SetUserExtension(self, UserExtensionCont, IdContent=None, LineNo=None):
- if not UserExtensionCont or UserExtensionCont == '':
- return True
- #
- # IdContent is a list contain UserId and IdString
- # For this call the general section header parser, if no definition of
- # IdString/UserId, it will return 'COMMON'
- #
- for IdContentItem in IdContent:
- InfUserExtensionItemObj = InfUserExtensionItem()
- if IdContentItem[0] == 'COMMON':
- UserId = ''
- else:
- UserId = IdContentItem[0]
-
- if IdContentItem[1] == 'COMMON':
- IdString = ''
- else:
- IdString = IdContentItem[1]
-
- #
- # Fill UserExtensionObj members.
- #
- InfUserExtensionItemObj.SetUserId(UserId)
- InfUserExtensionItemObj.SetIdString(IdString)
- InfUserExtensionItemObj.SetContent(UserExtensionCont)
- InfUserExtensionItemObj.SetSupArchList(IdContentItem[2])
-
-# for CheckItem in self.UserExtension:
-# if IdContentItem[0] == CheckItem[0] and IdContentItem[1] == CheckItem[1]:
-# if IdContentItem[2].upper() == 'COMMON' or CheckItem[2].upper() == 'COMMON':
-# #
-# # For COMMON ARCH type, do special check.
-# #
-# Logger.Error('InfParser',
-# ToolError.FORMAT_INVALID,
-# ST.ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR%\
-# (IdContentItem[0] + '.' + IdContentItem[1] + '.' + IdContentItem[2]),
-# File=GlobalData.gINF_MODULE_NAME,
-# Line=LineNo,
-# ExtraData=None)
-
- if self.UserExtension.has_key(IdContentItem):
- #
- # Each UserExtensions section header must have a unique set
- # of UserId, IdString and Arch values.
- # This means that the same UserId can be used in more than one
- # section header, provided the IdString or Arch values are
- # different. The same IdString values can be used in more than
- # one section header if the UserId or Arch values are
- # different. The same UserId and the same IdString can be used
- # in a section header if the Arch values are different in each
- # of the section headers.
- #
- Logger.Error('InfParser',
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR%\
- (IdContentItem[0] + '.' + IdContentItem[1] + '.' + IdContentItem[2]),
- File=GlobalData.gINF_MODULE_NAME,
- Line=LineNo,
- ExtraData=None)
- else:
- UserExtensionList = []
- UserExtensionList.append(InfUserExtensionItemObj)
- self.UserExtension[IdContentItem] = UserExtensionList
-
- return True
-
- def GetUserExtension(self):
- return self.UserExtension \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/Parser/__init__.py b/BaseTools/Source/Python/UPT/Object/Parser/__init__.py
deleted file mode 100644
index b457c3c97b..0000000000
--- a/BaseTools/Source/Python/UPT/Object/Parser/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Object' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-PARSER
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Object/__init__.py b/BaseTools/Source/Python/UPT/Object/__init__.py
deleted file mode 100644
index 7925ab65ba..0000000000
--- a/BaseTools/Source/Python/UPT/Object/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Object' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Object
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Parser/DecParser.py b/BaseTools/Source/Python/UPT/Parser/DecParser.py
deleted file mode 100644
index 823cf71e5e..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/DecParser.py
+++ /dev/null
@@ -1,989 +0,0 @@
-## @file
-# This file is used to parse DEC file. It will consumed by DecParser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-'''
-DecParser
-'''
-## Import modules
-#
-import Logger.Log as Logger
-from Logger.ToolError import FILE_PARSE_FAILURE
-from Logger.ToolError import FILE_OPEN_FAILURE
-from Logger import StringTable as ST
-
-import Library.DataType as DT
-from Library.ParserValidate import IsValidToken
-from Library.ParserValidate import IsValidPath
-from Library.ParserValidate import IsValidCFormatGuid
-from Library.ParserValidate import IsValidIdString
-from Library.ParserValidate import IsValidUserId
-from Library.ParserValidate import IsValidArch
-from Library.ParserValidate import IsValidWord
-from Parser.DecParserMisc import TOOL_NAME
-from Parser.DecParserMisc import CleanString
-from Parser.DecParserMisc import IsValidPcdDatum
-from Parser.DecParserMisc import ParserHelper
-from Parser.DecParserMisc import StripRoot
-from Parser.DecParserMisc import VERSION_PATTERN
-from Parser.DecParserMisc import CVAR_PATTERN
-from Parser.DecParserMisc import PCD_TOKEN_PATTERN
-from Parser.DecParserMisc import MACRO_PATTERN
-from Parser.DecParserMisc import FileContent
-from Object.Parser.DecObject import _DecComments
-from Object.Parser.DecObject import DecDefineObject
-from Object.Parser.DecObject import DecDefineItemObject
-from Object.Parser.DecObject import DecIncludeObject
-from Object.Parser.DecObject import DecIncludeItemObject
-from Object.Parser.DecObject import DecLibraryclassObject
-from Object.Parser.DecObject import DecLibraryclassItemObject
-from Object.Parser.DecObject import DecGuidObject
-from Object.Parser.DecObject import DecPpiObject
-from Object.Parser.DecObject import DecProtocolObject
-from Object.Parser.DecObject import DecGuidItemObject
-from Object.Parser.DecObject import DecUserExtensionObject
-from Object.Parser.DecObject import DecUserExtensionItemObject
-from Object.Parser.DecObject import DecPcdObject
-from Object.Parser.DecObject import DecPcdItemObject
-from Library.Misc import GuidStructureStringToGuidString
-from Library.Misc import CheckGuidRegFormat
-from Library.String import ReplaceMacro
-from Library.String import GetSplitValueList
-from Library.String import gMACRO_PATTERN
-from Library.String import ConvertSpecialChar
-
-##
-# _DecBase class for parsing
-#
-class _DecBase:
- def __init__(self, RawData):
- self._RawData = RawData
- self._ItemDict = {}
- self._LocalMacro = {}
- #
- # Data parsed by 'self' are saved to this object
- #
- self.ItemObject = None
-
- def GetDataObject(self):
- return self.ItemObject
-
- ## BlockStart
- #
- # Called if a new section starts
- #
- def BlockStart(self):
- self._LocalMacro = {}
-
- ## _CheckReDefine
- #
- # @param Key: to be checked if multi-defined
- # @param Scope: Format: [[SectionName, Arch], ...].
- # If scope is none, use global scope
- #
- def _CheckReDefine(self, Key, Scope = None):
- if not Scope:
- Scope = self._RawData.CurrentScope
- return
-
- SecArch = []
- #
- # Copy scope to SecArch, avoid Scope be changed outside
- #
- SecArch[0:1] = Scope[:]
- if Key not in self._ItemDict:
- self._ItemDict[Key] = [[SecArch, self._RawData.LineIndex]]
- return
-
- for Value in self._ItemDict[Key]:
- for SubValue in Scope:
- #
- # If current is common section
- #
- if SubValue[-1] == 'COMMON':
- for Other in Value[0]:
- # Key in common cannot be redefined in other arches
- # [:-1] means stripping arch info
- if Other[:-1] == SubValue[:-1]:
- self._LoggerError(ST.ERR_DECPARSE_REDEFINE % (Key, Value[1]))
- return
- continue
- CommonScope = []
- CommonScope[0:1] = SubValue
- CommonScope[-1] = 'COMMON'
- #
- # Cannot be redefined if this key already defined in COMMON Or defined in same arch
- #
- if SubValue in Value[0] or CommonScope in Value[0]:
- self._LoggerError(ST.ERR_DECPARSE_REDEFINE % (Key, Value[1]))
- return
- self._ItemDict[Key].append([SecArch, self._RawData.LineIndex])
-
- ## CheckRequiredFields
- # Some sections need to check if some fields exist, define section for example
- # Derived class can re-implement, top parser will call this function after all parsing done
- #
- def CheckRequiredFields(self):
- if self._RawData:
- pass
- return True
-
- ## IsItemRequired
- # In DEC spec, sections must have at least one statement except user
- # extension.
- # For example: "[guids" [<attribs>] "]" <EOL> <statements>+
- # sub class can override this method to indicate if statement is a must.
- #
- def _IsStatementRequired(self):
- if self._RawData:
- pass
- return False
-
- def _LoggerError(self, ErrorString):
- Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE, File=self._RawData.Filename,
- Line = self._RawData.LineIndex,
- ExtraData=ErrorString + ST.ERR_DECPARSE_LINE % self._RawData.CurrentLine)
-
- def _ReplaceMacro(self, String):
- if gMACRO_PATTERN.findall(String):
- String = ReplaceMacro(String, self._LocalMacro, False,
- FileName = self._RawData.Filename,
- Line = ['', self._RawData.LineIndex])
- String = ReplaceMacro(String, self._RawData.Macros, False,
- FileName = self._RawData.Filename,
- Line = ['', self._RawData.LineIndex])
- MacroUsed = gMACRO_PATTERN.findall(String)
- if MacroUsed:
- Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE,
- File=self._RawData.Filename,
- Line = self._RawData.LineIndex,
- ExtraData = ST.ERR_DECPARSE_MACRO_RESOLVE % (str(MacroUsed), String))
- return String
-
- def _MacroParser(self, String):
- TokenList = GetSplitValueList(String, ' ', 1)
- if len(TokenList) < 2 or TokenList[1] == '':
- self._LoggerError(ST.ERR_DECPARSE_MACRO_PAIR)
-
- TokenList = GetSplitValueList(TokenList[1], DT.TAB_EQUAL_SPLIT, 1)
- if TokenList[0] == '':
- self._LoggerError(ST.ERR_DECPARSE_MACRO_NAME)
- elif not IsValidToken(MACRO_PATTERN, TokenList[0]):
- self._LoggerError(ST.ERR_DECPARSE_MACRO_NAME_UPPER % TokenList[0])
-
- if len(TokenList) == 1:
- self._LocalMacro[TokenList[0]] = ''
- else:
- self._LocalMacro[TokenList[0]] = self._ReplaceMacro(TokenList[1])
-
- ## _ParseItem
- #
- # Parse specified item, this function must be derived by subclass
- #
- def _ParseItem(self):
- if self._RawData:
- pass
- #
- # Should never be called
- #
- return None
-
-
- ## _TailCommentStrategy
- #
- # This function can be derived to parse tail comment
- # default is it will not consume any lines
- #
- # @param Comment: Comment of current line
- #
- def _TailCommentStrategy(self, Comment):
- if Comment:
- pass
- if self._RawData:
- pass
- return False
-
- ## _StopCurrentParsing
- #
- # Called in Parse if current parsing should be stopped when encounter some
- # keyword
- # Default is section start and end
- #
- # @param Line: Current line
- #
- def _StopCurrentParsing(self, Line):
- if self._RawData:
- pass
- return Line[0] == DT.TAB_SECTION_START and Line[-1] == DT.TAB_SECTION_END
-
- ## _TryBackSlash
- #
- # Split comment and DEC content, concatenate lines if end of char is '\'
- #
- # @param ProcessedLine: ProcessedLine line
- # @param ProcessedComments: ProcessedComments line
- #
- def _TryBackSlash(self, ProcessedLine, ProcessedComments):
- CatLine = ''
- Comment = ''
- Line = ProcessedLine
- CommentList = ProcessedComments
- while not self._RawData.IsEndOfFile():
- if Line == '':
- self._LoggerError(ST.ERR_DECPARSE_BACKSLASH_EMPTY)
- break
-
- if Comment:
- CommentList.append((Comment, self._RawData.LineIndex))
- if Line[-1] != DT.TAB_SLASH:
- CatLine += Line
- break
- elif len(Line) < 2 or Line[-2] != ' ':
- self._LoggerError(ST.ERR_DECPARSE_BACKSLASH)
- else:
- CatLine += Line[:-1]
- Line, Comment = CleanString(self._RawData.GetNextLine())
- #
- # Reach end of content
- #
- if self._RawData.IsEndOfFile():
- if not CatLine:
- if ProcessedLine[-1] == DT.TAB_SLASH:
- self._LoggerError(ST.ERR_DECPARSE_BACKSLASH_EMPTY)
- CatLine = ProcessedLine
- else:
- if not Line or Line[-1] == DT.TAB_SLASH:
- self._LoggerError(ST.ERR_DECPARSE_BACKSLASH_EMPTY)
- CatLine += Line
-
- self._RawData.CurrentLine = self._ReplaceMacro(CatLine)
- return CatLine, CommentList
-
- ## Parse
- # This is a template method in which other member functions which might
- # override by sub class are called. It is responsible for reading file
- # line by line, and call other member functions to parse. This function
- # should not be re-implement by sub class.
- #
- def Parse(self):
- HeadComments = []
- TailComments = []
-
- #======================================================================
- # CurComments may pointer to HeadComments or TailComments
- #======================================================================
- CurComments = HeadComments
- CurObj = None
- ItemNum = 0
- FromBuf = False
-
- #======================================================================
- # Used to report error information if empty section found
- #======================================================================
- Index = self._RawData.LineIndex
- LineStr = self._RawData.CurrentLine
- while not self._RawData.IsEndOfFile() or self._RawData.NextLine:
- if self._RawData.NextLine:
- #==============================================================
- # Have processed line in buffer
- #==============================================================
- Line = self._RawData.NextLine
- HeadComments.extend(self._RawData.HeadComment)
- TailComments.extend(self._RawData.TailComment)
- self._RawData.ResetNext()
- Comment = ''
- FromBuf = True
- else:
- #==============================================================
- # No line in buffer, read next line
- #==============================================================
- Line, Comment = CleanString(self._RawData.GetNextLine())
- FromBuf = False
- if Line:
- if not FromBuf and CurObj and TailComments:
- #==========================================================
- # Set tail comments to previous statement if not empty.
- #==========================================================
- CurObj.SetTailComment(CurObj.GetTailComment()+TailComments)
-
- if not FromBuf:
- del TailComments[:]
- CurComments = TailComments
- Comments = []
- if Comment:
- Comments = [(Comment, self._RawData.LineIndex)]
-
- #==============================================================
- # Try if last char of line has backslash
- #==============================================================
- Line, Comments = self._TryBackSlash(Line, Comments)
- CurComments.extend(Comments)
-
- #==============================================================
- # Macro found
- #==============================================================
- if Line.startswith('DEFINE '):
- self._MacroParser(Line)
- del HeadComments[:]
- del TailComments[:]
- CurComments = HeadComments
- continue
-
- if self._StopCurrentParsing(Line):
- #==========================================================
- # This line does not belong to this parse,
- # Save it, can be used by next parse
- #==========================================================
- self._RawData.SetNext(Line, HeadComments, TailComments)
- break
-
- Obj = self._ParseItem()
- ItemNum += 1
- if Obj:
- Obj.SetHeadComment(Obj.GetHeadComment()+HeadComments)
- Obj.SetTailComment(Obj.GetTailComment()+TailComments)
- del HeadComments[:]
- del TailComments[:]
- CurObj = Obj
- else:
- CurObj = None
- else:
- if id(CurComments) == id(TailComments):
- #==========================================================
- # Check if this comment belongs to tail comment
- #==========================================================
- if not self._TailCommentStrategy(Comment):
- CurComments = HeadComments
-
- if Comment:
- CurComments.append(((Comment, self._RawData.LineIndex)))
- else:
- del CurComments[:]
-
- if self._IsStatementRequired() and ItemNum == 0:
- Logger.Error(
- TOOL_NAME, FILE_PARSE_FAILURE,
- File=self._RawData.Filename,
- Line=Index,
- ExtraData=ST.ERR_DECPARSE_STATEMENT_EMPTY % LineStr
- )
-
-## _DecDefine
-# Parse define section
-#
-class _DecDefine(_DecBase):
- def __init__(self, RawData):
- _DecBase.__init__(self, RawData)
- self.ItemObject = DecDefineObject(RawData.Filename)
- self._LocalMacro = self._RawData.Macros
- self._DefSecNum = 0
-
- #
- # Each field has a function to validate
- #
- self.DefineValidation = {
- DT.TAB_DEC_DEFINES_DEC_SPECIFICATION : self._SetDecSpecification,
- DT.TAB_DEC_DEFINES_PACKAGE_NAME : self._SetPackageName,
- DT.TAB_DEC_DEFINES_PACKAGE_GUID : self._SetPackageGuid,
- DT.TAB_DEC_DEFINES_PACKAGE_VERSION : self._SetPackageVersion,
- }
-
- def BlockStart(self):
- self._DefSecNum += 1
- if self._DefSecNum > 1:
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_MULTISEC)
-
- ## CheckRequiredFields
- #
- # Check required fields: DEC_SPECIFICATION, PACKAGE_NAME
- # PACKAGE_GUID, PACKAGE_VERSION
- #
- def CheckRequiredFields(self):
- Ret = False
- if self.ItemObject.GetPackageSpecification() == '':
- Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE, File=self._RawData.Filename,
- ExtraData=ST.ERR_DECPARSE_DEFINE_REQUIRED % DT.TAB_DEC_DEFINES_DEC_SPECIFICATION)
- elif self.ItemObject.GetPackageName() == '':
- Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE, File=self._RawData.Filename,
- ExtraData=ST.ERR_DECPARSE_DEFINE_REQUIRED % DT.TAB_DEC_DEFINES_PACKAGE_NAME)
- elif self.ItemObject.GetPackageGuid() == '':
- Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE, File=self._RawData.Filename,
- ExtraData=ST.ERR_DECPARSE_DEFINE_REQUIRED % DT.TAB_DEC_DEFINES_PACKAGE_GUID)
- elif self.ItemObject.GetPackageVersion() == '':
- Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE, File=self._RawData.Filename,
- ExtraData=ST.ERR_DECPARSE_DEFINE_REQUIRED % DT.TAB_DEC_DEFINES_PACKAGE_VERSION)
- else:
- Ret = True
- return Ret
-
- def _ParseItem(self):
- Line = self._RawData.CurrentLine
- TokenList = GetSplitValueList(Line, DT.TAB_EQUAL_SPLIT, 1)
- if TokenList[0] == DT.TAB_DEC_DEFINES_PKG_UNI_FILE:
- pass
- elif len(TokenList) < 2:
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_FORMAT)
- elif TokenList[0] not in self.DefineValidation:
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_UNKNOWKEY % TokenList[0])
- else:
- self.DefineValidation[TokenList[0]](TokenList[1])
-
- DefineItem = DecDefineItemObject()
- if TokenList[0] != DT.TAB_DEC_DEFINES_PKG_UNI_FILE:
- DefineItem.Key = TokenList[0]
- DefineItem.Value = TokenList[1]
- self.ItemObject.AddItem(DefineItem, self._RawData.CurrentScope)
- return DefineItem
-
- def _SetDecSpecification(self, Token):
- if self.ItemObject.GetPackageSpecification():
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED % DT.TAB_DEC_DEFINES_DEC_SPECIFICATION)
- if not IsValidToken('0[xX][0-9a-fA-F]{8}', Token):
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_SPEC)
- self.ItemObject.SetPackageSpecification(Token)
-
- def _SetPackageName(self, Token):
- if self.ItemObject.GetPackageName():
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED % DT.TAB_DEC_DEFINES_PACKAGE_NAME)
- if not IsValidWord(Token):
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_PKGNAME)
- self.ItemObject.SetPackageName(Token)
-
- def _SetPackageGuid(self, Token):
- if self.ItemObject.GetPackageGuid():
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED % DT.TAB_DEC_DEFINES_PACKAGE_GUID)
- if not CheckGuidRegFormat(Token):
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_PKGGUID)
- self.ItemObject.SetPackageGuid(Token)
-
- def _SetPackageVersion(self, Token):
- if self.ItemObject.GetPackageVersion():
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED % DT.TAB_DEC_DEFINES_PACKAGE_VERSION)
- if not IsValidToken(VERSION_PATTERN, Token):
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_PKGVERSION)
- else:
- if not DT.TAB_SPLIT in Token:
- Token = Token + '.0'
- self.ItemObject._PkgVersion = Token
-
-## _DecInclude
-#
-# Parse include section
-#
-class _DecInclude(_DecBase):
- def __init__(self, RawData):
- _DecBase.__init__(self, RawData)
- self.ItemObject = DecIncludeObject(RawData.Filename)
-
- def _ParseItem(self):
- Line = self._RawData.CurrentLine
-
- if not IsValidPath(Line, self._RawData.PackagePath):
- self._LoggerError(ST.ERR_DECPARSE_INCLUDE % Line)
-
- Item = DecIncludeItemObject(StripRoot(self._RawData.PackagePath, Line), self._RawData.PackagePath)
- self.ItemObject.AddItem(Item, self._RawData.CurrentScope)
- return Item
-
-## _DecLibraryclass
-#
-# Parse library class section
-#
-class _DecLibraryclass(_DecBase):
- def __init__(self, RawData):
- _DecBase.__init__(self, RawData)
- self.ItemObject = DecLibraryclassObject(RawData.Filename)
-
- def _ParseItem(self):
- Line = self._RawData.CurrentLine
- TokenList = GetSplitValueList(Line, DT.TAB_VALUE_SPLIT)
- if len(TokenList) != 2:
- self._LoggerError(ST.ERR_DECPARSE_LIBCLASS_SPLIT)
- if TokenList[0] == '' or TokenList[1] == '':
- self._LoggerError(ST.ERR_DECPARSE_LIBCLASS_EMPTY)
- if not IsValidToken('[A-Z][0-9A-Za-z]*', TokenList[0]):
- self._LoggerError(ST.ERR_DECPARSE_LIBCLASS_LIB)
-
- self._CheckReDefine(TokenList[0])
-
- Value = TokenList[1]
- #
- # Must end with .h
- #
- if not Value.endswith('.h'):
- self._LoggerError(ST.ERR_DECPARSE_LIBCLASS_PATH_EXT)
-
- #
- # Path must be existed
- #
- if not IsValidPath(Value, self._RawData.PackagePath):
- self._LoggerError(ST.ERR_DECPARSE_INCLUDE % Value)
-
- Item = DecLibraryclassItemObject(TokenList[0], StripRoot(self._RawData.PackagePath, Value),
- self._RawData.PackagePath)
- self.ItemObject.AddItem(Item, self._RawData.CurrentScope)
- return Item
-
-## _DecPcd
-#
-# Parse PCD section
-#
-class _DecPcd(_DecBase):
- def __init__(self, RawData):
- _DecBase.__init__(self, RawData)
- self.ItemObject = DecPcdObject(RawData.Filename)
- #
- # Used to check duplicate token
- # Key is token space and token number (integer), value is C name
- #
- self.TokenMap = {}
-
- def _ParseItem(self):
- Line = self._RawData.CurrentLine
- TokenList = Line.split(DT.TAB_VALUE_SPLIT)
- if len(TokenList) < 4:
- self._LoggerError(ST.ERR_DECPARSE_PCD_SPLIT)
-
- #
- # Token space guid C name
- #
- PcdName = GetSplitValueList(TokenList[0], DT.TAB_SPLIT)
- if len(PcdName) != 2 or PcdName[0] == '' or PcdName[1] == '':
- self._LoggerError(ST.ERR_DECPARSE_PCD_NAME)
-
- Guid = PcdName[0]
- if not IsValidToken(CVAR_PATTERN, Guid):
- self._LoggerError(ST.ERR_DECPARSE_PCD_CVAR_GUID)
-
- #
- # PCD C name
- #
- CName = PcdName[1]
- if not IsValidToken(CVAR_PATTERN, CName):
- self._LoggerError(ST.ERR_DECPARSE_PCD_CVAR_PCDCNAME)
-
- self._CheckReDefine(Guid + DT.TAB_SPLIT + CName)
-
- #
- # Default value, may be C array, string or number
- #
- Data = DT.TAB_VALUE_SPLIT.join(TokenList[1:-2]).strip()
-
- #
- # PCD data type
- #
- DataType = TokenList[-2].strip()
- Valid, Cause = IsValidPcdDatum(DataType, Data)
- if not Valid:
- self._LoggerError(Cause)
- PcdType = self._RawData.CurrentScope[0][0]
- if PcdType == DT.TAB_PCDS_FEATURE_FLAG_NULL.upper() and DataType != 'BOOLEAN':
- self._LoggerError(ST.ERR_DECPARSE_PCD_FEATUREFLAG)
- #
- # Token value is the last element in list.
- #
- Token = TokenList[-1].strip()
- if not IsValidToken(PCD_TOKEN_PATTERN, Token):
- self._LoggerError(ST.ERR_DECPARSE_PCD_TOKEN % Token)
- elif not Token.startswith('0x') and not Token.startswith('0X'):
- if long(Token) > 4294967295:
- self._LoggerError(ST.ERR_DECPARSE_PCD_TOKEN_INT % Token)
- Token = hex(long(Token))[:-1]
-
- IntToken = long(Token, 0)
- if (Guid, IntToken) in self.TokenMap:
- if self.TokenMap[Guid, IntToken] != CName:
- self._LoggerError(ST.ERR_DECPARSE_PCD_TOKEN_UNIQUE%(Token))
- else:
- self.TokenMap[Guid, IntToken] = CName
-
- Item = DecPcdItemObject(Guid, CName, Data, DataType, Token)
- self.ItemObject.AddItem(Item, self._RawData.CurrentScope)
- return Item
-
-## _DecGuid
-#
-# Parse GUID, PPI, Protocol section
-#
-class _DecGuid(_DecBase):
- def __init__(self, RawData):
- _DecBase.__init__(self, RawData)
- self.GuidObj = DecGuidObject(RawData.Filename)
- self.PpiObj = DecPpiObject(RawData.Filename)
- self.ProtocolObj = DecProtocolObject(RawData.Filename)
- self.ObjectDict = \
- {
- DT.TAB_GUIDS.upper() : self.GuidObj,
- DT.TAB_PPIS.upper() : self.PpiObj,
- DT.TAB_PROTOCOLS.upper() : self.ProtocolObj
- }
-
- def GetDataObject(self):
- if self._RawData.CurrentScope:
- return self.ObjectDict[self._RawData.CurrentScope[0][0]]
- return None
-
- def GetGuidObject(self):
- return self.GuidObj
-
- def GetPpiObject(self):
- return self.PpiObj
-
- def GetProtocolObject(self):
- return self.ProtocolObj
-
- def _ParseItem(self):
- Line = self._RawData.CurrentLine
- TokenList = GetSplitValueList(Line, DT.TAB_EQUAL_SPLIT, 1)
- if len(TokenList) < 2:
- self._LoggerError(ST.ERR_DECPARSE_CGUID)
- if TokenList[0] == '':
- self._LoggerError(ST.ERR_DECPARSE_CGUID_NAME)
- if TokenList[1] == '':
- self._LoggerError(ST.ERR_DECPARSE_CGUID_GUID)
- if not IsValidToken(CVAR_PATTERN, TokenList[0]):
- self._LoggerError(ST.ERR_DECPARSE_PCD_CVAR_GUID)
-
- self._CheckReDefine(TokenList[0])
-
- if TokenList[1][0] != '{':
- if not CheckGuidRegFormat(TokenList[1]):
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_PKGGUID)
- GuidString = TokenList[1]
- else:
- #
- # Convert C format GUID to GUID string and Simple error check
- #
- GuidString = GuidStructureStringToGuidString(TokenList[1])
- if TokenList[1][0] != '{' or TokenList[1][-1] != '}' or GuidString == '':
- self._LoggerError(ST.ERR_DECPARSE_CGUID_GUIDFORMAT)
-
- #
- # Check C format GUID
- #
- if not IsValidCFormatGuid(TokenList[1]):
- self._LoggerError(ST.ERR_DECPARSE_CGUID_GUIDFORMAT)
-
- Item = DecGuidItemObject(TokenList[0], TokenList[1], GuidString)
- ItemObject = self.ObjectDict[self._RawData.CurrentScope[0][0]]
- ItemObject.AddItem(Item, self._RawData.CurrentScope)
- return Item
-
-## _DecUserExtension
-#
-# Parse user extention section
-#
-class _DecUserExtension(_DecBase):
- def __init__(self, RawData):
- _DecBase.__init__(self, RawData)
- self.ItemObject = DecUserExtensionObject(RawData.Filename)
- self._Headers = []
- self._CurItems = []
-
- def BlockStart(self):
- self._CurItems = []
- for Header in self._RawData.CurrentScope:
- if Header in self._Headers:
- self._LoggerError(ST.ERR_DECPARSE_UE_DUPLICATE)
- else:
- self._Headers.append(Header)
-
- for Item in self._CurItems:
- if Item.UserId == Header[1] and Item.IdString == Header[2]:
- Item.ArchAndModuleType.append(Header[3])
- break
- else:
- Item = DecUserExtensionItemObject()
- Item.UserId = Header[1]
- Item.IdString = Header[2]
- Item.ArchAndModuleType.append(Header[3])
- self._CurItems.append(Item)
- self.ItemObject.AddItem(Item, None)
- self._LocalMacro = {}
-
- def _ParseItem(self):
- Line = self._RawData.CurrentLine
- Item = None
- for Item in self._CurItems:
- if Item.UserString:
- Item.UserString = '\n'.join([Item.UserString, Line])
- else:
- Item.UserString = Line
- return Item
-
-## Dec
-#
-# Top dec parser
-#
-class Dec(_DecBase, _DecComments):
- def __init__(self, DecFile, Parse = True):
- try:
- Content = ConvertSpecialChar(open(DecFile, 'rb').readlines())
- except BaseException:
- Logger.Error(TOOL_NAME, FILE_OPEN_FAILURE, File=DecFile,
- ExtraData=ST.ERR_DECPARSE_FILEOPEN % DecFile)
- RawData = FileContent(DecFile, Content)
-
- _DecComments.__init__(self)
- _DecBase.__init__(self, RawData)
-
- self._Define = _DecDefine(RawData)
- self._Include = _DecInclude(RawData)
- self._Guid = _DecGuid(RawData)
- self._LibClass = _DecLibraryclass(RawData)
- self._Pcd = _DecPcd(RawData)
- self._UserEx = _DecUserExtension(RawData)
-
- #
- # DEC file supported data types (one type per section)
- #
- self._SectionParser = {
- DT.TAB_DEC_DEFINES.upper() : self._Define,
- DT.TAB_INCLUDES.upper() : self._Include,
- DT.TAB_LIBRARY_CLASSES.upper() : self._LibClass,
- DT.TAB_GUIDS.upper() : self._Guid,
- DT.TAB_PPIS.upper() : self._Guid,
- DT.TAB_PROTOCOLS.upper() : self._Guid,
- DT.TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : self._Pcd,
- DT.TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : self._Pcd,
- DT.TAB_PCDS_FEATURE_FLAG_NULL.upper() : self._Pcd,
- DT.TAB_PCDS_DYNAMIC_NULL.upper() : self._Pcd,
- DT.TAB_PCDS_DYNAMIC_EX_NULL.upper() : self._Pcd,
- DT.TAB_USER_EXTENSIONS.upper() : self._UserEx
- }
-
- if Parse:
- self.ParseDecComment()
- self.Parse()
- #
- # Parsing done, check required fields
- #
- self.CheckRequiredFields()
-
- def CheckRequiredFields(self):
- for SectionParser in self._SectionParser.values():
- if not SectionParser.CheckRequiredFields():
- return False
- return True
-
- ##
- # Parse DEC file
- #
- def ParseDecComment(self):
- while not self._RawData.IsEndOfFile():
- Line, Comment = CleanString(self._RawData.GetNextLine())
- #
- # Header must be pure comment
- #
- if Line != '':
- self._RawData.UndoNextLine()
- break
-
- if Comment:
- self._HeadComment.append((Comment, self._RawData.LineIndex))
- #
- # Double '#' indicates end of header comments
- #
- if not Comment or Comment == DT.TAB_SPECIAL_COMMENT:
- break
-
- return
-
- def _StopCurrentParsing(self, Line):
- return False
-
- def _ParseItem(self):
- self._SectionHeaderParser()
- if len(self._RawData.CurrentScope) == 0:
- self._LoggerError(ST.ERR_DECPARSE_SECTION_EMPTY)
-
- SectionObj = self._SectionParser[self._RawData.CurrentScope[0][0]]
-
- SectionObj.BlockStart()
- SectionObj.Parse()
-
- return SectionObj.GetDataObject()
-
- def _UserExtentionSectionParser(self):
- self._RawData.CurrentScope = []
- ArchList = set()
- Section = self._RawData.CurrentLine[1:-1]
-
- Par = ParserHelper(Section, self._RawData.Filename)
- while not Par.End():
- #
- # User extention
- #
- Token = Par.GetToken()
- if Token.upper() != DT.TAB_USER_EXTENSIONS.upper():
- self._LoggerError(ST.ERR_DECPARSE_SECTION_UE)
- UserExtension = Token.upper()
-
- Par.AssertChar(DT.TAB_SPLIT, ST.ERR_DECPARSE_SECTION_UE, self._RawData.LineIndex)
- #
- # UserID
- #
- Token = Par.GetToken()
- if not IsValidUserId(Token):
- self._LoggerError(ST.ERR_DECPARSE_SECTION_UE_USERID)
- UserId = Token
-
- Par.AssertChar(DT.TAB_SPLIT, ST.ERR_DECPARSE_SECTION_UE, self._RawData.LineIndex)
- #
- # IdString
- #
- Token = Par.GetToken()
- if not IsValidIdString(Token):
- self._LoggerError(ST.ERR_DECPARSE_SECTION_UE_IDSTRING)
- IdString = Token
-
- Arch = 'COMMON'
- if Par.Expect(DT.TAB_SPLIT):
- Token = Par.GetToken()
- Arch = Token.upper()
- if not IsValidArch(Arch):
- self._LoggerError(ST.ERR_DECPARSE_ARCH)
- ArchList.add(Arch)
-
- if [UserExtension, UserId, IdString, Arch] not in \
- self._RawData.CurrentScope:
- self._RawData.CurrentScope.append(
- [UserExtension, UserId, IdString, Arch]
- )
-
- if not Par.Expect(DT.TAB_COMMA_SPLIT):
- break
- elif Par.End():
- self._LoggerError(ST.ERR_DECPARSE_SECTION_COMMA)
-
- Par.AssertEnd(ST.ERR_DECPARSE_SECTION_UE, self._RawData.LineIndex)
-
- if 'COMMON' in ArchList and len(ArchList) > 1:
- self._LoggerError(ST.ERR_DECPARSE_SECTION_COMMON)
-
- ## Section header parser
- #
- # The section header is always in following format:
- #
- # [section_name.arch<.platform|module_type>]
- #
- def _SectionHeaderParser(self):
- if self._RawData.CurrentLine[0] != DT.TAB_SECTION_START or self._RawData.CurrentLine[-1] != DT.TAB_SECTION_END:
- self._LoggerError(ST.ERR_DECPARSE_SECTION_IDENTIFY)
-
- RawSection = self._RawData.CurrentLine[1:-1].strip().upper()
-
- #
- # Check defines section which is only allowed to occur once and
- # no arch can be followed
- #
- if RawSection.startswith(DT.TAB_DEC_DEFINES.upper()):
- if RawSection != DT.TAB_DEC_DEFINES.upper():
- self._LoggerError(ST.ERR_DECPARSE_DEFINE_SECNAME)
-
- #
- # Check user extension section
- #
- if RawSection.startswith(DT.TAB_USER_EXTENSIONS.upper()):
- return self._UserExtentionSectionParser()
-
- self._RawData.CurrentScope = []
- SectionNames = []
- ArchList = set()
- for Item in GetSplitValueList(RawSection, DT.TAB_COMMA_SPLIT):
- if Item == '':
- self._LoggerError(ST.ERR_DECPARSE_SECTION_SUBEMPTY % self._RawData.CurrentLine)
-
- ItemList = GetSplitValueList(Item, DT.TAB_SPLIT)
-
- #
- # different types of PCD are permissible in one section
- #
- SectionName = ItemList[0]
- if SectionName not in self._SectionParser:
- self._LoggerError(ST.ERR_DECPARSE_SECTION_UNKNOW % SectionName)
-
- if SectionName not in SectionNames:
- SectionNames.append(SectionName)
-
- #
- # In DEC specification, all section headers have at most two part:
- # SectionName.Arch except UserExtention
- #
- if len(ItemList) > 2:
- self._LoggerError(ST.ERR_DECPARSE_SECTION_SUBTOOMANY % Item)
-
- if DT.TAB_PCDS_FEATURE_FLAG_NULL.upper() in SectionNames and len(SectionNames) > 1:
- self._LoggerError(ST.ERR_DECPARSE_SECTION_FEATUREFLAG % DT.TAB_PCDS_FEATURE_FLAG_NULL)
- #
- # S1 is always Arch
- #
- if len(ItemList) > 1:
- Str1 = ItemList[1]
- if not IsValidArch(Str1):
- self._LoggerError(ST.ERR_DECPARSE_ARCH)
- else:
- Str1 = 'COMMON'
- ArchList.add(Str1)
-
- if [SectionName, Str1] not in self._RawData.CurrentScope:
- self._RawData.CurrentScope.append([SectionName, Str1])
- #
- # 'COMMON' must not be used with specific ARCHs at the same section
- #
- if 'COMMON' in ArchList and len(ArchList) > 1:
- self._LoggerError(ST.ERR_DECPARSE_SECTION_COMMON)
-
- if len(SectionNames) == 0:
- self._LoggerError(ST.ERR_DECPARSE_SECTION_SUBEMPTY % self._RawData.CurrentLine)
- if len(SectionNames) != 1:
- for Sec in SectionNames:
- if not Sec.startswith(DT.TAB_PCDS.upper()):
- self._LoggerError(ST.ERR_DECPARSE_SECTION_NAME % str(SectionNames))
-
- def GetDefineSectionObject(self):
- return self._Define.GetDataObject()
-
- def GetIncludeSectionObject(self):
- return self._Include.GetDataObject()
-
- def GetGuidSectionObject(self):
- return self._Guid.GetGuidObject()
-
- def GetProtocolSectionObject(self):
- return self._Guid.GetProtocolObject()
-
- def GetPpiSectionObject(self):
- return self._Guid.GetPpiObject()
-
- def GetLibraryClassSectionObject(self):
- return self._LibClass.GetDataObject()
-
- def GetPcdSectionObject(self):
- return self._Pcd.GetDataObject()
-
- def GetUserExtensionSectionObject(self):
- return self._UserEx.GetDataObject()
-
- def GetPackageSpecification(self):
- return self._Define.GetDataObject().GetPackageSpecification()
-
- def GetPackageName(self):
- return self._Define.GetDataObject().GetPackageName()
-
- def GetPackageGuid(self):
- return self._Define.GetDataObject().GetPackageGuid()
-
- def GetPackageVersion(self):
- return self._Define.GetDataObject().GetPackageVersion()
-
- def GetPackageUniFile(self):
- return self._Define.GetDataObject().GetPackageUniFile()
diff --git a/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py b/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py
deleted file mode 100644
index 8d28979393..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py
+++ /dev/null
@@ -1,371 +0,0 @@
-## @file
-# This file is used to define helper class and function for DEC parser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-'''
-DecParserMisc
-'''
-
-## Import modules
-#
-import os
-import Logger.Log as Logger
-from Logger.ToolError import FILE_PARSE_FAILURE
-from Logger import StringTable as ST
-from Library.DataType import TAB_COMMENT_SPLIT
-from Library.DataType import TAB_COMMENT_EDK1_SPLIT
-from Library.ExpressionValidate import IsValidBareCString
-from Library.ParserValidate import IsValidCFormatGuid
-from Library.ExpressionValidate import IsValidLogicalExpr
-from Library.ExpressionValidate import IsValidStringTest
-from Library.Misc import CheckGuidRegFormat
-
-TOOL_NAME = 'DecParser'
-VERSION_PATTERN = '[0-9]+(\.[0-9]+)?'
-CVAR_PATTERN = '[_a-zA-Z][a-zA-Z0-9_]*'
-PCD_TOKEN_PATTERN = '(0[xX]0*[a-fA-F0-9]{1,8})|([0-9]+)'
-MACRO_PATTERN = '[A-Z][_A-Z0-9]*'
-
-## FileContent
-# Class to hold DEC file information
-#
-class FileContent:
- def __init__(self, Filename, FileContent2):
- self.Filename = Filename
- self.PackagePath, self.PackageFile = os.path.split(Filename)
- self.LineIndex = 0
- self.CurrentLine = ''
- self.NextLine = ''
- self.HeadComment = []
- self.TailComment = []
- self.CurrentScope = None
- self.Content = FileContent2
- self.Macros = {}
- self.FileLines = len(FileContent2)
-
- def GetNextLine(self):
- if self.LineIndex >= self.FileLines:
- return ''
- Line = self.Content[self.LineIndex]
- self.LineIndex += 1
- return Line
-
- def UndoNextLine(self):
- if self.LineIndex > 0:
- self.LineIndex -= 1
-
- def ResetNext(self):
- self.HeadComment = []
- self.TailComment = []
- self.NextLine = ''
-
- def SetNext(self, Line, HeadComment, TailComment):
- self.NextLine = Line
- self.HeadComment = HeadComment
- self.TailComment = TailComment
-
- def IsEndOfFile(self):
- return self.LineIndex >= self.FileLines
-
-
-## StripRoot
-#
-# Strip root path
-#
-# @param Root: Root must be absolute path
-# @param Path: Path to be stripped
-#
-def StripRoot(Root, Path):
- OrigPath = Path
- Root = os.path.normpath(Root)
- Path = os.path.normpath(Path)
- if not os.path.isabs(Root):
- return OrigPath
- if Path.startswith(Root):
- Path = Path[len(Root):]
- if Path and Path[0] == os.sep:
- Path = Path[1:]
- return Path
- return OrigPath
-
-## CleanString
-#
-# Split comments in a string
-# Remove spaces
-#
-# @param Line: The string to be cleaned
-# @param CommentCharacter: Comment char, used to ignore comment content,
-# default is DataType.TAB_COMMENT_SPLIT
-#
-def CleanString(Line, CommentCharacter=TAB_COMMENT_SPLIT, \
- AllowCppStyleComment=False):
- #
- # remove whitespace
- #
- Line = Line.strip()
- #
- # Replace EDK1's comment character
- #
- if AllowCppStyleComment:
- Line = Line.replace(TAB_COMMENT_EDK1_SPLIT, CommentCharacter)
- #
- # separate comments and statements
- #
- Comment = ''
- InQuote = False
- for Index in range(0, len(Line)):
- if Line[Index] == '"':
- InQuote = not InQuote
- continue
- if Line[Index] == CommentCharacter and not InQuote:
- Comment = Line[Index:].strip()
- Line = Line[0:Index].strip()
- break
-
- return Line, Comment
-
-
-## IsValidHexByte
-#
-# Check if Token is HexByte: <HexByte> ::= 0x <HexDigit>{1,2}
-#
-# @param Token: Token to be checked
-#
-def IsValidHexByte(Token):
- Token = Token.strip()
- if not Token.lower().startswith('0x') or not (len(Token) < 5 and len(Token) > 2):
- return False
- try:
- Token = long(Token, 0)
- except BaseException:
- return False
- return True
-
-## IsValidNList
-#
-# Check if Value has the format of <HexByte> ["," <HexByte>]{0,}
-# <HexByte> ::= "0x" <HexDigit>{1,2}
-#
-# @param Value: Value to be checked
-#
-def IsValidNList(Value):
- Par = ParserHelper(Value)
- if Par.End():
- return False
- while not Par.End():
- Token = Par.GetToken(',\t ')
- if not IsValidHexByte(Token):
- return False
- if Par.Expect(','):
- if Par.End():
- return False
- continue
- else:
- break
- return Par.End()
-
-## IsValidCArray
-#
-# check Array is valid
-#
-# @param Array: The input Array
-#
-def IsValidCArray(Array):
- Par = ParserHelper(Array)
- if not Par.Expect('{'):
- return False
- if Par.End():
- return False
- while not Par.End():
- Token = Par.GetToken(',}\t ')
- #
- # 0xa, 0xaa
- #
- if not IsValidHexByte(Token):
- return False
- if Par.Expect(','):
- if Par.End():
- return False
- continue
- elif Par.Expect('}'):
- #
- # End of C array
- #
- break
- else:
- return False
- return Par.End()
-
-## IsValidPcdDatum
-#
-# check PcdDatum is valid
-#
-# @param Type: The pcd Type
-# @param Value: The pcd Value
-#
-def IsValidPcdDatum(Type, Value):
- if Type not in ["UINT8", "UINT16", "UINT32", "UINT64", "VOID*", "BOOLEAN"]:
- return False, ST.ERR_DECPARSE_PCD_TYPE
- if Type == "VOID*":
- if not ((Value.startswith('L"') or Value.startswith('"') and \
- Value.endswith('"'))
- or (IsValidCArray(Value)) or (IsValidCFormatGuid(Value)) \
- or (IsValidNList(Value)) or (CheckGuidRegFormat(Value))
- ):
- return False, ST.ERR_DECPARSE_PCD_VOID % (Value, Type)
- RealString = Value[Value.find('"') + 1 :-1]
- if RealString:
- if not IsValidBareCString(RealString):
- return False, ST.ERR_DECPARSE_PCD_VOID % (Value, Type)
- elif Type == 'BOOLEAN':
- if Value in ['TRUE', 'FALSE', 'true', 'false', 'True', 'False',
- '0x1', '0x01', '1', '0x0', '0x00', '0']:
- return True, ""
- Valid, Cause = IsValidStringTest(Value)
- if not Valid:
- Valid, Cause = IsValidLogicalExpr(Value)
- if not Valid:
- return False, Cause
- else:
- if Value and (Value[0] == '-' or Value[0] == '+'):
- return False, ST.ERR_DECPARSE_PCD_INT_NEGTIVE % (Value, Type)
- try:
- StrVal = Value
- if Value and not Value.startswith('0x') \
- and not Value.startswith('0X'):
- Value = Value.lstrip('0')
- if not Value:
- return True, ""
- Value = long(Value, 0)
- TypeLenMap = {
- #
- # 0x00 - 0xff
- #
- 'UINT8' : 2,
- #
- # 0x0000 - 0xffff
- #
- 'UINT16' : 4,
- #
- # 0x00000000 - 0xffffffff
- #
- 'UINT32' : 8,
- #
- # 0x0 - 0xffffffffffffffff
- #
- 'UINT64' : 16
- }
- HexStr = hex(Value)
- #
- # First two chars of HexStr are 0x and tail char is L
- #
- if TypeLenMap[Type] < len(HexStr) - 3:
- return False, ST.ERR_DECPARSE_PCD_INT_EXCEED % (StrVal, Type)
- except BaseException:
- return False, ST.ERR_DECPARSE_PCD_INT % (Value, Type)
-
- return True, ""
-
-## ParserHelper
-#
-class ParserHelper:
- def __init__(self, String, File=''):
- self._String = String
- self._StrLen = len(String)
- self._Index = 0
- self._File = File
-
- ## End
- #
- # End
- #
- def End(self):
- self.__SkipWhitespace()
- return self._Index >= self._StrLen
-
- ## __SkipWhitespace
- #
- # Skip whitespace
- #
- def __SkipWhitespace(self):
- for Char in self._String[self._Index:]:
- if Char not in ' \t':
- break
- self._Index += 1
-
- ## Expect
- #
- # Expect char in string
- #
- # @param ExpectChar: char expected in index of string
- #
- def Expect(self, ExpectChar):
- self.__SkipWhitespace()
- for Char in self._String[self._Index:]:
- if Char != ExpectChar:
- return False
- else:
- self._Index += 1
- return True
- #
- # Index out of bound of String
- #
- return False
-
- ## GetToken
- #
- # Get token until encounter StopChar, front whitespace is consumed
- #
- # @param StopChar: Get token until encounter char in StopChar
- # @param StkipPair: Only can be ' or ", StopChar in SkipPair are skipped
- #
- def GetToken(self, StopChar='.,|\t ', SkipPair='"'):
- self.__SkipWhitespace()
- PreIndex = self._Index
- InQuote = False
- LastChar = ''
- for Char in self._String[self._Index:]:
- if Char == SkipPair and LastChar != '\\':
- InQuote = not InQuote
- if Char in StopChar and not InQuote:
- break
- self._Index += 1
- if Char == '\\' and LastChar == '\\':
- LastChar = ''
- else:
- LastChar = Char
- return self._String[PreIndex:self._Index]
-
- ## AssertChar
- #
- # Assert char at current index of string is AssertChar, or will report
- # error message
- #
- # @param AssertChar: AssertChar
- # @param ErrorString: ErrorString
- # @param ErrorLineNum: ErrorLineNum
- #
- def AssertChar(self, AssertChar, ErrorString, ErrorLineNum):
- if not self.Expect(AssertChar):
- Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE, File=self._File,
- Line=ErrorLineNum, ExtraData=ErrorString)
-
- ## AssertEnd
- #
- # @param ErrorString: ErrorString
- # @param ErrorLineNum: ErrorLineNum
- #
- def AssertEnd(self, ErrorString, ErrorLineNum):
- self.__SkipWhitespace()
- if self._Index != self._StrLen:
- Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE, File=self._File,
- Line=ErrorLineNum, ExtraData=ErrorString)
diff --git a/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py b/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py
deleted file mode 100644
index 6bf070be41..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py
+++ /dev/null
@@ -1,300 +0,0 @@
-## @file
-# This file is used to provide method for process AsBuilt INF file. It will consumed by InfParser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-'''
-InfAsBuiltProcess
-'''
-## Import modules
-#
-
-import os
-import re
-from Library import GlobalData
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger import ToolError
-
-from Library.String import GetSplitValueList
-from Library.Misc import GetHelpStringByRemoveHashKey
-from Library.Misc import ValidFile
-from Library.Misc import ProcessLineExtender
-from Library.ParserValidate import IsValidPath
-from Library.Parsing import MacroParser
-from Parser.InfParserMisc import InfExpandMacro
-
-from Library import DataType as DT
-
-## GetLibInstanceInfo
-#
-# Get the information from Library Instance INF file.
-#
-# @param string. A string start with # and followed by INF file path
-# @param WorkSpace. The WorkSpace directory used to combined with INF file path.
-#
-# @return GUID, Version
-def GetLibInstanceInfo(String, WorkSpace, LineNo, CurrentInfFileName):
-
- FileGuidString = ""
- VerString = ""
-
- OrignalString = String
- String = String.strip()
- if not String:
- return None, None
- #
- # Remove "#" characters at the beginning
- #
- String = GetHelpStringByRemoveHashKey(String)
- String = String.strip()
-
- #
- # To deal with library instance specified by GUID and version
- #
- RegFormatGuidPattern = re.compile("\s*([0-9a-fA-F]){8}-"
- "([0-9a-fA-F]){4}-"
- "([0-9a-fA-F]){4}-"
- "([0-9a-fA-F]){4}-"
- "([0-9a-fA-F]){12}\s*")
- VersionPattern = re.compile('[\t\s]*\d+(\.\d+)?[\t\s]*')
- GuidMatchedObj = RegFormatGuidPattern.search(String)
-
- if String.upper().startswith('GUID') and GuidMatchedObj and 'Version' in String:
- VersionStr = String[String.upper().find('VERSION') + 8:]
- VersionMatchedObj = VersionPattern.search(VersionStr)
- if VersionMatchedObj:
- Guid = GuidMatchedObj.group().strip()
- Version = VersionMatchedObj.group().strip()
- return GetGuidVerFormLibInstance(Guid, Version, WorkSpace, CurrentInfFileName)
-
- #
- # To deal with library instance specified by file name
- #
- FileLinesList = GetFileLineContent(String, WorkSpace, LineNo, OrignalString)
-
-
- ReFindFileGuidPattern = re.compile("^\s*FILE_GUID\s*=.*$")
- ReFindVerStringPattern = re.compile("^\s*VERSION_STRING\s*=.*$")
-
- for Line in FileLinesList:
- if ReFindFileGuidPattern.match(Line):
- FileGuidString = Line
- if ReFindVerStringPattern.match(Line):
- VerString = Line
-
- if FileGuidString:
- FileGuidString = GetSplitValueList(FileGuidString, '=', 1)[1]
- if VerString:
- VerString = GetSplitValueList(VerString, '=', 1)[1]
-
- return FileGuidString, VerString
-
-## GetPackageListInfo
-#
-# Get the package information from INF file.
-#
-# @param string. A string start with # and followed by INF file path
-# @param WorkSpace. The WorkSpace directory used to combined with INF file path.
-#
-# @return GUID, Version
-def GetPackageListInfo(FileNameString, WorkSpace, LineNo):
- PackageInfoList = []
- DefineSectionMacros = {}
- PackageSectionMacros = {}
-
- FileLinesList = GetFileLineContent(FileNameString, WorkSpace, LineNo, '')
-
- RePackageHeader = re.compile('^\s*\[Packages.*\].*$')
- ReDefineHeader = re.compile('^\s*\[Defines].*$')
-
- PackageHederFlag = False
- DefineHeaderFlag = False
- LineNo = -1
- for Line in FileLinesList:
- LineNo += 1
- Line = Line.strip()
-
- if Line.startswith('['):
- PackageHederFlag = False
- DefineHeaderFlag = False
-
- if Line.startswith("#"):
- continue
-
- if not Line:
- continue
-
- #
- # Found [Packages] section
- #
- if RePackageHeader.match(Line):
- PackageHederFlag = True
- continue
-
- #
- # Found [Define] section
- #
- if ReDefineHeader.match(Line):
- DefineHeaderFlag = True
- continue
-
- if DefineHeaderFlag:
- #
- # Find Macro
- #
- Name, Value = MacroParser((Line, LineNo),
- FileNameString,
- DT.MODEL_META_DATA_HEADER,
- DefineSectionMacros)
-
- if Name != None:
- DefineSectionMacros[Name] = Value
- continue
-
- if PackageHederFlag:
-
- #
- # Find Macro
- #
- Name, Value = MacroParser((Line, LineNo),
- FileNameString,
- DT.MODEL_META_DATA_PACKAGE,
- DefineSectionMacros)
- if Name != None:
- PackageSectionMacros[Name] = Value
- continue
-
- #
- # Replace with Local section Macro and [Defines] section Macro.
- #
- Line = InfExpandMacro(Line, (FileNameString, Line, LineNo), DefineSectionMacros, PackageSectionMacros, True)
-
- Line = GetSplitValueList(Line, "#", 1)[0]
- Line = GetSplitValueList(Line, "|", 1)[0]
- PackageInfoList.append(Line)
-
- return PackageInfoList
-
-def GetFileLineContent(FileName, WorkSpace, LineNo, OriginalString):
-
- if not LineNo:
- LineNo = -1
-
- #
- # Validate file name exist.
- #
- FullFileName = os.path.normpath(os.path.realpath(os.path.join(WorkSpace, FileName)))
- if not (ValidFile(FullFileName)):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_FILELIST_EXIST%(FileName),
- File=GlobalData.gINF_MODULE_NAME,
- Line=LineNo,
- ExtraData=OriginalString)
-
- #
- # Validate file exist/format.
- #
- if not IsValidPath(FileName, WorkSpace):
- Logger.Error("InfParser",
- ToolError.FORMAT_INVALID,
- ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID%(FileName),
- File=GlobalData.gINF_MODULE_NAME,
- Line=LineNo,
- ExtraData=OriginalString)
-
- FileLinesList = []
-
- try:
- FullFileName = FullFileName.replace('\\', '/')
- Inputfile = open(FullFileName, "rb", 0)
- try:
- FileLinesList = Inputfile.readlines()
- except BaseException:
- Logger.Error("InfParser", ToolError.FILE_READ_FAILURE, ST.ERR_FILE_OPEN_FAILURE, File=FullFileName)
- finally:
- Inputfile.close()
- except BaseException:
- Logger.Error("InfParser",
- ToolError.FILE_READ_FAILURE,
- ST.ERR_FILE_OPEN_FAILURE,
- File=FullFileName)
-
- FileLinesList = ProcessLineExtender(FileLinesList)
-
- return FileLinesList
-
-##
-# Get all INF files from current workspace
-#
-#
-def GetInfsFromWorkSpace(WorkSpace):
- InfFiles = []
- for top, dirs, files in os.walk(WorkSpace):
- dirs = dirs # just for pylint
- for File in files:
- if File.upper().endswith(".INF"):
- InfFiles.append(os.path.join(top, File))
-
- return InfFiles
-
-##
-# Get GUID and version from library instance file
-#
-#
-def GetGuidVerFormLibInstance(Guid, Version, WorkSpace, CurrentInfFileName):
- for InfFile in GetInfsFromWorkSpace(WorkSpace):
- try:
- if InfFile.strip().upper() == CurrentInfFileName.strip().upper():
- continue
- InfFile = InfFile.replace('\\', '/')
- if InfFile not in GlobalData.gLIBINSTANCEDICT:
- InfFileObj = open(InfFile, "rb", 0)
- GlobalData.gLIBINSTANCEDICT[InfFile] = InfFileObj
- else:
- InfFileObj = GlobalData.gLIBINSTANCEDICT[InfFile]
-
- except BaseException:
- Logger.Error("InfParser",
- ToolError.FILE_READ_FAILURE,
- ST.ERR_FILE_OPEN_FAILURE,
- File=InfFile)
- try:
- FileLinesList = InfFileObj.readlines()
- FileLinesList = ProcessLineExtender(FileLinesList)
-
- ReFindFileGuidPattern = re.compile("^\s*FILE_GUID\s*=.*$")
- ReFindVerStringPattern = re.compile("^\s*VERSION_STRING\s*=.*$")
-
- for Line in FileLinesList:
- if ReFindFileGuidPattern.match(Line):
- FileGuidString = Line
- if ReFindVerStringPattern.match(Line):
- VerString = Line
-
- if FileGuidString:
- FileGuidString = GetSplitValueList(FileGuidString, '=', 1)[1]
- if VerString:
- VerString = GetSplitValueList(VerString, '=', 1)[1]
-
- if FileGuidString.strip().upper() == Guid.upper() and \
- VerString.strip().upper() == Version.upper():
- return Guid, Version
-
- except BaseException:
- Logger.Error("InfParser", ToolError.FILE_READ_FAILURE, ST.ERR_FILE_OPEN_FAILURE, File=InfFile)
- finally:
- InfFileObj.close()
-
- return '', ''
-
-
diff --git a/BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py
deleted file mode 100644
index 36142cf84a..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py
+++ /dev/null
@@ -1,217 +0,0 @@
-## @file
-# This file contained the parser for [Binaries] sections in INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-'''
-InfBinarySectionParser
-'''
-##
-# Import Modules
-#
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import FORMAT_INVALID
-from Parser.InfParserMisc import InfExpandMacro
-from Library import DataType as DT
-from Library.Parsing import MacroParser
-from Library.Misc import GetSplitValueList
-from Object.Parser.InfCommonObject import InfLineCommentObject
-from Object.Parser.InfCommonObject import CurrentLine
-from Parser.InfParserMisc import InfParserSectionRoot
-
-class InfBinarySectionParser(InfParserSectionRoot):
- ## InfBinaryParser
- #
- #
- def InfBinaryParser(self, SectionString, InfSectionObject, FileName):
- #
- # Macro defined in this section
- #
- SectionMacros = {}
- ValueList = []
- #
- # For UI (UI, SEC_UI, UNI_UI) binaries
- # One and only one UI section can be included
- #
- UiBinaryList = []
- #
- # For Version (VER, SEC_VER, UNI_VER).
- # One and only one VER section on be included
- #
- VerBinaryList = []
- #
- # For other common type binaries
- #
- ComBinaryList = []
-
- StillCommentFalg = False
- HeaderComments = []
- LineComment = None
-
- AllSectionContent = ''
- #
- # Parse section content
- #
- for Line in SectionString:
- BinLineContent = Line[0]
- BinLineNo = Line[1]
-
- if BinLineContent.strip() == '':
- continue
-
- CurrentLineObj = CurrentLine()
- CurrentLineObj.FileName = FileName
- CurrentLineObj.LineString = BinLineContent
- CurrentLineObj.LineNo = BinLineNo
- #
- # Found Header Comments
- #
- if BinLineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- #
- # Last line is comments, and this line go on.
- #
- if StillCommentFalg:
- HeaderComments.append(Line)
- AllSectionContent += BinLineContent + DT.END_OF_LINE
- continue
- #
- # First time encounter comment
- #
- else:
- #
- # Clear original data
- #
- HeaderComments = []
- HeaderComments.append(Line)
- AllSectionContent += BinLineContent + DT.END_OF_LINE
- StillCommentFalg = True
- continue
- else:
- StillCommentFalg = False
-
- if len(HeaderComments) >= 1:
- LineComment = InfLineCommentObject()
- LineCommentContent = ''
- for Item in HeaderComments:
- LineCommentContent += Item[0] + DT.END_OF_LINE
- LineComment.SetHeaderComments(LineCommentContent)
-
- #
- # Find Tail comment.
- #
- if BinLineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- TailComments = BinLineContent[BinLineContent.find(DT.TAB_COMMENT_SPLIT):]
- BinLineContent = BinLineContent[:BinLineContent.find(DT.TAB_COMMENT_SPLIT)]
- if LineComment == None:
- LineComment = InfLineCommentObject()
- LineComment.SetTailComments(TailComments)
-
- #
- # Find Macro
- #
- MacroDef = MacroParser((BinLineContent, BinLineNo),
- FileName,
- DT.MODEL_EFI_BINARY_FILE,
- self.FileLocalMacros)
- if MacroDef[0] != None:
- SectionMacros[MacroDef[0]] = MacroDef[1]
- LineComment = None
- HeaderComments = []
- continue
-
- #
- # Replace with Local section Macro and [Defines] section Macro.
- #
- LineContent = InfExpandMacro(BinLineContent,
- (FileName, BinLineContent, BinLineNo),
- self.FileLocalMacros,
- SectionMacros, True)
-
- AllSectionContent += LineContent + DT.END_OF_LINE
- TokenList = GetSplitValueList(LineContent, DT.TAB_VALUE_SPLIT, 1)
- ValueList[0:len(TokenList)] = TokenList
-
- #
- # Should equal to UI/SEC_UI/UNI_UI
- #
- ValueList[0] = ValueList[0].strip()
- if ValueList[0] == DT.BINARY_FILE_TYPE_UNI_UI or \
- ValueList[0] == DT.BINARY_FILE_TYPE_SEC_UI or \
- ValueList[0] == DT.BINARY_FILE_TYPE_UI:
- if len(ValueList) == 2:
- TokenList = GetSplitValueList(ValueList[1],
- DT.TAB_VALUE_SPLIT,
- 2)
- NewValueList = []
- NewValueList.append(ValueList[0])
- for Item in TokenList:
- NewValueList.append(Item)
- UiBinaryList.append((NewValueList,
- LineComment,
- CurrentLineObj))
- #
- # Should equal to VER/SEC_VER/UNI_VER
- #
- elif ValueList[0] == DT.BINARY_FILE_TYPE_UNI_VER or \
- ValueList[0] == DT.BINARY_FILE_TYPE_SEC_VER or \
- ValueList[0] == DT.BINARY_FILE_TYPE_VER:
- if len(ValueList) == 2:
- TokenList = GetSplitValueList(ValueList[1],
- DT.TAB_VALUE_SPLIT,
- 2)
- NewValueList = []
- NewValueList.append(ValueList[0])
- for Item in TokenList:
- NewValueList.append(Item)
- VerBinaryList.append((NewValueList,
- LineComment,
- CurrentLineObj))
- else:
- if len(ValueList) == 2:
- TokenList = GetSplitValueList(ValueList[1],
- DT.TAB_VALUE_SPLIT,
- 4)
- NewValueList = []
- NewValueList.append(ValueList[0])
- for Item in TokenList:
- NewValueList.append(Item)
- ComBinaryList.append((NewValueList,
- LineComment,
- CurrentLineObj))
-
- ValueList = []
- LineComment = None
- TailComments = ''
- HeaderComments = []
- continue
-
- #
- # Current section archs
- #
- ArchList = []
- for Item in self.LastSectionHeaderContent:
- if Item[1] not in ArchList:
- ArchList.append(Item[1])
- InfSectionObject.SetSupArchList(Item[1])
-
- InfSectionObject.SetAllContent(AllSectionContent)
- if not InfSectionObject.SetBinary(UiBinaryList,
- VerBinaryList,
- ComBinaryList,
- ArchList):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR%("[Binaries]"),
- File=FileName,
- Line=Item[3])
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py
deleted file mode 100644
index 941641a845..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py
+++ /dev/null
@@ -1,218 +0,0 @@
-## @file
-# This file contained the parser for BuildOption sections in INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-InfBuildOptionSectionParser
-'''
-##
-# Import Modules
-#
-from Library import DataType as DT
-from Library import GlobalData
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import FORMAT_INVALID
-from Parser.InfParserMisc import InfExpandMacro
-from Library.Misc import GetSplitValueList
-from Parser.InfParserMisc import IsAsBuildOptionInfo
-from Library.Misc import GetHelpStringByRemoveHashKey
-from Library.ParserValidate import IsValidFamily
-from Library.ParserValidate import IsValidBuildOptionName
-from Parser.InfParserMisc import InfParserSectionRoot
-
-class InfBuildOptionSectionParser(InfParserSectionRoot):
- ## InfBuildOptionParser
- #
- #
- def InfBuildOptionParser(self, SectionString, InfSectionObject, FileName):
-
- BuildOptionList = []
- SectionContent = ''
-
- if not GlobalData.gIS_BINARY_INF:
- ValueList = []
- LineNo = 0
-
- for Line in SectionString:
- LineContent = Line[0]
- LineNo = Line[1]
- TailComments = ''
- ReplaceFlag = False
-
- if LineContent.strip() == '':
- SectionContent += LineContent + DT.END_OF_LINE
- continue
- #
- # Found Comment
- #
- if LineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- SectionContent += LineContent + DT.END_OF_LINE
- continue
-
- #
- # Find Tail comment.
- #
- if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- TailComments = LineContent[LineContent.find(DT.TAB_COMMENT_SPLIT):]
- LineContent = LineContent[:LineContent.find(DT.TAB_COMMENT_SPLIT)]
-
- TokenList = GetSplitValueList(LineContent, DT.TAB_DEQUAL_SPLIT, 1)
- if len(TokenList) == 2:
- #
- # "Replace" type build option
- #
- TokenList.append('True')
- ReplaceFlag = True
- else:
- TokenList = GetSplitValueList(LineContent, DT.TAB_EQUAL_SPLIT, 1)
- #
- # "Append" type build option
- #
- if len(TokenList) == 2:
- TokenList.append('False')
- else:
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_BUILD_OPTION_FORMAT_INVALID,
- ExtraData=LineContent,
- File=FileName,
- Line=LineNo)
-
- ValueList[0:len(TokenList)] = TokenList
-
- #
- # Replace with [Defines] section Macro
- #
- ValueList[0] = InfExpandMacro(ValueList[0], (FileName, LineContent, LineNo),
- self.FileLocalMacros, None)
- ValueList[1] = InfExpandMacro(ValueList[1], (FileName, LineContent, LineNo),
- self.FileLocalMacros, None, True)
- EqualString = ''
- if not ReplaceFlag:
- EqualString = ' = '
- else:
- EqualString = ' == '
-
- SectionContent += ValueList[0] + EqualString + ValueList[1] + TailComments + DT.END_OF_LINE
-
- Family = GetSplitValueList(ValueList[0], DT.TAB_COLON_SPLIT, 1)
- if len(Family) == 2:
- if not IsValidFamily(Family[0]):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_BUILD_OPTION_FORMAT_INVALID,
- ExtraData=LineContent,
- File=FileName,
- Line=LineNo)
- if not IsValidBuildOptionName(Family[1]):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_BUILD_OPTION_FORMAT_INVALID,
- ExtraData=LineContent,
- File=FileName,
- Line=LineNo)
- if len(Family) == 1:
- if not IsValidBuildOptionName(Family[0]):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_BUILD_OPTION_FORMAT_INVALID,
- ExtraData=LineContent,
- File=FileName,
- Line=LineNo)
-
- BuildOptionList.append(ValueList)
- ValueList = []
- continue
- else:
- BuildOptionList = InfAsBuiltBuildOptionParser(SectionString, FileName)
-
- #
- # Current section archs
- #
- ArchList = []
- LastItem = ''
- for Item in self.LastSectionHeaderContent:
- LastItem = Item
- if not (Item[1] == '' or Item[1] == '') and Item[1] not in ArchList:
- ArchList.append(Item[1])
- InfSectionObject.SetSupArchList(Item[1])
-
- InfSectionObject.SetAllContent(SectionContent)
- if not InfSectionObject.SetBuildOptions(BuildOptionList, ArchList, SectionContent):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR%("[BuilOptions]"),
- File=FileName,
- Line=LastItem[3])
-
-## InfBuildOptionParser
-#
-#
-def InfAsBuiltBuildOptionParser(SectionString, FileName):
- BuildOptionList = []
- #
- # AsBuild Binary INF file.
- #
- AsBuildOptionFlag = False
- BuildOptionItem = []
- Count = 0
- for Line in SectionString:
- Count += 1
- LineContent = Line[0]
- LineNo = Line[1]
-
- #
- # The last line
- #
- if len(SectionString) == Count:
- if LineContent.strip().startswith("##") and AsBuildOptionFlag:
- BuildOptionList.append(BuildOptionItem)
- BuildOptionList.append([GetHelpStringByRemoveHashKey(LineContent)])
- elif LineContent.strip().startswith("#") and AsBuildOptionFlag:
- BuildOptionInfo = GetHelpStringByRemoveHashKey(LineContent)
- BuildOptionItem.append(BuildOptionInfo)
- BuildOptionList.append(BuildOptionItem)
- else:
- if len(BuildOptionItem) > 0:
- BuildOptionList.append(BuildOptionItem)
-
- break
-
- if LineContent.strip() == '':
- AsBuildOptionFlag = False
- continue
-
- if LineContent.strip().startswith("##") and AsBuildOptionFlag:
- if len(BuildOptionItem) > 0:
- BuildOptionList.append(BuildOptionItem)
-
- BuildOptionItem = []
-
- if not LineContent.strip().startswith("#"):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_BO_CONTATIN_ASBUILD_AND_COMMON,
- File=FileName,
- Line=LineNo,
- ExtraData=LineContent)
-
- if IsAsBuildOptionInfo(LineContent):
- AsBuildOptionFlag = True
- continue
-
- if AsBuildOptionFlag:
- BuildOptionInfo = GetHelpStringByRemoveHashKey(LineContent)
- BuildOptionItem.append(BuildOptionInfo)
-
- return BuildOptionList \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py
deleted file mode 100644
index d00087a128..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py
+++ /dev/null
@@ -1,197 +0,0 @@
-## @file
-# This file contained the parser for define sections in INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-InfDefineSectionParser
-'''
-##
-# Import Modules
-#
-import re
-
-from Library import DataType as DT
-from Library import GlobalData
-from Library.Parsing import MacroParser
-from Library.Misc import GetSplitValueList
-from Library.ParserValidate import IsValidArch
-from Object.Parser.InfCommonObject import InfLineCommentObject
-from Object.Parser.InfDefineObject import InfDefMember
-from Parser.InfParserMisc import InfExpandMacro
-from Object.Parser.InfMisc import ErrorInInf
-from Logger import StringTable as ST
-from Parser.InfParserMisc import InfParserSectionRoot
-
-## __GetValidateArchList
-#
-#
-def GetValidateArchList(LineContent):
-
- TempArch = ''
- ArchList = []
- ValidateAcrhPatten = re.compile(r"^\s*#\s*VALID_ARCHITECTURES\s*=\s*.*$", re.DOTALL)
-
- if ValidateAcrhPatten.match(LineContent):
- TempArch = GetSplitValueList(LineContent, DT.TAB_EQUAL_SPLIT, 1)[1]
-
- TempArch = GetSplitValueList(TempArch, '(', 1)[0]
-
- ArchList = re.split('\s+', TempArch)
- NewArchList = []
- for Arch in ArchList:
- if IsValidArch(Arch):
- NewArchList.append(Arch)
-
- ArchList = NewArchList
-
- return ArchList
-
-class InfDefinSectionParser(InfParserSectionRoot):
- def InfDefineParser(self, SectionString, InfSectionObject, FileName, SectionComment):
-
- if SectionComment:
- pass
- #
- # Parser Defines section content and fill self._ContentList dict.
- #
- StillCommentFalg = False
- HeaderComments = []
- SectionContent = ''
- ArchList = []
- _ContentList = []
- _ValueList = []
- #
- # Add WORKSPACE to global Marco dict.
- #
- self.FileLocalMacros['WORKSPACE'] = GlobalData.gWORKSPACE
-
- for Line in SectionString:
- LineContent = Line[0]
- LineNo = Line[1]
- TailComments = ''
- LineComment = None
-
- LineInfo = ['', -1, '']
- LineInfo[0] = FileName
- LineInfo[1] = LineNo
- LineInfo[2] = LineContent
-
- if LineContent.strip() == '':
- continue
- #
- # The first time encountered VALIDATE_ARCHITECHERS will be considered as support arch list.
- #
- if not ArchList:
- ArchList = GetValidateArchList(LineContent)
-
- #
- # Parser Comment
- #
- if LineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- #
- # Last line is comments, and this line go on.
- #
- if StillCommentFalg:
- HeaderComments.append(Line)
- SectionContent += LineContent + DT.END_OF_LINE
- continue
- #
- # First time encounter comment
- #
- else:
- #
- # Clear original data
- #
- HeaderComments = []
- HeaderComments.append(Line)
- StillCommentFalg = True
- SectionContent += LineContent + DT.END_OF_LINE
- continue
- else:
- StillCommentFalg = False
-
- if len(HeaderComments) >= 1:
- LineComment = InfLineCommentObject()
- LineCommentContent = ''
- for Item in HeaderComments:
- LineCommentContent += Item[0] + DT.END_OF_LINE
- LineComment.SetHeaderComments(LineCommentContent)
-
- #
- # Find Tail comment.
- #
- if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- TailComments = LineContent[LineContent.find(DT.TAB_COMMENT_SPLIT):]
- LineContent = LineContent[:LineContent.find(DT.TAB_COMMENT_SPLIT)]
- if LineComment == None:
- LineComment = InfLineCommentObject()
- LineComment.SetTailComments(TailComments)
-
- #
- # Find Macro
- #
- Name, Value = MacroParser((LineContent, LineNo),
- FileName,
- DT.MODEL_META_DATA_HEADER,
- self.FileLocalMacros)
- if Name != None:
- self.FileLocalMacros[Name] = Value
- continue
-
- #
- # Replace with [Defines] section Macro
- #
- LineContent = InfExpandMacro(LineContent,
- (FileName, LineContent, LineNo),
- self.FileLocalMacros,
- None, True)
-
- SectionContent += LineContent + DT.END_OF_LINE
-
- TokenList = GetSplitValueList(LineContent, DT.TAB_EQUAL_SPLIT, 1)
- if len(TokenList) < 2:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_NO_VALUE,
- LineInfo=LineInfo)
- _ValueList[0:len(TokenList)] = TokenList
- if not _ValueList[0]:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_NO_NAME,
- LineInfo=LineInfo)
- if not _ValueList[1]:
- ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_NO_VALUE,
- LineInfo=LineInfo)
-
- Name, Value = _ValueList[0], _ValueList[1]
-
- InfDefMemberObj = InfDefMember(Name, Value)
- if (LineComment != None):
- InfDefMemberObj.Comments.SetHeaderComments(LineComment.GetHeaderComments())
- InfDefMemberObj.Comments.SetTailComments(LineComment.GetTailComments())
-
- InfDefMemberObj.CurrentLine.SetFileName(self.FullPath)
- InfDefMemberObj.CurrentLine.SetLineString(LineContent)
- InfDefMemberObj.CurrentLine.SetLineNo(LineNo)
-
- _ContentList.append(InfDefMemberObj)
- HeaderComments = []
- TailComments = ''
-
- #
- # Current Define section archs
- #
- if not ArchList:
- ArchList = ['COMMON']
-
- InfSectionObject.SetAllContent(SectionContent)
-
- InfSectionObject.SetDefines(_ContentList, Arch=ArchList)
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py
deleted file mode 100644
index 5cafc80ca5..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py
+++ /dev/null
@@ -1,104 +0,0 @@
-## @file
-# This file contained the parser for [Depex] sections in INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-'''
-InfDepexSectionParser
-'''
-##
-# Import Modules
-#
-import re
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import FORMAT_INVALID
-from Parser.InfParserMisc import InfExpandMacro
-from Library import DataType as DT
-from Library.Misc import GetSplitValueList
-from Parser.InfParserMisc import InfParserSectionRoot
-
-class InfDepexSectionParser(InfParserSectionRoot):
- ## InfDepexParser
- #
- # For now, only separate Depex String and comments.
- # Have two types of section header.
- # 1. [Depex.Arch.ModuleType, ...]
- # 2. [Depex.Arch|FFE, ...]
- #
- def InfDepexParser(self, SectionString, InfSectionObject, FileName):
- DepexContent = []
- DepexComment = []
- ValueList = []
- #
- # Parse section content
- #
- for Line in SectionString:
- LineContent = Line[0]
- LineNo = Line[1]
-
- #
- # Found comment
- #
- if LineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- DepexComment.append((LineContent, LineNo))
- continue
- #
- # Replace with [Defines] section Macro
- #
- LineContent = InfExpandMacro(LineContent,
- (FileName, LineContent, Line[1]),
- self.FileLocalMacros,
- None, True)
-
- CommentCount = LineContent.find(DT.TAB_COMMENT_SPLIT)
-
- if CommentCount > -1:
- DepexComment.append((LineContent[CommentCount:], LineNo))
- LineContent = LineContent[:CommentCount-1]
-
-
- CommentCount = -1
- DepexContent.append((LineContent, LineNo))
-
- TokenList = GetSplitValueList(LineContent, DT.TAB_COMMENT_SPLIT)
- ValueList[0:len(TokenList)] = TokenList
-
- #
- # Current section archs
- #
- KeyList = []
- LastItem = ''
- for Item in self.LastSectionHeaderContent:
- LastItem = Item
- if (Item[1], Item[2], Item[3]) not in KeyList:
- KeyList.append((Item[1], Item[2], Item[3]))
-
- NewCommentList = []
- FormatCommentLn = -1
- ReFormatComment = re.compile(r"""#(?:\s*)\[(.*?)\](?:.*)""", re.DOTALL)
- for CommentItem in DepexComment:
- CommentContent = CommentItem[0]
- if ReFormatComment.match(CommentContent) != None:
- FormatCommentLn = CommentItem[1] + 1
- continue
-
- if CommentItem[1] != FormatCommentLn:
- NewCommentList.append(CommentContent)
- else:
- FormatCommentLn = CommentItem[1] + 1
-
- if not InfSectionObject.SetDepex(DepexContent, KeyList = KeyList, CommentList = NewCommentList):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR%("[Depex]"),
- File=FileName,
- Line=LastItem[3]) \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py
deleted file mode 100644
index 9c3d703ad1..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py
+++ /dev/null
@@ -1,382 +0,0 @@
-## @file
-# This file contained the parser for [Guids], [Ppis], [Protocols] sections in INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-'''
-InfGuidPpiProtocolSectionParser
-'''
-##
-# Import Modules
-#
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import FORMAT_INVALID
-from Parser.InfParserMisc import InfExpandMacro
-from Library import DataType as DT
-from Library import GlobalData
-from Library.Parsing import MacroParser
-from Library.Misc import GetSplitValueList
-from Library.ParserValidate import IsValidIdString
-from Library.ParserValidate import IsValidUserId
-from Library.ParserValidate import IsValidArch
-from Parser.InfParserMisc import InfParserSectionRoot
-
-class InfGuidPpiProtocolSectionParser(InfParserSectionRoot):
- ## InfGuidParser
- #
- #
- def InfGuidParser(self, SectionString, InfSectionObject, FileName):
- #
- # Macro defined in this section
- #
- SectionMacros = {}
- ValueList = []
- GuidList = []
- CommentsList = []
- CurrentLineVar = None
- #
- # Parse section content
- #
- for Line in SectionString:
- LineContent = Line[0]
- LineNo = Line[1]
-
- if LineContent.strip() == '':
- CommentsList = []
- continue
-
- if LineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- CommentsList.append(Line)
- continue
- else:
- #
- # Encounter a GUID entry
- #
- if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- CommentsList.append((
- LineContent[LineContent.find(DT.TAB_COMMENT_SPLIT):],
- LineNo))
- LineContent = \
- LineContent[:LineContent.find(DT.TAB_COMMENT_SPLIT)]
-
- if LineContent != '':
- #
- # Find Macro
- #
- Name, Value = MacroParser((LineContent, LineNo),
- FileName,
- DT.MODEL_EFI_GUID,
- self.FileLocalMacros)
- if Name != None:
- SectionMacros[Name] = Value
- CommentsList = []
- ValueList = []
- continue
-
- TokenList = GetSplitValueList(LineContent, DT.TAB_VALUE_SPLIT, 1)
- ValueList[0:len(TokenList)] = TokenList
-
- #
- # Replace with Local section Macro and [Defines] section Macro.
- #
- ValueList = [InfExpandMacro(Value, (FileName, LineContent, LineNo),
- self.FileLocalMacros, SectionMacros, True)
- for Value in ValueList]
-
- CurrentLineVar = (LineContent, LineNo, FileName)
-
-
- if len(ValueList) >= 1:
- GuidList.append((ValueList, CommentsList, CurrentLineVar))
- CommentsList = []
- ValueList = []
- continue
-
- #
- # Current section archs
- #
- ArchList = []
- LineIndex = -1
- for Item in self.LastSectionHeaderContent:
- LineIndex = Item[3]
- if Item[1] not in ArchList:
- ArchList.append(Item[1])
-
- if not InfSectionObject.SetGuid(GuidList, Arch=ArchList):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[Guid]"),
- File=FileName,
- Line=LineIndex)
-
- ## InfPpiParser
- #
- #
- def InfPpiParser(self, SectionString, InfSectionObject, FileName):
- #
- # Macro defined in this section
- #
- SectionMacros = {}
- ValueList = []
- PpiList = []
- CommentsList = []
- CurrentLineVar = None
- #
- # Parse section content
- #
- for Line in SectionString:
- LineContent = Line[0]
- LineNo = Line[1]
-
- if LineContent.strip() == '':
- CommentsList = []
- continue
-
- if LineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- CommentsList.append(Line)
- continue
- else:
- #
- # Encounter a PPI entry
- #
- if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- CommentsList.append((
- LineContent[LineContent.find(DT.TAB_COMMENT_SPLIT):],
- LineNo))
- LineContent = \
- LineContent[:LineContent.find(DT.TAB_COMMENT_SPLIT)]
-
- if LineContent != '':
- #
- # Find Macro
- #
- Name, Value = MacroParser((LineContent, LineNo),
- FileName,
- DT.MODEL_EFI_PPI,
- self.FileLocalMacros)
- if Name != None:
- SectionMacros[Name] = Value
- ValueList = []
- CommentsList = []
- continue
-
- TokenList = GetSplitValueList(LineContent, DT.TAB_VALUE_SPLIT, 1)
- ValueList[0:len(TokenList)] = TokenList
-
- #
- # Replace with Local section Macro and [Defines] section Macro.
- #
- ValueList = [InfExpandMacro(Value, (FileName, LineContent, LineNo), self.FileLocalMacros, SectionMacros)
- for Value in ValueList]
-
- CurrentLineVar = (LineContent, LineNo, FileName)
-
- if len(ValueList) >= 1:
- PpiList.append((ValueList, CommentsList, CurrentLineVar))
- ValueList = []
- CommentsList = []
- continue
-
- #
- # Current section archs
- #
- ArchList = []
- LineIndex = -1
- for Item in self.LastSectionHeaderContent:
- LineIndex = Item[3]
- if Item[1] not in ArchList:
- ArchList.append(Item[1])
-
- if not InfSectionObject.SetPpi(PpiList, Arch=ArchList):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[Ppis]"),
- File=FileName,
- Line=LineIndex)
-
- ## InfUserExtensionParser
- #
- #
- def InfUserExtensionParser(self, SectionString, InfSectionObject, FileName):
-
- UserExtensionContent = ''
-
- #
- # Parse section content
- #
- for Line in SectionString:
- LineContent = Line[0]
- LineNo = Line[1]
-
- if LineContent.strip() == '':
- continue
- #
- # Replace with [Defines] section Macro
- #
- LineContent = InfExpandMacro(LineContent,
- (FileName, LineContent, LineNo),
- self.FileLocalMacros,
- None)
-
- UserExtensionContent += LineContent + DT.END_OF_LINE
-
- continue
-
- #
- # Current section UserId, IdString
- #
- IdContentList = []
- LastItem = ''
- SectionLineNo = None
- for Item in self.LastSectionHeaderContent:
- UserId = Item[1]
- IdString = Item[2]
- Arch = Item[3]
- SectionLineNo = Item[4]
- if not IsValidArch(Arch):
- Logger.Error(
- 'InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Arch),
- File=GlobalData.gINF_MODULE_NAME,
- Line=SectionLineNo,
- ExtraData=None)
-
- if (UserId, IdString, Arch) not in IdContentList:
- #
- # To check the UserId and IdString valid or not.
- #
- if not IsValidUserId(UserId):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_UE_SECTION_USER_ID_ERROR % (Item[1]),
- File=GlobalData.gINF_MODULE_NAME,
- Line=SectionLineNo,
- ExtraData=None)
-
- if not IsValidIdString(IdString):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_UE_SECTION_ID_STRING_ERROR % (IdString),
- File=GlobalData.gINF_MODULE_NAME, Line=SectionLineNo,
- ExtraData=None)
- IdContentList.append((UserId, IdString, Arch))
- else:
- #
- # Each UserExtensions section header must have a unique set
- # of UserId, IdString and Arch values.
- # This means that the same UserId can be used in more than one
- # section header, provided the IdString or Arch values are
- # different. The same IdString values can be used in more than
- # one section header if the UserId or Arch values are
- # different. The same UserId and the same IdString can be used
- # in a section header if the Arch values are different in each
- # of the section headers.
- #
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR % (
- IdString),
- File=GlobalData.gINF_MODULE_NAME,
- Line=SectionLineNo,
- ExtraData=None)
- LastItem = Item
-
- if not InfSectionObject.SetUserExtension(UserExtensionContent,
- IdContent=IdContentList,
- LineNo=SectionLineNo):
- Logger.Error\
- ('InfParser', FORMAT_INVALID, \
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[UserExtension]"), \
- File=FileName, Line=LastItem[4])
-
- def InfProtocolParser(self, SectionString, InfSectionObject, FileName):
- #
- # Macro defined in this section
- #
- SectionMacros = {}
- ValueList = []
- ProtocolList = []
- CommentsList = []
- CurrentLineVar = None
- #
- # Parse section content
- #
- for Line in SectionString:
- LineContent = Line[0]
- LineNo = Line[1]
-
- if LineContent.strip() == '':
- CommentsList = []
- continue
-
- if LineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- CommentsList.append(Line)
- continue
- else:
- #
- # Encounter a Protocol entry
- #
- if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- CommentsList.append((
- LineContent[LineContent.find(DT.TAB_COMMENT_SPLIT):],
- LineNo))
- LineContent = \
- LineContent[:LineContent.find(DT.TAB_COMMENT_SPLIT)]
-
- if LineContent != '':
- #
- # Find Macro
- #
- Name, Value = MacroParser((LineContent, LineNo),
- FileName,
- DT.MODEL_EFI_PROTOCOL,
- self.FileLocalMacros)
- if Name != None:
- SectionMacros[Name] = Value
- ValueList = []
- CommentsList = []
- continue
-
- TokenList = GetSplitValueList(LineContent, DT.TAB_VALUE_SPLIT, 1)
- ValueList[0:len(TokenList)] = TokenList
-
- #
- # Replace with Local section Macro and [Defines] section Macro.
- #
- ValueList = [InfExpandMacro(Value, (FileName, LineContent, LineNo), self.FileLocalMacros, SectionMacros)
- for Value in ValueList]
-
- CurrentLineVar = (LineContent, LineNo, FileName)
-
- if len(ValueList) >= 1:
- ProtocolList.append((ValueList, CommentsList, CurrentLineVar))
- ValueList = []
- CommentsList = []
- continue
-
- #
- # Current section archs
- #
- ArchList = []
- LineIndex = -1
- for Item in self.LastSectionHeaderContent:
- LineIndex = Item[3]
- if Item[1] not in ArchList:
- ArchList.append(Item[1])
-
- if not InfSectionObject.SetProtocol(ProtocolList, Arch=ArchList):
- Logger.Error\
- ('InfParser', FORMAT_INVALID, \
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[Protocol]"), \
- File=FileName, Line=LineIndex)
diff --git a/BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py
deleted file mode 100644
index 4540fe2754..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py
+++ /dev/null
@@ -1,210 +0,0 @@
-## @file
-# This file contained the parser for [Libraries] sections in INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-'''
-InfLibrarySectionParser
-'''
-##
-# Import Modules
-#
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import FORMAT_INVALID
-from Parser.InfParserMisc import InfExpandMacro
-from Library import DataType as DT
-from Library.Parsing import MacroParser
-from Library.Misc import GetSplitValueList
-from Object.Parser.InfCommonObject import InfLineCommentObject
-from Library import GlobalData
-from Parser.InfParserMisc import IsLibInstanceInfo
-from Parser.InfAsBuiltProcess import GetLibInstanceInfo
-from Parser.InfParserMisc import InfParserSectionRoot
-
-class InfLibrarySectionParser(InfParserSectionRoot):
- ## InfLibraryParser
- #
- #
- def InfLibraryParser(self, SectionString, InfSectionObject, FileName):
- #
- # For Common INF file
- #
- if not GlobalData.gIS_BINARY_INF:
- #
- # Macro defined in this section
- #
- SectionMacros = {}
- ValueList = []
- LibraryList = []
- LibStillCommentFalg = False
- LibHeaderComments = []
- LibLineComment = None
- #
- # Parse section content
- #
- for Line in SectionString:
- LibLineContent = Line[0]
- LibLineNo = Line[1]
-
- if LibLineContent.strip() == '':
- continue
-
- #
- # Found Header Comments
- #
- if LibLineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- #
- # Last line is comments, and this line go on.
- #
- if LibStillCommentFalg:
- LibHeaderComments.append(Line)
- continue
- #
- # First time encounter comment
- #
- else:
- #
- # Clear original data
- #
- LibHeaderComments = []
- LibHeaderComments.append(Line)
- LibStillCommentFalg = True
- continue
- else:
- LibStillCommentFalg = False
-
- if len(LibHeaderComments) >= 1:
- LibLineComment = InfLineCommentObject()
- LineCommentContent = ''
- for Item in LibHeaderComments:
- LineCommentContent += Item[0] + DT.END_OF_LINE
- LibLineComment.SetHeaderComments(LineCommentContent)
-
- #
- # Find Tail comment.
- #
- if LibLineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- LibTailComments = LibLineContent[LibLineContent.find(DT.TAB_COMMENT_SPLIT):]
- LibLineContent = LibLineContent[:LibLineContent.find(DT.TAB_COMMENT_SPLIT)]
- if LibLineComment == None:
- LibLineComment = InfLineCommentObject()
- LibLineComment.SetTailComments(LibTailComments)
-
- #
- # Find Macro
- #
- Name, Value = MacroParser((LibLineContent, LibLineNo),
- FileName,
- DT.MODEL_EFI_LIBRARY_CLASS,
- self.FileLocalMacros)
- if Name != None:
- SectionMacros[Name] = Value
- LibLineComment = None
- LibHeaderComments = []
- continue
-
- TokenList = GetSplitValueList(LibLineContent, DT.TAB_VALUE_SPLIT, 1)
- ValueList[0:len(TokenList)] = TokenList
-
- #
- # Replace with Local section Macro and [Defines] section Macro.
- #
- ValueList = [InfExpandMacro(Value, (FileName, LibLineContent, LibLineNo),
- self.FileLocalMacros, SectionMacros, True)
- for Value in ValueList]
-
- LibraryList.append((ValueList, LibLineComment,
- (LibLineContent, LibLineNo, FileName)))
- ValueList = []
- LibLineComment = None
- LibTailComments = ''
- LibHeaderComments = []
-
- continue
-
- #
- # Current section archs
- #
- KeyList = []
- for Item in self.LastSectionHeaderContent:
- if (Item[1], Item[2]) not in KeyList:
- KeyList.append((Item[1], Item[2]))
-
- if not InfSectionObject.SetLibraryClasses(LibraryList, KeyList = KeyList):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[Library]"),
- File=FileName,
- Line=Item[3])
- #
- # For Binary INF
- #
- else:
- self.InfAsBuiltLibraryParser(SectionString, InfSectionObject, FileName)
-
- def InfAsBuiltLibraryParser(self, SectionString, InfSectionObject, FileName):
- LibraryList = []
- LibInsFlag = False
- for Line in SectionString:
- LineContent = Line[0]
- LineNo = Line[1]
-
- if LineContent.strip() == '':
- LibInsFlag = False
- continue
-
- if not LineContent.strip().startswith("#"):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_LIB_CONTATIN_ASBUILD_AND_COMMON,
- File=FileName,
- Line=LineNo,
- ExtraData=LineContent)
-
- if IsLibInstanceInfo(LineContent):
- LibInsFlag = True
- continue
-
- if LibInsFlag:
- LibGuid, LibVer = GetLibInstanceInfo(LineContent, GlobalData.gWORKSPACE, LineNo, FileName)
- #
- # If the VERSION_STRING is missing from the INF file, tool should default to "0".
- #
- if LibVer == '':
- LibVer = '0'
- if LibGuid != '':
- if (LibGuid, LibVer) not in LibraryList:
- LibraryList.append((LibGuid, LibVer))
- else:
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_LIB_INSTANCE_MISS_GUID,
- File=FileName,
- Line=LineNo,
- ExtraData=LineContent)
-
- #
- # Current section archs
- #
- KeyList = []
- Item = ['', '', '']
- for Item in self.LastSectionHeaderContent:
- if (Item[1], Item[2]) not in KeyList:
- KeyList.append((Item[1], Item[2]))
-
- if not InfSectionObject.SetLibraryClasses(LibraryList, KeyList = KeyList):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[Library]"),
- File=FileName,
- Line=Item[3]) \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py
deleted file mode 100644
index 67f1145322..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py
+++ /dev/null
@@ -1,140 +0,0 @@
-## @file
-# This file contained the parser for [Packages] sections in INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-'''
-InfPackageSectionParser
-'''
-##
-# Import Modules
-#
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import FORMAT_INVALID
-from Parser.InfParserMisc import InfExpandMacro
-from Library import DataType as DT
-from Library.Parsing import MacroParser
-from Library.Misc import GetSplitValueList
-from Object.Parser.InfCommonObject import InfLineCommentObject
-from Parser.InfParserMisc import InfParserSectionRoot
-
-class InfPackageSectionParser(InfParserSectionRoot):
- ## InfPackageParser
- #
- #
- def InfPackageParser(self, SectionString, InfSectionObject, FileName):
- #
- # Macro defined in this section
- #
- SectionMacros = {}
- ValueList = []
- PackageList = []
- StillCommentFalg = False
- HeaderComments = []
- LineComment = None
- #
- # Parse section content
- #
- for Line in SectionString:
- PkgLineContent = Line[0]
- PkgLineNo = Line[1]
-
- if PkgLineContent.strip() == '':
- continue
-
- #
- # Find Header Comments
- #
- if PkgLineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- #
- # Last line is comments, and this line go on.
- #
- if StillCommentFalg:
- HeaderComments.append(Line)
- continue
- #
- # First time encounter comment
- #
- else:
- #
- # Clear original data
- #
- HeaderComments = []
- HeaderComments.append(Line)
- StillCommentFalg = True
- continue
- else:
- StillCommentFalg = False
-
- if len(HeaderComments) >= 1:
- LineComment = InfLineCommentObject()
- LineCommentContent = ''
- for Item in HeaderComments:
- LineCommentContent += Item[0] + DT.END_OF_LINE
- LineComment.SetHeaderComments(LineCommentContent)
-
- #
- # Find Tail comment.
- #
- if PkgLineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- TailComments = PkgLineContent[PkgLineContent.find(DT.TAB_COMMENT_SPLIT):]
- PkgLineContent = PkgLineContent[:PkgLineContent.find(DT.TAB_COMMENT_SPLIT)]
- if LineComment == None:
- LineComment = InfLineCommentObject()
- LineComment.SetTailComments(TailComments)
- #
- # Find Macro
- #
- Name, Value = MacroParser((PkgLineContent, PkgLineNo),
- FileName,
- DT.MODEL_META_DATA_PACKAGE,
- self.FileLocalMacros)
- if Name != None:
- SectionMacros[Name] = Value
- LineComment = None
- HeaderComments = []
- continue
-
- TokenList = GetSplitValueList(PkgLineContent, DT.TAB_VALUE_SPLIT, 1)
- ValueList[0:len(TokenList)] = TokenList
-
- #
- # Replace with Local section Macro and [Defines] section Macro.
- #
- ValueList = [InfExpandMacro(Value, (FileName, PkgLineContent, PkgLineNo),
- self.FileLocalMacros, SectionMacros, True)
- for Value in ValueList]
-
- PackageList.append((ValueList, LineComment,
- (PkgLineContent, PkgLineNo, FileName)))
- ValueList = []
- LineComment = None
- TailComments = ''
- HeaderComments = []
- continue
-
- #
- # Current section archs
- #
- ArchList = []
- for Item in self.LastSectionHeaderContent:
- if Item[1] not in ArchList:
- ArchList.append(Item[1])
-
- if not InfSectionObject.SetPackages(PackageList, Arch = ArchList):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR\
- %("[Packages]"),
- File=FileName,
- Line=Item[3]) \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Parser/InfParser.py b/BaseTools/Source/Python/UPT/Parser/InfParser.py
deleted file mode 100644
index fb90c396f7..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfParser.py
+++ /dev/null
@@ -1,630 +0,0 @@
-## @file
-# This file contained the parser for INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-InfParser
-'''
-
-##
-# Import Modules
-#
-import re
-import os
-from copy import deepcopy
-
-from Library.String import GetSplitValueList
-from Library.String import ConvertSpecialChar
-from Library.Misc import ProcessLineExtender
-from Library.Misc import ProcessEdkComment
-from Library.Parsing import NormPath
-from Library.ParserValidate import IsValidInfMoudleTypeList
-from Library.ParserValidate import IsValidArch
-from Library import DataType as DT
-from Library import GlobalData
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import FORMAT_INVALID
-from Logger.ToolError import FILE_READ_FAILURE
-from Logger.ToolError import PARSER_ERROR
-
-from Object.Parser.InfCommonObject import InfSectionCommonDef
-from Parser.InfSectionParser import InfSectionParser
-from Parser.InfParserMisc import gINF_SECTION_DEF
-from Parser.InfParserMisc import IsBinaryInf
-
-## OpenInfFile
-#
-#
-def OpenInfFile(Filename):
- FileLinesList = []
-
- try:
- FInputfile = open(Filename, "rb", 0)
- try:
- FileLinesList = FInputfile.readlines()
- except BaseException:
- Logger.Error("InfParser",
- FILE_READ_FAILURE,
- ST.ERR_FILE_OPEN_FAILURE,
- File=Filename)
- finally:
- FInputfile.close()
- except BaseException:
- Logger.Error("InfParser",
- FILE_READ_FAILURE,
- ST.ERR_FILE_OPEN_FAILURE,
- File=Filename)
-
- return FileLinesList
-
-## InfParser
-#
-# This class defined the structure used in InfParser object
-#
-# @param InfObject: Inherited from InfSectionParser class
-# @param Filename: Input value for Filename of INF file, default is
-# None
-# @param WorkspaceDir: Input value for current workspace directory,
-# default is None
-#
-class InfParser(InfSectionParser):
-
- def __init__(self, Filename = None, WorkspaceDir = None):
-
- #
- # Call parent class construct function
- #
- super(InfParser, self).__init__()
-
- self.WorkspaceDir = WorkspaceDir
- self.SupArchList = DT.ARCH_LIST
- self.EventList = []
- self.HobList = []
- self.BootModeList = []
-
- #
- # Load Inf file if filename is not None
- #
- if Filename != None:
- self.ParseInfFile(Filename)
-
- ## Parse INF file
- #
- # Parse the file if it exists
- #
- # @param Filename: Input value for filename of INF file
- #
- def ParseInfFile(self, Filename):
-
- Filename = NormPath(Filename)
- (Path, Name) = os.path.split(Filename)
- self.FullPath = Filename
- self.RelaPath = Path
- self.FileName = Name
- GlobalData.gINF_MODULE_DIR = Path
- GlobalData.gINF_MODULE_NAME = self.FullPath
- GlobalData.gIS_BINARY_INF = False
- #
- # Initialize common data
- #
- LineNo = 0
- CurrentSection = DT.MODEL_UNKNOWN
- SectionLines = []
-
- #
- # Flags
- #
- HeaderCommentStart = False
- HeaderCommentEnd = False
-
- #
- # While Section ends. parse whole section contents.
- #
- NewSectionStartFlag = False
- FirstSectionStartFlag = False
-
- #
- # Parse file content
- #
- CommentBlock = []
-
- #
- # Variables for Event/Hob/BootMode
- #
- self.EventList = []
- self.HobList = []
- self.BootModeList = []
- SectionType = ''
-
- FileLinesList = OpenInfFile (Filename)
-
- #
- # One INF file can only has one [Defines] section.
- #
- DefineSectionParsedFlag = False
-
- #
- # Convert special characters in lines to space character.
- #
- FileLinesList = ConvertSpecialChar(FileLinesList)
-
- #
- # Process Line Extender
- #
- FileLinesList = ProcessLineExtender(FileLinesList)
-
- #
- # Process EdkI INF style comment if found
- #
- OrigLines = [Line for Line in FileLinesList]
- FileLinesList, EdkCommentStartPos = ProcessEdkComment(FileLinesList)
-
- #
- # Judge whether the INF file is Binary INF or not
- #
- if IsBinaryInf(FileLinesList):
- GlobalData.gIS_BINARY_INF = True
-
- InfSectionCommonDefObj = None
-
- for Line in FileLinesList:
- LineNo = LineNo + 1
- Line = Line.strip()
- if (LineNo < len(FileLinesList) - 1):
- NextLine = FileLinesList[LineNo].strip()
-
- #
- # blank line
- #
- if (Line == '' or not Line) and LineNo == len(FileLinesList):
- LastSectionFalg = True
-
- #
- # check whether file header comment section started
- #
- if Line.startswith(DT.TAB_SPECIAL_COMMENT) and \
- (Line.find(DT.TAB_HEADER_COMMENT) > -1) and \
- not HeaderCommentStart:
- if CurrentSection != DT.MODEL_UNKNOWN:
- Logger.Error("Parser",
- PARSER_ERROR,
- ST.ERR_INF_PARSER_HEADER_FILE,
- File=Filename,
- Line=LineNo,
- RaiseError = Logger.IS_RAISE_ERROR)
- else:
- CurrentSection = DT.MODEL_META_DATA_FILE_HEADER
- #
- # Append the first line to section lines.
- #
- SectionLines.append((Line, LineNo))
- HeaderCommentStart = True
- continue
-
- #
- # Collect Header content.
- #
- if (Line.startswith(DT.TAB_COMMENT_SPLIT) and CurrentSection == DT.MODEL_META_DATA_FILE_HEADER) and\
- HeaderCommentStart and not Line.startswith(DT.TAB_SPECIAL_COMMENT) and not\
- HeaderCommentEnd and NextLine != '':
- SectionLines.append((Line, LineNo))
- continue
- #
- # Header content end
- #
- if (Line.startswith(DT.TAB_SPECIAL_COMMENT) or not Line.strip().startswith("#")) and HeaderCommentStart \
- and not HeaderCommentEnd:
- SectionLines.append((Line, LineNo))
- HeaderCommentStart = False
- #
- # Call Header comment parser.
- #
- self.InfHeaderParser(SectionLines, self.InfHeader, self.FileName)
- SectionLines = []
- HeaderCommentEnd = True
- continue
-
- #
- # Find a new section tab
- # Or at the last line of INF file,
- # need to process the last section.
- #
- LastSectionFalg = False
- if LineNo == len(FileLinesList):
- LastSectionFalg = True
-
- if Line.startswith(DT.TAB_COMMENT_SPLIT) and not Line.startswith(DT.TAB_SPECIAL_COMMENT):
- SectionLines.append((Line, LineNo))
- if not LastSectionFalg:
- continue
-
- #
- # Encountered a section. start with '[' and end with ']'
- #
- if (Line.startswith(DT.TAB_SECTION_START) and \
- Line.find(DT.TAB_SECTION_END) > -1) or LastSectionFalg:
- if not LastSectionFalg:
- #
- # check to prevent '#' inside section header
- #
- HeaderContent = Line[1:Line.find(DT.TAB_SECTION_END)]
- if HeaderContent.find(DT.TAB_COMMENT_SPLIT) != -1:
- Logger.Error("InfParser",
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_SECTION_HEADER_INVALID,
- File=self.FullPath,
- Line=LineNo,
- ExtraData=Line)
-
- #
- # Keep last time section header content for section parser
- # usage.
- #
- self.LastSectionHeaderContent = deepcopy(self.SectionHeaderContent)
-
- #
- # TailComments in section define.
- #
- TailComments = ''
- CommentIndex = Line.find(DT.TAB_COMMENT_SPLIT)
- if CommentIndex > -1:
- TailComments = Line[CommentIndex:]
- Line = Line[:CommentIndex]
-
- InfSectionCommonDefObj = InfSectionCommonDef()
- if TailComments != '':
- InfSectionCommonDefObj.SetTailComments(TailComments)
- if CommentBlock != '':
- InfSectionCommonDefObj.SetHeaderComments(CommentBlock)
- CommentBlock = []
- #
- # Call section parser before section header parer to avoid encounter EDKI INF file
- #
- if CurrentSection == DT.MODEL_META_DATA_DEFINE:
- DefineSectionParsedFlag = self._CallSectionParsers(CurrentSection,
- DefineSectionParsedFlag, SectionLines,
- InfSectionCommonDefObj, LineNo)
- #
- # Compare the new section name with current
- #
- self.SectionHeaderParser(Line, self.FileName, LineNo)
-
- self._CheckSectionHeaders(Line, LineNo)
-
- SectionType = _ConvertSecNameToType(self.SectionHeaderContent[0][0])
-
- if not FirstSectionStartFlag:
- CurrentSection = SectionType
- FirstSectionStartFlag = True
- else:
- NewSectionStartFlag = True
- else:
- SectionLines.append((Line, LineNo))
- continue
-
- if LastSectionFalg:
- SectionLines, CurrentSection = self._ProcessLastSection(SectionLines, Line, LineNo, CurrentSection)
-
- #
- # End of section content collect.
- # Parser the section content collected previously.
- #
- if NewSectionStartFlag or LastSectionFalg:
- if CurrentSection != DT.MODEL_META_DATA_DEFINE or \
- (LastSectionFalg and CurrentSection == DT.MODEL_META_DATA_DEFINE):
- DefineSectionParsedFlag = self._CallSectionParsers(CurrentSection,
- DefineSectionParsedFlag, SectionLines,
- InfSectionCommonDefObj, LineNo)
-
- CurrentSection = SectionType
- #
- # Clear section lines
- #
- SectionLines = []
- #
- # End of for
- #
- #
- # Found the first section, No file header.
- #
- if DefineSectionParsedFlag and not HeaderCommentEnd:
- Logger.Error("InfParser",
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_HEADER_MISSGING,
- File=self.FullPath)
-
- #
- # EDKII INF should not have EDKI style comment
- #
- if EdkCommentStartPos != -1:
- Logger.Error("InfParser",
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_EDKI_COMMENT_IN_EDKII,
- File=self.FullPath,
- Line=EdkCommentStartPos + 1,
- ExtraData=OrigLines[EdkCommentStartPos])
-
- #
- # extract [Event] [Hob] [BootMode] sections
- #
- self._ExtractEventHobBootMod(FileLinesList)
-
- ## _CheckSectionHeaders
- #
- #
- def _CheckSectionHeaders(self, Line, LineNo):
- if len(self.SectionHeaderContent) == 0:
- Logger.Error("InfParser",
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_SECTION_HEADER_INVALID,
- File=self.FullPath,
- Line=LineNo, ExtraData=Line)
- else:
- for SectionItem in self.SectionHeaderContent:
- ArchList = []
- #
- # Not cover Depex/UserExtension section header
- # check.
- #
- if SectionItem[0].strip().upper() == DT.TAB_INF_FIXED_PCD.upper() or \
- SectionItem[0].strip().upper() == DT.TAB_INF_PATCH_PCD.upper() or \
- SectionItem[0].strip().upper() == DT.TAB_INF_PCD_EX.upper() or \
- SectionItem[0].strip().upper() == DT.TAB_INF_PCD.upper() or \
- SectionItem[0].strip().upper() == DT.TAB_INF_FEATURE_PCD.upper():
- ArchList = GetSplitValueList(SectionItem[1].strip(), ' ')
- else:
- ArchList = [SectionItem[1].strip()]
-
- for Arch in ArchList:
- if (not IsValidArch(Arch)) and \
- (SectionItem[0].strip().upper() != DT.TAB_DEPEX.upper()) and \
- (SectionItem[0].strip().upper() != DT.TAB_USER_EXTENSIONS.upper()) and \
- (SectionItem[0].strip().upper() != DT.TAB_COMMON_DEFINES.upper()):
- Logger.Error("InfParser",
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(SectionItem[1]),
- File=self.FullPath,
- Line=LineNo, ExtraData=Line)
- #
- # Check if the ModuleType is valid
- #
- ChkModSectionList = ['LIBRARYCLASSES']
- if (self.SectionHeaderContent[0][0].upper() in ChkModSectionList):
- if SectionItem[2].strip().upper():
- MoudleTypeList = GetSplitValueList(
- SectionItem[2].strip().upper())
- if (not IsValidInfMoudleTypeList(MoudleTypeList)):
- Logger.Error("InfParser",
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(SectionItem[2]),
- File=self.FullPath, Line=LineNo,
- ExtraData=Line)
-
- ## _CallSectionParsers
- #
- #
- def _CallSectionParsers(self, CurrentSection, DefineSectionParsedFlag,
- SectionLines, InfSectionCommonDefObj, LineNo):
- if CurrentSection == DT.MODEL_META_DATA_DEFINE:
- if not DefineSectionParsedFlag:
- self.InfDefineParser(SectionLines,
- self.InfDefSection,
- self.FullPath,
- InfSectionCommonDefObj)
- DefineSectionParsedFlag = True
- else:
- Logger.Error("Parser",
- PARSER_ERROR,
- ST.ERR_INF_PARSER_MULTI_DEFINE_SECTION,
- File=self.FullPath,
- RaiseError = Logger.IS_RAISE_ERROR)
-
- elif CurrentSection == DT.MODEL_META_DATA_BUILD_OPTION:
- self.InfBuildOptionParser(SectionLines,
- self.InfBuildOptionSection,
- self.FullPath)
-
- elif CurrentSection == DT.MODEL_EFI_LIBRARY_CLASS:
- self.InfLibraryParser(SectionLines,
- self.InfLibraryClassSection,
- self.FullPath)
-
- elif CurrentSection == DT.MODEL_META_DATA_PACKAGE:
- self.InfPackageParser(SectionLines,
- self.InfPackageSection,
- self.FullPath)
- #
- # [Pcd] Sections, put it together
- #
- elif CurrentSection == DT.MODEL_PCD_FIXED_AT_BUILD or \
- CurrentSection == DT.MODEL_PCD_PATCHABLE_IN_MODULE or \
- CurrentSection == DT.MODEL_PCD_FEATURE_FLAG or \
- CurrentSection == DT.MODEL_PCD_DYNAMIC_EX or \
- CurrentSection == DT.MODEL_PCD_DYNAMIC:
- self.InfPcdParser(SectionLines,
- self.InfPcdSection,
- self.FullPath)
-
- elif CurrentSection == DT.MODEL_EFI_SOURCE_FILE:
- self.InfSourceParser(SectionLines,
- self.InfSourcesSection,
- self.FullPath)
-
- elif CurrentSection == DT.MODEL_META_DATA_USER_EXTENSION:
- self.InfUserExtensionParser(SectionLines,
- self.InfUserExtensionSection,
- self.FullPath)
-
- elif CurrentSection == DT.MODEL_EFI_PROTOCOL:
- self.InfProtocolParser(SectionLines,
- self.InfProtocolSection,
- self.FullPath)
-
- elif CurrentSection == DT.MODEL_EFI_PPI:
- self.InfPpiParser(SectionLines,
- self.InfPpiSection,
- self.FullPath)
-
- elif CurrentSection == DT.MODEL_EFI_GUID:
- self.InfGuidParser(SectionLines,
- self.InfGuidSection,
- self.FullPath)
-
- elif CurrentSection == DT.MODEL_EFI_DEPEX:
- self.InfDepexParser(SectionLines,
- self.InfDepexSection,
- self.FullPath)
-
- elif CurrentSection == DT.MODEL_EFI_BINARY_FILE:
- self.InfBinaryParser(SectionLines,
- self.InfBinariesSection,
- self.FullPath)
- #
- # Unknown section type found, raise error.
- #
- else:
- if len(self.SectionHeaderContent) >= 1:
- Logger.Error("Parser",
- PARSER_ERROR,
- ST.ERR_INF_PARSER_UNKNOWN_SECTION,
- File=self.FullPath, Line=LineNo,
- RaiseError = Logger.IS_RAISE_ERROR)
- else:
- Logger.Error("Parser",
- PARSER_ERROR,
- ST.ERR_INF_PARSER_NO_SECTION_ERROR,
- File=self.FullPath, Line=LineNo,
- RaiseError = Logger.IS_RAISE_ERROR)
-
- return DefineSectionParsedFlag
-
- def _ExtractEventHobBootMod(self, FileLinesList):
- SpecialSectionStart = False
- CheckLocation = False
- GFindSpecialCommentRe = \
- re.compile(r"""#(?:\s*)\[(.*?)\](?:.*)""", re.DOTALL)
- GFindNewSectionRe2 = \
- re.compile(r"""#?(\s*)\[(.*?)\](.*)""", re.DOTALL)
- LineNum = 0
- Element = []
- for Line in FileLinesList:
- Line = Line.strip()
- LineNum += 1
- MatchObject = GFindSpecialCommentRe.search(Line)
- if MatchObject:
- SpecialSectionStart = True
- Element = []
- if MatchObject.group(1).upper().startswith("EVENT"):
- List = self.EventList
- elif MatchObject.group(1).upper().startswith("HOB"):
- List = self.HobList
- elif MatchObject.group(1).upper().startswith("BOOTMODE"):
- List = self.BootModeList
- else:
- SpecialSectionStart = False
- CheckLocation = False
- if SpecialSectionStart:
- Element.append([Line, LineNum])
- List.append(Element)
- else:
- #
- # if currently in special section, try to detect end of current section
- #
- MatchObject = GFindNewSectionRe2.search(Line)
- if SpecialSectionStart:
- if MatchObject:
- SpecialSectionStart = False
- CheckLocation = False
- Element = []
- elif not Line:
- SpecialSectionStart = False
- CheckLocation = True
- Element = []
- else:
- if not Line.startswith(DT.TAB_COMMENT_SPLIT):
- Logger.Warn("Parser",
- ST.WARN_SPECIAL_SECTION_LOCATION_WRONG,
- File=self.FullPath, Line=LineNum)
- SpecialSectionStart = False
- CheckLocation = False
- Element = []
- else:
- Element.append([Line, LineNum])
- else:
- if CheckLocation:
- if MatchObject:
- CheckLocation = False
- elif Line:
- Logger.Warn("Parser",
- ST.WARN_SPECIAL_SECTION_LOCATION_WRONG,
- File=self.FullPath, Line=LineNum)
- CheckLocation = False
-
- if len(self.BootModeList) >= 1:
- self.InfSpecialCommentParser(self.BootModeList,
- self.InfSpecialCommentSection,
- self.FileName,
- DT.TYPE_BOOTMODE_SECTION)
-
- if len(self.EventList) >= 1:
- self.InfSpecialCommentParser(self.EventList,
- self.InfSpecialCommentSection,
- self.FileName,
- DT.TYPE_EVENT_SECTION)
-
- if len(self.HobList) >= 1:
- self.InfSpecialCommentParser(self.HobList,
- self.InfSpecialCommentSection,
- self.FileName,
- DT.TYPE_HOB_SECTION)
- ## _ProcessLastSection
- #
- #
- def _ProcessLastSection(self, SectionLines, Line, LineNo, CurrentSection):
- #
- # The last line is a section header. will discard it.
- #
- if not (Line.startswith(DT.TAB_SECTION_START) and Line.find(DT.TAB_SECTION_END) > -1):
- SectionLines.append((Line, LineNo))
-
- if len(self.SectionHeaderContent) >= 1:
- TemSectionName = self.SectionHeaderContent[0][0].upper()
- if TemSectionName.upper() not in gINF_SECTION_DEF.keys():
- Logger.Error("InfParser",
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_UNKNOWN_SECTION,
- File=self.FullPath,
- Line=LineNo,
- ExtraData=Line,
- RaiseError = Logger.IS_RAISE_ERROR
- )
- else:
- CurrentSection = gINF_SECTION_DEF[TemSectionName]
- self.LastSectionHeaderContent = self.SectionHeaderContent
-
- return SectionLines, CurrentSection
-
-## _ConvertSecNameToType
-#
-#
-def _ConvertSecNameToType(SectionName):
- SectionType = ''
- if SectionName.upper() not in gINF_SECTION_DEF.keys():
- SectionType = DT.MODEL_UNKNOWN
- else:
- SectionType = gINF_SECTION_DEF[SectionName.upper()]
-
- return SectionType
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py b/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py
deleted file mode 100644
index 7058e69da1..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py
+++ /dev/null
@@ -1,218 +0,0 @@
-## @file
-# This file contained the miscellaneous functions for INF parser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-InfParserMisc
-'''
-
-##
-# Import Modules
-#
-import re
-
-
-from Library import DataType as DT
-
-
-from Library.String import gMACRO_PATTERN
-from Library.String import ReplaceMacro
-from Object.Parser.InfMisc import ErrorInInf
-from Logger.StringTable import ERR_MARCO_DEFINITION_MISS_ERROR
-
-#
-# Global variable
-#
-
-#
-# Sections can exist in INF file
-#
-gINF_SECTION_DEF = {
- DT.TAB_UNKNOWN.upper() : DT.MODEL_UNKNOWN,
- DT.TAB_HEADER.upper() : DT.MODEL_META_DATA_FILE_HEADER,
- DT.TAB_INF_DEFINES.upper() : DT.MODEL_META_DATA_DEFINE,
- DT.TAB_BUILD_OPTIONS.upper() : DT.MODEL_META_DATA_BUILD_OPTION,
- DT.TAB_LIBRARY_CLASSES.upper() : DT.MODEL_EFI_LIBRARY_CLASS,
- DT.TAB_PACKAGES.upper() : DT.MODEL_META_DATA_PACKAGE,
- DT.TAB_INF_FIXED_PCD.upper() : DT.MODEL_PCD_FIXED_AT_BUILD,
- DT.TAB_INF_PATCH_PCD.upper() : DT.MODEL_PCD_PATCHABLE_IN_MODULE,
- DT.TAB_INF_FEATURE_PCD.upper() : DT.MODEL_PCD_FEATURE_FLAG,
- DT.TAB_INF_PCD_EX.upper() : DT.MODEL_PCD_DYNAMIC_EX,
- DT.TAB_INF_PCD.upper() : DT.MODEL_PCD_DYNAMIC,
- DT.TAB_SOURCES.upper() : DT.MODEL_EFI_SOURCE_FILE,
- DT.TAB_GUIDS.upper() : DT.MODEL_EFI_GUID,
- DT.TAB_PROTOCOLS.upper() : DT.MODEL_EFI_PROTOCOL,
- DT.TAB_PPIS.upper() : DT.MODEL_EFI_PPI,
- DT.TAB_DEPEX.upper() : DT.MODEL_EFI_DEPEX,
- DT.TAB_BINARIES.upper() : DT.MODEL_EFI_BINARY_FILE,
- DT.TAB_USER_EXTENSIONS.upper() : DT.MODEL_META_DATA_USER_EXTENSION
- #
- # EDK1 section
- # TAB_NMAKE.upper() : MODEL_META_DATA_NMAKE
- #
- }
-
-## InfExpandMacro
-#
-# Expand MACRO definition with MACROs defined in [Defines] section and specific section.
-# The MACROs defined in specific section has high priority and will be expanded firstly.
-#
-# @param LineInfo Contain information of FileName, LineContent, LineNo
-# @param GlobalMacros MACROs defined in INF [Defines] section
-# @param SectionMacros MACROs defined in INF specific section
-# @param Flag If the flag set to True, need to skip macros in a quoted string
-#
-def InfExpandMacro(Content, LineInfo, GlobalMacros=None, SectionMacros=None, Flag=False):
- if GlobalMacros == None:
- GlobalMacros = {}
- if SectionMacros == None:
- SectionMacros = {}
-
- FileName = LineInfo[0]
- LineContent = LineInfo[1]
- LineNo = LineInfo[2]
-
- NewLineInfo = (FileName, LineNo, LineContent)
-
- #
- # First, replace MARCOs with value defined in specific section
- #
- Content = ReplaceMacro (Content,
- SectionMacros,
- False,
- (LineContent, LineNo),
- FileName,
- Flag)
- #
- # Then replace MARCOs with value defined in [Defines] section
- #
- Content = ReplaceMacro (Content,
- GlobalMacros,
- False,
- (LineContent, LineNo),
- FileName,
- Flag)
-
- MacroUsed = gMACRO_PATTERN.findall(Content)
- #
- # no macro found in String, stop replacing
- #
- if len(MacroUsed) == 0:
- return Content
- else:
- for Macro in MacroUsed:
- gQuotedMacro = re.compile(".*\".*\$\(%s\).*\".*"%(Macro))
- if not gQuotedMacro.match(Content):
- #
- # Still have MACROs can't be expanded.
- #
- ErrorInInf (ERR_MARCO_DEFINITION_MISS_ERROR,
- LineInfo=NewLineInfo)
-
- return Content
-
-
-## IsBinaryInf
-#
-# Judge whether the INF file is Binary INF or Common INF
-#
-# @param FileLineList A list contain all INF file content.
-#
-def IsBinaryInf(FileLineList):
- if not FileLineList:
- return False
-
- ReIsSourcesSection = re.compile("^\s*\[Sources.*\]\s.*$", re.IGNORECASE)
- ReIsBinarySection = re.compile("^\s*\[Binaries.*\]\s.*$", re.IGNORECASE)
- BinarySectionFoundFlag = False
-
- for Line in FileLineList:
- if ReIsSourcesSection.match(Line):
- return False
- if ReIsBinarySection.match(Line):
- BinarySectionFoundFlag = True
-
- if BinarySectionFoundFlag:
- return True
-
- return False
-
-
-## IsLibInstanceInfo
-#
-# Judge whether the string contain the information of ## @LIB_INSTANCES.
-#
-# @param String
-#
-# @return Flag
-#
-def IsLibInstanceInfo(String):
- ReIsLibInstance = re.compile("^\s*##\s*@LIB_INSTANCES\s*$")
- if ReIsLibInstance.match(String):
- return True
- else:
- return False
-
-
-## IsAsBuildOptionInfo
-#
-# Judge whether the string contain the information of ## @ASBUILD.
-#
-# @param String
-#
-# @return Flag
-#
-def IsAsBuildOptionInfo(String):
- ReIsAsBuildInstance = re.compile("^\s*##\s*@AsBuilt\s*$")
- if ReIsAsBuildInstance.match(String):
- return True
- else:
- return False
-
-
-class InfParserSectionRoot(object):
- def __init__(self):
- #
- # Macros defined in [Define] section are file scope global
- #
- self.FileLocalMacros = {}
-
- #
- # Current Section Header content.
- #
- self.SectionHeaderContent = []
-
- #
- # Last time Section Header content.
- #
- self.LastSectionHeaderContent = []
-
- self.FullPath = ''
-
- self.InfDefSection = None
- self.InfBuildOptionSection = None
- self.InfLibraryClassSection = None
- self.InfPackageSection = None
- self.InfPcdSection = None
- self.InfSourcesSection = None
- self.InfUserExtensionSection = None
- self.InfProtocolSection = None
- self.InfPpiSection = None
- self.InfGuidSection = None
- self.InfDepexSection = None
- self.InfPeiDepexSection = None
- self.InfDxeDepexSection = None
- self.InfSmmDepexSection = None
- self.InfBinariesSection = None
- self.InfHeader = None
- self.InfSpecialCommentSection = None
diff --git a/BaseTools/Source/Python/UPT/Parser/InfPcdSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfPcdSectionParser.py
deleted file mode 100644
index 1011559450..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfPcdSectionParser.py
+++ /dev/null
@@ -1,184 +0,0 @@
-## @file
-# This file contained the parser for [Pcds] sections in INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-'''
-InfPcdSectionParser
-'''
-##
-# Import Modules
-#
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import FORMAT_INVALID
-from Parser.InfParserMisc import InfExpandMacro
-from Library import DataType as DT
-from Library.Parsing import MacroParser
-from Library.Misc import GetSplitValueList
-from Library import GlobalData
-from Library.String import SplitPcdEntry
-from Parser.InfParserMisc import InfParserSectionRoot
-
-class InfPcdSectionParser(InfParserSectionRoot):
- ## Section PCD related parser
- #
- # For 5 types of PCD list below, all use this function.
- # 'FixedPcd', 'FeaturePcd', 'PatchPcd', 'Pcd', 'PcdEx'
- #
- # This is a INF independent parser, the validation in this parser only
- # cover
- # INF spec scope, will not cross DEC/DSC to check pcd value
- #
- def InfPcdParser(self, SectionString, InfSectionObject, FileName):
- KeysList = []
- PcdList = []
- CommentsList = []
- ValueList = []
- #
- # Current section archs
- #
- LineIndex = -1
- for Item in self.LastSectionHeaderContent:
- if (Item[0], Item[1], Item[3]) not in KeysList:
- KeysList.append((Item[0], Item[1], Item[3]))
- LineIndex = Item[3]
-
- if (Item[0].upper() == DT.TAB_INF_FIXED_PCD.upper() or \
- Item[0].upper() == DT.TAB_INF_FEATURE_PCD.upper() or \
- Item[0].upper() == DT.TAB_INF_PCD.upper()) and GlobalData.gIS_BINARY_INF:
- Logger.Error('InfParser', FORMAT_INVALID, ST.ERR_ASBUILD_PCD_SECTION_TYPE%("\"" + Item[0] + "\""),
- File=FileName, Line=LineIndex)
-
- #
- # For Common INF file
- #
- if not GlobalData.gIS_BINARY_INF:
- #
- # Macro defined in this section
- #
- SectionMacros = {}
- for Line in SectionString:
- PcdLineContent = Line[0]
- PcdLineNo = Line[1]
- if PcdLineContent.strip() == '':
- CommentsList = []
- continue
-
- if PcdLineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- CommentsList.append(Line)
- continue
- else:
- #
- # Encounter a PCD entry
- #
- if PcdLineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- CommentsList.append((
- PcdLineContent[PcdLineContent.find(DT.TAB_COMMENT_SPLIT):],
- PcdLineNo))
- PcdLineContent = PcdLineContent[:PcdLineContent.find(DT.TAB_COMMENT_SPLIT)]
-
- if PcdLineContent != '':
- #
- # Find Macro
- #
- Name, Value = MacroParser((PcdLineContent, PcdLineNo),
- FileName,
- DT.MODEL_EFI_PCD,
- self.FileLocalMacros)
- if Name != None:
- SectionMacros[Name] = Value
- ValueList = []
- CommentsList = []
- continue
-
- PcdEntryReturn = SplitPcdEntry(PcdLineContent)
-
- if not PcdEntryReturn[1]:
- TokenList = ['']
- else:
- TokenList = PcdEntryReturn[0]
-
- ValueList[0:len(TokenList)] = TokenList
-
- #
- # Replace with Local section Macro and [Defines] section Macro.
- #
- ValueList = [InfExpandMacro(Value, (FileName, PcdLineContent, PcdLineNo),
- self.FileLocalMacros, SectionMacros, True)
- for Value in ValueList]
-
- if len(ValueList) >= 1:
- PcdList.append((ValueList, CommentsList, (PcdLineContent, PcdLineNo, FileName)))
- ValueList = []
- CommentsList = []
- continue
- #
- # For Binary INF file
- #
- else:
- for Line in SectionString:
- LineContent = Line[0].strip()
- LineNo = Line[1]
-
- if LineContent == '':
- CommentsList = []
- continue
-
- if LineContent.startswith(DT.TAB_COMMENT_SPLIT):
- CommentsList.append(LineContent)
- continue
- #
- # Have comments at tail.
- #
- CommentIndex = LineContent.find(DT.TAB_COMMENT_SPLIT)
- if CommentIndex > -1:
- CommentsList.append(LineContent[CommentIndex+1:])
- LineContent = LineContent[:CommentIndex]
-
- TokenList = GetSplitValueList(LineContent, DT.TAB_VALUE_SPLIT)
- #
- # PatchablePcd
- # TokenSpace.CName | Value | Offset
- #
- if KeysList[0][0].upper() == DT.TAB_INF_PATCH_PCD.upper():
- if len(TokenList) != 3:
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_ASBUILD_PATCHPCD_FORMAT_INVALID,
- File=FileName,
- Line=LineNo,
- ExtraData=LineContent)
- #
- elif KeysList[0][0].upper() == DT.TAB_INF_PCD_EX.upper():
- if len(TokenList) != 2:
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_ASBUILD_PCDEX_FORMAT_INVALID,
- File=FileName,
- Line=LineNo,
- ExtraData=LineContent)
- ValueList[0:len(TokenList)] = TokenList
- if len(ValueList) >= 1:
- PcdList.append((ValueList, CommentsList, (LineContent, LineNo, FileName)))
- ValueList = []
- CommentsList = []
- continue
-
- if not InfSectionObject.SetPcds(PcdList, KeysList = KeysList,
- PackageInfo = self.InfPackageSection.GetPackages()):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR%("[PCD]"),
- File=FileName,
- Line=LineIndex)
- \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py
deleted file mode 100644
index 879f924c45..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py
+++ /dev/null
@@ -1,490 +0,0 @@
-## @file
-# This file contained the parser for sections in INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-InfSectionParser
-'''
-##
-# Import Modules
-#
-from copy import deepcopy
-import re
-
-from Library.String import GetSplitValueList
-from Library.CommentParsing import ParseHeaderCommentSection
-from Library.CommentParsing import ParseComment
-
-from Library import DataType as DT
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import FORMAT_INVALID
-
-from Object.Parser.InfDefineObject import InfDefObject
-from Object.Parser.InfBuildOptionObject import InfBuildOptionsObject
-from Object.Parser.InfLibraryClassesObject import InfLibraryClassObject
-from Object.Parser.InfPackagesObject import InfPackageObject
-from Object.Parser.InfPcdObject import InfPcdObject
-from Object.Parser.InfSoucesObject import InfSourcesObject
-from Object.Parser.InfUserExtensionObject import InfUserExtensionObject
-from Object.Parser.InfProtocolObject import InfProtocolObject
-from Object.Parser.InfPpiObject import InfPpiObject
-from Object.Parser.InfGuidObject import InfGuidObject
-from Object.Parser.InfDepexObject import InfDepexObject
-from Object.Parser.InfBinaryObject import InfBinariesObject
-from Object.Parser.InfHeaderObject import InfHeaderObject
-from Object.Parser.InfMisc import InfSpecialCommentObject
-from Object.Parser.InfMisc import InfHobObject
-from Object.Parser.InfMisc import InfBootModeObject
-from Object.Parser.InfMisc import InfEventObject
-from Parser.InfParserMisc import gINF_SECTION_DEF
-from Parser.InfDefineSectionParser import InfDefinSectionParser
-from Parser.InfBuildOptionSectionParser import InfBuildOptionSectionParser
-from Parser.InfSourceSectionParser import InfSourceSectionParser
-from Parser.InfLibrarySectionParser import InfLibrarySectionParser
-from Parser.InfPackageSectionParser import InfPackageSectionParser
-from Parser.InfGuidPpiProtocolSectionParser import InfGuidPpiProtocolSectionParser
-from Parser.InfBinarySectionParser import InfBinarySectionParser
-from Parser.InfPcdSectionParser import InfPcdSectionParser
-from Parser.InfDepexSectionParser import InfDepexSectionParser
-
-## GetSpecialStr2
-#
-# GetSpecialStr2
-#
-def GetSpecialStr2(ItemList, FileName, LineNo, SectionString):
- Str2 = ''
- #
- # S2 may be Platform or ModuleType
- #
- if len(ItemList) == 3:
- #
- # Except [LibraryClass], [Depex]
- # section can has more than 2 items in section header string,
- # others should report error.
- #
- if not (ItemList[0].upper() == DT.TAB_LIBRARY_CLASSES.upper() or \
- ItemList[0].upper() == DT.TAB_DEPEX.upper() or \
- ItemList[0].upper() == DT.TAB_USER_EXTENSIONS.upper()):
- if ItemList[2] != '':
- Logger.Error('Parser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_SOURCE_SECTION_SECTIONNAME_INVALID % (SectionString),
- File=FileName,
- Line=LineNo,
- ExtraData=SectionString)
- Str2 = ItemList[2]
- elif len(ItemList) == 4:
- #
- # Except [UserExtension]
- # section can has 4 items in section header string,
- # others should report error.
- #
- if not ItemList[0].upper() == DT.TAB_USER_EXTENSIONS.upper() or ItemList[0].upper() == DT.TAB_DEPEX.upper():
- if ItemList[3] != '':
- Logger.Error('Parser', FORMAT_INVALID, ST.ERR_INF_PARSER_SOURCE_SECTION_SECTIONNAME_INVALID \
- % (SectionString), File=FileName, Line=LineNo, ExtraData=SectionString)
-
- if not ItemList[0].upper() == DT.TAB_USER_EXTENSIONS.upper():
- Str2 = ItemList[2] + ' | ' + ItemList[3]
- else:
- Str2 = ItemList[2]
-
- elif len(ItemList) > 4:
- Logger.Error('Parser', FORMAT_INVALID, ST.ERR_INF_PARSER_SOURCE_SECTION_SECTIONNAME_INVALID \
- % (SectionString), File=FileName, Line=LineNo, ExtraData=SectionString)
-
- return Str2
-
-## ProcessUseExtHeader
-#
-#
-def ProcessUseExtHeader(ItemList):
- NewItemList = []
- AppendContent = ''
- CompleteFlag = False
- for Item in ItemList:
- if Item.startswith('\"') and not Item.endswith('\"'):
- AppendContent = Item
- CompleteFlag = True
- elif Item.endswith('\"') and not Item.startswith('\"'):
- #
- # Should not have an userId or IdString not starts with " before but ends with ".
- #
- if not CompleteFlag:
- return False, []
- AppendContent = AppendContent + "." + Item
- NewItemList.append(AppendContent)
- CompleteFlag = False
- AppendContent = ''
- elif Item.endswith('\"') and Item.startswith('\"'):
- #
- # Common item, not need to combine the information
- #
- NewItemList.append(Item)
- else:
- if not CompleteFlag:
- NewItemList.append(Item)
- else:
- AppendContent = AppendContent + "." + Item
-
- if len(NewItemList) > 4:
- return False, []
-
- return True, NewItemList
-
-## GetArch
-#
-# GetArch
-#
-def GetArch(ItemList, ArchList, FileName, LineNo, SectionString):
- #
- # S1 is always Arch
- #
- if len(ItemList) > 1:
- Arch = ItemList[1]
- else:
- Arch = 'COMMON'
- ArchList.add(Arch)
-
- #
- # 'COMMON' must not be used with specific ARCHs at the same section
- #
- if 'COMMON' in ArchList and len(ArchList) > 1:
- Logger.Error('Parser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_SECTION_ARCH_CONFLICT,
- File=FileName,
- Line=LineNo,
- ExtraData=SectionString)
-
- return Arch, ArchList
-
-## InfSectionParser
-#
-# Inherit from object
-#
-class InfSectionParser(InfDefinSectionParser,
- InfBuildOptionSectionParser,
- InfSourceSectionParser,
- InfLibrarySectionParser,
- InfPackageSectionParser,
- InfGuidPpiProtocolSectionParser,
- InfBinarySectionParser,
- InfPcdSectionParser,
- InfDepexSectionParser):
- #
- # Parser objects used to implement singleton
- #
- MetaFiles = {}
-
- ## Factory method
- #
- # One file, one parser object. This factory method makes sure that there's
- # only one object constructed for one meta file.
- #
- # @param Class class object of real AutoGen class
- # (InfParser, DecParser or DscParser)
- # @param FilePath The path of meta file
- #
- def __new__(cls, FilePath, *args, **kwargs):
- if args:
- pass
- if kwargs:
- pass
- if FilePath in cls.MetaFiles:
- return cls.MetaFiles[FilePath]
- else:
- ParserObject = super(InfSectionParser, cls).__new__(cls)
- cls.MetaFiles[FilePath] = ParserObject
- return ParserObject
-
- def __init__(self):
- InfDefinSectionParser.__init__(self)
- InfBuildOptionSectionParser.__init__(self)
- InfSourceSectionParser.__init__(self)
- InfLibrarySectionParser.__init__(self)
- InfPackageSectionParser.__init__(self)
- InfGuidPpiProtocolSectionParser.__init__(self)
- InfBinarySectionParser.__init__(self)
- InfPcdSectionParser.__init__(self)
- InfDepexSectionParser.__init__(self)
- #
- # Initialize all objects that an INF file will generated.
- #
- self.InfDefSection = InfDefObject()
- self.InfBuildOptionSection = InfBuildOptionsObject()
- self.InfLibraryClassSection = InfLibraryClassObject()
- self.InfPackageSection = InfPackageObject()
- self.InfPcdSection = InfPcdObject(self.MetaFiles.keys()[0])
- self.InfSourcesSection = InfSourcesObject()
- self.InfUserExtensionSection = InfUserExtensionObject()
- self.InfProtocolSection = InfProtocolObject()
- self.InfPpiSection = InfPpiObject()
- self.InfGuidSection = InfGuidObject()
- self.InfDepexSection = InfDepexObject()
- self.InfPeiDepexSection = InfDepexObject()
- self.InfDxeDepexSection = InfDepexObject()
- self.InfSmmDepexSection = InfDepexObject()
- self.InfBinariesSection = InfBinariesObject()
- self.InfHeader = InfHeaderObject()
- self.InfSpecialCommentSection = InfSpecialCommentObject()
-
- #
- # A List for store define section content.
- #
- self._PcdNameList = []
- self._SectionName = ''
- self._SectionType = 0
- self.RelaPath = ''
- self.FileName = ''
-
- #
- # File Header content parser
- #
- def InfHeaderParser(self, Content, InfHeaderObject2, FileName):
- (Abstract, Description, Copyright, License) = ParseHeaderCommentSection(Content, FileName)
- #
- # Not process file name now, for later usage.
- #
- if self.FileName:
- pass
-
- #
- # Insert Abstract, Description, CopyRight, License into header object
- #
- InfHeaderObject2.SetAbstract(Abstract)
- InfHeaderObject2.SetDescription(Description)
- InfHeaderObject2.SetCopyright(Copyright)
- InfHeaderObject2.SetLicense(License)
-
-
-
-
- ## Section header parser
- #
- # The section header is always in following format:
- #
- # [section_name.arch<.platform|module_type>]
- #
- # @param String A string contained the content need to be parsed.
- #
- def SectionHeaderParser(self, SectionString, FileName, LineNo):
- _Scope = []
- _SectionName = ''
- ArchList = set()
- _ValueList = []
- _PcdNameList = [DT.TAB_INF_FIXED_PCD.upper(),
- DT.TAB_INF_FEATURE_PCD.upper(),
- DT.TAB_INF_PATCH_PCD.upper(),
- DT.TAB_INF_PCD.upper(),
- DT.TAB_INF_PCD_EX.upper()
- ]
- SectionString = SectionString.strip()
- for Item in GetSplitValueList(SectionString[1:-1], DT.TAB_COMMA_SPLIT):
- if Item == '':
- Logger.Error('Parser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (""),
- File=FileName,
- Line=LineNo,
- ExtraData=SectionString)
- ItemList = GetSplitValueList(Item, DT.TAB_SPLIT)
- #
- # different section should not mix in one section
- # Allow different PCD type sections mixed together
- #
- if _SectionName.upper() not in _PcdNameList:
- if _SectionName != '' and _SectionName.upper() != ItemList[0].upper():
- Logger.Error('Parser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_SECTION_NAME_DUPLICATE,
- File=FileName,
- Line=LineNo,
- ExtraData=SectionString)
- elif _PcdNameList[1] in [_SectionName.upper(), ItemList[0].upper()] and \
- (_SectionName.upper()!= ItemList[0].upper()):
- Logger.Error('Parser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (""),
- File=FileName,
- Line=LineNo,
- ExtraData=SectionString)
-
- _SectionName = ItemList[0]
- if _SectionName.upper() in gINF_SECTION_DEF:
- self._SectionType = gINF_SECTION_DEF[_SectionName.upper()]
- else:
- self._SectionType = DT.MODEL_UNKNOWN
- Logger.Error("Parser",
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_UNKNOWN_SECTION,
- File=FileName,
- Line=LineNo,
- ExtraData=SectionString)
-
- #
- # Get Arch
- #
- Str1, ArchList = GetArch(ItemList, ArchList, FileName, LineNo, SectionString)
-
- #
- # For [Defines] section, do special check.
- #
- if ItemList[0].upper() == DT.TAB_COMMON_DEFINES.upper():
- if len(ItemList) != 1:
- Logger.Error('Parser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (SectionString),
- File=FileName, Line=LineNo, ExtraData=SectionString)
-
- #
- # For [UserExtension] section, do special check.
- #
- if ItemList[0].upper() == DT.TAB_USER_EXTENSIONS.upper():
-
- RetValue = ProcessUseExtHeader(ItemList)
-
- if not RetValue[0]:
- Logger.Error('Parser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (SectionString),
- File=FileName, Line=LineNo, ExtraData=SectionString)
- else:
- ItemList = RetValue[1]
-
- if len(ItemList) == 3:
- ItemList.append('COMMON')
-
- Str1 = ItemList[1]
-
- #
- # For Library classes, need to check module type.
- #
- if ItemList[0].upper() == DT.TAB_LIBRARY_CLASSES.upper() and len(ItemList) == 3:
- if ItemList[2] != '':
- ModuleTypeList = GetSplitValueList(ItemList[2], DT.TAB_VALUE_SPLIT)
- for Item in ModuleTypeList:
- if Item.strip() not in DT.MODULE_LIST:
- Logger.Error('Parser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID % (Item),
- File=FileName,
- Line=LineNo,
- ExtraData=SectionString)
- #
- # GetSpecialStr2
- #
- Str2 = GetSpecialStr2(ItemList, FileName, LineNo, SectionString)
-
- _Scope.append([Str1, Str2])
-
- _NewValueList = []
- _AppendFlag = True
- if _SectionName.upper() in _PcdNameList:
- for ValueItem in _ValueList:
- if _SectionName.upper() == ValueItem[0].upper() and Str1.upper() not in ValueItem[1].split():
- ValueItem[1] = ValueItem[1] + " " + Str1
- _AppendFlag = False
- elif _SectionName.upper() == ValueItem[0].upper() and Str1.upper() in ValueItem[1].split():
- _AppendFlag = False
-
- _NewValueList.append(ValueItem)
-
- _ValueList = _NewValueList
-
- if _AppendFlag:
- if not ItemList[0].upper() == DT.TAB_USER_EXTENSIONS.upper():
- _ValueList.append([_SectionName, Str1, Str2, LineNo])
- else:
- if len(ItemList) == 4:
- _ValueList.append([_SectionName, Str1, Str2, ItemList[3], LineNo])
-
- self.SectionHeaderContent = deepcopy(_ValueList)
-
- ## GenSpecialSectionList
- #
- # @param SpecialSectionList: a list of list, of which item's format
- # (Comment, LineNum)
- # @param ContainerFile: Input value for filename of Inf file
- #
- def InfSpecialCommentParser (self, SpecialSectionList, InfSectionObject, ContainerFile, SectionType):
- ReFindSpecialCommentRe = re.compile(r"""#(?:\s*)\[(.*?)\](?:.*)""", re.DOTALL)
- ReFindHobArchRe = re.compile(r"""[Hh][Oo][Bb]\.([^,]*)""", re.DOTALL)
- if self.FileName:
- pass
- SpecialObjectList = []
- ArchList = []
- if SectionType == DT.TYPE_EVENT_SECTION:
- TokenDict = DT.EVENT_TOKENS
- elif SectionType == DT.TYPE_HOB_SECTION:
- TokenDict = DT.HOB_TOKENS
- else:
- TokenDict = DT.BOOTMODE_TOKENS
-
- for List in SpecialSectionList:
- #
- # Hob has Arch attribute, need to be handled specially here
- #
- if SectionType == DT.TYPE_HOB_SECTION:
-
- MatchObject = ReFindSpecialCommentRe.search(List[0][0])
- HobSectionStr = MatchObject.group(1)
- ArchList = []
- for Match in ReFindHobArchRe.finditer(HobSectionStr):
- Arch = Match.groups(1)[0].upper()
- ArchList.append(Arch)
- CommentSoFar = ''
- for Index in xrange(1, len(List)):
- Result = ParseComment(List[Index], DT.ALL_USAGE_TOKENS, TokenDict, [], False)
- Usage = Result[0]
- Type = Result[1]
- HelpText = Result[3]
-
- if Usage == DT.ITEM_UNDEFINED and Type == DT.ITEM_UNDEFINED:
- if HelpText is None:
- HelpText = ''
- if not HelpText.endswith('\n'):
- HelpText += '\n'
- CommentSoFar += HelpText
- else:
- if HelpText:
- CommentSoFar += HelpText
- if SectionType == DT.TYPE_EVENT_SECTION:
- SpecialObject = InfEventObject()
- SpecialObject.SetEventType(Type)
- SpecialObject.SetUsage(Usage)
- SpecialObject.SetHelpString(CommentSoFar)
- elif SectionType == DT.TYPE_HOB_SECTION:
- SpecialObject = InfHobObject()
- SpecialObject.SetHobType(Type)
- SpecialObject.SetUsage(Usage)
- SpecialObject.SetHelpString(CommentSoFar)
- if len(ArchList) >= 1:
- SpecialObject.SetSupArchList(ArchList)
- else:
- SpecialObject = InfBootModeObject()
- SpecialObject.SetSupportedBootModes(Type)
- SpecialObject.SetUsage(Usage)
- SpecialObject.SetHelpString(CommentSoFar)
-
- SpecialObjectList.append(SpecialObject)
- CommentSoFar = ''
- if not InfSectionObject.SetSpecialComments(SpecialObjectList,
- SectionType):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (SectionType),
- ContainerFile
- )
diff --git a/BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py
deleted file mode 100644
index 51db796035..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py
+++ /dev/null
@@ -1,145 +0,0 @@
-## @file
-# This file contained the parser for [Sources] sections in INF file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-'''
-InfSourceSectionParser
-'''
-##
-# Import Modules
-#
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import FORMAT_INVALID
-from Parser.InfParserMisc import InfExpandMacro
-from Library import DataType as DT
-from Library.Parsing import MacroParser
-from Library.Misc import GetSplitValueList
-from Object.Parser.InfCommonObject import InfLineCommentObject
-from Parser.InfParserMisc import InfParserSectionRoot
-
-class InfSourceSectionParser(InfParserSectionRoot):
- ## InfSourceParser
- #
- #
- def InfSourceParser(self, SectionString, InfSectionObject, FileName):
- SectionMacros = {}
- ValueList = []
- SourceList = []
- StillCommentFalg = False
- HeaderComments = []
- LineComment = None
- SectionContent = ''
- for Line in SectionString:
- SrcLineContent = Line[0]
- SrcLineNo = Line[1]
-
- if SrcLineContent.strip() == '':
- continue
-
- #
- # Found Header Comments
- #
- if SrcLineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):
- #
- # Last line is comments, and this line go on.
- #
- if StillCommentFalg:
- HeaderComments.append(Line)
- SectionContent += SrcLineContent + DT.END_OF_LINE
- continue
- #
- # First time encounter comment
- #
- else:
- #
- # Clear original data
- #
- HeaderComments = []
- HeaderComments.append(Line)
- StillCommentFalg = True
- SectionContent += SrcLineContent + DT.END_OF_LINE
- continue
- else:
- StillCommentFalg = False
-
- if len(HeaderComments) >= 1:
- LineComment = InfLineCommentObject()
- LineCommentContent = ''
- for Item in HeaderComments:
- LineCommentContent += Item[0] + DT.END_OF_LINE
- LineComment.SetHeaderComments(LineCommentContent)
-
- #
- # Find Tail comment.
- #
- if SrcLineContent.find(DT.TAB_COMMENT_SPLIT) > -1:
- TailComments = SrcLineContent[SrcLineContent.find(DT.TAB_COMMENT_SPLIT):]
- SrcLineContent = SrcLineContent[:SrcLineContent.find(DT.TAB_COMMENT_SPLIT)]
- if LineComment == None:
- LineComment = InfLineCommentObject()
- LineComment.SetTailComments(TailComments)
-
- #
- # Find Macro
- #
- Name, Value = MacroParser((SrcLineContent, SrcLineNo),
- FileName,
- DT.MODEL_EFI_SOURCE_FILE,
- self.FileLocalMacros)
- if Name != None:
- SectionMacros[Name] = Value
- LineComment = None
- HeaderComments = []
- continue
-
- #
- # Replace with Local section Macro and [Defines] section Macro.
- #
- SrcLineContent = InfExpandMacro(SrcLineContent,
- (FileName, SrcLineContent, SrcLineNo),
- self.FileLocalMacros,
- SectionMacros)
-
- TokenList = GetSplitValueList(SrcLineContent, DT.TAB_VALUE_SPLIT, 4)
- ValueList[0:len(TokenList)] = TokenList
-
- #
- # Store section content string after MACRO replaced.
- #
- SectionContent += SrcLineContent + DT.END_OF_LINE
-
- SourceList.append((ValueList, LineComment,
- (SrcLineContent, SrcLineNo, FileName)))
- ValueList = []
- LineComment = None
- TailComments = ''
- HeaderComments = []
- continue
-
- #
- # Current section archs
- #
- ArchList = []
- for Item in self.LastSectionHeaderContent:
- if Item[1] not in ArchList:
- ArchList.append(Item[1])
- InfSectionObject.SetSupArchList(Item[1])
-
- InfSectionObject.SetAllContent(SectionContent)
- if not InfSectionObject.SetSources(SourceList, Arch = ArchList):
- Logger.Error('InfParser',
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[Sources]"),
- File=FileName,
- Line=Item[3]) \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Parser/__init__.py b/BaseTools/Source/Python/UPT/Parser/__init__.py
deleted file mode 100644
index 151f9ed433..0000000000
--- a/BaseTools/Source/Python/UPT/Parser/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Parser' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Parser
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py b/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py
deleted file mode 100644
index cb8aa18788..0000000000
--- a/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py
+++ /dev/null
@@ -1,607 +0,0 @@
-## @file DecPomAlignment.py
-# This file contained the adapter for convert INF parser object to POM Object
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-DecPomAlignment
-'''
-
-##
-# Import Modules
-#
-import os.path
-from os import sep
-import platform
-
-import Logger.Log as Logger
-from Logger import StringTable as ST
-from Logger.ToolError import UPT_MUL_DEC_ERROR
-
-from Library.Parsing import NormPath
-from Library.DataType import ARCH_LIST
-from Library.DataType import TAB_GUIDS
-from Library.DataType import TAB_PROTOCOLS
-from Library.DataType import TAB_PPIS
-from Library.DataType import TAB_DEC_DEFINES_PACKAGE_NAME
-from Library.DataType import TAB_DEC_DEFINES_PACKAGE_GUID
-from Library.DataType import TAB_DEC_DEFINES_PACKAGE_VERSION
-from Library.DataType import TAB_DEC_DEFINES_DEC_SPECIFICATION
-from Library.DataType import TAB_ARCH_COMMON
-from Library.CommentParsing import ParseHeaderCommentSection
-from Library.DataType import TAB_INCLUDES
-from Library.CommentParsing import ParseGenericComment
-from Library.DataType import TAB_LIBRARY_CLASSES
-from Library.DataType import TAB_PCDS
-from Library.DataType import TAB_PCDS_FIXED_AT_BUILD_NULL
-from Library.DataType import TAB_PCDS_PATCHABLE_IN_MODULE_NULL
-from Library.DataType import TAB_PCDS_FEATURE_FLAG_NULL
-from Library.DataType import TAB_PCDS_DYNAMIC_EX_NULL
-from Library.DataType import TAB_PCDS_DYNAMIC_NULL
-from Library.DataType import TAB_PTR_TYPE_PCD
-from Library.DataType import ITEM_UNDEFINED
-from Library.CommentParsing import ParseDecPcdGenericComment
-from Library.CommentParsing import ParseDecPcdTailComment
-from Library.Misc import GetFiles
-from Library.Misc import Sdict
-from Parser.DecParser import Dec
-
-from Object.POM.PackageObject import PackageObject
-from Object.POM.CommonObject import UserExtensionObject
-from Object.POM.CommonObject import IncludeObject
-from Object.POM.CommonObject import GuidObject
-from Object.POM.CommonObject import ProtocolObject
-from Object.POM.CommonObject import PpiObject
-from Object.POM.CommonObject import LibraryClassObject
-from Object.POM.CommonObject import PcdObject
-from Object.POM.CommonObject import TextObject
-
-
-## DecPomAlignment
-#
-# Inherited from PackageObject
-#
-class DecPomAlignment(PackageObject):
- def __init__(self, Filename, WorkspaceDir = None, CheckMulDec = False):
- PackageObject.__init__(self)
- self.UserExtensions = ''
- self.WorkspaceDir = WorkspaceDir
- self.SupArchList = ARCH_LIST
- self.CheckMulDec = CheckMulDec
- self.DecParser = None
-
- #
- # Load Dec file
- #
- self.LoadDecFile(Filename)
-
- #
- # Transfer to Package Object if IsToPackage is True
- #
- self.DecToPackage()
-
- ## Load Dec file
- #
- # Load the file if it exists
- #
- # @param Filename: Input value for filename of Dec file
- #
- def LoadDecFile(self, Filename):
- #
- # Insert a record for file
- #
- Filename = NormPath(Filename)
- (Path, Name) = os.path.split(Filename)
- self.SetFullPath(Filename)
- self.SetRelaPath(Path)
- self.SetFileName(Name)
- self.SetPackagePath(Path[Path.upper().find(self.WorkspaceDir.upper()) + len(self.WorkspaceDir) + 1:])
- self.SetCombinePath(Filename[Filename.upper().find(self.WorkspaceDir.upper()) + len(self.WorkspaceDir) + 1:])
-
- self.DecParser = Dec(Filename)
-
- ## Transfer to Package Object
- #
- # Transfer all contents of a Dec file to a standard Package Object
- #
- def DecToPackage(self):
- #
- # Init global information for the file
- #
- ContainerFile = self.GetFullPath()
-
- #
- # Generate Package Header
- #
- self.GenPackageHeader(ContainerFile)
-
- #
- # Generate Includes
- #
- self.GenIncludes(ContainerFile)
-
- #
- # Generate Guids
- #
- self.GenGuidProtocolPpis(TAB_GUIDS, ContainerFile)
-
- #
- # Generate Protocols
- #
- self.GenGuidProtocolPpis(TAB_PROTOCOLS, ContainerFile)
-
- #
- # Generate Ppis
- #
- self.GenGuidProtocolPpis(TAB_PPIS, ContainerFile)
-
- #
- # Generate LibraryClasses
- #
- self.GenLibraryClasses(ContainerFile)
-
- #
- # Generate Pcds
- #
- self.GenPcds(ContainerFile)
-
- #
- # Generate Module File list, will be used later on to generate
- # distribution
- #
- self.GenModuleFileList(ContainerFile)
-
- #
- # Generate user extensions
- #
- self.GenUserExtensions()
-
- ## Generate user extention
- #
- #
- def GenUserExtensions(self):
- UEObj = self.DecParser.GetUserExtensionSectionObject()
- UEList = UEObj.GetAllUserExtensions()
- for Item in UEList:
- if not Item.UserString:
- continue
- UserExtension = UserExtensionObject()
- UserId = Item.UserId
- if UserId.startswith('"') and UserId.endswith('"'):
- UserId = UserId[1:-1]
- UserExtension.SetUserID(UserId)
- Identifier = Item.IdString
- if Identifier.startswith('"') and Identifier.endswith('"'):
- Identifier = Identifier[1:-1]
- UserExtension.SetIdentifier(Identifier)
- UserExtension.SetStatement(Item.UserString)
- UserExtension.SetSupArchList(
- Item.ArchAndModuleType
- )
- self.SetUserExtensionList(
- self.GetUserExtensionList() + [UserExtension]
- )
-
- ## Generate Package Header
- #
- # Gen Package Header of Dec as <Key> = <Value>
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenPackageHeader(self, ContainerFile):
- Logger.Debug(2, "Generate PackageHeader ...")
- DefinesDict = {}
-
- #
- # Update all defines item in database
- #
- DefObj = self.DecParser.GetDefineSectionObject()
- for Item in DefObj.GetDefines():
- #
- # put items into Dict except for PackageName, Guid, Version, DEC_SPECIFICATION
- #
- SkipItemList = [TAB_DEC_DEFINES_PACKAGE_NAME, \
- TAB_DEC_DEFINES_PACKAGE_GUID, TAB_DEC_DEFINES_PACKAGE_VERSION, TAB_DEC_DEFINES_DEC_SPECIFICATION]
- if Item.Key in SkipItemList:
- continue
- DefinesDict['%s = %s' % (Item.Key, Item.Value)] = TAB_ARCH_COMMON
-
- self.SetBaseName(DefObj.GetPackageName())
- self.SetVersion(DefObj.GetPackageVersion())
-# self.SetName(DefObj.GetPackageName() + ' Version ' + \
-# DefObj.GetPackageVersion())
- self.SetName(os.path.splitext(self.GetFileName())[0])
- self.SetGuid(DefObj.GetPackageGuid())
-
- if DefinesDict:
- UserExtension = UserExtensionObject()
- UserExtension.SetDefinesDict(DefinesDict)
- UserExtension.SetIdentifier('DefineModifiers')
- UserExtension.SetUserID('EDK2')
- self.SetUserExtensionList(
- self.GetUserExtensionList() + [UserExtension]
- )
-
- #
- # Get All header comment section information
- #
- Abstract, Description, Copyright, License = \
- ParseHeaderCommentSection(self.DecParser.GetHeadComment(),
- ContainerFile)
- self.SetAbstract(Abstract)
- self.SetDescription(Description)
- self.SetCopyright(Copyright)
- self.SetLicense(License)
-
- ## GenIncludes
- #
- # Gen Includes of Dec
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenIncludes(self, ContainerFile):
- if ContainerFile:
- pass
- Logger.Debug(2, "Generate %s ..." % TAB_INCLUDES)
- IncludesDict = Sdict()
-
- IncObj = self.DecParser.GetIncludeSectionObject()
- for Item in IncObj.GetAllIncludes():
- IncludePath = os.path.normpath(Item.File)
- if platform.system() != 'Windows':
- IncludePath = IncludePath.replace('\\', '/')
- if IncludePath in IncludesDict:
- if Item.GetArchList() == [TAB_ARCH_COMMON] or IncludesDict[IncludePath] == [TAB_ARCH_COMMON]:
- IncludesDict[IncludePath] = [TAB_ARCH_COMMON]
- else:
- IncludesDict[IncludePath] = IncludesDict[IncludePath] + Item.GetArchList()
- else:
- IncludesDict[IncludePath] = Item.GetArchList()
-
- #
- # get the standardIncludeFileList(industry), packageIncludeFileList
- # (others) for PackageObject
- #
- PackagePath = os.path.split(self.GetFullPath())[0]
- IncludePathList = \
- [os.path.normpath(Path) + sep for Path in IncludesDict.keys()]
- IncludePathList.sort()
-
- #
- # get a non-overlap set of include path, IncludePathList should be
- # sorted, and path should be end with path seperator '\'
- #
- NonOverLapList = []
- for Path1 in IncludePathList:
- for Path2 in NonOverLapList:
- if Path1.startswith(Path2):
- break
- else:
- NonOverLapList.append(Path1)
- #
- # revert the list so the longest path shown first in list, also need
- # to remove the extra path seperator '\'
- # as this list is used to search the supported Arch info
- #
- for IndexN in range (0, len(IncludePathList)):
- IncludePathList[IndexN] = os.path.normpath(IncludePathList[IndexN])
- IncludePathList.sort()
- IncludePathList.reverse()
- #
- # save the include path list for later usage
- #
- self.SetIncludePathList(IncludePathList)
- StandardIncludeFileList = []
- PackageIncludeFileList = []
-
- IncludeFileList = []
- for Path in NonOverLapList:
- FileList = GetFiles(os.path.join(PackagePath, Path), ['CVS', '.svn'], False)
- IncludeFileList += [os.path.normpath(os.path.join(Path, File)) for File in FileList]
- for Includefile in IncludeFileList:
- ExtName = os.path.splitext(Includefile)[1]
- if ExtName.upper() == '.DEC' and self.CheckMulDec:
- Logger.Error('MkPkg',
- UPT_MUL_DEC_ERROR,
- ST.ERR_MUL_DEC_ERROR%(os.path.dirname(ContainerFile),
- os.path.basename(ContainerFile),
- Includefile))
-
- FileCombinePath = os.path.dirname(Includefile)
- Include = IncludeObject()
- for Path in IncludePathList:
- if FileCombinePath.startswith(Path):
- SupArchList = IncludesDict[Path]
- break
- Include.SetFilePath(Includefile)
- Include.SetSupArchList(SupArchList)
- if Includefile.find('IndustryStandard') != -1:
- StandardIncludeFileList.append(Include)
- else:
- PackageIncludeFileList.append(Include)
-
- self.SetStandardIncludeFileList(StandardIncludeFileList)
-
- #
- # put include path into the PackageIncludeFileList
- #
- PackagePathList = []
- IncObj = self.DecParser.GetIncludeSectionObject()
- for Item in IncObj.GetAllIncludes():
- IncludePath = Item.File
- Include = IncludeObject()
- Include.SetFilePath(IncludePath)
- Include.SetSupArchList(Item.GetArchList())
- PackagePathList.append(Include)
- self.SetPackageIncludeFileList(PackagePathList + PackageIncludeFileList)
-
- ## GenPpis
- #
- # Gen Ppis of Dec
- # <CName>=<GuidValue>
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenGuidProtocolPpis(self, Type, ContainerFile):
- if ContainerFile:
- pass
- Logger.Debug(2, "Generate %s ..." % Type)
-
- Obj = None
- Factory = None
- if Type == TAB_GUIDS:
- Obj = self.DecParser.GetGuidSectionObject()
- def CreateGuidObject():
- Object = GuidObject()
- Object.SetGuidTypeList([])
- Object.SetUsage(None)
- Object.SetName(None)
- return Object
- Factory = CreateGuidObject
- elif Type == TAB_PROTOCOLS:
- Obj = self.DecParser.GetProtocolSectionObject()
-
- def CreateProtocolObject():
- return ProtocolObject()
- Factory = CreateProtocolObject
- elif Type == TAB_PPIS:
- Obj = self.DecParser.GetPpiSectionObject()
-
- def CreatePpiObject():
- return PpiObject()
- Factory = CreatePpiObject
- else:
- #
- # Should not be here
- #
- return
-
- DeclarationsList = []
-
- #
- # Go through each arch
- #
- for Item in Obj.GetGuidStyleAllItems():
- Name = Item.GuidCName
- Value = Item.GuidString
- HelpTxt = ParseGenericComment(Item.GetHeadComment() + \
- Item.GetTailComment())
-
- ListObject = Factory()
- ListObject.SetCName(Name)
- ListObject.SetGuid(Value)
- ListObject.SetSupArchList(Item.GetArchList())
- if HelpTxt:
- ListObject.SetHelpTextList([HelpTxt])
-
- DeclarationsList.append(ListObject)
-
- #
- #GuidTypeList is abstracted from help
- #
- if Type == TAB_GUIDS:
- self.SetGuidList(self.GetGuidList() + DeclarationsList)
- elif Type == TAB_PROTOCOLS:
- self.SetProtocolList(self.GetProtocolList() + DeclarationsList)
- elif Type == TAB_PPIS:
- self.SetPpiList(self.GetPpiList() + DeclarationsList)
-
- ## GenLibraryClasses
- #
- # Gen LibraryClasses of Dec
- # <CName>=<GuidValue>
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenLibraryClasses(self, ContainerFile):
- if ContainerFile:
- pass
- Logger.Debug(2, "Generate %s ..." % TAB_LIBRARY_CLASSES)
- LibraryClassDeclarations = []
-
- LibObj = self.DecParser.GetLibraryClassSectionObject()
- for Item in LibObj.GetAllLibraryclasses():
- LibraryClass = LibraryClassObject()
- LibraryClass.SetLibraryClass(Item.Libraryclass)
- LibraryClass.SetSupArchList(Item.GetArchList())
- LibraryClass.SetIncludeHeader(Item.File)
- HelpTxt = ParseGenericComment(Item.GetHeadComment() + \
- Item.GetTailComment(), None, '@libraryclass')
- if HelpTxt:
- LibraryClass.SetHelpTextList([HelpTxt])
- LibraryClassDeclarations.append(LibraryClass)
-
- self.SetLibraryClassList(self.GetLibraryClassList() + \
- LibraryClassDeclarations)
-
- ## GenPcds
- #
- # Gen Pcds of Dec
- # <TokenSpcCName>.<TokenCName>|<Value>|<DatumType>|<Token>
- #
- # @param ContainerFile: The Dec file full path
- #
- def GenPcds(self, ContainerFile):
- Logger.Debug(2, "Generate %s ..." % TAB_PCDS)
-
- PcdObj = self.DecParser.GetPcdSectionObject()
- #
- # Get all Pcds
- #
- PcdDeclarations = []
- IterList = [
- (TAB_PCDS_FIXED_AT_BUILD_NULL, 'FixedPcd'),
- (TAB_PCDS_PATCHABLE_IN_MODULE_NULL, 'PatchPcd'),
- (TAB_PCDS_FEATURE_FLAG_NULL, 'FeaturePcd'),
- (TAB_PCDS_DYNAMIC_EX_NULL, 'PcdEx'),
- (TAB_PCDS_DYNAMIC_NULL, 'Pcd')]
- #
- # For each PCD type
- #
- for PcdType, Type in IterList:
- #
- # Go through all archs
- #
- # for Arch in self.SupArchList + [TAB_ARCH_COMMON]:
- #
- for Item in PcdObj.GetPcdsByType(PcdType.upper()):
- PcdDeclaration = GenPcdDeclaration(
- ContainerFile,
- (Item.TokenSpaceGuidCName, Item.TokenCName,
- Item.DefaultValue, Item.DatumType, Item.TokenValue,
- Type, Item.GetHeadComment(), Item.GetTailComment(),
- '')
- )
- PcdDeclaration.SetSupArchList(Item.GetArchListOfType(PcdType))
- PcdDeclarations.append(PcdDeclaration)
-
- self.SetPcdList(self.GetPcdList() + PcdDeclarations)
-
-
- ## GenModuleFileList
- #
- def GenModuleFileList(self, ContainerFile):
- ModuleFileList = []
- ContainerFileName = os.path.basename(ContainerFile)
- ContainerFilePath = os.path.dirname(ContainerFile)
- for Item in GetFiles(ContainerFilePath,
- ['CVS', '.svn'] + self.GetIncludePathList(), False):
- ExtName = os.path.splitext(Item)[1]
- if ExtName.lower() == '.inf':
- ModuleFileList.append(Item)
- elif ExtName.upper() == '.DEC' and self.CheckMulDec:
- if Item == ContainerFileName:
- continue
- Logger.Error('MkPkg',
- UPT_MUL_DEC_ERROR,
- ST.ERR_MUL_DEC_ERROR%(ContainerFilePath,
- ContainerFileName,
- Item))
-
- self.SetModuleFileList(ModuleFileList)
-
- ## Show detailed information of Package
- #
- # Print all members and their values of Package class
- #
- def ShowPackage(self):
- print '\nName =', self.GetName()
- print '\nBaseName =', self.GetBaseName()
- print '\nVersion =', self.GetVersion()
- print '\nGuid =', self.GetGuid()
-
- print '\nStandardIncludes = %d ' \
- % len(self.GetStandardIncludeFileList()),
- for Item in self.GetStandardIncludeFileList():
- print Item.GetFilePath(), ' ', Item.GetSupArchList()
- print '\nPackageIncludes = %d \n' \
- % len(self.GetPackageIncludeFileList()),
- for Item in self.GetPackageIncludeFileList():
- print Item.GetFilePath(), ' ', Item.GetSupArchList()
-
- print '\nGuids =', self.GetGuidList()
- for Item in self.GetGuidList():
- print Item.GetCName(), Item.GetGuid(), Item.GetSupArchList()
- print '\nProtocols =', self.GetProtocolList()
- for Item in self.GetProtocolList():
- print Item.GetCName(), Item.GetGuid(), Item.GetSupArchList()
- print '\nPpis =', self.GetPpiList()
- for Item in self.GetPpiList():
- print Item.GetCName(), Item.GetGuid(), Item.GetSupArchList()
- print '\nLibraryClasses =', self.GetLibraryClassList()
- for Item in self.GetLibraryClassList():
- print Item.GetLibraryClass(), Item.GetRecommendedInstance(), \
- Item.GetSupArchList()
- print '\nPcds =', self.GetPcdList()
- for Item in self.GetPcdList():
- print 'CName=', Item.GetCName(), 'TokenSpaceGuidCName=', \
- Item.GetTokenSpaceGuidCName(), \
- 'DefaultValue=', Item.GetDefaultValue(), \
- 'ValidUsage=', Item.GetValidUsage(), \
- 'SupArchList', Item.GetSupArchList(), \
- 'Token=', Item.GetToken(), 'DatumType=', Item.GetDatumType()
-
- for Item in self.GetMiscFileList():
- print Item.GetName()
- for FileObjectItem in Item.GetFileList():
- print FileObjectItem.GetURI()
- print '****************\n'
-
-## GenPcdDeclaration
-#
-# @param ContainerFile: File name of the DEC file
-# @param PcdInfo: Pcd information, of format (TokenGuidCName,
-# TokenName, Value, DatumType, Token, Type,
-# GenericComment, TailComment, Arch)
-#
-def GenPcdDeclaration(ContainerFile, PcdInfo):
- HelpStr = ''
- TailHelpStr = ''
- TokenGuidCName, TokenName, Value, DatumType, Token, Type, \
- GenericComment, TailComment, Arch = PcdInfo
- Pcd = PcdObject()
- Pcd.SetCName(TokenName)
- Pcd.SetToken(Token)
- Pcd.SetTokenSpaceGuidCName(TokenGuidCName)
- Pcd.SetDatumType(DatumType)
- Pcd.SetDefaultValue(Value)
- Pcd.SetValidUsage(Type)
- #
- # MaxDatumSize is required field for 'VOID*' PCD
- #
- if DatumType == TAB_PTR_TYPE_PCD:
- Pcd.SetMaxDatumSize(ITEM_UNDEFINED)
-
- SupArchList = [Arch]
- Pcd.SetSupArchList(SupArchList)
-
- if GenericComment:
- HelpStr, PcdErr = ParseDecPcdGenericComment(GenericComment,
- ContainerFile)
- if PcdErr:
- Pcd.SetPcdErrorsList([PcdErr])
-
- if TailComment:
- SupModuleList, TailHelpStr = ParseDecPcdTailComment(TailComment,
- ContainerFile)
- if SupModuleList:
- Pcd.SetSupModuleList(SupModuleList)
-
- if HelpStr and (not HelpStr.endswith('\n')) and TailHelpStr:
- HelpStr += '\n'
- HelpStr += TailHelpStr
- if HelpStr:
- HelpTxtObj = TextObject()
- HelpTxtObj.SetString(HelpStr)
- Pcd.SetHelpTextList([HelpTxtObj])
-
- return Pcd
diff --git a/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py b/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py
deleted file mode 100644
index a4a3107366..0000000000
--- a/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py
+++ /dev/null
@@ -1,971 +0,0 @@
-## @file InfPomAlignment.py
-# This file contained the adapter for convert INF parser object to POM Object
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-'''
-InfPomAlignment
-'''
-##
-# Import modules
-#
-import os.path
-
-from Logger import StringTable as ST
-import Logger.Log as Logger
-
-from Library.String import FORMAT_INVALID
-from Library.String import PARSER_ERROR
-from Library.String import NormPath
-from Library.String import GetSplitValueList
-from Library.Misc import ConvertVersionToDecimal
-from Library.Misc import GetHelpStringByRemoveHashKey
-from Library.Misc import ConvertArchList
-from Library.Parsing import GetPkgInfoFromDec
-from Library import DataType as DT
-from Library import GlobalData
-
-from Object.POM import CommonObject
-from Object.POM.ModuleObject import ModuleObject
-from Object.POM.ModuleObject import ExternObject
-from Object.POM.ModuleObject import HobObject
-from Object.POM.ModuleObject import EventObject
-from Object.POM.ModuleObject import BootModeObject
-from Object.POM.ModuleObject import PackageDependencyObject
-from Object.POM.ModuleObject import SourceFileObject
-from Object.POM.ModuleObject import DepexObject
-from Object.POM.ModuleObject import AsBuildLibraryClassObject
-from Object.POM.ModuleObject import AsBuiltObject
-from PomAdapter.InfPomAlignmentMisc import GenModuleHeaderUserExt
-from PomAdapter.InfPomAlignmentMisc import GenBinaryData
-from Parser import InfParser
-
-
-
-## InfPomAlignment
-#
-# Inherit from ModuleObject
-#
-class InfPomAlignment(ModuleObject):
- ## Construct of InfPomAlignment
- # Skip means that UPT don't care the syntax of INF, this may be the not
- # distributed INF files during creation or the INF files checked for
- # dependency rule during remove.
- #
- def __init__(self, FileName, WorkSpace=None, PackagePath='', Skip=False):
- ModuleObject.__init__(self)
-
- self.Parser = None
- self.FileName = FileName
- self.WorkSpace = WorkSpace
- self.CombinePath = ''
- self.LibModuleTypeList = []
- self.FullPath = ''
- self.ModulePath = ''
- self.WorkspaceDir = " "
- self.CustomMakefile = []
-
- self.SetPackagePath(PackagePath)
- #
- # Call GenInfPomObjects function to fill POM object.
- #
- if Skip:
- OrigConfig = Logger.SUPRESS_ERROR
- Logger.SUPRESS_ERROR = True
- self._GenInfPomObjects(Skip)
- Logger.SUPRESS_ERROR = OrigConfig
- else:
- self._GenInfPomObjects(Skip)
-
- ##
- # Generate all POM objects, the original input comes
- # from INF parser's output
- #
- def _GenInfPomObjects(self, Skip):
- #
- # Call INF Parser to get information from INF file
- #
- self.Parser = InfParser.InfParser(self.FileName, self.WorkSpace)
- self.FullPath = self.Parser.FullPath
- self.GetFullPath()
- self._GenModuleHeader()
- #
- # Call GenBinaries after Module Header for Binary INF consideration.
- #
- self._GenBinaries()
- self._GenBuildOptions()
- self._GenLibraryClasses()
- self._GenPackages(Skip)
- self._GenPcds()
- self._GenSources()
- self._GenUserExtensions()
- self._GenGuidProtocolPpis(DT.TAB_GUIDS)
- self._GenGuidProtocolPpis(DT.TAB_PROTOCOLS)
- self._GenGuidProtocolPpis(DT.TAB_PPIS)
- self._GenDepexes()
- self._GenMiscFiles(self.FullPath, Skip)
-
- ## Convert [Defines] section content to InfDefObject
- #
- # Convert [Defines] section content to InfDefObject
- #
- # @param Defines The content under [Defines] section
- # @param ModuleHeader An object of ModuleHeaderClass
- # @param Arch The supported ARCH
- #
- def _GenModuleHeader(self):
- Logger.Debug(2, "Generate ModuleHeader ...")
- #
- # Get all defines information form InfParser Object
- #
- RecordSet = self.Parser.InfDefSection.Defines
- #
- # Should only have one ArchString Item.
- #
- ArchString = RecordSet.keys()[0]
- ArchList = GetSplitValueList(ArchString, ' ')
- ArchList = ConvertArchList(ArchList)
- HasCalledFlag = False
-
- #
- # Get data from Sdict()
- #
- ValueList = RecordSet[ArchString]
- self.SetFileName(self.FileName)
- self.SetFullPath(self.FullPath)
- #
- # The INF's filename (without the directory path or the extension)
- # must be used for the value of the
- # ModuleSurfaceArea.Header.Name element
- #
- self.SetName(os.path.splitext(os.path.basename(self.FileName))[0])
-
- self.WorkspaceDir = " "
- #
- # CombinePath and ModulePath
- #
- PathCount = self.FullPath.upper().find(self.WorkSpace.upper()) + len(self.WorkSpace) + 1
- CombinePath = self.FullPath[PathCount:]
- self.SetCombinePath(CombinePath)
-
- ModulePath = os.path.split(CombinePath)[0]
- ModuleRelativePath = ModulePath
- if self.GetPackagePath() != '':
- ModuleRelativePath = ModulePath[ModulePath.find(self.GetPackagePath()) + len(self.GetPackagePath()) + 1:]
- self.SetModulePath(ModuleRelativePath)
-
- #
- # For Define Seciton Items.
- #
- DefineObj = ValueList
-
- #
- # Convert UEFI/PI version to decimal number
- #
- if DefineObj.GetUefiSpecificationVersion() != None:
- __UefiVersion = DefineObj.GetUefiSpecificationVersion().GetValue()
- __UefiVersion = ConvertVersionToDecimal(__UefiVersion)
- self.SetUefiSpecificationVersion(str(__UefiVersion))
- if DefineObj.GetPiSpecificationVersion() != None:
- __PiVersion = DefineObj.GetPiSpecificationVersion().GetValue()
- __PiVersion = ConvertVersionToDecimal(__PiVersion)
-
- self.SetPiSpecificationVersion(str(__PiVersion))
-
- SpecList = DefineObj.GetSpecification()
- NewSpecList = []
- for SpecItem in SpecList:
- NewSpecList.append((SpecItem[0], ConvertVersionToDecimal(SpecItem[1])))
- self.SetSpecList(NewSpecList)
-
- #
- # must exist items in INF define section
- # MODULE_TYPE/BASE_NAME/INF_VERSION/FILE_GUID/VERSION_STRING
- #
- if DefineObj.GetModuleType() == None:
- Logger.Error("InfParser", FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_SECTION_MUST_ITEM_NOT_EXIST % ("MODULE_TYPE"), File=self.FullPath)
- else:
- self.SetModuleType(DefineObj.GetModuleType().GetValue())
- ModuleType = DefineObj.GetModuleType().GetValue()
- if ModuleType:
- #
- # Drivers and applications are not allowed to have a MODULE_TYPE of "BASE". Only
- # libraries are permitted to a have a MODULE_TYPE of "BASE".
- #
- if len(DefineObj.LibraryClass) == 0 and ModuleType == 'BASE':
- Logger.Error("InfParser",
- FORMAT_INVALID,
- ST.ERR_INF_PARSER_MODULETYPE_INVALID,
- File=self.FullPath,
- Line=DefineObj.ModuleType.CurrentLine.LineNo,
- ExtraData=DefineObj.ModuleType.CurrentLine.LineString)
- self.LibModuleTypeList.append(ModuleType)
- if DefineObj.GetBaseName() == None:
- Logger.Error("InfParser", FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_SECTION_MUST_ITEM_NOT_EXIST % ("BASE_NAME"), File=self.FullPath)
- else:
- self.SetBaseName(DefineObj.GetBaseName().GetValue())
- if DefineObj.GetInfVersion() == None:
- Logger.Error("InfParser", FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_SECTION_MUST_ITEM_NOT_EXIST % ("INF_VERSION"), File=self.FullPath)
- else:
- self.SetVersion(DefineObj.GetInfVersion().GetValue())
- if DefineObj.GetFileGuid() == None:
- Logger.Error("InfParser", FORMAT_INVALID,
- ST.ERR_INF_PARSER_DEFINE_SECTION_MUST_ITEM_NOT_EXIST % ("FILE_GUID"), File=self.FullPath)
- else:
- self.SetGuid(DefineObj.GetFileGuid().GetValue())
- if DefineObj.GetVersionString() == None:
- #
- # VERSION_STRING is missing from the [Defines] section, tools must assume that the module's version is 0.
- #
- self.SetVersion('0')
- else:
- #
- # Get version of INF
- #
- if DefineObj.GetVersionString().GetValue() != "":
- #
- # EDK2 inf
- #
- VersionString = DefineObj.GetVersionString().GetValue()
- if len(VersionString) > 0:
- VersionString = ConvertVersionToDecimal(VersionString)
- self.SetVersion(VersionString)
- else:
- #
- # EDK1 inf
- #
- Logger.Error("Parser", PARSER_ERROR, ST.ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF, ExtraData=self.FullPath,
- RaiseError=Logger.IS_RAISE_ERROR)
-
- #
- # if there is Shadow, Should judge the MODULE_TYPE in
- # SEC, PEI_CORE and PEIM
- #
- if DefineObj.GetShadow():
- ModuleTypeValue = DefineObj.GetModuleType().GetValue()
- if not (ModuleTypeValue == 'SEC' or ModuleTypeValue == 'PEI_CORE' or ModuleTypeValue == 'PEIM'):
- Logger.Error("InfParser", FORMAT_INVALID, ST.ERR_INF_PARSER_DEFINE_SHADOW_INVALID, File=self.FullPath)
-
- if DefineObj.GetPcdIsDriver() != None:
- self.SetPcdIsDriver(DefineObj.GetPcdIsDriver().GetValue())
-
- #
- # LIBRARY_CLASS
- #
- self._GenModuleHeaderLibClass(DefineObj, ArchList)
-
- #
- # CUSTOM_MAKEFILE
- #
- self.CustomMakefile = DefineObj.GetCustomMakefile()
- #
- # Externs in Defines section
- # Only one define section, so just call once.
- #
- if not HasCalledFlag:
- self._GenModuleHeaderExterns(DefineObj)
- HasCalledFlag = True
-
- #
- # each module has only one module header
- #
- self.SetSupArchList(ArchList)
- #
- # Get Hob/BootMode/EventList information
- #
- self._GenSpecialComments()
- #
- # put all define statement into user-extension sections
- #
- DefinesDictNew = GenModuleHeaderUserExt(DefineObj, ArchString)
-
- if DefinesDictNew:
- UserExtension = CommonObject.UserExtensionObject()
- UserExtension.SetDefinesDict(DefinesDictNew)
- UserExtension.SetIdentifier('DefineModifiers')
- UserExtension.SetUserID('EDK2')
- self.SetUserExtensionList(self.GetUserExtensionList() + [UserExtension])
-
- #
- # Get all meta-file header information
- # the record is list of items formated:
- # [LineValue, Arch, StartLine, ID, Third]
- #
-
- InfHeaderObj = self.Parser.InfHeader
- #
- # Put header information into POM object
- #
- self.SetAbstract(InfHeaderObj.GetAbstract())
- self.SetDescription(InfHeaderObj.GetDescription())
- self.SetCopyright(InfHeaderObj.GetCopyright())
- self.SetLicense(InfHeaderObj.GetLicense())
-
- ## GenModuleHeaderLibClass
- #
- #
- def _GenModuleHeaderLibClass(self, DefineObj, ArchList):
- LibraryList = DefineObj.GetLibraryClass()
- for LibraryItem in LibraryList:
- Lib = CommonObject.LibraryClassObject()
- Lib.SetLibraryClass(LibraryItem.GetLibraryName())
- Lib.SetUsage(DT.USAGE_ITEM_PRODUCES)
- SupModuleList = LibraryItem.GetTypes()
- self.LibModuleTypeList += SupModuleList
- Lib.SetSupModuleList(SupModuleList)
- Lib.SetSupArchList(ArchList)
- self.SetLibraryClassList(self.GetLibraryClassList() + [Lib])
- self.SetIsLibrary(True)
- self.SetIsLibraryModList(self.GetIsLibraryModList() + SupModuleList)
-
- ## GenModuleHeaderExterns
- #
- #
- def _GenModuleHeaderExterns(self, DefineObj):
- EntryPointList = DefineObj.GetEntryPoint()
- for EntryPoint in EntryPointList:
- Image = ExternObject()
- Image.SetEntryPoint(EntryPoint.GetCName())
- #
- # Future enhancement
- #
- self.SetExternList(self.GetExternList() + [Image])
- #
- # UNLOAD_IMAGE
- #
- UnloadImageList = DefineObj.GetUnloadImages()
- for UnloadImage in UnloadImageList:
- Image = ExternObject()
- #
- # Future enhancement
- #
- Image.SetUnloadImage(UnloadImage.GetCName())
- self.SetExternList(self.GetExternList() + [Image])
- #
- # CONSTRUCTOR
- #
- ConstructorList = DefineObj.GetConstructor()
- for ConstructorItem in ConstructorList:
- Image = ExternObject()
- #
- # Future enhancement
- #
- Image.SetConstructor(ConstructorItem.GetCName())
- self.SetExternList(self.GetExternList() + [Image])
- #
- # DESTRUCTOR
- #
- DestructorList = DefineObj.GetDestructor()
- for DestructorItem in DestructorList:
- Image = ExternObject()
- #
- # Future enhancement
- #
- Image.SetDestructor(DestructorItem.GetCName())
- self.SetExternList(self.GetExternList() + [Image])
-
- ## GenModuleHeaderExterns
- # BootMode/HOB/Event
- #
- def _GenSpecialComments(self):
- SpecialCommentsList = self.Parser.InfSpecialCommentSection.GetSpecialComments()
- for Key in SpecialCommentsList:
- if Key == DT.TYPE_HOB_SECTION:
- HobList = []
- for Item in SpecialCommentsList[Key]:
- Hob = HobObject()
- Hob.SetHobType(Item.GetHobType())
- Hob.SetUsage(Item.GetUsage())
- Hob.SetSupArchList(Item.GetSupArchList())
- if Item.GetHelpString():
- HelpTextObj = CommonObject.TextObject()
- HelpTextObj.SetString(Item.GetHelpString())
- Hob.SetHelpTextList([HelpTextObj])
- HobList.append(Hob)
- self.SetHobList(HobList)
- elif Key == DT.TYPE_EVENT_SECTION:
- EventList = []
- for Item in SpecialCommentsList[Key]:
- Event = EventObject()
- Event.SetEventType(Item.GetEventType())
- Event.SetUsage(Item.GetUsage())
- if Item.GetHelpString():
- HelpTextObj = CommonObject.TextObject()
- HelpTextObj.SetString(Item.GetHelpString())
- Event.SetHelpTextList([HelpTextObj])
- EventList.append(Event)
- self.SetEventList(EventList)
- elif Key == DT.TYPE_BOOTMODE_SECTION:
- BootModeList = []
- for Item in SpecialCommentsList[Key]:
- BootMode = BootModeObject()
- BootMode.SetSupportedBootModes(Item.GetSupportedBootModes())
- BootMode.SetUsage(Item.GetUsage())
- if Item.GetHelpString():
- HelpTextObj = CommonObject.TextObject()
- HelpTextObj.SetString(Item.GetHelpString())
- BootMode.SetHelpTextList([HelpTextObj])
- BootModeList.append(BootMode)
- self.SetBootModeList(BootModeList)
-
- ## GenBuildOptions
- #
- # Gen BuildOptions of Inf
- # [<Family>:]<ToolFlag>=Flag
- #
- #
- def _GenBuildOptions(self):
- Logger.Debug(2, "Generate %s ..." % DT.TAB_BUILD_OPTIONS)
- #
- # Get all BuildOptions
- #
- BuildOptionsList = self.Parser.InfBuildOptionSection.GetBuildOptions()
- if not GlobalData.gIS_BINARY_INF:
- BuildOptionDict = {}
-
- for BuildOptionObj in BuildOptionsList:
- ArchList = BuildOptionObj.GetSupArchList()
- ArchList = ConvertArchList(ArchList)
- BuildOptionsContent = BuildOptionObj.GetContent()
- ArchString = ' '.join(ArchList)
-
- if not BuildOptionsContent:
- continue
-
- BuildOptionDict[ArchString] = BuildOptionsContent
-
- if not BuildOptionDict:
- return
- UserExtension = CommonObject.UserExtensionObject()
- UserExtension.SetBuildOptionDict(BuildOptionDict)
- UserExtension.SetIdentifier('BuildOptionModifiers')
- UserExtension.SetUserID('EDK2')
- self.SetUserExtensionList(self.GetUserExtensionList() + [UserExtension])
- else:
- #
- # Not process this information, will be processed in GenBinaries()
- #
- pass
-
- ## GenLibraryClasses
- #
- # Get LibraryClass of Inf
- # <LibraryClassKeyWord>|<LibraryInstance>
- #
- # @param ContainerFile: The Inf file full path
- #
- def _GenLibraryClasses(self):
- Logger.Debug(2, "Generate %s ..." % DT.TAB_LIBRARY_CLASSES)
- if not GlobalData.gIS_BINARY_INF:
- #
- # Get all LibraryClasses
- #
- LibClassObj = self.Parser.InfLibraryClassSection.LibraryClasses
- Keys = LibClassObj.keys()
-
- for Key in Keys:
- LibraryClassData = LibClassObj[Key]
- for Item in LibraryClassData:
- LibraryClass = CommonObject.LibraryClassObject()
- LibraryClass.SetUsage(DT.USAGE_ITEM_CONSUMES)
- LibraryClass.SetLibraryClass(Item.GetLibName())
- LibraryClass.SetRecommendedInstance(None)
- LibraryClass.SetFeatureFlag(Item.GetFeatureFlagExp())
- LibraryClass.SetSupArchList(ConvertArchList(Item.GetSupArchList()))
- LibraryClass.SetSupModuleList(Item.GetSupModuleList())
- HelpStringObj = Item.GetHelpString()
-
- if HelpStringObj != None:
- CommentString = GetHelpStringByRemoveHashKey(HelpStringObj.HeaderComments +
- HelpStringObj.TailComments)
- HelpTextHeaderObj = CommonObject.TextObject()
- HelpTextHeaderObj.SetString(CommentString)
- LibraryClass.SetHelpTextList([HelpTextHeaderObj])
-
- self.SetLibraryClassList(self.GetLibraryClassList() + [LibraryClass])
-
- ## GenPackages
- #
- # Gen Packages of Inf
- #
- #
- # @param ContainerFile: The Inf file full path
- #
- def _GenPackages(self, Skip):
- Logger.Debug(2, "Generate %s ..." % DT.TAB_PACKAGES)
- #
- # Get all Packages
- #
- PackageObj = self.Parser.InfPackageSection.Packages
-
- #
- # Go through each arch
- #
- for PackageItemObj in PackageObj:
- #
- # Need package information for dependency check usage
- #
- PackageDependency = PackageDependencyObject()
- PackageDependency.SetPackageFilePath(NormPath(PackageItemObj.GetPackageName()))
- PackageDependency.SetSupArchList(ConvertArchList(PackageItemObj.GetSupArchList()))
- PackageDependency.SetFeatureFlag(PackageItemObj.GetFeatureFlagExp())
-
- PkgInfo = GetPkgInfoFromDec(os.path.normpath(os.path.join(self.WorkSpace,
- NormPath(PackageItemObj.GetPackageName()))))
- if PkgInfo[1] and PkgInfo[2]:
- PackageDependency.SetGuid(PkgInfo[1])
- PackageDependency.SetVersion(PkgInfo[2])
- elif Skip:
- continue
- else:
- Logger.Error("\nUPT", PARSER_ERROR,
- ST.ERR_INF_GET_PKG_DEPENDENCY_FAIL % PackageItemObj.GetPackageName(), File=self.FullPath)
-
- PackageDependencyList = self.GetPackageDependencyList()
- PackageDependencyList.append(PackageDependency)
- self.SetPackageDependencyList(PackageDependencyList)
-
- ## GenPcds
- #
- # Gen Pcds of Inf
- # <TokenSpaceGuidCName>.<PcdCName>[|<Value> [|<FFE>]]
- #
- # @param ContainerFile: The Inf file full path
- #
- def _GenPcds(self):
- if not GlobalData.gIS_BINARY_INF:
- Logger.Debug(2, "Generate %s ..." % DT.TAB_PCDS)
-
- #
- # Get all Pcds
- #
- PcdObj = self.Parser.InfPcdSection.Pcds
- KeysList = PcdObj.keys()
-
- #
- # Go through each arch
- #
- for (PcdType, PcdKey) in KeysList:
- PcdData = PcdObj[PcdType, PcdKey]
- for PcdItemObj in PcdData:
- CommentList = PcdItemObj.GetHelpStringList()
- if CommentList:
- for CommentItem in CommentList:
- Pcd = CommonObject.PcdObject()
- Pcd.SetCName(PcdItemObj.GetCName())
- Pcd.SetTokenSpaceGuidCName(PcdItemObj.GetTokenSpaceGuidCName())
- Pcd.SetDefaultValue(PcdItemObj.GetDefaultValue())
- Pcd.SetItemType(PcdType)
- Pcd.SetValidUsage(CommentItem.GetUsageItem())
- Pcd.SetFeatureFlag(PcdItemObj.GetFeatureFlagExp())
- Pcd.SetSupArchList(ConvertArchList(PcdItemObj.GetSupportArchList()))
- HelpTextObj = CommonObject.TextObject()
- HelpTextObj.SetString(CommentItem.GetHelpStringItem())
- Pcd.SetHelpTextList([HelpTextObj])
- PcdList = self.GetPcdList()
- PcdList.append(Pcd)
- self.SetPcdList(PcdList)
-
- ## GenSources
- #
- # Gen Sources of Inf
- # <Filename>[|<Family>[|<TagName>[|<ToolCode>[|<PcdFeatureFlag>]]]]
- #
- # @param ContainerFile: The Inf file full path
- #
- def _GenSources(self):
- Logger.Debug(2, "Generate %s ..." % DT.TAB_SOURCES)
-
- #
- # Get all SourceFiles
- #
- SourceObj = self.Parser.InfSourcesSection.Sources
- DataList = SourceObj.keys()
- #
- # Go through each arch
- #
- SourceList = []
- for Key in DataList:
- SourceData = SourceObj[Key]
- for Item in SourceData:
- SourceFile = Item.GetSourceFileName()
- Family = Item.GetFamily()
- FeatureFlag = Item.GetFeatureFlagExp()
- SupArchList = ConvertArchList(Item.GetSupArchList())
- SupArchList.sort()
- Source = SourceFileObject()
- Source.SetSourceFile(SourceFile)
- Source.SetFamily(Family)
- Source.SetFeatureFlag(FeatureFlag)
- Source.SetSupArchList(SupArchList)
- SourceList.append(Source)
-
- self.SetSourceFileList(self.GetSourceFileList() + SourceList)
-
-
- ## GenUserExtensions
- #
- # Gen UserExtensions of Inf
- #
- def _GenUserExtensions(self):
- #
- # UserExtensions
- #
- UserExtensionObj = self.Parser.InfUserExtensionSection.UserExtension
- Keys = UserExtensionObj.keys()
-
- for Key in Keys:
- UserExtensionData = UserExtensionObj[Key]
- for UserExtensionDataObj in UserExtensionData:
- UserExtension = CommonObject.UserExtensionObject()
- UserId = UserExtensionDataObj.GetUserId()
- if UserId.startswith('"') and UserId.endswith('"'):
- UserId = UserId[1:-1]
- UserExtension.SetUserID(UserId)
- Identifier = UserExtensionDataObj.GetIdString()
- if Identifier.startswith('"') and Identifier.endswith('"'):
- Identifier = Identifier[1:-1]
- UserExtension.SetIdentifier(Identifier)
- UserExtension.SetStatement(UserExtensionDataObj.GetContent())
- UserExtension.SetSupArchList(ConvertArchList(UserExtensionDataObj.GetSupArchList()))
- self.SetUserExtensionList(self.GetUserExtensionList() + [UserExtension])
-
- def _GenDepexesList(self, SmmDepexList, DxeDepexList, PeiDepexList):
- if SmmDepexList:
- self.SetSmmDepex(SmmDepexList)
- if DxeDepexList:
- self.SetDxeDepex(DxeDepexList)
- if PeiDepexList:
- self.SetPeiDepex(PeiDepexList)
-
- ## GenDepexes
- #
- # Gen Depex of Inf
- #
- # @param ContainerFile: The Inf file full path
- #
- def _GenDepexes(self):
- Logger.Debug(2, "Generate %s ..." % DT.TAB_DEPEX)
-
- PEI_LIST = [DT.SUP_MODULE_PEIM]
- SMM_LIST = [DT.SUP_MODULE_DXE_SMM_DRIVER]
- DXE_LIST = [DT.SUP_MODULE_DXE_DRIVER, DT.SUP_MODULE_DXE_SAL_DRIVER,
- DT.SUP_MODULE_DXE_RUNTIME_DRIVER]
-
- IsLibraryClass = self.GetIsLibrary()
- #
- # Get all Depexes
- #
- DepexData = self.Parser.InfDepexSection.GetDepex()
- SmmDepexList = []
- DxeDepexList = []
- PeiDepexList = []
- for Depex in DepexData:
- ModuleType = Depex.GetModuleType()
- ModuleTypeList = []
- if IsLibraryClass:
- if not self.GetIsLibraryModList():
- Logger.Error("\nMkPkg", PARSER_ERROR, ST.ERR_INF_PARSER_DEPEX_SECTION_INVALID_FOR_LIBRARY_CLASS,
- self.GetFullPath(), RaiseError=True)
- if ModuleType and ModuleType not in self.GetIsLibraryModList():
- Logger.Error("\nMkPkg", PARSER_ERROR, ST.ERR_INF_PARSER_DEPEX_SECTION_NOT_DETERMINED,
- self.GetFullPath(), RaiseError=True)
- if ModuleType:
- ModuleTypeList = [ModuleType]
- else:
- for ModuleTypeInList in self.GetIsLibraryModList():
- if ModuleTypeInList in DT.VALID_DEPEX_MODULE_TYPE_LIST:
- ModuleTypeList.append(ModuleTypeInList)
- if not ModuleTypeList:
- Logger.Error("\nMkPkg", PARSER_ERROR, ST.ERR_INF_PARSER_DEPEX_SECTION_NOT_DETERMINED,
- self.GetFullPath(), RaiseError=True)
- else:
- if not ModuleType:
- ModuleType = self.ModuleType
- if ModuleType not in DT.VALID_DEPEX_MODULE_TYPE_LIST:
- Logger.Error("\nMkPkg", PARSER_ERROR,
- ST.ERR_INF_PARSER_DEPEX_SECTION_MODULE_TYPE_ERROR % (ModuleType),
- self.GetFullPath(), RaiseError=True)
- if ModuleType != self.ModuleType:
- Logger.Error("\nMkPkg", PARSER_ERROR, ST.ERR_INF_PARSER_DEPEX_SECTION_NOT_DETERMINED,
- self.GetFullPath(), RaiseError=True)
- ModuleTypeList = [ModuleType]
- for ModuleType in ModuleTypeList:
- DepexIns = DepexObject()
- DepexIns.SetDepex(Depex.GetDepexContent())
- if IsLibraryClass:
- DepexIns.SetModuleType(ModuleType)
- else:
- if Depex.GetModuleType():
- DepexIns.SetModuleType(Depex.GetModuleType())
- DepexIns.SetSupArchList(ConvertArchList([Depex.GetSupArch()]))
- DepexIns.SetFeatureFlag(Depex.GetFeatureFlagExp())
- if Depex.HelpString:
- HelpIns = CommonObject.TextObject()
- HelpIns.SetString(GetHelpStringByRemoveHashKey(Depex.HelpString))
- DepexIns.SetHelpText(HelpIns)
-
- if ModuleType in SMM_LIST:
- SmmDepexList.append(DepexIns)
- if ModuleType in DXE_LIST:
- DxeDepexList.append(DepexIns)
- if ModuleType in PEI_LIST:
- PeiDepexList.append(DepexIns)
- if ModuleType == DT.SUP_MODULE_UEFI_DRIVER:
- if IsLibraryClass:
- DxeDepexList.append(DepexIns)
- else:
- Logger.Error("\nMkPkg", PARSER_ERROR, ST.ERR_INF_PARSER_DEPEX_SECTION_INVALID_FOR_DRIVER,
- self.GetFullPath(), RaiseError=True)
-
- #End of for ModuleType in ModuleTypeList
- self._GenDepexesList(SmmDepexList, DxeDepexList, PeiDepexList)
- #End of for Depex in DepexData
-
- ## GenBinaries
- #
- # Gen Binary of Inf, must be called after Pcd/Library is generated
- # <FileType>|<Filename>|<Target>[|<TokenSpaceGuidCName>.<PcdCName>]
- #
- # @param ContainerFile: The Inf file full path
- #
- def _GenBinaries(self):
- Logger.Debug(2, "Generate %s ..." % DT.TAB_BINARIES)
- BinariesDict = {}
-
- #
- # Get all Binary data
- #
- BinaryObj = self.Parser.InfBinariesSection.GetBinary()
-
- BinaryData = BinaryObj.keys()
-
- #
- # If the INF file does not contain a [Sources] section, and the INF file does contain a [Binaries] section,
- # then the ModuleSurfaceArea.BinaryModule attribute must be set to true. Otherwise, do not use the attribute
- #
- if BinaryObj and not self.Parser.InfSourcesSection.GetSources():
- self.BinaryModule = True
- else:
- self.BinaryModule = False
-
- BinaryFileObjectList = []
- AsBuildLibraryClassList = []
- AsBuildBuildOptionList = []
- AsBuildIns = AsBuiltObject()
- #
- # Library AsBuild Info
- #
- for LibItem in self.Parser.InfLibraryClassSection.GetLibraryClasses():
- AsBuildLibIns = AsBuildLibraryClassObject()
- AsBuildLibIns.SetLibGuid(LibItem.GetFileGuid())
- AsBuildLibIns.SetLibVersion(LibItem.GetVersion())
- AsBuildLibraryClassList.append(AsBuildLibIns)
- AsBuildIns.SetLibraryInstancesList(AsBuildLibraryClassList)
-
- #
- # BuildOption AsBuild Info
- #
- for BuildOptionItem in self.Parser.InfBuildOptionSection.GetBuildOptions():
- AsBuildBuildOptionList += BuildOptionItem.GetAsBuildList()
- AsBuildIns.SetBuildFlagsList(AsBuildBuildOptionList)
-
- #
- # PatchPcd and PcdEx
- #
- AsBuildIns = self._GenAsBuiltPcds(self.Parser.InfPcdSection.GetPcds(), AsBuildIns)
-
- BinariesDict, AsBuildIns, BinaryFileObjectList = GenBinaryData(BinaryData, BinaryObj,
- BinariesDict,
- AsBuildIns,
- BinaryFileObjectList,
- self.GetSupArchList(),
- self.BinaryModule)
-
- BinariesDict2 = {}
- for Key in BinariesDict:
- ValueList = BinariesDict[Key]
- if len(ValueList) > 1:
- BinariesDict2[Key] = ValueList
- else:
- #
- # if there is no TagName, ToolCode, HelpStr,
- # then do not need to put them into userextension
- #
- (Target, Family, TagName, HelpStr) = ValueList[0]
- if not (Target or Family or TagName or HelpStr):
- continue
- else:
- BinariesDict2[Key] = ValueList
-
- self.SetBinaryFileList(self.GetBinaryFileList() + BinaryFileObjectList)
-
- if BinariesDict2:
- UserExtension = CommonObject.UserExtensionObject()
- UserExtension.SetBinariesDict(BinariesDict2)
- UserExtension.SetIdentifier('BinaryFileModifiers')
- UserExtension.SetUserID('EDK2')
- self.SetUserExtensionList(self.GetUserExtensionList() + [UserExtension])
-
- ## GenAsBuiltPcds
- #
- #
- def _GenAsBuiltPcds(self, PcdList, AsBuildIns):
- AsBuildPatchPcdList = []
- AsBuildPcdExList = []
- #
- # Pcd AsBuild Info
- #
- for PcdItem in PcdList:
- if PcdItem[0].upper() == DT.TAB_INF_PATCH_PCD.upper():
- PcdItemObj = PcdItem[1]
- Pcd = CommonObject.PcdObject()
- Pcd.SetCName(PcdItemObj.GetCName())
- Pcd.SetTokenSpaceGuidCName(PcdItemObj.GetTokenSpaceGuidCName())
- if PcdItemObj.GetTokenSpaceGuidValue() == '' and self.BinaryModule:
- Logger.Error("\nMkPkg",
- PARSER_ERROR,
- ST.ERR_ASBUILD_PCD_TOKENSPACE_GUID_VALUE_MISS % \
- (PcdItemObj.GetTokenSpaceGuidCName()),
- self.GetFullPath(), RaiseError=True)
- else:
- Pcd.SetTokenSpaceGuidValue(PcdItemObj.GetTokenSpaceGuidValue())
- if (PcdItemObj.GetToken() == '' or PcdItemObj.GetDatumType() == '') and self.BinaryModule:
- Logger.Error("\nMkPkg",
- PARSER_ERROR,
- ST.ERR_ASBUILD_PCD_DECLARITION_MISS % \
- (PcdItemObj.GetTokenSpaceGuidCName() + '.' + PcdItemObj.GetCName()),
- self.GetFullPath(), RaiseError=True)
- Pcd.SetToken(PcdItemObj.GetToken())
- Pcd.SetDatumType(PcdItemObj.GetDatumType())
- Pcd.SetMaxDatumSize(PcdItemObj.GetMaxDatumSize())
- Pcd.SetDefaultValue(PcdItemObj.GetDefaultValue())
- Pcd.SetOffset(PcdItemObj.GetOffset())
- Pcd.SetItemType(PcdItem[0])
- Pcd.SetFeatureFlag(PcdItemObj.GetFeatureFlagExp())
- Pcd.SetSupArchList(ConvertArchList(PcdItemObj.GetSupportArchList()))
- HelpTextObj = CommonObject.TextObject()
- HelpTextObj.SetString(PcdItemObj.GetHelpStringList())
- Pcd.SetHelpTextList([HelpTextObj])
- AsBuildPatchPcdList.append(Pcd)
- else:
- PcdItemObj = PcdItem[1]
- Pcd = CommonObject.PcdObject()
- Pcd.SetTokenSpaceGuidValue(PcdItemObj.GetTokenSpaceGuidValue())
- Pcd.SetToken(PcdItemObj.GetToken())
- Pcd.SetDatumType(PcdItemObj.GetDatumType())
- Pcd.SetMaxDatumSize(PcdItemObj.GetMaxDatumSize())
- Pcd.SetDefaultValue(PcdItemObj.GetDefaultValue())
- Pcd.SetItemType(PcdItem[0])
- Pcd.SetFeatureFlag(PcdItemObj.GetFeatureFlagExp())
- Pcd.SetSupArchList(ConvertArchList(PcdItemObj.GetSupportArchList()))
- HelpTextObj = CommonObject.TextObject()
- HelpTextObj.SetString(PcdItemObj.GetHelpStringList())
- Pcd.SetHelpTextList([HelpTextObj])
- AsBuildPcdExList.append(Pcd)
- AsBuildIns.SetPatchPcdList(AsBuildPatchPcdList)
- AsBuildIns.SetPcdExList(AsBuildPcdExList)
-
- return AsBuildIns
-
- ## GenGuidProtocolPpis
- #
- # Gen Guids/Protocol/Ppis of INF
- # <CName>=<GuidValue>
- #
- def _GenGuidProtocolPpis(self, Type):
- Logger.Debug(2, "Generate %s ..." % Type)
- #
- # Get all Guid/Protocol/Ppis data
- #
- GuidObj = self.Parser.InfGuidSection.GetGuid()
- ProtocolObj = self.Parser.InfProtocolSection.GetProtocol()
- PpisObj = self.Parser.InfPpiSection.GetPpi()
-
- GuidProtocolPpiList = []
-
- if Type == DT.TAB_GUIDS:
- GuidData = GuidObj.keys()
- for Item in GuidData:
- CommentList = Item.GetCommentList()
- #
- # Depend on CommentList content
- # generate muti-guid-obj
- #
- if CommentList:
- for GuidComentItem in CommentList:
- ListObject = CommonObject.GuidObject()
- ListObject.SetGuidTypeList([GuidComentItem.GetGuidTypeItem()])
- ListObject.SetVariableName(GuidComentItem.GetVariableNameItem())
- ListObject.SetUsage(GuidComentItem.GetUsageItem())
- ListObject.SetName(Item.GetName())
- ListObject.SetCName(Item.GetName())
- ListObject.SetSupArchList(ConvertArchList(Item.GetSupArchList()))
- ListObject.SetFeatureFlag(Item.GetFeatureFlagExp())
- HelpString = GuidComentItem.GetHelpStringItem()
- HelpTxtTailObj = CommonObject.TextObject()
- HelpTxtTailObj.SetString(HelpString)
-
- ListObject.SetHelpTextList([HelpTxtTailObj])
-
- GuidProtocolPpiList.append(ListObject)
- elif Type == DT.TAB_PROTOCOLS:
- ProtocolData = ProtocolObj.keys()
- for Item in ProtocolData:
- CommentList = Item.GetCommentList()
- for CommentItem in CommentList:
- ListObject = CommonObject.ProtocolObject()
- ListObject.SetCName(Item.GetName())
- ListObject.SetSupArchList(ConvertArchList(Item.GetSupArchList()))
- ListObject.SetFeatureFlag(Item.GetFeatureFlagExp())
- ListObject.SetNotify(CommentItem.GetNotify())
- ListObject.SetUsage(CommentItem.GetUsageItem())
- HelpTxtObj = CommonObject.TextObject()
- HelpString = CommentItem.GetHelpStringItem()
- HelpTxtObj.SetString(HelpString)
- ListObject.SetHelpTextList([HelpTxtObj])
- GuidProtocolPpiList.append(ListObject)
- elif Type == DT.TAB_PPIS:
- PpiData = PpisObj.keys()
- for Item in PpiData:
- CommentList = Item.GetCommentList()
- for CommentItem in CommentList:
- ListObject = CommonObject.PpiObject()
- ListObject.SetCName(Item.GetName())
- ListObject.SetSupArchList(ConvertArchList(Item.GetSupArchList()))
- ListObject.SetFeatureFlag(Item.GetFeatureFlagExp())
- ListObject.SetNotify(CommentItem.GetNotify())
- ListObject.SetUsage(CommentItem.GetUsage())
- HelpTextObj = CommonObject.TextObject()
- HelpString = CommentItem.GetHelpStringItem()
- HelpTextObj.SetString(HelpString)
- ListObject.SetHelpTextList([HelpTextObj])
- GuidProtocolPpiList.append(ListObject)
-
- if Type == DT.TAB_GUIDS:
- self.SetGuidList(self.GetGuidList() + GuidProtocolPpiList)
- elif Type == DT.TAB_PROTOCOLS:
- self.SetProtocolList(self.GetProtocolList() + GuidProtocolPpiList)
- elif Type == DT.TAB_PPIS:
- self.SetPpiList(self.GetPpiList() + GuidProtocolPpiList)
-
- ## GenMiscFiles
- #
- # Gen MiscellaneousFiles of Inf
- #
- # @param ContainerFile: The Inf file full path
- #
- def _GenMiscFiles(self, ContainerFile, Skip):
- pass
-
diff --git a/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py b/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py
deleted file mode 100644
index 7369d64672..0000000000
--- a/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py
+++ /dev/null
@@ -1,221 +0,0 @@
-## @file InfPomAlignmentMisc.py
-# This file contained the routines for InfPomAlignment
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-InfPomAlignmentMisc
-'''
-
-##
-# Import modules
-#
-import Logger.Log as Logger
-from Library import DataType as DT
-from Library.Misc import ConvertArchList
-from Object.POM.ModuleObject import BinaryFileObject
-from Object.POM import CommonObject
-
-## GenModuleHeaderUserExt
-#
-#
-def GenModuleHeaderUserExt(DefineObj, ArchString):
- DefinesDictNew = {}
- EdkReleaseVersion = DefineObj.GetEdkReleaseVersion()
- Shadow = DefineObj.GetShadow()
- DpxSource = DefineObj.GetDpxSource()
- PciVendorId = DefineObj.GetPciVendorId()
- PciDeviceId = DefineObj.GetPciDeviceId()
- PciClassCode = DefineObj.GetPciClassCode()
- PciRevision = DefineObj.GetPciRevision()
- PciCompress = DefineObj.GetPciCompress()
- CustomMakefile = DefineObj.GetCustomMakefile()
- UefiHiiResourceSection = DefineObj.GetUefiHiiResourceSection()
-
- if EdkReleaseVersion != None:
- Name = DT.TAB_INF_DEFINES_EDK_RELEASE_VERSION
- Value = EdkReleaseVersion.GetValue()
- Statement = _GenInfDefineStateMent(EdkReleaseVersion.Comments.GetHeaderComments(),
- Name,
- Value,
- EdkReleaseVersion.Comments.GetTailComments())
- DefinesDictNew[Statement] = ArchString
-
- if Shadow != None:
- Name = DT.TAB_INF_DEFINES_SHADOW
- Value = Shadow.GetValue()
- Statement = _GenInfDefineStateMent(Shadow.Comments.GetHeaderComments(),
- Name,
- Value,
- Shadow.Comments.GetTailComments())
- DefinesDictNew[Statement] = ArchString
-
- if DpxSource != None:
- Name = DT.TAB_INF_DEFINES_DPX_SOURCE
- for DpxSourceItem in DpxSource:
- Value = DpxSourceItem[0]
- Statement = _GenInfDefineStateMent(DpxSourceItem[1].GetHeaderComments(),
- Name,
- Value,
- DpxSourceItem[1].GetTailComments())
- DefinesDictNew[Statement] = ArchString
-
- if PciVendorId != None:
- Name = DT.TAB_INF_DEFINES_PCI_VENDOR_ID
- Value = PciVendorId.GetValue()
- Statement = _GenInfDefineStateMent(PciVendorId.Comments.GetHeaderComments(),
- Name,
- Value,
- PciVendorId.Comments.GetTailComments())
- DefinesDictNew[Statement] = ArchString
-
- if PciDeviceId != None:
- Name = DT.TAB_INF_DEFINES_PCI_DEVICE_ID
- Value = PciDeviceId.GetValue()
- Statement = _GenInfDefineStateMent(PciDeviceId.Comments.GetHeaderComments(),
- Name,
- Value,
- PciDeviceId.Comments.GetTailComments())
- DefinesDictNew[Statement] = ArchString
-
- if PciClassCode != None:
- Name = DT.TAB_INF_DEFINES_PCI_CLASS_CODE
- Value = PciClassCode.GetValue()
- Statement = _GenInfDefineStateMent(PciClassCode.Comments.GetHeaderComments(),
- Name,
- Value,
- PciClassCode.Comments.GetTailComments())
- DefinesDictNew[Statement] = ArchString
-
- if PciRevision != None:
- Name = DT.TAB_INF_DEFINES_PCI_REVISION
- Value = PciRevision.GetValue()
- Statement = _GenInfDefineStateMent(PciRevision.Comments.GetHeaderComments(),
- Name,
- Value,
- PciRevision.Comments.GetTailComments())
- DefinesDictNew[Statement] = ArchString
-
- if PciCompress != None:
- Name = DT.TAB_INF_DEFINES_PCI_COMPRESS
- Value = PciCompress.GetValue()
- Statement = _GenInfDefineStateMent(PciCompress.Comments.GetHeaderComments(),
- Name,
- Value,
- PciCompress.Comments.GetTailComments())
- DefinesDictNew[Statement] = ArchString
-
- if len(CustomMakefile) >= 1:
- for CustomMakefileItem in CustomMakefile:
- Name = DT.TAB_INF_DEFINES_CUSTOM_MAKEFILE
- #
- # Not with Feature Flag Expression
- #
- if len(CustomMakefileItem) == 3:
- if CustomMakefileItem[0] != '':
- Value = CustomMakefileItem[0] + ' | ' + CustomMakefileItem[1]
- else:
- Value = CustomMakefileItem[1]
-
- Comments = CustomMakefileItem[2]
- Statement = _GenInfDefineStateMent(Comments.GetHeaderComments(),
- Name,
- Value,
- Comments.GetTailComments())
-
- DefinesDictNew[Statement] = ArchString
-
- if UefiHiiResourceSection != None:
- Name = DT.TAB_INF_DEFINES_UEFI_HII_RESOURCE_SECTION
- Value = UefiHiiResourceSection.GetValue()
- HeaderComment = UefiHiiResourceSection.Comments.GetHeaderComments()
- TailComment = UefiHiiResourceSection.Comments.GetTailComments()
- Statement = _GenInfDefineStateMent(HeaderComment,
- Name,
- Value,
- TailComment)
- DefinesDictNew[Statement] = ""
-
- return DefinesDictNew
-
-
-## Generate the define statement that will be put into userextension
-# Not support comments.
-#
-# @param HeaderComment: the original header comment (# not remvoed)
-# @param Name: the definition keyword, should not be empty or none
-# @param Value: the definition keyword value
-# @param TailComment: the original Tail comment (# not remvoed)
-#
-# @return: the regenerated define statement
-#
-def _GenInfDefineStateMent(HeaderComment, Name, Value, TailComment):
- Logger.Debug(5, HeaderComment + TailComment)
- Statement = '%s = %s' % (Name, Value)
-
- return Statement
-
-## GenBinaryData
-#
-#
-def GenBinaryData(BinaryData, BinaryObj, BinariesDict, AsBuildIns, BinaryFileObjectList, SupArchList, BinaryModule):
- if BinaryModule:
- pass
- OriSupArchList = SupArchList
- for Item in BinaryData:
- ItemObj = BinaryObj[Item][0][0]
- if ItemObj.GetType() not in DT.BINARY_FILE_TYPE_UI_LIST + DT.BINARY_FILE_TYPE_VER_LIST:
- TagName = ItemObj.GetTagName()
- Family = ItemObj.GetFamily()
- else:
- TagName = ''
- Family = ''
- FFE = ItemObj.GetFeatureFlagExp()
-
- #
- # If have architecturie specified, then use the specified architecturie;
- # If the section tag does not have an architecture modifier or the modifier is "common" (case in-sensitive),
- # and the VALID_ARCHITECTURES comment exists, the list from the VALID_ARCHITECTURES comment
- # can be used for the attribute.
- # If both not have VALID_ARCHITECTURE comment and no architecturie specified, then keep it empty.
- #
- SupArchList = ConvertArchList(ItemObj.GetSupArchList())
- SupArchList.sort()
- if len(SupArchList) == 1 and SupArchList[0] == 'COMMON':
- if not (len(OriSupArchList) == 1 or OriSupArchList[0] == 'COMMON'):
- SupArchList = OriSupArchList
- else:
- SupArchList = ['COMMON']
-
- FileNameObj = CommonObject.FileNameObject()
- FileNameObj.SetFileType(ItemObj.GetType())
- FileNameObj.SetFilename(ItemObj.GetFileName())
- FileNameObj.SetFeatureFlag(FFE)
- FileNameObj.SetSupArchList(SupArchList)
- FileNameList = [FileNameObj]
-
- BinaryFile = BinaryFileObject()
- BinaryFile.SetFileNameList(FileNameList)
- BinaryFile.SetAsBuiltList(AsBuildIns)
- BinaryFileObjectList.append(BinaryFile)
-
- SupArchStr = ' '.join(SupArchList)
- Key = (ItemObj.GetFileName(), ItemObj.GetType(), FFE, SupArchStr)
- ValueItem = (ItemObj.GetTarget(), Family, TagName, '')
- if Key in BinariesDict:
- ValueList = BinariesDict[Key]
- ValueList.append(ValueItem)
- BinariesDict[Key] = ValueList
- else:
- BinariesDict[Key] = [ValueItem]
-
- return BinariesDict, AsBuildIns, BinaryFileObjectList
diff --git a/BaseTools/Source/Python/UPT/PomAdapter/__init__.py b/BaseTools/Source/Python/UPT/PomAdapter/__init__.py
deleted file mode 100644
index e477b97baa..0000000000
--- a/BaseTools/Source/Python/UPT/PomAdapter/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Parser' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-PomAdapter
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/RmPkg.py b/BaseTools/Source/Python/UPT/RmPkg.py
deleted file mode 100644
index 3817812168..0000000000
--- a/BaseTools/Source/Python/UPT/RmPkg.py
+++ /dev/null
@@ -1,246 +0,0 @@
-## @file
-# Install distribution package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-RmPkg
-'''
-
-##
-# Import Modules
-#
-import os.path
-from stat import S_IWUSR
-from traceback import format_exc
-from platform import python_version
-import md5
-from sys import stdin
-from sys import platform
-
-from Core.DependencyRules import DependencyRules
-from Library.Misc import CheckEnvVariable
-from Library import GlobalData
-from Logger import StringTable as ST
-import Logger.Log as Logger
-from Logger.ToolError import OPTION_MISSING
-from Logger.ToolError import UNKNOWN_ERROR
-from Logger.ToolError import ABORT_ERROR
-from Logger.ToolError import CODE_ERROR
-from Logger.ToolError import FatalError
-
-
-## CheckDpDepex
-#
-# Check if the Depex is satisfied
-# @param Dep: Dep
-# @param Guid: Guid of Dp
-# @param Version: Version of Dp
-# @param WorkspaceDir: Workspace Dir
-#
-def CheckDpDepex(Dep, Guid, Version, WorkspaceDir):
- (Removable, DependModuleList) = Dep.CheckDpDepexForRemove(Guid, Version)
- if not Removable:
- Logger.Info(ST.MSG_CONFIRM_REMOVE)
- Logger.Info(ST.MSG_USER_DELETE_OP)
- Input = stdin.readline()
- Input = Input.replace('\r', '').replace('\n', '')
- if Input.upper() != 'Y':
- Logger.Error("RmPkg", UNKNOWN_ERROR, ST.ERR_USER_INTERRUPT)
- return 1
- else:
- #
- # report list of modules that are not valid due to force
- # remove,
- # also generate a log file for reference
- #
- Logger.Info(ST.MSG_INVALID_MODULE_INTRODUCED)
- LogFilePath = os.path.normpath(os.path.join(WorkspaceDir, GlobalData.gINVALID_MODULE_FILE))
- Logger.Info(ST.MSG_CHECK_LOG_FILE % LogFilePath)
- try:
- LogFile = open(LogFilePath, 'w')
- try:
- for ModulePath in DependModuleList:
- LogFile.write("%s\n"%ModulePath)
- Logger.Info(ModulePath)
- except IOError:
- Logger.Warn("\nRmPkg", ST.ERR_FILE_WRITE_FAILURE,
- File=LogFilePath)
- except IOError:
- Logger.Warn("\nRmPkg", ST.ERR_FILE_OPEN_FAILURE,
- File=LogFilePath)
- finally:
- LogFile.close()
-
-## Remove Path
-#
-# removing readonly file on windows will get "Access is denied"
-# error, so before removing, change the mode to be writeable
-#
-# @param Path: The Path to be removed
-#
-def RemovePath(Path):
- Logger.Info(ST.MSG_REMOVE_FILE % Path)
- if not os.access(Path, os.W_OK):
- os.chmod(Path, S_IWUSR)
- os.remove(Path)
- try:
- os.removedirs(os.path.split(Path)[0])
- except OSError:
- pass
-## GetCurrentFileList
-#
-# @param DataBase: DataBase of UPT
-# @param Guid: Guid of Dp
-# @param Version: Version of Dp
-# @param WorkspaceDir: Workspace Dir
-#
-def GetCurrentFileList(DataBase, Guid, Version, WorkspaceDir):
- NewFileList = []
- for Dir in DataBase.GetDpInstallDirList(Guid, Version):
- RootDir = os.path.normpath(os.path.join(WorkspaceDir, Dir))
- for Root, Dirs, Files in os.walk(RootDir):
- Logger.Debug(0, Dirs)
- for File in Files:
- FilePath = os.path.join(Root, File)
- if FilePath not in NewFileList:
- NewFileList.append(FilePath)
- return NewFileList
-
-
-## Tool entrance method
-#
-# This method mainly dispatch specific methods per the command line options.
-# If no error found, return zero value so the caller of this tool can know
-# if it's executed successfully or not.
-#
-# @param Options: command option
-#
-def Main(Options = None):
-
- try:
- DataBase = GlobalData.gDB
- if not Options.DistributionFile:
- Logger.Error("RmPkg",
- OPTION_MISSING,
- ExtraData=ST.ERR_SPECIFY_PACKAGE)
- CheckEnvVariable()
- WorkspaceDir = GlobalData.gWORKSPACE
- #
- # Prepare check dependency
- #
- Dep = DependencyRules(DataBase)
-
- if Options.DistributionFile:
- (Guid, Version, NewDpFileName) = \
- DataBase.GetDpByName(os.path.split(Options.DistributionFile)[1])
- if not Guid:
- Logger.Error("RmPkg", UNKNOWN_ERROR, ST.ERR_PACKAGE_NOT_INSTALLED % Options.DistributionFile)
- else:
- Guid = Options.PackageGuid
- Version = Options.PackageVersion
- #
- # Check Dp existing
- #
- if not Dep.CheckDpExists(Guid, Version):
- Logger.Error("RmPkg", UNKNOWN_ERROR, ST.ERR_DISTRIBUTION_NOT_INSTALLED)
- #
- # Check for Distribution files existence in /conf/upt, if not exist,
- # Warn user and go on.
- #
- StoredDistFile = os.path.normpath(os.path.join(WorkspaceDir, GlobalData.gUPT_DIR, NewDpFileName))
- if not os.path.isfile(StoredDistFile):
- Logger.Warn("RmPkg", ST.WRN_DIST_NOT_FOUND%StoredDistFile)
- StoredDistFile = None
-
- #
- # Check Dp depex
- #
- CheckDpDepex(Dep, Guid, Version, WorkspaceDir)
-
- #
- # Get Current File List
- #
- NewFileList = GetCurrentFileList(DataBase, Guid, Version, WorkspaceDir)
-
- #
- # Remove all files
- #
- MissingFileList = []
- for (Path, Md5Sum) in DataBase.GetDpFileList(Guid, Version):
- if os.path.isfile(Path):
- if Path in NewFileList:
- NewFileList.remove(Path)
- if not Options.Yes:
- #
- # check whether modified by users
- #
- Md5Sigature = md5.new(open(str(Path), 'rb').read())
- if Md5Sum != Md5Sigature.hexdigest():
- Logger.Info(ST.MSG_CONFIRM_REMOVE2 % Path)
- Input = stdin.readline()
- Input = Input.replace('\r', '').replace('\n', '')
- if Input.upper() != 'Y':
- continue
- RemovePath(Path)
- else:
- MissingFileList.append(Path)
-
- for Path in NewFileList:
- if os.path.isfile(Path):
- if (not Options.Yes) and (not os.path.split(Path)[1].startswith('.')):
- Logger.Info(ST.MSG_CONFIRM_REMOVE3 % Path)
- Input = stdin.readline()
- Input = Input.replace('\r', '').replace('\n', '')
- if Input.upper() != 'Y':
- continue
- RemovePath(Path)
-
- #
- # Remove distribution files in /Conf/.upt
- #
- if StoredDistFile is not None:
- os.remove(StoredDistFile)
-
- #
- # update database
- #
- Logger.Quiet(ST.MSG_UPDATE_PACKAGE_DATABASE)
- DataBase.RemoveDpObj(Guid, Version)
- Logger.Quiet(ST.MSG_FINISH)
-
- ReturnCode = 0
-
- except FatalError, XExcept:
- ReturnCode = XExcept.args[0]
- if Logger.GetLevel() <= Logger.DEBUG_9:
- Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + \
- format_exc())
- except KeyboardInterrupt:
- ReturnCode = ABORT_ERROR
- if Logger.GetLevel() <= Logger.DEBUG_9:
- Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + \
- format_exc())
- except:
- Logger.Error(
- "\nRmPkg",
- CODE_ERROR,
- ST.ERR_UNKNOWN_FATAL_REMOVING_ERR,
- ExtraData=ST.MSG_SEARCH_FOR_HELP,
- RaiseError=False
- )
- Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + \
- format_exc())
- ReturnCode = CODE_ERROR
- return ReturnCode
-
-
diff --git a/BaseTools/Source/Python/UPT/UPT.py b/BaseTools/Source/Python/UPT/UPT.py
deleted file mode 100644
index b168a51daa..0000000000
--- a/BaseTools/Source/Python/UPT/UPT.py
+++ /dev/null
@@ -1,239 +0,0 @@
-## @file
-#
-# This file is the main entry for UPT
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-UPT
-'''
-
-## import modules
-#
-import sys
-import os.path
-from os import environ
-from sys import platform
-from optparse import OptionParser
-from traceback import format_exc
-from platform import python_version
-
-from Logger import StringTable as ST
-import Logger.Log as Logger
-from Logger.StringTable import MSG_VERSION
-from Logger.StringTable import MSG_DESCRIPTION
-from Logger.StringTable import MSG_USAGE
-from Logger.ToolError import FILE_NOT_FOUND
-from Logger.ToolError import OPTION_MISSING
-from Logger.ToolError import FILE_TYPE_MISMATCH
-from Logger.ToolError import OPTION_CONFLICT
-from Logger.ToolError import FatalError
-import MkPkg
-import InstallPkg
-import RmPkg
-from Library.Misc import CheckEnvVariable
-from Library import GlobalData
-from Core.IpiDb import IpiDatabase
-from BuildVersion import gBUILD_VERSION
-
-##
-# Version and Copyright
-#
-#VersionNumber = "1.0"
-#__version__ = "Revision " + VersionNumber
-#__copyright__ = "Copyright (c) 2011 Intel Corporation All Rights Reserved."
-
-## CheckConflictOption
-#
-# CheckConflictOption
-#
-def CheckConflictOption(Opt):
- if (Opt.PackFileToCreate and Opt.PackFileToInstall and Opt.PackFileToRemove):
- Logger.Error("UPT", OPTION_CONFLICT, ExtraData=ST.ERR_REQUIRE_I_C_R_OPTION)
- elif Opt.PackFileToCreate and Opt.PackFileToInstall:
- Logger.Error("UPT", OPTION_CONFLICT, ExtraData=ST.ERR_I_C_EXCLUSIVE)
- elif Opt.PackFileToInstall and Opt.PackFileToRemove:
- Logger.Error("UPT", OPTION_CONFLICT, ExtraData=ST.ERR_I_R_EXCLUSIVE)
- elif Opt.PackFileToCreate and Opt.PackFileToRemove:
- Logger.Error("UPT", OPTION_CONFLICT, ExtraData=ST.ERR_C_R_EXCLUSIVE)
-
-## SetLogLevel
-#
-def SetLogLevel(Opt):
- if Opt.opt_verbose:
- Logger.SetLevel(Logger.VERBOSE)
- elif Opt.opt_quiet:
- Logger.SetLevel(Logger.QUIET + 1)
- elif Opt.debug_level != None:
- if Opt.debug_level < 0 or Opt.debug_level > 9:
- Logger.Warn("UPT", ST.ERR_DEBUG_LEVEL)
- Logger.SetLevel(Logger.INFO)
- else:
- Logger.SetLevel(Opt.debug_level + 1)
- elif Opt.opt_slient:
- Logger.SetLevel(Logger.SILENT)
- else:
- Logger.SetLevel(Logger.INFO)
-
-## Main
-#
-# Main
-#
-def Main():
- Logger.Initialize()
-
- Parser = OptionParser(version=(MSG_VERSION + ' ' + gBUILD_VERSION), description=MSG_DESCRIPTION,
- prog="UPT.exe", usage=MSG_USAGE)
-
- Parser.add_option("-d", "--debug", action="store", type="int", dest="debug_level", help=ST.HLP_PRINT_DEBUG_INFO)
-
- Parser.add_option("-v", "--verbose", action="store_true", dest="opt_verbose",
- help=ST.HLP_PRINT_INFORMATIONAL_STATEMENT)
-
- Parser.add_option("-s", "--silent", action="store_true", dest="opt_slient", help=ST.HLP_RETURN_NO_DISPLAY)
-
- Parser.add_option("-q", "--quiet", action="store_true", dest="opt_quiet", help=ST.HLP_RETURN_AND_DISPLAY)
-
- Parser.add_option("-i", "--install", action="store", type="string", dest="Install_Distribution_Package_File",
- help=ST.HLP_SPECIFY_PACKAGE_NAME_INSTALL)
-
- Parser.add_option("-c", "--create", action="store", type="string", dest="Create_Distribution_Package_File",
- help=ST.HLP_SPECIFY_PACKAGE_NAME_CREATE)
-
- Parser.add_option("-r", "--remove", action="store", type="string", dest="Remove_Distribution_Package_File",
- help=ST.HLP_SPECIFY_PACKAGE_NAME_REMOVE)
-
- Parser.add_option("-t", "--template", action="store", type="string", dest="Package_Information_Data_File",
- help=ST.HLP_SPECIFY_TEMPLATE_NAME_CREATE)
-
- Parser.add_option("-p", "--dec-filename", action="append", type="string", dest="EDK2_DEC_Filename",
- help=ST.HLP_SPECIFY_DEC_NAME_CREATE)
-
- Parser.add_option("-m", "--inf-filename", action="append", type="string", dest="EDK2_INF_Filename",
- help=ST.HLP_SPECIFY_INF_NAME_CREATE)
-
- Parser.add_option("-f", "--force", action="store_true", dest="Yes", help=ST.HLP_DISABLE_PROMPT)
-
- Parser.add_option("-n", "--custom-path", action="store_true", dest="CustomPath", help=ST.HLP_CUSTOM_PATH_PROMPT)
-
- Parser.add_option("-x", "--free-lock", action="store_true", dest="SkipLock", help=ST.HLP_SKIP_LOCK_CHECK)
-
- Opt = Parser.parse_args()[0]
-
- Var2Var = [
- ("PackageInformationDataFile", Opt.Package_Information_Data_File),
- ("PackFileToInstall", Opt.Install_Distribution_Package_File),
- ("PackFileToCreate", Opt.Create_Distribution_Package_File),
- ("PackFileToRemove", Opt.Remove_Distribution_Package_File),
- ("PackageFileList", Opt.EDK2_DEC_Filename),
- ("ModuleFileList", Opt.EDK2_INF_Filename)
- ]
- for Var in Var2Var:
- setattr(Opt, Var[0], Var[1])
-
- try:
- CheckEnvVariable()
- except FatalError, XExcept:
- if Logger.GetLevel() <= Logger.DEBUG_9:
- Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + format_exc())
- return XExcept.args[0]
-
- GlobalData.gWORKSPACE = os.path.normpath(environ["WORKSPACE"])
- WorkspaceDir = GlobalData.gWORKSPACE
-
- SetLogLevel(Opt)
-
- GlobalData.gDB = IpiDatabase(os.path.normpath(os.path.join(WorkspaceDir, "Conf/DistributionPackageDatabase.db")))
- GlobalData.gDB.InitDatabase(Opt.SkipLock)
-
- #
- # Make sure the Db will get closed correctly
- #
- try:
- ReturnCode = 0
- CheckConflictOption(Opt)
-
- RunModule = None
- if Opt.PackFileToCreate:
- if Opt.PackageInformationDataFile:
- if not os.path.exists(Opt.PackageInformationDataFile):
- if not os.path.exists(os.path.join(WorkspaceDir, Opt.PackageInformationDataFile)):
- Logger.Error("\nUPT", FILE_NOT_FOUND, ST.ERR_NO_TEMPLATE_FILE % Opt.PackageInformationDataFile)
- else:
- Opt.PackageInformationDataFile = os.path.join(WorkspaceDir, Opt.PackageInformationDataFile)
- else:
- Logger.Error("UPT", OPTION_MISSING, ExtraData=ST.ERR_REQUIRE_T_OPTION)
- if not Opt.PackFileToCreate.endswith('.dist'):
- Logger.Error("CreatePkg", FILE_TYPE_MISMATCH, ExtraData=ST.ERR_DIST_EXT_ERROR % Opt.PackFileToCreate)
- RunModule = MkPkg.Main
-
- elif Opt.PackFileToInstall:
- if not Opt.PackFileToInstall.endswith('.dist'):
- Logger.Error("InstallPkg", FILE_TYPE_MISMATCH, ExtraData=ST.ERR_DIST_EXT_ERROR % Opt.PackFileToInstall)
-
- #
- # check file existence, if not absolute path, then try current working directory, then $(WORKSPACE)
- #
- Existed = True
- if os.path.isabs(Opt.PackFileToInstall):
- if not (os.path.exists(Opt.PackFileToInstall) and os.path.isfile(Opt.PackFileToInstall)):
- Existed = False
- else:
- AbsPath = os.path.normpath(os.path.join(os.getcwd(), Opt.PackFileToInstall))
- if not (os.path.exists(AbsPath) and os.path.isfile(AbsPath)):
- AbsPath = os.path.normpath(os.path.join(WorkspaceDir, Opt.PackFileToInstall))
- if not (os.path.exists(AbsPath) and os.path.isfile(AbsPath)):
- Existed = False
-
- if Existed:
- Opt.PackFileToInstall = AbsPath
-
- if not Existed:
- Logger.Error("InstallPkg", FILE_NOT_FOUND, ST.ERR_INSTALL_DIST_NOT_FOUND % Opt.PackFileToInstall)
-
- setattr(Opt, 'PackageFile', Opt.PackFileToInstall)
- RunModule = InstallPkg.Main
-
- elif Opt.PackFileToRemove:
- if not Opt.PackFileToRemove.endswith('.dist'):
- Logger.Error("RemovePkg", FILE_TYPE_MISMATCH, ExtraData=ST.ERR_DIST_EXT_ERROR % Opt.PackFileToRemove)
- head, tail = os.path.split(Opt.PackFileToRemove)
- if head or not tail:
- Logger.Error("RemovePkg",
- FILE_TYPE_MISMATCH,
- ExtraData=ST.ERR_DIST_FILENAME_ONLY_FOR_REMOVE % Opt.PackFileToRemove)
-
- setattr(Opt, 'DistributionFile', Opt.PackFileToRemove)
- RunModule = RmPkg.Main
- else:
- Parser.print_usage()
- return OPTION_MISSING
-
- ReturnCode = RunModule(Opt)
- except FatalError, XExcept:
- ReturnCode = XExcept.args[0]
- if Logger.GetLevel() <= Logger.DEBUG_9:
- Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + \
- format_exc())
- finally:
- GlobalData.gDB.CloseDb()
-
- return ReturnCode
-
-if __name__ == '__main__':
- RETVAL = Main()
- #
- # 0-127 is a safe return range, and 1 is a standard default error
- #
- if RETVAL < 0 or RETVAL > 127:
- RETVAL = 1
- sys.exit(RETVAL)
diff --git a/BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py b/BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py
deleted file mode 100644
index 72a909db0e..0000000000
--- a/BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py
+++ /dev/null
@@ -1,1419 +0,0 @@
-## @file
-# This file contain unit test for CommentParsing
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-import os
-import unittest
-
-import Logger.Log as Logger
-from GenMetaFile.GenInfFile import GenGuidSections
-from GenMetaFile.GenInfFile import GenProtocolPPiSections
-from GenMetaFile.GenInfFile import GenPcdSections
-from GenMetaFile.GenInfFile import GenSpecialSections
-from Library.CommentGenerating import GenGenericCommentF
-from Library.CommentGenerating import _GetHelpStr
-from Object.POM.CommonObject import TextObject
-from Object.POM.CommonObject import GuidObject
-from Object.POM.CommonObject import ProtocolObject
-from Object.POM.CommonObject import PpiObject
-from Object.POM.CommonObject import PcdObject
-from Object.POM.ModuleObject import HobObject
-
-from Library.String import GetSplitValueList
-from Library.DataType import TAB_SPACE_SPLIT
-from Library.DataType import LANGUAGE_EN_US
-from Library.DataType import ITEM_UNDEFINED
-from Library.DataType import TAB_INF_FEATURE_PCD
-from Library import GlobalData
-from Library.Misc import CreateDirectory
-
-#
-# Test _GetHelpStr
-#
-class _GetHelpStrTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- #
- # Normal case1: have one help text object with Lang = 'en-US'
- #
- def testNormalCase1(self):
- HelpStr = 'Hello world'
- HelpTextObj = TextObject()
- HelpTextObj.SetLang(LANGUAGE_EN_US)
- HelpTextObj.SetString(HelpStr)
-
- HelpTextList = [HelpTextObj]
- Result = _GetHelpStr(HelpTextList)
- self.assertEqual(Result, HelpStr)
-
- #
- # Normal case2: have two help text object with Lang = 'en-US' and other
- #
- def testNormalCase2(self):
- HelpStr = 'Hello world'
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('eng')
- HelpTextObj.SetString(HelpStr)
-
- HelpTextList = [HelpTextObj]
-
- ExpectedStr = 'Hello world1'
- HelpTextObj = TextObject()
- HelpTextObj.SetLang(LANGUAGE_EN_US)
- HelpTextObj.SetString(ExpectedStr)
-
- HelpTextList.append(HelpTextObj)
-
- Result = _GetHelpStr(HelpTextList)
- self.assertEqual(Result, ExpectedStr)
-
- #
- # Normal case3: have two help text object with Lang = '' and 'eng'
- #
- def testNormalCase3(self):
- HelpStr = 'Hello world'
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('')
- HelpTextObj.SetString(HelpStr)
-
- HelpTextList = [HelpTextObj]
-
- ExpectedStr = 'Hello world1'
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('eng')
- HelpTextObj.SetString(ExpectedStr)
-
- HelpTextList.append(HelpTextObj)
-
- Result = _GetHelpStr(HelpTextList)
- self.assertEqual(Result, ExpectedStr)
-
- #
- # Normal case4: have two help text object with Lang = '' and ''
- #
- def testNormalCase4(self):
-
- ExpectedStr = 'Hello world1'
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('eng')
- HelpTextObj.SetString(ExpectedStr)
- HelpTextList = [HelpTextObj]
-
- HelpStr = 'Hello world'
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('')
- HelpTextObj.SetString(HelpStr)
- HelpTextList.append(HelpTextObj)
-
- Result = _GetHelpStr(HelpTextList)
- self.assertEqual(Result, ExpectedStr)
-
- #
- # Normal case: have three help text object with Lang = '','en', 'en-US'
- #
- def testNormalCase5(self):
-
- ExpectedStr = 'Hello world1'
- HelpTextObj = TextObject()
- HelpTextObj.SetLang(LANGUAGE_EN_US)
- HelpTextObj.SetString(ExpectedStr)
- HelpTextList = [HelpTextObj]
-
- HelpStr = 'Hello unknown world'
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('')
- HelpTextObj.SetString(HelpStr)
- HelpTextList.append(HelpTextObj)
-
- HelpStr = 'Hello mysterious world'
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('')
- HelpTextObj.SetString(HelpStr)
- HelpTextList.append(HelpTextObj)
-
- Result = _GetHelpStr(HelpTextList)
- self.assertEqual(Result, ExpectedStr)
-
- HelpTextList.sort()
- self.assertEqual(Result, ExpectedStr)
-
- HelpTextList.sort(reverse=True)
- self.assertEqual(Result, ExpectedStr)
-
-
-#
-# Test GenGuidSections
-#
-class GenGuidSectionsTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- #
- # This is the API to generate Guid Object to help UnitTest
- #
- def GuidFactory(self, CName, FFE, Usage, GuidType, VariableName, HelpStr):
- Guid = GuidObject()
- Guid.SetCName(CName)
- Guid.SetFeatureFlag(FFE)
- Guid.SetGuidTypeList([GuidType])
- Guid.SetUsage(Usage)
- Guid.SetVariableName(VariableName)
-
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('')
- HelpTextObj.SetString(HelpStr)
- Guid.SetHelpTextList([HelpTextObj])
-
- return Guid
-
- #
- # Normal case: have two GuidObject
- #
- def testNormalCase1(self):
- GuidList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'PRODUCES'
- GuidType = 'Event'
- VariableName = ''
- HelpStr = 'Usage comment line 1'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'CONSUMES'
- GuidType = 'Variable'
- VariableName = ''
- HelpStr = 'Usage comment line 2'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- Result = GenGuidSections(GuidList)
- Expected = '''[Guids]
-## PRODUCES ## Event # Usage comment line 1
-## CONSUMES ## Variable: # Usage comment line 2
-Guid1|FFE1'''
- self.assertEqual(Result.strip(), Expected)
-
- #
- # Normal case: have two GuidObject
- #
- def testNormalCase2(self):
- GuidList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'PRODUCES'
- GuidType = 'Event'
- VariableName = ''
- HelpStr = 'Usage comment line 1'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'UNDEFINED'
- GuidType = 'UNDEFINED'
- VariableName = ''
- HelpStr = 'Generic comment line 1\n Generic comment line 2'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- Result = GenGuidSections(GuidList)
- Expected = '''[Guids]
-## PRODUCES ## Event # Usage comment line 1
-# Generic comment line 1
-# Generic comment line 2
-Guid1|FFE1'''
-
- self.assertEqual(Result.strip(), Expected)
-
- #
- # Normal case: have two GuidObject, one help goes to generic help,
- # the other go into usage comment
- #
- def testNormalCase3(self):
- GuidList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'UNDEFINED'
- GuidType = 'UNDEFINED'
- VariableName = ''
- HelpStr = 'Generic comment'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'PRODUCES'
- GuidType = 'Event'
- VariableName = ''
- HelpStr = 'Usage comment line 1'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- Result = GenGuidSections(GuidList)
- Expected = '''[Guids]
-# Generic comment
-## PRODUCES ## Event # Usage comment line 1
-Guid1|FFE1'''
-
- self.assertEqual(Result.strip(), Expected)
-
- #
- # Normal case: have one GuidObject, generic comment multiple lines
- #
- def testNormalCase5(self):
- GuidList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'UNDEFINED'
- GuidType = 'UNDEFINED'
- VariableName = ''
- HelpStr = 'Generic comment line1 \n generic comment line 2'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- Result = GenGuidSections(GuidList)
- Expected = '''[Guids]
-# Generic comment line1
-# generic comment line 2
-Guid1|FFE1'''
-
- self.assertEqual(Result.strip(), Expected)
-
- #
- # Normal case: have one GuidObject, usage comment multiple lines
- #
- def testNormalCase6(self):
- GuidList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'PRODUCES'
- GuidType = 'Event'
- VariableName = ''
- HelpStr = 'Usage comment line 1\n Usage comment line 2'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- Result = GenGuidSections(GuidList)
- Expected = '''[Guids]
-Guid1|FFE1 ## PRODUCES ## Event # Usage comment line 1 Usage comment line 2
-'''
- self.assertEqual(Result.strip(), Expected.strip())
-
- #
- # Normal case: have one GuidObject, usage comment one line
- #
- def testNormalCase7(self):
- GuidList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'UNDEFINED'
- GuidType = 'UNDEFINED'
- VariableName = ''
- HelpStr = 'Usage comment line 1'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- Result = GenGuidSections(GuidList)
- Expected = '''[Guids]
-Guid1|FFE1 # Usage comment line 1
-'''
- self.assertEqual(Result.strip(), Expected.strip())
-
- #
- # Normal case: have two GuidObject
- #
- def testNormalCase8(self):
- GuidList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'PRODUCES'
- GuidType = 'Event'
- VariableName = ''
- HelpStr = 'Usage comment line 1\n Usage comment line 2'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'PRODUCES'
- GuidType = 'Event'
- VariableName = ''
- HelpStr = 'Usage comment line 3'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- Result = GenGuidSections(GuidList)
- Expected = '''[Guids]
-## PRODUCES ## Event # Usage comment line 1 Usage comment line 2
-## PRODUCES ## Event # Usage comment line 3
-Guid1|FFE1
-'''
- self.assertEqual(Result.strip(), Expected.strip())
-
- #
- # Normal case: have no GuidObject
- #
- def testNormalCase9(self):
- GuidList = []
-
- Result = GenGuidSections(GuidList)
- Expected = ''
- self.assertEqual(Result.strip(), Expected.strip())
-
- #
- # Normal case: have one GuidObject with no comment generated
- #
- def testNormalCase10(self):
- GuidList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'UNDEFINED'
- GuidType = 'UNDEFINED'
- VariableName = ''
- HelpStr = ''
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- Result = GenGuidSections(GuidList)
- Expected = '''[Guids]
-Guid1|FFE1
-'''
- self.assertEqual(Result.strip(), Expected.strip())
-
- #
- # Normal case: have three GuidObject
- #
- def testNormalCase11(self):
- GuidList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'UNDEFINED'
- GuidType = 'UNDEFINED'
- VariableName = ''
- HelpStr = 'general comment line 1'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'PRODUCES'
- GuidType = 'Event'
- VariableName = ''
- HelpStr = 'Usage comment line 3'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'UNDEFINED'
- GuidType = 'UNDEFINED'
- VariableName = ''
- HelpStr = 'general comment line 2'
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- Result = GenGuidSections(GuidList)
- Expected = '''[Guids]
-# general comment line 1
-## PRODUCES ## Event # Usage comment line 3
-# general comment line 2
-Guid1|FFE1
-'''
- self.assertEqual(Result.strip(), Expected.strip())
-
- #
- # Normal case: have three GuidObject, with Usage/Type and no help
- #
- def testNormalCase12(self):
- GuidList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'PRODUCES'
- GuidType = 'GUID'
- VariableName = ''
- HelpStr = ''
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'PRODUCES'
- GuidType = 'Event'
- VariableName = ''
- HelpStr = ''
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- CName = 'Guid1'
- FFE = 'FFE1'
- Usage = 'CONSUMES'
- GuidType = 'Event'
- VariableName = ''
- HelpStr = ''
- Guid1 = self.GuidFactory(CName, FFE, Usage, GuidType,
- VariableName, HelpStr)
- GuidList.append(Guid1)
-
- Result = GenGuidSections(GuidList)
- Expected = '''[Guids]
-## PRODUCES ## GUID
-## PRODUCES ## Event
-## CONSUMES ## Event
-Guid1|FFE1
-'''
- self.assertEqual(Result.strip(), Expected.strip())
-
-#
-# Test GenProtocolPPiSections
-#
-class GenProtocolPPiSectionsTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- #
- # This is the API to generate Protocol/Ppi Object to help UnitTest
- #
- def ObjectFactory(self, CName, FFE, Usage, Notify, HelpStr, IsProtocol):
- if IsProtocol:
- Object = ProtocolObject()
- else:
- Object = PpiObject()
-
- Object.SetCName(CName)
- Object.SetFeatureFlag(FFE)
- Object.SetUsage(Usage)
- Object.SetNotify(Notify)
-
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('')
- HelpTextObj.SetString(HelpStr)
- Object.SetHelpTextList([HelpTextObj])
-
- return Object
-
- # Usage Notify Help INF Comment
- #1 UNDEFINED true Present ## UNDEFINED ## NOTIFY # Help
- #2 UNDEFINED true Not Present ## UNDEFINED ## NOTIFY
- #3 UNDEFINED false Present ## UNDEFINED # Help
- #4 UNDEFINED false Not Present ## UNDEFINED
- #5 UNDEFINED Not Present Present # Help
- #6 UNDEFINED Not Present Not Present <empty>
- #7 Other true Present ## Other ## NOTIFY # Help
- #8 Other true Not Present ## Other ## NOTIFY
- #9 Other false Present ## Other # Help
- #A Other false Not Present ## Other
- #B Other Not Present Present ## Other # Help
- #C Other Not Present Not Present ## Other
-
- def testNormalCase1(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'UNDEFINED'
- Notify = True
- HelpStr = 'Help'
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 ## UNDEFINED ## NOTIFY # Help'''
- self.assertEqual(Result.strip(), Expected)
-
- IsProtocol = False
- ObjectList = []
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Ppis]
-Guid1|FFE1 ## UNDEFINED ## NOTIFY # Help'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase2(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'UNDEFINED'
- Notify = True
- HelpStr = ''
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 ## UNDEFINED ## NOTIFY'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase3(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'UNDEFINED'
- Notify = False
- HelpStr = 'Help'
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 ## UNDEFINED # Help'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase4(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'UNDEFINED'
- Notify = False
- HelpStr = ''
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 ## UNDEFINED'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase5(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'UNDEFINED'
- Notify = ''
- HelpStr = 'Help'
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 # Help'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase6(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'UNDEFINED'
- Notify = ''
- HelpStr = ''
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase7(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'PRODUCES'
- Notify = True
- HelpStr = 'Help'
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 ## PRODUCES ## NOTIFY # Help'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase8(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'PRODUCES'
- Notify = True
- HelpStr = ''
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 ## PRODUCES ## NOTIFY'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase9(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'PRODUCES'
- Notify = False
- HelpStr = 'Help'
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 ## PRODUCES # Help'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCaseA(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'PRODUCES'
- Notify = False
- HelpStr = ''
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 ## PRODUCES'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCaseB(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'PRODUCES'
- Notify = ''
- HelpStr = 'Help'
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 ## PRODUCES # Help'''
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCaseC(self):
- ObjectList = []
-
- CName = 'Guid1'
- FFE = 'FFE1'
-
- Usage = 'PRODUCES'
- Notify = ''
- HelpStr = ''
- IsProtocol = True
- Object = self.ObjectFactory(CName, FFE, Usage, Notify,
- HelpStr, IsProtocol)
- ObjectList.append(Object)
-
-
- Result = GenProtocolPPiSections(ObjectList, IsProtocol)
- Expected = '''[Protocols]
-Guid1|FFE1 ## PRODUCES'''
- self.assertEqual(Result.strip(), Expected)
-
-#
-# Test GenPcdSections
-#
-class GenPcdSectionsTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- #
- # This is the API to generate Pcd Object to help UnitTest
- #
- def ObjectFactory(self, ItemType, TSCName, CName, DValue, FFE, Usage, Str):
- Object = PcdObject()
- HelpStr = Str
-
- Object.SetItemType(ItemType)
- Object.SetTokenSpaceGuidCName(TSCName)
- Object.SetCName(CName)
- Object.SetDefaultValue(DValue)
- Object.SetFeatureFlag(FFE)
- Object.SetValidUsage(Usage)
-
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('')
- HelpTextObj.SetString(HelpStr)
- Object.SetHelpTextList([HelpTextObj])
-
- return Object
-
-
- # Usage Help INF Comment
- #1 UNDEFINED Present # Help
- #2 UNDEFINED Not Present <empty>
- #3 Other Present ## Other # Help
- #4 Other Not Present ## Other
-
- def testNormalCase1(self):
- ObjectList = []
- ItemType = 'Pcd'
- TSCName = 'TSCName'
- CName = 'CName'
- DValue = 'DValue'
- FFE = 'FFE'
-
- Usage = 'UNDEFINED'
- Str = 'Help'
-
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Result = GenPcdSections(ObjectList)
- Expected = \
- '[Pcd]\n' + \
- 'TSCName.CName|DValue|FFE # Help'
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase2(self):
- ObjectList = []
- ItemType = 'Pcd'
- TSCName = 'TSCName'
- CName = 'CName'
- DValue = 'DValue'
- FFE = 'FFE'
-
- Usage = 'UNDEFINED'
- Str = ''
-
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Result = GenPcdSections(ObjectList)
- Expected = '[Pcd]\nTSCName.CName|DValue|FFE'
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase3(self):
- ObjectList = []
- ItemType = 'Pcd'
- TSCName = 'TSCName'
- CName = 'CName'
- DValue = 'DValue'
- FFE = 'FFE'
-
- Usage = 'CONSUMES'
- Str = 'Help'
-
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Result = GenPcdSections(ObjectList)
- Expected = '[Pcd]\nTSCName.CName|DValue|FFE ## CONSUMES # Help'
- self.assertEqual(Result.strip(), Expected)
-
- def testNormalCase4(self):
- ObjectList = []
- ItemType = 'Pcd'
- TSCName = 'TSCName'
- CName = 'CName'
- DValue = 'DValue'
- FFE = 'FFE'
-
- Usage = 'CONSUMES'
- Str = ''
-
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Result = GenPcdSections(ObjectList)
- Expected = '[Pcd]\nTSCName.CName|DValue|FFE ## CONSUMES'
- self.assertEqual(Result.strip(), Expected)
-
- #
- # multiple lines for normal usage
- #
- def testNormalCase5(self):
- ObjectList = []
- ItemType = 'Pcd'
- TSCName = 'TSCName'
- CName = 'CName'
- DValue = 'DValue'
- FFE = 'FFE'
-
- Usage = 'CONSUMES'
- Str = 'commment line 1\ncomment line 2'
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Result = GenPcdSections(ObjectList)
- Expected = '''[Pcd]
-TSCName.CName|DValue|FFE ## CONSUMES # commment line 1 comment line 2'''
- self.assertEqual(Result.strip(), Expected)
-
- #
- # multiple lines for UNDEFINED usage
- #
- def testNormalCase6(self):
- ObjectList = []
- ItemType = 'Pcd'
- TSCName = 'TSCName'
- CName = 'CName'
- DValue = 'DValue'
- FFE = 'FFE'
-
- Usage = 'UNDEFINED'
- Str = 'commment line 1\ncomment line 2'
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Usage = 'UNDEFINED'
- Str = 'commment line 3'
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Result = GenPcdSections(ObjectList)
- Expected = '''[Pcd]
-# commment line 1
-# comment line 2
-# commment line 3
-TSCName.CName|DValue|FFE'''
- self.assertEqual(Result.strip(), Expected)
-
- #
- # multiple lines for UNDEFINED and normal usage
- #
- def testNormalCase7(self):
- ObjectList = []
- ItemType = 'Pcd'
- TSCName = 'TSCName'
- CName = 'CName'
- DValue = 'DValue'
- FFE = 'FFE'
-
- Usage = 'UNDEFINED'
- Str = 'commment line 1\ncomment line 2'
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Usage = 'CONSUMES'
- Str = 'Foo'
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Usage = 'UNDEFINED'
- Str = 'commment line 3'
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Result = GenPcdSections(ObjectList)
- Expected = '''[Pcd]
-# commment line 1
-# comment line 2
-## CONSUMES # Foo
-# commment line 3
-TSCName.CName|DValue|FFE'''
- self.assertEqual(Result.strip(), Expected)
-
- # Usage Help INF Comment
- # CONSUMES Present # Help (keep <EOL> and insert '#' at beginning of each new line)
- # CONSUMES Not Present <empty>
-
- #
- # TAB_INF_FEATURE_PCD
- #
- def testNormalCase8(self):
- ObjectList = []
- ItemType = TAB_INF_FEATURE_PCD
- TSCName = 'TSCName'
- CName = 'CName'
- DValue = 'DValue'
- FFE = 'FFE'
-
- Usage = 'CONSUMES'
- Str = 'commment line 1\ncomment line 2'
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Result = GenPcdSections(ObjectList)
- Expected = '''[FeaturePcd]
-# commment line 1
-# comment line 2
-TSCName.CName|DValue|FFE'''
- self.assertEqual(Result.strip(), Expected)
-
- #
- # TAB_INF_FEATURE_PCD
- #
- def testNormalCase9(self):
- ObjectList = []
- ItemType = TAB_INF_FEATURE_PCD
- TSCName = 'TSCName'
- CName = 'CName'
- DValue = 'DValue'
- FFE = 'FFE'
-
- Usage = 'CONSUMES'
- Str = ''
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Result = GenPcdSections(ObjectList)
- Expected = '''[FeaturePcd]
-TSCName.CName|DValue|FFE'''
- self.assertEqual(Result.strip(), Expected)
-
- #
- # TAB_INF_FEATURE_PCD
- #
- def testNormalCase10(self):
- ObjectList = []
- ItemType = TAB_INF_FEATURE_PCD
- TSCName = 'TSCName'
- CName = 'CName'
- DValue = 'DValue'
- FFE = 'FFE'
-
- Usage = 'PRODUCES'
- Str = 'commment line 1\ncomment line 2'
- Object = self.ObjectFactory(ItemType, TSCName, CName, DValue, FFE,
- Usage, Str)
- ObjectList.append(Object)
-
- Result = GenPcdSections(ObjectList)
- Expected = '''
-
-[FeaturePcd]
-# commment line 1
-# comment line 2
-TSCName.CName|DValue|FFE
-'''
- self.assertEqual(Result, Expected)
-
-
-#
-# Test GenSpecialSections of Hob
-#
-class GenHobSectionsTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- #
- # This is the API to generate Event Object to help UnitTest
- #
- def ObjectFactory(self, SupArchList, Type, Usage, Str):
- Object = HobObject()
- HelpStr = Str
-
- Object.SetHobType(Type)
- Object.SetUsage(Usage)
- Object.SetSupArchList(SupArchList)
-
- HelpTextObj = TextObject()
- HelpTextObj.SetLang('')
- HelpTextObj.SetString(HelpStr)
- Object.SetHelpTextList([HelpTextObj])
-
- return Object
-
- def testNormalCase1(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = 'Help'
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# ##
-# # Help
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase2(self):
- ObjectList = []
- SupArchList = []
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = 'Help'
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob]
-# ##
-# # Help
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase3(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = '\nComment Line 1\n\n'
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# ##
-# # Comment Line 1
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase4(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = '\nComment Line 1\n'
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# ##
-# # Comment Line 1
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase5(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = 'Comment Line 1\n\n'
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# ##
-# # Comment Line 1
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase6(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = ''
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase7(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = '\nNew Stack HoB'
-
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# ##
-# # New Stack HoB
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase8(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = '\nNew Stack HoB\n\nTail Comment'
-
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# ##
-# # New Stack HoB
-# #
-# # Tail Comment
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase9(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = '\n\n'
-
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# ##
-# #
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase10(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = '\n'
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# ##
-# #
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase11(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = '\n\n\n'
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# ##
-# #
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
- def testNormalCase12(self):
- ObjectList = []
- SupArchList = ['X64']
- Type = 'Foo'
- Usage = 'UNDEFINED'
- Str = '\n\n\n\n'
-
- Object = self.ObjectFactory(SupArchList, Type, Usage, Str)
- ObjectList.append(Object)
-
- Result = GenSpecialSections(ObjectList, 'Hob')
- Expected = '''# [Hob.X64]
-# ##
-# #
-# #
-# #
-# Foo ## UNDEFINED
-#
-#
-'''
- self.assertEqual(Result, Expected)
-
-#
-# Test GenGenericCommentF
-#
-class GenGenericCommentFTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def testNormalCase1(self):
- CommentLines = 'Comment Line 1'
- Result = GenGenericCommentF(CommentLines)
- Expected = '# Comment Line 1\n'
- self.assertEqual(Result, Expected)
-
- def testNormalCase2(self):
- CommentLines = '\n'
- Result = GenGenericCommentF(CommentLines)
- Expected = '#\n'
- self.assertEqual(Result, Expected)
-
- def testNormalCase3(self):
- CommentLines = '\n\n\n'
- Result = GenGenericCommentF(CommentLines)
- Expected = '#\n#\n#\n'
- self.assertEqual(Result, Expected)
-
- def testNormalCase4(self):
- CommentLines = 'coment line 1\n'
- Result = GenGenericCommentF(CommentLines)
- Expected = '# coment line 1\n'
- self.assertEqual(Result, Expected)
-
- def testNormalCase5(self):
- CommentLines = 'coment line 1\n coment line 2\n'
- Result = GenGenericCommentF(CommentLines)
- Expected = '# coment line 1\n# coment line 2\n'
- self.assertEqual(Result, Expected)
-
-if __name__ == '__main__':
- Logger.Initialize()
- unittest.main() \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py b/BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py
deleted file mode 100644
index 3ed3345c6d..0000000000
--- a/BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py
+++ /dev/null
@@ -1,923 +0,0 @@
-## @file
-# This file contain unit test for CommentParsing
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-import unittest
-
-import Logger.Log as Logger
-from Library.CommentParsing import ParseHeaderCommentSection, \
- ParseGenericComment, \
- ParseDecPcdGenericComment, \
- ParseDecPcdTailComment
-from Library.CommentParsing import _IsCopyrightLine
-from Library.String import GetSplitValueList
-from Library.DataType import TAB_SPACE_SPLIT
-from Library.DataType import LANGUAGE_EN_US
-
-#
-# Test ParseHeaderCommentSection
-#
-class ParseHeaderCommentSectionTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- #
- # Normal case1: have license/copyright/license above @file
- #
- def testNormalCase1(self):
- TestCommentLines1 = \
- '''# License1
- # License2
- #
- ## @file
- # example abstract
- #
- # example description
- #
- # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- #
- # License3
- #'''
-
- CommentList = GetSplitValueList(TestCommentLines1, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- Abstract, Description, Copyright, License = \
- ParseHeaderCommentSection(TestCommentLinesList, "PhonyFile")
-
- ExpectedAbstract = 'example abstract'
- self.assertEqual(Abstract, ExpectedAbstract)
-
- ExpectedDescription = 'example description'
- self.assertEqual(Description, ExpectedDescription)
-
- ExpectedCopyright = \
- 'Copyright (c) 2007 - 2010,'\
- ' Intel Corporation. All rights reserved.<BR>'
- self.assertEqual(Copyright, ExpectedCopyright)
-
- ExpectedLicense = 'License1\nLicense2\n\nLicense3'
- self.assertEqual(License, ExpectedLicense)
-
- #
- # Normal case2: have license/copyright above @file, but no copyright after
- #
- def testNormalCase2(self):
- TestCommentLines2 = \
- ''' # License1
- # License2
- #
- ## @file
- # example abstract
- #
- # example description
- #
- #Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- #
- ##'''
-
- CommentList = GetSplitValueList(TestCommentLines2, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- Abstract, Description, Copyright, License = \
- ParseHeaderCommentSection(TestCommentLinesList, "PhonyFile")
-
- ExpectedAbstract = 'example abstract'
- self.assertEqual(Abstract, ExpectedAbstract)
-
- ExpectedDescription = 'example description'
- self.assertEqual(Description, ExpectedDescription)
-
- ExpectedCopyright = \
- 'Copyright (c) 2007 - 2010, Intel Corporation.'\
- ' All rights reserved.<BR>'
- self.assertEqual(Copyright, ExpectedCopyright)
-
- ExpectedLicense = 'License1\nLicense2'
- self.assertEqual(License, ExpectedLicense)
-
-
- #
- # Normal case2: have license/copyright/license above @file,
- # but no abstract/description
- #
- def testNormalCase3(self):
- TestCommentLines3 = \
- ''' # License1
- # License2
- #
- ## @file
- # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- #
- # License3 Line1
- # License3 Line2
- ##'''
-
- CommentList = GetSplitValueList(TestCommentLines3, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- Abstract, Description, Copyright, License = \
- ParseHeaderCommentSection(TestCommentLinesList, "PhonyFile")
-
- ExpectedAbstract = ''
- self.assertEqual(Abstract, ExpectedAbstract)
-
- ExpectedDescription = ''
- self.assertEqual(Description, ExpectedDescription)
-
- ExpectedCopyright = \
- 'Copyright (c) 2007 - 2010,'\
- ' Intel Corporation. All rights reserved.<BR>'
- self.assertEqual(Copyright, ExpectedCopyright)
-
- ExpectedLicense = \
- 'License1\n' \
- 'License2\n\n' \
- 'License3 Line1\n' \
- 'License3 Line2'
- self.assertEqual(License, ExpectedLicense)
-
- #
- # Normal case4: format example in spec
- #
- def testNormalCase4(self):
- TestCommentLines = \
- '''
- ## @file
- # Abstract
- #
- # Description
- #
- # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- #
- # License
- #
- ##'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- Abstract, Description, Copyright, License = \
- ParseHeaderCommentSection(TestCommentLinesList, "PhonyFile")
-
- ExpectedAbstract = 'Abstract'
- self.assertEqual(Abstract, ExpectedAbstract)
-
- ExpectedDescription = 'Description'
- self.assertEqual(Description, ExpectedDescription)
-
- ExpectedCopyright = \
- 'Copyright (c) 2007 - 2010, Intel Corporation.'\
- ' All rights reserved.<BR>'
- self.assertEqual(Copyright, ExpectedCopyright)
-
- ExpectedLicense = \
- 'License'
- self.assertEqual(License, ExpectedLicense)
-
- #
- # Normal case5: other line between copyright
- #
- def testNormalCase5(self):
- TestCommentLines = \
- '''
- ## @file
- # Abstract
- #
- # Description
- #
- # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- # other line
- # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- #
- # License
- #
- ##'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- Abstract, Description, Copyright, License = \
- ParseHeaderCommentSection(TestCommentLinesList, "PhonyFile")
-
- ExpectedAbstract = 'Abstract'
- self.assertEqual(Abstract, ExpectedAbstract)
-
- ExpectedDescription = 'Description'
- self.assertEqual(Description, ExpectedDescription)
-
- ExpectedCopyright = \
- 'Copyright (c) 2007 - 2010, Intel Corporation.'\
- ' All rights reserved.<BR>\n'\
- 'Copyright (c) 2007 - 2010, Intel Corporation.'\
- ' All rights reserved.<BR>'
- self.assertEqual(Copyright, ExpectedCopyright)
-
- ExpectedLicense = \
- 'License'
- self.assertEqual(License, ExpectedLicense)
-
- #
- # Normal case6: multiple lines of copyright
- #
- def testNormalCase6(self):
- TestCommentLines = \
- '''
- ## @file
- # Abstract
- #
- # Description
- #
- # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- # Copyright (c) 2007 - 2010, FOO1 Corporation. All rights reserved.<BR>
- # Copyright (c) 2007 - 2010, FOO2 Corporation. All rights reserved.<BR>
- #
- # License
- #
- ##'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- Abstract, Description, Copyright, License = \
- ParseHeaderCommentSection(TestCommentLinesList, "PhonyFile")
-
- ExpectedAbstract = 'Abstract'
- self.assertEqual(Abstract, ExpectedAbstract)
-
- ExpectedDescription = 'Description'
- self.assertEqual(Description, ExpectedDescription)
-
- ExpectedCopyright = \
- 'Copyright (c) 2007 - 2010, Intel Corporation.'\
- ' All rights reserved.<BR>\n'\
- 'Copyright (c) 2007 - 2010, FOO1 Corporation.'\
- ' All rights reserved.<BR>\n'\
- 'Copyright (c) 2007 - 2010, FOO2 Corporation.'\
- ' All rights reserved.<BR>'
- self.assertEqual(Copyright, ExpectedCopyright)
-
- ExpectedLicense = \
- 'License'
- self.assertEqual(License, ExpectedLicense)
-
- #
- # Normal case7: Abstract not present
- #
- def testNormalCase7(self):
- TestCommentLines = \
- '''
- ## @file
- #
- # Description
- #
- # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- # Copyright (c) 2007 - 2010, FOO1 Corporation. All rights reserved.<BR>
- # Copyright (c) 2007 - 2010, FOO2 Corporation. All rights reserved.<BR>
- #
- # License
- #
- ##'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- Abstract, Description, Copyright, License = \
- ParseHeaderCommentSection(TestCommentLinesList, "PhonyFile")
-
- ExpectedAbstract = ''
- self.assertEqual(Abstract, ExpectedAbstract)
-
- ExpectedDescription = 'Description'
- self.assertEqual(Description, ExpectedDescription)
-
- ExpectedCopyright = \
- 'Copyright (c) 2007 - 2010, Intel Corporation.'\
- ' All rights reserved.<BR>\n'\
- 'Copyright (c) 2007 - 2010, FOO1 Corporation.'\
- ' All rights reserved.<BR>\n'\
- 'Copyright (c) 2007 - 2010, FOO2 Corporation.'\
- ' All rights reserved.<BR>'
- self.assertEqual(Copyright, ExpectedCopyright)
-
- ExpectedLicense = \
- 'License'
- self.assertEqual(License, ExpectedLicense)
-
- #
- # Normal case8: Description not present
- #
- def testNormalCase8(self):
- TestCommentLines = \
- '''
- ## @file
- # Abstact
- #
- # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- #
- # License
- #
- ##'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- Abstract, Description, Copyright, License = \
- ParseHeaderCommentSection(TestCommentLinesList, "PhonyFile")
-
- ExpectedAbstract = 'Abstact'
- self.assertEqual(Abstract, ExpectedAbstract)
-
- ExpectedDescription = ''
- self.assertEqual(Description, ExpectedDescription)
-
- ExpectedCopyright = \
- 'Copyright (c) 2007 - 2010, Intel Corporation.'\
- ' All rights reserved.<BR>'
- self.assertEqual(Copyright, ExpectedCopyright)
-
- ExpectedLicense = \
- 'License'
- self.assertEqual(License, ExpectedLicense)
-
- #
- # Error case1: No copyright found
- #
- def testErrorCase1(self):
- TestCommentLines = \
- '''
- ## @file
- # Abstract
- #
- # Description
- #
- # License
- #
- ##'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- self.assertRaises(Logger.FatalError,
- ParseHeaderCommentSection,
- TestCommentLinesList,
- "PhonyFile")
-
- #
- # Error case2: non-empty non-comment lines passed in
- #
- def testErrorCase2(self):
- TestCommentLines = \
- '''
- ## @file
- # Abstract
- #
- this is invalid line
- # Description
- #
- # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
- # License
- #
- ##'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- self.assertRaises(Logger.FatalError,
- ParseHeaderCommentSection,
- TestCommentLinesList,
- "PhonyFile")
-
-#
-# Test ParseGenericComment
-#
-class ParseGenericCommentTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- #
- # Normal case1: one line of comment
- #
- def testNormalCase1(self):
- TestCommentLines = \
- '''# hello world'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- HelptxtObj = ParseGenericComment(TestCommentLinesList, 'testNormalCase1')
- self.failIf(not HelptxtObj)
- self.assertEqual(HelptxtObj.GetString(), 'hello world')
- self.assertEqual(HelptxtObj.GetLang(), LANGUAGE_EN_US)
-
- #
- # Normal case2: multiple lines of comment
- #
- def testNormalCase2(self):
- TestCommentLines = \
- '''## hello world
- # second line'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- HelptxtObj = ParseGenericComment(TestCommentLinesList, 'testNormalCase2')
- self.failIf(not HelptxtObj)
- self.assertEqual(HelptxtObj.GetString(),
- 'hello world\n' + 'second line')
- self.assertEqual(HelptxtObj.GetLang(), LANGUAGE_EN_US)
-
- #
- # Normal case3: multiple lines of comment, non comment lines will be skipped
- #
- def testNormalCase3(self):
- TestCommentLines = \
- '''## hello world
- This is not comment line'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- HelptxtObj = ParseGenericComment(TestCommentLinesList, 'testNormalCase3')
- self.failIf(not HelptxtObj)
- self.assertEqual(HelptxtObj.GetString(),
- 'hello world\n\n')
- self.assertEqual(HelptxtObj.GetLang(), LANGUAGE_EN_US)
-
-#
-# Test ParseDecPcdGenericComment
-#
-class ParseDecPcdGenericCommentTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- #
- # Normal case1: comments with no special comment
- #
- def testNormalCase1(self):
- TestCommentLines = \
- '''## hello world
- # second line'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (HelpTxt, PcdErr) = \
- ParseDecPcdGenericComment(TestCommentLinesList, 'testNormalCase1')
- self.failIf(not HelpTxt)
- self.failIf(PcdErr)
- self.assertEqual(HelpTxt,
- 'hello world\n' + 'second line')
-
-
- #
- # Normal case2: comments with valid list
- #
- def testNormalCase2(self):
- TestCommentLines = \
- '''## hello world
- # second line
- # @ValidList 1, 2, 3
- # other line'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (HelpTxt, PcdErr) = \
- ParseDecPcdGenericComment(TestCommentLinesList, 'UnitTest')
- self.failIf(not HelpTxt)
- self.failIf(not PcdErr)
- self.assertEqual(HelpTxt,
- 'hello world\n' + 'second line\n' + 'other line')
- ExpectedList = GetSplitValueList('1 2 3', TAB_SPACE_SPLIT)
- ActualList = [item for item in \
- GetSplitValueList(PcdErr.GetValidValue(), TAB_SPACE_SPLIT) if item]
- self.assertEqual(ExpectedList, ActualList)
- self.failIf(PcdErr.GetExpression())
- self.failIf(PcdErr.GetValidValueRange())
-
- #
- # Normal case3: comments with valid range
- #
- def testNormalCase3(self):
- TestCommentLines = \
- '''## hello world
- # second line
- # @ValidRange LT 1 AND GT 2
- # other line'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (HelpTxt, PcdErr) = \
- ParseDecPcdGenericComment(TestCommentLinesList, 'UnitTest')
- self.failIf(not HelpTxt)
- self.failIf(not PcdErr)
- self.assertEqual(HelpTxt,
- 'hello world\n' + 'second line\n' + 'other line')
- self.assertEqual(PcdErr.GetValidValueRange().strip(), 'LT 1 AND GT 2')
- self.failIf(PcdErr.GetExpression())
- self.failIf(PcdErr.GetValidValue())
-
- #
- # Normal case4: comments with valid expression
- #
- def testNormalCase4(self):
- TestCommentLines = \
- '''## hello world
- # second line
- # @Expression LT 1 AND GT 2
- # other line'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (HelpTxt, PcdErr) = \
- ParseDecPcdGenericComment(TestCommentLinesList, 'UnitTest')
- self.failIf(not HelpTxt)
- self.failIf(not PcdErr)
- self.assertEqual(HelpTxt,
- 'hello world\n' + 'second line\n' + 'other line')
- self.assertEqual(PcdErr.GetExpression().strip(), 'LT 1 AND GT 2')
- self.failIf(PcdErr.GetValidValueRange())
- self.failIf(PcdErr.GetValidValue())
-
- #
- # Normal case5: comments with valid expression and no generic comment
- #
- def testNormalCase5(self):
- TestCommentLines = \
- '''# @Expression LT 1 AND GT 2'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (HelpTxt, PcdErr) = \
- ParseDecPcdGenericComment(TestCommentLinesList, 'UnitTest')
- self.failIf(HelpTxt)
- self.failIf(not PcdErr)
- self.assertEqual(PcdErr.GetExpression().strip(), 'LT 1 AND GT 2')
- self.failIf(PcdErr.GetValidValueRange())
- self.failIf(PcdErr.GetValidValue())
-
- #
- # Normal case6: comments with only generic help text
- #
- def testNormalCase6(self):
- TestCommentLines = \
- '''#'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (HelpTxt, PcdErr) = \
- ParseDecPcdGenericComment(TestCommentLinesList, 'UnitTest')
- self.assertEqual(HelpTxt, '\n')
- self.failIf(PcdErr)
-
-
-
- #
- # Error case1: comments with both expression and valid list, use later
- # ignore the former and with a warning message
- #
- def testErrorCase1(self):
- TestCommentLines = \
- '''## hello world
- # second line
- # @ValidList 1, 2, 3
- # @Expression LT 1 AND GT 2
- # other line'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- try:
- ParseDecPcdGenericComment(TestCommentLinesList, 'UnitTest')
- except Logger.FatalError:
- pass
-
-#
-# Test ParseDecPcdTailComment
-#
-class ParseDecPcdTailCommentTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- #
- # Normal case1: comments with no SupModeList
- #
- def testNormalCase1(self):
- TestCommentLines = \
- '''## #hello world'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (SupModeList, HelpStr) = \
- ParseDecPcdTailComment(TestCommentLinesList, 'UnitTest')
- self.failIf(not HelpStr)
- self.failIf(SupModeList)
- self.assertEqual(HelpStr,
- 'hello world')
-
- #
- # Normal case2: comments with one SupMode
- #
- def testNormalCase2(self):
- TestCommentLines = \
- '''## BASE #hello world'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (SupModeList, HelpStr) = \
- ParseDecPcdTailComment(TestCommentLinesList, 'UnitTest')
- self.failIf(not HelpStr)
- self.failIf(not SupModeList)
- self.assertEqual(HelpStr,
- 'hello world')
- self.assertEqual(SupModeList,
- ['BASE'])
-
- #
- # Normal case3: comments with more than one SupMode
- #
- def testNormalCase3(self):
- TestCommentLines = \
- '''## BASE UEFI_APPLICATION #hello world'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (SupModeList, HelpStr) = \
- ParseDecPcdTailComment(TestCommentLinesList, 'UnitTest')
- self.failIf(not HelpStr)
- self.failIf(not SupModeList)
- self.assertEqual(HelpStr,
- 'hello world')
- self.assertEqual(SupModeList,
- ['BASE', 'UEFI_APPLICATION'])
-
- #
- # Normal case4: comments with more than one SupMode, no help text
- #
- def testNormalCase4(self):
- TestCommentLines = \
- '''## BASE UEFI_APPLICATION'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (SupModeList, HelpStr) = \
- ParseDecPcdTailComment(TestCommentLinesList, 'UnitTest')
- self.failIf(HelpStr)
- self.failIf(not SupModeList)
- self.assertEqual(SupModeList,
- ['BASE', 'UEFI_APPLICATION'])
-
- #
- # Normal case5: general comments with no supModList, extract from real case
- #
- def testNormalCase5(self):
- TestCommentLines = \
- ''' # 1 = 128MB, 2 = 256MB, 3 = MAX'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- (SupModeList, HelpStr) = \
- ParseDecPcdTailComment(TestCommentLinesList, 'UnitTest')
- self.failIf(not HelpStr)
- self.assertEqual(HelpStr,
- '1 = 128MB, 2 = 256MB, 3 = MAX')
- self.failIf(SupModeList)
-
-
- #
- # Error case2: comments with supModList contains valid and invalid
- # module type
- #
- def testErrorCase2(self):
- TestCommentLines = \
- '''## BASE INVALID_MODULE_TYPE #hello world'''
-
- CommentList = GetSplitValueList(TestCommentLines, "\n")
- LineNum = 0
- TestCommentLinesList = []
- for Comment in CommentList:
- LineNum += 1
- TestCommentLinesList.append((Comment, LineNum))
-
- try:
- ParseDecPcdTailComment(TestCommentLinesList, 'UnitTest')
- except Logger.FatalError:
- pass
-
-
-#
-# Test _IsCopyrightLine
-#
-class _IsCopyrightLineTest(unittest.TestCase):
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- #
- # Normal case
- #
- def testCase1(self):
- Line = 'this is a copyright ( line'
- Result = _IsCopyrightLine(Line)
- self.failIf(not Result)
-
- #
- # Normal case
- #
- def testCase2(self):
- Line = 'this is a Copyright ( line'
- Result = _IsCopyrightLine(Line)
- self.failIf(not Result)
-
- #
- # Normal case
- #
- def testCase3(self):
- Line = 'this is not aCopyright ( line'
- Result = _IsCopyrightLine(Line)
- self.failIf(Result)
-
- #
- # Normal case
- #
- def testCase4(self):
- Line = 'this is Copyright( line'
- Result = _IsCopyrightLine(Line)
- self.failIf(not Result)
-
- #
- # Normal case
- #
- def testCase5(self):
- Line = 'this is Copyright (line'
- Result = _IsCopyrightLine(Line)
- self.failIf(not Result)
-
- #
- # Normal case
- #
- def testCase6(self):
- Line = 'this is not Copyright line'
- Result = _IsCopyrightLine(Line)
- self.failIf(Result)
-
- #
- # Normal case
- #
- def testCase7(self):
- Line = 'Copyright (c) line'
- Result = _IsCopyrightLine(Line)
- self.failIf(not Result)
-
- #
- # Normal case
- #
- def testCase8(self):
- Line = ' Copyright (c) line'
- Result = _IsCopyrightLine(Line)
- self.failIf(not Result)
-
- #
- # Normal case
- #
- def testCase9(self):
- Line = 'not a Copyright '
- Result = _IsCopyrightLine(Line)
- self.failIf(Result)
-
-if __name__ == '__main__':
- Logger.Initialize()
- unittest.main() \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py b/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py
deleted file mode 100644
index 8b4ece2617..0000000000
--- a/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py
+++ /dev/null
@@ -1,284 +0,0 @@
-## @file
-# This file contain unit test for DecParser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-import os
-import unittest
-
-from Parser.DecParserMisc import \
- IsValidCArray, \
- IsValidPcdDatum
-
-from Parser.DecParser import Dec
-
-from Library.ParserValidate import IsValidCFormatGuid
-
-#
-# Test tool function
-#
-def TestToolFuncs():
- assert IsValidCArray('{0x1, 0x23}')
-
- # Empty after comma
- assert not IsValidCArray('{0x1, 0x23, }')
-
- # 0x2345 too long
- assert not IsValidCArray('{0x1, 0x2345}')
-
- # Must end with '}'
- assert not IsValidCArray('{0x1, 0x23, ')
-
- # Whitespace between numbers
- assert not IsValidCArray('{0x1, 0x2 3, }')
-
- assert IsValidPcdDatum('VOID*', '"test"')[0]
- assert IsValidPcdDatum('VOID*', 'L"test"')[0]
- assert IsValidPcdDatum('BOOLEAN', 'TRUE')[0]
- assert IsValidPcdDatum('BOOLEAN', 'FALSE')[0]
- assert IsValidPcdDatum('BOOLEAN', '0')[0]
- assert IsValidPcdDatum('BOOLEAN', '1')[0]
- assert IsValidPcdDatum('UINT8', '0xab')[0]
-
- assert not IsValidPcdDatum('UNKNOWNTYPE', '0xabc')[0]
- assert not IsValidPcdDatum('UINT8', 'not number')[0]
-
- assert( IsValidCFormatGuid('{ 0xfa0b1735 , 0x87a0, 0x4193, {0xb2, 0x66 , 0x53, 0x8c , 0x38, 0xaf, 0x48, 0xce }}'))
- assert( not IsValidCFormatGuid('{ 0xfa0b1735 , 0x87a0, 0x4193, {0xb2, 0x66 , 0x53, 0x8c , 0x38, 0xaf, 0x48, 0xce }} 0xaa'))
-
-def TestTemplate(TestString, TestFunc):
- Path = os.path.join(os.getcwd(), 'test.dec')
- Path = os.path.normpath(Path)
- try:
- f = open(Path, 'w')
-
- # Write test string to file
- f.write(TestString)
-
- # Close file
- f.close()
- except:
- print 'Can not create temporary file [%s]!' % Path
- exit(-1)
-
- # Call test function to test
- Ret = TestFunc(Path, TestString)
-
- # Test done, remove temporary file
- os.remove(Path)
- return Ret
-
-# To make test unit works OK, must set IsRaiseError to True
-# This function test right syntax DEC file
-# @retval: parser object
-#
-def TestOK(Path, TestString):
- try:
- Parser = Dec(Path)
- except:
- raise 'Bug!!! Correct syntax in DEC file, but exception raised!\n' + TestString
- return Parser
-
-# This function test wrong syntax DEC file
-# if parser checked wrong syntax, exception thrown and it's expected result
-def TestError(Path, TestString):
- try:
- Dec(Path)
- except:
- # Raise error, get expected result
- return True
- raise 'Bug!!! Wrong syntax in DEC file, but passed by DEC parser!!\n' + TestString
-
-def TestDecDefine():
- TestString = '''
- [Defines]
- DEC_SPECIFICATION = 0x00010005
- PACKAGE_NAME = MdePkg
- PACKAGE_GUID = 1E73767F-8F52-4603-AEB4-F29B510B6766
- PACKAGE_VERSION = 1.02
- '''
- Parser = TestTemplate(TestString, TestOK)
- DefObj = Parser.GetDefineSectionObject()
- assert DefObj.GetPackageSpecification() == '0x00010005'
- assert DefObj.GetPackageName() == 'MdePkg'
- assert DefObj.GetPackageGuid() == '1E73767F-8F52-4603-AEB4-F29B510B6766'
- assert DefObj.GetPackageVersion() == '1.02'
-
- TestString = '''
- [Defines]
- UNKNOW_KEY = 0x00010005 # A unknown key
- '''
- assert TestTemplate(TestString, TestError)
-
- TestString = '''
- [Defines]
- PACKAGE_GUID = F-8F52-4603-AEB4-F29B510B6766 # Error GUID
- '''
- assert TestTemplate(TestString, TestError)
-
-def TestDecInclude():
- TestString = '''
- [Defines]
- DEC_SPECIFICATION = 0x00010005
- PACKAGE_NAME = MdePkg
- PACKAGE_GUID = 1E73767F-8F52-4603-AEB4-F29B510B6766
- PACKAGE_VERSION = 1.02
- [ \\
- Includes]
- Include
- [Includes.IA32]
- Include/Ia32
- '''
-
- # Create directory in current directory
- try:
- os.makedirs('Include/Ia32')
- except:
- pass
- Parser = TestTemplate(TestString, TestOK)
-
- IncObj = Parser.GetIncludeSectionObject()
- Items = IncObj.GetIncludes()
- assert len(Items) == 1
- assert Items[0].File == 'Include'
-
- Items = IncObj.GetIncludes('IA32')
- assert len(Items) == 1
- # normpath is called in DEC parser so '/' is converted to '\'
- assert Items[0].File == 'Include\\Ia32'
-
- TestString = '''
- [Defines]
- DEC_SPECIFICATION = 0x00010005
- PACKAGE_NAME = MdePkg
- PACKAGE_GUID = 1E73767F-8F52-4603-AEB4-F29B510B6766
- PACKAGE_VERSION = 1.02
- [Includes]
- Include_not_exist # directory does not exist
- '''
- assert TestTemplate(TestString, TestError)
-
- os.removedirs('Include/Ia32')
-
-def TestDecGuidPpiProtocol():
- TestString = '''
- [Defines]
- DEC_SPECIFICATION = 0x00010005
- PACKAGE_NAME = MdePkg
- PACKAGE_GUID = 1E73767F-8F52-4603-AEB4-F29B510B6766
- PACKAGE_VERSION = 1.02
- [Guids]
- #
- # GUID defined in UEFI2.1/UEFI2.0/EFI1.1
- #
- ## Include/Guid/GlobalVariable.h
- gEfiGlobalVariableGuid = { 0x8BE4DF61, 0x93CA, 0x11D2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }}
- [Protocols]
- ## Include/Protocol/Bds.h
- gEfiBdsArchProtocolGuid = { 0x665E3FF6, 0x46CC, 0x11D4, { 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }}
- [Ppis]
- ## Include/Ppi/MasterBootMode.h
- gEfiPeiMasterBootModePpiGuid = { 0x7408d748, 0xfc8c, 0x4ee6, {0x92, 0x88, 0xc4, 0xbe, 0xc0, 0x92, 0xa4, 0x10 } }
- '''
- Parser = TestTemplate(TestString, TestOK)
- Obj = Parser.GetGuidSectionObject()
- Items = Obj.GetGuids()
- assert Obj.GetSectionName() == 'Guids'.upper()
- assert len(Items) == 1
- assert Items[0].GuidCName == 'gEfiGlobalVariableGuid'
- assert Items[0].GuidCValue == '{ 0x8BE4DF61, 0x93CA, 0x11D2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }}'
-
- Obj = Parser.GetProtocolSectionObject()
- Items = Obj.GetProtocols()
- assert Obj.GetSectionName() == 'Protocols'.upper()
- assert len(Items) == 1
- assert Items[0].GuidCName == 'gEfiBdsArchProtocolGuid'
- assert Items[0].GuidCValue == '{ 0x665E3FF6, 0x46CC, 0x11D4, { 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }}'
-
- Obj = Parser.GetPpiSectionObject()
- Items = Obj.GetPpis()
- assert Obj.GetSectionName() == 'Ppis'.upper()
- assert len(Items) == 1
- assert Items[0].GuidCName == 'gEfiPeiMasterBootModePpiGuid'
- assert Items[0].GuidCValue == '{ 0x7408d748, 0xfc8c, 0x4ee6, {0x92, 0x88, 0xc4, 0xbe, 0xc0, 0x92, 0xa4, 0x10 } }'
-
-def TestDecPcd():
- TestString = '''
- [Defines]
- DEC_SPECIFICATION = 0x00010005
- PACKAGE_NAME = MdePkg
- PACKAGE_GUID = 1E73767F-8F52-4603-AEB4-F29B510B6766
- PACKAGE_VERSION = 1.02
- [PcdsFeatureFlag]
- ## If TRUE, the component name protocol will not be installed.
- gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE|BOOLEAN|0x0000000d
-
- [PcdsFixedAtBuild]
- ## Indicates the maximum length of unicode string
- gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000|UINT32|0x00000001
-
- [PcdsFixedAtBuild.IPF]
- ## The base address of IO port space for IA64 arch
- gEfiMdePkgTokenSpaceGuid.PcdIoBlockBaseAddressForIpf|0x0ffffc000000|UINT64|0x0000000f
-
- [PcdsFixedAtBuild,PcdsPatchableInModule]
- ## This flag is used to control the printout of DebugLib
- gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000|UINT32|0x00000006
-
- [PcdsFixedAtBuild,PcdsPatchableInModule,PcdsDynamic]
- ## This value is used to set the base address of pci express hierarchy
- gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE0000000|UINT64|0x0000000a
- '''
- Parser = TestTemplate(TestString, TestOK)
- Obj = Parser.GetPcdSectionObject()
- Items = Obj.GetPcds('PcdsFeatureFlag', 'COMMON')
- assert len(Items) == 1
- assert Items[0].TokenSpaceGuidCName == 'gEfiMdePkgTokenSpaceGuid'
- assert Items[0].TokenCName == 'PcdComponentNameDisable'
- assert Items[0].DefaultValue == 'FALSE'
- assert Items[0].DatumType == 'BOOLEAN'
- assert Items[0].TokenValue == '0x0000000d'
-
- Items = Obj.GetPcdsByType('PcdsFixedAtBuild')
- assert len(Items) == 4
- assert len(Obj.GetPcdsByType('PcdsPatchableInModule')) == 2
-
-def TestDecUserExtension():
- TestString = '''
- [Defines]
- DEC_SPECIFICATION = 0x00010005
- PACKAGE_NAME = MdePkg
- PACKAGE_GUID = 1E73767F-8F52-4603-AEB4-F29B510B6766
- PACKAGE_VERSION = 1.02
- [UserExtensions.MyID."TestString".IA32]
- Some Strings...
- '''
- Parser = TestTemplate(TestString, TestOK)
- Obj = Parser.GetUserExtensionSectionObject()
- Items = Obj.GetAllUserExtensions()
- assert len(Items) == 1
- assert Items[0].UserString == 'Some Strings...'
- assert len(Items[0].ArchAndModuleType) == 1
- assert ['MyID', '"TestString"', 'IA32'] in Items[0].ArchAndModuleType
-
-if __name__ == '__main__':
- import Logger.Logger
- Logger.Logger.Initialize()
- unittest.FunctionTestCase(TestToolFuncs).runTest()
- unittest.FunctionTestCase(TestDecDefine).runTest()
- unittest.FunctionTestCase(TestDecInclude).runTest()
- unittest.FunctionTestCase(TestDecGuidPpiProtocol).runTest()
- unittest.FunctionTestCase(TestDecPcd).runTest()
- unittest.FunctionTestCase(TestDecUserExtension).runTest()
-
- print 'All tests passed...'
-
-
diff --git a/BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py b/BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py
deleted file mode 100644
index 2f4917525b..0000000000
--- a/BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py
+++ /dev/null
@@ -1,534 +0,0 @@
-## @file
-# This file contain unit test for DecParser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-import os
-import unittest
-from Logger.Log import FatalError
-
-from Parser.DecParser import \
- Dec, \
- _DecDefine, \
- _DecLibraryclass, \
- _DecPcd, \
- _DecGuid, \
- FileContent, \
- _DecBase, \
- CleanString
-
-from Object.Parser.DecObject import _DecComments
-
-#
-# Test CleanString
-#
-class CleanStringTestCase(unittest.TestCase):
- def testCleanString(self):
- Line, Comment = CleanString('')
- self.assertEqual(Line, '')
- self.assertEqual(Comment, '')
-
- Line, Comment = CleanString('line without comment')
- self.assertEqual(Line, 'line without comment')
- self.assertEqual(Comment, '')
-
- Line, Comment = CleanString('# pure comment')
- self.assertEqual(Line, '')
- self.assertEqual(Comment, '# pure comment')
-
- Line, Comment = CleanString('line # and comment')
- self.assertEqual(Line, 'line')
- self.assertEqual(Comment, '# and comment')
-
- def testCleanStringCpp(self):
- Line, Comment = CleanString('line // and comment', AllowCppStyleComment = True)
- self.assertEqual(Line, 'line')
- self.assertEqual(Comment, '# and comment')
-
-#
-# Test _DecBase._MacroParser function
-#
-class MacroParserTestCase(unittest.TestCase):
- def setUp(self):
- self.dec = _DecBase(FileContent('dummy', []))
-
- def testCorrectMacro(self):
- self.dec._MacroParser('DEFINE MARCRO1 = test1')
- self.failIf('MARCRO1' not in self.dec._LocalMacro)
- self.assertEqual(self.dec._LocalMacro['MARCRO1'], 'test1')
-
- def testErrorMacro1(self):
- # Raise fatal error, macro name must be upper case letter
- self.assertRaises(FatalError, self.dec._MacroParser, 'DEFINE not_upper_case = test2')
-
- def testErrorMacro2(self):
- # No macro name given
- self.assertRaises(FatalError, self.dec._MacroParser, 'DEFINE ')
-
-#
-# Test _DecBase._TryBackSlash function
-#
-class TryBackSlashTestCase(unittest.TestCase):
- def setUp(self):
- Content = [
- # Right case
- 'test no backslash',
-
- 'test with backslash \\',
- 'continue second line',
-
- # Do not precede with whitespace
- '\\',
-
- # Empty line after backlash is not allowed
- 'line with backslash \\',
- ''
- ]
- self.dec = _DecBase(FileContent('dummy', Content))
-
- def testBackSlash(self):
- #
- # Right case, assert return values
- #
- ConcatLine, CommentList = self.dec._TryBackSlash(self.dec._RawData.GetNextLine(), [])
- self.assertEqual(ConcatLine, 'test no backslash')
- self.assertEqual(CommentList, [])
-
- ConcatLine, CommentList = self.dec._TryBackSlash(self.dec._RawData.GetNextLine(), [])
- self.assertEqual(CommentList, [])
- self.assertEqual(ConcatLine, 'test with backslash continue second line')
-
- #
- # Error cases, assert raise exception
- #
- self.assertRaises(FatalError, self.dec._TryBackSlash, self.dec._RawData.GetNextLine(), [])
- self.assertRaises(FatalError, self.dec._TryBackSlash, self.dec._RawData.GetNextLine(), [])
-
-#
-# Test _DecBase.Parse function
-#
-class DataItem(_DecComments):
- def __init__(self):
- _DecComments.__init__(self)
- self.String = ''
-
-class Data(_DecComments):
- def __init__(self):
- _DecComments.__init__(self)
- # List of DataItem
- self.ItemList = []
-
-class TestInner(_DecBase):
- def __init__(self, RawData):
- _DecBase.__init__(self, RawData)
- self.ItemObject = Data()
-
- def _StopCurrentParsing(self, Line):
- return Line == '[TOP]'
-
- def _ParseItem(self):
- Item = DataItem()
- Item.String = self._RawData.CurrentLine
- self.ItemObject.ItemList.append(Item)
- return Item
-
- def _TailCommentStrategy(self, Comment):
- return Comment.find('@comment') != -1
-
-class TestTop(_DecBase):
- def __init__(self, RawData):
- _DecBase.__init__(self, RawData)
- # List of Data
- self.ItemObject = []
-
- # Top parser
- def _StopCurrentParsing(self, Line):
- return False
-
- def _ParseItem(self):
- TestParser = TestInner(self._RawData)
- TestParser.Parse()
- self.ItemObject.append(TestParser.ItemObject)
- return TestParser.ItemObject
-
-class ParseTestCase(unittest.TestCase):
- def setUp(self):
- pass
-
- def testParse(self):
- Content = \
- '''# Top comment
- [TOP]
- # sub1 head comment
- (test item has both head and tail comment) # sub1 tail comment
- # sub2 head comment
- (test item has head and special tail comment)
- # @comment test TailCommentStrategy branch
-
- (test item has no comment)
-
- # test NextLine branch
- [TOP]
- sub-item
- '''
- dec = TestTop(FileContent('dummy', Content.splitlines()))
- dec.Parse()
-
- # Two sections
- self.assertEqual(len(dec.ItemObject), 2)
-
- data = dec.ItemObject[0]
- self.assertEqual(data._HeadComment[0][0], '# Top comment')
- self.assertEqual(data._HeadComment[0][1], 1)
-
- # 3 subitems
- self.assertEqual(len(data.ItemList), 3)
-
- dataitem = data.ItemList[0]
- self.assertEqual(dataitem.String, '(test item has both head and tail comment)')
- # Comment content
- self.assertEqual(dataitem._HeadComment[0][0], '# sub1 head comment')
- self.assertEqual(dataitem._TailComment[0][0], '# sub1 tail comment')
- # Comment line number
- self.assertEqual(dataitem._HeadComment[0][1], 3)
- self.assertEqual(dataitem._TailComment[0][1], 4)
-
- dataitem = data.ItemList[1]
- self.assertEqual(dataitem.String, '(test item has head and special tail comment)')
- # Comment content
- self.assertEqual(dataitem._HeadComment[0][0], '# sub2 head comment')
- self.assertEqual(dataitem._TailComment[0][0], '# @comment test TailCommentStrategy branch')
- # Comment line number
- self.assertEqual(dataitem._HeadComment[0][1], 5)
- self.assertEqual(dataitem._TailComment[0][1], 7)
-
- dataitem = data.ItemList[2]
- self.assertEqual(dataitem.String, '(test item has no comment)')
- # Comment content
- self.assertEqual(dataitem._HeadComment, [])
- self.assertEqual(dataitem._TailComment, [])
-
- data = dec.ItemObject[1]
- self.assertEqual(data._HeadComment[0][0], '# test NextLine branch')
- self.assertEqual(data._HeadComment[0][1], 11)
-
- # 1 subitems
- self.assertEqual(len(data.ItemList), 1)
-
- dataitem = data.ItemList[0]
- self.assertEqual(dataitem.String, 'sub-item')
- self.assertEqual(dataitem._HeadComment, [])
- self.assertEqual(dataitem._TailComment, [])
-
-#
-# Test _DecDefine._ParseItem
-#
-class DecDefineTestCase(unittest.TestCase):
- def GetObj(self, Content):
- Obj = _DecDefine(FileContent('dummy', Content.splitlines()))
- Obj._RawData.CurrentLine = Obj._RawData.GetNextLine()
- return Obj
-
- def testDecDefine(self):
- item = self.GetObj('PACKAGE_NAME = MdePkg')._ParseItem()
- self.assertEqual(item.Key, 'PACKAGE_NAME')
- self.assertEqual(item.Value, 'MdePkg')
-
- def testDecDefine1(self):
- obj = self.GetObj('PACKAGE_NAME')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testDecDefine2(self):
- obj = self.GetObj('unknown_key = ')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testDecDefine3(self):
- obj = self.GetObj('PACKAGE_NAME = ')
- self.assertRaises(FatalError, obj._ParseItem)
-
-#
-# Test _DecLibraryclass._ParseItem
-#
-class DecLibraryTestCase(unittest.TestCase):
- def GetObj(self, Content):
- Obj = _DecLibraryclass(FileContent('dummy', Content.splitlines()))
- Obj._RawData.CurrentLine = Obj._RawData.GetNextLine()
- return Obj
-
- def testNoInc(self):
- obj = self.GetObj('UefiRuntimeLib')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testEmpty(self):
- obj = self.GetObj(' | ')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testLibclassNaming(self):
- obj = self.GetObj('lowercase_efiRuntimeLib|Include/Library/UefiRuntimeLib.h')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testLibclassExt(self):
- obj = self.GetObj('RuntimeLib|Include/Library/UefiRuntimeLib.no_h')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testLibclassRelative(self):
- obj = self.GetObj('RuntimeLib|Include/../UefiRuntimeLib.h')
- self.assertRaises(FatalError, obj._ParseItem)
-
-#
-# Test _DecPcd._ParseItem
-#
-class DecPcdTestCase(unittest.TestCase):
- def GetObj(self, Content):
- Obj = _DecPcd(FileContent('dummy', Content.splitlines()))
- Obj._RawData.CurrentLine = Obj._RawData.GetNextLine()
- Obj._RawData.CurrentScope = [('PcdsFeatureFlag'.upper(), 'COMMON')]
- return Obj
-
- def testOK(self):
- item = self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE|BOOLEAN|0x0000000d')._ParseItem()
- self.assertEqual(item.TokenSpaceGuidCName, 'gEfiMdePkgTokenSpaceGuid')
- self.assertEqual(item.TokenCName, 'PcdComponentNameDisable')
- self.assertEqual(item.DefaultValue, 'FALSE')
- self.assertEqual(item.DatumType, 'BOOLEAN')
- self.assertEqual(item.TokenValue, '0x0000000d')
-
- def testNoCvar(self):
- obj = self.GetObj('123ai.PcdComponentNameDisable|FALSE|BOOLEAN|0x0000000d')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testSplit(self):
- obj = self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable FALSE|BOOLEAN|0x0000000d')
- self.assertRaises(FatalError, obj._ParseItem)
-
- obj = self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE|BOOLEAN|0x0000000d | abc')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testUnknownType(self):
- obj = self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE|unknown|0x0000000d')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testVoid(self):
- obj = self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|abc|VOID*|0x0000000d')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testUINT(self):
- obj = self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|0xabc|UINT8|0x0000000d')
- self.assertRaises(FatalError, obj._ParseItem)
-
-#
-# Test _DecInclude._ParseItem
-#
-class DecIncludeTestCase(unittest.TestCase):
- #
- # Test code to be added
- #
- pass
-
-#
-# Test _DecGuid._ParseItem
-#
-class DecGuidTestCase(unittest.TestCase):
- def GetObj(self, Content):
- Obj = _DecGuid(FileContent('dummy', Content.splitlines()))
- Obj._RawData.CurrentLine = Obj._RawData.GetNextLine()
- Obj._RawData.CurrentScope = [('guids'.upper(), 'COMMON')]
- return Obj
-
- def testCValue(self):
- item = self.GetObj('gEfiIpSecProtocolGuid={ 0xdfb386f7, 0xe100, 0x43ad,'
- ' {0x9c, 0x9a, 0xed, 0x90, 0xd0, 0x8a, 0x5e, 0x12 }}')._ParseItem()
- self.assertEqual(item.GuidCName, 'gEfiIpSecProtocolGuid')
- self.assertEqual(item.GuidCValue, '{ 0xdfb386f7, 0xe100, 0x43ad, {0x9c, 0x9a, 0xed, 0x90, 0xd0, 0x8a, 0x5e, 0x12 }}')
-
- def testGuidString(self):
- item = self.GetObj('gEfiIpSecProtocolGuid=1E73767F-8F52-4603-AEB4-F29B510B6766')._ParseItem()
- self.assertEqual(item.GuidCName, 'gEfiIpSecProtocolGuid')
- self.assertEqual(item.GuidCValue, '1E73767F-8F52-4603-AEB4-F29B510B6766')
-
- def testNoValue1(self):
- obj = self.GetObj('gEfiIpSecProtocolGuid')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testNoValue2(self):
- obj = self.GetObj('gEfiIpSecProtocolGuid=')
- self.assertRaises(FatalError, obj._ParseItem)
-
- def testNoName(self):
- obj = self.GetObj('=')
- self.assertRaises(FatalError, obj._ParseItem)
-
-#
-# Test Dec.__init__
-#
-class DecDecInitTestCase(unittest.TestCase):
- def testNoDecFile(self):
- self.assertRaises(FatalError, Dec, 'No_Such_File')
-
-class TmpFile:
- def __init__(self, File):
- self.File = File
-
- def Write(self, Content):
- try:
- FileObj = open(self.File, 'w')
- FileObj.write(Content)
- FileObj.close()
- except:
- pass
-
- def Remove(self):
- try:
- os.remove(self.File)
- except:
- pass
-
-#
-# Test Dec._UserExtentionSectionParser
-#
-class DecUESectionTestCase(unittest.TestCase):
- def setUp(self):
- self.File = TmpFile('test.dec')
- self.File.Write(
-'''[userextensions.intel."myid"]
-[userextensions.intel."myid".IA32]
-[userextensions.intel."myid".IA32,]
-[userextensions.intel."myid]
-'''
- )
-
- def tearDown(self):
- self.File.Remove()
-
- def testUserExtentionHeader(self):
- dec = Dec('test.dec', False)
-
- # OK: [userextensions.intel."myid"]
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- dec._UserExtentionSectionParser()
- self.assertEqual(len(dec._RawData.CurrentScope), 1)
- self.assertEqual(dec._RawData.CurrentScope[0][0], 'userextensions'.upper())
- self.assertEqual(dec._RawData.CurrentScope[0][1], 'intel')
- self.assertEqual(dec._RawData.CurrentScope[0][2], '"myid"')
- self.assertEqual(dec._RawData.CurrentScope[0][3], 'COMMON')
-
- # OK: [userextensions.intel."myid".IA32]
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- dec._UserExtentionSectionParser()
- self.assertEqual(len(dec._RawData.CurrentScope), 1)
- self.assertEqual(dec._RawData.CurrentScope[0][0], 'userextensions'.upper())
- self.assertEqual(dec._RawData.CurrentScope[0][1], 'intel')
- self.assertEqual(dec._RawData.CurrentScope[0][2], '"myid"')
- self.assertEqual(dec._RawData.CurrentScope[0][3], 'IA32')
-
- # Fail: [userextensions.intel."myid".IA32,]
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- self.assertRaises(FatalError, dec._UserExtentionSectionParser)
-
- # Fail: [userextensions.intel."myid]
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- self.assertRaises(FatalError, dec._UserExtentionSectionParser)
-
-#
-# Test Dec._SectionHeaderParser
-#
-class DecSectionTestCase(unittest.TestCase):
- def setUp(self):
- self.File = TmpFile('test.dec')
- self.File.Write(
-'''[no section start or end
-[,] # empty sub-section
-[unknow_section_name]
-[Includes.IA32.other] # no third one
-[PcdsFeatureFlag, PcdsFixedAtBuild] # feature flag PCD must not be in the same section of other types of PCD
-[Includes.IA32, Includes.IA32]
-[Includes, Includes.IA32] # common cannot be with other arch
-[Includes.IA32, PcdsFeatureFlag] # different section name
-''' )
-
- def tearDown(self):
- self.File.Remove()
-
- def testSectionHeader(self):
- dec = Dec('test.dec', False)
- # [no section start or end
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- self.assertRaises(FatalError, dec._SectionHeaderParser)
-
- #[,] # empty sub-section
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- self.assertRaises(FatalError, dec._SectionHeaderParser)
-
- # [unknow_section_name]
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- self.assertRaises(FatalError, dec._SectionHeaderParser)
-
- # [Includes.IA32.other] # no third one
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- self.assertRaises(FatalError, dec._SectionHeaderParser)
-
- # [PcdsFeatureFlag, PcdsFixedAtBuild]
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- self.assertRaises(FatalError, dec._SectionHeaderParser)
-
- # [Includes.IA32, Includes.IA32]
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- dec._SectionHeaderParser()
- self.assertEqual(len(dec._RawData.CurrentScope), 1)
- self.assertEqual(dec._RawData.CurrentScope[0][0], 'Includes'.upper())
- self.assertEqual(dec._RawData.CurrentScope[0][1], 'IA32')
-
- # [Includes, Includes.IA32] # common cannot be with other arch
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- self.assertRaises(FatalError, dec._SectionHeaderParser)
-
- # [Includes.IA32, PcdsFeatureFlag] # different section name not allowed
- dec._RawData.CurrentLine = CleanString(dec._RawData.GetNextLine())[0]
- self.assertRaises(FatalError, dec._SectionHeaderParser)
-
-#
-# Test Dec._ParseDecComment
-#
-class DecDecCommentTestCase(unittest.TestCase):
- def testDecHeadComment(self):
- File = TmpFile('test.dec')
- File.Write(
- '''# abc
- ##''')
- dec = Dec('test.dec', False)
- dec.ParseDecComment()
- self.assertEqual(len(dec._HeadComment), 2)
- self.assertEqual(dec._HeadComment[0][0], '# abc')
- self.assertEqual(dec._HeadComment[0][1], 1)
- self.assertEqual(dec._HeadComment[1][0], '##')
- self.assertEqual(dec._HeadComment[1][1], 2)
- File.Remove()
-
- def testNoDoubleComment(self):
- File = TmpFile('test.dec')
- File.Write(
- '''# abc
- #
- [section_start]''')
- dec = Dec('test.dec', False)
- dec.ParseDecComment()
- self.assertEqual(len(dec._HeadComment), 2)
- self.assertEqual(dec._HeadComment[0][0], '# abc')
- self.assertEqual(dec._HeadComment[0][1], 1)
- self.assertEqual(dec._HeadComment[1][0], '#')
- self.assertEqual(dec._HeadComment[1][1], 2)
- File.Remove()
-
-if __name__ == '__main__':
- import Logger.Logger
- Logger.Logger.Initialize()
- unittest.main()
-
diff --git a/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py b/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py
deleted file mode 100644
index f3b43ee0bc..0000000000
--- a/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py
+++ /dev/null
@@ -1,386 +0,0 @@
-## @file
-# This file contain unit test for Test [Binary] section part of InfParser
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-import os
-#import Object.Parser.InfObject as InfObject
-from Object.Parser.InfCommonObject import CurrentLine
-from Object.Parser.InfCommonObject import InfLineCommentObject
-from Object.Parser.InfBinaryObject import InfBinariesObject
-import Logger.Log as Logger
-import Library.GlobalData as Global
-##
-# Test Common binary item
-#
-
-#-------------start of common binary item test input--------------------------#
-
-#
-# Only has 1 element, binary item Type
-#
-SectionStringsCommonItem1 = \
-"""
-GUID
-"""
-#
-# Have 2 elements, binary item Type and FileName
-#
-SectionStringsCommonItem2 = \
-"""
-GUID | Test/Test.guid
-"""
-
-#
-# Have 3 elements, Type | FileName | Target | Family | TagName | FeatureFlagExp
-#
-SectionStringsCommonItem3 = \
-"""
-GUID | Test/Test.guid | DEBUG
-"""
-
-#
-# Have 3 elements, Type | FileName | Target
-# Target with MACRO defined in [Define] section
-#
-SectionStringsCommonItem4 = \
-"""
-GUID | Test/Test.guid | $(TARGET)
-"""
-
-#
-# Have 3 elements, Type | FileName | Target
-# FileName with MACRO defined in [Binary] section
-#
-SectionStringsCommonItem5 = \
-"""
-DEFINE BINARY_FILE_PATH = Test
-GUID | $(BINARY_FILE_PATH)/Test.guid | $(TARGET)
-"""
-
-#
-# Have 4 elements, Type | FileName | Target | Family
-#
-SectionStringsCommonItem6 = \
-"""
-GUID | Test/Test.guid | DEBUG | *
-"""
-
-#
-# Have 4 elements, Type | FileName | Target | Family
-#
-SectionStringsCommonItem7 = \
-"""
-GUID | Test/Test.guid | DEBUG | MSFT
-"""
-
-#
-# Have 5 elements, Type | FileName | Target | Family | TagName
-#
-SectionStringsCommonItem8 = \
-"""
-GUID | Test/Test.guid | DEBUG | MSFT | TEST
-"""
-
-#
-# Have 6 elements, Type | FileName | Target | Family | TagName | FFE
-#
-SectionStringsCommonItem9 = \
-"""
-GUID | Test/Test.guid | DEBUG | MSFT | TEST | TRUE
-"""
-
-#
-# Have 7 elements, Type | FileName | Target | Family | TagName | FFE | Overflow
-# Test wrong format
-#
-SectionStringsCommonItem10 = \
-"""
-GUID | Test/Test.guid | DEBUG | MSFT | TEST | TRUE | OVERFLOW
-"""
-
-#-------------end of common binary item test input----------------------------#
-
-
-
-#-------------start of VER type binary item test input------------------------#
-
-#
-# Has 1 element, error format
-#
-SectionStringsVerItem1 = \
-"""
-VER
-"""
-#
-# Have 5 elements, error format(Maximum elements amount is 4)
-#
-SectionStringsVerItem2 = \
-"""
-VER | Test/Test.ver | * | TRUE | OverFlow
-"""
-
-#
-# Have 2 elements, Type | FileName
-#
-SectionStringsVerItem3 = \
-"""
-VER | Test/Test.ver
-"""
-
-#
-# Have 3 elements, Type | FileName | Target
-#
-SectionStringsVerItem4 = \
-"""
-VER | Test/Test.ver | DEBUG
-"""
-
-#
-# Have 4 elements, Type | FileName | Target | FeatureFlagExp
-#
-SectionStringsVerItem5 = \
-"""
-VER | Test/Test.ver | DEBUG | TRUE
-"""
-
-#
-# Exist 2 VER items, both opened.
-#
-SectionStringsVerItem6 = \
-"""
-VER | Test/Test.ver | * | TRUE
-VER | Test/Test2.ver | * | TRUE
-"""
-
-
-#
-# Exist 2 VER items, only 1 opened.
-#
-SectionStringsVerItem7 = \
-"""
-VER | Test/Test.ver | * | TRUE
-VER | Test/Test2.ver | * | FALSE
-"""
-
-#-------------end of VER type binary item test input--------------------------#
-
-
-#-------------start of UI type binary item test input-------------------------#
-
-#
-# Test only one UI section can exist
-#
-SectionStringsUiItem1 = \
-"""
-UI | Test/Test.ui | * | TRUE
-UI | Test/Test2.ui | * | TRUE
-"""
-
-SectionStringsUiItem2 = \
-"""
-UI | Test/Test.ui | * | TRUE
-SEC_UI | Test/Test2.ui | * | TRUE
-"""
-
-SectionStringsUiItem3 = \
-"""
-UI | Test/Test.ui | * | TRUE
-UI | Test/Test2.ui | * | FALSE
-"""
-
-#
-# Has 1 element, error format
-#
-SectionStringsUiItem4 = \
-"""
-UI
-"""
-#
-# Have 5 elements, error format(Maximum elements amount is 4)
-#
-SectionStringsUiItem5 = \
-"""
-UI | Test/Test.ui | * | TRUE | OverFlow
-"""
-
-#
-# Have 2 elements, Type | FileName
-#
-SectionStringsUiItem6 = \
-"""
-UI | Test/Test.ui
-"""
-
-#
-# Have 3 elements, Type | FileName | Target
-#
-SectionStringsUiItem7 = \
-"""
-UI | Test/Test.ui | DEBUG
-"""
-
-#
-# Have 4 elements, Type | FileName | Target | FeatureFlagExp
-#
-SectionStringsUiItem8 = \
-"""
-UI | Test/Test.ui | DEBUG | TRUE
-"""
-#---------------end of UI type binary item test input-------------------------#
-
-
-gFileName = "BinarySectionTest.inf"
-
-##
-# Construct SectionString for call section parser usage.
-#
-def StringToSectionString(String):
- Lines = String.split('\n')
- LineNo = 0
- SectionString = []
- for Line in Lines:
- if Line.strip() == '':
- continue
- SectionString.append((Line, LineNo, ''))
- LineNo = LineNo + 1
-
- return SectionString
-
-def PrepareTest(String):
- SectionString = StringToSectionString(String)
- ItemList = []
- for Item in SectionString:
- ValueList = Item[0].split('|')
- for count in range(len(ValueList)):
- ValueList[count] = ValueList[count].strip()
- if len(ValueList) >= 2:
- #
- # Create a temp file for test.
- #
- FileName = os.path.normpath(os.path.realpath(ValueList[1].strip()))
- try:
- TempFile = open (FileName, "w")
- TempFile.close()
- except:
- print "File Create Error"
- CurrentLine = CurrentLine()
- CurrentLine.SetFileName("Test")
- CurrentLine.SetLineString(Item[0])
- CurrentLine.SetLineNo(Item[1])
- InfLineCommentObject = InfLineCommentObject()
-
- ItemList.append((ValueList, InfLineCommentObject, CurrentLine))
-
- return ItemList
-
-if __name__ == '__main__':
- Logger.Initialize()
-
- InfBinariesInstance = InfBinariesObject()
- ArchList = ['COMMON']
- Global.gINF_MODULE_DIR = os.getcwd()
-
- AllPassedFlag = True
-
- #
- # For All Ui test
- #
- UiStringList = [
- SectionStringsUiItem1,
- SectionStringsUiItem2,
- SectionStringsUiItem3,
- SectionStringsUiItem4,
- SectionStringsUiItem5,
- SectionStringsUiItem6,
- SectionStringsUiItem7,
- SectionStringsUiItem8
- ]
-
- for Item in UiStringList:
- Ui = PrepareTest(Item)
- if Item == SectionStringsUiItem4 or Item == SectionStringsUiItem5:
- try:
- InfBinariesInstance.SetBinary(Ui = Ui, ArchList = ArchList)
- except Logger.FatalError:
- pass
- else:
- try:
- InfBinariesInstance.SetBinary(Ui = Ui, ArchList = ArchList)
- except:
- AllPassedFlag = False
-
- #
- # For All Ver Test
- #
- VerStringList = [
- SectionStringsVerItem1,
- SectionStringsVerItem2,
- SectionStringsVerItem3,
- SectionStringsVerItem4,
- SectionStringsVerItem5,
- SectionStringsVerItem6,
- SectionStringsVerItem7
- ]
- for Item in VerStringList:
- Ver = PrepareTest(Item)
- if Item == SectionStringsVerItem1 or \
- Item == SectionStringsVerItem2:
-
- try:
- InfBinariesInstance.SetBinary(Ver = Ver, ArchList = ArchList)
- except:
- pass
-
- else:
- try:
- InfBinariesInstance.SetBinary(Ver = Ver, ArchList = ArchList)
- except:
- AllPassedFlag = False
-
- #
- # For All Common Test
- #
- CommonStringList = [
- SectionStringsCommonItem1,
- SectionStringsCommonItem2,
- SectionStringsCommonItem3,
- SectionStringsCommonItem4,
- SectionStringsCommonItem5,
- SectionStringsCommonItem6,
- SectionStringsCommonItem7,
- SectionStringsCommonItem8,
- SectionStringsCommonItem9,
- SectionStringsCommonItem10
- ]
-
- for Item in CommonStringList:
- CommonBin = PrepareTest(Item)
- if Item == SectionStringsCommonItem10 or \
- Item == SectionStringsCommonItem1:
-
- try:
- InfBinariesInstance.SetBinary(CommonBinary = CommonBin, ArchList = ArchList)
- except:
- pass
-
- else:
- try:
- InfBinariesInstance.SetBinary(Ver = Ver, ArchList = ArchList)
- except:
- print "Test Failed!"
- AllPassedFlag = False
-
- if AllPassedFlag :
- print 'All tests passed...'
- else:
- print 'Some unit test failed!'
-
diff --git a/BaseTools/Source/Python/UPT/Xml/CommonXml.py b/BaseTools/Source/Python/UPT/Xml/CommonXml.py
deleted file mode 100644
index fff6e6772e..0000000000
--- a/BaseTools/Source/Python/UPT/Xml/CommonXml.py
+++ /dev/null
@@ -1,879 +0,0 @@
-## @file
-# This file is used to parse a PCD file of .PKG file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-CommonXml
-'''
-
-##
-# Import Modules
-#
-
-from Core.DistributionPackageClass import DistributionPackageHeaderObject
-from Library.String import ConvertNEToNOTEQ
-from Library.String import ConvertNOTEQToNE
-from Library.String import GetSplitValueList
-from Library.String import GetStringOfList
-from Library.Xml.XmlRoutines import XmlElement
-from Library.Xml.XmlRoutines import XmlElement2
-from Library.Xml.XmlRoutines import XmlAttribute
-from Library.Xml.XmlRoutines import XmlNode
-from Library.Xml.XmlRoutines import XmlList
-from Library.Xml.XmlRoutines import CreateXmlElement
-from Object.POM.CommonObject import FileObject
-from Object.POM.CommonObject import MiscFileObject
-from Object.POM.CommonObject import UserExtensionObject
-from Object.POM.CommonObject import ClonedRecordObject
-from Object.POM.CommonObject import LibraryClassObject
-from Object.POM.CommonObject import FileNameObject
-from Object.POM.ModuleObject import ModuleObject
-from Xml.XmlParserMisc import IsRequiredItemListNull
-from Xml.XmlParserMisc import GetHelpTextList
-
-import Library.DataType as DataType
-
-##
-# ClonedFromXml
-#
-class ClonedFromXml(object):
- def __init__(self):
- self.GUID = ''
- self.Version = ''
-
- def FromXml(self, Item, Key):
- self.GUID = XmlElement(Item, '%s/GUID' % Key)
- self.Version = XmlAttribute(XmlNode(Item, '%s/GUID' % Key), 'Version')
-
- if self.GUID == '' and self.Version == '':
- return None
-
- ClonedFrom = ClonedRecordObject()
- ClonedFrom.SetPackageGuid(self.GUID)
- ClonedFrom.SetPackageVersion(self.Version)
-
- return ClonedFrom
-
- def ToXml(self, ClonedFrom, Key):
- if self.GUID:
- pass
- Element1 = CreateXmlElement('GUID', ClonedFrom.GetPackageGuid(), [],
- [['Version', ClonedFrom.GetPackageVersion()]])
- AttributeList = []
- NodeList = [Element1]
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- return "GUID = %s Version = %s" % (self.GUID, self.Version)
-
-
-##
-# CommonDefinesXml
-#
-class CommonDefinesXml(object):
- def __init__(self):
- self.Usage = ''
- self.SupArchList = []
- self.SupModList = []
- self.FeatureFlag = ''
-
- def FromXml(self, Item, Key):
- if Key:
- pass
- self.Usage = XmlAttribute(Item, 'Usage')
- self.SupArchList = \
- [Arch for Arch in GetSplitValueList(XmlAttribute(Item, 'SupArchList'), DataType.TAB_SPACE_SPLIT) if Arch]
- self.SupModList = \
- [Mod for Mod in GetSplitValueList(XmlAttribute(Item, 'SupModList'), DataType.TAB_SPACE_SPLIT) if Mod]
- self.FeatureFlag = ConvertNOTEQToNE(XmlAttribute(Item, 'FeatureFlag'))
-
-
- def ToXml(self):
- pass
-
- def __str__(self):
- return "Usage = %s SupArchList = %s SupModList = %s FeatureFlag = %s" \
- % (self.Usage, self.SupArchList, self.SupModList, self.FeatureFlag)
-
-
-##
-# HelpTextXml
-#
-class HelpTextXml(object):
- def __init__(self):
- self.HelpText = ''
- self.Lang = ''
-
- def FromXml(self, Item, Key):
- if Key:
- pass
- self.HelpText = XmlElement2(Item, 'HelpText')
- self.Lang = XmlAttribute(Item, 'Lang')
-
- def ToXml(self, HelpText, Key='HelpText'):
- if self.HelpText:
- pass
- return CreateXmlElement('%s' % Key, HelpText.GetString(), [], [['Lang', HelpText.GetLang()]])
- def __str__(self):
- return "HelpText = %s Lang = %s" % (self.HelpText, self.Lang)
-
-##
-# HeaderXml
-#
-class HeaderXml(object):
- def __init__(self):
- self.Name = ''
- self.BaseName = ''
- self.GUID = ''
- self.Version = ''
- self.Copyright = ''
- self.License = ''
- self.Abstract = ''
- self.Description = ''
-
- def FromXml(self, Item, Key, IsRequiredCheck=False, IsStandAlongModule=False):
- if not Item and IsRequiredCheck:
- XmlTreeLevel = []
- if IsStandAlongModule:
- XmlTreeLevel = ['DistributionPackage', 'ModuleSurfaceArea']
- else:
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'ModuleSurfaceArea']
- CheckDict = {'Header':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- self.Name = XmlElement(Item, '%s/Name' % Key)
- self.BaseName = XmlAttribute(XmlNode(Item, '%s/Name' % Key), 'BaseName')
- self.GUID = XmlElement(Item, '%s/GUID' % Key)
- self.Version = XmlAttribute(XmlNode(Item, '%s/GUID' % Key), 'Version')
- self.Copyright = XmlElement(Item, '%s/Copyright' % Key)
- self.License = XmlElement(Item, '%s/License' % Key)
- self.Abstract = XmlElement(Item, '%s/Abstract' % Key)
- self.Description = XmlElement(Item, '%s/Description' % Key)
-
- ModuleHeader = ModuleObject()
- ModuleHeader.SetName(self.Name)
- ModuleHeader.SetBaseName(self.BaseName)
- ModuleHeader.SetGuid(self.GUID)
- ModuleHeader.SetVersion(self.Version)
- ModuleHeader.SetCopyright(self.Copyright)
- ModuleHeader.SetLicense(self.License)
- ModuleHeader.SetAbstract(self.Abstract)
- ModuleHeader.SetDescription(self.Description)
-
- return ModuleHeader
-
- def ToXml(self, Header, Key):
- if self.GUID:
- pass
- Element1 = CreateXmlElement('Name', Header.GetName(), [], [['BaseName', Header.GetBaseName()]])
- Element2 = CreateXmlElement('GUID', Header.GetGuid(), [], [['Version', Header.GetVersion()]])
- AttributeList = []
- NodeList = [Element1,
- Element2,
- ['Copyright', Header.GetCopyright()],
- ['License', Header.GetLicense()],
- ['Abstract', Header.GetAbstract()],
- ['Description', Header.GetDescription()],
- ]
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- return "Name = %s BaseName = %s GUID = %s Version = %s Copyright = %s \
- License = %s Abstract = %s Description = %s" % \
- (self.Name, self.BaseName, self.GUID, self.Version, self.Copyright, \
- self.License, self.Abstract, self.Description)
-##
-# DistributionPackageHeaderXml
-#
-class DistributionPackageHeaderXml(object):
- def __init__(self):
- self.Header = HeaderXml()
- self.ReadOnly = ''
- self.RePackage = ''
- self.Vendor = ''
- self.Date = ''
- self.Signature = ''
- self.XmlSpecification = ''
-
- def FromXml(self, Item, Key):
- if not Item:
- return None
- self.ReadOnly = XmlAttribute(XmlNode(Item, '%s' % Key), 'ReadOnly')
- self.RePackage = XmlAttribute(XmlNode(Item, '%s' % Key), 'RePackage')
- self.Vendor = XmlElement(Item, '%s/Vendor' % Key)
- self.Date = XmlElement(Item, '%s/Date' % Key)
- self.Signature = XmlElement(Item, '%s/Signature' % Key)
- self.XmlSpecification = XmlElement(Item, '%s/XmlSpecification' % Key)
- self.Header.FromXml(Item, Key)
-
- DistributionPackageHeader = DistributionPackageHeaderObject()
- if self.ReadOnly.upper() == 'TRUE':
- DistributionPackageHeader.ReadOnly = True
- elif self.ReadOnly.upper() == 'FALSE':
- DistributionPackageHeader.ReadOnly = False
-
- if self.RePackage.upper() == 'TRUE':
- DistributionPackageHeader.RePackage = True
- elif self.RePackage.upper() == 'FALSE':
- DistributionPackageHeader.RePackage = False
- DistributionPackageHeader.Vendor = self.Vendor
- DistributionPackageHeader.Date = self.Date
- DistributionPackageHeader.Signature = self.Signature
- DistributionPackageHeader.XmlSpecification = self.XmlSpecification
-
- DistributionPackageHeader.SetName(self.Header.Name)
- DistributionPackageHeader.SetBaseName(self.Header.BaseName)
- DistributionPackageHeader.SetGuid(self.Header.GUID)
- DistributionPackageHeader.SetVersion(self.Header.Version)
- DistributionPackageHeader.SetCopyright(self.Header.Copyright)
- DistributionPackageHeader.SetLicense(self.Header.License)
- DistributionPackageHeader.SetAbstract(self.Header.Abstract)
- DistributionPackageHeader.SetDescription(self.Header.Description)
-
- return DistributionPackageHeader
-
- def ToXml(self, DistributionPackageHeader, Key):
- if self.Header:
- pass
- Element1 = CreateXmlElement('Name', \
- DistributionPackageHeader.GetName(), [], \
- [['BaseName', \
- DistributionPackageHeader.GetBaseName()]])
- Element2 = CreateXmlElement('GUID', \
- DistributionPackageHeader.GetGuid(), [], \
- [['Version', \
- DistributionPackageHeader.GetVersion()]])
- AttributeList = []
- if DistributionPackageHeader.ReadOnly != '':
- AttributeList.append(['ReadOnly', str(DistributionPackageHeader.ReadOnly).lower()])
- if DistributionPackageHeader.RePackage != '':
- AttributeList.append(['RePackage', str(DistributionPackageHeader.RePackage).lower()])
-
- NodeList = [Element1,
- Element2,
- ['Vendor', DistributionPackageHeader.Vendor],
- ['Date', DistributionPackageHeader.Date],
- ['Copyright', DistributionPackageHeader.GetCopyright()],
- ['License', DistributionPackageHeader.GetLicense()],
- ['Abstract', DistributionPackageHeader.GetAbstract()],
- ['Description', \
- DistributionPackageHeader.GetDescription()],
- ['Signature', DistributionPackageHeader.Signature],
- ['XmlSpecification', \
- DistributionPackageHeader.XmlSpecification],
- ]
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- return "ReadOnly = %s RePackage = %s Vendor = %s Date = %s \
- Signature = %s XmlSpecification = %s %s" % \
- (self.ReadOnly, self.RePackage, self.Vendor, self.Date, \
- self.Signature, self.XmlSpecification, self.Header)
-##
-# PackageHeaderXml
-#
-class PackageHeaderXml(object):
- def __init__(self):
- self.Header = HeaderXml()
- self.PackagePath = ''
-
- def FromXml(self, Item, Key, PackageObject2):
- if not Item:
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea']
- CheckDict = {'PackageHeader':None, }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- self.PackagePath = XmlElement(Item, '%s/PackagePath' % Key)
- self.Header.FromXml(Item, Key)
-
- PackageObject2.SetName(self.Header.Name)
- PackageObject2.SetBaseName(self.Header.BaseName)
- PackageObject2.SetGuid(self.Header.GUID)
- PackageObject2.SetVersion(self.Header.Version)
- PackageObject2.SetCopyright(self.Header.Copyright)
- PackageObject2.SetLicense(self.Header.License)
- PackageObject2.SetAbstract(self.Header.Abstract)
- PackageObject2.SetDescription(self.Header.Description)
- PackageObject2.SetPackagePath(self.PackagePath)
-
- def ToXml(self, PackageObject2, Key):
- if self.PackagePath:
- pass
- Element1 = \
- CreateXmlElement('Name', PackageObject2.GetName(), [], \
- [['BaseName', PackageObject2.GetBaseName()]])
- Element2 = CreateXmlElement('GUID', PackageObject2.GetGuid(), [], \
- [['Version', PackageObject2.GetVersion()]])
- AttributeList = []
- NodeList = [Element1,
- Element2,
- ['Copyright', PackageObject2.GetCopyright()],
- ['License', PackageObject2.GetLicense()],
- ['Abstract', PackageObject2.GetAbstract()],
- ['Description', PackageObject2.GetDescription()],
- ['PackagePath', PackageObject2.GetPackagePath()],
- ]
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- return "PackagePath = %s %s" \
- % (self.PackagePath, self.Header)
-
-##
-# MiscellaneousFileXml
-#
-class MiscellaneousFileXml(object):
- def __init__(self):
- self.Header = HeaderXml()
- self.Files = []
- ##
- # This API is used for Package or Module's MiscellaneousFile section
- #
- def FromXml(self, Item, Key):
- if not Item:
- return None
- self.Header.FromXml(Item, Key)
- NewItem = XmlNode(Item, '%s/Header' % Key)
- self.Header.FromXml(NewItem, 'Header')
-
- for SubItem in XmlList(Item, '%s/Filename' % Key):
- Filename = XmlElement(SubItem, '%s/Filename' % Key)
- Executable = XmlAttribute(XmlNode(SubItem, '%s/Filename' % Key), 'Executable')
- if Executable.upper() == "TRUE":
- Executable = True
- else:
- Executable = False
- self.Files.append([Filename, Executable])
-
- MiscFile = MiscFileObject()
- MiscFile.SetCopyright(self.Header.Copyright)
- MiscFile.SetLicense(self.Header.License)
- MiscFile.SetAbstract(self.Header.Abstract)
- MiscFile.SetDescription(self.Header.Description)
- MiscFileList = []
- for File in self.Files:
- FileObj = FileObject()
- FileObj.SetURI(File[0])
- FileObj.SetExecutable(File[1])
- MiscFileList.append(FileObj)
- MiscFile.SetFileList(MiscFileList)
-
- return MiscFile
- ##
- # This API is used for DistP's tool section
- #
- def FromXml2(self, Item, Key):
- if Item is None:
- return None
-
- NewItem = XmlNode(Item, '%s/Header' % Key)
- self.Header.FromXml(NewItem, 'Header')
-
- for SubItem in XmlList(Item, '%s/Filename' % Key):
- Filename = XmlElement(SubItem, '%s/Filename' % Key)
- Executable = \
- XmlAttribute(XmlNode(SubItem, '%s/Filename' % Key), 'Executable')
- OsType = XmlAttribute(XmlNode(SubItem, '%s/Filename' % Key), 'OS')
- if Executable.upper() == "TRUE":
- Executable = True
- else:
- Executable = False
- self.Files.append([Filename, Executable, OsType])
-
- MiscFile = MiscFileObject()
- MiscFile.SetName(self.Header.Name)
- MiscFile.SetCopyright(self.Header.Copyright)
- MiscFile.SetLicense(self.Header.License)
- MiscFile.SetAbstract(self.Header.Abstract)
- MiscFile.SetDescription(self.Header.Description)
- MiscFileList = []
- for File in self.Files:
- FileObj = FileObject()
- FileObj.SetURI(File[0])
- FileObj.SetExecutable(File[1])
- FileObj.SetOS(File[2])
- MiscFileList.append(FileObj)
- MiscFile.SetFileList(MiscFileList)
-
- return MiscFile
-
- ##
- # This API is used for Package or Module's MiscellaneousFile section
- #
- def ToXml(self, MiscFile, Key):
- if self.Header:
- pass
- if MiscFile:
- NodeList = [['Copyright', MiscFile.GetCopyright()],
- ['License', MiscFile.GetLicense()],
- ['Abstract', MiscFile.GetAbstract()],
- ['Description', MiscFile.GetDescription()],
- ]
-
- for File in MiscFile.GetFileList():
- NodeList.append\
- (CreateXmlElement\
- ('Filename', File.GetURI(), [], \
- [['Executable', str(File.GetExecutable()).lower()]]))
- Root = CreateXmlElement('%s' % Key, '', NodeList, [])
-
- return Root
- ##
- # This API is used for DistP's tool section
- #
- def ToXml2(self, MiscFile, Key):
- if self.Header:
- pass
- if MiscFile:
- NodeList = [['Name', MiscFile.GetName()],
- ['Copyright', MiscFile.GetCopyright()],
- ['License', MiscFile.GetLicense()],
- ['Abstract', MiscFile.GetAbstract()],
- ['Description', MiscFile.GetDescription()],
- ]
- HeaderNode = CreateXmlElement('Header', '', NodeList, [])
- NodeList = [HeaderNode]
-
- for File in MiscFile.GetFileList():
- NodeList.append\
- (CreateXmlElement\
- ('Filename', File.GetURI(), [], \
- [['Executable', str(File.GetExecutable()).lower()], \
- ['OS', File.GetOS()]]))
- Root = CreateXmlElement('%s' % Key, '', NodeList, [])
-
- return Root
-
- def __str__(self):
- Str = str(self.Header)
- for Item in self.Files:
- Str = Str + '\n\tFilename:' + str(Item)
- return Str
-##
-# UserExtensionsXml
-#
-class UserExtensionsXml(object):
- def __init__(self):
- self.UserId = ''
- self.Identifier = ''
- self.DefineDict = {}
- self.BuildOptionDict = {}
- self.IncludesDict = {}
- self.SourcesDict = {}
- self.BinariesDict = {}
- self.SupArchList = []
- self.Statement = ''
- self.Defines = ''
- self.BuildOptions = ''
-
- def FromXml2(self, Item, Key):
- self.UserId = XmlAttribute(XmlNode(Item, '%s' % Key), 'UserId')
- self.Identifier = XmlAttribute(XmlNode(Item, '%s' % Key), 'Identifier')
-
- UserExtension = UserExtensionObject()
- UserExtension.SetUserID(self.UserId)
- UserExtension.SetIdentifier(self.Identifier)
-
- return UserExtension
-
- def FromXml(self, Item, Key):
- self.UserId = XmlAttribute(XmlNode(Item, '%s' % Key), 'UserId')
- self.Identifier = XmlAttribute(XmlNode(Item, '%s' % Key), 'Identifier')
-
- DefineItem = XmlNode(Item, '%s/Define' % Key)
- for SubItem in XmlList(DefineItem, 'Define/Statement'):
- Statement = XmlElement(SubItem, '%s/Statement' % Key)
- self.DefineDict[Statement] = ""
-
- BuildOptionItem = XmlNode(Item, '%s/BuildOption' % Key)
- for SubItem in XmlList(BuildOptionItem, 'BuildOption/Statement'):
- Statement = XmlElement(SubItem, '%s/Statement' % Key)
- Arch = XmlAttribute(XmlNode(SubItem, '%s/Statement' % Key), 'SupArchList')
- self.BuildOptionDict[Arch] = Statement
-
- IncludesItem = XmlNode(Item, '%s/Includes' % Key)
- for SubItem in XmlList(IncludesItem, 'Includes/Statement'):
- Statement = XmlElement(SubItem, '%s/Statement' % Key)
- Arch = XmlAttribute(XmlNode(SubItem, '%s/Statement' % Key), 'SupArchList')
- self.IncludesDict[Statement] = Arch
-
- SourcesItem = XmlNode(Item, '%s/Sources' % Key)
- Tmp = UserExtensionSourceXml()
- SourceDict = Tmp.FromXml(SourcesItem, 'Sources')
- self.SourcesDict = SourceDict
-
- BinariesItem = XmlNode(Item, '%s/Binaries' % Key)
- Tmp = UserExtensionBinaryXml()
- BinariesDict = Tmp.FromXml(BinariesItem, 'Binaries')
- self.BinariesDict = BinariesDict
-
- self.Statement = XmlElement(Item, 'UserExtensions')
- SupArch = XmlAttribute(XmlNode(Item, '%s' % Key), 'SupArchList')
- self.SupArchList = [Arch for Arch in GetSplitValueList(SupArch, DataType.TAB_SPACE_SPLIT) if Arch]
-
- UserExtension = UserExtensionObject()
- UserExtension.SetUserID(self.UserId)
- UserExtension.SetIdentifier(self.Identifier)
- UserExtension.SetStatement(self.Statement)
- UserExtension.SetSupArchList(self.SupArchList)
- UserExtension.SetDefinesDict(self.DefineDict)
- UserExtension.SetBuildOptionDict(self.BuildOptionDict)
- UserExtension.SetIncludesDict(self.IncludesDict)
- UserExtension.SetSourcesDict(self.SourcesDict)
- UserExtension.SetBinariesDict(self.BinariesDict)
-
- return UserExtension
-
- def ToXml(self, UserExtension, Key):
- if self.UserId:
- pass
-
- AttributeList = [['UserId', str(UserExtension.GetUserID())],
- ['Identifier', str(UserExtension.GetIdentifier())],
- ['SupArchList', \
- GetStringOfList(UserExtension.GetSupArchList())],
- ]
-
- Root = CreateXmlElement('%s' % Key, UserExtension.GetStatement(), [], \
- AttributeList)
-
- NodeList = []
- DefineDict = UserExtension.GetDefinesDict()
- if DefineDict:
- for Item in DefineDict.keys():
- NodeList.append(CreateXmlElement\
- ('Statement', Item, [], []))
- DefineElement = CreateXmlElement('Define', '', NodeList, [])
- Root.appendChild(DefineElement)
-
- NodeList = []
- BuildOptionDict = UserExtension.GetBuildOptionDict()
- if BuildOptionDict:
- for Item in BuildOptionDict.keys():
- NodeList.append(CreateXmlElement\
- ('Statement', BuildOptionDict[Item], [], \
- [['SupArchList', Item]]))
- BuildOptionElement = \
- CreateXmlElement('BuildOption', '', NodeList, [])
- Root.appendChild(BuildOptionElement)
-
- NodeList = []
- IncludesDict = UserExtension.GetIncludesDict()
- if IncludesDict:
- for Item in IncludesDict.keys():
- NodeList.append(CreateXmlElement\
- ('Statement', Item, [], \
- [['SupArchList', IncludesDict[Item]]]))
- IncludesElement = CreateXmlElement('Includes', '', NodeList, [])
- Root.appendChild(IncludesElement)
-
- NodeList = []
- SourcesDict = UserExtension.GetSourcesDict()
- if SourcesDict:
- Tmp = UserExtensionSourceXml()
- Root.appendChild(Tmp.ToXml(SourcesDict, 'Sources'))
-
- NodeList = []
- BinariesDict = UserExtension.GetBinariesDict()
- if BinariesDict:
- Tmp = UserExtensionBinaryXml()
- Root.appendChild(Tmp.ToXml(BinariesDict, 'Binaries'))
-
- return Root
-
- def __str__(self):
- Str = "UserId = %s Identifier = %s" % (self.UserId, self.Identifier)
- Str = Str + '\n\tDefines:' + str(self.Defines)
- Str = Str + '\n\tBuildOptions:' + str(self.BuildOptions)
- return Str
-
-##
-# UserExtensionSourceXml
-#
-class UserExtensionSourceXml(object):
- def __init__(self):
- self.UserExtensionSource = ''
-
- def FromXml(self, Item, Key):
- if Key:
- pass
- if self.UserExtensionSource:
- pass
- Dict = {}
-
- #SourcesItem = XmlNode(Item, '%s/Sources' % Key)
- for SubItem in XmlList(Item, 'Sources/SourceFile'):
- FileName = XmlElement(SubItem, 'SourceFile/FileName')
- Family = XmlElement(SubItem, 'SourceFile/Family')
- FeatureFlag = XmlElement(SubItem, 'SourceFile/FeatureFlag')
- SupArchStr = XmlElement(SubItem, 'SourceFile/SupArchList')
- DictKey = (FileName, Family, FeatureFlag, SupArchStr)
-
- ValueList = []
- for ValueNodeItem in XmlList(SubItem, \
- 'SourceFile/SourceFileOtherAttr'):
- TagName = XmlElement(ValueNodeItem, \
- 'SourceFileOtherAttr/TagName')
- ToolCode = XmlElement(ValueNodeItem, \
- 'SourceFileOtherAttr/ToolCode')
- Comment = XmlElement(ValueNodeItem, \
- 'SourceFileOtherAttr/Comment')
- if (TagName == ' ') and (ToolCode == ' ') and (Comment == ' '):
- TagName = ''
- ToolCode = ''
- Comment = ''
- ValueList.append((TagName, ToolCode, Comment))
-
- Dict[DictKey] = ValueList
-
- return Dict
-
- def ToXml(self, Dict, Key):
- if self.UserExtensionSource:
- pass
- SourcesNodeList = []
- for Item in Dict:
- ValueList = Dict[Item]
- (FileName, Family, FeatureFlag, SupArchStr) = Item
- SourceFileNodeList = []
- SourceFileNodeList.append(["FileName", FileName])
- SourceFileNodeList.append(["Family", Family])
- SourceFileNodeList.append(["FeatureFlag", FeatureFlag])
- SourceFileNodeList.append(["SupArchList", SupArchStr])
- for (TagName, ToolCode, Comment) in ValueList:
- ValueNodeList = []
- if not (TagName or ToolCode or Comment):
- TagName = ' '
- ToolCode = ' '
- Comment = ' '
- ValueNodeList.append(["TagName", TagName])
- ValueNodeList.append(["ToolCode", ToolCode])
- ValueNodeList.append(["Comment", Comment])
- ValueNodeXml = CreateXmlElement('SourceFileOtherAttr', '', \
- ValueNodeList, [])
- SourceFileNodeList.append(ValueNodeXml)
- SourceFileNodeXml = CreateXmlElement('SourceFile', '', \
- SourceFileNodeList, [])
- SourcesNodeList.append(SourceFileNodeXml)
- Root = CreateXmlElement('%s' % Key, '', SourcesNodeList, [])
- return Root
-
-##
-# UserExtensionBinaryXml
-#
-class UserExtensionBinaryXml(object):
- def __init__(self):
- self.UserExtensionBinary = ''
-
- def FromXml(self, Item, Key):
- if Key:
- pass
- if self.UserExtensionBinary:
- pass
-
- Dict = {}
-
- for SubItem in XmlList(Item, 'Binaries/Binary'):
- FileName = XmlElement(SubItem, 'Binary/FileName')
- FileType = XmlElement(SubItem, 'Binary/FileType')
- FFE = XmlElement(SubItem, 'Binary/FeatureFlag')
- SupArch = XmlElement(SubItem, 'Binary/SupArchList')
- DictKey = (FileName, FileType, ConvertNOTEQToNE(FFE), SupArch)
-
- ValueList = []
- for ValueNodeItem in XmlList(SubItem, \
- 'Binary/BinaryFileOtherAttr'):
- Target = XmlElement(ValueNodeItem, \
- 'BinaryFileOtherAttr/Target')
- Family = XmlElement(ValueNodeItem, \
- 'BinaryFileOtherAttr/Family')
- TagName = XmlElement(ValueNodeItem, \
- 'BinaryFileOtherAttr/TagName')
- Comment = XmlElement(ValueNodeItem, \
- 'BinaryFileOtherAttr/Comment')
- if (Target == ' ') and (Family == ' ') and \
- (TagName == ' ') and (Comment == ' '):
- Target = ''
- Family = ''
- TagName = ''
- Comment = ''
-
- ValueList.append((Target, Family, TagName, Comment))
-
- Dict[DictKey] = ValueList
-
- return Dict
-
- def ToXml(self, Dict, Key):
- if self.UserExtensionBinary:
- pass
- BinariesNodeList = []
- for Item in Dict:
- ValueList = Dict[Item]
- (FileName, FileType, FeatureFlag, SupArch) = Item
- FileNodeList = []
- FileNodeList.append(["FileName", FileName])
- FileNodeList.append(["FileType", FileType])
- FileNodeList.append(["FeatureFlag", ConvertNEToNOTEQ(FeatureFlag)])
- FileNodeList.append(["SupArchList", SupArch])
- for (Target, Family, TagName, Comment) in ValueList:
- ValueNodeList = []
- if not (Target or Family or TagName or Comment):
- Target = ' '
- Family = ' '
- TagName = ' '
- Comment = ' '
- ValueNodeList.append(["Target", Target])
- ValueNodeList.append(["Family", Family])
- ValueNodeList.append(["TagName", TagName])
- ValueNodeList.append(["Comment", Comment])
- ValueNodeXml = CreateXmlElement('BinaryFileOtherAttr', '', \
- ValueNodeList, [])
- FileNodeList.append(ValueNodeXml)
- FileNodeXml = CreateXmlElement('Binary', '', FileNodeList, [])
- BinariesNodeList.append(FileNodeXml)
- Root = CreateXmlElement('%s' % Key, '', BinariesNodeList, [])
- return Root
-
-##
-# LibraryClassXml
-#
-class LibraryClassXml(object):
- def __init__(self):
- self.Keyword = ''
- self.HeaderFile = ''
- self.RecommendedInstanceGuid = ''
- self.RecommendedInstanceVersion = ''
- self.CommonDefines = CommonDefinesXml()
- self.HelpText = []
-
- def FromXml(self, Item, Key):
- self.Keyword = XmlAttribute(XmlNode(Item, '%s' % Key), 'Keyword')
- if self.Keyword == '':
- self.Keyword = XmlElement(Item, '%s/Keyword' % Key)
- self.HeaderFile = XmlElement(Item, '%s/HeaderFile' % Key)
- self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
-
- LibraryClass = LibraryClassObject()
- LibraryClass.SetLibraryClass(self.Keyword)
- LibraryClass.SetIncludeHeader(self.HeaderFile)
- if self.CommonDefines.Usage:
- LibraryClass.SetUsage(self.CommonDefines.Usage)
- LibraryClass.SetSupArchList(self.CommonDefines.SupArchList)
- LibraryClass.SetSupModuleList(self.CommonDefines.SupModList)
- LibraryClass.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
- LibraryClass.SetHelpTextList(GetHelpTextList(self.HelpText))
-
- return LibraryClass
-
- def ToXml(self, LibraryClass, Key):
- if self.HeaderFile:
- pass
- AttributeList = \
- [['Keyword', LibraryClass.GetLibraryClass()],
- ['SupArchList', GetStringOfList(LibraryClass.GetSupArchList())],
- ['SupModList', GetStringOfList(LibraryClass.GetSupModuleList())]
- ]
- NodeList = [['HeaderFile', LibraryClass.GetIncludeHeader()]]
- for Item in LibraryClass.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
-
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def ToXml2(self, LibraryClass, Key):
- if self.HeaderFile:
- pass
-
- FeatureFlag = ConvertNEToNOTEQ(LibraryClass.GetFeatureFlag())
-
- AttributeList = \
- [['Usage', LibraryClass.GetUsage()], \
- ['SupArchList', GetStringOfList(LibraryClass.GetSupArchList())], \
- ['SupModList', GetStringOfList(LibraryClass.GetSupModuleList())], \
- ['FeatureFlag', FeatureFlag]
- ]
- NodeList = [['Keyword', LibraryClass.GetLibraryClass()], ]
- for Item in LibraryClass.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
-
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- Str = "Keyword = %s HeaderFile = %s RecommendedInstanceGuid = %s RecommendedInstanceVersion = %s %s" % \
- (self.Keyword, self.HeaderFile, self.RecommendedInstanceGuid, self.RecommendedInstanceVersion, \
- self.CommonDefines)
- for Item in self.HelpText:
- Str = Str + "\n\t" + str(Item)
- return Str
-
-##
-# FilenameXml
-#
-class FilenameXml(object):
- def __init__(self):
- self.FileType = ''
- self.Filename = ''
- self.CommonDefines = CommonDefinesXml()
-
- def FromXml(self, Item, Key):
- self.FileType = XmlAttribute(Item, 'FileType')
- self.Filename = XmlElement(Item, 'Filename')
- self.CommonDefines.FromXml(Item, Key)
-
- FeatureFlag = ConvertNOTEQToNE(self.CommonDefines.FeatureFlag)
-
- Filename = FileNameObject()
- #
- # Convert File Type
- #
- if self.FileType == 'UEFI_IMAGE':
- self.FileType = 'PE32'
-
- Filename.SetFileType(self.FileType)
- Filename.SetFilename(self.Filename)
- Filename.SetSupArchList(self.CommonDefines.SupArchList)
- Filename.SetFeatureFlag(FeatureFlag)
-
- return Filename
-
- def ToXml(self, Filename, Key):
- if self.Filename:
- pass
- AttributeList = [['SupArchList', \
- GetStringOfList(Filename.GetSupArchList())],
- ['FileType', Filename.GetFileType()],
- ['FeatureFlag', ConvertNEToNOTEQ(Filename.GetFeatureFlag())],
- ]
- Root = CreateXmlElement('%s' % Key, Filename.GetFilename(), [], AttributeList)
-
- return Root
-
- def __str__(self):
- return "FileType = %s Filename = %s %s" \
- % (self.FileType, self.Filename, self.CommonDefines)
diff --git a/BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py b/BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py
deleted file mode 100644
index bfd8d4f7bb..0000000000
--- a/BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py
+++ /dev/null
@@ -1,284 +0,0 @@
-## @file
-# This file is used to parse a xml file of .PKG file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-GuidProtocolPpiXml
-'''
-from Library.String import ConvertNEToNOTEQ
-from Library.String import ConvertNOTEQToNE
-from Library.String import GetStringOfList
-from Library.Xml.XmlRoutines import XmlElement
-from Library.Xml.XmlRoutines import XmlAttribute
-from Library.Xml.XmlRoutines import XmlNode
-from Library.Xml.XmlRoutines import XmlList
-from Library.Xml.XmlRoutines import CreateXmlElement
-
-from Object.POM.CommonObject import GuidObject
-from Object.POM.CommonObject import ProtocolObject
-from Object.POM.CommonObject import PpiObject
-
-from Xml.CommonXml import CommonDefinesXml
-from Xml.CommonXml import HelpTextXml
-
-from Xml.XmlParserMisc import GetHelpTextList
-
-##
-#GUID/Protocol/Ppi Common
-#
-class GuidProtocolPpiXml(object):
- def __init__(self, Mode):
- self.UiName = ''
- self.GuidTypes = ''
- self.Notify = ''
- self.CName = ''
- self.GuidValue = ''
- self.CommonDefines = CommonDefinesXml()
- self.HelpText = []
- #
- # Guid/Ppi/Library, internal used for indicate return object for
- # FromXml
- #
- self.Type = ''
- #
- # there are slightly different field between package and module
- #
- self.Mode = Mode
- self.GuidType = ''
- self.VariableName = ''
-
- def FromXml(self, Item, Key):
- self.UiName = XmlAttribute(XmlNode(Item, '%s' % Key), 'UiName')
- self.GuidType = XmlAttribute(XmlNode(Item, '%s' % Key), 'GuidType')
- self.Notify = XmlAttribute(XmlNode(Item, '%s' % Key), 'Notify')
- self.CName = XmlElement(Item, '%s/CName' % Key)
- self.GuidValue = XmlElement(Item, '%s/GuidValue' % Key)
- self.VariableName = XmlElement(Item, '%s/VariableName' % Key)
- self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
-
- if self.Type == 'Guid':
- GuidProtocolPpi = GuidObject()
- elif self.Type == 'Protocol':
- GuidProtocolPpi = ProtocolObject()
- else:
- GuidProtocolPpi = PpiObject()
- GuidProtocolPpi.SetHelpTextList(GetHelpTextList(self.HelpText))
-
- return GuidProtocolPpi
-
- def ToXml(self, GuidProtocolPpi, Key):
- if self.GuidValue:
- pass
- AttributeList = \
- [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())], \
- ['UiName', GuidProtocolPpi.GetName()], \
- ['GuidType', GetStringOfList(GuidProtocolPpi.GetGuidTypeList())], \
- ['Notify', str(GuidProtocolPpi.GetNotify()).lower()], \
- ['SupArchList', GetStringOfList(GuidProtocolPpi.GetSupArchList())], \
- ['SupModList', GetStringOfList(GuidProtocolPpi.GetSupModuleList())], \
- ['FeatureFlag', ConvertNEToNOTEQ(GuidProtocolPpi.GetFeatureFlag())]
- ]
- NodeList = [['CName', GuidProtocolPpi.GetCName()],
- ['GuidValue', GuidProtocolPpi.GetGuid()],
- ['VariableName', GuidProtocolPpi.VariableName]
- ]
- for Item in GuidProtocolPpi.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- Str = \
- "UiName = %s Notify = %s GuidTypes = %s CName = %s GuidValue = %s %s" \
- % (self.UiName, self.Notify, self.GuidTypes, self.CName, \
- self.GuidValue, self.CommonDefines)
- for Item in self.HelpText:
- Str = Str + "\n\t" + str(Item)
- return Str
-##
-#GUID Xml
-#
-class GuidXml(GuidProtocolPpiXml):
- def __init__(self, Mode):
- GuidProtocolPpiXml.__init__(self, Mode)
- self.Type = 'Guid'
-
- def FromXml(self, Item, Key):
- GuidProtocolPpi = GuidProtocolPpiXml.FromXml(self, Item, Key)
-
- if self.Mode == 'Package':
-
- GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)
- GuidProtocolPpi.SetSupModuleList(self.CommonDefines.SupModList)
- GuidProtocolPpi.SetCName(self.CName)
- GuidProtocolPpi.SetGuid(self.GuidValue)
- else:
- GuidProtocolPpi.SetUsage(self.CommonDefines.Usage)
- if self.GuidType:
- GuidProtocolPpi.SetGuidTypeList([self.GuidType])
- GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)
- GuidProtocolPpi.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
- GuidProtocolPpi.SetCName(self.CName)
- GuidProtocolPpi.SetVariableName(self.VariableName)
- return GuidProtocolPpi
-
- def ToXml(self, GuidProtocolPpi, Key):
- if self.Mode == 'Package':
- AttributeList = \
- [['GuidType', \
- GetStringOfList(GuidProtocolPpi.GetGuidTypeList())], \
- ['SupArchList', \
- GetStringOfList(GuidProtocolPpi.GetSupArchList())], \
- ['SupModList', \
- GetStringOfList(GuidProtocolPpi.GetSupModuleList())],
- ]
- NodeList = [['CName', GuidProtocolPpi.GetCName()],
- ['GuidValue', GuidProtocolPpi.GetGuid()],
- ]
- else:
- AttributeList = \
- [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())], \
- ['GuidType', GetStringOfList(GuidProtocolPpi.GetGuidTypeList())],\
- ['SupArchList', \
- GetStringOfList(GuidProtocolPpi.GetSupArchList())], \
- ['FeatureFlag', ConvertNEToNOTEQ(GuidProtocolPpi.GetFeatureFlag())]
- ]
- NodeList = [['CName', GuidProtocolPpi.GetCName()],
- ['VariableName', GuidProtocolPpi.GetVariableName()]
- ]
-
- for Item in GuidProtocolPpi.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-##
-#Protocol Xml
-#
-class ProtocolXml(GuidProtocolPpiXml):
- def __init__(self, Mode):
- GuidProtocolPpiXml.__init__(self, Mode)
- self.Type = 'Protocol'
-
- def FromXml(self, Item, Key):
- GuidProtocolPpi = GuidProtocolPpiXml.FromXml(self, Item, Key)
- if self.Mode == 'Package':
- GuidProtocolPpi.SetFeatureFlag(self.CommonDefines.FeatureFlag)
- GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)
- GuidProtocolPpi.SetSupModuleList(self.CommonDefines.SupModList)
- GuidProtocolPpi.SetCName(self.CName)
- GuidProtocolPpi.SetGuid(self.GuidValue)
- else:
- GuidProtocolPpi.SetUsage(self.CommonDefines.Usage)
- if self.Notify.upper() == "TRUE":
- GuidProtocolPpi.SetNotify(True)
- elif self.Notify.upper() == "FALSE":
- GuidProtocolPpi.SetNotify(False)
- else:
- GuidProtocolPpi.SetNotify('')
- GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)
- GuidProtocolPpi.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
- GuidProtocolPpi.SetCName(self.CName)
-
- return GuidProtocolPpi
-
- def ToXml(self, GuidProtocolPpi, Key):
- if self.Mode == 'Package':
- AttributeList = \
- [['SupArchList', \
- GetStringOfList(GuidProtocolPpi.GetSupArchList())], \
- ['SupModList', \
- GetStringOfList(GuidProtocolPpi.GetSupModuleList())], \
- ['FeatureFlag', GuidProtocolPpi.GetFeatureFlag()]
- ]
- NodeList = [['CName', GuidProtocolPpi.GetCName()],
- ['GuidValue', GuidProtocolPpi.GetGuid()],
- ]
- else:
- AttributeList = \
- [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())], \
- ['Notify', str(GuidProtocolPpi.GetNotify()).lower()], \
- ['SupArchList', \
- GetStringOfList(GuidProtocolPpi.GetSupArchList())], \
- ['FeatureFlag', ConvertNEToNOTEQ(GuidProtocolPpi.GetFeatureFlag())]
- ]
- NodeList = [['CName', GuidProtocolPpi.GetCName()],
- ]
-
- for Item in GuidProtocolPpi.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-##
-#Ppi Xml
-#
-class PpiXml(GuidProtocolPpiXml):
- def __init__(self, Mode):
- GuidProtocolPpiXml.__init__(self, Mode)
- self.Type = 'Ppi'
-
- def FromXml(self, Item, Key):
- GuidProtocolPpi = GuidProtocolPpiXml.FromXml(self, Item, Key)
- if self.Mode == 'Package':
- GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)
- GuidProtocolPpi.SetSupModuleList(self.CommonDefines.SupModList)
- GuidProtocolPpi.SetCName(self.CName)
- GuidProtocolPpi.SetGuid(self.GuidValue)
- else:
- GuidProtocolPpi.SetUsage(self.CommonDefines.Usage)
- if self.Notify.upper() == "TRUE":
- GuidProtocolPpi.SetNotify(True)
- elif self.Notify.upper() == "FALSE":
- GuidProtocolPpi.SetNotify(False)
- else:
- GuidProtocolPpi.SetNotify('')
- GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)
- GuidProtocolPpi.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
- GuidProtocolPpi.SetCName(self.CName)
-
- return GuidProtocolPpi
-
- def ToXml(self, GuidProtocolPpi, Key):
- if self.Mode == 'Package':
- AttributeList = \
- [['SupArchList', \
- GetStringOfList(GuidProtocolPpi.GetSupArchList())],
- ]
- NodeList = [['CName', GuidProtocolPpi.GetCName()],
- ['GuidValue', GuidProtocolPpi.GetGuid()],
- ]
- else:
- AttributeList = \
- [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())], \
- ['Notify', str(GuidProtocolPpi.GetNotify()).lower()], \
- ['SupArchList', \
- GetStringOfList(GuidProtocolPpi.GetSupArchList())], \
- ['FeatureFlag', ConvertNEToNOTEQ(GuidProtocolPpi.GetFeatureFlag())]
- ]
- NodeList = [['CName', GuidProtocolPpi.GetCName()],
- ]
-
- for Item in GuidProtocolPpi.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
- return Root
diff --git a/BaseTools/Source/Python/UPT/Xml/IniToXml.py b/BaseTools/Source/Python/UPT/Xml/IniToXml.py
deleted file mode 100644
index 4be20d00ca..0000000000
--- a/BaseTools/Source/Python/UPT/Xml/IniToXml.py
+++ /dev/null
@@ -1,503 +0,0 @@
-## @file
-# This file is for converting package information data file to xml file.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-IniToXml
-'''
-
-import os.path
-import re
-from time import strftime
-from time import localtime
-
-import Logger.Log as Logger
-from Logger.ToolError import UPT_INI_PARSE_ERROR
-from Logger.ToolError import FILE_NOT_FOUND
-from Library.Xml.XmlRoutines import CreateXmlElement
-from Library.DataType import TAB_VALUE_SPLIT
-from Library.DataType import TAB_EQUAL_SPLIT
-from Library.DataType import TAB_SECTION_START
-from Library.DataType import TAB_SECTION_END
-from Logger import StringTable as ST
-from Library.String import ConvertSpecialChar
-from Library.ParserValidate import IsValidPath
-
-## log error:
-#
-# @param error: error
-# @param File: File
-# @param Line: Line
-#
-def IniParseError(Error, File, Line):
- Logger.Error("UPT", UPT_INI_PARSE_ERROR, File=File,
- Line=Line, ExtraData=Error)
-
-## __ValidatePath
-#
-# @param Path: Path to be checked
-#
-def __ValidatePath(Path, Root):
- Path = Path.strip()
- if os.path.isabs(Path) or not IsValidPath(Path, Root):
- return False, ST.ERR_FILELIST_LOCATION % (Root, Path)
- return True, ''
-
-## ValidateMiscFile
-#
-# @param Filename: File to be checked
-#
-def ValidateMiscFile(Filename):
- Root = ''
- if 'WORKSPACE' in os.environ:
- Root = os.environ['WORKSPACE']
- return __ValidatePath(Filename, Root)
-
-## ValidateToolsFile
-#
-# @param Filename: File to be checked
-#
-def ValidateToolsFile(Filename):
- Valid, Cause = False, ''
- if not Valid and 'EDK_TOOLS_PATH' in os.environ:
- Valid, Cause = __ValidatePath(Filename, os.environ['EDK_TOOLS_PATH'])
- if not Valid and 'WORKSPACE' in os.environ:
- Valid, Cause = __ValidatePath(Filename, os.environ['WORKSPACE'])
- return Valid, Cause
-
-## ParseFileList
-#
-# @param Line: Line
-# @param Map: Map
-# @param CurrentKey: CurrentKey
-# @param PathFunc: Path validate function
-#
-def ParseFileList(Line, Map, CurrentKey, PathFunc):
- FileList = ["", {}]
- TokenList = Line.split(TAB_VALUE_SPLIT)
- if len(TokenList) > 0:
- Path = TokenList[0].strip().replace('\\', '/')
- if not Path:
- return False, ST.ERR_WRONG_FILELIST_FORMAT
- Valid, Cause = PathFunc(Path)
- if not Valid:
- return Valid, Cause
- FileList[0] = TokenList[0].strip()
- for Token in TokenList[1:]:
- Attr = Token.split(TAB_EQUAL_SPLIT)
- if len(Attr) != 2 or not Attr[0].strip() or not Attr[1].strip():
- return False, ST.ERR_WRONG_FILELIST_FORMAT
-
- Key = Attr[0].strip()
- Val = Attr[1].strip()
- if Key not in ['OS', 'Executable']:
- return False, ST.ERR_UNKNOWN_FILELIST_ATTR % Key
-
- if Key == 'OS' and Val not in ["Win32", "Win64", "Linux32",
- "Linux64", "OS/X32", "OS/X64",
- "GenericWin", "GenericNix"]:
- return False, ST.ERR_FILELIST_ATTR % 'OS'
- elif Key == 'Executable' and Val not in ['true', 'false']:
- return False, ST.ERR_FILELIST_ATTR % 'Executable'
- FileList[1][Key] = Val
-
- Map[CurrentKey].append(FileList)
- return True, ''
-
-## Create header XML file
-#
-# @param DistMap: DistMap
-# @param Root: Root
-#
-def CreateHeaderXml(DistMap, Root):
- Element1 = CreateXmlElement('Name', DistMap['Name'],
- [], [['BaseName', DistMap['BaseName']]])
- Element2 = CreateXmlElement('GUID', DistMap['GUID'],
- [], [['Version', DistMap['Version']]])
- AttributeList = [['ReadOnly', DistMap['ReadOnly']],
- ['RePackage', DistMap['RePackage']]]
- NodeList = [Element1,
- Element2,
- ['Vendor', DistMap['Vendor']],
- ['Date', DistMap['Date']],
- ['Copyright', DistMap['Copyright']],
- ['License', DistMap['License']],
- ['Abstract', DistMap['Abstract']],
- ['Description', DistMap['Description']],
- ['Signature', DistMap['Signature']],
- ['XmlSpecification', DistMap['XmlSpecification']],
- ]
- Root.appendChild(CreateXmlElement('DistributionHeader', '',
- NodeList, AttributeList))
-
-## Create tools XML file
-#
-# @param Map: Map
-# @param Root: Root
-# @param Tag: Tag
-#
-def CreateToolsXml(Map, Root, Tag):
- #
- # Check if all elements in this section are empty
- #
- for Key in Map:
- if len(Map[Key]) > 0:
- break
- else:
- return
-
- NodeList = [['Name', Map['Name']],
- ['Copyright', Map['Copyright']],
- ['License', Map['License']],
- ['Abstract', Map['Abstract']],
- ['Description', Map['Description']],
- ]
- HeaderNode = CreateXmlElement('Header', '', NodeList, [])
- NodeList = [HeaderNode]
-
- for File in Map['FileList']:
- AttrList = []
- for Key in File[1]:
- AttrList.append([Key, File[1][Key]])
- NodeList.append(CreateXmlElement('Filename', File[0], [], AttrList))
- Root.appendChild(CreateXmlElement(Tag, '', NodeList, []))
-
-## ValidateValues
-#
-# @param Key: Key
-# @param Value: Value
-# @param SectionName: SectionName
-#
-def ValidateValues(Key, Value, SectionName):
- if SectionName == 'DistributionHeader':
- Valid, Cause = ValidateRegValues(Key, Value)
- if not Valid:
- return Valid, Cause
- Valid = __ValidateDistHeader(Key, Value)
- if not Valid:
- return Valid, ST.ERR_VALUE_INVALID % (Key, SectionName)
- else:
- Valid = __ValidateOtherHeader(Key, Value)
- if not Valid:
- return Valid, ST.ERR_VALUE_INVALID % (Key, SectionName)
- return True, ''
-
-## ValidateRegValues
-#
-# @param Key: Key
-# @param Value: Value
-#
-def ValidateRegValues(Key, Value):
- ValidateMap = {
- 'ReadOnly' :
- ('true|false', ST.ERR_BOOLEAN_VALUE % (Key, Value)),
- 'RePackage' :
- ('true|false', ST.ERR_BOOLEAN_VALUE % (Key, Value)),
- 'GUID' :
- ('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}'
- '-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}',
- ST.ERR_GUID_VALUE % Value),
- 'Version' : ('[0-9]+(\.[0-9]+)?', ST.ERR_VERSION_VALUE % \
- (Key, Value)),
- 'XmlSpecification' : ('1\.1', ST.ERR_VERSION_XMLSPEC % Value)
- }
- if Key not in ValidateMap:
- return True, ''
- Elem = ValidateMap[Key]
- Match = re.compile(Elem[0]).match(Value)
- if Match and Match.start() == 0 and Match.end() == len(Value):
- return True, ''
- return False, Elem[1]
-
-## __ValidateDistHeaderName
-#
-# @param Name: Name
-#
-def __ValidateDistHeaderName(Name):
- if len(Name) < 1:
- return False
-
- for Char in Name:
- if ord(Char) < 0x20 or ord(Char) >= 0x7f:
- return False
- return True
-
-## __ValidateDistHeaderBaseName
-#
-# @param BaseName: BaseName
-#
-def __ValidateDistHeaderBaseName(BaseName):
- if not BaseName:
- return False
-# if CheckLen and len(BaseName) < 2:
-# return False
- if not BaseName[0].isalnum() and BaseName[0] != '_':
- return False
- for Char in BaseName[1:]:
- if not Char.isalnum() and Char not in '-_':
- return False
- return True
-
-## __ValidateDistHeaderAbstract
-#
-# @param Abstract: Abstract
-#
-def __ValidateDistHeaderAbstract(Abstract):
- return '\t' not in Abstract and len(Abstract.splitlines()) == 1
-
-## __ValidateOtherHeaderAbstract
-#
-# @param Abstract: Abstract
-#
-def __ValidateOtherHeaderAbstract(Abstract):
- return __ValidateDistHeaderAbstract(Abstract)
-
-## __ValidateDistHeader
-#
-# @param Key: Key
-# @param Value: Value
-#
-def __ValidateDistHeader(Key, Value):
- ValidateMap = {
- 'Name' : __ValidateDistHeaderName,
- 'BaseName' : __ValidateDistHeaderBaseName,
- 'Abstract' : __ValidateDistHeaderAbstract,
- 'Vendor' : __ValidateDistHeaderAbstract
- }
- return not (Value and Key in ValidateMap and not ValidateMap[Key](Value))
-
-## __ValidateOtherHeader
-#
-# @param Key: Key
-# @param Value: Value
-#
-def __ValidateOtherHeader(Key, Value):
- ValidateMap = {
- 'Name' : __ValidateDistHeaderName,
- 'Abstract' : __ValidateOtherHeaderAbstract
- }
- return not (Value and Key in ValidateMap and not ValidateMap[Key](Value))
-
-## Convert ini file to xml file
-#
-# @param IniFile
-#
-def IniToXml(IniFile):
- if not os.path.exists(IniFile):
- Logger.Error("UPT", FILE_NOT_FOUND, ST.ERR_TEMPLATE_NOTFOUND % IniFile)
-
- DistMap = {'ReadOnly' : '', 'RePackage' : '', 'Name' : '',
- 'BaseName' : '', 'GUID' : '', 'Version' : '', 'Vendor' : '',
- 'Date' : '', 'Copyright' : '', 'License' : '', 'Abstract' : '',
- 'Description' : '', 'Signature' : '', 'XmlSpecification' : ''
- }
-
- ToolsMap = {'Name' : '', 'Copyright' : '', 'License' : '',
- 'Abstract' : '', 'Description' : '', 'FileList' : []}
- #
- # Only FileList is a list: [['file1', {}], ['file2', {}], ...]
- #
- MiscMap = {'Name' : '', 'Copyright' : '', 'License' : '',
- 'Abstract' : '', 'Description' : '', 'FileList' : []}
-
- SectionMap = {
- 'DistributionHeader' : DistMap,
- 'ToolsHeader' : ToolsMap,
- 'MiscellaneousFilesHeader' : MiscMap
- }
-
- PathValidator = {
- 'ToolsHeader' : ValidateToolsFile,
- 'MiscellaneousFilesHeader' : ValidateMiscFile
- }
-
- ParsedSection = []
-
- SectionName = ''
- CurrentKey = ''
- PreMap = None
- Map = None
- FileContent = ConvertSpecialChar(open(IniFile, 'rb').readlines())
- LastIndex = 0
- for Index in range(0, len(FileContent)):
- LastIndex = Index
- Line = FileContent[Index].strip()
- if Line == '':
- continue
- if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
- CurrentKey = ''
- SectionName = Line[1:-1].strip()
- if SectionName not in SectionMap:
- IniParseError(ST.ERR_SECTION_NAME_INVALID % SectionName,
- IniFile, Index+1)
-
- if SectionName in ParsedSection:
- IniParseError(ST.ERR_SECTION_REDEFINE % SectionName,
- IniFile, Index+1)
- else:
- ParsedSection.append(SectionName)
-
- Map = SectionMap[SectionName]
- continue
- if not Map:
- IniParseError(ST.ERR_SECTION_NAME_NONE, IniFile, Index+1)
- TokenList = Line.split(TAB_EQUAL_SPLIT, 1)
- TempKey = TokenList[0].strip()
- #
- # Value spanned multiple or same keyword appears more than one time
- #
- if len(TokenList) < 2 or TempKey not in Map:
- if CurrentKey == '':
- IniParseError(ST.ERR_KEYWORD_INVALID % TempKey,
- IniFile, Index+1)
- elif CurrentKey == 'FileList':
- #
- # Special for FileList
- #
- Valid, Cause = ParseFileList(Line, Map, CurrentKey,
- PathValidator[SectionName])
- if not Valid:
- IniParseError(Cause, IniFile, Index+1)
-
- else:
- #
- # Multiple lines for one key such as license
- # Or if string on the left side of '=' is not a keyword
- #
- Map[CurrentKey] = ''.join([Map[CurrentKey], '\n', Line])
- Valid, Cause = ValidateValues(CurrentKey,
- Map[CurrentKey], SectionName)
- if not Valid:
- IniParseError(Cause, IniFile, Index+1)
- continue
-
- if (TokenList[1].strip() == ''):
- IniParseError(ST.ERR_EMPTY_VALUE, IniFile, Index+1)
-
- #
- # A keyword found
- #
- CurrentKey = TempKey
- if Map[CurrentKey]:
- IniParseError(ST.ERR_KEYWORD_REDEFINE % CurrentKey,
- IniFile, Index+1)
-
- if id(Map) != id(PreMap) and Map['Copyright']:
- PreMap = Map
- Copyright = Map['Copyright'].lower()
- Pos = Copyright.find('copyright')
- if Pos == -1:
- IniParseError(ST.ERR_COPYRIGHT_CONTENT, IniFile, Index)
- if not Copyright[Pos + len('copyright'):].lstrip(' ').startswith('('):
- IniParseError(ST.ERR_COPYRIGHT_CONTENT, IniFile, Index)
-
- if CurrentKey == 'FileList':
- Valid, Cause = ParseFileList(TokenList[1], Map, CurrentKey,
- PathValidator[SectionName])
- if not Valid:
- IniParseError(Cause, IniFile, Index+1)
- else:
- Map[CurrentKey] = TokenList[1].strip()
- Valid, Cause = ValidateValues(CurrentKey,
- Map[CurrentKey], SectionName)
- if not Valid:
- IniParseError(Cause, IniFile, Index+1)
-
- if id(Map) != id(PreMap) and Map['Copyright'] and 'copyright' not in Map['Copyright'].lower():
- IniParseError(ST.ERR_COPYRIGHT_CONTENT, IniFile, LastIndex)
-
- #
- # Check mandatory keys
- #
- CheckMdtKeys(DistMap, IniFile, LastIndex,
- (('ToolsHeader', ToolsMap), ('MiscellaneousFilesHeader', MiscMap))
- )
-
- return CreateXml(DistMap, ToolsMap, MiscMap, IniFile)
-
-
-## CheckMdtKeys
-#
-# @param MdtDistKeys: All mandatory keys
-# @param DistMap: Dist content
-# @param IniFile: Ini file
-# @param LastIndex: Last index of Ini file
-# @param Maps: Tools and Misc section name and map. (('section_name', map),*)
-#
-def CheckMdtKeys(DistMap, IniFile, LastIndex, Maps):
- MdtDistKeys = ['Name', 'GUID', 'Version', 'Vendor', 'Copyright', 'License', 'Abstract', 'XmlSpecification']
- for Key in MdtDistKeys:
- if Key not in DistMap or DistMap[Key] == '':
- IniParseError(ST.ERR_KEYWORD_MANDATORY % Key, IniFile, LastIndex+1)
-
- if '.' not in DistMap['Version']:
- DistMap['Version'] = DistMap['Version'] + '.0'
-
- DistMap['Date'] = str(strftime("%Y-%m-%dT%H:%M:%S", localtime()))
-
- #
- # Check Tools Surface Area according to UPT Spec
- # <Tools> {0,}
- # <Header> ... </Header> {0,1}
- # <Filename> ... </Filename> {1,}
- # </Tools>
- # <Header>
- # <Name> xs:normalizedString </Name> {1}
- # <Copyright> xs:string </Copyright> {0,1}
- # <License> xs:string </License> {0,1}
- # <Abstract> xs:normalizedString </Abstract> {0,1}
- # <Description> xs:string </Description> {0,1}
- # </Header>
- #
- for Item in Maps:
- Map = Item[1]
- NonEmptyKey = 0
- for Key in Map:
- if Map[Key]:
- NonEmptyKey += 1
-
- if NonEmptyKey > 0 and not Map['FileList']:
- IniParseError(ST.ERR_KEYWORD_MANDATORY % (Item[0] + '.FileList'), IniFile, LastIndex+1)
-
- if NonEmptyKey > 0 and not Map['Name']:
- IniParseError(ST.ERR_KEYWORD_MANDATORY % (Item[0] + '.Name'), IniFile, LastIndex+1)
-
-## CreateXml
-#
-# @param DistMap: Dist Content
-# @param ToolsMap: Tools Content
-# @param MiscMap: Misc Content
-# @param IniFile: Ini File
-#
-def CreateXml(DistMap, ToolsMap, MiscMap, IniFile):
- Attrs = [['xmlns', 'http://www.uefi.org/2011/1.1'],
- ['xmlns:xsi', 'http:/www.w3.org/2001/XMLSchema-instance'],
- ]
- Root = CreateXmlElement('DistributionPackage', '', [], Attrs)
- CreateHeaderXml(DistMap, Root)
- CreateToolsXml(ToolsMap, Root, 'Tools')
- CreateToolsXml(MiscMap, Root, 'MiscellaneousFiles')
-
- FileAndExt = IniFile.rsplit('.', 1)
- if len(FileAndExt) > 1:
- FileName = FileAndExt[0] + '.xml'
- else:
- FileName = IniFile + '.xml'
- File = open(FileName, 'w')
-
- try:
- File.write(Root.toprettyxml(indent = ' '))
- finally:
- File.close()
- return FileName
-
diff --git a/BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py b/BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py
deleted file mode 100644
index a913a859f6..0000000000
--- a/BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py
+++ /dev/null
@@ -1,997 +0,0 @@
-## @file
-# This file is used to parse a Module file of .PKG file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-ModuleSurfaceAreaXml
-'''
-from xml.dom import minidom
-
-from Library.String import ConvertNEToNOTEQ
-from Library.String import ConvertNOTEQToNE
-from Library.String import GetStringOfList
-from Library.Xml.XmlRoutines import XmlElement
-from Library.Xml.XmlRoutines import XmlAttribute
-from Library.Xml.XmlRoutines import XmlNode
-from Library.Xml.XmlRoutines import XmlList
-from Library.Xml.XmlRoutines import CreateXmlElement
-from Object.POM.CommonObject import GuidVersionObject
-from Object.POM.ModuleObject import BootModeObject
-from Object.POM.ModuleObject import DepexObject
-from Object.POM.ModuleObject import ModuleObject
-from Object.POM.ModuleObject import EventObject
-from Object.POM.ModuleObject import HobObject
-from Object.POM.ModuleObject import SourceFileObject
-from Object.POM.ModuleObject import PackageDependencyObject
-from Object.POM.ModuleObject import ExternObject
-from Object.POM.ModuleObject import BinaryFileObject
-from Object.POM.ModuleObject import AsBuiltObject
-from Object.POM.ModuleObject import BinaryBuildFlagObject
-from Xml.CommonXml import ClonedFromXml
-from Xml.CommonXml import HeaderXml
-from Xml.CommonXml import HelpTextXml
-from Xml.CommonXml import CommonDefinesXml
-from Xml.CommonXml import LibraryClassXml
-from Xml.CommonXml import UserExtensionsXml
-from Xml.CommonXml import MiscellaneousFileXml
-from Xml.CommonXml import FilenameXml
-from Xml.GuidProtocolPpiXml import GuidXml
-from Xml.GuidProtocolPpiXml import ProtocolXml
-from Xml.GuidProtocolPpiXml import PpiXml
-from Xml.PcdXml import PcdEntryXml
-from Xml.XmlParserMisc import GetHelpTextList
-from Library import GlobalData
-from Library.Misc import GetSplitValueList
-
-## BinaryFileXml
-#
-# represent the following XML item
-#
-# <BinaryFile>
-# <Filename
-# FileType=" FileType " {1}
-# SupArchList=" ArchListType " {0,1}
-# FeatureFlag=" FeatureFlagExpression " {0,1} >
-# xs:anyURI
-# </Filename> {1,}
-# <AsBuilt> ... </AsBuilt> {0,}
-# </BinaryFile> {1,}
-#
-class BinaryFileXml(object):
- def __init__(self):
- self.FileNames = []
- self.AsBuiltList = []
- self.PatchPcdValues = ''
- self.PcdExValues = ''
- self.LibraryInstances = ''
- self.BuildFlags = ''
-
- def FromXml(self, Item, Key):
- if self.FileNames:
- pass
- BinaryFile = BinaryFileObject()
- FilenameList = []
- for SubItem in XmlList(Item, '%s/Filename' % Key):
- Axml = FilenameXml()
- Bxml = Axml.FromXml(SubItem, 'Filename')
- FilenameList.append(Bxml)
- BinaryFile.SetFileNameList(FilenameList)
- if GlobalData.gIS_BINARY_INF:
- AsBuiltList = []
- for AsBuiltItem in XmlList(Item, '%s/AsBuilt' % Key):
- AsBuilt = AsBuiltObject()
-
- PatchPcdValueList = []
- for SubItem in XmlList(AsBuiltItem, 'AsBuilt/PatchPcdValue'):
- Axml = PcdEntryXml()
- Bxml = Axml.FromXml(SubItem, 'PatchPcdValue')
- PatchPcdValueList.append(Bxml)
- AsBuilt.SetPatchPcdList(PatchPcdValueList)
- PcdExValueList = []
- for SubItem in XmlList(AsBuiltItem, 'AsBuilt/PcdExValue'):
- Axml = PcdEntryXml()
- Bxml = Axml.FromXml(SubItem, 'PcdExValue')
- PcdExValueList.append(Bxml)
- AsBuilt.SetPcdExList(PcdExValueList)
- LibraryList = []
- for SubItem in XmlList(Item, '%s/AsBuilt/LibraryInstances/GUID' % Key):
- GuidVerObj = GuidVersionObject()
- GUID = XmlElement(SubItem, 'GUID')
- Version = XmlAttribute(XmlNode(SubItem, 'GUID'), 'Version')
- GuidVerObj.SetGuid(GUID)
- GuidVerObj.SetVersion(Version)
- LibraryList.append(GuidVerObj)
- if XmlList(Item, '%s/AsBuilt/LibraryInstances' % Key) and not LibraryList:
- LibraryList = [None]
- AsBuilt.SetLibraryInstancesList(LibraryList)
- BuildFlagList = []
- for SubItem in XmlList(Item, '%s/AsBuilt/BuildFlags' % Key):
- BuildFlag = BuildFlagXml()
- BuildFlagList.append(BuildFlag.FromXml2(SubItem, 'BuildFlags'))
- AsBuilt.SetBuildFlagsList(BuildFlagList)
- AsBuiltList.append(AsBuilt)
- BinaryFile.SetAsBuiltList(AsBuiltList)
- return BinaryFile
-
- def ToXml(self, BinaryFile, Key):
- if self.FileNames:
- pass
- NodeList = []
- FilenameList = BinaryFile.GetFileNameList()
- for Filename in FilenameList:
- Tmp = FilenameXml()
- NodeList.append(Tmp.ToXml(Filename, 'Filename'))
-
- if GlobalData.gIS_BINARY_INF:
- AsBuildList = BinaryFile.GetAsBuiltList()
- PatchPcdValueList = AsBuildList.GetPatchPcdList()
- PcdExList = AsBuildList.GetPcdExList()
- LibGuidVerList = AsBuildList.GetLibraryInstancesList()
- BuildFlagList = AsBuildList.GetBuildFlagsList()
-
- AsBuiltNodeList = []
-
- for Pcd in PatchPcdValueList:
- Tmp = PcdEntryXml()
- AsBuiltNodeList.append(Tmp.ToXml4(Pcd, 'PatchPcdValue'))
-
- for Pcd in PcdExList:
- Tmp = PcdEntryXml()
- AsBuiltNodeList.append(Tmp.ToXml4(Pcd, 'PcdExValue'))
-
- GuiVerElemList = []
- for LibGuidVer in LibGuidVerList:
- GuiVerElem = \
- CreateXmlElement('GUID', LibGuidVer.GetLibGuid(), [], [['Version', LibGuidVer.GetLibVersion()]])
- GuiVerElemList.append(GuiVerElem)
- if len(GuiVerElemList) > 0:
- LibGuidVerElem = CreateXmlElement('LibraryInstances', '', GuiVerElemList, [])
- AsBuiltNodeList.append(LibGuidVerElem)
-
- for BuildFlag in BuildFlagList:
- Tmp = BuildFlagXml()
- Elem = CreateXmlElement('BuildFlags', ''.join(BuildFlag), [], [])
- AsBuiltNodeList.append(Elem)
-
- if len(AsBuiltNodeList) > 0:
- Element = CreateXmlElement('AsBuilt', '', AsBuiltNodeList, [])
- NodeList.append(Element)
-
- Root = CreateXmlElement('%s' % Key, '', NodeList, [])
-
- return Root
-
- def __str__(self):
- Str = "BinaryFiles:"
- for Item in self.FileNames:
- Str = Str + '\n\t' + str(Item)
- for Item in self.PatchPcdValues:
- Str = Str + '\n\t' + str(Item)
- for Item in self.PcdExValues:
- Str = Str + '\n\t' + str(Item)
- for Item in self.LibraryInstances:
- Str = Str + '\n\t' + str(Item)
- for Item in self.BuildFlags:
- Str = Str + '\n\t' + str(Item)
- return Str
-
-##
-# PackageXml
-#
-class PackageXml(object):
- def __init__(self):
- self.Description = ''
- self.Guid = ''
- self.Version = ''
- self.CommonDefines = CommonDefinesXml()
-
- def FromXml(self, Item, Key):
- self.Description = XmlElement(Item, '%s/Description' % Key)
- self.Guid = XmlElement(Item, '%s/GUID' % Key)
- self.Version = XmlAttribute(XmlNode(Item, '%s/GUID' % Key), 'Version')
- self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)
-
- PackageDependency = PackageDependencyObject()
- PackageDependency.SetPackage(self.Description)
- PackageDependency.SetGuid(self.Guid)
- PackageDependency.SetVersion(self.Version)
- PackageDependency.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
- PackageDependency.SetSupArchList(self.CommonDefines.SupArchList)
-
- return PackageDependency
-
- def ToXml(self, PackageDependency, Key):
- if self.Guid:
- pass
- AttributeList = [['SupArchList', GetStringOfList(PackageDependency.GetSupArchList())],
- ['FeatureFlag', ConvertNEToNOTEQ(PackageDependency.GetFeatureFlag())], ]
- Element1 = CreateXmlElement('GUID', PackageDependency.GetGuid(), [],
- [['Version', PackageDependency.GetVersion()]])
- NodeList = [['Description', PackageDependency.GetPackage()], Element1, ]
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- Str = "Description = %s Guid = %s Version = %s %s" \
- % (self.Description, self.Guid, self.Version, self.CommonDefines)
- return Str
-##
-# ExternXml
-#
-class ExternXml(object):
- def __init__(self):
- self.CommonDefines = CommonDefinesXml()
- self.EntryPoint = ''
- self.UnloadImage = ''
- self.Constructor = ''
- self.Destructor = ''
- self.SupModList = ''
- self.SupArchList = ''
- self.HelpText = []
-
- def FromXml(self, Item, Key):
- self.CommonDefines.FromXml(Item, Key)
- self.EntryPoint = XmlElement(Item, '%s/EntryPoint' % Key)
- self.UnloadImage = XmlElement(Item, '%s/UnloadImage' % Key)
- self.Constructor = XmlElement(Item, '%s/Constructor' % Key)
- self.Destructor = XmlElement(Item, '%s/Destructor' % Key)
-
- Extern = ExternObject()
- Extern.SetEntryPoint(self.EntryPoint)
- Extern.SetUnloadImage(self.UnloadImage)
- Extern.SetConstructor(self.Constructor)
- Extern.SetDestructor(self.Destructor)
- if self.CommonDefines.SupModList:
- Extern.SetSupModList(self.CommonDefines.SupModList)
- if self.CommonDefines.SupArchList:
- Extern.SetSupArchList(self.CommonDefines.SupArchList)
- return Extern
-
- def ToXml(self, Extern, Key):
- if self.HelpText:
- pass
-
- NodeList = []
- if Extern.GetEntryPoint():
- NodeList.append(['EntryPoint', Extern.GetEntryPoint()])
- if Extern.GetUnloadImage():
- NodeList.append(['UnloadImage', Extern.GetUnloadImage()])
- if Extern.GetConstructor():
- NodeList.append(['Constructor', Extern.GetConstructor()])
- if Extern.GetDestructor():
- NodeList.append(['Destructor', Extern.GetDestructor()])
- Root = CreateXmlElement('%s' % Key, '', NodeList, [])
-
- return Root
-
- def __str__(self):
- Str = "EntryPoint = %s UnloadImage = %s Constructor = %s Destructor = %s %s" \
- % (self.EntryPoint, self.UnloadImage, self.Constructor, self.Destructor, self.CommonDefines)
- for Item in self.HelpText:
- Str = Str + '\n\t' + str(Item)
- return Str
-##
-# DepexXml
-#
-class DepexXml(object):
- def __init__(self):
- self.CommonDefines = CommonDefinesXml()
- self.Expression = None
- self.HelpText = []
-
- def FromXml(self, Item, Key):
- if not Item:
- return None
- self.CommonDefines.FromXml(Item, Key)
- self.Expression = XmlElement(Item, '%s/Expression' % Key)
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
-
- Depex = DepexObject()
- Depex.SetDepex(self.Expression)
- Depex.SetModuleType(self.CommonDefines.SupModList)
- Depex.SetSupArchList(self.CommonDefines.SupArchList)
- Depex.SetFeatureFlag(self.CommonDefines.FeatureFlag)
- Depex.SetHelpTextList(GetHelpTextList(self.HelpText))
-
- return Depex
-
- def ToXml(self, Depex, Key):
- if self.HelpText:
- pass
- AttributeList = [['SupArchList', GetStringOfList(Depex.GetSupArchList())],
- ['SupModList', Depex.GetModuleType()]]
- NodeList = [['Expression', Depex.GetDepex()]]
- if Depex.GetHelpText():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Depex.GetHelpText(), 'HelpText'))
-
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
- return Root
-
- def __str__(self):
- Str = "Expression = %s" % (self.Expression)
- for Item in self.HelpText:
- Str = Str + '\n\t' + str(Item)
- return Str
-
-##
-# BootModeXml
-#
-class BootModeXml(object):
- def __init__(self):
- self.SupportedBootModes = ''
- self.CommonDefines = CommonDefinesXml()
- self.HelpText = []
-
- def FromXml(self, Item, Key):
- self.SupportedBootModes = \
- XmlElement(Item, '%s/SupportedBootModes' % Key)
- self.CommonDefines.FromXml(Item, Key)
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
-
- BootMode = BootModeObject()
- BootMode.SetSupportedBootModes(self.SupportedBootModes)
- BootMode.SetUsage(self.CommonDefines.Usage)
- BootMode.SetHelpTextList(GetHelpTextList(self.HelpText))
-
- return BootMode
-
- def ToXml(self, BootMode, Key):
- if self.HelpText:
- pass
- AttributeList = [['Usage', BootMode.GetUsage()], ]
- NodeList = [['SupportedBootModes', BootMode.GetSupportedBootModes()]]
- for Item in BootMode.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item, 'HelpText'))
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- Str = "SupportedBootModes = %s %s" % (self.SupportedBootModes, self.CommonDefines)
- for Item in self.HelpText:
- Str = Str + '\n\t' + str(Item)
- return Str
-##
-# EventXml
-#
-class EventXml(object):
- def __init__(self):
- self.EventType = ''
- self.Name = ''
- self.CommonDefines = CommonDefinesXml()
- self.HelpText = []
-
- def FromXml(self, Item, Key):
- self.EventType = XmlAttribute(XmlNode(Item, '%s' % Key), 'EventType')
- self.Name = XmlElement(Item, '%s' % Key)
- self.CommonDefines.FromXml(Item, Key)
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
-
- Event = EventObject()
- Event.SetEventType(self.EventType)
- Event.SetUsage(self.CommonDefines.Usage)
- Event.SetHelpTextList(GetHelpTextList(self.HelpText))
-
- return Event
-
- def ToXml(self, Event, Key):
- if self.HelpText:
- pass
- AttributeList = [['EventType', Event.GetEventType()],
- ['Usage', Event.GetUsage()],
- ]
- NodeList = []
- for Item in Event.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item, 'HelpText'))
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- Str = "EventType = %s %s" % (self.EventType, self.CommonDefines)
- for Item in self.HelpText:
- Str = Str + '\n\t' + str(Item)
- return Str
-##
-# HobXml
-#
-class HobXml(object):
- def __init__(self):
- self.HobType = ''
- self.Name = ''
- self.CommonDefines = CommonDefinesXml()
- self.HelpText = []
-
- def FromXml(self, Item, Key):
- self.HobType = XmlAttribute(XmlNode(Item, '%s' % Key), 'HobType')
- self.Name = XmlElement(Item, '%s' % Key)
- self.CommonDefines.FromXml(Item, Key)
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
-
- Hob = HobObject()
- Hob.SetHobType(self.HobType)
- Hob.SetSupArchList(self.CommonDefines.SupArchList)
- Hob.SetUsage(self.CommonDefines.Usage)
- Hob.SetHelpTextList(GetHelpTextList(self.HelpText))
-
- return Hob
-
- def ToXml(self, Hob, Key):
- if self.Name:
- pass
- AttributeList = [['HobType', Hob.GetHobType()],
- ['Usage', Hob.GetUsage()],
- ['SupArchList', GetStringOfList(Hob.GetSupArchList())], ]
- NodeList = []
- for Item in Hob.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item, 'HelpText'))
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- Str = "HobType = %s %s" % (self.HobType, self.CommonDefines)
- for Item in self.HelpText:
- Str = Str + '\n\t' + str(Item)
- return Str
-
-##
-# SourceFileXml
-#
-class SourceFileXml(object):
- def __init__(self):
- self.SourceFile = ''
- self.ToolChainFamily = ''
- self.FileType = ''
- self.CommonDefines = CommonDefinesXml()
-
- def FromXml(self, Item, Key):
- self.ToolChainFamily = XmlAttribute(Item, 'Family')
- self.SourceFile = XmlElement(Item, 'Filename')
- self.CommonDefines.FromXml(Item, Key)
-
- self.CommonDefines.FeatureFlag = ConvertNOTEQToNE(self.CommonDefines.FeatureFlag)
-
- SourceFile = SourceFileObject()
- SourceFile.SetSourceFile(self.SourceFile)
- SourceFile.SetFamily(self.ToolChainFamily)
- SourceFile.SetSupArchList(self.CommonDefines.SupArchList)
- SourceFile.SetFeatureFlag(self.CommonDefines.FeatureFlag)
-
- return SourceFile
-
- def ToXml(self, SourceFile, Key):
- if self.SourceFile:
- pass
- FeatureFlag = ConvertNEToNOTEQ(SourceFile.GetFeatureFlag())
- AttributeList = [['SupArchList', GetStringOfList(SourceFile.GetSupArchList())],
- ['Family', SourceFile.GetFamily()],
- ['FeatureFlag', FeatureFlag], ]
- Root = CreateXmlElement('%s' % Key, SourceFile.GetSourceFile(), [], AttributeList)
- return Root
-
-##
-# ModulePropertyXml
-#
-class ModulePropertyXml(object):
- def __init__(self):
- self.CommonDefines = CommonDefinesXml()
- self.ModuleType = ''
- self.Path = ''
- self.PcdIsDriver = ''
- self.UefiSpecificationVersion = ''
- self.PiSpecificationVersion = ''
- self.SpecificationList = []
- self.SpecificationVersion = ''
- self.BootModes = []
- self.Events = []
- self.HOBs = []
-
- def FromXml(self, Item, Key, Header=None):
- self.CommonDefines.FromXml(Item, Key)
- self.ModuleType = XmlElement(Item, '%s/ModuleType' % Key)
- self.Path = XmlElement(Item, '%s/Path' % Key)
- self.PcdIsDriver = XmlElement(Item, '%s/PcdIsDriver' % Key)
- self.UefiSpecificationVersion = XmlElement(Item, '%s/UefiSpecificationVersion' % Key)
- self.PiSpecificationVersion = XmlElement(Item, '%s/PiSpecificationVersion' % Key)
- for SubItem in XmlList(Item, '%s/Specification' % Key):
- Specification = XmlElement(SubItem, '/Specification')
- Version = XmlAttribute(XmlNode(SubItem, '/Specification'), 'Version')
- self.SpecificationList.append((Specification, Version))
- for SubItem in XmlList(Item, '%s/BootMode' % Key):
- Axml = BootModeXml()
- BootMode = Axml.FromXml(SubItem, 'BootMode')
- self.BootModes.append(BootMode)
- for SubItem in XmlList(Item, '%s/Event' % Key):
- Axml = EventXml()
- Event = Axml.FromXml(SubItem, 'Event')
- self.Events.append(Event)
- for SubItem in XmlList(Item, '%s/HOB' % Key):
- Axml = HobXml()
- Hob = Axml.FromXml(SubItem, 'HOB')
- self.HOBs.append(Hob)
-
- if Header == None:
- Header = ModuleObject()
-
- Header.SetModuleType(self.ModuleType)
- Header.SetSupArchList(self.CommonDefines.SupArchList)
- Header.SetModulePath(self.Path)
-
- Header.SetPcdIsDriver(self.PcdIsDriver)
- Header.SetUefiSpecificationVersion(self.UefiSpecificationVersion)
- Header.SetPiSpecificationVersion(self.PiSpecificationVersion)
- Header.SetSpecList(self.SpecificationList)
-
- return Header, self.BootModes, self.Events, self.HOBs
-
-
- def ToXml(self, Header, BootModes, Events, Hobs, Key):
- if self.ModuleType:
- pass
- AttributeList = [['SupArchList', GetStringOfList(Header.GetSupArchList())], ]
-
- NodeList = [['ModuleType', Header.GetModuleType()],
- ['Path', Header.GetModulePath()],
- ['PcdIsDriver', Header.GetPcdIsDriver()],
- ['UefiSpecificationVersion', Header.GetUefiSpecificationVersion()],
- ['PiSpecificationVersion', Header.GetPiSpecificationVersion()],
- ]
- for Item in Header.GetSpecList():
- Spec, Version = Item
- SpecElem = CreateXmlElement('Specification', Spec, [], [['Version', Version]])
- NodeList.append(SpecElem)
-
- for Item in BootModes:
- Tmp = BootModeXml()
- NodeList.append(Tmp.ToXml(Item, 'BootMode'))
- for Item in Events:
- Tmp = EventXml()
- NodeList.append(Tmp.ToXml(Item, 'Event'))
- for Item in Hobs:
- Tmp = HobXml()
- NodeList.append(Tmp.ToXml(Item, 'HOB'))
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- Str = "ModuleType = %s Path = %s PcdIsDriver = %s UefiSpecificationVersion = %s PiSpecificationVersion = %s \
- Specification = %s SpecificationVersion = %s %s" % \
- (self.ModuleType, self.Path, self.PcdIsDriver, \
- self.UefiSpecificationVersion, self.PiSpecificationVersion, \
- self.SpecificationList, self.SpecificationVersion, self.CommonDefines)
- for Item in self.BootModes:
- Str = Str + '\n\t' + str(Item)
- for Item in self.Events:
- Str = Str + '\n\t' + str(Item)
- for Item in self.HOBs:
- Str = Str + '\n\t' + str(Item)
- return Str
-
-##
-# ModuleXml
-#
-class ModuleSurfaceAreaXml(object):
- def __init__(self, Package=''):
- self.Module = None
- #
- # indicate the package that this module resides in
- #
- self.Package = Package
-
- def FromXml2(self, Item, Module):
- if self.Module:
- pass
- #
- # PeiDepex
- #
- PeiDepexList = []
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/PeiDepex'):
- Tmp = DepexXml()
- Depex = Tmp.FromXml(XmlNode(SubItem, 'PeiDepex'), 'PeiDepex')
- PeiDepexList.append(Depex)
- Module.SetPeiDepex(PeiDepexList)
-
- #
- # DxeDepex
- #
- DxeDepexList = []
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/DxeDepex'):
- Tmp = DepexXml()
- Depex = Tmp.FromXml(XmlNode(SubItem, 'DxeDepex'), 'DxeDepex')
- DxeDepexList.append(Depex)
- Module.SetDxeDepex(DxeDepexList)
-
- #
- # SmmDepex
- #
- SmmDepexList = []
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/SmmDepex'):
- Tmp = DepexXml()
- Depex = Tmp.FromXml(XmlNode(SubItem, 'SmmDepex'), 'SmmDepex')
- SmmDepexList.append(Depex)
- Module.SetSmmDepex(SmmDepexList)
-
- #
- # MiscellaneousFile
- Tmp = MiscellaneousFileXml()
- MiscFileList = Tmp.FromXml(XmlNode(Item, '/ModuleSurfaceArea/MiscellaneousFiles'), 'MiscellaneousFiles')
- if MiscFileList:
- Module.SetMiscFileList([MiscFileList])
- else:
- Module.SetMiscFileList([])
-
- #
- # UserExtensions
- #
- for Item in XmlList(Item, '/ModuleSurfaceArea/UserExtensions'):
- Tmp = UserExtensionsXml()
- UserExtension = Tmp.FromXml(Item, 'UserExtensions')
- Module.SetUserExtensionList(Module.GetUserExtensionList() + [UserExtension])
-
- return Module
-
- def FromXml(self, Item, Key, IsStandAlongModule=False):
- IsBinaryModule = XmlAttribute(Item, 'BinaryModule')
- #
- # Header
- #
- Tmp = HeaderXml()
- Module = Tmp.FromXml(XmlNode(Item, '/%s/Header' % Key), 'Header', True, IsStandAlongModule)
- Module.SetBinaryModule(IsBinaryModule)
-
- if IsBinaryModule:
- GlobalData.gIS_BINARY_INF = True
-
- #
- # ModuleProperties
- #
- Tmp = ModulePropertyXml()
- (Module, BootModes, Events, HOBs) = \
- Tmp.FromXml(XmlNode(Item, '/ModuleSurfaceArea/ModuleProperties'), 'ModuleProperties', Module)
- Module.SetBootModeList(BootModes)
- Module.SetEventList(Events)
- Module.SetHobList(HOBs)
- #
- # ClonedFrom
- #
- Tmp = ClonedFromXml()
- ClonedFrom = Tmp.FromXml(XmlNode(Item, '/ModuleSurfaceArea/ClonedFrom'), 'ClonedFrom')
- if ClonedFrom:
- Module.SetClonedFrom(ClonedFrom)
-
- #
- # LibraryClass
- #
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/LibraryClassDefinitions/LibraryClass'):
- Tmp = LibraryClassXml()
- LibraryClass = Tmp.FromXml(SubItem, 'LibraryClass')
- Module.SetLibraryClassList(Module.GetLibraryClassList() + [LibraryClass])
-
- if XmlList(Item, '/ModuleSurfaceArea/LibraryClassDefinitions') and \
- not XmlList(Item, '/ModuleSurfaceArea/LibraryClassDefinitions/LibraryClass'):
- Module.SetLibraryClassList([None])
-
- #
- # SourceFiles
- #
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/SourceFiles/Filename'):
- Tmp = SourceFileXml()
- SourceFile = Tmp.FromXml(SubItem, 'Filename')
- Module.SetSourceFileList(Module.GetSourceFileList() + [SourceFile])
-
- if XmlList(Item, '/ModuleSurfaceArea/SourceFiles') and \
- not XmlList(Item, '/ModuleSurfaceArea/SourceFiles/Filename') :
- Module.SetSourceFileList([None])
-
- #
- # BinaryFile
- #
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/BinaryFiles/BinaryFile'):
- Tmp = BinaryFileXml()
- BinaryFile = Tmp.FromXml(SubItem, 'BinaryFile')
- Module.SetBinaryFileList(Module.GetBinaryFileList() + [BinaryFile])
-
- if XmlList(Item, '/ModuleSurfaceArea/BinaryFiles') and \
- not XmlList(Item, '/ModuleSurfaceArea/BinaryFiles/BinaryFile') :
- Module.SetBinaryFileList([None])
- #
- # PackageDependencies
- #
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/PackageDependencies/Package'):
- Tmp = PackageXml()
- PackageDependency = Tmp.FromXml(SubItem, 'Package')
- Module.SetPackageDependencyList(Module.GetPackageDependencyList() + [PackageDependency])
-
- if XmlList(Item, '/ModuleSurfaceArea/PackageDependencies') and \
- not XmlList(Item, '/ModuleSurfaceArea/PackageDependencies/Package'):
- Module.SetPackageDependencyList([None])
-
- #
- # Guid
- #
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/Guids/GuidCName'):
- Tmp = GuidXml('Module')
- GuidProtocolPpi = Tmp.FromXml(SubItem, 'GuidCName')
- Module.SetGuidList(Module.GetGuidList() + [GuidProtocolPpi])
-
- if XmlList(Item, '/ModuleSurfaceArea/Guids') and not XmlList(Item, '/ModuleSurfaceArea/Guids/GuidCName'):
- Module.SetGuidList([None])
-
- #
- # Protocol
- #
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/Protocols/Protocol'):
- Tmp = ProtocolXml('Module')
- GuidProtocolPpi = Tmp.FromXml(SubItem, 'Protocol')
- Module.SetProtocolList(Module.GetProtocolList() + [GuidProtocolPpi])
-
- if XmlList(Item, '/ModuleSurfaceArea/Protocols') and not XmlList(Item, '/ModuleSurfaceArea/Protocols/Protocol'):
- Module.SetProtocolList([None])
-
- #
- # Ppi
- #
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/PPIs/Ppi'):
- Tmp = PpiXml('Module')
- GuidProtocolPpi = Tmp.FromXml(SubItem, 'Ppi')
- Module.SetPpiList(Module.GetPpiList() + [GuidProtocolPpi])
-
- if XmlList(Item, '/ModuleSurfaceArea/PPIs') and not XmlList(Item, '/ModuleSurfaceArea/PPIs/Ppi'):
- Module.SetPpiList([None])
-
- #
- # Extern
- #
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/Externs/Extern'):
- Tmp = ExternXml()
- Extern = Tmp.FromXml(SubItem, 'Extern')
- Module.SetExternList(Module.GetExternList() + [Extern])
-
- if XmlList(Item, '/ModuleSurfaceArea/Externs') and not XmlList(Item, '/ModuleSurfaceArea/Externs/Extern'):
- Module.SetExternList([None])
-
- if not Module.GetBinaryModule():
- #
- # PcdCoded
- #
- for SubItem in XmlList(Item, '/ModuleSurfaceArea/PcdCoded/PcdEntry'):
- Tmp = PcdEntryXml()
- PcdEntry = Tmp.FromXml3(SubItem, 'PcdEntry')
- Module.SetPcdList(Module.GetPcdList() + [PcdEntry])
-
- if XmlList(Item, '/ModuleSurfaceArea/PcdCoded') and \
- not XmlList(Item, '/ModuleSurfaceArea/PcdCoded/PcdEntry'):
- Module.SetPcdList([None])
-
- Module = self.FromXml2(Item, Module)
- #
- # return the module object
- #
- self.Module = Module
- return self.Module
-
- def ToXml(self, Module):
- if self.Package:
- pass
- #
- # Create root node of module surface area
- #
- DomModule = minidom.Document().createElement('ModuleSurfaceArea')
- if Module.GetBinaryModule():
- DomModule.setAttribute('BinaryModule', 'true')
-
- #
- # Header
- #
- Tmp = HeaderXml()
- DomModule.appendChild(Tmp.ToXml(Module, 'Header'))
- #
- # ModuleProperties
- #
- Tmp = ModulePropertyXml()
- DomModule.appendChild(Tmp.ToXml(Module, Module.GetBootModeList(), Module.GetEventList(), Module.GetHobList(), \
- 'ModuleProperties'))
- #
- # ClonedFrom
- #
- Tmp = ClonedFromXml()
- if Module.GetClonedFrom():
- DomModule.appendChild(Tmp.ToXml(Module.GetClonedFrom(), 'ClonedFrom'))
- #
- # LibraryClass
- #
- LibraryClassNode = CreateXmlElement('LibraryClassDefinitions', '', [], [])
- for LibraryClass in Module.GetLibraryClassList():
- Tmp = LibraryClassXml()
- LibraryClassNode.appendChild(Tmp.ToXml2(LibraryClass, 'LibraryClass'))
- DomModule.appendChild(LibraryClassNode)
- #
- # SourceFile
- #
- SourceFileNode = CreateXmlElement('SourceFiles', '', [], [])
- for SourceFile in Module.GetSourceFileList():
- Tmp = SourceFileXml()
- SourceFileNode.appendChild(Tmp.ToXml(SourceFile, 'Filename'))
- DomModule.appendChild(SourceFileNode)
- #
- # BinaryFile
- #
- BinaryFileNode = CreateXmlElement('BinaryFiles', '', [], [])
- for BinaryFile in Module.GetBinaryFileList():
- Tmp = BinaryFileXml()
- BinaryFileNode.appendChild(Tmp.ToXml(BinaryFile, 'BinaryFile'))
- DomModule.appendChild(BinaryFileNode)
- #
- # PackageDependencies
- #
- PackageDependencyNode = CreateXmlElement('PackageDependencies', '', [], [])
- for PackageDependency in Module.GetPackageDependencyList():
- Tmp = PackageXml()
- PackageDependencyNode.appendChild(Tmp.ToXml(PackageDependency, 'Package'))
- DomModule.appendChild(PackageDependencyNode)
-
- #
- # Guid
- #
- GuidProtocolPpiNode = CreateXmlElement('Guids', '', [], [])
- for GuidProtocolPpi in Module.GetGuidList():
- Tmp = GuidXml('Module')
- GuidProtocolPpiNode.appendChild(Tmp.ToXml(GuidProtocolPpi, 'GuidCName'))
- DomModule.appendChild(GuidProtocolPpiNode)
-
- #
- # Protocol
- #
- GuidProtocolPpiNode = CreateXmlElement('Protocols', '', [], [])
- for GuidProtocolPpi in Module.GetProtocolList():
- Tmp = ProtocolXml('Module')
- GuidProtocolPpiNode.appendChild(Tmp.ToXml(GuidProtocolPpi, 'Protocol'))
- DomModule.appendChild(GuidProtocolPpiNode)
-
- #
- # Ppi
- #
- GuidProtocolPpiNode = CreateXmlElement('PPIs', '', [], [])
- for GuidProtocolPpi in Module.GetPpiList():
- Tmp = PpiXml('Module')
- GuidProtocolPpiNode.appendChild(Tmp.ToXml(GuidProtocolPpi, 'Ppi'))
- DomModule.appendChild(GuidProtocolPpiNode)
- #
- # Extern
- #
- ExternNode = CreateXmlElement('Externs', '', [], [])
- for Extern in Module.GetExternList():
- Tmp = ExternXml()
- ExternNode.appendChild(Tmp.ToXml(Extern, 'Extern'))
- DomModule.appendChild(ExternNode)
- #
- # PcdCoded
- #
- PcdEntryNode = CreateXmlElement('PcdCoded', '', [], [])
- for PcdEntry in Module.GetPcdList():
- Tmp = PcdEntryXml()
- PcdEntryNode.appendChild(Tmp.ToXml3(PcdEntry, 'PcdEntry'))
- DomModule.appendChild(PcdEntryNode)
-
- #
- # PeiDepex
- #
- if Module.GetPeiDepex():
- for Item in Module.GetPeiDepex():
- Tmp = DepexXml()
- DomModule.appendChild(Tmp.ToXml(Item, 'PeiDepex'))
-
- #
- # DxeDepex
- #
- if Module.GetDxeDepex():
- for Item in Module.GetDxeDepex():
- Tmp = DepexXml()
- DomModule.appendChild(Tmp.ToXml(Item, 'DxeDepex'))
-
- #
- # SmmDepex
- #
- if Module.GetSmmDepex():
- for Item in Module.GetSmmDepex():
- Tmp = DepexXml()
- DomModule.appendChild(Tmp.ToXml(Item, 'SmmDepex'))
-
- #
- # MiscellaneousFile
- #
- if Module.GetMiscFileList():
- Tmp = MiscellaneousFileXml()
- DomModule.appendChild(Tmp.ToXml(Module.GetMiscFileList()[0], 'MiscellaneousFiles'))
- #
- # UserExtensions
- #
- if Module.GetUserExtensionList():
- for UserExtension in Module.GetUserExtensionList():
- Tmp = UserExtensionsXml()
- DomModule.appendChild(Tmp.ToXml(UserExtension, 'UserExtensions'))
-
- return DomModule
-
-##
-# BuildFlagXml used to generate BuildFlag for <AsBuilt>
-#
-class BuildFlagXml(object):
- def __init__(self):
- self.Target = ''
- self.TagName = ''
- self.Family = ''
- self.AsBuiltFlags = ''
-
- def FromXml(self, Item, Key):
- self.Target = XmlElement(Item, '%s/Target' % Key)
- self.TagName = XmlElement(Item, '%s/TagName' % Key)
- self.Family = XmlElement(Item, '%s/Family' % Key)
-
- BuildFlag = BinaryBuildFlagObject()
-
- BuildFlag.SetTarget(self.Target)
- BuildFlag.SetTagName(self.TagName)
- BuildFlag.SetFamily(self.Family)
-
- return BuildFlag
-
- #
- # For AsBuild INF usage
- #
- def FromXml2(self, Item, Key):
- self.AsBuiltFlags = XmlElement(Item, '%s' % Key)
-
- LineList = GetSplitValueList(self.AsBuiltFlags, '\n')
- ReturnLine = ''
- Count = 0
- for Line in LineList:
- if Count == 0:
- ReturnLine = "# " + Line
- else:
- ReturnLine = ReturnLine + '\n' + '# ' + Line
- Count += 1
-
- BuildFlag = BinaryBuildFlagObject()
- BuildFlag.SetAsBuiltOptionFlags(ReturnLine)
-
- return BuildFlag
-
- def ToXml(self, BuildFlag, Key):
- if self.Target:
- pass
- AttributeList = []
- NodeList = []
- NodeList.append(['BuildFlags', BuildFlag])
-
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
- return Root
diff --git a/BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py b/BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py
deleted file mode 100644
index 85062ac883..0000000000
--- a/BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py
+++ /dev/null
@@ -1,398 +0,0 @@
-## @file
-# This file is used to parse a Package file of .PKG file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-PackageSurfaceAreaXml
-'''
-from xml.dom import minidom
-
-from Library.String import GetStringOfList
-from Library.Xml.XmlRoutines import XmlElement
-from Library.Xml.XmlRoutines import XmlNode
-from Library.Xml.XmlRoutines import XmlList
-from Library.Xml.XmlRoutines import CreateXmlElement
-from Object.POM.CommonObject import IncludeObject
-from Object.POM.CommonObject import TextObject
-from Object.POM.PackageObject import PackageObject
-from Xml.CommonXml import ClonedFromXml
-from Xml.CommonXml import PackageHeaderXml
-from Xml.CommonXml import HelpTextXml
-from Xml.CommonXml import CommonDefinesXml
-from Xml.CommonXml import LibraryClassXml
-from Xml.CommonXml import UserExtensionsXml
-from Xml.CommonXml import MiscellaneousFileXml
-from Xml.GuidProtocolPpiXml import GuidXml
-from Xml.GuidProtocolPpiXml import ProtocolXml
-from Xml.GuidProtocolPpiXml import PpiXml
-from Xml.ModuleSurfaceAreaXml import ModuleSurfaceAreaXml
-from Xml.PcdXml import PcdEntryXml
-
-##
-# IndustryStandardHeaderXml
-#
-class IndustryStandardHeaderXml(object):
- def __init__(self):
- self.HeaderFile = ''
- self.HelpText = []
-
- def FromXml(self, Item, Key):
- self.HeaderFile = XmlElement(Item, '%s/HeaderFile' % Key)
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
-
- Include = IncludeObject()
- Include.SetFilePath(self.HeaderFile)
- HelpTxt = TextObject()
- HelpTxt.SetString(self.HelpText)
- Include.SetHelpText(HelpTxt)
-
- return Include
-
- def ToXml(self, IndustryStandardHeader, Key):
- if self.HeaderFile:
- pass
- AttributeList = []
- NodeList = [['HeaderFile', IndustryStandardHeader.GetFilePath()]]
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- Str = "HeaderFile = %s" % (self.HeaderFile)
- for Item in self.HelpText:
- Str = Str + "\n\t" + str(Item)
- return Str
-##
-# PackageIncludeHeaderXml
-#
-class PackageIncludeHeaderXml(object):
- def __init__(self):
- self.HeaderFile = ''
- self.CommonDefines = CommonDefinesXml()
- self.HelpText = []
-
- def FromXml(self, Item, Key):
- self.HeaderFile = XmlElement(Item, '%s/HeaderFile' % Key)
- self.CommonDefines.FromXml(XmlNode(Item, '%s/HeaderFile' % Key), 'HeaderFile')
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
-
- Include = IncludeObject()
- Include.SetFilePath(self.HeaderFile)
- Include.SetSupArchList(self.CommonDefines.SupArchList)
- HelpTxt = TextObject()
- HelpTxt.SetString(self.HelpText)
- Include.SetHelpText(HelpTxt)
-
- return Include
-
- def ToXml(self, PackageIncludeHeader, Key):
- if self.HeaderFile:
- pass
- AttributeList = [['SupArchList', GetStringOfList(PackageIncludeHeader.GetSupArchList())], \
- ['SupModList', GetStringOfList(PackageIncludeHeader.GetSupModuleList())], ]
-
- HeaderFileNode = CreateXmlElement('HeaderFile', PackageIncludeHeader.FilePath, [], AttributeList)
-
- NodeList = [HeaderFileNode]
- for Item in PackageIncludeHeader.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
-
- Root = CreateXmlElement('%s' % Key, '', NodeList, [])
-
- return Root
-
- def __str__(self):
- Str = "HeaderFile = %s\n\t%s" % (self.HeaderFile, self.CommonDefines)
- for Item in self.HelpText:
- Str = Str + "\n\t" + str(Item)
- return Str
-
-##
-# PcdCheckXml
-#
-class PcdCheckXml(object):
- def __init__(self):
- self.PcdCheck = ''
-
- def FromXml(self, Item, Key):
- if Key:
- pass
- self.PcdCheck = XmlElement(Item, 'PcdCheck')
-
- return self.PcdCheck
-
- def ToXml(self, PcdCheck, Key):
- if self.PcdCheck:
- pass
- Root = CreateXmlElement('%s' % Key, PcdCheck, [], [])
- return Root
-
- def __str__(self):
- return "PcdCheck = %s" % (self.PcdCheck)
-
-##
-# PackageSurfaceAreaXml
-#
-class PackageSurfaceAreaXml(object):
- def __init__(self):
- self.Package = None
-
- def FromXml(self, Item, Key):
- if Key:
- pass
- #
- # Create a package object
- #
- Package = PackageObject()
- #
- # Header
- #
- Tmp = PackageHeaderXml()
- Tmp.FromXml(XmlNode(Item, '/PackageSurfaceArea/Header'), 'Header', Package)
- #
- # ClonedFrom
- #
- Tmp = ClonedFromXml()
- if XmlNode(Item, '/PackageSurfaceArea/ClonedFrom'):
- ClonedFrom = Tmp.FromXml(XmlNode(Item, '/PackageSurfaceArea/ClonedFrom'), 'ClonedFrom')
- Package.SetClonedFromList([ClonedFrom])
- #
- # LibraryClass
- #
-
- for SubItem in XmlList(Item, '/PackageSurfaceArea/LibraryClassDeclarations/LibraryClass'):
- Tmp = LibraryClassXml()
- LibraryClass = Tmp.FromXml(SubItem, 'LibraryClass')
- Package.SetLibraryClassList(Package.GetLibraryClassList() + [LibraryClass])
-
- if XmlList(Item, '/PackageSurfaceArea/LibraryClassDeclarations') and \
- not XmlList(Item, '/PackageSurfaceArea/LibraryClassDeclarations/LibraryClass'):
- Package.SetLibraryClassList([None])
-
- #
- # IndustryStandardHeader
- #
- for SubItem in XmlList(Item, '/PackageSurfaceArea/IndustryStandardIncludes/IndustryStandardHeader'):
- Tmp = IndustryStandardHeaderXml()
- Include = Tmp.FromXml(SubItem, 'IndustryStandardHeader')
- Package.SetStandardIncludeFileList(Package.GetStandardIncludeFileList() + [Include])
-
- if XmlList(Item, '/PackageSurfaceArea/IndustryStandardIncludes') and \
- not XmlList(Item, '/PackageSurfaceArea/IndustryStandardIncludes/IndustryStandardHeader'):
- Package.SetStandardIncludeFileList([None])
-
-
- #
- # PackageHeader
- #
- for SubItem in XmlList(Item, '/PackageSurfaceArea/PackageIncludes/PackageHeader'):
- Tmp = PackageIncludeHeaderXml()
- Include = Tmp.FromXml(SubItem, 'PackageHeader')
- Package.SetPackageIncludeFileList(Package.GetPackageIncludeFileList() + [Include])
-
- if XmlList(Item, '/PackageSurfaceArea/PackageIncludes') and not \
- XmlList(Item, '/PackageSurfaceArea/PackageIncludes/PackageHeader'):
- Package.SetPackageIncludeFileList([None])
-
- #
- # Guid
- #
- for SubItem in XmlList(Item, '/PackageSurfaceArea/GuidDeclarations/Entry'):
- Tmp = GuidXml('Package')
- GuidProtocolPpi = Tmp.FromXml(SubItem, 'Entry')
- Package.SetGuidList(Package.GetGuidList() + [GuidProtocolPpi])
-
- if XmlList(Item, '/PackageSurfaceArea/GuidDeclarations') and not \
- XmlList(Item, '/PackageSurfaceArea/GuidDeclarations/Entry'):
- Package.SetGuidList([None])
-
- #
- # Protocol
- #
- for SubItem in XmlList(Item, '/PackageSurfaceArea/ProtocolDeclarations/Entry'):
- Tmp = ProtocolXml('Package')
- GuidProtocolPpi = Tmp.FromXml(SubItem, 'Entry')
- Package.SetProtocolList(Package.GetProtocolList() + [GuidProtocolPpi])
-
- if XmlList(Item, '/PackageSurfaceArea/ProtocolDeclarations') and not \
- XmlList(Item, '/PackageSurfaceArea/ProtocolDeclarations/Entry'):
- Package.SetProtocolList([None])
-
- #
- # Ppi
- #
- for SubItem in XmlList(Item, '/PackageSurfaceArea/PpiDeclarations/Entry'):
- Tmp = PpiXml('Package')
- GuidProtocolPpi = Tmp.FromXml(SubItem, 'Entry')
- Package.SetPpiList(Package.GetPpiList() + [GuidProtocolPpi])
-
- if XmlList(Item, '/PackageSurfaceArea/PpiDeclarations') and not \
- XmlList(Item, '/PackageSurfaceArea/PpiDeclarations/Entry'):
- Package.SetPpiList([None])
-
- #
- # PcdEntry
- #
- for SubItem in XmlList(Item, '/PackageSurfaceArea/PcdDeclarations/PcdEntry'):
- Tmp = PcdEntryXml()
- PcdEntry = Tmp.FromXml2(SubItem, 'PcdEntry')
- Package.SetPcdList(Package.GetPcdList() + [PcdEntry])
-
- if XmlList(Item, '/PackageSurfaceArea/PcdDeclarations') and not \
- XmlList(Item, '/PackageSurfaceArea/PcdDeclarations/PcdEntry'):
- Package.SetPcdList([None])
-
- #
- # PcdCheck
- #
- for SubItem in XmlList(Item, '/PackageSurfaceArea/PcdRelationshipChecks/PcdCheck'):
- Tmp = PcdCheckXml()
- PcdCheck = Tmp.FromXml(SubItem, 'PcdCheck')
- Package.PcdChecks.append(PcdCheck)
-
- #
- # Modules
- #
- for SubItem in XmlList(Item, '/PackageSurfaceArea/Modules/ModuleSurfaceArea'):
- Tmp = ModuleSurfaceAreaXml()
- Module = Tmp.FromXml(SubItem, 'ModuleSurfaceArea')
- ModuleDictKey = (Module.GetGuid(), Module.GetVersion(), Module.GetName(), Module.GetModulePath())
- Package.ModuleDict[ModuleDictKey] = Module
- #
- # MiscellaneousFile
- #
- Tmp = MiscellaneousFileXml()
- MiscFileList = Tmp.FromXml(XmlNode(Item, '/PackageSurfaceArea/MiscellaneousFiles'), 'MiscellaneousFiles')
- if MiscFileList:
- Package.SetMiscFileList([MiscFileList])
- else:
- Package.SetMiscFileList([])
-
- #
- # UserExtensions
- #
- for Item in XmlList(Item, '/PackageSurfaceArea/UserExtensions'):
- Tmp = UserExtensionsXml()
- UserExtension = Tmp.FromXml(Item, 'UserExtensions')
- Package.UserExtensionList.append(UserExtension)
-
- self.Package = Package
- return self.Package
-
- def ToXml(self, Package):
- if self.Package:
- pass
- #
- # Create PackageSurfaceArea node
- #
- DomPackage = minidom.Document().createElement('PackageSurfaceArea')
- #
- # Header
- #
- Tmp = PackageHeaderXml()
- DomPackage.appendChild(Tmp.ToXml(Package, 'Header'))
- #
- # ClonedFrom
- #
- Tmp = ClonedFromXml()
- if Package.GetClonedFromList() != []:
- DomPackage.appendChild(Tmp.ToXml(Package.GetClonedFromList[0], 'ClonedFrom'))
- #
- # LibraryClass
- #
- LibraryClassNode = CreateXmlElement('LibraryClassDeclarations', '', [], [])
- for LibraryClass in Package.GetLibraryClassList():
- Tmp = LibraryClassXml()
- LibraryClassNode.appendChild(Tmp.ToXml(LibraryClass, 'LibraryClass'))
- DomPackage.appendChild(LibraryClassNode)
- #
- # IndustryStandardHeader
- #
- IndustryStandardHeaderNode = CreateXmlElement('IndustryStandardIncludes', '', [], [])
- for Include in Package.GetStandardIncludeFileList():
- Tmp = IndustryStandardHeaderXml()
- IndustryStandardHeaderNode.appendChild(Tmp.ToXml(Include, 'IndustryStandardHeader'))
- DomPackage.appendChild(IndustryStandardHeaderNode)
- #
- # PackageHeader
- #
- PackageIncludeHeaderNode = CreateXmlElement('PackageIncludes', '', [], [])
- for Include in Package.GetPackageIncludeFileList():
- Tmp = PackageIncludeHeaderXml()
- PackageIncludeHeaderNode.appendChild(Tmp.ToXml(Include, 'PackageHeader'))
- DomPackage.appendChild(PackageIncludeHeaderNode)
- ModuleNode = CreateXmlElement('Modules', '', [], [])
- for Module in Package.GetModuleDict().values():
- Tmp = ModuleSurfaceAreaXml()
- ModuleNode.appendChild(Tmp.ToXml(Module))
- DomPackage.appendChild(ModuleNode)
- #
- # Guid
- #
- GuidProtocolPpiNode = CreateXmlElement('GuidDeclarations', '', [], [])
- for GuidProtocolPpi in Package.GetGuidList():
- Tmp = GuidXml('Package')
- GuidProtocolPpiNode.appendChild(Tmp.ToXml\
- (GuidProtocolPpi, 'Entry'))
- DomPackage.appendChild(GuidProtocolPpiNode)
- #
- # Protocol
- #
- GuidProtocolPpiNode = \
- CreateXmlElement('ProtocolDeclarations', '', [], [])
- for GuidProtocolPpi in Package.GetProtocolList():
- Tmp = ProtocolXml('Package')
- GuidProtocolPpiNode.appendChild\
- (Tmp.ToXml(GuidProtocolPpi, 'Entry'))
- DomPackage.appendChild(GuidProtocolPpiNode)
- #
- # Ppi
- #
- GuidProtocolPpiNode = CreateXmlElement('PpiDeclarations', '', [], [])
- for GuidProtocolPpi in Package.GetPpiList():
- Tmp = PpiXml('Package')
- GuidProtocolPpiNode.appendChild\
- (Tmp.ToXml(GuidProtocolPpi, 'Entry'))
- DomPackage.appendChild(GuidProtocolPpiNode)
- #
- # PcdEntry
- #
- PcdEntryNode = CreateXmlElement('PcdDeclarations', '', [], [])
- for PcdEntry in Package.GetPcdList():
- Tmp = PcdEntryXml()
- PcdEntryNode.appendChild(Tmp.ToXml2(PcdEntry, 'PcdEntry'))
- DomPackage.appendChild(PcdEntryNode)
-
- #
- # MiscellaneousFile
- #
- Tmp = MiscellaneousFileXml()
- if Package.GetMiscFileList():
- DomPackage.appendChild(Tmp.ToXml(Package.GetMiscFileList()[0], 'MiscellaneousFiles'))
-
- #
- # UserExtensions
- #
- if Package.GetUserExtensionList():
- for UserExtension in Package.GetUserExtensionList():
- Tmp = UserExtensionsXml()
- DomPackage.appendChild(Tmp.ToXml(UserExtension, 'UserExtensions'))
-
- return DomPackage
diff --git a/BaseTools/Source/Python/UPT/Xml/PcdXml.py b/BaseTools/Source/Python/UPT/Xml/PcdXml.py
deleted file mode 100644
index d1f1332726..0000000000
--- a/BaseTools/Source/Python/UPT/Xml/PcdXml.py
+++ /dev/null
@@ -1,403 +0,0 @@
-## @file
-# This file is used to parse a PCD file of .PKG file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-PcdXml
-'''
-
-##
-# Import Modules
-#
-
-from Library.Xml.XmlRoutines import XmlElement
-from Library.Xml.XmlRoutines import XmlAttribute
-from Library.Xml.XmlRoutines import XmlNode
-from Library.Xml.XmlRoutines import CreateXmlElement
-from Library.Xml.XmlRoutines import XmlList
-from Library.String import GetStringOfList
-from Library.String import ConvertNEToNOTEQ
-from Library.String import ConvertNOTEQToNE
-from Library import GlobalData
-from Object.POM.CommonObject import PcdObject
-from Object.POM.CommonObject import PcdErrorObject
-from Xml.CommonXml import HelpTextXml
-from Xml.CommonXml import CommonDefinesXml
-from Xml.XmlParserMisc import GetHelpTextList
-
-##
-# PcdErrorXml
-#
-class PcdErrorXml(object):
- def __init__(self):
- self.ValidValueList = ''
- self.ValidValueListLang = ''
- self.ValidValueRange = ''
- self.Expression = ''
- self.ErrorNumber = ''
- self.ErrorMessage = []
-
- def FromXml(self, Item, Key):
- self.ValidValueList = XmlElement(Item, '%s/ValidValueList' % Key)
- self.ValidValueListLang = \
- XmlAttribute(XmlNode(Item, '%s/ValidValueList' % Key), 'Lang')
- self.ValidValueRange = XmlElement(Item, '%s/ValidValueRange' % Key)
- self.Expression = XmlElement(Item, '%s/Expression' % Key)
- self.ErrorNumber = XmlElement(Item, '%s/ErrorNumber' % Key)
- for ErrMsg in XmlList(Item, '%s/ErrorMessage' % Key):
- ErrorMessageString = XmlElement(ErrMsg, 'ErrorMessage')
- ErrorMessageLang = \
- XmlAttribute(XmlNode(ErrMsg, 'ErrorMessage'), 'Lang')
- self.ErrorMessage.append((ErrorMessageLang, ErrorMessageString))
-
- Error = PcdErrorObject()
- Error.SetValidValue(self.ValidValueList)
- Error.SetValidValueLang(self.ValidValueListLang)
- Error.SetValidValueRange(self.ValidValueRange)
- Error.SetExpression(self.Expression)
- Error.SetErrorNumber(self.ErrorNumber)
- Error.SetErrorMessageList(self.ErrorMessage)
-
- return Error
-
- def ToXml(self, PcdError, Key):
- if self.Expression:
- pass
- AttributeList = []
- NodeList = []
- if PcdError.GetValidValue():
- Element1 = \
- CreateXmlElement('ValidValueList', PcdError.GetValidValue(), [], \
- [['Lang', PcdError.GetValidValueLang()]])
- NodeList.append(Element1)
- if PcdError.GetValidValueRange():
- Element1 = \
- CreateXmlElement('ValidValueRange', \
- PcdError.GetValidValueRange(), [], [])
- NodeList.append(Element1)
- if PcdError.GetExpression():
- NodeList.append(['Expression', PcdError.GetExpression()])
- if PcdError.GetErrorNumber():
- NodeList.append(['ErrorNumber', PcdError.GetErrorNumber()])
- for Item in PcdError.GetErrorMessageList():
- Element = \
- CreateXmlElement('ErrorMessage', Item[1], [], [['Lang', Item[0]]])
- NodeList.append(Element)
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- def __str__(self):
- return "ValidValueList = %s ValidValueListLang = %s ValidValueRange \
- = %s Expression = %s ErrorNumber = %s %s" % \
- (self.ValidValueList, self.ValidValueListLang, self.ValidValueRange, \
- self.Expression, self.ErrorNumber, self.ErrorMessage)
-
-##
-# PcdEntryXml
-#
-class PcdEntryXml(object):
- def __init__(self):
- self.PcdItemType = ''
- self.PcdUsage = ''
- self.TokenSpaceGuidCName = ''
- self.TokenSpaceGuidValue = ''
- self.Token = ''
- self.CName = ''
- self.PcdCName = ''
- self.DatumType = ''
- self.ValidUsage = ''
- self.DefaultValue = ''
- self.MaxDatumSize = ''
- self.Value = ''
- self.Offset = ''
- self.CommonDefines = CommonDefinesXml()
- self.HelpText = []
- self.PcdError = []
-
- ##
- # AsBuilt will use FromXml
- #
- def FromXml(self, Item, Key):
- self.PcdItemType = \
- XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdItemType')
- self.PcdUsage = XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdUsage')
- self.TokenSpaceGuidCName = \
- XmlElement(Item, '%s/TokenSpaceGuidCname' % Key)
- self.TokenSpaceGuidValue = \
- XmlElement(Item, '%s/TokenSpaceGuidValue' % Key)
- self.Token = XmlElement(Item, '%s/Token' % Key)
- self.CName = XmlElement(Item, '%s/CName' % Key)
- self.PcdCName = XmlElement(Item, '%s/PcdCName' % Key)
- self.DatumType = XmlElement(Item, '%s/DatumType' % Key)
- self.ValidUsage = XmlElement(Item, '%s/ValidUsage' % Key)
- if not GlobalData.gIS_BINARY_INF:
- self.DefaultValue = XmlElement(Item, '%s/DefaultValue' % Key)
- else:
- self.DefaultValue = XmlElement(Item, '%s/Value' % Key)
- self.MaxDatumSize = XmlElement(Item, '%s/MaxDatumSize' % Key)
- self.Value = XmlElement(Item, '%s/Value' % Key)
- self.Offset = XmlElement(Item, '%s/Offset' % Key)
- self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
- for PcdErrorItem in XmlList(Item, '%s/PcdError' % Key):
- PcdErrorObjXml = PcdErrorXml()
- PcdErrorObj = PcdErrorObjXml.FromXml(PcdErrorItem, 'PcdError')
- self.PcdError.append(PcdErrorObj)
-
- self.DefaultValue = ConvertNOTEQToNE(self.DefaultValue)
-
- PcdEntry = PcdObject()
- PcdEntry.SetSupArchList(self.CommonDefines.SupArchList)
- PcdEntry.SetTokenSpaceGuidCName(self.TokenSpaceGuidCName)
- PcdEntry.SetTokenSpaceGuidValue(self.TokenSpaceGuidValue)
- PcdEntry.SetToken(self.Token)
- PcdEntry.SetOffset(self.Offset)
- PcdEntry.SetCName(self.CName)
- PcdEntry.SetPcdCName(self.PcdCName)
- PcdEntry.SetDatumType(self.DatumType)
- PcdEntry.SetValidUsage(self.ValidUsage)
- PcdEntry.SetDefaultValue(self.DefaultValue)
- PcdEntry.SetMaxDatumSize(self.MaxDatumSize)
- PcdEntry.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
- PcdEntry.SetItemType(self.PcdItemType)
-
- PcdEntry.SetHelpTextList(GetHelpTextList(self.HelpText))
- PcdEntry.SetPcdErrorsList(self.PcdError)
-
- return PcdEntry
- ##
- # Package will use FromXml2
- #
- def FromXml2(self, Item, Key):
- self.TokenSpaceGuidCName = \
- XmlElement(Item, '%s/TokenSpaceGuidCname' % Key)
- self.Token = XmlElement(Item, '%s/Token' % Key)
- self.CName = XmlElement(Item, '%s/CName' % Key)
- self.DatumType = XmlElement(Item, '%s/DatumType' % Key)
- self.ValidUsage = XmlElement(Item, '%s/ValidUsage' % Key)
- self.DefaultValue = XmlElement(Item, '%s/DefaultValue' % Key)
- self.MaxDatumSize = XmlElement(Item, '%s/MaxDatumSize' % Key)
- self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
- for PcdErrorItem in XmlList(Item, '%s/PcdError' % Key):
- PcdErrorObjXml = PcdErrorXml()
- PcdErrorObj = PcdErrorObjXml.FromXml(PcdErrorItem, 'PcdError')
- self.PcdError.append(PcdErrorObj)
-
- self.DefaultValue = ConvertNOTEQToNE(self.DefaultValue)
-
- PcdEntry = PcdObject()
- PcdEntry.SetSupArchList(self.CommonDefines.SupArchList)
- PcdEntry.SetSupModuleList(self.CommonDefines.SupModList)
- PcdEntry.SetTokenSpaceGuidCName(self.TokenSpaceGuidCName)
- PcdEntry.SetToken(self.Token)
- PcdEntry.SetCName(self.CName)
- PcdEntry.SetDatumType(self.DatumType)
- PcdEntry.SetValidUsage(self.ValidUsage)
- PcdEntry.SetDefaultValue(self.DefaultValue)
- PcdEntry.SetMaxDatumSize(self.MaxDatumSize)
- PcdEntry.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
-
- PcdEntry.SetHelpTextList(GetHelpTextList(self.HelpText))
- PcdEntry.SetPcdErrorsList(self.PcdError)
-
- return PcdEntry
-
- ##
- # Module will use FromXml3
- #
- def FromXml3(self, Item, Key):
- self.PcdItemType = \
- XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdItemType')
- self.PcdUsage = XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdUsage')
- self.TokenSpaceGuidCName = \
- XmlElement(Item, '%s/TokenSpaceGuidCName' % Key)
- self.CName = XmlElement(Item, '%s/CName' % Key)
- self.DefaultValue = XmlElement(Item, '%s/DefaultValue' % Key)
- self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)
- for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
- HelpTextObj = HelpTextXml()
- HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
- self.HelpText.append(HelpTextObj)
- for PcdErrorItem in XmlList(Item, '%s/PcdError' % Key):
- PcdErrorObj = PcdErrorXml()
- PcdErrorObj.FromXml(PcdErrorItem, 'PcdError')
- self.PcdError.append(PcdErrorObj)
-
- self.DefaultValue = ConvertNOTEQToNE(self.DefaultValue)
-
- PcdEntry = PcdObject()
- PcdEntry.SetSupArchList(self.CommonDefines.SupArchList)
- PcdEntry.SetTokenSpaceGuidCName(self.TokenSpaceGuidCName)
- PcdEntry.SetCName(self.CName)
- PcdEntry.SetValidUsage(self.PcdUsage)
- PcdEntry.SetDefaultValue(self.DefaultValue)
- PcdEntry.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
- PcdEntry.SetItemType(self.PcdItemType)
-
- PcdEntry.SetHelpTextList(GetHelpTextList(self.HelpText))
- PcdEntry.SetPcdErrorsList(self.PcdError)
-
- return PcdEntry
-
- def ToXml(self, PcdEntry, Key):
- if self.PcdCName:
- pass
-
- DefaultValue = ConvertNEToNOTEQ(PcdEntry.GetDefaultValue())
-
- AttributeList = \
- [['SupArchList', GetStringOfList(PcdEntry.GetSupArchList())], \
- ['PcdUsage', PcdEntry.GetValidUsage()], \
- ['PcdItemType', PcdEntry.GetItemType()], \
- ['FeatureFlag', PcdEntry.GetFeatureFlag()],
- ]
- NodeList = [['TokenSpaceGuidCname', PcdEntry.GetTokenSpaceGuidCName()],
- ['TokenSpaceGuidValue', PcdEntry.GetTokenSpaceGuidValue()],
- ['Token', PcdEntry.GetToken()],
- ['CName', PcdEntry.GetCName()],
- ['DatumType', PcdEntry.GetDatumType()],
- ['ValidUsage', GetStringOfList(PcdEntry.GetValidUsage())],
- ['DefaultValue', DefaultValue],
- ['MaxDatumSize', PcdEntry.GetMaxDatumSize()],
- ['Offset', PcdEntry.GetOffset()],
- ]
-
- for Item in PcdEntry.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
- for Item in PcdEntry.GetPcdErrorsList():
- Tmp = PcdErrorXml()
- NodeList.append(Tmp.ToXml(Item, 'PcdError'))
-
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
- ##
- # Package will use ToXml2
- #
- def ToXml2(self, PcdEntry, Key):
- if self.PcdCName:
- pass
-
- DefaultValue = ConvertNEToNOTEQ(PcdEntry.GetDefaultValue())
-
- AttributeList = \
- [['SupArchList', GetStringOfList(PcdEntry.GetSupArchList())], \
- ['SupModList', GetStringOfList(PcdEntry.GetSupModuleList())]
- ]
- NodeList = [['TokenSpaceGuidCname', PcdEntry.GetTokenSpaceGuidCName()],
- ['Token', PcdEntry.GetToken()],
- ['CName', PcdEntry.GetCName()],
- ['DatumType', PcdEntry.GetDatumType()],
- ['ValidUsage', GetStringOfList(PcdEntry.GetValidUsage())],
- ['DefaultValue', DefaultValue],
- ['MaxDatumSize', PcdEntry.GetMaxDatumSize()],
- ]
- for Item in PcdEntry.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
-
- for Item in PcdEntry.GetPcdErrorsList():
- Tmp = PcdErrorXml()
- NodeList.append(Tmp.ToXml(Item, 'PcdError'))
-
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
- ##
- # Module will use ToXml3
- #
- def ToXml3(self, PcdEntry, Key):
- if self.PcdCName:
- pass
-
- DefaultValue = ConvertNEToNOTEQ(PcdEntry.GetDefaultValue())
-
- AttributeList = \
- [['SupArchList', GetStringOfList(PcdEntry.GetSupArchList())], \
- ['PcdUsage', PcdEntry.GetValidUsage()], \
- ['PcdItemType', PcdEntry.GetItemType()], \
- ['FeatureFlag', ConvertNEToNOTEQ(PcdEntry.GetFeatureFlag())],
- ]
- NodeList = [['CName', PcdEntry.GetCName()],
- ['TokenSpaceGuidCName', PcdEntry.GetTokenSpaceGuidCName()],
- ['DefaultValue', DefaultValue],
- ]
-
- for Item in PcdEntry.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
- for Item in PcdEntry.GetPcdErrorsList():
- Tmp = PcdErrorXml()
- NodeList.append(Tmp.ToXml(Item, 'PcdError'))
-
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
- ##
- # AsBuild Module will use ToXml4
- #
- def ToXml4(self, PcdEntry, Key):
- if self.PcdCName:
- pass
-
- DefaultValue = ConvertNEToNOTEQ(PcdEntry.GetDefaultValue())
-
- AttributeList = []
-
- NodeList = [
- ['TokenSpaceGuidValue', PcdEntry.GetTokenSpaceGuidValue()],
- ['PcdCName', PcdEntry.GetCName()],
- ['Token', PcdEntry.GetToken()],
- ['DatumType', PcdEntry.GetDatumType()],
- ['MaxDatumSize', PcdEntry.GetMaxDatumSize()],
- ['Value', DefaultValue],
- ['Offset', PcdEntry.GetOffset()]
- ]
-
- for Item in PcdEntry.GetHelpTextList():
- Tmp = HelpTextXml()
- NodeList.append(Tmp.ToXml(Item))
- for Item in PcdEntry.GetPcdErrorsList():
- Tmp = PcdErrorXml()
- NodeList.append(Tmp.ToXml(Item, 'PcdError'))
-
- Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList)
-
- return Root
-
-
- def __str__(self):
- Str = \
- ('PcdItemType = %s PcdUsage = %s TokenSpaceGuidCName = %s \
- TokenSpaceGuidValue = %s Token = %s CName = %s PcdCName = %s \
- DatumType = %s ValidUsage = %s DefaultValue = %s MaxDatumSize = %s \
- Value = %s Offset = %s %s') % \
- (self.PcdItemType, self.PcdUsage, self.TokenSpaceGuidCName, \
- self.TokenSpaceGuidValue, self.Token, self.CName, self.PcdCName, \
- self.DatumType, self.ValidUsage, self.DefaultValue, \
- self.MaxDatumSize, self.Value, self.Offset, self.CommonDefines)
- for Item in self.HelpText:
- Str = Str + "\n\t" + str(Item)
- for Item in self.PcdError:
- Str = Str + "\n\tPcdError:" + str(Item)
- return Str \ No newline at end of file
diff --git a/BaseTools/Source/Python/UPT/Xml/XmlParser.py b/BaseTools/Source/Python/UPT/Xml/XmlParser.py
deleted file mode 100644
index 5a2f0dc705..0000000000
--- a/BaseTools/Source/Python/UPT/Xml/XmlParser.py
+++ /dev/null
@@ -1,926 +0,0 @@
-## @file
-# This file is used to parse a xml file of .PKG file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-XmlParser
-'''
-
-##
-# Import Modules
-#
-import re
-
-from Library.Xml.XmlRoutines import XmlNode
-from Library.Xml.XmlRoutines import CreateXmlElement
-from Library.Xml.XmlRoutines import XmlList
-from Library.Xml.XmlRoutines import XmlParseFile
-from Core.DistributionPackageClass import DistributionPackageClass
-from Object.POM.ModuleObject import DepexObject
-from Library.ParserValidate import IsValidInfMoudleType
-from Library.ParserValidate import IsValidInstallPath
-from Library.Misc import IsEqualList
-from Library.Misc import Sdict
-
-from Logger.StringTable import ERR_XML_INVALID_VARIABLENAME
-from Logger.StringTable import ERR_XML_INVALID_LIB_SUPMODLIST
-from Logger.StringTable import ERR_XML_INVALID_EXTERN_SUPARCHLIST
-from Logger.StringTable import ERR_XML_INVALID_EXTERN_SUPMODLIST
-from Logger.StringTable import ERR_XML_INVALID_EXTERN_SUPMODLIST_NOT_LIB
-from Logger.StringTable import ERR_FILE_NAME_INVALIDE
-from Logger.StringTable import ERR_XML_INVALID_BINARY_FILE_TYPE
-from Logger.ToolError import PARSER_ERROR
-from Logger.ToolError import FORMAT_INVALID
-
-from Xml.CommonXml import DistributionPackageHeaderXml
-from Xml.CommonXml import MiscellaneousFileXml
-from Xml.CommonXml import UserExtensionsXml
-from Xml.XmlParserMisc import ConvertVariableName
-from Xml.XmlParserMisc import IsRequiredItemListNull
-from Xml.ModuleSurfaceAreaXml import ModuleSurfaceAreaXml
-from Xml.PackageSurfaceAreaXml import PackageSurfaceAreaXml
-
-import Logger.Log as Logger
-
-##
-# DistributionPackageXml
-#
-class DistributionPackageXml(object):
- def __init__(self):
- self.DistP = DistributionPackageClass()
- self.Pkg = ''
-
- ## ValidateDistributionPackage
- #
- # Check if any required item is missing in DistributionPackage
- #
- def ValidateDistributionPackage(self):
- XmlTreeLevel = ['DistributionPackage']
- if self.DistP:
- #
- # Check DistributionPackage -> DistributionHeader
- #
- XmlTreeLevel = ['DistributionPackage', '']
- CheckDict = {'DistributionHeader':self.DistP.Header }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- if self.DistP.Header:
- DpHeader = self.DistP.Header
- XmlTreeLevel = ['DistributionPackage', 'DistributionHeader']
- CheckDict = Sdict()
- CheckDict['Name'] = DpHeader.GetName()
- CheckDict['GUID'] = DpHeader.GetGuid()
- CheckDict['Version'] = DpHeader.GetVersion()
- CheckDict['Copyright'] = DpHeader.GetCopyright()
- CheckDict['License'] = DpHeader.GetLicense()
- CheckDict['Abstract'] = DpHeader.GetAbstract()
- CheckDict['Vendor'] = DpHeader.GetVendor()
- CheckDict['Date'] = DpHeader.GetDate()
- CheckDict['XmlSpecification'] = DpHeader.GetXmlSpecification()
-
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- else:
- XmlTreeLevel = ['DistributionPackage', 'DistributionHeader']
- CheckDict = CheckDict = {'DistributionHeader':'', }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check Each Package
- #
- for Key in self.DistP.PackageSurfaceArea:
- ValidatePackageSurfaceArea(self.DistP.PackageSurfaceArea[Key])
-
- #
- # Check Each Module
- #
- for Key in self.DistP.ModuleSurfaceArea:
- ValidateMS(self.DistP.ModuleSurfaceArea[Key], ['DistributionPackage', 'ModuleSurfaceArea'])
-
- #
- # Check Each Tool
- #
- if self.DistP.Tools:
- XmlTreeLevel = ['DistributionPackage', 'Tools', 'Header']
- CheckDict = {'Name':self.DistP.Tools.GetName(), }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- if not self.DistP.Tools.GetFileList():
- XmlTreeLevel = ['DistributionPackage', 'Tools']
- CheckDict = {'FileName':None, }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- for Item in self.DistP.Tools.GetFileList():
- XmlTreeLevel = ['DistributionPackage', 'Tools']
- CheckDict = {'FileName':Item.GetURI(), }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check Each Misc File
- #
- if self.DistP.MiscellaneousFiles:
- XmlTreeLevel = ['DistributionPackage', 'MiscellaneousFiles', 'Header']
- CheckDict = {'Name':self.DistP.MiscellaneousFiles.GetName(), }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- if not self.DistP.MiscellaneousFiles.GetFileList():
- XmlTreeLevel = ['DistributionPackage', 'MiscellaneousFiles']
- CheckDict = {'FileName':None, }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- for Item in self.DistP.MiscellaneousFiles.GetFileList():
- XmlTreeLevel = ['DistributionPackage', 'MiscellaneousFiles']
- CheckDict = {'FileName':Item.GetURI(), }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check Each Distribution Level User Extension
- #
- for Item in self.DistP.UserExtensions:
- XmlTreeLevel = ['DistributionPackage', 'UserExtensions']
- CheckDict = {'UserId':Item.GetUserID(), }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
-
- def FromXml(self, Filename=None):
- if Filename != None:
- self.DistP = DistributionPackageClass()
- #
- # Load to XML
- #
- self.Pkg = XmlParseFile(Filename)
-
- #
- # Parse Header information
- #
- Tmp = DistributionPackageHeaderXml()
- DistributionPackageHeader = \
- Tmp.FromXml(XmlNode(self.Pkg, '/DistributionPackage/DistributionHeader'), 'DistributionHeader')
- self.DistP.Header = DistributionPackageHeader
- #
- # Parse each PackageSurfaceArea
- #
- for Item in XmlList(self.Pkg, '/DistributionPackage/PackageSurfaceArea'):
- Psa = PackageSurfaceAreaXml()
- Package = Psa.FromXml(Item, 'PackageSurfaceArea')
- self.DistP.PackageSurfaceArea[(Package.GetGuid(), \
- Package.GetVersion(), \
- Package.GetPackagePath())] = \
- Package
- #
- # Parse each ModuleSurfaceArea
- #
- for Item in XmlList(self.Pkg, '/DistributionPackage/ModuleSurfaceArea'):
- Msa = ModuleSurfaceAreaXml()
- Module = Msa.FromXml(Item, 'ModuleSurfaceArea', True)
- ModuleKey = (Module.GetGuid(), Module.GetVersion(), Module.GetName(), Module.GetModulePath())
- self.DistP.ModuleSurfaceArea[ModuleKey] = Module
-
- #
- # Parse Tools
- #
- Tmp = MiscellaneousFileXml()
- self.DistP.Tools = Tmp.FromXml2(XmlNode(self.Pkg, '/DistributionPackage/Tools'), 'Tools')
-
- #
- # Parse MiscFiles
- #
- Tmp = MiscellaneousFileXml()
- self.DistP.MiscellaneousFiles = \
- Tmp.FromXml2(XmlNode(self.Pkg, \
- '/DistributionPackage/MiscellaneousFiles'), \
- 'MiscellaneousFiles')
-
- #
- # Parse UserExtensions
- #
- for Item in XmlList(self.Pkg, '/DistributionPackage/UserExtensions'):
- Tmp = UserExtensionsXml()
- self.DistP.UserExtensions.append(Tmp.FromXml2(Item, 'UserExtensions'))
-
- #
- # Check Required Items for XML
- #
- self.ValidateDistributionPackage()
-
- return self.DistP
-
- def ToXml(self, DistP):
- if self.DistP:
- pass
- if DistP != None:
- #
- # Parse DistributionPackageHeader
- #
- Attrs = [['xmlns', 'http://www.uefi.org/2011/1.1'],
- ['xmlns:xsi', 'http:/www.w3.org/2001/XMLSchema-instance'],
- ]
- Root = CreateXmlElement('DistributionPackage', '', [], Attrs)
-
- Tmp = DistributionPackageHeaderXml()
- Root.appendChild(Tmp.ToXml(DistP.Header, 'DistributionHeader'))
- #
- # Parse each PackageSurfaceArea
- #
- for Package in DistP.PackageSurfaceArea.values():
- Psa = PackageSurfaceAreaXml()
- DomPackage = Psa.ToXml(Package)
- Root.appendChild(DomPackage)
- #
- # Parse each ModuleSurfaceArea
- #
- for Module in DistP.ModuleSurfaceArea.values():
- Msa = ModuleSurfaceAreaXml()
- DomModule = Msa.ToXml(Module)
- Root.appendChild(DomModule)
- #
- # Parse Tools
- #
- Tmp = MiscellaneousFileXml()
- ToolNode = Tmp.ToXml2(DistP.Tools, 'Tools')
- if ToolNode is not None:
- Root.appendChild(ToolNode)
- #
- # Parse MiscFiles
- #
- Tmp = MiscellaneousFileXml()
- MiscFileNode = Tmp.ToXml2(DistP.MiscellaneousFiles,
- 'MiscellaneousFiles')
- if MiscFileNode is not None:
- Root.appendChild(MiscFileNode)
-
- XmlContent = Root.toprettyxml(indent=' ')
-
-
- #
- # Remove empty element
- #
- XmlContent = re.sub(r'[\s\r\n]*<[^<>=]*/>', '', XmlContent)
-
- #
- # Remove empty help text element
- #
- XmlContent = re.sub(r'[\s\r\n]*<HelpText Lang="en-US"/>', '',
- XmlContent)
-
- #
- # Remove SupArchList="COMMON" or "common"
- #
- XmlContent = \
- re.sub(r'[\s\r\n]*SupArchList[\s\r\n]*=[\s\r\n]*"[\s\r\n]*COMMON'
- '[\s\r\n]*"', '', XmlContent)
- XmlContent = \
- re.sub(r'[\s\r\n]*SupArchList[\s\r\n]*=[\s\r\n]*"[\s\r\n]*common'
- '[\s\r\n]*"', '', XmlContent)
- #
- # Remove <SupArchList> COMMON </SupArchList>
- #
- XmlContent = \
- re.sub(r'[\s\r\n]*<SupArchList>[\s\r\n]*COMMON[\s\r\n]*'
- '</SupArchList>[\s\r\n]*', '', XmlContent)
-
- #
- # Remove <SupArchList> common </SupArchList>
- #
- XmlContent = \
- re.sub(r'[\s\r\n]*<SupArchList>[\s\r\n]*'
- 'common[\s\r\n]*</SupArchList>[\s\r\n]*', '', XmlContent)
-
- #
- # Remove SupModList="COMMON" or "common"
- #
- XmlContent = \
- re.sub(r'[\s\r\n]*SupModList[\s\r\n]*=[\s\r\n]*"[\s\r\n]*COMMON'
- '[\s\r\n]*"', '', XmlContent)
- XmlContent = \
- re.sub(r'[\s\r\n]*SupModList[\s\r\n]*=[\s\r\n]*"[\s\r\n]*common'
- '[\s\r\n]*"', '', XmlContent)
-
- return XmlContent
-
- return ''
-
-## ValidateMS
-#
-# Check if any required item is missing in ModuleSurfaceArea
-#
-# @param Module: The ModuleSurfaceArea to be checked
-# @param XmlTreeLevel: The top level of Module
-#
-def ValidateMS(Module, TopXmlTreeLevel):
- ValidateMS1(Module, TopXmlTreeLevel)
- ValidateMS2(Module, TopXmlTreeLevel)
- ValidateMS3(Module, TopXmlTreeLevel)
-
-## ValidateMS1
-#
-# Check if any required item is missing in ModuleSurfaceArea
-#
-# @param Module: The ModuleSurfaceArea to be checked
-# @param XmlTreeLevel: The top level of Module
-#
-def ValidateMS1(Module, TopXmlTreeLevel):
- #
- # Check Guids -> GuidCName
- #
- XmlTreeLevel = TopXmlTreeLevel + ['Guids']
- for Item in Module.GetGuidList():
- if Item == None:
- CheckDict = {'GuidCName':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = TopXmlTreeLevel + ['Guids', 'GuidCName']
- for Item in Module.GetGuidList():
- CheckDict = {'CName':Item.GetCName(),
- 'GuidType':Item.GetGuidTypeList(),
- 'Usage':Item.GetUsage()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- if Item.GetVariableName():
- Result = ConvertVariableName(Item.GetVariableName())
- if Result is None:
- Msg = "->".join(Node for Node in XmlTreeLevel)
- ErrorMsg = ERR_XML_INVALID_VARIABLENAME % (Item.GetVariableName(), Item.GetCName(), Msg)
- Logger.Error('\nUPT', PARSER_ERROR, ErrorMsg, RaiseError=True)
- else:
- Item.SetVariableName(Result)
-
- #
- # Check Protocols -> Protocol
- #
- XmlTreeLevel = TopXmlTreeLevel + ['Protocols']
- for Item in Module.GetProtocolList():
- if Item == None:
- CheckDict = {'Protocol':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = TopXmlTreeLevel + ['Protocols', 'Protocol']
- for Item in Module.GetProtocolList():
- CheckDict = {'CName':Item.GetCName(),
- 'Usage':Item.GetUsage()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check PPIs -> Ppi
- #
- XmlTreeLevel = TopXmlTreeLevel + ['PPIs']
- for Item in Module.GetPpiList():
- if Item == None:
- CheckDict = {'Ppi':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = TopXmlTreeLevel + ['PPIs', 'Ppi']
- for Item in Module.GetPpiList():
- CheckDict = {'CName':Item.GetCName(),
- 'Usage':Item.GetUsage()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check PcdCoded -> Entry
- #
- XmlTreeLevel = TopXmlTreeLevel + ['PcdCoded']
- for Item in Module.GetPcdList():
- if Item == None:
- CheckDict = {'PcdEntry':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = TopXmlTreeLevel + ['PcdCoded', 'PcdEntry']
- for Item in Module.GetPcdList():
- CheckDict = {'TokenSpaceGuidCname':Item.GetTokenSpaceGuidCName(),
- 'CName':Item.GetCName(),
- 'PcdUsage':Item.GetValidUsage(),
- 'PcdItemType':Item.GetItemType()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check Externs -> Extern
- #
- XmlTreeLevel = TopXmlTreeLevel + ['Externs']
- for Item in Module.GetExternList():
- if Item == None:
- CheckDict = {'Extern':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # If SupArchList is used to identify different EntryPoint, UnloadImage, Constructor/Destructor elements and
- # that SupArchList does not match ModuleSurfaceArea.ModuleProperties:SupArchList, the tool must exit gracefully,
- # informing the user that the EDK II Build system does not support different EntryPoint, UnloadImage,
- # Constructor or Destructor elements based on Architecture type. Two SupArchList attributes are considered
- # identical if it lists the same CPU architectures in any order.
- #
- for Item in Module.GetExternList():
- if len(Item.SupArchList) > 0:
- if not IsEqualList(Item.SupArchList, Module.SupArchList):
- Logger.Error('\nUPT',
- PARSER_ERROR,
- ERR_XML_INVALID_EXTERN_SUPARCHLIST % (str(Item.SupArchList), str(Module.SupArchList)),
- RaiseError=True)
-
- #
- # Check DistributionPackage -> ModuleSurfaceArea -> UserExtensions
- #
- XmlTreeLevel = TopXmlTreeLevel + ['UserExtensions']
- for Item in Module.GetUserExtensionList():
- CheckDict = {'UserId':Item.GetUserID(), 'Identifier':Item.GetIdentifier()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> MiscellaneousFiles -> Filename
- #
- XmlTreeLevel = TopXmlTreeLevel + ['MiscellaneousFiles']
- for Item in Module.GetMiscFileList():
- if not Item.GetFileList():
- CheckDict = {'Filename':'', }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- for File in Item.GetFileList():
- CheckDict = {'Filename':File.GetURI(), }
-
-## ValidateMS2
-#
-# Check if any required item is missing in ModuleSurfaceArea
-#
-# @param Module: The ModuleSurfaceArea to be checked
-# @param XmlTreeLevel: The top level of Module
-#
-def ValidateMS2(Module, TopXmlTreeLevel):
- #
- # Check Header
- #
- XmlTreeLevel = TopXmlTreeLevel + ['Header']
- CheckDict = Sdict()
- CheckDict['Name'] = Module.GetName()
- CheckDict['BaseName'] = Module.GetBaseName()
- CheckDict['GUID'] = Module.GetGuid()
- CheckDict['Version'] = Module.GetVersion()
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check ModuleProperties
- #
- XmlTreeLevel = TopXmlTreeLevel + ['ModuleProperties']
- CheckDict = {'ModuleType':Module.GetModuleType(),
- 'Path':Module.GetModulePath()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- if not IsValidInstallPath(Module.GetModulePath()):
- Logger.Error("UPT", FORMAT_INVALID, ERR_FILE_NAME_INVALIDE % Module.GetModulePath())
-
- #
- # Check ModuleProperties->BootMode
- #
- XmlTreeLevel = TopXmlTreeLevel + ['ModuleProperties'] + ['BootMode']
- for Item in Module.GetBootModeList():
- CheckDict = {'Usage':Item.GetUsage(),
- 'SupportedBootModes':Item.GetSupportedBootModes()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check ModuleProperties->Event
- #
- XmlTreeLevel = TopXmlTreeLevel + ['ModuleProperties'] + ['Event']
- for Item in Module.GetEventList():
- CheckDict = {'Usage':Item.GetUsage(),
- 'EventType':Item.GetEventType()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check ModuleProperties->Hob
- #
- XmlTreeLevel = TopXmlTreeLevel + ['ModuleProperties'] + ['HOB']
- for Item in Module.GetHobList():
- CheckDict = {'Usage':Item.GetUsage(),
- 'HobType':Item.GetHobType()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # The UDP Specification supports the module type of UEFI_RUNTIME_DRIVER, which is not present in the EDK II INF
- # File Specification v. 1.23, so UPT must perform the following translation that include the generation of a
- # [Depex] section.
- #
- if Module.ModuleType == "UEFI_RUNTIME_DRIVER":
- Module.ModuleType = "DXE_RUNTIME_DRIVER"
- DxeObj = DepexObject()
- DxeObj.SetDepex("gEfiBdsArchProtocolGuid AND \ngEfiCpuArchProtocolGuid AND\n" + \
- "gEfiMetronomeArchProtocolGuid AND \ngEfiMonotonicCounterArchProtocolGuid AND\n" + \
- "gEfiRealTimeClockArchProtocolGuid AND \ngEfiResetArchProtocolGuid AND\n" + \
- "gEfiRuntimeArchProtocolGuid AND \ngEfiSecurityArchProtocolGuid AND\n" + \
- "gEfiTimerArchProtocolGuid AND \ngEfiVariableWriteArchProtocolGuid AND\n" + \
- "gEfiVariableArchProtocolGuid AND \ngEfiWatchdogTimerArchProtocolGuid")
- DxeObj.SetModuleType(['DXE_RUNTIME_DRIVER'])
- Module.PeiDepex = []
- Module.DxeDepex = []
- Module.SmmDepex = []
- Module.DxeDepex.append(DxeObj)
-
- #
- # Check LibraryClassDefinitions -> LibraryClass
- #
- XmlTreeLevel = TopXmlTreeLevel + ['LibraryClassDefinitions']
- for Item in Module.GetLibraryClassList():
- if Item == None:
- CheckDict = {'LibraryClass':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = TopXmlTreeLevel + ['LibraryClassDefinitions', 'LibraryClass']
-
- IsLibraryModule = False
- LibrarySupModList = []
- for Item in Module.GetLibraryClassList():
- CheckDict = {'Keyword':Item.GetLibraryClass(),
- 'Usage':Item.GetUsage()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- #
- # If the LibraryClass:SupModList is not "UNDEFINED" the LIBRARY_CLASS entry must have the list
- # appended using the format:
- # LIBRARY_CLASS = <ClassName> ["|" <Edk2ModuleTypeList>]
- #
- # Edk2ModuleTypeList ::= <ModuleType> [" " <ModuleType>]{0,}
- # <ModuleTypes> ::= {"BASE"} {"SEC"} {"PEI_CORE"} {"PEIM"}
- # {"DXE_CORE"} {"DXE_DRIVER"} {"SMM_CORE"}
- # {"DXE_SMM_DRIVER"} {"DXE_RUNTIME_DRIVER"}
- # {"DXE_SAL_DRIVER"} {"UEFI_DRIVER"}
- # {"UEFI_APPLICATION"} {"USER_DEFINED"}
- #
- if len(Item.SupModuleList) > 0:
- for SupModule in Item.SupModuleList:
- if not IsValidInfMoudleType(SupModule):
- Logger.Error('\nUPT',
- PARSER_ERROR,
- ERR_XML_INVALID_LIB_SUPMODLIST % (Item.LibraryClass, str(SupModule)),
- RaiseError=True)
-
- if Item.Usage == 'PRODUCES' or Item.Usage == 'SOMETIMES_PRODUCES':
- IsLibraryModule = True
- LibrarySupModList = Item.SupModuleList
-
-
- #
- # For Library modules (indicated by a LIBRARY_CLASS statement in the [Defines] section)
- # If the SupModList attribute of the CONSTRUCTOR or DESTRUCTOR element does not match the Supported Module
- # Types listed after "LIBRARY_CLASS = <Keyword> |", the tool should gracefully exit with an error message
- # stating that there is a conflict in the module types the CONSTRUCTOR/DESTRUCTOR is to be used with and
- # the Module types this Library supports.
- #
- if IsLibraryModule:
- for Item in Module.GetExternList():
- if Item.Constructor or Item.Destructor:
- if hasattr(Item, 'SupModList') and len(Item.SupModList) > 0 and \
- not IsEqualList(Item.SupModList, LibrarySupModList):
- Logger.Error('\nUPT',
- PARSER_ERROR,
- ERR_XML_INVALID_EXTERN_SUPMODLIST % (str(Item.SupModList), str(LibrarySupModList)),
- RaiseError=True)
-
- #
- # If the module is not a library module, the MODULE_TYPE listed in the ModuleSurfaceArea.Header must match the
- # SupModList attribute. If these conditions cannot be met, the tool must exit gracefully, informing the user
- # that the EDK II Build system does not currently support the features required by this Module.
- #
- if not IsLibraryModule:
- for Item in Module.GetExternList():
- if hasattr(Item, 'SupModList') and len(Item.SupModList) > 0 and \
- not IsEqualList(Item.SupModList, [Module.ModuleType]):
- Logger.Error('\nUPT',
- PARSER_ERROR,
- ERR_XML_INVALID_EXTERN_SUPMODLIST_NOT_LIB % (str(Module.ModuleType), str(Item.SupModList)),
- RaiseError=True)
- #
- # Check SourceFiles
- #
- XmlTreeLevel = TopXmlTreeLevel + ['SourceFiles']
- for Item in Module.GetSourceFileList():
- if Item == None:
- CheckDict = {'Filename':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = TopXmlTreeLevel + ['SourceFiles']
- for Item in Module.GetSourceFileList():
- CheckDict = {'Filename':Item.GetSourceFile()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- for ItemCount in range(len(Module.GetBinaryFileList())):
- Item = Module.GetBinaryFileList()[ItemCount]
- if Item and len(Item.FileNamList) > 0 and Item.FileNamList[0].FileType == 'FREEFORM':
- Item.FileNamList[0].FileType = 'SUBTYPE_GUID'
- Module.GetBinaryFileList()[ItemCount] = Item
- if Item and len(Item.FileNamList) > 0 and Item.FileNamList[0].FileType == 'DISPOSABLE':
- Logger.Error('\nUPT',
- PARSER_ERROR,
- ERR_XML_INVALID_BINARY_FILE_TYPE % ('DISPOSABLE'),
- RaiseError=True)
-
-## ValidateMS3
-#
-# Check if any required item is missing in ModuleSurfaceArea
-#
-# @param Module: The ModuleSurfaceArea to be checked
-# @param XmlTreeLevel: The top level of Module
-#
-def ValidateMS3(Module, TopXmlTreeLevel):
- #
- # Check PackageDependencies -> Package
- #
- XmlTreeLevel = TopXmlTreeLevel + ['PackageDependencies']
- for Item in Module.GetPackageDependencyList():
- if Item == None:
- CheckDict = {'Package':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = TopXmlTreeLevel + ['PackageDependencies', 'Package']
- for Item in Module.GetPackageDependencyList():
- CheckDict = {'GUID':Item.GetGuid()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check BinaryFiles -> BinaryFile
- #
- for Item in Module.GetBinaryFileList():
- if Item == None:
- XmlTreeLevel = TopXmlTreeLevel + ['BinaryFiles']
- CheckDict = {'BinaryFile':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- if not Item.GetFileNameList():
- XmlTreeLevel = TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile']
- CheckDict = {'Filename':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile']
- for File in Item.GetFileNameList():
- CheckDict = {'Filename':File.GetFilename(),
- 'FileType':File.GetFileType()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- for AsBuilt in Item.GetAsBuiltList():
- #
- # Check LibInstance
- #
- if len(AsBuilt.LibraryInstancesList) == 1 and not AsBuilt.LibraryInstancesList[0]:
- CheckDict = {'GUID':''}
- XmlTreeLevel = TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile', 'AsBuilt', 'LibraryInstances']
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- for LibItem in AsBuilt.LibraryInstancesList:
- CheckDict = {'Guid':LibItem.Guid,
- 'Version':LibItem.Version}
- XmlTreeLevel = TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile', 'AsBuilt', 'LibraryInstances']
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check PatchPcd
- #
- for PatchPcdItem in AsBuilt.PatchPcdList:
- CheckDict = {'TokenSpaceGuidValue':PatchPcdItem.TokenSpaceGuidValue,
- 'PcdCName':PatchPcdItem.PcdCName,
- 'Token':PatchPcdItem.Token,
- 'DatumType':PatchPcdItem.DatumType,
- 'Value':PatchPcdItem.DefaultValue,
- 'Offset':PatchPcdItem.Offset}
- XmlTreeLevel = TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile', 'AsBuilt', 'PatchPcdValue']
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- #
- # Check PcdError
- #
- for PcdErrorItem in PatchPcdItem.PcdErrorsList:
- CheckDict = {'ErrorNumber':PcdErrorItem.ErrorNumber}
- XmlTreeLevel = TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile', 'AsBuilt',
- 'PatchPcdValue', 'PcdError']
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- #
- # Check PcdEx
- #
- for PcdExItem in AsBuilt.PcdExValueList:
- CheckDict = {'TokenSpaceGuidValue':PcdExItem.TokenSpaceGuidValue,
- 'Token':PcdExItem.Token,
- 'DatumType':PcdExItem.DatumType,
- 'Value':PcdExItem.DefaultValue}
- XmlTreeLevel = TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile', 'AsBuilt', 'PcdExValue']
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- #
- # Check PcdError
- #
- for PcdErrorItem in PcdExItem.PcdErrorsList:
- CheckDict = {'ErrorNumber':PcdErrorItem.ErrorNumber}
- XmlTreeLevel = TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile', 'AsBuilt',
- 'PcdExValue', 'PcdError']
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- #
- # Check SmmDepex
- #
- XmlTreeLevel = TopXmlTreeLevel + ['SmmDepex']
- for Item in Module.GetSmmDepex():
- CheckDict = {'Expression':Item.GetDepex()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check PeiDepex
- #
- XmlTreeLevel = TopXmlTreeLevel + ['PeiDepex']
- for Item in Module.GetPeiDepex():
- CheckDict = {'Expression':Item.GetDepex()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check DxeDepex
- #
- XmlTreeLevel = TopXmlTreeLevel + ['DxeDepex']
- for Item in Module.GetDxeDepex():
- CheckDict = {'Expression':Item.GetDepex()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check <UserExtensions>
- #
- XmlTreeLevel = TopXmlTreeLevel + ['UserExtensions']
- for Item in Module.GetUserExtensionList():
- CheckDict = {'UserId':Item.GetUserID(), 'Identifier':Item.GetIdentifier()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
-## ValidatePS1
-#
-# ValidatePS1
-#
-def ValidatePS1(Package):
- #
- # Check DistributionPackage -> PackageSurfaceArea -> Header
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'Header']
- CheckDict = Sdict()
- CheckDict['Name'] = Package.GetName()
- CheckDict['BaseName'] = Package.GetBaseName()
- CheckDict['GUID'] = Package.GetGuid()
- CheckDict['Version'] = Package.GetVersion()
- CheckDict['PackagePath'] = Package.GetPackagePath()
-
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- if not IsValidInstallPath(Package.GetPackagePath()):
- Logger.Error("UPT", FORMAT_INVALID, ERR_FILE_NAME_INVALIDE % Package.GetPackagePath())
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> ClonedFrom
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'ClonedFrom']
- for Item in Package.GetClonedFromList():
- if Item == None:
- CheckDict = Sdict()
- CheckDict['GUID'] = ''
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- CheckDict = Sdict()
- CheckDict['GUID'] = Item.GetPackageGuid()
- CheckDict['Version'] = Item.GetPackageVersion()
-
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> LibraryClassDeclarations -> LibraryClass
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'LibraryClassDeclarations']
- for Item in Package.GetLibraryClassList():
- if Item == None:
- CheckDict = {'LibraryClass':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'LibraryClassDeclarations', 'LibraryClass']
- for Item in Package.GetLibraryClassList():
- CheckDict = {'Keyword':Item.GetLibraryClass(),
- 'HeaderFile':Item.GetIncludeHeader()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> IndustryStandardIncludes -> IndustryStandardHeader
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'IndustryStandardIncludes']
- for Item in Package.GetStandardIncludeFileList():
- if Item == None:
- CheckDict = {'IndustryStandardHeader':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'IndustryStandardIncludes', 'IndustryStandardHeader']
- for Item in Package.GetStandardIncludeFileList():
- CheckDict = {'HeaderFile':Item.GetFilePath()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> PackageIncludes -> PackageHeader
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'PackageIncludes']
- for Item in Package.GetPackageIncludeFileList():
- if Item == None:
- CheckDict = {'PackageHeader':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'PackageIncludes', 'PackageHeader']
- for Item in Package.GetPackageIncludeFileList():
- CheckDict = {'HeaderFile':Item.GetFilePath()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
-## ValidatePS2
-#
-# ValidatePS2
-#
-def ValidatePS2(Package):
- #
- # Check DistributionPackage -> PackageSurfaceArea -> Modules -> ModuleSurfaceArea
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'Modules', 'ModuleSurfaceArea']
- for Item in Package.GetModuleDict().values():
- ValidateMS(Item, XmlTreeLevel)
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> GuidDeclarations Entry
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'GuidDeclarations']
- for Item in Package.GetGuidList():
- if Item == None:
- CheckDict = {'Entry':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'GuidDeclarations', 'Entry']
- for Item in Package.GetGuidList():
- CheckDict = {'CName':Item.GetCName(),
- 'GuidValue':Item.GetGuid()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> ProtocolDeclarations -> Entry
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'ProtocolDeclarations']
- for Item in Package.GetProtocolList():
- if Item == None:
- CheckDict = {'Entry':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'ProtocolDeclarations', 'Entry']
- for Item in Package.GetProtocolList():
- CheckDict = {'CName':Item.GetCName(),
- 'GuidValue':Item.GetGuid()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> PpiDeclarations -> Entry
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'PpiDeclarations']
- for Item in Package.GetPpiList():
- if Item == None:
- CheckDict = {'Entry':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'PpiDeclarations', 'Entry']
- for Item in Package.GetPpiList():
- CheckDict = {'CName':Item.GetCName(),
- 'GuidValue':Item.GetGuid()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> PcdDeclarations -> Entry
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'PcdDeclarations']
- for Item in Package.GetPcdList():
- if Item == None:
- CheckDict = {'PcdEntry':''}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'PcdDeclarations', 'PcdEntry']
- for Item in Package.GetPcdList():
- CheckDict = {'TokenSpaceGuidCname':Item.GetTokenSpaceGuidCName(),
- 'Token':Item.GetToken(),
- 'CName':Item.GetCName(),
- 'DatumType':Item.GetDatumType(),
- 'ValidUsage':Item.GetValidUsage(),
- 'DefaultValue':Item.GetDefaultValue()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> UserExtensions
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'UserExtensions']
- for Item in Package.GetUserExtensionList():
- CheckDict = {'UserId':Item.GetUserID(), 'Identifier':Item.GetIdentifier()}
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
- #
- # Check DistributionPackage -> PackageSurfaceArea -> MiscellaneousFiles -> Filename
- #
- XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'MiscellaneousFiles']
- for Item in Package.GetMiscFileList():
- if not Item.GetFileList():
- CheckDict = {'Filename':'', }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
- for File in Item.GetFileList():
- CheckDict = {'Filename':File.GetURI(), }
- IsRequiredItemListNull(CheckDict, XmlTreeLevel)
-
-## ValidatePackageSurfaceArea
-#
-# Check if any required item is missing in PackageSurfaceArea
-#
-# @param Package: The PackageSurfaceArea to be checked
-#
-def ValidatePackageSurfaceArea(Package):
- ValidatePS1(Package)
- ValidatePS2(Package)
diff --git a/BaseTools/Source/Python/UPT/Xml/XmlParserMisc.py b/BaseTools/Source/Python/UPT/Xml/XmlParserMisc.py
deleted file mode 100644
index 0ffa44d35f..0000000000
--- a/BaseTools/Source/Python/UPT/Xml/XmlParserMisc.py
+++ /dev/null
@@ -1,89 +0,0 @@
-## @file
-# This file is used to parse a xml file of .PKG file
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-XmlParserMisc
-'''
-from Object.POM.CommonObject import TextObject
-from Logger.StringTable import ERR_XML_PARSER_REQUIRED_ITEM_MISSING
-from Logger.ToolError import PARSER_ERROR
-import Logger.Log as Logger
-
-## ConvertVariableName()
-# Convert VariableName to be L"string",
-# input of UCS-2 format Hex Array or L"string" (C style.) could be converted successfully,
-# others will not.
-#
-# @param VariableName: string need to be converted
-# @retval: the L quoted string converted if success, else None will be returned
-#
-def ConvertVariableName(VariableName):
- VariableName = VariableName.strip()
- #
- # check for L quoted string
- #
- if VariableName.startswith('L"') and VariableName.endswith('"'):
- return VariableName
-
- #
- # check for Hex Array, it should be little endian even number of hex numbers
- #
- ValueList = VariableName.split(' ')
- if len(ValueList)%2 == 1:
- return None
-
- TransferedStr = ''
-
- Index = 0
-
- while Index < len(ValueList):
- FirstByte = int(ValueList[Index], 16)
- SecondByte = int(ValueList[Index + 1], 16)
- if SecondByte != 0:
- return None
-
- if FirstByte not in xrange(0x20, 0x7F):
- return None
- TransferedStr += ('%c')%FirstByte
- Index = Index + 2
-
- return 'L"' + TransferedStr + '"'
-
-## IsRequiredItemListNull
-#
-# Check if a required XML section item/attribue is NULL
-#
-# @param ItemList: The list of items to be checked
-# @param XmlTreeLevel: The error message tree level
-#
-def IsRequiredItemListNull(ItemDict, XmlTreeLevel):
- for Key in ItemDict:
- if not ItemDict[Key]:
- Msg = "->".join(Node for Node in XmlTreeLevel)
- ErrorMsg = ERR_XML_PARSER_REQUIRED_ITEM_MISSING % (Key, Msg)
- Logger.Error('\nUPT', PARSER_ERROR, ErrorMsg, RaiseError=True)
-
-
-## Get help text
-#
-# @param HelpText
-#
-def GetHelpTextList(HelpText):
- HelpTextList = []
- for HelT in HelpText:
- HelpTextObj = TextObject()
- HelpTextObj.SetLang(HelT.Lang)
- HelpTextObj.SetString(HelT.HelpText)
- HelpTextList.append(HelpTextObj)
- return HelpTextList
diff --git a/BaseTools/Source/Python/UPT/Xml/__init__.py b/BaseTools/Source/Python/UPT/Xml/__init__.py
deleted file mode 100644
index 5d268d990b..0000000000
--- a/BaseTools/Source/Python/UPT/Xml/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-## @file
-# Python 'Library' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-'''
-Xml
-''' \ No newline at end of file
diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTools/Source/Python/Workspace/BuildClassObject.py
deleted file mode 100644
index 7d709d3f0b..0000000000
--- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
+++ /dev/null
@@ -1,366 +0,0 @@
-## @file
-# This file is used to define each component of the build database
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-import os
-
-from Common.Misc import sdict
-from Common.Misc import RealPath2
-from Common.BuildToolError import *
-
-## PcdClassObject
-#
-# This Class is used for PcdObject
-#
-# @param object: Inherited from object class
-# @param Name: Input value for Name of Pcd, default is None
-# @param Guid: Input value for Guid of Pcd, default is None
-# @param Type: Input value for Type of Pcd, default is None
-# @param DatumType: Input value for DatumType of Pcd, default is None
-# @param Value: Input value for Value of Pcd, default is None
-# @param Token: Input value for Token of Pcd, default is None
-# @param MaxDatumSize: Input value for MaxDatumSize of Pcd, default is None
-# @param SkuInfoList: Input value for SkuInfoList of Pcd, default is {}
-# @param IsOverrided: Input value for IsOverrided of Pcd, default is False
-# @param GuidValue: Input value for TokenSpaceGuidValue of Pcd, default is None
-#
-# @var TokenCName: To store value for TokenCName
-# @var TokenSpaceGuidCName: To store value for TokenSpaceGuidCName
-# @var Type: To store value for Type
-# @var DatumType: To store value for DatumType
-# @var TokenValue: To store value for TokenValue
-# @var MaxDatumSize: To store value for MaxDatumSize
-# @var SkuInfoList: To store value for SkuInfoList
-# @var IsOverrided: To store value for IsOverrided
-# @var Phase: To store value for Phase, default is "DXE"
-#
-class PcdClassObject(object):
- def __init__(self, Name = None, Guid = None, Type = None, DatumType = None, Value = None, Token = None, MaxDatumSize = None, SkuInfoList = {}, IsOverrided = False, GuidValue = None):
- self.TokenCName = Name
- self.TokenSpaceGuidCName = Guid
- self.TokenSpaceGuidValue = GuidValue
- self.Type = Type
- self.DatumType = DatumType
- self.DefaultValue = Value
- self.TokenValue = Token
- self.MaxDatumSize = MaxDatumSize
- self.SkuInfoList = SkuInfoList
- self.Phase = "DXE"
- self.Pending = False
- self.IsOverrided = IsOverrided
-
- ## Convert the class to a string
- #
- # Convert each member of the class to string
- # Organize to a signle line format string
- #
- # @retval Rtn Formatted String
- #
- def __str__(self):
- Rtn = '\tTokenCName=' + str(self.TokenCName) + ', ' + \
- 'TokenSpaceGuidCName=' + str(self.TokenSpaceGuidCName) + ', ' + \
- 'Type=' + str(self.Type) + ', ' + \
- 'DatumType=' + str(self.DatumType) + ', ' + \
- 'DefaultValue=' + str(self.DefaultValue) + ', ' + \
- 'TokenValue=' + str(self.TokenValue) + ', ' + \
- 'MaxDatumSize=' + str(self.MaxDatumSize) + ', '
- for Item in self.SkuInfoList.values():
- Rtn = Rtn + 'SkuId=' + Item.SkuId + ', ' + 'SkuIdName=' + Item.SkuIdName
- Rtn = Rtn + ', IsOverrided=' + str(self.IsOverrided)
-
- return Rtn
-
- ## Override __eq__ function
- #
- # Check whether pcds are the same
- #
- # @retval False The two pcds are different
- # @retval True The two pcds are the same
- #
- def __eq__(self, Other):
- return Other and self.TokenCName == Other.TokenCName and self.TokenSpaceGuidCName == Other.TokenSpaceGuidCName
-
- ## Override __hash__ function
- #
- # Use (TokenCName, TokenSpaceGuidCName) as key in hash table
- #
- # @retval truple() Key for hash table
- #
- def __hash__(self):
- return hash((self.TokenCName, self.TokenSpaceGuidCName))
-
-## LibraryClassObject
-#
-# This Class defines LibraryClassObject used in BuildDatabase
-#
-# @param object: Inherited from object class
-# @param Name: Input value for LibraryClassName, default is None
-# @param SupModList: Input value for SupModList, default is []
-# @param Type: Input value for Type, default is None
-#
-# @var LibraryClass: To store value for LibraryClass
-# @var SupModList: To store value for SupModList
-# @var Type: To store value for Type
-#
-class LibraryClassObject(object):
- def __init__(self, Name = None, SupModList = [], Type = None):
- self.LibraryClass = Name
- self.SupModList = SupModList
- if Type != None:
- self.SupModList = CleanString(Type).split(DataType.TAB_SPACE_SPLIT)
-
-## ModuleBuildClassObject
-#
-# This Class defines ModuleBuildClass
-#
-# @param object: Inherited from object class
-#
-# @var MetaFile: To store value for module meta file path
-# @var BaseName: To store value for BaseName
-# @var ModuleType: To store value for ModuleType
-# @var Guid: To store value for Guid
-# @var Version: To store value for Version
-# @var PcdIsDriver: To store value for PcdIsDriver
-# @var BinaryModule: To store value for BinaryModule
-# @var CustomMakefile: To store value for CustomMakefile
-# @var Specification: To store value for Specification
-# @var Shadow To store value for Shadow
-# @var LibraryClass: To store value for LibraryClass, it is a list structure as
-# [ LibraryClassObject, ...]
-# @var ModuleEntryPointList: To store value for ModuleEntryPointList
-# @var ModuleUnloadImageList: To store value for ModuleUnloadImageList
-# @var ConstructorList: To store value for ConstructorList
-# @var DestructorList: To store value for DestructorList
-# @var Binaries: To store value for Binaries, it is a list structure as
-# [ ModuleBinaryClassObject, ...]
-# @var Sources: To store value for Sources, it is a list structure as
-# [ ModuleSourceFilesClassObject, ... ]
-# @var LibraryClasses: To store value for LibraryClasses, it is a set structure as
-# { [LibraryClassName, ModuleType] : LibraryClassInfFile }
-# @var Protocols: To store value for Protocols, it is a list structure as
-# [ ProtocolName, ... ]
-# @var Ppis: To store value for Ppis, it is a list structure as
-# [ PpiName, ... ]
-# @var Guids: To store value for Guids, it is a list structure as
-# [ GuidName, ... ]
-# @var Includes: To store value for Includes, it is a list structure as
-# [ IncludePath, ... ]
-# @var Packages: To store value for Packages, it is a list structure as
-# [ DecFileName, ... ]
-# @var Pcds: To store value for Pcds, it is a set structure as
-# { [(PcdCName, PcdGuidCName)] : PcdClassObject}
-# @var BuildOptions: To store value for BuildOptions, it is a set structure as
-# { [BuildOptionKey] : BuildOptionValue}
-# @var Depex: To store value for Depex
-#
-class ModuleBuildClassObject(object):
- def __init__(self):
- self.AutoGenVersion = 0
- self.MetaFile = ''
- self.BaseName = ''
- self.ModuleType = ''
- self.Guid = ''
- self.Version = ''
- self.PcdIsDriver = ''
- self.BinaryModule = ''
- self.Shadow = ''
- self.SourceOverridePath = ''
- self.CustomMakefile = {}
- self.Specification = {}
- self.LibraryClass = []
- self.ModuleEntryPointList = []
- self.ModuleUnloadImageList = []
- self.ConstructorList = []
- self.DestructorList = []
-
- self.Binaries = []
- self.Sources = []
- self.LibraryClasses = sdict()
- self.Libraries = []
- self.Protocols = []
- self.Ppis = []
- self.Guids = []
- self.Includes = []
- self.Packages = []
- self.Pcds = {}
- self.BuildOptions = {}
- self.Depex = {}
-
- ## Convert the class to a string
- #
- # Convert member MetaFile of the class to a string
- #
- # @retval string Formatted String
- #
- def __str__(self):
- return str(self.MetaFile)
-
- ## Override __eq__ function
- #
- # Check whether ModuleBuildClassObjects are the same
- #
- # @retval False The two ModuleBuildClassObjects are different
- # @retval True The two ModuleBuildClassObjects are the same
- #
- def __eq__(self, Other):
- return self.MetaFile == Other
-
- ## Override __hash__ function
- #
- # Use MetaFile as key in hash table
- #
- # @retval string Key for hash table
- #
- def __hash__(self):
- return hash(self.MetaFile)
-
-## PackageBuildClassObject
-#
-# This Class defines PackageBuildClass
-#
-# @param object: Inherited from object class
-#
-# @var MetaFile: To store value for package meta file path
-# @var PackageName: To store value for PackageName
-# @var Guid: To store value for Guid
-# @var Version: To store value for Version
-# @var Protocols: To store value for Protocols, it is a set structure as
-# { [ProtocolName] : Protocol Guid, ... }
-# @var Ppis: To store value for Ppis, it is a set structure as
-# { [PpiName] : Ppi Guid, ... }
-# @var Guids: To store value for Guids, it is a set structure as
-# { [GuidName] : Guid, ... }
-# @var Includes: To store value for Includes, it is a list structure as
-# [ IncludePath, ... ]
-# @var LibraryClasses: To store value for LibraryClasses, it is a set structure as
-# { [LibraryClassName] : LibraryClassInfFile }
-# @var Pcds: To store value for Pcds, it is a set structure as
-# { [(PcdCName, PcdGuidCName)] : PcdClassObject}
-#
-class PackageBuildClassObject(object):
- def __init__(self):
- self.MetaFile = ''
- self.PackageName = ''
- self.Guid = ''
- self.Version = ''
-
- self.Protocols = {}
- self.Ppis = {}
- self.Guids = {}
- self.Includes = []
- self.LibraryClasses = {}
- self.Pcds = {}
-
- ## Convert the class to a string
- #
- # Convert member MetaFile of the class to a string
- #
- # @retval string Formatted String
- #
- def __str__(self):
- return str(self.MetaFile)
-
- ## Override __eq__ function
- #
- # Check whether PackageBuildClassObjects are the same
- #
- # @retval False The two PackageBuildClassObjects are different
- # @retval True The two PackageBuildClassObjects are the same
- #
- def __eq__(self, Other):
- return self.MetaFile == Other
-
- ## Override __hash__ function
- #
- # Use MetaFile as key in hash table
- #
- # @retval string Key for hash table
- #
- def __hash__(self):
- return hash(self.MetaFile)
-
-## PlatformBuildClassObject
-#
-# This Class defines PlatformBuildClass
-#
-# @param object: Inherited from object class
-#
-# @var MetaFile: To store value for platform meta-file path
-# @var PlatformName: To store value for PlatformName
-# @var Guid: To store value for Guid
-# @var Version: To store value for Version
-# @var DscSpecification: To store value for DscSpecification
-# @var OutputDirectory: To store value for OutputDirectory
-# @var FlashDefinition: To store value for FlashDefinition
-# @var BuildNumber: To store value for BuildNumber
-# @var MakefileName: To store value for MakefileName
-# @var SkuIds: To store value for SkuIds, it is a set structure as
-# { 'SkuName' : SkuId, '!include' : includefilename, ...}
-# @var Modules: To store value for Modules, it is a list structure as
-# [ InfFileName, ... ]
-# @var Libraries: To store value for Libraries, it is a list structure as
-# [ InfFileName, ... ]
-# @var LibraryClasses: To store value for LibraryClasses, it is a set structure as
-# { (LibraryClassName, ModuleType) : LibraryClassInfFile }
-# @var Pcds: To store value for Pcds, it is a set structure as
-# { [(PcdCName, PcdGuidCName)] : PcdClassObject }
-# @var BuildOptions: To store value for BuildOptions, it is a set structure as
-# { [BuildOptionKey] : BuildOptionValue }
-#
-class PlatformBuildClassObject(object):
- def __init__(self):
- self.MetaFile = ''
- self.PlatformName = ''
- self.Guid = ''
- self.Version = ''
- self.DscSpecification = ''
- self.OutputDirectory = ''
- self.FlashDefinition = ''
- self.BuildNumber = ''
- self.MakefileName = ''
-
- self.SkuIds = {}
- self.Modules = []
- self.LibraryInstances = []
- self.LibraryClasses = {}
- self.Libraries = {}
- self.Pcds = {}
- self.BuildOptions = {}
-
- ## Convert the class to a string
- #
- # Convert member MetaFile of the class to a string
- #
- # @retval string Formatted String
- #
- def __str__(self):
- return str(self.MetaFile)
-
- ## Override __eq__ function
- #
- # Check whether PlatformBuildClassObjects are the same
- #
- # @retval False The two PlatformBuildClassObjects are different
- # @retval True The two PlatformBuildClassObjects are the same
- #
- def __eq__(self, Other):
- return self.MetaFile == Other
-
- ## Override __hash__ function
- #
- # Use MetaFile as key in hash table
- #
- # @retval string Key for hash table
- #
- def __hash__(self):
- return hash(self.MetaFile)
-
diff --git a/BaseTools/Source/Python/Workspace/MetaDataTable.py b/BaseTools/Source/Python/Workspace/MetaDataTable.py
deleted file mode 100644
index 34ef4903df..0000000000
--- a/BaseTools/Source/Python/Workspace/MetaDataTable.py
+++ /dev/null
@@ -1,338 +0,0 @@
-## @file
-# This file is used to create/update/query/erase table for files
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-
-import Common.EdkLogger as EdkLogger
-from CommonDataClass import DataClass
-from CommonDataClass.DataClass import FileClass
-
-## Convert to SQL required string format
-def ConvertToSqlString(StringList):
- return map(lambda s: "'" + s.replace("'", "''") + "'", StringList)
-
-## TableFile
-#
-# This class defined a common table
-#
-# @param object: Inherited from object class
-#
-# @param Cursor: Cursor of the database
-# @param TableName: Name of the table
-#
-class Table(object):
- _COLUMN_ = ''
- _ID_STEP_ = 1
- _ID_MAX_ = 0x80000000
- _DUMMY_ = 0
-
- def __init__(self, Cursor, Name='', IdBase=0, Temporary=False):
- self.Cur = Cursor
- self.Table = Name
- self.IdBase = int(IdBase)
- self.ID = int(IdBase)
- self.Temporary = Temporary
-
- def __str__(self):
- return self.Table
-
- ## Create table
- #
- # Create a table
- #
- def Create(self, NewTable=True):
- if NewTable:
- self.Drop()
-
- if self.Temporary:
- SqlCommand = """create temp table IF NOT EXISTS %s (%s)""" % (self.Table, self._COLUMN_)
- else:
- SqlCommand = """create table IF NOT EXISTS %s (%s)""" % (self.Table, self._COLUMN_)
- EdkLogger.debug(EdkLogger.DEBUG_8, SqlCommand)
- self.Cur.execute(SqlCommand)
- self.ID = self.GetId()
-
- ## Insert table
- #
- # Insert a record into a table
- #
- def Insert(self, *Args):
- self.ID = self.ID + self._ID_STEP_
- if self.ID >= (self.IdBase + self._ID_MAX_):
- self.ID = self.IdBase + self._ID_STEP_
- Values = ", ".join([str(Arg) for Arg in Args])
- SqlCommand = "insert into %s values(%s, %s)" % (self.Table, self.ID, Values)
- EdkLogger.debug(EdkLogger.DEBUG_5, SqlCommand)
- self.Cur.execute(SqlCommand)
- return self.ID
-
- ## Query table
- #
- # Query all records of the table
- #
- def Query(self):
- SqlCommand = """select * from %s""" % self.Table
- self.Cur.execute(SqlCommand)
- for Rs in self.Cur:
- EdkLogger.verbose(str(Rs))
- TotalCount = self.GetId()
-
- ## Drop a table
- #
- # Drop the table
- #
- def Drop(self):
- SqlCommand = """drop table IF EXISTS %s""" % self.Table
- self.Cur.execute(SqlCommand)
-
- ## Get count
- #
- # Get a count of all records of the table
- #
- # @retval Count: Total count of all records
- #
- def GetCount(self):
- SqlCommand = """select count(ID) from %s""" % self.Table
- Record = self.Cur.execute(SqlCommand).fetchall()
- return Record[0][0]
-
- def GetId(self):
- SqlCommand = """select max(ID) from %s""" % self.Table
- Record = self.Cur.execute(SqlCommand).fetchall()
- Id = Record[0][0]
- if Id == None:
- Id = self.IdBase
- return Id
-
- ## Init the ID of the table
- #
- # Init the ID of the table
- #
- def InitID(self):
- self.ID = self.GetId()
-
- ## Exec
- #
- # Exec Sql Command, return result
- #
- # @param SqlCommand: The SqlCommand to be executed
- #
- # @retval RecordSet: The result after executed
- #
- def Exec(self, SqlCommand):
- EdkLogger.debug(EdkLogger.DEBUG_5, SqlCommand)
- self.Cur.execute(SqlCommand)
- RecordSet = self.Cur.fetchall()
- return RecordSet
-
- def SetEndFlag(self):
- self.Exec("insert into %s values(%s)" % (self.Table, self._DUMMY_))
- #
- # Need to execution commit for table data changed.
- #
- self.Cur.connection.commit()
-
- def IsIntegral(self):
- Result = self.Exec("select min(ID) from %s" % (self.Table))
- if Result[0][0] != -1:
- return False
- return True
-
- def GetAll(self):
- return self.Exec("select * from %s where ID > 0 order by ID" % (self.Table))
-
-## TableFile
-#
-# This class defined a table used for file
-#
-# @param object: Inherited from object class
-#
-class TableFile(Table):
- _COLUMN_ = '''
- ID INTEGER PRIMARY KEY,
- Name VARCHAR NOT NULL,
- ExtName VARCHAR,
- Path VARCHAR,
- FullPath VARCHAR NOT NULL,
- Model INTEGER DEFAULT 0,
- TimeStamp SINGLE NOT NULL
- '''
- def __init__(self, Cursor):
- Table.__init__(self, Cursor, 'File')
-
- ## Insert table
- #
- # Insert a record into table File
- #
- # @param Name: Name of a File
- # @param ExtName: ExtName of a File
- # @param Path: Path of a File
- # @param FullPath: FullPath of a File
- # @param Model: Model of a File
- # @param TimeStamp: TimeStamp of a File
- #
- def Insert(self, Name, ExtName, Path, FullPath, Model, TimeStamp):
- (Name, ExtName, Path, FullPath) = ConvertToSqlString((Name, ExtName, Path, FullPath))
- return Table.Insert(
- self,
- Name,
- ExtName,
- Path,
- FullPath,
- Model,
- TimeStamp
- )
-
- ## InsertFile
- #
- # Insert one file to table
- #
- # @param FileFullPath: The full path of the file
- # @param Model: The model of the file
- #
- # @retval FileID: The ID after record is inserted
- #
- def InsertFile(self, File, Model):
- return self.Insert(
- File.Name,
- File.Ext,
- File.Dir,
- File.Path,
- Model,
- File.TimeStamp
- )
-
- ## Get ID of a given file
- #
- # @param FilePath Path of file
- #
- # @retval ID ID value of given file in the table
- #
- def GetFileId(self, File):
- QueryScript = "select ID from %s where FullPath = '%s'" % (self.Table, str(File))
- RecordList = self.Exec(QueryScript)
- if len(RecordList) == 0:
- return None
- return RecordList[0][0]
-
- ## Get type of a given file
- #
- # @param FileId ID of a file
- #
- # @retval file_type Model value of given file in the table
- #
- def GetFileType(self, FileId):
- QueryScript = "select Model from %s where ID = '%s'" % (self.Table, FileId)
- RecordList = self.Exec(QueryScript)
- if len(RecordList) == 0:
- return None
- return RecordList[0][0]
-
- ## Get file timestamp of a given file
- #
- # @param FileId ID of file
- #
- # @retval timestamp TimeStamp value of given file in the table
- #
- def GetFileTimeStamp(self, FileId):
- QueryScript = "select TimeStamp from %s where ID = '%s'" % (self.Table, FileId)
- RecordList = self.Exec(QueryScript)
- if len(RecordList) == 0:
- return None
- return RecordList[0][0]
-
- ## Update the timestamp of a given file
- #
- # @param FileId ID of file
- # @param TimeStamp Time stamp of file
- #
- def SetFileTimeStamp(self, FileId, TimeStamp):
- self.Exec("update %s set TimeStamp=%s where ID='%s'" % (self.Table, TimeStamp, FileId))
-
- ## Get list of file with given type
- #
- # @param FileType Type value of file
- #
- # @retval file_list List of files with the given type
- #
- def GetFileList(self, FileType):
- RecordList = self.Exec("select FullPath from %s where Model=%s" % (self.Table, FileType))
- if len(RecordList) == 0:
- return []
- return [R[0] for R in RecordList]
-
-## TableDataModel
-#
-# This class defined a table used for data model
-#
-# @param object: Inherited from object class
-#
-#
-class TableDataModel(Table):
- _COLUMN_ = """
- ID INTEGER PRIMARY KEY,
- CrossIndex INTEGER NOT NULL,
- Name VARCHAR NOT NULL,
- Description VARCHAR
- """
- def __init__(self, Cursor):
- Table.__init__(self, Cursor, 'DataModel')
-
- ## Insert table
- #
- # Insert a record into table DataModel
- #
- # @param ID: ID of a ModelType
- # @param CrossIndex: CrossIndex of a ModelType
- # @param Name: Name of a ModelType
- # @param Description: Description of a ModelType
- #
- def Insert(self, CrossIndex, Name, Description):
- (Name, Description) = ConvertToSqlString((Name, Description))
- return Table.Insert(self, CrossIndex, Name, Description)
-
- ## Init table
- #
- # Create all default records of table DataModel
- #
- def InitTable(self):
- EdkLogger.verbose("\nInitialize table DataModel started ...")
- Count = self.GetCount()
- if Count != None and Count != 0:
- return
- for Item in DataClass.MODEL_LIST:
- CrossIndex = Item[1]
- Name = Item[0]
- Description = Item[0]
- self.Insert(CrossIndex, Name, Description)
- EdkLogger.verbose("Initialize table DataModel ... DONE!")
-
- ## Get CrossIndex
- #
- # Get a model's cross index from its name
- #
- # @param ModelName: Name of the model
- # @retval CrossIndex: CrossIndex of the model
- #
- def GetCrossIndex(self, ModelName):
- CrossIndex = -1
- SqlCommand = """select CrossIndex from DataModel where name = '""" + ModelName + """'"""
- self.Cur.execute(SqlCommand)
- for Item in self.Cur:
- CrossIndex = Item[0]
-
- return CrossIndex
-
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
deleted file mode 100644
index b2e98633af..0000000000
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ /dev/null
@@ -1,1825 +0,0 @@
-## @file
-# This file is used to parse meta files
-#
-# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import re
-import time
-import copy
-
-import Common.EdkLogger as EdkLogger
-import Common.GlobalData as GlobalData
-
-from CommonDataClass.DataClass import *
-from Common.DataType import *
-from Common.String import *
-from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData, AnalyzeDscPcd
-from Common.Expression import *
-from CommonDataClass.Exceptions import *
-
-from MetaFileTable import MetaFileStorage
-
-## A decorator used to parse macro definition
-def ParseMacro(Parser):
- def MacroParser(self):
- Match = gMacroDefPattern.match(self._CurrentLine)
- if not Match:
- # Not 'DEFINE/EDK_GLOBAL' statement, call decorated method
- Parser(self)
- return
-
- TokenList = GetSplitValueList(self._CurrentLine[Match.end(1):], TAB_EQUAL_SPLIT, 1)
- # Syntax check
- if not TokenList[0]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No macro name given",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- if len(TokenList) < 2:
- TokenList.append('')
-
- Type = Match.group(1)
- Name, Value = TokenList
- # Global macros can be only defined via environment variable
- if Name in GlobalData.gGlobalDefines:
- EdkLogger.error('Parser', FORMAT_INVALID, "%s can only be defined via environment variable" % Name,
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- # Only upper case letters, digit and '_' are allowed
- if not gMacroNamePattern.match(Name):
- EdkLogger.error('Parser', FORMAT_INVALID, "The macro name must be in the pattern [A-Z][A-Z0-9_]*",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
-
- Value = ReplaceMacro(Value, self._Macros)
- if Type in self.DataType:
- self._ItemType = self.DataType[Type]
- else:
- self._ItemType = MODEL_META_DATA_DEFINE
- # DEFINE defined macros
- if Type == TAB_DSC_DEFINES_DEFINE:
- #
- # First judge whether this DEFINE is in conditional directive statements or not.
- #
- if type(self) == DscParser and self._InDirective > -1:
- pass
- else:
- if type(self) == DecParser:
- if MODEL_META_DATA_HEADER in self._SectionType:
- self._FileLocalMacros[Name] = Value
- else:
- self._ConstructSectionMacroDict(Name, Value)
- elif self._SectionType == MODEL_META_DATA_HEADER:
- self._FileLocalMacros[Name] = Value
- else:
- self._ConstructSectionMacroDict(Name, Value)
-
- # EDK_GLOBAL defined macros
- elif type(self) != DscParser:
- EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL can only be used in .dsc file",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- elif self._SectionType != MODEL_META_DATA_HEADER:
- EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL can only be used under [Defines] section",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- elif (Name in self._FileLocalMacros) and (self._FileLocalMacros[Name] != Value):
- EdkLogger.error('Parser', FORMAT_INVALID, "EDK_GLOBAL defined a macro with the same name and different value as one defined by 'DEFINE'",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
-
- self._ValueList = [Type, Name, Value]
-
- return MacroParser
-
-## Base class of parser
-#
-# This class is used for derivation purpose. The specific parser for one kind
-# type file must derive this class and implement some public interfaces.
-#
-# @param FilePath The path of platform description file
-# @param FileType The raw data of DSC file
-# @param Table Database used to retrieve module/package information
-# @param Macros Macros used for replacement in file
-# @param Owner Owner ID (for sub-section parsing)
-# @param From ID from which the data comes (for !INCLUDE directive)
-#
-class MetaFileParser(object):
- # data type (file content) for specific file type
- DataType = {}
-
- # Parser objects used to implement singleton
- MetaFiles = {}
-
- ## Factory method
- #
- # One file, one parser object. This factory method makes sure that there's
- # only one object constructed for one meta file.
- #
- # @param Class class object of real AutoGen class
- # (InfParser, DecParser or DscParser)
- # @param FilePath The path of meta file
- # @param *args The specific class related parameters
- # @param **kwargs The specific class related dict parameters
- #
- def __new__(Class, FilePath, *args, **kwargs):
- if FilePath in Class.MetaFiles:
- return Class.MetaFiles[FilePath]
- else:
- ParserObject = super(MetaFileParser, Class).__new__(Class)
- Class.MetaFiles[FilePath] = ParserObject
- return ParserObject
-
- ## Constructor of MetaFileParser
- #
- # Initialize object of MetaFileParser
- #
- # @param FilePath The path of platform description file
- # @param FileType The raw data of DSC file
- # @param Table Database used to retrieve module/package information
- # @param Macros Macros used for replacement in file
- # @param Owner Owner ID (for sub-section parsing)
- # @param From ID from which the data comes (for !INCLUDE directive)
- #
- def __init__(self, FilePath, FileType, Table, Owner= -1, From= -1):
- self._Table = Table
- self._RawTable = Table
- self._FileType = FileType
- self.MetaFile = FilePath
- self._FileDir = self.MetaFile.Dir
- self._Defines = {}
- self._FileLocalMacros = {}
- self._SectionsMacroDict = {}
-
- # for recursive parsing
- self._Owner = [Owner]
- self._From = From
-
- # parsr status for parsing
- self._ValueList = ['', '', '', '', '']
- self._Scope = []
- self._LineIndex = 0
- self._CurrentLine = ''
- self._SectionType = MODEL_UNKNOWN
- self._SectionName = ''
- self._InSubsection = False
- self._SubsectionType = MODEL_UNKNOWN
- self._SubsectionName = ''
- self._ItemType = MODEL_UNKNOWN
- self._LastItem = -1
- self._Enabled = 0
- self._Finished = False
- self._PostProcessed = False
- # Different version of meta-file has different way to parse.
- self._Version = 0
-
- ## Store the parsed data in table
- def _Store(self, *Args):
- return self._Table.Insert(*Args)
-
- ## Virtual method for starting parse
- def Start(self):
- raise NotImplementedError
-
- ## Notify a post-process is needed
- def DoPostProcess(self):
- self._PostProcessed = False
-
- ## Set parsing complete flag in both class and table
- def _Done(self):
- self._Finished = True
- ## Do not set end flag when processing included files
- if self._From == -1:
- self._Table.SetEndFlag()
-
- def _PostProcess(self):
- self._PostProcessed = True
-
- ## Get the parse complete flag
- def _GetFinished(self):
- return self._Finished
-
- ## Set the complete flag
- def _SetFinished(self, Value):
- self._Finished = Value
-
- ## Use [] style to query data in table, just for readability
- #
- # DataInfo = [data_type, scope1(arch), scope2(platform/moduletype)]
- #
- def __getitem__(self, DataInfo):
- if type(DataInfo) != type(()):
- DataInfo = (DataInfo,)
-
- # Parse the file first, if necessary
- if not self._Finished:
- if self._RawTable.IsIntegrity():
- self._Finished = True
- else:
- self._Table = self._RawTable
- self._PostProcessed = False
- self.Start()
-
- # No specific ARCH or Platform given, use raw data
- if self._RawTable and (len(DataInfo) == 1 or DataInfo[1] == None):
- return self._RawTable.Query(*DataInfo)
-
- # Do post-process if necessary
- if not self._PostProcessed:
- self._PostProcess()
-
- return self._Table.Query(*DataInfo)
-
- ## Data parser for the common format in different type of file
- #
- # The common format in the meatfile is like
- #
- # xxx1 | xxx2 | xxx3
- #
- @ParseMacro
- def _CommonParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- self._ValueList[0:len(TokenList)] = TokenList
-
- ## Data parser for the format in which there's path
- #
- # Only path can have macro used. So we need to replace them before use.
- #
- @ParseMacro
- def _PathParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- self._ValueList[0:len(TokenList)] = TokenList
- # Don't do macro replacement for dsc file at this point
- if type(self) != DscParser:
- Macros = self._Macros
- self._ValueList = [ReplaceMacro(Value, Macros) for Value in self._ValueList]
-
- ## Skip unsupported data
- def _Skip(self):
- EdkLogger.warn("Parser", "Unrecognized content", File=self.MetaFile,
- Line=self._LineIndex + 1, ExtraData=self._CurrentLine);
- self._ValueList[0:1] = [self._CurrentLine]
-
- ## Section header parser
- #
- # The section header is always in following format:
- #
- # [section_name.arch<.platform|module_type>]
- #
- def _SectionHeaderParser(self):
- self._Scope = []
- self._SectionName = ''
- ArchList = set()
- for Item in GetSplitValueList(self._CurrentLine[1:-1], TAB_COMMA_SPLIT):
- if Item == '':
- continue
- ItemList = GetSplitValueList(Item, TAB_SPLIT)
- # different section should not mix in one section
- if self._SectionName != '' and self._SectionName != ItemList[0].upper():
- EdkLogger.error('Parser', FORMAT_INVALID, "Different section names in the same section",
- File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
- self._SectionName = ItemList[0].upper()
- if self._SectionName in self.DataType:
- self._SectionType = self.DataType[self._SectionName]
- # Check if the section name is valid
- if self._SectionName not in SECTIONS_HAVE_ITEM_AFTER_ARCH and len(ItemList) > 2:
- EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
- self.MetaFile, self._LineIndex + 1, self._CurrentLine)
- elif self._Version >= 0x00010005:
- EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
- self.MetaFile, self._LineIndex + 1, self._CurrentLine)
- else:
- self._SectionType = MODEL_UNKNOWN
-
- # S1 is always Arch
- if len(ItemList) > 1:
- S1 = ItemList[1].upper()
- else:
- S1 = 'COMMON'
- ArchList.add(S1)
-
- # S2 may be Platform or ModuleType
- if len(ItemList) > 2:
- S2 = ItemList[2].upper()
- else:
- S2 = 'COMMON'
- self._Scope.append([S1, S2])
-
- # 'COMMON' must not be used with specific ARCHs at the same section
- if 'COMMON' in ArchList and len(ArchList) > 1:
- EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
- File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
- # If the section information is needed later, it should be stored in database
- self._ValueList[0] = self._SectionName
-
- ## [defines] section parser
- @ParseMacro
- def _DefineParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- self._ValueList[1:len(TokenList)] = TokenList
- if not self._ValueList[1]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No name specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- if not self._ValueList[2]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No value specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
-
- self._ValueList = [ReplaceMacro(Value, self._Macros) for Value in self._ValueList]
- Name, Value = self._ValueList[1], self._ValueList[2]
- # Sometimes, we need to make differences between EDK and EDK2 modules
- if Name == 'INF_VERSION':
- try:
- self._Version = int(Value, 0)
- except:
- EdkLogger.error('Parser', FORMAT_INVALID, "Invalid version number",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
-
- if type(self) == InfParser and self._Version < 0x00010005:
- # EDK module allows using defines as macros
- self._FileLocalMacros[Name] = Value
- self._Defines[Name] = Value
-
- ## [BuildOptions] section parser
- @ParseMacro
- def _BuildOptionParser(self):
- self._CurrentLine = CleanString(self._CurrentLine, BuildOption=True)
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- TokenList2 = GetSplitValueList(TokenList[0], ':', 1)
- if len(TokenList2) == 2:
- self._ValueList[0] = TokenList2[0] # toolchain family
- self._ValueList[1] = TokenList2[1] # keys
- else:
- self._ValueList[1] = TokenList[0]
- if len(TokenList) == 2 and type(self) != DscParser: # value
- self._ValueList[2] = ReplaceMacro(TokenList[1], self._Macros)
-
- if self._ValueList[1].count('_') != 4:
- EdkLogger.error(
- 'Parser',
- FORMAT_INVALID,
- "'%s' must be in format of <TARGET>_<TOOLCHAIN>_<ARCH>_<TOOL>_FLAGS" % self._ValueList[1],
- ExtraData=self._CurrentLine,
- File=self.MetaFile,
- Line=self._LineIndex + 1
- )
-
- def _GetMacros(self):
- Macros = {}
- Macros.update(self._FileLocalMacros)
- Macros.update(self._GetApplicableSectionMacro())
- return Macros
-
- ## Construct section Macro dict
- def _ConstructSectionMacroDict(self, Name, Value):
- ScopeKey = [(Scope[0], Scope[1]) for Scope in self._Scope]
- ScopeKey = tuple(ScopeKey)
- SectionDictKey = self._SectionType, ScopeKey
- #
- # DecParser SectionType is a list, will contain more than one item only in Pcd Section
- # As Pcd section macro usage is not alllowed, so here it is safe
- #
- if type(self) == DecParser:
- SectionDictKey = self._SectionType[0], ScopeKey
- if SectionDictKey not in self._SectionsMacroDict:
- self._SectionsMacroDict[SectionDictKey] = {}
- SectionLocalMacros = self._SectionsMacroDict[SectionDictKey]
- SectionLocalMacros[Name] = Value
-
- ## Get section Macros that are applicable to current line, which may come from other sections
- ## that share the same name while scope is wider
- def _GetApplicableSectionMacro(self):
- Macros = {}
-
- ComComMacroDict = {}
- ComSpeMacroDict = {}
- SpeSpeMacroDict = {}
-
- ActiveSectionType = self._SectionType
- if type(self) == DecParser:
- ActiveSectionType = self._SectionType[0]
-
- for (SectionType, Scope) in self._SectionsMacroDict:
- if SectionType != ActiveSectionType:
- continue
-
- for ActiveScope in self._Scope:
- Scope0, Scope1 = ActiveScope[0], ActiveScope[1]
- if(Scope0, Scope1) not in Scope:
- break
- else:
- SpeSpeMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])
-
- for ActiveScope in self._Scope:
- Scope0, Scope1 = ActiveScope[0], ActiveScope[1]
- if(Scope0, Scope1) not in Scope and (Scope0, "COMMON") not in Scope and ("COMMON", Scope1) not in Scope:
- break
- else:
- ComSpeMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])
-
- if ("COMMON", "COMMON") in Scope:
- ComComMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])
-
- Macros.update(ComComMacroDict)
- Macros.update(ComSpeMacroDict)
- Macros.update(SpeSpeMacroDict)
-
- return Macros
-
- _SectionParser = {}
- Finished = property(_GetFinished, _SetFinished)
- _Macros = property(_GetMacros)
-
-
-## INF file parser class
-#
-# @param FilePath The path of platform description file
-# @param FileType The raw data of DSC file
-# @param Table Database used to retrieve module/package information
-# @param Macros Macros used for replacement in file
-#
-class InfParser(MetaFileParser):
- # INF file supported data types (one type per section)
- DataType = {
- TAB_UNKNOWN.upper() : MODEL_UNKNOWN,
- TAB_INF_DEFINES.upper() : MODEL_META_DATA_HEADER,
- TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DEFINE,
- TAB_BUILD_OPTIONS.upper() : MODEL_META_DATA_BUILD_OPTION,
- TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,
- TAB_LIBRARIES.upper() : MODEL_EFI_LIBRARY_INSTANCE,
- TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,
- TAB_PACKAGES.upper() : MODEL_META_DATA_PACKAGE,
- TAB_NMAKE.upper() : MODEL_META_DATA_NMAKE,
- TAB_INF_FIXED_PCD.upper() : MODEL_PCD_FIXED_AT_BUILD,
- TAB_INF_PATCH_PCD.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,
- TAB_INF_FEATURE_PCD.upper() : MODEL_PCD_FEATURE_FLAG,
- TAB_INF_PCD_EX.upper() : MODEL_PCD_DYNAMIC_EX,
- TAB_INF_PCD.upper() : MODEL_PCD_DYNAMIC,
- TAB_SOURCES.upper() : MODEL_EFI_SOURCE_FILE,
- TAB_GUIDS.upper() : MODEL_EFI_GUID,
- TAB_PROTOCOLS.upper() : MODEL_EFI_PROTOCOL,
- TAB_PPIS.upper() : MODEL_EFI_PPI,
- TAB_DEPEX.upper() : MODEL_EFI_DEPEX,
- TAB_BINARIES.upper() : MODEL_EFI_BINARY_FILE,
- TAB_USER_EXTENSIONS.upper() : MODEL_META_DATA_USER_EXTENSION
- }
-
- ## Constructor of InfParser
- #
- # Initialize object of InfParser
- #
- # @param FilePath The path of module description file
- # @param FileType The raw data of DSC file
- # @param Table Database used to retrieve module/package information
- # @param Macros Macros used for replacement in file
- #
- def __init__(self, FilePath, FileType, Table):
- # prevent re-initialization
- if hasattr(self, "_Table"):
- return
- MetaFileParser.__init__(self, FilePath, FileType, Table)
- self.PcdsDict = {}
-
- ## Parser starter
- def Start(self):
- NmakeLine = ''
- Content = ''
- try:
- Content = open(str(self.MetaFile), 'r').readlines()
- except:
- EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=self.MetaFile)
-
- # parse the file line by line
- IsFindBlockComment = False
-
- for Index in range(0, len(Content)):
- # skip empty, commented, block commented lines
- Line = CleanString(Content[Index], AllowCppStyleComment=True)
- NextLine = ''
- if Index + 1 < len(Content):
- NextLine = CleanString(Content[Index + 1])
- if Line == '':
- continue
- if Line.find(DataType.TAB_COMMENT_EDK_START) > -1:
- IsFindBlockComment = True
- continue
- if Line.find(DataType.TAB_COMMENT_EDK_END) > -1:
- IsFindBlockComment = False
- continue
- if IsFindBlockComment:
- continue
-
- self._LineIndex = Index
- self._CurrentLine = Line
-
- # section header
- if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
- self._SectionHeaderParser()
- # Check invalid sections
- if self._Version < 0x00010005:
- if self._SectionType in [MODEL_META_DATA_BUILD_OPTION,
- MODEL_EFI_LIBRARY_CLASS,
- MODEL_META_DATA_PACKAGE,
- MODEL_PCD_FIXED_AT_BUILD,
- MODEL_PCD_PATCHABLE_IN_MODULE,
- MODEL_PCD_FEATURE_FLAG,
- MODEL_PCD_DYNAMIC_EX,
- MODEL_PCD_DYNAMIC,
- MODEL_EFI_GUID,
- MODEL_EFI_PROTOCOL,
- MODEL_EFI_PPI,
- MODEL_META_DATA_USER_EXTENSION]:
- EdkLogger.error('Parser', FORMAT_INVALID,
- "Section [%s] is not allowed in inf file without version" % (self._SectionName),
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- elif self._SectionType in [MODEL_EFI_INCLUDE,
- MODEL_EFI_LIBRARY_INSTANCE,
- MODEL_META_DATA_NMAKE]:
- EdkLogger.error('Parser', FORMAT_INVALID,
- "Section [%s] is not allowed in inf file with version 0x%08x" % (self._SectionName, self._Version),
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- continue
- # merge two lines specified by '\' in section NMAKE
- elif self._SectionType == MODEL_META_DATA_NMAKE:
- if Line[-1] == '\\':
- if NextLine == '':
- self._CurrentLine = NmakeLine + Line[0:-1]
- NmakeLine = ''
- else:
- if NextLine[0] == TAB_SECTION_START and NextLine[-1] == TAB_SECTION_END:
- self._CurrentLine = NmakeLine + Line[0:-1]
- NmakeLine = ''
- else:
- NmakeLine = NmakeLine + ' ' + Line[0:-1]
- continue
- else:
- self._CurrentLine = NmakeLine + Line
- NmakeLine = ''
-
- # section content
- self._ValueList = ['', '', '']
- # parse current line, result will be put in self._ValueList
- self._SectionParser[self._SectionType](self)
- if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:
- self._ItemType = -1
- continue
- #
- # Model, Value1, Value2, Value3, Arch, Platform, BelongsToItem=-1,
- # LineBegin=-1, ColumnBegin=-1, LineEnd=-1, ColumnEnd=-1, Enabled=-1
- #
- for Arch, Platform in self._Scope:
- self._Store(self._SectionType,
- self._ValueList[0],
- self._ValueList[1],
- self._ValueList[2],
- Arch,
- Platform,
- self._Owner[-1],
- self._LineIndex + 1,
- - 1,
- self._LineIndex + 1,
- - 1,
- 0
- )
- if IsFindBlockComment:
- EdkLogger.error("Parser", FORMAT_INVALID, "Open block comments (starting with /*) are expected to end with */",
- File=self.MetaFile)
- self._Done()
-
- ## Data parser for the format in which there's path
- #
- # Only path can have macro used. So we need to replace them before use.
- #
- def _IncludeParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- self._ValueList[0:len(TokenList)] = TokenList
- Macros = self._Macros
- if Macros:
- for Index in range(0, len(self._ValueList)):
- Value = self._ValueList[Index]
- if not Value:
- continue
-
- if Value.upper().find('$(EFI_SOURCE)\Edk'.upper()) > -1 or Value.upper().find('$(EFI_SOURCE)/Edk'.upper()) > -1:
- Value = '$(EDK_SOURCE)' + Value[17:]
- if Value.find('$(EFI_SOURCE)') > -1 or Value.find('$(EDK_SOURCE)') > -1:
- pass
- elif Value.startswith('.'):
- pass
- elif Value.startswith('$('):
- pass
- else:
- Value = '$(EFI_SOURCE)/' + Value
-
- self._ValueList[Index] = ReplaceMacro(Value, Macros)
-
- ## Parse [Sources] section
- #
- # Only path can have macro used. So we need to replace them before use.
- #
- @ParseMacro
- def _SourceFileParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- self._ValueList[0:len(TokenList)] = TokenList
- Macros = self._Macros
- # For Acpi tables, remove macro like ' TABLE_NAME=Sata1'
- if 'COMPONENT_TYPE' in Macros:
- if self._Defines['COMPONENT_TYPE'].upper() == 'ACPITABLE':
- self._ValueList[0] = GetSplitValueList(self._ValueList[0], ' ', 1)[0]
- if self._Defines['BASE_NAME'] == 'Microcode':
- pass
- self._ValueList = [ReplaceMacro(Value, Macros) for Value in self._ValueList]
-
- ## Parse [Binaries] section
- #
- # Only path can have macro used. So we need to replace them before use.
- #
- @ParseMacro
- def _BinaryFileParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 2)
- if len(TokenList) < 2:
- EdkLogger.error('Parser', FORMAT_INVALID, "No file type or path specified",
- ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
- File=self.MetaFile, Line=self._LineIndex + 1)
- if not TokenList[0]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No file type specified",
- ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
- File=self.MetaFile, Line=self._LineIndex + 1)
- if not TokenList[1]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No file path specified",
- ExtraData=self._CurrentLine + " (<FileType> | <FilePath> [| <Target>])",
- File=self.MetaFile, Line=self._LineIndex + 1)
- self._ValueList[0:len(TokenList)] = TokenList
- self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros)
-
- ## [nmake] section parser (Edk.x style only)
- def _NmakeParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- self._ValueList[0:len(TokenList)] = TokenList
- # remove macros
- self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros)
- # remove self-reference in macro setting
- #self._ValueList[1] = ReplaceMacro(self._ValueList[1], {self._ValueList[0]:''})
-
- ## [FixedPcd], [FeaturePcd], [PatchPcd], [Pcd] and [PcdEx] sections parser
- @ParseMacro
- def _PcdParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
- ValueList = GetSplitValueList(TokenList[0], TAB_SPLIT)
- if len(ValueList) != 2:
- EdkLogger.error('Parser', FORMAT_INVALID, "Illegal token space GUID and PCD name format",
- ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- self._ValueList[0:1] = ValueList
- if len(TokenList) > 1:
- self._ValueList[2] = TokenList[1]
- if self._ValueList[0] == '' or self._ValueList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
- ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
-
- # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
- if self._ValueList[2] != '':
- InfPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
- if InfPcdValueList[0] in ['True', 'true', 'TRUE']:
- self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '1', 1);
- elif InfPcdValueList[0] in ['False', 'false', 'FALSE']:
- self._ValueList[2] = TokenList[1].replace(InfPcdValueList[0], '0', 1);
- if (self._ValueList[0], self._ValueList[1]) not in self.PcdsDict:
- self.PcdsDict[self._ValueList[0], self._ValueList[1]] = self._SectionType
- elif self.PcdsDict[self._ValueList[0], self._ValueList[1]] != self._SectionType:
- EdkLogger.error('Parser', FORMAT_INVALID, "It is not permissible to list a specified PCD in different PCD type sections.",
- ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<PcdCName>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
-
- ## [depex] section parser
- @ParseMacro
- def _DepexParser(self):
- self._ValueList[0:1] = [self._CurrentLine]
-
- _SectionParser = {
- MODEL_UNKNOWN : MetaFileParser._Skip,
- MODEL_META_DATA_HEADER : MetaFileParser._DefineParser,
- MODEL_META_DATA_BUILD_OPTION : MetaFileParser._BuildOptionParser,
- MODEL_EFI_INCLUDE : _IncludeParser, # for Edk.x modules
- MODEL_EFI_LIBRARY_INSTANCE : MetaFileParser._CommonParser, # for Edk.x modules
- MODEL_EFI_LIBRARY_CLASS : MetaFileParser._PathParser,
- MODEL_META_DATA_PACKAGE : MetaFileParser._PathParser,
- MODEL_META_DATA_NMAKE : _NmakeParser, # for Edk.x modules
- MODEL_PCD_FIXED_AT_BUILD : _PcdParser,
- MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,
- MODEL_PCD_FEATURE_FLAG : _PcdParser,
- MODEL_PCD_DYNAMIC_EX : _PcdParser,
- MODEL_PCD_DYNAMIC : _PcdParser,
- MODEL_EFI_SOURCE_FILE : _SourceFileParser,
- MODEL_EFI_GUID : MetaFileParser._CommonParser,
- MODEL_EFI_PROTOCOL : MetaFileParser._CommonParser,
- MODEL_EFI_PPI : MetaFileParser._CommonParser,
- MODEL_EFI_DEPEX : _DepexParser,
- MODEL_EFI_BINARY_FILE : _BinaryFileParser,
- MODEL_META_DATA_USER_EXTENSION : MetaFileParser._Skip,
- }
-
-## DSC file parser class
-#
-# @param FilePath The path of platform description file
-# @param FileType The raw data of DSC file
-# @param Table Database used to retrieve module/package information
-# @param Macros Macros used for replacement in file
-# @param Owner Owner ID (for sub-section parsing)
-# @param From ID from which the data comes (for !INCLUDE directive)
-#
-class DscParser(MetaFileParser):
- # DSC file supported data types (one type per section)
- DataType = {
- TAB_SKUIDS.upper() : MODEL_EFI_SKU_ID,
- TAB_LIBRARIES.upper() : MODEL_EFI_LIBRARY_INSTANCE,
- TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,
- TAB_BUILD_OPTIONS.upper() : MODEL_META_DATA_BUILD_OPTION,
- TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : MODEL_PCD_FIXED_AT_BUILD,
- TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,
- TAB_PCDS_FEATURE_FLAG_NULL.upper() : MODEL_PCD_FEATURE_FLAG,
- TAB_PCDS_DYNAMIC_DEFAULT_NULL.upper() : MODEL_PCD_DYNAMIC_DEFAULT,
- TAB_PCDS_DYNAMIC_HII_NULL.upper() : MODEL_PCD_DYNAMIC_HII,
- TAB_PCDS_DYNAMIC_VPD_NULL.upper() : MODEL_PCD_DYNAMIC_VPD,
- TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper() : MODEL_PCD_DYNAMIC_EX_DEFAULT,
- TAB_PCDS_DYNAMIC_EX_HII_NULL.upper() : MODEL_PCD_DYNAMIC_EX_HII,
- TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper() : MODEL_PCD_DYNAMIC_EX_VPD,
- TAB_COMPONENTS.upper() : MODEL_META_DATA_COMPONENT,
- TAB_COMPONENTS_SOURCE_OVERRIDE_PATH.upper() : MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH,
- TAB_DSC_DEFINES.upper() : MODEL_META_DATA_HEADER,
- TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DEFINE,
- TAB_DSC_DEFINES_EDKGLOBAL : MODEL_META_DATA_GLOBAL_DEFINE,
- TAB_INCLUDE.upper() : MODEL_META_DATA_INCLUDE,
- TAB_IF.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
- TAB_IF_DEF.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,
- TAB_IF_N_DEF.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF,
- TAB_ELSE_IF.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF,
- TAB_ELSE.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE,
- TAB_END_IF.upper() : MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF,
- }
-
- # Valid names in define section
- DefineKeywords = [
- "DSC_SPECIFICATION",
- "PLATFORM_NAME",
- "PLATFORM_GUID",
- "PLATFORM_VERSION",
- "SKUID_IDENTIFIER",
- "SUPPORTED_ARCHITECTURES",
- "BUILD_TARGETS",
- "OUTPUT_DIRECTORY",
- "FLASH_DEFINITION",
- "BUILD_NUMBER",
- "RFC_LANGUAGES",
- "ISO_LANGUAGES",
- "TIME_STAMP_FILE",
- "VPD_TOOL_GUID",
- "FIX_LOAD_TOP_MEMORY_ADDRESS"
- ]
-
- SymbolPattern = ValueExpression.SymbolPattern
-
- ## Constructor of DscParser
- #
- # Initialize object of DscParser
- #
- # @param FilePath The path of platform description file
- # @param FileType The raw data of DSC file
- # @param Table Database used to retrieve module/package information
- # @param Macros Macros used for replacement in file
- # @param Owner Owner ID (for sub-section parsing)
- # @param From ID from which the data comes (for !INCLUDE directive)
- #
- def __init__(self, FilePath, FileType, Table, Owner= -1, From= -1):
- # prevent re-initialization
- if hasattr(self, "_Table"):
- return
- MetaFileParser.__init__(self, FilePath, FileType, Table, Owner, From)
- self._Version = 0x00010005 # Only EDK2 dsc file is supported
- # to store conditional directive evaluation result
- self._DirectiveStack = []
- self._DirectiveEvalStack = []
- self._Enabled = 1
-
- #
- # Specify whether current line is in uncertain condition
- #
- self._InDirective = -1
-
- # Final valid replacable symbols
- self._Symbols = {}
- #
- # Map the ID between the original table and new table to track
- # the owner item
- #
- self._IdMapping = {-1:-1}
-
- ## Parser starter
- def Start(self):
- Content = ''
- try:
- Content = open(str(self.MetaFile), 'r').readlines()
- except:
- EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=self.MetaFile)
-
- for Index in range(0, len(Content)):
- Line = CleanString(Content[Index])
- # skip empty line
- if Line == '':
- continue
-
- self._CurrentLine = Line
- self._LineIndex = Index
- if self._InSubsection and self._Owner[-1] == -1:
- self._Owner.append(self._LastItem)
-
- # section header
- if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
- self._SectionType = MODEL_META_DATA_SECTION_HEADER
- # subsection ending
- elif Line[0] == '}' and self._InSubsection:
- self._InSubsection = False
- self._SubsectionType = MODEL_UNKNOWN
- self._SubsectionName = ''
- self._Owner[-1] = -1
- continue
- # subsection header
- elif Line[0] == TAB_OPTION_START and Line[-1] == TAB_OPTION_END:
- self._SubsectionType = MODEL_META_DATA_SUBSECTION_HEADER
- # directive line
- elif Line[0] == '!':
- self._DirectiveParser()
- continue
-
- if self._InSubsection:
- SectionType = self._SubsectionType
- else:
- SectionType = self._SectionType
- self._ItemType = SectionType
-
- self._ValueList = ['', '', '']
- self._SectionParser[SectionType](self)
- if self._ValueList == None:
- continue
- #
- # Model, Value1, Value2, Value3, Arch, ModuleType, BelongsToItem=-1, BelongsToFile=-1,
- # LineBegin=-1, ColumnBegin=-1, LineEnd=-1, ColumnEnd=-1, Enabled=-1
- #
- for Arch, ModuleType in self._Scope:
- self._LastItem = self._Store(
- self._ItemType,
- self._ValueList[0],
- self._ValueList[1],
- self._ValueList[2],
- Arch,
- ModuleType,
- self._Owner[-1],
- self._From,
- self._LineIndex + 1,
- - 1,
- self._LineIndex + 1,
- - 1,
- self._Enabled
- )
-
- if self._DirectiveStack:
- Type, Line, Text = self._DirectiveStack[-1]
- EdkLogger.error('Parser', FORMAT_INVALID, "No matching '!endif' found",
- ExtraData=Text, File=self.MetaFile, Line=Line)
- self._Done()
-
- ## <subsection_header> parser
- def _SubsectionHeaderParser(self):
- self._SubsectionName = self._CurrentLine[1:-1].upper()
- if self._SubsectionName in self.DataType:
- self._SubsectionType = self.DataType[self._SubsectionName]
- else:
- self._SubsectionType = MODEL_UNKNOWN
- EdkLogger.warn("Parser", "Unrecognized sub-section", File=self.MetaFile,
- Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
- self._ValueList[0] = self._SubsectionName
-
- ## Directive statement parser
- def _DirectiveParser(self):
- self._ValueList = ['', '', '']
- TokenList = GetSplitValueList(self._CurrentLine, ' ', 1)
- self._ValueList[0:len(TokenList)] = TokenList
-
- # Syntax check
- DirectiveName = self._ValueList[0].upper()
- if DirectiveName not in self.DataType:
- EdkLogger.error("Parser", FORMAT_INVALID, "Unknown directive [%s]" % DirectiveName,
- File=self.MetaFile, Line=self._LineIndex + 1)
-
- if DirectiveName in ['!IF', '!IFDEF', '!IFNDEF']:
- self._InDirective += 1
-
- if DirectiveName in ['!ENDIF']:
- self._InDirective -= 1
-
- if DirectiveName in ['!IF', '!IFDEF', '!INCLUDE', '!IFNDEF', '!ELSEIF'] and self._ValueList[1] == '':
- EdkLogger.error("Parser", FORMAT_INVALID, "Missing expression",
- File=self.MetaFile, Line=self._LineIndex + 1,
- ExtraData=self._CurrentLine)
-
- ItemType = self.DataType[DirectiveName]
- Scope = [['COMMON', 'COMMON']]
- if ItemType == MODEL_META_DATA_INCLUDE:
- Scope = self._Scope
- if ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF:
- # Remove all directives between !if and !endif, including themselves
- while self._DirectiveStack:
- # Remove any !else or !elseif
- DirectiveInfo = self._DirectiveStack.pop()
- if DirectiveInfo[0] in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF]:
- break
- else:
- EdkLogger.error("Parser", FORMAT_INVALID, "Redundant '!endif'",
- File=self.MetaFile, Line=self._LineIndex + 1,
- ExtraData=self._CurrentLine)
- elif ItemType != MODEL_META_DATA_INCLUDE:
- # Break if there's a !else is followed by a !elseif
- if ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF and \
- self._DirectiveStack and \
- self._DirectiveStack[-1][0] == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE:
- EdkLogger.error("Parser", FORMAT_INVALID, "'!elseif' after '!else'",
- File=self.MetaFile, Line=self._LineIndex + 1,
- ExtraData=self._CurrentLine)
- self._DirectiveStack.append((ItemType, self._LineIndex + 1, self._CurrentLine))
- elif self._From > 0:
- EdkLogger.error('Parser', FORMAT_INVALID,
- "No '!include' allowed in included file",
- ExtraData=self._CurrentLine, File=self.MetaFile,
- Line=self._LineIndex + 1)
-
- #
- # Model, Value1, Value2, Value3, Arch, ModuleType, BelongsToItem=-1, BelongsToFile=-1,
- # LineBegin=-1, ColumnBegin=-1, LineEnd=-1, ColumnEnd=-1, Enabled=-1
- #
- for Arch, ModuleType in Scope:
- self._LastItem = self._Store(
- ItemType,
- self._ValueList[0],
- self._ValueList[1],
- self._ValueList[2],
- Arch,
- ModuleType,
- self._Owner[-1],
- self._From,
- self._LineIndex + 1,
- - 1,
- self._LineIndex + 1,
- - 1,
- 0
- )
-
- ## [defines] section parser
- @ParseMacro
- def _DefineParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- self._ValueList[1:len(TokenList)] = TokenList
-
- # Syntax check
- if not self._ValueList[1]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No name specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- if not self._ValueList[2]:
- EdkLogger.error('Parser', FORMAT_INVALID, "No value specified",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- if not self._ValueList[1] in self.DefineKeywords:
- EdkLogger.error('Parser', FORMAT_INVALID,
- "Unknown keyword found: %s. "
- "If this is a macro you must "
- "add it as a DEFINE in the DSC" % self._ValueList[1],
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- self._Defines[self._ValueList[1]] = self._ValueList[2]
- self._ItemType = self.DataType[TAB_DSC_DEFINES.upper()]
-
- @ParseMacro
- def _SkuIdParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- if len(TokenList) != 2:
- EdkLogger.error('Parser', FORMAT_INVALID, "Correct format is '<Integer>|<UiName>'",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- self._ValueList[0:len(TokenList)] = TokenList
-
- ## Parse Edk style of library modules
- @ParseMacro
- def _LibraryInstanceParser(self):
- self._ValueList[0] = self._CurrentLine
-
- ## PCD sections parser
- #
- # [PcdsFixedAtBuild]
- # [PcdsPatchableInModule]
- # [PcdsFeatureFlag]
- # [PcdsDynamicEx
- # [PcdsDynamicExDefault]
- # [PcdsDynamicExVpd]
- # [PcdsDynamicExHii]
- # [PcdsDynamic]
- # [PcdsDynamicDefault]
- # [PcdsDynamicVpd]
- # [PcdsDynamicHii]
- #
- @ParseMacro
- def _PcdParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
- self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
- if len(TokenList) == 2:
- self._ValueList[2] = TokenList[1]
- if self._ValueList[0] == '' or self._ValueList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
- ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- if self._ValueList[2] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given",
- ExtraData=self._CurrentLine + " (<TokenSpaceGuidCName>.<TokenCName>|<PcdValue>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
-
- # Validate the datum type of Dynamic Defaul PCD and DynamicEx Default PCD
- ValueList = GetSplitValueList(self._ValueList[2])
- if len(ValueList) > 1 and ValueList[1] != TAB_VOID \
- and self._ItemType in [MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT]:
- EdkLogger.error('Parser', FORMAT_INVALID, "The datum type '%s' of PCD is wrong" % ValueList[1],
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
-
- # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE', replace with integer 1 or 0.
- DscPcdValueList = GetSplitValueList(TokenList[1], TAB_VALUE_SPLIT, 1)
- if DscPcdValueList[0] in ['True', 'true', 'TRUE']:
- self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '1', 1);
- elif DscPcdValueList[0] in ['False', 'false', 'FALSE']:
- self._ValueList[2] = TokenList[1].replace(DscPcdValueList[0], '0', 1);
-
-
- ## [components] section parser
- @ParseMacro
- def _ComponentParser(self):
- if self._CurrentLine[-1] == '{':
- self._ValueList[0] = self._CurrentLine[0:-1].strip()
- self._InSubsection = True
- else:
- self._ValueList[0] = self._CurrentLine
-
- ## [LibraryClasses] section
- @ParseMacro
- def _LibraryClassParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
- if len(TokenList) < 2:
- EdkLogger.error('Parser', FORMAT_INVALID, "No library class or instance specified",
- ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- if TokenList[0] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No library class specified",
- ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- if TokenList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No library instance specified",
- ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
-
- self._ValueList[0:len(TokenList)] = TokenList
-
- def _CompponentSourceOverridePathParser(self):
- self._ValueList[0] = self._CurrentLine
-
- ## [BuildOptions] section parser
- @ParseMacro
- def _BuildOptionParser(self):
- self._CurrentLine = CleanString(self._CurrentLine, BuildOption=True)
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- TokenList2 = GetSplitValueList(TokenList[0], ':', 1)
- if len(TokenList2) == 2:
- self._ValueList[0] = TokenList2[0] # toolchain family
- self._ValueList[1] = TokenList2[1] # keys
- else:
- self._ValueList[1] = TokenList[0]
- if len(TokenList) == 2: # value
- self._ValueList[2] = TokenList[1]
-
- if self._ValueList[1].count('_') != 4:
- EdkLogger.error(
- 'Parser',
- FORMAT_INVALID,
- "'%s' must be in format of <TARGET>_<TOOLCHAIN>_<ARCH>_<TOOL>_FLAGS" % self._ValueList[1],
- ExtraData=self._CurrentLine,
- File=self.MetaFile,
- Line=self._LineIndex + 1
- )
-
- ## Override parent's method since we'll do all macro replacements in parser
- def _GetMacros(self):
- Macros = {}
- Macros.update(self._FileLocalMacros)
- Macros.update(self._GetApplicableSectionMacro())
- Macros.update(GlobalData.gEdkGlobal)
- Macros.update(GlobalData.gPlatformDefines)
- Macros.update(GlobalData.gCommandLineDefines)
- # PCD cannot be referenced in macro definition
- if self._ItemType not in [MODEL_META_DATA_DEFINE, MODEL_META_DATA_GLOBAL_DEFINE]:
- Macros.update(self._Symbols)
- return Macros
-
- def _PostProcess(self):
- Processer = {
- MODEL_META_DATA_SECTION_HEADER : self.__ProcessSectionHeader,
- MODEL_META_DATA_SUBSECTION_HEADER : self.__ProcessSubsectionHeader,
- MODEL_META_DATA_HEADER : self.__ProcessDefine,
- MODEL_META_DATA_DEFINE : self.__ProcessDefine,
- MODEL_META_DATA_GLOBAL_DEFINE : self.__ProcessDefine,
- MODEL_META_DATA_INCLUDE : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IF : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF : self.__ProcessDirective,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF : self.__ProcessDirective,
- MODEL_EFI_SKU_ID : self.__ProcessSkuId,
- MODEL_EFI_LIBRARY_INSTANCE : self.__ProcessLibraryInstance,
- MODEL_EFI_LIBRARY_CLASS : self.__ProcessLibraryClass,
- MODEL_PCD_FIXED_AT_BUILD : self.__ProcessPcd,
- MODEL_PCD_PATCHABLE_IN_MODULE : self.__ProcessPcd,
- MODEL_PCD_FEATURE_FLAG : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_DEFAULT : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_HII : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_VPD : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_EX_DEFAULT : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_EX_HII : self.__ProcessPcd,
- MODEL_PCD_DYNAMIC_EX_VPD : self.__ProcessPcd,
- MODEL_META_DATA_COMPONENT : self.__ProcessComponent,
- MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH : self.__ProcessSourceOverridePath,
- MODEL_META_DATA_BUILD_OPTION : self.__ProcessBuildOption,
- MODEL_UNKNOWN : self._Skip,
- MODEL_META_DATA_USER_EXTENSION : self._Skip,
- }
-
- self._Table = MetaFileStorage(self._RawTable.Cur, self.MetaFile, MODEL_FILE_DSC, True)
- self._Table.Create()
- self._DirectiveStack = []
- self._DirectiveEvalStack = []
- self._FileWithError = self.MetaFile
- self._FileLocalMacros = {}
- self._SectionsMacroDict = {}
- GlobalData.gPlatformDefines = {}
-
- # Get all macro and PCD which has straitforward value
- self.__RetrievePcdValue()
- self._Content = self._RawTable.GetAll()
- self._ContentIndex = 0
- while self._ContentIndex < len(self._Content) :
- Id, self._ItemType, V1, V2, V3, S1, S2, Owner, self._From, \
- LineStart, ColStart, LineEnd, ColEnd, Enabled = self._Content[self._ContentIndex]
-
- if self._From < 0:
- self._FileWithError = self.MetaFile
-
- self._ContentIndex += 1
-
- self._Scope = [[S1, S2]]
- #
- # For !include directive, handle it specially,
- # merge arch and module type in case of duplicate items
- #
- while self._ItemType == MODEL_META_DATA_INCLUDE:
- if self._ContentIndex >= len(self._Content):
- break
- Record = self._Content[self._ContentIndex]
- if LineStart == Record[9] and LineEnd == Record[11]:
- if [Record[5], Record[6]] not in self._Scope:
- self._Scope.append([Record[5], Record[6]])
- self._ContentIndex += 1
- else:
- break
-
- self._LineIndex = LineStart - 1
- self._ValueList = [V1, V2, V3]
-
- try:
- Processer[self._ItemType]()
- except EvaluationException, Excpt:
- #
- # Only catch expression evaluation error here. We need to report
- # the precise number of line on which the error occurred
- #
- if hasattr(Excpt, 'Pcd'):
- if Excpt.Pcd in GlobalData.gPlatformOtherPcds:
- Info = GlobalData.gPlatformOtherPcds[Excpt.Pcd]
- EdkLogger.error('Parser', FORMAT_INVALID, "Cannot use this PCD (%s) in an expression as"
- " it must be defined in a [PcdsFixedAtBuild] or [PcdsFeatureFlag] section"
- " of the DSC file, and it is currently defined in this section:"
- " %s, line #: %d." % (Excpt.Pcd, Info[0], Info[1]),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex + 1)
- else:
- EdkLogger.error('Parser', FORMAT_INVALID, "PCD (%s) is not defined in DSC file" % Excpt.Pcd,
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex + 1)
- else:
- EdkLogger.error('Parser', FORMAT_INVALID, "Invalid expression: %s" % str(Excpt),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex + 1)
- except MacroException, Excpt:
- EdkLogger.error('Parser', FORMAT_INVALID, str(Excpt),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex + 1)
-
- if self._ValueList == None:
- continue
-
- NewOwner = self._IdMapping.get(Owner, -1)
- self._Enabled = int((not self._DirectiveEvalStack) or (False not in self._DirectiveEvalStack))
- self._LastItem = self._Store(
- self._ItemType,
- self._ValueList[0],
- self._ValueList[1],
- self._ValueList[2],
- S1,
- S2,
- NewOwner,
- self._From,
- self._LineIndex + 1,
- - 1,
- self._LineIndex + 1,
- - 1,
- self._Enabled
- )
- self._IdMapping[Id] = self._LastItem
-
- GlobalData.gPlatformDefines.update(self._FileLocalMacros)
- self._PostProcessed = True
- self._Content = None
-
- def __ProcessSectionHeader(self):
- self._SectionName = self._ValueList[0]
- if self._SectionName in self.DataType:
- self._SectionType = self.DataType[self._SectionName]
- else:
- self._SectionType = MODEL_UNKNOWN
-
- def __ProcessSubsectionHeader(self):
- self._SubsectionName = self._ValueList[0]
- if self._SubsectionName in self.DataType:
- self._SubsectionType = self.DataType[self._SubsectionName]
- else:
- self._SubsectionType = MODEL_UNKNOWN
-
- def __RetrievePcdValue(self):
- Records = self._RawTable.Query(MODEL_PCD_FEATURE_FLAG, BelongsToItem= -1.0)
- for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
- Name = TokenSpaceGuid + '.' + PcdName
- ValList, Valid, Index = AnalyzeDscPcd(Value, MODEL_PCD_FEATURE_FLAG)
- self._Symbols[Name] = ValList[Index]
-
- Records = self._RawTable.Query(MODEL_PCD_FIXED_AT_BUILD, BelongsToItem= -1.0)
- for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
- Name = TokenSpaceGuid + '.' + PcdName
- ValList, Valid, Index = AnalyzeDscPcd(Value, MODEL_PCD_FIXED_AT_BUILD)
- self._Symbols[Name] = ValList[Index]
-
- Content = open(str(self.MetaFile), 'r').readlines()
- GlobalData.gPlatformOtherPcds['DSCFILE'] = str(self.MetaFile)
- for PcdType in (MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII,
- MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_DEFAULT, MODEL_PCD_DYNAMIC_EX_HII,
- MODEL_PCD_DYNAMIC_EX_VPD):
- Records = self._RawTable.Query(PcdType, BelongsToItem= -1.0)
- for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Records:
- Name = TokenSpaceGuid + '.' + PcdName
- if Name not in GlobalData.gPlatformOtherPcds:
- PcdLine = Line
- while not Content[Line - 1].lstrip().startswith(TAB_SECTION_START):
- Line -= 1
- GlobalData.gPlatformOtherPcds[Name] = (CleanString(Content[Line - 1]), PcdLine, PcdType)
-
- def __ProcessDefine(self):
- if not self._Enabled:
- return
-
- Type, Name, Value = self._ValueList
- Value = ReplaceMacro(Value, self._Macros, False)
- if self._ItemType == MODEL_META_DATA_DEFINE:
- if self._SectionType == MODEL_META_DATA_HEADER:
- self._FileLocalMacros[Name] = Value
- else:
- self._ConstructSectionMacroDict(Name, Value)
- elif self._ItemType == MODEL_META_DATA_GLOBAL_DEFINE:
- GlobalData.gEdkGlobal[Name] = Value
-
- #
- # Keyword in [Defines] section can be used as Macros
- #
- if (self._ItemType == MODEL_META_DATA_HEADER) and (self._SectionType == MODEL_META_DATA_HEADER):
- self._FileLocalMacros[Name] = Value
-
- self._ValueList = [Type, Name, Value]
-
- def __ProcessDirective(self):
- Result = None
- if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF]:
- Macros = self._Macros
- Macros.update(GlobalData.gGlobalDefines)
- try:
- Result = ValueExpression(self._ValueList[1], Macros)()
- except SymbolNotFound, Exc:
- EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc), self._ValueList[1])
- Result = False
- except WrnExpression, Excpt:
- #
- # Catch expression evaluation warning here. We need to report
- # the precise number of line and return the evaluation result
- #
- EdkLogger.warn('Parser', "Suspicious expression: %s" % str(Excpt),
- File=self._FileWithError, ExtraData=' '.join(self._ValueList),
- Line=self._LineIndex + 1)
- Result = Excpt.result
-
- if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF]:
- self._DirectiveStack.append(self._ItemType)
- if self._ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_IF:
- Result = bool(Result)
- else:
- Macro = self._ValueList[1]
- Macro = Macro[2:-1] if (Macro.startswith("$(") and Macro.endswith(")")) else Macro
- Result = Macro in self._Macros
- if self._ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF:
- Result = not Result
- self._DirectiveEvalStack.append(Result)
- elif self._ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF:
- self._DirectiveStack.append(self._ItemType)
- self._DirectiveEvalStack[-1] = not self._DirectiveEvalStack[-1]
- self._DirectiveEvalStack.append(bool(Result))
- elif self._ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE:
- self._DirectiveStack.append(self._ItemType)
- self._DirectiveEvalStack[-1] = not self._DirectiveEvalStack[-1]
- self._DirectiveEvalStack.append(True)
- elif self._ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF:
- # Back to the nearest !if/!ifdef/!ifndef
- while self._DirectiveStack:
- self._DirectiveEvalStack.pop()
- Directive = self._DirectiveStack.pop()
- if Directive in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,
- MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF]:
- break
- elif self._ItemType == MODEL_META_DATA_INCLUDE:
- # The included file must be relative to workspace or same directory as DSC file
- __IncludeMacros = {}
- #
- # Allow using system environment variables in path after !include
- #
- __IncludeMacros['WORKSPACE'] = GlobalData.gGlobalDefines['WORKSPACE']
- if "ECP_SOURCE" in GlobalData.gGlobalDefines.keys():
- __IncludeMacros['ECP_SOURCE'] = GlobalData.gGlobalDefines['ECP_SOURCE']
- #
- # During GenFds phase call DSC parser, will go into this branch.
- #
- elif "ECP_SOURCE" in GlobalData.gCommandLineDefines.keys():
- __IncludeMacros['ECP_SOURCE'] = GlobalData.gCommandLineDefines['ECP_SOURCE']
-
- __IncludeMacros['EFI_SOURCE'] = GlobalData.gGlobalDefines['EFI_SOURCE']
- __IncludeMacros['EDK_SOURCE'] = GlobalData.gGlobalDefines['EDK_SOURCE']
- #
- # Allow using MACROs comes from [Defines] section to keep compatible.
- #
- __IncludeMacros.update(self._Macros)
-
- IncludedFile = NormPath(ReplaceMacro(self._ValueList[1], __IncludeMacros, RaiseError=True))
- #
- # First search the include file under the same directory as DSC file
- #
- IncludedFile1 = PathClass(IncludedFile, self.MetaFile.Dir)
- ErrorCode, ErrorInfo1 = IncludedFile1.Validate()
- if ErrorCode != 0:
- #
- # Also search file under the WORKSPACE directory
- #
- IncludedFile1 = PathClass(IncludedFile, GlobalData.gWorkspace)
- ErrorCode, ErrorInfo2 = IncludedFile1.Validate()
- if ErrorCode != 0:
- EdkLogger.error('parser', ErrorCode, File=self._FileWithError,
- Line=self._LineIndex + 1, ExtraData=ErrorInfo1 + "\n" + ErrorInfo2)
-
- self._FileWithError = IncludedFile1
-
- IncludedFileTable = MetaFileStorage(self._Table.Cur, IncludedFile1, MODEL_FILE_DSC, False)
- Owner = self._Content[self._ContentIndex - 1][0]
- Parser = DscParser(IncludedFile1, self._FileType, IncludedFileTable,
- Owner=Owner, From=Owner)
-
- # set the parser status with current status
- Parser._SectionName = self._SectionName
- Parser._SectionType = self._SectionType
- Parser._Scope = self._Scope
- Parser._Enabled = self._Enabled
- # Parse the included file
- Parser.Start()
-
- # update current status with sub-parser's status
- self._SectionName = Parser._SectionName
- self._SectionType = Parser._SectionType
- self._Scope = Parser._Scope
- self._Enabled = Parser._Enabled
-
- # Insert all records in the table for the included file into dsc file table
- Records = IncludedFileTable.GetAll()
- if Records:
- self._Content[self._ContentIndex:self._ContentIndex] = Records
- self._Content.pop(self._ContentIndex - 1)
- self._ValueList = None
- self._ContentIndex -= 1
-
- def __ProcessSkuId(self):
- self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=True)
- for Value in self._ValueList]
-
- def __ProcessLibraryInstance(self):
- self._ValueList = [ReplaceMacro(Value, self._Macros) for Value in self._ValueList]
-
- def __ProcessLibraryClass(self):
- self._ValueList[1] = ReplaceMacro(self._ValueList[1], self._Macros, RaiseError=True)
-
- def __ProcessPcd(self):
- if self._ItemType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
- self._ValueList[2] = ReplaceMacro(self._ValueList[2], self._Macros, RaiseError=True)
- return
-
- ValList, Valid, Index = AnalyzeDscPcd(self._ValueList[2], self._ItemType)
- if not Valid:
- EdkLogger.error('build', FORMAT_INVALID, "Pcd format incorrect.", File=self._FileWithError, Line=self._LineIndex+1,
- ExtraData="%s.%s|%s" % (self._ValueList[0], self._ValueList[1], self._ValueList[2]))
- PcdValue = ValList[Index]
- if PcdValue:
- try:
- ValList[Index] = ValueExpression(PcdValue, self._Macros)(True)
- except WrnExpression, Value:
- ValList[Index] = Value.result
-
- if ValList[Index] == 'True':
- ValList[Index] = '1'
- if ValList[Index] == 'False':
- ValList[Index] = '0'
-
- GlobalData.gPlatformPcds[TAB_SPLIT.join(self._ValueList[0:2])] = PcdValue
- self._ValueList[2] = '|'.join(ValList)
-
- def __ProcessComponent(self):
- self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
-
- def __ProcessSourceOverridePath(self):
- self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
-
- def __ProcessBuildOption(self):
- self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=False)
- for Value in self._ValueList]
-
- _SectionParser = {
- MODEL_META_DATA_HEADER : _DefineParser,
- MODEL_EFI_SKU_ID : _SkuIdParser,
- MODEL_EFI_LIBRARY_INSTANCE : _LibraryInstanceParser,
- MODEL_EFI_LIBRARY_CLASS : _LibraryClassParser,
- MODEL_PCD_FIXED_AT_BUILD : _PcdParser,
- MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,
- MODEL_PCD_FEATURE_FLAG : _PcdParser,
- MODEL_PCD_DYNAMIC_DEFAULT : _PcdParser,
- MODEL_PCD_DYNAMIC_HII : _PcdParser,
- MODEL_PCD_DYNAMIC_VPD : _PcdParser,
- MODEL_PCD_DYNAMIC_EX_DEFAULT : _PcdParser,
- MODEL_PCD_DYNAMIC_EX_HII : _PcdParser,
- MODEL_PCD_DYNAMIC_EX_VPD : _PcdParser,
- MODEL_META_DATA_COMPONENT : _ComponentParser,
- MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH : _CompponentSourceOverridePathParser,
- MODEL_META_DATA_BUILD_OPTION : _BuildOptionParser,
- MODEL_UNKNOWN : MetaFileParser._Skip,
- MODEL_META_DATA_USER_EXTENSION : MetaFileParser._Skip,
- MODEL_META_DATA_SECTION_HEADER : MetaFileParser._SectionHeaderParser,
- MODEL_META_DATA_SUBSECTION_HEADER : _SubsectionHeaderParser,
- }
-
- _Macros = property(_GetMacros)
-
-## DEC file parser class
-#
-# @param FilePath The path of platform description file
-# @param FileType The raw data of DSC file
-# @param Table Database used to retrieve module/package information
-# @param Macros Macros used for replacement in file
-#
-class DecParser(MetaFileParser):
- # DEC file supported data types (one type per section)
- DataType = {
- TAB_DEC_DEFINES.upper() : MODEL_META_DATA_HEADER,
- TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DEFINE,
- TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,
- TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,
- TAB_GUIDS.upper() : MODEL_EFI_GUID,
- TAB_PPIS.upper() : MODEL_EFI_PPI,
- TAB_PROTOCOLS.upper() : MODEL_EFI_PROTOCOL,
- TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : MODEL_PCD_FIXED_AT_BUILD,
- TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,
- TAB_PCDS_FEATURE_FLAG_NULL.upper() : MODEL_PCD_FEATURE_FLAG,
- TAB_PCDS_DYNAMIC_NULL.upper() : MODEL_PCD_DYNAMIC,
- TAB_PCDS_DYNAMIC_EX_NULL.upper() : MODEL_PCD_DYNAMIC_EX,
- }
-
- ## Constructor of DecParser
- #
- # Initialize object of DecParser
- #
- # @param FilePath The path of platform description file
- # @param FileType The raw data of DSC file
- # @param Table Database used to retrieve module/package information
- # @param Macros Macros used for replacement in file
- #
- def __init__(self, FilePath, FileType, Table):
- # prevent re-initialization
- if hasattr(self, "_Table"):
- return
- MetaFileParser.__init__(self, FilePath, FileType, Table, -1)
- self._Comments = []
- self._Version = 0x00010005 # Only EDK2 dec file is supported
- self._AllPCDs = [] # Only for check duplicate PCD
-
- ## Parser starter
- def Start(self):
- Content = ''
- try:
- Content = open(str(self.MetaFile), 'r').readlines()
- except:
- EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=self.MetaFile)
-
- for Index in range(0, len(Content)):
- Line, Comment = CleanString2(Content[Index])
- self._CurrentLine = Line
- self._LineIndex = Index
-
- # save comment for later use
- if Comment:
- self._Comments.append((Comment, self._LineIndex + 1))
- # skip empty line
- if Line == '':
- continue
-
- # section header
- if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
- self._SectionHeaderParser()
- self._Comments = []
- continue
- elif len(self._SectionType) == 0:
- self._Comments = []
- continue
-
- # section content
- self._ValueList = ['', '', '']
- self._SectionParser[self._SectionType[0]](self)
- if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:
- self._ItemType = -1
- self._Comments = []
- continue
-
- #
- # Model, Value1, Value2, Value3, Arch, BelongsToItem=-1, LineBegin=-1,
- # ColumnBegin=-1, LineEnd=-1, ColumnEnd=-1, FeatureFlag='', Enabled=-1
- #
- for Arch, ModuleType, Type in self._Scope:
- self._LastItem = self._Store(
- Type,
- self._ValueList[0],
- self._ValueList[1],
- self._ValueList[2],
- Arch,
- ModuleType,
- self._Owner[-1],
- self._LineIndex + 1,
- - 1,
- self._LineIndex + 1,
- - 1,
- 0
- )
- for Comment, LineNo in self._Comments:
- self._Store(
- MODEL_META_DATA_COMMENT,
- Comment,
- self._ValueList[0],
- self._ValueList[1],
- Arch,
- ModuleType,
- self._LastItem,
- LineNo,
- - 1,
- LineNo,
- - 1,
- 0
- )
- self._Comments = []
- self._Done()
-
-
- ## Section header parser
- #
- # The section header is always in following format:
- #
- # [section_name.arch<.platform|module_type>]
- #
- def _SectionHeaderParser(self):
- self._Scope = []
- self._SectionName = ''
- self._SectionType = []
- ArchList = set()
- Line = self._CurrentLine.replace("%s%s" % (TAB_COMMA_SPLIT, TAB_SPACE_SPLIT), TAB_COMMA_SPLIT)
- for Item in Line[1:-1].split(TAB_COMMA_SPLIT):
- if Item == '':
- EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR,
- "section name can NOT be empty or incorrectly use separator comma",
- self.MetaFile, self._LineIndex + 1, self._CurrentLine)
- ItemList = Item.split(TAB_SPLIT)
-
- # different types of PCD are permissible in one section
- self._SectionName = ItemList[0].upper()
- if self._SectionName in self.DataType:
- if self.DataType[self._SectionName] not in self._SectionType:
- self._SectionType.append(self.DataType[self._SectionName])
- else:
- EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
- self.MetaFile, self._LineIndex + 1, self._CurrentLine)
-
- if MODEL_PCD_FEATURE_FLAG in self._SectionType and len(self._SectionType) > 1:
- EdkLogger.error(
- 'Parser',
- FORMAT_INVALID,
- "%s must not be in the same section of other types of PCD" % TAB_PCDS_FEATURE_FLAG_NULL,
- File=self.MetaFile,
- Line=self._LineIndex + 1,
- ExtraData=self._CurrentLine
- )
- # S1 is always Arch
- if len(ItemList) > 1:
- S1 = ItemList[1].upper()
- else:
- S1 = 'COMMON'
- ArchList.add(S1)
- # S2 may be Platform or ModuleType
- if len(ItemList) > 2:
- S2 = ItemList[2].upper()
- else:
- S2 = 'COMMON'
- if [S1, S2, self.DataType[self._SectionName]] not in self._Scope:
- self._Scope.append([S1, S2, self.DataType[self._SectionName]])
-
- # 'COMMON' must not be used with specific ARCHs at the same section
- if 'COMMON' in ArchList and len(ArchList) > 1:
- EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",
- File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)
-
- ## [guids], [ppis] and [protocols] section parser
- @ParseMacro
- def _GuidParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
- if len(TokenList) < 2:
- EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name or value specified",
- ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- if TokenList[0] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name specified",
- ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- if TokenList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No GUID value specified",
- ExtraData=self._CurrentLine + " (<CName> = <GuidValueInCFormat>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- if TokenList[1][0] != '{' or TokenList[1][-1] != '}' or GuidStructureStringToGuidString(TokenList[1]) == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "Invalid GUID value format",
- ExtraData=self._CurrentLine + \
- " (<CName> = <GuidValueInCFormat:{8,4,4,{2,2,2,2,2,2,2,2}}>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- self._ValueList[0] = TokenList[0]
- self._ValueList[1] = TokenList[1]
-
- ## PCD sections parser
- #
- # [PcdsFixedAtBuild]
- # [PcdsPatchableInModule]
- # [PcdsFeatureFlag]
- # [PcdsDynamicEx
- # [PcdsDynamic]
- #
- @ParseMacro
- def _PcdParser(self):
- TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
- self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
- ValueRe = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*')
- # check PCD information
- if self._ValueList[0] == '' or self._ValueList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID or PCD name specified",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- # check format of token space GUID CName
- if not ValueRe.match(self._ValueList[0]):
- EdkLogger.error('Parser', FORMAT_INVALID, "The format of the token space GUID CName is invalid. The correct format is '(a-zA-Z_)[a-zA-Z0-9_]*'",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- # check format of PCD CName
- if not ValueRe.match(self._ValueList[1]):
- EdkLogger.error('Parser', FORMAT_INVALID, "The format of the PCD CName is invalid. The correct format is '(a-zA-Z_)[a-zA-Z0-9_]*'",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- # check PCD datum information
- if len(TokenList) < 2 or TokenList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "No PCD Datum information given",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
-
-
- ValueRe = re.compile(r'^\s*L?\".*\|.*\"')
- PtrValue = ValueRe.findall(TokenList[1])
-
- # Has VOID* type string, may contain "|" character in the string.
- if len(PtrValue) != 0:
- ptrValueList = re.sub(ValueRe, '', TokenList[1])
- ValueList = GetSplitValueList(ptrValueList)
- ValueList[0] = PtrValue[0]
- else:
- ValueList = GetSplitValueList(TokenList[1])
-
-
- # check if there's enough datum information given
- if len(ValueList) != 3:
- EdkLogger.error('Parser', FORMAT_INVALID, "Invalid PCD Datum information given",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- # check default value
- if ValueList[0] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "Missing DefaultValue in PCD Datum information",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- # check datum type
- if ValueList[1] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "Missing DatumType in PCD Datum information",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- # check token of the PCD
- if ValueList[2] == '':
- EdkLogger.error('Parser', FORMAT_INVALID, "Missing Token in PCD Datum information",
- ExtraData=self._CurrentLine + \
- " (<TokenSpaceGuidCName>.<PcdCName>|<DefaultValue>|<DatumType>|<Token>)",
- File=self.MetaFile, Line=self._LineIndex + 1)
- # check format of default value against the datum type
- IsValid, Cause = CheckPcdDatum(ValueList[1], ValueList[0])
- if not IsValid:
- EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=self._CurrentLine,
- File=self.MetaFile, Line=self._LineIndex + 1)
-
- if ValueList[0] in ['True', 'true', 'TRUE']:
- ValueList[0] = '1'
- elif ValueList[0] in ['False', 'false', 'FALSE']:
- ValueList[0] = '0'
-
- # check for duplicate PCD definition
- if (self._Scope[0], self._ValueList[0], self._ValueList[1]) in self._AllPCDs:
- EdkLogger.error('Parser', FORMAT_INVALID,
- "The same PCD name and GUID have been already defined",
- ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex + 1)
- else:
- self._AllPCDs.append((self._Scope[0], self._ValueList[0], self._ValueList[1]))
-
- self._ValueList[2] = ValueList[0].strip() + '|' + ValueList[1].strip() + '|' + ValueList[2].strip()
-
- _SectionParser = {
- MODEL_META_DATA_HEADER : MetaFileParser._DefineParser,
- MODEL_EFI_INCLUDE : MetaFileParser._PathParser,
- MODEL_EFI_LIBRARY_CLASS : MetaFileParser._PathParser,
- MODEL_EFI_GUID : _GuidParser,
- MODEL_EFI_PPI : _GuidParser,
- MODEL_EFI_PROTOCOL : _GuidParser,
- MODEL_PCD_FIXED_AT_BUILD : _PcdParser,
- MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,
- MODEL_PCD_FEATURE_FLAG : _PcdParser,
- MODEL_PCD_DYNAMIC : _PcdParser,
- MODEL_PCD_DYNAMIC_EX : _PcdParser,
- MODEL_UNKNOWN : MetaFileParser._Skip,
- MODEL_META_DATA_USER_EXTENSION : MetaFileParser._Skip,
- }
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- pass
-
diff --git a/BaseTools/Source/Python/Workspace/MetaFileTable.py b/BaseTools/Source/Python/Workspace/MetaFileTable.py
deleted file mode 100644
index 088a118de1..0000000000
--- a/BaseTools/Source/Python/Workspace/MetaFileTable.py
+++ /dev/null
@@ -1,351 +0,0 @@
-## @file
-# This file is used to create/update/query/erase a meta file table
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import uuid
-
-import Common.EdkLogger as EdkLogger
-
-from MetaDataTable import Table, TableFile
-from MetaDataTable import ConvertToSqlString
-from CommonDataClass.DataClass import MODEL_FILE_DSC, MODEL_FILE_DEC, MODEL_FILE_INF, \
- MODEL_FILE_OTHERS
-
-class MetaFileTable(Table):
- # TRICK: use file ID as the part before '.'
- _ID_STEP_ = 0.00000001
- _ID_MAX_ = 0.99999999
-
- ## Constructor
- def __init__(self, Cursor, MetaFile, FileType, Temporary):
- self.MetaFile = MetaFile
-
- self._FileIndexTable = TableFile(Cursor)
- self._FileIndexTable.Create(False)
-
- FileId = self._FileIndexTable.GetFileId(MetaFile)
- if not FileId:
- FileId = self._FileIndexTable.InsertFile(MetaFile, FileType)
-
- if Temporary:
- TableName = "_%s_%s_%s" % (FileType, FileId, uuid.uuid4().hex)
- else:
- TableName = "_%s_%s" % (FileType, FileId)
-
- #Table.__init__(self, Cursor, TableName, FileId, False)
- Table.__init__(self, Cursor, TableName, FileId, Temporary)
- self.Create(not self.IsIntegrity())
-
- def IsIntegrity(self):
- try:
- TimeStamp = self.MetaFile.TimeStamp
- Result = self.Cur.execute("select ID from %s where ID<0" % (self.Table)).fetchall()
- if not Result:
- # update the timestamp in database
- self._FileIndexTable.SetFileTimeStamp(self.IdBase, TimeStamp)
- return False
-
- if TimeStamp != self._FileIndexTable.GetFileTimeStamp(self.IdBase):
- # update the timestamp in database
- self._FileIndexTable.SetFileTimeStamp(self.IdBase, TimeStamp)
- return False
- except Exception, Exc:
- EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc))
- return False
- return True
-
-## Python class representation of table storing module data
-class ModuleTable(MetaFileTable):
- _ID_STEP_ = 0.00000001
- _ID_MAX_ = 0.99999999
- _COLUMN_ = '''
- ID REAL PRIMARY KEY,
- Model INTEGER NOT NULL,
- Value1 TEXT NOT NULL,
- Value2 TEXT,
- Value3 TEXT,
- Scope1 TEXT,
- Scope2 TEXT,
- BelongsToItem REAL NOT NULL,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- Enabled INTEGER DEFAULT 0
- '''
- # used as table end flag, in case the changes to database is not committed to db file
- _DUMMY_ = "-1, -1, '====', '====', '====', '====', '====', -1, -1, -1, -1, -1, -1"
-
- ## Constructor
- def __init__(self, Cursor, MetaFile, Temporary):
- MetaFileTable.__init__(self, Cursor, MetaFile, MODEL_FILE_INF, Temporary)
-
- ## Insert a record into table Inf
- #
- # @param Model: Model of a Inf item
- # @param Value1: Value1 of a Inf item
- # @param Value2: Value2 of a Inf item
- # @param Value3: Value3 of a Inf item
- # @param Scope1: Arch of a Inf item
- # @param Scope2 Platform os a Inf item
- # @param BelongsToItem: The item belongs to which another item
- # @param StartLine: StartLine of a Inf item
- # @param StartColumn: StartColumn of a Inf item
- # @param EndLine: EndLine of a Inf item
- # @param EndColumn: EndColumn of a Inf item
- # @param Enabled: If this item enabled
- #
- def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON',
- BelongsToItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):
- (Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
- return Table.Insert(
- self,
- Model,
- Value1,
- Value2,
- Value3,
- Scope1,
- Scope2,
- BelongsToItem,
- StartLine,
- StartColumn,
- EndLine,
- EndColumn,
- Enabled
- )
-
- ## Query table
- #
- # @param Model: The Model of Record
- # @param Arch: The Arch attribute of Record
- # @param Platform The Platform attribute of Record
- #
- # @retval: A recordSet of all found records
- #
- def Query(self, Model, Arch=None, Platform=None):
- ConditionString = "Model=%s AND Enabled>=0" % Model
- ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"
-
- if Arch != None and Arch != 'COMMON':
- ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch
- if Platform != None and Platform != 'COMMON':
- ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Platform
-
- SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)
- return self.Exec(SqlCommand)
-
-## Python class representation of table storing package data
-class PackageTable(MetaFileTable):
- _COLUMN_ = '''
- ID REAL PRIMARY KEY,
- Model INTEGER NOT NULL,
- Value1 TEXT NOT NULL,
- Value2 TEXT,
- Value3 TEXT,
- Scope1 TEXT,
- Scope2 TEXT,
- BelongsToItem REAL NOT NULL,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- Enabled INTEGER DEFAULT 0
- '''
- # used as table end flag, in case the changes to database is not committed to db file
- _DUMMY_ = "-1, -1, '====', '====', '====', '====', '====', -1, -1, -1, -1, -1, -1"
-
- ## Constructor
- def __init__(self, Cursor, MetaFile, Temporary):
- MetaFileTable.__init__(self, Cursor, MetaFile, MODEL_FILE_DEC, Temporary)
-
- ## Insert table
- #
- # Insert a record into table Dec
- #
- # @param Model: Model of a Dec item
- # @param Value1: Value1 of a Dec item
- # @param Value2: Value2 of a Dec item
- # @param Value3: Value3 of a Dec item
- # @param Scope1: Arch of a Dec item
- # @param Scope2: Module type of a Dec item
- # @param BelongsToItem: The item belongs to which another item
- # @param StartLine: StartLine of a Dec item
- # @param StartColumn: StartColumn of a Dec item
- # @param EndLine: EndLine of a Dec item
- # @param EndColumn: EndColumn of a Dec item
- # @param Enabled: If this item enabled
- #
- def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON',
- BelongsToItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=0):
- (Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
- return Table.Insert(
- self,
- Model,
- Value1,
- Value2,
- Value3,
- Scope1,
- Scope2,
- BelongsToItem,
- StartLine,
- StartColumn,
- EndLine,
- EndColumn,
- Enabled
- )
-
- ## Query table
- #
- # @param Model: The Model of Record
- # @param Arch: The Arch attribute of Record
- #
- # @retval: A recordSet of all found records
- #
- def Query(self, Model, Arch=None):
- ConditionString = "Model=%s AND Enabled>=0" % Model
- ValueString = "Value1,Value2,Value3,Scope1,ID,StartLine"
-
- if Arch != None and Arch != 'COMMON':
- ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Arch
-
- SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)
- return self.Exec(SqlCommand)
-
-## Python class representation of table storing platform data
-class PlatformTable(MetaFileTable):
- _COLUMN_ = '''
- ID REAL PRIMARY KEY,
- Model INTEGER NOT NULL,
- Value1 TEXT NOT NULL,
- Value2 TEXT,
- Value3 TEXT,
- Scope1 TEXT,
- Scope2 TEXT,
- BelongsToItem REAL NOT NULL,
- FromItem REAL NOT NULL,
- StartLine INTEGER NOT NULL,
- StartColumn INTEGER NOT NULL,
- EndLine INTEGER NOT NULL,
- EndColumn INTEGER NOT NULL,
- Enabled INTEGER DEFAULT 0
- '''
- # used as table end flag, in case the changes to database is not committed to db file
- _DUMMY_ = "-1, -1, '====', '====', '====', '====', '====', -1, -1, -1, -1, -1, -1, -1"
-
- ## Constructor
- def __init__(self, Cursor, MetaFile, Temporary):
- MetaFileTable.__init__(self, Cursor, MetaFile, MODEL_FILE_DSC, Temporary)
-
- ## Insert table
- #
- # Insert a record into table Dsc
- #
- # @param Model: Model of a Dsc item
- # @param Value1: Value1 of a Dsc item
- # @param Value2: Value2 of a Dsc item
- # @param Value3: Value3 of a Dsc item
- # @param Scope1: Arch of a Dsc item
- # @param Scope2: Module type of a Dsc item
- # @param BelongsToItem: The item belongs to which another item
- # @param FromItem: The item belongs to which dsc file
- # @param StartLine: StartLine of a Dsc item
- # @param StartColumn: StartColumn of a Dsc item
- # @param EndLine: EndLine of a Dsc item
- # @param EndColumn: EndColumn of a Dsc item
- # @param Enabled: If this item enabled
- #
- def Insert(self, Model, Value1, Value2, Value3, Scope1='COMMON', Scope2='COMMON', BelongsToItem=-1,
- FromItem=-1, StartLine=-1, StartColumn=-1, EndLine=-1, EndColumn=-1, Enabled=1):
- (Value1, Value2, Value3, Scope1, Scope2) = ConvertToSqlString((Value1, Value2, Value3, Scope1, Scope2))
- return Table.Insert(
- self,
- Model,
- Value1,
- Value2,
- Value3,
- Scope1,
- Scope2,
- BelongsToItem,
- FromItem,
- StartLine,
- StartColumn,
- EndLine,
- EndColumn,
- Enabled
- )
-
- ## Query table
- #
- # @param Model: The Model of Record
- # @param Scope1: Arch of a Dsc item
- # @param Scope2: Module type of a Dsc item
- # @param BelongsToItem: The item belongs to which another item
- # @param FromItem: The item belongs to which dsc file
- #
- # @retval: A recordSet of all found records
- #
- def Query(self, Model, Scope1=None, Scope2=None, BelongsToItem=None, FromItem=None):
- ConditionString = "Model=%s AND Enabled>0" % Model
- ValueString = "Value1,Value2,Value3,Scope1,Scope2,ID,StartLine"
-
- if Scope1 != None and Scope1 != 'COMMON':
- ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Scope1
- if Scope2 != None and Scope2 != 'COMMON':
- ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Scope2
-
- if BelongsToItem != None:
- ConditionString += " AND BelongsToItem=%s" % BelongsToItem
- else:
- ConditionString += " AND BelongsToItem<0"
-
- if FromItem != None:
- ConditionString += " AND FromItem=%s" % FromItem
-
- SqlCommand = "SELECT %s FROM %s WHERE %s" % (ValueString, self.Table, ConditionString)
- return self.Exec(SqlCommand)
-
-## Factory class to produce different storage for different type of meta-file
-class MetaFileStorage(object):
- _FILE_TABLE_ = {
- MODEL_FILE_INF : ModuleTable,
- MODEL_FILE_DEC : PackageTable,
- MODEL_FILE_DSC : PlatformTable,
- MODEL_FILE_OTHERS : MetaFileTable,
- }
-
- _FILE_TYPE_ = {
- ".inf" : MODEL_FILE_INF,
- ".dec" : MODEL_FILE_DEC,
- ".dsc" : MODEL_FILE_DSC,
- }
-
- ## Constructor
- def __new__(Class, Cursor, MetaFile, FileType=None, Temporary=False):
- # no type given, try to find one
- if not FileType:
- if MetaFile.Type in self._FILE_TYPE_:
- FileType = Class._FILE_TYPE_[MetaFile.Type]
- else:
- FileType = MODEL_FILE_OTHERS
-
- # don't pass the type around if it's well known
- if FileType == MODEL_FILE_OTHERS:
- Args = (Cursor, MetaFile, FileType, Temporary)
- else:
- Args = (Cursor, MetaFile, Temporary)
-
- # create the storage object and return it to caller
- return Class._FILE_TABLE_[FileType](*Args)
-
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
deleted file mode 100644
index 60acc914e9..0000000000
--- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
+++ /dev/null
@@ -1,237 +0,0 @@
-## @file
-# Common routines used by workspace
-#
-# Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-from Common.Misc import sdict
-from Common.DataType import SUP_MODULE_USER_DEFINED
-from BuildClassObject import LibraryClassObject
-
-## Get all packages from platform for specified arch, target and toolchain
-#
-# @param Platform: DscBuildData instance
-# @param BuildDatabase: The database saves all data for all metafiles
-# @param Arch: Current arch
-# @param Target: Current target
-# @param Toolchain: Current toolchain
-# @retval: List of packages which are DecBuildData instances
-#
-def GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain):
- PkgSet = set()
- for ModuleFile in Platform.Modules:
- Data = BuildDatabase[ModuleFile, Arch, Target, Toolchain]
- PkgSet.update(Data.Packages)
- for Lib in GetLiabraryInstances(Data, Platform, BuildDatabase, Arch, Target, Toolchain):
- PkgSet.update(Lib.Packages)
- return list(PkgSet)
-
-## Get all declared PCD from platform for specified arch, target and toolchain
-#
-# @param Platform: DscBuildData instance
-# @param BuildDatabase: The database saves all data for all metafiles
-# @param Arch: Current arch
-# @param Target: Current target
-# @param Toolchain: Current toolchain
-# @retval: A dictionary contains instances of PcdClassObject with key (PcdCName, TokenSpaceGuid)
-#
-def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain):
- PkgList = GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain)
- DecPcds = {}
- for Pkg in PkgList:
- for Pcd in Pkg.Pcds:
- DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd]
- return DecPcds
-
-## Get all dependent libraries for a module
-#
-# @param Module: InfBuildData instance
-# @param Platform: DscBuildData instance
-# @param BuildDatabase: The database saves all data for all metafiles
-# @param Arch: Current arch
-# @param Target: Current target
-# @param Toolchain: Current toolchain
-# @retval: List of dependent libraries which are InfBuildData instances
-#
-def GetLiabraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain):
- if Module.AutoGenVersion >= 0x00010005:
- return _GetModuleLibraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain)
- else:
- return _ResolveLibraryReference(Module, Platform)
-
-def _GetModuleLibraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain):
- ModuleType = Module.ModuleType
-
- # for overriding library instances with module specific setting
- PlatformModule = Platform.Modules[str(Module)]
-
- # add forced library instances (specified under LibraryClasses sections)
- #
- # If a module has a MODULE_TYPE of USER_DEFINED,
- # do not link in NULL library class instances from the global [LibraryClasses.*] sections.
- #
- if Module.ModuleType != SUP_MODULE_USER_DEFINED:
- for LibraryClass in Platform.LibraryClasses.GetKeys():
- if LibraryClass.startswith("NULL") and Platform.LibraryClasses[LibraryClass, Module.ModuleType]:
- Module.LibraryClasses[LibraryClass] = Platform.LibraryClasses[LibraryClass, Module.ModuleType]
-
- # add forced library instances (specified in module overrides)
- for LibraryClass in PlatformModule.LibraryClasses:
- if LibraryClass.startswith("NULL"):
- Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]
-
- # EdkII module
- LibraryConsumerList = [Module]
- Constructor = []
- ConsumedByList = sdict()
- LibraryInstance = sdict()
-
- while len(LibraryConsumerList) > 0:
- M = LibraryConsumerList.pop()
- for LibraryClassName in M.LibraryClasses:
- if LibraryClassName not in LibraryInstance:
- # override library instance for this module
- if LibraryClassName in PlatformModule.LibraryClasses:
- LibraryPath = PlatformModule.LibraryClasses[LibraryClassName]
- else:
- LibraryPath = Platform.LibraryClasses[LibraryClassName, ModuleType]
- if LibraryPath == None or LibraryPath == "":
- LibraryPath = M.LibraryClasses[LibraryClassName]
- if LibraryPath == None or LibraryPath == "":
- return []
-
- LibraryModule = BuildDatabase[LibraryPath, Arch, Target, Toolchain]
- # for those forced library instance (NULL library), add a fake library class
- if LibraryClassName.startswith("NULL"):
- LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, [ModuleType]))
- elif LibraryModule.LibraryClass == None \
- or len(LibraryModule.LibraryClass) == 0 \
- or (ModuleType != 'USER_DEFINED'
- and ModuleType not in LibraryModule.LibraryClass[0].SupModList):
- # only USER_DEFINED can link against any library instance despite of its SupModList
- return []
-
- LibraryInstance[LibraryClassName] = LibraryModule
- LibraryConsumerList.append(LibraryModule)
- else:
- LibraryModule = LibraryInstance[LibraryClassName]
-
- if LibraryModule == None:
- continue
-
- if LibraryModule.ConstructorList != [] and LibraryModule not in Constructor:
- Constructor.append(LibraryModule)
-
- if LibraryModule not in ConsumedByList:
- ConsumedByList[LibraryModule] = []
- # don't add current module itself to consumer list
- if M != Module:
- if M in ConsumedByList[LibraryModule]:
- continue
- ConsumedByList[LibraryModule].append(M)
- #
- # Initialize the sorted output list to the empty set
- #
- SortedLibraryList = []
- #
- # Q <- Set of all nodes with no incoming edges
- #
- LibraryList = [] #LibraryInstance.values()
- Q = []
- for LibraryClassName in LibraryInstance:
- M = LibraryInstance[LibraryClassName]
- LibraryList.append(M)
- if ConsumedByList[M] == []:
- Q.append(M)
-
- #
- # start the DAG algorithm
- #
- while True:
- EdgeRemoved = True
- while Q == [] and EdgeRemoved:
- EdgeRemoved = False
- # for each node Item with a Constructor
- for Item in LibraryList:
- if Item not in Constructor:
- continue
- # for each Node without a constructor with an edge e from Item to Node
- for Node in ConsumedByList[Item]:
- if Node in Constructor:
- continue
- # remove edge e from the graph if Node has no constructor
- ConsumedByList[Item].remove(Node)
- EdgeRemoved = True
- if ConsumedByList[Item] == []:
- # insert Item into Q
- Q.insert(0, Item)
- break
- if Q != []:
- break
- # DAG is done if there's no more incoming edge for all nodes
- if Q == []:
- break
-
- # remove node from Q
- Node = Q.pop()
- # output Node
- SortedLibraryList.append(Node)
-
- # for each node Item with an edge e from Node to Item do
- for Item in LibraryList:
- if Node not in ConsumedByList[Item]:
- continue
- # remove edge e from the graph
- ConsumedByList[Item].remove(Node)
-
- if ConsumedByList[Item] != []:
- continue
- # insert Item into Q, if Item has no other incoming edges
- Q.insert(0, Item)
-
- #
- # if any remaining node Item in the graph has a constructor and an incoming edge, then the graph has a cycle
- #
- for Item in LibraryList:
- if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:
- return []
- if Item not in SortedLibraryList:
- SortedLibraryList.append(Item)
-
- #
- # Build the list of constructor and destructir names
- # The DAG Topo sort produces the destructor order, so the list of constructors must generated in the reverse order
- #
- SortedLibraryList.reverse()
- return SortedLibraryList
-
-def _ResolveLibraryReference(Module, Platform):
- LibraryConsumerList = [Module]
-
- # "CompilerStub" is a must for Edk modules
- if Module.Libraries:
- Module.Libraries.append("CompilerStub")
- LibraryList = []
- while len(LibraryConsumerList) > 0:
- M = LibraryConsumerList.pop()
- for LibraryName in M.Libraries:
- Library = Platform.LibraryClasses[LibraryName, ':dummy:']
- if Library == None:
- for Key in Platform.LibraryClasses.data.keys():
- if LibraryName.upper() == Key.upper():
- Library = Platform.LibraryClasses[Key, ':dummy:']
- break
- if Library == None:
- continue
-
- if Library not in LibraryList:
- LibraryList.append(Library)
- LibraryConsumerList.append(Library)
- return LibraryList
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
deleted file mode 100644
index 19c00ca78d..0000000000
--- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
+++ /dev/null
@@ -1,2550 +0,0 @@
-## @file
-# This file is used to create a database used by build tool
-#
-# Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import sqlite3
-import os
-import os.path
-import pickle
-import uuid
-
-import Common.EdkLogger as EdkLogger
-import Common.GlobalData as GlobalData
-
-from Common.String import *
-from Common.DataType import *
-from Common.Misc import *
-from types import *
-
-from CommonDataClass.CommonClass import SkuInfoClass
-
-from MetaDataTable import *
-from MetaFileTable import *
-from MetaFileParser import *
-from BuildClassObject import *
-from WorkspaceCommon import GetDeclaredPcd
-from Common.Misc import AnalyzeDscPcd
-
-## Platform build information from DSC file
-#
-# This class is used to retrieve information stored in database and convert them
-# into PlatformBuildClassObject form for easier use for AutoGen.
-#
-class DscBuildData(PlatformBuildClassObject):
- # dict used to convert PCD type in database to string used by build tool
- _PCD_TYPE_STRING_ = {
- MODEL_PCD_FIXED_AT_BUILD : "FixedAtBuild",
- MODEL_PCD_PATCHABLE_IN_MODULE : "PatchableInModule",
- MODEL_PCD_FEATURE_FLAG : "FeatureFlag",
- MODEL_PCD_DYNAMIC : "Dynamic",
- MODEL_PCD_DYNAMIC_DEFAULT : "Dynamic",
- MODEL_PCD_DYNAMIC_HII : "DynamicHii",
- MODEL_PCD_DYNAMIC_VPD : "DynamicVpd",
- MODEL_PCD_DYNAMIC_EX : "DynamicEx",
- MODEL_PCD_DYNAMIC_EX_DEFAULT : "DynamicEx",
- MODEL_PCD_DYNAMIC_EX_HII : "DynamicExHii",
- MODEL_PCD_DYNAMIC_EX_VPD : "DynamicExVpd",
- }
-
- # dict used to convert part of [Defines] to members of DscBuildData directly
- _PROPERTY_ = {
- #
- # Required Fields
- #
- TAB_DSC_DEFINES_PLATFORM_NAME : "_PlatformName",
- TAB_DSC_DEFINES_PLATFORM_GUID : "_Guid",
- TAB_DSC_DEFINES_PLATFORM_VERSION : "_Version",
- TAB_DSC_DEFINES_DSC_SPECIFICATION : "_DscSpecification",
- #TAB_DSC_DEFINES_OUTPUT_DIRECTORY : "_OutputDirectory",
- #TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES : "_SupArchList",
- #TAB_DSC_DEFINES_BUILD_TARGETS : "_BuildTargets",
- #TAB_DSC_DEFINES_SKUID_IDENTIFIER : "_SkuName",
- #TAB_DSC_DEFINES_FLASH_DEFINITION : "_FlashDefinition",
- TAB_DSC_DEFINES_BUILD_NUMBER : "_BuildNumber",
- TAB_DSC_DEFINES_MAKEFILE_NAME : "_MakefileName",
- TAB_DSC_DEFINES_BS_BASE_ADDRESS : "_BsBaseAddress",
- TAB_DSC_DEFINES_RT_BASE_ADDRESS : "_RtBaseAddress",
- #TAB_DSC_DEFINES_RFC_LANGUAGES : "_RFCLanguages",
- #TAB_DSC_DEFINES_ISO_LANGUAGES : "_ISOLanguages",
- }
-
- # used to compose dummy library class name for those forced library instances
- _NullLibraryNumber = 0
-
- ## Constructor of DscBuildData
- #
- # Initialize object of DscBuildData
- #
- # @param FilePath The path of platform description file
- # @param RawData The raw data of DSC file
- # @param BuildDataBase Database used to retrieve module/package information
- # @param Arch The target architecture
- # @param Platform (not used for DscBuildData)
- # @param Macros Macros used for replacement in DSC file
- #
- def __init__(self, FilePath, RawData, BuildDataBase, Arch='COMMON', Target=None, Toolchain=None):
- self.MetaFile = FilePath
- self._RawData = RawData
- self._Bdb = BuildDataBase
- self._Arch = Arch
- self._Target = Target
- self._Toolchain = Toolchain
- self._Clear()
-
- ## XXX[key] = value
- def __setitem__(self, key, value):
- self.__dict__[self._PROPERTY_[key]] = value
-
- ## value = XXX[key]
- def __getitem__(self, key):
- return self.__dict__[self._PROPERTY_[key]]
-
- ## "in" test support
- def __contains__(self, key):
- return key in self._PROPERTY_
-
- ## Set all internal used members of DscBuildData to None
- def _Clear(self):
- self._Header = None
- self._PlatformName = None
- self._Guid = None
- self._Version = None
- self._DscSpecification = None
- self._OutputDirectory = None
- self._SupArchList = None
- self._BuildTargets = None
- self._SkuName = None
- self._FlashDefinition = None
- self._BuildNumber = None
- self._MakefileName = None
- self._BsBaseAddress = None
- self._RtBaseAddress = None
- self._SkuIds = None
- self._Modules = None
- self._LibraryInstances = None
- self._LibraryClasses = None
- self._Pcds = None
- self._DecPcds = None
- self._BuildOptions = None
- self._LoadFixAddress = None
- self._RFCLanguages = None
- self._ISOLanguages = None
- self._VpdToolGuid = None
- self.__Macros = None
-
- ## Get current effective macros
- def _GetMacros(self):
- if self.__Macros == None:
- self.__Macros = {}
- self.__Macros.update(GlobalData.gPlatformDefines)
- self.__Macros.update(GlobalData.gGlobalDefines)
- self.__Macros.update(GlobalData.gCommandLineDefines)
- return self.__Macros
-
- ## Get architecture
- def _GetArch(self):
- return self._Arch
-
- ## Set architecture
- #
- # Changing the default ARCH to another may affect all other information
- # because all information in a platform may be ARCH-related. That's
- # why we need to clear all internal used members, in order to cause all
- # information to be re-retrieved.
- #
- # @param Value The value of ARCH
- #
- def _SetArch(self, Value):
- if self._Arch == Value:
- return
- self._Arch = Value
- self._Clear()
-
- ## Retrieve all information in [Defines] section
- #
- # (Retriving all [Defines] information in one-shot is just to save time.)
- #
- def _GetHeaderInfo(self):
- RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch]
- for Record in RecordList:
- Name = Record[1]
- # items defined _PROPERTY_ don't need additional processing
- if Name in self:
- self[Name] = Record[2]
- # some special items in [Defines] section need special treatment
- elif Name == TAB_DSC_DEFINES_OUTPUT_DIRECTORY:
- self._OutputDirectory = NormPath(Record[2], self._Macros)
- if ' ' in self._OutputDirectory:
- EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in OUTPUT_DIRECTORY",
- File=self.MetaFile, Line=Record[-1],
- ExtraData=self._OutputDirectory)
- elif Name == TAB_DSC_DEFINES_FLASH_DEFINITION:
- self._FlashDefinition = PathClass(NormPath(Record[2], self._Macros), GlobalData.gWorkspace)
- ErrorCode, ErrorInfo = self._FlashDefinition.Validate('.fdf')
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=Record[-1],
- ExtraData=ErrorInfo)
- elif Name == TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES:
- self._SupArchList = GetSplitValueList(Record[2], TAB_VALUE_SPLIT)
- elif Name == TAB_DSC_DEFINES_BUILD_TARGETS:
- self._BuildTargets = GetSplitValueList(Record[2])
- elif Name == TAB_DSC_DEFINES_SKUID_IDENTIFIER:
- if self._SkuName == None:
- self._SkuName = Record[2]
- elif Name == TAB_FIX_LOAD_TOP_MEMORY_ADDRESS:
- try:
- self._LoadFixAddress = int (Record[2], 0)
- except:
- EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS %s is not valid dec or hex string" % (Record[2]))
- elif Name == TAB_DSC_DEFINES_RFC_LANGUAGES:
- if not Record[2] or Record[2][0] != '"' or Record[2][-1] != '"' or len(Record[2]) == 1:
- EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'language code for RFC_LANGUAGES must have double quotes around it, for example: RFC_LANGUAGES = "en-us;zh-hans"',
- File=self.MetaFile, Line=Record[-1])
- LanguageCodes = Record[2][1:-1]
- if not LanguageCodes:
- EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'one or more RFC4646 format language code must be provided for RFC_LANGUAGES statement',
- File=self.MetaFile, Line=Record[-1])
- LanguageList = GetSplitValueList(LanguageCodes, TAB_SEMI_COLON_SPLIT)
- # check whether there is empty entries in the list
- if None in LanguageList:
- EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'one or more empty language code is in RFC_LANGUAGES statement',
- File=self.MetaFile, Line=Record[-1])
- self._RFCLanguages = LanguageList
- elif Name == TAB_DSC_DEFINES_ISO_LANGUAGES:
- if not Record[2] or Record[2][0] != '"' or Record[2][-1] != '"' or len(Record[2]) == 1:
- EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'language code for ISO_LANGUAGES must have double quotes around it, for example: ISO_LANGUAGES = "engchn"',
- File=self.MetaFile, Line=Record[-1])
- LanguageCodes = Record[2][1:-1]
- if not LanguageCodes:
- EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'one or more ISO639-2 format language code must be provided for ISO_LANGUAGES statement',
- File=self.MetaFile, Line=Record[-1])
- if len(LanguageCodes)%3:
- EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'bad ISO639-2 format for ISO_LANGUAGES',
- File=self.MetaFile, Line=Record[-1])
- LanguageList = []
- for i in range(0, len(LanguageCodes), 3):
- LanguageList.append(LanguageCodes[i:i+3])
- self._ISOLanguages = LanguageList
- elif Name == TAB_DSC_DEFINES_VPD_TOOL_GUID:
- #
- # try to convert GUID to a real UUID value to see whether the GUID is format
- # for VPD_TOOL_GUID is correct.
- #
- try:
- uuid.UUID(Record[2])
- except:
- EdkLogger.error("build", FORMAT_INVALID, "Invalid GUID format for VPD_TOOL_GUID", File=self.MetaFile)
- self._VpdToolGuid = Record[2]
- # set _Header to non-None in order to avoid database re-querying
- self._Header = 'DUMMY'
-
- ## Retrieve platform name
- def _GetPlatformName(self):
- if self._PlatformName == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._PlatformName == None:
- EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No PLATFORM_NAME", File=self.MetaFile)
- return self._PlatformName
-
- ## Retrieve file guid
- def _GetFileGuid(self):
- if self._Guid == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._Guid == None:
- EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No PLATFORM_GUID", File=self.MetaFile)
- return self._Guid
-
- ## Retrieve platform version
- def _GetVersion(self):
- if self._Version == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._Version == None:
- EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No PLATFORM_VERSION", File=self.MetaFile)
- return self._Version
-
- ## Retrieve platform description file version
- def _GetDscSpec(self):
- if self._DscSpecification == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._DscSpecification == None:
- EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No DSC_SPECIFICATION", File=self.MetaFile)
- return self._DscSpecification
-
- ## Retrieve OUTPUT_DIRECTORY
- def _GetOutpuDir(self):
- if self._OutputDirectory == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._OutputDirectory == None:
- self._OutputDirectory = os.path.join("Build", self._PlatformName)
- return self._OutputDirectory
-
- ## Retrieve SUPPORTED_ARCHITECTURES
- def _GetSupArch(self):
- if self._SupArchList == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._SupArchList == None:
- EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No SUPPORTED_ARCHITECTURES", File=self.MetaFile)
- return self._SupArchList
-
- ## Retrieve BUILD_TARGETS
- def _GetBuildTarget(self):
- if self._BuildTargets == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._BuildTargets == None:
- EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No BUILD_TARGETS", File=self.MetaFile)
- return self._BuildTargets
-
- ## Retrieve SKUID_IDENTIFIER
- def _GetSkuName(self):
- if self._SkuName == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._SkuName == None or self._SkuName not in self.SkuIds:
- self._SkuName = 'DEFAULT'
- return self._SkuName
-
- ## Override SKUID_IDENTIFIER
- def _SetSkuName(self, Value):
- if Value in self.SkuIds:
- self._SkuName = Value
- # Needs to re-retrieve the PCD information
- self._Pcds = None
-
- def _GetFdfFile(self):
- if self._FlashDefinition == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._FlashDefinition == None:
- self._FlashDefinition = ''
- return self._FlashDefinition
-
- ## Retrieve FLASH_DEFINITION
- def _GetBuildNumber(self):
- if self._BuildNumber == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._BuildNumber == None:
- self._BuildNumber = ''
- return self._BuildNumber
-
- ## Retrieve MAKEFILE_NAME
- def _GetMakefileName(self):
- if self._MakefileName == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._MakefileName == None:
- self._MakefileName = ''
- return self._MakefileName
-
- ## Retrieve BsBaseAddress
- def _GetBsBaseAddress(self):
- if self._BsBaseAddress == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._BsBaseAddress == None:
- self._BsBaseAddress = ''
- return self._BsBaseAddress
-
- ## Retrieve RtBaseAddress
- def _GetRtBaseAddress(self):
- if self._RtBaseAddress == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._RtBaseAddress == None:
- self._RtBaseAddress = ''
- return self._RtBaseAddress
-
- ## Retrieve the top address for the load fix address
- def _GetLoadFixAddress(self):
- if self._LoadFixAddress == None:
- if self._Header == None:
- self._GetHeaderInfo()
-
- if self._LoadFixAddress == None:
- self._LoadFixAddress = self._Macros.get(TAB_FIX_LOAD_TOP_MEMORY_ADDRESS, '0')
-
- try:
- self._LoadFixAddress = int (self._LoadFixAddress, 0)
- except:
- EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS %s is not valid dec or hex string" % (self._LoadFixAddress))
-
- #
- # If command line defined, should override the value in DSC file.
- #
- if 'FIX_LOAD_TOP_MEMORY_ADDRESS' in GlobalData.gCommandLineDefines.keys():
- try:
- self._LoadFixAddress = int(GlobalData.gCommandLineDefines['FIX_LOAD_TOP_MEMORY_ADDRESS'], 0)
- except:
- EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS %s is not valid dec or hex string" % (GlobalData.gCommandLineDefines['FIX_LOAD_TOP_MEMORY_ADDRESS']))
-
- if self._LoadFixAddress < 0:
- EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS is set to the invalid negative value 0x%x" % (self._LoadFixAddress))
- if self._LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self._LoadFixAddress % 0x1000 != 0:
- EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS is set to the invalid unaligned 4K value 0x%x" % (self._LoadFixAddress))
-
- return self._LoadFixAddress
-
- ## Retrieve RFCLanguage filter
- def _GetRFCLanguages(self):
- if self._RFCLanguages == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._RFCLanguages == None:
- self._RFCLanguages = []
- return self._RFCLanguages
-
- ## Retrieve ISOLanguage filter
- def _GetISOLanguages(self):
- if self._ISOLanguages == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._ISOLanguages == None:
- self._ISOLanguages = []
- return self._ISOLanguages
- ## Retrieve the GUID string for VPD tool
- def _GetVpdToolGuid(self):
- if self._VpdToolGuid == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._VpdToolGuid == None:
- self._VpdToolGuid = ''
- return self._VpdToolGuid
-
- ## Retrieve [SkuIds] section information
- def _GetSkuIds(self):
- if self._SkuIds == None:
- self._SkuIds = sdict()
- RecordList = self._RawData[MODEL_EFI_SKU_ID, self._Arch]
- for Record in RecordList:
- if Record[0] in [None, '']:
- EdkLogger.error('build', FORMAT_INVALID, 'No Sku ID number',
- File=self.MetaFile, Line=Record[-1])
- if Record[1] in [None, '']:
- EdkLogger.error('build', FORMAT_INVALID, 'No Sku ID name',
- File=self.MetaFile, Line=Record[-1])
- self._SkuIds[Record[1]] = Record[0]
- if 'DEFAULT' not in self._SkuIds:
- self._SkuIds['DEFAULT'] = '0'
- return self._SkuIds
-
- ## Retrieve [Components] section information
- def _GetModules(self):
- if self._Modules != None:
- return self._Modules
-
- self._Modules = sdict()
- RecordList = self._RawData[MODEL_META_DATA_COMPONENT, self._Arch]
- Macros = self._Macros
- Macros["EDK_SOURCE"] = GlobalData.gEcpSource
- for Record in RecordList:
- ModuleFile = PathClass(NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch=self._Arch)
- ModuleId = Record[5]
- LineNo = Record[6]
-
- # check the file validation
- ErrorCode, ErrorInfo = ModuleFile.Validate('.inf')
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
- ExtraData=ErrorInfo)
- # Check duplication
- # If arch is COMMON, no duplicate module is checked since all modules in all component sections are selected
- if self._Arch != 'COMMON' and ModuleFile in self._Modules:
- EdkLogger.error('build', FILE_DUPLICATED, File=self.MetaFile, ExtraData=str(ModuleFile), Line=LineNo)
-
- Module = ModuleBuildClassObject()
- Module.MetaFile = ModuleFile
-
- # get module override path
- RecordList = self._RawData[MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH, self._Arch, None, ModuleId]
- if RecordList != []:
- Module.SourceOverridePath = os.path.join(GlobalData.gWorkspace, NormPath(RecordList[0][0], Macros))
-
- # Check if the source override path exists
- if not os.path.isdir(Module.SourceOverridePath):
- EdkLogger.error('build', FILE_NOT_FOUND, Message = 'Source override path does not exist:', File=self.MetaFile, ExtraData=Module.SourceOverridePath, Line=LineNo)
-
- #Add to GlobalData Variables
- GlobalData.gOverrideDir[ModuleFile.Key] = Module.SourceOverridePath
-
- # get module private library instance
- RecordList = self._RawData[MODEL_EFI_LIBRARY_CLASS, self._Arch, None, ModuleId]
- for Record in RecordList:
- LibraryClass = Record[0]
- LibraryPath = PathClass(NormPath(Record[1], Macros), GlobalData.gWorkspace, Arch=self._Arch)
- LineNo = Record[-1]
-
- # check the file validation
- ErrorCode, ErrorInfo = LibraryPath.Validate('.inf')
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
- ExtraData=ErrorInfo)
-
- if LibraryClass == '' or LibraryClass == 'NULL':
- self._NullLibraryNumber += 1
- LibraryClass = 'NULL%d' % self._NullLibraryNumber
- EdkLogger.verbose("Found forced library for %s\n\t%s [%s]" % (ModuleFile, LibraryPath, LibraryClass))
- Module.LibraryClasses[LibraryClass] = LibraryPath
- if LibraryPath not in self.LibraryInstances:
- self.LibraryInstances.append(LibraryPath)
-
- # get module private PCD setting
- for Type in [MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE, \
- MODEL_PCD_FEATURE_FLAG, MODEL_PCD_DYNAMIC, MODEL_PCD_DYNAMIC_EX]:
- RecordList = self._RawData[Type, self._Arch, None, ModuleId]
- for TokenSpaceGuid, PcdCName, Setting, Dummy1, Dummy2, Dummy3, Dummy4 in RecordList:
- TokenList = GetSplitValueList(Setting)
- DefaultValue = TokenList[0]
- if len(TokenList) > 1:
- MaxDatumSize = TokenList[1]
- else:
- MaxDatumSize = ''
- TypeString = self._PCD_TYPE_STRING_[Type]
- Pcd = PcdClassObject(
- PcdCName,
- TokenSpaceGuid,
- TypeString,
- '',
- DefaultValue,
- '',
- MaxDatumSize,
- {},
- False,
- None
- )
- Module.Pcds[PcdCName, TokenSpaceGuid] = Pcd
-
- # get module private build options
- RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, None, ModuleId]
- for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3, Dummy4 in RecordList:
- if (ToolChainFamily, ToolChain) not in Module.BuildOptions:
- Module.BuildOptions[ToolChainFamily, ToolChain] = Option
- else:
- OptionString = Module.BuildOptions[ToolChainFamily, ToolChain]
- Module.BuildOptions[ToolChainFamily, ToolChain] = OptionString + " " + Option
-
- self._Modules[ModuleFile] = Module
- return self._Modules
-
- ## Retrieve all possible library instances used in this platform
- def _GetLibraryInstances(self):
- if self._LibraryInstances == None:
- self._GetLibraryClasses()
- return self._LibraryInstances
-
- ## Retrieve [LibraryClasses] information
- def _GetLibraryClasses(self):
- if self._LibraryClasses == None:
- self._LibraryInstances = []
- #
- # tdict is a special dict kind of type, used for selecting correct
- # library instance for given library class and module type
- #
- LibraryClassDict = tdict(True, 3)
- # track all library class names
- LibraryClassSet = set()
- RecordList = self._RawData[MODEL_EFI_LIBRARY_CLASS, self._Arch, None, -1]
- Macros = self._Macros
- for Record in RecordList:
- LibraryClass, LibraryInstance, Dummy, Arch, ModuleType, Dummy, LineNo = Record
- if LibraryClass == '' or LibraryClass == 'NULL':
- self._NullLibraryNumber += 1
- LibraryClass = 'NULL%d' % self._NullLibraryNumber
- EdkLogger.verbose("Found forced library for arch=%s\n\t%s [%s]" % (Arch, LibraryInstance, LibraryClass))
- LibraryClassSet.add(LibraryClass)
- LibraryInstance = PathClass(NormPath(LibraryInstance, Macros), GlobalData.gWorkspace, Arch=self._Arch)
- # check the file validation
- ErrorCode, ErrorInfo = LibraryInstance.Validate('.inf')
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
- ExtraData=ErrorInfo)
-
- if ModuleType != 'COMMON' and ModuleType not in SUP_MODULE_LIST:
- EdkLogger.error('build', OPTION_UNKNOWN, "Unknown module type [%s]" % ModuleType,
- File=self.MetaFile, ExtraData=LibraryInstance, Line=LineNo)
- LibraryClassDict[Arch, ModuleType, LibraryClass] = LibraryInstance
- if LibraryInstance not in self._LibraryInstances:
- self._LibraryInstances.append(LibraryInstance)
-
- # resolve the specific library instance for each class and each module type
- self._LibraryClasses = tdict(True)
- for LibraryClass in LibraryClassSet:
- # try all possible module types
- for ModuleType in SUP_MODULE_LIST:
- LibraryInstance = LibraryClassDict[self._Arch, ModuleType, LibraryClass]
- if LibraryInstance == None:
- continue
- self._LibraryClasses[LibraryClass, ModuleType] = LibraryInstance
-
- # for Edk style library instances, which are listed in different section
- Macros["EDK_SOURCE"] = GlobalData.gEcpSource
- RecordList = self._RawData[MODEL_EFI_LIBRARY_INSTANCE, self._Arch]
- for Record in RecordList:
- File = PathClass(NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch=self._Arch)
- LineNo = Record[-1]
- # check the file validation
- ErrorCode, ErrorInfo = File.Validate('.inf')
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
- ExtraData=ErrorInfo)
- if File not in self._LibraryInstances:
- self._LibraryInstances.append(File)
- #
- # we need the module name as the library class name, so we have
- # to parse it here. (self._Bdb[] will trigger a file parse if it
- # hasn't been parsed)
- #
- Library = self._Bdb[File, self._Arch, self._Target, self._Toolchain]
- self._LibraryClasses[Library.BaseName, ':dummy:'] = Library
- return self._LibraryClasses
-
- def _ValidatePcd(self, PcdCName, TokenSpaceGuid, Setting, PcdType, LineNo):
- if self._DecPcds == None:
- self._DecPcds = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain)
- if (PcdCName, TokenSpaceGuid) not in self._DecPcds:
- EdkLogger.error('build', PARSER_ERROR,
- "Pcd (%s.%s) defined in DSC is not declared in DEC files." % (TokenSpaceGuid, PcdCName),
- File=self.MetaFile, Line=LineNo)
- ValueList, IsValid, Index = AnalyzeDscPcd(Setting, PcdType, self._DecPcds[PcdCName, TokenSpaceGuid].DatumType)
- if not IsValid and PcdType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
- EdkLogger.error('build', FORMAT_INVALID, "Pcd format incorrect.", File=self.MetaFile, Line=LineNo,
- ExtraData="%s.%s|%s" % (TokenSpaceGuid, PcdCName, Setting))
- if ValueList[Index] and PcdType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_BUILD]:
- try:
- ValueList[Index] = ValueExpression(ValueList[Index], GlobalData.gPlatformPcds)(True)
- except WrnExpression, Value:
- ValueList[Index] = Value.result
- except EvaluationException, Excpt:
- if hasattr(Excpt, 'Pcd'):
- if Excpt.Pcd in GlobalData.gPlatformOtherPcds:
- EdkLogger.error('Parser', FORMAT_INVALID, "Cannot use this PCD (%s) in an expression as"
- " it must be defined in a [PcdsFixedAtBuild] or [PcdsFeatureFlag] section"
- " of the DSC file" % Excpt.Pcd,
- File=self.MetaFile, Line=LineNo)
- else:
- EdkLogger.error('Parser', FORMAT_INVALID, "PCD (%s) is not defined in DSC file" % Excpt.Pcd,
- File=self.MetaFile, Line=LineNo)
- else:
- EdkLogger.error('Parser', FORMAT_INVALID, "Invalid expression: %s" % str(Excpt),
- File=self.MetaFile, Line=LineNo)
- if ValueList[Index] == 'True':
- ValueList[Index] = '1'
- elif ValueList[Index] == 'False':
- ValueList[Index] = '0'
- if ValueList[Index]:
- Valid, ErrStr = CheckPcdDatum(self._DecPcds[PcdCName, TokenSpaceGuid].DatumType, ValueList[Index])
- if not Valid:
- EdkLogger.error('build', FORMAT_INVALID, ErrStr, File=self.MetaFile, Line=LineNo,
- ExtraData="%s.%s" % (TokenSpaceGuid, PcdCName))
- return ValueList
-
- ## Retrieve all PCD settings in platform
- def _GetPcds(self):
- if self._Pcds == None:
- self._Pcds = sdict()
- self._Pcds.update(self._GetPcd(MODEL_PCD_FIXED_AT_BUILD))
- self._Pcds.update(self._GetPcd(MODEL_PCD_PATCHABLE_IN_MODULE))
- self._Pcds.update(self._GetPcd(MODEL_PCD_FEATURE_FLAG))
- self._Pcds.update(self._GetDynamicPcd(MODEL_PCD_DYNAMIC_DEFAULT))
- self._Pcds.update(self._GetDynamicHiiPcd(MODEL_PCD_DYNAMIC_HII))
- self._Pcds.update(self._GetDynamicVpdPcd(MODEL_PCD_DYNAMIC_VPD))
- self._Pcds.update(self._GetDynamicPcd(MODEL_PCD_DYNAMIC_EX_DEFAULT))
- self._Pcds.update(self._GetDynamicHiiPcd(MODEL_PCD_DYNAMIC_EX_HII))
- self._Pcds.update(self._GetDynamicVpdPcd(MODEL_PCD_DYNAMIC_EX_VPD))
- return self._Pcds
-
- ## Retrieve [BuildOptions]
- def _GetBuildOptions(self):
- if self._BuildOptions == None:
- self._BuildOptions = sdict()
- #
- # Retrieve build option for EDKII style module
- #
- RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, EDKII_NAME]
- for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3, Dummy4 in RecordList:
- self._BuildOptions[ToolChainFamily, ToolChain, EDKII_NAME] = Option
- #
- # Retrieve build option for EDK style module
- #
- RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, EDK_NAME]
- for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3, Dummy4 in RecordList:
- self._BuildOptions[ToolChainFamily, ToolChain, EDK_NAME] = Option
- return self._BuildOptions
-
- ## Retrieve non-dynamic PCD settings
- #
- # @param Type PCD type
- #
- # @retval a dict object contains settings of given PCD type
- #
- def _GetPcd(self, Type):
- Pcds = sdict()
- #
- # tdict is a special dict kind of type, used for selecting correct
- # PCD settings for certain ARCH
- #
- PcdDict = tdict(True, 3)
- PcdSet = set()
- # Find out all possible PCD candidates for self._Arch
- RecordList = self._RawData[Type, self._Arch]
- for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- PcdSet.add((PcdCName, TokenSpaceGuid, Dummy4))
- PcdDict[Arch, PcdCName, TokenSpaceGuid] = Setting
- # Remove redundant PCD candidates
- for PcdCName, TokenSpaceGuid, Dummy4 in PcdSet:
- Setting = PcdDict[self._Arch, PcdCName, TokenSpaceGuid]
- if Setting == None:
- continue
- PcdValue, DatumType, MaxDatumSize = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
- Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
- PcdCName,
- TokenSpaceGuid,
- self._PCD_TYPE_STRING_[Type],
- DatumType,
- PcdValue,
- '',
- MaxDatumSize,
- {},
- False,
- None
- )
- return Pcds
-
- ## Retrieve dynamic PCD settings
- #
- # @param Type PCD type
- #
- # @retval a dict object contains settings of given PCD type
- #
- def _GetDynamicPcd(self, Type):
- Pcds = sdict()
- #
- # tdict is a special dict kind of type, used for selecting correct
- # PCD settings for certain ARCH and SKU
- #
- PcdDict = tdict(True, 4)
- PcdList = []
- # Find out all possible PCD candidates for self._Arch
- RecordList = self._RawData[Type, self._Arch]
- for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- PcdList.append((PcdCName, TokenSpaceGuid, Dummy4))
- PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] = Setting
- # Remove redundant PCD candidates, per the ARCH and SKU
- for PcdCName, TokenSpaceGuid, Dummy4 in PcdList:
- Setting = PcdDict[self._Arch, self.SkuName, PcdCName, TokenSpaceGuid]
- if Setting == None:
- continue
-
- PcdValue, DatumType, MaxDatumSize = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
-
- SkuInfo = SkuInfoClass(self.SkuName, self.SkuIds[self.SkuName], '', '', '', '', '', PcdValue)
- Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
- PcdCName,
- TokenSpaceGuid,
- self._PCD_TYPE_STRING_[Type],
- DatumType,
- PcdValue,
- '',
- MaxDatumSize,
- {self.SkuName : SkuInfo},
- False,
- None
- )
- return Pcds
-
- ## Retrieve dynamic HII PCD settings
- #
- # @param Type PCD type
- #
- # @retval a dict object contains settings of given PCD type
- #
- def _GetDynamicHiiPcd(self, Type):
- Pcds = sdict()
- #
- # tdict is a special dict kind of type, used for selecting correct
- # PCD settings for certain ARCH and SKU
- #
- PcdDict = tdict(True, 4)
- PcdSet = set()
- RecordList = self._RawData[Type, self._Arch]
- # Find out all possible PCD candidates for self._Arch
- for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- PcdSet.add((PcdCName, TokenSpaceGuid, Dummy4))
- PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] = Setting
- # Remove redundant PCD candidates, per the ARCH and SKU
- for PcdCName, TokenSpaceGuid, Dummy4 in PcdSet:
- Setting = PcdDict[self._Arch, self.SkuName, PcdCName, TokenSpaceGuid]
- if Setting == None:
- continue
- VariableName, VariableGuid, VariableOffset, DefaultValue = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
- SkuInfo = SkuInfoClass(self.SkuName, self.SkuIds[self.SkuName], VariableName, VariableGuid, VariableOffset, DefaultValue)
- Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
- PcdCName,
- TokenSpaceGuid,
- self._PCD_TYPE_STRING_[Type],
- '',
- DefaultValue,
- '',
- '',
- {self.SkuName : SkuInfo},
- False,
- None
- )
- return Pcds
-
- ## Retrieve dynamic VPD PCD settings
- #
- # @param Type PCD type
- #
- # @retval a dict object contains settings of given PCD type
- #
- def _GetDynamicVpdPcd(self, Type):
- Pcds = sdict()
- #
- # tdict is a special dict kind of type, used for selecting correct
- # PCD settings for certain ARCH and SKU
- #
- PcdDict = tdict(True, 4)
- PcdList = []
- # Find out all possible PCD candidates for self._Arch
- RecordList = self._RawData[Type, self._Arch]
- for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- PcdList.append((PcdCName, TokenSpaceGuid, Dummy4))
- PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] = Setting
- # Remove redundant PCD candidates, per the ARCH and SKU
- for PcdCName, TokenSpaceGuid, Dummy4 in PcdList:
- Setting = PcdDict[self._Arch, self.SkuName, PcdCName, TokenSpaceGuid]
- if Setting == None:
- continue
- #
- # For the VOID* type, it can have optional data of MaxDatumSize and InitialValue
- # For the Integer & Boolean type, the optional data can only be InitialValue.
- # At this point, we put all the data into the PcdClssObject for we don't know the PCD's datumtype
- # until the DEC parser has been called.
- #
- VpdOffset, MaxDatumSize, InitialValue = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
-
- SkuInfo = SkuInfoClass(self.SkuName, self.SkuIds[self.SkuName], '', '', '', '', VpdOffset, InitialValue)
- Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
- PcdCName,
- TokenSpaceGuid,
- self._PCD_TYPE_STRING_[Type],
- '',
- '',
- '',
- MaxDatumSize,
- {self.SkuName : SkuInfo},
- False,
- None
- )
- return Pcds
-
- ## Add external modules
- #
- # The external modules are mostly those listed in FDF file, which don't
- # need "build".
- #
- # @param FilePath The path of module description file
- #
- def AddModule(self, FilePath):
- FilePath = NormPath(FilePath)
- if FilePath not in self.Modules:
- Module = ModuleBuildClassObject()
- Module.MetaFile = FilePath
- self.Modules.append(Module)
-
- ## Add external PCDs
- #
- # The external PCDs are mostly those listed in FDF file to specify address
- # or offset information.
- #
- # @param Name Name of the PCD
- # @param Guid Token space guid of the PCD
- # @param Value Value of the PCD
- #
- def AddPcd(self, Name, Guid, Value):
- if (Name, Guid) not in self.Pcds:
- self.Pcds[Name, Guid] = PcdClassObject(Name, Guid, '', '', '', '', '', {}, False, None)
- self.Pcds[Name, Guid].DefaultValue = Value
-
- _Macros = property(_GetMacros)
- Arch = property(_GetArch, _SetArch)
- Platform = property(_GetPlatformName)
- PlatformName = property(_GetPlatformName)
- Guid = property(_GetFileGuid)
- Version = property(_GetVersion)
- DscSpecification = property(_GetDscSpec)
- OutputDirectory = property(_GetOutpuDir)
- SupArchList = property(_GetSupArch)
- BuildTargets = property(_GetBuildTarget)
- SkuName = property(_GetSkuName, _SetSkuName)
- FlashDefinition = property(_GetFdfFile)
- BuildNumber = property(_GetBuildNumber)
- MakefileName = property(_GetMakefileName)
- BsBaseAddress = property(_GetBsBaseAddress)
- RtBaseAddress = property(_GetRtBaseAddress)
- LoadFixAddress = property(_GetLoadFixAddress)
- RFCLanguages = property(_GetRFCLanguages)
- ISOLanguages = property(_GetISOLanguages)
- VpdToolGuid = property(_GetVpdToolGuid)
- SkuIds = property(_GetSkuIds)
- Modules = property(_GetModules)
- LibraryInstances = property(_GetLibraryInstances)
- LibraryClasses = property(_GetLibraryClasses)
- Pcds = property(_GetPcds)
- BuildOptions = property(_GetBuildOptions)
-
-## Platform build information from DEC file
-#
-# This class is used to retrieve information stored in database and convert them
-# into PackageBuildClassObject form for easier use for AutoGen.
-#
-class DecBuildData(PackageBuildClassObject):
- # dict used to convert PCD type in database to string used by build tool
- _PCD_TYPE_STRING_ = {
- MODEL_PCD_FIXED_AT_BUILD : "FixedAtBuild",
- MODEL_PCD_PATCHABLE_IN_MODULE : "PatchableInModule",
- MODEL_PCD_FEATURE_FLAG : "FeatureFlag",
- MODEL_PCD_DYNAMIC : "Dynamic",
- MODEL_PCD_DYNAMIC_DEFAULT : "Dynamic",
- MODEL_PCD_DYNAMIC_HII : "DynamicHii",
- MODEL_PCD_DYNAMIC_VPD : "DynamicVpd",
- MODEL_PCD_DYNAMIC_EX : "DynamicEx",
- MODEL_PCD_DYNAMIC_EX_DEFAULT : "DynamicEx",
- MODEL_PCD_DYNAMIC_EX_HII : "DynamicExHii",
- MODEL_PCD_DYNAMIC_EX_VPD : "DynamicExVpd",
- }
-
- # dict used to convert part of [Defines] to members of DecBuildData directly
- _PROPERTY_ = {
- #
- # Required Fields
- #
- TAB_DEC_DEFINES_PACKAGE_NAME : "_PackageName",
- TAB_DEC_DEFINES_PACKAGE_GUID : "_Guid",
- TAB_DEC_DEFINES_PACKAGE_VERSION : "_Version",
- TAB_DEC_DEFINES_PKG_UNI_FILE : "_PkgUniFile",
- }
-
-
- ## Constructor of DecBuildData
- #
- # Initialize object of DecBuildData
- #
- # @param FilePath The path of package description file
- # @param RawData The raw data of DEC file
- # @param BuildDataBase Database used to retrieve module information
- # @param Arch The target architecture
- # @param Platform (not used for DecBuildData)
- # @param Macros Macros used for replacement in DSC file
- #
- def __init__(self, File, RawData, BuildDataBase, Arch='COMMON', Target=None, Toolchain=None):
- self.MetaFile = File
- self._PackageDir = File.Dir
- self._RawData = RawData
- self._Bdb = BuildDataBase
- self._Arch = Arch
- self._Target = Target
- self._Toolchain = Toolchain
- self._Clear()
-
- ## XXX[key] = value
- def __setitem__(self, key, value):
- self.__dict__[self._PROPERTY_[key]] = value
-
- ## value = XXX[key]
- def __getitem__(self, key):
- return self.__dict__[self._PROPERTY_[key]]
-
- ## "in" test support
- def __contains__(self, key):
- return key in self._PROPERTY_
-
- ## Set all internal used members of DecBuildData to None
- def _Clear(self):
- self._Header = None
- self._PackageName = None
- self._Guid = None
- self._Version = None
- self._PkgUniFile = None
- self._Protocols = None
- self._Ppis = None
- self._Guids = None
- self._Includes = None
- self._LibraryClasses = None
- self._Pcds = None
- self.__Macros = None
-
- ## Get current effective macros
- def _GetMacros(self):
- if self.__Macros == None:
- self.__Macros = {}
- self.__Macros.update(GlobalData.gGlobalDefines)
- return self.__Macros
-
- ## Get architecture
- def _GetArch(self):
- return self._Arch
-
- ## Set architecture
- #
- # Changing the default ARCH to another may affect all other information
- # because all information in a platform may be ARCH-related. That's
- # why we need to clear all internal used members, in order to cause all
- # information to be re-retrieved.
- #
- # @param Value The value of ARCH
- #
- def _SetArch(self, Value):
- if self._Arch == Value:
- return
- self._Arch = Value
- self._Clear()
-
- ## Retrieve all information in [Defines] section
- #
- # (Retriving all [Defines] information in one-shot is just to save time.)
- #
- def _GetHeaderInfo(self):
- RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch]
- for Record in RecordList:
- Name = Record[1]
- if Name in self:
- self[Name] = Record[2]
- self._Header = 'DUMMY'
-
- ## Retrieve package name
- def _GetPackageName(self):
- if self._PackageName == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._PackageName == None:
- EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "No PACKAGE_NAME", File=self.MetaFile)
- return self._PackageName
-
- ## Retrieve file guid
- def _GetFileGuid(self):
- if self._Guid == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._Guid == None:
- EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "No PACKAGE_GUID", File=self.MetaFile)
- return self._Guid
-
- ## Retrieve package version
- def _GetVersion(self):
- if self._Version == None:
- if self._Header == None:
- self._GetHeaderInfo()
- if self._Version == None:
- self._Version = ''
- return self._Version
-
- ## Retrieve protocol definitions (name/value pairs)
- def _GetProtocol(self):
- if self._Protocols == None:
- #
- # tdict is a special kind of dict, used for selecting correct
- # protocol defition for given ARCH
- #
- ProtocolDict = tdict(True)
- NameList = []
- # find out all protocol definitions for specific and 'common' arch
- RecordList = self._RawData[MODEL_EFI_PROTOCOL, self._Arch]
- for Name, Guid, Dummy, Arch, ID, LineNo in RecordList:
- if Name not in NameList:
- NameList.append(Name)
- ProtocolDict[Arch, Name] = Guid
- # use sdict to keep the order
- self._Protocols = sdict()
- for Name in NameList:
- #
- # limit the ARCH to self._Arch, if no self._Arch found, tdict
- # will automatically turn to 'common' ARCH for trying
- #
- self._Protocols[Name] = ProtocolDict[self._Arch, Name]
- return self._Protocols
-
- ## Retrieve PPI definitions (name/value pairs)
- def _GetPpi(self):
- if self._Ppis == None:
- #
- # tdict is a special kind of dict, used for selecting correct
- # PPI defition for given ARCH
- #
- PpiDict = tdict(True)
- NameList = []
- # find out all PPI definitions for specific arch and 'common' arch
- RecordList = self._RawData[MODEL_EFI_PPI, self._Arch]
- for Name, Guid, Dummy, Arch, ID, LineNo in RecordList:
- if Name not in NameList:
- NameList.append(Name)
- PpiDict[Arch, Name] = Guid
- # use sdict to keep the order
- self._Ppis = sdict()
- for Name in NameList:
- #
- # limit the ARCH to self._Arch, if no self._Arch found, tdict
- # will automatically turn to 'common' ARCH for trying
- #
- self._Ppis[Name] = PpiDict[self._Arch, Name]
- return self._Ppis
-
- ## Retrieve GUID definitions (name/value pairs)
- def _GetGuid(self):
- if self._Guids == None:
- #
- # tdict is a special kind of dict, used for selecting correct
- # GUID defition for given ARCH
- #
- GuidDict = tdict(True)
- NameList = []
- # find out all protocol definitions for specific and 'common' arch
- RecordList = self._RawData[MODEL_EFI_GUID, self._Arch]
- for Name, Guid, Dummy, Arch, ID, LineNo in RecordList:
- if Name not in NameList:
- NameList.append(Name)
- GuidDict[Arch, Name] = Guid
- # use sdict to keep the order
- self._Guids = sdict()
- for Name in NameList:
- #
- # limit the ARCH to self._Arch, if no self._Arch found, tdict
- # will automatically turn to 'common' ARCH for trying
- #
- self._Guids[Name] = GuidDict[self._Arch, Name]
- return self._Guids
-
- ## Retrieve public include paths declared in this package
- def _GetInclude(self):
- if self._Includes == None:
- self._Includes = []
- RecordList = self._RawData[MODEL_EFI_INCLUDE, self._Arch]
- Macros = self._Macros
- Macros["EDK_SOURCE"] = GlobalData.gEcpSource
- for Record in RecordList:
- File = PathClass(NormPath(Record[0], Macros), self._PackageDir, Arch=self._Arch)
- LineNo = Record[-1]
- # validate the path
- ErrorCode, ErrorInfo = File.Validate()
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
-
- # avoid duplicate include path
- if File not in self._Includes:
- self._Includes.append(File)
- return self._Includes
-
- ## Retrieve library class declarations (not used in build at present)
- def _GetLibraryClass(self):
- if self._LibraryClasses == None:
- #
- # tdict is a special kind of dict, used for selecting correct
- # library class declaration for given ARCH
- #
- LibraryClassDict = tdict(True)
- LibraryClassSet = set()
- RecordList = self._RawData[MODEL_EFI_LIBRARY_CLASS, self._Arch]
- Macros = self._Macros
- for LibraryClass, File, Dummy, Arch, ID, LineNo in RecordList:
- File = PathClass(NormPath(File, Macros), self._PackageDir, Arch=self._Arch)
- # check the file validation
- ErrorCode, ErrorInfo = File.Validate()
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
- LibraryClassSet.add(LibraryClass)
- LibraryClassDict[Arch, LibraryClass] = File
- self._LibraryClasses = sdict()
- for LibraryClass in LibraryClassSet:
- self._LibraryClasses[LibraryClass] = LibraryClassDict[self._Arch, LibraryClass]
- return self._LibraryClasses
-
- ## Retrieve PCD declarations
- def _GetPcds(self):
- if self._Pcds == None:
- self._Pcds = sdict()
- self._Pcds.update(self._GetPcd(MODEL_PCD_FIXED_AT_BUILD))
- self._Pcds.update(self._GetPcd(MODEL_PCD_PATCHABLE_IN_MODULE))
- self._Pcds.update(self._GetPcd(MODEL_PCD_FEATURE_FLAG))
- self._Pcds.update(self._GetPcd(MODEL_PCD_DYNAMIC))
- self._Pcds.update(self._GetPcd(MODEL_PCD_DYNAMIC_EX))
- return self._Pcds
-
- ## Retrieve PCD declarations for given type
- def _GetPcd(self, Type):
- Pcds = sdict()
- #
- # tdict is a special kind of dict, used for selecting correct
- # PCD declaration for given ARCH
- #
- PcdDict = tdict(True, 3)
- # for summarizing PCD
- PcdSet = set()
- # find out all PCDs of the 'type'
- RecordList = self._RawData[Type, self._Arch]
- for TokenSpaceGuid, PcdCName, Setting, Arch, Dummy1, Dummy2 in RecordList:
- PcdDict[Arch, PcdCName, TokenSpaceGuid] = Setting
- PcdSet.add((PcdCName, TokenSpaceGuid))
-
- for PcdCName, TokenSpaceGuid in PcdSet:
- #
- # limit the ARCH to self._Arch, if no self._Arch found, tdict
- # will automatically turn to 'common' ARCH and try again
- #
- Setting = PcdDict[self._Arch, PcdCName, TokenSpaceGuid]
- if Setting == None:
- continue
-
- DefaultValue, DatumType, TokenNumber = AnalyzePcdData(Setting)
-
- Pcds[PcdCName, TokenSpaceGuid, self._PCD_TYPE_STRING_[Type]] = PcdClassObject(
- PcdCName,
- TokenSpaceGuid,
- self._PCD_TYPE_STRING_[Type],
- DatumType,
- DefaultValue,
- TokenNumber,
- '',
- {},
- False,
- None
- )
- return Pcds
-
-
- _Macros = property(_GetMacros)
- Arch = property(_GetArch, _SetArch)
- PackageName = property(_GetPackageName)
- Guid = property(_GetFileGuid)
- Version = property(_GetVersion)
-
- Protocols = property(_GetProtocol)
- Ppis = property(_GetPpi)
- Guids = property(_GetGuid)
- Includes = property(_GetInclude)
- LibraryClasses = property(_GetLibraryClass)
- Pcds = property(_GetPcds)
-
-## Module build information from INF file
-#
-# This class is used to retrieve information stored in database and convert them
-# into ModuleBuildClassObject form for easier use for AutoGen.
-#
-class InfBuildData(ModuleBuildClassObject):
- # dict used to convert PCD type in database to string used by build tool
- _PCD_TYPE_STRING_ = {
- MODEL_PCD_FIXED_AT_BUILD : "FixedAtBuild",
- MODEL_PCD_PATCHABLE_IN_MODULE : "PatchableInModule",
- MODEL_PCD_FEATURE_FLAG : "FeatureFlag",
- MODEL_PCD_DYNAMIC : "Dynamic",
- MODEL_PCD_DYNAMIC_DEFAULT : "Dynamic",
- MODEL_PCD_DYNAMIC_HII : "DynamicHii",
- MODEL_PCD_DYNAMIC_VPD : "DynamicVpd",
- MODEL_PCD_DYNAMIC_EX : "DynamicEx",
- MODEL_PCD_DYNAMIC_EX_DEFAULT : "DynamicEx",
- MODEL_PCD_DYNAMIC_EX_HII : "DynamicExHii",
- MODEL_PCD_DYNAMIC_EX_VPD : "DynamicExVpd",
- }
-
- # dict used to convert part of [Defines] to members of InfBuildData directly
- _PROPERTY_ = {
- #
- # Required Fields
- #
- TAB_INF_DEFINES_BASE_NAME : "_BaseName",
- TAB_INF_DEFINES_FILE_GUID : "_Guid",
- TAB_INF_DEFINES_MODULE_TYPE : "_ModuleType",
- #
- # Optional Fields
- #
- #TAB_INF_DEFINES_INF_VERSION : "_AutoGenVersion",
- TAB_INF_DEFINES_COMPONENT_TYPE : "_ComponentType",
- TAB_INF_DEFINES_MAKEFILE_NAME : "_MakefileName",
- #TAB_INF_DEFINES_CUSTOM_MAKEFILE : "_CustomMakefile",
- TAB_INF_DEFINES_DPX_SOURCE :"_DxsFile",
- TAB_INF_DEFINES_VERSION_NUMBER : "_Version",
- TAB_INF_DEFINES_VERSION_STRING : "_Version",
- TAB_INF_DEFINES_VERSION : "_Version",
- TAB_INF_DEFINES_PCD_IS_DRIVER : "_PcdIsDriver",
- TAB_INF_DEFINES_SHADOW : "_Shadow",
-
- TAB_COMPONENTS_SOURCE_OVERRIDE_PATH : "_SourceOverridePath",
- }
-
- # dict used to convert Component type to Module type
- _MODULE_TYPE_ = {
- "LIBRARY" : "BASE",
- "SECURITY_CORE" : "SEC",
- "PEI_CORE" : "PEI_CORE",
- "COMBINED_PEIM_DRIVER" : "PEIM",
- "PIC_PEIM" : "PEIM",
- "RELOCATABLE_PEIM" : "PEIM",
- "PE32_PEIM" : "PEIM",
- "BS_DRIVER" : "DXE_DRIVER",
- "RT_DRIVER" : "DXE_RUNTIME_DRIVER",
- "SAL_RT_DRIVER" : "DXE_SAL_DRIVER",
- "DXE_SMM_DRIVER" : "DXE_SMM_DRIVER",
- # "SMM_DRIVER" : "DXE_SMM_DRIVER",
- # "BS_DRIVER" : "DXE_SMM_DRIVER",
- # "BS_DRIVER" : "UEFI_DRIVER",
- "APPLICATION" : "UEFI_APPLICATION",
- "LOGO" : "BASE",
- }
-
- # regular expression for converting XXX_FLAGS in [nmake] section to new type
- _NMAKE_FLAG_PATTERN_ = re.compile("(?:EBC_)?([A-Z]+)_(?:STD_|PROJ_|ARCH_)?FLAGS(?:_DLL|_ASL|_EXE)?", re.UNICODE)
- # dict used to convert old tool name used in [nmake] section to new ones
- _TOOL_CODE_ = {
- "C" : "CC",
- "LIB" : "SLINK",
- "LINK" : "DLINK",
- }
-
-
- ## Constructor of DscBuildData
- #
- # Initialize object of DscBuildData
- #
- # @param FilePath The path of platform description file
- # @param RawData The raw data of DSC file
- # @param BuildDataBase Database used to retrieve module/package information
- # @param Arch The target architecture
- # @param Platform The name of platform employing this module
- # @param Macros Macros used for replacement in DSC file
- #
- def __init__(self, FilePath, RawData, BuildDatabase, Arch='COMMON', Target=None, Toolchain=None):
- self.MetaFile = FilePath
- self._ModuleDir = FilePath.Dir
- self._RawData = RawData
- self._Bdb = BuildDatabase
- self._Arch = Arch
- self._Target = Target
- self._Toolchain = Toolchain
- self._Platform = 'COMMON'
- self._SourceOverridePath = None
- if FilePath.Key in GlobalData.gOverrideDir:
- self._SourceOverridePath = GlobalData.gOverrideDir[FilePath.Key]
- self._Clear()
-
- ## XXX[key] = value
- def __setitem__(self, key, value):
- self.__dict__[self._PROPERTY_[key]] = value
-
- ## value = XXX[key]
- def __getitem__(self, key):
- return self.__dict__[self._PROPERTY_[key]]
-
- ## "in" test support
- def __contains__(self, key):
- return key in self._PROPERTY_
-
- ## Set all internal used members of InfBuildData to None
- def _Clear(self):
- self._Header_ = None
- self._AutoGenVersion = None
- self._BaseName = None
- self._DxsFile = None
- self._ModuleType = None
- self._ComponentType = None
- self._BuildType = None
- self._Guid = None
- self._Version = None
- self._PcdIsDriver = None
- self._BinaryModule = None
- self._Shadow = None
- self._MakefileName = None
- self._CustomMakefile = None
- self._Specification = None
- self._LibraryClass = None
- self._ModuleEntryPointList = None
- self._ModuleUnloadImageList = None
- self._ConstructorList = None
- self._DestructorList = None
- self._Defs = None
- self._Binaries = None
- self._Sources = None
- self._LibraryClasses = None
- self._Libraries = None
- self._Protocols = None
- self._Ppis = None
- self._Guids = None
- self._Includes = None
- self._Packages = None
- self._Pcds = None
- self._BuildOptions = None
- self._Depex = None
- self._DepexExpression = None
- self.__Macros = None
-
- ## Get current effective macros
- def _GetMacros(self):
- if self.__Macros == None:
- self.__Macros = {}
- # EDK_GLOBAL defined macros can be applied to EDK module
- if self.AutoGenVersion < 0x00010005:
- self.__Macros.update(GlobalData.gEdkGlobal)
- self.__Macros.update(GlobalData.gGlobalDefines)
- return self.__Macros
-
- ## Get architecture
- def _GetArch(self):
- return self._Arch
-
- ## Set architecture
- #
- # Changing the default ARCH to another may affect all other information
- # because all information in a platform may be ARCH-related. That's
- # why we need to clear all internal used members, in order to cause all
- # information to be re-retrieved.
- #
- # @param Value The value of ARCH
- #
- def _SetArch(self, Value):
- if self._Arch == Value:
- return
- self._Arch = Value
- self._Clear()
-
- ## Return the name of platform employing this module
- def _GetPlatform(self):
- return self._Platform
-
- ## Change the name of platform employing this module
- #
- # Changing the default name of platform to another may affect some information
- # because they may be PLATFORM-related. That's why we need to clear all internal
- # used members, in order to cause all information to be re-retrieved.
- #
- def _SetPlatform(self, Value):
- if self._Platform == Value:
- return
- self._Platform = Value
- self._Clear()
-
- ## Retrieve all information in [Defines] section
- #
- # (Retriving all [Defines] information in one-shot is just to save time.)
- #
- def _GetHeaderInfo(self):
- RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch, self._Platform]
- for Record in RecordList:
- Name, Value = Record[1], ReplaceMacro(Record[2], self._Macros, False)
- # items defined _PROPERTY_ don't need additional processing
- if Name in self:
- self[Name] = Value
- # some special items in [Defines] section need special treatment
- elif Name in ('EFI_SPECIFICATION_VERSION', 'UEFI_SPECIFICATION_VERSION', 'EDK_RELEASE_VERSION', 'PI_SPECIFICATION_VERSION'):
- if Name in ('EFI_SPECIFICATION_VERSION', 'UEFI_SPECIFICATION_VERSION'):
- Name = 'UEFI_SPECIFICATION_VERSION'
- if self._Specification == None:
- self._Specification = sdict()
- self._Specification[Name] = GetHexVerValue(Value)
- if self._Specification[Name] == None:
- EdkLogger.error("build", FORMAT_NOT_SUPPORTED,
- "'%s' format is not supported for %s" % (Value, Name),
- File=self.MetaFile, Line=Record[-1])
- elif Name == 'LIBRARY_CLASS':
- if self._LibraryClass == None:
- self._LibraryClass = []
- ValueList = GetSplitValueList(Value)
- LibraryClass = ValueList[0]
- if len(ValueList) > 1:
- SupModuleList = GetSplitValueList(ValueList[1], ' ')
- else:
- SupModuleList = SUP_MODULE_LIST
- self._LibraryClass.append(LibraryClassObject(LibraryClass, SupModuleList))
- elif Name == 'ENTRY_POINT':
- if self._ModuleEntryPointList == None:
- self._ModuleEntryPointList = []
- self._ModuleEntryPointList.append(Value)
- elif Name == 'UNLOAD_IMAGE':
- if self._ModuleUnloadImageList == None:
- self._ModuleUnloadImageList = []
- if not Value:
- continue
- self._ModuleUnloadImageList.append(Value)
- elif Name == 'CONSTRUCTOR':
- if self._ConstructorList == None:
- self._ConstructorList = []
- if not Value:
- continue
- self._ConstructorList.append(Value)
- elif Name == 'DESTRUCTOR':
- if self._DestructorList == None:
- self._DestructorList = []
- if not Value:
- continue
- self._DestructorList.append(Value)
- elif Name == TAB_INF_DEFINES_CUSTOM_MAKEFILE:
- TokenList = GetSplitValueList(Value)
- if self._CustomMakefile == None:
- self._CustomMakefile = {}
- if len(TokenList) < 2:
- self._CustomMakefile['MSFT'] = TokenList[0]
- self._CustomMakefile['GCC'] = TokenList[0]
- else:
- if TokenList[0] not in ['MSFT', 'GCC']:
- EdkLogger.error("build", FORMAT_NOT_SUPPORTED,
- "No supported family [%s]" % TokenList[0],
- File=self.MetaFile, Line=Record[-1])
- self._CustomMakefile[TokenList[0]] = TokenList[1]
- else:
- if self._Defs == None:
- self._Defs = sdict()
- self._Defs[Name] = Value
-
- #
- # Retrieve information in sections specific to Edk.x modules
- #
- if self.AutoGenVersion >= 0x00010005:
- if not self._ModuleType:
- EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,
- "MODULE_TYPE is not given", File=self.MetaFile)
- if self._ModuleType not in SUP_MODULE_LIST:
- RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch, self._Platform]
- for Record in RecordList:
- Name = Record[1]
- if Name == "MODULE_TYPE":
- LineNo = Record[6]
- break
- EdkLogger.error("build", FORMAT_NOT_SUPPORTED,
- "MODULE_TYPE %s is not supported for EDK II, valid values are:\n %s" % (self._ModuleType,' '.join(l for l in SUP_MODULE_LIST)),
- File=self.MetaFile, Line=LineNo)
- if (self._Specification == None) or (not 'PI_SPECIFICATION_VERSION' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VERSION'], 16) < 0x0001000A):
- if self._ModuleType == SUP_MODULE_SMM_CORE:
- EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "SMM_CORE module type can't be used in the module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=self.MetaFile)
- if self._Defs and 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self._Defs \
- and 'PCI_CLASS_CODE' in self._Defs:
- self._BuildType = 'UEFI_OPTIONROM'
- elif self._Defs and 'UEFI_HII_RESOURCE_SECTION' in self._Defs \
- and self._Defs['UEFI_HII_RESOURCE_SECTION'] == 'TRUE':
- self._BuildType = 'UEFI_HII'
- else:
- self._BuildType = self._ModuleType.upper()
-
- if self._DxsFile:
- File = PathClass(NormPath(self._DxsFile), self._ModuleDir, Arch=self._Arch)
- # check the file validation
- ErrorCode, ErrorInfo = File.Validate(".dxs", CaseSensitive=False)
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo,
- File=self.MetaFile, Line=LineNo)
- if self.Sources == None:
- self._Sources = []
- self._Sources.append(File)
- else:
- if not self._ComponentType:
- EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,
- "COMPONENT_TYPE is not given", File=self.MetaFile)
- self._BuildType = self._ComponentType.upper()
- if self._ComponentType in self._MODULE_TYPE_:
- self._ModuleType = self._MODULE_TYPE_[self._ComponentType]
- if self._ComponentType == 'LIBRARY':
- self._LibraryClass = [LibraryClassObject(self._BaseName, SUP_MODULE_LIST)]
- # make use some [nmake] section macros
- Macros = self._Macros
- Macros["EDK_SOURCE"] = GlobalData.gEcpSource
- Macros['PROCESSOR'] = self._Arch
- RecordList = self._RawData[MODEL_META_DATA_NMAKE, self._Arch, self._Platform]
- for Name,Value,Dummy,Arch,Platform,ID,LineNo in RecordList:
- Value = ReplaceMacro(Value, Macros, True)
- if Name == "IMAGE_ENTRY_POINT":
- if self._ModuleEntryPointList == None:
- self._ModuleEntryPointList = []
- self._ModuleEntryPointList.append(Value)
- elif Name == "DPX_SOURCE":
- File = PathClass(NormPath(Value), self._ModuleDir, Arch=self._Arch)
- # check the file validation
- ErrorCode, ErrorInfo = File.Validate(".dxs", CaseSensitive=False)
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo,
- File=self.MetaFile, Line=LineNo)
- if self.Sources == None:
- self._Sources = []
- self._Sources.append(File)
- else:
- ToolList = self._NMAKE_FLAG_PATTERN_.findall(Name)
- if len(ToolList) == 0 or len(ToolList) != 1:
- pass
-# EdkLogger.warn("build", "Don't know how to do with macro [%s]" % Name,
-# File=self.MetaFile, Line=LineNo)
- else:
- if self._BuildOptions == None:
- self._BuildOptions = sdict()
-
- if ToolList[0] in self._TOOL_CODE_:
- Tool = self._TOOL_CODE_[ToolList[0]]
- else:
- Tool = ToolList[0]
- ToolChain = "*_*_*_%s_FLAGS" % Tool
- ToolChainFamily = 'MSFT' # Edk.x only support MSFT tool chain
- #ignore not replaced macros in value
- ValueList = GetSplitList(' ' + Value, '/D')
- Dummy = ValueList[0]
- for Index in range(1, len(ValueList)):
- if ValueList[Index][-1] == '=' or ValueList[Index] == '':
- continue
- Dummy = Dummy + ' /D ' + ValueList[Index]
- Value = Dummy.strip()
- if (ToolChainFamily, ToolChain) not in self._BuildOptions:
- self._BuildOptions[ToolChainFamily, ToolChain] = Value
- else:
- OptionString = self._BuildOptions[ToolChainFamily, ToolChain]
- self._BuildOptions[ToolChainFamily, ToolChain] = OptionString + " " + Value
- # set _Header to non-None in order to avoid database re-querying
- self._Header_ = 'DUMMY'
-
- ## Retrieve file version
- def _GetInfVersion(self):
- if self._AutoGenVersion == None:
- RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch, self._Platform]
- for Record in RecordList:
- if Record[1] == TAB_INF_DEFINES_INF_VERSION:
- self._AutoGenVersion = int(Record[2], 0)
- break
- if self._AutoGenVersion == None:
- self._AutoGenVersion = 0x00010000
- return self._AutoGenVersion
-
- ## Retrieve BASE_NAME
- def _GetBaseName(self):
- if self._BaseName == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._BaseName == None:
- EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No BASE_NAME name", File=self.MetaFile)
- return self._BaseName
-
- ## Retrieve DxsFile
- def _GetDxsFile(self):
- if self._DxsFile == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._DxsFile == None:
- self._DxsFile = ''
- return self._DxsFile
-
- ## Retrieve MODULE_TYPE
- def _GetModuleType(self):
- if self._ModuleType == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._ModuleType == None:
- self._ModuleType = 'BASE'
- if self._ModuleType not in SUP_MODULE_LIST:
- self._ModuleType = "USER_DEFINED"
- return self._ModuleType
-
- ## Retrieve COMPONENT_TYPE
- def _GetComponentType(self):
- if self._ComponentType == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._ComponentType == None:
- self._ComponentType = 'USER_DEFINED'
- return self._ComponentType
-
- ## Retrieve "BUILD_TYPE"
- def _GetBuildType(self):
- if self._BuildType == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if not self._BuildType:
- self._BuildType = "BASE"
- return self._BuildType
-
- ## Retrieve file guid
- def _GetFileGuid(self):
- if self._Guid == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._Guid == None:
- self._Guid = '00000000-0000-0000-000000000000'
- return self._Guid
-
- ## Retrieve module version
- def _GetVersion(self):
- if self._Version == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._Version == None:
- self._Version = '0.0'
- return self._Version
-
- ## Retrieve PCD_IS_DRIVER
- def _GetPcdIsDriver(self):
- if self._PcdIsDriver == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._PcdIsDriver == None:
- self._PcdIsDriver = ''
- return self._PcdIsDriver
-
- ## Retrieve SHADOW
- def _GetShadow(self):
- if self._Shadow == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._Shadow != None and self._Shadow.upper() == 'TRUE':
- self._Shadow = True
- else:
- self._Shadow = False
- return self._Shadow
-
- ## Retrieve CUSTOM_MAKEFILE
- def _GetMakefile(self):
- if self._CustomMakefile == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._CustomMakefile == None:
- self._CustomMakefile = {}
- return self._CustomMakefile
-
- ## Retrieve EFI_SPECIFICATION_VERSION
- def _GetSpec(self):
- if self._Specification == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._Specification == None:
- self._Specification = {}
- return self._Specification
-
- ## Retrieve LIBRARY_CLASS
- def _GetLibraryClass(self):
- if self._LibraryClass == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._LibraryClass == None:
- self._LibraryClass = []
- return self._LibraryClass
-
- ## Retrieve ENTRY_POINT
- def _GetEntryPoint(self):
- if self._ModuleEntryPointList == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._ModuleEntryPointList == None:
- self._ModuleEntryPointList = []
- return self._ModuleEntryPointList
-
- ## Retrieve UNLOAD_IMAGE
- def _GetUnloadImage(self):
- if self._ModuleUnloadImageList == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._ModuleUnloadImageList == None:
- self._ModuleUnloadImageList = []
- return self._ModuleUnloadImageList
-
- ## Retrieve CONSTRUCTOR
- def _GetConstructor(self):
- if self._ConstructorList == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._ConstructorList == None:
- self._ConstructorList = []
- return self._ConstructorList
-
- ## Retrieve DESTRUCTOR
- def _GetDestructor(self):
- if self._DestructorList == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._DestructorList == None:
- self._DestructorList = []
- return self._DestructorList
-
- ## Retrieve definies other than above ones
- def _GetDefines(self):
- if self._Defs == None:
- if self._Header_ == None:
- self._GetHeaderInfo()
- if self._Defs == None:
- self._Defs = sdict()
- return self._Defs
-
- ## Retrieve binary files
- def _GetBinaryFiles(self):
- if self._Binaries == None:
- self._Binaries = []
- RecordList = self._RawData[MODEL_EFI_BINARY_FILE, self._Arch, self._Platform]
- Macros = self._Macros
- Macros["EDK_SOURCE"] = GlobalData.gEcpSource
- Macros['PROCESSOR'] = self._Arch
- for Record in RecordList:
- FileType = Record[0]
- LineNo = Record[-1]
- Target = 'COMMON'
- FeatureFlag = []
- if Record[2]:
- TokenList = GetSplitValueList(Record[2], TAB_VALUE_SPLIT)
- if TokenList:
- Target = TokenList[0]
- if len(TokenList) > 1:
- FeatureFlag = Record[1:]
-
- File = PathClass(NormPath(Record[1], Macros), self._ModuleDir, '', FileType, True, self._Arch, '', Target)
- # check the file validation
- ErrorCode, ErrorInfo = File.Validate()
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
- self._Binaries.append(File)
- return self._Binaries
-
- ## Retrieve source files
- def _GetSourceFiles(self):
- if self._Sources == None:
- self._Sources = []
- RecordList = self._RawData[MODEL_EFI_SOURCE_FILE, self._Arch, self._Platform]
- Macros = self._Macros
- for Record in RecordList:
- LineNo = Record[-1]
- ToolChainFamily = Record[1]
- TagName = Record[2]
- ToolCode = Record[3]
- FeatureFlag = Record[4]
- if self.AutoGenVersion < 0x00010005:
- Macros["EDK_SOURCE"] = GlobalData.gEcpSource
- Macros['PROCESSOR'] = self._Arch
- # old module source files (Edk)
- File = PathClass(NormPath(Record[0], Macros), self._ModuleDir, self._SourceOverridePath,
- '', False, self._Arch, ToolChainFamily, '', TagName, ToolCode)
- # check the file validation
- ErrorCode, ErrorInfo = File.Validate(CaseSensitive=False)
- if ErrorCode != 0:
- if File.Ext.lower() == '.h':
- EdkLogger.warn('build', 'Include file not found', ExtraData=ErrorInfo,
- File=self.MetaFile, Line=LineNo)
- continue
- else:
- EdkLogger.error('build', ErrorCode, ExtraData=File, File=self.MetaFile, Line=LineNo)
- else:
- File = PathClass(NormPath(Record[0], Macros), self._ModuleDir, '',
- '', False, self._Arch, ToolChainFamily, '', TagName, ToolCode)
- # check the file validation
- ErrorCode, ErrorInfo = File.Validate()
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
-
- self._Sources.append(File)
- return self._Sources
-
- ## Retrieve library classes employed by this module
- def _GetLibraryClassUses(self):
- if self._LibraryClasses == None:
- self._LibraryClasses = sdict()
- RecordList = self._RawData[MODEL_EFI_LIBRARY_CLASS, self._Arch, self._Platform]
- for Record in RecordList:
- Lib = Record[0]
- Instance = Record[1]
- if Instance:
- Instance = NormPath(Instance, self._Macros)
- self._LibraryClasses[Lib] = Instance
- return self._LibraryClasses
-
- ## Retrieve library names (for Edk.x style of modules)
- def _GetLibraryNames(self):
- if self._Libraries == None:
- self._Libraries = []
- RecordList = self._RawData[MODEL_EFI_LIBRARY_INSTANCE, self._Arch, self._Platform]
- for Record in RecordList:
- LibraryName = ReplaceMacro(Record[0], self._Macros, False)
- # in case of name with '.lib' extension, which is unusual in Edk.x inf
- LibraryName = os.path.splitext(LibraryName)[0]
- if LibraryName not in self._Libraries:
- self._Libraries.append(LibraryName)
- return self._Libraries
-
- ## Retrieve protocols consumed/produced by this module
- def _GetProtocols(self):
- if self._Protocols == None:
- self._Protocols = sdict()
- RecordList = self._RawData[MODEL_EFI_PROTOCOL, self._Arch, self._Platform]
- for Record in RecordList:
- CName = Record[0]
- Value = ProtocolValue(CName, self.Packages)
- if Value == None:
- PackageList = "\n\t".join([str(P) for P in self.Packages])
- EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
- "Value of Protocol [%s] is not found under [Protocols] section in" % CName,
- ExtraData=PackageList, File=self.MetaFile, Line=Record[-1])
- self._Protocols[CName] = Value
- return self._Protocols
-
- ## Retrieve PPIs consumed/produced by this module
- def _GetPpis(self):
- if self._Ppis == None:
- self._Ppis = sdict()
- RecordList = self._RawData[MODEL_EFI_PPI, self._Arch, self._Platform]
- for Record in RecordList:
- CName = Record[0]
- Value = PpiValue(CName, self.Packages)
- if Value == None:
- PackageList = "\n\t".join([str(P) for P in self.Packages])
- EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
- "Value of PPI [%s] is not found under [Ppis] section in " % CName,
- ExtraData=PackageList, File=self.MetaFile, Line=Record[-1])
- self._Ppis[CName] = Value
- return self._Ppis
-
- ## Retrieve GUIDs consumed/produced by this module
- def _GetGuids(self):
- if self._Guids == None:
- self._Guids = sdict()
- RecordList = self._RawData[MODEL_EFI_GUID, self._Arch, self._Platform]
- for Record in RecordList:
- CName = Record[0]
- Value = GuidValue(CName, self.Packages)
- if Value == None:
- PackageList = "\n\t".join([str(P) for P in self.Packages])
- EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
- "Value of Guid [%s] is not found under [Guids] section in" % CName,
- ExtraData=PackageList, File=self.MetaFile, Line=Record[-1])
- self._Guids[CName] = Value
- return self._Guids
-
- ## Retrieve include paths necessary for this module (for Edk.x style of modules)
- def _GetIncludes(self):
- if self._Includes == None:
- self._Includes = []
- if self._SourceOverridePath:
- self._Includes.append(self._SourceOverridePath)
-
- Macros = self._Macros
- if 'PROCESSOR' in GlobalData.gEdkGlobal.keys():
- Macros['PROCESSOR'] = GlobalData.gEdkGlobal['PROCESSOR']
- else:
- Macros['PROCESSOR'] = self._Arch
- RecordList = self._RawData[MODEL_EFI_INCLUDE, self._Arch, self._Platform]
- for Record in RecordList:
- if Record[0].find('EDK_SOURCE') > -1:
- Macros['EDK_SOURCE'] = GlobalData.gEcpSource
- File = NormPath(Record[0], self._Macros)
- if File[0] == '.':
- File = os.path.join(self._ModuleDir, File)
- else:
- File = os.path.join(GlobalData.gWorkspace, File)
- File = RealPath(os.path.normpath(File))
- if File:
- self._Includes.append(File)
-
- #TRICK: let compiler to choose correct header file
- Macros['EDK_SOURCE'] = GlobalData.gEdkSource
- File = NormPath(Record[0], self._Macros)
- if File[0] == '.':
- File = os.path.join(self._ModuleDir, File)
- else:
- File = os.path.join(GlobalData.gWorkspace, File)
- File = RealPath(os.path.normpath(File))
- if File:
- self._Includes.append(File)
- else:
- File = NormPath(Record[0], Macros)
- if File[0] == '.':
- File = os.path.join(self._ModuleDir, File)
- else:
- File = os.path.join(GlobalData.gWorkspace, File)
- File = RealPath(os.path.normpath(File))
- if File:
- self._Includes.append(File)
- return self._Includes
-
- ## Retrieve packages this module depends on
- def _GetPackages(self):
- if self._Packages == None:
- self._Packages = []
- RecordList = self._RawData[MODEL_META_DATA_PACKAGE, self._Arch, self._Platform]
- Macros = self._Macros
- Macros['EDK_SOURCE'] = GlobalData.gEcpSource
- for Record in RecordList:
- File = PathClass(NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch=self._Arch)
- LineNo = Record[-1]
- # check the file validation
- ErrorCode, ErrorInfo = File.Validate('.dec')
- if ErrorCode != 0:
- EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
- # parse this package now. we need it to get protocol/ppi/guid value
- Package = self._Bdb[File, self._Arch, self._Target, self._Toolchain]
- self._Packages.append(Package)
- return self._Packages
-
- ## Retrieve PCDs used in this module
- def _GetPcds(self):
- if self._Pcds == None:
- self._Pcds = sdict()
- self._Pcds.update(self._GetPcd(MODEL_PCD_FIXED_AT_BUILD))
- self._Pcds.update(self._GetPcd(MODEL_PCD_PATCHABLE_IN_MODULE))
- self._Pcds.update(self._GetPcd(MODEL_PCD_FEATURE_FLAG))
- self._Pcds.update(self._GetPcd(MODEL_PCD_DYNAMIC))
- self._Pcds.update(self._GetPcd(MODEL_PCD_DYNAMIC_EX))
- return self._Pcds
-
- ## Retrieve build options specific to this module
- def _GetBuildOptions(self):
- if self._BuildOptions == None:
- self._BuildOptions = sdict()
- RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, self._Platform]
- for Record in RecordList:
- ToolChainFamily = Record[0]
- ToolChain = Record[1]
- Option = Record[2]
- if (ToolChainFamily, ToolChain) not in self._BuildOptions:
- self._BuildOptions[ToolChainFamily, ToolChain] = Option
- else:
- # concatenate the option string if they're for the same tool
- OptionString = self._BuildOptions[ToolChainFamily, ToolChain]
- self._BuildOptions[ToolChainFamily, ToolChain] = OptionString + " " + Option
- return self._BuildOptions
-
- ## Retrieve dependency expression
- def _GetDepex(self):
- if self._Depex == None:
- self._Depex = tdict(False, 2)
- RecordList = self._RawData[MODEL_EFI_DEPEX, self._Arch]
-
- # If the module has only Binaries and no Sources, then ignore [Depex]
- if self.Sources == None or self.Sources == []:
- if self.Binaries != None and self.Binaries != []:
- return self._Depex
-
- # PEIM and DXE drivers must have a valid [Depex] section
- if len(self.LibraryClass) == 0 and len(RecordList) == 0:
- if self.ModuleType == 'DXE_DRIVER' or self.ModuleType == 'PEIM' or self.ModuleType == 'DXE_SMM_DRIVER' or \
- self.ModuleType == 'DXE_SAL_DRIVER' or self.ModuleType == 'DXE_RUNTIME_DRIVER':
- EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "No [Depex] section or no valid expression in [Depex] section for [%s] module" \
- % self.ModuleType, File=self.MetaFile)
-
- Depex = sdict()
- for Record in RecordList:
- DepexStr = ReplaceMacro(Record[0], self._Macros, False)
- Arch = Record[3]
- ModuleType = Record[4]
- TokenList = DepexStr.split()
- if (Arch, ModuleType) not in Depex:
- Depex[Arch, ModuleType] = []
- DepexList = Depex[Arch, ModuleType]
- for Token in TokenList:
- if Token in DEPEX_SUPPORTED_OPCODE:
- DepexList.append(Token)
- elif Token.endswith(".inf"): # module file name
- ModuleFile = os.path.normpath(Token)
- Module = self.BuildDatabase[ModuleFile]
- if Module == None:
- EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "Module is not found in active platform",
- ExtraData=Token, File=self.MetaFile, Line=Record[-1])
- DepexList.append(Module.Guid)
- else:
- # get the GUID value now
- Value = ProtocolValue(Token, self.Packages)
- if Value == None:
- Value = PpiValue(Token, self.Packages)
- if Value == None:
- Value = GuidValue(Token, self.Packages)
- if Value == None:
- PackageList = "\n\t".join([str(P) for P in self.Packages])
- EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
- "Value of [%s] is not found in" % Token,
- ExtraData=PackageList, File=self.MetaFile, Line=Record[-1])
- DepexList.append(Value)
- for Arch, ModuleType in Depex:
- self._Depex[Arch, ModuleType] = Depex[Arch, ModuleType]
- return self._Depex
-
- ## Retrieve depedency expression
- def _GetDepexExpression(self):
- if self._DepexExpression == None:
- self._DepexExpression = tdict(False, 2)
- RecordList = self._RawData[MODEL_EFI_DEPEX, self._Arch]
- DepexExpression = sdict()
- for Record in RecordList:
- DepexStr = ReplaceMacro(Record[0], self._Macros, False)
- Arch = Record[3]
- ModuleType = Record[4]
- TokenList = DepexStr.split()
- if (Arch, ModuleType) not in DepexExpression:
- DepexExpression[Arch, ModuleType] = ''
- for Token in TokenList:
- DepexExpression[Arch, ModuleType] = DepexExpression[Arch, ModuleType] + Token.strip() + ' '
- for Arch, ModuleType in DepexExpression:
- self._DepexExpression[Arch, ModuleType] = DepexExpression[Arch, ModuleType]
- return self._DepexExpression
-
- ## Retrieve PCD for given type
- def _GetPcd(self, Type):
- Pcds = sdict()
- PcdDict = tdict(True, 4)
- PcdList = []
- RecordList = self._RawData[Type, self._Arch, self._Platform]
- for TokenSpaceGuid, PcdCName, Setting, Arch, Platform, Dummy1, LineNo in RecordList:
- PcdDict[Arch, Platform, PcdCName, TokenSpaceGuid] = (Setting, LineNo)
- PcdList.append((PcdCName, TokenSpaceGuid))
- # get the guid value
- if TokenSpaceGuid not in self.Guids:
- Value = GuidValue(TokenSpaceGuid, self.Packages)
- if Value == None:
- PackageList = "\n\t".join([str(P) for P in self.Packages])
- EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
- "Value of Guid [%s] is not found under [Guids] section in" % TokenSpaceGuid,
- ExtraData=PackageList, File=self.MetaFile, Line=LineNo)
- self.Guids[TokenSpaceGuid] = Value
-
- # resolve PCD type, value, datum info, etc. by getting its definition from package
- for PcdCName, TokenSpaceGuid in PcdList:
- Setting, LineNo = PcdDict[self._Arch, self.Platform, PcdCName, TokenSpaceGuid]
- if Setting == None:
- continue
- ValueList = AnalyzePcdData(Setting)
- DefaultValue = ValueList[0]
- Pcd = PcdClassObject(
- PcdCName,
- TokenSpaceGuid,
- '',
- '',
- DefaultValue,
- '',
- '',
- {},
- False,
- self.Guids[TokenSpaceGuid]
- )
-
- # get necessary info from package declaring this PCD
- for Package in self.Packages:
- #
- # 'dynamic' in INF means its type is determined by platform;
- # if platform doesn't give its type, use 'lowest' one in the
- # following order, if any
- #
- # "FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic", "DynamicEx"
- #
- PcdType = self._PCD_TYPE_STRING_[Type]
- if Type == MODEL_PCD_DYNAMIC:
- Pcd.Pending = True
- for T in ["FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic", "DynamicEx"]:
- if (PcdCName, TokenSpaceGuid, T) in Package.Pcds:
- PcdType = T
- break
- else:
- Pcd.Pending = False
-
- if (PcdCName, TokenSpaceGuid, PcdType) in Package.Pcds:
- PcdInPackage = Package.Pcds[PcdCName, TokenSpaceGuid, PcdType]
- Pcd.Type = PcdType
- Pcd.TokenValue = PcdInPackage.TokenValue
-
- #
- # Check whether the token value exist or not.
- #
- if Pcd.TokenValue == None or Pcd.TokenValue == "":
- EdkLogger.error(
- 'build',
- FORMAT_INVALID,
- "No TokenValue for PCD [%s.%s] in [%s]!" % (TokenSpaceGuid, PcdCName, str(Package)),
- File =self.MetaFile, Line=LineNo,
- ExtraData=None
- )
- #
- # Check hexadecimal token value length and format.
- #
- ReIsValidPcdTokenValue = re.compile(r"^[0][x|X][0]*[0-9a-fA-F]{1,8}$", re.DOTALL)
- if Pcd.TokenValue.startswith("0x") or Pcd.TokenValue.startswith("0X"):
- if ReIsValidPcdTokenValue.match(Pcd.TokenValue) == None:
- EdkLogger.error(
- 'build',
- FORMAT_INVALID,
- "The format of TokenValue [%s] of PCD [%s.%s] in [%s] is invalid:" % (Pcd.TokenValue, TokenSpaceGuid, PcdCName, str(Package)),
- File =self.MetaFile, Line=LineNo,
- ExtraData=None
- )
-
- #
- # Check decimal token value length and format.
- #
- else:
- try:
- TokenValueInt = int (Pcd.TokenValue, 10)
- if (TokenValueInt < 0 or TokenValueInt > 4294967295):
- EdkLogger.error(
- 'build',
- FORMAT_INVALID,
- "The format of TokenValue [%s] of PCD [%s.%s] in [%s] is invalid, as a decimal it should between: 0 - 4294967295!"% (Pcd.TokenValue, TokenSpaceGuid, PcdCName, str(Package)),
- File =self.MetaFile, Line=LineNo,
- ExtraData=None
- )
- except:
- EdkLogger.error(
- 'build',
- FORMAT_INVALID,
- "The format of TokenValue [%s] of PCD [%s.%s] in [%s] is invalid, it should be hexadecimal or decimal!"% (Pcd.TokenValue, TokenSpaceGuid, PcdCName, str(Package)),
- File =self.MetaFile, Line=LineNo,
- ExtraData=None
- )
-
- Pcd.DatumType = PcdInPackage.DatumType
- Pcd.MaxDatumSize = PcdInPackage.MaxDatumSize
- Pcd.InfDefaultValue = Pcd.DefaultValue
- if Pcd.DefaultValue in [None, '']:
- Pcd.DefaultValue = PcdInPackage.DefaultValue
- break
- else:
- EdkLogger.error(
- 'build',
- FORMAT_INVALID,
- "PCD [%s.%s] in [%s] is not found in dependent packages:" % (TokenSpaceGuid, PcdCName, self.MetaFile),
- File =self.MetaFile, Line=LineNo,
- ExtraData="\t%s" % '\n\t'.join([str(P) for P in self.Packages])
- )
- Pcds[PcdCName, TokenSpaceGuid] = Pcd
-
- return Pcds
-
- _Macros = property(_GetMacros)
- Arch = property(_GetArch, _SetArch)
- Platform = property(_GetPlatform, _SetPlatform)
-
- AutoGenVersion = property(_GetInfVersion)
- BaseName = property(_GetBaseName)
- ModuleType = property(_GetModuleType)
- ComponentType = property(_GetComponentType)
- BuildType = property(_GetBuildType)
- Guid = property(_GetFileGuid)
- Version = property(_GetVersion)
- PcdIsDriver = property(_GetPcdIsDriver)
- Shadow = property(_GetShadow)
- CustomMakefile = property(_GetMakefile)
- Specification = property(_GetSpec)
- LibraryClass = property(_GetLibraryClass)
- ModuleEntryPointList = property(_GetEntryPoint)
- ModuleUnloadImageList = property(_GetUnloadImage)
- ConstructorList = property(_GetConstructor)
- DestructorList = property(_GetDestructor)
- Defines = property(_GetDefines)
- DxsFile = property(_GetDxsFile)
-
- Binaries = property(_GetBinaryFiles)
- Sources = property(_GetSourceFiles)
- LibraryClasses = property(_GetLibraryClassUses)
- Libraries = property(_GetLibraryNames)
- Protocols = property(_GetProtocols)
- Ppis = property(_GetPpis)
- Guids = property(_GetGuids)
- Includes = property(_GetIncludes)
- Packages = property(_GetPackages)
- Pcds = property(_GetPcds)
- BuildOptions = property(_GetBuildOptions)
- Depex = property(_GetDepex)
- DepexExpression = property(_GetDepexExpression)
-
-## Database
-#
-# This class defined the build database for all modules, packages and platform.
-# It will call corresponding parser for the given file if it cannot find it in
-# the database.
-#
-# @param DbPath Path of database file
-# @param GlobalMacros Global macros used for replacement during file parsing
-# @prarm RenewDb=False Create new database file if it's already there
-#
-class WorkspaceDatabase(object):
-
- # default database file path
- _DB_PATH_ = "Conf/.cache/build.db"
-
- #
- # internal class used for call corresponding file parser and caching the result
- # to avoid unnecessary re-parsing
- #
- class BuildObjectFactory(object):
-
- _FILE_TYPE_ = {
- ".inf" : MODEL_FILE_INF,
- ".dec" : MODEL_FILE_DEC,
- ".dsc" : MODEL_FILE_DSC,
- }
-
- # file parser
- _FILE_PARSER_ = {
- MODEL_FILE_INF : InfParser,
- MODEL_FILE_DEC : DecParser,
- MODEL_FILE_DSC : DscParser,
- }
-
- # convert to xxxBuildData object
- _GENERATOR_ = {
- MODEL_FILE_INF : InfBuildData,
- MODEL_FILE_DEC : DecBuildData,
- MODEL_FILE_DSC : DscBuildData,
- }
-
- _CACHE_ = {} # (FilePath, Arch) : <object>
-
- # constructor
- def __init__(self, WorkspaceDb):
- self.WorkspaceDb = WorkspaceDb
-
- # key = (FilePath, Arch=None)
- def __contains__(self, Key):
- FilePath = Key[0]
- if len(Key) > 1:
- Arch = Key[1]
- else:
- Arch = None
- return (FilePath, Arch) in self._CACHE_
-
- # key = (FilePath, Arch=None, Target=None, Toochain=None)
- def __getitem__(self, Key):
- FilePath = Key[0]
- KeyLength = len(Key)
- if KeyLength > 1:
- Arch = Key[1]
- else:
- Arch = None
- if KeyLength > 2:
- Target = Key[2]
- else:
- Target = None
- if KeyLength > 3:
- Toolchain = Key[3]
- else:
- Toolchain = None
-
- # if it's generated before, just return the cached one
- Key = (FilePath, Arch, Target, Toolchain)
- if Key in self._CACHE_:
- return self._CACHE_[Key]
-
- # check file type
- Ext = FilePath.Type
- if Ext not in self._FILE_TYPE_:
- return None
- FileType = self._FILE_TYPE_[Ext]
- if FileType not in self._GENERATOR_:
- return None
-
- # get the parser ready for this file
- MetaFile = self._FILE_PARSER_[FileType](
- FilePath,
- FileType,
- MetaFileStorage(self.WorkspaceDb.Cur, FilePath, FileType)
- )
- # alwasy do post-process, in case of macros change
- MetaFile.DoPostProcess()
- # object the build is based on
- BuildObject = self._GENERATOR_[FileType](
- FilePath,
- MetaFile,
- self,
- Arch,
- Target,
- Toolchain
- )
- self._CACHE_[Key] = BuildObject
- return BuildObject
-
- # placeholder for file format conversion
- class TransformObjectFactory:
- def __init__(self, WorkspaceDb):
- self.WorkspaceDb = WorkspaceDb
-
- # key = FilePath, Arch
- def __getitem__(self, Key):
- pass
-
- ## Constructor of WorkspaceDatabase
- #
- # @param DbPath Path of database file
- # @param GlobalMacros Global macros used for replacement during file parsing
- # @prarm RenewDb=False Create new database file if it's already there
- #
- def __init__(self, DbPath, RenewDb=False):
- self._DbClosedFlag = False
- if not DbPath:
- DbPath = os.path.normpath(os.path.join(GlobalData.gWorkspace, self._DB_PATH_))
-
- # don't create necessary path for db in memory
- if DbPath != ':memory:':
- DbDir = os.path.split(DbPath)[0]
- if not os.path.exists(DbDir):
- os.makedirs(DbDir)
-
- # remove db file in case inconsistency between db and file in file system
- if self._CheckWhetherDbNeedRenew(RenewDb, DbPath):
- os.remove(DbPath)
-
- # create db with optimized parameters
- self.Conn = sqlite3.connect(DbPath, isolation_level='DEFERRED')
- self.Conn.execute("PRAGMA synchronous=OFF")
- self.Conn.execute("PRAGMA temp_store=MEMORY")
- self.Conn.execute("PRAGMA count_changes=OFF")
- self.Conn.execute("PRAGMA cache_size=8192")
- #self.Conn.execute("PRAGMA page_size=8192")
-
- # to avoid non-ascii character conversion issue
- self.Conn.text_factory = str
- self.Cur = self.Conn.cursor()
-
- # create table for internal uses
- self.TblDataModel = TableDataModel(self.Cur)
- self.TblFile = TableFile(self.Cur)
- self.Platform = None
-
- # conversion object for build or file format conversion purpose
- self.BuildObject = WorkspaceDatabase.BuildObjectFactory(self)
- self.TransformObject = WorkspaceDatabase.TransformObjectFactory(self)
-
- ## Check whether workspace database need to be renew.
- # The renew reason maybe:
- # 1) If user force to renew;
- # 2) If user do not force renew, and
- # a) If the time of last modified python source is newer than database file;
- # b) If the time of last modified frozen executable file is newer than database file;
- #
- # @param force User force renew database
- # @param DbPath The absolute path of workspace database file
- #
- # @return Bool value for whether need renew workspace databse
- #
- def _CheckWhetherDbNeedRenew (self, force, DbPath):
- # if database does not exist, we need do nothing
- if not os.path.exists(DbPath): return False
-
- # if user force to renew database, then not check whether database is out of date
- if force: return True
-
- #
- # Check the time of last modified source file or build.exe
- # if is newer than time of database, then database need to be re-created.
- #
- timeOfToolModified = 0
- if hasattr(sys, "frozen"):
- exePath = os.path.abspath(sys.executable)
- timeOfToolModified = os.stat(exePath).st_mtime
- else:
- curPath = os.path.dirname(__file__) # curPath is the path of WorkspaceDatabase.py
- rootPath = os.path.split(curPath)[0] # rootPath is root path of python source, such as /BaseTools/Source/Python
- if rootPath == "" or rootPath == None:
- EdkLogger.verbose("\nFail to find the root path of build.exe or python sources, so can not \
-determine whether database file is out of date!\n")
-
- # walk the root path of source or build's binary to get the time last modified.
-
- for root, dirs, files in os.walk (rootPath):
- for dir in dirs:
- # bypass source control folder
- if dir.lower() in [".svn", "_svn", "cvs"]:
- dirs.remove(dir)
-
- for file in files:
- ext = os.path.splitext(file)[1]
- if ext.lower() == ".py": # only check .py files
- fd = os.stat(os.path.join(root, file))
- if timeOfToolModified < fd.st_mtime:
- timeOfToolModified = fd.st_mtime
- if timeOfToolModified > os.stat(DbPath).st_mtime:
- EdkLogger.verbose("\nWorkspace database is out of data!")
- return True
-
- return False
-
- ## Initialize build database
- def InitDatabase(self):
- EdkLogger.verbose("\nInitialize build database started ...")
-
- #
- # Create new tables
- #
- self.TblDataModel.Create(False)
- self.TblFile.Create(False)
-
- #
- # Initialize table DataModel
- #
- self.TblDataModel.InitTable()
- EdkLogger.verbose("Initialize build database ... DONE!")
-
- ## Query a table
- #
- # @param Table: The instance of the table to be queried
- #
- def QueryTable(self, Table):
- Table.Query()
-
- def __del__(self):
- self.Close()
-
- ## Close entire database
- #
- # Commit all first
- # Close the connection and cursor
- #
- def Close(self):
- if not self._DbClosedFlag:
- self.Conn.commit()
- self.Cur.close()
- self.Conn.close()
- self._DbClosedFlag = True
-
- ## Summarize all packages in the database
- def GetPackageList(self, Platform, Arch, TargetName, ToolChainTag):
- self.Platform = Platform
- PackageList =[]
- Pa = self.BuildObject[self.Platform, 'COMMON']
- #
- # Get Package related to Modules
- #
- for Module in Pa.Modules:
- ModuleObj = self.BuildObject[Module, Arch, TargetName, ToolChainTag]
- for Package in ModuleObj.Packages:
- if Package not in PackageList:
- PackageList.append(Package)
- #
- # Get Packages related to Libraries
- #
- for Lib in Pa.LibraryInstances:
- LibObj = self.BuildObject[Lib, Arch, TargetName, ToolChainTag]
- for Package in LibObj.Packages:
- if Package not in PackageList:
- PackageList.append(Package)
-
- return PackageList
-
- ## Summarize all platforms in the database
- def _GetPlatformList(self):
- PlatformList = []
- for PlatformFile in self.TblFile.GetFileList(MODEL_FILE_DSC):
- try:
- Platform = self.BuildObject[PathClass(PlatformFile), 'COMMON']
- except:
- Platform = None
- if Platform != None:
- PlatformList.append(Platform)
- return PlatformList
-
- PlatformList = property(_GetPlatformList)
-
-##
-#
-# This acts like the main() function for the script, unless it is 'import'ed into another
-# script.
-#
-if __name__ == '__main__':
- pass
-
diff --git a/BaseTools/Source/Python/Workspace/__init__.py b/BaseTools/Source/Python/Workspace/__init__.py
deleted file mode 100644
index 05cd34bad5..0000000000
--- a/BaseTools/Source/Python/Workspace/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'Workspace' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
deleted file mode 100644
index 2058a7bae7..0000000000
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ /dev/null
@@ -1,1576 +0,0 @@
-## @file
-# Routines for generating build report.
-#
-# This module contains the functionality to generate build report after
-# build all target completes successfully.
-#
-# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-## Import Modules
-#
-import os
-import re
-import platform
-import textwrap
-import traceback
-import sys
-import time
-import struct
-from datetime import datetime
-from StringIO import StringIO
-from Common import EdkLogger
-from Common.Misc import SaveFileOnChange
-from Common.Misc import GuidStructureByteArrayToGuidString
-from Common.Misc import GuidStructureStringToGuidString
-from Common.InfClassObject import gComponentType2ModuleType
-from Common.BuildToolError import FILE_WRITE_FAILURE
-from Common.BuildToolError import CODE_ERROR
-from Common.DataType import TAB_LINE_BREAK
-from Common.DataType import TAB_DEPEX
-from Common.DataType import TAB_SLASH
-from Common.DataType import TAB_SPACE_SPLIT
-from Common.DataType import TAB_BRG_PCD
-from Common.DataType import TAB_BRG_LIBRARY
-from Common.DataType import TAB_BACK_SLASH
-
-## Pattern to extract contents in EDK DXS files
-gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL)
-
-## Pattern to find total FV total size, occupied size in flash report intermediate file
-gFvTotalSizePattern = re.compile(r"EFI_FV_TOTAL_SIZE = (0x[0-9a-fA-F]+)")
-gFvTakenSizePattern = re.compile(r"EFI_FV_TAKEN_SIZE = (0x[0-9a-fA-F]+)")
-
-## Pattern to find module size and time stamp in module summary report intermediate file
-gModuleSizePattern = re.compile(r"MODULE_SIZE = (\d+)")
-gTimeStampPattern = re.compile(r"TIME_STAMP = (\d+)")
-
-## Pattern to find GUID value in flash description files
-gPcdGuidPattern = re.compile(r"PCD\((\w+)[.](\w+)\)")
-
-## Pattern to collect offset, GUID value pair in the flash report intermediate file
-gOffsetGuidPattern = re.compile(r"(0x[0-9A-Fa-f]+) ([-A-Fa-f0-9]+)")
-
-## Pattern to find module base address and entry point in fixed flash map file
-gModulePattern = r"\n[-\w]+\s*\(([^,]+),\s*BaseAddress=%(Address)s,\s*EntryPoint=%(Address)s\)\s*\(GUID=([-0-9A-Fa-f]+)[^)]*\)"
-gMapFileItemPattern = re.compile(gModulePattern % {"Address" : "(-?0[xX][0-9A-Fa-f]+)"})
-
-## Pattern to find all module referenced header files in source files
-gIncludePattern = re.compile(r'#include\s*["<]([^">]+)[">]')
-gIncludePattern2 = re.compile(r"#include\s+EFI_([A-Z_]+)\s*[(]\s*(\w+)\s*[)]")
-
-## Pattern to find the entry point for EDK module using EDKII Glue library
-gGlueLibEntryPoint = re.compile(r"__EDKII_GLUE_MODULE_ENTRY_POINT__\s*=\s*(\w+)")
-
-## Tags for MaxLength of line in report
-gLineMaxLength = 120
-
-## Tags for end of line in report
-gEndOfLine = "\r\n"
-
-## Tags for section start, end and separator
-gSectionStart = ">" + "=" * (gLineMaxLength-2) + "<"
-gSectionEnd = "<" + "=" * (gLineMaxLength-2) + ">" + "\n"
-gSectionSep = "=" * gLineMaxLength
-
-## Tags for subsection start, end and separator
-gSubSectionStart = ">" + "-" * (gLineMaxLength-2) + "<"
-gSubSectionEnd = "<" + "-" * (gLineMaxLength-2) + ">"
-gSubSectionSep = "-" * gLineMaxLength
-
-
-## The look up table to map PCD type to pair of report display type and DEC type
-gPcdTypeMap = {
- 'FixedAtBuild' : ('FIXED', 'FixedAtBuild'),
- 'PatchableInModule': ('PATCH', 'PatchableInModule'),
- 'FeatureFlag' : ('FLAG', 'FeatureFlag'),
- 'Dynamic' : ('DYN', 'Dynamic'),
- 'DynamicHii' : ('DYNHII', 'Dynamic'),
- 'DynamicVpd' : ('DYNVPD', 'Dynamic'),
- 'DynamicEx' : ('DEX', 'DynamicEx'),
- 'DynamicExHii' : ('DEXHII', 'DynamicEx'),
- 'DynamicExVpd' : ('DEXVPD', 'DynamicEx'),
- }
-
-## The look up table to map module type to driver type
-gDriverTypeMap = {
- 'SEC' : '0x3 (SECURITY_CORE)',
- 'PEI_CORE' : '0x4 (PEI_CORE)',
- 'PEIM' : '0x6 (PEIM)',
- 'DXE_CORE' : '0x5 (DXE_CORE)',
- 'DXE_DRIVER' : '0x7 (DRIVER)',
- 'DXE_SAL_DRIVER' : '0x7 (DRIVER)',
- 'DXE_SMM_DRIVER' : '0x7 (DRIVER)',
- 'DXE_RUNTIME_DRIVER': '0x7 (DRIVER)',
- 'UEFI_DRIVER' : '0x7 (DRIVER)',
- 'UEFI_APPLICATION' : '0x9 (APPLICATION)',
- 'SMM_CORE' : '0xD (SMM_CORE)',
- 'SMM_DRIVER' : '0xA (SMM)', # Extension of module type to support PI 1.1 SMM drivers
- }
-
-## The look up table of the supported opcode in the dependency expression binaries
-gOpCodeList = ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", "TRUE", "FALSE", "END", "SOR"]
-
-##
-# Writes a string to the file object.
-#
-# This function writes a string to the file object and a new line is appended
-# afterwards. It may optionally wraps the string for better readability.
-#
-# @File The file object to write
-# @String The string to be written to the file
-# @Wrapper Indicates whether to wrap the string
-#
-def FileWrite(File, String, Wrapper=False):
- if Wrapper:
- String = textwrap.fill(String, 120)
- File.write(String + gEndOfLine)
-
-##
-# Find all the header file that the module source directly includes.
-#
-# This function scans source code to find all header files the module may
-# include. This is not accurate but very effective to find all the header
-# file the module might include with #include statement.
-#
-# @Source The source file name
-# @IncludePathList The list of include path to find the source file.
-# @IncludeFiles The dictionary of current found include files.
-#
-def FindIncludeFiles(Source, IncludePathList, IncludeFiles):
- FileContents = open(Source).read()
- #
- # Find header files with pattern #include "XXX.h" or #include <XXX.h>
- #
- for Match in gIncludePattern.finditer(FileContents):
- FileName = Match.group(1).strip()
- for Dir in [os.path.dirname(Source)] + IncludePathList:
- FullFileName = os.path.normpath(os.path.join(Dir, FileName))
- if os.path.exists(FullFileName):
- IncludeFiles[FullFileName.lower().replace("\\", "/")] = FullFileName
- break
-
- #
- # Find header files with pattern like #include EFI_PPI_CONSUMER(XXX)
- #
- for Match in gIncludePattern2.finditer(FileContents):
- Key = Match.group(2)
- Type = Match.group(1)
- if "ARCH_PROTOCOL" in Type:
- FileName = "ArchProtocol/%(Key)s/%(Key)s.h" % {"Key" : Key}
- elif "PROTOCOL" in Type:
- FileName = "Protocol/%(Key)s/%(Key)s.h" % {"Key" : Key}
- elif "PPI" in Type:
- FileName = "Ppi/%(Key)s/%(Key)s.h" % {"Key" : Key}
- elif "GUID" in Type:
- FileName = "Guid/%(Key)s/%(Key)s.h" % {"Key" : Key}
- else:
- continue
- for Dir in IncludePathList:
- FullFileName = os.path.normpath(os.path.join(Dir, FileName))
- if os.path.exists(FullFileName):
- IncludeFiles[FullFileName.lower().replace("\\", "/")] = FullFileName
- break
-
-## Split each lines in file
-#
-# This method is used to split the lines in file to make the length of each line
-# less than MaxLength.
-#
-# @param Content The content of file
-# @param MaxLength The Max Length of the line
-#
-def FileLinesSplit(Content=None, MaxLength=None):
- ContentList = Content.split(TAB_LINE_BREAK)
- NewContent = ''
- NewContentList = []
- for Line in ContentList:
- while len(Line.rstrip()) > MaxLength:
- LineSpaceIndex = Line.rfind(TAB_SPACE_SPLIT, 0, MaxLength)
- LineSlashIndex = Line.rfind(TAB_SLASH, 0, MaxLength)
- LineBackSlashIndex = Line.rfind(TAB_BACK_SLASH, 0, MaxLength)
- if max(LineSpaceIndex, LineSlashIndex, LineBackSlashIndex) > 0:
- LineBreakIndex = max(LineSpaceIndex, LineSlashIndex, LineBackSlashIndex)
- else:
- LineBreakIndex = MaxLength
- NewContentList.append(Line[:LineBreakIndex])
- Line = Line[LineBreakIndex:]
- if Line:
- NewContentList.append(Line)
- for NewLine in NewContentList:
- NewContent += NewLine + TAB_LINE_BREAK
-
- NewContent = NewContent.replace(TAB_LINE_BREAK, gEndOfLine).replace('\r\r\n', gEndOfLine)
- return NewContent
-
-
-
-##
-# Parse binary dependency expression section
-#
-# This utility class parses the dependency expression section and translate the readable
-# GUID name and value.
-#
-class DepexParser(object):
- ##
- # Constructor function for class DepexParser
- #
- # This constructor function collect GUID values so that the readable
- # GUID name can be translated.
- #
- # @param self The object pointer
- # @param Wa Workspace context information
- #
- def __init__(self, Wa):
- self._GuidDb = {}
- for Pa in Wa.AutoGenObjectList:
- for Package in Pa.PackageList:
- for Protocol in Package.Protocols:
- GuidValue = GuidStructureStringToGuidString(Package.Protocols[Protocol])
- self._GuidDb[GuidValue.upper()] = Protocol
- for Ppi in Package.Ppis:
- GuidValue = GuidStructureStringToGuidString(Package.Ppis[Ppi])
- self._GuidDb[GuidValue.upper()] = Ppi
- for Guid in Package.Guids:
- GuidValue = GuidStructureStringToGuidString(Package.Guids[Guid])
- self._GuidDb[GuidValue.upper()] = Guid
-
- ##
- # Parse the binary dependency expression files.
- #
- # This function parses the binary dependency expression file and translate it
- # to the instruction list.
- #
- # @param self The object pointer
- # @param DepexFileName The file name of binary dependency expression file.
- #
- def ParseDepexFile(self, DepexFileName):
- DepexFile = open(DepexFileName, "rb")
- DepexStatement = []
- OpCode = DepexFile.read(1)
- while OpCode:
- Statement = gOpCodeList[struct.unpack("B", OpCode)[0]]
- if Statement in ["BEFORE", "AFTER", "PUSH"]:
- GuidValue = "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X" % \
- struct.unpack("LHHBBBBBBBB", DepexFile.read(16))
- GuidString = self._GuidDb.get(GuidValue, GuidValue)
- Statement = "%s %s" % (Statement, GuidString)
- DepexStatement.append(Statement)
- OpCode = DepexFile.read(1)
-
- return DepexStatement
-
-##
-# Reports library information
-#
-# This class reports the module library subsection in the build report file.
-#
-class LibraryReport(object):
- ##
- # Constructor function for class LibraryReport
- #
- # This constructor function generates LibraryReport object for
- # a module.
- #
- # @param self The object pointer
- # @param M Module context information
- #
- def __init__(self, M):
- self.LibraryList = []
- if int(str(M.AutoGenVersion), 0) >= 0x00010005:
- self._EdkIIModule = True
- else:
- self._EdkIIModule = False
-
- for Lib in M.DependentLibraryList:
- LibInfPath = str(Lib)
- LibClassList = Lib.LibraryClass[0].LibraryClass
- LibConstructorList = Lib.ConstructorList
- LibDesstructorList = Lib.DestructorList
- LibDepexList = Lib.DepexExpression[M.Arch, M.ModuleType]
- self.LibraryList.append((LibInfPath, LibClassList, LibConstructorList, LibDesstructorList, LibDepexList))
-
- ##
- # Generate report for module library information
- #
- # This function generates report for the module library.
- # If the module is EDKII style one, the additional library class, library
- # constructor/destructor and dependency expression may also be reported.
- #
- # @param self The object pointer
- # @param File The file object for report
- #
- def GenerateReport(self, File):
- FileWrite(File, gSubSectionStart)
- FileWrite(File, TAB_BRG_LIBRARY)
- if len(self.LibraryList) > 0:
- FileWrite(File, gSubSectionSep)
- for LibraryItem in self.LibraryList:
- LibInfPath = LibraryItem[0]
- FileWrite(File, LibInfPath)
-
- #
- # Report library class, library constructor and destructor for
- # EDKII style module.
- #
- if self._EdkIIModule:
- LibClass = LibraryItem[1]
- EdkIILibInfo = ""
- LibConstructor = " ".join(LibraryItem[2])
- if LibConstructor:
- EdkIILibInfo += " C = " + LibConstructor
- LibDestructor = " ".join(LibraryItem[3])
- if LibDestructor:
- EdkIILibInfo += " D = " + LibDestructor
- LibDepex = " ".join(LibraryItem[4])
- if LibDepex:
- EdkIILibInfo += " Depex = " + LibDepex
- if EdkIILibInfo:
- FileWrite(File, "{%s: %s}" % (LibClass, EdkIILibInfo))
- else:
- FileWrite(File, "{%s}" % LibClass)
-
- FileWrite(File, gSubSectionEnd)
-
-##
-# Reports dependency expression information
-#
-# This class reports the module dependency expression subsection in the build report file.
-#
-class DepexReport(object):
- ##
- # Constructor function for class DepexReport
- #
- # This constructor function generates DepexReport object for
- # a module. If the module source contains the DXS file (usually EDK
- # style module), it uses the dependency in DXS file; otherwise,
- # it uses the dependency expression from its own INF [Depex] section
- # and then merges with the ones from its dependent library INF.
- #
- # @param self The object pointer
- # @param M Module context information
- #
- def __init__(self, M):
- self.Depex = ""
- self._DepexFileName = os.path.join(M.BuildDir, "OUTPUT", M.Module.BaseName + ".depex")
- ModuleType = M.ModuleType
- if not ModuleType:
- ModuleType = gComponentType2ModuleType.get(M.ComponentType, "")
-
- if ModuleType in ["SEC", "PEI_CORE", "DXE_CORE", "SMM_CORE", "UEFI_APPLICATION"]:
- return
-
- for Source in M.SourceFileList:
- if os.path.splitext(Source.Path)[1].lower() == ".dxs":
- Match = gDxsDependencyPattern.search(open(Source.Path).read())
- if Match:
- self.Depex = Match.group(1).strip()
- self.Source = "DXS"
- break
- else:
- self.Depex = M.DepexExpressionList.get(M.ModuleType, "")
- self.ModuleDepex = " ".join(M.Module.DepexExpression[M.Arch, M.ModuleType])
- if not self.ModuleDepex:
- self.ModuleDepex = "(None)"
-
- LibDepexList = []
- for Lib in M.DependentLibraryList:
- LibDepex = " ".join(Lib.DepexExpression[M.Arch, M.ModuleType]).strip()
- if LibDepex != "":
- LibDepexList.append("(" + LibDepex + ")")
- self.LibraryDepex = " AND ".join(LibDepexList)
- if not self.LibraryDepex:
- self.LibraryDepex = "(None)"
- self.Source = "INF"
-
- ##
- # Generate report for module dependency expression information
- #
- # This function generates report for the module dependency expression.
- #
- # @param self The object pointer
- # @param File The file object for report
- # @param GlobalDepexParser The platform global Dependency expression parser object
- #
- def GenerateReport(self, File, GlobalDepexParser):
- if not self.Depex:
- FileWrite(File, gSubSectionStart)
- FileWrite(File, TAB_DEPEX)
- FileWrite(File, gSubSectionEnd)
- return
- FileWrite(File, gSubSectionStart)
- if os.path.isfile(self._DepexFileName):
- try:
- DepexStatements = GlobalDepexParser.ParseDepexFile(self._DepexFileName)
- FileWrite(File, "Final Dependency Expression (DEPEX) Instructions")
- for DepexStatement in DepexStatements:
- FileWrite(File, " %s" % DepexStatement)
- FileWrite(File, gSubSectionSep)
- except:
- EdkLogger.warn(None, "Dependency expression file is corrupted", self._DepexFileName)
-
- FileWrite(File, "Dependency Expression (DEPEX) from %s" % self.Source)
-
- if self.Source == "INF":
- FileWrite(File, "%s" % self.Depex, True)
- FileWrite(File, gSubSectionSep)
- FileWrite(File, "From Module INF: %s" % self.ModuleDepex, True)
- FileWrite(File, "From Library INF: %s" % self.LibraryDepex, True)
- else:
- FileWrite(File, "%s" % self.Depex)
- FileWrite(File, gSubSectionEnd)
-
-##
-# Reports dependency expression information
-#
-# This class reports the module build flags subsection in the build report file.
-#
-class BuildFlagsReport(object):
- ##
- # Constructor function for class BuildFlagsReport
- #
- # This constructor function generates BuildFlagsReport object for
- # a module. It reports the build tool chain tag and all relevant
- # build flags to build the module.
- #
- # @param self The object pointer
- # @param M Module context information
- #
- def __init__(self, M):
- BuildOptions = {}
- #
- # Add build flags according to source file extension so that
- # irrelevant ones can be filtered out.
- #
- for Source in M.SourceFileList:
- Ext = os.path.splitext(Source.File)[1].lower()
- if Ext in [".c", ".cc", ".cpp"]:
- BuildOptions["CC"] = 1
- elif Ext in [".s", ".asm"]:
- BuildOptions["PP"] = 1
- BuildOptions["ASM"] = 1
- elif Ext in [".vfr"]:
- BuildOptions["VFRPP"] = 1
- BuildOptions["VFR"] = 1
- elif Ext in [".dxs"]:
- BuildOptions["APP"] = 1
- BuildOptions["CC"] = 1
- elif Ext in [".asl"]:
- BuildOptions["ASLPP"] = 1
- BuildOptions["ASL"] = 1
- elif Ext in [".aslc"]:
- BuildOptions["ASLCC"] = 1
- BuildOptions["ASLDLINK"] = 1
- BuildOptions["CC"] = 1
- elif Ext in [".asm16"]:
- BuildOptions["ASMLINK"] = 1
- BuildOptions["SLINK"] = 1
- BuildOptions["DLINK"] = 1
-
- #
- # Save module build flags.
- #
- self.ToolChainTag = M.ToolChain
- self.BuildFlags = {}
- for Tool in BuildOptions:
- self.BuildFlags[Tool + "_FLAGS"] = M.BuildOption.get(Tool, {}).get("FLAGS", "")
-
- ##
- # Generate report for module build flags information
- #
- # This function generates report for the module build flags expression.
- #
- # @param self The object pointer
- # @param File The file object for report
- #
- def GenerateReport(self, File):
- FileWrite(File, gSubSectionStart)
- FileWrite(File, "Build Flags")
- FileWrite(File, "Tool Chain Tag: %s" % self.ToolChainTag)
- for Tool in self.BuildFlags:
- FileWrite(File, gSubSectionSep)
- FileWrite(File, "%s = %s" % (Tool, self.BuildFlags[Tool]), True)
-
- FileWrite(File, gSubSectionEnd)
-
-
-##
-# Reports individual module information
-#
-# This class reports the module section in the build report file.
-# It comprises of module summary, module PCD, library, dependency expression,
-# build flags sections.
-#
-class ModuleReport(object):
- ##
- # Constructor function for class ModuleReport
- #
- # This constructor function generates ModuleReport object for
- # a separate module in a platform build.
- #
- # @param self The object pointer
- # @param M Module context information
- # @param ReportType The kind of report items in the final report file
- #
- def __init__(self, M, ReportType):
- self.ModuleName = M.Module.BaseName
- self.ModuleInfPath = M.MetaFile.File
- self.FileGuid = M.Guid
- self.Size = 0
- self.BuildTimeStamp = None
- self.DriverType = ""
- if not M.IsLibrary:
- ModuleType = M.ModuleType
- if not ModuleType:
- ModuleType = gComponentType2ModuleType.get(M.ComponentType, "")
- #
- # If a module complies to PI 1.1, promote Module type to "SMM_DRIVER"
- #
- if ModuleType == "DXE_SMM_DRIVER":
- PiSpec = M.Module.Specification.get("PI_SPECIFICATION_VERSION", "0x00010000")
- if int(PiSpec, 0) >= 0x0001000A:
- ModuleType = "SMM_DRIVER"
- self.DriverType = gDriverTypeMap.get(ModuleType, "0x2 (FREE_FORM)")
- self.UefiSpecVersion = M.Module.Specification.get("UEFI_SPECIFICATION_VERSION", "")
- self.PiSpecVersion = M.Module.Specification.get("PI_SPECIFICATION_VERSION", "")
- self.PciDeviceId = M.Module.Defines.get("PCI_DEVICE_ID", "")
- self.PciVendorId = M.Module.Defines.get("PCI_VENDOR_ID", "")
- self.PciClassCode = M.Module.Defines.get("PCI_CLASS_CODE", "")
-
- self._BuildDir = M.BuildDir
- self.ModulePcdSet = {}
- if "PCD" in ReportType:
- #
- # Collect all module used PCD set: module INF referenced directly or indirectly.
- # It also saves module INF default values of them in case they exist.
- #
- for Pcd in M.ModulePcdList + M.LibraryPcdList:
- self.ModulePcdSet.setdefault((Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Type), (Pcd.InfDefaultValue, Pcd.DefaultValue))
-
- self.LibraryReport = None
- if "LIBRARY" in ReportType:
- self.LibraryReport = LibraryReport(M)
-
- self.DepexReport = None
- if "DEPEX" in ReportType:
- self.DepexReport = DepexReport(M)
-
- if "BUILD_FLAGS" in ReportType:
- self.BuildFlagsReport = BuildFlagsReport(M)
-
-
- ##
- # Generate report for module information
- #
- # This function generates report for separate module expression
- # in a platform build.
- #
- # @param self The object pointer
- # @param File The file object for report
- # @param GlobalPcdReport The platform global PCD report object
- # @param GlobalPredictionReport The platform global Prediction report object
- # @param GlobalDepexParser The platform global Dependency expression parser object
- # @param ReportType The kind of report items in the final report file
- #
- def GenerateReport(self, File, GlobalPcdReport, GlobalPredictionReport, GlobalDepexParser, ReportType):
- FileWrite(File, gSectionStart)
-
- FwReportFileName = os.path.join(self._BuildDir, "DEBUG", self.ModuleName + ".txt")
- if os.path.isfile(FwReportFileName):
- try:
- FileContents = open(FwReportFileName).read()
- Match = gModuleSizePattern.search(FileContents)
- if Match:
- self.Size = int(Match.group(1))
-
- Match = gTimeStampPattern.search(FileContents)
- if Match:
- self.BuildTimeStamp = datetime.fromtimestamp(int(Match.group(1)))
- except IOError:
- EdkLogger.warn(None, "Fail to read report file", FwReportFileName)
-
- FileWrite(File, "Module Summary")
- FileWrite(File, "Module Name: %s" % self.ModuleName)
- FileWrite(File, "Module INF Path: %s" % self.ModuleInfPath)
- FileWrite(File, "File GUID: %s" % self.FileGuid)
- if self.Size:
- FileWrite(File, "Size: 0x%X (%.2fK)" % (self.Size, self.Size / 1024.0))
- if self.BuildTimeStamp:
- FileWrite(File, "Build Time Stamp: %s" % self.BuildTimeStamp)
- if self.DriverType:
- FileWrite(File, "Driver Type: %s" % self.DriverType)
- if self.UefiSpecVersion:
- FileWrite(File, "UEFI Spec Version: %s" % self.UefiSpecVersion)
- if self.PiSpecVersion:
- FileWrite(File, "PI Spec Version: %s" % self.PiSpecVersion)
- if self.PciDeviceId:
- FileWrite(File, "PCI Device ID: %s" % self.PciDeviceId)
- if self.PciVendorId:
- FileWrite(File, "PCI Vendor ID: %s" % self.PciVendorId)
- if self.PciClassCode:
- FileWrite(File, "PCI Class Code: %s" % self.PciClassCode)
-
- FileWrite(File, gSectionSep)
-
- if "PCD" in ReportType:
- GlobalPcdReport.GenerateReport(File, self.ModulePcdSet)
-
- if "LIBRARY" in ReportType:
- self.LibraryReport.GenerateReport(File)
-
- if "DEPEX" in ReportType:
- self.DepexReport.GenerateReport(File, GlobalDepexParser)
-
- if "BUILD_FLAGS" in ReportType:
- self.BuildFlagsReport.GenerateReport(File)
-
- if "FIXED_ADDRESS" in ReportType and self.FileGuid:
- GlobalPredictionReport.GenerateReport(File, self.FileGuid)
-
- FileWrite(File, gSectionEnd)
-
-##
-# Reports platform and module PCD information
-#
-# This class reports the platform PCD section and module PCD subsection
-# in the build report file.
-#
-class PcdReport(object):
- ##
- # Constructor function for class PcdReport
- #
- # This constructor function generates PcdReport object a platform build.
- # It collects the whole PCD database from platform DSC files, platform
- # flash description file and package DEC files.
- #
- # @param self The object pointer
- # @param Wa Workspace context information
- #
- def __init__(self, Wa):
- self.AllPcds = {}
- self.MaxLen = 0
- if Wa.FdfProfile:
- self.FdfPcdSet = Wa.FdfProfile.PcdDict
- else:
- self.FdfPcdSet = {}
-
- self.ModulePcdOverride = {}
- for Pa in Wa.AutoGenObjectList:
- #
- # Collect all platform referenced PCDs and grouped them by PCD token space
- # GUID C Names
- #
- for Pcd in Pa.AllPcdList:
- PcdList = self.AllPcds.setdefault(Pcd.TokenSpaceGuidCName, {}).setdefault(Pcd.Type, [])
- if Pcd not in PcdList:
- PcdList.append(Pcd)
- if len(Pcd.TokenCName) > self.MaxLen:
- self.MaxLen = len(Pcd.TokenCName)
-
- for Module in Pa.Platform.Modules.values():
- #
- # Collect module override PCDs
- #
- for ModulePcd in Module.M.ModulePcdList + Module.M.LibraryPcdList:
- TokenCName = ModulePcd.TokenCName
- TokenSpaceGuid = ModulePcd.TokenSpaceGuidCName
- ModuleDefault = ModulePcd.DefaultValue
- ModulePath = os.path.basename(Module.M.MetaFile.File)
- self.ModulePcdOverride.setdefault((TokenCName, TokenSpaceGuid), {})[ModulePath] = ModuleDefault
-
-
- #
- # Collect PCD DEC default value.
- #
- self.DecPcdDefault = {}
- for Pa in Wa.AutoGenObjectList:
- for Package in Pa.PackageList:
- for (TokenCName, TokenSpaceGuidCName, DecType) in Package.Pcds:
- DecDefaultValue = Package.Pcds[TokenCName, TokenSpaceGuidCName, DecType].DefaultValue
- self.DecPcdDefault.setdefault((TokenCName, TokenSpaceGuidCName, DecType), DecDefaultValue)
- #
- # Collect PCDs defined in DSC common section
- #
- self.DscPcdDefault = {}
- for Arch in Wa.ArchList:
- Platform = Wa.BuildDatabase[Wa.MetaFile, Arch, Wa.BuildTarget, Wa.ToolChain]
- for (TokenCName, TokenSpaceGuidCName) in Platform.Pcds:
- DscDefaultValue = Platform.Pcds[(TokenCName, TokenSpaceGuidCName)].DefaultValue
- if DscDefaultValue:
- self.DscPcdDefault[(TokenCName, TokenSpaceGuidCName)] = DscDefaultValue
-
- ##
- # Generate report for PCD information
- #
- # This function generates report for separate module expression
- # in a platform build.
- #
- # @param self The object pointer
- # @param File The file object for report
- # @param ModulePcdSet Set of all PCDs referenced by module or None for
- # platform PCD report
- # @param DscOverridePcds Module DSC override PCDs set
- #
- def GenerateReport(self, File, ModulePcdSet):
- if ModulePcdSet == None:
- #
- # For platform global PCD section
- #
- FileWrite(File, gSectionStart)
- FileWrite(File, "Platform Configuration Database Report")
- FileWrite(File, " *P - Platform scoped PCD override in DSC file")
- FileWrite(File, " *F - Platform scoped PCD override in FDF file")
- FileWrite(File, " *M - Module scoped PCD override")
- FileWrite(File, gSectionSep)
- else:
- #
- # For module PCD sub-section
- #
- FileWrite(File, gSubSectionStart)
- FileWrite(File, TAB_BRG_PCD)
- FileWrite(File, gSubSectionSep)
-
- for Key in self.AllPcds:
- #
- # Group PCD by their token space GUID C Name
- #
- First = True
- for Type in self.AllPcds[Key]:
- #
- # Group PCD by their usage type
- #
- TypeName, DecType = gPcdTypeMap.get(Type, ("", Type))
- for Pcd in self.AllPcds[Key][Type]:
- #
- # Get PCD default value and their override relationship
- #
- DecDefaultValue = self.DecPcdDefault.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName, DecType))
- DscDefaultValue = self.DscPcdDefault.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName))
- DscDefaultValue = self.FdfPcdSet.get((Pcd.TokenCName, Key), DscDefaultValue)
- InfDefaultValue = None
-
- PcdValue = DecDefaultValue
- if DscDefaultValue:
- PcdValue = DscDefaultValue
- if ModulePcdSet != None:
- if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type) not in ModulePcdSet:
- continue
- InfDefault, PcdValue = ModulePcdSet[Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type]
- if InfDefault == "":
- InfDefault = None
- if First:
- if ModulePcdSet == None:
- FileWrite(File, "")
- FileWrite(File, Key)
- First = False
-
-
- if Pcd.DatumType in ('UINT8', 'UINT16', 'UINT32', 'UINT64'):
- PcdValueNumber = int(PcdValue.strip(), 0)
- if DecDefaultValue == None:
- DecMatch = True
- else:
- DecDefaultValueNumber = int(DecDefaultValue.strip(), 0)
- DecMatch = (DecDefaultValueNumber == PcdValueNumber)
-
- if InfDefaultValue == None:
- InfMatch = True
- else:
- InfDefaultValueNumber = int(InfDefaultValue.strip(), 0)
- InfMatch = (InfDefaultValueNumber == PcdValueNumber)
-
- if DscDefaultValue == None:
- DscMatch = True
- else:
- DscDefaultValueNumber = int(DscDefaultValue.strip(), 0)
- DscMatch = (DscDefaultValueNumber == PcdValueNumber)
- else:
- if DecDefaultValue == None:
- DecMatch = True
- else:
- DecMatch = (DecDefaultValue.strip() == PcdValue.strip())
-
- if InfDefaultValue == None:
- InfMatch = True
- else:
- InfMatch = (InfDefaultValue.strip() == PcdValue.strip())
-
- if DscDefaultValue == None:
- DscMatch = True
- else:
- DscMatch = (DscDefaultValue.strip() == PcdValue.strip())
-
- #
- # Report PCD item according to their override relationship
- #
- if DecMatch and InfMatch:
- FileWrite(File, ' %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
- else:
- if DscMatch:
- if (Pcd.TokenCName, Key) in self.FdfPcdSet:
- FileWrite(File, ' *F %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
- else:
- FileWrite(File, ' *P %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
- else:
- FileWrite(File, ' *M %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
-
- if TypeName in ('DYNHII', 'DEXHII', 'DYNVPD', 'DEXVPD'):
- for SkuInfo in Pcd.SkuInfoList.values():
- if TypeName in ('DYNHII', 'DEXHII'):
- FileWrite(File, '%*s: %s: %s' % (self.MaxLen + 4, SkuInfo.VariableGuid, SkuInfo.VariableName, SkuInfo.VariableOffset))
- else:
- FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset))
-
- if not DscMatch and DscDefaultValue != None:
- FileWrite(File, ' %*s = %s' % (self.MaxLen + 19, 'DSC DEFAULT', DscDefaultValue.strip()))
-
- if not InfMatch and InfDefaultValue != None:
- FileWrite(File, ' %*s = %s' % (self.MaxLen + 19, 'INF DEFAULT', InfDefaultValue.strip()))
-
- if not DecMatch and DecDefaultValue != None:
- FileWrite(File, ' %*s = %s' % (self.MaxLen + 19, 'DEC DEFAULT', DecDefaultValue.strip()))
-
- if ModulePcdSet == None:
- ModuleOverride = self.ModulePcdOverride.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName), {})
- for ModulePath in ModuleOverride:
- ModuleDefault = ModuleOverride[ModulePath]
- if Pcd.DatumType in ('UINT8', 'UINT16', 'UINT32', 'UINT64'):
- ModulePcdDefaultValueNumber = int(ModuleDefault.strip(), 0)
- Match = (ModulePcdDefaultValueNumber == PcdValueNumber)
- else:
- Match = (ModuleDefault.strip() == PcdValue.strip())
- if Match:
- continue
- FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 19, ModulePath, ModuleDefault.strip()))
-
- if ModulePcdSet == None:
- FileWrite(File, gSectionEnd)
- else:
- FileWrite(File, gSubSectionEnd)
-
-
-
-##
-# Reports platform and module Prediction information
-#
-# This class reports the platform execution order prediction section and
-# module load fixed address prediction subsection in the build report file.
-#
-class PredictionReport(object):
- ##
- # Constructor function for class PredictionReport
- #
- # This constructor function generates PredictionReport object for the platform.
- #
- # @param self: The object pointer
- # @param Wa Workspace context information
- #
- def __init__(self, Wa):
- self._MapFileName = os.path.join(Wa.BuildDir, Wa.Name + ".map")
- self._MapFileParsed = False
- self._EotToolInvoked = False
- self._FvDir = Wa.FvDir
- self._EotDir = Wa.BuildDir
- self._FfsEntryPoint = {}
- self._GuidMap = {}
- self._SourceList = []
- self.FixedMapDict = {}
- self.ItemList = []
- self.MaxLen = 0
-
- #
- # Collect all platform reference source files and GUID C Name
- #
- for Pa in Wa.AutoGenObjectList:
- for Module in Pa.LibraryAutoGenList + Pa.ModuleAutoGenList:
- #
- # BASE typed modules are EFI agnostic, so we need not scan
- # their source code to find PPI/Protocol produce or consume
- # information.
- #
- if Module.ModuleType == "BASE":
- continue
- #
- # Add module referenced source files
- #
- self._SourceList.append(str(Module))
- IncludeList = {}
- for Source in Module.SourceFileList:
- if os.path.splitext(str(Source))[1].lower() == ".c":
- self._SourceList.append(" " + str(Source))
- FindIncludeFiles(Source.Path, Module.IncludePathList, IncludeList)
- for IncludeFile in IncludeList.values():
- self._SourceList.append(" " + IncludeFile)
-
- for Guid in Module.PpiList:
- self._GuidMap[Guid] = GuidStructureStringToGuidString(Module.PpiList[Guid])
- for Guid in Module.ProtocolList:
- self._GuidMap[Guid] = GuidStructureStringToGuidString(Module.ProtocolList[Guid])
- for Guid in Module.GuidList:
- self._GuidMap[Guid] = GuidStructureStringToGuidString(Module.GuidList[Guid])
-
- if Module.Guid and not Module.IsLibrary:
- EntryPoint = " ".join(Module.Module.ModuleEntryPointList)
- if int(str(Module.AutoGenVersion), 0) >= 0x00010005:
- RealEntryPoint = "_ModuleEntryPoint"
- else:
- RealEntryPoint = EntryPoint
- if EntryPoint == "_ModuleEntryPoint":
- CCFlags = Module.BuildOption.get("CC", {}).get("FLAGS", "")
- Match = gGlueLibEntryPoint.search(CCFlags)
- if Match:
- EntryPoint = Match.group(1)
-
- self._FfsEntryPoint[Module.Guid.upper()] = (EntryPoint, RealEntryPoint)
-
-
- #
- # Collect platform firmware volume list as the input of EOT.
- #
- self._FvList = []
- if Wa.FdfProfile:
- for Fd in Wa.FdfProfile.FdDict:
- for FdRegion in Wa.FdfProfile.FdDict[Fd].RegionList:
- if FdRegion.RegionType != "FV":
- continue
- for FvName in FdRegion.RegionDataList:
- if FvName in self._FvList:
- continue
- self._FvList.append(FvName)
- for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:
- for Section in Ffs.SectionList:
- try:
- for FvSection in Section.SectionList:
- if FvSection.FvName in self._FvList:
- continue
- self._FvList.append(FvSection.FvName)
- except AttributeError:
- pass
-
-
- ##
- # Parse platform fixed address map files
- #
- # This function parses the platform final fixed address map file to get
- # the database of predicted fixed address for module image base, entry point
- # etc.
- #
- # @param self: The object pointer
- #
- def _ParseMapFile(self):
- if self._MapFileParsed:
- return
- self._MapFileParsed = True
- if os.path.isfile(self._MapFileName):
- try:
- FileContents = open(self._MapFileName).read()
- for Match in gMapFileItemPattern.finditer(FileContents):
- AddressType = Match.group(1)
- BaseAddress = Match.group(2)
- EntryPoint = Match.group(3)
- Guid = Match.group(4).upper()
- List = self.FixedMapDict.setdefault(Guid, [])
- List.append((AddressType, BaseAddress, "*I"))
- List.append((AddressType, EntryPoint, "*E"))
- except:
- EdkLogger.warn(None, "Cannot open file to read", self._MapFileName)
-
- ##
- # Invokes EOT tool to get the predicted the execution order.
- #
- # This function invokes EOT tool to calculate the predicted dispatch order
- #
- # @param self: The object pointer
- #
- def _InvokeEotTool(self):
- if self._EotToolInvoked:
- return
-
- self._EotToolInvoked = True
- FvFileList = []
- for FvName in self._FvList:
- FvFile = os.path.join(self._FvDir, FvName + ".Fv")
- if os.path.isfile(FvFile):
- FvFileList.append(FvFile)
-
- if len(FvFileList) == 0:
- return
- #
- # Write source file list and GUID file list to an intermediate file
- # as the input for EOT tool and dispatch List as the output file
- # from EOT tool.
- #
- SourceList = os.path.join(self._EotDir, "SourceFile.txt")
- GuidList = os.path.join(self._EotDir, "GuidList.txt")
- DispatchList = os.path.join(self._EotDir, "Dispatch.txt")
-
- TempFile = open(SourceList, "w+")
- for Item in self._SourceList:
- FileWrite(TempFile, Item)
- TempFile.close()
- TempFile = open(GuidList, "w+")
- for Key in self._GuidMap:
- FileWrite(TempFile, "%s %s" % (Key, self._GuidMap[Key]))
- TempFile.close()
-
- try:
- from Eot.Eot import Eot
-
- #
- # Invoke EOT tool and echo its runtime performance
- #
- EotStartTime = time.time()
- Eot(CommandLineOption=False, SourceFileList=SourceList, GuidList=GuidList,
- FvFileList=' '.join(FvFileList), Dispatch=DispatchList, IsInit=True)
- EotEndTime = time.time()
- EotDuration = time.strftime("%H:%M:%S", time.gmtime(int(round(EotEndTime - EotStartTime))))
- EdkLogger.quiet("EOT run time: %s\n" % EotDuration)
-
- #
- # Parse the output of EOT tool
- #
- for Line in open(DispatchList):
- if len(Line.split()) < 4:
- continue
- (Guid, Phase, FfsName, FilePath) = Line.split()
- Symbol = self._FfsEntryPoint.get(Guid, [FfsName, ""])[0]
- if len(Symbol) > self.MaxLen:
- self.MaxLen = len(Symbol)
- self.ItemList.append((Phase, Symbol, FilePath))
- except:
- EdkLogger.quiet("(Python %s on %s\n%s)" % (platform.python_version(), sys.platform, traceback.format_exc()))
- EdkLogger.warn(None, "Failed to generate execution order prediction report, for some error occurred in executing EOT.")
-
-
- ##
- # Generate platform execution order report
- #
- # This function generates the predicted module execution order.
- #
- # @param self The object pointer
- # @param File The file object for report
- #
- def _GenerateExecutionOrderReport(self, File):
- self._InvokeEotTool()
- if len(self.ItemList) == 0:
- return
- FileWrite(File, gSectionStart)
- FileWrite(File, "Execution Order Prediction")
- FileWrite(File, "*P PEI phase")
- FileWrite(File, "*D DXE phase")
- FileWrite(File, "*E Module INF entry point name")
- FileWrite(File, "*N Module notification function name")
-
- FileWrite(File, "Type %-*s %s" % (self.MaxLen, "Symbol", "Module INF Path"))
- FileWrite(File, gSectionSep)
- for Item in self.ItemList:
- FileWrite(File, "*%sE %-*s %s" % (Item[0], self.MaxLen, Item[1], Item[2]))
-
- FileWrite(File, gSectionStart)
-
- ##
- # Generate Fixed Address report.
- #
- # This function generate the predicted fixed address report for a module
- # specified by Guid.
- #
- # @param self The object pointer
- # @param File The file object for report
- # @param Guid The module Guid value.
- # @param NotifyList The list of all notify function in a module
- #
- def _GenerateFixedAddressReport(self, File, Guid, NotifyList):
- self._ParseMapFile()
- FixedAddressList = self.FixedMapDict.get(Guid)
- if not FixedAddressList:
- return
-
- FileWrite(File, gSubSectionStart)
- FileWrite(File, "Fixed Address Prediction")
- FileWrite(File, "*I Image Loading Address")
- FileWrite(File, "*E Entry Point Address")
- FileWrite(File, "*N Notification Function Address")
- FileWrite(File, "*F Flash Address")
- FileWrite(File, "*M Memory Address")
- FileWrite(File, "*S SMM RAM Offset")
- FileWrite(File, "TOM Top of Memory")
-
- FileWrite(File, "Type Address Name")
- FileWrite(File, gSubSectionSep)
- for Item in FixedAddressList:
- Type = Item[0]
- Value = Item[1]
- Symbol = Item[2]
- if Symbol == "*I":
- Name = "(Image Base)"
- elif Symbol == "*E":
- Name = self._FfsEntryPoint.get(Guid, ["", "_ModuleEntryPoint"])[1]
- elif Symbol in NotifyList:
- Name = Symbol
- Symbol = "*N"
- else:
- continue
-
- if "Flash" in Type:
- Symbol += "F"
- elif "Memory" in Type:
- Symbol += "M"
- else:
- Symbol += "S"
-
- if Value[0] == "-":
- Value = "TOM" + Value
-
- FileWrite(File, "%s %-16s %s" % (Symbol, Value, Name))
-
- ##
- # Generate report for the prediction part
- #
- # This function generate the predicted fixed address report for a module or
- # predicted module execution order for a platform.
- # If the input Guid is None, then, it generates the predicted module execution order;
- # otherwise it generated the module fixed loading address for the module specified by
- # Guid.
- #
- # @param self The object pointer
- # @param File The file object for report
- # @param Guid The module Guid value.
- #
- def GenerateReport(self, File, Guid):
- if Guid:
- self._GenerateFixedAddressReport(File, Guid.upper(), [])
- else:
- self._GenerateExecutionOrderReport(File)
-
-##
-# Reports FD region information
-#
-# This class reports the FD subsection in the build report file.
-# It collects region information of platform flash device.
-# If the region is a firmware volume, it lists the set of modules
-# and its space information; otherwise, it only lists its region name,
-# base address and size in its sub-section header.
-# If there are nesting FVs, the nested FVs will list immediate after
-# this FD region subsection
-#
-class FdRegionReport(object):
- ##
- # Discover all the nested FV name list.
- #
- # This is an internal worker function to discover the all the nested FV information
- # in the parent firmware volume. It uses deep first search algorithm recursively to
- # find all the FV list name and append them to the list.
- #
- # @param self The object pointer
- # @param FvName The name of current firmware file system
- # @param Wa Workspace context information
- #
- def _DiscoverNestedFvList(self, FvName, Wa):
- for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:
- for Section in Ffs.SectionList:
- try:
- for FvSection in Section.SectionList:
- if FvSection.FvName in self.FvList:
- continue
- self._GuidsDb[Ffs.NameGuid.upper()] = FvSection.FvName
- self.FvList.append(FvSection.FvName)
- self.FvInfo[FvSection.FvName] = ("Nested FV", 0, 0)
- self._DiscoverNestedFvList(FvSection.FvName, Wa)
- except AttributeError:
- pass
-
- ##
- # Constructor function for class FdRegionReport
- #
- # This constructor function generates FdRegionReport object for a specified FdRegion.
- # If the FdRegion is a firmware volume, it will recursively find all its nested Firmware
- # volume list. This function also collects GUID map in order to dump module identification
- # in the final report.
- #
- # @param self: The object pointer
- # @param FdRegion The current FdRegion object
- # @param Wa Workspace context information
- #
- def __init__(self, FdRegion, Wa):
- self.Type = FdRegion.RegionType
- self.BaseAddress = FdRegion.Offset
- self.Size = FdRegion.Size
- self.FvList = []
- self.FvInfo = {}
- self._GuidsDb = {}
- self._FvDir = Wa.FvDir
-
- #
- # If the input FdRegion is not a firmware volume,
- # we are done.
- #
- if self.Type != "FV":
- return
-
- #
- # Find all nested FVs in the FdRegion
- #
- for FvName in FdRegion.RegionDataList:
- if FvName in self.FvList:
- continue
- self.FvList.append(FvName)
- self.FvInfo[FvName] = ("Fd Region", self.BaseAddress, self.Size)
- self._DiscoverNestedFvList(FvName, Wa)
-
- PlatformPcds = {}
- #
- # Collect PCDs declared in DEC files.
- #
- for Pa in Wa.AutoGenObjectList:
- for Package in Pa.PackageList:
- for (TokenCName, TokenSpaceGuidCName, DecType) in Package.Pcds:
- DecDefaultValue = Package.Pcds[TokenCName, TokenSpaceGuidCName, DecType].DefaultValue
- PlatformPcds[(TokenCName, TokenSpaceGuidCName)] = DecDefaultValue
- #
- # Collect PCDs defined in DSC common section
- #
- for Platform in Wa.BuildDatabase.WorkspaceDb.PlatformList:
- for (TokenCName, TokenSpaceGuidCName) in Platform.Pcds:
- DscDefaultValue = Platform.Pcds[(TokenCName, TokenSpaceGuidCName)].DefaultValue
- PlatformPcds[(TokenCName, TokenSpaceGuidCName)] = DscDefaultValue
-
- #
- # Add PEI and DXE a priori files GUIDs defined in PI specification.
- #
- self._GuidsDb["1B45CC0A-156A-428A-AF62-49864DA0E6E6"] = "PEI Apriori"
- self._GuidsDb["FC510EE7-FFDC-11D4-BD41-0080C73C8881"] = "DXE Apriori"
- #
- # Add ACPI table storage file
- #
- self._GuidsDb["7E374E25-8E01-4FEE-87F2-390C23C606CD"] = "ACPI table storage"
-
- for Pa in Wa.AutoGenObjectList:
- for ModuleKey in Pa.Platform.Modules:
- M = Pa.Platform.Modules[ModuleKey].M
- InfPath = os.path.join(Wa.WorkspaceDir, M.MetaFile.File)
- self._GuidsDb[M.Guid.upper()] = "%s (%s)" % (M.Module.BaseName, InfPath)
-
- #
- # Collect the GUID map in the FV firmware volume
- #
- for FvName in self.FvList:
- for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:
- try:
- #
- # collect GUID map for binary EFI file in FDF file.
- #
- Guid = Ffs.NameGuid.upper()
- Match = gPcdGuidPattern.match(Ffs.NameGuid)
- if Match:
- PcdTokenspace = Match.group(1)
- PcdToken = Match.group(2)
- if (PcdToken, PcdTokenspace) in PlatformPcds:
- GuidValue = PlatformPcds[(PcdToken, PcdTokenspace)]
- Guid = GuidStructureByteArrayToGuidString(GuidValue).upper()
- for Section in Ffs.SectionList:
- try:
- ModuleSectFile = os.path.join(Wa.WorkspaceDir, Section.SectFileName)
- self._GuidsDb[Guid] = ModuleSectFile
- except AttributeError:
- pass
- except AttributeError:
- pass
-
-
- ##
- # Internal worker function to generate report for the FD region
- #
- # This internal worker function to generate report for the FD region.
- # It the type is firmware volume, it lists offset and module identification.
- #
- # @param self The object pointer
- # @param File The file object for report
- # @param Title The title for the FD subsection
- # @param BaseAddress The base address for the FD region
- # @param Size The size of the FD region
- # @param FvName The FV name if the FD region is a firmware volume
- #
- def _GenerateReport(self, File, Title, Type, BaseAddress, Size=0, FvName=None):
- FileWrite(File, gSubSectionStart)
- FileWrite(File, Title)
- FileWrite(File, "Type: %s" % Type)
- FileWrite(File, "Base Address: 0x%X" % BaseAddress)
-
- if self.Type == "FV":
- FvTotalSize = 0
- FvTakenSize = 0
- FvFreeSize = 0
- FvReportFileName = os.path.join(self._FvDir, FvName + ".Fv.txt")
- try:
- #
- # Collect size info in the firmware volume.
- #
- FvReport = open(FvReportFileName).read()
- Match = gFvTotalSizePattern.search(FvReport)
- if Match:
- FvTotalSize = int(Match.group(1), 16)
- Match = gFvTakenSizePattern.search(FvReport)
- if Match:
- FvTakenSize = int(Match.group(1), 16)
- FvFreeSize = FvTotalSize - FvTakenSize
- #
- # Write size information to the report file.
- #
- FileWrite(File, "Size: 0x%X (%.0fK)" % (FvTotalSize, FvTotalSize / 1024.0))
- FileWrite(File, "Fv Name: %s (%.1f%% Full)" % (FvName, FvTakenSize * 100.0 / FvTotalSize))
- FileWrite(File, "Occupied Size: 0x%X (%.0fK)" % (FvTakenSize, FvTakenSize / 1024.0))
- FileWrite(File, "Free Size: 0x%X (%.0fK)" % (FvFreeSize, FvFreeSize / 1024.0))
- FileWrite(File, "Offset Module")
- FileWrite(File, gSubSectionSep)
- #
- # Write module offset and module identification to the report file.
- #
- OffsetInfo = {}
- for Match in gOffsetGuidPattern.finditer(FvReport):
- Guid = Match.group(2).upper()
- OffsetInfo[Match.group(1)] = self._GuidsDb.get(Guid, Guid)
- OffsetList = OffsetInfo.keys()
- OffsetList.sort()
- for Offset in OffsetList:
- FileWrite (File, "%s %s" % (Offset, OffsetInfo[Offset]))
- except IOError:
- EdkLogger.warn(None, "Fail to read report file", FvReportFileName)
- else:
- FileWrite(File, "Size: 0x%X (%.0fK)" % (Size, Size / 1024.0))
- FileWrite(File, gSubSectionEnd)
-
- ##
- # Generate report for the FD region
- #
- # This function generates report for the FD region.
- #
- # @param self The object pointer
- # @param File The file object for report
- #
- def GenerateReport(self, File):
- if (len(self.FvList) > 0):
- for FvItem in self.FvList:
- Info = self.FvInfo[FvItem]
- self._GenerateReport(File, Info[0], "FV", Info[1], Info[2], FvItem)
- else:
- self._GenerateReport(File, "FD Region", self.Type, self.BaseAddress, self.Size)
-
-##
-# Reports FD information
-#
-# This class reports the FD section in the build report file.
-# It collects flash device information for a platform.
-#
-class FdReport(object):
- ##
- # Constructor function for class FdReport
- #
- # This constructor function generates FdReport object for a specified
- # firmware device.
- #
- # @param self The object pointer
- # @param Fd The current Firmware device object
- # @param Wa Workspace context information
- #
- def __init__(self, Fd, Wa):
- self.FdName = Fd.FdUiName
- self.BaseAddress = Fd.BaseAddress
- self.Size = Fd.Size
- self.FdRegionList = [FdRegionReport(FdRegion, Wa) for FdRegion in Fd.RegionList]
-
- ##
- # Generate report for the firmware device.
- #
- # This function generates report for the firmware device.
- #
- # @param self The object pointer
- # @param File The file object for report
- #
- def GenerateReport(self, File):
- FileWrite(File, gSectionStart)
- FileWrite(File, "Firmware Device (FD)")
- FileWrite(File, "FD Name: %s" % self.FdName)
- FileWrite(File, "Base Address: %s" % self.BaseAddress)
- FileWrite(File, "Size: 0x%X (%.0fK)" % (self.Size, self.Size / 1024.0))
- if len(self.FdRegionList) > 0:
- FileWrite(File, gSectionSep)
- for FdRegionItem in self.FdRegionList:
- FdRegionItem.GenerateReport(File)
-
- FileWrite(File, gSectionEnd)
-
-
-
-##
-# Reports platform information
-#
-# This class reports the whole platform information
-#
-class PlatformReport(object):
- ##
- # Constructor function for class PlatformReport
- #
- # This constructor function generates PlatformReport object a platform build.
- # It generates report for platform summary, flash, global PCDs and detailed
- # module information for modules involved in platform build.
- #
- # @param self The object pointer
- # @param Wa Workspace context information
- # @param MaList The list of modules in the platform build
- #
- def __init__(self, Wa, MaList, ReportType):
- self._WorkspaceDir = Wa.WorkspaceDir
- self.PlatformName = Wa.Name
- self.PlatformDscPath = Wa.Platform
- self.Architectures = " ".join(Wa.ArchList)
- self.ToolChain = Wa.ToolChain
- self.Target = Wa.BuildTarget
- self.OutputPath = os.path.join(Wa.WorkspaceDir, Wa.OutputDir)
- self.BuildEnvironment = platform.platform()
-
- self.PcdReport = None
- if "PCD" in ReportType:
- self.PcdReport = PcdReport(Wa)
-
- self.FdReportList = []
- if "FLASH" in ReportType and Wa.FdfProfile and MaList == None:
- for Fd in Wa.FdfProfile.FdDict:
- self.FdReportList.append(FdReport(Wa.FdfProfile.FdDict[Fd], Wa))
-
- self.PredictionReport = None
- if "FIXED_ADDRESS" in ReportType or "EXECUTION_ORDER" in ReportType:
- self.PredictionReport = PredictionReport(Wa)
-
- self.DepexParser = None
- if "DEPEX" in ReportType:
- self.DepexParser = DepexParser(Wa)
-
- self.ModuleReportList = []
- if MaList != None:
- self._IsModuleBuild = True
- for Ma in MaList:
- self.ModuleReportList.append(ModuleReport(Ma, ReportType))
- else:
- self._IsModuleBuild = False
- for Pa in Wa.AutoGenObjectList:
- for ModuleKey in Pa.Platform.Modules:
- self.ModuleReportList.append(ModuleReport(Pa.Platform.Modules[ModuleKey].M, ReportType))
-
-
-
- ##
- # Generate report for the whole platform.
- #
- # This function generates report for platform information.
- # It comprises of platform summary, global PCD, flash and
- # module list sections.
- #
- # @param self The object pointer
- # @param File The file object for report
- # @param BuildDuration The total time to build the modules
- # @param ReportType The kind of report items in the final report file
- #
- def GenerateReport(self, File, BuildDuration, ReportType):
- FileWrite(File, "Platform Summary")
- FileWrite(File, "Platform Name: %s" % self.PlatformName)
- FileWrite(File, "Platform DSC Path: %s" % self.PlatformDscPath)
- FileWrite(File, "Architectures: %s" % self.Architectures)
- FileWrite(File, "Tool Chain: %s" % self.ToolChain)
- FileWrite(File, "Target: %s" % self.Target)
- FileWrite(File, "Output Path: %s" % self.OutputPath)
- FileWrite(File, "Build Environment: %s" % self.BuildEnvironment)
- FileWrite(File, "Build Duration: %s" % BuildDuration)
- FileWrite(File, "Report Content: %s" % ", ".join(ReportType))
-
- if not self._IsModuleBuild:
- if "PCD" in ReportType:
- self.PcdReport.GenerateReport(File, None)
-
- if "FLASH" in ReportType:
- for FdReportListItem in self.FdReportList:
- FdReportListItem.GenerateReport(File)
-
- for ModuleReportItem in self.ModuleReportList:
- ModuleReportItem.GenerateReport(File, self.PcdReport, self.PredictionReport, self.DepexParser, ReportType)
-
- if not self._IsModuleBuild:
- if "EXECUTION_ORDER" in ReportType:
- self.PredictionReport.GenerateReport(File, None)
-
-## BuildReport class
-#
-# This base class contain the routines to collect data and then
-# applies certain format to the output report
-#
-class BuildReport(object):
- ##
- # Constructor function for class BuildReport
- #
- # This constructor function generates BuildReport object a platform build.
- # It generates report for platform summary, flash, global PCDs and detailed
- # module information for modules involved in platform build.
- #
- # @param self The object pointer
- # @param ReportFile The file name to save report file
- # @param ReportType The kind of report items in the final report file
- #
- def __init__(self, ReportFile, ReportType):
- self.ReportFile = ReportFile
- if ReportFile:
- self.ReportList = []
- self.ReportType = []
- if ReportType:
- for ReportTypeItem in ReportType:
- if ReportTypeItem not in self.ReportType:
- self.ReportType.append(ReportTypeItem)
- else:
- self.ReportType = ["PCD", "LIBRARY", "BUILD_FLAGS", "DEPEX", "FLASH", "FIXED_ADDRESS"]
- ##
- # Adds platform report to the list
- #
- # This function adds a platform report to the final report list.
- #
- # @param self The object pointer
- # @param Wa Workspace context information
- # @param MaList The list of modules in the platform build
- #
- def AddPlatformReport(self, Wa, MaList=None):
- if self.ReportFile:
- self.ReportList.append((Wa, MaList))
-
- ##
- # Generates the final report.
- #
- # This function generates platform build report. It invokes GenerateReport()
- # method for every platform report in the list.
- #
- # @param self The object pointer
- # @param BuildDuration The total time to build the modules
- #
- def GenerateReport(self, BuildDuration):
- if self.ReportFile:
- try:
- File = StringIO('')
- for (Wa, MaList) in self.ReportList:
- PlatformReport(Wa, MaList, self.ReportType).GenerateReport(File, BuildDuration, self.ReportType)
- Content = FileLinesSplit(File.getvalue(), gLineMaxLength)
- SaveFileOnChange(self.ReportFile, Content, True)
- EdkLogger.quiet("Build report can be found at %s" % os.path.abspath(self.ReportFile))
- except IOError:
- EdkLogger.error(None, FILE_WRITE_FAILURE, ExtraData=self.ReportFile)
- except:
- EdkLogger.error("BuildReport", CODE_ERROR, "Unknown fatal error when generating build report", ExtraData=self.ReportFile, RaiseError=False)
- EdkLogger.quiet("(Python %s on %s\n%s)" % (platform.python_version(), sys.platform, traceback.format_exc()))
- File.close()
-
-# This acts like the main() function for the script, unless it is 'import'ed into another script.
-if __name__ == '__main__':
- pass
-
diff --git a/BaseTools/Source/Python/build/__init__.py b/BaseTools/Source/Python/build/__init__.py
deleted file mode 100644
index 64cf63b635..0000000000
--- a/BaseTools/Source/Python/build/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-## @file
-# Python 'build' package initialization file.
-#
-# This file is required to make Python interpreter treat the directory
-# as containing package.
-#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
deleted file mode 100644
index 24a6ed8168..0000000000
--- a/BaseTools/Source/Python/build/build.py
+++ /dev/null
@@ -1,1906 +0,0 @@
-## @file
-# build a platform or a module
-#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import re
-import StringIO
-import sys
-import glob
-import time
-import platform
-import traceback
-import encodings.ascii
-
-from struct import *
-from threading import *
-from optparse import OptionParser
-from subprocess import *
-from Common import Misc as Utils
-
-from Common.TargetTxtClassObject import *
-from Common.ToolDefClassObject import *
-from Common.DataType import *
-from Common.BuildVersion import gBUILD_VERSION
-from AutoGen.AutoGen import *
-from Common.BuildToolError import *
-from Workspace.WorkspaceDatabase import *
-
-from BuildReport import BuildReport
-from GenPatchPcdTable.GenPatchPcdTable import *
-from PatchPcdValue.PatchPcdValue import *
-
-import Common.EdkLogger
-import Common.GlobalData as GlobalData
-
-# Version and Copyright
-VersionNumber = "0.51" + ' ' + gBUILD_VERSION
-__version__ = "%prog Version " + VersionNumber
-__copyright__ = "Copyright (c) 2007 - 2013, Intel Corporation All rights reserved."
-
-## standard targets of build command
-gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
-
-## build configuration file
-gBuildConfiguration = "Conf/target.txt"
-gBuildCacheDir = "Conf/.cache"
-gToolsDefinition = "Conf/tools_def.txt"
-
-TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')
-TmpTableDict = {}
-
-## Check environment PATH variable to make sure the specified tool is found
-#
-# If the tool is found in the PATH, then True is returned
-# Otherwise, False is returned
-#
-def IsToolInPath(tool):
- if os.environ.has_key('PATHEXT'):
- extns = os.environ['PATHEXT'].split(os.path.pathsep)
- else:
- extns = ('',)
- for pathDir in os.environ['PATH'].split(os.path.pathsep):
- for ext in extns:
- if os.path.exists(os.path.join(pathDir, tool + ext)):
- return True
- return False
-
-## Check environment variables
-#
-# Check environment variables that must be set for build. Currently they are
-#
-# WORKSPACE The directory all packages/platforms start from
-# EDK_TOOLS_PATH The directory contains all tools needed by the build
-# PATH $(EDK_TOOLS_PATH)/Bin/<sys> must be set in PATH
-#
-# If any of above environment variable is not set or has error, the build
-# will be broken.
-#
-def CheckEnvVariable():
- # check WORKSPACE
- if "WORKSPACE" not in os.environ:
- EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
- ExtraData="WORKSPACE")
-
- WorkspaceDir = os.path.normcase(os.path.normpath(os.environ["WORKSPACE"]))
- if not os.path.exists(WorkspaceDir):
- EdkLogger.error("build", FILE_NOT_FOUND, "WORKSPACE doesn't exist", ExtraData="%s" % WorkspaceDir)
- elif ' ' in WorkspaceDir:
- EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in WORKSPACE path",
- ExtraData=WorkspaceDir)
- os.environ["WORKSPACE"] = WorkspaceDir
-
- #
- # Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always point to ECP
- #
- if "ECP_SOURCE" not in os.environ:
- os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg)
- if "EFI_SOURCE" not in os.environ:
- os.environ["EFI_SOURCE"] = os.environ["ECP_SOURCE"]
- if "EDK_SOURCE" not in os.environ:
- os.environ["EDK_SOURCE"] = os.environ["ECP_SOURCE"]
-
- #
- # Unify case of characters on case-insensitive systems
- #
- EfiSourceDir = os.path.normcase(os.path.normpath(os.environ["EFI_SOURCE"]))
- EdkSourceDir = os.path.normcase(os.path.normpath(os.environ["EDK_SOURCE"]))
- EcpSourceDir = os.path.normcase(os.path.normpath(os.environ["ECP_SOURCE"]))
-
- os.environ["EFI_SOURCE"] = EfiSourceDir
- os.environ["EDK_SOURCE"] = EdkSourceDir
- os.environ["ECP_SOURCE"] = EcpSourceDir
- os.environ["EDK_TOOLS_PATH"] = os.path.normcase(os.environ["EDK_TOOLS_PATH"])
-
- if not os.path.exists(EcpSourceDir):
- EdkLogger.verbose("ECP_SOURCE = %s doesn't exist. Edk modules could not be built." % EcpSourceDir)
- elif ' ' in EcpSourceDir:
- EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in ECP_SOURCE path",
- ExtraData=EcpSourceDir)
- if not os.path.exists(EdkSourceDir):
- if EdkSourceDir == EcpSourceDir:
- EdkLogger.verbose("EDK_SOURCE = %s doesn't exist. Edk modules could not be built." % EdkSourceDir)
- else:
- EdkLogger.error("build", PARAMETER_INVALID, "EDK_SOURCE does not exist",
- ExtraData=EdkSourceDir)
- elif ' ' in EdkSourceDir:
- EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in EDK_SOURCE path",
- ExtraData=EdkSourceDir)
- if not os.path.exists(EfiSourceDir):
- if EfiSourceDir == EcpSourceDir:
- EdkLogger.verbose("EFI_SOURCE = %s doesn't exist. Edk modules could not be built." % EfiSourceDir)
- else:
- EdkLogger.error("build", PARAMETER_INVALID, "EFI_SOURCE does not exist",
- ExtraData=EfiSourceDir)
- elif ' ' in EfiSourceDir:
- EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in EFI_SOURCE path",
- ExtraData=EfiSourceDir)
-
- # change absolute path to relative path to WORKSPACE
- if EfiSourceDir.upper().find(WorkspaceDir.upper()) != 0:
- EdkLogger.error("build", PARAMETER_INVALID, "EFI_SOURCE is not under WORKSPACE",
- ExtraData="WORKSPACE = %s\n EFI_SOURCE = %s" % (WorkspaceDir, EfiSourceDir))
- if EdkSourceDir.upper().find(WorkspaceDir.upper()) != 0:
- EdkLogger.error("build", PARAMETER_INVALID, "EDK_SOURCE is not under WORKSPACE",
- ExtraData="WORKSPACE = %s\n EDK_SOURCE = %s" % (WorkspaceDir, EdkSourceDir))
- if EcpSourceDir.upper().find(WorkspaceDir.upper()) != 0:
- EdkLogger.error("build", PARAMETER_INVALID, "ECP_SOURCE is not under WORKSPACE",
- ExtraData="WORKSPACE = %s\n ECP_SOURCE = %s" % (WorkspaceDir, EcpSourceDir))
-
- # check EDK_TOOLS_PATH
- if "EDK_TOOLS_PATH" not in os.environ:
- EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
- ExtraData="EDK_TOOLS_PATH")
-
- # check PATH
- if "PATH" not in os.environ:
- EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
- ExtraData="PATH")
-
- GlobalData.gWorkspace = WorkspaceDir
- GlobalData.gEfiSource = EfiSourceDir
- GlobalData.gEdkSource = EdkSourceDir
- GlobalData.gEcpSource = EcpSourceDir
-
- GlobalData.gGlobalDefines["WORKSPACE"] = WorkspaceDir
- GlobalData.gGlobalDefines["EFI_SOURCE"] = EfiSourceDir
- GlobalData.gGlobalDefines["EDK_SOURCE"] = EdkSourceDir
- GlobalData.gGlobalDefines["ECP_SOURCE"] = EcpSourceDir
- GlobalData.gGlobalDefines["EDK_TOOLS_PATH"] = os.environ["EDK_TOOLS_PATH"]
-
-## Get normalized file path
-#
-# Convert the path to be local format, and remove the WORKSPACE path at the
-# beginning if the file path is given in full path.
-#
-# @param FilePath File path to be normalized
-# @param Workspace Workspace path which the FilePath will be checked against
-#
-# @retval string The normalized file path
-#
-def NormFile(FilePath, Workspace):
- # check if the path is absolute or relative
- if os.path.isabs(FilePath):
- FileFullPath = os.path.normpath(FilePath)
- else:
- FileFullPath = os.path.normpath(os.path.join(Workspace, FilePath))
-
- # check if the file path exists or not
- if not os.path.isfile(FileFullPath):
- EdkLogger.error("build", FILE_NOT_FOUND, ExtraData="\t%s (Please give file in absolute path or relative to WORKSPACE)" % FileFullPath)
-
- # remove workspace directory from the beginning part of the file path
- if Workspace[-1] in ["\\", "/"]:
- return FileFullPath[len(Workspace):]
- else:
- return FileFullPath[(len(Workspace) + 1):]
-
-## Get the output of an external program
-#
-# This is the entrance method of thread reading output of an external program and
-# putting them in STDOUT/STDERR of current program.
-#
-# @param From The stream message read from
-# @param To The stream message put on
-# @param ExitFlag The flag used to indicate stopping reading
-#
-def ReadMessage(From, To, ExitFlag):
- while True:
- # read one line a time
- Line = From.readline()
- # empty string means "end"
- if Line != None and Line != "":
- To(Line.rstrip())
- else:
- break
- if ExitFlag.isSet():
- break
-
-## Launch an external program
-#
-# This method will call subprocess.Popen to execute an external program with
-# given options in specified directory. Because of the dead-lock issue during
-# redirecting output of the external program, threads are used to to do the
-# redirection work.
-#
-# @param Command A list or string containing the call of the program
-# @param WorkingDir The directory in which the program will be running
-#
-def LaunchCommand(Command, WorkingDir):
- # if working directory doesn't exist, Popen() will raise an exception
- if not os.path.isdir(WorkingDir):
- EdkLogger.error("build", FILE_NOT_FOUND, ExtraData=WorkingDir)
-
- Proc = None
- EndOfProcedure = None
- try:
- # launch the command
- Proc = Popen(Command, stdout=PIPE, stderr=PIPE, env=os.environ, cwd=WorkingDir, bufsize=-1)
-
- # launch two threads to read the STDOUT and STDERR
- EndOfProcedure = Event()
- EndOfProcedure.clear()
- if Proc.stdout:
- StdOutThread = Thread(target=ReadMessage, args=(Proc.stdout, EdkLogger.info, EndOfProcedure))
- StdOutThread.setName("STDOUT-Redirector")
- StdOutThread.setDaemon(False)
- StdOutThread.start()
-
- if Proc.stderr:
- StdErrThread = Thread(target=ReadMessage, args=(Proc.stderr, EdkLogger.quiet, EndOfProcedure))
- StdErrThread.setName("STDERR-Redirector")
- StdErrThread.setDaemon(False)
- StdErrThread.start()
-
- # waiting for program exit
- Proc.wait()
- except: # in case of aborting
- # terminate the threads redirecting the program output
- if EndOfProcedure != None:
- EndOfProcedure.set()
- if Proc == None:
- if type(Command) != type(""):
- Command = " ".join(Command)
- EdkLogger.error("build", COMMAND_FAILURE, "Failed to start command", ExtraData="%s [%s]" % (Command, WorkingDir))
-
- if Proc.stdout:
- StdOutThread.join()
- if Proc.stderr:
- StdErrThread.join()
-
- # check the return code of the program
- if Proc.returncode != 0:
- if type(Command) != type(""):
- Command = " ".join(Command)
- EdkLogger.error("build", COMMAND_FAILURE, ExtraData="%s [%s]" % (Command, WorkingDir))
-
-## The smallest unit that can be built in multi-thread build mode
-#
-# This is the base class of build unit. The "Obj" parameter must provide
-# __str__(), __eq__() and __hash__() methods. Otherwise there could be build units
-# missing build.
-#
-# Currently the "Obj" should be only ModuleAutoGen or PlatformAutoGen objects.
-#
-class BuildUnit:
- ## The constructor
- #
- # @param self The object pointer
- # @param Obj The object the build is working on
- # @param Target The build target name, one of gSupportedTarget
- # @param Dependency The BuildUnit(s) which must be completed in advance
- # @param WorkingDir The directory build command starts in
- #
- def __init__(self, Obj, BuildCommand, Target, Dependency, WorkingDir="."):
- self.BuildObject = Obj
- self.Dependency = Dependency
- self.WorkingDir = WorkingDir
- self.Target = Target
- self.BuildCommand = BuildCommand
- if not BuildCommand:
- EdkLogger.error("build", OPTION_MISSING,
- "No build command found for this module. "
- "Please check your setting of %s_%s_%s_MAKE_PATH in Conf/tools_def.txt file." %
- (Obj.BuildTarget, Obj.ToolChain, Obj.Arch),
- ExtraData=str(Obj))
-
-
- ## str() method
- #
- # It just returns the string representation of self.BuildObject
- #
- # @param self The object pointer
- #
- def __str__(self):
- return str(self.BuildObject)
-
- ## "==" operator method
- #
- # It just compares self.BuildObject with "Other". So self.BuildObject must
- # provide its own __eq__() method.
- #
- # @param self The object pointer
- # @param Other The other BuildUnit object compared to
- #
- def __eq__(self, Other):
- return Other != None and self.BuildObject == Other.BuildObject \
- and self.BuildObject.Arch == Other.BuildObject.Arch
-
- ## hash() method
- #
- # It just returns the hash value of self.BuildObject which must be hashable.
- #
- # @param self The object pointer
- #
- def __hash__(self):
- return hash(self.BuildObject) + hash(self.BuildObject.Arch)
-
- def __repr__(self):
- return repr(self.BuildObject)
-
-## The smallest module unit that can be built by nmake/make command in multi-thread build mode
-#
-# This class is for module build by nmake/make build system. The "Obj" parameter
-# must provide __str__(), __eq__() and __hash__() methods. Otherwise there could
-# be make units missing build.
-#
-# Currently the "Obj" should be only ModuleAutoGen object.
-#
-class ModuleMakeUnit(BuildUnit):
- ## The constructor
- #
- # @param self The object pointer
- # @param Obj The ModuleAutoGen object the build is working on
- # @param Target The build target name, one of gSupportedTarget
- #
- def __init__(self, Obj, Target):
- Dependency = [ModuleMakeUnit(La, Target) for La in Obj.LibraryAutoGenList]
- BuildUnit.__init__(self, Obj, Obj.BuildCommand, Target, Dependency, Obj.MakeFileDir)
- if Target in [None, "", "all"]:
- self.Target = "tbuild"
-
-## The smallest platform unit that can be built by nmake/make command in multi-thread build mode
-#
-# This class is for platform build by nmake/make build system. The "Obj" parameter
-# must provide __str__(), __eq__() and __hash__() methods. Otherwise there could
-# be make units missing build.
-#
-# Currently the "Obj" should be only PlatformAutoGen object.
-#
-class PlatformMakeUnit(BuildUnit):
- ## The constructor
- #
- # @param self The object pointer
- # @param Obj The PlatformAutoGen object the build is working on
- # @param Target The build target name, one of gSupportedTarget
- #
- def __init__(self, Obj, Target):
- Dependency = [ModuleMakeUnit(Lib, Target) for Lib in self.BuildObject.LibraryAutoGenList]
- Dependency.extend([ModuleMakeUnit(Mod, Target) for Mod in self.BuildObject.ModuleAutoGenList])
- BuildUnit.__init__(self, Obj, Obj.BuildCommand, Target, Dependency, Obj.MakeFileDir)
-
-## The class representing the task of a module build or platform build
-#
-# This class manages the build tasks in multi-thread build mode. Its jobs include
-# scheduling thread running, catching thread error, monitor the thread status, etc.
-#
-class BuildTask:
- # queue for tasks waiting for schedule
- _PendingQueue = sdict()
- _PendingQueueLock = threading.Lock()
-
- # queue for tasks ready for running
- _ReadyQueue = sdict()
- _ReadyQueueLock = threading.Lock()
-
- # queue for run tasks
- _RunningQueue = sdict()
- _RunningQueueLock = threading.Lock()
-
- # queue containing all build tasks, in case duplicate build
- _TaskQueue = sdict()
-
- # flag indicating error occurs in a running thread
- _ErrorFlag = threading.Event()
- _ErrorFlag.clear()
- _ErrorMessage = ""
-
- # BoundedSemaphore object used to control the number of running threads
- _Thread = None
-
- # flag indicating if the scheduler is started or not
- _SchedulerStopped = threading.Event()
- _SchedulerStopped.set()
-
- ## Start the task scheduler thread
- #
- # @param MaxThreadNumber The maximum thread number
- # @param ExitFlag Flag used to end the scheduler
- #
- @staticmethod
- def StartScheduler(MaxThreadNumber, ExitFlag):
- SchedulerThread = Thread(target=BuildTask.Scheduler, args=(MaxThreadNumber, ExitFlag))
- SchedulerThread.setName("Build-Task-Scheduler")
- SchedulerThread.setDaemon(False)
- SchedulerThread.start()
- # wait for the scheduler to be started, especially useful in Linux
- while not BuildTask.IsOnGoing():
- time.sleep(0.01)
-
- ## Scheduler method
- #
- # @param MaxThreadNumber The maximum thread number
- # @param ExitFlag Flag used to end the scheduler
- #
- @staticmethod
- def Scheduler(MaxThreadNumber, ExitFlag):
- BuildTask._SchedulerStopped.clear()
- try:
- # use BoundedSemaphore to control the maximum running threads
- BuildTask._Thread = BoundedSemaphore(MaxThreadNumber)
- #
- # scheduling loop, which will exits when no pending/ready task and
- # indicated to do so, or there's error in running thread
- #
- while (len(BuildTask._PendingQueue) > 0 or len(BuildTask._ReadyQueue) > 0 \
- or not ExitFlag.isSet()) and not BuildTask._ErrorFlag.isSet():
- EdkLogger.debug(EdkLogger.DEBUG_8, "Pending Queue (%d), Ready Queue (%d)"
- % (len(BuildTask._PendingQueue), len(BuildTask._ReadyQueue)))
-
- # get all pending tasks
- BuildTask._PendingQueueLock.acquire()
- BuildObjectList = BuildTask._PendingQueue.keys()
- #
- # check if their dependency is resolved, and if true, move them
- # into ready queue
- #
- for BuildObject in BuildObjectList:
- Bt = BuildTask._PendingQueue[BuildObject]
- if Bt.IsReady():
- BuildTask._ReadyQueue[BuildObject] = BuildTask._PendingQueue.pop(BuildObject)
- BuildTask._PendingQueueLock.release()
-
- # launch build thread until the maximum number of threads is reached
- while not BuildTask._ErrorFlag.isSet():
- # empty ready queue, do nothing further
- if len(BuildTask._ReadyQueue) == 0:
- break
-
- # wait for active thread(s) exit
- BuildTask._Thread.acquire(True)
-
- # start a new build thread
- Bo = BuildTask._ReadyQueue.keys()[0]
- Bt = BuildTask._ReadyQueue.pop(Bo)
-
- # move into running queue
- BuildTask._RunningQueueLock.acquire()
- BuildTask._RunningQueue[Bo] = Bt
- BuildTask._RunningQueueLock.release()
-
- Bt.Start()
- # avoid tense loop
- time.sleep(0.01)
-
- # avoid tense loop
- time.sleep(0.01)
-
- # wait for all running threads exit
- if BuildTask._ErrorFlag.isSet():
- EdkLogger.quiet("\nWaiting for all build threads exit...")
- # while not BuildTask._ErrorFlag.isSet() and \
- while len(BuildTask._RunningQueue) > 0:
- EdkLogger.verbose("Waiting for thread ending...(%d)" % len(BuildTask._RunningQueue))
- EdkLogger.debug(EdkLogger.DEBUG_8, "Threads [%s]" % ", ".join([Th.getName() for Th in threading.enumerate()]))
- # avoid tense loop
- time.sleep(0.1)
- except BaseException, X:
- #
- # TRICK: hide the output of threads left runing, so that the user can
- # catch the error message easily
- #
- EdkLogger.SetLevel(EdkLogger.ERROR)
- BuildTask._ErrorFlag.set()
- BuildTask._ErrorMessage = "build thread scheduler error\n\t%s" % str(X)
-
- BuildTask._PendingQueue.clear()
- BuildTask._ReadyQueue.clear()
- BuildTask._RunningQueue.clear()
- BuildTask._TaskQueue.clear()
- BuildTask._SchedulerStopped.set()
-
- ## Wait for all running method exit
- #
- @staticmethod
- def WaitForComplete():
- BuildTask._SchedulerStopped.wait()
-
- ## Check if the scheduler is running or not
- #
- @staticmethod
- def IsOnGoing():
- return not BuildTask._SchedulerStopped.isSet()
-
- ## Abort the build
- @staticmethod
- def Abort():
- if BuildTask.IsOnGoing():
- BuildTask._ErrorFlag.set()
- BuildTask.WaitForComplete()
-
- ## Check if there's error in running thread
- #
- # Since the main thread cannot catch exceptions in other thread, we have to
- # use threading.Event to communicate this formation to main thread.
- #
- @staticmethod
- def HasError():
- return BuildTask._ErrorFlag.isSet()
-
- ## Get error message in running thread
- #
- # Since the main thread cannot catch exceptions in other thread, we have to
- # use a static variable to communicate this message to main thread.
- #
- @staticmethod
- def GetErrorMessage():
- return BuildTask._ErrorMessage
-
- ## Factory method to create a BuildTask object
- #
- # This method will check if a module is building or has been built. And if
- # true, just return the associated BuildTask object in the _TaskQueue. If
- # not, create and return a new BuildTask object. The new BuildTask object
- # will be appended to the _PendingQueue for scheduling later.
- #
- # @param BuildItem A BuildUnit object representing a build object
- # @param Dependency The dependent build object of BuildItem
- #
- @staticmethod
- def New(BuildItem, Dependency=None):
- if BuildItem in BuildTask._TaskQueue:
- Bt = BuildTask._TaskQueue[BuildItem]
- return Bt
-
- Bt = BuildTask()
- Bt._Init(BuildItem, Dependency)
- BuildTask._TaskQueue[BuildItem] = Bt
-
- BuildTask._PendingQueueLock.acquire()
- BuildTask._PendingQueue[BuildItem] = Bt
- BuildTask._PendingQueueLock.release()
-
- return Bt
-
- ## The real constructor of BuildTask
- #
- # @param BuildItem A BuildUnit object representing a build object
- # @param Dependency The dependent build object of BuildItem
- #
- def _Init(self, BuildItem, Dependency=None):
- self.BuildItem = BuildItem
-
- self.DependencyList = []
- if Dependency == None:
- Dependency = BuildItem.Dependency
- else:
- Dependency.extend(BuildItem.Dependency)
- self.AddDependency(Dependency)
- # flag indicating build completes, used to avoid unnecessary re-build
- self.CompleteFlag = False
-
- ## Check if all dependent build tasks are completed or not
- #
- def IsReady(self):
- ReadyFlag = True
- for Dep in self.DependencyList:
- if Dep.CompleteFlag == True:
- continue
- ReadyFlag = False
- break
-
- return ReadyFlag
-
- ## Add dependent build task
- #
- # @param Dependency The list of dependent build objects
- #
- def AddDependency(self, Dependency):
- for Dep in Dependency:
- self.DependencyList.append(BuildTask.New(Dep)) # BuildTask list
-
- ## The thread wrapper of LaunchCommand function
- #
- # @param Command A list or string contains the call of the command
- # @param WorkingDir The directory in which the program will be running
- #
- def _CommandThread(self, Command, WorkingDir):
- try:
- LaunchCommand(Command, WorkingDir)
- self.CompleteFlag = True
- except:
- #
- # TRICK: hide the output of threads left runing, so that the user can
- # catch the error message easily
- #
- if not BuildTask._ErrorFlag.isSet():
- GlobalData.gBuildingModule = "%s [%s, %s, %s]" % (str(self.BuildItem.BuildObject),
- self.BuildItem.BuildObject.Arch,
- self.BuildItem.BuildObject.ToolChain,
- self.BuildItem.BuildObject.BuildTarget
- )
- EdkLogger.SetLevel(EdkLogger.ERROR)
- BuildTask._ErrorFlag.set()
- BuildTask._ErrorMessage = "%s broken\n %s [%s]" % \
- (threading.currentThread().getName(), Command, WorkingDir)
- # indicate there's a thread is available for another build task
- BuildTask._RunningQueueLock.acquire()
- BuildTask._RunningQueue.pop(self.BuildItem)
- BuildTask._RunningQueueLock.release()
- BuildTask._Thread.release()
-
- ## Start build task thread
- #
- def Start(self):
- EdkLogger.quiet("Building ... %s" % repr(self.BuildItem))
- Command = self.BuildItem.BuildCommand + [self.BuildItem.Target]
- self.BuildTread = Thread(target=self._CommandThread, args=(Command, self.BuildItem.WorkingDir))
- self.BuildTread.setName("build thread")
- self.BuildTread.setDaemon(False)
- self.BuildTread.start()
-
-## The class contains the information related to EFI image
-#
-class PeImageInfo():
- ## Constructor
- #
- # Constructor will load all required image information.
- #
- # @param BaseName The full file path of image.
- # @param Guid The GUID for image.
- # @param Arch Arch of this image.
- # @param OutputDir The output directory for image.
- # @param DebugDir The debug directory for image.
- # @param ImageClass PeImage Information
- #
- def __init__(self, BaseName, Guid, Arch, OutputDir, DebugDir, ImageClass):
- self.BaseName = BaseName
- self.Guid = Guid
- self.Arch = Arch
- self.OutputDir = OutputDir
- self.DebugDir = DebugDir
- self.Image = ImageClass
- self.Image.Size = (self.Image.Size / 0x1000 + 1) * 0x1000
-
-## The class implementing the EDK2 build process
-#
-# The build process includes:
-# 1. Load configuration from target.txt and tools_def.txt in $(WORKSPACE)/Conf
-# 2. Parse DSC file of active platform
-# 3. Parse FDF file if any
-# 4. Establish build database, including parse all other files (module, package)
-# 5. Create AutoGen files (C code file, depex file, makefile) if necessary
-# 6. Call build command
-#
-class Build():
- ## Constructor
- #
- # Constructor will load all necessary configurations, parse platform, modules
- # and packages and the establish a database for AutoGen.
- #
- # @param Target The build command target, one of gSupportedTarget
- # @param WorkspaceDir The directory of workspace
- # @param BuildOptions Build options passed from command line
- #
- def __init__(self, Target, WorkspaceDir, BuildOptions):
- self.WorkspaceDir = WorkspaceDir
- self.Target = Target
- self.PlatformFile = BuildOptions.PlatformFile
- self.ModuleFile = BuildOptions.ModuleFile
- self.ArchList = BuildOptions.TargetArch
- self.ToolChainList = BuildOptions.ToolChain
- self.BuildTargetList= BuildOptions.BuildTarget
- self.Fdf = BuildOptions.FdfFile
- self.FdList = BuildOptions.RomImage
- self.FvList = BuildOptions.FvImage
- self.CapList = BuildOptions.CapName
- self.SilentMode = BuildOptions.SilentMode
- self.ThreadNumber = BuildOptions.ThreadNumber
- self.SkipAutoGen = BuildOptions.SkipAutoGen
- self.Reparse = BuildOptions.Reparse
- self.SkuId = BuildOptions.SkuId
- self.SpawnMode = True
- self.BuildReport = BuildReport(BuildOptions.ReportFile, BuildOptions.ReportType)
- self.TargetTxt = TargetTxtClassObject()
- self.ToolDef = ToolDefClassObject()
- if BuildOptions.DisableCache:
- self.Db = WorkspaceDatabase(":memory:")
- else:
- self.Db = WorkspaceDatabase(None, self.Reparse)
- self.BuildDatabase = self.Db.BuildObject
- self.Platform = None
- self.LoadFixAddress = 0
- self.UniFlag = BuildOptions.Flag
-
- # print dot character during doing some time-consuming work
- self.Progress = Utils.Progressor()
-
- self.InitBuild()
-
- # print current build environment and configuration
- EdkLogger.quiet("%-16s = %s" % ("WORKSPACE", os.environ["WORKSPACE"]))
- EdkLogger.quiet("%-16s = %s" % ("ECP_SOURCE", os.environ["ECP_SOURCE"]))
- EdkLogger.quiet("%-16s = %s" % ("EDK_SOURCE", os.environ["EDK_SOURCE"]))
- EdkLogger.quiet("%-16s = %s" % ("EFI_SOURCE", os.environ["EFI_SOURCE"]))
- EdkLogger.quiet("%-16s = %s" % ("EDK_TOOLS_PATH", os.environ["EDK_TOOLS_PATH"]))
-
- EdkLogger.info("")
-
- os.chdir(self.WorkspaceDir)
-
- ## Load configuration
- #
- # This method will parse target.txt and get the build configurations.
- #
- def LoadConfiguration(self):
- #
- # Check target.txt and tools_def.txt and Init them
- #
- BuildConfigurationFile = os.path.normpath(os.path.join(self.WorkspaceDir, gBuildConfiguration))
- if os.path.isfile(BuildConfigurationFile) == True:
- StatusCode = self.TargetTxt.LoadTargetTxtFile(BuildConfigurationFile)
-
- ToolDefinitionFile = self.TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
- if ToolDefinitionFile == '':
- ToolDefinitionFile = gToolsDefinition
- ToolDefinitionFile = os.path.normpath(os.path.join(self.WorkspaceDir, ToolDefinitionFile))
- if os.path.isfile(ToolDefinitionFile) == True:
- StatusCode = self.ToolDef.LoadToolDefFile(ToolDefinitionFile)
- else:
- EdkLogger.error("build", FILE_NOT_FOUND, ExtraData=ToolDefinitionFile)
- else:
- EdkLogger.error("build", FILE_NOT_FOUND, ExtraData=BuildConfigurationFile)
-
- # if no ARCH given in command line, get it from target.txt
- if not self.ArchList:
- self.ArchList = self.TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TARGET_ARCH]
- self.ArchList = tuple(self.ArchList)
-
- # if no build target given in command line, get it from target.txt
- if not self.BuildTargetList:
- self.BuildTargetList = self.TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TARGET]
-
- # if no tool chain given in command line, get it from target.txt
- if not self.ToolChainList:
- self.ToolChainList = self.TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_TAG]
- if self.ToolChainList == None or len(self.ToolChainList) == 0:
- EdkLogger.error("build", RESOURCE_NOT_AVAILABLE, ExtraData="No toolchain given. Don't know how to build.\n")
-
- # check if the tool chains are defined or not
- NewToolChainList = []
- for ToolChain in self.ToolChainList:
- if ToolChain not in self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_TAG]:
- EdkLogger.warn("build", "Tool chain [%s] is not defined" % ToolChain)
- else:
- NewToolChainList.append(ToolChain)
- # if no tool chain available, break the build
- if len(NewToolChainList) == 0:
- EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,
- ExtraData="[%s] not defined. No toolchain available for build!\n" % ", ".join(self.ToolChainList))
- else:
- self.ToolChainList = NewToolChainList
-
- if self.ThreadNumber == None:
- self.ThreadNumber = self.TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER]
- if self.ThreadNumber == '':
- self.ThreadNumber = 0
- else:
- self.ThreadNumber = int(self.ThreadNumber, 0)
-
- if self.ThreadNumber == 0:
- self.ThreadNumber = 1
-
- if not self.PlatformFile:
- PlatformFile = self.TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_ACTIVE_PLATFORM]
- if not PlatformFile:
- # Try to find one in current directory
- WorkingDirectory = os.getcwd()
- FileList = glob.glob(os.path.normpath(os.path.join(WorkingDirectory, '*.dsc')))
- FileNum = len(FileList)
- if FileNum >= 2:
- EdkLogger.error("build", OPTION_MISSING,
- ExtraData="There are %d DSC files in %s. Use '-p' to specify one.\n" % (FileNum, WorkingDirectory))
- elif FileNum == 1:
- PlatformFile = FileList[0]
- else:
- EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,
- ExtraData="No active platform specified in target.txt or command line! Nothing can be built.\n")
-
- self.PlatformFile = PathClass(NormFile(PlatformFile, self.WorkspaceDir), self.WorkspaceDir)
-
- ## Initialize build configuration
- #
- # This method will parse DSC file and merge the configurations from
- # command line and target.txt, then get the final build configurations.
- #
- def InitBuild(self):
- # parse target.txt, tools_def.txt, and platform file
- self.LoadConfiguration()
-
- # Allow case-insensitive for those from command line or configuration file
- ErrorCode, ErrorInfo = self.PlatformFile.Validate(".dsc", False)
- if ErrorCode != 0:
- EdkLogger.error("build", ErrorCode, ExtraData=ErrorInfo)
-
- # create metafile database
- self.Db.InitDatabase()
-
- ## Build a module or platform
- #
- # Create autogen code and makefile for a module or platform, and the launch
- # "make" command to build it
- #
- # @param Target The target of build command
- # @param Platform The platform file
- # @param Module The module file
- # @param BuildTarget The name of build target, one of "DEBUG", "RELEASE"
- # @param ToolChain The name of toolchain to build
- # @param Arch The arch of the module/platform
- # @param CreateDepModuleCodeFile Flag used to indicate creating code
- # for dependent modules/Libraries
- # @param CreateDepModuleMakeFile Flag used to indicate creating makefile
- # for dependent modules/Libraries
- #
- def _Build(self, Target, AutoGenObject, CreateDepsCodeFile=True, CreateDepsMakeFile=True):
- if AutoGenObject == None:
- return False
-
- # skip file generation for cleanxxx targets, run and fds target
- if Target not in ['clean', 'cleanlib', 'cleanall', 'run', 'fds']:
- # for target which must generate AutoGen code and makefile
- if not self.SkipAutoGen or Target == 'genc':
- self.Progress.Start("Generating code")
- AutoGenObject.CreateCodeFile(CreateDepsCodeFile)
- self.Progress.Stop("done!")
- if Target == "genc":
- return True
-
- if not self.SkipAutoGen or Target == 'genmake':
- self.Progress.Start("Generating makefile")
- AutoGenObject.CreateMakeFile(CreateDepsMakeFile)
- AutoGenObject.CreateAsBuiltInf()
- self.Progress.Stop("done!")
- if Target == "genmake":
- return True
- else:
- # always recreate top/platform makefile when clean, just in case of inconsistency
- AutoGenObject.CreateCodeFile(False)
- AutoGenObject.CreateMakeFile(False)
-
- if EdkLogger.GetLevel() == EdkLogger.QUIET:
- EdkLogger.quiet("Building ... %s" % repr(AutoGenObject))
-
- BuildCommand = AutoGenObject.BuildCommand
- if BuildCommand == None or len(BuildCommand) == 0:
- EdkLogger.error("build", OPTION_MISSING,
- "No build command found for this module. "
- "Please check your setting of %s_%s_%s_MAKE_PATH in Conf/tools_def.txt file." %
- (AutoGenObject.BuildTarget, AutoGenObject.ToolChain, AutoGenObject.Arch),
- ExtraData=str(AutoGenObject))
-
- BuildCommand = BuildCommand + [Target]
- LaunchCommand(BuildCommand, AutoGenObject.MakeFileDir)
- if Target == 'cleanall':
- try:
- #os.rmdir(AutoGenObject.BuildDir)
- RemoveDirectory(AutoGenObject.BuildDir, True)
- #
- # First should close DB.
- #
- self.Db.Close()
- RemoveDirectory(gBuildCacheDir, True)
- except WindowsError, X:
- EdkLogger.error("build", FILE_DELETE_FAILURE, ExtraData=str(X))
- return True
-
- ## Rebase module image and Get function address for the input module list.
- #
- def _RebaseModule (self, MapBuffer, BaseAddress, ModuleList, AddrIsOffset = True, ModeIsSmm = False):
- if ModeIsSmm:
- AddrIsOffset = False
- InfFileNameList = ModuleList.keys()
- #InfFileNameList.sort()
- for InfFile in InfFileNameList:
- sys.stdout.write (".")
- sys.stdout.flush()
- ModuleInfo = ModuleList[InfFile]
- ModuleName = ModuleInfo.BaseName
- ModuleOutputImage = ModuleInfo.Image.FileName
- ModuleDebugImage = os.path.join(ModuleInfo.DebugDir, ModuleInfo.BaseName + '.efi')
- ## for SMM module in SMRAM, the SMRAM will be allocated from base to top.
- if not ModeIsSmm:
- BaseAddress = BaseAddress - ModuleInfo.Image.Size
- #
- # Update Image to new BaseAddress by GenFw tool
- #
- LaunchCommand(["GenFw", "--rebase", str(BaseAddress), "-r", ModuleOutputImage], ModuleInfo.OutputDir)
- LaunchCommand(["GenFw", "--rebase", str(BaseAddress), "-r", ModuleDebugImage], ModuleInfo.DebugDir)
- else:
- #
- # Set new address to the section header only for SMM driver.
- #
- LaunchCommand(["GenFw", "--address", str(BaseAddress), "-r", ModuleOutputImage], ModuleInfo.OutputDir)
- LaunchCommand(["GenFw", "--address", str(BaseAddress), "-r", ModuleDebugImage], ModuleInfo.DebugDir)
- #
- # Collect funtion address from Map file
- #
- ImageMapTable = ModuleOutputImage.replace('.efi', '.map')
- FunctionList = []
- if os.path.exists(ImageMapTable):
- OrigImageBaseAddress = 0
- ImageMap = open (ImageMapTable, 'r')
- for LinStr in ImageMap:
- if len (LinStr.strip()) == 0:
- continue
- #
- # Get the preferred address set on link time.
- #
- if LinStr.find ('Preferred load address is') != -1:
- StrList = LinStr.split()
- OrigImageBaseAddress = int (StrList[len(StrList) - 1], 16)
-
- StrList = LinStr.split()
- if len (StrList) > 4:
- if StrList[3] == 'f' or StrList[3] =='F':
- Name = StrList[1]
- RelativeAddress = int (StrList[2], 16) - OrigImageBaseAddress
- FunctionList.append ((Name, RelativeAddress))
- if ModuleInfo.Arch == 'IPF' and Name.endswith('_ModuleEntryPoint'):
- #
- # Get the real entry point address for IPF image.
- #
- ModuleInfo.Image.EntryPoint = RelativeAddress
- ImageMap.close()
- #
- # Add general information.
- #
- if ModeIsSmm:
- MapBuffer.write('\n\n%s (Fixed SMRAM Offset, BaseAddress=0x%010X, EntryPoint=0x%010X)\n' % (ModuleName, BaseAddress, BaseAddress + ModuleInfo.Image.EntryPoint))
- elif AddrIsOffset:
- MapBuffer.write('\n\n%s (Fixed Memory Offset, BaseAddress=-0x%010X, EntryPoint=-0x%010X)\n' % (ModuleName, 0 - BaseAddress, 0 - (BaseAddress + ModuleInfo.Image.EntryPoint)))
- else:
- MapBuffer.write('\n\n%s (Fixed Memory Address, BaseAddress=0x%010X, EntryPoint=0x%010X)\n' % (ModuleName, BaseAddress, BaseAddress + ModuleInfo.Image.EntryPoint))
- #
- # Add guid and general seciton section.
- #
- TextSectionAddress = 0
- DataSectionAddress = 0
- for SectionHeader in ModuleInfo.Image.SectionHeaderList:
- if SectionHeader[0] == '.text':
- TextSectionAddress = SectionHeader[1]
- elif SectionHeader[0] in ['.data', '.sdata']:
- DataSectionAddress = SectionHeader[1]
- if AddrIsOffset:
- MapBuffer.write('(GUID=%s, .textbaseaddress=-0x%010X, .databaseaddress=-0x%010X)\n' % (ModuleInfo.Guid, 0 - (BaseAddress + TextSectionAddress), 0 - (BaseAddress + DataSectionAddress)))
- else:
- MapBuffer.write('(GUID=%s, .textbaseaddress=0x%010X, .databaseaddress=0x%010X)\n' % (ModuleInfo.Guid, BaseAddress + TextSectionAddress, BaseAddress + DataSectionAddress))
- #
- # Add debug image full path.
- #
- MapBuffer.write('(IMAGE=%s)\n\n' % (ModuleDebugImage))
- #
- # Add funtion address
- #
- for Function in FunctionList:
- if AddrIsOffset:
- MapBuffer.write(' -0x%010X %s\n' % (0 - (BaseAddress + Function[1]), Function[0]))
- else:
- MapBuffer.write(' 0x%010X %s\n' % (BaseAddress + Function[1], Function[0]))
- ImageMap.close()
-
- #
- # for SMM module in SMRAM, the SMRAM will be allocated from base to top.
- #
- if ModeIsSmm:
- BaseAddress = BaseAddress + ModuleInfo.Image.Size
-
- ## Collect MAP information of all FVs
- #
- def _CollectFvMapBuffer (self, MapBuffer, Wa, ModuleList):
- if self.Fdf:
- # First get the XIP base address for FV map file.
- GuidPattern = re.compile("[-a-fA-F0-9]+")
- GuidName = re.compile("\(GUID=[-a-fA-F0-9]+")
- for FvName in Wa.FdfProfile.FvDict.keys():
- FvMapBuffer = os.path.join(Wa.FvDir, FvName + '.Fv.map')
- if not os.path.exists(FvMapBuffer):
- continue
- FvMap = open (FvMapBuffer, 'r')
- #skip FV size information
- FvMap.readline()
- FvMap.readline()
- FvMap.readline()
- FvMap.readline()
- for Line in FvMap:
- MatchGuid = GuidPattern.match(Line)
- if MatchGuid != None:
- #
- # Replace GUID with module name
- #
- GuidString = MatchGuid.group()
- if GuidString.upper() in ModuleList:
- Line = Line.replace(GuidString, ModuleList[GuidString.upper()].Name)
- MapBuffer.write('%s' % (Line))
- #
- # Add the debug image full path.
- #
- MatchGuid = GuidName.match(Line)
- if MatchGuid != None:
- GuidString = MatchGuid.group().split("=")[1]
- if GuidString.upper() in ModuleList:
- MapBuffer.write('(IMAGE=%s)\n' % (os.path.join(ModuleList[GuidString.upper()].DebugDir, ModuleList[GuidString.upper()].Name + '.efi')))
-
- FvMap.close()
-
- ## Collect MAP information of all modules
- #
- def _CollectModuleMapBuffer (self, MapBuffer, ModuleList):
- sys.stdout.write ("Generate Load Module At Fix Address Map")
- sys.stdout.flush()
- PatchEfiImageList = []
- PeiModuleList = {}
- BtModuleList = {}
- RtModuleList = {}
- SmmModuleList = {}
- PeiSize = 0
- BtSize = 0
- RtSize = 0
- # reserve 4K size in SMRAM to make SMM module address not from 0.
- SmmSize = 0x1000
- IsIpfPlatform = False
- if 'IPF' in self.ArchList:
- IsIpfPlatform = True
- for ModuleGuid in ModuleList:
- Module = ModuleList[ModuleGuid]
- GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (Module.MetaFile, Module.Arch, Module.ToolChain, Module.BuildTarget)
-
- OutputImageFile = ''
- for ResultFile in Module.CodaTargetList:
- if str(ResultFile.Target).endswith('.efi'):
- #
- # module list for PEI, DXE, RUNTIME and SMM
- #
- OutputImageFile = os.path.join(Module.OutputDir, Module.Name + '.efi')
- ImageClass = PeImageClass (OutputImageFile)
- if not ImageClass.IsValid:
- EdkLogger.error("build", FILE_PARSE_FAILURE, ExtraData=ImageClass.ErrorInfo)
- ImageInfo = PeImageInfo(Module.Name, Module.Guid, Module.Arch, Module.OutputDir, Module.DebugDir, ImageClass)
- if Module.ModuleType in ['PEI_CORE', 'PEIM', 'COMBINED_PEIM_DRIVER','PIC_PEIM', 'RELOCATABLE_PEIM', 'DXE_CORE']:
- PeiModuleList[Module.MetaFile] = ImageInfo
- PeiSize += ImageInfo.Image.Size
- elif Module.ModuleType in ['BS_DRIVER', 'DXE_DRIVER', 'UEFI_DRIVER']:
- BtModuleList[Module.MetaFile] = ImageInfo
- BtSize += ImageInfo.Image.Size
- elif Module.ModuleType in ['DXE_RUNTIME_DRIVER', 'RT_DRIVER', 'DXE_SAL_DRIVER', 'SAL_RT_DRIVER']:
- RtModuleList[Module.MetaFile] = ImageInfo
- #IPF runtime driver needs to be at 2 page alignment.
- if IsIpfPlatform and ImageInfo.Image.Size % 0x2000 != 0:
- ImageInfo.Image.Size = (ImageInfo.Image.Size / 0x2000 + 1) * 0x2000
- RtSize += ImageInfo.Image.Size
- elif Module.ModuleType in ['SMM_CORE', 'DXE_SMM_DRIVER']:
- SmmModuleList[Module.MetaFile] = ImageInfo
- SmmSize += ImageInfo.Image.Size
- if Module.ModuleType == 'DXE_SMM_DRIVER':
- PiSpecVersion = '0x00000000'
- if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification:
- PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION']
- # for PI specification < PI1.1, DXE_SMM_DRIVER also runs as BOOT time driver.
- if int(PiSpecVersion, 16) < 0x0001000A:
- BtModuleList[Module.MetaFile] = ImageInfo
- BtSize += ImageInfo.Image.Size
- break
- #
- # EFI image is final target.
- # Check EFI image contains patchable FixAddress related PCDs.
- #
- if OutputImageFile != '':
- ModuleIsPatch = False
- for Pcd in Module.ModulePcdList:
- if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST:
- ModuleIsPatch = True
- break
- if not ModuleIsPatch:
- for Pcd in Module.LibraryPcdList:
- if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST:
- ModuleIsPatch = True
- break
-
- if not ModuleIsPatch:
- continue
- #
- # Module includes the patchable load fix address PCDs.
- # It will be fixed up later.
- #
- PatchEfiImageList.append (OutputImageFile)
-
- #
- # Get Top Memory address
- #
- ReservedRuntimeMemorySize = 0
- TopMemoryAddress = 0
- if self.LoadFixAddress == 0xFFFFFFFFFFFFFFFF:
- TopMemoryAddress = 0
- else:
- TopMemoryAddress = self.LoadFixAddress
- if TopMemoryAddress < RtSize + BtSize + PeiSize:
- EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS is too low to load driver")
- # Make IPF runtime driver at 2 page alignment.
- if IsIpfPlatform:
- ReservedRuntimeMemorySize = TopMemoryAddress % 0x2000
- RtSize = RtSize + ReservedRuntimeMemorySize
-
- #
- # Patch FixAddress related PCDs into EFI image
- #
- for EfiImage in PatchEfiImageList:
- EfiImageMap = EfiImage.replace('.efi', '.map')
- if not os.path.exists(EfiImageMap):
- continue
- #
- # Get PCD offset in EFI image by GenPatchPcdTable function
- #
- PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage)
- #
- # Patch real PCD value by PatchPcdValue tool
- #
- for PcdInfo in PcdTable:
- ReturnValue = 0
- if PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE:
- ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE, str (PeiSize/0x1000))
- elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE:
- ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE_DATA_TYPE, str (BtSize/0x1000))
- elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE:
- ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE, str (RtSize/0x1000))
- elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE and len (SmmModuleList) > 0:
- ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE, str (SmmSize/0x1000))
- if ReturnValue != 0:
- EdkLogger.error("build", PARAMETER_INVALID, "Patch PCD value failed", ExtraData=ErrorInfo)
-
- MapBuffer.write('PEI_CODE_PAGE_NUMBER = 0x%x\n' % (PeiSize/0x1000))
- MapBuffer.write('BOOT_CODE_PAGE_NUMBER = 0x%x\n' % (BtSize/0x1000))
- MapBuffer.write('RUNTIME_CODE_PAGE_NUMBER = 0x%x\n' % (RtSize/0x1000))
- if len (SmmModuleList) > 0:
- MapBuffer.write('SMM_CODE_PAGE_NUMBER = 0x%x\n' % (SmmSize/0x1000))
-
- PeiBaseAddr = TopMemoryAddress - RtSize - BtSize
- BtBaseAddr = TopMemoryAddress - RtSize
- RtBaseAddr = TopMemoryAddress - ReservedRuntimeMemorySize
-
- self._RebaseModule (MapBuffer, PeiBaseAddr, PeiModuleList, TopMemoryAddress == 0)
- self._RebaseModule (MapBuffer, BtBaseAddr, BtModuleList, TopMemoryAddress == 0)
- self._RebaseModule (MapBuffer, RtBaseAddr, RtModuleList, TopMemoryAddress == 0)
- self._RebaseModule (MapBuffer, 0x1000, SmmModuleList, AddrIsOffset = False, ModeIsSmm = True)
- MapBuffer.write('\n\n')
- sys.stdout.write ("\n")
- sys.stdout.flush()
-
- ## Save platform Map file
- #
- def _SaveMapFile (self, MapBuffer, Wa):
- #
- # Map file path is got.
- #
- MapFilePath = os.path.join(Wa.BuildDir, Wa.Name + '.map')
- #
- # Save address map into MAP file.
- #
- SaveFileOnChange(MapFilePath, MapBuffer.getvalue(), False)
- MapBuffer.close()
- if self.LoadFixAddress != 0:
- sys.stdout.write ("\nLoad Module At Fix Address Map file can be found at %s\n" %(MapFilePath))
- sys.stdout.flush()
-
- ## Build active platform for different build targets and different tool chains
- #
- def _BuildPlatform(self):
- for BuildTarget in self.BuildTargetList:
- GlobalData.gGlobalDefines['TARGET'] = BuildTarget
- for ToolChain in self.ToolChainList:
- GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain
- GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = ToolChain
- Wa = WorkspaceAutoGen(
- self.WorkspaceDir,
- self.PlatformFile,
- BuildTarget,
- ToolChain,
- self.ArchList,
- self.BuildDatabase,
- self.TargetTxt,
- self.ToolDef,
- self.Fdf,
- self.FdList,
- self.FvList,
- self.CapList,
- self.SkuId,
- self.UniFlag,
- self.Progress
- )
- self.Fdf = Wa.FdfFile
- self.LoadFixAddress = Wa.Platform.LoadFixAddress
- self.BuildReport.AddPlatformReport(Wa)
- self.Progress.Stop("done!")
- self._Build(self.Target, Wa)
-
- # Create MAP file when Load Fix Address is enabled.
- if self.Target in ["", "all", "fds"]:
- for Arch in Wa.ArchList:
- GlobalData.gGlobalDefines['ARCH'] = Arch
- #
- # Check whether the set fix address is above 4G for 32bit image.
- #
- if (Arch == 'IA32' or Arch == 'ARM') and self.LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >= 0x100000000:
- EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platform with IA32 or ARM arch modules")
- #
- # Get Module List
- #
- ModuleList = {}
- for Pa in Wa.AutoGenObjectList:
- for Ma in Pa.ModuleAutoGenList:
- if Ma == None:
- continue
- if not Ma.IsLibrary:
- ModuleList[Ma.Guid.upper()] = Ma
-
- MapBuffer = StringIO('')
- if self.LoadFixAddress != 0:
- #
- # Rebase module to the preferred memory address before GenFds
- #
- self._CollectModuleMapBuffer(MapBuffer, ModuleList)
- if self.Fdf:
- #
- # create FDS again for the updated EFI image
- #
- self._Build("fds", Wa)
- if self.Fdf:
- #
- # Create MAP file for all platform FVs after GenFds.
- #
- self._CollectFvMapBuffer(MapBuffer, Wa, ModuleList)
- #
- # Save MAP buffer into MAP file.
- #
- self._SaveMapFile (MapBuffer, Wa)
-
- ## Build active module for different build targets, different tool chains and different archs
- #
- def _BuildModule(self):
- for BuildTarget in self.BuildTargetList:
- GlobalData.gGlobalDefines['TARGET'] = BuildTarget
- for ToolChain in self.ToolChainList:
- GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain
- GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = ToolChain
- #
- # module build needs platform build information, so get platform
- # AutoGen first
- #
- Wa = WorkspaceAutoGen(
- self.WorkspaceDir,
- self.PlatformFile,
- BuildTarget,
- ToolChain,
- self.ArchList,
- self.BuildDatabase,
- self.TargetTxt,
- self.ToolDef,
- self.Fdf,
- self.FdList,
- self.FvList,
- self.CapList,
- self.SkuId,
- self.UniFlag,
- self.Progress,
- self.ModuleFile
- )
- self.Fdf = Wa.FdfFile
- self.LoadFixAddress = Wa.Platform.LoadFixAddress
- Wa.CreateMakeFile(False)
- self.Progress.Stop("done!")
- MaList = []
- for Arch in Wa.ArchList:
- GlobalData.gGlobalDefines['ARCH'] = Arch
- Ma = ModuleAutoGen(Wa, self.ModuleFile, BuildTarget, ToolChain, Arch, self.PlatformFile)
- if Ma == None: continue
- MaList.append(Ma)
- self._Build(self.Target, Ma)
-
- self.BuildReport.AddPlatformReport(Wa, MaList)
- if MaList == []:
- EdkLogger.error(
- 'build',
- BUILD_ERROR,
- "Module for [%s] is not a component of active platform."\
- " Please make sure that the ARCH and inf file path are"\
- " given in the same as in [%s]" %\
- (', '.join(Wa.ArchList), self.PlatformFile),
- ExtraData=self.ModuleFile
- )
- # Create MAP file when Load Fix Address is enabled.
- if self.Target == "fds" and self.Fdf:
- for Arch in Wa.ArchList:
- #
- # Check whether the set fix address is above 4G for 32bit image.
- #
- if (Arch == 'IA32' or Arch == 'ARM') and self.LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >= 0x100000000:
- EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platorm with IA32 or ARM arch modules")
- #
- # Get Module List
- #
- ModuleList = {}
- for Pa in Wa.AutoGenObjectList:
- for Ma in Pa.ModuleAutoGenList:
- if Ma == None:
- continue
- if not Ma.IsLibrary:
- ModuleList[Ma.Guid.upper()] = Ma
-
- MapBuffer = StringIO('')
- if self.LoadFixAddress != 0:
- #
- # Rebase module to the preferred memory address before GenFds
- #
- self._CollectModuleMapBuffer(MapBuffer, ModuleList)
- #
- # create FDS again for the updated EFI image
- #
- self._Build("fds", Wa)
- #
- # Create MAP file for all platform FVs after GenFds.
- #
- self._CollectFvMapBuffer(MapBuffer, Wa, ModuleList)
- #
- # Save MAP buffer into MAP file.
- #
- self._SaveMapFile (MapBuffer, Wa)
-
- ## Build a platform in multi-thread mode
- #
- def _MultiThreadBuildPlatform(self):
- for BuildTarget in self.BuildTargetList:
- GlobalData.gGlobalDefines['TARGET'] = BuildTarget
- for ToolChain in self.ToolChainList:
- GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain
- GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = ToolChain
- Wa = WorkspaceAutoGen(
- self.WorkspaceDir,
- self.PlatformFile,
- BuildTarget,
- ToolChain,
- self.ArchList,
- self.BuildDatabase,
- self.TargetTxt,
- self.ToolDef,
- self.Fdf,
- self.FdList,
- self.FvList,
- self.CapList,
- self.SkuId,
- self.UniFlag,
- self.Progress
- )
- self.Fdf = Wa.FdfFile
- self.LoadFixAddress = Wa.Platform.LoadFixAddress
- self.BuildReport.AddPlatformReport(Wa)
- Wa.CreateMakeFile(False)
-
- # multi-thread exit flag
- ExitFlag = threading.Event()
- ExitFlag.clear()
- for Arch in Wa.ArchList:
- GlobalData.gGlobalDefines['ARCH'] = Arch
- Pa = PlatformAutoGen(Wa, self.PlatformFile, BuildTarget, ToolChain, Arch)
- if Pa == None:
- continue
- pModules = []
- for Module in Pa.Platform.Modules:
- # Get ModuleAutoGen object to generate C code file and makefile
- Ma = ModuleAutoGen(Wa, Module, BuildTarget, ToolChain, Arch, self.PlatformFile)
- if Ma == None:
- continue
- # Not to auto-gen for targets 'clean', 'cleanlib', 'cleanall', 'run', 'fds'
- if self.Target not in ['clean', 'cleanlib', 'cleanall', 'run', 'fds']:
- # for target which must generate AutoGen code and makefile
- if not self.SkipAutoGen or self.Target == 'genc':
- Ma.CreateCodeFile(True)
- if self.Target == "genc":
- continue
-
- if not self.SkipAutoGen or self.Target == 'genmake':
- Ma.CreateMakeFile(True)
- Ma.CreateAsBuiltInf()
- if self.Target == "genmake":
- continue
- self.Progress.Stop("done!")
- pModules.append(Ma)
-
- for Ma in pModules:
- # Generate build task for the module
- Bt = BuildTask.New(ModuleMakeUnit(Ma, self.Target))
- # Break build if any build thread has error
- if BuildTask.HasError():
- # we need a full version of makefile for platform
- ExitFlag.set()
- BuildTask.WaitForComplete()
- Pa.CreateMakeFile(False)
- EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
- # Start task scheduler
- if not BuildTask.IsOnGoing():
- BuildTask.StartScheduler(self.ThreadNumber, ExitFlag)
-
- # in case there's an interruption. we need a full version of makefile for platform
- Pa.CreateMakeFile(False)
- if BuildTask.HasError():
- EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
-
- #
- # Save temp tables to a TmpTableDict.
- #
- for Key in Wa.BuildDatabase._CACHE_:
- if Wa.BuildDatabase._CACHE_[Key]._RawData and Wa.BuildDatabase._CACHE_[Key]._RawData._Table and Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table:
- if TemporaryTablePattern.match(Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table):
- TmpTableDict[Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table] = Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Cur
- #
- #
- # All modules have been put in build tasks queue. Tell task scheduler
- # to exit if all tasks are completed
- #
- ExitFlag.set()
- BuildTask.WaitForComplete()
-
- #
- # Check for build error, and raise exception if one
- # has been signaled.
- #
- if BuildTask.HasError():
- EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)
-
- # Create MAP file when Load Fix Address is enabled.
- if self.Target in ["", "all", "fds"]:
- for Arch in Wa.ArchList:
- #
- # Check whether the set fix address is above 4G for 32bit image.
- #
- if (Arch == 'IA32' or Arch == 'ARM') and self.LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >= 0x100000000:
- EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platorm with IA32 or ARM arch modules")
- #
- # Get Module List
- #
- ModuleList = {}
- for Pa in Wa.AutoGenObjectList:
- for Ma in Pa.ModuleAutoGenList:
- if Ma == None:
- continue
- if not Ma.IsLibrary:
- ModuleList[Ma.Guid.upper()] = Ma
- #
- # Rebase module to the preferred memory address before GenFds
- #
- MapBuffer = StringIO('')
- if self.LoadFixAddress != 0:
- self._CollectModuleMapBuffer(MapBuffer, ModuleList)
-
- if self.Fdf:
- #
- # Generate FD image if there's a FDF file found
- #
- LaunchCommand(Wa.BuildCommand + ["fds"], Wa.MakeFileDir)
- #
- # Create MAP file for all platform FVs after GenFds.
- #
- self._CollectFvMapBuffer(MapBuffer, Wa, ModuleList)
- #
- # Save MAP buffer into MAP file.
- #
- self._SaveMapFile(MapBuffer, Wa)
-
- ## Generate GuidedSectionTools.txt in the FV directories.
- #
- def CreateGuidedSectionToolsFile(self):
- for BuildTarget in self.BuildTargetList:
- for ToolChain in self.ToolChainList:
- Wa = WorkspaceAutoGen(
- self.WorkspaceDir,
- self.PlatformFile,
- BuildTarget,
- ToolChain,
- self.ArchList,
- self.BuildDatabase,
- self.TargetTxt,
- self.ToolDef,
- self.Fdf,
- self.FdList,
- self.FvList,
- self.CapList,
- self.SkuId,
- self.UniFlag
- )
- FvDir = Wa.FvDir
- if not os.path.exists(FvDir):
- continue
-
- for Arch in self.ArchList:
- # Build up the list of supported architectures for this build
- prefix = '%s_%s_%s_' % (BuildTarget, ToolChain, Arch)
-
- # Look through the tool definitions for GUIDed tools
- guidAttribs = []
- for (attrib, value) in self.ToolDef.ToolsDefTxtDictionary.iteritems():
- if attrib.upper().endswith('_GUID'):
- split = attrib.split('_')
- thisPrefix = '_'.join(split[0:3]) + '_'
- if thisPrefix == prefix:
- guid = self.ToolDef.ToolsDefTxtDictionary[attrib]
- guid = guid.lower()
- toolName = split[3]
- path = '_'.join(split[0:4]) + '_PATH'
- path = self.ToolDef.ToolsDefTxtDictionary[path]
- path = self.GetFullPathOfTool(path)
- guidAttribs.append((guid, toolName, path))
-
- # Write out GuidedSecTools.txt
- toolsFile = os.path.join(FvDir, 'GuidedSectionTools.txt')
- toolsFile = open(toolsFile, 'wt')
- for guidedSectionTool in guidAttribs:
- print >> toolsFile, ' '.join(guidedSectionTool)
- toolsFile.close()
-
- ## Returns the full path of the tool.
- #
- def GetFullPathOfTool (self, tool):
- if os.path.exists(tool):
- return os.path.realpath(tool)
- else:
- # We need to search for the tool using the
- # PATH environment variable.
- for dirInPath in os.environ['PATH'].split(os.pathsep):
- foundPath = os.path.join(dirInPath, tool)
- if os.path.exists(foundPath):
- return os.path.realpath(foundPath)
-
- # If the tool was not found in the path then we just return
- # the input tool.
- return tool
-
- ## Launch the module or platform build
- #
- def Launch(self):
- if not self.ModuleFile:
- if not self.SpawnMode or self.Target not in ["", "all"]:
- self.SpawnMode = False
- self._BuildPlatform()
- else:
- self._MultiThreadBuildPlatform()
- self.CreateGuidedSectionToolsFile()
- else:
- self.SpawnMode = False
- self._BuildModule()
-
- ## Do some clean-up works when error occurred
- def Relinquish(self):
- OldLogLevel = EdkLogger.GetLevel()
- EdkLogger.SetLevel(EdkLogger.ERROR)
- #self.DumpBuildData()
- Utils.Progressor.Abort()
- if self.SpawnMode == True:
- BuildTask.Abort()
- EdkLogger.SetLevel(OldLogLevel)
-
- def DumpBuildData(self):
- CacheDirectory = os.path.join(self.WorkspaceDir, gBuildCacheDir)
- Utils.CreateDirectory(CacheDirectory)
- Utils.DataDump(Utils.gFileTimeStampCache, os.path.join(CacheDirectory, "gFileTimeStampCache"))
- Utils.DataDump(Utils.gDependencyDatabase, os.path.join(CacheDirectory, "gDependencyDatabase"))
-
- def RestoreBuildData(self):
- FilePath = os.path.join(self.WorkspaceDir, gBuildCacheDir, "gFileTimeStampCache")
- if Utils.gFileTimeStampCache == {} and os.path.isfile(FilePath):
- Utils.gFileTimeStampCache = Utils.DataRestore(FilePath)
- if Utils.gFileTimeStampCache == None:
- Utils.gFileTimeStampCache = {}
-
- FilePath = os.path.join(self.WorkspaceDir, gBuildCacheDir, "gDependencyDatabase")
- if Utils.gDependencyDatabase == {} and os.path.isfile(FilePath):
- Utils.gDependencyDatabase = Utils.DataRestore(FilePath)
- if Utils.gDependencyDatabase == None:
- Utils.gDependencyDatabase = {}
-
-def ParseDefines(DefineList=[]):
- DefineDict = {}
- if DefineList != None:
- for Define in DefineList:
- DefineTokenList = Define.split("=", 1)
- if not GlobalData.gMacroNamePattern.match(DefineTokenList[0]):
- EdkLogger.error('build', FORMAT_INVALID,
- "The macro name must be in the pattern [A-Z][A-Z0-9_]*",
- ExtraData=DefineTokenList[0])
-
- if len(DefineTokenList) == 1:
- DefineDict[DefineTokenList[0]] = "TRUE"
- else:
- DefineDict[DefineTokenList[0]] = DefineTokenList[1].strip()
- return DefineDict
-
-gParamCheck = []
-def SingleCheckCallback(option, opt_str, value, parser):
- if option not in gParamCheck:
- setattr(parser.values, option.dest, value)
- gParamCheck.append(option)
- else:
- parser.error("Option %s only allows one instance in command line!" % option)
-
-## Parse command line options
-#
-# Using standard Python module optparse to parse command line option of this tool.
-#
-# @retval Opt A optparse.Values object containing the parsed options
-# @retval Args Target of build command
-#
-def MyOptionParser():
- Parser = OptionParser(description=__copyright__,version=__version__,prog="build.exe",usage="%prog [options] [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]")
- Parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32','X64','IPF','EBC','ARM', 'AARCH64'], dest="TargetArch",
- help="ARCHS is one of list: IA32, X64, IPF, ARM, AARCH64 or EBC, which overrides target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option.")
- Parser.add_option("-p", "--platform", action="callback", type="string", dest="PlatformFile", callback=SingleCheckCallback,
- help="Build the platform specified by the DSC file name argument, overriding target.txt's ACTIVE_PLATFORM definition.")
- Parser.add_option("-m", "--module", action="callback", type="string", dest="ModuleFile", callback=SingleCheckCallback,
- help="Build the module specified by the INF file name argument.")
- Parser.add_option("-b", "--buildtarget", type="string", dest="BuildTarget", help="Using the TARGET to build the platform, overriding target.txt's TARGET definition.",
- action="append")
- Parser.add_option("-t", "--tagname", action="append", type="string", dest="ToolChain",
- help="Using the Tool Chain Tagname to build the platform, overriding target.txt's TOOL_CHAIN_TAG definition.")
- Parser.add_option("-x", "--sku-id", action="callback", type="string", dest="SkuId", callback=SingleCheckCallback,
- help="Using this name of SKU ID to build the platform, overriding SKUID_IDENTIFIER in DSC file.")
-
- Parser.add_option("-n", action="callback", type="int", dest="ThreadNumber", callback=SingleCheckCallback,
- help="Build the platform using multi-threaded compiler. The value overrides target.txt's MAX_CONCURRENT_THREAD_NUMBER. Less than 2 will disable multi-thread builds.")
-
- Parser.add_option("-f", "--fdf", action="callback", type="string", dest="FdfFile", callback=SingleCheckCallback,
- help="The name of the FDF file to use, which overrides the setting in the DSC file.")
- Parser.add_option("-r", "--rom-image", action="append", type="string", dest="RomImage", default=[],
- help="The name of FD to be generated. The name must be from [FD] section in FDF file.")
- Parser.add_option("-i", "--fv-image", action="append", type="string", dest="FvImage", default=[],
- help="The name of FV to be generated. The name must be from [FV] section in FDF file.")
- Parser.add_option("-C", "--capsule-image", action="append", type="string", dest="CapName", default=[],
- help="The name of Capsule to be generated. The name must be from [Capsule] section in FDF file.")
- Parser.add_option("-u", "--skip-autogen", action="store_true", dest="SkipAutoGen", help="Skip AutoGen step.")
- Parser.add_option("-e", "--re-parse", action="store_true", dest="Reparse", help="Re-parse all meta-data files.")
-
- Parser.add_option("-c", "--case-insensitive", action="store_true", dest="CaseInsensitive", default=False, help="Don't check case of file name.")
-
- Parser.add_option("-w", "--warning-as-error", action="store_true", dest="WarningAsError", help="Treat warning in tools as error.")
- Parser.add_option("-j", "--log", action="store", dest="LogFile", help="Put log in specified file as well as on console.")
-
- Parser.add_option("-s", "--silent", action="store_true", type=None, dest="SilentMode",
- help="Make use of silent mode of (n)make.")
- Parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")
- Parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed, "\
- "including library instances selected, final dependency expression, "\
- "and warning messages, etc.")
- Parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.")
- Parser.add_option("-D", "--define", action="append", type="string", dest="Macros", help="Macro: \"Name [= Value]\".")
-
- Parser.add_option("-y", "--report-file", action="store", dest="ReportFile", help="Create/overwrite the report to the specified filename.")
- Parser.add_option("-Y", "--report-type", action="append", type="choice", choices=['PCD','LIBRARY','FLASH','DEPEX','BUILD_FLAGS','FIXED_ADDRESS', 'EXECUTION_ORDER'], dest="ReportType", default=[],
- help="Flags that control the type of build report to generate. Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS, EXECUTION_ORDER]. "\
- "To specify more than one flag, repeat this option on the command line and the default flag set is [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS]")
- Parser.add_option("-F", "--flag", action="store", type="string", dest="Flag",
- help="Specify the specific option to parse EDK UNI file. Must be one of: [-c, -s]. -c is for EDK framework UNI file, and -s is for EDK UEFI UNI file. "\
- "This option can also be specified by setting *_*_*_BUILD_FLAGS in [BuildOptions] section of platform DSC. If they are both specified, this value "\
- "will override the setting in [BuildOptions] section of platform DSC.")
- Parser.add_option("-N", "--no-cache", action="store_true", dest="DisableCache", default=False, help="Disable build cache mechanism")
-
- (Opt, Args)=Parser.parse_args()
- return (Opt, Args)
-
-## Tool entrance method
-#
-# This method mainly dispatch specific methods per the command line options.
-# If no error found, return zero value so the caller of this tool can know
-# if it's executed successfully or not.
-#
-# @retval 0 Tool was successful
-# @retval 1 Tool failed
-#
-def Main():
- StartTime = time.time()
-
- # Initialize log system
- EdkLogger.Initialize()
-
- #
- # Parse the options and args
- #
- (Option, Target) = MyOptionParser()
- GlobalData.gOptions = Option
- GlobalData.gCaseInsensitive = Option.CaseInsensitive
-
- # Set log level
- if Option.verbose != None:
- EdkLogger.SetLevel(EdkLogger.VERBOSE)
- elif Option.quiet != None:
- EdkLogger.SetLevel(EdkLogger.QUIET)
- elif Option.debug != None:
- EdkLogger.SetLevel(Option.debug + 1)
- else:
- EdkLogger.SetLevel(EdkLogger.INFO)
-
- if Option.LogFile != None:
- EdkLogger.SetLogFile(Option.LogFile)
-
- if Option.WarningAsError == True:
- EdkLogger.SetWarningAsError()
-
- if platform.platform().find("Windows") >= 0:
- GlobalData.gIsWindows = True
- else:
- GlobalData.gIsWindows = False
-
- EdkLogger.quiet("Build environment: %s" % platform.platform())
- EdkLogger.quiet(time.strftime("Build start time: %H:%M:%S, %b.%d %Y\n", time.localtime()));
- ReturnCode = 0
- MyBuild = None
- try:
- if len(Target) == 0:
- Target = "all"
- elif len(Target) >= 2:
- EdkLogger.error("build", OPTION_NOT_SUPPORTED, "More than one targets are not supported.",
- ExtraData="Please select one of: %s" %(' '.join(gSupportedTarget)))
- else:
- Target = Target[0].lower()
-
- if Target not in gSupportedTarget:
- EdkLogger.error("build", OPTION_NOT_SUPPORTED, "Not supported target [%s]." % Target,
- ExtraData="Please select one of: %s" %(' '.join(gSupportedTarget)))
-
- #
- # Check environment variable: EDK_TOOLS_PATH, WORKSPACE, PATH
- #
- CheckEnvVariable()
- GlobalData.gCommandLineDefines.update(ParseDefines(Option.Macros))
-
- Workspace = os.getenv("WORKSPACE")
- #
- # Get files real name in workspace dir
- #
- GlobalData.gAllFiles = Utils.DirCache(Workspace)
-
- WorkingDirectory = os.getcwd()
- if not Option.ModuleFile:
- FileList = glob.glob(os.path.normpath(os.path.join(WorkingDirectory, '*.inf')))
- FileNum = len(FileList)
- if FileNum >= 2:
- EdkLogger.error("build", OPTION_NOT_SUPPORTED, "There are %d INF files in %s." % (FileNum, WorkingDirectory),
- ExtraData="Please use '-m <INF_FILE_PATH>' switch to choose one.")
- elif FileNum == 1:
- Option.ModuleFile = NormFile(FileList[0], Workspace)
-
- if Option.ModuleFile:
- if os.path.isabs (Option.ModuleFile):
- if os.path.normcase (os.path.normpath(Option.ModuleFile)).find (Workspace) == 0:
- Option.ModuleFile = NormFile(os.path.normpath(Option.ModuleFile), Workspace)
- Option.ModuleFile = PathClass(Option.ModuleFile, Workspace)
- ErrorCode, ErrorInfo = Option.ModuleFile.Validate(".inf", False)
- if ErrorCode != 0:
- EdkLogger.error("build", ErrorCode, ExtraData=ErrorInfo)
-
- if Option.PlatformFile != None:
- if os.path.isabs (Option.PlatformFile):
- if os.path.normcase (os.path.normpath(Option.PlatformFile)).find (Workspace) == 0:
- Option.PlatformFile = NormFile(os.path.normpath(Option.PlatformFile), Workspace)
- Option.PlatformFile = PathClass(Option.PlatformFile, Workspace)
-
- if Option.FdfFile != None:
- if os.path.isabs (Option.FdfFile):
- if os.path.normcase (os.path.normpath(Option.FdfFile)).find (Workspace) == 0:
- Option.FdfFile = NormFile(os.path.normpath(Option.FdfFile), Workspace)
- Option.FdfFile = PathClass(Option.FdfFile, Workspace)
- ErrorCode, ErrorInfo = Option.FdfFile.Validate(".fdf", False)
- if ErrorCode != 0:
- EdkLogger.error("build", ErrorCode, ExtraData=ErrorInfo)
-
- if Option.Flag != None and Option.Flag not in ['-c', '-s']:
- EdkLogger.error("build", OPTION_VALUE_INVALID, "UNI flag must be one of -c or -s")
-
- MyBuild = Build(Target, Workspace, Option)
- GlobalData.gCommandLineDefines['ARCH'] = ' '.join(MyBuild.ArchList)
- MyBuild.Launch()
- # Drop temp tables to avoid database locked.
- for TmpTableName in TmpTableDict:
- SqlCommand = """drop table IF EXISTS %s""" % TmpTableName
- TmpTableDict[TmpTableName].execute(SqlCommand)
- #MyBuild.DumpBuildData()
- except FatalError, X:
- if MyBuild != None:
- # for multi-thread build exits safely
- MyBuild.Relinquish()
- if Option != None and Option.debug != None:
- EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
- ReturnCode = X.args[0]
- except Warning, X:
- # error from Fdf parser
- if MyBuild != None:
- # for multi-thread build exits safely
- MyBuild.Relinquish()
- if Option != None and Option.debug != None:
- EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
- else:
- EdkLogger.error(X.ToolName, FORMAT_INVALID, File=X.FileName, Line=X.LineNumber, ExtraData=X.Message, RaiseError = False)
- ReturnCode = FORMAT_INVALID
- except KeyboardInterrupt:
- ReturnCode = ABORT_ERROR
- if Option != None and Option.debug != None:
- EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
- except:
- if MyBuild != None:
- # for multi-thread build exits safely
- MyBuild.Relinquish()
-
- # try to get the meta-file from the object causing exception
- Tb = sys.exc_info()[-1]
- MetaFile = GlobalData.gProcessingFile
- while Tb != None:
- if 'self' in Tb.tb_frame.f_locals and hasattr(Tb.tb_frame.f_locals['self'], 'MetaFile'):
- MetaFile = Tb.tb_frame.f_locals['self'].MetaFile
- Tb = Tb.tb_next
- EdkLogger.error(
- "\nbuild",
- CODE_ERROR,
- "Unknown fatal error when processing [%s]" % MetaFile,
- ExtraData="\n(Please send email to edk2-buildtools-devel@lists.sourceforge.net for help, attaching following call stack trace!)\n",
- RaiseError=False
- )
- EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
- ReturnCode = CODE_ERROR
- finally:
- Utils.Progressor.Abort()
-
- if ReturnCode == 0:
- Conclusion = "Done"
- elif ReturnCode == ABORT_ERROR:
- Conclusion = "Aborted"
- else:
- Conclusion = "Failed"
- FinishTime = time.time()
- BuildDuration = time.gmtime(int(round(FinishTime - StartTime)))
- BuildDurationStr = ""
- if BuildDuration.tm_yday > 1:
- BuildDurationStr = time.strftime("%H:%M:%S", BuildDuration) + ", %d day(s)"%(BuildDuration.tm_yday - 1)
- else:
- BuildDurationStr = time.strftime("%H:%M:%S", BuildDuration)
- if MyBuild != None:
- MyBuild.BuildReport.GenerateReport(BuildDurationStr)
- MyBuild.Db.Close()
- EdkLogger.SetLevel(EdkLogger.QUIET)
- EdkLogger.quiet("\n- %s -" % Conclusion)
- EdkLogger.quiet(time.strftime("Build end time: %H:%M:%S, %b.%d %Y", time.localtime()))
- EdkLogger.quiet("Build total time: %s\n" % BuildDurationStr)
- return ReturnCode
-
-if __name__ == '__main__':
- r = Main()
- ## 0-127 is a safe return range, and 1 is a standard default error
- if r < 0 or r > 127: r = 1
- sys.exit(r)
-
diff --git a/BaseTools/Source/Python/sitecustomize.py b/BaseTools/Source/Python/sitecustomize.py
deleted file mode 100644
index 22501f8bae..0000000000
--- a/BaseTools/Source/Python/sitecustomize.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-import sys
-import locale
-
-if sys.platform == "darwin":
- DefaultLocal = locale.getdefaultlocale()[1]
- if DefaultLocal is None:
- DefaultLocal = 'UTF8'
- sys.setdefaultencoding(DefaultLocal)
-
diff --git a/BaseTools/Tests/CToolsTests.py b/BaseTools/Tests/CToolsTests.py
deleted file mode 100644
index 67681ea77f..0000000000
--- a/BaseTools/Tests/CToolsTests.py
+++ /dev/null
@@ -1,35 +0,0 @@
-## @file
-# Unit tests for C based BaseTools
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import sys
-import unittest
-
-import TianoCompress
-modules = (
- TianoCompress,
- )
-
-
-def TheTestSuite():
- suites = map(lambda module: module.TheTestSuite(), modules)
- return unittest.TestSuite(suites)
-
-if __name__ == '__main__':
- allTests = TheTestSuite()
- unittest.TextTestRunner().run(allTests)
-
diff --git a/BaseTools/Tests/CheckPythonSyntax.py b/BaseTools/Tests/CheckPythonSyntax.py
deleted file mode 100644
index e27c341c0c..0000000000
--- a/BaseTools/Tests/CheckPythonSyntax.py
+++ /dev/null
@@ -1,74 +0,0 @@
-## @file
-# Unit tests for checking syntax of Python source code
-#
-# Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import unittest
-import py_compile
-
-import TestTools
-
-class Tests(TestTools.BaseToolsTest):
-
- def setUp(self):
- TestTools.BaseToolsTest.setUp(self)
-
- def SingleFileTest(self, filename):
- try:
- py_compile.compile(filename, doraise=True)
- except Exception, e:
- self.fail('syntax error: %s, Error is %s' % (filename, str(e)))
-
-def MakePythonSyntaxCheckTests():
- def GetAllPythonSourceFiles():
- pythonSourceFiles = []
- for (root, dirs, files) in os.walk(TestTools.PythonSourceDir):
- for filename in files:
- if filename.lower().endswith('.py'):
- pythonSourceFiles.append(
- os.path.join(root, filename)
- )
- return pythonSourceFiles
-
- def MakeTestName(filename):
- assert filename.lower().endswith('.py')
- name = filename[:-3]
- name = name.replace(TestTools.PythonSourceDir, '')
- name = name.replace(os.path.sep, '_')
- return 'test' + name
-
- def MakeNewTest(filename):
- test = MakeTestName(filename)
- newmethod = lambda self: self.SingleFileTest(filename)
- setattr(
- Tests,
- test,
- newmethod
- )
-
- for filename in GetAllPythonSourceFiles():
- MakeNewTest(filename)
-
-MakePythonSyntaxCheckTests()
-del MakePythonSyntaxCheckTests
-
-TheTestSuite = TestTools.MakeTheTestSuite(locals())
-
-if __name__ == '__main__':
- allTests = TheTestSuite()
- unittest.TextTestRunner().run(allTests)
-
-
diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile
deleted file mode 100644
index b7cb226da9..0000000000
--- a/BaseTools/Tests/GNUmakefile
+++ /dev/null
@@ -1,21 +0,0 @@
-## @file
-# GNU/Linux makefile for 'Tests' module build.
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-all: test
-
-test:
- @python RunTests.py
-
-clean:
- find . -name '*.pyc' -exec rm '{}' ';'
-
diff --git a/BaseTools/Tests/PythonToolsTests.py b/BaseTools/Tests/PythonToolsTests.py
deleted file mode 100644
index 7db5855e0b..0000000000
--- a/BaseTools/Tests/PythonToolsTests.py
+++ /dev/null
@@ -1,32 +0,0 @@
-## @file
-# Unit tests for Python based BaseTools
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import sys
-import unittest
-
-
-def TheTestSuite():
- suites = []
- import CheckPythonSyntax
- suites.append(CheckPythonSyntax.TheTestSuite())
- return unittest.TestSuite(suites)
-
-if __name__ == '__main__':
- allTests = TheTestSuite()
- unittest.TextTestRunner().run(allTests)
-
diff --git a/BaseTools/Tests/RunTests.py b/BaseTools/Tests/RunTests.py
deleted file mode 100644
index 193bc60625..0000000000
--- a/BaseTools/Tests/RunTests.py
+++ /dev/null
@@ -1,40 +0,0 @@
-## @file
-# Unit tests for BaseTools utilities
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import sys
-import unittest
-
-import TestTools
-
-sys.path.append(TestTools.PythonSourceDir)
-
-def GetCTestSuite():
- import CToolsTests
- return CToolsTests.TheTestSuite()
-
-def GetPythonTestSuite():
- import PythonToolsTests
- return PythonToolsTests.TheTestSuite()
-
-def GetAllTestsSuite():
- return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])
-
-if __name__ == '__main__':
- allTests = GetAllTestsSuite()
- unittest.TextTestRunner(verbosity=2).run(allTests)
-
diff --git a/BaseTools/Tests/TestTools.py b/BaseTools/Tests/TestTools.py
deleted file mode 100644
index e838ae4294..0000000000
--- a/BaseTools/Tests/TestTools.py
+++ /dev/null
@@ -1,179 +0,0 @@
-## @file
-# Utility functions and classes for BaseTools unit tests
-#
-# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import base64
-import os
-import os.path
-import random
-import shutil
-import subprocess
-import sys
-import types
-import unittest
-
-TestsDir = os.path.realpath(os.path.split(sys.argv[0])[0])
-BaseToolsDir = os.path.realpath(os.path.join(TestsDir, '..'))
-CSourceDir = os.path.join(BaseToolsDir, 'Source', 'C')
-PythonSourceDir = os.path.join(BaseToolsDir, 'Source', 'Python')
-TestTempDir = os.path.join(TestsDir, 'TestTempDir')
-
-def MakeTheTestSuite(localItems):
- tests = []
- for name, item in localItems.iteritems():
- if isinstance(item, types.TypeType):
- if issubclass(item, unittest.TestCase):
- tests.append(unittest.TestLoader().loadTestsFromTestCase(item))
- elif issubclass(item, unittest.TestSuite):
- tests.append(item())
- return lambda: unittest.TestSuite(tests)
-
-def GetBaseToolsPaths():
- if sys.platform in ('win32', 'win64'):
- return [ os.path.join(BaseToolsDir, 'Bin', sys.platform.title()) ]
- else:
- uname = os.popen('uname -sm').read().strip()
- for char in (' ', '/'):
- uname = uname.replace(char, '-')
- return [
- os.path.join(BaseToolsDir, 'Bin', uname),
- os.path.join(BaseToolsDir, 'BinWrappers', uname),
- os.path.join(BaseToolsDir, 'BinWrappers', 'PosixLike')
- ]
-
-BaseToolsBinPaths = GetBaseToolsPaths()
-
-class BaseToolsTest(unittest.TestCase):
-
- def cleanOutDir(self, dir):
- for dirItem in os.listdir(dir):
- if dirItem in ('.', '..'): continue
- dirItem = os.path.join(dir, dirItem)
- self.RemoveFileOrDir(dirItem)
-
- def CleanUpTmpDir(self):
- if os.path.exists(self.testDir):
- self.cleanOutDir(self.testDir)
-
- def HandleTreeDeleteError(self, function, path, excinfo):
- os.chmod(path, stat.S_IWRITE)
- function(path)
-
- def RemoveDir(self, dir):
- shutil.rmtree(dir, False, self.HandleTreeDeleteError)
-
- def RemoveFileOrDir(self, path):
- if not os.path.exists(path):
- return
- elif os.path.isdir(path):
- self.RemoveDir(path)
- else:
- os.remove(path)
-
- def DisplayBinaryData(self, description, data):
- print description, '(base64 encoded):'
- b64data = base64.b64encode(data)
- print b64data
-
- def DisplayFile(self, fileName):
- sys.stdout.write(self.ReadTmpFile(fileName))
- sys.stdout.flush()
-
- def FindToolBin(self, toolName):
- for binPath in BaseToolsBinPaths:
- bin = os.path.join(binPath, toolName)
- if os.path.exists(bin):
- break
- assert os.path.exists(bin)
- return bin
-
- def RunTool(self, *args, **kwd):
- if 'toolName' in kwd: toolName = kwd['toolName']
- else: toolName = None
- if 'logFile' in kwd: logFile = kwd['logFile']
- else: logFile = None
-
- if toolName is None: toolName = self.toolName
- bin = self.FindToolBin(toolName)
- if logFile is not None:
- logFile = open(os.path.join(self.testDir, logFile), 'w')
- popenOut = logFile
- else:
- popenOut = subprocess.PIPE
-
- args = [toolName] + list(args)
-
- Proc = subprocess.Popen(
- args, executable=bin,
- stdout=popenOut, stderr=subprocess.STDOUT
- )
-
- if logFile is None:
- Proc.stdout.read()
-
- return Proc.wait()
-
- def GetTmpFilePath(self, fileName):
- return os.path.join(self.testDir, fileName)
-
- def OpenTmpFile(self, fileName, mode = 'r'):
- return open(os.path.join(self.testDir, fileName), mode)
-
- def ReadTmpFile(self, fileName):
- f = open(self.GetTmpFilePath(fileName), 'r')
- data = f.read()
- f.close()
- return data
-
- def WriteTmpFile(self, fileName, data):
- f = open(self.GetTmpFilePath(fileName), 'w')
- f.write(data)
- f.close()
-
- def GenRandomFileData(self, fileName, minlen = None, maxlen = None):
- if maxlen is None: maxlen = minlen
- f = self.OpenTmpFile(fileName, 'w')
- f.write(self.GetRandomString(minlen, maxlen))
- f.close()
-
- def GetRandomString(self, minlen = None, maxlen = None):
- if minlen is None: minlen = 1024
- if maxlen is None: maxlen = minlen
- return ''.join(
- [chr(random.randint(0,255))
- for x in xrange(random.randint(minlen, maxlen))
- ])
-
- def setUp(self):
- self.savedEnvPath = os.environ['PATH']
- self.savedSysPath = sys.path[:]
-
- for binPath in BaseToolsBinPaths:
- os.environ['PATH'] = \
- os.path.pathsep.join((os.environ['PATH'], binPath))
-
- self.testDir = TestTempDir
- if not os.path.exists(self.testDir):
- os.mkdir(self.testDir)
- else:
- self.cleanOutDir(self.testDir)
-
- def tearDown(self):
- self.RemoveFileOrDir(self.testDir)
-
- os.environ['PATH'] = self.savedEnvPath
- sys.path = self.savedSysPath
-
diff --git a/BaseTools/Tests/TianoCompress.py b/BaseTools/Tests/TianoCompress.py
deleted file mode 100644
index 01cd975048..0000000000
--- a/BaseTools/Tests/TianoCompress.py
+++ /dev/null
@@ -1,74 +0,0 @@
-## @file
-# Unit tests for TianoCompress utility
-#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##
-# Import Modules
-#
-import os
-import random
-import sys
-import unittest
-
-import TestTools
-
-class Tests(TestTools.BaseToolsTest):
-
- def setUp(self):
- TestTools.BaseToolsTest.setUp(self)
- self.toolName = 'TianoCompress'
-
- def testHelp(self):
- result = self.RunTool('--help', logFile='help')
- #self.DisplayFile('help')
- self.assertTrue(result == 0)
-
- def compressionTestCycle(self, data):
- path = self.GetTmpFilePath('input')
- self.WriteTmpFile('input', data)
- result = self.RunTool(
- '-e',
- '-o', self.GetTmpFilePath('output1'),
- self.GetTmpFilePath('input')
- )
- self.assertTrue(result == 0)
- result = self.RunTool(
- '-d',
- '-o', self.GetTmpFilePath('output2'),
- self.GetTmpFilePath('output1')
- )
- self.assertTrue(result == 0)
- start = self.ReadTmpFile('input')
- finish = self.ReadTmpFile('output2')
- startEqualsFinish = start == finish
- if not startEqualsFinish:
- print
- print 'Original data did not match decompress(compress(data))'
- self.DisplayBinaryData('original data', start)
- self.DisplayBinaryData('after compression', self.ReadTmpFile('output1'))
- self.DisplayBinaryData('after decomression', finish)
- self.assertTrue(startEqualsFinish)
-
- def testRandomDataCycles(self):
- for i in range(8):
- data = self.GetRandomString(1024, 2048)
- self.compressionTestCycle(data)
- self.CleanUpTmpDir()
-
-TheTestSuite = TestTools.MakeTheTestSuite(locals())
-
-if __name__ == '__main__':
- allTests = TheTestSuite()
- unittest.TextTestRunner().run(allTests)
-
-
diff --git a/BaseTools/UserManuals/BootSectImage_Utility_Man_Page.rtf b/BaseTools/UserManuals/BootSectImage_Utility_Man_Page.rtf
deleted file mode 100644
index 10a28a0230..0000000000
--- a/BaseTools/UserManuals/BootSectImage_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,307 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 00000000000000000000}@\'cb\'ce\'cc\'e5;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f42\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f43\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f45\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f46\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f47\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f48\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\f49\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f50\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f62\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f63\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}
-{\f65\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f66\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f67\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f68\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
-{\f69\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f70\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f174\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f382\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}
-{\f383\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f385\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f386\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f389\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
-{\f390\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f412\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f413\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f415\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}
-{\f416\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f419\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f420\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\f422\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}
-{\f423\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f425\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f426\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f427\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
-{\f428\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f429\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f430\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f431\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}
-{\f432\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f433\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f435\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f436\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f440\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}
-{\f444\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}
-{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}
-{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}
-{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;
-\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;\red255\green255\blue255;}
-{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{
-\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{
-\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat
-heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked \ssemihidden \spriority9 Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 \slink18 \ssemihidden \sunhideused \styrsid5586544 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink17 \slocked \ssemihidden \styrsid5586544 Balloon Text Char;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid8402467 annotation reference;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext20 \slink21 \ssemihidden \sunhideused \styrsid8402467 annotation text;}{\*\cs21 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink20 \slocked \ssemihidden \styrsid8402467 Comment Text Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon20 \snext20 \slink23 \ssemihidden \sunhideused \styrsid8402467 annotation subject;}{\*\cs23 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon21 \slink22 \slocked \ssemihidden \styrsid8402467 Comment Subject Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid11486534 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid11486534 CodeCharacter;}{\*\cs26 \additive \spriority0 \styrsid16394004 st;}}{\*\pgptbl {\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}}
-{\*\rsidtbl \rsid854321\rsid1728542\rsid3426029\rsid5328796\rsid5465433\rsid5509614\rsid5586544\rsid8089322\rsid8330179\rsid8402467\rsid8539130\rsid9394584\rsid10374593\rsid11100704\rsid11486534\rsid11605559\rsid11993802\rsid12198464\rsid15015589
-\rsid15298565\rsid15883390\rsid16394004\rsid16395198}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo10\dy6\hr16\min20}
-{\revtim\yr2011\mo8\dy10\hr9\min38}{\version16}{\edmins103}{\nofpages2}{\nofwords336}{\nofchars1918}{\nofcharsws2250}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot5586544 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid5586544 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 BootSectImage.exe Options Filename}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544\charrsid5586544
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 Synopsis}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid5586544
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid8089322 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11993802\charrsid8089322 {\*\bkmkstart OLE_LINK1}{\*\bkmkstart OLE_LINK2}{\*\bkmkstart OLE_LINK3}\hich\af39\dbch\af31505\loch\f39 BootSectImage.exe }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390 \hich\af39\dbch\af31505\loch\f39 [-m] [-d | -v] -p }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8330179 \hich\af39\dbch\af31505\loch\f39 <F}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390 \hich\af39\dbch\af31505\loch\f39 ile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8330179
-\hich\af39\dbch\af31505\loch\f39 N}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390 \hich\af39\dbch\af31505\loch\f39 ame}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8330179 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8089322
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390 \hich\af39\dbch\af31505\loch\f39 BootSectImage.exe [-m}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11486534 \hich\af39\dbch\af31505\loch\f39 | -f}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390 \hich\af39\dbch\af31505\loch\f39 ] [-d | -v]
-\hich\f39 \endash \loch\f39 g }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8330179 \hich\af39\dbch\af31505\loch\f39 <D}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390 \hich\af39\dbch\af31505\loch\f39 est}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8330179 \hich\af39\dbch\af31505\loch\f39 F}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390 \hich\af39\dbch\af31505\loch\f39 ile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8330179
-\hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8330179 \hich\af39\dbch\af31505\loch\f39 <I}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390 \hich\af39\dbch\af31505\loch\f39 nput}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8330179 \hich\af39\dbch\af31505\loch\f39 F}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390
-\hich\af39\dbch\af31505\loch\f39 ile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8330179 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15883390
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15298565 \hich\af39\dbch\af31505\loch\f39 BootSectImage.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15298565
-\hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15298565 \loch\af39\dbch\af31505\hich\f39 \endash }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15298565 \hich\af39\dbch\af31505\loch\f39 h
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15298565 \hich\af39\dbch\af31505\loch\f39 BootSectImage.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15298565
-\hich\af39\dbch\af31505\loch\f39 --version}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid15298565\charrsid8089322
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5586544 {\*\bkmkend OLE_LINK1}{\*\bkmkend OLE_LINK2}{\*\bkmkend OLE_LINK3}
-\hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11100704 \hich\af39\dbch\af31505\loch\f39 The BootSectImage tool}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5465433 \hich\af39\dbch\af31505\loch\f39
- }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11993802\charrsid5509614 \hich\af39\dbch\af31505\loch\f39 print}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5465433 \hich\af39\dbch\af31505\loch\f39 s}{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11993802\charrsid5509614 \hich\af39\dbch\af31505\loch\f39 information or patch destination file by source file for }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid16394004\charrsid16394004
-\hich\af39\dbch\af31505\loch\f39 BIOS Parameter Block}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16394004 \hich\af39\dbch\af31505\loch\f39 (}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11993802\charrsid5509614 \hich\af39\dbch\af31505\loch\f39 BPB}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16394004 \hich\af39\dbch\af31505\loch\f39 ) }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11993802\charrsid5509614 \hich\af39\dbch\af31505\loch\f39 or M}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3426029 \hich\af39\dbch\af31505\loch\f39 aster }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11993802\charrsid5509614 \hich\af39\dbch\af31505\loch\f39 B}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3426029 \hich\af39\dbch\af31505\loch\f39 oot }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11993802\charrsid5509614 \hich\af39\dbch\af31505\loch\f39 R}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3426029 \hich\af39\dbch\af31505\loch\f39 ecord}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16394004 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3426029 \hich\af39\dbch\af31505\loch\f39 (MBR)}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11993802\charrsid5509614 .}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11100704 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544
-\hich\af39\dbch\af31505\loch\f39 If }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8402467 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 parser opt
-\hich\af39\dbch\af31505\loch\f39
-ion is specified, this tool will parse the content of input file with Filename and print BPB information to screen. If patch option specified, this tool will patch BPB information in dest file using data from input file, or MBR if \hich\f39 \endash
-\loch\f39 m option specified.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5586544 {\*\bkmkstart OLE_LINK4}{\*\bkmkstart OLE_LINK5}\hich\af39\dbch\af31505\loch\f39 Options}{
-\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid5586544
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11605559 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11605559\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11605559 \hich\af39\dbch\af31505\loch\f39 e specified, tool prints usage.}{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11605559\charrsid11605559
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544 {\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5}\hich\af39\dbch\af31505\loch\f39 -p, --parse
-\par }\pard \ltrpar\ql \fi426\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 Tool will parse input file with Filename.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 -g, --patch destfile\tab \tab \tab \tab \tab
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 Tool will patch destfile with data from input file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 -f, --force
-\par \tab \hich\af39\dbch\af31505\loch\f39 Force patch even if FAT type of SrcImage and DstImage mismatch.
-\par \hich\af39\dbch\af31505\loch\f39 -m, --mbr
-\par \tab \hich\af39\dbch\af31505\loch\f39 MBR will be processed if specified.
-\par \hich\af39\dbch\af31505\loch\f39 --version
-\par \tab \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit-v, --verbose
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 Turn on verbose output with informational messages printed. This is
-\hich\af39\dbch\af31505\loch\f39 a count value, so specifying \hich\f39 \endash \loch\f39 vv can be used to increase the verbosity level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 -q, --quiet
-\par \tab \hich\af39\dbch\af31505\loch\f39 Disable all messages except FATAL ERRORS
-\par \hich\af39\dbch\af31505\loch\f39 -d, --debug [#]
-\par \tab \hich\af39\dbch\af31505\loch\f39 Enable debug messages, at level #
-\par \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par \tab \hich\af39\dbch\af31505\loch\f39 Print copyright, version and usage of this program and exit
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid11486534 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid8539130 \hich\af39\dbch\af31505\loch\f39 Status codes returned}{
-\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid11486534
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts11\trleft-115\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid11486534\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw20 \clbrdrl\brdrs\brdrw20 \clbrdrb\brdrs\brdrw20 \clbrdrr\brdrs\brdrw20 \cltxlrtb\clftsWidth3\clwWidth2970\clpadl0\clpadt115\clpadb0\clpadr115\clpadfl3\clpadft3\clpadfb3\clpadfr3\clshdrawnil\clhidemark \cellx2855\clvertalt\clbrdrt
-\brdrs\brdrw20 \clbrdrl\brdrnone \clbrdrb\brdrs\brdrw20 \clbrdrr\brdrs\brdrw20 \cltxlrtb\clftsWidth3\clwWidth5850\clpadl0\clpadt115\clpadb0\clpadr115\clpadfl3\clpadft3\clpadfb3\clpadfr3\clshdrawnil\clhidemark \cellx8705\pard\plain \ltrpar
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {
-\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid11486534 {\*\bkmkstart OLE_LINK6}{\*\bkmkstart OLE_LINK7}\hich\af2\dbch\af13\loch\f2 -1}{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid11486534 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid9394584 \hich\af39\dbch\af13\loch\f39 Options value invalid or}{\rtlch\fcs1 \af0 \ltrch\fcs0
-\lang1033\langfe2052\kerning2\langfenp2052\insrsid1728542 \hich\af39\dbch\af13\loch\f39 options}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid9394584 \hich\af39\dbch\af13\loch\f39 conflict.}{\rtlch\fcs1 \af0
-\ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid11486534 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid11486534 \trowd \irow0\irowband0\ltrrow
-\ts11\trleft-115\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid11486534\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw20 \clbrdrl\brdrs\brdrw20
-\clbrdrb\brdrs\brdrw20 \clbrdrr\brdrs\brdrw20 \cltxlrtb\clftsWidth3\clwWidth2970\clpadl0\clpadt115\clpadb0\clpadr115\clpadfl3\clpadft3\clpadfb3\clpadfr3\clshdrawnil\clhidemark \cellx2855\clvertalt\clbrdrt\brdrs\brdrw20 \clbrdrl\brdrnone \clbrdrb
-\brdrs\brdrw20 \clbrdrr\brdrs\brdrw20 \cltxlrtb\clftsWidth3\clwWidth5850\clpadl0\clpadt115\clpadb0\clpadr115\clpadfl3\clpadft3\clpadfb3\clpadfr3\clshdrawnil\clhidemark \cellx8705\row \ltrrow}\trowd \irow1\irowband1\ltrrow
-\ts11\trleft-115\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid11486534\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrs\brdrw20 \clbrdrb
-\brdrs\brdrw20 \clbrdrr\brdrs\brdrw20 \cltxlrtb\clftsWidth3\clwWidth2970\clpadl0\clpadt115\clpadb0\clpadr115\clpadfl3\clpadft3\clpadfb3\clpadfr3\clshdrawnil\clhidemark \cellx2855\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrs\brdrw20 \clbrdrr
-\brdrs\brdrw20 \cltxlrtb\clftsWidth3\clwWidth5850\clpadl0\clpadt115\clpadb0\clpadr115\clpadfl3\clpadft3\clpadfb3\clpadfr3\clshdrawnil\clhidemark \cellx8705\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid11486534 {\*\bkmkend OLE_LINK6}{\*\bkmkend OLE_LINK7}0}{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid11486534 \cell }{
-\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid9394584 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid11486534 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0
-\fs20\insrsid11486534 \trowd \irow1\irowband1\ltrrow\ts11\trleft-115\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid11486534\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3
-\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrs\brdrw20 \clbrdrb\brdrs\brdrw20 \clbrdrr\brdrs\brdrw20 \cltxlrtb\clftsWidth3\clwWidth2970\clpadl0\clpadt115\clpadb0\clpadr115\clpadfl3\clpadft3\clpadfb3\clpadfr3\clshdrawnil\clhidemark \cellx2855\clvertalt\clbrdrt
-\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrs\brdrw20 \clbrdrr\brdrs\brdrw20 \cltxlrtb\clftsWidth3\clwWidth5850\clpadl0\clpadt115\clpadb0\clpadr115\clpadfl3\clpadft3\clpadfb3\clpadfr3\clshdrawnil\clhidemark \cellx8705\row \ltrrow}\pard\plain \ltrpar
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid16395198 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid9394584 \hich\af2\dbch\af13\loch\f2 1}{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid9394584\charrsid9394584 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid9394584 \hich\af39\dbch\af13\loch\f39
-Debug option value invalid.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid9394584 \trowd \irow2\irowband2\lastrow \ltrrow
-\ts11\trleft-115\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid9394584\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrs\brdrw20 \clbrdrb
-\brdrs\brdrw20 \clbrdrr\brdrs\brdrw20 \cltxlrtb\clftsWidth3\clwWidth2970\clpadl0\clpadt115\clpadb0\clpadr115\clpadfl3\clpadft3\clpadfb3\clpadfr3\clshdrawnil\clhidemark \cellx2855\clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrs\brdrw20 \clbrdrr
-\brdrs\brdrw20 \cltxlrtb\clftsWidth3\clwWidth5850\clpadl0\clpadt115\clpadb0\clpadr115\clpadfl3\clpadft3\clpadfb3\clpadfr3\clshdrawnil\clhidemark \cellx8705\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 1. c:\\Tools\\BootSectImage.exe \hich\f39 \endash \loch\f39 p loader.data
-\par \hich\af39\dbch\af31505\loch\f39 BPB information from loader.data will be displayed on screen.
-\par \hich\af39\dbch\af31505\loch\f39 2. c:\\Tools\\BootSectImage.exe \hich\f39 \endash \loch\f39 g Dest.data loader.data
-\par \hich\af39\dbch\af31505\loch\f39 BPB information in Dest.data will be patched by loader.data BPB.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 No known issues
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 19\hich\af39\dbch\af31505\loch\f39 99 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15015589 \hich\af39\dbch\af31505\loch\f39 20}{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11993802 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15015589 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid5586544 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be fou\hich\af39\dbch\af31505\loch\f39 nd at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }\pard \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5586544
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000a075
-7d26fe56cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/Build_Utility_Man_Page.rtf b/BaseTools/UserManuals/Build_Utility_Man_Page.rtf
deleted file mode 100644
index 6a0e7d9968..0000000000
--- a/BaseTools/UserManuals/Build_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,443 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch13\stshfloch37\stshfhich37\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
-{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New{\*\falt Courier New};}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f36\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri{\*\falt Century Gothic};}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma{\*\falt Times New Roman};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f41\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Consolas;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
-{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
-{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri{\*\falt Century Gothic};}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\f44\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
-{\f45\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\f47\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\f48\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}
-{\f49\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\f50\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\f51\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
-{\f52\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\f64\fbidi \fmodern\fcharset238\fprq1 Courier New CE{\*\falt Courier New};}{\f65\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr{\*\falt Courier New};}
-{\f67\fbidi \fmodern\fcharset161\fprq1 Courier New Greek{\*\falt Courier New};}{\f68\fbidi \fmodern\fcharset162\fprq1 Courier New Tur{\*\falt Courier New};}{\f69\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew){\*\falt Courier New};}
-{\f70\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic){\*\falt Courier New};}{\f71\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic{\*\falt Courier New};}{\f72\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese){\*\falt Courier New};}
-{\f176\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f404\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\f405\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\f407\fbidi \froman\fcharset161\fprq2 Cambria Greek;}
-{\f408\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\f411\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\f412\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\f414\fbidi \fswiss\fcharset238\fprq2 Calibri CE{\*\falt Century Gothic};}
-{\f415\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr{\*\falt Century Gothic};}{\f417\fbidi \fswiss\fcharset161\fprq2 Calibri Greek{\*\falt Century Gothic};}{\f418\fbidi \fswiss\fcharset162\fprq2 Calibri Tur{\*\falt Century Gothic};}
-{\f421\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic{\*\falt Century Gothic};}{\f422\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese){\*\falt Century Gothic};}{\f424\fbidi \fswiss\fcharset238\fprq2 Tahoma CE{\*\falt Times New Roman};}
-{\f425\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr{\*\falt Times New Roman};}{\f427\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek{\*\falt Times New Roman};}{\f428\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur{\*\falt Times New Roman};}
-{\f429\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew){\*\falt Times New Roman};}{\f430\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic){\*\falt Times New Roman};}{\f431\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic{\*\falt Times New Roman};}
-{\f432\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese){\*\falt Times New Roman};}{\f433\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai){\*\falt Times New Roman};}{\f446\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}
-{\f454\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f455\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f457\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f458\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f461\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f462\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}
-{\f464\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f465\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f467\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f468\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}
-{\f471\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f472\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
-{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}
-{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
-{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
-{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}
-{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}
-{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
-{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}
-{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
-{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE{\*\falt Century Gothic};}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr{\*\falt Century Gothic};}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek{\*\falt Century Gothic};}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur{\*\falt Century Gothic};}
-{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic{\*\falt Century Gothic};}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese){\*\falt Century Gothic};}
-{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}
-{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}
-{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
-\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
-\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs21\kerning2\loch\af37\hich\af37\dbch\af13 }{\*\defpap \ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }
-\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{
-\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat
-heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs21\lang1033\langfe2052\kerning2\loch\f37\hich\af37\dbch\af13\cgrid\langnp1033\langfenp2052
-\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f36\hich\af36\dbch\af13 \sbasedon10 \slink1 \slocked Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1
-\ab\ai\af0\afs28 \ltrch\fcs0 \b\i\fs28\loch\f36\hich\af36\dbch\af13 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \styrsid16534634 annotation reference;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext18 \slink19 \ssemihidden \styrsid16534634
-annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \f41 \sbasedon10 \slink18 \slocked \ssemihidden \styrsid16534634 Comment Text Char;}{\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025
-\ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon18 \snext18 \slink21 \ssemihidden \styrsid16534634 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b\f41
-\sbasedon19 \slink20 \slocked \ssemihidden \styrsid16534634 Comment Subject Char;}{\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext22 \slink23 \ssemihidden \styrsid16534634 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink22 \slocked \ssemihidden \styrsid16534634 Balloon Text Char;}{\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \styrsid14971029 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \styrsid14971029 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl
-\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f37\hich\af37\dbch\af13\cgrid\langnp1033\langfenp2052 \sbasedon11 \snext26 \styrsid14971029
-Table Grid;}}{\*\revtbl {Unknown;}{yzeng15;}}{\*\rsidtbl \rsid1063253\rsid1211840\rsid1381256\rsid1839752\rsid2442797\rsid2694053\rsid2974720\rsid4338091\rsid4590013\rsid4999604\rsid5116989\rsid5911148\rsid6164334\rsid6375506\rsid6492146\rsid6561745\rsid6579891\rsid6637302
-\rsid6827362\rsid7278947\rsid7820891\rsid8023663\rsid8600807\rsid8996461\rsid9010967\rsid10121491\rsid10897639\rsid11224689\rsid11427337\rsid12210198\rsid13245303\rsid13716787\rsid14971029\rsid15538292\rsid15612145\rsid16533044\rsid16534634}{\mmathPr
-\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator yzeng15}{\creatim\yr2010\mo10\dy6\hr13\min22}{\revtim\yr2011\mo8\dy31\hr14\min13}{\version29}{\edmins158}{\nofpages5}
-{\nofwords1165}{\nofchars6672}{\nofcharsws7822}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\ftnbj\aenddoc\revisions\trackmoves1\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701
-\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot1211840 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}
-{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang
-{\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang
-{\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx360\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Name
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build.exe \hich\f41 \endash \loch\f41 }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1063253 \hich\af41\dbch\af13\loch\f41 is }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 the master command that provides }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1063253 \hich\af41\dbch\af13\loch\f41 developers}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 with a single command for selecting various options of a build
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Synopsis
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build.exe }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2442797 \hich\af41\dbch\af13\loch\f41
-[-v | -q | -d] [-a <Arch>] [-p <DscFile>] [-m <InfFile>] [-b <Target>] [-t <TagName>] [-f FdfFile] [-r <RomImageName>] [-i <FvImageName>] }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15612145
-\hich\af41\dbch\af13\loch\f41 [-C <Cap}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8023663 \hich\af41\dbch\af13\loch\f41 sule}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15612145 \hich\af41\dbch\af13\loch\f41 ImageName>] }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2442797 \hich\af41\dbch\af13\loch\f41
-[-n ThreadNum] [-x <SkuId>] [-u] [-e] [-w] [-j <LogFile>] [-s] [-D <MACROS>] [-y <ReportFile>]\hich\af41\dbch\af13\loch\f41 [-Y <ReportType>] [-F <Flags>] }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
-[}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2442797 \hich\af41\dbch\af13\loch\f41 All | GenC | GenMake | Fds | Libraries | Modules | Clean | CleanAll | CleanLib | run}{\rtlch\fcs1 \ab\af41\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 ]}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11224689
-\par }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid13716787 \hich\af41\dbch\af13\loch\f41 Build.exe}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13716787 \hich\af41\dbch\af13\loch\f41 \hich\f41
-\endash \loch\f41 h
-\par }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid13716787 \hich\af41\dbch\af13\loch\f41 Build.exe}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13716787 \hich\af41\dbch\af13\loch\f41 --version}{
-\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13716787\charrsid13716787
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Description
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build.exe is the master command line (CLI) tool that provides a single command for selecting various }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9010967
-\hich\af41\dbch\af13\loch\f41 build options}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 . In general, it checks the environment variables, gets the user\hich\f41 \rquote \loch\f41
-s configuration from either the CLI or target.txt, parses the dsc, dec, inf, \hich\af41\dbch\af13\loch\f41
-target.txt, tools_def.txt, generates .C, .H files and the Makefiles for one or more modules and/or the active platform, calls a make (NMake or make) program to process these Makefiles, then optionally calls GenFds to generate an fd file.
-\par \hich\af41\dbch\af13\loch\f41 The build tool sup\hich\af41\dbch\af13\loch\f41 ports two kinds of path specifications on command line - an absolutely path or a relative (to the WORKSPACE environment variable) path \hich\f41 \endash \loch\f41
- in command line.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Options
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 There are no required options. }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11427337 \hich\af41\dbch\af13\loch\f41
-If no options are specified, it uses options specified in targe\hich\af41\dbch\af13\loch\f41 t.txt.}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11224689
-\par }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -a, --arch <ARCH>
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 ARCH is one of }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2974720
-\hich\af41\dbch\af13\loch\f41 a }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 list: IA32, X64, IPF or EBC, which overrides }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2974720
-\hich\af41\dbch\af13\loch\f41 the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 target.txt's TARGET_ARCH definition. To specify }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1063253
-\hich\af41\dbch\af13\loch\f41 another }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 ARCH, repeat this option.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -p, --platform PlatformName.dsc
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6164334
-\hich\af41\dbch\af13\loch\f41 s}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 the platform specified by the DSC file}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9010967
-\hich\af41\dbch\af13\loch\f41 . }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1063253 \hich\af41\dbch\af13\loch\f41 The}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 name argument, overrides }{
-\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1063253 \hich\af41\dbch\af13\loch\f41 the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 target.txt's ACTIVE_PLATFORM definition.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -m, --module ModuleName.inf
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6164334
-\hich\af41\dbch\af13\loch\f41 s}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 the module specified by the INF file name argument.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -b, --buildtarget <TARGET>
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 TARGET is one of}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid1063253 \hich\af41\dbch\af13\loch\f41 a}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 list: DEBUG, RELEASE,}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1727593357\langfenp2052\insrsid15538292 \hich\af41\dbch\af13\loch\f41 NOOPT}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1727593357\langfenp2052\insrsid15538292 \loch\af41\hich\af41\dbch\f13 \'a3\'ac}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 which overrides }{
-\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1063253 \hich\af41\dbch\af13\loch\f41 the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 target.txt\hich\af41\dbch\af13\loch\f41
-'s TARGET definition. To specify }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1063253 \hich\af41\dbch\af13\loch\f41 another }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
-TARGET, please repeat this option.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -t, --tagname Tagname
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Us}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1063253
-\hich\af41\dbch\af13\loch\f41 e}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6164334 \hich\af41\dbch\af13\loch\f41 s}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
- the Tool Chain Tagname to build the platform}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1063253 .}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9010967 \hich\af41\dbch\af13\loch\f41 }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid1063253 \hich\af41\dbch\af13\loch\f41 It }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 overrides target.txt's TOOL_CHAIN_TAG definition.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -f --fdf Filename.fdf
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 The name of the FDF file }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid6164334 \hich\af41\dbch\af13\loch\f41 to use to}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 override the setting in the DSC file.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -r --rom-image ROM_IMAGE_NAME
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
-The name of FD to be generated. The name must be from [FD] section in FDF file.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -i --fv-image FV_IMAGE_NAME
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 The name of FV to be generated. The name must be from [FV] section in
-\hich\af41\dbch\af13\loch\f41 FDF file.}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11224689
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0\pararsid10121491 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10121491 -}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid10121491 \hich\af41\dbch\af13\loch\f41 C}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10121491 \hich\af41\dbch\af13\loch\f41 --}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid6637302\charrsid6637302 \hich\af41\dbch\af13\loch\f41 capsule-image}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid10121491 \hich\af41\dbch\af13\loch\f41 CAPSULE}{\rtlch\fcs1 \ab\af41\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid10121491 \hich\af41\dbch\af13\loch\f41 _IMAGE_NAME
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0\pararsid6375506 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10121491\charrsid6375506 \hich\af41\dbch\af13\loch\f41
-The name of Capsule to be generated. The name must be from [Capsule] section in FDF file.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\pnrdate1190691435\pnrnot1\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -n NUM
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6164334
-\hich\af41\dbch\af13\loch\f41 s}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 the platform using multi-threaded compiler. The value overrides }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891
-\hich\af41\dbch\af13\loch\f41 the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 target.txt's MULTIPLE_THREAD and MAX_CONCURRENT_THREAD_NUMBER. }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891
-\hich\af41\dbch\af13\loch\f41 Using l}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 ess than 2 will disable multi-thread builds.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -x --sku-id SKU_ID}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid11224689
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891 \hich\af41\dbch\af13\loch\f41 Use}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 SKU ID to build the platform}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891 \hich\af41\dbch\af13\loch\f41 and override the}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 SKUID_IDENTIFIER in DSC file.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -u --skip-autogen}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid11224689
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891 \hich\af41\dbch\af13\loch\f41 Use to s}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 kip }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891 \hich\af41\dbch\af13\loch\f41 the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 AutoGen
-\hich\af41\dbch\af13\loch\f41 step. Note the build may fail if there\hich\f41 \rquote \loch\f41 s no AutoGen-ed files before.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -e --re-parse}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid11224689
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891 \hich\af41\dbch\af13\loch\f41 Use to r}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 e-parse all meta-data files. Use this option if you encounter }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891 \hich\af41\dbch\af13\loch\f41 an }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 inconsistency issue.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11224689
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -w --warning-as-error}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid11224689
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891 \hich\af41\dbch\af13\loch\f41 Use to t}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 reat warning in }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891 \hich\af41\dbch\af13\loch\f41 the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 tool as }{
-\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891 \hich\af41\dbch\af13\loch\f41 an }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 error.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -j --log LOGFILE}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid11224689
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7820891 \hich\af41\dbch\af13\loch\f41 Use to p}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 ut screen output in specified file.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -s \hich\f41 \endash \loch\f41 silent
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2974720 \hich\af41\dbch\af13\loch\f41 Enable }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\loch\af41\dbch\af13\hich\f41 \'93\loch\f41 \hich\f41 make\'94\loch\f41 \hich\f41 tool to run \'93\loch\f41 \hich\f41 silently\'94\loch\f41 . Internally, a \hich\f41 \lquote \loch\f41 -s\hich\f41 \rquote \loch\f41 \hich\f41 switch will be passed to \'93
-\loch\f41 \hich\f41 make\'94\loch\f41 tool. Don\hich\f41 \rquote \loch\f41 \hich\f41 t use this option if your \'93\loch\f41 \hich\f41 make\'94\loch\f41 tool doesn\hich\f41 \rquote \loch\f41 t support \hich\f41 \lquote \loch\f41 -s\hich\f41 \rquote
-\loch\f41 \hich\f41 . Instead, if your \'93\loch\f41 \hich\f41 make\'94\loch\f41 \hich\af41\dbch\af13\loch\f41 tool uses other option}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2974720 \hich\af41\dbch\af13\loch\f41 s}{\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 you could add it to the XX_XX_XX_MAKE_FLAGS in tools_def.txt.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -d, --debug [#]
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Enable debug messages at specified level. It is used by Tool itself.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -q, --quiet
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Disable all messages except FATAL ERRORS.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -v, --verbose
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2974720 \hich\af41\dbch\af13\loch\f41 Enable}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 verbose ou\hich\af41\dbch\af13\loch\f41 tput with informational messages printed.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -D, --define MACROS
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Macro: "Name [= Value]".
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -y, --report-file REPORTFILE}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid11224689
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Create/overwrite the report to the specified filename.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -Y, --report-type REPORTTYPE
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Flags that control the type of build report to generate.
-\hich\af41\dbch\af13\loch\f41
- Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS, EXECUTION_ORDER]. To specify more than one flag, repeat this option on the command line and the default flag set is [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS]}{
-\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11224689
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -F FLAG\hich\af41\dbch\af13\loch\f41 , --flag=FLAG}{\rtlch\fcs1
-\ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid11224689
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
-Specify the specific option to parse EDK UNI file. Must be one of: [-c, -s]. -c is for EDK framework UNI file, and -s is for EDK UEFI UNI file. This option can also be specified by setting *_*_*_BUILD_FLAGS in [BuildOptions] section of platfo
-\hich\af41\dbch\af13\loch\f41 rm DSC. If they are both specified, this value will override the setting in [BuildOptions] section of platform DSC.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 --version
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Show program copyright and version number then exit.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 -h, --help
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Print the copyright, version and usage of this program then exit.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11224689 {\*\bkmkstart _Ref299349210}\hich\af41\dbch\af13\loch\f41 Target{\*\bkmkend _Ref299349210}
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 If no target is given, then default target is ALL.
-\par }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 ALL}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
- Build everything for either the platform or module.
-\par }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 GenC}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
- Auto-generate all C files for either the platform or module.
-\par }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 GenMake}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Generate the Makefiles \hich\f41 \endash
-\loch\f41 if auto-generated files are missing,
-\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
- then auto-generate all C files first for either the platform or module.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Fds}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 Create the FD Image files.
-\par }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Libraries}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build all EDK Libraries and EDK II Libra
-\hich\af41\dbch\af13\loch\f41 ry Instances which are specified.
-\par }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Modules}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
- Build all EDK components and EDK II modules which are specified.
-\par }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Clean}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
- Remove intermediate files generated by the NMAKE command (leaving
-\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 the auto-generated C format, FD image files
-\hich\af41\dbch\af13\loch\f41 , PE32 output files, PCH
-\par \hich\af41\dbch\af13\loch\f41 files and LIB files).
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 CleanAll}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 Remove all }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6164334 \hich\af41\dbch\af13\loch\f41 intermediate}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
-, auto-generated, FV and FD image files \hich\f41 \endash \loch\f41
-\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
- state of the tree should be exactly as if a fresh checkout or install has
-\par \hich\af41\dbch\af13\loch\f41 \hich\af41\dbch\af13\loch\f41 occurred.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 CleanLib}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 Remove intermediate files generated by the NMAKE command AND LIB
-\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
- files (leaving the auto-generated, FV and FD image files, PE32 output
-\par \hich\af41\dbch\af13\loch\f41 files and PCH files)
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 run}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\hich\af41\dbch\af13\loch\f41 Run platform (for \hich\af41\dbch\af13\loch\f41 emulator platform only)
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid14971029 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid14971029 {\*\bkmkstart OLE_LINK3}{\*\bkmkstart OLE_LINK4}
-{\*\bkmkstart OLE_LINK5}{\*\bkmkstart OLE_LINK6}\hich\af41\dbch\af13\loch\f41 Status codes returned}{\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid14971029\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
-\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil \cellx8712
-\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid14971029 0}{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid14971029 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid14971029 \hich\af41\dbch\af13\loch\f41 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid14971029
-\cell }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {
-\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid14971029 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
-\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil \cellx8712
-\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid4338091 \hich\af2\dbch\af13\loch\f2 Nonzero}{
-\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid14971029\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid13245303\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid14971029 \hich\af41\dbch\af13\loch\f41 The action failed.\cell
-}\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af37\afs20 \ltrch\fcs0 \fs20\insrsid14971029 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
-\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil \cellx8712
-\row }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16534634 {\*\bkmkend OLE_LINK3}{\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5}
-{\*\bkmkend OLE_LINK6}
-\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11224689
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11224689
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Examples
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Assume that $(WORKSPACE) is C:\\MyWorkspace
-\par }\pard \ltrpar\ql \li180\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin180\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build platform: Nt32Pkg.dsc
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Specify the platform description file on the command line.
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 C:\\MyWorkspace>build -p Nt32Pkg\\Nt32Pkg.dsc \hich\f41 \endash
-\loch\f41 a IA32
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
-Build the platform in the current working directory if it contains a platform description file.
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 C:\\MyWorkspace\\Nt32Pk\hich\af41\dbch\af13\loch\f41 g>build \hich\f41
-\endash \loch\f41 a IA32
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build the active platform specified in the target.txt file.
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 C:\\ MyWorkspace>build \hich\f41 \endash \loch\f41 a Ia32
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11224689
-\par }\pard \ltrpar\ql \li180\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin180\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build Module: HelloWorld.inf
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Specify the platform and Module on the command line.
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 C:\\MyWorkspace>build -p Nt32Pkg\\Nt32Pkg.dsc \hich\f41 \endash
-\loch\f41 a IA32 \\
-\par }\pard \ltrpar\ql \li720\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 \hich\f41 \endash \hich\af41\dbch\af13\loch\f41
-m MdeModulePkg/Application/HelloWorld/HelloWorld.inf
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41
-Specify the Module on the command line and use the active platform specified in the target.txt file.
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 C:\\MyWorkspace>build \hich\f41 \endash \loch\f41 a IA32 \\
-\par }\pard \ltrpar\ql \li720\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \loch\af41\dbch\af13\hich\f41 \endash \loch\f41 m MdeModulePkg/Application/HelloWorld/HelloWorld.inf
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build the module \hich\af41\dbch\af13\loch\f41
-in the current working directory if it contains a module description file and specify the platform on the command line.
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 C:\\ MyWorkspace\\MdeModulePkg\\Application\\HelloWorld>build \hich\f41
-\endash \loch\f41 a Ia32 \\
-\par }\pard \ltrpar\ql \li720\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \loch\af41\dbch\af13\hich\f41 \endash \loch\f41 p Nt32Pkg\\Nt32Pkg.dsc
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Build the module in the current working direc\hich\af41\dbch\af13\loch\f41
-tory and use the active platform specified in the target.txt file.
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 C:\\ MyWorkspace\\MdeModulePkg\\Application\\HelloWorld>build \hich\f41
-\endash \loch\f41 a Ia32
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Bugs
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 No known }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9010967 \hich\af41\dbch\af13\loch\f41 issues.}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11224689
-\par \hich\af41\dbch\af13\loch\f41 Report bugs to edk2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11224689
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Files
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 target.txt, tools_def.txt, platform.dsc, flashmap.fdf, package.dec and module.inf.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11224689 \hich\af41\dbch\af13\loch\f41 See also
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 GenFds.exe
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11224689 \hich\af41\dbch\af13\loch\f41 License
-\par }\pard\plain \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 Copyright (c) 1999 - 201}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid1381256 \hich\af41\dbch\af13\loch\f41 1}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11224689 \hich\af41\dbch\af13\loch\f41 , Intel Corporation. All rights reserved.
-\par
-\par \hich\af41\dbch\af13\loch\f41 This program and the accompanying materials are licensed and made available under the terms and
-\par \hich\af41\dbch\af13\loch\f41 conditions of the BSD License which accompanies this distribution. The full text of the license may be
-\par \hich\af41\dbch\af13\loch\f41 found at:
-\par \hich\af41\dbch\af13\loch\f41 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af41\dbch\af13\loch\f41 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES
-\par \hich\af41\dbch\af13\loch\f41 OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8
-72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7
-2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b
-44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7
-065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000
-00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08
-84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc
-52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353
-bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468
-656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c
-070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7
-29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65
-312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8
-a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04
-98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c
-94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471
-7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671
-9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1
-e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5
-193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1
-17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2
-8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6
-6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a
-668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847
-bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e
-16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b
-5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0
-8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2
-c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966
-0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b
-7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb
-9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0
-088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf
-8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26
-ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0
-28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6
-345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93
-b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30
-254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74
-68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24
-51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198
-720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528
-a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000
-000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000
-002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468
-656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000
-00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000
-00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 heading 2;\lsdqformat1 \lsdpriority0 heading 3;\lsdqformat1 \lsdpriority0 heading 4;\lsdqformat1 \lsdpriority0 heading 5;
-\lsdqformat1 \lsdpriority0 heading 6;\lsdqformat1 \lsdpriority0 heading 7;\lsdqformat1 \lsdpriority0 heading 8;\lsdqformat1 \lsdpriority0 heading 9;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 7;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 8;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 9;\lsdqformat1 \lsdpriority0 caption;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 Title;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 Default Paragraph Font;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 Subtitle;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;
-\lsdunhideused0 \lsdlocked0 Revision;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;
-\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 0105000002000000180000004d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f000000000000000000000000e0ee
-b81fa567cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/EfiLdrImage_Utility_Man_Page.rtf b/BaseTools/UserManuals/EfiLdrImage_Utility_Man_Page.rtf
deleted file mode 100644
index 60ea39a97f..0000000000
--- a/BaseTools/UserManuals/EfiLdrImage_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,284 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 \slink18 \ssemihidden \sunhideused \styrsid14227342 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink17 \slocked \ssemihidden \styrsid14227342 Balloon Text Char;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid3615718 annotation reference;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext20 \slink21 \ssemihidden \sunhideused \styrsid3615718 annotation text;}{\*\cs21 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink20 \slocked \ssemihidden \styrsid3615718 Comment Text Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon20 \snext20 \slink23 \ssemihidden \sunhideused \styrsid3615718 annotation subject;}{\*\cs23 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon21 \slink22 \slocked \ssemihidden \styrsid3615718 Comment Subject Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid8600807 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid8600807 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh
-\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid4999604 Table Grid;}}{\*\rsidtbl \rsid1146210\rsid2496182\rsid3615718\rsid4999604\rsid5851758\rsid5911148\rsid5922889\rsid6122156\rsid6239696\rsid7634119\rsid7831486\rsid8089322\rsid8544345\rsid8600807\rsid9010605
-\rsid10178116\rsid11477561\rsid12198464\rsid12780272\rsid14227342\rsid14293206\rsid15732707}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}
-{\creatim\yr2010\mo10\dy6\hr16\min22}{\revtim\yr2011\mo8\dy10\hr9\min46}{\version16}{\edmins175}{\nofpages2}{\nofwords243}{\nofchars1387}{\nofcharsws1627}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot14227342 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1036\langfe1033\langnp1036\insrsid14227342\charrsid8544345 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\lang1036\langfe1033\langnp1036\insrsid14227342\charrsid8544345 \hich\af39\dbch\af31505\loch\f39 \hich\f39 EfiLdrImage.exe Options PE1 PE2 PE3 \'85
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1036\langfe1033\langnp1036\insrsid14227342\charrsid8544345 \hich\af39\dbch\af31505\loch\f39 Synopsis}{
-\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1036\langfe1033\langnp1036\insrsid14227342
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11477561 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11477561\charrsid8544345 \hich\af39\dbch\af31505\loch\f39 EfiLdrImage.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6122156 \hich\af39\dbch\af31505\loch\f39
- [-v | -q | -d]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11477561\charrsid8089322 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8600807
-\hich\af39\dbch\af31505\loch\f39 -o}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2496182 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12780272 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2496182 \hich\af39\dbch\af31505\loch\f39 File}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12780272 \hich\af39\dbch\af31505\loch\f39 N}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2496182
-\hich\af39\dbch\af31505\loch\f39 ame}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12780272 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8600807 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12780272 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8600807 \hich\af39\dbch\af31505\loch\f39 Input}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12780272
-\hich\af39\dbch\af31505\loch\f39 F}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8600807 \hich\af39\dbch\af31505\loch\f39 ile1}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12780272 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8600807 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4999604 \hich\af39\dbch\af31505\loch\f39 [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14293206
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8600807 \hich\af39\dbch\af31505\loch\f39 inputfile2}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14293206 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4999604 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12780272 \loch\af39\dbch\af31505\hich\f39 \'85}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11477561
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8600807 \hich\af39\dbch\af31505\loch\f39 EfiLdrImage.exe \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 EfiLdrImage.exe --version}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid8600807\charrsid8089322
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5851758 \hich\af39\dbch\af31505\loch\f39 The EfiLdrImage tool is used to }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid7634119
-\hich\af39\dbch\af31505\loch\f39 combine}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 PE files into }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid7634119
-\hich\af39\dbch\af31505\loch\f39 EFILDR image}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7634119 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14227342 \hich\af39\dbch\af31505\loch\f39
-with Efi loader header.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid8600807 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 Options}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid3615718
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid6239696 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6239696\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6239696 \hich\af39\dbch\af31505\loch\f39 e specified, tool prints usage.}{\rtlch\fcs1 \af0
-\ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid6239696\charrsid6239696
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 -o, --output Filename
-\par \tab \hich\af39\dbch\af31505\loch\f39 The file that contains the combined loader file.
-\par \hich\af39\dbch\af31505\loch\f39 --version}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14227342
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14227342 \tab \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit
-\par \hich\af39\dbch\af31505\loch\f39 -v, --verbose}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14227342
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14227342 \hich\af39\dbch\af31505\loch\f39
-Turn on verbose output with informational messages printed. This is a count value, so specifying \hich\f39 \endash \loch\f39 vv can be used to increase the verbosity level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 -q, --quiet}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14227342
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14227342 \tab \hich\af39\dbch\af31505\loch\f39 Disable all messages excep\hich\af39\dbch\af31505\loch\f39 t FATAL ERRORS
-\par \hich\af39\dbch\af31505\loch\f39 -d, --debug [#]}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14227342
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14227342 \tab \hich\af39\dbch\af31505\loch\f39 Enable debug messages, at level #
-\par \hich\af39\dbch\af31505\loch\f39 -h, --help}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14227342
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14227342 \tab \hich\af39\dbch\af31505\loch\f39 Print copyright, version and usage of this program and exit
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid4999604 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid8600807 {\*\bkmkstart OLE_LINK1}{\*\bkmkstart OLE_LINK2}
-\hich\af39\dbch\af31505\loch\f39 Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid8600807\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid4999604\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid8600807\charrsid8600807 \hich\af2\dbch\af13\loch\f2 STATUS_SUCCESS}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4999604 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid4999604\charrsid4999604 \tab }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid4999604 0}{\rtlch\fcs1 \ab\af2\afs18
-\ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid8600807 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid8600807 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0
-\kerning2\insrsid8600807 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid8600807 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb
-\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid4999604\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid8600807\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\kerning2\insrsid8600807\charrsid8600807 \hich\af2\dbch\af13\loch\f2
-STATUS_ERROR}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4999604 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid4999604\charrsid4999604 \tab \tab }{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid4999604 \hich\af2\dbch\af13\loch\f2 2}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid8600807\charrsid8600807
-\cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid9010605\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid8600807
-\hich\af39\dbch\af13\loch\f39 The action \hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid8600807 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid4999604\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid3615718
-{\*\bkmkend OLE_LINK1}{\*\bkmkend OLE_LINK2}
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 1. c:\\Tools\\EfiLdrImage.exe \hich\f39 \endash \loch\f39 o loader.img loader.data loader1.data
-\par \hich\af39\dbch\af31505\loch\f39 The loader.data and loader1.data will be put into loader.img file which contains a EFI loader header.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 No known issues
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14227342 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 1999 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5922889 \hich\af39\dbch\af31505\loch\f39 20}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11477561 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5922889 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14227342
-\hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. \hich\af39\dbch\af31505\loch\f39 The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }\pard \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid14227342
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000e04d
-d663ff56cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/EfiRom_Utility_Man_Page.rtf b/BaseTools/UserManuals/EfiRom_Utility_Man_Page.rtf
deleted file mode 100644
index c1087783b9..0000000000
--- a/BaseTools/UserManuals/EfiRom_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,272 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana;}{\f40\fbidi \fmodern\fcharset134\fprq1{\*\panose 00000000000000000000}\'d0\'c2\'cb\'ce\'cc\'e5;}
-{\f41\fbidi \fnil\fcharset134\fprq2{\*\panose 00000000000000000000}@\'cb\'ce\'cc\'e5;}{\f42\fbidi \fmodern\fcharset134\fprq1{\*\panose 00000000000000000000}@\'d0\'c2\'cb\'ce\'cc\'e5;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}
-{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE;}
-{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr;}{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek;}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur;}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic;}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese);}{\f447\fbidi \fmodern\fcharset0\fprq1 NSimSun Western;}{\f457\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f467\fbidi \fmodern\fcharset0\fprq1 @\'d0\'c2\'cb\'ce\'cc\'e5 Western;}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;\red163\green21\blue21;}{\*\defchp \fs21\kerning2\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs21\alang1025 \ltrch\fcs0 \fs21\lang1033\langfe2052\kerning2\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs44 \ltrch\fcs0 \b\f39\fs44\kerning44 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0
-\b\fs32\kerning0\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked \ssemihidden \spriority9 Heading 2 Char;}}{\*\rsidtbl \rsid143575\rsid541891\rsid1143002\rsid3304138\rsid7482167\rsid8667972\rsid10503224\rsid10945130\rsid11033084
-\rsid12077502\rsid12146371\rsid12734514\rsid14640521}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator kgui1}{\creatim\yr2011\mo11\dy24\hr21\min26}
-{\revtim\yr2011\mo12\dy1\hr9\min19}{\version13}{\edmins4}{\nofpages3}{\nofwords656}{\nofchars3745}{\nofcharsws4393}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701
-\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot12077502 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}
-{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang
-{\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang
-{\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 EfiRom.exe - build an Option ROM image
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 EfiRom.exe }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\cf18\lang1024\langfe1024\loch\af40\hich\af0\dbch\af40\noproof\insrsid14640521 \hich\af0\dbch\af40\loch\f40
--f VendorId -i DeviceId}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14640521 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 \hich\f39
-[options] Filename [Filename]\'85
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39
-EfiRom is used to build an Option ROM image from UEFI PE32 file(s) and/or legacy option ROM images that conform to PCI 2.3 or PCI 3.0 specifications for Option ROM layout. The EfiRom utility performs some rudimentary checking on the input Portable Executa
-\hich\af39\dbch\af31505\loch\f39 b\hich\af39\dbch\af31505\loch\f39 le (PE) PE32 files to verify they are indeed PE32 images. These checks include:
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Verification that the DOS stub magic value is 0x5A4D
-\par \hich\af39\dbch\af31505\loch\f39 \hich\f39 Verification that the PE signature is \'93\loch\f39 PE\\0\\\hich\f39 0\'94
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 If either of these checks fails then the utility will abort without creating
-\hich\af39\dbch\af31505\loch\f39 the output ROM image file.
-\par \hich\af39\dbch\af31505\loch\f39 This utility performs some rudimentary checking of the input binary files to verify they are indeed valid option ROM images. These checks include:
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Verification that the signature of the option ROM header is 0xAA55
-\par \hich\af39\dbch\af31505\loch\f39 Verification t\hich\af39\dbch\af31505\loch\f39 hat the offset to the PCI data structure is within the range of the file size.
-\par \hich\af39\dbch\af31505\loch\f39 \hich\f39 Verification that the signature of the PCI data structure is \'93\loch\f39 \hich\f39 PCIR\'94.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Filename1 [FilenameN]
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Input PE/PE32+/COFF or legacy option ROM image file(s).
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -o, --output RomFilena\hich\af39\dbch\af31505\loch\f39 me
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39
-The ROM filename being created. If not specified, use the first input filename as name and *.rom as the output filename extension.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -e, --efi
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Input PE/PE32+/COFF file(s)
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -b, --binary
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Input legacy option ROM image files.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -ec, --compress
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Compress input PE/\hich\af39\dbch\af31505\loch\f39 PE32+/COFF file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -n, --no-last-bit
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Do not set the LAST bit on the last file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -l ClassCode, --class-code=ClassCode
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Use ClassCode in the PCI data structure header in the input file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -r Rev, --Revision=Rev
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Use Rev in the PCI data structure header in the input file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -p, --pci23
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39
-Default layout meets PCI 3.0 specifications, specifying this flag will for a PCI 2.3 layout.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -d, --dump
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Dump the header of input option ROM image
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -i, --device-id
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Device ID}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3304138
-\hich\af39\dbch\af31505\loch\f39 , m}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid12077502 \hich\af39\dbch\af31505\loch\f39 ust be spe\hich\af39\dbch\af31505\loch\f39 cified.}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -f, --vendor-id
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Vendor ID}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3304138
-\hich\af39\dbch\af31505\loch\f39 , m}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid12734514 \hich\af39\dbch\af31505\loch\f39 ust be specified.}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 --version
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program then exit.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39
-Turn on verbose output with informational messages printed. This is a count value, so specifying \hich\f39 \endash \loch\f39 v\hich\af39\dbch\af31505\loch\f39 can be used to increase the verbosity level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -q, --quiet
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Disable all messages except FATAL ERRORS.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -d, --debug [#]
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Enable debug messages, at level #.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Print the copyright, version and usage of this program then exit.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Examples
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Generate the Option\hich\af39\dbch\af31505\loch\f39 ROM with two efi binary files and one legacy binary file. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10503224
-\hich\af39\dbch\af31505\loch\f39 Vendor ID and Device ID are both specified in command line. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 \hich\f39
-The output filename is not specified in command line, so the output filename will be \'93\loch\f39 \hich\f39 File1.rom\'94\loch\f39 . The output filename is the same as the \hich\af39\dbch\af31505\loch\f39 \hich\f39
-first input filename with the extension \'93\loch\f39 \hich\f39 .rom\'94
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 EfiRom }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11033084 \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 i 0xABCD \hich\f39
-\endash \loch\f39 f 0x1234 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 e File1.efi File2.efi \hich\f39 \endash \loch\f39 b Legacy.bin
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Generate the Option ROM with two efi binary files and one legacy binary file with the output filename specified on the command line.}{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid541891 \hich\af39\dbch\af31505\loch\f39 Vendor ID and Device ID are both specified in command line}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1143002 .}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid10945130
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 EfiRom }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8667972 \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 i 0xABCD \hich\f39 \endash
-\loch\f39 f 0x1234 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 o file.rom \hich\f39 \endash \loch\f39 e File1.efi File2.efi \hich\f39 \endash \loch\f39 b Legacy.bin
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Generate the Option ROM with two efi binary files and one legacy binary file. The output filename is not specified in c\hich\af39\dbch\af31505\loch\f39
-\hich\f39 ommand line, so the output filename will be \'93\loch\f39 \hich\f39 File1.rom\'94\loch\f39 \hich\f39 . The output filename is the same as the first input filename with the extension \'93\loch\f39 \hich\f39 .rom\'94\loch\f39
-. Vendor ID and Device ID are both specified in command line and the efi binary files will be compressed using th\hich\af39\dbch\af31505\loch\f39 e\hich\af39\dbch\af31505\loch\f39 Tiano Compression algorithm.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 EfiRom \hich\f39 \endash \loch\f39 i 0xABCD \hich\f39 \endash \loch\f39 f 0x1234 \hich\f39 \endash \loch\f39 ec File1.efi File2.efi \hich\f39 \endash
-\loch\f39 b Legacy.bin
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39
-Generate the Option ROM with two efi binary files and one legacy binary file with the output filename is specified in command line. Vendor ID and Device ID are b\hich\af39\dbch\af31505\loch\f39
-oth specified in command line and the efi binary files will be compressed using the Tiano Compression algorithm.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 EfiRom \hich\f39 \endash \loch\f39 o file.rom \hich\f39 \endash \loch\f39 i 0xABCD \hich\f39 \endash \loch\f39 f 0x1234 \hich\f39 \endash \loch\f39
-ec File1.efi File2.efi \hich\f39 \endash \loch\f39 b Legacy.bin
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 No known bugs.
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.sou\hich\af39\dbch\af31505\loch\f39 rceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid10945130
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid10945130 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 1999 - 20}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid143575 \hich\af39\dbch\af31505\loch\f39 11}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10945130
-\hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the term\hich\af39\dbch\af31505\loch\f39 s and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES\hich\af39\dbch\af31505\loch\f39 OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90
-fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2
-ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae
-a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1
-399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5
-4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84
-0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b
-c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7
-689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20
-5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0
-aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d
-316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840
-545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a
-c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100
-0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7
-8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89
-d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500
-1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f
-bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6
-a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a
-0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021
-0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008
-00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e500000000000000000000000060d8
-3d35c7afcc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/Fpd2Dsc_Utility_Man_Page.rtf b/BaseTools/UserManuals/Fpd2Dsc_Utility_Man_Page.rtf
deleted file mode 100644
index 67013fc57b..0000000000
--- a/BaseTools/UserManuals/Fpd2Dsc_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,286 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid16339470 annotation reference;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid16339470 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink18 \slocked \ssemihidden \styrsid16339470 Comment Text Char;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid16339470 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid16339470 Comment Subject Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid16339470 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid16339470 Balloon Text Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid15613251 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid15613251 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh
-\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid15613251 Table Grid;}}{\*\rsidtbl \rsid333279\rsid2624780\rsid4143951\rsid4999604\rsid5911148\rsid6188885\rsid8089322\rsid8600807\rsid8744855\rsid10316551\rsid10694641\rsid11086328\rsid11813356\rsid12198464
-\rsid12786293\rsid13377248\rsid15227435\rsid15613251\rsid16190093\rsid16339470}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}
-{\creatim\yr2010\mo11\dy8\hr10\min48}{\revtim\yr2011\mo8\dy10\hr9\min47}{\version15}{\edmins33}{\nofpages3}{\nofwords301}{\nofchars1718}{\nofcharsws2015}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot11086328 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Fpd2Dsc.exe
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Fpd2Dsc.exe }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15227435 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Filename}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15227435 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13377248 \hich\af39\dbch\af31505\loch\f39 [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12786293 \hich\af39\dbch\af31505\loch\f39 -v | -q}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13377248 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2624780
-\hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash \loch\f39 o }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6188885 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2624780 \hich\af39\dbch\af31505\loch\f39 Output}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6188885 \hich\af39\dbch\af31505\loch\f39 F}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2624780 \hich\af39\dbch\af31505\loch\f39 ile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6188885
-\hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11086328
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2624780 \hich\af39\dbch\af31505\loch\f39 Fpd2Dsc.exe }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15227435
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2624780 \hich\af39\dbch\af31505\loch\f39 Filename}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15227435 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2624780 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12786293 \loch\af39\dbch\af31505\hich\f39 \endash }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2624780
-\hich\af39\dbch\af31505\loch\f39 a}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12786293 \hich\af39\dbch\af31505\loch\f39 [-v | -q]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2624780
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid4143951 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4143951 \hich\af39\dbch\af31505\loch\f39 Fpd2Dsc.exe \hich\f39 \endash
-\loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 Fpd2Dsc.exe --version}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid4143951\charrsid8089322
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4143951
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39
-Fpd2Dsc converts an FPD file to an Extended DSC file. It generates a new Extended DSC file by extracting Platform build-related information from FPD file. It does a literal mapping from XML schema to TEXT file.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Options}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid11086328
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid10316551 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10316551\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10316551 \hich\af39\dbch\af31505\loch\f39 e specified, tool pr
-\hich\af39\dbch\af31505\loch\f39 ints }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid10316551 \hich\af39\dbch\af31505\loch\f39 error message}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10316551 .}{
-\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid10316551\charrsid10316551
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 -o, --output Filename
-\par \hich\af39\dbch\af31505\loch\f39 Specify the name of the DSC file to be created.
-\par \hich\af39\dbch\af31505\loch\f39 -a --auto
-\par \tab \hich\af39\dbch\af31505\loch\f39 Automatically create the DSC file using the name of the FPD file and replacing file extension.
-\par \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Turn on verbose output with information\hich\af39\dbch\af31505\loch\f39
-al messages printed.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 -q, --quiet
-\par \tab \hich\af39\dbch\af31505\loch\f39 Disable all messages except FATAL ERRORS.
-\par \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par \tab \hich\af39\dbch\af31505\loch\f39 Print copyright, version and usage of this program and exit.
-\par \hich\af39\dbch\af31505\loch\f39 --version}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11086328
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11086328 \tab \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit.
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid16339470
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid15613251 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid15613251 \hich\af39\dbch\af31505\loch\f39 Status codes returned}{
-\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid15613251\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid15613251 0}{
-\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid15613251 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid15613251 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0
-\ltrch\fcs0 \kerning2\insrsid15613251 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid15613251 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb
-\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid15613251
-\hich\af2\dbch\af13\loch\f2 1}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid15613251\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid333279\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid15613251 \hich\af39\dbch\af13\loch\f39 The action failed.\cell
-}\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid15613251 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid15613251 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16339470
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid16339470
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 1. Fpd2Dsc c:\\EdkII\\EdkNt32Pkg\\Nt32.fpd \hich\f39 \endash \loch\f39 o c:\\EdkII\\EdkNt32Pkg\\Nt32.dsc
-\par \tab \hich\af39\dbch\af31505\loch\f39 Generate the Extended DSC file of NT32 platform based on its FPD file.
-\par \hich\af39\dbch\af31505\loch\f39 2. Fpd2Dsc c:\\EdkII\\EdkNt32Pkg\\Nt32.fp\hich\af39\dbch\af31505\loch\f39 d \hich\f39 \endash \loch\f39 a
-\par \hich\af39\dbch\af31505\loch\f39 Generate the Extended DSC file of NT32 platform based on its FPD file. It is the short form of example 1 since example 1 specifies the default DSC file name.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 No known issues.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 $(WORKSPACE)\\Conf\\FrameworkDatabase.db
-\par \hich\af39\dbch\af31505\loch\f39 $(WORKSPACE)\\Conf\\\hich\af39\dbch\af31505\loch\f39 tools_def.txt
-\par \hich\af39\dbch\af31505\loch\f39 Package description files listed in the above database files.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Spd2Dec.exe, Msa2Inf.exe
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 1999 - 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid10694641 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11086328 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made avai\hich\af39\dbch\af31505\loch\f39 lable
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASI\hich\af39\dbch\af31505\loch\f39 S,
-\par \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000000045
-b176ff56cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenBootSector_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenBootSector_Utility_Man_Page.rtf
deleted file mode 100644
index dfee8b118f..0000000000
--- a/BaseTools/UserManuals/GenBootSector_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,281 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 00000000000000000000}@\'cb\'ce\'cc\'e5;}{\f43\fbidi \fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f475\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f476\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f478\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f479\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f482\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f483\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs21\kerning2\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs21\alang1025 \ltrch\fcs0 \fs21\lang1033\langfe2052\kerning2\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs44 \ltrch\fcs0 \b\f39\fs44\kerning44 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0
-\b\fs32\kerning0\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid2845843 annotation reference;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid2845843 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20\lang0\langfe2052\kerning0\langnp0\langfenp2052
-\sbasedon10 \slink18 \slocked \ssemihidden \styrsid2845843 Comment Text Char;}{\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0
-\b\fs20\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid2845843 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0
-\b\f39\fs20\lang0\langfe2052\kerning0\langnp0\langfenp2052 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid2845843 Comment Subject Char;}{\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe2052\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid2845843 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0
-\f38\fs16\lang0\langfe2052\kerning0\langnp0\langfenp2052 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid2845843 Balloon Text Char;}{\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0
-\rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \spriority0 \styrsid3702744 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid3702744
-CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid3702744 Table Grid;}}{\*\rsidtbl \rsid30831\rsid1997213\rsid2187891\rsid2845843\rsid3702744\rsid4349102\rsid4464881\rsid4673256\rsid4999604\rsid5911148\rsid6109204\rsid7668629\rsid8600807\rsid9578817\rsid10314143
-\rsid11670632\rsid12197322\rsid12198464\rsid12716080\rsid14887753\rsid14892679\rsid15406319}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}
-{\creatim\yr2011\mo7\dy18\hr16\min5}{\revtim\yr2011\mo8\dy10\hr9\min43}{\version12}{\edmins1180}{\nofpages3}{\nofwords309}{\nofchars1764}{\nofcharsws2069}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot30831 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 GenBootSector.exe
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid30831 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid30831 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid30831\charrsid30831 \hich\af39\dbch\af31505\loch\f39 GenBootSector}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid30831 \hich\af39\dbch\af31505\loch\f39 .exe }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid6109204 \hich\af39\dbch\af31505\loch\f39 [-v | -q | -d] [-m] -i }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14887753 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6109204
-\hich\af39\dbch\af31505\loch\f39 Input}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14887753 \hich\af39\dbch\af31505\loch\f39 F}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6109204 \hich\af39\dbch\af31505\loch\f39 ile}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14887753 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6109204 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash \loch\f39 o }{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14887753 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6109204 \hich\af39\dbch\af31505\loch\f39 Output}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid14887753 \hich\af39\dbch\af31505\loch\f39 F}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6109204 \hich\af39\dbch\af31505\loch\f39 ile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14887753
-\hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6109204
-\par \hich\af39\dbch\af31505\loch\f39 GenBootSector.exe -l}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid30831
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6109204 \hich\af39\dbch\af31505\loch\f39 GenBootSector.exe \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 GenBootSector.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6109204\charrsid3702744 \hich\af39\dbch\af31505\loch\f39 --version
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid30831 \hich\af39\dbch\af31505\loch\f39 GenBootSector reads boot sector data of }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2845843 \hich\af39\dbch\af31505\loch\f39 a }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid30831 \hich\af39\dbch\af31505\loch\f39 drive into }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2845843 \hich\af39\dbch\af31505\loch\f39 a }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid30831
-\hich\af39\dbch\af31505\loch\f39 file or write boot sector data to a drive from a file, depending on where the drive appear in the options. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39
-A drive letter must be specified at \hich\f39 \endash \loch\f39 i or \hich\f39 \endash \loch\f39 o option because boot sector is related\hich\af39\dbch\af31505\loch\f39 with drives.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid3702744 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 Options}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid2845843
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid14892679 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14892679\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14892679 \hich\af39\dbch\af31505\loch\f39 e specified, tool prints usage.}{
-\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid14892679\charrsid14892679
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 -l, --list
-\par }\pard \ltrpar\ql \fi426\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 List all drive information in current system.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 -i, --input Filename\tab \tab \tab \tab \tab
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 The file or disk boot sector data will be read from.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 -o, --output Filename
-\par \tab \hich\af39\dbch\af31505\loch\f39 The file or disk boot sector data will be written to.
-\par \hich\af39\dbch\af31505\loch\f39 -m, --mbr\tab \hich\af39\dbch\af31505\loch\f39 MBR will be processed if specified.
-\par \hich\af39\dbch\af31505\loch\f39 --version\tab \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit
-\par \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 Turn on verbose output with informational messages printed. This is a c
-\hich\af39\dbch\af31505\loch\f39 ount value, so specifying \hich\f39 \endash \loch\f39 vv can be used to increase the verbosity level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 -q, --quiet
-\par \tab \hich\af39\dbch\af31505\loch\f39 disable all messages except FATAL ERRORS
-\par \hich\af39\dbch\af31505\loch\f39 -d, --debug [#]
-\par \tab \hich\af39\dbch\af31505\loch\f39 Enable debug messages, at level #
-\par \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par \tab \hich\af39\dbch\af31505\loch\f39 Print copyright, version and usage of this program and exit
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2845843
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid3702744 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid3702744 {\*\bkmkstart OLE_LINK10}{\*\bkmkstart OLE_LINK11}{\*\bkmkstart OLE_LINK3}{\*\bkmkstart OLE_LINK4}
-{\*\bkmkstart OLE_LINK5}{\*\bkmkstart OLE_LINK6}{\*\bkmkstart OLE_LINK9}{\*\bkmkstart OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid3702744\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid3702744
-{\*\bkmkend OLE_LINK10}{\*\bkmkend OLE_LINK11}0}{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid3702744 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid3702744 \hich\af39\dbch\af13\loch\f39
-The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid3702744 \cell }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid3702744 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb
-\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid3702744
-\hich\af2\dbch\af13\loch\f2 1}{\rtlch\fcs1 \af43\afs19 \ltrch\fcs0 \cs25\f43\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid3702744\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid9578817\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid3702744 \hich\af39\dbch\af13\loch\f39 The action
-\hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid3702744 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2845843 {\*\bkmkend OLE_LINK3}
-{\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5}{\*\bkmkend OLE_LINK6}{\*\bkmkend OLE_LINK9}{\*\bkmkend OLE_LINK14}
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 1. c:\\\hich\af39\dbch\af31505\loch\f39 Tools\\GenBootSector.exe -l
-\par \hich\af39\dbch\af31505\loch\f39 List information of all local drives.
-\par \hich\af39\dbch\af31505\loch\f39 2. c:\\Tools\\GenBootSector.exe -i a: -o data.com
-\par \hich\af39\dbch\af31505\loch\f39 Get boot sector data of drive a: and write them to data.com.
-\par \hich\af39\dbch\af31505\loch\f39 3. c:\\Tools\\GenBootSector.exe -i data.com -o a:
-\par \hich\af39\dbch\af31505\loch\f39 Update boot sector of drive a: w\hich\af39\dbch\af31505\loch\f39 ith data from data.com.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid12716080 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid12716080 \hich\af39\dbch\af31505\loch\f39 No known issues.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid30831 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 1999 - 2011}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10314143 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and condition\hich\af39\dbch\af31505\loch\f39 s of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,WITHOUT WARRANTIES OR REPRESENTATI\hich\af39\dbch\af31505\loch\f39 ONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }\pard \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid10314143
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90
-fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2
-ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae
-a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1
-399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5
-4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84
-0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b
-c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7
-689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20
-5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0
-aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d
-316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840
-545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a
-c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100
-0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7
-8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89
-d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500
-1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f
-bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6
-a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a
-0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021
-0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008
-00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000007072
-fcdefe56cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenCrc32_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenCrc32_Utility_Man_Page.rtf
deleted file mode 100644
index 61292258ce..0000000000
--- a/BaseTools/UserManuals/GenCrc32_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,297 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
-{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
-{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}
-{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f55\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f56\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
-{\f58\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f59\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f60\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f61\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
-{\f62\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f63\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}
-{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
-{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}
-{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
-{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}
-{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}
-{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
-{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}
-{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}
-{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}
-{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
-{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green127\blue127;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 \slink18 \ssemihidden \sunhideused \styrsid12206721 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink17 \slocked \ssemihidden \styrsid12206721 Balloon Text Char;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid2759676 annotation reference;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext20 \slink21 \ssemihidden \sunhideused \styrsid2759676 annotation text;}{\*\cs21 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink20 \slocked \ssemihidden \styrsid2759676 Comment Text Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon20 \snext20 \slink23 \ssemihidden \sunhideused \styrsid2759676 annotation subject;}{\*\cs23 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon21 \slink22 \slocked \ssemihidden \styrsid2759676 Comment Subject Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid6184429 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid6184429 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh
-\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid6184429 Table Grid;}}{\*\rsidtbl \rsid1192848\rsid1966294\rsid2759676\rsid3353825\rsid4348399\rsid4467160\rsid4922786\rsid4999604\rsid5911148\rsid6184429\rsid6386813\rsid8600807\rsid9250385\rsid9781783
-\rsid11760870\rsid12198464\rsid12206721\rsid14620079\rsid15543797}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo10\dy6\hr16\min42}
-{\revtim\yr2011\mo8\dy10\hr9\min48}{\version13}{\edmins288}{\nofpages2}{\nofwords375}{\nofchars2144}{\nofcharsws2514}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot11760870 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \fi-1300\li-140\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-140\itap0\pararsid6184429 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 GenCrc32.exe
-\par }\pard\plain \ltrpar\s2\ql \fi-1440\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid6184429 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 GenCrc32 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6184429 \hich\af39\dbch\af31505\loch\f39 [-v | -q | -}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid1966294 -}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6184429 \hich\af39\dbch\af31505\loch\f39 d}{\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid1966294 \hich\af39\dbch\af31505\loch\f39 ebug <\hich\af39\dbch\af31505\loch\f39 Level\hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6184429 \hich\af39\dbch\af31505\loch\f39 ] \hich\f39 \endash \loch\f39 e|-d -o }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4467160
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6184429 \hich\af39\dbch\af31505\loch\f39 Output}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4467160 \hich\af39\dbch\af31505\loch\f39 F}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6184429 \hich\af39\dbch\af31505\loch\f39 ile}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4467160 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6184429 \hich\af39\dbch\af31505\loch\f39
- }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4467160 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6184429
-\hich\af39\dbch\af31505\loch\f39 Input}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4467160 \hich\af39\dbch\af31505\loch\f39 F}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6184429 \hich\af39\dbch\af31505\loch\f39 ile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4467160 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6184429
-\par \hich\af39\dbch\af31505\loch\f39 GenCrc32 \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 GenCrc32 --version}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11760870
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid6184429 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 The GenCrc32 tool generate}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9781783 \hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39
- the CRC32 value when encoding the input file, put the calculated CRC32 value into the output file header, and then put the input file into the output file tail. When decoding the input file, GenCrc32 is used to verify the CRC32 value. If the CRC32 value
-\hich\af39\dbch\af31505\loch\f39 i\hich\af39\dbch\af31505\loch\f39
-s valid, the input file, except for CRC32 value, will be written to the output file. If the CRC32 value is not valid, the error message will be displayed and the output file will not be created.
-\par }\pard\plain \ltrpar\s2\ql \fi-1440\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid6184429 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Options}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid11760870
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid14620079 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14620079\charrsid12198464 {\*\bkmkstart OLE_LINK12}{\*\bkmkstart OLE_LINK13}\hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14620079
-\hich\af39\dbch\af31505\loch\f39 e specified, tool\hich\af39\dbch\af31505\loch\f39 prints usage.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid14620079\charrsid14620079 {\*\bkmkend OLE_LINK12}{\*\bkmkend OLE_LINK13}
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 -e }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870
-\hich\af39\dbch\af31505\loch\f39 Calculate CRC32 value for the input file.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 -d}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Verify CRC32 value for the input file.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 -o, --output Filename}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11760870
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 File will be created to store the output content.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 --version
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11760870 \hich\af0\dbch\af31505\loch\f0 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit
-
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Turn on verbose output with informational messages printed. This is a count value, so specifying \hich\f39 \endash
-\loch\f39 v can be used to increase the verbosity level.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 -q, --quiet}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11760870
-\par \tab \hich\af0\dbch\af31505\loch\f0 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Disable all messages exc\hich\af39\dbch\af31505\loch\f39 ept FATAL ERRORS
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 --debug [0-9]
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11760870 \tab \hich\af0\dbch\af31505\loch\f0 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Enable debug messages. Only 0-9 Level is supported.
-
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11760870 \tab \hich\af0\dbch\af31505\loch\f0 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39
-Print copyright, version and usage of this program and exit
-\par }\pard\plain \ltrpar\s2\ql \fi-1440\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid6184429 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6184429\charrsid6184429 {\*\bkmkstart OLE_LINK7}{\*\bkmkstart OLE_LINK8}\hich\af39\dbch\af31505\loch\f39
-Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid6184429
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid6184429\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6184429\charrsid8600807 \hich\af2\dbch\af13\loch\f2 STATUS_SUCCESS}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6184429 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6184429\charrsid4999604 \tab }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6184429 0}{\rtlch\fcs1 \ab\af2\afs18
-\ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid6184429 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6184429 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0
-\kerning2\insrsid6184429 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid6184429 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb
-\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid6184429\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\kerning2\insrsid6184429\charrsid8600807 \hich\af2\dbch\af13\loch\f2
-STATUS_ERROR}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6184429 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6184429\charrsid4999604 \tab \tab }{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6184429 \hich\af2\dbch\af13\loch\f2 2}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid6184429\charrsid8600807
-\cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid4348399\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid6184429
-\hich\af39\dbch\af13\loch\f39 The action \hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid6184429 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid6184429\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid6184429 \rtlch\fcs1
-\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11760870 {\*\bkmkend OLE_LINK7}{\*\bkmkend OLE_LINK8}
-\hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 \hich\f39 1. Calculate CRC32 value for the input file \'93\loch\f39 \hich\f39 file.sec\'94\loch\f39 and write the CRC32 value and input file into the output file "file.crc32".
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 GenCrc32 \hich\f39 \endash \loch\f39 e \hich\f39 \endash \loch\f39 o file.crc32 file.sec
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 2. Verify CRC32 value o\hich\af39\dbch\af31505\loch\f39
-f the input file "file.crc32" and write the input file (not including CRC32 value) to the output file "file.orig"
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 GenCrc32 \hich\f39 \endash \loch\f39 d \hich\f39 \endash \loch\f39 o file.orig file.crc32
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 3. Verify CRC32 value of the input file "file.crc32" in the quiet mode and write the input file (not inclu\hich\af39\dbch\af31505\loch\f39
-ding CRC32 value) to the output file "file.orig"
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 GenCrc32 \hich\f39 \endash \loch\f39 d -q \hich\f39 \endash \loch\f39 o file.orig file.crc32
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid6184429 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 No known bugs.
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11760870
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid6184429 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid6184429 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af2\afs20 \ltrch\fcs0
-\f2\fs20\insrsid11760870 \hich\af2\dbch\af31505\loch\f2 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid6184429 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11760870 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 2006 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6386813 \hich\af39\dbch\af31505\loch\f39 20}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid1192848 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6386813 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11760870
-\hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials
-\par \hich\af39\dbch\af31505\loch\f39 are licensed and made available under the terms and conditions of the BSD License
-\par \hich\af39\dbch\af31505\loch\f39 which accompanies this distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http:\hich\af39\dbch\af31505\loch\f39 //opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid11760870
-\par
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000002040
-efa9ff56cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenDepex_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenDepex_Utility_Man_Page.rtf
deleted file mode 100644
index d07cd45244..0000000000
--- a/BaseTools/UserManuals/GenDepex_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,327 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
-{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
-{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}
-{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f55\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f56\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
-{\f58\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f59\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f60\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f61\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
-{\f62\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f63\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}
-{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
-{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}
-{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
-{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}
-{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}
-{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
-{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}
-{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}
-{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}
-{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
-{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs21\kerning2\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs21\alang1025 \ltrch\fcs0 \fs21\lang1033\langfe2052\kerning2\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs44 \ltrch\fcs0 \b\f39\fs44\kerning44 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0
-\b\fs32\kerning0\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid15757365 annotation reference;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid15757365 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20\lang0\langfe2052\kerning0\langnp0\langfenp2052
-\sbasedon10 \slink18 \slocked \ssemihidden \styrsid15757365 Comment Text Char;}{\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0
-\b\fs20\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid15757365 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0
-\b\f39\fs20\lang0\langfe2052\kerning0\langnp0\langfenp2052 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid15757365 Comment Subject Char;}{\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe2052\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid15757365 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0
-\f38\fs16\lang0\langfe2052\kerning0\langnp0\langfenp2052 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid15757365 Balloon Text Char;}{\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0
-\rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \spriority0 \styrsid9260867 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid9260867
-CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid9260867 Table Grid;}}{\*\rsidtbl \rsid540413\rsid746529\rsid1516182\rsid1837945\rsid2960814\rsid3044027\rsid3803771\rsid3881082\rsid4939999\rsid4999604\rsid5911148\rsid8600807\rsid9260867\rsid10040013\rsid11362432
-\rsid11799969\rsid12198464\rsid15757365}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2011\mo7\dy18\hr16\min10}
-{\revtim\yr2011\mo8\dy10\hr10}{\version13}{\edmins119}{\nofpages3}{\nofwords639}{\nofchars3645}{\nofcharsws4276}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot11362432 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0
-\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 GenDepex.exe or GenDepex.py \hich\f39 \endash \loch\f39 Convert the dependency string of file to the binary PI dependency expression. }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid1516182
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 GenDepex.exe }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10040013 \hich\af39\dbch\af31505\loch\f39 [-q | -v | -d]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid3044027 \hich\af39\dbch\af31505\loch\f39 [-m]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9260867 \hich\af39\dbch\af31505\loch\f39 [-o }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1837945
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9260867 \hich\af39\dbch\af31505\loch\f39 Output}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1837945 \hich\af39\dbch\af31505\loch\f39 F}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9260867 \hich\af39\dbch\af31505\loch\f39 ile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1837945 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid9260867 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10040013 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash \loch\f39 t }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid1837945 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10040013 \hich\af39\dbch\af31505\loch\f39 ModuleType}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1837945
-\hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid10040013 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3044027 \loch\af39\dbch\af31505\hich\f39 \endash
-\loch\f39 e }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2960814 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3044027 \hich\af39\dbch\af31505\loch\f39 Expression}{\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid2960814 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3044027 \hich\af39\dbch\af31505\loch\f39 |}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182
-\hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2960814 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39
-dependency_expression_file}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1837945 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9260867 \hich\af39\dbch\af31505\loch\f39 GenDepex.exe \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 GenDepex.exe --version}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid9260867
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 GenDepex generate}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3881082 \hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182
-\hich\af39\dbch\af31505\loch\f39 the binary PI dependency expression according to module type}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3881082 \hich\af39\dbch\af31505\loch\f39
- by parsing the input dependency expression string or the preprocessed dxs file}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39
-. For PEIM module type, the PEI dependency expression will be generated. For DXE_DRIVER, UEFI_DRIVER, DXE_RUNTIME_DRIVER, DXE_SAL_DRIVER and DXE_SMM_DRIVER, the DXE dependency e\hich\af39\dbch\af31505\loch\f39 xpression will be generated.}{\rtlch\fcs1
-\af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1516182
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 GenDepex tool is not a standalone tool. When [depex] section is specified in module INF, it will be used by }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid15757365 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Build tool. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15757365
-\hich\af39\dbch\af31505\loch\f39 The }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Build tool first parses the content in [depex] section to create the dependency expression string,
-\hich\af39\dbch\af31505\loch\f39 then GenDepex will parse the generated string. When}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15757365 \hich\af39\dbch\af31505\loch\f39 a}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182
-\hich\af39\dbch\af31505\loch\f39 [depex] section is not specified, but File.dxs file exist, GenDepex tool will be used together with }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15757365 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Compiler and }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15757365 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 EDKII trim too}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15757365 \hich\af39\dbch\af31505\loch\f39 l}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182
-\hich\af39\dbch\af31505\loch\f39 . The File.dxs first is preprocessed by Compiler, }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15757365 \hich\af39\dbch\af31505\loch\f39 and then}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182
-\hich\af39\dbch\af31505\loch\f39 process\hich\af39\dbch\af31505\loch\f39 ed by }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15757365 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182
-\hich\af39\dbch\af31505\loch\f39 trim tool to remove all other code except for }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15757365 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182
-\hich\af39\dbch\af31505\loch\f39 dependency content, last}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15757365 \hich\af39\dbch\af31505\loch\f39 ly the}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182
-\hich\af39\dbch\af31505\loch\f39 GenPepex will process the preprocessed dependency file.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11799969\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11799969 \hich\af39\dbch\af31505\loch\f39 e specified, tool prints error message.}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4939999
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 dependency_expression_file}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid1516182
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Specify the name o\hich\af39\dbch\af31505\loch\f39
-f the preprocessed dxs file to be parsed into the binary PI dependency expression.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1516182
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 -o FILE, --output=FILE
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39
-Specify the name of depex file that contains the generated binary PI dependency expression.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1516182
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 -t MODULETYPE, --module-type=MODULETYPE
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39
-The type of module is for which the dependency expression serves. Only EDKII module type is supported.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1516182
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 -e EXPRESSION, --dependency-expression=EXPRESSION
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39
-The option value is the string of dependency expression. If this option presents, the input file will b\hich\af39\dbch\af31505\loch\f39 e ignored.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 -m, --optimize}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid1516182
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39
-Do some simple optimization on the expression to remove the duplicated guid.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1516182
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 -v, --verbose}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid1516182
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 \tab Run with verbose information.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1516182
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 -d DEBUG, --debug=DEBUG [0-9]}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid1516182
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Enable debug messages at specified level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 -q, --quiet}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid1516182
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Run with little information in quiet mode.}{\rtlch\fcs1 \af0\afs18
-\ltrch\fcs0 \f0\fs18\cf1\insrsid1516182
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 --version}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid1516182
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Show program's version number and exit
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Show this help message and exit
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid9260867 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9260867 {\*\bkmkstart OLE_LINK3}{\*\bkmkstart OLE_LINK4}\hich\af39\dbch\af31505\loch\f39
-Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9260867\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid9260867 0}{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid9260867 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid9260867 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0
-\kerning2\insrsid9260867 \cell }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid9260867 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb
-\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid9260867
-\hich\af2\dbch\af13\loch\f2 1}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid9260867\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid746529\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid9260867 \hich\af39\dbch\af13\loch\f39 The action \hich\af39\dbch\af13\loch\f39
-failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {
-\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid9260867 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1516182 {\*\bkmkend OLE_LINK3}{\*\bkmkend OLE_LINK4}\hich\af39\dbch\af31505\loch\f39 Example
-
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 1. Parse the input dependency string based on DXE_DRIVER module type to generate the binary PI dependency expression into the output test.depex file.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 GenDepex.exe -o test.depex -t DXE_DRIVER -e "\{ 0x26baccb2, 0x6f42, 0x11d4, \{\hich\af39\dbch\af31505\loch\f39
-0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81\} }{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid1516182 \}}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 AND \{
- 0xf617b358, 0x12cf, 0x414a, 0xa0, 0x69, 0x60, 0x67, 0x7b, 0xda, 0x13, 0xb3 \} END"
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 2. Parse the input dependency string based on DXE_DRIVER module type to generate the binary PI dependency expression in\hich\af39\dbch\af31505\loch\f39
-to the output test.depex file in the optimization mode.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1516182
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 GenDepex -o test.depex -t DXE_DRIVER -e "\{ 0x26baccb2, 0x6f42, 0x11d4, \{0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81\} \} AND \{
- 0x26baccb2, 0x6f42, 0x11d4, \{0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x8\hich\af39\dbch\af31505\loch\f39 1\} \} END" -m}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid1516182
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Same to
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 GenDepex -o test.depex -t DXE_DRIVER -e "\{ 0x26baccb2, 0x6f42, 0x11d4, \{0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81\} \} END"
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 3. Parse the input preprocessed dependency file (test.iii) based on DXE_DRIVER module type to generate the b\hich\af39\dbch\af31505\loch\f39
-inary PI dependency expression into the output test.depex.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1516182
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 GenDepex \hich\f39 \endash \loch\f39 o test.depex \hich\f39 \endash \loch\f39 t DXE_DRIVER test.iii
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Test.iii file is the preprocessed dxs file like:
-\par \hich\af39\dbch\af31505\loch\f39 DEPENDENCY_START
-\par \hich\af39\dbch\af31505\loch\f39 \{ 0x26baccb2, 0x6f42, 0x11d4, \{0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81\} \} AND
-\par \hich\af39\dbch\af31505\loch\f39 \{ 0xf617b358, 0x12cf, 0x414a, 0xa0, 0x69, 0x60, 0x67, 0x7b, 0xda, 0x13, 0xb3 \}
-\par \hich\af39\dbch\af31505\loch\f39 DEPENDENCY_END
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 No known bugs.
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1516182
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11362432 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 2007 - 2011}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. A\hich\af39\dbch\af31505\loch\f39 ll rights reserved.
-
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/lic\hich\af39\dbch\af31505\loch\f39 enses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1516182 \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\insrsid1516182
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1516182
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90
-fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2
-ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae
-a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1
-399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5
-4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84
-0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b
-c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7
-689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20
-5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0
-aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d
-316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840
-545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a
-c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100
-0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7
-8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89
-d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500
-1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f
-bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6
-a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a
-0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021
-0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008
-00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000f0ad
-2a3e0157cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenFds_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenFds_Utility_Man_Page.rtf
deleted file mode 100644
index 587f6fb5b6..0000000000
--- a/BaseTools/UserManuals/GenFds_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,413 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch13\stshfloch37\stshfhich37\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
-{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New{\*\falt Courier New};}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f36\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri{\*\falt Century Gothic};}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma{\*\falt Times New Roman};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f41\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Consolas;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
-{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}
-{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri{\*\falt Century Gothic};}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\f44\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
-{\f45\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\f47\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\f48\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}
-{\f49\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\f50\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\f51\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
-{\f52\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\f64\fbidi \fmodern\fcharset238\fprq1 Courier New CE{\*\falt Courier New};}{\f65\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr{\*\falt Courier New};}
-{\f67\fbidi \fmodern\fcharset161\fprq1 Courier New Greek{\*\falt Courier New};}{\f68\fbidi \fmodern\fcharset162\fprq1 Courier New Tur{\*\falt Courier New};}{\f69\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew){\*\falt Courier New};}
-{\f70\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic){\*\falt Courier New};}{\f71\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic{\*\falt Courier New};}{\f72\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese){\*\falt Courier New};}
-{\f176\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f404\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\f405\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\f407\fbidi \froman\fcharset161\fprq2 Cambria Greek;}
-{\f408\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\f411\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\f412\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\f414\fbidi \fswiss\fcharset238\fprq2 Calibri CE{\*\falt Century Gothic};}
-{\f415\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr{\*\falt Century Gothic};}{\f417\fbidi \fswiss\fcharset161\fprq2 Calibri Greek{\*\falt Century Gothic};}{\f418\fbidi \fswiss\fcharset162\fprq2 Calibri Tur{\*\falt Century Gothic};}
-{\f421\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic{\*\falt Century Gothic};}{\f422\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese){\*\falt Century Gothic};}{\f424\fbidi \fswiss\fcharset238\fprq2 Tahoma CE{\*\falt Times New Roman};}
-{\f425\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr{\*\falt Times New Roman};}{\f427\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek{\*\falt Times New Roman};}{\f428\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur{\*\falt Times New Roman};}
-{\f429\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew){\*\falt Times New Roman};}{\f430\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic){\*\falt Times New Roman};}{\f431\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic{\*\falt Times New Roman};}
-{\f432\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese){\*\falt Times New Roman};}{\f433\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai){\*\falt Times New Roman};}{\f446\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}
-{\f454\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f455\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f457\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f458\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f461\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f462\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}
-{\f464\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f465\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f467\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f468\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}
-{\f471\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f472\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
-{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}
-{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
-{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
-{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}
-{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}
-{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
-{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}
-{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
-{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE{\*\falt Century Gothic};}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr{\*\falt Century Gothic};}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek{\*\falt Century Gothic};}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur{\*\falt Century Gothic};}
-{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic{\*\falt Century Gothic};}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese){\*\falt Century Gothic};}
-{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}
-{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}
-{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
-\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
-\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs21\kerning2\loch\af37\hich\af37\dbch\af13 }{\*\defpap \ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }
-\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{
-\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat
-heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs21\lang1033\langfe2052\kerning2\loch\f37\hich\af37\dbch\af13\cgrid\langnp1033\langfenp2052
-\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f36\hich\af36\dbch\af13 \sbasedon10 \slink1 \slocked Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1
-\ab\ai\af0\afs28 \ltrch\fcs0 \b\i\fs28\loch\f36\hich\af36\dbch\af13 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 \slink18 \ssemihidden \styrsid9045387 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink17 \slocked \ssemihidden \styrsid9045387 Balloon Text Char;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \styrsid6561787 annotation reference;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext20 \slink21 \ssemihidden \styrsid6561787
-annotation text;}{\*\cs21 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f41\fs20 \sbasedon10 \slink20 \slocked \ssemihidden \styrsid6561787 Comment Text Char;}{\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1
-\ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon20 \snext20 \slink23 \ssemihidden \styrsid6561787 annotation subject;}{\*\cs23 \additive \rtlch\fcs1 \ab\af0\afs20
-\ltrch\fcs0 \b\f41\fs20 \sbasedon21 \slink22 \slocked \ssemihidden \styrsid6561787 Comment Subject Char;}{\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \styrsid10972537 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \styrsid10972537 CodeCharacter;}{\*\ts26\tsrowd
-\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f37\hich\af37\dbch\af13\cgrid\langnp1033\langfenp2052 \sbasedon11 \snext26 \styrsid10972537
-Table Grid;}{\s27\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext27 \slink28 \ssemihidden \sunhideused \styrsid4485839 Document Map;}{\*\cs28 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16\lang0\langfe1033\kerning0\langfenp1033 \sbasedon10 \slink27 \slocked \ssemihidden \styrsid4485839
-Document Map Char;}}{\*\rsidtbl \rsid2295390\rsid2305826\rsid3830244\rsid4485839\rsid4999604\rsid5316845\rsid5513321\rsid5911148\rsid6561787\rsid8089322\rsid8600807\rsid8933181\rsid9045387\rsid9519395\rsid9709990\rsid9780763\rsid10972537\rsid11487336
-\rsid11805687\rsid12198464\rsid12201627\rsid12915296\rsid12991318\rsid13252123\rsid13254357\rsid13310497\rsid13923130\rsid14303388\rsid16126217}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440
-\mintLim0\mnaryLim1}{\info{\operator yzeng15}{\creatim\yr2010\mo10\dy6\hr16\min46}{\revtim\yr2011\mo8\dy31\hr14\min14}{\version22}{\edmins57}{\nofpages2}{\nofwords932}{\nofchars5416}{\nofcharsws6336}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.micros
-oft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701
-\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind5\viewscale120\rsidroot9045387 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}
-{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang
-{\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang
-{\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid5513321\charrsid13310497 \hich\af41\dbch\af13\loch\f41 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid5513321\charrsid13310497 \hich\af41\dbch\af13\loch\f41 GenFds.exe
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9045387\charrsid13310497 \hich\af41\dbch\af13\loch\f41 Synopsis}{\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid9045387\charrsid16126217
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid9780763 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9780763 \hich\af41\dbch\af13\loch\f41 GenFds}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9780763\charrsid8089322 \hich\af41\dbch\af13\loch\f41 .exe }{\rtlch\fcs1
-\ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9780763 \hich\af41\dbch\af13\loch\f41 [}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 -v | -q | -d}{\rtlch\fcs1
-\ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9780763 \hich\af41\dbch\af13\loch\f41 ]}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 [-w }{\rtlch\fcs1 \ab\af41\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 <}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 Workspace}{
-\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 >}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130
-\hich\af41\dbch\af13\loch\f41 ] [-D }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 <}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 Macro=Value}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 >}{\rtlch\fcs1
-\ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 ]}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \loch\af41\dbch\af13\hich\f41 \'85}
-{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 [-a }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990
-\hich\af41\dbch\af13\loch\f41 <}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 Arch}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 L}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 ist}{\rtlch\fcs1 \ab\af41\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 >}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 ] [-o }{\rtlch\fcs1
-\ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 <}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41
-Output}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 D}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130
-\hich\af41\dbch\af13\loch\f41 ir}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 >}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 ]}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2305826 \hich\af41\dbch\af13\loch\f41 [-r }{\rtlch\fcs1
-\ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 <}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2305826 \hich\af41\dbch\af13\loch\f41 Fd}{
-\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 N}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2305826
-\hich\af41\dbch\af13\loch\f41 ame}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 >}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2305826 \hich\af41\dbch\af13\loch\f41 ] [-i }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 <}{\rtlch\fcs1
-\ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2305826 \hich\af41\dbch\af13\loch\f41 Fv}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 N}{
-\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2305826 \hich\af41\dbch\af13\loch\f41 ame}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990
-\hich\af41\dbch\af13\loch\f41 >}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2305826 \hich\af41\dbch\af13\loch\f41 ]}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12991318 \hich\af41\dbch\af13\loch\f41 [-C <CapsuleImage>] }{
-\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \loch\af41\dbch\af13\hich\f41 \endash \loch\f41 f }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990
-\hich\af41\dbch\af13\loch\f41 <}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 Fdf}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 F}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 ile}{\rtlch\fcs1 \ab\af41\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 >}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 \hich\f41 \endash
-\loch\f41 b }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 <}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130
-\hich\af41\dbch\af13\loch\f41 Build}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 T}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 arget}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 >}{\rtlch\fcs1
-\ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 \hich\f41 \endash \loch\f41 t }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990
-\hich\af41\dbch\af13\loch\f41 <}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 Tag}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 N}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 ame}{\rtlch\fcs1 \ab\af41\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 >}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 \hich\f41 \endash
-\loch\f41 p }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 <}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130
-\hich\af41\dbch\af13\loch\f41 Platform}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 F}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13923130 \hich\af41\dbch\af13\loch\f41 ile}{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9709990 \hich\af41\dbch\af13\loch\f41 >}{\rtlch\fcs1 \ab\af41\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9780763
-\par }{\rtlch\fcs1 \ab\af41\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2305826 \hich\af41\dbch\af13\loch\f41 GenFds.exe \hich\f41 \endash \loch\f41 h
-\par \hich\af41\dbch\af13\loch\f41 GenFds.exe --version}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid2305826\charrsid8089322
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5513321\charrsid13310497 \hich\af41\dbch\af13\loch\f41 Description
-\par }\pard\plain \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\lang1033\langfe2052\langfenp2052\insrsid16126217 \hich\af41\dbch\af13\loch\f41 GenFds}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid16126217 \hich\af41\dbch\af13\loch\f41
- generates the Ffs, Fv, FD and Section data depending on the selected command line options.}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\lang1033\langfe2052\langfenp2052\insrsid16126217 \hich\af41\dbch\af13\loch\f41 It}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\insrsid16126217 \hich\af41\dbch\af13\loch\f41 }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid13310497 \hich\af41\dbch\af13\loch\f41 gets the}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid5513321 \hich\af41\dbch\af13\loch\f41
- platform, flash and module information from }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid13310497 \hich\af41\dbch\af13\loch\f41 the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid5513321 \hich\af41\dbch\af13\loch\f41 target.txt,}{\rtlch\fcs1
-\af41\afs18 \ltrch\fcs0 \fs18\lang1033\langfe2052\langfenp2052\insrsid12201627 \hich\af41\dbch\af13\loch\f41 }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid5513321 \hich\af41\dbch\af13\loch\f41
-platform.dsc, flashmap.fdf, package.dec and module.inf. The FDF file must be }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid9045387 \hich\af41\dbch\af13\loch\f41 specified}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\lang1033\langfe2052\langfenp2052\insrsid12201627 \hich\af41\dbch\af13\loch\f41 }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid13310497 \hich\af41\dbch\af13\loch\f41 and }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid5513321
-\hich\af41\dbch\af13\loch\f41 follow the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid13310497 \hich\af41\dbch\af13\loch\f41 correct FDF specification or the build will stop with an exception}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\insrsid5513321
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 The FDF file describes inf\hich\af41\dbch\af13\loch\f41 ormation about flash parts}
-{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9045387 ,}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 as well as rules for combining binaries}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9045387 ,}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41
- (Firmware Image) built from a DSC file. The output of the first phase of an EDK II build (as defined in the EDK II Build Specification) generates valid PE32/PE32+/Coff image files. GenFds\hich\af41\dbch\af13\loch\f41
- performs the second phase of the build process during which consumes the images generated during the first phase, using statements and rules defined in the FDF file to place the PE32/PE32+/Coff images files into one or more EFI sections}{\rtlch\fcs1
-\af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13310497 \hich\af41\dbch\af13\loch\f41 . The}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12201627 \hich\af41\dbch\af13\loch\f41 }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 EFI sections \hich\af41\dbch\af13\loch\f41 may }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9045387 \hich\af41\dbch\af13\loch\f41 be }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41
-combined with other optional sections (version, depex, user interface) sections, into EFI Firmware File system (FFS) Sections. FFS images are put into Firmware Volumes (FVs,) and finally, the FV sections are combined into one or more Flash Device bi
-\hich\af41\dbch\af13\loch\f41 nary image (FD.)
-\par \hich\af41\dbch\af13\loch\f41 The outputDir must be }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9045387 \hich\af41\dbch\af13\loch\f41 specified}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 . T}{
-\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9045387 \hich\af41\dbch\af13\loch\f41 he t}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41
-ool will generate a FV directory which includes a FFS directory, Fv file, Fv INf file and Fd file. The FFS directory }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9045387 \hich\af41\dbch\af13\loch\f41 contains }{\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 all modules directory which }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9045387 \hich\af41\dbch\af13\loch\f41 contains }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Ffs files and section files. All outpu\hich\af41\dbch\af13\loch\f41 t of GenFds tool will be in }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9045387 \hich\af41\dbch\af13\loch\f41 the }{
-\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 FV directory. The FV directory structure is }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9045387 \hich\af41\dbch\af13\loch\f41 as }{\rtlch\fcs1
-\af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 follow}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9045387 \hich\af41\dbch\af13\loch\f41 s.}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321
-\hich\af41\dbch\af13\loch\f41 The outputDir should be part of Efi file path. }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 For}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321
-\hich\af41\dbch\af13\loch\f41 each of }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 module }{\rtlch\fcs1
-\af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 described }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 in the FDF file }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 such as }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 the \hich\f41 \lquote \loch\f41 InfFIle\hich\f41 \rquote \loch\f41
- statement format the GenFds tool }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 will determing the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 \hich\f41
- input files from the path of \'93\loch\f41 $(outputDir)\\ $(Arch) \\ $(ActivePlatfromName) \\$(ModuleName) \\$(ModuleName) \\DEBUG
-\par }\pard \ltrpar\ql \fi-360\li420\ri0\sb200\nowidctlpar\tx420\wrapdefault\faauto\rin0\lin420\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 1.\tab If Arch list was }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 specified}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 , }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41
-the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 GenFds tool will use this Arch instead of Arch List in Target.txt file
-\par }\pard \ltrpar\ql \fi-360\li420\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin420\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 2.\tab If Workspace\hich\af41\dbch\af13\loch\f41 was not }{\rtlch\fcs1
-\af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 specified}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 , }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123
-\hich\af41\dbch\af13\loch\f41 the }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 GenFds tool will use the Workspace path set in OS environment.
-\par \hich\af41\dbch\af13\loch\f41 3.\tab If ActivePlatform was }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 specified}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41
-, GenFds tool will use th}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 e}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41
- active platform as the current platform instead of active platform in Target.txt file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 GenFds tool support}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123
-\hich\af41\dbch\af13\loch\f41 s}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 2 kinds of path in command line}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8933181
-\hich\af41\dbch\af13\loch\f41 :}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Absolute path and relative workspace path. The GenFds tool also support}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 s}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 $(WORKSPACE) marco in path. For example, if the input Fdf }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 is }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 $(WORKSPACE)\\NT32PKg\\Nt32.fdf, the tool will expand the $(WORKSPACE) macro with real pat
-\hich\af41\dbch\af13\loch\f41 h.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Options}{\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid5513321
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11487336 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid3830244\charrsid12198464 \hich\af41\dbch\af13\loch\f41 If no options ar}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3830244 \hich\af41\dbch\af13\loch\f41 e specified, tool prints }{\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid3830244 \hich\af41\dbch\af13\loch\f41 error message}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3830244 .}{\rtlch\fcs1 \af0 \ltrch\fcs0
-\lang1033\langfe2052\langfenp2052\insrsid3830244\charrsid11487336
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -a, --arch <ARCHS>
-\par }\pard \ltrpar\ql \fi1\li425\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin425\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41
-ARCHS is a comma separated (no space) list containing one or more of: IA32, X64, IPF or EBC }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 when}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321
-\hich\af41\dbch\af13\loch\f41 built, overrides target.txt\hich\f41 \rquote \loch\f41 s TARGET_ARCH
-\par }\pard \ltrpar\ql \fi-425\li425\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin425\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -p, --platform PlatformName.ds\hich\af41\dbch\af13\loch\f41 c
-\par }\pard \ltrpar\ql \li426\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin426\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Build}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123
-\hich\af41\dbch\af13\loch\f41 s}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 the platform specified by the DSC file name argument, over rides the ACTIVE_PLATFORM
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -f, --filename Filename\tab \tab \tab
-\par }\pard \ltrpar\ql \fi426\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Input FDF file and its format must follow FDF specification.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -r, --rom_image FdUiName\tab \tab \tab \tab
-\par }\pard \ltrpar\ql \fi425\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Build}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123
-\hich\af41\dbch\af13\loch\f41 s}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 the image using the [FD] section named by FdUiName.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -i, --FvImage UiFvName
-\par \tab }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 Builds}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 the FV image using the [FV] section named by UiFvName}{
-\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5513321
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11805687 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11805687 -}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11805687 \hich\af41\dbch\af13\loch\f41 C}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11805687 \hich\af41\dbch\af13\loch\f41 , --}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11805687\charrsid11805687 \hich\af41\dbch\af13\loch\f41 CapsuleImage}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11805687 \hich\af41\dbch\af13\loch\f41 Ui}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11805687 \hich\af41\dbch\af13\loch\f41 Cap}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11805687 \hich\af41\dbch\af13\loch\f41 Name
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\pnrdate1190691426\pnrnot1\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11805687 \tab }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11805687\charrsid11805687
-\hich\af41\dbch\af13\loch\f41 Build the Capsule image using the [Capsu}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11805687 \hich\af41\dbch\af13\loch\f41 le] section named by UiCapName}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11805687\charrsid11805687
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -o, --output Dir
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 The output directory of Genfds tool. }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 This}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 directory also should be the directory of the EFI file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -w \hich\f41 \endash \loch\f41 -workspace
-\par \tab \hich\af41\dbch\af13\loch\f41 The }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 current }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 workspace path }{
-\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5513321
-\par }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -b --buildtarget DEBUG|RELEASE
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Build target is one of: DEBUG, RELEASE}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4485839 ,\hich\af41\dbch\af13\loch\f41 NOOPT}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 .}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5513321
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -t --tagname TOOLCHAIN_TAG
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Specif}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123
-\hich\af41\dbch\af13\loch\f41 ies}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 the tool chain to build the platform.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5513321
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -D --define MACRO=VALUE
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Pass macro to this tool.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid5513321
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -s --specifyaddress ADDRESS
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Specif}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123
-\hich\af41\dbch\af13\loch\f41 ies}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 driver load address.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5513321
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 [--version]
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5513321 \tab }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Print version and copyright of this program and exit
-\par \hich\af41\dbch\af13\loch\f41 [-v, --verbose]
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13310497 \hich\af41\dbch\af13\loch\f41 Enable}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321
-\hich\af41\dbch\af13\loch\f41 verbose output with \hich\af41\dbch\af13\loch\f41 informational messages printed. This is a count value, so specifying \hich\f41 \endash \loch\f41 vv can be used to increase the verbosity level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 [-q, --quiet]
-\par \tab }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13252123 \hich\af41\dbch\af13\loch\f41 Disable}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 all messages except FATAL ERRORS
-\par \hich\af41\dbch\af13\loch\f41 [-d, --debug [#]]
-\par \tab \hich\af41\dbch\af13\loch\f41 Enable debug messages, at level #
-\par \hich\af41\dbch\af13\loch\f41 [-h, --help]
-\par \tab \hich\af41\dbch\af13\loch\f41 Print copyright\hich\af41\dbch\af13\loch\f41 , version and usage of this program and exit
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid10972537 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid10972537 {\*\bkmkstart OLE_LINK3}{\*\bkmkstart OLE_LINK4}
-{\*\bkmkstart OLE_LINK5}\hich\af41\dbch\af13\loch\f41 Status codes returned}{\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid10972537\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
-\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil \cellx8712
-\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid10972537 0}{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid10972537 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid10972537 \hich\af41\dbch\af13\loch\f41 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid10972537
-\cell }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {
-\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid10972537 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
-\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil \cellx8712
-\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid14303388 \hich\af2\dbch\af13\loch\f2 Nonzero}{
-\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid10972537\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5316845\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid10972537 \hich\af41\dbch\af13\loch\f41 The action failed.\cell
-}\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af37\afs20 \ltrch\fcs0 \fs20\insrsid10972537 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
-\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil \cellx8712
-\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5513321 {\*\bkmkend OLE_LINK3}{\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5}\hich\af41\dbch\af13\loch\f41
-Example
-\par }\pard\plain \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 1. WORKSAPCE has already set. $(WORKSPACE) = c:\\work\\\hich\af41\dbch\af13\loch\f41 EdkII. The Fdf file is in c:\\work\\EdkII\\Nt32pkg\\Nt32pkg.fdf. Output directory is c:\\work\\EdkII\\
-Build\\Nt32\\Debug_MyTools. ActivePlatform is C:\\work\\EdkII\\Nt32Pkg\\Nt32Pkg.dsc
-\par \hich\af41\dbch\af13\loch\f41 GenFds \hich\f41 \endash \loch\f41 f c:\\work\\EdkII\\Nt32pkg\\Nt32pkg.fdf \hich\f41 \endash \loch\f41 o c:\\work\\EdkII\\Build\\Nt32\\Debug_MyTo\hich\af41\dbch\af13\loch\f41 ols \hich\f41 \endash \loch\f41 p c:\\work\\EdkII
-\\Nt32pkg\\Nt32Pkg.dsc
-\par \hich\af41\dbch\af13\loch\f41 GenFds \hich\f41 \endash \loch\f41 f $(WORKSPACE)\\Nt32Pkg\\Nt32Pkg.fdf \hich\f41 \endash \loch\f41 o $(WORSPACE)\\Build\\Nt32\\Debug_MyTools \hich\f41 \endash \loch\f41 p $(WORKSAPCE)\\Nt32Pkg\\Nt32Pkg.dsc
-\par
-\par \hich\af41\dbch\af13\loch\f41 GenFds \hich\f41 \endash \loch\f41 f Nt32Pkg\\Nt32Pkg.fdf \hich\f41 \endash \loch\f41 o Build\\Nt32\\Debug_MyTools \hich\f41 \endash \loch\f41 p Nt32Pkg\\Nt32Pkg.dsc
-\par \hich\af41\dbch\af13\loch\f41 2. Generate on\hich\af41\dbch\af13\loch\f41 e FD which is defined in FDF file. Use \hich\f41 \lquote \loch\f41 -r\hich\f41 \rquote \loch\f41
- and Fd UIName. The Fd UIName is the name which is defined in the FDf file, for detail information refer to FDF specification
-\par \hich\af41\dbch\af13\loch\f41 GenFds \hich\f41 \endash \loch\f41 f GenFds \hich\f41 \endash \loch\f41 f c:\\work\\EdkII\\Nt32pkg\\Nt32pkg.fdf \hich\f41 \endash \loch\f41 o c:\\work\\EdkII\\Build\\Nt32\\Debu\hich\af41\dbch\af13\loch\f41 g_MyTools
-\hich\f41 \endash \loch\f41 p c:\\work\\EdkII\\Nt32pkg\\Nt32Pkg.dsc \hich\f41 \endash \loch\f41 r Fv_Recovery
-\par \hich\af41\dbch\af13\loch\f41 3. Generate one FV which is defined in FDF file. Use \hich\f41 \lquote \loch\f41 -i\hich\f41 \rquote \loch\f41
- and FV UiName. The FV UIName is the name which is defined in the FDF file, for detail information refers to FDF specification.
-\par \hich\af41\dbch\af13\loch\f41 GenFds \hich\f41 \endash \loch\f41 f\hich\af41\dbch\af13\loch\f41 c:\\work\\EdkII\\Nt32pkg\\Nt32pkg.fdf \hich\f41 \endash \loch\f41 o c:\\work\\EdkII\\Build\\Nt32\\Debug_MyTools \hich\f41 \endash \loch\f41 p c:\\work\\EdkII
-\\Nt32pkg\\Nt32Pkg.dsc \hich\f41 \endash \loch\f41 I FVRecovery
-\par
-\par \hich\af41\dbch\af13\loch\f41 4. Use command line option to replace the Arch List in Target.txt.
-\par \hich\af41\dbch\af13\loch\f41 GenFds \hich\f41 \endash \loch\f41 f c:\\work\\EdkII\\Nt32pkg\\Nt32pkg.fdf \hich\f41 \endash \loch\f41 o c:\\work\\EdkI\hich\af41\dbch\af13\loch\f41 I\\Build\\Nt32\\Debug_MyTools \hich\f41 \endash \loch\f41 p c:\\work\\EdkII
-\\Nt32pkg\\Nt32Pkg.dsc
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 -a IA32, X64
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 No know issues
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 target.txt, platform.dsc, flashmap.fdf, package.dec and module.inf.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5513321 \hich\af41\dbch\af13\loch\f41 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 GenFv, GenFfs, GenSection, GenFw.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af41\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5513321 \hich\af41\dbch\af13\loch\f41 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af41\hich\af41\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 Copyright (c) 1999 - }{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13310497 \hich\af41\dbch\af13\loch\f41 201}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9519395 \hich\af41\dbch\af13\loch\f41 1}{\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 , Intel Corporation. All rights reserved.
-\par \hich\af41\dbch\af13\loch\f41 This program and the accompanying materials are licensed and made available
-\par \hich\af41\dbch\af13\loch\f41 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af41\dbch\af13\loch\f41 distribution. The full text of the license may be found at
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af41\afs18 \ltrch\fcs0 \fs18\insrsid5513321 \hich\af41\dbch\af13\loch\f41 htt\hich\af41\dbch\af13\loch\f41 p://opensource.org/licenses/bsd-license.php}{\rtlch\fcs1
-\af41\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5513321 \hich\af41\dbch\af13\loch\f41 . THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }\pard \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5513321
-\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8
-72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7
-2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b
-44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7
-065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000
-00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08
-84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc
-52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353
-bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468
-656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c
-070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7
-29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65
-312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8
-a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04
-98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c
-94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471
-7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671
-9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1
-e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5
-193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1
-17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2
-8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6
-6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a
-668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847
-bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e
-16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b
-5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0
-8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2
-c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966
-0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b
-7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb
-9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0
-088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf
-8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26
-ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0
-28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6
-345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93
-b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30
-254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74
-68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24
-51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198
-720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528
-a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000
-000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000
-002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468
-656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000
-00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000
-00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 heading 2;\lsdqformat1 \lsdpriority0 heading 3;\lsdqformat1 \lsdpriority0 heading 4;\lsdqformat1 \lsdpriority0 heading 5;
-\lsdqformat1 \lsdpriority0 heading 6;\lsdqformat1 \lsdpriority0 heading 7;\lsdqformat1 \lsdpriority0 heading 8;\lsdqformat1 \lsdpriority0 heading 9;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 7;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 8;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 toc 9;\lsdqformat1 \lsdpriority0 caption;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 Title;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 Default Paragraph Font;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 Subtitle;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdpriority0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;
-\lsdunhideused0 \lsdlocked0 Revision;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;
-\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 0105000002000000180000004d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f000000000000000000000000b0c9
-9231a567cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenFfs_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenFfs_Utility_Man_Page.rtf
deleted file mode 100644
index 84d8632b84..0000000000
--- a/BaseTools/UserManuals/GenFfs_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,313 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid9311749 annotation reference;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid9311749 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink18 \slocked \ssemihidden \styrsid9311749 Comment Text Char;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid9311749 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid9311749 Comment Subject Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid9311749 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid9311749 Balloon Text Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid1326121 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid1326121 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh
-\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid1326121 Table Grid;}}{\*\rsidtbl \rsid1326121\rsid2566036\rsid2585461\rsid4000798\rsid4999604\rsid5911148\rsid7865390\rsid7959743\rsid8549383\rsid8600807\rsid9311749\rsid11368657\rsid12198464\rsid16535783
-\rsid16590019}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo10\dy6\hr15\min17}{\revtim\yr2011\mo8\dy10\hr10}{\version11}{\edmins21}
-{\nofpages3}{\nofwords589}{\nofchars3362}{\nofcharsws3944}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot2566036 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0
-\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 GenFfs.exe \hich\f39 \endash \loch\f39 build one PI firmware file.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 GenFfs.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019 \hich\af39\dbch\af31505\loch\f39 [-v] [-x] [-s] [-a }{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2585461 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019
-\hich\af39\dbch\af31505\loch\f39 FileAlign}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2585461 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019 \hich\af39\dbch\af31505\loch\f39 ] \hich\f39 \endash \loch\f39 t }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2585461
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019 \hich\af39\dbch\af31505\loch\f39 Type}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2585461 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash
-\loch\f39 g }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2585461 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019
-\hich\af39\dbch\af31505\loch\f39 FileGuid}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2585461 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash \loch\f39 i }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2585461
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019 \hich\af39\dbch\af31505\loch\f39 InputFile[ -n SectionAlign]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2585461 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash
-\loch\f39 o }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2585461 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019
-\hich\af39\dbch\af31505\loch\f39 OutputFile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2585461 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2566036
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019 \hich\af39\dbch\af31505\loch\f39 GenFfs.exe \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 GenFfs.exe --version}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16590019
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 GenFfs }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7959743 \hich\af39\dbch\af31505\loch\f39 generates}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036
-\hich\af39\dbch\af31505\loch\f39 FFS files for inclusion in a firmware volume. FFS file is the file system file for the firmware storage defined in the Volume 3 of the PI 1.0 specification. This utility }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid7959743 \hich\af39\dbch\af31505\loch\f39 aggregates}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 all of the \hich\af39\dbch\af31505\loch\f39
-file components into a single, correctly formed FFS file
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Options}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid2566036
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid7865390 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid7865390\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7865390 \hich\af39\dbch\af31505\loch\f39 e specified, tool prints usage.}{\rtlch\fcs1 \af0
-\ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid7865390\charrsid7865390
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -o FileName, --outputfile FileName
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7959743 \hich\af39\dbch\af31505\loch\f39 Creates }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036
-\hich\af39\dbch\af31505\loch\f39 PI firmware file. This option is required.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -t Type, --filetype Type
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39
-Type is one FV file type defined in PI spec, which is one type of EFI_FV_FILETYPE_RAW, EFI_FV_FILETYPE_FREEFORM, EFI_FV_FILETYPE_SECURITY_CORE, EFI_FV_FILETYPE_PEIM, EFI_FV_FILETYPE_PEI_CORE, EFI_FV_FILETYPE_DXE_CORE, EFI_FV_FILETYPE_DRIVER, EFI_FV_FILETY
-\hich\af39\dbch\af31505\loch\f39 P\hich\af39\dbch\af31505\loch\f39 E_APPLICATION, EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER, EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE. This option is required.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -g FileGuid, --fileguid FileGuid
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39
-FileGuid is the unique identifier for this FFS file. Its format is 00000000-0000-0000-0000-000000000000. T\hich\af39\dbch\af31505\loch\f39 his option is required.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -x, --fixed
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39
-Set fixed attribute in FFS file header to indicate that the file may not be moved from its present location.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -s, --checksum
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39
-Set checksum attribute in FFS file header to calculate the whole file checksum.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -a FileAlign, --\hich\af39\dbch\af31505\loch\f39 align FileAlign
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39
-FileAlign specifies FFS file alignment, which only support the following alignment: 8,16,128,512,1K,4K,32K,64K.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -i SectionFile, --sectionfile SectionFile
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Section file will be read into this FFS file. This option is required.
-
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -n Sec\hich\af39\dbch\af31505\loch\f39
-tionAlign, --sectionalign SectionAlign
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39
-SectionAlign specifies this section file alignment in the FFS file, which support the alignment scope 1~64K. It is specified together with section}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7959743 \hich\af39\dbch\af31505\loch\f39 }{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 file parameter.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Turn on verbose output with information\hich\af39\dbch\af31505\loch\f39
-al messages.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 --version
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Show program version number and exit
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Show this help message and exit
-\par }\pard\plain \ltrpar\s2\ql \fi-1440\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid1326121 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1326121\charrsid16535783 \hich\af39\dbch\af31505\loch\f39 Status codes returned
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid1326121\charrsid8600807 \hich\af2\dbch\af13\loch\f2 STATUS_SUCCESS}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1326121 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid1326121\charrsid4999604 \tab }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid1326121 0}{\rtlch\fcs1 \ab\af2\afs18
-\ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid1326121 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1326121 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0
-\kerning2\insrsid1326121 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid1326121 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb
-\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\kerning2\insrsid1326121\charrsid8600807 \hich\af2\dbch\af13\loch\f2
-STATUS_ERROR}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1326121 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid1326121\charrsid4999604 \tab \tab }{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid1326121 \hich\af2\dbch\af13\loch\f2 2}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid1326121\charrsid8600807
-\cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid4000798\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid1326121
-\hich\af39\dbch\af13\loch\f39 The action \hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid1326121 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 1. Generate PeiCore FFS file with the input sections, fileguid, and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39
-GenFfs -t EFI_FV_FILETYPE_PEI_CORE -g 52C05B14-0B98-496c-BC3B-04B50211D680 -i PeiMain.pe32 -i PeiMain.ui -i PeiMain.ver -o 52C05B14-0B98-496c-BC3B-04B50211D680-PeiMai\hich\af39\dbch\af31505\loch\f39 n.ffs
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 2. Generate PeiCore FFS file with the fixed, checksum attributes, the input sections with 16 byte alignment, the fileguid, and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 GenFfs -t EFI_FV_FILETYPE_PEI_CORE -g 52C05B14-0B98-496c-BC3B-04B50211D680 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf6\insrsid2566036
-\loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 x \hich\f39 \endash \loch\f39 s}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 -i PeiMain.pe32 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf6\insrsid2566036 \loch\af39\dbch\af31505\hich\f39 \endash \hich\af39\dbch\af31505\loch\f39 n 16}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39
- -i PeiMain.ui -i PeiMain.ver -o 52C05B14-0B98-496c-BC3B-04B50211D680-PeiMain.ffs
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 3. Generate RAW type FFS file with the input raw files, checksum attribute, fileguid, and the output file name. The RAW type FFS file doesn\hich\f39 \rquote
-\loch\f39 t care whether the input files\hich\af39\dbch\af31505\loch\f39 are the formed section files or not.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 GenFfs \hich\f39 \endash \loch\f39 t EFI_FV_FILETYPE_RAW \hich\f39 \endash \loch\f39 g E8B33A4F-4C07-4e3f-A746-4A1E4036C5EC \hich\f39 \endash \loch\f39 s
-\hich\f39 \endash \loch\f39 i vendor.raw \hich\f39 \endash \loch\f39 o E8B33A4F-4C07-4e3f-A746-4A1E4036C5EC-vendor.raw
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 4. Generate FV type FFS file with the input FV section file, checksum attribute,\hich\af39\dbch\af31505\loch\f39 fileguid, and the output filename.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 GenFfs \hich\f39 \endash \loch\f39 t EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE \hich\f39 \endash \loch\f39 g 47C70572-CA18-455d-ABB9-B37FBA402AB2 \hich\f39
-\endash \loch\f39 s \hich\f39 \endash \loch\f39 i fvmain.fvsec \hich\f39 \endash \loch\f39 o 47C70572-CA18-455d-ABB9-B37FBA402AB2-fvmain.ffs
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 No known bugs.
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists\hich\af39\dbch\af31505\loch\f39 .sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid2566036
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 2007 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7959743 \hich\af39\dbch\af31505\loch\f39 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11368657 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accomp\hich\af39\dbch\af31505\loch\f39 anies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2566036 \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS
-\hich\af39\dbch\af31505\loch\f39 OR IMPLIED.
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000303d
-41530157cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenFv_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenFv_Utility_Man_Page.rtf
deleted file mode 100644
index 4f98a5a46a..0000000000
--- a/BaseTools/UserManuals/GenFv_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,404 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid3301406 annotation reference;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid3301406 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink18 \slocked \ssemihidden \styrsid3301406 Comment Text Char;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid3301406 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid3301406 Comment Subject Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid3301406 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid3301406 Balloon Text Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid12207580 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid12207580 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh
-\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid12207580 Table Grid;}}{\*\rsidtbl \rsid209071\rsid1076770\rsid3171843\rsid3301406\rsid3608683\rsid4195908\rsid4999604\rsid5861171\rsid5911148\rsid7107506\rsid7807742\rsid8600807\rsid12198464\rsid12207580
-\rsid14224643\rsid15426231\rsid15684614\rsid16349543}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo11\dy8\hr12\min28}
-{\revtim\yr2011\mo8\dy10\hr10\min1}{\version12}{\edmins50}{\nofpages5}{\nofwords1070}{\nofchars6100}{\nofcharsws7156}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot3608683 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0
-\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 GenFv.exe \hich\f39 \endash \loch\f39 build one PI firmware volume image or one UEFI capsule image.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 GenFv.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5861171 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid209071 \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 p }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5861171
-\loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 i }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15684614 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5861171 \hich\af39\dbch\af31505\loch\f39 InputFile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15684614 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5861171 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid209071 \hich\af39\dbch\af31505\loch\f39 [
-}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5861171 \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 o }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15684614 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5861171 \hich\af39\dbch\af31505\loch\f39 OutputFile}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15684614 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid209071 \hich\af39\dbch\af31505\loch\f39
-]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12207580
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid209071 \hich\af39\dbch\af31505\loch\f39 GenFv.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14224643
-\hich\af39\dbch\af31505\loch\f39 [-v | -q | -d]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid209071 \hich\af39\dbch\af31505\loch\f39
- [-b <BlockSize>] [-n <NumBlock>] [-f <FfsFile>] [-s <FileTakeSize>] [-r <Address>] [-a <AddressFile>] [-m <LogFile>] [-g }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14224643
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid209071 \hich\af39\dbch\af31505\loch\f39 Guid}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid209071 \hich\af39\dbch\af31505\loch\f39 ] [}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 --FvNameGuid }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 Guid}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid209071 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14224643 \hich\af39\dbch\af31505\loch\f39
- [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 --capflag }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 <}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 CapFlag}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 >] [}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 --capheadsize }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 <}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 HeadSize}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14224643 \hich\af39\dbch\af31505\loch\f39 >] [-c]}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid209071 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash \loch\f39 i <InputFile> \hich\f39 \endash \loch\f39 o <OutputFile>}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid209071\charrsid14224643
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12207580 \hich\af39\dbch\af31505\loch\f39 GenFv.exe \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 GenFv.exe --version}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid4195908
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 GenFv }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3608683 \hich\af39\dbch\af31505\loch\f39 generates}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\insrsid4195908
-\hich\af39\dbch\af31505\loch\f39 a PI firmware volume image or a UEFI capsule image from the PI firmware files or the binary files, which conforms to the firmware volume image format defined in PI specification or uefi capsule image format d
-\hich\af39\dbch\af31505\loch\f39 efined in UEFI specification.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 This utility }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3608683 \hich\af39\dbch\af31505\loch\f39 aggregates the}{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39
- Firmware File System (FFS2) files into a single FV image with FFS2 file system guid. The input files must be compliant with the PI 1.0 specification. The utility will create a FV header, append all \hich\af39\dbch\af31505\loch\f39
-of the FFS input files, and optionally}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3608683 ,}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39
- add the FFS pad file for those FFS files that require the specific file alignment. When adding PEI files or dxe drivers, it will relocate them to the fixed flash address or the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3608683
-\hich\af39\dbch\af31505\loch\f39 preferred}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39
- loaded memory address if necessary. Also, one symbol map file that contains the symbol information (Function and Variable) for each driver in the FV will be produced. This utility also responsible }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid3608683 \hich\af39\dbch\af31505\loch\f39 aggregates}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 the binary files into a single UEFI capsule ima\hich\af39\dbch\af31505\loch\f39
-ge with the UEFI capsule header.
-\par \hich\af39\dbch\af31505\loch\f39 GenFv takes as input the path/filename of the Fv.inf or Cap.inf file, the output file name, the starting physical address of the FV, the boot driver base address and the runtime driver base address of the address.inf file
-\hich\af39\dbch\af31505\loch\f39 to create the final Fv or Capsule image. This utility is usually called by GenFds tool, which parses platform.fdf file to create the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3608683
-\hich\af39\dbch\af31505\loch\f39 internal}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Fv.inf or Cap.inf. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3608683 \hich\af39\dbch\af31505\loch\f39
-The internal Fv.inf and Cap.inf information is generally not used by end users. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid4195908
-\hich\af39\dbch\af31505\loch\f39 Options}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid4195908
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid1076770 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1076770\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no\hich\af39\dbch\af31505\loch\f39 options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1076770 \hich\af39\dbch\af31505\loch\f39
-e specified, tool prints usage.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid1076770\charrsid1076770
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -o FileName, --outputfile FileName
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39
-The PI firmware volume image or Uefi Capsule image is created. This option is required.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -i FileName, --inputfile FileName}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid4195908
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 File is the input FV.inf or Cap.inf to specify how to co
-\hich\af39\dbch\af31505\loch\f39 nstruct FvImage or CapImage. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3608683 \hich\af39\dbch\af31505\loch\f39 See examples for details.}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908
-\hich\af39\dbch\af31505\loch\f39 File may be one capsule image when its header is dumped. This option is required.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -b BlockSize, --blocksize BlockSize}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid4195908
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 BlockSize is one HEX or DEC format value required by FV image.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -n NumberBlock, --n\hich\af39\dbch\af31505\loch\f39 umberblock NumberBlock
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 NumberBlock is one HEX or DEC format value. NumberBlock is one optional parameter.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -f FfsFile, --ffsfile FfsFile}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 FfsFile is placed into FV image. Multiple files can be input one by one.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -s FileTakeSize, --filetakesize FileTakenS\hich\af39\dbch\af31505\loch\f39 ize}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Specify the size of the required space that the input file is placed in FV image. It should be specified together with the input file.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -r Address, --baseaddr Address}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Address is the rebase start address for drivers that run in Flash. It supports DEC or HEX digital format.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -a AddressFile, --addrfile AddressFile
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 AddressFile is a file used to log boot driver base address and runtime driver base address. this tool will upd\hich\af39\dbch\af31505\loch\f39
-ates these two addresses afterrelocating all boot drivers and runtime drivers in this fv image to the preferred loaded memory address.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -m logfile, --map logfile}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Logfile is the output Fv map file. If this option is not given, the FvName.map will be the def\hich\af39\dbch\af31505\loch\f39 ault fv map file name.}{
-\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -g Guid, --guid Guid}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Guid is one specific capsule guid value or fv file system guid value.
-\par \hich\af39\dbch\af31505\loch\f39 Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 --FvNameGuid Guid}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Guid is used to specify Fv Name. }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Its for\hich\af39\dbch\af31505\loch\f39 mat is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 --capflag CapFlag}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Specify capsule reset flag (PersistAcrossReset, PopulateSystemTable or InitiateReset or none).
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 --capheadsize HeadSize}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Specify head size for capsule image in the format of HEX or DEC.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -c, --cap\hich\af39\dbch\af31505\loch\f39 sule}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Create Uefi capsule image.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -p, --dump}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Dump a capsule image header.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Enable verbose output with informational messages.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -q, --quiet }{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39
-Disable all messages except key message and fatal error.}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -d, --debug level
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Enable debug \hich\af39\dbch\af31505\loch\f39 message with specified level.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 --version
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Show program's version number and exit
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Show this help message and exit
-\par }\pard\plain \ltrpar\s2\ql \fi-1440\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid12207580 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid12207580\charrsid12207580 {\*\bkmkstart OLE_LINK7}{\*\bkmkstart OLE_LINK8}
-\hich\af39\dbch\af31505\loch\f39 Status codes returned
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid12207580\charrsid8600807 \hich\af2\dbch\af13\loch\f2 STATUS_SUCCESS}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12207580 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18
-\ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid12207580\charrsid4999604 \tab }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid12207580 0}{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid12207580 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12207580 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0
-\kerning2\insrsid12207580 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid12207580 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb
-\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\kerning2\insrsid12207580\charrsid8600807 \hich\af2\dbch\af13\loch\f2
-STATUS_ERROR}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12207580 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid12207580\charrsid4999604 \tab \tab }{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid12207580 \hich\af2\dbch\af13\loch\f2 2}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0
-\cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid12207580\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid15426231\yts26 {
-\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid12207580 \hich\af39\dbch\af13\loch\f39 The action \hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0
-\fs20\insrsid12207580 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid4195908 {\*\bkmkend OLE_LINK7}{\*\bkmkend OLE_LINK8}\hich\af39\dbch\af31505\loch\f39 Example
-
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 1. Generate BFV that contains PEI drivers in Flash with the input FV.inf, base address, and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 GenFv -i FvRecovery.inf -o FvRecovery.fv -r 0xFFFD0000
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 FvRecovery.inf
-\par \hich\af39\dbch\af31505\loch\f39 [options]
-\par \hich\af39\dbch\af31505\loch\f39 EFI_BLOCK_SIZE = 0x10000 #required option
-\par \hich\af39\dbch\af31505\loch\f39 EFI_NUM_BLOCKS = 0x3
-\par \hich\af39\dbch\af31505\loch\f39 EFI_BASE_ADDRESS = 0xFFFD0000 #optional, if command line -r is not specified, this option will be used.
-\par \hich\af39\dbch\af31505\loch\f39 [attributes]
-\par \hich\af39\dbch\af31505\loch\f39 EFI_ERASE_POLARITY = 1
-\par \hich\af39\dbch\af31505\loch\f39 EFI_WRITE_ENABLED_CAP = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_READ\hich\af39\dbch\af31505\loch\f39 _ENABLED_CAP = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_READ_LOCK_STATUS = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_WRITE_STATUS = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_READ_DISABLED_CAP = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_WRITE_LOCK_STATUS = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_LOCK_CAP = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_LOCK_STATUS = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_ERASE_POLARITY = 1
-\par \hich\af39\dbch\af31505\loch\f39 EFI_MEMORY_MAPPED = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_READ_LOCK_CAP = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_WRITE_\hich\af39\dbch\af31505\loch\f39 DISABLED_CAP = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_READ_STATUS = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_WRITE_LOCK_CAP = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_STICKY_WRITE = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 EFI_FVB2_ALIGNMENT_16 = TRUE
-\par \hich\af39\dbch\af31505\loch\f39 [files]
-\par \hich\af39\dbch\af31505\loch\f39 EFI_FILE_NAME = K:\\Build\\NT32\\DEBUG_MYTOOLS\\Fv\\Ffs\\52C05B14-0B98-496c-BC3B-04B50211D680PeiMain\\52C05B14-0B98-496c-BC3B-04B5021\hich\af39\dbch\af31505\loch\f39 1D680.ffs
-\par \hich\af39\dbch\af31505\loch\f39 EFI_FILE_NAME = K:\\Build\\NT32\\DEBUG_MYTOOLS\\Fv\\Ffs\\9B3ADA4F-AE56-4c24-8DEA-F03B7558AE50PcdPeim\\9B3ADA4F-AE56-4c24-8DEA-F03B7558AE50.ffs
-\par ......}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39
-2. Generate FvMain that contains Dxe drivers loaded in the preferred loaded memory address with the input FV.inf, address file, the output file name, its firmware file system guid (FFS2) and its guid name.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 GenFv -i FvMain.inf -o FvMain.fv -a Addr.inf \hich\f39 \endash \loch\f39 g 8c\hich\af39\dbch\af31505\loch\f39 8ce578-8a3d-4f1c-9935-896185c32dd3
-\hich\f39 \endash \loch\f39 FvNameGuid 6D99E806-3D38-42c2-A095-5F4300BFD7DC}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Addr.inf}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 [options]
-\par \hich\af39\dbch\af31505\loch\f39 EFI_BOOT_DRIVER_BASE_ADDRESS = 0x1f300000
-\par \hich\af39\dbch\af31505\loch\f39 EFI_RUNTIME_DRIVER_BASE_ADDRESS = 0x1f600000}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 3. Generate the capsule image with the input cap.inf, and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 GenFv -i BiosUpdate.inf -o BiosUpdate.cap
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 BiosUpdate.inf}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid4195908
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 [options]
-\par \hich\af39\dbch\af31505\loch\f39 EFI_CAPSULE_GUID = 25A5CD7D-A5EB-4d74-9C28-D6EF04E03B16 (Required)
-\par \hich\af39\dbch\af31505\loch\f39 EFI_CAPSULE_HEADER_SIZE = 0x20 \hich\af39\dbch\af31505\loch\f39 (Optional)
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1036\langfe1033\langnp1036\insrsid4195908\charrsid3608683 \hich\af39\dbch\af31505\loch\f39 EFI_CAPSULE_FLAGS = PopulateSystemTable (Optional)
-\par \hich\af39\dbch\af31505\loch\f39 [attributes]
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 [files]
-\par \hich\af39\dbch\af31505\loch\f39 EFI_FILE_NAME = K:\\Build\\NT32\\DEBUG_MYTOOLS\\Fv\\Ffs\\EDBEDF47-\hich\af39\dbch\af31505\loch\f39 6EA3-4512-83C1-70F4769D4BDE-Capsule_A.fvi
-\par \hich\af39\dbch\af31505\loch\f39 4. Dump capsule image header information for the input capsule image.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 GenFv -p -i BiosUpdate.cap -o Cap.info}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 No known issues.
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid4195908
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 2007 - 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid16349543 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text \hich\af39\dbch\af31505\loch\f39 of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4195908 \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e30000000000000000000000e0000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff0900060000000000000000000000010000000100000000000000001000000200000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdffffff04000000feffffff05000000fefffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff010000000c6ad98892f1d411a65f0040963251e50000000000000000000000009058
-6c5c0157cc010300000080020000000000004d0073006f004400610074006100530074006f0072006500000000000000000000000000000000000000000000000000000000000000000000000000000000001a000101ffffffffffffffff02000000000000000000000000000000000000000000000090586c5c0157cc01
-90586c5c0157cc010000000000000000000000005300d800c4004d003400c3004b00c600d900550034003000d8004e005000d200d9003400df00ce00d700c0003d003d000000000000000000000000000000000032000101ffffffffffffffff03000000000000000000000000000000000000000000000090586c5c0157
-cc0190586c5c0157cc010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff04000000ffffffff000000000000000000000000000000000000000000000000
-00000000000000000000000000000000d800000000000000010000000200000003000000feffffff0500000006000000070000000800000009000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3c623a536f75726365732053656c65637465645374796c653d225c4150412e58534c22205374796c654e616d653d224150412220786d6c6e733a623d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f7267
-2f6f6666696365446f63756d656e742f323030362f6269626c696f6772617068792220786d6c6e733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f677261706879223e3c2f623a536f75726365733e00000000
-0000000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b37413043
-383934422d413633322d343745352d394145302d4433463245354546454544457d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c
-64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6f70656e500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000
-0000000000000000000000000000000000000000000000000000000000000400000055010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f677261706879222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f
-72654974656d3e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf
deleted file mode 100644
index 045c9d4dd7..0000000000
--- a/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,359 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 00000000000000000000}@\'cb\'ce\'cc\'e5;}{\f43\fbidi \fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f475\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f476\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f478\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f479\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f482\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f483\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;\red0\green127\blue127;}{\*\defchp \fs21\kerning2\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs21\alang1025 \ltrch\fcs0 \fs21\lang1033\langfe2052\kerning2\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs44 \ltrch\fcs0 \b\f39\fs44\kerning44 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0
-\b\fs32\kerning0\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid4815795 annotation reference;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid4815795 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20\lang0\langfe2052\kerning0\langnp0\langfenp2052
-\sbasedon10 \slink18 \slocked \ssemihidden \styrsid4815795 Comment Text Char;}{\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0
-\b\fs20\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid4815795 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0
-\b\f39\fs20\lang0\langfe2052\kerning0\langnp0\langfenp2052 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid4815795 Comment Subject Char;}{\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe2052\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid4815795 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0
-\f38\fs16\lang0\langfe2052\kerning0\langnp0\langfenp2052 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid4815795 Balloon Text Char;}{\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0
-\rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \spriority0 \styrsid6636700 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid6636700
-CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid6636700 Table Grid;}}{\*\rsidtbl \rsid1120999\rsid3954098\rsid4815795\rsid4999604\rsid5318420\rsid5911148\rsid6184429\rsid6636700\rsid8089322\rsid8459339\rsid8600807\rsid12198464\rsid12521351\rsid15026228
-\rsid15604690\rsid16255639\rsid16399512}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2011\mo7\dy18\hr16\min14}
-{\revtim\yr2011\mo8\dy10\hr9\min39}{\version10}{\edmins22}{\nofpages4}{\nofwords838}{\nofchars4782}{\nofcharsws5609}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot15604690 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0
-\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw.exe \hich\f39 \endash \loch\f39 build a UEFI image or other image.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw.exe }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid12521351 \hich\af39\dbch\af31505\loch\f39 -r | }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid3954098 \hich\af39\dbch\af31505\loch\f39 -o <OutputFile> [-e }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5318420 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3954098
-\hich\af39\dbch\af31505\loch\f39 EfiType}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5318420 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3954098 \hich\af39\dbch\af31505\loch\f39
-] [-c | -t | -l | -u | -b | -z | -s }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5318420 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3954098 \hich\af39\dbch\af31505\loch\f39 TimeDate}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5318420 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3954098 \hich\af39\dbch\af31505\loch\f39 | -m | -j | }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid3954098\charrsid3954098 \hich\af39\dbch\af31505\loch\f39 --hiipackage}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3954098 \hich\af39\dbch\af31505\loch\f39 | --}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid3954098\charrsid3954098 \hich\af39\dbch\af31505\loch\f39 hiibinpackage}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3954098 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid12521351 \hich\af39\dbch\af31505\loch\f39 [-a] [-p]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3954098
-\hich\af39\dbch\af31505\loch\f39 <Input}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 File}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid3954098 \hich\af39\dbch\af31505\loch\f39 >}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid16399512 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid16399512 \hich\af39\dbch\af31505\loch\f39 GenFw.exe \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 GenFw\hich\af39\dbch\af31505\loch\f39 .exe --version}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid16399512\charrsid8089322
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid16399512
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39
-Genfw is mainly used to process PE32 image to get the expected image data or image file. PE32 is a general-purpose image format that contains, among other information, data identifying the target environment for execution of the image. This utility can mo
-\hich\af39\dbch\af31505\loch\f39 d\hich\af39\dbch\af31505\loch\f39
-ify the standard PE32 image to create UEFI image with EFI subsystem type, PI Terse Executable image with the compact TE image header, zero its dubug data or reset its time stamp. It can also extract PE32 image data to create bin file, extract PE32 image d
-\hich\af39\dbch\af31505\loch\f39 a\hich\af39\dbch\af31505\loch\f39
-ta section to create Acpi table image, or dump PI TE image header information. It can also parse the text MicroCode definition file to create the MicroCode binary image, merge (concatenate) several MicroCode binary images into a single file by pad value a
-\hich\af39\dbch\af31505\loch\f39 n\hich\af39\dbch\af31505\loch\f39 d alignment requirement. This tool also supports the override the input file with the output contents.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid15026228\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15026228 \hich\af39\dbch\af31505\loch\f39 e specified, tool prints usage.}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4815795
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Filename1 [FilenameN]
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Input PE/PE32+ image, or TE image, or MicroCode Txt file, or MicroCode bin
-\hich\af39\dbch\af31505\loch\f39 file, or hii binary pakcages.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -o FileName, --outputfile FileName
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39
-The EFI image, TeImage, AcpiImage, MicroBin, hii package lists file or other modified PE image will be created.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -e EFI_FILETYPE, --efiImage EFI_FILETYPE
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Create Efi Image. EFI_FILETYPE is one \hich\af39\dbch\af31505\loch\f39
-of BASE, SEC, PEI_CORE, PEIM, DXE_CORE, SMM_CORE, DXE_DRIVER, UEFI_APPLICATION, DXE_SAL_DRIVER, UEFI_DRIVER, DXE_RUNTIME_DRIVER, DXE_SMM_DRIVER, SECURITY_CORE, COMBINED_PEIM_DRIVER, PIC_PEIM, RELOCATABLE_PEIM, BS_DRIVER, RT_DRIVER, APPLICATION, SAL_RT_DRI
-\hich\af39\dbch\af31505\loch\f39 V\hich\af39\dbch\af31505\loch\f39 ER to support all module types.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid8459339
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -c, --acpi
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Create Acpi table.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -t, --terse
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Create Te Image.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -u, --dump
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Dump TeImage Header.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -z, --zero
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39
-Zero the Debug Data Fields in the PE input image file. It also zeros the time stamp fields.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid8459339
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -b, --exe2bin
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Convert the input EXE to the output BIN file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -l, --stripped
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Strip off the relocation information data from PE or TE image.}{
-\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid8459339
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -s timedate, --stamp timedate
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 \hich\f39 timedate format is \'93\loch\f39 \hich\f39 yyyy-mm-dd 00:00:00\'94
-\loch\f39 \hich\f39 . If timedata is set to \'93\loch\f39 \hich\f39 NOW\'94\loch\f39 , current system time is used. Th\hich\af39\dbch\af31505\loch\f39 e support date scope is 1970-1-1 8:0:0 ~ 2038-1-19 3:14:07.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid8459339
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -m, --mcifile
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Convert input microcode txt definition file to microcode bin file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -j, --join
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Merge multiple microcode bin files to one file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -a NUM, --align NUM
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 NUM is one HEX or DEC format alignme\hich\af39\dbch\af31505\loch\f39
-nt value, which is used to combine multiple microcode bin files.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -p NUM, --pad NUM
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39
-NUM is one HEX or DEC format padding value, which is used to combine multiple microcode bin files.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 --keepexceptiontable
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Don\hich\f39 \rquote \loch\f39 t clear exception table.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 --keepzeropending
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Don\hich\f39 \rquote \loch\f39 t \hich\af39\dbch\af31505\loch\f39
-strip zero pending of .reloc.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -r, --replace
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Overwrite the input file with the output content.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -g HiiPackageListGuid, --hiiguid HiiPackageListGuid
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Guid is used to specify hii package list guid.}{\rtlch\fcs1 \af0\afs18
-\ltrch\fcs0 \f0\fs18\cf1\insrsid8459339
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 --hiipackage\hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af0\afs18
-\ltrch\fcs0 \b\f0\fs18\cf1\insrsid8459339
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39
-Combine all input binary hii packages into a single package list as the text resource data file (RC file format).
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 --hiibinpackage }{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid8459339
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39
-Combine all input binary hii packages into a single package list as the binary resource section.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Turn on verbose output with informational messages.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -d, --debug level
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid8459339 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Enable debug message with specified level.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 --version
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Show program's version number and exit
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Show this help message and exit
-\par }\pard\plain \ltrpar\s2\ql \fi-1440\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid6636700 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid6636700\charrsid6184429 {\*\bkmkstart OLE_LINK7}{\*\bkmkstart OLE_LINK8}\hich\af39\dbch\af31505\loch\f39
-Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid6636700
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6636700\charrsid8600807 \hich\af2\dbch\af13\loch\f2 STATUS_SUC\hich\af2\dbch\af13\loch\f2 CESS}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6636700 \hich\af39\dbch\af13\loch\f39 }{
-\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6636700\charrsid4999604 \tab }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6636700
-0}{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid6636700 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6636700 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0
-\ltrch\fcs0 \kerning2\insrsid6636700 \cell }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid6636700 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb
-\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\kerning2\insrsid6636700\charrsid8600807 \hich\af2\dbch\af13\loch\f2
-STATUS_ERROR}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6636700 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\kerning2\insrsid6636700\charrsid4999604 \tab \tab }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6636700 \hich\af2\dbch\af13\loch\f2 2}{\rtlch\fcs1 \af43\afs19 \ltrch\fcs0 \cs25\f43\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid6636700\charrsid8600807 \cell }\pard \ltrpar
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid16255639\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid6636700
-\hich\af39\dbch\af13\loch\f39 The action \hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid6636700 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid8459339 {\*\bkmkend OLE_LINK7}{\*\bkmkend OLE_LINK8}\hich\af39\dbch\af31505\loch\f39 Example
-
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 1. Generate Efi image with the input PE image, module type and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \hich\f39 \endash \loch\f39 e PEI_CORE PeiMain.dll \hich\f39 \endash \loch\f39 o PeiMain.efi
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 2. Generate Te image with the input PE image and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \hich\f39 \endash \loch\f39 t PeiMain.dll \hich\f39 \endash \loch\f39 o PeiMain.te
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 3. Generate acpi table image with the input PE image and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \hich\f39 \endash \loch\f39 c Facs.dll \hich\f39 \endash \loch\f39 o Facs.acpi
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 4. Dump TeImage Header with the input Te\hich\af39\dbch\af31505\loch\f39 Image and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \hich\f39 \endash \loch\f39 u PeiMain.te \hich\f39 \endash \loch\f39 o PeiMain.teheader
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 5. Modify PeImage by zero its debug data.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \hich\f39 \endash \loch\f39 z PeiMain.dll \hich\f39 \endash \loch\f39 o Peimain.zero
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 6. Modify PeImage by set new timestamp and override the input image without the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 \hich\f39 s \'93\loch\f39 \hich\f39 2007-8-16 16:06:32\'94\loch\f39 PeiMain.dll \hich\f39
-\endash \loch\f39 r
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 7. Extract bin image from PeImage.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \hich\f39 \endash \loch\f39 b PeiMain.dll \hich\f39 \endash \loch\f39 o PeiMain.bin
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 8. Generate the microcode binary file from the micro code txt file.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \hich\f39 \endash \loch\f39 m Mci.txt \hich\f39 \endash \loch\f39 o Mci.bin
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 9. Merge the multiple mci binary files to one file.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \hich\f39 \endash \loch\f39 j Mci.bin1 Mci.bin2 Mci.bin3 \hich\f39 \endash \loch\f39 a 32 \hich\f39 \endash \loch\f39 p 0xFF \hich\f39 \endash
-\loch\f39 o Mci.bin
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 10. Generate the text resource file (RC format) based on all input binary HII packages and their package list guid.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \hich\f39 \endash \loch\f39 o SampleHii.rc \hich\f39 \endash \loch\f39 g D49D2EB0-44D5-4621-9FD6-1A92C9109B99 \hich\f39 \endash
-\hich\af39\dbch\af31505\loch\f39 hiipackage SampleStr.hpk SampleVfr.hpk}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid8459339
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 11. Generate the binary resource section based on all input binary HII packages and their package list guid.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid8459339
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 GenFw \hich\f39 \endash \loch\f39 o SampleHii.bin \hich\f39 \endash \loch\f39 g D49D2EB0-44D5-4621-9FD6-1A92C9109B99 \hich\f39 \endash \loch\f39
-hiibinpackage SampleStr.hpk SampleVfr.hpk}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid8459339
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Bu\hich\af39\dbch\af31505\loch\f39 gs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 No known bugs.
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid8459339
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid15604690 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 2007 - 2011}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 un\hich\af39\dbch\af31505\loch\f39 der the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8459339 \hich\af39\dbch\af31505\loch\f39 WITHOU\hich\af39\dbch\af31505\loch\f39
-T WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\insrsid8459339
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90
-fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2
-ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae
-a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1
-399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5
-4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84
-0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b
-c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7
-689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20
-5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0
-aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d
-316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840
-545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a
-c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100
-0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7
-8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89
-d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500
-1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f
-bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6
-a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a
-0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021
-0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008
-00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000a0b0
-a95ffe56cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenPage_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenPage_Utility_Man_Page.rtf
deleted file mode 100644
index 73157fc112..0000000000
--- a/BaseTools/UserManuals/GenPage_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,107 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch13\stshfloch39\stshfhich39\stshfbi0\deflang1033\deflangfe2052{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\f13\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt ??\'a1\'a7??};}
-{\f36\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma{\*\falt Times New Roman};}{\f38\froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\f39\fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri{\*\falt Century Gothic};}
-{\f41\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@SimSun;}{\f48\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana{\*\falt Verdana};}{\f301\froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};}
-{\f302\froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\f304\froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\f305\froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}
-{\f306\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\f307\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\f308\froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}
-{\f309\froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\f433\fnil\fcharset0\fprq2 SimSun Western{\*\falt ??\'a1\'a7??};}{\f661\fswiss\fcharset238\fprq2 Tahoma CE{\*\falt Times New Roman};}
-{\f662\fswiss\fcharset204\fprq2 Tahoma Cyr{\*\falt Times New Roman};}{\f664\fswiss\fcharset161\fprq2 Tahoma Greek{\*\falt Times New Roman};}{\f665\fswiss\fcharset162\fprq2 Tahoma Tur{\*\falt Times New Roman};}
-{\f666\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew){\*\falt Times New Roman};}{\f667\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic){\*\falt Times New Roman};}{\f668\fswiss\fcharset186\fprq2 Tahoma Baltic{\*\falt Times New Roman};}
-{\f669\fswiss\fcharset163\fprq2 Tahoma (Vietnamese){\*\falt Times New Roman};}{\f670\fswiss\fcharset222\fprq2 Tahoma (Thai){\*\falt Times New Roman};}{\f681\froman\fcharset238\fprq2 Cambria CE;}{\f682\froman\fcharset204\fprq2 Cambria Cyr;}
-{\f684\froman\fcharset161\fprq2 Cambria Greek;}{\f685\froman\fcharset162\fprq2 Cambria Tur;}{\f688\froman\fcharset186\fprq2 Cambria Baltic;}{\f689\froman\fcharset163\fprq2 Cambria (Vietnamese);}
-{\f691\fswiss\fcharset238\fprq2 Calibri CE{\*\falt Century Gothic};}{\f692\fswiss\fcharset204\fprq2 Calibri Cyr{\*\falt Century Gothic};}{\f694\fswiss\fcharset161\fprq2 Calibri Greek{\*\falt Century Gothic};}
-{\f695\fswiss\fcharset162\fprq2 Calibri Tur{\*\falt Century Gothic};}{\f698\fswiss\fcharset186\fprq2 Calibri Baltic{\*\falt Century Gothic};}{\f699\fswiss\fcharset163\fprq2 Calibri (Vietnamese){\*\falt Century Gothic};}
-{\f713\fnil\fcharset0\fprq2 @SimSun Western;}{\f781\fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f782\fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f784\fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f785\fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f788\fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f789\fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
-\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
-\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 heading 2;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\lang1024\langfe1024\loch\f39\hich\af39\dbch\af13\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{\*\cs15
-\additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f38\hich\af38\dbch\af0 \sbasedon10 \slink1 \slocked Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0 \b\i\fs28\loch\f38\hich\af38\dbch\af0
-\sbasedon10 \slink2 \slocked \ssemihidden Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af36\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f36\hich\af36\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext17 \slink18 \ssemihidden \styrsid9396350 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af36\afs16 \ltrch\fcs0 \f36\fs16 \sbasedon10 \slink17 \slocked \ssemihidden \styrsid9396350 Balloon Text Char;}{
-\s19\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \cbpat9 \rtlch\fcs1 \af36\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f36\hich\af36\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext19 \ssemihidden \styrsid4851248
-Document Map;}}
-{\*\latentstyles\lsdstimax156\lsdlockeddef0{\lsdlockedexcept Normal;heading 1;heading 2;heading 3;heading 4;heading 5;heading 6;heading 7;heading 8;heading 9;toc 1;toc 2;toc 3;toc 4;toc 5;toc 6;toc 7;toc 8;toc 9;caption;Title;Default Paragraph Font;Subtitle;Strong;Emphasis;Table Grid;}}
-{\*\rsidtbl \rsid553632\rsid948930\rsid992837\rsid2773884\rsid4851248\rsid8142543\rsid8481152\rsid9255498\rsid9396350\rsid9966059\rsid13047213\rsid13901873\rsid14443160\rsid15433410}{\*\generator Microsoft Word 11.0.0000;}{\info{\operator jsu1}
-{\creatim\yr2010\mo10\dy6\hr17}{\revtim\yr2011\mo8\dy10\hr9\min28}{\version14}{\edmins4003}{\nofpages2}{\nofwords280}{\nofchars1599}{\nofcharsws1876}{\vern24615}{\*\password 00000000}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wor
-dml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\widowctrl\ftnbj\aenddoc\donotembedsysfont0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3
-\jcompress\viewkind1\viewscale120\rsidroot9396350 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
-\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang
-{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af48\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9396350 \hich\af48\dbch\af13\loch\f48 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 GenPage.exe Options Filename
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid9396350 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af48\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9396350 \hich\af48\dbch\af13\loch\f48 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid13047213 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af0
-\ltrch\fcs0 \b\insrsid13047213 \hich\af48\dbch\af13\loch\f48 GenPage}{\rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b\insrsid13047213\charrsid13047213 \hich\af48\dbch\af13\loch\f48 .exe }{\rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b\insrsid15433410\charrsid9255498
-\hich\af48\dbch\af13\loch\f48 -o \hich\af48\dbch\af13\loch\f48 <\hich\af48\dbch\af13\loch\f48 output_filename\hich\af48\dbch\af13\loch\f48 >\hich\af48\dbch\af13\loch\f48 \hich\af48\dbch\af13\loch\f48 [\hich\af48\dbch\af13\loch\f48 -f
-\hich\af48\dbch\af13\loch\f48 ]\hich\af48\dbch\af13\loch\f48 [\hich\af48\dbch\af13\loch\f48 -b\hich\af48\dbch\af13\loch\f48 ]\hich\af48\dbch\af13\loch\f48 [\hich\af48\dbch\af13\loch\f48 --version\hich\af48\dbch\af13\loch\f48 ]
-\hich\af48\dbch\af13\loch\f48 [\hich\af48\dbch\af13\loch\f48 -\hich\af48\dbch\af13\loch\f48 d\hich\af48\dbch\af13\loch\f48 ]\hich\af48\dbch\af13\loch\f48 [\hich\af48\dbch\af13\loch\f48 -q | -\hich\af48\dbch\af13\loch\f48 v\hich\af48\dbch\af13\loch\f48 ]
-\hich\af48\dbch\af13\loch\f48 [\hich\af48\dbch\af13\loch\f48 -h\hich\af48\dbch\af13\loch\f48 ]\hich\af48\dbch\af13\loch\f48 }{\rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b\insrsid8142543 \hich\af48\dbch\af13\loch\f48 <}{\rtlch\fcs1 \ab\af0 \ltrch\fcs0
-\b\insrsid553632\charrsid553632 \hich\af48\dbch\af13\loch\f48 EfiLoaderImageName}{\rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b\insrsid8142543 \hich\af48\dbch\af13\loch\f48 >}{\rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b\insrsid13047213\charrsid8142543
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid9396350 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid9396350\charrsid9396350
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af48\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9396350 \hich\af48\dbch\af13\loch\f48 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 The output of this tool is composed of two parts: the page table part and non-page table part. The }{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid948930 \hich\af48\dbch\af13\loch\f48
-non-page table }{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 is placed at the beginning of the output file}{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid948930 \hich\af48\dbch\af13\loch\f48 . The}{
-\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4851248 \hich\af48\dbch\af13\loch\f48 }{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid948930 \hich\af48\dbch\af13\loch\f48 page table is}{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 placed at the offset specified from option. }{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid948930 \hich\af48\dbch\af13\loch\f48 The }{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 Page table base address can also be specified by command line option.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af48\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9396350 \hich\af48\dbch\af13\loch\f48 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 [-f, --offset offset]
-\par }\pard \ltrpar\ql \fi426\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 The position that the page table will appear in the output file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 [-b, --baseaddr address]\tab \tab \tab \tab \tab
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 The page tab\hich\af48\dbch\af13\loch\f48 le location.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 -o, --output Filename
-\par \tab \hich\af48\dbch\af13\loch\f48 The file that contains both non-page table part and page table.
-\par \hich\af48\dbch\af13\loch\f48 [--version]
-\par \tab \hich\af48\dbch\af13\loch\f48 Print version and copyright of this program and exit
-\par \hich\af48\dbch\af13\loch\f48 [-v, --verbose]
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 Turn on verbose output with informational messages printed. This is a cou
-\hich\af48\dbch\af13\loch\f48 nt value, so specifying \hich\f48 \endash \loch\f48 vv can be used to increase the verbosity level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 [-q, --quiet]
-\par \tab \hich\af48\dbch\af13\loch\f48 Disable all messages except FATAL ERRORS
-\par \hich\af48\dbch\af13\loch\f48 [-d, --debug [#]]
-\par \tab \hich\af48\dbch\af13\loch\f48 Enable debug messages, at level #
-\par \hich\af48\dbch\af13\loch\f48 [-h, --help]
-\par \tab \hich\af48\dbch\af13\loch\f48 Print copyright, version and usage of this program and exit
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af48\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9396350 \hich\af48\dbch\af13\loch\f48 Example
-\par }\pard\plain \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af48\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 1. c:\\Tools\\GenPage.exe \hich\f48 \endash \loch\f48 f 0x20000 \hich\f48 \endash \loch\f48 b 0x1000 \hich\f48 \endash \loch\f48 o loader.img loader.data
-\par \hich\af48\dbch\af13\loch\f48 The loader.data and a 4G range page table with base address 0x1000 will be put into loader.img file. The page table will be placed at offset 0x20000 of loader.img file.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af48\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9396350 \hich\af48\dbch\af13\loch\f48 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 No \hich\af48\dbch\af13\loch\f48 know}{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8142543 \hich\af48\dbch\af13\loch\f48 n}{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9396350
-\hich\af48\dbch\af13\loch\f48 issues
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af48\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9396350 \hich\af48\dbch\af13\loch\f48 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af48\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9396350 \hich\af48\dbch\af13\loch\f48 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af48\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9396350 \hich\af48\dbch\af13\loch\f48 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af48\hich\af48\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 Copyright (c) 1999 - }{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid948930 \hich\af48\dbch\af13\loch\f48 201}{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13901873
-\hich\af48\dbch\af13\loch\f48 1}{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 , Intel Corporation. All rights reserved.
-\par \hich\af48\dbch\af13\loch\f48 This program and the accompanying materials are licensed and made available}{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14443160 \hich\af48\dbch\af13\loch\f48 }{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 under the terms and conditions of the BSD License which accomp\hich\af48\dbch\af13\loch\f48 anies this distribution. The full text of the license may be found at
-\par \hich\af48\dbch\af13\loch\f48 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af48\dbch\af13\loch\f48 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,}{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14443160 \hich\af48\dbch\af13\loch\f48 }{\rtlch\fcs1 \af48\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9396350 \hich\af48\dbch\af13\loch\f48 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRES\hich\af48\dbch\af13\loch\f48 S OR IMPLIED.
-\par }\pard \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9396350
-\par }} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenPatchPcdTable_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenPatchPcdTable_Utility_Man_Page.rtf
deleted file mode 100644
index 2fc2128a81..0000000000
--- a/BaseTools/UserManuals/GenPatchPcdTable_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,254 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana{\*\falt Verdana};}{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 00000000000000000000}@\'cb\'ce\'cc\'e5;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f55\fbidi \fswiss\fcharset238\fprq2 Arial CE;}
-{\f56\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}{\f58\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f59\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f60\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}
-{\f61\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}{\f62\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f63\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}
-{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}
-{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}
-{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}
-{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs21\kerning2\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs21\alang1025 \ltrch\fcs0 \fs21\lang1033\langfe2052\kerning2\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs44 \ltrch\fcs0 \b\f39\fs44\kerning44 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0
-\b\fs32\kerning0\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked \ssemihidden \spriority9 Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid8131749
-annotation reference;}{\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid8131749 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20\lang0\langfe2052\kerning0\langnp0\langfenp2052
-\sbasedon10 \slink18 \slocked \ssemihidden \styrsid8131749 Comment Text Char;}{\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0
-\b\fs20\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid8131749 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0
-\b\f39\fs20\lang0\langfe2052\kerning0\langnp0\langfenp2052 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid8131749 Comment Subject Char;}{\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe2052\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid8131749 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0
-\f38\fs16\lang0\langfe2052\kerning0\langnp0\langfenp2052 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid8131749 Balloon Text Char;}}{\*\rsidtbl \rsid8089322\rsid8131749\rsid8260129\rsid9178819\rsid10167770\rsid11893288\rsid12198464}{\mmathPr
-\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2011\mo7\dy18\hr16\min16}{\revtim\yr2011\mo8\dy10\hr9\min40}{\version6}{\edmins15}{\nofpages2}
-{\nofwords382}{\nofchars2180}{\nofcharsws2557}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot8260129 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0
-\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 GenPatchPcdTable.exe or GenPatchPcdTable.py \hich\f39 \endash \loch\f39 Parse the binary EFI image and its map file to get all used patchable PCDs\hich\f39 \rquote \loch\f39
- name and their offset in EFI image.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9178819
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 GenPatchPcdTable.exe -m <MapFile> -e <EfiFile> }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid12198464 \hich\af39\dbch\af31505\loch\f39 [}{\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 -o <OutFile>}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid12198464 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9178819
-
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11893288 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11893288 \hich\af39\dbch\af31505\loch\f39 GenPatchPcd.exe \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 GenPatchPcd.exe --version}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11893288\charrsid8089322
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11893288
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 GenPatchPcdTable tool parses the binary EFI image and map file generated by the different compilers (including MSFT, ICC, GCC) in EDKII \hich\af39\dbch\af31505\loch\f39
-code base. This tool searches the image map file to find every patchable PCD name and its real address, then parse the binary EFI image to get each section name and address, and calculate PCD offset in the binary EFI image. Finally, Pcd name, its offset a
-\hich\af39\dbch\af31505\loch\f39 n\hich\af39\dbch\af31505\loch\f39 d section name will be written into the output file. }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9178819
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 GenPatchPcdTable tool usually works together with PatchPcdValue tool to set the specific value of a patchable PCD into the binary EFI image. }{\rtlch\fcs1
-\af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9178819
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid12198464 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid12198464\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options are specified, tool prints usage.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 -m M\hich\af39\dbch\af31505\loch\f39 APFILE, --mapfile=MAPFILE}{
-\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid9178819
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39
-The map file generated by compiler contains the function and global variable information.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9178819
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 -e EFIFILE, --efifile=EFIFILE}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid9178819
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 The binary EFI image may contain the patchable PCD.}{\rtlch\fcs1 \af0\afs18
-\ltrch\fcs0 \f0\fs18\cf1\insrsid9178819
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 -o OUTFILE, --outputfile=OUTFILE}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid9178819
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39
-The output file stores the found patchable PCD information, which includes PcdName, Offset in EFI image and the section name.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9178819
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 -h, --help}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid9178819
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 Show this help message and exit.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid9178819
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 --version
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 Show program's version number and exit.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid12198464 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid12198464 \hich\af39\dbch\af31505\loch\f39 Status codes returned
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid12198464 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid12198464\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 Always ret\hich\af39\dbch\af31505\loch\f39 urn 0}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12198464 .}{\rtlch\fcs1 \af0 \ltrch\fcs0
-\insrsid12198464\charrsid12198464
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 1. Get the patchable Pcds from the binary PeiCore image and PeiCore map file, and output the PCD information into the file PcdTable.txt.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 GenPatchPcdTable.exe -m PeiCore.map -e PeiCore.efi -o PcdTable.txt}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid9178819
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 PcdTable.txt file contains the fol\hich\af39\dbch\af31505\loch\f39 lowing PCD information:}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid9178819
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 PCD Name Offset Section Name
-\par \hich\af39\dbch\af31505\loch\f39 PcdDebugPrintErrorLevel 0x6F80 .data
-\par \hich\af39\dbch\af31505\loch\f39 PcdLoadFixAddressBootTimeCodePageNumber 0x6F84 .data
-\par \hich\af39\dbch\af31505\loch\f39 PcdLoadFixAddressPeiCodePageNumber 0x6F88 .data
-\par \hich\af39\dbch\af31505\loch\f39 PcdLoadFixAddressR\hich\af39\dbch\af31505\loch\f39 untimeCodePageNumber 0x6F8C .data
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 No known bugs.
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9178819
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid8260129 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 2008 - 2011}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying mate\hich\af39\dbch\af31505\loch\f39 rials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9178819 \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\insrsid9178819
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9178819
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90
-fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2
-ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae
-a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1
-399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5
-4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84
-0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b
-c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7
-689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20
-5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0
-aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d
-316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840
-545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a
-c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100
-0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7
-8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89
-d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500
-1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f
-bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6
-a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a
-0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021
-0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008
-00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000005055
-146efe56cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenSec_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenSec_Utility_Man_Page.rtf
deleted file mode 100644
index 7a3c5681f4..0000000000
--- a/BaseTools/UserManuals/GenSec_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,382 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f4\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Helvetica;}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
-{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}
-{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}
-{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
-{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f85\fbidi \fswiss\fcharset238\fprq2 Helvetica CE;}{\f86\fbidi \fswiss\fcharset204\fprq2 Helvetica Cyr;}
-{\f88\fbidi \fswiss\fcharset161\fprq2 Helvetica Greek;}{\f89\fbidi \fswiss\fcharset162\fprq2 Helvetica Tur;}{\f90\fbidi \fswiss\fcharset177\fprq2 Helvetica (Hebrew);}{\f91\fbidi \fswiss\fcharset178\fprq2 Helvetica (Arabic);}
-{\f92\fbidi \fswiss\fcharset186\fprq2 Helvetica Baltic;}{\f93\fbidi \fswiss\fcharset163\fprq2 Helvetica (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}
-{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
-{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}
-{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}
-{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
-{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}
-{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}
-{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}
-{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
-{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid13127309 annotation reference;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid13127309 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink18 \slocked \ssemihidden \styrsid13127309 Comment Text Char;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid13127309 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid13127309 Comment Subject Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid13127309 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid13127309 Balloon Text Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid14900051 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid14900051 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh
-\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid14900051 Table Grid;}}{\*\rsidtbl \rsid4944739\rsid4999604\rsid5797707\rsid5911148\rsid6517620\rsid7240686\rsid8600807\rsid8723325\rsid9642788\rsid11029556\rsid11342878\rsid12069099\rsid12198464\rsid13127309
-\rsid14900051\rsid15798865}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo10\dy6\hr17\min1}{\revtim\yr2011\mo8\dy10\hr10\min2}
-{\version12}{\edmins145}{\nofpages4}{\nofwords706}{\nofchars4028}{\nofcharsws4725}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot11342878 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0
-\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 GenSec.exe \hich\f39 \endash \loch\f39 build one PI section file.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1036\langfe1033\langnp1036\insrsid11342878\charrsid11342878 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid11342878\charrsid11342878 \hich\af39\dbch\af31505\loch\f39 GenSec.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707
-\hich\af39\dbch\af31505\loch\f39 [-v | -d]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid12069099 \hich\af39\dbch\af31505\loch\f39 [-s <SectionType>] [-c }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid12069099 \hich\af39\dbch\af31505\loch\f39
-CompressType}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid12069099 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707 \hich\af39\dbch\af31505\loch\f39
- [-g <GuidValue>] [-l <GuidHeaderLength>] [-r <GuidAttr>]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid11342878\charrsid11342878 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707 \hich\af39\dbch\af31505\loch\f39 [-n }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid11029556 \hich\af39\dbch\af31505\loch\f39 <
-}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707 \hich\af39\dbch\af31505\loch\f39 UiString}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid11029556 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707 \hich\af39\dbch\af31505\loch\f39
-] [-j }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid11029556 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707 \hich\af39\dbch\af31505\loch\f39 Number}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid11029556
-\hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707 \hich\af39\dbch\af31505\loch\f39 ] }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid12069099 \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 o <OutputFile>}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid11342878\charrsid11342878
-\hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid12069099 \hich\af39\dbch\af31505\loch\f39 <InputFile1> }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid11342878\charrsid11342878 \hich\af39\dbch\af31505\loch\f39 [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid12069099
-\hich\af39\dbch\af31505\loch\f39 <InputFile2>}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid11342878\charrsid11342878 \hich\af39\dbch\af31505\loch\f39 \hich\f39 ]\'85}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid11342878
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707 \hich\af39\dbch\af31505\loch\f39 GenSec.exe \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 GenSec.exe --version}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid5797707\charrsid11342878
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 GenSec }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4944739 \hich\af39\dbch\af31505\loch\f39 generates}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878
-\hich\af39\dbch\af31505\loch\f39
- valid EFI_SECTION type files, which conform to the firmware file section defined in the PI specification, from PE32/PE32+/COFF image files or other binary files. This utility will produce a file that is the section header concatenated with the contents o
-\hich\af39\dbch\af31505\loch\f39 f\hich\af39\dbch\af31505\loch\f39 the input file. It does not validate that the contents of the input file match the section added.
-\par \hich\af39\dbch\af31505\loch\f39 PI SECTION Types referred to the Volume 3 of the PI 1.0 specification.
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4 Mnemonic\cell
-\hich\af4\dbch\af31505\loch\f4 PI Section Type\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878
-\trowd \irow0\irowband0\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4
-COMPRESS\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_COMPRESSION\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878
-\trowd \irow1\irowband1\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4
-GUID\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_GUID_DEFINED\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878
-\trowd \irow2\irowband2\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4
-PE32\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_PE32\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878
-\trowd \irow3\irowband3\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4
-PIC\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_PIC\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878
-\trowd \irow4\irowband4\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4
-TE\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_TE\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878
-\trowd \irow5\irowband5\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4
-DXE_DEPEX\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_DXE_DEPEX\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878
-\trowd \irow6\irowband6\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4
-VERSION\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_VERSION\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878
-\trowd \irow7\irowband7\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4
-UI\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_USER_INTERFACE\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878
-\trowd \irow8\irowband8\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4
-COMPAT16\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_COMPATIBILITY16\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0
-\f4\fs18\insrsid11342878 \trowd \irow9\irowband9\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3
-\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr
-\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878
-\hich\af4\dbch\af31505\loch\f4 FVIMAGE\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1
-\af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \trowd \irow10\irowband10\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15
-\trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt
-\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {
-\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4 SUBGUID\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_FREEFORM_SUBTYPE_GUID\cell }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \trowd \irow11\irowband11\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb
-\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar
-\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4 RAW\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_RAW\cell }\pard \ltrpar
-\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \trowd \irow12\irowband12\ltrrow\ts11\trgaph108\trleft36\trbrdrt\brdrs\brdrw15 \trbrdrl
-\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15
-\cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row \ltrrow}\pard \ltrpar
-\ql \li0\ri0\sa60\sl240\slmult0\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \hich\af4\dbch\af31505\loch\f4 PEI_DEPEX\cell \hich\af4\dbch\af31505\loch\f4 EFI_SECTION_PEI_DEPEX\cell
-}\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af4\afs18 \ltrch\fcs0 \f4\fs18\insrsid11342878 \trowd \irow13\irowband13\lastrow \ltrrow\ts11\trgaph108\trleft36\trbrdrt
-\brdrs\brdrw15 \trbrdrl\brdrs\brdrw15 \trbrdrb\brdrs\brdrw15 \trbrdrr\brdrs\brdrw15 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind144\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr
-\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth1392\clshdrawnil \cellx1428\clvertalt\clbrdrt\brdrs\brdrw15 \clbrdrl\brdrs\brdrw15 \clbrdrb\brdrs\brdrw15 \clbrdrr\brdrs\brdrw15 \cltxlrtb\clftsWidth3\clwWidth4372\clshdrawnil \cellx5800\row
-}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid15798865\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15798865 \hich\af39\dbch\af31505\loch\f39 e specified, tool prints usage.}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid13127309
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Filename1 [FilenameN]
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Input PE/PE32+ image, or TE image, or other binary files.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -o FileName, --outputfile FileName
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 The PI section file is created. This option is required.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -s SectionType, --sectiontype SectionType
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 SectionType defined in PI spec is one type of EFI_SECTION_COMPRE
-\hich\af39\dbch\af31505\loch\f39
-SSION, EFI_SECTION_GUID_DEFINED, EFI_SECTION_PE32, EFI_SECTION_PIC, EFI_SECTION_TE, EFI_SECTION_DXE_DEPEX, EFI_SECTION_COMPATIBILITY16, EFI_SECTION_USER_INTERFACE, EFI_SECTION_VERSION, EFI_SECTION_FIRMWARE_VOLUME_IMAGE, EFI_SECTION_RAW, EFI_SECTION_FREEFO
-\hich\af39\dbch\af31505\loch\f39 R\hich\af39\dbch\af31505\loch\f39 M_SUBTYPE_GUID, EFI_SECTION_PEI_DEPEX. If sectiontype is not given, EFI_SECTION_ALL is default type to contain the input all sections to one section file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -c [Type], --compress [Type]
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Compress method type can be PI_NONE or PI_STD. If Type is not given, PI_
-\hich\af39\dbch\af31505\loch\f39 STD is default type.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -g GuidValue, --vendor GuidValue
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39
-GuidValue is one specific vendor guid value for guided section. Its format is 00000000-0000-0000-0000-000000000000. If it is not given, the default CRC32 guided is used.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -l GuidHeaderLength, --HeaderLength GuidHeaderLength
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Specify the size of header of GUID-ed data.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -r GuidAttr, --attributes GuidAttr
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39
-GuidAttr is guided section attributes, which may be PROCESSING_REQUIRED or AUTH_STATUS_VALID. If it is not given, PROCESSING\hich\af39\dbch\af31505\loch\f39 _REQUIRED is the default attribute.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -n String, --name String
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 String is a NULL terminated string used in Ui section.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -j Number, --buildnumber Number
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Number is an integer value between 0000 and 9999 used in Ver section.
-
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Turn on verbose output w\hich\af39\dbch\af31505\loch\f39
-ith informational messages.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -d, --debug level
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11342878 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Enable debug message with specified level.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 --version
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Show program version number and exit
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Show this help message and exit
-\par }\pard\plain \ltrpar\s2\ql \fi-1440\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid14900051 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14900051\charrsid6517620 {\*\bkmkstart OLE_LINK7}{\*\bkmkstart OLE_LINK8}\hich\af39\dbch\af31505\loch\f39
-Status codes returned
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid14900051\charrsid8600807 \hich\af2\dbch\af13\loch\f2 STATUS_SUCCESS}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid14900051 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18
-\ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid14900051\charrsid4999604 \tab }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid14900051 0}{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid14900051 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid14900051 \hich\af39\dbch\af13\loch\f39 The action was com\hich\af39\dbch\af13\loch\f39 pleted as requested.}{
-\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid14900051 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid14900051 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb
-\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\kerning2\insrsid14900051\charrsid8600807 \hich\af2\dbch\af13\loch\f2
-STATUS_ERROR}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid14900051 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid14900051\charrsid4999604 \tab \tab }{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid14900051 \hich\af2\dbch\af13\loch\f2 2}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0
-\cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid14900051\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid8723325\yts26 {
-\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid14900051 \hich\af39\dbch\af13\loch\f39 The action \hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0
-\fs20\insrsid14900051 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11342878 {\*\bkmkend OLE_LINK7}{\*\bkmkend OLE_LINK8}\hich\af39\dbch\af31505\loch\f39 Example
-
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 1. Generate PE32 section file with the input PE image, PE32 section type and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid11342878\charrsid11342878 \hich\af39\dbch\af31505\loch\f39 GenSec -s EFI_SECTION_PE32 PeiMain.efi -o PeiMain.pe32
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 2. Generate compression section file with the input section files, compression method and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid11342878\charrsid11342878 \hich\af39\dbch\af31505\loch\f39 GenSec -s EFI_SECTION_COMPRESSION \hich\f39 \endash \loch\f39
-c PI_STD PeiMain.pe32 PeiMain.ui PeiMain.ver -o PeiMain.com
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 3. Generate the default CRC32 guided section file\hich\af39\dbch\af31505\loch\f39 with the input section files, and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 GenSec \hich\f39 \endash \loch\f39 s EFI_SECTION_GUID_DEFINED PeiMain.pe32 PeiMain.ui PeiMain.ver \hich\f39 \endash \loch\f39 o PeiMain.guided
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 4. Generate the vendor specific guided section file with the input vendor raw files, the vendor guid, and the \hich\af39\dbch\af31505\loch\f39
-output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 GenSec \hich\f39 \endash \loch\f39 s EFI_SECTION_GUID_DEFINED \hich\f39 \endash \loch\f39 g A31280AD-481E-41B6-95E8-127F-4C984779 \hich\f39 \endash
-\loch\f39 r PROCESSING_REQUIRED \hich\f39 \endash \loch\f39 r AUTH_STATUS_VALID PeiMain.raw \hich\f39 \endash \loch\f39 o PeiMain.guided
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 5. Generate UI section with the input string and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid11342878\charrsid11342878 \hich\af39\dbch\af31505\loch\f39 Gensec -s EFI_SEC\hich\af39\dbch\af31505\loch\f39 TION_USER_INTERFACE \hich\f39 \endash \loch\f39
-\hich\f39 n \'93\loch\f39 \hich\f39 PeiMain\'94\loch\f39 \hich\f39 \endash \loch\f39 o PeiMain.ui
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 6. Generate VER section with the input build number and the output file name.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid11342878\charrsid11342878 \hich\af39\dbch\af31505\loch\f39 GenSec -s EFI_SECTION_VERSION \hich\f39 \endash \loch\f39 j 20 \hich\f39 \endash \loch\f39 o PeiMain.ver
-
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 No known }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4944739 \hich\af39\dbch\af31505\loch\f39 issues}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 .
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11342878
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 2007 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid4944739 \hich\af39\dbch\af31505\loch\f39 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9642788 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 dist\hich\af39\dbch\af31505\loch\f39 ribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11342878 \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e500000000000000000000000040c5
-f0830157cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/GenVtf_Utility_Man_Page.rtf b/BaseTools/UserManuals/GenVtf_Utility_Man_Page.rtf
deleted file mode 100644
index 695696c4aa..0000000000
--- a/BaseTools/UserManuals/GenVtf_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,308 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;\red0\green127\blue127;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap
-\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 \slink18 \ssemihidden \sunhideused \styrsid11091224 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink17 \slocked \ssemihidden \styrsid11091224 Balloon Text Char;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid4072718 annotation reference;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext20 \slink21 \ssemihidden \sunhideused \styrsid4072718 annotation text;}{\*\cs21 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink20 \slocked \ssemihidden \styrsid4072718 Comment Text Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon20 \snext20 \slink23 \ssemihidden \sunhideused \styrsid4072718 annotation subject;}{\*\cs23 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon21 \slink22 \slocked \ssemihidden \styrsid4072718 Comment Subject Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid12480811 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid12480811 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh
-\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid12480811 Table Grid;}}{\*\rsidtbl \rsid351840\rsid2906062\rsid3369612\rsid3607127\rsid4072718\rsid4999604\rsid5056671\rsid5793818\rsid5911148\rsid7230979\rsid8326873\rsid8600807\rsid11091224\rsid12198464
-\rsid12480811\rsid13438422\rsid14880849\rsid15277707\rsid15819932}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo10\dy6\hr15\min21}
-{\revtim\yr2011\mo8\dy10\hr10\min2}{\version14}{\edmins1040}{\nofpages3}{\nofwords493}{\nofchars2812}{\nofcharsws3299}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot13438422 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0
-\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 GenVtf.exe - generate the Boot Strap File (AKA Volume Top File, or VTF) for IPF images
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 GenVtf.exe [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5056671 \hich\af39\dbch\af31505\loch\f39 -v | -q | -d}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid3607127 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5056671 \hich\af39\dbch\af31505\loch\f39
- }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2906062 \hich\af39\dbch\af31505\loch\f39 [-o }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15819932
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2906062 \hich\af39\dbch\af31505\loch\f39 OutputFile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid15819932 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2906062 \hich\af39\dbch\af31505\loch\f39 ] \hich\f39 \endash
-\hich\af39\dbch\af31505\loch\f39 f <FileName> -r <BaseAddr> -s <Size>}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid7230979
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2906062 \hich\af39\dbch\af31505\loch\f39 GenVtf.exe \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 GenVtf.exe --version}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2906062\charrsid351840
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 GenVtf }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 generates}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979
-\hich\af39\dbch\af31505\loch\f39 the Boot Strap File (AKA Volume Top File, or VTF) for IPF images. This utility }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 parses}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 the input BSF inf file and get}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979
-\hich\af39\dbch\af31505\loch\f39 the component information. If all the\hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 required components are in a single }{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 VTF file, then only one VTF Base Address and Size }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 is}{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 needed and only one raw data output file and one symbol output file }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 (}{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 which is the symbol of raw data}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 ) is needed}{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 . If there}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 is a }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 component required }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 for the}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979
-\hich\af39\dbch\af31505\loch\f39 the second V\hich\af39\dbch\af31505\loch\f39 TF file but there}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 is}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 no second VTF Base Address and Size specified in }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 command line interface, then this utility will exit with }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 a }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 related error message; if there}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 is a }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979
-\hich\af39\dbch\af31505\loch\f39 second VTF Base Address and Size specified, then two raw data output files and one sym\hich\af39\dbch\af31505\loch\f39 bol output file}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849
-\hich\af39\dbch\af31505\loch\f39 will be created}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 .
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Options}{\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0
-\b\f0\fs28\cf18\insrsid7230979
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid3369612\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3369612 \hich\af39\dbch\af31505\loch\f39 e specified, tool prints usage.}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid4072718
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 -f, --filename BS_INFFile
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Name of the BS Image INF file to use
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 -r, --baseaddr hexaddress
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 The Base Address is the starting address of the Firmware Volume wh\hich\af39\dbch\af31505\loch\f39 ere the Boot Strapped Image will reside
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 -s, --size Size
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 The size of the Firmware Volume
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 -o, --output Filename
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 VTF Filename that will be created
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 --version
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid7230979 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Turn on verbose outpu\hich\af39\dbch\af31505\loch\f39
-t with informational messages printed. This is a count value, so specifying \hich\f39 \endash \loch\f39 vv can be used to increase the verbosity level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 -q, --quiet
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid7230979 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Disable all messages except FATAL ERRORS
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 -d, --debug [#]
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid7230979 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Enable debug messages, at level #
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid7230979 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Print copyright, version and usage of this program and exit
-\par }\pard\plain \ltrpar\s2\ql \fi-1440\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid12480811 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid12480811\charrsid3607127 {\*\bkmkstart OLE_LINK7}{\*\bkmkstart OLE_LINK8}\hich\af39\dbch\af31505\loch\f39
-Status codes returned
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid12480811\charrsid8600807 \hich\af2\dbch\af13\loch\f2 STATUS_SUCCESS}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12480811 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18
-\ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid12480811\charrsid4999604 \tab }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid12480811 0}{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid12480811 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12480811 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0
-\kerning2\insrsid12480811 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid12480811 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb
-\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\kerning2\insrsid12480811\charrsid8600807 \hich\af2\dbch\af13\loch\f2
-STATUS_ERROR}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12480811 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid12480811\charrsid4999604 \tab \tab }{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid12480811 \hich\af2\dbch\af13\loch\f2 2}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0
-\cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid12480811\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid15277707\yts26 {
-\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid12480811 \hich\af39\dbch\af13\loch\f39 The action \hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0
-\fs20\insrsid12480811 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid7230979 {\*\bkmkend OLE_LINK7}{\*\bkmkend OLE_LINK8}\hich\af39\dbch\af31505\loch\f39 Example}{
-\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0 \b\f0\fs28\cf18\insrsid7230979
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Generate one VTF file with inf file name, base address and size specified in command line and without output filename specified. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 Default}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 \hich\f39 filename \'93\loch\f39 \hich\f39 VTF1.RAW\'94\loch\f39 will be used.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 GenVtf \hich\f39 \endash \loch\f39 f bsf.inf \hich\f39 \endash \loch\f39 r 0xFFE00000 \hich\f39 \endash \loch\f39 s 0x200000
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Generate two VTF files with inf file name\hich\af39\dbch\af31505\loch\f39
-, base address and size specified in command line and without output filename specified. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 Default}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 \hich\f39 filename \'93\loch\f39 \hich\f39 VTF1.RAW\'94\loch\f39 \hich\f39 and \'93\loch\f39 \hich\f39 VTF2.RAW\'94\loch\f39 will be used.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 GenVtf \hich\f39 \endash \loch\f39 f bsf.inf \hich\f39 \endash \loch\f39 r 0xFFE00000 \hich\f39 \endash \loch\f39 s 0x200000 \hich\f39 \endash \loch\f39
-r 0xFFD00000 \hich\f39 \endash \loch\f39 s 0x100000
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Generate one VTF file with inf file name,\hich\af39\dbch\af31505\loch\f39 base address and size specified in command line and output filename specified.
-
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 GenVtf \hich\f39 \endash \loch\f39 o file.tmp \hich\f39 \endash \loch\f39 f bsf.inf \hich\f39 \endash \loch\f39 r 0xFFE00000 \hich\f39 \endash \loch\f39
-s 0x200000
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Generate two VTF files with inf file name, base address and size specified in command line and output filename specified.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 GenVtf \hich\f39 \endash \loch\f39 o file1.tmp \hich\f39 \endash \loch\f39 o file2.tmp \hich\f39 \endash \loch\f39 f bsf.inf \hich\f39 \endash \loch\f39
-r 0xFFE00000 \hich\f39 \endash \loch\f39 s 0x200000 \hich\f39 \endash \loch\f39 r 0xFFD00000 \hich\f39 \endash \loch\f39 s 0x100000
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Bugs}{\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0
-\b\f0\fs28\cf18\insrsid7230979
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 No known bugs.
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk\hich\af39\dbch\af31505\loch\f39 2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid7230979
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Files}{\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0
-\b\f0\fs28\cf18\insrsid7230979
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 See}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf18\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 also}{\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0 \b\f0\fs28\cf18\insrsid7230979
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 License}{\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0
-\b\f0\fs28\cf18\insrsid7230979
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 1999 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14880849 \hich\af39\dbch\af31505\loch\f39 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid351840 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7230979 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials
-\par \hich\af39\dbch\af31505\loch\f39 are licensed and made available under the terms and conditions of the BSD License
-\par \hich\af39\dbch\af31505\loch\f39 which accompanies this distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php\tab
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD L\hich\af39\dbch\af31505\loch\f39 ICENSE ON AN "AS IS" BASIS,
-\par \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid7230979
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e500000000000000000000000000cf
-518b0157cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/Intel_UEFI_Packaging_Tool_Man_Page.rtf b/BaseTools/UserManuals/Intel_UEFI_Packaging_Tool_Man_Page.rtf
deleted file mode 100644
index e479261a1d..0000000000
--- a/BaseTools/UserManuals/Intel_UEFI_Packaging_Tool_Man_Page.rtf
+++ /dev/null
@@ -1,558 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f3\fbidi \froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f10\fbidi \fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt SimSun};}
-{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana{\*\falt Verdana};}{\f41\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@SimSun;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f312\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f313\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f315\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f316\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f317\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f318\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f319\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f320\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f332\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f333\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f335\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f336\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f337\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f338\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f339\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f340\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f444\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f652\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f653\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f655\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f656\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f659\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f660\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f702\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}
-{\f703\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f705\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f706\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}
-{\f709\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f710\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f724\fbidi \fnil\fcharset0\fprq2 @SimSun Western;}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;\red79\green129\blue189;\red192\green80\blue77;\red255\green255\blue255;}{\*\defchp
-\fs21\kerning2\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1
-\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1
-\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0
-\rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1
-Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs21\alang1025 \ltrch\fcs0 \fs21\lang1033\langfe1033\kerning2\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033
-\snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs44 \ltrch\fcs0 \b\f39\fs44\kerning44 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0
-\b\fs32\kerning0\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked \ssemihidden \spriority9 Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs21 \ltrch\fcs0 \fs21 \sbasedon10 \ssemihidden \sunhideused \styrsid14245224
-annotation reference;}{\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon0 \snext18 \slink19 \sunhideused \styrsid14245224 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f39\fs24\kerning0 \sbasedon10 \slink18 \slocked \styrsid14245224 Comment Text Char;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs24\alang1025 \ltrch\fcs0 \b\fs24\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid14245224 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f39\fs24\kerning0 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid14245224 Comment Subject Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe2052\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid14245224 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \f39\fs16\kerning0 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid14245224 Balloon Text Char;}}{\*\listtable
-{\list\listtemplateid-757050274\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid-1837736466\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0
-\fi-360\li360\lin360 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'01);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-420\li840\lin840 }
-{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-420\li1260\lin1260 }{\listlevel
-\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-420\li1680\lin1680 }{\listlevel\levelnfc4
-\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'04);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-420\li2100\lin2100 }{\listlevel\levelnfc2\levelnfcn2\leveljc2
-\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-420\li2520\lin2520 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0
-\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-420\li2940\lin2940 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0
-\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'07);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-420\li3360\lin3360 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1
-\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-420\li3780\lin3780 }{\listname ;}\listid940380088}}{\*\listoverridetable{\listoverride\listid940380088
-\listoverridecount0\ls1}}{\*\revtbl {Unknown;}{lhauch;}}{\*\rsidtbl \rsid1799\rsid91813\rsid396487\rsid483735\rsid552779\rsid655454\rsid685363\rsid805008\rsid1009867\rsid1050478\rsid1054871\rsid1064894\rsid1536027\rsid1734833\rsid1924533\rsid2172204\rsid2383780\rsid2490530
-\rsid2562233\rsid2574604\rsid2707436\rsid2819890\rsid3217417\rsid3356758\rsid3687826\rsid3947812\rsid3958709\rsid4003508\rsid4355979\rsid4412180\rsid4472091\rsid4527705\rsid4868941\rsid5134899\rsid5203345\rsid5310607\rsid5464326\rsid5852719\rsid6362790
-\rsid7164825\rsid7174505\rsid7424010\rsid7609983\rsid7997214\rsid8276687\rsid8812445\rsid8814479\rsid8943713\rsid9138298\rsid9446431\rsid9901089\rsid9964275\rsid10190081\rsid10246519\rsid10316983\rsid10440781\rsid10490922\rsid10891364\rsid10963834
-\rsid11147893\rsid11365531\rsid11761618\rsid12071700\rsid12143623\rsid12200614\rsid12483726\rsid12718714\rsid12721085\rsid12721903\rsid12803398\rsid12810495\rsid12914083\rsid13187009\rsid13379505\rsid13771663\rsid13849670\rsid14181487\rsid14245224
-\rsid14313265\rsid15022072\rsid15164179\rsid15283407\rsid15421225\rsid15548121\rsid15563257\rsid15625864\rsid15803579\rsid15860657\rsid16128153\rsid16193110\rsid16255980\rsid16453629\rsid16464444\rsid16524051}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0
-\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author kgui1}{\operator lhauch}{\creatim\yr2011\mo7\dy1\hr9\min12}{\revtim\yr2011\mo7\dy1\hr9\min12}{\version2}{\edmins0}{\nofpages8}{\nofwords2241}
-{\nofchars12776}{\*\company Intel Corporation}{\nofcharsws14988}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0\ltrsect
-\deftab360\widowctrl\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot2707436 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}
-{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
-{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9
-\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 \hich\f39 UPT.EXE (Intel\'ae\loch\f39 \hich\f39 UEFI Packaging Tool (Intel\'ae\loch\f39 UEFIUPT)) - create, install or remove a UEFI Distribution Package.}{\rtlch\fcs1 \af0\afs18
-\ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 upt [option] UEFI_PACKAGE_FILE}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The Intel UEFIPT command set has an associated order of execution precedence. For example: -v takes precedence over \hich\f39 \endash \loch\f39
-q which has precedence over \hich\f39 \endash \loch\f39 d which has precedence of \hich\f39 \endash \loch\f39 s.
-\par \hich\af39\dbch\af31505\loch\f39 Execution precedence \hich\af39\dbch\af31505\loch\f39 is defined as follows:
-\par }\pard \ltrpar\ql \li-720\ri0\sb60\nowidctlpar\wrapdefault\faauto\rin0\lin-720\itap0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 upt \hich\f2 \endash \loch\f2 h | --help | --version
-\par }\pard \ltrpar\ql \li-720\ri0\sb60\nowidctlpar\wrapdefault\faauto\rin0\lin-720\itap0\pararsid13187009 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid13187009 \hich\af2\dbch\af31505\loch\f2 upt [-v|\hich\af2\dbch\af31505\loch\f2
--q|-d DEBUG_LEVEL|-s] [-}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid13187009 \hich\af2\dbch\af31505\loch\f2 f] [-x] \hich\f2 \endash \loch\f2 c DistFile \hich\f2 \endash \loch\f2 t DistInfo}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0
-\f2\fs16\cf13\insrsid13187009
-\par }\pard \ltrpar\ql \li-720\ri0\sb60\nowidctlpar\wrapdefault\faauto\rin0\lin-720\itap0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 upt [-v|\hich\af2\dbch\af31505\loch\f2 -q|-d DEBUG_LEVEL|-s] [-f] [-x]
-\hich\f2 \endash \loch\f2 c DistFile \hich\f2 \endash \loch\f2 t DistInfo [-m INF_File\hich\af2\dbch\af31505\loch\f2 ]+
-\par \hich\af2\dbch\af31505\loch\f2 upt [-v|-q|-d DEBUG_LEVEL|-s] [-f] [-x] \hich\f2 \endash \loch\f2 c DistFile \hich\f2 \endash \loch\f2 t DistInfo [-p DEC_File\hich\af2\dbch\af31505\loch\f2 ]+
-\par \hich\af2\dbch\af31505\loch\f2 upt [-v|-q|-d DEBUG_LEVEL|-s] [-f] [-x] \hich\f2 \endash \loch\f2 c DistFile \hich\f2 \endash \loch\f2 t DistInfo [-m INF_File\hich\af2\dbch\af31505\loch\f2 ]+ \hich\af2\dbch\af31505\loch\f2 [-p DEC_File
-\hich\af2\dbch\af31505\loch\f2 ]+
-\par \hich\af2\dbch\af31505\loch\f2 upt [-v|-q|-d DEBUG_LEVEL|-s] [-f|-n] [-x] \hich\f2 \endash \loch\f2 i DistFile
-\par \hich\af2\dbch\af31505\loch\f2 upt [-v|-q|-d DEBUG_LEVEL|-s] [}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid5310607 -}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 f] [-x] \hich\f2 \endash
-\loch\f2 r DistFile}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 \hich\f39 Intel\'ae\loch\f39 UEFIPT is used to create, install or remove a UEFI Distribution Package.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 \hich\f39 A \'93\loch\f39 \hich\f39 package information data\'94\loch\f39 \hich\f39 file (\'94\loch\f39 \hich\f39 .ini\'94\loch\f39 ) comprised of a
-\hich\af39\dbch\af31505\loch\f39 \hich\f39 \'93\loch\f39 \hich\f39 Distribution header\'94\loch\f39 \hich\f39 (required), and optional \'93\loch\f39 \hich\f39 Miscellaneous File Header, and/or \'93\loch\f39 \hich\f39 Tools Header\'94\loch\f39 \hich\f39
- is required to create a distribution package. Instructions on how to create a package information file and its required content may be found in the Intel\'ae\loch\f39 UE\hich\af39\dbch\af31505\loch\f39 F\hich\af39\dbch\af31505\loch\f39 \hich\f39
-I Packaging Tool (Intel\'ae\loch\f39 UEFIPT) Quick Start guide. }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 When entered on the command line, file locations are relative to the program execution path set in the OS environment variable }{\rtlch\fcs1 \af2\afs18
-\ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 WORKSPACE}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 .
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Intel UEFIPT provides development environment support for the EDK\hich\af39\dbch\af31505\loch\f39 II development tree.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf18\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Windows Development Workstations}{\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39
-The working directory for the EDK II build tree (containing distribution packages) is defined as a first level folder from the root directory for drive C. For example:
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 C:\\EDKII>
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 In this example, the OS\hich\af39\dbch\af31505\loch\f39
- environment variable WORKSPACE is set to the working directory for EDK II development. For example:
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 C:\\>set WORKSPACE=C:\\EDKII
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf18\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Windows 7 Development Workstations
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 For Windows 7 users, it is recommended that you use the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf19\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 subst
-}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 command, keeping your edk2 downloads in your home directory. \hich\af39\dbch\af31505\loch\f39
-Windows 7 only allows administrators to create folders in the root directory. If you can remember to always open the cmd.exe using "run as\hich\af39\dbch\af31505\loch\f39
- administrator ...", the directions above can be used. Otherwise, if you sources are located in a directory path such as the following:
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 C:\\Users\\myname\\Documents\\Work\\edk2>
-\par \hich\af2\dbch\af31505\loch\f2 subst z: C:\\Users\\myname\\Documents\\Work\\edk2
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Then set the OS environment variable W\hich\af39\dbch\af31505\loch\f39
-ORKSPACE to the newly created drive:
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid2707436 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid2707436 \hich\af2\dbch\af31505\loch\f2 C:\\Users\\myname\\Documents\\Work\\edk2>z:
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 z:\\>set WORKSPACE=z:\\
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf18\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Linux and OS/X Development Workstations
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The working directory for the EDK II build tree (containing distribution packages) is defined as a first \hich\af39\dbch\af31505\loch\f39
-level folder from your home directory. For example:
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 [/home/myname/edk2] #
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39
-In this example, the OS environment variable WORKSPACE is set to the working directory for EDK II development. For example:
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 [/home/myname/edk2] # export WORKSPACE=/home/myname/edk2
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The OS environment variable}{\rtlch\fcs1 \af39 \ltrch\fcs0 \insrsid9138298
-\hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 WORKSPACE}{\rtlch\fcs1 \af39 \ltrch\fcs0 \insrsid9138298 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 is now set to the EDKII WORKSPACE}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 To create a distribution package:}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid483735
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 >upt -c test.dist -p MdePkg/MdePkg.dec -t Package_Information_Data_File.ini}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid2172204
-\par }\pard \ltrpar\ql \fi-360\li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0\pararsid685363 {\rtlch\fcs1 \af3\afs18 \ltrch\fcs0 \f3\fs18\cf1\insrsid9138298 \loch\af3\dbch\af31505\hich\f3 \'b7\tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'93\loch\f39 \hich\f39 test.dist\'94\loch\f39 is the target distribution package that will be generated. If a destination pat\hich\af39\dbch\af31505\loch\f39
-h is not supplied, the test.dist will be created in the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10246519 \hich\af39\dbch\af31505\loch\f39 current working }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\hich\af39\dbch\af31505\loch\f39 directory}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14181487 ,}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \fi-360\li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af3\afs18 \ltrch\fcs0 \f3\fs18\cf1\insrsid9138298 \loch\af3\dbch\af31505\hich\f3 \'b7\tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'93\loch\f39 \hich\f39 MdePkg/MdePkg.dec\'94\loch\f39 is the path\hich\af39\dbch\af31505\loch\f39 and \hich\af39\dbch\af31505\loch\f39 the source file used to generate the distribution package,
-}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af3\afs18 \ltrch\fcs0 \f3\fs18\cf1\insrsid9138298 \loch\af3\dbch\af31505\hich\f3 \'b7\tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'93\loch\f39 \hich\f39
-Package_Information_Data_File.ini\'94\loch\f39 \hich\f39 is the file which specifies the information not included in \'93\loch\f39 \hich\f39 MdePkg/MdePkg.dec\'94\loch\f39 but is re\hich\af39\dbch\af31505\loch\f39
-quired by the packaging specification. If a source path for the Package_Information_Data_File.ini is not provided, }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10246519 \hich\af39\dbch\af31505\loch\f39 I\hich\af39\dbch\af31505\loch\f39
-ntel UEFIPT will attempt to locate the file in the current working directory or\hich\af39\dbch\af31505\loch\f39 , failing that, the tool will attempt to locate it in}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\hich\af39\dbch\af31505\loch\f39 $(WORKSPACE)}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10246519 \hich\af39\dbch\af31505\loch\f39 dire\hich\af39\dbch\af31505\loch\f39 c\hich\af39\dbch\af31505\loch\f39 tory}{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9138298 .}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 UPT User Extensions
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 User extensions are provided so meta}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 -}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 \hich\f39 data files can be created which provide functionality identical to the original meta-data. Details about user extensions are located in the Intel\'ae\loch\f39 UEFIPT Quick Start Guide. }
-{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 --version
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Show program's version number and exit
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Show th\hich\af39\dbch\af31505\loch\f39 is help message and exit
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -d DEBUG_LEVEL, --debug=DEBUG_LEVEL
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Print DEBUG statements, where DEBUG_LEVEL is 0-9
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Print informational statements
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -s, --silent
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39
-Returns only the exit code informational and error messages are not displayed
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -q\hich\af39\dbch\af31505\loch\f39 , --quiet
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Returns the exit code and displays error messages only}{\rtlch\fcs1
-\af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -i INSTALL_DISTRIBUTION_PACKAGE_FILE}{\rtlch\fcs1 \ab\af0\afs18
-\ltrch\fcs0 \b\f0\fs18\cf1\insrsid9138298 ,\line }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 --install= INSTALL_DISTRIBUTION_PACKAGE_FILE}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Specify the UEFI Distribution Package filename to install
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -c CREATE_DISTRIBUTION_PACKAGE_FILE,}{\rtlch\fcs1 \ab\af0\afs18
-\ltrch\fcs0 \b\f0\fs18\cf1\insrsid9138298 \line }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 --create= CREATE_DISTRIBUTION_PACKAGE_FILE}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Specify the UEFI Distribution Package filename to create
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -r REMOVE_DISTRIBUTION_PACKAGE_FILE,}{\rtlch\fcs1 \ab\af0\afs18
-\ltrch\fcs0 \b\f0\fs18\cf1\insrsid9138298 \line }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 --remove= REMOVE_DISTRIBUTION_PACKAGE_FILE}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Specify the UEFI Distribution Package filename to remove
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -t PACKAGE_I\hich\af39\dbch\af31505\loch\f39 NFORMATION_DATA _FILE,}{
-\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid9138298 \line }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 --template= PACKAGE_INFORMATION_DATA_FILE}{\rtlch\fcs1 \ab\af0\afs18
-\ltrch\fcs0 \b\f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Specify Package Information Data filename to create package}{\rtlch\fcs1
-\af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -p EDK2_DEC_FILENAME, --dec-filename= EDK2_DEC_FILENAME}{\rtlch\fcs1
-\ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Specify dec file names to create package}{\rtlch\fcs1 \af0\afs18
-\ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -m EDK2_INF_FILENAME, --inf-\hich\af39\dbch\af31505\loch\f39
-filename= EDK2_INF_FILENAME}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Specify inf file names to create package}{\rtlch\fcs1 \af0\afs18
-\ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -f, --force
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Disable all user prompts}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -n, --custom-path}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Enable user prompting for alternate installation directories}{\rtlch\fcs1
-\af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -x, --}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid15860657 \hich\af39\dbch\af31505\loch\f39 free}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -loc\hich\af39\dbch\af31505\loch\f39 k
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Skip the check for multiple instances}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid9138298
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Examples}{\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0
-\b\f0\fs28\cf17\insrsid9138298
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 In the examples below, the "\\
-" character is used to indicate line extension. On Microsoft* Windows based workstations, the command-line must appear on a single line, while under Linux and OS/X, the shell will correctly handle the "\\\hich\af39\dbch\af31505\loch\f39
-" line extension character and the command can appear on separate lines.
-\par \hich\af39\dbch\af31505\loch\f39 All EDK II tools allow the user to specify a forward slash "/" character in directory names on the command-line.
-\par \hich\af39\dbch\af31505\loch\f39 The command-line prompt in the following Intel UEFIPT examples is ">";\hich\af39\dbch\af31505\loch\f39 command-line prompt character may vary based on the operating system.
-\par }\pard \ltrpar\ql \fi-360\li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 1.\tab \hich\f39 Option \'93\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 -c, --create}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'94\loch\f39 }{\rtlch\fcs1 \af10\afs18 \ltrch\fcs0
-\f10\fs18\cf1\insrsid9138298 \loch\af10\dbch\af31505\hich\f10 \'e0}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 create a distribution package}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The command showing the proper syntax used to create a distribution package}
-{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 .
-\par
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >upt -c test.dist -p MdePkg/MdePkg.dec -t Package\hich\af2\dbch\af31505\loch\f2
-_Information_Data_File.ini
-\par }\pard \ltrpar\ql \fi-360\li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af3\afs18 \ltrch\fcs0 \f3\fs18\cf1\insrsid9138298 \loch\af3\dbch\af31505\hich\f3 \'b7\tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'93}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 test.dist}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\loch\af39\dbch\af31505\hich\f39 \'94\loch\f39 is the target distribution package to be generated, }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af3\afs18 \ltrch\fcs0 \f3\fs18\cf1\insrsid9138298 \loch\af3\dbch\af31505\hich\f3 \'b7\tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'93}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0
-\f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 MdePkg/MdePkg.dec}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'94\loch\f39 is the path and source used to generate the distribution package, }
-{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af3\afs18 \ltrch\fcs0 \f3\fs18\cf1\insrsid9138298 \loch\af3\dbch\af31505\hich\f3 \'b7\tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'93}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0
-\f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 Package_Information_Data_File.ini}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'94\loch\f39 is the file which specifies the inf
-\hich\af39\dbch\af31505\loch\f39 \hich\f39 ormation not included in \'93}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 MdePkg\\MdePkg.dec}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\loch\af39\dbch\af31505\hich\f39 \'94\loch\f39 but is required by the packaging specification
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The extended version of the commands\hich\af39\dbch\af31505\loch\f39 :}{
-\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par
-\par \ltrrow}\trowd \irow0\irowband0\lastrow \ltrrow\ts11\trqc\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt
-\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth6120\clshdrawnil \cellx6012\pard \ltrpar\ql \li0\ri0\sb60\keep\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0
-\f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >upt -\hich\f2 \endash \loch\f2 create=test.dist --dec-filename=MdePkg/MdePkg.dec \\
-\par }\pard \ltrpar\ql \li0\ri0\sl276\slmult1\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 --template=Package_Information_Data_File.ini}{\rtlch\fcs1
-\af0\afs16 \ltrch\fcs0 \f0\fs16\cf13\insrsid9138298 \cell }\pard \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \f0\fs16\cf13\insrsid9138298
-\trowd \irow0\irowband0\lastrow \ltrrow\ts11\trqc\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt
-\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth6120\clshdrawnil \cellx6012\row }\pard \ltrpar\ql \fi-360\li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 2.\tab Option }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'93\loch\f39 -m, --inf-filename}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'94\loch\f39 }{\rtlch\fcs1 \af10\afs18 \ltrch\fcs0 \f10\fs18\cf1\insrsid9138298 \loch\af10\dbch\af31505\hich\f10 \'e0}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\hich\af39\dbch\af31505\loch\f39 Specifying the module file name for inclusion in the distribution package.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par \ltrrow}\trowd \irow0\irowband0\lastrow \ltrrow\ts11\trqc\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt
-\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth8100\clshdrawnil \cellx7992\pard \ltrpar\ql \li0\ri0\sb60\keep\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0
-\f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >upt \hich\f2 \endash \loch\f2 c testm.dist \\
-\par \hich\af2\dbch\af31505\loch\f2 -m MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.\hich\af2\dbch\af31505\loch\f2 inf \\
-\par \hich\af2\dbch\af31505\loch\f2 \hich\f2 \endash \loch\f2 t Package_Information_Data_File.ini
-\par }\pard \ltrpar\ql \li0\ri0\keep\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \f0\fs16\cf13\insrsid9138298 \cell }\pard \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {
-\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \f0\fs16\cf13\insrsid9138298 \trowd \irow0\irowband0\lastrow \ltrrow\ts11\trqc\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10
-\trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth8100\clshdrawnil \cellx7992\row }\pard \ltrpar
-\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The extended version of the command:}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par
-\par \ltrrow}\trowd \irow0\irowband0\lastrow \ltrrow\ts11\trqc\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt
-\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth8483\clshdrawnil \cellx8375\pard \ltrpar\ql \li0\ri0\sb60\keep\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0
-\f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >upt -\hich\f2 \endash \loch\f2 create=testm.dist \\
-\par \hich\af2\dbch\af31505\loch\f2 --inf-filename=MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf \\
-\par \hich\af2\dbch\af31505\loch\f2 \hich\f2 \endash \loch\f2 -template=Package_Information_Data_File.ini
-\par }\pard \ltrpar\ql \li0\ri0\keep\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \f0\fs16\cf13\insrsid9138298 \cell }\pard \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {
-\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \f0\fs16\cf13\insrsid9138298 \trowd \irow0\irowband0\lastrow \ltrrow\ts11\trqc\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10
-\trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrnone \clbrdrl\brdrnone \clbrdrb\brdrnone \clbrdrr\brdrnone \cltxlrtb\clftsWidth3\clwWidth8483\clshdrawnil \cellx8375\row }\pard \ltrpar
-\ql \fi-360\li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af3\afs18 \ltrch\fcs0 \f3\fs18\cf1\insrsid9138298 \loch\af3\dbch\af31505\hich\f3 \'b7\tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\loch\af39\dbch\af31505\hich\f39 \'93}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 testm.dist}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \'93
-\loch\f39 is the target distribution package to be generated,}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af3\afs18 \ltrch\fcs0 \f3\fs18\cf1\insrsid9138298 \loch\af3\dbch\af31505\hich\f3 \'b7\tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'93}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0
-\f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'94\loch\f39
- is the path and filename for the \hich\af39\dbch\af31505\loch\f39 module\hich\af39\dbch\af31505\loch\f39 to be included in the distribution package, and
-\par }{\rtlch\fcs1 \af3\afs18 \ltrch\fcs0 \f3\fs18\cf1\insrsid9138298 \loch\af3\dbch\af31505\hich\f3 \'b7\tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'93}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0
-\f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 Package_Informati\hich\af2\dbch\af31505\loch\f2 on_Data_File.ini}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'94\loch\f39 \hich\f39
- is the file which specifies the information not included in \'93}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 AcpiPlatformDxe.inf}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\hich\af39\dbch\af31505\loch\f39 \hich\f39 \'94\loch\f39 but is required by the packaging specification
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \fi-360\li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 3.\tab \hich\f39 Option \'93}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid9138298 -}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 i, --install}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'94\loch\f39
-}{\rtlch\fcs1 \af10\afs18 \ltrch\fcs0 \f10\fs18\cf1\insrsid9138298 \loch\af10\dbch\af31505\hich\f10 \'e0}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 install a UEFI package file
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 File locations are relative to the program executio
-\hich\af39\dbch\af31505\loch\f39 n path set in the OS environment variable WORKSPACE. WORKSPACE is set to the working directory for the EDK II development tree (containing distribution packages).
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf18\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Windows Development Workstations
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The working directory of the EDKII development tree is a fir\hich\af39\dbch\af31505\loch\f39 st level folder from the root directory for drive C. For example:
-
-\par }\pard \ltrpar\qc \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 C:\\EDKII>
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39
-In this example, the OS environment variable WORKSPACE is set to the working directory for EDK II. For example:
-\par }\pard \ltrpar\qc \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 C:\\>set WORKSPACE=C:\\EDKII
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf18\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Windows 7 Development Workstations
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 For Wi\hich\af39\dbch\af31505\loch\f39
-ndows 7 users, it is recommended that you use the subst command, keeping your edk2 downloads in your home directory. Windows 7 only allows administrators to create folders in the root directory. If you can remember to always open the cmd.exe using "run as
-\hich\af39\dbch\af31505\loch\f39 \hich\af39\dbch\af31505\loch\f39 administrator ...", the directions above can be used. Otherwise, if you sources are located in a directory path such as the following:
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 C:\\Users\\myname\\Documents\\Work\\edk2>
-\par \hich\af2\dbch\af31505\loch\f2 subst z: C:\\Users\\myname\\Documents\\Work\\edk2
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Then set the OS environment variable WORKSPACE to the newly created drive:
-
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid3217417 \hich\af2\dbch\af31505\loch\f2 C:\\Users\\myname\\Documents\\Work\\edk2>z:}{\rtlch\fcs1 \af2\afs18
-\ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 z:\\>set WORKSPACE=z:\\
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf18\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Linux and OS/X Development Workstations
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The working directory for the EDK II build tree (containing distribu\hich\af39\dbch\af31505\loch\f39
-tion packages) is defined as a first level folder from your home directory. For example:
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 [/home/myname/edk2] #
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39
-In this example, the OS environment variable WORKSPACE is set to the working directory for EDK II development. For example:
-\par }\pard \ltrpar\qc \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 [/home/myname/edk2] \hich\af2\dbch\af31505\loch\f2
-# export WORKSPACE=/home/myname/edk2
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The OS environment variable WORKSPACE is now set to the EDKII WORKSPACE}{
-\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 .
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 \hich\f39 Copy the distribution package file to the location to which the OS variable \'93\loch\f39 \hich\f39 WORKSPACE\'94\loch\f39
- has been defined. For example:
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf18\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Windows Development Workstations}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li1440\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin1440\itap0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >copy test.dist %WORKSPACE%
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf18\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Linux and OS/X Development Workstations
-\par }\pard \ltrpar\ql \li1440\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin1440\itap0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 #\hich\af2\dbch\af31505\loch\f2 \hich\af2\dbch\af31505\loch\f2
-cp test.dist $WORKSPACE}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Execute the UPT command to install the distribution package. For example:
-\par }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >UPT \hich\f2 \endash \loch\f2 i test.dist
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The extended version of the command:}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >UPT \hich\f2 \endash \loch\f2 -install=test.dist
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39
-If the distribution package target folder is already present (for example, MdePkg already exists), Intel UEFIPT will inform you that the specified target already exists and will prompt you to enter another location. If no addition
-\hich\af39\dbch\af31505\loch\f39 al locations are required, pressing [ENTER] will exit the tool. The following is an output display example:}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf18\insrsid9138298 \hich\af0\dbch\af31505\loch\f0 Windows Development Workstations}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par \ltrrow}\trowd \irow0\irowband0\lastrow \ltrrow\ts11\trqc\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt
-\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth7578\clshdrawnil \cellx7470\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af2\afs16
-\ltrch\fcs0 \f2\fs16\cf1\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 C:\\EDKII>upt \hich\f2 \endash \loch\f2 i test.dist\line \hich\f2 Unzipping and parsing distribution package XML file\'85\line \line \loch\f2 Dist.content -> C:\\EDKII\\dist.conte
-\hich\af2\dbch\af31505\loch\f2 nt\line \hich\f2 Installing package \'85\loch\f2 MdePkg Version 1.02\line This directory already exists: MdePkg.\line Please select another location. Press [Enter] with no input to quit:\line
-\par }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 MyDistributionPackageSource\\}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf1\insrsid9138298 \cell }\pard \ltrpar
-\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf1\insrsid9138298 \trowd \irow0\irowband0\lastrow \ltrrow\ts11\trqc\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl
-\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth7578\clshdrawnil \cellx7470\row }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf18\insrsid9138298 \hich\af0\dbch\af31505\loch\f0
-Linux and OS/X Development Workstations}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par \ltrrow}\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf1\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 # \hich\af2\dbch\af31505\loch\f2 upt\hich\af2\dbch\af31505\loch\f2
-\loch\af2\dbch\af31505\hich\f2 \endash \loch\f2 i test.dist\line \hich\af2\dbch\af31505\loch\f2 \hich\f2 Unzipping and parsing distribution package XML file\'85\line \line \loch\f2 Dist.content -> /home/myname/edk2/dist.content\line \hich\f2
-Installing package \'85\loch\f2 MdePkg Version 1.02\line This directory already exists: MdePkg.\line Please select another location. Press [Enter] with no input to quit:\line
-\par }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 MyDis\hich\af2\dbch\af31505\loch\f2 tributionPackageSource/}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf1\insrsid9138298 \cell }\pard \ltrpar
-\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf1\insrsid9138298 \trowd \irow0\irowband0\lastrow \ltrrow\ts11\trqc\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl
-\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth7578\clshdrawnil \cellx7470\row }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \fi-360\li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 4.\tab \hich\f39 Option \'93\loch\f39 \hich\f39 -r, --remove\'94
-\loch\f39 }{\rtlch\fcs1 \af10\afs18 \ltrch\fcs0 \f10\fs18\cf1\insrsid9138298 \loch\af10\dbch\af31505\hich\f10 \'e0}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 remove a UEFI package file}{\rtlch\fcs1
-\af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >upt -r test.dist
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The extended version of the command}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15283407 \hich\af39\dbch\af31505\loch\f39
- using a second version of a distribution that was also installed}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 :}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >upt -\hich\f2 \endash \loch\f2 remove=test\hich\af2\dbch\af31505\loch\f2 _80c92dc3-3a9c-42e9-9b92-4d2b82f0025b_1.0\hich\af2\dbch\af31505\loch\f2 .dist
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 \hich\f39 Where \'93}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 test.dist}{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9138298 \loch\af39\dbch\af31505\hich\f39 \'93\hich\af39\dbch\af31505\loch\f39 and }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2
-test_80c92dc3-3a9c-42e9-9b92-4d2b82f0025b_1.0.dist}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 }{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \fs18\insrsid9138298\charrsid10246519 \hich\af39\dbch\af31505\loch\f39 are
-\hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 the name\hich\af39\dbch\af31505\loch\f39 s\hich\af39\dbch\af31505\loch\f39 of\hich\af39\dbch\af31505\loch\f39 }{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10246519 \hich\af39\dbch\af31505\loch\f39 installed}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10246519 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 UEFI distribution package}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10246519 \hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\hich\af39\dbch\af31505\loch\f39 \hich\af39\dbch\af31505\loch\f39 that will be removed}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 .}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\insrsid9138298
-\par }\pard \ltrpar\ql \fi-360\li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 5.\tab \hich\f39 Option \'93\loch\f39 \hich\f39 -n, --custom-path\'94
-\loch\f39 }{\rtlch\fcs1 \af10\afs18 \ltrch\fcs0 \f10\fs18\cf1\insrsid9138298 \loch\af10\dbch\af31505\hich\f10 \'e0}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39
- prompt for the source path for each package in the distribution}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 upt -i test.dist \hich\f2 \endash \loch\f2 n
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The extended version of the command:}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 upt \hich\f2 \endash }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid12483726 -}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298
-\hich\af2\dbch\af31505\loch\f2 install=test.dist --custom-path
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 You will be presented with a display similar to the following:
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf18\insrsid9138298 \hich\af0\dbch\af31505\loch\f0 Windows Development Workstations}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\par \ltrrow}\trowd \irow0\irowband0\lastrow \ltrrow\ts11\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt
-\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth8856\clshdrawnil \cellx8748\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af2\afs16
-\ltrch\fcs0 \f2\fs16\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 C:\\EDKII}{\rtlch\fcs1 \af2\afs22 \ltrch\fcs0 \f2\fs22\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >upt \hich\f2 \endash \loch\f2 i test.dist \hich\f2 \endash \loch\f2 n\line }{
-\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf1\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 \hich\f2 Unzipping and parsing distribution package XML file\'85\line \hich\af2\dbch\af31505\loch\f2 dist.pkg -> c:\\EDKII\\dist.pkg\line \line
-Dist.content -> C:\\EDKII\\dist.content\line \hich\f2 Installing package \'85\loch\f2 MdePkg Version 1.02\line Please select package location. Press [Enter] with no input to quit:\line }{\rtlch\fcs1 \af2\afs22 \ltrch\fcs0 \f2\fs22\insrsid9138298
-\par }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 MyDistributionPackageSource\\}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 \cell }\pard \ltrpar
-\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 \trowd \irow0\irowband0\lastrow \ltrrow\ts11\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl
-\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth8856\clshdrawnil \cellx8748\row }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf18\insrsid9138298 \hich\af0\dbch\af31505\loch\f0
-Linux and OS/X Development Workstations}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par \ltrrow}\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 # }{\rtlch\fcs1 \af2\afs22 \ltrch\fcs0 \f2\fs22\insrsid9138298
-\hich\af2\dbch\af31505\loch\f2 upt \loch\af2\dbch\af31505\hich\f2 \endash \hich\af2\dbch\af31505\loch\f2 i test.dist \hich\f2 \endash \loch\f2 n\line }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf1\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 \hich\f2
-Unzipping and parsing distribution package XML file\'85\line \loch\f2 dist.pkg -> /home/myname/edk2/dist.pkg\line \line Dist.content -> /home/myname/edk2/dist.content\line \hich\f2 Installing package \'85\loch\f2 MdePkg Version 1.02\line
-Please select package location. Press [E\hich\af2\dbch\af31505\loch\f2 nter] with no input to quit:\line }{\rtlch\fcs1 \af2\afs22 \ltrch\fcs0 \f2\fs22\insrsid9138298
-\par }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 MyDistributionPackageSource/}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 \cell }\pard \ltrpar
-\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 \trowd \irow0\irowband0\lastrow \ltrrow\ts11\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl
-\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth8856\clshdrawnil \cellx8748\row }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 6.\tab \hich\f39 Option \'93\loch\f39 \hich\f39 -x, --free-lock\'94\loch\f39 }{\rtlch\fcs1 \af10\afs18 \ltrch\fcs0 \f10\fs18\cf1\insrsid9138298
-\loch\af10\dbch\af31505\hich\f10 \'e0}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 \hich\f39 instructs the Intel\'ae\loch\f39
- UEFIPT to unconditionally free the lock on the UPT database before any UPT operations are executed.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Background: While executing, the Intel UEFIPT\hich\af39\dbch\af31505\loch\f39 \hich\f39
- locks the UPT database. This precludes any other instance of Intel UEFIPT from executing. If Intel UEFIPT should be stopped for some reason (for example, you press CTRL+C) the UPT database will remain locked. The \'93\loch\f39 \hich\f39 -x, --free-lock
-\'94\loch\f39 option is used to skip \hich\af39\dbch\af31505\loch\f39 t\hich\af39\dbch\af31505\loch\f39 he lock check.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >upt -i test.dist \hich\f2 \endash \loch\f2 x
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 The extended version of the command:}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >upt \hich\f2 \endash }{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid11147893 -}{\rtlch\fcs1 \af2\afs16 \ltrch\fcs0 \f2\fs16\cf13\insrsid9138298
-\hich\af2\dbch\af31505\loch\f2 install=test.dist \hich\f2 \endash \loch\f2 -free-lock
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 If the UPT database is locked, you will be presented with a display similar to the following:}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-
-\par
-\par \ltrrow}\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\intbl\wrapdefault\faauto\rin0\lin0 {\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\insrsid9138298 \hich\af2\dbch\af31505\loch\f2 >upt \hich\f2 \endash \loch\f2 c test28.dist \hich\f2 \endash \loch\f2
-p MdePkg/MdePkg.dec \hich\f2 \endash \hich\af2\dbch\af31505\loch\f2 t Package_Information_Data_File.ini\line \line \hich\f2 upt\'85\line \loch\f2 : error D003: UPT is already running. Only one instance is allowed\line }{\rtlch\fcs1 \af0\afs18
-\ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 \cell }\pard \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 \trowd \irow0\irowband0\lastrow \ltrrow
-\ts11\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trftsWidth1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10
-\clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth8856\clshdrawnil \cellx8748\row }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\hich\af0\dbch\af31505\loch\f0 NOTE: Error message format varies based on the Development Workstation operating system.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 During stress testing under Microsoft* Windows 7 w\hich\af39\dbch\af31505\loch\f39
-ith anti-virus software enabled, the tool failed after successfully completing 400 create package operations
-\par \hich\af39\dbch\af31505\loch\f39 An EDK II binary module that uses binary file types of UNI_VER, UNI_UI, LIB and UEFI_APP cannot be distributed using the standard features, however\hich\af39\dbch\af31505\loch\f39
- the contents may be distributed using MiscellaneousFiles portion of the UPT.
-\par \hich\af39\dbch\af31505\loch\f39
-When installing a UEFI Distribution Package generated by other tools that allow absolute path names for files, the error messages on Windows are different than the error messages on *NIX systems. The Intel UEFIPT does not support absolute path names for f
-\hich\af39\dbch\af31505\loch\f39 i\hich\af39\dbch\af31505\loch\f39 les and directories.
-\par \hich\af39\dbch\af31505\loch\f39 If an EDK II Meta-data file is incorrectly formatted, information from the header comment block, such as copyright and license may be lost.
-\par \hich\af39\dbch\af31505\loch\f39 Manually removing or renaming a directory tree that was installed by the Intel UEFIPT will not \hich\af39\dbch\af31505\loch\f39 allow using the Intel UEFIPT for other operations.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid9138298
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Windows: %WORKSPACE%\\BaseTools\\Conf}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 \\}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\hich\af39\dbch\af31505\loch\f39 Empty_Package_Information_Data_File.ini
-\par \hich\af39\dbch\af31505\loch\f39 Linux & OS/X: $(WORKSPACE)/BaseTools/Conf/Empty_Package_Information_Data_File.ini}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 \hich\f39 Intel\'ae\loch\f39 \hich\f39 UEFI Packaging Tool (Intel\'ae\loch\f39 UEFIPT\hich\af39\dbch\af31505\loch\f39 ) Quick Start guide (}
-{\field{\*\fldinst {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm-1493759412\insrsid1799 \hich\af39\dbch\af31505\loch\f39 HYPERLINK "../../BaseTools_r2100/UserManuals/www.tianocore.org"}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\deleted\fs18\cf1\revauthdel1\revdttmdel-1493759412\insrsid9138298\delrsid1799 \hich\af39\dbch\af31505\loch\f39 HYPERLINK "www.tianocore.org"}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm-1493759412\insrsid1799 {\*\datafield
-00d0c9ea79f9bace118c8200aa004ba90b0200000001000000e0c9ea79f9bace118c8200aa004ba90b800000002e002e002f002e002e002f00420061007300650054006f006f006c0073005f00720032003100300030002f0055007300650072004d0061006e00750061006c0073002f007700770077002e00740069006100
-6e006f0063006f00720065002e006f00720067000000795881f43b1d7f48af2c825dc485276300000000a5ab0000}}}{\fldrslt {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\ul\cf2\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 www.tianocore.org}}}\sectd \ltrsect
-\linex0\sectdefaultcl\sftnbj {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 , edk2/Documents)
-\par \hich\af39\dbch\af31505\loch\f39 The Distribution Package (.dist) for install and create, along with the Package Infor\hich\af39\dbch\af31505\loch\f39
-mation Data File (.ini) are not required to be in the EDK II WORKSPACE. All other files are required to be in the directory tree pointed to by the system environment variable: WORKSPACE. (The Distribution Package file name used during removal is in the $(
-\hich\af39\dbch\af31505\loch\f39 W\hich\af39\dbch\af31505\loch\f39 ORKSPACE)/Conf directory tree, placed there during package installation by the tool.)
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe2052\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 \hich\f39 Copyright\'a9\loch\f39 2011 Intel Corporation. All rights reserved}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 .
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available under the terms \hich\af39\dbch\af31505\loch\f39
-and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at:}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298 \line }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298
-\hich\af39\dbch\af31505\loch\f39 }{\field{\*\fldinst {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 HYPERLINK "http://opensource.org/licenses/bsd-license.php"}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\insrsid2707436 {\*\datafield
-00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b7600000068007400740070003a002f002f006f00700065006e0073006f0075007200630065002e006f00720067002f006c006900630065006e007300650073002f006200730064002d006c006900630065006e007300
-65002e007000680070000000795881f43b1d7f48af2c825dc485276300000000a5ab00003349}}}{\fldrslt {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\ul\cf2\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php}}}\sectd \ltrsect
-\linex0\sectdefaultcl\sftnbj {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid9138298
-\par \line }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-\par }{\rtlch\fcs1 \af39\afs16 \ltrch\fcs0 \fs16\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 Revision 1.}{\rtlch\fcs1 \af39\afs16 \ltrch\fcs0 \fs16\cf1\insrsid10246519 \hich\af39\dbch\af31505\loch\f39 5}{\rtlch\fcs1 \af39\afs16 \ltrch\fcs0
-\fs16\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 , }{\rtlch\fcs1 \af39\afs16 \ltrch\fcs0 \fs16\cf1\insrsid10246519 \hich\af39\dbch\af31505\loch\f39 01}{\rtlch\fcs1 \af39\afs16 \ltrch\fcs0 \fs16\cf1\insrsid10246519
-\hich\af39\dbch\af31505\loch\f39 Ju}{\rtlch\fcs1 \af39\afs16 \ltrch\fcs0 \fs16\cf1\insrsid10246519 \hich\af39\dbch\af31505\loch\f39 ly}{\rtlch\fcs1 \af39\afs16 \ltrch\fcs0 \fs16\cf1\insrsid10246519 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1
-\af39\afs16 \ltrch\fcs0 \fs16\cf1\insrsid9138298 \hich\af39\dbch\af31505\loch\f39 2011}{\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \f0\fs16\cf1\insrsid9138298
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90
-fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2
-ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae
-a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1
-399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5
-4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84
-0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b
-c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7
-689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20
-5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0
-aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d
-316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840
-545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a
-c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100
-0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7
-8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89
-d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500
-1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f
-bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6
-a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a
-0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021
-0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008
-00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000006032
-b4b80938cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/LzmaCompress_Utility_Man_Page.rtf b/BaseTools/UserManuals/LzmaCompress_Utility_Man_Page.rtf
deleted file mode 100644
index 8906913171..0000000000
--- a/BaseTools/UserManuals/LzmaCompress_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,357 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
-{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
-{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana{\*\falt Verdana};}{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}
-{\f41\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f245\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f246\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f248\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f249\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f250\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f251\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\f252\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f253\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f255\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f256\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
-{\f258\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f259\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f260\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f261\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
-{\f262\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f263\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f265\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f266\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}
-{\f268\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f269\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f270\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f271\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
-{\f272\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f273\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f377\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f585\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}
-{\f586\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f588\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f589\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f592\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
-{\f593\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f615\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f616\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f618\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}
-{\f619\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f622\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f623\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\f625\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}
-{\f626\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f628\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f629\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f630\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
-{\f631\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f632\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f633\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f634\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}
-{\f635\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f636\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f638\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f639\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f642\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f643\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}
-{\f647\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f655\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f656\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f658\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}
-{\f659\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f662\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f663\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
-{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green127\blue127;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap
-\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive
-\rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0 \b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 \slink18 \ssemihidden \sunhideused \styrsid1535607 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink17 \slocked \ssemihidden \styrsid1535607 Balloon Text Char;}{\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext19 \spriority0 \styrsid13255892 CellBodyLeft;}{\*\cs20 \additive \b\f2\cf13 \spriority0 \styrsid13255892 CodeCharacter;}{\*\ts21\tsrowd\trbrdrt
-\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext21 \spriority59 \styrsid13255892 Table Grid;}}{\*\revtbl {Unknown;}{lgao4;}}{\*\rsidtbl \rsid200707\rsid1530076\rsid1535607\rsid1840106\rsid2567646\rsid3478841\rsid4929157\rsid4999604\rsid5140827\rsid5788588\rsid5911148\rsid8600807\rsid9728962\rsid10095135
-\rsid10558486\rsid11685714\rsid11874792\rsid12003746\rsid12126252\rsid12198464\rsid13058712\rsid13255892\rsid13715311}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info
-{\operator lgao4}{\creatim\yr2010\mo10\dy6\hr16\min2}{\revtim\yr2012\mo3\dy13\hr10\min34}{\version19}{\edmins44}{\nofpages3}{\nofwords536}{\nofchars2849}{\nofcharsws3379}{\vern32773}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/word
-ml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot5140827 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \fi-2830\li1390\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx180\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin1390\itap0\pararsid9728962 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28
-\ltrch\fcs0 \b\fs28\cf17\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li90\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin90\itap0\pararsid9728962 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 LzmaCompress.exe \hich\f39 \endash \loch\f39 encode or decode a file by LZMA compress/decompress algorithm
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li-90\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-90\itap0\pararsid9728962 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 LzmaCompress}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9728962 \hich\af39\dbch\af31505\loch\f39 [-v | -q | }{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm654533262\langfenp2052\insrsid4929157 \hich\af39\dbch\af31505\loch\f39 --f86 | }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9728962 -}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5788588 -}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9728962 \hich\af39\dbch\af31505\loch\f39 d}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5788588 \hich\af39\dbch\af31505\loch\f39 ebug <Level>}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9728962 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 -e|-d}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9728962 \hich\af39\dbch\af31505\loch\f39 [-o }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid10095135
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9728962 \hich\af39\dbch\af31505\loch\f39 OutputFile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid10095135 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9728962 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 <inputFile>}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5140827
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9728962 \hich\af39\dbch\af31505\loch\f39 LzmaCompress}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9728962 \hich\af39\dbch\af31505\loch\f39
-\hich\f39 \endash \loch\f39 h
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid9728962 \hich\af39\dbch\af31505\loch\f39 LzmaCompress}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9728962 \hich\af39\dbch\af31505\loch\f39
- --version
-\par }\pard\plain \ltrpar\s2\ql \fi-2740\li1300\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx720\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin1300\itap0\pararsid9728962 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 \hich\f39 The LzmaCompress tool is used to encode or decode files with LZMA encode or decode algorithm. When \'93\loch\f39 \hich\f39 -e\'94\loch\f39
- option is specified in the command line the tool will encode the input file with LZMA encode algorith\hich\af39\dbch\af31505\loch\f39 \hich\f39 m; when \'93\loch\f39 \hich\f39 -d\'94\loch\f39
- option is specified in the command line the tool will decode the input file with LZMA decode algorithm. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392165\langfenp2052\insrsid4929157
-\loch\af39\dbch\af31505\hich\f39 \'93}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm654533262\langfenp2052\insrsid4929157 \loch\af39\dbch\af31505\hich\f39 \emdash \loch\f39 f86}{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392165\langfenp2052\insrsid11685714 \hich\af39\dbch\af31505\loch\f39 " option }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392166\langfenp2052\insrsid11685714 \hich\af39\dbch\af31505\loch\f39 is specified to enable }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392180\langfenp2052\insrsid13058712 \hich\af39\dbch\af31505\loch\f39 converter for x}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392166\langfenp2052\insrsid11685714 \hich\af39\dbch\af31505\loch\f39 86 code that can improve the compress ratio }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392167\langfenp2052\insrsid1840106 \hich\af39\dbch\af31505\loch\f39 for }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392171\langfenp2052\insrsid1840106 \hich\af39\dbch\af31505\loch\f39 IA32 or X64 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392167\langfenp2052\insrsid1840106 \hich\af39\dbch\af31505\loch\f39 PE image}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392171\langfenp2052\insrsid1840106 .}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392167\langfenp2052\insrsid1840106
-\hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39
-When decoding file, this tool performs some rudimentary checking on the input files to verify they are compressed by LZMA algorithm. These checks include:
-\par \hich\af39\dbch\af31505\loch\f39 The input file header (5 + 8 bytes header);
-\par \hich\af39\dbch\af31505\loch\f39 The first 5 bytes is the attribute of compressi\hich\af39\dbch\af31505\loch\f39 on.
-\par \hich\af39\dbch\af31505\loch\f39 The following 8 bytes is original size which is the input file size and it is the decompressed file size.
-\par \hich\af39\dbch\af31505\loch\f39 While encoding file, this tool does not perform any checking.
-\par }\pard\plain \ltrpar\s2\ql \fi-4810\li3460\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin3460\itap0\pararsid9728962 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid13255892\charrsid12198464 \hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid13255892 \hich\af39\dbch\af31505\loch\f39 e specified, tool prints usage.}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1535607
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 -e }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39
- Encode the input file, which means to compress the input file
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 -d}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39
- Decode the input file, which means to decompress the input file
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 -o, --output Filename}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5140827
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 The file containing encoded or decoded content of input file
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid13715311 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\revauth1\revdttm1191392161\insrsid13715311 -}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm654533263\langfenp2052\insrsid4929157 -}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm654533262\langfenp2052\insrsid4929157
-\hich\af39\dbch\af31505\loch\f39 f}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392161\langfenp2052\insrsid13715311 \hich\af39\dbch\af31505\loch\f39 86}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392161\langfenp2052\insrsid13715311
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm1191392161\insrsid13715311 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm1191392161\insrsid10558486
-\hich\af39\dbch\af31505\loch\f39 enable conver}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392179\langfenp2052\insrsid10558486 \hich\af39\dbch\af31505\loch\f39 ter}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\revauth1\revdttm1191392161\insrsid13715311\charrsid13715311 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392179\langfenp2052\insrsid10558486
-\hich\af39\dbch\af31505\loch\f39 for }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm1191392161\insrsid13715311\charrsid13715311 \hich\af39\dbch\af31505\loch\f39 x86 code}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\revauth1\revdttm1191392161\insrsid13715311
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 --version
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5140827 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3478841 \hich\af39\dbch\af31505\loch\f39 Enable}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39
- verbose output with informational messages printed. This is a count value, so specifying \hich\f39 \endash \loch\f39 v can be used to increase the verbosity level.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 -q, --quiet}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5140827
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Disabl\hich\af39\dbch\af31505\loch\f39 e all messages except FATAL ERRORS
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 --debug [0-9]
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5140827 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Enable debug messages. Only 0-9 Level is supported.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5140827 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Print copyright, version and usage of this program and exit
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid13255892 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\lang1033\langfe2052\langfenp2052\insrsid13255892 {\*\bkmkstart OLE_LINK10}{\*\bkmkstart OLE_LINK11}
-{\*\bkmkstart OLE_LINK3}{\*\bkmkstart OLE_LINK4}{\*\bkmkstart OLE_LINK5}{\*\bkmkstart OLE_LINK6}{\*\bkmkstart OLE_LINK9}\hich\af39\dbch\af31505\loch\f39 Status codes retu\hich\af39\dbch\af31505\loch\f39 rned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf18\lang1033\langfe2052\langfenp2052\insrsid13255892\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts21\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts21 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid13255892
-{\*\bkmkend OLE_LINK10}{\*\bkmkend OLE_LINK11}0\cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid13255892 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid13255892 \cell }\pard\plain \ltrpar
-\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af37\afs20 \ltrch\fcs0 \fs20\insrsid13255892 \trowd \irow0\irowband0\ltrrow\ts21\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts21 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid13255892
-\hich\af2\dbch\af13\loch\f2 Nonzero}{\rtlch\fcs1 \af41\afs19 \ltrch\fcs0 \cs20\f41\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid13255892\charrsid8600807 \cell }\pard \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid200707\yts21 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid13255892 \hich\af39\dbch\af13\loch\f39 The action failed.\cell
-}\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid13255892 \trowd \irow1\irowband1\lastrow \ltrrow\ts21\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid9728962 \rtlch\fcs1
-\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5140827 {\*\bkmkend OLE_LINK3}{\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5
-}{\*\bkmkend OLE_LINK6}{\*\bkmkend OLE_LINK9}\hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 \hich\f39 1. Encode the input file \'93\loch\f39 \hich\f39 file.efi\'94\loch\f39 \hich\f39 and specify the output file name with \'93\loch\f39 \hich\f39 file.lzma\'94
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 LzmaCompress \hich\f39 \endash \loch\f39 e \hich\f39 \endash \hich\af39\dbch\af31505\loch\f39 o file.lzma file.efi
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 \hich\f39 2. Decode the input file \'93\loch\f39 \hich\f39 file.lzma\'94\loch\f39 \hich\f39 and specify the output file name with \'93\loch\f39 \hich\f39
-file.orig\'94
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 LzmaCompress \hich\f39 \endash \loch\f39 d \hich\f39 \endash \loch\f39 o file.orig file.lzma
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 3. Decode the input file "file.lzma" in the quiet mode and specify the output file name with "file.orig"
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Lzma\hich\af39\dbch\af31505\loch\f39 Compress \hich\f39 \endash \loch\f39 d -q \hich\f39 \endash \loch\f39 o file.orig file.lzma}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392162\langfenp2052\insrsid5140827
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid13715311 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392162\langfenp2052\insrsid13715311
-\hich\af39\dbch\af31505\loch\f39 4}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm1191392162\insrsid13715311 \hich\af39\dbch\af31505\loch\f39 \hich\f39 . Encode the input file \'93\loch\f39 \hich\f39 file.efi\'94\loch\f39 }{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392162\langfenp2052\insrsid13715311 \hich\af39\dbch\af31505\loch\f39 with }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392180\langfenp2052\insrsid12126252 \hich\af39\dbch\af31505\loch\f39 converter for }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392180\langfenp2052\insrsid13058712 \hich\af39\dbch\af31505\loch\f39 x}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392162\langfenp2052\insrsid13715311 \hich\af39\dbch\af31505\loch\f39 86 code }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm1191392162\insrsid13715311
-\hich\af39\dbch\af31505\loch\f39 \hich\f39 and specify the output file name with \'93\loch\f39 \hich\f39 file.lzma\'94
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\revauth1\revdttm1191392162\insrsid13715311 \hich\af39\dbch\af31505\loch\f39 LzmaCompress \hich\f39 \endash
-\loch\f39 e }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392162\langfenp2052\insrsid4929157 \loch\af39\dbch\af31505\hich\f39 \endash }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm654533263\langfenp2052\insrsid4929157 \hich\af39\dbch\af31505\loch\f39 -f86}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392162\langfenp2052\insrsid13715311 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\revauth1\revdttm1191392162\insrsid13715311
-\loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 o file}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191406241\langfenp2052\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 x86}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\revauth1\revdttm1191392162\insrsid13715311 \hich\af39\dbch\af31505\loch\f39 .lzma file}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191406241\langfenp2052\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 x86}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\revauth1\revdttm1191392162\insrsid13715311
-\hich\af39\dbch\af31505\loch\f39 .efi}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191406241\langfenp2052\insrsid13715311
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid2567646 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191406241\langfenp2052\insrsid2567646
-\hich\af39\dbch\af31505\loch\f39 5}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm1191406241\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 \hich\f39 . Decode the input file \'93\loch\f39 file}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191406241\langfenp2052\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 x86}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm1191406241\insrsid2567646
-\hich\af39\dbch\af31505\loch\f39 \hich\f39 .lzma\'94\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191406242\langfenp2052\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 with
-\hich\af39\dbch\af31505\loch\f39 converter for \hich\af39\dbch\af31505\loch\f39 x\hich\af39\dbch\af31505\loch\f39 86 code}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm1191406242\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 }{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm1191406241\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 \hich\f39 and specify the output file name with \'93\loch\f39 file}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191406241\langfenp2052\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 x86}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\revised\revauth1\revdttm1191406241\insrsid2567646
-\hich\af39\dbch\af31505\loch\f39 \hich\f39 .orig\'94
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\revauth1\revdttm1191406241\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 LzmaCompress \hich\f39 \endash \loch\f39 d }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191406242\langfenp2052\insrsid2567646 --\hich\af39\dbch\af31505\loch\f39 f8\hich\af39\dbch\af31505\loch\f39 6 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\revised\revauth1\revdttm1191406241\insrsid2567646 \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 o file}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191406241\langfenp2052\insrsid2567646
-\hich\af39\dbch\af31505\loch\f39 x86}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\revauth1\revdttm1191406241\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 .orig file}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191406241\langfenp2052\insrsid2567646 \hich\af39\dbch\af31505\loch\f39 x86}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\revised\revauth1\revdttm1191406241\insrsid2567646
-\hich\af39\dbch\af31505\loch\f39 .lzma
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2567646\charrsid2567646
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid9728962 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 No known }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3478841 \hich\af39\dbch\af31505\loch\f39 issues}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 .
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid5140827
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid9728962 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid9728962 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af2\afs20 \ltrch\fcs0
-\f2\fs20\insrsid5140827 \hich\af2\dbch\af31505\loch\f2 LZMA algorithm is in http://www.7-zip.org
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid9728962 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39 Based on LZMA Utility 4.65 : Igor Pavlov : Public domain : 2009-02-03
-\par
-\par \hich\af39\dbch\af31505\loch\f39 Copyright (c) 2006 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3478841 \hich\af39\dbch\af31505\loch\f39 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm1191392171\langfenp2052\insrsid12003746 \hich\af39\dbch\af31505\loch\f39 2}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\deleted\fs18\cf1\lang1033\langfe2052\revauthdel1\revdttmdel1191392171\langfenp2052\insrsid11874792\delrsid12003746 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5140827 \hich\af39\dbch\af31505\loch\f39
-, Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials
-\par \hich\af39\dbch\af31505\loch\f39 are licensed and made available under the terms and conditions of the BSD License
-\par \hich\af39\dbch\af31505\loch\f39 which accompanies this distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http:\hich\af39\dbch\af31505\loch\f39 //opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5140827
-\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8
-72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7
-2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b
-44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7
-065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000
-00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08
-84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc
-52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353
-bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468
-656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c
-070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7
-29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65
-312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8
-a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04
-98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c
-94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471
-7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671
-9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1
-e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5
-193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1
-17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2
-8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6
-6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a
-668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847
-bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e
-16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b
-5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0
-8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2
-c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966
-0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b
-7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb
-9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0
-088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf
-8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26
-ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0
-28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6
-345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93
-b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30
-254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74
-68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24
-51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198
-720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528
-a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000
-000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000
-002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468
-656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000
-00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000
-00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e352e30000000000000000000000e0000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff0900060000000000000000000000010000000100000000000000001000000200000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdffffff04000000feffffff05000000fefffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff01000000ec69d9888b8b3d4c859eaf6cd158be0f000000000000000000000000d049
-4bd2c100cd010300000080020000000000004d0073006f004400610074006100530074006f0072006500000000000000000000000000000000000000000000000000000000000000000000000000000000001a000101ffffffffffffffff020000000000000000000000000000000000000000000000d0494bd2c100cd01
-d0494bd2c100cd01000000000000000000000000ce00c600c400d9003500c800c700520055004500430042003300c6004b004c003400d3005000d6005000c0003d003d000000000000000000000000000000000032000101ffffffffffffffff030000000000000000000000000000000000000000000000d0494bd2c100
-cd01d0494bd2c100cd010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff04000000ffffffff000000000000000000000000000000000000000000000000
-00000000000000000000000000000000dd00000000000000010000000200000003000000feffffff0500000006000000070000000800000009000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3c623a536f757263657320786d6c6e733a623d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f6772617068792220786d6c6e733d
-22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f677261706879222053656c65637465645374796c653d225c4150412e58534c22205374796c654e616d653d224150412046696674682045646974696f6e222f3e0d
-0a00000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b37453339
-363942412d443138392d343035302d383137362d3632384237423333463633457d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c
-64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6f70656e500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000
-0000000000000000000000000000000000000000000000000000000000000400000055010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f677261706879222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f
-72654974656d3e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/Msa2Inf_Utility_Man_Page.rtf b/BaseTools/UserManuals/Msa2Inf_Utility_Man_Page.rtf
deleted file mode 100644
index c34d5781e0..0000000000
--- a/BaseTools/UserManuals/Msa2Inf_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,274 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\caccentone\ctint255\cshade255\red79\green129\blue189;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }
-{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \ab\ai\af0 \ltrch\fcs0 \b\i\cf17 \sbasedon10 \sqformat \spriority21 \styrsid487763 Intense Emphasis;}{\*\cs18 \additive
-\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid14420522 annotation reference;}{\s19\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0
-\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext19 \slink20 \ssemihidden \sunhideused \styrsid14420522 annotation text;}{\*\cs20 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20
-\sbasedon10 \slink19 \slocked \ssemihidden \styrsid14420522 Comment Text Char;}{\s21\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0
-\b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon19 \snext19 \slink22 \ssemihidden \sunhideused \styrsid14420522 annotation subject;}{\*\cs22 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20
-\sbasedon20 \slink21 \slocked \ssemihidden \styrsid14420522 Comment Subject Char;}{\s23\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext23 \slink24 \ssemihidden \sunhideused \styrsid14420522 Balloon Text;}{\*\cs24 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink23 \slocked \ssemihidden \styrsid14420522 Balloon Text Char;}{\s25\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext25 \spriority0 \styrsid1511655 CellBodyLeft;}{\*\cs26 \additive \b\f2\cf13 \spriority0 \styrsid1511655 CodeCharacter;}{\*\ts27\tsrowd\trbrdrt
-\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext27 \spriority59 \styrsid1511655 Table Grid;}}{\*\rsidtbl \rsid487763\rsid948821\rsid1511655\rsid4999604\rsid5911148\rsid6686102\rsid8600807\rsid8989803\rsid9440952\rsid9984392\rsid10187098\rsid12198464\rsid14420522\rsid16136673}{\mmathPr
-\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo10\dy6\hr16\min7}{\revtim\yr2011\mo8\dy10\hr10\min2}{\version11}{\edmins9}{\nofpages2}
-{\nofwords299}{\nofchars1705}{\nofcharsws2001}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot16136673 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf18\lang1036\langfe1033\langnp1036\insrsid16136673\charrsid16136673 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\lang1036\langfe1033\langnp1036\insrsid16136673\charrsid16136673 \hich\af39\dbch\af31505\loch\f39 Msa2Inf.exe
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\lang1036\langfe1033\langnp1036\insrsid16136673\charrsid16136673 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid16136673\charrsid16136673 \hich\af39\dbch\af31505\loch\f39 Msa2Inf.exe [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid9440952
-\hich\af39\dbch\af31505\loch\f39 -v | -q] \hich\f39 \endash \loch\f39 o <OutputFile>|-a}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid16136673\charrsid16136673 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid8989803 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid9440952
-\hich\af39\dbch\af31505\loch\f39 Input}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid16136673\charrsid16136673 \hich\af39\dbch\af31505\loch\f39 File}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid8989803 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid16136673
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid9440952\charrsid16136673 \hich\af39\dbch\af31505\loch\f39 Msa2Inf.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid9440952 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash \loch\f39 h
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid9440952\charrsid16136673 \hich\af39\dbch\af31505\loch\f39 Msa2Inf.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid9440952 \hich\af39\dbch\af31505\loch\f39 --version}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe2052\langnp1036\langfenp2052\insrsid9440952\charrsid16136673
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\lang1036\langfe1033\langnp1036\insrsid16136673\charrsid16136673 \hich\af39\dbch\af31505\loch\f39 Description
-
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 Msa2Inf converts an MSA file }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid487763 \hich\af39\dbch\af31505\loch\f39 in}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 to an Extended INF file. It generates a new Extended INF file by extracting build-related information from }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid487763
-\hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 MSA file. It does a literal mapping from XML schema to TEXT file.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1511655\charrsid12198464 {\*\bkmkstart OLE_LINK12}{\*\bkmkstart OLE_LINK13}\hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1511655 \hich\af39\dbch\af31505\loch\f39
-e specified, tool prints }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid1511655 {\*\bkmkend OLE_LINK12}{\*\bkmkend OLE_LINK13}\hich\af39\dbch\af31505\loch\f39 error message.}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid14420522
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 -o, --output Filename
-\par \hich\af39\dbch\af31505\loch\f39 Specify the name of the INF file to be created.
-\par \hich\af39\dbch\af31505\loch\f39 -a --auto
-\par \tab \hich\af39\dbch\af31505\loch\f39 Automatically create the INF file using the name of the MSA file and replacing file extension.
-\par \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid487763 \hich\af39\dbch\af31505\loch\f39 Enable}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid16136673
-\hich\af39\dbch\af31505\loch\f39 verbose output with informa\hich\af39\dbch\af31505\loch\f39 tional messages printed.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 -q, --quiet
-\par \tab \hich\af39\dbch\af31505\loch\f39 Disable all messages except FATAL ERRORS.
-\par \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par \tab \hich\af39\dbch\af31505\loch\f39 Print copyright, version and usage of this program and exit.
-\par \hich\af39\dbch\af31505\loch\f39 --version
-\par \tab \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid1511655 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\lang1033\langfe2052\langfenp2052\insrsid1511655 {\*\bkmkstart OLE_LINK10}{\*\bkmkstart OLE_LINK11}
-{\*\bkmkstart OLE_LINK3}{\*\bkmkstart OLE_LINK4}{\*\bkmkstart OLE_LINK5}{\*\bkmkstart OLE_LINK6}{\*\bkmkstart OLE_LINK9}{\*\bkmkstart OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf18\lang1033\langfe2052\langfenp2052\insrsid1511655\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts27\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s25\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts27 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs26\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid1511655
-{\*\bkmkend OLE_LINK10}{\*\bkmkend OLE_LINK11}0\cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1511655 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid1511655 \cell }\pard\plain \ltrpar
-\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af37\afs20 \ltrch\fcs0 \fs20\insrsid1511655 \trowd \irow0\irowband0\ltrrow\ts27\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s25\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts27 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs26\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid1511655
-\hich\af2\dbch\af13\loch\f2 1}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs26\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid1511655\charrsid8600807 \cell }\pard \ltrpar\s25\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid10187098\yts27 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid1511655 \hich\af39\dbch\af13\loch\f39 The action
-\hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid1511655 \trowd \irow1\irowband1\lastrow \ltrrow\ts27\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid16136673 {\*\bkmkend OLE_LINK3}{\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5}
-{\*\bkmkend OLE_LINK6}{\*\bkmkend OLE_LINK9}{\*\bkmkend OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 1. Msa2Inf c:\\EdkII\\Nt32Pkg\\WinNtThunkDxe\\\hich\af39\dbch\af31505\loch\f39 WinNtThunk.msa \hich\f39 \endash \loch\f39 o c:\\EdkII\\Nt32Pkg\\WinNtThunkDxe\\WinNtThunk.inf
-\par \tab \hich\af39\dbch\af31505\loch\f39 Generate the Extended INF file of WinNtThunk driver based on its MSA file.
-\par \hich\af39\dbch\af31505\loch\f39 2. Msa2Inf c:\\EdkII\\Nt32Pkg\\WinNtThunkDxe\\WinNtThunk.msa \hich\f39 \endash \loch\f39 a
-\par \hich\af39\dbch\af31505\loch\f39 Generate the Extended INF file of WinNtThunk dri\hich\af39\dbch\af31505\loch\f39 ver based on its MSA file. It is the short form of example 1 since example 1 specifies the default INF file name.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 No known issues
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 $(WORKSPACE)\\Conf\\FrameworkDatabase.db
-\par \hich\af39\dbch\af31505\loch\f39 Package description files listed in the above database files.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 Sp\hich\af39\dbch\af31505\loch\f39 d2Dec.exe, Fpd2Dsc.exe
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 1999 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid487763 \hich\af39\dbch\af31505\loch\f39 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid948821 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid16136673 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000300c
-37980157cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/PatchPcdValue_Utility_Man_Page.rtf b/BaseTools/UserManuals/PatchPcdValue_Utility_Man_Page.rtf
deleted file mode 100644
index 20eb5c8592..0000000000
--- a/BaseTools/UserManuals/PatchPcdValue_Utility_Man_Page.rtf
+++ /dev/null
Binary files differ
diff --git a/BaseTools/UserManuals/Spd2Dec_Utility_Man_Page.rtf b/BaseTools/UserManuals/Spd2Dec_Utility_Man_Page.rtf
deleted file mode 100644
index dd0a1fc98e..0000000000
--- a/BaseTools/UserManuals/Spd2Dec_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,270 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 00000000000000000000}@\'cb\'ce\'cc\'e5;}{\f43\fbidi \fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f475\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f476\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f478\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f479\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f482\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f483\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid3697369 annotation reference;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid3697369 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink18 \slocked \ssemihidden \styrsid3697369 Comment Text Char;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid3697369 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid3697369 Comment Subject Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid3697369 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid3697369 Balloon Text Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid7800259 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid7800259 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh
-\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid7800259 Table Grid;}}{\*\rsidtbl \rsid1402324\rsid2294266\rsid3697369\rsid4999604\rsid5911148\rsid7078214\rsid7800259\rsid7950612\rsid8089322\rsid8600807\rsid10575933\rsid12198464\rsid14044543}{\mmathPr
-\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo10\dy6\hr17\min12}{\revtim\yr2011\mo8\dy10\hr9\min40}{\version9}{\edmins11}{\nofpages2}
-{\nofwords268}{\nofchars1528}{\nofcharsws1793}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot1402324 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Spd2Dec.exe
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Spd2Dec.exe [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14044543 \hich\af39\dbch\af31505\loch\f39 -v | -q}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14044543 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash \loch\f39
-a|-o <OutputFile>}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14044543 \hich\af39\dbch\af31505\loch\f39
-<Input}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 File}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14044543 \hich\af39\dbch\af31505\loch\f39 >}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid1402324
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid7950612 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid7950612 \hich\af39\dbch\af31505\loch\f39 Spd
-\hich\af39\dbch\af31505\loch\f39 2\hich\af39\dbch\af31505\loch\f39 Dec.exe \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 Spd2Dec.exe --version}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid7950612\charrsid8089322
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid7950612
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Spd2Dec converts an SPD file to a DEC file. It generates a new DEC file by extracting build-related information from SPD file. It does a literal mapping from XML schema to TEXT file.
-
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid7800259\charrsid12198464 {\*\bkmkstart OLE_LINK12}{\*\bkmkstart OLE_LINK13}\hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid7800259 \hich\af39\dbch\af31505\loch\f39
-e specified, tool prints }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid7800259 {\*\bkmkend OLE_LINK12}{\*\bkmkend OLE_LINK13}\hich\af39\dbch\af31505\loch\f39 error message.}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid3697369
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 -o, --output Filename
-\par \hich\af39\dbch\af31505\loch\f39 Specify the name of the DEC file to be created.
-\par \hich\af39\dbch\af31505\loch\f39 -a --auto
-\par \tab \hich\af39\dbch\af31505\loch\f39 Automatically create the DEC file using the name of the MSA file and replacing file extension.
-\par \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2294266 \hich\af39\dbch\af31505\loch\f39 Enable}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1402324
-\hich\af39\dbch\af31505\loch\f39 verbose output wit\hich\af39\dbch\af31505\loch\f39 h informational messages printed.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 -q, --quiet\tab Disable all messages except FATAL ERRORS.
-\par \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par \tab \hich\af39\dbch\af31505\loch\f39 Print copyright, version and usage of this program and exit.
-\par \hich\af39\dbch\af31505\loch\f39 --version
-\par \tab \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid7800259 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid7800259 {\*\bkmkstart OLE_LINK10}{\*\bkmkstart OLE_LINK11}
-{\*\bkmkstart OLE_LINK3}{\*\bkmkstart OLE_LINK4}{\*\bkmkstart OLE_LINK5}{\*\bkmkstart OLE_LINK6}{\*\bkmkstart OLE_LINK9}{\*\bkmkstart OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid7800259\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid7800259
-{\*\bkmkend OLE_LINK10}{\*\bkmkend OLE_LINK11}0}{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid7800259 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid7800259 \hich\af39\dbch\af13\loch\f39
-The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid7800259 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1
-\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid7800259 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10
-\trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid7800259
-\hich\af2\dbch\af13\loch\f2 1}{\rtlch\fcs1 \af43\afs19 \ltrch\fcs0 \cs25\f43\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid7800259\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid7950612\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid7800259 \hich\af39\dbch\af13\loch\f39 The action
-\hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid7800259 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1402324 {\*\bkmkend OLE_LINK3}{\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5}
-{\*\bkmkend OLE_LINK6}{\*\bkmkend OLE_LINK9}{\*\bkmkend OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 1. Spd2Dec c:\\EdkII\\Nt32Pkg\\\hich\af39\dbch\af31505\loch\f39 Nt32Pkg.spd \hich\f39 \endash \loch\f39 o c:\\EdkII\\Nt32Pkg\\Nt32Pkg.dec
-\par \tab \hich\af39\dbch\af31505\loch\f39 Generate the DEC file of Nt32Pkg based on its SPD file.
-\par \hich\af39\dbch\af31505\loch\f39 2. Spd2Dec c:\\EdkII\\Nt32Pkg\\Nt32Pkg.spd \hich\f39 \endash \loch\f39 a
-\par \hich\af39\dbch\af31505\loch\f39 Generate the DEC file of Nt32Pkg based on its SPD file. It is the short form of example 1 since example\hich\af39\dbch\af31505\loch\f39 1 specifies the default DEC file name.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 No known issues.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Msa2Inf.exe, Fpd2Dsc.exe
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 1999 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2294266 \hich\af39\dbch\af31505\loch\f39 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid7078214 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1402324 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.ph\hich\af39\dbch\af31505\loch\f39 p
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000e0e6
-837dfe56cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/SplitFile_Utility_Man_Page.rtf b/BaseTools/UserManuals/SplitFile_Utility_Man_Page.rtf
deleted file mode 100644
index 0fe568a511..0000000000
--- a/BaseTools/UserManuals/SplitFile_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,318 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 \slink18 \ssemihidden \sunhideused \styrsid11539687 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink17 \slocked \ssemihidden \styrsid11539687 Balloon Text Char;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid3870620 annotation reference;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext20 \slink21 \ssemihidden \sunhideused \styrsid3870620 annotation text;}{\*\cs21 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink20 \slocked \ssemihidden \styrsid3870620 Comment Text Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon20 \snext20 \slink23 \ssemihidden \sunhideused \styrsid3870620 annotation subject;}{\*\cs23 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon21 \slink22 \slocked \ssemihidden \styrsid3870620 Comment Subject Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid10361764 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid10361764 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh
-\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid10361764 Table Grid;}}{\*\rsidtbl \rsid3870620\rsid4395805\rsid4999604\rsid5577864\rsid5911148\rsid6120166\rsid8089322\rsid8600807\rsid8672847\rsid9918578\rsid10361764\rsid11229351\rsid11539687\rsid12068497
-\rsid12198464\rsid13917585\rsid14119595\rsid14383934\rsid15035121}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo10\dy6\hr16\min11}
-{\revtim\yr2011\mo8\dy10\hr9\min53}{\version12}{\edmins36}{\nofpages3}{\nofwords572}{\nofchars3265}{\nofcharsws3830}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot11539687 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 Split.exe
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11229351 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11229351 {\*\bkmkstart OLE_LINK1}{\*\bkmkstart OLE_LINK2}{\*\bkmkstart OLE_LINK3}\hich\af39\dbch\af31505\loch\f39 Split}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid11229351\charrsid8089322 \hich\af39\dbch\af31505\loch\f39 .exe }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11229351 \hich\af39\dbch\af31505\loch\f39 [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 -v | -q | -d}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11229351 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 [-s }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14119595 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 Value}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14119595
-\hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 ] [-p }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14119595 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 OutputDir}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14119595 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847
-\hich\af39\dbch\af31505\loch\f39 ] [-o }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14119595 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 FirstFile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14119595 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 ] [-t }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14119595
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 SecondFile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14119595 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 ] \hich\f39 \endash
-\loch\f39 f <InputFile>}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11229351
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 Split}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8672847\charrsid8089322
-\hich\af39\dbch\af31505\loch\f39 .exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 Split}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid8672847\charrsid8089322 \hich\af39\dbch\af31505\loch\f39 .exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8672847 \hich\af39\dbch\af31505\loch\f39 --version}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid8672847\charrsid8089322
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11539687 {\*\bkmkend OLE_LINK1}{\*\bkmkend OLE_LINK2}{\*\bkmkend OLE_LINK3}
-\hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid15035121 \hich\af39\dbch\af31505\loch\f39 SplitFile creates two Binary files either in the same directory as the current working directory or in the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3870620
-\hich\af39\dbch\af31505\loch\f39 specified}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15035121 \hich\af39\dbch\af31505\loch\f39 directory. The}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39
- input file will not be changed by}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15035121 \hich\af39\dbch\af31505\loch\f39 the split}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39
-. Two Binary files will be created in either the same directory as the current working directory, or, if the either of the output files contain a path, then in the URI is used, based }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid15035121
-\hich\af39\dbch\af31505\loch\f39 on }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3870620 \hich\af39\dbch\af31505\loch\f39 the output}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 \hich\f39
- directory, if specified by \'93\loch\f39 \hich\f39 -p\'94\loch\f39 \hich\f39 , \'93\loch\f39 \hich\f39 --prefix\'94\loch\f39 option.
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6120166 \hich\af39\dbch\af31505\loch\f39 When th\hich\af39\dbch\af31505\loch\f39 e}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39
-o or \hich\f39 \endash \loch\f39 t options }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6120166 \hich\af39\dbch\af31505\loch\f39 are }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39
-not specified, then the non-specified split filenames }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6120166 \hich\af39\dbch\af31505\loch\f39 use the filenames of the input file along}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687
-\hich\af39\dbch\af31505\loch\f39 with }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6120166 \hich\af39\dbch\af31505\loch\f39 a suffix, formatted as: }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687
-\hich\af39\dbch\af31505\loch\f39 filename.ext.1 and/or filename.ext.2.
-\par \hich\af39\dbch\af31505\loch\f39 When reading the input filename, if the end of file is reached before \hich\af39\dbch\af31505\loch\f39 the number of bytes has been reached, the first file will be an exact copy of the input file, }{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid12068497 \hich\af39\dbch\af31505\loch\f39 and }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 the second file }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid12068497 \hich\af39\dbch\af31505\loch\f39 is created with}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 zero length.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10361764\charrsid12198464 {\*\bkmkstart OLE_LINK12}{\*\bkmkstart OLE_LINK13}\hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10361764 \hich\af39\dbch\af31505\loch\f39
-e specified, tool prints usage.}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3870620 {\*\bkmkend OLE_LINK12}{\*\bkmkend OLE_LINK13}
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 -f, --filename Fi\hich\af39\dbch\af31505\loch\f39 lename\tab \tab \tab
-\par }\pard \ltrpar\ql \fi426\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 Input file specified by Filename
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 -s, --split VALUE\tab \tab \tab \tab
-\par }\pard \ltrpar\ql \fi425\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 The number of bytes in the first file.
-\par \hich\af39\dbch\af31505\loch\f39 The Split Occurs at the AFTER VALUE BYTES from the start of the file.
-\par \hich\af39\dbch\af31505\loch\f39 Value can be integer, hex }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14383934 \hich\af39\dbch\af31505\loch\f39 address}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687
-\hich\af39\dbch\af31505\loch\f39 , or integer-letter, such as 1K, where:
-\par \hich\af39\dbch\af31505\loch\f39 K=1024B\hich\af39\dbch\af31505\loch\f39 ytes, M=1024K, G=1024M
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 -p, --prefix OutputDir\tab \tab \tab \tab
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 Output directory
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 -o, --firstfile Filename1
-\par \tab \hich\af39\dbch\af31505\loch\f39 First of the Split Files.
-\par \hich\af39\dbch\af31505\loch\f39 -t, --secondfile Filename2
-\par \tab \hich\af39\dbch\af31505\loch\f39 Second of the Split Files.
-\par \hich\af39\dbch\af31505\loch\f39 --version
-\par \tab \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit
-\par \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid12068497 \hich\af39\dbch\af31505\loch\f39 Enabl}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14383934
-\hich\af39\dbch\af31505\loch\f39 e}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 verbose output with informational messages printed. This is a count value}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid14383934 .}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5577864 \hich\af39\dbch\af31505\loch\f39 Specifying }{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \loch\af39\dbch\af31505\hich\f39 \endash \loch\f39 vv }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5577864 \hich\af39\dbch\af31505\loch\f39 will}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 increase the verbosity level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 -q, --quiet
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14383934 \hich\af39\dbch\af31505\loch\f39 D}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 isable all messages except FATAL ERRORS
-\par \hich\af39\dbch\af31505\loch\f39 -d, --debug [#]
-\par \tab \hich\af39\dbch\af31505\loch\f39 Enable debug messages, at level #
-\par \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par \tab \hich\af39\dbch\af31505\loch\f39 Print c\hich\af39\dbch\af31505\loch\f39 opyright, version and usage of this program and exit
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid10361764 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid10361764 {\*\bkmkstart OLE_LINK10}{\*\bkmkstart OLE_LINK11}
-{\*\bkmkstart OLE_LINK4}{\*\bkmkstart OLE_LINK5}{\*\bkmkstart OLE_LINK6}{\*\bkmkstart OLE_LINK9}{\*\bkmkstart OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid10361764\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid10361764
-{\*\bkmkend OLE_LINK10}{\*\bkmkend OLE_LINK11}0}{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid10361764 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid10361764 \hich\af39\dbch\af13\loch\f39
-The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid10361764 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1
-\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid10361764 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10
-\trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid10361764
-\hich\af2\dbch\af13\loch\f2 Nonzero}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid10361764\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid4395805\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid10361764 \hich\af39\dbch\af13\loch\f39 The action
-\hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid10361764 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11539687 {\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5}{\*\bkmkend OLE_LINK6}
-{\*\bkmkend OLE_LINK9}{\*\bkmkend OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 1. c:\\Tools\\Split.exe -f tool_setup.bat
-\par \hich\af39\dbch\af31505\loch\f39 \hich\f39 tool_setup.bat file will be split into two files tool_setup.bat1 and tool_setup.bat2. As no \'93\loch\f39 \hich\f39 -s\'94\loch\f39
- was specified, tool_setup.bat1 will have the size of the input file while tool_setu\hich\af39\dbch\af31505\loch\f39 p.bat2 will have size zero.
-\par \hich\af39\dbch\af31505\loch\f39 2. c:\\Tools\\Split.exe -f tool_setup.bat -o tool_setup1 -t tool_setup2
-\par \hich\af39\dbch\af31505\loch\f39 \hich\f39 tool_setup.bat file will be split into two files tool_setup1 and tool_setup2. As no \'93\loch\f39 \hich\f39 -s\'94\loch\f39 was specified, tool_setup1 will have the size of the input file whil
-\hich\af39\dbch\af31505\loch\f39 e tool_setup2 will have size zero.
-\par \hich\af39\dbch\af31505\loch\f39 3. c:\\Tools\\Split.exe -f tool_setup.bat -s 5k -o tool_setup1 -t tool_setup2
-\par \hich\af39\dbch\af31505\loch\f39 \hich\f39 tool_setup.bat file will be split into two files tool_setup1 and tool_setup2. Now \'93\loch\f39 \hich\f39 -s 5k\'94\loch\f39 specified and tool_setup.bat is not as large as 5k, s
-\hich\af39\dbch\af31505\loch\f39 o tool_setup1 will have size of the input file while tool_setup2 will have size zero.
-\par \hich\af39\dbch\af31505\loch\f39 4. c:\\Tools\\Split.exe -f tool_setup.bat -s 4k -p c:\\ -o Test/tool_setup1 -t Test1/tool_setup2
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 tool_setup.bat file will be split into two files tool_setup1 and tool_setup2
-\hich\af39\dbch\af31505\loch\f39 \hich\f39 . Now \'93\loch\f39 \hich\f39 -s 4k\'94\loch\f39 \hich\f39
- specified and tool_setup.bat is 4.9k, tool_setup1 will have the size of 4k and tool_setup2 will have size 0.5k. The output files are both preceded with a directory and \'93\loch\f39 -p c:\\\hich\f39 \'94\loch\f39 \hich\f39 is specified, so the \'93
-\loch\f39 \hich\f39 Test\'94\loch\f39 \hich\f39 and \'93\loch\f39 \hich\f39 Test1\'94\loch\f39 directories will be crea\hich\af39\dbch\af31505\loch\f39 t\hich\af39\dbch\af31505\loch\f39 ed under c:\\ to contain tool_setup1 and tool_setup2 }{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid3870620 \hich\af39\dbch\af31505\loch\f39 separately}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 .
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 No known issues
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 None.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 1999 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid5577864 \hich\af39\dbch\af31505\loch\f39 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11229351 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11539687 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.ph\hich\af39\dbch\af31505\loch\f39 p
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }\pard \ltrpar\ql \li60\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin60\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid11539687
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e500000000000000000000000040de
-f2460057cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/TargetTool_Utility_Man_Page.rtf b/BaseTools/UserManuals/TargetTool_Utility_Man_Page.rtf
deleted file mode 100644
index 9fed01d856..0000000000
--- a/BaseTools/UserManuals/TargetTool_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,322 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
-{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
-{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}
-{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f55\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f56\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
-{\f58\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f59\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f60\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f61\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
-{\f62\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f63\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}
-{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
-{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}
-{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
-{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}
-{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}
-{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
-{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}
-{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}
-{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}
-{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
-{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid11096561 annotation reference;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid11096561 annotation text;}{\*\cs19 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20 \sbasedon10 \slink18 \slocked \ssemihidden \styrsid11096561 Comment Text Char;}{
-\s20\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon18 \snext18 \slink21 \ssemihidden \sunhideused \styrsid11096561 annotation subject;}{\*\cs21 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20 \sbasedon19 \slink20 \slocked \ssemihidden \styrsid11096561 Comment Subject Char;}{
-\s22\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext22 \slink23 \ssemihidden \sunhideused \styrsid11096561 Balloon Text;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16 \sbasedon10 \slink22 \slocked \ssemihidden \styrsid11096561 Balloon Text Char;}{
-\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext24 \spriority0 \styrsid16388005 CellBodyLeft;}{\*\cs25 \additive \b\f2\cf13 \spriority0 \styrsid16388005 CodeCharacter;}{\*\ts26\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh
-\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext26 \spriority59 \styrsid16388005 Table Grid;}}{\*\rsidtbl \rsid1639664\rsid3545966\rsid4999604\rsid5911148\rsid7558875\rsid8264487\rsid8600807\rsid8736310\rsid9178918\rsid9377452\rsid11096561\rsid12198464\rsid14565536\rsid14895404
-\rsid16388005}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo10\dy6\hr17\min13}{\revtim\yr2011\mo8\dy10\hr9\min53}{\version11}
-{\edmins21}{\nofpages3}{\nofwords566}{\nofchars3227}{\nofcharsws3786}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot1639664 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0
-\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 TargetTool.exe or TargetToo.py \hich\f39 \endash \loch\f39 Command line tool edits EDKII build configuration file: target.txt.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 TargetTool [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310 \hich\af39\dbch\af31505\loch\f39 -m }{\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310 \hich\af39\dbch\af31505\loch\f39 ThreadNum}{
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310 \hich\af39\dbch\af31505\loch\f39 [-t }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310 \hich\af39\dbch\af31505\loch\f39 Target}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310 \hich\af39\dbch\af31505\loch\f39 ] [-a }{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310 \hich\af39\dbch\af31505\loch\f39
-Arch}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310
-\hich\af39\dbch\af31505\loch\f39 ] [-p }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310 \hich\af39\dbch\af31505\loch\f39 DscFile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310 \hich\af39\dbch\af31505\loch\f39 ] [-c }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9178918 \hich\af39\dbch\af31505\loch\f39 ToolDefFile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9178918 \hich\af39\dbch\af31505\loch\f39 [-n }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9178918 \hich\af39\dbch\af31505\loch\f39 TagName}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9178918 \hich\af39\dbch\af31505\loch\f39 ] [-r }{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9178918 \hich\af39\dbch\af31505\loch\f39
-Rule}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9178918
-\hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310
-\hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8264487 \hich\af39\dbch\af31505\loch\f39 A}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664
-\hich\af39\dbch\af31505\loch\f39 rgs}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8736310 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid1639664
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9178918 \hich\af39\dbch\af31505\loch\f39 TargetTool \hich\f39 \endash \loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 TargetTool --version}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9178918
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 TargetTool print}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14895404 \hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664
-\hich\af39\dbch\af31505\loch\f39 current build setting in target.txt. It can also be used to clear current setting in target.txt. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14895404 \hich\af39\dbch\af31505\loch\f39 or}{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39
- to modify the current setting in target.txt. After it sets the build configuration, build tool can run without any command line option to build the tip with the current setting in target.txt. TargetTool command line option can be specified together to pr
-\hich\af39\dbch\af31505\loch\f39 i\hich\af39\dbch\af31505\loch\f39 nt or set one or a group of configurations.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1639664
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid16388005\charrsid12198464 {\*\bkmkstart OLE_LINK12}{\*\bkmkstart OLE_LINK13}\hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9377452 \hich\af39\dbch\af31505\loch\f39
-e specified, tool prints }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9377452 \hich\af39\dbch\af31505\loch\f39 error message}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid16388005 .}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11096561 {\*\bkmkend OLE_LINK12}{\*\bkmkend OLE_LINK13}
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Args}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid1639664
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 This is the required command option, which can be one of the follow values.
-
-\par \hich\af39\dbch\af31505\loch\f39 Clean Clean the all defaul\hich\af39\dbch\af31505\loch\f39 t configuration of target.txt.
-\par \hich\af39\dbch\af31505\loch\f39 Print Print the all default configuration of target.txt.
-\par \hich\af39\dbch\af31505\loch\f39 Set Replace the default configuration with expected value specified by option.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 -a TARGET_ARCH, --arch=TARGET_ARCH
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 ARCHS is one of the list: IA32, X64, IPF or EBC,
-\hich\af39\dbch\af31505\loch\f39 which replaces target.txt's TARGET_ARCH definition. To specify more archs, repeat this option. 0 will clear this setting in target.txt and can't combine with other value.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 -p DSCFILE, --platform=DSCFILE}{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0
-\f2\fs20\insrsid1639664
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39
-Specify a DSC file, which replace target.txt's ACTIVE_PLATFORM definition. 0 will clear this setting in target.txt and can't combine with other value.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 -c TOOL_DEFINITION_FILE, --tooldef=TOOL_DEFINITION_FILE}{\rtlch\fcs1
-\af2\afs20 \ltrch\fcs0 \f2\fs20\insrsid1639664
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Specify the WORKSPACE relative path of tool_def.t
-\hich\af39\dbch\af31505\loch\f39 xt file, which replace target.txt's TOOL_CHAIN_CONF definition. 0 will clear this setting in target.txt and can't combine with other value.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 -t TARGET, --target=TARGET
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39
-TARGET is one of the list: DEBUG, RELEASE, which replaces target.txt's TARGET definition.\hich\af39\dbch\af31505\loch\f39 To specify more TARGET, repeat this option. 0 will clear this setting in target.txt and can't combine with other value.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 -n TOOL_CHAIN_TAG, --tagname=TOOL_CHAIN_TAG
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39
-Specify the Tool Chain Tagname, which replaces target.txt's TOOL_CHAIN_TAG definition. 0 wi\hich\af39\dbch\af31505\loch\f39 ll clear this setting in target.txt and can't combine with other value.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 -r BUILD_RULE_FILE, --buildrule=BUILD_RULE_FILE
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39
-Specify the build rule configure file, which replaces target.txt's BUILD_RULE_CONF definition. If not specified, the default value Conf/build_rule.txt will be set.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 -m NUM, --multithread=NUM
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Specify the multi-thread number which replaces target.txt's MAX_CO
-\hich\af39\dbch\af31505\loch\f39 NCURRENT_THREAD_NUMBER. If the value is less than 2, MULTIPLE_THREAD will be disabled. If the value is larger than 1, MULTIPLE_THREAD will be enabled.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1639664
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 --version}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid1639664
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Show program version number and exit
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Show this help message and exit
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid16388005 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid16388005 {\*\bkmkstart OLE_LINK10}{\*\bkmkstart OLE_LINK11}
-{\*\bkmkstart OLE_LINK3}{\*\bkmkstart OLE_LINK4}{\*\bkmkstart OLE_LINK5}{\*\bkmkstart OLE_LINK6}{\*\bkmkstart OLE_LINK9}{\*\bkmkstart OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid16388005\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid16388005
-{\*\bkmkend OLE_LINK10}{\*\bkmkend OLE_LINK11}0}{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\lang1033\langfe2052\kerning2\langfenp2052\insrsid16388005 \cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid16388005 \hich\af39\dbch\af13\loch\f39
-The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid16388005 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1
-\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid16388005 \trowd \irow0\irowband0\ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10
-\trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts26 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs25\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid16388005
-\hich\af2\dbch\af13\loch\f2 1}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs25\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid16388005\charrsid8600807 \cell }\pard \ltrpar\s24\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid14565536\yts26 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid16388005 \hich\af39\dbch\af13\loch\f39 The action
-\hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid16388005 \trowd \irow1\irowband1\lastrow \ltrrow\ts26\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1639664 {\*\bkmkend OLE_LINK3}{\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5}
-{\*\bkmkend OLE_LINK6}{\*\bkmkend OLE_LINK9}{\*\bkmkend OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 1. Print current build setting in target.txt
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 TargetTool Print}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid1639664
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 2. Clear current build setting in target.txt.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 TargetTool Clean}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1639664
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 3. Set the build thread number to 3.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1639664
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 TargetTool -m 3 set}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid1639664
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 4. Set the build arch to IA32, X64 and IPF both.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 TargetTool -a IA32 -a X\hich\af39\dbch\af31505\loch\f39 64 -a IPF set}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid1639664
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 5. Set the build target to DEBUG and set the active platform to NT32Pkg.dsc}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1639664
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 TargetTool -t DEBUG -p Nt32Pkg/Nt32Pkg.dsc set}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid1639664
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 No known }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14895404 \hich\af39\dbch\af31505\loch\f39 issues}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 .
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid1639664
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 Copyr\hich\af39\dbch\af31505\loch\f39 ight (c) 2007 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14895404 \hich\af39\dbch\af31505\loch\f39 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid7558875 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1639664 \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\insrsid1639664
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1639664
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000003088
-a3510057cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/TianoCompress_Utility_Man_Page.rtf b/BaseTools/UserManuals/TianoCompress_Utility_Man_Page.rtf
deleted file mode 100644
index b2b07aba20..0000000000
--- a/BaseTools/UserManuals/TianoCompress_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,295 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green127\blue127;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 \slink18 \ssemihidden \sunhideused \styrsid7632496 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink17 \slocked \ssemihidden \styrsid7632496 Balloon Text Char;}{\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext19 \spriority0 \styrsid6897091 CellBodyLeft;}{\*\cs20 \additive \b\f2\cf13 \spriority0 \styrsid6897091 CodeCharacter;}{\*\ts21\tsrowd\trbrdrt
-\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext21 \spriority59 \styrsid6897091 Table Grid;}}{\*\rsidtbl \rsid31399\rsid4999604\rsid5324626\rsid5856265\rsid5911148\rsid6034337\rsid6184429\rsid6454980\rsid6845986\rsid6897091\rsid7632496\rsid8600807\rsid9781754\rsid10967835\rsid12198464
-\rsid16532127}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo10\dy6\hr16\min15}{\revtim\yr2011\mo8\dy10\hr9\min54}{\version12}
-{\edmins14}{\nofpages3}{\nofwords423}{\nofchars2415}{\nofcharsws2833}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot6454980 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid16532127 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 TianoCompress.exe \hich\f39 \endash \loch\f39 encode or decode a file
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid16532127 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 TianoCompress.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5324626 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \endash \loch\f39
-e|-d}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5324626 \hich\af39\dbch\af31505\loch\f39
--v | -q | --debug}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5324626 \hich\af39\dbch\af31505\loch\f39
- [-o }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9781754 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5324626
-\hich\af39\dbch\af31505\loch\f39 OutputFile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid9781754 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5324626 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5324626 \hich\af39\dbch\af31505\loch\f39 <Input}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 File}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5324626 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid6454980
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5324626 \hich\af39\dbch\af31505\loch\f39 TianoCompress.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5324626 \hich\af39\dbch\af31505\loch\f39
-\hich\f39 \endash \loch\f39 h
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid5324626 \hich\af39\dbch\af31505\loch\f39 TianoCompress.exe}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5324626 \hich\af39\dbch\af31505\loch\f39
- --version
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid16532127 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 TianoCompress tool encode}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980
-\hich\af39\dbch\af31505\loch\f39 or decode}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 files with }{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 EFI extension encode or decode algorithm. When}{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 the}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 \hich\f39 \'93\loch\f39 \hich\f39 -e\'94\loch\f39 \hich\f39
- option is specified in command line, the tool will encode the input file with EFI extension encode algorithm; when \'93\loch\f39 \hich\f39 -d\'94\loch\f39 opti\hich\af39\dbch\af31505\loch\f39
-on is specified in the command line, the tool will decode the input file with EFI extension decode algorithm. When decoding a file, }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 tool performs some rudimentary checking on the input files to verify that they }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337
-\hich\af39\dbch\af31505\loch\f39 were }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 compressed by the EFI extension algo\hich\af39\dbch\af31505\loch\f39 rithm. These checks include:
-\par \hich\af39\dbch\af31505\loch\f39 Check}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 ing}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39
- the input file header (8 bytes header);
-\par \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 Checking t}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39
-he first 4 bytes is component size (not usable);
-\par \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 Checking t}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39
-he following 4 bytes }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 are }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 the original size }{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 of}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 the input file size and}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 that}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 it is the decompressed file size.
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 The}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 tool does not perform any checking}{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 when encoding the file.}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 .
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid16532127 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid10967835\charrsid12198464 {\*\bkmkstart OLE_LINK12}{\*\bkmkstart OLE_LINK13}\hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid10967835 \hich\af39\dbch\af31505\loch\f39
-e specified, tool prints usage.}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid7632496 {\*\bkmkend OLE_LINK12}{\*\bkmkend OLE_LINK13}
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 -e
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Encode the input file, which means to compress the i\hich\af39\dbch\af31505\loch\f39 nput file
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 -d
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Decode the input file, which means to decompress the input file
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 -o, --output Filename}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6454980
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 The file containing encoded or decoded content of input file
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 --version
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6454980 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Print version and copyright of this program and exit
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 -v, --verbose
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 Enable}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980
-\hich\af39\dbch\af31505\loch\f39 verbose output with informational messages printed. This is a count value, so specifying \hich\f39 \endash \loch\f39 v can be used to increase the verbosity level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 -q, --quiet}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid6454980
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Disable all messages except FATAL ERRORS
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 --debug [0-9]
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6454980 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Enable debug messages. nly 0-9 Level is supported.
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6454980 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Print copyright, version and usage of this program and exit
-\par }\pard\plain \ltrpar\s2\ql \fi-1440\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid6897091 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6897091\charrsid6184429 {\*\bkmkstart OLE_LINK7}{\*\bkmkstart OLE_LINK8}\hich\af39\dbch\af31505\loch\f39
-Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid6897091
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts21\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts21 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6897091\charrsid8600807 \hich\af2\dbch\af13\loch\f2 STATUS_SUCCESS}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6897091 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6897091\charrsid4999604 \tab }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6897091 0\cell }{\rtlch\fcs1 \af0 \ltrch\fcs0
-\insrsid6897091 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid6897091 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0
-\fs20\insrsid6897091 \trowd \irow0\irowband0\ltrrow\ts21\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts21 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\kerning2\insrsid6897091\charrsid8600807 \hich\af2\dbch\af13\loch\f2
-STATUS_ERROR}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6897091 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6897091\charrsid4999604 \tab \tab }{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid6897091 \hich\af2\dbch\af13\loch\f2 2}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \cs20\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid6897091\charrsid8600807
-\cell }\pard \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid6845986\yts21 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid6897091
-\hich\af39\dbch\af13\loch\f39 The action \hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid6897091 \trowd \irow1\irowband1\lastrow \ltrrow\ts21\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid16532127 \rtlch\fcs1
-\af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6454980 {\*\bkmkend OLE_LINK7}{\*\bkmkend OLE_LINK8}
-\hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 \hich\f39 1. Encode the input file \'93\loch\f39 \hich\f39 file.efi\'94\loch\f39 \hich\f39 and specify the output file name with \'93\loch\f39 file.tiano
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 TianoCompress \hich\f39 \endash \loch\f39 e \hich\f39 \endash \loch\f39 o file.tiano file.efi
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 \hich\f39 2. Decode the input file \'93\loch\f39 \hich\f39 file.tiano\'94\loch\f39 \hich\f39 and specify the output file name with \'93\loch\f39 \hich\f39
-file.orig\'94
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 TianoCompress \hich\f39 \endash \loch\f39 d \hich\f39 \endash \loch\f39 o file.orig file.tiano
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 3. Decode the input file "file.tiano" in the quiet mode and specify the output file name with "file.orig"
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 TianoCompress \hich\f39 \endash \loch\f39 d -q \hich\f39 \endash \loch\f39 o file.orig file.tiano
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid16532127 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 No known }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 issues}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980 .
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.\hich\af39\dbch\af31505\loch\f39 sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6454980
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid16532127 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid16532127 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \fi-1300\li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid16532127 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid6454980 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 1999 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 20}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid5856265 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6034337 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6454980
-\hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompa\hich\af39\dbch\af31505\loch\f39 nies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS O\hich\af39\dbch\af31505\loch\f39 R IMPLIED.
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000a0cc
-e5640057cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/Trim_Utility_Man_Page.rtf b/BaseTools/UserManuals/Trim_Utility_Man_Page.rtf
deleted file mode 100644
index 7548e1b210..0000000000
--- a/BaseTools/UserManuals/Trim_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,343 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
-{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
-{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}
-{\f41\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f43\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f44\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f46\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f47\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f48\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f49\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\f50\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f51\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f53\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f54\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
-{\f56\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f57\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f58\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f59\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
-{\f60\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f61\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f63\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f64\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}
-{\f66\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f67\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f68\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f69\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
-{\f70\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f71\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f175\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f383\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}
-{\f384\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f386\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f387\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f390\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
-{\f391\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f413\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f414\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f416\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}
-{\f417\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f420\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f421\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\f423\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}
-{\f424\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f426\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f427\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f428\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
-{\f429\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f430\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f431\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f432\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}
-{\f433\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f434\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f437\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f440\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f441\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}
-{\f445\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f453\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f454\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f456\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}
-{\f457\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f460\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f461\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
-{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive
-\rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0 \b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 \slink18 \ssemihidden \sunhideused \styrsid6643493 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink17 \slocked \ssemihidden \styrsid6643493 Balloon Text Char;}{\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext19 \spriority0 \styrsid8347714 CellBodyLeft;}{\*\cs20 \additive \b\f2\cf13 \spriority0 \styrsid8347714 CodeCharacter;}{\*\ts21\tsrowd\trbrdrt
-\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext21 \spriority59 \styrsid8347714 Table Grid;}}{\*\revtbl {Unknown;}{yzeng15;}}{\*\rsidtbl \rsid2436965\rsid3155658\rsid4999604\rsid5138063\rsid5911148\rsid6037602\rsid6643493\rsid6907013\rsid8089322\rsid8347714\rsid8412573\rsid8600807\rsid8606769\rsid8651272
-\rsid14103422\rsid16001458}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator yzeng15}{\creatim\yr2010\mo10\dy6\hr17\min15}{\revtim\yr2011\mo9\dy8\hr12\min14}
-{\version13}{\edmins11}{\nofpages3}{\nofwords668}{\nofchars3492}{\nofcharsws4152}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot6643493 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0
-\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Trim.exe or Trim.py \hich\f39 \endash \loch\f39 Convert the preprocessed source files by C compiler to the expected style file to be processed further by EDKII tool.}{\rtlch\fcs1
-\af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 trim [-s|-r|\hich\af39\dbch\af31505\loch\f39 -a|-8] [-c] [-v|-d <debug_level>|-q] [-o <output_file>] <input_file>
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid3155658 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid3155658 \hich\af39\dbch\af31505\loch\f39 trim \hich\f39 \endash
-\loch\f39 h
-\par \hich\af39\dbch\af31505\loch\f39 trim --version}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid3155658\charrsid8089322
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid3155658
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Trim tool }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422 \hich\af39\dbch\af31505\loch\f39 process}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493
-\hich\af39\dbch\af31505\loch\f39 the preprocessed file by}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422 \hich\af39\dbch\af31505\loch\f39 a}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39
- Compiler to remove the unused content }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422 \hich\af39\dbch\af31505\loch\f39 and }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39
-generate the file to be processed further by EDKII tools.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Trim t\hich\af39\dbch\af31505\loch\f39 ool can also be used generate the expected source file to work with EDKII build system and EDKII core code}{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422 \hich\af39\dbch\af31505\loch\f39 . It extends the EDKII build system to support more source file types.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 input_file
-\par \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 The input file may be the preprocessed source code, the pr\hich\af39\dbch\af31505\loch\f39 eprocessed VFR file, ASL file or R8 framework source file.}{
-\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -s, --source-code
-\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 The input file is}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422
-\hich\af39\dbch\af31505\loch\f39 a }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39
-preprocessed source code, including C or assembly code. All generated codes from the include header files are remove all. Only content in source file is k\hich\af39\dbch\af31505\loch\f39 ept.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid6643493
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -r, --vfr-file
-\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 The input file is }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422
-\hich\af39\dbch\af31505\loch\f39 a }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 preprocessed VFR file. All generated codes from the include header files are remove except for the typedef structure.}{
-\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -a, --asl-file
-\par }\pard \ltrpar\ql \fi360\li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 The input file is }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid14103422 \hich\af39\dbch\af31505\loch\f39 an }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 ASL file. The asl source include style Include\hich\af39\dbch\af31505\loch\f39
-(*.asi) will be changed to C style #include *.asi. The preprocessed asl file can be preprocessed by C compiler. }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -8, --}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\deleted\fs18\cf1\revauthdel1\revdttmdel-2030484795\insrsid6643493\delrsid8412573 \hich\af39\dbch\af31505\loch\f39 r8}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm-2030484795\langfenp2052\insrsid8412573 \hich\af39\dbch\af31505\loch\f39 E}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\revised\lang1033\langfe2052\revauth1\revdttm-2030484722\langfenp2052\insrsid16001458 \hich\af39\dbch\af31505\loch\f39 dk}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -source-code
-\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39
-The input file is the EDK style source code to be trimmed for ECP platform. Some EDK framework source file w\hich\af39\dbch\af31505\loch\f39 \hich\f39 ill be modified to work with EDKII thunk and core drivers. A window script tool \'93\loch\f39 \hich\f39
-ImportTool.bat\'94\loch\f39 is created to process a group of EDK framework source files in the same file directory. }{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20\insrsid6643493
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -c, --convert-hex
-\par }\pard \ltrpar\ql \fi360\li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Convert}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422
-\hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 standard hex format (0xabcd) to MASM f\hich\af39\dbch\af31505\loch\f39 ormat (abcdh).}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0
-\f0\fs18\cf1\insrsid6643493
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -o OUTPUTFILE, --output=OUTPUTFILE
-\par }\pard \ltrpar\ql \fi360\li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 The output file }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422
-\hich\af39\dbch\af31505\loch\f39 stores}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 the trimmed content.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -v, --verbose}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 \tab }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422 \hich\af39\dbch\af31505\loch\f39 Enable}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 verbose output with informational messages printed}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2436965
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -d LOGLEVEL, --debug=LOGLEVEL [0-9]}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid6643493
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Enable debug messages at specified level.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -q, --quiet}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Disable all messages except FATAL ERRORS}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493\delrsid6643493 \hich\af39\dbch\af31505\loch\f39 }{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid2436965
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 --version}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid6643493
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Show program version number and exit
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 -h, -?, --help
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Show this help message and exit
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid8347714 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid8347714 {\*\bkmkstart OLE_LINK10}{\*\bkmkstart OLE_LINK11}
-{\*\bkmkstart OLE_LINK3}{\*\bkmkstart OLE_LINK4}{\*\bkmkstart OLE_LINK5}{\*\bkmkstart OLE_LINK6}{\*\bkmkstart OLE_LINK9}{\*\bkmkstart OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid8347714\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts21\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts21 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid8347714
-{\*\bkmkend OLE_LINK10}{\*\bkmkend OLE_LINK11}0\cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid8347714 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid8347714 \cell }\pard\plain \ltrpar
-\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af37\afs20 \ltrch\fcs0 \fs20\insrsid8347714 \trowd \irow0\irowband0\ltrrow\ts21\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts21 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid8347714
-\hich\af2\dbch\af13\loch\f2 1}{\rtlch\fcs1 \af41\afs19 \ltrch\fcs0 \cs20\f41\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid8347714\charrsid8600807 \cell }\pard \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid3155658\yts21 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid8347714 \hich\af39\dbch\af13\loch\f39 The action failed.\cell
-}\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid8347714 \trowd \irow1\irowband1\lastrow \ltrrow\ts21\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6643493 {\*\bkmkend OLE_LINK3}{\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5}
-{\*\bkmkend OLE_LINK6}{\*\bkmkend OLE_LINK9}{\*\bkmkend OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39
-1. Trim the preprocessed source file (test.i) by C compiler to remove all generated codes from the include header files by this source file (test.s) to the output file test.iii, which only contains the content in this source file (test.s).}{\rtlch\fcs1
-\af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid6643493\charrsid8606769 \hich\af39\dbch\af31505\loch\f39 Trim --source-co\hich\af39\dbch\af31505\loch\f39 de -o test.iii test.i}{\rtlch\fcs1 \ab\af0\afs18
-\ltrch\fcs0 \b\f0\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid6643493\charrsid8606769
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 2. Trim the preprocessed source file (test.i) by }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422 \hich\af39\dbch\af31505\loch\f39 a }{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39
-C compiler to remove all generated codes from the include header files by this source file (test.asm) and convert standard hex format (0xabcd) to MASM format (abcdh) to the output fil\hich\af39\dbch\af31505\loch\f39
-e test.iii, which only contains the content in this source file (test.s).
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid6643493\charrsid8606769 \hich\af39\dbch\af31505\loch\f39 Trim --source-code --convert-hex -o test.iii test.i}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid6643493\charrsid8606769
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 3. Trim the preprocessed source file (test.i) by}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14103422 \hich\af39\dbch\af31505\loch\f39 a}{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 C compiler to remove all generated codes from the include header files by this \hich\af39\dbch\af31505\loch\f39
-source file (test.vfr) except for the typedef structures to the output file (test.iii).}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Trim --vfr-file -o test.iii test.i}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 4. Trim }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8651272 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 ASL source file (test.asl) to convert the ASL style Include(*.asi) to the C style #include *.asi. The update}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8651272
-\hich\af39\dbch\af31505\loch\f39 d}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 ASL will ou\hich\af39\dbch\af31505\loch\f39 tput to test.i.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Trim --asl-file -o test.i test.asl}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 5. Modify an EDK style framework source file to work with EDKII thunk and core drivers.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid6643493\charrsid8606769 \hich\af39\dbch\af31505\loch\f39 Trim --r8-source-code -o test.c test.c}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\lang1036\langfe1033\langnp1036\insrsid6643493\charrsid8606769
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 5. Modify all EDK style framework source files (*.c and *.h) in current direct\hich\af39\dbch\af31505\loch\f39 \hich\f39
-ory to work with EDKII thunk and core drivers by the script \'93\loch\f39 \hich\f39 ImportTool.bat\'94.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 ImportTool *.c}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid6643493
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 ImportTool *.h
-\par }{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\cf1\insrsid6643493
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 No known }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8651272 \hich\af39\dbch\af31505\loch\f39 issues}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 .
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-buildtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid6643493
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 2007 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8651272 \hich\af39\dbch\af31505\loch\f39 20}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid8606769 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid8651272 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493
-\hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 htt\hich\af39\dbch\af31505\loch\f39 p://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6643493 \hich\af39\dbch\af31505\loch\f39 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\insrsid6643493
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6643493
-\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8
-72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7
-2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b
-44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7
-065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000
-00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08
-84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc
-52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353
-bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468
-656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c
-070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7
-29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65
-312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8
-a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04
-98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c
-94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471
-7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671
-9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1
-e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5
-193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1
-17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2
-8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6
-6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a
-668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847
-bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e
-16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b
-5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0
-8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2
-c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966
-0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b
-7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb
-9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0
-088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf
-8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26
-ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0
-28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6
-345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93
-b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30
-254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74
-68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24
-51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198
-720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528
-a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000
-000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000
-002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468
-656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000
-00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000
-00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e352e30000000000000000000000e0000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff0900060000000000000000000000010000000100000000000000001000000200000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdffffff04000000feffffff05000000fefffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff01000000ec69d9888b8b3d4c859eaf6cd158be0f00000000000000000000000060c7
-dccddd6dcc010300000080020000000000004d0073006f004400610074006100530074006f0072006500000000000000000000000000000000000000000000000000000000000000000000000000000000001a000101ffffffffffffffff02000000000000000000000000000000000000000000000060c7dccddd6dcc01
-60c7dccddd6dcc010000000000000000000000005500c500c2003500c0005500c60054004b00d400ca0042004b00c1004c00d400db004d00c5003000d400d0003d003d000000000000000000000000000000000032000101ffffffffffffffff03000000000000000000000000000000000000000000000060c7dccddd6d
-cc0160c7dccddd6dcc010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff04000000ffffffff000000000000000000000000000000000000000000000000
-00000000000000000000000000000000da00000000000000010000000200000003000000feffffff0500000006000000070000000800000009000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3c623a536f75726365732053656c65637465645374796c653d225c4150412e58534c22205374796c654e616d653d224150412220786d6c6e733a623d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f7267
-2f6f6666696365446f63756d656e742f323030362f6269626c696f6772617068792220786d6c6e733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f677261706879223e3c2f623a536f75726365733e0d0a0000
-0000000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b38313946
-353835322d393334392d344132422d383132412d3132463445434339354144337d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c
-64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6f70656e500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000
-0000000000000000000000000000000000000000000000000000000000000400000055010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f6269626c696f677261706879222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f
-72654974656d3e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/UtilityManPage_template.rtf b/BaseTools/UserManuals/UtilityManPage_template.rtf
deleted file mode 100644
index ae315e9f02..0000000000
--- a/BaseTools/UserManuals/UtilityManPage_template.rtf
+++ /dev/null
Binary files differ
diff --git a/BaseTools/UserManuals/VfrCompiler_Utility_Man_Page.rtf b/BaseTools/UserManuals/VfrCompiler_Utility_Man_Page.rtf
deleted file mode 100644
index 81980fc193..0000000000
--- a/BaseTools/UserManuals/VfrCompiler_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,326 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg1252\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
-{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
-{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}
-{\f41\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f43\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f44\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f46\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f47\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f48\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f49\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\f50\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f51\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f53\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f54\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
-{\f56\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f57\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f58\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f59\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
-{\f60\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f61\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f63\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f64\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}
-{\f66\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f67\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f68\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f69\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
-{\f70\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f71\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f175\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\f383\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}
-{\f384\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f386\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f387\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f390\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}
-{\f391\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f413\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f414\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f416\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}
-{\f417\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f420\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f421\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\f423\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}
-{\f424\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f426\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f427\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f428\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
-{\f429\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f430\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f431\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f432\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}
-{\f433\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f434\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}
-{\f437\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f440\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}{\f441\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}
-{\f445\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f453\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f454\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f456\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}
-{\f457\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f460\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f461\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
-{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\chyperlink\ctint255\cshade255\red0\green0\blue255;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }
-{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf17 \sbasedon10 \sunhideused \styrsid1204842 Hyperlink;}{
-\s18\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033
-\sbasedon0 \snext18 \slink19 \ssemihidden \sunhideused \styrsid3956845 Balloon Text;}{\*\cs19 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16 \sbasedon10 \slink18 \slocked \ssemihidden \styrsid3956845 Balloon Text Char;}{\*\cs20 \additive
-\rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \sunhideused \styrsid6635418 annotation reference;}{\s21\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0
-\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext21 \slink22 \ssemihidden \sunhideused \styrsid6635418 annotation text;}{\*\cs22 \additive \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f39\fs20
-\sbasedon10 \slink21 \slocked \ssemihidden \styrsid6635418 Comment Text Char;}{\s23\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0
-\b\fs20\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon21 \snext21 \slink24 \ssemihidden \sunhideused \styrsid6635418 annotation subject;}{\*\cs24 \additive \rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f39\fs20
-\sbasedon22 \slink23 \slocked \ssemihidden \styrsid6635418 Comment Subject Char;}{\s25\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext25 \spriority0 \styrsid4289583 CellBodyLeft;}{\*\cs26 \additive \b\f2\cf13 \spriority0 \styrsid4289583 CodeCharacter;}{\*\ts27\tsrowd\trbrdrt
-\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext27 \spriority59 \styrsid4289583 Table Grid;}}{\*\rsidtbl \rsid83254\rsid1204842\rsid2570438\rsid3956845\rsid4289583\rsid4999604\rsid5715948\rsid5911148\rsid6448922\rsid6635418\rsid7634258\rsid8089322\rsid8600807\rsid9190531\rsid9200893
-\rsid10094212\rsid11500129\rsid11950970\rsid12476259\rsid12931970\rsid14109446\rsid14166490}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator Dong, Yong}
-{\creatim\yr2010\mo10\dy6\hr16\min18}{\revtim\yr2011\mo9\dy7\hr10\min32}{\version13}{\edmins49}{\nofpages3}{\nofwords681}{\nofchars3883}{\nofcharsws4555}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
-\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\widowctrl\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot14166490 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \hich .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \hich .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \hich .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \hich )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \hich (}{\pntxta \hich )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \hich (}{\pntxta \hich )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \hich (}{\pntxta \hich )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \hich (}{\pntxta \hich )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \hich (}{\pntxta \hich )}}\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0
-\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf18\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 VfrCompile.exe \hich\f39 \endash \loch\f39 Compile the framework VFR and UEFI VFR file to UEFI IFR opcode table and binary.
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Synopsis
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 VfrCompile}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid11950970\delrsid11950970 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11950970 \hich\af39\dbch\af31505\loch\f39 [-o <OutputDir>] [-b] [-l] [-n] [-c]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11950970 \hich\af39\dbch\af31505\loch\f39 <}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 VfrFile}{\rtlch\fcs1
-\ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11950970 \hich\af39\dbch\af31505\loch\f39 >}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14166490
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid9190531 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11500129 \hich\af39\dbch\af31505\loch\f39 VfrCompile.exe \hich\f39
-\endash \loch\f39 h}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid11500129\charrsid8089322
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11500129
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 VfrCompile }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39 parses}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490
-\hich\af39\dbch\af31505\loch\f39 the preprocessed UEFI and Framework VFR file to generate UEFI IFR opcode table, Binary Data and IFR listing file. This tool }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39
-was}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 based on the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39 ANTLR}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\super\insrsid9200893\charrsid12476259 \hich\af39\dbch\af31505\loch\f39 *}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842 \hich\af39\dbch\af31505\loch\f39 (Another Tool for Language Recognition)}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39
-parser to implement VFR syntax parser. The generated UEFI IFR opcode table is stored in autogen VfrFileNameBin.c}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39 . }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39 T}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39
-he global data variable}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6635418 \hich\af39\dbch\af31505\loch\f39 , named}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 VfrFileNameBin}{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 ,}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39
-contains the}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 IFR opcode table. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39
-The generated file will be placed into the output directory sp\hich\af39\dbch\af31505\loch\f39 ecified by -o option. If output directory is not specified, the generate file will be placed in current }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid6635418 \hich\af39\dbch\af31505\loch\f39 directory. The}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39 d}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490
-\hich\af39\dbch\af31505\loch\f39 river source code always uses this global data to register HII form package}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 and show}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490
-\hich\af39\dbch\af31505\loch\f39 this page. The generated UEFI IFR opcode binary f\hich\af39\dbch\af31505\loch\f39 ile is VfrFileName.hpk, which can also be registered into HII Form package. The generated IFR listing file is VfrFileName.lst, which lists
-}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39 the }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 IFR opcode for each VFR statement for debug purpose.
-
-\par \hich\af39\dbch\af31505\loch\f39 This }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39 is not a }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid6635418 \hich\af39\dbch\af31505\loch\f39 standalone. }{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 It is used together with the comp\hich\af39\dbch\af31505\loch\f39 iler preprocessor, }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893
-\hich\af39\dbch\af31505\loch\f39 and }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 EDKII trim too}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893 \hich\af39\dbch\af31505\loch\f39
-. The VFR file is first preprocessed by the cCompiler and the output file is then trimmed to remove the unused definitions}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842 \hich\af39\dbch\af31505\loch\f39
- before being compiled by the VfrCompile tool to generated the UEFI IFR opcode. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid9200893
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Options
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs18
-\ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 VfrFile
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 The input file is }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid1204842 \hich\af39\dbch\af31505\loch\f39 a }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 UEFI or Framework VFR file, which has been preprocessed by }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid1204842 \hich\af39\dbch\af31505\loch\f39 a }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Compiler and}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842
-\hich\af39\dbch\af31505\loch\f39 the}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Trim tool. The generated output file is VfrFileName.c.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 -o DIR, --output-directory DIR
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 All generated files }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid1204842 \hich\af39\dbch\af31505\loch\f39 are}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 placed into output directory. If this option is \hich\af39\dbch\af31505\loch\f39
-not specified, the default output directory is current directory.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 -b, --create-ifr-package
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Create}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842
-\hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 an UEFI IFR Binary HII pack file. The generated file name is VfrFileName.hpk.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 -l create an output IFR listing file
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Create}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842
-\hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 an output IFR listing file (VfrFi\hich\af39\dbch\af31505\loch\f39 leName.lst) to list each IFR opcode for each VFR}{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 statement.}{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0
-\b\f0\fs18\cf1\insrsid14166490
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 -n, --no-pre-processing
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Do not preprocess}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid2570438 \hich\af39\dbch\af31505\loch\f39 t}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842 \hich\af39\dbch\af31505\loch\f39 he}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39
- input vfr file. The input VFR file has been processed. If this option is not specified, the default behavior is same to set this option.
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid83254 \hich\af39\dbch\af31505\loch\f39 Selecting this option disables preprocessing of VFR files. }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid2570438
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 -c, --compatible-framework
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Recognize}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid83254
-\hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 the input VFR file is the framework VFR syntax. If this option is not specified, the UEFI syntax is default }{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid83254 \hich\af39\dbch\af31505\loch\f39 the VFR }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 syntax.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 -h, --help
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Print version and usage of this program and exit.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid12931970 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\insrsid12931970\charrsid6448922 \hich\af39\dbch\af31505\loch\f39 -s, --string-db
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid12931970 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\insrsid12931970\charrsid6448922 \hich\af39\dbch\af31505\loch\f39 Input uni string package file.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid12931970 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\insrsid12931970\charrsid6448922 \hich\af39\dbch\af31505\loch\f39 -g, --guid
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid12931970 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\insrsid12931970\charrsid6448922 \hich\af39\dbch\af31505\loch\f39
-Override class guid input, format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf6\insrsid12931970\charrsid10094212
-\par }\pard \ltrpar\ql \fi360\li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid12931970
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0\pararsid4289583 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\lang1033\langfe2052\langfenp2052\insrsid4289583 {\*\bkmkstart OLE_LINK10}{\*\bkmkstart OLE_LINK11}
-{\*\bkmkstart OLE_LINK3}{\*\bkmkstart OLE_LINK4}{\*\bkmkstart OLE_LINK5}{\*\bkmkstart OLE_LINK6}{\*\bkmkstart OLE_LINK9}{\*\bkmkstart OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Status codes returned}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf18\lang1033\langfe2052\langfenp2052\insrsid4289583\charrsid4999604
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts27\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s25\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts27 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs26\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid4289583
-{\*\bkmkend OLE_LINK10}{\*\bkmkend OLE_LINK11}0\cell }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4289583 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid4289583 \cell }\pard\plain \ltrpar
-\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af37\afs20 \ltrch\fcs0 \fs20\insrsid4289583 \trowd \irow0\irowband0\ltrrow\ts27\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s25\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts27 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs26\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid4289583
-\hich\af2\dbch\af13\loch\f2 Nonzero}{\rtlch\fcs1 \af41\afs19 \ltrch\fcs0 \cs26\f41\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid4289583\charrsid8600807 \cell }\pard \ltrpar\s25\ql \li0\ri20\sb60\sa60\sl-200\slmult0
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid11500129\yts27 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid4289583 \hich\af39\dbch\af13\loch\f39 The action failed.\cell
-}\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0 \fs20\insrsid4289583 \trowd \irow1\irowband1\lastrow \ltrrow\ts27\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10
-\trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8820\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid5911148\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2970\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid14166490 {\*\bkmkend OLE_LINK3}{\*\bkmkend OLE_LINK4}{\*\bkmkend OLE_LINK5}
-{\*\bkmkend OLE_LINK6}{\*\bkmkend OLE_LINK9}{\*\bkmkend OLE_LINK14}\hich\af39\dbch\af31505\loch\f39 Example
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 1. Parse the preprocessed UEFI VFR file (Vfr_Uefi.iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Uefi.c).
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 VfrCompile -n Vfr_Uefi.iii
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 2. Parse the preprocessed UEFI VFR file (Vfr_Uefi.iii) to generate the UEFI IFR opcode table in autoge\hich\af39\dbch\af31505\loch\f39
-n C file (Vfr_Uefi.c) and UEFI IFR Binary File (Vfr_Uefi.hpk)
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 VfrCompile -n -b Vfr_Uefi.iii
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39
-3. Parse the preprocessed UEFI VFR file (Vfr_Uefi.iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Uefi.c) and UEFI IFR Binary File (Vfr_Uefi.hpk) \hich\af39\dbch\af31505\loch\f39 and IFR listing file (Vfr_Uefi.lst)
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 VfrCompile -n -b -l Vfr_Uefi.iii
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 4. Parse the preprocessed Framework VFR file (Vfr_Framework.iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Framework.c).
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 VfrCompile -n -c Vfr_Framework.iii
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid14109446 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\insrsid14109446\charrsid6448922 \hich\af39\dbch\af31505\loch\f39 5. Parse the preprocessed UEFI VFR file (Vfr_Uefi
-\hich\af39\dbch\af31505\loch\f39 .iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Uefi.c), also base on the string token number to get efi varstore name from the string binary file (Vfr_Uefi.hpk).
-\par }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\insrsid14109446\charrsid6448922 \hich\af39\dbch\af31505\loch\f39 VfrCompile -n \hich\f39 \endash \loch\f39 s Vfr_Uefi.hpk Vfr_Uefi.iii
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\insrsid14109446\charrsid6448922 \hich\af39\dbch\af31505\loch\f39 6. Parse the preprocessed UEFI \hich\af39\dbch\af31505\loch\f39
-VFR file (Vfr_Uefi.iii) to generate the UEFI IFR opcode table in autogen C file (Vfr_Uefi.c), also override class guid with the input one.
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\insrsid14109446\charrsid6448922 \hich\af39\dbch\af31505\loch\f39 VfrCompile -n \hich\f39 \endash \loch\f39
-g C153B68D-EBFC-488E-B110-662867745B87 Vfr_Uefi.iii}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\insrsid14109446\charrsid7634258
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 No known }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842 \hich\af39\dbch\af31505\loch\f39 issues}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 .
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-build\hich\af39\dbch\af31505\loch\f39 tools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid14166490
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 See also
-\par }\pard\plain \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 None
-\par }\pard\plain \ltrpar\s2\ql \li-1440\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin-1440\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf18\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 2007 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid1204842 \hich\af39\dbch\af31505\loch\f39 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid12476259 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available
-\par \hich\af39\dbch\af31505\loch\f39 under the terms and conditions of the BSD License which accompanies this
-\par \hich\af39\dbch\af31505\loch\f39 distribution. The full text of the license may be found at
-\par \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par \hich\af39\dbch\af31505\loch\f39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-\par }\pard \ltrpar\ql \li0\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14166490 \hich\af39\dbch\af31505\loch\f39 WITH\hich\af39\dbch\af31505\loch\f39
-OUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid14166490
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000f0d4
-6273066dcc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/UserManuals/VolInfo_Utility_Man_Page.rtf b/BaseTools/UserManuals/VolInfo_Utility_Man_Page.rtf
deleted file mode 100644
index a2ad94694d..0000000000
--- a/BaseTools/UserManuals/VolInfo_Utility_Man_Page.rtf
+++ /dev/null
@@ -1,287 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg936\uc2\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe2052\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
-{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Verdana{\*\falt Verdana};}
-{\f40\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@\'cb\'ce\'cc\'e5;}{\f42\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}
-{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}\'cb\'ce\'cc\'e5{\*\falt SimSun};}
-{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}
-{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}
-{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f177\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f425\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f426\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f428\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f429\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f430\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f431\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f432\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f433\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f434\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f435\fbidi \fswiss\fcharset238\fprq2 Verdana CE{\*\falt Verdana};}{\f436\fbidi \fswiss\fcharset204\fprq2 Verdana Cyr{\*\falt Verdana};}
-{\f438\fbidi \fswiss\fcharset161\fprq2 Verdana Greek{\*\falt Verdana};}{\f439\fbidi \fswiss\fcharset162\fprq2 Verdana Tur{\*\falt Verdana};}{\f442\fbidi \fswiss\fcharset186\fprq2 Verdana Baltic{\*\falt Verdana};}
-{\f443\fbidi \fswiss\fcharset163\fprq2 Verdana (Vietnamese){\*\falt Verdana};}{\f447\fbidi \fnil\fcharset0\fprq2 @\'cb\'ce\'cc\'e5 Western;}{\f465\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f466\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}
-{\f468\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}{\f469\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f472\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f473\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}
-{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
-{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt SimSun};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red8\green96\blue168;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat heading 1;}{\s2\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025
-\ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sqformat heading 2;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
-Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af0\afs32 \ltrch\fcs0 \b\fs32\kerning32\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\ai\af0\afs28 \ltrch\fcs0
-\b\i\fs28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked Heading 2 Char;}{\s17\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
-\fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext17 \slink18 \ssemihidden \sunhideused \styrsid11871115 Balloon Text;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
-\sbasedon10 \slink17 \slocked \ssemihidden \styrsid11871115 Balloon Text Char;}{\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\itap0 \rtlch\fcs1 \af0\afs16\alang1025 \ltrch\fcs0
-\fs16\cf1\lang1033\langfe1033\loch\f39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext19 \spriority0 \styrsid11798724 CellBodyLeft;}{\*\cs20 \additive \b\f2\cf13 \spriority0 \styrsid11798724 CodeCharacter;}{\*\ts21\tsrowd\trbrdrt
-\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
-\sbasedon11 \snext21 \spriority59 \styrsid11798724 Table Grid;}}{\*\rsidtbl \rsid539498\rsid1389978\rsid4999604\rsid5911148\rsid8216522\rsid8600807\rsid11798724\rsid11871115\rsid12198464\rsid13857151\rsid14511453\rsid14812620}{\mmathPr\mmathFont34
-\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator ydliu}{\creatim\yr2010\mo11\dy8\hr15\min32}{\revtim\yr2011\mo8\dy10\hr9\min58}{\version8}{\edmins18}{\nofpages2}{\nofwords433}
-{\nofchars2473}{\nofcharsws2901}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
-\deftab360\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120
-\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale135\rsidroot11871115 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang
-{\pntxta \dbch .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta \dbch .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta \dbch )}}{\*\pnseclvl5
-\pndec\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb \dbch (}{\pntxta \dbch )}}\pard\plain \ltrpar\s2\ql \li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar
-\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Name
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 VolInfo \hich\f39 \endash \loch\f39 Displays the contents of a firmware volume
-\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Synopsis}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid14511453
-\par }\pard\plain \ltrpar\ql \fi360\li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\cufi200\pararsid14812620 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {
-\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14812620 \hich\af39\dbch\af31505\loch\f39 VolInfo [}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14812620 \hich\af39\dbch\af31505\loch\f39
--x <XrefFile>}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14812620 \hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14812620 \hich\af39\dbch\af31505\loch\f39
- [--offset \hich\af39\dbch\af31505\loch\f39 <\hich\af39\dbch\af31505\loch\f39 Offset\hich\af39\dbch\af31505\loch\f39 >\hich\af39\dbch\af31505\loch\f39 ]}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14812620 \hich\af39\dbch\af31505\loch\f39
-}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14812620 \hich\af39\dbch\af31505\loch\f39 <InputFile>}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid14812620\charrsid14812620
-\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Description
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 VolInfo \hich\af39\dbch\af31505\loch\f39 displays the contents of a firmware volume residing in a file for informational purposes.
-\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Options}{\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0
-\b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid14511453
-\par }\pard\plain \ltrpar\ql \fi360\li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0\pararsid11798724 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11798724\charrsid12198464 {\*\bkmkstart OLE_LINK12}{\*\bkmkstart OLE_LINK13}\hich\af39\dbch\af31505\loch\f39 If no options ar}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11798724
-\hich\af39\dbch\af31505\loch\f39 e specified, tool prints usage.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\langfenp2052\insrsid11798724\charrsid11798724 {\*\bkmkend OLE_LINK12}{\*\bkmkend OLE_LINK13}
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 -x xref, --xref xref
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 xref is the path to a file-guid cross reference f
-\hich\af39\dbch\af31505\loch\f39 ile. This file }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 is}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39
- used to provide human readable names to the GUIDs found in the firmware volume.
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0 \b\fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 --offset offset
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39
-offset is the offset within the file to start processing the firmware volume. This }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 is used}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453
-\hich\af39\dbch\af31505\loch\f39 if the specified disk file is a firmware device im\hich\af39\dbch\af31505\loch\f39 age which generally }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 contains}{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 multiple firmware volume}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 s}{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39
-. The offset can be specified as a decimal number or a hexadecimal number (for example, 0x1ffe). If a 'k' suffix is attached to the number, then the number will be multiplied by 1024 (0x400) to turn t\hich\af39\dbch\af31505\loch\f39
-he number into kilobytes.}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14511453
-\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx0\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0\pararsid11798724 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe2052\langfenp2052\insrsid11798724 \hich\af39\dbch\af31505\loch\f39 Status codes returned}{
-\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid11798724\charrsid11798724 {\*\bkmkstart OLE_LINK7}{\*\bkmkstart OLE_LINK8}
-\par \ltrrow}\trowd \irow0\irowband0\ltrrow\ts21\trleft426\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8286\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid11798724\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind534\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2436\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\pard\plain \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts21 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0
-\cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid11798724\charrsid8600807 \hich\af2\dbch\af13\loch\f2 STATUS_SUCCESS}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11798724 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18
-\ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid11798724\charrsid4999604 \tab }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid11798724 0\cell }{\rtlch\fcs1
-\af0 \ltrch\fcs0 \insrsid11798724 \hich\af39\dbch\af13\loch\f39 The action was completed as requested.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \kerning2\insrsid11798724 \cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0
-\fs20\insrsid11798724 \trowd \irow0\irowband0\ltrrow\ts21\trleft426\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8286\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid11798724\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind534\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2436\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row \ltrrow}\pard\plain \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid5911148\yts21 \rtlch\fcs1
-\af0\afs16\alang1025 \ltrch\fcs0 \fs16\cf1\lang1033\langfe1033\loch\af39\hich\af39\dbch\af13\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\kerning2\insrsid11798724\charrsid8600807 \hich\af2\dbch\af13\loch\f2
-STATUS_ERROR}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11798724 \hich\af39\dbch\af13\loch\f39 }{\rtlch\fcs1 \ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid11798724\charrsid4999604 \tab \tab }{\rtlch\fcs1
-\ab\af2\afs18 \ltrch\fcs0 \cs20\b\f2\fs18\cf13\lang1033\langfe2052\kerning2\langfenp2052\insrsid11798724 \hich\af2\dbch\af13\loch\f2 2}{\rtlch\fcs1 \af42\afs19 \ltrch\fcs0
-\cs20\f42\fs19\cf0\lang1033\langfe2052\langfenp2052\insrsid11798724\charrsid8600807 \cell }\pard \ltrpar\s19\ql \li0\ri20\sb60\sa60\sl-200\slmult0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin20\lin0\pararsid8216522\yts21 {
-\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe2052\kerning2\langfenp2052\insrsid11798724 \hich\af39\dbch\af13\loch\f39 The action \hich\af39\dbch\af13\loch\f39 failed.\cell }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af37\afs20 \ltrch\fcs0
-\fs20\insrsid11798724 \trowd \irow1\irowband1\lastrow \ltrrow\ts21\trleft426\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
-\trftsWidth3\trwWidth8286\trftsWidthB3\trftsWidthA3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid11798724\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind534\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl
-\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2436\clshdrawnil\clhidemark \cellx2862\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
-\cltxlrtb\clftsWidth3\clwWidth5850\clshdrawnil\clhidemark \cellx8712\row }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid11798724
-{\*\bkmkend OLE_LINK7}{\*\bkmkend OLE_LINK8}
-\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Examples
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Assume that $(WORKSPACE) is /home/joeuser/src/edk2 an\hich\af39\dbch\af31505\loch\f39 d the firmware volumes have been built into Build/EdkUnix/DEBUG_UNIXGCC/FV}{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 :}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 ~/src/edk2$}{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 VolInfo Build/EdkUnix/DEBUG_UNIXGCC/FV/FVMAIN.fv}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\insrsid14511453
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39
-Assuming that a firmware device image had been built and that the firmware volume of interest resided at byte offset 6\hich\af39\dbch\af31505\loch\f39 5536 of that file, then the following command would show that firmware volume}{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 :}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 ~/src/edk2$ }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 VolInfo --offset 65536 path/to/FV/EDKUNIX.fd}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid14511453
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Or, equivalently,
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 ~/src/edk2$ }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 VolInfo --offset 64k path/to/FV/EDKUNIX.fd}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid14511453
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Or, equivalently,
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 ~/src/edk2$ }{\rtlch\fcs1 \ab\af39\afs18 \ltrch\fcs0
-\b\fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 VolInfo --offs\hich\af39\dbch\af31505\loch\f39 et 0x10000 path/to/FV/EDKUNIX.fd}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid14511453
-\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 GuidedSectionTools.txt
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 This (optional) file is built as part of the edk2 build process. It }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 is}{\rtlch\fcs1
-\af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 generated in the FV directory alongside the firmware volume file. The VolInfo utility }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11871115
-\hich\af39\dbch\af31505\loch\f39 looks}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 for this file alongside the input fi\hich\af39\dbch\af31505\loch\f39 rmware volume file, and if found it will read }{
-\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 its}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 contents to define tools }{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 used}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 for extracting GUID defined firmware volume sections.
-\par \hich\af39\dbch\af31505\loch\f39 Each line contains three tokens separated by whitespace. The three tokens are (in order): 1) the GUID associated with the \hich\af39\dbch\af31505\loch\f39
-tool, 2) a name for the tool, and 3) the path to the tool executable. An example of a possible line from the file:
-\par }\pard \ltrpar\ql \li720\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 a31280ad-481e-41b6-95e8-127f4c984779 TIANO /path/to/TianoCompress
-\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 GuidedSectionTools.txt
-\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Bugs
-\par }\pard\plain \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 No known }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 issues}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453
-\par \hich\af39\dbch\af31505\loch\f39 Report bugs to edk2-bui\hich\af39\dbch\af31505\loch\f39 ldtools-devel@lists.sourceforge.net}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f0\fs18\cf1\insrsid14511453
-\par }\pard \ltrpar\ql \li0\ri0\sb400\sa60\sl-340\slmult0\nowidctlpar\tx1440\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Files
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 GuidedSectionTools.txt
-\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb400\sa60\sl-340\slmult0\keep\keepn\nowidctlpar\tx360\tx1440\wrapdefault\faauto\outlinelevel1\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
-\fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af39\afs28 \ltrch\fcs0 \b\fs28\cf17\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 License
-\par }\pard\plain \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\af39\hich\af39\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 Copyright (c) 1999 - }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid11871115 \hich\af39\dbch\af31505\loch\f39 201}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13857151 \hich\af39\dbch\af31505\loch\f39 1}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 , Intel Corporation. All rights reserved.
-\par
-\par \hich\af39\dbch\af31505\loch\f39 This program and the accompanying materials are licensed and made available under the terms andconditions of the B\hich\af39\dbch\af31505\loch\f39
-SD License which accompanies this distribution. The full text of the license may befound at:}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453\delrsid14511453 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0
-\fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39 http://opensource.org/licenses/bsd-license.php
-\par
-\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0\pararsid13857151 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453 \hich\af39\dbch\af31505\loch\f39
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES}{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid13857151 \hich\af39\dbch\af31505\loch\f39 }{\rtlch\fcs1 \af39\afs18
-\ltrch\fcs0 \fs18\cf1\insrsid13857151 \hich\af39\dbch\af31505\loch\f39 OR REPRESENTATIONS OF ANY\hich\af39\dbch\af31505\loch\f39 KIND, EITHER EXPRESS OR IMPLIED.
-\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\lang1033\langfe2052\langfenp2052\insrsid14511453\charrsid13857151
-\par }{\rtlch\fcs1 \af39\afs18 \ltrch\fcs0 \fs18\cf1\insrsid14511453
-\par }\pard \ltrpar\ql \li360\ri0\sb200\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\lang1033\langfe2052\langfenp2052\insrsid14511453
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
-44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
-6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
-3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
-5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
-b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
-c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
-51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
-b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
-6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
-9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
-b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
-59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
-2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
-656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
-350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
-52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
-73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
-0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
-000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
-0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
-000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
-00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
-4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000c070
-8ffb0057cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file
diff --git a/BaseTools/building-gcc.txt b/BaseTools/building-gcc.txt
deleted file mode 100644
index ed9cecee28..0000000000
--- a/BaseTools/building-gcc.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-To use GCC with the BaseTools project for edk2 based development purposes,
-you will need to build a GCC based cross-compiler (in addition to binutils).
-
-Instructions for building GCC for this purpose can be found under the
-BaseTools source tree. (In addition to the instructions, you will also
-find scripts to help automate the build process.)
-
-If you do not have a tianocore.org account, you can make use of the 'guest'
-account with an empty password.
-
-In a web browser, you can 'browse' the relavent source at this location:
- http://sourceforge.net/p/edk2-buildtools/code/HEAD/tree/trunk/BaseTools/gcc
-
-Or, with subversion, you can download the relavent source with this command:
- svn co https://svn.code.sf.net/p/edk2-buildtools/code/trunk/BaseTools/gcc
diff --git a/BaseTools/gcc/README.txt b/BaseTools/gcc/README.txt
deleted file mode 100644
index ea7dd64576..0000000000
--- a/BaseTools/gcc/README.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-You may run these scripts to build a UEFI/PI gcc cross compiler.
-
-Cross compilers built with these scripts are tested on
-Linux, OS X and Cygwin.
-
-Please note that you may need to modify your edk2 tree's Conf/tools_def.txt
-file to point to the location where you installed the cross compiler.
-
-=== tianoCross-gcc-4.1 ===
-
-This script will build an x86 (ia32) cross compiler.
-
-The results of this script are very similar to the 'mingw' cross compiler
-which is commonly available on linux and OS X. But, since the cross
-compiler produced by this script is tested, it is the only 'supported' way
-to build UEFI/PI images.
-
-To use this script, you will need:
-
- * A recent version (3.0 or later should be fine) of gcc that is able to produce
- executables for the machine that you want to run this compiler on (the host
- machine).
- * wget or curl
- * tar
- * bzip
- * gzip
- * bash
- * As well as (possibly) others tools and development packages
-
-=== x86_64-mingw-gcc-build.py ==
-
-This script will build an x86_64 (x64/Intel 64/amd64) cross compiler.
-
-To use this script, you will need:
-
- * A recent version (3.0 or later should be fine) of gcc that is able to
- produce executables for the machine that you want to run this compiler
- on (the host machine).
- * Python 2.5
- * texinfo
- * bison
- * flex
- * libmpfr
- * libgmp
- * As well as (possibly) others tools and development packages
-
-=== Ubuntu Notes ===
-
-On Ubuntu, the following command should install all the necessary build
-packages to utilize the x86_64-mingw-gcc-build.py script:
-
- sudo apt-get install build-essential texinfo bison flex libgmp3-dev libmpfr-dev
-
-=== CYGWIN Notes ===
-
-You should setup cygwin to use binmode on all mounts. When you initially
-install cygwin it gives you the choice of Unix file mode (recommended) or DOS
-file mode. Unix mode will cause all the cygwin directories to be mounted in
-binmode, while DOS will mount the dirs in textmode. Here is an example of a
-cygwin install where the dirs are (properly) mounted in binmode.
-
-C:\cygwin\bin on /usr/bin type user (binmode)
-C:\cygwin\lib on /usr/lib type user (binmode)
-c:\workspace on /workspace type system (binmode)
-C:\cygwin on / type user (binmode)
-
-If you use textmode, it is likely that the build will fail in a way that is
-hard to debug.
-
-Cygwin is pretty slow, so it is not recommended for large builds.
-
diff --git a/BaseTools/gcc/mingw-gcc-build.py b/BaseTools/gcc/mingw-gcc-build.py
deleted file mode 100755
index 420b3dea80..0000000000
--- a/BaseTools/gcc/mingw-gcc-build.py
+++ /dev/null
@@ -1,564 +0,0 @@
-#!/usr/bin/env python
-
-## @file
-#
-# Automation of instructions from:
-# http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-doc/
-# howto-build/mingw-w64-howto-build.txt?revision=216&view=markup
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-
-from optparse import OptionParser
-import os
-import shutil
-import subprocess
-import sys
-import tarfile
-import urllib
-import urlparse
-try:
- from hashlib import md5
-except Exception:
- from md5 import md5
-
-if sys.version_info < (2, 5):
- #
- # This script (and edk2 BaseTools) require Python 2.5 or newer
- #
- print 'Python version 2.5 or later is required.'
- sys.exit(-1)
-
-#
-# Version and Copyright
-#
-VersionNumber = "0.01"
-__version__ = "%prog Version " + VersionNumber
-__copyright__ = "Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved."
-
-class Config:
- """class Config
-
- Stores the configuration options for the rest of the script.
-
- Handles the command line options, and allows the code within
- the script to easily interact with the 'config' requested by
- the user.
- """
-
- def __init__(self):
- self.base_dir = os.getcwd()
- (self.options, self.args) = self.CheckOptions()
- self.__init_dirs__()
-
- def CheckOptions(self):
- Parser = \
- OptionParser(
- description=__copyright__,
- version=__version__,
- prog="mingw-gcc-build",
- usage="%prog [options] [target]"
- )
- Parser.add_option(
- "--arch",
- action = "store", type = "string",
- default = '',
- dest = "arch",
- help = "Processor architecture to build gcc for."
- )
- Parser.add_option(
- "--src-dir",
- action = "store", type = "string", dest = "src_dir",
- default = os.path.join(self.base_dir, 'src'),
- help = "Directory to download/extract binutils/gcc sources"
- )
- Parser.add_option(
- "--build-dir",
- action = "store", type = "string", dest = "build_dir",
- default = os.path.join(self.base_dir, 'build'),
- help = "Directory to download/extract binutils/gcc sources"
- )
- Parser.add_option(
- "--prefix",
- action = "store", type = "string", dest = "prefix",
- default = os.path.join(self.base_dir, 'install'),
- help = "Prefix to install binutils/gcc into"
- )
- Parser.add_option(
- "--skip-binutils",
- action = "store_true", dest = "skip_binutils",
- default = False,
- help = "Will skip building binutils"
- )
- Parser.add_option(
- "--skip-gcc",
- action = "store_true", dest = "skip_gcc",
- default = False,
- help = "Will skip building GCC"
- )
- Parser.add_option(
- "--symlinks",
- action = "store", type = "string", dest = "symlinks",
- default = os.path.join(self.base_dir, 'symlinks'),
- help = "Directory to create binutils/gcc symbolic links into."
- )
- Parser.add_option(
- "-v", "--verbose",
- action="store_true",
- type=None, help="Print verbose messages"
- )
-
- (Opt, Args) = Parser.parse_args()
-
- self.arch = Opt.arch.lower()
- allowedArchs = ('ia32', 'x64', 'ipf')
- if self.arch not in allowedArchs:
- Parser.error(
- 'Please use --arch to specify one of: %s' %
- ', '.join(allowedArchs)
- )
- self.target_arch = {'ia32': 'i686', 'x64': 'x86_64', 'ipf': 'ia64'}[self.arch]
- self.target_sys = {'ia32': 'pc', 'x64': 'pc', 'ipf': 'pc'}[self.arch]
- self.target_bin = {'ia32': 'mingw32', 'x64': 'mingw32', 'ipf': 'elf'}[self.arch]
- self.target_combo = '-'.join((self.target_arch, self.target_sys, self.target_bin))
-
- return (Opt, Args)
-
- def __init_dirs__(self):
- self.src_dir = os.path.realpath(os.path.expanduser(self.options.src_dir))
- self.build_dir = os.path.realpath(os.path.expanduser(self.options.build_dir))
- self.prefix = os.path.realpath(os.path.expanduser(self.options.prefix))
- self.symlinks = os.path.realpath(os.path.expanduser(self.options.symlinks))
-
- def IsConfigOk(self):
-
- building = []
- if not self.options.skip_binutils:
- building.append('binutils')
- if not self.options.skip_gcc:
- building.append('gcc')
- if len(building) == 0:
- print "Nothing will be built!"
- print
- print "Please try using --help and then change the configuration."
- return False
-
- print "Current directory:"
- print " ", self.base_dir
- print "Sources download/extraction:", self.Relative(self.src_dir)
- print "Build directory :", self.Relative(self.build_dir)
- print "Prefix (install) directory :", self.Relative(self.prefix)
- print "Create symlinks directory :", self.Relative(self.symlinks)
- print "Building :", ', '.join(building)
- print
- answer = raw_input("Is this configuration ok? (default = no): ")
- if (answer.lower() not in ('y', 'yes')):
- print
- print "Please try using --help and then change the configuration."
- return False
-
- if self.arch.lower() == 'ipf':
- print
- print 'Please note that the IPF compiler built by this script has'
- print 'not yet been validated!'
- print
- answer = raw_input("Are you sure you want to build it? (default = no): ")
- if (answer.lower() not in ('y', 'yes')):
- print
- print "Please try using --help and then change the configuration."
- return False
-
- print
- return True
-
- def Relative(self, path):
- if path.startswith(self.base_dir):
- return '.' + path[len(self.base_dir):]
- return path
-
- def MakeDirs(self):
- for path in (self.src_dir, self.build_dir,self.prefix, self.symlinks):
- if not os.path.exists(path):
- os.makedirs(path)
-
-class SourceFiles:
- """class SourceFiles
-
- Handles the downloading of source files used by the script.
- """
-
- def __init__(self, config):
- self.config = config
- self.source_files = self.source_files[config.arch]
-
- if config.options.skip_binutils:
- del self.source_files['binutils']
-
- if config.options.skip_gcc:
- del self.source_files['gcc']
- del self.source_files['mingw_hdr']
-
- source_files_common = {
- 'binutils': {
- 'url': 'http://www.kernel.org/pub/linux/devel/binutils/' + \
- 'binutils-$version.tar.bz2',
- 'version': '2.20.51.0.5',
- 'md5': '6d2de7cdf7a8389e70b124e3d73b4d37',
- },
- }
-
- source_files_x64 = {
- 'gcc': {
- 'url': 'http://ftpmirror.gnu.org/gcc/' + \
- 'gcc-$version/gcc-$version.tar.bz2',
- 'version': '4.3.0',
- 'md5': '197ed8468b38db1d3481c3111691d85b',
- },
- }
-
- source_files_ia32 = {
- 'gcc': source_files_x64['gcc'],
- }
-
- source_files_ipf = source_files_x64.copy()
- source_files_ipf['gcc']['configure-params'] = (
- '--with-gnu-as', '--with-gnu-ld', '--with-newlib',
- '--verbose', '--disable-libssp', '--disable-nls',
- '--enable-languages=c,c++'
- )
-
- source_files = {
- 'ia32': [source_files_common, source_files_ia32],
- 'x64': [source_files_common, source_files_x64],
- 'ipf': [source_files_common, source_files_ipf],
- }
-
- for arch in source_files:
- mergedSourceFiles = {}
- for source_files_dict in source_files[arch]:
- mergedSourceFiles.update(source_files_dict)
- for downloadItem in mergedSourceFiles:
- fdata = mergedSourceFiles[downloadItem]
- fdata['filename'] = fdata['url'].split('/')[-1]
- if 'extract-dir' not in fdata:
- for ext in ('.tar.gz', '.tar.bz2', '.zip'):
- if fdata['filename'].endswith(ext):
- fdata['extract-dir'] = fdata['filename'][:-len(ext)]
- break
- replaceables = ('extract-dir', 'filename', 'url')
- for replaceItem in fdata:
- if replaceItem in replaceables: continue
- if type(fdata[replaceItem]) != str: continue
- for replaceable in replaceables:
- if type(fdata[replaceable]) != str: continue
- if replaceable in fdata:
- fdata[replaceable] = \
- fdata[replaceable].replace(
- '$' + replaceItem,
- fdata[replaceItem]
- )
- source_files[arch] = mergedSourceFiles
- #print 'source_files:', source_files
-
- def GetAll(self):
-
- def progress(received, blockSize, fileSize):
- if fileSize < 0: return
- wDots = (100 * received * blockSize) / fileSize / 10
- if wDots > self.dots:
- for i in range(wDots - self.dots):
- print '.',
- sys.stdout.flush()
- self.dots += 1
-
- maxRetries = 1
- for (fname, fdata) in self.source_files.items():
- for retries in range(maxRetries):
- try:
- self.dots = 0
- local_file = os.path.join(self.config.src_dir, fdata['filename'])
- url = fdata['url']
- print 'Downloading %s:' % fname, url
- if retries > 0:
- print '(retry)',
- sys.stdout.flush()
-
- completed = False
- if os.path.exists(local_file):
- md5_pass = self.checkHash(fdata)
- if md5_pass:
- print '[md5 match]',
- else:
- print '[md5 mismatch]',
- sys.stdout.flush()
- completed = md5_pass
-
- if not completed:
- urllib.urlretrieve(url, local_file, progress)
-
- #
- # BUGBUG: Suggest proxy to user if download fails.
- #
- # export http_proxy=http://proxyservername.mycompany.com:911
- # export ftp_proxy=http://proxyservername.mycompany.com:911
-
- if not completed and os.path.exists(local_file):
- md5_pass = self.checkHash(fdata)
- if md5_pass:
- print '[md5 match]',
- else:
- print '[md5 mismatch]',
- sys.stdout.flush()
- completed = md5_pass
-
- if completed:
- print '[done]'
- break
- else:
- print '[failed]'
- print ' Tried to retrieve', url
- print ' to', local_file
- print 'Possible fixes:'
- print '* If you are behind a web-proxy, try setting the',
- print 'http_proxy environment variable'
- print '* You can try to download this file separately',
- print 'and rerun this script'
- raise Exception()
-
- except KeyboardInterrupt:
- print '[KeyboardInterrupt]'
- return False
-
- except Exception, e:
- print e
-
- if not completed: return False
-
- return True
-
- def checkHash(self, fdata):
- local_file = os.path.join(self.config.src_dir, fdata['filename'])
- expect_md5 = fdata['md5']
- data = open(local_file).read()
- md5sum = md5()
- md5sum.update(data)
- return md5sum.hexdigest().lower() == expect_md5.lower()
-
- def GetModules(self):
- return self.source_files.keys()
-
- def GetFilenameOf(self, module):
- return self.source_files[module]['filename']
-
- def GetMd5Of(self, module):
- return self.source_files[module]['md5']
-
- def GetExtractDirOf(self, module):
- return self.source_files[module]['extract-dir']
-
- def GetAdditionalParameters(self, module, step):
- key = step + '-params'
- if key in self.source_files[module]:
- return self.source_files[module][key]
- else:
- return tuple()
-
-class Extracter:
- """class Extracter
-
- Handles the extraction of the source files from their downloaded
- archive files.
- """
-
- def __init__(self, source_files, config):
- self.source_files = source_files
- self.config = config
-
- def Extract(self, module):
- src = self.config.src_dir
- extractDst = os.path.join(src, self.config.arch)
- local_file = os.path.join(src, self.source_files.GetFilenameOf(module))
- moduleMd5 = self.source_files.GetMd5Of(module)
- extracted = os.path.join(extractDst, os.path.split(local_file)[1] + '.extracted')
- if not os.path.exists(extractDst):
- os.mkdir(extractDst)
-
- extractedMd5 = None
- if os.path.exists(extracted):
- extractedMd5 = open(extracted).read()
-
- if extractedMd5 != moduleMd5:
- print 'Extracting %s:' % self.config.Relative(local_file)
- tar = tarfile.open(local_file)
- tar.extractall(extractDst)
- open(extracted, 'w').write(moduleMd5)
- else:
- pass
- #print 'Previously extracted', self.config.Relative(local_file)
-
- def ExtractAll(self):
- for module in self.source_files.GetModules():
- self.Extract(module)
-
-class Builder:
- """class Builder
-
- Builds and installs the GCC tool suite.
- """
-
- def __init__(self, source_files, config):
- self.source_files = source_files
- self.config = config
-
- def Build(self):
- if not self.config.options.skip_binutils:
- self.BuildModule('binutils')
- if not self.config.options.skip_gcc:
- self.BuildModule('gcc')
- self.MakeSymLinks()
-
- def IsBuildStepComplete(self, step):
- return \
- os.path.exists(
- os.path.join(
- self.config.build_dir, self.config.arch, step + '.completed'
- )
- )
-
- def MarkBuildStepComplete(self, step):
- open(
- os.path.join(
- self.config.build_dir, self.config.arch, step + '.completed'
- ),
- "w"
- ).close()
-
-
- def BuildModule(self, module):
- base_dir = os.getcwd()
- build_dir = os.path.join(self.config.build_dir, self.config.arch, module)
- module_dir = self.source_files.GetExtractDirOf(module)
- module_dir = os.path.realpath(os.path.join('src', self.config.arch, module_dir))
- configure = os.path.join(module_dir, 'configure')
- prefix = self.config.prefix
- if not os.path.exists(build_dir):
- os.makedirs(build_dir)
- os.chdir(build_dir)
-
- cmd = (
- configure,
- '--target=%s' % self.config.target_combo,
- '--prefix=' + prefix,
- '--with-sysroot=' + prefix,
- '--disable-werror',
- )
- if os.path.exists('/opt/local/include/gmp.h'):
- cmd += ('--with-gmp=/opt/local',)
- if module == 'gcc': cmd += ('--oldincludedir=/opt/local/include',)
- cmd += self.source_files.GetAdditionalParameters(module, 'configure')
- self.RunCommand(cmd, module, 'config', skipable=True)
-
- cmd = ('make',)
- if module == 'gcc':
- cmd += ('all-gcc',)
- self.RunCommand(cmd, module, 'build')
-
- cmd = ('make',)
- if module == 'gcc':
- cmd += ('install-gcc',)
- else:
- cmd += ('install',)
- self.RunCommand(cmd, module, 'install')
-
- os.chdir(base_dir)
-
- print '%s module is now built and installed' % module
-
- def RunCommand(self, cmd, module, stage, skipable=False):
- if skipable:
- if self.IsBuildStepComplete('%s.%s' % (module, stage)):
- return
-
- popen = lambda cmd: \
- subprocess.Popen(
- cmd,
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT
- )
-
- print '%s [%s] ...' % (module, stage),
- sys.stdout.flush()
- p = popen(cmd)
- output = p.stdout.read()
- p.wait()
- if p.returncode != 0:
- print '[failed!]'
- logFile = os.path.join(self.config.build_dir, 'log.txt')
- f = open(logFile, "w")
- f.write(output)
- f.close()
- raise Exception, 'Failed to %s %s\n' % (stage, module) + \
- 'See output log at %s' % self.config.Relative(logFile)
- else:
- print '[done]'
-
- if skipable:
- self.MarkBuildStepComplete('%s.%s' % (module, stage))
-
- def MakeSymLinks(self):
- links_dir = os.path.join(self.config.symlinks, self.config.arch)
- if not os.path.exists(links_dir):
- os.makedirs(links_dir)
- startPrinted = False
- for link in ('ar', 'ld', 'gcc'):
- src = os.path.join(
- self.config.prefix, 'bin', self.config.target_combo + '-' + link
- )
- linkdst = os.path.join(links_dir, link)
- if not os.path.lexists(linkdst):
- if not startPrinted:
- print 'Making symlinks in %s:' % self.config.Relative(links_dir),
- startPrinted = True
- print link,
- os.symlink(src, linkdst)
-
- if startPrinted:
- print '[done]'
-
-class App:
- """class App
-
- The main body of the application.
- """
-
- def __init__(self):
- config = Config()
-
- if not config.IsConfigOk():
- return
-
- config.MakeDirs()
-
- sources = SourceFiles(config)
- result = sources.GetAll()
- if result:
- print 'All files have been downloaded & verified'
- else:
- print 'An error occured while downloading a file'
- return
-
- Extracter(sources, config).ExtractAll()
-
- Builder(sources, config).Build()
-
-App()
-
diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
deleted file mode 100755
index 98d0247aa1..0000000000
--- a/BaseTools/toolsetup.bat
+++ /dev/null
@@ -1,374 +0,0 @@
-@REM @file
-@REM This stand-alone program is typically called by the edksetup.bat file,
-@REM however it may be executed directly from the BaseTools project folder
-@REM if the file is not executed within a WORKSPACE\BaseTools folder.
-@REM
-@REM Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
-@REM
-@REM This program and the accompanying materials are licensed and made available
-@REM under the terms and conditions of the BSD License which accompanies this
-@REM distribution. The full text of the license may be found at:
-@REM http://opensource.org/licenses/bsd-license.php
-@REM
-@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
-@REM IMPLIED.
-@REM
-
-@echo off
-pushd .
-
-@REM ##############################################################
-@REM # You should not have to modify anything below this line
-@REM #
-
-@if /I "%1"=="-h" goto Usage
-@if /I "%1"=="-help" goto Usage
-@if /I "%1"=="--help" goto Usage
-@if /I "%1"=="/h" goto Usage
-@if /I "%1"=="/help" goto Usage
-@if /I "%1"=="/?" goto Usage
-
-
-:loop
- @if "%1"=="" goto setup_workspace
- @if /I "%1"=="--nt32" (
- @REM Ignore --nt32 flag
- shift
- goto loop
- )
- @if /I "%1"=="Reconfig" (
- shift
- set RECONFIG=TRUE
- goto loop
- )
- @if /I "%1"=="Rebuild" (
- shift
- set REBUILD=TRUE
- goto loop
- )
- @if /I "%1"=="ForceRebuild" (
- shift
- set FORCE_REBUILD=TRUE
- goto loop
- )
- if "%1"=="" goto setup_workspace
- if exist %1 (
- if not defined BASE_TOOLS_PATH (
- if exist %1\Source set BASE_TOOLS_PATH=%1
- shift
- goto loop
- )
- if not defined EDK_TOOLS_PATH (
- if exist %1\Bin\Win32 set EDK_TOOLS_PATH=%1
- shift
- goto loop
- )
- echo.
- echo !!! ERROR !!! Unknown argument, %1 !!!
- echo.
- goto end
- ) else (
- echo.
- echo !!! ERROR !!! Unknown argument, %1 !!!
- echo.
- goto end
- )
- goto loop
-
-
-@REM
-@REM Check the required system environment variables
-@REM
-
-:setup_workspace
- REM
- REM check the EDK_TOOLS_PATH
- REM
- if not defined EDK_TOOLS_PATH goto no_EDK_TOOLS_PATH
- if exist %EDK_TOOLS_PATH% goto set_PATH
-
-:no_EDK_TOOLS_PATH
- if not defined WORKSPACE (
- if defined BASE_TOOLS_PATH (
- set EDK_TOOLS_PATH=%BASE_TOOLS_PATH%
- goto set_PATH
- ) else (
- echo.
- echo !!! ERROR !!! Neither BASE_TOOLS_PATH nor EDK_TOOLS_PATH are set. !!!
- echo.
- goto end
- )
- ) else (
- if exist %WORKSPACE%\BaseTools\Bin (
- set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
- goto set_PATH
- ) else (
- echo.
- echo !!! ERROR !!! No tools path available. Please set EDK_TOOLS_PATH !!!
- echo.
- goto end
- )
- )
-
-:set_PATH
- if defined WORKSPACE_TOOLS_PATH goto check_PATH
- set PATH=%EDK_TOOLS_PATH%\Bin;%EDK_TOOLS_PATH%\Bin\Win32;%PATH%
- set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
- goto PATH_ok
-
-:check_PATH
- if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto PATH_ok
- set PATH=%EDK_TOOLS_PATH%\Bin;%EDK_TOOLS_PATH%\Bin\Win32;%PATH%
- set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%
- echo Resetting the PATH variable to include the EDK_TOOLS_PATH for this session.
-
-:PATH_ok
- echo PATH = %PATH%
- echo.
- if defined WORKSPACE (
- echo WORKSPACE = %WORKSPACE%
- )
- echo EDK_TOOLS_PATH = %EDK_TOOLS_PATH%
- if defined BASE_TOOLS_PATH (
- echo BASE_TOOLS_PATH = %BASE_TOOLS_PATH%
- )
- echo.
-
-REM
-REM copy *.template to %WORKSPACE%\Conf
-REM
-if not defined WORKSPACE (
- if defined RECONFIG (
- echo.
- echo !!! WARNING !!! WORKSPACE environment variable was not set, cannot Reconfig !!!
- echo.
- )
- goto skip_reconfig
-)
-
-if NOT exist %WORKSPACE%\Conf (
- mkdir %WORKSPACE%\Conf
-) else (
- if defined RECONFIG (
- echo.
- echo Over-writing the files in the WORKSPACE\Conf directory
- echo using the default template files
- echo.
- )
-)
-
-if NOT exist %WORKSPACE%\Conf\target.txt (
- echo copying ... target.template to %WORKSPACE%\Conf\target.txt
- if NOT exist %EDK_TOOLS_PATH%\Conf\target.template (
- echo Error: target.template is missing at folder %EDK_TOOLS_PATH%\Conf\
- )
- copy %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul
-) else (
- if defined RECONFIG echo over-write ... target.template to %WORKSPACE%\Conf\target.txt
- if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul
-)
-
-if NOT exist %WORKSPACE%\Conf\tools_def.txt (
- echo copying ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt
- if NOT exist %EDK_TOOLS_PATH%\Conf\tools_def.template (
- echo Error: tools_def.template is missing at folder %EDK_TOOLS_PATH%\Conf\
- )
- copy %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul
-) else (
- if defined RECONFIG echo over-write ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt
- if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul
-)
-
-if NOT exist %WORKSPACE%\Conf\build_rule.txt (
- echo copying ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt
- if NOT exist %EDK_TOOLS_PATH%\Conf\build_rule.template (
- echo Error: build_rule.template is missing at folder %EDK_TOOLS_PATH%\Conf\
- )
- copy %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul
-) else (
- if defined RECONFIG echo over-write ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt
- if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul
-)
-
-:skip_reconfig
-
-@REM
-@REM Test if we are going to have to do a build
-@REM
-if defined FORCE_REBUILD goto check_build_environment
-if defined REBUILD goto check_build_environment
-if not exist "%EDK_TOOLS_PATH%\Bin" goto check_build_environment
-
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\BootSectImage.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\build.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\EfiLdrImage.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\EfiRom.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenBootSector.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFds.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFfs.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFv.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenFw.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenPage.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenSec.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\GenVtf.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\MigrationMsa2Inf.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Split.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\TargetTool.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\TianoCompress.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Trim.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\VfrCompile.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\Fpd2Dsc.exe" goto check_build_environment
-IF NOT EXIST "%EDK_TOOLS_PATH%\Bin\Win32\VolInfo.exe" goto check_build_environment
-
-goto end
-
-:check_build_environment
-
- if not defined FORCE_REBUILD (
- echo.
- echo Rebuilding of tools is not required. Binaries of the latest,
- echo tested versions of the tools have been tested and included in the
- echo EDK II repository.
- echo.
- echo If you really want to build the tools, use the ForceRebuild option.
- echo.
- goto end
- )
-
- if not defined BASE_TOOLS_PATH (
- if not exist "Source\C\Makefile" (
- if not exist "%EDK_TOOLS_PATH%\Source\C\Makefile" goto no_source_files
- set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%
- ) else (
- set BASE_TOOLS_PATH=%CD%
- )
- )
- set PATH=%BASE_TOOLS_PATH%\Bin\Win32;%PATH%
-
- set PYTHONPATH=%BASE_TOOLS_PATH%\Source\Python
-
- if not defined PYTHON_HOME (
- if defined PYTHONHOME (
- set PYTHON_HOME=%PYTHONHOME%
- ) else (
- echo.
- echo !!! ERROR !!! PYTHON_HOME is required to build or execute the tools, please set it. !!!
- echo.
- goto end
- )
- )
-
- @REM We have Python, now test for FreezePython application
- if not defined PYTHON_FREEZER_PATH (
- @REM see if we can find FreezePython.ex
- if exist "%PYTHON_HOME%\Tools\cx_Freeze-3.0.3\FreezePython.exe" (
- set PYTHON_FREEZER_PATH=%PYTHON_HOME%\Tools\cx_Freeze-3.0.3
- )
- if exist "%PYTHON_HOME%\Tools\cx_Freeze\FreezePython.exe" (
- set PYTHON_FREEZER_PATH=%PYTHON_HOME%\Tools\cx_Freeze
- )
- if exist "C:\cx_Freeze\FreezePython.exe" (
- set PYTHON_FREEZER_PATH=C:\cx_Freeze
- )
- if exist "C:\cx_Freeze-3.0.3" (
- set PYTHON_FREEZER_PATH=C:\cx_Freeze-3.0.3
- )
- if not defined PYTHON_FREEZER_PATH (
- echo.
- echo !!! WARNING !!! Will not be able to compile Python programs to .exe
- echo Will setup environment to run Python scripts directly.
- echo.
- set PYTHONPATH=%BASE_TOOLS_PATH%\Source\Python
- set PATH=%PYTHONPATH%\build;%PYTHONPATH%\GenFds;%PYTHONPATH%\Trim;%PATH%
- set PATHEXT=%PATHEXT%;.py
- )
- )
-
- echo BASE_TOOLS_PATH = %BASE_TOOLS_PATH%
- echo PYTHON_PATH = %PYTHON_PATH%
- echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%
- echo.
-
- if defined VCINSTALLDIR goto VisualStudioAvailable
- if defined VS100COMNTOOLS (
- call "%VS100COMNTOOLS%\vsvars32.bat"
- ) else (
- if defined VS90COMNTOOLS (
- call "%VS90COMNTOOLS%\vsvars32.bat"
- ) else (
- if defined VS80COMNTOOLS (
- call "%VS80COMNTOOLS%\vsvars32.bat"
- ) else (
- if defined VS71COMNTOOLS (
- call "%VS71COMNTOOLS%\vsvars32.bat"
- ) else (
- echo.
- echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!!
- echo.
- goto end
- )
- )
- )
- )
-
-:VisualStudioAvailable
- if defined FORCE_REBUILD goto CleanAndBuild
- goto IncrementalBuild
-
-:CleanAndBuild
- pushd .
- cd %BASE_TOOLS_PATH%
- call nmake cleanall
- del /f /q %BASE_TOOLS_PATH%\Bin\Win32\*.*
- popd
- @REM Let CleanAndBuild fall through to IncrementalBuild
-
-
-:IncrementalBuild
- pushd .
- cd %BASE_TOOLS_PATH%
- call nmake c
- popd
-
- if defined PYTHON_FREEZER_PATH (
- echo BUILDING PYTHON TOOLS
- pushd .
- cd %BASE_TOOLS_PATH%
- call nmake python
- popd
- ) else (
- echo.
- echo !!! WARNING !!! Cannot make executable from Python code, executing python scripts instead !!!
- echo.
- )
- goto end
-
-
-:no_source_files
- echo.
- echo !!! ERROR !!! Cannot build BaseTools applications - no source directory located !!!
- echo.
- goto end
-
-:Usage
- echo.
- echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]"
- echo.
- echo base_tools_path BaseTools project path, BASE_TOOLS_PATH will be set to this path.
- echo edk_tools_path EDK_TOOLS_PATH will be set to this path.
- echo Rebuild If sources are available perform an Incremental build, only
- echo build those updated tools.
- echo ForceRebuild If sources are available, rebuild all tools regardless of
- echo whether they have been updated or not.
- echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.
-echo.
-
-:end
-set REBUILD=
-set FORCE_REBUILD=
-set RECONFIG=
-popd
-
-@echo on
-
diff --git a/ShellBinPkg/MinUefiShell/Ia32/Shell.efi b/ShellBinPkg/MinUefiShell/Ia32/Shell.efi
deleted file mode 100644
index e1268cd785..0000000000
--- a/ShellBinPkg/MinUefiShell/Ia32/Shell.efi
+++ /dev/null
Binary files differ
diff --git a/ShellBinPkg/MinUefiShell/Ia32/profiles.txt b/ShellBinPkg/MinUefiShell/Ia32/profiles.txt
deleted file mode 100644
index 912cee8a89..0000000000
--- a/ShellBinPkg/MinUefiShell/Ia32/profiles.txt
+++ /dev/null
@@ -1 +0,0 @@
-this release includes:
diff --git a/ShellBinPkg/MinUefiShell/MinUefiShell.inf b/ShellBinPkg/MinUefiShell/MinUefiShell.inf
deleted file mode 100644
index bb9e26e322..0000000000
--- a/ShellBinPkg/MinUefiShell/MinUefiShell.inf
+++ /dev/null
@@ -1,29 +0,0 @@
-## @file
-# This is the UEFI Shell application binary file.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = Shell
- FILE_GUID = 7C04A583-9E3E-4f1c-AD65-E05268D0B4D1
- MODULE_TYPE = UEFI_APPLICATION
- VERSION_STRING = 1.0
-
-[Binaries.Ia32]
- PE32|Ia32/Shell.efi|*
-
-[Binaries.X64]
- PE32|X64/Shell.efi|*
-
diff --git a/ShellBinPkg/MinUefiShell/X64/Shell.efi b/ShellBinPkg/MinUefiShell/X64/Shell.efi
deleted file mode 100644
index 858a377bda..0000000000
--- a/ShellBinPkg/MinUefiShell/X64/Shell.efi
+++ /dev/null
Binary files differ
diff --git a/ShellBinPkg/MinUefiShell/X64/profiles.txt b/ShellBinPkg/MinUefiShell/X64/profiles.txt
deleted file mode 100644
index 912cee8a89..0000000000
--- a/ShellBinPkg/MinUefiShell/X64/profiles.txt
+++ /dev/null
@@ -1 +0,0 @@
-this release includes:
diff --git a/ShellBinPkg/ReadMe.txt b/ShellBinPkg/ReadMe.txt
deleted file mode 100644
index e64c4e0938..0000000000
--- a/ShellBinPkg/ReadMe.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-============================================================================
- OVERVIEW
-============================================================================
-The binaries of ShellBinPkg are generated with ShellPkg project and built with
-BaseTools Package (r13224). The binaries are built with no debug information
-by building with "RELEASE" target.
-
-The following steps can help to re-generate these binaries for customization:
-1. Check out EDK II to $(WORKSPACE)
-(svn https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2).
-
-2. Under $(WORKSPACE) directory (i.e. c:\EdkII),
- To generate Shell, execute:
- "build -a IA32 -a X64 -p ShellPkg\ShellPkg.dsc -b RELEASE"
- To generate Minimal Shell, execute:
- "build -a IA32 -a X64 -p ShellPkg\ShellPkg.dsc -b RELEASE -D NO_SHELL_PROFILES"
-
-============================================================================
- HOW TO INCORPORATE THIS SHELL INTO NT32
-============================================================================
-The instructions below are included as a sample and template on how a
-developer may integrate this code into an existing platform:
-
-1. Update system PCDs to support this new module
- Update the PCD as follows using the Shell's PCD:
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5,
- 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0,
- 0xB4, 0xD1 }
-
-2. Remove the old shell from the NT32 Firmware list
- Remove the FILE APPLICATION section for the old shell.
-
-3. Add this shell to the NT32 firmware list
- Add the Shell.INF to the end of the list of DXE modules.
-
-4. Build NT32
-
-============================================================================
- KNOWN LIMITATIONS
-============================================================================
-1. RM can delete current working directory via other map name.
-2. DrvCfg does not overlap boot manager functionality.
-3. Shell documentation is in development and forthcoming.
-
-============================================================================
diff --git a/ShellBinPkg/ShellBinPkg.dec b/ShellBinPkg/ShellBinPkg.dec
deleted file mode 100644
index 34575ab15b..0000000000
--- a/ShellBinPkg/ShellBinPkg.dec
+++ /dev/null
@@ -1,21 +0,0 @@
-## @file
-# UEFI 2.0 Shell Binary Package
-#
-# This package contains binary shell application that follows
-# UEFI specification and UEFI Shell 2.0 specification.
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this distribution.
-# The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES
-# OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- DEC_SPECIFICATION = 0x00010005
- PACKAGE_NAME = ShellBinPkg
- PACKAGE_GUID = 4B34AD9D-1324-41e5-8B1D-359AA7BCA62C
- PACKAGE_VERSION = 0.5
-
diff --git a/ShellBinPkg/UefiShell/Ia32/Shell.efi b/ShellBinPkg/UefiShell/Ia32/Shell.efi
deleted file mode 100644
index afdb071fab..0000000000
--- a/ShellBinPkg/UefiShell/Ia32/Shell.efi
+++ /dev/null
Binary files differ
diff --git a/ShellBinPkg/UefiShell/Ia32/profiles.txt b/ShellBinPkg/UefiShell/Ia32/profiles.txt
deleted file mode 100644
index 0739839e4d..0000000000
--- a/ShellBinPkg/UefiShell/Ia32/profiles.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-this release includes:
-
-Drivers1
-Debug1
-Network1
-Install1 \ No newline at end of file
diff --git a/ShellBinPkg/UefiShell/UefiShell.inf b/ShellBinPkg/UefiShell/UefiShell.inf
deleted file mode 100644
index bb9e26e322..0000000000
--- a/ShellBinPkg/UefiShell/UefiShell.inf
+++ /dev/null
@@ -1,29 +0,0 @@
-## @file
-# This is the UEFI Shell application binary file.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = Shell
- FILE_GUID = 7C04A583-9E3E-4f1c-AD65-E05268D0B4D1
- MODULE_TYPE = UEFI_APPLICATION
- VERSION_STRING = 1.0
-
-[Binaries.Ia32]
- PE32|Ia32/Shell.efi|*
-
-[Binaries.X64]
- PE32|X64/Shell.efi|*
-
diff --git a/ShellBinPkg/UefiShell/X64/Shell.efi b/ShellBinPkg/UefiShell/X64/Shell.efi
deleted file mode 100644
index 7667a07f49..0000000000
--- a/ShellBinPkg/UefiShell/X64/Shell.efi
+++ /dev/null
Binary files differ
diff --git a/ShellBinPkg/UefiShell/X64/profiles.txt b/ShellBinPkg/UefiShell/X64/profiles.txt
deleted file mode 100644
index 0739839e4d..0000000000
--- a/ShellBinPkg/UefiShell/X64/profiles.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-this release includes:
-
-Drivers1
-Debug1
-Network1
-Install1 \ No newline at end of file
diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c b/ShellPkg/Application/Shell/ConsoleLogger.c
deleted file mode 100644
index 1c5ad7def2..0000000000
--- a/ShellPkg/Application/Shell/ConsoleLogger.c
+++ /dev/null
@@ -1,1197 +0,0 @@
-/** @file
- Provides interface to shell console logger.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#include "ConsoleLogger.h"
-#include "Shell.h"
-
-STATIC CONST CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };
-
-/**
- Install our intermediate ConOut into the system table to
- keep a log of all the info that is displayed to the user.
-
- @param[in] ScreensToSave Sets how many screen-worths of data to save.
- @param[out] ConsoleInfo The object to pass into later functions.
-
- @retval EFI_SUCCESS The operation was successful.
- @return other The operation failed.
-
- @sa ConsoleLoggerResetBuffers
- @sa InstallProtocolInterface
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerInstall(
- IN CONST UINTN ScreensToSave,
- OUT CONSOLE_LOGGER_PRIVATE_DATA **ConsoleInfo
- )
-{
- EFI_STATUS Status;
- ASSERT(ConsoleInfo != NULL);
-
- (*ConsoleInfo) = AllocateZeroPool(sizeof(CONSOLE_LOGGER_PRIVATE_DATA));
- if ((*ConsoleInfo) == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- (*ConsoleInfo)->Signature = CONSOLE_LOGGER_PRIVATE_DATA_SIGNATURE;
- (*ConsoleInfo)->OldConOut = gST->ConOut;
- (*ConsoleInfo)->OldConHandle = gST->ConsoleOutHandle;
- (*ConsoleInfo)->Buffer = NULL;
- (*ConsoleInfo)->BufferSize = 0;
- (*ConsoleInfo)->OriginalStartRow = 0;
- (*ConsoleInfo)->CurrentStartRow = 0;
- (*ConsoleInfo)->RowsPerScreen = 0;
- (*ConsoleInfo)->ColsPerScreen = 0;
- (*ConsoleInfo)->Attributes = NULL;
- (*ConsoleInfo)->AttribSize = 0;
- (*ConsoleInfo)->ScreenCount = ScreensToSave;
- (*ConsoleInfo)->HistoryMode.MaxMode = 1;
- (*ConsoleInfo)->HistoryMode.Mode = 0;
- (*ConsoleInfo)->HistoryMode.Attribute = 0;
- (*ConsoleInfo)->HistoryMode.CursorColumn = 0;
- (*ConsoleInfo)->HistoryMode.CursorRow = 0;
- (*ConsoleInfo)->HistoryMode.CursorVisible = FALSE;
- (*ConsoleInfo)->OurConOut.Reset = ConsoleLoggerReset;
- (*ConsoleInfo)->OurConOut.OutputString = ConsoleLoggerOutputString;
- (*ConsoleInfo)->OurConOut.TestString = ConsoleLoggerTestString;
- (*ConsoleInfo)->OurConOut.QueryMode = ConsoleLoggerQueryMode;
- (*ConsoleInfo)->OurConOut.SetMode = ConsoleLoggerSetMode;
- (*ConsoleInfo)->OurConOut.SetAttribute = ConsoleLoggerSetAttribute;
- (*ConsoleInfo)->OurConOut.ClearScreen = ConsoleLoggerClearScreen;
- (*ConsoleInfo)->OurConOut.SetCursorPosition = ConsoleLoggerSetCursorPosition;
- (*ConsoleInfo)->OurConOut.EnableCursor = ConsoleLoggerEnableCursor;
- (*ConsoleInfo)->OurConOut.Mode = gST->ConOut->Mode;
- (*ConsoleInfo)->Enabled = TRUE;
-
- Status = ConsoleLoggerResetBuffers(*ConsoleInfo);
- if (EFI_ERROR(Status)) {
- SHELL_FREE_NON_NULL((*ConsoleInfo));
- *ConsoleInfo = NULL;
- return (Status);
- }
-
- Status = gBS->InstallProtocolInterface(&gImageHandle, &gEfiSimpleTextOutProtocolGuid, EFI_NATIVE_INTERFACE, (VOID*)&((*ConsoleInfo)->OurConOut));
- if (EFI_ERROR(Status)) {
- SHELL_FREE_NON_NULL((*ConsoleInfo)->Buffer);
- SHELL_FREE_NON_NULL((*ConsoleInfo)->Attributes);
- SHELL_FREE_NON_NULL((*ConsoleInfo));
- *ConsoleInfo = NULL;
- return (Status);
- }
-
- gST->ConsoleOutHandle = gImageHandle;
- gST->ConOut = &(*ConsoleInfo)->OurConOut;
-
- return (Status);
-}
-
-/**
- Return the system to the state it was before InstallConsoleLogger
- was installed.
-
- @param[in] ConsoleInfo The object from the install function.
-
- @retval EFI_SUCCESS The operation was successful
- @return other The operation failed. This was from UninstallProtocolInterface.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerUninstall(
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- )
-{
- ASSERT(ConsoleInfo != NULL);
- ASSERT(ConsoleInfo->OldConOut != NULL);
-
- if (ConsoleInfo->Buffer != NULL) {
- FreePool(ConsoleInfo->Buffer);
- DEBUG_CODE(ConsoleInfo->Buffer = NULL;);
- DEBUG_CODE(ConsoleInfo->BufferSize = 0;);
- }
- if (ConsoleInfo->Attributes != NULL) {
- FreePool(ConsoleInfo->Attributes);
- DEBUG_CODE(ConsoleInfo->Attributes = NULL;);
- DEBUG_CODE(ConsoleInfo->AttribSize = 0;);
- }
-
- gST->ConsoleOutHandle = ConsoleInfo->OldConHandle;
- gST->ConOut = ConsoleInfo->OldConOut;
-
- return (gBS->UninstallProtocolInterface(gImageHandle, &gEfiSimpleTextOutProtocolGuid, (VOID*)&ConsoleInfo->OurConOut));
-}
-
-/**
- Displays previously logged output back to the screen.
-
- This will scroll the screen forwards and backwards through the log of previous
- output. If Rows is 0 then the size of 1/2 the screen will be scrolled. If Rows
- is (UINTN)(-1) then the size of the screen will be scrolled.
-
- @param[in] Forward If TRUE then the log will be displayed forwards (scroll to newer).
- If FALSE then the log will be displayed backwards (scroll to older).
- @param[in] Rows Determines how many rows the log should scroll.
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerDisplayHistory(
- IN CONST BOOLEAN Forward,
- IN CONST UINTN Rows,
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- )
-{
- UINTN RowChange;
-
- ASSERT(ConsoleInfo != NULL);
-
- //
- // Calculate the row number change
- //
- switch (Rows) {
- case ((UINTN)(-1)):
- RowChange = ConsoleInfo->RowsPerScreen;
- break;
- case (0):
- RowChange = ConsoleInfo->RowsPerScreen / 2;
- break;
- default:
- RowChange = Rows;
- break;
- }
-
- //
- // Do the math for direction
- //
- if (Forward) {
- if ((ConsoleInfo->OriginalStartRow - ConsoleInfo->CurrentStartRow) < RowChange) {
- RowChange = ConsoleInfo->OriginalStartRow - ConsoleInfo->CurrentStartRow;
- }
- } else {
- if (ConsoleInfo->CurrentStartRow < RowChange) {
- RowChange = ConsoleInfo->CurrentStartRow;
- }
- }
-
- //
- // If we are already at one end or the other
- //
- if (RowChange == 0) {
- return (EFI_SUCCESS);
- }
-
- //
- // Clear the screen
- //
- ConsoleInfo->OldConOut->ClearScreen(ConsoleInfo->OldConOut);
-
- //
- // Set the new start row
- //
- if (Forward) {
- ConsoleInfo->CurrentStartRow += RowChange;
- } else {
- ConsoleInfo->CurrentStartRow -= RowChange;
- }
-
- //
- // Change the screen
- //
- return (UpdateDisplayFromHistory(ConsoleInfo));
-}
-
-/**
- Function to return to normal output whent he scrolling is complete.
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-
- @retval EFI_SUCCESS The operation was successful.
- @return other The operation failed. See UpdateDisplayFromHistory.
-
- @sa UpdateDisplayFromHistory
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerStopHistory(
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- )
-{
- ASSERT(ConsoleInfo != NULL);
- if (ConsoleInfo->CurrentStartRow == ConsoleInfo->OriginalStartRow) {
- return (EFI_SUCCESS);
- }
- ConsoleInfo->CurrentStartRow = ConsoleInfo->OriginalStartRow;
- return (UpdateDisplayFromHistory(ConsoleInfo));
-}
-
-/**
- Updates the hidden ConOut to be displaying the correct stuff.
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-
- @retval EFI_SUCCESS The operation was successful.
- @return other The operation failed.
-**/
-EFI_STATUS
-EFIAPI
-UpdateDisplayFromHistory(
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- )
-{
- EFI_STATUS Status;
- EFI_STATUS RetVal;
- CHAR16 *Screen;
- INT32 *Attributes;
- UINTN CurrentRow;
- CHAR16 TempCharHolder;
- UINTN Column;
- INT32 CurrentAttrib;
- UINTN CurrentColumn;
- CHAR16 *StringSegment;
- CHAR16 *StringSegmentEnd;
- CHAR16 StringSegmentEndChar;
- INT32 OrigAttribute;
-
- ASSERT(ConsoleInfo != NULL);
- TempCharHolder = CHAR_NULL;
- RetVal = EFI_SUCCESS;
- OrigAttribute = ConsoleInfo->OldConOut->Mode->Attribute;
-
- //
- // Disable cursor visibility and move it to the top left corner
- //
- ConsoleInfo->OldConOut->EnableCursor (ConsoleInfo->OldConOut, FALSE);
- ConsoleInfo->OldConOut->SetCursorPosition (ConsoleInfo->OldConOut, 0, 0);
-
- Screen = &ConsoleInfo->Buffer[(ConsoleInfo->ColsPerScreen + 2) * ConsoleInfo->CurrentStartRow];
- Attributes = &ConsoleInfo->Attributes[ConsoleInfo->ColsPerScreen * ConsoleInfo->CurrentStartRow];
- for ( CurrentRow = 0
- ; CurrentRow < ConsoleInfo->RowsPerScreen
- ; CurrentRow++
- , Screen += (ConsoleInfo->ColsPerScreen + 2)
- , Attributes += ConsoleInfo->ColsPerScreen
- ){
- //
- // dont use the last char - prevents screen scroll
- //
- if (CurrentRow == (ConsoleInfo->RowsPerScreen-1)){
- TempCharHolder = Screen[ConsoleInfo->ColsPerScreen - 1];
- Screen[ConsoleInfo->ColsPerScreen - 1] = CHAR_NULL;
- }
-
- for ( Column = 0
- ; Column < ConsoleInfo->ColsPerScreen
- ; Column++
- ){
- if (Screen[Column] != CHAR_NULL) {
- CurrentAttrib = Attributes[Column];
- CurrentColumn = Column;
- StringSegment = &Screen[Column];
-
- //
- // Find the first char with a different arrribute and make that temporarily NULL
- // so we can do fewer printout statements. (later) restore that one and we will
- // start at that collumn on the next loop.
- //
- StringSegmentEndChar = CHAR_NULL;
- for ( StringSegmentEnd = StringSegment
- ; StringSegmentEnd != CHAR_NULL
- ; StringSegmentEnd++
- , Column++
- ){
- if (Attributes[Column] != CurrentAttrib) {
- StringSegmentEndChar = *StringSegmentEnd;
- *StringSegmentEnd = CHAR_NULL;
- break;
- }
- } // StringSegmentEnd loop
-
- //
- // Now write out as much as had the same Attributes
- //
-
- ConsoleInfo->OldConOut->SetAttribute(ConsoleInfo->OldConOut, CurrentAttrib);
- ConsoleInfo->OldConOut->SetCursorPosition(ConsoleInfo->OldConOut, CurrentColumn, CurrentRow);
- Status = ConsoleInfo->OldConOut->OutputString(ConsoleInfo->OldConOut, StringSegment);
-
- if (EFI_ERROR(Status)) {
- ASSERT(FALSE);
- RetVal = Status;
- }
-
- //
- // If we found a change in attribute put the character back and decrement the column
- // so when it increments it will point at that character and we will start printing
- // a segment with that new attribute
- //
- if (StringSegmentEndChar != CHAR_NULL) {
- *StringSegmentEnd = StringSegmentEndChar;
- StringSegmentEndChar = CHAR_NULL;
- Column--;
- }
- }
- } // column for loop
-
- //
- // If we removed the last char and this was the last row put it back
- //
- if (TempCharHolder != CHAR_NULL) {
- Screen[ConsoleInfo->ColsPerScreen - 1] = TempCharHolder;
- TempCharHolder = CHAR_NULL;
- }
- } // row for loop
-
- //
- // If we are setting the screen back to original turn on the cursor and make it visible
- // and set the attributes back to what they were
- //
- if (ConsoleInfo->CurrentStartRow == ConsoleInfo->OriginalStartRow) {
- ConsoleInfo->OldConOut->SetAttribute (
- ConsoleInfo->OldConOut,
- ConsoleInfo->HistoryMode.Attribute
- );
- ConsoleInfo->OldConOut->SetCursorPosition (
- ConsoleInfo->OldConOut,
- ConsoleInfo->HistoryMode.CursorColumn,
- ConsoleInfo->HistoryMode.CursorRow - ConsoleInfo->OriginalStartRow
- );
-
- Status = ConsoleInfo->OldConOut->EnableCursor (
- ConsoleInfo->OldConOut,
- ConsoleInfo->HistoryMode.CursorVisible
- );
- if (EFI_ERROR (Status)) {
- RetVal = Status;
- }
- } else {
- ConsoleInfo->OldConOut->SetAttribute (
- ConsoleInfo->OldConOut,
- OrigAttribute
- );
- }
-
- return (RetVal);
-}
-
-/**
- Reset the text output device hardware and optionaly run diagnostics
-
- @param This pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
- @param ExtendedVerification Indicates that a more extensive test may be performed
-
- @retval EFI_SUCCESS The text output device was reset.
- @retval EFI_DEVICE_ERROR The text output device is not functioning correctly and
- could not be reset.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerReset (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- )
-{
- EFI_STATUS Status;
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
- ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(This);
-
- //
- // Forward the request to the original ConOut
- //
- Status = ConsoleInfo->OldConOut->Reset (ConsoleInfo->OldConOut, ExtendedVerification);
-
- //
- // Check that the buffers are still correct for logging
- //
- if (!EFI_ERROR (Status)) {
- ConsoleLoggerResetBuffers(ConsoleInfo);
- }
-
- return Status;
-}
-
-/**
- Appends a string to the history buffer. If the buffer is full then the oldest
- information in the buffer will be dropped. Information is added in a line by
- line manner such that an empty line takes up just as much space as a full line.
-
- @param[in] String String pointer to add.
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-**/
-EFI_STATUS
-EFIAPI
-AppendStringToHistory(
- IN CONST CHAR16 *String,
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- )
-{
- CONST CHAR16 *Walker;
- UINTN CopySize;
- UINTN PrintIndex;
- UINTN Index;
-
- ASSERT(ConsoleInfo != NULL);
-
- for ( Walker = String
- ; Walker != NULL && *Walker != CHAR_NULL
- ; Walker++
- ){
- switch (*Walker) {
- case (CHAR_BACKSPACE):
- if (ConsoleInfo->HistoryMode.CursorColumn > 0) {
- ConsoleInfo->HistoryMode.CursorColumn--;
- }
- break;
- case (CHAR_LINEFEED):
- if (ConsoleInfo->HistoryMode.CursorRow >= (INT32)((ConsoleInfo->RowsPerScreen * ConsoleInfo->ScreenCount)-1)) {
- //
- // Should never be bigger
- //
- ASSERT(ConsoleInfo->HistoryMode.CursorRow == (INT32)((ConsoleInfo->RowsPerScreen * ConsoleInfo->ScreenCount)-1));
-
- //
- // scroll history attributes 'up' 1 row and set the last row to default attribute
- //
- CopySize = ConsoleInfo->ColsPerScreen
- * ((ConsoleInfo->RowsPerScreen * ConsoleInfo->ScreenCount) - 1)
- * sizeof(ConsoleInfo->Attributes[0]);
- ASSERT(CopySize < ConsoleInfo->AttribSize);
- CopyMem(
- ConsoleInfo->Attributes,
- ConsoleInfo->Attributes + ConsoleInfo->ColsPerScreen,
- CopySize
- );
-
- for ( Index = 0
- ; Index < ConsoleInfo->ColsPerScreen
- ; Index++
- ){
- *(ConsoleInfo->Attributes + (CopySize/sizeof(ConsoleInfo->Attributes)) + Index) = ConsoleInfo->HistoryMode.Attribute;
- }
-
- //
- // scroll history buffer 'up' 1 row and set the last row to spaces (L' ')
- //
- CopySize = (ConsoleInfo->ColsPerScreen + 2)
- * ((ConsoleInfo->RowsPerScreen * ConsoleInfo->ScreenCount) - 1)
- * sizeof(ConsoleInfo->Buffer[0]);
- ASSERT(CopySize < ConsoleInfo->BufferSize);
- CopyMem(
- ConsoleInfo->Buffer,
- ConsoleInfo->Buffer + (ConsoleInfo->ColsPerScreen + 2),
- CopySize
- );
-
- //
- // Set that last row of chars to spaces
- //
- SetMem16(((UINT8*)ConsoleInfo->Buffer)+CopySize, ConsoleInfo->ColsPerScreen*sizeof(CHAR16), L' ');
- } else {
- //
- // we are not on the last row
- //
-
- //
- // We should not be scrolling history
- //
- ASSERT (ConsoleInfo->OriginalStartRow == ConsoleInfo->CurrentStartRow);
- //
- // are we at the end of a row?
- //
- if (ConsoleInfo->HistoryMode.CursorRow == (INT32) (ConsoleInfo->OriginalStartRow + ConsoleInfo->RowsPerScreen - 1)) {
- ConsoleInfo->OriginalStartRow++;
- ConsoleInfo->CurrentStartRow++;
- }
- ConsoleInfo->HistoryMode.CursorRow++;
- }
- break;
- case (CHAR_CARRIAGE_RETURN):
- //
- // Move the cursor to the beginning of the current row.
- //
- ConsoleInfo->HistoryMode.CursorColumn = 0;
- break;
- default:
- //
- // Acrtually print characters into the history buffer
- //
-
- PrintIndex = ConsoleInfo->HistoryMode.CursorRow * ConsoleInfo->ColsPerScreen + ConsoleInfo->HistoryMode.CursorColumn;
-
- for ( // no initializer needed
- ; ConsoleInfo->HistoryMode.CursorColumn < (INT32) ConsoleInfo->ColsPerScreen
- ; ConsoleInfo->HistoryMode.CursorColumn++
- , PrintIndex++
- , Walker++
- ){
- if (*Walker == CHAR_NULL
- ||*Walker == CHAR_BACKSPACE
- ||*Walker == CHAR_LINEFEED
- ||*Walker == CHAR_CARRIAGE_RETURN
- ){
- Walker--;
- break;
- }
- //
- // The buffer is 2*CursorRow more since it has that many \r\n characters at the end of each row.
- //
-
- ASSERT(PrintIndex + ConsoleInfo->HistoryMode.CursorRow < ConsoleInfo->BufferSize);
- ConsoleInfo->Buffer[PrintIndex + (2*ConsoleInfo->HistoryMode.CursorRow)] = *Walker;
- ASSERT(PrintIndex < ConsoleInfo->AttribSize);
- ConsoleInfo->Attributes[PrintIndex] = ConsoleInfo->HistoryMode.Attribute;
- } // for loop
-
- //
- // Add the carriage return and line feed at the end of the lines
- //
- if (ConsoleInfo->HistoryMode.CursorColumn >= (INT32)ConsoleInfo->ColsPerScreen) {
- AppendStringToHistory(L"\r\n", ConsoleInfo);
- Walker--;
- }
-
- break;
- } // switch for character
- } // for loop
-
- return (EFI_SUCCESS);
-}
-
-/**
- Worker function to handle printing the output to the screen
- and the history buffer
-
- @param[in] String The string to output
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-
- @retval EFI_SUCCESS The string was printed
- @retval EFI_DEVICE_ERROR The device reported an error while attempting to output
- the text.
- @retval EFI_UNSUPPORTED The output device's mode is not currently in a
- defined text mode.
- @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the
- characters in the Unicode string could not be
- rendered and were skipped.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerOutputStringSplit(
- IN CONST CHAR16 *String,
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- )
-{
- EFI_STATUS Status;
-
- //
- // Forward the request to the original ConOut
- //
- Status = ConsoleInfo->OldConOut->OutputString (ConsoleInfo->OldConOut, (CHAR16*)String);
-
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- return (AppendStringToHistory(String, ConsoleInfo));
-}
-
-/**
- Function to handle page break mode.
-
- This function will prompt for continue or break.
-
- @retval EFI_SUCCESS Continue was choosen
- @return other Break was choosen
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerDoPageBreak(
- VOID
- )
-{
- SHELL_PROMPT_RESPONSE *Resp;
- EFI_STATUS Status;
-
- Resp = NULL;
- ASSERT(ShellInfoObject.PageBreakEnabled);
- ShellInfoObject.PageBreakEnabled = FALSE;
- Status = ShellPromptForResponseHii(ShellPromptResponseTypeQuitContinue, STRING_TOKEN(STR_SHELL_QUIT_CONT), ShellInfoObject.HiiHandle, (VOID**)&Resp);
- ShellInfoObject.PageBreakEnabled = TRUE;
- ASSERT(Resp != NULL);
- if (Resp == NULL) {
- return (EFI_NOT_FOUND);
- }
- if (EFI_ERROR(Status)) {
- if (Resp != NULL) {
- FreePool(Resp);
- }
- return (Status);
- }
- if (*Resp == ShellPromptResponseContinue) {
- FreePool(Resp);
- ShellInfoObject.ConsoleInfo->RowCounter = 0;
-// ShellInfoObject.ConsoleInfo->OurConOut.Mode->CursorRow = 0;
-// ShellInfoObject.ConsoleInfo->OurConOut.Mode->CursorColumn = 0;
-
- return (EFI_SUCCESS);
- } else if (*Resp == ShellPromptResponseQuit) {
- FreePool(Resp);
- ShellInfoObject.ConsoleInfo->Enabled = FALSE;
- return (EFI_DEVICE_ERROR);
- } else {
- ASSERT(FALSE);
- }
- return (EFI_SUCCESS);
-}
-/**
- Worker function to handle printing the output with page breaks.
-
- @param[in] String The string to output
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-
- @retval EFI_SUCCESS The string was printed
- @retval EFI_DEVICE_ERROR The device reported an error while attempting to output
- the text.
- @retval EFI_UNSUPPORTED The output device's mode is not currently in a
- defined text mode.
- @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the
- characters in the Unicode string could not be
- rendered and were skipped.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerPrintWithPageBreak(
- IN CONST CHAR16 *String,
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- )
-{
- CONST CHAR16 *Walker;
- CONST CHAR16 *LineStart;
- CHAR16 *StringCopy;
- CHAR16 TempChar;
-
- StringCopy = NULL;
- StringCopy = StrnCatGrow(&StringCopy, NULL, String, 0);
- if (StringCopy == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- for ( Walker = StringCopy
- , LineStart = StringCopy
- ; Walker != NULL && *Walker != CHAR_NULL
- ; Walker++
- ){
- switch (*Walker) {
- case (CHAR_BACKSPACE):
- if (ConsoleInfo->OurConOut.Mode->CursorColumn > 0) {
- ConsoleInfo->OurConOut.Mode->CursorColumn--;
- }
- break;
- case (CHAR_LINEFEED):
- //
- // add a temp NULL terminator
- //
- TempChar = *(Walker + 1);
- *((CHAR16*)(Walker+1)) = CHAR_NULL;
-
- //
- // output the string
- //
- ConsoleLoggerOutputStringSplit (LineStart, ConsoleInfo);
-
- //
- // restore the temp NULL terminator to it's original character
- //
- *((CHAR16*)(Walker+1)) = TempChar;
-
- //
- // Update LineStart Variable
- //
- LineStart = Walker + 1;
-
- //
- // increment row count
- //
- ShellInfoObject.ConsoleInfo->RowCounter++;
- ConsoleInfo->OurConOut.Mode->CursorRow++;
-
- break;
- case (CHAR_CARRIAGE_RETURN):
- //
- // Move the cursor to the beginning of the current row.
- //
- ConsoleInfo->OurConOut.Mode->CursorColumn = 0;
- break;
- default:
- //
- // increment column count
- //
- ConsoleInfo->OurConOut.Mode->CursorColumn++;
- //
- // check if that is the last column
- //
- if ((INTN)ConsoleInfo->ColsPerScreen == ConsoleInfo->OurConOut.Mode->CursorColumn + 1) {
- //
- // output a line similar to the linefeed character.
- //
-
- //
- // add a temp NULL terminator
- //
- TempChar = *(Walker + 1);
- *((CHAR16*)(Walker+1)) = CHAR_NULL;
-
- //
- // output the string
- //
- ConsoleLoggerOutputStringSplit (LineStart, ConsoleInfo);
-
- //
- // restore the temp NULL terminator to it's original character
- //
- *((CHAR16*)(Walker+1)) = TempChar;
-
- //
- // Update LineStart Variable
- //
- LineStart = Walker + 1;
-
- //
- // increment row count and zero the column
- //
- ShellInfoObject.ConsoleInfo->RowCounter++;
- ConsoleInfo->OurConOut.Mode->CursorRow++;
- ConsoleInfo->OurConOut.Mode->CursorColumn = 0;
- } // last column on line
- break;
- } // switch for character
-
- //
- // check if that was the last printable row. If yes handle PageBreak mode
- //
- if ((ConsoleInfo->RowsPerScreen) -1 == ShellInfoObject.ConsoleInfo->RowCounter) {
- if (EFI_ERROR(ConsoleLoggerDoPageBreak())) {
- //
- // We got an error which means 'break' and halt the printing
- //
- SHELL_FREE_NON_NULL(StringCopy);
- return (EFI_DEVICE_ERROR);
- }
- }
- } // for loop
-
- if (LineStart != NULL && *LineStart != CHAR_NULL) {
- ConsoleLoggerOutputStringSplit (LineStart, ConsoleInfo);
- }
-
- SHELL_FREE_NON_NULL(StringCopy);
- return (EFI_SUCCESS);
-}
-
-/**
- Write a Unicode string to the output device.
-
- @param[in] This Protocol instance pointer.
- @param[in] WString The NULL-terminated Unicode string to be displayed on the output
- device(s). All output devices must also support the Unicode
- drawing defined in this file.
- @retval EFI_SUCCESS The string was output to the device.
- @retval EFI_DEVICE_ERROR The device reported an error while attempting to output
- the text.
- @retval EFI_UNSUPPORTED The output device's mode is not currently in a
- defined text mode.
- @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the
- characters in the Unicode string could not be
- rendered and were skipped.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerOutputString (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *WString
- )
-{
- EFI_INPUT_KEY Key;
- UINTN EventIndex;
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
- ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(This);
- if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleOut) {
- return (EFI_UNSUPPORTED);
- }
- ASSERT(ShellInfoObject.ConsoleInfo == ConsoleInfo);
- if (ShellInfoObject.HaltOutput) {
- //
- // just get some key
- //
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ShellInfoObject.HaltOutput = FALSE;
- }
- if (!ShellInfoObject.ConsoleInfo->Enabled) {
- return (EFI_DEVICE_ERROR);
- } else if (ShellInfoObject.PageBreakEnabled) {
- return (ConsoleLoggerPrintWithPageBreak(WString, ConsoleInfo));
- } else {
- return (ConsoleLoggerOutputStringSplit(WString, ConsoleInfo));
- }
-}
-
-/**
- Verifies that all characters in a Unicode string can be output to the
- target device.
-
- @param[in] This Protocol instance pointer.
- @param[in] WString The NULL-terminated Unicode string to be examined for the output
- device(s).
-
- @retval EFI_SUCCESS The device(s) are capable of rendering the output string.
- @retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be
- rendered by one or more of the output devices mapped
- by the EFI handle.
-
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerTestString (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *WString
- )
-{
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
- ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(This);
- //
- // Forward the request to the original ConOut
- //
- return (ConsoleInfo->OldConOut->TestString (ConsoleInfo->OldConOut, WString));
-}
-
-/**
- Returns information for an available text mode that the output device(s)
- supports.
-
- @param[in] This Protocol instance pointer.
- @param[in] ModeNumber The mode number to return information on.
- @param[out] Columns Upon return, the number of columns in the selected geometry
- @param[out] Rows Upon return, the number of rows in the selected geometry
-
- @retval EFI_SUCCESS The requested mode information was returned.
- @retval EFI_DEVICE_ERROR The device had an error and could not
- complete the request.
- @retval EFI_UNSUPPORTED The mode number was not valid.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerQueryMode (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN ModeNumber,
- OUT UINTN *Columns,
- OUT UINTN *Rows
- )
-{
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
- ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(This);
- //
- // Forward the request to the original ConOut
- //
- return (ConsoleInfo->OldConOut->QueryMode (
- ConsoleInfo->OldConOut,
- ModeNumber,
- Columns,
- Rows
- ));
-}
-
-/**
- Sets the output device(s) to a specified mode.
-
- @param[in] This Protocol instance pointer.
- @param[in] ModeNumber The mode number to set.
-
-
- @retval EFI_SUCCESS The requested text mode was set.
- @retval EFI_DEVICE_ERROR The device had an error and
- could not complete the request.
- @retval EFI_UNSUPPORTED The mode number was not valid.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerSetMode (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN ModeNumber
- )
-{
- EFI_STATUS Status;
-
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
- ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(This);
-
- //
- // Forward the request to the original ConOut
- //
- Status = ConsoleInfo->OldConOut->SetMode (ConsoleInfo->OldConOut, ModeNumber);
-
- //
- // Check that the buffers are still correct for logging
- //
- if (!EFI_ERROR (Status)) {
- ConsoleInfo->OurConOut.Mode = gST->ConOut->Mode;
- ConsoleLoggerResetBuffers(ConsoleInfo);
- }
-
- return Status;
-}
-
-/**
- Sets the background and foreground colors for the OutputString () and
- ClearScreen () functions.
-
- @param[in] This Protocol instance pointer.
- @param[in] Attribute The attribute to set. Bits 0..3 are the foreground color, and
- bits 4..6 are the background color. All other bits are undefined
- and must be zero. The valid Attributes are defined in this file.
-
- @retval EFI_SUCCESS The attribute was set.
- @retval EFI_DEVICE_ERROR The device had an error and
- could not complete the request.
- @retval EFI_UNSUPPORTED The attribute requested is not defined.
-
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerSetAttribute (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN Attribute
- )
-{
- EFI_STATUS Status;
-
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
- ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(This);
-
- //
- // Forward the request to the original ConOut
- //
- Status = ConsoleInfo->OldConOut->SetAttribute (ConsoleInfo->OldConOut, Attribute);
-
- //
- // Record console output history
- //
- if (!EFI_ERROR (Status)) {
- ConsoleInfo->HistoryMode.Attribute = (INT32) Attribute;
- }
-
- return Status;
-}
-
-/**
- Clears the output device(s) display to the currently selected background
- color.
-
- @param[in] This Protocol instance pointer.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR The device had an error and
- could not complete the request.
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerClearScreen (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
- )
-{
- EFI_STATUS Status;
- CHAR16 *Screen;
- INT32 *Attributes;
- UINTN Row;
- UINTN Column;
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
-
- if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleOut) {
- return (EFI_UNSUPPORTED);
- }
-
- ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(This);
-
- //
- // Forward the request to the original ConOut
- //
- Status = ConsoleInfo->OldConOut->ClearScreen (ConsoleInfo->OldConOut);
-
- //
- // Record console output history
- //
- if (!EFI_ERROR (Status)) {
- Screen = &ConsoleInfo->Buffer[(ConsoleInfo->ColsPerScreen + 1) * ConsoleInfo->CurrentStartRow];
- Attributes = &ConsoleInfo->Attributes[ConsoleInfo->ColsPerScreen * ConsoleInfo->CurrentStartRow];
- for ( Row = ConsoleInfo->OriginalStartRow
- ; Row < (ConsoleInfo->RowsPerScreen * ConsoleInfo->ScreenCount)
- ; Row++
- ){
- for ( Column = 0
- ; Column < ConsoleInfo->ColsPerScreen
- ; Column++
- , Screen++
- , Attributes++
- ){
- *Screen = L' ';
- *Attributes = ConsoleInfo->OldConOut->Mode->Attribute;
- }
- //
- // Skip the NULL on each column end in text buffer only
- //
- Screen++;
- }
- ConsoleInfo->HistoryMode.CursorColumn = 0;
- ConsoleInfo->HistoryMode.CursorRow = 0;
- }
-
- return Status;
-}
-
-/**
- Sets the current coordinates of the cursor position
-
- @param[in] This Protocol instance pointer.
- @param[in] Column Column to put the cursor in. Must be between zero and Column returned from QueryMode
- @param[in] Row Row to put the cursor in. Must be between zero and Row returned from QueryMode
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR The device had an error and
- could not complete the request.
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the
- cursor position is invalid for the current mode.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerSetCursorPosition (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN Column,
- IN UINTN Row
- )
-{
- EFI_STATUS Status;
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
-
- if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleOut) {
- return (EFI_UNSUPPORTED);
- }
-
- ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(This);
- //
- // Forward the request to the original ConOut
- //
- Status = ConsoleInfo->OldConOut->SetCursorPosition (
- ConsoleInfo->OldConOut,
- Column,
- Row
- );
-
- //
- // Record console output history
- //
- if (!EFI_ERROR (Status)) {
- ConsoleInfo->HistoryMode.CursorColumn = (INT32)Column;
- ConsoleInfo->HistoryMode.CursorRow = (INT32)(ConsoleInfo->OriginalStartRow + Row);
- }
-
- return Status;
-}
-
-/**
- Makes the cursor visible or invisible
-
- @param[in] This Protocol instance pointer.
- @param[in] Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is
- set to be invisible.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR The device had an error and could not complete the
- request, or the device does not support changing
- the cursor mode.
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerEnableCursor (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN BOOLEAN Visible
- )
-{
- EFI_STATUS Status;
-
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
- ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(This);
- //
- // Forward the request to the original ConOut
- //
- Status = ConsoleInfo->OldConOut->EnableCursor (ConsoleInfo->OldConOut, Visible);
-
- //
- // Record console output history
- //
- if (!EFI_ERROR (Status)) {
- ConsoleInfo->HistoryMode.CursorVisible = Visible;
- }
-
- return Status;
-}
-
-/**
- Function to update and verify that the current buffers are correct.
-
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-
- This will be used when a mode has changed or a reset ocurred to verify all
- history buffers.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerResetBuffers(
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- )
-{
- EFI_STATUS Status;
-
- if (ConsoleInfo->Buffer != NULL) {
- FreePool(ConsoleInfo->Buffer);
- ConsoleInfo->Buffer = NULL;
- ConsoleInfo->BufferSize = 0;
- }
- if (ConsoleInfo->Attributes != NULL) {
- FreePool(ConsoleInfo->Attributes);
- ConsoleInfo->Attributes = NULL;
- ConsoleInfo->AttribSize = 0;
- }
-
- Status = gST->ConOut->QueryMode (gST->ConOut, gST->ConOut->Mode->Mode, &ConsoleInfo->ColsPerScreen, &ConsoleInfo->RowsPerScreen);
- if (EFI_ERROR(Status)){
- return (Status);
- }
-
- ConsoleInfo->BufferSize = (ConsoleInfo->ColsPerScreen + 2) * ConsoleInfo->RowsPerScreen * ConsoleInfo->ScreenCount * sizeof(ConsoleInfo->Buffer[0]);
- ConsoleInfo->AttribSize = ConsoleInfo->ColsPerScreen * ConsoleInfo->RowsPerScreen * ConsoleInfo->ScreenCount * sizeof(ConsoleInfo->Attributes[0]);
-
- ConsoleInfo->Buffer = (CHAR16*)AllocateZeroPool(ConsoleInfo->BufferSize);
-
- if (ConsoleInfo->Buffer == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- ConsoleInfo->Attributes = (INT32*)AllocateZeroPool(ConsoleInfo->AttribSize);
- if (ConsoleInfo->Attributes == NULL) {
- FreePool(ConsoleInfo->Buffer);
- ConsoleInfo->Buffer = NULL;
- return (EFI_OUT_OF_RESOURCES);
- }
-
- CopyMem (&ConsoleInfo->HistoryMode, ConsoleInfo->OldConOut->Mode, sizeof (EFI_SIMPLE_TEXT_OUTPUT_MODE));
-
- return (EFI_SUCCESS);
-}
diff --git a/ShellPkg/Application/Shell/ConsoleLogger.h b/ShellPkg/Application/Shell/ConsoleLogger.h
deleted file mode 100644
index c470cdb7ab..0000000000
--- a/ShellPkg/Application/Shell/ConsoleLogger.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/** @file
- Provides interface to shell console logger.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#ifndef _CONSOLE_LOGGER_HEADER_
-#define _CONSOLE_LOGGER_HEADER_
-
-#include <Uefi.h>
-
-#include <Protocol/SimpleTextOut.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-
-#include <Library/DebugLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HiiLib.h>
-#include <Library/ShellLib.h>
-
-#define CONSOLE_LOGGER_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('c', 'o', 'P', 'D')
-
-typedef struct _CONSOLE_LOGGER_PRIVATE_DATA{
- UINTN Signature;
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL OurConOut; ///< the protocol we installed onto the system table
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *OldConOut; ///< old protocol to reinstall upon exiting
- EFI_HANDLE OldConHandle; ///< old protocol handle
- UINTN ScreenCount; ///< How many screens worth of data to save
- CHAR16 *Buffer; ///< Buffer to save data
- UINTN BufferSize; ///< size of buffer in bytes
-
- // start row is the top of the screen
- UINTN OriginalStartRow; ///< What the originally visible start row was
- UINTN CurrentStartRow; ///< what the currently visible start row is
-
- UINTN RowsPerScreen; ///< how many rows the screen can display
- UINTN ColsPerScreen; ///< how many columns the screen can display
-
- INT32 *Attributes; ///< Buffer for Attribute to be saved for each character
- UINTN AttribSize; ///< Size of Attributes in bytes
-
- EFI_SIMPLE_TEXT_OUTPUT_MODE HistoryMode; ///< mode of the history log
- BOOLEAN Enabled; ///< Set to FALSE when a break is requested.
- UINTN RowCounter; ///< Initial row of each print job.
-} CONSOLE_LOGGER_PRIVATE_DATA;
-
-#define CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(a) CR (a, CONSOLE_LOGGER_PRIVATE_DATA, OurConOut, CONSOLE_LOGGER_PRIVATE_DATA_SIGNATURE)
-
-/**
- Install our intermediate ConOut into the system table to
- keep a log of all the info that is displayed to the user.
-
- @param[in] ScreensToSave Sets how many screen-worths of data to save.
- @param[out] ConsoleInfo The object to pass into later functions.
-
- @retval EFI_SUCCESS The operation was successful.
- @return other The operation failed.
-
- @sa ConsoleLoggerResetBuffers
- @sa InstallProtocolInterface
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerInstall(
- IN CONST UINTN ScreensToSave,
- OUT CONSOLE_LOGGER_PRIVATE_DATA **ConsoleInfo
- );
-
-/**
- Return the system to the state it was before InstallConsoleLogger
- was installed.
-
- @param[in, out] ConsoleInfo The object from the install function.
-
- @retval EFI_SUCCESS The operation was successful
- @return other The operation failed. This was from UninstallProtocolInterface.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerUninstall(
- IN OUT CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- );
-
-/**
- Displays previously logged output back to the screen.
-
- This will scroll the screen forwards and backwards through the log of previous
- output. If Rows is 0 then the size of 1/2 the screen will be scrolled. If Rows
- is (UINTN)(-1) then the size of the screen will be scrolled.
-
- @param[in] Forward If TRUE then the log will be displayed forwards (scroll to newer).
- If FALSE then the log will be displayed backwards (scroll to older).
- @param[in] Rows Determines how many rows the log should scroll.
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerDisplayHistory(
- IN CONST BOOLEAN Forward,
- IN CONST UINTN Rows,
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- );
-
-/**
- Function to return to normal output whent he scrolling is complete.
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-
- @retval EFI_SUCCESS The operation was successful.
- @return other The operation failed. See UpdateDisplayFromHistory.
-
- @sa UpdateDisplayFromHistory
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerStopHistory(
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- );
-
-/**
- Updates the hidden ConOut to be displaying the correct stuff.
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-
- @retval EFI_SUCCESS The operation was successful.
- @return other The operation failed.
-**/
-EFI_STATUS
-EFIAPI
-UpdateDisplayFromHistory(
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- );
-
-/**
- Reset the text output device hardware and optionaly run diagnostics
-
- @param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
- @param ExtendedVerification Indicates that a more extensive test may be performed
-
- @retval EFI_SUCCESS The text output device was reset.
- @retval EFI_DEVICE_ERROR The text output device is not functioning correctly and
- could not be reset.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerReset (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- );
-
-/**
- Write a Unicode string to the output device.
-
- @param[in] This Protocol instance pointer.
- @param[in] WString The NULL-terminated Unicode string to be displayed on the output
- device(s). All output devices must also support the Unicode
- drawing defined in this file.
- @retval EFI_SUCCESS The string was output to the device.
- @retval EFI_DEVICE_ERROR The device reported an error while attempting to output
- the text.
- @retval EFI_UNSUPPORTED The output device's mode is not currently in a
- defined text mode.
- @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the
- characters in the Unicode string could not be
- rendered and were skipped.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerOutputString(
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *WString
- );
-
-/**
- Verifies that all characters in a Unicode string can be output to the
- target device.
-
- @param[in] This Protocol instance pointer.
- @param[in] WString The NULL-terminated Unicode string to be examined for the output
- device(s).
-
- @retval EFI_SUCCESS The device(s) are capable of rendering the output string.
- @retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be
- rendered by one or more of the output devices mapped
- by the EFI handle.
-
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerTestString (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *WString
- );
-
-/**
- Returns information for an available text mode that the output device(s)
- supports.
-
- @param[in] This Protocol instance pointer.
- @param[in] ModeNumber The mode number to return information on.
- @param[out] Columns Upon return, the number of columns in the selected geometry
- @param[out] Rows Upon return, the number of rows in the selected geometry
-
- @retval EFI_SUCCESS The requested mode information was returned.
- @retval EFI_DEVICE_ERROR The device had an error and could not
- complete the request.
- @retval EFI_UNSUPPORTED The mode number was not valid.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerQueryMode (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN ModeNumber,
- OUT UINTN *Columns,
- OUT UINTN *Rows
- );
-
-/**
- Sets the output device(s) to a specified mode.
-
- @param[in] This Protocol instance pointer.
- @param[in] ModeNumber The mode number to set.
-
-
- @retval EFI_SUCCESS The requested text mode was set.
- @retval EFI_DEVICE_ERROR The device had an error and
- could not complete the request.
- @retval EFI_UNSUPPORTED The mode number was not valid.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerSetMode (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN ModeNumber
- );
-
-/**
- Sets the background and foreground colors for the OutputString () and
- ClearScreen () functions.
-
- @param[in] This Protocol instance pointer.
- @param[in] Attribute The attribute to set. Bits 0..3 are the foreground color, and
- bits 4..6 are the background color. All other bits are undefined
- and must be zero. The valid Attributes are defined in this file.
-
- @retval EFI_SUCCESS The attribute was set.
- @retval EFI_DEVICE_ERROR The device had an error and
- could not complete the request.
- @retval EFI_UNSUPPORTED The attribute requested is not defined.
-
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerSetAttribute (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN Attribute
- );
-
-/**
- Clears the output device(s) display to the currently selected background
- color.
-
- @param[in] This Protocol instance pointer.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR The device had an error and
- could not complete the request.
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerClearScreen (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
- );
-
-/**
- Sets the current coordinates of the cursor position.
-
- @param[in] This Protocol instance pointer.
- @param[in] Column Column to put the cursor in. Must be between zero and Column returned from QueryMode
- @param[in] Row Row to put the cursor in. Must be between zero and Row returned from QueryMode
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR The device had an error and
- could not complete the request.
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the
- cursor position is invalid for the current mode.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerSetCursorPosition (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN Column,
- IN UINTN Row
- );
-
-/**
- Makes the cursor visible or invisible
-
- @param[in] This Protocol instance pointer.
- @param[in] Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is
- set to be invisible.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR The device had an error and could not complete the
- request, or the device does not support changing
- the cursor mode.
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode.
-
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerEnableCursor (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN BOOLEAN Visible
- );
-
-/**
- Function to update and verify that the current buffers are correct.
-
- @param[in] ConsoleInfo The pointer to the instance of the console logger information.
-
- This will be used when a mode has changed or a reset ocurred to verify all
- history buffers.
-**/
-EFI_STATUS
-EFIAPI
-ConsoleLoggerResetBuffers(
- IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo
- );
-
-#endif //_CONSOLE_LOGGER_HEADER_
-
diff --git a/ShellPkg/Application/Shell/ConsoleWrappers.c b/ShellPkg/Application/Shell/ConsoleWrappers.c
deleted file mode 100644
index 561a666473..0000000000
--- a/ShellPkg/Application/Shell/ConsoleWrappers.c
+++ /dev/null
@@ -1,477 +0,0 @@
-/** @file
- Function definitions for shell simple text in and out on top of file handles.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include "ConsoleWrappers.h"
-#include "Shell.h"
-
-typedef struct {
- EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn;
- SHELL_FILE_HANDLE FileHandle;
- EFI_HANDLE TheHandle;
-} SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
-
-typedef struct {
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOut;
- SHELL_FILE_HANDLE FileHandle;
- EFI_HANDLE TheHandle;
-} SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
-
-/**
- Event notification function for EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey event
- Signal the event if there is key available
-
- @param Event Indicates the event that invoke this function.
- @param Context Indicates the calling context.
-
-**/
-VOID
-EFIAPI
-ConInWaitForKey (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- UINT64 Position;
- UINT64 Size;
- //
- // Someone is waiting on the keystroke event, if there's
- // a key pending, signal the event
- //
- // Context is the pointer to EFI_SIMPLE_TEXT_INPUT_PROTOCOL
- //
- ShellInfoObject.NewEfiShellProtocol->GetFilePosition(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *)Context)->FileHandle, &Position);
- ShellInfoObject.NewEfiShellProtocol->GetFileSize (((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *)Context)->FileHandle, &Size );
- if (Position < Size) {
- gBS->SignalEvent (Event);
- }
-}
-
-/**
- Reset function for the fake simple text input.
-
- @param[in] This A pointer to the SimpleTextIn structure.
- @param[in] ExtendedVerification TRUE for extra validation, FALSE otherwise.
-
- @retval EFI_SUCCESS The reset was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextInReset(
- IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- )
-{
- return (EFI_SUCCESS);
-}
-
-/**
- ReadKeyStroke function for the fake simple text input.
-
- @param[in] This A pointer to the SimpleTextIn structure.
- @param[in, out] Key A pointer to the Key structure to fill.
-
- @retval EFI_SUCCESS The read was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextInReadKeyStroke(
- IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
- IN OUT EFI_INPUT_KEY *Key
- )
-{
- UINTN Size;
- Size = sizeof(CHAR16);
- if (Key == NULL || This == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- Key->ScanCode = 0;
- return (ShellInfoObject.NewEfiShellProtocol->ReadFile(
- ((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *)This)->FileHandle,
- &Size,
- &Key->UnicodeChar));
-}
-
-/**
- Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a
- SHELL_FILE_HANDLE to support redirecting input from a file.
-
- @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use.
- @param[in] HandleLocation The pointer of a location to copy handle with protocol to.
-
- @retval NULL There was insufficient memory available.
- @return A pointer to the allocated protocol structure;
-**/
-EFI_SIMPLE_TEXT_INPUT_PROTOCOL*
-EFIAPI
-CreateSimpleTextInOnFile(
- IN SHELL_FILE_HANDLE FileHandleToUse,
- IN EFI_HANDLE *HandleLocation
- )
-{
- SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ProtocolToReturn;
- EFI_STATUS Status;
-
- if (HandleLocation == NULL || FileHandleToUse == NULL) {
- return (NULL);
- }
-
- ProtocolToReturn = AllocateZeroPool(sizeof(SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL));
- if (ProtocolToReturn == NULL) {
- return (NULL);
- }
- ProtocolToReturn->FileHandle = FileHandleToUse;
- ProtocolToReturn->SimpleTextIn.Reset = FileBasedSimpleTextInReset;
- ProtocolToReturn->SimpleTextIn.ReadKeyStroke = FileBasedSimpleTextInReadKeyStroke;
-
- Status = gBS->CreateEvent (
- EVT_NOTIFY_WAIT,
- TPL_NOTIFY,
- ConInWaitForKey,
- &ProtocolToReturn->SimpleTextIn,
- &ProtocolToReturn->SimpleTextIn.WaitForKey
- );
-
- if (EFI_ERROR(Status)) {
- FreePool(ProtocolToReturn);
- return (NULL);
- }
- ///@todo possibly also install SimpleTextInputEx on the handle at this point.
- Status = gBS->InstallProtocolInterface(
- &(ProtocolToReturn->TheHandle),
- &gEfiSimpleTextInProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &(ProtocolToReturn->SimpleTextIn));
- if (!EFI_ERROR(Status)) {
- *HandleLocation = ProtocolToReturn->TheHandle;
- return ((EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)ProtocolToReturn);
- } else {
- FreePool(ProtocolToReturn);
- return (NULL);
- }
-}
-
-/**
- Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a
- SHELL_FILE_HANDLE to support redirecting input from a file.
-
- @param[in] SimpleTextIn The pointer to the SimpleTextIn to close.
-
- @retval EFI_SUCCESS The object was closed.
-**/
-EFI_STATUS
-EFIAPI
-CloseSimpleTextInOnFile(
- IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *SimpleTextIn
- )
-{
- EFI_STATUS Status;
- EFI_STATUS Status1;
-
- if (SimpleTextIn == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- Status = gBS->CloseEvent(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *)SimpleTextIn)->SimpleTextIn.WaitForKey);
-
- Status1 = gBS->UninstallProtocolInterface(
- ((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->TheHandle,
- &gEfiSimpleTextInProtocolGuid,
- &(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->SimpleTextIn));
-
- FreePool(SimpleTextIn);
- if (!EFI_ERROR(Status)) {
- return (Status1);
- } else {
- return (Status);
- }
-}
-
-/**
- Reset the text output device hardware and optionaly run diagnostics.
-
- @param This pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
- @param ExtendedVerification Indicates that a more extensive test may be performed
-
- @retval EFI_SUCCESS The text output device was reset.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextOutReset (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- )
-{
- return (EFI_SUCCESS);
-}
-
-/**
- Verifies that all characters in a Unicode string can be output to the
- target device.
-
- @param[in] This Protocol instance pointer.
- @param[in] WString The NULL-terminated Unicode string to be examined.
-
- @retval EFI_SUCCESS The device(s) are capable of rendering the output string.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextOutTestString (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *WString
- )
-{
- return (EFI_SUCCESS);
-}
-
-/**
- Returns information for an available text mode that the output device(s)
- supports.
-
- @param[in] This Protocol instance pointer.
- @param[in] ModeNumber The mode number to return information on.
- @param[out] Columns Upon return, the number of columns in the selected geometry
- @param[out] Rows Upon return, the number of rows in the selected geometry
-
- @retval EFI_UNSUPPORTED The mode number was not valid.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextOutQueryMode (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN ModeNumber,
- OUT UINTN *Columns,
- OUT UINTN *Rows
- )
-{
- return (EFI_UNSUPPORTED);
-}
-
-/**
- Sets the output device(s) to a specified mode.
-
- @param[in] This Protocol instance pointer.
- @param[in] ModeNumber The mode number to set.
-
- @retval EFI_UNSUPPORTED The mode number was not valid.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextOutSetMode (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN ModeNumber
- )
-{
- return (EFI_UNSUPPORTED);
-}
-
-/**
- Sets the background and foreground colors for the OutputString () and
- ClearScreen () functions.
-
- @param[in] This Protocol instance pointer.
- @param[in] Attribute The attribute to set. Bits 0..3 are the foreground color, and
- bits 4..6 are the background color. All other bits are undefined
- and must be zero. The valid Attributes are defined in this file.
-
- @retval EFI_SUCCESS The attribute was set.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextOutSetAttribute (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN Attribute
- )
-{
- return (EFI_SUCCESS);
-}
-
-/**
- Clears the output device(s) display to the currently selected background
- color.
-
- @param[in] This Protocol instance pointer.
-
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextOutClearScreen (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
- )
-{
- return (EFI_SUCCESS);
-}
-
-/**
- Sets the current coordinates of the cursor position
-
- @param[in] This Protocol instance pointer.
- @param[in] Column Column to put the cursor in. Must be between zero and Column returned from QueryMode
- @param[in] Row Row to put the cursor in. Must be between zero and Row returned from QueryMode
-
- @retval EFI_SUCCESS The operation completed successfully.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextOutSetCursorPosition (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN Column,
- IN UINTN Row
- )
-{
- return (EFI_SUCCESS);
-}
-
-/**
- Makes the cursor visible or invisible
-
- @param[in] This Protocol instance pointer.
- @param[in] Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is
- set to be invisible.
-
- @retval EFI_SUCCESS The operation completed successfully.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextOutEnableCursor (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN BOOLEAN Visible
- )
-{
- return (EFI_SUCCESS);
-}
-
-/**
- Write a Unicode string to the output device.
-
- @param[in] This Protocol instance pointer.
- @param[in] WString The NULL-terminated Unicode string to be displayed on the output
- device(s). All output devices must also support the Unicode
- drawing defined in this file.
- @retval EFI_SUCCESS The string was output to the device.
- @retval EFI_DEVICE_ERROR The device reported an error while attempting to output
- the text.
- @retval EFI_UNSUPPORTED The output device's mode is not currently in a
- defined text mode.
- @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the
- characters in the Unicode string could not be
- rendered and were skipped.
-**/
-EFI_STATUS
-EFIAPI
-FileBasedSimpleTextOutOutputString (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *WString
- )
-{
- UINTN Size;
- Size = StrLen(WString) * sizeof(CHAR16);
- return (ShellInfoObject.NewEfiShellProtocol->WriteFile(
- ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)This)->FileHandle,
- &Size,
- WString));
-}
-
-/**
- Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a
- SHELL_FILE_HANDLE to support redirecting output from a file.
-
- @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use.
- @param[in] HandleLocation The pointer of a location to copy handle with protocol to.
-
- @retval NULL There was insufficient memory available.
- @return A pointer to the allocated protocol structure;
-**/
-EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*
-EFIAPI
-CreateSimpleTextOutOnFile(
- IN SHELL_FILE_HANDLE FileHandleToUse,
- IN EFI_HANDLE *HandleLocation
- )
-{
- SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ProtocolToReturn;
- EFI_STATUS Status;
-
- if (HandleLocation == NULL || FileHandleToUse == NULL) {
- return (NULL);
- }
-
- ProtocolToReturn = AllocateZeroPool(sizeof(SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL));
- if (ProtocolToReturn == NULL) {
- return (NULL);
- }
- ProtocolToReturn->FileHandle = FileHandleToUse;
- ProtocolToReturn->SimpleTextOut.Reset = FileBasedSimpleTextOutReset;
- ProtocolToReturn->SimpleTextOut.TestString = FileBasedSimpleTextOutTestString;
- ProtocolToReturn->SimpleTextOut.QueryMode = FileBasedSimpleTextOutQueryMode;
- ProtocolToReturn->SimpleTextOut.SetMode = FileBasedSimpleTextOutSetMode;
- ProtocolToReturn->SimpleTextOut.SetAttribute = FileBasedSimpleTextOutSetAttribute;
- ProtocolToReturn->SimpleTextOut.ClearScreen = FileBasedSimpleTextOutClearScreen;
- ProtocolToReturn->SimpleTextOut.SetCursorPosition = FileBasedSimpleTextOutSetCursorPosition;
- ProtocolToReturn->SimpleTextOut.EnableCursor = FileBasedSimpleTextOutEnableCursor;
- ProtocolToReturn->SimpleTextOut.OutputString = FileBasedSimpleTextOutOutputString;
- ProtocolToReturn->SimpleTextOut.Mode = AllocateZeroPool(sizeof(EFI_SIMPLE_TEXT_OUTPUT_MODE));
- if (ProtocolToReturn->SimpleTextOut.Mode == NULL) {
- FreePool(ProtocolToReturn);
- return (NULL);
- }
- ProtocolToReturn->SimpleTextOut.Mode->MaxMode = 0;
- ProtocolToReturn->SimpleTextOut.Mode->Mode = 0;
- ProtocolToReturn->SimpleTextOut.Mode->Attribute = 0;
- ProtocolToReturn->SimpleTextOut.Mode->CursorColumn = 0;
- ProtocolToReturn->SimpleTextOut.Mode->CursorRow = 0;
- ProtocolToReturn->SimpleTextOut.Mode->CursorVisible = FALSE;
-
- Status = gBS->InstallProtocolInterface(
- &(ProtocolToReturn->TheHandle),
- &gEfiSimpleTextOutProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &(ProtocolToReturn->SimpleTextOut));
- if (!EFI_ERROR(Status)) {
- *HandleLocation = ProtocolToReturn->TheHandle;
- return ((EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)ProtocolToReturn);
- } else {
- FreePool(ProtocolToReturn);
- return (NULL);
- }
-}
-
-/**
- Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a
- SHELL_FILE_HANDLE to support redirecting output from a file.
-
- @param[in] SimpleTextOut The pointer to the SimpleTextOUT to close.
-
- @retval EFI_SUCCESS The object was closed.
-**/
-EFI_STATUS
-EFIAPI
-CloseSimpleTextOutOnFile(
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut
- )
-{
- EFI_STATUS Status;
- if (SimpleTextOut == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- Status = gBS->UninstallProtocolInterface(
- ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->TheHandle,
- &gEfiSimpleTextOutProtocolGuid,
- &(((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->SimpleTextOut));
- FreePool(SimpleTextOut);
- return (Status);
-}
diff --git a/ShellPkg/Application/Shell/ConsoleWrappers.h b/ShellPkg/Application/Shell/ConsoleWrappers.h
deleted file mode 100644
index 572113d397..0000000000
--- a/ShellPkg/Application/Shell/ConsoleWrappers.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/** @file
- Function definitions for shell simple text in and out on top of file handles.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_CONSOLE_WRAPPERS_HEADER_
-#define _SHELL_CONSOLE_WRAPPERS_HEADER_
-
-/**
- Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a
- SHELL_FILE_HANDLE to support redirecting input from a file.
-
- @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use.
- @param[in] HandleLocation The pointer of a location to copy handle with protocol to.
-
- @retval NULL There was insufficient memory available.
- @return A pointer to the allocated protocol structure;
-**/
-EFI_SIMPLE_TEXT_INPUT_PROTOCOL*
-EFIAPI
-CreateSimpleTextInOnFile(
- IN SHELL_FILE_HANDLE FileHandleToUse,
- IN EFI_HANDLE *HandleLocation
- );
-
-/**
- Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a
- SHELL_FILE_HANDLE to support redirecting input from a file.
-
- @param[in] SimpleTextIn The pointer to the SimpleTextIn to close.
-
- @retval EFI_SUCCESS The object was closed.
-**/
-EFI_STATUS
-EFIAPI
-CloseSimpleTextInOnFile(
- IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *SimpleTextIn
- );
-
-/**
- Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a
- SHELL_FILE_HANDLE to support redirecting output from a file.
-
- @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use.
- @param[in] HandleLocation The pointer of a location to copy handle with protocol to.
-
- @retval NULL There was insufficient memory available.
- @return A pointer to the allocated protocol structure;
-**/
-EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*
-EFIAPI
-CreateSimpleTextOutOnFile(
- IN SHELL_FILE_HANDLE FileHandleToUse,
- IN EFI_HANDLE *HandleLocation
- );
-
-/**
- Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a
- SHELL_FILE_HANDLE to support redirecting output from a file.
-
- @param[in] SimpleTextOut The pointer to the SimpleTextOUT to close.
-
- @retval EFI_SUCCESS The object was closed.
-**/
-EFI_STATUS
-EFIAPI
-CloseSimpleTextOutOnFile(
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut
- );
-
-#endif //_SHELL_CONSOLE_WRAPPERS_HEADER_
-
diff --git a/ShellPkg/Application/Shell/FileHandleInternal.h b/ShellPkg/Application/Shell/FileHandleInternal.h
deleted file mode 100644
index 2aaae34214..0000000000
--- a/ShellPkg/Application/Shell/FileHandleInternal.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/** @file
- internal worker functions for FileHandleWrappers to use
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _FILE_HANDLE_INTERNAL_HEADER_
-#define _FILE_HANDLE_INTERNAL_HEADER_
-
-/**
- Move the cursor position one character backward.
-
- @param[in] LineLength Length of a line. Get it by calling QueryMode
- @param[in, out] Column Current column of the cursor position
- @param[in, out] Row Current row of the cursor position
-**/
-VOID
-EFIAPI
-MoveCursorBackward (
- IN UINTN LineLength,
- IN OUT UINTN *Column,
- IN OUT UINTN *Row
- );
-
-/**
- Move the cursor position one character forward.
-
- @param[in] LineLength Length of a line.
- @param[in] TotalRow Total row of a screen
- @param[in, out] Column Current column of the cursor position
- @param[in, out] Row Current row of the cursor position
-**/
-VOID
-EFIAPI
-MoveCursorForward (
- IN UINTN LineLength,
- IN UINTN TotalRow,
- IN OUT UINTN *Column,
- IN OUT UINTN *Row
- );
-
-/**
- Prints out each previously typed command in the command list history log.
-
- When each screen is full it will pause for a key before continuing.
-
- @param[in] TotalCols How many columns are on the screen
- @param[in] TotalRows How many rows are on the screen
- @param[in] StartColumn which column to start at
-**/
-VOID
-EFIAPI
-PrintCommandHistory (
- IN CONST UINTN TotalCols,
- IN CONST UINTN TotalRows,
- IN CONST UINTN StartColumn
- );
-
-#endif //_FILE_HANDLE_INTERNAL_HEADER_
-
diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c b/ShellPkg/Application/Shell/FileHandleWrappers.c
deleted file mode 100644
index 2ca13cb3f3..0000000000
--- a/ShellPkg/Application/Shell/FileHandleWrappers.c
+++ /dev/null
@@ -1,1798 +0,0 @@
-/** @file
- EFI_FILE_PROTOCOL wrappers for other items (Like Environment Variables,
- StdIn, StdOut, StdErr, etc...).
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "Shell.h"
-#include "FileHandleInternal.h"
-
-/**
- File style interface for console (Open).
-
- @param[in] This Ignored.
- @param[out] NewHandle Ignored.
- @param[in] FileName Ignored.
- @param[in] OpenMode Ignored.
- @param[in] Attributes Ignored.
-
- @retval EFI_NOT_FOUND
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceOpenNotFound(
- IN EFI_FILE_PROTOCOL *This,
- OUT EFI_FILE_PROTOCOL **NewHandle,
- IN CHAR16 *FileName,
- IN UINT64 OpenMode,
- IN UINT64 Attributes
- )
-{
- return (EFI_NOT_FOUND);
-}
-
-/**
- File style interface for console (Close, Delete, & Flush)
-
- @param[in] This Ignored.
-
- @retval EFI_SUCCESS
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceNopGeneric(
- IN EFI_FILE_PROTOCOL *This
- )
-{
- return (EFI_SUCCESS);
-}
-
-/**
- File style interface for console (GetPosition).
-
- @param[in] This Ignored.
- @param[out] Position Ignored.
-
- @retval EFI_UNSUPPORTED
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceNopGetPosition(
- IN EFI_FILE_PROTOCOL *This,
- OUT UINT64 *Position
- )
-{
- return (EFI_UNSUPPORTED);
-}
-
-/**
- File style interface for console (SetPosition).
-
- @param[in] This Ignored.
- @param[in] Position Ignored.
-
- @retval EFI_UNSUPPORTED
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceNopSetPosition(
- IN EFI_FILE_PROTOCOL *This,
- IN UINT64 Position
- )
-{
- return (EFI_UNSUPPORTED);
-}
-
-/**
- File style interface for console (GetInfo).
-
- @param[in] This Ignored.
- @param[in] InformationType Ignored.
- @param[in, out] BufferSize Ignored.
- @param[out] Buffer Ignored.
-
- @retval EFI_UNSUPPORTED
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceNopGetInfo(
- IN EFI_FILE_PROTOCOL *This,
- IN EFI_GUID *InformationType,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- )
-{
- return (EFI_UNSUPPORTED);
-}
-
-/**
- File style interface for console (SetInfo).
-
- @param[in] This Ignored.
- @param[in] InformationType Ignored.
- @param[in] BufferSize Ignored.
- @param[in] Buffer Ignored.
-
- @retval EFI_UNSUPPORTED
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceNopSetInfo(
- IN EFI_FILE_PROTOCOL *This,
- IN EFI_GUID *InformationType,
- IN UINTN BufferSize,
- IN VOID *Buffer
- )
-{
- return (EFI_UNSUPPORTED);
-}
-
-/**
- File style interface for StdOut (Write).
-
- Writes data to the screen.
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
- @param[in, out] BufferSize Size in bytes of Buffer.
- @param[in] Buffer The pointer to the buffer to write.
-
- @retval EFI_UNSUPPORTED No output console is supported.
- @return A return value from gST->ConOut->OutputString.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceStdOutWrite(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleOut) {
- return (EFI_UNSUPPORTED);
- } else {
- return (gST->ConOut->OutputString(gST->ConOut, Buffer));
- }
-}
-
-/**
- File style interface for StdIn (Write).
-
- @param[in] This Ignored.
- @param[in, out] BufferSize Ignored.
- @param[in] Buffer Ignored.
-
- @retval EFI_UNSUPPORTED
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceStdInWrite(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- return (EFI_UNSUPPORTED);
-}
-
-/**
- File style interface for console StdErr (Write).
-
- Writes error to the error output.
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
- @param[in, out] BufferSize Size in bytes of Buffer.
- @param[in] Buffer The pointer to the buffer to write.
-
- @return A return value from gST->StdErr->OutputString.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceStdErrWrite(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- return (gST->StdErr->OutputString(gST->StdErr, Buffer));
-}
-
-/**
- File style interface for console StdOut (Read).
-
- @param[in] This Ignored.
- @param[in, out] BufferSize Ignored.
- @param[out] Buffer Ignored.
-
- @retval EFI_UNSUPPORTED
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceStdOutRead(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- )
-{
- return (EFI_UNSUPPORTED);
-}
-
-/**
- File style interface for console StdErr (Read).
-
- @param[in] This Ignored.
- @param[in, out] BufferSize Ignored.
- @param[out] Buffer Ignored.
-
- @retval EFI_UNSUPPORTED Always.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceStdErrRead(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- )
-{
- return (EFI_UNSUPPORTED);
-}
-
-/**
- File style interface for NUL file (Read).
-
- @param[in] This Ignored.
- @param[in, out] BufferSize Poiner to 0 upon return.
- @param[out] Buffer Ignored.
-
- @retval EFI_SUCCESS Always.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceNulRead(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- )
-{
- *BufferSize = 0;
- return (EFI_SUCCESS);
-}
-
-/**
- File style interface for NUL file (Write).
-
- @param[in] This Ignored.
- @param[in, out] BufferSize Ignored.
- @param[in] Buffer Ignored.
-
- @retval EFI_SUCCESS
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceNulWrite(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- return (EFI_SUCCESS);
-}
-
-/**
- File style interface for console (Read).
-
- This will return a single line of input from the console.
-
- @param This A pointer to the EFI_FILE_PROTOCOL instance that is the
- file handle to read data from. Not used.
- @param BufferSize On input, the size of the Buffer. On output, the amount
- of data returned in Buffer. In both cases, the size is
- measured in bytes.
- @param Buffer The buffer into which the data is read.
-
-
- @retval EFI_SUCCESS The data was read.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_DEVICE_ERROR An attempt was made to read from a deleted file.
- @retval EFI_DEVICE_ERROR On entry, the current file position is beyond the end of the file.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory
- entry. BufferSize has been updated with the size
- needed to complete the request.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceStdInRead(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- )
-{
- CHAR16 *CurrentString;
- BOOLEAN Done;
- UINTN Column; // Column of current cursor
- UINTN Row; // Row of current cursor
- UINTN StartColumn; // Column at the beginning of the line
- UINTN Update; // Line index for update
- UINTN Delete; // Num of chars to delete from console after update
- UINTN StringLen; // Total length of the line
- UINTN StringCurPos; // Line index corresponding to the cursor
- UINTN MaxStr; // Maximum possible line length
- UINTN Index;
- UINTN TotalColumn; // Num of columns in the console
- UINTN TotalRow; // Num of rows in the console
- UINTN SkipLength;
- UINTN OutputLength; // Length of the update string
- UINTN TailRow; // Row of end of line
- UINTN TailColumn; // Column of end of line
- EFI_INPUT_KEY Key;
-
- BUFFER_LIST *LinePos;
- BUFFER_LIST *NewPos;
- BOOLEAN InScrolling;
- EFI_STATUS Status;
- BOOLEAN InTabScrolling; // Whether in TAB-completion state
- EFI_SHELL_FILE_INFO *FoundFileList;
- EFI_SHELL_FILE_INFO *TabLinePos;
- EFI_SHELL_FILE_INFO *TempPos;
- CHAR16 *TabStr;
- CHAR16 *TabOutputStr;
- BOOLEAN InQuotationMode;
- CHAR16 *TempStr;
- UINTN TabPos; // Start index of the string to search for TAB completion.
- UINTN TabUpdatePos; // Start index of the string updated by TAB stroke
-// UINTN Count;
- UINTN EventIndex;
- CONST CHAR16 *Cwd;
-
- //
- // If buffer is not large enough to hold a CHAR16, return minimum buffer size
- //
- if (*BufferSize < sizeof (CHAR16) * 2) {
- *BufferSize = sizeof (CHAR16) * 2;
- return (EFI_BUFFER_TOO_SMALL);
- }
-
- Done = FALSE;
- CurrentString = Buffer;
- StringLen = 0;
- StringCurPos = 0;
- OutputLength = 0;
- Update = 0;
- Delete = 0;
- LinePos = NewPos = (BUFFER_LIST*)(&ShellInfoObject.ViewingSettings.CommandHistory);
- InScrolling = FALSE;
- InTabScrolling = FALSE;
- Status = EFI_SUCCESS;
- TabLinePos = NULL;
- FoundFileList = NULL;
- TempPos = NULL;
- TabPos = 0;
- TabUpdatePos = 0;
-
- //
- // Allocate buffers
- //
- TabStr = AllocateZeroPool (*BufferSize);
- if (TabStr == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- TabOutputStr = AllocateZeroPool (*BufferSize);
- if (TabOutputStr == NULL) {
- FreePool(TabStr);
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Get the screen setting and the current cursor location
- //
- Column = StartColumn = gST->ConOut->Mode->CursorColumn;
- Row = gST->ConOut->Mode->CursorRow;
- gST->ConOut->QueryMode (gST->ConOut, gST->ConOut->Mode->Mode, &TotalColumn, &TotalRow);
-
- //
- // Limit the line length to the buffer size or the minimun size of the
- // screen. (The smaller takes effect)
- //
- MaxStr = TotalColumn * (TotalRow - 1) - StartColumn;
- if (MaxStr > *BufferSize / sizeof (CHAR16)) {
- MaxStr = *BufferSize / sizeof (CHAR16);
- }
- ZeroMem (CurrentString, MaxStr * sizeof (CHAR16));
- do {
- //
- // Read a key
- //
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- //
- // Press PageUp or PageDown to scroll the history screen up or down.
- // Press any other key to quit scrolling.
- //
- if (Key.UnicodeChar == 0 && (Key.ScanCode == SCAN_PAGE_UP || Key.ScanCode == SCAN_PAGE_DOWN)) {
- if (Key.ScanCode == SCAN_PAGE_UP) {
- ConsoleLoggerDisplayHistory(FALSE, 0, ShellInfoObject.ConsoleInfo);
- } else if (Key.ScanCode == SCAN_PAGE_DOWN) {
- ConsoleLoggerDisplayHistory(TRUE, 0, ShellInfoObject.ConsoleInfo);
- }
-
- InScrolling = TRUE;
- } else {
- if (InScrolling) {
- ConsoleLoggerStopHistory(ShellInfoObject.ConsoleInfo);
- InScrolling = FALSE;
- }
- }
-
- //
- // If we are quitting TAB scrolling...
- //
- if (InTabScrolling && Key.UnicodeChar != CHAR_TAB) {
- if (FoundFileList != NULL) {
- ShellInfoObject.NewEfiShellProtocol->FreeFileList (&FoundFileList);
- DEBUG_CODE(FoundFileList = NULL;);
- }
- InTabScrolling = FALSE;
- }
-
- switch (Key.UnicodeChar) {
- case CHAR_CARRIAGE_RETURN:
- //
- // All done, print a newline at the end of the string
- //
- TailRow = Row + (StringLen - StringCurPos + Column) / TotalColumn;
- TailColumn = (StringLen - StringCurPos + Column) % TotalColumn;
- ShellPrintEx ((INT32)TailColumn, (INT32)TailRow, L"%N\n");
- Done = TRUE;
- break;
-
- case CHAR_BACKSPACE:
- if (StringCurPos != 0) {
- //
- // If not move back beyond string beginning, move all characters behind
- // the current position one character forward
- //
- StringCurPos--;
- Update = StringCurPos;
- Delete = 1;
- CopyMem (CurrentString + StringCurPos, CurrentString + StringCurPos + 1, sizeof (CHAR16) * (StringLen - StringCurPos));
-
- //
- // Adjust the current column and row
- //
- MoveCursorBackward (TotalColumn, &Column, &Row);
- }
- break;
-
- case CHAR_TAB:
- //
- // handle auto complete of file and directory names...
- //
- if (InTabScrolling) {
- ASSERT(FoundFileList != NULL);
- ASSERT(TabLinePos != NULL);
- TabLinePos = (EFI_SHELL_FILE_INFO*)GetNextNode(&(FoundFileList->Link), &TabLinePos->Link);
- if (IsNull(&(FoundFileList->Link), &TabLinePos->Link)) {
- TabLinePos = (EFI_SHELL_FILE_INFO*)GetNextNode(&(FoundFileList->Link), &TabLinePos->Link);
- }
- } else {
- TabPos = 0;
- TabUpdatePos = 0;
- InQuotationMode = FALSE;
- for (Index = 0; Index < StringLen; Index++) {
- if (CurrentString[Index] == L'\"') {
- InQuotationMode = (BOOLEAN)(!InQuotationMode);
- }
- if (CurrentString[Index] == L' ' && !InQuotationMode) {
- TabPos = Index + 1;
- TabUpdatePos = Index + 1;
- }
- if (CurrentString[Index] == L'\\') {
- TabUpdatePos = Index + 1;
- }
- }
- if (StrStr(CurrentString + TabPos, L":") == NULL) {
- Cwd = ShellInfoObject.NewEfiShellProtocol->GetCurDir(NULL);
- if (Cwd != NULL) {
- StrCpy(TabStr, Cwd);
- if (TabStr[StrLen(TabStr)-1] == L'\\' && *(CurrentString + TabPos) == L'\\' ) {
- TabStr[StrLen(TabStr)-1] = CHAR_NULL;
- }
- StrnCat(TabStr, CurrentString + TabPos, (StringLen - TabPos) * sizeof (CHAR16));
- } else {
- StrCpy(TabStr, L"");
- StrnCat(TabStr, CurrentString + TabPos, (StringLen - TabPos) * sizeof (CHAR16));
- }
- } else {
- StrCpy(TabStr, CurrentString + TabPos);
- }
- StrCat(TabStr, L"*");
- FoundFileList = NULL;
-// TabStr = PathCleanUpDirectories(TabStr);
- Status = ShellInfoObject.NewEfiShellProtocol->FindFiles(TabStr, &FoundFileList);
- for ( TempStr = CurrentString
- ; *TempStr == L' '
- ; TempStr++); // note the ';'... empty for loop
- //
- // make sure we have a list before we do anything more...
- //
- if (EFI_ERROR (Status) || FoundFileList == NULL) {
- InTabScrolling = FALSE;
- TabLinePos = NULL;
- continue;
- } else {
- //
- // enumerate through the list of files
- //
- for ( TempPos = (EFI_SHELL_FILE_INFO*)GetFirstNode(&(FoundFileList->Link))
- ; !IsNull(&FoundFileList->Link, &TempPos->Link)
- ; TempPos = (EFI_SHELL_FILE_INFO*)GetNextNode(&(FoundFileList->Link), &(TempPos->Link))
- ){
- //
- // If "cd" is typed, only directory name will be auto-complete filled
- // in either case . and .. will be removed.
- //
- if ((((TempStr[0] == L'c' || TempStr[0] == L'C') &&
- (TempStr[1] == L'd' || TempStr[1] == L'D')
- ) && ((ShellIsDirectory(TempPos->FullName) != EFI_SUCCESS)
- ||(StrCmp(TempPos->FileName, L".") == 0)
- ||(StrCmp(TempPos->FileName, L"..") == 0)
- )) || ((StrCmp(TempPos->FileName, L".") == 0)
- ||(StrCmp(TempPos->FileName, L"..") == 0))){
- TabLinePos = TempPos;
- TempPos = (EFI_SHELL_FILE_INFO*)(RemoveEntryList(&(TempPos->Link))->BackLink);
- InternalFreeShellFileInfoNode(TabLinePos);
- }
- }
- if (FoundFileList != NULL && !IsListEmpty(&FoundFileList->Link)) {
- TabLinePos = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FoundFileList->Link);
- InTabScrolling = TRUE;
- } else {
- FreePool(FoundFileList);
- FoundFileList = NULL;
- }
- }
- }
- break;
-
- default:
- if (Key.UnicodeChar >= ' ') {
- //
- // If we are at the buffer's end, drop the key
- //
- if (StringLen == MaxStr - 1 && (ShellInfoObject.ViewingSettings.InsertMode || StringCurPos == StringLen)) {
- break;
- }
- //
- // If in insert mode, make space by moving each other character 1
- // space higher in the array
- //
- if (ShellInfoObject.ViewingSettings.InsertMode) {
- CopyMem(CurrentString + StringCurPos + 1, CurrentString + StringCurPos, (StringLen - StringCurPos)*sizeof(CurrentString[0]));
- }
-
- CurrentString[StringCurPos] = Key.UnicodeChar;
- Update = StringCurPos;
-
- StringCurPos += 1;
- OutputLength = 1;
- }
- break;
-
- case 0:
- switch (Key.ScanCode) {
- case SCAN_DELETE:
- //
- // Move characters behind current position one character forward
- //
- if (StringLen != 0) {
- Update = StringCurPos;
- Delete = 1;
- CopyMem (CurrentString + StringCurPos, CurrentString + StringCurPos + 1, sizeof (CHAR16) * (StringLen - StringCurPos));
- }
- break;
-
- case SCAN_UP:
- //
- // Prepare to print the previous command
- //
- NewPos = (BUFFER_LIST*)GetPreviousNode(&ShellInfoObject.ViewingSettings.CommandHistory.Link, &LinePos->Link);
- if (IsNull(&ShellInfoObject.ViewingSettings.CommandHistory.Link, &LinePos->Link)) {
- NewPos = (BUFFER_LIST*)GetPreviousNode(&ShellInfoObject.ViewingSettings.CommandHistory.Link, &LinePos->Link);
- }
- break;
-
- case SCAN_DOWN:
- //
- // Prepare to print the next command
- //
- NewPos = (BUFFER_LIST*)GetNextNode(&ShellInfoObject.ViewingSettings.CommandHistory.Link, &LinePos->Link);
- if (NewPos == (BUFFER_LIST*)(&ShellInfoObject.ViewingSettings.CommandHistory)) {
- NewPos = (BUFFER_LIST*)GetNextNode(&ShellInfoObject.ViewingSettings.CommandHistory.Link, &LinePos->Link);
- }
- break;
-
- case SCAN_LEFT:
- //
- // Adjust current cursor position
- //
- if (StringCurPos != 0) {
- --StringCurPos;
- MoveCursorBackward (TotalColumn, &Column, &Row);
- }
- break;
-
- case SCAN_RIGHT:
- //
- // Adjust current cursor position
- //
- if (StringCurPos < StringLen) {
- ++StringCurPos;
- MoveCursorForward (TotalColumn, TotalRow, &Column, &Row);
- }
- break;
-
- case SCAN_HOME:
- //
- // Move current cursor position to the beginning of the command line
- //
- Row -= (StringCurPos + StartColumn) / TotalColumn;
- Column = StartColumn;
- StringCurPos = 0;
- break;
-
- case SCAN_END:
- //
- // Move current cursor position to the end of the command line
- //
- TailRow = Row + (StringLen - StringCurPos + Column) / TotalColumn;
- TailColumn = (StringLen - StringCurPos + Column) % TotalColumn;
- Row = TailRow;
- Column = TailColumn;
- StringCurPos = StringLen;
- break;
-
- case SCAN_ESC:
- //
- // Prepare to clear the current command line
- //
- CurrentString[0] = 0;
- Update = 0;
- Delete = StringLen;
- Row -= (StringCurPos + StartColumn) / TotalColumn;
- Column = StartColumn;
- OutputLength = 0;
- break;
-
- case SCAN_INSERT:
- //
- // Toggle the SEnvInsertMode flag
- //
- ShellInfoObject.ViewingSettings.InsertMode = (BOOLEAN)!ShellInfoObject.ViewingSettings.InsertMode;
- break;
-
- case SCAN_F7:
- //
- // Print command history
- //
- PrintCommandHistory (TotalColumn, TotalRow, 4);
- *CurrentString = CHAR_NULL;
- Done = TRUE;
- break;
- }
- }
-
- if (Done) {
- break;
- }
-
- //
- // If we are in auto-complete mode, we are preparing to print
- // the next file or directory name
- //
- if (InTabScrolling) {
- //
- // Adjust the column and row to the start of TAB-completion string.
- //
- Column = (StartColumn + TabUpdatePos) % TotalColumn;
- Row -= (StartColumn + StringCurPos) / TotalColumn - (StartColumn + TabUpdatePos) / TotalColumn;
- OutputLength = StrLen (TabLinePos->FileName);
- //
- // if the output string contains blank space, quotation marks L'\"'
- // should be added to the output.
- //
- if (StrStr(TabLinePos->FileName, L" ") != NULL){
- TabOutputStr[0] = L'\"';
- CopyMem (TabOutputStr + 1, TabLinePos->FileName, OutputLength * sizeof (CHAR16));
- TabOutputStr[OutputLength + 1] = L'\"';
- TabOutputStr[OutputLength + 2] = CHAR_NULL;
- } else {
- CopyMem (TabOutputStr, TabLinePos->FileName, OutputLength * sizeof (CHAR16));
- TabOutputStr[OutputLength] = CHAR_NULL;
- }
- OutputLength = StrLen (TabOutputStr) < MaxStr - 1 ? StrLen (TabOutputStr) : MaxStr - 1;
- CopyMem (CurrentString + TabUpdatePos, TabOutputStr, OutputLength * sizeof (CHAR16));
- CurrentString[TabUpdatePos + OutputLength] = CHAR_NULL;
- StringCurPos = TabUpdatePos + OutputLength;
- Update = TabUpdatePos;
- if (StringLen > TabUpdatePos + OutputLength) {
- Delete = StringLen - TabUpdatePos - OutputLength;
- }
- }
-
- //
- // If we have a new position, we are preparing to print a previous or
- // next command.
- //
- if (NewPos != (BUFFER_LIST*)(&ShellInfoObject.ViewingSettings.CommandHistory)) {
- Column = StartColumn;
- Row -= (StringCurPos + StartColumn) / TotalColumn;
-
- LinePos = NewPos;
- NewPos = (BUFFER_LIST*)(&ShellInfoObject.ViewingSettings.CommandHistory);
-
- OutputLength = StrLen (LinePos->Buffer) < MaxStr - 1 ? StrLen (LinePos->Buffer) : MaxStr - 1;
- CopyMem (CurrentString, LinePos->Buffer, OutputLength * sizeof (CHAR16));
- CurrentString[OutputLength] = CHAR_NULL;
-
- StringCurPos = OutputLength;
-
- //
- // Draw new input string
- //
- Update = 0;
- if (StringLen > OutputLength) {
- //
- // If old string was longer, blank its tail
- //
- Delete = StringLen - OutputLength;
- }
- }
- //
- // If we need to update the output do so now
- //
- if (Update != (UINTN) -1) {
- ShellPrintEx ((INT32)Column, (INT32)Row, L"%s%.*s", CurrentString + Update, Delete, L"");
- StringLen = StrLen (CurrentString);
-
- if (Delete != 0) {
- SetMem (CurrentString + StringLen, Delete * sizeof (CHAR16), CHAR_NULL);
- }
-
- if (StringCurPos > StringLen) {
- StringCurPos = StringLen;
- }
-
- Update = (UINTN) -1;
-
- //
- // After using print to reflect newly updates, if we're not using
- // BACKSPACE and DELETE, we need to move the cursor position forward,
- // so adjust row and column here.
- //
- if (Key.UnicodeChar != CHAR_BACKSPACE && !(Key.UnicodeChar == 0 && Key.ScanCode == SCAN_DELETE)) {
- //
- // Calulate row and column of the tail of current string
- //
- TailRow = Row + (StringLen - StringCurPos + Column + OutputLength) / TotalColumn;
- TailColumn = (StringLen - StringCurPos + Column + OutputLength) % TotalColumn;
-
- //
- // If the tail of string reaches screen end, screen rolls up, so if
- // Row does not equal TailRow, Row should be decremented
- //
- // (if we are recalling commands using UPPER and DOWN key, and if the
- // old command is too long to fit the screen, TailColumn must be 79.
- //
- if (TailColumn == 0 && TailRow >= TotalRow && Row != TailRow) {
- Row--;
- }
- //
- // Calculate the cursor position after current operation. If cursor
- // reaches line end, update both row and column, otherwise, only
- // column will be changed.
- //
- if (Column + OutputLength >= TotalColumn) {
- SkipLength = OutputLength - (TotalColumn - Column);
-
- Row += SkipLength / TotalColumn + 1;
- if (Row > TotalRow - 1) {
- Row = TotalRow - 1;
- }
-
- Column = SkipLength % TotalColumn;
- } else {
- Column += OutputLength;
- }
- }
-
- Delete = 0;
- }
- //
- // Set the cursor position for this key
- //
- gST->ConOut->SetCursorPosition (gST->ConOut, Column, Row);
- } while (!Done);
-
- if (CurrentString != NULL && StrLen(CurrentString) > 0) {
- //
- // add the line to the history buffer
- //
- AddLineToCommandHistory(CurrentString);
- }
-
- FreePool (TabStr);
- FreePool (TabOutputStr);
- //
- // Return the data to the caller
- //
- *BufferSize = StringLen * sizeof (CHAR16);
-
- //
- // if this was used it should be deallocated by now...
- // prevent memory leaks...
- //
- ASSERT(FoundFileList == NULL);
-
- return EFI_SUCCESS;
-}
-
-//
-// FILE sytle interfaces for StdIn/StdOut/StdErr
-//
-EFI_FILE_PROTOCOL FileInterfaceStdIn = {
- EFI_FILE_REVISION,
- FileInterfaceOpenNotFound,
- FileInterfaceNopGeneric,
- FileInterfaceNopGeneric,
- FileInterfaceStdInRead,
- FileInterfaceStdInWrite,
- FileInterfaceNopGetPosition,
- FileInterfaceNopSetPosition,
- FileInterfaceNopGetInfo,
- FileInterfaceNopSetInfo,
- FileInterfaceNopGeneric
-};
-
-EFI_FILE_PROTOCOL FileInterfaceStdOut = {
- EFI_FILE_REVISION,
- FileInterfaceOpenNotFound,
- FileInterfaceNopGeneric,
- FileInterfaceNopGeneric,
- FileInterfaceStdOutRead,
- FileInterfaceStdOutWrite,
- FileInterfaceNopGetPosition,
- FileInterfaceNopSetPosition,
- FileInterfaceNopGetInfo,
- FileInterfaceNopSetInfo,
- FileInterfaceNopGeneric
-};
-
-EFI_FILE_PROTOCOL FileInterfaceStdErr = {
- EFI_FILE_REVISION,
- FileInterfaceOpenNotFound,
- FileInterfaceNopGeneric,
- FileInterfaceNopGeneric,
- FileInterfaceStdErrRead,
- FileInterfaceStdErrWrite,
- FileInterfaceNopGetPosition,
- FileInterfaceNopSetPosition,
- FileInterfaceNopGetInfo,
- FileInterfaceNopSetInfo,
- FileInterfaceNopGeneric
-};
-
-EFI_FILE_PROTOCOL FileInterfaceNulFile = {
- EFI_FILE_REVISION,
- FileInterfaceOpenNotFound,
- FileInterfaceNopGeneric,
- FileInterfaceNopGeneric,
- FileInterfaceNulRead,
- FileInterfaceNulWrite,
- FileInterfaceNopGetPosition,
- FileInterfaceNopSetPosition,
- FileInterfaceNopGetInfo,
- FileInterfaceNopSetInfo,
- FileInterfaceNopGeneric
-};
-
-
-
-
-//
-// This is identical to EFI_FILE_PROTOCOL except for the additional member
-// for the name.
-//
-
-typedef struct {
- UINT64 Revision;
- EFI_FILE_OPEN Open;
- EFI_FILE_CLOSE Close;
- EFI_FILE_DELETE Delete;
- EFI_FILE_READ Read;
- EFI_FILE_WRITE Write;
- EFI_FILE_GET_POSITION GetPosition;
- EFI_FILE_SET_POSITION SetPosition;
- EFI_FILE_GET_INFO GetInfo;
- EFI_FILE_SET_INFO SetInfo;
- EFI_FILE_FLUSH Flush;
- CHAR16 Name[1];
-} EFI_FILE_PROTOCOL_ENVIRONMENT;
-//ANSI compliance helper to get size of the struct.
-#define SIZE_OF_EFI_FILE_PROTOCOL_ENVIRONMENT EFI_FIELD_OFFSET (EFI_FILE_PROTOCOL_ENVIRONMENT, Name)
-
-/**
- File style interface for Environment Variable (Close).
-
- Frees the memory for this object.
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
-
- @retval EFI_SUCCESS
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceEnvClose(
- IN EFI_FILE_PROTOCOL *This
- )
-{
- FreePool((EFI_FILE_PROTOCOL_ENVIRONMENT*)This);
- return (EFI_SUCCESS);
-}
-
-/**
- File style interface for Environment Variable (Delete).
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
-
- @retval The return value from FileInterfaceEnvClose().
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceEnvDelete(
- IN EFI_FILE_PROTOCOL *This
- )
-{
- SHELL_DELETE_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name);
- return (FileInterfaceEnvClose(This));
-}
-
-/**
- File style interface for Environment Variable (Read).
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
- @param[in, out] BufferSize Size in bytes of Buffer.
- @param[out] Buffer The pointer to the buffer to fill.
-
- @retval EFI_SUCCESS The data was read.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceEnvRead(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- )
-{
- return (SHELL_GET_ENVIRONMENT_VARIABLE(
- ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,
- BufferSize,
- Buffer));
-}
-
-/**
- File style interface for Volatile Environment Variable (Write).
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
- @param[in, out] BufferSize Size in bytes of Buffer.
- @param[in] Buffer The pointer to the buffer to write.
-
- @retval EFI_SUCCESS The data was read.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceEnvVolWrite(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- VOID* NewBuffer;
- UINTN NewSize;
- EFI_STATUS Status;
-
- NewBuffer = NULL;
- NewSize = 0;
-
- Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);
- if (Status == EFI_BUFFER_TOO_SMALL){
- NewBuffer = AllocateZeroPool(NewSize + *BufferSize + sizeof(CHAR16));
- Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);
- }
- if (!EFI_ERROR(Status) && NewBuffer != NULL) {
- while (((CHAR16*)NewBuffer)[NewSize/2] == CHAR_NULL) {
- //
- // We want to overwrite the CHAR_NULL
- //
- NewSize -= 2;
- }
- CopyMem((UINT8*)NewBuffer + NewSize + 2, Buffer, *BufferSize);
- Status = SHELL_SET_ENVIRONMENT_VARIABLE_V(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, StrSize(NewBuffer), NewBuffer);
- FreePool(NewBuffer);
- return (Status);
- } else {
- SHELL_FREE_NON_NULL(NewBuffer);
- return (SHELL_SET_ENVIRONMENT_VARIABLE_V(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, *BufferSize, Buffer));
- }
-}
-
-
-/**
- File style interface for Non Volatile Environment Variable (Write).
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
- @param[in, out] BufferSize Size in bytes of Buffer.
- @param[in] Buffer The pointer to the buffer to write.
-
- @retval EFI_SUCCESS The data was read.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceEnvNonVolWrite(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- VOID* NewBuffer;
- UINTN NewSize;
- EFI_STATUS Status;
-
- NewBuffer = NULL;
- NewSize = 0;
-
- Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);
- if (Status == EFI_BUFFER_TOO_SMALL){
- NewBuffer = AllocateZeroPool(NewSize + *BufferSize);
- Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);
- }
- if (!EFI_ERROR(Status)) {
- CopyMem((UINT8*)NewBuffer + NewSize, Buffer, *BufferSize);
- return (SHELL_SET_ENVIRONMENT_VARIABLE_NV(
- ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,
- NewSize + *BufferSize,
- NewBuffer));
- } else {
- return (SHELL_SET_ENVIRONMENT_VARIABLE_NV(
- ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,
- *BufferSize,
- Buffer));
- }
-}
-
-/**
- Creates a EFI_FILE_PROTOCOL (almost) object for using to access
- environment variables through file operations.
-
- @param EnvName The name of the Environment Variable to be operated on.
-
- @retval NULL Memory could not be allocated.
- @return other a pointer to an EFI_FILE_PROTOCOL structure
-**/
-EFI_FILE_PROTOCOL*
-EFIAPI
-CreateFileInterfaceEnv(
- IN CONST CHAR16 *EnvName
- )
-{
- EFI_FILE_PROTOCOL_ENVIRONMENT *EnvFileInterface;
-
- if (EnvName == NULL) {
- return (NULL);
- }
-
- //
- // Get some memory
- //
- EnvFileInterface = AllocateZeroPool(sizeof(EFI_FILE_PROTOCOL_ENVIRONMENT)+StrSize(EnvName));
- if (EnvFileInterface == NULL){
- return (NULL);
- }
-
- //
- // Assign the generic members
- //
- EnvFileInterface->Revision = EFI_FILE_REVISION;
- EnvFileInterface->Open = FileInterfaceOpenNotFound;
- EnvFileInterface->Close = FileInterfaceEnvClose;
- EnvFileInterface->GetPosition = FileInterfaceNopGetPosition;
- EnvFileInterface->SetPosition = FileInterfaceNopSetPosition;
- EnvFileInterface->GetInfo = FileInterfaceNopGetInfo;
- EnvFileInterface->SetInfo = FileInterfaceNopSetInfo;
- EnvFileInterface->Flush = FileInterfaceNopGeneric;
- EnvFileInterface->Delete = FileInterfaceEnvDelete;
- EnvFileInterface->Read = FileInterfaceEnvRead;
-
- StrCpy(EnvFileInterface->Name, EnvName);
-
- //
- // Assign the different members for Volatile and Non-Volatile variables
- //
- if (IsVolatileEnv(EnvName)) {
- EnvFileInterface->Write = FileInterfaceEnvVolWrite;
- } else {
- EnvFileInterface->Write = FileInterfaceEnvNonVolWrite;
- }
- return ((EFI_FILE_PROTOCOL *)EnvFileInterface);
-}
-
-/**
- Move the cursor position one character backward.
-
- @param[in] LineLength Length of a line. Get it by calling QueryMode
- @param[in, out] Column Current column of the cursor position
- @param[in, out] Row Current row of the cursor position
-**/
-VOID
-EFIAPI
-MoveCursorBackward (
- IN UINTN LineLength,
- IN OUT UINTN *Column,
- IN OUT UINTN *Row
- )
-{
- //
- // If current column is 0, move to the last column of the previous line,
- // otherwise, just decrement column.
- //
- if (*Column == 0) {
- *Column = LineLength - 1;
- if (*Row > 0) {
- (*Row)--;
- }
- return;
- }
- (*Column)--;
-}
-
-/**
- Move the cursor position one character forward.
-
- @param[in] LineLength Length of a line.
- @param[in] TotalRow Total row of a screen
- @param[in, out] Column Current column of the cursor position
- @param[in, out] Row Current row of the cursor position
-**/
-VOID
-EFIAPI
-MoveCursorForward (
- IN UINTN LineLength,
- IN UINTN TotalRow,
- IN OUT UINTN *Column,
- IN OUT UINTN *Row
- )
-{
- //
- // Increment Column.
- // If this puts column past the end of the line, move to first column
- // of the next row.
- //
- (*Column)++;
- if (*Column >= LineLength) {
- (*Column) = 0;
- if ((*Row) < TotalRow - 1) {
- (*Row)++;
- }
- }
-}
-
-/**
- Prints out each previously typed command in the command list history log.
-
- When each screen is full it will pause for a key before continuing.
-
- @param[in] TotalCols How many columns are on the screen
- @param[in] TotalRows How many rows are on the screen
- @param[in] StartColumn which column to start at
-**/
-VOID
-EFIAPI
-PrintCommandHistory (
- IN CONST UINTN TotalCols,
- IN CONST UINTN TotalRows,
- IN CONST UINTN StartColumn
- )
-{
- BUFFER_LIST *Node;
- UINTN Index;
- UINTN LineNumber;
- UINTN LineCount;
-
- ShellPrintEx (-1, -1, L"\n");
- Index = 0;
- LineNumber = 0;
- //
- // go through history list...
- //
- for ( Node = (BUFFER_LIST*)GetFirstNode(&ShellInfoObject.ViewingSettings.CommandHistory.Link)
- ; !IsNull(&ShellInfoObject.ViewingSettings.CommandHistory.Link, &Node->Link)
- ; Node = (BUFFER_LIST*)GetNextNode(&ShellInfoObject.ViewingSettings.CommandHistory.Link, &Node->Link)
- ){
- Index++;
- LineCount = ((StrLen (Node->Buffer) + StartColumn + 1) / TotalCols) + 1;
-
- if (LineNumber + LineCount >= TotalRows) {
- ShellPromptForResponseHii(
- ShellPromptResponseTypeEnterContinue,
- STRING_TOKEN (STR_SHELL_ENTER_TO_CONT),
- ShellInfoObject.HiiHandle,
- NULL
- );
- LineNumber = 0;
- }
- ShellPrintEx (-1, -1, L"%2d. %s\n", Index, Node->Buffer);
- LineNumber += LineCount;
- }
-}
-
-
-
-
-
-
-//
-// This is identical to EFI_FILE_PROTOCOL except for the additional members
-// for the buffer, size, and position.
-//
-
-typedef struct {
- UINT64 Revision;
- EFI_FILE_OPEN Open;
- EFI_FILE_CLOSE Close;
- EFI_FILE_DELETE Delete;
- EFI_FILE_READ Read;
- EFI_FILE_WRITE Write;
- EFI_FILE_GET_POSITION GetPosition;
- EFI_FILE_SET_POSITION SetPosition;
- EFI_FILE_GET_INFO GetInfo;
- EFI_FILE_SET_INFO SetInfo;
- EFI_FILE_FLUSH Flush;
- VOID *Buffer;
- UINT64 Position;
- UINT64 BufferSize;
- BOOLEAN Unicode;
-} EFI_FILE_PROTOCOL_MEM;
-
-/**
- File style interface for Mem (SetPosition).
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
- @param[out] Position The position to set.
-
- @retval EFI_SUCCESS The position was successfully changed.
- @retval EFI_INVALID_PARAMETER The Position was invalid.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceMemSetPosition(
- IN EFI_FILE_PROTOCOL *This,
- OUT UINT64 Position
- )
-{
- if (Position <= ((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize) {
- ((EFI_FILE_PROTOCOL_MEM*)This)->Position = Position;
- return (EFI_SUCCESS);
- } else {
- return (EFI_INVALID_PARAMETER);
- }
-}
-
-/**
- File style interface for Mem (GetPosition).
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
- @param[out] Position The pointer to the position.
-
- @retval EFI_SUCCESS The position was retrieved.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceMemGetPosition(
- IN EFI_FILE_PROTOCOL *This,
- OUT UINT64 *Position
- )
-{
- *Position = ((EFI_FILE_PROTOCOL_MEM*)This)->Position;
- return (EFI_SUCCESS);
-}
-
-/**
- File style interface for Mem (Write).
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
- @param[in, out] BufferSize Size in bytes of Buffer.
- @param[in] Buffer The pointer to the buffer to write.
-
- @retval EFI_OUT_OF_RESOURCES The operation failed due to lack of resources.
- @retval EFI_SUCCESS The data was written.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceMemWrite(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- CHAR8 *AsciiBuffer;
- if (((EFI_FILE_PROTOCOL_MEM*)This)->Unicode) {
- //
- // Unicode
- //
- if ((UINTN)(((EFI_FILE_PROTOCOL_MEM*)This)->Position + (*BufferSize)) > (UINTN)(((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize)) {
- ((EFI_FILE_PROTOCOL_MEM*)This)->Buffer = ReallocatePool((UINTN)(((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize), (UINTN)(((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize) + (*BufferSize) + 10, ((EFI_FILE_PROTOCOL_MEM*)This)->Buffer);
- ((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize += (*BufferSize) + 10;
- }
- CopyMem(((UINT8*)((EFI_FILE_PROTOCOL_MEM*)This)->Buffer) + ((EFI_FILE_PROTOCOL_MEM*)This)->Position, Buffer, *BufferSize);
- ((EFI_FILE_PROTOCOL_MEM*)This)->Position += (*BufferSize);
- return (EFI_SUCCESS);
- } else {
- //
- // Ascii
- //
- AsciiBuffer = AllocateZeroPool(*BufferSize);
- if (AsciiBuffer == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiSPrint(AsciiBuffer, *BufferSize, "%S", Buffer);
- if ((UINTN)(((EFI_FILE_PROTOCOL_MEM*)This)->Position + AsciiStrSize(AsciiBuffer)) > (UINTN)(((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize)) {
- ((EFI_FILE_PROTOCOL_MEM*)This)->Buffer = ReallocatePool((UINTN)(((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize), (UINTN)(((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize) + AsciiStrSize(AsciiBuffer) + 10, ((EFI_FILE_PROTOCOL_MEM*)This)->Buffer);
- ((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize += AsciiStrSize(AsciiBuffer) + 10;
- }
- CopyMem(((UINT8*)((EFI_FILE_PROTOCOL_MEM*)This)->Buffer) + ((EFI_FILE_PROTOCOL_MEM*)This)->Position, AsciiBuffer, AsciiStrSize(AsciiBuffer));
- ((EFI_FILE_PROTOCOL_MEM*)This)->Position += AsciiStrSize(AsciiBuffer);
- FreePool(AsciiBuffer);
- return (EFI_SUCCESS);
- }
-}
-
-/**
- File style interface for Mem (Read).
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
- @param[in, out] BufferSize Size in bytes of Buffer.
- @param[in] Buffer The pointer to the buffer to fill.
-
- @retval EFI_SUCCESS The data was read.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceMemRead(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- if (*BufferSize > (UINTN)((((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize) - (UINTN)(((EFI_FILE_PROTOCOL_MEM*)This)->Position))) {
- (*BufferSize) = (UINTN)((((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize) - (UINTN)(((EFI_FILE_PROTOCOL_MEM*)This)->Position));
- }
- CopyMem(Buffer, ((UINT8*)((EFI_FILE_PROTOCOL_MEM*)This)->Buffer) + ((EFI_FILE_PROTOCOL_MEM*)This)->Position, (*BufferSize));
- ((EFI_FILE_PROTOCOL_MEM*)This)->Position = ((EFI_FILE_PROTOCOL_MEM*)This)->Position + (*BufferSize);
- return (EFI_SUCCESS);
-}
-
-/**
- File style interface for Mem (Close).
-
- Frees all memory associated with this object.
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
-
- @retval EFI_SUCCESS The 'file' was closed.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceMemClose(
- IN EFI_FILE_PROTOCOL *This
- )
-{
- SHELL_FREE_NON_NULL(((EFI_FILE_PROTOCOL_MEM*)This)->Buffer);
- SHELL_FREE_NON_NULL(This);
- return (EFI_SUCCESS);
-}
-
-/**
- Creates a EFI_FILE_PROTOCOL (almost) object for using to access
- a file entirely in memory through file operations.
-
- @param[in] Unicode Boolean value with TRUE for Unicode and FALSE for Ascii.
-
- @retval NULL Memory could not be allocated.
- @return other A pointer to an EFI_FILE_PROTOCOL structure.
-**/
-EFI_FILE_PROTOCOL*
-EFIAPI
-CreateFileInterfaceMem(
- IN CONST BOOLEAN Unicode
- )
-{
- EFI_FILE_PROTOCOL_MEM *FileInterface;
-
- //
- // Get some memory
- //
- FileInterface = AllocateZeroPool(sizeof(EFI_FILE_PROTOCOL_MEM));
- if (FileInterface == NULL){
- return (NULL);
- }
-
- //
- // Assign the generic members
- //
- FileInterface->Revision = EFI_FILE_REVISION;
- FileInterface->Open = FileInterfaceOpenNotFound;
- FileInterface->Close = FileInterfaceMemClose;
- FileInterface->GetPosition = FileInterfaceMemGetPosition;
- FileInterface->SetPosition = FileInterfaceMemSetPosition;
- FileInterface->GetInfo = FileInterfaceNopGetInfo;
- FileInterface->SetInfo = FileInterfaceNopSetInfo;
- FileInterface->Flush = FileInterfaceNopGeneric;
- FileInterface->Delete = FileInterfaceNopGeneric;
- FileInterface->Read = FileInterfaceMemRead;
- FileInterface->Write = FileInterfaceMemWrite;
- FileInterface->Unicode = Unicode;
-
- ASSERT(FileInterface->Buffer == NULL);
- ASSERT(FileInterface->BufferSize == 0);
- ASSERT(FileInterface->Position == 0);
-
- return ((EFI_FILE_PROTOCOL *)FileInterface);
-}
-
-typedef struct {
- UINT64 Revision;
- EFI_FILE_OPEN Open;
- EFI_FILE_CLOSE Close;
- EFI_FILE_DELETE Delete;
- EFI_FILE_READ Read;
- EFI_FILE_WRITE Write;
- EFI_FILE_GET_POSITION GetPosition;
- EFI_FILE_SET_POSITION SetPosition;
- EFI_FILE_GET_INFO GetInfo;
- EFI_FILE_SET_INFO SetInfo;
- EFI_FILE_FLUSH Flush;
- BOOLEAN Unicode;
- EFI_FILE_PROTOCOL *Orig;
-} EFI_FILE_PROTOCOL_FILE;
-
-/**
- Set a files current position
-
- @param This Protocol instance pointer.
- @param Position Byte position from the start of the file.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.
-
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceFileSetPosition(
- IN EFI_FILE_PROTOCOL *This,
- IN UINT64 Position
- )
-{
- return ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->SetPosition(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, Position);
-}
-
-/**
- Get a file's current position
-
- @param This Protocol instance pointer.
- @param Position Byte position from the start of the file.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open..
-
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceFileGetPosition(
- IN EFI_FILE_PROTOCOL *This,
- OUT UINT64 *Position
- )
-{
- return ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->GetPosition(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, Position);
-}
-
-/**
- Get information about a file.
-
- @param This Protocol instance pointer.
- @param InformationType Type of information to return in Buffer.
- @param BufferSize On input size of buffer, on output amount of data in buffer.
- @param Buffer The buffer to return data.
-
- @retval EFI_SUCCESS Data was returned.
- @retval EFI_UNSUPPORT InformationType is not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write protected.
- @retval EFI_ACCESS_DENIED The file was open for read only.
- @retval EFI_BUFFER_TOO_SMALL Buffer was too small; required size returned in BufferSize.
-
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceFileGetInfo(
- IN EFI_FILE_PROTOCOL *This,
- IN EFI_GUID *InformationType,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- )
-{
- return ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->GetInfo(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, InformationType, BufferSize, Buffer);
-}
-
-/**
- Set information about a file
-
- @param This Protocol instance pointer.
- @param InformationType Type of information in Buffer.
- @param BufferSize Size of buffer.
- @param Buffer The data to write.
-
- @retval EFI_SUCCESS Data was returned.
- @retval EFI_UNSUPPORT InformationType is not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write protected.
- @retval EFI_ACCESS_DENIED The file was open for read only.
-
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceFileSetInfo(
- IN EFI_FILE_PROTOCOL *This,
- IN EFI_GUID *InformationType,
- IN UINTN BufferSize,
- IN VOID *Buffer
- )
-{
- return ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->SetInfo(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, InformationType, BufferSize, Buffer);
-}
-
-/**
- Flush data back for the file handle.
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORT Writes to Open directory are not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write protected.
- @retval EFI_ACCESS_DENIED The file was open for read only.
- @retval EFI_VOLUME_FULL The volume is full.
-
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceFileFlush(
- IN EFI_FILE_PROTOCOL *This
- )
-{
- return ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Flush(((EFI_FILE_PROTOCOL_FILE*)This)->Orig);
-}
-
-/**
- Read data from the file.
-
- @param This Protocol instance pointer.
- @param BufferSize On input size of buffer, on output amount of data in buffer.
- @param Buffer The buffer in which data is read.
-
- @retval EFI_SUCCESS Data was read.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_BUFFER_TO_SMALL BufferSize is too small. BufferSize contains required size.
-
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceFileRead(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- )
-{
- CHAR8 *AsciiBuffer;
- UINTN Size;
- EFI_STATUS Status;
- if (((EFI_FILE_PROTOCOL_FILE*)This)->Unicode) {
- //
- // Unicode
- //
- return (((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Read(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, BufferSize, Buffer));
- } else {
- //
- // Ascii
- //
- AsciiBuffer = AllocateZeroPool((Size = *BufferSize));
- Status = (((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Read(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, &Size, AsciiBuffer));
- UnicodeSPrint(Buffer, *BufferSize, L"%a", AsciiBuffer);
- FreePool(AsciiBuffer);
- return (Status);
- }
-}
-
-/**
- Opens a new file relative to the source file's location.
-
- @param[in] This The protocol instance pointer.
- @param[out] NewHandle Returns File Handle for FileName.
- @param[in] FileName Null terminated string. "\", ".", and ".." are supported.
- @param[in] OpenMode Open mode for file.
- @param[in] Attributes Only used for EFI_FILE_MODE_CREATE.
-
- @retval EFI_SUCCESS The device was opened.
- @retval EFI_NOT_FOUND The specified file could not be found on the device.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_MEDIA_CHANGED The media has changed.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_ACCESS_DENIED The service denied access to the file.
- @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceFileOpen (
- IN EFI_FILE_PROTOCOL *This,
- OUT EFI_FILE_PROTOCOL **NewHandle,
- IN CHAR16 *FileName,
- IN UINT64 OpenMode,
- IN UINT64 Attributes
- )
-{
- return ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Open(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, NewHandle, FileName, OpenMode, Attributes);
-}
-
-/**
- Close and delete the file handle.
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS The device was opened.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
-
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceFileDelete(
- IN EFI_FILE_PROTOCOL *This
- )
-{
- EFI_STATUS Status;
- Status = ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Delete(((EFI_FILE_PROTOCOL_FILE*)This)->Orig);
- FreePool(This);
- return (Status);
-}
-
-/**
- File style interface for File (Close).
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
-
- @retval EFI_SUCCESS The file was closed.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceFileClose(
- IN EFI_FILE_PROTOCOL *This
- )
-{
- EFI_STATUS Status;
- Status = ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Close(((EFI_FILE_PROTOCOL_FILE*)This)->Orig);
- FreePool(This);
- return (Status);
-}
-
-/**
- File style interface for File (Write).
-
- If the file was opened with ASCII mode the data will be processed through
- AsciiSPrint before writing.
-
- @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
- @param[in, out] BufferSize Size in bytes of Buffer.
- @param[in] Buffer The pointer to the buffer to write.
-
- @retval EFI_SUCCESS The data was written.
-**/
-EFI_STATUS
-EFIAPI
-FileInterfaceFileWrite(
- IN EFI_FILE_PROTOCOL *This,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- CHAR8 *AsciiBuffer;
- UINTN Size;
- EFI_STATUS Status;
- if (((EFI_FILE_PROTOCOL_FILE*)This)->Unicode) {
- //
- // Unicode
- //
- return (((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Write(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, BufferSize, Buffer));
- } else {
- //
- // Ascii
- //
- AsciiBuffer = AllocateZeroPool(*BufferSize);
- AsciiSPrint(AsciiBuffer, *BufferSize, "%S", Buffer);
- Size = AsciiStrSize(AsciiBuffer) - 1; // (we dont need the null terminator)
- Status = (((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Write(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, &Size, AsciiBuffer));
- FreePool(AsciiBuffer);
- return (Status);
- }
-}
-
-/**
- Create a file interface with unicode information.
-
- This will create a new EFI_FILE_PROTOCOL identical to the Templace
- except that the new one has Unicode and Ascii knowledge.
-
- @param[in] Template A pointer to the EFI_FILE_PROTOCOL object.
- @param[in] Unicode TRUE for UCS-2, FALSE for ASCII.
-
- @return a new EFI_FILE_PROTOCOL object to be used instead of the template.
-**/
-EFI_FILE_PROTOCOL*
-CreateFileInterfaceFile(
- IN CONST EFI_FILE_PROTOCOL *Template,
- IN CONST BOOLEAN Unicode
- )
-{
- EFI_FILE_PROTOCOL_FILE *NewOne;
-
- NewOne = AllocateZeroPool(sizeof(EFI_FILE_PROTOCOL_FILE));
- if (NewOne == NULL) {
- return (NULL);
- }
- CopyMem(NewOne, Template, sizeof(EFI_FILE_PROTOCOL_FILE));
- NewOne->Orig = (EFI_FILE_PROTOCOL *)Template;
- NewOne->Unicode = Unicode;
- NewOne->Open = FileInterfaceFileOpen;
- NewOne->Close = FileInterfaceFileClose;
- NewOne->Delete = FileInterfaceFileDelete;
- NewOne->Read = FileInterfaceFileRead;
- NewOne->Write = FileInterfaceFileWrite;
- NewOne->GetPosition = FileInterfaceFileGetPosition;
- NewOne->SetPosition = FileInterfaceFileSetPosition;
- NewOne->GetInfo = FileInterfaceFileGetInfo;
- NewOne->SetInfo = FileInterfaceFileSetInfo;
- NewOne->Flush = FileInterfaceFileFlush;
-
- return ((EFI_FILE_PROTOCOL *)NewOne);
-}
diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.h b/ShellPkg/Application/Shell/FileHandleWrappers.h
deleted file mode 100644
index af133b0963..0000000000
--- a/ShellPkg/Application/Shell/FileHandleWrappers.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/** @file
- EFI_FILE_PROTOCOL wrappers for other items (Like Environment Variables, StdIn, StdOut, StdErr, etc...)
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_FILE_HANDLE_WRAPPERS_HEADER_
-#define _SHELL_FILE_HANDLE_WRAPPERS_HEADER_
-
-typedef struct {
- LIST_ENTRY Link;
- CHAR16* Buffer;
-} SHELL_LINE_LIST;
-
-typedef struct {
- UINTN LogCount;
- SHELL_LINE_LIST *Log;
-} SHELL_LINE_LOG;
-
-///
-/// FILE sytle interfaces for StdIn.
-///
-extern EFI_FILE_PROTOCOL FileInterfaceStdIn;
-
-///
-/// FILE sytle interfaces for StdOut.
-///
-extern EFI_FILE_PROTOCOL FileInterfaceStdOut;
-
-///
-/// FILE sytle interfaces for StdErr.
-///
-extern EFI_FILE_PROTOCOL FileInterfaceStdErr;
-
-///
-/// FILE style interface for NUL file.
-///
-extern EFI_FILE_PROTOCOL FileInterfaceNulFile;
-
-/**
- Creates a EFI_FILE_PROTOCOL (almost) object for using to access
- environment variables through file operations.
-
- @param EnvName The name of the Environment Variable to be operated on.
-
- @retval NULL Memory could not be allocated.
- @return other a pointer to an EFI_FILE_PROTOCOL structure
-**/
-EFI_FILE_PROTOCOL*
-EFIAPI
-CreateFileInterfaceEnv(
- CONST CHAR16 *EnvName
- );
-
-/**
- Creates a EFI_FILE_PROTOCOL (almost) object for using to access
- a file entirely in memory through file operations.
-
- @param[in] Unicode TRUE if the data is UNICODE, FALSE otherwise.
-
- @retval NULL Memory could not be allocated.
- @return other a pointer to an EFI_FILE_PROTOCOL structure
-**/
-EFI_FILE_PROTOCOL*
-EFIAPI
-CreateFileInterfaceMem(
- IN CONST BOOLEAN Unicode
- );
-
-/**
- Creates a EFI_FILE_PROTOCOL (almost) object for using to access
- a file entirely with unicode awareness through file operations.
-
- @param[in] Template The pointer to the handle to start with.
- @param[in] Unicode TRUE if the data is UNICODE, FALSE otherwise.
-
- @retval NULL Memory could not be allocated.
- @return other a pointer to an EFI_FILE_PROTOCOL structure
-**/
-EFI_FILE_PROTOCOL*
-CreateFileInterfaceFile(
- IN CONST EFI_FILE_PROTOCOL *Template,
- IN CONST BOOLEAN Unicode
- );
-
-#endif //_SHELL_FILE_HANDLE_WRAPPERS_HEADER_
-
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c
deleted file mode 100644
index 35ffae8e9c..0000000000
--- a/ShellPkg/Application/Shell/Shell.c
+++ /dev/null
@@ -1,1945 +0,0 @@
-/** @file
- This is THE shell (application)
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "Shell.h"
-
-//
-// Initialize the global structure
-//
-SHELL_INFO ShellInfoObject = {
- NULL,
- NULL,
- FALSE,
- FALSE,
- {
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- NULL,
- NULL
- },
- {0,0},
- {
- {0,0},
- 0,
- 0,
- TRUE
- },
- NULL,
- 0,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- {0,0,NULL,NULL},
- {0,0},
- NULL,
- NULL,
- NULL,
- NULL,
- FALSE
-};
-
-STATIC CONST CHAR16 mScriptExtension[] = L".NSH";
-STATIC CONST CHAR16 mExecutableExtensions[] = L".NSH;.EFI";
-STATIC CONST CHAR16 mStartupScript[] = L"startup.nsh";
-
-/**
- Function to start monitoring for CTRL-S using SimpleTextInputEx. This
- feature's enabled state was not known when the shell initially launched.
-
- @retval EFI_SUCCESS The feature is enabled.
- @retval EFI_OUT_OF_RESOURCES There is not enough mnemory available.
-**/
-EFI_STATUS
-EFIAPI
-InternalEfiShellStartCtrlSMonitor(
- VOID
- )
-{
- EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *SimpleEx;
- EFI_KEY_DATA KeyData;
- EFI_STATUS Status;
-
- Status = gBS->OpenProtocol(
- gST->ConsoleInHandle,
- &gEfiSimpleTextInputExProtocolGuid,
- (VOID**)&SimpleEx,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SHELL_NO_IN_EX),
- ShellInfoObject.HiiHandle);
- return (EFI_SUCCESS);
- }
-
- KeyData.KeyState.KeyToggleState = 0;
- KeyData.Key.ScanCode = 0;
- KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED;
- KeyData.Key.UnicodeChar = L's';
-
- Status = SimpleEx->RegisterKeyNotify(
- SimpleEx,
- &KeyData,
- NotificationFunction,
- &ShellInfoObject.CtrlSNotifyHandle1);
-
- KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED;
- if (!EFI_ERROR(Status)) {
- Status = SimpleEx->RegisterKeyNotify(
- SimpleEx,
- &KeyData,
- NotificationFunction,
- &ShellInfoObject.CtrlSNotifyHandle2);
- }
- KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED;
- KeyData.Key.UnicodeChar = 19;
-
- if (!EFI_ERROR(Status)) {
- Status = SimpleEx->RegisterKeyNotify(
- SimpleEx,
- &KeyData,
- NotificationFunction,
- &ShellInfoObject.CtrlSNotifyHandle2);
- }
- KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED;
- if (!EFI_ERROR(Status)) {
- Status = SimpleEx->RegisterKeyNotify(
- SimpleEx,
- &KeyData,
- NotificationFunction,
- &ShellInfoObject.CtrlSNotifyHandle2);
- }
- return (Status);
-}
-
-
-
-/**
- The entry point for the application.
-
- @param[in] ImageHandle The firmware allocated handle for the EFI image.
- @param[in] SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The entry point is executed successfully.
- @retval other Some error occurs when executing this entry point.
-
-**/
-EFI_STATUS
-EFIAPI
-UefiMain (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- CHAR16 *TempString;
- UINTN Size;
- EFI_HANDLE ConInHandle;
- EFI_SIMPLE_TEXT_INPUT_PROTOCOL *OldConIn;
-
- if (PcdGet8(PcdShellSupportLevel) > 3) {
- return (EFI_UNSUPPORTED);
- }
-
- //
- // Clear the screen
- //
- Status = gST->ConOut->ClearScreen(gST->ConOut);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- //
- // Populate the global structure from PCDs
- //
- ShellInfoObject.ImageDevPath = NULL;
- ShellInfoObject.FileDevPath = NULL;
- ShellInfoObject.PageBreakEnabled = PcdGetBool(PcdShellPageBreakDefault);
- ShellInfoObject.ViewingSettings.InsertMode = PcdGetBool(PcdShellInsertModeDefault);
- ShellInfoObject.LogScreenCount = PcdGet8 (PcdShellScreenLogCount );
-
- //
- // verify we dont allow for spec violation
- //
- ASSERT(ShellInfoObject.LogScreenCount >= 3);
-
- //
- // Initialize the LIST ENTRY objects...
- //
- InitializeListHead(&ShellInfoObject.BufferToFreeList.Link);
- InitializeListHead(&ShellInfoObject.ViewingSettings.CommandHistory.Link);
- InitializeListHead(&ShellInfoObject.SplitList.Link);
-
- //
- // Check PCDs for optional features that are not implemented yet.
- //
- if ( PcdGetBool(PcdShellSupportOldProtocols)
- || !FeaturePcdGet(PcdShellRequireHiiPlatform)
- || FeaturePcdGet(PcdShellSupportFrameworkHii)
- ) {
- return (EFI_UNSUPPORTED);
- }
-
- //
- // turn off the watchdog timer
- //
- gBS->SetWatchdogTimer (0, 0, 0, NULL);
-
- //
- // install our console logger. This will keep a log of the output for back-browsing
- //
- Status = ConsoleLoggerInstall(ShellInfoObject.LogScreenCount, &ShellInfoObject.ConsoleInfo);
- if (!EFI_ERROR(Status)) {
- //
- // Enable the cursor to be visible
- //
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
-
- //
- // If supporting EFI 1.1 we need to install HII protocol
- // only do this if PcdShellRequireHiiPlatform == FALSE
- //
- // remove EFI_UNSUPPORTED check above when complete.
- ///@todo add support for Framework HII
-
- //
- // install our (solitary) HII package
- //
- ShellInfoObject.HiiHandle = HiiAddPackages (&gEfiCallerIdGuid, gImageHandle, ShellStrings, NULL);
- if (ShellInfoObject.HiiHandle == NULL) {
- if (PcdGetBool(PcdShellSupportFrameworkHii)) {
- ///@todo Add our package into Framework HII
- }
- if (ShellInfoObject.HiiHandle == NULL) {
- return (EFI_NOT_STARTED);
- }
- }
-
- //
- // create and install the EfiShellParametersProtocol
- //
- Status = CreatePopulateInstallShellParametersProtocol(&ShellInfoObject.NewShellParametersProtocol, &ShellInfoObject.RootShellInstance);
- ASSERT_EFI_ERROR(Status);
- ASSERT(ShellInfoObject.NewShellParametersProtocol != NULL);
-
- //
- // create and install the EfiShellProtocol
- //
- Status = CreatePopulateInstallShellProtocol(&ShellInfoObject.NewEfiShellProtocol);
- ASSERT_EFI_ERROR(Status);
- ASSERT(ShellInfoObject.NewEfiShellProtocol != NULL);
-
- //
- // Now initialize the shell library (it requires Shell Parameters protocol)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // Check the command line
- //
- Status = ProcessCommandLine();
-
- //
- // If shell support level is >= 1 create the mappings and paths
- //
- if (PcdGet8(PcdShellSupportLevel) >= 1) {
- Status = ShellCommandCreateInitialMappingsAndPaths();
- }
-
- //
- // save the device path for the loaded image and the device path for the filepath (under loaded image)
- // These are where to look for the startup.nsh file
- //
- Status = GetDevicePathsForImageAndFile(&ShellInfoObject.ImageDevPath, &ShellInfoObject.FileDevPath);
- ASSERT_EFI_ERROR(Status);
-
- //
- // Display the version
- //
- if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion) {
- ShellPrintHiiEx (
- 0,
- gST->ConOut->Mode->CursorRow,
- NULL,
- STRING_TOKEN (STR_VER_OUTPUT_MAIN),
- ShellInfoObject.HiiHandle,
- SupportLevel[PcdGet8(PcdShellSupportLevel)],
- gEfiShellProtocol->MajorVersion,
- gEfiShellProtocol->MinorVersion,
- (gST->Hdr.Revision&0xffff0000)>>16,
- (gST->Hdr.Revision&0x0000ffff),
- gST->FirmwareVendor,
- gST->FirmwareRevision
- );
- }
-
- //
- // Display the mapping
- //
- if (PcdGet8(PcdShellSupportLevel) >= 2 && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap) {
- Status = RunCommand(L"map");
- ASSERT_EFI_ERROR(Status);
- }
-
- //
- // init all the built in alias'
- //
- Status = SetBuiltInAlias();
- ASSERT_EFI_ERROR(Status);
-
- //
- // Initialize environment variables
- //
- if (ShellCommandGetProfileList() != NULL) {
- Status = InternalEfiShellSetEnv(L"profiles", ShellCommandGetProfileList(), TRUE);
- ASSERT_EFI_ERROR(Status);
- }
-
- Size = 100;
- TempString = AllocateZeroPool(Size);
-
- UnicodeSPrint(TempString, Size, L"%d", PcdGet8(PcdShellSupportLevel));
- Status = InternalEfiShellSetEnv(L"uefishellsupport", TempString, TRUE);
- ASSERT_EFI_ERROR(Status);
-
- UnicodeSPrint(TempString, Size, L"%d.%d", ShellInfoObject.NewEfiShellProtocol->MajorVersion, ShellInfoObject.NewEfiShellProtocol->MinorVersion);
- Status = InternalEfiShellSetEnv(L"uefishellversion", TempString, TRUE);
- ASSERT_EFI_ERROR(Status);
-
- UnicodeSPrint(TempString, Size, L"%d.%d", (gST->Hdr.Revision & 0xFFFF0000) >> 16, gST->Hdr.Revision & 0x0000FFFF);
- Status = InternalEfiShellSetEnv(L"uefiversion", TempString, TRUE);
- ASSERT_EFI_ERROR(Status);
-
- FreePool(TempString);
-
- if (!EFI_ERROR(Status)) {
- if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoInterrupt) {
- //
- // Set up the event for CTRL-C monitoring...
- //
- Status = InernalEfiShellStartMonitor();
- }
-
- if (!EFI_ERROR(Status) && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleIn) {
- //
- // Set up the event for CTRL-S monitoring...
- //
- Status = InternalEfiShellStartCtrlSMonitor();
- }
-
- if (!EFI_ERROR(Status) && ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleIn) {
- //
- // close off the gST->ConIn
- //
- OldConIn = gST->ConIn;
- ConInHandle = gST->ConsoleInHandle;
- gST->ConIn = CreateSimpleTextInOnFile((SHELL_FILE_HANDLE)&FileInterfaceNulFile, &gST->ConsoleInHandle);
- } else {
- OldConIn = NULL;
- ConInHandle = NULL;
- }
-
- if (!EFI_ERROR(Status) && PcdGet8(PcdShellSupportLevel) >= 1) {
- //
- // process the startup script or launch the called app.
- //
- Status = DoStartupScript(ShellInfoObject.ImageDevPath, ShellInfoObject.FileDevPath);
- }
-
- if (!ShellCommandGetExit() && (PcdGet8(PcdShellSupportLevel) >= 3 || PcdGetBool(PcdShellForceConsole)) && !EFI_ERROR(Status) && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleIn) {
- //
- // begin the UI waiting loop
- //
- do {
- //
- // clean out all the memory allocated for CONST <something> * return values
- // between each shell prompt presentation
- //
- if (!IsListEmpty(&ShellInfoObject.BufferToFreeList.Link)){
- FreeBufferList(&ShellInfoObject.BufferToFreeList);
- }
-
- //
- // Reset page break back to default.
- //
- ShellInfoObject.PageBreakEnabled = PcdGetBool(PcdShellPageBreakDefault);
- ShellInfoObject.ConsoleInfo->Enabled = TRUE;
- ShellInfoObject.ConsoleInfo->RowCounter = 0;
-
- //
- // Reset the CTRL-C event (yes we ignore the return values)
- //
- Status = gBS->CheckEvent (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak);
-
- //
- // Display Prompt
- //
- Status = DoShellPrompt();
- } while (!ShellCommandGetExit());
- }
- if (OldConIn != NULL && ConInHandle != NULL) {
- CloseSimpleTextInOnFile (gST->ConIn);
- gST->ConIn = OldConIn;
- gST->ConsoleInHandle = ConInHandle;
- }
- }
- }
-
- //
- // uninstall protocols / free memory / etc...
- //
- if (ShellInfoObject.UserBreakTimer != NULL) {
- gBS->CloseEvent(ShellInfoObject.UserBreakTimer);
- DEBUG_CODE(ShellInfoObject.UserBreakTimer = NULL;);
- }
- if (ShellInfoObject.ImageDevPath != NULL) {
- FreePool(ShellInfoObject.ImageDevPath);
- DEBUG_CODE(ShellInfoObject.ImageDevPath = NULL;);
- }
- if (ShellInfoObject.FileDevPath != NULL) {
- FreePool(ShellInfoObject.FileDevPath);
- DEBUG_CODE(ShellInfoObject.FileDevPath = NULL;);
- }
- if (ShellInfoObject.NewShellParametersProtocol != NULL) {
- CleanUpShellParametersProtocol(ShellInfoObject.NewShellParametersProtocol);
- DEBUG_CODE(ShellInfoObject.NewShellParametersProtocol = NULL;);
- }
- if (ShellInfoObject.NewEfiShellProtocol != NULL){
- if (ShellInfoObject.NewEfiShellProtocol->IsRootShell()){
- ShellInfoObject.NewEfiShellProtocol->SetEnv(L"cwd", L"", TRUE);
- }
- CleanUpShellProtocol(ShellInfoObject.NewEfiShellProtocol);
- DEBUG_CODE(ShellInfoObject.NewEfiShellProtocol = NULL;);
- }
-
- if (!IsListEmpty(&ShellInfoObject.BufferToFreeList.Link)){
- FreeBufferList(&ShellInfoObject.BufferToFreeList);
- }
-
- if (!IsListEmpty(&ShellInfoObject.SplitList.Link)){
- ASSERT(FALSE); ///@todo finish this de-allocation.
- }
-
- if (ShellInfoObject.ShellInitSettings.FileName != NULL) {
- FreePool(ShellInfoObject.ShellInitSettings.FileName);
- DEBUG_CODE(ShellInfoObject.ShellInitSettings.FileName = NULL;);
- }
-
- if (ShellInfoObject.ShellInitSettings.FileOptions != NULL) {
- FreePool(ShellInfoObject.ShellInitSettings.FileOptions);
- DEBUG_CODE(ShellInfoObject.ShellInitSettings.FileOptions = NULL;);
- }
-
- if (ShellInfoObject.HiiHandle != NULL) {
- HiiRemovePackages(ShellInfoObject.HiiHandle);
- DEBUG_CODE(ShellInfoObject.HiiHandle = NULL;);
- }
-
- if (!IsListEmpty(&ShellInfoObject.ViewingSettings.CommandHistory.Link)){
- FreeBufferList(&ShellInfoObject.ViewingSettings.CommandHistory);
- }
-
- ASSERT(ShellInfoObject.ConsoleInfo != NULL);
- if (ShellInfoObject.ConsoleInfo != NULL) {
- ConsoleLoggerUninstall(ShellInfoObject.ConsoleInfo);
- FreePool(ShellInfoObject.ConsoleInfo);
- DEBUG_CODE(ShellInfoObject.ConsoleInfo = NULL;);
- }
-
- if (ShellCommandGetExit()) {
- return ((EFI_STATUS)ShellCommandGetExitCode());
- }
- return (Status);
-}
-
-/**
- Sets all the alias' that were registered with the ShellCommandLib library.
-
- @retval EFI_SUCCESS all init commands were run sucessfully.
-**/
-EFI_STATUS
-EFIAPI
-SetBuiltInAlias(
- )
-{
- EFI_STATUS Status;
- CONST ALIAS_LIST *List;
- ALIAS_LIST *Node;
-
- //
- // Get all the commands we want to run
- //
- List = ShellCommandGetInitAliasList();
-
- //
- // for each command in the List
- //
- for ( Node = (ALIAS_LIST*)GetFirstNode(&List->Link)
- ; !IsNull (&List->Link, &Node->Link)
- ; Node = (ALIAS_LIST *)GetNextNode(&List->Link, &Node->Link)
- ){
- //
- // install the alias'
- //
- Status = InternalSetAlias(Node->CommandString, Node->Alias, TRUE);
- ASSERT_EFI_ERROR(Status);
- }
- return (EFI_SUCCESS);
-}
-
-/**
- Internal function to determine if 2 command names are really the same.
-
- @param[in] Command1 The pointer to the first command name.
- @param[in] Command2 The pointer to the second command name.
-
- @retval TRUE The 2 command names are the same.
- @retval FALSE The 2 command names are not the same.
-**/
-BOOLEAN
-EFIAPI
-IsCommand(
- IN CONST CHAR16 *Command1,
- IN CONST CHAR16 *Command2
- )
-{
- if (StringNoCaseCompare(&Command1, &Command2) == 0) {
- return (TRUE);
- }
- return (FALSE);
-}
-
-/**
- Internal function to determine if a command is a script only command.
-
- @param[in] CommandName The pointer to the command name.
-
- @retval TRUE The command is a script only command.
- @retval FALSE The command is not a script only command.
-**/
-BOOLEAN
-EFIAPI
-IsScriptOnlyCommand(
- IN CONST CHAR16 *CommandName
- )
-{
- if (IsCommand(CommandName, L"for")
- ||IsCommand(CommandName, L"endfor")
- ||IsCommand(CommandName, L"if")
- ||IsCommand(CommandName, L"else")
- ||IsCommand(CommandName, L"endif")
- ||IsCommand(CommandName, L"goto")) {
- return (TRUE);
- }
- return (FALSE);
-}
-
-/**
- This function will populate the 2 device path protocol parameters based on the
- global gImageHandle. The DevPath will point to the device path for the handle that has
- loaded image protocol installed on it. The FilePath will point to the device path
- for the file that was loaded.
-
- @param[in, out] DevPath On a sucessful return the device path to the loaded image.
- @param[in, out] FilePath On a sucessful return the device path to the file.
-
- @retval EFI_SUCCESS The 2 device paths were sucessfully returned.
- @retval other A error from gBS->HandleProtocol.
-
- @sa HandleProtocol
-**/
-EFI_STATUS
-EFIAPI
-GetDevicePathsForImageAndFile (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevPath,
- IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath
- )
-{
- EFI_STATUS Status;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
-
- ASSERT(DevPath != NULL);
- ASSERT(FilePath != NULL);
-
- Status = gBS->OpenProtocol (
- gImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID**)&LoadedImage,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR (Status)) {
- Status = gBS->OpenProtocol (
- LoadedImage->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&ImageDevicePath,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR (Status)) {
- *DevPath = DuplicateDevicePath (ImageDevicePath);
- *FilePath = DuplicateDevicePath (LoadedImage->FilePath);
- gBS->CloseProtocol(
- LoadedImage->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- gImageHandle,
- NULL);
- }
- gBS->CloseProtocol(
- gImageHandle,
- &gEfiLoadedImageProtocolGuid,
- gImageHandle,
- NULL);
- }
- return (Status);
-}
-
-STATIC CONST SHELL_PARAM_ITEM mShellParamList[] = {
- {L"-nostartup", TypeFlag},
- {L"-startup", TypeFlag},
- {L"-noconsoleout", TypeFlag},
- {L"-noconsolein", TypeFlag},
- {L"-nointerrupt", TypeFlag},
- {L"-nomap", TypeFlag},
- {L"-noversion", TypeFlag},
- {L"-startup", TypeFlag},
- {L"-delay", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Process all Uefi Shell 2.0 command line options.
-
- see Uefi Shell 2.0 section 3.2 for full details.
-
- the command line must resemble the following:
-
- shell.efi [ShellOpt-options] [options] [file-name [file-name-options]]
-
- ShellOpt-options Options which control the initialization behavior of the shell.
- These options are read from the EFI global variable "ShellOpt"
- and are processed before options or file-name.
-
- options Options which control the initialization behavior of the shell.
-
- file-name The name of a UEFI shell application or script to be executed
- after initialization is complete. By default, if file-name is
- specified, then -nostartup is implied. Scripts are not supported
- by level 0.
-
- file-name-options The command-line options that are passed to file-name when it
- is invoked.
-
- This will initialize the ShellInfoObject.ShellInitSettings global variable.
-
- @retval EFI_SUCCESS The variable is initialized.
-**/
-EFI_STATUS
-EFIAPI
-ProcessCommandLine(
- VOID
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- UINTN Size;
- CONST CHAR16 *TempConst;
- UINTN Count;
- UINTN LoopVar;
- CHAR16 *ProblemParam;
- UINT64 Intermediate;
-
- Package = NULL;
- ProblemParam = NULL;
-
- Status = ShellCommandLineParse (mShellParamList, &Package, NULL, FALSE);
-
- Count = 1;
- Size = 0;
- TempConst = ShellCommandLineGetRawValue(Package, Count++);
- if (TempConst != NULL && StrLen(TempConst)) {
- ShellInfoObject.ShellInitSettings.FileName = AllocateZeroPool(StrSize(TempConst));
- if (ShellInfoObject.ShellInitSettings.FileName == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- StrCpy(ShellInfoObject.ShellInitSettings.FileName, TempConst);
- ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoStartup = 1;
- for (LoopVar = 0 ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {
- if (StrCmp(gEfiShellParametersProtocol->Argv[LoopVar], ShellInfoObject.ShellInitSettings.FileName)==0) {
- LoopVar++;
- //
- // We found the file... add the rest of the params...
- //
- for ( ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {
- ASSERT((ShellInfoObject.ShellInitSettings.FileOptions == NULL && Size == 0) || (ShellInfoObject.ShellInitSettings.FileOptions != NULL));
- StrnCatGrow(&ShellInfoObject.ShellInitSettings.FileOptions,
- &Size,
- L" ",
- 0);
- if (ShellInfoObject.ShellInitSettings.FileOptions == NULL) {
- SHELL_FREE_NON_NULL(ShellInfoObject.ShellInitSettings.FileName);
- return (EFI_OUT_OF_RESOURCES);
- }
- StrnCatGrow(&ShellInfoObject.ShellInitSettings.FileOptions,
- &Size,
- gEfiShellParametersProtocol->Argv[LoopVar],
- 0);
- if (ShellInfoObject.ShellInitSettings.FileOptions == NULL) {
- SHELL_FREE_NON_NULL(ShellInfoObject.ShellInitSettings.FileName);
- return (EFI_OUT_OF_RESOURCES);
- }
- }
- }
- }
- } else {
- ShellCommandLineFreeVarList(Package);
- Package = NULL;
- Status = ShellCommandLineParse (mShellParamList, &Package, &ProblemParam, FALSE);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), ShellInfoObject.HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellCommandLineFreeVarList(Package);
- return (EFI_INVALID_PARAMETER);
- }
- }
-
- ShellInfoObject.ShellInitSettings.BitUnion.Bits.Startup = ShellCommandLineGetFlag(Package, L"-startup");
- ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoStartup = ShellCommandLineGetFlag(Package, L"-nostartup");
- ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleOut = ShellCommandLineGetFlag(Package, L"-noconsoleout");
- ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleIn = ShellCommandLineGetFlag(Package, L"-noconsolein");
- ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoInterrupt = ShellCommandLineGetFlag(Package, L"-nointerrupt");
- ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap = ShellCommandLineGetFlag(Package, L"-nomap");
- ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion = ShellCommandLineGetFlag(Package, L"-noversion");
- ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay = ShellCommandLineGetFlag(Package, L"-delay");
-
- ShellInfoObject.ShellInitSettings.Delay = 5;
-
- if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoInterrupt) {
- ShellInfoObject.ShellInitSettings.Delay = 0;
- } else if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay) {
- TempConst = ShellCommandLineGetValue(Package, L"-delay");
- if (TempConst != NULL && *TempConst == L':') {
- TempConst++;
- }
- if (TempConst != NULL && !EFI_ERROR(ShellConvertStringToUint64(TempConst, &Intermediate, FALSE, FALSE))) {
- ShellInfoObject.ShellInitSettings.Delay = (UINTN)Intermediate;
- }
- }
- ShellCommandLineFreeVarList(Package);
-
- return (Status);
-}
-
-/**
- Handles all interaction with the default startup script.
-
- this will check that the correct command line parameters were passed, handle the delay, and then start running the script.
-
- @param ImagePath the path to the image for shell. first place to look for the startup script
- @param FilePath the path to the file for shell. second place to look for the startup script.
-
- @retval EFI_SUCCESS the variable is initialized.
-**/
-EFI_STATUS
-EFIAPI
-DoStartupScript(
- EFI_DEVICE_PATH_PROTOCOL *ImagePath,
- EFI_DEVICE_PATH_PROTOCOL *FilePath
- )
-{
- EFI_STATUS Status;
- UINTN Delay;
- EFI_INPUT_KEY Key;
- SHELL_FILE_HANDLE FileHandle;
- EFI_DEVICE_PATH_PROTOCOL *NewPath;
- EFI_DEVICE_PATH_PROTOCOL *NamePath;
- CHAR16 *FileStringPath;
- CHAR16 *TempSpot;
- UINTN NewSize;
- CONST CHAR16 *MapName;
-
- Key.UnicodeChar = CHAR_NULL;
- Key.ScanCode = 0;
- FileHandle = NULL;
-
- if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.Startup && ShellInfoObject.ShellInitSettings.FileName != NULL) {
- //
- // launch something else instead
- //
- NewSize = StrSize(ShellInfoObject.ShellInitSettings.FileName);
- if (ShellInfoObject.ShellInitSettings.FileOptions != NULL) {
- NewSize += StrSize(ShellInfoObject.ShellInitSettings.FileOptions) + sizeof(CHAR16);
- }
- FileStringPath = AllocateZeroPool(NewSize);
- if (FileStringPath == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- StrCpy(FileStringPath, ShellInfoObject.ShellInitSettings.FileName);
- if (ShellInfoObject.ShellInitSettings.FileOptions != NULL) {
- StrCat(FileStringPath, L" ");
- StrCat(FileStringPath, ShellInfoObject.ShellInitSettings.FileOptions);
- }
- Status = RunCommand(FileStringPath);
- FreePool(FileStringPath);
- return (Status);
-
- }
-
- //
- // for shell level 0 we do no scripts
- // Without the Startup bit overriding we allow for nostartup to prevent scripts
- //
- if ( (PcdGet8(PcdShellSupportLevel) < 1)
- || (ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoStartup && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.Startup)
- ){
- return (EFI_SUCCESS);
- }
-
- gST->ConOut->EnableCursor(gST->ConOut, FALSE);
- //
- // print out our warning and see if they press a key
- //
- for ( Status = EFI_UNSUPPORTED, Delay = ShellInfoObject.ShellInitSettings.Delay * 10
- ; Delay != 0 && EFI_ERROR(Status)
- ; Delay--
- ){
- ShellPrintHiiEx(0, gST->ConOut->Mode->CursorRow, NULL, STRING_TOKEN (STR_SHELL_STARTUP_QUESTION), ShellInfoObject.HiiHandle, Delay/10);
- gBS->Stall (100000);
- if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleIn) {
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- }
- }
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_CRLF), ShellInfoObject.HiiHandle);
- gST->ConOut->EnableCursor(gST->ConOut, TRUE);
-
- //
- // ESC was pressed
- //
- if (Status == EFI_SUCCESS && Key.UnicodeChar == 0 && Key.ScanCode == SCAN_ESC) {
- return (EFI_SUCCESS);
- }
-
- //
- // Try the first location (must be file system)
- //
- MapName = ShellInfoObject.NewEfiShellProtocol->GetMapFromDevicePath(&ImagePath);
- if (MapName != NULL) {
- FileStringPath = NULL;
- NewSize = 0;
- FileStringPath = StrnCatGrow(&FileStringPath, &NewSize, MapName, 0);
- if (FileStringPath == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- TempSpot = StrStr(FileStringPath, L";");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- FileStringPath = StrnCatGrow(&FileStringPath, &NewSize, ((FILEPATH_DEVICE_PATH*)FilePath)->PathName, 0);
- PathRemoveLastItem(FileStringPath);
- FileStringPath = StrnCatGrow(&FileStringPath, &NewSize, mStartupScript, 0);
- Status = ShellInfoObject.NewEfiShellProtocol->OpenFileByName(FileStringPath, &FileHandle, EFI_FILE_MODE_READ);
- FreePool(FileStringPath);
- }
- }
- if (EFI_ERROR(Status)) {
- NamePath = FileDevicePath (NULL, mStartupScript);
- NewPath = AppendDevicePathNode (ImagePath, NamePath);
- FreePool(NamePath);
-
- //
- // Try the location
- //
- Status = InternalOpenFileDevicePath(NewPath, &FileHandle, EFI_FILE_MODE_READ, 0);
- FreePool(NewPath);
- }
- //
- // If we got a file, run it
- //
- if (!EFI_ERROR(Status) && FileHandle != NULL) {
- Status = RunScriptFileHandle (FileHandle, mStartupScript);
- ShellInfoObject.NewEfiShellProtocol->CloseFile(FileHandle);
- } else {
- FileStringPath = ShellFindFilePath(mStartupScript);
- if (FileStringPath == NULL) {
- //
- // we return success since we dont need to have a startup script
- //
- Status = EFI_SUCCESS;
- ASSERT(FileHandle == NULL);
- } else {
- Status = RunScriptFile(FileStringPath);
- FreePool(FileStringPath);
- }
- }
-
-
- return (Status);
-}
-
-/**
- Function to perform the shell prompt looping. It will do a single prompt,
- dispatch the result, and then return. It is expected that the caller will
- call this function in a loop many times.
-
- @retval EFI_SUCCESS
- @retval RETURN_ABORTED
-**/
-EFI_STATUS
-EFIAPI
-DoShellPrompt (
- VOID
- )
-{
- UINTN Column;
- UINTN Row;
- CHAR16 *CmdLine;
- CONST CHAR16 *CurDir;
- UINTN BufferSize;
- EFI_STATUS Status;
-
- CurDir = NULL;
-
- //
- // Get screen setting to decide size of the command line buffer
- //
- gST->ConOut->QueryMode (gST->ConOut, gST->ConOut->Mode->Mode, &Column, &Row);
- BufferSize = Column * Row * sizeof (CHAR16);
- CmdLine = AllocateZeroPool (BufferSize);
- if (CmdLine == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- CurDir = ShellInfoObject.NewEfiShellProtocol->GetEnv(L"cwd");
-
- //
- // Prompt for input
- //
- gST->ConOut->SetCursorPosition (gST->ConOut, 0, gST->ConOut->Mode->CursorRow);
-
- if (CurDir != NULL && StrLen(CurDir) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_CURDIR), ShellInfoObject.HiiHandle, CurDir);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_SHELL), ShellInfoObject.HiiHandle);
- }
-
- //
- // Read a line from the console
- //
- Status = ShellInfoObject.NewEfiShellProtocol->ReadFile(ShellInfoObject.NewShellParametersProtocol->StdIn, &BufferSize, CmdLine);
-
- //
- // Null terminate the string and parse it
- //
- if (!EFI_ERROR (Status)) {
- CmdLine[BufferSize / sizeof (CHAR16)] = CHAR_NULL;
- Status = RunCommand(CmdLine);
- }
-
- //
- // Done with this command
- //
- FreePool (CmdLine);
- return Status;
-}
-
-/**
- Add a buffer to the Buffer To Free List for safely returning buffers to other
- places without risking letting them modify internal shell information.
-
- @param Buffer Something to pass to FreePool when the shell is exiting.
-**/
-VOID*
-EFIAPI
-AddBufferToFreeList(
- VOID *Buffer
- )
-{
- BUFFER_LIST *BufferListEntry;
-
- if (Buffer == NULL) {
- return (NULL);
- }
-
- BufferListEntry = AllocateZeroPool(sizeof(BUFFER_LIST));
- ASSERT(BufferListEntry != NULL);
- BufferListEntry->Buffer = Buffer;
- InsertTailList(&ShellInfoObject.BufferToFreeList.Link, &BufferListEntry->Link);
- return (Buffer);
-}
-
-/**
- Add a buffer to the Line History List
-
- @param Buffer The line buffer to add.
-**/
-VOID
-EFIAPI
-AddLineToCommandHistory(
- IN CONST CHAR16 *Buffer
- )
-{
- BUFFER_LIST *Node;
-
- Node = AllocateZeroPool(sizeof(BUFFER_LIST));
- ASSERT(Node != NULL);
- Node->Buffer = AllocateZeroPool(StrSize(Buffer));
- ASSERT(Node->Buffer != NULL);
- StrCpy(Node->Buffer, Buffer);
-
- InsertTailList(&ShellInfoObject.ViewingSettings.CommandHistory.Link, &Node->Link);
-}
-
-/**
- Checks if a string is an alias for another command. If yes, then it replaces the alias name
- with the correct command name.
-
- @param[in, out] CommandString Upon entry the potential alias. Upon return the
- command name if it was an alias. If it was not
- an alias it will be unchanged. This function may
- change the buffer to fit the command name.
-
- @retval EFI_SUCCESS The name was changed.
- @retval EFI_SUCCESS The name was not an alias.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-ShellConvertAlias(
- IN OUT CHAR16 **CommandString
- )
-{
- CONST CHAR16 *NewString;
-
- NewString = ShellInfoObject.NewEfiShellProtocol->GetAlias(*CommandString, NULL);
- if (NewString == NULL) {
- return (EFI_SUCCESS);
- }
- FreePool(*CommandString);
- *CommandString = AllocateZeroPool(StrSize(NewString));
- if (*CommandString == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- StrCpy(*CommandString, NewString);
- return (EFI_SUCCESS);
-}
-
-/**
- Function allocates a new command line and replaces all instances of environment
- variable names that are correctly preset to their values.
-
- If the return value is not NULL the memory must be caller freed.
-
- @param[in] OriginalCommandLine The original command line
-
- @retval NULL An error ocurred.
- @return The new command line with no environment variables present.
-**/
-CHAR16*
-EFIAPI
-ShellConvertVariables (
- IN CONST CHAR16 *OriginalCommandLine
- )
-{
- CONST CHAR16 *MasterEnvList;
- UINTN NewSize;
- CHAR16 *NewCommandLine1;
- CHAR16 *NewCommandLine2;
- CHAR16 *Temp;
- UINTN ItemSize;
- CHAR16 *ItemTemp;
- SCRIPT_FILE *CurrentScriptFile;
- ALIAS_LIST *AliasListNode;
-
- ASSERT(OriginalCommandLine != NULL);
-
- ItemSize = 0;
- NewSize = StrSize(OriginalCommandLine);
- CurrentScriptFile = ShellCommandGetCurrentScriptFile();
- Temp = NULL;
-
- ///@todo update this to handle the %0 - %9 for scripting only (borrow from line 1256 area) ? ? ?
-
- //
- // calculate the size required for the post-conversion string...
- //
- if (CurrentScriptFile != NULL) {
- for (AliasListNode = (ALIAS_LIST*)GetFirstNode(&CurrentScriptFile->SubstList)
- ; !IsNull(&CurrentScriptFile->SubstList, &AliasListNode->Link)
- ; AliasListNode = (ALIAS_LIST*)GetNextNode(&CurrentScriptFile->SubstList, &AliasListNode->Link)
- ){
- for (Temp = StrStr(OriginalCommandLine, AliasListNode->Alias)
- ; Temp != NULL
- ; Temp = StrStr(Temp+1, AliasListNode->Alias)
- ){
- //
- // we need a preceeding and if there is space no ^ preceeding (if no space ignore)
- //
- if ((((Temp-OriginalCommandLine)>2) && *(Temp-2) != L'^') || ((Temp-OriginalCommandLine)<=2)) {
- NewSize += StrSize(AliasListNode->CommandString);
- }
- }
- }
- }
-
- for (MasterEnvList = EfiShellGetEnv(NULL)
- ; MasterEnvList != NULL && *MasterEnvList != CHAR_NULL //&& *(MasterEnvList+1) != CHAR_NULL
- ; MasterEnvList += StrLen(MasterEnvList) + 1
- ){
- if (StrSize(MasterEnvList) > ItemSize) {
- ItemSize = StrSize(MasterEnvList);
- }
- for (Temp = StrStr(OriginalCommandLine, MasterEnvList)
- ; Temp != NULL
- ; Temp = StrStr(Temp+1, MasterEnvList)
- ){
- //
- // we need a preceeding and following % and if there is space no ^ preceeding (if no space ignore)
- //
- if (*(Temp-1) == L'%' && *(Temp+StrLen(MasterEnvList)) == L'%' &&
- ((((Temp-OriginalCommandLine)>2) && *(Temp-2) != L'^') || ((Temp-OriginalCommandLine)<=2))) {
- NewSize+=StrSize(EfiShellGetEnv(MasterEnvList));
- }
- }
- }
-
- //
- // Quick out if none were found...
- //
- if (NewSize == StrSize(OriginalCommandLine)) {
- ASSERT(Temp == NULL);
- Temp = StrnCatGrow(&Temp, NULL, OriginalCommandLine, 0);
- return (Temp);
- }
-
- //
- // now do the replacements...
- //
- NewCommandLine1 = AllocateZeroPool(NewSize);
- NewCommandLine2 = AllocateZeroPool(NewSize);
- ItemTemp = AllocateZeroPool(ItemSize+(2*sizeof(CHAR16)));
- if (NewCommandLine1 == NULL || NewCommandLine2 == NULL || ItemTemp == NULL) {
- SHELL_FREE_NON_NULL(NewCommandLine1);
- SHELL_FREE_NON_NULL(NewCommandLine2);
- SHELL_FREE_NON_NULL(ItemTemp);
- return (NULL);
- }
- StrCpy(NewCommandLine1, OriginalCommandLine);
- for (MasterEnvList = EfiShellGetEnv(NULL)
- ; MasterEnvList != NULL && *MasterEnvList != CHAR_NULL //&& *(MasterEnvList+1) != CHAR_NULL
- ; MasterEnvList += StrLen(MasterEnvList) + 1
- ){
- StrCpy(ItemTemp, L"%");
- StrCat(ItemTemp, MasterEnvList);
- StrCat(ItemTemp, L"%");
- ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, ItemTemp, EfiShellGetEnv(MasterEnvList), TRUE, FALSE);
- StrCpy(NewCommandLine1, NewCommandLine2);
- }
- if (CurrentScriptFile != NULL) {
- for (AliasListNode = (ALIAS_LIST*)GetFirstNode(&CurrentScriptFile->SubstList)
- ; !IsNull(&CurrentScriptFile->SubstList, &AliasListNode->Link)
- ; AliasListNode = (ALIAS_LIST*)GetNextNode(&CurrentScriptFile->SubstList, &AliasListNode->Link)
- ){
- ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, AliasListNode->Alias, AliasListNode->CommandString, TRUE, FALSE);
- StrCpy(NewCommandLine1, NewCommandLine2);
- }
- }
-
- FreePool(NewCommandLine2);
- FreePool(ItemTemp);
-
- return (NewCommandLine1);
-}
-
-/**
- Internal function to run a command line with pipe usage.
-
- @param[in] CmdLine The pointer to the command line.
- @param[in] StdIn The pointer to the Standard input.
- @param[in] StdOut The pointer to the Standard output.
-
- @retval EFI_SUCCESS The split command is executed successfully.
- @retval other Some error occurs when executing the split command.
-**/
-EFI_STATUS
-EFIAPI
-RunSplitCommand(
- IN CONST CHAR16 *CmdLine,
- IN SHELL_FILE_HANDLE *StdIn,
- IN SHELL_FILE_HANDLE *StdOut
- )
-{
- EFI_STATUS Status;
- CHAR16 *NextCommandLine;
- CHAR16 *OurCommandLine;
- UINTN Size1;
- UINTN Size2;
- SPLIT_LIST *Split;
- SHELL_FILE_HANDLE *TempFileHandle;
- BOOLEAN Unicode;
-
- ASSERT(StdOut == NULL);
-
- ASSERT(StrStr(CmdLine, L"|") != NULL);
-
- Status = EFI_SUCCESS;
- NextCommandLine = NULL;
- OurCommandLine = NULL;
- Size1 = 0;
- Size2 = 0;
-
- NextCommandLine = StrnCatGrow(&NextCommandLine, &Size1, StrStr(CmdLine, L"|")+1, 0);
- OurCommandLine = StrnCatGrow(&OurCommandLine , &Size2, CmdLine , StrStr(CmdLine, L"|") - CmdLine);
-
- if (NextCommandLine == NULL || OurCommandLine == NULL) {
- SHELL_FREE_NON_NULL(OurCommandLine);
- SHELL_FREE_NON_NULL(NextCommandLine);
- return (EFI_OUT_OF_RESOURCES);
- } else if (StrStr(OurCommandLine, L"|") != NULL || Size1 == 0 || Size2 == 0) {
- SHELL_FREE_NON_NULL(OurCommandLine);
- SHELL_FREE_NON_NULL(NextCommandLine);
- return (EFI_INVALID_PARAMETER);
- } else if (NextCommandLine[0] != CHAR_NULL &&
- NextCommandLine[0] == L'a' &&
- NextCommandLine[1] == L' '
- ){
- CopyMem(NextCommandLine, NextCommandLine+1, StrSize(NextCommandLine) - sizeof(NextCommandLine[0]));
- Unicode = FALSE;
- } else {
- Unicode = TRUE;
- }
-
-
- //
- // make a SPLIT_LIST item and add to list
- //
- Split = AllocateZeroPool(sizeof(SPLIT_LIST));
- ASSERT(Split != NULL);
- Split->SplitStdIn = StdIn;
- Split->SplitStdOut = ConvertEfiFileProtocolToShellHandle(CreateFileInterfaceMem(Unicode), NULL);
- ASSERT(Split->SplitStdOut != NULL);
- InsertHeadList(&ShellInfoObject.SplitList.Link, &Split->Link);
-
- Status = RunCommand(OurCommandLine);
-
- //
- // move the output from the first to the in to the second.
- //
- TempFileHandle = Split->SplitStdOut;
- if (Split->SplitStdIn == StdIn) {
- Split->SplitStdOut = NULL;
- } else {
- Split->SplitStdOut = Split->SplitStdIn;
- }
- Split->SplitStdIn = TempFileHandle;
- ShellInfoObject.NewEfiShellProtocol->SetFilePosition(ConvertShellHandleToEfiFileProtocol(Split->SplitStdIn), 0);
-
- if (!EFI_ERROR(Status)) {
- Status = RunCommand(NextCommandLine);
- }
-
- //
- // remove the top level from the ScriptList
- //
- ASSERT((SPLIT_LIST*)GetFirstNode(&ShellInfoObject.SplitList.Link) == Split);
- RemoveEntryList(&Split->Link);
-
- //
- // Note that the original StdIn is now the StdOut...
- //
- if (Split->SplitStdOut != NULL && Split->SplitStdOut != StdIn) {
- ShellInfoObject.NewEfiShellProtocol->CloseFile(ConvertShellHandleToEfiFileProtocol(Split->SplitStdOut));
- }
- if (Split->SplitStdIn != NULL) {
- ShellInfoObject.NewEfiShellProtocol->CloseFile(ConvertShellHandleToEfiFileProtocol(Split->SplitStdIn));
- }
-
- FreePool(Split);
- FreePool(NextCommandLine);
- FreePool(OurCommandLine);
-
- return (Status);
-}
-
-/**
- Function will process and run a command line.
-
- This will determine if the command line represents an internal shell
- command or dispatch an external application.
-
- @param[in] CmdLine The command line to parse.
-
- @retval EFI_SUCCESS The command was completed.
- @retval EFI_ABORTED The command's operation was aborted.
-**/
-EFI_STATUS
-EFIAPI
-RunCommand(
- IN CONST CHAR16 *CmdLine
- )
-{
- EFI_STATUS Status;
- EFI_STATUS StatusCode;
- CHAR16 *CommandName;
- SHELL_STATUS ShellStatus;
- UINTN Argc;
- CHAR16 **Argv;
- BOOLEAN LastError;
- CHAR16 LeString[11];
- CHAR16 *PostAliasCmdLine;
- UINTN PostAliasSize;
- CHAR16 *PostVariableCmdLine;
- CHAR16 *CommandWithPath;
- CONST EFI_DEVICE_PATH_PROTOCOL *DevPath;
- CONST CHAR16 *TempLocation;
- CONST CHAR16 *TempLocation2;
- SHELL_FILE_HANDLE OriginalStdIn;
- SHELL_FILE_HANDLE OriginalStdOut;
- SHELL_FILE_HANDLE OriginalStdErr;
- SYSTEM_TABLE_INFO OriginalSystemTableInfo;
- CHAR16 *TempLocation3;
- UINTN Count;
- UINTN Count2;
- CHAR16 *CleanOriginal;
- SPLIT_LIST *Split;
-
- ASSERT(CmdLine != NULL);
- if (StrLen(CmdLine) == 0) {
- return (EFI_SUCCESS);
- }
-
- CommandName = NULL;
- PostVariableCmdLine = NULL;
- PostAliasCmdLine = NULL;
- CommandWithPath = NULL;
- DevPath = NULL;
- Status = EFI_SUCCESS;
- CleanOriginal = NULL;
- Split = NULL;
-
- CleanOriginal = StrnCatGrow(&CleanOriginal, NULL, CmdLine, 0);
- if (CleanOriginal == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- while (CleanOriginal[StrLen(CleanOriginal)-1] == L' ') {
- CleanOriginal[StrLen(CleanOriginal)-1] = CHAR_NULL;
- }
- while (CleanOriginal[0] == L' ') {
- CopyMem(CleanOriginal, CleanOriginal+1, StrSize(CleanOriginal) - sizeof(CleanOriginal[0]));
- }
-
- CommandName = NULL;
- if (StrStr(CleanOriginal, L" ") == NULL){
- StrnCatGrow(&CommandName, NULL, CleanOriginal, 0);
- } else {
- StrnCatGrow(&CommandName, NULL, CleanOriginal, StrStr(CleanOriginal, L" ") - CleanOriginal);
- }
-
- ASSERT(PostAliasCmdLine == NULL);
- if (!ShellCommandIsCommandOnList(CommandName)) {
- //
- // Convert via alias
- //
- Status = ShellConvertAlias(&CommandName);
- PostAliasSize = 0;
- PostAliasCmdLine = StrnCatGrow(&PostAliasCmdLine, &PostAliasSize, CommandName, 0);
- PostAliasCmdLine = StrnCatGrow(&PostAliasCmdLine, &PostAliasSize, StrStr(CleanOriginal, L" "), 0);
- ASSERT_EFI_ERROR(Status);
- } else {
- PostAliasCmdLine = StrnCatGrow(&PostAliasCmdLine, NULL, CleanOriginal, 0);
- }
-
- if (CleanOriginal != NULL) {
- FreePool(CleanOriginal);
- CleanOriginal = NULL;
- }
-
- if (CommandName != NULL) {
- FreePool(CommandName);
- CommandName = NULL;
- }
-
- PostVariableCmdLine = ShellConvertVariables(PostAliasCmdLine);
-
- //
- // we can now free the modified by alias command line
- //
- if (PostAliasCmdLine != NULL) {
- FreePool(PostAliasCmdLine);
- PostAliasCmdLine = NULL;
- }
-
- if (PostVariableCmdLine == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- while (PostVariableCmdLine[StrLen(PostVariableCmdLine)-1] == L' ') {
- PostVariableCmdLine[StrLen(PostVariableCmdLine)-1] = CHAR_NULL;
- }
- while (PostVariableCmdLine[0] == L' ') {
- CopyMem(PostVariableCmdLine, PostVariableCmdLine+1, StrSize(PostVariableCmdLine) - sizeof(PostVariableCmdLine[0]));
- }
-
- //
- // We dont do normal processing with a split command line (output from one command input to another)
- //
- TempLocation3 = NULL;
- if (StrStr(PostVariableCmdLine, L"|") != NULL) {
- for (TempLocation3 = PostVariableCmdLine ; TempLocation3 != NULL && *TempLocation3 != CHAR_NULL ; TempLocation3++) {
- if (*TempLocation3 == L'^' && *(TempLocation3+1) == L'|') {
- TempLocation3++;
- } else if (*TempLocation3 == L'|') {
- break;
- }
- }
- }
- if (TempLocation3 != NULL && *TempLocation3 != CHAR_NULL) {
- //
- // are we in an existing split???
- //
- if (!IsListEmpty(&ShellInfoObject.SplitList.Link)) {
- Split = (SPLIT_LIST*)GetFirstNode(&ShellInfoObject.SplitList.Link);
- }
-
- if (Split == NULL) {
- Status = RunSplitCommand(PostVariableCmdLine, NULL, NULL);
- } else {
- Status = RunSplitCommand(PostVariableCmdLine, Split->SplitStdIn, Split->SplitStdOut);
- }
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_SPLIT), ShellInfoObject.HiiHandle, PostVariableCmdLine);
- }
- } else {
-
- //
- // If this is a mapped drive change handle that...
- //
- if (PostVariableCmdLine[(StrLen(PostVariableCmdLine)-1)] == L':' && StrStr(PostVariableCmdLine, L" ") == NULL) {
- Status = ShellInfoObject.NewEfiShellProtocol->SetCurDir(NULL, PostVariableCmdLine);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_MAPPING), ShellInfoObject.HiiHandle, PostVariableCmdLine);
- }
- FreePool(PostVariableCmdLine);
- return (Status);
- }
-
- ///@todo update this section to divide into 3 ways - run internal command, run split (above), and run an external file...
- /// We waste a lot of time doing processing like StdIn,StdOut,Argv,Argc for things that are external files...
-
-
-
- Status = UpdateStdInStdOutStdErr(ShellInfoObject.NewShellParametersProtocol, PostVariableCmdLine, &OriginalStdIn, &OriginalStdOut, &OriginalStdErr, &OriginalSystemTableInfo);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_NOT_FOUND) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_REDUNDA_REDIR), ShellInfoObject.HiiHandle);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_REDIR), ShellInfoObject.HiiHandle);
- }
- } else {
- while (PostVariableCmdLine[StrLen(PostVariableCmdLine)-1] == L' ') {
- PostVariableCmdLine[StrLen(PostVariableCmdLine)-1] = CHAR_NULL;
- }
- while (PostVariableCmdLine[0] == L' ') {
- CopyMem(PostVariableCmdLine, PostVariableCmdLine+1, StrSize(PostVariableCmdLine) - sizeof(PostVariableCmdLine[0]));
- }
-
- //
- // get the argc and argv updated for internal commands
- //
- Status = UpdateArgcArgv(ShellInfoObject.NewShellParametersProtocol, PostVariableCmdLine, &Argv, &Argc);
- ASSERT_EFI_ERROR(Status);
-
- for (Count = 0 ; Count < ShellInfoObject.NewShellParametersProtocol->Argc ; Count++) {
- if (StrStr(ShellInfoObject.NewShellParametersProtocol->Argv[Count], L"-?") == ShellInfoObject.NewShellParametersProtocol->Argv[Count]
- || (ShellInfoObject.NewShellParametersProtocol->Argv[0][0] == L'?' && ShellInfoObject.NewShellParametersProtocol->Argv[0][1] == CHAR_NULL)
- ) {
- //
- // We need to redo the arguments since a parameter was -?
- // move them all down 1 to the end, then up one then replace the first with help
- //
- FreePool(ShellInfoObject.NewShellParametersProtocol->Argv[Count]);
- ShellInfoObject.NewShellParametersProtocol->Argv[Count] = NULL;
- for (Count2 = Count ; (Count2 + 1) < ShellInfoObject.NewShellParametersProtocol->Argc ; Count2++) {
- ShellInfoObject.NewShellParametersProtocol->Argv[Count2] = ShellInfoObject.NewShellParametersProtocol->Argv[Count2+1];
- }
- ShellInfoObject.NewShellParametersProtocol->Argv[Count2] = NULL;
- for (Count2 = ShellInfoObject.NewShellParametersProtocol->Argc -1 ; Count2 > 0 ; Count2--) {
- ShellInfoObject.NewShellParametersProtocol->Argv[Count2] = ShellInfoObject.NewShellParametersProtocol->Argv[Count2-1];
- }
- ShellInfoObject.NewShellParametersProtocol->Argv[0] = NULL;
- ShellInfoObject.NewShellParametersProtocol->Argv[0] = StrnCatGrow(&ShellInfoObject.NewShellParametersProtocol->Argv[0], NULL, L"help", 0);
- break;
- }
- }
-
- //
- // command or file?
- //
- if (ShellCommandIsCommandOnList(ShellInfoObject.NewShellParametersProtocol->Argv[0])) {
- //
- // Run the command (which was converted if it was an alias)
- //
- if (!EFI_ERROR(Status)) {
- Status = ShellCommandRunCommandHandler(ShellInfoObject.NewShellParametersProtocol->Argv[0], &ShellStatus, &LastError);
- ASSERT_EFI_ERROR(Status);
- UnicodeSPrint(LeString, sizeof(LeString)*sizeof(LeString[0]), L"0x%08x", ShellStatus);
- DEBUG_CODE(InternalEfiShellSetEnv(L"DebugLasterror", LeString, TRUE););
- if (LastError) {
- InternalEfiShellSetEnv(L"Lasterror", LeString, TRUE);
- }
- //
- // Pass thru the exitcode from the app.
- //
- if (ShellCommandGetExit()) {
- Status = ShellStatus;
- } else if (ShellStatus != 0 && IsScriptOnlyCommand(ShellInfoObject.NewShellParametersProtocol->Argv[0])) {
- Status = EFI_ABORTED;
- }
- }
- } else {
- //
- // run an external file (or script)
- //
- if (StrStr(ShellInfoObject.NewShellParametersProtocol->Argv[0], L":") != NULL) {
- ASSERT (CommandWithPath == NULL);
- if (ShellIsFile(ShellInfoObject.NewShellParametersProtocol->Argv[0]) == EFI_SUCCESS) {
- CommandWithPath = StrnCatGrow(&CommandWithPath, NULL, ShellInfoObject.NewShellParametersProtocol->Argv[0], 0);
- }
- }
- if (CommandWithPath == NULL) {
- CommandWithPath = ShellFindFilePathEx(ShellInfoObject.NewShellParametersProtocol->Argv[0], mExecutableExtensions);
- }
- if (CommandWithPath == NULL || ShellIsDirectory(CommandWithPath) == EFI_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, ShellInfoObject.NewShellParametersProtocol->Argv[0]);
- } else {
- //
- // Check if it's a NSH (script) file.
- //
- TempLocation = CommandWithPath+StrLen(CommandWithPath)-4;
- TempLocation2 = mScriptExtension;
- if ((StrLen(CommandWithPath) > 4) && (StringNoCaseCompare((VOID*)(&TempLocation), (VOID*)(&TempLocation2)) == 0)) {
- Status = RunScriptFile (CommandWithPath);
- } else {
- DevPath = ShellInfoObject.NewEfiShellProtocol->GetDevicePathFromFilePath(CommandWithPath);
- ASSERT(DevPath != NULL);
- Status = InternalShellExecuteDevicePath(
- &gImageHandle,
- DevPath,
- PostVariableCmdLine,
- NULL,
- &StatusCode
- );
-
- //
- // Updatet last error status.
- //
- UnicodeSPrint(LeString, sizeof(LeString)*sizeof(LeString[0]), L"0x%08x", StatusCode);
- DEBUG_CODE(InternalEfiShellSetEnv(L"DebugLasterror", LeString, TRUE););
- InternalEfiShellSetEnv(L"Lasterror", LeString, TRUE);
- }
- }
- }
-
- //
- // Print some error info.
- //
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR), ShellInfoObject.HiiHandle, (VOID*)(Status));
- }
-
- CommandName = StrnCatGrow(&CommandName, NULL, ShellInfoObject.NewShellParametersProtocol->Argv[0], 0);
-
- RestoreArgcArgv(ShellInfoObject.NewShellParametersProtocol, &Argv, &Argc);
-
- RestoreStdInStdOutStdErr(ShellInfoObject.NewShellParametersProtocol, &OriginalStdIn, &OriginalStdOut, &OriginalStdErr, &OriginalSystemTableInfo);
- }
- if (CommandName != NULL) {
- if (ShellCommandGetCurrentScriptFile() != NULL && !IsScriptOnlyCommand(CommandName)) {
- //
- // if this is NOT a scipt only command return success so the script won't quit.
- // prevent killing the script - this is the only place where we know the actual command name (after alias and variable replacement...)
- //
- Status = EFI_SUCCESS;
- }
- }
- }
-
- SHELL_FREE_NON_NULL(CommandName);
- SHELL_FREE_NON_NULL(CommandWithPath);
- SHELL_FREE_NON_NULL(PostVariableCmdLine);
-
- return (Status);
-}
-
-STATIC CONST UINT16 InvalidChars[] = {L'*', L'?', L'<', L'>', L'\\', L'/', L'\"', 0x0001, 0x0002};
-/**
- Function determins if the CommandName COULD be a valid command. It does not determine whether
- this is a valid command. It only checks for invalid characters.
-
- @param[in] CommandName The name to check
-
- @retval TRUE CommandName could be a command name
- @retval FALSE CommandName could not be a valid command name
-**/
-BOOLEAN
-EFIAPI
-IsValidCommandName(
- IN CONST CHAR16 *CommandName
- )
-{
- UINTN Count;
- if (CommandName == NULL) {
- ASSERT(FALSE);
- return (FALSE);
- }
- for ( Count = 0
- ; Count < sizeof(InvalidChars) / sizeof(InvalidChars[0])
- ; Count++
- ){
- if (ScanMem16(CommandName, StrSize(CommandName), InvalidChars[Count]) != NULL) {
- return (FALSE);
- }
- }
- return (TRUE);
-}
-
-/**
- Function to process a NSH script file via SHELL_FILE_HANDLE.
-
- @param[in] Handle The handle to the already opened file.
- @param[in] Name The name of the script file.
-
- @retval EFI_SUCCESS the script completed sucessfully
-**/
-EFI_STATUS
-EFIAPI
-RunScriptFileHandle (
- IN SHELL_FILE_HANDLE Handle,
- IN CONST CHAR16 *Name
- )
-{
- EFI_STATUS Status;
- SCRIPT_FILE *NewScriptFile;
- UINTN LoopVar;
- CHAR16 *CommandLine;
- CHAR16 *CommandLine2;
- CHAR16 *CommandLine3;
- SCRIPT_COMMAND_LIST *LastCommand;
- BOOLEAN Ascii;
- BOOLEAN PreScriptEchoState;
- BOOLEAN PreCommandEchoState;
- CONST CHAR16 *CurDir;
- UINTN LineCount;
- CHAR16 LeString[50];
-
- ASSERT(!ShellCommandGetScriptExit());
-
- PreScriptEchoState = ShellCommandGetEchoState();
-
- NewScriptFile = (SCRIPT_FILE*)AllocateZeroPool(sizeof(SCRIPT_FILE));
- if (NewScriptFile == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- //
- // Set up the name
- //
- ASSERT(NewScriptFile->ScriptName == NULL);
- NewScriptFile->ScriptName = StrnCatGrow(&NewScriptFile->ScriptName, NULL, Name, 0);
- if (NewScriptFile->ScriptName == NULL) {
- DeleteScriptFileStruct(NewScriptFile);
- return (EFI_OUT_OF_RESOURCES);
- }
-
- //
- // Save the parameters (used to replace %0 to %9 later on)
- //
- NewScriptFile->Argc = ShellInfoObject.NewShellParametersProtocol->Argc;
- if (NewScriptFile->Argc != 0) {
- NewScriptFile->Argv = (CHAR16**)AllocateZeroPool(NewScriptFile->Argc * sizeof(CHAR16*));
- if (NewScriptFile->Argv == NULL) {
- DeleteScriptFileStruct(NewScriptFile);
- return (EFI_OUT_OF_RESOURCES);
- }
- for (LoopVar = 0 ; LoopVar < 10 && LoopVar < NewScriptFile->Argc; LoopVar++) {
- ASSERT(NewScriptFile->Argv[LoopVar] == NULL);
- NewScriptFile->Argv[LoopVar] = StrnCatGrow(&NewScriptFile->Argv[LoopVar], NULL, ShellInfoObject.NewShellParametersProtocol->Argv[LoopVar], 0);
- if (NewScriptFile->Argv[LoopVar] == NULL) {
- DeleteScriptFileStruct(NewScriptFile);
- return (EFI_OUT_OF_RESOURCES);
- }
- }
- } else {
- NewScriptFile->Argv = NULL;
- }
-
- InitializeListHead(&NewScriptFile->CommandList);
- InitializeListHead(&NewScriptFile->SubstList);
-
- //
- // Now build the list of all script commands.
- //
- LineCount = 0;
- while(!ShellFileHandleEof(Handle)) {
- CommandLine = ShellFileHandleReturnLine(Handle, &Ascii);
- LineCount++;
- if (CommandLine == NULL || StrLen(CommandLine) == 0) {
- continue;
- }
- NewScriptFile->CurrentCommand = AllocateZeroPool(sizeof(SCRIPT_COMMAND_LIST));
- if (NewScriptFile->CurrentCommand == NULL) {
- DeleteScriptFileStruct(NewScriptFile);
- return (EFI_OUT_OF_RESOURCES);
- }
-
- NewScriptFile->CurrentCommand->Cl = CommandLine;
- NewScriptFile->CurrentCommand->Data = NULL;
- NewScriptFile->CurrentCommand->Line = LineCount;
-
- InsertTailList(&NewScriptFile->CommandList, &NewScriptFile->CurrentCommand->Link);
- }
-
- //
- // Add this as the topmost script file
- //
- ShellCommandSetNewScript (NewScriptFile);
-
- //
- // Now enumerate through the commands and run each one.
- //
- CommandLine = AllocateZeroPool(PcdGet16(PcdShellPrintBufferSize));
- if (CommandLine == NULL) {
- DeleteScriptFileStruct(NewScriptFile);
- return (EFI_OUT_OF_RESOURCES);
- }
- CommandLine2 = AllocateZeroPool(PcdGet16(PcdShellPrintBufferSize));
- if (CommandLine2 == NULL) {
- FreePool(CommandLine);
- DeleteScriptFileStruct(NewScriptFile);
- return (EFI_OUT_OF_RESOURCES);
- }
-
- for ( NewScriptFile->CurrentCommand = (SCRIPT_COMMAND_LIST *)GetFirstNode(&NewScriptFile->CommandList)
- ; !IsNull(&NewScriptFile->CommandList, &NewScriptFile->CurrentCommand->Link)
- ; // conditional increment in the body of the loop
- ){
- ASSERT(CommandLine2 != NULL);
- StrCpy(CommandLine2, NewScriptFile->CurrentCommand->Cl);
-
- //
- // NULL out comments
- //
- for (CommandLine3 = CommandLine2 ; CommandLine3 != NULL && *CommandLine3 != CHAR_NULL ; CommandLine3++) {
- if (*CommandLine3 == L'^') {
- if (*(CommandLine3+1) == L'#' || *(CommandLine3+1) == L':') {
- CopyMem(CommandLine3, CommandLine3+1, StrSize(CommandLine3) - sizeof(CommandLine3[0]));
- }
- } else if (*CommandLine3 == L'#') {
- *CommandLine3 = CHAR_NULL;
- }
- }
-
- if (CommandLine2 != NULL && StrLen(CommandLine2) >= 1) {
- //
- // Due to variability in starting the find and replace action we need to have both buffers the same.
- //
- StrCpy(CommandLine, CommandLine2);
-
- //
- // Remove the %0 to %9 from the command line (if we have some arguments)
- //
- if (NewScriptFile->Argv != NULL) {
- switch (NewScriptFile->Argc) {
- default:
- Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PcdGet16 (PcdShellPrintBufferSize), L"%9", NewScriptFile->Argv[9], FALSE, TRUE);
- ASSERT_EFI_ERROR(Status);
- case 9:
- Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PcdGet16 (PcdShellPrintBufferSize), L"%8", NewScriptFile->Argv[8], FALSE, TRUE);
- ASSERT_EFI_ERROR(Status);
- case 8:
- Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PcdGet16 (PcdShellPrintBufferSize), L"%7", NewScriptFile->Argv[7], FALSE, TRUE);
- ASSERT_EFI_ERROR(Status);
- case 7:
- Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PcdGet16 (PcdShellPrintBufferSize), L"%6", NewScriptFile->Argv[6], FALSE, TRUE);
- ASSERT_EFI_ERROR(Status);
- case 6:
- Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PcdGet16 (PcdShellPrintBufferSize), L"%5", NewScriptFile->Argv[5], FALSE, TRUE);
- ASSERT_EFI_ERROR(Status);
- case 5:
- Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PcdGet16 (PcdShellPrintBufferSize), L"%4", NewScriptFile->Argv[4], FALSE, TRUE);
- ASSERT_EFI_ERROR(Status);
- case 4:
- Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PcdGet16 (PcdShellPrintBufferSize), L"%3", NewScriptFile->Argv[3], FALSE, TRUE);
- ASSERT_EFI_ERROR(Status);
- case 3:
- Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PcdGet16 (PcdShellPrintBufferSize), L"%2", NewScriptFile->Argv[2], FALSE, TRUE);
- ASSERT_EFI_ERROR(Status);
- case 2:
- Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PcdGet16 (PcdShellPrintBufferSize), L"%1", NewScriptFile->Argv[1], FALSE, TRUE);
- ASSERT_EFI_ERROR(Status);
- case 1:
- Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PcdGet16 (PcdShellPrintBufferSize), L"%0", NewScriptFile->Argv[0], FALSE, TRUE);
- ASSERT_EFI_ERROR(Status);
- break;
- case 0:
- break;
- }
- }
- Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PcdGet16 (PcdShellPrintBufferSize), L"%1", L"\"\"", FALSE, FALSE);
- Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PcdGet16 (PcdShellPrintBufferSize), L"%2", L"\"\"", FALSE, FALSE);
- Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PcdGet16 (PcdShellPrintBufferSize), L"%3", L"\"\"", FALSE, FALSE);
- Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PcdGet16 (PcdShellPrintBufferSize), L"%4", L"\"\"", FALSE, FALSE);
- Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PcdGet16 (PcdShellPrintBufferSize), L"%5", L"\"\"", FALSE, FALSE);
- Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PcdGet16 (PcdShellPrintBufferSize), L"%6", L"\"\"", FALSE, FALSE);
- Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PcdGet16 (PcdShellPrintBufferSize), L"%7", L"\"\"", FALSE, FALSE);
- Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PcdGet16 (PcdShellPrintBufferSize), L"%8", L"\"\"", FALSE, FALSE);
- Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PcdGet16 (PcdShellPrintBufferSize), L"%9", L"\"\"", FALSE, FALSE);
-
- StrCpy(CommandLine2, CommandLine);
-
- LastCommand = NewScriptFile->CurrentCommand;
-
- for (CommandLine3 = CommandLine2 ; CommandLine3[0] == L' ' ; CommandLine3++);
-
- if (CommandLine3 != NULL && CommandLine3[0] == L':' ) {
- //
- // This line is a goto target / label
- //
- } else {
- if (CommandLine3 != NULL && StrLen(CommandLine3) > 0) {
- if (CommandLine3[0] == L'@') {
- //
- // We need to save the current echo state
- // and disable echo for just this command.
- //
- PreCommandEchoState = ShellCommandGetEchoState();
- ShellCommandSetEchoState(FALSE);
- Status = RunCommand(CommandLine3+1);
-
- //
- // Now restore the pre-'@' echo state.
- //
- ShellCommandSetEchoState(PreCommandEchoState);
- } else {
- if (ShellCommandGetEchoState()) {
- CurDir = ShellInfoObject.NewEfiShellProtocol->GetEnv(L"cwd");
- if (CurDir != NULL && StrLen(CurDir) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_CURDIR), ShellInfoObject.HiiHandle, CurDir);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_SHELL), ShellInfoObject.HiiHandle);
- }
- ShellPrintEx(-1, -1, L"%s\r\n", CommandLine2);
- }
- Status = RunCommand(CommandLine3);
- }
- }
-
- if (ShellCommandGetScriptExit()) {
- UnicodeSPrint(LeString, sizeof(LeString)*sizeof(LeString[0]), L"0x%Lx", ShellCommandGetExitCode());
- DEBUG_CODE(InternalEfiShellSetEnv(L"DebugLasterror", LeString, TRUE););
- InternalEfiShellSetEnv(L"Lasterror", LeString, TRUE);
-
- ShellCommandRegisterExit(FALSE, 0);
- Status = EFI_SUCCESS;
- break;
- }
- if (EFI_ERROR(Status)) {
- break;
- }
- if (ShellCommandGetExit()) {
- break;
- }
- }
- //
- // If that commend did not update the CurrentCommand then we need to advance it...
- //
- if (LastCommand == NewScriptFile->CurrentCommand) {
- NewScriptFile->CurrentCommand = (SCRIPT_COMMAND_LIST *)GetNextNode(&NewScriptFile->CommandList, &NewScriptFile->CurrentCommand->Link);
- if (!IsNull(&NewScriptFile->CommandList, &NewScriptFile->CurrentCommand->Link)) {
- NewScriptFile->CurrentCommand->Reset = TRUE;
- }
- }
- } else {
- NewScriptFile->CurrentCommand = (SCRIPT_COMMAND_LIST *)GetNextNode(&NewScriptFile->CommandList, &NewScriptFile->CurrentCommand->Link);
- if (!IsNull(&NewScriptFile->CommandList, &NewScriptFile->CurrentCommand->Link)) {
- NewScriptFile->CurrentCommand->Reset = TRUE;
- }
- }
- }
-
-
- FreePool(CommandLine);
- FreePool(CommandLine2);
- ShellCommandSetNewScript (NULL);
-
- //
- // Only if this was the last script reset the state.
- //
- if (ShellCommandGetCurrentScriptFile()==NULL) {
- ShellCommandSetEchoState(PreScriptEchoState);
- }
- return (EFI_SUCCESS);
-}
-
-/**
- Function to process a NSH script file.
-
- @param[in] ScriptPath Pointer to the script file name (including file system path).
-
- @retval EFI_SUCCESS the script completed sucessfully
-**/
-EFI_STATUS
-EFIAPI
-RunScriptFile (
- IN CONST CHAR16 *ScriptPath
- )
-{
- EFI_STATUS Status;
- SHELL_FILE_HANDLE FileHandle;
-
- if (ShellIsFile(ScriptPath) != EFI_SUCCESS) {
- return (EFI_INVALID_PARAMETER);
- }
-
- Status = ShellOpenFileByName(ScriptPath, &FileHandle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- Status = RunScriptFileHandle(FileHandle, ScriptPath);
-
- ShellCloseFile(&FileHandle);
-
- return (Status);
-}
diff --git a/ShellPkg/Application/Shell/Shell.h b/ShellPkg/Application/Shell/Shell.h
deleted file mode 100644
index d01b126075..0000000000
--- a/ShellPkg/Application/Shell/Shell.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/** @file
- function definitions for internal to shell functions.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_INTERNAL_HEADER_
-#define _SHELL_INTERNAL_HEADER_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/ShellVariableGuid.h>
-
-#include <Protocol/LoadedImage.h>
-#include <Protocol/SimpleTextOut.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellInterface.h>
-#include <Protocol/EfiShellEnvironment2.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/BlockIo.h>
-
-#include <Library/BaseLib.h>
-#include <Library/UefiApplicationEntryPoint.h>
-#include <Library/UefiLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/DevicePathLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellLib.h>
-#include <Library/SortLib.h>
-#include <Library/HiiLib.h>
-#include <Library/PrintLib.h>
-#include <Library/HandleParsingLib.h>
-#include <Library/PathLib.h>
-
-#include "ShellParametersProtocol.h"
-#include "ShellProtocol.h"
-#include "ShellEnvVar.h"
-#include "ConsoleLogger.h"
-#include "ShellManParser.h"
-#include "ConsoleWrappers.h"
-
-typedef struct {
- LIST_ENTRY Link; ///< Standard linked list handler.
- SHELL_FILE_HANDLE *SplitStdOut; ///< ConsoleOut for use in the split.
- SHELL_FILE_HANDLE *SplitStdIn; ///< ConsoleIn for use in the split.
-} SPLIT_LIST;
-
-typedef struct {
- UINT32 Startup:1; ///< Was "-startup" found on command line.
- UINT32 NoStartup:1; ///< Was "-nostartup" found on command line.
- UINT32 NoConsoleOut:1; ///< Was "-noconsoleout" found on command line.
- UINT32 NoConsoleIn:1; ///< Was "-noconsolein" found on command line.
- UINT32 NoInterrupt:1; ///< Was "-nointerrupt" found on command line.
- UINT32 NoMap:1; ///< Was "-nomap" found on command line.
- UINT32 NoVersion:1; ///< Was "-noversion" found on command line.
- UINT32 Delay:1; ///< Was "-delay[:n] found on command line
- UINT32 Reserved:8; ///< Extra bits
-} SHELL_BITS;
-
-typedef union {
- SHELL_BITS Bits;
- UINT16 AllBits;
-} SHELL_BIT_UNION;
-
-typedef struct {
- SHELL_BIT_UNION BitUnion;
- UINTN Delay; ///< Seconds of delay default:5.
- CHAR16 *FileName; ///< Filename to run upon successful initialization.
- CHAR16 *FileOptions; ///< Options to pass to FileName.
-} SHELL_INIT_SETTINGS;
-
-typedef struct {
- BUFFER_LIST CommandHistory;
- UINTN VisibleRowNumber;
- UINTN OriginalVisibleRowNumber;
- BOOLEAN InsertMode; ///< Is the current typing mode insert (FALSE = overwrite).
-} SHELL_VIEWING_SETTINGS;
-
-typedef struct {
- EFI_SHELL_PARAMETERS_PROTOCOL *NewShellParametersProtocol;
- EFI_SHELL_PROTOCOL *NewEfiShellProtocol;
- BOOLEAN PageBreakEnabled;
- BOOLEAN RootShellInstance;
- SHELL_INIT_SETTINGS ShellInitSettings;
- BUFFER_LIST BufferToFreeList; ///< List of buffers that were returned to the user to free.
- SHELL_VIEWING_SETTINGS ViewingSettings;
- EFI_HII_HANDLE HiiHandle; ///< Handle from HiiLib.
- UINTN LogScreenCount; ///< How many screens of log information to save.
- EFI_EVENT UserBreakTimer; ///< Timer event for polling for CTRL-C.
- EFI_DEVICE_PATH_PROTOCOL *ImageDevPath; ///< DevicePath for ourselves.
- EFI_DEVICE_PATH_PROTOCOL *FileDevPath; ///< DevicePath for ourselves.
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo; ///< Pointer for ConsoleInformation.
- EFI_SHELL_PARAMETERS_PROTOCOL *OldShellParameters; ///< old shell parameters to reinstall upon exiting.
- SHELL_PROTOCOL_HANDLE_LIST OldShellList; ///< List of other instances to reinstall when closing.
- SPLIT_LIST SplitList; ///< List of Splits in FILO stack.
- EFI_HANDLE CtrlCNotifyHandle1; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
- EFI_HANDLE CtrlCNotifyHandle2; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
- EFI_HANDLE CtrlCNotifyHandle3; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
- EFI_HANDLE CtrlCNotifyHandle4; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
- EFI_HANDLE CtrlSNotifyHandle1; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
- EFI_HANDLE CtrlSNotifyHandle2; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
- EFI_HANDLE CtrlSNotifyHandle3; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
- EFI_HANDLE CtrlSNotifyHandle4; ///< The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
- BOOLEAN HaltOutput; ///< TRUE to start a CTRL-S halt.
-} SHELL_INFO;
-
-extern SHELL_INFO ShellInfoObject;
-
-/**
- Sets all the alias' that were registered with the ShellCommandLib library.
-
- @retval EFI_SUCCESS all init commands were run sucessfully.
-**/
-EFI_STATUS
-EFIAPI
-SetBuiltInAlias(
- VOID
- );
-
-/**
- This function will populate the 2 device path protocol parameters based on the
- global gImageHandle. the DevPath will point to the device path for the handle that has
- loaded image protocol installed on it. the FilePath will point to the device path
- for the file that was loaded.
-
- @param[in, out] DevPath on a sucessful return the device path to the loaded image
- @param[in, out] FilePath on a sucessful return the device path to the file
-
- @retval EFI_SUCCESS the 2 device paths were sucessfully returned.
- @return other a error from gBS->HandleProtocol
-
- @sa HandleProtocol
-**/
-EFI_STATUS
-EFIAPI
-GetDevicePathsForImageAndFile (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevPath,
- IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath
- );
-
-/**
- Process all Uefi Shell 2.0 command line options.
-
- see Uefi Shell 2.0 section 3.2 for full details.
-
- the command line should resemble the following:
-
- shell.efi [ShellOpt-options] [options] [file-name [file-name-options]]
-
- ShellOpt options Options which control the initialization behavior of the shell.
- These options are read from the EFI global variable "ShellOpt"
- and are processed before options or file-name.
-
- options Options which control the initialization behavior of the shell.
-
- file-name The name of a UEFI shell application or script to be executed
- after initialization is complete. By default, if file-name is
- specified, then -nostartup is implied. Scripts are not supported
- by level 0.
-
- file-nameoptions The command-line options that are passed to file-name when it
- is invoked.
-
- This will initialize the ShellInitSettings global variable.
-
- @retval EFI_SUCCESS the variable is initialized.
-**/
-EFI_STATUS
-EFIAPI
-ProcessCommandLine(
- VOID
- );
-
-/**
- Handles all interaction with the default startup script.
-
- this will check that the correct command line parameters were passed, handle the delay, and then start running the script.
-
- @param[in] ImagePath The path to the image for shell. The first place to look for the startup script.
- @param[in] FilePath The path to the file for shell. The second place to look for the startup script.
-
- @retval EFI_SUCCESS The variable is initialized.
-**/
-EFI_STATUS
-EFIAPI
-DoStartupScript(
- IN EFI_DEVICE_PATH_PROTOCOL *ImagePath,
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath
- );
-
-/**
- Function to perform the shell prompt looping. It will do a single prompt,
- dispatch the result, and then return. It is expected that the caller will
- call this function in a loop many times.
-
- @retval EFI_SUCCESS
- @retval RETURN_ABORTED
-**/
-EFI_STATUS
-EFIAPI
-DoShellPrompt (
- VOID
- );
-
-/**
- Add a buffer to the Buffer To Free List for safely returning buffers to other
- places without risking letting them modify internal shell information.
-
- @param Buffer Something to pass to FreePool when the shell is exiting.
-**/
-VOID*
-EFIAPI
-AddBufferToFreeList(
- VOID *Buffer
- );
-
-/**
- Add a buffer to the Command History List.
-
- @param Buffer[in] The line buffer to add.
-**/
-VOID
-EFIAPI
-AddLineToCommandHistory(
- IN CONST CHAR16 *Buffer
- );
-
-/**
- Function will process and run a command line.
-
- This will determine if the command line represents an internal shell command or dispatch an external application.
-
- @param[in] CmdLine the command line to parse
-
- @retval EFI_SUCCESS the command was completed
- @retval EFI_ABORTED the command's operation was aborted
-**/
-EFI_STATUS
-EFIAPI
-RunCommand(
- IN CONST CHAR16 *CmdLine
- );
-
-/**
- Function determins if the CommandName COULD be a valid command. It does not determine whether
- this is a valid command. It only checks for invalid characters.
-
- @param[in] CommandName The name to check
-
- @retval TRUE CommandName could be a command name
- @retval FALSE CommandName could not be a valid command name
-**/
-BOOLEAN
-EFIAPI
-IsValidCommandName(
- IN CONST CHAR16 *CommandName
- );
-
-/**
- Function to process a NSH script file via SHELL_FILE_HANDLE.
-
- @param[in] Handle The handle to the already opened file.
- @param[in] Name The name of the script file.
-
- @retval EFI_SUCCESS the script completed sucessfully
-**/
-EFI_STATUS
-EFIAPI
-RunScriptFileHandle (
- IN SHELL_FILE_HANDLE Handle,
- IN CONST CHAR16 *Name
- );
-
-/**
- Function to process a NSH script file.
-
- @param[in] ScriptPath Pointer to the script file name (including file system path).
-
- @retval EFI_SUCCESS the script completed sucessfully
-**/
-EFI_STATUS
-EFIAPI
-RunScriptFile (
- IN CONST CHAR16 *ScriptPath
- );
-
-
-#endif //_SHELL_INTERNAL_HEADER_
-
diff --git a/ShellPkg/Application/Shell/Shell.inf b/ShellPkg/Application/Shell/Shell.inf
deleted file mode 100644
index c3af617430..0000000000
--- a/ShellPkg/Application/Shell/Shell.inf
+++ /dev/null
@@ -1,109 +0,0 @@
-## @file
-# This is the shell application
-#
-# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = Shell
- FILE_GUID = 7C04A583-9E3E-4f1c-AD65-E05268D0B4D1
- MODULE_TYPE = UEFI_APPLICATION
- VERSION_STRING = 1.0
- ENTRY_POINT = UefiMain
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources]
- Shell.c
- Shell.h
- ShellParametersProtocol.c
- ShellParametersProtocol.h
- ShellProtocol.c
- ShellProtocol.h
- FileHandleWrappers.c
- FileHandleWrappers.h
- FileHandleInternal.h
- ShellEnvVar.c
- ShellEnvVar.h
- ShellManParser.c
- ShellManParser.h
- Shell.uni
- ConsoleLogger.c
- ConsoleLogger.h
- ConsoleWrappers.c
- ConsoleWrappers.h
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- BaseLib
- UefiApplicationEntryPoint
- UefiLib
- DebugLib
- MemoryAllocationLib
- ShellCommandLib
- UefiRuntimeServicesTableLib
- UefiBootServicesTableLib
- DevicePathLib
- BaseMemoryLib
- PcdLib
- FileHandleLib
- PrintLib
- HiiLib
- SortLib
- HandleParsingLib
- PathLib
-
-[Guids]
- gShellVariableGuid # ALWAYS_CONSUMED
- gShellMapGuid # ALWAYS_CONSUMED
- gShellAliasGuid # ALWAYS_CONSUMED
-
-[Protocols]
- gEfiShellProtocolGuid # ALWAYS_PRODUCED
- # SOMETIMES_CONSUMED
- gEfiShellParametersProtocolGuid # ALWAYS_PRODUCED
- # SOMETIMES_CONSUMED
-
-# gEfiShellEnvironment2Guid # SOMETIMES_PRODUCED
-# gEfiShellInterfaceGuid # SOMETIMES_PRODUCED
-
- gEfiSimpleTextInputExProtocolGuid # ALWAYS_CONSUMED
- gEfiSimpleTextInProtocolGuid # ALWAYS_CONSUMED
- gEfiSimpleTextOutProtocolGuid # ALWAYS_CONSUMED
- gEfiSimpleFileSystemProtocolGuid # ALWAYS_CONSUMED
- gEfiLoadedImageProtocolGuid # ALWAYS_CONSUMED
- gEfiComponentName2ProtocolGuid # ALWAYS_CONSUMED
- gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED
- gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED
-
-[Pcd]
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportOldProtocols # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellRequireHiiPlatform # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportFrameworkHii # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellPageBreakDefault # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellInsertModeDefault # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellScreenLogCount # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole # ALWAYS_CONSUMED
-
diff --git a/ShellPkg/Application/Shell/Shell.uni b/ShellPkg/Application/Shell/Shell.uni
deleted file mode 100644
index 71484b441e..0000000000
--- a/ShellPkg/Application/Shell/Shell.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Application/Shell/ShellEnvVar.c b/ShellPkg/Application/Shell/ShellEnvVar.c
deleted file mode 100644
index a4bd6a6179..0000000000
--- a/ShellPkg/Application/Shell/ShellEnvVar.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/** @file
- function declarations for shell environment functions.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/ShellVariableGuid.h>
-
-#include <Library/BaseLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/DebugLib.h>
-#include <Library/BaseMemoryLib.h>
-
-#include "ShellEnvVar.h"
-
-/**
- Reports whether an environment variable is Volatile or Non-Volatile.
-
- @param EnvVarName The name of the environment variable in question
-
- @retval TRUE This environment variable is Volatile
- @retval FALSE This environment variable is NON-Volatile
-**/
-BOOLEAN
-EFIAPI
-IsVolatileEnv (
- IN CONST CHAR16 *EnvVarName
- )
-{
- EFI_STATUS Status;
- UINTN Size;
- VOID *Buffer;
- UINT32 Attribs;
-
- Size = 0;
- Buffer = NULL;
-
- //
- // get the variable
- //
- Status = gRT->GetVariable((CHAR16*)EnvVarName,
- &gShellVariableGuid,
- &Attribs,
- &Size,
- Buffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Buffer = AllocateZeroPool(Size);
- ASSERT(Buffer != NULL);
- Status = gRT->GetVariable((CHAR16*)EnvVarName,
- &gShellVariableGuid,
- &Attribs,
- &Size,
- Buffer);
- FreePool(Buffer);
- }
- //
- // not found means volatile
- //
- if (Status == EFI_NOT_FOUND) {
- return (TRUE);
- }
- ASSERT_EFI_ERROR(Status);
-
- //
- // check for the Non Volatile bit
- //
- if ((Attribs & EFI_VARIABLE_NON_VOLATILE) == EFI_VARIABLE_NON_VOLATILE) {
- return (FALSE);
- }
-
- //
- // everything else is volatile
- //
- return (TRUE);
-}
-
-/**
- free function for ENV_VAR_LIST objects.
-
- @param[in] List The pointer to pointer to list.
-**/
-VOID
-EFIAPI
-FreeEnvironmentVariableList(
- IN LIST_ENTRY *List
- )
-{
- ENV_VAR_LIST *Node;
-
- ASSERT (List != NULL);
- if (List == NULL) {
- return;
- }
-
- for ( Node = (ENV_VAR_LIST*)GetFirstNode(List)
- ; IsListEmpty(List)
- ; Node = (ENV_VAR_LIST*)GetFirstNode(List)
- ){
- ASSERT(Node != NULL);
- RemoveEntryList(&Node->Link);
- if (Node->Key != NULL) {
- FreePool(Node->Key);
- }
- if (Node->Val != NULL) {
- FreePool(Node->Val);
- }
- FreePool(Node);
- }
-}
-
-/**
- Creates a list of all Shell-Guid-based environment variables.
-
- @param[in, out] ListHead The pointer to pointer to LIST ENTRY object for
- storing this list.
-
- @retval EFI_SUCCESS the list was created sucessfully.
-**/
-EFI_STATUS
-EFIAPI
-GetEnvironmentVariableList(
- IN OUT LIST_ENTRY *ListHead
- )
-{
- CHAR16 *VariableName;
- UINTN NameSize;
- UINT64 MaxStorSize;
- UINT64 RemStorSize;
- UINT64 MaxVarSize;
- EFI_STATUS Status;
- EFI_GUID Guid;
- UINTN ValSize;
- ENV_VAR_LIST *VarList;
-
- if (ListHead == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- if (gRT->Hdr.Revision >= EFI_2_00_SYSTEM_TABLE_REVISION) {
- Status = gRT->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS, &MaxStorSize, &RemStorSize, &MaxVarSize);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
- } else {
- Status = EFI_SUCCESS;
- MaxVarSize = 16384;
- }
-
- NameSize = (UINTN)MaxVarSize;
- VariableName = AllocateZeroPool(NameSize);
- if (VariableName == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- StrCpy(VariableName, L"");
-
- while (!EFI_ERROR(Status)) {
- NameSize = (UINTN)MaxVarSize;
- Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid);
- if (Status == EFI_NOT_FOUND){
- Status = EFI_SUCCESS;
- break;
- }
- if (!EFI_ERROR(Status) && CompareGuid(&Guid, &gShellVariableGuid)){
- VarList = AllocateZeroPool(sizeof(ENV_VAR_LIST));
- if (VarList == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- ValSize = 0;
- Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(VariableName, &VarList->Atts, &ValSize, VarList->Val);
- if (Status == EFI_BUFFER_TOO_SMALL){
- VarList->Val = AllocateZeroPool(ValSize);
- if (VarList->Val == NULL) {
- SHELL_FREE_NON_NULL(VarList);
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(VariableName, &VarList->Atts, &ValSize, VarList->Val);
- }
- }
- if (!EFI_ERROR(Status) && VarList != NULL) {
- VarList->Key = AllocateZeroPool(StrSize(VariableName));
- if (VarList->Key == NULL) {
- SHELL_FREE_NON_NULL(VarList->Val);
- SHELL_FREE_NON_NULL(VarList);
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- StrCpy(VarList->Key, VariableName);
- InsertTailList(ListHead, &VarList->Link);
- }
- }
- }
- } // compare guid
- } // while
- FreePool(VariableName);
-
- if (EFI_ERROR(Status)) {
- FreeEnvironmentVariableList(ListHead);
- }
-
- return (Status);
-}
-
-/**
- Sets a list of all Shell-Guid-based environment variables. this will
- also eliminate all existing shell environment variables (even if they
- are not on the list).
-
- This function will also deallocate the memory from List.
-
- @param[in] ListHead The pointer to LIST_ENTRY from
- GetShellEnvVarList().
-
- @retval EFI_SUCCESS the list was Set sucessfully.
-**/
-EFI_STATUS
-EFIAPI
-SetEnvironmentVariableList(
- IN LIST_ENTRY *ListHead
- )
-{
- ENV_VAR_LIST VarList;
- ENV_VAR_LIST *Node;
- EFI_STATUS Status;
- UINTN Size;
-
- InitializeListHead(&VarList.Link);
-
- //
- // Delete all the current environment variables
- //
- Status = GetEnvironmentVariableList(&VarList.Link);
- ASSERT_EFI_ERROR(Status);
-
- for ( Node = (ENV_VAR_LIST*)GetFirstNode(&VarList.Link)
- ; !IsNull(&VarList.Link, &Node->Link)
- ; Node = (ENV_VAR_LIST*)GetNextNode(&VarList.Link, &Node->Link)
- ){
- if (Node->Key != NULL) {
- Status = SHELL_DELETE_ENVIRONMENT_VARIABLE(Node->Key);
- }
- ASSERT_EFI_ERROR(Status);
- }
-
- FreeEnvironmentVariableList(&VarList.Link);
-
- //
- // set all the variables fron the list
- //
- for ( Node = (ENV_VAR_LIST*)GetFirstNode(ListHead)
- ; !IsNull(ListHead, &Node->Link)
- ; Node = (ENV_VAR_LIST*)GetNextNode(ListHead, &Node->Link)
- ){
- Size = StrSize(Node->Val);
- if (Node->Atts & EFI_VARIABLE_NON_VOLATILE) {
- Status = SHELL_SET_ENVIRONMENT_VARIABLE_NV(Node->Key, Size, Node->Val);
- } else {
- Status = SHELL_SET_ENVIRONMENT_VARIABLE_V (Node->Key, Size, Node->Val);
- }
- ASSERT_EFI_ERROR(Status);
- }
- FreeEnvironmentVariableList(ListHead);
-
- return (Status);
-}
-
-/**
- sets a list of all Shell-Guid-based environment variables.
-
- @param Environment Points to a NULL-terminated array of environment
- variables with the format 'x=y', where x is the
- environment variable name and y is the value.
-
- @retval EFI_SUCCESS The command executed successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_OUT_OF_RESOURCES Out of resources.
-
- @sa SetEnvironmentVariableList
-**/
-EFI_STATUS
-EFIAPI
-SetEnvironmentVariables(
- IN CONST CHAR16 **Environment
- )
-{
- CONST CHAR16 *CurrentString;
- UINTN CurrentCount;
- ENV_VAR_LIST *VarList;
- ENV_VAR_LIST *Node;
- UINTN NewSize;
-
- VarList = NULL;
-
- if (Environment == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // Build a list identical to the ones used for get/set list functions above
- //
- for ( CurrentCount = 0
- ;
- ; CurrentCount++
- ){
- CurrentString = Environment[CurrentCount];
- if (CurrentString == NULL) {
- break;
- }
- ASSERT(StrStr(CurrentString, L"=") != NULL);
- Node = AllocateZeroPool(sizeof(ENV_VAR_LIST));
- ASSERT(Node != NULL);
- Node->Key = AllocateZeroPool((StrStr(CurrentString, L"=") - CurrentString + 1) * sizeof(CHAR16));
- ASSERT(Node->Key != NULL);
- StrnCpy(Node->Key, CurrentString, StrStr(CurrentString, L"=") - CurrentString);
- NewSize = StrSize(CurrentString);
- NewSize -= StrLen(Node->Key) - 1;
- Node->Val = AllocateZeroPool(NewSize);
- ASSERT(Node->Val != NULL);
- StrCpy(Node->Val, CurrentString + StrLen(Node->Key) + 1);
- Node->Atts = EFI_VARIABLE_BOOTSERVICE_ACCESS;
-
- if (VarList == NULL) {
- VarList = AllocateZeroPool(sizeof(ENV_VAR_LIST));
- ASSERT(VarList != NULL);
- InitializeListHead(&VarList->Link);
- }
- InsertTailList(&VarList->Link, &Node->Link);
-
- } // for loop
-
- //
- // set this new list as the set of all environment variables.
- // this function also frees the memory and deletes all pre-existing
- // shell-guid based environment variables.
- //
- return (SetEnvironmentVariableList(&VarList->Link));
-}
diff --git a/ShellPkg/Application/Shell/ShellEnvVar.h b/ShellPkg/Application/Shell/ShellEnvVar.h
deleted file mode 100644
index ab3d9166db..0000000000
--- a/ShellPkg/Application/Shell/ShellEnvVar.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/** @file
- function definitions for shell environment functions.
-
- the following includes are required:
-//#include <Guid/ShellVariableGuid.h>
-//#include <Library/UefiRuntimeServicesTableLib.h>
-
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_ENVIRONMENT_VARIABLE_HEADER_
-#define _SHELL_ENVIRONMENT_VARIABLE_HEADER_
-
-typedef struct {
- LIST_ENTRY Link;
- CHAR16 *Key;
- CHAR16 *Val;
- UINT32 Atts;
-} ENV_VAR_LIST;
-
-/**
- Reports whether an environment variable is Volatile or Non-Volatile
-
- This will use the Runtime Services call GetVariable to to search for the variable.
-
- @param EnvVarName The name of the environment variable in question
-
- @retval TRUE This environment variable is Volatile
- @retval FALSE This environment variable is NON-Volatile
-**/
-BOOLEAN
-EFIAPI
-IsVolatileEnv (
- IN CONST CHAR16 *EnvVarName
- );
-
-/**
- Delete a Non-Violatile environment variable.
-
- This will use the Runtime Services call SetVariable to remove a non-violatile variable.
-
- @param EnvVarName The name of the environment variable in question
-
- @retval EFI_SUCCESS The variable was deleted sucessfully
- @retval other An error ocurred
- @sa SetVariable
-**/
-#define SHELL_DELETE_ENVIRONMENT_VARIABLE(EnvVarName) \
- (gRT->SetVariable((CHAR16*)EnvVarName, \
- &gShellVariableGuid, \
- 0, \
- 0, \
- NULL))
-
-/**
- Set a Non-Violatile environment variable.
-
- This will use the Runtime Services call SetVariable to set a non-violatile variable.
-
- @param EnvVarName The name of the environment variable in question
- @param BufferSize UINTN size of Buffer
- @param Buffer Pointer to value to set variable to
-
- @retval EFI_SUCCESS The variable was changed sucessfully
- @retval other An error ocurred
- @sa SetVariable
-**/
-#define SHELL_SET_ENVIRONMENT_VARIABLE_NV(EnvVarName,BufferSize,Buffer) \
- (gRT->SetVariable((CHAR16*)EnvVarName, \
- &gShellVariableGuid, \
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS, \
- BufferSize, \
- (VOID*)Buffer))
-
-/**
- Get an environment variable.
-
- This will use the Runtime Services call GetVariable to get a variable.
-
- @param EnvVarName The name of the environment variable in question
- @param BufferSize Pointer to the UINTN size of Buffer
- @param Buffer Pointer buffer to get variable value into
-
- @retval EFI_SUCCESS The variable's value was retrieved sucessfully
- @retval other An error ocurred
- @sa SetVariable
-**/
-#define SHELL_GET_ENVIRONMENT_VARIABLE(EnvVarName,BufferSize,Buffer) \
- (gRT->GetVariable((CHAR16*)EnvVarName, \
- &gShellVariableGuid, \
- 0, \
- BufferSize, \
- Buffer))
-
-/**
- Get an environment variable.
-
- This will use the Runtime Services call GetVariable to get a variable.
-
- @param EnvVarName The name of the environment variable in question
- @param Atts Pointer to the UINT32 for attributes (or NULL)
- @param BufferSize Pointer to the UINTN size of Buffer
- @param Buffer Pointer buffer to get variable value into
-
- @retval EFI_SUCCESS The variable's value was retrieved sucessfully
- @retval other An error ocurred
- @sa SetVariable
-**/
-#define SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(EnvVarName,Atts,BufferSize,Buffer) \
- (gRT->GetVariable((CHAR16*)EnvVarName, \
- &gShellVariableGuid, \
- Atts, \
- BufferSize, \
- Buffer))
-
-/**
- Set a Violatile environment variable.
-
- This will use the Runtime Services call SetVariable to set a violatile variable.
-
- @param EnvVarName The name of the environment variable in question
- @param BufferSize UINTN size of Buffer
- @param Buffer Pointer to value to set variable to
-
- @retval EFI_SUCCESS The variable was changed sucessfully
- @retval other An error ocurred
- @sa SetVariable
-**/
-#define SHELL_SET_ENVIRONMENT_VARIABLE_V(EnvVarName,BufferSize,Buffer) \
- (gRT->SetVariable((CHAR16*)EnvVarName, \
- &gShellVariableGuid, \
- EFI_VARIABLE_BOOTSERVICE_ACCESS, \
- BufferSize, \
- (VOID*)Buffer))
-
-/**
- Creates a list of all Shell-Guid-based environment variables.
-
- @param[in, out] List The pointer to pointer to LIST_ENTRY object for
- storing this list.
-
- @retval EFI_SUCCESS the list was created sucessfully.
-**/
-EFI_STATUS
-EFIAPI
-GetEnvironmentVariableList(
- IN OUT LIST_ENTRY *List
- );
-
-/**
- Sets a list of all Shell-Guid-based environment variables. this will
- also eliminate all pre-existing shell environment variables (even if they
- are not on the list).
-
- This function will also deallocate the memory from List.
-
- @param[in] List The pointer to LIST_ENTRY from
- GetShellEnvVarList().
-
- @retval EFI_SUCCESS The list was Set sucessfully.
-**/
-EFI_STATUS
-EFIAPI
-SetEnvironmentVariableList(
- IN LIST_ENTRY *List
- );
-
-/**
- sets all Shell-Guid-based environment variables. this will
- also eliminate all pre-existing shell environment variables (even if they
- are not on the list).
-
- @param[in] Environment Points to a NULL-terminated array of environment
- variables with the format 'x=y', where x is the
- environment variable name and y is the value.
-
- @retval EFI_SUCCESS The command executed successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_OUT_OF_RESOURCES Out of resources.
-
- @sa SetEnvironmentVariableList
-**/
-EFI_STATUS
-EFIAPI
-SetEnvironmentVariables(
- IN CONST CHAR16 **Environment
- );
-
-/**
- free function for ENV_VAR_LIST objects.
-
- @param[in] List The pointer to pointer to list.
-**/
-VOID
-EFIAPI
-FreeEnvironmentVariableList(
- IN LIST_ENTRY *List
- );
-
-#endif //_SHELL_ENVIRONMENT_VARIABLE_HEADER_
-
diff --git a/ShellPkg/Application/Shell/ShellManParser.c b/ShellPkg/Application/Shell/ShellManParser.c
deleted file mode 100644
index 470f51a8ea..0000000000
--- a/ShellPkg/Application/Shell/ShellManParser.c
+++ /dev/null
@@ -1,644 +0,0 @@
-/** @file
- Provides interface to shell MAN file parser.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "Shell.h"
-
-/**
- Verifies that the filename has .MAN on the end.
-
- allocates a new buffer and copies the name (appending .MAN if necessary)
-
- ASSERT if ManFileName is NULL
-
- @param[in] ManFileName original filename
-
- @return the new filename with .man as the extension.
-**/
-CHAR16 *
-EFIAPI
-GetManFileName(
- IN CONST CHAR16 *ManFileName
- )
-{
- CHAR16 *Buffer;
- if (ManFileName == NULL) {
- return (NULL);
- }
- //
- // Fix the file name
- //
- if (StrnCmp(ManFileName+StrLen(ManFileName)-4, L".man", 4)==0) {
- Buffer = AllocateZeroPool(StrSize(ManFileName));
- if (Buffer != NULL) {
- StrCpy(Buffer, ManFileName);
- }
- } else {
- Buffer = AllocateZeroPool(StrSize(ManFileName) + 4*sizeof(CHAR16));
- if (Buffer != NULL) {
- StrCpy(Buffer, ManFileName);
- StrCat(Buffer, L".man");
- }
- }
- return (Buffer);
-}
-
-/**
- Search the path environment variable for possible locations and test for
- which one contains a man file with the name specified. If a valid file is found
- stop searching and return the (opened) SHELL_FILE_HANDLE for that file.
-
- @param[in] FileName Name of the file to find and open.
- @param[out] Handle Pointer to the handle of the found file. The
- value of this is undefined for return values
- except EFI_SUCCESS.
-
- @retval EFI_SUCCESS The file was found. Handle is a valid SHELL_FILE_HANDLE
- @retval EFI_INVALID_PARAMETER A parameter had an invalid value.
- @retval EFI_NOT_FOUND The file was not found.
-**/
-EFI_STATUS
-EFIAPI
-SearchPathForFile(
- IN CONST CHAR16 *FileName,
- OUT SHELL_FILE_HANDLE *Handle
- )
-{
- CHAR16 *FullFileName;
- EFI_STATUS Status;
-
- if ( FileName == NULL
- || Handle == NULL
- || StrLen(FileName) == 0
- ){
- return (EFI_INVALID_PARAMETER);
- }
-
- FullFileName = ShellFindFilePath(FileName);
- if (FullFileName == NULL) {
- return (EFI_NOT_FOUND);
- }
-
- //
- // now open that file
- //
- Status = EfiShellOpenFileByName(FullFileName, Handle, EFI_FILE_MODE_READ);
- FreePool(FullFileName);
-
- return (Status);
-}
-
-/**
- parses through Buffer (which is MAN file formatted) and returns the
- detailed help for any sub section specified in the comma seperated list of
- sections provided. If the end of the file or a .TH section is found then
- return.
-
- Upon a sucessful return the caller is responsible to free the memory in *HelpText
-
- @param[in] Buffer Buffer to read from
- @param[in] Sections name of command's sub sections to find
- @param[in] HelpText pointer to pointer to string where text goes.
- @param[in] HelpSize pointer to size of allocated HelpText (may be updated)
-
- @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
- @retval EFI_SUCCESS the section was found and its description sotred in
- an alloceted buffer.
-**/
-EFI_STATUS
-EFIAPI
-ManBufferFindSections(
- IN CONST CHAR16 *Buffer,
- IN CONST CHAR16 *Sections,
- IN CHAR16 **HelpText,
- IN UINTN *HelpSize
- )
-{
- EFI_STATUS Status;
- CONST CHAR16 *CurrentLocation;
- BOOLEAN CurrentlyReading;
- CHAR16 *SectionName;
- UINTN SectionLen;
- BOOLEAN Found;
- CHAR16 *TempString;
- CHAR16 *TempString2;
-
- if ( Buffer == NULL
- || HelpText == NULL
- || HelpSize == NULL
- ){
- return (EFI_INVALID_PARAMETER);
- }
-
- Status = EFI_SUCCESS;
- CurrentlyReading = FALSE;
- Found = FALSE;
-
- for (CurrentLocation = Buffer,TempString = NULL
- ; CurrentLocation != NULL && *CurrentLocation != CHAR_NULL
- ; CurrentLocation=StrStr(CurrentLocation, L"\r\n"),TempString = NULL
- ){
- while(CurrentLocation[0] == L'\r' || CurrentLocation[0] == L'\n') {
- CurrentLocation++;
- }
- if (CurrentLocation[0] == L'#') {
- //
- // Skip comment lines
- //
- continue;
- }
- if (StrnCmp(CurrentLocation, L".TH", 3) == 0) {
- //
- // we hit the end of this commands section so stop.
- //
- break;
- }
- if (StrnCmp(CurrentLocation, L".SH ", 4) == 0) {
- if (Sections == NULL) {
- CurrentlyReading = TRUE;
- continue;
- } else if (CurrentlyReading) {
- CurrentlyReading = FALSE;
- }
- CurrentLocation += 4;
- //
- // is this a section we want to read in?
- //
- if (StrLen(CurrentLocation)!=0) {
- TempString2 = StrStr(CurrentLocation, L" ");
- TempString2 = MIN(TempString2, StrStr(CurrentLocation, L"\r"));
- TempString2 = MIN(TempString2, StrStr(CurrentLocation, L"\n"));
- ASSERT(TempString == NULL);
- TempString = StrnCatGrow(&TempString, NULL, CurrentLocation, TempString2==NULL?0:TempString2 - CurrentLocation);
- if (TempString == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- break;
- }
- SectionName = TempString;
- SectionLen = StrLen(SectionName);
- SectionName = StrStr(Sections, SectionName);
- if (SectionName == NULL) {
- continue;
- }
- if (*(SectionName + SectionLen) == CHAR_NULL || *(SectionName + SectionLen) == L',') {
- CurrentlyReading = TRUE;
- }
- }
- } else if (CurrentlyReading) {
- Found = TRUE;
- if (StrLen(CurrentLocation)!=0) {
- TempString2 = StrStr(CurrentLocation, L"\r");
- TempString2 = MIN(TempString2, StrStr(CurrentLocation, L"\n"));
- ASSERT(TempString == NULL);
- TempString = StrnCatGrow(&TempString, NULL, CurrentLocation, TempString2==NULL?0:TempString2 - CurrentLocation);
- if (TempString == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- break;
- }
- //
- // copy and save the current line.
- //
- ASSERT((*HelpText == NULL && *HelpSize == 0) || (*HelpText != NULL));
- StrnCatGrow (HelpText, HelpSize, TempString, 0);
- if (HelpText == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- break;
- }
- StrnCatGrow (HelpText, HelpSize, L"\r\n", 0);
- if (HelpText == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- break;
- }
- }
- }
- SHELL_FREE_NON_NULL(TempString);
- }
- if (!Found && !EFI_ERROR(Status)) {
- return (EFI_NOT_FOUND);
- }
- return (Status);
-}
-
-/**
- parses through the MAN file specified by SHELL_FILE_HANDLE and returns the
- detailed help for any sub section specified in the comma seperated list of
- sections provided. If the end of the file or a .TH section is found then
- return.
-
- Upon a sucessful return the caller is responsible to free the memory in *HelpText
-
- @param[in] Handle FileHandle to read from
- @param[in] Sections name of command's sub sections to find
- @param[out] HelpText pointer to pointer to string where text goes.
- @param[out] HelpSize pointer to size of allocated HelpText (may be updated)
- @param[in] Ascii TRUE if the file is ASCII, FALSE otherwise.
-
- @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
- @retval EFI_SUCCESS the section was found and its description sotred in
- an alloceted buffer.
-**/
-EFI_STATUS
-EFIAPI
-ManFileFindSections(
- IN SHELL_FILE_HANDLE Handle,
- IN CONST CHAR16 *Sections,
- OUT CHAR16 **HelpText,
- OUT UINTN *HelpSize,
- IN BOOLEAN Ascii
- )
-{
- EFI_STATUS Status;
- CHAR16 *ReadLine;
- UINTN Size;
- BOOLEAN CurrentlyReading;
- CHAR16 *SectionName;
- UINTN SectionLen;
- BOOLEAN Found;
-
- if ( Handle == NULL
- || HelpText == NULL
- || HelpSize == NULL
- ){
- return (EFI_INVALID_PARAMETER);
- }
-
- Status = EFI_SUCCESS;
- CurrentlyReading = FALSE;
- Size = 1024;
- Found = FALSE;
-
- ReadLine = AllocateZeroPool(Size);
- if (ReadLine == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- for (;!ShellFileHandleEof(Handle);Size = 1024) {
- Status = ShellFileHandleReadLine(Handle, ReadLine, &Size, TRUE, &Ascii);
- if (ReadLine[0] == L'#') {
- //
- // Skip comment lines
- //
- continue;
- }
- //
- // ignore too small of buffer...
- //
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Status = EFI_SUCCESS;
- }
- if (EFI_ERROR(Status)) {
- break;
- } else if (StrnCmp(ReadLine, L".TH", 3) == 0) {
- //
- // we hit the end of this commands section so stop.
- //
- break;
- } else if (StrnCmp(ReadLine, L".SH", 3) == 0) {
- if (Sections == NULL) {
- CurrentlyReading = TRUE;
- continue;
- }
- //
- // we found a section
- //
- if (CurrentlyReading) {
- CurrentlyReading = FALSE;
- }
- //
- // is this a section we want to read in?
- //
- for ( SectionName = ReadLine + 3
- ; *SectionName == L' '
- ; SectionName++);
- SectionLen = StrLen(SectionName);
- SectionName = StrStr(Sections, SectionName);
- if (SectionName == NULL) {
- continue;
- }
- if (*(SectionName + SectionLen) == CHAR_NULL || *(SectionName + SectionLen) == L',') {
- CurrentlyReading = TRUE;
- }
- } else if (CurrentlyReading) {
- Found = TRUE;
- //
- // copy and save the current line.
- //
- ASSERT((*HelpText == NULL && *HelpSize == 0) || (*HelpText != NULL));
- StrnCatGrow (HelpText, HelpSize, ReadLine, 0);
- StrnCatGrow (HelpText, HelpSize, L"\r\n", 0);
- }
- }
- FreePool(ReadLine);
- if (!Found && !EFI_ERROR(Status)) {
- return (EFI_NOT_FOUND);
- }
- return (Status);
-}
-
-/**
- parses through the MAN file formatted Buffer and returns the
- "Brief Description" for the .TH section as specified by Command. If the
- command section is not found return EFI_NOT_FOUND.
-
- Upon a sucessful return the caller is responsible to free the memory in *BriefDesc
-
- @param[in] Handle Buffer to read from
- @param[in] Command name of command's section to find
- @param[in] BriefDesc pointer to pointer to string where description goes.
- @param[in] BriefSize pointer to size of allocated BriefDesc
-
- @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
- @retval EFI_SUCCESS the section was found and its description sotred in
- an alloceted buffer.
-**/
-EFI_STATUS
-EFIAPI
-ManBufferFindTitleSection(
- IN CHAR16 **Buffer,
- IN CONST CHAR16 *Command,
- IN CHAR16 **BriefDesc,
- IN UINTN *BriefSize
- )
-{
- EFI_STATUS Status;
- CHAR16 *TitleString;
- CHAR16 *TitleEnd;
- CHAR16 *CurrentLocation;
-
- if ( Buffer == NULL
- || Command == NULL
- || (BriefDesc != NULL && BriefSize == NULL)
- ){
- return (EFI_INVALID_PARAMETER);
- }
-
- Status = EFI_SUCCESS;
-
- TitleString = AllocateZeroPool((7*sizeof(CHAR16)) + StrSize(Command));
- if (TitleString == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- StrCpy(TitleString, L".TH ");
- StrCat(TitleString, Command);
- StrCat(TitleString, L" 0 ");
-
- CurrentLocation = StrStr(*Buffer, TitleString);
- if (CurrentLocation == NULL){
- Status = EFI_NOT_FOUND;
- } else {
- //
- // we found it so copy out the rest of the line into BriefDesc
- // After skipping any spaces or zeroes
- //
- for (CurrentLocation += StrLen(TitleString)
- ; *CurrentLocation == L' ' || *CurrentLocation == L'0' || *CurrentLocation == L'1' || *CurrentLocation == L'\"'
- ; CurrentLocation++);
-
- TitleEnd = StrStr(CurrentLocation, L"\"");
- if (TitleEnd == NULL) {
- Status = EFI_DEVICE_ERROR;
- } else {
- if (BriefDesc != NULL) {
- *BriefSize = StrSize(TitleEnd);
- *BriefDesc = AllocateZeroPool(*BriefSize);
- if (*BriefDesc == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- StrnCpy(*BriefDesc, CurrentLocation, TitleEnd-CurrentLocation);
- }
- }
-
- for (CurrentLocation = TitleEnd
- ; *CurrentLocation != L'\n'
- ; CurrentLocation++);
- for (
- ; *CurrentLocation == L' ' || *CurrentLocation == L'\n' || *CurrentLocation == L'\r'
- ; CurrentLocation++);
- *Buffer = CurrentLocation;
- }
- }
-
- FreePool(TitleString);
- return (Status);
-}
-
-/**
- parses through the MAN file specified by SHELL_FILE_HANDLE and returns the
- "Brief Description" for the .TH section as specified by Command. if the
- command section is not found return EFI_NOT_FOUND.
-
- Upon a sucessful return the caller is responsible to free the memory in *BriefDesc
-
- @param[in] Handle FileHandle to read from
- @param[in] Command name of command's section to find
- @param[out] BriefDesc pointer to pointer to string where description goes.
- @param[out] BriefSize pointer to size of allocated BriefDesc
- @param[in, out] Ascii TRUE if the file is ASCII, FALSE otherwise, will be
- set if the file handle is at the 0 position.
-
- @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
- @retval EFI_SUCCESS the section was found and its description sotred in
- an alloceted buffer.
-**/
-EFI_STATUS
-EFIAPI
-ManFileFindTitleSection(
- IN SHELL_FILE_HANDLE Handle,
- IN CONST CHAR16 *Command,
- OUT CHAR16 **BriefDesc OPTIONAL,
- OUT UINTN *BriefSize OPTIONAL,
- IN OUT BOOLEAN *Ascii
- )
-{
- EFI_STATUS Status;
- CHAR16 *TitleString;
- CHAR16 *ReadLine;
- UINTN Size;
- CHAR16 *TitleEnd;
- UINTN TitleLen;
- BOOLEAN Found;
-
- if ( Handle == NULL
- || Command == NULL
- || (BriefDesc != NULL && BriefSize == NULL)
- ){
- return (EFI_INVALID_PARAMETER);
- }
-
- Status = EFI_SUCCESS;
- Size = 1024;
- Found = FALSE;
-
- ReadLine = AllocateZeroPool(Size);
- if (ReadLine == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- TitleString = AllocateZeroPool((4*sizeof(CHAR16)) + StrSize(Command));
- if (TitleString == NULL) {
- FreePool(ReadLine);
- return (EFI_OUT_OF_RESOURCES);
- }
- StrCpy(TitleString, L".TH ");
- StrCat(TitleString, Command);
- TitleLen = StrLen(TitleString);
- for (;!ShellFileHandleEof(Handle);Size = 1024) {
- Status = ShellFileHandleReadLine(Handle, ReadLine, &Size, TRUE, Ascii);
- if (ReadLine[0] == L'#') {
- //
- // Skip comment lines
- //
- continue;
- }
- //
- // ignore too small of buffer...
- //
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Status = EFI_SUCCESS;
- }
- if (EFI_ERROR(Status)) {
- break;
- }
- if (StrnCmp(ReadLine, TitleString, TitleLen) == 0) {
- Found = TRUE;
- //
- // we found it so copy out the rest of the line into BriefDesc
- // After skipping any spaces or zeroes
- //
- for ( TitleEnd = ReadLine+TitleLen
- ; *TitleEnd == L' ' || *TitleEnd == L'0' || *TitleEnd == L'1'
- ; TitleEnd++);
- if (BriefDesc != NULL) {
- *BriefSize = StrSize(TitleEnd);
- *BriefDesc = AllocateZeroPool(*BriefSize);
- if (*BriefDesc == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- break;
- }
- StrCpy(*BriefDesc, TitleEnd);
- }
- break;
- }
- }
- FreePool(ReadLine);
- FreePool(TitleString);
- if (!Found && !EFI_ERROR(Status)) {
- return (EFI_NOT_FOUND);
- }
- return (Status);
-}
-
-/**
- This function returns the help information for the specified command. The help text
- will be parsed from a UEFI Shell manual page. (see UEFI Shell 2.0 Appendix B)
-
- If Sections is specified, then each section name listed will be compared in a casesensitive
- manner, to the section names described in Appendix B. If the section exists,
- it will be appended to the returned help text. If the section does not exist, no
- information will be returned. If Sections is NULL, then all help text information
- available will be returned.
-
- if BriefDesc is NULL, then the breif description will not be savedd seperatly,
- but placed first in the main HelpText.
-
- @param[in] ManFileName Points to the NULL-terminated UEFI Shell MAN file name.
- @param[in] Command Points to the NULL-terminated UEFI Shell command name.
- @param[in] Sections Points to the NULL-terminated comma-delimited
- section names to return. If NULL, then all
- sections will be returned.
- @param[out] BriefDesc On return, points to a callee-allocated buffer
- containing brief description text.
- @param[out] HelpText On return, points to a callee-allocated buffer
- containing all specified help text.
-
- @retval EFI_SUCCESS The help text was returned.
- @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
- returned help text.
- @retval EFI_INVALID_PARAMETER HelpText is NULL.
- @retval EFI_INVALID_PARAMETER ManFileName is invalid.
- @retval EFI_NOT_FOUND There is no help text available for Command.
-**/
-EFI_STATUS
-EFIAPI
-ProcessManFile(
- IN CONST CHAR16 *ManFileName,
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Sections OPTIONAL,
- OUT CHAR16 **BriefDesc OPTIONAL,
- OUT CHAR16 **HelpText
- )
-{
- CHAR16 *TempString;
- SHELL_FILE_HANDLE FileHandle;
- EFI_STATUS Status;
- UINTN HelpSize;
- UINTN BriefSize;
- BOOLEAN Ascii;
- CHAR16 *TempString2;
- EFI_DEVICE_PATH_PROTOCOL *FileDevPath;
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
-
- if ( ManFileName == NULL
- || Command == NULL
- || HelpText == NULL
- ){
- return (EFI_INVALID_PARAMETER);
- }
-
- HelpSize = 0;
- BriefSize = 0;
- TempString = NULL;
- //
- // See if it's in HII first
- //
- TempString = ShellCommandGetCommandHelp(Command);
- if (TempString != NULL) {
- TempString2 = TempString;
- Status = ManBufferFindTitleSection(&TempString2, Command, BriefDesc, &BriefSize);
- if (!EFI_ERROR(Status) && HelpText != NULL){
- Status = ManBufferFindSections(TempString2, Sections, HelpText, &HelpSize);
- }
- } else {
- FileHandle = NULL;
- TempString = GetManFileName(ManFileName);
- if (TempString == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- Status = SearchPathForFile(TempString, &FileHandle);
- if (EFI_ERROR(Status)) {
- FileDevPath = FileDevicePath(NULL, TempString);
- DevPath = AppendDevicePath (ShellInfoObject.ImageDevPath, FileDevPath);
- Status = InternalOpenFileDevicePath(DevPath, &FileHandle, EFI_FILE_MODE_READ, 0);
- FreePool(FileDevPath);
- FreePool(DevPath);
- }
-
- if (!EFI_ERROR(Status)) {
- HelpSize = 0;
- BriefSize = 0;
- Status = ManFileFindTitleSection(FileHandle, Command, BriefDesc, &BriefSize, &Ascii);
- if (!EFI_ERROR(Status) && HelpText != NULL){
- Status = ManFileFindSections(FileHandle, Sections, HelpText, &HelpSize, Ascii);
- }
- ShellInfoObject.NewEfiShellProtocol->CloseFile(FileHandle);
- } else {
- *HelpText = NULL;
- }
- }
- if (TempString != NULL) {
- FreePool(TempString);
- }
-
- return (Status);
-}
diff --git a/ShellPkg/Application/Shell/ShellManParser.h b/ShellPkg/Application/Shell/ShellManParser.h
deleted file mode 100644
index 3807eec9b2..0000000000
--- a/ShellPkg/Application/Shell/ShellManParser.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/** @file
- Provides interface to shell MAN file parser.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_MAN_FILE_PARSER_HEADER_
-#define _SHELL_MAN_FILE_PARSER_HEADER_
-
-/**
- This function returns the help information for the specified command. The help text
- will be parsed from a UEFI Shell manual page. (see UEFI Shell 2.0 Appendix B)
-
- If Sections is specified, then each section name listed will be compared in a casesensitive
- manner, to the section names described in Appendix B. If the section exists,
- it will be appended to the returned help text. If the section does not exist, no
- information will be returned. If Sections is NULL, then all help text information
- available will be returned.
-
- if BriefDesc is NULL, then the breif description will not be savedd seperatly,
- but placed first in the main HelpText.
-
- @param[in] ManFileName Points to the NULL-terminated UEFI Shell MAN file name.
- @param[in] Command Points to the NULL-terminated UEFI Shell command name.
- @param[in] Sections Points to the NULL-terminated comma-delimited
- section names to return. If NULL, then all
- sections will be returned.
- @param[out] BriefDesc On return, points to a callee-allocated buffer
- containing brief description text.
- @param[out] HelpText On return, points to a callee-allocated buffer
- containing all specified help text.
-
- @retval EFI_SUCCESS The help text was returned.
- @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
- returned help text.
- @retval EFI_INVALID_PARAMETER HelpText is NULL
- @retval EFI_NOT_FOUND There is no help text available for Command.
-**/
-EFI_STATUS
-EFIAPI
-ProcessManFile(
- IN CONST CHAR16 *ManFileName,
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Sections OPTIONAL,
- OUT CHAR16 **BriefDesc,
- OUT CHAR16 **HelpText
- );
-
-/**
- parses through the MAN file specified by SHELL_FILE_HANDLE and returns the
- detailed help for any sub section specified in the comma seperated list of
- sections provided. If the end of the file or a .TH section is found then
- return.
-
- Upon a sucessful return the caller is responsible to free the memory in *HelpText
-
- @param[in] Handle FileHandle to read from
- @param[in] Sections name of command's sub sections to find
- @param[out] HelpText pointer to pointer to string where text goes.
- @param[out] HelpSize pointer to size of allocated HelpText (may be updated)
- @param[in] Ascii TRUE if the file is ASCII, FALSE otherwise.
-
- @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
- @retval EFI_SUCCESS the section was found and its description sotred in
- an alloceted buffer.
-**/
-EFI_STATUS
-EFIAPI
-ManFileFindSections(
- IN SHELL_FILE_HANDLE Handle,
- IN CONST CHAR16 *Sections,
- OUT CHAR16 **HelpText,
- OUT UINTN *HelpSize,
- IN BOOLEAN Ascii
- );
-
-#endif //_SHELL_MAN_FILE_PARSER_HEADER_
-
diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c
deleted file mode 100644
index c8ac00bc81..0000000000
--- a/ShellPkg/Application/Shell/ShellParametersProtocol.c
+++ /dev/null
@@ -1,1284 +0,0 @@
-/** @file
- Member functions of EFI_SHELL_PARAMETERS_PROTOCOL and functions for creation,
- manipulation, and initialization of EFI_SHELL_PARAMETERS_PROTOCOL.
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "ShellParametersProtocol.h"
-#include "ConsoleWrappers.h"
-
-/**
- return the next parameter from a command line string;
-
- This function moves the next parameter from Walker into TempParameter and moves
- Walker up past that parameter for recursive calling. When the final parameter
- is moved *Walker will be set to NULL;
-
- Temp Parameter must be large enough to hold the parameter before calling this
- function.
-
- @param[in, out] Walker pointer to string of command line. Adjusted to
- reminaing command line on return
- @param[in, out] TempParameter pointer to string of command line item extracted.
-
-**/
-VOID
-EFIAPI
-GetNextParameter(
- CHAR16 **Walker,
- CHAR16 **TempParameter
- )
-{
- CHAR16 *NextDelim;
- CHAR16 *TempLoc;
-
- ASSERT(Walker != NULL);
- ASSERT(*Walker != NULL);
- ASSERT(TempParameter != NULL);
- ASSERT(*TempParameter != NULL);
-
- //
- // make sure we dont have any leading spaces
- //
- while ((*Walker)[0] == L' ') {
- (*Walker)++;
- }
-
- //
- // make sure we still have some params now...
- //
- if (StrLen(*Walker) == 0) {
- ASSERT((*Walker)[0] == CHAR_NULL);
- *Walker = NULL;
- return;
- }
-
- //
- // we have a quoted parameter
- // could be the last parameter, but SHOULD have a trailing quote
- //
- if ((*Walker)[0] == L'\"') {
- NextDelim = NULL;
- for (TempLoc = *Walker + 1 ; TempLoc != NULL && *TempLoc != CHAR_NULL ; TempLoc++) {
- if (*TempLoc == L'^' && *(TempLoc+1) == L'\"') {
- TempLoc++;
- } else if (*TempLoc == L'\"') {
- NextDelim = TempLoc;
- break;
- }
- }
-
- if (NextDelim - ((*Walker)+1) == 0) {
- //
- // found ""
- //
- StrCpy(*TempParameter, L"");
- *Walker = NextDelim + 1;
- } else if (NextDelim != NULL) {
- StrnCpy(*TempParameter, (*Walker)+1, NextDelim - ((*Walker)+1));
- *Walker = NextDelim + 1;
- } else {
- //
- // last one... someone forgot the training quote!
- //
- StrCpy(*TempParameter, *Walker);
- *Walker = NULL;
- }
- for (TempLoc = *TempParameter ; TempLoc != NULL && *TempLoc != CHAR_NULL ; TempLoc++) {
- if (*TempLoc == L'^' && *(TempLoc+1) == L'\"') {
- CopyMem(TempLoc, TempLoc+1, StrSize(TempLoc) - sizeof(TempLoc[0]));
- }
- }
- } else {
- //
- // we have a regular parameter (no quote) OR
- // we have the final parameter (no trailing space)
- //
- NextDelim = StrStr((*Walker), L" ");
- if (NextDelim != NULL) {
- StrnCpy(*TempParameter, *Walker, NextDelim - (*Walker));
- (*TempParameter)[NextDelim - (*Walker)] = CHAR_NULL;
- *Walker = NextDelim+1;
- } else {
- //
- // last one.
- //
- StrCpy(*TempParameter, *Walker);
- *Walker = NULL;
- }
- for (NextDelim = *TempParameter ; NextDelim != NULL && *NextDelim != CHAR_NULL ; NextDelim++) {
- if (*NextDelim == L'^' && *(NextDelim+1) == L'^') {
- CopyMem(NextDelim, NextDelim+1, StrSize(NextDelim) - sizeof(NextDelim[0]));
- }
- }
- while ((*TempParameter)[StrLen(*TempParameter)-1] == L' ') {
- (*TempParameter)[StrLen(*TempParameter)-1] = CHAR_NULL;
- }
- while ((*TempParameter)[0] == L' ') {
- CopyMem(*TempParameter, (*TempParameter)+1, StrSize(*TempParameter) - sizeof((*TempParameter)[0]));
- }
- }
- return;
-}
-
-/**
- Function to populate Argc and Argv.
-
- This function parses the CommandLine and divides it into standard C style Argc/Argv
- parameters for inclusion in EFI_SHELL_PARAMETERS_PROTOCOL. this supports space
- delimited and quote surrounded parameter definition.
-
- @param[in] CommandLine String of command line to parse
- @param[in, out] Argv pointer to array of strings; one for each parameter
- @param[in, out] Argc pointer to number of strings in Argv array
-
- @return EFI_SUCCESS the operation was sucessful
- @return EFI_OUT_OF_RESOURCES a memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-ParseCommandLineToArgs(
- IN CONST CHAR16 *CommandLine,
- IN OUT CHAR16 ***Argv,
- IN OUT UINTN *Argc
- )
-{
- UINTN Count;
- CHAR16 *TempParameter;
- CHAR16 *Walker;
- CHAR16 *NewParam;
- UINTN Size;
-
- ASSERT(Argc != NULL);
- ASSERT(Argv != NULL);
-
- if (CommandLine == NULL || StrLen(CommandLine)==0) {
- (*Argc) = 0;
- (*Argv) = NULL;
- return (EFI_SUCCESS);
- }
-
- Size = StrSize(CommandLine);
- TempParameter = AllocateZeroPool(Size);
- if (TempParameter == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- for ( Count = 0
- , Walker = (CHAR16*)CommandLine
- ; Walker != NULL && *Walker != CHAR_NULL
- ; GetNextParameter(&Walker, &TempParameter)
- , Count++
- );
-
-/* Count = 0;
- Walker = (CHAR16*)CommandLine;
- while(Walker != NULL) {
- GetNextParameter(&Walker, &TempParameter);
- Count++;
- }
-*/
- //
- // lets allocate the pointer array
- //
- (*Argv) = AllocateZeroPool((Count)*sizeof(CHAR16*));
- if (*Argv == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- *Argc = 0;
- Walker = (CHAR16*)CommandLine;
- while(Walker != NULL && *Walker != CHAR_NULL) {
- SetMem16(TempParameter, Size, CHAR_NULL);
- GetNextParameter(&Walker, &TempParameter);
- NewParam = AllocateZeroPool(StrSize(TempParameter));
- ASSERT(NewParam != NULL);
- StrCpy(NewParam, TempParameter);
- ((CHAR16**)(*Argv))[(*Argc)] = NewParam;
- (*Argc)++;
- }
- ASSERT(Count >= (*Argc));
- return (EFI_SUCCESS);
-}
-
-/**
- creates a new EFI_SHELL_PARAMETERS_PROTOCOL instance and populates it and then
- installs it on our handle and if there is an existing version of the protocol
- that one is cached for removal later.
-
- @param[in, out] NewShellParameters on a successful return, a pointer to pointer
- to the newly installed interface.
- @param[in, out] RootShellInstance on a successful return, pointer to boolean.
- TRUE if this is the root shell instance.
-
- @retval EFI_SUCCESS the operation completed successfully.
- @return other the operation failed.
- @sa ReinstallProtocolInterface
- @sa InstallProtocolInterface
- @sa ParseCommandLineToArgs
-**/
-EFI_STATUS
-EFIAPI
-CreatePopulateInstallShellParametersProtocol (
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL **NewShellParameters,
- IN OUT BOOLEAN *RootShellInstance
- )
-{
- EFI_STATUS Status;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- CHAR16 *FullCommandLine;
- UINTN Size;
-
- Size = 0;
- FullCommandLine = NULL;
- LoadedImage = NULL;
-
- //
- // Assert for valid parameters
- //
- ASSERT(NewShellParameters != NULL);
- ASSERT(RootShellInstance != NULL);
-
- //
- // See if we have a shell parameters placed on us
- //
- Status = gBS->OpenProtocol (
- gImageHandle,
- &gEfiShellParametersProtocolGuid,
- (VOID **) &ShellInfoObject.OldShellParameters,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- //
- // if we don't then we must be the root shell (error is expected)
- //
- if (EFI_ERROR (Status)) {
- *RootShellInstance = TRUE;
- }
-
- //
- // Allocate the new structure
- //
- *NewShellParameters = AllocateZeroPool(sizeof(EFI_SHELL_PARAMETERS_PROTOCOL));
- if ((*NewShellParameters) == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- //
- // get loaded image protocol
- //
- Status = gBS->OpenProtocol (
- gImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **) &LoadedImage,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- ASSERT_EFI_ERROR(Status);
- //
- // Build the full command line
- //
- Status = SHELL_GET_ENVIRONMENT_VARIABLE(L"ShellOpt", &Size, &FullCommandLine);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- FullCommandLine = AllocateZeroPool(Size + LoadedImage->LoadOptionsSize);
- Status = SHELL_GET_ENVIRONMENT_VARIABLE(L"ShellOpt", &Size, &FullCommandLine);
- }
- if (Status == EFI_NOT_FOUND) {
- //
- // no parameters via environment... ok
- //
- } else {
- if (EFI_ERROR(Status)) {
- return (Status);
- }
- }
- if (Size == 0 && LoadedImage->LoadOptionsSize != 0) {
- ASSERT(FullCommandLine == NULL);
- //
- // Now we need to include a NULL terminator in the size.
- //
- Size = LoadedImage->LoadOptionsSize + sizeof(FullCommandLine[0]);
- FullCommandLine = AllocateZeroPool(Size);
- }
- if (FullCommandLine != NULL) {
- if (LoadedImage->LoadOptionsSize != 0){
- StrCpy(FullCommandLine, LoadedImage->LoadOptions);
- }
- //
- // Populate Argc and Argv
- //
- Status = ParseCommandLineToArgs(FullCommandLine,
- &(*NewShellParameters)->Argv,
- &(*NewShellParameters)->Argc);
-
- FreePool(FullCommandLine);
-
- ASSERT_EFI_ERROR(Status);
- } else {
- (*NewShellParameters)->Argv = NULL;
- (*NewShellParameters)->Argc = 0;
- }
-
- //
- // Populate the 3 faked file systems...
- //
- if (*RootShellInstance) {
- (*NewShellParameters)->StdIn = &FileInterfaceStdIn;
- (*NewShellParameters)->StdOut = &FileInterfaceStdOut;
- (*NewShellParameters)->StdErr = &FileInterfaceStdErr;
- Status = gBS->InstallProtocolInterface(&gImageHandle,
- &gEfiShellParametersProtocolGuid,
- EFI_NATIVE_INTERFACE,
- (VOID*)(*NewShellParameters));
- } else {
- //
- // copy from the existing ones
- //
- (*NewShellParameters)->StdIn = ShellInfoObject.OldShellParameters->StdIn;
- (*NewShellParameters)->StdOut = ShellInfoObject.OldShellParameters->StdOut;
- (*NewShellParameters)->StdErr = ShellInfoObject.OldShellParameters->StdErr;
- Status = gBS->ReinstallProtocolInterface(gImageHandle,
- &gEfiShellParametersProtocolGuid,
- (VOID*)ShellInfoObject.OldShellParameters,
- (VOID*)(*NewShellParameters));
- }
-
- return (Status);
-}
-
-/**
- frees all memory used by createion and installation of shell parameters protocol
- and if there was an old version installed it will restore that one.
-
- @param NewShellParameters the interface of EFI_SHELL_PARAMETERS_PROTOCOL that is
- being cleaned up.
-
- @retval EFI_SUCCESS the cleanup was successful
- @return other the cleanup failed
- @sa ReinstallProtocolInterface
- @sa UninstallProtocolInterface
-**/
-EFI_STATUS
-EFIAPI
-CleanUpShellParametersProtocol (
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *NewShellParameters
- )
-{
- EFI_STATUS Status;
- UINTN LoopCounter;
-
- //
- // If the old exists we need to restore it
- //
- if (ShellInfoObject.OldShellParameters != NULL) {
- Status = gBS->ReinstallProtocolInterface(gImageHandle,
- &gEfiShellParametersProtocolGuid,
- (VOID*)NewShellParameters,
- (VOID*)ShellInfoObject.OldShellParameters);
- DEBUG_CODE(ShellInfoObject.OldShellParameters = NULL;);
- } else {
- //
- // No old one, just uninstall us...
- //
- Status = gBS->UninstallProtocolInterface(gImageHandle,
- &gEfiShellParametersProtocolGuid,
- (VOID*)NewShellParameters);
- }
- if (NewShellParameters->Argv != NULL) {
- for ( LoopCounter = 0
- ; LoopCounter < NewShellParameters->Argc
- ; LoopCounter++
- ){
- FreePool(NewShellParameters->Argv[LoopCounter]);
- }
- FreePool(NewShellParameters->Argv);
- }
- FreePool(NewShellParameters);
- return (Status);
-}
-
-/**
- Determin if a file name represents a unicode file.
-
- @param[in] FileName Pointer to the filename to open.
-
- @retval EFI_SUCCESS The file is a unicode file.
- @return An error upon failure.
-**/
-EFI_STATUS
-EFIAPI
-IsUnicodeFile(
- IN CONST CHAR16 *FileName
- )
-{
- SHELL_FILE_HANDLE Handle;
- EFI_STATUS Status;
- UINT64 OriginalFilePosition;
- UINTN CharSize;
- CHAR16 CharBuffer;
-
- Status = gEfiShellProtocol->OpenFileByName(FileName, &Handle, EFI_FILE_MODE_READ);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
- gEfiShellProtocol->GetFilePosition(Handle, &OriginalFilePosition);
- gEfiShellProtocol->SetFilePosition(Handle, 0);
- CharSize = sizeof(CHAR16);
- Status = gEfiShellProtocol->ReadFile(Handle, &CharSize, &CharBuffer);
- if (EFI_ERROR(Status) || CharBuffer != gUnicodeFileTag) {
- Status = EFI_BUFFER_TOO_SMALL;
- }
- gEfiShellProtocol->SetFilePosition(Handle, OriginalFilePosition);
- gEfiShellProtocol->CloseFile(Handle);
- return (Status);
-}
-
-/**
- Strips out quotes sections of a string.
-
- All of the characters between quotes is replaced with spaces.
-
- @param[in, out] TheString A pointer to the string to update.
-**/
-VOID
-EFIAPI
-StripQuotes (
- IN OUT CHAR16 *TheString
- )
-{
- BOOLEAN RemoveNow;
-
- for (RemoveNow = FALSE ; TheString != NULL && *TheString != CHAR_NULL ; TheString++) {
- if (*TheString == L'^' && *(TheString + 1) == L'\"') {
- TheString++;
- } else if (*TheString == L'\"') {
- RemoveNow = (BOOLEAN)!RemoveNow;
- } else if (RemoveNow) {
- *TheString = L' ';
- }
- }
-}
-
-/**
- Calcualte the 32-bit CRC in a EFI table using the service provided by the
- gRuntime service.
-
- @param Hdr Pointer to an EFI standard header
-
-**/
-VOID
-CalculateEfiHdrCrc (
- IN OUT EFI_TABLE_HEADER *Hdr
- )
-{
- UINT32 Crc;
-
- Hdr->CRC32 = 0;
-
- //
- // If gBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then
- // Crc will come back as zero if we set it to zero here
- //
- Crc = 0;
- gBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc);
- Hdr->CRC32 = Crc;
-}
-
-/**
- Fix a string to only have the file name, removing starting at the first space of whatever is quoted.
-
- @param[in] FileName The filename to start with.
-
- @retval NULL FileName was invalid.
- @return The modified FileName.
-**/
-CHAR16*
-EFIAPI
-FixFileName (
- IN CHAR16 *FileName
- )
-{
- CHAR16 *Copy;
- CHAR16 *TempLocation;
-
- if (FileName == NULL) {
- return (NULL);
- }
-
- if (FileName[0] == L'\"') {
- Copy = FileName+1;
- if ((TempLocation = StrStr(Copy , L"\"")) != NULL) {
- TempLocation[0] = CHAR_NULL;
- }
- } else {
- Copy = FileName;
- while(Copy[0] == L' ') {
- Copy++;
- }
- if ((TempLocation = StrStr(Copy , L" ")) != NULL) {
- TempLocation[0] = CHAR_NULL;
- }
- }
-
- if (Copy[0] == CHAR_NULL) {
- return (NULL);
- }
-
- return (Copy);
-}
-
-/**
- Funcion will replace the current StdIn and StdOut in the ShellParameters protocol
- structure by parsing NewCommandLine. The current values are returned to the
- user.
-
- This will also update the system table.
-
- @param[in, out] ShellParameters Pointer to parameter structure to modify.
- @param[in] NewCommandLine The new command line to parse and use.
- @param[out] OldStdIn Pointer to old StdIn.
- @param[out] OldStdOut Pointer to old StdOut.
- @param[out] OldStdErr Pointer to old StdErr.
- @param[out] SystemTableInfo Pointer to old system table information.
-
- @retval EFI_SUCCESS Operation was sucessful, Argv and Argc are valid.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-UpdateStdInStdOutStdErr(
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
- IN CHAR16 *NewCommandLine,
- OUT SHELL_FILE_HANDLE *OldStdIn,
- OUT SHELL_FILE_HANDLE *OldStdOut,
- OUT SHELL_FILE_HANDLE *OldStdErr,
- OUT SYSTEM_TABLE_INFO *SystemTableInfo
- )
-{
- CHAR16 *CommandLineCopy;
- CHAR16 *CommandLineWalker;
- CHAR16 *StdErrFileName;
- CHAR16 *StdOutFileName;
- CHAR16 *StdInFileName;
- CHAR16 *StdInVarName;
- CHAR16 *StdOutVarName;
- CHAR16 *StdErrVarName;
- EFI_STATUS Status;
- SHELL_FILE_HANDLE TempHandle;
- UINT64 FileSize;
- BOOLEAN OutUnicode;
- BOOLEAN InUnicode;
- BOOLEAN ErrUnicode;
- BOOLEAN OutAppend;
- BOOLEAN ErrAppend;
- UINTN Size;
- CHAR16 TagBuffer[2];
- SPLIT_LIST *Split;
- CHAR16 *FirstLocation;
-
- OutUnicode = TRUE;
- InUnicode = TRUE;
- ErrUnicode = TRUE;
- StdInVarName = NULL;
- StdOutVarName = NULL;
- StdErrVarName = NULL;
- StdErrFileName = NULL;
- StdInFileName = NULL;
- StdOutFileName = NULL;
- ErrAppend = FALSE;
- OutAppend = FALSE;
- CommandLineCopy = NULL;
- FirstLocation = NULL;
-
- if (ShellParameters == NULL || SystemTableInfo == NULL || OldStdIn == NULL || OldStdOut == NULL || OldStdErr == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- SystemTableInfo->ConIn = gST->ConIn;
- SystemTableInfo->ConInHandle = gST->ConsoleInHandle;
- SystemTableInfo->ConOut = gST->ConOut;
- SystemTableInfo->ConOutHandle = gST->ConsoleOutHandle;
- SystemTableInfo->ConErr = gST->StdErr;
- SystemTableInfo->ConErrHandle = gST->StandardErrorHandle;
- *OldStdIn = ShellParameters->StdIn;
- *OldStdOut = ShellParameters->StdOut;
- *OldStdErr = ShellParameters->StdErr;
-
- if (NewCommandLine == NULL) {
- return (EFI_SUCCESS);
- }
-
- CommandLineCopy = StrnCatGrow(&CommandLineCopy, NULL, NewCommandLine, 0);
- if (CommandLineCopy == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- Status = EFI_SUCCESS;
- Split = NULL;
- FirstLocation = CommandLineCopy + StrLen(CommandLineCopy);
-
- StripQuotes(CommandLineCopy);
-
- if (!IsListEmpty(&ShellInfoObject.SplitList.Link)) {
- Split = (SPLIT_LIST*)GetFirstNode(&ShellInfoObject.SplitList.Link);
- if (Split != NULL && Split->SplitStdIn != NULL) {
- ShellParameters->StdIn = Split->SplitStdIn;
- }
- if (Split != NULL && Split->SplitStdOut != NULL) {
- ShellParameters->StdOut = Split->SplitStdOut;
- }
- }
-
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 2>>v ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 12, L' ');
- StdErrVarName = CommandLineWalker += 6;
- ErrAppend = TRUE;
- if (StrStr(CommandLineWalker, L" 2>>v ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 1>>v ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 12, L' ');
- StdOutVarName = CommandLineWalker += 6;
- OutAppend = TRUE;
- if (StrStr(CommandLineWalker, L" 1>>v ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- } else if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >>v ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 10, L' ');
- StdOutVarName = CommandLineWalker += 5;
- OutAppend = TRUE;
- if (StrStr(CommandLineWalker, L" >>v ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- } else if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >v ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 8, L' ');
- StdOutVarName = CommandLineWalker += 4;
- OutAppend = FALSE;
- if (StrStr(CommandLineWalker, L" >v ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 1>>a ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 12, L' ');
- StdOutFileName = CommandLineWalker += 6;
- OutAppend = TRUE;
- OutUnicode = FALSE;
- if (StrStr(CommandLineWalker, L" 1>>a ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 1>> ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 10, L' ');
- if (StdOutFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdOutFileName = CommandLineWalker += 5;
- OutAppend = TRUE;
- }
- if (StrStr(CommandLineWalker, L" 1>> ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >> ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 8, L' ');
- if (StdOutFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdOutFileName = CommandLineWalker += 4;
- OutAppend = TRUE;
- }
- if (StrStr(CommandLineWalker, L" >> ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >>a ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 10, L' ');
- if (StdOutFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdOutFileName = CommandLineWalker += 5;
- OutAppend = TRUE;
- OutUnicode = FALSE;
- }
- if (StrStr(CommandLineWalker, L" >>a ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 1>a ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 10, L' ');
- if (StdOutFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdOutFileName = CommandLineWalker += 5;
- OutAppend = FALSE;
- OutUnicode = FALSE;
- }
- if (StrStr(CommandLineWalker, L" 1>a ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >a ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 8, L' ');
- if (StdOutFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdOutFileName = CommandLineWalker += 4;
- OutAppend = FALSE;
- OutUnicode = FALSE;
- }
- if (StrStr(CommandLineWalker, L" >a ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 2>> ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 10, L' ');
- if (StdErrFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdErrFileName = CommandLineWalker += 5;
- ErrAppend = TRUE;
- }
- if (StrStr(CommandLineWalker, L" 2>> ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
-
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 2>v ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 10, L' ');
- if (StdErrVarName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdErrVarName = CommandLineWalker += 5;
- ErrAppend = FALSE;
- }
- if (StrStr(CommandLineWalker, L" 2>v ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 1>v ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 10, L' ');
- if (StdOutVarName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdOutVarName = CommandLineWalker += 5;
- OutAppend = FALSE;
- }
- if (StrStr(CommandLineWalker, L" 1>v ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 2>a ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 10, L' ');
- if (StdErrFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdErrFileName = CommandLineWalker += 5;
- ErrAppend = FALSE;
- ErrUnicode = FALSE;
- }
- if (StrStr(CommandLineWalker, L" 2>a ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 2> ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 8, L' ');
- if (StdErrFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdErrFileName = CommandLineWalker += 4;
- ErrAppend = FALSE;
- }
- if (StrStr(CommandLineWalker, L" 2> ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
-
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 1> ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 8, L' ');
- if (StdOutFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdOutFileName = CommandLineWalker += 4;
- OutAppend = FALSE;
- }
- if (StrStr(CommandLineWalker, L" 1> ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
-
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" > ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 6, L' ');
- if (StdOutFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdOutFileName = CommandLineWalker += 3;
- OutAppend = FALSE;
- }
- if (StrStr(CommandLineWalker, L" > ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
-
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" < ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 6, L' ');
- if (StdInFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdInFileName = CommandLineWalker += 3;
- }
- if (StrStr(CommandLineWalker, L" < ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" <a ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 8, L' ');
- if (StdInFileName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdInFileName = CommandLineWalker += 4;
- InUnicode = FALSE;
- }
- if (StrStr(CommandLineWalker, L" <a ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
- if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" <v ")) != NULL) {
- FirstLocation = MIN(CommandLineWalker, FirstLocation);
- SetMem16(CommandLineWalker, 8, L' ');
- if (StdInVarName != NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- StdInVarName = CommandLineWalker += 4;
- }
- if (StrStr(CommandLineWalker, L" <v ") != NULL) {
- Status = EFI_NOT_FOUND;
- }
- }
-
- //
- // re-populate the string to support any filenames that were in quotes.
- //
- StrCpy(CommandLineCopy, NewCommandLine);
-
- if (FirstLocation != CommandLineCopy + StrLen(CommandLineCopy)
- && ((UINTN)(FirstLocation - CommandLineCopy) < StrLen(NewCommandLine))
- ){
- *(NewCommandLine + (UINTN)(FirstLocation - CommandLineCopy)) = CHAR_NULL;
- }
-
- if (!EFI_ERROR(Status)) {
-
- if (StdErrFileName != NULL) {
- if ((StdErrFileName = FixFileName(StdErrFileName)) == NULL) {
- Status = EFI_INVALID_PARAMETER;
- }
- }
- if (StdOutFileName != NULL) {
- if ((StdOutFileName = FixFileName(StdOutFileName)) == NULL) {
- Status = EFI_INVALID_PARAMETER;
- }
- }
- if (StdInFileName != NULL) {
- if ((StdInFileName = FixFileName(StdInFileName)) == NULL) {
- Status = EFI_INVALID_PARAMETER;
- }
- }
- if (StdErrVarName != NULL) {
- if ((StdErrVarName = FixFileName(StdErrVarName)) == NULL) {
- Status = EFI_INVALID_PARAMETER;
- }
- }
- if (StdOutVarName != NULL) {
- if ((StdOutVarName = FixFileName(StdOutVarName)) == NULL) {
- Status = EFI_INVALID_PARAMETER;
- }
- }
- if (StdInVarName != NULL) {
- if ((StdInVarName = FixFileName(StdInVarName)) == NULL) {
- Status = EFI_INVALID_PARAMETER;
- }
- }
-
- //
- // Verify not the same and not duplicating something from a split
- //
- if (
- //
- // Check that no 2 filenames are the same
- //
- (StdErrFileName != NULL && StdOutFileName!= NULL && StringNoCaseCompare(&StdErrFileName, &StdOutFileName) == 0)
- ||(StdErrFileName != NULL && StdInFileName != NULL && StringNoCaseCompare(&StdErrFileName, &StdInFileName ) == 0)
- ||(StdOutFileName != NULL && StdInFileName != NULL && StringNoCaseCompare(&StdOutFileName, &StdInFileName ) == 0)
- //
- // Check that no 2 variable names are the same
- //
- ||(StdErrVarName != NULL && StdInVarName != NULL && StringNoCaseCompare(&StdErrVarName , &StdInVarName ) == 0)
- ||(StdOutVarName != NULL && StdInVarName != NULL && StringNoCaseCompare(&StdOutVarName , &StdInVarName ) == 0)
- ||(StdErrVarName != NULL && StdOutVarName != NULL && StringNoCaseCompare(&StdErrVarName , &StdOutVarName ) == 0)
- //
- // When a split (using | operator) is in place some are not allowed
- //
- ||(Split != NULL && Split->SplitStdIn != NULL && (StdInVarName != NULL || StdInFileName != NULL))
- ||(Split != NULL && Split->SplitStdOut != NULL && (StdOutVarName != NULL || StdOutFileName != NULL))
- //
- // Check that nothing is trying to be output to 2 locations.
- //
- ||(StdErrFileName != NULL && StdErrVarName != NULL)
- ||(StdOutFileName != NULL && StdOutVarName != NULL)
- ||(StdInFileName != NULL && StdInVarName != NULL)
- //
- // Check for no volatile environment variables
- //
- ||(StdErrVarName != NULL && !IsVolatileEnv(StdErrVarName))
- ||(StdOutVarName != NULL && !IsVolatileEnv(StdOutVarName))
- //
- // Cant redirect during a reconnect operation.
- //
- ||(StrStr(NewCommandLine, L"connect -r") != NULL
- && (StdOutVarName != NULL || StdOutFileName != NULL || StdErrFileName != NULL || StdErrVarName != NULL))
- //
- // Check that filetypes (Unicode/Ascii) do not change during an append
- //
- ||(StdOutFileName != NULL && OutUnicode && OutAppend && (!EFI_ERROR(ShellFileExists(StdOutFileName)) && EFI_ERROR(IsUnicodeFile(StdOutFileName))))
- ||(StdErrFileName != NULL && ErrUnicode && ErrAppend && (!EFI_ERROR(ShellFileExists(StdErrFileName)) && EFI_ERROR(IsUnicodeFile(StdErrFileName))))
- ||(StdOutFileName != NULL && !OutUnicode && OutAppend && (!EFI_ERROR(ShellFileExists(StdOutFileName)) && !EFI_ERROR(IsUnicodeFile(StdOutFileName))))
- ||(StdErrFileName != NULL && !ErrUnicode && ErrAppend && (!EFI_ERROR(ShellFileExists(StdErrFileName)) && !EFI_ERROR(IsUnicodeFile(StdErrFileName))))
- ){
- Status = EFI_INVALID_PARAMETER;
- ShellParameters->StdIn = *OldStdIn;
- ShellParameters->StdOut = *OldStdOut;
- ShellParameters->StdErr = *OldStdErr;
- } else if (!EFI_ERROR(Status)){
- //
- // Open the Std<Whatever> and we should not have conflicts here...
- //
-
- //
- // StdErr to a file
- //
- if (StdErrFileName != NULL) {
- if (!ErrAppend) {
- //
- // delete existing file.
- //
- ShellInfoObject.NewEfiShellProtocol->DeleteFileByName(StdErrFileName);
- }
- Status = ShellOpenFileByName(StdErrFileName, &TempHandle, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ|EFI_FILE_MODE_CREATE,0);
- if (!ErrAppend && ErrUnicode && !EFI_ERROR(Status)) {
- //
- // Write out the gUnicodeFileTag
- //
- Size = sizeof(CHAR16);
- TagBuffer[0] = gUnicodeFileTag;
- TagBuffer[1] = CHAR_NULL;
- ShellInfoObject.NewEfiShellProtocol->WriteFile(TempHandle, &Size, TagBuffer);
- }
- if (!ErrUnicode && !EFI_ERROR(Status)) {
- TempHandle = CreateFileInterfaceFile(TempHandle, FALSE);
- ASSERT(TempHandle != NULL);
- }
- if (!EFI_ERROR(Status)) {
- ShellParameters->StdErr = TempHandle;
- gST->StdErr = CreateSimpleTextOutOnFile(TempHandle, &gST->StandardErrorHandle);
- }
- }
-
- //
- // StdOut to a file
- //
- if (!EFI_ERROR(Status) && StdOutFileName != NULL) {
- if (!OutAppend) {
- //
- // delete existing file.
- //
- ShellInfoObject.NewEfiShellProtocol->DeleteFileByName(StdOutFileName);
- }
- Status = ShellOpenFileByName(StdOutFileName, &TempHandle, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ|EFI_FILE_MODE_CREATE,0);
- if (TempHandle == NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- if (StrStr(StdOutFileName, L"NUL")==StdOutFileName) {
- //no-op
- } else if (!OutAppend && OutUnicode && !EFI_ERROR(Status)) {
- //
- // Write out the gUnicodeFileTag
- //
- Size = sizeof(CHAR16);
- TagBuffer[0] = gUnicodeFileTag;
- TagBuffer[1] = CHAR_NULL;
- ShellInfoObject.NewEfiShellProtocol->WriteFile(TempHandle, &Size, TagBuffer);
- } else if (OutAppend) {
- //
- // Move to end of file
- //
- Status = ShellInfoObject.NewEfiShellProtocol->GetFileSize(TempHandle, &FileSize);
- if (!EFI_ERROR(Status)) {
- Status = ShellInfoObject.NewEfiShellProtocol->SetFilePosition(TempHandle, FileSize);
- }
- }
- if (!OutUnicode && !EFI_ERROR(Status)) {
- TempHandle = CreateFileInterfaceFile(TempHandle, FALSE);
- ASSERT(TempHandle != NULL);
- }
- if (!EFI_ERROR(Status)) {
- ShellParameters->StdOut = TempHandle;
- gST->ConOut = CreateSimpleTextOutOnFile(TempHandle, &gST->ConsoleOutHandle);
- }
- }
- }
-
- //
- // StdOut to a var
- //
- if (!EFI_ERROR(Status) && StdOutVarName != NULL) {
- if (!OutAppend) {
- //
- // delete existing variable.
- //
- SHELL_SET_ENVIRONMENT_VARIABLE_V(StdOutVarName, 0, L"");
- }
- TempHandle = CreateFileInterfaceEnv(StdOutVarName);
- ASSERT(TempHandle != NULL);
- ShellParameters->StdOut = TempHandle;
- gST->ConOut = CreateSimpleTextOutOnFile(TempHandle, &gST->ConsoleOutHandle);
- }
-
- //
- // StdErr to a var
- //
- if (!EFI_ERROR(Status) && StdErrVarName != NULL) {
- if (!ErrAppend) {
- //
- // delete existing variable.
- //
- SHELL_SET_ENVIRONMENT_VARIABLE_V(StdErrVarName, 0, L"");
- }
- TempHandle = CreateFileInterfaceEnv(StdErrVarName);
- ASSERT(TempHandle != NULL);
- ShellParameters->StdErr = TempHandle;
- gST->StdErr = CreateSimpleTextOutOnFile(TempHandle, &gST->StandardErrorHandle);
- }
-
- //
- // StdIn from a var
- //
- if (!EFI_ERROR(Status) && StdInVarName != NULL) {
- TempHandle = CreateFileInterfaceEnv(StdInVarName);
- if (TempHandle == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- if (!InUnicode) {
- TempHandle = CreateFileInterfaceFile(TempHandle, FALSE);
- }
- Size = 0;
- if (TempHandle == NULL || ((EFI_FILE_PROTOCOL*)TempHandle)->Read(TempHandle, &Size, NULL) != EFI_BUFFER_TOO_SMALL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- ShellParameters->StdIn = TempHandle;
- gST->ConIn = CreateSimpleTextInOnFile(TempHandle, &gST->ConsoleInHandle);
- }
- }
- }
-
- //
- // StdIn from a file
- //
- if (!EFI_ERROR(Status) && StdInFileName != NULL) {
- Status = ShellOpenFileByName(
- StdInFileName,
- &TempHandle,
- EFI_FILE_MODE_READ,
- 0);
- if (!InUnicode && !EFI_ERROR(Status)) {
- TempHandle = CreateFileInterfaceFile(TempHandle, FALSE);
- }
- if (!EFI_ERROR(Status)) {
- ShellParameters->StdIn = TempHandle;
- gST->ConIn = CreateSimpleTextInOnFile(TempHandle, &gST->ConsoleInHandle);
- }
- }
- }
- }
- FreePool(CommandLineCopy);
-
- CalculateEfiHdrCrc(&gST->Hdr);
-
- if (gST->ConIn == NULL ||gST->ConOut == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- return (Status);
-}
-
-/**
- Funcion will replace the current StdIn and StdOut in the ShellParameters protocol
- structure with StdIn and StdOut. The current values are de-allocated.
-
- @param[in, out] ShellParameters Pointer to parameter structure to modify.
- @param[in] OldStdIn Pointer to old StdIn.
- @param[in] OldStdOut Pointer to old StdOut.
- @param[in] OldStdErr Pointer to old StdErr.
- @param[in] SystemTableInfo Pointer to old system table information.
-**/
-EFI_STATUS
-EFIAPI
-RestoreStdInStdOutStdErr (
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
- IN SHELL_FILE_HANDLE *OldStdIn,
- IN SHELL_FILE_HANDLE *OldStdOut,
- IN SHELL_FILE_HANDLE *OldStdErr,
- IN SYSTEM_TABLE_INFO *SystemTableInfo
- )
-{
- SPLIT_LIST *Split;
-
- if (ShellParameters == NULL
- ||OldStdIn == NULL
- ||OldStdOut == NULL
- ||OldStdErr == NULL
- ||SystemTableInfo == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- if (!IsListEmpty(&ShellInfoObject.SplitList.Link)) {
- Split = (SPLIT_LIST*)GetFirstNode(&ShellInfoObject.SplitList.Link);
- } else {
- Split = NULL;
- }
- if (ShellParameters->StdIn != *OldStdIn) {
- if ((Split != NULL && Split->SplitStdIn != ShellParameters->StdIn) || Split == NULL) {
- gEfiShellProtocol->CloseFile(ShellParameters->StdIn);
- }
- ShellParameters->StdIn = *OldStdIn;
- }
- if (ShellParameters->StdOut != *OldStdOut) {
- if ((Split != NULL && Split->SplitStdOut != ShellParameters->StdOut) || Split == NULL) {
- gEfiShellProtocol->CloseFile(ShellParameters->StdOut);
- }
- ShellParameters->StdOut = *OldStdOut;
- }
- if (ShellParameters->StdErr != *OldStdErr) {
- gEfiShellProtocol->CloseFile(ShellParameters->StdErr);
- ShellParameters->StdErr = *OldStdErr;
- }
-
- if (gST->ConIn != SystemTableInfo->ConIn) {
- CloseSimpleTextInOnFile(gST->ConIn);
- gST->ConIn = SystemTableInfo->ConIn;
- gST->ConsoleInHandle = SystemTableInfo->ConInHandle;
- }
- if (gST->ConOut != SystemTableInfo->ConOut) {
- CloseSimpleTextOutOnFile(gST->ConOut);
- gST->ConOut = SystemTableInfo->ConOut;
- gST->ConsoleOutHandle = SystemTableInfo->ConOutHandle;
- }
- if (gST->StdErr != SystemTableInfo->ConErr) {
- CloseSimpleTextOutOnFile(gST->StdErr);
- gST->StdErr = SystemTableInfo->ConErr;
- gST->StandardErrorHandle = SystemTableInfo->ConErrHandle;
- }
-
- CalculateEfiHdrCrc(&gST->Hdr);
-
- return (EFI_SUCCESS);
-}
-/**
- Funcion will replace the current Argc and Argv in the ShellParameters protocol
- structure by parsing NewCommandLine. The current values are returned to the
- user.
-
- If OldArgv or OldArgc is NULL then that value is not returned.
-
- @param[in, out] ShellParameters Pointer to parameter structure to modify.
- @param[in] NewCommandLine The new command line to parse and use.
- @param[out] OldArgv Pointer to old list of parameters.
- @param[out] OldArgc Pointer to old number of items in Argv list.
-
- @retval EFI_SUCCESS Operation was sucessful, Argv and Argc are valid.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-UpdateArgcArgv(
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
- IN CONST CHAR16 *NewCommandLine,
- OUT CHAR16 ***OldArgv OPTIONAL,
- OUT UINTN *OldArgc OPTIONAL
- )
-{
- ASSERT(ShellParameters != NULL);
-
- if (OldArgc != NULL) {
- *OldArgc = ShellParameters->Argc;
- }
- if (OldArgc != NULL) {
- *OldArgv = ShellParameters->Argv;
- }
-
- return (ParseCommandLineToArgs(NewCommandLine, &(ShellParameters->Argv), &(ShellParameters->Argc)));
-}
-
-/**
- Funcion will replace the current Argc and Argv in the ShellParameters protocol
- structure with Argv and Argc. The current values are de-allocated and the
- OldArgv must not be deallocated by the caller.
-
- @param[in, out] ShellParameters pointer to parameter structure to modify
- @param[in] OldArgv pointer to old list of parameters
- @param[in] OldArgc pointer to old number of items in Argv list
-**/
-VOID
-EFIAPI
-RestoreArgcArgv(
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
- IN CHAR16 ***OldArgv,
- IN UINTN *OldArgc
- )
-{
- UINTN LoopCounter;
- ASSERT(ShellParameters != NULL);
- ASSERT(OldArgv != NULL);
- ASSERT(OldArgc != NULL);
-
- if (ShellParameters->Argv != NULL) {
- for ( LoopCounter = 0
- ; LoopCounter < ShellParameters->Argc
- ; LoopCounter++
- ){
- FreePool(ShellParameters->Argv[LoopCounter]);
- }
- FreePool(ShellParameters->Argv);
- }
- ShellParameters->Argv = *OldArgv;
- *OldArgv = NULL;
- ShellParameters->Argc = *OldArgc;
- *OldArgc = 0;
-}
diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.h b/ShellPkg/Application/Shell/ShellParametersProtocol.h
deleted file mode 100644
index b63e1d394f..0000000000
--- a/ShellPkg/Application/Shell/ShellParametersProtocol.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/** @file
- Member functions of EFI_SHELL_PARAMETERS_PROTOCOL and functions for creation,
- manipulation, and initialization of EFI_SHELL_PARAMETERS_PROTOCOL.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_PARAMETERS_PROTOCOL_PROVIDER_HEADER_
-#define _SHELL_PARAMETERS_PROTOCOL_PROVIDER_HEADER_
-
-#include <Uefi.h>
-
-#include <Protocol/SimpleFileSystem.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/SimpleTextOut.h>
-#include <Protocol/SimpleTextIn.h>
-
-#include <Guid/ShellVariableGuid.h>
-
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiLib.h>
-#include <Library/DebugLib.h>
-#include <Library/ShellLib.h>
-#include <Library/FileHandleLib.h>
-
-#include "ShellEnvVar.h"
-#include "FileHandleWrappers.h"
-#include "Shell.h"
-
-/**
- creates a new EFI_SHELL_PARAMETERS_PROTOCOL instance and populates it and then
- installs it on our handle and if there is an existing version of the protocol
- that one is cached for removal later.
-
- @param[in, out] NewShellParameters on a successful return, a pointer to pointer
- to the newly installed interface.
- @param[in, out] RootShellInstance on a successful return, pointer to boolean.
- TRUE if this is the root shell instance.
-
- @retval EFI_SUCCESS the operation completed successfully.
- @return other the operation failed.
- @sa ReinstallProtocolInterface
- @sa InstallProtocolInterface
- @sa ParseCommandLineToArgs
-**/
-EFI_STATUS
-EFIAPI
-CreatePopulateInstallShellParametersProtocol (
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL **NewShellParameters,
- IN OUT BOOLEAN *RootShellInstance
- );
-
-/**
- frees all memory used by createion and installation of shell parameters protocol
- and if there was an old version installed it will restore that one.
-
- @param NewShellParameters the interface of EFI_SHELL_PARAMETERS_PROTOCOL that is
- being cleaned up.
-
- @retval EFI_SUCCESS the cleanup was successful
- @return other the cleanup failed
- @sa ReinstallProtocolInterface
- @sa UninstallProtocolInterface
-**/
-EFI_STATUS
-EFIAPI
-CleanUpShellParametersProtocol (
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *NewShellParameters
- );
-
-/**
- Funcion will replace the current Argc and Argv in the ShellParameters protocol
- structure by parsing NewCommandLine. The current values are returned to the
- user.
-
- @param[in, out] ShellParameters pointer to parameter structure to modify
- @param[in] NewCommandLine the new command line to parse and use
- @param[out] OldArgv pointer to old list of parameters
- @param[out] OldArgc pointer to old number of items in Argv list
-
- @retval EFI_SUCCESS operation was sucessful, Argv and Argc are valid
- @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-UpdateArgcArgv(
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
- IN CONST CHAR16 *NewCommandLine,
- OUT CHAR16 ***OldArgv,
- OUT UINTN *OldArgc
- );
-
-/**
- Funcion will replace the current Argc and Argv in the ShellParameters protocol
- structure with Argv and Argc. The current values are de-allocated and the
- OldArgv must not be deallocated by the caller.
-
- @param[in, out] ShellParameters pointer to parameter structure to modify
- @param[in] OldArgv pointer to old list of parameters
- @param[in] OldArgc pointer to old number of items in Argv list
-**/
-VOID
-EFIAPI
-RestoreArgcArgv(
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
- IN CHAR16 ***OldArgv,
- IN UINTN *OldArgc
- );
-
-typedef struct {
- EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn;
- EFI_HANDLE ConInHandle;
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;
- EFI_HANDLE ConOutHandle;
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConErr;
- EFI_HANDLE ConErrHandle;
-} SYSTEM_TABLE_INFO;
-
-/**
- Funcion will replace the current StdIn and StdOut in the ShellParameters protocol
- structure by parsing NewCommandLine. The current values are returned to the
- user.
-
- This will also update the system table.
-
- @param[in, out] ShellParameters Pointer to parameter structure to modify.
- @param[in] NewCommandLine The new command line to parse and use.
- @param[out] OldStdIn Pointer to old StdIn.
- @param[out] OldStdOut Pointer to old StdOut.
- @param[out] OldStdErr Pointer to old StdErr.
- @param[out] SystemTableInfo Pointer to old system table information.
-
- @retval EFI_SUCCESS Operation was sucessful, Argv and Argc are valid.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-UpdateStdInStdOutStdErr(
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
- IN CHAR16 *NewCommandLine,
- OUT SHELL_FILE_HANDLE *OldStdIn,
- OUT SHELL_FILE_HANDLE *OldStdOut,
- OUT SHELL_FILE_HANDLE *OldStdErr,
- OUT SYSTEM_TABLE_INFO *SystemTableInfo
- );
-
-/**
- Funcion will replace the current StdIn and StdOut in the ShellParameters protocol
- structure with StdIn and StdOut. The current values are de-allocated.
-
- @param[in, out] ShellParameters Pointer to parameter structure to modify.
- @param[in] OldStdIn Pointer to old StdIn.
- @param[in] OldStdOut Pointer to old StdOut.
- @param[in] OldStdErr Pointer to old StdErr.
- @param[in] SystemTableInfo Pointer to old system table information.
-**/
-EFI_STATUS
-EFIAPI
-RestoreStdInStdOutStdErr (
- IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
- IN SHELL_FILE_HANDLE *OldStdIn,
- IN SHELL_FILE_HANDLE *OldStdOut,
- IN SHELL_FILE_HANDLE *OldStdErr,
- IN SYSTEM_TABLE_INFO *SystemTableInfo
- );
-
-/**
- function to populate Argc and Argv.
-
- This function parses the CommandLine and divides it into standard C style Argc/Argv
- parameters for inclusion in EFI_SHELL_PARAMETERS_PROTOCOL. this supports space
- delimited and quote surrounded parameter definition.
-
- @param[in] CommandLine String of command line to parse
- @param[in, out] Argv pointer to array of strings; one for each parameter
- @param[in, out] Argc pointer to number of strings in Argv array
-
- @return EFI_SUCCESS the operation was sucessful
- @return EFI_OUT_OF_RESOURCES a memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-ParseCommandLineToArgs(
- IN CONST CHAR16 *CommandLine,
- IN OUT CHAR16 ***Argv,
- IN OUT UINTN *Argc
- );
-
-/**
- return the next parameter from a command line string;
-
- This function moves the next parameter from Walker into TempParameter and moves
- Walker up past that parameter for recursive calling. When the final parameter
- is moved *Walker will be set to NULL;
-
- Temp Parameter must be large enough to hold the parameter before calling this
- function.
-
- @param[in, out] Walker pointer to string of command line. Adjusted to
- reminaing command line on return
- @param[in, out] TempParameter pointer to string of command line item extracted.
-
-**/
-VOID
-EFIAPI
-GetNextParameter(
- CHAR16 **Walker,
- CHAR16 **TempParameter
- );
-
-#endif //_SHELL_PARAMETERS_PROTOCOL_PROVIDER_HEADER_
-
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c
deleted file mode 100644
index 8f719dad75..0000000000
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ /dev/null
@@ -1,3416 +0,0 @@
-/** @file
- Member functions of EFI_SHELL_PROTOCOL and functions for creation,
- manipulation, and initialization of EFI_SHELL_PROTOCOL.
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "Shell.h"
-#include <Library/FileHandleLib.h>
-
-/**
- Close an open file handle.
-
- This function closes a specified file handle. All "dirty" cached file data is
- flushed to the device, and the file is closed. In all cases the handle is
- closed.
-
- @param[in] FileHandle The file handle to close.
-
- @retval EFI_SUCCESS The file handle was closed successfully.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellClose (
- IN SHELL_FILE_HANDLE FileHandle
- )
-{
- ShellFileHandleRemove(FileHandle);
- return (FileHandleClose(ConvertShellHandleToEfiFileProtocol(FileHandle)));
-}
-
-/**
- Internal worker to determine whether there is a BlockIo somewhere
- upon the device path specified.
-
- @param[in] DevicePath The device path to test.
-
- @retval TRUE gEfiBlockIoProtocolGuid was installed on a handle with this device path
- @retval FALSE gEfiBlockIoProtocolGuid was not found.
-**/
-BOOLEAN
-EFIAPI
-InternalShellProtocolIsBlockIoPresent(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevicePathCopy;
- EFI_STATUS Status;
- EFI_HANDLE Handle;
-
- Handle = NULL;
-
- DevicePathCopy = (EFI_DEVICE_PATH_PROTOCOL*)DevicePath;
- Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &DevicePathCopy, &Handle);
-
- if ((Handle != NULL) && (!EFI_ERROR(Status))) {
- return (TRUE);
- }
- return (FALSE);
-}
-
-/**
- Internal worker to determine whether there is a file system somewhere
- upon the device path specified.
-
- @param[in] DevicePath The device path to test.
-
- @retval TRUE gEfiSimpleFileSystemProtocolGuid was installed on a handle with this device path
- @retval FALSE gEfiSimpleFileSystemProtocolGuid was not found.
-**/
-BOOLEAN
-EFIAPI
-InternalShellProtocolIsSimpleFileSystemPresent(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevicePathCopy;
- EFI_STATUS Status;
- EFI_HANDLE Handle;
-
- Handle = NULL;
-
- DevicePathCopy = (EFI_DEVICE_PATH_PROTOCOL*)DevicePath;
- Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid, &DevicePathCopy, &Handle);
-
- if ((Handle != NULL) && (!EFI_ERROR(Status))) {
- return (TRUE);
- }
- return (FALSE);
-}
-
-/**
- Internal worker debug helper function to print out maps as they are added.
-
- @param[in] Mapping string mapping that has been added
- @param[in] DevicePath pointer to device path that has been mapped.
-
- @retval EFI_SUCCESS the operation was successful.
- @return other an error ocurred
-
- @sa LocateHandle
- @sa OpenProtocol
-**/
-EFI_STATUS
-EFIAPI
-InternalShellProtocolDebugPrintMessage (
- IN CONST CHAR16 *Mapping,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- EFI_STATUS Status;
- CHAR16 *Temp;
-
- Status = EFI_SUCCESS;
- DEBUG_CODE_BEGIN();
-
- if (Mapping != NULL) {
- DEBUG((EFI_D_INFO, "Added new map item:\"%S\"\r\n", Mapping));
- }
- Temp = ConvertDevicePathToText(DevicePath, TRUE, TRUE);
- DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp));
- FreePool(Temp);
-
- DEBUG_CODE_END();
- return (Status);
-}
-
-/**
- This function creates a mapping for a device path.
-
- If both DeviecPath and Mapping are NULL, this will reset the mapping to default values.
-
- @param DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,
- then the mapping will be deleted.
- @param Mapping Points to the NULL-terminated mapping for the device path. Must end with a ':'
-
- @retval EFI_SUCCESS Mapping created or deleted successfully.
- @retval EFI_NO_MAPPING There is no handle that corresponds exactly to DevicePath. See the
- boot service function LocateDevicePath().
- @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
- @retval EFI_INVALID_PARAMETER Mapping was NULL
- @retval EFI_INVALID_PARAMETER Mapping did not end with a ':'
- @retval EFI_INVALID_PARAMETER DevicePath was not pointing at a device that had a SIMPLE_FILE_SYSTEM_PROTOCOL installed.
- @retval EFI_NOT_FOUND There was no mapping found to delete
- @retval EFI_OUT_OF_RESOURCES Memory allocation failed
-**/
-EFI_STATUS
-EFIAPI
-EfiShellSetMap(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL,
- IN CONST CHAR16 *Mapping
- )
-{
- EFI_STATUS Status;
- SHELL_MAP_LIST *MapListNode;
-
- if (Mapping == NULL){
- return (EFI_INVALID_PARAMETER);
- }
-
- if (Mapping[StrLen(Mapping)-1] != ':') {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // Delete the mapping
- //
- if (DevicePath == NULL) {
- if (IsListEmpty(&gShellMapList.Link)) {
- return (EFI_NOT_FOUND);
- }
- for ( MapListNode = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
- ; !IsNull(&gShellMapList.Link, &MapListNode->Link)
- ; MapListNode = (SHELL_MAP_LIST *)GetNextNode(&gShellMapList.Link, &MapListNode->Link)
- ){
- if (StringNoCaseCompare(&MapListNode->MapName, &Mapping) == 0) {
- RemoveEntryList(&MapListNode->Link);
- FreePool(MapListNode);
- return (EFI_SUCCESS);
- }
- } // for loop
-
- //
- // We didnt find one to delete
- //
- return (EFI_NOT_FOUND);
- }
-
- //
- // make sure this is a valid to add device path
- //
- ///@todo add BlockIo to this test...
- if (!InternalShellProtocolIsSimpleFileSystemPresent(DevicePath)
- && !InternalShellProtocolIsBlockIoPresent(DevicePath)) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // First make sure there is no old mapping
- //
- Status = EfiShellSetMap(NULL, Mapping);
- if ((Status != EFI_SUCCESS) && (Status != EFI_NOT_FOUND)) {
- return (Status);
- }
-
- //
- // now add the new one.
- //
- Status = ShellCommandAddMapItemAndUpdatePath(Mapping, DevicePath, 0, FALSE);
-
- return(Status);
-}
-
-/**
- Gets the device path from the mapping.
-
- This function gets the device path associated with a mapping.
-
- @param Mapping A pointer to the mapping
-
- @retval !=NULL Pointer to the device path that corresponds to the
- device mapping. The returned pointer does not need
- to be freed.
- @retval NULL There is no device path associated with the
- specified mapping.
-**/
-CONST EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-EfiShellGetDevicePathFromMap(
- IN CONST CHAR16 *Mapping
- )
-{
- SHELL_MAP_LIST *MapListItem;
- CHAR16 *NewName;
- UINTN Size;
-
- NewName = NULL;
- Size = 0;
-
- StrnCatGrow(&NewName, &Size, Mapping, 0);
- if (Mapping[StrLen(Mapping)-1] != L':') {
- StrnCatGrow(&NewName, &Size, L":", 0);
- }
-
- MapListItem = ShellCommandFindMapItem(NewName);
-
- FreePool(NewName);
-
- if (MapListItem != NULL) {
- return (MapListItem->DevicePath);
- }
- return(NULL);
-}
-
-/**
- Gets the mapping(s) that most closely matches the device path.
-
- This function gets the mapping which corresponds to the device path *DevicePath. If
- there is no exact match, then the mapping which most closely matches *DevicePath
- is returned, and *DevicePath is updated to point to the remaining portion of the
- device path. If there is an exact match, the mapping is returned and *DevicePath
- points to the end-of-device-path node.
-
- If there are multiple map names they will be semi-colon seperated in the
- NULL-terminated string.
-
- @param DevicePath On entry, points to a device path pointer. On
- exit, updates the pointer to point to the
- portion of the device path after the mapping.
-
- @retval NULL No mapping was found.
- @return !=NULL Pointer to NULL-terminated mapping. The buffer
- is callee allocated and should be freed by the caller.
-**/
-CONST CHAR16 *
-EFIAPI
-EfiShellGetMapFromDevicePath(
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
- )
-{
- SHELL_MAP_LIST *Node;
- CHAR16 *PathForReturn;
- UINTN PathSize;
-// EFI_HANDLE PathHandle;
-// EFI_HANDLE MapHandle;
-// EFI_STATUS Status;
-// EFI_DEVICE_PATH_PROTOCOL *DevicePathCopy;
-// EFI_DEVICE_PATH_PROTOCOL *MapPathCopy;
-
- if (DevicePath == NULL || *DevicePath == NULL) {
- return (NULL);
- }
-
- PathForReturn = NULL;
- PathSize = 0;
-
- for ( Node = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
- ; !IsNull(&gShellMapList.Link, &Node->Link)
- ; Node = (SHELL_MAP_LIST *)GetNextNode(&gShellMapList.Link, &Node->Link)
- ){
- //
- // check for exact match
- //
- if (DevicePathCompare(DevicePath, &Node->DevicePath) == 0) {
- ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn != NULL));
- if (PathSize != 0) {
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, L";", 0);
- }
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, Node->MapName, 0);
- }
- }
- if (PathForReturn != NULL) {
- while (!IsDevicePathEndType (*DevicePath)) {
- *DevicePath = NextDevicePathNode (*DevicePath);
- }
- SetDevicePathEndNode (*DevicePath);
- }
-/*
- ///@todo finish code for inexact matches.
- if (PathForReturn == NULL) {
- PathSize = 0;
-
- DevicePathCopy = DuplicateDevicePath(*DevicePath);
- ASSERT(DevicePathCopy != NULL);
- Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid, &DevicePathCopy, &PathHandle);
- ASSERT_EFI_ERROR(Status);
- //
- // check each of the device paths we have to get the root of the path for consist mappings
- //
- for ( Node = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
- ; !IsNull(&gShellMapList.Link, &Node->Link)
- ; Node = (SHELL_MAP_LIST *)GetNextNode(&gShellMapList.Link, &Node->Link)
- ){
- if ((Node->Flags & SHELL_MAP_FLAGS_CONSIST) == 0) {
- continue;
- }
- MapPathCopy = DuplicateDevicePath(Node->DevicePath);
- ASSERT(MapPathCopy != NULL);
- Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid, &MapPathCopy, &MapHandle);
- if (MapHandle == PathHandle) {
-
- *DevicePath = DevicePathCopy;
-
- MapPathCopy = NULL;
- DevicePathCopy = NULL;
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, Node->MapName, 0);
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, L";", 0);
- break;
- }
- }
- //
- // now add on the non-consistent mappings
- //
- for ( Node = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
- ; !IsNull(&gShellMapList.Link, &Node->Link)
- ; Node = (SHELL_MAP_LIST *)GetNextNode(&gShellMapList.Link, &Node->Link)
- ){
- if ((Node->Flags & SHELL_MAP_FLAGS_CONSIST) != 0) {
- continue;
- }
- MapPathCopy = Node->DevicePath;
- ASSERT(MapPathCopy != NULL);
- Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid, &MapPathCopy, &MapHandle);
- if (MapHandle == PathHandle) {
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, Node->MapName, 0);
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, L";", 0);
- break;
- }
- }
- }
-*/
-
- return (AddBufferToFreeList(PathForReturn));
-}
-
-/**
- Converts a device path to a file system-style path.
-
- This function converts a device path to a file system path by replacing part, or all, of
- the device path with the file-system mapping. If there are more than one application
- file system mappings, the one that most closely matches Path will be used.
-
- @param Path The pointer to the device path
-
- @retval NULL the device path could not be found.
- @return all The pointer of the NULL-terminated file path. The path
- is callee-allocated and should be freed by the caller.
-**/
-CHAR16 *
-EFIAPI
-EfiShellGetFilePathFromDevicePath(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevicePathCopy;
- EFI_DEVICE_PATH_PROTOCOL *MapPathCopy;
- SHELL_MAP_LIST *MapListItem;
- CHAR16 *PathForReturn;
- UINTN PathSize;
- EFI_HANDLE PathHandle;
- EFI_HANDLE MapHandle;
- EFI_STATUS Status;
- FILEPATH_DEVICE_PATH *FilePath;
- FILEPATH_DEVICE_PATH *AlignedNode;
-
- PathForReturn = NULL;
- PathSize = 0;
-
- DevicePathCopy = (EFI_DEVICE_PATH_PROTOCOL*)Path;
- ASSERT(DevicePathCopy != NULL);
- if (DevicePathCopy == NULL) {
- return (NULL);
- }
- ///@todo BlockIo?
- Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid, &DevicePathCopy, &PathHandle);
-
- if (EFI_ERROR(Status)) {
- return (NULL);
- }
- //
- // check each of the device paths we have to get the root of the path
- //
- for ( MapListItem = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
- ; !IsNull(&gShellMapList.Link, &MapListItem->Link)
- ; MapListItem = (SHELL_MAP_LIST *)GetNextNode(&gShellMapList.Link, &MapListItem->Link)
- ){
- MapPathCopy = (EFI_DEVICE_PATH_PROTOCOL*)MapListItem->DevicePath;
- ASSERT(MapPathCopy != NULL);
- ///@todo BlockIo?
- Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid, &MapPathCopy, &MapHandle);
- if (MapHandle == PathHandle) {
- ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn != NULL));
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, MapListItem->MapName, 0);
- //
- // go through all the remaining nodes in the device path
- //
- for ( FilePath = (FILEPATH_DEVICE_PATH*)DevicePathCopy
- ; !IsDevicePathEnd (&FilePath->Header)
- ; FilePath = (FILEPATH_DEVICE_PATH*)NextDevicePathNode (&FilePath->Header)
- ){
- //
- // all the rest should be file path nodes
- //
- if ((DevicePathType(&FilePath->Header) != MEDIA_DEVICE_PATH) ||
- (DevicePathSubType(&FilePath->Header) != MEDIA_FILEPATH_DP)) {
- FreePool(PathForReturn);
- PathForReturn = NULL;
- ASSERT(FALSE);
- } else {
- //
- // append the path part onto the filepath.
- //
- ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn != NULL));
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, L"\\", 1);
-
- AlignedNode = AllocateCopyPool (DevicePathNodeLength(FilePath), FilePath);
- PathForReturn = StrnCatGrow(&PathForReturn, &PathSize, AlignedNode->PathName, 0);
- FreePool(AlignedNode);
- }
- } // for loop of remaining nodes
- }
- if (PathForReturn != NULL) {
- break;
- }
- } // for loop of paths to check
- return(PathForReturn);
-}
-
-/**
- Converts a file system style name to a device path.
-
- This function converts a file system style name to a device path, by replacing any
- mapping references to the associated device path.
-
- @param[in] Path The pointer to the path.
-
- @return The pointer of the file path. The file path is callee
- allocated and should be freed by the caller.
- @retval NULL The path could not be found.
- @retval NULL There was not enough available memory.
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-EfiShellGetDevicePathFromFilePath(
- IN CONST CHAR16 *Path
- )
-{
- CHAR16 *MapName;
- CHAR16 *NewPath;
- CONST CHAR16 *Cwd;
- UINTN Size;
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_DEVICE_PATH_PROTOCOL *DevicePathCopy;
- EFI_DEVICE_PATH_PROTOCOL *DevicePathCopyForFree;
- EFI_DEVICE_PATH_PROTOCOL *DevicePathForReturn;
- EFI_HANDLE Handle;
- EFI_STATUS Status;
-
- if (Path == NULL) {
- return (NULL);
- }
-
- MapName = NULL;
- NewPath = NULL;
-
- if (StrStr(Path, L":") == NULL) {
- Cwd = EfiShellGetCurDir(NULL);
- if (Cwd == NULL) {
- return (NULL);
- }
- Size = StrSize(Cwd);
- Size += StrSize(Path);
- NewPath = AllocateZeroPool(Size);
- if (NewPath == NULL) {
- return (NULL);
- }
- StrCpy(NewPath, Cwd);
- if (*Path == L'\\') {
- Path++;
- while (PathRemoveLastItem(NewPath)) ;
- }
- StrCat(NewPath, Path);
- DevicePathForReturn = EfiShellGetDevicePathFromFilePath(NewPath);
- FreePool(NewPath);
- return (DevicePathForReturn);
- }
-
- Size = 0;
- //
- // find the part before (but including) the : for the map name
- //
- ASSERT((MapName == NULL && Size == 0) || (MapName != NULL));
- MapName = StrnCatGrow(&MapName, &Size, Path, (StrStr(Path, L":")-Path+1));
- if (MapName == NULL || MapName[StrLen(MapName)-1] != L':') {
- return (NULL);
- }
-
- //
- // look up the device path in the map
- //
- DevicePath = EfiShellGetDevicePathFromMap(MapName);
- if (DevicePath == NULL) {
- //
- // Must have been a bad Mapname
- //
- return (NULL);
- }
-
- //
- // make a copy for LocateDevicePath to modify (also save a pointer to call FreePool with)
- //
- DevicePathCopyForFree = DevicePathCopy = DuplicateDevicePath(DevicePath);
- if (DevicePathCopy == NULL) {
- FreePool(MapName);
- return (NULL);
- }
-
- //
- // get the handle
- //
- ///@todo BlockIo?
- Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid, &DevicePathCopy, &Handle);
- if (EFI_ERROR(Status)) {
- if (DevicePathCopyForFree != NULL) {
- FreePool(DevicePathCopyForFree);
- }
- FreePool(MapName);
- return (NULL);
- }
-
- //
- // build the full device path
- //
- if (*(Path+StrLen(MapName)+1) == CHAR_NULL) {
- DevicePathForReturn = FileDevicePath(Handle, L"\\");
- } else {
- DevicePathForReturn = FileDevicePath(Handle, Path+StrLen(MapName));
- }
-
- FreePool(MapName);
- if (DevicePathCopyForFree != NULL) {
- FreePool(DevicePathCopyForFree);
- }
-
- return (DevicePathForReturn);
-}
-
-/**
- Gets the name of the device specified by the device handle.
-
- This function gets the user-readable name of the device specified by the device
- handle. If no user-readable name could be generated, then *BestDeviceName will be
- NULL and EFI_NOT_FOUND will be returned.
-
- If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the function will return the
- device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if present on
- DeviceHandle.
-
- If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will return the
- device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on DeviceHandle.
- If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and
- EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
- EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
-
- @param DeviceHandle The handle of the device.
- @param Flags Determines the possible sources of component names.
- Valid bits are:
- EFI_DEVICE_NAME_USE_COMPONENT_NAME
- EFI_DEVICE_NAME_USE_DEVICE_PATH
- @param Language A pointer to the language specified for the device
- name, in the same format as described in the UEFI
- specification, Appendix M
- @param BestDeviceName On return, points to the callee-allocated NULL-
- terminated name of the device. If no device name
- could be found, points to NULL. The name must be
- freed by the caller...
-
- @retval EFI_SUCCESS Get the name successfully.
- @retval EFI_NOT_FOUND Fail to get the device name.
- @retval EFI_INVALID_PARAMETER Flags did not have a valid bit set.
- @retval EFI_INVALID_PARAMETER BestDeviceName was NULL
- @retval EFI_INVALID_PARAMETER DeviceHandle was NULL
-**/
-EFI_STATUS
-EFIAPI
-EfiShellGetDeviceName(
- IN EFI_HANDLE DeviceHandle,
- IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
- IN CHAR8 *Language,
- OUT CHAR16 **BestDeviceName
- )
-{
- EFI_STATUS Status;
- EFI_COMPONENT_NAME2_PROTOCOL *CompName2;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_HANDLE *HandleList;
- UINTN HandleCount;
- UINTN LoopVar;
- CHAR16 *DeviceNameToReturn;
- CHAR8 *Lang;
- CHAR8 *TempChar;
-
- UINTN ParentControllerCount;
- EFI_HANDLE *ParentControllerBuffer;
- UINTN ParentDriverCount;
- EFI_HANDLE *ParentDriverBuffer;
-
- if (BestDeviceName == NULL ||
- DeviceHandle == NULL
- ){
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // make sure one of the 2 supported bits is on
- //
- if (((Flags & EFI_DEVICE_NAME_USE_COMPONENT_NAME) == 0) &&
- ((Flags & EFI_DEVICE_NAME_USE_DEVICE_PATH) == 0)) {
- return (EFI_INVALID_PARAMETER);
- }
-
- DeviceNameToReturn = NULL;
- *BestDeviceName = NULL;
- HandleList = NULL;
- HandleCount = 0;
- Lang = NULL;
-
- if ((Flags & EFI_DEVICE_NAME_USE_COMPONENT_NAME) != 0) {
- Status = ParseHandleDatabaseByRelationship(
- NULL,
- DeviceHandle,
- HR_DRIVER_BINDING_HANDLE|HR_DEVICE_DRIVER,
- &HandleCount,
- &HandleList);
- for (LoopVar = 0; LoopVar < HandleCount ; LoopVar++){
- //
- // Go through those handles until we get one that passes for GetComponentName
- //
- Status = gBS->OpenProtocol(
- HandleList[LoopVar],
- &gEfiComponentName2ProtocolGuid,
- (VOID**)&CompName2,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
- Status = gBS->OpenProtocol(
- HandleList[LoopVar],
- &gEfiComponentNameProtocolGuid,
- (VOID**)&CompName2,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- }
-
- if (EFI_ERROR(Status)) {
- continue;
- }
- if (Language == NULL) {
- Lang = AllocateZeroPool(AsciiStrSize(CompName2->SupportedLanguages));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, CompName2->SupportedLanguages);
- TempChar = AsciiStrStr(Lang, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Lang = AllocateZeroPool(AsciiStrSize(Language));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, Language);
- }
- Status = CompName2->GetControllerName(CompName2, DeviceHandle, NULL, Lang, &DeviceNameToReturn);
- FreePool(Lang);
- Lang = NULL;
- if (!EFI_ERROR(Status) && DeviceNameToReturn != NULL) {
- break;
- }
- }
- if (HandleList != NULL) {
- FreePool(HandleList);
- }
-
- //
- // Now check the parent controller using this as the child.
- //
- if (DeviceNameToReturn == NULL){
- PARSE_HANDLE_DATABASE_PARENTS(DeviceHandle, &ParentControllerCount, &ParentControllerBuffer);
- for (LoopVar = 0 ; LoopVar < ParentControllerCount ; LoopVar++) {
- PARSE_HANDLE_DATABASE_UEFI_DRIVERS(ParentControllerBuffer[LoopVar], &ParentDriverCount, &ParentDriverBuffer);
- for (HandleCount = 0 ; HandleCount < ParentDriverCount ; HandleCount++) {
- //
- // try using that driver's component name with controller and our driver as the child.
- //
- Status = gBS->OpenProtocol(
- ParentDriverBuffer[HandleCount],
- &gEfiComponentName2ProtocolGuid,
- (VOID**)&CompName2,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
- Status = gBS->OpenProtocol(
- ParentDriverBuffer[HandleCount],
- &gEfiComponentNameProtocolGuid,
- (VOID**)&CompName2,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- }
-
- if (EFI_ERROR(Status)) {
- continue;
- }
- if (Language == NULL) {
- Lang = AllocateZeroPool(AsciiStrSize(CompName2->SupportedLanguages));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, CompName2->SupportedLanguages);
- TempChar = AsciiStrStr(Lang, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Lang = AllocateZeroPool(AsciiStrSize(Language));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, Language);
- }
- Status = CompName2->GetControllerName(CompName2, ParentControllerBuffer[LoopVar], DeviceHandle, Lang, &DeviceNameToReturn);
- FreePool(Lang);
- Lang = NULL;
- if (!EFI_ERROR(Status) && DeviceNameToReturn != NULL) {
- break;
- }
-
-
-
- }
- SHELL_FREE_NON_NULL(ParentDriverBuffer);
- if (!EFI_ERROR(Status) && DeviceNameToReturn != NULL) {
- break;
- }
- }
- SHELL_FREE_NON_NULL(ParentControllerBuffer);
- }
- //
- // dont return on fail since we will try device path if that bit is on
- //
- if (DeviceNameToReturn != NULL){
- ASSERT(BestDeviceName != NULL);
- StrnCatGrow(BestDeviceName, NULL, DeviceNameToReturn, 0);
- return (EFI_SUCCESS);
- }
- }
- if ((Flags & EFI_DEVICE_NAME_USE_DEVICE_PATH) != 0) {
- Status = gBS->OpenProtocol(
- DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&DevicePath,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!EFI_ERROR(Status)) {
- //
- // use device path to text on the device path
- //
- *BestDeviceName = ConvertDevicePathToText(DevicePath, TRUE, TRUE);
- return (EFI_SUCCESS);
- }
- }
- //
- // none of the selected bits worked.
- //
- return (EFI_NOT_FOUND);
-}
-
-/**
- Opens the root directory of a device on a handle
-
- This function opens the root directory of a device and returns a file handle to it.
-
- @param DeviceHandle The handle of the device that contains the volume.
- @param FileHandle On exit, points to the file handle corresponding to the root directory on the
- device.
-
- @retval EFI_SUCCESS Root opened successfully.
- @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
- could not be opened.
- @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
- @retval EFI_DEVICE_ERROR The device had an error
-**/
-EFI_STATUS
-EFIAPI
-EfiShellOpenRootByHandle(
- IN EFI_HANDLE DeviceHandle,
- OUT SHELL_FILE_HANDLE *FileHandle
- )
-{
- EFI_STATUS Status;
- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFileSystem;
- EFI_FILE_PROTOCOL *RealFileHandle;
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
-
- //
- // get the simple file system interface
- //
- Status = gBS->OpenProtocol(DeviceHandle,
- &gEfiSimpleFileSystemProtocolGuid,
- (VOID**)&SimpleFileSystem,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
- return (EFI_NOT_FOUND);
- }
-
- Status = gBS->OpenProtocol(DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&DevPath,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
- return (EFI_NOT_FOUND);
- }
- //
- // Open the root volume now...
- //
- Status = SimpleFileSystem->OpenVolume(SimpleFileSystem, &RealFileHandle);
- *FileHandle = ConvertEfiFileProtocolToShellHandle(RealFileHandle, EfiShellGetMapFromDevicePath(&DevPath));
- return (Status);
-}
-
-/**
- Opens the root directory of a device.
-
- This function opens the root directory of a device and returns a file handle to it.
-
- @param DevicePath Points to the device path corresponding to the device where the
- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
- @param FileHandle On exit, points to the file handle corresponding to the root directory on the
- device.
-
- @retval EFI_SUCCESS Root opened successfully.
- @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
- could not be opened.
- @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
- @retval EFI_DEVICE_ERROR The device had an error
- @retval EFI_INVALID_PARAMETER FileHandle is NULL.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellOpenRoot(
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- OUT SHELL_FILE_HANDLE *FileHandle
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE Handle;
-
- if (FileHandle == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // find the handle of the device with that device handle and the file system
- //
- ///@todo BlockIo?
- Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid,
- &DevicePath,
- &Handle);
- if (EFI_ERROR(Status)) {
- return (EFI_NOT_FOUND);
- }
-
- return (EfiShellOpenRootByHandle(Handle, FileHandle));
-}
-
-/**
- Returns whether any script files are currently being processed.
-
- @retval TRUE There is at least one script file active.
- @retval FALSE No script files are active now.
-
-**/
-BOOLEAN
-EFIAPI
-EfiShellBatchIsActive (
- VOID
- )
-{
- if (ShellCommandGetCurrentScriptFile() == NULL) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-/**
- Worker function to open a file based on a device path. this will open the root
- of the volume and then traverse down to the file itself.
-
- @param DevicePath Device Path of the file.
- @param FileHandle Pointer to the file upon a successful return.
- @param OpenMode mode to open file in.
- @param Attributes the File Attributes to use when creating a new file.
-
- @retval EFI_SUCCESS the file is open and FileHandle is valid
- @retval EFI_UNSUPPORTED the device path cotained non-path elements
- @retval other an error ocurred.
-**/
-EFI_STATUS
-EFIAPI
-InternalOpenFileDevicePath(
- IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode,
- IN UINT64 Attributes OPTIONAL
- )
-{
- EFI_STATUS Status;
- FILEPATH_DEVICE_PATH *FilePathNode;
- EFI_HANDLE Handle;
- SHELL_FILE_HANDLE ShellHandle;
- EFI_FILE_PROTOCOL *Handle1;
- EFI_FILE_PROTOCOL *Handle2;
- EFI_DEVICE_PATH_PROTOCOL *DpCopy;
- FILEPATH_DEVICE_PATH *AlignedNode;
-
- if (FileHandle == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- *FileHandle = NULL;
- Handle1 = NULL;
- Handle2 = NULL;
- Handle = NULL;
- DpCopy = DevicePath;
- ShellHandle = NULL;
- FilePathNode = NULL;
- AlignedNode = NULL;
-
- Status = EfiShellOpenRoot(DevicePath, &ShellHandle);
-
- if (!EFI_ERROR(Status)) {
- Handle1 = ConvertShellHandleToEfiFileProtocol(ShellHandle);
- if (Handle1 != NULL) {
- //
- // chop off the begining part before the file system part...
- //
- ///@todo BlockIo?
- Status = gBS->LocateDevicePath(&gEfiSimpleFileSystemProtocolGuid,
- &DevicePath,
- &Handle);
- if (!EFI_ERROR(Status)) {
- //
- // To access as a file system, the file path should only
- // contain file path components. Follow the file path nodes
- // and find the target file
- //
- for ( FilePathNode = (FILEPATH_DEVICE_PATH *)DevicePath
- ; !IsDevicePathEnd (&FilePathNode->Header)
- ; FilePathNode = (FILEPATH_DEVICE_PATH *) NextDevicePathNode (&FilePathNode->Header)
- ){
- SHELL_FREE_NON_NULL(AlignedNode);
- AlignedNode = AllocateCopyPool (DevicePathNodeLength(FilePathNode), FilePathNode);
- //
- // For file system access each node should be a file path component
- //
- if (DevicePathType (&FilePathNode->Header) != MEDIA_DEVICE_PATH ||
- DevicePathSubType (&FilePathNode->Header) != MEDIA_FILEPATH_DP
- ) {
- Status = EFI_UNSUPPORTED;
- break;
- }
-
- //
- // Open this file path node
- //
- Handle2 = Handle1;
- Handle1 = NULL;
-
- //
- // if this is the last node in the DevicePath always create (if that was requested).
- //
- if (IsDevicePathEnd ((NextDevicePathNode (&FilePathNode->Header)))) {
- Status = Handle2->Open (
- Handle2,
- &Handle1,
- AlignedNode->PathName,
- OpenMode,
- Attributes
- );
- } else {
-
- //
- // This is not the last node and we dont want to 'create' existing
- // directory entries...
- //
-
- //
- // open without letting it create
- // prevents error on existing files/directories
- //
- Status = Handle2->Open (
- Handle2,
- &Handle1,
- AlignedNode->PathName,
- OpenMode &~EFI_FILE_MODE_CREATE,
- Attributes
- );
- //
- // if above failed now open and create the 'item'
- // if OpenMode EFI_FILE_MODE_CREATE bit was on (but disabled above)
- //
- if ((EFI_ERROR (Status)) && ((OpenMode & EFI_FILE_MODE_CREATE) != 0)) {
- Status = Handle2->Open (
- Handle2,
- &Handle1,
- AlignedNode->PathName,
- OpenMode,
- Attributes
- );
- }
- }
- //
- // Close the last node
- //
- ShellInfoObject.NewEfiShellProtocol->CloseFile (Handle2);
-
- //
- // If there's been an error, stop
- //
- if (EFI_ERROR (Status)) {
- break;
- }
- } // for loop
- }
- }
- }
- SHELL_FREE_NON_NULL(AlignedNode);
- if (EFI_ERROR(Status)) {
- if (Handle1 != NULL) {
- ShellInfoObject.NewEfiShellProtocol->CloseFile(Handle1);
- }
- } else {
- *FileHandle = ConvertEfiFileProtocolToShellHandle(Handle1, ShellFileHandleGetPath(ShellHandle));
- }
- return (Status);
-}
-
-/**
- Creates a file or directory by name.
-
- This function creates an empty new file or directory with the specified attributes and
- returns the new file's handle. If the file already exists and is read-only, then
- EFI_INVALID_PARAMETER will be returned.
-
- If the file already existed, it is truncated and its attributes updated. If the file is
- created successfully, the FileHandle is the file's handle, else, the FileHandle is NULL.
-
- If the file name begins with >v, then the file handle which is returned refers to the
- shell environment variable with the specified name. If the shell environment variable
- already exists and is non-volatile then EFI_INVALID_PARAMETER is returned.
-
- @param FileName Pointer to NULL-terminated file path
- @param FileAttribs The new file's attrbiutes. the different attributes are
- described in EFI_FILE_PROTOCOL.Open().
- @param FileHandle On return, points to the created file handle or directory's handle
-
- @retval EFI_SUCCESS The file was opened. FileHandle points to the new file's handle.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED could not open the file path
- @retval EFI_NOT_FOUND the specified file could not be found on the devide, or could not
- file the file system on the device.
- @retval EFI_NO_MEDIA the device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
- longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
- the DirName.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
- when the media is write-protected.
- @retval EFI_ACCESS_DENIED The service denied access to the file.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellCreateFile(
- IN CONST CHAR16 *FileName,
- IN UINT64 FileAttribs,
- OUT SHELL_FILE_HANDLE *FileHandle
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_STATUS Status;
-
- //
- // Is this for an environment variable
- // do we start with >v
- //
- if (StrStr(FileName, L">v") == FileName) {
- if (!IsVolatileEnv(FileName+2)) {
- return (EFI_INVALID_PARAMETER);
- }
- *FileHandle = CreateFileInterfaceEnv(FileName+2);
- return (EFI_SUCCESS);
- }
-
- //
- // We are opening a regular file.
- //
- DevicePath = EfiShellGetDevicePathFromFilePath(FileName);
- if (DevicePath == NULL) {
- return (EFI_NOT_FOUND);
- }
-
- Status = InternalOpenFileDevicePath(DevicePath, FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, FileAttribs); // 0 = no specific file attributes
- FreePool(DevicePath);
-
- return(Status);
-}
-
-/**
- Opens a file or a directory by file name.
-
- This function opens the specified file in the specified OpenMode and returns a file
- handle.
- If the file name begins with >v, then the file handle which is returned refers to the
- shell environment variable with the specified name. If the shell environment variable
- exists, is non-volatile and the OpenMode indicates EFI_FILE_MODE_WRITE, then
- EFI_INVALID_PARAMETER is returned.
-
- If the file name is >i, then the file handle which is returned refers to the standard
- input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is >o, then the file handle which is returned refers to the standard
- output. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is >e, then the file handle which is returned refers to the standard
- error. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is NUL, then the file handle that is returned refers to the standard NUL
- file. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER is
- returned.
-
- If return EFI_SUCCESS, the FileHandle is the opened file's handle, else, the
- FileHandle is NULL.
-
- @param FileName Points to the NULL-terminated UCS-2 encoded file name.
- @param FileHandle On return, points to the file handle.
- @param OpenMode File open mode. Either EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
- Specification.
- @retval EFI_SUCCESS The file was opened. FileHandle has the opened file's handle.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. FileHandle is NULL.
- @retval EFI_UNSUPPORTED Could not open the file path. FileHandle is NULL.
- @retval EFI_NOT_FOUND The specified file could not be found on the device or the file
- system could not be found on the device. FileHandle is NULL.
- @retval EFI_NO_MEDIA The device has no medium. FileHandle is NULL.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
- longer supported. FileHandle is NULL.
- @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
- the FileName. FileHandle is NULL.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. FileHandle is NULL.
- @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
- when the media is write-protected. FileHandle is NULL.
- @retval EFI_ACCESS_DENIED The service denied access to the file. FileHandle is NULL.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file. FileHandle
- is NULL.
- @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellOpenFileByName(
- IN CONST CHAR16 *FileName,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_STATUS Status;
-
- *FileHandle = NULL;
-
- //
- // Is this for StdIn
- //
- if (StrCmp(FileName, L">i") == 0) {
- //
- // make sure not writing to StdIn
- //
- if ((OpenMode & EFI_FILE_MODE_WRITE) != 0) {
- return (EFI_INVALID_PARAMETER);
- }
- *FileHandle = ShellInfoObject.NewShellParametersProtocol->StdIn;
- ASSERT(*FileHandle != NULL);
- return (EFI_SUCCESS);
- }
-
- //
- // Is this for StdOut
- //
- if (StrCmp(FileName, L">o") == 0) {
- //
- // make sure not writing to StdIn
- //
- if ((OpenMode & EFI_FILE_MODE_READ) != 0) {
- return (EFI_INVALID_PARAMETER);
- }
- *FileHandle = &FileInterfaceStdOut;
- return (EFI_SUCCESS);
- }
-
- //
- // Is this for NUL file
- //
- if (StrCmp(FileName, L"NUL") == 0) {
- *FileHandle = &FileInterfaceNulFile;
- return (EFI_SUCCESS);
- }
-
- //
- // Is this for StdErr
- //
- if (StrCmp(FileName, L">e") == 0) {
- //
- // make sure not writing to StdIn
- //
- if ((OpenMode & EFI_FILE_MODE_READ) != 0) {
- return (EFI_INVALID_PARAMETER);
- }
- *FileHandle = &FileInterfaceStdErr;
- return (EFI_SUCCESS);
- }
-
- //
- // Is this for an environment variable
- // do we start with >v
- //
- if (StrStr(FileName, L">v") == FileName) {
- if (!IsVolatileEnv(FileName+2) &&
- ((OpenMode & EFI_FILE_MODE_WRITE) != 0)) {
- return (EFI_INVALID_PARAMETER);
- }
- *FileHandle = CreateFileInterfaceEnv(FileName+2);
- return (EFI_SUCCESS);
- }
-
- //
- // We are opening a regular file.
- //
- DevicePath = EfiShellGetDevicePathFromFilePath(FileName);
-// DEBUG_CODE(InternalShellProtocolDebugPrintMessage (NULL, DevicePath););
- if (DevicePath == NULL) {
- return (EFI_NOT_FOUND);
- }
-
- //
- // Copy the device path, open the file, then free the memory
- //
- Status = InternalOpenFileDevicePath(DevicePath, FileHandle, OpenMode, 0); // 0 = no specific file attributes
- FreePool(DevicePath);
-
- return(Status);
-}
-
-/**
- Deletes the file specified by the file name.
-
- This function deletes a file.
-
- @param FileName Points to the NULL-terminated file name.
-
- @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
- @sa EfiShellCreateFile
-**/
-EFI_STATUS
-EFIAPI
-EfiShellDeleteFileByName(
- IN CONST CHAR16 *FileName
- )
-{
- SHELL_FILE_HANDLE FileHandle;
- EFI_STATUS Status;
-
- //
- // get a handle to the file
- //
- Status = EfiShellCreateFile(FileName,
- 0,
- &FileHandle);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
- //
- // now delete the file
- //
- return (ShellInfoObject.NewEfiShellProtocol->DeleteFile(FileHandle));
-}
-
-/**
- Disables the page break output mode.
-**/
-VOID
-EFIAPI
-EfiShellDisablePageBreak (
- VOID
- )
-{
- ShellInfoObject.PageBreakEnabled = FALSE;
-}
-
-/**
- Enables the page break output mode.
-**/
-VOID
-EFIAPI
-EfiShellEnablePageBreak (
- VOID
- )
-{
- ShellInfoObject.PageBreakEnabled = TRUE;
-}
-
-/**
- internal worker function to load and run an image via device path.
-
- @param ParentImageHandle A handle of the image that is executing the specified
- command line.
- @param DevicePath device path of the file to execute
- @param CommandLine Points to the NULL-terminated UCS-2 encoded string
- containing the command line. If NULL then the command-
- line will be empty.
- @param Environment Points to a NULL-terminated array of environment
- variables with the format 'x=y', where x is the
- environment variable name and y is the value. If this
- is NULL, then the current shell environment is used.
- @param StatusCode Points to the status code returned by the command.
-
- @retval EFI_SUCCESS The command executed successfully. The status code
- returned by the command is pointed to by StatusCode.
- @retval EFI_INVALID_PARAMETER The parameters are invalid.
- @retval EFI_OUT_OF_RESOURCES Out of resources.
- @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
-**/
-EFI_STATUS
-EFIAPI
-InternalShellExecuteDevicePath(
- IN CONST EFI_HANDLE *ParentImageHandle,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN CONST CHAR16 *CommandLine OPTIONAL,
- IN CONST CHAR16 **Environment OPTIONAL,
- OUT EFI_STATUS *StatusCode OPTIONAL
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE NewHandle;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- LIST_ENTRY OrigEnvs;
- EFI_SHELL_PARAMETERS_PROTOCOL ShellParamsProtocol;
-
- if (ParentImageHandle == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- InitializeListHead(&OrigEnvs);
-
- NewHandle = NULL;
-
- //
- // Load the image with:
- // FALSE - not from boot manager and NULL, 0 being not already in memory
- //
- Status = gBS->LoadImage(
- FALSE,
- *ParentImageHandle,
- (EFI_DEVICE_PATH_PROTOCOL*)DevicePath,
- NULL,
- 0,
- &NewHandle);
-
- if (EFI_ERROR(Status)) {
- if (NewHandle != NULL) {
- gBS->UnloadImage(NewHandle);
- }
- return (Status);
- }
- Status = gBS->OpenProtocol(
- NewHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID**)&LoadedImage,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-
- if (!EFI_ERROR(Status)) {
- ASSERT(LoadedImage->LoadOptionsSize == 0);
- if (CommandLine != NULL) {
- LoadedImage->LoadOptionsSize = (UINT32)StrSize(CommandLine);
- LoadedImage->LoadOptions = (VOID*)CommandLine;
- }
-
- //
- // Save our current environment settings for later restoration if necessary
- //
- if (Environment != NULL) {
- Status = GetEnvironmentVariableList(&OrigEnvs);
- if (!EFI_ERROR(Status)) {
- Status = SetEnvironmentVariables(Environment);
- }
- }
-
- //
- // Initialize and install a shell parameters protocol on the image.
- //
- ShellParamsProtocol.StdIn = ShellInfoObject.NewShellParametersProtocol->StdIn;
- ShellParamsProtocol.StdOut = ShellInfoObject.NewShellParametersProtocol->StdOut;
- ShellParamsProtocol.StdErr = ShellInfoObject.NewShellParametersProtocol->StdErr;
- Status = UpdateArgcArgv(&ShellParamsProtocol, CommandLine, NULL, NULL);
- ASSERT_EFI_ERROR(Status);
- Status = gBS->InstallProtocolInterface(&NewHandle, &gEfiShellParametersProtocolGuid, EFI_NATIVE_INTERFACE, &ShellParamsProtocol);
- ASSERT_EFI_ERROR(Status);
-
- ///@todo initialize and install ShellInterface protocol on the new image for compatibility if - PcdGetBool(PcdShellSupportOldProtocols)
-
- //
- // now start the image and if the caller wanted the return code pass it to them...
- //
- if (!EFI_ERROR(Status)) {
- if (StatusCode != NULL) {
- *StatusCode = gBS->StartImage(NewHandle, NULL, NULL);
- } else {
- Status = gBS->StartImage(NewHandle, NULL, NULL);
- }
- }
-
- //
- // Cleanup (and dont overwrite errors)
- //
- if (EFI_ERROR(Status)) {
- gBS->UninstallProtocolInterface(NewHandle, &gEfiShellParametersProtocolGuid, &ShellParamsProtocol);
- } else {
- Status = gBS->UninstallProtocolInterface(NewHandle, &gEfiShellParametersProtocolGuid, &ShellParamsProtocol);
- ASSERT_EFI_ERROR(Status);
- }
- }
-
- if (!IsListEmpty(&OrigEnvs)) {
- if (EFI_ERROR(Status)) {
- SetEnvironmentVariableList(&OrigEnvs);
- } else {
- Status = SetEnvironmentVariableList(&OrigEnvs);
- }
- }
-
- return(Status);
-}
-/**
- Execute the command line.
-
- This function creates a nested instance of the shell and executes the specified
- command (CommandLine) with the specified environment (Environment). Upon return,
- the status code returned by the specified command is placed in StatusCode.
-
- If Environment is NULL, then the current environment is used and all changes made
- by the commands executed will be reflected in the current environment. If the
- Environment is non-NULL, then the changes made will be discarded.
-
- The CommandLine is executed from the current working directory on the current
- device.
-
- @param ParentImageHandle A handle of the image that is executing the specified
- command line.
- @param CommandLine Points to the NULL-terminated UCS-2 encoded string
- containing the command line. If NULL then the command-
- line will be empty.
- @param Environment Points to a NULL-terminated array of environment
- variables with the format 'x=y', where x is the
- environment variable name and y is the value. If this
- is NULL, then the current shell environment is used.
- @param StatusCode Points to the status code returned by the command.
-
- @retval EFI_SUCCESS The command executed successfully. The status code
- returned by the command is pointed to by StatusCode.
- @retval EFI_INVALID_PARAMETER The parameters are invalid.
- @retval EFI_OUT_OF_RESOURCES Out of resources.
- @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
- @retval EFI_UNSUPPORTED The support level required for this function is not present.
-
- @sa InternalShellExecuteDevicePath
-**/
-EFI_STATUS
-EFIAPI
-EfiShellExecute(
- IN EFI_HANDLE *ParentImageHandle,
- IN CHAR16 *CommandLine OPTIONAL,
- IN CHAR16 **Environment OPTIONAL,
- OUT EFI_STATUS *StatusCode OPTIONAL
- )
-{
- EFI_STATUS Status;
- CHAR16 *Temp;
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- UINTN Size;
-
- if ((PcdGet8(PcdShellSupportLevel) < 1)) {
- return (EFI_UNSUPPORTED);
- }
-
- DevPath = AppendDevicePath (ShellInfoObject.ImageDevPath, ShellInfoObject.FileDevPath);
-
- DEBUG_CODE_BEGIN();
- Temp = ConvertDevicePathToText(ShellInfoObject.FileDevPath, TRUE, TRUE);
- FreePool(Temp);
- Temp = ConvertDevicePathToText(ShellInfoObject.ImageDevPath, TRUE, TRUE);
- FreePool(Temp);
- Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE);
- FreePool(Temp);
- DEBUG_CODE_END();
-
- Temp = NULL;
- Size = 0;
- ASSERT((Temp == NULL && Size == 0) || (Temp != NULL));
- StrnCatGrow(&Temp, &Size, L"Shell.efi ", 0);
- StrnCatGrow(&Temp, &Size, CommandLine, 0);
-
- Status = InternalShellExecuteDevicePath(
- ParentImageHandle,
- DevPath,
- Temp,
- (CONST CHAR16**)Environment,
- StatusCode);
-
- //
- // de-allocate and return
- //
- FreePool(DevPath);
- FreePool(Temp);
- return(Status);
-}
-
-/**
- Utility cleanup function for EFI_SHELL_FILE_INFO objects.
-
- 1) frees all pointers (non-NULL)
- 2) Closes the SHELL_FILE_HANDLE
-
- @param FileListNode pointer to the list node to free
-**/
-VOID
-EFIAPI
-InternalFreeShellFileInfoNode(
- IN EFI_SHELL_FILE_INFO *FileListNode
- )
-{
- if (FileListNode->Info != NULL) {
- FreePool((VOID*)FileListNode->Info);
- }
- if (FileListNode->FileName != NULL) {
- FreePool((VOID*)FileListNode->FileName);
- }
- if (FileListNode->FullName != NULL) {
- FreePool((VOID*)FileListNode->FullName);
- }
- if (FileListNode->Handle != NULL) {
- ShellInfoObject.NewEfiShellProtocol->CloseFile(FileListNode->Handle);
- }
- FreePool(FileListNode);
-}
-/**
- Frees the file list.
-
- This function cleans up the file list and any related data structures. It has no
- impact on the files themselves.
-
- @param FileList The file list to free. Type EFI_SHELL_FILE_INFO is
- defined in OpenFileList()
-
- @retval EFI_SUCCESS Free the file list successfully.
- @retval EFI_INVALID_PARAMETER FileList was NULL or *FileList was NULL;
-**/
-EFI_STATUS
-EFIAPI
-EfiShellFreeFileList(
- IN EFI_SHELL_FILE_INFO **FileList
- )
-{
- EFI_SHELL_FILE_INFO *ShellFileListItem;
-
- if (FileList == NULL || *FileList == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- for ( ShellFileListItem = (EFI_SHELL_FILE_INFO*)GetFirstNode(&(*FileList)->Link)
- ; !IsListEmpty(&(*FileList)->Link)
- ; ShellFileListItem = (EFI_SHELL_FILE_INFO*)GetFirstNode(&(*FileList)->Link)
- ){
- RemoveEntryList(&ShellFileListItem->Link);
- InternalFreeShellFileInfoNode(ShellFileListItem);
- }
- return(EFI_SUCCESS);
-}
-
-/**
- Deletes the duplicate file names files in the given file list.
-
- This function deletes the reduplicate files in the given file list.
-
- @param FileList A pointer to the first entry in the file list.
-
- @retval EFI_SUCCESS Always success.
- @retval EFI_INVALID_PARAMETER FileList was NULL or *FileList was NULL;
-**/
-EFI_STATUS
-EFIAPI
-EfiShellRemoveDupInFileList(
- IN EFI_SHELL_FILE_INFO **FileList
- )
-{
- EFI_SHELL_FILE_INFO *ShellFileListItem;
- EFI_SHELL_FILE_INFO *ShellFileListItem2;
-
- if (FileList == NULL || *FileList == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- for ( ShellFileListItem = (EFI_SHELL_FILE_INFO*)GetFirstNode(&(*FileList)->Link)
- ; !IsNull(&(*FileList)->Link, &ShellFileListItem->Link)
- ; ShellFileListItem = (EFI_SHELL_FILE_INFO*)GetNextNode(&(*FileList)->Link, &ShellFileListItem->Link)
- ){
- for ( ShellFileListItem2 = (EFI_SHELL_FILE_INFO*)GetNextNode(&(*FileList)->Link, &ShellFileListItem->Link)
- ; !IsNull(&(*FileList)->Link, &ShellFileListItem2->Link)
- ; ShellFileListItem2 = (EFI_SHELL_FILE_INFO*)GetNextNode(&(*FileList)->Link, &ShellFileListItem2->Link)
- ){
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)ShellFileListItem->FullName,
- (CHAR16*)ShellFileListItem2->FullName) == 0
- ){
- RemoveEntryList(&ShellFileListItem2->Link);
- InternalFreeShellFileInfoNode(ShellFileListItem2);
- }
- }
- }
- return (EFI_SUCCESS);
-}
-/**
- Allocates and duplicates a EFI_SHELL_FILE_INFO node.
-
- @param[in] Node The node to copy from.
- @param[in] Save TRUE to set Node->Handle to NULL, FALSE otherwise.
-
- @retval NULL a memory allocation error ocurred
- @return != NULL a pointer to the new node
-**/
-EFI_SHELL_FILE_INFO*
-EFIAPI
-InternalDuplicateShellFileInfo(
- IN EFI_SHELL_FILE_INFO *Node,
- IN BOOLEAN Save
- )
-{
- EFI_SHELL_FILE_INFO *NewNode;
-
- NewNode = AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));
- if (NewNode == NULL) {
- return (NULL);
- }
- NewNode->FullName = AllocateZeroPool(StrSize(Node->FullName));
-
- NewNode->FileName = AllocateZeroPool(StrSize(Node->FileName));
- NewNode->Info = AllocateZeroPool((UINTN)Node->Info->Size);
- if ( NewNode->FullName == NULL
- || NewNode->FileName == NULL
- || NewNode->Info == NULL
- ){
- return(NULL);
- }
- NewNode->Status = Node->Status;
- NewNode->Handle = Node->Handle;
- if (!Save) {
- Node->Handle = NULL;
- }
- StrCpy((CHAR16*)NewNode->FullName, Node->FullName);
- StrCpy((CHAR16*)NewNode->FileName, Node->FileName);
- CopyMem(NewNode->Info, Node->Info, (UINTN)Node->Info->Size);
-
- return(NewNode);
-}
-
-/**
- Allocates and populates a EFI_SHELL_FILE_INFO structure. if any memory operation
- failed it will return NULL.
-
- @param[in] BasePath the Path to prepend onto filename for FullPath
- @param[in] Status Status member initial value.
- @param[in] FullName FullName member initial value.
- @param[in] FileName FileName member initial value.
- @param[in] Handle Handle member initial value.
- @param[in] Info Info struct to copy.
-
- @retval NULL An error ocurred.
- @return a pointer to the newly allocated structure.
-**/
-EFI_SHELL_FILE_INFO *
-EFIAPI
-CreateAndPopulateShellFileInfo(
- IN CONST CHAR16 *BasePath,
- IN CONST EFI_STATUS Status,
- IN CONST CHAR16 *FullName,
- IN CONST CHAR16 *FileName,
- IN CONST SHELL_FILE_HANDLE Handle,
- IN CONST EFI_FILE_INFO *Info
- )
-{
- EFI_SHELL_FILE_INFO *ShellFileListItem;
- CHAR16 *TempString;
- UINTN Size;
-
- TempString = NULL;
- Size = 0;
-
- ShellFileListItem = AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));
- if (ShellFileListItem == NULL) {
- return (NULL);
- }
- if (Info != NULL && Info->Size != 0) {
- ShellFileListItem->Info = AllocateZeroPool((UINTN)Info->Size);
- if (ShellFileListItem->Info == NULL) {
- FreePool(ShellFileListItem);
- return (NULL);
- }
- CopyMem(ShellFileListItem->Info, Info, (UINTN)Info->Size);
- } else {
- ShellFileListItem->Info = NULL;
- }
- if (FileName != NULL) {
- ASSERT(TempString == NULL);
- ShellFileListItem->FileName = StrnCatGrow(&TempString, 0, FileName, 0);
- if (ShellFileListItem->FileName == NULL) {
- FreePool(ShellFileListItem->Info);
- FreePool(ShellFileListItem);
- return (NULL);
- }
- } else {
- ShellFileListItem->FileName = NULL;
- }
- Size = 0;
- TempString = NULL;
- if (BasePath != NULL) {
- ASSERT((TempString == NULL && Size == 0) || (TempString != NULL));
- TempString = StrnCatGrow(&TempString, &Size, BasePath, 0);
- if (TempString == NULL) {
- FreePool((VOID*)ShellFileListItem->FileName);
- FreePool(ShellFileListItem->Info);
- FreePool(ShellFileListItem);
- return (NULL);
- }
- }
- if (ShellFileListItem->FileName != NULL) {
- ASSERT((TempString == NULL && Size == 0) || (TempString != NULL));
- TempString = StrnCatGrow(&TempString, &Size, ShellFileListItem->FileName, 0);
- if (TempString == NULL) {
- FreePool((VOID*)ShellFileListItem->FileName);
- FreePool(ShellFileListItem->Info);
- FreePool(ShellFileListItem);
- return (NULL);
- }
- }
-
- ShellFileListItem->FullName = TempString;
- ShellFileListItem->Status = Status;
- ShellFileListItem->Handle = Handle;
-
- return (ShellFileListItem);
-}
-
-/**
- Find all files in a specified directory.
-
- @param FileDirHandle Handle of the directory to search.
- @param FileList On return, points to the list of files in the directory
- or NULL if there are no files in the directory.
-
- @retval EFI_SUCCESS File information was returned successfully.
- @retval EFI_VOLUME_CORRUPTED The file system structures have been corrupted.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_NO_MEDIA The device media is not present.
- @retval EFI_INVALID_PARAMETER The FileDirHandle was not a directory.
- @return An error from FileHandleGetFileName().
-**/
-EFI_STATUS
-EFIAPI
-EfiShellFindFilesInDir(
- IN SHELL_FILE_HANDLE FileDirHandle,
- OUT EFI_SHELL_FILE_INFO **FileList
- )
-{
- EFI_SHELL_FILE_INFO *ShellFileList;
- EFI_SHELL_FILE_INFO *ShellFileListItem;
- EFI_FILE_INFO *FileInfo;
- EFI_STATUS Status;
- BOOLEAN NoFile;
- CHAR16 *TempString;
- CHAR16 *BasePath;
- UINTN Size;
- CHAR16 *TempSpot;
-
- Status = FileHandleGetFileName(FileDirHandle, &BasePath);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- if (ShellFileHandleGetPath(FileDirHandle) != NULL) {
- TempString = NULL;
- Size = 0;
- TempString = StrnCatGrow(&TempString, &Size, ShellFileHandleGetPath(FileDirHandle), 0);
- if (TempString == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- TempSpot = StrStr(TempString, L";");
-
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
-
- TempString = StrnCatGrow(&TempString, &Size, BasePath, 0);
- if (TempString == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- BasePath = TempString;
- }
-
- NoFile = FALSE;
- ShellFileList = NULL;
- ShellFileListItem = NULL;
- FileInfo = NULL;
- Status = EFI_SUCCESS;
-
-
- for ( Status = FileHandleFindFirstFile(FileDirHandle, &FileInfo)
- ; !EFI_ERROR(Status) && !NoFile
- ; Status = FileHandleFindNextFile(FileDirHandle, FileInfo, &NoFile)
- ){
- TempString = NULL;
- Size = 0;
- //
- // allocate a new EFI_SHELL_FILE_INFO and populate it...
- //
- ASSERT((TempString == NULL && Size == 0) || (TempString != NULL));
- TempString = StrnCatGrow(&TempString, &Size, BasePath, 0);
- TempString = StrnCatGrow(&TempString, &Size, FileInfo->FileName, 0);
- ShellFileListItem = CreateAndPopulateShellFileInfo(
- BasePath,
- EFI_SUCCESS, // success since we didnt fail to open it...
- TempString,
- FileInfo->FileName,
- NULL, // no handle since not open
- FileInfo);
-
- if (ShellFileList == NULL) {
- ShellFileList = (EFI_SHELL_FILE_INFO*)AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));
- ASSERT(ShellFileList != NULL);
- InitializeListHead(&ShellFileList->Link);
- }
- InsertTailList(&ShellFileList->Link, &ShellFileListItem->Link);
- }
- if (EFI_ERROR(Status)) {
- EfiShellFreeFileList(&ShellFileList);
- *FileList = NULL;
- } else {
- *FileList = ShellFileList;
- }
- SHELL_FREE_NON_NULL(BasePath);
- return(Status);
-}
-
-/**
- Updates a file name to be preceeded by the mapped drive name
-
- @param[in] BasePath the Mapped drive name to prepend
- @param[in, out] Path pointer to pointer to the file name to update.
-
- @retval EFI_SUCCESS
- @retval EFI_OUT_OF_RESOURCES
-**/
-EFI_STATUS
-EFIAPI
-UpdateFileName(
- IN CONST CHAR16 *BasePath,
- IN OUT CHAR16 **Path
- )
-{
- CHAR16 *Path2;
- UINTN Path2Size;
-
- Path2Size = 0;
- Path2 = NULL;
-
- ASSERT(Path != NULL);
- ASSERT(*Path != NULL);
- ASSERT(BasePath != NULL);
-
- //
- // convert a local path to an absolute path
- //
- if (StrStr(*Path, L":") == NULL) {
- ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));
- StrnCatGrow(&Path2, &Path2Size, BasePath, 0);
- if (Path2 == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));
- StrnCatGrow(&Path2, &Path2Size, (*Path)[0] == L'\\'?(*Path) + 1 :*Path, 0);
- if (Path2 == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- }
-
- FreePool(*Path);
- (*Path) = Path2;
-
- return (EFI_SUCCESS);
-}
-
-/**
- If FileHandle is a directory then the function reads from FileHandle and reads in
- each of the FileInfo structures. If one of them matches the Pattern's first
- "level" then it opens that handle and calls itself on that handle.
-
- If FileHandle is a file and matches all of the remaining Pattern (which would be
- on its last node), then add a EFI_SHELL_FILE_INFO object for this file to fileList.
-
- Upon a EFI_SUCCESS return fromt he function any the caller is responsible to call
- FreeFileList with FileList.
-
- @param[in] FilePattern The FilePattern to check against.
- @param[in] UnicodeCollation The pointer to EFI_UNICODE_COLLATION_PROTOCOL structure
- @param[in] FileHandle The FileHandle to start with
- @param[in, out] FileList pointer to pointer to list of found files.
- @param[in] ParentNode The node for the parent. Same file as identified by HANDLE.
- @param[in] MapName The file system name this file is on.
-
- @retval EFI_SUCCESS all files were found and the FileList contains a list.
- @retval EFI_NOT_FOUND no files were found
- @retval EFI_OUT_OF_RESOURCES a memory allocation failed
-**/
-EFI_STATUS
-EFIAPI
-ShellSearchHandle(
- IN CONST CHAR16 *FilePattern,
- IN EFI_UNICODE_COLLATION_PROTOCOL *UnicodeCollation,
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT EFI_SHELL_FILE_INFO **FileList,
- IN CONST EFI_SHELL_FILE_INFO *ParentNode OPTIONAL,
- IN CONST CHAR16 *MapName
- )
-{
- EFI_STATUS Status;
- CONST CHAR16 *NextFilePatternStart;
- CHAR16 *CurrentFilePattern;
- EFI_SHELL_FILE_INFO *ShellInfo;
- EFI_SHELL_FILE_INFO *ShellInfoNode;
- EFI_SHELL_FILE_INFO *NewShellNode;
- BOOLEAN Directory;
- CHAR16 *NewFullName;
- UINTN Size;
-
- if ( FilePattern == NULL
- || UnicodeCollation == NULL
- || FileList == NULL
- ){
- return (EFI_INVALID_PARAMETER);
- }
- ShellInfo = NULL;
- CurrentFilePattern = NULL;
-
- if (*FilePattern == L'\\') {
- FilePattern++;
- }
-
- for( NextFilePatternStart = FilePattern
- ; *NextFilePatternStart != CHAR_NULL && *NextFilePatternStart != L'\\'
- ; NextFilePatternStart++);
-
- CurrentFilePattern = AllocateZeroPool((NextFilePatternStart-FilePattern+1)*sizeof(CHAR16));
- ASSERT(CurrentFilePattern != NULL);
- StrnCpy(CurrentFilePattern, FilePattern, NextFilePatternStart-FilePattern);
-
- if (CurrentFilePattern[0] == CHAR_NULL
- &&NextFilePatternStart[0] == CHAR_NULL
- ){
- //
- // Add the current parameter FileHandle to the list, then end...
- //
- if (ParentNode == NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- NewShellNode = InternalDuplicateShellFileInfo((EFI_SHELL_FILE_INFO*)ParentNode, TRUE);
- if (NewShellNode == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- NewShellNode->Handle = NULL;
- if (*FileList == NULL) {
- *FileList = AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));
- InitializeListHead(&((*FileList)->Link));
- }
-
- //
- // Add to the returning to use list
- //
- InsertTailList(&(*FileList)->Link, &NewShellNode->Link);
-
- Status = EFI_SUCCESS;
- }
- }
- } else {
- Status = EfiShellFindFilesInDir(FileHandle, &ShellInfo);
-
- if (!EFI_ERROR(Status)){
- if (StrStr(NextFilePatternStart, L"\\") != NULL){
- Directory = TRUE;
- } else {
- Directory = FALSE;
- }
- for ( ShellInfoNode = (EFI_SHELL_FILE_INFO*)GetFirstNode(&ShellInfo->Link)
- ; !IsNull (&ShellInfo->Link, &ShellInfoNode->Link)
- ; ShellInfoNode = (EFI_SHELL_FILE_INFO*)GetNextNode(&ShellInfo->Link, &ShellInfoNode->Link)
- ){
- if (UnicodeCollation->MetaiMatch(UnicodeCollation, (CHAR16*)ShellInfoNode->FileName, CurrentFilePattern)){
- if (ShellInfoNode->FullName != NULL && StrStr(ShellInfoNode->FullName, L":") == NULL) {
- Size = StrSize(ShellInfoNode->FullName);
- Size += StrSize(MapName) + sizeof(CHAR16);
- NewFullName = AllocateZeroPool(Size);
- if (NewFullName == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- StrCpy(NewFullName, MapName);
- StrCat(NewFullName, ShellInfoNode->FullName+1);
- FreePool((VOID*)ShellInfoNode->FullName);
- ShellInfoNode->FullName = NewFullName;
- }
- }
- if (Directory && !EFI_ERROR(Status) && ShellInfoNode->FullName != NULL && ShellInfoNode->FileName != NULL){
- //
- // should be a directory
- //
-
- //
- // don't open the . and .. directories
- //
- if ( (StrCmp(ShellInfoNode->FileName, L".") != 0)
- && (StrCmp(ShellInfoNode->FileName, L"..") != 0)
- ){
- //
- //
- //
- if (EFI_ERROR(Status)) {
- break;
- }
- //
- // Open the directory since we need that handle in the next recursion.
- //
- ShellInfoNode->Status = EfiShellOpenFileByName (ShellInfoNode->FullName, &ShellInfoNode->Handle, EFI_FILE_MODE_READ);
-
- //
- // recurse with the next part of the pattern
- //
- Status = ShellSearchHandle(NextFilePatternStart, UnicodeCollation, ShellInfoNode->Handle, FileList, ShellInfoNode, MapName);
- }
- } else if (!EFI_ERROR(Status)) {
- //
- // should be a file
- //
-
- //
- // copy the information we need into a new Node
- //
- NewShellNode = InternalDuplicateShellFileInfo(ShellInfoNode, FALSE);
- ASSERT(NewShellNode != NULL);
- if (NewShellNode == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- }
- if (*FileList == NULL) {
- *FileList = AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));
- InitializeListHead(&((*FileList)->Link));
- }
-
- //
- // Add to the returning to use list
- //
- InsertTailList(&(*FileList)->Link, &NewShellNode->Link);
- }
- }
- if (EFI_ERROR(Status)) {
- break;
- }
- }
- if (EFI_ERROR(Status)) {
- EfiShellFreeFileList(&ShellInfo);
- } else {
- Status = EfiShellFreeFileList(&ShellInfo);
- }
- }
- }
-
- FreePool(CurrentFilePattern);
- return (Status);
-}
-
-/**
- Find files that match a specified pattern.
-
- This function searches for all files and directories that match the specified
- FilePattern. The FilePattern can contain wild-card characters. The resulting file
- information is placed in the file list FileList.
-
- Wildcards are processed
- according to the rules specified in UEFI Shell 2.0 spec section 3.7.1.
-
- The files in the file list are not opened. The OpenMode field is set to 0 and the FileInfo
- field is set to NULL.
-
- if *FileList is not NULL then it must be a pre-existing and properly initialized list.
-
- @param FilePattern Points to a NULL-terminated shell file path, including wildcards.
- @param FileList On return, points to the start of a file list containing the names
- of all matching files or else points to NULL if no matching files
- were found. only on a EFI_SUCCESS return will; this be non-NULL.
-
- @retval EFI_SUCCESS Files found. FileList is a valid list.
- @retval EFI_NOT_FOUND No files found.
- @retval EFI_NO_MEDIA The device has no media
- @retval EFI_DEVICE_ERROR The device reported an error
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted
-**/
-EFI_STATUS
-EFIAPI
-EfiShellFindFiles(
- IN CONST CHAR16 *FilePattern,
- OUT EFI_SHELL_FILE_INFO **FileList
- )
-{
- EFI_STATUS Status;
- CHAR16 *PatternCopy;
- CHAR16 *PatternCurrentLocation;
- EFI_DEVICE_PATH_PROTOCOL *RootDevicePath;
- SHELL_FILE_HANDLE RootFileHandle;
- CHAR16 *MapName;
- UINTN Count;
-
- if ( FilePattern == NULL
- || FileList == NULL
- || StrStr(FilePattern, L":") == NULL
- ){
- return (EFI_INVALID_PARAMETER);
- }
- Status = EFI_SUCCESS;
- RootDevicePath = NULL;
- RootFileHandle = NULL;
- MapName = NULL;
- PatternCopy = AllocateZeroPool(StrSize(FilePattern));
- if (PatternCopy == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- StrCpy(PatternCopy, FilePattern);
-
- PatternCopy = PathCleanUpDirectories(PatternCopy);
-
- Count = StrStr(PatternCopy, L":") - PatternCopy;
- Count += 2;
-
- ASSERT(MapName == NULL);
- MapName = StrnCatGrow(&MapName, NULL, PatternCopy, Count);
- if (MapName == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- RootDevicePath = EfiShellGetDevicePathFromFilePath(PatternCopy);
- if (RootDevicePath == NULL) {
- Status = EFI_INVALID_PARAMETER;
- } else {
- Status = EfiShellOpenRoot(RootDevicePath, &RootFileHandle);
- if (!EFI_ERROR(Status)) {
- for ( PatternCurrentLocation = PatternCopy
- ; *PatternCurrentLocation != ':'
- ; PatternCurrentLocation++);
- PatternCurrentLocation++;
- Status = ShellSearchHandle(PatternCurrentLocation, gUnicodeCollation, RootFileHandle, FileList, NULL, MapName);
- }
- FreePool(RootDevicePath);
- }
- }
-
- SHELL_FREE_NON_NULL(PatternCopy);
- SHELL_FREE_NON_NULL(MapName);
-
- return(Status);
-}
-
-/**
- Opens the files that match the path specified.
-
- This function opens all of the files specified by Path. Wildcards are processed
- according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
- matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.
-
- @param Path A pointer to the path string.
- @param OpenMode Specifies the mode used to open each file, EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE.
- @param FileList Points to the start of a list of files opened.
-
- @retval EFI_SUCCESS Create the file list successfully.
- @return Others Can't create the file list.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellOpenFileList(
- IN CHAR16 *Path,
- IN UINT64 OpenMode,
- IN OUT EFI_SHELL_FILE_INFO **FileList
- )
-{
- EFI_STATUS Status;
- EFI_SHELL_FILE_INFO *ShellFileListItem;
- CHAR16 *Path2;
- UINTN Path2Size;
- CONST CHAR16 *CurDir;
- BOOLEAN Found;
-
- PathCleanUpDirectories(Path);
-
- Path2Size = 0;
- Path2 = NULL;
-
- if (FileList == NULL || *FileList == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- if (*Path == L'.' && *(Path+1) == L'\\') {
- Path+=2;
- }
-
- //
- // convert a local path to an absolute path
- //
- if (StrStr(Path, L":") == NULL) {
- CurDir = EfiShellGetCurDir(NULL);
- ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));
- StrnCatGrow(&Path2, &Path2Size, CurDir, 0);
- if (*Path == L'\\') {
- Path++;
- while (PathRemoveLastItem(Path2)) ;
- }
- ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));
- StrnCatGrow(&Path2, &Path2Size, Path, 0);
- } else {
- ASSERT(Path2 == NULL);
- StrnCatGrow(&Path2, NULL, Path, 0);
- }
-
- PathCleanUpDirectories (Path2);
-
- //
- // do the search
- //
- Status = EfiShellFindFiles(Path2, FileList);
-
- FreePool(Path2);
-
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- Found = FALSE;
- //
- // We had no errors so open all the files (that are not already opened...)
- //
- for ( ShellFileListItem = (EFI_SHELL_FILE_INFO*)GetFirstNode(&(*FileList)->Link)
- ; !IsNull(&(*FileList)->Link, &ShellFileListItem->Link)
- ; ShellFileListItem = (EFI_SHELL_FILE_INFO*)GetNextNode(&(*FileList)->Link, &ShellFileListItem->Link)
- ){
- if (ShellFileListItem->Status == 0 && ShellFileListItem->Handle == NULL) {
- ShellFileListItem->Status = EfiShellOpenFileByName (ShellFileListItem->FullName, &ShellFileListItem->Handle, OpenMode);
- Found = TRUE;
- }
- }
-
- if (!Found) {
- return (EFI_NOT_FOUND);
- }
- return(EFI_SUCCESS);
-}
-
-/**
- This function updated with errata.
-
- Gets either a single or list of environment variables.
-
- If name is not NULL then this function returns the current value of the specified
- environment variable.
-
- If Name is NULL, then a list of all environment variable names is returned. Each is a
- NULL terminated string with a double NULL terminating the list.
-
- @param Name A pointer to the environment variable name. If
- Name is NULL, then the function will return all
- of the defined shell environment variables. In
- the case where multiple environment variables are
- being returned, each variable will be terminated by
- a NULL, and the list will be terminated by a double
- NULL.
-
- @return !=NULL A pointer to the returned string.
- The returned pointer does not need to be freed by the caller.
-
- @retval NULL The environment variable doesn't exist or there are
- no environment variables.
-**/
-CONST CHAR16 *
-EFIAPI
-EfiShellGetEnv(
- IN CONST CHAR16 *Name
- )
-{
- EFI_STATUS Status;
- VOID *Buffer;
- UINTN Size;
- LIST_ENTRY List;
- ENV_VAR_LIST *Node;
- CHAR16 *CurrentWriteLocation;
-
- Size = 0;
- Buffer = NULL;
-
- if (Name == NULL) {
- //
- // Get all our environment variables
- //
- InitializeListHead(&List);
- Status = GetEnvironmentVariableList(&List);
- if (EFI_ERROR(Status)){
- return (NULL);
- }
-
- //
- // Build the semi-colon delimited list. (2 passes)
- //
- for ( Node = (ENV_VAR_LIST*)GetFirstNode(&List)
- ; !IsNull(&List, &Node->Link)
- ; Node = (ENV_VAR_LIST*)GetNextNode(&List, &Node->Link)
- ){
- ASSERT(Node->Key != NULL);
- Size += StrSize(Node->Key);
- }
-
- Size += 2*sizeof(CHAR16);
-
- Buffer = AllocateZeroPool(Size);
- if (Buffer == NULL) {
- if (!IsListEmpty (&List)) {
- FreeEnvironmentVariableList(&List);
- }
- return (NULL);
- }
- CurrentWriteLocation = (CHAR16*)Buffer;
-
- for ( Node = (ENV_VAR_LIST*)GetFirstNode(&List)
- ; !IsNull(&List, &Node->Link)
- ; Node = (ENV_VAR_LIST*)GetNextNode(&List, &Node->Link)
- ){
- ASSERT(Node->Key != NULL);
- StrCpy(CurrentWriteLocation, Node->Key);
- CurrentWriteLocation += StrLen(CurrentWriteLocation) + 1;
- }
-
- //
- // Free the list...
- //
- if (!IsListEmpty (&List)) {
- FreeEnvironmentVariableList(&List);
- }
- } else {
- //
- // We are doing a specific environment variable
- //
-
- //
- // get the size we need for this EnvVariable
- //
- Status = SHELL_GET_ENVIRONMENT_VARIABLE(Name, &Size, Buffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- //
- // Allocate the space and recall the get function
- //
- Buffer = AllocateZeroPool(Size);
- ASSERT(Buffer != NULL);
- Status = SHELL_GET_ENVIRONMENT_VARIABLE(Name, &Size, Buffer);
- }
- //
- // we didnt get it (might not exist)
- // free the memory if we allocated any and return NULL
- //
- if (EFI_ERROR(Status)) {
- if (Buffer != NULL) {
- FreePool(Buffer);
- }
- return (NULL);
- }
- }
-
- //
- // return the buffer
- //
- return (AddBufferToFreeList(Buffer));
-}
-
-/**
- Internal variable setting function. Allows for setting of the read only variables.
-
- @param Name Points to the NULL-terminated environment variable name.
- @param Value Points to the NULL-terminated environment variable value. If the value is an
- empty string then the environment variable is deleted.
- @param Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
-
- @retval EFI_SUCCESS The environment variable was successfully updated.
-**/
-EFI_STATUS
-EFIAPI
-InternalEfiShellSetEnv(
- IN CONST CHAR16 *Name,
- IN CONST CHAR16 *Value,
- IN BOOLEAN Volatile
- )
-{
- if (Value == NULL || StrLen(Value) == 0) {
- return (SHELL_DELETE_ENVIRONMENT_VARIABLE(Name));
- } else {
- SHELL_DELETE_ENVIRONMENT_VARIABLE(Name);
- if (Volatile) {
- return (SHELL_SET_ENVIRONMENT_VARIABLE_V(Name, StrSize(Value), Value));
- } else {
- return (SHELL_SET_ENVIRONMENT_VARIABLE_NV(Name, StrSize(Value), Value));
- }
- }
-}
-
-/**
- Sets the environment variable.
-
- This function changes the current value of the specified environment variable. If the
- environment variable exists and the Value is an empty string, then the environment
- variable is deleted. If the environment variable exists and the Value is not an empty
- string, then the value of the environment variable is changed. If the environment
- variable does not exist and the Value is an empty string, there is no action. If the
- environment variable does not exist and the Value is a non-empty string, then the
- environment variable is created and assigned the specified value.
-
- For a description of volatile and non-volatile environment variables, see UEFI Shell
- 2.0 specification section 3.6.1.
-
- @param Name Points to the NULL-terminated environment variable name.
- @param Value Points to the NULL-terminated environment variable value. If the value is an
- empty string then the environment variable is deleted.
- @param Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
-
- @retval EFI_SUCCESS The environment variable was successfully updated.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellSetEnv(
- IN CONST CHAR16 *Name,
- IN CONST CHAR16 *Value,
- IN BOOLEAN Volatile
- )
-{
- if (Name == NULL || *Name == CHAR_NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- //
- // Make sure we dont 'set' a predefined read only variable
- //
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)Name,
- L"cwd") == 0
- ||gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)Name,
- L"Lasterror") == 0
- ||gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)Name,
- L"profiles") == 0
- ||gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)Name,
- L"uefishellsupport") == 0
- ||gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)Name,
- L"uefishellversion") == 0
- ||gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)Name,
- L"uefiversion") == 0
- ){
- return (EFI_INVALID_PARAMETER);
- }
- return (InternalEfiShellSetEnv(Name, Value, Volatile));
-}
-
-/**
- Returns the current directory on the specified device.
-
- If FileSystemMapping is NULL, it returns the current working directory. If the
- FileSystemMapping is not NULL, it returns the current directory associated with the
- FileSystemMapping. In both cases, the returned name includes the file system
- mapping (i.e. fs0:\current-dir).
-
- @param FileSystemMapping A pointer to the file system mapping. If NULL,
- then the current working directory is returned.
-
- @retval !=NULL The current directory.
- @retval NULL Current directory does not exist.
-**/
-CONST CHAR16 *
-EFIAPI
-EfiShellGetCurDir(
- IN CONST CHAR16 *FileSystemMapping OPTIONAL
- )
-{
- CHAR16 *PathToReturn;
- UINTN Size;
- SHELL_MAP_LIST *MapListItem;
- if (!IsListEmpty(&gShellMapList.Link)) {
- //
- // if parameter is NULL, use current
- //
- if (FileSystemMapping == NULL) {
- return (EfiShellGetEnv(L"cwd"));
- } else {
- Size = 0;
- PathToReturn = NULL;
- MapListItem = ShellCommandFindMapItem(FileSystemMapping);
- if (MapListItem != NULL) {
- ASSERT((PathToReturn == NULL && Size == 0) || (PathToReturn != NULL));
- PathToReturn = StrnCatGrow(&PathToReturn, &Size, MapListItem->MapName, 0);
- PathToReturn = StrnCatGrow(&PathToReturn, &Size, MapListItem->CurrentDirectoryPath, 0);
- }
- }
- return (AddBufferToFreeList(PathToReturn));
- } else {
- return (NULL);
- }
-}
-
-/**
- Changes the current directory on the specified device.
-
- If the FileSystem is NULL, and the directory Dir does not contain a file system's
- mapped name, this function changes the current working directory.
-
- If the FileSystem is NULL and the directory Dir contains a mapped name, then the
- current file system and the current directory on that file system are changed.
-
- If FileSystem is NULL, and Dir is not NULL, then this changes the current working file
- system.
-
- If FileSystem is not NULL and Dir is not NULL, then this function changes the current
- directory on the specified file system.
-
- If the current working directory or the current working file system is changed then the
- %cwd% environment variable will be updated
-
- @param FileSystem A pointer to the file system's mapped name. If NULL, then the current working
- directory is changed.
- @param Dir Points to the NULL-terminated directory on the device specified by FileSystem.
-
- @retval EFI_SUCCESS The operation was sucessful
- @retval EFI_NOT_FOUND The file system could not be found
-**/
-EFI_STATUS
-EFIAPI
-EfiShellSetCurDir(
- IN CONST CHAR16 *FileSystem OPTIONAL,
- IN CONST CHAR16 *Dir
- )
-{
- CHAR16 *MapName;
- SHELL_MAP_LIST *MapListItem;
- UINTN Size;
- EFI_STATUS Status;
- CHAR16 *TempString;
- CHAR16 *DirectoryName;
- UINTN TempLen;
-
- Size = 0;
- MapName = NULL;
- MapListItem = NULL;
- TempString = NULL;
- DirectoryName = NULL;
-
- if ((FileSystem == NULL && Dir == NULL) || Dir == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- if (IsListEmpty(&gShellMapList.Link)){
- return (EFI_NOT_FOUND);
- }
-
- DirectoryName = StrnCatGrow(&DirectoryName, NULL, Dir, 0);
- ASSERT(DirectoryName != NULL);
-
- PathCleanUpDirectories(DirectoryName);
-
- if (FileSystem == NULL) {
- //
- // determine the file system mapping to use
- //
- if (StrStr(DirectoryName, L":") != NULL) {
- ASSERT(MapName == NULL);
- MapName = StrnCatGrow(&MapName, NULL, DirectoryName, (StrStr(DirectoryName, L":")-DirectoryName+1));
- }
- //
- // find the file system mapping's entry in the list
- // or use current
- //
- if (MapName != NULL) {
- MapListItem = ShellCommandFindMapItem(MapName);
-
- //
- // make that the current file system mapping
- //
- if (MapListItem != NULL) {
- gShellCurDir = MapListItem;
- }
- } else {
- MapListItem = gShellCurDir;
- }
-
- if (MapListItem == NULL) {
- return (EFI_NOT_FOUND);
- }
-
- //
- // now update the MapListItem's current directory
- //
- if (MapListItem->CurrentDirectoryPath != NULL && DirectoryName[StrLen(DirectoryName) - 1] != L':') {
- FreePool(MapListItem->CurrentDirectoryPath);
- MapListItem->CurrentDirectoryPath = NULL;
- }
- if (MapName != NULL) {
- TempLen = StrLen(MapName);
- if (TempLen != StrLen(DirectoryName)) {
- ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL));
- MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, DirectoryName+StrLen(MapName), 0);
- }
- } else {
- ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL));
- MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, DirectoryName, 0);
- }
- if ((MapListItem->CurrentDirectoryPath != NULL && MapListItem->CurrentDirectoryPath[StrLen(MapListItem->CurrentDirectoryPath)-1] != L'\\') || (MapListItem->CurrentDirectoryPath == NULL)) {
- ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL));
- MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, L"\\", 0);
- }
- } else {
- //
- // cant have a mapping in the directory...
- //
- if (StrStr(DirectoryName, L":") != NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- //
- // FileSystem != NULL
- //
- MapListItem = ShellCommandFindMapItem(FileSystem);
- if (MapListItem == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-// gShellCurDir = MapListItem;
- if (DirectoryName != NULL) {
- //
- // change current dir on that file system
- //
-
- if (MapListItem->CurrentDirectoryPath != NULL) {
- FreePool(MapListItem->CurrentDirectoryPath);
- DEBUG_CODE(MapListItem->CurrentDirectoryPath = NULL;);
- }
-// ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL));
-// MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, FileSystem, 0);
- ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL));
- MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, L"\\", 0);
- ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL));
- MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, DirectoryName, 0);
- if (MapListItem->CurrentDirectoryPath != NULL && MapListItem->CurrentDirectoryPath[StrLen(MapListItem->CurrentDirectoryPath)-1] != L'\\') {
- ASSERT((MapListItem->CurrentDirectoryPath == NULL && Size == 0) || (MapListItem->CurrentDirectoryPath != NULL));
- MapListItem->CurrentDirectoryPath = StrnCatGrow(&MapListItem->CurrentDirectoryPath, &Size, L"\\", 0);
- }
- }
- }
- //
- // if updated the current directory then update the environment variable
- //
- if (MapListItem == gShellCurDir) {
- Size = 0;
- ASSERT((TempString == NULL && Size == 0) || (TempString != NULL));
- StrnCatGrow(&TempString, &Size, MapListItem->MapName, 0);
- ASSERT((TempString == NULL && Size == 0) || (TempString != NULL));
- StrnCatGrow(&TempString, &Size, MapListItem->CurrentDirectoryPath, 0);
- Status = InternalEfiShellSetEnv(L"cwd", TempString, TRUE);
- FreePool(TempString);
- return (Status);
- }
- return(EFI_SUCCESS);
-}
-
-/**
- Return help information about a specific command.
-
- This function returns the help information for the specified command. The help text
- can be internal to the shell or can be from a UEFI Shell manual page.
-
- If Sections is specified, then each section name listed will be compared in a casesensitive
- manner, to the section names described in Appendix B. If the section exists,
- it will be appended to the returned help text. If the section does not exist, no
- information will be returned. If Sections is NULL, then all help text information
- available will be returned.
-
- @param Command Points to the NULL-terminated UEFI Shell command name.
- @param Sections Points to the NULL-terminated comma-delimited
- section names to return. If NULL, then all
- sections will be returned.
- @param HelpText On return, points to a callee-allocated buffer
- containing all specified help text.
-
- @retval EFI_SUCCESS The help text was returned.
- @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
- returned help text.
- @retval EFI_INVALID_PARAMETER HelpText is NULL
- @retval EFI_NOT_FOUND There is no help text available for Command.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellGetHelpText(
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Sections OPTIONAL,
- OUT CHAR16 **HelpText
- )
-{
- CONST CHAR16 *ManFileName;
-
- ASSERT(HelpText != NULL);
-
- ManFileName = ShellCommandGetManFileNameHandler(Command);
-
- if (ManFileName != NULL) {
- return (ProcessManFile(ManFileName, Command, Sections, NULL, HelpText));
- } else {
- return (ProcessManFile(Command, Command, Sections, NULL, HelpText));
- }
-}
-
-/**
- Gets the enable status of the page break output mode.
-
- User can use this function to determine current page break mode.
-
- @retval TRUE The page break output mode is enabled.
- @retval FALSE The page break output mode is disabled.
-**/
-BOOLEAN
-EFIAPI
-EfiShellGetPageBreak(
- VOID
- )
-{
- return(ShellInfoObject.PageBreakEnabled);
-}
-
-/**
- Judges whether the active shell is the root shell.
-
- This function makes the user to know that whether the active Shell is the root shell.
-
- @retval TRUE The active Shell is the root Shell.
- @retval FALSE The active Shell is NOT the root Shell.
-**/
-BOOLEAN
-EFIAPI
-EfiShellIsRootShell(
- VOID
- )
-{
- return(ShellInfoObject.RootShellInstance);
-}
-
-/**
- function to return a semi-colon delimeted list of all alias' in the current shell
-
- up to caller to free the memory.
-
- @retval NULL No alias' were found
- @retval NULL An error ocurred getting alias'
- @return !NULL a list of all alias'
-**/
-CHAR16 *
-EFIAPI
-InternalEfiShellGetListAlias(
- )
-{
- UINT64 MaxStorSize;
- UINT64 RemStorSize;
- UINT64 MaxVarSize;
- EFI_STATUS Status;
- EFI_GUID Guid;
- CHAR16 *VariableName;
- UINTN NameSize;
- CHAR16 *RetVal;
- UINTN RetSize;
-
- Status = gRT->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS, &MaxStorSize, &RemStorSize, &MaxVarSize);
- ASSERT_EFI_ERROR(Status);
-
- VariableName = AllocateZeroPool((UINTN)MaxVarSize);
- RetSize = 0;
- RetVal = NULL;
-
- if (VariableName == NULL) {
- return (NULL);
- }
-
- VariableName[0] = CHAR_NULL;
-
- while (TRUE) {
- NameSize = (UINTN)MaxVarSize;
- Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid);
- if (Status == EFI_NOT_FOUND){
- break;
- }
- ASSERT_EFI_ERROR(Status);
- if (EFI_ERROR(Status)) {
- break;
- }
- if (CompareGuid(&Guid, &gShellAliasGuid)){
- ASSERT((RetVal == NULL && RetSize == 0) || (RetVal != NULL));
- RetVal = StrnCatGrow(&RetVal, &RetSize, VariableName, 0);
- RetVal = StrnCatGrow(&RetVal, &RetSize, L";", 0);
- } // compare guid
- } // while
- FreePool(VariableName);
-
- return (RetVal);
-}
-
-/**
- This function returns the command associated with a alias or a list of all
- alias'.
-
- @param[in] Alias Points to the NULL-terminated shell alias.
- If this parameter is NULL, then all
- aliases will be returned in ReturnedData.
- @param[out] Volatile upon return of a single command if TRUE indicates
- this is stored in a volatile fashion. FALSE otherwise.
-
- @return If Alias is not NULL, it will return a pointer to
- the NULL-terminated command for that alias.
- If Alias is NULL, ReturnedData points to a ';'
- delimited list of alias (e.g.
- ReturnedData = "dir;del;copy;mfp") that is NULL-terminated.
- @retval NULL an error ocurred
- @retval NULL Alias was not a valid Alias
-**/
-CONST CHAR16 *
-EFIAPI
-EfiShellGetAlias(
- IN CONST CHAR16 *Alias,
- OUT BOOLEAN *Volatile OPTIONAL
- )
-{
- CHAR16 *RetVal;
- UINTN RetSize;
- UINT32 Attribs;
- EFI_STATUS Status;
-
- if (Alias != NULL) {
- if (Volatile == NULL) {
- return (AddBufferToFreeList(GetVariable((CHAR16*)Alias, &gShellAliasGuid)));
- }
- RetSize = 0;
- RetVal = NULL;
- Status = gRT->GetVariable((CHAR16*)Alias, &gShellAliasGuid, &Attribs, &RetSize, RetVal);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- RetVal = AllocateZeroPool(RetSize);
- Status = gRT->GetVariable((CHAR16*)Alias, &gShellAliasGuid, &Attribs, &RetSize, RetVal);
- }
- if (EFI_ERROR(Status)) {
- if (RetVal != NULL) {
- FreePool(RetVal);
- }
- return (NULL);
- }
- if ((EFI_VARIABLE_NON_VOLATILE & Attribs) == EFI_VARIABLE_NON_VOLATILE) {
- *Volatile = FALSE;
- } else {
- *Volatile = TRUE;
- }
-
- return (AddBufferToFreeList(RetVal));
- }
- return (AddBufferToFreeList(InternalEfiShellGetListAlias()));
-}
-
-/**
- Changes a shell command alias.
-
- This function creates an alias for a shell command or if Alias is NULL it will delete an existing alias.
-
- this function does not check for built in alias'.
-
- @param[in] Command Points to the NULL-terminated shell command or existing alias.
- @param[in] Alias Points to the NULL-terminated alias for the shell command. If this is NULL, and
- Command refers to an alias, that alias will be deleted.
- @param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the
- Alias being set will be stored in a non-volatile fashion.
-
- @retval EFI_SUCCESS Alias created or deleted successfully.
- @retval EFI_NOT_FOUND the Alias intended to be deleted was not found
-**/
-EFI_STATUS
-EFIAPI
-InternalSetAlias(
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Alias,
- IN BOOLEAN Volatile
- )
-{
- //
- // We must be trying to remove one if Alias is NULL
- //
- if (Alias == NULL) {
- //
- // remove an alias (but passed in COMMAND parameter)
- //
- return (gRT->SetVariable((CHAR16*)Command, &gShellAliasGuid, 0, 0, NULL));
- } else {
- //
- // Add and replace are the same
- //
-
- // We dont check the error return on purpose since the variable may not exist.
- gRT->SetVariable((CHAR16*)Command, &gShellAliasGuid, 0, 0, NULL);
-
- return (gRT->SetVariable((CHAR16*)Alias, &gShellAliasGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS|(Volatile?0:EFI_VARIABLE_NON_VOLATILE), StrSize(Command), (VOID*)Command));
- }
-}
-
-/**
- Changes a shell command alias.
-
- This function creates an alias for a shell command or if Alias is NULL it will delete an existing alias.
-
-
- @param[in] Command Points to the NULL-terminated shell command or existing alias.
- @param[in] Alias Points to the NULL-terminated alias for the shell command. If this is NULL, and
- Command refers to an alias, that alias will be deleted.
- @param[in] Replace If TRUE and the alias already exists, then the existing alias will be replaced. If
- FALSE and the alias already exists, then the existing alias is unchanged and
- EFI_ACCESS_DENIED is returned.
- @param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the
- Alias being set will be stored in a non-volatile fashion.
-
- @retval EFI_SUCCESS Alias created or deleted successfully.
- @retval EFI_NOT_FOUND the Alias intended to be deleted was not found
- @retval EFI_ACCESS_DENIED The alias is a built-in alias or already existed and Replace was set to
- FALSE.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellSetAlias(
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Alias,
- IN BOOLEAN Replace,
- IN BOOLEAN Volatile
- )
-{
- //
- // cant set over a built in alias
- //
- if (ShellCommandIsOnAliasList(Alias==NULL?Command:Alias)) {
- return (EFI_ACCESS_DENIED);
- }
- if (Command == NULL || *Command == CHAR_NULL || StrLen(Command) == 0) {
- return (EFI_INVALID_PARAMETER);
- }
-
- if (EfiShellGetAlias(Command, NULL) != NULL && !Replace) {
- return (EFI_ACCESS_DENIED);
- }
-
- return (InternalSetAlias(Command, Alias, Volatile));
-}
-
-// Pure FILE_HANDLE operations are passed to FileHandleLib
-// these functions are indicated by the *
-EFI_SHELL_PROTOCOL mShellProtocol = {
- EfiShellExecute,
- EfiShellGetEnv,
- EfiShellSetEnv,
- EfiShellGetAlias,
- EfiShellSetAlias,
- EfiShellGetHelpText,
- EfiShellGetDevicePathFromMap,
- EfiShellGetMapFromDevicePath,
- EfiShellGetDevicePathFromFilePath,
- EfiShellGetFilePathFromDevicePath,
- EfiShellSetMap,
- EfiShellGetCurDir,
- EfiShellSetCurDir,
- EfiShellOpenFileList,
- EfiShellFreeFileList,
- EfiShellRemoveDupInFileList,
- EfiShellBatchIsActive,
- EfiShellIsRootShell,
- EfiShellEnablePageBreak,
- EfiShellDisablePageBreak,
- EfiShellGetPageBreak,
- EfiShellGetDeviceName,
- (EFI_SHELL_GET_FILE_INFO)FileHandleGetInfo, //*
- (EFI_SHELL_SET_FILE_INFO)FileHandleSetInfo, //*
- EfiShellOpenFileByName,
- EfiShellClose,
- EfiShellCreateFile,
- (EFI_SHELL_READ_FILE)FileHandleRead, //*
- (EFI_SHELL_WRITE_FILE)FileHandleWrite, //*
- (EFI_SHELL_DELETE_FILE)FileHandleDelete, //*
- EfiShellDeleteFileByName,
- (EFI_SHELL_GET_FILE_POSITION)FileHandleGetPosition, //*
- (EFI_SHELL_SET_FILE_POSITION)FileHandleSetPosition, //*
- (EFI_SHELL_FLUSH_FILE)FileHandleFlush, //*
- EfiShellFindFiles,
- EfiShellFindFilesInDir,
- (EFI_SHELL_GET_FILE_SIZE)FileHandleGetSize, //*
- EfiShellOpenRoot,
- EfiShellOpenRootByHandle,
- NULL,
- SHELL_MAJOR_VERSION,
- SHELL_MINOR_VERSION
-};
-
-/**
- Function to create and install on the current handle.
-
- Will overwrite any existing ShellProtocols in the system to be sure that
- the current shell is in control.
-
- This must be removed via calling CleanUpShellProtocol().
-
- @param[in, out] NewShell The pointer to the pointer to the structure
- to install.
-
- @retval EFI_SUCCESS The operation was successful.
- @return An error from LocateHandle, CreateEvent, or other core function.
-**/
-EFI_STATUS
-EFIAPI
-CreatePopulateInstallShellProtocol (
- IN OUT EFI_SHELL_PROTOCOL **NewShell
- )
-{
- EFI_STATUS Status;
- UINTN BufferSize;
- EFI_HANDLE *Buffer;
- UINTN HandleCounter;
- SHELL_PROTOCOL_HANDLE_LIST *OldProtocolNode;
-
- if (NewShell == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- BufferSize = 0;
- Buffer = NULL;
- OldProtocolNode = NULL;
- InitializeListHead(&ShellInfoObject.OldShellList.Link);
-
- //
- // Initialize EfiShellProtocol object...
- //
- Status = gBS->CreateEvent(0,
- 0,
- NULL,
- NULL,
- &mShellProtocol.ExecutionBreak);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- //
- // Get the size of the buffer we need.
- //
- Status = gBS->LocateHandle(ByProtocol,
- &gEfiShellProtocolGuid,
- NULL,
- &BufferSize,
- Buffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- //
- // Allocate and recall with buffer of correct size
- //
- Buffer = AllocateZeroPool(BufferSize);
- if (Buffer == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- Status = gBS->LocateHandle(ByProtocol,
- &gEfiShellProtocolGuid,
- NULL,
- &BufferSize,
- Buffer);
- if (EFI_ERROR(Status)) {
- FreePool(Buffer);
- return (Status);
- }
- //
- // now overwrite each of them, but save the info to restore when we end.
- //
- for (HandleCounter = 0 ; HandleCounter < (BufferSize/sizeof(EFI_HANDLE)) ; HandleCounter++) {
- OldProtocolNode = AllocateZeroPool(sizeof(SHELL_PROTOCOL_HANDLE_LIST));
- ASSERT(OldProtocolNode != NULL);
- Status = gBS->OpenProtocol(Buffer[HandleCounter],
- &gEfiShellProtocolGuid,
- (VOID **) &(OldProtocolNode->Interface),
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR(Status)) {
- //
- // reinstall over the old one...
- //
- OldProtocolNode->Handle = Buffer[HandleCounter];
- Status = gBS->ReinstallProtocolInterface(
- OldProtocolNode->Handle,
- &gEfiShellProtocolGuid,
- OldProtocolNode->Interface,
- (VOID*)(&mShellProtocol));
- if (!EFI_ERROR(Status)) {
- //
- // we reinstalled sucessfully. log this so we can reverse it later.
- //
-
- //
- // add to the list for subsequent...
- //
- InsertTailList(&ShellInfoObject.OldShellList.Link, &OldProtocolNode->Link);
- }
- }
- }
- FreePool(Buffer);
- } else if (Status == EFI_NOT_FOUND) {
- ASSERT(IsListEmpty(&ShellInfoObject.OldShellList.Link));
- //
- // no one else published yet. just publish it ourselves.
- //
- Status = gBS->InstallProtocolInterface (
- &gImageHandle,
- &gEfiShellProtocolGuid,
- EFI_NATIVE_INTERFACE,
- (VOID*)(&mShellProtocol));
- }
-
- if (PcdGetBool(PcdShellSupportOldProtocols)){
- ///@todo support ShellEnvironment2
- ///@todo do we need to support ShellEnvironment (not ShellEnvironment2) also?
- }
-
- if (!EFI_ERROR(Status)) {
- *NewShell = &mShellProtocol;
- }
- return (Status);
-}
-
-/**
- Opposite of CreatePopulateInstallShellProtocol.
-
- Free all memory and restore the system to the state it was in before calling
- CreatePopulateInstallShellProtocol.
-
- @param[in, out] NewShell The pointer to the new shell protocol structure.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-CleanUpShellProtocol (
- IN OUT EFI_SHELL_PROTOCOL *NewShell
- )
-{
- EFI_STATUS Status;
- SHELL_PROTOCOL_HANDLE_LIST *Node2;
- EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *SimpleEx;
-
- //
- // if we need to restore old protocols...
- //
- if (!IsListEmpty(&ShellInfoObject.OldShellList.Link)) {
- for (Node2 = (SHELL_PROTOCOL_HANDLE_LIST *)GetFirstNode(&ShellInfoObject.OldShellList.Link)
- ; !IsListEmpty (&ShellInfoObject.OldShellList.Link)
- ; Node2 = (SHELL_PROTOCOL_HANDLE_LIST *)GetFirstNode(&ShellInfoObject.OldShellList.Link)
- ){
- RemoveEntryList(&Node2->Link);
- Status = gBS->ReinstallProtocolInterface(Node2->Handle,
- &gEfiShellProtocolGuid,
- NewShell,
- Node2->Interface);
- FreePool(Node2);
- }
- } else {
- //
- // no need to restore
- //
- Status = gBS->UninstallProtocolInterface(gImageHandle,
- &gEfiShellProtocolGuid,
- NewShell);
- }
- Status = gBS->CloseEvent(NewShell->ExecutionBreak);
- NewShell->ExecutionBreak = NULL;
-
- Status = gBS->OpenProtocol(
- gST->ConsoleInHandle,
- &gEfiSimpleTextInputExProtocolGuid,
- (VOID**)&SimpleEx,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-
- if (!EFI_ERROR (Status)) {
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle1);
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle2);
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle3);
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlCNotifyHandle4);
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle1);
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle2);
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle3);
- Status = SimpleEx->UnregisterKeyNotify(SimpleEx, ShellInfoObject.CtrlSNotifyHandle4);
- }
- return (Status);
-}
-
-/**
- Notification function for keystrokes.
-
- @param[in] KeyData The key that was pressed.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-NotificationFunction(
- IN EFI_KEY_DATA *KeyData
- )
-{
- EFI_INPUT_KEY Key;
- if ((KeyData->Key.UnicodeChar == L'c' || KeyData->Key.UnicodeChar == 3) &&
- (KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))
- ){
- if (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak == NULL) {
- return (EFI_UNSUPPORTED);
- }
- return (gBS->SignalEvent(ShellInfoObject.NewEfiShellProtocol->ExecutionBreak));
- } else if ((KeyData->Key.UnicodeChar == L's') &&
- (KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))
- ){
- ShellInfoObject.HaltOutput = TRUE;
-
- //
- // Make sure that there are no pending keystrokes to pervent the pause.
- //
- gST->ConIn->Reset(gST->ConIn, FALSE);
- while (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key)==EFI_SUCCESS);
- }
- return (EFI_SUCCESS);
-}
-
-/**
- Function to start monitoring for CTRL-C using SimpleTextInputEx. This
- feature's enabled state was not known when the shell initially launched.
-
- @retval EFI_SUCCESS The feature is enabled.
- @retval EFI_OUT_OF_RESOURCES There is not enough mnemory available.
-**/
-EFI_STATUS
-EFIAPI
-InernalEfiShellStartMonitor(
- VOID
- )
-{
- EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *SimpleEx;
- EFI_KEY_DATA KeyData;
- EFI_STATUS Status;
-
- Status = gBS->OpenProtocol(
- gST->ConsoleInHandle,
- &gEfiSimpleTextInputExProtocolGuid,
- (VOID**)&SimpleEx,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SHELL_NO_IN_EX),
- ShellInfoObject.HiiHandle);
- return (EFI_SUCCESS);
- }
-
- if (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak == NULL) {
- return (EFI_UNSUPPORTED);
- }
-
- KeyData.KeyState.KeyToggleState = 0;
- KeyData.Key.ScanCode = 0;
- KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED;
- KeyData.Key.UnicodeChar = L'c';
-
- Status = SimpleEx->RegisterKeyNotify(
- SimpleEx,
- &KeyData,
- NotificationFunction,
- &ShellInfoObject.CtrlCNotifyHandle1);
-
- KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED;
- if (!EFI_ERROR(Status)) {
- Status = SimpleEx->RegisterKeyNotify(
- SimpleEx,
- &KeyData,
- NotificationFunction,
- &ShellInfoObject.CtrlCNotifyHandle2);
- }
- KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED;
- KeyData.Key.UnicodeChar = 3;
- if (!EFI_ERROR(Status)) {
- Status = SimpleEx->RegisterKeyNotify(
- SimpleEx,
- &KeyData,
- NotificationFunction,
- &ShellInfoObject.CtrlCNotifyHandle3);
- }
- KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED;
- if (!EFI_ERROR(Status)) {
- Status = SimpleEx->RegisterKeyNotify(
- SimpleEx,
- &KeyData,
- NotificationFunction,
- &ShellInfoObject.CtrlCNotifyHandle4);
- }
- return (Status);
-}
diff --git a/ShellPkg/Application/Shell/ShellProtocol.h b/ShellPkg/Application/Shell/ShellProtocol.h
deleted file mode 100644
index a63ae8fc83..0000000000
--- a/ShellPkg/Application/Shell/ShellProtocol.h
+++ /dev/null
@@ -1,976 +0,0 @@
-/** @file
- Member functions of EFI_SHELL_PROTOCOL and functions for creation,
- manipulation, and initialization of EFI_SHELL_PROTOCOL.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_PROTOCOL_HEADER_
-#define _SHELL_PROTOCOL_HEADER_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/ShellVariableGuid.h>
-#include <Guid/ShellMapGuid.h>
-#include <Guid/ShellAliasGuid.h>
-
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/SimpleFileSystem.h>
-#include <Protocol/DevicePathToText.h>
-#include <Protocol/ComponentName2.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DevicePath.h>
-#include <Protocol/SimpleTextInEx.h>
-
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/BaseLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/PrintLib.h>
-#include <Library/DevicePathLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/UefiLib.h>
-#include <Library/SortLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellLib.h>
-
-#include "FileHandleWrappers.h"
-#include "ShellEnvVar.h"
-#include "ShellManParser.h"
-
-typedef struct {
- LIST_ENTRY Link;
- EFI_SHELL_PROTOCOL *Interface;
- EFI_HANDLE Handle;
-} SHELL_PROTOCOL_HANDLE_LIST;
-
-// flags values...
-#define SHELL_MAP_FLAGS_CONSIST BIT1
-
-/**
- Function to create and install on the current handle.
-
- Will overwrite any existing ShellProtocols in the system to be sure that
- the current shell is in control.
-
- This must be removed via calling CleanUpShellProtocol().
-
- @param[in, out] NewShell The pointer to the pointer to the structure
- to install.
-
- @retval EFI_SUCCESS The operation was successful.
- @return An error from LocateHandle, CreateEvent, or other core function.
-**/
-EFI_STATUS
-EFIAPI
-CreatePopulateInstallShellProtocol (
- IN OUT EFI_SHELL_PROTOCOL **NewShell
- );
-
-/**
- Opposite of CreatePopulateInstallShellProtocol.
-
- Free all memory and restore the system to the state it was in before calling
- CreatePopulateInstallShellProtocol.
-
- @param[in, out] NewShell The pointer to the new shell protocol structure.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-CleanUpShellProtocol (
- IN OUT EFI_SHELL_PROTOCOL *NewShell
- );
-
-/**
- This function creates a mapping for a device path.
-
- @param DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,
- then the mapping will be deleted.
- @param Mapping Points to the NULL-terminated mapping for the device path. Must end with a ':'
-
- @retval EFI_SUCCESS Mapping created or deleted successfully.
- @retval EFI_NO_MAPPING There is no handle that corresponds exactly to DevicePath. See the
- boot service function LocateDevicePath().
- @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
- @retval EFI_INVALID_PARAMETER Mapping was NULL
- @retval EFI_INVALID_PARAMETER Mapping did not end with a ':'
- @retval EFI_INVALID_PARAMETER DevicePath was not pointing at a device that had a SIMPLE_FILE_SYSTEM_PROTOCOL installed.
- @retval EFI_NOT_FOUND There was no mapping found to delete
- @retval EFI_OUT_OF_RESOURCES Memory allocation failed
-**/
-EFI_STATUS
-EFIAPI
-EfiShellSetMap(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL,
- IN CONST CHAR16 *Mapping
- );
-
-/**
- Gets the device path from the mapping.
-
- This function gets the device path associated with a mapping.
-
- @param Mapping A pointer to the mapping
-
- @retval !=NULL Pointer to the device path that corresponds to the
- device mapping. The returned pointer does not need
- to be freed.
- @retval NULL There is no device path associated with the
- specified mapping.
-**/
-CONST EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-EfiShellGetDevicePathFromMap(
- IN CONST CHAR16 *Mapping
- );
-
-/**
- Gets the mapping that most closely matches the device path.
-
- This function gets the mapping which corresponds to the device path *DevicePath. If
- there is no exact match, then the mapping which most closely matches *DevicePath
- is returned, and *DevicePath is updated to point to the remaining portion of the
- device path. If there is an exact match, the mapping is returned and *DevicePath
- points to the end-of-device-path node.
-
- @param DevicePath On entry, points to a device path pointer. On
- exit, updates the pointer to point to the
- portion of the device path after the mapping.
-
- @retval NULL No mapping was found.
- @return !=NULL Pointer to NULL-terminated mapping. The buffer
- is callee allocated and should be freed by the caller.
-**/
-CONST CHAR16 *
-EFIAPI
-EfiShellGetMapFromDevicePath(
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
- );
-
-/**
- Converts a device path to a file system-style path.
-
- This function converts a device path to a file system path by replacing part, or all, of
- the device path with the file-system mapping. If there are more than one application
- file system mappings, the one that most closely matches Path will be used.
-
- @param Path The pointer to the device path
-
- @retval NULL the device path could not be found.
- @return all The pointer of the NULL-terminated file path. The path
- is callee-allocated and should be freed by the caller.
-**/
-CHAR16 *
-EFIAPI
-EfiShellGetFilePathFromDevicePath(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
- );
-
-/**
- Converts a file system style name to a device path.
-
- This function converts a file system style name to a device path, by replacing any
- mapping references to the associated device path.
-
- @param Path the pointer to the path
-
- @return all The pointer of the file path. The file path is callee
- allocated and should be freed by the caller.
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-EfiShellGetDevicePathFromFilePath(
- IN CONST CHAR16 *Path
- );
-
-/**
- Gets the name of the device specified by the device handle.
-
- This function gets the user-readable name of the device specified by the device
- handle. If no user-readable name could be generated, then *BestDeviceName will be
- NULL and EFI_NOT_FOUND will be returned.
-
- If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the function will return the
- device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if present on
- DeviceHandle.
-
- If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will return the
- device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on DeviceHandle.
- If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and
- EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
- EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
-
- @param DeviceHandle The handle of the device.
- @param Flags Determines the possible sources of component names.
- Valid bits are:
- EFI_DEVICE_NAME_USE_COMPONENT_NAME
- EFI_DEVICE_NAME_USE_DEVICE_PATH
- @param Language A pointer to the language specified for the device
- name, in the same format as described in the UEFI
- specification, Appendix M
- @param BestDeviceName On return, points to the callee-allocated NULL-
- terminated name of the device. If no device name
- could be found, points to NULL. The name must be
- freed by the caller...
-
- @retval EFI_SUCCESS Get the name successfully.
- @retval EFI_NOT_FOUND Fail to get the device name.
- @retval EFI_INVALID_PARAMETER Flags did not have a valid bit set.
- @retval EFI_INVALID_PARAMETER BestDeviceName was NULL
- @retval EFI_INVALID_PARAMETER DeviceHandle was NULL
-**/
-EFI_STATUS
-EFIAPI
-EfiShellGetDeviceName(
- IN EFI_HANDLE DeviceHandle,
- IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
- IN CHAR8 *Language,
- OUT CHAR16 **BestDeviceName
- );
-
-/**
- Opens the root directory of a device on a handle
-
- This function opens the root directory of a device and returns a file handle to it.
-
- @param DeviceHandle The handle of the device that contains the volume.
- @param FileHandle On exit, points to the file handle corresponding to the root directory on the
- device.
-
- @retval EFI_SUCCESS Root opened successfully.
- @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
- could not be opened.
- @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
- @retval EFI_DEVICE_ERROR The device had an error
-**/
-EFI_STATUS
-EFIAPI
-EfiShellOpenRootByHandle(
- IN EFI_HANDLE DeviceHandle,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Opens the root directory of a device.
-
- This function opens the root directory of a device and returns a file handle to it.
-
- @param DevicePath Points to the device path corresponding to the device where the
- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
- @param FileHandle On exit, points to the file handle corresponding to the root directory on the
- device.
-
- @retval EFI_SUCCESS Root opened successfully.
- @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
- could not be opened.
- @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
- @retval EFI_DEVICE_ERROR The device had an error
-**/
-EFI_STATUS
-EFIAPI
-EfiShellOpenRoot(
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Returns whether any script files are currently being processed.
-
- @retval TRUE There is at least one script file active.
- @retval FALSE No script files are active now.
-
-**/
-BOOLEAN
-EFIAPI
-EfiShellBatchIsActive (
- VOID
- );
-
-/**
- Worker function to open a file based on a device path. this will open the root
- of the volume and then traverse down to the file itself.
-
- @param DevicePath2 Device Path of the file
- @param FileHandle Pointer to the file upon a successful return
- @param OpenMode mode to open file in.
- @param Attributes the File Attributes to use when creating a new file
-
- @retval EFI_SUCCESS the file is open and FileHandle is valid
- @retval EFI_UNSUPPORTED the device path cotained non-path elements
- @retval other an error ocurred.
-**/
-EFI_STATUS
-EFIAPI
-InternalOpenFileDevicePath(
- IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath2,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode,
- IN UINT64 Attributes OPTIONAL
- );
-
-/**
- Creates a file or directory by name.
-
- This function creates an empty new file or directory with the specified attributes and
- returns the new file's handle. If the file already exists and is read-only, then
- EFI_INVALID_PARAMETER will be returned.
-
- If the file already existed, it is truncated and its attributes updated. If the file is
- created successfully, the FileHandle is the file's handle, else, the FileHandle is NULL.
-
- If the file name begins with >v, then the file handle which is returned refers to the
- shell environment variable with the specified name. If the shell environment variable
- already exists and is non-volatile then EFI_INVALID_PARAMETER is returned.
-
- @param FileName Pointer to NULL-terminated file path
- @param FileAttribs The new file's attrbiutes. the different attributes are
- described in EFI_FILE_PROTOCOL.Open().
- @param FileHandle On return, points to the created file handle or directory's handle
-
- @retval EFI_SUCCESS The file was opened. FileHandle points to the new file's handle.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED could not open the file path
- @retval EFI_NOT_FOUND the specified file could not be found on the devide, or could not
- file the file system on the device.
- @retval EFI_NO_MEDIA the device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
- longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
- the DirName.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
- when the media is write-protected.
- @retval EFI_ACCESS_DENIED The service denied access to the file.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellCreateFile(
- IN CONST CHAR16 *FileName,
- IN UINT64 FileAttribs,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Opens a file or a directory by file name.
-
- This function opens the specified file in the specified OpenMode and returns a file
- handle.
- If the file name begins with >v, then the file handle which is returned refers to the
- shell environment variable with the specified name. If the shell environment variable
- exists, is non-volatile and the OpenMode indicates EFI_FILE_MODE_WRITE, then
- EFI_INVALID_PARAMETER is returned.
-
- If the file name is >i, then the file handle which is returned refers to the standard
- input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is >o, then the file handle which is returned refers to the standard
- output. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is >e, then the file handle which is returned refers to the standard
- error. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is NUL, then the file handle that is returned refers to the standard NUL
- file. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER is
- returned.
-
- If return EFI_SUCCESS, the FileHandle is the opened file's handle, else, the
- FileHandle is NULL.
-
- @param FileName Points to the NULL-terminated UCS-2 encoded file name.
- @param FileHandle On return, points to the file handle.
- @param OpenMode File open mode. Either EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
- Specification.
- @retval EFI_SUCCESS The file was opened. FileHandle has the opened file's handle.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. FileHandle is NULL.
- @retval EFI_UNSUPPORTED Could not open the file path. FileHandle is NULL.
- @retval EFI_NOT_FOUND The specified file could not be found on the device or the file
- system could not be found on the device. FileHandle is NULL.
- @retval EFI_NO_MEDIA The device has no medium. FileHandle is NULL.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
- longer supported. FileHandle is NULL.
- @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
- the FileName. FileHandle is NULL.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. FileHandle is NULL.
- @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
- when the media is write-protected. FileHandle is NULL.
- @retval EFI_ACCESS_DENIED The service denied access to the file. FileHandle is NULL.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file. FileHandle
- is NULL.
- @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellOpenFileByName(
- IN CONST CHAR16 *FileName,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode
- );
-
-/**
- Deletes the file specified by the file name.
-
- This function deletes a file.
-
- @param FileName Points to the NULL-terminated file name.
-
- @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
- @sa EfiShellCreateFile
- @sa FileHandleDelete
-**/
-EFI_STATUS
-EFIAPI
-EfiShellDeleteFileByName(
- IN CONST CHAR16 *FileName
- );
-
-/**
- Disables the page break output mode.
-**/
-VOID
-EFIAPI
-EfiShellDisablePageBreak (
- VOID
- );
-
-/**
- Enables the page break output mode.
-**/
-VOID
-EFIAPI
-EfiShellEnablePageBreak (
- VOID
- );
-
-/**
- internal worker function to run a command via Device Path
-
- @param ParentImageHandle A handle of the image that is executing the specified
- command line.
- @param DevicePath device path of the file to execute
- @param CommandLine Points to the NULL-terminated UCS-2 encoded string
- containing the command line. If NULL then the command-
- line will be empty.
- @param Environment Points to a NULL-terminated array of environment
- variables with the format 'x=y', where x is the
- environment variable name and y is the value. If this
- is NULL, then the current shell environment is used.
- @param StatusCode Points to the status code returned by the command.
-
- @retval EFI_SUCCESS The command executed successfully. The status code
- returned by the command is pointed to by StatusCode.
- @retval EFI_INVALID_PARAMETER The parameters are invalid.
- @retval EFI_OUT_OF_RESOURCES Out of resources.
- @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
-**/
-EFI_STATUS
-EFIAPI
-InternalShellExecuteDevicePath(
- IN CONST EFI_HANDLE *ParentImageHandle,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN CONST CHAR16 *CommandLine OPTIONAL,
- IN CONST CHAR16 **Environment OPTIONAL,
- OUT EFI_STATUS *StatusCode OPTIONAL
- );
-
-/**
- Execute the command line.
-
- This function creates a nested instance of the shell and executes the specified
- command (CommandLine) with the specified environment (Environment). Upon return,
- the status code returned by the specified command is placed in StatusCode.
-
- If Environment is NULL, then the current environment is used and all changes made
- by the commands executed will be reflected in the current environment. If the
- Environment is non-NULL, then the changes made will be discarded.
-
- The CommandLine is executed from the current working directory on the current
- device.
-
- @param ParentImageHandle A handle of the image that is executing the specified
- command line.
- @param CommandLine Points to the NULL-terminated UCS-2 encoded string
- containing the command line. If NULL then the command-
- line will be empty.
- @param Environment Points to a NULL-terminated array of environment
- variables with the format 'x=y', where x is the
- environment variable name and y is the value. If this
- is NULL, then the current shell environment is used.
- @param StatusCode Points to the status code returned by the command.
-
- @retval EFI_SUCCESS The command executed successfully. The status code
- returned by the command is pointed to by StatusCode.
- @retval EFI_INVALID_PARAMETER The parameters are invalid.
- @retval EFI_OUT_OF_RESOURCES Out of resources.
- @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellExecute(
- IN EFI_HANDLE *ParentImageHandle,
- IN CHAR16 *CommandLine OPTIONAL,
- IN CHAR16 **Environment OPTIONAL,
- OUT EFI_STATUS *StatusCode OPTIONAL
- );
-
-/**
- Utility cleanup function for EFI_SHELL_FILE_INFO objects.
-
- 1) frees all pointers (non-NULL)
- 2) Closes the SHELL_FILE_HANDLE
-
- @param FileListNode pointer to the list node to free
-**/
-VOID
-EFIAPI
-FreeShellFileInfoNode(
- IN EFI_SHELL_FILE_INFO *FileListNode
- );
-
-/**
- Frees the file list.
-
- This function cleans up the file list and any related data structures. It has no
- impact on the files themselves.
-
- @param FileList The file list to free. Type EFI_SHELL_FILE_INFO is
- defined in OpenFileList()
-
- @retval EFI_SUCCESS Free the file list successfully.
- @retval EFI_INVALID_PARAMETER FileList was NULL or *FileList was NULL;
-**/
-EFI_STATUS
-EFIAPI
-EfiShellFreeFileList(
- IN EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Deletes the duplicate file names files in the given file list.
-
- This function deletes the reduplicate files in the given file list.
-
- @param FileList A pointer to the first entry in the file list.
-
- @retval EFI_SUCCESS Always success.
- @retval EFI_INVALID_PARAMETER FileList was NULL or *FileList was NULL;
-**/
-EFI_STATUS
-EFIAPI
-EfiShellRemoveDupInFileList(
- IN EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Allocates and populates a EFI_SHELL_FILE_INFO structure. if any memory operation
- failed it will return NULL.
-
- @param[in] BasePath the Path to prepend onto filename for FullPath
- @param[in] Status Status member initial value.
- @param[in] FullName FullName member initial value.
- @param[in] FileName FileName member initial value.
- @param[in] Handle Handle member initial value.
- @param[in] Info Info struct to copy.
-
-**/
-EFI_SHELL_FILE_INFO *
-EFIAPI
-CreateAndPopulateShellFileInfo(
- IN CONST CHAR16 *BasePath,
- IN CONST EFI_STATUS Status,
- IN CONST CHAR16 *FullName,
- IN CONST CHAR16 *FileName,
- IN CONST SHELL_FILE_HANDLE Handle,
- IN CONST EFI_FILE_INFO *Info
- );
-
-/**
- Find all files in a specified directory.
-
- @param FileDirHandle Handle of the directory to search.
- @param FileList On return, points to the list of files in the directory
- or NULL if there are no files in the directory.
-
- @retval EFI_SUCCESS File information was returned successfully.
- @retval EFI_VOLUME_CORRUPTED The file system structures have been corrupted.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_NO_MEDIA The device media is not present.
- @retval EFI_INVALID_PARAMETER The FileDirHandle was not a directory.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellFindFilesInDir(
- IN SHELL_FILE_HANDLE FileDirHandle,
- OUT EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Find files that match a specified pattern.
-
- This function searches for all files and directories that match the specified
- FilePattern. The FilePattern can contain wild-card characters. The resulting file
- information is placed in the file list FileList.
-
- Wildcards are processed
- according to the rules specified in UEFI Shell 2.0 spec section 3.7.1.
-
- The files in the file list are not opened. The OpenMode field is set to 0 and the FileInfo
- field is set to NULL.
-
- if *FileList is not NULL then it must be a pre-existing and properly initialized list.
-
- @param FilePattern Points to a NULL-terminated shell file path, including wildcards.
- @param FileList On return, points to the start of a file list containing the names
- of all matching files or else points to NULL if no matching files
- were found. only on a EFI_SUCCESS return will; this be non-NULL.
-
- @retval EFI_SUCCESS Files found. FileList is a valid list.
- @retval EFI_NOT_FOUND No files found.
- @retval EFI_NO_MEDIA The device has no media
- @retval EFI_DEVICE_ERROR The device reported an error
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted
-**/
-EFI_STATUS
-EFIAPI
-EfiShellFindFiles(
- IN CONST CHAR16 *FilePattern,
- OUT EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Opens the files that match the path specified.
-
- This function opens all of the files specified by Path. Wildcards are processed
- according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
- matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.
-
- @param Path A pointer to the path string.
- @param OpenMode Specifies the mode used to open each file, EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE.
- @param FileList Points to the start of a list of files opened.
-
- @retval EFI_SUCCESS Create the file list successfully.
- @return Others Can't create the file list.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellOpenFileList(
- IN CHAR16 *Path,
- IN UINT64 OpenMode,
- IN OUT EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Gets the environment variable.
-
- This function returns the current value of the specified environment variable.
-
- @param Name A pointer to the environment variable name
-
- @return !=NULL The environment variable's value. The returned
- pointer does not need to be freed by the caller.
- @retval NULL The environment variable doesn't exist.
-**/
-CONST CHAR16 *
-EFIAPI
-EfiShellGetEnv(
- IN CONST CHAR16 *Name
- );
-
-/**
- Sets the environment variable.
-
- This function changes the current value of the specified environment variable. If the
- environment variable exists and the Value is an empty string, then the environment
- variable is deleted. If the environment variable exists and the Value is not an empty
- string, then the value of the environment variable is changed. If the environment
- variable does not exist and the Value is an empty string, there is no action. If the
- environment variable does not exist and the Value is a non-empty string, then the
- environment variable is created and assigned the specified value.
-
- For a description of volatile and non-volatile environment variables, see UEFI Shell
- 2.0 specification section 3.6.1.
-
- @param Name Points to the NULL-terminated environment variable name.
- @param Value Points to the NULL-terminated environment variable value. If the value is an
- empty string then the environment variable is deleted.
- @param Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
-
- @retval EFI_SUCCESS The environment variable was successfully updated.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellSetEnv(
- IN CONST CHAR16 *Name,
- IN CONST CHAR16 *Value,
- IN BOOLEAN Volatile
- );
-
-/**
- Returns the current directory on the specified device.
-
- If FileSystemMapping is NULL, it returns the current working directory. If the
- FileSystemMapping is not NULL, it returns the current directory associated with the
- FileSystemMapping. In both cases, the returned name includes the file system
- mapping (i.e. fs0:\current-dir).
-
- @param FileSystemMapping A pointer to the file system mapping. If NULL,
- then the current working directory is returned.
-
- @retval !=NULL The current directory.
- @retval NULL Current directory does not exist.
-**/
-CONST CHAR16 *
-EFIAPI
-EfiShellGetCurDir(
- IN CONST CHAR16 *FileSystemMapping OPTIONAL
- );
-
-/**
- Changes the current directory on the specified device.
-
- If the FileSystem is NULL, and the directory Dir does not contain a file system's
- mapped name, this function changes the current working directory. If FileSystem is
- NULL and the directory Dir contains a mapped name, then the current file system and
- the current directory on that file system are changed.
-
- If FileSystem is not NULL, and Dir is NULL, then this changes the current working file
- system.
-
- If FileSystem is not NULL and Dir is not NULL, then this function changes the current
- directory on the specified file system.
-
- If the current working directory or the current working file system is changed then the
- %cwd% environment variable will be updated
-
- @param FileSystem A pointer to the file system's mapped name. If NULL, then the current working
- directory is changed.
- @param Dir Points to the NULL-terminated directory on the device specified by FileSystem.
-
- @retval EFI_SUCCESS The operation was sucessful
-**/
-EFI_STATUS
-EFIAPI
-EfiShellSetCurDir(
- IN CONST CHAR16 *FileSystem OPTIONAL,
- IN CONST CHAR16 *Dir
- );
-
-/**
- Return help information about a specific command.
-
- This function returns the help information for the specified command. The help text
- can be internal to the shell or can be from a UEFI Shell manual page.
-
- If Sections is specified, then each section name listed will be compared in a casesensitive
- manner, to the section names described in Appendix B. If the section exists,
- it will be appended to the returned help text. If the section does not exist, no
- information will be returned. If Sections is NULL, then all help text information
- available will be returned.
-
- @param Command Points to the NULL-terminated UEFI Shell command name.
- @param Sections Points to the NULL-terminated comma-delimited
- section names to return. If NULL, then all
- sections will be returned.
- @param HelpText On return, points to a callee-allocated buffer
- containing all specified help text.
-
- @retval EFI_SUCCESS The help text was returned.
- @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
- returned help text.
- @retval EFI_INVALID_PARAMETER HelpText is NULL
- @retval EFI_NOT_FOUND There is no help text available for Command.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellGetHelpText(
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Sections OPTIONAL,
- OUT CHAR16 **HelpText
- );
-
-/**
- Gets the enable status of the page break output mode.
-
- User can use this function to determine current page break mode.
-
- @retval TRUE The page break output mode is enabled
- @retval FALSE The page break output mode is disabled
-**/
-BOOLEAN
-EFIAPI
-EfiShellGetPageBreak(
- VOID
- );
-
-/**
- Judges whether the active shell is the root shell.
-
- This function makes the user to know that whether the active Shell is the root shell.
-
- @retval TRUE The active Shell is the root Shell.
- @retval FALSE The active Shell is NOT the root Shell.
-**/
-BOOLEAN
-EFIAPI
-EfiShellIsRootShell(
- VOID
- );
-
-/**
- This function returns the command associated with a alias or a list of all
- alias'.
-
- @param[in] Command Points to the NULL-terminated shell alias.
- If this parameter is NULL, then all
- aliases will be returned in ReturnedData.
- @param[out] Volatile upon return of a single command if TRUE indicates
- this is stored in a volatile fashion. FALSE otherwise.
- @return If Alias is not NULL, it will return a pointer to
- the NULL-terminated command for that alias.
- If Alias is NULL, ReturnedData points to a ';'
- delimited list of alias (e.g.
- ReturnedData = "dir;del;copy;mfp") that is NULL-terminated.
- @retval NULL an error ocurred
- @retval NULL Alias was not a valid Alias
-**/
-CONST CHAR16 *
-EFIAPI
-EfiShellGetAlias(
- IN CONST CHAR16 *Command,
- OUT BOOLEAN *Volatile OPTIONAL
- );
-
-/**
- Changes a shell command alias.
-
- This function creates an alias for a shell command or if Alias is NULL it will delete an existing alias.
-
- this function does not check for built in alias'.
-
- @param[in] Command Points to the NULL-terminated shell command or existing alias.
- @param[in] Alias Points to the NULL-terminated alias for the shell command. If this is NULL, and
- Command refers to an alias, that alias will be deleted.
- @param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the
- Alias being set will be stored in a non-volatile fashion.
-
- @retval EFI_SUCCESS Alias created or deleted successfully.
- @retval EFI_NOT_FOUND the Alias intended to be deleted was not found
-**/
-EFI_STATUS
-EFIAPI
-InternalSetAlias(
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Alias OPTIONAL,
- IN BOOLEAN Volatile
- );
-
-/**
- Changes a shell command alias.
-
- This function creates an alias for a shell command or if Alias is NULL it will delete an existing alias.
-
-
- @param[in] Command Points to the NULL-terminated shell command or existing alias.
- @param[in] Alias Points to the NULL-terminated alias for the shell command. If this is NULL, and
- Command refers to an alias, that alias will be deleted.
- @param[in] Replace If TRUE and the alias already exists, then the existing alias will be replaced. If
- FALSE and the alias already exists, then the existing alias is unchanged and
- EFI_ACCESS_DENIED is returned.
- @param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the
- Alias being set will be stored in a non-volatile fashion.
-
- @retval EFI_SUCCESS Alias created or deleted successfully.
- @retval EFI_NOT_FOUND the Alias intended to be deleted was not found
- @retval EFI_ACCESS_DENIED The alias is a built-in alias or already existed and Replace was set to
- FALSE.
-**/
-EFI_STATUS
-EFIAPI
-EfiShellSetAlias(
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Alias OPTIONAL,
- IN BOOLEAN Replace,
- IN BOOLEAN Volatile
- );
-
-/**
- Utility cleanup function for EFI_SHELL_FILE_INFO objects.
-
- 1) frees all pointers (non-NULL)
- 2) Closes the SHELL_FILE_HANDLE
-
- @param FileListNode pointer to the list node to free
-**/
-VOID
-EFIAPI
-InternalFreeShellFileInfoNode(
- IN EFI_SHELL_FILE_INFO *FileListNode
- );
-
-/**
- Internal variable setting function. Allows for setting of the read only variables.
-
- @param Name Points to the NULL-terminated environment variable name.
- @param Value Points to the NULL-terminated environment variable value. If the value is an
- empty string then the environment variable is deleted.
- @param Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
-
- @retval EFI_SUCCESS The environment variable was successfully updated.
-**/
-EFI_STATUS
-EFIAPI
-InternalEfiShellSetEnv(
- IN CONST CHAR16 *Name,
- IN CONST CHAR16 *Value,
- IN BOOLEAN Volatile
- );
-
-/**
- Function to start monitoring for CTRL-C using SimpleTextInputEx. This
- feature's enabled state was not known when the shell initially launched.
-
- @retval EFI_SUCCESS The feature is enabled.
- @retval EFI_OUT_OF_RESOURCES There is not enough mnemory available.
-**/
-EFI_STATUS
-EFIAPI
-InernalEfiShellStartMonitor(
- VOID
- );
-
-/**
- Notification function for keystrokes.
-
- @param[in] KeyData The key that was pressed.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-NotificationFunction(
- IN EFI_KEY_DATA *KeyData
- );
-#endif //_SHELL_PROTOCOL_HEADER_
-
diff --git a/ShellPkg/Application/ShellCTestApp/ShellCTestApp.c b/ShellPkg/Application/ShellCTestApp/ShellCTestApp.c
deleted file mode 100644
index 8d3fa4c662..0000000000
--- a/ShellPkg/Application/ShellCTestApp/ShellCTestApp.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/** @file
- This is a test application that demonstrates how to use the C-style entry point
- for a shell application.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Uefi.h>
-#include <Library/UefiLib.h>
-#include <Library/DebugLib.h>
-#include <Library/ShellCEntryLib.h>
-
-/**
- UEFI application entry point which has an interface similar to a
- standard C main function.
-
- The ShellCEntryLib library instance wrappers the actual UEFI application
- entry point and calls this ShellAppMain function.
-
- @param[in] Argc The number of items in Argv.
- @param[in] Argv Array of pointers to strings.
-
- @retval 0 The application exited normally.
- @retval Other An error occurred.
-
-**/
-INTN
-EFIAPI
-ShellAppMain (
- IN UINTN Argc,
- IN CHAR16 **Argv
- )
-{
- UINTN Index;
-
- Print(L"ShellCTestApp.c:ShellAppMain called with %d parameters\n", Argc);
- for (Index = 0; Index < Argc; Index++) {
- Print(L"Argv[%d]: %s\n", Index, Argv[Index]);
- }
-
- return 0;
-}
diff --git a/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf b/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf
deleted file mode 100644
index 4839b9fd97..0000000000
--- a/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf
+++ /dev/null
@@ -1,39 +0,0 @@
-## @file
-# This is the shell application
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = ShellCTestApp
- FILE_GUID = 7a6ca3b8-ee1b-489c-b300-24544a7bd418
- MODULE_TYPE = UEFI_APPLICATION
- VERSION_STRING = 1.0
- ENTRY_POINT = ShellCEntryLib
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources]
- ShellCTestApp.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
-
-[LibraryClasses]
- ShellCEntryLib
- UefiLib \ No newline at end of file
diff --git a/ShellPkg/Application/ShellExecTestApp/SA.c b/ShellPkg/Application/ShellExecTestApp/SA.c
deleted file mode 100644
index 80531d09e9..0000000000
--- a/ShellPkg/Application/ShellExecTestApp/SA.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- This is a simple shell application
-
- Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Uefi.h>
-#include <Library/UefiApplicationEntryPoint.h>
-#include <Library/UefiLib.h>
-
-/**
- as the real entry point for the application.
-
- @param[in] ImageHandle The firmware allocated handle for the EFI image.
- @param[in] SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The entry point is executed successfully.
- @retval other Some error occurs when executing this entry point.
-
-**/
-EFI_STATUS
-EFIAPI
-UefiMain (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- Print(L"ShellExecute - Pass");
- return EFI_SUCCESS;
-}
diff --git a/ShellPkg/Application/ShellExecTestApp/SA.inf b/ShellPkg/Application/ShellExecTestApp/SA.inf
deleted file mode 100644
index 86e3f7b197..0000000000
--- a/ShellPkg/Application/ShellExecTestApp/SA.inf
+++ /dev/null
@@ -1,41 +0,0 @@
-## @file
-# Sample UEFI Application Reference EDKII Module
-#
-# This is a simple shell application
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = EmptyApplication
- FILE_GUID = 8F7D7B1D-0E1C-4c98-B12E-4EC99C4081AC
- MODULE_TYPE = UEFI_APPLICATION
- VERSION_STRING = 1.0
- ENTRY_POINT = UefiMain
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources]
- SA.c
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- UefiApplicationEntryPoint
- UefiLib
-
diff --git a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c b/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c
deleted file mode 100644
index 6bdd237e8d..0000000000
--- a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/** @file
- This is a test application that demonstrates how to use the sorting functions.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Uefi.h>
-#include <Library/UefiLib.h>
-#include <Library/DebugLib.h>
-#include <Library/ShellCEntryLib.h>
-#include <Library/SortLib.h>
-
-/**
- Test comparator.
-
- @param[in] b1 The first INTN
- @param[in] b2 The other INTN
-
- @retval 0 They are the same.
- @retval -1 b1 is less than b2
- @retval 1 b1 is greater then b2
-**/
-INTN
-EFIAPI
-Test(CONST VOID *b1, CONST VOID *b2)
-{
- if (*(INTN*)b1 == *(INTN*)b2) {
- return (0);
- }
- if (*(INTN*)b1 < *(INTN*)b2) {
- return(-1);
- }
- return (1);
-}
-
-/**
- UEFI application entry point which has an interface similar to a
- standard C main function.
-
- The ShellCEntryLib library instance wrappers the actual UEFI application
- entry point and calls this ShellAppMain function.
-
- @param Argc Argument count
- @param Argv The parsed arguments
-
- @retval 0 The application exited normally.
- @retval Other An error occurred.
-
-**/
-INTN
-EFIAPI
-ShellAppMain (
- IN UINTN Argc,
- IN CHAR16 **Argv
- )
-{
- INTN Array[10];
-
- Array[0] = 2;
- Array[1] = 3;
- Array[2] = 4;
- Array[3] = 1;
- Array[4] = 5;
- Array[5] = 6;
- Array[6] = 7;
- Array[7] = 8;
- Array[8] = 1;
- Array[9] = 5;
-
- Print(L"Array = %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\r\n", Array[0],Array[1],Array[2],Array[3],Array[4],Array[5],Array[6],Array[7],Array[8],Array[9]);
- PerformQuickSort(Array, 10, sizeof(INTN), Test);
- Print(L"POST-SORT\r\n");
- Print(L"Array = %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\r\n", Array[0],Array[1],Array[2],Array[3],Array[4],Array[5],Array[6],Array[7],Array[8],Array[9]);
- return 0;
-}
diff --git a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf b/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf
deleted file mode 100644
index ab13244215..0000000000
--- a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf
+++ /dev/null
@@ -1,41 +0,0 @@
-## @file
-# This is the shell sorting testing application
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = ShellSortTestApp
- FILE_GUID = 079E8E98-AE93-4b9a-8A71-1DC869F23E09
- MODULE_TYPE = UEFI_APPLICATION
- VERSION_STRING = 1.0
- ENTRY_POINT = ShellCEntryLib
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources]
- ShellSortTestApp.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
-
-[LibraryClasses]
- ShellCEntryLib
- UefiLib
- SortLib
-
diff --git a/ShellPkg/Include/Guid/ShellAliasGuid.h b/ShellPkg/Include/Guid/ShellAliasGuid.h
deleted file mode 100644
index 200e358688..0000000000
--- a/ShellPkg/Include/Guid/ShellAliasGuid.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/** @file
- GUID for Shell Variable for Get/Set via runtime services.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_ALIAS_VARIABLE_GUID_H_
-#define _SHELL_ALIAS_VARIABLE_GUID_H_
-
-#define SHELL_ALIAS_VARIABLE_GUID \
-{ \
- 0x0053d9d6, 0x2659, 0x4599, { 0xa2, 0x6b, 0xef, 0x45, 0x36, 0xe6, 0x31, 0xa9 } \
-}
-
-extern EFI_GUID gShellAliasGuid;
-
-#endif \ No newline at end of file
diff --git a/ShellPkg/Include/Guid/ShellEnvironment2Ext.h b/ShellPkg/Include/Guid/ShellEnvironment2Ext.h
deleted file mode 100644
index a18d16c0e9..0000000000
--- a/ShellPkg/Include/Guid/ShellEnvironment2Ext.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/** @file
- GUID for EFI shell Environment2 Extension.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELLPKG_SHELL_ENV2_EXT_GUID_H_
-#define _SHELLPKG_SHELL_ENV2_EXT_GUID_H_
-
-#define SHELLPKG_SHELL_ENV2_EXT_GUID \
-{ \
- 0xd2c18636, 0x40e5, 0x4eb5, {0xa3, 0x1b, 0x36, 0x69, 0x5f, 0xd4, 0x2c, 0x87} \
-}
-
-extern EFI_GUID gEfiShellEnvironment2ExtGuid;
-
-#endif
diff --git a/ShellPkg/Include/Guid/ShellLibHiiGuid.h b/ShellPkg/Include/Guid/ShellLibHiiGuid.h
deleted file mode 100644
index 26d3279d46..0000000000
--- a/ShellPkg/Include/Guid/ShellLibHiiGuid.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/** @file
- GUIDs for HII package list installed by Shell libraries.
-
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELLLIB_HII_GUID_H_
-#define _SHELLLIB_HII_GUID_H_
-
-#define HANDLE_PARSING_HII_GUID \
- { \
- 0xb8969637, 0x81de, 0x43af, { 0xbc, 0x9a, 0x24, 0xd9, 0x89, 0x13, 0xf2, 0xf6 } \
- }
-
-#define SHELL_DEBUG1_HII_GUID \
- { \
- 0x25f200aa, 0xd3cb, 0x470a, { 0xbf, 0x51, 0xe7, 0xd1, 0x62, 0xd2, 0x2e, 0x6f } \
- }
-
-#define SHELL_DRIVER1_HII_GUID \
- { \
- 0xaf0b742, 0x63ec, 0x45bd, {0x8d, 0xb6, 0x71, 0xad, 0x7f, 0x2f, 0xe8, 0xe8} \
- }
-
-#define SHELL_INSTALL1_HII_GUID \
- { \
- 0x7d574d54, 0xd364, 0x4d4a, { 0x95, 0xe3, 0x49, 0x45, 0xdb, 0x7a, 0xd3, 0xee } \
- }
-
-#define SHELL_LEVEL1_HII_GUID \
- { \
- 0xdec5daa4, 0x6781, 0x4820, { 0x9c, 0x63, 0xa7, 0xb0, 0xe4, 0xf1, 0xdb, 0x31 } \
- }
-
-#define SHELL_LEVEL2_HII_GUID \
- { \
- 0xf95a7ccc, 0x4c55, 0x4426, { 0xa7, 0xb4, 0xdc, 0x89, 0x61, 0x95, 0xb, 0xae } \
- }
-
-#define SHELL_LEVEL3_HII_GUID \
- { \
- 0x4344558d, 0x4ef9, 0x4725, { 0xb1, 0xe4, 0x33, 0x76, 0xe8, 0xd6, 0x97, 0x4f } \
- }
-
-#define SHELL_NETWORK1_HII_GUID \
- { \
- 0xf3d301bb, 0xf4a5, 0x45a8, { 0xb0, 0xb7, 0xfa, 0x99, 0x9c, 0x62, 0x37, 0xae } \
- }
-
-extern EFI_GUID gHandleParsingHiiGuid;
-extern EFI_GUID gShellDebug1HiiGuid;
-extern EFI_GUID gShellDriver1HiiGuid;
-extern EFI_GUID gShellInstall1HiiGuid;
-extern EFI_GUID gShellLevel1HiiGuid;
-extern EFI_GUID gShellLevel2HiiGuid;
-extern EFI_GUID gShellLevel3HiiGuid;
-extern EFI_GUID gShellNetwork1HiiGuid;
-
-#endif
diff --git a/ShellPkg/Include/Guid/ShellMapGuid.h b/ShellPkg/Include/Guid/ShellMapGuid.h
deleted file mode 100644
index 180a41bf53..0000000000
--- a/ShellPkg/Include/Guid/ShellMapGuid.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/** @file
- GUID for Shell Map for Get/Set via runtime services.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_MAP_GUID_H_
-#define _SHELL_MAP_GUID_H_
-
-#define SHELL_MAP_GUID \
-{ \
- 0x51271e13, 0x7de3, 0x43af, { 0x8b, 0xc2, 0x71, 0xad, 0x3b, 0x82, 0x43, 0x25 } \
-}
-
-extern EFI_GUID gShellMapGuid;
-
-#endif \ No newline at end of file
diff --git a/ShellPkg/Include/Guid/ShellPkgTokenSpace.h b/ShellPkg/Include/Guid/ShellPkgTokenSpace.h
deleted file mode 100644
index d8e1b3acfb..0000000000
--- a/ShellPkg/Include/Guid/ShellPkgTokenSpace.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/** @file
- GUID for ShellPkg PCD Token Space.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELLPKG_TOKEN_SPACE_GUID_H_
-#define _SHELLPKG_TOKEN_SPACE_GUID_H_
-
-#define EFI_SHELLPKG_TOKEN_SPACE_GUID \
-{ \
- 0x171e9188, 0x31d3, 0x40f5, { 0xb1, 0xc, 0x53, 0x9b, 0x2d, 0xb9, 0x40, 0xcd } \
-}
-
-extern EFI_GUID gEfiShellPkgTokenSpaceGuid;
-
-#endif
diff --git a/ShellPkg/Include/Guid/ShellVariableGuid.h b/ShellPkg/Include/Guid/ShellVariableGuid.h
deleted file mode 100644
index b93c94774b..0000000000
--- a/ShellPkg/Include/Guid/ShellVariableGuid.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/** @file
- GUID for Shell Variable for Get/Set via runtime services.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_VARIABLE_GUID_H_
-#define _SHELL_VARIABLE_GUID_H_
-
-#define SHELL_VARIABLE_GUID \
-{ \
- 0x158def5a, 0xf656, 0x419c, { 0xb0, 0x27, 0x7a, 0x31, 0x92, 0xc0, 0x79, 0xd2 } \
-}
-
-extern EFI_GUID gShellVariableGuid;
-
-#endif \ No newline at end of file
diff --git a/ShellPkg/Include/Library/FileHandleLib.h b/ShellPkg/Include/Library/FileHandleLib.h
deleted file mode 100644
index 6c79397570..0000000000
--- a/ShellPkg/Include/Library/FileHandleLib.h
+++ /dev/null
@@ -1,498 +0,0 @@
-/** @file
- Provides interface to EFI_FILE_HANDLE functionality.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _FILE_HANDLE_LIBRARY_HEADER_
-#define _FILE_HANDLE_LIBRARY_HEADER_
-
-#include <Protocol/SimpleFileSystem.h>
-
-/// The tag for use in identifying UNICODE files.
-/// If the file is UNICODE, the first 16 bits of the file will equal this value.
-extern CONST UINT16 gUnicodeFileTag;
-
-/**
- This function retrieves information about the file for the handle
- specified and stores it in the allocated pool memory.
-
- This function allocates a buffer to store the file's information. It is the
- caller's responsibility to free the buffer.
-
- @param[in] FileHandle The file handle of the file for which information is
- being requested.
-
- @retval NULL Information could not be retrieved.
- @retval !NULL The information about the file.
-**/
-EFI_FILE_INFO*
-EFIAPI
-FileHandleGetInfo (
- IN EFI_FILE_HANDLE FileHandle
- );
-
-/**
- This function sets the information about the file for the opened handle
- specified.
-
- @param[in] FileHandle The file handle of the file for which information
- is being set.
-
- @param[in] FileInfo The information to set.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER A parameter was out of range or invalid.
- @retval EFI_UNSUPPORTED The FileHandle does not support FileInfo.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleSetInfo (
- IN EFI_FILE_HANDLE FileHandle,
- IN CONST EFI_FILE_INFO *FileInfo
- );
-
-/**
- This function reads information from an opened file.
-
- If FileHandle is not a directory, the function reads the requested number of
- bytes from the file at the file's current position and returns them in Buffer.
- If the read goes beyond the end of the file, the read length is truncated to the
- end of the file. The file's current position is increased by the number of bytes
- returned. If FileHandle is a directory, the function reads the directory entry
- at the file's current position and returns the entry in Buffer. If the Buffer
- is not large enough to hold the current directory entry, then
- EFI_BUFFER_TOO_SMALL is returned and the current file position is not updated.
- BufferSize is set to be the size of the buffer needed to read the entry. On
- success, the current position is updated to the next directory entry. If there
- are no more directory entries, the read returns a zero-length buffer.
- EFI_FILE_INFO is the structure returned as the directory entry.
-
- @param[in] FileHandle The opened file handle.
- @param[in, out] BufferSize On input, the size of buffer in bytes. On return,
- the number of bytes written.
- @param[out] Buffer The buffer to put read data into.
-
- @retval EFI_SUCCESS Data was read.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required
- size.
-
-**/
-EFI_STATUS
-EFIAPI
-FileHandleRead(
- IN EFI_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- );
-
-/**
- Write data to a file.
-
- This function writes the specified number of bytes to the file at the current
- file position. The current file position is advanced the actual number of bytes
- written, which is returned in BufferSize. Partial writes only occur when there
- has been a data error during the write attempt (such as "volume space full").
- The file is automatically grown to hold the data if required. Direct writes to
- opened directories are not supported.
-
- @param[in] FileHandle The opened file for writing.
- @param[in, out] BufferSize On input, the number of bytes in Buffer. On output,
- the number of bytes written.
- @param[in] Buffer The buffer containing data to write is stored.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED Writes to an open directory are not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write-protected.
- @retval EFI_ACCESS_DENIED The file was opened for read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleWrite(
- IN EFI_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- );
-
-/**
- Close an open file handle.
-
- This function closes a specified file handle. All "dirty" cached file data is
- flushed to the device, and the file is closed. In all cases the handle is
- closed.
-
- @param[in] FileHandle The file handle to close.
-
- @retval EFI_SUCCESS The file handle was closed successfully.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleClose (
- IN EFI_FILE_HANDLE FileHandle
- );
-
-/**
- Delete a file and close the handle.
-
- This function closes and deletes a file. In all cases the file handle is closed.
- If the file cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is
- returned, but the handle is still closed.
-
- @param[in] FileHandle The file handle to delete.
-
- @retval EFI_SUCCESS The file was closed successfully.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed, but the file was not
- deleted.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleDelete (
- IN EFI_FILE_HANDLE FileHandle
- );
-
-/**
- Set the current position in a file.
-
- This function sets the current file position for the handle to the position
- supplied. With the exception of moving to position 0xFFFFFFFFFFFFFFFF, only
- absolute positioning is supported, and moving past the end of the file is
- allowed (a subsequent write would grow the file). Moving to position
- 0xFFFFFFFFFFFFFFFF causes the current position to be set to the end of the file.
- If FileHandle is a directory, the only position that may be set is zero. This
- has the effect of starting the read process of the directory entries over again.
-
- @param[in] FileHandle The file handle on which the position is being set.
- @param[in] Position The byte position from the begining of the file.
-
- @retval EFI_SUCCESS The operation completed sucessfully.
- @retval EFI_UNSUPPORTED The request for non-zero is not valid on
- directories.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleSetPosition (
- IN EFI_FILE_HANDLE FileHandle,
- IN UINT64 Position
- );
-
-/**
- Gets a file's current position.
-
- This function retrieves the current file position for the file handle. For
- directories, the current file position has no meaning outside of the file
- system driver. As such, the operation is not supported. An error is returned
- if FileHandle is a directory.
-
- @param[in] FileHandle The open file handle on which to get the position.
- @param[out] Position The byte position from begining of file.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED The request is not valid on directories.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleGetPosition (
- IN EFI_FILE_HANDLE FileHandle,
- OUT UINT64 *Position
- );
-/**
- Flushes data on a file.
-
- This function flushes all modified data associated with a file to a device.
-
- @param[in] FileHandle The file handle on which to flush data.
-
- @retval EFI_SUCCESS The data was flushed.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened for read only.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleFlush (
- IN EFI_FILE_HANDLE FileHandle
- );
-
-/**
- Function to determine if a given handle is a directory handle.
-
- If DirHandle is NULL, then ASSERT().
-
- Open the file information on the DirHandle, and verify that the Attribute
- includes EFI_FILE_DIRECTORY bit set.
-
- @param[in] DirHandle The handle to open the file.
-
- @retval EFI_SUCCESS DirHandle is a directory.
- @retval EFI_INVALID_PARAMETER DirHandle did not have EFI_FILE_INFO available.
- @retval EFI_NOT_FOUND DirHandle is not a directory.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleIsDirectory (
- IN EFI_FILE_HANDLE DirHandle
- );
-
-/** Retrieve first entry from a directory.
-
- This function takes an open directory handle and gets information from the
- first entry in the directory. A buffer is allocated to contain
- the information and a pointer to the buffer is returned in *Buffer. The
- caller can use FileHandleFindNextFile() to get subsequent directory entries.
-
- The buffer will be freed by FileHandleFindNextFile() when the last directory
- entry is read. Otherwise, the caller must free the buffer, using FreePool,
- when finished with it.
-
- @param[in] DirHandle The file handle of the directory to search.
- @param[out] Buffer The pointer to pointer to buffer for file's information.
-
- @retval EFI_SUCCESS Found the first file.
- @retval EFI_NOT_FOUND Cannot find the directory.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @return Others The status of FileHandleGetInfo, FileHandleSetPosition,
- or FileHandleRead.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleFindFirstFile (
- IN EFI_FILE_HANDLE DirHandle,
- OUT EFI_FILE_INFO **Buffer
- );
-
-/** Retrieve next entries from a directory.
-
- To use this function, the caller must first call the FileHandleFindFirstFile()
- function to get the first directory entry. Subsequent directory entries are
- retrieved by using the FileHandleFindNextFile() function. This function can
- be called several times to get each entry from the directory. If the call of
- FileHandleFindNextFile() retrieved the last directory entry, the next call of
- this function will set *NoFile to TRUE and free the buffer.
-
- @param[in] DirHandle The file handle of the directory.
- @param[out] Buffer The pointer to buffer for file's information.
- @param[out] NoFile The pointer to boolean when last file is found.
-
- @retval EFI_SUCCESS Found the next file, or reached last file.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleFindNextFile(
- IN EFI_FILE_HANDLE DirHandle,
- OUT EFI_FILE_INFO *Buffer,
- OUT BOOLEAN *NoFile
- );
-
-/**
- Retrieve the size of a file.
-
- If FileHandle is NULL then ASSERT().
- If Size is NULL then ASSERT().
-
- This function extracts the file size info from the FileHandle's EFI_FILE_INFO
- data.
-
- @param[in] FileHandle The file handle from which size is retrieved.
- @param[out] Size The pointer to size.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR Cannot access the file.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleGetSize (
- IN EFI_FILE_HANDLE FileHandle,
- OUT UINT64 *Size
- );
-
-/**
- Set the size of a file.
-
- If FileHandle is NULL then ASSERT().
-
- This function changes the file size info from the FileHandle's EFI_FILE_INFO
- data.
-
- @param[in] FileHandle The file handle whose size is to be changed.
- @param[in] Size The new size.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR Cannot access the file.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleSetSize (
- IN EFI_FILE_HANDLE FileHandle,
- IN UINT64 Size
- );
-
-/**
- Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the
- directory 'stack'.
-
- @param[in] Handle Handle to the Directory or File to create path to.
- @param[out] FullFileName Pointer to pointer to generated full file name. It
- is the responsibility of the caller to free this memory
- with a call to FreePool().
- @retval EFI_SUCCESS The operation was successful and FullFileName is valid.
- @retval EFI_INVALID_PARAMETER Handle was NULL.
- @retval EFI_INVALID_PARAMETER FullFileName was NULL.
- @retval EFI_OUT_OF_MEMORY A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleGetFileName (
- IN CONST EFI_FILE_HANDLE Handle,
- OUT CHAR16 **FullFileName
- );
-
-/**
- Function to read a single line (up to but not including the \n) from a file.
-
- If the position upon start is 0, then the Ascii Boolean will be set. This should be
- maintained and not changed for all operations with the same file.
-
- @param[in] Handle FileHandle to read from.
- @param[in, out] Buffer The pointer to buffer to read into.
- @param[in, out] Size The pointer to number of bytes in Buffer.
- @param[in] Truncate If the buffer is large enough, this has no effect.
- If the buffer is is too small and Truncate is TRUE,
- the line will be truncated.
- If the buffer is is too small and Truncate is FALSE,
- then no read will occur.
-
- @param[in, out] Ascii Boolean value for indicating whether the file is
- Ascii (TRUE) or UCS2 (FALSE).
-
- @retval EFI_SUCCESS The operation was successful. The line is stored in
- Buffer.
- @retval EFI_INVALID_PARAMETER Handle was NULL.
- @retval EFI_INVALID_PARAMETER Size was NULL.
- @retval EFI_BUFFER_TOO_SMALL Size was not large enough to store the line.
- Size was updated to the minimum space required.
- @sa FileHandleRead
-**/
-EFI_STATUS
-EFIAPI
-FileHandleReadLine(
- IN EFI_FILE_HANDLE Handle,
- IN OUT CHAR16 *Buffer,
- IN OUT UINTN *Size,
- IN BOOLEAN Truncate,
- IN OUT BOOLEAN *Ascii
- );
-
-/**
- Function to read a single line from a file. The \n is not included in the returned
- buffer. The returned buffer must be callee freed.
-
- If the position upon start is 0, then the Ascii Boolean will be set. This should be
- maintained and not changed for all operations with the same file.
-
- @param[in] Handle FileHandle to read from.
- @param[in, out] Ascii Boolean value for indicating whether the file is
- Ascii (TRUE) or UCS2 (FALSE).
-
- @return The line of text from the file.
-
- @sa FileHandleReadLine
-**/
-CHAR16*
-EFIAPI
-FileHandleReturnLine(
- IN EFI_FILE_HANDLE Handle,
- IN OUT BOOLEAN *Ascii
- );
-
-/**
- Function to write a line of unicode text to a file.
-
- If Handle is NULL, ASSERT.
-
- @param[in] Handle FileHandle to write to.
- @param[in] Buffer Buffer to write, if NULL the function will
- take no action and return EFI_SUCCESS.
-
- @retval EFI_SUCCESS The data was written.
- @retval other Failure.
-
- @sa FileHandleWrite
-**/
-EFI_STATUS
-EFIAPI
-FileHandleWriteLine(
- IN EFI_FILE_HANDLE Handle,
- IN CHAR16 *Buffer
- );
-
-/**
- Function to take a formatted argument and print it to a file.
-
- @param[in] Handle The file handle for the file to write to.
- @param[in] Format The format argument (see printlib for the format specifier).
- @param[in] ... The variable arguments for the format.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval other A return value from FileHandleWriteLine.
-
- @sa FileHandleWriteLine
-**/
-EFI_STATUS
-EFIAPI
-FileHandlePrintLine(
- IN EFI_FILE_HANDLE Handle,
- IN CONST CHAR16 *Format,
- ...
- );
-
-/**
- Function to determine if a FILE_HANDLE is at the end of the file.
-
- This will NOT work on directories.
-
- If Handle is NULL, then ASSERT().
-
- @param[in] Handle The file handle.
-
- @retval TRUE The position is at the end of the file.
- @retval FALSE The position is not at the end of the file.
-**/
-BOOLEAN
-EFIAPI
-FileHandleEof(
- IN EFI_FILE_HANDLE Handle
- );
-
-#endif //_FILE_HANDLE_LIBRARY_HEADER_
-
diff --git a/ShellPkg/Include/Library/HandleParsingLib.h b/ShellPkg/Include/Library/HandleParsingLib.h
deleted file mode 100644
index 8c0b81d12c..0000000000
--- a/ShellPkg/Include/Library/HandleParsingLib.h
+++ /dev/null
@@ -1,343 +0,0 @@
-/** @file
- Provides interface to advanced shell functionality for parsing both handle and protocol database.
-
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __HANDLE_PARSING_LIB__
-#define __HANDLE_PARSING_LIB__
-
-#include <Uefi.h>
-
-/**
- Function to get the name of a protocol or struct from it's GUID.
-
- If Guid is NULL, then ASSERT.
-
- @param[in] Guid The GUID to look for the name of.
- @param[in] Lang The language to use.
-
- @return The pointer to a string of the name. The caller
- is responsible to free this memory.
-**/
-CHAR16*
-EFIAPI
-GetStringNameFromGuid(
- IN CONST EFI_GUID *Guid,
- IN CONST CHAR8 *Lang OPTIONAL
- );
-
-/**
- Function to get the Guid for a protocol or struct based on it's string name.
-
- @param[in] Name The pointer to the string name.
- @param[in] Lang The pointer to the language code (string).
- @param[in] Guid The pointer to the pointer to the Guid.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-GetGuidFromStringName(
- IN CONST CHAR16 *Name,
- IN CONST CHAR8 *Lang OPTIONAL,
- IN EFI_GUID **Guid
- );
-
-/**
- Function to dump protocol information from a handle.
-
- This function will return a allocated string buffer containing the
- information. The caller is responsible for freeing the memory.
-
- If Guid is NULL, ASSERT().
- If TheHandle is NULL, ASSERT().
-
- @param[in] TheHandle The handle to dump information from.
- @param[in] Guid The GUID of the protocol to dump.
- @param[in] Verbose TRUE for extra info. FALSE otherwise.
-
- @return The pointer to string.
- @retval NULL An error was encountered.
-**/
-CHAR16*
-EFIAPI
-GetProtocolInformationDump(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST EFI_GUID *Guid,
- IN CONST BOOLEAN Verbose
- );
-
-/**
- Function to retrieve the driver name (if possible) from the ComponentName or
- ComponentName2 protocol.
-
- The string returned must be callee freed.
-
- @param[in] TheHandle The driver handle to get the name of.
- @param[in] Language The language to use.
-
- @retval NULL The name could not be found.
- @return A pointer to the string name. Do not de-allocate the memory.
-**/
-CONST CHAR16*
-EFIAPI
-GetStringNameFromHandle(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST CHAR8 *Language
- );
-
-#define HR_UNKNOWN 0
-#define HR_IMAGE_HANDLE BIT1
-#define HR_DRIVER_BINDING_HANDLE BIT2 // has driver binding
-#define HR_DEVICE_DRIVER BIT3 // device driver (hybrid?)
-#define HR_BUS_DRIVER BIT4 // a bus driver (hybrid?)
-#define HR_DRIVER_CONFIGURATION_HANDLE BIT5
-#define HR_DRIVER_DIAGNOSTICS_HANDLE BIT6
-#define HR_COMPONENT_NAME_HANDLE BIT7
-#define HR_DEVICE_HANDLE BIT8
-#define HR_PARENT_HANDLE BIT9
-#define HR_CONTROLLER_HANDLE BIT10
-#define HR_CHILD_HANDLE BIT11
-#define HR_VALID_MASK (BIT1|BIT2|BIT3|BIT4|BIT5|BIT6|BIT7|BIT8|BIT9|BIT10|BIT11)
-
-/**
- Gets all the related EFI_HANDLEs based on the mask supplied.
-
- This function will scan all EFI_HANDLES in the UEFI environment's handle database
- and return all the ones with the specified relationship (Mask) to the specified
- controller handle.
-
- If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT.
- If MatchingHandleCount is NULL, then ASSERT.
-
- If MatchingHandleBuffer is not NULL upon a successful return, the memory must be
- caller freed.
-
- @param[in] DriverBindingHandle The handle with Driver Binding protocol on it.
- @param[in] ControllerHandle The handle with Device Path protocol on it.
- @param[in] Mask The mask of what relationship(s) is desired.
- @param[in] MatchingHandleCount The pointer to UINTN specifying number of HANDLES in
- MatchingHandleBuffer.
- @param[out] MatchingHandleBuffer On a successful return, a buffer of MatchingHandleCount
- EFI_HANDLEs with a terminating NULL EFI_HANDLE.
-
- @retval EFI_SUCCESS The operation was successful, and any related handles
- are in MatchingHandleBuffer.
- @retval EFI_NOT_FOUND No matching handles were found.
- @retval EFI_INVALID_PARAMETER A parameter was invalid or out of range.
- @sa ParseHandleDatabaseByRelationshipWithType
-**/
-EFI_STATUS
-EFIAPI
-ParseHandleDatabaseByRelationship (
- IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL,
- IN CONST EFI_HANDLE ControllerHandle OPTIONAL,
- IN CONST UINTN Mask,
- IN UINTN *MatchingHandleCount,
- OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL
- );
-
-/**
- Gets all the related EFI_HANDLEs based on the mask supplied.
-
- This function scans all EFI_HANDLES in the UEFI environment's handle database
- and returns the ones with the specified relationship (Mask) to the specified
- controller handle.
-
- If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT.
- If MatchingHandleCount is NULL, then ASSERT.
-
- If MatchingHandleBuffer is not NULL upon a successful return the memory must be
- caller freed.
-
- @param[in] DriverBindingHandle The handle with Driver Binding protocol on it.
- @param[in] ControllerHandle The handle with Device Path protocol on it.
- @param[in] MatchingHandleCount The pointer to UINTN that specifies the number of HANDLES in
- MatchingHandleBuffer.
- @param[out] MatchingHandleBuffer On a successful return, a buffer of MatchingHandleCount
- EFI_HANDLEs with a terminating NULL EFI_HANDLE.
- @param[out] HandleType An array of type information.
-
- @retval EFI_SUCCESS The operation was successful, and any related handles
- are in MatchingHandleBuffer.
- @retval EFI_NOT_FOUND No matching handles were found.
- @retval EFI_INVALID_PARAMETER A parameter was invalid or out of range.
-**/
-EFI_STATUS
-EFIAPI
-ParseHandleDatabaseByRelationshipWithType (
- IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL,
- IN CONST EFI_HANDLE ControllerHandle OPTIONAL,
- IN UINTN *HandleCount,
- OUT EFI_HANDLE **HandleBuffer,
- OUT UINTN **HandleType
- );
-
-/**
- Gets handles for any parents of the passed in controller.
-
- @param[in] ControllerHandle The handle of the controller.
- @param[in] Count The pointer to the number of handles in
- MatchingHandleBuffer on return.
- @param[out] Buffer The buffer containing handles on a successful
- return.
- @retval EFI_SUCCESS The operation was successful.
- @sa ParseHandleDatabaseByRelationship
-**/
-#define PARSE_HANDLE_DATABASE_PARENTS(ControllerHandle, Count, Buffer) \
- ParseHandleDatabaseByRelationship(NULL, ControllerHandle, HR_PARENT_HANDLE, Count, Buffer)
-
-/**
- Gets handles for any UEFI drivers of the passed in controller.
-
- @param[in] ControllerHandle The handle of the controller.
- @param[in] Count The pointer to the number of handles in
- MatchingHandleBuffer on return.
- @param[out] Buffer The buffer containing handles on a successful
- return.
- @retval EFI_SUCCESS The operation was successful.
- @sa ParseHandleDatabaseByRelationship
-**/
-#define PARSE_HANDLE_DATABASE_UEFI_DRIVERS(ControllerHandle, Count, Buffer) \
- ParseHandleDatabaseByRelationship(NULL, ControllerHandle, HR_DRIVER_BINDING_HANDLE|HR_DEVICE_DRIVER, Count, Buffer)
-
-/**
- Gets handles for any children of the passed in controller by the passed in driver handle.
-
- @param[in] DriverHandle The handle of the driver.
- @param[in] ControllerHandle The handle of the controller.
- @param[in] Count The pointer to the number of handles in
- MatchingHandleBuffer on return.
- @param[out] Buffer The buffer containing handles on a successful
- return.
- @retval EFI_SUCCESS The operation was successful.
- @sa ParseHandleDatabaseByRelationship
-**/
-#define PARSE_HANDLE_DATABASE_MANAGED_CHILDREN(DriverHandle, ControllerHandle, Count, Buffer) \
- ParseHandleDatabaseByRelationship(DriverHandle, ControllerHandle, HR_CHILD_HANDLE|HR_DEVICE_HANDLE, Count, Buffer)
-
-/**
- Gets handles for any devices managed by the passed in driver.
-
- @param[in] DriverHandle The handle of the driver.
- @param[in] Count The pointer to the number of handles in
- MatchingHandleBuffer on return.
- @param[out] Buffer The buffer containing handles on a successful
- return.
- @retval EFI_SUCCESS The operation was successful.
- @sa ParseHandleDatabaseByRelationship
-**/
-#define PARSE_HANDLE_DATABASE_DEVICES(DriverHandle, Count, Buffer) \
- ParseHandleDatabaseByRelationship(DriverHandle, NULL, HR_CONTROLLER_HANDLE|HR_DEVICE_HANDLE, Count, Buffer)
-
-/**
- Gets handles for any child devices produced by the passed in driver.
-
- @param[in] DriverHandle The handle of the driver.
- @param[in] MatchingHandleCount The pointer to the number of handles in
- MatchingHandleBuffer on return.
- @param[out] MatchingHandleBuffer The buffer containing handles on a successful
- return.
- @retval EFI_SUCCESS The operation was successful.
- @sa ParseHandleDatabaseByRelationship
-**/
-EFI_STATUS
-EFIAPI
-ParseHandleDatabaseForChildDevices(
- IN CONST EFI_HANDLE DriverHandle,
- IN UINTN *MatchingHandleCount,
- OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL
- );
-
-/**
- Gets handles for any child controllers of the passed in controller.
-
- @param[in] ControllerHandle The handle of the "parent controller".
- @param[in] MatchingHandleCount The pointer to the number of handles in
- MatchingHandleBuffer on return.
- @param[out] MatchingHandleBuffer The buffer containing handles on a successful
- return.
- @retval EFI_SUCCESS The operation was successful.
- @sa ParseHandleDatabaseByRelationship
-**/
-EFI_STATUS
-EFIAPI
-ParseHandleDatabaseForChildControllers(
- IN CONST EFI_HANDLE ControllerHandle,
- IN UINTN *MatchingHandleCount,
- OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL
- );
-
-
-/**
- Function to retrieve the human-friendly index of a given handle. If the handle
- does not have a index one will be automatically assigned. The index value is valid
- until the termination of the shell application.
-
- @param[in] TheHandle The handle to retrieve an index for.
-
- @retval 0 A memory allocation failed.
- @return The index of the handle.
-
-**/
-UINTN
-EFIAPI
-ConvertHandleToHandleIndex(
- IN CONST EFI_HANDLE TheHandle
- );
-
-/**
- Function to retrieve the EFI_HANDLE from the human-friendly index.
-
- @param[in] TheIndex The index to retrieve the EFI_HANDLE for.
-
- @retval NULL The index was invalid.
- @return The EFI_HANDLE that index represents.
-
-**/
-EFI_HANDLE
-EFIAPI
-ConvertHandleIndexToHandle(
- IN CONST UINTN TheIndex
- );
-
-/**
- Function to get all handles that support a given protocol or all handles.
-
- @param[in] ProtocolGuid The guid of the protocol to get handles for. If NULL
- then the function will return all handles.
-
- @retval NULL A memory allocation failed.
- @return A NULL terminated list of handles.
-**/
-EFI_HANDLE*
-EFIAPI
-GetHandleListByProtocol (
- IN CONST EFI_GUID *ProtocolGuid OPTIONAL
- );
-
-/**
- Function to get all handles that support some protocols.
-
- @param[in] ProtocolGuids A NULL terminated list of protocol GUIDs.
-
- @retval NULL A memory allocation failed.
- @retval NULL ProtocolGuids was NULL.
- @return A NULL terminated list of EFI_HANDLEs.
-**/
-EFI_HANDLE*
-EFIAPI
-GetHandleListByProtocolList (
- IN CONST EFI_GUID **ProtocolGuids
- );
-
-#endif // __HANDLE_PARSING_LIB__
diff --git a/ShellPkg/Include/Library/PathLib.h b/ShellPkg/Include/Library/PathLib.h
deleted file mode 100644
index ee473523d2..0000000000
--- a/ShellPkg/Include/Library/PathLib.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/** @file
- Provides interface to path manipulation functions.
-
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#ifndef _PATH_LIB_
-#define _PATH_LIB_
-
-#include <Base.h>
-#include <Library/BaseMemoryLib.h>
-
-/**
- Removes the last directory or file entry in a path by changing the last
- L'\' to a CHAR_NULL.
-
- @param[in, out] Path The pointer to the path to modify.
-
- @retval FALSE Nothing was found to remove.
- @retval TRUE A directory or file was removed.
-**/
-BOOLEAN
-EFIAPI
-PathRemoveLastItem(
- IN OUT CHAR16 *Path
- );
-
-/**
- Function to clean up paths.
-
- - Single periods in the path are removed.
- - Double periods in the path are removed along with a single parent directory.
- - Forward slashes L'/' are converted to backward slashes L'\'.
-
- This will be done inline and the existing buffer may be larger than required
- upon completion.
-
- @param[in] Path The pointer to the string containing the path.
-
- @retval NULL An error occured.
- @return Path in all other instances.
-**/
-CHAR16*
-EFIAPI
-PathCleanUpDirectories(
- IN CHAR16 *Path
- );
-
-#endif //_PATH_LIB_
diff --git a/ShellPkg/Include/Library/ShellCEntryLib.h b/ShellPkg/Include/Library/ShellCEntryLib.h
deleted file mode 100644
index dfbb16f9c3..0000000000
--- a/ShellPkg/Include/Library/ShellCEntryLib.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
- Provides application point extension for "C" style main funciton.
-
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_C_ENTRY_LIB_
-#define _SHELL_C_ENTRY_LIB_
-
-/**
- UEFI application entry point which has an interface similar to a
- standard C main function.
-
- The ShellCEntryLib library instance wrappers the actual UEFI application
- entry point and calls this ShellAppMain function.
-
- @param[in] Argc The number of parameters.
- @param[in] Argv The array of pointers to parameters.
-
- @retval 0 The application exited normally.
- @retval Other An error occurred.
-
-**/
-INTN
-EFIAPI
-ShellAppMain (
- IN UINTN Argc,
- IN CHAR16 **Argv
- );
-
-#endif
-
diff --git a/ShellPkg/Include/Library/ShellCommandLib.h b/ShellPkg/Include/Library/ShellCommandLib.h
deleted file mode 100644
index 13d526edf7..0000000000
--- a/ShellPkg/Include/Library/ShellCommandLib.h
+++ /dev/null
@@ -1,676 +0,0 @@
-/** @file
- Provides interface to shell internal functions for shell commands.
-
- This library is for use ONLY by shell commands linked into the shell application.
- This library will not funciton if it is used for UEFI Shell 2.0 Applications.
-
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_COMMAND_LIB_
-#define _SHELL_COMMAND_LIB_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/UnicodeCollation.h>
-#include <Protocol/SimpleFileSystem.h>
-
-#include <Library/UefiBootServicesTableLib.h>
-
-//
-// The extern global protocol poionters.
-//
-extern EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation;
-extern CONST CHAR16* SupportLevel[];
-
-//
-// The map list objects.
-//
-typedef struct {
- LIST_ENTRY Link;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- CHAR16 *MapName;
- CHAR16 *CurrentDirectoryPath;
- UINT64 Flags;
-} SHELL_MAP_LIST;
-/// List of Mappings - DeviceName and Drive Letter(ism).
-extern SHELL_MAP_LIST gShellMapList;
-/// Pointer to node of current directory in the mMapList.
-extern SHELL_MAP_LIST *gShellCurDir;
-
-/**
- Returns the help MAN fileName for a given shell command.
-
- @retval !NULL The unicode string of the MAN filename.
- @retval NULL An error ocurred.
-
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *SHELL_GET_MAN_FILENAME)(
- VOID
- );
-
-/**
- Runs a shell command on a given command line.
-
- The specific operation of a given shell command is specified in the UEFI Shell
- Specification 2.0, or in the source of the given command.
-
- Upon completion of the command run the shell protocol and environment variables
- may have been updated due to the operation.
-
- @param[in] ImageHandle The ImageHandle to the app, or NULL if
- the command built into shell.
- @param[in] SystemTable The pointer to the system table.
-
- @retval RETURN_SUCCESS The shell command was sucessful.
- @retval RETURN_UNSUPPORTED The command is not supported.
-**/
-typedef
-SHELL_STATUS
-(EFIAPI *SHELL_RUN_COMMAND)(
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Registers the handlers of type SHELL_RUN_COMMAND and
- SHELL_GET_MAN_FILENAME for each shell command.
-
- If the ShellSupportLevel is greater than the value of
- PcdShellSupportLevel, then return RETURN_UNSUPPORTED.
-
- Registers the the handlers specified by GetHelpInfoHandler and CommandHandler
- with the command specified by CommandString. If the command named by
- CommandString has already been registered, then return
- RETURN_ALREADY_STARTED.
-
- If there are not enough resources available to register the handlers, then
- RETURN_OUT_OF_RESOURCES is returned.
-
- If CommandString is NULL, then ASSERT().
- If GetHelpInfoHandler is NULL, then ASSERT().
- If CommandHandler is NULL, then ASSERT().
- If ProfileName is NULL, then ASSERT().
-
- @param[in] CommandString The pointer to the command name. This is the
- name to look for on the command line in
- the shell.
- @param[in] CommandHandler The pointer to a function that runs the
- specified command.
- @param[in] GetManFileName The pointer to a function that provides man
- filename.
- @param[in] ShellMinSupportLevel The minimum Shell Support Level which has this
- function.
- @param[in] ProfileName The profile name to require for support of this
- function.
- @param[in] CanAffectLE Indicates whether this command's return value
- can change the LASTERROR environment variable.
- @param[in] HiiHandle The handle of this command's HII entry.
- @param[in] ManFormatHelp The HII locator for the help text.
-
- @retval RETURN_SUCCESS The handlers were registered.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to
- register the shell command.
- @retval RETURN_UNSUPPORTED The ShellMinSupportLevel was higher than the
- currently allowed support level.
- @retval RETURN_ALREADY_STARTED The CommandString represents a command that
- is already registered. Only one handler set for
- a given command is allowed.
- @sa SHELL_GET_MAN_FILENAME
- @sa SHELL_RUN_COMMAND
-**/
-RETURN_STATUS
-EFIAPI
-ShellCommandRegisterCommandName (
- IN CONST CHAR16 *CommandString,
- IN SHELL_RUN_COMMAND CommandHandler,
- IN SHELL_GET_MAN_FILENAME GetManFileName,
- IN UINT32 ShellMinSupportLevel,
- IN CONST CHAR16 *ProfileName,
- IN CONST BOOLEAN CanAffectLE,
- IN CONST EFI_HANDLE HiiHandle,
- IN CONST EFI_STRING_ID ManFormatHelp
- );
-
-/**
- Checks if a command string has been registered for CommandString, and if so, it runs
- the previously registered handler for that command with the command line.
-
- If CommandString is NULL, then ASSERT().
-
- If Sections is specified, then each section name listed will be compared in a case sensitive
- manner to the section names described in Appendix B UEFI Shell 2.0 Specification. If the section exists,
- it is appended to the returned help text. If the section does not exist, no
- information is returned. If Sections is NULL, then all help text information
- available is returned.
-
- @param[in] CommandString The pointer to the command name. This is the name
- found on the command line in the shell.
- @param[in, out] RetVal The pointer to the return value from the command handler.
-
- @param[in, out] CanAffectLE Indicates whether this command's return value
- needs to be placed into LASTERROR environment variable.
-
- @retval RETURN_SUCCESS The handler was run.
- @retval RETURN_NOT_FOUND The CommandString did not match a registered
- command name.
- @sa SHELL_RUN_COMMAND
-**/
-RETURN_STATUS
-EFIAPI
-ShellCommandRunCommandHandler (
- IN CONST CHAR16 *CommandString,
- IN OUT SHELL_STATUS *RetVal,
- IN OUT BOOLEAN *CanAffectLE OPTIONAL
- );
-
-/**
- Checks if a command string has been registered for CommandString, and if so, it
- returns the MAN filename specified for that command.
-
- If CommandString is NULL, then ASSERT().
-
- @param[in] CommandString The pointer to the command name. This is the name
- found on the command line in the shell.
-
- @retval NULL The CommandString was not a registered command.
- @retval other The name of the MAN file.
- @sa SHELL_GET_MAN_FILENAME
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandGetManFileNameHandler (
- IN CONST CHAR16 *CommandString
- );
-
-
-typedef struct {
- LIST_ENTRY Link;
- CHAR16 *CommandString;
-} COMMAND_LIST;
-
-/**
- Get the list of all available shell internal commands. This is a linked list,
- via the LIST_ENTRY structure. Enumerate through it using the BaseLib linked
- list functions. Do not modify the values.
-
- @param[in] Sort TRUE to alphabetically sort the values first. FALSE otherwise.
-
- @return A linked list of all available shell commands.
-**/
-CONST COMMAND_LIST*
-EFIAPI
-ShellCommandGetCommandList (
- IN CONST BOOLEAN Sort
- );
-
-typedef struct {
- LIST_ENTRY Link;
- CHAR16 *CommandString;
- CHAR16 *Alias;
-} ALIAS_LIST;
-
-/**
- Registers aliases to be set as part of the initialization of the shell application.
-
- If Command is NULL, then ASSERT().
- If Alias is NULL, then ASSERT().
-
- @param[in] Command The pointer to the Command.
- @param[in] Alias The pointer to Alias.
-
- @retval RETURN_SUCCESS The handlers were registered.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to
- register the shell command.
-**/
-RETURN_STATUS
-EFIAPI
-ShellCommandRegisterAlias (
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Alias
- );
-
-/**
- Get the list of all shell alias commands. This is a linked list,
- via LIST_ENTRY structure. Enumerate through it using the BaseLib linked
- list functions. Do not modify the values.
-
- @return A linked list of all requested shell aliases.
-**/
-CONST ALIAS_LIST*
-EFIAPI
-ShellCommandGetInitAliasList (
- VOID
- );
-
-/**
- Determine if a given alias is on the list of built in aliases.
-
- @param[in] Alias The alias to test for.
-
- @retval TRUE The alias is a built in alias.
- @retval FALSE The alias is not a built in alias.
-**/
-BOOLEAN
-EFIAPI
-ShellCommandIsOnAliasList (
- IN CONST CHAR16 *Alias
- );
-
-/**
- Checks if a command is already on the list.
-
- @param[in] CommandString The command string to check for on the list.
-
- @retval TRUE CommandString represents a registered command.
- @retval FALSE CommandString does not represent a registered command.
-**/
-BOOLEAN
-EFIAPI
-ShellCommandIsCommandOnList (
- IN CONST CHAR16 *CommandString
- );
-
-/**
- Get the help text for a command.
-
- @param[in] CommandString The command name.
-
- @retval NULL No help text was found.
- @return The string of the help text. The caller required to free.
-**/
-CHAR16*
-EFIAPI
-ShellCommandGetCommandHelp (
- IN CONST CHAR16 *CommandString
- );
-
-/**
- Function to make sure that the above pointers are valid.
-**/
-EFI_STATUS
-EFIAPI
-CommandInit (
- VOID
- );
-
-/**
- Function to determine current state of ECHO. Echo determines if lines from scripts
- and ECHO commands are enabled.
-
- @retval TRUE Echo is currently enabled.
- @retval FALSE Echo is currently disabled.
-**/
-BOOLEAN
-EFIAPI
-ShellCommandGetEchoState (
- VOID
- );
-
-/**
- Function to set current state of ECHO. Echo determines if lines from scripts
- and ECHO commands are enabled.
-
- @param[in] State TRUE to enable Echo, FALSE otherwise.
-**/
-VOID
-EFIAPI
-ShellCommandSetEchoState (
- IN BOOLEAN State
- );
-
-
-
-/**
- Indicate that the current shell or script should exit.
-
- @param[in] ScriptOnly TRUE if exiting a script; FALSE otherwise.
- @param[in] ErrorCode The 64 bit error code to return.
-**/
-VOID
-EFIAPI
-ShellCommandRegisterExit (
- IN BOOLEAN ScriptOnly,
- IN CONST UINT64 ErrorCode
- );
-
-/**
- Retrieve the Exit code.
-
- @return the value passed into RegisterExit.
-**/
-UINT64
-EFIAPI
-ShellCommandGetExitCode (
- VOID
- );
-
-/**
- Retrieve the Exit indicator.
-
- @retval TRUE Exit was indicated.
- @retval FALSE Exit was not indicated.
-**/
-BOOLEAN
-EFIAPI
-ShellCommandGetExit (
- VOID
- );
-
-/**
- Retrieve the Exit script indicator.
-
- If ShellCommandGetExit returns FALSE, then the return from this is undefined.
-
- @retval TRUE ScriptOnly was indicated.
- @retval FALSE ScriptOnly was not indicated.
-**/
-BOOLEAN
-EFIAPI
-ShellCommandGetScriptExit (
- VOID
- );
-
-typedef struct {
- LIST_ENTRY Link; ///< List enumerator items.
- UINTN Line; ///< What line of the script file this was on.
- CHAR16 *Cl; ///< The original command line.
- VOID *Data; ///< The data structure format dependant upon Command. (not always used)
- BOOLEAN Reset; ///< Reset the command (it must be treated like a initial run (but it may have data already))
-} SCRIPT_COMMAND_LIST;
-
-typedef struct {
- CHAR16 *ScriptName; ///< The filename of this script.
- CHAR16 **Argv; ///< The parmameters to the script file.
- UINTN Argc; ///< The count of parameters.
- LIST_ENTRY CommandList; ///< The script converted to a list of commands (SCRIPT_COMMAND_LIST objects).
- SCRIPT_COMMAND_LIST *CurrentCommand; ///< The command currently being operated. If !=NULL must be a member of CommandList.
- LIST_ENTRY SubstList; ///< A list of current script loop alias' (ALIAS_LIST objects) (Used for the for %-based replacement).
-} SCRIPT_FILE;
-
-/**
- Function to return a pointer to the currently running script file object.
-
- @retval NULL A script file is not currently running.
- @return A pointer to the current script file object.
-**/
-SCRIPT_FILE*
-EFIAPI
-ShellCommandGetCurrentScriptFile (
- VOID
- );
-
-/**
- Function to set a new script as the currently running one.
-
- This function will correctly stack and unstack nested scripts.
-
- @param[in] Script The pointer to new script information structure. If NULL,
- it removes and de-allocates the topmost Script structure.
-
- @return A pointer to the current running script file after this
- change. It is NULL if removing the final script.
-**/
-SCRIPT_FILE*
-EFIAPI
-ShellCommandSetNewScript (
- IN SCRIPT_FILE *Script OPTIONAL
- );
-
-/**
- Function to cleanup all memory from a SCRIPT_FILE structure.
-
- @param[in] Script The pointer to the structure to cleanup.
-**/
-VOID
-EFIAPI
-DeleteScriptFileStruct (
- IN SCRIPT_FILE *Script
- );
-
-/**
- Function to get the current Profile string.
-
- This is used to retrieve what profiles were installed.
-
- @retval NULL There are no installed profiles.
- @return A semicolon-delimited list of profiles.
-**/
-CONST CHAR16 *
-EFIAPI
-ShellCommandGetProfileList (
- VOID
- );
-
-typedef enum {
- MappingTypeFileSystem,
- MappingTypeBlockIo,
- MappingTypeMax
-} SHELL_MAPPING_TYPE;
-
-/**
- Function to generate the next default mapping name.
-
- If the return value is not NULL then it must be callee freed.
-
- @param Type What kind of mapping name to make.
-
- @retval NULL a memory allocation failed.
- @return a new map name string
-**/
-CHAR16*
-EFIAPI
-ShellCommandCreateNewMappingName(
- IN CONST SHELL_MAPPING_TYPE Type
- );
-
-/**
- Function to initialize the table for creating consistent map names.
-
- @param[out] Table The pointer to pointer to pointer to DevicePathProtocol object.
-
- @retval EFI_SUCCESS The table was created successfully.
-**/
-EFI_STATUS
-EFIAPI
-ShellCommandConsistMappingInitialize (
- EFI_DEVICE_PATH_PROTOCOL ***Table
- );
-
-/**
- Function to uninitialize the table for creating consistent map names.
-
- The parameter must have been received from ShellCommandConsistMappingInitialize.
-
- @param[out] Table The pointer to pointer to DevicePathProtocol object.
-
- @retval EFI_SUCCESS The table was deleted successfully.
-**/
-EFI_STATUS
-EFIAPI
-ShellCommandConsistMappingUnInitialize (
- EFI_DEVICE_PATH_PROTOCOL **Table
- );
-
-/**
- Create a consistent mapped name for the device specified by DevicePath
- based on the Table.
-
- This must be called after ShellCommandConsistMappingInitialize() and
- before ShellCommandConsistMappingUnInitialize() is called.
-
- @param[in] DevicePath The pointer to the dev path for the device.
- @param[in] Table The Table of mapping information.
-
- @retval NULL A consistent mapped name could not be created.
- @return A pointer to a string allocated from pool with the device name.
-**/
-CHAR16*
-EFIAPI
-ShellCommandConsistMappingGenMappingName (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN EFI_DEVICE_PATH_PROTOCOL **Table
- );
-
-/**
- Function to search the list of mappings for the first matching node on the
- list based on the MapKey.
-
- @param[in] MapKey The pointer to the string key to search for in the map.
-
- @return the node on the list.
-**/
-SHELL_MAP_LIST*
-EFIAPI
-ShellCommandFindMapItem (
- IN CONST CHAR16 *MapKey
- );
-
-/**
- Function to add a map node to the list of map items and update the "path" environment variable (optionally).
-
- If Path is TRUE (during initialization only), the path environment variable will also be updated to include
- default paths on the new map name...
-
- Path should be FALSE when this function is called from the protocol SetMap function.
-
- @param[in] Name The human readable mapped name.
- @param[in] DevicePath The Device Path for this map.
- @param[in] Flags The Flags attribute for this map item.
- @param[in] Path TRUE to update path, FALSE to skip this step (should only be TRUE during initialization).
-
- @retval EFI_SUCCESS The addition was sucessful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
-**/
-EFI_STATUS
-EFIAPI
-ShellCommandAddMapItemAndUpdatePath(
- IN CONST CHAR16 *Name,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN CONST UINT64 Flags,
- IN CONST BOOLEAN Path
- );
-
-/**
- Creates the default map names for each device path in the system with
- a protocol depending on the Type.
-
- Also sets up the default path environment variable if Type is FileSystem.
-
- @retval EFI_SUCCESS All map names were created sucessfully.
- @retval EFI_NOT_FOUND No protocols were found in the system.
- @return Error returned from gBS->LocateHandle().
-
- @sa LocateHandle
-**/
-EFI_STATUS
-EFIAPI
-ShellCommandCreateInitialMappingsAndPaths(
- VOID
- );
-
-/**
- Converts a SHELL_FILE_HANDLE to an EFI_FILE_PROTOCOL*.
-
- @param[in] Handle The SHELL_FILE_HANDLE to convert.
-
- @return a EFI_FILE_PROTOCOL* representing the same file.
-**/
-EFI_FILE_PROTOCOL*
-EFIAPI
-ConvertShellHandleToEfiFileProtocol(
- IN CONST SHELL_FILE_HANDLE Handle
- );
-
-/**
- Remove a SHELL_FILE_HANDLE frmo the list of SHELL_FILE_HANDLES.
-
- @param[in] Handle The SHELL_FILE_HANDLE to remove.
-
- @retval TRUE The item was removed.
- @retval FALSE The item was not found.
-**/
-BOOLEAN
-EFIAPI
-ShellFileHandleRemove(
- IN CONST SHELL_FILE_HANDLE Handle
- );
-
-/**
- Converts a EFI_FILE_PROTOCOL* to an SHELL_FILE_HANDLE.
-
- @param[in] Handle The pointer to EFI_FILE_PROTOCOL to convert.
- @param[in] Path The path to the file for verification.
-
- @return a SHELL_FILE_HANDLE representing the same file.
-**/
-SHELL_FILE_HANDLE
-EFIAPI
-ConvertEfiFileProtocolToShellHandle(
- IN CONST EFI_FILE_PROTOCOL *Handle,
- IN CONST CHAR16 *Path
- );
-
-/**
- Find the path that was logged with the specified SHELL_FILE_HANDLE.
-
- @param[in] Handle The SHELL_FILE_HANDLE to query on.
-
- @return A pointer to the path for the file.
-**/
-CONST CHAR16*
-EFIAPI
-ShellFileHandleGetPath(
- IN CONST SHELL_FILE_HANDLE Handle
- );
-
-
-/**
- Function to determine if a SHELL_FILE_HANDLE is at the end of the file.
-
- This will NOT work on directories.
-
- If Handle is NULL, then ASSERT.
-
- @param[in] Handle the file handle
-
- @retval TRUE the position is at the end of the file
- @retval FALSE the position is not at the end of the file
-**/
-BOOLEAN
-EFIAPI
-ShellFileHandleEof(
- IN SHELL_FILE_HANDLE Handle
- );
-
-typedef struct {
- LIST_ENTRY Link;
- void *Buffer;
-} BUFFER_LIST;
-
-/**
- Frees any BUFFER_LIST defined type.
-
- @param[in] List The pointer to the list head.
-**/
-VOID
-EFIAPI
-FreeBufferList (
- IN BUFFER_LIST *List
- );
-
-#endif //_SHELL_COMMAND_LIB_
diff --git a/ShellPkg/Include/Library/ShellLib.h b/ShellPkg/Include/Library/ShellLib.h
deleted file mode 100644
index 7d2416d383..0000000000
--- a/ShellPkg/Include/Library/ShellLib.h
+++ /dev/null
@@ -1,1331 +0,0 @@
-/** @file
- Provides interface to shell functionality for shell commands and applications.
-
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __SHELL_LIB__
-#define __SHELL_LIB__
-
-#include <Uefi.h>
-#include <Guid/FileInfo.h>
-#include <Protocol/SimpleFileSystem.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/EfiShellInterface.h>
-#include <Protocol/EfiShellEnvironment2.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-
-// (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for bytes)
-#define MAX_FILE_NAME_LEN 512
-
-extern EFI_SHELL_PARAMETERS_PROTOCOL *gEfiShellParametersProtocol;
-extern EFI_SHELL_PROTOCOL *gEfiShellProtocol;
-
-/**
- This function will retrieve the information about the file for the handle
- specified and store it in allocated pool memory.
-
- This function allocates a buffer to store the file's information. It is the
- caller's responsibility to free the buffer.
-
- @param[in] FileHandle The file handle of the file for which information is
- being requested.
-
- @retval NULL Information could not be retrieved.
-
- @return The information about the file.
-**/
-EFI_FILE_INFO*
-EFIAPI
-ShellGetFileInfo (
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- This function sets the information about the file for the opened handle
- specified.
-
- @param[in] FileHandle The file handle of the file for which information
- is being set.
-
- @param[in] FileInfo The information to set.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER A parameter was out of range or invalid.
- @retval EFI_UNSUPPORTED The FileHandle does not support FileInfo.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-ShellSetFileInfo (
- IN SHELL_FILE_HANDLE FileHandle,
- IN EFI_FILE_INFO *FileInfo
- );
-
-/**
- This function will open a file or directory referenced by DevicePath.
-
- This function opens a file with the open mode according to the file path. The
- Attributes is valid only for EFI_FILE_MODE_CREATE.
-
- @param[in, out] FilePath On input, the device path to the file. On output,
- the remaining device path.
- @param[out] DeviceHandle Pointer to the system device handle.
- @param[out] FileHandle Pointer to the file handle.
- @param[in] OpenMode The mode to open the file with.
- @param[in] Attributes The file's file attributes.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED Could not open the file path.
- @retval EFI_NOT_FOUND The specified file could not be found on the
- device or the file system could not be found on
- the device.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the
- medium is no longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the
- file.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-ShellOpenFileByDevicePath(
- IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,
- OUT EFI_HANDLE *DeviceHandle,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode,
- IN UINT64 Attributes
- );
-
-/**
- This function will open a file or directory referenced by filename.
-
- If return is EFI_SUCCESS, the Filehandle is the opened file's handle;
- otherwise, the Filehandle is NULL. Attributes is valid only for
- EFI_FILE_MODE_CREATE.
-
- @param[in] FilePath The pointer to file name.
- @param[out] FileHandle The pointer to the file handle.
- @param[in] OpenMode The mode to open the file with.
- @param[in] Attributes The file's file attributes.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED Could not open the file path.
- @retval EFI_NOT_FOUND The specified file could not be found on the
- device or the file system could not be found
- on the device.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the
- medium is no longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the
- file.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-ShellOpenFileByName(
- IN CONST CHAR16 *FilePath,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode,
- IN UINT64 Attributes
- );
-
-/**
- This function creates a directory.
-
- If return is EFI_SUCCESS, the Filehandle is the opened directory's handle;
- otherwise, the Filehandle is NULL. If the directory already existed, this
- function opens the existing directory.
-
- @param[in] DirectoryName The pointer to Directory name.
- @param[out] FileHandle The pointer to the file handle.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED Could not open the file path.
- @retval EFI_NOT_FOUND The specified file could not be found on the
- device, or the file system could not be found
- on the device.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the
- medium is no longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the
- file.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-ShellCreateDirectory(
- IN CONST CHAR16 *DirectoryName,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- This function reads information from an opened file.
-
- If FileHandle is not a directory, the function reads the requested number of
- bytes from the file at the file's current position and returns them in Buffer.
- If the read goes beyond the end of the file, the read length is truncated to the
- end of the file. The file's current position is increased by the number of bytes
- returned. If FileHandle is a directory, the function reads the directory entry
- at the file's current position and returns the entry in Buffer. If the Buffer
- is not large enough to hold the current directory entry, then
- EFI_BUFFER_TOO_SMALL is returned and the current file position is not updated.
- BufferSize is set to be the size of the buffer needed to read the entry. On
- success, the current position is updated to the next directory entry. If there
- are no more directory entries, the read returns a zero-length buffer.
- EFI_FILE_INFO is the structure returned as the directory entry.
-
- @param[in] FileHandle The opened file handle.
- @param[in, out] ReadSize On input the size of buffer in bytes. On return
- the number of bytes written.
- @param[out] Buffer The buffer to put read data into.
-
- @retval EFI_SUCCESS Data was read.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required
- size.
-
-**/
-EFI_STATUS
-EFIAPI
-ShellReadFile(
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
- );
-
-/**
- Write data to a file.
-
- This function writes the specified number of bytes to the file at the current
- file position. The current file position is advanced the actual number of bytes
- written, which is returned in BufferSize. Partial writes only occur when there
- has been a data error during the write attempt (such as "volume space full").
- The file is automatically grown to hold the data if required. Direct writes to
- opened directories are not supported.
-
- @param[in] FileHandle The opened file for writing.
-
- @param[in, out] BufferSize On input the number of bytes in Buffer. On output
- the number of bytes written.
-
- @param[in] Buffer The buffer containing data to write is stored.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED Writes to an open directory are not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write-protected.
- @retval EFI_ACCESS_DENIED The file was open for read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-ShellWriteFile(
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- );
-
-/**
- Close an open file handle.
-
- This function closes a specified file handle. All "dirty" cached file data is
- flushed to the device, and the file is closed. In all cases the handle is
- closed.
-
- @param[in] FileHandle The file handle to close.
-
- @retval EFI_SUCCESS The file handle was closed sucessfully.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-ShellCloseFile (
- IN SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Delete a file and close the handle
-
- This function closes and deletes a file. In all cases the file handle is closed.
- If the file cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is
- returned, but the handle is still closed.
-
- @param[in] FileHandle The file handle to delete.
-
- @retval EFI_SUCCESS The file was closed sucessfully.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed, but the file was not
- deleted.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-ShellDeleteFile (
- IN SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Set the current position in a file.
-
- This function sets the current file position for the handle to the position
- supplied. With the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only
- absolute positioning is supported, and moving past the end of the file is
- allowed (a subsequent write would grow the file). Moving to position
- 0xFFFFFFFFFFFFFFFF causes the current position to be set to the end of the file.
- If FileHandle is a directory, the only position that may be set is zero. This
- has the effect of starting the read process of the directory entries over.
-
- @param[in] FileHandle The file handle on which the position is being set.
-
- @param[in] Position The byte position from the begining of the file.
-
- @retval EFI_SUCCESS Operation completed sucessfully.
- @retval EFI_UNSUPPORTED The seek request for non-zero is not valid on
- directories.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-ShellSetFilePosition (
- IN SHELL_FILE_HANDLE FileHandle,
- IN UINT64 Position
- );
-
-/**
- Gets a file's current position
-
- This function retrieves the current file position for the file handle. For
- directories, the current file position has no meaning outside of the file
- system driver and as such the operation is not supported. An error is returned
- if FileHandle is a directory.
-
- @param[in] FileHandle The open file handle on which to get the position.
- @param[out] Position The byte position from the begining of the file.
-
- @retval EFI_SUCCESS The operation completed sucessfully.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED The request is not valid on directories.
-**/
-EFI_STATUS
-EFIAPI
-ShellGetFilePosition (
- IN SHELL_FILE_HANDLE FileHandle,
- OUT UINT64 *Position
- );
-
-/**
- Flushes data on a file
-
- This function flushes all modified data associated with a file to a device.
-
- @param[in] FileHandle The file handle on which to flush data.
-
- @retval EFI_SUCCESS The data was flushed.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened for read only.
-**/
-EFI_STATUS
-EFIAPI
-ShellFlushFile (
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/** Retrieve first entry from a directory.
-
- This function takes an open directory handle and gets information from the
- first entry in the directory. A buffer is allocated to contain
- the information and a pointer to the buffer is returned in *Buffer. The
- caller can use ShellFindNextFile() to get subsequent directory entries.
-
- The buffer will be freed by ShellFindNextFile() when the last directory
- entry is read. Otherwise, the caller must free the buffer, using FreePool,
- when finished with it.
-
- @param[in] DirHandle The file handle of the directory to search.
- @param[out] Buffer The pointer to the buffer for the file's information.
-
- @retval EFI_SUCCESS Found the first file.
- @retval EFI_NOT_FOUND Cannot find the directory.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @return Others Status of ShellGetFileInfo, ShellSetFilePosition,
- or ShellReadFile.
-
- @sa ShellReadFile
-**/
-EFI_STATUS
-EFIAPI
-ShellFindFirstFile (
- IN SHELL_FILE_HANDLE DirHandle,
- OUT EFI_FILE_INFO **Buffer
- );
-
-/** Retrieve next entries from a directory.
-
- To use this function, the caller must first call the ShellFindFirstFile()
- function to get the first directory entry. Subsequent directory entries are
- retrieved by using the ShellFindNextFile() function. This function can
- be called several times to get each entry from the directory. If the call of
- ShellFindNextFile() retrieved the last directory entry, the next call of
- this function will set *NoFile to TRUE and free the buffer.
-
- @param[in] DirHandle The file handle of the directory.
- @param[in, out] Buffer The pointer to buffer for file's information.
- @param[in, out] NoFile The pointer to boolean when last file is found.
-
- @retval EFI_SUCCESS Found the next file.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
-
- @sa ShellReadFile
-**/
-EFI_STATUS
-EFIAPI
-ShellFindNextFile(
- IN SHELL_FILE_HANDLE DirHandle,
- IN OUT EFI_FILE_INFO *Buffer,
- IN OUT BOOLEAN *NoFile
- );
-
-/**
- Retrieve the size of a file.
-
- This function extracts the file size info from the FileHandle's EFI_FILE_INFO
- data.
-
- @param[in] FileHandle The file handle from which size is retrieved.
- @param[out] Size The pointer to size.
-
- @retval EFI_SUCCESS The operation was completed sucessfully.
- @retval EFI_DEVICE_ERROR Cannot access the file.
-**/
-EFI_STATUS
-EFIAPI
-ShellGetFileSize (
- IN SHELL_FILE_HANDLE FileHandle,
- OUT UINT64 *Size
- );
-
-/**
- Retrieves the status of the break execution flag
-
- This function is useful to check whether the application is being asked to halt by the shell.
-
- @retval TRUE The execution break is enabled.
- @retval FALSE The execution break is not enabled.
-**/
-BOOLEAN
-EFIAPI
-ShellGetExecutionBreakFlag(
- VOID
- );
-
-/**
- Return the value of an environment variable.
-
- This function gets the value of the environment variable set by the
- ShellSetEnvironmentVariable function.
-
- @param[in] EnvKey The key name of the environment variable.
-
- @retval NULL The named environment variable does not exist.
- @return != NULL The pointer to the value of the environment variable.
-**/
-CONST CHAR16*
-EFIAPI
-ShellGetEnvironmentVariable (
- IN CONST CHAR16 *EnvKey
- );
-
-/**
- Set the value of an environment variable.
-
- This function changes the current value of the specified environment variable. If the
- environment variable exists and the Value is an empty string, then the environment
- variable is deleted. If the environment variable exists and the Value is not an empty
- string, then the value of the environment variable is changed. If the environment
- variable does not exist and the Value is an empty string, there is no action. If the
- environment variable does not exist and the Value is a non-empty string, then the
- environment variable is created and assigned the specified value.
-
- This is not supported pre-UEFI Shell 2.0.
-
- @param[in] EnvKey The key name of the environment variable.
- @param[in] EnvVal The Value of the environment variable
- @param[in] Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
-
- @retval EFI_SUCCESS The operation completed sucessfully
- @retval EFI_UNSUPPORTED This operation is not allowed in pre-UEFI 2.0 Shell environments.
-**/
-EFI_STATUS
-EFIAPI
-ShellSetEnvironmentVariable (
- IN CONST CHAR16 *EnvKey,
- IN CONST CHAR16 *EnvVal,
- IN BOOLEAN Volatile
- );
-
-/**
- Cause the shell to parse and execute a command line.
-
- This function creates a nested instance of the shell and executes the specified
- command (CommandLine) with the specified environment (Environment). Upon return,
- the status code returned by the specified command is placed in StatusCode.
- If Environment is NULL, then the current environment is used and all changes made
- by the commands executed will be reflected in the current environment. If the
- Environment is non-NULL, then the changes made will be discarded.
- The CommandLine is executed from the current working directory on the current
- device.
-
- The EnvironmentVariables and Status parameters are ignored in a pre-UEFI Shell 2.0
- environment. The values pointed to by the parameters will be unchanged by the
- ShellExecute() function. The Output parameter has no effect in a
- UEFI Shell 2.0 environment.
-
- @param[in] ParentHandle The parent image starting the operation.
- @param[in] CommandLine The pointer to a NULL terminated command line.
- @param[in] Output True to display debug output. False to hide it.
- @param[in] EnvironmentVariables Optional pointer to array of environment variables
- in the form "x=y". If NULL, the current set is used.
- @param[out] Status The status of the run command line.
-
- @retval EFI_SUCCESS The operation completed sucessfully. Status
- contains the status code returned.
- @retval EFI_INVALID_PARAMETER A parameter contains an invalid value.
- @retval EFI_OUT_OF_RESOURCES Out of resources.
- @retval EFI_UNSUPPORTED The operation is not allowed.
-**/
-EFI_STATUS
-EFIAPI
-ShellExecute (
- IN EFI_HANDLE *ParentHandle,
- IN CHAR16 *CommandLine,
- IN BOOLEAN Output,
- IN CHAR16 **EnvironmentVariables,
- OUT EFI_STATUS *Status
- );
-
-/**
- Retreives the current directory path.
-
- If the DeviceName is NULL, it returns the current device's current directory
- name. If the DeviceName is not NULL, it returns the current directory name
- on specified drive.
-
- @param[in] DeviceName The name of the file system to get directory on.
-
- @retval NULL The directory does not exist.
- @retval != NULL The directory.
-**/
-CONST CHAR16*
-EFIAPI
-ShellGetCurrentDir (
- IN CHAR16 * CONST DeviceName OPTIONAL
- );
-
-/**
- Sets (enabled or disabled) the page break mode.
-
- When page break mode is enabled the screen will stop scrolling
- and wait for operator input before scrolling a subsequent screen.
-
- @param[in] CurrentState TRUE to enable and FALSE to disable.
-**/
-VOID
-EFIAPI
-ShellSetPageBreakMode (
- IN BOOLEAN CurrentState
- );
-
-/**
- Opens a group of files based on a path.
-
- This function uses the Arg to open all the matching files. Each matched
- file has a SHELL_FILE_ARG structure to record the file information. These
- structures are placed on the list ListHead. Users can get the SHELL_FILE_ARG
- structures from ListHead to access each file. This function supports wildcards
- and will process '?' and '*' as such. The list must be freed with a call to
- ShellCloseFileMetaArg().
-
- If you are NOT appending to an existing list *ListHead must be NULL. If
- *ListHead is NULL then it must be callee freed.
-
- @param[in] Arg The pointer to path string.
- @param[in] OpenMode Mode to open files with.
- @param[in, out] ListHead Head of linked list of results.
-
- @retval EFI_SUCCESS The operation was sucessful and the list head
- contains the list of opened files.
- @retval != EFI_SUCCESS The operation failed.
-
- @sa InternalShellConvertFileListType
-**/
-EFI_STATUS
-EFIAPI
-ShellOpenFileMetaArg (
- IN CHAR16 *Arg,
- IN UINT64 OpenMode,
- IN OUT EFI_SHELL_FILE_INFO **ListHead
- );
-
-/**
- Free the linked list returned from ShellOpenFileMetaArg.
-
- @param[in, out] ListHead The pointer to free.
-
- @retval EFI_SUCCESS The operation was sucessful.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
-**/
-EFI_STATUS
-EFIAPI
-ShellCloseFileMetaArg (
- IN OUT EFI_SHELL_FILE_INFO **ListHead
- );
-
-/**
- Find a file by searching the CWD and then the path.
-
- If FileName is NULL, then ASSERT.
-
- If the return value is not NULL then the memory must be caller freed.
-
- @param[in] FileName Filename string.
-
- @retval NULL The file was not found.
- @retval !NULL The path to the file.
-**/
-CHAR16 *
-EFIAPI
-ShellFindFilePath (
- IN CONST CHAR16 *FileName
- );
-
-/**
- Find a file by searching the CWD and then the path with a variable set of file
- extensions. If the file is not found it will append each extension in the list
- in the order provided and return the first one that is successful.
-
- If FileName is NULL, then ASSERT.
- If FileExtension is NULL, then the behavior is identical to ShellFindFilePath.
-
- If the return value is not NULL then the memory must be caller freed.
-
- @param[in] FileName The filename string.
- @param[in] FileExtension Semicolon delimited list of possible extensions.
-
- @retval NULL The file was not found.
- @retval !NULL The path to the file.
-**/
-CHAR16 *
-EFIAPI
-ShellFindFilePathEx (
- IN CONST CHAR16 *FileName,
- IN CONST CHAR16 *FileExtension
- );
-
-typedef enum {
- TypeFlag = 0, ///< A flag that is present or not present only (IE "-a").
- TypeValue, ///< A flag that has some data following it with a space (IE "-a 1").
- TypePosition, ///< Some data that did not follow a parameter (IE "filename.txt").
- TypeStart, ///< A flag that has variable value appended to the end (IE "-ad", "-afd", "-adf", etc...).
- TypeDoubleValue, ///< A flag that has 2 space seperated value data following it (IE "-a 1 2").
- TypeMaxValue, ///< A flag followed by all the command line data before the next flag.
- TypeMax,
-} SHELL_PARAM_TYPE;
-
-typedef struct {
- CHAR16 *Name;
- SHELL_PARAM_TYPE Type;
-} SHELL_PARAM_ITEM;
-
-
-/// Helper structure for no parameters (besides -? and -b)
-extern SHELL_PARAM_ITEM EmptyParamList[];
-
-/// Helper structure for -sfo only (besides -? and -b)
-extern SHELL_PARAM_ITEM SfoParamList[];
-
-/**
- Checks the command line arguments passed against the list of valid ones.
- Optionally removes NULL values first.
-
- If no initialization is required, then return RETURN_SUCCESS.
-
- @param[in] CheckList The pointer to list of parameters to check.
- @param[out] CheckPackage The package of checked values.
- @param[out] ProblemParam Optional pointer to pointer to unicode string for
- the paramater that caused failure.
- @param[in] AutoPageBreak Will automatically set PageBreakEnabled.
- @param[in] AlwaysAllowNumbers Will never fail for number based flags.
-
- @retval EFI_SUCCESS The operation completed sucessfully.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
- @retval EFI_VOLUME_CORRUPTED The command line was corrupt.
- @retval EFI_DEVICE_ERROR The commands contained 2 opposing arguments. One
- of the command line arguments was returned in
- ProblemParam if provided.
- @retval EFI_NOT_FOUND A argument required a value that was missing.
- The invalid command line argument was returned in
- ProblemParam if provided.
-**/
-EFI_STATUS
-EFIAPI
-ShellCommandLineParseEx (
- IN CONST SHELL_PARAM_ITEM *CheckList,
- OUT LIST_ENTRY **CheckPackage,
- OUT CHAR16 **ProblemParam OPTIONAL,
- IN BOOLEAN AutoPageBreak,
- IN BOOLEAN AlwaysAllowNumbers
- );
-
-/// Make it easy to upgrade from older versions of the shell library.
-#define ShellCommandLineParse(CheckList,CheckPackage,ProblemParam,AutoPageBreak) ShellCommandLineParseEx(CheckList,CheckPackage,ProblemParam,AutoPageBreak,FALSE)
-
-/**
- Frees shell variable list that was returned from ShellCommandLineParse.
-
- This function will free all the memory that was used for the CheckPackage
- list of postprocessed shell arguments.
-
- If CheckPackage is NULL, then return.
-
- @param[in] CheckPackage The list to de-allocate.
- **/
-VOID
-EFIAPI
-ShellCommandLineFreeVarList (
- IN LIST_ENTRY *CheckPackage
- );
-
-/**
- Checks for presence of a flag parameter.
-
- Flag arguments are in the form of "-<Key>" or "/<Key>", but do not have a value following the key.
-
- If CheckPackage is NULL then return FALSE.
- If KeyString is NULL then ASSERT().
-
- @param[in] CheckPackage The package of parsed command line arguments.
- @param[in] KeyString The Key of the command line argument to check for.
-
- @retval TRUE The flag is on the command line.
- @retval FALSE The flag is not on the command line.
-**/
-BOOLEAN
-EFIAPI
-ShellCommandLineGetFlag (
- IN CONST LIST_ENTRY * CONST CheckPackage,
- IN CONST CHAR16 * CONST KeyString
- );
-
-/**
- Returns value from command line argument.
-
- Value parameters are in the form of "-<Key> value" or "/<Key> value".
-
- If CheckPackage is NULL, then return NULL.
-
- @param[in] CheckPackage The package of parsed command line arguments.
- @param[in] KeyString The Key of the command line argument to check for.
-
- @retval NULL The flag is not on the command line.
- @retval !=NULL The pointer to unicode string of the value.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandLineGetValue (
- IN CONST LIST_ENTRY *CheckPackage,
- IN CHAR16 *KeyString
- );
-
-/**
- Returns raw value from command line argument.
-
- Raw value parameters are in the form of "value" in a specific position in the list.
-
- If CheckPackage is NULL, then return NULL.
-
- @param[in] CheckPackage The package of parsed command line arguments.
- @param[in] Position The position of the value.
-
- @retval NULL The flag is not on the command line.
- @retval !=NULL The pointer to unicode string of the value.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandLineGetRawValue (
- IN CONST LIST_ENTRY * CONST CheckPackage,
- IN UINTN Position
- );
-
-/**
- Returns the number of command line value parameters that were parsed.
-
- This will not include flags.
-
- @param[in] CheckPackage The package of parsed command line arguments.
-
- @retval (UINTN)-1 No parsing has occurred.
- @retval other The number of value parameters found.
-**/
-UINTN
-EFIAPI
-ShellCommandLineGetCount(
- IN CONST LIST_ENTRY *CheckPackage
- );
-
-/**
- Determines if a parameter is duplicated.
-
- If Param is not NULL, then it will point to a callee-allocated string buffer
- with the parameter value, if a duplicate is found.
-
- If CheckPackage is NULL, then ASSERT.
-
- @param[in] CheckPackage The package of parsed command line arguments.
- @param[out] Param Upon finding one, a pointer to the duplicated parameter.
-
- @retval EFI_SUCCESS No parameters were duplicated.
- @retval EFI_DEVICE_ERROR A duplicate was found.
- **/
-EFI_STATUS
-EFIAPI
-ShellCommandLineCheckDuplicate (
- IN CONST LIST_ENTRY *CheckPackage,
- OUT CHAR16 **Param
- );
-
-/**
- This function causes the shell library to initialize itself. If the shell library
- is already initialized it will de-initialize all the current protocol pointers and
- re-populate them again.
-
- When the library is used with PcdShellLibAutoInitialize set to true this function
- will return EFI_SUCCESS and perform no actions.
-
- This function is intended for internal access for shell commands only.
-
- @retval EFI_SUCCESS The initialization was complete sucessfully.
-
-**/
-EFI_STATUS
-EFIAPI
-ShellInitialize (
- VOID
- );
-
-/**
- Print at a specific location on the screen.
-
- This function will move the cursor to a given screen location and print the specified string.
-
- If -1 is specified for either the Row or Col the current screen location for BOTH
- will be used.
-
- If either Row or Col is out of range for the current console, then ASSERT.
- If Format is NULL, then ASSERT.
-
- In addition to the standard %-based flags as supported by UefiLib Print() this supports
- the following additional flags:
- %N - Set output attribute to normal
- %H - Set output attribute to highlight
- %E - Set output attribute to error
- %B - Set output attribute to blue color
- %V - Set output attribute to green color
-
- Note: The background color is controlled by the shell command cls.
-
- @param[in] Col The column to print at.
- @param[in] Row The row to print at.
- @param[in] Format The format string.
- @param[in] ... The variable argument list.
-
- @return EFI_SUCCESS The printing was successful.
- @return EFI_DEVICE_ERROR The console device reported an error.
-**/
-EFI_STATUS
-EFIAPI
-ShellPrintEx(
- IN INT32 Col OPTIONAL,
- IN INT32 Row OPTIONAL,
- IN CONST CHAR16 *Format,
- ...
- );
-
-/**
- Print at a specific location on the screen.
-
- This function will move the cursor to a given screen location and print the specified string.
-
- If -1 is specified for either the Row or Col the current screen location for BOTH
- will be used.
-
- If either Row or Col is out of range for the current console, then ASSERT.
- If Format is NULL, then ASSERT.
-
- In addition to the standard %-based flags as supported by UefiLib Print() this supports
- the following additional flags:
- %N - Set output attribute to normal.
- %H - Set output attribute to highlight.
- %E - Set output attribute to error.
- %B - Set output attribute to blue color.
- %V - Set output attribute to green color.
-
- Note: The background color is controlled by the shell command cls.
-
- @param[in] Col The column to print at.
- @param[in] Row The row to print at.
- @param[in] Language The language of the string to retrieve. If this parameter
- is NULL, then the current platform language is used.
- @param[in] HiiFormatStringId The format string Id for getting from Hii.
- @param[in] HiiFormatHandle The format string Handle for getting from Hii.
- @param[in] ... The variable argument list.
-
- @return EFI_SUCCESS The printing was successful.
- @return EFI_DEVICE_ERROR The console device reported an error.
-**/
-EFI_STATUS
-EFIAPI
-ShellPrintHiiEx(
- IN INT32 Col OPTIONAL,
- IN INT32 Row OPTIONAL,
- IN CONST CHAR8 *Language OPTIONAL,
- IN CONST EFI_STRING_ID HiiFormatStringId,
- IN CONST EFI_HANDLE HiiFormatHandle,
- ...
- );
-
-/**
- Function to determine if a given filename represents a directory.
-
- If DirName is NULL, then ASSERT.
-
- @param[in] DirName Path to directory to test.
-
- @retval EFI_SUCCESS The Path represents a directory.
- @retval EFI_NOT_FOUND The Path does not represent a directory.
- @retval other The path failed to open.
-**/
-EFI_STATUS
-EFIAPI
-ShellIsDirectory(
- IN CONST CHAR16 *DirName
- );
-
-/**
- Function to determine if a given filename represents a file.
-
- This will search the CWD only.
-
- If Name is NULL, then ASSERT.
-
- @param[in] Name Path to file to test.
-
- @retval EFI_SUCCESS The Path represents a file.
- @retval EFI_NOT_FOUND The Path does not represent a file.
- @retval other The path failed to open.
-**/
-EFI_STATUS
-EFIAPI
-ShellIsFile(
- IN CONST CHAR16 *Name
- );
-
-/**
- Function to determine if a given filename represents a file.
-
- This will search the CWD and then the Path.
-
- If Name is NULL, then ASSERT.
-
- @param[in] Name Path to file to test.
-
- @retval EFI_SUCCESS The Path represents a file.
- @retval EFI_NOT_FOUND The Path does not represent a file.
- @retval other The path failed to open.
-**/
-EFI_STATUS
-EFIAPI
-ShellIsFileInPath(
- IN CONST CHAR16 *Name
- );
-
-/**
- Function to determine whether a string is decimal or hex representation of a number
- and return the number converted from the string.
-
- Note: this function cannot be used when (UINTN)(-1), (0xFFFFFFFF) may be a valid
- result. Use ShellConvertStringToUint64 instead.
-
- @param[in] String String representation of a number.
-
- @return The unsigned integer result of the conversion.
- @retval (UINTN)(-1) An error occured.
-**/
-UINTN
-EFIAPI
-ShellStrToUintn(
- IN CONST CHAR16 *String
- );
-
-/**
- Safely append with automatic string resizing given length of Destination and
- desired length of copy from Source.
-
- Append the first D characters of Source to the end of Destination, where D is
- the lesser of Count and the StrLen() of Source. If appending those D characters
- will fit within Destination (whose Size is given as CurrentSize) and
- still leave room for a NULL terminator, then those characters are appended,
- starting at the original terminating NULL of Destination, and a new terminating
- NULL is appended.
-
- If appending D characters onto Destination will result in a overflow of the size
- given in CurrentSize the string will be grown such that the copy can be performed
- and CurrentSize will be updated to the new size.
-
- If Source is NULL, there is nothing to append, so return the current buffer in
- Destination.
-
- If Destination is NULL, then ASSERT().
- If Destination's current length (including NULL terminator) is already more than
- CurrentSize, then ASSERT().
-
- @param[in, out] Destination The String to append onto.
- @param[in, out] CurrentSize On call, the number of bytes in Destination. On
- return, possibly the new size (still in bytes). If NULL,
- then allocate whatever is needed.
- @param[in] Source The String to append from.
- @param[in] Count The maximum number of characters to append. If 0, then
- all are appended.
-
- @return The Destination after appending the Source.
-**/
-CHAR16*
-EFIAPI
-StrnCatGrow (
- IN OUT CHAR16 **Destination,
- IN OUT UINTN *CurrentSize,
- IN CONST CHAR16 *Source,
- IN UINTN Count
- );
-
-/**
- This is a find and replace function. Upon successful return the NewString is a copy of
- SourceString with each instance of FindTarget replaced with ReplaceWith.
-
- If SourceString and NewString overlap the behavior is undefined.
-
- If the string would grow bigger than NewSize it will halt and return error.
-
- @param[in] SourceString The string with source buffer.
- @param[in, out] NewString The string with resultant buffer.
- @param[in] NewSize The size in bytes of NewString.
- @param[in] FindTarget The string to look for.
- @param[in] ReplaceWith The string to replace FindTarget with.
- @param[in] SkipPreCarrot If TRUE will skip a FindTarget that has a '^'
- immediately before it.
- @param[in] ParameterReplacing If TRUE will add "" around items with spaces.
-
- @retval EFI_INVALID_PARAMETER SourceString was NULL.
- @retval EFI_INVALID_PARAMETER NewString was NULL.
- @retval EFI_INVALID_PARAMETER FindTarget was NULL.
- @retval EFI_INVALID_PARAMETER ReplaceWith was NULL.
- @retval EFI_INVALID_PARAMETER FindTarget had length < 1.
- @retval EFI_INVALID_PARAMETER SourceString had length < 1.
- @retval EFI_BUFFER_TOO_SMALL NewSize was less than the minimum size to hold
- the new string (truncation occurred).
- @retval EFI_SUCCESS The string was successfully copied with replacement.
-**/
-EFI_STATUS
-EFIAPI
-ShellCopySearchAndReplace(
- IN CHAR16 CONST *SourceString,
- IN OUT CHAR16 *NewString,
- IN UINTN NewSize,
- IN CONST CHAR16 *FindTarget,
- IN CONST CHAR16 *ReplaceWith,
- IN CONST BOOLEAN SkipPreCarrot,
- IN CONST BOOLEAN ParameterReplacing
- );
-
-/**
- Check if a Unicode character is a hexadecimal character.
-
- This internal function checks if a Unicode character is a
- numeric character. The valid hexadecimal characters are
- L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
-
-
- @param Char The character to check against.
-
- @retval TRUE The Char is a hexadecmial character.
- @retval FALSE The Char is not a hexadecmial character.
-
-**/
-BOOLEAN
-EFIAPI
-ShellIsHexaDecimalDigitCharacter (
- IN CHAR16 Char
- );
-
-/**
- Check if a Unicode character is a decimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid characters are
- L'0' to L'9'.
-
-
- @param Char The character to check against.
-
- @retval TRUE The Char is a hexadecmial character.
- @retval FALSE The Char is not a hexadecmial character.
-
-**/
-BOOLEAN
-EFIAPI
-ShellIsDecimalDigitCharacter (
- IN CHAR16 Char
- );
-
-///
-/// What type of answer is requested.
-///
-typedef enum {
- ShellPromptResponseTypeYesNo,
- ShellPromptResponseTypeYesNoCancel,
- ShellPromptResponseTypeFreeform,
- ShellPromptResponseTypeQuitContinue,
- ShellPromptResponseTypeYesNoAllCancel,
- ShellPromptResponseTypeEnterContinue,
- ShellPromptResponseTypeAnyKeyContinue,
- ShellPromptResponseTypeMax
-} SHELL_PROMPT_REQUEST_TYPE;
-
-///
-/// What answer was given.
-///
-typedef enum {
- ShellPromptResponseYes,
- ShellPromptResponseNo,
- ShellPromptResponseCancel,
- ShellPromptResponseQuit,
- ShellPromptResponseContinue,
- ShellPromptResponseAll,
- ShellPromptResponseMax
-} SHELL_PROMPT_RESPONSE;
-
-/**
- Prompt the user and return the resultant answer to the requestor.
-
- This function will display the requested question on the shell prompt and then
- wait for an apropriate answer to be input from the console.
-
- If the SHELL_PROMPT_REQUEST_TYPE is SHELL_PROMPT_REQUEST_TYPE_YESNO, ShellPromptResponseTypeQuitContinue
- or SHELL_PROMPT_REQUEST_TYPE_YESNOCANCEL then *Response is of type SHELL_PROMPT_RESPONSE.
-
- If the SHELL_PROMPT_REQUEST_TYPE is ShellPromptResponseTypeFreeform then *Response is of type
- CHAR16*.
-
- In either case *Response must be callee freed if Response was not NULL;
-
- @param Type What type of question is asked. This is used to filter the input
- to prevent invalid answers to question.
- @param Prompt The pointer to a string prompt used to request input.
- @param Response The pointer to Response, which will be populated upon return.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_UNSUPPORTED The operation is not supported as requested.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
- @return other The operation failed.
-**/
-EFI_STATUS
-EFIAPI
-ShellPromptForResponse (
- IN SHELL_PROMPT_REQUEST_TYPE Type,
- IN CHAR16 *Prompt OPTIONAL,
- IN OUT VOID **Response OPTIONAL
- );
-
-/**
- Prompt the user and return the resultant answer to the requestor.
-
- This function is the same as ShellPromptForResponse, except that the prompt is
- automatically pulled from HII.
-
- @param[in] Type What type of question is asked. This is used to filter the input
- to prevent invalid answers to question.
- @param[in] HiiFormatStringId The format string Id for getting from Hii.
- @param[in] HiiFormatHandle The format string Handle for getting from Hii.
- @param[in, out] Response The pointer to Response, which will be populated upon return.
-
- @retval EFI_SUCCESS The operation was sucessful.
- @return other The operation failed.
-
- @sa ShellPromptForResponse
-**/
-EFI_STATUS
-EFIAPI
-ShellPromptForResponseHii (
- IN SHELL_PROMPT_REQUEST_TYPE Type,
- IN CONST EFI_STRING_ID HiiFormatStringId,
- IN CONST EFI_HANDLE HiiFormatHandle,
- IN OUT VOID **Response
- );
-
-/**
- Function to determin if an entire string is a valid number.
-
- If Hex it must be preceeded with a 0x, 0X, or has ForceHex set TRUE.
-
- @param[in] String The string to evaluate.
- @param[in] ForceHex TRUE - always assume hex.
- @param[in] StopAtSpace TRUE to halt upon finding a space, FALSE to keep going.
-
- @retval TRUE It is all numeric (dec/hex) characters.
- @retval FALSE There is a non-numeric character.
-**/
-BOOLEAN
-EFIAPI
-ShellIsHexOrDecimalNumber (
- IN CONST CHAR16 *String,
- IN CONST BOOLEAN ForceHex,
- IN CONST BOOLEAN StopAtSpace
- );
-
-/**
- Function to verify and convert a string to its numerical 64 bit representation.
-
- If Hex it must be preceeded with a 0x, 0X, or has ForceHex set TRUE.
-
- @param[in] String The string to evaluate.
- @param[out] Value Upon a successful return the value of the conversion.
- @param[in] ForceHex TRUE - always assume hex.
- @param[in] StopAtSpace TRUE to halt upon finding a space, FALSE to
- process the entire String.
-
- @retval EFI_SUCCESS The conversion was successful.
- @retval EFI_INVALID_PARAMETER String contained an invalid character.
- @retval EFI_NOT_FOUND String was a number, but Value was NULL.
-**/
-EFI_STATUS
-EFIAPI
-ShellConvertStringToUint64(
- IN CONST CHAR16 *String,
- OUT UINT64 *Value,
- IN CONST BOOLEAN ForceHex,
- IN CONST BOOLEAN StopAtSpace
- );
-
-/**
- Function to determine if a given filename exists.
-
- @param[in] Name Path to test.
-
- @retval EFI_SUCCESS The Path represents a file.
- @retval EFI_NOT_FOUND The Path does not represent a file.
- @retval other The path failed to open.
-**/
-EFI_STATUS
-EFIAPI
-ShellFileExists(
- IN CONST CHAR16 *Name
- );
-
-/**
- Function to read a single line from a SHELL_FILE_HANDLE. The \n is not included in the returned
- buffer. The returned buffer must be callee freed.
-
- If the position upon start is 0, then the Ascii Boolean will be set. This should be
- maintained and not changed for all operations with the same file.
-
- @param[in] Handle SHELL_FILE_HANDLE to read from.
- @param[in, out] Ascii Boolean value for indicating whether the file is
- Ascii (TRUE) or UCS2 (FALSE).
-
- @return The line of text from the file.
-
- @sa ShellFileHandleReadLine
-**/
-CHAR16*
-EFIAPI
-ShellFileHandleReturnLine(
- IN SHELL_FILE_HANDLE Handle,
- IN OUT BOOLEAN *Ascii
- );
-
-/**
- Function to read a single line (up to but not including the \n) from a SHELL_FILE_HANDLE.
-
- If the position upon start is 0, then the Ascii Boolean will be set. This should be
- maintained and not changed for all operations with the same file.
-
- @param[in] Handle SHELL_FILE_HANDLE to read from.
- @param[in, out] Buffer The pointer to buffer to read into.
- @param[in, out] Size The pointer to number of bytes in Buffer.
- @param[in] Truncate If the buffer is large enough, this has no effect.
- If the buffer is is too small and Truncate is TRUE,
- the line will be truncated.
- If the buffer is is too small and Truncate is FALSE,
- then no read will occur.
-
- @param[in, out] Ascii Boolean value for indicating whether the file is
- Ascii (TRUE) or UCS2 (FALSE).
-
- @retval EFI_SUCCESS The operation was successful. The line is stored in
- Buffer.
- @retval EFI_INVALID_PARAMETER Handle was NULL.
- @retval EFI_INVALID_PARAMETER Size was NULL.
- @retval EFI_BUFFER_TOO_SMALL Size was not large enough to store the line.
- Size was updated to the minimum space required.
-**/
-EFI_STATUS
-EFIAPI
-ShellFileHandleReadLine(
- IN SHELL_FILE_HANDLE Handle,
- IN OUT CHAR16 *Buffer,
- IN OUT UINTN *Size,
- IN BOOLEAN Truncate,
- IN OUT BOOLEAN *Ascii
- );
-
-#endif // __SHELL_LIB__
diff --git a/ShellPkg/Include/Library/SortLib.h b/ShellPkg/Include/Library/SortLib.h
deleted file mode 100644
index a3e0fd9bec..0000000000
--- a/ShellPkg/Include/Library/SortLib.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/** @file
- Library used for sorting and comparison routines.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __SORT_LIB_H__
-#define __SORT_LIB_H__
-
-/**
- Prototype for comparison function for any two element types.
-
- @param[in] Buffer1 The pointer to first buffer.
- @param[in] Buffer2 The pointer to second buffer.
-
- @retval 0 Buffer1 equal to Buffer2.
- @return <0 Buffer1 is less than Buffer2.
- @return >0 Buffer1 is greater than Buffer2.
-**/
-typedef
-INTN
-(EFIAPI *SORT_COMPARE)(
- IN CONST VOID *Buffer1,
- IN CONST VOID *Buffer2
- );
-
-/**
- Function to perform a Quick Sort on a buffer of comparable elements.
-
- Each element must be equally sized.
-
- If BufferToSort is NULL, then ASSERT.
- If CompareFunction is NULL, then ASSERT.
-
- If Count is < 2 , then perform no action.
- If Size is < 1 , then perform no action.
-
- @param[in, out] BufferToSort On call, a Buffer of (possibly sorted) elements;
- on return, a buffer of sorted elements.
- @param[in] Count The number of elements in the buffer to sort.
- @param[in] ElementSize The size of an element in bytes.
- @param[in] CompareFunction The function to call to perform the comparison
- of any two elements.
-**/
-VOID
-EFIAPI
-PerformQuickSort (
- IN OUT VOID *BufferToSort,
- IN CONST UINTN Count,
- IN CONST UINTN ElementSize,
- IN SORT_COMPARE CompareFunction
- );
-
-
-/**
- Function to compare 2 device paths for use as CompareFunction.
-
- @param[in] Buffer1 The pointer to Device Path to compare.
- @param[in] Buffer2 The pointer to second DevicePath to compare.
-
- @retval 0 Buffer1 equal to Buffer2.
- @return < 0 Buffer1 is less than Buffer2.
- @return > 0 Buffer1 is greater than Buffer2.
-**/
-INTN
-EFIAPI
-DevicePathCompare (
- IN CONST VOID *Buffer1,
- IN CONST VOID *Buffer2
- );
-
-/**
- Function to compare 2 strings without regard to case of the characters.
-
- @param[in] Buffer1 The pointer to String to compare (CHAR16**).
- @param[in] Buffer2 The pointer to second String to compare (CHAR16**).
-
- @retval 0 Buffer1 equal to Buffer2.
- @return < 0 Buffer1 is less than Buffer2.
- @return > 0 Buffer1 is greater than Buffer2.
-**/
-INTN
-EFIAPI
-StringNoCaseCompare (
- IN CONST VOID *Buffer1,
- IN CONST VOID *Buffer2
- );
-
-/**
- Function to compare 2 strings.
-
- @param[in] Buffer1 The pointer to String to compare (CHAR16**).
- @param[in] Buffer2 The pointer to second String to compare (CHAR16**).
-
- @retval 0 Buffer1 equal to Buffer2.
- @return < 0 Buffer1 is less than Buffer2.
- @return > 0 Buffer1 is greater than Buffer2.
-**/
-INTN
-EFIAPI
-StringCompare (
- IN CONST VOID *Buffer1,
- IN CONST VOID *Buffer2
- );
-
-#endif //__SORT_LIB_H__
diff --git a/ShellPkg/Include/Protocol/EfiShell.h b/ShellPkg/Include/Protocol/EfiShell.h
deleted file mode 100644
index d36c1f6b17..0000000000
--- a/ShellPkg/Include/Protocol/EfiShell.h
+++ /dev/null
@@ -1,1005 +0,0 @@
-/** @file
- EFI Shell protocol as defined in the UEFI Shell 2.0 specification including errata.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __EFI_SHELL_PROTOCOL__
-#define __EFI_SHELL_PROTOCOL__
-
-#include <ShellBase.h>
-#include <Guid/FileInfo.h>
-
-#define EFI_SHELL_PROTOCOL_GUID \
- { \
- 0x6302d008, 0x7f9b, 0x4f30, { 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e } \
- }
-
-// replaced EFI_LIST_ENTRY with LIST_ENTRY for simplicity.
-// they are identical outside of the name.
-typedef struct {
- LIST_ENTRY Link; ///< Linked list members.
- EFI_STATUS Status; ///< Status of opening the file. Valid only if Handle != NULL.
- CONST CHAR16 *FullName; ///< Fully qualified filename.
- CONST CHAR16 *FileName; ///< name of this file.
- SHELL_FILE_HANDLE Handle; ///< Handle for interacting with the opened file or NULL if closed.
- EFI_FILE_INFO *Info; ///< Pointer to the FileInfo struct for this file or NULL.
-} EFI_SHELL_FILE_INFO;
-
-/**
- Returns whether any script files are currently being processed.
-
- @retval TRUE There is at least one script file active.
- @retval FALSE No script files are active now.
-
-**/
-typedef
-BOOLEAN
-(EFIAPI *EFI_SHELL_BATCH_IS_ACTIVE) (
- VOID
- );
-
-/**
- Closes the file handle.
-
- This function closes a specified file handle. All 'dirty' cached file data is
- flushed to the device, and the file is closed. In all cases, the handle is
- closed.
-
- @param[in] FileHandle The file handle to be closed.
-
- @retval EFI_SUCCESS The file closed sucessfully.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_CLOSE_FILE)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Creates a file or directory by name.
-
- This function creates an empty new file or directory with the specified attributes and
- returns the new file's handle. If the file already exists and is read-only, then
- EFI_INVALID_PARAMETER will be returned.
-
- If the file already existed, it is truncated and its attributes updated. If the file is
- created successfully, the FileHandle is the file's handle, else, the FileHandle is NULL.
-
- If the file name begins with >v, then the file handle which is returned refers to the
- shell environment variable with the specified name. If the shell environment variable
- already exists and is non-volatile then EFI_INVALID_PARAMETER is returned.
-
- @param[in] FileName Pointer to NULL-terminated file path.
- @param[in] FileAttribs The new file's attrbiutes. The different attributes are
- described in EFI_FILE_PROTOCOL.Open().
- @param[out] FileHandle On return, points to the created file handle or directory's handle.
-
- @retval EFI_SUCCESS The file was opened. FileHandle points to the new file's handle.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED The file path could not be opened.
- @retval EFI_NOT_FOUND The specified file could not be found on the device, or could not
- file the file system on the device.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
- longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
- the DirName.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
- when the media is write-protected.
- @retval EFI_ACCESS_DENIED The service denied access to the file.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_CREATE_FILE)(
- IN CONST CHAR16 *FileName,
- IN UINT64 FileAttribs,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Deletes the file specified by the file handle.
-
- This function closes and deletes a file. In all cases, the file handle is closed. If the file
- cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is returned, but the
- handle is still closed.
-
- @param[in] FileHandle The file handle to delete.
-
- @retval EFI_SUCCESS The file was closed and deleted and the handle was closed.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_DELETE_FILE)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Deletes the file specified by the file name.
-
- This function deletes a file.
-
- @param[in] FileName Points to the NULL-terminated file name.
-
- @retval EFI_SUCCESS The file was deleted.
- @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_DELETE_FILE_BY_NAME)(
- IN CONST CHAR16 *FileName
- );
-
-/**
- Disables the page break output mode.
-**/
-typedef
-VOID
-(EFIAPI *EFI_SHELL_DISABLE_PAGE_BREAK) (
- VOID
- );
-
-/**
- Enables the page break output mode.
-**/
-typedef
-VOID
-(EFIAPI *EFI_SHELL_ENABLE_PAGE_BREAK) (
- VOID
- );
-
-/**
- Execute the command line.
-
- This function creates a nested instance of the shell and executes the specified
- command (CommandLine) with the specified environment (Environment). Upon return,
- the status code returned by the specified command is placed in StatusCode.
-
- If Environment is NULL, then the current environment is used and all changes made
- by the commands executed will be reflected in the current environment. If the
- Environment is non-NULL, then the changes made will be discarded.
-
- The CommandLine is executed from the current working directory on the current
- device.
-
- @param[in] ParentImageHandle A handle of the image that is executing the specified
- command line.
- @param[in] CommandLine Points to the NULL-terminated UCS-2 encoded string
- containing the command line. If NULL then the command-
- line will be empty.
- @param[in] Environment Points to a NULL-terminated array of environment
- variables with the format 'x=y', where x is the
- environment variable name and y is the value. If this
- is NULL, then the current shell environment is used.
- @param[out] ErrorCode Points to the status code returned by the command.
-
- @retval EFI_SUCCESS The command executed successfully. The status code
- returned by the command is pointed to by StatusCode.
- @retval EFI_INVALID_PARAMETER The parameters are invalid.
- @retval EFI_OUT_OF_RESOURCES Out of resources.
- @retval EFI_UNSUPPORTED Nested shell invocations are not allowed.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_EXECUTE) (
- IN EFI_HANDLE *ParentImageHandle,
- IN CHAR16 *CommandLine OPTIONAL,
- IN CHAR16 **Environment OPTIONAL,
- OUT EFI_STATUS *StatusCode OPTIONAL
- );
-
-/**
- Find files that match a specified pattern.
-
- This function searches for all files and directories that match the specified
- FilePattern. The FilePattern can contain wild-card characters. The resulting file
- information is placed in the file list FileList.
-
- The files in the file list are not opened. The OpenMode field is set to 0 and the FileInfo
- field is set to NULL.
-
- @param[in] FilePattern Points to a NULL-terminated shell file path, including wildcards.
- @param[out] FileList On return, points to the start of a file list containing the names
- of all matching files or else points to NULL if no matching files
- were found.
-
- @retval EFI_SUCCESS Files found.
- @retval EFI_NOT_FOUND No files found.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FIND_FILES)(
- IN CONST CHAR16 *FilePattern,
- OUT EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Find all files in a specified directory.
-
- @param[in] FileDirHandle Handle of the directory to search.
- @param[out] FileList On return, points to the list of files in the directory
- or NULL if there are no files in the directory.
-
- @retval EFI_SUCCESS File information was returned successfully.
- @retval EFI_VOLUME_CORRUPTED The file system structures have been corrupted.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_NO_MEDIA The device media is not present.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FIND_FILES_IN_DIR)(
-IN SHELL_FILE_HANDLE FileDirHandle,
-OUT EFI_SHELL_FILE_INFO **FileList
-);
-
-/**
- Flushes data back to a device.
-
- This function flushes all modified data associated with a file to a device.
-
- @param[in] FileHandle The handle of the file to flush.
-
- @retval EFI_SUCCESS The data was flushed.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
- @retval EFI_ACCESS_DENIED The file was opened read-only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FLUSH_FILE)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Frees the file list.
-
- This function cleans up the file list and any related data structures. It has no
- impact on the files themselves.
-
- @param[in] FileList The file list to free. Type EFI_SHELL_FILE_INFO is
- defined in OpenFileList().
-
- @retval EFI_SUCCESS Free the file list successfully.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_FREE_FILE_LIST) (
- IN EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Returns the current directory on the specified device.
-
- If FileSystemMapping is NULL, it returns the current working directory. If the
- FileSystemMapping is not NULL, it returns the current directory associated with the
- FileSystemMapping. In both cases, the returned name includes the file system
- mapping (i.e. fs0:\current-dir).
-
- @param[in] FileSystemMapping A pointer to the file system mapping. If NULL,
- then the current working directory is returned.
-
- @retval !=NULL The current directory.
- @retval NULL Current directory does not exist.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_CUR_DIR) (
- IN CONST CHAR16 *FileSystemMapping OPTIONAL
- );
-
-typedef UINT32 EFI_SHELL_DEVICE_NAME_FLAGS;
-#define EFI_DEVICE_NAME_USE_COMPONENT_NAME 0x00000001
-#define EFI_DEVICE_NAME_USE_DEVICE_PATH 0x00000002
-
-/**
- Gets the name of the device specified by the device handle.
-
- This function gets the user-readable name of the device specified by the device
- handle. If no user-readable name could be generated, then *BestDeviceName will be
- NULL and EFI_NOT_FOUND will be returned.
-
- If EFI_DEVICE_NAME_USE_COMPONENT_NAME is set, then the function will return the
- device's name using the EFI_COMPONENT_NAME2_PROTOCOL, if present on
- DeviceHandle.
-
- If EFI_DEVICE_NAME_USE_DEVICE_PATH is set, then the function will return the
- device's name using the EFI_DEVICE_PATH_PROTOCOL, if present on DeviceHandle.
- If both EFI_DEVICE_NAME_USE_COMPONENT_NAME and
- EFI_DEVICE_NAME_USE_DEVICE_PATH are set, then
- EFI_DEVICE_NAME_USE_COMPONENT_NAME will have higher priority.
-
- @param[in] DeviceHandle The handle of the device.
- @param[in] Flags Determines the possible sources of component names.
- @param[in] Language A pointer to the language specified for the device
- name, in the same format as described in the UEFI
- specification, Appendix M.
- @param[out] BestDeviceName On return, points to the callee-allocated NULL-
- terminated name of the device. If no device name
- could be found, points to NULL. The name must be
- freed by the caller...
-
- @retval EFI_SUCCESS Get the name successfully.
- @retval EFI_NOT_FOUND Fail to get the device name.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_DEVICE_NAME) (
- IN EFI_HANDLE DeviceHandle,
- IN EFI_SHELL_DEVICE_NAME_FLAGS Flags,
- IN CHAR8 *Language,
- OUT CHAR16 **BestDeviceName
- );
-
-/**
- Gets the device path from the mapping.
-
- This function gets the device path associated with a mapping.
-
- @param[in] Mapping A pointer to the mapping
-
- @retval !=NULL Pointer to the device path that corresponds to the
- device mapping. The returned pointer does not need
- to be freed.
- @retval NULL There is no device path associated with the
- specified mapping.
-**/
-typedef
-CONST EFI_DEVICE_PATH_PROTOCOL *
-(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_MAP) (
- IN CONST CHAR16 *Mapping
- );
-
-/**
- Converts a file system style name to a device path.
-
- This function converts a file system style name to a device path, by replacing any
- mapping references to the associated device path.
-
- @param[in] Path The pointer to the path.
-
- @return The pointer of the file path. The file path is callee
- allocated and should be freed by the caller.
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL *
-(EFIAPI *EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH) (
- IN CONST CHAR16 *Path
- );
-
-/**
- Gets either a single or list of environment variables.
-
- If name is not NULL then this function returns the current value of the specified
- environment variable.
-
- If Name is NULL than a list of all environment variable names is returned. Each a
- NULL terminated string with a double NULL terminating the list.
-
- @param[in] Name A pointer to the environment variable name. If
- Name is NULL, then the function will return all
- of the defined shell environment variables. In
- the case where multiple environment variables are
- being returned, each variable will be terminated by
- a NULL, and the list will be terminated by a double
- NULL.
-
- @return A pointer to the returned string.
- The returned pointer does not need to be freed by the caller.
-
- @retval NULL The environment variable doesn't exist or there are
- no environment variables.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_ENV) (
- IN CONST CHAR16 *Name OPTIONAL
- );
-
-/**
- Gets the file information from an open file handle.
-
- This function allocates a buffer to store the file's information. It's the caller's
- responsibility to free the buffer.
-
- @param[in] FileHandle A File Handle.
-
- @retval NULL Cannot get the file info.
- @return A pointer to a buffer with file information.
-**/
-typedef
-EFI_FILE_INFO *
-(EFIAPI *EFI_SHELL_GET_FILE_INFO)(
- IN SHELL_FILE_HANDLE FileHandle
- );
-
-/**
- Converts a device path to a file system-style path.
-
- This function converts a device path to a file system path by replacing part, or all, of
- the device path with the file-system mapping. If there are more than one application
- file system mappings, the one that most closely matches Path will be used.
-
- @param[in] Path The pointer to the device path.
-
- @return The pointer of the NULL-terminated file path. The path
- is callee-allocated and should be freed by the caller.
-**/
-typedef
-CHAR16 *
-(EFIAPI *EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH) (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *Path
- );
-
-/**
- Gets a file's current position.
-
- This function returns the current file position for the file handle. For directories, the
- current file position has no meaning outside of the file system driver and as such, the
- operation is not supported.
-
- @param[in] FileHandle The file handle on which to get the current position.
- @param[out] Position Byte position from the start of the file.
-
- @retval EFI_SUCCESS Data was accessed.
- @retval EFI_UNSUPPORTED The request is not valid on open directories.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_FILE_POSITION)(
- IN SHELL_FILE_HANDLE FileHandle,
- OUT UINT64 *Position
- );
-
-/**
- Gets the size of a file.
-
- This function returns the size of the file specified by FileHandle.
-
- @param[in] FileHandle The handle of the file.
- @param[out] Size The size of this file.
-
- @retval EFI_SUCCESS Get the file's size.
- @retval EFI_DEVICE_ERROR Can't access the file.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_FILE_SIZE)(
- IN SHELL_FILE_HANDLE FileHandle,
- OUT UINT64 *Size
- );
-
-/**
- Return help information about a specific command.
-
- This function returns the help information for the specified command. The help text
- can be internal to the shell or can be from a UEFI Shell manual page.
-
- If Sections is specified, then each section name listed will be compared in a casesensitive
- manner, to the section names described in Appendix B. If the section exists,
- it will be appended to the returned help text. If the section does not exist, no
- information will be returned. If Sections is NULL, then all help text information
- available will be returned.
-
- @param[in] Command Points to the NULL-terminated UEFI Shell command name.
- @param[in] Sections Points to the NULL-terminated comma-delimited
- section names to return. If NULL, then all
- sections will be returned.
- @param[out] HelpText On return, points to a callee-allocated buffer
- containing all specified help text.
-
- @retval EFI_SUCCESS The help text was returned.
- @retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
- returned help text.
- @retval EFI_INVALID_PARAMETER HelpText is NULL.
- @retval EFI_NOT_FOUND There is no help text available for Command.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_GET_HELP_TEXT) (
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Sections OPTIONAL,
- OUT CHAR16 **HelpText
- );
-
-/**
- Gets the mapping(s) that most closely matches the device path.
-
- This function gets the mapping which corresponds to the device path *DevicePath. If
- there is no exact match, then the mapping which most closely matches *DevicePath
- is returned, and *DevicePath is updated to point to the remaining portion of the
- device path. If there is an exact match, the mapping is returned and *DevicePath
- points to the end-of-device-path node.
-
- If there are multiple map names they will be semi-colon seperated in the
- NULL-terminated string.
-
- @param[in, out] DevicePath On entry, points to a device path pointer. On
- exit, updates the pointer to point to the
- portion of the device path after the mapping.
-
- @retval NULL No mapping was found.
- @retval !=NULL Pointer to NULL-terminated mapping. The buffer
- is callee allocated and should be freed by the caller.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_MAP_FROM_DEVICE_PATH) (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
- );
-
-/**
- Gets the enable status of the page break output mode.
-
- User can use this function to determine current page break mode.
-
- @retval TRUE The page break output mode is enabled.
- @retval FALSE The page break output mode is disabled.
-**/
-typedef
-BOOLEAN
-(EFIAPI *EFI_SHELL_GET_PAGE_BREAK) (
- VOID
- );
-
-/**
- Judges whether the active shell is the root shell.
-
- This function makes the user to know that whether the active Shell is the root shell.
-
- @retval TRUE The active Shell is the root Shell.
- @retval FALSE The active Shell is NOT the root Shell.
-**/
-typedef
-BOOLEAN
-(EFIAPI *EFI_SHELL_IS_ROOT_SHELL) (
-VOID
-);
-
-/**
- Opens a file or a directory by file name.
-
- This function opens the specified file in the specified OpenMode and returns a file
- handle.
- If the file name begins with '>v', then the file handle which is returned refers to the
- shell environment variable with the specified name. If the shell environment variable
- exists, is non-volatile and the OpenMode indicates EFI_FILE_MODE_WRITE, then
- EFI_INVALID_PARAMETER is returned.
-
- If the file name is '>i', then the file handle which is returned refers to the standard
- input. If the OpenMode indicates EFI_FILE_MODE_WRITE, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is '>o', then the file handle which is returned refers to the standard
- output. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is '>e', then the file handle which is returned refers to the standard
- error. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER
- is returned.
-
- If the file name is 'NUL', then the file handle that is returned refers to the standard NUL
- file. If the OpenMode indicates EFI_FILE_MODE_READ, then EFI_INVALID_PARAMETER is
- returned.
-
- If return EFI_SUCCESS, the FileHandle is the opened file's handle, else, the
- FileHandle is NULL.
-
- @param[in] FileName Points to the NULL-terminated UCS-2 encoded file name.
- @param[out] FileHandle On return, points to the file handle.
- @param[in] OpenMode File open mode. Either EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE from section 12.4 of the UEFI
- Specification.
- @retval EFI_SUCCESS The file was opened. FileHandle has the opened file's handle.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value. FileHandle is NULL.
- @retval EFI_UNSUPPORTED Could not open the file path. FileHandle is NULL.
- @retval EFI_NOT_FOUND The specified file could not be found on the device or the file
- system could not be found on the device. FileHandle is NULL.
- @retval EFI_NO_MEDIA The device has no medium. FileHandle is NULL.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no
- longer supported. FileHandle is NULL.
- @retval EFI_DEVICE_ERROR The device reported an error or can't get the file path according
- the FileName. FileHandle is NULL.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. FileHandle is NULL.
- @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write
- when the media is write-protected. FileHandle is NULL.
- @retval EFI_ACCESS_DENIED The service denied access to the file. FileHandle is NULL.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file. FileHandle
- is NULL.
- @retval EFI_VOLUME_FULL The volume is full. FileHandle is NULL.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_FILE_BY_NAME) (
- IN CONST CHAR16 *FileName,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode
- );
-
-/**
- Opens the files that match the path specified.
-
- This function opens all of the files specified by Path. Wildcards are processed
- according to the rules specified in UEFI Shell 2.0 spec section 3.7.1. Each
- matching file has an EFI_SHELL_FILE_INFO structure created in a linked list.
-
- @param[in] Path A pointer to the path string.
- @param[in] OpenMode Specifies the mode used to open each file, EFI_FILE_MODE_READ or
- EFI_FILE_MODE_WRITE.
- @param[in, out] FileList Points to the start of a list of files opened.
-
- @retval EFI_SUCCESS Create the file list successfully.
- @return Can't create the file list.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_FILE_LIST) (
- IN CHAR16 *Path,
- IN UINT64 OpenMode,
- IN OUT EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Opens the root directory of a device.
-
- This function opens the root directory of a device and returns a file handle to it.
-
- @param[in] DevicePath Points to the device path corresponding to the device where the
- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed.
- @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
- device.
-
- @retval EFI_SUCCESS Root opened successfully.
- @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
- could not be opened.
- @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
- @retval EFI_DEVICE_ERROR The device had an error.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_ROOT)(
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Opens the root directory of a device on a handle.
-
- This function opens the root directory of a device and returns a file handle to it.
-
- @param[in] DeviceHandle The handle of the device that contains the volume.
- @param[out] FileHandle On exit, points to the file handle corresponding to the root directory on the
- device.
-
- @retval EFI_SUCCESS Root opened successfully.
- @retval EFI_NOT_FOUND EFI_SIMPLE_FILE_SYSTEM could not be found or the root directory
- could not be opened.
- @retval EFI_VOLUME_CORRUPTED The data structures in the volume were corrupted.
- @retval EFI_DEVICE_ERROR The device had an error.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_OPEN_ROOT_BY_HANDLE)(
- IN EFI_HANDLE DeviceHandle,
- OUT SHELL_FILE_HANDLE *FileHandle
- );
-
-/**
- Reads data from the file.
-
- If FileHandle is not a directory, the function reads the requested number of bytes
- from the file at the file's current position and returns them in Buffer. If the read goes
- beyond the end of the file, the read length is truncated to the end of the file. The file's
- current position is increased by the number of bytes returned.
- If FileHandle is a directory, then an error is returned.
-
- @param[in] FileHandle The opened file handle for read.
- @param[in] ReadSize On input, the size of Buffer, in bytes. On output, the amount of data read.
- @param[in, out] Buffer The buffer in which data is read.
-
- @retval EFI_SUCCESS Data was read.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required size.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_READ_FILE) (
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT UINTN *ReadSize,
- IN OUT VOID *Buffer
- );
-
-/**
- Deletes the duplicate file names files in the given file list.
-
- @param[in] FileList A pointer to the first entry in the file list.
-
- @retval EFI_SUCCESS Always success.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_REMOVE_DUP_IN_FILE_LIST) (
- IN EFI_SHELL_FILE_INFO **FileList
- );
-
-/**
- Changes a shell command alias.
-
- This function creates an alias for a shell command.
-
- @param[in] Command Points to the NULL-terminated shell command or existing alias.
- @param[in] Alias Points to the NULL-terminated alias for the shell command. If this is NULL, and
- Command refers to an alias, that alias will be deleted.
- @param[in] Replace If TRUE and the alias already exists, then the existing alias will be replaced. If
- FALSE and the alias already exists, then the existing alias is unchanged and
- EFI_ACCESS_DENIED is returned.
- @param[in] Volatile if TRUE the Alias being set will be stored in a volatile fashion. if FALSE the
- Alias being set will be stored in a non-volatile fashion.
-
- @retval EFI_SUCCESS Alias created or deleted successfully.
- @retval EFI_ACCESS_DENIED The alias is a built-in alias or already existed and Replace was set to
- FALSE.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_ALIAS)(
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Alias,
- IN BOOLEAN Replace,
- IN BOOLEAN Volatile
- );
-
-/**
- This function returns the command associated with a alias or a list of all
- alias'.
-
- @param[in] Alias Points to the NULL-terminated shell alias.
- If this parameter is NULL, then all
- aliases will be returned in ReturnedData.
- @param[out] Volatile Upon return of a single command if TRUE indicates
- this is stored in a volatile fashion. FALSE otherwise.
- @return If Alias is not NULL, it will return a pointer to
- the NULL-terminated command for that alias.
- If Alias is NULL, ReturnedData points to a ';'
- delimited list of alias (e.g.
- ReturnedData = "dir;del;copy;mfp") that is NULL-terminated.
- @retval NULL An error ocurred.
- @retval NULL Alias was not a valid Alias.
-**/
-typedef
-CONST CHAR16 *
-(EFIAPI *EFI_SHELL_GET_ALIAS)(
- IN CONST CHAR16 *Alias,
- OUT BOOLEAN *Volatile OPTIONAL
- );
-
-/**
- Changes the current directory on the specified device.
-
- If the FileSystem is NULL, and the directory Dir does not contain a file system's
- mapped name, this function changes the current working directory. If FileSystem is
- NULL and the directory Dir contains a mapped name, then the current file system and
- the current directory on that file system are changed.
-
- If FileSystem is not NULL, and Dir is NULL, then this changes the current working file
- system.
-
- If FileSystem is not NULL and Dir is not NULL, then this function changes the current
- directory on the specified file system.
-
- If the current working directory or the current working file system is changed then the
- %cwd% environment variable will be updated.
-
- @param[in] FileSystem A pointer to the file system's mapped name. If NULL, then the current working
- directory is changed.
- @param[in] Dir Points to the NULL-terminated directory on the device specified by FileSystem.
-
- @retval NULL Current directory does not exist.
- @return The current directory.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_CUR_DIR) (
- IN CONST CHAR16 *FileSystem OPTIONAL,
- IN CONST CHAR16 *Dir
- );
-
-/**
- Sets the environment variable.
-
- This function changes the current value of the specified environment variable. If the
- environment variable exists and the Value is an empty string, then the environment
- variable is deleted. If the environment variable exists and the Value is not an empty
- string, then the value of the environment variable is changed. If the environment
- variable does not exist and the Value is an empty string, there is no action. If the
- environment variable does not exist and the Value is a non-empty string, then the
- environment variable is created and assigned the specified value.
-
- For a description of volatile and non-volatile environment variables, see UEFI Shell
- 2.0 specification section 3.6.1.
-
- @param[in] Name Points to the NULL-terminated environment variable name.
- @param[in] Value Points to the NULL-terminated environment variable value. If the value is an
- empty string then the environment variable is deleted.
- @param[in] Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
-
- @retval EFI_SUCCESS The environment variable was successfully updated.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_ENV) (
- IN CONST CHAR16 *Name,
- IN CONST CHAR16 *Value,
- IN BOOLEAN Volatile
- );
-
-/**
- Sets the file information to an opened file handle.
-
- This function changes file information. All file information in the EFI_FILE_INFO
- struct will be updated to the passed in data.
-
- @param[in] FileHandle A file handle.
- @param[in] FileInfo Points to new file information.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write-protected.
- @retval EFI_ACCESS_DENIED The file was opened read-only.
- @retval EFI_VOLUME_FULL The volume is full.
- @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of EFI_FILE_INFO.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_FILE_INFO)(
- IN SHELL_FILE_HANDLE FileHandle,
- IN CONST EFI_FILE_INFO *FileInfo
- );
-
-/**
- Sets a file's current position.
-
- This function sets the current file position for the handle to the position supplied. With
- the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only absolute positioning is
- supported, and seeking past the end of the file is allowed (a subsequent write would
- grow the file). Seeking to position 0xFFFFFFFFFFFFFFFF causes the current position
- to be set to the end of the file.
-
- @param[in] FileHandle The file handle on which requested position will be set.
- @param[in] Position Byte position from the start of the file.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open directories.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_FILE_POSITION)(
- IN SHELL_FILE_HANDLE FileHandle,
- IN UINT64 Position
- );
-
-/**
- This function creates a mapping for a device path.
-
- @param[in] DevicePath Points to the device path. If this is NULL and Mapping points to a valid mapping,
- then the mapping will be deleted.
- @param[in] Mapping Points to the NULL-terminated mapping for the device path.
-
- @retval EFI_SUCCESS Mapping created or deleted successfully.
- @retval EFI_NO_MAPPING There is no handle that corresponds exactly to DevicePath. See the
- boot service function LocateDevicePath().
- @retval EFI_ACCESS_DENIED The mapping is a built-in alias.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_SET_MAP)(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN CONST CHAR16 *Mapping
- );
-
-/**
- Writes data to the file.
-
- This function writes the specified number of bytes to the file at the current file position.
- The current file position is advanced the actual number of bytes written, which is
- returned in BufferSize. Partial writes only occur when there has been a data error
- during the write attempt (such as "volume space full"). The file automatically grows to
- hold the data, if required.
-
- Direct writes to opened directories are not supported.
-
- @param[in] FileHandle The opened file handle for writing.
- @param[in, out] BufferSize On input, size of Buffer.
- @param[in] Buffer The buffer in which data to write.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED Writes to open directory are not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write-protected.
- @retval EFI_ACCESS_DENIED The file was open for read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SHELL_WRITE_FILE)(
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- );
-
-typedef struct _EFI_SHELL_PROTOCOL {
- EFI_SHELL_EXECUTE Execute;
- EFI_SHELL_GET_ENV GetEnv;
- EFI_SHELL_SET_ENV SetEnv;
- EFI_SHELL_GET_ALIAS GetAlias;
- EFI_SHELL_SET_ALIAS SetAlias;
- EFI_SHELL_GET_HELP_TEXT GetHelpText;
- EFI_SHELL_GET_DEVICE_PATH_FROM_MAP GetDevicePathFromMap;
- EFI_SHELL_GET_MAP_FROM_DEVICE_PATH GetMapFromDevicePath;
- EFI_SHELL_GET_DEVICE_PATH_FROM_FILE_PATH GetDevicePathFromFilePath;
- EFI_SHELL_GET_FILE_PATH_FROM_DEVICE_PATH GetFilePathFromDevicePath;
- EFI_SHELL_SET_MAP SetMap;
- EFI_SHELL_GET_CUR_DIR GetCurDir;
- EFI_SHELL_SET_CUR_DIR SetCurDir;
- EFI_SHELL_OPEN_FILE_LIST OpenFileList;
- EFI_SHELL_FREE_FILE_LIST FreeFileList;
- EFI_SHELL_REMOVE_DUP_IN_FILE_LIST RemoveDupInFileList;
- EFI_SHELL_BATCH_IS_ACTIVE BatchIsActive;
- EFI_SHELL_IS_ROOT_SHELL IsRootShell;
- EFI_SHELL_ENABLE_PAGE_BREAK EnablePageBreak;
- EFI_SHELL_DISABLE_PAGE_BREAK DisablePageBreak;
- EFI_SHELL_GET_PAGE_BREAK GetPageBreak;
- EFI_SHELL_GET_DEVICE_NAME GetDeviceName;
- EFI_SHELL_GET_FILE_INFO GetFileInfo;
- EFI_SHELL_SET_FILE_INFO SetFileInfo;
- EFI_SHELL_OPEN_FILE_BY_NAME OpenFileByName;
- EFI_SHELL_CLOSE_FILE CloseFile;
- EFI_SHELL_CREATE_FILE CreateFile;
- EFI_SHELL_READ_FILE ReadFile;
- EFI_SHELL_WRITE_FILE WriteFile;
- EFI_SHELL_DELETE_FILE DeleteFile;
- EFI_SHELL_DELETE_FILE_BY_NAME DeleteFileByName;
- EFI_SHELL_GET_FILE_POSITION GetFilePosition;
- EFI_SHELL_SET_FILE_POSITION SetFilePosition;
- EFI_SHELL_FLUSH_FILE FlushFile;
- EFI_SHELL_FIND_FILES FindFiles;
- EFI_SHELL_FIND_FILES_IN_DIR FindFilesInDir;
- EFI_SHELL_GET_FILE_SIZE GetFileSize;
- EFI_SHELL_OPEN_ROOT OpenRoot;
- EFI_SHELL_OPEN_ROOT_BY_HANDLE OpenRootByHandle;
- EFI_EVENT ExecutionBreak;
- UINT32 MajorVersion;
- UINT32 MinorVersion;
-} EFI_SHELL_PROTOCOL;
-
-extern EFI_GUID gEfiShellProtocolGuid;
-
-enum ShellVersion {
- SHELL_MAJOR_VERSION = 2,
- SHELL_MINOR_VERSION = 0
-};
-
-#endif
diff --git a/ShellPkg/Include/Protocol/EfiShellEnvironment2.h b/ShellPkg/Include/Protocol/EfiShellEnvironment2.h
deleted file mode 100644
index 05ec69d5ac..0000000000
--- a/ShellPkg/Include/Protocol/EfiShellEnvironment2.h
+++ /dev/null
@@ -1,975 +0,0 @@
-/** @file
- Defines for EFI shell environment 2 ported to EDK II build environment. (no spec)
-
- Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#ifndef _SHELL_ENVIRONMENT_2_PROTOCOL_H_
-#define _SHELL_ENVIRONMENT_2_PROTOCOL_H_
-
-#define DEFAULT_INIT_ROW 1
-#define DEFAULT_AUTO_LF FALSE
-
-/**
- This function is a prototype for a function that dumps information on a protocol
- to a given location. The location is dependant on the implementation. This is
- used when programatically adding shell commands.
-
- @param[in] Handle The handle the protocol is on.
- @param[in] Interface The interface to the protocol.
-
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_DUMP_PROTOCOL_INFO) (
- IN EFI_HANDLE Handle,
- IN VOID *Interface
- );
-
-/**
- This function is a prototype for each command internal to the EFI shell
- implementation. The specific command depends on the implementation. This is
- used when programatically adding shell commands.
-
- @param[in] ImageHandle The handle to the binary shell.
- @param[in] SystemTable The pointer to the system table.
-
- @retval EFI_SUCCESS The command completed.
- @retval other An error occurred. Any error is possible
- depending on the implementation of the shell
- command.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_INTERNAL_COMMAND) (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- This function is a prototype for one that gets a help string for a given command.
- This is used when programatically adding shell commands. Upon successful return
- the memory allocated is up to the caller to free.
-
- @param[in, out] Str Pointer to pointer to string to display for help.
-
- @retval EFI_SUCCESS The help string is in the parameter Str.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLCMD_GET_LINE_HELP) (
- IN OUT CHAR16 **Str
- );
-
-/**
-Structure returned from functions that open multiple files.
-**/
-typedef struct {
- UINT32 Signature; ///< SHELL_FILE_ARG_SIGNATURE.
- LIST_ENTRY Link; ///< Linked list helper.
- EFI_STATUS Status; ///< File's status.
-
- EFI_FILE_HANDLE Parent; ///< What is the Parent file of this file.
- UINT64 OpenMode; ///< How was the file opened.
- CHAR16 *ParentName; ///< String representation of parent.
- EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath; ///< DevicePath for Parent.
-
- CHAR16 *FullName; ///< Path and file name for this file.
- CHAR16 *FileName; ///< File name for this file.
-
- EFI_FILE_HANDLE Handle; ///< Handle to this file.
- EFI_FILE_INFO *Info; ///< Pointer to file info for this file.
-} SHELL_FILE_ARG;
-
-/// Signature for SHELL_FILE_ARG.
-#define SHELL_FILE_ARG_SIGNATURE SIGNATURE_32 ('g', 'r', 'a', 'f')
-
-/**
-GUID for the shell environment2 and shell environment.
-**/
-#define SHELL_ENVIRONMENT_PROTOCOL_GUID \
- { \
- 0x47c7b221, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} \
- }
-
-/**
-GUID for the shell environment2 extension (main GUID above).
-**/
-#define EFI_SE_EXT_SIGNATURE_GUID \
- { \
- 0xd2c18636, 0x40e5, 0x4eb5, {0xa3, 0x1b, 0x36, 0x69, 0x5f, 0xd4, 0x2c, 0x87} \
- }
-
-#define EFI_SHELL_MAJOR_VER 0x00000001 ///< Major version of the EFI_SHELL_ENVIRONMENT2.
-#define EFI_SHELL_MINOR_VER 0x00000000 ///< Minor version of the EFI_SHELL_ENVIRONMENT2.
-
-/**
- Execute a command line.
-
- This function will run the CommandLine. This includes loading any required images,
- parsing any requires scripts, and if DebugOutput is TRUE printing errors
- encountered directly to the screen.
-
- @param[in] ParentImageHandle Handle of the image executing this operation.
- @param[in] CommandLine The string command line to execute.
- @param[in] DebugOutput TRUE indicates that errors should be printed directly.
- FALSE supresses error messages.
-
- @retval EFI_SUCCESS The command line executed and completed.
- @retval EFI_ABORTED The operation aborted.
- @retval EFI_INVALID_PARAMETER A parameter did not have a valid value.
- @retval EFI_OUT_OF_RESOURCES A required memory allocation failed.
-
-@sa HandleProtocol
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_EXECUTE) (
- IN EFI_HANDLE *ParentImageHandle,
- IN CHAR16 *CommandLine,
- IN BOOLEAN DebugOutput
- );
-
-/**
- This function returns a shell environment variable value.
-
- @param[in] Name The pointer to the string with the shell environment
- variable name.
-
- @retval NULL The shell environment variable's value could not be found.
- @retval !=NULL The value of the shell environment variable Name.
-
-**/
-typedef
-CHAR16 *
-(EFIAPI *SHELLENV_GET_ENV) (
- IN CHAR16 *Name
- );
-
-/**
- This function returns a shell environment map value.
-
- @param[in] Name The pointer to the string with the shell environment
- map name.
-
- @retval NULL The shell environment map's value could not be found.
- @retval !=NULL The value of the shell environment map Name.
-
-**/
-typedef
-CHAR16 *
-(EFIAPI *SHELLENV_GET_MAP) (
- IN CHAR16 *Name
- );
-
-/**
- This function will add an internal command to the shell interface.
-
- This will allocate all required memory, put the new command on the command
- list in the correct location.
-
- @param[in] Handler The handler function to call when the command gets called.
- @param[in] Cmd The command name.
- @param[in] GetLineHelp The function to call of type "get help" for this command.
-
- @retval EFI_SUCCESS The command is now part of the command list.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @sa SHELLENV_INTERNAL_COMMAND
- @sa SHELLCMD_GET_LINE_HELP
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_ADD_CMD) (
- IN SHELLENV_INTERNAL_COMMAND Handler,
- IN CHAR16 *Cmd,
- IN SHELLCMD_GET_LINE_HELP GetLineHelp
- );
-
-/**
- Internal interface to add protocol handlers.
-
- This function is for internal shell use only. This is how protocol handlers are added.
- This will get the current protocol info and add the new info or update existing info
- and then resave the info.
-
- @param[in] Protocol The pointer to the protocol's GUID.
- @param[in] DumpToken The function pointer to dump token function or
- NULL.
- @param[in] DumpInfo The function pointer to dump infomation function
- or NULL.
- @param[in] IdString The English name of the protocol.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_ADD_PROT) (
- IN EFI_GUID *Protocol,
- IN SHELLENV_DUMP_PROTOCOL_INFO DumpToken OPTIONAL,
- IN SHELLENV_DUMP_PROTOCOL_INFO DumpInfo OPTIONAL,
- IN CHAR16 *IdString
- );
-
-/**
- This function finds a protocol handle by a GUID.
-
- This function will check for already known protocols by GUID and if one is
- found it will return the name of that protocol. If no name is found and
- GenId is TRUE it will generate ths string.
-
- @param[in] Protocol The GUID of the protocol to look for.
- @param[in] GenId Whether to generate a name string if it is not found.
-
- @return !NULL The Name of the protocol.
- @retval NULL The Name was not found, and GenId was not TRUE.
-**/
-typedef
-CHAR16*
-(EFIAPI *SHELLENV_GET_PROT) (
- IN EFI_GUID *Protocol,
- IN BOOLEAN GenId
- );
-
-/**
- This function returns a string array containing the current directory on
- a given device.
-
- If DeviceName is specified, then return the current shell directory on that
- device. If DeviceName is NULL, then return the current directory on the
- current device. The caller us responsible to free the returned string when
- no longer required.
-
- @param[in] DeviceName The name of the device to get the current
- directory on, or NULL for current device.
-
- @return String array with the current directory on the current or specified device.
-
-**/
-typedef
-CHAR16*
-(EFIAPI *SHELLENV_CUR_DIR) (
- IN CHAR16 *DeviceName OPTIONAL
- );
-
-/**
- This function will open a group of files that match the Arg path, including
- support for wildcard characters ('?' and '*') in the Arg path. If there are
- any wildcard characters in the path this function will find any and all files
- that match the wildcards. It returns a double linked list based on the
- LIST_ENTRY linked list structure. Use this in conjunction with the
- SHELL_FILE_ARG_SIGNATURE to get the SHELL_FILE_ARG structures that are returned.
- The memory allocated by the callee for this list is freed by making a call to
- SHELLENV_FREE_FILE_LIST.
-
- @param[in] Arg The pointer Path to files to open.
- @param[in, out] ListHead The pointer to the allocated and initialized list head
- upon which to append all opened file structures.
-
- @retval EFI_SUCCESS One or more files was opened and a struct of each file's
- information was appended to ListHead.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_NOT_FOUND No matching files could be found.
- @sa SHELLENV_FREE_FILE_LIST
-**/typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_FILE_META_ARG) (
- IN CHAR16 *Arg,
- IN OUT LIST_ENTRY *ListHead
- );
-
-/**
- This frees all of the nodes under the ListHead, but not ListHead itself.
-
- @param[in, out] ListHead Pointer to list to free all nodes of.
-
- @retval EFI_SUCCESS This function always returns EFI_SUCCESS.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_FREE_FILE_LIST) (
- IN OUT LIST_ENTRY *ListHead
- );
-
-/**
- This function creates a new instance of the ShellInterface protocol for use on
- the ImageHandle.
-
- This function is for internal shell usage. This will allocate and then populate
- EFI_SHELL_INTERFACE protocol. It is the caller's responsibility to free the
- memory.
-
- @param[in] ImageHandle The handle which will use the new ShellInterface
- protocol.
-
- @return The newly allocated shell interface protocol.
-
-**/
-typedef
-EFI_SHELL_INTERFACE*
-(EFIAPI *SHELLENV_NEW_SHELL) (
- IN EFI_HANDLE ImageHandle
- );
-
-/**
- This function determins whether a script file is currently being processed.
-
- A script file (.nsh file) can contain a series of commands and this is useful to
- know for some shell commands whether they are being run manually or as part of a
- script.
-
- @retval TRUE A script file is being processed.
- @retval FALSE A script file is not being processed.
-**/
-typedef
-BOOLEAN
-(EFIAPI *SHELLENV_BATCH_IS_ACTIVE) (
- VOID
- );
-
-/**
- This is an internal shell function to free any and all allocated resources.
- This should be called immediately prior to closing the shell.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_FREE_RESOURCES) (
- VOID
- );
-
-/**
- This function enables the page break mode.
-
- This mode causes the output to pause after each complete screen to enable a
- user to more easily read it. If AutoWrap is TRUE, then rows with too many
- characters will be chopped and divided into 2 rows. If FALSE, then rows with
- too many characters may not be fully visible to the user on the screen.
-
- @param[in] StartRow The row number to start this on.
- @param[in] AutoWrap Whether to auto wrap rows that are too long.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_ENABLE_PAGE_BREAK) (
- IN INT32 StartRow,
- IN BOOLEAN AutoWrap
- );
-
-/**
- This function disables the page break mode.
-
- Disabling this causes the output to print out exactly as coded, with no breaks
- for readability.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_DISABLE_PAGE_BREAK) (
- VOID
- );
-
-/**
- Get the status of the page break output mode.
-
- @retval FALSE Page break output mode is not enabled.
- @retval TRUE Page break output mode is enabled.
-**/
-typedef
-BOOLEAN
-(EFIAPI *SHELLENV_GET_PAGE_BREAK) (
- VOID
- );
-
-/**
- This function sets the keys to filter for for the console in. The valid
- values to set are:
-
- #define EFI_OUTPUT_SCROLL 0x00000001
- #define EFI_OUTPUT_PAUSE 0x00000002
- #define EFI_EXECUTION_BREAK 0x00000004
-
- @param[in] KeyFilter The new key filter to use.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_SET_KEY_FILTER) (
- IN UINT32 KeyFilter
- );
-
-/**
- This function gets the keys to filter for for the console in.
-
- The valid values to get are:
- #define EFI_OUTPUT_SCROLL 0x00000001
- #define EFI_OUTPUT_PAUSE 0x00000002
- #define EFI_EXECUTION_BREAK 0x00000004
-
- @retval The current filter mask.
-**/
-typedef
-UINT32
-(EFIAPI *SHELLENV_GET_KEY_FILTER) (
- VOID
- );
-
-/**
- This function determins if the shell application should break.
-
- This is used to inform a shell application that a break condition has been
- initiated. Long loops should check this to prevent delays to the break.
-
- @retval TRUE A break has been signaled. The application
- should exit with EFI_ABORTED as soon as possible.
- @retval FALSE Continue as normal.
-**/
-typedef
-BOOLEAN
-(EFIAPI *SHELLENV_GET_EXECUTION_BREAK) (
- VOID
- );
-
-/**
- This is an internal shell function used to increment the shell nesting level.
-
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_INCREMENT_SHELL_NESTING_LEVEL) (
- VOID
- );
-
-/**
- This is an internal shell function used to decrement the shell nesting level.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_DECREMENT_SHELL_NESTING_LEVEL) (
- VOID
- );
-
-/**
- This function determins if the caller is running under the root shell.
-
- @retval TRUE The caller is running under the root shell.
- @retval FALSE The caller is not running under the root shell.
-
-**/
-typedef
-BOOLEAN
-(EFIAPI *SHELLENV_IS_ROOT_SHELL) (
- VOID
- );
-
-/**
- Close the console proxy to restore the original console.
-
- This is an internal shell function to handle shell cascading. It restores the
- original set of console protocols.
-
- @param[in] ConInHandle The handle of ConIn.
- @param[in, out] ConIn The pointer to the location to return the pointer to
- the original console input.
- @param[in] ConOutHandle The handle of ConOut
- @param[in, out] ConOut The pointer to the location to return the pointer to
- the original console output.
-**/
-typedef
-VOID
-(EFIAPI *SHELLENV_CLOSE_CONSOLE_PROXY) (
- IN EFI_HANDLE ConInHandle,
- IN OUT EFI_SIMPLE_TEXT_INPUT_PROTOCOL **ConIn,
- IN EFI_HANDLE ConOutHandle,
- IN OUT EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL **ConOut
- );
-
-//
-// declarations of handle enumerator
-//
-/**
- For ease of use the shell maps handle #'s to short numbers.
- This is only done on request for various internal commands and the references
- are immediately freed when the internal command completes.
-**/
-typedef
-VOID
-(EFIAPI *INIT_HANDLE_ENUMERATOR) (
- VOID
- );
-
-/**
- This is an internal shell function to enumerate the handle database.
-
- This function gets the next handle in the handle database. If no handles are
- found, EFI_NOT_FOUND is returned. If the previous Handle was the last handle,
- it is set to NULL before returning.
-
- This must be called after INIT_HANDLE_ENUMERATOR and before CLOSE_HANDLE_ENUMERATOR.
-
- @param[in, out] Handle The pointer to pointer to Handle. It is set
- on a sucessful return.
-
- @retval EFI_SUCCESS The next handle in the handle database is *Handle.
- @retval EFI_NOT_FOUND There is not another handle.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *NEXT_HANDLE) (
- IN OUT EFI_HANDLE **Handle
- );
-
-/**
- This is an internal shell function to enumerate the handle database.
-
- This function skips the next SkipNum handles in the handle database. If there
- are not enough handles left to skip that many EFI_ACCESS_DENIED is returned and
- no skip is performed.
-
- This must be called after INIT_HANDLE_ENUMERATOR and before CLOSE_HANDLE_ENUMERATOR.
-
- @param[in] SkipNum How many handles to skip
-
- @retval EFI_SUCCESS The next handle in the handle database is *Handle
- @retval EFI_ACCESS_DENIED There are not SkipNum handles left in the database
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SKIP_HANDLE) (
- IN UINTN SkipNum
- );
-
-/**
- This is an internal shell function to enumerate the handle database.
-
- This function resets the the handle database so that NEXT_HANDLE and SKIP_HANDLE
- will start from EnumIndex on the next call.
-
- This must be called after INIT_HANDLE_ENUMERATOR and before CLOSE_HANDLE_ENUMERATOR.
-
- @param[in] EnumIndex Where to start.
-
- @return The number of handles either read out or skipped before this reset.
-**/
-typedef
-UINTN
-(EFIAPI *RESET_HANDLE_ENUMERATOR) (
- IN UINTN EnumIndex
- );
-
-/**
- This is an internal shell function to enumerate the handle database.
-
- This must be called after INIT_HANDLE_ENUMERATOR.
-
- This function releases all memory and resources associated with the handle database.
- After this no other handle enumerator functions except INIT_HANDLE_ENUMERATOR will
- function properly.
-**/
-typedef
-VOID
-(EFIAPI *CLOSE_HANDLE_ENUMERATOR) (
- VOID
- );
-
-/**
- This is an internal shell function to enumerate the handle database.
-
- This function returns the number of handles in the handle database.
-
- This must be called after INIT_HANDLE_ENUMERATOR and before CLOSE_HANDLE_ENUMERATOR.
-
- @return The number of handles in the handle database.
-**/
-typedef
-UINTN
-(EFIAPI *GET_NUM) (
- VOID
- );
-
-/**
-Handle Enumerator structure.
-**/
-typedef struct {
- INIT_HANDLE_ENUMERATOR Init; ///< The pointer to INIT_HANDLE_ENUMERATOR function.
- NEXT_HANDLE Next; ///< The pointer to NEXT_HANDLE function.
- SKIP_HANDLE Skip; ///< The pointer to SKIP_HANDLE function.
- RESET_HANDLE_ENUMERATOR Reset; ///< The pointer to RESET_HANDLE_ENUMERATOR function.
- CLOSE_HANDLE_ENUMERATOR Close; ///< The pointer to CLOSE_HANDLE_ENUMERATOR function.
- GET_NUM GetNum; ///< The pointer to GET_NUM function.
-} HANDLE_ENUMERATOR;
-
-/**
- Signature for the PROTOCOL_INFO structure.
-**/
-#define PROTOCOL_INFO_SIGNATURE SIGNATURE_32 ('s', 'p', 'i', 'n')
-
-/**
- PROTOCOL_INFO structure for protocol enumerator functions.
-**/
-typedef struct {
- UINTN Signature; ///< PROTOCOL_INFO_SIGNATURE.
- LIST_ENTRY Link; ///< Standard linked list helper member.
- //
- // The parsing info for the protocol.
- //
- EFI_GUID ProtocolId; ///< The GUID for the protocol.
- CHAR16 *IdString; ///< The name of the protocol.
- SHELLENV_DUMP_PROTOCOL_INFO DumpToken; ///< The pointer to DumpToken function for the protocol.
- SHELLENV_DUMP_PROTOCOL_INFO DumpInfo; ///< The pointer to DumpInfo function for the protocol.
- //
- // Patabase info on which handles are supporting this protocol.
- //
- UINTN NoHandles; ///< The number of handles producing this protocol.
- EFI_HANDLE *Handles; ///< The array of handles.
-
-} PROTOCOL_INFO;
-
-//
-// Declarations of protocol info enumerator.
-//
-/**
- This is an internal shell function to initialize the protocol enumerator.
-
- This must be called before NEXT_PROTOCOL_INFO, SKIP_PROTOCOL_INFO,
- RESET_PROTOCOL_INFO_ENUMERATOR, and CLOSE_PROTOCOL_INFO_ENUMERATOR are
- called.
-**/
-typedef
-VOID
-(EFIAPI *INIT_PROTOCOL_INFO_ENUMERATOR) (
- VOID
- );
-
-/**
- This function is an internal shell function for enumeration of protocols.
-
- This function returns the next protocol on the list. If this is called
- immediately after initialization, it will return the first protocol on the list.
- If this is called immediately after reset, it will return the first protocol again.
-
- This cannot be called after CLOSE_PROTOCOL_INFO_ENUMERATOR, but it must be
- called after INIT_PROTOCOL_INFO_ENUMERATOR.
-
- @param[in, out] ProtocolInfo The pointer to pointer to protocol information structure.
-
- @retval EFI_SUCCESS The next protocol's information was sucessfully returned.
- @retval NULL There are no more protocols.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *NEXT_PROTOCOL_INFO) (
- IN OUT PROTOCOL_INFO **ProtocolInfo
- );
-
-/**
- This function is an internal shell function for enumeration of protocols.
-
- This cannot be called after CLOSE_PROTOCOL_INFO_ENUMERATOR, but it must be
- called after INIT_PROTOCOL_INFO_ENUMERATOR.
-
- This function does nothing and always returns EFI_SUCCESS.
-
- @retval EFI_SUCCESS Always returned (see above).
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SKIP_PROTOCOL_INFO) (
- IN UINTN SkipNum
- );
-
-/**
- This function is an internal shell function for enumeration of protocols.
-
- This cannot be called after CLOSE_PROTOCOL_INFO_ENUMERATOR, but it must be
- called after INIT_PROTOCOL_INFO_ENUMERATOR.
-
- This function resets the list of protocols such that the next one in the
- list is the begining of the list.
-**/
-typedef
-VOID
-(EFIAPI *RESET_PROTOCOL_INFO_ENUMERATOR) (
- VOID
- );
-
-
-/**
- This function is an internal shell function for enumeration of protocols.
-
- This must be called after INIT_PROTOCOL_INFO_ENUMERATOR. After this call
- no protocol enumerator calls except INIT_PROTOCOL_INFO_ENUMERATOR may be made.
-
- This function frees any memory or resources associated with the protocol
- enumerator.
-**/
-typedef
-VOID
-(EFIAPI *CLOSE_PROTOCOL_INFO_ENUMERATOR) (
- VOID
- );
-
-/**
- Protocol enumerator structure of function pointers.
-**/
-typedef struct {
- INIT_PROTOCOL_INFO_ENUMERATOR Init; ///< The pointer to INIT_PROTOCOL_INFO_ENUMERATOR function.
- NEXT_PROTOCOL_INFO Next; ///< The pointer to NEXT_PROTOCOL_INFO function.
- SKIP_PROTOCOL_INFO Skip; ///< The pointer to SKIP_PROTOCOL_INFO function.
- RESET_PROTOCOL_INFO_ENUMERATOR Reset; ///< The pointer to RESET_PROTOCOL_INFO_ENUMERATOR function.
- CLOSE_PROTOCOL_INFO_ENUMERATOR Close; ///< The pointer to CLOSE_PROTOCOL_INFO_ENUMERATOR function.
-} PROTOCOL_INFO_ENUMERATOR;
-
-/**
- This function is used to retrieve a user-friendly display name for a handle.
-
- If UseComponentName is TRUE then the component name protocol for this device
- or it's parent device (if required) will be used to obtain the name of the
- device. If UseDevicePath is TRUE it will get the human readable device path
- and return that. If both are TRUE it will try to use component name first
- and device path if that fails.
-
- It will use either ComponentName or ComponentName2 protocol, depending on
- what is present.
-
- This function will furthur verify whether the handle in question produced either
- EFI_DRIVER_CONFIGRATION_PROTOCOL or EFI_DRIVER_CONFIGURATION2_PROTOCOL and also
- whether the handle in question produced either EFI_DRIVER_DIAGNOSTICS_PROTOCOL or
- EFI_DRIVER_DIAGNOSTICS2_PROTOCOL.
-
- Upon successful return, the memory for *BestDeviceName is up to the caller to free.
-
- @param[in] DeviceHandle The device handle whose name is desired.
- @param[in] UseComponentName Whether to use the ComponentName protocol at all.
- @param[in] UseDevicePath Whether to use the DevicePath protocol at all.
- @param[in] Language The pointer to the language string to use.
- @param[in, out] BestDeviceName The pointer to pointer to string allocated with the name.
- @param[out] ConfigurationStatus The pointer to status for opening a Configuration protocol.
- @param[out] DiagnosticsStatus The pointer to status for opening a Diagnostics protocol.
- @param[in] Display Whether to Print this out to default Print location.
- @param[in] Indent How many characters to indent the printing.
-
- @retval EFI_SUCCESS This function always returns EFI_SUCCESS.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *GET_DEVICE_NAME) (
- IN EFI_HANDLE DeviceHandle,
- IN BOOLEAN UseComponentName,
- IN BOOLEAN UseDevicePath,
- IN CHAR8 *Language,
- IN OUT CHAR16 **BestDeviceName,
- OUT EFI_STATUS *ConfigurationStatus,
- OUT EFI_STATUS *DiagnosticsStatus,
- IN BOOLEAN Display,
- IN UINTN Indent
- );
-
-#define EFI_SHELL_COMPATIBLE_MODE_VER L"1.1.1" ///< The string for lowest version this shell supports.
-#define EFI_SHELL_ENHANCED_MODE_VER L"1.1.2" ///< The string for highest version this shell supports.
-
-/**
- This function gets the shell mode as stored in the shell environment
- "efishellmode". It will not fail.
-
- @param[out] Mode Returns a string representing one of the
- 2 supported modes of the shell.
-
- @retval EFI_SUCCESS This function always returns success.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *GET_SHELL_MODE) (
- OUT CHAR16 **Mode
- );
-
-/**
- Convert a file system style name to a device path.
-
- This function will convert a shell path name to a Device Path Protocol path.
- This function will allocate any required memory for this operation and it
- is the responsibility of the caller to free that memory when no longer required.
-
- If anything prevents the complete conversion free any allocated memory and
- return NULL.
-
- @param[in] Path The path to convert.
-
- @retval !NULL A pointer to the callee allocated Device Path.
- @retval NULL The operation could not be completed.
-**/
-typedef
-EFI_DEVICE_PATH_PROTOCOL*
-(EFIAPI *SHELLENV_NAME_TO_PATH) (
- IN CHAR16 *Path
- );
-
-/**
- Converts a device path into a file system map name.
-
- If DevPath is NULL, then ASSERT.
-
- This function looks through the shell environment map for a map whose device
- path matches the DevPath parameter. If one is found the Name is returned via
- Name parameter. If sucessful the caller must free the memory allocated for
- Name.
-
- This function will use the internal lock to prevent changes to the map during
- the lookup operation.
-
- @param[in] DevPath The device path to search for a name for.
- @param[in] ConsistMapping What state to verify map flag VAR_ID_CONSIST.
- @param[out] Name On sucessful return the name of that device path.
-
- @retval EFI_SUCCESS The DevPath was found and the name returned
- in Name.
- @retval EFI_OUT_OF_RESOURCES A required memory allocation failed.
- @retval EFI_UNSUPPORTED The DevPath was not found in the map.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_GET_FS_NAME) (
- IN EFI_DEVICE_PATH_PROTOCOL * DevPath,
- IN BOOLEAN ConsistMapping,
- OUT CHAR16 **Name
- );
-
-/**
- This function will open a group of files that match the Arg path, but will not
- support the wildcard characters ('?' and '*') in the Arg path. If there are
- any wildcard characters in the path this function will return
- EFI_INVALID_PARAMETER. The return is a double linked list based on the
- LIST_ENTRY linked list structure. Use this in conjunction with the
- SHELL_FILE_ARG_SIGNATURE to get the SHELL_FILE_ARG structures that are returned.
- The memory allocated by the callee for this list is freed by making a call to
- SHELLENV_FREE_FILE_LIST.
-
- @param[in] Arg The pointer to the path of the files to be opened.
- @param[in, out] ListHead The pointer to allocated and initialized list head
- upon which to append all the opened file structures.
-
- @retval EFI_SUCCESS One or more files was opened and a struct of each file's
- information was appended to ListHead.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_NOT_FOUND No matching files could be found.
- @sa SHELLENV_FREE_FILE_LIST
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_FILE_META_ARG_NO_WILDCARD) (
- IN CHAR16 *Arg,
- IN OUT LIST_ENTRY *ListHead
- );
-
-/**
- This function removes duplicate file listings from lists.
-
- This is a function for use with SHELLENV_FILE_META_ARG_NO_WILDCARD and
- SHELLENV_FILE_META_ARG. This function will verify that there are no duplicate
- files in the list of returned files. Any file listed twice will have one of its
- instances removed.
-
- @param[in] ListHead The pointer to linked list head that was returned from
- SHELLENV_FILE_META_ARG_NO_WILDCARD or
- SHELLENV_FILE_META_ARG.
-
- @retval EFI_SUCCESS This function always returns success.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_DEL_DUP_FILE) (
- IN LIST_ENTRY * ListHead
- );
-
-/**
- Converts a File System map name to a device path.
-
- If DevPath is NULL, then ASSERT().
-
- This function looks through the shell environment map for a map whose Name
- matches the Name parameter. If one is found, the device path pointer is
- updated to point to that file systems device path. The caller should not
- free the memory from that device path.
-
- This function will use the internal lock to prevent changes to the map during
- the lookup operation.
-
- @param[in] Name The pointer to the NULL terminated UNICODE string of the
- file system name.
- @param[out] DevPath The pointer to pointer to DevicePath. Only valid on
- successful return.
-
- @retval EFI_SUCCESS The conversion was successful, and the device
- path was returned.
- @retval EFI_NOT_FOUND The file system could not be found in the map.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *SHELLENV_GET_FS_DEVICE_PATH) (
- IN CHAR16 *Name,
- OUT EFI_DEVICE_PATH_PROTOCOL **DevPath
- );
-
-/// EFI_SHELL_ENVIRONMENT2 protocol structure.
-typedef struct {
- SHELLENV_EXECUTE Execute;
- SHELLENV_GET_ENV GetEnv;
- SHELLENV_GET_MAP GetMap;
- SHELLENV_ADD_CMD AddCmd;
- SHELLENV_ADD_PROT AddProt;
- SHELLENV_GET_PROT GetProt;
- SHELLENV_CUR_DIR CurDir;
- SHELLENV_FILE_META_ARG FileMetaArg;
- SHELLENV_FREE_FILE_LIST FreeFileList;
-
- //
- // The following services are only used by the shell itself.
- //
- SHELLENV_NEW_SHELL NewShell;
- SHELLENV_BATCH_IS_ACTIVE BatchIsActive;
-
- SHELLENV_FREE_RESOURCES FreeResources;
-
- //
- // GUID to differentiate ShellEnvironment2 from ShellEnvironment.
- //
- EFI_GUID SESGuid;
- //
- // Major Version grows if shell environment interface has been changes.
- //
- UINT32 MajorVersion;
- UINT32 MinorVersion;
- SHELLENV_ENABLE_PAGE_BREAK EnablePageBreak;
- SHELLENV_DISABLE_PAGE_BREAK DisablePageBreak;
- SHELLENV_GET_PAGE_BREAK GetPageBreak;
-
- SHELLENV_SET_KEY_FILTER SetKeyFilter;
- SHELLENV_GET_KEY_FILTER GetKeyFilter;
-
- SHELLENV_GET_EXECUTION_BREAK GetExecutionBreak;
- SHELLENV_INCREMENT_SHELL_NESTING_LEVEL IncrementShellNestingLevel;
- SHELLENV_DECREMENT_SHELL_NESTING_LEVEL DecrementShellNestingLevel;
- SHELLENV_IS_ROOT_SHELL IsRootShell;
-
- SHELLENV_CLOSE_CONSOLE_PROXY CloseConsoleProxy;
- HANDLE_ENUMERATOR HandleEnumerator;
- PROTOCOL_INFO_ENUMERATOR ProtocolInfoEnumerator;
- GET_DEVICE_NAME GetDeviceName;
- GET_SHELL_MODE GetShellMode;
- SHELLENV_NAME_TO_PATH NameToPath;
- SHELLENV_GET_FS_NAME GetFsName;
- SHELLENV_FILE_META_ARG_NO_WILDCARD FileMetaArgNoWildCard;
- SHELLENV_DEL_DUP_FILE DelDupFileArg;
- SHELLENV_GET_FS_DEVICE_PATH GetFsDevicePath;
-} EFI_SHELL_ENVIRONMENT2;
-
-extern EFI_GUID gEfiShellEnvironment2Guid;
-extern EFI_GUID gEfiShellEnvironment2ExtGuid;
-
-#endif // _SHELL_ENVIRONMENT_2_PROTOCOL_H_
diff --git a/ShellPkg/Include/Protocol/EfiShellInterface.h b/ShellPkg/Include/Protocol/EfiShellInterface.h
deleted file mode 100644
index 6a34c60b07..0000000000
--- a/ShellPkg/Include/Protocol/EfiShellInterface.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/** @file
- EFI Shell Interface protocol from EDK shell (no spec).
-
- Shell Interface - additional information (over image_info) provided
- to an application started by the shell.
-
- ConIo provides a file-style interface to the console.
-
- The shell interface's and data (including ConIo) are only valid during
- the applications Entry Point. Once the application returns from it's
- entry point the data is freed by the invoking shell.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELLINTERFACE_H_
-#define _SHELLINTERFACE_H_
-
-#include <Protocol/SimpleFileSystem.h>
-
-#define SHELL_INTERFACE_PROTOCOL_GUID \
- { \
- 0x47c7b223, 0xc42a, 0x11d2, {0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} \
- }
-
-///
-/// Bit definitions for EFI_SHELL_ARG_INFO
-///
-typedef enum {
- ARG_NO_ATTRIB = 0x0,
- ARG_IS_QUOTED = BIT0,
- ARG_PARTIALLY_QUOTED = BIT1,
- ARG_FIRST_HALF_QUOTED = BIT2,
- ARG_FIRST_CHAR_IS_ESC = BIT3
-} EFI_SHELL_ARG_INFO_TYPES;
-
-///
-/// Attributes for an argument.
-///
-typedef struct _EFI_SHELL_ARG_INFO {
- UINT32 Attributes;
-} EFI_SHELL_ARG_INFO;
-
-///
-/// This protocol provides access to additional information about a shell application.
-///
-typedef struct {
- ///
- /// Handle back to original image handle & image information.
- ///
- EFI_HANDLE ImageHandle;
- EFI_LOADED_IMAGE_PROTOCOL *Info;
-
- ///
- /// Parsed arg list converted more C-like format.
- ///
- CHAR16 **Argv;
- UINTN Argc;
-
- ///
- /// Storage for file redirection args after parsing.
- ///
- CHAR16 **RedirArgv;
- UINTN RedirArgc;
-
- ///
- /// A file style handle for console io.
- ///
- EFI_FILE_PROTOCOL *StdIn;
- EFI_FILE_PROTOCOL *StdOut;
- EFI_FILE_PROTOCOL *StdErr;
-
- ///
- /// List of attributes for each argument.
- ///
- EFI_SHELL_ARG_INFO *ArgInfo;
-
- ///
- /// Whether we are echoing.
- ///
- BOOLEAN EchoOn;
-} EFI_SHELL_INTERFACE;
-
-extern EFI_GUID gEfiShellInterfaceGuid;
-
-#endif
diff --git a/ShellPkg/Include/Protocol/EfiShellParameters.h b/ShellPkg/Include/Protocol/EfiShellParameters.h
deleted file mode 100644
index e52328b3a4..0000000000
--- a/ShellPkg/Include/Protocol/EfiShellParameters.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @file
- EFI Shell protocol as defined in the UEFI Shell 2.0 specification.
-
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __EFI_SHELL_PARAMETERS_PROTOCOL__
-#define __EFI_SHELL_PARAMETERS_PROTOCOL__
-
-#include <ShellBase.h>
-
-#define EFI_SHELL_PARAMETERS_PROTOCOL_GUID \
- { \
- 0x752f3136, 0x4e16, 0x4fdc, { 0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca } \
- }
-
-typedef struct _EFI_SHELL_PARAMETERS_PROTOCOL {
- ///
- /// Points to an Argc-element array of points to NULL-terminated strings containing
- /// the command-line parameters. The first entry in the array is always the full file
- /// path of the executable. Any quotation marks that were used to preserve
- /// whitespace have been removed.
- ///
- CHAR16 **Argv;
-
- ///
- /// The number of elements in the Argv array.
- ///
- UINTN Argc;
-
- ///
- /// The file handle for the standard input for this executable. This may be different
- /// from the ConInHandle in EFI_SYSTEM_TABLE.
- ///
- SHELL_FILE_HANDLE StdIn;
-
- ///
- /// The file handle for the standard output for this executable. This may be different
- /// from the ConOutHandle in EFI_SYSTEM_TABLE.
- ///
- SHELL_FILE_HANDLE StdOut;
-
- ///
- /// The file handle for the standard error output for this executable. This may be
- /// different from the StdErrHandle in EFI_SYSTEM_TABLE.
- ///
- SHELL_FILE_HANDLE StdErr;
-} EFI_SHELL_PARAMETERS_PROTOCOL;
-
-extern EFI_GUID gEfiShellParametersProtocolGuid;
-
-#endif
diff --git a/ShellPkg/Include/ShellBase.h b/ShellPkg/Include/ShellBase.h
deleted file mode 100644
index 576cd7b1a4..0000000000
--- a/ShellPkg/Include/ShellBase.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/** @file
- Root include file for Shell Package modules that utilize the SHELL_RETURN type
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SHELL_BASE_
-#define _SHELL_BASE_
-
-typedef VOID *SHELL_FILE_HANDLE;
-
-#define SHELL_FREE_NON_NULL(Pointer) \
- do { \
- if ((Pointer) != NULL) { \
- FreePool((Pointer)); \
- (Pointer) = NULL; \
- } \
- } while(FALSE)
-
-typedef enum {
-///
-/// The operation completed successfully.
-///
-SHELL_SUCCESS = 0,
-
-///
-/// The image failed to load.
-///
-SHELL_LOAD_ERROR = 1,
-
-///
-/// The parameter was incorrect.
-///
-SHELL_INVALID_PARAMETER = 2,
-
-///
-/// The operation is not supported.
-///
-SHELL_UNSUPPORTED = 3,
-
-///
-/// The buffer was not the proper size for the request.
-///
-SHELL_BAD_BUFFER_SIZE = 4,
-
-///
-/// The buffer was not large enough to hold the requested data.
-/// The required buffer size is returned in the appropriate
-/// parameter when this error occurs.
-///
-SHELL_BUFFER_TOO_SMALL = 5,
-
-///
-/// There is no data pending upon return.
-///
-SHELL_NOT_READY = 6,
-
-///
-/// The physical device reported an error while attempting the
-/// operation.
-///
-SHELL_DEVICE_ERROR = 7,
-
-///
-/// The device cannot be written to.
-///
-SHELL_WRITE_PROTECTED = 8,
-
-///
-/// The resource has run out.
-///
-SHELL_OUT_OF_RESOURCES = 9,
-
-///
-/// An inconsistency was detected on the file system causing the
-/// operation to fail.
-///
-SHELL_VOLUME_CORRUPTED = 10,
-
-///
-/// There is no more space on the file system.
-///
-SHELL_VOLUME_FULL = 11,
-
-///
-/// The device does not contain any medium to perform the
-/// operation.
-///
-SHELL_NO_MEDIA = 12,
-
-///
-/// The medium in the device has changed since the last
-/// access.
-///
-SHELL_MEDIA_CHANGED = 13,
-
-///
-/// The item was not found.
-///
-SHELL_NOT_FOUND = 14,
-
-///
-/// Access was denied.
-///
-SHELL_ACCESS_DENIED = 15,
-
-// note the skipping of 16 and 17
-
-///
-/// A timeout time expired.
-///
-SHELL_TIMEOUT = 18,
-
-///
-/// The protocol has not been started.
-///
-SHELL_NOT_STARTED = 19,
-
-///
-/// The protocol has already been started.
-///
-SHELL_ALREADY_STARTED = 20,
-
-///
-/// The operation was aborted.
-///
-SHELL_ABORTED = 21,
-
-// note the skipping of 22, 23, and 24
-
-///
-/// A function encountered an internal version that was
-/// incompatible with a version requested by the caller.
-///
-SHELL_INCOMPATIBLE_VERSION = 25,
-
-///
-/// The function was not performed due to a security violation.
-///
-SHELL_SECURITY_VIOLATION = 26,
-
-///
-/// The function was performed and resulted in an unequal
-/// comparison..
-///
-SHELL_NOT_EQUAL = 27
-}SHELL_STATUS;
-
-#endif //__SHELL_BASE__ \ No newline at end of file
diff --git a/ShellPkg/Library/BasePathLib/BasePathLib.c b/ShellPkg/Library/BasePathLib/BasePathLib.c
deleted file mode 100644
index 2166c9d8af..0000000000
--- a/ShellPkg/Library/BasePathLib/BasePathLib.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/** @file
- Provides interface to path manipulation functions.
-
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#include <Base.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/PathLib.h>
-#include <Library/BaseLib.h>
-
-/**
- Removes the last directory or file entry in a path by changing the last
- L'\' to a CHAR_NULL.
-
- @param[in, out] Path The pointer to the path to modify.
-
- @retval FALSE Nothing was found to remove.
- @retval TRUE A directory or file was removed.
-**/
-BOOLEAN
-EFIAPI
-PathRemoveLastItem(
- IN OUT CHAR16 *Path
- )
-{
- CHAR16 *Walker;
- CHAR16 *LastSlash;
- //
- // get directory name from path... ('chop' off extra)
- //
- for ( Walker = Path, LastSlash = NULL
- ; Walker != NULL && *Walker != CHAR_NULL
- ; Walker++
- ){
- if (*Walker == L'\\' && *(Walker + 1) != CHAR_NULL) {
- LastSlash = Walker+1;
- }
- }
- if (LastSlash != NULL) {
- *LastSlash = CHAR_NULL;
- return (TRUE);
- }
- return (FALSE);
-}
-
-/**
- Function to clean up paths.
-
- - Single periods in the path are removed.
- - Double periods in the path are removed along with a single parent directory.
- - Forward slashes L'/' are converted to backward slashes L'\'.
-
- This will be done inline and the existing buffer may be larger than required
- upon completion.
-
- @param[in] Path The pointer to the string containing the path.
-
- @retval NULL An error occured.
- @return Path in all other instances.
-**/
-CHAR16*
-EFIAPI
-PathCleanUpDirectories(
- IN CHAR16 *Path
- )
-{
- CHAR16 *TempString;
- UINTN TempSize;
- if (Path==NULL) {
- return(NULL);
- }
-
- //
- // Fix up the '/' vs '\'
- //
- for (TempString = Path ; TempString != NULL && *TempString != CHAR_NULL ; TempString++) {
- if (*TempString == L'/') {
- *TempString = L'\\';
- }
- }
-
- //
- // Fix up the ..
- //
- while ((TempString = StrStr(Path, L"\\..\\")) != NULL) {
- *TempString = CHAR_NULL;
- TempString += 4;
- PathRemoveLastItem(Path);
- TempSize = StrSize(TempString);
- CopyMem(Path+StrLen(Path), TempString, TempSize);
- }
- if ((TempString = StrStr(Path, L"\\..")) != NULL && *(TempString + 3) == CHAR_NULL) {
- *TempString = CHAR_NULL;
- PathRemoveLastItem(Path);
- }
-
- //
- // Fix up the .
- //
- while ((TempString = StrStr(Path, L"\\.\\")) != NULL) {
- *TempString = CHAR_NULL;
- TempString += 2;
- TempSize = StrSize(TempString);
- CopyMem(Path+StrLen(Path), TempString, TempSize);
- }
- if ((TempString = StrStr(Path, L"\\.")) != NULL && *(TempString + 2) == CHAR_NULL) {
- *(TempString + 1) = CHAR_NULL;
- }
-
-
-
- return (Path);
-}
-
diff --git a/ShellPkg/Library/BasePathLib/BasePathLib.inf b/ShellPkg/Library/BasePathLib/BasePathLib.inf
deleted file mode 100644
index a9bd6a8e45..0000000000
--- a/ShellPkg/Library/BasePathLib/BasePathLib.inf
+++ /dev/null
@@ -1,38 +0,0 @@
-## @file
-# Provides interface to path manipulation functions.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = BasePathLib
- FILE_GUID = ED244F93-B97A-4a17-83E0-A03CF2A7F7B4
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = PathLib|UEFI_APPLICATION UEFI_DRIVER
-
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- BasePathLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
-
-
-[LibraryClasses]
- BaseMemoryLib
- BaseLib \ No newline at end of file
diff --git a/ShellPkg/Library/BaseSortLib/BaseSortLib.c b/ShellPkg/Library/BaseSortLib/BaseSortLib.c
deleted file mode 100644
index 0b7e8f3f6f..0000000000
--- a/ShellPkg/Library/BaseSortLib/BaseSortLib.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/** @file
- Library used for sorting routines.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Uefi.h>
-
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/SortLib.h>
-
-/**
- Worker function for QuickSorting. This function is identical to PerformQuickSort,
- except that is uses the pre-allocated buffer so the in place sorting does not need to
- allocate and free buffers constantly.
-
- Each element must be equal sized.
-
- if BufferToSort is NULL, then ASSERT.
- if CompareFunction is NULL, then ASSERT.
- if Buffer is NULL, then ASSERT.
-
- if Count is < 2 then perform no action.
- if Size is < 1 then perform no action.
-
- @param[in, out] BufferToSort on call a Buffer of (possibly sorted) elements
- on return a buffer of sorted elements
- @param[in] Count the number of elements in the buffer to sort
- @param[in] ElementSize Size of an element in bytes
- @param[in] CompareFunction The function to call to perform the comparison
- of any 2 elements
- @param[in] Buffer Buffer of size ElementSize for use in swapping
-**/
-VOID
-EFIAPI
-QuickSortWorker (
- IN OUT VOID *BufferToSort,
- IN CONST UINTN Count,
- IN CONST UINTN ElementSize,
- IN SORT_COMPARE CompareFunction,
- IN VOID *Buffer
- )
-{
- VOID *Pivot;
- UINTN LoopCount;
- UINTN NextSwapLocation;
-
- ASSERT(BufferToSort != NULL);
- ASSERT(CompareFunction != NULL);
- ASSERT(Buffer != NULL);
-
- if ( Count < 2
- || ElementSize < 1
- ){
- return;
- }
-
- NextSwapLocation = 0;
-
- //
- // pick a pivot (we choose last element)
- //
- Pivot = ((UINT8*)BufferToSort+((Count-1)*ElementSize));
-
- //
- // Now get the pivot such that all on "left" are below it
- // and everything "right" are above it
- //
- for ( LoopCount = 0
- ; LoopCount < Count -1
- ; LoopCount++
- ){
- //
- // if the element is less than the pivot
- //
- if (CompareFunction((VOID*)((UINT8*)BufferToSort+((LoopCount)*ElementSize)),Pivot) <= 0){
- //
- // swap
- //
- CopyMem (Buffer, (UINT8*)BufferToSort+(NextSwapLocation*ElementSize), ElementSize);
- CopyMem ((UINT8*)BufferToSort+(NextSwapLocation*ElementSize), (UINT8*)BufferToSort+((LoopCount)*ElementSize), ElementSize);
- CopyMem ((UINT8*)BufferToSort+((LoopCount)*ElementSize), Buffer, ElementSize);
-
- //
- // increment NextSwapLocation
- //
- NextSwapLocation++;
- }
- }
- //
- // swap pivot to it's final position (NextSwapLocaiton)
- //
- CopyMem (Buffer, Pivot, ElementSize);
- CopyMem (Pivot, (UINT8*)BufferToSort+(NextSwapLocation*ElementSize), ElementSize);
- CopyMem ((UINT8*)BufferToSort+(NextSwapLocation*ElementSize), Buffer, ElementSize);
-
- //
- // Now recurse on 2 paritial lists. neither of these will have the 'pivot' element
- // IE list is sorted left half, pivot element, sorted right half...
- //
- if (NextSwapLocation >= 2) {
- QuickSortWorker(
- BufferToSort,
- NextSwapLocation,
- ElementSize,
- CompareFunction,
- Buffer);
- }
-
- if ((Count - NextSwapLocation - 1) >= 2) {
- QuickSortWorker(
- (UINT8 *)BufferToSort + (NextSwapLocation+1) * ElementSize,
- Count - NextSwapLocation - 1,
- ElementSize,
- CompareFunction,
- Buffer);
- }
- return;
-}
-/**
- Function to perform a Quick Sort alogrithm on a buffer of comparable elements.
-
- Each element must be equal sized.
-
- if BufferToSort is NULL, then ASSERT.
- if CompareFunction is NULL, then ASSERT.
-
- if Count is < 2 then perform no action.
- if Size is < 1 then perform no action.
-
- @param[in, out] BufferToSort on call a Buffer of (possibly sorted) elements
- on return a buffer of sorted elements
- @param[in] Count the number of elements in the buffer to sort
- @param[in] ElementSize Size of an element in bytes
- @param[in] CompareFunction The function to call to perform the comparison
- of any 2 elements
-**/
-VOID
-EFIAPI
-PerformQuickSort (
- IN OUT VOID *BufferToSort,
- IN CONST UINTN Count,
- IN CONST UINTN ElementSize,
- IN SORT_COMPARE CompareFunction
- )
-{
- VOID *Buffer;
-
- ASSERT(BufferToSort != NULL);
- ASSERT(CompareFunction != NULL);
-
- Buffer = AllocateZeroPool(ElementSize);
- ASSERT(Buffer != NULL);
-
- QuickSortWorker(
- BufferToSort,
- Count,
- ElementSize,
- CompareFunction,
- Buffer);
-
- FreePool(Buffer);
- return;
-}
-
-/**
- Not supported in Base version.
-
- @param[in] Buffer1 Ignored.
- @param[in] Buffer2 Ignored.
-
- ASSERT and return 0.
-**/
-INTN
-EFIAPI
-DevicePathCompare (
- IN CONST VOID *Buffer1,
- IN CONST VOID *Buffer2
- )
-{
- ASSERT(FALSE);
- return 0;
-}
-
-/**
- Function to compare 2 strings without regard to case of the characters.
-
- @param[in] Buffer1 Pointer to String to compare.
- @param[in] Buffer2 Pointer to second String to compare.
-
- @retval 0 Buffer1 equal to Buffer2.
- @return < 0 Buffer1 is less than Buffer2.
- @return > 0 Buffer1 is greater than Buffer2.
-**/
-INTN
-EFIAPI
-StringNoCaseCompare (
- IN CONST VOID *Buffer1,
- IN CONST VOID *Buffer2
- )
-{
- ASSERT(FALSE);
- return 0;
-}
-
-
-/**
- Function to compare 2 strings.
-
- @param[in] Buffer1 Pointer to String to compare (CHAR16**).
- @param[in] Buffer2 Pointer to second String to compare (CHAR16**).
-
- @retval 0 Buffer1 equal to Buffer2.
- @return < 0 Buffer1 is less than Buffer2.
- @return > 0 Buffer1 is greater than Buffer2.
-**/
-INTN
-EFIAPI
-StringCompare (
- IN CONST VOID *Buffer1,
- IN CONST VOID *Buffer2
- )
-{
- ASSERT(FALSE);
- return 0;
-}
-
-
diff --git a/ShellPkg/Library/BaseSortLib/BaseSortLib.inf b/ShellPkg/Library/BaseSortLib/BaseSortLib.inf
deleted file mode 100644
index 3d2b259819..0000000000
--- a/ShellPkg/Library/BaseSortLib/BaseSortLib.inf
+++ /dev/null
@@ -1,41 +0,0 @@
-## @file
-# Library used for sorting routines.
-#
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = BaseSortLib
- FILE_GUID = 03F3331B-F12D-494f-BF37-E55A657F2497
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = SortLib|UEFI_APPLICATION UEFI_DRIVER
-
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- BaseSortLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
-
-
diff --git a/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c b/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
deleted file mode 100644
index fb9d4ec0be..0000000000
--- a/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
+++ /dev/null
@@ -1,1165 +0,0 @@
-/** @file
- Provides interface to EFI_FILE_HANDLE functionality.
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Uefi.h>
-
-#include <Protocol/SimpleFileSystem.h>
-#include <Protocol/UnicodeCollation.h>
-
-#include <Guid/FileInfo.h>
-
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/FileHandleLib.h>
-#include <Library/PcdLib.h>
-#include <Library/PrintLib.h>
-
-CONST UINT16 gUnicodeFileTag = EFI_UNICODE_BYTE_ORDER_MARK;
-
-#define MAX_FILE_NAME_LEN 522 // (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for bytes)
-#define FIND_XXXXX_FILE_BUFFER_SIZE (SIZE_OF_EFI_FILE_INFO + MAX_FILE_NAME_LEN)
-
-/**
- This function will retrieve the information about the file for the handle
- specified and store it in allocated pool memory.
-
- This function allocates a buffer to store the file's information. It is the
- caller's responsibility to free the buffer
-
- @param FileHandle The file handle of the file for which information is
- being requested.
-
- @retval NULL information could not be retrieved.
-
- @return the information about the file
-**/
-EFI_FILE_INFO*
-EFIAPI
-FileHandleGetInfo (
- IN EFI_FILE_HANDLE FileHandle
- )
-{
- EFI_FILE_INFO *FileInfo;
- UINTN FileInfoSize;
- EFI_STATUS Status;
-
- if (FileHandle == NULL) {
- return (NULL);
- }
-
- //
- // Get the required size to allocate
- //
- FileInfoSize = 0;
- FileInfo = NULL;
- Status = FileHandle->GetInfo(FileHandle,
- &gEfiFileInfoGuid,
- &FileInfoSize,
- NULL);
- if (Status == EFI_BUFFER_TOO_SMALL){
- //
- // error is expected. getting size to allocate
- //
- FileInfo = AllocateZeroPool(FileInfoSize);
- //
- // now get the information
- //
- Status = FileHandle->GetInfo(FileHandle,
- &gEfiFileInfoGuid,
- &FileInfoSize,
- FileInfo);
- //
- // if we got an error free the memory and return NULL
- //
- if (EFI_ERROR(Status)) {
- FreePool(FileInfo);
- return NULL;
- }
- }
- return (FileInfo);
-}
-
-/**
- This function sets the information about the file for the opened handle
- specified.
-
- @param[in] FileHandle The file handle of the file for which information
- is being set.
-
- @param[in] FileInfo The information to set.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER A parameter was out of range or invalid.
- @retval EFI_UNSUPPORTED The FileHandle does not support FileInfo.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleSetInfo (
- IN EFI_FILE_HANDLE FileHandle,
- IN CONST EFI_FILE_INFO *FileInfo
- )
-{
-
- //
- // ASSERT if the FileHandle or FileInfo is NULL
- //
- ASSERT (FileHandle != NULL);
- ASSERT (FileInfo != NULL);
-
- //
- // Set the info
- //
- return (FileHandle->SetInfo(FileHandle,
- &gEfiFileInfoGuid,
- (UINTN)FileInfo->Size,
- (EFI_FILE_INFO*)FileInfo));
-}
-
-/**
- This function reads information from an opened file.
-
- If FileHandle is not a directory, the function reads the requested number of
- bytes from the file at the file's current position and returns them in Buffer.
- If the read goes beyond the end of the file, the read length is truncated to the
- end of the file. The file's current position is increased by the number of bytes
- returned. If FileHandle is a directory, the function reads the directory entry
- at the file's current position and returns the entry in Buffer. If the Buffer
- is not large enough to hold the current directory entry, then
- EFI_BUFFER_TOO_SMALL is returned and the current file position is not updated.
- BufferSize is set to be the size of the buffer needed to read the entry. On
- success, the current position is updated to the next directory entry. If there
- are no more directory entries, the read returns a zero-length buffer.
- EFI_FILE_INFO is the structure returned as the directory entry.
-
- @param FileHandle the opened file handle
- @param BufferSize on input the size of buffer in bytes. on return
- the number of bytes written.
- @param Buffer the buffer to put read data into.
-
- @retval EFI_SUCCESS Data was read.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required
- size.
-
-**/
-EFI_STATUS
-EFIAPI
-FileHandleRead(
- IN EFI_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- )
-{
- //
- // ASSERT if FileHandle is NULL
- //
- ASSERT (FileHandle != NULL);
-
- //
- // Perform the read based on EFI_FILE_PROTOCOL
- //
- return (FileHandle->Read(FileHandle, BufferSize, Buffer));
-}
-
-
-/**
- Write data to a file.
-
- This function writes the specified number of bytes to the file at the current
- file position. The current file position is advanced the actual number of bytes
- written, which is returned in BufferSize. Partial writes only occur when there
- has been a data error during the write attempt (such as "volume space full").
- The file is automatically grown to hold the data if required. Direct writes to
- opened directories are not supported.
-
- @param FileHandle The opened file for writing
- @param BufferSize on input the number of bytes in Buffer. On output
- the number of bytes written.
- @param Buffer the buffer containing data to write is stored.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED Writes to an open directory are not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write-protected.
- @retval EFI_ACCESS_DENIED The file was open for read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleWrite(
- IN EFI_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- //
- // ASSERT if FileHandle is NULL
- //
- ASSERT (FileHandle != NULL);
- //
- // Perform the write based on EFI_FILE_PROTOCOL
- //
- return (FileHandle->Write(FileHandle, BufferSize, Buffer));
-}
-
-/**
- Close an open file handle.
-
- This function closes a specified file handle. All "dirty" cached file data is
- flushed to the device, and the file is closed. In all cases the handle is
- closed.
-
-@param FileHandle the file handle to close.
-
-@retval EFI_SUCCESS the file handle was closed sucessfully.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleClose (
- IN EFI_FILE_HANDLE FileHandle
- )
-{
- EFI_STATUS Status;
- //
- // ASSERT if FileHandle is NULL
- //
- ASSERT (FileHandle != NULL);
- //
- // Perform the Close based on EFI_FILE_PROTOCOL
- //
- Status = FileHandle->Close(FileHandle);
- return Status;
-}
-
-/**
- Delete a file and close the handle
-
- This function closes and deletes a file. In all cases the file handle is closed.
- If the file cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is
- returned, but the handle is still closed.
-
- @param FileHandle the file handle to delete
-
- @retval EFI_SUCCESS the file was closed sucessfully
- @retval EFI_WARN_DELETE_FAILURE the handle was closed, but the file was not
- deleted
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleDelete (
- IN EFI_FILE_HANDLE FileHandle
- )
-{
- EFI_STATUS Status;
- //
- // ASSERT if FileHandle is NULL
- //
- ASSERT (FileHandle != NULL);
- //
- // Perform the Delete based on EFI_FILE_PROTOCOL
- //
- Status = FileHandle->Delete(FileHandle);
- return Status;
-}
-
-/**
- Set the current position in a file.
-
- This function sets the current file position for the handle to the position
- supplied. With the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only
- absolute positioning is supported, and seeking past the end of the file is
- allowed (a subsequent write would grow the file). Seeking to position
- 0xFFFFFFFFFFFFFFFF causes the current position to be set to the end of the file.
- If FileHandle is a directory, the only position that may be set is zero. This
- has the effect of starting the read process of the directory entries over.
-
- @param FileHandle The file handle on which the position is being set
- @param Position Byte position from begining of file
-
- @retval EFI_SUCCESS Operation completed sucessfully.
- @retval EFI_UNSUPPORTED the seek request for non-zero is not valid on
- directories.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleSetPosition (
- IN EFI_FILE_HANDLE FileHandle,
- IN UINT64 Position
- )
-{
- //
- // ASSERT if FileHandle is NULL
- //
- ASSERT (FileHandle != NULL);
- //
- // Perform the SetPosition based on EFI_FILE_PROTOCOL
- //
- return (FileHandle->SetPosition(FileHandle, Position));
-}
-
-/**
- Gets a file's current position
-
- This function retrieves the current file position for the file handle. For
- directories, the current file position has no meaning outside of the file
- system driver and as such the operation is not supported. An error is returned
- if FileHandle is a directory.
-
- @param FileHandle The open file handle on which to get the position.
- @param Position Byte position from begining of file.
-
- @retval EFI_SUCCESS the operation completed sucessfully.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED the request is not valid on directories.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleGetPosition (
- IN EFI_FILE_HANDLE FileHandle,
- OUT UINT64 *Position
- )
-{
- if (Position == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- //
- // ASSERT if FileHandle is NULL
- //
- ASSERT (FileHandle != NULL);
- //
- // Perform the GetPosition based on EFI_FILE_PROTOCOL
- //
- return (FileHandle->GetPosition(FileHandle, Position));
-}
-/**
- Flushes data on a file
-
- This function flushes all modified data associated with a file to a device.
-
- @param FileHandle The file handle on which to flush data
-
- @retval EFI_SUCCESS The data was flushed.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened for read only.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleFlush (
- IN EFI_FILE_HANDLE FileHandle
- )
-{
- //
- // ASSERT if FileHandle is NULL
- //
- ASSERT (FileHandle != NULL);
- //
- // Perform the Flush based on EFI_FILE_PROTOCOL
- //
- return (FileHandle->Flush(FileHandle));
-}
-
-/**
- function to determine if a given handle is a directory handle
-
- if DirHandle is NULL then ASSERT()
-
- open the file information on the DirHandle and verify that the Attribute
- includes EFI_FILE_DIRECTORY bit set.
-
- @param DirHandle Handle to open file
-
- @retval EFI_SUCCESS DirHandle is a directory
- @retval EFI_INVALID_PARAMETER DirHandle did not have EFI_FILE_INFO available
- @retval EFI_NOT_FOUND DirHandle is not a directory
-**/
-EFI_STATUS
-EFIAPI
-FileHandleIsDirectory (
- IN EFI_FILE_HANDLE DirHandle
- )
-{
- EFI_FILE_INFO *DirInfo;
-
- //
- // ASSERT if DirHandle is NULL
- //
- ASSERT(DirHandle != NULL);
-
- //
- // get the file information for DirHandle
- //
- DirInfo = FileHandleGetInfo (DirHandle);
-
- //
- // Parse DirInfo
- //
- if (DirInfo == NULL) {
- //
- // We got nothing...
- //
- return (EFI_INVALID_PARAMETER);
- }
- if ((DirInfo->Attribute & EFI_FILE_DIRECTORY) == 0) {
- //
- // Attributes say this is not a directory
- //
- FreePool (DirInfo);
- return (EFI_NOT_FOUND);
- }
- //
- // all good...
- //
- FreePool (DirInfo);
- return (EFI_SUCCESS);
-}
-
-/** Retrieve first entry from a directory.
-
- This function takes an open directory handle and gets information from the
- first entry in the directory. A buffer is allocated to contain
- the information and a pointer to the buffer is returned in *Buffer. The
- caller can use FileHandleFindNextFile() to get subsequent directory entries.
-
- The buffer will be freed by FileHandleFindNextFile() when the last directory
- entry is read. Otherwise, the caller must free the buffer, using FreePool,
- when finished with it.
-
- @param[in] DirHandle The file handle of the directory to search.
- @param[out] Buffer The pointer to pointer to buffer for file's information.
-
- @retval EFI_SUCCESS Found the first file.
- @retval EFI_NOT_FOUND Cannot find the directory.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @return Others status of FileHandleGetInfo, FileHandleSetPosition,
- or FileHandleRead
-**/
-EFI_STATUS
-EFIAPI
-FileHandleFindFirstFile (
- IN EFI_FILE_HANDLE DirHandle,
- OUT EFI_FILE_INFO **Buffer
- )
-{
- EFI_STATUS Status;
- UINTN BufferSize;
-
- if (Buffer == NULL || DirHandle == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // verify that DirHandle is a directory
- //
- Status = FileHandleIsDirectory(DirHandle);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- //
- // Allocate a buffer sized to struct size + enough for the string at the end
- //
- BufferSize = FIND_XXXXX_FILE_BUFFER_SIZE;
- *Buffer = AllocateZeroPool(BufferSize);
- if (*Buffer == NULL){
- return (EFI_OUT_OF_RESOURCES);
- }
-
- //
- // reset to the begining of the directory
- //
- Status = FileHandleSetPosition(DirHandle, 0);
- if (EFI_ERROR(Status)) {
- FreePool(*Buffer);
- *Buffer = NULL;
- return (Status);
- }
-
- //
- // read in the info about the first file
- //
- Status = FileHandleRead (DirHandle, &BufferSize, *Buffer);
- ASSERT(Status != EFI_BUFFER_TOO_SMALL);
- if (EFI_ERROR(Status) || BufferSize == 0) {
- FreePool(*Buffer);
- *Buffer = NULL;
- if (BufferSize == 0) {
- return (EFI_NOT_FOUND);
- }
- return (Status);
- }
- return (EFI_SUCCESS);
-}
-
-/** Retrieve next entries from a directory.
-
- To use this function, the caller must first call the FileHandleFindFirstFile()
- function to get the first directory entry. Subsequent directory entries are
- retrieved by using the FileHandleFindNextFile() function. This function can
- be called several times to get each entry from the directory. If the call of
- FileHandleFindNextFile() retrieved the last directory entry, the next call of
- this function will set *NoFile to TRUE and free the buffer.
-
- @param[in] DirHandle The file handle of the directory.
- @param[out] Buffer The pointer to buffer for file's information.
- @param[out] NoFile The pointer to boolean when last file is found.
-
- @retval EFI_SUCCESS Found the next file, or reached last file
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleFindNextFile(
- IN EFI_FILE_HANDLE DirHandle,
- OUT EFI_FILE_INFO *Buffer,
- OUT BOOLEAN *NoFile
- )
-{
- EFI_STATUS Status;
- UINTN BufferSize;
-
- //
- // ASSERTs for DirHandle or Buffer or NoFile poitners being NULL
- //
- ASSERT (DirHandle != NULL);
- ASSERT (Buffer != NULL);
- ASSERT (NoFile != NULL);
-
- //
- // This BufferSize MUST stay equal to the originally allocated one in GetFirstFile
- //
- BufferSize = FIND_XXXXX_FILE_BUFFER_SIZE;
-
- //
- // read in the info about the next file
- //
- Status = FileHandleRead (DirHandle, &BufferSize, Buffer);
- ASSERT(Status != EFI_BUFFER_TOO_SMALL);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- //
- // If we read 0 bytes (but did not have erros) we already read in the last file.
- //
- if (BufferSize == 0) {
- FreePool(Buffer);
- *NoFile = TRUE;
- }
-
- return (EFI_SUCCESS);
-}
-
-/**
- Retrieve the size of a file.
-
- if FileHandle is NULL then ASSERT()
- if Size is NULL then ASSERT()
-
- This function extracts the file size info from the FileHandle's EFI_FILE_INFO
- data.
-
- @param FileHandle file handle from which size is retrieved
- @param Size pointer to size
-
- @retval EFI_SUCCESS operation was completed sucessfully
- @retval EFI_DEVICE_ERROR cannot access the file
-**/
-EFI_STATUS
-EFIAPI
-FileHandleGetSize (
- IN EFI_FILE_HANDLE FileHandle,
- OUT UINT64 *Size
- )
-{
- EFI_FILE_INFO *FileInfo;
-
- //
- // ASSERT for FileHandle or Size being NULL
- //
- ASSERT (FileHandle != NULL);
- ASSERT (Size != NULL);
-
- //
- // get the FileInfo structure
- //
- FileInfo = FileHandleGetInfo(FileHandle);
- if (FileInfo == NULL) {
- return (EFI_DEVICE_ERROR);
- }
-
- //
- // Assign the Size pointer to the correct value
- //
- *Size = FileInfo->FileSize;
-
- //
- // free the FileInfo memory
- //
- FreePool(FileInfo);
-
- return (EFI_SUCCESS);
-}
-
-/**
- Set the size of a file.
-
- If FileHandle is NULL then ASSERT().
-
- This function changes the file size info from the FileHandle's EFI_FILE_INFO
- data.
-
- @param FileHandle File handle whose size is to be changed.
- @param Size New size.
-
- @retval EFI_SUCCESS operation was completed sucessfully.
- @retval EFI_DEVICE_ERROR cannot access the file.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleSetSize (
- IN EFI_FILE_HANDLE FileHandle,
- IN UINT64 Size
- )
-{
- EFI_FILE_INFO *FileInfo;
- EFI_STATUS Status;
-
- //
- // ASSERT for FileHandle or Size being NULL
- //
- ASSERT (FileHandle != NULL);
-
- //
- // get the FileInfo structure
- //
- FileInfo = FileHandleGetInfo(FileHandle);
- if (FileInfo == NULL) {
- return (EFI_DEVICE_ERROR);
- }
-
- //
- // Assign the FileSize pointer to the new value
- //
- FileInfo->FileSize = Size;
-
- Status = FileHandleSetInfo(FileHandle, FileInfo);
- //
- // free the FileInfo memory
- //
- FreePool(FileInfo);
-
- return (Status);
-}
-
-/**
- Safely append (on the left) with automatic string resizing given length of Destination and
- desired length of copy from Source.
-
- append the first D characters of Source to the end of Destination, where D is
- the lesser of Count and the StrLen() of Source. If appending those D characters
- will fit within Destination (whose Size is given as CurrentSize) and
- still leave room for a NULL terminator, then those characters are appended,
- starting at the original terminating NULL of Destination, and a new terminating
- NULL is appended.
-
- If appending D characters onto Destination will result in a overflow of the size
- given in CurrentSize the string will be grown such that the copy can be performed
- and CurrentSize will be updated to the new size.
-
- If Source is NULL, there is nothing to append, just return the current buffer in
- Destination.
-
- if Destination is NULL, then ASSERT()
- if Destination's current length (including NULL terminator) is already more then
- CurrentSize, then ASSERT()
-
- @param[in, out] Destination The String to append onto
- @param[in, out] CurrentSize on call the number of bytes in Destination. On
- return possibly the new size (still in bytes). if NULL
- then allocate whatever is needed.
- @param[in] Source The String to append from
- @param[in] Count Maximum number of characters to append. if 0 then
- all are appended.
-
- @return Destination return the resultant string.
-**/
-CHAR16*
-EFIAPI
-StrnCatGrowLeft (
- IN OUT CHAR16 **Destination,
- IN OUT UINTN *CurrentSize,
- IN CONST CHAR16 *Source,
- IN UINTN Count
- )
-{
- UINTN DestinationStartSize;
- UINTN NewSize;
- UINTN CopySize;
-
- //
- // ASSERTs
- //
- ASSERT(Destination != NULL);
-
- //
- // If there's nothing to do then just return Destination
- //
- if (Source == NULL) {
- return (*Destination);
- }
-
- //
- // allow for NULL pointers address as Destination
- //
- if (*Destination != NULL) {
- ASSERT(CurrentSize != 0);
- DestinationStartSize = StrSize(*Destination);
- ASSERT(DestinationStartSize <= *CurrentSize);
- } else {
- DestinationStartSize = 0;
-// ASSERT(*CurrentSize == 0);
- }
-
- //
- // Append all of Source?
- //
- if (Count == 0) {
- Count = StrSize(Source);
- }
-
- //
- // Test and grow if required
- //
- if (CurrentSize != NULL) {
- NewSize = *CurrentSize;
- while (NewSize < (DestinationStartSize + Count)) {
- NewSize += 2 * Count;
- }
- *Destination = ReallocatePool(*CurrentSize, NewSize, *Destination);
- *CurrentSize = NewSize;
- } else {
- *Destination = AllocateZeroPool(Count+sizeof(CHAR16));
- }
- if (*Destination == NULL) {
- return NULL;
- }
-
- CopySize = StrSize(*Destination);
- CopyMem((*Destination)+((Count-2)/sizeof(CHAR16)), *Destination, CopySize);
- CopyMem(*Destination, Source, Count-2);
- return (*Destination);
-}
-
-/**
- Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the
- directory 'stack'.
-
- if Handle is NULL, return EFI_INVALID_PARAMETER
-
- @param[in] Handle Handle to the Directory or File to create path to.
- @param[out] FullFileName pointer to pointer to generated full file name. It
- is the responsibility of the caller to free this memory
- with a call to FreePool().
- @retval EFI_SUCCESS the operation was sucessful and the FullFileName is valid.
- @retval EFI_INVALID_PARAMETER Handle was NULL.
- @retval EFI_INVALID_PARAMETER FullFileName was NULL.
- @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileHandleGetFileName (
- IN CONST EFI_FILE_HANDLE Handle,
- OUT CHAR16 **FullFileName
- )
-{
- EFI_STATUS Status;
- UINTN Size;
- EFI_FILE_HANDLE CurrentHandle;
- EFI_FILE_HANDLE NextHigherHandle;
- EFI_FILE_INFO *FileInfo;
-
- Size = 0;
-
- //
- // Check our parameters
- //
- if (FullFileName == NULL || Handle == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- *FullFileName = NULL;
- CurrentHandle = NULL;
-
- Status = Handle->Open(Handle, &CurrentHandle, L".", EFI_FILE_MODE_READ, 0);
- if (!EFI_ERROR(Status)) {
- //
- // Reverse out the current directory on the device
- //
- for (;;) {
- FileInfo = FileHandleGetInfo(CurrentHandle);
- if (FileInfo == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- break;
- } else {
- //
- // We got info... do we have a name? if yes preceed the current path with it...
- //
- if (StrLen (FileInfo->FileName) == 0) {
- if (*FullFileName == NULL) {
- ASSERT((*FullFileName == NULL && Size == 0) || (*FullFileName != NULL));
- *FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"\\", 0);
- }
- FreePool(FileInfo);
- break;
- } else {
- if (*FullFileName == NULL) {
- ASSERT((*FullFileName == NULL && Size == 0) || (*FullFileName != NULL));
- *FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"\\", 0);
- }
- ASSERT((*FullFileName == NULL && Size == 0) || (*FullFileName != NULL));
- *FullFileName = StrnCatGrowLeft(FullFileName, &Size, FileInfo->FileName, 0);
- *FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"\\", 0);
- FreePool(FileInfo);
- }
- }
- //
- // Move to the parent directory
- //
- Status = CurrentHandle->Open (CurrentHandle, &NextHigherHandle, L"..", EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR (Status)) {
- break;
- }
-
- FileHandleClose(CurrentHandle);
- CurrentHandle = NextHigherHandle;
- }
- } else if (Status == EFI_NOT_FOUND) {
- Status = EFI_SUCCESS;
- ASSERT((*FullFileName == NULL && Size == 0) || (*FullFileName != NULL));
- *FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"\\", 0);
- }
-
- if (CurrentHandle != NULL) {
- CurrentHandle->Close (CurrentHandle);
- }
-
- if (EFI_ERROR(Status) && *FullFileName != NULL) {
- FreePool(*FullFileName);
- }
-
- return (Status);
-}
-
-/**
- Function to read a single line from a file. The \n is not included in the returned
- buffer. The returned buffer must be callee freed.
-
- If the position upon start is 0, then the Ascii Boolean will be set. This should be
- maintained and not changed for all operations with the same file.
-
- @param[in] Handle FileHandle to read from.
- @param[in, out] Ascii Boolean value for indicating whether the file is Ascii (TRUE) or UCS2 (FALSE);
-
- @return The line of text from the file.
-
- @sa FileHandleReadLine
-**/
-CHAR16*
-EFIAPI
-FileHandleReturnLine(
- IN EFI_FILE_HANDLE Handle,
- IN OUT BOOLEAN *Ascii
- )
-{
- CHAR16 *RetVal;
- UINTN Size;
- EFI_STATUS Status;
-
- Size = 0;
- RetVal = NULL;
-
- Status = FileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- RetVal = AllocateZeroPool(Size);
- Status = FileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);
- }
- ASSERT_EFI_ERROR(Status);
- if (EFI_ERROR(Status) && (RetVal != NULL)) {
- FreePool(RetVal);
- RetVal = NULL;
- }
- return (RetVal);
-}
-
-/**
- Function to read a single line (up to but not including the \n) from a EFI_FILE_HANDLE.
-
- If the position upon start is 0, then the Ascii Boolean will be set. This should be
- maintained and not changed for all operations with the same file.
-
- @param[in] Handle FileHandle to read from
- @param[in, out] Buffer pointer to buffer to read into
- @param[in, out] Size pointer to number of bytes in buffer
- @param[in] Truncate if TRUE then allows for truncation of the line to fit.
- if FALSE will reset the position to the begining of the
- line if the buffer is not large enough.
- @param[in, out] Ascii Boolean value for indicating whether the file is Ascii (TRUE) or UCS2 (FALSE);
-
- @retval EFI_SUCCESS the operation was sucessful. the line is stored in
- Buffer.
- @retval EFI_INVALID_PARAMETER Handle was NULL.
- @retval EFI_INVALID_PARAMETER Size was NULL.
- @retval EFI_BUFFER_TOO_SMALL Size was not enough space to store the line.
- Size was updated to minimum space required.
- @sa FileHandleRead
-**/
-EFI_STATUS
-EFIAPI
-FileHandleReadLine(
- IN EFI_FILE_HANDLE Handle,
- IN OUT CHAR16 *Buffer,
- IN OUT UINTN *Size,
- IN BOOLEAN Truncate,
- IN OUT BOOLEAN *Ascii
- )
-{
- EFI_STATUS Status;
- CHAR16 CharBuffer;
- UINTN CharSize;
- UINTN CountSoFar;
- UINT64 OriginalFilePosition;
-
-
- if (Handle == NULL
- ||Size == NULL
- ){
- return (EFI_INVALID_PARAMETER);
- }
- if (Buffer == NULL) {
- ASSERT(*Size == 0);
- } else {
- *Buffer = CHAR_NULL;
- }
- FileHandleGetPosition(Handle, &OriginalFilePosition);
- if (OriginalFilePosition == 0) {
- CharSize = sizeof(CHAR16);
- Status = FileHandleRead(Handle, &CharSize, &CharBuffer);
- ASSERT_EFI_ERROR(Status);
- if (CharBuffer == gUnicodeFileTag) {
- *Ascii = FALSE;
- } else {
- *Ascii = TRUE;
- FileHandleSetPosition(Handle, OriginalFilePosition);
- }
- }
-
- for (CountSoFar = 0;;CountSoFar++){
- CharBuffer = 0;
- if (*Ascii) {
- CharSize = sizeof(CHAR8);
- } else {
- CharSize = sizeof(CHAR16);
- }
- Status = FileHandleRead(Handle, &CharSize, &CharBuffer);
- if ( EFI_ERROR(Status)
- || CharSize == 0
- || (CharBuffer == L'\n' && !(*Ascii))
- || (CharBuffer == '\n' && *Ascii)
- ){
- break;
- }
- //
- // if we have space save it...
- //
- if ((CountSoFar+1)*sizeof(CHAR16) < *Size){
- ASSERT(Buffer != NULL);
- ((CHAR16*)Buffer)[CountSoFar] = CharBuffer;
- ((CHAR16*)Buffer)[CountSoFar+1] = CHAR_NULL;
- }
- }
-
- //
- // if we ran out of space tell when...
- //
- if ((CountSoFar+1)*sizeof(CHAR16) > *Size){
- *Size = (CountSoFar+1)*sizeof(CHAR16);
- if (!Truncate) {
- FileHandleSetPosition(Handle, OriginalFilePosition);
- } else {
- DEBUG((DEBUG_WARN, "The line was truncated in FileHandleReadLine"));
- }
- return (EFI_BUFFER_TOO_SMALL);
- }
- while(Buffer[StrLen(Buffer)-1] == L'\r') {
- Buffer[StrLen(Buffer)-1] = CHAR_NULL;
- }
-
- return (Status);
-}
-
-/**
- function to write a line of unicode text to a file.
-
- if Handle is NULL, ASSERT.
- if Buffer is NULL, do nothing. (return SUCCESS)
-
- @param[in] Handle FileHandle to write to
- @param[in] Buffer Buffer to write
-
- @retval EFI_SUCCESS the data was written.
- @retval other failure.
-
- @sa FileHandleWrite
-**/
-EFI_STATUS
-EFIAPI
-FileHandleWriteLine(
- IN EFI_FILE_HANDLE Handle,
- IN CHAR16 *Buffer
- )
-{
- EFI_STATUS Status;
- UINTN Size;
-
- ASSERT(Handle != NULL);
-
- if (Buffer == NULL) {
- return (EFI_SUCCESS);
- }
-
- Size = StrSize(Buffer) - sizeof(Buffer[0]);
- Status = FileHandleWrite(Handle, &Size, Buffer);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
- Size = StrSize(L"\r\n") - sizeof(CHAR16);
- return FileHandleWrite(Handle, &Size, L"\r\n");
-}
-
-/**
- function to take a formatted argument and print it to a file.
-
- @param[in] Handle the file handle for the file to write to
- @param[in] Format the format argument (see printlib for format specifier)
- @param[in] ... the variable arguments for the format
-
- @retval EFI_SUCCESS the operation was sucessful
- @return other a return value from FileHandleWriteLine
-
- @sa FileHandleWriteLine
-**/
-EFI_STATUS
-EFIAPI
-FileHandlePrintLine(
- IN EFI_FILE_HANDLE Handle,
- IN CONST CHAR16 *Format,
- ...
- )
-{
- VA_LIST Marker;
- CHAR16 *Buffer;
- EFI_STATUS Status;
-
- //
- // Get a buffer to print into
- //
- Buffer = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
- ASSERT (Buffer != NULL);
-
- //
- // Print into our buffer
- //
- VA_START (Marker, Format);
- UnicodeVSPrint (Buffer, PcdGet16 (PcdShellPrintBufferSize), Format, Marker);
- VA_END (Marker);
-
- //
- // Print buffer into file
- //
- Status = FileHandleWriteLine(Handle, Buffer);
-
- //
- // Cleanup and return
- //
- FreePool(Buffer);
- return (Status);
-}
-
-/**
- Function to determine if a FILE_HANDLE is at the end of the file.
-
- This will NOT work on directories.
-
- If Handle is NULL, then ASSERT.
-
- @param[in] Handle the file handle
-
- @retval TRUE the position is at the end of the file
- @retval FALSE the position is not at the end of the file
-**/
-BOOLEAN
-EFIAPI
-FileHandleEof(
- IN EFI_FILE_HANDLE Handle
- )
-{
- EFI_FILE_INFO *Info;
- UINT64 Pos;
- BOOLEAN RetVal;
-
- //
- // ASSERT if Handle is NULL
- //
- ASSERT(Handle != NULL);
-
- FileHandleGetPosition(Handle, &Pos);
- Info = FileHandleGetInfo (Handle);
- ASSERT(Info != NULL);
- FileHandleSetPosition(Handle, Pos);
-
- if (Info == NULL) {
- return (FALSE);
- }
-
- if (Pos == Info->FileSize) {
- RetVal = TRUE;
- } else {
- RetVal = FALSE;
- }
-
- FreePool (Info);
-
- return (RetVal);
-}
diff --git a/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf b/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
deleted file mode 100644
index dbeb6ba5f3..0000000000
--- a/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+++ /dev/null
@@ -1,50 +0,0 @@
-## @file
-# Provides interface to shell functionality for shell commands and applications.
-#
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = BaseFileHandleLib
- FILE_GUID = 9495D344-9D8A-41f3-8D17-E2FD238C4E71
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = FileHandleLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER
-
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- UefiFileHandleLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- PrintLib
- PcdLib
-
-[Protocols]
- gEfiSimpleFileSystemProtocolGuid # ALWAYS_USED
-
-[Guids]
- gEfiFileInfoGuid # ALWAYS_CONSUMED
-
-[Pcd.common]
- gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize # ALWAYS_CONSUMED
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
deleted file mode 100644
index a5e523530f..0000000000
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ /dev/null
@@ -1,1721 +0,0 @@
-/** @file
- Provides interface to advanced shell functionality for parsing both handle and protocol database.
-
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiHandleParsingLib.h"
-#include "IndustryStandard/Acpi10.h"
-
-EFI_HANDLE mHandleParsingHiiHandle;
-HANDLE_INDEX_LIST mHandleList = {{{NULL,NULL},0,0},0};
-
-/**
- Constructor for the library.
-
- @param[in] ImageHandle Ignored.
- @param[in] SystemTable Ignored.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-HandleParsingLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- mHandleParsingHiiHandle = HiiAddPackages (&gHandleParsingHiiGuid, gImageHandle, UefiHandleParsingLibStrings, NULL);
- if (mHandleParsingHiiHandle == NULL) {
- return (EFI_DEVICE_ERROR);
- }
-
- return (EFI_SUCCESS);
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param[in] ImageHandle Ignored.
- @param[in] SystemTable Ignored.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-HandleParsingLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (mHandleParsingHiiHandle != NULL) {
- HiiRemovePackages(mHandleParsingHiiHandle);
- }
- return (EFI_SUCCESS);
-}
-
-/*
-CHAR16*
-EFIAPI
-LoadedImageProtocolDumpInformation(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST BOOLEAN Verbose
- )
-{
- EFI_LOADED_IMAGE_PROTOCOL *Image;
- EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- EFI_DEVICE_PATH_PROTOCOL *DevPathNode;
- VOID *Buffer;
- UINTN BufferSize;
- UINT32 AuthenticationStatus;
- EFI_GUID *NameGuid;
- EFI_FIRMWARE_VOLUME_PROTOCOL *FV;
- EFI_FIRMWARE_VOLUME2_PROTOCOL *FV2;
-
- FV = NULL;
- FV2 = NULL;
- Buffer = NULL;
- BufferSize = 0;
-
- Status = HandleProtocol (
- TheHandle,
- &gEfiLoadedImageProtocolGuid,
- &Image);
- ASSERT_EFI_ERROR(Status);
-
- DevPath = UnpackDevicePath (Image->FilePath);
-
- if (DevPath == NULL) {
- return NULL;
- }
-
- DevPathNode = DevPath;
-
- while (!IsDevicePathEnd (DevPathNode)) {
- //
- // Find the Fv File path
- //
- NameGuid = GetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)DevPathNode);
- if (NameGuid != NULL) {
- Status = BS->HandleProtocol (
- Image->DeviceHandle,
- &gEfiFirmwareVolumeProtocolGuid,
- &FV
- );
- if (!EFI_ERROR (Status)) {
- Status = FV->ReadSection (
- FV,
- NameGuid,
- EFI_SECTION_USER_INTERFACE,
- 0,
- &Buffer,
- &BufferSize,
- &AuthenticationStatus
- );
- if (!EFI_ERROR (Status)) {
- break;
- }
-
- Buffer = NULL;
- } else {
- Status = BS->HandleProtocol (
- Image->DeviceHandle,
- &gEfiFirmwareVolume2ProtocolGuid,
- &FV2
- );
- if (!EFI_ERROR (Status)) {
- Status = FV2->ReadSection (
- FV2,
- NameGuid,
- EFI_SECTION_USER_INTERFACE,
- 0,
- &Buffer,
- &BufferSize,
- &AuthenticationStatus
- );
- if (!EFI_ERROR (Status)) {
- break;
- }
-
- Buffer = NULL;
- }
- }
- }
- //
- // Next device path node
- //
- DevPathNode = NextDevicePathNode (DevPathNode);
- }
-
- FreePool (DevPath);
- return Buffer;
-}
-*/
-
-/**
- Function to dump information about PciRootBridgeIo.
-
- This will allocate the return buffer from boot services pool.
-
- @param[in] TheHandle The handle that has PciRootBridgeIo installed.
- @param[in] Verbose TRUE for additional information, FALSE otherwise.
-
- @retval A poitner to a string containing the information.
-**/
-CHAR16*
-EFIAPI
-PciRootBridgeIoDumpInformation(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST BOOLEAN Verbose
- )
-{
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
- EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Configuration;
- UINT64 Supports;
- UINT64 Attributes;
- CHAR16 *Temp;
- CHAR16 *Temp2;
- CHAR16 *RetVal;
- EFI_STATUS Status;
-
- RetVal = NULL;
-
- if (!Verbose) {
- return (CatSPrint(NULL, L"PciRootBridgeIo"));
- }
-
- Status = gBS->HandleProtocol(
- TheHandle,
- &gEfiPciRootBridgeIoProtocolGuid,
- (VOID**)&PciRootBridgeIo);
-
- if (EFI_ERROR(Status)) {
- return NULL;
- }
-
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_PH), NULL);
- ASSERT (Temp != NULL);
- Temp2 = CatSPrint(L"\r\n", Temp, PciRootBridgeIo->ParentHandle);
- FreePool(Temp);
- RetVal = Temp2;
- Temp2 = NULL;
-
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_SEG), NULL);
- ASSERT (Temp != NULL);
- Temp2 = CatSPrint(RetVal, Temp, PciRootBridgeIo->SegmentNumber);
- FreePool(Temp);
- FreePool(RetVal);
- RetVal = Temp2;
- Temp2 = NULL;
-
- Supports = 0;
- Attributes = 0;
- Status = PciRootBridgeIo->GetAttributes (PciRootBridgeIo, &Supports, &Attributes);
- if (!EFI_ERROR(Status)) {
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_ATT), NULL);
- ASSERT (Temp != NULL);
- Temp2 = CatSPrint(RetVal, Temp, Attributes);
- FreePool(Temp);
- FreePool(RetVal);
- RetVal = Temp2;
- Temp2 = NULL;
-
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_SUPPORTS), NULL);
- ASSERT (Temp != NULL);
- Temp2 = CatSPrint(RetVal, Temp, Supports);
- FreePool(Temp);
- FreePool(RetVal);
- RetVal = Temp2;
- Temp2 = NULL;
- }
-
- Configuration = NULL;
- Status = PciRootBridgeIo->Configuration (PciRootBridgeIo, (VOID **) &Configuration);
- if (!EFI_ERROR(Status) && Configuration != NULL) {
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_TITLE), NULL);
- ASSERT (Temp != NULL);
- Temp2 = CatSPrint(RetVal, Temp, Supports);
- FreePool(Temp);
- FreePool(RetVal);
- RetVal = Temp2;
- Temp2 = NULL;
- while (Configuration->Desc == ACPI_ADDRESS_SPACE_DESCRIPTOR) {
- Temp = NULL;
- switch (Configuration->ResType) {
- case ACPI_ADDRESS_SPACE_TYPE_MEM:
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_MEM), NULL);
- break;
- case ACPI_ADDRESS_SPACE_TYPE_IO:
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_IO), NULL);
- break;
- case ACPI_ADDRESS_SPACE_TYPE_BUS:
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_PCIRB_DUMP_BUS), NULL);
- break;
- }
- if (Temp != NULL) {
- Temp2 = CatSPrint(RetVal, L"%s", Temp);
- FreePool(Temp);
- FreePool(RetVal);
- RetVal = Temp2;
- Temp2 = NULL;
- }
-
- Temp2 = CatSPrint(RetVal,
- L"%H%02x %016lx %016lx %02x%N\r\n",
- Configuration->SpecificFlag,
- Configuration->AddrRangeMin,
- Configuration->AddrRangeMax,
- Configuration->AddrSpaceGranularity
- );
- FreePool(RetVal);
- RetVal = Temp2;
- Temp2 = NULL;
- Configuration++;
- }
- }
- return (RetVal);
-}
-
-/**
- Function to dump information about SimpleTextOut.
-
- This will allocate the return buffer from boot services pool.
-
- @param[in] TheHandle The handle that has SimpleTextOut installed.
- @param[in] Verbose TRUE for additional information, FALSE otherwise.
-
- @retval A poitner to a string containing the information.
-**/
-CHAR16*
-EFIAPI
-TxtOutProtocolDumpInformation(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST BOOLEAN Verbose
- )
-{
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Dev;
- INTN Index;
- UINTN Col;
- UINTN Row;
- EFI_STATUS Status;
- CHAR16 *RetVal;
- UINTN Size;
- CHAR16 *Temp;
- UINTN NewSize;
-
- if (!Verbose) {
- return (NULL);
- }
-
- RetVal = NULL;
- Size = 0;
-
- Status = gBS->HandleProtocol(
- TheHandle,
- &gEfiSimpleTextOutProtocolGuid,
- (VOID**)&Dev);
-
- ASSERT_EFI_ERROR(Status);
- ASSERT (Dev != NULL && Dev->Mode != NULL);
-
- Size = (Dev->Mode->MaxMode + 1) * 80;
- RetVal = AllocateZeroPool(Size);
-
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_TXT_OUT_DUMP_HEADER), NULL);
- if (Temp != NULL) {
- UnicodeSPrint(RetVal, Size, Temp, Dev, Dev->Mode->Attribute);
- FreePool(Temp);
- }
-
- //
- // Dump TextOut Info
- //
- Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_TXT_OUT_DUMP_LINE), NULL);
- for (Index = 0; Index < Dev->Mode->MaxMode; Index++) {
- Status = Dev->QueryMode (Dev, Index, &Col, &Row);
- NewSize = Size - StrSize(RetVal);
- UnicodeSPrint(
- RetVal + StrLen(RetVal),
- NewSize,
- Temp == NULL?L"":Temp,
- Index == Dev->Mode->Mode ? L'*' : L' ',
- Index,
- !EFI_ERROR(Status)?Col:-1,
- !EFI_ERROR(Status)?Row:-1
- );
- }
- FreePool(Temp);
- return (RetVal);
-}
-
-STATIC CONST UINTN VersionStringSize = 60;
-
-/**
- Function to dump information about EfiDriverSupportedEfiVersion protocol.
-
- This will allocate the return buffer from boot services pool.
-
- @param[in] TheHandle The handle that has the protocol installed.
- @param[in] Verbose TRUE for additional information, FALSE otherwise.
-
- @retval A poitner to a string containing the information.
-**/
-CHAR16*
-EFIAPI
-DriverEfiVersionProtocolDumpInformation(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST BOOLEAN Verbose
- )
-{
- EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL *DriverEfiVersion;
- EFI_STATUS Status;
- CHAR16 *RetVal;
-
- Status = gBS->HandleProtocol(
- TheHandle,
- &gEfiDriverSupportedEfiVersionProtocolGuid,
- (VOID**)&DriverEfiVersion);
-
- ASSERT_EFI_ERROR(Status);
-
- RetVal = AllocateZeroPool(VersionStringSize);
- ASSERT(RetVal != NULL);
- UnicodeSPrint(RetVal, VersionStringSize, L"0x%08x", DriverEfiVersion->FirmwareVersion);
- return (RetVal);
-}
-
-/**
- Function to dump information about DevicePath protocol.
-
- This will allocate the return buffer from boot services pool.
-
- @param[in] TheHandle The handle that has the protocol installed.
- @param[in] Verbose TRUE for additional information, FALSE otherwise.
-
- @retval A poitner to a string containing the information.
-**/
-CHAR16*
-EFIAPI
-DevicePathProtocolDumpInformation(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST BOOLEAN Verbose
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- CHAR16 *Temp;
- CHAR16 *Temp2;
- EFI_STATUS Status;
- Temp = NULL;
-
- Status = gBS->OpenProtocol(TheHandle, &gEfiDevicePathProtocolGuid, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!EFI_ERROR(Status)) {
- //
- // I cannot decide whether to allow shortcuts here (the second BOOLEAN on the next line)
- //
- Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE);
- gBS->CloseProtocol(TheHandle, &gEfiDevicePathProtocolGuid, gImageHandle, NULL);
- }
- if (!Verbose && Temp != NULL && StrLen(Temp) > 30) {
- Temp2 = NULL;
- Temp2 = StrnCatGrow(&Temp2, NULL, Temp+(StrLen(Temp) - 30), 30);
- FreePool(Temp);
- Temp = Temp2;
- }
- return (Temp);
-}
-
-//
-// Put the information on the NT32 protocol GUIDs here so we are not dependant on the Nt32Pkg
-//
-#define LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID \
- { \
- 0x58c518b1, 0x76f3, 0x11d4, 0xbc, 0xea, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 \
- }
-
-#define LOCAL_EFI_WIN_NT_BUS_DRIVER_IO_PROTOCOL_GUID \
- { \
- 0x96eb4ad6, 0xa32a, 0x11d4, 0xbc, 0xfd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 \
- }
-
-#define LOCAL_EFI_WIN_NT_SERIAL_PORT_GUID \
- { \
- 0xc95a93d, 0xa006, 0x11d4, 0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 \
- }
-STATIC CONST EFI_GUID WinNtThunkProtocolGuid = LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID;
-STATIC CONST EFI_GUID WinNtIoProtocolGuid = LOCAL_EFI_WIN_NT_BUS_DRIVER_IO_PROTOCOL_GUID;
-STATIC CONST EFI_GUID WinNtSerialPortGuid = LOCAL_EFI_WIN_NT_SERIAL_PORT_GUID;
-
-STATIC CONST GUID_INFO_BLOCK mGuidStringListNT[] = {
- {STRING_TOKEN(STR_WINNT_THUNK), (EFI_GUID*)&WinNtThunkProtocolGuid, NULL},
- {STRING_TOKEN(STR_WINNT_DRIVER_IO), (EFI_GUID*)&WinNtIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_WINNT_SERIAL_PORT), (EFI_GUID*)&WinNtSerialPortGuid, NULL},
- {STRING_TOKEN(STR_UNKNOWN_DEVICE), NULL, NULL},
-};
-
-STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
- {STRING_TOKEN(STR_LOADED_IMAGE), &gEfiLoadedImageProtocolGuid, NULL},
- {STRING_TOKEN(STR_DEVICE_PATH), &gEfiDevicePathProtocolGuid, DevicePathProtocolDumpInformation},
- {STRING_TOKEN(STR_IMAGE_PATH), &gEfiLoadedImageDevicePathProtocolGuid, DevicePathProtocolDumpInformation},
- {STRING_TOKEN(STR_DEVICE_PATH_UTIL), &gEfiDevicePathUtilitiesProtocolGuid, NULL},
- {STRING_TOKEN(STR_DEVICE_PATH_TXT), &gEfiDevicePathToTextProtocolGuid, NULL},
- {STRING_TOKEN(STR_DEVICE_PATH_FTXT), &gEfiDevicePathFromTextProtocolGuid, NULL},
- {STRING_TOKEN(STR_DEVICE_PATH_PC), &gEfiPcAnsiGuid, NULL},
- {STRING_TOKEN(STR_DEVICE_PATH_VT100), &gEfiVT100Guid, NULL},
- {STRING_TOKEN(STR_DEVICE_PATH_VT100P), &gEfiVT100PlusGuid, NULL},
- {STRING_TOKEN(STR_DEVICE_PATH_VTUTF8), &gEfiVTUTF8Guid, NULL},
- {STRING_TOKEN(STR_DRIVER_BINDING), &gEfiDriverBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_PLATFORM_OVERRIDE), &gEfiPlatformDriverOverrideProtocolGuid, NULL},
- {STRING_TOKEN(STR_BUS_OVERRIDE), &gEfiBusSpecificDriverOverrideProtocolGuid, NULL},
- {STRING_TOKEN(STR_DRIVER_DIAG), &gEfiDriverDiagnosticsProtocolGuid, NULL},
- {STRING_TOKEN(STR_DRIVER_DIAG2), &gEfiDriverDiagnostics2ProtocolGuid, NULL},
- {STRING_TOKEN(STR_DRIVER_CN), &gEfiComponentNameProtocolGuid, NULL},
- {STRING_TOKEN(STR_DRIVER_CN2), &gEfiComponentName2ProtocolGuid, NULL},
- {STRING_TOKEN(STR_PLAT_DRV_CFG), &gEfiPlatformToDriverConfigurationProtocolGuid, NULL},
- {STRING_TOKEN(STR_DRIVER_VERSION), &gEfiDriverSupportedEfiVersionProtocolGuid, DriverEfiVersionProtocolDumpInformation},
- {STRING_TOKEN(STR_TXT_IN), &gEfiSimpleTextInProtocolGuid, NULL},
- {STRING_TOKEN(STR_TXT_IN_EX), &gEfiSimpleTextInputExProtocolGuid, NULL},
- {STRING_TOKEN(STR_TXT_OUT), &gEfiSimpleTextOutProtocolGuid, TxtOutProtocolDumpInformation},
- {STRING_TOKEN(STR_SIM_POINTER), &gEfiSimplePointerProtocolGuid, NULL},
- {STRING_TOKEN(STR_ABS_POINTER), &gEfiAbsolutePointerProtocolGuid, NULL},
- {STRING_TOKEN(STR_SERIAL_IO), &gEfiSerialIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_GRAPHICS_OUTPUT), &gEfiGraphicsOutputProtocolGuid, NULL},
- {STRING_TOKEN(STR_EDID_DISCOVERED), &gEfiEdidDiscoveredProtocolGuid, NULL},
- {STRING_TOKEN(STR_EDID_ACTIVE), &gEfiEdidActiveProtocolGuid, NULL},
- {STRING_TOKEN(STR_EDID_OVERRIDE), &gEfiEdidOverrideProtocolGuid, NULL},
- {STRING_TOKEN(STR_CON_IN), &gEfiConsoleInDeviceGuid, NULL},
- {STRING_TOKEN(STR_CON_OUT), &gEfiConsoleOutDeviceGuid, NULL},
- {STRING_TOKEN(STR_STD_ERR), &gEfiStandardErrorDeviceGuid, NULL},
- {STRING_TOKEN(STR_LOAD_FILE), &gEfiLoadFileProtocolGuid, NULL},
- {STRING_TOKEN(STR_LOAD_FILE2), &gEfiLoadFile2ProtocolGuid, NULL},
- {STRING_TOKEN(STR_SIMPLE_FILE_SYS), &gEfiSimpleFileSystemProtocolGuid, NULL},
- {STRING_TOKEN(STR_TAPE_IO), &gEfiTapeIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_DISK_IO), &gEfiDiskIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_BLK_IO), &gEfiBlockIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_UC), &gEfiUnicodeCollationProtocolGuid, NULL},
- {STRING_TOKEN(STR_UC2), &gEfiUnicodeCollation2ProtocolGuid, NULL},
- {STRING_TOKEN(STR_PCIRB_IO), &gEfiPciRootBridgeIoProtocolGuid, PciRootBridgeIoDumpInformation},
- {STRING_TOKEN(STR_PCI_IO), &gEfiPciIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_SCSI_PT), &gEfiScsiPassThruProtocolGuid, NULL},
- {STRING_TOKEN(STR_SCSI_IO), &gEfiScsiIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_SCSI_PT_EXT), &gEfiExtScsiPassThruProtocolGuid, NULL},
- {STRING_TOKEN(STR_ISCSI), &gEfiIScsiInitiatorNameProtocolGuid, NULL},
- {STRING_TOKEN(STR_USB_IO), &gEfiUsbIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_USB_HC), &gEfiUsbHcProtocolGuid, NULL},
- {STRING_TOKEN(STR_USB_HC2), &gEfiUsb2HcProtocolGuid, NULL},
- {STRING_TOKEN(STR_DEBUG_SUPPORT), &gEfiDebugSupportProtocolGuid, NULL},
- {STRING_TOKEN(STR_DEBUG_PORT), &gEfiDebugPortProtocolGuid, NULL},
- {STRING_TOKEN(STR_DECOMPRESS), &gEfiDecompressProtocolGuid, NULL},
- {STRING_TOKEN(STR_ACPI_TABLE), &gEfiAcpiTableProtocolGuid, NULL},
- {STRING_TOKEN(STR_EBC_INTERPRETER), &gEfiEbcProtocolGuid, NULL},
- {STRING_TOKEN(STR_SNP), &gEfiSimpleNetworkProtocolGuid, NULL},
- {STRING_TOKEN(STR_NII), &gEfiNetworkInterfaceIdentifierProtocolGuid, NULL},
- {STRING_TOKEN(STR_NII_31), &gEfiNetworkInterfaceIdentifierProtocolGuid_31, NULL},
- {STRING_TOKEN(STR_PXE_BC), &gEfiPxeBaseCodeProtocolGuid, NULL},
- {STRING_TOKEN(STR_PXE_CB), &gEfiPxeBaseCodeCallbackProtocolGuid, NULL},
- {STRING_TOKEN(STR_BIS), &gEfiBisProtocolGuid, NULL},
- {STRING_TOKEN(STR_MNP_SB), &gEfiManagedNetworkServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_MNP), &gEfiManagedNetworkProtocolGuid, NULL},
- {STRING_TOKEN(STR_ARP_SB), &gEfiArpServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_ARP), &gEfiArpProtocolGuid, NULL},
- {STRING_TOKEN(STR_DHCPV4_SB), &gEfiDhcp4ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_DHCPV4), &gEfiDhcp4ProtocolGuid, NULL},
- {STRING_TOKEN(STR_TCPV4_SB), &gEfiTcp4ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_TCPV4), &gEfiTcp4ProtocolGuid, NULL},
- {STRING_TOKEN(STR_IPV4_SB), &gEfiIp4ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_IPV4), &gEfiIp4ProtocolGuid, NULL},
- {STRING_TOKEN(STR_IPV4_CFG), &gEfiIp4ConfigProtocolGuid, NULL},
- {STRING_TOKEN(STR_SHELL_PARAMETERS), &gEfiShellParametersProtocolGuid, NULL},
- {STRING_TOKEN(STR_SHELL), &gEfiShellProtocolGuid, NULL},
- {STRING_TOKEN(STR_UDPV4_SB), &gEfiUdp4ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_UDPV4), &gEfiUdp4ProtocolGuid, NULL},
- {STRING_TOKEN(STR_MTFTPV4_SB), &gEfiMtftp4ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_MTFTPV4), &gEfiMtftp4ProtocolGuid, NULL},
- {STRING_TOKEN(STR_AUTH_INFO), &gEfiAuthenticationInfoProtocolGuid, NULL},
- {STRING_TOKEN(STR_HASH_SB), &gEfiHashServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_HASH), &gEfiHashProtocolGuid, NULL},
- {STRING_TOKEN(STR_HII_FONT), &gEfiHiiFontProtocolGuid, NULL},
- {STRING_TOKEN(STR_HII_STRING), &gEfiHiiStringProtocolGuid, NULL},
- {STRING_TOKEN(STR_HII_IMAGE), &gEfiHiiImageProtocolGuid, NULL},
- {STRING_TOKEN(STR_HII_DATABASE), &gEfiHiiDatabaseProtocolGuid, NULL},
- {STRING_TOKEN(STR_HII_CONFIG_ROUT), &gEfiHiiConfigRoutingProtocolGuid, NULL},
- {STRING_TOKEN(STR_HII_CONFIG_ACC), &gEfiHiiConfigAccessProtocolGuid, NULL},
- {STRING_TOKEN(STR_HII_FORM_BROWSER2), &gEfiFormBrowser2ProtocolGuid, NULL},
- {STRING_TOKEN(STR_DRIVER_FAM_OVERRIDE), &gEfiDriverFamilyOverrideProtocolGuid, NULL},
- {STRING_TOKEN(STR_PCD), &gPcdProtocolGuid, NULL},
- {STRING_TOKEN(STR_TCG), &gEfiTcgProtocolGuid, NULL},
- {STRING_TOKEN(STR_HII_PACKAGE_LIST), &gEfiHiiPackageListProtocolGuid, NULL},
-
-//
-// the ones under this are deprecated by the current UEFI Spec, but may be found anyways...
-//
- {STRING_TOKEN(STR_SHELL_INTERFACE), &gEfiShellInterfaceGuid, NULL},
- {STRING_TOKEN(STR_SHELL_ENV2), &gEfiShellEnvironment2Guid, NULL},
- {STRING_TOKEN(STR_SHELL_ENV), &gEfiShellEnvironment2Guid, NULL},
- {STRING_TOKEN(STR_DEVICE_IO), &gEfiDeviceIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_UGA_DRAW), &gEfiUgaDrawProtocolGuid, NULL},
- {STRING_TOKEN(STR_UGA_IO), &gEfiUgaIoProtocolGuid, NULL},
- {STRING_TOKEN(STR_ESP), &gEfiPartTypeSystemPartGuid, NULL},
- {STRING_TOKEN(STR_GPT_NBR), &gEfiPartTypeLegacyMbrGuid, NULL},
- {STRING_TOKEN(STR_DRIVER_CONFIG), &gEfiDriverConfigurationProtocolGuid, NULL},
- {STRING_TOKEN(STR_DRIVER_CONFIG2), &gEfiDriverConfiguration2ProtocolGuid, NULL},
-
-//
-// the ones under this are GUID identified structs, not protocols
-//
- {STRING_TOKEN(STR_FILE_INFO), &gEfiFileInfoGuid, NULL},
- {STRING_TOKEN(STR_FILE_SYS_INFO), &gEfiFileSystemInfoGuid, NULL},
-
-//
-// the ones under this are misc GUIDS.
-//
- {STRING_TOKEN(STR_EFI_GLOBAL_VARIABLE), &gEfiGlobalVariableGuid, NULL},
-
-//
-// UEFI 2.2
-//
- {STRING_TOKEN(STR_IP6_SB), &gEfiIp6ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_IP6), &gEfiIp6ProtocolGuid, NULL},
- {STRING_TOKEN(STR_IP6_CONFIG), &gEfiIp6ConfigProtocolGuid, NULL},
- {STRING_TOKEN(STR_MTFTP6_SB), &gEfiMtftp6ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_MTFTP6), &gEfiMtftp6ProtocolGuid, NULL},
- {STRING_TOKEN(STR_DHCP6_SB), &gEfiDhcp6ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_DHCP6), &gEfiDhcp6ProtocolGuid, NULL},
- {STRING_TOKEN(STR_UDP6_SB), &gEfiUdp6ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_UDP6), &gEfiUdp6ProtocolGuid, NULL},
- {STRING_TOKEN(STR_TCP6_SB), &gEfiTcp6ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_TCP6), &gEfiTcp6ProtocolGuid, NULL},
- {STRING_TOKEN(STR_VLAN_CONFIG), &gEfiVlanConfigProtocolGuid, NULL},
- {STRING_TOKEN(STR_EAP), &gEfiEapProtocolGuid, NULL},
- {STRING_TOKEN(STR_EAP_MGMT), &gEfiEapManagementProtocolGuid, NULL},
- {STRING_TOKEN(STR_FTP4_SB), &gEfiFtp4ServiceBindingProtocolGuid, NULL},
- {STRING_TOKEN(STR_FTP4), &gEfiFtp4ProtocolGuid, NULL},
- {STRING_TOKEN(STR_IP_SEC_CONFIG), &gEfiIpSecConfigProtocolGuid, NULL},
- {STRING_TOKEN(STR_DH), &gEfiDriverHealthProtocolGuid, NULL},
- {STRING_TOKEN(STR_DEF_IMG_LOAD), &gEfiDeferredImageLoadProtocolGuid, NULL},
- {STRING_TOKEN(STR_USER_CRED), &gEfiUserCredentialProtocolGuid, NULL},
- {STRING_TOKEN(STR_USER_MNGR), &gEfiUserManagerProtocolGuid, NULL},
- {STRING_TOKEN(STR_ATA_PASS_THRU), &gEfiAtaPassThruProtocolGuid, NULL},
-
-//
-// UEFI 2.3
-//
- {STRING_TOKEN(STR_FW_MGMT), &gEfiFirmwareManagementProtocolGuid, NULL},
- {STRING_TOKEN(STR_IP_SEC), &gEfiIpSecProtocolGuid, NULL},
- {STRING_TOKEN(STR_IP_SEC2), &gEfiIpSec2ProtocolGuid, NULL},
-
-//
-// UEFI 2.3.1
-//
- {STRING_TOKEN(STR_KMS), &gEfiKmsProtocolGuid, NULL},
- {STRING_TOKEN(STR_BLK_IO2), &gEfiBlockIo2ProtocolGuid, NULL},
- {STRING_TOKEN(STR_SSC), &gEfiStorageSecurityCommandProtocolGuid, NULL},
- {STRING_TOKEN(STR_UC2), &gEfiUserCredential2ProtocolGuid, NULL},
-
-//
-// terminator
-//
- {STRING_TOKEN(STR_UNKNOWN_DEVICE), NULL, NULL},
-};
-
-/**
- Function to get the node for a protocol or struct from it's GUID.
-
- if Guid is NULL, then ASSERT.
-
- @param[in] Guid The GUID to look for the name of.
-
- @return The node.
-**/
-CONST GUID_INFO_BLOCK *
-EFIAPI
-InternalShellGetNodeFromGuid(
- IN CONST EFI_GUID* Guid
- )
-{
- CONST GUID_INFO_BLOCK *ListWalker;
-
- ASSERT(Guid != NULL);
-
- if (PcdGetBool(PcdShellIncludeNtGuids)) {
- for (ListWalker = mGuidStringListNT ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) {
- if (CompareGuid(ListWalker->GuidId, Guid)) {
- return (ListWalker);
- }
- }
- }
- for (ListWalker = mGuidStringList ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) {
- if (CompareGuid(ListWalker->GuidId, Guid)) {
- return (ListWalker);
- }
- }
- return (ListWalker);
-}
-
-/**
- Function to get the name of a protocol or struct from it's GUID.
-
- if Guid is NULL, then ASSERT.
-
- @param[in] Guid The GUID to look for the name of.
- @param[in] Lang The language to use.
-
- @return pointer to string of the name. The caller
- is responsible to free this memory.
-**/
-CHAR16*
-EFIAPI
-GetStringNameFromGuid(
- IN CONST EFI_GUID *Guid,
- IN CONST CHAR8 *Lang OPTIONAL
- )
-{
- CONST GUID_INFO_BLOCK *Id;
-
- Id = InternalShellGetNodeFromGuid(Guid);
- return (HiiGetString(mHandleParsingHiiHandle, Id->StringId, Lang));
-}
-
-/**
- Function to dump protocol information from a handle.
-
- This function will return a allocated string buffer containing the
- information. The caller is responsible for freeing the memory.
-
- If Guid is NULL, ASSERT().
- If TheHandle is NULL, ASSERT().
-
- @param[in] TheHandle The handle to dump information from.
- @param[in] Guid The GUID of the protocol to dump.
- @param[in] Verbose TRUE for extra info. FALSE otherwise.
-
- @return The pointer to string.
- @retval NULL An error was encountered.
-**/
-CHAR16*
-EFIAPI
-GetProtocolInformationDump(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST EFI_GUID *Guid,
- IN CONST BOOLEAN Verbose
- )
-{
- CONST GUID_INFO_BLOCK *Id;
-
- ASSERT(TheHandle != NULL);
- ASSERT(Guid != NULL);
-
- if (TheHandle == NULL || Guid == NULL) {
- return (NULL);
- }
-
- Id = InternalShellGetNodeFromGuid(Guid);
- if (Id != NULL && Id->DumpInfo != NULL) {
- return (Id->DumpInfo(TheHandle, Verbose));
- }
- return (NULL);
-}
-
-/**
- Function to get the Guid for a protocol or struct based on it's string name.
-
- @param[in] Name The pointer to the string name.
- @param[in] Lang The pointer to the language code.
- @param[in] Guid The pointer to the Guid.
-
- @retval EFI_SUCCESS The operation was sucessful.
-**/
-EFI_STATUS
-EFIAPI
-GetGuidFromStringName(
- IN CONST CHAR16 *Name,
- IN CONST CHAR8 *Lang OPTIONAL,
- IN EFI_GUID **Guid
- )
-{
- CONST GUID_INFO_BLOCK *ListWalker;
- CHAR16 *String;
-
- ASSERT(Guid != NULL);
- if (Guid == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- *Guid = NULL;
-
- if (PcdGetBool(PcdShellIncludeNtGuids)) {
- for (ListWalker = mGuidStringListNT ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) {
- String = HiiGetString(mHandleParsingHiiHandle, ListWalker->StringId, Lang);
- if (Name != NULL && String != NULL && StrCmp(Name, String)==0) {
- *Guid = ListWalker->GuidId;
- }
- SHELL_FREE_NON_NULL(String);
- if (*Guid != NULL) {
- return (EFI_SUCCESS);
- }
- }
- }
- for (ListWalker = mGuidStringList ; ListWalker != NULL && ListWalker->GuidId != NULL ; ListWalker++) {
- String = HiiGetString(mHandleParsingHiiHandle, ListWalker->StringId, Lang);
- if (Name != NULL && String != NULL && StrCmp(Name, String)==0) {
- *Guid = ListWalker->GuidId;
- }
- SHELL_FREE_NON_NULL(String);
- if (*Guid != NULL) {
- return (EFI_SUCCESS);
- }
- }
- return (EFI_NOT_FOUND);
-}
-
-/**
- Function to retrieve the driver name (if possible) from the ComponentName or
- ComponentName2 protocol
-
- @param[in] TheHandle The driver handle to get the name of.
- @param[in] Language The language to use.
-
- @retval NULL The name could not be found.
- @return A pointer to the string name. Do not de-allocate the memory.
-**/
-CONST CHAR16*
-EFIAPI
-GetStringNameFromHandle(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST CHAR8 *Language
- )
-{
- EFI_COMPONENT_NAME2_PROTOCOL *CompNameStruct;
- EFI_STATUS Status;
- CHAR16 *RetVal;
-
- Status = gBS->OpenProtocol(
- TheHandle,
- &gEfiComponentName2ProtocolGuid,
- (VOID**)&CompNameStruct,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!EFI_ERROR(Status)) {
- Status = CompNameStruct->GetDriverName(CompNameStruct, (CHAR8*)Language, &RetVal);
- if (!EFI_ERROR(Status)) {
- return (RetVal);
- }
- }
- Status = gBS->OpenProtocol(
- TheHandle,
- &gEfiComponentNameProtocolGuid,
- (VOID**)&CompNameStruct,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!EFI_ERROR(Status)) {
- Status = CompNameStruct->GetDriverName(CompNameStruct, (CHAR8*)Language, &RetVal);
- if (!EFI_ERROR(Status)) {
- return (RetVal);
- }
- }
- return (NULL);
-}
-
-/**
- Function to initialize the file global mHandleList object for use in
- vonverting handles to index and index to handle.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-InternalShellInitHandleList(
- VOID
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *HandleBuffer;
- UINTN HandleCount;
- HANDLE_LIST *ListWalker;
-
- if (mHandleList.NextIndex != 0) {
- return EFI_SUCCESS;
- }
- InitializeListHead(&mHandleList.List.Link);
- mHandleList.NextIndex = 1;
- Status = gBS->LocateHandleBuffer (
- AllHandles,
- NULL,
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- ASSERT_EFI_ERROR(Status);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
- for (mHandleList.NextIndex = 1 ; mHandleList.NextIndex <= HandleCount ; mHandleList.NextIndex++){
- ListWalker = AllocateZeroPool(sizeof(HANDLE_LIST));
- ASSERT(ListWalker != NULL);
- ListWalker->TheHandle = HandleBuffer[mHandleList.NextIndex-1];
- ListWalker->TheIndex = mHandleList.NextIndex;
- InsertTailList(&mHandleList.List.Link,&ListWalker->Link);
- }
- FreePool(HandleBuffer);
- return (EFI_SUCCESS);
-}
-
-/**
- Function to retrieve the human-friendly index of a given handle. If the handle
- does not have a index one will be automatically assigned. The index value is valid
- until the termination of the shell application.
-
- @param[in] TheHandle The handle to retrieve an index for.
-
- @retval 0 A memory allocation failed.
- @return The index of the handle.
-
-**/
-UINTN
-EFIAPI
-ConvertHandleToHandleIndex(
- IN CONST EFI_HANDLE TheHandle
- )
-{
- EFI_STATUS Status;
- EFI_GUID **ProtocolBuffer;
- UINTN ProtocolCount;
- HANDLE_LIST *ListWalker;
-
- if (TheHandle == NULL) {
- return 0;
- }
-
- InternalShellInitHandleList();
-
- for (ListWalker = (HANDLE_LIST*)GetFirstNode(&mHandleList.List.Link)
- ; !IsNull(&mHandleList.List.Link,&ListWalker->Link)
- ; ListWalker = (HANDLE_LIST*)GetNextNode(&mHandleList.List.Link,&ListWalker->Link)
- ){
- if (ListWalker->TheHandle == TheHandle) {
- //
- // Verify that TheHandle is still present in the Handle Database
- //
- Status = gBS->ProtocolsPerHandle(TheHandle, &ProtocolBuffer, &ProtocolCount);
- if (EFI_ERROR (Status)) {
- //
- // TheHandle is not present in the Handle Database, so delete from the handle list
- //
- RemoveEntryList (&ListWalker->Link);
- return 0;
- }
- FreePool (ProtocolBuffer);
- return (ListWalker->TheIndex);
- }
- }
-
- //
- // Verify that TheHandle is valid handle
- //
- Status = gBS->ProtocolsPerHandle(TheHandle, &ProtocolBuffer, &ProtocolCount);
- if (EFI_ERROR (Status)) {
- //
- // TheHandle is not valid, so do not add to handle list
- //
- return 0;
- }
- FreePool (ProtocolBuffer);
-
- ListWalker = AllocateZeroPool(sizeof(HANDLE_LIST));
- ASSERT(ListWalker != NULL);
- ListWalker->TheHandle = TheHandle;
- ListWalker->TheIndex = mHandleList.NextIndex++;
- InsertTailList(&mHandleList.List.Link,&ListWalker->Link);
- return (ListWalker->TheIndex);
-}
-
-
-
-/**
- Function to retrieve the EFI_HANDLE from the human-friendly index.
-
- @param[in] TheIndex The index to retrieve the EFI_HANDLE for.
-
- @retval NULL The index was invalid.
- @return The EFI_HANDLE that index represents.
-
-**/
-EFI_HANDLE
-EFIAPI
-ConvertHandleIndexToHandle(
- IN CONST UINTN TheIndex
- )
-{
- EFI_STATUS Status;
- EFI_GUID **ProtocolBuffer;
- UINTN ProtocolCount;
- HANDLE_LIST *ListWalker;
-
- InternalShellInitHandleList();
-
- if (TheIndex >= mHandleList.NextIndex) {
- return NULL;
- }
-
- for (ListWalker = (HANDLE_LIST*)GetFirstNode(&mHandleList.List.Link)
- ; !IsNull(&mHandleList.List.Link,&ListWalker->Link)
- ; ListWalker = (HANDLE_LIST*)GetNextNode(&mHandleList.List.Link,&ListWalker->Link)
- ){
- if (ListWalker->TheIndex == TheIndex && ListWalker->TheHandle != NULL) {
- //
- // Verify that LinkWalker->TheHandle is valid handle
- //
- Status = gBS->ProtocolsPerHandle(ListWalker->TheHandle, &ProtocolBuffer, &ProtocolCount);
- if (EFI_ERROR (Status)) {
- //
- // TheHandle is not valid, so do not add to handle list
- //
- ListWalker->TheHandle = NULL;
- }
- return (ListWalker->TheHandle);
- }
- }
- return NULL;
-}
-
-/**
- Gets all the related EFI_HANDLEs based on the mask supplied.
-
- This function scans all EFI_HANDLES in the UEFI environment's handle database
- and returns the ones with the specified relationship (Mask) to the specified
- controller handle.
-
- If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT.
- If MatchingHandleCount is NULL, then ASSERT.
-
- If MatchingHandleBuffer is not NULL upon a successful return the memory must be
- caller freed.
-
- @param[in] DriverBindingHandle The handle with Driver Binding protocol on it.
- @param[in] ControllerHandle The handle with Device Path protocol on it.
- @param[in] MatchingHandleCount The pointer to UINTN that specifies the number of HANDLES in
- MatchingHandleBuffer.
- @param[out] MatchingHandleBuffer On a successful return, a buffer of MatchingHandleCount
- EFI_HANDLEs with a terminating NULL EFI_HANDLE.
- @param[out] HandleType An array of type information.
-
- @retval EFI_SUCCESS The operation was successful, and any related handles
- are in MatchingHandleBuffer.
- @retval EFI_NOT_FOUND No matching handles were found.
- @retval EFI_INVALID_PARAMETER A parameter was invalid or out of range.
-**/
-EFI_STATUS
-EFIAPI
-ParseHandleDatabaseByRelationshipWithType (
- IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL,
- IN CONST EFI_HANDLE ControllerHandle OPTIONAL,
- IN UINTN *HandleCount,
- OUT EFI_HANDLE **HandleBuffer,
- OUT UINTN **HandleType
- )
-{
- EFI_STATUS Status;
- UINTN HandleIndex;
- EFI_GUID **ProtocolGuidArray;
- UINTN ArrayCount;
- UINTN ProtocolIndex;
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo;
- UINTN OpenInfoCount;
- UINTN OpenInfoIndex;
- UINTN ChildIndex;
- INTN DriverBindingHandleIndex;
-
- ASSERT(HandleCount != NULL);
- ASSERT(HandleBuffer != NULL);
- ASSERT(HandleType != NULL);
- ASSERT(DriverBindingHandle != NULL || ControllerHandle != NULL);
-
- *HandleCount = 0;
- *HandleBuffer = NULL;
- *HandleType = NULL;
-
- //
- // Retrieve the list of all handles from the handle database
- //
- Status = gBS->LocateHandleBuffer (
- AllHandles,
- NULL,
- NULL,
- HandleCount,
- HandleBuffer
- );
- if (EFI_ERROR (Status)) {
- return (Status);
- }
-
- *HandleType = AllocateZeroPool (*HandleCount * sizeof (UINTN));
- ASSERT(*HandleType != NULL);
-
- DriverBindingHandleIndex = -1;
- for (HandleIndex = 0; HandleIndex < *HandleCount; HandleIndex++) {
- if (DriverBindingHandle != NULL && (*HandleBuffer)[HandleIndex] == DriverBindingHandle) {
- DriverBindingHandleIndex = (INTN)HandleIndex;
- }
- }
-
- for (HandleIndex = 0; HandleIndex < *HandleCount; HandleIndex++) {
- //
- // Retrieve the list of all the protocols on each handle
- //
- Status = gBS->ProtocolsPerHandle (
- (*HandleBuffer)[HandleIndex],
- &ProtocolGuidArray,
- &ArrayCount
- );
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) {
-
- //
- // Set the bit describing what this handle has
- //
- if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiLoadedImageProtocolGuid) ) {
- (*HandleType)[HandleIndex] |= HR_IMAGE_HANDLE;
- } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverBindingProtocolGuid) ) {
- (*HandleType)[HandleIndex] |= HR_DRIVER_BINDING_HANDLE;
- } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverConfiguration2ProtocolGuid)) {
- (*HandleType)[HandleIndex] |= HR_DRIVER_CONFIGURATION_HANDLE;
- } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverConfigurationProtocolGuid) ) {
- (*HandleType)[HandleIndex] |= HR_DRIVER_CONFIGURATION_HANDLE;
- } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverDiagnostics2ProtocolGuid) ) {
- (*HandleType)[HandleIndex] |= HR_DRIVER_DIAGNOSTICS_HANDLE;
- } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDriverDiagnosticsProtocolGuid) ) {
- (*HandleType)[HandleIndex] |= HR_DRIVER_DIAGNOSTICS_HANDLE;
- } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiComponentName2ProtocolGuid) ) {
- (*HandleType)[HandleIndex] |= HR_COMPONENT_NAME_HANDLE;
- } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiComponentNameProtocolGuid) ) {
- (*HandleType)[HandleIndex] |= HR_COMPONENT_NAME_HANDLE;
- } else if (CompareGuid (ProtocolGuidArray[ProtocolIndex], &gEfiDevicePathProtocolGuid) ) {
- (*HandleType)[HandleIndex] |= HR_DEVICE_HANDLE;
- } else {
- DEBUG_CODE_BEGIN();
- ASSERT((*HandleType)[HandleIndex] == (*HandleType)[HandleIndex]);
- DEBUG_CODE_END();
- }
- //
- // Retrieve the list of agents that have opened each protocol
- //
- Status = gBS->OpenProtocolInformation (
- (*HandleBuffer)[HandleIndex],
- ProtocolGuidArray[ProtocolIndex],
- &OpenInfo,
- &OpenInfoCount
- );
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- if (ControllerHandle == NULL) {
- //
- // ControllerHandle == NULL and DriverBindingHandle != NULL.
- // Return information on all the controller handles that the driver specified by DriverBindingHandle is managing
- //
- for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
- if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle && (OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
- (*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
- if (DriverBindingHandleIndex != -1) {
- (*HandleType)[DriverBindingHandleIndex] |= HR_DEVICE_DRIVER;
- }
- }
- if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle && (OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
- (*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
- if (DriverBindingHandleIndex != -1) {
- (*HandleType)[DriverBindingHandleIndex] |= (HR_BUS_DRIVER | HR_DEVICE_DRIVER);
- }
- for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
- if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) {
- (*HandleType)[ChildIndex] |= (HR_DEVICE_HANDLE | HR_CHILD_HANDLE);
- }
- }
- }
- }
- }
- if (DriverBindingHandle == NULL && ControllerHandle != NULL) {
- if (ControllerHandle == (*HandleBuffer)[HandleIndex]) {
- (*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
- for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
- if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
- for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
- if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) {
- (*HandleType)[ChildIndex] |= HR_DEVICE_DRIVER;
- }
- }
- }
- if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
- for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
- if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) {
- (*HandleType)[ChildIndex] |= (HR_BUS_DRIVER | HR_DEVICE_DRIVER);
- }
- if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) {
- (*HandleType)[ChildIndex] |= (HR_DEVICE_HANDLE | HR_CHILD_HANDLE);
- }
- }
- }
- }
- } else {
- for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
- if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
- if (OpenInfo[OpenInfoIndex].ControllerHandle == ControllerHandle) {
- (*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_PARENT_HANDLE);
- }
- }
- }
- }
- }
- if (DriverBindingHandle != NULL && ControllerHandle != NULL) {
- if (ControllerHandle == (*HandleBuffer)[HandleIndex]) {
- (*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_CONTROLLER_HANDLE);
- for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
- if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
- if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle) {
- if (DriverBindingHandleIndex != -1) {
- (*HandleType)[DriverBindingHandleIndex] |= HR_DEVICE_DRIVER;
- }
- }
- }
- if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
- if (OpenInfo[OpenInfoIndex].AgentHandle == DriverBindingHandle) {
- for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
- if (OpenInfo[OpenInfoIndex].ControllerHandle == (*HandleBuffer)[ChildIndex]) {
- (*HandleType)[ChildIndex] |= (HR_DEVICE_HANDLE | HR_CHILD_HANDLE);
- }
- }
- }
-
- for (ChildIndex = 0; ChildIndex < *HandleCount; ChildIndex++) {
- if (OpenInfo[OpenInfoIndex].AgentHandle == (*HandleBuffer)[ChildIndex]) {
- (*HandleType)[ChildIndex] |= (HR_BUS_DRIVER | HR_DEVICE_DRIVER);
- }
- }
- }
- }
- } else {
- for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
- if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
- if (OpenInfo[OpenInfoIndex].ControllerHandle == ControllerHandle) {
- (*HandleType)[HandleIndex] |= (HR_DEVICE_HANDLE | HR_PARENT_HANDLE);
- }
- }
- }
- }
- }
- FreePool (OpenInfo);
- }
- FreePool (ProtocolGuidArray);
- }
- return EFI_SUCCESS;
-}
-
-/**
- Gets all the related EFI_HANDLEs based on the single EFI_HANDLE and the mask
- supplied.
-
- This function will scan all EFI_HANDLES in the UEFI environment's handle database
- and return all the ones with the specified relationship (Mask) to the specified
- controller handle.
-
- If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT.
- If MatchingHandleCount is NULL, then ASSERT.
-
- If MatchingHandleBuffer is not NULL upon a sucessful return the memory must be
- caller freed.
-
- @param[in] DriverBindingHandle Handle to a object with Driver Binding protocol
- on it.
- @param[in] ControllerHandle Handle to a device with Device Path protocol on it.
- @param[in] Mask Mask of what relationship(s) is desired.
- @param[in] MatchingHandleCount Poitner to UINTN specifying number of HANDLES in
- MatchingHandleBuffer.
- @param[out] MatchingHandleBuffer On a sucessful return a buffer of MatchingHandleCount
- EFI_HANDLEs and a terminating NULL EFI_HANDLE.
-
- @retval EFI_SUCCESS The operation was sucessful and any related handles
- are in MatchingHandleBuffer;
- @retval EFI_NOT_FOUND No matching handles were found.
- @retval EFI_INVALID_PARAMETER A parameter was invalid or out of range.
-**/
-EFI_STATUS
-EFIAPI
-ParseHandleDatabaseByRelationship (
- IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL,
- IN CONST EFI_HANDLE ControllerHandle OPTIONAL,
- IN CONST UINTN Mask,
- IN UINTN *MatchingHandleCount,
- OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL
- )
-{
- EFI_STATUS Status;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- UINTN *HandleType;
- UINTN HandleIndex;
-
- ASSERT(MatchingHandleCount != NULL);
- ASSERT(DriverBindingHandle != NULL || ControllerHandle != NULL);
-
- if ((Mask & HR_VALID_MASK) != Mask) {
- return (EFI_INVALID_PARAMETER);
- }
-
- if ((Mask & HR_CHILD_HANDLE) != 0 && DriverBindingHandle == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- *MatchingHandleCount = 0;
- if (MatchingHandleBuffer != NULL) {
- *MatchingHandleBuffer = NULL;
- }
-
- HandleBuffer = NULL;
- HandleType = NULL;
-
- Status = ParseHandleDatabaseByRelationshipWithType (
- DriverBindingHandle,
- ControllerHandle,
- &HandleCount,
- &HandleBuffer,
- &HandleType
- );
- if (!EFI_ERROR (Status)) {
- //
- // Count the number of handles that match the attributes in Mask
- //
- for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
- if ((HandleType[HandleIndex] & Mask) == Mask) {
- (*MatchingHandleCount)++;
- }
- }
- //
- // If no handles match the attributes in Mask then return EFI_NOT_FOUND
- //
- if (*MatchingHandleCount == 0) {
- Status = EFI_NOT_FOUND;
- } else {
-
- if (MatchingHandleBuffer == NULL) {
- //
- // Someone just wanted the count...
- //
- Status = EFI_SUCCESS;
- } else {
- //
- // Allocate a handle buffer for the number of handles that matched the attributes in Mask
- //
- *MatchingHandleBuffer = AllocateZeroPool ((*MatchingHandleCount +1)* sizeof (EFI_HANDLE));
- ASSERT(*MatchingHandleBuffer != NULL);
-
- for (HandleIndex = 0,*MatchingHandleCount = 0
- ; HandleIndex < HandleCount
- ; HandleIndex++
- ){
- //
- // Fill the allocated buffer with the handles that matched the attributes in Mask
- //
- if ((HandleType[HandleIndex] & Mask) == Mask) {
- (*MatchingHandleBuffer)[(*MatchingHandleCount)++] = HandleBuffer[HandleIndex];
- }
- }
-
- //
- // Make the last one NULL
- //
- (*MatchingHandleBuffer)[*MatchingHandleCount] = NULL;
-
- Status = EFI_SUCCESS;
- } // MacthingHandleBuffer == NULL (ELSE)
- } // *MatchingHandleCount == 0 (ELSE)
- } // no error on ParseHandleDatabaseByRelationshipWithType
-
- if (HandleBuffer != NULL) {
- FreePool (HandleBuffer);
- }
-
- if (HandleType != NULL) {
- FreePool (HandleType);
- }
-
- return Status;
-}
-
-/**
- Gets handles for any child controllers of the passed in controller.
-
- @param[in] ControllerHandle The handle of the "parent controller"
- @param[in] MatchingHandleCount Pointer to the number of handles in
- MatchingHandleBuffer on return.
- @param[out] MatchingHandleBuffer Buffer containing handles on a successful
- return.
-
-
- @retval EFI_SUCCESS The operation was sucessful.
-**/
-EFI_STATUS
-EFIAPI
-ParseHandleDatabaseForChildControllers(
- IN CONST EFI_HANDLE ControllerHandle,
- IN UINTN *MatchingHandleCount,
- OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL
- )
-{
- EFI_STATUS Status;
- UINTN HandleIndex;
- UINTN DriverBindingHandleCount;
- EFI_HANDLE *DriverBindingHandleBuffer;
- UINTN DriverBindingHandleIndex;
- UINTN ChildControllerHandleCount;
- EFI_HANDLE *ChildControllerHandleBuffer;
- UINTN ChildControllerHandleIndex;
- EFI_HANDLE *HandleBufferForReturn;
-
- if (MatchingHandleCount == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- *MatchingHandleCount = 0;
-
- Status = PARSE_HANDLE_DATABASE_UEFI_DRIVERS (
- ControllerHandle,
- &DriverBindingHandleCount,
- &DriverBindingHandleBuffer
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Get a buffer big enough for all the controllers.
- //
- HandleBufferForReturn = GetHandleListByProtocol(NULL);
- if (HandleBufferForReturn == NULL) {
- FreePool (DriverBindingHandleBuffer);
- return (EFI_NOT_FOUND);
- }
-
- for (DriverBindingHandleIndex = 0; DriverBindingHandleIndex < DriverBindingHandleCount; DriverBindingHandleIndex++) {
- Status = PARSE_HANDLE_DATABASE_MANAGED_CHILDREN (
- DriverBindingHandleBuffer[DriverBindingHandleIndex],
- ControllerHandle,
- &ChildControllerHandleCount,
- &ChildControllerHandleBuffer
- );
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- for (ChildControllerHandleIndex = 0;
- ChildControllerHandleIndex < ChildControllerHandleCount;
- ChildControllerHandleIndex++
- ) {
- for (HandleIndex = 0; HandleIndex < *MatchingHandleCount; HandleIndex++) {
- if (HandleBufferForReturn[HandleIndex] == ChildControllerHandleBuffer[ChildControllerHandleIndex]) {
- break;
- }
- }
- if (HandleIndex >= *MatchingHandleCount) {
- HandleBufferForReturn[(*MatchingHandleCount)++] = ChildControllerHandleBuffer[ChildControllerHandleIndex];
- }
- }
-
- FreePool (ChildControllerHandleBuffer);
- }
-
- FreePool (DriverBindingHandleBuffer);
-
- if (MatchingHandleBuffer != NULL) {
- *MatchingHandleBuffer = HandleBufferForReturn;
- } else {
- FreePool(HandleBufferForReturn);
- }
-
- return (EFI_SUCCESS);
-}
-
-/**
- Appends 1 buffer to another buffer. This will re-allocate the destination buffer
- if necessary to fit all of the data.
-
- If DestinationBuffer is NULL, then ASSERT().
-
- @param[in, out] DestinationBuffer The pointer to the pointer to the buffer to append onto.
- @param[in, out] DestinationSize The pointer to the size of DestinationBuffer.
- @param[in] SourceBuffer The pointer to the buffer to append onto DestinationBuffer.
- @param[in] SourceSize The number of bytes of SourceBuffer to append.
-
- @retval NULL A memory allocation failed.
- @retval NULL A parameter was invalid.
- @return A pointer to (*DestinationBuffer).
-**/
-VOID*
-EFIAPI
-BuffernCatGrow (
- IN OUT VOID **DestinationBuffer,
- IN OUT UINTN *DestinationSize,
- IN VOID *SourceBuffer,
- IN UINTN SourceSize
- )
-{
- UINTN LocalDestinationSize;
- UINTN LocalDestinationFinalSize;
-
- ASSERT(DestinationBuffer != NULL);
-
- if (SourceSize == 0 || SourceBuffer == NULL) {
- return (*DestinationBuffer);
- }
-
- if (DestinationSize == NULL) {
- LocalDestinationSize = 0;
- } else {
- LocalDestinationSize = *DestinationSize;
- }
-
- LocalDestinationFinalSize = LocalDestinationSize + SourceSize;
-
- if (DestinationSize != NULL) {
- *DestinationSize = LocalDestinationSize;
- }
-
- if (LocalDestinationSize == 0) {
- // allcoate
- *DestinationBuffer = AllocateZeroPool(LocalDestinationFinalSize);
- } else {
- // reallocate
- *DestinationBuffer = ReallocatePool(LocalDestinationSize, LocalDestinationFinalSize, *DestinationBuffer);
- }
-
- ASSERT(*DestinationBuffer != NULL);
-
- // copy
- return (CopyMem(((UINT8*)(*DestinationBuffer)) + LocalDestinationSize, SourceBuffer, SourceSize));
-}
-
-/**
- Gets handles for any child devices produced by the passed in driver.
-
- @param[in] DriverHandle The handle of the driver.
- @param[in] MatchingHandleCount Pointer to the number of handles in
- MatchingHandleBuffer on return.
- @param[out] MatchingHandleBuffer Buffer containing handles on a successful
- return.
- @retval EFI_SUCCESS The operation was sucessful.
- @sa ParseHandleDatabaseByRelationship
-**/
-EFI_STATUS
-EFIAPI
-ParseHandleDatabaseForChildDevices(
- IN CONST EFI_HANDLE DriverHandle,
- IN UINTN *MatchingHandleCount,
- OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL
- )
-{
- EFI_HANDLE *Buffer;
- EFI_HANDLE *Buffer2;
- UINTN Count1;
- UINTN Count2;
- UINTN HandleIndex;
- EFI_STATUS Status;
- UINTN HandleBufferSize;
-
- ASSERT(MatchingHandleCount != NULL);
-
- HandleBufferSize = 0;
- Buffer = NULL;
- Buffer2 = NULL;
- *MatchingHandleCount = 0;
-
- Status = PARSE_HANDLE_DATABASE_DEVICES (
- DriverHandle,
- &Count1,
- &Buffer
- );
- if (!EFI_ERROR (Status)) {
- for (HandleIndex = 0; HandleIndex < Count1; HandleIndex++) {
- //
- // now find the children
- //
- Status = PARSE_HANDLE_DATABASE_MANAGED_CHILDREN (
- DriverHandle,
- Buffer[HandleIndex],
- &Count2,
- &Buffer2
- );
- if (EFI_ERROR(Status)) {
- break;
- }
- //
- // save out required and optional data elements
- //
- *MatchingHandleCount += Count2;
- if (MatchingHandleBuffer != NULL) {
- *MatchingHandleBuffer = BuffernCatGrow((VOID**)MatchingHandleBuffer, &HandleBufferSize, Buffer2, Count2 * sizeof(Buffer2[0]));
- }
-
- //
- // free the memory
- //
- if (Buffer2 != NULL) {
- FreePool(Buffer2);
- }
- }
- }
-
- if (Buffer != NULL) {
- FreePool(Buffer);
- }
- return (Status);
-}
-
-/**
- Function to get all handles that support a given protocol or all handles.
-
- @param[in] ProtocolGuid The guid of the protocol to get handles for. If NULL
- then the function will return all handles.
-
- @retval NULL A memory allocation failed.
- @return A NULL terminated list of handles.
-**/
-EFI_HANDLE*
-EFIAPI
-GetHandleListByProtocol (
- IN CONST EFI_GUID *ProtocolGuid OPTIONAL
- )
-{
- EFI_HANDLE *HandleList;
- UINTN Size;
- EFI_STATUS Status;
-
- Size = 0;
- HandleList = NULL;
-
- //
- // We cannot use LocateHandleBuffer since we need that NULL item on the ends of the list!
- //
- if (ProtocolGuid == NULL) {
- Status = gBS->LocateHandle(AllHandles, NULL, NULL, &Size, HandleList);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- HandleList = AllocateZeroPool(Size + sizeof(EFI_HANDLE));
- if (HandleList == NULL) {
- return (NULL);
- }
- Status = gBS->LocateHandle(AllHandles, NULL, NULL, &Size, HandleList);
- HandleList[Size/sizeof(EFI_HANDLE)] = NULL;
- }
- } else {
- Status = gBS->LocateHandle(ByProtocol, (EFI_GUID*)ProtocolGuid, NULL, &Size, HandleList);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- HandleList = AllocateZeroPool(Size + sizeof(EFI_HANDLE));
- if (HandleList == NULL) {
- return (NULL);
- }
- Status = gBS->LocateHandle(ByProtocol, (EFI_GUID*)ProtocolGuid, NULL, &Size, HandleList);
- HandleList[Size/sizeof(EFI_HANDLE)] = NULL;
- }
- }
- if (EFI_ERROR(Status)) {
- if (HandleList != NULL) {
- FreePool(HandleList);
- }
- return (NULL);
- }
- return (HandleList);
-}
-
-/**
- Function to get all handles that support some protocols.
-
- @param[in] ProtocolGuids A NULL terminated list of protocol GUIDs.
-
- @retval NULL A memory allocation failed.
- @retval NULL ProtocolGuids was NULL.
- @return A NULL terminated list of EFI_HANDLEs.
-**/
-EFI_HANDLE*
-EFIAPI
-GetHandleListByProtocolList (
- IN CONST EFI_GUID **ProtocolGuids
- )
-{
- EFI_HANDLE *HandleList;
- UINTN Size;
- UINTN TotalSize;
- UINTN TempSize;
- EFI_STATUS Status;
- CONST EFI_GUID **GuidWalker;
- EFI_HANDLE *HandleWalker1;
- EFI_HANDLE *HandleWalker2;
-
- Size = 0;
- HandleList = NULL;
- TotalSize = sizeof(EFI_HANDLE);
-
- for (GuidWalker = ProtocolGuids ; GuidWalker != NULL && *GuidWalker != NULL ; GuidWalker++,Size = 0){
- Status = gBS->LocateHandle(ByProtocol, (EFI_GUID*)(*GuidWalker), NULL, &Size, NULL);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- TotalSize += Size;
- }
- }
-
- //
- // No handles were found...
- //
- if (TotalSize == sizeof(EFI_HANDLE)) {
- return (NULL);
- }
-
- HandleList = AllocateZeroPool(TotalSize);
- if (HandleList == NULL) {
- return (NULL);
- }
-
- Size = 0;
- for (GuidWalker = ProtocolGuids ; GuidWalker != NULL && *GuidWalker != NULL ; GuidWalker++){
- TempSize = TotalSize - Size;
- Status = gBS->LocateHandle(ByProtocol, (EFI_GUID*)(*GuidWalker), NULL, &TempSize, HandleList+(Size/sizeof(EFI_HANDLE)));
-
- //
- // Allow for missing protocols... Only update the 'used' size upon success.
- //
- if (!EFI_ERROR(Status)) {
- Size += TempSize;
- }
- }
- ASSERT(HandleList[(TotalSize/sizeof(EFI_HANDLE))-1] == NULL);
-
- for (HandleWalker1 = HandleList ; HandleWalker1 != NULL && *HandleWalker1 != NULL ; HandleWalker1++) {
- for (HandleWalker2 = HandleWalker1 + 1; HandleWalker2 != NULL && *HandleWalker2 != NULL ; HandleWalker2++) {
- if (*HandleWalker1 == *HandleWalker2) {
- //
- // copy memory back 1 handle width.
- //
- CopyMem(HandleWalker2, HandleWalker2 + 1, TotalSize - ((HandleWalker2-HandleList+1)*sizeof(EFI_HANDLE)));
- }
- }
- }
-
- return (HandleList);
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
deleted file mode 100644
index 3b1ad2bac4..0000000000
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/** @file
- Provides interface to advanced shell functionality for parsing both handle and protocol database.
-
- Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_
-#define _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_
-
-#include <Uefi.h>
-
-#include <Guid/FileInfo.h>
-#include <Guid/ConsoleInDevice.h>
-#include <Guid/ConsoleOutDevice.h>
-#include <Guid/StandardErrorDevice.h>
-#include <Guid/GlobalVariable.h>
-#include <Guid/Gpt.h>
-#include <Guid/FileSystemInfo.h>
-#include <Guid/ShellLibHiiGuid.h>
-
-#include <Protocol/SimpleFileSystem.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/EfiShellInterface.h>
-#include <Protocol/EfiShellEnvironment2.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/DevicePathToText.h>
-#include <Protocol/DriverBinding.h>
-#include <Protocol/DriverConfiguration2.h>
-#include <Protocol/DriverConfiguration.h>
-#include <Protocol/DriverDiagnostics2.h>
-#include <Protocol/DriverDiagnostics.h>
-#include <Protocol/ComponentName2.h>
-#include <Protocol/ComponentName.h>
-#include <Protocol/PlatformDriverOverride.h>
-#include <Protocol/DevicePathUtilities.h>
-#include <Protocol/DevicePathFromText.h>
-#include <Protocol/BusSpecificDriverOverride.h>
-#include <Protocol/PlatformToDriverConfiguration.h>
-#include <Protocol/DriverSupportedEfiVersion.h>
-#include <Protocol/SimpleTextInEx.h>
-#include <Protocol/SimplePointer.h>
-#include <Protocol/SerialIo.h>
-#include <Protocol/AbsolutePointer.h>
-#include <Protocol/GraphicsOutput.h>
-#include <Protocol/EdidDiscovered.h>
-#include <Protocol/EdidActive.h>
-#include <Protocol/EdidOverride.h>
-#include <Protocol/LoadFile.h>
-#include <Protocol/LoadFile2.h>
-#include <Protocol/TapeIo.h>
-#include <Protocol/DiskIo.h>
-#include <Protocol/BlockIo.h>
-#include <Protocol/UnicodeCollation.h>
-#include <Protocol/PciRootBridgeIo.h>
-#include <Protocol/PciIo.h>
-#include <Protocol/ScsiPassThru.h>
-#include <Protocol/ScsiPassThruExt.h>
-#include <Protocol/ScsiIo.h>
-#include <Protocol/IScsiInitiatorName.h>
-#include <Protocol/UsbIo.h>
-#include <Protocol/UsbHostController.h>
-#include <Protocol/Usb2HostController.h>
-#include <Protocol/DebugSupport.h>
-#include <Protocol/DebugPort.h>
-#include <Protocol/Decompress.h>
-#include <Protocol/AcpiTable.h>
-#include <Protocol/Ebc.h>
-#include <Protocol/SimpleNetwork.h>
-#include <Protocol/NetworkInterfaceIdentifier.h>
-#include <Protocol/PxeBaseCode.h>
-#include <Protocol/PxeBaseCodeCallBack.h>
-#include <Protocol/Bis.h>
-#include <Protocol/ManagedNetwork.h>
-#include <Protocol/Arp.h>
-#include <Protocol/Dhcp4.h>
-#include <Protocol/Tcp4.h>
-#include <Protocol/Ip4.h>
-#include <Protocol/Ip4Config.h>
-#include <Protocol/Udp4.h>
-#include <Protocol/Mtftp4.h>
-#include <Protocol/AuthenticationInfo.h>
-#include <Protocol/Hash.h>
-#include <Protocol/HiiFont.h>
-#include <Protocol/HiiString.h>
-#include <Protocol/HiiImage.h>
-#include <Protocol/HiiDatabase.h>
-#include <Protocol/HiiConfigRouting.h>
-#include <Protocol/HiiConfigAccess.h>
-#include <Protocol/FormBrowser2.h>
-#include <Protocol/DeviceIo.h>
-#include <Protocol/UgaDraw.h>
-#include <Protocol/UgaIo.h>
-#include <Protocol/DriverConfiguration.h>
-#include <Protocol/DriverConfiguration2.h>
-#include <Protocol/DevicePathUtilities.h>
-//#include <Protocol/FirmwareVolume.h>
-//#include <Protocol/FirmwareVolume2.h>
-#include <Protocol/DriverFamilyOverride.h>
-#include <Protocol/Pcd.h>
-#include <Protocol/TcgService.h>
-#include <Protocol/HiiPackageList.h>
-#include <Protocol/Ip6.h>
-#include <Protocol/Ip6Config.h>
-#include <Protocol/Mtftp6.h>
-#include <Protocol/Dhcp6.h>
-#include <Protocol/Udp6.h>
-#include <Protocol/Tcp6.h>
-#include <Protocol/VlanConfig.h>
-#include <Protocol/Eap.h>
-#include <Protocol/EapManagement.h>
-#include <Protocol/Ftp4.h>
-#include <Protocol/IpSecConfig.h>
-#include <Protocol/DriverHealth.h>
-#include <Protocol/DeferredImageLoad.h>
-#include <Protocol/UserCredential.h>
-#include <Protocol/UserManager.h>
-#include <Protocol/AtaPassThru.h>
-#include <Protocol/FirmwareManagement.h>
-#include <Protocol/IpSec.h>
-#include <Protocol/Kms.h>
-#include <Protocol/BlockIo2.h>
-#include <Protocol/StorageSecurityCommand.h>
-#include <Protocol/UserCredential2.h>
-
-#include <Library/HandleParsingLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/DevicePathLib.h>
-#include <Library/PcdLib.h>
-#include <Library/PrintLib.h>
-#include <Library/UefiLib.h>
-#include <Library/HiiLib.h>
-#include <Library/ShellLib.h>
-
-typedef struct {
- LIST_ENTRY Link;
- EFI_HANDLE TheHandle;
- UINTN TheIndex;
-}HANDLE_LIST;
-
-typedef struct {
- HANDLE_LIST List;
- UINTN NextIndex;
-} HANDLE_INDEX_LIST;
-
-typedef
-CHAR16 *
-(EFIAPI *DUMP_PROTOCOL_INFO)(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST BOOLEAN Verbose
- );
-
-typedef struct _GUID_INFO_BLOCK{
- EFI_STRING_ID StringId;
- EFI_GUID *GuidId;
- DUMP_PROTOCOL_INFO DumpInfo;
-} GUID_INFO_BLOCK;
-
-#endif
-
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
deleted file mode 100644
index ddba0cfa18..0000000000
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
+++ /dev/null
@@ -1,190 +0,0 @@
-## @file
-# Provides interface to advanced shell functionality for parsing both handle and protocol database.
-# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiHandleParsingLib
- FILE_GUID = 3CDC7177-CC2A-4678-BA8F-1A936A093FA4
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = HandleParsingLib|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = HandleParsingLibConstructor
- DESTRUCTOR = HandleParsingLibDestructor
-
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- UefiHandleParsingLib.c
- UefiHandleParsingLib.h
- UefiHandleParsingLib.uni
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- ShellPkg/ShellPkg.dec
-
-[LibraryClasses]
- UefiBootServicesTableLib
- MemoryAllocationLib
- DevicePathLib
- BaseLib
- BaseMemoryLib
- DebugLib
- FileHandleLib
- PrintLib
- UefiLib
- HiiLib
-
-[Protocols]
- gEfiSimpleFileSystemProtocolGuid ##CONSUMES
-
- # shell 2.0
- gEfiShellProtocolGuid ##SOMETIMES_CONSUMED
- gEfiShellParametersProtocolGuid ##SOMETIMES_CONSUMED
-
- # 'old' shell
- gEfiShellEnvironment2Guid ##SOMETIMES_CONSUMED
- gEfiShellInterfaceGuid ##SOMETIMES_CONSUMED
-
- gEfiUnicodeCollation2ProtocolGuid ##CONSUMES
- gEfiDevicePathToTextProtocolGuid ##CONSUMES
- gEfiBusSpecificDriverOverrideProtocolGuid ##CONSUMES
- gEfiDevicePathUtilitiesProtocolGuid ##CONSUMES
- gEfiDevicePathFromTextProtocolGuid ##CONSUMES
- gEfiPlatformDriverOverrideProtocolGuid ##CONSUMES
- gEfiSimpleTextInProtocolGuid ##CONSUMES
- gEfiPlatformToDriverConfigurationProtocolGuid ##CONSUMES
- gEfiDriverSupportedEfiVersionProtocolGuid ##CONSUMES
- gEfiLoadedImageProtocolGuid ##CONSUMES
- gEfiDevicePathProtocolGuid ##CONSUMES
- gEfiLoadedImageDevicePathProtocolGuid ##CONSUMES
- gEfiSimpleTextOutProtocolGuid ##UNDEFINED
- gEfiSimplePointerProtocolGuid ##UNDEFINED
- gEfiAbsolutePointerProtocolGuid ##UNDEFINED
- gEfiSerialIoProtocolGuid ##UNDEFINED
- gEfiEdidDiscoveredProtocolGuid ##UNDEFINED
- gEfiEdidActiveProtocolGuid ##UNDEFINED
- gEfiEdidOverrideProtocolGuid ##UNDEFINED
- gEfiLoadFileProtocolGuid ##UNDEFINED
- gEfiLoadFile2ProtocolGuid ##UNDEFINED
- gEfiTapeIoProtocolGuid ##UNDEFINED
- gEfiDiskIoProtocolGuid ##UNDEFINED
- gEfiBlockIoProtocolGuid ##UNDEFINED
- gEfiUnicodeCollationProtocolGuid ##UNDEFINED
- gEfiPciRootBridgeIoProtocolGuid ##UNDEFINED
- gEfiPciIoProtocolGuid ##UNDEFINED
- gEfiScsiPassThruProtocolGuid ##UNDEFINED
- gEfiScsiIoProtocolGuid ##UNDEFINED
- gEfiExtScsiPassThruProtocolGuid ##UNDEFINED
- gEfiIScsiInitiatorNameProtocolGuid ##UNDEFINED
- gEfiUsbIoProtocolGuid ##UNDEFINED
- gEfiUsbHcProtocolGuid ##UNDEFINED
- gEfiUsb2HcProtocolGuid ##UNDEFINED
- gEfiDebugSupportProtocolGuid ##UNDEFINED
- gEfiDebugPortProtocolGuid ##UNDEFINED
- gEfiDecompressProtocolGuid ##UNDEFINED
- gEfiAcpiTableProtocolGuid ##UNDEFINED
- gEfiEbcProtocolGuid ##UNDEFINED
- gEfiSimpleNetworkProtocolGuid ##UNDEFINED
- gEfiNetworkInterfaceIdentifierProtocolGuid ##UNDEFINED
- gEfiNetworkInterfaceIdentifierProtocolGuid_31 ##UNDEFINED
- gEfiPxeBaseCodeProtocolGuid ##UNDEFINED
- gEfiPxeBaseCodeCallbackProtocolGuid ##UNDEFINED
- gEfiBisProtocolGuid ##UNDEFINED
- gEfiManagedNetworkServiceBindingProtocolGuid ##UNDEFINED
- gEfiManagedNetworkProtocolGuid ##UNDEFINED
- gEfiArpServiceBindingProtocolGuid ##UNDEFINED
- gEfiArpProtocolGuid ##UNDEFINED
- gEfiDhcp4ServiceBindingProtocolGuid ##UNDEFINED
- gEfiDhcp4ProtocolGuid ##UNDEFINED
- gEfiTcp4ServiceBindingProtocolGuid ##UNDEFINED
- gEfiTcp4ProtocolGuid ##UNDEFINED
- gEfiIp4ServiceBindingProtocolGuid ##UNDEFINED
- gEfiIp4ProtocolGuid ##UNDEFINED
- gEfiIp4ConfigProtocolGuid ##UNDEFINED
- gEfiUdp4ServiceBindingProtocolGuid ##UNDEFINED
- gEfiUdp4ProtocolGuid ##UNDEFINED
- gEfiMtftp4ServiceBindingProtocolGuid ##UNDEFINED
- gEfiMtftp4ProtocolGuid ##UNDEFINED
- gEfiAuthenticationInfoProtocolGuid ##UNDEFINED
- gEfiHashServiceBindingProtocolGuid ##UNDEFINED
- gEfiHashProtocolGuid ##UNDEFINED
- gEfiHiiFontProtocolGuid ##UNDEFINED
- gEfiHiiStringProtocolGuid ##UNDEFINED
- gEfiHiiImageProtocolGuid ##UNDEFINED
- gEfiHiiConfigRoutingProtocolGuid ##UNDEFINED
- gEfiHiiConfigAccessProtocolGuid ##UNDEFINED
- gEfiFormBrowser2ProtocolGuid ##UNDEFINED
- gEfiDeviceIoProtocolGuid ##UNDEFINED
- gEfiUgaDrawProtocolGuid ##UNDEFINED
- gEfiUgaIoProtocolGuid ##UNDEFINED
- gEfiDriverConfigurationProtocolGuid ##UNDEFINED
- gEfiDriverConfiguration2ProtocolGuid ##UNDEFINED
- gEfiSimpleTextInputExProtocolGuid ##UNDEFINED
- gEfiIp6ServiceBindingProtocolGuid ##UNDEFINED
- gEfiIp6ProtocolGuid ##UNDEFINED
- gEfiIp6ConfigProtocolGuid ##UNDEFINED
- gEfiMtftp6ServiceBindingProtocolGuid ##UNDEFINED
- gEfiMtftp6ProtocolGuid ##UNDEFINED
- gEfiDhcp6ServiceBindingProtocolGuid ##UNDEFINED
- gEfiDhcp6ProtocolGuid ##UNDEFINED
- gEfiUdp6ServiceBindingProtocolGuid ##UNDEFINED
- gEfiUdp6ProtocolGuid ##UNDEFINED
- gEfiTcp6ServiceBindingProtocolGuid ##UNDEFINED
- gEfiTcp6ProtocolGuid ##UNDEFINED
- gEfiVlanConfigProtocolGuid ##UNDEFINED
- gEfiEapProtocolGuid ##UNDEFINED
- gEfiEapManagementProtocolGuid ##UNDEFINED
- gEfiFtp4ServiceBindingProtocolGuid ##UNDEFINED
- gEfiFtp4ProtocolGuid ##UNDEFINED
- gEfiIpSecConfigProtocolGuid ##UNDEFINED
- gEfiDriverHealthProtocolGuid ##UNDEFINED
- gEfiDeferredImageLoadProtocolGuid ##UNDEFINED
- gEfiUserCredentialProtocolGuid ##UNDEFINED
- gEfiUserManagerProtocolGuid ##UNDEFINED
- gEfiAtaPassThruProtocolGuid ##UNDEFINED
- gEfiFirmwareManagementProtocolGuid ##UNDEFINED
- gEfiIpSecProtocolGuid ##UNDEFINED
- gEfiIpSec2ProtocolGuid ##UNDEFINED
- gEfiKmsProtocolGuid ##UNDEFINED
- gEfiBlockIo2ProtocolGuid ##UNDEFINED
- gEfiStorageSecurityCommandProtocolGuid ##UNDEFINED
- gEfiUserCredential2ProtocolGuid ##UNDEFINED
- gPcdProtocolGuid ##UNDEFINED
- gEfiTcgProtocolGuid ##UNDEFINED
- gEfiHiiPackageListProtocolGuid ##UNDEFINED
- gEfiDriverFamilyOverrideProtocolGuid ##UNDEFINED
-
-[Guids]
- gEfiFileInfoGuid ##CONSUMES
- gEfiShellEnvironment2ExtGuid ##CONSUMES
- gEfiPcAnsiGuid ##UNDEFINED
- gEfiVT100Guid ##UNDEFINED
- gEfiVT100PlusGuid ##UNDEFINED
- gEfiVTUTF8Guid ##UNDEFINED
- gEfiStandardErrorDeviceGuid ##UNDEFINED
- gEfiConsoleInDeviceGuid ##UNDEFINED
- gEfiConsoleOutDeviceGuid ##UNDEFINED
- gEfiFileSystemInfoGuid ##UNDEFINED
- gEfiGlobalVariableGuid ##UNDEFINED
- gEfiPartTypeSystemPartGuid ##UNDEFINED
- gEfiPartTypeLegacyMbrGuid ##UNDEFINED
- gHandleParsingHiiGuid ##UNDEFINED
-
-[Pcd.common]
- gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize ##CONSUMES
- gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize ##CONSUMES
- gEfiShellPkgTokenSpaceGuid.PcdShellIncludeNtGuids ##CONSUMES \ No newline at end of file
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
deleted file mode 100644
index 6a9074eafe..0000000000
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c b/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c
deleted file mode 100644
index 60b15fe8a0..0000000000
--- a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/** @file
- Provides application point extension for "C" style main funciton
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Base.h>
-
-#include <Protocol/SimpleFileSystem.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/EfiShellInterface.h>
-#include <Protocol/EfiShellParameters.h>
-
-#include <Library/ShellCEntryLib.h>
-#include <Library/DebugLib.h>
-
-/**
- UEFI entry point for an application that will in turn call the
- ShellAppMain function which has parameters similar to a standard C
- main function.
-
- An application that uses UefiShellCEntryLib must have a ShellAppMain
- function as prototyped in Include/Library/ShellCEntryLib.h.
-
- @param ImageHandle The image handle of the UEFI Application.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The application exited normally.
- @retval Other An error occurred.
-
-**/
-EFI_STATUS
-EFIAPI
-ShellCEntryLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- INTN ReturnFromMain;
- EFI_SHELL_PARAMETERS_PROTOCOL *EfiShellParametersProtocol;
- EFI_SHELL_INTERFACE *EfiShellInterface;
- EFI_STATUS Status;
-
- ReturnFromMain = -1;
- EfiShellParametersProtocol = NULL;
- EfiShellInterface = NULL;
-
- Status = SystemTable->BootServices->OpenProtocol(ImageHandle,
- &gEfiShellParametersProtocolGuid,
- (VOID **)&EfiShellParametersProtocol,
- ImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR(Status)) {
- //
- // use shell 2.0 interface
- //
- ReturnFromMain = ShellAppMain (
- EfiShellParametersProtocol->Argc,
- EfiShellParametersProtocol->Argv
- );
- } else {
- //
- // try to get shell 1.0 interface instead.
- //
- Status = SystemTable->BootServices->OpenProtocol(ImageHandle,
- &gEfiShellInterfaceGuid,
- (VOID **)&EfiShellInterface,
- ImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR(Status)) {
- //
- // use shell 1.0 interface
- //
- ReturnFromMain = ShellAppMain (
- EfiShellInterface->Argc,
- EfiShellInterface->Argv
- );
- } else {
- ASSERT(FALSE);
- }
- }
- if (ReturnFromMain == 0) {
- return (EFI_SUCCESS);
- } else {
- return (EFI_UNSUPPORTED);
- }
-}
diff --git a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf b/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
deleted file mode 100644
index 69972cee43..0000000000
--- a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
+++ /dev/null
@@ -1,44 +0,0 @@
-## @file
-# Provides interface to shell functionality for shell commands and applications.
-#
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellCEntryLib
- FILE_GUID = 0e205c8a-8586-4dec-9f5c-4f9e394aefe8
- MODULE_TYPE = UEFI_APPLICATION
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ShellCEntryLib|UEFI_APPLICATION UEFI_DRIVER
-
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- UefiShellCEntryLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
-
-[LibraryClasses]
- UefiApplicationEntryPoint
- DebugLib
-
-
-[Protocols]
- gEfiShellParametersProtocolGuid # ALWAYS_CONSUMED
- gEfiShellInterfaceGuid # SOMETIMES_CONSUMED
-
-
diff --git a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
deleted file mode 100644
index 9fbcbb3eb2..0000000000
--- a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
+++ /dev/null
@@ -1,1393 +0,0 @@
-/** @file
- Main file for support of shell consist mapping.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#include "UefiShellCommandLib.h"
-#include <Library/DevicePathLib.h>
-#include <Library/SortLib.h>
-
-typedef enum {
- MTDTypeUnknown,
- MTDTypeFloppy,
- MTDTypeHardDisk,
- MTDTypeCDRom,
- MTDTypeEnd
-} MTD_TYPE;
-
-typedef struct {
- CHAR16 *Str;
- UINTN Len;
-} POOL_PRINT;
-
-typedef struct {
- UINTN Hi;
- MTD_TYPE Mtd;
- POOL_PRINT Csd;
- BOOLEAN Digital;
-} DEVICE_CONSIST_MAPPING_INFO;
-
-typedef struct {
- MTD_TYPE MTDType;
- CHAR16 *Name;
-} MTD_NAME;
-
-typedef struct {
- UINT8 Type;
- UINT8 SubType;
- VOID (EFIAPI *SerialFun) (EFI_DEVICE_PATH_PROTOCOL *DevPath, DEVICE_CONSIST_MAPPING_INFO *MapInfo);
- INTN (EFIAPI *CompareFun) (EFI_DEVICE_PATH_PROTOCOL *DevPath, EFI_DEVICE_PATH_PROTOCOL *DevPath2);
-} DEV_PATH_CONSIST_MAPPING_TABLE;
-
-
-/**
- Concatenates a formatted unicode string to allocated pool.
- The caller must free the resulting buffer.
-
- @param Str Tracks the allocated pool, size in use, and amount of pool allocated.
- @param Fmt The format string
- @param ... The data will be printed.
-
- @return Allocated buffer with the formatted string printed in it.
- The caller must free the allocated buffer.
- The buffer allocation is not packed.
-
-**/
-CHAR16 *
-EFIAPI
-CatPrint (
- IN OUT POOL_PRINT *Str,
- IN CHAR16 *Fmt,
- ...
- )
-{
- UINT16 *AppendStr;
- VA_LIST Args;
- UINTN StringSize;
-
- AppendStr = AllocateZeroPool (0x1000);
- if (AppendStr == NULL) {
- ASSERT(FALSE);
- return Str->Str;
- }
-
- VA_START (Args, Fmt);
- UnicodeVSPrint (AppendStr, 0x1000, Fmt, Args);
- VA_END (Args);
- if (NULL == Str->Str) {
- StringSize = StrSize (AppendStr);
- Str->Str = AllocateZeroPool (StringSize);
- ASSERT (Str->Str != NULL);
- } else {
- StringSize = StrSize (AppendStr);
- StringSize += (StrSize (Str->Str) - sizeof (UINT16));
-
- Str->Str = ReallocatePool (
- StrSize (Str->Str),
- StringSize,
- Str->Str
- );
- ASSERT (Str->Str != NULL);
- }
-
- StrCat (Str->Str, AppendStr);
- Str->Len = StringSize;
-
- FreePool (AppendStr);
- return Str->Str;
-}
-
-MTD_NAME mMTDName[] = {
- {
- MTDTypeUnknown,
- L"F"
- },
- {
- MTDTypeFloppy,
- L"FP"
- },
- {
- MTDTypeHardDisk,
- L"HD"
- },
- {
- MTDTypeCDRom,
- L"CD"
- },
- {
- MTDTypeEnd,
- NULL
- }
-};
-
-/**
- Function to append a 64 bit number / 25 onto the string.
-
- @param[in, out] Str The string so append onto.
- @param[in] Num The number to divide and append.
-
- @retval EFI_INVALID_PARAMETER A parameter was NULL.
- @retval EFI_SUCCESS The appending was successful.
-**/
-EFI_STATUS
-EFIAPI
-AppendCSDNum2 (
- IN OUT POOL_PRINT *Str,
- IN UINT64 Num
- )
-{
- UINT64 Result;
- UINT32 Rem;
-
- if (Str == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- Result = DivU64x32Remainder (Num, 25, &Rem);
- if (Result > 0) {
- AppendCSDNum2 (Str, Result);
- }
-
- CatPrint (Str, L"%c", Rem + 'a');
- return (EFI_SUCCESS);
-}
-
-/**
- Function to append a 64 bit number onto the mapping info.
-
- @param[in, out] MappingItem The mapping info object to append onto.
- @param[in] Num The info to append.
-
- @retval EFI_INVALID_PARAMETER A parameter was NULL.
- @retval EFI_SUCCESS The appending was successful.
-**/
-EFI_STATUS
-EFIAPI
-AppendCSDNum (
- IN OUT DEVICE_CONSIST_MAPPING_INFO *MappingItem,
- IN UINT64 Num
- )
-{
- if (MappingItem == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (MappingItem->Digital) {
- CatPrint (&MappingItem->Csd, L"%ld", Num);
- } else {
- AppendCSDNum2 (&MappingItem->Csd, Num);
- }
-
- MappingItem->Digital = (BOOLEAN)!(MappingItem->Digital);
-
- return (EFI_SUCCESS);
-}
-
-/**
- Function to append string into the mapping info.
-
- @param[in, out] MappingItem The mapping info object to append onto.
- @param[in] Str The info to append.
-
- @retval EFI_INVALID_PARAMETER A parameter was NULL.
- @retval EFI_SUCCESS The appending was successful.
-**/
-EFI_STATUS
-EFIAPI
-AppendCSDStr (
- IN OUT DEVICE_CONSIST_MAPPING_INFO *MappingItem,
- IN CHAR16 *Str
- )
-{
- CHAR16 *Index;
-
- if (Str == NULL || MappingItem == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- if (MappingItem->Digital) {
- //
- // To aVOID mult-meaning, the mapping is:
- // 0 1 2 3 4 5 6 7 8 9 a b c d e f
- // 0 16 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- //
- for (Index = Str; *Index != 0; Index++) {
- switch (*Index) {
- case '0':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- CatPrint (&MappingItem->Csd, L"%c", *Index);
- break;
-
- case '1':
- CatPrint (&MappingItem->Csd, L"16");
- break;
-
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- CatPrint (&MappingItem->Csd, L"1%c", *Index - 'a' + '0');
- break;
-
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- CatPrint (&MappingItem->Csd, L"1%c", *Index - 'A' + '0');
- break;
- }
- }
- } else {
- for (Index = Str; *Index != 0; Index++) {
- //
- // The mapping is:
- // 0 1 2 3 4 5 6 7 8 9 a b c d e f
- // a b c d e f g h i j k l m n o p
- //
- if (*Index >= '0' && *Index <= '9') {
- CatPrint (&MappingItem->Csd, L"%c", *Index - '0' + 'a');
- } else if (*Index >= 'a' && *Index <= 'f') {
- CatPrint (&MappingItem->Csd, L"%c", *Index - 'a' + 'k');
- } else if (*Index >= 'A' && *Index <= 'F') {
- CatPrint (&MappingItem->Csd, L"%c", *Index - 'A' + 'k');
- }
- }
- }
-
- MappingItem->Digital = (BOOLEAN)!(MappingItem->Digital);
-
- return (EFI_SUCCESS);
-}
-
-/**
- Function to append a Guid to the mapping item.
-
- @param[in, out] MappingItem The item to append onto.
- @param[in] Guid The guid to append.
-
- @retval EFI_SUCCESS The appending operation was successful.
- @retval EFI_INVALID_PARAMETER A parameter was NULL.
-**/
-EFI_STATUS
-EFIAPI
-AppendCSDGuid (
- DEVICE_CONSIST_MAPPING_INFO *MappingItem,
- EFI_GUID *Guid
- )
-{
- CHAR16 Buffer[64];
-
- if (Guid == NULL || MappingItem == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- UnicodeSPrint (
- Buffer,
- 0,
- L"%g",
- Guid
- );
-
- AppendCSDStr (MappingItem, Buffer);
-
- return (EFI_SUCCESS);
-}
-
-/**
- Function to compare 2 APCI device paths.
-
- @param[in] DevicePath1 The first device path to compare.
- @param[in] DevicePath2 The second device path to compare.
-
- @retval 0 The device paths represent the same device.
- @return Non zero if the devices are different, zero otherwise.
-**/
-INTN
-EFIAPI
-DevPathCompareAcpi (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2
- )
-{
- ACPI_HID_DEVICE_PATH *Acpi1;
- ACPI_HID_DEVICE_PATH *Acpi2;
-
- if (DevicePath1 == NULL || DevicePath2 == NULL) {
- return (-2);
- }
-
- Acpi1 = (ACPI_HID_DEVICE_PATH *) DevicePath1;
- Acpi2 = (ACPI_HID_DEVICE_PATH *) DevicePath2;
- if (Acpi1->HID > Acpi2->HID || (Acpi1->HID == Acpi2->HID && Acpi1->UID > Acpi2->UID)) {
- return 1;
- }
-
- if (Acpi1->HID == Acpi2->HID && Acpi1->UID == Acpi2->UID) {
- return 0;
- }
-
- return -1;
-}
-
-/**
- Function to compare 2 PCI device paths.
-
- @param[in] DevicePath1 The first device path to compare.
- @param[in] DevicePath2 The second device path to compare.
-
- @retval 0 The device paths represent the same device.
- @return Non zero if the devices are different, zero otherwise.
-**/
-INTN
-EFIAPI
-DevPathComparePci (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2
- )
-{
- PCI_DEVICE_PATH *Pci1;
- PCI_DEVICE_PATH *Pci2;
-
- ASSERT(DevicePath1 != NULL);
- ASSERT(DevicePath2 != NULL);
-
- Pci1 = (PCI_DEVICE_PATH *) DevicePath1;
- Pci2 = (PCI_DEVICE_PATH *) DevicePath2;
- if (Pci1->Device > Pci2->Device || (Pci1->Device == Pci2->Device && Pci1->Function > Pci2->Function)) {
- return 1;
- }
-
- if (Pci1->Device == Pci2->Device && Pci1->Function == Pci2->Function) {
- return 0;
- }
-
- return -1;
-}
-
-/**
- Do a comparison on 2 device paths.
-
- @param[in] DevicePath1 The first device path.
- @param[in] DevicePath2 The second device path.
-
- @retval 0 The 2 device paths are the same.
- @retval <0 DevicePath2 is greater than DevicePath1.
- @retval >0 DevicePath1 is greater than DevicePath2.
-**/
-INTN
-EFIAPI
-DevPathCompareDefault (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2
- )
-{
- UINTN DevPathSize1;
- UINTN DevPathSize2;
-
- ASSERT(DevicePath1 != NULL);
- ASSERT(DevicePath2 != NULL);
-
- DevPathSize1 = DevicePathNodeLength (DevicePath1);
- DevPathSize2 = DevicePathNodeLength (DevicePath2);
- if (DevPathSize1 > DevPathSize2) {
- return 1;
- } else if (DevPathSize1 < DevPathSize2) {
- return -1;
- } else {
- return CompareMem (DevicePath1, DevicePath2, DevPathSize1);
- }
-}
-
-/**
- DevicePathNode must be SerialHDD Channel type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialHardDrive (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- HARDDRIVE_DEVICE_PATH *Hd;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Hd = (HARDDRIVE_DEVICE_PATH *) DevicePathNode;
- if (MappingItem->Mtd == MTDTypeUnknown) {
- MappingItem->Mtd = MTDTypeHardDisk;
- }
-
- AppendCSDNum (MappingItem, Hd->PartitionNumber);
-}
-
-/**
- DevicePathNode must be SerialAtapi Channel type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialAtapi (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- ATAPI_DEVICE_PATH *Atapi;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Atapi = (ATAPI_DEVICE_PATH *) DevicePathNode;
- AppendCSDNum (MappingItem, (Atapi->PrimarySecondary * 2 + Atapi->SlaveMaster));
-}
-
-/**
- DevicePathNode must be SerialCDROM Channel type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialCdRom (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- CDROM_DEVICE_PATH *Cd;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Cd = (CDROM_DEVICE_PATH *) DevicePathNode;
- MappingItem->Mtd = MTDTypeCDRom;
- AppendCSDNum (MappingItem, Cd->BootEntry);
-}
-
-/**
- DevicePathNode must be SerialFibre Channel type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialFibre (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- FIBRECHANNEL_DEVICE_PATH *Fibre;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Fibre = (FIBRECHANNEL_DEVICE_PATH *) DevicePathNode;
- AppendCSDNum (MappingItem, Fibre->WWN);
- AppendCSDNum (MappingItem, Fibre->Lun);
-}
-
-/**
- DevicePathNode must be SerialUart type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialUart (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- UART_DEVICE_PATH *Uart;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Uart = (UART_DEVICE_PATH *) DevicePathNode;
- AppendCSDNum (MappingItem, Uart->BaudRate);
- AppendCSDNum (MappingItem, Uart->DataBits);
- AppendCSDNum (MappingItem, Uart->Parity);
- AppendCSDNum (MappingItem, Uart->StopBits);
-}
-
-/**
- DevicePathNode must be SerialUSB type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialUsb (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- USB_DEVICE_PATH *Usb;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Usb = (USB_DEVICE_PATH *) DevicePathNode;
- AppendCSDNum (MappingItem, Usb->ParentPortNumber);
- AppendCSDNum (MappingItem, Usb->InterfaceNumber);
-}
-
-/**
- DevicePathNode must be SerialVendor type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-
-**/
-VOID
-EFIAPI
-DevPathSerialVendor (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- VENDOR_DEVICE_PATH *Vendor;
- SAS_DEVICE_PATH *Sas;
-
- if (DevicePathNode == NULL || MappingItem == NULL) {
- return;
- }
-
- Vendor = (VENDOR_DEVICE_PATH *) DevicePathNode;
- AppendCSDGuid (MappingItem, &Vendor->Guid);
-
- if (CompareGuid (&gEfiSasDevicePathGuid, &Vendor->Guid)) {
- Sas = (SAS_DEVICE_PATH *) Vendor;
- AppendCSDNum (MappingItem, Sas->SasAddress);
- AppendCSDNum (MappingItem, Sas->Lun);
- AppendCSDNum (MappingItem, Sas->DeviceTopology);
- AppendCSDNum (MappingItem, Sas->RelativeTargetPort);
- }
-}
-
-/**
- DevicePathNode must be SerialLun type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialLun (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- DEVICE_LOGICAL_UNIT_DEVICE_PATH *Lun;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Lun = (DEVICE_LOGICAL_UNIT_DEVICE_PATH *) DevicePathNode;
- AppendCSDNum (MappingItem, Lun->Lun);
-}
-
-/**
- DevicePathNode must be SerialSata type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialSata (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- SATA_DEVICE_PATH *Sata;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Sata = (SATA_DEVICE_PATH *) DevicePathNode;
- AppendCSDNum (MappingItem, Sata->HBAPortNumber);
- AppendCSDNum (MappingItem, Sata->PortMultiplierPortNumber);
- AppendCSDNum (MappingItem, Sata->Lun);
-}
-
-/**
- DevicePathNode must be SerialSCSI type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialIScsi (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
-///@todo make this a PCD
-//
-// As Csd of ISCSI node is quite long, we comment
-// the code below to keep the consistent mapping
-// short. Uncomment if you really need it.
-//
-/*
- ISCSI_DEVICE_PATH *IScsi;
- UINT8 *IScsiTargetName;
- CHAR16 *TargetName;
- UINTN TargetNameLength;
- UINTN Index;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- IScsi = (ISCSI_DEVICE_PATH *) DevicePathNode;
- AppendCSDNum (MappingItem, IScsi->NetworkProtocol);
- AppendCSDNum (MappingItem, IScsi->LoginOption);
- AppendCSDNum (MappingItem, IScsi->Lun);
- AppendCSDNum (MappingItem, IScsi->TargetPortalGroupTag);
- TargetNameLength = DevicePathNodeLength (DevicePathNode) - sizeof (ISCSI_DEVICE_PATH);
- if (TargetNameLength > 0) {
- TargetName = AllocateZeroPool ((TargetNameLength + 1) * sizeof (CHAR16));
- if (TargetName != NULL) {
- IScsiTargetName = (UINT8 *) (IScsi + 1);
- for (Index = 0; Index < TargetNameLength; Index++) {
- TargetName[Index] = (CHAR16) IScsiTargetName[Index];
- }
- AppendCSDStr (MappingItem, TargetName);
- FreePool (TargetName);
- }
- }
- */
-}
-
-/**
- DevicePathNode must be SerialI20 type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialI2O (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- I2O_DEVICE_PATH *DevicePath_I20;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- DevicePath_I20 = (I2O_DEVICE_PATH *) DevicePathNode;
- AppendCSDNum (MappingItem, DevicePath_I20->Tid);
-}
-
-/**
- DevicePathNode must be Mac Address type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialMacAddr (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- MAC_ADDR_DEVICE_PATH *Mac;
- UINTN HwAddressSize;
- UINTN Index;
- CHAR16 Buffer[64];
- CHAR16 *PBuffer;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Mac = (MAC_ADDR_DEVICE_PATH *) DevicePathNode;
-
- HwAddressSize = sizeof (EFI_MAC_ADDRESS);
- if (Mac->IfType == 0x01 || Mac->IfType == 0x00) {
- HwAddressSize = 6;
- }
-
- for (Index = 0, PBuffer = Buffer; Index < HwAddressSize; Index++, PBuffer += 2) {
- UnicodeSPrint (PBuffer, 0, L"%02x", (UINTN) Mac->MacAddress.Addr[Index]);
- }
-
- AppendCSDStr (MappingItem, Buffer);
-}
-
-/**
- DevicePathNode must be InfiniBand type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialInfiniBand (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- INFINIBAND_DEVICE_PATH *InfiniBand;
- UINTN Index;
- CHAR16 Buffer[64];
- CHAR16 *PBuffer;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- InfiniBand = (INFINIBAND_DEVICE_PATH *) DevicePathNode;
- for (Index = 0, PBuffer = Buffer; Index < 16; Index++, PBuffer += 2) {
- UnicodeSPrint (PBuffer, 0, L"%02x", (UINTN) InfiniBand->PortGid[Index]);
- }
-
- AppendCSDStr (MappingItem, Buffer);
- AppendCSDNum (MappingItem, InfiniBand->ServiceId);
- AppendCSDNum (MappingItem, InfiniBand->TargetPortId);
- AppendCSDNum (MappingItem, InfiniBand->DeviceId);
-}
-
-/**
- DevicePathNode must be IPv4 type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialIPv4 (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- IPv4_DEVICE_PATH *Ip;
- CHAR16 Buffer[10];
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Ip = (IPv4_DEVICE_PATH *) DevicePathNode;
- UnicodeSPrint (
- Buffer,
- 0,
- L"%02x%02x%02x%02x",
- (UINTN) Ip->LocalIpAddress.Addr[0],
- (UINTN) Ip->LocalIpAddress.Addr[1],
- (UINTN) Ip->LocalIpAddress.Addr[2],
- (UINTN) Ip->LocalIpAddress.Addr[3]
- );
- AppendCSDStr (MappingItem, Buffer);
- AppendCSDNum (MappingItem, Ip->LocalPort);
- UnicodeSPrint (
- Buffer,
- 0,
- L"%02x%02x%02x%02x",
- (UINTN) Ip->RemoteIpAddress.Addr[0],
- (UINTN) Ip->RemoteIpAddress.Addr[1],
- (UINTN) Ip->RemoteIpAddress.Addr[2],
- (UINTN) Ip->RemoteIpAddress.Addr[3]
- );
- AppendCSDStr (MappingItem, Buffer);
- AppendCSDNum (MappingItem, Ip->RemotePort);
-}
-
-/**
- DevicePathNode must be IPv6 type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialIPv6 (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- IPv6_DEVICE_PATH *Ip;
- UINTN Index;
- CHAR16 Buffer[64];
- CHAR16 *PBuffer;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Ip = (IPv6_DEVICE_PATH *) DevicePathNode;
- for (Index = 0, PBuffer = Buffer; Index < 16; Index++, PBuffer += 2) {
- UnicodeSPrint (PBuffer, 0, L"%02x", (UINTN) Ip->LocalIpAddress.Addr[Index]);
- }
-
- AppendCSDStr (MappingItem, Buffer);
- AppendCSDNum (MappingItem, Ip->LocalPort);
- for (Index = 0, PBuffer = Buffer; Index < 16; Index++, PBuffer += 2) {
- UnicodeSPrint (PBuffer, 0, L"%02x", (UINTN) Ip->RemoteIpAddress.Addr[Index]);
- }
-
- AppendCSDStr (MappingItem, Buffer);
- AppendCSDNum (MappingItem, Ip->RemotePort);
-}
-
-/**
- DevicePathNode must be SCSI type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialScsi (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- SCSI_DEVICE_PATH *Scsi;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Scsi = (SCSI_DEVICE_PATH *) DevicePathNode;
- AppendCSDNum (MappingItem, Scsi->Pun);
- AppendCSDNum (MappingItem, Scsi->Lun);
-}
-
-/**
- DevicePathNode must be 1394 type and this will populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerial1394 (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- F1394_DEVICE_PATH *DevicePath_F1394;
- CHAR16 Buffer[20];
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- DevicePath_F1394 = (F1394_DEVICE_PATH *) DevicePathNode;
- UnicodeSPrint (Buffer, 0, L"%lx", DevicePath_F1394->Guid);
- AppendCSDStr (MappingItem, Buffer);
-}
-
-/**
- If the node is floppy type then populate the MappingItem.
-
- @param[in] DevicePathNode The node to get info on.
- @param[in] MappingItem The info item to populate.
-**/
-VOID
-EFIAPI
-DevPathSerialAcpi (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- ACPI_HID_DEVICE_PATH *Acpi;
-
- ASSERT(DevicePathNode != NULL);
- ASSERT(MappingItem != NULL);
-
- Acpi = (ACPI_HID_DEVICE_PATH *) DevicePathNode;
- if ((Acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) {
- if (EISA_ID_TO_NUM (Acpi->HID) == 0x0604) {
- MappingItem->Mtd = MTDTypeFloppy;
- AppendCSDNum (MappingItem, Acpi->UID);
- }
- }
-}
-
-/**
- Empty function used for unknown devices.
-
- @param[in] DevicePathNode Ignored.
- @param[in] MappingItem Ignored.
-
- Does nothing.
-**/
-VOID
-EFIAPI
-DevPathSerialDefault (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem
- )
-{
- return;
-}
-
-DEV_PATH_CONSIST_MAPPING_TABLE DevPathConsistMappingTable[] = {
- HARDWARE_DEVICE_PATH,
- HW_PCI_DP,
- DevPathSerialDefault,
- DevPathComparePci,
- ACPI_DEVICE_PATH,
- ACPI_DP,
- DevPathSerialAcpi,
- DevPathCompareAcpi,
- MESSAGING_DEVICE_PATH,
- MSG_ATAPI_DP,
- DevPathSerialAtapi,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_SCSI_DP,
- DevPathSerialScsi,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_FIBRECHANNEL_DP,
- DevPathSerialFibre,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_1394_DP,
- DevPathSerial1394,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_USB_DP,
- DevPathSerialUsb,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_I2O_DP,
- DevPathSerialI2O,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_MAC_ADDR_DP,
- DevPathSerialMacAddr,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_IPv4_DP,
- DevPathSerialIPv4,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_IPv6_DP,
- DevPathSerialIPv6,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_INFINIBAND_DP,
- DevPathSerialInfiniBand,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_UART_DP,
- DevPathSerialUart,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_VENDOR_DP,
- DevPathSerialVendor,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_DEVICE_LOGICAL_UNIT_DP,
- DevPathSerialLun,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_SATA_DP,
- DevPathSerialSata,
- DevPathCompareDefault,
- MESSAGING_DEVICE_PATH,
- MSG_ISCSI_DP,
- DevPathSerialIScsi,
- DevPathCompareDefault,
- MEDIA_DEVICE_PATH,
- MEDIA_HARDDRIVE_DP,
- DevPathSerialHardDrive,
- DevPathCompareDefault,
- MEDIA_DEVICE_PATH,
- MEDIA_CDROM_DP,
- DevPathSerialCdRom,
- DevPathCompareDefault,
- MEDIA_DEVICE_PATH,
- MEDIA_VENDOR_DP,
- DevPathSerialVendor,
- DevPathCompareDefault,
- 0,
- 0,
- NULL,
- NULL
-};
-
-/**
- Function to determine if a device path node is Hi or not.
-
- @param[in] DevicePathNode The node to check.
-
- @retval TRUE The node is Hi.
- @retval FALSE The node is not Hi.
-**/
-BOOLEAN
-EFIAPI
-IsHIDevicePathNode (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode
- )
-{
- ACPI_HID_DEVICE_PATH *Acpi;
-
- ASSERT(DevicePathNode != NULL);
-
- if (DevicePathNode->Type == HARDWARE_DEVICE_PATH) {
- return TRUE;
- }
-
- if (DevicePathNode->Type == ACPI_DEVICE_PATH) {
- Acpi = (ACPI_HID_DEVICE_PATH *) DevicePathNode;
- switch (EISA_ID_TO_NUM (Acpi->HID)) {
- case 0x0301:
- case 0x0401:
- case 0x0501:
- case 0x0604:
- return FALSE;
- }
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Function to convert a standard device path structure into a Hi version.
-
- @param[in] DevicePath The device path to convert.
-
- @return the device path portion that is Hi.
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GetHIDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- UINTN NonHIDevicePathNodeCount;
- UINTN Index;
- EFI_DEV_PATH Node;
- EFI_DEVICE_PATH_PROTOCOL *HIDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;
-
- ASSERT(DevicePath != NULL);
-
- NonHIDevicePathNodeCount = 0;
-
- HIDevicePath = AllocateZeroPool (sizeof (EFI_DEVICE_PATH_PROTOCOL));
- SetDevicePathEndNode (HIDevicePath);
-
- Node.DevPath.Type = END_DEVICE_PATH_TYPE;
- Node.DevPath.SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE;
- Node.DevPath.Length[0] = (UINT8)sizeof (EFI_DEVICE_PATH_PROTOCOL);
- Node.DevPath.Length[1] = 0;
-
- while (!IsDevicePathEnd (DevicePath)) {
- if (IsHIDevicePathNode (DevicePath)) {
- for (Index = 0; Index < NonHIDevicePathNodeCount; Index++) {
- TempDevicePath = AppendDevicePathNode (HIDevicePath, &Node.DevPath);
- FreePool (HIDevicePath);
- HIDevicePath = TempDevicePath;
- }
-
- TempDevicePath = AppendDevicePathNode (HIDevicePath, DevicePath);
- FreePool (HIDevicePath);
- HIDevicePath = TempDevicePath;
- } else {
- NonHIDevicePathNodeCount++;
- }
- //
- // Next device path node
- //
- DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) NextDevicePathNode (DevicePath);
- }
-
- return HIDevicePath;
-}
-
-/**
- Function to walk the device path looking for a dumpable node.
-
- @param[in] MappingItem The Item to fill with data.
- @param[in] DevicePath The path of the item to get data on.
-
- @return EFI_SUCCESS Always returns success.
-**/
-EFI_STATUS
-EFIAPI
-GetDeviceConsistMappingInfo (
- IN DEVICE_CONSIST_MAPPING_INFO *MappingItem,
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- VOID (EFIAPI *SerialFun) (EFI_DEVICE_PATH_PROTOCOL *, DEVICE_CONSIST_MAPPING_INFO *);
-
- UINTN Index;
-
- ASSERT(DevicePath != NULL);
- ASSERT(MappingItem != NULL);
-
- SetMem (&MappingItem->Csd, sizeof (POOL_PRINT), 0);
-
- while (!IsDevicePathEnd (DevicePath)) {
- //
- // Find the handler to dump this device path node
- //
- SerialFun = NULL;
- for (Index = 0; DevPathConsistMappingTable[Index].SerialFun != NULL; Index += 1) {
-
- if (DevicePathType (DevicePath) == DevPathConsistMappingTable[Index].Type &&
- DevicePathSubType (DevicePath) == DevPathConsistMappingTable[Index].SubType
- ) {
- SerialFun = DevPathConsistMappingTable[Index].SerialFun;
- break;
- }
- }
- //
- // If not found, use a generic function
- //
- if (!SerialFun) {
- SerialFun = DevPathSerialDefault;
- }
-
- SerialFun (DevicePath, MappingItem);
-
- //
- // Next device path node
- //
- DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) NextDevicePathNode (DevicePath);
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Function to initialize the table for creating consistent map names.
-
- @param[out] Table The pointer to pointer to pointer to DevicePathProtocol object.
-
- @retval EFI_SUCCESS The table was created successfully.
-**/
-EFI_STATUS
-EFIAPI
-ShellCommandConsistMappingInitialize (
- OUT EFI_DEVICE_PATH_PROTOCOL ***Table
- )
-{
- EFI_HANDLE *HandleBuffer;
- UINTN HandleNum;
- UINTN HandleLoop;
- EFI_DEVICE_PATH_PROTOCOL **TempTable;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_DEVICE_PATH_PROTOCOL *HIDevicePath;
- UINTN Index;
- EFI_STATUS Status;
-
- HandleBuffer = NULL;
-
- Status = gBS->LocateHandleBuffer (
- AllHandles,
- NULL,
- NULL,
- &HandleNum,
- &HandleBuffer
- );
- ASSERT_EFI_ERROR(Status);
-
- TempTable = AllocateZeroPool ((HandleNum + 1) * sizeof (EFI_DEVICE_PATH_PROTOCOL *));
- if (TempTable == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- for (HandleLoop = 0 ; HandleLoop < HandleNum ; HandleLoop++) {
- DevicePath = DevicePathFromHandle (HandleBuffer[HandleLoop]);
- if (DevicePath == NULL) {
- continue;
- }
-
- HIDevicePath = GetHIDevicePath (DevicePath);
- if (HIDevicePath == NULL) {
- continue;
- }
-
- for (Index = 0; TempTable[Index] != NULL; Index++) {
- if (DevicePathCompare (&TempTable[Index], &HIDevicePath) == 0) {
- FreePool (HIDevicePath);
- break;
- }
- }
-
- if (TempTable[Index] == NULL) {
- TempTable[Index] = HIDevicePath;
- }
- }
-
- for (Index = 0; TempTable[Index] != NULL; Index++);
- PerformQuickSort(TempTable, Index, sizeof(EFI_DEVICE_PATH_PROTOCOL*), DevicePathCompare);
- *Table = TempTable;
-
- if (HandleBuffer != NULL) {
- FreePool (HandleBuffer);
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Function to uninitialize the table for creating consistent map names.
-
- The parameter must have been received from ShellCommandConsistMappingInitialize.
-
- @param[out] Table The pointer to pointer to DevicePathProtocol object.
-
- @retval EFI_SUCCESS The table was deleted successfully.
-**/
-EFI_STATUS
-EFIAPI
-ShellCommandConsistMappingUnInitialize (
- EFI_DEVICE_PATH_PROTOCOL **Table
- )
-{
- UINTN Index;
-
- ASSERT(Table != NULL);
-
- for (Index = 0; Table[Index] != NULL; Index++) {
- FreePool (Table[Index]);
- }
-
- FreePool (Table);
- return EFI_SUCCESS;
-}
-
-/**
- Create a consistent mapped name for the device specified by DevicePath
- based on the Table.
-
- This must be called after ShellCommandConsistMappingInitialize() and
- before ShellCommandConsistMappingUnInitialize() is called.
-
- @param[in] DevicePath The pointer to the dev path for the device.
- @param[in] Table The Table of mapping information.
-
- @retval NULL A consistent mapped name could not be created.
- @return A pointer to a string allocated from pool with the device name.
-**/
-CHAR16 *
-EFIAPI
-ShellCommandConsistMappingGenMappingName (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN EFI_DEVICE_PATH_PROTOCOL **Table
- )
-{
- POOL_PRINT Str;
- DEVICE_CONSIST_MAPPING_INFO MappingInfo;
- EFI_DEVICE_PATH_PROTOCOL *HIDevicePath;
- UINTN Index;
- UINTN NewSize;
-
- ASSERT(DevicePath != NULL);
- ASSERT(Table != NULL);
-
- HIDevicePath = GetHIDevicePath (DevicePath);
- if (HIDevicePath == NULL) {
- return NULL;
- }
-
- for (Index = 0; Table[Index] != NULL; Index++) {
- if (DevicePathCompare (&Table[Index], &HIDevicePath) == 0) {
- break;
- }
- }
-
- FreePool (HIDevicePath);
- if (Table[Index] == NULL) {
- return NULL;
- }
-
- MappingInfo.Hi = Index;
- MappingInfo.Mtd = MTDTypeUnknown;
- MappingInfo.Digital = FALSE;
-
- GetDeviceConsistMappingInfo (&MappingInfo, DevicePath);
-
- SetMem (&Str, sizeof (Str), 0);
- for (Index = 0; mMTDName[Index].MTDType != MTDTypeEnd; Index++) {
- if (MappingInfo.Mtd == mMTDName[Index].MTDType) {
- break;
- }
- }
-
- if (mMTDName[Index].MTDType != MTDTypeEnd) {
- CatPrint (&Str, L"%s", mMTDName[Index].Name);
- }
-
- CatPrint (&Str, L"%d", (UINTN) MappingInfo.Hi);
- if (MappingInfo.Csd.Str != NULL) {
- CatPrint (&Str, L"%s", MappingInfo.Csd.Str);
- FreePool (MappingInfo.Csd.Str);
- }
-
- if (Str.Str != NULL) {
- CatPrint (&Str, L":");
- }
-
- NewSize = (Str.Len + 1) * sizeof (CHAR16);
- Str.Str = ReallocatePool (Str.Len, NewSize, Str.Str);
- if (Str.Str == NULL) {
- return (NULL);
- }
- Str.Str[Str.Len] = CHAR_NULL;
- return Str.Str;
-}
-
-/**
- Function to search the list of mappings for the node on the list based on the key.
-
- @param[in] MapKey String Key to search for on the map
-
- @return the node on the list.
-**/
-SHELL_MAP_LIST *
-EFIAPI
-ShellCommandFindMapItem (
- IN CONST CHAR16 *MapKey
- )
-{
- SHELL_MAP_LIST *MapListItem;
-
- for ( MapListItem = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
- ; !IsNull(&gShellMapList.Link, &MapListItem->Link)
- ; MapListItem = (SHELL_MAP_LIST *)GetNextNode(&gShellMapList.Link, &MapListItem->Link)
- ){
- if (gUnicodeCollation->StriColl(gUnicodeCollation,MapListItem->MapName,(CHAR16*)MapKey) == 0) {
- return (MapListItem);
- }
- }
- return (NULL);
-}
-
-
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
deleted file mode 100644
index 75628f0137..0000000000
--- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
+++ /dev/null
@@ -1,1327 +0,0 @@
-/** @file
- Provides interface to shell internal functions for shell commands.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellCommandLib.h"
-
-/// The tag for use in identifying UNICODE files.
-/// If the file is UNICODE, the first 16 bits of the file will equal this value.
-enum {
- gUnicodeFileTag = 0xFEFF
-};
-
-// STATIC local variables
-STATIC SHELL_COMMAND_INTERNAL_LIST_ENTRY mCommandList;
-STATIC SCRIPT_FILE_LIST mScriptList;
-STATIC ALIAS_LIST mAliasList;
-STATIC BOOLEAN mEchoState;
-STATIC BOOLEAN mExitRequested;
-STATIC UINT64 mExitCode;
-STATIC BOOLEAN mExitScript;
-STATIC CHAR16 *mProfileList;
-STATIC UINTN mProfileListSize;
-STATIC UINTN mFsMaxCount = 0;
-STATIC UINTN mBlkMaxCount = 0;
-STATIC BUFFER_LIST mFileHandleList;
-
-// global variables required by library class.
-EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation = NULL;
-SHELL_MAP_LIST gShellMapList;
-SHELL_MAP_LIST *gShellCurDir = NULL;
-
-CONST CHAR16* SupportLevel[] = {
- L"Minimal",
- L"Scripting",
- L"Basic",
- L"Interactive"
-};
-
-/**
- Function to make sure that the global protocol pointers are valid.
- must be called after constructor before accessing the pointers.
-**/
-EFI_STATUS
-EFIAPI
-CommandInit(
- VOID
- )
-{
- EFI_STATUS Status;
- if (gUnicodeCollation == NULL) {
- Status = gBS->LocateProtocol(&gEfiUnicodeCollation2ProtocolGuid, NULL, (VOID**)&gUnicodeCollation);
- if (EFI_ERROR(Status)) {
- return (EFI_DEVICE_ERROR);
- }
- }
- return (EFI_SUCCESS);
-}
-
-/**
- Constructor for the Shell Command library.
-
- Initialize the library and determine if the underlying is a UEFI Shell 2.0 or an EFI shell.
-
- @param ImageHandle the image handle of the process
- @param SystemTable the EFI System Table pointer
-
- @retval EFI_SUCCESS the initialization was complete sucessfully
-**/
-RETURN_STATUS
-EFIAPI
-ShellCommandLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- InitializeListHead(&gShellMapList.Link);
- InitializeListHead(&mCommandList.Link);
- InitializeListHead(&mAliasList.Link);
- InitializeListHead(&mScriptList.Link);
- InitializeListHead(&mFileHandleList.Link);
- mEchoState = TRUE;
-
- mExitRequested = FALSE;
- mExitScript = FALSE;
- mProfileListSize = 0;
- mProfileList = NULL;
-
- if (gUnicodeCollation == NULL) {
- Status = gBS->LocateProtocol(&gEfiUnicodeCollation2ProtocolGuid, NULL, (VOID**)&gUnicodeCollation);
- if (EFI_ERROR(Status)) {
- return (EFI_DEVICE_ERROR);
- }
- }
-
- return (RETURN_SUCCESS);
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param ImageHandle the image handle of the process
- @param SystemTable the EFI System Table pointer
-
- @retval RETURN_SUCCESS this function always returns success
-**/
-RETURN_STATUS
-EFIAPI
-ShellCommandLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- SHELL_COMMAND_INTERNAL_LIST_ENTRY *Node;
- COMMAND_LIST *Node2;
- SCRIPT_FILE_LIST *Node3;
- SHELL_MAP_LIST *MapNode;
- //
- // enumerate throught the list and free all the memory
- //
- while (!IsListEmpty (&mCommandList.Link)) {
- Node = (SHELL_COMMAND_INTERNAL_LIST_ENTRY *)GetFirstNode(&mCommandList.Link);
- RemoveEntryList(&Node->Link);
- SHELL_FREE_NON_NULL(Node->CommandString);
- FreePool(Node);
- DEBUG_CODE(Node = NULL;);
- }
-
- //
- // enumerate through the init command list and free all memory
- //
- while (!IsListEmpty (&mAliasList.Link)) {
- Node2 = (COMMAND_LIST *)GetFirstNode(&mAliasList.Link);
- RemoveEntryList(&Node2->Link);
- SHELL_FREE_NON_NULL(Node2->CommandString);
- FreePool(Node2);
- DEBUG_CODE(Node2 = NULL;);
- }
-
- //
- // enumerate throught the list and free all the memory
- //
- while (!IsListEmpty (&mScriptList.Link)) {
- Node3 = (SCRIPT_FILE_LIST *)GetFirstNode(&mScriptList.Link);
- RemoveEntryList(&Node3->Link);
- DeleteScriptFileStruct(Node3->Data);
- FreePool(Node3);
- }
-
- //
- // enumerate throught the mappings list and free all the memory
- //
- if (!IsListEmpty(&gShellMapList.Link)) {
- for (MapNode = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
- ; !IsListEmpty (&gShellMapList.Link)
- ; MapNode = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
- ){
- ASSERT(MapNode != NULL);
- RemoveEntryList(&MapNode->Link);
- SHELL_FREE_NON_NULL(MapNode->DevicePath);
- SHELL_FREE_NON_NULL(MapNode->MapName);
- SHELL_FREE_NON_NULL(MapNode->CurrentDirectoryPath);
- FreePool(MapNode);
- }
- }
- if (!IsListEmpty(&mFileHandleList.Link)){
- FreeBufferList(&mFileHandleList);
- }
-
- if (mProfileList != NULL) {
- FreePool(mProfileList);
- }
-
- gUnicodeCollation = NULL;
- gShellCurDir = NULL;
-
- return (RETURN_SUCCESS);
-}
-
-/**
- Checks if a command is already on the list.
-
- @param[in] CommandString The command string to check for on the list.
-**/
-BOOLEAN
-EFIAPI
-ShellCommandIsCommandOnList (
- IN CONST CHAR16 *CommandString
- )
-{
- SHELL_COMMAND_INTERNAL_LIST_ENTRY *Node;
-
- //
- // assert for NULL parameter
- //
- ASSERT(CommandString != NULL);
-
- //
- // check for the command
- //
- for ( Node = (SHELL_COMMAND_INTERNAL_LIST_ENTRY *)GetFirstNode(&mCommandList.Link)
- ; !IsNull(&mCommandList.Link, &Node->Link)
- ; Node = (SHELL_COMMAND_INTERNAL_LIST_ENTRY *)GetNextNode(&mCommandList.Link, &Node->Link)
- ){
- ASSERT(Node->CommandString != NULL);
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)CommandString,
- Node->CommandString) == 0
- ){
- return (TRUE);
- }
- }
- return (FALSE);
-}
-
-/**
- Get the help text for a command.
-
- @param[in] CommandString The command name.
-
- @retval NULL No help text was found.
- @return String of help text. Caller reuiqred to free.
-**/
-CHAR16*
-EFIAPI
-ShellCommandGetCommandHelp (
- IN CONST CHAR16 *CommandString
- )
-{
- SHELL_COMMAND_INTERNAL_LIST_ENTRY *Node;
-
- //
- // assert for NULL parameter
- //
- ASSERT(CommandString != NULL);
-
- //
- // check for the command
- //
- for ( Node = (SHELL_COMMAND_INTERNAL_LIST_ENTRY *)GetFirstNode(&mCommandList.Link)
- ; !IsNull(&mCommandList.Link, &Node->Link)
- ; Node = (SHELL_COMMAND_INTERNAL_LIST_ENTRY *)GetNextNode(&mCommandList.Link, &Node->Link)
- ){
- ASSERT(Node->CommandString != NULL);
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)CommandString,
- Node->CommandString) == 0
- ){
- return (HiiGetString(Node->HiiHandle, Node->ManFormatHelp, NULL));
- }
- }
- return (NULL);
-}
-
-/**
- Registers handlers of type SHELL_RUN_COMMAND and
- SHELL_GET_MAN_FILENAME for each shell command.
-
- If the ShellSupportLevel is greater than the value of the
- PcdShellSupportLevel then return RETURN_UNSUPPORTED.
-
- Registers the handlers specified by GetHelpInfoHandler and CommandHandler
- with the command specified by CommandString. If the command named by
- CommandString has already been registered, then return
- RETURN_ALREADY_STARTED.
-
- If there are not enough resources available to register the handlers then
- RETURN_OUT_OF_RESOURCES is returned.
-
- If CommandString is NULL, then ASSERT().
- If GetHelpInfoHandler is NULL, then ASSERT().
- If CommandHandler is NULL, then ASSERT().
- If ProfileName is NULL, then ASSERT().
-
- @param[in] CommandString Pointer to the command name. This is the
- name to look for on the command line in
- the shell.
- @param[in] CommandHandler Pointer to a function that runs the
- specified command.
- @param[in] GetManFileName Pointer to a function that provides man
- filename.
- @param[in] ShellMinSupportLevel minimum Shell Support Level which has this
- function.
- @param[in] ProfileName profile name to require for support of this
- function.
- @param[in] CanAffectLE indicates whether this command's return value
- can change the LASTERROR environment variable.
- @param[in] HiiHandle Handle of this command's HII entry.
- @param[in] ManFormatHelp HII locator for the help text.
-
- @retval RETURN_SUCCESS The handlers were registered.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to
- register the shell command.
- @retval RETURN_UNSUPPORTED the ShellMinSupportLevel was higher than the
- currently allowed support level.
- @retval RETURN_ALREADY_STARTED The CommandString represents a command that
- is already registered. Only 1 handler set for
- a given command is allowed.
- @sa SHELL_GET_MAN_FILENAME
- @sa SHELL_RUN_COMMAND
-**/
-RETURN_STATUS
-EFIAPI
-ShellCommandRegisterCommandName (
- IN CONST CHAR16 *CommandString,
- IN SHELL_RUN_COMMAND CommandHandler,
- IN SHELL_GET_MAN_FILENAME GetManFileName,
- IN UINT32 ShellMinSupportLevel,
- IN CONST CHAR16 *ProfileName,
- IN CONST BOOLEAN CanAffectLE,
- IN CONST EFI_HANDLE HiiHandle,
- IN CONST EFI_STRING_ID ManFormatHelp
- )
-{
- SHELL_COMMAND_INTERNAL_LIST_ENTRY *Node;
-
- //
- // ASSERTs for NULL parameters
- //
- ASSERT(CommandString != NULL);
- ASSERT(GetManFileName != NULL);
- ASSERT(CommandHandler != NULL);
- ASSERT(ProfileName != NULL);
-
- //
- // check for shell support level
- //
- if (PcdGet8(PcdShellSupportLevel) < ShellMinSupportLevel) {
- return (RETURN_UNSUPPORTED);
- }
-
- //
- // check for already on the list
- //
- if (ShellCommandIsCommandOnList(CommandString)) {
- return (RETURN_ALREADY_STARTED);
- }
-
- //
- // allocate memory for new struct
- //
- Node = AllocateZeroPool(sizeof(SHELL_COMMAND_INTERNAL_LIST_ENTRY));
- ASSERT(Node != NULL);
- Node->CommandString = AllocateZeroPool(StrSize(CommandString));
- ASSERT(Node->CommandString != NULL);
-
- //
- // populate the new struct
- //
- StrCpy(Node->CommandString, CommandString);
-
- Node->GetManFileName = GetManFileName;
- Node->CommandHandler = CommandHandler;
- Node->LastError = CanAffectLE;
- Node->HiiHandle = HiiHandle;
- Node->ManFormatHelp = ManFormatHelp;
-
- if ( StrLen(ProfileName)>0
- && ((mProfileList != NULL
- && StrStr(mProfileList, ProfileName) == NULL) || mProfileList == NULL)
- ){
- ASSERT((mProfileList == NULL && mProfileListSize == 0) || (mProfileList != NULL));
- if (mProfileList == NULL) {
- //
- // If this is the first make a leading ';'
- //
- StrnCatGrow(&mProfileList, &mProfileListSize, L";", 0);
- }
- StrnCatGrow(&mProfileList, &mProfileListSize, ProfileName, 0);
- StrnCatGrow(&mProfileList, &mProfileListSize, L";", 0);
- }
-
- //
- // add the new struct to the list
- //
- InsertTailList (&mCommandList.Link, &Node->Link);
-
- return (RETURN_SUCCESS);
-}
-
-/**
- Function to get the current Profile string.
-
- @retval NULL There are no installed profiles.
- @return A semi-colon delimited list of profiles.
-**/
-CONST CHAR16 *
-EFIAPI
-ShellCommandGetProfileList (
- VOID
- )
-{
- return (mProfileList);
-}
-
-/**
- Checks if a command string has been registered for CommandString and if so it runs
- the previously registered handler for that command with the command line.
-
- If CommandString is NULL, then ASSERT().
-
- If Sections is specified, then each section name listed will be compared in a casesensitive
- manner, to the section names described in Appendix B UEFI Shell 2.0 spec. If the section exists,
- it will be appended to the returned help text. If the section does not exist, no
- information will be returned. If Sections is NULL, then all help text information
- available will be returned.
-
- @param[in] CommandString Pointer to the command name. This is the name
- found on the command line in the shell.
- @param[in, out] RetVal Pointer to the return vaule from the command handler.
-
- @param[in, out] CanAffectLE indicates whether this command's return value
- needs to be placed into LASTERROR environment variable.
-
- @retval RETURN_SUCCESS The handler was run.
- @retval RETURN_NOT_FOUND The CommandString did not match a registered
- command name.
- @sa SHELL_RUN_COMMAND
-**/
-RETURN_STATUS
-EFIAPI
-ShellCommandRunCommandHandler (
- IN CONST CHAR16 *CommandString,
- IN OUT SHELL_STATUS *RetVal,
- IN OUT BOOLEAN *CanAffectLE OPTIONAL
- )
-{
- SHELL_COMMAND_INTERNAL_LIST_ENTRY *Node;
-
- //
- // assert for NULL parameters
- //
- ASSERT(CommandString != NULL);
-
- //
- // check for the command
- //
- for ( Node = (SHELL_COMMAND_INTERNAL_LIST_ENTRY *)GetFirstNode(&mCommandList.Link)
- ; !IsNull(&mCommandList.Link, &Node->Link)
- ; Node = (SHELL_COMMAND_INTERNAL_LIST_ENTRY *)GetNextNode(&mCommandList.Link, &Node->Link)
- ){
- ASSERT(Node->CommandString != NULL);
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)CommandString,
- Node->CommandString) == 0
- ){
- if (CanAffectLE != NULL) {
- *CanAffectLE = Node->LastError;
- }
- if (RetVal != NULL) {
- *RetVal = Node->CommandHandler(NULL, gST);
- } else {
- Node->CommandHandler(NULL, gST);
- }
- return (RETURN_SUCCESS);
- }
- }
- return (RETURN_NOT_FOUND);
-}
-
-/**
- Checks if a command string has been registered for CommandString and if so it
- returns the MAN filename specified for that command.
-
- If CommandString is NULL, then ASSERT().
-
- @param[in] CommandString Pointer to the command name. This is the name
- found on the command line in the shell.\
-
- @retval NULL the commandString was not a registered command.
- @return other the name of the MAN file.
- @sa SHELL_GET_MAN_FILENAME
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandGetManFileNameHandler (
- IN CONST CHAR16 *CommandString
- )
-{
- SHELL_COMMAND_INTERNAL_LIST_ENTRY *Node;
-
- //
- // assert for NULL parameters
- //
- ASSERT(CommandString != NULL);
-
- //
- // check for the command
- //
- for ( Node = (SHELL_COMMAND_INTERNAL_LIST_ENTRY *)GetFirstNode(&mCommandList.Link)
- ; !IsNull(&mCommandList.Link, &Node->Link)
- ; Node = (SHELL_COMMAND_INTERNAL_LIST_ENTRY *)GetNextNode(&mCommandList.Link, &Node->Link)
- ){
- ASSERT(Node->CommandString != NULL);
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)CommandString,
- Node->CommandString) == 0
- ){
- return (Node->GetManFileName());
- }
- }
- return (NULL);
-}
-
-/**
- Get the list of all available shell internal commands. This is a linked list
- (via LIST_ENTRY structure). enumerate through it using the BaseLib linked
- list functions. do not modify the values.
-
- @param[in] Sort TRUE to alphabetically sort the values first. FALSE otherwise.
-
- @return a Linked list of all available shell commands.
-**/
-CONST COMMAND_LIST*
-EFIAPI
-ShellCommandGetCommandList (
- IN CONST BOOLEAN Sort
- )
-{
-// if (!Sort) {
-// return ((COMMAND_LIST*)(&mCommandList));
-// }
- return ((COMMAND_LIST*)(&mCommandList));
-}
-
-/**
- Registers aliases to be set as part of the initialization of the shell application.
-
- If Command is NULL, then ASSERT().
- If Alias is NULL, then ASSERT().
-
- @param[in] Command Pointer to the Command
- @param[in] Alias Pointer to Alias
-
- @retval RETURN_SUCCESS The handlers were registered.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to
- register the shell command.
-**/
-RETURN_STATUS
-EFIAPI
-ShellCommandRegisterAlias (
- IN CONST CHAR16 *Command,
- IN CONST CHAR16 *Alias
- )
-{
- ALIAS_LIST *Node;
-
- //
- // Asserts for NULL
- //
- ASSERT(Command != NULL);
- ASSERT(Alias != NULL);
-
- //
- // allocate memory for new struct
- //
- Node = AllocateZeroPool(sizeof(ALIAS_LIST));
- ASSERT(Node != NULL);
- Node->CommandString = AllocateZeroPool(StrSize(Command));
- Node->Alias = AllocateZeroPool(StrSize(Alias));
- ASSERT(Node->CommandString != NULL);
- ASSERT(Node->Alias != NULL);
-
- //
- // populate the new struct
- //
- StrCpy(Node->CommandString, Command);
- StrCpy(Node->Alias , Alias );
-
- //
- // add the new struct to the list
- //
- InsertTailList (&mAliasList.Link, &Node->Link);
-
- return (RETURN_SUCCESS);
-}
-
-/**
- Get the list of all shell alias commands. This is a linked list
- (via LIST_ENTRY structure). enumerate through it using the BaseLib linked
- list functions. do not modify the values.
-
- @return a Linked list of all requested shell alias'.
-**/
-CONST ALIAS_LIST*
-EFIAPI
-ShellCommandGetInitAliasList (
- VOID
- )
-{
- return (&mAliasList);
-}
-
-/**
- Determine if a given alias is on the list of built in alias'.
-
- @param[in] Alias The alias to test for
-
- @retval TRUE The alias is a built in alias
- @retval FALSE The alias is not a built in alias
-**/
-BOOLEAN
-EFIAPI
-ShellCommandIsOnAliasList(
- IN CONST CHAR16 *Alias
- )
-{
- ALIAS_LIST *Node;
-
- //
- // assert for NULL parameter
- //
- ASSERT(Alias != NULL);
-
- //
- // check for the Alias
- //
- for ( Node = (ALIAS_LIST *)GetFirstNode(&mAliasList.Link)
- ; !IsNull(&mAliasList.Link, &Node->Link)
- ; Node = (ALIAS_LIST *)GetNextNode(&mAliasList.Link, &Node->Link)
- ){
- ASSERT(Node->CommandString != NULL);
- ASSERT(Node->Alias != NULL);
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)Alias,
- Node->CommandString) == 0
- ){
- return (TRUE);
- }
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)Alias,
- Node->Alias) == 0
- ){
- return (TRUE);
- }
- }
- return (FALSE);
-}
-
-/**
- Function to determine current state of ECHO. Echo determins if lines from scripts
- and ECHO commands are enabled.
-
- @retval TRUE Echo is currently enabled
- @retval FALSE Echo is currently disabled
-**/
-BOOLEAN
-EFIAPI
-ShellCommandGetEchoState(
- VOID
- )
-{
- return (mEchoState);
-}
-
-/**
- Function to set current state of ECHO. Echo determins if lines from scripts
- and ECHO commands are enabled.
-
- If State is TRUE, Echo will be enabled.
- If State is FALSE, Echo will be disabled.
-
- @param[in] State How to set echo.
-**/
-VOID
-EFIAPI
-ShellCommandSetEchoState(
- IN BOOLEAN State
- )
-{
- mEchoState = State;
-}
-
-/**
- Indicate that the current shell or script should exit.
-
- @param[in] ScriptOnly TRUE if exiting a script; FALSE otherwise.
- @param[in] ErrorCode The 64 bit error code to return.
-**/
-VOID
-EFIAPI
-ShellCommandRegisterExit (
- IN BOOLEAN ScriptOnly,
- IN CONST UINT64 ErrorCode
- )
-{
- mExitRequested = (BOOLEAN)(!mExitRequested);
- if (mExitRequested) {
- mExitScript = ScriptOnly;
- } else {
- mExitScript = FALSE;
- }
- mExitCode = ErrorCode;
-}
-
-/**
- Retrieve the Exit indicator.
-
- @retval TRUE Exit was indicated.
- @retval FALSE Exis was not indicated.
-**/
-BOOLEAN
-EFIAPI
-ShellCommandGetExit (
- VOID
- )
-{
- return (mExitRequested);
-}
-
-/**
- Retrieve the Exit code.
-
- If ShellCommandGetExit returns FALSE than the return from this is undefined.
-
- @return the value passed into RegisterExit.
-**/
-UINT64
-EFIAPI
-ShellCommandGetExitCode (
- VOID
- )
-{
- return (mExitCode);
-}
-/**
- Retrieve the Exit script indicator.
-
- If ShellCommandGetExit returns FALSE than the return from this is undefined.
-
- @retval TRUE ScriptOnly was indicated.
- @retval FALSE ScriptOnly was not indicated.
-**/
-BOOLEAN
-EFIAPI
-ShellCommandGetScriptExit (
- VOID
- )
-{
- return (mExitScript);
-}
-
-/**
- Function to cleanup all memory from a SCRIPT_FILE structure.
-
- @param[in] Script The pointer to the structure to cleanup.
-**/
-VOID
-EFIAPI
-DeleteScriptFileStruct (
- IN SCRIPT_FILE *Script
- )
-{
- UINT8 LoopVar;
-
- if (Script == NULL) {
- return;
- }
-
- for (LoopVar = 0 ; LoopVar < Script->Argc ; LoopVar++) {
- SHELL_FREE_NON_NULL(Script->Argv[LoopVar]);
- }
- if (Script->Argv != NULL) {
- SHELL_FREE_NON_NULL(Script->Argv);
- }
- Script->CurrentCommand = NULL;
- while (!IsListEmpty (&Script->CommandList)) {
- Script->CurrentCommand = (SCRIPT_COMMAND_LIST *)GetFirstNode(&Script->CommandList);
- if (Script->CurrentCommand != NULL) {
- RemoveEntryList(&Script->CurrentCommand->Link);
- if (Script->CurrentCommand->Cl != NULL) {
- SHELL_FREE_NON_NULL(Script->CurrentCommand->Cl);
- }
- if (Script->CurrentCommand->Data != NULL) {
- SHELL_FREE_NON_NULL(Script->CurrentCommand->Data);
- }
- SHELL_FREE_NON_NULL(Script->CurrentCommand);
- }
- }
- SHELL_FREE_NON_NULL(Script->ScriptName);
- SHELL_FREE_NON_NULL(Script);
-}
-
-/**
- Function to return a pointer to the currently running script file object.
-
- @retval NULL A script file is not currently running.
- @return A pointer to the current script file object.
-**/
-SCRIPT_FILE*
-EFIAPI
-ShellCommandGetCurrentScriptFile (
- VOID
- )
-{
- SCRIPT_FILE_LIST *List;
- if (IsListEmpty (&mScriptList.Link)) {
- return (NULL);
- }
- List = ((SCRIPT_FILE_LIST*)GetFirstNode(&mScriptList.Link));
- return (List->Data);
-}
-
-/**
- Function to set a new script as the currently running one.
-
- This function will correctly stack and unstack nested scripts.
-
- @param[in] Script Pointer to new script information structure. if NULL
- will remove and de-allocate the top-most Script structure.
-
- @return A pointer to the current running script file after this
- change. NULL if removing the final script.
-**/
-SCRIPT_FILE*
-EFIAPI
-ShellCommandSetNewScript (
- IN SCRIPT_FILE *Script OPTIONAL
- )
-{
- SCRIPT_FILE_LIST *Node;
- if (Script == NULL) {
- if (IsListEmpty (&mScriptList.Link)) {
- return (NULL);
- }
- Node = (SCRIPT_FILE_LIST *)GetFirstNode(&mScriptList.Link);
- RemoveEntryList(&Node->Link);
- DeleteScriptFileStruct(Node->Data);
- FreePool(Node);
- } else {
- Node = AllocateZeroPool(sizeof(SCRIPT_FILE_LIST));
- if (Node == NULL) {
- return (NULL);
- }
- Node->Data = Script;
- InsertHeadList(&mScriptList.Link, &Node->Link);
- }
- return (ShellCommandGetCurrentScriptFile());
-}
-
-/**
- Function to generate the next default mapping name.
-
- If the return value is not NULL then it must be callee freed.
-
- @param Type What kind of mapping name to make.
-
- @retval NULL a memory allocation failed.
- @return a new map name string
-**/
-CHAR16*
-EFIAPI
-ShellCommandCreateNewMappingName(
- IN CONST SHELL_MAPPING_TYPE Type
- )
-{
- CHAR16 *String;
- ASSERT(Type < MappingTypeMax);
-
- String = NULL;
-
- String = AllocateZeroPool(PcdGet8(PcdShellMapNameLength) * sizeof(String[0]));
- UnicodeSPrint(
- String,
- PcdGet8(PcdShellMapNameLength) * sizeof(String[0]),
- Type == MappingTypeFileSystem?L"FS%d:":L"BLK%d:",
- Type == MappingTypeFileSystem?mFsMaxCount++:mBlkMaxCount++);
-
- return (String);
-}
-
-/**
- Function to add a map node to the list of map items and update the "path" environment variable (optionally).
-
- If Path is TRUE (during initialization only), the path environment variable will also be updated to include
- default paths on the new map name...
-
- Path should be FALSE when this function is called from the protocol SetMap function.
-
- @param[in] Name The human readable mapped name.
- @param[in] DevicePath The Device Path for this map.
- @param[in] Flags The Flags attribute for this map item.
- @param[in] Path TRUE to update path, FALSE to skip this step (should only be TRUE during initialization).
-
- @retval EFI_SUCCESS The addition was sucessful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
-**/
-EFI_STATUS
-EFIAPI
-ShellCommandAddMapItemAndUpdatePath(
- IN CONST CHAR16 *Name,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN CONST UINT64 Flags,
- IN CONST BOOLEAN Path
- )
-{
- EFI_STATUS Status;
- SHELL_MAP_LIST *MapListNode;
- CONST CHAR16 *OriginalPath;
- CHAR16 *NewPath;
- UINTN NewPathSize;
-
- NewPathSize = 0;
- NewPath = NULL;
- OriginalPath = NULL;
- Status = EFI_SUCCESS;
-
- MapListNode = AllocateZeroPool(sizeof(SHELL_MAP_LIST));
- if (MapListNode == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- MapListNode->Flags = Flags;
- MapListNode->MapName = AllocateZeroPool(StrSize(Name));
- MapListNode->DevicePath = DuplicateDevicePath(DevicePath);
- if ((MapListNode->MapName == NULL) || (MapListNode->DevicePath == NULL)){
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- StrCpy(MapListNode->MapName, Name);
- InsertTailList(&gShellMapList.Link, &MapListNode->Link);
- }
- }
- if (EFI_ERROR(Status)) {
- if (MapListNode != NULL) {
- if (MapListNode->DevicePath != NULL) {
- FreePool(MapListNode->DevicePath);
- }
- if (MapListNode->MapName != NULL) {
- FreePool(MapListNode->MapName);
- }
- FreePool(MapListNode);
- }
- } else if (Path) {
- //
- // Since there was no error and Path was TRUE
- // Now add the correct path for that mapping
- //
- OriginalPath = gEfiShellProtocol->GetEnv(L"path");
- ASSERT((NewPath == NULL && NewPathSize == 0) || (NewPath != NULL));
- if (OriginalPath != NULL) {
- StrnCatGrow(&NewPath, &NewPathSize, OriginalPath, 0);
- } else {
- StrnCatGrow(&NewPath, &NewPathSize, L".\\", 0);
- }
- StrnCatGrow(&NewPath, &NewPathSize, L";", 0);
- StrnCatGrow(&NewPath, &NewPathSize, Name, 0);
- StrnCatGrow(&NewPath, &NewPathSize, L"\\efi\\tools\\;", 0);
- StrnCatGrow(&NewPath, &NewPathSize, Name, 0);
- StrnCatGrow(&NewPath, &NewPathSize, L"\\efi\\boot\\;", 0);
- StrnCatGrow(&NewPath, &NewPathSize, Name, 0);
- StrnCatGrow(&NewPath, &NewPathSize, L"\\", 0);
-
- Status = gEfiShellProtocol->SetEnv(L"path", NewPath, TRUE);
- ASSERT_EFI_ERROR(Status);
- FreePool(NewPath);
- }
- return (Status);
-}
-
-/**
- Creates the default map names for each device path in the system with
- a protocol depending on the Type.
-
- Creates the consistent map names for each device path in the system with
- a protocol depending on the Type.
-
- Note: This will reset all mappings in the system("map -r").
-
- Also sets up the default path environment variable if Type is FileSystem.
-
- @retval EFI_SUCCESS All map names were created sucessfully.
- @retval EFI_NOT_FOUND No protocols were found in the system.
- @return Error returned from gBS->LocateHandle().
-
- @sa LocateHandle
-**/
-EFI_STATUS
-EFIAPI
-ShellCommandCreateInitialMappingsAndPaths(
- VOID
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *HandleList;
- UINTN Count;
- EFI_DEVICE_PATH_PROTOCOL **DevicePathList;
- CHAR16 *NewDefaultName;
- CHAR16 *NewConsistName;
- EFI_DEVICE_PATH_PROTOCOL **ConsistMappingTable;
- SHELL_MAP_LIST *MapListNode;
-
- HandleList = NULL;
-
- //
- // Reset the static members back to zero
- //
- mFsMaxCount = 0;
- mBlkMaxCount = 0;
-
- gEfiShellProtocol->SetEnv(L"path", L"", TRUE);
-
- //
- // First empty out the existing list.
- //
- if (!IsListEmpty(&gShellMapList.Link)) {
- for ( MapListNode = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
- ; !IsListEmpty(&gShellMapList.Link)
- ; MapListNode = (SHELL_MAP_LIST *)GetFirstNode(&gShellMapList.Link)
- ){
- RemoveEntryList(&MapListNode->Link);
- FreePool(MapListNode);
- } // for loop
- }
-
- //
- // Find each handle with Simple File System
- //
- HandleList = GetHandleListByProtocol(&gEfiSimpleFileSystemProtocolGuid);
- if (HandleList != NULL) {
- //
- // Do a count of the handles
- //
- for (Count = 0 ; HandleList[Count] != NULL ; Count++);
-
- //
- // Get all Device Paths
- //
- DevicePathList = AllocateZeroPool(sizeof(EFI_DEVICE_PATH_PROTOCOL*) * Count);
- ASSERT(DevicePathList != NULL);
-
- for (Count = 0 ; HandleList[Count] != NULL ; Count++) {
- DevicePathList[Count] = DevicePathFromHandle(HandleList[Count]);
- }
-
- //
- // Sort all DevicePaths
- //
- PerformQuickSort(DevicePathList, Count, sizeof(EFI_DEVICE_PATH_PROTOCOL*), DevicePathCompare);
-
- ShellCommandConsistMappingInitialize(&ConsistMappingTable);
- //
- // Assign new Mappings to all...
- //
- for (Count = 0 ; HandleList[Count] != NULL ; Count++) {
- //
- // Get default name first
- //
- NewDefaultName = ShellCommandCreateNewMappingName(MappingTypeFileSystem);
- ASSERT(NewDefaultName != NULL);
- Status = ShellCommandAddMapItemAndUpdatePath(NewDefaultName, DevicePathList[Count], 0, TRUE);
- ASSERT_EFI_ERROR(Status);
- FreePool(NewDefaultName);
-
- //
- // Now do consistent name
- //
- NewConsistName = ShellCommandConsistMappingGenMappingName(DevicePathList[Count], ConsistMappingTable);
- if (NewConsistName != NULL) {
- Status = ShellCommandAddMapItemAndUpdatePath(NewConsistName, DevicePathList[Count], 0, FALSE);
- ASSERT_EFI_ERROR(Status);
- FreePool(NewConsistName);
- }
- }
-
- ShellCommandConsistMappingUnInitialize(ConsistMappingTable);
-
- SHELL_FREE_NON_NULL(HandleList);
- SHELL_FREE_NON_NULL(DevicePathList);
-
- HandleList = NULL;
- } else {
- Count = (UINTN)-1;
- }
-
- //
- // Find each handle with Block Io
- //
- HandleList = GetHandleListByProtocol(&gEfiBlockIoProtocolGuid);
- if (HandleList != NULL) {
- for (Count = 0 ; HandleList[Count] != NULL ; Count++);
-
- //
- // Get all Device Paths
- //
- DevicePathList = AllocateZeroPool(sizeof(EFI_DEVICE_PATH_PROTOCOL*) * Count);
- ASSERT(DevicePathList != NULL);
-
- for (Count = 0 ; HandleList[Count] != NULL ; Count++) {
- DevicePathList[Count] = DevicePathFromHandle(HandleList[Count]);
- }
-
- //
- // Sort all DevicePaths
- //
- PerformQuickSort(DevicePathList, Count, sizeof(EFI_DEVICE_PATH_PROTOCOL*), DevicePathCompare);
-
- //
- // Assign new Mappings to all...
- //
- for (Count = 0 ; HandleList[Count] != NULL ; Count++) {
- //
- // Get default name first
- //
- NewDefaultName = ShellCommandCreateNewMappingName(MappingTypeBlockIo);
- ASSERT(NewDefaultName != NULL);
- Status = ShellCommandAddMapItemAndUpdatePath(NewDefaultName, DevicePathList[Count], 0, FALSE);
- ASSERT_EFI_ERROR(Status);
- FreePool(NewDefaultName);
- }
-
- SHELL_FREE_NON_NULL(HandleList);
- SHELL_FREE_NON_NULL(DevicePathList);
- } else if (Count == (UINTN)-1) {
- return (EFI_NOT_FOUND);
- }
-
- return (EFI_SUCCESS);
-}
-
-/**
- Converts a SHELL_FILE_HANDLE to an EFI_FILE_PROTOCOL*.
-
- @param[in] Handle The SHELL_FILE_HANDLE to convert.
-
- @return a EFI_FILE_PROTOCOL* representing the same file.
-**/
-EFI_FILE_PROTOCOL*
-EFIAPI
-ConvertShellHandleToEfiFileProtocol(
- IN CONST SHELL_FILE_HANDLE Handle
- )
-{
- return ((EFI_FILE_PROTOCOL*)(Handle));
-}
-
-/**
- Converts a EFI_FILE_PROTOCOL* to an SHELL_FILE_HANDLE.
-
- @param[in] Handle The pointer to EFI_FILE_PROTOCOL to convert.
- @param[in] Path The path to the file for verification.
-
- @return A SHELL_FILE_HANDLE representing the same file.
- @retval NULL There was not enough memory.
-**/
-SHELL_FILE_HANDLE
-EFIAPI
-ConvertEfiFileProtocolToShellHandle(
- IN CONST EFI_FILE_PROTOCOL *Handle,
- IN CONST CHAR16 *Path
- )
-{
- SHELL_COMMAND_FILE_HANDLE *Buffer;
- BUFFER_LIST *NewNode;
-
- if (Path != NULL) {
- Buffer = AllocateZeroPool(sizeof(SHELL_COMMAND_FILE_HANDLE));
- if (Buffer == NULL) {
- return (NULL);
- }
- NewNode = AllocateZeroPool(sizeof(BUFFER_LIST));
- if (NewNode == NULL) {
- return (NULL);
- }
- Buffer->FileHandle = (EFI_FILE_PROTOCOL*)Handle;
- Buffer->Path = StrnCatGrow(&Buffer->Path, NULL, Path, 0);
- if (Buffer->Path == NULL) {
- return (NULL);
- }
- NewNode->Buffer = Buffer;
-
- InsertHeadList(&mFileHandleList.Link, &NewNode->Link);
- }
- return ((SHELL_FILE_HANDLE)(Handle));
-}
-
-/**
- Find the path that was logged with the specified SHELL_FILE_HANDLE.
-
- @param[in] Handle The SHELL_FILE_HANDLE to query on.
-
- @return A pointer to the path for the file.
-**/
-CONST CHAR16*
-EFIAPI
-ShellFileHandleGetPath(
- IN CONST SHELL_FILE_HANDLE Handle
- )
-{
- BUFFER_LIST *Node;
-
- for (Node = (BUFFER_LIST*)GetFirstNode(&mFileHandleList.Link)
- ; !IsNull(&mFileHandleList.Link, &Node->Link)
- ; Node = (BUFFER_LIST*)GetNextNode(&mFileHandleList.Link, &Node->Link)
- ){
- if ((Node->Buffer) && (((SHELL_COMMAND_FILE_HANDLE *)Node->Buffer)->FileHandle == Handle)){
- return (((SHELL_COMMAND_FILE_HANDLE *)Node->Buffer)->Path);
- }
- }
- return (NULL);
-}
-
-/**
- Remove a SHELL_FILE_HANDLE from the list of SHELL_FILE_HANDLES.
-
- @param[in] Handle The SHELL_FILE_HANDLE to remove.
-
- @retval TRUE The item was removed.
- @retval FALSE The item was not found.
-**/
-BOOLEAN
-EFIAPI
-ShellFileHandleRemove(
- IN CONST SHELL_FILE_HANDLE Handle
- )
-{
- BUFFER_LIST *Node;
-
- for (Node = (BUFFER_LIST*)GetFirstNode(&mFileHandleList.Link)
- ; !IsNull(&mFileHandleList.Link, &Node->Link)
- ; Node = (BUFFER_LIST*)GetNextNode(&mFileHandleList.Link, &Node->Link)
- ){
- if ((Node->Buffer) && (((SHELL_COMMAND_FILE_HANDLE *)Node->Buffer)->FileHandle == Handle)){
- RemoveEntryList(&Node->Link);
- SHELL_FREE_NON_NULL(((SHELL_COMMAND_FILE_HANDLE *)Node->Buffer)->Path);
- SHELL_FREE_NON_NULL(Node->Buffer);
- SHELL_FREE_NON_NULL(Node);
- return (TRUE);
- }
- }
- return (FALSE);
-}
-
-/**
- Function to determine if a SHELL_FILE_HANDLE is at the end of the file.
-
- This will NOT work on directories.
-
- If Handle is NULL, then ASSERT.
-
- @param[in] Handle the file handle
-
- @retval TRUE the position is at the end of the file
- @retval FALSE the position is not at the end of the file
-**/
-BOOLEAN
-EFIAPI
-ShellFileHandleEof(
- IN SHELL_FILE_HANDLE Handle
- )
-{
- EFI_FILE_INFO *Info;
- UINT64 Pos;
- BOOLEAN RetVal;
-
- //
- // ASSERT if Handle is NULL
- //
- ASSERT(Handle != NULL);
-
- gEfiShellProtocol->GetFilePosition(Handle, &Pos);
- Info = gEfiShellProtocol->GetFileInfo (Handle);
- ASSERT(Info != NULL);
- gEfiShellProtocol->SetFilePosition(Handle, Pos);
-
- if (Info == NULL) {
- return (FALSE);
- }
-
- if (Pos == Info->FileSize) {
- RetVal = TRUE;
- } else {
- RetVal = FALSE;
- }
-
- FreePool (Info);
-
- return (RetVal);
-}
-
-/**
- Frees any BUFFER_LIST defined type.
-
- @param[in] List The BUFFER_LIST object to free.
-**/
-VOID
-EFIAPI
-FreeBufferList (
- IN BUFFER_LIST *List
- )
-{
- BUFFER_LIST *BufferListEntry;
-
- if (List == NULL){
- return;
- }
- //
- // enumerate through the buffer list and free all memory
- //
- for ( BufferListEntry = ( BUFFER_LIST *)GetFirstNode(&List->Link)
- ; !IsListEmpty (&List->Link)
- ; BufferListEntry = (BUFFER_LIST *)GetFirstNode(&List->Link)
- ){
- RemoveEntryList(&BufferListEntry->Link);
- ASSERT(BufferListEntry->Buffer != NULL);
- if (BufferListEntry->Buffer != NULL) {
- FreePool(BufferListEntry->Buffer);
- }
- FreePool(BufferListEntry);
- }
-}
-
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.h b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.h
deleted file mode 100644
index ef81dd3f89..0000000000
--- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/** @file
- Provides interface to shell internal functions for shell commands.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_COMMAND_LIB_INTERNAL_HEADER_
-#define _UEFI_COMMAND_LIB_INTERNAL_HEADER_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/FileInfo.h>
-
-#include <Protocol/SimpleFileSystem.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/EfiShellInterface.h>
-#include <Protocol/EfiShellEnvironment2.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/UnicodeCollation.h>
-#include <Protocol/BlockIo.h>
-
-#include <Library/DevicePathLib.h>
-#include <Library/SortLib.h>
-#include <Library/HandleParsingLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/PrintLib.h>
-#include <Library/ShellLib.h>
-#include <Library/HiiLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-
-typedef struct{
- LIST_ENTRY Link;
- CHAR16 *CommandString;
- SHELL_GET_MAN_FILENAME GetManFileName;
- SHELL_RUN_COMMAND CommandHandler;
- BOOLEAN LastError;
- EFI_HANDLE HiiHandle;
- EFI_STRING_ID ManFormatHelp;
-} SHELL_COMMAND_INTERNAL_LIST_ENTRY;
-
-typedef struct {
- LIST_ENTRY Link;
- SCRIPT_FILE *Data;
-} SCRIPT_FILE_LIST;
-
-typedef struct {
- EFI_FILE_PROTOCOL *FileHandle;
- CHAR16 *Path;
-} SHELL_COMMAND_FILE_HANDLE;
-
-
-#endif //_UEFI_COMMAND_LIB_INTERNAL_HEADER_
-
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
deleted file mode 100644
index 6e792056d3..0000000000
--- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
+++ /dev/null
@@ -1,60 +0,0 @@
-## @file
-# Provides interface to shell internal functions for shell commands.
-#
-# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellCommandLib
- FILE_GUID = 5C12F31F-EBAC-466e-A400-FCA8C9EA3A05
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ShellCommandLib|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = ShellCommandLibConstructor
- DESTRUCTOR = ShellCommandLibDestructor
-
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- UefiShellCommandLib.c
- UefiShellCommandLib.h
- ConsistMapping.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- PrintLib
- UefiBootServicesTableLib
- ShellLib
- HiiLib
-
-[Protocols]
- gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED
- gEfiShellProtocolGuid # ALWAYS_CONSUMED
- gEfiShellParametersProtocolGuid # ALWAYS_CONSUMED
-
-[Guids]
- gEfiSasDevicePathGuid # ALWAYS_CONSUMED
-
-[Pcd.common]
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel ## ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength ## ALWAYS_CONSUMED
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c
deleted file mode 100644
index 90e112471d..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c
+++ /dev/null
@@ -1,1431 +0,0 @@
-/** @file
- Main file for bcfg shell Debug1 function.
-
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include <Guid/GlobalVariable.h>
-#include <Library/PrintLib.h>
-#include <Library/HandleParsingLib.h>
-#include <Library/DevicePathLib.h>
-
-typedef enum {
- BcfgTargetBootOrder = 0,
- BcfgTargetDriverOrder = 1,
- BcfgTargetMax = 2
-} BCFG_OPERATION_TARGET;
-
-typedef enum {
- BcfgTypeDump = 0,
- BcfgTypeAdd = 1,
- BcfgTypeAddp = 2,
- BcfgTypeAddh = 3,
- BcfgTypeRm = 4,
- BcfgTypeMv = 5,
- BcfgTypeOpt = 6,
- BcfgTypeMax = 7
-} BCFG_OPERATION_TYPE;
-
-typedef struct {
- BCFG_OPERATION_TARGET Target;
- BCFG_OPERATION_TYPE Type;
- UINT16 Number1;
- UINT16 Number2;
- UINTN HandleIndex;
- CHAR16 *FileName;
- CHAR16 *Description;
- UINT16 *Order;
- CONST CHAR16 *OptData;
-} BGFG_OPERATION;
-
-/**
- Get the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @return Actual number of entries in EFI_KEY_OPTION.Keys.
-**/
-#define KEY_OPTION_INPUT_KEY_COUNT(KeyOption) \
- (((KeyOption)->KeyData & EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK) >> LowBitSet32 (EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK))
-
-/**
- Update the optional data for a boot or driver option.
-
- If optional data exists it will be changed.
-
- @param[in] Index The boot or driver option index update.
- @param[in] DataSize The size in bytes of Data.
- @param[in] Data The buffer for the optioanl data.
- @param[in] Target The target of the operation.
-
- @retval EFI_SUCCESS The data was sucessfully updated.
- @retval other A error occured.
-**/
-EFI_STATUS
-EFIAPI
-UpdateOptionalDataDebug1(
- UINT16 Index,
- UINTN DataSize,
- UINT8 *Data,
- IN CONST BCFG_OPERATION_TARGET Target
- )
-{
- EFI_STATUS Status;
- CHAR16 VariableName[12];
- UINTN OriginalSize;
- UINT8 *OriginalData;
- UINTN NewSize;
- UINT8 *NewData;
- UINTN OriginalOptionDataSize;
-
- UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", Index);
-
- OriginalSize = 0;
- OriginalData = NULL;
- NewData = NULL;
- NewSize = 0;
-
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &OriginalSize,
- OriginalData);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- OriginalData = AllocateZeroPool(OriginalSize);
- if (OriginalData == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &OriginalSize,
- OriginalData);
- }
-
- if (!EFI_ERROR(Status)) {
- //
- // Allocate new struct and discard old optional data.
- //
- ASSERT (OriginalData != NULL);
- OriginalOptionDataSize = sizeof(UINT32) + sizeof(UINT16) + StrSize(((CHAR16*)(OriginalData + sizeof(UINT32) + sizeof(UINT16))));
- OriginalOptionDataSize += (*(UINT16*)(OriginalData + sizeof(UINT32)));
- OriginalOptionDataSize -= OriginalSize;
- NewSize = OriginalSize - OriginalOptionDataSize + DataSize;
- NewData = AllocateCopyPool(NewSize, OriginalData);
- if (NewData == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- CopyMem(NewData + OriginalSize - OriginalOptionDataSize, Data, DataSize);
- }
- }
-
- if (!EFI_ERROR(Status)) {
- //
- // put the data back under the variable
- //
- Status = gRT->SetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- NewSize,
- NewData);
- }
-
- SHELL_FREE_NON_NULL(OriginalData);
- SHELL_FREE_NON_NULL(NewData);
- return (Status);
-}
-
-/**
- This function will get a CRC for a boot option.
-
- @param[in, out] Crc The CRC value to return.
- @param[in] BootIndex The boot option index to CRC.
-
- @retval EFI_SUCCESS The CRC was sucessfully returned.
- @retval other A error occured.
-**/
-EFI_STATUS
-EFIAPI
-GetBootOptionCrcDebug1(
- UINT32 *Crc,
- UINT16 BootIndex
- )
-{
- CHAR16 VariableName[12];
- EFI_STATUS Status;
- UINT8 *Buffer;
- UINTN BufferSize;
-
- Buffer = NULL;
- BufferSize = 0;
-
- //
- // Get the data Buffer
- //
- UnicodeSPrint(VariableName, sizeof(VariableName), L"%Boot%04x", BootIndex);
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &BufferSize,
- NULL);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Buffer = AllocateZeroPool(BufferSize);
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &BufferSize,
- Buffer);
- }
-
- //
- // Get the CRC computed
- //
- if (!EFI_ERROR(Status)) {
- Status = gBS->CalculateCrc32 (Buffer, BufferSize, Crc);
- }
-
- SHELL_FREE_NON_NULL(Buffer);
- return EFI_SUCCESS;
-}
-
-/**
- This function will populate the device path protocol parameter based on TheHandle.
-
- @param[in] TheHandle Driver handle.
- @param[in, out] FilePath On a sucessful return the device path to the handle.
-
- @retval EFI_SUCCESS The device path was sucessfully returned.
- @retval other A error from gBS->HandleProtocol.
-
- @sa HandleProtocol
-**/
-EFI_STATUS
-EFIAPI
-GetDevicePathForDriverHandleDebug1 (
- IN EFI_HANDLE TheHandle,
- IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath
- )
-{
- EFI_STATUS Status;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
-
- Status = gBS->OpenProtocol (
- TheHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID**)&LoadedImage,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR (Status)) {
- Status = gBS->OpenProtocol (
- LoadedImage->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&ImageDevicePath,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR (Status)) {
-// *DevPath = DuplicateDevicePath (ImageDevicePath);
-// *FilePath = DuplicateDevicePath (LoadedImage->FilePath);
- *FilePath = AppendDevicePath(ImageDevicePath,LoadedImage->FilePath);
- gBS->CloseProtocol(
- LoadedImage->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- gImageHandle,
- NULL);
- }
- gBS->CloseProtocol(
- TheHandle,
- &gEfiLoadedImageProtocolGuid,
- gImageHandle,
- NULL);
- }
- return (Status);
-}
-
-/**
- Function to add a option.
-
- @param[in] Position The position to add Target at.
- @param[in] File The file to make the target.
- @param[in] Desc The description text.
- @param[in] CurrentOrder The pointer to the current order of items.
- @param[in] OrderCount The number if items in CurrentOrder.
- @param[in] Target The info on the option to add.
- @param[in] UseHandle TRUE to use HandleNumber, FALSE to use File and Desc.
- @param[in] UsePath TRUE to convert to devicepath.
- @param[in] HandleNumber The handle number to add.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
-**/
-SHELL_STATUS
-EFIAPI
-BcfgAddDebug1(
- IN UINTN Position,
- IN CONST CHAR16 *File,
- IN CONST CHAR16 *Desc,
- IN CONST UINT16 *CurrentOrder,
- IN CONST UINTN OrderCount,
- IN CONST BCFG_OPERATION_TARGET Target,
- IN CONST BOOLEAN UseHandle,
- IN CONST BOOLEAN UsePath,
- IN CONST UINTN HandleNumber
- )
-{
- EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_DEVICE_PATH_PROTOCOL *FilePath;
- EFI_DEVICE_PATH_PROTOCOL *FileNode;
- CHAR16 *Str;
- UINT8 *TempByteBuffer;
- UINT8 *TempByteStart;
- EFI_SHELL_FILE_INFO *Arg;
- EFI_SHELL_FILE_INFO *FileList;
- CHAR16 OptionStr[40];
- UINTN DescSize, FilePathSize;
- BOOLEAN Found;
- UINTN TargetLocation;
- UINTN Index;
- EFI_HANDLE *Handles;
- EFI_HANDLE CurHandle;
- UINTN DriverBindingHandleCount;
- UINTN ParentControllerHandleCount;
- UINTN ChildControllerHandleCount;
- SHELL_STATUS ShellStatus;
- UINT16 *NewOrder;
-
- if (!UseHandle) {
- if (File == NULL || Desc == NULL) {
- return (SHELL_INVALID_PARAMETER);
- }
- } else {
- if (HandleNumber == 0) {
- return (SHELL_INVALID_PARAMETER);
- }
- }
-
- if (Position > OrderCount) {
- Position = OrderCount;
- }
-
- Str = NULL;
- FilePath = NULL;
- FileNode = NULL;
- FileList = NULL;
- Handles = NULL;
- ShellStatus = SHELL_SUCCESS;
- TargetLocation = 0xFFFF;
-
- if (UseHandle) {
- CurHandle = ConvertHandleIndexToHandle(HandleNumber);
- if (CurHandle == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"Handle Number");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (Target == BcfgTargetBootOrder) {
- //
- //Make sure that the handle should point to a real controller
- //
- Status = PARSE_HANDLE_DATABASE_UEFI_DRIVERS (
- CurHandle,
- &DriverBindingHandleCount,
- NULL);
-
- Status = PARSE_HANDLE_DATABASE_PARENTS (
- CurHandle,
- &ParentControllerHandleCount,
- NULL);
-
- Status = ParseHandleDatabaseForChildControllers (
- CurHandle,
- &ChildControllerHandleCount,
- NULL);
-
- if (DriverBindingHandleCount > 0
- || ParentControllerHandleCount > 0
- || ChildControllerHandleCount > 0) {
- FilePath = NULL;
- Status = gBS->HandleProtocol (
- CurHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&FilePath);
- }
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_HANDLE), gShellDebug1HiiHandle, HandleNumber);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- } else {
- //
- //Make sure that the handle should point to driver, not a controller.
- //
- Status = PARSE_HANDLE_DATABASE_UEFI_DRIVERS (
- CurHandle,
- &DriverBindingHandleCount,
- NULL);
-
- Status = PARSE_HANDLE_DATABASE_PARENTS (
- CurHandle,
- &ParentControllerHandleCount,
- NULL);
-
- Status = ParseHandleDatabaseForChildControllers (
- CurHandle,
- &ChildControllerHandleCount,
- NULL);
-
- Status = gBS->HandleProtocol (
- CurHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&FilePath);
-
- if (DriverBindingHandleCount > 0
- || ParentControllerHandleCount > 0
- || ChildControllerHandleCount > 0
- || !EFI_ERROR(Status) ) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"Handle Number");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Get the DevicePath from the loaded image information.
- //
- Status = GetDevicePathForDriverHandleDebug1(CurHandle, &FilePath);
- }
- }
- }
- } else {
- //
- // Get file info
- //
- ShellOpenFileMetaArg ((CHAR16*)File, EFI_FILE_MODE_READ, &FileList);
-
- if (FileList == NULL) {
- //
- // If filename matched nothing fail
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, File);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (FileList->Link.ForwardLink != FileList->Link.BackLink) {
- //
- // If filename expanded to multiple names, fail
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE), gShellDebug1HiiHandle, File);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Arg = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link);
- if (EFI_ERROR(Arg->Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_OPEN), gShellDebug1HiiHandle, File, Arg->Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Build FilePath to the filename
- //
-
- //
- // get the device path
- //
- DevicePath = gEfiShellProtocol->GetDevicePathFromFilePath(Arg->FullName);
- if (DevicePath == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellDebug1HiiHandle, Arg->FullName);
- ShellStatus = SHELL_UNSUPPORTED;
- } else {
-/*
- if (UsePath) {
- DevPath = DevicePath;
- while (!IsDevicePathEnd(DevPath)) {
- if ((DevicePathType(DevPath) == MEDIA_DEVICE_PATH) &&
- (DevicePathSubType(DevPath) == MEDIA_HARDDRIVE_DP)) {
-
- //
- // If we find it use it instead
- //
- DevicePath = DevPath;
- break;
- }
- DevPath = NextDevicePathNode(DevPath);
- }
- //
- // append the file
- //
- for(StringWalker=Arg->FullName; *StringWalker != CHAR_NULL && *StringWalker != ':'; StringWalker++);
- FileNode = FileDevicePath(NULL, StringWalker+1);
- FilePath = AppendDevicePath(DevicePath, FileNode);
- FreePool(FileNode);
- } else {
-*/
- FilePath = DuplicateDevicePath(DevicePath);
-/*
- }
-*/
- FreePool(DevicePath);
- }
- }
- }
- }
-
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Find a free target ,a brute force implementation
- //
- Found = FALSE;
- for (TargetLocation=0; TargetLocation < 0xFFFF; TargetLocation++) {
- Found = TRUE;
- for (Index=0; Index < OrderCount; Index++) {
- if (CurrentOrder[Index] == TargetLocation) {
- Found = FALSE;
- break;
- }
- }
-
- if (Found) {
- break;
- }
- }
-
- if (TargetLocation == 0xFFFF) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET_NF), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET), gShellDebug1HiiHandle, TargetLocation);
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Add the option
- //
- DescSize = StrSize(Desc);
- FilePathSize = GetDevicePathSize (FilePath);
-
- TempByteBuffer = AllocateZeroPool(sizeof(UINT32) + sizeof(UINT16) + DescSize + FilePathSize);
- if (TempByteBuffer != NULL) {
- TempByteStart = TempByteBuffer;
- *((UINT32 *) TempByteBuffer) = LOAD_OPTION_ACTIVE; // Attributes
- TempByteBuffer += sizeof (UINT32);
-
- *((UINT16 *) TempByteBuffer) = (UINT16)FilePathSize; // FilePathListLength
- TempByteBuffer += sizeof (UINT16);
-
- CopyMem (TempByteBuffer, Desc, DescSize);
- TempByteBuffer += DescSize;
- ASSERT (FilePath != NULL);
- CopyMem (TempByteBuffer, FilePath, FilePathSize);
-
- UnicodeSPrint (OptionStr, sizeof(OptionStr), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", TargetLocation);
- Status = gRT->SetVariable (
- OptionStr,
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof(UINT32) + sizeof(UINT16) + DescSize + FilePathSize,
- TempByteStart
- );
-
- FreePool(TempByteStart);
- } else {
- Status = EFI_OUT_OF_RESOURCES;
- }
-
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellDebug1HiiHandle, OptionStr, Status);
- } else {
- NewOrder = AllocateZeroPool((OrderCount+1)*sizeof(NewOrder[0]));
- ASSERT(NewOrder != NULL);
- CopyMem(NewOrder, CurrentOrder, (OrderCount)*sizeof(NewOrder[0]));
-
- //
- // Insert target into order list
- //
- for (Index=OrderCount; Index > Position; Index--) {
- NewOrder[Index] = NewOrder[Index-1];
- }
-
- NewOrder[Position] = (UINT16) TargetLocation;
- Status = gRT->SetVariable (
- Target == BcfgTargetBootOrder?L"BootOrder":L"DriverOrder",
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- (OrderCount+1) * sizeof(UINT16),
- NewOrder
- );
-
- FreePool(NewOrder);
-
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, Target == BcfgTargetBootOrder?L"BootOrder":L"DriverOrder", Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Print (L"bcfg: Add %s as %x\n", OptionStr, Position);
- }
- }
- }
-
-//
-//If always Free FilePath, will free devicepath in system when use "addh"
-//
- if (FilePath!=NULL && !UseHandle) {
- FreePool (FilePath);
- }
-
- if (Str != NULL) {
- FreePool(Str);
- }
-
- if (Handles != NULL) {
- FreePool (Handles);
- }
-
- if (FileList != NULL) {
- ShellCloseFileMetaArg (&FileList);
- }
-
- return (ShellStatus);
-}
-
-/**
- Funciton to remove an item.
-
- @param[in] Target The target item to move.
- @param[in] CurrentOrder The pointer to the current order of items.
- @param[in] OrderCount The number if items in CurrentOrder.
- @param[in] Location The current location of the Target.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
-**/
-SHELL_STATUS
-EFIAPI
-BcfgRemoveDebug1(
- IN CONST BCFG_OPERATION_TARGET Target,
- IN CONST UINT16 *CurrentOrder,
- IN CONST UINTN OrderCount,
- IN CONST UINT16 Location
- )
-{
- CHAR16 VariableName[12];
- UINT16 *NewOrder;
- EFI_STATUS Status;
- UINTN NewCount;
-
- UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", CurrentOrder[Location]);
- Status = gRT->SetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- 0,
- NULL);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, VariableName, Status);
- return (SHELL_INVALID_PARAMETER);
- }
- NewOrder = AllocateZeroPool(OrderCount*sizeof(CurrentOrder[0]));
- if (NewOrder != NULL) {
- NewCount = OrderCount;
- CopyMem(NewOrder, CurrentOrder, OrderCount*sizeof(CurrentOrder[0]));
- CopyMem(NewOrder+Location, NewOrder+Location+1, (OrderCount - Location - 1)*sizeof(CurrentOrder[0]));
- NewCount--;
-
- Status = gRT->SetVariable(
- Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- NewCount*sizeof(NewOrder[0]),
- NewOrder);
- FreePool(NewOrder);
- } else {
- Status = EFI_OUT_OF_RESOURCES;
- }
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder", Status);
- return (SHELL_INVALID_PARAMETER);
- }
- return (SHELL_SUCCESS);
-}
-
-/**
- Funciton to move a item to another location.
-
- @param[in] Target The target item to move.
- @param[in] CurrentOrder The pointer to the current order of items.
- @param[in] OrderCount The number if items in CurrentOrder.
- @param[in] OldLocation The current location of the Target.
- @param[in] NewLocation The desired location of the Target.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
-**/
-SHELL_STATUS
-EFIAPI
-BcfgMoveDebug1(
- IN CONST BCFG_OPERATION_TARGET Target,
- IN CONST UINT16 *CurrentOrder,
- IN CONST UINTN OrderCount,
- IN CONST UINT16 OldLocation,
- IN CONST UINT16 NewLocation
- )
-{
- UINT16 *NewOrder;
- EFI_STATUS Status;
- UINT16 Temp;
-
- NewOrder = AllocateZeroPool(OrderCount*sizeof(CurrentOrder[0]));
- ASSERT(NewOrder != NULL);
-
- Temp = CurrentOrder[OldLocation];
- CopyMem(NewOrder, CurrentOrder, OrderCount*sizeof(CurrentOrder[0]));
- CopyMem(NewOrder+OldLocation, NewOrder+OldLocation+1, (OrderCount - OldLocation - 1)*sizeof(CurrentOrder[0]));
- CopyMem(NewOrder+NewLocation+1, NewOrder+NewLocation, (OrderCount - NewLocation - 1)*sizeof(CurrentOrder[0]));
- NewOrder[NewLocation] = Temp;
-
-
- Status = gRT->SetVariable(
- Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- OrderCount*sizeof(CurrentOrder[0]),
- NewOrder);
-
- FreePool(NewOrder);
-
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder", Status);
- return (SHELL_INVALID_PARAMETER);
- }
- return (SHELL_SUCCESS);
-}
-
-/**
- Function to add optional data to an option.
-
- @param[in] OptData The optional data to add.
- @param[in] CurrentOrder The pointer to the current order of items.
- @param[in] OrderCount The number if items in CurrentOrder.
- @param[in] Target The target of the operation.
-
- @retval SHELL_SUCCESS The operation was succesful.
-**/
-SHELL_STATUS
-EFIAPI
-BcfgAddOptDebug1(
- IN CONST CHAR16 *OptData,
- IN CONST UINT16 *CurrentOrder,
- IN CONST UINTN OrderCount,
- IN CONST BCFG_OPERATION_TARGET Target
- )
-{
- EFI_KEY_OPTION NewKeyOption;
- EFI_KEY_OPTION *KeyOptionBuffer;
- SHELL_STATUS ShellStatus;
- EFI_STATUS Status;
- UINT16 OptionIndex;
- UINT16 LoopCounter;
- UINT64 Intermediate;
- CONST CHAR16 *Temp;
- CONST CHAR16 *Walker;
- CHAR16 *FileName;
- CHAR16 *Temp2;
- CHAR16 *Data;
- UINT16 KeyIndex;
- CHAR16 VariableName[12];
-
- SHELL_FILE_HANDLE FileHandle;
-
- Status = EFI_SUCCESS;
- ShellStatus = SHELL_SUCCESS;
- Walker = OptData;
- FileName = NULL;
- Data = NULL;
- KeyOptionBuffer = NULL;
-
- ZeroMem(&NewKeyOption, sizeof(EFI_KEY_OPTION));
-
- while(Walker[0] == L' ') {
- Walker++;
- }
-
- //
- // Get the index of the variable we are changing.
- //
- Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
- if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL || ((UINT16)Intermediate) > ((UINT16)OrderCount)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"Option Index");
- ShellStatus = SHELL_INVALID_PARAMETER;
- return (ShellStatus);
- }
- OptionIndex = (UINT16)Intermediate;
-
- Temp = StrStr(Walker, L" ");
- if (Temp != NULL) {
- Walker = Temp;
- }
- while(Walker[0] == L' ') {
- Walker++;
- }
-
- //
- // determine whether we have file with data, quote delimited information, or a hot-key
- //
- if (Walker[0] == L'\"') {
- //
- // quoted filename or quoted information.
- //
- Temp = StrStr(Walker+1, L"\"");
- if (Temp == NULL || StrLen(Temp) != 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- FileName = StrnCatGrow(&FileName, NULL, Walker+1, 0);
- if (FileName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- return (ShellStatus);
- }
- Temp2 = StrStr(FileName, L"\"");
- ASSERT(Temp2 != NULL);
- Temp2[0] = CHAR_NULL;
- Temp2++;
- if (StrLen(Temp2)>0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- if (EFI_ERROR(ShellFileExists(Walker))) {
- //
- // Not a file. must be misc information.
- //
- Data = FileName;
- FileName = NULL;
- } else {
- FileName = StrnCatGrow(&FileName, NULL, Walker, 0);
- }
- }
- } else {
- //
- // filename or hot key information.
- //
- if (StrStr(Walker, L" ") == NULL) {
- //
- // filename
- //
- if (EFI_ERROR(ShellFileExists(Walker))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellDebug1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- FileName = StrnCatGrow(&FileName, NULL, Walker, 0);
- }
- } else {
- if (Target != BcfgTargetBootOrder) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_BOOT_ONLY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Get hot key information
- //
- Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
- if (EFI_ERROR(Status) || (((UINT32)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- NewKeyOption.KeyData = (UINT32)Intermediate;
- Temp = StrStr(Walker, L" ");
- if (Temp != NULL) {
- Walker = Temp;
- }
- while(Walker[0] == L' ') {
- Walker++;
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Now we know how many EFI_INPUT_KEY structs we need to attach to the end of the EFI_KEY_OPTION struct.
- // Re-allocate with the added information.
- //
- KeyOptionBuffer = AllocateCopyPool(sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)), &NewKeyOption);
- if (KeyOptionBuffer == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellDebug1HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- }
- }
- for (LoopCounter = 0 ; ShellStatus == SHELL_SUCCESS && LoopCounter < KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption); LoopCounter++) {
- //
- // ScanCode
- //
- Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
- if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- ((EFI_INPUT_KEY*)(((UINT8*)KeyOptionBuffer) + sizeof(EFI_KEY_OPTION)))[LoopCounter].ScanCode = (UINT16)Intermediate;
- Temp = StrStr(Walker, L" ");
- if (Temp != NULL) {
- Walker = Temp;
- }
- while(Walker[0] == L' ') {
- Walker++;
- }
-
- //
- // UnicodeChar
- //
- Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
- if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- ((EFI_INPUT_KEY*)(((UINT8*)KeyOptionBuffer) + sizeof(EFI_KEY_OPTION)))[LoopCounter].UnicodeChar = (UINT16)Intermediate;
- Temp = StrStr(Walker, L" ");
- if (Temp != NULL) {
- Walker = Temp;
- }
- while(Walker[0] == L' ') {
- Walker++;
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Now do the BootOption / BootOptionCrc
- //
- ASSERT (OptionIndex <= OrderCount);
- KeyOptionBuffer->BootOption = CurrentOrder[OptionIndex];
- Status = GetBootOptionCrcDebug1(&(KeyOptionBuffer->BootOptionCrc), KeyOptionBuffer->BootOption);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"Option Index");
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- for (Temp2 = NULL, KeyIndex = 0 ; KeyIndex < 0xFFFF ; KeyIndex++) {
- UnicodeSPrint(VariableName, sizeof(VariableName), L"Key%04x", KeyIndex);
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- (UINTN*)&Intermediate,
- NULL);
- if (Status == EFI_NOT_FOUND) {
- break;
- }
- }
- Status = gRT->SetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)),
- KeyOptionBuffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellDebug1HiiHandle, VariableName, Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- ASSERT(FileName == NULL && Data == NULL);
- }
- }
- }
-
- //
- // Shouldn't be possible to have have both. Neither is ok though.
- //
- ASSERT(FileName == NULL || Data == NULL);
-
- if (ShellStatus == SHELL_SUCCESS && (FileName != NULL || Data != NULL)) {
- if (FileName != NULL) {
- //
- // Open the file and populate the data buffer.
- //
- Status = ShellOpenFileByName(
- FileName,
- &FileHandle,
- EFI_FILE_MODE_READ,
- 0);
- if (!EFI_ERROR(Status)) {
- Status = ShellGetFileSize(FileHandle, &Intermediate);
- }
- Data = AllocateZeroPool((UINTN)Intermediate);
- if (Data == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellDebug1HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- }
- if (!EFI_ERROR(Status)) {
- Status = ShellReadFile(FileHandle, (UINTN *)&Intermediate, Data);
- }
- } else {
- Intermediate = StrSize(Data);
- }
-
- if (!EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS && Data != NULL) {
- Status = UpdateOptionalDataDebug1(CurrentOrder[OptionIndex], (UINTN)Intermediate, (UINT8*)Data, Target);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellDebug1HiiHandle, VariableName, Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellDebug1HiiHandle, VariableName, Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
-
- SHELL_FREE_NON_NULL(Data);
- SHELL_FREE_NON_NULL(KeyOptionBuffer);
- SHELL_FREE_NON_NULL(FileName);
- return ShellStatus;
-}
-
-/**
- Function to dump the Bcfg information.
-
- @param[in] Op The operation.
- @param[in] OrderCount How many to dump.
- @param[in] CurrentOrder The pointer to the current order of items.
- @param[in] VerboseOutput TRUE for extra output. FALSE otherwise.
-
- @retval SHELL_SUCCESS The dump was successful.
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
-**/
-SHELL_STATUS
-EFIAPI
-BcfgDisplayDumpDebug1(
- IN CONST CHAR16 *Op,
- IN CONST UINTN OrderCount,
- IN CONST UINT16 *CurrentOrder,
- IN CONST BOOLEAN VerboseOutput
- )
-{
- EFI_STATUS Status;
- UINT8 *Buffer;
- UINTN BufferSize;
- CHAR16 VariableName[12];
- UINTN LoopVar;
- UINTN LoopVar2;
- CHAR16 *DevPathString;
- VOID *DevPath;
-
- if (OrderCount == 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE), gShellDebug1HiiHandle);
- return (SHELL_SUCCESS);
- }
-
- for (LoopVar = 0 ; LoopVar < OrderCount ; LoopVar++) {
- Buffer = NULL;
- BufferSize = 0;
- UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Op, CurrentOrder[LoopVar]);
-
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &BufferSize,
- Buffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Buffer = AllocateZeroPool(BufferSize);
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &BufferSize,
- Buffer);
- }
-
- if (EFI_ERROR(Status) || Buffer == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_READ_FAIL), gShellDebug1HiiHandle, VariableName, Status);
- return (SHELL_INVALID_PARAMETER);
- }
-
- if ((*(UINT16*)(Buffer+4)) != 0) {
- DevPath = AllocateZeroPool(*(UINT16*)(Buffer+4));
- CopyMem(DevPath, Buffer+6+StrSize((CHAR16*)(Buffer+6)), *(UINT16*)(Buffer+4));
- DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
- } else {
- DevPath = NULL;
- DevPathString = NULL;
- }
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_BCFG_LOAD_OPTIONS),
- gShellDebug1HiiHandle,
- LoopVar,
- VariableName,
- (CHAR16*)(Buffer+6),
- DevPathString,
- (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) <= BufferSize?L'N':L'Y');
- if (VerboseOutput) {
- for (LoopVar2 = (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6);LoopVar2<BufferSize;LoopVar2++){
- ShellPrintEx(
- -1,
- -1,
- NULL,
- L"%02x",
- Buffer[LoopVar2]);
- }
- ShellPrintEx(
- -1,
- -1,
- NULL,
- L"\r\n");
- }
-
- if (Buffer != NULL) {
- FreePool(Buffer);
- }
- if (DevPath != NULL) {
- FreePool(DevPath);
- }
- if (DevPathString != NULL) {
- FreePool(DevPathString);
- }
- }
- return (SHELL_SUCCESS);
-}
-
-/**
- Function to initialize the BCFG operation structure.
-
- @param[in] Struct The stuct to initialize.
-**/
-VOID
-EFIAPI
-InitBcfgStructDebug1(
- IN BGFG_OPERATION *Struct
- )
-{
- ASSERT(Struct != NULL);
- Struct->Target = BcfgTargetMax;
- Struct->Type = BcfgTypeMax;
- Struct->Number1 = 0;
- Struct->Number2 = 0;
- Struct->HandleIndex = 0;
- Struct->FileName = NULL;
- Struct->Description = NULL;
- Struct->Order = NULL;
- Struct->OptData = NULL;
-}
-
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-v", TypeFlag},
- {L"-opt", TypeMaxValue},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'bcfg' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunBcfg (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN ParamNumber;
- CONST CHAR16 *CurrentParam;
- BGFG_OPERATION CurrentOperation;
- UINTN Length;
- UINT64 Intermediate;
-
- Length = 0;
- ProblemParam = NULL;
- Package = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- InitBcfgStructDebug1(&CurrentOperation);
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // Read in if we are doing -OPT
- //
- if (ShellCommandLineGetFlag(Package, L"-opt")) {
- CurrentOperation.OptData = ShellCommandLineGetValue(Package, L"-opt");
- if (CurrentOperation.OptData == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDebug1HiiHandle, L"-opt");
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeOpt;
- }
-
- //
- // small block to read the target of the operation
- //
- if ((ShellCommandLineGetCount(Package) < 3 && CurrentOperation.Type != BcfgTypeOpt) ||
- (ShellCommandLineGetCount(Package) < 2 && CurrentOperation.Type == BcfgTypeOpt)
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"driver") == 0) {
- CurrentOperation.Target = BcfgTargetDriverOrder;
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"boot") == 0) {
- CurrentOperation.Target = BcfgTargetBootOrder;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_DRIVER_BOOT), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
-
-
- //
- // Read in the boot or driver order environment variable (not needed for opt)
- //
- if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BcfgTargetMax) {
- Length = 0;
- Status = gRT->GetVariable(
- CurrentOperation.Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &Length,
- CurrentOperation.Order);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- CurrentOperation.Order = AllocateZeroPool(Length+(4*sizeof(CurrentOperation.Order[0])));
- Status = gRT->GetVariable(
- CurrentOperation.Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &Length,
- CurrentOperation.Order);
- }
- }
-
- //
- // large block to read the type of operation and verify parameter types for the info.
- //
- if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BcfgTargetMax) {
- for (ParamNumber = 2 ; ParamNumber < ShellCommandLineGetCount(Package) && ShellStatus == SHELL_SUCCESS; ParamNumber++) {
- CurrentParam = ShellCommandLineGetRawValue(Package, ParamNumber);
- if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"dump") == 0) {
- CurrentOperation.Type = BcfgTypeDump;
- } else if (ShellCommandLineGetFlag(Package, L"-v")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"-v (without dump)");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"add") == 0) {
- if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeAdd;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number1 = (UINT16)Intermediate;
- ASSERT(CurrentOperation.FileName == NULL);
- CurrentOperation.FileName = StrnCatGrow(&CurrentOperation.FileName , NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
- ASSERT(CurrentOperation.Description == NULL);
- CurrentOperation.Description = StrnCatGrow(&CurrentOperation.Description, NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
- }
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"addp") == 0) {
- if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeAddp;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number1 = (UINT16)Intermediate;
- ASSERT(CurrentOperation.FileName == NULL);
- CurrentOperation.FileName = StrnCatGrow(&CurrentOperation.FileName , NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
- ASSERT(CurrentOperation.Description == NULL);
- CurrentOperation.Description = StrnCatGrow(&CurrentOperation.Description, NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
- }
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"addh") == 0) {
- if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeAddh;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number1 = (UINT16)Intermediate;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.HandleIndex = (UINT16)Intermediate;
- ASSERT(CurrentOperation.Description == NULL);
- CurrentOperation.Description = StrnCatGrow(&CurrentOperation.Description, NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
- }
- }
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"rm") == 0) {
- if ((ParamNumber + 1) >= ShellCommandLineGetCount(Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeRm;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number1 = (UINT16)Intermediate;
- if (CurrentOperation.Number1 > (Length / sizeof(CurrentOperation.Order[0]))){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellDebug1HiiHandle, Length / sizeof(CurrentOperation.Order[0]));
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"mv") == 0) {
- if ((ParamNumber + 2) >= ShellCommandLineGetCount(Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeMv;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number1 = (UINT16)Intermediate;
- if (CurrentOperation.Number1 > (Length / sizeof(CurrentOperation.Order[0]))){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellDebug1HiiHandle, Length / sizeof(CurrentOperation.Order[0]));
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number2 = (UINT16)Intermediate;
- }
- if (CurrentOperation.Number2 == CurrentOperation.Number1
- ||CurrentOperation.Number1 > (Length / sizeof(CurrentOperation.Order[0]))
- ||CurrentOperation.Number2 > (Length / sizeof(CurrentOperation.Order[0]))
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellDebug1HiiHandle, Length / sizeof(CurrentOperation.Order[0]));
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- }
- if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BcfgTargetMax && CurrentOperation.Type < BcfgTypeMax) {
- //
- // we have all the info. Do the work
- //
- switch (CurrentOperation.Type) {
- case BcfgTypeDump:
- ShellStatus = BcfgDisplayDumpDebug1(
- CurrentOperation.Target == BcfgTargetBootOrder?L"Boot":L"Driver",
- Length / sizeof(CurrentOperation.Order[0]),
- CurrentOperation.Order,
- ShellCommandLineGetFlag(Package, L"-v"));
- break;
- case BcfgTypeMv:
- ShellStatus = BcfgMoveDebug1(
- CurrentOperation.Target,
- CurrentOperation.Order,
- Length / sizeof(CurrentOperation.Order[0]),
- CurrentOperation.Number1,
- CurrentOperation.Number2);
- break;
- case BcfgTypeRm:
- ShellStatus = BcfgRemoveDebug1(
- CurrentOperation.Target,
- CurrentOperation.Order,
- Length / sizeof(CurrentOperation.Order[0]),
- CurrentOperation.Number1);
- break;
- case BcfgTypeAdd:
- case BcfgTypeAddp:
- case BcfgTypeAddh:
- ShellStatus = BcfgAddDebug1(
- CurrentOperation.Number1,
- CurrentOperation.FileName,
- CurrentOperation.Description==NULL?L"":CurrentOperation.Description,
- CurrentOperation.Order,
- Length / sizeof(CurrentOperation.Order[0]),
- CurrentOperation.Target,
- (BOOLEAN)(CurrentOperation.Type == BcfgTypeAddh),
- (BOOLEAN)(CurrentOperation.Type == BcfgTypeAddp),
- CurrentOperation.HandleIndex);
- break;
- case BcfgTypeOpt:
- ShellStatus = BcfgAddOptDebug1(
- CurrentOperation.OptData,
- CurrentOperation.Order,
- Length / sizeof(CurrentOperation.Order[0]),
- CurrentOperation.Target);
- break;
- default:
- ASSERT(FALSE);
- }
- }
- }
-
- if (Package != NULL) {
- ShellCommandLineFreeVarList (Package);
- }
- if (CurrentOperation.FileName != NULL) {
- FreePool(CurrentOperation.FileName);
- }
- if (CurrentOperation.Description != NULL) {
- FreePool(CurrentOperation.Description);
- }
- if (CurrentOperation.Order != NULL) {
- FreePool(CurrentOperation.Order);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c
deleted file mode 100644
index 01ef1997b2..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/** @file
- Main file for Comp shell Debug1 function.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-
-/**
- Function for 'comp' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunComp (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN LoopVar;
- SHELL_FILE_HANDLE FileHandle1;
- SHELL_FILE_HANDLE FileHandle2;
- UINT8 ErrorCount;
- UINT64 Size1;
- UINT64 Size2;
- UINT8 DataFromFile1;
- UINT8 DataFromFile2;
- UINT8 ADF_File11;
- UINT8 ADF_File12;
- UINT8 ADF_File13;
- UINT8 ADF_File21;
- UINT8 ADF_File22;
- UINT8 ADF_File23;
- UINTN DataSizeFromFile1;
- UINTN DataSizeFromFile2;
- CHAR16 *FileName1;
- CHAR16 *FileName2;
- CONST CHAR16 *TempParam;
-
- ErrorCount = 0;
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- FileName1 = NULL;
- FileName2 = NULL;
- FileHandle1 = NULL;
- FileHandle2 = NULL;
- Size1 = 0;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- TempParam = ShellCommandLineGetRawValue(Package, 1);
- ASSERT(TempParam != NULL);
- FileName1 = ShellFindFilePath(TempParam);
- if (FileName1 == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, TempParam);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- Status = ShellOpenFileByName(FileName1, &FileHandle1, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, TempParam, Status);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- TempParam = ShellCommandLineGetRawValue(Package, 2);
- ASSERT(TempParam != NULL);
- FileName2 = ShellFindFilePath(TempParam);
- if (FileName2 == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, TempParam);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- Status = ShellOpenFileByName(FileName2, &FileHandle2, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, TempParam, Status);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- if (ShellStatus == SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_HEADER), gShellDebug1HiiHandle, FileName1, FileName2);
- Status = gEfiShellProtocol->GetFileSize(FileHandle1, &Size1);
- ASSERT_EFI_ERROR(Status);
- Status = gEfiShellProtocol->GetFileSize(FileHandle2, &Size2);
- ASSERT_EFI_ERROR(Status);
- if (Size1 != Size2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_SIZE_FAIL), gShellDebug1HiiHandle);
- ErrorCount++;
- ShellStatus = SHELL_NOT_EQUAL;
- }
- }
- if (ShellStatus == SHELL_SUCCESS) {
- for (LoopVar = 0 ; LoopVar < Size1 && ErrorCount <= 10 ; LoopVar++) {
- DataSizeFromFile1 = 1;
- DataSizeFromFile2 = 1;
- Status = gEfiShellProtocol->ReadFile(FileHandle1, &DataSizeFromFile1, &DataFromFile1);
- ASSERT_EFI_ERROR(Status);
- Status = gEfiShellProtocol->ReadFile(FileHandle2, &DataSizeFromFile2, &DataFromFile2);
- ASSERT_EFI_ERROR(Status);
- if (DataFromFile1 != DataFromFile2) {
- ADF_File11 = 0;
- ADF_File12 = 0;
- ADF_File13 = 0;
- ADF_File21 = 0;
- ADF_File22 = 0;
- ADF_File23 = 0;
- if (LoopVar + 1 < Size1) {
- LoopVar++;
- DataSizeFromFile1 = 1;
- DataSizeFromFile2 = 1;
- Status = gEfiShellProtocol->ReadFile(FileHandle1, &DataSizeFromFile1, &ADF_File11);
- ASSERT_EFI_ERROR(Status);
- Status = gEfiShellProtocol->ReadFile(FileHandle2, &DataSizeFromFile2, &ADF_File21);
- ASSERT_EFI_ERROR(Status);
- if (LoopVar + 1 < Size1) {
- LoopVar++;
- DataSizeFromFile1 = 1;
- DataSizeFromFile2 = 1;
- Status = gEfiShellProtocol->ReadFile(FileHandle1, &DataSizeFromFile1, &ADF_File12);
- ASSERT_EFI_ERROR(Status);
- Status = gEfiShellProtocol->ReadFile(FileHandle2, &DataSizeFromFile2, &ADF_File22);
- ASSERT_EFI_ERROR(Status);
- if (LoopVar + 1 < Size1) {
- LoopVar++;
- DataSizeFromFile1 = 1;
- DataSizeFromFile2 = 1;
- Status = gEfiShellProtocol->ReadFile(FileHandle1, &DataSizeFromFile1, &ADF_File13);
- ASSERT_EFI_ERROR(Status);
- Status = gEfiShellProtocol->ReadFile(FileHandle2, &DataSizeFromFile2, &ADF_File23);
- ASSERT_EFI_ERROR(Status);
- }
- }
- }
- if (ADF_File13 != ADF_File23) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_COMP_SPOT_FAIL4),
- gShellDebug1HiiHandle,
- ++ErrorCount,
- FileName1,
- LoopVar,
- DataFromFile1, ADF_File11, ADF_File12, ADF_File13,
- DataFromFile1, ADF_File11, ADF_File12, ADF_File13,
- FileName2,
- LoopVar,
- DataFromFile2, ADF_File21, ADF_File22, ADF_File23,
- DataFromFile2, ADF_File21, ADF_File22, ADF_File23
- );
- } else if (ADF_File12 != ADF_File22) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_COMP_SPOT_FAIL3),
- gShellDebug1HiiHandle,
- ++ErrorCount,
- FileName1,
- LoopVar,
- DataFromFile1, ADF_File11, ADF_File12,
- DataFromFile1, ADF_File11, ADF_File12,
- FileName2,
- LoopVar,
- DataFromFile2, ADF_File21, ADF_File22,
- DataFromFile2, ADF_File21, ADF_File22
- );
- } else if (ADF_File11 != ADF_File21) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_COMP_SPOT_FAIL2),
- gShellDebug1HiiHandle,
- ++ErrorCount,
- FileName1,
- LoopVar,
- DataFromFile1, ADF_File11,
- DataFromFile1, ADF_File11,
- FileName2,
- LoopVar,
- DataFromFile2, ADF_File21,
- DataFromFile2, ADF_File21
- );
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_COMP_SPOT_FAIL1),
- gShellDebug1HiiHandle,
- ++ErrorCount,
- FileName1,
- LoopVar,
- DataFromFile1,
- DataFromFile1,
- FileName2,
- LoopVar,
- DataFromFile2,
- DataFromFile2
- );
- }
- ShellStatus = SHELL_NOT_EQUAL;
- }
- }
- if (ErrorCount == 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_FOOTER_PASS), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_FOOTER_FAIL), gShellDebug1HiiHandle);
- }
- }
- }
-
- ShellCommandLineFreeVarList (Package);
- }
- SHELL_FREE_NON_NULL(FileName1);
- SHELL_FREE_NON_NULL(FileName2);
-
- if (FileHandle1 != NULL) {
- gEfiShellProtocol->CloseFile(FileHandle1);
- }
- if (FileHandle2 != NULL) {
- gEfiShellProtocol->CloseFile(FileHandle2);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
deleted file mode 100644
index b1f8327f4a..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
+++ /dev/null
@@ -1,1416 +0,0 @@
-/** @file
- Main file for compression routine.
-
- Compression routine. The compression algorithm is a mixture of
- LZ77 and Huffman coding. LZ77 transforms the source data into a
- sequence of Original Characters and Pointers to repeated strings.
- This sequence is further divided into Blocks and Huffman codings
- are applied to each Block.
-
- Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Library/MemoryAllocationLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <ShellBase.h>
-
-//
-// Macro Definitions
-//
-typedef INT16 NODE;
-#define UINT8_MAX 0xff
-#define UINT8_BIT 8
-#define THRESHOLD 3
-#define INIT_CRC 0
-#define WNDBIT 13
-#define WNDSIZ (1U << WNDBIT)
-#define MAXMATCH 256
-#define BLKSIZ (1U << 14) // 16 * 1024U
-#define PERC_FLAG 0x8000U
-#define CODE_BIT 16
-#define NIL 0
-#define MAX_HASH_VAL (3 * WNDSIZ + (WNDSIZ / 512 + 1) * UINT8_MAX)
-#define HASH(LoopVar7, LoopVar5) ((LoopVar7) + ((LoopVar5) << (WNDBIT - 9)) + WNDSIZ * 2)
-#define CRCPOLY 0xA001
-#define UPDATE_CRC(LoopVar5) mCrc = mCrcTable[(mCrc ^ (LoopVar5)) & 0xFF] ^ (mCrc >> UINT8_BIT)
-
-//
-// C: the Char&Len Set; P: the Position Set; T: the exTra Set
-//
-#define NC (UINT8_MAX + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define NP (WNDBIT + 1)
-#define PBIT 4
-#define NT (CODE_BIT + 3)
-#define TBIT 5
-#if NT > NP
- #define NPT NT
-#else
- #define NPT NP
-#endif
-//
-// Function Prototypes
-//
-
-/**
- Put a dword to output stream
-
- @param[in] Data The dword to put.
-**/
-VOID
-EFIAPI
-PutDword(
- IN UINT32 Data
- );
-
-//
-// Global Variables
-//
-STATIC UINT8 *mSrc;
-STATIC UINT8 *mDst;
-STATIC UINT8 *mSrcUpperLimit;
-STATIC UINT8 *mDstUpperLimit;
-
-STATIC UINT8 *mLevel;
-STATIC UINT8 *mText;
-STATIC UINT8 *mChildCount;
-STATIC UINT8 *mBuf;
-STATIC UINT8 mCLen[NC];
-STATIC UINT8 mPTLen[NPT];
-STATIC UINT8 *mLen;
-STATIC INT16 mHeap[NC + 1];
-STATIC INT32 mRemainder;
-STATIC INT32 mMatchLen;
-STATIC INT32 mBitCount;
-STATIC INT32 mHeapSize;
-STATIC INT32 mTempInt32;
-STATIC UINT32 mBufSiz = 0;
-STATIC UINT32 mOutputPos;
-STATIC UINT32 mOutputMask;
-STATIC UINT32 mSubBitBuf;
-STATIC UINT32 mCrc;
-STATIC UINT32 mCompSize;
-STATIC UINT32 mOrigSize;
-
-STATIC UINT16 *mFreq;
-STATIC UINT16 *mSortPtr;
-STATIC UINT16 mLenCnt[17];
-STATIC UINT16 mLeft[2 * NC - 1];
-STATIC UINT16 mRight[2 * NC - 1];
-STATIC UINT16 mCrcTable[UINT8_MAX + 1];
-STATIC UINT16 mCFreq[2 * NC - 1];
-STATIC UINT16 mCCode[NC];
-STATIC UINT16 mPFreq[2 * NP - 1];
-STATIC UINT16 mPTCode[NPT];
-STATIC UINT16 mTFreq[2 * NT - 1];
-
-STATIC NODE mPos;
-STATIC NODE mMatchPos;
-STATIC NODE mAvail;
-STATIC NODE *mPosition;
-STATIC NODE *mParent;
-STATIC NODE *mPrev;
-STATIC NODE *mNext = NULL;
-INT32 mHuffmanDepth = 0;
-
-/**
- Make a CRC table.
-
-**/
-VOID
-EFIAPI
-MakeCrcTable (
- VOID
- )
-{
- UINT32 LoopVar1;
-
- UINT32 LoopVar2;
-
- UINT32 LoopVar4;
-
- for (LoopVar1 = 0; LoopVar1 <= UINT8_MAX; LoopVar1++) {
- LoopVar4 = LoopVar1;
- for (LoopVar2 = 0; LoopVar2 < UINT8_BIT; LoopVar2++) {
- if ((LoopVar4 & 1) != 0) {
- LoopVar4 = (LoopVar4 >> 1) ^ CRCPOLY;
- } else {
- LoopVar4 >>= 1;
- }
- }
-
- mCrcTable[LoopVar1] = (UINT16) LoopVar4;
- }
-}
-
-/**
- Put a dword to output stream
-
- @param[in] Data The dword to put.
-**/
-VOID
-EFIAPI
-PutDword (
- IN UINT32 Data
- )
-{
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x08)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x10)) & 0xff);
- }
-
- if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x18)) & 0xff);
- }
-}
-
-/**
- Allocate memory spaces for data structures used in compression process.
-
- @retval EFI_SUCCESS Memory was allocated successfully.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-AllocateMemory (
- VOID
- )
-{
- mText = AllocateZeroPool (WNDSIZ * 2 + MAXMATCH);
- mLevel = AllocateZeroPool ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mLevel));
- mChildCount = AllocateZeroPool ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mChildCount));
- mPosition = AllocateZeroPool ((WNDSIZ + UINT8_MAX + 1) * sizeof (*mPosition));
- mParent = AllocateZeroPool (WNDSIZ * 2 * sizeof (*mParent));
- mPrev = AllocateZeroPool (WNDSIZ * 2 * sizeof (*mPrev));
- mNext = AllocateZeroPool ((MAX_HASH_VAL + 1) * sizeof (*mNext));
-
- mBufSiz = BLKSIZ;
- mBuf = AllocateZeroPool (mBufSiz);
- while (mBuf == NULL) {
- mBufSiz = (mBufSiz / 10U) * 9U;
- if (mBufSiz < 4 * 1024U) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- mBuf = AllocateZeroPool (mBufSiz);
- }
-
- mBuf[0] = 0;
-
- return EFI_SUCCESS;
-}
-
-/**
- Called when compression is completed to free memory previously allocated.
-
-**/
-VOID
-EFIAPI
-FreeMemory (
- VOID
- )
-{
- SHELL_FREE_NON_NULL (mText);
- SHELL_FREE_NON_NULL (mLevel);
- SHELL_FREE_NON_NULL (mChildCount);
- SHELL_FREE_NON_NULL (mPosition);
- SHELL_FREE_NON_NULL (mParent);
- SHELL_FREE_NON_NULL (mPrev);
- SHELL_FREE_NON_NULL (mNext);
- SHELL_FREE_NON_NULL (mBuf);
-}
-
-/**
- Initialize String Info Log data structures.
-**/
-VOID
-EFIAPI
-InitSlide (
- VOID
- )
-{
- NODE LoopVar1;
-
- SetMem (mLevel + WNDSIZ, (UINT8_MAX + 1) * sizeof (UINT8), 1);
- SetMem (mPosition + WNDSIZ, (UINT8_MAX + 1) * sizeof (NODE), 0);
-
- SetMem (mParent + WNDSIZ, WNDSIZ * sizeof (NODE), 0);
-
- mAvail = 1;
- for (LoopVar1 = 1; LoopVar1 < WNDSIZ - 1; LoopVar1++) {
- mNext[LoopVar1] = (NODE) (LoopVar1 + 1);
- }
-
- mNext[WNDSIZ - 1] = NIL;
- SetMem (mNext + WNDSIZ * 2, (MAX_HASH_VAL - WNDSIZ * 2 + 1) * sizeof (NODE), 0);
-}
-
-/**
- Find child node given the parent node and the edge character
-
- @param[in] LoopVar6 The parent node.
- @param[in] LoopVar5 The edge character.
-
- @return The child node.
- @retval NIL(Zero) No child could be found.
-
-**/
-NODE
-EFIAPI
-Child (
- IN NODE LoopVar6,
- IN UINT8 LoopVar5
- )
-{
- NODE LoopVar4;
-
- LoopVar4 = mNext[HASH (LoopVar6, LoopVar5)];
- mParent[NIL] = LoopVar6; /* sentinel */
- while (mParent[LoopVar4] != LoopVar6) {
- LoopVar4 = mNext[LoopVar4];
- }
-
- return LoopVar4;
-}
-
-/**
- Create a new child for a given parent node.
-
- @param[in] LoopVar6 The parent node.
- @param[in] LoopVar5 The edge character.
- @param[in] LoopVar4 The child node.
-**/
-VOID
-EFIAPI
-MakeChild (
- IN NODE LoopVar6,
- IN UINT8 LoopVar5,
- IN NODE LoopVar4
- )
-{
- NODE LoopVar12;
-
- NODE LoopVar10;
-
- LoopVar12 = (NODE) HASH (LoopVar6, LoopVar5);
- LoopVar10 = mNext[LoopVar12];
- mNext[LoopVar12] = LoopVar4;
- mNext[LoopVar4] = LoopVar10;
- mPrev[LoopVar10] = LoopVar4;
- mPrev[LoopVar4] = LoopVar12;
- mParent[LoopVar4] = LoopVar6;
- mChildCount[LoopVar6]++;
-}
-
-/**
- Split a node.
-
- @param[in] Old The node to split.
-**/
-VOID
-EFIAPI
-Split (
- IN NODE Old
- )
-{
- NODE New;
-
- NODE LoopVar10;
-
- New = mAvail;
- mAvail = mNext[New];
- mChildCount[New] = 0;
- LoopVar10 = mPrev[Old];
- mPrev[New] = LoopVar10;
- mNext[LoopVar10] = New;
- LoopVar10 = mNext[Old];
- mNext[New] = LoopVar10;
- mPrev[LoopVar10] = New;
- mParent[New] = mParent[Old];
- mLevel[New] = (UINT8) mMatchLen;
- mPosition[New] = mPos;
- MakeChild (New, mText[mMatchPos + mMatchLen], Old);
- MakeChild (New, mText[mPos + mMatchLen], mPos);
-}
-
-/**
- Insert string info for current position into the String Info Log.
-
-**/
-VOID
-EFIAPI
-InsertNode (
- VOID
- )
-{
- NODE LoopVar6;
-
- NODE LoopVar4;
-
- NODE LoopVar2;
-
- NODE LoopVar10;
- UINT8 LoopVar5;
- UINT8 *TempString3;
- UINT8 *TempString2;
-
- if (mMatchLen >= 4) {
- //
- // We have just got a long match, the target tree
- // can be located by MatchPos + 1. Travese the tree
- // from bottom up to get to a proper starting point.
- // The usage of PERC_FLAG ensures proper node deletion
- // in DeleteNode() later.
- //
- mMatchLen--;
- LoopVar4 = (NODE) ((mMatchPos + 1) | WNDSIZ);
- LoopVar6 = mParent[LoopVar4];
- while (LoopVar6 == NIL) {
- LoopVar4 = mNext[LoopVar4];
- LoopVar6 = mParent[LoopVar4];
- }
-
- while (mLevel[LoopVar6] >= mMatchLen) {
- LoopVar4 = LoopVar6;
- LoopVar6 = mParent[LoopVar6];
- }
-
- LoopVar10 = LoopVar6;
- while (mPosition[LoopVar10] < 0) {
- mPosition[LoopVar10] = mPos;
- LoopVar10 = mParent[LoopVar10];
- }
-
- if (LoopVar10 < WNDSIZ) {
- mPosition[LoopVar10] = (NODE) (mPos | PERC_FLAG);
- }
- } else {
- //
- // Locate the target tree
- //
- LoopVar6 = (NODE) (mText[mPos] + WNDSIZ);
- LoopVar5 = mText[mPos + 1];
- LoopVar4 = Child (LoopVar6, LoopVar5);
- if (LoopVar4 == NIL) {
- MakeChild (LoopVar6, LoopVar5, mPos);
- mMatchLen = 1;
- return ;
- }
-
- mMatchLen = 2;
- }
- //
- // Traverse down the tree to find a match.
- // Update Position value along the route.
- // Node split or creation is involved.
- //
- for (;;) {
- if (LoopVar4 >= WNDSIZ) {
- LoopVar2 = MAXMATCH;
- mMatchPos = LoopVar4;
- } else {
- LoopVar2 = mLevel[LoopVar4];
- mMatchPos = (NODE) (mPosition[LoopVar4] & ~PERC_FLAG);
- }
-
- if (mMatchPos >= mPos) {
- mMatchPos -= WNDSIZ;
- }
-
- TempString3 = &mText[mPos + mMatchLen];
- TempString2 = &mText[mMatchPos + mMatchLen];
- while (mMatchLen < LoopVar2) {
- if (*TempString3 != *TempString2) {
- Split (LoopVar4);
- return ;
- }
-
- mMatchLen++;
- TempString3++;
- TempString2++;
- }
-
- if (mMatchLen >= MAXMATCH) {
- break;
- }
-
- mPosition[LoopVar4] = mPos;
- LoopVar6 = LoopVar4;
- LoopVar4 = Child (LoopVar6, *TempString3);
- if (LoopVar4 == NIL) {
- MakeChild (LoopVar6, *TempString3, mPos);
- return ;
- }
-
- mMatchLen++;
- }
-
- LoopVar10 = mPrev[LoopVar4];
- mPrev[mPos] = LoopVar10;
- mNext[LoopVar10] = mPos;
- LoopVar10 = mNext[LoopVar4];
- mNext[mPos] = LoopVar10;
- mPrev[LoopVar10] = mPos;
- mParent[mPos] = LoopVar6;
- mParent[LoopVar4] = NIL;
-
- //
- // Special usage of 'next'
- //
- mNext[LoopVar4] = mPos;
-
-}
-
-/**
- Delete outdated string info. (The Usage of PERC_FLAG
- ensures a clean deletion).
-
-**/
-VOID
-EFIAPI
-DeleteNode (
- VOID
- )
-{
- NODE LoopVar6;
-
- NODE LoopVar4;
-
- NODE LoopVar11;
-
- NODE LoopVar10;
-
- NODE LoopVar9;
-
- if (mParent[mPos] == NIL) {
- return ;
- }
-
- LoopVar4 = mPrev[mPos];
- LoopVar11 = mNext[mPos];
- mNext[LoopVar4] = LoopVar11;
- mPrev[LoopVar11] = LoopVar4;
- LoopVar4 = mParent[mPos];
- mParent[mPos] = NIL;
- if (LoopVar4 >= WNDSIZ) {
- return ;
- }
-
- mChildCount[LoopVar4]--;
- if (mChildCount[LoopVar4] > 1) {
- return ;
- }
-
- LoopVar10 = (NODE) (mPosition[LoopVar4] & ~PERC_FLAG);
- if (LoopVar10 >= mPos) {
- LoopVar10 -= WNDSIZ;
- }
-
- LoopVar11 = LoopVar10;
- LoopVar6 = mParent[LoopVar4];
- LoopVar9 = mPosition[LoopVar6];
- while ((LoopVar9 & PERC_FLAG) != 0){
- LoopVar9 &= ~PERC_FLAG;
- if (LoopVar9 >= mPos) {
- LoopVar9 -= WNDSIZ;
- }
-
- if (LoopVar9 > LoopVar11) {
- LoopVar11 = LoopVar9;
- }
-
- mPosition[LoopVar6] = (NODE) (LoopVar11 | WNDSIZ);
- LoopVar6 = mParent[LoopVar6];
- LoopVar9 = mPosition[LoopVar6];
- }
-
- if (LoopVar6 < WNDSIZ) {
- if (LoopVar9 >= mPos) {
- LoopVar9 -= WNDSIZ;
- }
-
- if (LoopVar9 > LoopVar11) {
- LoopVar11 = LoopVar9;
- }
-
- mPosition[LoopVar6] = (NODE) (LoopVar11 | WNDSIZ | PERC_FLAG);
- }
-
- LoopVar11 = Child (LoopVar4, mText[LoopVar10 + mLevel[LoopVar4]]);
- LoopVar10 = mPrev[LoopVar11];
- LoopVar9 = mNext[LoopVar11];
- mNext[LoopVar10] = LoopVar9;
- mPrev[LoopVar9] = LoopVar10;
- LoopVar10 = mPrev[LoopVar4];
- mNext[LoopVar10] = LoopVar11;
- mPrev[LoopVar11] = LoopVar10;
- LoopVar10 = mNext[LoopVar4];
- mPrev[LoopVar10] = LoopVar11;
- mNext[LoopVar11] = LoopVar10;
- mParent[LoopVar11] = mParent[LoopVar4];
- mParent[LoopVar4] = NIL;
- mNext[LoopVar4] = mAvail;
- mAvail = LoopVar4;
-}
-
-/**
- Read in source data
-
- @param[out] LoopVar7 The buffer to hold the data.
- @param[in] LoopVar8 The number of bytes to read.
-
- @return The number of bytes actually read.
-**/
-INT32
-EFIAPI
-FreadCrc (
- OUT UINT8 *LoopVar7,
- IN INT32 LoopVar8
- )
-{
- INT32 LoopVar1;
-
- for (LoopVar1 = 0; mSrc < mSrcUpperLimit && LoopVar1 < LoopVar8; LoopVar1++) {
- *LoopVar7++ = *mSrc++;
- }
-
- LoopVar8 = LoopVar1;
-
- LoopVar7 -= LoopVar8;
- mOrigSize += LoopVar8;
- LoopVar1--;
- while (LoopVar1 >= 0) {
- UPDATE_CRC (*LoopVar7++);
- LoopVar1--;
- }
-
- return LoopVar8;
-}
-
-/**
- Advance the current position (read in new data if needed).
- Delete outdated string info. Find a match string for current position.
-
- @retval TRUE The operation was successful.
- @retval FALSE The operation failed due to insufficient memory.
-**/
-BOOLEAN
-EFIAPI
-GetNextMatch (
- VOID
- )
-{
- INT32 LoopVar8;
- VOID *Temp;
-
- mRemainder--;
- mPos++;
- if (mPos == WNDSIZ * 2) {
- Temp = AllocateZeroPool (WNDSIZ + MAXMATCH);
- if (Temp == NULL) {
- return (FALSE);
- }
- CopyMem (Temp, &mText[WNDSIZ], WNDSIZ + MAXMATCH);
- CopyMem (&mText[0], Temp, WNDSIZ + MAXMATCH);
- FreePool (Temp);
- LoopVar8 = FreadCrc (&mText[WNDSIZ + MAXMATCH], WNDSIZ);
- mRemainder += LoopVar8;
- mPos = WNDSIZ;
- }
-
- DeleteNode ();
- InsertNode ();
-
- return (TRUE);
-}
-
-/**
- Send entry LoopVar1 down the queue.
-
- @param[in] LoopVar1 The index of the item to move.
-**/
-VOID
-EFIAPI
-DownHeap (
- IN INT32 i
- )
-{
- INT32 LoopVar1;
-
- INT32 LoopVar2;
-
- //
- // priority queue: send i-th entry down heap
- //
- LoopVar2 = mHeap[i];
- LoopVar1 = 2 * i;
- while (LoopVar1 <= mHeapSize) {
- if (LoopVar1 < mHeapSize && mFreq[mHeap[LoopVar1]] > mFreq[mHeap[LoopVar1 + 1]]) {
- LoopVar1++;
- }
-
- if (mFreq[LoopVar2] <= mFreq[mHeap[LoopVar1]]) {
- break;
- }
-
- mHeap[i] = mHeap[LoopVar1];
- i = LoopVar1;
- LoopVar1 = 2 * i;
- }
-
- mHeap[i] = (INT16) LoopVar2;
-}
-
-/**
- Count the number of each code length for a Huffman tree.
-
- @param[in] LoopVar1 The top node.
-**/
-VOID
-EFIAPI
-CountLen (
- IN INT32 LoopVar1
- )
-{
- if (LoopVar1 < mTempInt32) {
- mLenCnt[(mHuffmanDepth < 16) ? mHuffmanDepth : 16]++;
- } else {
- mHuffmanDepth++;
- CountLen (mLeft[LoopVar1]);
- CountLen (mRight[LoopVar1]);
- mHuffmanDepth--;
- }
-}
-
-/**
- Create code length array for a Huffman tree.
-
- @param[in] Root The root of the tree.
-**/
-VOID
-EFIAPI
-MakeLen (
- IN INT32 Root
- )
-{
- INT32 LoopVar1;
-
- INT32 LoopVar2;
- UINT32 Cum;
-
- for (LoopVar1 = 0; LoopVar1 <= 16; LoopVar1++) {
- mLenCnt[LoopVar1] = 0;
- }
-
- CountLen (Root);
-
- //
- // Adjust the length count array so that
- // no code will be generated longer than its designated length
- //
- Cum = 0;
- for (LoopVar1 = 16; LoopVar1 > 0; LoopVar1--) {
- Cum += mLenCnt[LoopVar1] << (16 - LoopVar1);
- }
-
- while (Cum != (1U << 16)) {
- mLenCnt[16]--;
- for (LoopVar1 = 15; LoopVar1 > 0; LoopVar1--) {
- if (mLenCnt[LoopVar1] != 0) {
- mLenCnt[LoopVar1]--;
- mLenCnt[LoopVar1 + 1] += 2;
- break;
- }
- }
-
- Cum--;
- }
-
- for (LoopVar1 = 16; LoopVar1 > 0; LoopVar1--) {
- LoopVar2 = mLenCnt[LoopVar1];
- LoopVar2--;
- while (LoopVar2 >= 0) {
- mLen[*mSortPtr++] = (UINT8) LoopVar1;
- LoopVar2--;
- }
- }
-}
-
-/**
- Assign code to each symbol based on the code length array.
-
- @param[in] LoopVar8 The number of symbols.
- @param[in] Len The code length array.
- @param[out] Code The stores codes for each symbol.
-**/
-VOID
-EFIAPI
-MakeCode (
- IN INT32 LoopVar8,
- IN UINT8 Len[ ],
- OUT UINT16 Code[ ]
- )
-{
- INT32 LoopVar1;
- UINT16 Start[18];
-
- Start[1] = 0;
- for (LoopVar1 = 1; LoopVar1 <= 16; LoopVar1++) {
- Start[LoopVar1 + 1] = (UINT16) ((Start[LoopVar1] + mLenCnt[LoopVar1]) << 1);
- }
-
- for (LoopVar1 = 0; LoopVar1 < LoopVar8; LoopVar1++) {
- Code[LoopVar1] = Start[Len[LoopVar1]]++;
- }
-}
-
-/**
- Generates Huffman codes given a frequency distribution of symbols.
-
- @param[in] NParm The number of symbols.
- @param[in] FreqParm The frequency of each symbol.
- @param[out] LenParm The code length for each symbol.
- @param[out] CodeParm The code for each symbol.
-
- @return The root of the Huffman tree.
-**/
-INT32
-EFIAPI
-MakeTree (
- IN INT32 NParm,
- IN UINT16 FreqParm[ ],
- OUT UINT8 LenParm[ ],
- OUT UINT16 CodeParm[ ]
- )
-{
- INT32 LoopVar1;
-
- INT32 LoopVar2;
-
- INT32 LoopVar3;
-
- INT32 Avail;
-
- //
- // make tree, calculate len[], return root
- //
- mTempInt32 = NParm;
- mFreq = FreqParm;
- mLen = LenParm;
- Avail = mTempInt32;
- mHeapSize = 0;
- mHeap[1] = 0;
- for (LoopVar1 = 0; LoopVar1 < mTempInt32; LoopVar1++) {
- mLen[LoopVar1] = 0;
- if ((mFreq[LoopVar1]) != 0) {
- mHeapSize++;
- mHeap[mHeapSize] = (INT16) LoopVar1;
- }
- }
-
- if (mHeapSize < 2) {
- CodeParm[mHeap[1]] = 0;
- return mHeap[1];
- }
-
- for (LoopVar1 = mHeapSize / 2; LoopVar1 >= 1; LoopVar1--) {
- //
- // make priority queue
- //
- DownHeap (LoopVar1);
- }
-
- mSortPtr = CodeParm;
- do {
- LoopVar1 = mHeap[1];
- if (LoopVar1 < mTempInt32) {
- *mSortPtr++ = (UINT16) LoopVar1;
- }
-
- mHeap[1] = mHeap[mHeapSize--];
- DownHeap (1);
- LoopVar2 = mHeap[1];
- if (LoopVar2 < mTempInt32) {
- *mSortPtr++ = (UINT16) LoopVar2;
- }
-
- LoopVar3 = Avail++;
- mFreq[LoopVar3] = (UINT16) (mFreq[LoopVar1] + mFreq[LoopVar2]);
- mHeap[1] = (INT16) LoopVar3;
- DownHeap (1);
- mLeft[LoopVar3] = (UINT16) LoopVar1;
- mRight[LoopVar3] = (UINT16) LoopVar2;
- } while (mHeapSize > 1);
-
- mSortPtr = CodeParm;
- MakeLen (LoopVar3);
- MakeCode (NParm, LenParm, CodeParm);
-
- //
- // return root
- //
- return LoopVar3;
-}
-
-/**
- Outputs rightmost LoopVar8 bits of x
-
- @param[in] LoopVar8 The rightmost LoopVar8 bits of the data is used.
- @param[in] x The data.
-**/
-VOID
-EFIAPI
-PutBits (
- IN INT32 LoopVar8,
- IN UINT32 x
- )
-{
- UINT8 Temp;
-
- if (LoopVar8 < mBitCount) {
- mSubBitBuf |= x << (mBitCount -= LoopVar8);
- } else {
-
- Temp = (UINT8)(mSubBitBuf | (x >> (LoopVar8 -= mBitCount)));
- if (mDst < mDstUpperLimit) {
- *mDst++ = Temp;
- }
- mCompSize++;
-
- if (LoopVar8 < UINT8_BIT) {
- mSubBitBuf = x << (mBitCount = UINT8_BIT - LoopVar8);
- } else {
-
- Temp = (UINT8)(x >> (LoopVar8 - UINT8_BIT));
- if (mDst < mDstUpperLimit) {
- *mDst++ = Temp;
- }
- mCompSize++;
-
- mSubBitBuf = x << (mBitCount = 2 * UINT8_BIT - LoopVar8);
- }
- }
-}
-
-/**
- Encode a signed 32 bit number.
-
- @param[in] LoopVar5 The number to encode.
-**/
-VOID
-EFIAPI
-EncodeC (
- IN INT32 LoopVar5
- )
-{
- PutBits (mCLen[LoopVar5], mCCode[LoopVar5]);
-}
-
-/**
- Encode a unsigned 32 bit number.
-
- @param[in] LoopVar7 The number to encode.
-**/
-VOID
-EFIAPI
-EncodeP (
- IN UINT32 LoopVar7
- )
-{
- UINT32 LoopVar5;
-
- UINT32 LoopVar6;
-
- LoopVar5 = 0;
- LoopVar6 = LoopVar7;
- while (LoopVar6 != 0) {
- LoopVar6 >>= 1;
- LoopVar5++;
- }
-
- PutBits (mPTLen[LoopVar5], mPTCode[LoopVar5]);
- if (LoopVar5 > 1) {
- PutBits(LoopVar5 - 1, LoopVar7 & (0xFFFFU >> (17 - LoopVar5)));
- }
-}
-
-/**
- Count the frequencies for the Extra Set.
-
-**/
-VOID
-EFIAPI
-CountTFreq (
- VOID
- )
-{
- INT32 LoopVar1;
-
- INT32 LoopVar3;
-
- INT32 LoopVar8;
-
- INT32 Count;
-
- for (LoopVar1 = 0; LoopVar1 < NT; LoopVar1++) {
- mTFreq[LoopVar1] = 0;
- }
-
- LoopVar8 = NC;
- while (LoopVar8 > 0 && mCLen[LoopVar8 - 1] == 0) {
- LoopVar8--;
- }
-
- LoopVar1 = 0;
- while (LoopVar1 < LoopVar8) {
- LoopVar3 = mCLen[LoopVar1++];
- if (LoopVar3 == 0) {
- Count = 1;
- while (LoopVar1 < LoopVar8 && mCLen[LoopVar1] == 0) {
- LoopVar1++;
- Count++;
- }
-
- if (Count <= 2) {
- mTFreq[0] = (UINT16) (mTFreq[0] + Count);
- } else if (Count <= 18) {
- mTFreq[1]++;
- } else if (Count == 19) {
- mTFreq[0]++;
- mTFreq[1]++;
- } else {
- mTFreq[2]++;
- }
- } else {
- ASSERT((LoopVar3+2)<(2 * NT - 1));
- mTFreq[LoopVar3 + 2]++;
- }
- }
-}
-
-/**
- Outputs the code length array for the Extra Set or the Position Set.
-
- @param[in] LoopVar8 The number of symbols.
- @param[in] nbit The number of bits needed to represent 'LoopVar8'.
- @param[in] Special The special symbol that needs to be take care of.
-
-**/
-VOID
-EFIAPI
-WritePTLen (
- IN INT32 LoopVar8,
- IN INT32 nbit,
- IN INT32 Special
- )
-{
- INT32 LoopVar1;
-
- INT32 LoopVar3;
-
- while (LoopVar8 > 0 && mPTLen[LoopVar8 - 1] == 0) {
- LoopVar8--;
- }
-
- PutBits (nbit, LoopVar8);
- LoopVar1 = 0;
- while (LoopVar1 < LoopVar8) {
- LoopVar3 = mPTLen[LoopVar1++];
- if (LoopVar3 <= 6) {
- PutBits (3, LoopVar3);
- } else {
- PutBits (LoopVar3 - 3, (1U << (LoopVar3 - 3)) - 2);
- }
-
- if (LoopVar1 == Special) {
- while (LoopVar1 < 6 && mPTLen[LoopVar1] == 0) {
- LoopVar1++;
- }
-
- PutBits (2, (LoopVar1 - 3) & 3);
- }
- }
-}
-
-/**
- Outputs the code length array for Char&Length Set.
-**/
-VOID
-EFIAPI
-WriteCLen (
- VOID
- )
-{
- INT32 LoopVar1;
-
- INT32 LoopVar3;
-
- INT32 LoopVar8;
-
- INT32 Count;
-
- LoopVar8 = NC;
- while (LoopVar8 > 0 && mCLen[LoopVar8 - 1] == 0) {
- LoopVar8--;
- }
-
- PutBits (CBIT, LoopVar8);
- LoopVar1 = 0;
- while (LoopVar1 < LoopVar8) {
- LoopVar3 = mCLen[LoopVar1++];
- if (LoopVar3 == 0) {
- Count = 1;
- while (LoopVar1 < LoopVar8 && mCLen[LoopVar1] == 0) {
- LoopVar1++;
- Count++;
- }
-
- if (Count <= 2) {
- for (LoopVar3 = 0; LoopVar3 < Count; LoopVar3++) {
- PutBits (mPTLen[0], mPTCode[0]);
- }
- } else if (Count <= 18) {
- PutBits (mPTLen[1], mPTCode[1]);
- PutBits (4, Count - 3);
- } else if (Count == 19) {
- PutBits (mPTLen[0], mPTCode[0]);
- PutBits (mPTLen[1], mPTCode[1]);
- PutBits (4, 15);
- } else {
- PutBits (mPTLen[2], mPTCode[2]);
- PutBits (CBIT, Count - 20);
- }
- } else {
- ASSERT((LoopVar3+2)<NPT);
- PutBits (mPTLen[LoopVar3 + 2], mPTCode[LoopVar3 + 2]);
- }
- }
-}
-
-/**
- Huffman code the block and output it.
-
-**/
-VOID
-EFIAPI
-SendBlock (
- VOID
- )
-{
- UINT32 LoopVar1;
-
- UINT32 LoopVar3;
-
- UINT32 Flags;
-
- UINT32 Root;
-
- UINT32 Pos;
-
- UINT32 Size;
- Flags = 0;
-
- Root = MakeTree (NC, mCFreq, mCLen, mCCode);
- Size = mCFreq[Root];
- PutBits (16, Size);
- if (Root >= NC) {
- CountTFreq ();
- Root = MakeTree (NT, mTFreq, mPTLen, mPTCode);
- if (Root >= NT) {
- WritePTLen (NT, TBIT, 3);
- } else {
- PutBits (TBIT, 0);
- PutBits (TBIT, Root);
- }
-
- WriteCLen ();
- } else {
- PutBits (TBIT, 0);
- PutBits (TBIT, 0);
- PutBits (CBIT, 0);
- PutBits (CBIT, Root);
- }
-
- Root = MakeTree (NP, mPFreq, mPTLen, mPTCode);
- if (Root >= NP) {
- WritePTLen (NP, PBIT, -1);
- } else {
- PutBits (PBIT, 0);
- PutBits (PBIT, Root);
- }
-
- Pos = 0;
- for (LoopVar1 = 0; LoopVar1 < Size; LoopVar1++) {
- if (LoopVar1 % UINT8_BIT == 0) {
- Flags = mBuf[Pos++];
- } else {
- Flags <<= 1;
- }
- if ((Flags & (1U << (UINT8_BIT - 1))) != 0){
- EncodeC(mBuf[Pos++] + (1U << UINT8_BIT));
- LoopVar3 = mBuf[Pos++] << UINT8_BIT;
- LoopVar3 += mBuf[Pos++];
-
- EncodeP (LoopVar3);
- } else {
- EncodeC (mBuf[Pos++]);
- }
- }
-
- SetMem (mCFreq, NC * sizeof (UINT16), 0);
- SetMem (mPFreq, NP * sizeof (UINT16), 0);
-}
-
-/**
- Start the huffman encoding.
-
-**/
-VOID
-EFIAPI
-HufEncodeStart (
- VOID
- )
-{
- SetMem (mCFreq, NC * sizeof (UINT16), 0);
- SetMem (mPFreq, NP * sizeof (UINT16), 0);
-
- mOutputPos = mOutputMask = 0;
-
- mBitCount = UINT8_BIT;
- mSubBitBuf = 0;
-}
-
-/**
- Outputs an Original Character or a Pointer.
-
- @param[in] LoopVar5 The original character or the 'String Length' element of
- a Pointer.
- @param[in] LoopVar7 The 'Position' field of a Pointer.
-**/
-VOID
-EFIAPI
-CompressOutput (
- IN UINT32 LoopVar5,
- IN UINT32 LoopVar7
- )
-{
- STATIC UINT32 CPos;
-
- if ((mOutputMask >>= 1) == 0) {
- mOutputMask = 1U << (UINT8_BIT - 1);
- if (mOutputPos >= mBufSiz - 3 * UINT8_BIT) {
- SendBlock ();
- mOutputPos = 0;
- }
-
- CPos = mOutputPos++;
- mBuf[CPos] = 0;
- }
- mBuf[mOutputPos++] = (UINT8) LoopVar5;
- mCFreq[LoopVar5]++;
- if (LoopVar5 >= (1U << UINT8_BIT)) {
- mBuf[CPos] = (UINT8)(mBuf[CPos]|mOutputMask);
- mBuf[mOutputPos++] = (UINT8)(LoopVar7 >> UINT8_BIT);
- mBuf[mOutputPos++] = (UINT8) LoopVar7;
- LoopVar5 = 0;
- while (LoopVar7!=0) {
- LoopVar7 >>= 1;
- LoopVar5++;
- }
- mPFreq[LoopVar5]++;
- }
-}
-
-/**
- End the huffman encoding.
-
-**/
-VOID
-EFIAPI
-HufEncodeEnd (
- VOID
- )
-{
- SendBlock ();
-
- //
- // Flush remaining bits
- //
- PutBits (UINT8_BIT - 1, 0);
-}
-
-/**
- The main controlling routine for compression process.
-
- @retval EFI_SUCCESS The compression is successful.
- @retval EFI_OUT_0F_RESOURCES Not enough memory for compression process.
-**/
-EFI_STATUS
-EFIAPI
-Encode (
- VOID
- )
-{
- EFI_STATUS Status;
- INT32 LastMatchLen;
- NODE LastMatchPos;
-
- Status = AllocateMemory ();
- if (EFI_ERROR (Status)) {
- FreeMemory ();
- return Status;
- }
-
- InitSlide ();
-
- HufEncodeStart ();
-
- mRemainder = FreadCrc (&mText[WNDSIZ], WNDSIZ + MAXMATCH);
-
- mMatchLen = 0;
- mPos = WNDSIZ;
- InsertNode ();
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
-
- while (mRemainder > 0) {
- LastMatchLen = mMatchLen;
- LastMatchPos = mMatchPos;
- if (!GetNextMatch ()) {
- Status = EFI_OUT_OF_RESOURCES;
- }
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
-
- if (mMatchLen > LastMatchLen || LastMatchLen < THRESHOLD) {
- //
- // Not enough benefits are gained by outputting a pointer,
- // so just output the original character
- //
- CompressOutput(mText[mPos - 1], 0);
- } else {
- //
- // Outputting a pointer is beneficial enough, do it.
- //
-
- CompressOutput(LastMatchLen + (UINT8_MAX + 1 - THRESHOLD),
- (mPos - LastMatchPos - 2) & (WNDSIZ - 1));
- LastMatchLen--;
- while (LastMatchLen > 0) {
- if (!GetNextMatch ()) {
- Status = EFI_OUT_OF_RESOURCES;
- }
- LastMatchLen--;
- }
-
- if (mMatchLen > mRemainder) {
- mMatchLen = mRemainder;
- }
- }
- }
-
- HufEncodeEnd ();
- FreeMemory ();
- return (Status);
-}
-
-/**
- The compression routine.
-
- @param[in] SrcBuffer The buffer containing the source data.
- @param[in] SrcSize The number of bytes in SrcBuffer.
- @param[in] DstBuffer The buffer to put the compressed image in.
- @param[in, out] DstSize On input the size (in bytes) of DstBuffer, on
- return the number of bytes placed in DstBuffer.
-
- @retval EFI_SUCCESS The compression was sucessful.
- @retval EFI_BUFFER_TOO_SMALL The buffer was too small. DstSize is required.
-**/
-EFI_STATUS
-EFIAPI
-Compress (
- IN VOID *SrcBuffer,
- IN UINT64 SrcSize,
- IN VOID *DstBuffer,
- IN OUT UINT64 *DstSize
- )
-{
- EFI_STATUS Status;
-
- //
- // Initializations
- //
- mBufSiz = 0;
- mBuf = NULL;
- mText = NULL;
- mLevel = NULL;
- mChildCount = NULL;
- mPosition = NULL;
- mParent = NULL;
- mPrev = NULL;
- mNext = NULL;
-
- mSrc = SrcBuffer;
- mSrcUpperLimit = mSrc + SrcSize;
- mDst = DstBuffer;
- mDstUpperLimit = mDst +*DstSize;
-
- PutDword (0L);
- PutDword (0L);
-
- MakeCrcTable ();
-
- mOrigSize = mCompSize = 0;
- mCrc = INIT_CRC;
-
- //
- // Compress it
- //
- Status = Encode ();
- if (EFI_ERROR (Status)) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // Null terminate the compressed data
- //
- if (mDst < mDstUpperLimit) {
- *mDst++ = 0;
- }
- //
- // Fill in compressed size and original size
- //
- mDst = DstBuffer;
- PutDword (mCompSize + 1);
- PutDword (mOrigSize);
-
- //
- // Return
- //
- if (mCompSize + 1 + 8 > *DstSize) {
- *DstSize = mCompSize + 1 + 8;
- return EFI_BUFFER_TOO_SMALL;
- } else {
- *DstSize = mCompSize + 1 + 8;
- return EFI_SUCCESS;
- }
-
-}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h
deleted file mode 100644
index 39a997178f..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
- Header file for compression routine.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _EFI_SHELL_COMPRESS_H_
-#define _EFI_SHELL_COMPRESS_H_
-
-/**
- The compression routine.
-
- @param[in] SrcBuffer The buffer containing the source data.
- @param[in] SrcSize Number of bytes in SrcBuffer.
- @param[in] DstBuffer The buffer to put the compressed image in.
- @param[in, out] DstSize On input the size (in bytes) of DstBuffer, on
- return the number of bytes placed in DstBuffer.
-
- @retval EFI_SUCCESS The compression was sucessful.
- @retval EFI_BUFFER_TOO_SMALL The buffer was too small. DstSize is required.
-**/
-EFI_STATUS
-EFIAPI
-Compress (
- IN VOID *SrcBuffer,
- IN UINT64 SrcSize,
- IN VOID *DstBuffer,
- IN OUT UINT64 *DstSize
- );
-
-#endif
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c
deleted file mode 100644
index 1c86f1df21..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/** @file
- Main file for Dblk shell Debug1 function.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include <Protocol/BlockIo.h>
-
-/**
- Display blocks to the screen.
-
- @param[in] DevPath The device path to get the blocks from.
- @param[in] Lba The Lba number to start from.
- @param[in] BlockCount How many blocks to display.
-
- @retval SHELL_SUCCESS The display was successful.
-**/
-SHELL_STATUS
-EFIAPI
-DisplayTheBlocks(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevPath,
- IN CONST UINT64 Lba,
- IN CONST UINT8 BlockCount
- )
-{
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
- EFI_HANDLE BlockIoHandle;
- EFI_STATUS Status;
- SHELL_STATUS ShellStatus;
- UINT8 *Buffer;
- UINTN BufferSize;
-
- ShellStatus = SHELL_SUCCESS;
-
- Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, (EFI_DEVICE_PATH_PROTOCOL **)&DevPath, &BlockIoHandle);
- if (EFI_ERROR(Status)) {
- return (SHELL_NOT_FOUND);
- }
-
- Status = gBS->OpenProtocol(BlockIoHandle, &gEfiBlockIoProtocolGuid, (VOID**)&BlockIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
- return (SHELL_NOT_FOUND);
- }
-
- BufferSize = BlockIo->Media->BlockSize * BlockCount;
- if (BufferSize > 0) {
- Buffer = AllocateZeroPool(BufferSize);
- } else {
- ShellPrintEx(-1,-1,L" BlockSize: 0x%08x, BlockCount: 0x%08x\r\n", BlockIo->Media->BlockSize, BlockCount);
- Buffer = NULL;
- }
-
- Status = BlockIo->ReadBlocks(BlockIo, BlockIo->Media->MediaId, Lba, BufferSize, Buffer);
- if (!EFI_ERROR(Status) && Buffer != NULL) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DBLK_HEADER),
- gShellDebug1HiiHandle,
- Lba,
- BufferSize,
- BlockIo
- );
-
- DumpHex(2,0,BufferSize,Buffer);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_READ_FAIL), gShellDebug1HiiHandle, L"BlockIo", Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
-
- if (Buffer != NULL) {
- FreePool(Buffer);
- }
-
- gBS->CloseProtocol(BlockIoHandle, &gEfiBlockIoProtocolGuid, gImageHandle, NULL);
- return (ShellStatus);
-}
-
-/**
- Function for 'dblk' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDblk (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *BlockName;
- CONST CHAR16 *LbaString;
- CONST CHAR16 *BlockCountString;
- UINT64 Lba;
- UINT64 BlockCount;
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Parse the params
- //
- BlockName = ShellCommandLineGetRawValue(Package, 1);
- LbaString = ShellCommandLineGetRawValue(Package, 2);
- BlockCountString = ShellCommandLineGetRawValue(Package, 3);
-
- if (LbaString == NULL) {
- Lba = 0;
- } else {
- if (!ShellIsHexOrDecimalNumber(LbaString, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, LbaString);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- ShellConvertStringToUint64(LbaString, &Lba, TRUE, FALSE);
- }
-
- if (BlockCountString == NULL) {
- BlockCount = 1;
- } else {
- if (!ShellIsHexOrDecimalNumber(BlockCountString, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, BlockCountString);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- ShellConvertStringToUint64(BlockCountString, &BlockCount, TRUE, FALSE);
- if (BlockCount > 0x10) {
- BlockCount = 0x10;
- } else if (BlockCount == 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, BlockCountString);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // do the work if we have a valid block identifier
- //
- if (gEfiShellProtocol->GetDevicePathFromMap(BlockName) == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, BlockName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- DevPath = (EFI_DEVICE_PATH_PROTOCOL*)gEfiShellProtocol->GetDevicePathFromMap(BlockName);
- if (gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &DevPath, NULL) == EFI_NOT_FOUND) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MAP_PROTOCOL), gShellDebug1HiiHandle, BlockName, L"BlockIo");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ShellStatus = DisplayTheBlocks(gEfiShellProtocol->GetDevicePathFromMap(BlockName), Lba, (UINT8)BlockCount);
- }
- }
- }
- }
-
- ShellCommandLineFreeVarList (Package);
- }
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
deleted file mode 100644
index dfee96bb29..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/** @file
- Main file for Dmem shell Debug1 function.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include <Protocol/PciRootBridgeIo.h>
-#include <Guid/Acpi.h>
-#include <Guid/Mps.h>
-#include <Guid/SmBios.h>
-#include <Guid/SalSystemTable.h>
-
-/**
- Make a printable character.
-
- If Char is printable then return it, otherwise return a question mark.
-
- @param[in] Char The character to make printable.
-
- @return A printable character representing Char.
-**/
-CHAR16
-EFIAPI
-MakePrintable(
- IN CONST CHAR16 Char
- )
-{
- if ((Char < 0x20 && Char > 0)||(Char > 126)) {
- return (L'?');
- }
- return (Char);
-}
-
-/**
- Display some Memory-Mapped-IO memory.
-
- @param[in] Address The starting address to display.
- @param[in] Size The length of memory to display.
-**/
-SHELL_STATUS
-EFIAPI
-DisplayMmioMemory(
- IN CONST VOID *Address,
- IN CONST UINTN Size
- )
-{
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRbIo;
- EFI_STATUS Status;
- VOID *Buffer;
- SHELL_STATUS ShellStatus;
-
- ShellStatus = SHELL_SUCCESS;
-
- Status = gBS->LocateProtocol(&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**)&PciRbIo);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle);
- return (SHELL_NOT_FOUND);
- }
- Buffer = AllocateZeroPool(Size);
- ASSERT(Buffer != NULL);
-
- Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, (UINT64)(UINTN)Address, Size, Buffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, Status);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
- DumpHex(2,0,Size,Buffer);
- }
-
- FreePool(Buffer);
- return (ShellStatus);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-mmio", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'dmem' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDmem (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- VOID *Address;
- UINT64 Size;
- CONST CHAR16 *Temp1;
- UINT64 AcpiTableAddress;
- UINT64 Acpi20TableAddress;
- UINT64 SalTableAddress;
- UINT64 SmbiosTableAddress;
- UINT64 MpsTableAddress;
- UINTN TableWalker;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- Address = NULL;
- Size = 0;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Temp1 = ShellCommandLineGetRawValue(Package, 1);
- if (Temp1 == NULL) {
- Address = gST;
- Size = 512;
- } else {
- if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, (UINT64*)&Address, TRUE, FALSE))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- Temp1 = ShellCommandLineGetRawValue(Package, 2);
- if (Temp1 == NULL) {
- Size = 512;
- } else {
- if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, &Size, TRUE, FALSE))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- if (!ShellCommandLineGetFlag(Package, L"-mmio")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
- DumpHex(2,0,(UINTN)Size,Address);
- if (Address == (VOID*)gST) {
- Acpi20TableAddress = 0;
- AcpiTableAddress = 0;
- SalTableAddress = 0;
- SmbiosTableAddress = 0;
- MpsTableAddress = 0;
- for (TableWalker = 0 ; TableWalker < gST->NumberOfTableEntries ; TableWalker++) {
- if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi20TableGuid)) {
- Acpi20TableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
- continue;
- }
- if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi10TableGuid)) {
- AcpiTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
- continue;
- }
- if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSalSystemTableGuid)) {
- SalTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
- continue;
- }
- if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbiosTableGuid)) {
- SmbiosTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
- continue;
- }
- if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiMpsTableGuid)) {
- MpsTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
- continue;
- }
- }
-
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle,
- (UINT64)(UINTN)Address,
- gST->Hdr.HeaderSize,
- gST->Hdr.Revision,
- (UINT64)(UINTN)gST->ConIn,
- (UINT64)(UINTN)gST->ConOut,
- (UINT64)(UINTN)gST->StdErr,
- (UINT64)(UINTN)gST->RuntimeServices,
- (UINT64)(UINTN)gST->BootServices,
- SalTableAddress,
- AcpiTableAddress,
- Acpi20TableAddress,
- MpsTableAddress,
- SmbiosTableAddress
- );
- }
- } else {
- ShellStatus = DisplayMmioMemory(Address, (UINTN)Size);
- }
- }
-
-
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
deleted file mode 100644
index 4bcc55bdd3..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/** @file
- Main file for DmpStore shell Debug1 function.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-
-STATIC CHAR16 *AttrType[] = {
- L"invalid", // 000
- L"invalid", // 001
- L"BS", // 010
- L"NV+BS", // 011
- L"RT+BS", // 100
- L"NV+RT+BS", // 101
- L"RT+BS", // 110
- L"NV+RT+BS", // 111
-};
-
-/**
- Function to display or delete variables.
-
- @param[in] VariableName The variable name of the EFI variable (or NULL).
- @param[in] Guid The GUID of the variable set (or NULL).
- @param[in] Delete TRUE to delete, FALSE otherwise.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_OUT_OF_RESOURCES A memorty allocation failed.
- @retval SHELL_ABORTED The abort message was received.
- @retval SHELL_DEVICE_ERROR UEFI Variable Services returned an error.
- @retval SHELL_NOT_FOUND the Name/Guid pair could not be found.
-**/
-SHELL_STATUS
-EFIAPI
-ProcessVariables (
- IN CONST CHAR16 *VariableName OPTIONAL,
- IN CONST EFI_GUID *Guid OPTIONAL,
- IN BOOLEAN Delete
- )
-{
- EFI_STATUS Status;
- UINT64 MaxStorSize;
- UINT64 RemStorSize;
- UINT64 MaxVarSize;
- CHAR16 *FoundVarName;
- UINTN Size;
- EFI_GUID FoundVarGuid;
- UINT8 *DataBuffer;
- UINTN DataSize;
- UINT32 Atts;
- SHELL_STATUS ShellStatus;
- BOOLEAN Found;
-
- Status = gRT->QueryVariableInfo(EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS|EFI_VARIABLE_NON_VOLATILE, &MaxStorSize, &RemStorSize, &MaxVarSize);
- if (EFI_ERROR(Status)) {
- return (SHELL_DEVICE_ERROR);
- }
-
- Found = FALSE;
- ShellStatus = SHELL_SUCCESS;
- Size = PcdGet16(PcdShellFileOperationSize);
- FoundVarName = AllocateZeroPool(Size);
-
- if (FoundVarName == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- FoundVarName[0] = CHAR_NULL;
-
-
- DataSize = (UINTN)MaxVarSize;
- DataBuffer = AllocateZeroPool(DataSize);
- if (DataBuffer == NULL) {
- FreePool(FoundVarName);
- return (SHELL_OUT_OF_RESOURCES);
- }
-
- for (;;){
- if (ShellGetExecutionBreakFlag()) {
- ShellStatus = SHELL_ABORTED;
- break;
- }
- Size = (UINTN)PcdGet16(PcdShellFileOperationSize);
- DataSize = (UINTN)MaxVarSize;
-
- Status = gRT->GetNextVariableName(&Size, FoundVarName, &FoundVarGuid);
- if (Status == EFI_NOT_FOUND) {
- break;
- }
- ASSERT_EFI_ERROR(Status);
-
- Status = gRT->GetVariable(FoundVarName, &FoundVarGuid, &Atts, &DataSize, DataBuffer);
- ASSERT_EFI_ERROR(Status);
-
- //
- // Check if it matches
- //
- if (VariableName != NULL) {
- if (!gUnicodeCollation->MetaiMatch(gUnicodeCollation, FoundVarName, (CHAR16*)VariableName)) {
- continue;
- }
- }
- if (Guid != NULL) {
- if (!CompareGuid(&FoundVarGuid, Guid)) {
- continue;
- }
- }
-
- //
- // do the print or delete
- //
- Found = TRUE;
- if (!Delete) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_DMPSTORE_HEADER_LINE),
- gShellDebug1HiiHandle,
- AttrType[Atts & 7],
- &FoundVarGuid,
- FoundVarName,
- DataSize);
- DumpHex(2, 0, DataSize, DataBuffer);
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_DMPSTORE_DELETE_LINE),
- gShellDebug1HiiHandle,
- &FoundVarGuid,
- FoundVarName);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_DMPSTORE_DELETE_DONE),
- gShellDebug1HiiHandle,
- gRT->SetVariable(FoundVarName, &FoundVarGuid, Atts, 0, NULL));
- }
- }
-
- if (FoundVarName != NULL) {
- FreePool(FoundVarName);
- }
- if (DataBuffer != NULL) {
- FreePool(DataBuffer);
- }
- if (!Found) {
- if (VariableName != NULL && Guid == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N), gShellDebug1HiiHandle, VariableName);
- } else if (VariableName != NULL && Guid != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_GN), gShellDebug1HiiHandle, Guid, VariableName);
- } else if (VariableName == NULL && Guid == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND), gShellDebug1HiiHandle);
- } else if (VariableName == NULL && Guid != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_G), gShellDebug1HiiHandle, Guid);
- }
- return (SHELL_NOT_FOUND);
- }
- return (SHELL_SUCCESS);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-d", TypeFlag},
- {L"-l", TypeFlag},
- {L"-s", TypeFlag},
- {L"-all", TypeFlag},
- {L"-guid", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'dmpstore' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDmpStore (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Temp;
- EFI_GUID *Guid;
- EFI_GUID GuidData;
- CONST CHAR16 *VariableName;
-
- ShellStatus = SHELL_SUCCESS;
- Package = NULL;
-
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-all") && ShellCommandLineGetFlag(Package, L"-guid")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"-all", L"-guid");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if ((ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) && ShellCommandLineGetFlag(Package, L"-d")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"-l or -s", L"-d");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (!ShellCommandLineGetFlag(Package, L"-all")) {
- Temp = ShellCommandLineGetValue(Package, L"-guid");
- if (Temp != NULL) {
- Status = ConvertStringToGuid(Temp, &GuidData);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- Guid = &GuidData;
- } else {
- Guid = &gEfiGlobalVariableGuid;
- }
- VariableName = ShellCommandLineGetRawValue(Package, 1);
- } else {
- VariableName = NULL;
- Guid = NULL;
- }
- if (ShellStatus == SHELL_SUCCESS) {
- if (ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) {
- ///@todo fix this after lib ready...
- ShellPrintEx(-1, -1, L"Not implemeneted yet.\r\n");
- ShellStatus = SHELL_UNSUPPORTED;
- } else {
- ShellStatus = ProcessVariables (VariableName, Guid, ShellCommandLineGetFlag(Package, L"-d"));
- }
- }
- }
- }
-
- if (Package != NULL) {
- ShellCommandLineFreeVarList (Package);
- }
- return ShellStatus;
-}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c
deleted file mode 100644
index c28f9bc591..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file
- Main file for Edit shell Debug1 function.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include "TextEditor.h"
-
-/**
- Function for 'edit' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEdit (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- CHAR16 *Buffer;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- LIST_ENTRY *Package;
- CONST CHAR16 *Cwd;
- CHAR16 *Nfs;
- CHAR16 *Spot;
- CONST CHAR16 *TempParam;
-// SHELL_FILE_HANDLE TempHandle;
-
- Buffer = NULL;
- ShellStatus = SHELL_SUCCESS;
- Nfs = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Cwd = gEfiShellProtocol->GetCurDir(NULL);
- if (Cwd == NULL) {
- Cwd = ShellGetEnvironmentVariable(L"path");
- if (Cwd != NULL) {
- Nfs = StrnCatGrow(&Nfs, NULL, Cwd+3, 0);
- if (Nfs != NULL) {
- Spot = StrStr(Nfs, L";");
- if (Spot != NULL) {
- *Spot = CHAR_NULL;
- }
- Spot = StrStr(Nfs, L"\\");
- if (Spot != NULL) {
- Spot[1] = CHAR_NULL;
- }
- gEfiShellProtocol->SetCurDir(NULL, Nfs);
- FreePool(Nfs);
- }
- }
- }
-
- Status = MainEditorInit ();
-
- if (EFI_ERROR (Status)) {
- gST->ConOut->ClearScreen (gST->ConOut);
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_MAIN_INIT_FAILED), gShellDebug1HiiHandle);
- } else {
- MainEditorBackup ();
-
- //
- // if editor launched with file named
- //
- if (ShellCommandLineGetCount(Package) == 2) {
- TempParam = ShellCommandLineGetRawValue(Package, 1);
- ASSERT(TempParam != NULL);
- FileBufferSetFileName (TempParam);
-// if (EFI_ERROR(ShellFileExists(MainEditor.FileBuffer->FileName))) {
-// Status = ShellOpenFileByName(MainEditor.FileBuffer->FileName, &TempHandle, EFI_FILE_MODE_CREATE|EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
-// if (!EFI_ERROR(Status)) {
-// ShellCloseFile(&TempHandle);
-// }
-// }
- }
-
- Status = FileBufferRead (MainEditor.FileBuffer->FileName, FALSE);
- if (!EFI_ERROR (Status)) {
- MainEditorRefresh ();
-
- Status = MainEditorKeyInput ();
- }
-
- if (Status != EFI_OUT_OF_RESOURCES) {
- //
- // back up the status string
- //
- Buffer = CatSPrint (NULL, L"%s", StatusBarGetString());
- }
-
- MainEditorCleanup ();
-
- //
- // print editor exit code on screen
- //
- if (Status == EFI_SUCCESS) {
- } else if (Status == EFI_OUT_OF_RESOURCES) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_GEN_OUT_MEM), gShellDebug1HiiHandle);
- } else {
- if (Buffer != NULL) {
- if (StrCmp (Buffer, L"") != 0) {
- //
- // print out the status string
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_MAIN_BUFFER), gShellDebug1HiiHandle, Buffer);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), gShellDebug1HiiHandle);
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), gShellDebug1HiiHandle);
- }
- }
-
- if (Status != EFI_OUT_OF_RESOURCES) {
- SHELL_FREE_NON_NULL (Buffer);
- }
- }
- }
- ShellCommandLineFreeVarList (Package);
- }
- return ShellStatus;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
deleted file mode 100644
index ff1d000aeb..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
+++ /dev/null
@@ -1,3358 +0,0 @@
-/** @file
- Implements filebuffer interface functions.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "TextEditor.h"
-#include <Guid/FileSystemInfo.h>
-#include <Library/FileHandleLib.h>
-
-EFI_EDITOR_FILE_BUFFER FileBuffer;
-EFI_EDITOR_FILE_BUFFER FileBufferBackupVar;
-
-//
-// for basic initialization of FileBuffer
-//
-EFI_EDITOR_FILE_BUFFER FileBufferConst = {
- NULL,
- FileTypeUnicode,
- NULL,
- NULL,
- 0,
- {
- 0,
- 0
- },
- {
- 0,
- 0
- },
- {
- 0,
- 0
- },
- {
- 0,
- 0
- },
- FALSE,
- TRUE,
- FALSE,
- NULL
-};
-
-//
-// the whole edit area needs to be refreshed
-//
-BOOLEAN FileBufferNeedRefresh;
-
-//
-// only the current line in edit area needs to be refresh
-//
-BOOLEAN FileBufferOnlyLineNeedRefresh;
-
-BOOLEAN FileBufferMouseNeedRefresh;
-
-extern BOOLEAN EditorMouseAction;
-
-/**
- Initialization function for FileBuffer.
-
- @param EFI_SUCCESS The initialization was successful.
- @param EFI_LOAD_ERROR A default name could not be created.
- @param EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferInit (
- VOID
- )
-{
- //
- // basically initialize the FileBuffer
- //
- CopyMem (&FileBuffer , &FileBufferConst, sizeof (EFI_EDITOR_FILE_BUFFER));
- CopyMem (&FileBufferBackupVar, &FileBufferConst, sizeof (EFI_EDITOR_FILE_BUFFER));
-
- //
- // set default FileName
- //
- FileBuffer.FileName = EditGetDefaultFileName (L"txt");
- if (FileBuffer.FileName == NULL) {
- return EFI_LOAD_ERROR;
- }
-
- FileBuffer.ListHead = AllocateZeroPool (sizeof (LIST_ENTRY));
- if (FileBuffer.ListHead == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- InitializeListHead (FileBuffer.ListHead);
-
- FileBuffer.DisplayPosition.Row = 2;
- FileBuffer.DisplayPosition.Column = 1;
- FileBuffer.LowVisibleRange.Row = 2;
- FileBuffer.LowVisibleRange.Column = 1;
-
- FileBufferNeedRefresh = FALSE;
- FileBufferMouseNeedRefresh = FALSE;
- FileBufferOnlyLineNeedRefresh = FALSE;
-
- return EFI_SUCCESS;
-}
-
-/**
- Backup function for FileBuffer. Only backup the following items:
- Mouse/Cursor position
- File Name, Type, ReadOnly, Modified
- Insert Mode
-
- This is for making the file buffer refresh as few as possible.
-
- @retval EFI_SUCCESS The backup operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferBackup (
- VOID
- )
-{
- FileBufferBackupVar.MousePosition = FileBuffer.MousePosition;
-
- SHELL_FREE_NON_NULL (FileBufferBackupVar.FileName);
- FileBufferBackupVar.FileName = NULL;
- FileBufferBackupVar.FileName = StrnCatGrow (&FileBufferBackupVar.FileName, NULL, FileBuffer.FileName, 0);
-
- FileBufferBackupVar.ModeInsert = FileBuffer.ModeInsert;
- FileBufferBackupVar.FileType = FileBuffer.FileType;
-
- FileBufferBackupVar.FilePosition = FileBuffer.FilePosition;
- FileBufferBackupVar.LowVisibleRange = FileBuffer.LowVisibleRange;
-
- FileBufferBackupVar.FileModified = FileBuffer.FileModified;
- FileBufferBackupVar.ReadOnly = FileBuffer.ReadOnly;
-
- return EFI_SUCCESS;
-}
-
-/**
- Advance to the next Count lines
-
- @param[in] Count The line number to advance by.
- @param[in] CurrentLine The pointer to the current line structure.
- @param[in] LineList The pointer to the linked list of lines.
-
- @retval NULL There was an error.
- @return The line structure after the advance.
-**/
-EFI_EDITOR_LINE *
-EFIAPI
-InternalEditorMiscLineAdvance (
- IN CONST UINTN Count,
- IN CONST EFI_EDITOR_LINE *CurrentLine,
- IN CONST LIST_ENTRY *LineList
- )
-
-{
- UINTN Index;
- CONST EFI_EDITOR_LINE *Line;
-
- if (CurrentLine == NULL || LineList == NULL) {
- return NULL;
- }
-
- for (Line = CurrentLine, Index = 0; Index < Count; Index++) {
- //
- // if already last line
- //
- if (Line->Link.ForwardLink == LineList) {
- return NULL;
- }
-
- Line = CR (Line->Link.ForwardLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- }
-
- return ((EFI_EDITOR_LINE *)Line);
-}
-
-/**
- Retreat to the previous Count lines.
-
- @param[in] Count The line number to retreat by.
- @param[in] CurrentLine The pointer to the current line structure.
- @param[in] LineList The pointer to the linked list of lines.
-
- @retval NULL There was an error.
- @return The line structure after the retreat.
-**/
-EFI_EDITOR_LINE *
-EFIAPI
-InternalEditorMiscLineRetreat (
- IN CONST UINTN Count,
- IN CONST EFI_EDITOR_LINE *CurrentLine,
- IN CONST LIST_ENTRY *LineList
- )
-
-{
- UINTN Index;
- CONST EFI_EDITOR_LINE *Line;
-
- if (CurrentLine == NULL || LineList == NULL) {
- return NULL;
- }
-
- for (Line = CurrentLine, Index = 0; Index < Count; Index++) {
- //
- // already the first line
- //
- if (Line->Link.BackLink == LineList) {
- return NULL;
- }
-
- Line = CR (Line->Link.BackLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- }
-
- return ((EFI_EDITOR_LINE *)Line);
-}
-
-/**
- Advance/Retreat lines
-
- @param[in] Count line number to advance/retreat
- >0 : advance
- <0 : retreat
-
- @retval NULL An error occured.
- @return The line after advance/retreat.
-**/
-EFI_EDITOR_LINE *
-MoveLine (
- IN CONST INTN Count
- )
-{
- EFI_EDITOR_LINE *Line;
- UINTN AbsCount;
-
- //
- // if < 0, then retreat
- // if > 0, the advance
- //
- if (Count <= 0) {
- AbsCount = (UINTN)ABS(Count);
- Line = InternalEditorMiscLineRetreat (AbsCount,MainEditor.FileBuffer->CurrentLine,MainEditor.FileBuffer->ListHead);
- } else {
- Line = InternalEditorMiscLineAdvance ((UINTN)Count,MainEditor.FileBuffer->CurrentLine,MainEditor.FileBuffer->ListHead);
- }
-
- return Line;
-}
-
-/**
- Function to update the 'screen' to display the mouse position.
-
- @retval EFI_SUCCESS The backup operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferRestoreMousePosition (
- VOID
- )
-{
- EFI_EDITOR_COLOR_UNION Orig;
- EFI_EDITOR_COLOR_UNION New;
- UINTN FRow;
- UINTN FColumn;
- BOOLEAN HasCharacter;
- EFI_EDITOR_LINE *CurrentLine;
- EFI_EDITOR_LINE *Line;
- CHAR16 Value;
-
- //
- // variable initialization
- //
- Line = NULL;
-
- if (MainEditor.MouseSupported) {
-
- if (FileBufferMouseNeedRefresh) {
-
- FileBufferMouseNeedRefresh = FALSE;
-
- //
- // if mouse position not moved and only mouse action
- // so do not need to refresh mouse position
- //
- if ((FileBuffer.MousePosition.Row == FileBufferBackupVar.MousePosition.Row &&
- FileBuffer.MousePosition.Column == FileBufferBackupVar.MousePosition.Column)
- && EditorMouseAction) {
- return EFI_SUCCESS;
- }
- //
- // backup the old screen attributes
- //
- Orig = MainEditor.ColorAttributes;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
- //
- // clear the old mouse position
- //
- FRow = FileBuffer.LowVisibleRange.Row + FileBufferBackupVar.MousePosition.Row - 2;
-
- FColumn = FileBuffer.LowVisibleRange.Column + FileBufferBackupVar.MousePosition.Column - 1;
-
- HasCharacter = TRUE;
- if (FRow > FileBuffer.NumLines) {
- HasCharacter = FALSE;
- } else {
- CurrentLine = FileBuffer.CurrentLine;
- Line = MoveLine (FRow - FileBuffer.FilePosition.Row);
-
- if (Line == NULL || FColumn > Line->Size) {
- HasCharacter = FALSE;
- }
-
- FileBuffer.CurrentLine = CurrentLine;
- }
-
- ShellPrintEx (
- (INT32)FileBufferBackupVar.MousePosition.Column - 1,
- (INT32)FileBufferBackupVar.MousePosition.Row - 1,
- L" "
- );
-
- if (HasCharacter) {
- Value = (Line->Buffer[FColumn - 1]);
- ShellPrintEx (
- (INT32)FileBufferBackupVar.MousePosition.Column - 1,
- (INT32)FileBufferBackupVar.MousePosition.Row - 1,
- L"%c",
- Value
- );
- }
- //
- // set the new mouse position
- //
- gST->ConOut->SetAttribute (gST->ConOut, New.Data);
-
- //
- // clear the old mouse position
- //
- FRow = FileBuffer.LowVisibleRange.Row + FileBuffer.MousePosition.Row - 2;
- FColumn = FileBuffer.LowVisibleRange.Column + FileBuffer.MousePosition.Column - 1;
-
- HasCharacter = TRUE;
- if (FRow > FileBuffer.NumLines) {
- HasCharacter = FALSE;
- } else {
- CurrentLine = FileBuffer.CurrentLine;
- Line = MoveLine (FRow - FileBuffer.FilePosition.Row);
-
- if (Line == NULL || FColumn > Line->Size) {
- HasCharacter = FALSE;
- }
-
- FileBuffer.CurrentLine = CurrentLine;
- }
-
- ShellPrintEx (
- (INT32)FileBuffer.MousePosition.Column - 1,
- (INT32)FileBuffer.MousePosition.Row - 1,
- L" "
- );
-
- if (HasCharacter) {
- Value = Line->Buffer[FColumn - 1];
- ShellPrintEx (
- (INT32)FileBuffer.MousePosition.Column - 1,
- (INT32)FileBuffer.MousePosition.Row - 1,
- L"%c",
- Value
- );
- }
- //
- // end of HasCharacter
- //
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
- }
- //
- // end of MouseNeedRefresh
- //
- }
- //
- // end of MouseSupported
- //
- return EFI_SUCCESS;
-}
-
-/**
- Free all the lines in FileBuffer
- Fields affected:
- Lines
- CurrentLine
- NumLines
- ListHead
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferFreeLines (
- VOID
- )
-{
- LIST_ENTRY *Link;
- EFI_EDITOR_LINE *Line;
-
- //
- // free all the lines
- //
- if (FileBuffer.Lines != NULL) {
-
- Line = FileBuffer.Lines;
- Link = &(Line->Link);
- do {
- Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- Link = Link->ForwardLink;
-
- //
- // free line's buffer and line itself
- //
- LineFree (Line);
- } while (Link != FileBuffer.ListHead);
- }
- //
- // clean the line list related structure
- //
- FileBuffer.Lines = NULL;
- FileBuffer.CurrentLine = NULL;
- FileBuffer.NumLines = 0;
-
- FileBuffer.ListHead->ForwardLink = FileBuffer.ListHead;
- FileBuffer.ListHead->BackLink = FileBuffer.ListHead;
-
- return EFI_SUCCESS;
-}
-
-/**
- Cleanup function for FileBuffer.
-
- @retval EFI_SUCCESS The cleanup was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferCleanup (
- VOID
- )
-{
- EFI_STATUS Status;
-
- SHELL_FREE_NON_NULL (FileBuffer.FileName);
-
- //
- // free all the lines
- //
- Status = FileBufferFreeLines ();
-
- SHELL_FREE_NON_NULL (FileBuffer.ListHead);
- FileBuffer.ListHead = NULL;
-
- SHELL_FREE_NON_NULL (FileBufferBackupVar.FileName);
- return Status;
-
-}
-
-/**
- Print a line specified by Line on a row specified by Row of the screen.
-
- @param[in] Line The line to print.
- @param[in] Row The row on the screen to print onto (begin from 1).
-
- @retval EFI_SUCCESS The printing was successful.
-**/
-EFI_STATUS
-FileBufferPrintLine (
- IN CONST EFI_EDITOR_LINE *Line,
- IN CONST UINTN Row
- )
-{
-
- CHAR16 *Buffer;
- UINTN Limit;
- CHAR16 PrintLine[200];
- CHAR16 PrintLine2[250];
-
- //
- // print start from correct character
- //
- Buffer = Line->Buffer + FileBuffer.LowVisibleRange.Column - 1;
-
- Limit = Line->Size - FileBuffer.LowVisibleRange.Column + 1;
- if (Limit > Line->Size) {
- Limit = 0;
- }
-
- StrnCpy (PrintLine, Buffer, MIN(MIN(Limit,MainEditor.ScreenSize.Column), 200));
- for (; Limit < MainEditor.ScreenSize.Column; Limit++) {
- PrintLine[Limit] = L' ';
- }
-
- PrintLine[MainEditor.ScreenSize.Column] = CHAR_NULL;
- ShellCopySearchAndReplace(PrintLine, PrintLine2, 250, L"%", L"^%", FALSE, FALSE);
-
- ShellPrintEx (
- 0,
- (INT32)Row - 1,
- L"%s",
- PrintLine2
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Set the cursor position according to FileBuffer.DisplayPosition.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferRestorePosition (
- VOID
- )
-{
- //
- // set cursor position
- //
- return (gST->ConOut->SetCursorPosition (
- gST->ConOut,
- FileBuffer.DisplayPosition.Column - 1,
- FileBuffer.DisplayPosition.Row - 1
- ));
-}
-
-/**
- Refresh the screen with whats in the buffer.
-
- @retval EFI_SUCCESS The refresh was successful.
- @retval EFI_LOAD_ERROR There was an error finding what to write.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferRefresh (
- VOID
- )
-{
- LIST_ENTRY *Link;
- EFI_EDITOR_LINE *Line;
- UINTN Row;
-
- //
- // if it's the first time after editor launch, so should refresh
- //
- if (!EditorFirst) {
- //
- // no definite required refresh
- // and file position displayed on screen has not been changed
- //
- if (!FileBufferNeedRefresh &&
- !FileBufferOnlyLineNeedRefresh &&
- FileBufferBackupVar.LowVisibleRange.Row == FileBuffer.LowVisibleRange.Row &&
- FileBufferBackupVar.LowVisibleRange.Column == FileBuffer.LowVisibleRange.Column
- ) {
-
- FileBufferRestoreMousePosition ();
- FileBufferRestorePosition ();
-
- return EFI_SUCCESS;
- }
- }
-
- gST->ConOut->EnableCursor (gST->ConOut, FALSE);
-
- //
- // only need to refresh current line
- //
- if (FileBufferOnlyLineNeedRefresh &&
- FileBufferBackupVar.LowVisibleRange.Row == FileBuffer.LowVisibleRange.Row &&
- FileBufferBackupVar.LowVisibleRange.Column == FileBuffer.LowVisibleRange.Column
- ) {
-
- EditorClearLine (FileBuffer.DisplayPosition.Row, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row);
- FileBufferPrintLine (
- FileBuffer.CurrentLine,
- FileBuffer.DisplayPosition.Row
- );
- } else {
- //
- // the whole edit area need refresh
- //
-
- //
- // no line
- //
- if (FileBuffer.Lines == NULL) {
- FileBufferRestoreMousePosition ();
- FileBufferRestorePosition ();
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
-
- return EFI_SUCCESS;
- }
- //
- // get the first line that will be displayed
- //
- Line = MoveLine (FileBuffer.LowVisibleRange.Row - FileBuffer.FilePosition.Row);
- if (Line == NULL) {
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
-
- return EFI_LOAD_ERROR;
- }
-
- Link = &(Line->Link);
- Row = 2;
- do {
- Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
-
- //
- // print line at row
- //
- FileBufferPrintLine (Line, Row);
-
- Link = Link->ForwardLink;
- Row++;
- } while (Link != FileBuffer.ListHead && Row <= (MainEditor.ScreenSize.Row - 1));
- //
- // while not file end and not screen full
- //
- while (Row <= (MainEditor.ScreenSize.Row - 1)) {
- EditorClearLine (Row, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row);
- Row++;
- }
- }
-
- FileBufferRestoreMousePosition ();
- FileBufferRestorePosition ();
-
- FileBufferNeedRefresh = FALSE;
- FileBufferOnlyLineNeedRefresh = FALSE;
-
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
- return EFI_SUCCESS;
-}
-
-/**
- Create a new line and append it to the line list.
- Fields affected:
- NumLines
- Lines
-
- @retval NULL The create line failed.
- @return The line created.
-**/
-EFI_EDITOR_LINE *
-EFIAPI
-FileBufferCreateLine (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
-
- //
- // allocate a line structure
- //
- Line = AllocateZeroPool (sizeof (EFI_EDITOR_LINE));
- if (Line == NULL) {
- return NULL;
- }
- //
- // initialize the structure
- //
- Line->Signature = LINE_LIST_SIGNATURE;
- Line->Size = 0;
- Line->TotalSize = 0;
- Line->Type = NewLineTypeDefault;
-
- //
- // initial buffer of the line is "\0"
- //
- ASSERT(CHAR_NULL == CHAR_NULL);
- Line->Buffer = CatSPrint (NULL, L"\0");
- if (Line->Buffer == NULL) {
- return NULL;
- }
-
- FileBuffer.NumLines++;
-
- //
- // insert the line into line list
- //
- InsertTailList (FileBuffer.ListHead, &Line->Link);
-
- if (FileBuffer.Lines == NULL) {
- FileBuffer.Lines = CR (FileBuffer.ListHead->ForwardLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- }
-
- return Line;
-}
-
-/**
- Set FileName field in FileBuffer.
-
- @param Str The file name to set.
-
- @retval EFI_SUCCESS The filename was successfully set.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_INVALID_PARAMETER Str is not a valid filename.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferSetFileName (
- IN CONST CHAR16 *Str
- )
-{
- //
- // Verify the parameters
- //
- if (!IsValidFileName(Str)) {
- return (EFI_INVALID_PARAMETER);
- }
- //
- // free the old file name
- //
- SHELL_FREE_NON_NULL (FileBuffer.FileName);
-
- //
- // Allocate and set the new name
- //
- FileBuffer.FileName = CatSPrint (NULL, L"%s", Str);
- if (FileBuffer.FileName == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- return EFI_SUCCESS;
-}
-/**
- Free the existing file lines and reset the modified flag.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferFree (
- VOID
- )
-{
- //
- // free all the lines
- //
- FileBufferFreeLines ();
- FileBuffer.FileModified = FALSE;
-
- return EFI_SUCCESS;
-}
-
-
-/**
- Read a file from disk into the FileBuffer.
-
- @param[in] FileName The filename to read.
- @param[in] Recover TRUE if is for recover mode, no information printouts.
-
- @retval EFI_SUCCESS The load was successful.
- @retval EFI_LOAD_ERROR The load failed.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_INVALID_PARAMETER FileName is a directory.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferRead (
- IN CONST CHAR16 *FileName,
- IN CONST BOOLEAN Recover
- )
-{
- EFI_EDITOR_LINE *Line;
- EE_NEWLINE_TYPE Type;
- UINTN LoopVar1;
- UINTN LoopVar2;
- UINTN LineSize;
- VOID *Buffer;
- CHAR16 *UnicodeBuffer;
- UINT8 *AsciiBuffer;
- UINTN FileSize;
- SHELL_FILE_HANDLE FileHandle;
- BOOLEAN CreateFile;
- EFI_STATUS Status;
- UINTN LineSizeBackup;
- EFI_FILE_INFO *Info;
-
- Line = NULL;
- LoopVar1 = 0;
- FileSize = 0;
- UnicodeBuffer = NULL;
- Type = NewLineTypeDefault;
- FileHandle = NULL;
- CreateFile = FALSE;
-
- //
- // in this function, when you return error ( except EFI_OUT_OF_RESOURCES )
- // you should set status string via StatusBarSetStatusString(L"blah")
- // since this function maybe called before the editorhandleinput loop
- // so any error will cause editor return
- // so if you want to print the error status
- // you should set the status string
- //
-
- //
- // try to open the file
- //
- Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ, 0);
-
- if (!EFI_ERROR(Status)) {
- CreateFile = FALSE;
- if (FileHandle == NULL) {
- StatusBarSetStatusString (L"Disk Error");
- return EFI_LOAD_ERROR;
- }
-
- Info = ShellGetFileInfo(FileHandle);
-
- if (Info->Attribute & EFI_FILE_DIRECTORY) {
- StatusBarSetStatusString (L"Directory Can Not Be Edited");
- FreePool (Info);
- return EFI_INVALID_PARAMETER;
- }
-
- if (Info->Attribute & EFI_FILE_READ_ONLY) {
- FileBuffer.ReadOnly = TRUE;
- } else {
- FileBuffer.ReadOnly = FALSE;
- }
- //
- // get file size
- //
- FileSize = (UINTN) Info->FileSize;
-
- FreePool (Info);
- } else if (Status == EFI_NOT_FOUND) {
- //
- // file not exists. add create and try again
- //
- Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
- if (EFI_ERROR (Status)) {
- if (Status == EFI_WRITE_PROTECTED ||
- Status == EFI_ACCESS_DENIED ||
- Status == EFI_NO_MEDIA ||
- Status == EFI_MEDIA_CHANGED
- ) {
- StatusBarSetStatusString (L"Access Denied");
- } else if (Status == EFI_DEVICE_ERROR || Status == EFI_VOLUME_CORRUPTED || Status == EFI_VOLUME_FULL) {
- StatusBarSetStatusString (L"Disk Error");
- } else {
- StatusBarSetStatusString (L"Invalid File Name or Current-working-directory");
- }
-
- return Status;
- } else {
- //
- // it worked. now delete it and move on with the name (now validated)
- //
- Status = ShellDeleteFile (&FileHandle);
- if (Status == EFI_WARN_DELETE_FAILURE) {
- Status = EFI_ACCESS_DENIED;
- }
- FileHandle = NULL;
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Access Denied");
- return Status;
- }
- }
- //
- // file doesn't exist, so set CreateFile to TRUE
- //
- CreateFile = TRUE;
- FileBuffer.ReadOnly = FALSE;
-
- //
- // all the check ends
- // so now begin to set file name, free lines
- //
- if (StrCmp (FileName, FileBuffer.FileName) != 0) {
- FileBufferSetFileName (FileName);
- }
- //
- // free the old lines
- //
- FileBufferFree ();
-
- }
- //
- // the file exists
- //
- if (!CreateFile) {
- //
- // allocate buffer to read file
- //
- Buffer = AllocateZeroPool (FileSize);
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // read file into Buffer
- //
- Status = ShellReadFile (FileHandle, &FileSize, Buffer);
- ShellCloseFile(&FileHandle);
- FileHandle = NULL;
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Read File Failed");
- SHELL_FREE_NON_NULL (Buffer);
- return EFI_LOAD_ERROR;
- }
- //
- // nothing in this file
- //
- if (FileSize == 0) {
- SHELL_FREE_NON_NULL (Buffer);
- //
- // since has no head, so only can be an ASCII file
- //
- FileBuffer.FileType = FileTypeAscii;
-
- goto Done;
- }
-
- AsciiBuffer = Buffer;
-
- if (FileSize < 2) {
- //
- // size < Unicode file header, so only can be ASCII file
- //
- FileBuffer.FileType = FileTypeAscii;
- } else {
- //
- // Unicode file
- //
- if (*(UINT16 *) Buffer == EFI_UNICODE_BYTE_ORDER_MARK) {
- //
- // Unicode file's size should be even
- //
- if ((FileSize % 2) != 0) {
- StatusBarSetStatusString (L"File Format Wrong");
- SHELL_FREE_NON_NULL (Buffer);
- return EFI_LOAD_ERROR;
- }
-
- FileSize /= 2;
-
- FileBuffer.FileType = FileTypeUnicode;
- UnicodeBuffer = Buffer;
-
- //
- // pass this 0xff and 0xfe
- //
- UnicodeBuffer++;
- FileSize--;
- } else {
- FileBuffer.FileType = FileTypeAscii;
- }
- //
- // end of AsciiBuffer ==
- //
- }
- //
- // end of FileSize < 2
- // all the check ends
- // so now begin to set file name, free lines
- //
- if (StrCmp (FileName, FileBuffer.FileName) != 0) {
- FileBufferSetFileName (FileName);
- }
-
- //
- // free the old lines
- //
- FileBufferFree ();
-
- //
- // parse file content line by line
- //
- for (LoopVar1 = 0; LoopVar1 < FileSize; LoopVar1++) {
- Type = NewLineTypeUnknown;
-
- for (LineSize = LoopVar1; LineSize < FileSize; LineSize++) {
- if (FileBuffer.FileType == FileTypeAscii) {
- if (AsciiBuffer[LineSize] == CHAR_CARRIAGE_RETURN) {
- Type = NewLineTypeCarriageReturn;
-
- //
- // has LF following
- //
- if (LineSize < FileSize - 1) {
- if (AsciiBuffer[LineSize + 1] == CHAR_LINEFEED) {
- Type = NewLineTypeCarriageReturnLineFeed;
- }
- }
-
- break;
- } else if (AsciiBuffer[LineSize] == CHAR_LINEFEED) {
- Type = NewLineTypeLineFeed;
-
- //
- // has CR following
- //
- if (LineSize < FileSize - 1) {
- if (AsciiBuffer[LineSize + 1] == CHAR_CARRIAGE_RETURN) {
- Type = NewLineTypeLineFeedCarriageReturn;
- }
- }
-
- break;
- }
- } else {
- if (UnicodeBuffer[LineSize] == CHAR_CARRIAGE_RETURN) {
- Type = NewLineTypeCarriageReturn;
-
- //
- // has LF following
- //
- if (LineSize < FileSize - 1) {
- if (UnicodeBuffer[LineSize + 1] == CHAR_LINEFEED) {
- Type = NewLineTypeCarriageReturnLineFeed;
- }
- }
-
- break;
- } else if (UnicodeBuffer[LineSize] == CHAR_LINEFEED) {
- Type = NewLineTypeLineFeed;
-
- //
- // has CR following
- //
- if (LineSize < FileSize - 1) {
- if (UnicodeBuffer[LineSize + 1] == CHAR_CARRIAGE_RETURN) {
- Type = NewLineTypeLineFeedCarriageReturn;
- }
- }
-
- break;
- }
- }
- //
- // endif == ASCII
- //
- }
- //
- // end of for LineSize
- //
- // if the type is wrong, then exit
- //
- if (Type == NewLineTypeUnknown) {
- //
- // Now if Type is NewLineTypeUnknown, it should be file end
- //
- Type = NewLineTypeDefault;
- }
-
- LineSizeBackup = LineSize;
-
- //
- // create a new line
- //
- Line = FileBufferCreateLine ();
- if (Line == NULL) {
- SHELL_FREE_NON_NULL (Buffer);
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // calculate file length
- //
- LineSize -= LoopVar1;
-
- //
- // Unicode and one CHAR_NULL
- //
- SHELL_FREE_NON_NULL (Line->Buffer);
- Line->Buffer = AllocateZeroPool (LineSize * 2 + 2);
-
- if (Line->Buffer == NULL) {
- RemoveEntryList (&Line->Link);
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // copy this line to Line->Buffer
- //
- for (LoopVar2 = 0; LoopVar2 < LineSize; LoopVar2++) {
- if (FileBuffer.FileType == FileTypeAscii) {
- Line->Buffer[LoopVar2] = (CHAR16) AsciiBuffer[LoopVar1];
- } else {
- Line->Buffer[LoopVar2] = UnicodeBuffer[LoopVar1];
- }
-
- LoopVar1++;
- }
- //
- // LoopVar1 now points to where CHAR_CARRIAGE_RETURN or CHAR_LINEFEED;
- //
- Line->Buffer[LineSize] = 0;
-
- Line->Size = LineSize;
- Line->TotalSize = LineSize;
- Line->Type = Type;
-
- if (Type == NewLineTypeCarriageReturnLineFeed || Type == NewLineTypeLineFeedCarriageReturn) {
- LoopVar1++;
- }
-
- //
- // last character is a return, SO create a new line
- //
- if (((Type == NewLineTypeCarriageReturnLineFeed || Type == NewLineTypeLineFeedCarriageReturn) && LineSizeBackup == FileSize - 2) ||
- ((Type == NewLineTypeLineFeed || Type == NewLineTypeCarriageReturn) && LineSizeBackup == FileSize - 1)
- ) {
- Line = FileBufferCreateLine ();
- if (Line == NULL) {
- SHELL_FREE_NON_NULL (Buffer);
- return EFI_OUT_OF_RESOURCES;
- }
- }
- //
- // end of if
- //
- }
- //
- // end of LoopVar1
- //
- SHELL_FREE_NON_NULL (Buffer);
-
- }
- //
- // end of if CreateFile
- //
-Done:
-
- FileBuffer.DisplayPosition.Row = 2;
- FileBuffer.DisplayPosition.Column = 1;
- FileBuffer.LowVisibleRange.Row = 1;
- FileBuffer.LowVisibleRange.Column = 1;
- FileBuffer.FilePosition.Row = 1;
- FileBuffer.FilePosition.Column = 1;
- FileBuffer.MousePosition.Row = 2;
- FileBuffer.MousePosition.Column = 1;
-
- if (!Recover) {
- UnicodeBuffer = CatSPrint (NULL, L"%d Lines Read", FileBuffer.NumLines);
- if (UnicodeBuffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- StatusBarSetStatusString (UnicodeBuffer);
- FreePool (UnicodeBuffer);
- }
-/*
- //
- // check whether we have fs?: in filename
- //
- LoopVar1 = 0;
- FSMappingPtr = NULL;
- while (FileName[LoopVar1] != 0) {
- if (FileName[LoopVar1] == L':') {
- FSMappingPtr = &FileName[LoopVar1];
- break;
- }
-
- LoopVar1++;
- }
-
- if (FSMappingPtr == NULL) {
- CurDir = ShellGetCurrentDir (NULL);
- } else {
- LoopVar1 = 0;
- LoopVar2 = 0;
- while (FileName[LoopVar1] != 0) {
- if (FileName[LoopVar1] == L':') {
- break;
- }
-
- FSMapping[LoopVar2++] = FileName[LoopVar1];
-
- LoopVar1++;
- }
-
- FSMapping[LoopVar2] = 0;
- CurDir = ShellGetCurrentDir (FSMapping);
- }
-
- if (CurDir != NULL) {
- for (LoopVar1 = 0; LoopVar1 < StrLen (CurDir) && CurDir[LoopVar1] != ':'; LoopVar1++);
-
- CurDir[LoopVar1] = 0;
- DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) ShellGetMap (CurDir);
- FreePool (CurDir);
- } else {
- return EFI_LOAD_ERROR;
- }
-
- Status = LibDevicePathToInterface (
- &gEfiSimpleFileSystemProtocolGuid,
- DevicePath,
- (VOID **) &Vol
- );
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
-
- Status = Vol->OpenVolume (Vol, &RootFs);
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
- //
- // Get volume information of file system
- //
- Size = SIZE_OF_EFI_FILE_SYSTEM_INFO + 100;
- VolumeInfo = (EFI_FILE_SYSTEM_INFO *) AllocateZeroPool (Size);
- Status = RootFs->GetInfo (RootFs, &gEfiFileSystemInfoGuid, &Size, VolumeInfo);
- if (EFI_ERROR (Status)) {
- RootFs->Close (RootFs);
- return EFI_LOAD_ERROR;
- }
-
- if (VolumeInfo->ReadOnly) {
- StatusBarSetStatusString (L"WARNING: Volume Read Only");
- }
-
- FreePool (VolumeInfo);
- RootFs->Close (RootFs);
- }
-//
-*/
- //
- // has line
- //
- if (FileBuffer.Lines != 0) {
- FileBuffer.CurrentLine = CR (FileBuffer.ListHead->ForwardLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- } else {
- //
- // create a dummy line
- //
- Line = FileBufferCreateLine ();
- if (Line == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- FileBuffer.CurrentLine = Line;
- }
-
- FileBuffer.FileModified = FALSE;
- FileBufferNeedRefresh = TRUE;
- FileBufferOnlyLineNeedRefresh = FALSE;
- FileBufferMouseNeedRefresh = TRUE;
-
-
- return EFI_SUCCESS;
-}
-
-/**
- According to FileBuffer.NewLineType & FileBuffer.FileType,
- get the return buffer and size.
-
- @param[in] Type The type of line.
- @param[out] Buffer The buffer to fill.
- @param[out] Size The amount of the buffer used on return.
-**/
-VOID
-EFIAPI
-GetNewLine (
- IN CONST EE_NEWLINE_TYPE Type,
- OUT CHAR8 *Buffer,
- OUT UINT8 *Size
- )
-{
- UINT8 NewLineSize;
-
- //
- // give new line buffer,
- // and will judge unicode or ascii
- //
- NewLineSize = 0;
-
- //
- // not legal new line type
- //
- if (Type != NewLineTypeLineFeed && Type != NewLineTypeCarriageReturn && Type != NewLineTypeCarriageReturnLineFeed && Type != NewLineTypeLineFeedCarriageReturn) {
- *Size = 0;
- return ;
- }
- //
- // use_cr: give 0x0d
- //
- if (Type == NewLineTypeCarriageReturn) {
- if (MainEditor.FileBuffer->FileType == FileTypeUnicode) {
- Buffer[0] = 0x0d;
- Buffer[1] = 0;
- NewLineSize = 2;
- } else {
- Buffer[0] = 0x0d;
- NewLineSize = 1;
- }
-
- *Size = NewLineSize;
- return ;
- }
- //
- // use_lf: give 0x0a
- //
- if (Type == NewLineTypeLineFeed) {
- if (MainEditor.FileBuffer->FileType == FileTypeUnicode) {
- Buffer[0] = 0x0a;
- Buffer[1] = 0;
- NewLineSize = 2;
- } else {
- Buffer[0] = 0x0a;
- NewLineSize = 1;
- }
-
- *Size = NewLineSize;
- return ;
- }
- //
- // use_crlf: give 0x0d 0x0a
- //
- if (Type == NewLineTypeCarriageReturnLineFeed) {
- if (MainEditor.FileBuffer->FileType == FileTypeUnicode) {
- Buffer[0] = 0x0d;
- Buffer[1] = 0;
- Buffer[2] = 0x0a;
- Buffer[3] = 0;
-
- NewLineSize = 4;
- } else {
- Buffer[0] = 0x0d;
- Buffer[1] = 0x0a;
- NewLineSize = 2;
- }
-
- *Size = NewLineSize;
- return ;
- }
- //
- // use_lfcr: give 0x0a 0x0d
- //
- if (Type == NewLineTypeLineFeedCarriageReturn) {
- if (MainEditor.FileBuffer->FileType == FileTypeUnicode) {
- Buffer[0] = 0x0a;
- Buffer[1] = 0;
- Buffer[2] = 0x0d;
- Buffer[3] = 0;
-
- NewLineSize = 4;
- } else {
- Buffer[0] = 0x0a;
- Buffer[1] = 0x0d;
- NewLineSize = 2;
- }
-
- *Size = NewLineSize;
- return ;
- }
-
-}
-
-/**
- Change a Unicode string to an ASCII string.
-
- @param[in] UStr The Unicode string.
- @param[in] Length The maximum size of AStr.
- @param[out] AStr ASCII string to pass out.
-
- @return The actuall length.
-**/
-UINTN
-EFIAPI
-UnicodeToAscii (
- IN CONST CHAR16 *UStr,
- IN CONST UINTN Length,
- OUT CHAR8 *AStr
- )
-{
- UINTN Index;
-
- //
- // just buffer copy, not character copy
- //
- for (Index = 0; Index < Length; Index++) {
- *AStr++ = (CHAR8) *UStr++;
- }
-
- return Index;
-}
-
-/**
- Save lines in FileBuffer to disk
-
- @param[in] FileName The file name for writing.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_LOAD_ERROR
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to write the file.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferSave (
- IN CONST CHAR16 *FileName
- )
-{
- SHELL_FILE_HANDLE FileHandle;
- LIST_ENTRY *Link;
- EFI_EDITOR_LINE *Line;
- CHAR16 *Str;
-
- EFI_STATUS Status;
- UINTN Length;
- UINTN NumLines;
- CHAR8 NewLineBuffer[4];
- UINT8 NewLineSize;
-
- EFI_FILE_INFO *Info;
-
- UINT64 Attribute;
-
- EE_NEWLINE_TYPE Type;
-
- UINTN TotalSize;
- //
- // 2M
- //
- CHAR8 *Cache;
- UINTN LeftSize;
- UINTN Size;
- CHAR8 *Ptr;
-
- Length = 0;
- //
- // 2M
- //
- TotalSize = 0x200000;
-
- Attribute = 0;
-
-
-
- //
- // if is the old file
- //
- if (FileBuffer.FileName != NULL && StrCmp (FileName, FileBuffer.FileName) == 0) {
- //
- // file has not been modified
- //
- if (!FileBuffer.FileModified) {
- return EFI_SUCCESS;
- }
-
- //
- // if file is read-only, set error
- //
- if (FileBuffer.ReadOnly) {
- StatusBarSetStatusString (L"Read Only File Can Not Be Saved");
- return EFI_SUCCESS;
- }
- }
-
- Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
-
- if (!EFI_ERROR (Status)) {
- Info = ShellGetFileInfo(FileHandle);
-
- if (Info != NULL && Info->Attribute & EFI_FILE_DIRECTORY) {
- StatusBarSetStatusString (L"Directory Can Not Be Saved");
- ShellCloseFile(FileHandle);
- FreePool(Info);
- return EFI_LOAD_ERROR;
- }
-
- if (Info != NULL) {
- Attribute = Info->Attribute & ~EFI_FILE_READ_ONLY;
- FreePool(Info);
- }
-
- //
- // if file exits, so delete it
- //
- Status = ShellDeleteFile (&FileHandle);
- if (EFI_ERROR (Status) || Status == EFI_WARN_DELETE_FAILURE) {
- StatusBarSetStatusString (L"Write File Failed");
- return EFI_LOAD_ERROR;
- }
- }
-
- Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, Attribute);
-
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Create File Failed");
- return EFI_LOAD_ERROR;
- }
-
- //
- // if file is Unicode file, write Unicode header to it.
- //
- if (FileBuffer.FileType == FileTypeUnicode) {
- Length = 2;
- Status = ShellWriteFile (FileHandle, &Length, (VOID*)&gUnicodeFileTag);
- if (EFI_ERROR (Status)) {
- ShellDeleteFile (&FileHandle);
- return EFI_LOAD_ERROR;
- }
- }
-
- Cache = AllocateZeroPool (TotalSize);
- if (Cache == NULL) {
- ShellDeleteFile (&FileHandle);
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // write all the lines back to disk
- //
- NumLines = 0;
- Type = NewLineTypeCarriageReturnLineFeed;
-
- Ptr = Cache;
- LeftSize = TotalSize;
-
- for (Link = FileBuffer.ListHead->ForwardLink; Link != FileBuffer.ListHead; Link = Link->ForwardLink) {
- Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
-
- if (Line->Type != NewLineTypeDefault) {
- Type = Line->Type;
- }
- //
- // newline character is at most 4 bytes ( two Unicode characters )
- //
- Length = 4;
- if (Line->Buffer != NULL && Line->Size != 0) {
- if (FileBuffer.FileType == FileTypeAscii) {
- Length += Line->Size;
- } else {
- Length += (Line->Size * 2);
- }
- //
- // end if FileTypeAscii
- //
- }
-
- //
- // no cache room left, so write cache to disk
- //
- if (LeftSize < Length) {
- Size = TotalSize - LeftSize;
- Status = ShellWriteFile (FileHandle, &Size, Cache);
- if (EFI_ERROR (Status)) {
- ShellDeleteFile (&FileHandle);
- FreePool (Cache);
- return EFI_LOAD_ERROR;
- }
- Ptr = Cache;
- LeftSize = TotalSize;
- }
-
- if (Line->Buffer != NULL && Line->Size != 0) {
- if (FileBuffer.FileType == FileTypeAscii) {
- UnicodeToAscii (Line->Buffer, Line->Size, Ptr);
- Length = Line->Size;
- } else {
- Length = (Line->Size * 2);
- CopyMem (Ptr, (CHAR8 *) Line->Buffer, Length);
- }
- //
- // end if FileTypeAscii
- //
- Ptr += Length;
- LeftSize -= Length;
-
- }
- //
- // end of if Line -> Buffer != NULL && Line -> Size != 0
- //
- // if not the last line , write return buffer to disk
- //
- if (Link->ForwardLink != FileBuffer.ListHead) {
- GetNewLine (Type, NewLineBuffer, &NewLineSize);
- CopyMem (Ptr, (CHAR8 *) NewLineBuffer, NewLineSize);
-
- Ptr += NewLineSize;
- LeftSize -= NewLineSize;
- }
-
- NumLines++;
- }
-
- if (TotalSize != LeftSize) {
- Size = TotalSize - LeftSize;
- Status = ShellWriteFile (FileHandle, &Size, Cache);
- if (EFI_ERROR (Status)) {
- ShellDeleteFile (&FileHandle);
- FreePool (Cache);
- return EFI_LOAD_ERROR;
- }
- }
-
- FreePool (Cache);
-
- ShellCloseFile(&FileHandle);
-
- FileBuffer.FileModified = FALSE;
-
- //
- // set status string
- //
- Str = CatSPrint (NULL, L"%d Lines Wrote", NumLines);
- if (Str == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- StatusBarSetStatusString (Str);
- SHELL_FREE_NON_NULL (Str);
-
- //
- // now everything is ready , you can set the new file name to filebuffer
- //
- if (FileName != NULL && FileBuffer.FileName != NULL && StrCmp (FileName, FileBuffer.FileName) != 0) {
- //
- // not the same
- //
- FileBufferSetFileName (FileName);
- if (FileBuffer.FileName == NULL) {
- ShellDeleteFile (&FileHandle);
- return EFI_OUT_OF_RESOURCES;
- }
- }
-
- FileBuffer.ReadOnly = FALSE;
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to left 1 character position.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferScrollLeft (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
-
- Line = FileBuffer.CurrentLine;
-
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
-
- //
- // if already at start of this line, so move to the end of previous line
- //
- if (FCol <= 1) {
- //
- // has previous line
- //
- if (Line->Link.BackLink != FileBuffer.ListHead) {
- FRow--;
- Line = CR (Line->Link.BackLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- FCol = Line->Size + 1;
- } else {
- return EFI_SUCCESS;
- }
- } else {
- //
- // if not at start of this line, just move to previous column
- //
- FCol--;
- }
-
- FileBufferMovePosition (FRow, FCol);
-
- return EFI_SUCCESS;
-}
-
-/**
- Delete a char in line
-
- @param[in, out] Line The line to delete in.
- @param[in] Pos Position to delete the char at ( start from 0 ).
-**/
-VOID
-EFIAPI
-LineDeleteAt (
- IN OUT EFI_EDITOR_LINE *Line,
- IN UINTN Pos
- )
-{
- UINTN Index;
-
- //
- // move the latter characters front
- //
- for (Index = Pos - 1; Index < Line->Size; Index++) {
- Line->Buffer[Index] = Line->Buffer[Index + 1];
- }
-
- Line->Size--;
-}
-
-/**
- Concatenate Src into Dest.
-
- @param[in, out] Dest Destination string
- @param[in] Src Src String.
-**/
-VOID
-EFIAPI
-LineCat (
- IN OUT EFI_EDITOR_LINE *Dest,
- IN EFI_EDITOR_LINE *Src
- )
-{
- CHAR16 *Str;
- UINTN Size;
-
- Size = Dest->Size;
-
- Dest->Buffer[Size] = 0;
-
- //
- // concatenate the two strings
- //
- Str = CatSPrint (NULL, L"%s%s", Dest->Buffer, Src->Buffer);
- if (Str == NULL) {
- Dest->Buffer = NULL;
- return ;
- }
-
- Dest->Size = Size + Src->Size;
- Dest->TotalSize = Dest->Size;
-
- FreePool (Dest->Buffer);
- FreePool (Src->Buffer);
-
- //
- // put str to dest->buffer
- //
- Dest->Buffer = Str;
-}
-
-/**
- Delete the previous character.
-
- @retval EFI_SUCCESS The delete was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferDoBackspace (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- EFI_EDITOR_LINE *End;
- LIST_ENTRY *Link;
- UINTN FileColumn;
-
- FileColumn = FileBuffer.FilePosition.Column;
-
- Line = FileBuffer.CurrentLine;
-
- //
- // the first column
- //
- if (FileColumn == 1) {
- //
- // the first row
- //
- if (FileBuffer.FilePosition.Row == 1) {
- return EFI_SUCCESS;
- }
-
- FileBufferScrollLeft ();
-
- Line = FileBuffer.CurrentLine;
- Link = Line->Link.ForwardLink;
- End = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
-
- //
- // concatenate this line with previous line
- //
- LineCat (Line, End);
- if (Line->Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // remove End from line list
- //
- RemoveEntryList (&End->Link);
- FreePool (End);
-
- FileBuffer.NumLines--;
-
- FileBufferNeedRefresh = TRUE;
- FileBufferOnlyLineNeedRefresh = FALSE;
-
- } else {
- //
- // just delete the previous character
- //
- LineDeleteAt (Line, FileColumn - 1);
- FileBufferScrollLeft ();
- FileBufferOnlyLineNeedRefresh = TRUE;
- }
-
- if (!FileBuffer.FileModified) {
- FileBuffer.FileModified = TRUE;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Add a return into line at current position.
-
- @retval EFI_SUCCESS The insetrion of the character was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferDoReturn (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- EFI_EDITOR_LINE *NewLine;
- UINTN FileColumn;
- UINTN Index;
- CHAR16 *Buffer;
- UINTN Row;
- UINTN Col;
-
- FileBufferNeedRefresh = TRUE;
- FileBufferOnlyLineNeedRefresh = FALSE;
-
- Line = FileBuffer.CurrentLine;
-
- FileColumn = FileBuffer.FilePosition.Column;
-
- NewLine = AllocateZeroPool (sizeof (EFI_EDITOR_LINE));
- if (NewLine == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- NewLine->Signature = LINE_LIST_SIGNATURE;
- NewLine->Size = Line->Size - FileColumn + 1;
- NewLine->TotalSize = NewLine->Size;
- NewLine->Buffer = CatSPrint (NULL, L"\0");
- if (NewLine->Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- NewLine->Type = NewLineTypeDefault;
-
- if (NewLine->Size > 0) {
- //
- // UNICODE + CHAR_NULL
- //
- Buffer = AllocateZeroPool (2 * (NewLine->Size + 1));
- if (Buffer == NULL) {
- FreePool (NewLine->Buffer);
- FreePool (NewLine);
- return EFI_OUT_OF_RESOURCES;
- }
-
- FreePool (NewLine->Buffer);
-
- NewLine->Buffer = Buffer;
-
- for (Index = 0; Index < NewLine->Size; Index++) {
- NewLine->Buffer[Index] = Line->Buffer[Index + FileColumn - 1];
- }
-
- NewLine->Buffer[NewLine->Size] = CHAR_NULL;
-
- Line->Buffer[FileColumn - 1] = CHAR_NULL;
- Line->Size = FileColumn - 1;
- }
- //
- // increase NumLines
- //
- FileBuffer.NumLines++;
-
- //
- // insert it into the correct position of line list
- //
- NewLine->Link.BackLink = &(Line->Link);
- NewLine->Link.ForwardLink = Line->Link.ForwardLink;
- Line->Link.ForwardLink->BackLink = &(NewLine->Link);
- Line->Link.ForwardLink = &(NewLine->Link);
-
- //
- // move cursor to the start of next line
- //
- Row = FileBuffer.FilePosition.Row + 1;
- Col = 1;
-
- FileBufferMovePosition (Row, Col);
-
- //
- // set file is modified
- //
- if (!FileBuffer.FileModified) {
- FileBuffer.FileModified = TRUE;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Delete current character from current line. This is the effect caused
- by the 'del' key.
-
- @retval EFI_SUCCESS
-**/
-EFI_STATUS
-EFIAPI
-FileBufferDoDelete (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- EFI_EDITOR_LINE *Next;
- LIST_ENTRY *Link;
- UINTN FileColumn;
-
- Line = FileBuffer.CurrentLine;
- FileColumn = FileBuffer.FilePosition.Column;
-
- //
- // the last column
- //
- if (FileColumn >= Line->Size + 1) {
- //
- // the last line
- //
- if (Line->Link.ForwardLink == FileBuffer.ListHead) {
- return EFI_SUCCESS;
- }
- //
- // since last character,
- // so will add the next line to this line
- //
- Link = Line->Link.ForwardLink;
- Next = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- LineCat (Line, Next);
- if (Line->Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- RemoveEntryList (&Next->Link);
- FreePool (Next);
-
- FileBuffer.NumLines--;
-
- FileBufferNeedRefresh = TRUE;
- FileBufferOnlyLineNeedRefresh = FALSE;
-
- } else {
- //
- // just delete current character
- //
- LineDeleteAt (Line, FileColumn);
- FileBufferOnlyLineNeedRefresh = TRUE;
- }
-
- if (!FileBuffer.FileModified) {
- FileBuffer.FileModified = TRUE;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to right 1 character.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferScrollRight (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
-
- Line = FileBuffer.CurrentLine;
- if (Line->Buffer == NULL) {
- return EFI_SUCCESS;
- }
-
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
-
- //
- // if already at end of this line, scroll it to the start of next line
- //
- if (FCol > Line->Size) {
- //
- // has next line
- //
- if (Line->Link.ForwardLink != FileBuffer.ListHead) {
- FRow++;
- FCol = 1;
- } else {
- return EFI_SUCCESS;
- }
- } else {
- //
- // if not at end of this line, just move to next column
- //
- FCol++;
- }
-
- FileBufferMovePosition (FRow, FCol);
-
- return EFI_SUCCESS;
-}
-
-/**
- Insert a char into line
-
-
- @param[in] Line The line to insert into.
- @param[in] Char The char to insert.
- @param[in] Pos The position to insert the char at ( start from 0 ).
- @param[in] StrSize The current string size ( include CHAR_NULL ),unit is Unicode character.
-
- @return The new string size ( include CHAR_NULL ) ( unit is Unicode character ).
-**/
-UINTN
-EFIAPI
-LineStrInsert (
- IN EFI_EDITOR_LINE *Line,
- IN CHAR16 Char,
- IN UINTN Pos,
- IN UINTN StrSize
- )
-{
- UINTN Index;
- CHAR16 *TempStringPtr;
- CHAR16 *Str;
-
- Index = (StrSize) * 2;
-
- Str = Line->Buffer;
-
- //
- // do not have free space
- //
- if (Line->TotalSize <= Line->Size) {
- Str = ReallocatePool (Index, Index + 16, Str);
- if (Str == NULL) {
- return 0;
- }
-
- Line->TotalSize += 8;
- }
- //
- // move the later part of the string one character right
- //
- TempStringPtr = Str;
- for (Index = StrSize; Index > Pos; Index--) {
- TempStringPtr[Index] = TempStringPtr[Index - 1];
- }
- //
- // insert char into it.
- //
- TempStringPtr[Index] = Char;
-
- Line->Buffer = Str;
- Line->Size++;
-
- return StrSize + 1;
-}
-
-/**
- Add a character to the current line.
-
- @param[in] Char The Character to input.
-
- @retval EFI_SUCCESS The input was succesful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferAddChar (
- IN CHAR16 Char
- )
-{
- EFI_EDITOR_LINE *Line;
- UINTN FilePos;
-
- Line = FileBuffer.CurrentLine;
-
- //
- // only needs to refresh current line
- //
- FileBufferOnlyLineNeedRefresh = TRUE;
-
- //
- // when is insert mode, or cursor is at end of this line,
- // so insert this character
- // or replace the character.
- //
- FilePos = FileBuffer.FilePosition.Column - 1;
- if (FileBuffer.ModeInsert || FilePos + 1 > Line->Size) {
- LineStrInsert (Line, Char, FilePos, Line->Size + 1);
- } else {
- Line->Buffer[FilePos] = Char;
- }
- //
- // move cursor to right
- //
- FileBufferScrollRight ();
-
- if (!FileBuffer.FileModified) {
- FileBuffer.FileModified = TRUE;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Handles inputs from characters (ASCII key + Backspace + return)
-
- @param[in] Char The input character.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR There was an error.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferDoCharInput (
- IN CONST CHAR16 Char
- )
-{
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
-
- switch (Char) {
- case CHAR_NULL:
- break;
-
- case CHAR_BACKSPACE:
- Status = FileBufferDoBackspace ();
- break;
-
- case CHAR_TAB:
- //
- // Tabs are ignored
- //
- break;
-
- case CHAR_LINEFEED:
- case CHAR_CARRIAGE_RETURN:
- Status = FileBufferDoReturn ();
- break;
-
- default:
- //
- // DEAL WITH ASCII CHAR, filter out thing like ctrl+f
- //
- if (Char > 127 || Char < 32) {
- Status = StatusBarSetStatusString (L"Unknown Command");
- } else {
- Status = FileBufferAddChar (Char);
- }
-
- break;
-
- }
-
- return Status;
-}
-
-/**
- Scroll cursor to the next line.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferScrollDown (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
-
- Line = FileBuffer.CurrentLine;
- if (Line->Buffer == NULL) {
- return EFI_SUCCESS;
- }
-
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
-
- //
- // has next line
- //
- if (Line->Link.ForwardLink != FileBuffer.ListHead) {
- FRow++;
- Line = CR (Line->Link.ForwardLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
-
- //
- // if the next line is not that long, so move to end of next line
- //
- if (FCol > Line->Size) {
- FCol = Line->Size + 1;
- }
-
- } else {
- return EFI_SUCCESS;
- }
-
- FileBufferMovePosition (FRow, FCol);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll the cursor to previous line.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferScrollUp (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
-
- Line = FileBuffer.CurrentLine;
-
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
-
- //
- // has previous line
- //
- if (Line->Link.BackLink != FileBuffer.ListHead) {
- FRow--;
- Line = CR (Line->Link.BackLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
-
- //
- // if previous line is not that long, so move to the end of previous line
- //
- if (FCol > Line->Size) {
- FCol = Line->Size + 1;
- }
-
- } else {
- return EFI_SUCCESS;
- }
-
- FileBufferMovePosition (FRow, FCol);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to next page.
-
- @retval EFI_SUCCESS The operation wa successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferPageDown (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
- UINTN Gap;
-
- Line = FileBuffer.CurrentLine;
-
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
-
- //
- // has next page
- //
- if (FileBuffer.NumLines >= FRow + (MainEditor.ScreenSize.Row - 2)) {
- Gap = (MainEditor.ScreenSize.Row - 2);
- } else {
- //
- // MOVE CURSOR TO LAST LINE
- //
- Gap = FileBuffer.NumLines - FRow;
- }
- //
- // get correct line
- //
- Line = MoveLine (Gap);
-
- //
- // if that line, is not that long, so move to the end of that line
- //
- if (Line != NULL && FCol > Line->Size) {
- FCol = Line->Size + 1;
- }
-
- FRow += Gap;
-
- FileBufferMovePosition (FRow, FCol);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to previous screen.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferPageUp (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
- UINTN Gap;
- INTN Retreat;
-
- Line = FileBuffer.CurrentLine;
-
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
-
- //
- // has previous page
- //
- if (FRow > (MainEditor.ScreenSize.Row - 2)) {
- Gap = (MainEditor.ScreenSize.Row - 2);
- } else {
- //
- // the first line of file will displayed on the first line of screen
- //
- Gap = FRow - 1;
- }
-
- Retreat = Gap;
- Retreat = -Retreat;
-
- //
- // get correct line
- //
- Line = MoveLine (Retreat);
-
- //
- // if that line is not that long, so move to the end of that line
- //
- if (Line != NULL && FCol > Line->Size) {
- FCol = Line->Size + 1;
- }
-
- FRow -= Gap;
-
- FileBufferMovePosition (FRow, FCol);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to end of the current line.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferEnd (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
-
- Line = FileBuffer.CurrentLine;
-
- FRow = FileBuffer.FilePosition.Row;
-
- //
- // goto the last column of the line
- //
- FCol = Line->Size + 1;
-
- FileBufferMovePosition (FRow, FCol);
-
- return EFI_SUCCESS;
-}
-
-/**
- Dispatch input to different handler
- @param[in] Key The input key. One of:
- ASCII KEY
- Backspace/Delete
- Return
- Direction key: up/down/left/right/pgup/pgdn
- Home/End
- INS
-
- @retval EFI_SUCCESS The dispatch was done successfully.
- @retval EFI_LOAD_ERROR The dispatch was not successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferHandleInput (
- IN CONST EFI_INPUT_KEY *Key
- )
-{
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
-
- switch (Key->ScanCode) {
- //
- // ordinary key input
- //
- case SCAN_NULL:
- if (!FileBuffer.ReadOnly) {
- Status = FileBufferDoCharInput (Key->UnicodeChar);
- } else {
- Status = StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
- }
-
- break;
-
- //
- // up arrow
- //
- case SCAN_UP:
- Status = FileBufferScrollUp ();
- break;
-
- //
- // down arrow
- //
- case SCAN_DOWN:
- Status = FileBufferScrollDown ();
- break;
-
- //
- // right arrow
- //
- case SCAN_RIGHT:
- Status = FileBufferScrollRight ();
- break;
-
- //
- // left arrow
- //
- case SCAN_LEFT:
- Status = FileBufferScrollLeft ();
- break;
-
- //
- // page up
- //
- case SCAN_PAGE_UP:
- Status = FileBufferPageUp ();
- break;
-
- //
- // page down
- //
- case SCAN_PAGE_DOWN:
- Status = FileBufferPageDown ();
- break;
-
- //
- // delete
- //
- case SCAN_DELETE:
- if (!FileBuffer.ReadOnly) {
- Status = FileBufferDoDelete ();
- } else {
- Status = StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
- }
-
- break;
-
- //
- // home
- //
- case SCAN_HOME:
- FileBufferMovePosition (FileBuffer.FilePosition.Row, 1);
- Status = EFI_SUCCESS;
- break;
-
- //
- // end
- //
- case SCAN_END:
- Status = FileBufferEnd ();
- break;
-
- //
- // insert
- //
- case SCAN_INSERT:
- FileBuffer.ModeInsert = (BOOLEAN)!FileBuffer.ModeInsert;
- Status = EFI_SUCCESS;
- break;
-
- default:
- Status = StatusBarSetStatusString (L"Unknown Command");
- break;
- }
-
- return Status;
-}
-
-/**
- Check user specified FileRow is above current screen.
-
- @param[in] FileRow The row of file position ( start from 1 ).
-
- @retval TRUE It is above the current screen.
- @retval FALSE It is not above the current screen.
-**/
-BOOLEAN
-EFIAPI
-AboveCurrentScreen (
- IN UINTN FileRow
- )
-{
- //
- // if is to the above of the screen
- //
- if (FileRow < FileBuffer.LowVisibleRange.Row) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Check user specified FileRow is under current screen.
-
- @param[in] FileRow The row of file position ( start from 1 ).
-
- @retval TRUE It is under the current screen.
- @retval FALSE It is not under the current screen.
-**/
-BOOLEAN
-EFIAPI
-UnderCurrentScreen (
- IN UINTN FileRow
- )
-{
- //
- // if is to the under of the screen
- //
- if (FileRow > FileBuffer.LowVisibleRange.Row + (MainEditor.ScreenSize.Row - 2) - 1) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Check user specified FileCol is left to current screen.
-
- @param[in] FileCol The column of file position ( start from 1 ).
-
- @retval TRUE It is to the left.
- @retval FALSE It is not to the left.
-**/
-BOOLEAN
-EFIAPI
-LeftCurrentScreen (
- IN UINTN FileCol
- )
-{
- //
- // if is to the left of the screen
- //
- if (FileCol < FileBuffer.LowVisibleRange.Column) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Check user specified FileCol is right to current screen.
-
- @param[in] FileCol The column of file position ( start from 1 ).
-
- @retval TRUE It is to the right.
- @retval FALSE It is not to the right.
-**/
-BOOLEAN
-EFIAPI
-RightCurrentScreen (
- IN UINTN FileCol
- )
-{
- //
- // if is to the right of the screen
- //
- if (FileCol > FileBuffer.LowVisibleRange.Column + MainEditor.ScreenSize.Column - 1) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Advance/Retreat lines and set CurrentLine in FileBuffer to it
-
- @param[in] Count The line number to advance/retreat
- >0 : advance
- <0: retreat
-
- @retval NULL An error occured.
- @return The line after advance/retreat.
-**/
-EFI_EDITOR_LINE *
-EFIAPI
-MoveCurrentLine (
- IN INTN Count
- )
-{
- EFI_EDITOR_LINE *Line;
- UINTN AbsCount;
-
- if (Count <= 0) {
- AbsCount = (UINTN)ABS(Count);
- Line = InternalEditorMiscLineRetreat (AbsCount,MainEditor.FileBuffer->CurrentLine,MainEditor.FileBuffer->ListHead);
- } else {
- Line = InternalEditorMiscLineAdvance ((UINTN)Count,MainEditor.FileBuffer->CurrentLine,MainEditor.FileBuffer->ListHead);
- }
-
- if (Line == NULL) {
- return NULL;
- }
-
- MainEditor.FileBuffer->CurrentLine = Line;
-
- return Line;
-}
-
-/**
- According to cursor's file position, adjust screen display
-
- @param[in] NewFilePosRow The row of file position ( start from 1 ).
- @param[in] NewFilePosCol The column of file position ( start from 1 ).
-**/
-VOID
-EFIAPI
-FileBufferMovePosition (
- IN CONST UINTN NewFilePosRow,
- IN CONST UINTN NewFilePosCol
- )
-{
- INTN RowGap;
- INTN ColGap;
- UINTN Abs;
- BOOLEAN Above;
- BOOLEAN Under;
- BOOLEAN Right;
- BOOLEAN Left;
-
- //
- // CALCULATE gap between current file position and new file position
- //
- RowGap = NewFilePosRow - FileBuffer.FilePosition.Row;
- ColGap = NewFilePosCol - FileBuffer.FilePosition.Column;
-
- Under = UnderCurrentScreen (NewFilePosRow);
- Above = AboveCurrentScreen (NewFilePosRow);
- //
- // if is below current screen
- //
- if (Under) {
- //
- // display row will be unchanged
- //
- FileBuffer.FilePosition.Row = NewFilePosRow;
- } else {
- if (Above) {
- //
- // has enough above line, so display row unchanged
- // not has enough above lines, so the first line is at the
- // first display line
- //
- if (NewFilePosRow < (FileBuffer.DisplayPosition.Row - 1)) {
- FileBuffer.DisplayPosition.Row = NewFilePosRow + 1;
- }
-
- FileBuffer.FilePosition.Row = NewFilePosRow;
- } else {
- //
- // in current screen
- //
- FileBuffer.FilePosition.Row = NewFilePosRow;
- if (RowGap < 0) {
- Abs = (UINTN)ABS(RowGap);
- FileBuffer.DisplayPosition.Row -= Abs;
- } else {
- FileBuffer.DisplayPosition.Row += RowGap;
- }
- }
- }
-
- FileBuffer.LowVisibleRange.Row = FileBuffer.FilePosition.Row - (FileBuffer.DisplayPosition.Row - 2);
-
- Right = RightCurrentScreen (NewFilePosCol);
- Left = LeftCurrentScreen (NewFilePosCol);
-
- //
- // if right to current screen
- //
- if (Right) {
- //
- // display column will be changed to end
- //
- FileBuffer.DisplayPosition.Column = MainEditor.ScreenSize.Column;
- FileBuffer.FilePosition.Column = NewFilePosCol;
- } else {
- if (Left) {
- //
- // has enough left characters , so display row unchanged
- // not has enough left characters,
- // so the first character is at the first display column
- //
- if (NewFilePosCol < (FileBuffer.DisplayPosition.Column)) {
- FileBuffer.DisplayPosition.Column = NewFilePosCol;
- }
-
- FileBuffer.FilePosition.Column = NewFilePosCol;
- } else {
- //
- // in current screen
- //
- FileBuffer.FilePosition.Column = NewFilePosCol;
- if (ColGap < 0) {
- Abs = (UINTN)(-ColGap);
- FileBuffer.DisplayPosition.Column -= Abs;
- } else {
- FileBuffer.DisplayPosition.Column += ColGap;
- }
- }
- }
-
- FileBuffer.LowVisibleRange.Column = FileBuffer.FilePosition.Column - (FileBuffer.DisplayPosition.Column - 1);
-
- //
- // let CurrentLine point to correct line;
- //
- FileBuffer.CurrentLine = MoveCurrentLine (RowGap);
-
-}
-
-/**
- Cut current line out and return a pointer to it.
-
- @param[out] CutLine Upon a successful return pointer to the pointer to
- the allocated cut line.
-
- @retval EFI_SUCCESS The cut was successful.
- @retval EFI_NOT_FOUND There was no selection to cut.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferCutLine (
- OUT EFI_EDITOR_LINE **CutLine
- )
-{
- EFI_EDITOR_LINE *Line;
- EFI_EDITOR_LINE *NewLine;
- UINTN Row;
- UINTN Col;
-
- if (FileBuffer.ReadOnly) {
- StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
- return EFI_SUCCESS;
- }
-
- Line = FileBuffer.CurrentLine;
-
- //
- // if is the last dummy line, SO CAN not cut
- //
- if (StrCmp (Line->Buffer, L"\0") == 0 && Line->Link.ForwardLink == FileBuffer.ListHead
- //
- // last line
- //
- ) {
- //
- // LAST LINE AND NOTHING ON THIS LINE, SO CUT NOTHING
- //
- StatusBarSetStatusString (L"Nothing to Cut");
- return EFI_NOT_FOUND;
- }
- //
- // if is the last line, so create a dummy line
- //
- if (Line->Link.ForwardLink == FileBuffer.ListHead) {
- //
- // last line
- // create a new line
- //
- NewLine = FileBufferCreateLine ();
- if (NewLine == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- }
-
- FileBuffer.NumLines--;
- Row = FileBuffer.FilePosition.Row;
- Col = 1;
- //
- // move home
- //
- FileBuffer.CurrentLine = CR (
- FileBuffer.CurrentLine->Link.ForwardLink,
- EFI_EDITOR_LINE,
- Link,
- LINE_LIST_SIGNATURE
- );
-
- RemoveEntryList (&Line->Link);
-
- FileBuffer.Lines = CR (FileBuffer.ListHead->ForwardLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
-
- FileBufferMovePosition (Row, Col);
-
- FileBuffer.FileModified = TRUE;
- FileBufferNeedRefresh = TRUE;
- FileBufferOnlyLineNeedRefresh = FALSE;
-
- *CutLine = Line;
-
- return EFI_SUCCESS;
-}
-
-/**
- Paste a line into line list.
-
- @retval EFI_SUCCESS The paste was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferPasteLine (
- VOID
- )
-{
- EFI_EDITOR_LINE *Line;
- EFI_EDITOR_LINE *NewLine;
- UINTN Row;
- UINTN Col;
-
- //
- // if nothing is on clip board
- // then do nothing
- //
- if (MainEditor.CutLine == NULL) {
- return EFI_SUCCESS;
- }
- //
- // read only file can not be pasted on
- //
- if (FileBuffer.ReadOnly) {
- StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
- return EFI_SUCCESS;
- }
-
- NewLine = LineDup (MainEditor.CutLine);
- if (NewLine == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // insert it above current line
- //
- Line = FileBuffer.CurrentLine;
- NewLine->Link.BackLink = Line->Link.BackLink;
- NewLine->Link.ForwardLink = &Line->Link;
-
- Line->Link.BackLink->ForwardLink = &NewLine->Link;
- Line->Link.BackLink = &NewLine->Link;
-
- FileBuffer.NumLines++;
- FileBuffer.CurrentLine = NewLine;
-
- FileBuffer.Lines = CR (FileBuffer.ListHead->ForwardLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
-
- Col = 1;
- //
- // move home
- //
- Row = FileBuffer.FilePosition.Row;
-
- FileBufferMovePosition (Row, Col);
-
- //
- // after paste, set some value so that refresh knows to do something
- //
- FileBuffer.FileModified = TRUE;
- FileBufferNeedRefresh = TRUE;
- FileBufferOnlyLineNeedRefresh = FALSE;
-
- return EFI_SUCCESS;
-}
-
-/**
- Search string from current position on in file
-
- @param[in] Str The search string.
- @param[in] Offset The offset from current position.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_NOT_FOUND The string Str was not found.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferSearch (
- IN CONST CHAR16 *Str,
- IN CONST UINTN Offset
- )
-{
- CHAR16 *Current;
- UINTN Position;
- UINTN Row;
- UINTN Column;
- EFI_EDITOR_LINE *Line;
- CHAR16 *CharPos;
- LIST_ENTRY *Link;
- BOOLEAN Found;
-
- Column = 0;
- Position = 0;
-
- //
- // search if in current line
- //
- Current = FileBuffer.CurrentLine->Buffer + FileBuffer.FilePosition.Column - 1 + Offset;
-
- if (Current >= (FileBuffer.CurrentLine->Buffer + FileBuffer.CurrentLine->Size)) {
- //
- // the end
- //
- Current = FileBuffer.CurrentLine->Buffer + FileBuffer.CurrentLine->Size;
- }
-
- Found = FALSE;
-
- CharPos = StrStr (Current, Str);
- if (CharPos != NULL) {
- Position = CharPos - Current + 1;
- Found = TRUE;
- }
-
- //
- // found
- //
- if (Found) {
- Column = (Position - 1) + FileBuffer.FilePosition.Column + Offset;
- Row = FileBuffer.FilePosition.Row;
- } else {
- //
- // not found so find through next lines
- //
- Link = FileBuffer.CurrentLine->Link.ForwardLink;
-
- Row = FileBuffer.FilePosition.Row + 1;
- while (Link != FileBuffer.ListHead) {
- Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
-// Position = StrStr (Line->Buffer, Str);
- CharPos = StrStr (Line->Buffer, Str);
- if (CharPos != NULL) {
- Position = CharPos - Line->Buffer + 1;
- Found = TRUE;
- }
-
- if (Found) {
- //
- // found
- //
- Column = Position;
- break;
- }
-
- Row++;
- Link = Link->ForwardLink;
- }
-
- if (Link == FileBuffer.ListHead) {
- Found = FALSE;
- } else {
- Found = TRUE;
- }
- }
-
- if (!Found) {
- return EFI_NOT_FOUND;
- }
-
- FileBufferMovePosition (Row, Column);
-
- //
- // call refresh to fresh edit area,
- // because the outer may loop to find multiply occurrence of this string
- //
- FileBufferRefresh ();
-
- return EFI_SUCCESS;
-}
-
-/**
- Replace SearchLen characters from current position on with Replace.
-
- This will modify the current buffer at the current position.
-
- @param[in] Replace The string to replace.
- @param[in] SearchLen Search string's length.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferReplace (
- IN CONST CHAR16 *Replace,
- IN CONST UINTN SearchLen
- )
-{
- UINTN ReplaceLen;
- UINTN Index;
- CHAR16 *Buffer;
- UINTN NewSize;
- UINTN OldSize;
- UINTN Gap;
-
- ReplaceLen = StrLen (Replace);
-
- OldSize = FileBuffer.CurrentLine->Size + 1;
- //
- // include CHAR_NULL
- //
- NewSize = OldSize + (ReplaceLen - SearchLen);
-
- if (ReplaceLen > SearchLen) {
- //
- // do not have the enough space
- //
- if (FileBuffer.CurrentLine->TotalSize + 1 <= NewSize) {
- FileBuffer.CurrentLine->Buffer = ReallocatePool (
- 2 * OldSize,
- 2 * NewSize,
- FileBuffer.CurrentLine->Buffer
- );
- FileBuffer.CurrentLine->TotalSize = NewSize - 1;
- }
-
- if (FileBuffer.CurrentLine->Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // the end CHAR_NULL character;
- //
- Buffer = FileBuffer.CurrentLine->Buffer + (NewSize - 1);
- Gap = ReplaceLen - SearchLen;
-
- //
- // keep the latter part
- //
- for (Index = 0; Index < (FileBuffer.CurrentLine->Size - FileBuffer.FilePosition.Column - SearchLen + 2); Index++) {
- *Buffer = *(Buffer - Gap);
- Buffer--;
- }
- //
- // set replace into it
- //
- Buffer = FileBuffer.CurrentLine->Buffer + FileBuffer.FilePosition.Column - 1;
- for (Index = 0; Index < ReplaceLen; Index++) {
- Buffer[Index] = Replace[Index];
- }
- }
-
- if (ReplaceLen < SearchLen) {
- Buffer = FileBuffer.CurrentLine->Buffer + FileBuffer.FilePosition.Column - 1;
-
- for (Index = 0; Index < ReplaceLen; Index++) {
- Buffer[Index] = Replace[Index];
- }
-
- Buffer += ReplaceLen;
- Gap = SearchLen - ReplaceLen;
-
- //
- // set replace into it
- //
- for (Index = 0; Index < (FileBuffer.CurrentLine->Size - FileBuffer.FilePosition.Column - ReplaceLen + 2); Index++) {
- *Buffer = *(Buffer + Gap);
- Buffer++;
- }
- }
-
- if (ReplaceLen == SearchLen) {
- Buffer = FileBuffer.CurrentLine->Buffer + FileBuffer.FilePosition.Column - 1;
- for (Index = 0; Index < ReplaceLen; Index++) {
- Buffer[Index] = Replace[Index];
- }
- }
-
- FileBuffer.CurrentLine->Size += (ReplaceLen - SearchLen);
-
- FileBufferOnlyLineNeedRefresh = TRUE;
-
- FileBuffer.FileModified = TRUE;
-
- MainTitleBarRefresh (MainEditor.FileBuffer->FileName, MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly, MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row, 0, 0);
- FileBufferRestorePosition ();
- FileBufferRefresh ();
-
- return EFI_SUCCESS;
-}
-
-/**
- Move the mouse cursor position.
-
- @param[in] TextX The new x-coordinate.
- @param[in] TextY The new y-coordinate.
-**/
-VOID
-EFIAPI
-FileBufferAdjustMousePosition (
- IN CONST INT32 TextX,
- IN CONST INT32 TextY
- )
-{
- UINTN CoordinateX;
- UINTN CoordinateY;
- UINTN AbsX;
- UINTN AbsY;
-
- //
- // TextX and TextY is mouse movement data returned by mouse driver
- // This function will change it to MousePosition
- //
- //
- // get absolute value
- //
-
- AbsX = ABS(TextX);
- AbsY = ABS(TextY);
-
- CoordinateX = FileBuffer.MousePosition.Column;
- CoordinateY = FileBuffer.MousePosition.Row;
-
- if (TextX >= 0) {
- CoordinateX += TextX;
- } else {
- if (CoordinateX >= AbsX) {
- CoordinateX -= AbsX;
- } else {
- CoordinateX = 0;
- }
- }
-
- if (TextY >= 0) {
- CoordinateY += TextY;
- } else {
- if (CoordinateY >= AbsY) {
- CoordinateY -= AbsY;
- } else {
- CoordinateY = 0;
- }
- }
- //
- // check whether new mouse column position is beyond screen
- // if not, adjust it
- //
- if (CoordinateX >= 1 && CoordinateX <= MainEditor.ScreenSize.Column) {
- FileBuffer.MousePosition.Column = CoordinateX;
- } else if (CoordinateX < 1) {
- FileBuffer.MousePosition.Column = 1;
- } else if (CoordinateX > MainEditor.ScreenSize.Column) {
- FileBuffer.MousePosition.Column = MainEditor.ScreenSize.Column;
- }
- //
- // check whether new mouse row position is beyond screen
- // if not, adjust it
- //
- if (CoordinateY >= 2 && CoordinateY <= (MainEditor.ScreenSize.Row - 1)) {
- FileBuffer.MousePosition.Row = CoordinateY;
- } else if (CoordinateY < 2) {
- FileBuffer.MousePosition.Row = 2;
- } else if (CoordinateY > (MainEditor.ScreenSize.Row - 1)) {
- FileBuffer.MousePosition.Row = (MainEditor.ScreenSize.Row - 1);
- }
-
-}
-
-/**
- Search and replace operation.
-
- @param[in] SearchStr The string to search for.
- @param[in] ReplaceStr The string to replace with.
- @param[in] Offset The column to start at.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferReplaceAll (
- IN CHAR16 *SearchStr,
- IN CHAR16 *ReplaceStr,
- IN UINTN Offset
- )
-{
- CHAR16 *Buffer;
- UINTN Position;
- UINTN Column;
- UINTN ReplaceLen;
- UINTN SearchLen;
- UINTN Index;
- UINTN NewSize;
- UINTN OldSize;
- UINTN Gap;
- EFI_EDITOR_LINE *Line;
- LIST_ENTRY *Link;
- CHAR16 *CharPos;
-
- SearchLen = StrLen (SearchStr);
- ReplaceLen = StrLen (ReplaceStr);
-
- Column = FileBuffer.FilePosition.Column + Offset - 1;
-
- if (Column > FileBuffer.CurrentLine->Size) {
- Column = FileBuffer.CurrentLine->Size;
- }
-
- Link = &(FileBuffer.CurrentLine->Link);
-
- while (Link != FileBuffer.ListHead) {
- Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- CharPos = StrStr (Line->Buffer + Column, SearchStr);
- if (CharPos != NULL) {
- Position = CharPos - Line->Buffer;// + Column;
- //
- // found
- //
- if (ReplaceLen > SearchLen) {
- OldSize = Line->Size + 1;
- //
- // include CHAR_NULL
- //
- NewSize = OldSize + (ReplaceLen - SearchLen);
-
- //
- // do not have the enough space
- //
- if (Line->TotalSize + 1 <= NewSize) {
- Line->Buffer = ReallocatePool (
- 2 * OldSize,
- 2 * NewSize,
- Line->Buffer
- );
- Line->TotalSize = NewSize - 1;
- }
-
- if (Line->Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // the end CHAR_NULL character;
- //
- Buffer = Line->Buffer + (NewSize - 1);
- Gap = ReplaceLen - SearchLen;
-
- //
- // keep the latter part
- //
- for (Index = 0; Index < (Line->Size - Position - SearchLen + 1); Index++) {
- *Buffer = *(Buffer - Gap);
- Buffer--;
- }
-
- } else if (ReplaceLen < SearchLen){
- Buffer = Line->Buffer + Position + ReplaceLen;
- Gap = SearchLen - ReplaceLen;
-
- for (Index = 0; Index < (Line->Size - Position - ReplaceLen + 1); Index++) {
- *Buffer = *(Buffer + Gap);
- Buffer++;
- }
- } else {
- ASSERT(ReplaceLen == SearchLen);
- }
- //
- // set replace into it
- //
- Buffer = Line->Buffer + Position;
- for (Index = 0; Index < ReplaceLen; Index++) {
- Buffer[Index] = ReplaceStr[Index];
- }
-
- Line->Size += (ReplaceLen - SearchLen);
- Column += ReplaceLen;
- } else {
- //
- // not found
- //
- Column = 0;
- Link = Link->ForwardLink;
- }
- }
- //
- // call refresh to fresh edit area
- //
- FileBuffer.FileModified = TRUE;
- FileBufferNeedRefresh = TRUE;
- FileBufferRefresh ();
-
- return EFI_SUCCESS;
-}
-
-/**
- Set the modified state to TRUE.
-**/
-VOID
-EFIAPI
-FileBufferSetModified (
- VOID
- )
-{
- FileBuffer.FileModified = TRUE;
-}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h
deleted file mode 100644
index 9d4a08d7a3..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/** @file
- Declares filebuffer interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_FILE_BUFFER_H_
-#define _LIB_FILE_BUFFER_H_
-
-#include "TextEditorTypes.h"
-
-/**
- Initialization function for FileBuffer.
-
- @param EFI_SUCCESS The initialization was successful.
- @param EFI_LOAD_ERROR A default name could not be created.
- @param EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferInit (
- VOID
- );
-
-/**
- Cleanup function for FileBuffer.
-
- @retval EFI_SUCCESS The cleanup was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferCleanup (
- VOID
- );
-
-/**
- Refresh the screen with whats in the buffer.
-
- @retval EFI_SUCCESS The refresh was successful.
- @retval EFI_LOAD_ERROR There was an error finding what to write.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferRefresh (
- VOID
- );
-
-/**
- Dispatch input to different handler
- @param[in] Key The input key. One of:
- ASCII KEY
- Backspace/Delete
- Return
- Direction key: up/down/left/right/pgup/pgdn
- Home/End
- INS
-
- @retval EFI_SUCCESS The dispatch was done successfully.
- @retval EFI_LOAD_ERROR The dispatch was not successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferHandleInput (
- IN CONST EFI_INPUT_KEY * Key
- );
-
-/**
- Backup function for FileBuffer. Only backup the following items:
- Mouse/Cursor position
- File Name, Type, ReadOnly, Modified
- Insert Mode
-
- This is for making the file buffer refresh as few as possible.
-
- @retval EFI_SUCCESS The backup operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferBackup (
- VOID
- );
-
-/**
- Set the cursor position according to FileBuffer.DisplayPosition.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferRestorePosition (
- VOID
- );
-
-/**
- Set FileName field in FileBuffer.
-
- @param Str The file name to set.
-
- @retval EFI_SUCCESS The filename was successfully set.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_INVALID_PARAMETER Str is not a valid filename.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferSetFileName (
- IN CONST CHAR16 *Str
- );
-
-/**
- Read a file from disk into the FileBuffer.
-
- @param[in] FileName The filename to read.
- @param[in] Recover TRUE if is for recover mode, no information printouts.
-
- @retval EFI_SUCCESS The load was successful.
- @retval EFI_LOAD_ERROR The load failed.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_INVALID_PARAMETER FileName is a directory.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferRead (
- IN CONST CHAR16 *FileName,
- IN CONST BOOLEAN Recover
- );
-
-/**
- Save lines in FileBuffer to disk
-
- @param[in] FileName The file name for writing.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_LOAD_ERROR
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to write the file.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferSave (
- CONST CHAR16 *FileName
- );
-
-/**
- According to cursor's file position, adjust screen display
-
- @param[in] NewFilePosRow The row of file position ( start from 1 ).
- @param[in] NewFilePosCol The column of file position ( start from 1 ).
-**/
-VOID
-EFIAPI
-FileBufferMovePosition (
- IN CONST UINTN NewFilePosRow,
- IN CONST UINTN NewFilePosCol
- );
-
-/**
- Cut current line out and return a pointer to it.
-
- @param[out] CutLine Upon a successful return pointer to the pointer to
- the allocated cut line.
-
- @retval EFI_SUCCESS The cut was successful.
- @retval EFI_NOT_FOUND There was no selection to cut.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferCutLine (
- OUT EFI_EDITOR_LINE **CutLine
- );
-
-/**
- Paste a line into line list.
-
- @retval EFI_SUCCESS The paste was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferPasteLine (
- VOID
- );
-
-/**
- Search string from current position on in file
-
- @param[in] Str The search string.
- @param[in] Offset The offset from current position.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_NOT_FOUND The string Str was not found.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferSearch (
- IN CONST CHAR16 *Str,
- IN CONST UINTN Offset
- );
-
-/**
- Replace SearchLen characters from current position on with Replace.
-
- This will modify the current buffer at the current position.
-
- @param[in] Replace The string to replace.
- @param[in] SearchLen Search string's length.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferReplace (
- IN CONST CHAR16 *Replace,
- IN CONST UINTN SearchLen
- );
-
-/**
- Search and replace operation.
-
- @param[in] SearchStr The string to search for.
- @param[in] ReplaceStr The string to replace with.
- @param[in] Offset The column to start at.
-**/
-EFI_STATUS
-EFIAPI
-FileBufferReplaceAll (
- IN CHAR16 *SearchStr,
- IN CHAR16 *ReplaceStr,
- IN UINTN Offset
- );
-
-/**
- Move the mouse cursor position.
-
- @param[in] TextX The new x-coordinate.
- @param[in] TextY The new y-coordinate.
-**/
-VOID
-EFIAPI
-FileBufferAdjustMousePosition (
- IN CONST INT32 TextX,
- IN CONST INT32 TextY
- );
-
-/**
- Set the modified state to TRUE.
-**/
-VOID
-EFIAPI
-FileBufferSetModified (
- VOID
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
deleted file mode 100644
index c5e47b105b..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
+++ /dev/null
@@ -1,1935 +0,0 @@
-/** @file
- Implements editor interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "TextEditor.h"
-#include "EditStatusBar.h"
-#include "EditInputBar.h"
-#include "EditMenuBar.h"
-
-//
-// the first time editor launch
-//
-BOOLEAN EditorFirst;
-
-//
-// it's time editor should exit
-//
-BOOLEAN EditorExit;
-
-BOOLEAN EditorMouseAction;
-
-extern EFI_EDITOR_FILE_BUFFER FileBuffer;
-
-extern BOOLEAN FileBufferNeedRefresh;
-
-extern BOOLEAN FileBufferOnlyLineNeedRefresh;
-
-extern BOOLEAN FileBufferMouseNeedRefresh;
-
-extern EFI_EDITOR_FILE_BUFFER FileBufferBackupVar;
-
-EFI_EDITOR_GLOBAL_EDITOR MainEditor;
-
-
-/**
- Load a file from disk to editor
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-MainCommandOpenFile (
- VOID
- );
-
-/**
- Switch a file from ASCII to UNICODE or vise-versa.
-
- @retval EFI_SUCCESS The switch was ok or a warning was presented.
-**/
-EFI_STATUS
-MainCommandSwitchFileType (
- VOID
- );
-
-/**
- move cursor to specified lines
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-MainCommandGotoLine (
- VOID
- );
-
-/**
- Save current file to disk, you can save to current file name or
- save to another file name.
-
- @retval EFI_SUCCESS The file was saved correctly.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A file access error occured.
-**/
-EFI_STATUS
-MainCommandSaveFile (
- VOID
- );
-
-/**
- Show help information for the editor.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-MainCommandDisplayHelp (
- VOID
- );
-
-/**
- exit editor
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-MainCommandExit (
- VOID
- );
-
-/**
- search string in file buffer
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-MainCommandSearch (
- VOID
- );
-
-/**
- search string in file buffer, and replace it with another str
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-MainCommandSearchReplace (
- VOID
- );
-
-/**
- cut current line to clipboard
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-MainCommandCutLine (
- VOID
- );
-
-/**
- paste line to file buffer.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-MainCommandPasteLine (
- VOID
- );
-
-/**
- Help info that will be displayed.
-**/
-EFI_STRING_ID MainMenuHelpInfo[] = {
- STRING_TOKEN(STR_EDIT_HELP_TITLE),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_LIST_TITLE),
- STRING_TOKEN(STR_EDIT_HELP_DIV),
- STRING_TOKEN(STR_EDIT_HELP_GO_TO_LINE),
- STRING_TOKEN(STR_EDIT_HELP_SAVE_FILE),
- STRING_TOKEN(STR_EDIT_HELP_EXIT),
- STRING_TOKEN(STR_EDIT_HELP_SEARCH),
- STRING_TOKEN(STR_EDIT_HELP_SEARCH_REPLACE),
- STRING_TOKEN(STR_EDIT_HELP_CUT_LINE),
- STRING_TOKEN(STR_EDIT_HELP_PASTE_LINE),
- STRING_TOKEN(STR_EDIT_HELP_OPEN_FILE),
- STRING_TOKEN(STR_EDIT_HELP_FILE_TYPE),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_EXIT_HELP),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_DIV),
-0
-};
-
-MENU_ITEM_FUNCTION MainControlBasedMenuFunctions[] = {
- NULL,
- NULL, /* Ctrl - A */
- NULL, /* Ctrl - B */
- NULL, /* Ctrl - C */
- NULL, /* Ctrl - D */
- MainCommandDisplayHelp, /* Ctrl - E */
- MainCommandSearch, /* Ctrl - F */
- MainCommandGotoLine, /* Ctrl - G */
- NULL, /* Ctrl - H */
- NULL, /* Ctrl - I */
- NULL, /* Ctrl - J */
- MainCommandCutLine, /* Ctrl - K */
- NULL, /* Ctrl - L */
- NULL, /* Ctrl - M */
- NULL, /* Ctrl - N */
- MainCommandOpenFile, /* Ctrl - O */
- NULL, /* Ctrl - P */
- MainCommandExit, /* Ctrl - Q */
- MainCommandSearchReplace, /* Ctrl - R */
- MainCommandSaveFile, /* Ctrl - S */
- MainCommandSwitchFileType, /* Ctrl - T */
- MainCommandPasteLine, /* Ctrl - U */
- NULL, /* Ctrl - V */
- NULL, /* Ctrl - W */
- NULL, /* Ctrl - X */
- NULL, /* Ctrl - Y */
- NULL, /* Ctrl - Z */
-};
-
-EDITOR_MENU_ITEM MainMenuItems[] = {
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_GO_TO_LINE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F1),
- MainCommandGotoLine
- },
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_SAVE_FILE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F2),
- MainCommandSaveFile
- },
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_EXIT),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F3),
- MainCommandExit
- },
-
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_SEARCH),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F4),
- MainCommandSearch
- },
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_SEARCH_REPLACE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F5),
- MainCommandSearchReplace
- },
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_CUT_LINE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F6),
- MainCommandCutLine
- },
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_PASTE_LINE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F7),
- MainCommandPasteLine
- },
-
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_OPEN_FILE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F8),
- MainCommandOpenFile
- },
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_FILE_TYPE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F9),
- MainCommandSwitchFileType
- },
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_FILE_TYPE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F11),
- MainCommandSwitchFileType
- },
-
- {
- 0,
- 0,
- NULL
- }
-};
-
-
-/**
- Load a file from disk to editor
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-MainCommandOpenFile (
- VOID
- )
-{
- BOOLEAN Done;
- EFI_STATUS Status;
-
- //
- // This command will open a file from current working directory.
- // Read-only file can also be opened. But it can not be modified.
- // Below is the scenario of Open File command:
- // 1.IF currently opened file has not been modIFied, directly go to step .
- // IF currently opened file has been modified,
- // an Input Bar will be prompted as :
- // "File Modified. Save ( Yes/No/Cancel) ?"
- // IF user press 'y' or 'Y', currently opened file will be saved.
- // IF user press 'n' or 'N', currently opened file will
- // not be saved.
- // IF user press 'c' or 'C' or ESC, Open File command ends and
- // currently opened file is still opened.
- //
- // 2. An Input Bar will be prompted as : "File Name to Open: "
- // IF user press ESC, Open File command ends and
- // currently opened file is still opened.
- // Any other inputs with a Return will
- // cause currently opened file close.
- //
- // 3. IF user input file name is an existing file , this file will be read
- // and opened.
- // IF user input file name is a new file, this file will be created
- // and opened. This file's type ( UNICODE or ASCII ) is the same
- // with the old file.
- // if current file is modified, so you need to choose
- // whether to save it first.
- //
- if (MainEditor.FileBuffer->FileModified) {
-
- Status = InputBarSetPrompt (L"File modified. Save (Yes/No/Cancel) ? ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // the answer is just one character
- //
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // loop for user's answer
- // valid answer is just 'y' 'Y', 'n' 'N', 'c' 'C'
- //
- Done = FALSE;
- while (!Done) {
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // want to save this file first
- //
- Status = FileBufferSave (MainEditor.FileBuffer->FileName);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- MainTitleBarRefresh (MainEditor.FileBuffer->FileName, MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly, MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row, 0, 0);
- FileBufferRestorePosition ();
- Done = TRUE;
- break;
-
- case L'n':
- case L'N':
- //
- // the file won't be saved
- //
- Done = TRUE;
- break;
-
- case L'c':
- case L'C':
- return EFI_SUCCESS;
- }
- }
- }
- //
- // TO get the open file name
- //
- Status = InputBarSetPrompt (L"File Name to Open: ");
- if (EFI_ERROR (Status)) {
- FileBufferRead (MainEditor.FileBuffer->FileName, TRUE);
- return Status;
- }
-
- Status = InputBarSetStringSize (100);
- if (EFI_ERROR (Status)) {
- FileBufferRead (MainEditor.FileBuffer->FileName, TRUE);
- return Status;
- }
-
- while (1) {
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
- //
- // The input string length should > 0
- //
- if (StrLen (InputBarGetString()) > 0) {
- //
- // CHECK if filename is valid
- //
- if (!IsValidFileName (InputBarGetString())) {
- FileBufferRead (MainEditor.FileBuffer->FileName, TRUE);
- StatusBarSetStatusString (L"Invalid File Name");
- return EFI_SUCCESS;
- }
-
- break;
- }
- }
- //
- // read from disk
- //
- Status = FileBufferRead (InputBarGetString(), FALSE);
-
- if (EFI_ERROR (Status)) {
- FileBufferRead (MainEditor.FileBuffer->FileName, TRUE);
- return EFI_LOAD_ERROR;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Switch a file from ASCII to UNICODE or vise-versa.
-
- @retval EFI_SUCCESS The switch was ok or a warning was presented.
-**/
-EFI_STATUS
-MainCommandSwitchFileType (
- VOID
- )
-{
- //
- // Below is the scenario of File Type command:
- // After File Type is executed, file type will be changed to another type
- // if file is read-only, can not be modified
- //
- if (MainEditor.FileBuffer->ReadOnly) {
- StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
- return EFI_SUCCESS;
- }
-
- if (MainEditor.FileBuffer->FileType == FileTypeUnicode) {
- MainEditor.FileBuffer->FileType = FileTypeAscii;
- } else {
- MainEditor.FileBuffer->FileType = FileTypeUnicode;
- }
-
- MainEditor.FileBuffer->FileModified = TRUE;
-
- return EFI_SUCCESS;
-}
-
-/**
- cut current line to clipboard
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-MainCommandCutLine (
- VOID
- )
-{
- EFI_STATUS Status;
- EFI_EDITOR_LINE *Line;
-
- //
- // This command will cut current line ( where cursor is on ) to clip board.
- // And cursor will move to the beginning of next line.
- // Below is the scenario of Cut Line command:
- // 1. IF cursor is on valid line, current line will be cut to clip board.
- // IF cursor is not on valid line, an Status String will be prompted :
- // "Nothing to Cut".
- //
- Status = FileBufferCutLine (&Line);
- if (Status == EFI_NOT_FOUND) {
- return EFI_SUCCESS;
- }
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- MainEditor.CutLine = Line;
-
- return EFI_SUCCESS;
-}
-
-/**
- paste line to file buffer.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-MainCommandPasteLine (
- VOID
- )
-{
- EFI_STATUS Status;
-
- //
- // Below is the scenario of Paste Line command:
- // 1. IF nothing is on clipboard, a Status String will be prompted :
- // "No Line to Paste" and Paste Line command ends.
- // IF something is on clipboard, insert it above current line.
- // nothing on clipboard
- //
- if (MainEditor.CutLine == NULL) {
- StatusBarSetStatusString (L"No Line to Paste");
- return EFI_SUCCESS;
- }
-
- Status = FileBufferPasteLine ();
-
- return Status;
-}
-
-
-/**
- search string in file buffer
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-MainCommandSearch (
- VOID
- )
-{
- EFI_STATUS Status;
- CHAR16 *Buffer;
- BOOLEAN Done;
- UINTN Offset;
-
- //
- // Below is the scenario of Search command:
- // 1. An Input Bar will be prompted : "Enter Search String:".
- // IF user press ESC, Search command ends.
- // IF user just press Enter, Search command ends.
- // IF user inputs the search string, do Step 2.
- //
- // 2. IF input search string is found, cursor will move to the first
- // occurrence and do Step 3.
- // IF input search string is not found, a Status String
- // "Search String Not Found" will be prompted and Search command ends.
- //
- // 3. An Input Bar will be prompted: "Find Next (Yes/No/Cancel ) ?".
- // IF user press ESC, Search command ends.
- // IF user press 'y' or 'Y', do Step 2.
- // IF user press 'n' or 'N', Search command ends.
- // IF user press 'c' or 'C', Search command ends.
- //
- Status = InputBarSetPrompt (L"Enter Search String: ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (40);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // ESC
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
- //
- // just enter pressed
- //
- if (StrLen (InputBarGetString()) == 0) {
- return EFI_SUCCESS;
- }
-
- Buffer = CatSPrint (NULL, L"%s", InputBarGetString());
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // the first time , search from current position
- //
- Offset = 0;
- do {
- //
- // since search may be continued to search multiple times
- // so we need to backup editor each time
- //
- MainEditorBackup ();
-
- Status = FileBufferSearch (Buffer, Offset);
-
- if (Status == EFI_NOT_FOUND) {
- break;
- }
- //
- // Find next
- //
- Status = InputBarSetPrompt (L"Find Next (Yes/No) ?");
- if (EFI_ERROR (Status)) {
- FreePool (Buffer);
- return Status;
- }
-
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- FreePool (Buffer);
- return Status;
- }
-
- Done = FALSE;
- while (!Done) {
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- FreePool (Buffer);
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- Done = TRUE;
- break;
-
- case L'n':
- case L'N':
- FreePool (Buffer);
- return EFI_SUCCESS;
-
- }
- //
- // end of which
- //
- }
- //
- // end of while !Done
- // for search second, third time, search from current position + strlen
- //
- Offset = StrLen (Buffer);
-
- } while (1);
- //
- // end of do
- //
- FreePool (Buffer);
- StatusBarSetStatusString (L"Search String Not Found");
-
- return EFI_SUCCESS;
-}
-
-/**
- Search string in file buffer, and replace it with another str.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-MainCommandSearchReplace (
- VOID
- )
-{
- EFI_STATUS Status;
- CHAR16 *Search;
- CHAR16 *Replace;
- BOOLEAN Done;
- BOOLEAN First;
- BOOLEAN ReplaceOption;
- UINTN SearchLen;
- UINTN ReplaceLen;
- BOOLEAN ReplaceAll;
-
- ReplaceOption = FALSE;
-
- //
- // Below is the scenario of Search/Replace command:
- // 1. An Input Bar is prompted : "Enter Search String:".
- // IF user press ESC, Search/Replace command ends.
- // IF user just press Enter, Search/Replace command ends.
- // IF user inputs the search string S, do Step 2.
- //
- // 2. An Input Bar is prompted: "Replace With:".
- // IF user press ESC, Search/Replace command ends.
- // IF user inputs the replace string R, do Step 3.
- //
- // 3. IF input search string is not found, an Status String
- // "Search String Not Found" will be prompted
- // and Search/Replace command ends
- // IF input search string is found, do Step 4.
- //
- // 4. An Input Bar will be prompted: "Replace ( Yes/No/All/Cancel )?"
- // IF user press 'y' or 'Y', S will be replaced with R and do Step 5
- // IF user press 'n' or 'N', S will not be replaced and do Step 5.
- // IF user press 'a' or 'A', all the S from file current position on
- // will be replaced with R and Search/Replace command ends.
- // IF user press 'c' or 'C' or ESC, Search/Replace command ends.
- //
- // 5. An Input Bar will be prompted: "Find Next (Yes/No/Cancel) ?".
- // IF user press ESC, Search/Replace command ends.
- // IF user press 'y' or 'Y', do Step 3.
- // IF user press 'n' or 'N', Search/Replace command ends.
- // IF user press 'c' or 'C', Search/Replace command ends.
- // input search string
- //
- Status = InputBarSetPrompt (L"Enter Search String: ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (40);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // ESC
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
- //
- // if just pressed enter
- //
- if (StrLen (InputBarGetString()) == 0) {
- return EFI_SUCCESS;
- }
-
- Search = CatSPrint (NULL, L"%s", InputBarGetString());
- if (Search == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- SearchLen = StrLen (Search);
-
- //
- // input replace string
- //
- Status = InputBarSetPrompt (L"Replace With: ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (40);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // ESC
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
-
- Replace = CatSPrint (NULL, L"%s", InputBarGetString());
- if (Replace == NULL) {
- FreePool (Search);
- return EFI_OUT_OF_RESOURCES;
- }
-
- ReplaceLen = StrLen (Replace);
-
- First = TRUE;
- ReplaceAll = FALSE;
- do {
- //
- // since search may be continued to search multiple times
- // so we need to backup editor each time
- //
- MainEditorBackup ();
-
- if (First) {
- Status = FileBufferSearch (Search, 0);
- } else {
- //
- // if just replace, so skip this replace string
- // if replace string is an empty string, so skip to next character
- //
- if (ReplaceOption) {
- Status = FileBufferSearch (Search, (ReplaceLen == 0) ? 1 : ReplaceLen);
- } else {
- Status = FileBufferSearch (Search, SearchLen);
- }
- }
-
- if (Status == EFI_NOT_FOUND) {
- break;
- }
- //
- // replace or not?
- //
- Status = InputBarSetPrompt (L"Replace (Yes/No/All/Cancel) ?");
-
- if (EFI_ERROR (Status)) {
- FreePool (Search);
- FreePool (Replace);
- return Status;
- }
-
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- FreePool (Search);
- FreePool (Replace);
- return Status;
- }
-
- Done = FALSE;
- while (!Done) {
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- FreePool (Search);
- FreePool (Replace);
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- Done = TRUE;
- ReplaceOption = TRUE;
- break;
-
- case L'n':
- case L'N':
- Done = TRUE;
- ReplaceOption = FALSE;
- break;
-
- case L'a':
- case L'A':
- Done = TRUE;
- ReplaceOption = TRUE;
- ReplaceAll = TRUE;
- break;
-
- case L'c':
- case L'C':
- FreePool (Search);
- FreePool (Replace);
- return EFI_SUCCESS;
-
- }
- //
- // end of which
- //
- }
- //
- // end of while !Done
- // Decide to Replace
- //
- if (ReplaceOption) {
- //
- // file is read-only
- //
- if (MainEditor.FileBuffer->ReadOnly) {
- StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
- return EFI_SUCCESS;
- }
- //
- // replace all
- //
- if (ReplaceAll) {
- Status = FileBufferReplaceAll (Search, Replace, 0);
- FreePool (Search);
- FreePool (Replace);
- return Status;
- }
- //
- // replace
- //
- Status = FileBufferReplace (Replace, SearchLen);
- if (EFI_ERROR (Status)) {
- FreePool (Search);
- FreePool (Replace);
- return Status;
- }
- }
- //
- // Find next
- //
- Status = InputBarSetPrompt (L"Find Next (Yes/No) ?");
- if (EFI_ERROR (Status)) {
- FreePool (Search);
- FreePool (Replace);
- return Status;
- }
-
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- FreePool (Search);
- FreePool (Replace);
- return Status;
- }
-
- Done = FALSE;
- while (!Done) {
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- FreePool (Search);
- FreePool (Replace);
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- Done = TRUE;
- break;
-
- case L'n':
- case L'N':
- FreePool (Search);
- FreePool (Replace);
- return EFI_SUCCESS;
-
- }
- //
- // end of which
- //
- }
- //
- // end of while !Done
- //
- First = FALSE;
-
- } while (1);
- //
- // end of do
- //
- FreePool (Search);
- FreePool (Replace);
-
- StatusBarSetStatusString (L"Search String Not Found");
-
- return EFI_SUCCESS;
-}
-
-/**
- exit editor
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-MainCommandExit (
- VOID
- )
-{
- EFI_STATUS Status;
-
- //
- // Below is the scenario of Exit command:
- // 1. IF currently opened file is not modified, exit the editor and
- // Exit command ends.
- // IF currently opened file is modified, do Step 2
- //
- // 2. An Input Bar will be prompted:
- // "File modified. Save ( Yes/No/Cancel )?"
- // IF user press 'y' or 'Y', currently opened file will be saved
- // and Editor exits
- // IF user press 'n' or 'N', currently opened file will not be saved
- // and Editor exits.
- // IF user press 'c' or 'C' or ESC, Exit command ends.
- // if file has been modified, so will prompt user whether to save the changes
- //
- if (MainEditor.FileBuffer->FileModified) {
-
- Status = InputBarSetPrompt (L"File modified. Save (Yes/No/Cancel) ? ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- while (1) {
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // write file back to disk
- //
- Status = FileBufferSave (MainEditor.FileBuffer->FileName);
- if (!EFI_ERROR (Status)) {
- EditorExit = TRUE;
- }
-
- return Status;
-
- case L'n':
- case L'N':
- EditorExit = TRUE;
- return EFI_SUCCESS;
-
- case L'c':
- case L'C':
- return EFI_SUCCESS;
-
- }
- }
- }
-
- EditorExit = TRUE;
- return EFI_SUCCESS;
-
-}
-
-/**
- move cursor to specified lines
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-MainCommandGotoLine (
- VOID
- )
-{
- EFI_STATUS Status;
- UINTN Row;
-
- //
- // Below is the scenario of Go To Line command:
- // 1. An Input Bar will be prompted : "Go To Line:".
- // IF user press ESC, Go To Line command ends.
- // IF user just press Enter, cursor remains unchanged.
- // IF user inputs line number, do Step 2.
- //
- // 2. IF input line number is valid, move cursor to the beginning
- // of specified line and Go To Line command ends.
- // IF input line number is invalid, a Status String will be prompted:
- // "No Such Line" and Go To Line command ends.
- //
- Status = InputBarSetPrompt (L"Go To Line: ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // line number's digit <= 6
- //
- Status = InputBarSetStringSize (6);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // press ESC
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
- //
- // if JUST press enter
- //
- if (StrLen (InputBarGetString()) == 0) {
- return EFI_SUCCESS;
- }
-
- Row = ShellStrToUintn (InputBarGetString());
-
- //
- // invalid line number
- //
- if (Row > MainEditor.FileBuffer->NumLines || Row <= 0) {
- StatusBarSetStatusString (L"No Such Line");
- return EFI_SUCCESS;
- }
- //
- // move cursor to that line's start
- //
- FileBufferMovePosition (Row, 1);
-
- return EFI_SUCCESS;
-}
-
-/**
- Save current file to disk, you can save to current file name or
- save to another file name.
-
- @retval EFI_SUCCESS The file was saved correctly.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A file access error occured.
-**/
-EFI_STATUS
-MainCommandSaveFile (
- VOID
- )
-{
- EFI_STATUS Status;
- CHAR16 *FileName;
- BOOLEAN OldFile;
- CHAR16 *Str;
- SHELL_FILE_HANDLE FileHandle;
- EFI_FILE_INFO *Info;
-
- //
- // This command will save currently opened file to disk.
- // You can choose save to another file name or just save to
- // current file name.
- // Below is the scenario of Save File command:
- // ( Suppose the old file name is A )
- // 1. An Input Bar will be prompted: "File To Save: [ old file name]"
- // IF user press ESC, Save File command ends .
- // IF user press Enter, input file name will be A.
- // IF user inputs a new file name B, input file name will be B.
- //
- // 2. IF input file name is A, go to do Step 3.
- // IF input file name is B, go to do Step 4.
- //
- // 3. IF A is read only, Status Bar will show "Access Denied" and
- // Save File commands ends.
- // IF A is not read only, save file buffer to disk and remove modified
- // flag in Title Bar , then Save File command ends.
- //
- // 4. IF B does not exist, create this file and save file buffer to it.
- // Go to do Step 7.
- // IF B exits, do Step 5.
- //
- // 5.An Input Bar will be prompted:
- // "File Exists. Overwrite ( Yes/No/Cancel )?"
- // IF user press 'y' or 'Y', do Step 6.
- // IF user press 'n' or 'N', Save File commands ends.
- // IF user press 'c' or 'C' or ESC, Save File commands ends.
- //
- // 6. IF B is a read-only file, Status Bar will show "Access Denied" and
- // Save File commands ends.
- // IF B can be read and write, save file buffer to B.
- //
- // 7. Update File Name field in Title Bar to B and remove the modified
- // flag in Title Bar.
- //
- Str = CatSPrint (NULL, L"File to Save: [%s]", MainEditor.FileBuffer->FileName);
- if (Str == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- if (StrLen (Str) >= 50) {
- //
- // replace the long file name with "..."
- //
- Str[46] = L'.';
- Str[47] = L'.';
- Str[48] = L'.';
- Str[49] = L']';
- Str[50] = CHAR_NULL;
- }
-
- Status = InputBarSetPrompt (Str);
- FreePool(Str);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
-
- Status = InputBarSetStringSize (100);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // get new file name
- //
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // if user pressed ESC
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
-
- //
- // if just enter pressed, so think save to current file name
- //
- if (StrLen (InputBarGetString()) == 0) {
- FileName = CatSPrint (NULL, L"%s", MainEditor.FileBuffer->FileName);
- } else {
- FileName = CatSPrint (NULL, L"%s", InputBarGetString());
- }
-
- if (FileName == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- if (!IsValidFileName (FileName)) {
- StatusBarSetStatusString (L"Invalid File Name");
- FreePool (FileName);
- return EFI_SUCCESS;
- }
-
- OldFile = FALSE;
-
- //
- // save to the old file
- //
- if (StringNoCaseCompare (&FileName, &MainEditor.FileBuffer->FileName) == 0) {
- OldFile = TRUE;
- }
-
- if (OldFile) {
- //
- // if the file is read only, so can not write back to it.
- //
- if (MainEditor.FileBuffer->ReadOnly == TRUE) {
- StatusBarSetStatusString (L"Access Denied");
- FreePool (FileName);
- return EFI_SUCCESS;
- }
- } else {
- //
- // if the file exists
- //
- if (ShellFileExists(FileName) != EFI_NOT_FOUND) {
- //
- // check for read only
- //
- Status = ShellOpenFileByName(FileName, &FileHandle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- StatusBarSetStatusString (L"Open Failed");
- FreePool (FileName);
- return EFI_SUCCESS;
- }
-
- Info = ShellGetFileInfo(FileHandle);
- if (Info == NULL) {
- StatusBarSetStatusString (L"Access Denied");
- FreePool (FileName);
- return (EFI_SUCCESS);
- }
-
- if (Info->Attribute & EFI_FILE_READ_ONLY) {
- StatusBarSetStatusString (L"Access Denied - Read Only");
- FreePool (Info);
- FreePool (FileName);
- return (EFI_SUCCESS);
- }
- FreePool (Info);
-
- //
- // ask user whether to overwrite this file
- //
- Status = InputBarSetPrompt (L"File exists. Overwrite (Yes/No/Cancel) ? ");
- if (EFI_ERROR (Status)) {
- SHELL_FREE_NON_NULL (FileName);
- return Status;
- }
-
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- SHELL_FREE_NON_NULL (FileName);
- return Status;
- }
-
- while (TRUE) {
- Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- break;
-
- case L'n':
- case L'N':
- case L'c':
- case L'C':
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
- } // end switch
- } // while (!done)
- } // file does exist
- } // if old file name same
-
- //
- // save file to disk with specified name
- //
- FileBufferSetModified();
- Status = FileBufferSave (FileName);
- SHELL_FREE_NON_NULL (FileName);
-
- return Status;
-}
-
-/**
- Show help information for the editor.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-MainCommandDisplayHelp (
- VOID
- )
-{
- INT32 CurrentLine;
- CHAR16 *InfoString;
- EFI_INPUT_KEY Key;
-
- //
- // print helpInfo
- //
- for (CurrentLine = 0; 0 != MainMenuHelpInfo[CurrentLine]; CurrentLine++) {
- InfoString = HiiGetString(gShellDebug1HiiHandle, MainMenuHelpInfo[CurrentLine], NULL);
- ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString);
- }
-
- //
- // scan for ctrl+w
- //
- do {
- gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- } while(SCAN_CONTROL_W != Key.UnicodeChar);
-
- //
- // update screen with file buffer's info
- //
- FileBufferRestorePosition ();
- FileBufferNeedRefresh = TRUE;
- FileBufferOnlyLineNeedRefresh = FALSE;
- FileBufferRefresh ();
-
- return EFI_SUCCESS;
-}
-
-EFI_EDITOR_COLOR_ATTRIBUTES OriginalColors;
-INTN OriginalMode;
-
-
-//
-// basic initialization for MainEditor
-//
-EFI_EDITOR_GLOBAL_EDITOR MainEditorConst = {
- &FileBuffer,
- {
- 0,
- 0
- },
- {
- 0,
- 0
- },
- NULL,
- FALSE,
- NULL
-};
-
-/**
- The initialization function for MainEditor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-EFIAPI
-MainEditorInit (
- VOID
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *HandleBuffer;
- UINTN HandleCount;
- UINTN Index;
-
- //
- // basic initialization
- //
- CopyMem (&MainEditor, &MainEditorConst, sizeof (MainEditor));
-
- //
- // set screen attributes
- //
- MainEditor.ColorAttributes.Colors.Foreground = gST->ConOut->Mode->Attribute & 0x000000ff;
-
- MainEditor.ColorAttributes.Colors.Background = (UINT8) (gST->ConOut->Mode->Attribute >> 4);
- OriginalColors = MainEditor.ColorAttributes.Colors;
-
- OriginalMode = gST->ConOut->Mode->Mode;
-
- //
- // query screen size
- //
- gST->ConOut->QueryMode (
- gST->ConOut,
- gST->ConOut->Mode->Mode,
- &(MainEditor.ScreenSize.Column),
- &(MainEditor.ScreenSize.Row)
- );
-
- //
- // Find mouse in System Table ConsoleInHandle
- //
- Status = gBS->HandleProtocol (
- gST->ConIn,
- &gEfiSimplePointerProtocolGuid,
- (VOID**)&MainEditor.MouseInterface
- );
- if (EFI_ERROR (Status)) {
- //
- // If there is no Simple Pointer Protocol on System Table
- //
- HandleBuffer = NULL;
- MainEditor.MouseInterface = NULL;
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiSimplePointerProtocolGuid,
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- if (!EFI_ERROR (Status) && HandleCount > 0) {
- //
- // Try to find the first available mouse device
- //
- for (Index = 0; Index < HandleCount; Index++) {
- Status = gBS->HandleProtocol (
- HandleBuffer[Index],
- &gEfiSimplePointerProtocolGuid,
- (VOID**)&MainEditor.MouseInterface
- );
- if (!EFI_ERROR (Status)) {
- break;
- }
- }
- }
- if (HandleBuffer != NULL) {
- FreePool (HandleBuffer);
- }
- }
-
- if (!EFI_ERROR (Status) && MainEditor.MouseInterface != NULL) {
- MainEditor.MouseAccumulatorX = 0;
- MainEditor.MouseAccumulatorY = 0;
- MainEditor.MouseSupported = TRUE;
- }
-
- //
- // below will call the five components' init function
- //
- Status = MainTitleBarInit (L"UEFI EDIT 2.0");
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBEDITOR_TITLEBAR), gShellDebug1HiiHandle);
- return EFI_LOAD_ERROR;
- }
-
- Status = ControlHotKeyInit (MainControlBasedMenuFunctions);
- Status = MenuBarInit (MainMenuItems);
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBEDITOR_MAINMENU), gShellDebug1HiiHandle);
- return EFI_LOAD_ERROR;
- }
-
- Status = StatusBarInit ();
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBEDITOR_STATUSBAR), gShellDebug1HiiHandle);
- return EFI_LOAD_ERROR;
- }
-
- InputBarInit ();
-
- Status = FileBufferInit ();
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBEDITOR_FILEBUFFER), gShellDebug1HiiHandle);
- return EFI_LOAD_ERROR;
- }
- //
- // clear whole screen and enable cursor
- //
- gST->ConOut->ClearScreen (gST->ConOut);
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
-
- //
- // initialize EditorFirst and EditorExit
- //
- EditorFirst = TRUE;
- EditorExit = FALSE;
- EditorMouseAction = FALSE;
-
- return EFI_SUCCESS;
-}
-
-/**
- The cleanup function for MainEditor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-EFIAPI
-MainEditorCleanup (
- VOID
- )
-{
- EFI_STATUS Status;
-
- //
- // call the five components' cleanup function
- // if error, do not exit
- // just print some warning
- //
- MainTitleBarCleanup();
- StatusBarCleanup();
- InputBarCleanup();
- MenuBarCleanup ();
-
- Status = FileBufferCleanup ();
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP), gShellDebug1HiiHandle);
- }
- //
- // restore old mode
- //
- if (OriginalMode != gST->ConOut->Mode->Mode) {
- gST->ConOut->SetMode (gST->ConOut, OriginalMode);
- }
- //
- // restore old screen color
- //
- gST->ConOut->SetAttribute (
- gST->ConOut,
- EFI_TEXT_ATTR (OriginalColors.Foreground, OriginalColors.Background)
- );
-
- gST->ConOut->ClearScreen (gST->ConOut);
-
- return EFI_SUCCESS;
-}
-
-/**
- Refresh the main editor component.
-**/
-VOID
-EFIAPI
-MainEditorRefresh (
- VOID
- )
-{
- //
- // The Stall value is from experience. NOT from spec. avoids 'flicker'
- //
- gBS->Stall (50);
-
- //
- // call the components refresh function
- //
- if (EditorFirst
- || StrCmp (FileBufferBackupVar.FileName, FileBuffer.FileName) != 0
- || FileBufferBackupVar.FileType != FileBuffer.FileType
- || FileBufferBackupVar.FileModified != FileBuffer.FileModified
- || FileBufferBackupVar.ReadOnly != FileBuffer.ReadOnly) {
-
- MainTitleBarRefresh (MainEditor.FileBuffer->FileName, MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly, MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row, 0, 0);
- FileBufferRestorePosition ();
- FileBufferRefresh ();
- }
- if (EditorFirst
- || FileBufferBackupVar.FilePosition.Row != FileBuffer.FilePosition.Row
- || FileBufferBackupVar.FilePosition.Column != FileBuffer.FilePosition.Column
- || FileBufferBackupVar.ModeInsert != FileBuffer.ModeInsert
- || StatusBarGetRefresh()) {
-
- StatusBarRefresh (EditorFirst, MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column, MainEditor.FileBuffer->FilePosition.Row, MainEditor.FileBuffer->FilePosition.Column, MainEditor.FileBuffer->ModeInsert);
- FileBufferRestorePosition ();
- FileBufferRefresh ();
- }
-
- if (EditorFirst) {
- FileBufferRestorePosition ();
- }
-
- //
- // EditorFirst is now set to FALSE
- //
- EditorFirst = FALSE;
-}
-
-/**
- Get's the resultant location of the cursor based on the relative movement of the Mouse.
-
- @param[in] GuidX The relative mouse movement.
-
- @return The X location of the mouse.
-**/
-INT32
-EFIAPI
-GetTextX (
- IN INT32 GuidX
- )
-{
- INT32 Gap;
-
- MainEditor.MouseAccumulatorX += GuidX;
- Gap = (MainEditor.MouseAccumulatorX * (INT32) MainEditor.ScreenSize.Column) / (INT32) (50 * (INT32) MainEditor.MouseInterface->Mode->ResolutionX);
- MainEditor.MouseAccumulatorX = (MainEditor.MouseAccumulatorX * (INT32) MainEditor.ScreenSize.Column) % (INT32) (50 * (INT32) MainEditor.MouseInterface->Mode->ResolutionX);
- MainEditor.MouseAccumulatorX = MainEditor.MouseAccumulatorX / (INT32) MainEditor.ScreenSize.Column;
- return Gap;
-}
-
-/**
- Get's the resultant location of the cursor based on the relative movement of the Mouse.
-
- @param[in] GuidY The relative mouse movement.
-
- @return The Y location of the mouse.
-**/
-INT32
-EFIAPI
-GetTextY (
- IN INT32 GuidY
- )
-{
- INT32 Gap;
-
- MainEditor.MouseAccumulatorY += GuidY;
- Gap = (MainEditor.MouseAccumulatorY * (INT32) MainEditor.ScreenSize.Row) / (INT32) (50 * (INT32) MainEditor.MouseInterface->Mode->ResolutionY);
- MainEditor.MouseAccumulatorY = (MainEditor.MouseAccumulatorY * (INT32) MainEditor.ScreenSize.Row) % (INT32) (50 * (INT32) MainEditor.MouseInterface->Mode->ResolutionY);
- MainEditor.MouseAccumulatorY = MainEditor.MouseAccumulatorY / (INT32) MainEditor.ScreenSize.Row;
-
- return Gap;
-}
-
-/**
- Support mouse movement. Move the cursor.
-
- @param[in] MouseState The current mouse state.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_NOT_FOUND There was no mouse support found.
-**/
-EFI_STATUS
-EFIAPI
-MainEditorHandleMouseInput (
- IN EFI_SIMPLE_POINTER_STATE MouseState
- )
-{
-
- INT32 TextX;
- INT32 TextY;
- UINTN FRow;
- UINTN FCol;
-
- LIST_ENTRY *Link;
- EFI_EDITOR_LINE *Line;
-
- UINTN Index;
- BOOLEAN Action;
-
- //
- // mouse action means:
- // mouse movement
- // mouse left button
- //
- Action = FALSE;
-
- //
- // have mouse movement
- //
- if (MouseState.RelativeMovementX || MouseState.RelativeMovementY) {
- //
- // handle
- //
- TextX = GetTextX (MouseState.RelativeMovementX);
- TextY = GetTextY (MouseState.RelativeMovementY);
-
- FileBufferAdjustMousePosition (TextX, TextY);
-
- Action = TRUE;
-
- }
-
- //
- // if left button pushed down
- //
- if (MouseState.LeftButton) {
-
- FCol = MainEditor.FileBuffer->MousePosition.Column - 1 + 1;
-
- FRow = MainEditor.FileBuffer->FilePosition.Row +
- MainEditor.FileBuffer->MousePosition.Row -
- MainEditor.FileBuffer->DisplayPosition.Row;
-
- //
- // beyond the file line length
- //
- if (MainEditor.FileBuffer->NumLines < FRow) {
- FRow = MainEditor.FileBuffer->NumLines;
- }
-
- Link = MainEditor.FileBuffer->ListHead->ForwardLink;
- for (Index = 0; Index < FRow - 1; Index++) {
- Link = Link->ForwardLink;
- }
-
- Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
-
- //
- // beyond the line's column length
- //
- if (FCol > Line->Size + 1) {
- FCol = Line->Size + 1;
- }
-
- FileBufferMovePosition (FRow, FCol);
-
- MainEditor.FileBuffer->MousePosition.Row = MainEditor.FileBuffer->DisplayPosition.Row;
-
- MainEditor.FileBuffer->MousePosition.Column = MainEditor.FileBuffer->DisplayPosition.Column;
-
- Action = TRUE;
- }
- //
- // mouse has action
- //
- if (Action) {
- return EFI_SUCCESS;
- }
-
- //
- // no mouse action
- //
- return EFI_NOT_FOUND;
-}
-
-/**
- Handle user key input. This routes to other functions for the actions.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-MainEditorKeyInput (
- VOID
- )
-{
- EFI_INPUT_KEY Key;
- EFI_STATUS Status;
- EFI_SIMPLE_POINTER_STATE MouseState;
-
- do {
-
- Status = EFI_SUCCESS;
- EditorMouseAction = FALSE;
-
- //
- // backup some key elements, so that can aVOID some refresh work
- //
- MainEditorBackup ();
-
- //
- // change priority of checking mouse/keyboard activity dynamically
- // so prevent starvation of keyboard.
- // if last time, mouse moves then this time check keyboard
- //
- if (MainEditor.MouseSupported) {
- Status = MainEditor.MouseInterface->GetState (
- MainEditor.MouseInterface,
- &MouseState
- );
- if (!EFI_ERROR (Status)) {
-
- Status = MainEditorHandleMouseInput (MouseState);
-
- if (!EFI_ERROR (Status)) {
- EditorMouseAction = TRUE;
- FileBufferMouseNeedRefresh = TRUE;
- } else if (Status == EFI_LOAD_ERROR) {
- StatusBarSetStatusString (L"Invalid Mouse Movement ");
- }
- }
- }
-
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- if (!EFI_ERROR (Status)) {
- //
- // dispatch to different components' key handling function
- // so not everywhere has to set this variable
- //
- FileBufferMouseNeedRefresh = TRUE;
- //
- // clear previous status string
- //
- StatusBarSetRefresh();
-
- //
- // dispatch to different components' key handling function
- //
- if (EFI_NOT_FOUND != MenuBarDispatchControlHotKey(&Key)) {
- Status = EFI_SUCCESS;
- } else if ((Key.ScanCode == SCAN_NULL) || ((Key.ScanCode >= SCAN_UP) && (Key.ScanCode <= SCAN_PAGE_DOWN))) {
- Status = FileBufferHandleInput (&Key);
- } else if ((Key.ScanCode >= SCAN_F1) && (Key.ScanCode <= SCAN_F12)) {
- Status = MenuBarDispatchFunctionKey (&Key);
- } else {
- StatusBarSetStatusString (L"Unknown Command");
- FileBufferMouseNeedRefresh = FALSE;
- }
-
- if (Status != EFI_SUCCESS && Status != EFI_OUT_OF_RESOURCES) {
- //
- // not already has some error status
- //
- if (StatusBarGetString() != NULL && StrCmp (L"", StatusBarGetString()) == 0) {
- StatusBarSetStatusString (L"Disk Error. Try Again");
- }
- }
-
- }
- //
- // after handling, refresh editor
- //
- MainEditorRefresh ();
-
- } while (Status != EFI_OUT_OF_RESOURCES && !EditorExit);
-
- return Status;
-}
-
-/**
- Set clipboard
-
- @param[in] Line A pointer to the line to be set to clipboard
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-MainEditorSetCutLine (
- EFI_EDITOR_LINE *Line
- )
-{
- if (Line == NULL) {
- return EFI_SUCCESS;
- }
-
- if (MainEditor.CutLine != NULL) {
- //
- // free the old clipboard
- //
- LineFree (MainEditor.CutLine);
- }
- //
- // duplicate the line to clipboard
- //
- MainEditor.CutLine = LineDup (Line);
- if (MainEditor.CutLine == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Backup function for MainEditor
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-MainEditorBackup (
- VOID
- )
-{
- FileBufferBackup ();
-
- return EFI_SUCCESS;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.h
deleted file mode 100644
index c45859deda..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/** @file
- Declares editor interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_EDITOR_H_
-#define _LIB_EDITOR_H_
-
-#include "TextEditorTypes.h"
-
-/**
- The initialization function for MainEditor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-EFIAPI
-MainEditorInit (
- VOID
- );
-
-/**
- The cleanup function for MainEditor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-EFIAPI
-MainEditorCleanup (
- VOID
- );
-
-/**
- Refresh the main editor component.
-**/
-VOID
-EFIAPI
-MainEditorRefresh (
- VOID
- );
-
-/**
- Handle user key input. This routes to other functions for the actions.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-MainEditorKeyInput (
- VOID
- );
-
-/**
- Backup function for MainEditor
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-MainEditorBackup (
- VOID
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.c
deleted file mode 100644
index ade78b8f90..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/** @file
- Implementation of various string and line routines.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "TextEditor.h"
-#include "Misc.h"
-
-/**
- Duplicate a EFI_EDITOR_LINE structure.
-
- @param Src The line structure to copy from.
-
- @retval NULL A memory allocation failed.
- @return a pointer to the newly allcoated line.
-**/
-EFI_EDITOR_LINE *
-EFIAPI
-LineDup (
- IN EFI_EDITOR_LINE *Src
- )
-{
- EFI_EDITOR_LINE *Dest;
-
- //
- // allocate for the line structure
- //
- Dest = AllocateZeroPool (sizeof (EFI_EDITOR_LINE));
- if (Dest == NULL) {
- return NULL;
- }
- //
- // allocate and set the line buffer
- //
- Dest->Buffer = CatSPrint (NULL, L"%s", Src->Buffer);
- if (Dest->Buffer == NULL) {
- FreePool (Dest);
- return NULL;
- }
-
- //
- // set the other structure members
- //
- Dest->Signature = LINE_LIST_SIGNATURE;
- Dest->Size = Src->Size;
- Dest->TotalSize = Dest->Size;
- Dest->Type = Src->Type;
- Dest->Link = Src->Link;
-
- return Dest;
-}
-
-/**
- Free a EFI_EDITOR_LINE structure.
-
- @param Src The line structure to free.
-**/
-VOID
-EFIAPI
-LineFree (
- IN EFI_EDITOR_LINE *Src
- )
-{
- if (Src == NULL) {
- return ;
- }
- //
- // free the line buffer and then the line structure itself
- //
- SHELL_FREE_NON_NULL (Src->Buffer);
- SHELL_FREE_NON_NULL (Src);
-
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.h
deleted file mode 100644
index 583de3b42c..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/** @file
- Declares generic editor helper functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_MISC_H_
-#define _LIB_MISC_H_
-
-#include "TextEditorTypes.h"
-
-
-
-/**
- Free a EFI_EDITOR_LINE structure.
-
- @param Src The line structure to free.
-**/
-VOID
-EFIAPI
-LineFree (
- IN EFI_EDITOR_LINE *Src
- );
-
-/**
- Duplicate a EFI_EDITOR_LINE structure.
-
- @param Src The line structure to copy from.
-
- @retval NULL A memory allocation failed.
- @return a pointer to the newly allcoated line.
-**/
-EFI_EDITOR_LINE *
-EFIAPI
-LineDup (
- IN EFI_EDITOR_LINE *Src
- );
-
-
-
-
-
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni
deleted file mode 100644
index a61cae33d3..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditor.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditor.h
deleted file mode 100644
index 774f01a291..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditor.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
- Main include file for Edit shell Debug1 function.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _EFI_EDIT_H_
-#define _EFI_EDIT_H_
-
-#include "TextEditorTypes.h"
-
-#include "MainTextEditor.h"
-#include "FileBuffer.h"
-#include "EditTitleBar.h"
-#include "EditStatusBar.h"
-#include "EditInputBar.h"
-#include "EditMenuBar.h"
-#include "Misc.h"
-
-extern EFI_EDITOR_GLOBAL_EDITOR MainEditor;
-extern BOOLEAN EditorFirst;
-extern BOOLEAN EditorExit;
-
-#endif // _EFI_EDIT_H_
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditorTypes.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditorTypes.h
deleted file mode 100644
index dfd56dd9a6..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditorTypes.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/** @file
- Declares editor types.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _EDITOR_TYPE_H_
-#define _EDITOR_TYPE_H_
-
-#include "UefiShellDebug1CommandsLib.h"
-#include "EditTitleBar.h"
-#include "EditMenuBar.h"
-
-#define MIN_POOL_SIZE 125
-#define MAX_STRING_LENGTH 127
-
-typedef struct {
- UINTN Row;
- UINTN Column;
-} EFI_EDITOR_POSITION;
-
-typedef
-EFI_STATUS
-(*EFI_MENU_ITEM_FUNCTION) (
- VOID
- );
-
-typedef enum {
- NewLineTypeDefault,
- NewLineTypeLineFeed,
- NewLineTypeCarriageReturn,
- NewLineTypeCarriageReturnLineFeed,
- NewLineTypeLineFeedCarriageReturn,
- NewLineTypeUnknown
-} EE_NEWLINE_TYPE;
-
-#define LINE_LIST_SIGNATURE SIGNATURE_32 ('e', 'e', 'l', 'l')
-typedef struct _EFI_EDITOR_LINE {
- UINTN Signature;
- CHAR16 *Buffer;
- UINTN Size; // unit is Unicode
- UINTN TotalSize; // unit is Unicode, exclude CHAR_NULL
- EE_NEWLINE_TYPE Type;
- LIST_ENTRY Link;
-} EFI_EDITOR_LINE;
-
-typedef struct {
- UINT32 Foreground : 4;
- UINT32 Background : 4;
-} EFI_EDITOR_COLOR_ATTRIBUTES;
-
-typedef union {
- EFI_EDITOR_COLOR_ATTRIBUTES Colors;
- UINTN Data;
-} EFI_EDITOR_COLOR_UNION;
-
-typedef struct {
- UINTN Columns;
- UINTN Rows;
-} EFI_EDITOR_TEXT_MODE;
-
-typedef struct {
- CHAR16 *FileName; // file name current edited in editor
- EDIT_FILE_TYPE FileType; // Unicode file or ASCII file
- LIST_ENTRY *ListHead; // list head of lines
- EFI_EDITOR_LINE *Lines; // lines of current file
- UINTN NumLines; // total line numbers
- EFI_EDITOR_POSITION DisplayPosition; // cursor position in screen
- EFI_EDITOR_POSITION FilePosition; // cursor position in file
- EFI_EDITOR_POSITION MousePosition; // mouse position in screen
- // file position of first byte displayed on screen
- //
- EFI_EDITOR_POSITION LowVisibleRange;
-
- BOOLEAN FileModified; // file is modified or not
- BOOLEAN ModeInsert; // input mode INS or OVR
- BOOLEAN ReadOnly; // file is read-only or not
- EFI_EDITOR_LINE *CurrentLine; // current line cursor is at
-} EFI_EDITOR_FILE_BUFFER;
-
-typedef struct {
- EFI_EDITOR_FILE_BUFFER *FileBuffer;
-
- EFI_EDITOR_COLOR_UNION ColorAttributes;
- EFI_EDITOR_POSITION ScreenSize; // row number and column number
- EFI_EDITOR_LINE *CutLine; // clip board
- BOOLEAN MouseSupported;
- EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;
- INT32 MouseAccumulatorX;
- INT32 MouseAccumulatorY;
-
-} EFI_EDITOR_GLOBAL_EDITOR;
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c
deleted file mode 100644
index 978ce7f13a..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/** @file
- Implements inputbar interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "EditInputBar.h"
-#include "UefiShellDebug1CommandsLib.h"
-
-CHAR16 *mPrompt; // Input bar mPrompt string.
-CHAR16 *mReturnString; // The returned string.
-UINTN StringSize; // Size of mReturnString space size.
-
-/**
- Initialize the input bar.
-**/
-VOID
-EFIAPI
-InputBarInit (
- VOID
- )
-{
- mPrompt = NULL;
- mReturnString = NULL;
- StringSize = 0;
-}
-
-/**
- Cleanup function for input bar.
-**/
-VOID
-EFIAPI
-InputBarCleanup (
- VOID
- )
-{
- //
- // free input bar's prompt and input string
- //
- SHELL_FREE_NON_NULL (mPrompt);
- SHELL_FREE_NON_NULL (mReturnString);
- mPrompt = NULL;
- mReturnString = NULL;
-}
-
-/**
- Display the prompt.
- Do the requesting of input.
-
- @param[in] LastColumn The last printable column.
- @param[in] LastRow The last printable row.
-**/
-VOID
-EFIAPI
-InputBarPrintInput (
- IN UINTN LastColumn,
- IN UINTN LastRow
- )
-{
- UINTN Limit;
- UINTN Size;
- CHAR16 *Buffer;
- UINTN Index;
- UINTN mPromptLen;
-
- mPromptLen = StrLen (mPrompt);
- Limit = LastColumn - mPromptLen - 1;
- Size = StrLen (mReturnString);
-
- //
- // check whether the mPrompt length and input length will
- // exceed limit
- //
- if (Size <= Limit) {
- Buffer = mReturnString;
- } else {
- Buffer = mReturnString + Size - Limit;
- }
-
- gST->ConOut->EnableCursor (gST->ConOut, FALSE);
-
- ShellPrintEx (((INT32)mPromptLen), ((INT32)LastRow) - 1, L"%s", Buffer);
- Size = StrLen (Buffer);
-
- //
- // print " " after mPrompt
- //
- for (Index = Size; Index < Limit; Index++) {
- ShellPrintEx ((INT32)(mPromptLen + Size), ((INT32)LastRow) - 1, L" ");
- }
-
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
- gST->ConOut->SetCursorPosition (gST->ConOut, Size + mPromptLen, LastRow - 1);
-}
-
-typedef struct {
- UINT32 Foreground : 4;
- UINT32 Background : 4;
-} INPUT_BAR_COLOR_ATTRIBUTES;
-
-typedef union {
- INPUT_BAR_COLOR_ATTRIBUTES Colors;
- UINTN Data;
-} INPUT_BAR_COLOR_UNION;
-
-
-/**
- The refresh function for InputBar, it will wait for user input
-
- @param[in] LastRow The last printable row.
- @param[in] LastColumn The last printable column.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-InputBarRefresh (
- UINTN LastRow,
- UINTN LastColumn
- )
-{
- INPUT_BAR_COLOR_UNION Orig;
- INPUT_BAR_COLOR_UNION New;
- EFI_INPUT_KEY Key;
- UINTN Size;
- EFI_STATUS Status;
- BOOLEAN NoDisplay;
- UINTN Limit;
- UINTN mPromptLen;
- UINTN EventIndex;
- UINTN CursorRow;
- UINTN CursorCol;
-
- //
- // variable initialization
- //
- Size = 0;
- Status = EFI_SUCCESS;
-
- //
- // back up the old screen attributes
- //
- CursorCol = gST->ConOut->Mode->CursorColumn;
- CursorRow = gST->ConOut->Mode->CursorRow;
- Orig.Data = gST->ConOut->Mode->Attribute;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
- gST->ConOut->SetAttribute (gST->ConOut, New.Data);
-
- //
- // clear input bar
- //
- EditorClearLine (LastRow , LastColumn, LastRow);
-
- gST->ConOut->SetCursorPosition (gST->ConOut, 0, LastRow - 1);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBINPUTBAR_MAININPUTBAR), gShellDebug1HiiHandle, mPrompt);
-
- //
- // that's the maximum input length that can be displayed on screen
- //
- mPromptLen = StrLen (mPrompt);
- Limit = LastColumn - mPromptLen;
-
- //
- // this is a selection mPrompt, cursor will stay in edit area
- // actually this is for search , search/replace
- //
- if (StrStr (mPrompt, L"Yes/No")) {
- NoDisplay = TRUE;
- gST->ConOut->SetCursorPosition (gST->ConOut, CursorCol, CursorRow);
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
- } else {
- NoDisplay = FALSE;
- }
- //
- // wait for user input
- //
- for (;;) {
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- if (EFI_ERROR (Status)) {
- continue;
- }
- //
- // pressed ESC
- //
- if (Key.ScanCode == SCAN_ESC) {
- Size = 0;
- Status = EFI_NOT_READY;
- break;
- }
- //
- // return pressed
- //
- if (Key.UnicodeChar == CHAR_LINEFEED || Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
- break;
- } else if (Key.UnicodeChar == CHAR_BACKSPACE) {
- //
- // backspace
- //
- if (Size > 0) {
- Size--;
- mReturnString[Size] = CHAR_NULL;
- if (!NoDisplay) {
-
- InputBarPrintInput (LastColumn, LastRow);
-
- }
- }
- } else if (Key.UnicodeChar <= 127 && Key.UnicodeChar >= 32) {
- //
- // VALID ASCII char pressed
- //
- mReturnString[Size] = Key.UnicodeChar;
-
- //
- // should be less than specified length
- //
- if (Size >= StringSize) {
- continue;
- }
-
- Size++;
-
- mReturnString[Size] = CHAR_NULL;
-
- if (!NoDisplay) {
-
- InputBarPrintInput (LastColumn, LastRow);
-
- } else {
- //
- // if just choose yes/no
- //
- break;
- }
-
- }
- }
-
- mReturnString[Size] = CHAR_NULL;
-
-
- //
- // restore screen attributes
- //
- gST->ConOut->SetCursorPosition (gST->ConOut, CursorCol, CursorRow);
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
-
- return Status;
-}
-
-/**
- SetPrompt and wait for input.
-
- @param[in] Str The prompt string.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-InputBarSetPrompt (
- IN CONST CHAR16 *Str
- )
-{
- //
- // FREE the old mPrompt string
- //
- SHELL_FREE_NON_NULL (mPrompt);
-
- mPrompt = CatSPrint (NULL, L"%s ", Str);
- if (mPrompt == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Set the size of the string in characters.
-
- @param[in] Size The max number of characters to accept.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-InputBarSetStringSize (
- UINTN Size
- )
-{
- //
- // free the old ReturnStirng
- //
- SHELL_FREE_NON_NULL (mReturnString);
-
- StringSize = Size;
- mReturnString = AllocateZeroPool ((StringSize + 1) * sizeof(mReturnString[0]));
- if (mReturnString == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Function to retrieve the input from the user.
-
- @retval NULL No input has been received.
- @return The string that was input.
-**/
-CONST CHAR16*
-EFIAPI
-InputBarGetString (
- VOID
- )
-{
- return (mReturnString);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.h
deleted file mode 100644
index c8557a83f1..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/** @file
- Declares imputbar interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_INPUT_BAR_H_
-#define _LIB_INPUT_BAR_H_
-
-/**
- Initialize the input bar.
-**/
-VOID
-EFIAPI
-InputBarInit (
- VOID
- );
-
-/**
- Cleanup function for input bar.
-**/
-VOID
-EFIAPI
-InputBarCleanup (
- VOID
- );
-
-/**
- The refresh function for InputBar, it will wait for user input
-
- @param[in] LastRow The last printable row.
- @param[in] LastColumn The last printable column.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-InputBarRefresh (
- UINTN LastRow,
- UINTN LastColumn
- );
-
-/**
- SetPrompt and wait for input.
-
- @param[in] Str The prompt string.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-InputBarSetPrompt (
- IN CONST CHAR16 *Str
- );
-
-/**
- Set the size of the string in characters.
-
- @param[in] Size The max number of characters to accept.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-InputBarSetStringSize (
- UINTN Size
- );
-
-/**
- Function to retrieve the input from the user.
-
- @retval NULL No input has been received.
- @return The string that was input.
-**/
-CONST CHAR16*
-EFIAPI
-InputBarGetString (
- VOID
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c
deleted file mode 100644
index b721850300..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/** @file
- implements menubar interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "EditMenuBar.h"
-#include "UefiShellDebug1CommandsLib.h"
-#include "EditStatusBar.h"
-
-EDITOR_MENU_ITEM *MenuItems;
-MENU_ITEM_FUNCTION *ControlBasedMenuFunctions;
-UINTN NumItems;
-
-/**
- Cleanup function for a menu bar. frees all allocated memory.
-**/
-VOID
-EFIAPI
-MenuBarCleanup (
- VOID
- )
-{
- SHELL_FREE_NON_NULL(MenuItems);
-}
-
-/**
- Initialize the menu bar with the specified items.
-
- @param[in] Items The items to display and their functions.
-
- @retval EFI_SUCCESS The initialization was correct.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-MenuBarInit (
- IN CONST EDITOR_MENU_ITEM *Items
- )
-{
- CONST EDITOR_MENU_ITEM *ItemsWalker;
-
- for (NumItems = 0, ItemsWalker = Items ; ItemsWalker != NULL && ItemsWalker->Function != NULL ; ItemsWalker++,NumItems++);
-
- MenuItems = AllocateZeroPool((NumItems+1) * sizeof(EDITOR_MENU_ITEM));
- if (MenuItems == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- CopyMem(MenuItems, Items, (NumItems+1) * sizeof(EDITOR_MENU_ITEM));
- return EFI_SUCCESS;
-}
-
-/**
- Initialize the control hot-key with the specified items.
-
- @param[in] Items The hot-key functions.
-
- @retval EFI_SUCCESS The initialization was correct.
-**/
-EFI_STATUS
-EFIAPI
-ControlHotKeyInit (
- IN MENU_ITEM_FUNCTION *Items
- )
-{
- ControlBasedMenuFunctions = Items;
- return EFI_SUCCESS;
-}
-/**
- Refresh function for the menu bar.
-
- @param[in] LastRow The last printable row.
- @param[in] LastCol The last printable column.
-
- @retval EFI_SUCCESS The refresh was successful.
-**/
-EFI_STATUS
-EFIAPI
-MenuBarRefresh (
- IN CONST UINTN LastRow,
- IN CONST UINTN LastCol
- )
-{
- EDITOR_MENU_ITEM *Item;
- UINTN Col;
- UINTN Row;
- UINTN Width;
- CHAR16 *NameString;
- CHAR16 *FunctionKeyString;
-
- //
- // variable initialization
- //
- Col = 1;
- Row = (LastRow - 2);
-
- //
- // clear menu bar rows
- //
- EditorClearLine (LastRow - 2, LastCol, LastRow);
- EditorClearLine (LastRow - 1, LastCol, LastRow);
- EditorClearLine (LastRow , LastCol, LastRow);
-
-
- //
- // print out the menu items
- //
- for (Item = MenuItems; Item != NULL && Item->Function != NULL; Item++) {
-
-
- NameString = HiiGetString(gShellDebug1HiiHandle, Item->NameToken, NULL);
-
-
- Width = MAX ((StrLen (NameString) + 6), 20);
- if (((Col + Width) > LastCol)) {
- Row++;
- Col = 1;
- }
-
- FunctionKeyString = HiiGetString(gShellDebug1HiiHandle, Item->FunctionKeyToken, NULL);
-
- ShellPrintEx ((INT32)(Col) - 1, (INT32)(Row) - 1, L"%E%s%N %H%s%N ", FunctionKeyString, NameString);
-
- FreePool (NameString);
- FreePool (FunctionKeyString);
- Col += Width;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Function to dispatch the correct function based on a function key (F1...)
-
- @param[in] Key The pressed key.
-
- @retval EFI_NOT_FOUND The key was not a valid function key
- (an error was sent to the status bar).
- @return The return value from the called dispatch function.
-**/
-EFI_STATUS
-EFIAPI
-MenuBarDispatchFunctionKey (
- IN CONST EFI_INPUT_KEY *Key
- )
-{
- UINTN Index;
-
- Index = Key->ScanCode - SCAN_F1;
-
- //
- // check whether in range
- //
- if (Index > (NumItems - 1)) {
- StatusBarSetStatusString (L"Unknown Command");
- return EFI_SUCCESS;
- }
-
- return (MenuItems[Index].Function ());
-}
-
-/**
- Function to dispatch the correct function based on a control-based key (ctrl+o...)
-
- @param[in] Key The pressed key.
-
- @retval EFI_NOT_FOUND The key was not a valid control-based key
- (an error was sent to the status bar).
- @return EFI_SUCCESS.
-**/
-EFI_STATUS
-EFIAPI
-MenuBarDispatchControlHotKey (
- IN CONST EFI_INPUT_KEY *Key
- )
-{
-
- if ((SCAN_CONTROL_Z < Key->UnicodeChar)
- ||(NULL == ControlBasedMenuFunctions[Key->UnicodeChar]))
- {
- return EFI_NOT_FOUND;
- }
-
- ControlBasedMenuFunctions[Key->UnicodeChar]();
- return EFI_SUCCESS;
-}
-
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h
deleted file mode 100644
index 8cd846f28b..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/** @file
- Declares menubar interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_MENU_BAR_H_
-#define _LIB_MENU_BAR_H_
-
-#define SCAN_CONTROL_E 5
-#define SCAN_CONTROL_F 6
-#define SCAN_CONTROL_G 7
-#define SCAN_CONTROL_K 11
-#define SCAN_CONTROL_O 15
-#define SCAN_CONTROL_Q 17
-#define SCAN_CONTROL_R 18
-#define SCAN_CONTROL_S 19
-#define SCAN_CONTROL_T 20
-#define SCAN_CONTROL_U 21
-#define SCAN_CONTROL_W 23
-#define SCAN_CONTROL_Z 26
-
-
-typedef
-EFI_STATUS
-(*MENU_ITEM_FUNCTION) (
- VOID
- );
-
-typedef struct _EDITOR_MENU_ITEM {
- EFI_STRING_ID NameToken;
- CHAR16 FunctionKeyToken;
- MENU_ITEM_FUNCTION Function;
-} EDITOR_MENU_ITEM;
-
-/**
- Initializa the menu bar with the specified items.
-
- @param[in] Items The items to display and their functions.
-
- @retval EFI_SUCCESS The initialization was correct.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-MenuBarInit (
- IN CONST EDITOR_MENU_ITEM *Items
- );
-
-/**
- Initialize the control hot-key with the specified items.
-
- @param[in] Items The hot-key functions.
-
- @retval EFI_SUCCESS The initialization was correct.
-**/
-EFI_STATUS
-EFIAPI
-ControlHotKeyInit (
- IN MENU_ITEM_FUNCTION *Items
- );
-
-/**
- Cleanup function for a menu bar. frees all allocated memory.
-**/
-VOID
-EFIAPI
-MenuBarCleanup (
- VOID
- );
-
-/**
- Refresh function for the menu bar.
-
- @param[in] LastRow The last printable row.
- @param[in] LastCol The last printable column.
-
- @retval EFI_SUCCESS The refresh was successful.
-**/
-EFI_STATUS
-EFIAPI
-MenuBarRefresh (
- IN CONST UINTN LastRow,
- IN CONST UINTN LastCol
- );
-
-/**
- Function to dispatch the correct function based on a function key (F1...)
-
- @param[in] Key The pressed key.
-
- @retval EFI_NOT_FOUND The key was not a valid function key
- (an error was sent to the status bar).
- @return The return value from the called dispatch function.
-**/
-EFI_STATUS
-EFIAPI
-MenuBarDispatchFunctionKey (
- IN CONST EFI_INPUT_KEY *Key
- );
-
-/**
- Function to dispatch the correct function based on a control-based key (ctrl+o...)
-
- @param[in] Key The pressed key.
-
- @retval EFI_NOT_FOUND The key was not a valid control-based key
- (an error was sent to the status bar).
- @return EFI_SUCCESS.
-**/
-EFI_STATUS
-EFIAPI
-MenuBarDispatchControlHotKey (
- IN CONST EFI_INPUT_KEY *Key
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c
deleted file mode 100644
index 6722b7ae81..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/** @file
- Implements statusbar interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "EditStatusBar.h"
-#include "UefiShellDebug1CommandsLib.h"
-
-CHAR16 *StatusString;
-BOOLEAN StatusBarNeedRefresh;
-BOOLEAN StatusStringChanged;
-
-/**
- Initialization function for Status Bar.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @sa StatusBarSetStatusString
-**/
-EFI_STATUS
-EFIAPI
-StatusBarInit (
- VOID
- )
-{
- //
- // initialize the statusbar
- //
- StatusString = NULL;
- StatusBarNeedRefresh = TRUE;
- StatusStringChanged = FALSE;
-
- //
- // status string set to ""
- //
- return (StatusBarSetStatusString (L""));
-}
-
-/**
- Cleanup function for the status bar.
-**/
-VOID
-EFIAPI
-StatusBarCleanup (
- VOID
- )
-{
- //
- // free the status string and backvar's status string
- //
- SHELL_FREE_NON_NULL (StatusString);
-}
-
-typedef struct {
- UINT32 Foreground : 4;
- UINT32 Background : 4;
-} STATUS_BAR_COLOR_ATTRIBUTES;
-
-typedef union {
- STATUS_BAR_COLOR_ATTRIBUTES Colors;
- UINTN Data;
-} STATUS_BAR_COLOR_UNION;
-
-/**
- Cause the status bar to refresh it's printing on the screen.
-
- @param[in] EditorFirst TRUE to indicate the first launch of the editor.
- FALSE otherwise.
- @param[in] LastRow LastPrintable row.
- @param[in] LastCol Last printable column.
- @param[in] FileRow Row in the file.
- @param[in] FileCol Column in the file.
- @param[in] InsertMode TRUE to indicate InsertMode. FALSE otherwise.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-StatusBarRefresh (
- IN BOOLEAN EditorFirst,
- IN UINTN LastRow,
- IN UINTN LastCol,
- IN UINTN FileRow,
- IN UINTN FileCol,
- IN BOOLEAN InsertMode
- )
-{
- STATUS_BAR_COLOR_UNION Orig;
- STATUS_BAR_COLOR_UNION New;
-
- if (!StatusStringChanged && StatusBarNeedRefresh) {
- StatusBarSetStatusString (L"\0");
- }
- //
- // when it's called first time after editor launch, so refresh is mandatory
- //
- if (!StatusBarNeedRefresh && !StatusStringChanged) {
- return EFI_SUCCESS;
- }
-
- //
- // back up the screen attributes
- //
- Orig.Data = gST->ConOut->Mode->Attribute;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
- gST->ConOut->EnableCursor (gST->ConOut, FALSE);
- gST->ConOut->SetAttribute (gST->ConOut, New.Data);
-
- //
- // clear status bar
- //
- EditorClearLine (LastRow, LastCol, LastRow);
-
- //
- // print row, column fields
- //
- if (FileRow != (UINTN)(-1) && FileCol != (UINTN)(-1)) {
- ShellPrintEx (
- 0,
- (INT32)(LastRow) - 1,
- L" %d,%d %s",
- FileRow,
- FileCol,
- StatusString
- );
- } else {
- ShellPrintEx (
- 0,
- (INT32)(LastRow) - 1,
- L" %s",
- StatusString
- );
- }
-
- //
- // print insert mode field
- //
- if (InsertMode) {
- ShellPrintEx ((INT32)(LastCol) - 21, (INT32)(LastRow) - 1, L"|%s| Help: Ctrl-E", L"INS");
- } else {
- ShellPrintEx ((INT32)(LastCol) - 21, (INT32)(LastRow) - 1, L"|%s| Help: Ctrl-E", L"OVR");
- }
- //
- // restore the old screen attributes
- //
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
-
- //
- // restore position in edit area
- //
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
-
- StatusBarNeedRefresh = FALSE;
- StatusStringChanged = FALSE;
-
- return EFI_SUCCESS;
-}
-
-/**
- Set the status string text part.
-
- @param[in] Str The string to use.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-StatusBarSetStatusString (
- IN CHAR16 *Str
- )
-{
- StatusStringChanged = TRUE;
-
- //
- // free the old status string
- //
- SHELL_FREE_NON_NULL (StatusString);
- StatusString = CatSPrint (NULL, L"%s", Str);
- if (StatusString == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Function to retrieve the current status string.
-
- @return The string that is used.
-**/
-CONST CHAR16*
-EFIAPI
-StatusBarGetString (
- VOID
- )
-{
- return (StatusString);
-}
-
-/**
- Function to set the need refresh boolean to TRUE.
-**/
-VOID
-EFIAPI
-StatusBarSetRefresh(
- VOID
- )
-{
- StatusBarNeedRefresh = TRUE;
-}
-
-/**
- Function to get the need refresh boolean to TRUE.
-
- @retval TRUE The status bar needs to be refreshed.
-**/
-BOOLEAN
-EFIAPI
-StatusBarGetRefresh(
- VOID
- )
-{
- return (StatusBarNeedRefresh);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h
deleted file mode 100644
index debf83a9ec..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/** @file
- Declares statusbar interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_STATUS_BAR_H_
-#define _LIB_STATUS_BAR_H_
-
-/**
- Initialization function for Status Bar.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @sa StatusBarSetStatusString
-**/
-EFI_STATUS
-EFIAPI
-StatusBarInit (
- VOID
- );
-
-/**
- Cleanup function for the status bar.
-**/
-VOID
-EFIAPI
-StatusBarCleanup (
- VOID
- );
-
-/**
- Cause the status bar to refresh it's printing on the screen.
-
- @param[in] EditorFirst TRUE to indicate the first launch of the editor.
- FALSE otherwise.
- @param[in] LastRow LastPrintable row.
- @param[in] LastCol Last printable column.
- @param[in] FileRow Row in the file.
- @param[in] FileCol Column in the file.
- @param[in] InsertMode TRUE to indicate InsertMode. FALSE otherwise.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-StatusBarRefresh (
- IN BOOLEAN EditorFirst,
- IN UINTN LastRow,
- IN UINTN LastCol,
- IN UINTN FileRow,
- IN UINTN FileCol,
- IN BOOLEAN InsertMode
- );
-
-/**
- Set the status string text part.
-
- @param[in] Str The string to use.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-StatusBarSetStatusString (
- IN CHAR16 *Str
- );
-
-/**
- Function to retrieve the current status string.
-
- @return The string that is used.
-**/
-CONST CHAR16*
-EFIAPI
-StatusBarGetString (
- VOID
- );
-
-/**
- Function to set the need refresh boolean to TRUE.
-**/
-VOID
-EFIAPI
-StatusBarSetRefresh(
- VOID
- );
-
-/**
- Function to get the need refresh boolean to TRUE.
-
- @retval TRUE The status bar needs to be refreshed.
-**/
-BOOLEAN
-EFIAPI
-StatusBarGetRefresh(
- VOID
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c
deleted file mode 100644
index c29ecc00fd..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/** @file
- Implements titlebar interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "EditTitleBar.h"
-#include "UefiShellDebug1CommandsLib.h"
-
-CHAR16 *Title = NULL;
-
-/**
- Initialize a title bar.
-
- @param[in] Prompt The prompt to print in the title bar.
-
- @retval EFI_SUCCESS The initialization was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-MainTitleBarInit (
- CONST CHAR16 *Prompt
- )
-{
- SHELL_FREE_NON_NULL (Title);
- if (Prompt == NULL) {
- Title = CatSPrint (NULL, L"");
- } else {
- //
- // set Title
- //
- Title = CatSPrint (NULL, L"%s", Prompt);
- }
- if (Title == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Clean up the memory used.
-**/
-VOID
-EFIAPI
-MainTitleBarCleanup (
- VOID
- )
-{
- SHELL_FREE_NON_NULL (Title);
- Title = NULL;
-}
-
-typedef struct {
- UINT32 Foreground : 4;
- UINT32 Background : 4;
-} TITLE_BAR_COLOR_ATTRIBUTES;
-
-typedef union {
- TITLE_BAR_COLOR_ATTRIBUTES Colors;
- UINTN Data;
-} TITLE_BAR_COLOR_UNION;
-
-/**
- Refresh function for MainTitleBar
-
- @param[in] FileName The open file's name (or NULL).
- @param[in] FileType The type fo the file.
- @param[in] ReadOnly TRUE if the file is read only. FALSE otherwise.
- @param[in] Modified TRUE if the file was modified. FALSE otherwise.
- @param[in] LastCol The last printable column.
- @param[in] LastRow The last printable row.
- @param[in] Offset The offset into the file. (only for mem/disk)
- @param[in] Size The file's size. (only for mem/disk)
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-MainTitleBarRefresh (
- IN CONST CHAR16 *FileName OPTIONAL,
- IN CONST EDIT_FILE_TYPE FileType,
- IN CONST BOOLEAN ReadOnly,
- IN CONST BOOLEAN Modified,
- IN CONST UINTN LastCol,
- IN CONST UINTN LastRow,
- IN CONST UINTN Offset,
- IN CONST UINTN Size
- )
-{
- TITLE_BAR_COLOR_UNION Orig;
- TITLE_BAR_COLOR_UNION New;
- CONST CHAR16 *FileNameTmp;
- INTN TempInteger;
-
-
- //
- // backup the old screen attributes
- //
- Orig.Data = gST->ConOut->Mode->Attribute;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
- gST->ConOut->SetAttribute (gST->ConOut, New.Data);
-
- //
- // clear the title line
- //
- EditorClearLine (1, LastCol, LastRow);
-
- if (Title != NULL) {
- //
- // print the new title bar prefix
- //
- ShellPrintEx (
- 0,
- 0,
- L"%s ",
- Title
- );
- }
- if (FileName == NULL) {
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
- return EFI_SUCCESS;
- }
- //
- // First Extract the FileName from fullpath
- //
- FileNameTmp = FileName;
- for (TempInteger = StrLen (FileNameTmp) - 1; TempInteger >= 0; TempInteger--) {
- if (FileNameTmp[TempInteger] == L'\\') {
- break;
- }
- }
-
- FileNameTmp = FileNameTmp + TempInteger + 1;
-
- //
- // the space for file name is 20 characters
- //
- if (StrLen (FileNameTmp) <= 20) {
- ShellPrintEx (-1,-1, L"%s ", FileNameTmp);
- for (TempInteger = StrLen (FileNameTmp); TempInteger < 20; TempInteger++) {
- ShellPrintEx (-1,-1, L" ");
- }
-
- } else {
- for (TempInteger = 0; TempInteger < 17; TempInteger++) {
- ShellPrintEx (-1,-1, L"%c", FileNameTmp[TempInteger]);
- }
- //
- // print "..."
- //
- ShellPrintEx (-1,-1, L"... ");
- }
- //
- // print file type field
- //
- switch (FileType){
- case FileTypeAscii:
- case FileTypeUnicode:
- if (FileType == FileTypeAscii){
- ShellPrintEx (-1,-1, L" UNICODE ");
- }
- //
- // print read-only field for text files
- //
- if (ReadOnly) {
- ShellPrintEx (-1,-1, L"ReadOnly ");
- } else {
- ShellPrintEx (-1,-1, L" ");
- }
- break;
- case FileTypeDiskBuffer:
- case FileTypeMemBuffer:
- //
- // Print the offset.
- //
- ShellPrintEx (-1,-1, L"Offset %X | Size %X", Offset, Size);
- case FileTypeFileBuffer:
- break;
- default:
- break;
- }
- //
- // print modified field
- //
- if (Modified) {
- ShellPrintEx (-1,-1, L"Modified");
- }
- //
- // restore the old attribute
- //
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
-
- return EFI_SUCCESS;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.h
deleted file mode 100644
index d8f420fb80..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/** @file
- Declares titlebar interface functions.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_TITLE_BAR_H_
-#define _LIB_TITLE_BAR_H_
-
-/**
- Initialize a title bar.
-
- @param[in] Prompt The prompt to print in the title bar.
-
- @retval EFI_SUCCESS The initialization was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-MainTitleBarInit (
- CONST CHAR16 *Prompt
- );
-
-/**
- Clean up the memory used.
-**/
-VOID
-EFIAPI
-MainTitleBarCleanup (
- VOID
- );
-
-typedef enum {
- FileTypeNone,
- FileTypeAscii,
- FileTypeUnicode,
- FileTypeDiskBuffer,
- FileTypeMemBuffer,
- FileTypeFileBuffer
-} EDIT_FILE_TYPE;
-
-/**
- Refresh function for MainTitleBar
-
- @param[in] FileName The open file's name (or NULL).
- @param[in] FileType The type fo the file.
- @param[in] ReadOnly TRUE if the file is read only. FALSE otherwise.
- @param[in] Modified TRUE if the file was modified. FALSE otherwise.
- @param[in] LastCol The last printable column.
- @param[in] LastRow The last printable row.
- @param[in] Offset The offset into the file. (only for mem/disk)
- @param[in] Size The file's size. (only for mem/disk)
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-MainTitleBarRefresh (
- IN CONST CHAR16 *FileName OPTIONAL,
- IN CONST EDIT_FILE_TYPE FileType,
- IN CONST BOOLEAN ReadOnly,
- IN CONST BOOLEAN Modified,
- IN CONST UINTN LastCol,
- IN CONST UINTN LastRow,
- IN CONST UINTN Offset,
- IN CONST UINTN Size
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c
deleted file mode 100644
index 25e8718980..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/** @file
- Main file for EfiCompress shell Debug1 function.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include "Compress.h"
-
-/**
- Function for 'compress' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEfiCompress (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- SHELL_FILE_HANDLE InShellFileHandle;
- SHELL_FILE_HANDLE OutShellFileHandle;
- UINT64 OutSize;
- UINTN OutSize2;
- VOID *OutBuffer;
- UINT64 InSize;
- UINTN InSize2;
- VOID *InBuffer;
- CHAR16 *InFileName;
- CONST CHAR16 *OutFileName;
- CONST CHAR16 *TempParam;
-
- InFileName = NULL;
- OutFileName = NULL;
- OutSize = 0;
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- OutBuffer = NULL;
- InShellFileHandle = NULL;
- OutShellFileHandle = NULL;
- InBuffer = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- TempParam = ShellCommandLineGetRawValue(Package, 1);
- ASSERT(TempParam != NULL);
- InFileName = ShellFindFilePath(TempParam);
- OutFileName = ShellCommandLineGetRawValue(Package, 2);
- if (InFileName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, TempParam);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- if (ShellIsDirectory(InFileName) == EFI_SUCCESS){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, InFileName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, OutFileName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- if (ShellStatus == SHELL_SUCCESS) {
- Status = ShellOpenFileByName(InFileName, &InShellFileHandle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1), Status);
- ShellStatus = SHELL_NOT_FOUND;
- }
- Status = ShellOpenFileByName(OutFileName, &OutShellFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 2), Status);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- if (ShellStatus == SHELL_SUCCESS) {
- Status = gEfiShellProtocol->GetFileSize(InShellFileHandle, &InSize);
- ASSERT_EFI_ERROR(Status);
- InBuffer = AllocateZeroPool((UINTN)InSize);
- ASSERT(InBuffer != NULL);
- InSize2 = (UINTN)InSize;
- Status = gEfiShellProtocol->ReadFile(InShellFileHandle, &InSize2, InBuffer);
- InSize = InSize2;
- ASSERT_EFI_ERROR(Status);
- Status = Compress(InBuffer, InSize, OutBuffer, &OutSize);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- OutBuffer = AllocateZeroPool((UINTN)OutSize);
- ASSERT(OutBuffer != NULL);
- Status = Compress(InBuffer, InSize, OutBuffer, &OutSize);
- }
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_EFI_COMPRESS_FAIL), gShellDebug1HiiHandle, Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- } else {
- OutSize2 = (UINTN)OutSize;
- Status = gEfiShellProtocol->WriteFile(OutShellFileHandle, &OutSize2, OutBuffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, OutFileName, Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- }
- }
- }
- }
-
- ShellCommandLineFreeVarList (Package);
- }
- if (InShellFileHandle != NULL) {
- gEfiShellProtocol->CloseFile(InShellFileHandle);
- }
- if (OutShellFileHandle != NULL) {
- gEfiShellProtocol->CloseFile(OutShellFileHandle);
- }
- SHELL_FREE_NON_NULL(InFileName);
- SHELL_FREE_NON_NULL(InBuffer);
- SHELL_FREE_NON_NULL(OutBuffer);
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c
deleted file mode 100644
index 35a32f1f3b..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/** @file
- Main file for EfiDecompress shell Debug1 function.
-
- Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include <Protocol/Decompress.h>
-
-
-/**
- Function for 'decompress' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEfiDecompress (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- SHELL_FILE_HANDLE InFileHandle;
- SHELL_FILE_HANDLE OutFileHandle;
- UINT32 OutSize;
- UINTN OutSizeTemp;
- VOID *OutBuffer;
- UINTN InSize;
- VOID *InBuffer;
- CHAR16 *InFileName;
- CONST CHAR16 *OutFileName;
- UINT64 Temp64Bit;
- UINT32 ScratchSize;
- VOID *ScratchBuffer;
- EFI_DECOMPRESS_PROTOCOL *Decompress;
- CONST CHAR16 *TempParam;
-
- InFileName = NULL;
- OutFileName = NULL;
- OutSize = 0;
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- OutBuffer = NULL;
- InBuffer = NULL;
- ScratchBuffer = NULL;
- InFileHandle = NULL;
- OutFileHandle = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- TempParam = ShellCommandLineGetRawValue(Package, 1);
- ASSERT(TempParam != NULL);
- InFileName = ShellFindFilePath(TempParam);
- OutFileName = ShellCommandLineGetRawValue(Package, 2);
- if (InFileName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, TempParam);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- if (ShellIsDirectory(InFileName) == EFI_SUCCESS){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, InFileName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, OutFileName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- if (ShellStatus == SHELL_SUCCESS) {
- Status = ShellOpenFileByName(InFileName, &InFileHandle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1), Status);
- ShellStatus = SHELL_NOT_FOUND;
- }
- Status = ShellOpenFileByName(OutFileName, &OutFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 2), Status);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- Status = FileHandleGetSize(InFileHandle, &Temp64Bit);
- ASSERT(Temp64Bit <= (UINT32)(-1));
- InSize = (UINTN)Temp64Bit;
- ASSERT_EFI_ERROR(Status);
- InBuffer = AllocateZeroPool(InSize);
- ASSERT(InBuffer != NULL);
- Status = gEfiShellProtocol->ReadFile(InFileHandle, &InSize, InBuffer);
- ASSERT_EFI_ERROR(Status);
-
- Status = gBS->LocateProtocol(&gEfiDecompressProtocolGuid, NULL, (VOID**)&Decompress);
- ASSERT_EFI_ERROR(Status);
-
- Status = Decompress->GetInfo(Decompress, InBuffer, (UINT32)InSize, &OutSize, &ScratchSize);
- ASSERT_EFI_ERROR(Status);
-
- OutBuffer = AllocateZeroPool(OutSize);
- ScratchBuffer = AllocateZeroPool(ScratchSize);
- ASSERT(OutBuffer != NULL);
- ASSERT(ScratchBuffer != NULL);
-
- Status = Decompress->Decompress(Decompress, InBuffer, (UINT32)InSize, OutBuffer, OutSize, ScratchBuffer, ScratchSize);
- ASSERT_EFI_ERROR(Status);
-
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_EFI_DECOMPRESS_FAIL), gShellDebug1HiiHandle, Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- } else {
- OutSizeTemp = OutSize;
- Status = gEfiShellProtocol->WriteFile(OutFileHandle, &OutSizeTemp, OutBuffer);
- OutSize = (UINT32)OutSizeTemp;
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, OutFileName, Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- }
- }
- }
- }
-
- ShellCommandLineFreeVarList (Package);
- }
- if (InFileHandle != NULL) {
- gEfiShellProtocol->CloseFile(InFileHandle);
- }
- if (OutFileHandle != NULL) {
- gEfiShellProtocol->CloseFile(OutFileHandle);
- }
-
- SHELL_FREE_NON_NULL(InFileName);
- SHELL_FREE_NON_NULL(InBuffer);
- SHELL_FREE_NON_NULL(OutBuffer);
- SHELL_FREE_NON_NULL(ScratchBuffer);
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c
deleted file mode 100644
index 46926320a6..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c
+++ /dev/null
@@ -1,2507 +0,0 @@
-/** @file
- Defines HBufferImage - the view of the file that is visible at any point,
- as well as the event handlers for editing the file
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "HexEditor.h"
-
-extern EFI_HANDLE HImageHandleBackup;
-
-extern HEFI_EDITOR_FILE_IMAGE HFileImage;
-extern HEFI_EDITOR_DISK_IMAGE HDiskImage;
-extern HEFI_EDITOR_MEM_IMAGE HMemImage;
-
-extern HEFI_EDITOR_FILE_IMAGE HFileImageBackupVar;
-extern HEFI_EDITOR_DISK_IMAGE HDiskImageBackupVar;
-extern HEFI_EDITOR_MEM_IMAGE HMemImageBackupVar;
-
-extern BOOLEAN HEditorMouseAction;
-
-extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
-extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditorBackupVar;
-
-HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
-HEFI_EDITOR_BUFFER_IMAGE HBufferImageBackupVar;
-
-//
-// for basic initialization of HBufferImage
-//
-HEFI_EDITOR_BUFFER_IMAGE HBufferImageConst = {
- NULL,
- NULL,
- 0,
- NULL,
- {
- 0,
- 0
- },
- {
- 0,
- 0
- },
- {
- 0,
- 0
- },
- 0,
- TRUE,
- FALSE,
- FileTypeNone,
- NULL,
- NULL,
- NULL
-};
-
-//
-// the whole edit area needs to be refreshed
-//
-BOOLEAN HBufferImageNeedRefresh;
-
-//
-// only the current line in edit area needs to be refresh
-//
-BOOLEAN HBufferImageOnlyLineNeedRefresh;
-
-BOOLEAN HBufferImageMouseNeedRefresh;
-
-/**
- Initialization function for HBufferImage
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HBufferImageInit (
- VOID
- )
-{
- EFI_STATUS Status;
-
- //
- // basically initialize the HBufferImage
- //
- CopyMem (&HBufferImage, &HBufferImageConst, sizeof (HBufferImage));
-
- //
- // INIT listhead
- //
- HBufferImage.ListHead = AllocateZeroPool (sizeof (LIST_ENTRY));
- if (HBufferImage.ListHead == NULL) {
- return EFI_LOAD_ERROR;
- }
-
- InitializeListHead (HBufferImage.ListHead);
-
- HBufferImage.DisplayPosition.Row = 2;
- HBufferImage.DisplayPosition.Column = 10;
- HBufferImage.MousePosition.Row = 2;
- HBufferImage.MousePosition.Column = 10;
-
- HBufferImage.FileImage = &HFileImage;
- HBufferImage.DiskImage = &HDiskImage;
- HBufferImage.MemImage = &HMemImage;
-
- HBufferImageNeedRefresh = FALSE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- HBufferImageMouseNeedRefresh = FALSE;
-
- HBufferImageBackupVar.FileImage = &HFileImageBackupVar;
- HBufferImageBackupVar.DiskImage = &HDiskImageBackupVar;
- HBufferImageBackupVar.MemImage = &HMemImageBackupVar;
-
- Status = HFileImageInit ();
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
-
- Status = HDiskImageInit ();
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
-
- Status = HMemImageInit ();
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Backup function for HBufferImage. Only a few fields need to be backup.
- This is for making the file buffer refresh as few as possible.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageBackup (
- VOID
- )
-{
- HBufferImageBackupVar.MousePosition = HBufferImage.MousePosition;
-
- HBufferImageBackupVar.BufferPosition = HBufferImage.BufferPosition;
-
- HBufferImageBackupVar.Modified = HBufferImage.Modified;
-
- HBufferImageBackupVar.BufferType = HBufferImage.BufferType;
- HBufferImageBackupVar.LowVisibleRow = HBufferImage.LowVisibleRow;
- HBufferImageBackupVar.HighBits = HBufferImage.HighBits;
-
- //
- // three kinds of buffer supported
- // file buffer
- // disk buffer
- // memory buffer
- //
- switch (HBufferImage.BufferType) {
- case FileTypeFileBuffer:
- HFileImageBackup ();
- break;
-
- case FileTypeDiskBuffer:
- HDiskImageBackup ();
- break;
-
- case FileTypeMemBuffer:
- HMemImageBackup ();
- break;
-
- default:
- break;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Free all the lines in HBufferImage.
- Fields affected:
- Lines
- CurrentLine
- NumLines
- ListHead
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageFreeLines (
- VOID
- )
-{
- HFreeLines (HBufferImage.ListHead, HBufferImage.Lines);
-
- HBufferImage.Lines = NULL;
- HBufferImage.CurrentLine = NULL;
- HBufferImage.NumLines = 0;
-
- return EFI_SUCCESS;
-}
-
-/**
- Cleanup function for HBufferImage
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageCleanup (
- VOID
- )
-{
- EFI_STATUS Status;
-
- //
- // free all the lines
- //
- Status = HBufferImageFreeLines ();
-
- SHELL_FREE_NON_NULL (HBufferImage.ListHead);
- HBufferImage.ListHead = NULL;
-
- HFileImageCleanup ();
- HDiskImageCleanup ();
-
- return Status;
-
-}
-
-/**
- Print Line on Row
-
- @param[in] Line The lline to print.
- @param[in] Row The row on screen ( begin from 1 ).
- @param[in] FRow The FRow.
- @param[in] Orig The original color.
- @param[in] New The color to print with.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImagePrintLine (
- IN HEFI_EDITOR_LINE *Line,
- IN UINTN Row,
- IN UINTN FRow,
- IN HEFI_EDITOR_COLOR_UNION Orig,
- IN HEFI_EDITOR_COLOR_UNION New
-
- )
-{
-
- UINTN Index;
- UINTN Pos;
- BOOLEAN Selected;
- BOOLEAN BeNewColor;
- UINTN RowStart;
- UINTN RowEnd;
- UINTN ColStart;
- UINTN ColEnd;
-
- //
- // variable initialization
- //
- ColStart = 0;
- ColEnd = 0;
- Selected = FALSE;
-
- //
- // print the selected area in opposite color
- //
- if (HMainEditor.SelectStart != 0 && HMainEditor.SelectEnd != 0) {
- RowStart = (HMainEditor.SelectStart - 1) / 0x10 + 1;
- RowEnd = (HMainEditor.SelectEnd - 1) / 0x10 + 1;
-
- ColStart = (HMainEditor.SelectStart - 1) % 0x10 + 1;
- ColEnd = (HMainEditor.SelectEnd - 1) % 0x10 + 1;
-
- if (FRow >= RowStart && FRow <= RowEnd) {
- Selected = TRUE;
- }
-
- if (FRow > RowStart) {
- ColStart = 1;
- }
-
- if (FRow < RowEnd) {
- ColEnd = 0x10;
- }
-
- }
-
- if (!HEditorMouseAction) {
- ShellPrintEx (
- 0,
- (INT32)Row - 1,
- L"%8X ",
- ((INT32)Row - 2 + HBufferImage.LowVisibleRow - 1) * 0x10
- );
-
- }
-
- for (Index = 0; Index < 0x08 && Index < Line->Size; Index++) {
-
- BeNewColor = FALSE;
-
- if (Selected) {
- if (Index + 1 >= ColStart && Index + 1 <= ColEnd) {
- BeNewColor = TRUE;
- }
- }
-
- if (BeNewColor) {
- gST->ConOut->SetAttribute (gST->ConOut, New.Data);
- } else {
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
- }
-
- Pos = 10 + (Index * 3);
- if (Line->Buffer[Index] < 0x10) {
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"0");
- Pos++;
- }
-
- if (Index < 0x07) {
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"%x ", Line->Buffer[Index]);
- } else {
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"%x ", Line->Buffer[Index]);
- }
-
- }
-
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
- while (Index < 0x08) {
- Pos = 10 + (Index * 3);
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L" ");
- Index++;
- }
-
- while (Index < 0x10 && Index < Line->Size) {
-
- BeNewColor = FALSE;
-
- if (Selected) {
- if (Index + 1 >= ColStart && Index + 1 <= ColEnd) {
- BeNewColor = TRUE;
- }
- }
-
- if (BeNewColor) {
- gST->ConOut->SetAttribute (gST->ConOut, New.Data);
- } else {
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
- }
-
- Pos = 10 + (Index * 3) + 1;
- if (Line->Buffer[Index] < 0x10) {
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"0");
- Pos++;
- }
-
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"%x ", Line->Buffer[Index]);
- Index++;
- }
-
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
- while (Index < 0x10) {
- Pos = 10 + (Index * 3) + 1;
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L" ");
- Index++;
- }
- //
- // restore the original color
- //
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
-
- //
- // PRINT the buffer content
- //
- if (!HEditorMouseAction) {
- for (Index = 0; Index < 0x10 && Index < Line->Size; Index++) {
- Pos = ASCII_POSITION + Index;
-
- //
- // learned from shelle.h -- IsValidChar
- //
- if (Line->Buffer[Index] >= L' ') {
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"%c", (CHAR16) Line->Buffer[Index]);
- } else {
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"%c", '.');
- }
- }
-
- while (Index < 0x10) {
- Pos = ASCII_POSITION + Index;
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L" ");
- Index++;
- }
- }
- //
- // restore the abundant blank in hex edit area to original color
- //
- if (Selected) {
- if (ColEnd <= 7) {
- Pos = 10 + (ColEnd - 1) * 3 + 2;
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L" ");
- } else if (ColEnd == 8) {
- Pos = 10 + (ColEnd - 1) * 3 + 2;
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L" ");
- } else {
- Pos = 10 + (ColEnd - 1) * 3 + 3;
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L" ");
- }
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Function to decide if a column number is stored in the high bits.
-
- @param[in] Column The column to examine.
- @param[out] FCol The actual column number.
-
- @retval TRUE The actual column was in high bits and is now in FCol.
- @retval FALSE There was not a column number in the high bits.
-**/
-BOOLEAN
-HBufferImageIsAtHighBits (
- IN UINTN Column,
- OUT UINTN *FCol
- )
-{
- Column -= 10;
-
- //
- // NOW AFTER THE SUB, Column start from 0
- // 23 AND 24 ARE BOTH BLANK
- //
- if (Column == 24) {
- *FCol = 0;
- return FALSE;
- }
-
- if (Column > 24) {
- Column--;
- }
-
- *FCol = (Column / 3) + 1;
-
- if (Column % 3 == 0) {
- return TRUE;
- }
-
- if ((Column % 3 == 2)) {
- *FCol = 0;
- }
-
- return FALSE;
-}
-
-/**
- Decide if a point is in the already selected area.
-
- @param[in] MouseRow The row of the point to test.
- @param[in] MouseCol The col of the point to test.
-
- @retval TRUE The point is in the selected area.
- @retval FALSE The point is not in the selected area.
-**/
-BOOLEAN
-HBufferImageIsInSelectedArea (
- IN UINTN MouseRow,
- IN UINTN MouseCol
- )
-{
- UINTN FRow;
- UINTN RowStart;
- UINTN RowEnd;
- UINTN ColStart;
- UINTN ColEnd;
- UINTN MouseColStart;
- UINTN MouseColEnd;
-
- //
- // judge mouse position whether is in selected area
- //
- //
- // not select
- //
- if (HMainEditor.SelectStart == 0 || HMainEditor.SelectEnd == 0) {
- return FALSE;
- }
- //
- // calculate the select area
- //
- RowStart = (HMainEditor.SelectStart - 1) / 0x10 + 1;
- RowEnd = (HMainEditor.SelectEnd - 1) / 0x10 + 1;
-
- ColStart = (HMainEditor.SelectStart - 1) % 0x10 + 1;
- ColEnd = (HMainEditor.SelectEnd - 1) % 0x10 + 1;
-
- FRow = HBufferImage.LowVisibleRow + MouseRow - 2;
- if (FRow < RowStart || FRow > RowEnd) {
- return FALSE;
- }
-
- if (FRow > RowStart) {
- ColStart = 1;
- }
-
- if (FRow < RowEnd) {
- ColEnd = 0x10;
- }
-
- MouseColStart = 10 + (ColStart - 1) * 3;
- if (ColStart > 8) {
- MouseColStart++;
- }
-
- MouseColEnd = 10 + (ColEnd - 1) * 3 + 1;
- if (ColEnd > 8) {
- MouseColEnd++;
- }
-
- if (MouseCol < MouseColStart || MouseCol > MouseColEnd) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Set mouse position according to HBufferImage.MousePosition.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageRestoreMousePosition (
- VOID
- )
-{
- HEFI_EDITOR_COLOR_UNION Orig;
- HEFI_EDITOR_COLOR_UNION New;
- UINTN FRow;
- UINTN FColumn;
- BOOLEAN HasCharacter;
- HEFI_EDITOR_LINE *CurrentLine;
- HEFI_EDITOR_LINE *Line;
- UINT8 Value;
- BOOLEAN HighBits;
-
- Line = NULL;
- if (HMainEditor.MouseSupported) {
-
- if (HBufferImageMouseNeedRefresh) {
-
- HBufferImageMouseNeedRefresh = FALSE;
-
- //
- // if mouse position not moved and only mouse action
- // so do not need to refresh mouse position
- //
- if ((
- HBufferImage.MousePosition.Row == HBufferImageBackupVar.MousePosition.Row &&
- HBufferImage.MousePosition.Column == HBufferImageBackupVar.MousePosition.Column
- ) &&
- HEditorMouseAction
- ) {
- return EFI_SUCCESS;
- }
- //
- // backup the old screen attributes
- //
- Orig = HMainEditor.ColorAttributes;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
- //
- // if in selected area,
- // so do not need to refresh mouse
- //
- if (!HBufferImageIsInSelectedArea (
- HBufferImageBackupVar.MousePosition.Row,
- HBufferImageBackupVar.MousePosition.Column
- )) {
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
- } else {
- gST->ConOut->SetAttribute (gST->ConOut, New.Data);
- }
- //
- // clear the old mouse position
- //
- FRow = HBufferImage.LowVisibleRow + HBufferImageBackupVar.MousePosition.Row - 2;
-
- HighBits = HBufferImageIsAtHighBits (
- HBufferImageBackupVar.MousePosition.Column,
- &FColumn
- );
-
- HasCharacter = TRUE;
- if (FRow > HBufferImage.NumLines || FColumn == 0) {
- HasCharacter = FALSE;
- } else {
- CurrentLine = HBufferImage.CurrentLine;
- Line = HMoveLine (FRow - HBufferImage.BufferPosition.Row);
-
- if (Line == NULL || FColumn > Line->Size) {
- HasCharacter = FALSE;
- }
-
- HBufferImage.CurrentLine = CurrentLine;
- }
-
- ShellPrintEx (
- (INT32)HBufferImageBackupVar.MousePosition.Column - 1,
- (INT32)HBufferImageBackupVar.MousePosition.Row - 1,
- L" "
- );
-
- if (HasCharacter) {
- if (HighBits) {
- Value = (UINT8) (Line->Buffer[FColumn - 1] & 0xf0);
- Value = (UINT8) (Value >> 4);
- } else {
- Value = (UINT8) (Line->Buffer[FColumn - 1] & 0xf);
- }
-
- ShellPrintEx (
- (INT32)HBufferImageBackupVar.MousePosition.Column - 1,
- (INT32)HBufferImageBackupVar.MousePosition.Row - 1,
- L"%x",
- Value
- );
- }
-
- if (!HBufferImageIsInSelectedArea (
- HBufferImage.MousePosition.Row,
- HBufferImage.MousePosition.Column
- )) {
- gST->ConOut->SetAttribute (gST->ConOut, New.Data);
- } else {
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
- }
- //
- // clear the old mouse position
- //
- FRow = HBufferImage.LowVisibleRow + HBufferImage.MousePosition.Row - 2;
-
- HighBits = HBufferImageIsAtHighBits (
- HBufferImage.MousePosition.Column,
- &FColumn
- );
-
- HasCharacter = TRUE;
- if (FRow > HBufferImage.NumLines || FColumn == 0) {
- HasCharacter = FALSE;
- } else {
- CurrentLine = HBufferImage.CurrentLine;
- Line = HMoveLine (FRow - HBufferImage.BufferPosition.Row);
-
- if (Line == NULL || FColumn > Line->Size) {
- HasCharacter = FALSE;
- }
-
- HBufferImage.CurrentLine = CurrentLine;
- }
-
- ShellPrintEx (
- (INT32)HBufferImage.MousePosition.Column - 1,
- (INT32)HBufferImage.MousePosition.Row - 1,
- L" "
- );
-
- if (HasCharacter) {
- if (HighBits) {
- Value = (UINT8) (Line->Buffer[FColumn - 1] & 0xf0);
- Value = (UINT8) (Value >> 4);
- } else {
- Value = (UINT8) (Line->Buffer[FColumn - 1] & 0xf);
- }
-
- ShellPrintEx (
- (INT32)HBufferImage.MousePosition.Column - 1,
- (INT32)HBufferImage.MousePosition.Row - 1,
- L"%x",
- Value
- );
- }
- //
- // end of HasCharacter
- //
- gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
- }
- //
- // end of MouseNeedRefresh
- //
- }
- //
- // end of MouseSupported
- //
- return EFI_SUCCESS;
-}
-
-/**
- Set cursor position according to HBufferImage.DisplayPosition.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageRestorePosition (
- VOID
- )
-{
- //
- // set cursor position
- //
- gST->ConOut->SetCursorPosition (
- gST->ConOut,
- HBufferImage.DisplayPosition.Column - 1,
- HBufferImage.DisplayPosition.Row - 1
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Refresh function for HBufferImage.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A Load error occured.
-
-**/
-EFI_STATUS
-HBufferImageRefresh (
- VOID
- )
-{
- LIST_ENTRY *Link;
- HEFI_EDITOR_LINE *Line;
- UINTN Row;
- HEFI_EDITOR_COLOR_UNION Orig;
- HEFI_EDITOR_COLOR_UNION New;
-
- UINTN StartRow;
- UINTN EndRow;
- UINTN FStartRow;
- UINTN FEndRow;
- UINTN Tmp;
-
- Orig = HMainEditor.ColorAttributes;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
- //
- // if it's the first time after editor launch, so should refresh
- //
- if (HEditorFirst == FALSE) {
- //
- // no definite required refresh
- // and file position displayed on screen has not been changed
- //
- if (!HBufferImageNeedRefresh &&
- !HBufferImageOnlyLineNeedRefresh &&
- HBufferImageBackupVar.LowVisibleRow == HBufferImage.LowVisibleRow
- ) {
- HBufferImageRestoreMousePosition ();
- HBufferImageRestorePosition ();
- return EFI_SUCCESS;
- }
- }
-
- gST->ConOut->EnableCursor (gST->ConOut, FALSE);
-
- //
- // only need to refresh current line
- //
- if (HBufferImageOnlyLineNeedRefresh && HBufferImageBackupVar.LowVisibleRow == HBufferImage.LowVisibleRow) {
-
- HBufferImagePrintLine (
- HBufferImage.CurrentLine,
- HBufferImage.DisplayPosition.Row,
- HBufferImage.BufferPosition.Row,
- Orig,
- New
- );
- } else {
- //
- // the whole edit area need refresh
- //
- if (HEditorMouseAction && HMainEditor.SelectStart != 0 && HMainEditor.SelectEnd != 0) {
- if (HMainEditor.SelectStart != HMainEditorBackupVar.SelectStart) {
- if (HMainEditor.SelectStart >= HMainEditorBackupVar.SelectStart && HMainEditorBackupVar.SelectStart != 0) {
- StartRow = (HMainEditorBackupVar.SelectStart - 1) / 0x10 + 1;
- } else {
- StartRow = (HMainEditor.SelectStart - 1) / 0x10 + 1;
- }
- } else {
- StartRow = (HMainEditor.SelectStart - 1) / 0x10 + 1;
- }
-
- if (HMainEditor.SelectEnd <= HMainEditorBackupVar.SelectEnd) {
- EndRow = (HMainEditorBackupVar.SelectEnd - 1) / 0x10 + 1;
- } else {
- EndRow = (HMainEditor.SelectEnd - 1) / 0x10 + 1;
- }
- //
- // swap
- //
- if (StartRow > EndRow) {
- Tmp = StartRow;
- StartRow = EndRow;
- EndRow = Tmp;
- }
-
- FStartRow = StartRow;
- FEndRow = EndRow;
-
- StartRow = 2 + StartRow - HBufferImage.LowVisibleRow;
- EndRow = 2 + EndRow - HBufferImage.LowVisibleRow;
-
- } else {
- //
- // not mouse selection actions
- //
- FStartRow = HBufferImage.LowVisibleRow;
- StartRow = 2;
- EndRow = (HMainEditor.ScreenSize.Row - 1);
- }
- //
- // no line
- //
- if (HBufferImage.Lines == NULL) {
- HBufferImageRestoreMousePosition ();
- HBufferImageRestorePosition ();
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
- return EFI_SUCCESS;
- }
- //
- // get the first line that will be displayed
- //
- Line = HMoveLine (FStartRow - HBufferImage.BufferPosition.Row);
- if (Line == NULL) {
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
- return EFI_LOAD_ERROR;
- }
-
- Link = &(Line->Link);
- Row = StartRow;
- do {
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
-
- //
- // print line at row
- //
- HBufferImagePrintLine (
- Line,
- Row,
- HBufferImage.LowVisibleRow + Row - 2,
- Orig,
- New
- );
-
- Link = Link->ForwardLink;
- Row++;
- } while (Link != HBufferImage.ListHead && Row <= EndRow);
-
- while (Row <= EndRow) {
- EditorClearLine (Row, HMainEditor.ScreenSize.Column, HMainEditor.ScreenSize.Row);
- Row++;
- }
- //
- // while not file end and not screen full
- //
- }
-
- HBufferImageRestoreMousePosition ();
- HBufferImageRestorePosition ();
-
- HBufferImageNeedRefresh = FALSE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
-
- return EFI_SUCCESS;
-}
-
-/**
- Read an image into a buffer friom a source.
-
- @param[in] FileName Pointer to the file name. OPTIONAL and ignored if not FileTypeFileBuffer.
- @param[in] DiskName Pointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] DiskOffset Offset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] DiskSize Size of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] MemOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
- @param[in] MemSize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
- @param[in] BufferType The type of buffer to save. IGNORED.
- @param[in] Recover TRUE for recovermode, FALSE otherwise.
-
- @return EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageRead (
- IN CONST CHAR16 *FileName,
- IN CONST CHAR16 *DiskName,
- IN UINTN DiskOffset,
- IN UINTN DiskSize,
- IN UINTN MemOffset,
- IN UINTN MemSize,
- IN EDIT_FILE_TYPE BufferType,
- IN BOOLEAN Recover
- )
-{
- EFI_STATUS Status;
- EDIT_FILE_TYPE BufferTypeBackup;
-
- //
- // variable initialization
- //
- Status = EFI_SUCCESS;
- HBufferImage.BufferType = BufferType;
-
- //
- // three types of buffer supported
- // file buffer
- // disk buffer
- // memory buffer
- //
- BufferTypeBackup = HBufferImage.BufferType;
-
- switch (BufferType) {
- case FileTypeFileBuffer:
- Status = HFileImageRead (FileName, Recover);
- break;
-
- case FileTypeDiskBuffer:
- Status = HDiskImageRead (DiskName, DiskOffset, DiskSize, Recover);
- break;
-
- case FileTypeMemBuffer:
- Status = HMemImageRead (MemOffset, MemSize, Recover);
- break;
-
- default:
- Status = EFI_NOT_FOUND;
- break;
- }
-
- if (EFI_ERROR (Status)) {
- HBufferImage.BufferType = BufferTypeBackup;
- }
-
- return Status;
-}
-
-/**
- Save the current image.
-
- @param[in] FileName Pointer to the file name. OPTIONAL and ignored if not FileTypeFileBuffer.
- @param[in] DiskName Pointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] DiskOffset Offset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] DiskSize Size of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] MemOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
- @param[in] MemSize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
- @param[in] BufferType The type of buffer to save. IGNORED.
-
- @return EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageSave (
- IN CHAR16 *FileName,
- IN CHAR16 *DiskName,
- IN UINTN DiskOffset,
- IN UINTN DiskSize,
- IN UINTN MemOffset,
- IN UINTN MemSize,
- IN EDIT_FILE_TYPE BufferType
- )
-{
- EFI_STATUS Status;
- EDIT_FILE_TYPE BufferTypeBackup;
-
- //
- // variable initialization
- //
- Status = EFI_SUCCESS;
- BufferTypeBackup = HBufferImage.BufferType;
-
- switch (HBufferImage.BufferType) {
- //
- // file buffer
- //
- case FileTypeFileBuffer:
- Status = HFileImageSave (FileName);
- break;
-
- //
- // disk buffer
- //
- case FileTypeDiskBuffer:
- Status = HDiskImageSave (DiskName, DiskOffset, DiskSize);
- break;
-
- //
- // memory buffer
- //
- case FileTypeMemBuffer:
- Status = HMemImageSave (MemOffset, MemSize);
- break;
-
- default:
- Status = EFI_NOT_FOUND;
- break;
- }
-
- if (EFI_ERROR (Status)) {
- HBufferImage.BufferType = BufferTypeBackup;
- }
-
- return Status;
-}
-
-/**
- Create a new line and append it to the line list.
- Fields affected:
- NumLines
- Lines
-
- @retval NULL create line failed.
- @return the line created.
-
-**/
-HEFI_EDITOR_LINE *
-HBufferImageCreateLine (
- VOID
- )
-{
- HEFI_EDITOR_LINE *Line;
-
- //
- // allocate for line structure
- //
- Line = AllocateZeroPool (sizeof (HEFI_EDITOR_LINE));
- if (Line == NULL) {
- return NULL;
- }
-
- Line->Signature = EFI_EDITOR_LINE_LIST;
- Line->Size = 0;
-
- HBufferImage.NumLines++;
-
- //
- // insert to line list
- //
- InsertTailList (HBufferImage.ListHead, &Line->Link);
-
- if (HBufferImage.Lines == NULL) {
- HBufferImage.Lines = CR (
- HBufferImage.ListHead->ForwardLink,
- HEFI_EDITOR_LINE,
- Link,
- EFI_EDITOR_LINE_LIST
- );
- }
-
- return Line;
-}
-
-/**
- Free the current image.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageFree (
- VOID
- )
-{
- //
- // free all lines
- //
- HBufferImageFreeLines ();
-
- return EFI_SUCCESS;
-}
-
-/**
- change char to int value based on Hex.
-
- @param[in] Char The input char.
-
- @return The character's index value.
- @retval -1 The operation failed.
-**/
-INTN
-EFIAPI
-HBufferImageCharToHex (
- IN CHAR16 Char
- )
-{
- //
- // change the character to hex
- //
- if (Char >= L'0' && Char <= L'9') {
- return (INTN) (Char - L'0');
- }
-
- if (Char >= L'a' && Char <= L'f') {
- return (INTN) (Char - L'a' + 10);
- }
-
- if (Char >= L'A' && Char <= L'F') {
- return (INTN) (Char - L'A' + 10);
- }
-
- return -1;
-}
-
-/**
- Add character.
-
- @param[in] Char -- input char.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageAddChar (
- IN CHAR16 Char
- )
-{
- HEFI_EDITOR_LINE *Line;
- HEFI_EDITOR_LINE *NewLine;
- INTN Value;
- UINT8 Old;
- UINTN FRow;
- UINTN FCol;
- BOOLEAN High;
-
- Value = HBufferImageCharToHex (Char);
-
- //
- // invalid input
- //
- if (Value == -1) {
- return EFI_SUCCESS;
- }
-
- Line = HBufferImage.CurrentLine;
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
- High = HBufferImage.HighBits;
-
- //
- // only needs to refresh current line
- //
- HBufferImageOnlyLineNeedRefresh = TRUE;
-
- //
- // not a full line and beyond the last character
- //
- if (FCol > Line->Size) {
- //
- // cursor always at high 4 bits
- // and always put input to the low 4 bits
- //
- Line->Buffer[Line->Size] = (UINT8) Value;
- Line->Size++;
- High = FALSE;
- } else {
-
- Old = Line->Buffer[FCol - 1];
-
- //
- // always put the input to the low 4 bits
- //
- Old = (UINT8) (Old & 0x0f);
- Old = (UINT8) (Old << 4);
- Old = (UINT8) (Value + Old);
- Line->Buffer[FCol - 1] = Old;
-
- //
- // at the low 4 bits of the last character of a full line
- // so if no next line, need to create a new line
- //
- if (!High && FCol == 0x10) {
-
- HBufferImageOnlyLineNeedRefresh = FALSE;
- HBufferImageNeedRefresh = TRUE;
-
- if (Line->Link.ForwardLink == HBufferImage.ListHead) {
- //
- // last line
- //
- // create a new line
- //
- NewLine = HBufferImageCreateLine ();
- if (NewLine == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // end of NULL
- //
- }
- //
- // end of == ListHead
- //
- }
- //
- // end of == 0x10
- //
- // if already at end of this line, scroll it to the start of next line
- //
- if (FCol == 0x10 && !High) {
- //
- // definitely has next line
- //
- FRow++;
- FCol = 1;
- High = TRUE;
- } else {
- //
- // if not at end of this line, just move to next column
- //
- if (!High) {
- FCol++;
- }
-
- if (High) {
- High = FALSE;
- } else {
- High = TRUE;
- }
-
- }
- //
- // end of ==FALSE
- //
- }
- //
- // move cursor to right
- //
- HBufferImageMovePosition (FRow, FCol, High);
-
- if (!HBufferImage.Modified) {
- HBufferImage.Modified = TRUE;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Delete the previous character.
-
- @retval EFI_SUCCESS The operationw as successful.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageDoBackspace (
- VOID
- )
-{
- HEFI_EDITOR_LINE *Line;
-
- UINTN FileColumn;
- UINTN FPos;
- BOOLEAN LastLine;
-
- //
- // variable initialization
- //
- LastLine = FALSE;
-
- //
- // already the first character
- //
- if (HBufferImage.BufferPosition.Row == 1 && HBufferImage.BufferPosition.Column == 1) {
- return EFI_SUCCESS;
- }
-
- FPos = (HBufferImage.BufferPosition.Row - 1) * 0x10 + HBufferImage.BufferPosition.Column - 1;
-
- FileColumn = HBufferImage.BufferPosition.Column;
-
- Line = HBufferImage.CurrentLine;
- LastLine = FALSE;
- if (Line->Link.ForwardLink == HBufferImage.ListHead && FileColumn > 1) {
- LastLine = TRUE;
- }
-
- HBufferImageDeleteCharacterFromBuffer (FPos - 1, 1, NULL);
-
- //
- // if is the last line
- // then only this line need to be refreshed
- //
- if (LastLine) {
- HBufferImageNeedRefresh = FALSE;
- HBufferImageOnlyLineNeedRefresh = TRUE;
- } else {
- HBufferImageNeedRefresh = TRUE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- }
-
- if (!HBufferImage.Modified) {
- HBufferImage.Modified = TRUE;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- ASCII key + Backspace + return.
-
- @param[in] Char The input char.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageDoCharInput (
- IN CHAR16 Char
- )
-{
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
-
- switch (Char) {
- case 0:
- break;
-
- case 0x08:
- Status = HBufferImageDoBackspace ();
- break;
-
- case 0x09:
- case 0x0a:
- case 0x0d:
- //
- // Tabs, Returns are thought as nothing
- //
- break;
-
- default:
- //
- // DEAL WITH ASCII CHAR, filter out thing like ctrl+f
- //
- if (Char > 127 || Char < 32) {
- Status = StatusBarSetStatusString (L"Unknown Command");
- } else {
- Status = HBufferImageAddChar (Char);
- }
-
- break;
- }
-
- return Status;
-}
-
-/**
- Check user specified FileRow is above current screen.
-
- @param[in] FileRow Row of file position ( start from 1 ).
-
- @retval TRUE It is above the current screen.
- @retval FALSE It is not above the current screen.
-
-**/
-BOOLEAN
-HAboveCurrentScreen (
- IN UINTN FileRow
- )
-{
- if (FileRow < HBufferImage.LowVisibleRow) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Check user specified FileRow is under current screen.
-
- @param[in] FileRow Row of file position ( start from 1 ).
-
- @retval TRUE It is under the current screen.
- @retval FALSE It is not under the current screen.
-
-**/
-BOOLEAN
-HUnderCurrentScreen (
- IN UINTN FileRow
- )
-{
- if (FileRow > HBufferImage.LowVisibleRow + (HMainEditor.ScreenSize.Row - 2) - 1) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- According to cursor's file position, adjust screen display.
-
- @param[in] NewFilePosRow Row of file position ( start from 1 ).
- @param[in] NewFilePosCol Column of file position ( start from 1 ).
- @param[in] HighBits Cursor will on high4 bits or low4 bits.
-**/
-VOID
-HBufferImageMovePosition (
- IN UINTN NewFilePosRow,
- IN UINTN NewFilePosCol,
- IN BOOLEAN HighBits
- )
-{
- INTN RowGap;
- UINTN Abs;
- BOOLEAN Above;
- BOOLEAN Under;
- UINTN NewDisplayCol;
-
- //
- // CALCULATE gap between current file position and new file position
- //
- RowGap = NewFilePosRow - HBufferImage.BufferPosition.Row;
-
- Under = HUnderCurrentScreen (NewFilePosRow);
- Above = HAboveCurrentScreen (NewFilePosRow);
-
- HBufferImage.HighBits = HighBits;
-
- //
- // if is below current screen
- //
- if (Under) {
- //
- // display row will be unchanged
- //
- HBufferImage.BufferPosition.Row = NewFilePosRow;
- } else {
- if (Above) {
- //
- // has enough above line, so display row unchanged
- // not has enough above lines, so the first line is
- // at the first display line
- //
- if (NewFilePosRow < (HBufferImage.DisplayPosition.Row - 2 + 1)) {
- HBufferImage.DisplayPosition.Row = NewFilePosRow + 2 - 1;
- }
-
- HBufferImage.BufferPosition.Row = NewFilePosRow;
- } else {
- //
- // in current screen
- //
- HBufferImage.BufferPosition.Row = NewFilePosRow;
- if (RowGap <= 0) {
- Abs = (UINTN)ABS(RowGap);
- HBufferImage.DisplayPosition.Row -= Abs;
- } else {
- HBufferImage.DisplayPosition.Row += RowGap;
- }
-
- }
- }
-
- HBufferImage.LowVisibleRow = HBufferImage.BufferPosition.Row - (HBufferImage.DisplayPosition.Row - 2);
-
- //
- // always in current screen
- //
- HBufferImage.BufferPosition.Column = NewFilePosCol;
-
- NewDisplayCol = 10 + (NewFilePosCol - 1) * 3;
- if (NewFilePosCol > 0x8) {
- NewDisplayCol++;
- }
-
- if (!HighBits) {
- NewDisplayCol++;
- }
-
- HBufferImage.DisplayPosition.Column = NewDisplayCol;
-
- //
- // let CurrentLine point to correct line;
- //
- HBufferImage.CurrentLine = HMoveCurrentLine (RowGap);
-
-}
-
-/**
- Scroll cursor to right.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageScrollRight (
- VOID
- )
-{
- HEFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
-
- //
- // scroll right will always move to the high4 bits of the next character
- //
- HBufferImageNeedRefresh = FALSE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
-
- Line = HBufferImage.CurrentLine;
-
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
-
- //
- // this line is not full and no next line
- //
- if (FCol > Line->Size) {
- return EFI_SUCCESS;
- }
- //
- // if already at end of this line, scroll it to the start of next line
- //
- if (FCol == 0x10) {
- //
- // has next line
- //
- if (Line->Link.ForwardLink != HBufferImage.ListHead) {
- FRow++;
- FCol = 1;
-
- } else {
- return EFI_SUCCESS;
- }
- } else {
- //
- // if not at end of this line, just move to next column
- //
- FCol++;
-
- }
-
- HBufferImageMovePosition (FRow, FCol, TRUE);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to left.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageScrollLeft (
- VOID
- )
-{
-
- HEFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
-
- HBufferImageNeedRefresh = FALSE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
-
- Line = HBufferImage.CurrentLine;
-
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
-
- //
- // if already at start of this line, so move to the end of previous line
- //
- if (FCol <= 1) {
- //
- // has previous line
- //
- if (Line->Link.BackLink != HBufferImage.ListHead) {
- FRow--;
- Line = CR (Line->Link.BackLink, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- FCol = Line->Size;
- } else {
- return EFI_SUCCESS;
- }
- } else {
- //
- // if not at start of this line, just move to previous column
- //
- FCol--;
- }
-
- HBufferImageMovePosition (FRow, FCol, TRUE);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to the next line
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageScrollDown (
- VOID
- )
-{
- HEFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
- BOOLEAN HighBits;
-
- Line = HBufferImage.CurrentLine;
-
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
- HighBits = HBufferImage.HighBits;
-
- //
- // has next line
- //
- if (Line->Link.ForwardLink != HBufferImage.ListHead) {
- FRow++;
- Line = CR (Line->Link.ForwardLink, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
-
- //
- // if the next line is not that long, so move to end of next line
- //
- if (FCol > Line->Size) {
- FCol = Line->Size + 1;
- HighBits = TRUE;
- }
-
- } else {
- return EFI_SUCCESS;
- }
-
- HBufferImageMovePosition (FRow, FCol, HighBits);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to previous line
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageScrollUp (
- VOID
- )
-{
- HEFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
-
- Line = HBufferImage.CurrentLine;
-
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
-
- //
- // has previous line
- //
- if (Line->Link.BackLink != HBufferImage.ListHead) {
- FRow--;
-
- } else {
- return EFI_SUCCESS;
- }
-
- HBufferImageMovePosition (FRow, FCol, HBufferImage.HighBits);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to next page
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImagePageDown (
- VOID
- )
-{
- HEFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
- UINTN Gap;
- BOOLEAN HighBits;
-
- Line = HBufferImage.CurrentLine;
-
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
- HighBits = HBufferImage.HighBits;
-
- //
- // has next page
- //
- if (HBufferImage.NumLines >= FRow + (HMainEditor.ScreenSize.Row - 2)) {
- Gap = (HMainEditor.ScreenSize.Row - 2);
- } else {
- //
- // MOVE CURSOR TO LAST LINE
- //
- Gap = HBufferImage.NumLines - FRow;
- }
- //
- // get correct line
- //
- Line = HMoveLine (Gap);
-
- //
- // if that line, is not that long, so move to the end of that line
- //
- if (Line != NULL && FCol > Line->Size) {
- FCol = Line->Size + 1;
- HighBits = TRUE;
- }
-
- FRow += Gap;
-
- HBufferImageMovePosition (FRow, FCol, HighBits);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to previous page
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImagePageUp (
- VOID
- )
-{
- HEFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
- UINTN Gap;
- INTN Retreat;
-
- Line = HBufferImage.CurrentLine;
-
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
-
- //
- // has previous page
- //
- if (FRow > (HMainEditor.ScreenSize.Row - 2)) {
- Gap = (HMainEditor.ScreenSize.Row - 2);
- } else {
- //
- // the first line of file will displayed on the first line of screen
- //
- Gap = FRow - 1;
- }
-
- Retreat = Gap;
- Retreat = -Retreat;
-
- //
- // get correct line
- //
- Line = HMoveLine (Retreat);
-
- FRow -= Gap;
-
- HBufferImageMovePosition (FRow, FCol, HBufferImage.HighBits);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to start of line
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageHome (
- VOID
- )
-{
- HEFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
- BOOLEAN HighBits;
-
- Line = HBufferImage.CurrentLine;
-
- //
- // curosr will at the high bit
- //
- FRow = HBufferImage.BufferPosition.Row;
- FCol = 1;
- HighBits = TRUE;
-
- //
- // move cursor position
- //
- HBufferImageMovePosition (FRow, FCol, HighBits);
-
- return EFI_SUCCESS;
-}
-
-/**
- Scroll cursor to end of line.
-
- @retval EFI_SUCCESS Teh operation was successful.
-**/
-EFI_STATUS
-HBufferImageEnd (
- VOID
- )
-{
- HEFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
- BOOLEAN HighBits;
-
- //
- // need refresh mouse
- //
- HBufferImageMouseNeedRefresh = TRUE;
-
- Line = HBufferImage.CurrentLine;
-
- FRow = HBufferImage.BufferPosition.Row;
-
- if (Line->Size == 0x10) {
- FCol = Line->Size;
- HighBits = FALSE;
- } else {
- FCol = Line->Size + 1;
- HighBits = TRUE;
- }
- //
- // move cursor position
- //
- HBufferImageMovePosition (FRow, FCol, HighBits);
-
- return EFI_SUCCESS;
-}
-
-/**
- Get the size of the open buffer.
-
- @retval The size in bytes.
-**/
-UINTN
-HBufferImageGetTotalSize (
- VOID
- )
-{
- UINTN Size;
-
- HEFI_EDITOR_LINE *Line;
-
- //
- // calculate the total size of whole line list's buffer
- //
- if (HBufferImage.Lines == NULL) {
- return 0;
- }
-
- Line = CR (
- HBufferImage.ListHead->BackLink,
- HEFI_EDITOR_LINE,
- Link,
- EFI_EDITOR_LINE_LIST
- );
- //
- // one line at most 0x10
- //
- Size = 0x10 * (HBufferImage.NumLines - 1) + Line->Size;
-
- return Size;
-}
-
-/**
- Delete character from buffer.
-
- @param[in] Pos Position, Pos starting from 0.
- @param[in] Count The Count of characters to delete.
- @param[out] DeleteBuffer The DeleteBuffer.
-
- @retval EFI_SUCCESS Success
-**/
-EFI_STATUS
-HBufferImageDeleteCharacterFromBuffer (
- IN UINTN Pos,
- IN UINTN Count,
- OUT UINT8 *DeleteBuffer
- )
-{
- UINTN Index;
-
- VOID *Buffer;
- UINT8 *BufferPtr;
- UINTN Size;
-
- HEFI_EDITOR_LINE *Line;
- LIST_ENTRY *Link;
- UINTN StartRow;
-
- UINTN OldFCol;
- UINTN OldFRow;
- UINTN OldPos;
-
- UINTN NewPos;
-
- EFI_STATUS Status;
-
- //
- // get the line that start position is at
- //
- StartRow = Pos / 0x10;
-
- Size = HBufferImageGetTotalSize ();
-
- if (Size < Count) {
- return EFI_LOAD_ERROR;
- }
-
- if (Size == 0) {
- return EFI_SUCCESS;
- }
-
- //
- // relocate all the HBufferImage fields
- //
- OldFRow = HBufferImage.BufferPosition.Row;
- OldFCol = HBufferImage.BufferPosition.Column;
- OldPos = (OldFRow - 1) * 0x10 + OldFCol - 1;
-
- if (Pos > 0) {
- //
- // has character before it,
- // so locate according to block's previous character
- //
- NewPos = Pos - 1;
-
- } else {
- //
- // has no character before it,
- // so locate according to block's next character
- //
- NewPos = 0;
- }
-
- HBufferImageMovePosition (NewPos / 0x10 + 1, NewPos % 0x10 + 1, TRUE);
-
- Buffer = AllocateZeroPool (Size);
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- HBufferImageListToBuffer (Buffer, Size);
-
- BufferPtr = (UINT8 *) Buffer;
-
- //
- // pass deleted buffer out
- //
- if (DeleteBuffer != NULL) {
- for (Index = 0; Index < Count; Index++) {
- DeleteBuffer[Index] = BufferPtr[Pos + Index];
- }
- }
- //
- // delete the part from Pos
- //
- for (Index = Pos; Index < Size - Count; Index++) {
- BufferPtr[Index] = BufferPtr[Index + Count];
- }
-
- Size -= Count;
-
- HBufferImageFreeLines ();
-
- Status = HBufferImageBufferToList (Buffer, Size);
- FreePool (Buffer);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Link = HMainEditor.BufferImage->ListHead->ForwardLink;
- for (Index = 0; Index < NewPos / 0x10; Index++) {
- Link = Link->ForwardLink;
- }
-
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- HBufferImage.CurrentLine = Line;
-
- //
- // if current cursor position if inside select area
- // then move it to the block's NEXT character
- //
- if (OldPos >= Pos && OldPos < (Pos + Count)) {
- NewPos = Pos;
- } else {
- if (OldPos < Pos) {
- NewPos = OldPos;
- } else {
- NewPos = OldPos - Count;
- }
- }
-
- HBufferImageMovePosition (NewPos / 0x10 + 1, NewPos % 0x10 + 1, TRUE);
-
- return EFI_SUCCESS;
-}
-
-/**
- Add character to buffer, add before pos.
-
- @param[in] Pos Position, Pos starting from 0.
- @param[in] Count Count of characters to add.
- @param[in] AddBuffer Add buffer.
-
- @retval EFI_SUCCESS Success.
-**/
-EFI_STATUS
-HBufferImageAddCharacterToBuffer (
- IN UINTN Pos,
- IN UINTN Count,
- IN UINT8 *AddBuffer
- )
-{
- INTN Index;
-
- VOID *Buffer;
- UINT8 *BufferPtr;
- UINTN Size;
-
- HEFI_EDITOR_LINE *Line;
-
- LIST_ENTRY *Link;
- UINTN StartRow;
-
- UINTN OldFCol;
- UINTN OldFRow;
- UINTN OldPos;
-
- UINTN NewPos;
-
- //
- // get the line that start position is at
- //
- StartRow = Pos / 0x10;
-
- Size = HBufferImageGetTotalSize ();
-
- //
- // relocate all the HBufferImage fields
- //
- OldFRow = HBufferImage.BufferPosition.Row;
- OldFCol = HBufferImage.BufferPosition.Column;
- OldPos = (OldFRow - 1) * 0x10 + OldFCol - 1;
-
- //
- // move cursor before Pos
- //
- if (Pos > 0) {
- NewPos = Pos - 1;
- } else {
- NewPos = 0;
- }
-
- HBufferImageMovePosition (NewPos / 0x10 + 1, NewPos % 0x10 + 1, TRUE);
-
- Buffer = AllocateZeroPool (Size + Count);
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- HBufferImageListToBuffer (Buffer, Size);
-
- BufferPtr = (UINT8 *) Buffer;
-
- //
- // get a place to add
- //
- for (Index = (INTN) (Size + Count - 1); Index >= (INTN) Pos; Index--) {
- BufferPtr[Index] = BufferPtr[Index - Count];
- }
- //
- // add the buffer
- //
- for (Index = (INTN) 0; Index < (INTN) Count; Index++) {
- BufferPtr[Index + Pos] = AddBuffer[Index];
- }
-
- Size += Count;
-
- HBufferImageFreeLines ();
-
- HBufferImageBufferToList (Buffer, Size);
-
- FreePool (Buffer);
-
- Link = HMainEditor.BufferImage->ListHead->ForwardLink;
- for (Index = 0; Index < (INTN) NewPos / 0x10; Index++) {
- Link = Link->ForwardLink;
- }
-
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- HBufferImage.CurrentLine = Line;
-
- if (OldPos >= Pos) {
- NewPos = OldPos + Count;
- } else {
- NewPos = OldPos;
- }
-
- HBufferImageMovePosition (NewPos / 0x10 + 1, NewPos % 0x10 + 1, TRUE);
-
- return EFI_SUCCESS;
-}
-
-/**
- Delete current character from line.
-
- @retval EFI_SUCCESS The operationw as successful.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageDoDelete (
- VOID
- )
-{
-
- HEFI_EDITOR_LINE *Line;
-
- BOOLEAN LastLine;
- UINTN FileColumn;
- UINTN FPos;
-
- FPos = (HBufferImage.BufferPosition.Row - 1) * 0x10 + HBufferImage.BufferPosition.Column - 1;
-
- FileColumn = HBufferImage.BufferPosition.Column;
-
- Line = HBufferImage.CurrentLine;
-
- //
- // if beyond the last character
- //
- if (FileColumn > Line->Size) {
- return EFI_SUCCESS;
- }
-
- LastLine = FALSE;
- if (Line->Link.ForwardLink == HBufferImage.ListHead) {
- LastLine = TRUE;
- }
-
- HBufferImageDeleteCharacterFromBuffer (FPos, 1, NULL);
-
- //
- // if is the last line
- // then only this line need to be refreshed
- //
- if (LastLine) {
- HBufferImageNeedRefresh = FALSE;
- HBufferImageOnlyLineNeedRefresh = TRUE;
- } else {
- HBufferImageNeedRefresh = TRUE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- }
-
- if (!HBufferImage.Modified) {
- HBufferImage.Modified = TRUE;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Change the raw buffer to a list of lines for the UI.
-
- @param[in] Buffer The pointer to the buffer to fill.
- @param[in] Bytes The size of the buffer in bytes.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageBufferToList (
- IN VOID *Buffer,
- IN UINTN Bytes
- )
-{
- UINTN TempI;
- UINTN TempJ;
- UINTN Left;
- HEFI_EDITOR_LINE *Line;
- UINT8 *BufferPtr;
-
- TempI = 0;
- Left = 0;
- BufferPtr = (UINT8 *) Buffer;
-
- //
- // parse file content line by line
- //
- while (TempI < Bytes) {
- if (Bytes - TempI >= 0x10) {
- Left = 0x10;
- } else {
- Left = Bytes - TempI;
- }
-
- //
- // allocate a new line
- //
- Line = HBufferImageCreateLine ();
- if (Line == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Line->Size = Left;
-
- for (TempJ = 0; TempJ < Left; TempJ++) {
- Line->Buffer[TempJ] = BufferPtr[TempI];
- TempI++;
- }
-
- }
-
- //
- // last line is a full line, SO create a new line
- //
- if (Left == 0x10 || Bytes == 0) {
- Line = HBufferImageCreateLine ();
- if (Line == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Change the list of lines from the UI to a raw buffer.
-
- @param[in] Buffer The pointer to the buffer to fill.
- @param[in] Bytes The size of the buffer in bytes.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageListToBuffer (
- IN VOID *Buffer,
- IN UINTN Bytes
- )
-{
- UINTN Count;
- UINTN Index;
- HEFI_EDITOR_LINE *Line;
- LIST_ENTRY *Link;
- UINT8 *BufferPtr;
-
- //
- // change the line list to a large buffer
- //
- if (HBufferImage.Lines == NULL) {
- return EFI_SUCCESS;
- }
-
- Link = &HBufferImage.Lines->Link;
- Count = 0;
- BufferPtr = (UINT8 *) Buffer;
-
- //
- // deal line by line
- //
- while (Link != HBufferImage.ListHead) {
-
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
-
- //@todo shouldn't this be an error???
- if (Count + Line->Size > Bytes) {
- return EFI_SUCCESS;
- }
-
- for (Index = 0; Index < Line->Size; Index++) {
- BufferPtr[Index] = Line->Buffer[Index];
- }
-
- Count += Line->Size;
- BufferPtr += Line->Size;
-
- Link = Link->ForwardLink;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Move the mouse in the image buffer.
-
- @param[in] TextX The x-coordinate.
- @param[in] TextY The y-coordinate.
-**/
-VOID
-EFIAPI
-HBufferImageAdjustMousePosition (
- IN INT32 TextX,
- IN INT32 TextY
- )
-{
- UINTN TempX;
- UINTN TempY;
- UINTN AbsX;
- UINTN AbsY;
-
- //
- // TextX and TextY is mouse movement data returned by mouse driver
- // This function will change it to MousePosition
- //
- //
- // get absolute TempX value
- //
- if (TextX >= 0) {
- AbsX = TextX;
- } else {
- AbsX = -TextX;
- }
- //
- // get absolute TempY value
- //
- if (TextY >= 0) {
- AbsY = TextY;
- } else {
- AbsY = -TextY;
- }
-
- TempX = HBufferImage.MousePosition.Column;
- TempY = HBufferImage.MousePosition.Row;
-
- if (TextX >= 0) {
- TempX += TextX;
- } else {
- if (TempX >= AbsX) {
- TempX -= AbsX;
- } else {
- TempX = 0;
- }
- }
-
- if (TextY >= 0) {
- TempY += TextY;
- } else {
- if (TempY >= AbsY) {
- TempY -= AbsY;
- } else {
- TempY = 0;
- }
- }
- //
- // check whether new mouse column position is beyond screen
- // if not, adjust it
- //
- if (TempX >= 10 && TempX <= (10 + 0x10 * 3 - 1)) {
- HBufferImage.MousePosition.Column = TempX;
- } else if (TempX < 10) {
- HBufferImage.MousePosition.Column = 10;
- } else if (TempX > (10 + 0x10 * 3 - 1)) {
- HBufferImage.MousePosition.Column = 10 + 0x10 * 3 - 1;
- }
- //
- // check whether new mouse row position is beyond screen
- // if not, adjust it
- //
- if (TempY >= 2 && TempY <= (HMainEditor.ScreenSize.Row - 1)) {
- HBufferImage.MousePosition.Row = TempY;
- } else if (TempY < 2) {
- HBufferImage.MousePosition.Row = 2;
- } else if (TempY > (HMainEditor.ScreenSize.Row - 1)) {
- HBufferImage.MousePosition.Row = (HMainEditor.ScreenSize.Row - 1);
- }
-
-}
-
-/**
- Dispatch input to different handler
-
- @param[in] Key The input key:
- the keys can be:
- ASCII KEY
- Backspace/Delete
- Direction key: up/down/left/right/pgup/pgdn
- Home/End
- INS
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_OUT_OF_RESOURCES A Memory allocation failed.
-**/
-EFI_STATUS
-HBufferImageHandleInput (
- IN EFI_INPUT_KEY *Key
- )
-{
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
-
- switch (Key->ScanCode) {
- //
- // ordinary key
- //
- case SCAN_NULL:
- Status = HBufferImageDoCharInput (Key->UnicodeChar);
- break;
-
- //
- // up arrow
- //
- case SCAN_UP:
- Status = HBufferImageScrollUp ();
- break;
-
- //
- // down arrow
- //
- case SCAN_DOWN:
- Status = HBufferImageScrollDown ();
- break;
-
- //
- // right arrow
- //
- case SCAN_RIGHT:
- Status = HBufferImageScrollRight ();
- break;
-
- //
- // left arrow
- //
- case SCAN_LEFT:
- Status = HBufferImageScrollLeft ();
- break;
-
- //
- // page up
- //
- case SCAN_PAGE_UP:
- Status = HBufferImagePageUp ();
- break;
-
- //
- // page down
- //
- case SCAN_PAGE_DOWN:
- Status = HBufferImagePageDown ();
- break;
-
- //
- // delete
- //
- case SCAN_DELETE:
- Status = HBufferImageDoDelete ();
- break;
-
- //
- // home
- //
- case SCAN_HOME:
- Status = HBufferImageHome ();
- break;
-
- //
- // end
- //
- case SCAN_END:
- Status = HBufferImageEnd ();
- break;
-
- default:
- Status = StatusBarSetStatusString (L"Unknown Command");
- break;
- }
-
- return Status;
-}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h
deleted file mode 100644
index 91369b5931..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/** @file
- Defines BufferImage - the view of the file that is visible at any point,
- as well as the event handlers for editing the file
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_BUFFER_IMAGE_H_
-#define _LIB_BUFFER_IMAGE_H_
-
-#include "HexEditor.h"
-
-/**
- Initialization function for HBufferImage
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HBufferImageInit (
- VOID
- );
-
-/**
- Cleanup function for HBufferImage
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageCleanup (
- VOID
- );
-
-/**
- Refresh function for HBufferImage.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A Load error occured.
-
-**/
-EFI_STATUS
-HBufferImageRefresh (
- VOID
- );
-
-/**
- Dispatch input to different handler
-
- @param[in] Key The input key:
- the keys can be:
- ASCII KEY
- Backspace/Delete
- Direction key: up/down/left/right/pgup/pgdn
- Home/End
- INS
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_OUT_OF_RESOURCES A Memory allocation failed.
-**/
-EFI_STATUS
-HBufferImageHandleInput (
- IN EFI_INPUT_KEY *Key
- );
-
-/**
- Backup function for HBufferImage. Only a few fields need to be backup.
- This is for making the file buffer refresh as few as possible.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageBackup (
- VOID
- );
-
-/**
- Read an image into a buffer friom a source.
-
- @param[in] FileName Pointer to the file name. OPTIONAL and ignored if not FileTypeFileBuffer.
- @param[in] DiskName Pointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] DiskOffset Offset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] DiskSize Size of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] MemOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
- @param[in] MemSize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
- @param[in] BufferType The type of buffer to save. IGNORED.
- @param[in] Recover TRUE for recovermode, FALSE otherwise.
-
- @return EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageRead (
- IN CONST CHAR16 *FileName,
- IN CONST CHAR16 *DiskName,
- IN UINTN DiskOffset,
- IN UINTN DiskSize,
- IN UINTN MemOffset,
- IN UINTN MemSize,
- IN EDIT_FILE_TYPE BufferType,
- IN BOOLEAN Recover
- );
-
-/**
- Save the current image.
-
- @param[in] FileName Pointer to the file name. OPTIONAL and ignored if not FileTypeFileBuffer.
- @param[in] DiskName Pointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] DiskOffset Offset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] DiskSize Size of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] MemOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
- @param[in] MemSize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
- @param[in] BufferType The type of buffer to save. IGNORED.
-
- @return EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageSave (
- IN CHAR16 *FileName,
- IN CHAR16 *DiskName,
- IN UINTN DiskOffset,
- IN UINTN DiskSize,
- IN UINTN MemOffset,
- IN UINTN MemSize,
- IN EDIT_FILE_TYPE BufferType
- );
-
-/**
- According to cursor's file position, adjust screen display.
-
- @param[in] NewFilePosRow Row of file position ( start from 1 ).
- @param[in] NewFilePosCol Column of file position ( start from 1 ).
- @param[in] HighBits Cursor will on high4 bits or low4 bits.
-**/
-VOID
-HBufferImageMovePosition (
- IN UINTN NewFilePosRow,
- IN UINTN NewFilePosCol,
- IN BOOLEAN HighBits
- );
-
-
-/**
- Create a new line and append it to the line list.
- Fields affected:
- NumLines
- Lines
-
- @retval NULL create line failed.
- @return the line created.
-
-**/
-HEFI_EDITOR_LINE *
-HBufferImageCreateLine (
- VOID
- );
-
-/**
- Free the current image.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HBufferImageFree (
- VOID
- );
-
-/**
- Delete character from buffer.
-
- @param[in] Pos Position, Pos starting from 0.
- @param[in] Count The Count of characters to delete.
- @param[out] DeleteBuffer The DeleteBuffer.
-
- @retval EFI_SUCCESS Success
-**/
-EFI_STATUS
-HBufferImageDeleteCharacterFromBuffer (
- IN UINTN Pos,
- IN UINTN Count,
- OUT UINT8 *DeleteBuffer
- );
-
-/**
- Add character to buffer, add before pos.
-
- @param[in] Pos Position, Pos starting from 0.
- @param[in] Count Count of characters to add.
- @param[in] AddBuffer Add buffer.
-
- @retval EFI_SUCCESS Success.
-**/
-EFI_STATUS
-HBufferImageAddCharacterToBuffer (
- IN UINTN Pos,
- IN UINTN Count,
- IN UINT8 *AddBuffer
- );
-
-/**
- Change the raw buffer to a list of lines for the UI.
-
- @param[in] Buffer The pointer to the buffer to fill.
- @param[in] Bytes The size of the buffer in bytes.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageBufferToList (
- IN VOID *Buffer,
- IN UINTN Bytes
- );
-
-/**
- Change the list of lines from the UI to a raw buffer.
-
- @param[in] Buffer The pointer to the buffer to fill.
- @param[in] Bytes The size of the buffer in bytes.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageListToBuffer (
- IN VOID *Buffer,
- IN UINTN Bytes
- );
-
-/**
- Move the mouse in the image buffer.
-
- @param[in] TextX The x-coordinate.
- @param[in] TextY The y-coordinate.
-**/
-VOID
-EFIAPI
-HBufferImageAdjustMousePosition (
- IN INT32 TextX,
- IN INT32 TextY
- );
-
-/**
- Function to decide if a column number is stored in the high bits.
-
- @param[in] Column The column to examine.
- @param[out] FCol The actual column number.
-
- @retval TRUE The actual column was in high bits and is now in FCol.
- @retval FALSE There was not a column number in the high bits.
-**/
-BOOLEAN
-HBufferImageIsAtHighBits (
- IN UINTN Column,
- OUT UINTN *FCol
- );
-
-/**
- Get the size of the open buffer.
-
- @retval The size in bytes.
-**/
-UINTN
-HBufferImageGetTotalSize (
- VOID
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c
deleted file mode 100644
index 4d5bfb391f..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/** @file
- Functions to deal with Clip Board
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "HexEditor.h"
-
-typedef struct {
- UINT8 *Buffer;
- UINTN Size;
-} HEFI_EDITOR_CLIPBOARD;
-
-HEFI_EDITOR_CLIPBOARD HClipBoard;
-
-//
-// for basic initialization of HClipBoard
-//
-HEFI_EDITOR_CLIPBOARD HClipBoardConst = {
- NULL,
- 0
-};
-
-/**
- Initialization function for HDiskImage.
-
- @param[in] EFI_SUCCESS The operation was successful.
- @param[in] EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HClipBoardInit (
- VOID
- )
-{
- //
- // basiclly initialize the HDiskImage
- //
- CopyMem (&HClipBoard, &HClipBoardConst, sizeof (HClipBoard));
-
- return EFI_SUCCESS;
-}
-
-/**
- Initialization function for HDiskImage.
-
- @param[in] EFI_SUCCESS The operation was successful.
- @param[in] EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HClipBoardCleanup (
- VOID
- )
-{
-
- SHELL_FREE_NON_NULL (HClipBoard.Buffer);
-
- return EFI_SUCCESS;
-}
-
-/**
- Set a buffer into the clipboard.
-
- @param[in] Buffer The buffer to add to the clipboard.
- @param[in] Size The size of Buffer in bytes.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HClipBoardSet (
- IN UINT8 *Buffer,
- IN UINTN Size
- )
-{
- //
- // free the old clipboard buffer
- // and set new clipboard buffer
- //
- SHELL_FREE_NON_NULL (HClipBoard.Buffer);
- HClipBoard.Buffer = Buffer;
-
- HClipBoard.Size = Size;
-
- return EFI_SUCCESS;
-}
-
-/**
- Get a buffer from the clipboard.
-
- @param[out] Buffer The pointer to the buffer to add to the clipboard.
-
- @return the size of the buffer.
-**/
-UINTN
-HClipBoardGet (
- OUT UINT8 **Buffer
- )
-{
- //
- // return the clipboard buffer
- //
- *Buffer = HClipBoard.Buffer;
-
- return HClipBoard.Size;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h
deleted file mode 100644
index 8066c29247..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/** @file
- Defines DiskImage - the view of the file that is visible at any point,
- as well as the event handlers for editing the file
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_CLIP_BOARD_H_
-#define _LIB_CLIP_BOARD_H_
-
-#include "HexEditor.h"
-
-/**
- Initialization function for HDiskImage
-
- @param[in] EFI_SUCCESS The operation was successful.
- @param[in] EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HClipBoardInit (
- VOID
- );
-
-/**
- Initialization function for HDiskImage.
-
- @param[in] EFI_SUCCESS The operation was successful.
- @param[in] EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HClipBoardCleanup (
- VOID
- );
-
-/**
- Set a buffer into the clipboard.
-
- @param[in] Buffer The buffer to add to the clipboard.
- @param[in] Size The size of Buffer in bytes.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HClipBoardSet (
- IN UINT8 *Buffer,
- IN UINTN Size
- );
-
-/**
- Get a buffer from the clipboard.
-
- @param[out] Buffer The pointer to the buffer to add to the clipboard.
-
- @return the size of the buffer.
-**/
-UINTN
-HClipBoardGet (
- OUT UINT8 **Buffer
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
deleted file mode 100644
index c956f77b28..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
+++ /dev/null
@@ -1,433 +0,0 @@
-/** @file
- Functions to deal with Disk buffer.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "HexEditor.h"
-#include <Protocol/BlockIo.h>
-
-extern EFI_HANDLE HImageHandleBackup;
-extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
-
-extern BOOLEAN HBufferImageNeedRefresh;
-extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
-extern BOOLEAN HBufferImageMouseNeedRefresh;
-
-extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
-
-HEFI_EDITOR_DISK_IMAGE HDiskImage;
-HEFI_EDITOR_DISK_IMAGE HDiskImageBackupVar;
-
-//
-// for basic initialization of HDiskImage
-//
-HEFI_EDITOR_DISK_IMAGE HDiskImageConst = {
- NULL,
- 0,
- 0,
- 0
-};
-
-/**
- Initialization function for HDiskImage.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HDiskImageInit (
- VOID
- )
-{
- //
- // basically initialize the HDiskImage
- //
- CopyMem (&HDiskImage, &HDiskImageConst, sizeof (HDiskImage));
-
- CopyMem (&HDiskImageBackupVar, &HDiskImageConst, sizeof (HDiskImageBackupVar));
-
- return EFI_SUCCESS;
-}
-
-/**
- Backup function for HDiskImage. Only a few fields need to be backup.
- This is for making the Disk buffer refresh as few as possible.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES gST->ConOut of resources.
-**/
-EFI_STATUS
-HDiskImageBackup (
- VOID
- )
-{
- //
- // backup the disk name, offset and size
- //
- //
- SHELL_FREE_NON_NULL (HDiskImageBackupVar.Name);
-
- HDiskImageBackupVar.Name = CatSPrint(NULL, L"%s", HDiskImage.Name);
- if (HDiskImageBackupVar.Name == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- HDiskImageBackupVar.Offset = HDiskImage.Offset;
- HDiskImageBackupVar.Size = HDiskImage.Size;
-
- return EFI_SUCCESS;
-}
-
-/**
- Cleanup function for HDiskImage.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HDiskImageCleanup (
- VOID
- )
-{
- SHELL_FREE_NON_NULL (HDiskImage.Name);
- SHELL_FREE_NON_NULL (HDiskImageBackupVar.Name);
-
- return EFI_SUCCESS;
-}
-
-/**
- Set FileName field in HFileImage.
-
- @param[in] Str File name to set.
- @param[in] Offset The offset.
- @param[in] Size The size.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-HDiskImageSetDiskNameOffsetSize (
- IN CONST CHAR16 *Str,
- IN UINTN Offset,
- IN UINTN Size
- )
-{
- UINTN Len;
- UINTN Index;
-
- //
- // free the old file name
- //
- SHELL_FREE_NON_NULL (HDiskImage.Name);
-
- Len = StrLen (Str);
-
- HDiskImage.Name = AllocateZeroPool (2 * (Len + 1));
- if (HDiskImage.Name == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- for (Index = 0; Index < Len; Index++) {
- HDiskImage.Name[Index] = Str[Index];
- }
-
- HDiskImage.Name[Len] = L'\0';
-
- HDiskImage.Offset = Offset;
- HDiskImage.Size = Size;
-
- return EFI_SUCCESS;
-}
-
-/**
- Read a disk from disk into HBufferImage.
-
- @param[in] DeviceName filename to read.
- @param[in] Offset The offset.
- @param[in] Size The size.
- @param[in] Recover if is for recover, no information print.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
-**/
-EFI_STATUS
-HDiskImageRead (
- IN CONST CHAR16 *DeviceName,
- IN UINTN Offset,
- IN UINTN Size,
- IN BOOLEAN Recover
- )
-{
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_DEVICE_PATH_PROTOCOL *DupDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *DupDevicePathForFree;
- EFI_HANDLE Handle;
- EFI_BLOCK_IO_PROTOCOL *BlkIo;
- EFI_STATUS Status;
-
- VOID *Buffer;
- CHAR16 *Str;
- UINTN Bytes;
-
- HEFI_EDITOR_LINE *Line;
- UINT64 ByteOffset;
-
- EDIT_FILE_TYPE BufferTypeBackup;
-
- BufferTypeBackup = HBufferImage.BufferType;
- HBufferImage.BufferType = FileTypeDiskBuffer;
-
- DevicePath = gEfiShellProtocol->GetDevicePathFromMap(DeviceName);
- if (DevicePath == NULL) {
- StatusBarSetStatusString (L"Cannot Find Device");
- return EFI_INVALID_PARAMETER;
- }
- DupDevicePath = DuplicateDevicePath(DevicePath);
- DupDevicePathForFree = DupDevicePath;
- //
- // get blkio interface
- //
- Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid,&DupDevicePath,&Handle);
- FreePool(DupDevicePathForFree);
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Read Disk Failed");
- return Status;
- }
- Status = gBS->OpenProtocol(Handle, &gEfiBlockIoProtocolGuid, (VOID**)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Read Disk Failed");
- return Status;
- }
- //
- // if Offset exceeds LastBlock,
- // return error
- //
- if (Offset > BlkIo->Media->LastBlock || Offset + Size > BlkIo->Media->LastBlock) {
- StatusBarSetStatusString (L"Invalid Offset + Size");
- return EFI_LOAD_ERROR;
- }
-
- Bytes = BlkIo->Media->BlockSize * Size;
- Buffer = AllocateZeroPool (Bytes);
-
- if (Buffer == NULL) {
- StatusBarSetStatusString (L"Read Disk Failed");
- return EFI_OUT_OF_RESOURCES;
- }
-
- ByteOffset = MultU64x32 (Offset, BlkIo->Media->BlockSize);
-
- //
- // read from disk
- //
- Status = BlkIo->ReadBlocks (
- BlkIo,
- BlkIo->Media->MediaId,
- Offset,
- Bytes,
- Buffer
- );
-
- if (EFI_ERROR (Status)) {
- FreePool (Buffer);
- StatusBarSetStatusString (L"Read Disk Failed");
- return EFI_LOAD_ERROR;
- }
-
- HBufferImageFree ();
-
- //
- // convert buffer to line list
- //
- Status = HBufferImageBufferToList (Buffer, Bytes);
- FreePool (Buffer);
-
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Read Disk Failed");
- return Status;
- }
-
- Status = HDiskImageSetDiskNameOffsetSize (DeviceName, Offset, Size);
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Read Disk Failed");
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // initialize some variables
- //
- HDiskImage.BlockSize = BlkIo->Media->BlockSize;
-
- HBufferImage.DisplayPosition.Row = 2;
- HBufferImage.DisplayPosition.Column = 10;
-
- HBufferImage.MousePosition.Row = 2;
- HBufferImage.MousePosition.Column = 10;
-
- HBufferImage.LowVisibleRow = 1;
- HBufferImage.HighBits = TRUE;
-
- HBufferImage.BufferPosition.Row = 1;
- HBufferImage.BufferPosition.Column = 1;
-
- if (!Recover) {
- Str = CatSPrint(NULL, L"%d Lines Read", HBufferImage.NumLines);
- if (Str == NULL) {
- StatusBarSetStatusString (L"Read Disk Failed");
- return EFI_OUT_OF_RESOURCES;
- }
-
- StatusBarSetStatusString (Str);
- SHELL_FREE_NON_NULL (Str);
-
- HMainEditor.SelectStart = 0;
- HMainEditor.SelectEnd = 0;
-
- }
-
- //
- // has line
- //
- if (HBufferImage.Lines != NULL) {
- HBufferImage.CurrentLine = CR (
- HBufferImage.ListHead->ForwardLink,
- HEFI_EDITOR_LINE,
- Link,
- EFI_EDITOR_LINE_LIST
- );
- } else {
- //
- // create a dummy line
- //
- Line = HBufferImageCreateLine ();
- if (Line == NULL) {
- StatusBarSetStatusString (L"Read Disk Failed");
- return EFI_OUT_OF_RESOURCES;
- }
-
- HBufferImage.CurrentLine = Line;
- }
-
- HBufferImage.Modified = FALSE;
- HBufferImageNeedRefresh = TRUE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- HBufferImageMouseNeedRefresh = TRUE;
-
- return EFI_SUCCESS;
-}
-
-/**
- Save lines in HBufferImage to disk.
- NOT ALLOW TO WRITE TO ANOTHER DISK!!!!!!!!!
-
- @param[in] DeviceName The device name.
- @param[in] Offset The offset.
- @param[in] Size The size.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
-**/
-EFI_STATUS
-HDiskImageSave (
- IN CHAR16 *DeviceName,
- IN UINTN Offset,
- IN UINTN Size
- )
-{
-
- CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_DEVICE_PATH_PROTOCOL *DupDevicePath;
- EFI_BLOCK_IO_PROTOCOL *BlkIo;
- EFI_STATUS Status;
- EFI_HANDLE Handle;
- VOID *Buffer;
- UINTN Bytes;
-
- UINT64 ByteOffset;
-
- EDIT_FILE_TYPE BufferTypeBackup;
-
- //
- // if not modified, directly return
- //
- if (HBufferImage.Modified == FALSE) {
- return EFI_SUCCESS;
- }
-
- BufferTypeBackup = HBufferImage.BufferType;
- HBufferImage.BufferType = FileTypeDiskBuffer;
-
- DevicePath = gEfiShellProtocol->GetDevicePathFromMap(DeviceName);
- if (DevicePath == NULL) {
-// StatusBarSetStatusString (L"Cannot Find Device");
- return EFI_INVALID_PARAMETER;
- }
- DupDevicePath = DuplicateDevicePath(DevicePath);
-
- //
- // get blkio interface
- //
- Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid,&DupDevicePath,&Handle);
- FreePool(DupDevicePath);
- if (EFI_ERROR (Status)) {
-// StatusBarSetStatusString (L"Read Disk Failed");
- return Status;
- }
- Status = gBS->OpenProtocol(Handle, &gEfiBlockIoProtocolGuid, (VOID**)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR (Status)) {
-// StatusBarSetStatusString (L"Read Disk Failed");
- return Status;
- }
-
- Bytes = BlkIo->Media->BlockSize * Size;
- Buffer = AllocateZeroPool (Bytes);
-
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // concatenate the line list to a buffer
- //
- Status = HBufferImageListToBuffer (Buffer, Bytes);
- if (EFI_ERROR (Status)) {
- FreePool (Buffer);
- return Status;
- }
-
- ByteOffset = MultU64x32 (Offset, BlkIo->Media->BlockSize);
-
- //
- // write the buffer to disk
- //
- Status = BlkIo->WriteBlocks (
- BlkIo,
- BlkIo->Media->MediaId,
- Offset,
- Bytes,
- Buffer
- );
-
- FreePool (Buffer);
-
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
- //
- // now not modified
- //
- HBufferImage.Modified = FALSE;
-
- return EFI_SUCCESS;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h
deleted file mode 100644
index 06fb53020a..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/** @file
- Defines DiskImage - the view of the file that is visible at any point,
- as well as the event handlers for editing the file
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_DISK_IMAGE_H_
-#define _LIB_DISK_IMAGE_H_
-
-#include "HexEditor.h"
-
-/**
- Initialization function for HDiskImage.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HDiskImageInit (
- VOID
- );
-
-/**
- Cleanup function for HDiskImage.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HDiskImageCleanup (
- VOID
- );
-
-/**
- Backup function for HDiskImage. Only a few fields need to be backup.
- This is for making the Disk buffer refresh as few as possible.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES gST->ConOut of resources.
-**/
-EFI_STATUS
-HDiskImageBackup (
- VOID
- );
-
-/**
- Read a disk from disk into HBufferImage.
-
- @param[in] DeviceName filename to read.
- @param[in] Offset The offset.
- @param[in] Size The size.
- @param[in] Recover if is for recover, no information print.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
-**/
-EFI_STATUS
-HDiskImageRead (
- IN CONST CHAR16 *DeviceName,
- IN UINTN Offset,
- IN UINTN Size,
- IN BOOLEAN Recover
- );
-
-/**
- Save lines in HBufferImage to disk.
- NOT ALLOW TO WRITE TO ANOTHER DISK!!!!!!!!!
-
- @param[in] DeviceName The device name.
- @param[in] Offset The offset.
- @param[in] Size The size.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
-**/
-EFI_STATUS
-HDiskImageSave (
- IN CHAR16 *DeviceName,
- IN UINTN Offset,
- IN UINTN Size
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
deleted file mode 100644
index ccf5406645..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/** @file
- Functions to deal with file buffer.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "HexEditor.h"
-
-extern EFI_HANDLE HImageHandleBackup;
-extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
-
-extern BOOLEAN HBufferImageNeedRefresh;
-extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
-extern BOOLEAN HBufferImageMouseNeedRefresh;
-
-extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
-
-HEFI_EDITOR_FILE_IMAGE HFileImage;
-HEFI_EDITOR_FILE_IMAGE HFileImageBackupVar;
-
-//
-// for basic initialization of HFileImage
-//
-HEFI_EDITOR_BUFFER_IMAGE HFileImageConst = {
- NULL,
- 0,
- FALSE
-};
-
-/**
- Initialization function for HFileImage
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HFileImageInit (
- VOID
- )
-{
- //
- // basically initialize the HFileImage
- //
- CopyMem (&HFileImage, &HFileImageConst, sizeof (HFileImage));
-
- CopyMem (
- &HFileImageBackupVar,
- &HFileImageConst,
- sizeof (HFileImageBackupVar)
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Backup function for HFileImage. Only a few fields need to be backup.
- This is for making the file buffer refresh as few as possible.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-HFileImageBackup (
- VOID
- )
-{
- SHELL_FREE_NON_NULL (HFileImageBackupVar.FileName);
- HFileImageBackupVar.FileName = CatSPrint(NULL, L"%s", HFileImage.FileName);
- if (HFileImageBackupVar.FileName == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Cleanup function for HFileImage.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HFileImageCleanup (
- VOID
- )
-{
-
- SHELL_FREE_NON_NULL (HFileImage.FileName);
- SHELL_FREE_NON_NULL (HFileImageBackupVar.FileName);
-
- return EFI_SUCCESS;
-}
-
-/**
- Set FileName field in HFileImage
-
- @param[in] Str File name to set.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-HFileImageSetFileName (
- IN CONST CHAR16 *Str
- )
-{
- UINTN Size;
- UINTN Index;
-
- //
- // free the old file name
- //
- SHELL_FREE_NON_NULL (HFileImage.FileName);
-
- Size = StrLen (Str);
-
- HFileImage.FileName = AllocateZeroPool (2 * (Size + 1));
- if (HFileImage.FileName == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- for (Index = 0; Index < Size; Index++) {
- HFileImage.FileName[Index] = Str[Index];
- }
-
- HFileImage.FileName[Size] = L'\0';
-
- return EFI_SUCCESS;
-}
-
-/**
- Read a file from disk into HBufferImage.
-
- @param[in] FileName filename to read.
- @param[in] Recover if is for recover, no information print.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HFileImageRead (
- IN CONST CHAR16 *FileName,
- IN BOOLEAN Recover
- )
-{
- HEFI_EDITOR_LINE *Line;
- UINT8 *Buffer;
- CHAR16 *UnicodeBuffer;
- EFI_STATUS Status;
-
- //
- // variable initialization
- //
- Line = NULL;
-
- //
- // in this function, when you return error ( except EFI_OUT_OF_RESOURCES )
- // you should set status string
- // since this function maybe called before the editorhandleinput loop
- // so any error will cause editor return
- // so if you want to print the error status
- // you should set the status string
- //
- Status = ReadFileIntoBuffer (FileName, (VOID**)&Buffer, &HFileImage.Size, &HFileImage.ReadOnly);
- //
- // NULL pointer is only also a failure for a non-zero file size.
- //
- if ((EFI_ERROR(Status)) || (Buffer == NULL && HFileImage.Size != 0)) {
- UnicodeBuffer = CatSPrint(NULL, L"Read error on file &s: %r", FileName, Status);
- if (UnicodeBuffer == NULL) {
- SHELL_FREE_NON_NULL(Buffer);
- return EFI_OUT_OF_RESOURCES;
- }
-
- StatusBarSetStatusString (UnicodeBuffer);
- FreePool (UnicodeBuffer);
- return EFI_OUT_OF_RESOURCES;
- }
-
- HFileImageSetFileName (FileName);
-
- //
- // free the old lines
- //
- HBufferImageFree ();
-
- Status = HBufferImageBufferToList (Buffer, HFileImage.Size);
- SHELL_FREE_NON_NULL (Buffer);
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Error parsing file.");
- return Status;
- }
-
- HBufferImage.DisplayPosition.Row = 2;
- HBufferImage.DisplayPosition.Column = 10;
- HBufferImage.MousePosition.Row = 2;
- HBufferImage.MousePosition.Column = 10;
- HBufferImage.LowVisibleRow = 1;
- HBufferImage.HighBits = TRUE;
- HBufferImage.BufferPosition.Row = 1;
- HBufferImage.BufferPosition.Column = 1;
- HBufferImage.BufferType = FileTypeFileBuffer;
-
- if (!Recover) {
- UnicodeBuffer = CatSPrint(NULL, L"%d Lines Read", HBufferImage.NumLines);
- if (UnicodeBuffer == NULL) {
- SHELL_FREE_NON_NULL(Buffer);
- return EFI_OUT_OF_RESOURCES;
- }
-
- StatusBarSetStatusString (UnicodeBuffer);
- FreePool (UnicodeBuffer);
-
- HMainEditor.SelectStart = 0;
- HMainEditor.SelectEnd = 0;
- }
-
- //
- // has line
- //
- if (HBufferImage.Lines != 0) {
- HBufferImage.CurrentLine = CR (HBufferImage.ListHead->ForwardLink, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- } else {
- //
- // create a dummy line
- //
- Line = HBufferImageCreateLine ();
- if (Line == NULL) {
- SHELL_FREE_NON_NULL(Buffer);
- return EFI_OUT_OF_RESOURCES;
- }
-
- HBufferImage.CurrentLine = Line;
- }
-
- HBufferImage.Modified = FALSE;
- HBufferImageNeedRefresh = TRUE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- HBufferImageMouseNeedRefresh = TRUE;
-
- return EFI_SUCCESS;
-}
-
-/**
- Save lines in HBufferImage to disk.
-
- @param[in] FileName The file name.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HFileImageSave (
- IN CHAR16 *FileName
- )
-{
-
- LIST_ENTRY *Link;
- HEFI_EDITOR_LINE *Line;
- CHAR16 *Str;
- EFI_STATUS Status;
- UINTN NumLines;
- SHELL_FILE_HANDLE FileHandle;
- UINTN TotalSize;
- UINT8 *Buffer;
- UINT8 *Ptr;
- EDIT_FILE_TYPE BufferTypeBackup;
-
- BufferTypeBackup = HBufferImage.BufferType;
- HBufferImage.BufferType = FileTypeFileBuffer;
-
- //
- // if is the old file
- //
- if (HFileImage.FileName != NULL && FileName != NULL && StrCmp (FileName, HFileImage.FileName) == 0) {
- //
- // check whether file exists on disk
- //
- if (ShellIsFile(FileName) == EFI_SUCCESS) {
- //
- // current file exists on disk
- // so if not modified, then not save
- //
- if (HBufferImage.Modified == FALSE) {
- return EFI_SUCCESS;
- }
- //
- // if file is read-only, set error
- //
- if (HFileImage.ReadOnly == TRUE) {
- StatusBarSetStatusString (L"Read Only File Can Not Be Saved");
- return EFI_SUCCESS;
- }
- }
- }
-
- if (ShellIsDirectory(FileName) == EFI_SUCCESS) {
- StatusBarSetStatusString (L"Directory Can Not Be Saved");
- return EFI_LOAD_ERROR;
- }
-
- Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
-
- if (!EFI_ERROR (Status)) {
- //
- // the file exits, delete it
- //
- Status = ShellDeleteFile (&FileHandle);
- if (EFI_ERROR (Status) || Status == EFI_WARN_DELETE_FAILURE) {
- StatusBarSetStatusString (L"Write File Failed");
- return EFI_LOAD_ERROR;
- }
- }
-
- //
- // write all the lines back to disk
- //
- NumLines = 0;
- TotalSize = 0;
- for (Link = HBufferImage.ListHead->ForwardLink; Link != HBufferImage.ListHead; Link = Link->ForwardLink) {
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
-
- if (Line->Size != 0) {
- TotalSize += Line->Size;
- }
- //
- // end of if Line -> Size != 0
- //
- NumLines++;
- }
- //
- // end of for Link
- //
- Buffer = AllocateZeroPool (TotalSize);
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Ptr = Buffer;
- for (Link = HBufferImage.ListHead->ForwardLink; Link != HBufferImage.ListHead; Link = Link->ForwardLink) {
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
-
- if (Line->Size != 0) {
- CopyMem (Ptr, Line->Buffer, Line->Size);
- Ptr += Line->Size;
- }
- //
- // end of if Line -> Size != 0
- //
- }
-
-
- Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
-
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Create File Failed");
- return EFI_LOAD_ERROR;
- }
-
- Status = ShellWriteFile (FileHandle, &TotalSize, Buffer);
- FreePool (Buffer);
- if (EFI_ERROR (Status)) {
- ShellDeleteFile (&FileHandle);
- return EFI_LOAD_ERROR;
- }
-
- ShellCloseFile(&FileHandle);
-
- HBufferImage.Modified = FALSE;
-
- //
- // set status string
- //
- Str = CatSPrint(NULL, L"%d Lines Wrote", NumLines);
- StatusBarSetStatusString (Str);
- FreePool (Str);
-
- //
- // now everything is ready , you can set the new file name to filebuffer
- //
- if ((BufferTypeBackup != FileTypeFileBuffer && FileName != NULL) ||
- (FileName != NULL && HFileImage.FileName != NULL && StringNoCaseCompare (&FileName, &HFileImage.FileName) != 0)){
- //
- // not the same
- //
- HFileImageSetFileName (FileName);
- if (HFileImage.FileName == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- }
-
- HFileImage.ReadOnly = FALSE;
-
- return EFI_SUCCESS;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h
deleted file mode 100644
index ed27ad03ae..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/** @file
- Defines FileImage - the view of the file that is visible at any point,
- as well as the event handlers for editing the file
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_FILE_IMAGE_H_
-#define _LIB_FILE_IMAGE_H_
-
-#include "HexEditor.h"
-
-/**
- Initialization function for HFileImage
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HFileImageInit (
- VOID
- );
-
-/**
- Cleanup function for HFileImage.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HFileImageCleanup (
- VOID
- );
-
-/**
- Backup function for HFileImage. Only a few fields need to be backup.
- This is for making the file buffer refresh as few as possible.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-HFileImageBackup (
- VOID
- );
-
-/**
- Read a file from disk into HBufferImage.
-
- @param[in] FileName filename to read.
- @param[in] Recover if is for recover, no information print.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HFileImageRead (
- IN CONST CHAR16 *FileName,
- IN BOOLEAN Recover
- );
-
-/**
- Save lines in HBufferImage to disk.
-
- @param[in] FileName The file name.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HFileImageSave (
- IN CHAR16 *FileName
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c
deleted file mode 100644
index 68074d4244..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/** @file
- Main entry point of editor
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include "HexEditor.h"
-
-//
-// Global Variables
-//
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-f", TypeFlag},
- {L"-d", TypeFlag},
- {L"-m", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'hexedit' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunHexEdit (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- CHAR16 *Buffer;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- LIST_ENTRY *Package;
- CONST CHAR16 *Cwd;
- CHAR16 *NewName;
- CHAR16 *Spot;
- CONST CHAR16 *Name;
- UINTN Offset;
- UINTN Size;
- UINT64 LastOffset;
- EDIT_FILE_TYPE WhatToDo;
-
- Buffer = NULL;
- ShellStatus = SHELL_SUCCESS;
- NewName = NULL;
- Cwd = NULL;
- Buffer = NULL;
- Name = NULL;
- Spot = NULL;
- Offset = 0;
- Size = 0;
- LastOffset = 0;
- WhatToDo = FileTypeNone;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // Check for -d
- //
- if (ShellCommandLineGetFlag(Package, L"-d")){
- if (ShellCommandLineGetCount(Package) < 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) > 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- WhatToDo = FileTypeDiskBuffer;
- Name = ShellCommandLineGetRawValue(Package, 1);
- Offset = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 2));
- Size = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 3));
- }
- if (Offset == (UINTN)-1 || Size == (UINTN)-1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDebug1HiiHandle, L"-d");
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
-
- //
- // check for -f
- //
- if (ShellCommandLineGetFlag(Package, L"-f") && (WhatToDo == FileTypeNone)){
- if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Name = ShellCommandLineGetRawValue(Package, 1);
- if (Name == NULL || !IsValidFileName(Name)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Name);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- WhatToDo = FileTypeFileBuffer;
- }
- }
- }
-
- //
- // check for -m
- //
- if (ShellCommandLineGetFlag(Package, L"-m") && (WhatToDo == FileTypeNone)){
- if (ShellCommandLineGetCount(Package) < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- WhatToDo = FileTypeMemBuffer;
- Offset = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 1));
- Size = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 2));
- }
- }
- Name = ShellCommandLineGetRawValue(Package, 1);
- if (WhatToDo == FileTypeNone && Name != NULL) {
- if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (!IsValidFileName(Name)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Name);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- WhatToDo = FileTypeFileBuffer;
- }
- } else if (WhatToDo == FileTypeNone) {
- if (gEfiShellProtocol->GetCurDir(NULL) == NULL) {
- ShellStatus = SHELL_NOT_FOUND;
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle);
- } else {
- NewName = EditGetDefaultFileName(L"bin");
- Name = NewName;
- WhatToDo = FileTypeFileBuffer;
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS && WhatToDo == FileTypeNone) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (WhatToDo == FileTypeFileBuffer && ShellGetCurrentDir(NULL) == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Do the editor
- //
- Status = HMainEditorInit ();
- if (EFI_ERROR (Status)) {
- gST->ConOut->ClearScreen (gST->ConOut);
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_INIT_FAILED), gShellDebug1HiiHandle);
- } else {
- HMainEditorBackup ();
- switch (WhatToDo) {
- case FileTypeFileBuffer:
- Status = HBufferImageRead (
- Name==NULL?L"":Name,
- NULL,
- 0,
- 0,
- 0,
- 0,
- FileTypeFileBuffer,
- FALSE
- );
- break;
-
- case FileTypeDiskBuffer:
- Status = HBufferImageRead (
- NULL,
- Name==NULL?L"":Name,
- Offset,
- Size,
- 0,
- 0,
- FileTypeDiskBuffer,
- FALSE
- );
- break;
-
- case FileTypeMemBuffer:
- Status = HBufferImageRead (
- NULL,
- NULL,
- 0,
- 0,
- (UINT32) Offset,
- Size,
- FileTypeMemBuffer,
- FALSE
- );
- break;
-
- default:
- Status = EFI_NOT_FOUND;
- break;
- }
- if (!EFI_ERROR (Status)) {
- HMainEditorRefresh ();
- Status = HMainEditorKeyInput ();
- }
- if (Status != EFI_OUT_OF_RESOURCES) {
- //
- // back up the status string
- //
- Buffer = CatSPrint (NULL, L"%s\r\n", StatusBarGetString());
- }
- }
-
- //
- // cleanup
- //
- HMainEditorCleanup ();
-
- if (!EFI_ERROR (Status)) {
- if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = SHELL_UNSUPPORTED;
- }
- }
-
- //
- // print editor exit code on screen
- //
- if (Status == EFI_OUT_OF_RESOURCES) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle);
- } else if (EFI_ERROR(Status)){
- if (Buffer != NULL) {
- if (StrCmp (Buffer, L"") != 0) {
- //
- // print out the status string
- //
- ShellPrintEx(-1, -1, L"%s", Buffer);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_UNKNOWN_EDITOR), gShellDebug1HiiHandle);
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_UNKNOWN_EDITOR), gShellDebug1HiiHandle);
- }
- }
- }
- ShellCommandLineFreeVarList (Package);
- }
-
- SHELL_FREE_NON_NULL (Buffer);
- SHELL_FREE_NON_NULL (NewName);
- return ShellStatus;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditor.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditor.h
deleted file mode 100644
index d0a4bf4aae..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditor.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file
- Main include file for hex editor
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _EFI_SHELL_HEXEDIT_H_
-#define _EFI_SHELL_HEXEDIT_H_
-
-#include "UefiShellDebug1CommandsLib.h"
-#include "HexEditorTypes.h"
-
-#include "MainHexEditor.h"
-
-#include "BufferImage.h"
-#include "FileImage.h"
-#include "DiskImage.h"
-#include "MemImage.h"
-
-#include "EditTitleBar.h"
-#include "EditStatusBar.h"
-#include "EditInputBar.h"
-#include "EditMenuBar.h"
-
-#include "Misc.h"
-
-#include "Clipboard.h"
-
-extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
-extern BOOLEAN HEditorFirst;
-extern BOOLEAN HEditorExit;
-
-#endif // _HEDITOR_H
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
deleted file mode 100644
index 22f5c05566..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/** @file
- data types that are used by editor
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _HEDITOR_TYPE_H_
-#define _HEDITOR_TYPE_H_
-
-#include "UefiShellDebug1CommandsLib.h"
-#include "EditTitleBar.h"
-
-#define EFI_EDITOR_LINE_LIST SIGNATURE_32 ('e', 'e', 'l', 'l')
-
-#define ASCII_POSITION ((0x10 * 3) + 12)
-
-
-typedef struct {
- UINTN Row;
- UINTN Column;
-} HEFI_EDITOR_POSITION;
-
-typedef
-EFI_STATUS
-(*HEFI_MENU_ITEM_FUNCTION) (
- VOID
- );
-
-typedef struct {
- CHAR16 Name[50];
- CHAR16 Key[3];
- HEFI_MENU_ITEM_FUNCTION Function;
-} HMENU_ITEMS;
-
-typedef struct _HEFI_EDITOR_LINE {
- UINTN Signature;
- UINT8 Buffer[0x10];
- UINTN Size; // unit is Unicode
- LIST_ENTRY Link;
-} HEFI_EDITOR_LINE;
-
-typedef struct _HEFI_EDITOR_MENU_ITEM {
- CHAR16 NameToken;
- CHAR16 FunctionKeyToken;
- HEFI_MENU_ITEM_FUNCTION Function;
-} HEFI_EDITOR_MENU_ITEM;
-
-typedef struct {
- UINT32 Foreground : 4;
- UINT32 Background : 4;
-} HEFI_EDITOR_COLOR_ATTRIBUTES;
-
-typedef union {
- HEFI_EDITOR_COLOR_ATTRIBUTES Colors;
- UINT8 Data;
-} HEFI_EDITOR_COLOR_UNION;
-
-typedef struct {
- UINTN Columns;
- UINTN Rows;
-} HEFI_EDITOR_TEXT_MODE;
-
-
-typedef struct {
- CHAR16 *Name;
-
- UINTN BlockSize;
- UINTN Size;
- UINTN Offset;
-} HEFI_EDITOR_DISK_IMAGE;
-
-typedef struct {
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoFncs;
-
- UINTN Offset;
- UINTN Size;
-} HEFI_EDITOR_MEM_IMAGE;
-
-typedef struct {
- CHAR16 *FileName;
- UINTN Size; // file size
- BOOLEAN ReadOnly; // file is read-only or not
-} HEFI_EDITOR_FILE_IMAGE;
-
-typedef struct {
- LIST_ENTRY *ListHead; // list head of lines
- HEFI_EDITOR_LINE *Lines; // lines of current file
- UINTN NumLines; // number of lines
- HEFI_EDITOR_LINE *CurrentLine; // current line cursor is at
- HEFI_EDITOR_POSITION DisplayPosition; // cursor position in screen
- HEFI_EDITOR_POSITION MousePosition; // mouse position in screen
- HEFI_EDITOR_POSITION BufferPosition; // cursor position in buffer
- UINTN LowVisibleRow; // the lowest visible row of file position
- BOOLEAN HighBits; // cursor is at the high4 bits or low4 bits
- BOOLEAN Modified; // BUFFER is modified or not
- EDIT_FILE_TYPE BufferType;
-
- HEFI_EDITOR_FILE_IMAGE *FileImage;
- HEFI_EDITOR_DISK_IMAGE *DiskImage;
- HEFI_EDITOR_MEM_IMAGE *MemImage;
-
-} HEFI_EDITOR_BUFFER_IMAGE;
-
-typedef struct {
- HEFI_EDITOR_BUFFER_IMAGE *BufferImage;
-
- HEFI_EDITOR_COLOR_UNION ColorAttributes;
- HEFI_EDITOR_POSITION ScreenSize; // row number and column number
- BOOLEAN MouseSupported;
- EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;
- INT32 MouseAccumulatorX;
- INT32 MouseAccumulatorY;
-
- UINTN SelectStart; // starting from 1
- UINTN SelectEnd; // starting from 1
-} HEFI_EDITOR_GLOBAL_EDITOR;
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni
deleted file mode 100644
index 2b79381595..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
deleted file mode 100644
index 808f7a56c0..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
+++ /dev/null
@@ -1,2323 +0,0 @@
-/** @file
- Defines the Main Editor data type -
- - Global variables
- - Instances of the other objects of the editor
- - Main Interfaces
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "HexEditor.h"
-#include "EditStatusBar.h"
-#include "EditInputBar.h"
-
-HEFI_EDITOR_COLOR_ATTRIBUTES HOriginalColors;
-INTN HOriginalMode;
-
-//
-// the first time editor launch
-//
-BOOLEAN HEditorFirst;
-
-//
-// it's time editor should exit
-//
-BOOLEAN HEditorExit;
-
-BOOLEAN HEditorMouseAction;
-
-extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
-extern HEFI_EDITOR_BUFFER_IMAGE HBufferImageBackupVar;
-
-extern BOOLEAN HBufferImageMouseNeedRefresh;
-extern BOOLEAN HBufferImageNeedRefresh;
-extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
-
-HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
-HEFI_EDITOR_GLOBAL_EDITOR HMainEditorBackupVar;
-
-//
-// basic initialization for MainEditor
-//
-HEFI_EDITOR_GLOBAL_EDITOR HMainEditorConst = {
- &HBufferImage,
- {
- 0,
- 0
- },
- {
- 0,
- 0
- },
- FALSE,
- NULL,
- 0,
- 0,
- 1,
- 1
-};
-
-/**
- Help info that will be displayed.
-**/
-EFI_STRING_ID HexMainMenuHelpInfo[] = {
- STRING_TOKEN(STR_HEXEDIT_HELP_TITLE),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_LIST_TITLE),
- STRING_TOKEN(STR_HEXEDIT_HELP_DIV),
- STRING_TOKEN(STR_HEXEDIT_HELP_GO_TO_OFFSET),
- STRING_TOKEN(STR_HEXEDIT_HELP_SAVE_BUFFER),
- STRING_TOKEN(STR_HEXEDIT_HELP_EXIT),
- STRING_TOKEN(STR_HEXEDIT_HELP_SELECT_START),
- STRING_TOKEN(STR_HEXEDIT_HELP_SELECT_END),
- STRING_TOKEN(STR_HEXEDIT_HELP_CUT),
- STRING_TOKEN(STR_HEXEDIT_HELP_PASTE),
- STRING_TOKEN(STR_HEXEDIT_HELP_OPEN_FILE),
- STRING_TOKEN(STR_HEXEDIT_HELP_OPEN_DISK),
- STRING_TOKEN(STR_HEXEDIT_HELP_OPEN_MEMORY),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_EXIT_HELP),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_DIV),
- 0
-};
-
-
-/**
- show help menu.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HMainCommandDisplayHelp (
- VOID
- )
-{
- INT32 CurrentLine;
- CHAR16 * InfoString;
- EFI_INPUT_KEY Key;
-
- CurrentLine = 0;
- // print helpInfo
- for (CurrentLine = 0; 0 != HexMainMenuHelpInfo[CurrentLine]; CurrentLine++) {
- InfoString = HiiGetString(gShellDebug1HiiHandle, HexMainMenuHelpInfo[CurrentLine]
-, NULL);
- ShellPrintEx (0,CurrentLine+1,L"%E%s%N",InfoString);
- }
-
- // scan for ctrl+w
- do {
- gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- } while(SCAN_CONTROL_W != Key.UnicodeChar);
-
- // update screen with buffer's info
- HBufferImageNeedRefresh = TRUE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- HBufferImageRefresh ();
-
- return EFI_SUCCESS;
-}
-
-/**
- Move cursor to specified lines.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HMainCommandGoToOffset (
- VOID
- )
-{
- UINTN Size;
- UINT64 Offset;
- EFI_STATUS Status;
- UINTN FRow;
- UINTN FCol;
-
- //
- // variable initialization
- //
- Size = 0;
- Offset = 0;
- FRow = 0;
- FCol = 0;
-
- //
- // get offset
- //
- Status = InputBarSetPrompt (L"Go To Offset: ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (8);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- while (1) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
-
- return EFI_SUCCESS;
- }
- //
- // THE input string length should > 0
- //
- if (StrLen (InputBarGetString()) > 0) {
- Status = ShellConvertStringToUint64 (InputBarGetString(), &Offset, TRUE, FALSE);
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Invalid Offset");
- return EFI_SUCCESS;
- }
-
- break;
- }
- }
-
- Size = HBufferImageGetTotalSize ();
- if (Offset >= Size) {
- StatusBarSetStatusString (L"Invalid Offset");
- return EFI_SUCCESS;
- }
-
- FRow = (UINTN)DivU64x32(Offset , 0x10) + 1;
- FCol = (UINTN)ModU64x32(Offset , 0x10) + 1;
-
- HBufferImageMovePosition (FRow, FCol, TRUE);
-
- HBufferImageNeedRefresh = TRUE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- HBufferImageMouseNeedRefresh = TRUE;
-
- return EFI_SUCCESS;
-}
-
-/**
- Save current opened buffer.
- If is file buffer, you can save to current file name or
- save to another file name.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainCommandSaveBuffer (
- VOID
- )
-{
- EFI_STATUS Status;
- BOOLEAN Done;
- CHAR16 *FileName;
- BOOLEAN OldFile;
- CHAR16 *Str;
- EFI_FILE_INFO *Info;
- SHELL_FILE_HANDLE ShellFileHandle;
-
- if (HMainEditor.BufferImage->BufferType != FileTypeFileBuffer) {
- if (!HMainEditor.BufferImage->Modified) {
- return EFI_SUCCESS;
- }
-
- Status = InputBarSetPrompt (L"Dangerous to save disk/mem buffer. Save (Yes/No/Cancel) ? ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // the answer is just one character
- //
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // loop for user's answer
- // valid answer is just 'y' 'Y', 'n' 'N', 'c' 'C'
- //
- while (1) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // want to save this buffer first
- //
- Status = HBufferImageSave (
- NULL,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- HMainEditor.BufferImage->BufferType
- );
-
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"BufferSave: Problems Writing");
- return Status;
- }
-
- return EFI_SUCCESS;
-
- case L'n':
- case L'N':
- //
- // the file won't be saved
- //
- return EFI_SUCCESS;
- break;
-
- case L'c':
- case L'C':
- return EFI_SUCCESS;
- }
- //
- // end of switch
- //
- }
- //
- // ENDOF WHILE
- //
- }
- //
- // ENDOF != FILEBUFFER
- //
- // This command will save currently opened file to disk.
- // You can choose save to another file name or just save to
- // current file name.
- // Below is the scenario of Save File command: (
- // Suppose the old file name is A )
- // 1. An Input Bar will be prompted: "File To Save: [ old file name]"
- // IF user press ESC, Save File command ends .
- // IF user press Enter, input file name will be A.
- // IF user inputs a new file name B, input file name will be B.
- //
- // 2. IF input file name is A, go to do Step 3.
- // IF input file name is B, go to do Step 4.
- //
- // 3. IF A is read only, Status Bar will show "Access Denied"
- // and Save File commands ends.
- // IF A is not read only, save file buffer to disk
- // and remove Modified flag in Title Bar , then Save File command ends.
- //
- // 4. IF B does not exist, create this file and save file buffer to it.
- // Go to do Step 7.
- // IF B exits, do Step 5.
- //
- // 5. An Input Bar will be prompted:
- // "File Exists. Overwrite ( Yes/No/Cancel ) ?"
- // IF user press 'y' or 'Y', do Step 6.
- // IF user press 'n' or 'N', Save File commands ends.
- // IF user press 'c' or 'C' or ESC, Save File commands ends.
- //
- // 6. IF B is a read-only file, Status Bar will show "Access Denied"
- // and Save File commands ends.
- // IF B can be read and write, save file buffer to B.
- //
- // 7. Update File Name field in Title Bar to B
- // and remove the Modified flag in Title Bar.
- //
- Str = CatSPrint(NULL,
- L"File to Save: [%s]",
- HMainEditor.BufferImage->FileImage->FileName
- );
- if (Str == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- if (StrLen (Str) >= 50) {
- //
- // replace the long file name with "..."
- //
- Str[46] = L'.';
- Str[47] = L'.';
- Str[48] = L'.';
- Str[49] = L']';
- Str[50] = L'\0';
- }
-
- Status = InputBarSetPrompt (Str);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (100);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // get new file name
- //
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // if user pressed ESC
- //
- if (Status == EFI_NOT_READY) {
- SHELL_FREE_NON_NULL (Str);
- return EFI_SUCCESS;
- }
-
- SHELL_FREE_NON_NULL (Str);
-
- //
- // if just enter pressed, so think save to current file name
- //
- if (StrLen (InputBarGetString()) == 0) {
- FileName = CatSPrint(NULL,
- L"%s",
- HMainEditor.BufferImage->FileImage->FileName
- );
- } else {
- FileName = CatSPrint(NULL, L"%s", InputBarGetString());
- }
-
- if (FileName == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- if (!IsValidFileName (FileName)) {
- StatusBarSetStatusString (L"Invalid File Name");
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
- }
-
- OldFile = FALSE;
-
- //
- // save to the old file
- //
- if (StringNoCaseCompare (
- &FileName,
- &HMainEditor.BufferImage->FileImage->FileName
- ) == 0) {
- OldFile = TRUE;
- }
-
- if (OldFile) {
- //
- // if the file is read only, so can not write back to it.
- //
- if (HMainEditor.BufferImage->FileImage->ReadOnly) {
- StatusBarSetStatusString (L"Access Denied");
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
- }
- } else {
- Status = ShellOpenFileByName (FileName, &ShellFileHandle, EFI_FILE_MODE_READ, 0);
-
- if (!EFI_ERROR (Status)) {
-
- Info = ShellGetFileInfo(ShellFileHandle);
-
- ShellCloseFile(&ShellFileHandle);
- //
- // check if read only
- //
- if (Info->Attribute & EFI_FILE_READ_ONLY) {
- StatusBarSetStatusString (L"Access Denied");
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
- }
-
- SHELL_FREE_NON_NULL(Info);
- //
- // ask user whether to overwrite this file
- //
- Status = InputBarSetPrompt (L"File exists. Overwrite (Yes/No/Cancel) ? ");
- if (EFI_ERROR (Status)) {
- SHELL_FREE_NON_NULL (FileName);
- return Status;
- }
-
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- SHELL_FREE_NON_NULL (FileName);
- return Status;
- }
-
- Done = FALSE;
- while (!Done) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- if (Status == EFI_NOT_READY) {
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- Done = TRUE;
- break;
- case L'n':
- case L'N':
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
- case L'c':
- case L'C':
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
- } // switch
- } // while
- } // if opened existing file
- } // if OldFile
-
- //
- // save file back to disk
- //
- Status = HBufferImageSave (
- FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- FileTypeFileBuffer
- );
- SHELL_FREE_NON_NULL (FileName);
-
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Load a disk buffer editor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainCommandSelectStart (
- VOID
- )
-{
- UINTN Start;
-
- Start = (HMainEditor.BufferImage->BufferPosition.Row - 1) * 0x10 + HMainEditor.BufferImage->BufferPosition.Column;
-
- //
- // last line
- //
- if (HMainEditor.BufferImage->CurrentLine->Link.ForwardLink == HMainEditor.BufferImage->ListHead) {
- if (HMainEditor.BufferImage->BufferPosition.Column > HMainEditor.BufferImage->CurrentLine->Size) {
- StatusBarSetStatusString (L"Invalid Block Start");
- return EFI_LOAD_ERROR;
- }
- }
-
- if (HMainEditor.SelectEnd != 0 && Start > HMainEditor.SelectEnd) {
- StatusBarSetStatusString (L"Invalid Block Start");
- return EFI_LOAD_ERROR;
- }
-
- HMainEditor.SelectStart = Start;
-
- HBufferImageNeedRefresh = TRUE;
-
- return EFI_SUCCESS;
-}
-
-/**
- Load a disk buffer editor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainCommandSelectEnd (
- VOID
- )
-{
- UINTN End;
-
- End = (HMainEditor.BufferImage->BufferPosition.Row - 1) * 0x10 + HMainEditor.BufferImage->BufferPosition.Column;
-
- //
- // last line
- //
- if (HMainEditor.BufferImage->CurrentLine->Link.ForwardLink == HMainEditor.BufferImage->ListHead) {
- if (HMainEditor.BufferImage->BufferPosition.Column > HMainEditor.BufferImage->CurrentLine->Size) {
- StatusBarSetStatusString (L"Invalid Block End");
- return EFI_LOAD_ERROR;
- }
- }
-
- if (HMainEditor.SelectStart != 0 && End < HMainEditor.SelectStart) {
- StatusBarSetStatusString (L"Invalid Block End");
- return EFI_SUCCESS;
- }
-
- HMainEditor.SelectEnd = End;
-
- HBufferImageNeedRefresh = TRUE;
-
- return EFI_SUCCESS;
-}
-
-/**
- Cut current line to clipboard.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainCommandCut (
- VOID
- )
-{
- UINTN Index;
- HEFI_EDITOR_LINE *Line;
- LIST_ENTRY *Link;
- UINT8 *Buffer;
- UINTN Count;
-
- //
- // not select, so not allowed to cut
- //
- if (HMainEditor.SelectStart == 0) {
- StatusBarSetStatusString (L"No Block is Selected");
- return EFI_SUCCESS;
- }
- //
- // not select, so not allowed to cut
- //
- if (HMainEditor.SelectEnd == 0) {
- StatusBarSetStatusString (L"No Block is Selected");
- return EFI_SUCCESS;
- }
-
- Link = HMainEditor.BufferImage->ListHead->ForwardLink;
- for (Index = 0; Index < (HMainEditor.SelectEnd - 1) / 0x10; Index++) {
- Link = Link->ForwardLink;
- }
-
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
-
- Count = HMainEditor.SelectEnd - HMainEditor.SelectStart + 1;
- Buffer = AllocateZeroPool (Count);
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // cut the selected area
- //
- HBufferImageDeleteCharacterFromBuffer (
- HMainEditor.SelectStart - 1,
- Count,
- Buffer
- );
-
- //
- // put to clipboard
- //
- HClipBoardSet (Buffer, Count);
-
- HBufferImageNeedRefresh = TRUE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
-
- if (!HMainEditor.BufferImage->Modified) {
- HMainEditor.BufferImage->Modified = TRUE;
- }
-
- //
- // now no select area
- //
- HMainEditor.SelectStart = 0;
- HMainEditor.SelectEnd = 0;
-
- return EFI_SUCCESS;
-}
-
-/**
- Paste line to file buffer.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainCommandPaste (
- VOID
- )
-{
-
- BOOLEAN OnlyLineRefresh;
- HEFI_EDITOR_LINE *Line;
- UINT8 *Buffer;
- UINTN Count;
- UINTN FPos;
-
- Count = HClipBoardGet (&Buffer);
- if (Count == 0 || Buffer == NULL) {
- StatusBarSetStatusString (L"Nothing to Paste");
- return EFI_SUCCESS;
- }
-
- Line = HMainEditor.BufferImage->CurrentLine;
-
- OnlyLineRefresh = FALSE;
- if (Line->Link.ForwardLink == HMainEditor.BufferImage->ListHead && Line->Size + Count < 0x10) {
- //
- // is at last line, and after paste will not exceed
- // so only this line need to be refreshed
- //
- // if after add, the line is 0x10, then will append a new line
- // so the whole page will need be refreshed
- //
- OnlyLineRefresh = TRUE;
-
- }
-
- FPos = 0x10 * (HMainEditor.BufferImage->BufferPosition.Row - 1) + HMainEditor.BufferImage->BufferPosition.Column - 1;
-
- HBufferImageAddCharacterToBuffer (FPos, Count, Buffer);
-
- if (OnlyLineRefresh) {
- HBufferImageNeedRefresh = FALSE;
- HBufferImageOnlyLineNeedRefresh = TRUE;
- } else {
- HBufferImageNeedRefresh = TRUE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- }
-
- if (!HMainEditor.BufferImage->Modified) {
- HMainEditor.BufferImage->Modified = TRUE;
- }
-
- return EFI_SUCCESS;
-
-}
-
-/**
- Exit editor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainCommandExit (
- VOID
- )
-{
- EFI_STATUS Status;
-
- //
- // Below is the scenario of Exit command:
- // 1. IF currently opened file is not modified, exit the editor and
- // Exit command ends.
- // IF currently opened file is modified, do Step 2
- //
- // 2. An Input Bar will be prompted:
- // "File modified. Save ( Yes/No/Cancel )?"
- // IF user press 'y' or 'Y', currently opened file will be saved and
- // Editor exits
- // IF user press 'n' or 'N', currently opened file will not be saved
- // and Editor exits.
- // IF user press 'c' or 'C' or ESC, Exit command ends.
- //
- //
- // if file has been modified, so will prompt user
- // whether to save the changes
- //
- if (HMainEditor.BufferImage->Modified) {
-
- Status = InputBarSetPrompt (L"Buffer modified. Save (Yes/No/Cancel) ? ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- while (1) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // write file back to disk
- //
- Status = HBufferImageSave (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- HMainEditor.BufferImage->BufferType
- );
- if (!EFI_ERROR (Status)) {
- HEditorExit = TRUE;
- }
-
- return Status;
-
- case L'n':
- case L'N':
- HEditorExit = TRUE;
- return EFI_SUCCESS;
-
- case L'c':
- case L'C':
- return EFI_SUCCESS;
-
- }
- }
- }
-
- HEditorExit = TRUE;
- return EFI_SUCCESS;
-
-}
-
-/**
- Load a file from disk to editor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainCommandOpenFile (
- VOID
- )
-{
- BOOLEAN Done;
- EFI_STATUS Status;
- EDIT_FILE_TYPE BufferType;
-
- BufferType = HMainEditor.BufferImage->BufferType;
-
- //
- // This command will open a file from current working directory.
- // Read-only file can also be opened. But it can not be modified.
- // Below is the scenario of Open File command:
- // 1. IF currently opened file has not been modified, directly go to step .
- // IF currently opened file has been modified, an Input Bar will be
- // prompted as :
- // "File Modified. Save ( Yes/No/Cancel) ?"
- // IF user press 'y' or 'Y', currently opened file will be saved.
- // IF user press 'n' or 'N', currently opened file will
- // not be saved.
- // IF user press 'c' or 'C' or ESC, Open File command ends and
- // currently opened file is still opened.
- //
- // 2. An Input Bar will be prompted as : "File Name to Open: "
- // IF user press ESC, Open File command ends and
- // currently opened file is still opened.
- // Any other inputs with a Return will cause
- // currently opened file close.
- //
- // 3. IF user input file name is an existing file ,
- // this file will be read and opened.
- // IF user input file name is a new file, this file will be created
- // and opened. This file's type ( UNICODE or ASCII ) is the same with
- // the old file.
- //
- //
- // if current file is modified, so you need to choose whether to
- // save it first.
- //
- if (HMainEditor.BufferImage->Modified) {
-
- Status = InputBarSetPrompt (L"Buffer modified. Save (Yes/No/Cancel) ? ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // the answer is just one character
- //
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // loop for user's answer
- // valid answer is just 'y' 'Y', 'n' 'N', 'c' 'C'
- //
- Done = FALSE;
- while (!Done) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // want to save this buffer first
- //
- Status = HBufferImageSave (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- HMainEditor.BufferImage->BufferType
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- MainTitleBarRefresh (
- HMainEditor.BufferImage->BufferType == FileTypeFileBuffer?HMainEditor.BufferImage->FileImage->FileName:HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Name:NULL,
- HMainEditor.BufferImage->BufferType,
- HMainEditor.BufferImage->FileImage->ReadOnly,
- FALSE,
- HMainEditor.ScreenSize.Column,
- HMainEditor.ScreenSize.Row,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Offset:HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Offset:0,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Size :HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Size :0
- );
- Done = TRUE;
- break;
-
- case L'n':
- case L'N':
- //
- // the file won't be saved
- //
- Done = TRUE;
- break;
-
- case L'c':
- case L'C':
- return EFI_SUCCESS;
- }
- }
- }
- //
- // TO get the open file name
- //
- Status = InputBarSetPrompt (L"File Name to Open: ");
- if (EFI_ERROR (Status)) {
- HBufferImageRead (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType,
- TRUE
- );
- return Status;
- }
-
- Status = InputBarSetStringSize (100);
- if (EFI_ERROR (Status)) {
- Status = HBufferImageRead (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType,
- TRUE
- );
- return Status;
- }
-
- while (1) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- Status = HBufferImageRead (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType,
- TRUE
- );
-
- return Status;
- }
- //
- // THE input string length should > 0
- //
- if (StrLen (InputBarGetString()) > 0) {
- //
- // CHECK if filename's valid
- //
- if (!IsValidFileName (InputBarGetString())) {
- HBufferImageRead (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType,
- TRUE
- );
-
- StatusBarSetStatusString (L"Invalid File Name");
- return EFI_SUCCESS;
- }
-
- break;
- }
- }
- //
- // read from disk
- //
- Status = HBufferImageRead (
- InputBarGetString(),
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- FileTypeFileBuffer,
- FALSE
- );
-
- if (EFI_ERROR (Status)) {
- HBufferImageRead (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType,
- TRUE
- );
-
- return EFI_LOAD_ERROR;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Load a disk buffer editor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_NOT_FOUND The disk was not found.
-**/
-EFI_STATUS
-HMainCommandOpenDisk (
- VOID
- )
-{
- UINT64 Size;
- UINT64 Offset;
- CHAR16 *DeviceName;
- EFI_STATUS Status;
- BOOLEAN Done;
-
- EDIT_FILE_TYPE BufferType;
-
- //
- // variable initialization
- //
- Size = 0;
- Offset = 0;
- BufferType = HMainEditor.BufferImage->BufferType;
-
- //
- // if current file is modified, so you need to choose
- // whether to save it first.
- //
- if (HMainEditor.BufferImage->Modified) {
-
- Status = InputBarSetPrompt (L"Buffer modified. Save (Yes/No/Cancel) ? ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // the answer is just one character
- //
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // loop for user's answer
- // valid answer is just 'y' 'Y', 'n' 'N', 'c' 'C'
- //
- Done = FALSE;
- while (!Done) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // want to save this buffer first
- //
- Status = HBufferImageSave (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- MainTitleBarRefresh (
- HMainEditor.BufferImage->BufferType == FileTypeFileBuffer?HMainEditor.BufferImage->FileImage->FileName:HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Name:NULL,
- HMainEditor.BufferImage->BufferType,
- HMainEditor.BufferImage->FileImage->ReadOnly,
- FALSE,
- HMainEditor.ScreenSize.Column,
- HMainEditor.ScreenSize.Row,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Offset:HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Offset:0,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Size :HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Size :0
- );
- Done = TRUE;
- break;
-
- case L'n':
- case L'N':
- //
- // the file won't be saved
- //
- Done = TRUE;
- break;
-
- case L'c':
- case L'C':
- return EFI_SUCCESS;
- }
- }
- }
- //
- // get disk block device name
- //
- Status = InputBarSetPrompt (L"Block Device to Open: ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (100);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- while (1) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
-
- return EFI_SUCCESS;
- }
- //
- // THE input string length should > 0
- //
- if (StrLen (InputBarGetString()) > 0) {
- break;
- }
- }
-
- DeviceName = CatSPrint(NULL, L"%s", InputBarGetString());
- if (DeviceName == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // get starting offset
- //
- Status = InputBarSetPrompt (L"First Block No.: ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (16);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- while (1) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
-
- return EFI_SUCCESS;
- }
- //
- // THE input string length should > 0
- //
- if (StrLen (InputBarGetString()) > 0) {
- Status = ShellConvertStringToUint64 (InputBarGetString(), &Offset, TRUE, FALSE);
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- break;
- }
- }
- //
- // get Number of Blocks:
- //
- Status = InputBarSetPrompt (L"Number of Blocks: ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (8);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- while (1) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
-
- return EFI_SUCCESS;
- }
- //
- // THE input string length should > 0
- //
- if (StrLen (InputBarGetString()) > 0) {
- Status = ShellConvertStringToUint64 (InputBarGetString(), &Size, TRUE, FALSE);
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- if (Size == 0) {
- continue;
- }
-
- break;
- }
- }
-
- Status = HBufferImageRead (
- NULL,
- DeviceName,
- (UINTN)Offset,
- (UINTN)Size,
- 0,
- 0,
- FileTypeDiskBuffer,
- FALSE
- );
-
- if (EFI_ERROR (Status)) {
-
- HBufferImageRead (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType,
- TRUE
- );
- return EFI_NOT_FOUND;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Load memory content to editor
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_NOT_FOUND The disk was not found.
-**/
-EFI_STATUS
-HMainCommandOpenMemory (
- VOID
- )
-{
- UINT64 Size;
- UINT64 Offset;
- EFI_STATUS Status;
- BOOLEAN Done;
- EDIT_FILE_TYPE BufferType;
-
- //
- // variable initialization
- //
- Size = 0;
- Offset = 0;
- BufferType = HMainEditor.BufferImage->BufferType;
-
- //
- // if current buffer is modified, so you need to choose
- // whether to save it first.
- //
- if (HMainEditor.BufferImage->Modified) {
-
- Status = InputBarSetPrompt (L"Buffer modified. Save (Yes/No/Cancel) ? ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // the answer is just one character
- //
- Status = InputBarSetStringSize (1);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // loop for user's answer
- // valid answer is just 'y' 'Y', 'n' 'N', 'c' 'C'
- //
- Done = FALSE;
- while (!Done) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
- return EFI_SUCCESS;
- }
-
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // want to save this buffer first
- //
- Status = HBufferImageSave (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- MainTitleBarRefresh (
- HMainEditor.BufferImage->BufferType == FileTypeFileBuffer?HMainEditor.BufferImage->FileImage->FileName:HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Name:NULL,
- HMainEditor.BufferImage->BufferType,
- HMainEditor.BufferImage->FileImage->ReadOnly,
- FALSE,
- HMainEditor.ScreenSize.Column,
- HMainEditor.ScreenSize.Row,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Offset:HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Offset:0,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Size :HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Size :0
- );
- Done = TRUE;
- break;
-
- case L'n':
- case L'N':
- //
- // the file won't be saved
- //
- Done = TRUE;
- break;
-
- case L'c':
- case L'C':
- return EFI_SUCCESS;
- }
- }
- }
- //
- // get starting offset
- //
- Status = InputBarSetPrompt (L"Starting Offset: ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (8);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- while (1) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
-
- return EFI_SUCCESS;
- }
- //
- // THE input string length should > 0
- //
- if (StrLen (InputBarGetString()) > 0) {
- Status = ShellConvertStringToUint64 (InputBarGetString(), &Offset, TRUE, FALSE);
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- break;
- }
- }
- //
- // get Number of Blocks:
- //
- Status = InputBarSetPrompt (L"Buffer Size: ");
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = InputBarSetStringSize (8);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- while (1) {
- Status = InputBarRefresh (HMainEditor.ScreenSize.Row, HMainEditor.ScreenSize.Column);
-
- //
- // ESC pressed
- //
- if (Status == EFI_NOT_READY) {
-
- return EFI_SUCCESS;
- }
- //
- // THE input string length should > 0
- //
- if (StrLen (InputBarGetString()) > 0) {
- Status = ShellConvertStringToUint64 (InputBarGetString(), &Size, TRUE, FALSE);
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- if (Size == 0) {
- continue;
- }
-
- break;
- }
- }
-
- if ((Offset + Size - 1)> 0xffffffff) {
- StatusBarSetStatusString (L"Invalid parameter");
- return EFI_LOAD_ERROR;
- }
-
- Status = HBufferImageRead (
- NULL,
- NULL,
- 0,
- 0,
- (UINTN)Offset,
- (UINTN)Size,
- FileTypeMemBuffer,
- FALSE
- );
-
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Read Device Error!");
- HBufferImageRead (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType,
- TRUE
- );
- return EFI_NOT_FOUND;
- }
- return EFI_SUCCESS;
-
-}
-
-MENU_ITEM_FUNCTION HexMainControlBasedMenuFunctions[] = {
- NULL,
- NULL, /* Ctrl - A */
- NULL, /* Ctrl - B */
- NULL, /* Ctrl - C */
- HMainCommandSelectEnd, /* Ctrl - D */
- HMainCommandDisplayHelp, /* Ctrl - E */
- NULL, /* Ctrl - F */
- HMainCommandGoToOffset, /* Ctrl - G */
- NULL, /* Ctrl - H */
- HMainCommandOpenDisk, /* Ctrl - I */
- NULL, /* Ctrl - J */
- NULL, /* Ctrl - K */
- NULL, /* Ctrl - L */
- HMainCommandOpenMemory, /* Ctrl - M */
- NULL, /* Ctrl - N */
- HMainCommandOpenFile, /* Ctrl - O */
- NULL, /* Ctrl - P */
- HMainCommandExit, /* Ctrl - Q */
- NULL, /* Ctrl - R */
- HMainCommandSaveBuffer, /* Ctrl - S */
- HMainCommandSelectStart, /* Ctrl - T */
- NULL, /* Ctrl - U */
- HMainCommandPaste, /* Ctrl - V */
- NULL, /* Ctrl - W */
- HMainCommandCut, /* Ctrl - X */
- NULL, /* Ctrl - Y */
- NULL, /* Ctrl - Z */
-};
-
-CONST EDITOR_MENU_ITEM HexEditorMenuItems[] = {
- {
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_GO_TO_OFFSET),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F1),
- HMainCommandGoToOffset
- },
- {
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_SAVE_BUFFER),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F2),
- HMainCommandSaveBuffer
- },
- {
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_EXIT),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F3),
- HMainCommandExit
- },
-
- {
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_SELECT_START),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F4),
- HMainCommandSelectStart
- },
- {
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_SELECT_END),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F5),
- HMainCommandSelectEnd
- },
- {
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_CUT),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F6),
- HMainCommandCut
- },
- {
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_PASTE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F7),
- HMainCommandPaste
- },
-
- {
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_OPEN_FILE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F8),
- HMainCommandOpenFile
- },
- {
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_OPEN_DISK),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F9),
- HMainCommandOpenDisk
- },
- {
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_OPEN_MEMORY),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F10),
- HMainCommandOpenMemory
- },
-
- {
- 0,
- 0,
- NULL
- }
-};
-
-/**
- Init function for MainEditor
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainEditorInit (
- VOID
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *HandleBuffer;
- UINTN HandleCount;
- UINTN Index;
-
- //
- // basic initialization
- //
- CopyMem (&HMainEditor, &HMainEditorConst, sizeof (HMainEditor));
-
- //
- // set screen attributes
- //
- HMainEditor.ColorAttributes.Colors.Foreground = gST->ConOut->Mode->Attribute & 0x000000ff;
-
- HMainEditor.ColorAttributes.Colors.Background = (UINT8) (gST->ConOut->Mode->Attribute >> 4);
-
- HOriginalColors = HMainEditor.ColorAttributes.Colors;
-
- HOriginalMode = gST->ConOut->Mode->Mode;
-
- //
- // query screen size
- //
- gST->ConOut->QueryMode (
- gST->ConOut,
- gST->ConOut->Mode->Mode,
- &(HMainEditor.ScreenSize.Column),
- &(HMainEditor.ScreenSize.Row)
- );
-
- //
- // Find mouse in System Table ConsoleInHandle
- //
- Status = gBS->HandleProtocol (
- gST->ConIn,
- &gEfiSimplePointerProtocolGuid,
- (VOID**)&HMainEditor.MouseInterface
- );
- if (EFI_ERROR (Status)) {
- //
- // If there is no Simple Pointer Protocol on System Table
- //
- HandleBuffer = NULL;
- HMainEditor.MouseInterface = NULL;
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiSimplePointerProtocolGuid,
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- if (!EFI_ERROR (Status) && HandleCount > 0) {
- //
- // Try to find the first available mouse device
- //
- for (Index = 0; Index < HandleCount; Index++) {
- Status = gBS->HandleProtocol (
- HandleBuffer[Index],
- &gEfiSimplePointerProtocolGuid,
- (VOID**)&HMainEditor.MouseInterface
- );
- if (!EFI_ERROR (Status)) {
- break;
- }
- }
- }
- if (HandleBuffer != NULL) {
- FreePool (HandleBuffer);
- }
- }
-
- if (!EFI_ERROR (Status) && HMainEditor.MouseInterface != NULL) {
- HMainEditor.MouseAccumulatorX = 0;
- HMainEditor.MouseAccumulatorY = 0;
- HMainEditor.MouseSupported = TRUE;
- }
-
- //
- // below will call the five components' init function
- //
- Status = MainTitleBarInit (NULL);
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_TITLE), gShellDebug1HiiHandle);
- return EFI_LOAD_ERROR;
- }
-
- Status = ControlHotKeyInit (HexMainControlBasedMenuFunctions);
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_MAINMENU), gShellDebug1HiiHandle);
- return EFI_LOAD_ERROR;
- }
- Status = MenuBarInit (HexEditorMenuItems);
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_MAINMENU), gShellDebug1HiiHandle);
- return EFI_LOAD_ERROR;
- }
-
- Status = StatusBarInit ();
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_STATUS), gShellDebug1HiiHandle);
- return EFI_LOAD_ERROR;
- }
-
- InputBarInit ();
-
- Status = HBufferImageInit ();
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_BUFFERIMAGE), gShellDebug1HiiHandle);
- return EFI_LOAD_ERROR;
- }
-
- Status = HClipBoardInit ();
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_CLIPBOARD), gShellDebug1HiiHandle);
- return EFI_LOAD_ERROR;
- }
- //
- // clear whole screen and enable cursor
- //
- gST->ConOut->ClearScreen (gST->ConOut);
- gST->ConOut->EnableCursor (gST->ConOut, TRUE);
-
- //
- // initialize EditorFirst and EditorExit
- //
- HEditorFirst = TRUE;
- HEditorExit = FALSE;
- HEditorMouseAction = FALSE;
-
- return EFI_SUCCESS;
-}
-
-/**
- Cleanup function for MainEditor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainEditorCleanup (
- VOID
- )
-{
- EFI_STATUS Status;
-
- //
- // call the five components' cleanup function
- //
- MainTitleBarCleanup ();
-
- MenuBarCleanup ();
-
- StatusBarCleanup ();
-
- InputBarCleanup ();
-
- Status = HBufferImageCleanup ();
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_BUFFERIMAGE_CLEAN), gShellDebug1HiiHandle);
- }
-
- Status = HClipBoardCleanup ();
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_CLIPBOARD_CLEAN), gShellDebug1HiiHandle);
- }
- //
- // restore old mode
- //
- if (HOriginalMode != gST->ConOut->Mode->Mode) {
- gST->ConOut->SetMode (gST->ConOut, HOriginalMode);
- }
-
- gST->ConOut->SetAttribute (
- gST->ConOut,
- EFI_TEXT_ATTR (HOriginalColors.Foreground, HOriginalColors.Background)
- );
- gST->ConOut->ClearScreen (gST->ConOut);
-
- return EFI_SUCCESS;
-}
-
-/**
- Refresh function for MainEditor.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HMainEditorRefresh (
- VOID
- )
-{
- BOOLEAN NameChange;
- BOOLEAN ReadChange;
-
- NameChange = FALSE;
- ReadChange = FALSE;
-
- if (HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer) {
- if (HMainEditor.BufferImage->DiskImage != NULL &&
- HBufferImageBackupVar.DiskImage != NULL &&
- (HMainEditor.BufferImage->DiskImage->Offset != HBufferImageBackupVar.DiskImage->Offset ||
- HMainEditor.BufferImage->DiskImage->Size != HBufferImageBackupVar.DiskImage->Size) ){
- NameChange = TRUE;
- }
- } else if (HMainEditor.BufferImage->BufferType == FileTypeMemBuffer) {
- if (HMainEditor.BufferImage->MemImage != NULL &&
- HBufferImageBackupVar.MemImage != NULL &&
- (HMainEditor.BufferImage->MemImage->Offset != HBufferImageBackupVar.MemImage->Offset ||
- HMainEditor.BufferImage->MemImage->Size != HBufferImageBackupVar.MemImage->Size) ){
- NameChange = TRUE;
- }
- } else if (HMainEditor.BufferImage->BufferType == FileTypeFileBuffer) {
- if ( HMainEditor.BufferImage->FileImage != NULL &&
- HMainEditor.BufferImage->FileImage->FileName != NULL &&
- HBufferImageBackupVar.FileImage != NULL &&
- HBufferImageBackupVar.FileImage->FileName != NULL &&
- StrCmp (HMainEditor.BufferImage->FileImage->FileName, HBufferImageBackupVar.FileImage->FileName) != 0 ) {
- NameChange = TRUE;
- }
- }
- if ( HMainEditor.BufferImage->FileImage != NULL &&
- HBufferImageBackupVar.FileImage != NULL &&
- HMainEditor.BufferImage->FileImage->ReadOnly != HBufferImageBackupVar.FileImage->ReadOnly ) {
- ReadChange = TRUE;
- }
-
- //
- // to aVOID screen flicker
- // the stall value is from experience
- //
- gBS->Stall (50);
-
- //
- // call the components refresh function
- //
- if (HEditorFirst
- || NameChange
- || HMainEditor.BufferImage->BufferType != HBufferImageBackupVar.BufferType
- || HBufferImageBackupVar.Modified != HMainEditor.BufferImage->Modified
- || ReadChange ) {
-
- MainTitleBarRefresh (
- HMainEditor.BufferImage->BufferType == FileTypeFileBuffer&&HMainEditor.BufferImage->FileImage!=NULL?HMainEditor.BufferImage->FileImage->FileName:HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer&&HMainEditor.BufferImage->DiskImage!=NULL?HMainEditor.BufferImage->DiskImage->Name:NULL,
- HMainEditor.BufferImage->BufferType,
- (BOOLEAN)(HMainEditor.BufferImage->FileImage!=NULL?HMainEditor.BufferImage->FileImage->ReadOnly:FALSE),
- HMainEditor.BufferImage->Modified,
- HMainEditor.ScreenSize.Column,
- HMainEditor.ScreenSize.Row,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer&&HMainEditor.BufferImage->DiskImage!=NULL?HMainEditor.BufferImage->DiskImage->Offset:HMainEditor.BufferImage->BufferType == FileTypeMemBuffer&&HMainEditor.BufferImage->MemImage!=NULL?HMainEditor.BufferImage->MemImage->Offset:0,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer&&HMainEditor.BufferImage->DiskImage!=NULL?HMainEditor.BufferImage->DiskImage->Size :HMainEditor.BufferImage->BufferType == FileTypeMemBuffer&&HMainEditor.BufferImage->MemImage!=NULL?HMainEditor.BufferImage->MemImage->Size :0
- );
- HBufferImageRefresh ();
- }
- if (HEditorFirst
- || HBufferImageBackupVar.DisplayPosition.Row != HMainEditor.BufferImage->DisplayPosition.Row
- || HBufferImageBackupVar.DisplayPosition.Column != HMainEditor.BufferImage->DisplayPosition.Column
- || StatusBarGetRefresh()) {
-
- StatusBarRefresh (
- HEditorFirst,
- HMainEditor.ScreenSize.Row,
- HMainEditor.ScreenSize.Column,
- (UINTN)(-1),
- (UINTN)(-1),
- FALSE
- );
- HBufferImageRefresh ();
- }
-
- if (HEditorFirst) {
- HBufferImageRefresh ();
- }
-
- //
- // EditorFirst is now set to FALSE
- //
- HEditorFirst = FALSE;
-
- return EFI_SUCCESS;
-}
-
-/**
- Handle the mouse input.
-
- @param[in] MouseState The current mouse state.
- @param[out] BeforeLeftButtonDown helps with selections.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_NOT_FOUND The disk was not found.
-**/
-EFI_STATUS
-HMainEditorHandleMouseInput (
- IN EFI_SIMPLE_POINTER_STATE MouseState,
- OUT BOOLEAN *BeforeLeftButtonDown
- )
-{
-
- INT32 TextX;
- INT32 TextY;
- UINTN FRow;
- UINTN FCol;
- BOOLEAN HighBits;
- LIST_ENTRY *Link;
- HEFI_EDITOR_LINE *Line;
- UINTN Index;
- BOOLEAN Action;
-
- Action = FALSE;
-
- //
- // have mouse movement
- //
- if (MouseState.RelativeMovementX || MouseState.RelativeMovementY) {
- //
- // handle
- //
- TextX = HGetTextX (MouseState.RelativeMovementX);
- TextY = HGetTextY (MouseState.RelativeMovementY);
-
- HBufferImageAdjustMousePosition (TextX, TextY);
-
- Action = TRUE;
-
- }
-
- if (MouseState.LeftButton) {
- HighBits = HBufferImageIsAtHighBits (
- HMainEditor.BufferImage->MousePosition.Column,
- &FCol
- );
-
- //
- // not at an movable place
- //
- if (FCol == 0) {
- //
- // now just move mouse pointer to legal position
- //
- //
- // move mouse position to legal position
- //
- HMainEditor.BufferImage->MousePosition.Column -= 10;
- if (HMainEditor.BufferImage->MousePosition.Column > 24) {
- HMainEditor.BufferImage->MousePosition.Column--;
- FCol = HMainEditor.BufferImage->MousePosition.Column / 3 + 1 + 1;
- } else {
- if (HMainEditor.BufferImage->MousePosition.Column < 24) {
- FCol = HMainEditor.BufferImage->MousePosition.Column / 3 + 1 + 1;
- } else {
- //
- // == 24
- //
- FCol = 9;
- }
- }
-
- HighBits = TRUE;
-
- }
-
- FRow = HMainEditor.BufferImage->BufferPosition.Row +
- HMainEditor.BufferImage->MousePosition.Row -
- HMainEditor.BufferImage->DisplayPosition.Row;
-
- if (HMainEditor.BufferImage->NumLines < FRow) {
- //
- // dragging
- //
- //
- // now just move mouse pointer to legal position
- //
- FRow = HMainEditor.BufferImage->NumLines;
- HighBits = TRUE;
- }
-
- Link = HMainEditor.BufferImage->ListHead->ForwardLink;
- for (Index = 0; Index < FRow - 1; Index++) {
- Link = Link->ForwardLink;
- }
-
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
-
- //
- // dragging
- //
- //
- // now just move mouse pointer to legal position
- //
- if (FCol > Line->Size) {
- if (*BeforeLeftButtonDown) {
- HighBits = FALSE;
-
- if (Line->Size == 0) {
- if (FRow > 1) {
- FRow--;
- FCol = 16;
- } else {
- FRow = 1;
- FCol = 1;
- }
-
- } else {
- FCol = Line->Size;
- }
- } else {
- FCol = Line->Size + 1;
- HighBits = TRUE;
- }
- }
-
- HBufferImageMovePosition (FRow, FCol, HighBits);
-
- HMainEditor.BufferImage->MousePosition.Row = HMainEditor.BufferImage->DisplayPosition.Row;
-
- HMainEditor.BufferImage->MousePosition.Column = HMainEditor.BufferImage->DisplayPosition.Column;
-
- *BeforeLeftButtonDown = TRUE;
-
- Action = TRUE;
- } else {
- //
- // else of if LButton
- //
- // release LButton
- //
- if (*BeforeLeftButtonDown) {
- Action = TRUE;
- }
- //
- // mouse up
- //
- *BeforeLeftButtonDown = FALSE;
- }
-
- if (Action) {
- return EFI_SUCCESS;
- }
-
- return EFI_NOT_FOUND;
-}
-
-/**
- Handle user key input. will route it to other components handle function.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainEditorKeyInput (
- VOID
- )
-{
- EFI_INPUT_KEY Key;
- EFI_STATUS Status;
- EFI_SIMPLE_POINTER_STATE MouseState;
- BOOLEAN LengthChange;
- UINTN Size;
- UINTN OldSize;
- BOOLEAN BeforeMouseIsDown;
- BOOLEAN MouseIsDown;
- BOOLEAN FirstDown;
- BOOLEAN MouseDrag;
- UINTN FRow;
- UINTN FCol;
- UINTN SelectStartBackup;
- UINTN SelectEndBackup;
-
- //
- // variable initialization
- //
- OldSize = 0;
- FRow = 0;
- FCol = 0;
- LengthChange = FALSE;
-
- MouseIsDown = FALSE;
- FirstDown = FALSE;
- MouseDrag = FALSE;
-
- do {
-
- Status = EFI_SUCCESS;
-
- HEditorMouseAction = FALSE;
-
- //
- // backup some key elements, so that can aVOID some refresh work
- //
- HMainEditorBackup ();
-
- //
- // wait for user key input
- //
- //
- // change priority of checking mouse/keyboard activity dynamically
- // so prevent starvation of keyboard.
- // if last time, mouse moves then this time check keyboard
- //
- if (HMainEditor.MouseSupported) {
- Status = HMainEditor.MouseInterface->GetState (
- HMainEditor.MouseInterface,
- &MouseState
- );
- if (!EFI_ERROR (Status)) {
-
- BeforeMouseIsDown = MouseIsDown;
-
- Status = HMainEditorHandleMouseInput (MouseState, &MouseIsDown);
-
- if (!EFI_ERROR (Status)) {
- if (!BeforeMouseIsDown) {
- //
- // mouse down
- //
- if (MouseIsDown) {
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
- SelectStartBackup = HMainEditor.SelectStart;
- SelectEndBackup = HMainEditor.SelectEnd;
-
- FirstDown = TRUE;
- }
- } else {
-
- SelectStartBackup = HMainEditor.SelectStart;
- SelectEndBackup = HMainEditor.SelectEnd;
-
- //
- // begin to drag
- //
- if (MouseIsDown) {
- if (FirstDown) {
- if (MouseState.RelativeMovementX || MouseState.RelativeMovementY) {
- HMainEditor.SelectStart = 0;
- HMainEditor.SelectEnd = 0;
- HMainEditor.SelectStart = (FRow - 1) * 0x10 + FCol;
-
- MouseDrag = TRUE;
- FirstDown = FALSE;
- }
- } else {
- if ((
- (HBufferImage.BufferPosition.Row - 1) *
- 0x10 +
- HBufferImage.BufferPosition.Column
- ) >= HMainEditor.SelectStart
- ) {
- HMainEditor.SelectEnd = (HBufferImage.BufferPosition.Row - 1) *
- 0x10 +
- HBufferImage.BufferPosition.Column;
- } else {
- HMainEditor.SelectEnd = 0;
- }
- }
- //
- // end of if RelativeX/Y
- //
- } else {
- //
- // mouse is up
- //
- if (MouseDrag) {
- if (HBufferImageGetTotalSize () == 0) {
- HMainEditor.SelectStart = 0;
- HMainEditor.SelectEnd = 0;
- FirstDown = FALSE;
- MouseDrag = FALSE;
- }
-
- if ((
- (HBufferImage.BufferPosition.Row - 1) *
- 0x10 +
- HBufferImage.BufferPosition.Column
- ) >= HMainEditor.SelectStart
- ) {
- HMainEditor.SelectEnd = (HBufferImage.BufferPosition.Row - 1) *
- 0x10 +
- HBufferImage.BufferPosition.Column;
- } else {
- HMainEditor.SelectEnd = 0;
- }
-
- if (HMainEditor.SelectEnd == 0) {
- HMainEditor.SelectStart = 0;
- }
- }
-
- FirstDown = FALSE;
- MouseDrag = FALSE;
- }
-
- if (SelectStartBackup != HMainEditor.SelectStart || SelectEndBackup != HMainEditor.SelectEnd) {
- if ((SelectStartBackup - 1) / 0x10 != (HMainEditor.SelectStart - 1) / 0x10) {
- HBufferImageNeedRefresh = TRUE;
- } else {
- if ((SelectEndBackup - 1) / 0x10 != (HMainEditor.SelectEnd - 1) / 0x10) {
- HBufferImageNeedRefresh = TRUE;
- } else {
- HBufferImageOnlyLineNeedRefresh = TRUE;
- }
- }
- }
- }
-
- HEditorMouseAction = TRUE;
- HBufferImageMouseNeedRefresh = TRUE;
-
- } else if (Status == EFI_LOAD_ERROR) {
- StatusBarSetStatusString (L"Invalid Mouse Movement ");
- }
- }
- }
-
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- if (!EFI_ERROR (Status)) {
- //
- // dispatch to different components' key handling function
- // so not everywhere has to set this variable
- //
- HBufferImageMouseNeedRefresh = TRUE;
-
- //
- // clear previous status string
- //
- StatusBarSetRefresh();
- if (EFI_SUCCESS == MenuBarDispatchControlHotKey(&Key)) {
- Status = EFI_SUCCESS;
- } else if (Key.ScanCode == SCAN_NULL) {
- Status = HBufferImageHandleInput (&Key);
- } else if (((Key.ScanCode >= SCAN_UP) && (Key.ScanCode <= SCAN_PAGE_DOWN))) {
- Status = HBufferImageHandleInput (&Key);
- } else if (((Key.ScanCode >= SCAN_F1) && Key.ScanCode <= (SCAN_F12))) {
- Status = MenuBarDispatchFunctionKey (&Key);
- } else {
- StatusBarSetStatusString (L"Unknown Command");
-
- HBufferImageMouseNeedRefresh = FALSE;
- }
-
- if (Status != EFI_SUCCESS && Status != EFI_OUT_OF_RESOURCES) {
- //
- // not already has some error status
- //
- if (StrCmp (L"", StatusBarGetString()) == 0) {
- StatusBarSetStatusString (L"Disk Error. Try Again");
- }
- }
- }
- //
- // decide if has to set length warning
- //
- if (HBufferImage.BufferType != HBufferImageBackupVar.BufferType) {
- LengthChange = FALSE;
- } else {
- //
- // still the old buffer
- //
- if (HBufferImage.BufferType != FileTypeFileBuffer) {
- Size = HBufferImageGetTotalSize ();
-
- switch (HBufferImage.BufferType) {
- case FileTypeDiskBuffer:
- OldSize = HBufferImage.DiskImage->Size * HBufferImage.DiskImage->BlockSize;
- break;
-
- case FileTypeMemBuffer:
- OldSize = HBufferImage.MemImage->Size;
- break;
-
- default:
- OldSize = 0;
- break;
- }
-
- if (!LengthChange) {
- if (OldSize != Size) {
- StatusBarSetStatusString (L"Disk/Mem Buffer Length should not be changed");
- }
- }
-
- if (OldSize != Size) {
- LengthChange = TRUE;
- } else {
- LengthChange = FALSE;
- }
- }
- }
- //
- // after handling, refresh editor
- //
- HMainEditorRefresh ();
-
- } while (Status != EFI_OUT_OF_RESOURCES && !HEditorExit);
-
- return Status;
-}
-
-/**
- Backup function for MainEditor.
-**/
-VOID
-EFIAPI
-HMainEditorBackup (
- VOID
- )
-{
- HMainEditorBackupVar.SelectStart = HMainEditor.SelectStart;
- HMainEditorBackupVar.SelectEnd = HMainEditor.SelectEnd;
- HBufferImageBackup ();
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h
deleted file mode 100644
index ad9a7b4be8..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
- Defines the Main Editor data type -
- - Global variables
- - Instances of the other objects of the editor
- - Main Interfaces
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_EDITOR_H_
-#define _LIB_EDITOR_H_
-
-#include "HexEditor.h"
-
-/**
- Init function for MainEditor
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainEditorInit (
- VOID
- );
-
-/**
- Cleanup function for MainEditor.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainEditorCleanup (
- VOID
- );
-
-/**
- Refresh function for MainEditor.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HMainEditorRefresh (
- VOID
- );
-
-/**
- Handle user key input. will route it to other components handle function.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMainEditorKeyInput (
- VOID
- );
-
-/**
- Backup function for MainEditor.
-**/
-VOID
-EFIAPI
-HMainEditorBackup (
- VOID
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c
deleted file mode 100644
index 9d44abddd7..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c
+++ /dev/null
@@ -1,351 +0,0 @@
-/** @file
- Functions to deal with Mem buffer
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "HexEditor.h"
-
-extern EFI_HANDLE HImageHandleBackup;
-
-extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
-
-extern BOOLEAN HBufferImageNeedRefresh;
-extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
-extern BOOLEAN HBufferImageMouseNeedRefresh;
-
-extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
-
-HEFI_EDITOR_MEM_IMAGE HMemImage;
-HEFI_EDITOR_MEM_IMAGE HMemImageBackupVar;
-
-EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL DummyPciRootBridgeIo;
-
-//
-// for basic initialization of HDiskImage
-//
-HEFI_EDITOR_MEM_IMAGE HMemImageConst = {
- NULL,
- 0,
- 0
-};
-
-/**
- Empty function. always returns the same.
-
- @param[in] This Ignored.
- @param[in] Width Ignored.
- @param[in] Address Ignored.
- @param[in] Count Ignored.
- @param[in, out] Buffer Ignored.
-
- @retval EFI_UNSUPPORTED.
-**/
-EFI_STATUS
-EFIAPI
-DummyMemRead (
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- Empty function. always returns the same.
-
- @param[in] This Ignored.
- @param[in] Width Ignored.
- @param[in] Address Ignored.
- @param[in] Count Ignored.
- @param[in, out] Buffer Ignored.
-
- @retval EFI_UNSUPPORTED.
-**/
-EFI_STATUS
-EFIAPI
-DummyMemWrite (
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- Initialization function for HDiskImage.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMemImageInit (
- VOID
- )
-{
- EFI_STATUS Status;
-
- //
- // basically initialize the HMemImage
- //
- CopyMem (&HMemImage, &HMemImageConst, sizeof (HMemImage));
-
- Status = gBS->LocateProtocol (
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- (VOID**)&HMemImage.IoFncs
- );
- if (Status == EFI_NOT_FOUND) {
- //
- // For NT32, no EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL is available
- // Use Dummy PciRootBridgeIo for memory access
- //
- ZeroMem (&DummyPciRootBridgeIo, sizeof (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL));
- DummyPciRootBridgeIo.Mem.Read = DummyMemRead;
- DummyPciRootBridgeIo.Mem.Write = DummyMemWrite;
- HMemImage.IoFncs = &DummyPciRootBridgeIo;
- Status = EFI_SUCCESS;
- }
- if (!EFI_ERROR (Status)) {
- return EFI_SUCCESS;
- } else {
- return EFI_LOAD_ERROR;
- }
-}
-
-/**
- Backup function for HDiskImage. Only a few fields need to be backup.
- This is for making the Disk buffer refresh as few as possible.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HMemImageBackup (
- VOID
- )
-{
- HMemImageBackupVar.Offset = HMemImage.Offset;
- HMemImageBackupVar.Size = HMemImage.Size;
-
- return EFI_SUCCESS;
-}
-
-/**
- Set FileName field in HFileImage.
-
- @param[in] Offset The offset.
- @param[in] Size The size.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-HMemImageSetMemOffsetSize (
- IN UINTN Offset,
- IN UINTN Size
- )
-{
-
- HMemImage.Offset = Offset;
- HMemImage.Size = Size;
-
- return EFI_SUCCESS;
-}
-
-/**
- Read a disk from disk into HBufferImage.
-
- @param[in] Offset The offset.
- @param[in] Size The size.
- @param[in] Recover if is for recover, no information print.
-
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-HMemImageRead (
- IN UINTN Offset,
- IN UINTN Size,
- IN BOOLEAN Recover
- )
-{
-
- EFI_STATUS Status;
- void *Buffer;
- CHAR16 *Str;
- HEFI_EDITOR_LINE *Line;
-
- EDIT_FILE_TYPE BufferTypeBackup;
-
- BufferTypeBackup = HBufferImage.BufferType;
- HBufferImage.BufferType = FileTypeMemBuffer;
-
- Buffer = AllocateZeroPool (Size);
- if (Buffer == NULL) {
- StatusBarSetStatusString (L"Read Memory Failed");
- return EFI_OUT_OF_RESOURCES;
- }
-
- Status = HMemImage.IoFncs->Mem.Read (
- HMemImage.IoFncs,
- EfiPciWidthUint8,
- Offset,
- Size,
- Buffer
- );
-
- if (EFI_ERROR (Status)) {
- FreePool (Buffer);
- StatusBarSetStatusString (L"Memory Specified Not Accessible");
- return EFI_LOAD_ERROR;
- }
-
- HBufferImageFree ();
-
- Status = HBufferImageBufferToList (Buffer, Size);
- FreePool (Buffer);
-
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"Read Memory Failed");
- return Status;
- }
-
- Status = HMemImageSetMemOffsetSize (Offset, Size);
-
- HBufferImage.DisplayPosition.Row = 2;
- HBufferImage.DisplayPosition.Column = 10;
-
- HBufferImage.MousePosition.Row = 2;
- HBufferImage.MousePosition.Column = 10;
-
- HBufferImage.LowVisibleRow = 1;
- HBufferImage.HighBits = TRUE;
-
- HBufferImage.BufferPosition.Row = 1;
- HBufferImage.BufferPosition.Column = 1;
-
- if (!Recover) {
- Str = CatSPrint(NULL, L"%d Lines Read", HBufferImage.NumLines);
- if (Str == NULL) {
- StatusBarSetStatusString (L"Read Memory Failed");
- return EFI_OUT_OF_RESOURCES;
- }
-
- StatusBarSetStatusString (Str);
- SHELL_FREE_NON_NULL (Str);
-
- HMainEditor.SelectStart = 0;
- HMainEditor.SelectEnd = 0;
-
- }
-
- //
- // has line
- //
- if (HBufferImage.Lines != NULL) {
- HBufferImage.CurrentLine = CR (HBufferImage.ListHead->ForwardLink, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- } else {
- //
- // create a dummy line
- //
- Line = HBufferImageCreateLine ();
- if (Line == NULL) {
- StatusBarSetStatusString (L"Read Memory Failed");
- return EFI_OUT_OF_RESOURCES;
- }
-
- HBufferImage.CurrentLine = Line;
- }
-
- HBufferImage.Modified = FALSE;
- HBufferImageNeedRefresh = TRUE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- HBufferImageMouseNeedRefresh = TRUE;
-
- return EFI_SUCCESS;
-
-}
-
-/**
- Save lines in HBufferImage to disk.
-
- @param[in] Offset The offset.
- @param[in] Size The size.
-
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-HMemImageSave (
- IN UINTN Offset,
- IN UINTN Size
- )
-{
-
- EFI_STATUS Status;
- VOID *Buffer;
-
- EDIT_FILE_TYPE BufferTypeBackup;
-
- //
- // not modified, so directly return
- //
- if (HBufferImage.Modified == FALSE) {
- return EFI_SUCCESS;
- }
-
- BufferTypeBackup = HBufferImage.BufferType;
- HBufferImage.BufferType = FileTypeMemBuffer;
-
- Buffer = AllocateZeroPool (Size);
-
- if (Buffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Status = HBufferImageListToBuffer (Buffer, Size);
- if (EFI_ERROR (Status)) {
- FreePool (Buffer);
- return Status;
- }
- //
- // write back to memory
- //
- Status = HMemImage.IoFncs->Mem.Write (
- HMemImage.IoFncs,
- EfiPciWidthUint8,
- Offset,
- Size,
- Buffer
- );
-
- FreePool (Buffer);
-
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
- //
- // now not modified
- //
- HBufferImage.Modified = FALSE;
-
- return EFI_SUCCESS;
-}
-
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h
deleted file mode 100644
index 54fe517858..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/** @file
- Defines MemImage - the view of the file that is visible at any point,
- as well as the event handlers for editing the file
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_MEM_IMAGE_H_
-#define _LIB_MEM_IMAGE_H_
-
-#include "HexEditor.h"
-
-/**
- Initialization function for HDiskImage.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
-**/
-EFI_STATUS
-HMemImageInit (
- VOID
- );
-
-/**
- Backup function for HDiskImage. Only a few fields need to be backup.
- This is for making the Disk buffer refresh as few as possible.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HMemImageBackup (
- VOID
- );
-
-/**
- Set FileName field in HFileImage.
-
- @param[in] Offset The offset.
- @param[in] Size The size.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-HMemImageSetMemOffsetSize (
- IN UINTN Offset,
- IN UINTN Size
- );
-
-/**
- Read a disk from disk into HBufferImage.
-
- @param[in] Offset The offset.
- @param[in] Size The size.
- @param[in] Recover if is for recover, no information print.
-
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-HMemImageRead (
- IN UINTN Offset,
- IN UINTN Size,
- IN BOOLEAN Recover
- );
-
-/**
- Save lines in HBufferImage to disk.
-
- @param[in] Offset The offset.
- @param[in] Size The size.
-
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-HMemImageSave (
- IN UINTN Offset,
- IN UINTN Size
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c
deleted file mode 100644
index c3ed341936..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/** @file
- Implementation of various string and line routines
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "HexEditor.h"
-
-extern BOOLEAN HEditorMouseAction;
-
-/**
- Free a line and it's internal buffer.
-
- @param[in] Src The line to be freed.
-**/
-VOID
-HLineFree (
- IN HEFI_EDITOR_LINE *Src
- )
-{
- if (Src == NULL) {
- return ;
- }
-
- SHELL_FREE_NON_NULL (Src);
-
-}
-
-/**
- Advance to the next Count lines.
-
- @param[in] Count The line number to advance.
-
- @retval NULL An error occured.
- @return A pointer to the line after advance.
-**/
-HEFI_EDITOR_LINE *
-HLineAdvance (
- IN UINTN Count
- )
-{
- UINTN Index;
- HEFI_EDITOR_LINE *Line;
-
- Line = HMainEditor.BufferImage->CurrentLine;
- if (Line == NULL) {
- return NULL;
- }
-
- for (Index = 0; Index < Count; Index++) {
- //
- // if already last line
- //
- if (Line->Link.ForwardLink == HMainEditor.BufferImage->ListHead) {
- return NULL;
- }
-
- Line = CR (Line->Link.ForwardLink, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- }
-
- return Line;
-}
-
-/**
- Retreat to the previous Count lines.
-
- @param[in] Count The line number to retreat.
-
- @retval NULL An error occured.
- @return A pointer to the line after retreat.
-**/
-HEFI_EDITOR_LINE *
-HLineRetreat (
- IN UINTN Count
- )
-{
- UINTN Index;
- HEFI_EDITOR_LINE *Line;
-
- Line = HMainEditor.BufferImage->CurrentLine;
- if (Line == NULL) {
- return NULL;
- }
-
- for (Index = 0; Index < Count; Index++) {
- //
- // already the first line
- //
- if (Line->Link.BackLink == HMainEditor.BufferImage->ListHead) {
- return NULL;
- }
-
- Line = CR (Line->Link.BackLink, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- }
-
- return Line;
-}
-
-/**
- Advance/Retreat lines.
-
- @param[in] Count The line number to advance/retreat.
- >0 : advance
- <0: retreat
-
- @retval NULL An error occured.
- @return A pointer to the line after move.
-**/
-HEFI_EDITOR_LINE *
-HMoveLine (
- IN INTN Count
- )
-{
- HEFI_EDITOR_LINE *Line;
- UINTN AbsCount;
-
- //
- // difference with MoveCurrentLine
- // just return Line
- // do not set currentline to Line
- //
- if (Count <= 0) {
- AbsCount = (UINTN)ABS(Count);
- Line = HLineRetreat (AbsCount);
- } else {
- Line = HLineAdvance ((UINTN)Count);
- }
-
- return Line;
-}
-
-/**
- Advance/Retreat lines and set CurrentLine in BufferImage to it.
-
- @param[in] Count The line number to advance/retreat.
- >0 : advance
- <0: retreat
-
- @retval NULL An error occured.
- @return A pointer to the line after move.
-**/
-HEFI_EDITOR_LINE *
-HMoveCurrentLine (
- IN INTN Count
- )
-{
- HEFI_EDITOR_LINE *Line;
- UINTN AbsCount;
-
- //
- // <0: retreat
- // >0: advance
- //
- if (Count <= 0) {
- AbsCount = (UINTN)ABS(Count);
- Line = HLineRetreat (AbsCount);
- } else {
- Line = HLineAdvance ((UINTN)Count);
- }
-
- if (Line == NULL) {
- return NULL;
- }
-
- HMainEditor.BufferImage->CurrentLine = Line;
-
- return Line;
-}
-
-
-/**
- Free all the lines in HBufferImage.
- Fields affected:
- Lines
- CurrentLine
- NumLines
- ListHead
-
- @param[in] ListHead The list head.
- @param[in] Lines The lines.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HFreeLines (
- IN LIST_ENTRY *ListHead,
- IN HEFI_EDITOR_LINE *Lines
- )
-{
- LIST_ENTRY *Link;
- HEFI_EDITOR_LINE *Line;
-
- //
- // release all the lines
- //
- if (Lines != NULL) {
-
- Line = Lines;
- Link = &(Line->Link);
- do {
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- Link = Link->ForwardLink;
- HLineFree (Line);
- } while (Link != ListHead);
- }
-
- ListHead->ForwardLink = ListHead;
- ListHead->BackLink = ListHead;
-
- return EFI_SUCCESS;
-}
-
-/**
- Get the X information for the mouse.
-
- @param[in] GuidX The change.
-
- @return the new information.
-**/
-INT32
-HGetTextX (
- IN INT32 GuidX
- )
-{
- INT32 Gap;
-
- HMainEditor.MouseAccumulatorX += GuidX;
- Gap = (HMainEditor.MouseAccumulatorX * (INT32) HMainEditor.ScreenSize.Column) / (INT32) (50 * (INT32) HMainEditor.MouseInterface->Mode->ResolutionX);
- HMainEditor.MouseAccumulatorX = (HMainEditor.MouseAccumulatorX * (INT32) HMainEditor.ScreenSize.Column) % (INT32) (50 * (INT32) HMainEditor.MouseInterface->Mode->ResolutionX);
- HMainEditor.MouseAccumulatorX = HMainEditor.MouseAccumulatorX / (INT32) HMainEditor.ScreenSize.Column;
- return Gap;
-}
-
-/**
- Get the Y information for the mouse.
-
- @param[in] GuidY The change.
-
- @return the new information.
-**/
-INT32
-HGetTextY (
- IN INT32 GuidY
- )
-{
- INT32 Gap;
-
- HMainEditor.MouseAccumulatorY += GuidY;
- Gap = (HMainEditor.MouseAccumulatorY * (INT32) HMainEditor.ScreenSize.Row) / (INT32) (50 * (INT32) HMainEditor.MouseInterface->Mode->ResolutionY);
- HMainEditor.MouseAccumulatorY = (HMainEditor.MouseAccumulatorY * (INT32) HMainEditor.ScreenSize.Row) % (INT32) (50 * (INT32) HMainEditor.MouseInterface->Mode->ResolutionY);
- HMainEditor.MouseAccumulatorY = HMainEditor.MouseAccumulatorY / (INT32) HMainEditor.ScreenSize.Row;
-
- return Gap;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h
deleted file mode 100644
index df947935b0..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/** @file
- Definitions for various line and string routines
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_MISC_H_
-#define _LIB_MISC_H_
-
-#include "HexEditor.h"
-
-/**
- Advance/Retreat lines.
-
- @param[in] Count The line number to advance/retreat.
- >0 : advance
- <0: retreat
-
- @retval NULL An error occured.
- @return A pointer to the line after move.
-**/
-HEFI_EDITOR_LINE *
-HMoveLine (
- IN INTN Count
- );
-
-/**
- Advance/Retreat lines and set CurrentLine in BufferImage to it.
-
- @param[in] Count The line number to advance/retreat.
- >0 : advance
- <0: retreat
-
- @retval NULL An error occured.
- @return A pointer to the line after move.
-**/
-HEFI_EDITOR_LINE *
-HMoveCurrentLine (
- IN INTN Count
- );
-
-/**
- Free all the lines in HBufferImage.
- Fields affected:
- Lines
- CurrentLine
- NumLines
- ListHead
-
- @param[in] ListHead The list head.
- @param[in] Lines The lines.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-HFreeLines (
- IN LIST_ENTRY *ListHead,
- IN HEFI_EDITOR_LINE *Lines
- );
-
-/**
- Get the X information for the mouse.
-
- @param[in] GuidX The change.
-
- @return the new information.
-**/
-INT32
-HGetTextX (
- IN INT32 GuidX
- );
-
-/**
- Get the Y information for the mouse.
-
- @param[in] GuidY The change.
-
- @return the new information.
-**/
-INT32
-HGetTextY (
- IN INT32 GuidY
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c
deleted file mode 100644
index afc561fb7f..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c
+++ /dev/null
@@ -1,469 +0,0 @@
-/** @file
- Main file for LoadPciRom shell Debug1 function.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include <IndustryStandard/Pci22.h>
-#include <IndustryStandard/Pci23.h>
-#include <IndustryStandard/PeImage.h>
-#include <Protocol/Decompress.h>
-
-/**
- Connects all available drives and controllers.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_ABORTED The abort mechanism was received.
-**/
-EFI_STATUS
-EFIAPI
-LoadPciRomConnectAllDriversToAllControllers (
- VOID
- );
-
-/**
- Command entry point.
-
- @param[in] RomBar The Rom Base address.
- @param[in] RomSize The Rom size.
- @param[in] FileName The file name.
-
- @retval EFI_SUCCESS The command completed successfully.
- @retval EFI_INVALID_PARAMETER Command usage error.
- @retval EFI_UNSUPPORTED Protocols unsupported.
- @retval EFI_OUT_OF_RESOURCES Out of memory.
- @retval Other value Unknown error.
-**/
-EFI_STATUS
-EFIAPI
-LoadEfiDriversFromRomImage (
- VOID *RomBar,
- UINTN RomSize,
- CONST CHAR16 *FileName
- );
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-nc", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'loadpcirom' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunLoadPciRom (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_SHELL_FILE_INFO *FileList;
- UINTN SourceSize;
- UINT8 *File1Buffer;
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- BOOLEAN Connect;
- CONST CHAR16 *Param;
- UINTN ParamCount;
- EFI_SHELL_FILE_INFO *Node;
- //
- // Local variable initializations
- //
- File1Buffer = NULL;
- ShellStatus = SHELL_SUCCESS;
- FileList = NULL;
-
-
- //
- // verify number of arguments
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (ShellCommandLineGetFlag(Package, L"-nc")) {
- Connect = FALSE;
- } else {
- Connect = TRUE;
- }
-
- //
- // get a list with each file specified by parameters
- // if parameter is a directory then add all the files below it to the list
- //
- for ( ParamCount = 1, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ; Param != NULL
- ; ParamCount++, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ){
- Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, Param, Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- break;
- }
- }
- if (ShellStatus == SHELL_SUCCESS && FileList != NULL) {
- //
- // loop through the list and make sure we are not aborting...
- //
- for ( Node = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link) && !ShellGetExecutionBreakFlag()
- ; Node = (EFI_SHELL_FILE_INFO*)GetNextNode(&FileList->Link, &Node->Link)
- ){
- if (EFI_ERROR(Node->Status)){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, Node->FullName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- continue;
- }
- if (FileHandleIsDirectory(Node->Handle) == EFI_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, Node->FullName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- continue;
- }
- SourceSize = (UINTN) Node->Info->FileSize;
- File1Buffer = AllocateZeroPool (SourceSize);
- ASSERT(File1Buffer != NULL);
- Status = gEfiShellProtocol->ReadFile(Node->Handle, &SourceSize, File1Buffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_READ_FAIL), gShellDebug1HiiHandle, Node->FullName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = LoadEfiDriversFromRomImage (
- File1Buffer,
- SourceSize,
- Node->FullName
- );
-
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_PCI_ROM_RES), gShellDebug1HiiHandle, Node->FullName, Status);
- }
- FreePool(File1Buffer);
- }
- } else if (ShellStatus == SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- }
- if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
- Status = ShellCloseFileMetaArg(&FileList);
- }
- FileList = NULL;
-
- if (Connect) {
- Status = LoadPciRomConnectAllDriversToAllControllers ();
- }
- }
- }
-
- return (ShellStatus);
-}
-
-/**
- Command entry point.
-
- @param[in] RomBar The Rom Base address.
- @param[in] RomSize The Rom size.
- @param[in] FileName The file name.
-
- @retval EFI_SUCCESS The command completed successfully.
- @retval EFI_INVALID_PARAMETER Command usage error.
- @retval EFI_UNSUPPORTED Protocols unsupported.
- @retval EFI_OUT_OF_RESOURCES Out of memory.
- @retval Other value Unknown error.
-**/
-EFI_STATUS
-EFIAPI
-LoadEfiDriversFromRomImage (
- VOID *RomBar,
- UINTN RomSize,
- CONST CHAR16 *FileName
- )
-
-{
- EFI_PCI_EXPANSION_ROM_HEADER *EfiRomHeader;
- PCI_DATA_STRUCTURE *Pcir;
- UINTN ImageIndex;
- UINTN RomBarOffset;
- UINT32 ImageSize;
- UINT16 ImageOffset;
- EFI_HANDLE ImageHandle;
- EFI_STATUS Status;
- EFI_STATUS ReturnStatus;
- CHAR16 RomFileName[280];
- EFI_DEVICE_PATH_PROTOCOL *FilePath;
- BOOLEAN SkipImage;
- UINT32 DestinationSize;
- UINT32 ScratchSize;
- UINT8 *Scratch;
- VOID *ImageBuffer;
- VOID *DecompressedImageBuffer;
- UINT32 ImageLength;
- EFI_DECOMPRESS_PROTOCOL *Decompress;
- UINT32 InitializationSize;
-
- ImageIndex = 0;
- ReturnStatus = EFI_NOT_FOUND;
- RomBarOffset = (UINTN) RomBar;
-
- do {
-
- EfiRomHeader = (EFI_PCI_EXPANSION_ROM_HEADER *) (UINTN) RomBarOffset;
-
- if (EfiRomHeader->Signature != PCI_EXPANSION_ROM_HEADER_SIGNATURE) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_CORRUPT), gShellDebug1HiiHandle, FileName, ImageIndex);
-// PrintToken (STRING_TOKEN (STR_LOADPCIROM_IMAGE_CORRUPT), HiiHandle, ImageIndex);
- return ReturnStatus;
- }
-
- //
- // If the pointer to the PCI Data Structure is invalid, no further images can be located.
- // The PCI Data Structure must be DWORD aligned.
- //
- if (EfiRomHeader->PcirOffset == 0 ||
- (EfiRomHeader->PcirOffset & 3) != 0 ||
- RomBarOffset - (UINTN)RomBar + EfiRomHeader->PcirOffset + sizeof (PCI_DATA_STRUCTURE) > RomSize) {
- break;
- }
-
- Pcir = (PCI_DATA_STRUCTURE *) (UINTN) (RomBarOffset + EfiRomHeader->PcirOffset);
- //
- // If a valid signature is not present in the PCI Data Structure, no further images can be located.
- //
- if (Pcir->Signature != PCI_DATA_STRUCTURE_SIGNATURE) {
- break;
- }
- ImageSize = Pcir->ImageLength * 512;
- if (RomBarOffset - (UINTN)RomBar + ImageSize > RomSize) {
- break;
- }
-
- if ((Pcir->CodeType == PCI_CODE_TYPE_EFI_IMAGE) &&
- (EfiRomHeader->EfiSignature == EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE) &&
- ((EfiRomHeader->EfiSubsystem == EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER) ||
- (EfiRomHeader->EfiSubsystem == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER))) {
-
- ImageOffset = EfiRomHeader->EfiImageHeaderOffset;
- InitializationSize = EfiRomHeader->InitializationSize * 512;
-
- if (InitializationSize <= ImageSize && ImageOffset < InitializationSize) {
-
- ImageBuffer = (VOID *) (UINTN) (RomBarOffset + ImageOffset);
- ImageLength = InitializationSize - ImageOffset;
- DecompressedImageBuffer = NULL;
-
- //
- // decompress here if needed
- //
- SkipImage = FALSE;
- if (EfiRomHeader->CompressionType > EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED) {
- SkipImage = TRUE;
- }
-
- if (EfiRomHeader->CompressionType == EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED) {
- Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID**)&Decompress);
- ASSERT_EFI_ERROR(Status);
- if (EFI_ERROR (Status)) {
- SkipImage = TRUE;
- } else {
- SkipImage = TRUE;
- Status = Decompress->GetInfo (
- Decompress,
- ImageBuffer,
- ImageLength,
- &DestinationSize,
- &ScratchSize
- );
- if (!EFI_ERROR (Status)) {
- DecompressedImageBuffer = AllocateZeroPool (DestinationSize);
- if (ImageBuffer != NULL) {
- Scratch = AllocateZeroPool (ScratchSize);
- if (Scratch != NULL) {
- Status = Decompress->Decompress (
- Decompress,
- ImageBuffer,
- ImageLength,
- DecompressedImageBuffer,
- DestinationSize,
- Scratch,
- ScratchSize
- );
- if (!EFI_ERROR (Status)) {
- ImageBuffer = DecompressedImageBuffer;
- ImageLength = DestinationSize;
- SkipImage = FALSE;
- }
-
- FreePool (Scratch);
- }
- }
- }
- }
- }
-
- if (!SkipImage) {
- //
- // load image and start image
- //
- UnicodeSPrint (RomFileName, sizeof (RomFileName), L"%s[%d]", FileName, ImageIndex);
- FilePath = FileDevicePath (NULL, RomFileName);
-
- Status = gBS->LoadImage (
- TRUE,
- gImageHandle,
- FilePath,
- ImageBuffer,
- ImageLength,
- &ImageHandle
- );
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, FileName, ImageIndex, Status);
-// PrintToken (STRING_TOKEN (STR_LOADPCIROM_LOAD_IMAGE_ERROR), HiiHandle, ImageIndex, Status);
- } else {
- Status = gBS->StartImage (ImageHandle, NULL, NULL);
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_START_FAIL), gShellDebug1HiiHandle, FileName, ImageIndex, Status);
-// PrintToken (STRING_TOKEN (STR_LOADPCIROM_START_IMAGE), HiiHandle, ImageIndex, Status);
- } else {
- ReturnStatus = Status;
- }
- }
- }
-
- if (DecompressedImageBuffer != NULL) {
- FreePool (DecompressedImageBuffer);
- }
-
- }
- }
-
- RomBarOffset = RomBarOffset + ImageSize;
- ImageIndex++;
- } while (((Pcir->Indicator & 0x80) == 0x00) && ((RomBarOffset - (UINTN) RomBar) < RomSize));
-
- return ReturnStatus;
-}
-
-/**
- Connects all available drives and controllers.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_ABORTED The abort mechanism was received.
-**/
-EFI_STATUS
-EFIAPI
-LoadPciRomConnectAllDriversToAllControllers (
- VOID
- )
-
-{
- EFI_STATUS Status;
- UINTN AllHandleCount;
- EFI_HANDLE *AllHandleBuffer;
- UINTN Index;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- UINTN *HandleType;
- UINTN HandleIndex;
- BOOLEAN Parent;
- BOOLEAN Device;
-
- Status = gBS->LocateHandleBuffer(
- AllHandles,
- NULL,
- NULL,
- &AllHandleCount,
- &AllHandleBuffer
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- for (Index = 0; Index < AllHandleCount; Index++) {
- if (ShellGetExecutionBreakFlag ()) {
- Status = EFI_ABORTED;
- goto Done;
- }
- //
- // Scan the handle database
- //
- Status = ParseHandleDatabaseByRelationshipWithType(
- NULL,
- AllHandleBuffer[Index],
- &HandleCount,
- &HandleBuffer,
- &HandleType
- );
-/*
- Status = LibScanHandleDatabase (
- NULL,
- NULL,
- AllHandleBuffer[Index],
- NULL,
- &HandleCount,
- &HandleBuffer,
- &HandleType
- );
-*/
- if (EFI_ERROR (Status)) {
- goto Done;
- }
-
- Device = TRUE;
- if ((HandleType[Index] & HR_DRIVER_BINDING_HANDLE) != 0) {
- Device = FALSE;
- }
-
- if ((HandleType[Index] & HR_IMAGE_HANDLE) != 0) {
- Device = FALSE;
- }
-
- if (Device) {
- Parent = FALSE;
- for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
- if ((HandleType[HandleIndex] & HR_PARENT_HANDLE) != 0) {
- Parent = TRUE;
- }
- }
-
- if (!Parent) {
- if ((HandleType[Index] & HR_DEVICE_HANDLE) != 0) {
- Status = gBS->ConnectController (
- AllHandleBuffer[Index],
- NULL,
- NULL,
- TRUE
- );
- }
- }
- }
-
- FreePool (HandleBuffer);
- FreePool (HandleType);
- }
-
-Done:
- FreePool (AllHandleBuffer);
- return Status;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c
deleted file mode 100644
index 59900d3256..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/** @file
- Main file for Mode shell Debug1 function.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the acModeanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which acModeanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-STATIC CONST CHAR16 NameEfiReservedMemoryType[] = L"Reserved";
-STATIC CONST CHAR16 NameEfiLoaderCode[] = L"LoaderCode";
-STATIC CONST CHAR16 NameEfiLoaderData[] = L"LoaderData";
-STATIC CONST CHAR16 NameEfiBootServicesCode[] = L"BS_Code";
-STATIC CONST CHAR16 NameEfiBootServicesData[] = L"BS_Data";
-STATIC CONST CHAR16 NameEfiRuntimeServicesCode[] = L"RT_Code";
-STATIC CONST CHAR16 NameEfiRuntimeServicesData[] = L"RT_Data";
-STATIC CONST CHAR16 NameEfiConventionalMemory[] = L"Available";
-STATIC CONST CHAR16 NameEfiUnusableMemory[] = L"Unusable";
-STATIC CONST CHAR16 NameEfiACPIReclaimMemory[] = L"ACPIRec";
-STATIC CONST CHAR16 NameEfiACPIMemoryNVS[] = L"ACPI_NVS";
-STATIC CONST CHAR16 NameEfiMemoryMappedIO[] = L"MMIO";
-STATIC CONST CHAR16 NameEfiMemoryMappedIOPortSpace[] = L"MMIOPort";
-STATIC CONST CHAR16 NameEfiPalCode[] = L"PalCode";
-
-#include "UefiShellDebug1CommandsLib.h"
-
-/**
- Function for 'memmap' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMemMap (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN Size;
- EFI_MEMORY_DESCRIPTOR *Buffer;
- UINTN MapKey;
- UINTN ItemSize;
- UINT32 Version;
- UINT8 *Walker;
- UINT64 ReservedPages;
- UINT64 LoadCodePages;
- UINT64 LoadDataPages;
- UINT64 BSCodePages;
- UINT64 BSDataPages;
- UINT64 RTDataPages;
- UINT64 RTCodePages;
- UINT64 AvailPages;
- UINT64 TotalPages;
- UINT64 ReservedPagesSize;
- UINT64 LoadCodePagesSize;
- UINT64 LoadDataPagesSize;
- UINT64 BSCodePagesSize;
- UINT64 BSDataPagesSize;
- UINT64 RTDataPagesSize;
- UINT64 RTCodePagesSize;
- UINT64 AvailPagesSize;
- UINT64 TotalPagesSize;
- UINT64 AcpiReclaimPages;
- UINT64 AcpiNvsPages;
- UINT64 MmioSpacePages;
- UINT64 AcpiReclaimPagesSize;
- UINT64 AcpiNvsPagesSize;
- UINT64 MmioSpacePagesSize;
- BOOLEAN Sfo;
-
- AcpiReclaimPages = 0;
- AcpiNvsPages = 0;
- MmioSpacePages = 0;
- TotalPages = 0;
- ReservedPages = 0;
- LoadCodePages = 0;
- LoadDataPages = 0;
- BSCodePages = 0;
- BSDataPages = 0;
- RTDataPages = 0;
- RTCodePages = 0;
- AvailPages = 0;
- Size = 0;
- Buffer = NULL;
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (SfoParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = gBS->GetMemoryMap(&Size, Buffer, &MapKey, &ItemSize, &Version);
- if (Status == EFI_BUFFER_TOO_SMALL){
- Size += SIZE_1KB;
- Buffer = AllocateZeroPool(Size);
- Status = gBS->GetMemoryMap(&Size, Buffer, &MapKey, &ItemSize, &Version);
- }
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_GET_FAILED), gShellDebug1HiiHandle, Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- } else {
- ASSERT(Version == EFI_MEMORY_DESCRIPTOR_VERSION);
- Sfo = ShellCommandLineGetFlag(Package, L"-sfo");
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_LIST_HEAD), gShellDebug1HiiHandle);
- for (Walker = (UINT8*)Buffer; Walker < (((UINT8*)Buffer)+Size) && Walker != NULL; Walker += ItemSize){
- switch (((EFI_MEMORY_DESCRIPTOR*)Walker)->Type) {
- // replaced ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages) with 0000
- case EfiReservedMemoryType:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiReservedMemoryType, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- ReservedPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiLoaderCode:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiLoaderCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- LoadCodePages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiLoaderData:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiLoaderData, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- LoadDataPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiBootServicesCode:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiBootServicesCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- BSCodePages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiBootServicesData:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiBootServicesData, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- BSDataPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiRuntimeServicesCode:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiRuntimeServicesCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- RTCodePages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiRuntimeServicesData:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiRuntimeServicesData, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- RTDataPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiConventionalMemory:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiConventionalMemory, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- AvailPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiUnusableMemory:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiUnusableMemory, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiACPIReclaimMemory:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiACPIReclaimMemory, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- AcpiReclaimPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiACPIMemoryNVS:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiACPIMemoryNVS, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- AcpiNvsPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiMemoryMappedIO:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiMemoryMappedIO, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- MmioSpacePages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiMemoryMappedIOPortSpace:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiMemoryMappedIOPortSpace, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- case EfiPalCode:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiPalCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
- TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
- break;
- default:
- ASSERT(FALSE);
- }
- }
- //
- // print the summary
- //
- ReservedPagesSize = MultU64x64(SIZE_4KB,ReservedPages);
- LoadCodePagesSize = MultU64x64(SIZE_4KB,LoadCodePages);
- LoadDataPagesSize = MultU64x64(SIZE_4KB,LoadDataPages);
- BSCodePagesSize = MultU64x64(SIZE_4KB,BSCodePages);
- BSDataPagesSize = MultU64x64(SIZE_4KB,BSDataPages);
- RTDataPagesSize = MultU64x64(SIZE_4KB,RTDataPages);
- RTCodePagesSize = MultU64x64(SIZE_4KB,RTCodePages);
- AvailPagesSize = MultU64x64(SIZE_4KB,AvailPages);
- TotalPagesSize = MultU64x64(SIZE_4KB,TotalPages);
- AcpiReclaimPagesSize = MultU64x64(SIZE_4KB,AcpiReclaimPages);
- AcpiNvsPagesSize = MultU64x64(SIZE_4KB,AcpiNvsPages);
- MmioSpacePagesSize = MultU64x64(SIZE_4KB,MmioSpacePages);
- if (!Sfo) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_LIST_SUMM), gShellDebug1HiiHandle,
- ReservedPages, ReservedPagesSize,
- LoadCodePages, LoadCodePagesSize,
- LoadDataPages, LoadDataPagesSize,
- BSCodePages, BSCodePagesSize,
- BSDataPages, BSDataPagesSize,
- RTCodePages, RTCodePagesSize,
- RTDataPages, RTDataPagesSize,
- AcpiReclaimPages, AcpiReclaimPagesSize,
- AcpiNvsPages, AcpiNvsPagesSize,
- MmioSpacePages, MmioSpacePagesSize,
- AvailPages, AvailPagesSize,
- DivU64x32(MultU64x64(SIZE_4KB,TotalPages), SIZE_1MB), TotalPagesSize
- );
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_LIST_SUMM_SFO), gShellDebug1HiiHandle,
- TotalPagesSize,
- MultU64x64(SIZE_4KB,ReservedPages),
- BSCodePagesSize,
- BSDataPagesSize,
- RTCodePagesSize,
- RTDataPagesSize,
- LoadCodePagesSize,
- LoadDataPagesSize,
- AvailPages, AvailPagesSize
- );
- }
- }
- }
- ShellCommandLineFreeVarList (Package);
- }
-
- if (Buffer != NULL) {
- FreePool(Buffer);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
deleted file mode 100644
index 6a21ea4268..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
+++ /dev/null
@@ -1,628 +0,0 @@
-/** @file
- Main file for Mm shell Debug1 function.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include <Library/ShellLib.h>
-#include <Protocol/PciRootBridgeIo.h>
-#include <Protocol/DeviceIo.h>
-
-typedef enum {
- EfiMemory,
- EFIMemoryMappedIo,
- EfiIo,
- EfiPciConfig,
- EfiPciEConfig
-} EFI_ACCESS_TYPE;
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-mmio", TypeFlag},
- {L"-mem", TypeFlag},
- {L"-io", TypeFlag},
- {L"-pci", TypeFlag},
- {L"-pcie", TypeFlag},
- {L"-n", TypeFlag},
- {L"-w", TypeValue},
- {NULL, TypeMax}
- };
-
-STATIC CONST UINT64 MaxNum[9] = { 0xff, 0xffff, 0xffffffff, 0xffffffffffffffffULL };
-
-/**
- Read some data into a buffer from memory.
-
- @param[in] Width The width of each read.
- @param[in] Addresss The memory location to start reading at.
- @param[in] Size The size of Buffer in Width sized units.
- @param[out] Buffer The buffer to read into.
-**/
-VOID
-EFIAPI
-ReadMem (
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Size,
- OUT VOID *Buffer
- )
-{
- //
- // This function is defective. This ASSERT prevents the defect from affecting anything.
- //
- ASSERT(Size == 1);
- do {
- if (Width == EfiPciWidthUint8) {
- *(UINT8 *) Buffer = *(UINT8 *) (UINTN) Address;
- Address -= 1;
- } else if (Width == EfiPciWidthUint16) {
- *(UINT16 *) Buffer = *(UINT16 *) (UINTN) Address;
- Address -= 2;
- } else if (Width == EfiPciWidthUint32) {
- *(UINT32 *) Buffer = *(UINT32 *) (UINTN) Address;
- Address -= 4;
- } else if (Width == EfiPciWidthUint64) {
- *(UINT64 *) Buffer = *(UINT64 *) (UINTN) Address;
- Address -= 8;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_READ_ERROR), gShellDebug1HiiHandle);
- break;
- }
- Size--;
- } while (Size > 0);
-}
-
-/**
- Write some data to memory.
-
- @param[in] Width The width of each write.
- @param[in] Addresss The memory location to start writing at.
- @param[in] Size The size of Buffer in Width sized units.
- @param[in] Buffer The buffer to write from.
-**/
-VOID
-EFIAPI
-WriteMem (
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Size,
- IN VOID *Buffer
- )
-{
- //
- // This function is defective. This ASSERT prevents the defect from affecting anything.
- //
- ASSERT(Size == 1);
- do {
- if (Width == EfiPciWidthUint8) {
- *(UINT8 *) (UINTN) Address = *(UINT8 *) Buffer;
- Address += 1;
- } else if (Width == EfiPciWidthUint16) {
- *(UINT16 *) (UINTN) Address = *(UINT16 *) Buffer;
- Address += 2;
- } else if (Width == EfiPciWidthUint32) {
- *(UINT32 *) (UINTN) Address = *(UINT32 *) Buffer;
- Address += 4;
- } else if (Width == EfiPciWidthUint64) {
- *(UINT64 *) (UINTN) Address = *(UINT64 *) Buffer;
- Address += 8;
- } else {
- ASSERT (FALSE);
- }
- //
- //
- //
- Size--;
- } while (Size > 0);
-}
-
-/**
- Convert a string to it's hex data.
-
- @param[in] str The pointer to the string of hex data.
- @param[out] data The pointer to the buffer to fill. Valid upon a TRUE return.
-
- @retval TRUE The conversion was successful.
- @retval FALSE The conversion failed.
-**/
-BOOLEAN
-EFIAPI
-GetHex (
- IN UINT16 *str,
- OUT UINT64 *data
- )
-{
- UINTN TempUint;
- CHAR16 TempChar;
- BOOLEAN Find;
-
- Find = FALSE;
- //
- // convert hex digits
- //
- TempUint = 0;
- TempChar = *(str++);
- while (TempChar != CHAR_NULL) {
- if (TempChar >= 'a' && TempChar <= 'f') {
- TempChar -= 'a' - 'A';
- }
-
- if (TempChar == ' ') {
- break;
- }
-
- if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
- TempUint = (TempUint << 4) | (TempChar - (TempChar >= 'A' ? 'A' - 10 : '0'));
-
- Find = TRUE;
- } else {
- return FALSE;
- }
-
- TempChar = *(str++);
- }
-
- *data = TempUint;
- return Find;
-}
-
-/**
- Get the PCI-E Address from a PCI address format 0x0000ssbbddffrrr
- where ss is SEGMENT, bb is BUS, dd is DEVICE, ff is FUNCTION
- and rrr is REGISTER (extension format for PCI-E).
-
- @param[in] InputAddress PCI address format on input.
- @param[out]PciEAddress PCI-E address extention format.
-**/
-VOID
-EFIAPI
-GetPciEAddressFromInputAddress (
- IN UINT64 InputAddress,
- OUT UINT64 *PciEAddress
- )
-{
- *PciEAddress = RShiftU64(InputAddress & ~(UINT64) 0xFFF, 4);
- *PciEAddress += LShiftU64((UINT16) InputAddress & 0x0FFF, 32);
-}
-
-/**
- Function for 'mm' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMm (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev;
- UINT64 Address;
- UINT64 PciEAddress;
- UINT64 Value;
- UINT32 SegmentNumber;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width;
- EFI_ACCESS_TYPE AccessType;
- UINT64 Buffer;
- UINTN Index;
- UINTN Size;
- CHAR16 *AddressStr;
-// CHAR16 *ValueStr;
- BOOLEAN Complete;
- CHAR16 *InputStr;
- BOOLEAN Interactive;
- EFI_HANDLE *HandleBuffer;
- UINTN BufferSize;
- UINTN ItemValue;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Temp;
-
- Address = 0;
- PciEAddress = 0;
- IoDev = NULL;
- HandleBuffer = NULL;
- BufferSize = 0;
- SegmentNumber = 0;
- ShellStatus = SHELL_SUCCESS;
- InputStr = NULL;
-
- //
- // Parse arguments
- //
- Width = EfiPciWidthUint8;
- Size = 1;
- AccessType = EfiMemory;
- AddressStr = NULL;
-// ValueStr = NULL;
- Interactive = TRUE;
- Package = NULL;
-
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- } else if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- } else if (ShellCommandLineGetFlag(Package, L"-w") && ShellCommandLineGetValue(Package, L"-w") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"-w");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- } else {
- if (ShellCommandLineGetFlag(Package, L"-mmio")) {
- AccessType = EFIMemoryMappedIo;
- if (ShellCommandLineGetFlag(Package, L"-mem")
- ||ShellCommandLineGetFlag(Package, L"-io")
- ||ShellCommandLineGetFlag(Package, L"-pci")
- ||ShellCommandLineGetFlag(Package, L"-pcie")
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- } else if (ShellCommandLineGetFlag(Package, L"-mem")) {
- AccessType = EfiMemory;
- if (ShellCommandLineGetFlag(Package, L"-io")
- ||ShellCommandLineGetFlag(Package, L"-pci")
- ||ShellCommandLineGetFlag(Package, L"-pcie")
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- } else if (ShellCommandLineGetFlag(Package, L"-io")) {
- AccessType = EfiIo;
- if (ShellCommandLineGetFlag(Package, L"-pci")
- ||ShellCommandLineGetFlag(Package, L"-pcie")
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- } else if (ShellCommandLineGetFlag(Package, L"-pci")) {
- AccessType = EfiPciConfig;
- if (ShellCommandLineGetFlag(Package, L"-pcie")
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- } else if (ShellCommandLineGetFlag(Package, L"-pcie")) {
- AccessType = EfiPciEConfig;
- }
- }
-
- if (ShellCommandLineGetFlag (Package, L"-n")) {
- Interactive = FALSE;
- }
-
- Temp = ShellCommandLineGetValue(Package, L"-w");
- if (Temp != NULL) {
- ItemValue = ShellStrToUintn (Temp);
-
- switch (ItemValue) {
- case 1:
- Width = EfiPciWidthUint8;
- Size = 1;
- break;
-
- case 2:
- Width = EfiPciWidthUint16;
- Size = 2;
- break;
-
- case 4:
- Width = EfiPciWidthUint32;
- Size = 4;
- break;
-
- case 8:
- Width = EfiPciWidthUint64;
- Size = 8;
- break;
-
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDebug1HiiHandle, L"-w");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
-
- Temp = ShellCommandLineGetRawValue(Package, 1);
- if (!ShellIsHexOrDecimalNumber(Temp, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp, (UINT64*)&Address, TRUE, FALSE))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
-
- Temp = ShellCommandLineGetRawValue(Package, 2);
- if (Temp != NULL) {
- if (!ShellIsHexOrDecimalNumber(Temp, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp, &Value, TRUE, FALSE))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- switch (Size) {
- case 1:
- if (Value > 0xFF) {
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- break;
-
- case 2:
- if (Value > 0xFFFF) {
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- break;
-
- case 4:
- if (Value > 0xFFFFFFFF) {
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- break;
-
- default:
- break;
- }
-
- if (ShellStatus != SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
-
- if ((Address & (Size - 1)) != 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_NOT_ALIGNED), gShellDebug1HiiHandle, Address);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- //
- // locate DeviceIO protocol interface
- //
- if (AccessType != EfiMemory) {
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- &BufferSize,
- &HandleBuffer
- );
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- goto Done;
- }
- //
- // In the case of PCI or PCIE
- // Get segment number and mask the segment bits in Address
- //
- if (AccessType == EfiPciEConfig) {
- SegmentNumber = (UINT32) RShiftU64 (Address, 36) & 0xff;
- Address &= 0xfffffffffULL;
- } else {
- if (AccessType == EfiPciConfig) {
- SegmentNumber = (UINT32) RShiftU64 (Address, 32) & 0xff;
- Address &= 0xffffffff;
- }
- }
- //
- // Find the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL of the specified segment number
- //
- for (Index = 0; Index < BufferSize; Index++) {
- Status = gBS->HandleProtocol (
- HandleBuffer[Index],
- &gEfiPciRootBridgeIoProtocolGuid,
- (VOID *) &IoDev
- );
- if (EFI_ERROR (Status)) {
- continue;
- }
- if (IoDev->SegmentNumber != SegmentNumber) {
- IoDev = NULL;
- }
- }
- if (IoDev == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_SEGMENT_NOT_FOUND), gShellDebug1HiiHandle, SegmentNumber);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
-
- if (AccessType == EfiIo && Address + Size > 0x10000) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_ADDRESS_RANGE), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
-
- if (AccessType == EfiPciEConfig) {
- GetPciEAddressFromInputAddress (Address, &PciEAddress);
- }
-
- //
- // Set value
- //
- if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
- if (AccessType == EFIMemoryMappedIo) {
- IoDev->Mem.Write (IoDev, Width, Address, 1, &Value);
- } else if (AccessType == EfiIo) {
- IoDev->Io.Write (IoDev, Width, Address, 1, &Value);
- } else if (AccessType == EfiPciConfig) {
- IoDev->Pci.Write (IoDev, Width, Address, 1, &Value);
- } else if (AccessType == EfiPciEConfig) {
- IoDev->Pci.Write (IoDev, Width, PciEAddress, 1, &Value);
- } else {
- WriteMem (Width, Address, 1, &Value);
- }
-
- ASSERT(ShellStatus == SHELL_SUCCESS);
- goto Done;
- }
-
-
- //
- // non-interactive mode
- //
- if (!Interactive) {
- Buffer = 0;
- if (AccessType == EFIMemoryMappedIo) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_MMIO), gShellDebug1HiiHandle);
- IoDev->Mem.Read (IoDev, Width, Address, 1, &Buffer);
- } else if (AccessType == EfiIo) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_IO), gShellDebug1HiiHandle);
- IoDev->Io.Read (IoDev, Width, Address, 1, &Buffer);
- } else if (AccessType == EfiPciConfig) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_PCI), gShellDebug1HiiHandle);
- IoDev->Pci.Read (IoDev, Width, Address, 1, &Buffer);
- } else if (AccessType == EfiPciEConfig) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_PCIE), gShellDebug1HiiHandle);
- IoDev->Pci.Read (IoDev, Width, PciEAddress, 1, &Buffer);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_MEM), gShellDebug1HiiHandle);
- ReadMem (Width, Address, 1, &Buffer);
- }
-
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_ADDRESS), gShellDebug1HiiHandle, Address);
- if (Size == 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF2), gShellDebug1HiiHandle, Buffer);
- } else if (Size == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF4), gShellDebug1HiiHandle, Buffer);
- } else if (Size == 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF8), gShellDebug1HiiHandle, Buffer);
- } else if (Size == 8) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF16), gShellDebug1HiiHandle, Buffer);
- }
-
- ShellPrintEx(-1, -1, L"\r\n");
-
- ASSERT(ShellStatus == SHELL_SUCCESS);
- goto Done;
- }
- //
- // interactive mode
- //
- Complete = FALSE;
- do {
- if (AccessType == EfiIo && Address + Size > 0x10000) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_ADDRESS_RANGE2), gShellDebug1HiiHandle);
- break;
- }
-
- Buffer = 0;
- if (AccessType == EFIMemoryMappedIo) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_MMIO), gShellDebug1HiiHandle);
- IoDev->Mem.Read (IoDev, Width, Address, 1, &Buffer);
- } else if (AccessType == EfiIo) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_IO), gShellDebug1HiiHandle);
- IoDev->Io.Read (IoDev, Width, Address, 1, &Buffer);
- } else if (AccessType == EfiPciConfig) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_PCI), gShellDebug1HiiHandle);
- IoDev->Pci.Read (IoDev, Width, Address, 1, &Buffer);
- } else if (AccessType == EfiPciEConfig) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_PCIE), gShellDebug1HiiHandle);
- IoDev->Pci.Read (IoDev, Width, PciEAddress, 1, &Buffer);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_MEM), gShellDebug1HiiHandle);
- ReadMem (Width, Address, 1, &Buffer);
- }
-
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_ADDRESS), gShellDebug1HiiHandle, Address);
-
- if (Size == 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF2), gShellDebug1HiiHandle, Buffer);
- } else if (Size == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF4), gShellDebug1HiiHandle, Buffer);
- } else if (Size == 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF8), gShellDebug1HiiHandle, Buffer);
- } else if (Size == 8) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF16), gShellDebug1HiiHandle, Buffer);
- }
- ShellPrintEx(-1, -1, L" > ");
- //
- // wait user input to modify
- //
- if (InputStr != NULL) {
- FreePool(InputStr);
- InputStr = NULL;
- }
- ShellPromptForResponse(ShellPromptResponseTypeFreeform, NULL, (VOID**)&InputStr);
-
- //
- // skip space characters
- //
- for (Index = 0; InputStr != NULL && InputStr[Index] == ' '; Index++);
-
- //
- // parse input string
- //
- if (InputStr != NULL && (InputStr[Index] == '.' || InputStr[Index] == 'q' || InputStr[Index] == 'Q')) {
- Complete = TRUE;
- } else if (InputStr == NULL || InputStr[Index] == CHAR_NULL) {
- //
- // Continue to next address
- //
- } else if (GetHex (InputStr + Index, &Buffer) && Buffer <= MaxNum[Width]) {
- if (AccessType == EFIMemoryMappedIo) {
- IoDev->Mem.Write (IoDev, Width, Address, 1, &Buffer);
- } else if (AccessType == EfiIo) {
- IoDev->Io.Write (IoDev, Width, Address, 1, &Buffer);
- } else if (AccessType == EfiPciConfig) {
- IoDev->Pci.Write (IoDev, Width, Address, 1, &Buffer);
- } else if (AccessType == EfiPciEConfig) {
- IoDev->Pci.Write (IoDev, Width, PciEAddress, 1, &Buffer);
- } else {
- WriteMem (Width, Address, 1, &Buffer);
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR), gShellDebug1HiiHandle);
- continue;
- // PrintToken (STRING_TOKEN (STR_IOMOD_ERROR), HiiHandle);
- }
-
- Address += Size;
- if (AccessType == EfiPciEConfig) {
- GetPciEAddressFromInputAddress (Address, &PciEAddress);
- }
- ShellPrintEx(-1, -1, L"\r\n");
- // Print (L"\n");
- } while (!Complete);
- }
- ASSERT(ShellStatus == SHELL_SUCCESS);
-Done:
-
- if (InputStr != NULL) {
- FreePool(InputStr);
- }
- if (HandleBuffer != NULL) {
- FreePool (HandleBuffer);
- }
- if (Package != NULL) {
- ShellCommandLineFreeVarList (Package);
- }
- return ShellStatus;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c
deleted file mode 100644
index d2b67d5760..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/** @file
- Main file for Mode shell Debug1 function.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the acModeanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which acModeanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-
-/**
- Function for 'mode' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMode (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN NewCol;
- UINTN NewRow;
- UINTN Col;
- UINTN Row;
- CONST CHAR16 *Temp;
- BOOLEAN Done;
- INT32 LoopVar;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) == 3) {
- Temp = ShellCommandLineGetRawValue(Package, 1);
- if (!ShellIsHexOrDecimalNumber(Temp, FALSE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- NewCol = ShellStrToUintn(Temp);
- Temp = ShellCommandLineGetRawValue(Package, 2);
- if (!ShellIsHexOrDecimalNumber(Temp, FALSE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- NewRow = ShellStrToUintn(Temp);
-
- for (LoopVar = 0, Done = FALSE; LoopVar < gST->ConOut->Mode->MaxMode && ShellStatus == SHELL_SUCCESS ; LoopVar++) {
- Status = gST->ConOut->QueryMode(gST->ConOut, LoopVar, &Col, &Row);
- if (EFI_ERROR(Status)) {
- continue;
- }
- if (Col == NewCol && Row == NewRow) {
- Status = gST->ConOut->SetMode(gST->ConOut, LoopVar);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_SET_FAIL), gShellDebug1HiiHandle, Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- } else {
- // worked fine...
- Done = TRUE;
- }
- break;
- }
- }
-
- if (!Done) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_NO_MATCH), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
-
- } else if (ShellCommandLineGetCount(Package) == 1) {
- //
- // print out valid
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_LIST_HEAD), gShellDebug1HiiHandle);
- for (LoopVar = 0, Done = FALSE; LoopVar < gST->ConOut->Mode->MaxMode && ShellStatus == SHELL_SUCCESS ; LoopVar++) {
- Status = gST->ConOut->QueryMode(gST->ConOut, LoopVar, &Col, &Row);
- if (EFI_ERROR(Status)) {
- continue;
- }
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_LIST_ITEM), gShellDebug1HiiHandle, Col, Row, LoopVar == gST->ConOut->Mode->Mode?L'*':L' ');
- }
- }
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
deleted file mode 100644
index e597bbc6b0..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
+++ /dev/null
@@ -1,4709 +0,0 @@
-/** @file
- Main file for Pci shell Debug1 function.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include <Protocol/PciRootBridgeIo.h>
-#include <Library/ShellLib.h>
-#include <IndustryStandard/Pci.h>
-#include <IndustryStandard/Acpi.h>
-#include "Pci.h"
-
-#define PCI_CLASS_STRING_LIMIT 54
-//
-// Printable strings for Pci class code
-//
-typedef struct {
- CHAR16 *BaseClass; // Pointer to the PCI base class string
- CHAR16 *SubClass; // Pointer to the PCI sub class string
- CHAR16 *PIFClass; // Pointer to the PCI programming interface string
-} PCI_CLASS_STRINGS;
-
-//
-// a structure holding a single entry, which also points to its lower level
-// class
-//
-typedef struct PCI_CLASS_ENTRY_TAG {
- UINT8 Code; // Class, subclass or I/F code
- CHAR16 *DescText; // Description string
- struct PCI_CLASS_ENTRY_TAG *LowerLevelClass; // Subclass or I/F if any
-} PCI_CLASS_ENTRY;
-
-//
-// Declarations of entries which contain printable strings for class codes
-// in PCI configuration space
-//
-PCI_CLASS_ENTRY PCIBlankEntry[];
-PCI_CLASS_ENTRY PCISubClass_00[];
-PCI_CLASS_ENTRY PCISubClass_01[];
-PCI_CLASS_ENTRY PCISubClass_02[];
-PCI_CLASS_ENTRY PCISubClass_03[];
-PCI_CLASS_ENTRY PCISubClass_04[];
-PCI_CLASS_ENTRY PCISubClass_05[];
-PCI_CLASS_ENTRY PCISubClass_06[];
-PCI_CLASS_ENTRY PCISubClass_07[];
-PCI_CLASS_ENTRY PCISubClass_08[];
-PCI_CLASS_ENTRY PCISubClass_09[];
-PCI_CLASS_ENTRY PCISubClass_0a[];
-PCI_CLASS_ENTRY PCISubClass_0b[];
-PCI_CLASS_ENTRY PCISubClass_0c[];
-PCI_CLASS_ENTRY PCISubClass_0d[];
-PCI_CLASS_ENTRY PCISubClass_0e[];
-PCI_CLASS_ENTRY PCISubClass_0f[];
-PCI_CLASS_ENTRY PCISubClass_10[];
-PCI_CLASS_ENTRY PCISubClass_11[];
-PCI_CLASS_ENTRY PCIPIFClass_0101[];
-PCI_CLASS_ENTRY PCIPIFClass_0300[];
-PCI_CLASS_ENTRY PCIPIFClass_0604[];
-PCI_CLASS_ENTRY PCIPIFClass_0700[];
-PCI_CLASS_ENTRY PCIPIFClass_0701[];
-PCI_CLASS_ENTRY PCIPIFClass_0703[];
-PCI_CLASS_ENTRY PCIPIFClass_0800[];
-PCI_CLASS_ENTRY PCIPIFClass_0801[];
-PCI_CLASS_ENTRY PCIPIFClass_0802[];
-PCI_CLASS_ENTRY PCIPIFClass_0803[];
-PCI_CLASS_ENTRY PCIPIFClass_0904[];
-PCI_CLASS_ENTRY PCIPIFClass_0c00[];
-PCI_CLASS_ENTRY PCIPIFClass_0c03[];
-PCI_CLASS_ENTRY PCIPIFClass_0e00[];
-
-//
-// Base class strings entries
-//
-PCI_CLASS_ENTRY gClassStringList[] = {
- {
- 0x00,
- L"Pre 2.0 device",
- PCISubClass_00
- },
- {
- 0x01,
- L"Mass Storage Controller",
- PCISubClass_01
- },
- {
- 0x02,
- L"Network Controller",
- PCISubClass_02
- },
- {
- 0x03,
- L"Display Controller",
- PCISubClass_03
- },
- {
- 0x04,
- L"Multimedia Device",
- PCISubClass_04
- },
- {
- 0x05,
- L"Memory Controller",
- PCISubClass_05
- },
- {
- 0x06,
- L"Bridge Device",
- PCISubClass_06
- },
- {
- 0x07,
- L"Simple Communications Controllers",
- PCISubClass_07
- },
- {
- 0x08,
- L"Base System Peripherals",
- PCISubClass_08
- },
- {
- 0x09,
- L"Input Devices",
- PCISubClass_09
- },
- {
- 0x0a,
- L"Docking Stations",
- PCISubClass_0a
- },
- {
- 0x0b,
- L"Processors",
- PCISubClass_0b
- },
- {
- 0x0c,
- L"Serial Bus Controllers",
- PCISubClass_0c
- },
- {
- 0x0d,
- L"Wireless Controllers",
- PCISubClass_0d
- },
- {
- 0x0e,
- L"Intelligent IO Controllers",
- PCISubClass_0e
- },
- {
- 0x0f,
- L"Satellite Communications Controllers",
- PCISubClass_0f
- },
- {
- 0x10,
- L"Encryption/Decryption Controllers",
- PCISubClass_10
- },
- {
- 0x11,
- L"Data Acquisition & Signal Processing Controllers",
- PCISubClass_11
- },
- {
- 0xff,
- L"Device does not fit in any defined classes",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-//
-// Subclass strings entries
-//
-PCI_CLASS_ENTRY PCIBlankEntry[] = {
- {
- 0x00,
- L"",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_00[] = {
- {
- 0x00,
- L"All devices other than VGA",
- PCIBlankEntry
- },
- {
- 0x01,
- L"VGA-compatible devices",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_01[] = {
- {
- 0x00,
- L"SCSI controller",
- PCIBlankEntry
- },
- {
- 0x01,
- L"IDE controller",
- PCIPIFClass_0101
- },
- {
- 0x02,
- L"Floppy disk controller",
- PCIBlankEntry
- },
- {
- 0x03,
- L"IPI controller",
- PCIBlankEntry
- },
- {
- 0x04,
- L"RAID controller",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other mass storage controller",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_02[] = {
- {
- 0x00,
- L"Ethernet controller",
- PCIBlankEntry
- },
- {
- 0x01,
- L"Token ring controller",
- PCIBlankEntry
- },
- {
- 0x02,
- L"FDDI controller",
- PCIBlankEntry
- },
- {
- 0x03,
- L"ATM controller",
- PCIBlankEntry
- },
- {
- 0x04,
- L"ISDN controller",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other network controller",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_03[] = {
- {
- 0x00,
- L"VGA/8514 controller",
- PCIPIFClass_0300
- },
- {
- 0x01,
- L"XGA controller",
- PCIBlankEntry
- },
- {
- 0x02,
- L"3D controller",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other display controller",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */PCIBlankEntry
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_04[] = {
- {
- 0x00,
- L"Video device",
- PCIBlankEntry
- },
- {
- 0x01,
- L"Audio device",
- PCIBlankEntry
- },
- {
- 0x02,
- L"Computer Telephony device",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other multimedia device",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_05[] = {
- {
- 0x00,
- L"RAM memory controller",
- PCIBlankEntry
- },
- {
- 0x01,
- L"Flash memory controller",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other memory controller",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_06[] = {
- {
- 0x00,
- L"Host/PCI bridge",
- PCIBlankEntry
- },
- {
- 0x01,
- L"PCI/ISA bridge",
- PCIBlankEntry
- },
- {
- 0x02,
- L"PCI/EISA bridge",
- PCIBlankEntry
- },
- {
- 0x03,
- L"PCI/Micro Channel bridge",
- PCIBlankEntry
- },
- {
- 0x04,
- L"PCI/PCI bridge",
- PCIPIFClass_0604
- },
- {
- 0x05,
- L"PCI/PCMCIA bridge",
- PCIBlankEntry
- },
- {
- 0x06,
- L"NuBus bridge",
- PCIBlankEntry
- },
- {
- 0x07,
- L"CardBus bridge",
- PCIBlankEntry
- },
- {
- 0x08,
- L"RACEway bridge",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other bridge type",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_07[] = {
- {
- 0x00,
- L"Serial controller",
- PCIPIFClass_0700
- },
- {
- 0x01,
- L"Parallel port",
- PCIPIFClass_0701
- },
- {
- 0x02,
- L"Multiport serial controller",
- PCIBlankEntry
- },
- {
- 0x03,
- L"Modem",
- PCIPIFClass_0703
- },
- {
- 0x80,
- L"Other communication device",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_08[] = {
- {
- 0x00,
- L"PIC",
- PCIPIFClass_0800
- },
- {
- 0x01,
- L"DMA controller",
- PCIPIFClass_0801
- },
- {
- 0x02,
- L"System timer",
- PCIPIFClass_0802
- },
- {
- 0x03,
- L"RTC controller",
- PCIPIFClass_0803
- },
- {
- 0x04,
- L"Generic PCI Hot-Plug controller",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other system peripheral",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_09[] = {
- {
- 0x00,
- L"Keyboard controller",
- PCIBlankEntry
- },
- {
- 0x01,
- L"Digitizer (pen)",
- PCIBlankEntry
- },
- {
- 0x02,
- L"Mouse controller",
- PCIBlankEntry
- },
- {
- 0x03,
- L"Scanner controller",
- PCIBlankEntry
- },
- {
- 0x04,
- L"Gameport controller",
- PCIPIFClass_0904
- },
- {
- 0x80,
- L"Other input controller",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_0a[] = {
- {
- 0x00,
- L"Generic docking station",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other type of docking station",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_0b[] = {
- {
- 0x00,
- L"386",
- PCIBlankEntry
- },
- {
- 0x01,
- L"486",
- PCIBlankEntry
- },
- {
- 0x02,
- L"Pentium",
- PCIBlankEntry
- },
- {
- 0x10,
- L"Alpha",
- PCIBlankEntry
- },
- {
- 0x20,
- L"PowerPC",
- PCIBlankEntry
- },
- {
- 0x30,
- L"MIPS",
- PCIBlankEntry
- },
- {
- 0x40,
- L"Co-processor",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other processor",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_0c[] = {
- {
- 0x00,
- L"Firewire(IEEE 1394)",
- PCIPIFClass_0c03
- },
- {
- 0x01,
- L"ACCESS.bus",
- PCIBlankEntry
- },
- {
- 0x02,
- L"SSA",
- PCIBlankEntry
- },
- {
- 0x03,
- L"USB",
- PCIPIFClass_0c00
- },
- {
- 0x04,
- L"Fibre Channel",
- PCIBlankEntry
- },
- {
- 0x05,
- L"System Management Bus",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other bus type",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_0d[] = {
- {
- 0x00,
- L"iRDA compatible controller",
- PCIBlankEntry
- },
- {
- 0x01,
- L"Consumer IR controller",
- PCIBlankEntry
- },
- {
- 0x10,
- L"RF controller",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other type of wireless controller",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_0e[] = {
- {
- 0x00,
- L"I2O Architecture",
- PCIPIFClass_0e00
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_0f[] = {
- {
- 0x00,
- L"TV",
- PCIBlankEntry
- },
- {
- 0x01,
- L"Audio",
- PCIBlankEntry
- },
- {
- 0x02,
- L"Voice",
- PCIBlankEntry
- },
- {
- 0x03,
- L"Data",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_10[] = {
- {
- 0x00,
- L"Network & computing Encrypt/Decrypt",
- PCIBlankEntry
- },
- {
- 0x01,
- L"Entertainment Encrypt/Decrypt",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other Encrypt/Decrypt",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCISubClass_11[] = {
- {
- 0x00,
- L"DPIO modules",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Other DAQ & SP controllers",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-//
-// Programming Interface entries
-//
-PCI_CLASS_ENTRY PCIPIFClass_0101[] = {
- {
- 0x00,
- L"",
- PCIBlankEntry
- },
- {
- 0x01,
- L"OM-primary",
- PCIBlankEntry
- },
- {
- 0x02,
- L"PI-primary",
- PCIBlankEntry
- },
- {
- 0x03,
- L"OM/PI-primary",
- PCIBlankEntry
- },
- {
- 0x04,
- L"OM-secondary",
- PCIBlankEntry
- },
- {
- 0x05,
- L"OM-primary, OM-secondary",
- PCIBlankEntry
- },
- {
- 0x06,
- L"PI-primary, OM-secondary",
- PCIBlankEntry
- },
- {
- 0x07,
- L"OM/PI-primary, OM-secondary",
- PCIBlankEntry
- },
- {
- 0x08,
- L"OM-secondary",
- PCIBlankEntry
- },
- {
- 0x09,
- L"OM-primary, PI-secondary",
- PCIBlankEntry
- },
- {
- 0x0a,
- L"PI-primary, PI-secondary",
- PCIBlankEntry
- },
- {
- 0x0b,
- L"OM/PI-primary, PI-secondary",
- PCIBlankEntry
- },
- {
- 0x0c,
- L"OM-secondary",
- PCIBlankEntry
- },
- {
- 0x0d,
- L"OM-primary, OM/PI-secondary",
- PCIBlankEntry
- },
- {
- 0x0e,
- L"PI-primary, OM/PI-secondary",
- PCIBlankEntry
- },
- {
- 0x0f,
- L"OM/PI-primary, OM/PI-secondary",
- PCIBlankEntry
- },
- {
- 0x80,
- L"Master",
- PCIBlankEntry
- },
- {
- 0x81,
- L"Master, OM-primary",
- PCIBlankEntry
- },
- {
- 0x82,
- L"Master, PI-primary",
- PCIBlankEntry
- },
- {
- 0x83,
- L"Master, OM/PI-primary",
- PCIBlankEntry
- },
- {
- 0x84,
- L"Master, OM-secondary",
- PCIBlankEntry
- },
- {
- 0x85,
- L"Master, OM-primary, OM-secondary",
- PCIBlankEntry
- },
- {
- 0x86,
- L"Master, PI-primary, OM-secondary",
- PCIBlankEntry
- },
- {
- 0x87,
- L"Master, OM/PI-primary, OM-secondary",
- PCIBlankEntry
- },
- {
- 0x88,
- L"Master, OM-secondary",
- PCIBlankEntry
- },
- {
- 0x89,
- L"Master, OM-primary, PI-secondary",
- PCIBlankEntry
- },
- {
- 0x8a,
- L"Master, PI-primary, PI-secondary",
- PCIBlankEntry
- },
- {
- 0x8b,
- L"Master, OM/PI-primary, PI-secondary",
- PCIBlankEntry
- },
- {
- 0x8c,
- L"Master, OM-secondary",
- PCIBlankEntry
- },
- {
- 0x8d,
- L"Master, OM-primary, OM/PI-secondary",
- PCIBlankEntry
- },
- {
- 0x8e,
- L"Master, PI-primary, OM/PI-secondary",
- PCIBlankEntry
- },
- {
- 0x8f,
- L"Master, OM/PI-primary, OM/PI-secondary",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0300[] = {
- {
- 0x00,
- L"VGA compatible",
- PCIBlankEntry
- },
- {
- 0x01,
- L"8514 compatible",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0604[] = {
- {
- 0x00,
- L"",
- PCIBlankEntry
- },
- {
- 0x01,
- L"Subtractive decode",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0700[] = {
- {
- 0x00,
- L"Generic XT-compatible",
- PCIBlankEntry
- },
- {
- 0x01,
- L"16450-compatible",
- PCIBlankEntry
- },
- {
- 0x02,
- L"16550-compatible",
- PCIBlankEntry
- },
- {
- 0x03,
- L"16650-compatible",
- PCIBlankEntry
- },
- {
- 0x04,
- L"16750-compatible",
- PCIBlankEntry
- },
- {
- 0x05,
- L"16850-compatible",
- PCIBlankEntry
- },
- {
- 0x06,
- L"16950-compatible",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0701[] = {
- {
- 0x00,
- L"",
- PCIBlankEntry
- },
- {
- 0x01,
- L"Bi-directional",
- PCIBlankEntry
- },
- {
- 0x02,
- L"ECP 1.X-compliant",
- PCIBlankEntry
- },
- {
- 0x03,
- L"IEEE 1284",
- PCIBlankEntry
- },
- {
- 0xfe,
- L"IEEE 1284 target (not a controller)",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0703[] = {
- {
- 0x00,
- L"Generic",
- PCIBlankEntry
- },
- {
- 0x01,
- L"Hayes-compatible 16450",
- PCIBlankEntry
- },
- {
- 0x02,
- L"Hayes-compatible 16550",
- PCIBlankEntry
- },
- {
- 0x03,
- L"Hayes-compatible 16650",
- PCIBlankEntry
- },
- {
- 0x04,
- L"Hayes-compatible 16750",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0800[] = {
- {
- 0x00,
- L"Generic 8259",
- PCIBlankEntry
- },
- {
- 0x01,
- L"ISA",
- PCIBlankEntry
- },
- {
- 0x02,
- L"EISA",
- PCIBlankEntry
- },
- {
- 0x10,
- L"IO APIC",
- PCIBlankEntry
- },
- {
- 0x20,
- L"IO(x) APIC interrupt controller",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0801[] = {
- {
- 0x00,
- L"Generic 8237",
- PCIBlankEntry
- },
- {
- 0x01,
- L"ISA",
- PCIBlankEntry
- },
- {
- 0x02,
- L"EISA",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0802[] = {
- {
- 0x00,
- L"Generic 8254",
- PCIBlankEntry
- },
- {
- 0x01,
- L"ISA",
- PCIBlankEntry
- },
- {
- 0x02,
- L"EISA",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0803[] = {
- {
- 0x00,
- L"Generic",
- PCIBlankEntry
- },
- {
- 0x01,
- L"ISA",
- PCIBlankEntry
- },
- {
- 0x02,
- L"EISA",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0904[] = {
- {
- 0x00,
- L"Generic",
- PCIBlankEntry
- },
- {
- 0x10,
- L"",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0c00[] = {
- {
- 0x00,
- L"Universal Host Controller spec",
- PCIBlankEntry
- },
- {
- 0x10,
- L"Open Host Controller spec",
- PCIBlankEntry
- },
- {
- 0x80,
- L"No specific programming interface",
- PCIBlankEntry
- },
- {
- 0xfe,
- L"(Not Host Controller)",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0c03[] = {
- {
- 0x00,
- L"",
- PCIBlankEntry
- },
- {
- 0x10,
- L"Using 1394 OpenHCI spec",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-PCI_CLASS_ENTRY PCIPIFClass_0e00[] = {
- {
- 0x00,
- L"Message FIFO at offset 40h",
- PCIBlankEntry
- },
- {
- 0x01,
- L"",
- PCIBlankEntry
- },
- {
- 0x00,
- NULL,
- /* null string ends the list */NULL
- }
-};
-
-
-/**
- Generates printable Unicode strings that represent PCI device class,
- subclass and programmed I/F based on a value passed to the function.
-
- @param[in] ClassCode Value representing the PCI "Class Code" register read from a
- PCI device. The encodings are:
- bits 23:16 - Base Class Code
- bits 15:8 - Sub-Class Code
- bits 7:0 - Programming Interface
- @param[in, out] ClassStrings Pointer of PCI_CLASS_STRINGS structure, which contains
- printable class strings corresponding to ClassCode. The
- caller must not modify the strings that are pointed by
- the fields in ClassStrings.
-**/
-VOID
-PciGetClassStrings (
- IN UINT32 ClassCode,
- IN OUT PCI_CLASS_STRINGS *ClassStrings
- )
-{
- INTN Index;
- UINT8 Code;
- PCI_CLASS_ENTRY *CurrentClass;
-
- //
- // Assume no strings found
- //
- ClassStrings->BaseClass = L"UNDEFINED";
- ClassStrings->SubClass = L"UNDEFINED";
- ClassStrings->PIFClass = L"UNDEFINED";
-
- CurrentClass = gClassStringList;
- Code = (UINT8) (ClassCode >> 16);
- Index = 0;
-
- //
- // Go through all entries of the base class, until the entry with a matching
- // base class code is found. If reaches an entry with a null description
- // text, the last entry is met, which means no text for the base class was
- // found, so no more action is needed.
- //
- while (Code != CurrentClass[Index].Code) {
- if (NULL == CurrentClass[Index].DescText) {
- return ;
- }
-
- Index++;
- }
- //
- // A base class was found. Assign description, and check if this class has
- // sub-class defined. If sub-class defined, no more action is needed,
- // otherwise, continue to find description for the sub-class code.
- //
- ClassStrings->BaseClass = CurrentClass[Index].DescText;
- if (NULL == CurrentClass[Index].LowerLevelClass) {
- return ;
- }
- //
- // find Subclass entry
- //
- CurrentClass = CurrentClass[Index].LowerLevelClass;
- Code = (UINT8) (ClassCode >> 8);
- Index = 0;
-
- //
- // Go through all entries of the sub-class, until the entry with a matching
- // sub-class code is found. If reaches an entry with a null description
- // text, the last entry is met, which means no text for the sub-class was
- // found, so no more action is needed.
- //
- while (Code != CurrentClass[Index].Code) {
- if (NULL == CurrentClass[Index].DescText) {
- return ;
- }
-
- Index++;
- }
- //
- // A class was found for the sub-class code. Assign description, and check if
- // this sub-class has programming interface defined. If no, no more action is
- // needed, otherwise, continue to find description for the programming
- // interface.
- //
- ClassStrings->SubClass = CurrentClass[Index].DescText;
- if (NULL == CurrentClass[Index].LowerLevelClass) {
- return ;
- }
- //
- // Find programming interface entry
- //
- CurrentClass = CurrentClass[Index].LowerLevelClass;
- Code = (UINT8) ClassCode;
- Index = 0;
-
- //
- // Go through all entries of the I/F entries, until the entry with a
- // matching I/F code is found. If reaches an entry with a null description
- // text, the last entry is met, which means no text was found, so no more
- // action is needed.
- //
- while (Code != CurrentClass[Index].Code) {
- if (NULL == CurrentClass[Index].DescText) {
- return ;
- }
-
- Index++;
- }
- //
- // A class was found for the I/F code. Assign description, done!
- //
- ClassStrings->PIFClass = CurrentClass[Index].DescText;
- return ;
-}
-
-/**
- Print strings that represent PCI device class, subclass and programmed I/F.
-
- @param[in] ClassCodePtr Points to the memory which stores register Class Code in PCI
- configuation space.
- @param[in] IncludePIF If the printed string should include the programming I/F part
-**/
-VOID
-PciPrintClassCode (
- IN UINT8 *ClassCodePtr,
- IN BOOLEAN IncludePIF
- )
-{
- UINT32 ClassCode;
- PCI_CLASS_STRINGS ClassStrings;
- CHAR16 OutputString[PCI_CLASS_STRING_LIMIT + 1];
-
- ClassCode = 0;
- ClassCode |= ClassCodePtr[0];
- ClassCode |= (ClassCodePtr[1] << 8);
- ClassCode |= (ClassCodePtr[2] << 16);
-
- //
- // Get name from class code
- //
- PciGetClassStrings (ClassCode, &ClassStrings);
-
- if (IncludePIF) {
- //
- // Only print base class and sub class name
- //
- ShellPrintEx(-1,-1, L"%s - %s - %s",
- ClassStrings.BaseClass,
- ClassStrings.SubClass,
- ClassStrings.PIFClass
- );
-
- } else {
- //
- // Print base class, sub class, and programming inferface name
- //
- UnicodeSPrint (
- OutputString,
- PCI_CLASS_STRING_LIMIT * sizeof (CHAR16),
- L"%s - %s",
- ClassStrings.BaseClass,
- ClassStrings.SubClass
- );
-
- OutputString[PCI_CLASS_STRING_LIMIT] = 0;
- ShellPrintEx(-1,-1, L"%s", OutputString);
- }
-}
-
-/**
- This function finds out the protocol which is in charge of the given
- segment, and its bus range covers the current bus number. It lookes
- each instances of RootBridgeIoProtocol handle, until the one meets the
- criteria is found.
-
- @param[in] HandleBuf Buffer which holds all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles.
- @param[in] HandleCount Count of all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles.
- @param[in] Segment Segment number of device we are dealing with.
- @param[in] Bus Bus number of device we are dealing with.
- @param[out] IoDev Handle used to access configuration space of PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
- @retval EFI_INVALID_PARAMETER Invalid parameter.
-
-**/
-EFI_STATUS
-PciFindProtocolInterface (
- IN EFI_HANDLE *HandleBuf,
- IN UINTN HandleCount,
- IN UINT16 Segment,
- IN UINT16 Bus,
- OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev
- );
-
-/**
- This function gets the protocol interface from the given handle, and
- obtains its address space descriptors.
-
- @param[in] Handle The PCI_ROOT_BRIDIGE_IO_PROTOCOL handle.
- @param[out] IoDev Handle used to access configuration space of PCI device.
- @param[out] Descriptors Points to the address space descriptors.
-
- @retval EFI_SUCCESS The command completed successfully
-**/
-EFI_STATUS
-PciGetProtocolAndResource (
- IN EFI_HANDLE Handle,
- OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev,
- OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors
- );
-
-/**
- This function get the next bus range of given address space descriptors.
- It also moves the pointer backward a node, to get prepared to be called
- again.
-
- @param[in, out] Descriptors Points to current position of a serial of address space
- descriptors.
- @param[out] MinBus The lower range of bus number.
- @param[out] MaxBus The upper range of bus number.
- @param[out] IsEnd Meet end of the serial of descriptors.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciGetNextBusRange (
- IN OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors,
- OUT UINT16 *MinBus,
- OUT UINT16 *MaxBus,
- OUT BOOLEAN *IsEnd
- );
-
-/**
- Explain the data in PCI configuration space. The part which is common for
- PCI device and bridge is interpreted in this function. It calls other
- functions to interpret data unique for device or bridge.
-
- @param[in] ConfigSpace Data in PCI configuration space.
- @param[in] Address Address used to access configuration space of this PCI device.
- @param[in] IoDev Handle used to access configuration space of PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainData (
- IN PCI_CONFIG_SPACE *ConfigSpace,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
- );
-
-/**
- Explain the device specific part of data in PCI configuration space.
-
- @param[in] Device Data in PCI configuration space.
- @param[in] Address Address used to access configuration space of this PCI device.
- @param[in] IoDev Handle used to access configuration space of PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainDeviceData (
- IN PCI_DEVICE_HEADER *Device,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
- );
-
-/**
- Explain the bridge specific part of data in PCI configuration space.
-
- @param[in] Bridge Bridge specific data region in PCI configuration space.
- @param[in] Address Address used to access configuration space of this PCI device.
- @param[in] IoDev Handle used to access configuration space of PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainBridgeData (
- IN PCI_BRIDGE_HEADER *Bridge,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
- );
-
-/**
- Explain the Base Address Register(Bar) in PCI configuration space.
-
- @param[in] Bar Points to the Base Address Register intended to interpret.
- @param[in] Command Points to the register Command.
- @param[in] Address Address used to access configuration space of this PCI device.
- @param[in] IoDev Handle used to access configuration space of PCI device.
- @param[in, out] Index The Index.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainBar (
- IN UINT32 *Bar,
- IN UINT16 *Command,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
- IN OUT UINTN *Index
- );
-
-/**
- Explain the cardbus specific part of data in PCI configuration space.
-
- @param[in] CardBus CardBus specific region of PCI configuration space.
- @param[in] Address Address used to access configuration space of this PCI device.
- @param[in] IoDev Handle used to access configuration space of PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainCardBusData (
- IN PCI_CARDBUS_HEADER *CardBus,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
- );
-
-/**
- Explain each meaningful bit of register Status. The definition of Status is
- slightly different depending on the PCI header type.
-
- @param[in] Status Points to the content of register Status.
- @param[in] MainStatus Indicates if this register is main status(not secondary
- status).
- @param[in] HeaderType Header type of this PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainStatus (
- IN UINT16 *Status,
- IN BOOLEAN MainStatus,
- IN PCI_HEADER_TYPE HeaderType
- );
-
-/**
- Explain each meaningful bit of register Command.
-
- @param[in] Command Points to the content of register Command.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainCommand (
- IN UINT16 *Command
- );
-
-/**
- Explain each meaningful bit of register Bridge Control.
-
- @param[in] BridgeControl Points to the content of register Bridge Control.
- @param[in] HeaderType The headertype.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainBridgeControl (
- IN UINT16 *BridgeControl,
- IN PCI_HEADER_TYPE HeaderType
- );
-
-/**
- Print each capability structure.
-
- @param[in] IoDev The pointer to the deivce.
- @param[in] Address The address to start at.
- @param[in] CapPtr The offset from the address.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-PciExplainCapabilityStruct (
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
- IN UINT64 Address,
- IN UINT8 CapPtr
- );
-
-/**
- Display Pcie device structure.
-
- @param[in] IoDev The pointer to the root pci protocol.
- @param[in] Address The Address to start at.
- @param[in] CapabilityPtr The offset from the address to start.
-**/
-EFI_STATUS
-PciExplainPciExpress (
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
- IN UINT64 Address,
- IN UINT8 CapabilityPtr
- );
-
-/**
- Print out information of the capability information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieCapReg (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device capability information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieDeviceCap (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device control information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieDeviceControl (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device status information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieDeviceStatus (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device link information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieLinkCap (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device link control information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieLinkControl (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device link status information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieLinkStatus (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device slot information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieSlotCap (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device slot control information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieSlotControl (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device slot status information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieSlotStatus (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device root information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieRootControl (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device root capability information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieRootCap (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-/**
- Print out information of the device root status information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieRootStatus (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- );
-
-typedef EFI_STATUS (*PCIE_EXPLAIN_FUNCTION) (IN PCIE_CAP_STURCTURE *PciExpressCap);
-
-typedef enum {
- FieldWidthUINT8,
- FieldWidthUINT16,
- FieldWidthUINT32
-} PCIE_CAPREG_FIELD_WIDTH;
-
-typedef enum {
- PcieExplainTypeCommon,
- PcieExplainTypeDevice,
- PcieExplainTypeLink,
- PcieExplainTypeSlot,
- PcieExplainTypeRoot,
- PcieExplainTypeMax
-} PCIE_EXPLAIN_TYPE;
-
-typedef struct
-{
- UINT16 Token;
- UINTN Offset;
- PCIE_CAPREG_FIELD_WIDTH Width;
- PCIE_EXPLAIN_FUNCTION Func;
- PCIE_EXPLAIN_TYPE Type;
-} PCIE_EXPLAIN_STRUCT;
-
-PCIE_EXPLAIN_STRUCT PcieExplainList[] = {
- {
- STRING_TOKEN (STR_PCIEX_CAPABILITY_CAPID),
- 0x00,
- FieldWidthUINT8,
- NULL,
- PcieExplainTypeCommon
- },
- {
- STRING_TOKEN (STR_PCIEX_NEXTCAP_PTR),
- 0x01,
- FieldWidthUINT8,
- NULL,
- PcieExplainTypeCommon
- },
- {
- STRING_TOKEN (STR_PCIEX_CAP_REGISTER),
- 0x02,
- FieldWidthUINT16,
- ExplainPcieCapReg,
- PcieExplainTypeCommon
- },
- {
- STRING_TOKEN (STR_PCIEX_DEVICE_CAP),
- 0x04,
- FieldWidthUINT32,
- ExplainPcieDeviceCap,
- PcieExplainTypeDevice
- },
- {
- STRING_TOKEN (STR_PCIEX_DEVICE_CONTROL),
- 0x08,
- FieldWidthUINT16,
- ExplainPcieDeviceControl,
- PcieExplainTypeDevice
- },
- {
- STRING_TOKEN (STR_PCIEX_DEVICE_STATUS),
- 0x0a,
- FieldWidthUINT16,
- ExplainPcieDeviceStatus,
- PcieExplainTypeDevice
- },
- {
- STRING_TOKEN (STR_PCIEX_LINK_CAPABILITIES),
- 0x0c,
- FieldWidthUINT32,
- ExplainPcieLinkCap,
- PcieExplainTypeLink
- },
- {
- STRING_TOKEN (STR_PCIEX_LINK_CONTROL),
- 0x10,
- FieldWidthUINT16,
- ExplainPcieLinkControl,
- PcieExplainTypeLink
- },
- {
- STRING_TOKEN (STR_PCIEX_LINK_STATUS),
- 0x12,
- FieldWidthUINT16,
- ExplainPcieLinkStatus,
- PcieExplainTypeLink
- },
- {
- STRING_TOKEN (STR_PCIEX_SLOT_CAPABILITIES),
- 0x14,
- FieldWidthUINT32,
- ExplainPcieSlotCap,
- PcieExplainTypeSlot
- },
- {
- STRING_TOKEN (STR_PCIEX_SLOT_CONTROL),
- 0x18,
- FieldWidthUINT16,
- ExplainPcieSlotControl,
- PcieExplainTypeSlot
- },
- {
- STRING_TOKEN (STR_PCIEX_SLOT_STATUS),
- 0x1a,
- FieldWidthUINT16,
- ExplainPcieSlotStatus,
- PcieExplainTypeSlot
- },
- {
- STRING_TOKEN (STR_PCIEX_ROOT_CONTROL),
- 0x1c,
- FieldWidthUINT16,
- ExplainPcieRootControl,
- PcieExplainTypeRoot
- },
- {
- STRING_TOKEN (STR_PCIEX_RSVDP),
- 0x1e,
- FieldWidthUINT16,
- ExplainPcieRootCap,
- PcieExplainTypeRoot
- },
- {
- STRING_TOKEN (STR_PCIEX_ROOT_STATUS),
- 0x20,
- FieldWidthUINT32,
- ExplainPcieRootStatus,
- PcieExplainTypeRoot
- },
- {
- 0,
- 0,
- (PCIE_CAPREG_FIELD_WIDTH)0,
- NULL,
- PcieExplainTypeMax
- }
-};
-
-//
-// Global Variables
-//
-PCI_CONFIG_SPACE *mConfigSpace = NULL;
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-s", TypeValue},
- {L"-i", TypeFlag},
- {NULL, TypeMax}
- };
-
-CHAR16 *DevicePortTypeTable[] = {
- L"PCI Express Endpoint",
- L"Legacy PCI Express Endpoint",
- L"Unknown Type",
- L"Unknonw Type",
- L"Root Port of PCI Express Root Complex",
- L"Upstream Port of PCI Express Switch",
- L"Downstream Port of PCI Express Switch",
- L"PCI Express to PCI/PCI-X Bridge",
- L"PCI/PCI-X to PCI Express Bridge",
- L"Root Complex Integrated Endpoint",
- L"Root Complex Event Collector"
-};
-
-CHAR16 *L0sLatencyStrTable[] = {
- L"Less than 64ns",
- L"64ns to less than 128ns",
- L"128ns to less than 256ns",
- L"256ns to less than 512ns",
- L"512ns to less than 1us",
- L"1us to less than 2us",
- L"2us-4us",
- L"More than 4us"
-};
-
-CHAR16 *L1LatencyStrTable[] = {
- L"Less than 1us",
- L"1us to less than 2us",
- L"2us to less than 4us",
- L"4us to less than 8us",
- L"8us to less than 16us",
- L"16us to less than 32us",
- L"32us-64us",
- L"More than 64us"
-};
-
-CHAR16 *ASPMCtrlStrTable[] = {
- L"Disabled",
- L"L0s Entry Enabled",
- L"L1 Entry Enabled",
- L"L0s and L1 Entry Enabled"
-};
-
-CHAR16 *SlotPwrLmtScaleTable[] = {
- L"1.0x",
- L"0.1x",
- L"0.01x",
- L"0.001x"
-};
-
-CHAR16 *IndicatorTable[] = {
- L"Reserved",
- L"On",
- L"Blink",
- L"Off"
-};
-
-
-/**
- Function for 'pci' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunPci (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- UINT16 Segment;
- UINT16 Bus;
- UINT16 Device;
- UINT16 Func;
- UINT64 Address;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev;
- EFI_STATUS Status;
- PCI_COMMON_HEADER PciHeader;
- PCI_CONFIG_SPACE ConfigSpace;
- UINTN ScreenCount;
- UINTN TempColumn;
- UINTN ScreenSize;
- BOOLEAN ExplainData;
- UINTN Index;
- UINTN SizeOfHeader;
- BOOLEAN PrintTitle;
- UINTN HandleBufSize;
- EFI_HANDLE *HandleBuf;
- UINTN HandleCount;
- EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptors;
- UINT16 MinBus;
- UINT16 MaxBus;
- BOOLEAN IsEnd;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN Size;
- CONST CHAR16 *Temp;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- Address = 0;
- Size = 0;
- IoDev = NULL;
- HandleBuf = NULL;
- Package = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
-
- if (ShellCommandLineGetCount(Package) == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
-
- if (ShellCommandLineGetCount(Package) > 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetValue(Package, L"-s") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"-s");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- //
- // Get all instances of PciRootBridgeIo. Allocate space for 1 EFI_HANDLE and
- // call LibLocateHandle(), if EFI_BUFFER_TOO_SMALL is returned, allocate enough
- // space for handles and call it again.
- //
- HandleBufSize = sizeof (EFI_HANDLE);
- HandleBuf = (EFI_HANDLE *) AllocateZeroPool (HandleBufSize);
- if (HandleBuf == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- goto Done;
- }
-
- Status = gBS->LocateHandle (
- ByProtocol,
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- &HandleBufSize,
- HandleBuf
- );
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- HandleBuf = ReallocatePool (sizeof (EFI_HANDLE), HandleBufSize, HandleBuf);
- if (HandleBuf == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- goto Done;
- }
-
- Status = gBS->LocateHandle (
- ByProtocol,
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- &HandleBufSize,
- HandleBuf
- );
- }
-
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- goto Done;
- }
-
- HandleCount = HandleBufSize / sizeof (EFI_HANDLE);
- //
- // Argument Count == 1(no other argument): enumerate all pci functions
- //
- if (ShellCommandLineGetCount(Package) == 1) {
- gST->ConOut->QueryMode (
- gST->ConOut,
- gST->ConOut->Mode->Mode,
- &TempColumn,
- &ScreenSize
- );
-
- ScreenCount = 0;
- ScreenSize -= 4;
- if ((ScreenSize & 1) == 1) {
- ScreenSize -= 1;
- }
-
- PrintTitle = TRUE;
-
- //
- // For each handle, which decides a segment and a bus number range,
- // enumerate all devices on it.
- //
- for (Index = 0; Index < HandleCount; Index++) {
- Status = PciGetProtocolAndResource (
- HandleBuf[Index],
- &IoDev,
- &Descriptors
- );
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_HANDLE_CFG_ERR), gShellDebug1HiiHandle, Status);
- ShellStatus = SHELL_NOT_FOUND;
- goto Done;
- }
- //
- // No document say it's impossible for a RootBridgeIo protocol handle
- // to have more than one address space descriptors, so find out every
- // bus range and for each of them do device enumeration.
- //
- while (TRUE) {
- Status = PciGetNextBusRange (&Descriptors, &MinBus, &MaxBus, &IsEnd);
-
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_BUS_RANGE_ERR), gShellDebug1HiiHandle, Status);
- ShellStatus = SHELL_NOT_FOUND;
- goto Done;
- }
-
- if (IsEnd) {
- break;
- }
-
- for (Bus = MinBus; Bus <= MaxBus; Bus++) {
- //
- // For each devices, enumerate all functions it contains
- //
- for (Device = 0; Device <= PCI_MAX_DEVICE; Device++) {
- //
- // For each function, read its configuration space and print summary
- //
- for (Func = 0; Func <= PCI_MAX_FUNC; Func++) {
- if (ShellGetExecutionBreakFlag ()) {
- ShellStatus = SHELL_ABORTED;
- goto Done;
- }
- Address = CALC_EFI_PCI_ADDRESS (Bus, Device, Func, 0);
- IoDev->Pci.Read (
- IoDev,
- EfiPciWidthUint16,
- Address,
- 1,
- &PciHeader.VendorId
- );
-
- //
- // If VendorId = 0xffff, there does not exist a device at this
- // location. For each device, if there is any function on it,
- // there must be 1 function at Function 0. So if Func = 0, there
- // will be no more functions in the same device, so we can break
- // loop to deal with the next device.
- //
- if (PciHeader.VendorId == 0xffff && Func == 0) {
- break;
- }
-
- if (PciHeader.VendorId != 0xffff) {
-
- if (PrintTitle) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_TITLE), gShellDebug1HiiHandle);
- PrintTitle = FALSE;
- }
-
- IoDev->Pci.Read (
- IoDev,
- EfiPciWidthUint32,
- Address,
- sizeof (PciHeader) / sizeof (UINT32),
- &PciHeader
- );
-
- ShellPrintHiiEx(
- -1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_P1), gShellDebug1HiiHandle,
- IoDev->SegmentNumber,
- Bus,
- Device,
- Func
- );
-
- PciPrintClassCode (PciHeader.ClassCode, FALSE);
- ShellPrintHiiEx(
- -1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_P2), gShellDebug1HiiHandle,
- PciHeader.VendorId,
- PciHeader.DeviceId,
- PciHeader.ClassCode[0]
- );
-
- ScreenCount += 2;
- if (ScreenCount >= ScreenSize && ScreenSize != 0) {
- //
- // If ScreenSize == 0 we have the console redirected so don't
- // block updates
- //
- ScreenCount = 0;
- }
- //
- // If this is not a multi-function device, we can leave the loop
- // to deal with the next device.
- //
- if (Func == 0 && ((PciHeader.HeaderType & HEADER_TYPE_MULTI_FUNCTION) == 0x00)) {
- break;
- }
- }
- }
- }
- }
- //
- // If Descriptor is NULL, Configuration() returns EFI_UNSUPPRORED,
- // we assume the bus range is 0~PCI_MAX_BUS. After enumerated all
- // devices on all bus, we can leave loop.
- //
- if (Descriptors == NULL) {
- break;
- }
- }
- }
-
- Status = EFI_SUCCESS;
- goto Done;
- }
-
- ExplainData = FALSE;
- Segment = 0;
- Bus = 0;
- Device = 0;
- Func = 0;
- if (ShellCommandLineGetFlag(Package, L"-i")) {
- ExplainData = TRUE;
- }
-
- Temp = ShellCommandLineGetValue(Package, L"-s");
- if (Temp != NULL) {
- Segment = (UINT16) ShellStrToUintn (Temp);
- }
-
- //
- // The first Argument(except "-i") is assumed to be Bus number, second
- // to be Device number, and third to be Func number.
- //
- Temp = ShellCommandLineGetRawValue(Package, 1);
- if (Temp != NULL) {
- Bus = (UINT16)ShellStrToUintn(Temp);
- if (Bus > MAX_BUS_NUMBER) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
- Temp = ShellCommandLineGetRawValue(Package, 2);
- if (Temp != NULL) {
- Device = (UINT16) ShellStrToUintn(Temp);
- if (Device > MAX_DEVICE_NUMBER){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
-
- Temp = ShellCommandLineGetRawValue(Package, 3);
- if (Temp != NULL) {
- Func = (UINT16) ShellStrToUintn(Temp);
- if (Func > MAX_FUNCTION_NUMBER){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
-
- //
- // Find the protocol interface who's in charge of current segment, and its
- // bus range covers the current bus
- //
- Status = PciFindProtocolInterface (
- HandleBuf,
- HandleCount,
- Segment,
- Bus,
- &IoDev
- );
-
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(
- -1, -1, NULL, STRING_TOKEN (STR_PCI_NO_FIND), gShellDebug1HiiHandle,
- gShellDebug1HiiHandle,
- Segment,
- Bus
- );
- ShellStatus = SHELL_NOT_FOUND;
- goto Done;
- }
-
- Address = CALC_EFI_PCI_ADDRESS (Bus, Device, Func, 0);
- Status = IoDev->Pci.Read (
- IoDev,
- EfiPciWidthUint8,
- Address,
- sizeof (ConfigSpace),
- &ConfigSpace
- );
-
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_NO_CFG), gShellDebug1HiiHandle, Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- goto Done;
- }
-
- mConfigSpace = &ConfigSpace;
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_PCI_INFO),
- gShellDebug1HiiHandle,
- Segment,
- Bus,
- Device,
- Func,
- Segment,
- Bus,
- Device,
- Func
- );
-
- //
- // Dump standard header of configuration space
- //
- SizeOfHeader = sizeof (ConfigSpace.Common) + sizeof (ConfigSpace.NonCommon);
-
- DumpHex (2, 0, SizeOfHeader, &ConfigSpace);
- ShellPrintEx(-1,-1, L"\r\n");
-
- //
- // Dump device dependent Part of configuration space
- //
- DumpHex (
- 2,
- SizeOfHeader,
- sizeof (ConfigSpace) - SizeOfHeader,
- ConfigSpace.Data
- );
-
- //
- // If "-i" appears in command line, interpret data in configuration space
- //
- if (ExplainData) {
- Status = PciExplainData (&ConfigSpace, Address, IoDev);
- }
- }
-Done:
- if (HandleBuf != NULL) {
- FreePool (HandleBuf);
- }
- if (Package != NULL) {
- ShellCommandLineFreeVarList (Package);
- }
- mConfigSpace = NULL;
- return ShellStatus;
-}
-
-/**
- This function finds out the protocol which is in charge of the given
- segment, and its bus range covers the current bus number. It lookes
- each instances of RootBridgeIoProtocol handle, until the one meets the
- criteria is found.
-
- @param[in] HandleBuf Buffer which holds all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles.
- @param[in] HandleCount Count of all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles.
- @param[in] Segment Segment number of device we are dealing with.
- @param[in] Bus Bus number of device we are dealing with.
- @param[out] IoDev Handle used to access configuration space of PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
- @retval EFI_INVALID_PARAMETER Invalid parameter.
-
-**/
-EFI_STATUS
-PciFindProtocolInterface (
- IN EFI_HANDLE *HandleBuf,
- IN UINTN HandleCount,
- IN UINT16 Segment,
- IN UINT16 Bus,
- OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev
- )
-{
- UINTN Index;
- EFI_STATUS Status;
- BOOLEAN FoundInterface;
- EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptors;
- UINT16 MinBus;
- UINT16 MaxBus;
- BOOLEAN IsEnd;
-
- FoundInterface = FALSE;
- //
- // Go through all handles, until the one meets the criteria is found
- //
- for (Index = 0; Index < HandleCount; Index++) {
- Status = PciGetProtocolAndResource (HandleBuf[Index], IoDev, &Descriptors);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // When Descriptors == NULL, the Configuration() is not implemented,
- // so we only check the Segment number
- //
- if (Descriptors == NULL && Segment == (*IoDev)->SegmentNumber) {
- return EFI_SUCCESS;
- }
-
- if ((*IoDev)->SegmentNumber != Segment) {
- continue;
- }
-
- while (TRUE) {
- Status = PciGetNextBusRange (&Descriptors, &MinBus, &MaxBus, &IsEnd);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if (IsEnd) {
- break;
- }
-
- if (MinBus <= Bus && MaxBus >= Bus) {
- FoundInterface = TRUE;
- break;
- }
- }
- }
-
- if (FoundInterface) {
- return EFI_SUCCESS;
- } else {
- return EFI_INVALID_PARAMETER;
- }
-}
-
-/**
- This function gets the protocol interface from the given handle, and
- obtains its address space descriptors.
-
- @param[in] Handle The PCI_ROOT_BRIDIGE_IO_PROTOCOL handle.
- @param[out] IoDev Handle used to access configuration space of PCI device.
- @param[out] Descriptors Points to the address space descriptors.
-
- @retval EFI_SUCCESS The command completed successfully
-**/
-EFI_STATUS
-PciGetProtocolAndResource (
- IN EFI_HANDLE Handle,
- OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev,
- OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors
- )
-{
- EFI_STATUS Status;
-
- //
- // Get inferface from protocol
- //
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiPciRootBridgeIoProtocolGuid,
- (VOID**)IoDev
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // Call Configuration() to get address space descriptors
- //
- Status = (*IoDev)->Configuration (*IoDev, (VOID**)Descriptors);
- if (Status == EFI_UNSUPPORTED) {
- *Descriptors = NULL;
- return EFI_SUCCESS;
-
- } else {
- return Status;
- }
-}
-
-/**
- This function get the next bus range of given address space descriptors.
- It also moves the pointer backward a node, to get prepared to be called
- again.
-
- @param[in, out] Descriptors Points to current position of a serial of address space
- descriptors.
- @param[out] MinBus The lower range of bus number.
- @param[out] MaxBus The upper range of bus number.
- @param[out] IsEnd Meet end of the serial of descriptors.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciGetNextBusRange (
- IN OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors,
- OUT UINT16 *MinBus,
- OUT UINT16 *MaxBus,
- OUT BOOLEAN *IsEnd
- )
-{
- *IsEnd = FALSE;
-
- //
- // When *Descriptors is NULL, Configuration() is not implemented, so assume
- // range is 0~PCI_MAX_BUS
- //
- if ((*Descriptors) == NULL) {
- *MinBus = 0;
- *MaxBus = PCI_MAX_BUS;
- return EFI_SUCCESS;
- }
- //
- // *Descriptors points to one or more address space descriptors, which
- // ends with a end tagged descriptor. Examine each of the descriptors,
- // if a bus typed one is found and its bus range covers bus, this handle
- // is the handle we are looking for.
- //
-
- while ((*Descriptors)->Desc != ACPI_END_TAG_DESCRIPTOR) {
- if ((*Descriptors)->ResType == ACPI_ADDRESS_SPACE_TYPE_BUS) {
- *MinBus = (UINT16) (*Descriptors)->AddrRangeMin;
- *MaxBus = (UINT16) (*Descriptors)->AddrRangeMax;
- (*Descriptors)++;
- return (EFI_SUCCESS);
- }
-
- (*Descriptors)++;
- }
-
- if ((*Descriptors)->Desc == ACPI_END_TAG_DESCRIPTOR) {
- *IsEnd = TRUE;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Explain the data in PCI configuration space. The part which is common for
- PCI device and bridge is interpreted in this function. It calls other
- functions to interpret data unique for device or bridge.
-
- @param[in] ConfigSpace Data in PCI configuration space.
- @param[in] Address Address used to access configuration space of this PCI device.
- @param[in] IoDev Handle used to access configuration space of PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainData (
- IN PCI_CONFIG_SPACE *ConfigSpace,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
- )
-{
- PCI_COMMON_HEADER *Common;
- PCI_HEADER_TYPE HeaderType;
- EFI_STATUS Status;
- UINT8 CapPtr;
-
- Common = &(ConfigSpace->Common);
-
- Print (L"\n");
-
- //
- // Print Vendor Id and Device Id
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_VID_DID), gShellDebug1HiiHandle,
- INDEX_OF (&(Common->VendorId)),
- Common->VendorId,
- INDEX_OF (&(Common->DeviceId)),
- Common->DeviceId
- );
-
- //
- // Print register Command
- //
- PciExplainCommand (&(Common->Command));
-
- //
- // Print register Status
- //
- PciExplainStatus (&(Common->Status), TRUE, PciUndefined);
-
- //
- // Print register Revision ID
- //
- ShellPrintEx(-1, -1, L"/r/n");
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_RID), gShellDebug1HiiHandle,
- INDEX_OF (&(Common->RevisionId)),
- Common->RevisionId
- );
-
- //
- // Print register BIST
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_BIST), gShellDebug1HiiHandle, INDEX_OF (&(Common->Bist)));
- if ((Common->Bist & PCI_BIT_7) != 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_CAP), gShellDebug1HiiHandle, 0x0f & Common->Bist);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_CAP_NO), gShellDebug1HiiHandle);
- }
- //
- // Print register Cache Line Size
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_CACHE_LINE_SIZE),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Common->CacheLineSize)),
- Common->CacheLineSize
- );
-
- //
- // Print register Latency Timer
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_LATENCY_TIMER),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Common->PrimaryLatencyTimer)),
- Common->PrimaryLatencyTimer
- );
-
- //
- // Print register Header Type
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_HEADER_TYPE),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Common->HeaderType)),
- Common->HeaderType
- );
-
- if ((Common->HeaderType & PCI_BIT_7) != 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MULTI_FUNCTION), gShellDebug1HiiHandle);
-
- } else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_SINGLE_FUNCTION), gShellDebug1HiiHandle);
- }
-
- HeaderType = (PCI_HEADER_TYPE)(UINT8) (Common->HeaderType & 0x7f);
- switch (HeaderType) {
- case PciDevice:
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_PCI_DEVICE), gShellDebug1HiiHandle);
- break;
-
- case PciP2pBridge:
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_P2P_BRIDGE), gShellDebug1HiiHandle);
- break;
-
- case PciCardBusBridge:
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_CARDBUS_BRIDGE), gShellDebug1HiiHandle);
- break;
-
- default:
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RESERVED), gShellDebug1HiiHandle);
- HeaderType = PciUndefined;
- }
-
- //
- // Print register Class Code
- //
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_CLASS), gShellDebug1HiiHandle);
- PciPrintClassCode ((UINT8 *) Common->ClassCode, TRUE);
- Print (L"\n");
-
- if (ShellGetExecutionBreakFlag()) {
- return EFI_SUCCESS;
- }
-
- //
- // Interpret remaining part of PCI configuration header depending on
- // HeaderType
- //
- CapPtr = 0;
- Status = EFI_SUCCESS;
- switch (HeaderType) {
- case PciDevice:
- Status = PciExplainDeviceData (
- &(ConfigSpace->NonCommon.Device),
- Address,
- IoDev
- );
- CapPtr = ConfigSpace->NonCommon.Device.CapabilitiesPtr;
- break;
-
- case PciP2pBridge:
- Status = PciExplainBridgeData (
- &(ConfigSpace->NonCommon.Bridge),
- Address,
- IoDev
- );
- CapPtr = ConfigSpace->NonCommon.Bridge.CapabilitiesPtr;
- break;
-
- case PciCardBusBridge:
- Status = PciExplainCardBusData (
- &(ConfigSpace->NonCommon.CardBus),
- Address,
- IoDev
- );
- CapPtr = ConfigSpace->NonCommon.CardBus.CapabilitiesPtr;
- break;
- case PciUndefined:
- default:
- break;
- }
- //
- // If Status bit4 is 1, dump or explain capability structure
- //
- if ((Common->Status) & EFI_PCI_STATUS_CAPABILITY) {
- PciExplainCapabilityStruct (IoDev, Address, CapPtr);
- }
-
- return Status;
-}
-
-/**
- Explain the device specific part of data in PCI configuration space.
-
- @param[in] Device Data in PCI configuration space.
- @param[in] Address Address used to access configuration space of this PCI device.
- @param[in] IoDev Handle used to access configuration space of PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainDeviceData (
- IN PCI_DEVICE_HEADER *Device,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
- )
-{
- UINTN Index;
- BOOLEAN BarExist;
- EFI_STATUS Status;
- UINTN BarCount;
-
- //
- // Print Base Address Registers(Bar). When Bar = 0, this Bar does not
- // exist. If these no Bar for this function, print "none", otherwise
- // list detail information about this Bar.
- //
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BASE_ADDR), gShellDebug1HiiHandle, INDEX_OF (Device->Bar));
-
- BarExist = FALSE;
- BarCount = sizeof (Device->Bar) / sizeof (Device->Bar[0]);
- for (Index = 0; Index < BarCount; Index++) {
- if (Device->Bar[Index] == 0) {
- continue;
- }
-
- if (!BarExist) {
- BarExist = TRUE;
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_START_TYPE), gShellDebug1HiiHandle);
- Print (L" --------------------------------------------------------------------------");
- }
-
- Status = PciExplainBar (
- &(Device->Bar[Index]),
- &(mConfigSpace->Common.Command),
- Address,
- IoDev,
- &Index
- );
-
- if (EFI_ERROR (Status)) {
- break;
- }
- }
-
- if (!BarExist) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NONE), gShellDebug1HiiHandle);
-
- } else {
- Print (L"\n --------------------------------------------------------------------------");
- }
-
- //
- // Print register Expansion ROM Base Address
- //
- if ((Device->ROMBar & PCI_BIT_0) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_EXPANSION_ROM_DISABLED), gShellDebug1HiiHandle, INDEX_OF (&(Device->ROMBar)));
-
- } else {
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_EXPANSION_ROM_BASE),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Device->ROMBar)),
- Device->ROMBar
- );
- }
- //
- // Print register Cardbus CIS ptr
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_CARDBUS_CIS),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Device->CardBusCISPtr)),
- Device->CardBusCISPtr
- );
-
- //
- // Print register Sub-vendor ID and subsystem ID
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SUB_VENDOR_ID),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Device->SubVendorId)),
- Device->SubVendorId
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SUBSYSTEM_ID),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Device->SubSystemId)),
- Device->SubSystemId
- );
-
- //
- // Print register Capabilities Ptr
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_CAPABILITIES_PTR),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Device->CapabilitiesPtr)),
- Device->CapabilitiesPtr
- );
-
- //
- // Print register Interrupt Line and interrupt pin
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_INTERRUPT_LINE),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Device->InterruptLine)),
- Device->InterruptLine
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_INTERRUPT_PIN),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Device->InterruptPin)),
- Device->InterruptPin
- );
-
- //
- // Print register Min_Gnt and Max_Lat
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_MIN_GNT),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Device->MinGnt)),
- Device->MinGnt
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_MAX_LAT),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Device->MaxLat)),
- Device->MaxLat
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Explain the bridge specific part of data in PCI configuration space.
-
- @param[in] Bridge Bridge specific data region in PCI configuration space.
- @param[in] Address Address used to access configuration space of this PCI device.
- @param[in] IoDev Handle used to access configuration space of PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainBridgeData (
- IN PCI_BRIDGE_HEADER *Bridge,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
- )
-{
- UINTN Index;
- BOOLEAN BarExist;
- UINTN BarCount;
- UINT32 IoAddress32;
- EFI_STATUS Status;
-
- //
- // Print Base Address Registers. When Bar = 0, this Bar does not
- // exist. If these no Bar for this function, print "none", otherwise
- // list detail information about this Bar.
- //
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BASE_ADDRESS), gShellDebug1HiiHandle, INDEX_OF (&(Bridge->Bar)));
-
- BarExist = FALSE;
- BarCount = sizeof (Bridge->Bar) / sizeof (Bridge->Bar[0]);
-
- for (Index = 0; Index < BarCount; Index++) {
- if (Bridge->Bar[Index] == 0) {
- continue;
- }
-
- if (!BarExist) {
- BarExist = TRUE;
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_START_TYPE_2), gShellDebug1HiiHandle);
- Print (L" --------------------------------------------------------------------------");
- }
-
- Status = PciExplainBar (
- &(Bridge->Bar[Index]),
- &(mConfigSpace->Common.Command),
- Address,
- IoDev,
- &Index
- );
-
- if (EFI_ERROR (Status)) {
- break;
- }
- }
-
- if (!BarExist) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NONE), gShellDebug1HiiHandle);
- } else {
- Print (L"\n --------------------------------------------------------------------------");
- }
-
- //
- // Expansion register ROM Base Address
- //
- if ((Bridge->ROMBar & PCI_BIT_0) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NO_EXPANSION_ROM), gShellDebug1HiiHandle, INDEX_OF (&(Bridge->ROMBar)));
-
- } else {
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_EXPANSION_ROM_BASE_2),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Bridge->ROMBar)),
- Bridge->ROMBar
- );
- }
- //
- // Print Bus Numbers(Primary, Secondary, and Subordinate
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_BUS_NUMBERS),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Bridge->PrimaryBus)),
- INDEX_OF (&(Bridge->SecondaryBus)),
- INDEX_OF (&(Bridge->SubordinateBus))
- );
-
- Print (L" ------------------------------------------------------\n");
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BRIDGE), gShellDebug1HiiHandle, Bridge->PrimaryBus);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BRIDGE), gShellDebug1HiiHandle, Bridge->SecondaryBus);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BRIDGE), gShellDebug1HiiHandle, Bridge->SubordinateBus);
-
- //
- // Print register Secondary Latency Timer
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SECONDARY_TIMER),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Bridge->SecondaryLatencyTimer)),
- Bridge->SecondaryLatencyTimer
- );
-
- //
- // Print register Secondary Status
- //
- PciExplainStatus (&(Bridge->SecondaryStatus), FALSE, PciP2pBridge);
-
- //
- // Print I/O and memory ranges this bridge forwards. There are 3 resource
- // types: I/O, memory, and pre-fetchable memory. For each resource type,
- // base and limit address are listed.
- //
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RESOURCE_TYPE), gShellDebug1HiiHandle);
- Print (L"----------------------------------------------------------------------\n");
-
- //
- // IO Base & Limit
- //
- IoAddress32 = (Bridge->IoBaseUpper << 16 | Bridge->IoBase << 8);
- IoAddress32 &= 0xfffff000;
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_TWO_VARS),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Bridge->IoBase)),
- IoAddress32
- );
-
- IoAddress32 = (Bridge->IoLimitUpper << 16 | Bridge->IoLimit << 8);
- IoAddress32 |= 0x00000fff;
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_ONE_VAR), gShellDebug1HiiHandle, IoAddress32);
-
- //
- // Memory Base & Limit
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_MEMORY),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Bridge->MemoryBase)),
- (Bridge->MemoryBase << 16) & 0xfff00000
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_ONE_VAR),
- gShellDebug1HiiHandle,
- (Bridge->MemoryLimit << 16) | 0x000fffff
- );
-
- //
- // Pre-fetch-able Memory Base & Limit
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_PREFETCHABLE),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Bridge->PrefetchableMemBase)),
- Bridge->PrefetchableBaseUpper,
- (Bridge->PrefetchableMemBase << 16) & 0xfff00000
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_TWO_VARS_2),
- gShellDebug1HiiHandle,
- Bridge->PrefetchableLimitUpper,
- (Bridge->PrefetchableMemLimit << 16) | 0x000fffff
- );
-
- //
- // Print register Capabilities Pointer
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_CAPABILITIES_PTR_2),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Bridge->CapabilitiesPtr)),
- Bridge->CapabilitiesPtr
- );
-
- //
- // Print register Bridge Control
- //
- PciExplainBridgeControl (&(Bridge->BridgeControl), PciP2pBridge);
-
- //
- // Print register Interrupt Line & PIN
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_INTERRUPT_LINE_2),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Bridge->InterruptLine)),
- Bridge->InterruptLine
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_INTERRUPT_PIN),
- gShellDebug1HiiHandle,
- INDEX_OF (&(Bridge->InterruptPin)),
- Bridge->InterruptPin
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Explain the Base Address Register(Bar) in PCI configuration space.
-
- @param[in] Bar Points to the Base Address Register intended to interpret.
- @param[in] Command Points to the register Command.
- @param[in] Address Address used to access configuration space of this PCI device.
- @param[in] IoDev Handle used to access configuration space of PCI device.
- @param[in, out] Index The Index.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainBar (
- IN UINT32 *Bar,
- IN UINT16 *Command,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
- IN OUT UINTN *Index
- )
-{
- UINT16 OldCommand;
- UINT16 NewCommand;
- UINT64 Bar64;
- UINT32 OldBar32;
- UINT32 NewBar32;
- UINT64 OldBar64;
- UINT64 NewBar64;
- BOOLEAN IsMem;
- BOOLEAN IsBar32;
- UINT64 RegAddress;
-
- IsBar32 = TRUE;
- Bar64 = 0;
- NewBar32 = 0;
- NewBar64 = 0;
-
- //
- // According the bar type, list detail about this bar, for example: 32 or
- // 64 bits; pre-fetchable or not.
- //
- if ((*Bar & PCI_BIT_0) == 0) {
- //
- // This bar is of memory type
- //
- IsMem = TRUE;
-
- if ((*Bar & PCI_BIT_1) == 0 && (*Bar & PCI_BIT_2) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BAR), gShellDebug1HiiHandle, *Bar & 0xfffffff0);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MEM), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_32_BITS), gShellDebug1HiiHandle);
-
- } else if ((*Bar & PCI_BIT_1) == 0 && (*Bar & PCI_BIT_2) != 0) {
- Bar64 = 0x0;
- CopyMem (&Bar64, Bar, sizeof (UINT64));
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_ONE_VAR_2), gShellDebug1HiiHandle, RShiftU64 ((Bar64 & 0xfffffffffffffff0ULL), 32));
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_ONE_VAR_3), gShellDebug1HiiHandle, (UINT32) (Bar64 & 0xfffffffffffffff0ULL));
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MEM), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_64_BITS), gShellDebug1HiiHandle);
- IsBar32 = FALSE;
- *Index += 1;
-
- } else {
- //
- // Reserved
- //
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BAR), gShellDebug1HiiHandle, *Bar & 0xfffffff0);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MEM_2), gShellDebug1HiiHandle);
- }
-
- if ((*Bar & PCI_BIT_3) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NO), gShellDebug1HiiHandle);
-
- } else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_YES), gShellDebug1HiiHandle);
- }
-
- } else {
- //
- // This bar is of io type
- //
- IsMem = FALSE;
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_ONE_VAR_4), gShellDebug1HiiHandle, *Bar & 0xfffffffc);
- Print (L"I/O ");
- }
-
- //
- // Get BAR length(or the amount of resource this bar demands for). To get
- // Bar length, first we should temporarily disable I/O and memory access
- // of this function(by set bits in the register Command), then write all
- // "1"s to this bar. The bar value read back is the amount of resource
- // this bar demands for.
- //
- //
- // Disable io & mem access
- //
- OldCommand = *Command;
- NewCommand = (UINT16) (OldCommand & 0xfffc);
- RegAddress = Address | INDEX_OF (Command);
- IoDev->Pci.Write (IoDev, EfiPciWidthUint16, RegAddress, 1, &NewCommand);
-
- RegAddress = Address | INDEX_OF (Bar);
-
- //
- // Read after write the BAR to get the size
- //
- if (IsBar32) {
- OldBar32 = *Bar;
- NewBar32 = 0xffffffff;
-
- IoDev->Pci.Write (IoDev, EfiPciWidthUint32, RegAddress, 1, &NewBar32);
- IoDev->Pci.Read (IoDev, EfiPciWidthUint32, RegAddress, 1, &NewBar32);
- IoDev->Pci.Write (IoDev, EfiPciWidthUint32, RegAddress, 1, &OldBar32);
-
- if (IsMem) {
- NewBar32 = NewBar32 & 0xfffffff0;
- NewBar32 = (~NewBar32) + 1;
-
- } else {
- NewBar32 = NewBar32 & 0xfffffffc;
- NewBar32 = (~NewBar32) + 1;
- NewBar32 = NewBar32 & 0x0000ffff;
- }
- } else {
-
- OldBar64 = 0x0;
- CopyMem (&OldBar64, Bar, sizeof (UINT64));
- NewBar64 = 0xffffffffffffffffULL;
-
- IoDev->Pci.Write (IoDev, EfiPciWidthUint32, RegAddress, 2, &NewBar64);
- IoDev->Pci.Read (IoDev, EfiPciWidthUint32, RegAddress, 2, &NewBar64);
- IoDev->Pci.Write (IoDev, EfiPciWidthUint32, RegAddress, 2, &OldBar64);
-
- if (IsMem) {
- NewBar64 = NewBar64 & 0xfffffffffffffff0ULL;
- NewBar64 = (~NewBar64) + 1;
-
- } else {
- NewBar64 = NewBar64 & 0xfffffffffffffffcULL;
- NewBar64 = (~NewBar64) + 1;
- NewBar64 = NewBar64 & 0x000000000000ffff;
- }
- }
- //
- // Enable io & mem access
- //
- RegAddress = Address | INDEX_OF (Command);
- IoDev->Pci.Write (IoDev, EfiPciWidthUint16, RegAddress, 1, &OldCommand);
-
- if (IsMem) {
- if (IsBar32) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NEWBAR_32), gShellDebug1HiiHandle, NewBar32);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NEWBAR_32_2), gShellDebug1HiiHandle, NewBar32 + (*Bar & 0xfffffff0) - 1);
-
- } else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RSHIFT), gShellDebug1HiiHandle, RShiftU64 (NewBar64, 32));
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RSHIFT), gShellDebug1HiiHandle, (UINT32) NewBar64);
- Print (L" ");
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_RSHIFT),
- gShellDebug1HiiHandle,
- RShiftU64 ((NewBar64 + (Bar64 & 0xfffffffffffffff0ULL) - 1), 32)
- );
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RSHIFT), gShellDebug1HiiHandle, (UINT32) (NewBar64 + (Bar64 & 0xfffffffffffffff0ULL) - 1));
-
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NEWBAR_32_3), gShellDebug1HiiHandle, NewBar32);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NEWBAR_32_4), gShellDebug1HiiHandle, NewBar32 + (*Bar & 0xfffffffc) - 1);
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Explain the cardbus specific part of data in PCI configuration space.
-
- @param[in] CardBus CardBus specific region of PCI configuration space.
- @param[in] Address Address used to access configuration space of this PCI device.
- @param[in] IoDev Handle used to access configuration space of PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainCardBusData (
- IN PCI_CARDBUS_HEADER *CardBus,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
- )
-{
- BOOLEAN Io32Bit;
- PCI_CARDBUS_DATA *CardBusData;
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_CARDBUS_SOCKET),
- gShellDebug1HiiHandle,
- INDEX_OF (&(CardBus->CardBusSocketReg)),
- CardBus->CardBusSocketReg
- );
-
- //
- // Print Secondary Status
- //
- PciExplainStatus (&(CardBus->SecondaryStatus), FALSE, PciCardBusBridge);
-
- //
- // Print Bus Numbers(Primary bus number, CardBus bus number, and
- // Subordinate bus number
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_BUS_NUMBERS_2),
- gShellDebug1HiiHandle,
- INDEX_OF (&(CardBus->PciBusNumber)),
- INDEX_OF (&(CardBus->CardBusBusNumber)),
- INDEX_OF (&(CardBus->SubordinateBusNumber))
- );
-
- Print (L" ------------------------------------------------------\n");
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_CARDBUS), gShellDebug1HiiHandle, CardBus->PciBusNumber);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_CARDBUS_2), gShellDebug1HiiHandle, CardBus->CardBusBusNumber);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_CARDBUS_3), gShellDebug1HiiHandle, CardBus->SubordinateBusNumber);
-
- //
- // Print CardBus Latency Timer
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_CARDBUS_LATENCY),
- gShellDebug1HiiHandle,
- INDEX_OF (&(CardBus->CardBusLatencyTimer)),
- CardBus->CardBusLatencyTimer
- );
-
- //
- // Print Memory/Io ranges this cardbus bridge forwards
- //
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RESOURCE_TYPE_2), gShellDebug1HiiHandle);
- Print (L"----------------------------------------------------------------------\n");
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_MEM_3),
- gShellDebug1HiiHandle,
- INDEX_OF (&(CardBus->MemoryBase0)),
- CardBus->BridgeControl & PCI_BIT_8 ? L" Prefetchable" : L"Non-Prefetchable",
- CardBus->MemoryBase0 & 0xfffff000,
- CardBus->MemoryLimit0 | 0x00000fff
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_MEM_3),
- gShellDebug1HiiHandle,
- INDEX_OF (&(CardBus->MemoryBase1)),
- CardBus->BridgeControl & PCI_BIT_9 ? L" Prefetchable" : L"Non-Prefetchable",
- CardBus->MemoryBase1 & 0xfffff000,
- CardBus->MemoryLimit1 | 0x00000fff
- );
-
- Io32Bit = (BOOLEAN) (CardBus->IoBase0 & PCI_BIT_0);
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_IO_2),
- gShellDebug1HiiHandle,
- INDEX_OF (&(CardBus->IoBase0)),
- Io32Bit ? L" 32 bit" : L" 16 bit",
- CardBus->IoBase0 & (Io32Bit ? 0xfffffffc : 0x0000fffc),
- (CardBus->IoLimit0 & (Io32Bit ? 0xffffffff : 0x0000ffff)) | 0x00000003
- );
-
- Io32Bit = (BOOLEAN) (CardBus->IoBase1 & PCI_BIT_0);
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_IO_2),
- gShellDebug1HiiHandle,
- INDEX_OF (&(CardBus->IoBase1)),
- Io32Bit ? L" 32 bit" : L" 16 bit",
- CardBus->IoBase1 & (Io32Bit ? 0xfffffffc : 0x0000fffc),
- (CardBus->IoLimit1 & (Io32Bit ? 0xffffffff : 0x0000ffff)) | 0x00000003
- );
-
- //
- // Print register Interrupt Line & PIN
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_INTERRUPT_LINE_3),
- gShellDebug1HiiHandle,
- INDEX_OF (&(CardBus->InterruptLine)),
- CardBus->InterruptLine,
- INDEX_OF (&(CardBus->InterruptPin)),
- CardBus->InterruptPin
- );
-
- //
- // Print register Bridge Control
- //
- PciExplainBridgeControl (&(CardBus->BridgeControl), PciCardBusBridge);
-
- //
- // Print some registers in data region of PCI configuration space for cardbus
- // bridge. Fields include: Sub VendorId, Subsystem ID, and Legacy Mode Base
- // Address.
- //
- CardBusData = (PCI_CARDBUS_DATA *) ((UINT8 *) CardBus + sizeof (PCI_CARDBUS_HEADER));
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SUB_VENDOR_ID_2),
- gShellDebug1HiiHandle,
- INDEX_OF (&(CardBusData->SubVendorId)),
- CardBusData->SubVendorId,
- INDEX_OF (&(CardBusData->SubSystemId)),
- CardBusData->SubSystemId
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_OPTIONAL),
- gShellDebug1HiiHandle,
- INDEX_OF (&(CardBusData->LegacyBase)),
- CardBusData->LegacyBase
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Explain each meaningful bit of register Status. The definition of Status is
- slightly different depending on the PCI header type.
-
- @param[in] Status Points to the content of register Status.
- @param[in] MainStatus Indicates if this register is main status(not secondary
- status).
- @param[in] HeaderType Header type of this PCI device.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainStatus (
- IN UINT16 *Status,
- IN BOOLEAN MainStatus,
- IN PCI_HEADER_TYPE HeaderType
- )
-{
- if (MainStatus) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_STATUS), gShellDebug1HiiHandle, INDEX_OF (Status), *Status);
-
- } else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_SECONDARY_STATUS), gShellDebug1HiiHandle, INDEX_OF (Status), *Status);
- }
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NEW_CAPABILITIES), gShellDebug1HiiHandle, (*Status & PCI_BIT_4) != 0);
-
- //
- // Bit 5 is meaningless for CardBus Bridge
- //
- if (HeaderType == PciCardBusBridge) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_66_CAPABLE), gShellDebug1HiiHandle, (*Status & PCI_BIT_5) != 0);
-
- } else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_66_CAPABLE_2), gShellDebug1HiiHandle, (*Status & PCI_BIT_5) != 0);
- }
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_FAST_BACK), gShellDebug1HiiHandle, (*Status & PCI_BIT_7) != 0);
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MASTER_DATA), gShellDebug1HiiHandle, (*Status & PCI_BIT_8) != 0);
- //
- // Bit 9 and bit 10 together decides the DEVSEL timing
- //
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_DEVSEL_TIMING), gShellDebug1HiiHandle);
- if ((*Status & PCI_BIT_9) == 0 && (*Status & PCI_BIT_10) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_FAST), gShellDebug1HiiHandle);
-
- } else if ((*Status & PCI_BIT_9) != 0 && (*Status & PCI_BIT_10) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MEDIUM), gShellDebug1HiiHandle);
-
- } else if ((*Status & PCI_BIT_9) == 0 && (*Status & PCI_BIT_10) != 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_SLOW), gShellDebug1HiiHandle);
-
- } else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RESERVED_2), gShellDebug1HiiHandle);
- }
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SIGNALED_TARGET),
- gShellDebug1HiiHandle,
- (*Status & PCI_BIT_11) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_RECEIVED_TARGET),
- gShellDebug1HiiHandle,
- (*Status & PCI_BIT_12) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_RECEIVED_MASTER),
- gShellDebug1HiiHandle,
- (*Status & PCI_BIT_13) != 0
- );
-
- if (MainStatus) {
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SIGNALED_ERROR),
- gShellDebug1HiiHandle,
- (*Status & PCI_BIT_14) != 0
- );
-
- } else {
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_RECEIVED_ERROR),
- gShellDebug1HiiHandle,
- (*Status & PCI_BIT_14) != 0
- );
- }
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_DETECTED_ERROR),
- gShellDebug1HiiHandle,
- (*Status & PCI_BIT_15) != 0
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Explain each meaningful bit of register Command.
-
- @param[in] Command Points to the content of register Command.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainCommand (
- IN UINT16 *Command
- )
-{
- //
- // Print the binary value of register Command
- //
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_COMMAND), gShellDebug1HiiHandle, INDEX_OF (Command), *Command);
-
- //
- // Explain register Command bit by bit
- //
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SPACE_ACCESS_DENIED),
- gShellDebug1HiiHandle,
- (*Command & PCI_BIT_0) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_MEMORY_SPACE),
- gShellDebug1HiiHandle,
- (*Command & PCI_BIT_1) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_BEHAVE_BUS_MASTER),
- gShellDebug1HiiHandle,
- (*Command & PCI_BIT_2) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_MONITOR_SPECIAL_CYCLE),
- gShellDebug1HiiHandle,
- (*Command & PCI_BIT_3) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_MEM_WRITE_INVALIDATE),
- gShellDebug1HiiHandle,
- (*Command & PCI_BIT_4) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_PALETTE_SNOOPING),
- gShellDebug1HiiHandle,
- (*Command & PCI_BIT_5) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_ASSERT_PERR),
- gShellDebug1HiiHandle,
- (*Command & PCI_BIT_6) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_DO_ADDR_STEPPING),
- gShellDebug1HiiHandle,
- (*Command & PCI_BIT_7) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SERR_DRIVER),
- gShellDebug1HiiHandle,
- (*Command & PCI_BIT_8) != 0
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_FAST_BACK_2),
- gShellDebug1HiiHandle,
- (*Command & PCI_BIT_9) != 0
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Explain each meaningful bit of register Bridge Control.
-
- @param[in] BridgeControl Points to the content of register Bridge Control.
- @param[in] HeaderType The headertype.
-
- @retval EFI_SUCCESS The command completed successfully.
-**/
-EFI_STATUS
-PciExplainBridgeControl (
- IN UINT16 *BridgeControl,
- IN PCI_HEADER_TYPE HeaderType
- )
-{
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_BRIDGE_CONTROL),
- gShellDebug1HiiHandle,
- INDEX_OF (BridgeControl),
- *BridgeControl
- );
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_PARITY_ERROR),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_0) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SERR_ENABLE),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_1) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_ISA_ENABLE),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_2) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_VGA_ENABLE),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_3) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_MASTER_ABORT),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_5) != 0
- );
-
- //
- // Register Bridge Control has some slight differences between P2P bridge
- // and Cardbus bridge from bit 6 to bit 11.
- //
- if (HeaderType == PciP2pBridge) {
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SECONDARY_BUS_RESET),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_6) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_FAST_ENABLE),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_7) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_PRIMARY_DISCARD_TIMER),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_8)!=0 ? L"2^10" : L"2^15"
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_SECONDARY_DISCARD_TIMER),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_9)!=0 ? L"2^10" : L"2^15"
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_DISCARD_TIMER_STATUS),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_10) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_DISCARD_TIMER_SERR),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_11) != 0
- );
-
- } else {
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_CARDBUS_RESET),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_6) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_IREQ_ENABLE),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_7) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_PCI2_WRITE_POSTING_ENABLE),
- gShellDebug1HiiHandle,
- (*BridgeControl & PCI_BIT_10) != 0
- );
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Print each capability structure.
-
- @param[in] IoDev The pointer to the deivce.
- @param[in] Address The address to start at.
- @param[in] CapPtr The offset from the address.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-PciExplainCapabilityStruct (
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
- IN UINT64 Address,
- IN UINT8 CapPtr
- )
-{
- UINT8 CapabilityPtr;
- UINT16 CapabilityEntry;
- UINT8 CapabilityID;
- UINT64 RegAddress;
-
- CapabilityPtr = CapPtr;
-
- //
- // Go through the Capability list
- //
- while ((CapabilityPtr >= 0x40) && ((CapabilityPtr & 0x03) == 0x00)) {
- RegAddress = Address + CapabilityPtr;
- IoDev->Pci.Read (IoDev, EfiPciWidthUint16, RegAddress, 1, &CapabilityEntry);
-
- CapabilityID = (UINT8) CapabilityEntry;
-
- //
- // Explain PciExpress data
- //
- if (EFI_PCI_CAPABILITY_ID_PCIEXP == CapabilityID) {
- PciExplainPciExpress (IoDev, Address, CapabilityPtr);
- return EFI_SUCCESS;
- }
- //
- // Explain other capabilities here
- //
- CapabilityPtr = (UINT8) (CapabilityEntry >> 8);
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the capability information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieCapReg (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT16 PcieCapReg;
- CHAR16 *DevicePortType;
-
- PcieCapReg = PciExpressCap->PcieCapReg;
- Print (
- L" Capability Version(3:0): %E0x%04x%N\n",
- PCIE_CAP_VERSION (PcieCapReg)
- );
- if ((UINT8) PCIE_CAP_DEVICEPORT_TYPE (PcieCapReg) < PCIE_DEVICE_PORT_TYPE_MAX) {
- DevicePortType = DevicePortTypeTable[PCIE_CAP_DEVICEPORT_TYPE (PcieCapReg)];
- } else {
- DevicePortType = L"Unknown Type";
- }
- Print (
- L" Device/PortType(7:4): %E%s%N\n",
- DevicePortType
- );
- //
- // 'Slot Implemented' is only valid for:
- // a) Root Port of PCI Express Root Complex, or
- // b) Downstream Port of PCI Express Switch
- //
- if (PCIE_CAP_DEVICEPORT_TYPE (PcieCapReg) == PCIE_ROOT_COMPLEX_ROOT_PORT ||
- PCIE_CAP_DEVICEPORT_TYPE (PcieCapReg) == PCIE_SWITCH_DOWNSTREAM_PORT) {
- Print (
- L" Slot Implemented(8): %E%d%N\n",
- PCIE_CAP_SLOT_IMPLEMENTED (PcieCapReg)
- );
- }
- Print (
- L" Interrupt Message Number(13:9): %E0x%05x%N\n",
- PCIE_CAP_INT_MSG_NUM (PcieCapReg)
- );
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device capability information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieDeviceCap (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT16 PcieCapReg;
- UINT32 PcieDeviceCap;
- UINT8 DevicePortType;
- UINT8 L0sLatency;
- UINT8 L1Latency;
-
- PcieCapReg = PciExpressCap->PcieCapReg;
- PcieDeviceCap = PciExpressCap->PcieDeviceCap;
- DevicePortType = (UINT8) PCIE_CAP_DEVICEPORT_TYPE (PcieCapReg);
- Print (L" Max_Payload_Size Supported(2:0): ");
- if (PCIE_CAP_MAX_PAYLOAD (PcieDeviceCap) < 6) {
- Print (L"%E%d bytes%N\n", 1 << (PCIE_CAP_MAX_PAYLOAD (PcieDeviceCap) + 7));
- } else {
- Print (L"%EUnknown%N\n");
- }
- Print (
- L" Phantom Functions Supported(4:3): %E%d%N\n",
- PCIE_CAP_PHANTOM_FUNC (PcieDeviceCap)
- );
- Print (
- L" Extended Tag Field Supported(5): %E%d-bit Tag field supported%N\n",
- PCIE_CAP_EXTENDED_TAG (PcieDeviceCap) ? 8 : 5
- );
- //
- // Endpoint L0s and L1 Acceptable Latency is only valid for Endpoint
- //
- if (IS_PCIE_ENDPOINT (DevicePortType)) {
- L0sLatency = (UINT8) PCIE_CAP_L0SLATENCY (PcieDeviceCap);
- L1Latency = (UINT8) PCIE_CAP_L1LATENCY (PcieDeviceCap);
- Print (L" Endpoint L0s Acceptable Latency(8:6): ");
- if (L0sLatency < 4) {
- Print (L"%EMaximum of %d ns%N\n", 1 << (L0sLatency + 6));
- } else {
- if (L0sLatency < 7) {
- Print (L"%EMaximum of %d us%N\n", 1 << (L0sLatency - 3));
- } else {
- Print (L"%ENo limit%N\n");
- }
- }
- Print (L" Endpoint L1 Acceptable Latency(11:9): ");
- if (L1Latency < 7) {
- Print (L"%EMaximum of %d us%N\n", 1 << (L1Latency + 1));
- } else {
- Print (L"%ENo limit%N\n");
- }
- }
- Print (
- L" Role-based Error Reporting(15): %E%d%N\n",
- PCIE_CAP_ERR_REPORTING (PcieDeviceCap)
- );
- //
- // Only valid for Upstream Port:
- // a) Captured Slot Power Limit Value
- // b) Captured Slot Power Scale
- //
- if (DevicePortType == PCIE_SWITCH_UPSTREAM_PORT) {
- Print (
- L" Captured Slot Power Limit Value(25:18): %E0x%02x%N\n",
- PCIE_CAP_SLOT_POWER_VALUE (PcieDeviceCap)
- );
- Print (
- L" Captured Slot Power Limit Scale(27:26): %E%s%N\n",
- SlotPwrLmtScaleTable[PCIE_CAP_SLOT_POWER_SCALE (PcieDeviceCap)]
- );
- }
- //
- // Function Level Reset Capability is only valid for Endpoint
- //
- if (IS_PCIE_ENDPOINT (DevicePortType)) {
- Print (
- L" Function Level Reset Capability(28): %E%d%N\n",
- PCIE_CAP_FUNC_LEVEL_RESET (PcieDeviceCap)
- );
- }
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device control information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieDeviceControl (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT16 PcieCapReg;
- UINT16 PcieDeviceControl;
-
- PcieCapReg = PciExpressCap->PcieCapReg;
- PcieDeviceControl = PciExpressCap->DeviceControl;
- Print (
- L" Correctable Error Reporting Enable(0): %E%d%N\n",
- PCIE_CAP_COR_ERR_REPORTING_ENABLE (PcieDeviceControl)
- );
- Print (
- L" Non-Fatal Error Reporting Enable(1): %E%d%N\n",
- PCIE_CAP_NONFAT_ERR_REPORTING_ENABLE (PcieDeviceControl)
- );
- Print (
- L" Fatal Error Reporting Enable(2): %E%d%N\n",
- PCIE_CAP_FATAL_ERR_REPORTING_ENABLE (PcieDeviceControl)
- );
- Print (
- L" Unsupported Request Reporting Enable(3): %E%d%N\n",
- PCIE_CAP_UNSUP_REQ_REPORTING_ENABLE (PcieDeviceControl)
- );
- Print (
- L" Enable Relaxed Ordering(4): %E%d%N\n",
- PCIE_CAP_RELAXED_ORDERING_ENABLE (PcieDeviceControl)
- );
- Print (L" Max_Payload_Size(7:5): ");
- if (PCIE_CAP_MAX_PAYLOAD_SIZE (PcieDeviceControl) < 6) {
- Print (L"%E%d bytes%N\n", 1 << (PCIE_CAP_MAX_PAYLOAD_SIZE (PcieDeviceControl) + 7));
- } else {
- Print (L"%EUnknown%N\n");
- }
- Print (
- L" Extended Tag Field Enable(8): %E%d%N\n",
- PCIE_CAP_EXTENDED_TAG_ENABLE (PcieDeviceControl)
- );
- Print (
- L" Phantom Functions Enable(9): %E%d%N\n",
- PCIE_CAP_PHANTOM_FUNC_ENABLE (PcieDeviceControl)
- );
- Print (
- L" Auxiliary (AUX) Power PM Enable(10): %E%d%N\n",
- PCIE_CAP_AUX_PM_ENABLE (PcieDeviceControl)
- );
- Print (
- L" Enable No Snoop(11): %E%d%N\n",
- PCIE_CAP_NO_SNOOP_ENABLE (PcieDeviceControl)
- );
- Print (L" Max_Read_Request_Size(14:12): ");
- if (PCIE_CAP_MAX_READ_REQ_SIZE (PcieDeviceControl) < 6) {
- Print (L"%E%d bytes%N\n", 1 << (PCIE_CAP_MAX_READ_REQ_SIZE (PcieDeviceControl) + 7));
- } else {
- Print (L"%EUnknown%N\n");
- }
- //
- // Read operation is only valid for PCI Express to PCI/PCI-X Bridges
- //
- if (PCIE_CAP_DEVICEPORT_TYPE (PcieCapReg) == PCIE_PCIE_TO_PCIX_BRIDGE) {
- Print (
- L" Bridge Configuration Retry Enable(15): %E%d%N\n",
- PCIE_CAP_BRG_CONF_RETRY (PcieDeviceControl)
- );
- }
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device status information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieDeviceStatus (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT16 PcieDeviceStatus;
-
- PcieDeviceStatus = PciExpressCap->DeviceStatus;
- Print (
- L" Correctable Error Detected(0): %E%d%N\n",
- PCIE_CAP_COR_ERR_DETECTED (PcieDeviceStatus)
- );
- Print (
- L" Non-Fatal Error Detected(1): %E%d%N\n",
- PCIE_CAP_NONFAT_ERR_DETECTED (PcieDeviceStatus)
- );
- Print (
- L" Fatal Error Detected(2): %E%d%N\n",
- PCIE_CAP_FATAL_ERR_DETECTED (PcieDeviceStatus)
- );
- Print (
- L" Unsupported Request Detected(3): %E%d%N\n",
- PCIE_CAP_UNSUP_REQ_DETECTED (PcieDeviceStatus)
- );
- Print (
- L" AUX Power Detected(4): %E%d%N\n",
- PCIE_CAP_AUX_POWER_DETECTED (PcieDeviceStatus)
- );
- Print (
- L" Transactions Pending(5): %E%d%N\n",
- PCIE_CAP_TRANSACTION_PENDING (PcieDeviceStatus)
- );
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device link information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieLinkCap (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT32 PcieLinkCap;
- CHAR16 *SupLinkSpeeds;
- CHAR16 *AspmValue;
-
- PcieLinkCap = PciExpressCap->LinkCap;
- switch (PCIE_CAP_SUP_LINK_SPEEDS (PcieLinkCap)) {
- case 1:
- SupLinkSpeeds = L"2.5 GT/s";
- break;
- case 2:
- SupLinkSpeeds = L"5.0 GT/s and 2.5 GT/s";
- break;
- default:
- SupLinkSpeeds = L"Unknown";
- break;
- }
- Print (
- L" Supported Link Speeds(3:0): %E%s supported%N\n",
- SupLinkSpeeds
- );
- Print (
- L" Maximum Link Width(9:4): %Ex%d%N\n",
- PCIE_CAP_MAX_LINK_WIDTH (PcieLinkCap)
- );
- switch (PCIE_CAP_ASPM_SUPPORT (PcieLinkCap)) {
- case 1:
- AspmValue = L"L0s Entry";
- break;
- case 3:
- AspmValue = L"L0s and L1";
- break;
- default:
- AspmValue = L"Reserved";
- break;
- }
- Print (
- L" Active State Power Management Support(11:10): %E%s Supported%N\n",
- AspmValue
- );
- Print (
- L" L0s Exit Latency(14:12): %E%s%N\n",
- L0sLatencyStrTable[PCIE_CAP_L0S_LATENCY (PcieLinkCap)]
- );
- Print (
- L" L1 Exit Latency(17:15): %E%s%N\n",
- L1LatencyStrTable[PCIE_CAP_L0S_LATENCY (PcieLinkCap)]
- );
- Print (
- L" Clock Power Management(18): %E%d%N\n",
- PCIE_CAP_CLOCK_PM (PcieLinkCap)
- );
- Print (
- L" Surprise Down Error Reporting Capable(19): %E%d%N\n",
- PCIE_CAP_SUP_DOWN_ERR_REPORTING (PcieLinkCap)
- );
- Print (
- L" Data Link Layer Link Active Reporting Capable(20): %E%d%N\n",
- PCIE_CAP_LINK_ACTIVE_REPORTING (PcieLinkCap)
- );
- Print (
- L" Link Bandwidth Notification Capability(21): %E%d%N\n",
- PCIE_CAP_LINK_BWD_NOTIF_CAP (PcieLinkCap)
- );
- Print (
- L" Port Number(31:24): %E0x%02x%N\n",
- PCIE_CAP_PORT_NUMBER (PcieLinkCap)
- );
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device link control information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieLinkControl (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT16 PcieLinkControl;
- UINT8 DevicePortType;
-
- PcieLinkControl = PciExpressCap->LinkControl;
- DevicePortType = (UINT8) PCIE_CAP_DEVICEPORT_TYPE (PciExpressCap->PcieCapReg);
- Print (
- L" Active State Power Management Control(1:0): %E%s%N\n",
- ASPMCtrlStrTable[PCIE_CAP_ASPM_CONTROL (PcieLinkControl)]
- );
- //
- // RCB is not applicable to switches
- //
- if (!IS_PCIE_SWITCH(DevicePortType)) {
- Print (
- L" Read Completion Boundary (RCB)(3): %E%d byte%N\n",
- 1 << (PCIE_CAP_RCB (PcieLinkControl) + 6)
- );
- }
- //
- // Link Disable is reserved on
- // a) Endpoints
- // b) PCI Express to PCI/PCI-X bridges
- // c) Upstream Ports of Switches
- //
- if (!IS_PCIE_ENDPOINT (DevicePortType) &&
- DevicePortType != PCIE_SWITCH_UPSTREAM_PORT &&
- DevicePortType != PCIE_PCIE_TO_PCIX_BRIDGE) {
- Print (
- L" Link Disable(4): %E%d%N\n",
- PCIE_CAP_LINK_DISABLE (PcieLinkControl)
- );
- }
- Print (
- L" Common Clock Configuration(6): %E%d%N\n",
- PCIE_CAP_COMMON_CLK_CONF (PcieLinkControl)
- );
- Print (
- L" Extended Synch(7): %E%d%N\n",
- PCIE_CAP_EXT_SYNC (PcieLinkControl)
- );
- Print (
- L" Enable Clock Power Management(8): %E%d%N\n",
- PCIE_CAP_CLK_PWR_MNG (PcieLinkControl)
- );
- Print (
- L" Hardware Autonomous Width Disable(9): %E%d%N\n",
- PCIE_CAP_HW_AUTO_WIDTH_DISABLE (PcieLinkControl)
- );
- Print (
- L" Link Bandwidth Management Interrupt Enable(10): %E%d%N\n",
- PCIE_CAP_LINK_BDW_MNG_INT_EN (PcieLinkControl)
- );
- Print (
- L" Link Autonomous Bandwidth Interrupt Enable(11): %E%d%N\n",
- PCIE_CAP_LINK_AUTO_BDW_INT_EN (PcieLinkControl)
- );
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device link status information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieLinkStatus (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT16 PcieLinkStatus;
- CHAR16 *SupLinkSpeeds;
-
- PcieLinkStatus = PciExpressCap->LinkStatus;
- switch (PCIE_CAP_CUR_LINK_SPEED (PcieLinkStatus)) {
- case 1:
- SupLinkSpeeds = L"2.5 GT/s";
- break;
- case 2:
- SupLinkSpeeds = L"5.0 GT/s";
- break;
- default:
- SupLinkSpeeds = L"Reserved";
- break;
- }
- Print (
- L" Current Link Speed(3:0): %E%s%N\n",
- SupLinkSpeeds
- );
- Print (
- L" Negotiated Link Width(9:4): %Ex%d%N\n",
- PCIE_CAP_NEGO_LINK_WIDTH (PcieLinkStatus)
- );
- Print (
- L" Link Training(11): %E%d%N\n",
- PCIE_CAP_LINK_TRAINING (PcieLinkStatus)
- );
- Print (
- L" Slot Clock Configuration(12): %E%d%N\n",
- PCIE_CAP_SLOT_CLK_CONF (PcieLinkStatus)
- );
- Print (
- L" Data Link Layer Link Active(13): %E%d%N\n",
- PCIE_CAP_DATA_LINK_ACTIVE (PcieLinkStatus)
- );
- Print (
- L" Link Bandwidth Management Status(14): %E%d%N\n",
- PCIE_CAP_LINK_BDW_MNG_STAT (PcieLinkStatus)
- );
- Print (
- L" Link Autonomous Bandwidth Status(15): %E%d%N\n",
- PCIE_CAP_LINK_AUTO_BDW_STAT (PcieLinkStatus)
- );
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device slot information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieSlotCap (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT32 PcieSlotCap;
-
- PcieSlotCap = PciExpressCap->SlotCap;
-
- Print (
- L" Attention Button Present(0): %E%d%N\n",
- PCIE_CAP_ATT_BUT_PRESENT (PcieSlotCap)
- );
- Print (
- L" Power Controller Present(1): %E%d%N\n",
- PCIE_CAP_PWR_CTRLLER_PRESENT (PcieSlotCap)
- );
- Print (
- L" MRL Sensor Present(2): %E%d%N\n",
- PCIE_CAP_MRL_SENSOR_PRESENT (PcieSlotCap)
- );
- Print (
- L" Attention Indicator Present(3): %E%d%N\n",
- PCIE_CAP_ATT_IND_PRESENT (PcieSlotCap)
- );
- Print (
- L" Power Indicator Present(4): %E%d%N\n",
- PCIE_CAP_PWD_IND_PRESENT (PcieSlotCap)
- );
- Print (
- L" Hot-Plug Surprise(5): %E%d%N\n",
- PCIE_CAP_HOTPLUG_SUPPRISE (PcieSlotCap)
- );
- Print (
- L" Hot-Plug Capable(6): %E%d%N\n",
- PCIE_CAP_HOTPLUG_CAPABLE (PcieSlotCap)
- );
- Print (
- L" Slot Power Limit Value(14:7): %E0x%02x%N\n",
- PCIE_CAP_SLOT_PWR_LIMIT_VALUE (PcieSlotCap)
- );
- Print (
- L" Slot Power Limit Scale(16:15): %E%s%N\n",
- SlotPwrLmtScaleTable[PCIE_CAP_SLOT_PWR_LIMIT_SCALE (PcieSlotCap)]
- );
- Print (
- L" Electromechanical Interlock Present(17): %E%d%N\n",
- PCIE_CAP_ELEC_INTERLOCK_PRESENT (PcieSlotCap)
- );
- Print (
- L" No Command Completed Support(18): %E%d%N\n",
- PCIE_CAP_NO_COMM_COMPLETED_SUP (PcieSlotCap)
- );
- Print (
- L" Physical Slot Number(31:19): %E%d%N\n",
- PCIE_CAP_PHY_SLOT_NUM (PcieSlotCap)
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device slot control information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieSlotControl (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT16 PcieSlotControl;
-
- PcieSlotControl = PciExpressCap->SlotControl;
- Print (
- L" Attention Button Pressed Enable(0): %E%d%N\n",
- PCIE_CAP_ATT_BUT_ENABLE (PcieSlotControl)
- );
- Print (
- L" Power Fault Detected Enable(1): %E%d%N\n",
- PCIE_CAP_PWR_FLT_DETECT_ENABLE (PcieSlotControl)
- );
- Print (
- L" MRL Sensor Changed Enable(2): %E%d%N\n",
- PCIE_CAP_MRL_SENSOR_CHANGE_ENABLE (PcieSlotControl)
- );
- Print (
- L" Presence Detect Changed Enable(3): %E%d%N\n",
- PCIE_CAP_PRES_DETECT_CHANGE_ENABLE (PcieSlotControl)
- );
- Print (
- L" Command Completed Interrupt Enable(4): %E%d%N\n",
- PCIE_CAP_COMM_CMPL_INT_ENABLE (PcieSlotControl)
- );
- Print (
- L" Hot-Plug Interrupt Enable(5): %E%d%N\n",
- PCIE_CAP_HOTPLUG_INT_ENABLE (PcieSlotControl)
- );
- Print (
- L" Attention Indicator Control(7:6): %E%s%N\n",
- IndicatorTable[PCIE_CAP_ATT_IND_CTRL (PcieSlotControl)]
- );
- Print (
- L" Power Indicator Control(9:8): %E%s%N\n",
- IndicatorTable[PCIE_CAP_PWR_IND_CTRL (PcieSlotControl)]
- );
- Print (L" Power Controller Control(10): %EPower ");
- if (PCIE_CAP_PWR_CTRLLER_CTRL (PcieSlotControl)) {
- Print (L"Off%N\n");
- } else {
- Print (L"On%N\n");
- }
- Print (
- L" Electromechanical Interlock Control(11): %E%d%N\n",
- PCIE_CAP_ELEC_INTERLOCK_CTRL (PcieSlotControl)
- );
- Print (
- L" Data Link Layer State Changed Enable(12): %E%d%N\n",
- PCIE_CAP_DLINK_STAT_CHANGE_ENABLE (PcieSlotControl)
- );
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device slot status information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieSlotStatus (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT16 PcieSlotStatus;
-
- PcieSlotStatus = PciExpressCap->SlotStatus;
-
- Print (
- L" Attention Button Pressed(0): %E%d%N\n",
- PCIE_CAP_ATT_BUT_PRESSED (PcieSlotStatus)
- );
- Print (
- L" Power Fault Detected(1): %E%d%N\n",
- PCIE_CAP_PWR_FLT_DETECTED (PcieSlotStatus)
- );
- Print (
- L" MRL Sensor Changed(2): %E%d%N\n",
- PCIE_CAP_MRL_SENSOR_CHANGED (PcieSlotStatus)
- );
- Print (
- L" Presence Detect Changed(3): %E%d%N\n",
- PCIE_CAP_PRES_DETECT_CHANGED (PcieSlotStatus)
- );
- Print (
- L" Command Completed(4): %E%d%N\n",
- PCIE_CAP_COMM_COMPLETED (PcieSlotStatus)
- );
- Print (L" MRL Sensor State(5): %EMRL ");
- if (PCIE_CAP_MRL_SENSOR_STATE (PcieSlotStatus)) {
- Print (L" Opened%N\n");
- } else {
- Print (L" Closed%N\n");
- }
- Print (L" Presence Detect State(6): ");
- if (PCIE_CAP_PRES_DETECT_STATE (PcieSlotStatus)) {
- Print (L"%ECard Present in slot%N\n");
- } else {
- Print (L"%ESlot Empty%N\n");
- }
- Print (L" Electromechanical Interlock Status(7): %EElectromechanical Interlock ");
- if (PCIE_CAP_ELEC_INTERLOCK_STATE (PcieSlotStatus)) {
- Print (L"Engaged%N\n");
- } else {
- Print (L"Disengaged%N\n");
- }
- Print (
- L" Data Link Layer State Changed(8): %E%d%N\n",
- PCIE_CAP_DLINK_STAT_CHANGED (PcieSlotStatus)
- );
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device root information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieRootControl (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT16 PcieRootControl;
-
- PcieRootControl = PciExpressCap->RootControl;
-
- Print (
- L" System Error on Correctable Error Enable(0): %E%d%N\n",
- PCIE_CAP_SYSERR_ON_CORERR_EN (PcieRootControl)
- );
- Print (
- L" System Error on Non-Fatal Error Enable(1): %E%d%N\n",
- PCIE_CAP_SYSERR_ON_NONFATERR_EN (PcieRootControl)
- );
- Print (
- L" System Error on Fatal Error Enable(2): %E%d%N\n",
- PCIE_CAP_SYSERR_ON_FATERR_EN (PcieRootControl)
- );
- Print (
- L" PME Interrupt Enable(3): %E%d%N\n",
- PCIE_CAP_PME_INT_ENABLE (PcieRootControl)
- );
- Print (
- L" CRS Software Visibility Enable(4): %E%d%N\n",
- PCIE_CAP_CRS_SW_VIS_ENABLE (PcieRootControl)
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device root capability information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieRootCap (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT16 PcieRootCap;
-
- PcieRootCap = PciExpressCap->RsvdP;
-
- Print (
- L" CRS Software Visibility(0): %E%d%N\n",
- PCIE_CAP_CRS_SW_VIS (PcieRootCap)
- );
-
- return EFI_SUCCESS;
-}
-
-/**
- Print out information of the device root status information.
-
- @param[in] PciExpressCap The pointer to the structure about the device.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-ExplainPcieRootStatus (
- IN PCIE_CAP_STURCTURE *PciExpressCap
- )
-{
- UINT32 PcieRootStatus;
-
- PcieRootStatus = PciExpressCap->RootStatus;
-
- Print (
- L" PME Requester ID(15:0): %E0x%04x%N\n",
- PCIE_CAP_PME_REQ_ID (PcieRootStatus)
- );
- Print (
- L" PME Status(16): %E%d%N\n",
- PCIE_CAP_PME_STATUS (PcieRootStatus)
- );
- Print (
- L" PME Pending(17): %E%d%N\n",
- PCIE_CAP_PME_PENDING (PcieRootStatus)
- );
- return EFI_SUCCESS;
-}
-
-/**
- Display Pcie device structure.
-
- @param[in] IoDev The pointer to the root pci protocol.
- @param[in] Address The Address to start at.
- @param[in] CapabilityPtr The offset from the address to start.
-**/
-EFI_STATUS
-PciExplainPciExpress (
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
- IN UINT64 Address,
- IN UINT8 CapabilityPtr
- )
-{
-
- PCIE_CAP_STURCTURE PciExpressCap;
- EFI_STATUS Status;
- UINT64 CapRegAddress;
- UINT8 Bus;
- UINT8 Dev;
- UINT8 Func;
- UINT8 *ExRegBuffer;
- UINTN ExtendRegSize;
- UINT64 Pciex_Address;
- UINT8 DevicePortType;
- UINTN Index;
- UINT8 *RegAddr;
- UINTN RegValue;
-
- CapRegAddress = Address + CapabilityPtr;
- IoDev->Pci.Read (
- IoDev,
- EfiPciWidthUint32,
- CapRegAddress,
- sizeof (PciExpressCap) / sizeof (UINT32),
- &PciExpressCap
- );
-
- DevicePortType = (UINT8) PCIE_CAP_DEVICEPORT_TYPE (PciExpressCap.PcieCapReg);
-
- Print (L"\nPci Express device capability structure:\n");
-
- for (Index = 0; PcieExplainList[Index].Type < PcieExplainTypeMax; Index++) {
- if (ShellGetExecutionBreakFlag()) {
- goto Done;
- }
- RegAddr = ((UINT8 *) &PciExpressCap) + PcieExplainList[Index].Offset;
- switch (PcieExplainList[Index].Width) {
- case FieldWidthUINT8:
- RegValue = *(UINT8 *) RegAddr;
- break;
- case FieldWidthUINT16:
- RegValue = *(UINT16 *) RegAddr;
- break;
- case FieldWidthUINT32:
- RegValue = *(UINT32 *) RegAddr;
- break;
- default:
- RegValue = 0;
- break;
- }
- ShellPrintHiiEx(-1, -1, NULL,
- PcieExplainList[Index].Token,
- gShellDebug1HiiHandle,
- PcieExplainList[Index].Offset,
- RegValue
- );
- if (PcieExplainList[Index].Func == NULL) {
- continue;
- }
- switch (PcieExplainList[Index].Type) {
- case PcieExplainTypeLink:
- //
- // Link registers should not be used by
- // a) Root Complex Integrated Endpoint
- // b) Root Complex Event Collector
- //
- if (DevicePortType == PCIE_ROOT_COMPLEX_INTEGRATED_PORT ||
- DevicePortType == PCIE_ROOT_COMPLEX_EVENT_COLLECTOR) {
- continue;
- }
- break;
- case PcieExplainTypeSlot:
- //
- // Slot registers are only valid for
- // a) Root Port of PCI Express Root Complex
- // b) Downstream Port of PCI Express Switch
- // and when SlotImplemented bit is set in PCIE cap register.
- //
- if ((DevicePortType != PCIE_ROOT_COMPLEX_ROOT_PORT &&
- DevicePortType != PCIE_SWITCH_DOWNSTREAM_PORT) ||
- !PCIE_CAP_SLOT_IMPLEMENTED (PciExpressCap.PcieCapReg)) {
- continue;
- }
- break;
- case PcieExplainTypeRoot:
- //
- // Root registers are only valid for
- // Root Port of PCI Express Root Complex
- //
- if (DevicePortType != PCIE_ROOT_COMPLEX_ROOT_PORT) {
- continue;
- }
- break;
- default:
- break;
- }
- PcieExplainList[Index].Func (&PciExpressCap);
- }
-
- Bus = (UINT8) (RShiftU64 (Address, 24));
- Dev = (UINT8) (RShiftU64 (Address, 16));
- Func = (UINT8) (RShiftU64 (Address, 8));
-
- Pciex_Address = CALC_EFI_PCIEX_ADDRESS (Bus, Dev, Func, 0x100);
-
- ExtendRegSize = 0x1000 - 0x100;
-
- ExRegBuffer = (UINT8 *) AllocateZeroPool (ExtendRegSize);
-
- //
- // PciRootBridgeIo protocol should support pci express extend space IO
- // (Begins at offset 0x100)
- //
- Status = IoDev->Pci.Read (
- IoDev,
- EfiPciWidthUint32,
- Pciex_Address,
- (ExtendRegSize) / sizeof (UINT32),
- (VOID *) (ExRegBuffer)
- );
- if (EFI_ERROR (Status)) {
- FreePool ((VOID *) ExRegBuffer);
- return EFI_UNSUPPORTED;
- }
- //
- // Start outputing PciEx extend space( 0xFF-0xFFF)
- //
- Print (L"\n%HStart dumping PCIex extended configuration space (0x100 - 0xFFF).%N\n\n");
-
- if (ExRegBuffer != NULL) {
- DumpHex (
- 2,
- 0x100,
- ExtendRegSize,
- (VOID *) (ExRegBuffer)
- );
-
- FreePool ((VOID *) ExRegBuffer);
- }
-
-Done:
- return EFI_SUCCESS;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h
deleted file mode 100644
index 04a22da52c..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h
+++ /dev/null
@@ -1,462 +0,0 @@
-/** @file
- Header file for Pci shell Debug1 function.
-
- Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _EFI_SHELL_PCI_H_
-#define _EFI_SHELL_PCI_H_
-
-typedef enum {
- PciDevice,
- PciP2pBridge,
- PciCardBusBridge,
- PciUndefined
-} PCI_HEADER_TYPE;
-
-#define HEADER_TYPE_MULTI_FUNCTION 0x80
-
-#define MAX_BUS_NUMBER 255
-#define MAX_DEVICE_NUMBER 31
-#define MAX_FUNCTION_NUMBER 7
-
-#define EFI_PCI_CAPABILITY_ID_PCIEXP 0x10
-#define EFI_PCI_CAPABILITY_ID_PCIX 0x07
-
-#define CALC_EFI_PCI_ADDRESS(Bus, Dev, Func, Reg) \
- ((UINT64) ((((UINTN) Bus) << 24) + (((UINTN) Dev) << 16) + (((UINTN) Func) << 8) + ((UINTN) Reg)))
-
-#define CALC_EFI_PCIEX_ADDRESS(Bus, Dev, Func, ExReg) ( \
- (UINT64) ((((UINTN) Bus) << 24) + (((UINTN) Dev) << 16) + (((UINTN) Func) << 8) + (LShiftU64 ((UINT64) ExReg, 32))) \
- );
-
-#define INDEX_OF(Field) ((UINT8 *) (Field) - (UINT8 *) mConfigSpace)
-
-#define PCI_BIT_0 0x00000001
-#define PCI_BIT_1 0x00000002
-#define PCI_BIT_2 0x00000004
-#define PCI_BIT_3 0x00000008
-#define PCI_BIT_4 0x00000010
-#define PCI_BIT_5 0x00000020
-#define PCI_BIT_6 0x00000040
-#define PCI_BIT_7 0x00000080
-#define PCI_BIT_8 0x00000100
-#define PCI_BIT_9 0x00000200
-#define PCI_BIT_10 0x00000400
-#define PCI_BIT_11 0x00000800
-#define PCI_BIT_12 0x00001000
-#define PCI_BIT_13 0x00002000
-#define PCI_BIT_14 0x00004000
-#define PCI_BIT_15 0x00008000
-
-//
-// PCIE device/port types
-//
-#define PCIE_PCIE_ENDPOINT 0
-#define PCIE_LEGACY_PCIE_ENDPOINT 1
-#define PCIE_ROOT_COMPLEX_ROOT_PORT 4
-#define PCIE_SWITCH_UPSTREAM_PORT 5
-#define PCIE_SWITCH_DOWNSTREAM_PORT 6
-#define PCIE_PCIE_TO_PCIX_BRIDGE 7
-#define PCIE_PCIX_TO_PCIE_BRIDGE 8
-#define PCIE_ROOT_COMPLEX_INTEGRATED_PORT 9
-#define PCIE_ROOT_COMPLEX_EVENT_COLLECTOR 10
-#define PCIE_DEVICE_PORT_TYPE_MAX 11
-
-#define IS_PCIE_ENDPOINT(DevicePortType) \
- ((DevicePortType) == PCIE_PCIE_ENDPOINT || \
- (DevicePortType) == PCIE_LEGACY_PCIE_ENDPOINT || \
- (DevicePortType) == PCIE_ROOT_COMPLEX_INTEGRATED_PORT)
-
-#define IS_PCIE_SWITCH(DevicePortType) \
- ((DevicePortType == PCIE_SWITCH_UPSTREAM_PORT) || \
- (DevicePortType == PCIE_SWITCH_DOWNSTREAM_PORT))
-
-//
-// Capabilities Register
-//
-#define PCIE_CAP_VERSION(PcieCapReg) \
- ((PcieCapReg) & 0x0f)
-#define PCIE_CAP_DEVICEPORT_TYPE(PcieCapReg) \
- (((PcieCapReg) >> 4) & 0x0f)
-#define PCIE_CAP_SLOT_IMPLEMENTED(PcieCapReg) \
- (((PcieCapReg) >> 8) & 0x1)
-#define PCIE_CAP_INT_MSG_NUM(PcieCapReg) \
- (((PcieCapReg) >> 9) & 0x1f)
-//
-// Device Capabilities Register
-//
-#define PCIE_CAP_MAX_PAYLOAD(PcieDeviceCap) \
- ((PcieDeviceCap) & 0x7)
-#define PCIE_CAP_PHANTOM_FUNC(PcieDeviceCap) \
- (((PcieDeviceCap) >> 3) & 0x3)
-#define PCIE_CAP_EXTENDED_TAG(PcieDeviceCap) \
- (((PcieDeviceCap) >> 5) & 0x1)
-#define PCIE_CAP_L0SLATENCY(PcieDeviceCap) \
- (((PcieDeviceCap) >> 6) & 0x7)
-#define PCIE_CAP_L1LATENCY(PcieDeviceCap) \
- (((PcieDeviceCap) >> 9) & 0x7)
-#define PCIE_CAP_ERR_REPORTING(PcieDeviceCap) \
- (((PcieDeviceCap) >> 15) & 0x1)
-#define PCIE_CAP_SLOT_POWER_VALUE(PcieDeviceCap) \
- (((PcieDeviceCap) >> 18) & 0x0ff)
-#define PCIE_CAP_SLOT_POWER_SCALE(PcieDeviceCap) \
- (((PcieDeviceCap) >> 26) & 0x3)
-#define PCIE_CAP_FUNC_LEVEL_RESET(PcieDeviceCap) \
- (((PcieDeviceCap) >> 28) & 0x1)
-//
-// Device Control Register
-//
-#define PCIE_CAP_COR_ERR_REPORTING_ENABLE(PcieDeviceControl) \
- ((PcieDeviceControl) & 0x1)
-#define PCIE_CAP_NONFAT_ERR_REPORTING_ENABLE(PcieDeviceControl) \
- (((PcieDeviceControl) >> 1) & 0x1)
-#define PCIE_CAP_FATAL_ERR_REPORTING_ENABLE(PcieDeviceControl) \
- (((PcieDeviceControl) >> 2) & 0x1)
-#define PCIE_CAP_UNSUP_REQ_REPORTING_ENABLE(PcieDeviceControl) \
- (((PcieDeviceControl) >> 3) & 0x1)
-#define PCIE_CAP_RELAXED_ORDERING_ENABLE(PcieDeviceControl) \
- (((PcieDeviceControl) >> 4) & 0x1)
-#define PCIE_CAP_MAX_PAYLOAD_SIZE(PcieDeviceControl) \
- (((PcieDeviceControl) >> 5) & 0x7)
-#define PCIE_CAP_EXTENDED_TAG_ENABLE(PcieDeviceControl) \
- (((PcieDeviceControl) >> 8) & 0x1)
-#define PCIE_CAP_PHANTOM_FUNC_ENABLE(PcieDeviceControl) \
- (((PcieDeviceControl) >> 9) & 0x1)
-#define PCIE_CAP_AUX_PM_ENABLE(PcieDeviceControl) \
- (((PcieDeviceControl) >> 10) & 0x1)
-#define PCIE_CAP_NO_SNOOP_ENABLE(PcieDeviceControl) \
- (((PcieDeviceControl) >> 11) & 0x1)
-#define PCIE_CAP_MAX_READ_REQ_SIZE(PcieDeviceControl) \
- (((PcieDeviceControl) >> 12) & 0x7)
-#define PCIE_CAP_BRG_CONF_RETRY(PcieDeviceControl) \
- (((PcieDeviceControl) >> 15) & 0x1)
-//
-// Device Status Register
-//
-#define PCIE_CAP_COR_ERR_DETECTED(PcieDeviceStatus) \
- ((PcieDeviceStatus) & 0x1)
-#define PCIE_CAP_NONFAT_ERR_DETECTED(PcieDeviceStatus) \
- (((PcieDeviceStatus) >> 1) & 0x1)
-#define PCIE_CAP_FATAL_ERR_DETECTED(PcieDeviceStatus) \
- (((PcieDeviceStatus) >> 2) & 0x1)
-#define PCIE_CAP_UNSUP_REQ_DETECTED(PcieDeviceStatus) \
- (((PcieDeviceStatus) >> 3) & 0x1)
-#define PCIE_CAP_AUX_POWER_DETECTED(PcieDeviceStatus) \
- (((PcieDeviceStatus) >> 4) & 0x1)
-#define PCIE_CAP_TRANSACTION_PENDING(PcieDeviceStatus) \
- (((PcieDeviceStatus) >> 5) & 0x1)
-//
-// Link Capabilities Register
-//
-#define PCIE_CAP_SUP_LINK_SPEEDS(PcieLinkCap) \
- ((PcieLinkCap) & 0x0f)
-#define PCIE_CAP_MAX_LINK_WIDTH(PcieLinkCap) \
- (((PcieLinkCap) >> 4) & 0x3f)
-#define PCIE_CAP_ASPM_SUPPORT(PcieLinkCap) \
- (((PcieLinkCap) >> 10) & 0x3)
-#define PCIE_CAP_L0S_LATENCY(PcieLinkCap) \
- (((PcieLinkCap) >> 12) & 0x7)
-#define PCIE_CAP_L1_LATENCY(PcieLinkCap) \
- (((PcieLinkCap) >> 15) & 0x7)
-#define PCIE_CAP_CLOCK_PM(PcieLinkCap) \
- (((PcieLinkCap) >> 18) & 0x1)
-#define PCIE_CAP_SUP_DOWN_ERR_REPORTING(PcieLinkCap) \
- (((PcieLinkCap) >> 19) & 0x1)
-#define PCIE_CAP_LINK_ACTIVE_REPORTING(PcieLinkCap) \
- (((PcieLinkCap) >> 20) & 0x1)
-#define PCIE_CAP_LINK_BWD_NOTIF_CAP(PcieLinkCap) \
- (((PcieLinkCap) >> 21) & 0x1)
-#define PCIE_CAP_PORT_NUMBER(PcieLinkCap) \
- (((PcieLinkCap) >> 24) & 0x0ff)
-//
-// Link Control Register
-//
-#define PCIE_CAP_ASPM_CONTROL(PcieLinkControl) \
- ((PcieLinkControl) & 0x3)
-#define PCIE_CAP_RCB(PcieLinkControl) \
- (((PcieLinkControl) >> 3) & 0x1)
-#define PCIE_CAP_LINK_DISABLE(PcieLinkControl) \
- (((PcieLinkControl) >> 4) & 0x1)
-#define PCIE_CAP_COMMON_CLK_CONF(PcieLinkControl) \
- (((PcieLinkControl) >> 6) & 0x1)
-#define PCIE_CAP_EXT_SYNC(PcieLinkControl) \
- (((PcieLinkControl) >> 7) & 0x1)
-#define PCIE_CAP_CLK_PWR_MNG(PcieLinkControl) \
- (((PcieLinkControl) >> 8) & 0x1)
-#define PCIE_CAP_HW_AUTO_WIDTH_DISABLE(PcieLinkControl) \
- (((PcieLinkControl) >> 9) & 0x1)
-#define PCIE_CAP_LINK_BDW_MNG_INT_EN(PcieLinkControl) \
- (((PcieLinkControl) >> 10) & 0x1)
-#define PCIE_CAP_LINK_AUTO_BDW_INT_EN(PcieLinkControl) \
- (((PcieLinkControl) >> 11) & 0x1)
-//
-// Link Status Register
-//
-#define PCIE_CAP_CUR_LINK_SPEED(PcieLinkStatus) \
- ((PcieLinkStatus) & 0x0f)
-#define PCIE_CAP_NEGO_LINK_WIDTH(PcieLinkStatus) \
- (((PcieLinkStatus) >> 4) & 0x3f)
-#define PCIE_CAP_LINK_TRAINING(PcieLinkStatus) \
- (((PcieLinkStatus) >> 11) & 0x1)
-#define PCIE_CAP_SLOT_CLK_CONF(PcieLinkStatus) \
- (((PcieLinkStatus) >> 12) & 0x1)
-#define PCIE_CAP_DATA_LINK_ACTIVE(PcieLinkStatus) \
- (((PcieLinkStatus) >> 13) & 0x1)
-#define PCIE_CAP_LINK_BDW_MNG_STAT(PcieLinkStatus) \
- (((PcieLinkStatus) >> 14) & 0x1)
-#define PCIE_CAP_LINK_AUTO_BDW_STAT(PcieLinkStatus) \
- (((PcieLinkStatus) >> 15) & 0x1)
-//
-// Slot Capabilities Register
-//
-#define PCIE_CAP_ATT_BUT_PRESENT(PcieSlotCap) \
- ((PcieSlotCap) & 0x1)
-#define PCIE_CAP_PWR_CTRLLER_PRESENT(PcieSlotCap) \
- (((PcieSlotCap) >> 1) & 0x1)
-#define PCIE_CAP_MRL_SENSOR_PRESENT(PcieSlotCap) \
- (((PcieSlotCap) >> 2) & 0x1)
-#define PCIE_CAP_ATT_IND_PRESENT(PcieSlotCap) \
- (((PcieSlotCap) >> 3) & 0x1)
-#define PCIE_CAP_PWD_IND_PRESENT(PcieSlotCap) \
- (((PcieSlotCap) >> 4) & 0x1)
-#define PCIE_CAP_HOTPLUG_SUPPRISE(PcieSlotCap) \
- (((PcieSlotCap) >> 5) & 0x1)
-#define PCIE_CAP_HOTPLUG_CAPABLE(PcieSlotCap) \
- (((PcieSlotCap) >> 6) & 0x1)
-#define PCIE_CAP_SLOT_PWR_LIMIT_VALUE(PcieSlotCap) \
- (((PcieSlotCap) >> 7) & 0x0ff)
-#define PCIE_CAP_SLOT_PWR_LIMIT_SCALE(PcieSlotCap) \
- (((PcieSlotCap) >> 15) & 0x3)
-#define PCIE_CAP_ELEC_INTERLOCK_PRESENT(PcieSlotCap) \
- (((PcieSlotCap) >> 17) & 0x1)
-#define PCIE_CAP_NO_COMM_COMPLETED_SUP(PcieSlotCap) \
- (((PcieSlotCap) >> 18) & 0x1)
-#define PCIE_CAP_PHY_SLOT_NUM(PcieSlotCap) \
- (((PcieSlotCap) >> 19) & 0x1fff)
-//
-// Slot Control Register
-//
-#define PCIE_CAP_ATT_BUT_ENABLE(PcieSlotControl) \
- ((PcieSlotControl) & 0x1)
-#define PCIE_CAP_PWR_FLT_DETECT_ENABLE(PcieSlotControl) \
- (((PcieSlotControl) >> 1) & 0x1)
-#define PCIE_CAP_MRL_SENSOR_CHANGE_ENABLE(PcieSlotControl) \
- (((PcieSlotControl) >> 2) & 0x1)
-#define PCIE_CAP_PRES_DETECT_CHANGE_ENABLE(PcieSlotControl) \
- (((PcieSlotControl) >> 3) & 0x1)
-#define PCIE_CAP_COMM_CMPL_INT_ENABLE(PcieSlotControl) \
- (((PcieSlotControl) >> 4) & 0x1)
-#define PCIE_CAP_HOTPLUG_INT_ENABLE(PcieSlotControl) \
- (((PcieSlotControl) >> 5) & 0x1)
-#define PCIE_CAP_ATT_IND_CTRL(PcieSlotControl) \
- (((PcieSlotControl) >> 6) & 0x3)
-#define PCIE_CAP_PWR_IND_CTRL(PcieSlotControl) \
- (((PcieSlotControl) >> 8) & 0x3)
-#define PCIE_CAP_PWR_CTRLLER_CTRL(PcieSlotControl) \
- (((PcieSlotControl) >> 10) & 0x1)
-#define PCIE_CAP_ELEC_INTERLOCK_CTRL(PcieSlotControl) \
- (((PcieSlotControl) >> 11) & 0x1)
-#define PCIE_CAP_DLINK_STAT_CHANGE_ENABLE(PcieSlotControl) \
- (((PcieSlotControl) >> 12) & 0x1)
-//
-// Slot Status Register
-//
-#define PCIE_CAP_ATT_BUT_PRESSED(PcieSlotStatus) \
- ((PcieSlotStatus) & 0x1)
-#define PCIE_CAP_PWR_FLT_DETECTED(PcieSlotStatus) \
- (((PcieSlotStatus) >> 1) & 0x1)
-#define PCIE_CAP_MRL_SENSOR_CHANGED(PcieSlotStatus) \
- (((PcieSlotStatus) >> 2) & 0x1)
-#define PCIE_CAP_PRES_DETECT_CHANGED(PcieSlotStatus) \
- (((PcieSlotStatus) >> 3) & 0x1)
-#define PCIE_CAP_COMM_COMPLETED(PcieSlotStatus) \
- (((PcieSlotStatus) >> 4) & 0x1)
-#define PCIE_CAP_MRL_SENSOR_STATE(PcieSlotStatus) \
- (((PcieSlotStatus) >> 5) & 0x1)
-#define PCIE_CAP_PRES_DETECT_STATE(PcieSlotStatus) \
- (((PcieSlotStatus) >> 6) & 0x1)
-#define PCIE_CAP_ELEC_INTERLOCK_STATE(PcieSlotStatus) \
- (((PcieSlotStatus) >> 7) & 0x1)
-#define PCIE_CAP_DLINK_STAT_CHANGED(PcieSlotStatus) \
- (((PcieSlotStatus) >> 8) & 0x1)
-//
-// Root Control Register
-//
-#define PCIE_CAP_SYSERR_ON_CORERR_EN(PcieRootControl) \
- ((PcieRootControl) & 0x1)
-#define PCIE_CAP_SYSERR_ON_NONFATERR_EN(PcieRootControl) \
- (((PcieRootControl) >> 1) & 0x1)
-#define PCIE_CAP_SYSERR_ON_FATERR_EN(PcieRootControl) \
- (((PcieRootControl) >> 2) & 0x1)
-#define PCIE_CAP_PME_INT_ENABLE(PcieRootControl) \
- (((PcieRootControl) >> 3) & 0x1)
-#define PCIE_CAP_CRS_SW_VIS_ENABLE(PcieRootControl) \
- (((PcieRootControl) >> 4) & 0x1)
-//
-// Root Capabilities Register
-//
-#define PCIE_CAP_CRS_SW_VIS(PcieRootCap) \
- ((PcieRootCap) & 0x1)
-//
-// Root Status Register
-//
-#define PCIE_CAP_PME_REQ_ID(PcieRootStatus) \
- ((PcieRootStatus) & 0x0ffff)
-#define PCIE_CAP_PME_STATUS(PcieRootStatus) \
- (((PcieRootStatus) >> 16) & 0x1)
-#define PCIE_CAP_PME_PENDING(PcieRootStatus) \
- (((PcieRootStatus) >> 17) & 0x1)
-
-#pragma pack(1)
-//
-// Common part of the PCI configuration space header for devices, P2P bridges,
-// and cardbus bridges
-//
-typedef struct {
- UINT16 VendorId;
- UINT16 DeviceId;
-
- UINT16 Command;
- UINT16 Status;
-
- UINT8 RevisionId;
- UINT8 ClassCode[3];
-
- UINT8 CacheLineSize;
- UINT8 PrimaryLatencyTimer;
- UINT8 HeaderType;
- UINT8 Bist;
-
-} PCI_COMMON_HEADER;
-
-//
-// PCI configuration space header for devices(after the common part)
-//
-typedef struct {
- UINT32 Bar[6]; // Base Address Registers
- UINT32 CardBusCISPtr; // CardBus CIS Pointer
- UINT16 SubVendorId; // Subsystem Vendor ID
- UINT16 SubSystemId; // Subsystem ID
- UINT32 ROMBar; // Expansion ROM Base Address
- UINT8 CapabilitiesPtr; // Capabilities Pointer
- UINT8 Reserved[3];
-
- UINT32 Reserved1;
-
- UINT8 InterruptLine; // Interrupt Line
- UINT8 InterruptPin; // Interrupt Pin
- UINT8 MinGnt; // Min_Gnt
- UINT8 MaxLat; // Max_Lat
-} PCI_DEVICE_HEADER;
-
-//
-// PCI configuration space header for pci-to-pci bridges(after the common part)
-//
-typedef struct {
- UINT32 Bar[2]; // Base Address Registers
- UINT8 PrimaryBus; // Primary Bus Number
- UINT8 SecondaryBus; // Secondary Bus Number
- UINT8 SubordinateBus; // Subordinate Bus Number
- UINT8 SecondaryLatencyTimer; // Secondary Latency Timer
- UINT8 IoBase; // I/O Base
- UINT8 IoLimit; // I/O Limit
- UINT16 SecondaryStatus; // Secondary Status
- UINT16 MemoryBase; // Memory Base
- UINT16 MemoryLimit; // Memory Limit
- UINT16 PrefetchableMemBase; // Pre-fetchable Memory Base
- UINT16 PrefetchableMemLimit; // Pre-fetchable Memory Limit
- UINT32 PrefetchableBaseUpper; // Pre-fetchable Base Upper 32 bits
- UINT32 PrefetchableLimitUpper; // Pre-fetchable Limit Upper 32 bits
- UINT16 IoBaseUpper; // I/O Base Upper 16 bits
- UINT16 IoLimitUpper; // I/O Limit Upper 16 bits
- UINT8 CapabilitiesPtr; // Capabilities Pointer
- UINT8 Reserved[3];
-
- UINT32 ROMBar; // Expansion ROM Base Address
- UINT8 InterruptLine; // Interrupt Line
- UINT8 InterruptPin; // Interrupt Pin
- UINT16 BridgeControl; // Bridge Control
-} PCI_BRIDGE_HEADER;
-
-//
-// PCI configuration space header for cardbus bridges(after the common part)
-//
-typedef struct {
- UINT32 CardBusSocketReg; // Cardus Socket/ExCA Base
- // Address Register
- //
- UINT8 CapabilitiesPtr; // 14h in pci-cardbus bridge.
- UINT8 Reserved;
- UINT16 SecondaryStatus; // Secondary Status
- UINT8 PciBusNumber; // PCI Bus Number
- UINT8 CardBusBusNumber; // CardBus Bus Number
- UINT8 SubordinateBusNumber; // Subordinate Bus Number
- UINT8 CardBusLatencyTimer; // CardBus Latency Timer
- UINT32 MemoryBase0; // Memory Base Register 0
- UINT32 MemoryLimit0; // Memory Limit Register 0
- UINT32 MemoryBase1;
- UINT32 MemoryLimit1;
- UINT32 IoBase0;
- UINT32 IoLimit0; // I/O Base Register 0
- UINT32 IoBase1; // I/O Limit Register 0
- UINT32 IoLimit1;
-
- UINT8 InterruptLine; // Interrupt Line
- UINT8 InterruptPin; // Interrupt Pin
- UINT16 BridgeControl; // Bridge Control
-} PCI_CARDBUS_HEADER;
-
-//
-// Data region after PCI configuration header(for cardbus bridge)
-//
-typedef struct {
- UINT16 SubVendorId; // Subsystem Vendor ID
- UINT16 SubSystemId; // Subsystem ID
- UINT32 LegacyBase; // Optional 16-Bit PC Card Legacy
- // Mode Base Address
- //
- UINT32 Data[46];
-} PCI_CARDBUS_DATA;
-
-typedef union {
- PCI_DEVICE_HEADER Device;
- PCI_BRIDGE_HEADER Bridge;
- PCI_CARDBUS_HEADER CardBus;
-} NON_COMMON_UNION;
-
-typedef struct {
- PCI_COMMON_HEADER Common;
- NON_COMMON_UNION NonCommon;
- UINT32 Data[48];
-} PCI_CONFIG_SPACE;
-
-typedef struct {
- UINT8 PcieCapId;
- UINT8 NextCapPtr;
- UINT16 PcieCapReg;
- UINT32 PcieDeviceCap;
- UINT16 DeviceControl;
- UINT16 DeviceStatus;
- UINT32 LinkCap;
- UINT16 LinkControl;
- UINT16 LinkStatus;
- UINT32 SlotCap;
- UINT16 SlotControl;
- UINT16 SlotStatus;
- UINT16 RsvdP;
- UINT16 RootControl;
- UINT32 RootStatus;
-} PCIE_CAP_STURCTURE;
-
-#pragma pack()
-
-#endif // _PCI_H_
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
deleted file mode 100644
index e464d57fe4..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
+++ /dev/null
@@ -1,363 +0,0 @@
-/** @file
- Main file for SerMode shell Debug1 function.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-#include <Library/ShellLib.h>
-#include <Protocol/SerialIo.h>
-
-/**
- Display information about a serial device by it's handle.
-
- If HandleValid is FALSE, do all devices.
-
- @param[in] HandleIdx The handle index for the device.
- @param[in] HandleValid TRUE if HandleIdx is valid.
-
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
- @retval SHELL_SUCCESS The operation was successful.
-**/
-SHELL_STATUS
-EFIAPI
-DisplaySettings (
- IN UINTN HandleIdx,
- IN BOOLEAN HandleValid
- )
-{
- EFI_SERIAL_IO_PROTOCOL *SerialIo;
- UINTN NoHandles;
- EFI_HANDLE *Handles;
- EFI_STATUS Status;
- UINTN Index;
- CHAR16 *StopBits;
- CHAR16 Parity;
- SHELL_STATUS ShellStatus;
-
- Handles = NULL;
- StopBits = NULL;
-
- ShellStatus = SHELL_SUCCESS;
-
- Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles);
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle);
- return SHELL_INVALID_PARAMETER;
- }
-
- for (Index = 0; Index < NoHandles; Index++) {
- if (HandleValid) {
- if (ConvertHandleIndexToHandle(HandleIdx) != Handles[Index]) {
- continue;
- }
- }
-
- Status = gBS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, (VOID**)&SerialIo);
- if (!EFI_ERROR (Status)) {
- switch (SerialIo->Mode->Parity) {
- case DefaultParity:
-
- Parity = 'D';
- break;
-
- case NoParity:
-
- Parity = 'N';
- break;
-
- case EvenParity:
-
- Parity = 'E';
- break;
-
- case OddParity:
-
- Parity = 'O';
- break;
-
- case MarkParity:
-
- Parity = 'M';
- break;
-
- case SpaceParity:
-
- Parity = 'S';
- break;
-
- default:
-
- Parity = 'U';
- }
-
- switch (SerialIo->Mode->StopBits) {
- case DefaultStopBits:
-
- StopBits = L"Default";
- break;
-
- case OneStopBit:
-
- StopBits = L"1";
- break;
-
- case TwoStopBits:
-
- StopBits = L"2";
- break;
-
- case OneFiveStopBits:
-
- StopBits = L"1.5";
- break;
-
- default:
-
- StopBits = L"Unknown";
- }
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SERMODE_DISPLAY),
- gShellDebug1HiiHandle,
- ConvertHandleToHandleIndex (Handles[Index]),
- Handles[Index],
- SerialIo->Mode->BaudRate,
- Parity,
- SerialIo->Mode->DataBits,
- StopBits
- );
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- break;
- }
-
- if (HandleValid) {
- break;
- }
- }
-
- if (Index == NoHandles) {
- if ((NoHandles != 0 && HandleValid) || 0 == NoHandles) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NOT_FOUND), gShellDebug1HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
-
- return ShellStatus;
-}
-
-/**
- Function for 'sermode' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunSerMode (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- SHELL_STATUS ShellStatus;
- UINTN Index;
- UINTN NoHandles;
- EFI_HANDLE *Handles;
- EFI_PARITY_TYPE Parity;
- EFI_STOP_BITS_TYPE StopBits;
- UINTN HandleIdx;
- UINTN BaudRate;
- UINTN DataBits;
- UINTN Value;
- EFI_SERIAL_IO_PROTOCOL *SerialIo;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- CONST CHAR16 *Temp;
- UINT64 Intermediate;
-
- ShellStatus = SHELL_SUCCESS;
- HandleIdx = 0;
- Parity = DefaultParity;
- Handles = NULL;
- NoHandles = 0;
- Index = 0;
- Package = NULL;
-
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) < 6 && ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) > 6) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Temp = ShellCommandLineGetRawValue(Package, 1);
- if (Temp != NULL) {
- Status = ShellConvertStringToUint64(Temp, &Intermediate, TRUE, FALSE);
- HandleIdx = (UINTN)Intermediate;
- Temp = ShellCommandLineGetRawValue(Package, 2);
- if (Temp == NULL) {
- ShellStatus = DisplaySettings (HandleIdx, TRUE);
- goto Done;
- }
- } else {
- ShellStatus = DisplaySettings (0, FALSE);
- goto Done;
- }
- Temp = ShellCommandLineGetRawValue(Package, 2);
- if (Temp != NULL) {
- BaudRate = ShellStrToUintn(Temp);
- } else {
- ASSERT(FALSE);
- BaudRate = 0;
- }
- Temp = ShellCommandLineGetRawValue(Package, 3);
- if (Temp == NULL || StrLen(Temp)>1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- switch(Temp[0]){
- case 'd':
- case 'D':
- Parity = DefaultParity;
- break;
- case 'n':
- case 'N':
- Parity = NoParity;
- break;
- case 'e':
- case 'E':
- Parity = EvenParity;
- break;
- case 'o':
- case 'O':
- Parity = OddParity;
- break;
- case 'm':
- case 'M':
- Parity = MarkParity;
- break;
- case 's':
- case 'S':
- Parity = SpaceParity;
- break;
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
- Temp = ShellCommandLineGetRawValue(Package, 4);
- if (Temp != NULL) {
- DataBits = ShellStrToUintn(Temp);
- } else {
- //
- // make sure this is some number not in the list below.
- //
- DataBits = 0;
- }
- switch (DataBits) {
- case 4:
- case 7:
- case 8:
- break;
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- Temp = ShellCommandLineGetRawValue(Package, 5);
- Value = ShellStrToUintn(Temp);
- switch (Value) {
- case 0:
- StopBits = DefaultStopBits;
- break;
-
- case 1:
- StopBits = OneStopBit;
- break;
-
- case 2:
- StopBits = TwoStopBits;
- break;
-
- case 15:
- StopBits = OneFiveStopBits;
- break;
-
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles);
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
-
- for (Index = 0; Index < NoHandles; Index++) {
- if (ConvertHandleIndexToHandle (HandleIdx) != Handles[Index]) {
- continue;
- }
-
- Status = gBS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, (VOID**)&SerialIo);
- if (!EFI_ERROR (Status)) {
- Status = SerialIo->SetAttributes (
- SerialIo,
- (UINT64) BaudRate,
- SerialIo->Mode->ReceiveFifoDepth,
- SerialIo->Mode->Timeout,
- Parity,
- (UINT8) DataBits,
- StopBits
- );
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_FAIL), gShellDebug1HiiHandle, ConvertHandleToHandleIndex(Handles[Index]), Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_HANDLE), gShellDebug1HiiHandle, ConvertHandleToHandleIndex(Handles[Index]));
- }
- break;
- }
- }
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS && Index == NoHandles) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_BAD_HANDLE), gShellDebug1HiiHandle, HandleIdx);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
-
-Done:
- if (Package != NULL) {
- ShellCommandLineFreeVarList (Package);
- }
- if (Handles != NULL) {
- FreePool (Handles);
- }
- return ShellStatus;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c
deleted file mode 100644
index 24200320fc..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/** @file
- Main file for SetSize shell Debug1 function.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-
-/**
- Function for 'setsize' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunSetSize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Temp1;
- UINTN NewSize;
- UINTN LoopVar;
- SHELL_FILE_HANDLE FileHandle;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- NewSize = 0;
- } else {
- Temp1 = ShellCommandLineGetRawValue(Package, 1);
- if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SIZE_NOT_SPEC), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- NewSize = 0;
- } else {
- NewSize = ShellStrToUintn(Temp1);
- }
- }
- for (LoopVar = 2 ; LoopVar < ShellCommandLineGetCount(Package) && ShellStatus == SHELL_SUCCESS ; LoopVar++) {
- Status = ShellOpenFileByName(ShellCommandLineGetRawValue(Package, LoopVar), &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
- if (EFI_ERROR(Status)) {
- Status = ShellOpenFileByName(ShellCommandLineGetRawValue(Package, LoopVar), &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
- }
- if (EFI_ERROR(Status) && LoopVar == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, LoopVar), Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- break;
- } else {
- Status = FileHandleSetSize(FileHandle, NewSize);
- if (Status == EFI_VOLUME_FULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_VOLUME_FULL), gShellDebug1HiiHandle);
- ShellStatus = SHELL_VOLUME_FULL;
- } else if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, LoopVar), Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_DONE), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, LoopVar));
- }
- ShellCloseFile(&FileHandle);
- }
- }
-
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
deleted file mode 100644
index 8d26c9d93b..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/** @file
- Main file for SetVar shell Debug1 function.
-
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-guid", TypeValue},
- {L"-bs", TypeFlag},
- {L"-rt", TypeFlag},
- {L"-nv", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'setvar' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunSetVar (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *VariableName;
- CONST CHAR16 *Data;
- EFI_GUID Guid;
- CONST CHAR16 *StringGuid;
- UINT32 Attributes;
- UINT32 Attributes2;
- VOID *Buffer;
- UINTN Size;
- UINTN LoopVar;
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- Buffer = NULL;
- Size = 0;
- Attributes = 0;
- DevPath = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- VariableName = ShellCommandLineGetRawValue(Package, 1);
- Data = ShellCommandLineGetRawValue(Package, 2);
- if (!ShellCommandLineGetFlag(Package, L"-guid")){
- CopyGuid(&Guid, &gEfiGlobalVariableGuid);
- } else {
- StringGuid = ShellCommandLineGetValue(Package, L"-guid");
- Status = ConvertStringToGuid(StringGuid, &Guid);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, StringGuid);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- if (Data == NULL) {
- //
- // Display what's there
- //
- Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes, &Size, Buffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Buffer = AllocateZeroPool(Size);
- Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes, &Size, Buffer);
- }
- if (!EFI_ERROR(Status)&& Buffer != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_PRINT), gShellDebug1HiiHandle, &Guid, VariableName, Size);
- for (LoopVar = 0 ; LoopVar < Size ; LoopVar++) {
- ShellPrintEx(-1, -1, L"%02x ", ((UINT8*)Buffer)[LoopVar]);
- }
- ShellPrintEx(-1, -1, L"\r\n");
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_GET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- }
- } else if (StrCmp(Data, L"=") == 0) {
- //
- // Delete what's there!
- //
- Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, 0, NULL);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- } else {
- ASSERT(ShellStatus == SHELL_SUCCESS);
- }
- } else {
- if (Data[0] == L'=') {
- Data++;
- }
- //
- // Change what's there
- //
- if (ShellCommandLineGetFlag(Package, L"-bs")) {
- Attributes |= EFI_VARIABLE_BOOTSERVICE_ACCESS;
- }
- if (ShellCommandLineGetFlag(Package, L"-rt")) {
- Attributes |= EFI_VARIABLE_RUNTIME_ACCESS;
- }
- if (ShellCommandLineGetFlag(Package, L"-nv")) {
- Attributes |= EFI_VARIABLE_NON_VOLATILE;
- }
- if (ShellIsHexOrDecimalNumber(Data, TRUE, FALSE)) {
- if (StrLen(Data) % 2 != 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDebug1HiiHandle, Data);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // arbitrary buffer
- //
- Buffer = AllocateZeroPool((StrLen(Data) / 2));
- if (Buffer == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- for (LoopVar = 0 ; LoopVar < (StrLen(Data) / 2) ; LoopVar++) {
- ((UINT8*)Buffer)[LoopVar] = (UINT8)(HexCharToUintn(Data[LoopVar*2]) * 16);
- ((UINT8*)Buffer)[LoopVar] = (UINT8)(((UINT8*)Buffer)[LoopVar] + HexCharToUintn(Data[LoopVar*2+1]));
- }
- Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, StrLen(Data) / 2, Buffer);
- }
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- } else {
- ASSERT(ShellStatus == SHELL_SUCCESS);
- }
- }
- } else if (StrnCmp(Data, L"\"", 1) == 0) {
- Size = 0;
- Attributes2 = 0;
- Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes2, &Size, Buffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Buffer = AllocateZeroPool(Size);
- Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes2, &Size, Buffer);
- FreePool(Buffer);
- Attributes = Attributes2;
- }
- //
- // ascii text
- //
- Data++;
- Buffer = AllocateZeroPool(StrSize(Data) / 2);
- if (Buffer == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- AsciiSPrint(Buffer, StrSize(Data) / 2, "%s", Data);
- ((CHAR8*)Buffer)[AsciiStrLen(Buffer)-1] = CHAR_NULL;
- Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, AsciiStrSize(Buffer)-sizeof(CHAR8), Buffer);
- }
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- } else {
- ASSERT(ShellStatus == SHELL_SUCCESS);
- }
- } else if (StrnCmp(Data, L"L\"", 2) == 0) {
- //
- // ucs2 text
- //
- Data++;
- Data++;
- Buffer = AllocateZeroPool(StrSize(Data));
- if (Buffer == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- } else {
- UnicodeSPrint(Buffer, StrSize(Data), L"%s", Data);
- ((CHAR16*)Buffer)[StrLen(Buffer)-1] = CHAR_NULL;
-
- Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, StrSize(Buffer)-sizeof(CHAR16), Buffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- } else {
- ASSERT(ShellStatus == SHELL_SUCCESS);
- }
- }
- } else if (StrnCmp(Data, L"--", 2) == 0) {
- //
- // device path in text format
- //
- Data++;
- Data++;
- DevPath = ConvertTextToDevicePath(Data);
- if (DevPath == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_DPFT), gShellDebug1HiiHandle, Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, GetDevicePathSize(DevPath), DevPath);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- } else {
- ASSERT(ShellStatus == SHELL_SUCCESS);
- }
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Data);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- }
- ShellCommandLineFreeVarList (Package);
- }
-
- if (Buffer != NULL) {
- FreePool(Buffer);
- }
-
- if (DevPath != NULL) {
- FreePool(DevPath);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
deleted file mode 100644
index f07a4c4921..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/** @file
- Module for clarifying the content of the smbios structure element info.
-
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "../UefiShellDebug1CommandsLib.h"
-#include "PrintInfo.h"
-#include "QueryTable.h"
-#include "EventLogInfo.h"
-
-/**
- Function to display system event log access information.
-
- @param[in] Key Additional information to print.
- @param[in] Option Whether to print the additional information.
-**/
-VOID
-EFIAPI
-DisplaySELAccessMethod (
- IN CONST UINT8 Key,
- IN CONST UINT8 Option
- )
-{
- //
- // Print prompt
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ACCESS_METHOD), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
-
- //
- // Print value info
- //
- switch (Key) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ONE_EIGHT_BIT), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TWO_EIGHT_BITS), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ONE_SIXTEEN_BIT), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MEM_MAPPED_PHYS), gShellDebug1HiiHandle);
- break;
-
- case 4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_VIA_GENERAL), gShellDebug1HiiHandle);
- break;
-
- default:
- if (Key <= 0x7f) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FOR_FUTURE_ASSIGN), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_BIOS_VENDOR_OEM), gShellDebug1HiiHandle);
- }
- }
-}
-
-/**
- Function to display system event log status information.
-
- @param[in] Key Additional information to print.
- @param[in] Option Whether to print the additional information.
-**/
-VOID
-EFIAPI
-DisplaySELLogStatus (
- UINT8 Key,
- UINT8 Option
- )
-{
- //
- // Print prompt
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_STATUS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
-
- //
- // Print value info
- //
- if ((Key & 0x01) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_VALID), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_VALID), gShellDebug1HiiHandle);
- }
-
- if ((Key & 0x02) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_FULL), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_NOT_FULL), gShellDebug1HiiHandle);
- }
-
- if ((Key & 0xFC) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_RES_BITS_NOT_ZERO), gShellDebug1HiiHandle, Key & 0xFC);
- }
-}
-
-/**
- Function to display system event log header format information.
-
- @param[in] Key Additional information to print.
- @param[in] Option Whether to print the additional information.
-**/
-VOID
-EFIAPI
-DisplaySysEventLogHeaderFormat (
- UINT8 Key,
- UINT8 Option
- )
-{
- //
- // Print prompt
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_HEADER_FORMAT), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
-
- //
- // Print value info
- //
- if (Key == 0x00) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_NO_HEADER), gShellDebug1HiiHandle);
- } else if (Key == 0x01) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TYPE_LOG_HEADER), gShellDebug1HiiHandle);
- } else if (Key <= 0x7f) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FOR_FUTURE), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_BIOS_VENDOR), gShellDebug1HiiHandle);
- }
-}
-
-/**
- Display the header information for SEL log items.
-
- @param[in] Key The information key.
- @param[in] Option The option index.
-**/
-VOID
-DisplaySELLogHeaderLen (
- UINT8 Key,
- UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_HEADER_LEN), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ONE_VAR_D), gShellDebug1HiiHandle, Key & 0x7F);
-
- //
- // The most-significant bit of the field specifies
- // whether (0) or not (1) the record has been read
- //
- if ((Key & 0x80) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_THIS_RECORD_READ), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_THIS_RECORD_NOT_READ), gShellDebug1HiiHandle);
- }
-}
-
-/**
- Display the header information for type 1 items.
-
- @param[in] LogHeader The buffer with the information.
-**/
-VOID
-DisplaySysEventLogHeaderType1 (
- IN UINT8 *LogHeader
- )
-{
- LOG_HEADER_TYPE1_FORMAT *Header;
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SYSTEM_EVENT_LOG), gShellDebug1HiiHandle);
-
- //
- // Print Log Header Type1 Format info
- //
- Header = (LOG_HEADER_TYPE1_FORMAT *) (LogHeader);
-
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_OEM_RESERVED),
- gShellDebug1HiiHandle,
- Header->OEMReserved[0],
- Header->OEMReserved[1],
- Header->OEMReserved[2],
- Header->OEMReserved[3],
- Header->OEMReserved[4]
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->Metw);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->Meci);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_ADDRESS), gShellDebug1HiiHandle, Header->CMOSAddress);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_INDEX), gShellDebug1HiiHandle, Header->CMOSBitIndex);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_CHECKSUM_STARTING_OFF), gShellDebug1HiiHandle, Header->StartingOffset);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_CHECKSUN_BYTE_COUNT), gShellDebug1HiiHandle, Header->ChecksumOffset);
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_RESERVED),
- gShellDebug1HiiHandle,
- Header->OEMReserved[0],
- Header->OEMReserved[1],
- Header->OEMReserved[2]
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_HEADER_REVISION), gShellDebug1HiiHandle, Header->HeaderRevision);
-}
-
-/**
- Function to display system event log header information.
-
- @param[in] LogHeaderFormat Format identifier.
- @param[in] LogHeader Format informcation.
-**/
-VOID
-EFIAPI
-DisplaySysEventLogHeader (
- UINT8 LogHeaderFormat,
- UINT8 *LogHeader
- )
-{
- //
- // Print prompt
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_HEADER), gShellDebug1HiiHandle);
-
- //
- // Print value info
- //
- if (LogHeaderFormat == 0x00) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_NO_HEADER), gShellDebug1HiiHandle);
- } else if (LogHeaderFormat == 0x01) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TYPE_LOG_HEADER), gShellDebug1HiiHandle);
- DisplaySysEventLogHeaderType1 (LogHeader);
- } else if (LogHeaderFormat <= 0x7f) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FUTURE_ASSIGN), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_BIOS_VENDOR), gShellDebug1HiiHandle);
- }
-}
-
-/**
- Display the El Vdf information.
-
- @param[in] ElVdfType The information type.
- @param[in] VarData The information buffer.
-**/
-VOID
-DisplayElVdfInfo (
- UINT8 ElVdfType,
- UINT8 *VarData
- )
-{
- UINT16 *Word;
- UINT32 *Dword;
-
- //
- // Display Type Name
- //
- DisplaySELVarDataFormatType (ElVdfType, SHOW_DETAIL);
-
- //
- // Display Type description
- //
- switch (ElVdfType) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_NO_STD_FORMAT), gShellDebug1HiiHandle);
- break;
-
- case 1:
- Word = (UINT16 *) (VarData + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SMBIOS_STRUCT_ASSOC), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, *Word);
- break;
-
- case 2:
- Dword = (UINT32 *) (VarData + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULT_EVENT_COUNTER), gShellDebug1HiiHandle, *Dword);
- break;
-
- case 3:
- Word = (UINT16 *) (VarData + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SMBIOS_STRUCT_ASSOC), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, *Word);
- //
- // Followed by a multiple-event counter
- //
- Dword = (UINT32 *) (VarData + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULT_EVENT_COUNTER), gShellDebug1HiiHandle, *Dword);
- break;
-
- case 4:
- Dword = (UINT32 *) (VarData + 1);
- DisplayPostResultsBitmapDw1 (*Dword, SHOW_DETAIL);
- Dword++;
- DisplayPostResultsBitmapDw2 (*Dword, SHOW_DETAIL);
- break;
-
- case 5:
- Dword = (UINT32 *) (VarData + 1);
- DisplaySELSysManagementTypes (*Dword, SHOW_DETAIL);
- break;
-
- case 6:
- Dword = (UINT32 *) (VarData + 1);
- DisplaySELSysManagementTypes (*Dword, SHOW_DETAIL);
- //
- // Followed by a multiple-event counter
- //
- Dword = (UINT32 *) (VarData + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULT_EVENT_COUNTER), gShellDebug1HiiHandle, *Dword);
- break;
-
- default:
- if (ElVdfType <= 0x7F) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_UNUSED_AVAIL_FOR_ASSIGN), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FOR_SYSTEM), gShellDebug1HiiHandle);
- }
- }
-}
-
-/**
- Function to display system event log data.
-
- @param[in] LogData The data information.
- @param[in] LogAreaLength Length of the data.
-**/
-VOID
-EFIAPI
-DisplaySysEventLogData (
- UINT8 *LogData,
- UINT16 LogAreaLength
- )
-{
- LOG_RECORD_FORMAT *Log;
- UINT8 ElVdfType;
- //
- // Event Log Variable Data Format Types
- //
- UINTN Offset;
-
- //
- // Print prompt
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SYSTEM_EVENT_LOG_2), gShellDebug1HiiHandle);
-
- //
- // Print Log info
- //
- Offset = 0;
- Log = (LOG_RECORD_FORMAT *) LogData;
- while (Log != NULL && Log->Type != END_OF_LOG && Offset < LogAreaLength) {
- //
- // Get a Event Log Record
- //
- Log = (LOG_RECORD_FORMAT *) (LogData + Offset);
-
- if (Log != NULL) {
- //
- // Display Event Log Record Information
- //
- DisplaySELVarDataFormatType (Log->Type, SHOW_DETAIL);
- DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL);
-
- Offset += Log->Length;
- //
- // Display Log Header Date/Time Fields
- // These fields contain the BCD representation of the date and time
- // (as read from CMOS) of the occurrence of the event
- // So Print as hex and represent decimal
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_DATE), gShellDebug1HiiHandle);
- if (Log != NULL && Log->Year >= 80 && Log->Year <= 99) {
- Print (L"19");
- } else if (Log != NULL && Log->Year <= 79) {
- Print (L"20");
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle);
- continue;
- }
-
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TIME_SIX_VARS),
- gShellDebug1HiiHandle,
- Log->Year,
- Log->Month,
- Log->Day,
- Log->Hour,
- Log->Minute,
- Log->Second
- );
-
- //
- // Display Variable Data Format
- //
- if (Log->Length <= (sizeof (LOG_RECORD_FORMAT) - 1)) {
- continue;
- }
-
- ElVdfType = Log->LogVariableData[0];
- DisplayElVdfInfo (ElVdfType, Log->LogVariableData);
- }
- }
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h
deleted file mode 100644
index b32cfea812..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/** @file
- Module to clarify system event log of smbios structure.
-
- Copyright (c) 2005-2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SMBIOS_EVENT_LOG_INFO_H_
-#define _SMBIOS_EVENT_LOG_INFO_H_
-
-#define END_OF_LOG 0xFF
-
-#pragma pack(1)
-
-typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 Year;
- UINT8 Month;
- UINT8 Day;
- UINT8 Hour;
- UINT8 Minute;
- UINT8 Second;
- UINT8 LogVariableData[1];
-} LOG_RECORD_FORMAT;
-
-typedef struct {
- UINT8 OEMReserved[5];
- UINT8 Metw; // Multiple Event Time Window
- UINT8 Meci; // Multiple Event Count Increment
- UINT8 CMOSAddress; // Pre-boot Event Log Reset - CMOS Address
- UINT8 CMOSBitIndex; // Pre-boot Event Log Reset - CMOS Bit Index
- UINT8 StartingOffset; // CMOS Checksum - Starting Offset
- UINT8 ByteCount; // CMOS Checksum - Byte Count
- UINT8 ChecksumOffset; // CMOS Checksum - Checksum Offset
- UINT8 Reserved[3];
- UINT8 HeaderRevision;
-} LOG_HEADER_TYPE1_FORMAT;
-
-#pragma pack()
-//
-// System Event Log (Type 15)
-//
-
-/**
- Function to display system event log access information.
-
- @param[in] Key Additional information to print.
- @param[in] Option Whether to print the additional information.
-**/
-VOID
-EFIAPI
-DisplaySELAccessMethod (
- IN CONST UINT8 Key,
- IN CONST UINT8 Option
- );
-
-/**
- Function to display system event log status information.
-
- @param[in] Key Additional information to print.
- @param[in] Option Whether to print the additional information.
-**/
-VOID
-EFIAPI
-DisplaySELLogStatus (
- UINT8 Key,
- UINT8 Option
- );
-
-/**
- Function to display system event log header format information.
-
- @param[in] Key Additional information to print.
- @param[in] Option Whether to print the additional information.
-**/
-VOID
-EFIAPI
-DisplaySysEventLogHeaderFormat (
- UINT8 Key,
- UINT8 Option
- );
-
-/**
- Function to display system event log header information.
-
- @param[in] LogHeaderFormat Format identifier.
- @param[in] LogHeader Format informcation.
-**/
-VOID
-EFIAPI
-DisplaySysEventLogHeader (
- UINT8 LogHeaderFormat,
- UINT8 *LogHeader
- );
-
-/**
- Function to display system event log data.
-
- @param[in] LogData The data information.
- @param[in] LogAreaLength Length of the data.
-**/
-VOID
-EFIAPI
-DisplaySysEventLogData (
- UINT8 *LogData,
- UINT16 LogAreaLength
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
deleted file mode 100644
index 23a46d3fe1..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/** @file
- API for SMBIOS table.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "../UefiShellDebug1CommandsLib.h"
-#include <Guid/SmBios.h>
-#include "LibSmbiosView.h"
-#include "SmbiosView.h"
-
-STATIC UINT8 mInit = 0;
-STATIC SMBIOS_TABLE_ENTRY_POINT *mSmbiosTable = NULL;
-STATIC SMBIOS_STRUCTURE_POINTER m_SmbiosStruct;
-STATIC SMBIOS_STRUCTURE_POINTER *mSmbiosStruct = &m_SmbiosStruct;
-
-/**
- Init the SMBIOS VIEW API's environment.
-
- @retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.
-**/
-EFI_STATUS
-LibSmbiosInit (
- VOID
- )
-{
- EFI_STATUS Status;
-
- //
- // Init only once
- //
- if (mInit == 1) {
- return EFI_SUCCESS;
- }
- //
- // Get SMBIOS table from System Configure table
- //
- Status = GetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID**)&mSmbiosTable);
-
- if (mSmbiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), gShellDebug1HiiHandle);
- return EFI_NOT_FOUND;
- }
-
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_GET_TABLE_ERROR), gShellDebug1HiiHandle, Status);
- return Status;
- }
- //
- // Init SMBIOS structure table address
- //
- mSmbiosStruct->Raw = (UINT8 *) (UINTN) (mSmbiosTable->TableAddress);
-
- mInit = 1;
- return EFI_SUCCESS;
-}
-
-/**
- Cleanup the Smbios information.
-**/
-VOID
-LibSmbiosCleanup (
- VOID
- )
-{
- //
- // Release resources
- //
- if (mSmbiosTable != NULL) {
- mSmbiosTable = NULL;
- }
-
- mInit = 0;
-}
-
-/**
- Get the entry point structure for the table.
-
- @param[out] EntryPointStructure The pointer to populate.
-**/
-VOID
-LibSmbiosGetEPS (
- OUT SMBIOS_TABLE_ENTRY_POINT **EntryPointStructure
- )
-{
- //
- // return SMBIOS Table address
- //
- *EntryPointStructure = mSmbiosTable;
-}
-
-/**
- Return SMBIOS string for the given string number.
-
- @param[in] Smbios Pointer to SMBIOS structure.
- @param[in] StringNumber String number to return. -1 is used to skip all strings and
- point to the next SMBIOS structure.
-
- @return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
-**/
-CHAR8*
-LibGetSmbiosString (
- IN SMBIOS_STRUCTURE_POINTER *Smbios,
- IN UINT16 StringNumber
- )
-{
- UINT16 Index;
- CHAR8 *String;
-
- ASSERT (Smbios != NULL);
-
- //
- // Skip over formatted section
- //
- String = (CHAR8 *) (Smbios->Raw + Smbios->Hdr->Length);
-
- //
- // Look through unformated section
- //
- for (Index = 1; Index <= StringNumber; Index++) {
- if (StringNumber == Index) {
- return String;
- }
- //
- // Skip string
- //
- for (; *String != 0; String++);
- String++;
-
- if (*String == 0) {
- //
- // If double NULL then we are done.
- // Return pointer to next structure in Smbios.
- // if you pass in a -1 you will always get here
- //
- Smbios->Raw = (UINT8 *)++String;
- return NULL;
- }
- }
-
- return NULL;
-}
-
-/**
- Get SMBIOS structure for the given Handle,
- Handle is changed to the next handle or 0xFFFF when the end is
- reached or the handle is not found.
-
- @param[in, out] Handle 0xFFFF: get the first structure
- Others: get a structure according to this value.
- @param[out] Buffer The pointer to the pointer to the structure.
- @param[out] Length Length of the structure.
-
- @retval DMI_SUCCESS Handle is updated with next structure handle or
- 0xFFFF(end-of-list).
-
- @retval DMI_INVALID_HANDLE Handle is updated with first structure handle or
- 0xFFFF(end-of-list).
-**/
-EFI_STATUS
-LibGetSmbiosStructure (
- IN OUT UINT16 *Handle,
- OUT UINT8 **Buffer,
- OUT UINT16 *Length
- )
-{
- SMBIOS_STRUCTURE_POINTER Smbios;
- SMBIOS_STRUCTURE_POINTER SmbiosEnd;
- UINT8 *Raw;
-
- if (*Handle == INVALID_HANDLE) {
- *Handle = mSmbiosStruct->Hdr->Handle;
- return DMI_INVALID_HANDLE;
- }
-
- if ((Buffer == NULL) || (Length == NULL)) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_NO_BUFF_LEN_SPEC), gShellDebug1HiiHandle);
- return DMI_INVALID_HANDLE;
- }
-
- *Length = 0;
- Smbios.Hdr = mSmbiosStruct->Hdr;
- SmbiosEnd.Raw = Smbios.Raw + mSmbiosTable->TableLength;
- while (Smbios.Raw < SmbiosEnd.Raw) {
- if (Smbios.Hdr->Handle == *Handle) {
- Raw = Smbios.Raw;
- //
- // Walk to next structure
- //
- LibGetSmbiosString (&Smbios, (UINT16) (-1));
- //
- // Length = Next structure head - this structure head
- //
- *Length = (UINT16) (Smbios.Raw - Raw);
- *Buffer = Raw;
- //
- // update with the next structure handle.
- //
- if (Smbios.Raw < SmbiosEnd.Raw) {
- *Handle = Smbios.Hdr->Handle;
- } else {
- *Handle = INVALID_HANDLE;
- }
- return DMI_SUCCESS;
- }
- //
- // Walk to next structure
- //
- LibGetSmbiosString (&Smbios, (UINT16) (-1));
- }
-
- *Handle = INVALID_HANDLE;
- return DMI_INVALID_HANDLE;
-}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
deleted file mode 100644
index f953296bd9..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/** @file
- API for SMBIOS Plug and Play functions, access to SMBIOS table and structures.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _LIB_SMBIOS_VIEW_H_
-#define _LIB_SMBIOS_VIEW_H_
-
-#include <IndustryStandard/SmBios.h>
-
-#define DMI_SUCCESS 0x00
-#define DMI_UNKNOWN_FUNCTION 0x81
-#define DMI_FUNCTION_NOT_SUPPORTED 0x82
-#define DMI_INVALID_HANDLE 0x83
-#define DMI_BAD_PARAMETER 0x84
-#define DMI_INVALID_SUBFUNCTION 0x85
-#define DMI_NO_CHANGE 0x86
-#define DMI_ADD_STRUCTURE_FAILED 0x87
-#define DMI_READ_ONLY 0x8D
-#define DMI_LOCK_NOT_SUPPORTED 0x90
-#define DMI_CURRENTLY_LOCKED 0x91
-#define DMI_INVALID_LOCK 0x92
-
-#define INVALID_HANDLE (UINT16) (-1)
-
-#define EFI_SMBIOSERR(val) EFIERR (0x30000 | val)
-
-#define EFI_SMBIOSERR_FAILURE EFI_SMBIOSERR (1)
-#define EFI_SMBIOSERR_STRUCT_NOT_FOUND EFI_SMBIOSERR (2)
-#define EFI_SMBIOSERR_TYPE_UNKNOWN EFI_SMBIOSERR (3)
-#define EFI_SMBIOSERR_UNSUPPORTED EFI_SMBIOSERR (4)
-
-/**
- Init the SMBIOS VIEW API's environment.
-
- @retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.
-**/
-EFI_STATUS
-LibSmbiosInit (
- VOID
- );
-
-/**
- Cleanup the Smbios information.
-**/
-VOID
-LibSmbiosCleanup (
- VOID
- );
-
-/**
- Get the entry point structure for the table.
-
- @param[out] EntryPointStructure The pointer to populate.
-**/
-VOID
-LibSmbiosGetEPS (
- OUT SMBIOS_TABLE_ENTRY_POINT **EntryPointStructure
- );
-
-/**
- Return SMBIOS string for the given string number.
-
- @param[in] Smbios Pointer to SMBIOS structure.
- @param[in] StringNumber String number to return. -1 is used to skip all strings and
- point to the next SMBIOS structure.
-
- @return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
-**/
-CHAR8*
-LibGetSmbiosString (
- IN SMBIOS_STRUCTURE_POINTER *Smbios,
- IN UINT16 StringNumber
- );
-
-/**
- Get SMBIOS structure for the given Handle,
- Handle is changed to the next handle or 0xFFFF when the end is
- reached or the handle is not found.
-
- @param[in, out] Handle 0xFFFF: get the first structure
- Others: get a structure according to this value.
- @param[out] Buffer The pointer to the pointer to the structure.
- @param[out] Length Length of the structure.
-
- @retval DMI_SUCCESS Handle is updated with next structure handle or
- 0xFFFF(end-of-list).
-
- @retval DMI_INVALID_HANDLE Handle is updated with first structure handle or
- 0xFFFF(end-of-list).
-**/
-EFI_STATUS
-LibGetSmbiosStructure (
- IN OUT UINT16 *Handle,
- OUT UINT8 **Buffer,
- OUT UINT16 *Length
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
deleted file mode 100644
index 9ae5a0c741..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ /dev/null
@@ -1,3109 +0,0 @@
-/** @file
- Module for clarifying the content of the smbios structure element information.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "../UefiShellDebug1CommandsLib.h"
-#include "PrintInfo.h"
-#include "LibSmbiosView.h"
-#include "QueryTable.h"
-#include "EventLogInfo.h"
-
-
-//
-// Get the certain bit of 'value'
-//
-#define BIT(value, bit) ((value) & ((UINT64) 1) << (bit))
-
-//
-// Check if above or equal to version
-//
-#define AE_SMBIOS_VERSION(MajorVersion, MinorVersion) \
- (SmbiosMajorVersion > (MajorVersion) || (SmbiosMajorVersion == (MajorVersion) && SmbiosMinorVersion >= (MinorVersion)))
-
-//
-//////////////////////////////////////////////////////////
-// Macros of print structure element, simplify coding.
-//
-#define PRINT_PENDING_STRING(pStruct, type, element) \
- do { \
- CHAR8 *StringBuf; \
- StringBuf = LibGetSmbiosString ((pStruct), (pStruct->type->element)); \
- ShellPrintEx(-1,-1,L"%a",#element); \
- ShellPrintEx(-1,-1,L": %a\n", (StringBuf != NULL) ? StringBuf: ""); \
- } while (0);
-
-#define PRINT_SMBIOS_STRING(pStruct, stringnumber, element) \
- do { \
- CHAR8 *StringBuf; \
- StringBuf = LibGetSmbiosString ((pStruct), (stringnumber)); \
- ShellPrintEx(-1,-1,L"%a",#element); \
- ShellPrintEx(-1,-1,L": %a\n", (StringBuf != NULL) ? StringBuf: ""); \
- } while (0);
-
-#define PRINT_STRUCT_VALUE(pStruct, type, element) \
- do { \
- ShellPrintEx(-1,-1,L"%a",#element); \
- ShellPrintEx(-1,-1,L": %d\n", (pStruct->type->element)); \
- } while (0);
-
-#define PRINT_STRUCT_VALUE_H(pStruct, type, element) \
- do { \
- ShellPrintEx(-1,-1,L"%a",#element); \
- ShellPrintEx(-1,-1,L": 0x%x\n", (pStruct->type->element)); \
- } while (0);
-
-#define PRINT_STRUCT_VALUE_LH(pStruct, type, element) \
- do { \
- ShellPrintEx(-1,-1,L"%a",#element); \
- ShellPrintEx(-1,-1,L": 0x%lx\n", (pStruct->type->element)); \
- } while (0);
-
-#define PRINT_BIT_FIELD(pStruct, type, element, size) \
- do { \
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DUMP), gShellDebug1HiiHandle); \
- ShellPrintEx(-1,-1,L"%a",#element); \
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SIZE), gShellDebug1HiiHandle, size); \
- DumpHex (0, 0, size, &(pStruct->type->element)); \
- } while (0);
-
-#define PRINT_SMBIOS_BIT_FIELD(pStruct, startaddress, element, size) \
- do { \
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DUMP), gShellDebug1HiiHandle); \
- ShellPrintEx(-1,-1,L"%a",#element); \
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SIZE), gShellDebug1HiiHandle, size); \
- DumpHex (0, 0, size, startaddress); \
- } while (0);
-
-//
-/////////////////////////////////////////
-//
-
-/**
- Copy Length of Src buffer to Dest buffer,
- add a NULL termination to Dest buffer.
-
- @param[in, out] Dest Destination buffer head.
- @param[in] Src Source buffer head.
- @param[in] Length Length of buffer to be copied.
-**/
-VOID
-MemToString (
- IN OUT VOID *Dest,
- IN VOID *Src,
- IN UINTN Length
- )
-{
- UINT8 *SrcBuffer;
- UINT8 *DestBuffer;
- SrcBuffer = (UINT8 *) Src;
- DestBuffer = (UINT8 *) Dest;
- //
- // copy byte by byte
- //
- while ((Length--)!=0) {
- *DestBuffer++ = *SrcBuffer++;
- }
- //
- // append a NULL terminator
- //
- *DestBuffer = '\0';
-}
-
-//
-//////////////////////////////////////////////
-//
-// Functions below is to show the information
-//
-
-/**
- Print the info of EPS(Entry Point Structure).
-
- @param[in] SmbiosTable Pointer to the SMBIOS table entry point.
- @param[in] Option Display option.
-**/
-VOID
-SmbiosPrintEPSInfo (
- IN SMBIOS_TABLE_ENTRY_POINT *SmbiosTable,
- IN UINT8 Option
- )
-{
- UINT8 Anchor[5];
- UINT8 InAnchor[6];
-
- if (SmbiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SMBIOSTABLE_NULL), gShellDebug1HiiHandle);
- return ;
- }
-
- if (Option == SHOW_NONE) {
- return ;
- }
-
- if (Option >= SHOW_NORMAL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_SIGN), gShellDebug1HiiHandle);
- MemToString (Anchor, SmbiosTable->AnchorString, 4);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ANCHOR_STR), gShellDebug1HiiHandle, Anchor);
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EPS_CHECKSUM),
- gShellDebug1HiiHandle,
- SmbiosTable->EntryPointStructureChecksum
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_LEN), gShellDebug1HiiHandle, SmbiosTable->EntryPointLength);
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VERSION),
- gShellDebug1HiiHandle,
- SmbiosTable->MajorVersion,
- SmbiosTable->MinorVersion
- );
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NUMBER_STRUCT),
- gShellDebug1HiiHandle,
- SmbiosTable->NumberOfSmbiosStructures
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MAX_STRUCT_SIZE), gShellDebug1HiiHandle, SmbiosTable->MaxStructureSize);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_ADDR), gShellDebug1HiiHandle, SmbiosTable->TableAddress);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_LENGTH), gShellDebug1HiiHandle, SmbiosTable->TableLength);
-
- }
- //
- // If SHOW_ALL, also print followings.
- //
- if (Option >= SHOW_DETAIL) {
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_REVISION),
- gShellDebug1HiiHandle,
- SmbiosTable->EntryPointRevision
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BCD_REVISION), gShellDebug1HiiHandle, SmbiosTable->SmbiosBcdRevision);
- //
- // Since raw data is not string, add a NULL terminater.
- //
- MemToString (InAnchor, SmbiosTable->IntermediateAnchorString, 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTER_ACHOR), gShellDebug1HiiHandle, InAnchor);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTER_CHECKSUM), gShellDebug1HiiHandle, SmbiosTable->IntermediateChecksum);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FORMATTED_AREA), gShellDebug1HiiHandle);
- DumpHex (2, 0, 5, SmbiosTable->FormattedArea);
- }
-
- Print (L"\n");
-}
-
-/**
- This function print the content of the structure pointed by Struct.
-
- @param[in] Struct Point to the structure to be printed.
- @param[in] Option Print option of information detail.
-
- @retval EFI_SUCCESS Successfully Printing this function.
- @retval EFI_INVALID_PARAMETER Invalid Structure.
- @retval EFI_UNSUPPORTED Unsupported.
-**/
-EFI_STATUS
-SmbiosPrintStructure (
- IN SMBIOS_STRUCTURE_POINTER *Struct,
- IN UINT8 Option
- )
-{
- UINT8 Index;
- UINT8 *Buffer;
-
- if (Struct == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (Option == SHOW_NONE) {
- return EFI_SUCCESS;
- }
-
- Buffer = (UINT8 *) (UINTN) (Struct->Raw);
-
- //
- // Display structure header
- //
- DisplayStructureTypeInfo (Struct->Hdr->Type, SHOW_DETAIL);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FORMAT_PART_LEN), gShellDebug1HiiHandle, Struct->Hdr->Length);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, Struct->Hdr->Handle);
-
- if (Option == SHOW_OUTLINE) {
- return EFI_SUCCESS;
- }
-
- switch (Struct->Hdr->Type) {
- //
- // BIOS Information (Type 0)
- //
- case 0:
- PRINT_PENDING_STRING (Struct, Type0, Vendor);
- PRINT_PENDING_STRING (Struct, Type0, BiosVersion);
- PRINT_STRUCT_VALUE (Struct, Type0, BiosSegment);
- PRINT_PENDING_STRING (Struct, Type0, BiosReleaseDate);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, 64 * (Struct->Type0->BiosSize + 1));
-
- DisplayBiosCharacteristics (ReadUnaligned64 ((UINT64 *) (UINTN) &(Struct->Type0->BiosCharacteristics)), Option);
-
- if (Struct->Hdr->Length > 0x12) {
- DisplayBiosCharacteristicsExt1 (Struct->Type0->BIOSCharacteristicsExtensionBytes[0], Option);
- }
- if (Struct->Hdr->Length > 0x13) {
- DisplayBiosCharacteristicsExt2 (Struct->Type0->BIOSCharacteristicsExtensionBytes[1], Option);
- }
-
- if (AE_SMBIOS_VERSION (0x2, 0x4) && (Struct->Hdr->Length > 0x14)) {
- PRINT_STRUCT_VALUE (Struct, Type0, SystemBiosMajorRelease);
- PRINT_STRUCT_VALUE (Struct, Type0, SystemBiosMinorRelease);
- PRINT_STRUCT_VALUE (Struct, Type0, EmbeddedControllerFirmwareMajorRelease);
- PRINT_STRUCT_VALUE (Struct, Type0, EmbeddedControllerFirmwareMinorRelease);
- }
-
- break;
-
- //
- // System Information (Type 1)
- //
- case 1:
- PRINT_PENDING_STRING (Struct, Type1, Manufacturer);
- PRINT_PENDING_STRING (Struct, Type1, ProductName);
- PRINT_PENDING_STRING (Struct, Type1, Version);
- PRINT_PENDING_STRING (Struct, Type1, SerialNumber);
- PRINT_BIT_FIELD (Struct, Type1, Uuid, 16);
- DisplaySystemWakeupType (Struct->Type1->WakeUpType, Option);
- if (AE_SMBIOS_VERSION (0x2, 0x4) && (Struct->Hdr->Length > 0x19)) {
- PRINT_PENDING_STRING (Struct, Type1, SKUNumber);
- PRINT_PENDING_STRING (Struct, Type1, Family);
- }
-
- break;
-
- //
- // Baseboard Information (Type 2)
- //
- case 2:
- PRINT_PENDING_STRING (Struct, Type2, Manufacturer);
- PRINT_PENDING_STRING (Struct, Type2, ProductName);
- PRINT_PENDING_STRING (Struct, Type2, Version);
- PRINT_PENDING_STRING (Struct, Type2, SerialNumber);
- if (Struct->Hdr->Length > 0x8) {
- PRINT_PENDING_STRING (Struct, Type2, AssetTag);
- DisplayBaseBoardFeatureFlags (*(UINT8 *) &Struct->Type2->FeatureFlag, Option);
- PRINT_PENDING_STRING (Struct, Type2, LocationInChassis);
- PRINT_STRUCT_VALUE_H (Struct, Type2, ChassisHandle);
- DisplayBaseBoardBoardType (Struct->Type2->BoardType, Option);
- }
- break;
-
- //
- // System Enclosure (Type 3)
- //
- case 3:
- PRINT_PENDING_STRING (Struct, Type3, Manufacturer);
- PRINT_STRUCT_VALUE (Struct, Type3, Type);
- DisplaySystemEnclosureType (Struct->Type3->Type, Option);
- PRINT_PENDING_STRING (Struct, Type3, Version);
- PRINT_PENDING_STRING (Struct, Type3, SerialNumber);
- PRINT_PENDING_STRING (Struct, Type3, AssetTag);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOTUP_STATE), gShellDebug1HiiHandle);
- DisplaySystemEnclosureStatus (Struct->Type3->BootupState, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_STATE), gShellDebug1HiiHandle);
- DisplaySystemEnclosureStatus (Struct->Type3->PowerSupplyState, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_THERMAL_STATE), gShellDebug1HiiHandle);
- DisplaySystemEnclosureStatus (Struct->Type3->ThermalState, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SECURITY_STATUS), gShellDebug1HiiHandle);
- DisplaySESecurityStatus (Struct->Type3->SecurityStatus, Option);
- if (AE_SMBIOS_VERSION (0x2, 0x3) && (Struct->Hdr->Length > 0xD)) {
- PRINT_BIT_FIELD (Struct, Type3, OemDefined, 4);
- }
- break;
-
- //
- // Processor Information (Type 4)
- //
- case 4:
- PRINT_PENDING_STRING (Struct, Type4, Socket);
- DisplayProcessorType (Struct->Type4->ProcessorType, Option);
- if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0x28) &&
- (Struct->Type4->ProcessorFamily == 0xFE)) {
- //
- // Get family from ProcessorFamily2 field
- //
- DisplayProcessorFamily2 (Struct->Type4->ProcessorFamily2, Option);
- } else {
- DisplayProcessorFamily (Struct->Type4->ProcessorFamily, Option);
- }
- PRINT_PENDING_STRING (Struct, Type4, ProcessorManufacture);
- PRINT_BIT_FIELD (Struct, Type4, ProcessorId, 8);
- PRINT_PENDING_STRING (Struct, Type4, ProcessorVersion);
- DisplayProcessorVoltage (*(UINT8 *) &(Struct->Type4->Voltage), Option);
- PRINT_STRUCT_VALUE (Struct, Type4, ExternalClock);
- PRINT_STRUCT_VALUE (Struct, Type4, MaxSpeed);
- PRINT_STRUCT_VALUE (Struct, Type4, CurrentSpeed);
- DisplayProcessorStatus (Struct->Type4->Status, Option);
- DisplayProcessorUpgrade (Struct->Type4->ProcessorUpgrade, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type4, L1CacheHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type4, L2CacheHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type4, L3CacheHandle);
- if (AE_SMBIOS_VERSION (0x2, 0x3) && (Struct->Hdr->Length > 0x20)) {
- PRINT_PENDING_STRING (Struct, Type4, SerialNumber);
- PRINT_PENDING_STRING (Struct, Type4, AssetTag);
- PRINT_PENDING_STRING (Struct, Type4, PartNumber);
- }
- if (AE_SMBIOS_VERSION (0x2, 0x5) && (Struct->Hdr->Length > 0x23)) {
- PRINT_STRUCT_VALUE (Struct, Type4, CoreCount);
- PRINT_STRUCT_VALUE (Struct, Type4, EnabledCoreCount);
- PRINT_STRUCT_VALUE (Struct, Type4, ThreadCount);
- DisplayProcessorCharacteristics (Struct->Type4->ProcessorCharacteristics, Option);
- }
- break;
-
- //
- // Memory Controller Information (Type 5)
- //
- case 5:
- {
- UINT8 SlotNum;
- SlotNum = Struct->Type5->AssociatedMemorySlotNum;
-
- DisplayMcErrorDetectMethod (Struct->Type5->ErrDetectMethod, Option);
- DisplayMcErrorCorrectCapability (*(UINT8 *) &(Struct->Type5->ErrCorrectCapability), Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SUPOPRT), gShellDebug1HiiHandle);
- DisplayMcInterleaveSupport (Struct->Type5->SupportInterleave, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CURRENT), gShellDebug1HiiHandle);
- DisplayMcInterleaveSupport (Struct->Type5->CurrentInterleave, Option);
- DisplayMaxMemoryModuleSize (Struct->Type5->MaxMemoryModuleSize, SlotNum, Option);
- DisplayMcMemorySpeeds (*(UINT16 *) &(Struct->Type5->SupportSpeed), Option);
- DisplayMmMemoryType (Struct->Type5->SupportMemoryType, Option);
- DisplayMemoryModuleVoltage (Struct->Type5->MemoryModuleVoltage, Option);
- PRINT_STRUCT_VALUE (Struct, Type5, AssociatedMemorySlotNum);
- //
- // According to SMBIOS Specification, offset 0x0F
- //
- DisplayMemoryModuleConfigHandles ((UINT16 *) (&Buffer[0x0F]), SlotNum, Option);
- DisplayMcErrorCorrectCapability (Buffer[0x0F + 2 * SlotNum], Option);
- }
- break;
-
- //
- // Memory Module Information (Type 6)
- //
- case 6:
- PRINT_PENDING_STRING (Struct, Type6, SocketDesignation);
- DisplayMmBankConnections (Struct->Type6->BankConnections, Option);
- PRINT_STRUCT_VALUE (Struct, Type6, CurrentSpeed);
- DisplayMmMemoryType (*(UINT16 *) &(Struct->Type6->CurrentMemoryType), Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INSTALLED), gShellDebug1HiiHandle);
- DisplayMmMemorySize (*(UINT8 *) &(Struct->Type6->InstalledSize), Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED), gShellDebug1HiiHandle);
- DisplayMmMemorySize (*(UINT8 *) &(Struct->Type6->EnabledSize), Option);
- DisplayMmErrorStatus (Struct->Type6->ErrorStatus, Option);
- break;
-
- //
- // Cache Information (Type 7)
- //
- case 7:
- PRINT_PENDING_STRING (Struct, Type7, SocketDesignation);
- DisplayCacheConfiguration (Struct->Type7->CacheConfiguration, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type7, MaximumCacheSize);
- PRINT_STRUCT_VALUE_H (Struct, Type7, InstalledSize);
- PRINT_STRUCT_VALUE_H (Struct, Type7, SupportedSRAMType);
- PRINT_STRUCT_VALUE_H (Struct, Type7, CurrentSRAMType);
- DisplayCacheSRAMType (ReadUnaligned16 ((UINT16 *) (UINTN) &(Struct->Type7->CurrentSRAMType)), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type7, CacheSpeed);
- DisplayCacheErrCorrectingType (Struct->Type7->ErrorCorrectionType, Option);
- DisplayCacheSystemCacheType (Struct->Type7->SystemCacheType, Option);
- DisplayCacheAssociativity (Struct->Type7->Associativity, Option);
- break;
-
- //
- // Port Connector Information (Type 8)
- //
- case 8:
- PRINT_PENDING_STRING (Struct, Type8, InternalReferenceDesignator);
- Print (L"Internal ");
- DisplayPortConnectorType (Struct->Type8->InternalConnectorType, Option);
- PRINT_PENDING_STRING (Struct, Type8, ExternalReferenceDesignator);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EXTERNAL), gShellDebug1HiiHandle);
- DisplayPortConnectorType (Struct->Type8->ExternalConnectorType, Option);
- DisplayPortType (Struct->Type8->PortType, Option);
- break;
-
- //
- // System Slots (Type 9)
- //
- case 9:
- PRINT_PENDING_STRING (Struct, Type9, SlotDesignation);
- DisplaySystemSlotType (Struct->Type9->SlotType, Option);
- DisplaySystemSlotDataBusWidth (Struct->Type9->SlotDataBusWidth, Option);
- DisplaySystemSlotCurrentUsage (Struct->Type9->CurrentUsage, Option);
- DisplaySystemSlotLength (Struct->Type9->SlotLength, Option);
- DisplaySystemSlotId (
- Struct->Type9->SlotID,
- Struct->Type9->SlotType,
- Option
- );
- DisplaySlotCharacteristics1 (*(UINT8 *) &(Struct->Type9->SlotCharacteristics1), Option);
- DisplaySlotCharacteristics2 (*(UINT8 *) &(Struct->Type9->SlotCharacteristics2), Option);
- if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0xD)) {
- PRINT_STRUCT_VALUE_H (Struct, Type9, SegmentGroupNum);
- PRINT_STRUCT_VALUE_H (Struct, Type9, BusNum);
- PRINT_STRUCT_VALUE_H (Struct, Type9, DevFuncNum);
- }
- break;
-
- //
- // On Board Devices Information (Type 10)
- //
- case 10:
- {
- UINTN NumOfDevice;
- NumOfDevice = (Struct->Type10->Hdr.Length - sizeof (SMBIOS_STRUCTURE)) / (2 * sizeof (UINT8));
- for (Index = 0; Index < NumOfDevice; Index++) {
- DisplayOnboardDeviceTypes (Struct->Type10->Device[Index].DeviceType, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DESC_STRING), gShellDebug1HiiHandle);
- ShellPrintEx(-1,-1,L"%a\n",LibGetSmbiosString (Struct, Struct->Type10->Device[Index].DescriptionString));
- }
- }
- break;
-
- //
- // Oem Strings (Type 11)
- //
- case 11:
- PRINT_STRUCT_VALUE (Struct, Type11, StringCount);
- for (Index = 1; Index <= Struct->Type11->StringCount; Index++) {
- ShellPrintEx(-1,-1,L"%a\n", LibGetSmbiosString (Struct, Index));
- }
- break;
-
- //
- // System Configuration Options (Type 12)
- //
- case 12:
- PRINT_STRUCT_VALUE (Struct, Type12, StringCount);
- for (Index = 1; Index <= Struct->Type12->StringCount; Index++) {
- ShellPrintEx(-1,-1,L"%a\n", LibGetSmbiosString (Struct, Index));
- }
- break;
-
- //
- // BIOS Language Information (Type 13)
- //
- case 13:
- PRINT_STRUCT_VALUE (Struct, Type13, InstallableLanguages);
- PRINT_STRUCT_VALUE (Struct, Type13, Flags);
- PRINT_BIT_FIELD (Struct, Type13, Reserved, 15);
- PRINT_PENDING_STRING (Struct, Type13, CurrentLanguages);
- break;
-
- //
- // Group Associations (Type 14)
- //
- case 14:
- {
- UINT8 NumOfItem;
- NumOfItem = (Struct->Type14->Hdr.Length - 5) / 3;
- PRINT_PENDING_STRING (Struct, Type14, GroupName);
- for (Index = 0; Index < NumOfItem; Index++) {
- ShellPrintEx(-1,-1,L"ItemType %d: %d\n", Index + 1, Struct->Type14->Group[Index].ItemType);
- ShellPrintEx(-1,-1,L"ItemHandle %d: %d\n", Index + 1, Struct->Type14->Group[Index].ItemHandle);
- }
- }
- break;
-
- //
- // System Event Log (Type 15)
- //
- case 15:
- {
- EVENT_LOG_TYPE *Ptr;
- UINT8 Count;
- UINT8 *AccessMethodAddress;
-
- PRINT_STRUCT_VALUE_H (Struct, Type15, LogAreaLength);
- PRINT_STRUCT_VALUE_H (Struct, Type15, LogHeaderStartOffset);
- PRINT_STRUCT_VALUE_H (Struct, Type15, LogDataStartOffset);
- DisplaySELAccessMethod (Struct->Type15->AccessMethod, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type15, AccessMethodAddress);
- DisplaySELLogStatus (Struct->Type15->LogStatus, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type15, LogChangeToken);
- DisplaySysEventLogHeaderFormat (Struct->Type15->LogHeaderFormat, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type15, NumberOfSupportedLogTypeDescriptors);
- PRINT_STRUCT_VALUE_H (Struct, Type15, LengthOfLogTypeDescriptor);
-
- Count = Struct->Type15->NumberOfSupportedLogTypeDescriptors;
- if (Count > 0) {
- Ptr = Struct->Type15->EventLogTypeDescriptors;
-
- //
- // Display all Event Log type descriptors supported by system
- //
- for (Index = 0; Index < Count; Index++, Ptr++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SUPOPRTED_EVENT), gShellDebug1HiiHandle, Index + 1);
- DisplaySELTypes (Ptr->LogType, Option);
- DisplaySELVarDataFormatType (Ptr->DataFormatType, Option);
- }
-
- if (Option >= SHOW_DETAIL) {
- switch (Struct->Type15->AccessMethod) {
- case 03:
- AccessMethodAddress = (UINT8 *) (UINTN) (Struct->Type15->AccessMethodAddress);
- break;
-
- case 00:
- case 01:
- case 02:
- case 04:
- default:
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ACCESS_METHOD_NOT_SUPOPRTED),
- gShellDebug1HiiHandle,
- Struct->Type15->AccessMethod
- );
- return EFI_UNSUPPORTED;
- }
- //
- // Display Event Log Header
- //
- // Starting offset (or index) within the nonvolatile storage
- // of the event-log's header, from the Access Method Address
- //
- DisplaySysEventLogHeader (
- Struct->Type15->LogHeaderFormat,
- AccessMethodAddress + Struct->Type15->LogHeaderStartOffset
- );
-
- //
- // Display all Event Log data
- //
- // Starting offset (or index) within the nonvolatile storage
- // of the event-log's first data byte, from the Access Method Address(0x14)
- //
- DisplaySysEventLogData (
- AccessMethodAddress + Struct->Type15->LogDataStartOffset,
- (UINT16)
- (
- Struct->Type15->LogAreaLength -
- (Struct->Type15->LogDataStartOffset - Struct->Type15->LogHeaderStartOffset)
- )
- );
- }
-
- }
- }
- break;
-
- //
- // Physical Memory Array (Type 16)
- //
- case 16:
- DisplayPMALocation (Struct->Type16->Location, Option);
- DisplayPMAUse (Struct->Type16->Use, Option);
- DisplayPMAErrorCorrectionTypes (
- Struct->Type16->MemoryErrorCorrection,
- Option
- );
- PRINT_STRUCT_VALUE_H (Struct, Type16, MaximumCapacity);
- PRINT_STRUCT_VALUE_H (Struct, Type16, MemoryErrorInformationHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type16, NumberOfMemoryDevices);
- if (AE_SMBIOS_VERSION (0x2, 0x7) && Struct->Hdr->Length > 0xF) {
- PRINT_STRUCT_VALUE_LH (Struct, Type16, ExtendedMaximumCapacity);
- }
- break;
-
- //
- // Memory Device (Type 17)
- //
- case 17:
- PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryArrayHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryErrorInformationHandle);
- PRINT_STRUCT_VALUE (Struct, Type17, TotalWidth);
- PRINT_STRUCT_VALUE (Struct, Type17, DataWidth);
- PRINT_STRUCT_VALUE (Struct, Type17, Size);
- DisplayMemoryDeviceFormFactor (Struct->Type17->FormFactor, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type17, DeviceSet);
- PRINT_PENDING_STRING (Struct, Type17, DeviceLocator);
- PRINT_PENDING_STRING (Struct, Type17, BankLocator);
- DisplayMemoryDeviceType (Struct->Type17->MemoryType, Option);
- DisplayMemoryDeviceTypeDetail (ReadUnaligned16 ((UINT16 *) (UINTN) &(Struct->Type17->TypeDetail)), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type17, Speed);
- PRINT_PENDING_STRING (Struct, Type17, Manufacturer);
- PRINT_PENDING_STRING (Struct, Type17, SerialNumber);
- PRINT_PENDING_STRING (Struct, Type17, AssetTag);
- PRINT_PENDING_STRING (Struct, Type17, PartNumber);
- if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0x1B)) {
- PRINT_STRUCT_VALUE_H (Struct, Type17, Attributes);
- }
- if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x1C)) {
- PRINT_STRUCT_VALUE (Struct, Type17, ExtendedSize);
- PRINT_STRUCT_VALUE (Struct, Type17, ConfiguredMemoryClockSpeed);
- }
- break;
-
- //
- // 32-bit Memory Error Information (Type 18)
- //
- case 18:
- DisplayMemoryErrorType (Struct->Type18->ErrorType, Option);
- DisplayMemoryErrorGranularity (
- Struct->Type18->ErrorGranularity,
- Option
- );
- DisplayMemoryErrorOperation (Struct->Type18->ErrorOperation, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type18, VendorSyndrome);
- PRINT_STRUCT_VALUE_H (Struct, Type18, MemoryArrayErrorAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type18, DeviceErrorAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type18, ErrorResolution);
- break;
-
- //
- // Memory Array Mapped Address (Type 19)
- //
- case 19:
- PRINT_STRUCT_VALUE_H (Struct, Type19, StartingAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type19, EndingAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type19, MemoryArrayHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type19, PartitionWidth);
- if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0xF)) {
- PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedStartingAddress);
- PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedEndingAddress);
- }
- break;
-
- //
- // Memory Device Mapped Address (Type 20)
- //
- case 20:
- PRINT_STRUCT_VALUE_H (Struct, Type20, StartingAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type20, EndingAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type20, MemoryDeviceHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type20, MemoryArrayMappedAddressHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type20, PartitionRowPosition);
- PRINT_STRUCT_VALUE_H (Struct, Type20, InterleavePosition);
- PRINT_STRUCT_VALUE_H (Struct, Type20, InterleavedDataDepth);
- if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) {
- PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedStartingAddress);
- PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedEndingAddress);
- }
- break;
-
- //
- // Built-in Pointing Device (Type 21)
- //
- case 21:
- DisplayPointingDeviceType (Struct->Type21->Type, Option);
- DisplayPointingDeviceInterface (Struct->Type21->Interface, Option);
- PRINT_STRUCT_VALUE (Struct, Type21, NumberOfButtons);
- break;
-
- //
- // Portable Battery (Type 22)
- //
- case 22:
- PRINT_PENDING_STRING (Struct, Type22, Location);
- PRINT_PENDING_STRING (Struct, Type22, Manufacturer);
- PRINT_PENDING_STRING (Struct, Type22, ManufactureDate);
- PRINT_PENDING_STRING (Struct, Type22, SerialNumber);
- PRINT_PENDING_STRING (Struct, Type22, DeviceName);
- DisplayPBDeviceChemistry (
- Struct->Type22->DeviceChemistry,
- Option
- );
- PRINT_STRUCT_VALUE_H (Struct, Type22, DeviceCapacity);
- PRINT_STRUCT_VALUE_H (Struct, Type22, DesignVoltage);
- PRINT_PENDING_STRING (Struct, Type22, SBDSVersionNumber);
- PRINT_STRUCT_VALUE_H (Struct, Type22, MaximumErrorInBatteryData);
- PRINT_STRUCT_VALUE_H (Struct, Type22, SBDSSerialNumber);
- DisplaySBDSManufactureDate (
- Struct->Type22->SBDSManufactureDate,
- Option
- );
- PRINT_PENDING_STRING (Struct, Type22, SBDSDeviceChemistry);
- PRINT_STRUCT_VALUE_H (Struct, Type22, DesignCapacityMultiplier);
- PRINT_STRUCT_VALUE_H (Struct, Type22, OEMSpecific);
- break;
-
- //
- // System Reset (Type 23)
- //
- case 23:
- DisplaySystemResetCapabilities (
- Struct->Type23->Capabilities,
- Option
- );
- PRINT_STRUCT_VALUE_H (Struct, Type23, ResetCount);
- PRINT_STRUCT_VALUE_H (Struct, Type23, ResetLimit);
- PRINT_STRUCT_VALUE_H (Struct, Type23, TimerInterval);
- PRINT_STRUCT_VALUE_H (Struct, Type23, Timeout);
- break;
-
- //
- // Hardware Security (Type 24)
- //
- case 24:
- DisplayHardwareSecuritySettings (
- Struct->Type24->HardwareSecuritySettings,
- Option
- );
- break;
-
- //
- // System Power Controls (Type 25)
- //
- case 25:
- PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnMonth);
- PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnDayOfMonth);
- PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnHour);
- PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnMinute);
- PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnSecond);
- break;
-
- //
- // Voltage Probe (Type 26)
- //
- case 26:
- PRINT_PENDING_STRING (Struct, Type26, Description);
- DisplayVPLocation (*(UINT8 *) &(Struct->Type26->LocationAndStatus), Option);
- DisplayVPStatus (*(UINT8 *) &(Struct->Type26->LocationAndStatus), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type26, MaximumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type26, MinimumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type26, Resolution);
- PRINT_STRUCT_VALUE_H (Struct, Type26, Tolerance);
- PRINT_STRUCT_VALUE_H (Struct, Type26, Accuracy);
- PRINT_STRUCT_VALUE_H (Struct, Type26, OEMDefined);
- PRINT_STRUCT_VALUE_H (Struct, Type26, NominalValue);
- break;
-
- //
- // Cooling Device (Type 27)
- //
- case 27:
- PRINT_STRUCT_VALUE_H (Struct, Type27, TemperatureProbeHandle);
- DisplayCoolingDeviceStatus (*(UINT8 *) &(Struct->Type27->DeviceTypeAndStatus), Option);
- DisplayCoolingDeviceType (*(UINT8 *) &(Struct->Type27->DeviceTypeAndStatus), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type27, CoolingUnitGroup);
- PRINT_STRUCT_VALUE_H (Struct, Type27, OEMDefined);
- PRINT_STRUCT_VALUE_H (Struct, Type27, NominalSpeed);
- if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0xE)) {
- PRINT_PENDING_STRING (Struct, Type27, Description);
- }
- break;
-
- //
- // Temperature Probe (Type 28)
- //
- case 28:
- PRINT_PENDING_STRING (Struct, Type28, Description);
- DisplayTemperatureProbeStatus (*(UINT8 *) &(Struct->Type28->LocationAndStatus), Option);
- DisplayTemperatureProbeLoc (*(UINT8 *) &(Struct->Type28->LocationAndStatus), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type28, MaximumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type28, MinimumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type28, Resolution);
- PRINT_STRUCT_VALUE_H (Struct, Type28, Tolerance);
- PRINT_STRUCT_VALUE_H (Struct, Type28, Accuracy);
- PRINT_STRUCT_VALUE_H (Struct, Type28, OEMDefined);
- PRINT_STRUCT_VALUE_H (Struct, Type28, NominalValue);
- break;
-
- //
- // Electrical Current Probe (Type 29)
- //
- case 29:
- PRINT_PENDING_STRING (Struct, Type29, Description);
- DisplayECPStatus (*(UINT8 *) &(Struct->Type29->LocationAndStatus), Option);
- DisplayECPLoc (*(UINT8 *) &(Struct->Type29->LocationAndStatus), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type29, MaximumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type29, MinimumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type29, Resolution);
- PRINT_STRUCT_VALUE_H (Struct, Type29, Tolerance);
- PRINT_STRUCT_VALUE_H (Struct, Type29, Accuracy);
- PRINT_STRUCT_VALUE_H (Struct, Type29, OEMDefined);
- PRINT_STRUCT_VALUE_H (Struct, Type29, NominalValue);
- break;
-
- //
- // Out-of-Band Remote Access (Type 30)
- //
- case 30:
- PRINT_PENDING_STRING (Struct, Type30, ManufacturerName);
- DisplayOBRAConnections (Struct->Type30->Connections, Option);
- break;
-
- //
- // Boot Integrity Services (BIS) Entry Point (Type 31)
- //
- case 31:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_TYPE31), gShellDebug1HiiHandle);
- break;
-
- //
- // System Boot Information (Type 32)
- //
- case 32:
- PRINT_BIT_FIELD (Struct, Type32, Reserved, 6);
- DisplaySystemBootStatus (Struct->Type32->BootStatus, Option);
- break;
-
- //
- // 64-Bit Memory Error Information (Type 33)
- //
- case 33:
- DisplayMemoryErrorType (Struct->Type33->ErrorType, Option);
- DisplayMemoryErrorGranularity (
- Struct->Type33->ErrorGranularity,
- Option
- );
- DisplayMemoryErrorOperation (Struct->Type33->ErrorOperation, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type33, VendorSyndrome);
- PRINT_STRUCT_VALUE_LH (Struct, Type33, MemoryArrayErrorAddress);
- PRINT_STRUCT_VALUE_LH (Struct, Type33, DeviceErrorAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type33, ErrorResolution);
- break;
-
- //
- // Management Device (Type 34)
- //
- case 34:
- PRINT_PENDING_STRING (Struct, Type34, Description);
- DisplayMDType (Struct->Type34->Type, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type34, Address);
- DisplayMDAddressType (Struct->Type34->AddressType, Option);
- break;
-
- //
- // Management Device Component (Type 35)
- //
- case 35:
- PRINT_PENDING_STRING (Struct, Type35, Description);
- PRINT_STRUCT_VALUE_H (Struct, Type35, ManagementDeviceHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type35, ComponentHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type35, ThresholdHandle);
- break;
-
- //
- // Management Device Threshold Data (Type 36)
- //
- case 36:
- PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdNonCritical);
- PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdNonCritical);
- PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdCritical);
- PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdCritical);
- PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdNonRecoverable);
- PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdNonRecoverable);
- break;
-
- //
- // Memory Channel (Type 37)
- //
- case 37:
- {
- UINT8 Count;
- MEMORY_DEVICE *Ptr;
- DisplayMemoryChannelType (Struct->Type37->ChannelType, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type37, MaximumChannelLoad);
- PRINT_STRUCT_VALUE_H (Struct, Type37, MemoryDeviceCount);
-
- Count = Struct->Type37->MemoryDeviceCount;
- Ptr = Struct->Type37->MemoryDevice;
- for (Index = 0; Index < Count; Index++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_DEVICE), gShellDebug1HiiHandle, Index + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_LOAD), gShellDebug1HiiHandle, Ptr[Index].DeviceLoad);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_HANDLE), gShellDebug1HiiHandle, Ptr[Index].DeviceHandle);
- }
- }
- break;
-
- //
- // IPMI Device Information (Type 38)
- //
- case 38:
- DisplayIPMIDIBMCInterfaceType (Struct->Type38->InterfaceType, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type38, IPMISpecificationRevision);
- PRINT_STRUCT_VALUE_H (Struct, Type38, I2CSlaveAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type38, NVStorageDeviceAddress);
- PRINT_STRUCT_VALUE_LH (Struct, Type38, BaseAddress);
- break;
-
- //
- // System Power Supply (Type 39)
- //
- case 39:
- PRINT_STRUCT_VALUE_H (Struct, Type39, PowerUnitGroup);
- PRINT_PENDING_STRING (Struct, Type39, Location);
- PRINT_PENDING_STRING (Struct, Type39, DeviceName);
- PRINT_PENDING_STRING (Struct, Type39, Manufacturer);
- PRINT_PENDING_STRING (Struct, Type39, SerialNumber);
- PRINT_PENDING_STRING (Struct, Type39, AssetTagNumber);
- PRINT_PENDING_STRING (Struct, Type39, ModelPartNumber);
- PRINT_PENDING_STRING (Struct, Type39, RevisionLevel);
- PRINT_STRUCT_VALUE_H (Struct, Type39, MaxPowerCapacity);
- DisplaySPSCharacteristics (
- *(UINT16 *) &(Struct->Type39->PowerSupplyCharacteristics),
- Option
- );
- PRINT_STRUCT_VALUE_H (Struct, Type39, InputVoltageProbeHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type39, CoolingDeviceHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type39, InputCurrentProbeHandle);
- break;
-
- //
- // Additional Information (Type 40)
- //
- case 40:
- {
- UINT8 NumberOfEntries;
- UINT8 EntryLength;
- ADDITIONAL_INFORMATION_ENTRY *Entries;
-
- EntryLength = 0;
- Entries = Struct->Type40->AdditionalInfoEntries;
- NumberOfEntries = Struct->Type40->NumberOfAdditionalInformationEntries;
-
- PRINT_STRUCT_VALUE_H (Struct, Type40, NumberOfAdditionalInformationEntries);
-
- for (Index = 0; Index < NumberOfEntries; Index++) {
- EntryLength = Entries->EntryLength;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ENTRYLEN), gShellDebug1HiiHandle, EntryLength);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_REFERENCEDHANDLE), gShellDebug1HiiHandle, Entries->ReferencedHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_REFERENCEDOFFSET), gShellDebug1HiiHandle, Entries->ReferencedOffset);
- PRINT_SMBIOS_STRING (Struct, Entries->EntryString, String);
- PRINT_SMBIOS_BIT_FIELD (Struct, Entries->Value, Value, EntryLength - 5);
- Entries = (ADDITIONAL_INFORMATION_ENTRY *) ((UINT8 *)Entries + EntryLength);
- }
- }
- break;
-
- //
- // Onboard Devices Extended Information (Type 41)
- //
- case 41:
- PRINT_PENDING_STRING (Struct, Type41, ReferenceDesignation);
- ShellPrintEx(-1,-1,(((Struct->Type41->DeviceType) & 0x80) != 0) ? L"Device Enabled\n": L"Device Disabled\n");
- DisplayOnboardDeviceTypes ((Struct->Type41->DeviceType) & 0x7F, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type41, DeviceTypeInstance);
- PRINT_STRUCT_VALUE_H (Struct, Type41, SegmentGroupNum);
- PRINT_STRUCT_VALUE_H (Struct, Type41, BusNum);
- PRINT_STRUCT_VALUE_H (Struct, Type41, DevFuncNum);
- break;
-
- //
- // Management Controller Host Interface (Type 42)
- //
- case 42:
- PRINT_STRUCT_VALUE_H (Struct, Type42, InterfaceType);
- break;
-
- //
- // Inactive (Type 126)
- //
- case 126:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INACTIVE_STRUCT), gShellDebug1HiiHandle);
- break;
-
- //
- // End-of-Table (Type 127)
- //
- case 127:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_THIS_STRUCT_END_TABLE), gShellDebug1HiiHandle);
- break;
-
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_TYPE_UNDEFINED), gShellDebug1HiiHandle);
- break;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Display BIOS Information (Type 0) information.
-
- @param[in] Chara The information bits.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayBiosCharacteristics (
- IN UINT64 Chara,
- IN UINT8 Option
- )
-{
- //
- // Print header
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR), gShellDebug1HiiHandle);
- //
- // print option
- //
- PRINT_INFO_OPTION (Chara, Option);
-
- //
- // Check all the bits and print information
- // This function does not use Table because table of bits
- // are designed not to deal with UINT64
- //
- if (BIT (Chara, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN_BIT), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_NOT_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ISA_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MSA_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 6) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EISA_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PCI_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 8) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PC_CARD_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 9) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PLUG_PLAY_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 10) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_APM_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 11) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_UPGRADEABLE), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 12) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SHADOWING), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 13) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VESA_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 14) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ECSD_SUPPORT), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 15) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_FORM_CD_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 16) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SELECTED_BOOT_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 17) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_ROM_SOCKETED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 18) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_FROM_PC_CARD), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 19) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EDD_ENHANCED_DRIVER), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 20) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_JAPANESE_FLOPPY_NEC), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 21) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_JAPANESE_FLOPPY_TOSHIBA), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 22) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FLOPPY_SERVICES_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 23) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_POINT_TWO_MB), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 24) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_720_KB), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 25) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TWO_POINT_EIGHT_EIGHT_MB), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 26) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRINT_SCREEN_SUPPORT), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 27) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_KEYBOARD_SERV_SUPPORT), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 28) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SERIAL_SERVICES_SUPPORT), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 29) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRINTER_SERVICES_SUPPORT), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 30) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MONO_VIDEO_SUPPORT), gShellDebug1HiiHandle);
- }
-
- if (BIT (Chara, 31) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NEC_PC_98), gShellDebug1HiiHandle);
- }
- //
- // Just print the Reserved
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_32_47), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_48_64), gShellDebug1HiiHandle);
-}
-
-/**
- Display Bios Characteristice extensions1 information.
-
- @param[in] Byte1 The information.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayBiosCharacteristicsExt1 (
- IN UINT8 Byte1,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_EXTENSION), gShellDebug1HiiHandle);
- //
- // Print option
- //
- PRINT_INFO_OPTION (Byte1, Option);
-
- //
- // check bit and print
- //
- if (BIT (Byte1, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ACPI_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Byte1, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_USB_LEGACY_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Byte1, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AGP_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Byte1, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_I2O_BOOT_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Byte1, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LS_120_BOOT_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Byte1, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ATAPI_ZIP_DRIVE), gShellDebug1HiiHandle);
- }
-
- if (BIT (Byte1, 6) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_1394_BOOT_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Byte1, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SMART_BATTERY_SUPPORTED), gShellDebug1HiiHandle);
- }
-}
-
-/**
- Display Bios Characteristice extensions2 information.
-
- @param[in] byte2 The information.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayBiosCharacteristicsExt2 (
- IN UINT8 byte2,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_EXTENSION_2), gShellDebug1HiiHandle);
- //
- // Print option
- //
- PRINT_INFO_OPTION (byte2, Option);
-
- if (BIT (byte2, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_BOOT_SPEC_SUPP), gShellDebug1HiiHandle);
- }
-
- if (BIT (byte2, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FUNCTION_KEY_INIT), gShellDebug1HiiHandle);
- }
-
- if (AE_SMBIOS_VERSION (0x2, 0x4)) {
- if (BIT (byte2, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLE_TAR_CONT_DIST), gShellDebug1HiiHandle);
- }
- if (AE_SMBIOS_VERSION (0x2, 0x7)) {
- if (BIT (byte2, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UEFI_SPEC_SUPPORT), gShellDebug1HiiHandle);
- }
- if (BIT (byte2, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VIRTUAL_MACHINE), gShellDebug1HiiHandle);
- }
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 5);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 3);
- }
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 2);
- }
-}
-
-/**
- Display Processor Information (Type 4) information.
-
- @param[in] Family The family value.
- @param[in] Option The option value.
-**/
-VOID
-DisplayProcessorFamily (
- UINT8 Family,
- UINT8 Option
- )
-{
- //
- // Print prompt message
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROCESSOR_FAMILY), gShellDebug1HiiHandle);
- //
- // Print option
- //
- PRINT_INFO_OPTION (Family, Option);
-
- //
- // Use switch to check
- //
- switch (Family) {
- case 0x01:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER), gShellDebug1HiiHandle);
- break;
-
- case 0x02:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
-
- case 0x03:
- Print (L"8086\n");
- break;
-
- case 0x04:
- Print (L"80286\n");
- break;
-
- case 0x05:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL386_PROCESSOR), gShellDebug1HiiHandle);
- break;
-
- case 0x06:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL486_PROCESSOR), gShellDebug1HiiHandle);
- break;
-
- case 0x07:
- Print (L"8087\n");
- break;
-
- case 0x08:
- Print (L"80287\n");
- break;
-
- case 0x09:
- Print (L"80387\n");
- break;
-
- case 0x0A:
- Print (L"80487\n");
- break;
-
- case 0x0B:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_PROC_FAMILY), gShellDebug1HiiHandle);
- break;
-
- case 0x0C:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_PRO_PROC), gShellDebug1HiiHandle);
- break;
-
- case 0x0D:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_II_PROC), gShellDebug1HiiHandle);
- break;
-
- case 0x0E:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_PROC_MMX), gShellDebug1HiiHandle);
- break;
-
- case 0x0F:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CELERON_PROC), gShellDebug1HiiHandle);
- break;
-
- case 0x10:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_XEON_PROC), gShellDebug1HiiHandle);
- break;
-
- case 0x11:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_III_PROC), gShellDebug1HiiHandle);
- break;
-
- case 0x12:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_M1_FAMILY), gShellDebug1HiiHandle);
- break;
-
- case 0x13:
- Print (L"M2 Family\n");
- break;
-
- case 0x14:
- Print (L"Intel Celeron M\n");
- break;
-
- case 0x15:
- Print (L"Intel Pentium 4 HT\n");
- break;
-
- case 0x18:
- Print (L"AMD Duron\n");
- break;
-
- case 0x19:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_K5_FAMILY), gShellDebug1HiiHandle);
- break;
-
- case 0x1A:
- Print (L"K6 Family\n");
- break;
-
- case 0x1B:
- Print (L"K6-2\n");
- break;
-
- case 0x1C:
- Print (L"K6-3\n");
- break;
-
- case 0x1D:
- Print (L"AMD Althon Processor Family\n");
- break;
-
- case 0x1E:
- Print (L"AMD 29000 Family\n");
- break;
-
- case 0x1F:
- Print (L"K6-2+\n");
- break;
-
- case 0x20:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_FAMILY), gShellDebug1HiiHandle);
- break;
-
- case 0x21:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_601), gShellDebug1HiiHandle);
- break;
-
- case 0x22:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_603), gShellDebug1HiiHandle);
- break;
-
- case 0x23:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_603_PLUS), gShellDebug1HiiHandle);
- break;
-
- case 0x24:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_604), gShellDebug1HiiHandle);
- break;
-
- case 0x25:
- Print (L"Power PC 620\n");
- break;
-
- case 0x26:
- Print (L"Power PC 704\n");
- break;
-
- case 0x27:
- Print (L"Power PC 750\n");
- break;
-
- case 0x28:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_DUO), gShellDebug1HiiHandle);
- break;
-
- case 0x29:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_DUO_MOBILE), gShellDebug1HiiHandle);
- break;
-
- case 0x2A:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_SOLO_MOBILE), gShellDebug1HiiHandle);
- break;
-
- case 0x2B:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_ATOM), gShellDebug1HiiHandle);
- break;
-
- case 0x30:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ALPHA_FAMILY_2), gShellDebug1HiiHandle);
- break;
-
- case 0x31:
- Print (L"Alpha 21064\n");
- break;
-
- case 0x32:
- Print (L"Alpha 21066\n");
- break;
-
- case 0x33:
- Print (L"Alpha 21164\n");
- break;
-
- case 0x34:
- Print (L"Alpha 21164PC\n");
- break;
-
- case 0x35:
- Print (L"Alpha 21164a\n");
- break;
-
- case 0x36:
- Print (L"Alpha 21264\n");
- break;
-
- case 0x37:
- Print (L"Alpha 21364\n");
- break;
-
- case 0x38:
- Print (L"AMD Turion II Ultra Dual-Core Mobile M Processor Family\n");
- break;
-
- case 0x39:
- Print (L"AMD Turion II Dual-Core Mobile M Processor Family\n");
- break;
-
- case 0x3A:
- Print (L"AMD Althon II Dual-Core M Processor Family\n");
- break;
-
- case 0x3B:
- Print (L"AMD Opteron 6100 Series Processor\n");
- break;
-
- case 0x3C:
- Print (L"AMD Opteron 4100 Series Processor\n");
- break;
-
- case 0x3D:
- Print (L"AMD Opteron 6200 Series Processor\n");
- break;
-
- case 0x3E:
- Print (L"AMD Opteron 4200 Series Processor\n");
- break;
-
- case 0x40:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MIPS_FAMILY), gShellDebug1HiiHandle);
- break;
-
- case 0x41:
- Print (L"MIPS R4000\n");
- break;
-
- case 0x42:
- Print (L"MIPS R4200\n");
- break;
-
- case 0x43:
- Print (L"MIPS R4400\n");
- break;
-
- case 0x44:
- Print (L"MIPS R4600\n");
- break;
-
- case 0x45:
- Print (L"MIPS R10000\n");
- break;
-
- case 0x46:
- Print (L"AMD C-Series Processor\n");
- break;
-
- case 0x47:
- Print (L"AMD E-Series Processor\n");
- break;
-
- case 0x48:
- Print (L"AMD S-Series Processor\n");
- break;
-
- case 0x49:
- Print (L"AMD G-Series Processor\n");
- break;
-
- case 0x50:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SPARC_FAMILY), gShellDebug1HiiHandle);
- break;
-
- case 0x51:
- Print (L"SuperSparc\n");
- break;
-
- case 0x52:
- Print (L"microSparc II\n");
- break;
-
- case 0x53:
- Print (L"microSparc IIep\n");
- break;
-
- case 0x54:
- Print (L"UltraSparc\n");
- break;
-
- case 0x55:
- Print (L"UltraSparc II\n");
- break;
-
- case 0x56:
- Print (L"UltraSparcIIi\n");
- break;
-
- case 0x57:
- Print (L"UltraSparcIII\n");
- break;
-
- case 0x58:
- Print (L"UltraSparcIIIi\n");
- break;
-
- case 0x60:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_68040_FAMILY), gShellDebug1HiiHandle);
- break;
-
- case 0x61:
- Print (L"68xx\n");
- break;
-
- case 0x62:
- Print (L"68000\n");
- break;
-
- case 0x63:
- Print (L"68010\n");
- break;
-
- case 0x64:
- Print (L"68020\n");
- break;
-
- case 0x65:
- Print (L"68030\n");
- break;
-
- case 0x70:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HOBBIT_FAMILY), gShellDebug1HiiHandle);
- break;
-
- case 0x78:
- Print (L"Crusoe TM5000\n");
- break;
-
- case 0x79:
- Print (L"Crusoe TM3000\n");
- break;
-
- case 0x7A:
- Print (L"Efficeon TM8000\n");
- break;
-
- case 0x80:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WEITEK), gShellDebug1HiiHandle);
- break;
-
- case 0x82:
- Print (L"Itanium\n");
- break;
-
- case 0x83:
- Print (L"AMD Athlon64\n");
- break;
-
- case 0x84:
- Print (L"AMD Opteron\n");
- break;
-
- case 0x85:
- Print (L"AMD Sempron\n");
- break;
-
- case 0x86:
- Print (L"AMD Turion64 Mobile\n");
- break;
-
- case 0x87:
- Print (L"Dual-Core AMD Opteron\n");
- break;
-
- case 0x88:
- Print (L"AMD Athlon 64X2 DualCore\n");
- break;
-
- case 0x89:
- Print (L"AMD Turion 64X2 Mobile\n");
- break;
-
- case 0x8A:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0x8B:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_THIRD_GENERATION), gShellDebug1HiiHandle);
- break;
-
- case 0x8C:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_FX_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0x8D:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_X4_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0x8E:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_X2_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0x8F:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_ATHLON_X2_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0x90:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PA_RISC_FAMILY), gShellDebug1HiiHandle);
- break;
-
- case 0x91:
- Print (L"PA-RISC 8500\n");
- break;
-
- case 0x92:
- Print (L"PA-RISC 8000\n");
- break;
-
- case 0x93:
- Print (L"PA-RISC 7300LC\n");
- break;
-
- case 0x94:
- Print (L"PA-RISC 7200\n");
- break;
-
- case 0x95:
- Print (L"PA-RISC 7100LC\n");
- break;
-
- case 0x96:
- Print (L"PA-RISC 7100\n");
- break;
-
- case 0xA0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_V30_FAMILY), gShellDebug1HiiHandle);
- break;
-
- case 0xA1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3200_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xA2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3000_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xA3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5300_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xA4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5100_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xA5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5000_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xA6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_LV_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xA7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_ULV_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xA8:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7100_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xA9:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5400_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xAA:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xAB:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5200_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xAC:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7200_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xAD:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7300_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xAE:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7400_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xAF:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7400_SERIES_MULTI_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xB0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_III_XEON), gShellDebug1HiiHandle);
- break;
-
- case 0xB1:
- Print (L"Pentium III Processorwith Intel SpeedStep Technology\n");
- break;
-
- case 0xB2:
- Print (L"Pentium 4 processor\n");
- break;
-
- case 0xB3:
- Print (L"Intel Xeon Processor\n");
- break;
-
- case 0xB4:
- Print (L"AS400 Family\n");
- break;
-
- case 0xB5:
- Print (L"Intel Xeon processor MP\n");
- break;
-
- case 0xB6:
- Print (L"AMD Althon XP Processor Family\n");
- break;
-
- case 0xB7:
- Print (L"AMD Althon MP Promcessor Family\n");
- break;
-
- case 0xB8:
- Print (L"Intel Itanium 2 processor\n");
- break;
-
- case 0xB9:
- Print (L"Intel Penium M processor\n");
- break;
-
- case 0xBA:
- Print (L"Intel Celeron D processor\n");
- break;
-
- case 0xBB:
- Print (L"Intel Pentium D processor\n");
- break;
-
- case 0xBC:
- Print (L"Intel Pentium Processor Extreme Edition\n");
- break;
-
- case 0xBD:
- Print (L"Intel Core Solo Processor\n");
- break;
-
- case 0xBF:
- Print (L"Intel Core 2 Duo Processor\n");
- break;
-
- case 0xC0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_SOLO), gShellDebug1HiiHandle);
- break;
-
- case 0xC1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_EXTREME), gShellDebug1HiiHandle);
- break;
-
- case 0xC2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_QUAD), gShellDebug1HiiHandle);
- break;
-
- case 0xC3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_EXTREME), gShellDebug1HiiHandle);
- break;
-
- case 0xC4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_DUO_MOBILE), gShellDebug1HiiHandle);
- break;
-
- case 0xC5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_SOLO_MOBILE), gShellDebug1HiiHandle);
- break;
-
- case 0xC6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_I7), gShellDebug1HiiHandle);
- break;
-
- case 0xC7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CELERON_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xC8:
- Print (L"IBM 390\n");
- break;
-
- case 0xC9:
- Print (L"G4\n");
- break;
-
- case 0xCA:
- Print (L"G5\n");
- break;
-
- case 0xCB:
- Print (L"G6\n");
- break;
-
- case 0xCC:
- Print (L"zArchitectur\n");
- break;
-
- case 0xCD:
- Print (L"Intel Core i5 processor\n");
- break;
-
- case 0xCE:
- Print (L"Intel Core i3 processor\n");
- break;
-
- case 0xD2:
- Print (L"ViaC7M\n");
- break;
-
- case 0xD3:
- Print (L"ViaC7D\n");
- break;
-
- case 0xD4:
- Print (L"ViaC7\n");
- break;
-
- case 0xD5:
- Print (L"Eden\n");
- break;
-
- case 0xD6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_MULTI_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xD7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xD8:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xDA:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xDB:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xDD:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xDE:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xDF:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7_SERIES_MULTI_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xE0:
- Print (L"Multi-Core Intel Xeon processor 3400 Series\n");
- break;
-
- case 0xE6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_EMBEDDED_OPTERON_QUAD_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xE7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_TRIPLE_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xE8:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_TURION_ULTRA_DUAL_CORE_MOBILE), gShellDebug1HiiHandle);
- break;
-
- case 0xE9:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_TURION_DUAL_CORE_MOBILE), gShellDebug1HiiHandle);
- break;
-
- case 0xEA:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_ATHLON_DUAL_CORE), gShellDebug1HiiHandle);
- break;
-
- case 0xEB:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_SEMPRON_SI), gShellDebug1HiiHandle);
- break;
-
- case 0xEC:
- Print (L"AMD Phenom II Processor Family\n");
- break;
-
- case 0xED:
- Print (L"AMD Althon II Processor Family\n");
- break;
-
- case 0xEE:
- Print (L"Six-Core AMD Opteron Processor Family\n");
- break;
-
- case 0xEF:
- Print (L"AMD Sempron M Processor Family\n");
- break;
-
- case 0xFA:
- Print (L"i860\n");
- break;
-
- case 0xFB:
- Print (L"i960\n");
- break;
-
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY), gShellDebug1HiiHandle);
- }
- //
- // end switch
- //
-}
-
-/**
- Display processor family information.
-
- @param[in] Family2 The family value.
- @param[in] Option The option value.
-**/
-VOID
-DisplayProcessorFamily2 (
- IN UINT16 Family2,
- IN UINT8 Option
- )
-{
- //
- // Print prompt message
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROCESSOR_FAMILY), gShellDebug1HiiHandle);
-
- //
- // Print option
- //
- PRINT_INFO_OPTION (Family2, Option);
-
- //
- // Use switch to check
- //
- switch (Family2) {
- case 0x104:
- Print (L"SH-3\n");
- break;
-
- case 0x105:
- Print (L"SH-4\n");
- break;
-
- case 0x118:
- Print (L"ARM\n");
- break;
-
- case 0x119:
- Print (L"StrongARM\n");
- break;
-
- case 0x12C:
- Print (L"6x86\n");
- break;
-
- case 0x12D:
- Print (L"MediaGX\n");
- break;
-
- case 0x12E:
- Print (L"MII\n");
- break;
-
- case 0x140:
- Print (L"WinChip\n");
- break;
-
- case 0x15E:
- Print (L"DSP\n");
- break;
-
- case 0x1F4:
- Print (L"Video Processor\n");
- break;
-
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY), gShellDebug1HiiHandle);
- }
-
-}
-
-/**
- Display processor voltage information.
-
- @param[in] Voltage The Voltage.
- Bit 7 Set to 0, indicating 'legacy' mode for processor voltage
- Bits 6:4 Reserved, must be zero
- Bits 3:0 Voltage Capability.
- A Set bit indicates that the voltage is supported.
- Bit 0 - 5V
- Bit 1 - 3.3V
- Bit 2 - 2.9V
- Bit 3 - Reserved, must be zero.
-
- Note:
- Setting of multiple bits indicates the socket is configurable
- If bit 7 is set to 1, the remaining seven bits of the field are set to
- contain the processor's current voltage times 10.
- For example, the field value for a processor voltage of 1.8 volts would be
- 92h = 80h + (1.8 * 10) = 80h + 18 = 80h +12h.
-
- @param[in] Option The option.
-**/
-VOID
-DisplayProcessorVoltage (
- IN UINT8 Voltage,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_INFO), gShellDebug1HiiHandle);
- //
- // Print option
- //
- PRINT_INFO_OPTION (Voltage, Option);
-
- if (BIT (Voltage, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_CURRENT_VOLTAGE), gShellDebug1HiiHandle, (Voltage - 0x80));
- } else {
- if (BIT (Voltage, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_5V_SUPOPRTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Voltage, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_33V_SUPPORTED), gShellDebug1HiiHandle);
- }
-
- if (BIT (Voltage, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_29V_SUPPORTED), gShellDebug1HiiHandle);
- }
- //
- // check the reserved zero bits:
- //
- if (BIT (Voltage, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT3_NOT_ZERO), gShellDebug1HiiHandle);
- }
-
- if (BIT (Voltage, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle);
- }
-
- if (BIT (Voltage, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT5_NOT_ZERO), gShellDebug1HiiHandle);
- }
-
- if (BIT (Voltage, 6) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT6_NOT_ZERO), gShellDebug1HiiHandle);
- }
- }
-}
-
-/**
- Display processor information.
-
- @param[in] Status The status.
-Bit 7 Reserved, must be 0
-Bit 6 CPU Socket Populated
- 1 - CPU Socket Populated
- 0 - CPU Socket Unpopulated
-Bits 5:3 Reserved, must be zero
-Bits 2:0 CPU Status
- 0h - Unknown
- 1h - CPU Enabled
- 2h - CPU Disabled by User via BIOS Setup
- 3h - CPU Disabled By BIOS (POST Error)
- 4h - CPU is Idle, waiting to be enabled.
- 5-6h - Reserved
- 7h - Other
-
- @param[in] Option The option
-**/
-VOID
-DisplayProcessorStatus (
- IN UINT8 Status,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_STATUS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Status, Option);
-
- if (BIT (Status, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT7_NOT_ZERO), gShellDebug1HiiHandle);
- } else if (BIT (Status, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT5_NOT_ZERO), gShellDebug1HiiHandle);
- } else if (BIT (Status, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle);
- } else if (BIT (Status, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT3_NOT_ZERO), gShellDebug1HiiHandle);
- }
- //
- // Check BIT 6
- //
- if (BIT (Status, 6) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_SOCKET_POPULATED), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_SOCKET_UNPOPULATED), gShellDebug1HiiHandle);
- }
- //
- // Check BITs 2:0
- //
- switch (Status & 0x07) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_ENABLED), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_DISABLED_BY_USER), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_DIABLED_BY_BIOS), gShellDebug1HiiHandle);
- break;
-
- case 4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_IDLE), gShellDebug1HiiHandle);
- break;
-
- case 7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHERS), gShellDebug1HiiHandle);
- break;
-
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
- }
-}
-
-/**
- Display information about Memory Controller Information (Type 5).
-
- @param[in] Size Memory size.
- @param[in] SlotNum Which slot is this about.
- @param[in] Option Option for the level of detail output required.
-**/
-VOID
-DisplayMaxMemoryModuleSize (
- IN UINT8 Size,
- IN UINT8 SlotNum,
- IN UINT8 Option
- )
-{
- UINTN MaxSize;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SIZE_LARGEST_MEM), gShellDebug1HiiHandle);
- //
- // MaxSize is determined by follow formula
- //
- MaxSize = (UINTN) 1 << Size;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_MB), gShellDebug1HiiHandle, MaxSize);
-
- if (Option >= SHOW_DETAIL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MAX_AMOUNT_MEM), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_MB), gShellDebug1HiiHandle, MaxSize, SlotNum, MaxSize * SlotNum);
- }
-}
-
-/**
- Display information about memory configuration handles.
-
- @param[in] Handles The buffer of handles to output info on.
- @param[in] SlotNum The number of handles in the above buffer.
- @param[in] Option Option for the level of detail output required.
-**/
-VOID
-DisplayMemoryModuleConfigHandles (
- IN UINT16 *Handles,
- IN UINT8 SlotNum,
- IN UINT8 Option
- )
-{
- UINT8 Index;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HANDLES_CONTROLLED), gShellDebug1HiiHandle, SlotNum);
-
- if (Option >= SHOW_DETAIL) {
- //
- // No handle, Handles is INVALID.
- //
- if (SlotNum == 0) {
- return ;
- }
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HANDLES_LIST_CONTROLLED), gShellDebug1HiiHandle);
- for (Index = 0; Index < SlotNum; Index++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HANDLE), gShellDebug1HiiHandle, Index + 1, Handles[Index]);
- }
- }
-}
-
-/**
- Display Memory Module Information (Type 6).
-
- @param[in] BankConnections
- @param[in] Option
-**/
-VOID
-DisplayMmBankConnections (
- IN UINT8 BankConnections,
- IN UINT8 Option
- )
-{
- UINT8 High;
- UINT8 Low;
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_CONNECTIONS), gShellDebug1HiiHandle);
- //
- // Print option
- //
- PRINT_INFO_OPTION (BankConnections, Option);
-
- //
- // Divide it to high and low
- //
- High = (UINT8) (BankConnections & 0xF0);
- Low = (UINT8) (BankConnections & 0x0F);
- if (High != 0xF) {
- if (Low != 0xF) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_RAS), gShellDebug1HiiHandle, High, Low, High, Low);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_RAS_2), gShellDebug1HiiHandle, High, High);
- }
- } else {
- if (Low != 0xF) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_RAS_2), gShellDebug1HiiHandle, Low, Low);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NO_BANKS_CONNECTED), gShellDebug1HiiHandle);
- }
- }
-}
-
-/**
- Display memory informcation.
-
- Bits 0:6 Size (n),
- where 2**n is the size in MB with three special-case values:
- 7Dh Not determinable (Installed Size only)
- 7Eh Module is installed, but no memory has been enabled
- 7Fh Not installed
- Bit 7 Defines whether the memory module has a single- (0)
- or double-bank (1) connection.
-
- @param[in] Size - The size
- @param[in] Option - The option
-**/
-VOID
-DisplayMmMemorySize (
- IN UINT8 Size,
- IN UINT8 Option
- )
-{
- UINT8 Value;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEMORY_SIZE), gShellDebug1HiiHandle);
- //
- // Print option
- //
- PRINT_INFO_OPTION (Size, Option);
-
- //
- // Get the low bits(0-6 bit)
- //
- Value = (UINT8) (Size & 0x7F);
- if (Value == 0x7D) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_SIZE_NOT_DETERMINABLE), gShellDebug1HiiHandle);
- } else if (Value == 0x7E) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MODULE_INSTALLED), gShellDebug1HiiHandle);
- } else if (Value == 0x7F) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_INSTALLED), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_SIZE), gShellDebug1HiiHandle, 1 << Value);
- }
-
- if (BIT (Size, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_MODULE_DOUBLE_BANK), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_MODULE_SINGLE_BANK), gShellDebug1HiiHandle);
- }
-}
-
-/**
- Display Cache Configuration.
-
- @param[in] CacheConfiguration Cache Configuration.
-Bits 15:10 Reserved, must be 0
-Bits 9:8 Operational Mode
- 0h - Write Through
- 1h - Write Back
- 2h - Varies with Memory Address
- 3h - Unknown
-Bit 7 Enabled/Disabled
- 1 - Enabled
- 0 - Disabled
-Bits 6:5 Location
- 0h - Internal
- 1h - External
- 2h - Reserved
- 3h - Unknown
-Bit 4 Reserved, must be zero
-Bit 3 Cache Socketed
- 1 - Socketed
- 0 - Unsocketed
-Bits 2:0 Cache Level
- 1 through 8 (For example, an L1 cache would
- use value 000b and an L3 cache would use 010b.)
-
- @param[in] Option The option
-**/
-VOID
-DisplayCacheConfiguration (
- IN UINT16 CacheConfiguration,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_CONFIGURATION), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (CacheConfiguration, Option);
-
- if (BIT (CacheConfiguration, 15) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT15_NOT_ZERO), gShellDebug1HiiHandle);
- } else if (BIT (CacheConfiguration, 14) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT14_NOT_ZERO), gShellDebug1HiiHandle);
- } else if (BIT (CacheConfiguration, 13) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT13_NOT_ZERO), gShellDebug1HiiHandle);
- } else if (BIT (CacheConfiguration, 12) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT12_NOT_ZERO), gShellDebug1HiiHandle);
- } else if (BIT (CacheConfiguration, 11) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT11_NOT_ZERO), gShellDebug1HiiHandle);
- } else if (BIT (CacheConfiguration, 10) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT10_NOT_ZERO), gShellDebug1HiiHandle);
- } else if (BIT (CacheConfiguration, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle);
- }
-
- //
- // Check BITs 9:8
- //
- switch ((CacheConfiguration & 0x300) >> 8) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_WRITE_THROUGH), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_WRITE_BACK), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_VARIES_WITH_MEM_ADDR), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
- }
-
- //
- // Check BIT 7
- //
- if (BIT (CacheConfiguration, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
- }
-
- //
- // Check BITs 6:5
- //
- switch ((CacheConfiguration & 0x60) >> 5) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_INTERNAL), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_EXTERNAL), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
- }
-
- //
- // Check BIT 3
- //
- if (BIT (CacheConfiguration, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_SOCKETED), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_NOT_SOCKETED), gShellDebug1HiiHandle);
- }
-
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_LEVEL), gShellDebug1HiiHandle, (CacheConfiguration & 0x07) + 1);
-}
-
-/**
- The Slot ID field of the System Slot structure provides a mechanism to
- correlate the physical attributes of the slot to its logical access method
- (which varies based on the Slot Type field).
-
- @param[in] SlotId - The slot ID
- @param[in] SlotType - The slot type
- @param[in] Option - The Option
-**/
-VOID
-DisplaySystemSlotId (
- IN UINT16 SlotId,
- IN UINT8 SlotType,
- IN UINT8 Option
- )
-{
- //
- // Display slot type first
- //
- DisplaySystemSlotType (SlotType, Option);
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SLOT_ID), gShellDebug1HiiHandle);
- //
- // print option
- //
- PRINT_INFO_OPTION (SlotType, Option);
-
- switch (SlotType) {
- //
- // Slot Type: MCA
- //
- case 0x04:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LOGICAL_MICRO_CHAN), gShellDebug1HiiHandle);
- if (SlotId > 0 && SlotId < 15) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_D), gShellDebug1HiiHandle, SlotId);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_NOT_1_15), gShellDebug1HiiHandle);
- }
- break;
-
- //
- // EISA
- //
- case 0x05:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LOGICAL_EISA_NUM), gShellDebug1HiiHandle);
- if (SlotId > 0 && SlotId < 15) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_D), gShellDebug1HiiHandle, SlotId);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_NOT_1_15), gShellDebug1HiiHandle);
- }
- break;
-
- //
- // Slot Type: PCI
- //
- case 0x06:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
- break;
-
- //
- // PCMCIA
- //
- case 0x07:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_IDENTIFIES_ADAPTER_NUM), gShellDebug1HiiHandle, SlotId);
- break;
-
- //
- // Slot Type: PCI-E
- //
- case 0xA5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
- break;
-
- default:
- if ((SlotType >= 0x0E && SlotType <= 0x12) || (SlotType >= 0xA6 && SlotType <= 0xB6)){
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_SLOT_ID), gShellDebug1HiiHandle);
- }
- }
-}
-
-/**
- Display System Boot Information (Type 32) information.
-
- @param[in] Parameter The parameter.
- @param[in] Option The options.
-**/
-VOID
-DisplaySystemBootStatus (
- IN UINT8 Parameter,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_BOOT_STATUS), gShellDebug1HiiHandle);
- //
- // Print option
- //
- PRINT_INFO_OPTION (Parameter, Option);
-
- //
- // Check value and print
- //
- if (Parameter == 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NO_ERRORS_DETECTED), gShellDebug1HiiHandle);
- } else if (Parameter == 1) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NO_BOOTABLE_MEDIA), gShellDebug1HiiHandle);
- } else if (Parameter == 2) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NORMAL_OP_SYSTEM), gShellDebug1HiiHandle);
- } else if (Parameter == 3) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_DETECTED), gShellDebug1HiiHandle);
- } else if (Parameter == 4) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OP_SYSTEM), gShellDebug1HiiHandle);
- } else if (Parameter == 5) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_USER_REQUESTED_BOOT), gShellDebug1HiiHandle);
- } else if (Parameter == 6) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_SECURITY_VIOLATION), gShellDebug1HiiHandle);
- } else if (Parameter == 7) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PREV_REQ_IMAGE), gShellDebug1HiiHandle);
- } else if (Parameter == 8) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WATCHDOG_TIMER), gShellDebug1HiiHandle);
- } else if (Parameter >= 9 && Parameter <= 127) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RSVD_FUTURE_ASSIGNMENT), gShellDebug1HiiHandle);
- } else if (Parameter >= 128 && Parameter <= 191) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VENDOR_OEM_SPECIFIC), gShellDebug1HiiHandle);
- } else if (Parameter >= 192) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRODUCT_SPEC_IMPLMENTATION), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_VALUE), gShellDebug1HiiHandle);
- }
-}
-
-/**
- Display Portable Battery (Type 22) information.
-
- The date the cell pack was manufactured, in packed format:
- Bits 15:9 Year, biased by 1980, in the range 0 to 127.
- Bits 8:5 Month, in the range 1 to 12.
- Bits 4:0 Date, in the range 1 to 31.
- For example, 01 February 2000 would be identified as
- 0010 1000 0100 0001b (0x2841).
-
- @param[in] Date The date
- @param[in] Option The option
-**/
-VOID
-DisplaySBDSManufactureDate (
- IN UINT16 Date,
- IN UINT8 Option
- )
-{
- UINTN Day;
- UINTN Month;
- UINTN Year;
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SBDS_MANUFACTURE_DATE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Date, Option);
- //
- // Print date
- //
- Day = Date & 0x001F;
- Month = (Date & 0x01E0) >> 5;
- Year = ((Date & 0xFE00) >> 9) + 1980;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MONTH_DAY_YEAR), gShellDebug1HiiHandle, Day, Month, Year);
-
-}
-
-/**
- Display System Reset (Type 23) information.
-
-
-Identifies the system-reset capabilities for the system.
- Bits 7:6 Reserved for future assignment via this specification, set to 00b.
- Bit 5 System contains a watchdog timer, either True (1) or False (0).
- Bits 4:3 Boot Option on Limit.
- Identifies the system action to be taken when the Reset Limit is reached, one of:
- 00b Reserved, do not use.
- 01b Operating system
- 10b System utilities
- 11b Do not rebootBits
- 2:1 Boot Option. Indicates the action to be taken following a watchdog reset, one of:
- 00b Reserved, do not use.
- 01b Operating system
- 10b System utilities
- 11b Do not reboot
- Bit 0 Status.
- 1b The system reset is enabled by the user
- 0b The system reset is not enabled by the user
-
- @param[in] Reset Reset
- @param[in] Option The option
-**/
-VOID
-DisplaySystemResetCapabilities (
- IN UINT8 Reset,
- IN UINT8 Option
- )
-{
- UINTN Temp;
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_RESET_CAPABILITIES), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Reset, Option);
-
- //
- // Check reserved bits 7:6
- //
- if ((Reset & 0xC0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RESERVED_ZERO), gShellDebug1HiiHandle);
- }
- //
- // Watch dog
- //
- if (BIT (Reset, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WATCHDOG_TIMER_2), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_NOT_CONTAIN_TIMER), gShellDebug1HiiHandle);
- }
- //
- // Boot Option on Limit
- //
- Temp = (Reset & 0x18) >> 3;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_OPTION_LIMIT), gShellDebug1HiiHandle);
- switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OP_SYSTEM_2), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_UTIL), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DO_NOT_REBOOT_BITS), gShellDebug1HiiHandle);
- break;
- }
- //
- // Boot Option
- //
- Temp = (Reset & 0x06) >> 1;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_OPTION), gShellDebug1HiiHandle);
- switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OP_SYSTEM_2), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_UTIL), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DO_NOT_REBOOT), gShellDebug1HiiHandle);
- break;
- }
- //
- // Reset enable flag
- //
- if ((Reset & 0x01) != 0) {
- Print (L"The system reset is enabled by the user\n");
- } else {
- Print (L"The system reset is disabled by the user\n");
- }
-}
-
-/**
- Display Hardware Security (Type 24) information.
-
-
-Identifies the password and reset status for the system:
-
-Bits 7:6 Power-on Password Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
-Bits 5:4 Keyboard Password Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
-Bits 3:2 Administrator Password Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
-Bits 1:0 Front Panel Reset Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
-
- @param[in] Settings The device settings.
- @param[in] Option The device options.
-**/
-VOID
-DisplayHardwareSecuritySettings (
- IN UINT8 Settings,
- IN UINT8 Option
- )
-{
- UINTN Temp;
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HARDWARE_SECURITY_SET), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Settings, Option);
-
- //
- // Power-on Password Status
- //
- Temp = (Settings & 0xC0) >> 6;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_ON_PASSWORD), gShellDebug1HiiHandle);
- switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
- }
- //
- // Keyboard Password Status
- //
- Temp = (Settings & 0x30) >> 4;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_KEYBOARD_PASSWORD), gShellDebug1HiiHandle);
- switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
- }
- //
- // Administrator Password Status
- //
- Temp = (Settings & 0x0C) >> 2;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ADMIN_PASSWORD_STATUS), gShellDebug1HiiHandle);
- switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
- }
- //
- // Front Panel Reset Status
- //
- Temp = Settings & 0x3;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FRONT_PANEL_RESET), gShellDebug1HiiHandle);
- switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
- }
-}
-
-/**
- Display Out-of-Band Remote Access (Type 30) information.
-
- @param[in] Connections The device characteristics.
- @param[in] Option The device options.
-**/
-VOID
-DisplayOBRAConnections (
- IN UINT8 Connections,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONNECTIONS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Connections, Option);
-
- //
- // Check reserved bits 7:2
- //
- if ((Connections & 0xFC) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RESERVED_ZERO_2), gShellDebug1HiiHandle);
- }
- //
- // Outbound Connection
- //
- if (BIT (Connections, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OUTBOUND_CONN_ENABLED), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTUBOUND_CONN_DISABLED), gShellDebug1HiiHandle);
- }
- //
- // Inbound Connection
- //
- if (BIT (Connections, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INBOIUND_CONN_ENABLED), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INBOUND_CONN_DISABLED), gShellDebug1HiiHandle);
- }
-}
-
-/**
- Display System Power Supply (Type 39) information.
-
- @param[in] Characteristics The device characteristics.
- @param[in] Option The device options.
-**/
-VOID
-DisplaySPSCharacteristics (
- IN UINT16 Characteristics,
- IN UINT8 Option
- )
-{
- UINTN Temp;
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_CHAR), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Characteristics, Option);
-
- //
- // Check reserved bits 15:14
- //
- if ((Characteristics & 0xC000) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_15_14_RSVD), gShellDebug1HiiHandle);
- }
- //
- // Bits 13:10 - DMTF Power Supply Type
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TYPE), gShellDebug1HiiHandle);
- Temp = (Characteristics & 0x1C00) << 10;
- switch (Temp) {
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LINEAR), gShellDebug1HiiHandle);
- break;
-
- case 4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SWITCHING), gShellDebug1HiiHandle);
- break;
-
- case 5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BATTERY), gShellDebug1HiiHandle);
- break;
-
- case 6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UPS), gShellDebug1HiiHandle);
- break;
-
- case 7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONVERTER), gShellDebug1HiiHandle);
- break;
-
- case 8:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_REGULATOR), gShellDebug1HiiHandle);
- break;
-
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_2), gShellDebug1HiiHandle);
- }
- //
- // Bits 9:7 - Status
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STATUS_DASH), gShellDebug1HiiHandle);
- Temp = (Characteristics & 0x380) << 7;
- switch (Temp) {
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OK), gShellDebug1HiiHandle);
- break;
-
- case 4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NON_CRITICAL), gShellDebug1HiiHandle);
- break;
-
- case 5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CRITICAL_POWER_SUPPLY), gShellDebug1HiiHandle);
- break;
-
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED), gShellDebug1HiiHandle);
- }
- //
- // Bits 6:3 - DMTF Input Voltage Range Switching
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INPUT_VOLTAGE_RANGE), gShellDebug1HiiHandle);
- Temp = (Characteristics & 0x78) << 3;
- switch (Temp) {
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MANUAL), gShellDebug1HiiHandle);
- break;
-
- case 4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AUTO_SWITCH), gShellDebug1HiiHandle);
- break;
-
- case 5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WIDE_RANGE), gShellDebug1HiiHandle);
- break;
-
- case 6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_APPLICABLE), gShellDebug1HiiHandle);
- break;
-
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_3), gShellDebug1HiiHandle);
- break;
- }
- //
- // Power supply is unplugged from the wall
- //
- if (BIT (Characteristics, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_UNPLUGGED), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_PLUGGED), gShellDebug1HiiHandle);
- }
- //
- // Power supply is present
- //
- if (BIT (Characteristics, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_PRESENT), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_NOT_PRESENT), gShellDebug1HiiHandle);
- }
- //
- // hot replaceable
- //
- if (BIT (Characteristics, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_REPLACE), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_NOT_REPLACE), gShellDebug1HiiHandle);
- }
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
deleted file mode 100644
index d24aeb96cc..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
+++ /dev/null
@@ -1,411 +0,0 @@
-/** @file
- Module to clarify the element info of the smbios structure.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SMBIOS_PRINT_INFO_H_
-#define _SMBIOS_PRINT_INFO_H_
-
-#include <IndustryStandard/SmBios.h>
-
-extern UINT8 SmbiosMajorVersion;
-extern UINT8 SmbiosMinorVersion;
-
-#define SHOW_NONE 0x00
-#define SHOW_OUTLINE 0x01
-#define SHOW_NORMAL 0x02
-#define SHOW_DETAIL 0x03
-//
-// SHOW_ALL: WaitEnter() not wait input.
-//
-#define SHOW_ALL 0x04
-#define SHOW_STATISTICS 0x05
-
-#define AS_UINT16(pData) (*((UINT16 *) pData))
-#define AS_UINT32(pData) (*((UINT32 *) pData))
-#define AS_UINT64(pData) (*((UINT64 *) pData))
-
-/**
- Print the info of EPS(Entry Point Structure).
-
- @param[in] SmbiosTable Pointer to the SMBIOS table entry point.
- @param[in] Option Display option.
-**/
-VOID
-SmbiosPrintEPSInfo (
- IN SMBIOS_TABLE_ENTRY_POINT *SmbiosTable,
- IN UINT8 Option
- );
-
-/**
- This function print the content of the structure pointed by Struct.
-
- @param[in] Struct Point to the structure to be printed.
- @param[in] Option Print option of information detail.
-
- @retval EFI_SUCCESS Successfully Printing this function.
- @retval EFI_INVALID_PARAMETER Invalid Structure.
- @retval EFI_UNSUPPORTED Unsupported.
-**/
-EFI_STATUS
-SmbiosPrintStructure (
- IN SMBIOS_STRUCTURE_POINTER *Struct,
- IN UINT8 Option
- );
-
-/**
- Display BIOS Information (Type 0) information.
-
- @param[in] Chara The information bits.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayBiosCharacteristics (
- IN UINT64 Chara,
- IN UINT8 Option
- );
-
-/**
- Display Bios Characteristice extensions1 information.
-
- @param[in] Byte1 The information.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayBiosCharacteristicsExt1 (
- IN UINT8 Byte1,
- IN UINT8 Option
- );
-
-/**
- Display Bios Characteristice extensions2 information.
-
- @param[in] Byte2 The information.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayBiosCharacteristicsExt2 (
- IN UINT8 Byte2,
- IN UINT8 Option
- );
-
-/**
- Display Processor Information (Type 4) information.
-
- @param[in] Family The family value.
- @param[in] Option The option value.
-**/
-VOID
-DisplayProcessorFamily (
- UINT8 Family,
- UINT8 Option
- );
-
-/**
- Display processor family information.
-
- @param[in] Family2 The family value.
- @param[in] Option The option value.
-**/
-VOID
-DisplayProcessorFamily2 (
- IN UINT16 Family2,
- IN UINT8 Option
- );
-
-/**
- Display processor voltage information.
-
- @param[in] Voltage The Voltage.
- Bit 7 Set to 0, indicating 'legacy' mode for processor voltage
- Bits 6:4 Reserved, must be zero
- Bits 3:0 Voltage Capability.
- A Set bit indicates that the voltage is supported.
- Bit 0 - 5V
- Bit 1 - 3.3V
- Bit 2 - 2.9V
- Bit 3 - Reserved, must be zero.
-
- Note:
- Setting of multiple bits indicates the socket is configurable
- If bit 7 is set to 1, the remaining seven bits of the field are set to
- contain the processor's current voltage times 10.
- For example, the field value for a processor voltage of 1.8 volts would be
- 92h = 80h + (1.8 * 10) = 80h + 18 = 80h +12h.
-
- @param[in] Option The option.
-**/
-VOID
-DisplayProcessorVoltage (
- IN UINT8 Voltage,
- IN UINT8 Option
- );
-
-/**
- Display processor information.
-
- @param[in] Status The status.
-Bit 7 Reserved, must be 0
-Bit 6 CPU Socket Populated
- 1 - CPU Socket Populated
- 0 - CPU Socket Unpopulated
-Bits 5:3 Reserved, must be zero
-Bits 2:0 CPU Status
- 0h - Unknown
- 1h - CPU Enabled
- 2h - CPU Disabled by User via BIOS Setup
- 3h - CPU Disabled By BIOS (POST Error)
- 4h - CPU is Idle, waiting to be enabled.
- 5-6h - Reserved
- 7h - Other
-
- @param[in] Option The option
-**/
-VOID
-DisplayProcessorStatus (
- IN UINT8 Status,
- IN UINT8 Option
- );
-
-/**
- Display information about Memory Controller Information (Type 5).
-
- @param[in] Size Memory size.
- @param[in] SlotNum Which slot is this about.
- @param[in] Option Option for the level of detail output required.
-**/
-VOID
-DisplayMaxMemoryModuleSize (
- IN UINT8 Size,
- IN UINT8 SlotNum,
- IN UINT8 Option
- );
-
-/**
- Display information about memory configuration handles.
-
- @param[in] Handles The buffer of handles to output info on.
- @param[in] SlotNum The number of handles in the above buffer.
- @param[in] Option Option for the level of detail output required.
-**/
-VOID
-DisplayMemoryModuleConfigHandles (
- IN UINT16 *Handles,
- IN UINT8 SlotNum,
- IN UINT8 Option
- );
-
-/**
- Display Memory Module Information (Type 6).
-
- @param[in] BankConnections
- @param[in] Option
-**/
-VOID
-DisplayMmBankConnections (
- IN UINT8 BankConnections,
- IN UINT8 Option
- );
-
-/**
- Display memory informcation.
-
- Bits 0:6 Size (n),
- where 2**n is the size in MB with three special-case values:
- 7Dh Not determinable (Installed Size only)
- 7Eh Module is installed, but no memory has been enabled
- 7Fh Not installed
- Bit 7 Defines whether the memory module has a single- (0)
- or double-bank (1) connection.
-
- @param[in] Size - The size
- @param[in] Option - The option
-**/
-VOID
-DisplayMmMemorySize (
- IN UINT8 Size,
- IN UINT8 Option
- );
-
-/**
- Display Cache Configuration.
-
- @param[in] CacheConfiguration Cache Configuration.
-Bits 15:10 Reserved, must be 0
-Bits 9:8 Operational Mode
- 0h - Write Through
- 1h - Write Back
- 2h - Varies with Memory Address
- 3h - Unknown
-Bit 7 Enabled/Disabled
- 1 - Enabled
- 0 - Disabled
-Bits 6:5 Location
- 0h - Internal
- 1h - External
- 2h - Reserved
- 3h - Unknown
-Bit 4 Reserved, must be zero
-Bit 3 Cache Socketed
- 1 - Socketed
- 0 - Unsocketed
-Bits 2:0 Cache Level
- 1 through 8 (For example, an L1 cache would
- use value 000b and an L3 cache would use 010b.)
-
- @param[in] Option The option
-**/
-VOID
-DisplayCacheConfiguration (
- IN UINT16 CacheConfiguration,
- IN UINT8 Option
- );
-
-/**
- The Slot ID field of the System Slot structure provides a mechanism to
- correlate the physical attributes of the slot to its logical access method
- (which varies based on the Slot Type field).
-
- @param[in] SlotId - The slot ID
- @param[in] SlotType - The slot type
- @param[in] Option - The Option
-**/
-VOID
-DisplaySystemSlotId (
- IN UINT16 SlotId,
- IN UINT8 SlotType,
- IN UINT8 Option
- );
-
-/**
- Display Portable Battery (Type 22) information.
-
- The date the cell pack was manufactured, in packed format:
- Bits 15:9 Year, biased by 1980, in the range 0 to 127.
- Bits 8:5 Month, in the range 1 to 12.
- Bits 4:0 Date, in the range 1 to 31.
- For example, 01 February 2000 would be identified as
- 0010 1000 0100 0001b (0x2841).
-
- @param[in] Date The date
- @param[in] Option The option
-**/
-VOID
-DisplaySBDSManufactureDate (
- IN UINT16 Date,
- IN UINT8 Option
- );
-
-/**
- Display System Reset (Type 23) information.
-
- Routine Description:
- Identifies the system-reset capabilities for the system.
- Bits 7:6 Reserved for future assignment via this specification, set to 00b.
- Bit 5 System contains a watchdog timer, either True (1) or False (0).
- Bits 4:3 Boot Option on Limit.
- Identifies the system action to be taken when the Reset Limit is reached, one of:
- 00b Reserved, do not use.
- 01b Operating system
- 10b System utilities
- 11b Do not rebootBits
- 2:1 Boot Option. Indicates the action to be taken following a watchdog reset, one of:
- 00b Reserved, do not use.
- 01b Operating system
- 10b System utilities
- 11b Do not reboot
- Bit 0 Status.
- 1b The system reset is enabled by the user
- 0b The system reset is not enabled by the user
-
- @param[in] Reset Reset
- @param[in] Option The option
-**/
-VOID
-DisplaySystemResetCapabilities (
- IN UINT8 Reset,
- IN UINT8 Option
- );
-
-/**
- Display Hardware Security (Type 24) information.
-
- Routine Description:
- Identifies the password and reset status for the system:
-
- Bits 7:6 Power-on Password Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
- Bits 5:4 Keyboard Password Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
- Bits 3:2 Administrator Password Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
- Bits 1:0 Front Panel Reset Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
-
- @param[in] Settings The device settings.
- @param[in] Option The device options.
-**/
-VOID
-DisplayHardwareSecuritySettings (
- IN UINT8 Settings,
- IN UINT8 Option
- );
-
-/**
- Display Out-of-Band Remote Access (Type 30) information.
-
- @param[in] Connections The device characteristics.
- @param[in] Option The device options.
-**/
-VOID
-DisplayOBRAConnections (
- IN UINT8 Connections,
- IN UINT8 Option
- );
-
-/**
- Display System Boot Information (Type 32) information.
-
- @param[in] Parameter The parameter.
- @param[in] Option The options.
-**/
-VOID
-DisplaySystemBootStatus (
- IN UINT8 Parameter,
- IN UINT8 Option
- );
-
-/**
- Display System Power Supply (Type 39) information.
-
- @param[in] Characteristics The device characteristics.
- @param[in] Option The device options.
-**/
-VOID
-DisplaySPSCharacteristics (
- IN UINT16 Characteristics,
- IN UINT8 Option
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
deleted file mode 100644
index b6f3847992..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ /dev/null
@@ -1,4377 +0,0 @@
-/** @file
- Build a table, each item is (Key, Info) pair.
- And give a interface of query a string out of a table.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "../UefiShellDebug1CommandsLib.h"
-#include "QueryTable.h"
-#include "PrintInfo.h"
-
-TABLE_ITEM SystemWakeupTypeTable[] = {
- {
- 0x0,
- L" Reserved"
- },
- {
- 0x1,
- L" Other"
- },
- {
- 0x2,
- L" Unknown"
- },
- {
- 0x3,
- L" APM Timer"
- },
- {
- 0x4,
- L" Modem Ring"
- },
- {
- 0x5,
- L" LAN Remote"
- },
- {
- 0x6,
- L" Power Switch"
- },
- {
- 0x7,
- L" AC Power Restored"
- }
-};
-
-TABLE_ITEM BaseBoardFeatureFlagsTable[] = {
- {
- 0,
- L" Hosting board"
- },
- {
- 1,
- L" Requires at least one daughter board or auxiliary card"
- },
- {
- 2,
- L" Removable"
- },
- {
- 3,
- L" Replaceable"
- },
- {
- 4,
- L" Hot swappable"
- }
-};
-
-TABLE_ITEM BaseBoardBoardTypeTable[] = {
- {
- 0x01,
- L" Unknown"
- },
- {
- 0x02,
- L" Other"
- },
- {
- 0x03,
- L" Server Blade"
- },
- {
- 0x04,
- L" Connectivity Switch"
- },
- {
- 0x05,
- L" System Management Module"
- },
- {
- 0x06,
- L" Processor Module"
- },
- {
- 0x07,
- L" I/O Module"
- },
- {
- 0x08,
- L" Memory Module"
- },
- {
- 0x09,
- L" Daughter board"
- },
- {
- 0x0A,
- L" Motherboard"
- },
- {
- 0x0B,
- L" Processor/Memory Module"
- },
- {
- 0x0C,
- L" Processor/IO Module"
- },
- {
- 0x0D,
- L" Interconnect Board"
- }
-};
-
-TABLE_ITEM SystemEnclosureTypeTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" Desktop"
- },
- {
- 0x04,
- L" Low Profile Desktop"
- },
- {
- 0x05,
- L" Pizza Box"
- },
- {
- 0x06,
- L" Mini Tower"
- },
- {
- 0x07,
- L" Tower"
- },
- {
- 0x08,
- L" Portable"
- },
- {
- 0x09,
- L" LapTop"
- },
- {
- 0x0A,
- L" Notebook"
- },
- {
- 0x0B,
- L" Hand Held"
- },
- {
- 0x0C,
- L" Docking Station"
- },
- {
- 0x0D,
- L" All in One"
- },
- {
- 0x0E,
- L" Sub Notebook"
- },
- {
- 0x0F,
- L" Space-saving"
- },
- {
- 0x10,
- L" Main Server Chassis"
- },
- {
- 0x11,
- L" Expansion Chassis"
- },
- {
- 0x12,
- L" SubChassis"
- },
- {
- 0x13,
- L" Sub Notebook"
- },
- {
- 0x14,
- L" Bus Expansion Chassis"
- },
- {
- 0x15,
- L" Peripheral Chassis"
- },
- {
- 0x16,
- L" RAID Chassis"
- },
- {
- 0x17,
- L" Rack Mount Chassis"
- },
- {
- 0x18,
- L" Sealed-case PC"
- },
- {
- 0x19,
- L" Multi-system Chassis"
- },
- {
- 0x1A,
- L" CompactPCI"
- },
- {
- 0x1B,
- L" AdvancedTCA"
- },
- {
- 0x1C,
- L" Blade"
- },
- {
- 0x1D,
- L" Blade Enclosure"
- },
-};
-
-TABLE_ITEM SystemEnclosureStatusTable[] = {
- {
- 0x1,
- L" Other"
- },
- {
- 0x2,
- L" Unknown"
- },
- {
- 0x3,
- L" Safe"
- },
- {
- 0x4,
- L" Warning"
- },
- {
- 0x5,
- L" Critical"
- },
- {
- 0x6,
- L" Non-recoverable"
- }
-};
-
-TABLE_ITEM SESecurityStatusTable[] = {
- {
- 0x1,
- L" Other"
- },
- {
- 0x2,
- L" Unknown"
- },
- {
- 0x3,
- L" None"
- },
- {
- 0x4,
- L" External interface locked out"
- },
- {
- 0x5,
- L" External interface enabled"
- }
-};
-
-TABLE_ITEM ProcessorTypeTable[] = {
- {
- 0x1,
- L" Other"
- },
- {
- 0x2,
- L" Unknown"
- },
- {
- 0x3,
- L" Central Processor"
- },
- {
- 0x4,
- L" Math Processor"
- },
- {
- 0x5,
- L" DSP Processor"
- },
- {
- 0x6,
- L" Video Processor "
- },
-};
-
-TABLE_ITEM ProcessorUpgradeTable[] = {
- {
- 0x01,
- L"Other"
- },
- {
- 0x02,
- L"Unknown"
- },
- {
- 0x03,
- L"Daughter Board"
- },
- {
- 0x04,
- L"ZIF Socket"
- },
- {
- 0x05,
- L"Replaceable Piggy Back"
- },
- {
- 0x06,
- L"None"
- },
- {
- 0x07,
- L"LIF Socket"
- },
- {
- 0x08,
- L"Slot 1"
- },
- {
- 0x09,
- L"Slot 2"
- },
- {
- 0x0A,
- L"370-pin socket"
- },
- {
- 0x0B,
- L"Slot A"
- },
- {
- 0x0C,
- L"Slot M"
- },
- {
- 0x0D,
- L"Socket 423"
- },
- {
- 0x0E,
- L"Socket A"
- },
- {
- 0x0F,
- L"Socket 478"
- },
- {
- 0x10,
- L"Socket 754"
- },
- {
- 0x11,
- L"Socket 940"
- },
- {
- 0x12,
- L"Socket 939"
- },
- {
- 0x13,
- L"Socket mPGA604"
- },
- {
- 0x14,
- L"Socket LGA771"
- },
- {
- 0x15,
- L"Socket LGA775"
- },
- {
- 0x16,
- L"Socket S1"
- },
- {
- 0x17,
- L"Socket AM2"
- },
- {
- 0x18,
- L"Socket F"
- },
- {
- 0x19,
- L"Socket LGA1366"
- },
- {
- 0x1A,
- L"Socket G34"
- },
- {
- 0x1B,
- L"Socket AM3"
- },
- {
- 0x1C,
- L"Socket C32"
- },
- {
- 0x1D,
- L"Socket LGA1156"
- },
- {
- 0x1E,
- L"Socket LGA1567"
- },
- {
- 0x1F,
- L"Socket PGA988A"
- },
- {
- 0x20,
- L"Socket BGA1288"
- },
- {
- 0x21,
- L"Socket rPGA988B"
- },
- {
- 0x22,
- L"Socket BGA1023"
- },
- {
- 0x23,
- L"Socket BGA1224"
- },
- {
- 0x24,
- L"Socket BGA1155"
- },
- {
- 0x25,
- L"Socket LGA1356"
- },
- {
- 0x26,
- L"Socket LGA2011"
- },
- {
- 0x27,
- L"Socket FS1"
- },
- {
- 0x28,
- L"Socket FS2"
- },
- {
- 0x29,
- L"Socket FM1"
- },
- {
- 0x2A,
- L"Socket FM2"
- }
-};
-
-TABLE_ITEM ProcessorCharacteristicsTable[] = {
- {
- 1,
- L" Unknown"
- },
- {
- 2,
- L" 64-bit Capable"
- },
- {
- 3,
- L" Multi-Core"
- },
- {
- 4,
- L" Hardware Thread"
- },
- {
- 5,
- L" Execute Protection"
- },
- {
- 6,
- L" Enhanced Virtualization"
- },
- {
- 7,
- L" Power/Performance Control"
- }
-};
-
-
-TABLE_ITEM McErrorDetectMethodTable[] = {
- {
- 0x01,
- L"Other"
- },
- {
- 0x02,
- L"Unknown"
- },
- {
- 0x03,
- L"None"
- },
- {
- 0x04,
- L"8-bit Parity"
- },
- {
- 0x05,
- L"32-bit ECC"
- },
- {
- 0x06,
- L"64-bit ECC"
- },
- {
- 0x07,
- L"128-bit ECC"
- },
- {
- 0x08,
- L"CRC"
- },
-};
-
-TABLE_ITEM McErrorCorrectCapabilityTable[] = {
- {
- 0,
- L"Other"
- },
- {
- 1,
- L"Unknown"
- },
- {
- 2,
- L"None"
- },
- {
- 3,
- L"Single Bit Error Correcting"
- },
- {
- 4,
- L"Double Bit Error Correcting"
- },
- {
- 5,
- L"Error Scrubbing"
- },
-};
-
-TABLE_ITEM McInterleaveSupportTable[] = {
- {
- 0x01,
- L"Other"
- },
- {
- 0x02,
- L"Unknown"
- },
- {
- 0x03,
- L"One Way Interleave"
- },
- {
- 0x04,
- L"Two Way Interleave"
- },
- {
- 0x05,
- L"Four Way Interleave"
- },
- {
- 0x06,
- L"Eight Way Interleave"
- },
- {
- 0x07,
- L"Sixteen Way Interleave"
- }
-};
-
-TABLE_ITEM McMemorySpeedsTable[] = {
- {
- 0,
- L" Other"
- },
- {
- 1,
- L" Unknown"
- },
- {
- 2,
- L" 70ns"
- },
- {
- 3,
- L" 60ns"
- },
- {
- 4,
- L" 50ns"
- },
-};
-
-TABLE_ITEM MemoryModuleVoltageTable[] = {
- {
- 0,
- L" 5V"
- },
- {
- 1,
- L" 3.3V"
- },
- {
- 2,
- L" 2.9V"
- },
-};
-
-TABLE_ITEM MmMemoryTypeTable[] = {
- {
- 0,
- L" Other"
- },
- {
- 1,
- L" Unknown"
- },
- {
- 2,
- L" Standard"
- },
- {
- 3,
- L" Fast Page Mode"
- },
- {
- 4,
- L" EDO"
- },
- {
- 5,
- L" Parity"
- },
- {
- 6,
- L" ECC "
- },
- {
- 7,
- L" SIMM"
- },
- {
- 8,
- L" DIMM"
- },
- {
- 9,
- L" Burst EDO"
- },
- {
- 10,
- L" SDRAM"
- }
-};
-
-TABLE_ITEM MmErrorStatusTable[] = {
- {
- 0,
- L" Uncorrectable errors received"
- },
- {
- 1,
- L" Correctable errors received"
- },
- {
- 2,
- L" Error Status obtained from the event log"
- }
-};
-
-TABLE_ITEM CacheSRAMTypeTable[] = {
- {
- 0,
- L" Other"
- },
- {
- 1,
- L" Unknown"
- },
- {
- 2,
- L" Non-Burst"
- },
- {
- 3,
- L" Burst"
- },
- {
- 4,
- L" Pipeline Burst"
- },
- {
- 5,
- L" Synchronous"
- },
- {
- 6,
- L" Asynchronous"
- },
-};
-
-TABLE_ITEM CacheErrCorrectingTypeTable[] = {
- {
- 0x01,
- L"Other"
- },
- {
- 0x02,
- L"Unknown"
- },
- {
- 0x03,
- L"None"
- },
- {
- 0x04,
- L"Parity"
- },
- {
- 0x05,
- L"Single-bit ECC"
- },
- {
- 0x06,
- L"Multi-bit ECC"
- }
-};
-
-TABLE_ITEM CacheSystemCacheTypeTable[] = {
- {
- 0x01,
- L"Other"
- },
- {
- 0x02,
- L"Unknown"
- },
- {
- 0x03,
- L"Instruction"
- },
- {
- 0x04,
- L"Data"
- },
- {
- 0x05,
- L"Unified"
- }
-};
-
-TABLE_ITEM CacheAssociativityTable[] = {
- {
- 0x01,
- L"Other"
- },
- {
- 0x02,
- L"Unknown"
- },
- {
- 0x03,
- L"Direct Mapped"
- },
- {
- 0x04,
- L"2-way Set-Associative"
- },
- {
- 0x05,
- L"4-way Set-Associative"
- },
- {
- 0x06,
- L"Fully Associative"
- },
- {
- 0x07,
- L"8-way Set-Associative"
- },
- {
- 0x08,
- L"16-way Set-Associative"
- },
- {
- 0x09,
- L"12-way Set-Associative"
- },
- {
- 0x0A,
- L"24-way Set-Associative"
- },
- {
- 0x0B,
- L"32-way Set-Associative"
- },
- {
- 0x0C,
- L"48-way Set-Associative"
- },
- {
- 0x0D,
- L"64-way Set-Associative"
- },
- {
- 0x0E,
- L"20-way Set-Associative"
- }
-};
-
-TABLE_ITEM PortConnectorTypeTable[] = {
- {
- 0x00,
- L"None"
- },
- {
- 0x01,
- L"Centronics"
- },
- {
- 0x02,
- L"Mini Centronics"
- },
- {
- 0x03,
- L"Proprietary"
- },
- {
- 0x04,
- L"DB-25 pin male"
- },
- {
- 0x05,
- L"DB-25 pin female"
- },
- {
- 0x06,
- L"DB-15 pin male"
- },
- {
- 0x07,
- L"DB-15 pin female"
- },
- {
- 0x08,
- L"DB-9 pin male"
- },
- {
- 0x09,
- L"DB-9 pin female"
- },
- {
- 0x0A,
- L"RJ-11"
- },
- {
- 0x0B,
- L"RJ-45"
- },
- {
- 0x0C,
- L"50 Pin MiniSCSI"
- },
- {
- 0x0D,
- L"Mini-DIN"
- },
- {
- 0x0E,
- L"Micro-DIN"
- },
- {
- 0x0F,
- L"PS/2"
- },
- {
- 0x10,
- L"Infrared"
- },
- {
- 0x11,
- L"HP-HIL"
- },
- {
- 0x12,
- L"Access Bus (USB)"
- },
- {
- 0x13,
- L"SSA SCSI"
- },
- {
- 0x14,
- L"Circular DIN-8 male"
- },
- {
- 0x15,
- L"Circular DIN-8 female"
- },
- {
- 0x16,
- L"On Board IDE"
- },
- {
- 0x17,
- L"On Board Floppy"
- },
- {
- 0x18,
- L"9 Pin Dual Inline (pin 10 cut)"
- },
- {
- 0x19,
- L"25 Pin Dual Inline (pin 26 cut)"
- },
- {
- 0x1A,
- L"50 Pin Dual Inline"
- },
- {
- 0x1B,
- L"68 Pin Dual Inline"
- },
- {
- 0x1C,
- L"On Board Sound Input from CD-ROM"
- },
- {
- 0x1D,
- L"Mini-Centronics Type-14"
- },
- {
- 0x1E,
- L"Mini-Centronics Type-26"
- },
- {
- 0x1F,
- L"Mini-jack (headphones)"
- },
- {
- 0x20,
- L"BNC"
- },
- {
- 0x21,
- L"1394"
- },
- {
- 0x22,
- L"SAS/SATA Plug Receptacle"
- },
- {
- 0xA0,
- L"PC-98"
- },
- {
- 0xA1,
- L"PC-98Hireso"
- },
- {
- 0xA2,
- L"PC-H98"
- },
- {
- 0xA3,
- L"PC-98Note"
- },
- {
- 0xA4,
- L"PC-98Full"
- },
- {
- 0xFF,
- L"Other"
- },
-};
-
-TABLE_ITEM PortTypeTable[] = {
- {
- 0x00,
- L"None"
- },
- {
- 0x01,
- L"Parallel Port XT/AT Compatible"
- },
- {
- 0x02,
- L"Parallel Port PS/2"
- },
- {
- 0x03,
- L"Parallel Port ECP"
- },
- {
- 0x04,
- L"Parallel Port EPP"
- },
- {
- 0x05,
- L"Parallel Port ECP/EPP"
- },
- {
- 0x06,
- L"Serial Port XT/AT Compatible"
- },
- {
- 0x07,
- L"Serial Port 16450 Compatible"
- },
- {
- 0x08,
- L"Serial Port 16550 Compatible"
- },
- {
- 0x09,
- L"Serial Port 16550A Compatible"
- },
- {
- 0x0A,
- L"SCSI Port"
- },
- {
- 0x0B,
- L"MIDI Port"
- },
- {
- 0x0C,
- L"Joy Stick Port"
- },
- {
- 0x0D,
- L"Keyboard Port"
- },
- {
- 0x0E,
- L"Mouse Port"
- },
- {
- 0x0F,
- L"SSA SCSI"
- },
- {
- 0x10,
- L"USB"
- },
- {
- 0x11,
- L"FireWire (IEEE P1394)"
- },
- {
- 0x12,
- L"PCMCIA Type II"
- },
- {
- 0x13,
- L"PCMCIA Type II"
- },
- {
- 0x14,
- L"PCMCIA Type III"
- },
- {
- 0x15,
- L"Cardbus"
- },
- {
- 0x16,
- L"Access Bus Port"
- },
- {
- 0x17,
- L"SCSI II"
- },
- {
- 0x18,
- L"SCSI Wide"
- },
- {
- 0x19,
- L"PC-98"
- },
- {
- 0x1A,
- L"PC-98-Hireso"
- },
- {
- 0x1B,
- L"PC-H98"
- },
- {
- 0x1C,
- L"Video Port"
- },
- {
- 0x1D,
- L"Audio Port"
- },
- {
- 0x1E,
- L"Modem Port"
- },
- {
- 0x1F,
- L"Network Port"
- },
- {
- 0x20,
- L"SATA Port"
- },
- {
- 0x21,
- L"SAS Port"
- },
- {
- 0xA0,
- L"8251 Compatible"
- },
- {
- 0xA1,
- L"8251 FIFO Compatible"
- },
- {
- 0xFF,
- L"Other "
- },
-};
-
-TABLE_ITEM SystemSlotTypeTable[] = {
- {
- 0x01,
- L"Other"
- },
- {
- 0x02,
- L"Unknown"
- },
- {
- 0x03,
- L"ISA"
- },
- {
- 0x04,
- L"MCA"
- },
- {
- 0x05,
- L"EISA"
- },
- {
- 0x06,
- L"PCI"
- },
- {
- 0x07,
- L"PC Card (PCMCIA)"
- },
- {
- 0x08,
- L"VL-VESA"
- },
- {
- 0x09,
- L"Proprietary"
- },
- {
- 0x0A,
- L"Processor Card Slot"
- },
- {
- 0x0B,
- L"Proprietary Memory Card Slot"
- },
- {
- 0x0C,
- L"I/O Riser Card Slot"
- },
- {
- 0x0D,
- L"NuBus"
- },
- {
- 0x0E,
- L"PCI - 66MHz Capable"
- },
- {
- 0x0F,
- L"AGP"
- },
- {
- 0x10,
- L"AGP 2X"
- },
- {
- 0x11,
- L"AGP 4X"
- },
- {
- 0x12,
- L"PCI-X"
- },
- {
- 0xA0,
- L"PC-98/C20 "
- },
- {
- 0xA1,
- L"PC-98/C24 "
- },
- {
- 0xA2,
- L"PC-98/E "
- },
- {
- 0xA3,
- L"PC-98/Local Bus "
- },
- {
- 0xA4,
- L"PC-98/Card "
- },
- {
- 0xA5,
- L"PCI Express "
- },
- {
- 0xA6,
- L"PCI Express X1"
- },
- {
- 0xA7,
- L"PCI Express X2"
- },
- {
- 0xA8,
- L"PCI Express X4"
- },
- {
- 0xA9,
- L"PCI Express X8"
- },
- {
- 0xAA,
- L"PCI Express X16"
- },
- {
- 0xAB,
- L"PCI Express Gen 2"
- },
- {
- 0xAC,
- L"PCI Express Gen 2 X1"
- },
- {
- 0xAD,
- L"PCI Express Gen 2 X2"
- },
- {
- 0xAE,
- L"PCI Express Gen 2 X4"
- },
- {
- 0xAF,
- L"PCI Express Gen 2 X8"
- },
- {
- 0xB0,
- L"PCI Express Gen 2 X16"
- },
- {
- 0xB1,
- L"PCI Express Gen 3"
- },
- {
- 0xB2,
- L"PCI Express Gen 3 X1"
- },
- {
- 0xB3,
- L"PCI Express Gen 3 X2"
- },
- {
- 0xB4,
- L"PCI Express Gen 3 X4"
- },
- {
- 0xB5,
- L"PCI Express Gen 3 X8"
- },
- {
- 0xB6,
- L"PCI Express Gen 3 X16"
- }
-};
-
-TABLE_ITEM SystemSlotDataBusWidthTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" 8 bit"
- },
- {
- 0x04,
- L" 16 bit"
- },
- {
- 0x05,
- L" 32 bit"
- },
- {
- 0x06,
- L" 64 bit"
- },
- {
- 0x07,
- L" 128 bit"
- },
- {
- 0x08,
- L" 1x or x1"
- },
- {
- 0x09,
- L" 2x or x2"
- },
- {
- 0x0A,
- L" 4x or x4"
- },
- {
- 0x0B,
- L" 8x or x8"
- },
- {
- 0x0C,
- L" 12x or x12"
- },
- {
- 0x0D,
- L" 16x or x16"
- },
- {
- 0x0E,
- L" 32x or x32"
- }
-};
-
-TABLE_ITEM SystemSlotCurrentUsageTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" Available"
- },
- {
- 0x04,
- L" In use"
- },
-};
-
-TABLE_ITEM SystemSlotLengthTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" Short length"
- },
- {
- 0x04,
- L" Long Length"
- },
-};
-
-TABLE_ITEM SlotCharacteristics1Table[] = {
- {
- 0,
- L" Characteristics Unknown"
- },
- {
- 1,
- L" Provides 5.0 Volts"
- },
- {
- 2,
- L" Provides 3.3 Volts"
- },
- {
- 3,
- L" Slot's opening is shared with another slot, e.g. PCI/EISA shared slot."
- },
-
- {
- 4,
- L" PC Card slot supports PC Card-16"
- },
- {
- 5,
- L" PC Card slot supports CardBus"
- },
- {
- 6,
- L" PC Card slot supports Zoom Video "
- },
- {
- 7,
- L" PC Card slot supports Modem Ring Resume "
- }
-};
-
-TABLE_ITEM SlotCharacteristics2Table[] = {
- {
- 0,
- L" PCI slot supports Power Management Enable (PME#) signal"
- },
- {
- 1,
- L" Slot supports hot-plug devices"
- },
- {
- 2,
- L" PCI slot supports SMBus signal"
- }
-};
-
-TABLE_ITEM OnboardDeviceTypesTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" Video"
- },
- {
- 0x04,
- L" SCSI Controller"
- },
- {
- 0x05,
- L" Ethernet"
- },
- {
- 0x06,
- L" Token Ring"
- },
- {
- 0x07,
- L" Sound"
- },
- {
- 0x08,
- L" Pata Controller"
- },
- {
- 0x09,
- L" Sata Controller"
- },
- {
- 0x0A,
- L" Sas Controller"
- },
-};
-
-TABLE_ITEM SELTypesTable[] = {
- {
- 0x00,
- L" Reserved."
- },
- {
- 0x01,
- L" Single-bit ECC memory error"
- },
- {
- 0x02,
- L" Multi-bit ECC memory error"
- },
- {
- 0x03,
- L" Parity memory error"
- },
- {
- 0x04,
- L" Bus time-out"
- },
- {
- 0x05,
- L" I/O Channel Check"
- },
- {
- 0x06,
- L" Software NMI"
- },
- {
- 0x07,
- L" POST Memory Resize"
- },
- {
- 0x08,
- L" POST Error"
- },
- {
- 0x09,
- L" PCI Parity Error"
- },
- {
- 0x0A,
- L" PCI System Error"
- },
- {
- 0x0B,
- L" CPU Failure"
- },
- {
- 0x0C,
- L" EISA FailSafe Timer time-out"
- },
- {
- 0x0D,
- L" Correctable memory log disabled"
- },
- {
- 0x0E,
- L" Logging disabled for a specific Event Type"
- },
- {
- 0x0F,
- L" Reserved"
- },
- {
- 0x10,
- L" System Limit Exceeded"
- },
- {
- 0x11,
- L" Asynchronous hardware timer expired and issued a system reset"
- },
- {
- 0x12,
- L" System configuration information"
- },
- {
- 0x13,
- L" Hard-disk information"
- },
- {
- 0x14,
- L" System reconfigured"
- },
- {
- 0x15,
- L" Uncorrectable CPU-complex error"
- },
- {
- 0x16,
- L" Log Area Reset/Cleared"
- },
- {
- 0x17,
- L" System boot"
- },
- {
- 0x7F18,
- L" Unused by SMBIOS specification"
- },
- {
- 0xFE80,
- L" System and OEM specified"
- },
- {
- 0xFF,
- L" End-of-log"
- },
-};
-
-TABLE_ITEM SELVarDataFormatTypeTable[] = {
- {
- 0x00,
- L" None "
- },
- {
- 0x01,
- L" Handle "
- },
- {
- 0x02,
- L" Multiple-Event "
- },
- {
- 0x03,
- L" Multiple-Event Handle "
- },
- {
- 0x04,
- L" POST Results Bitmap "
- },
- //
- // Defined below
- //
- {
- 0x05,
- L" System Management Type"
- },
- //
- // Defined below
- //
- {
- 0x06,
- L" Multiple-Event System Management Type "
- },
- {
- 0x7F07,
- L" Unused "
- },
- {
- 0xFF80,
- L" OEM assigned "
- },
-};
-
-TABLE_ITEM PostResultsBitmapDw1Table[] = {
- {
- 0,
- L" Channel 2 Timer error "
- },
- {
- 1,
- L" Master PIC (8259 #1) error "
- },
- {
- 2,
- L" Slave PIC (8259 #2) error "
- },
- {
- 3,
- L" CMOS Battery Failure "
- },
- {
- 4,
- L" CMOS System Options Not Set "
- },
- {
- 5,
- L" CMOS Checksum Error "
- },
- {
- 6,
- L" CMOS Configuration Error "
- },
- {
- 7,
- L" Mouse and Keyboard Swapped "
- },
- {
- 8,
- L" Keyboard Locked "
- },
- {
- 9,
- L" Keyboard Not Functional "
- },
- {
- 10,
- L" Keyboard Controller Not Functional "
- },
- {
- 11,
- L" CMOS Memory Size Different "
- },
- {
- 12,
- L" Memory Decreased in Size "
- },
- {
- 13,
- L" Cache Memory Error "
- },
- {
- 14,
- L" Floppy Drive 0 Error "
- },
- {
- 15,
- L" Floppy Drive 1 Error "
- },
- {
- 16,
- L" Floppy Controller Failure "
- },
- {
- 17,
- L" Number of ATA Drives Reduced Error "
- },
- {
- 18,
- L" CMOS Time Not Set "
- },
- {
- 19,
- L" DDC Monitor Configuration Change "
- },
- {
- 20,
- L" Reserved, set to 0 "
- },
- {
- 21,
- L" Reserved, set to 0 "
- },
- {
- 22,
- L" Reserved, set to 0 "
- },
- {
- 23,
- L" Reserved, set to 0 "
- },
- {
- 24,
- L" Second DWORD has valid data "
- },
- {
- 25,
- L" Reserved, set to 0 "
- },
- {
- 26,
- L" Reserved, set to 0 "
- },
- {
- 27,
- L" Reserved, set to 0 "
- },
- {
- 28,
- L" Normally 0; available for OEM assignment "
- },
- {
- 29,
- L" Normally 0; available for OEM assignment "
- },
- {
- 30,
- L" Normally 0; available for OEM assignment "
- },
- {
- 31,
- L" Normally 0; available for OEM assignment "
- },
-};
-
-TABLE_ITEM PostResultsBitmapDw2Table[] = {
- {
- 0,
- L" Normally 0; available for OEM assignment "
- },
- {
- 1,
- L" Normally 0; available for OEM assignment "
- },
- {
- 2,
- L" Normally 0; available for OEM assignment "
- },
- {
- 3,
- L" Normally 0; available for OEM assignment "
- },
- {
- 4,
- L" Normally 0; available for OEM assignment "
- },
- {
- 5,
- L" Normally 0; available for OEM assignment "
- },
- {
- 6,
- L" Normally 0; available for OEM assignment "
- },
- {
- 7,
- L" PCI Memory Conflict "
- },
- {
- 8,
- L" PCI I/O Conflict "
- },
- {
- 9,
- L" PCI IRQ Conflict "
- },
- {
- 10,
- L" PNP Memory Conflict "
- },
- {
- 11,
- L" PNP 32 bit Memory Conflict "
- },
- {
- 12,
- L" PNP I/O Conflict "
- },
- {
- 13,
- L" PNP IRQ Conflict "
- },
- {
- 14,
- L" PNP DMA Conflict "
- },
- {
- 15,
- L" Bad PNP Serial ID Checksum "
- },
- {
- 16,
- L" Bad PNP Resource Data Checksum "
- },
- {
- 17,
- L" Static Resource Conflict "
- },
- {
- 18,
- L" NVRAM Checksum Error, NVRAM Cleared "
- },
- {
- 19,
- L" System Board Device Resource Conflict "
- },
- {
- 20,
- L" Primary Output Device Not Found "
- },
- {
- 21,
- L" Primary Input Device Not Found "
- },
- {
- 22,
- L" Primary Boot Device Not Found "
- },
- {
- 23,
- L" NVRAM Cleared By Jumper "
- },
- {
- 24,
- L" NVRAM Data Invalid, NVRAM Cleared "
- },
- {
- 25,
- L" FDC Resource Conflict "
- },
- {
- 26,
- L" Primary ATA Controller Resource Conflict "
- },
- {
- 27,
- L" Secondary ATA Controller Resource Conflict "
- },
- {
- 28,
- L" Parallel Port Resource Conflict "
- },
- {
- 29,
- L" Serial Port 1 Resource Conflict "
- },
- {
- 30,
- L" Serial Port 2 Resource Conflict "
- },
- {
- 31,
- L" Audio Resource Conflict "
- },
-};
-
-TABLE_ITEM SELSysManagementTypesTable[] = {
- {
- 0x01,
- L" +2.5V Out of range, #2 "
- },
- {
- 0x02,
- L" +3.3V Out of range "
- },
- {
- 0x03,
- L" +5V Out of range "
- },
- {
- 0x04,
- L" -5V Out of range "
- },
- {
- 0x05,
- L" +12V Out of range "
- },
- {
- 0x06,
- L" -12V Out of range "
- },
- {
- 0x0F07,
- L" Reserved for future out-of-range voltage levels "
- },
- {
- 0x10,
- L" System board temperature out of range "
- },
- {
- 0x11,
- L" Processor #1 temperature out of range "
- },
- {
- 0x12,
- L" Processor #2 temperature out of range "
- },
- {
- 0x13,
- L" Processor #3 temperature out of range "
- },
- {
- 0x14,
- L" Processor #4 temperature out of range "
- },
- {
- 0x1F15,
- L" Reserved for future out-of-range temperatures"
- },
- {
- 0x2720,
- L" Fan n (n = 0 to 7) Out of range "
- },
- {
- 0x2F28,
- L" Reserved for future assignment via this specification "
- },
- {
- 0x30,
- L" Chassis secure switch activated "
- },
-};
-
-TABLE_ITEM PMALocationTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" System board or motherboard"
- },
- {
- 0x04,
- L" ISA add-on card"
- },
- {
- 0x05,
- L" EISA add-on card"
- },
- {
- 0x06,
- L" PCI add-on card"
- },
- {
- 0x07,
- L" MCA add-on card"
- },
- {
- 0x08,
- L" PCMCIA add-on card"
- },
- {
- 0x09,
- L" Proprietary add-on card"
- },
- {
- 0x0A,
- L" NuBus"
- },
- {
- 0xA0,
- L" PC-98/C20 add-on card"
- },
- {
- 0xA1,
- L" PC-98/C24 add-on card"
- },
- {
- 0xA2,
- L" PC-98/E add-on card"
- },
- {
- 0xA3,
- L" PC-98/Local bus add-on card"
- }
-};
-
-TABLE_ITEM PMAUseTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" System memory"
- },
- {
- 0x04,
- L" Video memory"
- },
- {
- 0x05,
- L" Flash memory"
- },
- {
- 0x06,
- L" Non-volatile RAM"
- },
- {
- 0x07,
- L" Cache memory"
- }
-};
-
-TABLE_ITEM PMAErrorCorrectionTypesTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" None"
- },
- {
- 0x04,
- L" Parity"
- },
- {
- 0x05,
- L" Single-bit ECC"
- },
- {
- 0x06,
- L" Multi-bit ECC"
- },
- {
- 0x07,
- L" CRC"
- }
-};
-
-TABLE_ITEM MemoryDeviceFormFactorTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" SIMM"
- },
- {
- 0x04,
- L" SIP"
- },
- {
- 0x05,
- L" Chip"
- },
- {
- 0x06,
- L" DIP"
- },
- {
- 0x07,
- L" ZIP"
- },
- {
- 0x08,
- L" Proprietary Card"
- },
- {
- 0x09,
- L" DIMM"
- },
- {
- 0x0A,
- L" TSOP"
- },
- {
- 0x0B,
- L" Row of chips"
- },
- {
- 0x0C,
- L" RIMM"
- },
- {
- 0x0D,
- L" SODIMM"
- },
- {
- 0x0E,
- L" SRIMM"
- },
- {
- 0x0F,
- L" FB-DIMM"
- }
-};
-
-TABLE_ITEM MemoryDeviceTypeTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" DRAM"
- },
- {
- 0x04,
- L" EDRAM"
- },
- {
- 0x05,
- L" VRAM"
- },
- {
- 0x06,
- L" SRAM"
- },
- {
- 0x07,
- L" RAM"
- },
- {
- 0x08,
- L" ROM"
- },
- {
- 0x09,
- L" FLASH"
- },
- {
- 0x0A,
- L" EEPROM"
- },
- {
- 0x0B,
- L" FEPROM"
- },
- {
- 0x0C,
- L" EPROM"
- },
- {
- 0x0D,
- L" CDRAM"
- },
- {
- 0x0E,
- L" 3DRAM"
- },
- {
- 0x0F,
- L" SDRAM"
- },
- {
- 0x10,
- L" SGRAM"
- },
- {
- 0x11,
- L" RDRAM"
- },
- {
- 0x12,
- L" DDR"
- },
- {
- 0x13,
- L" DDR2"
- },
- {
- 0x14,
- L" DDR2 FB-DIMM"
- },
- {
- 0x18,
- L" DDR3"
- },
- {
- 0x19,
- L" FBD2"
- }
-};
-
-TABLE_ITEM MemoryDeviceTypeDetailTable[] = {
- {
- 1,
- L" Other"
- },
- {
- 2,
- L" Unknown"
- },
- {
- 3,
- L" Fast-paged"
- },
- {
- 4,
- L" Static column"
- },
- {
- 5,
- L" Pseudo-STATIC"
- },
- {
- 6,
- L" RAMBUS "
- },
- {
- 7,
- L" Synchronous"
- },
- {
- 8,
- L" CMOS"
- },
- {
- 9,
- L" EDO"
- },
- {
- 10,
- L" Window DRAM"
- },
- {
- 11,
- L" Cache DRAM"
- },
- {
- 12,
- L" Non-volatile"
- },
- {
- 13,
- L" Registered(Buffered)"
- },
- {
- 14,
- L" Unbuffered(Unregistered)"
- }
-};
-
-TABLE_ITEM MemoryErrorTypeTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" OK"
- },
- {
- 0x04,
- L" Bad read"
- },
- {
- 0x05,
- L" Parity error"
- },
- {
- 0x06,
- L" Single-bit error"
- },
- {
- 0x07,
- L" Double-bit error"
- },
- {
- 0x08,
- L" Multi-bit error"
- },
- {
- 0x09,
- L" Nibble error"
- },
- {
- 0x0A,
- L" Checksum error"
- },
- {
- 0x0B,
- L" CRC error"
- },
- {
- 0x0C,
- L" Corrected single-bit error"
- },
- {
- 0x0D,
- L" Corrected error"
- },
- {
- 0x0E,
- L" Uncorrectable error"
- },
-};
-
-TABLE_ITEM MemoryErrorGranularityTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" Device level"
- },
- {
- 0x04,
- L" Memory partition level"
- },
-};
-
-TABLE_ITEM MemoryErrorOperationTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" Read"
- },
- {
- 0x04,
- L" Write"
- },
- {
- 0x05,
- L" Partial Write"
- },
-};
-
-TABLE_ITEM PointingDeviceTypeTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" Mouse"
- },
- {
- 0x04,
- L" Track Ball"
- },
- {
- 0x05,
- L" Track Point"
- },
- {
- 0x06,
- L" Glide Point"
- },
- {
- 0x07,
- L" Touch Pad"
- },
-};
-
-TABLE_ITEM PointingDeviceInterfaceTable[] = {
- {
- 0x01,
- L" Other"
- },
- {
- 0x02,
- L" Unknown"
- },
- {
- 0x03,
- L" Serial"
- },
- {
- 0x04,
- L" PS/2"
- },
- {
- 0x05,
- L" Infrared"
- },
- {
- 0x06,
- L" HP-HIL"
- },
- {
- 0x07,
- L" Bus mouse"
- },
- {
- 0x08,
- L" ADB(Apple Desktop Bus"
- },
- {
- 0xA0,
- L" Bus mouse DB-9"
- },
- {
- 0xA1,
- L" Bus mouse mirco-DIN"
- },
- {
- 0xA2,
- L" USB"
- },
-};
-
-TABLE_ITEM PBDeviceChemistryTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" Lead Acid "
- },
- {
- 0x04,
- L" Nickel Cadmium "
- },
- {
- 0x05,
- L" Nickel metal hydride "
- },
- {
- 0x06,
- L" Lithium-ion "
- },
- {
- 0x07,
- L" Zinc air "
- },
- {
- 0x08,
- L" Lithium Polymer "
- },
-};
-
-TABLE_ITEM VPLocationTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" OK "
- },
- {
- 0x04,
- L" Non-critical "
- },
- {
- 0x05,
- L" Critical "
- },
- {
- 0x06,
- L" Non-recoverable "
- },
-};
-
-TABLE_ITEM VPStatusTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" Processor "
- },
- {
- 0x04,
- L" Disk "
- },
- {
- 0x05,
- L" Peripheral Bay "
- },
- {
- 0x06,
- L" System Management Module "
- },
- {
- 0x07,
- L" Motherboard "
- },
- {
- 0x08,
- L" Memory Module "
- },
- {
- 0x09,
- L" Processor Module "
- },
- {
- 0x0A,
- L" Power Unit "
- },
- {
- 0x0B,
- L" Add-in Card "
- },
-};
-
-TABLE_ITEM CoolingDeviceStatusTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" OK "
- },
- {
- 0x04,
- L" Non-critical "
- },
- {
- 0x05,
- L" Critical "
- },
- {
- 0x06,
- L" Non-recoverable "
- },
-};
-
-TABLE_ITEM CoolingDeviceTypeTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" Fan "
- },
- {
- 0x04,
- L" Centrifugal Blower "
- },
- {
- 0x05,
- L" Chip Fan "
- },
- {
- 0x06,
- L" Cabinet Fan "
- },
- {
- 0x07,
- L" Power Supply Fan "
- },
- {
- 0x08,
- L" Heat Pipe "
- },
- {
- 0x09,
- L" Integrated Refrigeration "
- },
- {
- 0x0A,
- L" Active Cooling "
- },
- {
- 0x0B,
- L" Passive Cooling "
- },
-};
-
-TABLE_ITEM TemperatureProbeStatusTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" OK "
- },
- {
- 0x04,
- L" Non-critical "
- },
- {
- 0x05,
- L" Critical "
- },
- {
- 0x06,
- L" Non-recoverable "
- },
-};
-
-TABLE_ITEM TemperatureProbeLocTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" Processor "
- },
- {
- 0x04,
- L" Disk "
- },
- {
- 0x05,
- L" Peripheral Bay "
- },
- {
- 0x06,
- L" System Management Module "
- },
- {
- 0x07,
- L" Motherboard "
- },
- {
- 0x08,
- L" Memory Module "
- },
- {
- 0x09,
- L" Processor Module "
- },
- {
- 0x0A,
- L" Power Unit "
- },
- {
- 0x0B,
- L" Add-in Card "
- },
-};
-
-TABLE_ITEM ECPStatusTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" OK "
- },
- {
- 0x04,
- L" Non-critical "
- },
- {
- 0x05,
- L" Critical "
- },
- {
- 0x06,
- L" Non-recoverable "
- },
-};
-
-TABLE_ITEM ECPLocTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" Processor "
- },
- {
- 0x04,
- L" Disk "
- },
- {
- 0x05,
- L" Peripheral Bay "
- },
- {
- 0x06,
- L" System Management Module "
- },
- {
- 0x07,
- L" Motherboard "
- },
- {
- 0x08,
- L" Memory Module "
- },
- {
- 0x09,
- L" Processor Module "
- },
- {
- 0x0A,
- L" Power Unit "
- },
- {
- 0x0B,
- L" Add-in Card "
- },
-};
-
-TABLE_ITEM MDTypeTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" National Semiconductor LM75 "
- },
- {
- 0x04,
- L" National Semiconductor LM78 "
- },
- {
- 0x05,
- L" National Semiconductor LM79 "
- },
- {
- 0x06,
- L" National Semiconductor LM80 "
- },
- {
- 0x07,
- L" National Semiconductor LM81 "
- },
- {
- 0x08,
- L" Analog Devices ADM9240 "
- },
- {
- 0x09,
- L" Dallas Semiconductor DS1780 "
- },
- {
- 0x0A,
- L" Maxim 1617 "
- },
- {
- 0x0B,
- L" Genesys GL518SM "
- },
- {
- 0x0C,
- L" Winbond W83781D "
- },
- {
- 0x0D,
- L" Holtek HT82H791 "
- },
-};
-
-TABLE_ITEM MDAddressTypeTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" I/O Port "
- },
- {
- 0x04,
- L" Memory "
- },
- {
- 0x05,
- L" SM Bus "
- },
-};
-
-TABLE_ITEM MemoryChannelTypeTable[] = {
- {
- 0x01,
- L" Other "
- },
- {
- 0x02,
- L" Unknown "
- },
- {
- 0x03,
- L" RamBus "
- },
- {
- 0x04,
- L" SyncLink "
- },
-};
-
-TABLE_ITEM IPMIDIBMCInterfaceTypeTable[] = {
- {
- 0x00,
- L" Unknown "
- },
- {
- 0x01,
- L" KCS: Keyboard Controller Style "
- },
- {
- 0x02,
- L" SMIC: Server Management Interface Chip "
- },
- {
- 0x03,
- L" BT: Block Transfer "
- },
- {
- 0xFF04,
- L" Reserved for future assignment by this specification "
- },
-};
-
-TABLE_ITEM StructureTypeInfoTable[] = {
- {
- 0,
- L" BIOS Information"
- },
- {
- 1,
- L" System Information"
- },
- {
- 2,
- L" Base Board Information"
- },
- {
- 3,
- L" System Enclosure"
- },
- {
- 4,
- L" Processor Information"
- },
- {
- 5,
- L" Memory Controller Information "
- },
- {
- 6,
- L" Memory Module Information "
- },
- {
- 7,
- L" Cache Information "
- },
- {
- 8,
- L" Port Connector Information "
- },
- {
- 9,
- L" System Slots "
- },
- {
- 10,
- L" On Board Devices Information "
- },
- {
- 11,
- L" OEM Strings"
- },
- {
- 12,
- L" System Configuration Options "
- },
- {
- 13,
- L" BIOS Language Information "
- },
- {
- 14,
- L" Group Associations "
- },
- {
- 15,
- L" System Event Log "
- },
- {
- 16,
- L" Physical Memory Array "
- },
- {
- 17,
- L" Memory Device "
- },
- {
- 18,
- L" 32-bit Memory Error Information "
- },
- {
- 19,
- L" Memory Array Mapped Address "
- },
- {
- 20,
- L" Memory Device Mapped Address "
- },
- {
- 21,
- L" Built-in Pointing Device "
- },
- {
- 22,
- L" Portable Battery "
- },
- {
- 23,
- L" System Reset "
- },
- {
- 24,
- L" Hardware Security "
- },
- {
- 25,
- L" System Power Controls "
- },
- {
- 26,
- L" Voltage Probe "
- },
- {
- 27,
- L" Cooling Device "
- },
- {
- 28,
- L" Temperature Probe "
- },
- {
- 29,
- L" Electrical Current Probe "
- },
- {
- 30,
- L" Out-of-Band Remote Access "
- },
- {
- 31,
- L" Boot Integrity Services (BIS) Entry Point"
- },
- {
- 32,
- L" System Boot Information "
- },
- {
- 33,
- L" 64-bit Memory Error Information "
- },
- {
- 34,
- L" Management Device "
- },
- {
- 35,
- L" Management Device Component "
- },
- {
- 36,
- L" Management Device Threshold Data "
- },
- {
- 37,
- L" Memory Channel "
- },
- {
- 38,
- L" IPMI Device Information "
- },
- {
- 39,
- L" System Power Supply"
- },
- {
- 40,
- L" Additional Information"
- },
- {
- 41,
- L" Onboard Devices Extended Information"
- },
- {
- 42,
- L" Management Controller Host Interface"
- },
- {
- 0x7E,
- L" Inactive"
- },
- {
- 0x7F,
- L" End-of-Table "
- },
-};
-
-
-/**
- Given a table and a Key, return the responding info.
-
- Notes:
- Table[Index].Key is change from UINT8 to UINT16,
- in order to deal with "0xaa - 0xbb".
-
- For example:
- DisplaySELVariableDataFormatTypes(UINT8 Type, UINT8 Option)
- has a item:
- "0x07-0x7F, Unused"
- Now define Key = 0x7F07, that is to say: High = 0x7F, Low = 0x07.
- Then all the Key Value between Low and High gets the same string
- L"Unused".
-
- @param[in] Table The begin address of table.
- @param[in] Number The number of table items.
- @param[in] Key The query Key.
- @param[in, out] Info Input as empty buffer; output as data buffer.
- @param[in] InfoLen The max number of characters for Info.
-
- @return the found Key and Info is valid.
- @retval QUERY_TABLE_UNFOUND and Info should be NULL.
-**/
-UINT8
-QueryTable (
- IN TABLE_ITEM *Table,
- IN UINTN Number,
- IN UINT8 Key,
- IN OUT CHAR16 *Info,
- IN UINTN InfoLen
- )
-{
- UINTN Index;
- //
- // High byte and Low byte of word
- //
- UINT8 High;
- UINT8 Low;
-
- for (Index = 0; Index < Number; Index++) {
- High = (UINT8) (Table[Index].Key >> 8);
- Low = (UINT8) (Table[Index].Key & 0x00FF);
- //
- // Check if Key is in the range
- //
- if (High > Low && Key >= Low && Key <= High) {
- StrnCpy (Info, Table[Index].Info, InfoLen-1);
- StrnCat (Info, L"\n", InfoLen - StrLen(Info));
- return Key;
- }
- //
- // Check if Key == Value in the table
- //
- if (Table[Index].Key == Key) {
- StrnCpy (Info, Table[Index].Info, InfoLen-1);
- StrnCat (Info, L"\n", InfoLen - StrLen(Info));
- return Key;
- }
- }
-
- StrnCpy (Info, L"Undefined Value\n", InfoLen);
- return QUERY_TABLE_UNFOUND;
-}
-
-/**
- Given a table of bit info and a Key, return the responding info to the Key.
-
- @param[in] Table Point to a table which maintains a map of 'bit' to 'message'.
- @param[in] Number Number of table items.
- @param[in] Bits The Key of query the bit map information.
-**/
-VOID
-PrintBitsInfo (
- IN TABLE_ITEM *Table,
- IN UINTN Number,
- IN UINT32 Bits
- )
-{
- //
- // Get certain bit of 'Value':
- //
-#define BIT(Value, bit) ((Value) & ((UINT32) 1) << (bit))
- //
- // Clear certain bit of 'Value':
- //
-#define CLR_BIT(Value, bit) ((Value) -= (BIT (Value, bit)))
-
- UINTN Index;
- UINT32 Value;
- BOOLEAN NoInfo;
-
- NoInfo = TRUE;
- Value = Bits;
- //
- // query the table and print information
- //
- for (Index = 0; Index < Number; Index++) {
- if (BIT (Value, Table[Index].Key) != 0) {
- Print (Table[Index].Info);
- Print (L" | ");
-
- NoInfo = FALSE;
- //
- // clear the bit, for reserved bits test
- //
- CLR_BIT (Value, Table[Index].Key);
- }
- }
-
- if (NoInfo) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_NO_INFO), gShellDebug1HiiHandle);
- }
-
- if (Value != 0) {
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_RSVD_BITS_SET),
- gShellDebug1HiiHandle,
- Value
- );
- }
-
- Print (L"\n");
-}
-//
-// //////////////////////////////////////////////////////////////////
-//
-// Following uses QueryTable functions to simplify the coding.
-// QueryTable(), PrintBitsInfo()
-//
-//
-#define PRINT_TABLE_ITEM(Table, Key) \
- do { \
- UINTN Num; \
- CHAR16 Info[66]; \
- Num = sizeof (Table) / sizeof (TABLE_ITEM); \
- ZeroMem (Info, sizeof (Info)); \
- QueryTable (Table, Num, Key, Info, sizeof(Info)/sizeof(Info[0])); \
- Print (Info); \
- } while (0);
-
-#define PRINT_BITS_INFO(Table, bits) \
- do { \
- UINTN Num; \
- Num = sizeof (Table) / sizeof (TABLE_ITEM); \
- PrintBitsInfo (Table, Num, (UINT32) bits); \
- } while (0);
-
-/**
- Display System Information (Type 1) Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemWakeupType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_WAKEUP_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (SystemWakeupTypeTable, Type);
-}
-
-/**
- Display Base Board (Type 2) Feature Flags.
-
- @param[in] FeatureFlags The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayBaseBoardFeatureFlags (
- IN UINT8 FeatureFlags,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BASE_BOARD_FEATURE_FLAGS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (FeatureFlags, Option);
- PRINT_BITS_INFO (BaseBoardFeatureFlagsTable, FeatureFlags);
-}
-
-/**
- Display Base Board (Type 2) Board Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayBaseBoardBoardType(
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BASE_BOARD_BOARD_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (BaseBoardBoardTypeTable, Type);
-}
-
-/**
- Display System Enclosure (Type 3) Enclosure Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemEnclosureType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- //
- // query table and print info
- //
- PRINT_TABLE_ITEM (SystemEnclosureTypeTable, Type);
-
- if (BIT (Type, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CHASSIS_LOCK_PRESENT), gShellDebug1HiiHandle);
- }
-}
-
-/**
- Display System Enclosure (Type 3) Enclosure Status.
-
- @param[in] Status The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemEnclosureStatus (
- IN UINT8 Status,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_STATUS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Status, Option);
- PRINT_TABLE_ITEM (SystemEnclosureStatusTable, Status);
-}
-
-/**
- Display System Enclosure (Type 3) Security Status.
-
- @param[in] Status The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySESecurityStatus (
- IN UINT8 Status,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_SECURITY), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Status, Option);
- PRINT_TABLE_ITEM (SESecurityStatusTable, Status);
-}
-
-/**
- Display Processor Information (Type 4) Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayProcessorType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (ProcessorTypeTable, Type);
-}
-
-/**
- Display Processor Information (Type 4) Upgrade.
-
- @param[in] Upgrade The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayProcessorUpgrade (
- IN UINT8 Upgrade,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_UPDATE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Upgrade, Option);
- PRINT_TABLE_ITEM (ProcessorUpgradeTable, Upgrade);
-}
-
-/**
- Display Processor Information (Type 4) Characteristics.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayProcessorCharacteristics (
- IN UINT16 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_CHARACTERISTICS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_BITS_INFO (ProcessorCharacteristicsTable, Type);
-}
-
-/**
- Display Memory Controller Information (Type 5) method.
-
- @param[in] Method The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMcErrorDetectMethod (
- IN UINT8 Method,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DETECTMETHOD), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Method, Option);
- PRINT_TABLE_ITEM (McErrorDetectMethodTable, Method);
-}
-
-/**
- Display Memory Controller Information (Type 5) Capability.
-
- @param[in] Capability The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMcErrorCorrectCapability (
- IN UINT8 Capability,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_CORRECT_CAPABILITY), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Capability, Option);
- PRINT_BITS_INFO (McErrorCorrectCapabilityTable, Capability);
-}
-
-/**
- Display Memory Controller Information (Type 5) Support.
-
- @param[in] Support The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMcInterleaveSupport (
- IN UINT8 Support,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_INTERLEAVE_SUPPORT), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Support, Option);
- PRINT_TABLE_ITEM (McInterleaveSupportTable, Support);
-}
-
-/**
- Display Memory Controller Information (Type 5) speeds.
-
- @param[in] Speed The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMcMemorySpeeds (
- IN UINT16 Speed,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MEMORY_SPEED), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Speed, Option);
- PRINT_BITS_INFO (McMemorySpeedsTable, Speed);
-}
-
-/**
- Display Memory Controller Information (Type 5) voltage.
-
- @param[in] Voltage The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryModuleVoltage (
- IN UINT8 Voltage,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_REQUIRED_VOLTAGES), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Voltage, Option);
- PRINT_BITS_INFO (MemoryModuleVoltageTable, Voltage);
-}
-
-/**
- Display Memory Module Information (Type 6) type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMmMemoryType (
- IN UINT16 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MODULE_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_BITS_INFO (MmMemoryTypeTable, Type);
-}
-
-/**
- Display Memory Module Information (Type 6) status.
-
- @param[in] Status The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMmErrorStatus (
- IN UINT8 Status,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MODULE_ERROR_STATUS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Status, Option);
- PRINT_BITS_INFO (MmErrorStatusTable, Status);
-}
-
-/**
- Display Cache Information (Type 7) SRAM Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCacheSRAMType (
- IN UINT16 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_SRAM_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION ((UINT8) Type, Option);
- PRINT_BITS_INFO (CacheSRAMTypeTable, (UINT8) Type);
-}
-
-/**
- Display Cache Information (Type 7) correcting Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCacheErrCorrectingType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_ERROR_CORRECTING), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (CacheErrCorrectingTypeTable, Type);
-}
-
-/**
- Display Cache Information (Type 7) Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCacheSystemCacheType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_SYSTEM_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (CacheSystemCacheTypeTable, Type);
-}
-
-/**
- Display Cache Information (Type 7) Associativity.
-
- @param[in] Associativity The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCacheAssociativity (
- IN UINT8 Associativity,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_ASSOCIATIVITY), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Associativity, Option);
- PRINT_TABLE_ITEM (CacheAssociativityTable, Associativity);
-}
-
-/**
- Display Port Connector Information (Type 8) type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPortConnectorType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORT_CONNECTOR_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (PortConnectorTypeTable, Type);
-}
-
-/**
- Display Port Connector Information (Type 8) port type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPortType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORT_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (PortTypeTable, Type);
-}
-
-/**
- Display System Slots (Type 9) slot type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemSlotType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (SystemSlotTypeTable, Type);
-}
-
-/**
- Display System Slots (Type 9) data bus width.
-
- @param[in] Width The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemSlotDataBusWidth (
- IN UINT8 Width,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_DATA), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Width, Option);
- PRINT_TABLE_ITEM (SystemSlotDataBusWidthTable, Width);
-}
-
-/**
- Display System Slots (Type 9) usage information.
-
- @param[in] Usage The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemSlotCurrentUsage (
- IN UINT8 Usage,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_CURRENT_USAGE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Usage, Option);
- PRINT_TABLE_ITEM (SystemSlotCurrentUsageTable, Usage);
-}
-
-/**
- Display System Slots (Type 9) slot length.
-
- @param[in] Length The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemSlotLength (
- IN UINT8 Length,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_LENGTH), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Length, Option);
- PRINT_TABLE_ITEM (SystemSlotLengthTable, Length);
-}
-
-/**
- Display System Slots (Type 9) characteristics.
-
- @param[in] Chara1 The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySlotCharacteristics1 (
- IN UINT8 Chara1,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SLOT_CHARACTERISTICS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Chara1, Option);
- PRINT_BITS_INFO (SlotCharacteristics1Table, Chara1);
-}
-
-/**
- Display System Slots (Type 9) characteristics.
-
- @param[in] Chara2 The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySlotCharacteristics2 (
- IN UINT8 Chara2,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SLOT_CHARACTERISTICS_2), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Chara2, Option);
- PRINT_BITS_INFO (SlotCharacteristics2Table, Chara2);
-}
-
-/**
- Display On Board Devices Information (Type 10) types.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayOnboardDeviceTypes (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_ONBOARD_DEVICE_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (OnboardDeviceTypesTable, Type);
-}
-
-/**
- Display System Event Log (Type 15) types.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySELTypes (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_EVENT_LOG_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (SELTypesTable, Type);
-}
-
-/**
- Display System Event Log (Type 15) format type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySELVarDataFormatType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_EVENT_LOG_VAR_DATA_FORMAT), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (SELVarDataFormatTypeTable, Type);
-}
-
-/**
- Display System Event Log (Type 15) dw1.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPostResultsBitmapDw1 (
- IN UINT32 Key,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POST_RESULTS_BITMAP), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
- PRINT_BITS_INFO (PostResultsBitmapDw1Table, Key);
-}
-
-/**
- Display System Event Log (Type 15) dw2.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPostResultsBitmapDw2 (
- IN UINT32 Key,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POST_RESULTS_SECOND_DWORD), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
- PRINT_BITS_INFO (PostResultsBitmapDw2Table, Key);
-}
-
-/**
- Display System Event Log (Type 15) type.
-
- @param[in] SMType The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySELSysManagementTypes (
- IN UINT32 SMType,
- IN UINT8 Option
- )
-{
- UINT8 Temp;
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_MANAGEMENT_TYPES), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (SMType, Option);
-
- //
- // Deal with wide range Value
- //
- if (SMType >= 0x80000000) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_OEM_ASSIGNED), gShellDebug1HiiHandle);
- } else if (SMType >= 0x00020000) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_RSVD_FOR_FUTURE_ASSIGN), gShellDebug1HiiHandle);
- } else if (SMType >= 0x00010000) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_MANAGEMENT_PROBE), gShellDebug1HiiHandle);
- } else if (SMType >= 0x31) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_RSVD_FOR_FUTURE_ASSIGN), gShellDebug1HiiHandle);
- } else {
- //
- // Deal with One byte data
- //
- Temp = (UINT8) (SMType & 0x3F);
- PRINT_TABLE_ITEM (SELSysManagementTypesTable, Temp);
- }
-}
-
-/**
- Display Physical Memory Array (Type 16) Location.
-
- @param[in] Location The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPMALocation (
- IN UINT8 Location,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_LOCATION), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Location, Option);
- PRINT_TABLE_ITEM (PMALocationTable, Location);
-}
-
-/**
- Display Physical Memory Array (Type 16) Use.
-
- @param[in] Use The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPMAUse (
- IN UINT8 Use,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_LOCATION), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Use, Option);
- PRINT_TABLE_ITEM (PMAUseTable, Use);
-}
-
-/**
- Display Physical Memory Array (Type 16) Types.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPMAErrorCorrectionTypes (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_ERROR), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (PMAErrorCorrectionTypesTable, Type);
-}
-
-/**
- Display Memory Device (Type 17) form factor.
-
- @param[in] FormFactor The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryDeviceFormFactor (
- IN UINT8 FormFactor,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_FORM_FACTOR), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (FormFactor, Option);
- PRINT_TABLE_ITEM (MemoryDeviceFormFactorTable, FormFactor);
-}
-
-/**
- Display Memory Device (Type 17) type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryDeviceType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (MemoryDeviceTypeTable, Type);
-}
-
-/**
- Display Memory Device (Type 17) details.
-
- @param[in] Para The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryDeviceTypeDetail (
- IN UINT16 Para,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_TYPE_DETAIL), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Para, Option);
- PRINT_BITS_INFO (MemoryDeviceTypeDetailTable, Para);
-}
-
-/**
- Display 32-bit Memory Error Information (Type 18) type.
-
- @param[in] ErrorType The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryErrorType (
- IN UINT8 ErrorType,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_INFO), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (ErrorType, Option);
- PRINT_TABLE_ITEM (MemoryErrorTypeTable, ErrorType);
-}
-
-/**
- Display 32-bit Memory Error Information (Type 18) error granularity.
-
- @param[in] Granularity The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryErrorGranularity (
- IN UINT8 Granularity,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_GRANULARITY), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Granularity, Option);
- PRINT_TABLE_ITEM (MemoryErrorGranularityTable, Granularity);
-}
-
-/**
- Display 32-bit Memory Error Information (Type 18) error information.
-
- @param[in] Operation The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryErrorOperation (
- IN UINT8 Operation,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_OP), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Operation, Option);
- PRINT_TABLE_ITEM (MemoryErrorOperationTable, Operation);
-}
-
-/**
- Display Built-in Pointing Device (Type 21) type information.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPointingDeviceType (
- IN UINT8 Type,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POINTING_DEVICE_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (PointingDeviceTypeTable, Type);
-}
-
-/**
- Display Built-in Pointing Device (Type 21) information.
-
- @param[in] Interface The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPointingDeviceInterface (
- IN UINT8 Interface,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POINTING_DEVICE_INTERFACE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Interface, Option);
- PRINT_TABLE_ITEM (PointingDeviceInterfaceTable, Interface);
-}
-
-/**
- Display Portable Battery (Type 22) information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPBDeviceChemistry (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORTABLE_BATT_DEV_CHEM), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
- PRINT_TABLE_ITEM (PBDeviceChemistryTable, Key);
-}
-
-/**
- Display Voltage Probe (Type 26) location information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayVPLocation (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- UINT8 Loc;
-
- Loc = (UINT8) ((Key & 0xE0) >> 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_VOLTAGE_PROBE_LOC), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Loc, Option);
- PRINT_TABLE_ITEM (VPLocationTable, Loc);
-}
-
-/**
- Display Voltage Probe (Type 26) status ype information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayVPStatus (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- UINT8 Status;
-
- Status = (UINT8) (Key & 0x1F);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_VOLTAGE_PROBE_STATUS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Status, Option);
- PRINT_TABLE_ITEM (VPStatusTable, Status);
-}
-
-/**
- Display Cooling (Type 27) status information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCoolingDeviceStatus (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- UINT8 Status;
-
- Status = (UINT8) ((Key & 0xE0) >> 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_COOLING_DEV_STATUS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Status, Option);
- PRINT_TABLE_ITEM (CoolingDeviceStatusTable, Status);
-}
-
-/**
- Display Cooling (Type 27) type information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCoolingDeviceType (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- UINT8 Type;
-
- Type = (UINT8) (Key & 0x1F);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_COOLING_DEV_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Type, Option);
- PRINT_TABLE_ITEM (CoolingDeviceTypeTable, Type);
-}
-
-/**
- Display Temperature Probe (Type 28) status information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayTemperatureProbeStatus (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- UINT8 Status;
-
- Status = (UINT8) ((Key & 0xE0) >> 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_TEMP_PROBE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Status, Option);
- PRINT_TABLE_ITEM (TemperatureProbeStatusTable, Status);
-}
-
-/**
- Display Temperature Probe (Type 28) location information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayTemperatureProbeLoc (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- UINT8 Loc;
-
- Loc = (UINT8) (Key & 0x1F);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_VOLTAGE_PROBE_LOC), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Loc, Option);
- PRINT_TABLE_ITEM (TemperatureProbeLocTable, Loc);
-}
-
-/**
- Display Electrical Current Probe (Type 29) status information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayECPStatus (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- UINT8 Status;
-
- Status = (UINT8) ((Key & 0xE0) >> 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_ELEC_PROBE_STATUS), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Status, Option);
- PRINT_TABLE_ITEM (ECPStatusTable, Status);
-}
-
-/**
- Display Type 29 information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayECPLoc (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- UINT8 Loc;
-
- Loc = (UINT8) (Key & 0x1F);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_ELEC_PROBE_LOC), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Loc, Option);
- PRINT_TABLE_ITEM (ECPLocTable, Loc);
-}
-
-/**
- Display Management Device (Type 34) Type.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMDType (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MANAGEMENT_DEV_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
- PRINT_TABLE_ITEM (MDTypeTable, Key);
-}
-
-/**
- Display Management Device (Type 34) Address Type.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMDAddressType (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MANAGEMENT_DEV_ADDR_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
- PRINT_TABLE_ITEM (MDAddressTypeTable, Key);
-}
-
-/**
- Display Memory Channel (Type 37) information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryChannelType (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_CHANNEL_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
- PRINT_TABLE_ITEM (MemoryChannelTypeTable, Key);
-}
-
-/**
- Display IPMI Device Information (Type 38) information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayIPMIDIBMCInterfaceType (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BMC_INTERFACE_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
- PRINT_TABLE_ITEM (IPMIDIBMCInterfaceTypeTable, Key);
-}
-
-/**
- Display the structure type information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayStructureTypeInfo (
- IN UINT8 Key,
- IN UINT8 Option
- )
-{
- //
- // display
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_STRUCT_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
- PRINT_TABLE_ITEM (StructureTypeInfoTable, Key);
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
deleted file mode 100644
index 9cae7094fb..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
+++ /dev/null
@@ -1,782 +0,0 @@
-/** @file
- Build a table, each item is (key, info) pair.
- and give a interface of query a string out of a table.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SMBIOS_QUERY_TABLE_H_
-#define _SMBIOS_QUERY_TABLE_H_
-
-#define QUERY_TABLE_UNFOUND 0xFF
-
-typedef struct TABLE_ITEM {
- UINT16 Key;
- CHAR16 *Info;
-} TABLE_ITEM;
-
-//
-// Print info by option
-//
-#define PRINT_INFO_OPTION(Value, Option) \
- do { \
- if (Option == SHOW_NONE) { \
- return ; \
- } \
- if (Option < SHOW_DETAIL) { \
- Print (L"0x%x\n", Value); \
- return ; \
- } \
- } while (0);
-
-/**
- Given a table and a Key, return the responding info.
-
- Notes:
- Table[Index].Key is change from UINT8 to UINT16,
- in order to deal with "0xaa - 0xbb".
-
- For example:
- DisplaySELVariableDataFormatTypes(UINT8 Type, UINT8 Option)
- has a item:
- "0x07-0x7F, Unused"
- Now define Key = 0x7F07, that is to say: High = 0x7F, Low = 0x07.
- Then all the Key Value between Low and High gets the same string
- L"Unused".
-
- @param[in] Table The begin address of table.
- @param[in] Number The number of table items.
- @param[in] Key The query Key.
- @param[in, out] Info Input as empty buffer; output as data buffer.
- @param[in] InfoLen The max number of characters for Info.
-
- @return the found Key and Info is valid.
- @retval QUERY_TABLE_UNFOUND and Info should be NULL.
-**/
-UINT8
-QueryTable (
- IN TABLE_ITEM *Table,
- IN UINTN Number,
- IN UINT8 Key,
- IN OUT CHAR16 *Info,
- IN UINTN InfoLen
- );
-
-/**
- Display the structure type information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayStructureTypeInfo (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display System Information (Type 1) Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemWakeupType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display Base Board (Type 2) Feature Flags.
-
- @param[in] FeatureFlags The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayBaseBoardFeatureFlags (
- IN UINT8 FeatureFlags,
- IN UINT8 Option
- );
-
-/**
- Display Base Board (Type 2) Board Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayBaseBoardBoardType(
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display System Enclosure (Type 3) Enclosure Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemEnclosureType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display System Enclosure (Type 3) Enclosure Status.
-
- @param[in] Status The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemEnclosureStatus (
- IN UINT8 Status,
- IN UINT8 Option
- );
-
-/**
- Display System Enclosure (Type 3) Security Status.
-
- @param[in] Status The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySESecurityStatus (
- IN UINT8 Status,
- IN UINT8 Option
- )
-;
-
-/**
- Display Processor Information (Type 4) Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayProcessorType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display Processor Information (Type 4) Upgrade.
-
- @param[in] Upgrade The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayProcessorUpgrade (
- IN UINT8 Upgrade,
- IN UINT8 Option
- );
-
-/**
- Display Processor Information (Type 4) Characteristics.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayProcessorCharacteristics (
- IN UINT16 Type,
- IN UINT8 Option
- );
-
-/**
- Display Memory Controller Information (Type 5) method.
-
- @param[in] Method The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMcErrorDetectMethod (
- IN UINT8 Method,
- IN UINT8 Option
- );
-
-/**
- Display Memory Controller Information (Type 5) Capability.
-
- @param[in] Capability The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMcErrorCorrectCapability (
- IN UINT8 Capability,
- IN UINT8 Option
- );
-
-/**
- Display Memory Controller Information (Type 5) Support.
-
- @param[in] Support The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMcInterleaveSupport (
- IN UINT8 Support,
- IN UINT8 Option
- );
-
-/**
- Display Memory Controller Information (Type 5) speeds.
-
- @param[in] Speed The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMcMemorySpeeds (
- IN UINT16 Speed,
- IN UINT8 Option
- );
-
-/**
- Display Memory Controller Information (Type 5) voltage.
-
- @param[in] Voltage The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryModuleVoltage (
- IN UINT8 Voltage,
- IN UINT8 Option
- );
-
-/**
- Display Memory Module Information (Type 6) type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMmMemoryType (
- IN UINT16 Type,
- IN UINT8 Option
- );
-
-/**
- Display Memory Module Information (Type 6) status.
-
- @param[in] Status The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMmErrorStatus (
- IN UINT8 Status,
- IN UINT8 Option
- );
-
-/**
- Display Cache Information (Type 7) SRAM Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCacheSRAMType (
- IN UINT16 Type,
- IN UINT8 Option
- );
-
-/**
- Display Cache Information (Type 7) correcting Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCacheErrCorrectingType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display Cache Information (Type 7) Type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCacheSystemCacheType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display Cache Information (Type 7) Associativity.
-
- @param[in] Associativity The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCacheAssociativity (
- IN UINT8 Associativity,
- IN UINT8 Option
- );
-
-/**
- Display Port Connector Information (Type 8) type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPortConnectorType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display Port Connector Information (Type 8) port type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPortType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display System Slots (Type 9) slot type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemSlotType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display System Slots (Type 9) data bus width.
-
- @param[in] Width The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemSlotDataBusWidth (
- IN UINT8 Width,
- IN UINT8 Option
- );
-
-/**
- Display System Slots (Type 9) usage information.
-
- @param[in] Usage The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemSlotCurrentUsage (
- IN UINT8 Usage,
- IN UINT8 Option
- );
-
-/**
- Display System Slots (Type 9) slot length.
-
- @param[in] Length The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySystemSlotLength (
- IN UINT8 Length,
- IN UINT8 Option
- );
-
-/**
- Display System Slots (Type 9) characteristics.
-
- @param[in] Chara1 The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySlotCharacteristics1 (
- IN UINT8 Chara1,
- IN UINT8 Option
- );
-
-/**
- Display System Slots (Type 9) characteristics.
-
- @param[in] Chara2 The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySlotCharacteristics2 (
- IN UINT8 Chara2,
- IN UINT8 Option
- );
-
-/**
- Display On Board Devices Information (Type 10) types.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayOnboardDeviceTypes (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display System Event Log (Type 15) types.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySELTypes (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display System Event Log (Type 15) format type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySELVarDataFormatType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display System Event Log (Type 15) dw1.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPostResultsBitmapDw1 (
- IN UINT32 Key,
- IN UINT8 Option
- );
-
-/**
- Display System Event Log (Type 15) dw2.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPostResultsBitmapDw2 (
- IN UINT32 Key,
- IN UINT8 Option
- );
-
-/**
- Display System Event Log (Type 15) type.
-
- @param[in] SMType The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplaySELSysManagementTypes (
- IN UINT32 SMType,
- IN UINT8 Option
- );
-
-/**
- Display Physical Memory Array (Type 16) Location.
-
- @param[in] Location The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPMALocation (
- IN UINT8 Location,
- IN UINT8 Option
- );
-
-/**
- Display Physical Memory Array (Type 16) Use.
-
- @param[in] Use The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPMAUse (
- IN UINT8 Use,
- IN UINT8 Option
- );
-
-/**
- Display Physical Memory Array (Type 16) Types.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPMAErrorCorrectionTypes (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display Memory Device (Type 17) form factor.
-
- @param[in] FormFactor The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryDeviceFormFactor (
- IN UINT8 FormFactor,
- IN UINT8 Option
- );
-
-/**
- Display Memory Device (Type 17) type.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryDeviceType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display Memory Device (Type 17) details.
-
- @param[in] Para The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryDeviceTypeDetail (
- IN UINT16 Para,
- IN UINT8 Option
- );
-
-/**
- Display 32-bit Memory Error Information (Type 18) type.
-
- @param[in] ErrorType The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryErrorType (
- IN UINT8 ErrorType,
- IN UINT8 Option
- );
-
-/**
- Display 32-bit Memory Error Information (Type 18) error granularity.
-
- @param[in] Granularity The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryErrorGranularity (
- IN UINT8 Granularity,
- IN UINT8 Option
- );
-
-/**
- Display 32-bit Memory Error Information (Type 18) error information.
-
- @param[in] Operation The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryErrorOperation (
- IN UINT8 Operation,
- IN UINT8 Option
- );
-
-/**
- Display Built-in Pointing Device (Type 21) type information.
-
- @param[in] Type The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPointingDeviceType (
- IN UINT8 Type,
- IN UINT8 Option
- );
-
-/**
- Display Built-in Pointing Device (Type 21) information.
-
- @param[in] Interface The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPointingDeviceInterface (
- IN UINT8 Interface,
- IN UINT8 Option
- );
-
-/**
- Display Portable Battery (Type 22) information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayPBDeviceChemistry (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Voltage Probe (Type 26) location information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayVPLocation (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Voltage Probe (Type 26) status ype information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayVPStatus (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Cooling (Type 27) status information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCoolingDeviceStatus (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Cooling (Type 27) type information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayCoolingDeviceType (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Temperature Probe (Type 28) status information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayTemperatureProbeStatus (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Temperature Probe (Type 28) location information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayTemperatureProbeLoc (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Electrical Current Probe (Type 29) status information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayECPStatus (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Electrical Current Probe (Type 29) location information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayECPLoc (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Management Device (Type 34) Type.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMDType (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Management Device (Type 34) Address Type.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMDAddressType (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display Memory Channel (Type 37) information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayMemoryChannelType (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-/**
- Display IPMI Device Information (Type 38) information.
-
- @param[in] Key The key of the structure.
- @param[in] Option The optional information.
-**/
-VOID
-DisplayIPMIDIBMCInterfaceType (
- IN UINT8 Key,
- IN UINT8 Option
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
deleted file mode 100644
index 95627a545c..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
+++ /dev/null
@@ -1,543 +0,0 @@
-/** @file
- Tools of clarify the content of the smbios table.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "../UefiShellDebug1CommandsLib.h"
-#include "LibSmbiosView.h"
-#include "SmbiosView.h"
-#include "PrintInfo.h"
-#include "QueryTable.h"
-
-UINT8 gShowType = SHOW_DETAIL;
-STATIC STRUCTURE_STATISTICS *mStatisticsTable = NULL;
-
-UINT8 SmbiosMajorVersion;
-UINT8 SmbiosMinorVersion;
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-t", TypeValue},
- {L"-h", TypeValue},
- {L"-s", TypeFlag},
- {L"-a", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'smbiosview' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunSmbiosView (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- UINT8 StructType;
- UINT16 StructHandle;
- EFI_STATUS Status;
- BOOLEAN RandomView;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Temp;
-
- mStatisticsTable = NULL;
- Package = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetValue(Package, L"-t") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"-t");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetValue(Package, L"-h") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"-h");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (
- (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-h")) ||
- (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-s")) ||
- (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-a")) ||
- (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetFlag(Package, L"-s")) ||
- (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetFlag(Package, L"-a")) ||
- (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-a"))
- ) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
-
- //
- // Init Lib
-
- Status = LibSmbiosInit ();
- if (EFI_ERROR (Status)) {
- ShellStatus = SHELL_NOT_FOUND;
- goto Done;
- }
- //
- // build statistics table
- //
- Status = InitSmbiosTableStatistics ();
- if (EFI_ERROR (Status)) {
- ShellStatus = SHELL_NOT_FOUND;
- goto Done;
- }
-
- StructType = STRUCTURE_TYPE_RANDOM;
- RandomView = TRUE;
- //
- // Initialize the StructHandle to be the first handle
- //
- StructHandle = INVALID_HANDLE;
- LibGetSmbiosStructure (&StructHandle, NULL, NULL);
-
- Temp = ShellCommandLineGetValue(Package, L"-t");
- if (Temp != NULL) {
- StructType = (UINT8) ShellStrToUintn (Temp);
- }
-
- Temp = ShellCommandLineGetValue(Package, L"-h");
- if (Temp != NULL) {
- RandomView = FALSE;
- StructHandle = (UINT16) ShellStrToUintn(Temp);
- }
-
- if (ShellCommandLineGetFlag(Package, L"-s")) {
- Status = DisplayStatisticsTable (SHOW_DETAIL);
- if (EFI_ERROR(Status)) {
- ShellStatus = SHELL_NOT_FOUND;
- }
- goto Done;
- }
-
- if (ShellCommandLineGetFlag(Package, L"-a")) {
- gShowType = SHOW_ALL;
- }
- //
- // Show SMBIOS structure information
- //
- Status = SMBiosView (StructType, StructHandle, gShowType, RandomView);
- if (EFI_ERROR(Status)) {
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- }
-Done:
- //
- // Release resources
- //
- if (mStatisticsTable != NULL) {
- //
- // Release statistics table
- //
- FreePool (mStatisticsTable);
- mStatisticsTable = NULL;
- }
-
- if (Package != NULL) {
- ShellCommandLineFreeVarList (Package);
- }
-
- LibSmbiosCleanup ();
-
- return ShellStatus;
-}
-
-/**
- Query all structures Data from SMBIOS table and Display
- the information to users as required display option.
-
- @param[in] QueryType Structure type to view.
- @param[in] QueryHandle Structure handle to view.
- @param[in] Option Display option: none,outline,normal,detail.
- @param[in] RandomView Support for -h parameter.
-
- @retval EFI_SUCCESS print is successful.
- @retval EFI_BAD_BUFFER_SIZE structure is out of the range of SMBIOS table.
-**/
-EFI_STATUS
-EFIAPI
-SMBiosView (
- IN UINT8 QueryType,
- IN UINT16 QueryHandle,
- IN UINT8 Option,
- IN BOOLEAN RandomView
- )
-{
- UINT16 Handle;
- UINT8 *Buffer;
- UINT16 Length;
- UINTN Index;
-
- SMBIOS_STRUCTURE_POINTER SmbiosStruct;
- SMBIOS_TABLE_ENTRY_POINT *SMBiosTable;
-
- SMBiosTable = NULL;
- LibSmbiosGetEPS (&SMBiosTable);
- if (SMBiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
- return EFI_BAD_BUFFER_SIZE;
- }
-
- if (CompareMem (SMBiosTable->AnchorString, "_SM_", 4) == 0) {
- //
- // Have got SMBIOS table
- //
- SmbiosPrintEPSInfo (SMBiosTable, Option);
-
- SmbiosMajorVersion = SMBiosTable->MajorVersion;
- SmbiosMinorVersion = SMBiosTable->MinorVersion;
-
- ShellPrintEx(-1,-1,L"=========================================================\n");
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERY_STRUCT_COND), gShellDebug1HiiHandle);
-
- if (QueryType == STRUCTURE_TYPE_RANDOM) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE_RANDOM), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE), gShellDebug1HiiHandle, QueryType);
- }
-
- if (RandomView) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE_RANDOM), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE), gShellDebug1HiiHandle, QueryHandle);
- }
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_SHOWTYPE), gShellDebug1HiiHandle);
- ShellPrintEx(-1,-1,GetShowTypeString (gShowType));
- ShellPrintEx(-1,-1,L"\n\n");
-
-/*
- //
- // Get internal commands, such as change options.
- //
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
-
- return Status;
- }
-*/
-
- //
- // Searching and display structure info
- //
- Handle = QueryHandle;
- for (Index = 0; Index < SMBiosTable->NumberOfSmbiosStructures; Index++) {
- //
- // if reach the end of table, break..
- //
- if (Handle == INVALID_HANDLE) {
- break;
- }
- //
- // handle then point to the next!
- //
- if (LibGetSmbiosStructure (&Handle, &Buffer, &Length) != DMI_SUCCESS) {
- break;
- }
-
- SmbiosStruct.Raw = Buffer;
-
- //
- // if QueryType==Random, print this structure.
- // if QueryType!=Random, but Hdr->Type==QueryType, also print it.
- // only if QueryType != Random and Hdr->Type != QueryType, skiped it.
- //
- if (QueryType != STRUCTURE_TYPE_RANDOM && SmbiosStruct.Hdr->Type != QueryType) {
- continue;
- }
-
- ShellPrintEx(-1,-1,L"\n=========================================================\n");
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE_HANDLE_DUMP_STRUCT),
- gShellDebug1HiiHandle,
- SmbiosStruct.Hdr->Type,
- SmbiosStruct.Hdr->Handle
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX_LENGTH), gShellDebug1HiiHandle, Index, Length);
- //
- // Addr of structure in structure in table
- //
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ADDR), gShellDebug1HiiHandle, (UINTN) Buffer);
- DumpHex (0, 0, Length, Buffer);
-
-/*
- //
- // Get internal commands, such as change options.
- //
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
-
- return Status;
- }
-*/
-
- if (gShowType != SHOW_NONE) {
- //
- // Print structure information
- //
- SmbiosPrintStructure (&SmbiosStruct, gShowType);
- ShellPrintEx(-1,-1,L"\n");
-
-/*
- //
- // Get internal commands, such as change options.
- //
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
-
- return Status;
- }
-*/
- }
- if (!RandomView) {
- break;
- }
- }
-
- ShellPrintEx(-1,-1,L"\n=========================================================\n");
- return EFI_SUCCESS;
- }
-
- return EFI_BAD_BUFFER_SIZE;
-}
-
-/**
- Function to initialize the global mStatisticsTable object.
-
- @retval EFI_SUCCESS print is successful.
-**/
-EFI_STATUS
-EFIAPI
-InitSmbiosTableStatistics (
- VOID
- )
-{
- UINT16 Handle;
- UINT8 *Buffer;
- UINT16 Length;
- UINT16 Offset;
- UINT16 Index;
-
- SMBIOS_STRUCTURE_POINTER SmbiosStruct;
- SMBIOS_TABLE_ENTRY_POINT *SMBiosTable;
- STRUCTURE_STATISTICS *StatisticsPointer;
-
- SMBiosTable = NULL;
- LibSmbiosGetEPS (&SMBiosTable);
- if (SMBiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
- return EFI_NOT_FOUND;
- }
-
- if (CompareMem (SMBiosTable->AnchorString, "_SM_", 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_SMBIOS_TABLE), gShellDebug1HiiHandle);
- return EFI_INVALID_PARAMETER;
- }
- //
- // Allocate memory to mStatisticsTable
- //
- if (mStatisticsTable != NULL) {
- FreePool (mStatisticsTable);
- mStatisticsTable = NULL;
- }
-
- mStatisticsTable = (STRUCTURE_STATISTICS *) AllocateZeroPool (SMBiosTable->NumberOfSmbiosStructures * sizeof (STRUCTURE_STATISTICS));
-
- if (mStatisticsTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OUT_OF_MEM), gShellDebug1HiiHandle);
- return EFI_OUT_OF_RESOURCES;
- }
-
- Offset = 0;
- StatisticsPointer = mStatisticsTable;
-
- //
- // search from the first one
- //
- Handle = INVALID_HANDLE;
- LibGetSmbiosStructure (&Handle, NULL, NULL);
- for (Index = 1; Index <= SMBiosTable->NumberOfSmbiosStructures; Index++) {
- //
- // If reach the end of table, break..
- //
- if (Handle == INVALID_HANDLE) {
- break;
- }
- //
- // After LibGetSmbiosStructure(), handle then point to the next!
- //
- if (LibGetSmbiosStructure (&Handle, &Buffer, &Length) != DMI_SUCCESS) {
- break;
- }
-
- SmbiosStruct.Raw = Buffer;
-
- //
- // general statistics
- //
- StatisticsPointer->Index = Index;
- StatisticsPointer->Type = SmbiosStruct.Hdr->Type;
- StatisticsPointer->Handle = SmbiosStruct.Hdr->Handle;
- StatisticsPointer->Length = Length;
- StatisticsPointer->Addr = Offset;
-
- Offset = (UINT16) (Offset + Length);
-
- StatisticsPointer = &mStatisticsTable[Index];
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Function to display the global mStatisticsTable object.
-
- @param[in] Option ECHO, NORMAL, or DETAIL control the amount of detail displayed.
-
- @retval EFI_SUCCESS print is successful.
-**/
-EFI_STATUS
-EFIAPI
-DisplayStatisticsTable (
- IN UINT8 Option
- )
-{
- UINTN Index;
- UINTN Num;
- STRUCTURE_STATISTICS *StatisticsPointer;
- SMBIOS_TABLE_ENTRY_POINT *SMBiosTable;
-
- SMBiosTable = NULL;
- if (Option < SHOW_OUTLINE) {
- return EFI_SUCCESS;
- }
- //
- // display EPS information firstly
- //
- LibSmbiosGetEPS (&SMBiosTable);
- if (SMBiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
- return EFI_UNSUPPORTED;
- }
-
- ShellPrintEx(-1,-1,L"\n============================================================\n");
- SmbiosPrintEPSInfo (SMBiosTable, Option);
-
- if (Option < SHOW_NORMAL) {
- return EFI_SUCCESS;
- }
-
- if (mStatisticsTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_STATS), gShellDebug1HiiHandle);
- return EFI_NOT_FOUND;
- }
-
- ShellPrintEx(-1,-1,L"============================================================\n");
- StatisticsPointer = &mStatisticsTable[0];
- Num = SMBiosTable->NumberOfSmbiosStructures;
- //
- // display statistics table content
- //
- for (Index = 1; Index <= Num; Index++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX), gShellDebug1HiiHandle, StatisticsPointer->Index);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE), gShellDebug1HiiHandle, StatisticsPointer->Type);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_HANDLE), gShellDebug1HiiHandle, StatisticsPointer->Handle);
- if (Option >= SHOW_DETAIL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OFFSET), gShellDebug1HiiHandle, StatisticsPointer->Addr);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_LENGTH), gShellDebug1HiiHandle, StatisticsPointer->Length);
- }
-
- ShellPrintEx(-1,-1,L"\n");
- StatisticsPointer = &mStatisticsTable[Index];
-/*
- //
- // Display 20 lines and wait for a page break
- //
- if (Index % 20 == 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ENTER_CONTINUE), gShellDebug1HiiHandle);
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
-
- return Status;
- }
- }
-*/
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- function to return a string of the detail level.
-
- @param[in] ShowType The detail level whose name is desired in clear text.
-
- @return A pointer to a string representing the ShowType (or 'undefined type' if not known).
-**/
-CHAR16 *
-EFIAPI
-GetShowTypeString (
- UINT8 ShowType
- )
-{
- //
- // show type
- //
- switch (ShowType) {
-
- case SHOW_NONE:
- return L"SHOW_NONE";
-
- case SHOW_OUTLINE:
- return L"SHOW_OUTLINE";
-
- case SHOW_NORMAL:
- return L"SHOW_NORMAL";
-
- case SHOW_DETAIL:
- return L"SHOW_DETAIL";
-
- case SHOW_ALL:
- return L"SHOW_ALL";
-
- default:
- return L"Undefined type";
- }
-}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h
deleted file mode 100644
index 638917ae8b..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
- Tools of clarify the content of the smbios table.
-
- Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _SMBIOS_VIEW_H_
-#define _SMBIOS_VIEW_H_
-
-#define STRUCTURE_TYPE_RANDOM (UINT8) 0xFE
-#define STRUCTURE_TYPE_INVALID (UINT8) 0xFF
-
-typedef struct {
- UINT16 Index;
- UINT8 Type;
- UINT16 Handle;
- UINT16 Addr; // offset from table head
- UINT16 Length; // total structure length
-} STRUCTURE_STATISTICS;
-
-/**
- Query all structures Data from SMBIOS table and Display
- the information to users as required display option.
-
- @param[in] QueryType Structure type to view.
- @param[in] QueryHandle Structure handle to view.
- @param[in] Option Display option: none,outline,normal,detail.
- @param[in] RandomView Support for -h parameter.
-
- @retval EFI_SUCCESS print is successful.
- @retval EFI_BAD_BUFFER_SIZE structure is out of the range of SMBIOS table.
-**/
-EFI_STATUS
-EFIAPI
-SMBiosView (
- IN UINT8 QueryType,
- IN UINT16 QueryHandle,
- IN UINT8 Option,
- IN BOOLEAN RandomView
- );
-
-/**
- Function to initialize the global mStatisticsTable object.
-
- @retval EFI_SUCCESS print is successful.
-**/
-EFI_STATUS
-EFIAPI
-InitSmbiosTableStatistics (
- VOID
- );
-
-/**
- Function to display the global mStatisticsTable object.
-
- @param[in] Option ECHO, NORMAL, or DETAIL control the amount of detail displayed.
-
- @retval EFI_SUCCESS print is successful.
-**/
-EFI_STATUS
-EFIAPI
-DisplayStatisticsTable (
- IN UINT8 Option
- );
-
-/**
- function to return a string of the detail level.
-
- @param[in] ShowType The detail level whose name is desired in clear text.
-
- @return A pointer to a string representing the ShowType (or 'undefined type' if not known).
-**/
-CHAR16*
-EFIAPI
-GetShowTypeString (
- UINT8 ShowType
- );
-
-extern UINT8 gShowType;
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
deleted file mode 100644
index e50995c58f..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c
deleted file mode 100644
index 75e0de2fa2..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c
+++ /dev/null
@@ -1,651 +0,0 @@
-/** @file
- Main file for NULL named library for debug1 profile shell command functions.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDebug1CommandsLib.h"
-
-STATIC CONST CHAR16 mFileName[] = L"Debug1Commands";
-EFI_HANDLE gShellDebug1HiiHandle = NULL;
-
-/**
- Gets the debug file name. This will be used if HII is not working.
-
- @retval NULL No file is available.
- @return The NULL-terminated filename to get help from.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandGetManFileNameDebug1 (
- VOID
- )
-{
- return (mFileName);
-}
-
-/**
- Constructor for the Shell Debug1 Commands library.
-
- @param ImageHandle the image handle of the process
- @param SystemTable the EFI System Table pointer
-
- @retval EFI_SUCCESS the shell command handlers were installed sucessfully
- @retval EFI_UNSUPPORTED the shell level required was not found.
-**/
-EFI_STATUS
-EFIAPI
-UefiShellDebug1CommandsLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- //
- // check our bit of the profiles mask
- //
- if ((PcdGet8(PcdShellProfileMask) & BIT1) == 0) {
- return (EFI_SUCCESS);
- }
-
- //
- // install the HII stuff.
- //
- gShellDebug1HiiHandle = HiiAddPackages (&gShellDebug1HiiGuid, gImageHandle, UefiShellDebug1CommandsLibStrings, NULL);
- if (gShellDebug1HiiHandle == NULL) {
- return (EFI_DEVICE_ERROR);
- }
-
- //
- // install our shell command handlers that are always installed
- //
- ShellCommandRegisterCommandName(L"setsize", ShellCommandRunSetSize , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SETSIZE) );
- ShellCommandRegisterCommandName(L"comp", ShellCommandRunComp , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_COMP) );
- ShellCommandRegisterCommandName(L"mode", ShellCommandRunMode , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_MODE) );
- ShellCommandRegisterCommandName(L"memmap", ShellCommandRunMemMap , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_MEMMAP) );
- ShellCommandRegisterCommandName(L"eficompress", ShellCommandRunEfiCompress , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EFICOMPRESS) );
- ShellCommandRegisterCommandName(L"efidecompress", ShellCommandRunEfiDecompress , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EFIDCOMPRESS) );
- ShellCommandRegisterCommandName(L"dmem", ShellCommandRunDmem , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_DMEM) );
- ShellCommandRegisterCommandName(L"loadpcirom", ShellCommandRunLoadPciRom , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_LOAD_PCI_ROM) );
- ShellCommandRegisterCommandName(L"mm", ShellCommandRunMm , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_MM) );
- ShellCommandRegisterCommandName(L"setvar", ShellCommandRunSetVar , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SETVAR) );
- ShellCommandRegisterCommandName(L"sermode", ShellCommandRunSerMode , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SERMODE) );
- ShellCommandRegisterCommandName(L"pci", ShellCommandRunPci , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_PCI) );
- ShellCommandRegisterCommandName(L"smbiosview", ShellCommandRunSmbiosView , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SMBIOSVIEW) );
- ShellCommandRegisterCommandName(L"dmpstore", ShellCommandRunDmpStore , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_DMPSTORE) );
- ShellCommandRegisterCommandName(L"dblk", ShellCommandRunDblk , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_DBLK) );
- ShellCommandRegisterCommandName(L"edit", ShellCommandRunEdit , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EDIT) );
- ShellCommandRegisterCommandName(L"hexedit", ShellCommandRunHexEdit , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_HEXEDIT) );
-
- //
- // check install profile bit of the profiles mask is set
- //
- if ((PcdGet8(PcdShellProfileMask) & BIT2) == 0) {
- ShellCommandRegisterCommandName(L"bcfg", ShellCommandRunBcfg , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_BCFG) );
- }
-
-
-
-
- ShellCommandRegisterAlias(L"dmem", L"mem");
-
- return (EFI_SUCCESS);
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param ImageHandle The image handle of the process.
- @param SystemTable The EFI System Table pointer.
-**/
-EFI_STATUS
-EFIAPI
-UefiShellDebug1CommandsLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (gShellDebug1HiiHandle != NULL) {
- HiiRemovePackages(gShellDebug1HiiHandle);
- }
- return (EFI_SUCCESS);
-}
-
-STATIC CONST CHAR8 Hex[] = {
- '0',
- '1',
- '2',
- '3',
- '4',
- '5',
- '6',
- '7',
- '8',
- '9',
- 'A',
- 'B',
- 'C',
- 'D',
- 'E',
- 'F'
-};
-
-/**
- Dump some hexadecimal data to the screen.
-
- @param[in] Indent How many spaces to indent the output.
- @param[in] Offset The offset of the printing.
- @param[in] DataSize The size in bytes of UserData.
- @param[in] UserData The data to print out.
-**/
-VOID
-DumpHex (
- IN UINTN Indent,
- IN UINTN Offset,
- IN UINTN DataSize,
- IN VOID *UserData
- )
-{
- UINT8 *Data;
-
- CHAR8 Val[50];
-
- CHAR8 Str[20];
-
- UINT8 TempByte;
- UINTN Size;
- UINTN Index;
-
- Data = UserData;
- while (DataSize != 0) {
- Size = 16;
- if (Size > DataSize) {
- Size = DataSize;
- }
-
- for (Index = 0; Index < Size; Index += 1) {
- TempByte = Data[Index];
- Val[Index * 3 + 0] = Hex[TempByte >> 4];
- Val[Index * 3 + 1] = Hex[TempByte & 0xF];
- Val[Index * 3 + 2] = (CHAR8) ((Index == 7) ? '-' : ' ');
- Str[Index] = (CHAR8) ((TempByte < ' ' || TempByte > 'z') ? '.' : TempByte);
- }
-
- Val[Index * 3] = 0;
- Str[Index] = 0;
- ShellPrintEx(-1, -1, L"%*a%02X: %-.48a *%a*\r\n", Indent, "", Offset, Val, Str);
-
- Data += Size;
- Offset += Size;
- DataSize -= Size;
- }
-}
-
-/**
- Convert a Unicode character to upper case only if
- it maps to a valid small-case ASCII character.
-
- This internal function only deal with Unicode character
- which maps to a valid small-case ASCII character, i.e.
- L'a' to L'z'. For other Unicode character, the input character
- is returned directly.
-
- @param Char The character to convert.
-
- @retval LowerCharacter If the Char is with range L'a' to L'z'.
- @retval Unchanged Otherwise.
-
-
- //Stolen from MdePkg Baselib
-**/
-CHAR16
-EFIAPI
-CharToUpper (
- IN CHAR16 Char
- )
-{
- if (Char >= L'a' && Char <= L'z') {
- return (CHAR16) (Char - (L'a' - L'A'));
- }
-
- return Char;
-}
-
-/**
- Function returns a system configuration table that is stored in the
- EFI System Table based on the provided GUID.
-
- @param[in] TableGuid A pointer to the table's GUID type.
- @param[in, out] Table On exit, a pointer to a system configuration table.
-
- @retval EFI_SUCCESS A configuration table matching TableGuid was found.
- @retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.
-**/
-EFI_STATUS
-EFIAPI
-GetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- IN OUT VOID **Table
- )
-{
- UINTN Index;
- ASSERT (Table != NULL);
-
- for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {
- if (CompareGuid (TableGuid, &(gST->ConfigurationTable[Index].VendorGuid))) {
- *Table = gST->ConfigurationTable[Index].VendorTable;
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-/**
- Convert a Unicode character to numerical value.
-
- This internal function only deal with Unicode character
- which maps to a valid hexadecimal ASII character, i.e.
- L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other
- Unicode character, the value returned does not make sense.
-
- @param Char The character to convert.
-
- @return The numerical value converted.
-
-**/
-UINTN
-EFIAPI
-HexCharToUintn (
- IN CHAR16 Char
- )
-{
- if (Char >= L'0' && Char <= L'9') {
- return Char - L'0';
- }
-
- return (UINTN) (10 + CharToUpper (Char) - L'A');
-}
-
-/**
- Convert a string representation of a guid to a Guid value.
-
- @param[in] StringGuid The pointer to the string of a guid.
- @param[in, out] Guid The pointer to the GUID structure to populate.
-
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
- @retval EFI_SUCCESS The conversion was successful.
-**/
-EFI_STATUS
-EFIAPI
-ConvertStringToGuid (
- IN CONST CHAR16 *StringGuid,
- IN OUT EFI_GUID *Guid
- )
-{
- CHAR16 *TempCopy;
- CHAR16 *TempSpot;
- CHAR16 *Walker;
- UINT64 TempVal;
- EFI_STATUS Status;
-
- if (StringGuid == NULL) {
- return (EFI_INVALID_PARAMETER);
- } else if (StrLen(StringGuid) != 36) {
- return (EFI_INVALID_PARAMETER);
- }
- TempCopy = NULL;
- TempCopy = StrnCatGrow(&TempCopy, NULL, StringGuid, 0);
- if (TempCopy == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- Walker = TempCopy;
- TempSpot = StrStr(Walker, L"-");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- Status = ShellConvertStringToUint64(Walker, &TempVal, TRUE, FALSE);
- if (EFI_ERROR(Status)) {
- FreePool(TempCopy);
- return (Status);
- }
- Guid->Data1 = (UINT32)TempVal;
- Walker += 9;
- TempSpot = StrStr(Walker, L"-");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- Status = ShellConvertStringToUint64(Walker, &TempVal, TRUE, FALSE);
- if (EFI_ERROR(Status)) {
- FreePool(TempCopy);
- return (Status);
- }
- Guid->Data2 = (UINT16)TempVal;
- Walker += 5;
- TempSpot = StrStr(Walker, L"-");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- Status = ShellConvertStringToUint64(Walker, &TempVal, TRUE, FALSE);
- if (EFI_ERROR(Status)) {
- FreePool(TempCopy);
- return (Status);
- }
- Guid->Data3 = (UINT16)TempVal;
- Walker += 5;
- Guid->Data4[0] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
- Guid->Data4[0] = (UINT8)(Guid->Data4[0]+ (UINT8)HexCharToUintn(Walker[1]));
- Walker += 2;
- Guid->Data4[1] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
- Guid->Data4[1] = (UINT8)(Guid->Data4[1] + (UINT8)HexCharToUintn(Walker[1]));
- Walker += 3;
- Guid->Data4[2] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
- Guid->Data4[2] = (UINT8)(Guid->Data4[2] + (UINT8)HexCharToUintn(Walker[1]));
- Walker += 2;
- Guid->Data4[3] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
- Guid->Data4[3] = (UINT8)(Guid->Data4[3] + (UINT8)HexCharToUintn(Walker[1]));
- Walker += 2;
- Guid->Data4[4] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
- Guid->Data4[4] = (UINT8)(Guid->Data4[4] + (UINT8)HexCharToUintn(Walker[1]));
- Walker += 2;
- Guid->Data4[5] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
- Guid->Data4[5] = (UINT8)(Guid->Data4[5] + (UINT8)HexCharToUintn(Walker[1]));
- Walker += 2;
- Guid->Data4[6] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
- Guid->Data4[6] = (UINT8)(Guid->Data4[6] + (UINT8)HexCharToUintn(Walker[1]));
- Walker += 2;
- Guid->Data4[7] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
- Guid->Data4[7] = (UINT8)(Guid->Data4[7] + (UINT8)HexCharToUintn(Walker[1]));
- FreePool(TempCopy);
- return (EFI_SUCCESS);
-}
-
-/**
- Clear the line at the specified Row.
-
- @param[in] Row The row number to be cleared ( start from 1 )
- @param[in] LastCol The last printable column.
- @param[in] LastRow The last printable row.
-**/
-VOID
-EFIAPI
-EditorClearLine (
- IN UINTN Row,
- IN UINTN LastCol,
- IN UINTN LastRow
- )
-{
- CHAR16 Line[200];
-
- if (Row == 0) {
- Row = 1;
- }
-
- //
- // prepare a blank line
- //
- SetMem16(Line, LastCol*sizeof(CHAR16), L' ');
-
- if (Row == LastRow) {
- //
- // if CHAR_NULL is still at position 80, it will cause first line error
- //
- Line[LastCol - 1] = CHAR_NULL;
- } else {
- Line[LastCol] = CHAR_NULL;
- }
-
- //
- // print out the blank line
- //
- ShellPrintEx (0, ((INT32)Row) - 1, Line);
-}
-
-/**
- Determine if the character is valid for a filename.
-
- @param[in] Ch The character to test.
-
- @retval TRUE The character is valid.
- @retval FALSE The character is not valid.
-**/
-BOOLEAN
-EFIAPI
-IsValidFileNameChar (
- IN CONST CHAR16 Ch
- )
-{
- //
- // See if there are any illegal characters within the name
- //
- if (Ch < 0x20 || Ch == L'\"' || Ch == L'*' || Ch == L'/' || Ch == L'<' || Ch == L'>' || Ch == L'?' || Ch == L'|') {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Check if file name has illegal characters.
-
- @param Name The filename to check.
-
- @retval TRUE The filename is ok.
- @retval FALSE The filename is not ok.
-**/
-BOOLEAN
-EFIAPI
-IsValidFileName (
- IN CONST CHAR16 *Name
- )
-{
-
- UINTN Index;
- UINTN Len;
-
- //
- // check the length of Name
- //
- for (Len = 0, Index = StrLen (Name) - 1; Index + 1 != 0; Index--, Len++) {
- if (Name[Index] == '\\' || Name[Index] == ':') {
- break;
- }
- }
-
- if (Len == 0 || Len > 255) {
- return FALSE;
- }
- //
- // check whether any char in Name not appears in valid file name char
- //
- for (Index = 0; Index < StrLen (Name); Index++) {
- if (!IsValidFileNameChar (Name[Index])) {
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/**
- Find a filename that is valid (not taken) with the given extension.
-
- @param[in] Extension The file extension.
-
- @retval NULL Something went wrong.
- @return the valid filename.
-**/
-CHAR16 *
-EFIAPI
-EditGetDefaultFileName (
- IN CONST CHAR16 *Extension
- )
-{
- EFI_STATUS Status;
- UINTN Suffix;
- BOOLEAN FoundNewFile;
- CHAR16 *FileNameTmp;
-
- Suffix = 0;
- FoundNewFile = FALSE;
-
- do {
- FileNameTmp = CatSPrint (NULL, L"NewFile%d.%s", Suffix, Extension);
-
- //
- // after that filename changed to path
- //
- Status = ShellFileExists (FileNameTmp);
-
- if (Status == EFI_NOT_FOUND) {
- return FileNameTmp;
- }
-
- FreePool (FileNameTmp);
- FileNameTmp = NULL;
- Suffix++;
- } while (Suffix != 0);
-
- FreePool (FileNameTmp);
- return NULL;
-}
-
-/**
- Read a file into an allocated buffer. The buffer is the responsibility
- of the caller to free.
-
- @param[in] FileName The filename of the file to open.
- @param[out] Buffer Upon successful return, the pointer to the
- address of the allocated buffer.
- @param[out] BufferSize If not NULL, then the pointer to the size
- of the allocated buffer.
- @param[out] ReadOnly Upon successful return TRUE if the file is
- read only. FALSE otherwise.
-
- @retval EFI_NOT_FOUND The filename did not represent a file in the
- file system.
- @retval EFI_SUCCESS The file was read into the buffer.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR The file read operation failed.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
- @retval EFI_INVALID_PARAMETER FileName was NULL.
- @retval EFI_INVALID_PARAMETER FileName was a directory.
-**/
-EFI_STATUS
-EFIAPI
-ReadFileIntoBuffer (
- IN CONST CHAR16 *FileName,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize OPTIONAL,
- OUT BOOLEAN *ReadOnly
- )
-{
- VOID *InternalBuffer;
- UINTN FileSize;
- SHELL_FILE_HANDLE FileHandle;
- BOOLEAN CreateFile;
- EFI_STATUS Status;
- EFI_FILE_INFO *Info;
-
- InternalBuffer = NULL;
- FileSize = 0;
- FileHandle = NULL;
- CreateFile = FALSE;
- Status = EFI_SUCCESS;
- Info = NULL;
-
- if (FileName == NULL || Buffer == NULL || ReadOnly == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // try to open the file
- //
- Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ, 0);
-
- if (!EFI_ERROR(Status)) {
- ASSERT(CreateFile == FALSE);
- if (FileHandle == NULL) {
- return EFI_LOAD_ERROR;
- }
-
- Info = ShellGetFileInfo(FileHandle);
-
- if (Info->Attribute & EFI_FILE_DIRECTORY) {
- FreePool (Info);
- return EFI_INVALID_PARAMETER;
- }
-
- if (Info->Attribute & EFI_FILE_READ_ONLY) {
- *ReadOnly = TRUE;
- } else {
- *ReadOnly = FALSE;
- }
- //
- // get file size
- //
- FileSize = (UINTN) Info->FileSize;
-
- FreePool (Info);
- } else if (Status == EFI_NOT_FOUND) {
- //
- // file not exists. add create and try again
- //
- Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
- if (EFI_ERROR (Status)) {
- return Status;
- } else {
- //
- // it worked. now delete it and move on with the name (now validated)
- //
- Status = ShellDeleteFile (&FileHandle);
- if (Status == EFI_WARN_DELETE_FAILURE) {
- Status = EFI_ACCESS_DENIED;
- }
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
- //
- // file doesn't exist, so set CreateFile to TRUE and can't be read-only
- //
- CreateFile = TRUE;
- *ReadOnly = FALSE;
- }
-
- //
- // the file exists
- //
- if (!CreateFile) {
- //
- // allocate buffer to read file
- //
- InternalBuffer = AllocateZeroPool (FileSize);
- if (InternalBuffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // read file into InternalBuffer
- //
- Status = ShellReadFile (FileHandle, &FileSize, InternalBuffer);
- ShellCloseFile(&FileHandle);
- FileHandle = NULL;
- if (EFI_ERROR (Status)) {
- SHELL_FREE_NON_NULL (InternalBuffer);
- return EFI_LOAD_ERROR;
- }
- }
- *Buffer = InternalBuffer;
- if (BufferSize != NULL) {
- *BufferSize = FileSize;
- }
- return (EFI_SUCCESS);
-
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
deleted file mode 100644
index d8755bfefc..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
+++ /dev/null
@@ -1,436 +0,0 @@
-/** @file
- Main file for NULL named library for Profile1 shell command functions.
-
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_
-#define _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/GlobalVariable.h>
-#include <Guid/ConsoleInDevice.h>
-#include <Guid/ConsoleOutDevice.h>
-#include <Guid/FileSystemInfo.h>
-#include <Guid/ShellLibHiiGuid.h>
-
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/DevicePath.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DriverDiagnostics2.h>
-#include <Protocol/DriverDiagnostics.h>
-#include <Protocol/PlatformDriverOverride.h>
-#include <Protocol/BusSpecificDriverOverride.h>
-#include <Protocol/PlatformToDriverConfiguration.h>
-#include <Protocol/DriverSupportedEfiVersion.h>
-#include <Protocol/DriverFamilyOverride.h>
-#include <Protocol/DriverHealth.h>
-#include <Protocol/SimplePointer.h>
-#include <Protocol/PciRootBridgeIo.h>
-
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/ShellLib.h>
-#include <Library/SortLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HiiLib.h>
-#include <Library/FileHandleLib.h>
-#include <Library/DevicePathLib.h>
-#include <Library/PrintLib.h>
-#include <Library/HandleParsingLib.h>
-
-
-extern EFI_HANDLE gShellDebug1HiiHandle;
-
-/**
- Function printing hex output to the console.
-
- @param[in] Indent Number of spaces to indent.
- @param[in] Offset Offset to start with.
- @param[in] DataSize Length of data.
- @param[in] UserData Pointer to some data.
-**/
-VOID
-DumpHex (
- IN UINTN Indent,
- IN UINTN Offset,
- IN UINTN DataSize,
- IN VOID *UserData
- );
-
-/**
- Function returns a system configuration table that is stored in the
- EFI System Table based on the provided GUID.
-
- @param[in] TableGuid A pointer to the table's GUID type.
- @param[in, out] Table On exit, a pointer to a system configuration table.
-
- @retval EFI_SUCCESS A configuration table matching TableGuid was found.
- @retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.
-**/
-EFI_STATUS
-EFIAPI
-GetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- IN OUT VOID **Table
- );
-
-/**
- Convert a string representation of a GUID to the GUID value.
-
- @param[in] StringGuid The pointer to the string containing a GUID printed.
- @param[in, out] Guid The pointer to the buffer to get the GUID value.
-**/
-EFI_STATUS
-EFIAPI
-ConvertStringToGuid (
- IN CONST CHAR16 *StringGuid,
- IN OUT EFI_GUID *Guid
- );
-
-/**
- Convert a Unicode character to numerical value.
-
- This internal function only deal with Unicode character
- which maps to a valid hexadecimal ASII character, i.e.
- L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other
- Unicode character, the value returned does not make sense.
-
- @param Char The character to convert.
-
- @return The numerical value converted.
-
-**/
-UINTN
-EFIAPI
-HexCharToUintn (
- IN CHAR16 Char
- );
-
-/**
- Function for 'setsize' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunSetSize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'comp' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunComp (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'mode' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMode (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'memmap' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMemMap (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'compress' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEfiCompress (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'decompress' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEfiDecompress (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'dmem' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDmem (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'loadpcirom' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunLoadPciRom (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'mm' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMm (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'setvar' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunSetVar (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'sermode' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunSerMode (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'bcfg' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunBcfg (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'pci' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunPci (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'smbiosview' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunSmbiosView (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'dmpstore' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDmpStore (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'dblk' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDblk (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'edit' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEdit (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'hexedit' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunHexEdit (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Clear the line at the specified Row.
-
- @param[in] Row The row number to be cleared ( start from 1 )
- @param[in] LastCol The last printable column.
- @param[in] LastRow The last printable row.
-**/
-VOID
-EFIAPI
-EditorClearLine (
- IN UINTN Row,
- IN UINTN LastCol,
- IN UINTN LastRow
- );
-
-/**
- Check if file name has illegal characters.
-
- @param Name The filename to check.
-
- @retval TRUE The filename is ok.
- @retval FALSE The filename is not ok.
-**/
-BOOLEAN
-EFIAPI
-IsValidFileName (
- IN CONST CHAR16 *Name
- );
-
-/**
- Find a filename that is valid (not taken) with the given extension.
-
- @param[in] Extension The file extension.
-
- @retval NULL Something went wrong.
- @return the valid filename.
-**/
-CHAR16 *
-EFIAPI
-EditGetDefaultFileName (
- IN CONST CHAR16 *Extension
- );
-
-/**
- Read a file into an allocated buffer. The buffer is the responsibility
- of the caller to free.
-
- @param[in] FileName The filename of the file to open.
- @param[out] Buffer Upon successful return, the pointer to the
- address of the allocated buffer.
- @param[out] BufferSize If not NULL, then the pointer to the size
- of the allocated buffer.
- @param[out] ReadOnly Upon successful return TRUE if the file is
- read only. FALSE otherwise.
-
- @retval EFI_NOT_FOUND The filename did not represent a file in the
- file system. Directories cannot be read with
- this method.
- @retval EFI_SUCCESS The file was read into the buffer.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_LOAD_ERROR The file read operation failed.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
- @retval EFI_INVALID_PARAMETER FileName was NULL.
- @retval EFI_INVALID_PARAMETER FileName was a directory.
-**/
-EFI_STATUS
-EFIAPI
-ReadFileIntoBuffer (
- IN CONST CHAR16 *FileName,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize OPTIONAL,
- OUT BOOLEAN *ReadOnly
- );
-
-#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
deleted file mode 100644
index 37f6f60aee..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
+++ /dev/null
@@ -1,136 +0,0 @@
-## @file
-# Provides shell Debug1 profile functions
-#
-# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellDebug1CommandsLib
- FILE_GUID = 90330D51-A99B-4cc8-A2EB-AE22542A3F45
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = UefiShellDebug1CommandsLibConstructor
- DESTRUCTOR = UefiShellDebug1CommandsLibDestructor
-
-[Sources]
- SetSize.c
- Comp.c
- Mode.c
- MemMap.c
- Compress.h
- Compress.c
- EfiCompress.c
- EfiDecompress.c
- Dmem.c
- LoadPciRom.c
- Mm.c
- SetVar.c
- SerMode.c
- Bcfg.c
- Pci.c
- Pci.h
- DmpStore.c
- Dblk.c
- SmbiosView/EventLogInfo.c
- SmbiosView/EventLogInfo.h
- SmbiosView/PrintInfo.c
- SmbiosView/QueryTable.c
- SmbiosView/SmbiosView.c
- SmbiosView/SmbiosViewStrings.uni
- SmbiosView/LibSmbiosView.c
- SmbiosView/PrintInfo.h
- SmbiosView/LibSmbiosView.h
- SmbiosView/QueryTable.h
- SmbiosView/SmbiosView.h
- UefiShellDebug1CommandsLib.c
- UefiShellDebug1CommandsLib.h
- UefiShellDebug1CommandsLib.uni
-
-## Files shared by both editors
- EditTitleBar.h
- EditTitleBar.c
- EditInputBar.h
- EditInputBar.c
- EditStatusBar.h
- EditStatusBar.c
- EditMenuBar.h
- EditMenuBar.c
-
-## Files specific to the text editor
- Edit/Edit.c
- Edit/TextEditor.h
- Edit/TextEditorTypes.h
- Edit/FileBuffer.h
- Edit/FileBuffer.c
- Edit/MainTextEditor.h
- Edit/MainTextEditor.c
- Edit/Misc.h
- Edit/Misc.c
- Edit/TextEditStrings.uni
-
-## Files specific to the HEX editor
- HexEdit/BufferImage.h
- HexEdit/BufferImage.c
- HexEdit/Clipboard.h
- HexEdit/Clipboard.c
- HexEdit/DiskImage.h
- HexEdit/DiskImage.c
- HexEdit/FileImage.h
- HexEdit/FileImage.c
- HexEdit/HexEdit.c
- HexEdit/HexEditor.h
- HexEdit/HexEditorTypes.h
- HexEdit/HexeditStrings.uni
- HexEdit/MainHexEditor.h
- HexEdit/MainHexEditor.c
- HexEdit/MemImage.h
- HexEdit/MemImage.c
- HexEdit/Misc.h
- HexEdit/Misc.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- ShellCommandLib
- ShellLib
- UefiLib
- UefiRuntimeServicesTableLib
- UefiBootServicesTableLib
- SortLib
- PrintLib
-
-[Pcd]
- gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize # ALWAYS_CONSUMED
- gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength # ALWAYS_CONSUMED
-
-[Protocols]
- gEfiPciRootBridgeIoProtocolGuid
- gEfiBlockIoProtocolGuid
- gEfiSimplePointerProtocolGuid
-
-[Guids]
- gEfiGlobalVariableGuid
- gEfiSmbiosTableGuid
- gEfiMpsTableGuid
- gEfiSalSystemTableGuid
- gEfiAcpi10TableGuid
- gEfiAcpi20TableGuid
- gShellDebug1HiiGuid
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
deleted file mode 100644
index 8d8234f5ad..0000000000
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
deleted file mode 100644
index 429964d8c8..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/** @file
- Main file for connect shell Driver1 function.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-/**
- Connect controller(s) and driver(s).
-
- @param[in] ControllerHandle The handle to the controller. Should have driver binding on it.
- @param[in] DriverHandle The handle to the driver. Should have driver binding.
- @param[in] Recursive TRUE to connect recursively, FALSE otherwise.
- @param[in] Output TRUE to have info on the screen, FALSE otherwise.
- @param[in] AlwaysOutput Override Output for errors.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-ConnectControllers (
- IN CONST EFI_HANDLE ControllerHandle OPTIONAL,
- IN CONST EFI_HANDLE DriverHandle OPTIONAL,
- IN CONST BOOLEAN Recursive,
- IN CONST BOOLEAN Output,
- IN CONST BOOLEAN AlwaysOutput
- )
-{
- EFI_STATUS Status;
- EFI_STATUS Status2;
- EFI_HANDLE *ControllerHandleList;
- EFI_HANDLE *DriverHandleList;
- EFI_HANDLE *HandleWalker;
-
- ControllerHandleList = NULL;
- Status = EFI_NOT_FOUND;
- Status2 = EFI_NOT_FOUND;
-
- //
- // If we have a single handle to connect make that a 'list'
- //
- if (DriverHandle == NULL) {
- DriverHandleList = NULL;
- } else {
- DriverHandleList = AllocateZeroPool(2*sizeof(EFI_HANDLE));
- if (DriverHandleList == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- DriverHandleList[0] = DriverHandle;
- DriverHandleList[1] = NULL;
- }
-
- //
- // do we connect all controllers (with a loop) or a single one...
- // This is where we call the gBS->ConnectController function.
- //
- if (ControllerHandle == NULL) {
- ControllerHandleList = GetHandleListByProtocol(&gEfiDevicePathProtocolGuid);
- for (HandleWalker = ControllerHandleList
- ; HandleWalker != NULL && *HandleWalker != NULL
- ; HandleWalker++
- ){
- Status = gBS->ConnectController(*HandleWalker, DriverHandleList, NULL, Recursive);
- if (!EFI_ERROR(Status)) {
- Status2 = EFI_SUCCESS;
- }
- if ((Output && !EFI_ERROR(Status)) || AlwaysOutput) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_HANDLE_RESULT), gShellDriver1HiiHandle, L"Connect", ConvertHandleToHandleIndex(*HandleWalker), Status);
- }
- }
- } else {
- Status = gBS->ConnectController(ControllerHandle, DriverHandleList, NULL, Recursive);
- if (!EFI_ERROR(Status)) {
- Status2 = EFI_SUCCESS;
- }
- if ((Output && !EFI_ERROR(Status)) || AlwaysOutput) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_HANDLE_RESULT), gShellDriver1HiiHandle, L"Connect", ConvertHandleToHandleIndex(ControllerHandle), Status);
- }
- }
-
- //
- // Free any memory we allocated.
- //
- if (ControllerHandleList != NULL) {
- FreePool(ControllerHandleList);
- }
- if (DriverHandleList != NULL) {
- FreePool(DriverHandleList);
- }
- return (Status2);
-}
-
-/**
- Do a connect from an EFI variable via it's key name.
-
- @param[in] Key The name of the EFI Variable.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-ConnectFromDevPaths (
- IN CONST CHAR16 *Key
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- EFI_DEVICE_PATH_PROTOCOL *DevPathWalker;
- UINTN Length;
- EFI_HANDLE Handle;
- EFI_STATUS Status;
-
- DevPath = NULL;
- Length = 0;
-
- //
- // Get the DevicePath buffer from the variable...
- //
- Status = gRT->GetVariable((CHAR16*)Key, (EFI_GUID*)&gEfiGlobalVariableGuid, NULL, &Length, DevPath);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- DevPath = AllocateZeroPool(Length);
- Status = gRT->GetVariable((CHAR16*)Key, (EFI_GUID*)&gEfiGlobalVariableGuid, NULL, &Length, DevPath);
- }
-
- Status = EFI_NOT_FOUND;
- //
- // walk the list of devices and connect them
- //
- for (DevPathWalker = DevPath
- ; DevPathWalker < (DevPath + Length) && EFI_ERROR(Status) && DevPath != NULL
- ; DevPathWalker += GetDevicePathSize(DevPathWalker)
- ){
- //
- // get the correct handle from a given device path
- //
- if ((StrCmp(Key, L"ConInDev") == 0)
- ||(StrCmp(Key, L"ConIn") == 0)
- ){
- Status = gBS->LocateDevicePath((EFI_GUID*)&gEfiConsoleInDeviceGuid, &DevPathWalker, &Handle);
- if (!EFI_ERROR(Status)) {
- Status = ConnectControllers(NULL, Handle, FALSE, TRUE, FALSE);
- }
- } else if ((StrCmp(Key, L"ConOutDev") == 0)
- || (StrCmp(Key, L"ConErrDev") == 0)
- || (StrCmp(Key, L"ConOut") == 0)
- || (StrCmp(Key, L"ConErr") == 0)
- ){
- Status = gBS->LocateDevicePath((EFI_GUID*)&gEfiConsoleOutDeviceGuid, &DevPathWalker, &Handle);
- if (!EFI_ERROR(Status)) {
- Status = ConnectControllers(NULL, Handle, FALSE, TRUE, FALSE);
- }
- }
- }
-
- if (DevPath != NULL) {
- FreePool(DevPath);
- }
- return (Status);
-}
-
-/**
- Convert the handle identifiers from strings and then connect them.
-
- One of them should have driver binding and either can be NULL.
-
- @param[in] Handle1 The first handle.
- @param[in] Handle2 The second handle.
- @param[in] Recursive TRUE to do connect recursively. FALSE otherwise.
- @param[in] Output TRUE to have output to screen. FALSE otherwise.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-ConvertAndConnectControllers (
- IN EFI_HANDLE *Handle1 OPTIONAL,
- IN EFI_HANDLE *Handle2 OPTIONAL,
- IN CONST BOOLEAN Recursive,
- IN CONST BOOLEAN Output
- )
-{
- //
- // if only one is NULL verify it's the proper one...
- //
- if ( (Handle1 == NULL && Handle2 != NULL)
- || (Handle1 != NULL && Handle2 == NULL)
- ){
- //
- // Figure out which one should be NULL and move the handle to the right place.
- // If Handle1 is NULL then test Handle2 and vise versa.
- // The one that DOES has driver binding must be Handle2
- //
- if (Handle1 == NULL) {
- if (EFI_ERROR(gBS->OpenProtocol(Handle2, &gEfiDriverBindingProtocolGuid, NULL, NULL, gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- // swap
- Handle1 = Handle2;
- Handle2 = NULL;
- } else {
- // We're all good...
- }
- } else {
- if (EFI_ERROR(gBS->OpenProtocol(Handle1, &gEfiDriverBindingProtocolGuid, NULL, NULL, gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- // We're all good...
- } else {
- // swap
- Handle2 = Handle1;
- Handle1 = NULL;
- }
- }
- }
-
- return (ConnectControllers(Handle1, Handle2, Recursive, Output, (BOOLEAN)(Handle2 != NULL && Handle1 != NULL)));
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-c", TypeFlag},
- {L"-r", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'connect' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunConnect (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Param1;
- CONST CHAR16 *Param2;
- UINTN Count;
- EFI_HANDLE Handle1;
- EFI_HANDLE Handle2;
- UINT64 Intermediate;
-
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // if more than 2 'value' parameters (plus the name one) or either -r or -c with any value parameters we have too many parameters
- //
- Count = (gInReconnect?0x4:0x3);
- if ((ShellCommandLineGetCount(Package) > Count)
- ||((ShellCommandLineGetFlag(Package, L"-r") || ShellCommandLineGetFlag(Package, L"-c")) && ShellCommandLineGetCount(Package)>1)
- ||(ShellCommandLineGetFlag(Package, L"-r") && ShellCommandLineGetFlag(Package, L"-c") )
- ){
- //
- // error for too many parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-c")) {
- //
- // do the conin and conout from EFI variables
- // if the first fails dont 'loose' the error
- //
- Status = ConnectFromDevPaths(L"ConInDev");
- if (EFI_ERROR(Status)) {
- ConnectFromDevPaths(L"ConOutDev");
- } else {
- Status = ConnectFromDevPaths(L"ConOutDev");
- }
- if (EFI_ERROR(Status)) {
- ConnectFromDevPaths(L"ConErrDev");
- } else {
- Status = ConnectFromDevPaths(L"ConErrDev");
- }
- if (EFI_ERROR(Status)) {
- ConnectFromDevPaths(L"ConErr");
- } else {
- Status = ConnectFromDevPaths(L"ConErr");
- }
- if (EFI_ERROR(Status)) {
- ConnectFromDevPaths(L"ConIn");
- } else {
- Status = ConnectFromDevPaths(L"ConIn");
- }
- if (EFI_ERROR(Status)) {
- ConnectFromDevPaths(L"ConOut");
- } else {
- Status = ConnectFromDevPaths(L"ConOut");
- }
- if (EFI_ERROR(Status)) {
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- } else {
- //
- // 0, 1, or 2 specific handles and possibly recursive
- //
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- Param2 = ShellCommandLineGetRawValue(Package, 2);
- Count = ShellCommandLineGetCount(Package);
-
- if (Param1 != NULL) {
- Status = ShellConvertStringToUint64(Param1, &Intermediate, TRUE, FALSE);
- Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- } else {
- Handle1 = NULL;
- }
-
- if (Param2 != NULL) {
- Status = ShellConvertStringToUint64(Param2, &Intermediate, TRUE, FALSE);
- Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param2);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- } else {
- Handle2 = NULL;
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- if (Param1 != NULL && Handle1 == NULL){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (Param2 != NULL && Handle2 == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param2);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (Handle2 != NULL && Handle1 != NULL && EFI_ERROR(gBS->OpenProtocol(Handle2, &gEfiDriverBindingProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param2);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ConvertAndConnectControllers(Handle1, Handle2, ShellCommandLineGetFlag(Package, L"-r"), (BOOLEAN)(Count!=0));
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CONNECT_NONE), gShellDriver1HiiHandle);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- }
- }
- }
-
- ShellCommandLineFreeVarList (Package);
- }
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c
deleted file mode 100644
index 1548770379..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/** @file
- Main file for DevTree shell Driver1 function.
-
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-d", TypeFlag},
- {L"-l", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Display a tree starting from this handle.
-
- @param[in] TheHandle The handle to start with.
- @param[in] Lang Optionally, a UEFI defined language code.
- @param[in] UseDevPaths TRUE to display info from DevPath as identifiers.
- FALSE will use component name protocol instead.
- @param[in] IndentCharCount How many characters to indent (allows for recursion).
- @param[in] HiiString The string from HII to use for output.
-
- @retval SHELL_SUCCESS The operation was successful.
-**/
-SHELL_STATUS
-EFIAPI
-DoDevTreeForHandle(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST CHAR8 *Lang OPTIONAL,
- IN CONST BOOLEAN UseDevPaths,
- IN CONST UINTN IndentCharCount,
- IN CONST CHAR16 *HiiString
- )
-{
- SHELL_STATUS ShellStatus;
- EFI_STATUS Status;
- CHAR16 *FormatString;
- CHAR16 *Name;
- EFI_HANDLE *ChildHandleBuffer;
- UINTN ChildCount;
- UINTN LoopVar;
-
- Status = EFI_SUCCESS;
- ShellStatus = SHELL_SUCCESS;
- Name = NULL;
- ChildHandleBuffer = NULL;
- ChildCount = 0;
-
- ASSERT(TheHandle != NULL);
- //
- // We want controller handles. they will not have LoadedImage or DriverBinding (or others...)
- //
- Status = gBS->OpenProtocol (
- TheHandle,
- &gEfiDriverBindingProtocolGuid,
- NULL,
- NULL,
- NULL,
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL
- );
- if (!EFI_ERROR (Status)) {
- return SHELL_SUCCESS;
- }
-
- Status = gBS->OpenProtocol (
- TheHandle,
- &gEfiLoadedImageProtocolGuid,
- NULL,
- NULL,
- NULL,
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL
- );
- if (!EFI_ERROR (Status)) {
- return SHELL_SUCCESS;
- }
-
- FormatString = AllocateZeroPool(StrSize(HiiString) + (10)*sizeof(FormatString[0]));
-
- ASSERT(HiiString != NULL);
- ASSERT(FormatString != NULL);
-
- //
- // we generate the format string on the fly so that we can control the
- // number of space characters that the first (empty) string has. this
- // handles the indenting.
- //
-
- UnicodeSPrint(FormatString, StrSize(HiiString) + (10)*sizeof(FormatString[0]), L"%%%ds %s", IndentCharCount, HiiString);
- gEfiShellProtocol->GetDeviceName((EFI_HANDLE)TheHandle, !UseDevPaths?EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH:EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Lang, &Name);
- //
- // print out the information for ourselves
- //
- ShellPrintEx(
- -1,
- -1,
- FormatString,
- L"",
- ConvertHandleToHandleIndex(TheHandle),
- Name==NULL?L"Unknown":Name);
-
- FreePool(FormatString);
- if (Name != NULL) {
- FreePool(Name);
- }
-
- //
- // recurse on each child handle with IndentCharCount + 2
- //
- ParseHandleDatabaseForChildControllers(TheHandle, &ChildCount, &ChildHandleBuffer);
- for (LoopVar = 0 ; LoopVar < ChildCount && ShellStatus == SHELL_SUCCESS; LoopVar++){
- ShellStatus = DoDevTreeForHandle(ChildHandleBuffer[LoopVar], Lang, UseDevPaths, IndentCharCount+2, HiiString);
- }
-
- if (ChildHandleBuffer != NULL) {
- FreePool(ChildHandleBuffer);
- }
-
- return (ShellStatus);
-}
-
-/**
- Function for 'devtree' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDevTree (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CHAR8 *Language;
- CONST CHAR16 *Lang;
- CHAR16 *HiiString;
- UINTN LoopVar;
- EFI_HANDLE TheHandle;
- BOOLEAN FlagD;
- UINT64 Intermediate;
- UINTN ParentControllerHandleCount;
- EFI_HANDLE *ParentControllerHandleBuffer;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- Language = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellCommandLineFreeVarList (Package);
- return (SHELL_INVALID_PARAMETER);
- }
- Lang = ShellCommandLineGetValue(Package, L"-l");
- if (Lang != NULL) {
- Language = AllocateZeroPool(StrSize(Lang));
- AsciiSPrint(Language, StrSize(Lang), "%S", Lang);
- } else if (!ShellCommandLineGetFlag(Package, L"-l")){
- ASSERT(Language == NULL);
-// Language = AllocateZeroPool(10);
-// AsciiSPrint(Language, 10, "en-us");
- } else {
- ASSERT(Language == NULL);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-l");
- ShellCommandLineFreeVarList (Package);
- return (SHELL_INVALID_PARAMETER);
- }
- FlagD = ShellCommandLineGetFlag(Package, L"-d");
-
- Lang = ShellCommandLineGetRawValue(Package, 1);
- HiiString = HiiGetString(gShellDriver1HiiHandle, STRING_TOKEN (STR_DEV_TREE_OUTPUT), Language);
-
- if (Lang == NULL) {
- for (LoopVar = 1 ; ; LoopVar++){
- TheHandle = ConvertHandleIndexToHandle(LoopVar);
- if (TheHandle == NULL){
- break;
- }
-
- //
- // Skip handles that do not have device path protocol
- //
- Status = gBS->OpenProtocol (
- TheHandle,
- &gEfiDevicePathProtocolGuid,
- NULL,
- NULL,
- NULL,
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- //
- // Skip handles that do have parents
- //
- ParentControllerHandleBuffer = NULL;
- Status = PARSE_HANDLE_DATABASE_PARENTS (
- TheHandle,
- &ParentControllerHandleCount,
- &ParentControllerHandleBuffer
- );
- SHELL_FREE_NON_NULL (ParentControllerHandleBuffer);
- if (ParentControllerHandleCount > 0) {
- continue;
- }
-
- //
- // Start a devtree from TheHandle that has a device path and no parents
- //
- ShellStatus = DoDevTreeForHandle(TheHandle, Language, FlagD, 0, HiiString);
- }
- } else {
- Status = ShellConvertStringToUint64(Lang, &Intermediate, TRUE, FALSE);
- if (EFI_ERROR(Status) || ConvertHandleIndexToHandle((UINTN)Intermediate) == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Lang);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ShellStatus = DoDevTreeForHandle(ConvertHandleIndexToHandle((UINTN)Intermediate), Language, FlagD, 0, HiiString);
- }
- }
-
- if (HiiString != NULL) {
- FreePool(HiiString);
- }
- SHELL_FREE_NON_NULL(Language);
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c
deleted file mode 100644
index 7998bde8c6..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/** @file
- Main file for devices shell Driver1 function.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-/**
- Get lots of info about a device from its handle.
-
- @param[in] TheHandle The device handle to get info on.
- @param[in, out] Type On successful return R, B, or D (root, bus, or
- device) will be placed in this buffer.
- @param[in, out] Cfg On successful return this buffer will be
- TRUE if the handle has configuration, FALSE
- otherwise.
- @param[in, out] Diag On successful return this buffer will be
- TRUE if the handle has disgnostics, FALSE
- otherwise.
- @param[in, out] Parents On successful return this buffer will be
- contain the number of parent handles.
- @param[in, out] Devices On successful return this buffer will be
- contain the number of devices controlled.
- @param[in, out] Children On successful return this buffer will be
- contain the number of child handles.
- @param[out] Name The pointer to a buffer that will be allocated
- and contain the string name of the handle.
- The caller must free this memory.
- @param[in] Language The language code as defined by the UEFI spec.
-
- @retval EFI_SUCCESS The info is there.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
-**/
-EFI_STATUS
-EFIAPI
-GetDeviceHandleInfo (
- IN EFI_HANDLE TheHandle,
- IN OUT CHAR16 *Type,
- IN OUT BOOLEAN *Cfg,
- IN OUT BOOLEAN *Diag,
- IN OUT UINTN *Parents,
- IN OUT UINTN *Devices,
- IN OUT UINTN *Children,
- OUT CHAR16 **Name,
- IN CONST CHAR8 *Language
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *HandleBuffer;
- UINTN Count;
-
- if (TheHandle == NULL
- || Type == NULL
- || Cfg == NULL
- || Diag == NULL
- || Parents == NULL
- || Devices == NULL
- || Children == NULL
- || Name == NULL ) {
- return (EFI_INVALID_PARAMETER);
- }
-
- *Cfg = FALSE;
- *Diag = FALSE;
- *Children = 0;
- *Parents = 0;
- *Devices = 0;
- *Type = L' ';
- *Name = CHAR_NULL;
- HandleBuffer = NULL;
- Status = EFI_SUCCESS;
-
- gEfiShellProtocol->GetDeviceName(TheHandle, EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, Name);
-
- Status = ParseHandleDatabaseForChildControllers(TheHandle, Children, NULL);
-// if (!EFI_ERROR(Status)) {
- Status = PARSE_HANDLE_DATABASE_PARENTS(TheHandle, Parents, NULL);
- if (/*!EFI_ERROR(Status) && */Parents != NULL && Children != NULL) {
- if (*Parents == 0) {
- *Type = L'R';
- } else if (*Children > 0) {
- *Type = L'B';
- } else {
- *Type = L'D';
- }
- }
-// }
- Status = PARSE_HANDLE_DATABASE_UEFI_DRIVERS(TheHandle, Devices, &HandleBuffer);
- if (!EFI_ERROR(Status) && Devices != NULL && HandleBuffer != NULL) {
- for (Count = 0 ; Count < *Devices ; Count++) {
- if (!EFI_ERROR(gBS->OpenProtocol(HandleBuffer[Count], &gEfiDriverConfigurationProtocolGuid, NULL, NULL, gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- *Cfg = TRUE;
- }
- if (!EFI_ERROR(gBS->OpenProtocol(HandleBuffer[Count], &gEfiDriverDiagnosticsProtocolGuid, NULL, NULL, gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- *Diag = TRUE;
- }
- if (!EFI_ERROR(gBS->OpenProtocol(HandleBuffer[Count], &gEfiDriverDiagnostics2ProtocolGuid, NULL, NULL, gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- *Diag = TRUE;
- }
- }
- SHELL_FREE_NON_NULL(HandleBuffer);
- }
-
- return (Status);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-l", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'devices' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDevices (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CHAR8 *Language;
- EFI_HANDLE *HandleList;
- EFI_HANDLE *HandleListWalker;
- CHAR16 Type;
- BOOLEAN Cfg;
- BOOLEAN Diag;
- UINTN Parents;
- UINTN Devices;
- UINTN Children;
- CHAR16 *Name;
- CONST CHAR16 *Lang;
-
- ShellStatus = SHELL_SUCCESS;
- Language = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // if more than 0 'value' parameters we have too many parameters
- //
- if (ShellCommandLineGetRawValue(Package, 1) != NULL){
- //
- // error for too many parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // get the language if necessary
- //
- Lang = ShellCommandLineGetValue(Package, L"-l");
- if (Lang != NULL) {
- Language = AllocateZeroPool(StrSize(Lang));
- AsciiSPrint(Language, StrSize(Lang), "%S", Lang);
- } else if (!ShellCommandLineGetFlag(Package, L"-l")){
- ASSERT(Language == NULL);
-// Language = AllocateZeroPool(10);
-// AsciiSPrint(Language, 10, "en-us");
- } else {
- ASSERT(Language == NULL);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-l");
- ShellCommandLineFreeVarList (Package);
- return (SHELL_INVALID_PARAMETER);
- }
-
-
- //
- // Print Header
- //
- ShellPrintHiiEx(-1, -1, Language, STRING_TOKEN (STR_DEVICES_HEADER_LINES), gShellDriver1HiiHandle);
-
- //
- // loop through each handle
- //
- HandleList = GetHandleListByProtocol(NULL);
- ASSERT(HandleList != NULL);
- for (HandleListWalker = HandleList
- ; HandleListWalker != NULL && *HandleListWalker != NULL /*&& !EFI_ERROR(Status)*/
- ; HandleListWalker++
- ){
-
- //
- // get all the info on each handle
- //
- Name = NULL;
- Status = GetDeviceHandleInfo(*HandleListWalker, &Type, &Cfg, &Diag, &Parents, &Devices, &Children, &Name, Language);
- if (Name != NULL && (Parents != 0 || Devices != 0 || Children != 0)) {
- ShellPrintHiiEx(
- -1,
- -1,
- Language,
- STRING_TOKEN (STR_DEVICES_ITEM_LINE),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(*HandleListWalker),
- Type,
- Cfg?L'X':L'-',
- Diag?L'X':L'-',
- Parents,
- Devices,
- Children,
- Name!=NULL?Name:L"<UNKNOWN>");
- }
- if (Name != NULL) {
- FreePool(Name);
- }
- }
-
- if (HandleList != NULL) {
- FreePool(HandleList);
- }
-
- }
- SHELL_FREE_NON_NULL(Language);
- ShellCommandLineFreeVarList (Package);
- }
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
deleted file mode 100644
index c369b79b77..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
+++ /dev/null
@@ -1,996 +0,0 @@
-/** @file
- Main file for Dh shell Driver1 function.
-
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-p", TypeValue},
- {L"-d", TypeFlag},
- {L"-v", TypeFlag},
- {L"-verbose", TypeFlag},
- {L"-sfo", TypeFlag},
- {L"-l", TypeValue},
- {NULL, TypeMax}
- };
-
-STATIC CONST EFI_GUID *UefiDriverModelProtocolsGuidArray[] = {
- &gEfiDriverBindingProtocolGuid,
- &gEfiPlatformDriverOverrideProtocolGuid,
- &gEfiBusSpecificDriverOverrideProtocolGuid,
- &gEfiDriverDiagnosticsProtocolGuid,
- &gEfiDriverDiagnostics2ProtocolGuid,
- &gEfiComponentNameProtocolGuid,
- &gEfiComponentName2ProtocolGuid,
- &gEfiPlatformToDriverConfigurationProtocolGuid,
- &gEfiDriverSupportedEfiVersionProtocolGuid,
- &gEfiDriverFamilyOverrideProtocolGuid,
- &gEfiDriverHealthProtocolGuid,
- &gEfiLoadedImageProtocolGuid,
- NULL
-};
-
-/**
- Get the name of a driver by it's handle.
-
- If a name is found the memory must be callee freed.
-
- @param[in] TheHandle The driver's handle.
- @param[in] Language The language to use.
- @param[in] NameFound Upon a successful return the name found.
-
- @retval EFI_SUCCESS The name was found.
-**/
-EFI_STATUS
-EFIAPI
-GetDriverName (
- IN EFI_HANDLE TheHandle,
- IN CONST CHAR8 *Language,
- IN CHAR16 **NameFound
- )
-{
- CHAR8 *Lang;
- CHAR8 *TempChar;
- EFI_STATUS Status;
- EFI_COMPONENT_NAME2_PROTOCOL *CompName2;
- CHAR16 *NameToReturn;
- //
- // Go through those handles until we get one that passes for GetComponentName
- //
- Status = gBS->OpenProtocol(
- TheHandle,
- &gEfiComponentName2ProtocolGuid,
- (VOID**)&CompName2,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
- Status = gBS->OpenProtocol(
- TheHandle,
- &gEfiComponentNameProtocolGuid,
- (VOID**)&CompName2,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- }
-
- if (EFI_ERROR(Status)) {
- return (EFI_NOT_FOUND);
- }
- if (Language == NULL) {
- Lang = AllocateZeroPool(AsciiStrSize(CompName2->SupportedLanguages));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, CompName2->SupportedLanguages);
- TempChar = AsciiStrStr(Lang, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Lang = AllocateZeroPool(AsciiStrSize(Language));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, Language);
- }
- Status = CompName2->GetDriverName(CompName2, Lang, &NameToReturn);
- FreePool(Lang);
-
- if (!EFI_ERROR(Status) && NameToReturn != NULL) {
- *NameFound = NULL;
- StrnCatGrow(NameFound, NULL, NameToReturn, 0);
- }
- return (Status);
-}
-
-/**
- Discover if a protocol guid is one of the UEFI Driver Model Protocols.
-
- @param[in] Guid The guid to test.
-
- @retval TRUE The guid does represent a driver model protocol.
- @retval FALSE The guid does not represent a driver model protocol.
-**/
-BOOLEAN
-EFIAPI
-IsDriverProt (
- IN CONST EFI_GUID *Guid
- )
-{
- CONST EFI_GUID **GuidWalker;
- BOOLEAN GuidFound;
- GuidFound = FALSE;
- for (GuidWalker = UefiDriverModelProtocolsGuidArray
- ; GuidWalker != NULL && *GuidWalker != NULL
- ; GuidWalker++
- ){
- if (CompareGuid(*GuidWalker, Guid)) {
- GuidFound = TRUE;
- break;
- }
- }
- return (GuidFound);
-}
-
-/**
- Get information for a handle.
-
- @param[in] TheHandle The handles to show info on.
- @param[in] Language Language string per UEFI specification.
- @param[in] Seperator Separator string between information blocks.
- @param[in] Verbose TRUE for extra info, FALSE otherwise.
- @param[in] ExtraInfo TRUE for extra info, FALSE otherwise.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER ProtocolName was NULL or invalid.
-**/
-CHAR16*
-EFIAPI
-GetProtocolInfoString(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST CHAR8 *Language,
- IN CONST CHAR16 *Seperator,
- IN CONST BOOLEAN Verbose,
- IN CONST BOOLEAN ExtraInfo
- )
-{
- EFI_GUID **ProtocolGuidArray;
- UINTN ArrayCount;
- UINTN ProtocolIndex;
- EFI_STATUS Status;
- CHAR16 *RetVal;
- UINTN Size;
- CHAR16 *Temp;
-
- ProtocolGuidArray = NULL;
- RetVal = NULL;
- Size = 0;
-
- Status = gBS->ProtocolsPerHandle (
- TheHandle,
- &ProtocolGuidArray,
- &ArrayCount
- );
- if (!EFI_ERROR (Status)) {
- for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) {
- Temp = GetStringNameFromGuid(ProtocolGuidArray[ProtocolIndex], Language);
- if (Temp != NULL) {
- ASSERT((RetVal == NULL && Size == 0) || (RetVal != NULL));
- if (Size != 0) {
- StrnCatGrow(&RetVal, &Size, Seperator, 0);
- }
- StrnCatGrow(&RetVal, &Size, L"%H", 0);
- StrnCatGrow(&RetVal, &Size, Temp, 0);
- StrnCatGrow(&RetVal, &Size, L"%N", 0);
- FreePool(Temp);
- }
- if (ExtraInfo) {
- Temp = GetProtocolInformationDump(TheHandle, ProtocolGuidArray[ProtocolIndex], Verbose);
- if (Temp != NULL) {
- ASSERT((RetVal == NULL && Size == 0) || (RetVal != NULL));
- if (!Verbose) {
- StrnCatGrow(&RetVal, &Size, L"(", 0);
- StrnCatGrow(&RetVal, &Size, Temp, 0);
- StrnCatGrow(&RetVal, &Size, L")\r\n", 0);
- } else {
- StrnCatGrow(&RetVal, &Size, Seperator, 0);
- StrnCatGrow(&RetVal, &Size, Temp, 0);
- }
- FreePool(Temp);
- }
- }
- }
- }
-
- SHELL_FREE_NON_NULL(ProtocolGuidArray);
-
- if (RetVal == NULL) {
- return (NULL);
- }
-
- ASSERT((RetVal == NULL && Size == 0) || (RetVal != NULL));
- StrnCatGrow(&RetVal, &Size, Seperator, 0);
- return (RetVal);
-}
-
-/**
- Gets the name of the loaded image.
-
- @param[in] TheHandle The handle of the driver to get info on.
- @param[out] Name The pointer to the pointer. Valid upon a successful return.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-GetDriverImageName (
- IN EFI_HANDLE TheHandle,
- OUT CHAR16 **Name
- )
-{
- // get loaded image and devicepathtotext on image->Filepath
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
-
- if (TheHandle == NULL || Name == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- Status = gBS->OpenProtocol (
- TheHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **) &LoadedImage,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR(Status)) {
- return (Status);
- }
- DevicePath = LoadedImage->FilePath;
- *Name = ConvertDevicePathToText(DevicePath, TRUE, TRUE);
- return (EFI_SUCCESS);
-}
-
-/**
- Display driver model information for a given handle.
-
- @param[in] Handle The handle to display info on.
- @param[in] BestName Use the best name?
- @param[in] Language The language to output in.
-**/
-EFI_STATUS
-EFIAPI
-DisplayDriverModelHandle (
- IN EFI_HANDLE Handle,
- IN BOOLEAN BestName,
- IN CONST CHAR8 *Language OPTIONAL
- )
-{
- EFI_STATUS Status;
- BOOLEAN ConfigurationStatus;
- BOOLEAN DiagnosticsStatus;
- UINTN DriverBindingHandleCount;
- EFI_HANDLE *DriverBindingHandleBuffer;
- UINTN ParentControllerHandleCount;
- EFI_HANDLE *ParentControllerHandleBuffer;
- UINTN ChildControllerHandleCount;
- EFI_HANDLE *ChildControllerHandleBuffer;
- CHAR16 *TempStringPointer;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- UINTN Index;
- CHAR16 *DriverName;
- EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
- UINTN NumberOfChildren;
- UINTN HandleIndex;
- UINTN ControllerHandleCount;
- EFI_HANDLE *ControllerHandleBuffer;
- UINTN ChildIndex;
- BOOLEAN Image;
-
- //
- // See if Handle is a device handle and display its details.
- //
- DriverBindingHandleBuffer = NULL;
- Status = PARSE_HANDLE_DATABASE_UEFI_DRIVERS (
- Handle,
- &DriverBindingHandleCount,
- &DriverBindingHandleBuffer
- );
-
- ParentControllerHandleBuffer = NULL;
- Status = PARSE_HANDLE_DATABASE_PARENTS (
- Handle,
- &ParentControllerHandleCount,
- &ParentControllerHandleBuffer
- );
-
- ChildControllerHandleBuffer = NULL;
- Status = ParseHandleDatabaseForChildControllers (
- Handle,
- &ChildControllerHandleCount,
- &ChildControllerHandleBuffer
- );
-
- DiagnosticsStatus = FALSE;
- ConfigurationStatus = FALSE;
-
- if (!EFI_ERROR(gBS->OpenProtocol(Handle, &gEfiDriverConfigurationProtocolGuid, NULL, NULL, gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- ConfigurationStatus = TRUE;
- }
- if (!EFI_ERROR(gBS->OpenProtocol(Handle, &gEfiDriverConfiguration2ProtocolGuid, NULL, NULL, gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- ConfigurationStatus = TRUE;
- }
- if (!EFI_ERROR(gBS->OpenProtocol(Handle, &gEfiDriverDiagnosticsProtocolGuid, NULL, NULL, gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- DiagnosticsStatus = TRUE;
- }
- if (!EFI_ERROR(gBS->OpenProtocol(Handle, &gEfiDriverDiagnostics2ProtocolGuid, NULL, NULL, gImageHandle, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- DiagnosticsStatus = TRUE;
- }
-
- Status = EFI_SUCCESS;
-
- if (DriverBindingHandleCount > 0 || ParentControllerHandleCount > 0 || ChildControllerHandleCount > 0) {
-
-
-
- DevicePath = NULL;
- TempStringPointer = NULL;
- Status = gBS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID**)&DevicePath);
-
- Status = gEfiShellProtocol->GetDeviceName(Handle, EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER1), gShellDriver1HiiHandle, TempStringPointer!=NULL?TempStringPointer:L"<Unknown>");
- SHELL_FREE_NON_NULL(TempStringPointer);
-
- TempStringPointer = ConvertDevicePathToText(DevicePath, TRUE, FALSE);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER2),
- gShellDriver1HiiHandle,
- TempStringPointer!=NULL?TempStringPointer:L"<None>",
- ParentControllerHandleCount == 0?L"ROOT":(ChildControllerHandleCount > 0)?L"BUS":L"DEVICE",
- ConfigurationStatus?L"YES":L"NO",
- DiagnosticsStatus?L"YES":L"NO"
- );
-
- SHELL_FREE_NON_NULL(TempStringPointer);
-
- if (DriverBindingHandleCount == 0) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER3),
- gShellDriver1HiiHandle,
- L"<None>"
- );
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER3),
- gShellDriver1HiiHandle,
- L""
- );
- for (Index = 0; Index < DriverBindingHandleCount; Index++) {
- Image = FALSE;
- Status = GetDriverName (
- DriverBindingHandleBuffer[Index],
- Language,
- &DriverName
- );
- if (EFI_ERROR (Status)) {
- Status = GetDriverImageName (
- DriverBindingHandleBuffer[Index],
- &DriverName
- );
- if (EFI_ERROR (Status)) {
- DriverName = NULL;
- }
- }
-
- if (Image) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER4A),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex (DriverBindingHandleBuffer[Index]),
- DriverName!=NULL?DriverName:L"<Unknown>"
- );
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER4B),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex (DriverBindingHandleBuffer[Index]),
- DriverName!=NULL?DriverName:L"<Unknown>"
- );
- }
- SHELL_FREE_NON_NULL(DriverName);
- }
- }
-
- if (ParentControllerHandleCount == 0) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER5),
- gShellDriver1HiiHandle,
- L"<None>"
- );
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER5),
- gShellDriver1HiiHandle,
- L""
- );
- for (Index = 0; Index < ParentControllerHandleCount; Index++) {
- Status = gEfiShellProtocol->GetDeviceName(ParentControllerHandleBuffer[Index], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER5B),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex (ParentControllerHandleBuffer[Index]),
- TempStringPointer!=NULL?TempStringPointer:L"<Unknown>"
- );
- SHELL_FREE_NON_NULL(TempStringPointer);
- }
- }
-
- if (ChildControllerHandleCount == 0) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER6),
- gShellDriver1HiiHandle,
- L"<None>"
- );
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER6),
- gShellDriver1HiiHandle,
- L""
- );
- for (Index = 0; Index < ChildControllerHandleCount; Index++) {
- Status = gEfiShellProtocol->GetDeviceName(ChildControllerHandleBuffer[Index], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER6B),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex (ChildControllerHandleBuffer[Index]),
- TempStringPointer!=NULL?TempStringPointer:L"<Unknown>"
- );
- SHELL_FREE_NON_NULL(TempStringPointer);
- }
- }
- }
-
- SHELL_FREE_NON_NULL(DriverBindingHandleBuffer);
-
- SHELL_FREE_NON_NULL(ParentControllerHandleBuffer);
-
- SHELL_FREE_NON_NULL(ChildControllerHandleBuffer);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // See if Handle is a driver binding handle and display its details.
- //
- Status = gBS->OpenProtocol (
- Handle,
- &gEfiDriverBindingProtocolGuid,
- (VOID **) &DriverBinding,
- NULL,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- return EFI_SUCCESS;
- }
-
- NumberOfChildren = 0;
- ControllerHandleBuffer = NULL;
- Status = PARSE_HANDLE_DATABASE_DEVICES (
- Handle,
- &ControllerHandleCount,
- &ControllerHandleBuffer
- );
- if (ControllerHandleCount > 0) {
- for (HandleIndex = 0; HandleIndex < ControllerHandleCount; HandleIndex++) {
- Status = PARSE_HANDLE_DATABASE_MANAGED_CHILDREN (
- Handle,
- ControllerHandleBuffer[HandleIndex],
- &ChildControllerHandleCount,
- NULL
- );
- NumberOfChildren += ChildControllerHandleCount;
- }
- }
-
- Status = GetDriverName (Handle, Language, &DriverName);
- if (EFI_ERROR (Status)) {
- DriverName = NULL;
- }
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER6B),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(Handle),
- DriverName!=NULL?DriverName:L"<Unknown>"
- );
- SHELL_FREE_NON_NULL(DriverName);
- Status = GetDriverImageName (
- Handle,
- &DriverName
- );
- if (EFI_ERROR (Status)) {
- DriverName = NULL;
- }
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER7B),
- gShellDriver1HiiHandle,
- DriverName!=NULL?DriverName:L"<Unknown>"
- );
- SHELL_FREE_NON_NULL(DriverName);
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER8),
- gShellDriver1HiiHandle,
- DriverBinding->Version,
- NumberOfChildren > 0?L"Bus":ControllerHandleCount > 0?L"Device":L"<Unknown>",
- ConfigurationStatus?L"YES":L"NO",
- DiagnosticsStatus?L"YES":L"NO"
- );
-
- if (ControllerHandleCount == 0) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER6),
- gShellDriver1HiiHandle,
- L"None"
- );
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER6),
- gShellDriver1HiiHandle,
- L""
- );
- for (HandleIndex = 0; HandleIndex < ControllerHandleCount; HandleIndex++) {
- Status = gEfiShellProtocol->GetDeviceName(ControllerHandleBuffer[HandleIndex], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer);
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER9B),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(ControllerHandleBuffer[HandleIndex]),
- TempStringPointer!=NULL?TempStringPointer:L"<Unknown>"
- );
- SHELL_FREE_NON_NULL(TempStringPointer);
-
- Status = PARSE_HANDLE_DATABASE_MANAGED_CHILDREN (
- Handle,
- ControllerHandleBuffer[HandleIndex],
- &ChildControllerHandleCount,
- &ChildControllerHandleBuffer
- );
- if (!EFI_ERROR (Status)) {
- for (ChildIndex = 0; ChildIndex < ChildControllerHandleCount; ChildIndex++) {
- Status = gEfiShellProtocol->GetDeviceName(ChildControllerHandleBuffer[ChildIndex], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer);
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_DRIVER6B),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(ChildControllerHandleBuffer[ChildIndex]),
- TempStringPointer!=NULL?TempStringPointer:L"<Unknown>"
- );
- SHELL_FREE_NON_NULL(TempStringPointer);
- }
-
- SHELL_FREE_NON_NULL (ChildControllerHandleBuffer);
- }
- }
-
- SHELL_FREE_NON_NULL (ControllerHandleBuffer);
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Display information for a handle.
-
- @param[in] TheHandle The handles to show info on.
- @param[in] Verbose TRUE for extra info, FALSE otherwise.
- @param[in] Sfo TRUE to output in standard format output (spec).
- @param[in] Language Language string per UEFI specification.
- @param[in] DriverInfo TRUE to show all info about the handle.
- @param[in] Multiple TRUE indicates more than will be output,
- FALSE for a single one.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER ProtocolName was NULL or invalid.
-**/
-SHELL_STATUS
-EFIAPI
-DoDhByHandle(
- IN CONST EFI_HANDLE TheHandle,
- IN CONST BOOLEAN Verbose,
- IN CONST BOOLEAN Sfo,
- IN CONST CHAR8 *Language,
- IN CONST BOOLEAN DriverInfo,
- IN CONST BOOLEAN Multiple
- )
-{
- CHAR16 *ProtocolInfoString;
- SHELL_STATUS ShellStatus;
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
- ShellStatus = SHELL_SUCCESS;
- ProtocolInfoString = NULL;
-
- if (!Sfo) {
- if (Multiple) {
- ProtocolInfoString = GetProtocolInfoString(TheHandle, Language, L" ", Verbose, TRUE);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(TheHandle),
- ProtocolInfoString==NULL?L"":ProtocolInfoString);
- } else {
- ProtocolInfoString = GetProtocolInfoString(TheHandle, Language, L"\r\n", Verbose, TRUE);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_SINGLE),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(TheHandle),
- TheHandle,
- ProtocolInfoString==NULL?L"":ProtocolInfoString);
- }
-
- if (DriverInfo) {
- DisplayDriverModelHandle ((EFI_HANDLE)TheHandle, TRUE, Language);
- }
- } else {
- ProtocolInfoString = GetProtocolInfoString(TheHandle, Language, L";", FALSE, FALSE);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DH_OUTPUT_SFO),
- gShellDriver1HiiHandle,
- Multiple ?L"HandlesInfo":L"HandleInfo",
- L"DriverName",
- L"ControllerName",
- ConvertHandleToHandleIndex(TheHandle),
- L"DevPath",
- ProtocolInfoString==NULL?L"":ProtocolInfoString);
-
-
- }
-
-
- if (ProtocolInfoString != NULL) {
- FreePool(ProtocolInfoString);
- }
- return (ShellStatus);
-}
-
-/**
- Display information for all handles on a list.
-
- @param[in] HandleList The NULL-terminated list of handles.
- @param[in] Verbose TRUE for extra info, FALSE otherwise.
- @param[in] Sfo TRUE to output in standard format output (spec).
- @param[in] Language Language string per UEFI specification.
- @param[in] DriverInfo TRUE to show all info about the handle.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER ProtocolName was NULL or invalid.
-**/
-SHELL_STATUS
-EFIAPI
-DoDhForHandleList(
- IN CONST EFI_HANDLE *HandleList,
- IN CONST BOOLEAN Verbose,
- IN CONST BOOLEAN Sfo,
- IN CONST CHAR8 *Language,
- IN CONST BOOLEAN DriverInfo
- )
-{
- CONST EFI_HANDLE *HandleWalker;
- SHELL_STATUS ShellStatus;
-
- ShellStatus = SHELL_SUCCESS;
-
- for (HandleWalker = HandleList ; HandleWalker != NULL && *HandleWalker != NULL && ShellStatus == SHELL_SUCCESS; HandleWalker++) {
- ShellStatus = DoDhByHandle(
- *HandleWalker,
- Verbose,
- Sfo,
- Language,
- DriverInfo,
- TRUE
- );
- }
- return (ShellStatus);
-}
-
-/**
- Display information for all handles.
-
- @param[in] Sfo TRUE to output in standard format output (spec).
- @param[in] Verbose TRUE for extra info, FALSE otherwise.
- @param[in] Language Language string per UEFI specification.
- @param[in] DriverInfo TRUE to show all info about the handle.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER ProtocolName was NULL or invalid.
-**/
-SHELL_STATUS
-EFIAPI
-DoDhForAll(
- IN CONST BOOLEAN Sfo,
- IN CONST BOOLEAN Verbose,
- IN CONST CHAR8 *Language,
- IN CONST BOOLEAN DriverInfo
- )
-{
- EFI_HANDLE *HandleList;
- SHELL_STATUS ShellStatus;
-
- HandleList = GetHandleListByProtocol(NULL);
-
- ShellStatus = DoDhForHandleList(
- HandleList,
- Verbose,
- Sfo,
- Language,
- DriverInfo);
-
- FreePool(HandleList);
-
- return (ShellStatus);
-}
-
-/**
- Display information for all handles which have a specific protocol.
-
- @param[in] ProtocolName The pointer to the name of the protocol.
- @param[in] Verbose TRUE for extra info, FALSE otherwise.
- @param[in] Sfo TRUE to output in standard format output (spec).
- @param[in] Language Language string per UEFI specification.
- @param[in] DriverInfo TRUE to show all info about the handle.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER ProtocolName was NULL or invalid.
-**/
-SHELL_STATUS
-EFIAPI
-DoDhByProtocol(
- IN CONST CHAR16 *ProtocolName,
- IN CONST BOOLEAN Verbose,
- IN CONST BOOLEAN Sfo,
- IN CONST CHAR8 *Language,
- IN CONST BOOLEAN DriverInfo
- )
-{
- EFI_GUID *Guid;
- EFI_STATUS Status;
- EFI_HANDLE *HandleList;
- SHELL_STATUS ShellStatus;
-
- if (ProtocolName == NULL) {
- return (SHELL_INVALID_PARAMETER);
- }
-
- Status = GetGuidFromStringName(ProtocolName, Language, &Guid);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DH_NO_GUID_FOUND), gShellDriver1HiiHandle, ProtocolName);
- return (SHELL_INVALID_PARAMETER);
- }
-
- HandleList = GetHandleListByProtocol(Guid);
-
- ShellStatus = DoDhForHandleList(
- HandleList,
- Verbose,
- Sfo,
- Language,
- DriverInfo);
-
- SHELL_FREE_NON_NULL(HandleList);
-
- return (ShellStatus);
-}
-
-/**
- Function for 'dh' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDh (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CHAR8 *Language;
- CONST CHAR16 *Lang;
- CONST CHAR16 *Temp2;
- BOOLEAN SfoMode;
- BOOLEAN FlagD;
- BOOLEAN Verbose;
- UINT64 Intermediate;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- Language = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellCommandLineFreeVarList (Package);
- return (SHELL_INVALID_PARAMETER);
- }
-
- Lang = ShellCommandLineGetValue(Package, L"-l");
- if (Lang != NULL) {
- Language = AllocateZeroPool(StrSize(Lang));
- AsciiSPrint(Language, StrSize(Lang), "%S", Lang);
- } else if (!ShellCommandLineGetFlag(Package, L"-l")){
- Language = AllocateZeroPool(10);
- AsciiSPrint(Language, 10, "en-us");
- } else {
- ASSERT(Language == NULL);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-l");
- ShellCommandLineFreeVarList (Package);
- return (SHELL_INVALID_PARAMETER);
- }
-
- SfoMode = ShellCommandLineGetFlag(Package, L"-sfo");
- FlagD = ShellCommandLineGetFlag(Package, L"-d");
- Verbose = (BOOLEAN)(ShellCommandLineGetFlag(Package, L"-v") || ShellCommandLineGetFlag(Package, L"-verbose"));
-
- if (ShellCommandLineGetFlag(Package, L"-p")) {
- if (ShellCommandLineGetCount(Package) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetValue(Package, L"-p") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-p");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // print by protocol
- //
- ShellStatus = DoDhByProtocol(
- ShellCommandLineGetValue(Package, L"-p"),
- Verbose,
- SfoMode,
- Lang==NULL?NULL:Language,
- FlagD
- );
- }
- } else {
- Temp2 = ShellCommandLineGetRawValue(Package, 1);
- if (Temp2 == NULL) {
- //
- // Print everything
- //
- ShellStatus = DoDhForAll(
- SfoMode,
- Verbose,
- Lang==NULL?NULL:Language,
- FlagD
- );
- } else {
- Status = ShellConvertStringToUint64(Temp2, &Intermediate, TRUE, FALSE);
- if (EFI_ERROR(Status) || ConvertHandleIndexToHandle((UINTN)Intermediate) == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Temp2);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // print 1 handle
- //
- ShellStatus = DoDhByHandle(
- ConvertHandleIndexToHandle((UINTN)Intermediate),
- Verbose,
- SfoMode,
- Lang==NULL?NULL:Language,
- FlagD,
- FALSE
- );
- }
- }
- }
-
-
- ShellCommandLineFreeVarList (Package);
- SHELL_FREE_NON_NULL(Language);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c
deleted file mode 100644
index a33bed9dc8..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/** @file
- Main file for Disconnect shell Driver1 function.
-
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-r", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Disconnect everything.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-DisconnectAll(
- VOID
- )
-{
- //
- // Stolen from UEFI 2.3 spec (May 2009 version)
- // Pages 171/172
- // Removed gBS local definition
- //
-
- //
- // Disconnect All Handles Example
- // The following example recusively disconnects all drivers from all
- // controllers in a platform.
- //
- EFI_STATUS Status;
-// EFI_BOOT_SERVICES *gBS;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- UINTN HandleIndex;
- //
- // Retrieve the list of all handles from the handle database
- //
- Status = gBS->LocateHandleBuffer (
- AllHandles,
- NULL,
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- if (!EFI_ERROR (Status)) {
- for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
- Status = gBS->DisconnectController (
- HandleBuffer[HandleIndex],
- NULL,
- NULL
- );
- }
- gBS->FreePool(HandleBuffer);
- //
- // end of stealing
- //
- }
- return (EFI_SUCCESS);
-}
-
-/**
- Function for 'disconnect' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDisconnect (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Param1;
- CONST CHAR16 *Param2;
- CONST CHAR16 *Param3;
- EFI_HANDLE Handle1;
- EFI_HANDLE Handle2;
- EFI_HANDLE Handle3;
- UINT64 Intermediate1;
- UINT64 Intermediate2;
- UINT64 Intermediate3;
-
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetFlag(Package, L"-r")){
- if (ShellCommandLineGetCount(Package) > 1){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = DisconnectAll();
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 4){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // must have between 1 and 3 handles passed in ...
- //
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- Param2 = ShellCommandLineGetRawValue(Package, 2);
- Param3 = ShellCommandLineGetRawValue(Package, 3);
- ShellConvertStringToUint64(Param1, &Intermediate1, TRUE, FALSE);
- Handle1 = Param1!=NULL?ConvertHandleIndexToHandle((UINTN)Intermediate1):NULL;
- ShellConvertStringToUint64(Param2, &Intermediate2, TRUE, FALSE);
- Handle2 = Param2!=NULL?ConvertHandleIndexToHandle((UINTN)Intermediate2):NULL;
- ShellConvertStringToUint64(Param3, &Intermediate3, TRUE, FALSE);
- Handle3 = Param3!=NULL?ConvertHandleIndexToHandle((UINTN)Intermediate3):NULL;
-
- if (Param1 != NULL && Handle1 == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (Param2 != NULL && Handle2 == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param2);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (Param3 != NULL && Handle3 == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param3);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (Handle2 != NULL && EFI_ERROR(gBS->OpenProtocol(Handle2, &gEfiDriverBindingProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- ASSERT(Param2 != NULL);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_NOT), gShellDriver1HiiHandle, ShellStrToUintn(Param2), L"driver handle");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(Param1 != NULL);
- Status = gBS->DisconnectController(Handle1, Handle2, Handle3);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_3P_RESULT), gShellDriver1HiiHandle, L"Disconnect", (UINTN)Intermediate1, (UINTN)Intermediate2, (UINTN)Intermediate3, Status);
- }
- }
- }
- }
- if (ShellStatus == SHELL_SUCCESS) {
- if (Status == EFI_SECURITY_VIOLATION) {
- ShellStatus = SHELL_SECURITY_VIOLATION;
- } else if (Status == EFI_INVALID_PARAMETER) {
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (EFI_ERROR(Status)) {
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c
deleted file mode 100644
index a687e0dcb9..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/** @file
- Main file for Drivers shell Driver1 function.
-
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-sfo", TypeFlag},
- {L"-l", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Get a device path (in text format) for a given handle.
-
- @param[in] TheHandle The handle to get the device path for.
-
- @retval NULL An error occured.
- @return A pointer to the driver path as a string. The callee must
- free this memory.
-**/
-CHAR16*
-EFIAPI
-GetDevicePathTextForHandle(
- IN EFI_HANDLE TheHandle
- )
-{
- EFI_STATUS Status;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *FinalPath;
- CHAR16 *RetVal;
-
- FinalPath = NULL;
-
- Status = gBS->OpenProtocol (
- TheHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID**)&LoadedImage,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR (Status)) {
- Status = gBS->OpenProtocol (
- LoadedImage->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&ImageDevicePath,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR (Status)) {
- FinalPath = AppendDevicePath (ImageDevicePath, LoadedImage->FilePath);
- gBS->CloseProtocol(
- LoadedImage->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- gImageHandle,
- NULL);
- }
- gBS->CloseProtocol(
- TheHandle,
- &gEfiLoadedImageProtocolGuid,
- gImageHandle,
- NULL);
- }
-
- if (FinalPath == NULL) {
- return (NULL);
- }
- RetVal = gEfiShellProtocol->GetFilePathFromDevicePath(FinalPath);
- if (RetVal == NULL) {
- RetVal = ConvertDevicePathToText(FinalPath, TRUE, TRUE);
- }
- FreePool(FinalPath);
- return (RetVal);
-}
-
-/**
- Determine if the given handle has Driver Configuration protocol.
-
- @param[in] TheHandle The handle to the driver to test.
-
- @retval TRUE The driver does have Driver Configuration.
- @retval FALSE The driver does not have Driver Configuration.
-**/
-BOOLEAN
-EFIAPI
-ReturnDriverConfig(
- IN CONST EFI_HANDLE TheHandle
- )
-{
- EFI_STATUS Status;
- Status = gBS->OpenProtocol((EFI_HANDLE)TheHandle, &gEfiDriverConfigurationProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL);
- if (EFI_ERROR(Status)) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-/**
- Determine if the given handle has DriverDiagnostics protocol.
-
- @param[in] TheHandle The handle to the driver to test.
-
- @retval TRUE The driver does have Driver Diasgnostics.
- @retval FALSE The driver does not have Driver Diagnostics.
-**/
-BOOLEAN
-EFIAPI
-ReturnDriverDiag(
- IN CONST EFI_HANDLE TheHandle
- )
-{
- EFI_STATUS Status;
- Status = gBS->OpenProtocol((EFI_HANDLE)TheHandle, &gEfiDriverDiagnostics2ProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL);
- if (EFI_ERROR(Status)) {
- Status = gBS->OpenProtocol((EFI_HANDLE)TheHandle, &gEfiDriverDiagnosticsProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL);
- if (EFI_ERROR(Status)) {
- return (FALSE);
- }
- }
- return (TRUE);
-}
-
-/**
- Finds and returns the version of the driver specified by TheHandle.
-
- @param[in] TheHandle The driver handle to get the version of.
-
- @return The version of the driver.
- @retval 0xFFFFFFFF An error ocurred.
-**/
-UINT32
-EFIAPI
-ReturnDriverVersion(
- IN CONST EFI_HANDLE TheHandle
- )
-{
- EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
- EFI_STATUS Status;
- UINT32 RetVal;
-
- RetVal = (UINT32)-1;
-
- Status = gBS->OpenProtocol((EFI_HANDLE)TheHandle, &gEfiDriverBindingProtocolGuid, (VOID**)&DriverBinding, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!EFI_ERROR(Status)) {
- RetVal = DriverBinding->Version;
- gBS->CloseProtocol(TheHandle, &gEfiDriverBindingProtocolGuid, gImageHandle, NULL);
- }
- return (RetVal);
-}
-
-/**
- Function for 'drivers' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDrivers (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CHAR8 *Language;
- CONST CHAR16 *Lang;
- EFI_HANDLE *HandleList;
- EFI_HANDLE *HandleWalker;
- UINTN ChildCount;
- UINTN DeviceCount;
- CHAR16 *Temp2;
- CHAR16 *FormatString;
- UINT32 DriverVersion;
- BOOLEAN DriverConfig;
- BOOLEAN DriverDiag;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- Language = NULL;
- FormatString = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Lang = ShellCommandLineGetValue(Package, L"-l");
- if (Lang != NULL) {
- Language = AllocateZeroPool(StrSize(Lang));
- AsciiSPrint(Language, StrSize(Lang), "%S", Lang);
- } else if (!ShellCommandLineGetFlag(Package, L"-l")){
- ASSERT(Language == NULL);
- // Language = AllocateZeroPool(10);
- // AsciiSPrint(Language, 10, "en-us");
- } else {
- ASSERT(Language == NULL);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-l");
- ShellCommandLineFreeVarList (Package);
- return (SHELL_INVALID_PARAMETER);
- }
-
- if (ShellCommandLineGetFlag(Package, L"-sfo")) {
- FormatString = HiiGetString(gShellDriver1HiiHandle, STRING_TOKEN(STR_DRIVERS_ITEM_LINE_SFO), Language);
- } else {
- FormatString = HiiGetString(gShellDriver1HiiHandle, STRING_TOKEN(STR_DRIVERS_ITEM_LINE), Language);
- //
- // print the header row
- //
- ShellPrintHiiEx(
- -1,
- -1,
- Language,
- STRING_TOKEN(STR_DRIVERS_HEADER_LINES),
- gShellDriver1HiiHandle);
- }
-
- HandleList = GetHandleListByProtocol(&gEfiDriverBindingProtocolGuid);
- for (HandleWalker = HandleList ; HandleWalker != NULL && *HandleWalker != NULL ; HandleWalker++){
- ChildCount = 0;
- DeviceCount = 0;
- Status = ParseHandleDatabaseForChildDevices (*HandleWalker, &ChildCount , NULL);
- Status = PARSE_HANDLE_DATABASE_DEVICES (*HandleWalker, &DeviceCount, NULL);
- Temp2 = GetDevicePathTextForHandle(*HandleWalker);
- DriverVersion = ReturnDriverVersion(*HandleWalker);
- DriverConfig = ReturnDriverConfig(*HandleWalker);
- DriverDiag = ReturnDriverDiag (*HandleWalker);
- Lang = GetStringNameFromHandle(*HandleWalker, Language==NULL?"en":Language);
-
- ShellPrintEx(
- -1,
- -1,
- FormatString,
- ConvertHandleToHandleIndex(*HandleWalker),
- DriverVersion,
- ChildCount > 0?L'B':(DeviceCount > 0?L'D':L'?'),
- DriverConfig?L'Y':L'N',
- DriverDiag?L'Y':L'N',
- DeviceCount,
- ChildCount,
- Lang,
- Temp2==NULL?L"":Temp2
- );
- if (Temp2 != NULL) {
- FreePool(Temp2);
- }
- }
- }
- SHELL_FREE_NON_NULL(Language);
- ShellCommandLineFreeVarList (Package);
- SHELL_FREE_NON_NULL(FormatString);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
deleted file mode 100644
index 427f71be19..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
+++ /dev/null
@@ -1,1395 +0,0 @@
-/** @file
- Main file for DrvCfg shell Driver1 function.
-
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-#include <Protocol/HiiConfigAccess.h>
-#include <Protocol/HiiDatabase.h>
-
-STATIC CONST EFI_GUID *CfgGuidList[] = {&gEfiDriverConfigurationProtocolGuid, &gEfiDriverConfiguration2ProtocolGuid, NULL};
-
-/**
- Find the EFI_HII_HANDLE by device path.
-
- @param[in] DevPath1 The Device Path to match.
- @param[out] HiiHandle The EFI_HII_HANDLE after the converstion.
- @param[in] HiiDb The Hii database protocol
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_NOT_FOUND There was no EFI_HII_HANDLE found for that deviec path.
-**/
-EFI_STATUS
-EFIAPI
-FindHiiHandleViaDevPath(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevPath1,
- OUT EFI_HII_HANDLE *HiiHandle,
- IN EFI_HII_DATABASE_PROTOCOL *HiiDb
- )
-{
- EFI_HII_HANDLE *HandleBuffer;
- UINTN HandleBufferSize;
- VOID *MainBuffer;
- UINTN MainBufferSize;
- EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader;
- EFI_HII_PACKAGE_HEADER *PackageHeader;
- UINTN LoopVariable;
- EFI_DEVICE_PATH_PROTOCOL *DevPath2;
- EFI_STATUS Status;
-
- ASSERT(DevPath1 != NULL);
- ASSERT(HiiHandle != NULL);
- ASSERT(*HiiHandle == NULL);
- ASSERT(HiiDb != NULL);
-
- HandleBufferSize = 0;
- HandleBuffer = NULL;
- Status = HiiDb->ListPackageLists(HiiDb, EFI_HII_PACKAGE_DEVICE_PATH, NULL, &HandleBufferSize, HandleBuffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- HandleBuffer = AllocateZeroPool(HandleBufferSize);
- ASSERT (HandleBuffer != NULL);
- Status = HiiDb->ListPackageLists(HiiDb, EFI_HII_PACKAGE_DEVICE_PATH, NULL, &HandleBufferSize, HandleBuffer);
- }
- if (EFI_ERROR(Status)) {
- SHELL_FREE_NON_NULL(HandleBuffer);
- return (Status);
- }
-
- if (HandleBuffer == NULL) {
- return EFI_NOT_FOUND;
- }
-
- for (LoopVariable = 0 ; LoopVariable < (HandleBufferSize/sizeof(HandleBuffer[0])) && *HiiHandle == NULL ; LoopVariable++) {
- MainBufferSize = 0;
- MainBuffer = NULL;
- Status = HiiDb->ExportPackageLists(HiiDb, HandleBuffer[LoopVariable], &MainBufferSize, MainBuffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- MainBuffer = AllocateZeroPool(MainBufferSize);
- ASSERT (MainBuffer != NULL);
- Status = HiiDb->ExportPackageLists(HiiDb, HandleBuffer[LoopVariable], &MainBufferSize, MainBuffer);
- }
- //
- // Enumerate through the block of returned memory.
- // This should actually be a small block, but we need to be sure.
- //
- for (PackageListHeader = (EFI_HII_PACKAGE_LIST_HEADER*)MainBuffer
- ; PackageListHeader != NULL && ((CHAR8*)PackageListHeader) < (((CHAR8*)MainBuffer)+MainBufferSize) && *HiiHandle == NULL
- ; PackageListHeader = (EFI_HII_PACKAGE_LIST_HEADER*)(((CHAR8*)(PackageListHeader)) + PackageListHeader->PackageLength )) {
- for (PackageHeader = (EFI_HII_PACKAGE_HEADER*)(((CHAR8*)(PackageListHeader))+sizeof(EFI_HII_PACKAGE_LIST_HEADER))
- ; PackageHeader != NULL && ((CHAR8*)PackageHeader) < (((CHAR8*)MainBuffer)+MainBufferSize) && PackageHeader->Type != EFI_HII_PACKAGE_END && *HiiHandle == NULL
- ; PackageHeader = (EFI_HII_PACKAGE_HEADER*)(((CHAR8*)(PackageHeader))+PackageHeader->Length)) {
- if (PackageHeader->Type == EFI_HII_PACKAGE_DEVICE_PATH) {
- DevPath2 = (EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER));
- if (DevicePathCompare(&DevPath1, &DevPath2) == 0) {
- *HiiHandle = HandleBuffer[LoopVariable];
- break;
- }
- }
- }
- }
- SHELL_FREE_NON_NULL(MainBuffer);
- }
- SHELL_FREE_NON_NULL(HandleBuffer);
-
- if (*HiiHandle == NULL) {
- return (EFI_NOT_FOUND);
- }
- return (EFI_SUCCESS);
-}
-
-/**
- Convert a EFI_HANDLE to a EFI_HII_HANDLE.
-
- @param[in] Handle The EFI_HANDLE to convert.
- @param[out] HiiHandle The EFI_HII_HANDLE after the converstion.
- @param[in] HiiDb The Hii database protocol
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-ConvertHandleToHiiHandle(
- IN CONST EFI_HANDLE Handle,
- OUT EFI_HII_HANDLE *HiiHandle,
- IN EFI_HII_DATABASE_PROTOCOL *HiiDb
- )
-{
- EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *DevPath1;
-
- if (HiiHandle == NULL || HiiDb == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- *HiiHandle = NULL;
-
- if (Handle == NULL) {
- return (EFI_SUCCESS);
- }
-
- DevPath1 = NULL;
- Status = gBS->OpenProtocol(Handle, &gEfiDevicePathProtocolGuid, (VOID**)&DevPath1, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status) || DevPath1 == NULL) {
- return (EFI_NOT_FOUND);
- }
-
- return (FindHiiHandleViaDevPath(DevPath1, HiiHandle, HiiDb));
-}
-
-/**
- Function to print out all HII configuration information to a file.
-
- @param[in] Handle The handle to get info on. NULL to do all handles.
- @param[in] FileName The filename to rwite the info to.
-**/
-SHELL_STATUS
-EFIAPI
-ConfigToFile(
- IN CONST EFI_HANDLE Handle,
- IN CONST CHAR16 *FileName
- )
-{
- EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
- EFI_STATUS Status;
- VOID *MainBuffer;
- UINTN MainBufferSize;
- EFI_HII_HANDLE HiiHandle;
- SHELL_FILE_HANDLE FileHandle;
-
- HiiDatabase = NULL;
- MainBufferSize = 0;
- MainBuffer = NULL;
- FileHandle = NULL;
-
- Status = ShellOpenFileByName(FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_GEN_FILE_OPEN),
- gShellDriver1HiiHandle,
- FileName,
- Status);
- return (SHELL_DEVICE_ERROR);
- }
-
- //
- // Locate HII Database protocol
- //
- Status = gBS->LocateProtocol (
- &gEfiHiiDatabaseProtocolGuid,
- NULL,
- (VOID **) &HiiDatabase
- );
-
- if (EFI_ERROR(Status) || HiiDatabase == NULL) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_GEN_PROTOCOL_NF),
- gShellDriver1HiiHandle,
- L"EfiHiiDatabaseProtocol",
- &gEfiHiiDatabaseProtocolGuid);
- ShellCloseFile(&FileHandle);
- return (SHELL_NOT_FOUND);
- }
-
- Status = ConvertHandleToHiiHandle(Handle, &HiiHandle, HiiDatabase);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_GEN_HANDLE_NOT),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(Handle),
- L"Device");
- ShellCloseFile(&FileHandle);
- return (SHELL_DEVICE_ERROR);
- }
-
- Status = HiiDatabase->ExportPackageLists(HiiDatabase, HiiHandle, &MainBufferSize, MainBuffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- MainBuffer = AllocateZeroPool(MainBufferSize);
- Status = HiiDatabase->ExportPackageLists(HiiDatabase, HiiHandle, &MainBufferSize, MainBuffer);
- }
-
- Status = ShellWriteFile(FileHandle, &MainBufferSize, MainBuffer);
-
- ShellCloseFile(&FileHandle);
- SHELL_FREE_NON_NULL(MainBuffer);
-
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_FILE_WRITE_FAIL),
- gShellDriver1HiiHandle,
- FileName,
- Status);
- return (SHELL_DEVICE_ERROR);
- }
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_DRVCFG_COMP),
- gShellDriver1HiiHandle);
-
- return (SHELL_SUCCESS);
-}
-
-/**
- Function to read in HII configuration information from a file.
-
- @param[in] Handle The handle to get info for.
- @param[in] FileName The filename to read the info from.
-**/
-SHELL_STATUS
-EFIAPI
-ConfigFromFile(
- IN EFI_HANDLE Handle,
- IN CONST CHAR16 *FileName
- )
-{
- EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
- EFI_STATUS Status;
- VOID *MainBuffer;
- UINT64 Temp;
- UINTN MainBufferSize;
- EFI_HII_HANDLE HiiHandle;
- SHELL_FILE_HANDLE FileHandle;
- CHAR16 *TempDevPathString;
- EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader;
- EFI_HII_PACKAGE_HEADER *PackageHeader;
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- UINTN HandleIndex;
-
- HiiDatabase = NULL;
- MainBufferSize = 0;
- MainBuffer = NULL;
- FileHandle = NULL;
-
- Status = ShellOpenFileByName(FileName, &FileHandle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_GEN_FILE_OPEN),
- gShellDriver1HiiHandle,
- FileName,
- Status);
- return (SHELL_DEVICE_ERROR);
- }
-
- //
- // Locate HII Database protocol
- //
- Status = gBS->LocateProtocol (
- &gEfiHiiDatabaseProtocolGuid,
- NULL,
- (VOID **) &HiiDatabase
- );
-
- if (EFI_ERROR(Status) || HiiDatabase == NULL) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_GEN_PROTOCOL_NF),
- gShellDriver1HiiHandle,
- L"EfiHiiDatabaseProtocol",
- &gEfiHiiDatabaseProtocolGuid);
- ShellCloseFile(&FileHandle);
- return (SHELL_NOT_FOUND);
- }
-
- Status = ShellGetFileSize(FileHandle, &Temp);
- MainBufferSize = (UINTN)Temp;
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_FILE_READ_FAIL),
- gShellDriver1HiiHandle,
- FileName,
- Status);
- ShellCloseFile(&FileHandle);
- return (SHELL_DEVICE_ERROR);
- }
- MainBuffer = AllocateZeroPool((UINTN)MainBufferSize);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_GEN_OUT_MEM),
- gShellDriver1HiiHandle);
- ShellCloseFile(&FileHandle);
- return (SHELL_DEVICE_ERROR);
- }
- Status = ShellReadFile(FileHandle, &MainBufferSize, MainBuffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_FILE_READ_FAIL),
- gShellDriver1HiiHandle,
- FileName,
- Status);
- ShellCloseFile(&FileHandle);
- SHELL_FREE_NON_NULL(MainBuffer);
- return (SHELL_DEVICE_ERROR);
- }
-
- ShellCloseFile(&FileHandle);
-
- if (Handle != NULL) {
- //
- // User override in place. Just do it.
- //
- HiiHandle = NULL;
- Status = ConvertHandleToHiiHandle(Handle, &HiiHandle, HiiDatabase);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_GEN_HANDLE_NOT),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(Handle),
- L"Device");
- ShellCloseFile(&FileHandle);
- return (SHELL_DEVICE_ERROR);
- }
- Status = HiiDatabase->UpdatePackageList(HiiDatabase, HiiHandle, MainBuffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_GEN_UEFI_FUNC_ERROR),
- gShellDriver1HiiHandle,
- L"HiiDatabase->UpdatePackageList",
- Status);
- return (SHELL_DEVICE_ERROR);
- }
- } else {
- //
- // we need to parse the buffer and try to match the device paths for each item to try to find it's device path.
- //
-
- for (PackageListHeader = (EFI_HII_PACKAGE_LIST_HEADER*)MainBuffer
- ; PackageListHeader != NULL && ((CHAR8*)PackageListHeader) < (((CHAR8*)MainBuffer)+MainBufferSize)
- ; PackageListHeader = (EFI_HII_PACKAGE_LIST_HEADER*)(((CHAR8*)(PackageListHeader)) + PackageListHeader->PackageLength )) {
- for (PackageHeader = (EFI_HII_PACKAGE_HEADER*)(((CHAR8*)(PackageListHeader))+sizeof(EFI_HII_PACKAGE_LIST_HEADER))
- ; PackageHeader != NULL && ((CHAR8*)PackageHeader) < (((CHAR8*)MainBuffer)+MainBufferSize) && PackageHeader->Type != EFI_HII_PACKAGE_END
- ; PackageHeader = (EFI_HII_PACKAGE_HEADER*)(((CHAR8*)(PackageHeader))+PackageHeader->Length)) {
- if (PackageHeader->Type == EFI_HII_PACKAGE_DEVICE_PATH) {
- HiiHandle = NULL;
- Status = FindHiiHandleViaDevPath((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), &HiiHandle, HiiDatabase);
- if (EFI_ERROR(Status)) {
- //
- // print out an error.
- //
- TempDevPathString = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), TRUE, TRUE);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_DRVCFG_IN_FILE_NF),
- gShellDriver1HiiHandle,
- TempDevPathString);
- SHELL_FREE_NON_NULL(TempDevPathString);
- } else {
- Status = HiiDatabase->UpdatePackageList(HiiDatabase, HiiHandle, PackageListHeader);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_GEN_UEFI_FUNC_ERROR),
- gShellDriver1HiiHandle,
- L"HiiDatabase->UpdatePackageList",
- Status);
- return (SHELL_DEVICE_ERROR);
- } else {
- DevPath = (EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER));
- gBS->LocateDevicePath(&gEfiHiiConfigAccessProtocolGuid, &DevPath, &Handle);
- HandleIndex = ConvertHandleToHandleIndex(Handle);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_DRVCFG_DONE_HII),
- gShellDriver1HiiHandle,
- HandleIndex);
- }
- }
- }
- }
- }
- }
-
- SHELL_FREE_NON_NULL(MainBuffer);
-
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_DRVCFG_COMP),
- gShellDriver1HiiHandle);
- return (SHELL_SUCCESS);
-}
-
-/**
- Present a requested action to the user.
-
- @param[in] DriverImageHandle The handle for the driver to configure.
- @param[in] ControllerHandle The handle of the device being managed by the Driver specified.
- @param[in] ChildHandle The handle of a child device of the specified device.
- @param[in] ActionRequired The required HII action.
-
- @retval SHELL_INVALID_PARAMETER A parameter has a invalid value.
-**/
-EFI_STATUS
-EFIAPI
-ShellCmdDriverConfigurationProcessActionRequired (
- EFI_HANDLE DriverImageHandle,
- EFI_HANDLE ControllerHandle,
- EFI_HANDLE ChildHandle,
- EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED ActionRequired
- )
-{
- EFI_HANDLE ConnectControllerContextOverride[2];
-
- switch (ActionRequired) {
- case EfiDriverConfigurationActionNone:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_DRVCFG_NONE), gShellDriver1HiiHandle);
- break;
-
- case EfiDriverConfigurationActionStopController:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_DRVCFG_STOP), gShellDriver1HiiHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_DRVCFG_ENTER_S), gShellDriver1HiiHandle, L"stop controller");
- ShellPromptForResponse(ShellPromptResponseTypeEnterContinue, NULL, NULL);
-
- gBS->DisconnectController (ControllerHandle, DriverImageHandle, ChildHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_DRVCFG_CTLR_S), gShellDriver1HiiHandle, L"stopped");
- break;
-
- case EfiDriverConfigurationActionRestartController:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_DRVCFG_RESTART_S), gShellDriver1HiiHandle, L"controller");
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_DRVCFG_ENTER_S), gShellDriver1HiiHandle, L"restart controller");
- ShellPromptForResponse(ShellPromptResponseTypeEnterContinue, NULL, NULL);
-
- gBS->DisconnectController (ControllerHandle, DriverImageHandle, ChildHandle);
- ConnectControllerContextOverride[0] = DriverImageHandle;
- ConnectControllerContextOverride[1] = NULL;
- gBS->ConnectController (ControllerHandle, ConnectControllerContextOverride, NULL, TRUE);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_DRVCFG_CTLR_S), gShellDriver1HiiHandle, L"restarted");
- break;
-
- case EfiDriverConfigurationActionRestartPlatform:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_DRVCFG_RESTART_S), gShellDriver1HiiHandle, L"platform");
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_DRVCFG_ENTER_S), gShellDriver1HiiHandle, L"restart platform");
- ShellPromptForResponse(ShellPromptResponseTypeEnterContinue, NULL, NULL);
-
- gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
- break;
-
- default:
- return (EFI_INVALID_PARAMETER);
- break;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Do the configuration in an environment without HII.
-
- @param[in] Language The language code.
- @param[in] ForceDefaults TRUE to force defaults, FALSE otherwise.
- @param[in] DefaultType If ForceDefaults is TRUE, specifies the default type.
- @param[in] AllChildren TRUE to configure all children, FALSE otherwise.
- @param[in] ValidateOptions TRUE to validate existing options, FALSE otherwise.
- @param[in] SetOptions TRUE to set options, FALSE otherwise.
- @param[in] DriverImageHandle The handle for the driver to configure.
- @param[in] DeviceHandle The handle of the device being managed by the Driver specified.
- @param[in] ChildHandle The handle of a child device of the specified device.
-
- @retval SHELL_NOT_FOUND A specified handle could not be found.
- @retval SHELL_INVALID_PARAMETER A parameter has a invalid value.
-**/
-SHELL_STATUS
-EFIAPI
-PreHiiDrvCfg (
- IN CONST CHAR8 *Language,
- IN BOOLEAN ForceDefaults,
- IN UINT32 DefaultType,
- IN BOOLEAN AllChildren,
- IN BOOLEAN ValidateOptions,
- IN BOOLEAN SetOptions,
- IN EFI_HANDLE DriverImageHandle,
- IN EFI_HANDLE DeviceHandle,
- IN EFI_HANDLE ChildHandle
- )
-{
- EFI_STATUS Status;
- SHELL_STATUS ShellStatus;
- UINTN OuterLoopCounter;
- CHAR8 *BestLanguage;
- UINTN DriverImageHandleCount;
- EFI_HANDLE *DriverImageHandleBuffer;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- UINTN *HandleType;
- UINTN LoopCounter;
- UINTN ChildIndex;
- UINTN ChildHandleCount;
- EFI_HANDLE *ChildHandleBuffer;
- UINTN *ChildHandleType;
- EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED ActionRequired;
- EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration;
- BOOLEAN Iso639Language;
- UINTN HandleIndex1;
- UINTN HandleIndex2;
- UINTN HandleIndex3;
-
- ShellStatus = SHELL_SUCCESS;
-
- if (ChildHandle == NULL && AllChildren) {
- SetOptions = FALSE;
- }
-
- if (ForceDefaults) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_FORCE_D),
- gShellDriver1HiiHandle,
- DefaultType);
- } else if (ValidateOptions) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_VALIDATE),
- gShellDriver1HiiHandle);
- } else if (SetOptions) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_SET),
- gShellDriver1HiiHandle);
- }
-
- if (DriverImageHandle == 0) {
- DriverImageHandleBuffer = GetHandleListByProtocolList(CfgGuidList);
- if (DriverImageHandleBuffer == NULL) {
- ShellStatus = SHELL_NOT_FOUND;
- goto Done;
- }
- for (
- HandleBuffer = DriverImageHandleBuffer, DriverImageHandleCount = 0
- ; HandleBuffer != NULL && *HandleBuffer != NULL
- ; HandleBuffer++,DriverImageHandleCount++);
- } else {
- DriverImageHandleCount = 1;
- //
- // Allocate buffer to hold the image handle so as to
- // keep consistent with the above clause
- //
- DriverImageHandleBuffer = AllocatePool (sizeof (EFI_HANDLE));
- ASSERT (DriverImageHandleBuffer);
- DriverImageHandleBuffer[0] = DriverImageHandle;
- }
-
- for (OuterLoopCounter = 0; OuterLoopCounter < DriverImageHandleCount; OuterLoopCounter++) {
- Iso639Language = FALSE;
- Status = gBS->OpenProtocol (
- DriverImageHandleBuffer[OuterLoopCounter],
- &gEfiDriverConfiguration2ProtocolGuid,
- (VOID **) &DriverConfiguration,
- NULL,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- Iso639Language = TRUE;
- Status = gBS->OpenProtocol (
- DriverImageHandleBuffer[OuterLoopCounter],
- &gEfiDriverConfigurationProtocolGuid,
- (VOID **) &DriverConfiguration,
- NULL,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- }
- if (EFI_ERROR (Status)) {
-// ShellPrintHiiEx(
-// -1,
-// -1,
-// NULL,
-// STRING_TOKEN (STR_DRVCFG_NOT_SUPPORT),
-// gShellDriver1HiiHandle,
-// ConvertHandleToHandleIndex (DriverImageHandleBuffer[OuterLoopCounter])
-// );
- ShellStatus = SHELL_UNSUPPORTED;
- continue;
- }
-
- BestLanguage = GetBestLanguage (
- DriverConfiguration->SupportedLanguages,
- Iso639Language,
- Language!=NULL?Language:"",
- DriverConfiguration->SupportedLanguages,
- NULL
- );
- if (BestLanguage == NULL) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_GEN_PROBLEM_VAL),
- gShellDriver1HiiHandle,
- L"-l"
- );
- ShellStatus = SHELL_INVALID_PARAMETER;
- continue;
- }
-
- Status = ParseHandleDatabaseByRelationshipWithType (
- DriverImageHandleBuffer[OuterLoopCounter],
- NULL,
- &HandleCount,
- &HandleBuffer,
- &HandleType
- );
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- if (SetOptions && DeviceHandle == NULL) {
-
- gST->ConOut->ClearScreen (gST->ConOut);
- Status = DriverConfiguration->SetOptions (
- DriverConfiguration,
- NULL,
- NULL,
- BestLanguage,
- &ActionRequired
- );
- gST->ConOut->ClearScreen (gST->ConOut);
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_ALL_LANG),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex (DriverImageHandleBuffer[OuterLoopCounter]),
- DriverConfiguration->SupportedLanguages
- );
- if (!EFI_ERROR (Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_OPTIONS_SET),
- gShellDriver1HiiHandle);
- for (LoopCounter = 0; LoopCounter < HandleCount; LoopCounter++) {
- if ((HandleType[LoopCounter] & HR_CONTROLLER_HANDLE) == HR_CONTROLLER_HANDLE) {
- ShellCmdDriverConfigurationProcessActionRequired (
- DriverImageHandleBuffer[OuterLoopCounter],
- HandleBuffer[LoopCounter],
- NULL,
- ActionRequired
- );
- }
- }
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_NOT_SET),
- gShellDriver1HiiHandle,
- Status);
- }
- continue;
- }
-
- for (LoopCounter = 0; LoopCounter < HandleCount; LoopCounter++) {
- if ((HandleType[LoopCounter] & HR_CONTROLLER_HANDLE) != HR_CONTROLLER_HANDLE) {
- continue;
- }
- if (DeviceHandle != NULL && DeviceHandle != HandleBuffer[LoopCounter]) {
- continue;
- }
- if (ChildHandle == NULL) {
- HandleIndex1 = ConvertHandleToHandleIndex (DriverImageHandleBuffer[OuterLoopCounter]);
- HandleIndex2 = ConvertHandleToHandleIndex (HandleBuffer[LoopCounter]);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_CTRL_LANG),
- gShellDriver1HiiHandle,
- HandleIndex1,
- HandleIndex2,
- DriverConfiguration->SupportedLanguages
- );
-
- if (ForceDefaults) {
- Status = DriverConfiguration->ForceDefaults (
- DriverConfiguration,
- HandleBuffer[LoopCounter],
- NULL,
- DefaultType,
- &ActionRequired
- );
-
- if (!EFI_ERROR (Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_DEF_FORCED),
- gShellDriver1HiiHandle);
- ShellCmdDriverConfigurationProcessActionRequired (
- DriverImageHandleBuffer[OuterLoopCounter],
- HandleBuffer[LoopCounter],
- NULL,
- ActionRequired
- );
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_FORCE_FAILED),
- gShellDriver1HiiHandle,
- Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- } else if (ValidateOptions) {
- Status = DriverConfiguration->OptionsValid (
- DriverConfiguration,
- HandleBuffer[LoopCounter],
- NULL
- );
-
- if (!EFI_ERROR (Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_OPTIONS_VALID),
- gShellDriver1HiiHandle);
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_OPTIONS_INV),
- gShellDriver1HiiHandle,
- Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- } else if (SetOptions) {
- gST->ConOut->ClearScreen (gST->ConOut);
- Status = DriverConfiguration->SetOptions (
- DriverConfiguration,
- HandleBuffer[LoopCounter],
- NULL,
- BestLanguage,
- &ActionRequired
- );
- gST->ConOut->ClearScreen (gST->ConOut);
- HandleIndex1 = ConvertHandleToHandleIndex (DriverImageHandleBuffer[OuterLoopCounter]);
- HandleIndex2 = ConvertHandleToHandleIndex (HandleBuffer[LoopCounter]);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_CTRL_LANG),
- gShellDriver1HiiHandle,
- HandleIndex1,
- HandleIndex2,
- DriverConfiguration->SupportedLanguages
- );
- if (!EFI_ERROR (Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_OPTIONS_SET),
- gShellDriver1HiiHandle);
-
- ShellCmdDriverConfigurationProcessActionRequired (
- DriverImageHandleBuffer[OuterLoopCounter],
- HandleBuffer[LoopCounter],
- NULL,
- ActionRequired
- );
-
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_NOT_SET),
- gShellDriver1HiiHandle,
- Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- } else {
- Print (L"\n");
- }
- }
-
- if (ChildHandle == NULL && !AllChildren) {
- continue;
- }
-
- Status = ParseHandleDatabaseByRelationshipWithType (
- DriverImageHandleBuffer[OuterLoopCounter],
- HandleBuffer[LoopCounter],
- &ChildHandleCount,
- &ChildHandleBuffer,
- &ChildHandleType
- );
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- for (ChildIndex = 0; ChildIndex < ChildHandleCount; ChildIndex++) {
-
- if ((ChildHandleType[ChildIndex] & HR_CHILD_HANDLE) != HR_CHILD_HANDLE) {
- continue;
- }
-
- if (ChildHandle != NULL && ChildHandle != ChildHandleBuffer[ChildIndex]) {
- continue;
- }
-
- HandleIndex1 = ConvertHandleToHandleIndex (DriverImageHandleBuffer[OuterLoopCounter]);
- HandleIndex2 = ConvertHandleToHandleIndex (HandleBuffer[LoopCounter]);
- HandleIndex3 = ConvertHandleToHandleIndex (ChildHandleBuffer[ChildIndex]);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_CHILD_LANG),
- gShellDriver1HiiHandle,
- HandleIndex1,
- HandleIndex2,
- HandleIndex3,
- DriverConfiguration->SupportedLanguages);
-
- if (ForceDefaults) {
- Status = DriverConfiguration->ForceDefaults (
- DriverConfiguration,
- HandleBuffer[LoopCounter],
- ChildHandleBuffer[ChildIndex],
- DefaultType,
- &ActionRequired
- );
-
- if (!EFI_ERROR (Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_DEF_FORCED),
- gShellDriver1HiiHandle);
-
- ShellCmdDriverConfigurationProcessActionRequired (
- DriverImageHandleBuffer[OuterLoopCounter],
- HandleBuffer[LoopCounter],
- ChildHandleBuffer[ChildIndex],
- ActionRequired
- );
-
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_FORCE_FAILED),
- gShellDriver1HiiHandle,
- Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- } else if (ValidateOptions) {
- Status = DriverConfiguration->OptionsValid (
- DriverConfiguration,
- HandleBuffer[LoopCounter],
- ChildHandleBuffer[ChildIndex]
- );
-
- if (!EFI_ERROR (Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_OPTIONS_VALID),
- gShellDriver1HiiHandle);
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_OPTIONS_INV),
- gShellDriver1HiiHandle,
- Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- } else if (SetOptions) {
- gST->ConOut->ClearScreen (gST->ConOut);
- Status = DriverConfiguration->SetOptions (
- DriverConfiguration,
- HandleBuffer[LoopCounter],
- ChildHandleBuffer[ChildIndex],
- BestLanguage,
- &ActionRequired
- );
- gST->ConOut->ClearScreen (gST->ConOut);
- HandleIndex1 = ConvertHandleToHandleIndex (DriverImageHandleBuffer[OuterLoopCounter]);
- HandleIndex2 = ConvertHandleToHandleIndex (HandleBuffer[LoopCounter]);
- HandleIndex3 = ConvertHandleToHandleIndex (ChildHandleBuffer[ChildIndex]);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_CHILD_LANG),
- gShellDriver1HiiHandle,
- HandleIndex1,
- HandleIndex2,
- HandleIndex3,
- DriverConfiguration->SupportedLanguages
- );
- if (!EFI_ERROR (Status)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_OPTIONS_SET),
- gShellDriver1HiiHandle);
-
- ShellCmdDriverConfigurationProcessActionRequired (
- DriverImageHandleBuffer[OuterLoopCounter],
- HandleBuffer[LoopCounter],
- ChildHandleBuffer[ChildIndex],
- ActionRequired
- );
-
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_NOT_SET),
- gShellDriver1HiiHandle,
- Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- } else {
- Print (L"\n");
- }
- }
-
- FreePool (ChildHandleBuffer);
- FreePool (ChildHandleType);
- }
-
- FreePool (BestLanguage);
- FreePool (HandleBuffer);
- FreePool (HandleType);
- }
-
- if (DriverImageHandle != NULL && DriverImageHandleCount != 0) {
- FreePool (DriverImageHandleBuffer);
- }
-
-Done:
- return ShellStatus;
-}
-
-/**
- Function to print out configuration information on all configurable handles.
-
- @param[in] ChildrenToo TRUE to tewst for children.
- @param[in] Language ASCII string for language code.
- @param[in] UseHii TRUE to check for Hii and DPC, FALSE for DCP only.
-
- @retval SHELL_SUCCESS The operation was successful.
-**/
-SHELL_STATUS
-EFIAPI
-PrintConfigInfoOnAll(
- IN CONST BOOLEAN ChildrenToo,
- IN CONST CHAR8 *Language,
- IN CONST BOOLEAN UseHii
- )
-{
- EFI_HANDLE *HandleList;
- EFI_HANDLE *CurrentHandle;
- BOOLEAN Found;
- UINTN Index2;
-
-
- Found = FALSE;
- HandleList = NULL;
- CurrentHandle = NULL;
-
- if (UseHii) {
- //
- // HII method
- //
- HandleList = GetHandleListByProtocol(&gEfiHiiConfigAccessProtocolGuid);
- for (CurrentHandle = HandleList ; CurrentHandle != NULL && *CurrentHandle != NULL; CurrentHandle++){
- Found = TRUE;
- Index2 = *CurrentHandle == NULL ? 0 : ConvertHandleToHandleIndex(*CurrentHandle);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_LINE_HII),
- gShellDriver1HiiHandle,
- Index2
- );
- }
- SHELL_FREE_NON_NULL(HandleList);
- }
-
- if (PreHiiDrvCfg (
- Language,
- FALSE,
- 0,
- ChildrenToo,
- FALSE,
- FALSE,
- 0,
- 0,
- 0) == SHELL_SUCCESS) {
- Found = TRUE;
- }
-
- if (!Found) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DRVCFG_NONE), gShellDriver1HiiHandle);
- return (SHELL_SUCCESS);
- }
-
- return (SHELL_SUCCESS);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamListHii[] = {
- {L"-s", TypeFlag},
- {L"-l", TypeValue},
- {L"-f", TypeValue},
- {L"-o", TypeValue},
- {L"-i", TypeValue},
- {NULL, TypeMax}
- };
-STATIC CONST SHELL_PARAM_ITEM ParamListPreHii[] = {
- {L"-c", TypeFlag},
- {L"-s", TypeFlag},
- {L"-v", TypeFlag},
- {L"-l", TypeValue},
- {L"-f", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'drvcfg' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDrvCfg (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CHAR8 *Language;
- CONST CHAR16 *Lang;
- CONST CHAR16 *HandleIndex1;
- CONST CHAR16 *HandleIndex2;
- CONST CHAR16 *HandleIndex3;
- CONST CHAR16 *ForceTypeString;
- BOOLEAN Force;
- BOOLEAN Set;
- BOOLEAN Validate;
- BOOLEAN InFromFile;
- BOOLEAN OutToFile;
- BOOLEAN AllChildren;
- BOOLEAN UseHii;
- UINT32 ForceType;
- UINT64 Intermediate;
- EFI_HANDLE Handle1;
- EFI_HANDLE Handle2;
- EFI_HANDLE Handle3;
- CONST CHAR16 *FileName;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- Language = NULL;
- UseHii = TRUE;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamListHii, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status) || ShellCommandLineGetCount(Package) > 2) {
- UseHii = FALSE;
- if (Package != NULL) {
- ShellCommandLineFreeVarList (Package);
- }
- SHELL_FREE_NON_NULL(ProblemParam);
- Status = ShellCommandLineParse (ParamListPreHii, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- } else {
- ASSERT(FALSE);
- }
- }
- }
- if (ShellStatus == SHELL_SUCCESS) {
- Lang = ShellCommandLineGetValue(Package, L"-l");
- if (Lang != NULL) {
- Language = AllocateZeroPool(StrSize(Lang));
- AsciiSPrint(Language, StrSize(Lang), "%S", Lang);
- } else if (ShellCommandLineGetFlag(Package, L"-l")){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-l");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- Set = ShellCommandLineGetFlag (Package, L"-s");
- Validate = ShellCommandLineGetFlag (Package, L"-v");
- InFromFile = ShellCommandLineGetFlag (Package, L"-i");
- OutToFile = ShellCommandLineGetFlag (Package, L"-o");
- AllChildren = ShellCommandLineGetFlag (Package, L"-c");
- Force = ShellCommandLineGetFlag (Package, L"-f");
- ForceTypeString = ShellCommandLineGetValue(Package, L"-f");
-
- if (OutToFile) {
- FileName = ShellCommandLineGetValue(Package, L"-o");
- } else if (InFromFile) {
- FileName = ShellCommandLineGetValue(Package, L"-i");
- } else {
- FileName = NULL;
- }
-
- if (InFromFile && EFI_ERROR(ShellFileExists(FileName))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellDriver1HiiHandle, FileName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- if (OutToFile && !EFI_ERROR(ShellFileExists(FileName))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_EXIST), gShellDriver1HiiHandle, FileName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- if (Force && ForceTypeString == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-f");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- if (Force) {
- Status = ShellConvertStringToUint64(ForceTypeString, &Intermediate, FALSE, FALSE);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDriver1HiiHandle, L"-f");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- ForceType = (UINT32)Intermediate;
- } else {
- ForceType = 0;
- }
- HandleIndex1 = ShellCommandLineGetRawValue(Package, 1);
- Handle1 = NULL;
- if (HandleIndex1 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex1, &Intermediate, TRUE, FALSE))) {
- Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate);
- if (Handle1 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, HandleIndex1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
- HandleIndex2 = ShellCommandLineGetRawValue(Package, 2);
- Handle2 = NULL;
- if (HandleIndex2 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex2, &Intermediate, TRUE, FALSE))) {
- Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate);
- if (Handle2 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, HandleIndex2);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
- HandleIndex3 = ShellCommandLineGetRawValue(Package, 3);
- Handle3 = NULL;
- if (HandleIndex3 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex3, &Intermediate, TRUE, FALSE))) {
- Handle3 = ConvertHandleIndexToHandle((UINTN)Intermediate);
- if (Handle3 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, HandleIndex3);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
-
- if ((InFromFile || OutToFile) && (FileName == NULL)) {
- if (FileName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, InFromFile?L"-i":L"-o");
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_REQ), gShellDriver1HiiHandle);
- }
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- if (!UseHii && (InFromFile || OutToFile)) {
- if (InFromFile) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"-i");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- if (OutToFile) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"-o");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- }
- if (Validate && Force) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONF), gShellDriver1HiiHandle, L"-v", L"-f");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- if (Validate && Set) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONF), gShellDriver1HiiHandle, L"-v", L"-s");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- if (Set && Force) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONF), gShellDriver1HiiHandle, L"-s", L"-f");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
- if (OutToFile && InFromFile) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONF), gShellDriver1HiiHandle, L"-i", L"-o");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
-
- //
- // We do HII first.
- //
- if (UseHii) {
- if (Handle1 != NULL && EFI_ERROR(gBS->OpenProtocol(Handle1, &gEfiHiiConfigAccessProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- //
- // no HII on this handle.
- //
- ShellStatus = SHELL_UNSUPPORTED;
- } else if (Validate) {
- } else if (Force) {
- } else if (Set) {
- } else if (InFromFile) {
- ShellStatus = ConfigFromFile(Handle1, FileName);
- if (Handle1 != NULL && ShellStatus == SHELL_SUCCESS) {
- goto Done;
- }
- } else if (OutToFile) {
- ShellStatus = ConfigToFile(Handle1, FileName);
- if (Handle1 != NULL && ShellStatus == SHELL_SUCCESS) {
- goto Done;
- }
- } else if (HandleIndex1 == NULL) {
- //
- // display all that are configurable
- //
- ShellStatus = PrintConfigInfoOnAll(AllChildren, Language, UseHii);
- goto Done;
- } else {
- if (!EFI_ERROR(gBS->OpenProtocol(Handle1, &gEfiHiiConfigAccessProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_LINE_HII),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(Handle1)
- );
- goto Done;
- }
- }
- }
-
- //
- // We allways need to do this one since it does both by default.
- //
- if (!InFromFile && !OutToFile) {
- ShellStatus = PreHiiDrvCfg (
- Language,
- Force,
- ForceType,
- AllChildren,
- Validate,
- Set,
- Handle1,
- Handle2,
- Handle3);
- }
-
- if (ShellStatus == SHELL_UNSUPPORTED) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRVCFG_NOT_SUPPORT),
- gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(Handle1)
- );
- }
- }
-
-Done:
- ShellCommandLineFreeVarList (Package);
- SHELL_FREE_NON_NULL(Language);
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c
deleted file mode 100644
index 986dc3a056..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/** @file
- Main file for DrvDiag shell Driver1 function.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-STATIC CONST EFI_GUID *DiagGuidList[] = {&gEfiDriverDiagnosticsProtocolGuid, &gEfiDriverDiagnostics2ProtocolGuid, NULL};
-//
-// We need 1 more item on the list...
-//
-typedef enum {
- TestModeStandard = EfiDriverDiagnosticTypeStandard,
- TestModeExtended = EfiDriverDiagnosticTypeExtended,
- TestModeManufacturing = EfiDriverDiagnosticTypeManufacturing,
- TestModeList,
- TestModeMax
-} DRV_DIAG_TEST_MODE;
-
-/**
- Do the diagnostics call for some set of handles.
-
- @param[in] Mode The type of diagnostic test to run.
- @param[in] Lang The language code to use.
- @param[in] AllChilds Should the test be on all children.
- @param[in] DriverHandle The driver handle to test with.
- @param[in] ControllerHandle The specific controller handle to test.
- @param[in] ChildHandle The specific child handle to test.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_INVALID_PARAMETER A parameter had an invalid value.
- @retval EFI_NOT_FOUND No diagnostic handle could be found.
-**/
-EFI_STATUS
-EFIAPI
-DoDiagnostics (
- IN CONST DRV_DIAG_TEST_MODE Mode,
- IN CONST CHAR8 *Lang,
- IN CONST BOOLEAN AllChilds,
- IN CONST EFI_HANDLE DriverHandle,
- IN CONST EFI_HANDLE ControllerHandle,
- IN CONST EFI_HANDLE ChildHandle
- )
-{
- EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics;
- EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2;
- EFI_HANDLE *DriverHandleList;
- EFI_HANDLE *ControllerHandleList;
- EFI_HANDLE *ChildHandleList;
- EFI_HANDLE *Walker;
- UINTN DriverHandleListCount;
- UINTN ControllerHandleListCount;
- UINTN ChildHandleListCount;
- UINTN DriverHandleListLoop;
- UINTN ControllerHandleListLoop;
- UINTN ChildHandleListLoop;
- EFI_STATUS Status;
- EFI_STATUS Status2;
- EFI_GUID *ErrorType;
- UINTN OutBufferSize;
- CHAR16 *OutBuffer;
- UINTN HandleIndex1;
- UINTN HandleIndex2;
- CHAR8 *Language;
- CHAR8 *TempChar;
- BOOLEAN Found;
-
- if ((ChildHandle != NULL && AllChilds) || (Mode >= TestModeMax)){
- return (EFI_INVALID_PARAMETER);
- }
-
- DriverDiagnostics = NULL;
- DriverDiagnostics2 = NULL;
- Status = EFI_SUCCESS;
- Status2 = EFI_SUCCESS;
- DriverHandleList = NULL;
- ControllerHandleList = NULL;
- ChildHandleList = NULL;
- Language = NULL;
- OutBuffer = NULL;
- ErrorType = NULL;
- DriverHandleListCount = 0;
- ControllerHandleListCount = 0;
- ChildHandleListCount = 0;
-
- if (DriverHandle != NULL) {
- DriverHandleList = AllocateZeroPool(2*sizeof(EFI_HANDLE));
- ASSERT(DriverHandleList!=NULL);
- DriverHandleList[0] = DriverHandle;
- DriverHandleListCount = 1;
- } else {
- DriverHandleList = GetHandleListByProtocolList(DiagGuidList);
- if (DriverHandleList == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"gEfiDriverDiagnosticsProtocolGuid", &gEfiDriverDiagnosticsProtocolGuid);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"gEfiDriverDiagnostics2ProtocolGuid", &gEfiDriverDiagnostics2ProtocolGuid);
- return (EFI_NOT_FOUND);
- }
- for (Walker = DriverHandleList ; Walker != NULL && *Walker != NULL ; DriverHandleListCount++, Walker++);
- }
-
- if (ControllerHandle != NULL) {
- ControllerHandleList = AllocateZeroPool(2*sizeof(EFI_HANDLE));
- ASSERT(ControllerHandleList!=NULL);
- ControllerHandleList[0] = ControllerHandle;
- ControllerHandleListCount = 1;
- } else {
- ControllerHandleList = NULL;
- }
-
- if (ChildHandle != NULL) {
- ChildHandleList = AllocateZeroPool(2*sizeof(EFI_HANDLE));
- ASSERT(ChildHandleList!=NULL);
- ChildHandleList[0] = ChildHandle;
- ChildHandleListCount = 1;
- } else if (AllChilds) {
- ChildHandleList = NULL;
- //
- // This gets handled in the loop below.
- //
- } else {
- ChildHandleList = NULL;
- }
-
- if (Mode == TestModeList) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DRVDIAG_HEADER), gShellDriver1HiiHandle);
- }
- for (DriverHandleListLoop = 0
- ; DriverHandleListLoop < DriverHandleListCount
- ; DriverHandleListLoop++
- ){
- if (Mode == TestModeList) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DRVDIAG_DRIVER_HEADER), gShellDriver1HiiHandle, ConvertHandleToHandleIndex(DriverHandleList[DriverHandleListLoop]));
- }
- if (ControllerHandle == NULL) {
- PARSE_HANDLE_DATABASE_DEVICES(DriverHandleList[DriverHandleListLoop], &ControllerHandleListCount, &ControllerHandleList);
- }
- if (ControllerHandleListCount == 0) {
- if (Mode == TestModeList) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DRVDIAG_DRIVER_NO_HANDLES), gShellDriver1HiiHandle);
- }
- } else {
- if (Mode == TestModeList) {
- ShellPrintEx(-1, -1, L"\r\n");
- }
- for (ControllerHandleListLoop = 0
- ; ControllerHandleListLoop < ControllerHandleListCount
- ; ControllerHandleListLoop++
- ){
- if (AllChilds) {
- ASSERT(ChildHandleList == NULL);
- PARSE_HANDLE_DATABASE_MANAGED_CHILDREN(
- DriverHandleList[DriverHandleListLoop],
- ControllerHandleList[ControllerHandleListLoop],
- &ChildHandleListCount,
- &ChildHandleList);
- }
- for (ChildHandleListLoop = 0
- ; (ChildHandleListLoop < ChildHandleListCount || ChildHandleList == NULL)
- ; ChildHandleListLoop++
- ){
- Found = FALSE;
- if (Mode != TestModeList) {
- if (Lang == NULL || Lang[2] == '-') {
- //
- // Get the protocol pointer and call the function
- //
- Status = gBS->OpenProtocol(
- DriverHandleList[DriverHandleListLoop],
- &gEfiDriverDiagnostics2ProtocolGuid,
- (VOID**)&DriverDiagnostics2,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!EFI_ERROR(Status)) {
- if (Lang == NULL) {
- Language = AllocateZeroPool(AsciiStrSize(DriverDiagnostics2->SupportedLanguages));
- if (Language == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Language, DriverDiagnostics2->SupportedLanguages);
- TempChar = AsciiStrStr(Language, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Language = AllocateZeroPool(AsciiStrSize(Lang));
- if (Language == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Language, Lang);
- }
- Found = TRUE;
- Status = DriverDiagnostics2->RunDiagnostics(
- DriverDiagnostics2,
- ControllerHandleList[ControllerHandleListLoop],
- ChildHandleList == NULL?NULL:ChildHandleList[ChildHandleListLoop],
- (EFI_DRIVER_DIAGNOSTIC_TYPE)Mode,
- Language,
- &ErrorType,
- &OutBufferSize,
- &OutBuffer);
- FreePool(Language);
- }
- }
- if (!Found && (Lang == NULL||(Lang!=NULL&&(Lang[2]!='-')))){
- Status = gBS->OpenProtocol(
- DriverHandleList[DriverHandleListLoop],
- &gEfiDriverDiagnosticsProtocolGuid,
- (VOID**)&DriverDiagnostics,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!EFI_ERROR(Status)) {
- if (Lang == NULL) {
- Language = AllocateZeroPool(AsciiStrSize(DriverDiagnostics2->SupportedLanguages));
- if (Language == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Language, DriverDiagnostics2->SupportedLanguages);
- TempChar = AsciiStrStr(Language, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Language = AllocateZeroPool(AsciiStrSize(Lang));
- if (Language == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Language, Lang);
- }
- Status = DriverDiagnostics->RunDiagnostics(
- DriverDiagnostics,
- ControllerHandleList[ControllerHandleListLoop],
- ChildHandleList == NULL?NULL:ChildHandleList[ChildHandleListLoop],
- (EFI_DRIVER_DIAGNOSTIC_TYPE)Mode,
- Language,
- &ErrorType,
- &OutBufferSize,
- &OutBuffer);
- FreePool(Language);
- }
- }
- if (EFI_ERROR(Status)) {
- Status2 = Status;
- }
- HandleIndex1 = ConvertHandleToHandleIndex(DriverHandleList[DriverHandleListLoop]);
- HandleIndex2 = ConvertHandleToHandleIndex(ControllerHandleList[ControllerHandleListLoop]);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_3P_RESULT),
- gShellDriver1HiiHandle,
- L"DrvDiag",
- HandleIndex1,
- HandleIndex2,
- ChildHandleList == NULL?0:ConvertHandleToHandleIndex(ChildHandleList[ChildHandleListLoop]),
- Status);
- if (OutBuffer!=NULL) {
- FreePool(OutBuffer);
- OutBuffer = NULL;
- }
- if (ErrorType!=NULL) {
- FreePool(ErrorType);
- ErrorType = NULL;
- }
- } else {
- HandleIndex1 = ConvertHandleToHandleIndex(DriverHandleList[DriverHandleListLoop]);
- HandleIndex2 = ConvertHandleToHandleIndex(ControllerHandleList[ControllerHandleListLoop]);
- //
- // Print out the information that this set can be tested
- //
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_DRV_DIAG_ITEM_LINE),
- gShellDriver1HiiHandle,
- HandleIndex1,
- HandleIndex2,
- ChildHandleList == NULL?0:ConvertHandleToHandleIndex(ChildHandleList[ChildHandleListLoop])
- );
- }
-
- //
- // If we are doing a single pass with NULL child jump out after a single loop
- //
- if (ChildHandleList == NULL) {
- break;
- }
- }
- if (AllChilds) {
- SHELL_FREE_NON_NULL(ChildHandleList);
- ChildHandleList = NULL;
- ChildHandleListCount = 0;
- }
- }
- if (ControllerHandle == NULL) {
- SHELL_FREE_NON_NULL(ControllerHandleList);
- ControllerHandleList = NULL;
- ControllerHandleListCount = 0;
- }
- }
- }
-
- if (DriverHandleList != NULL) {
- FreePool(DriverHandleList);
- }
- if (ControllerHandleList != NULL) {
- FreePool(ControllerHandleList);
- }
- if (ChildHandleList != NULL) {
- FreePool(ChildHandleList);
- }
- return (Status2);
-}
-
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-c", TypeFlag},
- {L"-s", TypeFlag},
- {L"-e", TypeFlag},
- {L"-m", TypeFlag},
- {L"-l", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'drvdiag' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDrvDiag (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- DRV_DIAG_TEST_MODE Mode;
- CHAR8 *Language;
- CONST CHAR16 *DriverHandleStr;
- CONST CHAR16 *ControllerHandleStr;
- CONST CHAR16 *ChildHandleStr;
- CONST CHAR16 *Lang;
- EFI_HANDLE Handle1;
- EFI_HANDLE Handle2;
- EFI_HANDLE Handle3;
- UINT64 Intermediate;
-
- ShellStatus = SHELL_SUCCESS;
- Mode = TestModeMax;
- Language = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // if more than 3 'value' parameters (plus the name one) or we have any 2 mode flags
- //
- if ((ShellCommandLineGetCount(Package) > 4)
- ||(ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-e"))
- ||(ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-m"))
- ||(ShellCommandLineGetFlag(Package, L"-e") && ShellCommandLineGetFlag(Package, L"-m"))
- ){
- //
- // error for too many parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if ((ShellCommandLineGetFlag(Package, L"-s"))
- || (ShellCommandLineGetFlag(Package, L"-e"))
- || (ShellCommandLineGetFlag(Package, L"-m"))
- ){
- //
- // Run the apropriate test
- //
- if (ShellCommandLineGetFlag(Package, L"-s")) {
- Mode = TestModeStandard;
- } else if (ShellCommandLineGetFlag(Package, L"-e")) {
- Mode = TestModeExtended;
- } else if (ShellCommandLineGetFlag(Package, L"-m")) {
- Mode = TestModeManufacturing;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // Do a listing of what's available to test
- //
- Mode = TestModeList;
- }
-
- Lang = ShellCommandLineGetValue(Package, L"-l");
- if (ShellCommandLineGetFlag(Package, L"-l") && Lang == NULL) {
- ASSERT(Language == NULL);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"-l");
- ShellCommandLineFreeVarList (Package);
- return (SHELL_INVALID_PARAMETER);
- } else if (Lang != NULL) {
- Language = AllocateZeroPool(StrSize(Lang));
- AsciiSPrint(Language, StrSize(Lang), "%S", Lang);
- }
-
- DriverHandleStr = ShellCommandLineGetRawValue(Package, 1);
- ControllerHandleStr = ShellCommandLineGetRawValue(Package, 2);
- ChildHandleStr = ShellCommandLineGetRawValue(Package, 3);
-
- if (DriverHandleStr == NULL) {
- Handle1 = NULL;
- } else {
- ShellConvertStringToUint64(DriverHandleStr, &Intermediate, TRUE, FALSE);
- Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate);
- }
- if (ControllerHandleStr == NULL) {
- Handle2 = NULL;
- } else {
- ShellConvertStringToUint64(ControllerHandleStr, &Intermediate, TRUE, FALSE);
- Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate);
- }
- if (ChildHandleStr == NULL) {
- Handle3 = NULL;
- } else {
- ShellConvertStringToUint64(ChildHandleStr, &Intermediate, TRUE, FALSE);
- Handle3 = ConvertHandleIndexToHandle((UINTN)Intermediate);
- }
-
- Status = DoDiagnostics (
- Mode,
- Language,
- ShellCommandLineGetFlag(Package, L"-c"),
- Handle1,
- Handle2,
- Handle3
- );
-
- SHELL_FREE_NON_NULL(Language);
- ShellCommandLineFreeVarList (Package);
-
- }
- if (ShellStatus == SHELL_SUCCESS) {
- if (Status == EFI_SECURITY_VIOLATION) {
- ShellStatus = SHELL_SECURITY_VIOLATION;
- } else if (Status == EFI_INVALID_PARAMETER) {
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (Status == EFI_NOT_FOUND) {
- ShellStatus = SHELL_NOT_FOUND;
- } else if (EFI_ERROR(Status)) {
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/OpenInfo.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/OpenInfo.c
deleted file mode 100644
index a7afa28c97..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/OpenInfo.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/** @file
- Main file for OpenInfo shell Driver1 function.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-STATIC CONST CHAR16 StringHandProt[] = L"HandProt ";
-STATIC CONST CHAR16 StringGetProt[] = L"GetProt ";
-STATIC CONST CHAR16 StringTestProt[] = L"TestProt ";
-STATIC CONST CHAR16 StringChild[] = L"Child ";
-STATIC CONST CHAR16 StringDriver[] = L"Driver ";
-STATIC CONST CHAR16 StringExclusive[] = L"Exclusive";
-STATIC CONST CHAR16 StringDriverEx[] = L"DriverEx ";
-STATIC CONST CHAR16 StringUnknown[] = L"Unknown ";
-
-/**
- Open the database and print out all the info about TheHandle.
-
- @param[in] TheHandle The handle to print info on.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_INVALID_PARAMETER TheHandle was NULL.
-**/
-EFI_STATUS
-EFIAPI
-TraverseHandleDatabase (
- IN CONST EFI_HANDLE TheHandle
- )
-{
- EFI_STATUS Status;
- EFI_GUID **ProtocolGuidArray;
- UINTN ArrayCount;
- UINTN ProtocolIndex;
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo;
- UINTN OpenInfoCount;
- UINTN OpenInfoIndex;
- CONST CHAR16 *OpenTypeString;
- CHAR16 *TempString;
- UINTN HandleIndex;
- CONST CHAR16 *Name;
- UINTN ControllerIndex;
-
- if (TheHandle == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // Retrieve the list of all the protocols on the handle
- //
- Status = gBS->ProtocolsPerHandle (
- TheHandle,
- &ProtocolGuidArray,
- &ArrayCount
- );
- ASSERT_EFI_ERROR(Status);
- if (!EFI_ERROR (Status)) {
-
- for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) {
- //
- // print out the human readable name for this one.
- //
- TempString = GetStringNameFromGuid(ProtocolGuidArray[ProtocolIndex], NULL);
- if (TempString == NULL) {
- continue;
- }
- ShellPrintEx(-1, -1, L"%H%s%N\r\n", TempString);
- FreePool(TempString);
-
- //
- // Retrieve the list of agents that have opened each protocol
- //
- Status = gBS->OpenProtocolInformation (
- TheHandle,
- ProtocolGuidArray[ProtocolIndex],
- &OpenInfo,
- &OpenInfoCount
- );
- ASSERT_EFI_ERROR(Status);
- if (!EFI_ERROR (Status)) {
- for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
- switch (OpenInfo[OpenInfoIndex].Attributes) {
- case EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL: OpenTypeString = StringHandProt; break;
- case EFI_OPEN_PROTOCOL_GET_PROTOCOL: OpenTypeString = StringGetProt; break;
- case EFI_OPEN_PROTOCOL_TEST_PROTOCOL: OpenTypeString = StringTestProt; break;
- case EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER: OpenTypeString = StringChild; break;
- case EFI_OPEN_PROTOCOL_BY_DRIVER: OpenTypeString = StringDriver; break;
- case EFI_OPEN_PROTOCOL_EXCLUSIVE: OpenTypeString = StringExclusive; break;
- case EFI_OPEN_PROTOCOL_BY_DRIVER|EFI_OPEN_PROTOCOL_EXCLUSIVE:
- OpenTypeString = StringDriverEx; break;
- default: OpenTypeString = StringUnknown; break;
- }
- HandleIndex = ConvertHandleToHandleIndex(OpenInfo[OpenInfoIndex].AgentHandle);
- Name = GetStringNameFromHandle(OpenInfo[OpenInfoIndex].AgentHandle, "en");
- ControllerIndex = ConvertHandleToHandleIndex(OpenInfo[OpenInfoIndex].ControllerHandle);
- if (ControllerIndex != 0) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_OPENINFO_LINE),
- gShellDriver1HiiHandle,
- HandleIndex,
- ControllerIndex,
- OpenInfo[OpenInfoIndex].OpenCount,
- OpenTypeString,
- Name
- );
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_OPENINFO_MIN_LINE),
- gShellDriver1HiiHandle,
- HandleIndex,
- OpenInfo[OpenInfoIndex].OpenCount,
- OpenTypeString,
- Name
- );
- }
- }
- FreePool (OpenInfo);
- }
- }
- FreePool (ProtocolGuidArray);
- }
-
- return Status;
-}
-
-/**
- Function for 'openinfo' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunOpenInfo (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- EFI_HANDLE TheHandle;
- CONST CHAR16 *Param1;
- UINT64 Intermediate;
-
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 2){
- //
- // error for too many parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) == 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- Status = ShellConvertStringToUint64(Param1, &Intermediate, TRUE, FALSE);
- if (EFI_ERROR(Status) || Param1 == NULL || ConvertHandleIndexToHandle((UINTN)Intermediate) == NULL){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- TheHandle = ConvertHandleIndexToHandle((UINTN)Intermediate);
- ASSERT(TheHandle != NULL);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_OPENINFO_HEADER_LINE), gShellDriver1HiiHandle, (UINTN)Intermediate, TheHandle);
-
- Status = TraverseHandleDatabase (TheHandle);
- if (!EFI_ERROR(Status)) {
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param1);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- }
- }
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Reconnect.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Reconnect.c
deleted file mode 100644
index e6a0fba20d..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Reconnect.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- Main file for Reconnect shell Driver1 function.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-/**
- Function for 'reconnect' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunReconnect (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- SHELL_STATUS ShellStatus;
-
- gInReconnect = TRUE;
-
- ShellStatus = ShellCommandRunDisconnect(ImageHandle, SystemTable);
- if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = ShellCommandRunConnect(ImageHandle, SystemTable);
- }
-
- gInReconnect = FALSE;
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.c
deleted file mode 100644
index 957fde9b8d..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/** @file
- Main file for NULL named library for level 1 shell command functions.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-STATIC CONST CHAR16 mFileName[] = L"Driver1Commands";
-EFI_HANDLE gShellDriver1HiiHandle = NULL;
-BOOLEAN gInReconnect = FALSE;
-
-/**
- Function to return the name of the file containing help if HII will not be used.
-
- @return The filename.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandGetManFileNameDriver1 (
- VOID
- )
-{
- return (mFileName);
-}
-
-/**
- Constructor for the Shell Driver1 Commands library.
-
- @param ImageHandle the image handle of the process
- @param SystemTable the EFI System Table pointer
-
- @retval EFI_SUCCESS the shell command handlers were installed sucessfully
- @retval EFI_UNSUPPORTED the shell level required was not found.
-**/
-EFI_STATUS
-EFIAPI
-UefiShellDriver1CommandsLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- //
- // check our bit of the profiles mask
- //
- if ((PcdGet8(PcdShellProfileMask) & BIT0) == 0) {
- return (EFI_SUCCESS);
- }
-
- //
- // install the HII stuff.
- //
- gShellDriver1HiiHandle = HiiAddPackages (&gShellDriver1HiiGuid, gImageHandle, UefiShellDriver1CommandsLibStrings, NULL);
- if (gShellDriver1HiiHandle == NULL) {
- return (EFI_DEVICE_ERROR);
- }
-
- //
- // install our shell command handlers that are always installed
- //
- ShellCommandRegisterCommandName(L"connect", ShellCommandRunConnect , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_CONNECT) );
- ShellCommandRegisterCommandName(L"devices", ShellCommandRunDevices , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_DEVICES) );
- ShellCommandRegisterCommandName(L"openinfo", ShellCommandRunOpenInfo , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_OPENINFO) );
- ShellCommandRegisterCommandName(L"disconnect", ShellCommandRunDisconnect , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_DISCONNECT));
- ShellCommandRegisterCommandName(L"reconnect", ShellCommandRunReconnect , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_RECONNECT) );
- ShellCommandRegisterCommandName(L"unload", ShellCommandRunUnload , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_UNLOAD) );
- ShellCommandRegisterCommandName(L"drvdiag", ShellCommandRunDrvDiag , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_DRVDIAG) );
- ShellCommandRegisterCommandName(L"dh", ShellCommandRunDh , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_DH) );
- ShellCommandRegisterCommandName(L"drivers", ShellCommandRunDrivers , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_DRIVERS) );
- ShellCommandRegisterCommandName(L"devtree", ShellCommandRunDevTree , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_DEVTREE) );
- ShellCommandRegisterCommandName(L"drvcfg", ShellCommandRunDrvCfg , ShellCommandGetManFileNameDriver1, 0, L"Driver1", TRUE, gShellDriver1HiiHandle, STRING_TOKEN(STR_GET_HELP_DRVCFG) );
-
- return (EFI_SUCCESS);
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param ImageHandle The image handle of the process.
- @param SystemTable The EFI System Table pointer.
-**/
-EFI_STATUS
-EFIAPI
-UefiShellDriver1CommandsLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (gShellDriver1HiiHandle != NULL) {
- HiiRemovePackages(gShellDriver1HiiHandle);
- }
- return (EFI_SUCCESS);
-}
-
-
-
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h
deleted file mode 100644
index 46ba8fdd8f..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/** @file
- Main file for NULL named library for Profile1 shell command functions.
-
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_SHELL_DRIVER1_COMMANDS_LIB_H_
-#define _UEFI_SHELL_DRIVER1_COMMANDS_LIB_H_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/GlobalVariable.h>
-#include <Guid/ConsoleInDevice.h>
-#include <Guid/ConsoleOutDevice.h>
-#include <Guid/ShellLibHiiGuid.h>
-
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/DevicePath.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DriverDiagnostics2.h>
-#include <Protocol/DriverDiagnostics.h>
-#include <Protocol/PlatformDriverOverride.h>
-#include <Protocol/BusSpecificDriverOverride.h>
-#include <Protocol/PlatformToDriverConfiguration.h>
-#include <Protocol/DriverSupportedEfiVersion.h>
-#include <Protocol/DriverFamilyOverride.h>
-#include <Protocol/DriverHealth.h>
-
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/ShellLib.h>
-#include <Library/SortLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HiiLib.h>
-#include <Library/FileHandleLib.h>
-#include <Library/DevicePathLib.h>
-#include <Library/PrintLib.h>
-#include <Library/HandleParsingLib.h>
-#include <Library/PeCoffGetEntryPointLib.h>
-
-
-extern EFI_HANDLE gShellDriver1HiiHandle;
-extern BOOLEAN gInReconnect;
-
-/**
- Function for 'connect' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunConnect (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'devices' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDevices (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'openinfo' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunOpenInfo (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'devtree' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDevTree (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'dh' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDh (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'disconnect' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDisconnect (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'drivers' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDrivers (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'drvcfg' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDrvCfg (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'drvdiag' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDrvDiag (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'reconnect' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunReconnect (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'unload' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunUnload (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-#endif
-
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
deleted file mode 100644
index 2050c71ecd..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
+++ /dev/null
@@ -1,73 +0,0 @@
-## @file
-# Provides shell driver1 profile functions
-#
-# Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellDriver1CommandsLib
- FILE_GUID = 313D3674-3ED4-48fd-BF97-7DB35D4190D1
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = UefiShellDriver1CommandsLibConstructor
- DESTRUCTOR = UefiShellDriver1CommandsLibDestructor
-
-[Sources]
- Connect.c
- Devices.c
- OpenInfo.c
- Disconnect.c
- Reconnect.c
- Unload.c
- DrvDiag.c
- Dh.c
- Drivers.c
- DevTree.c
- DrvCfg.c
- UefiShellDriver1CommandsLib.c
- UefiShellDriver1CommandsLib.h
- UefiShellDriver1CommandsLib.uni
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- ShellCommandLib
- ShellLib
- UefiLib
- UefiRuntimeServicesTableLib
- UefiBootServicesTableLib
- SortLib
- PrintLib
- PeCoffGetEntryPointLib
-
-[Pcd]
- gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask # ALWAYS_CONSUMED
-
-[Protocols]
- gEfiDriverHealthProtocolGuid # ALWAYS_CONSUMED
- gEfiDriverFamilyOverrideProtocolGuid # ALWAYS_CONSUMED
- gEfiHiiConfigAccessProtocolGuid # ALWAYS_CONSUMED
- gEfiHiiDatabaseProtocolGuid # ALWAYS_CONSUMED
-
-[Guids]
- gEfiGlobalVariableGuid # ALWAYS_CONSUMED
- gEfiConsoleInDeviceGuid # ALWAYS_CONSUMED
- gEfiConsoleOutDeviceGuid # ALWAYS_CONSUMED
- gShellDriver1HiiGuid ## PRODUCES
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
deleted file mode 100644
index aeb555076d..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c
deleted file mode 100644
index 4e1ac0da82..0000000000
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/** @file
- Main file for Unload shell Driver1 function.
-
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellDriver1CommandsLib.h"
-
-/**
- Function to translate the EFI_MEMORY_TYPE into a string.
-
- @param[in] Memory The memory type.
-
- @retval A string representation of the type allocated from BS Pool.
-**/
-CHAR16*
-EFIAPI
-ConvertMemoryType (
- IN CONST EFI_MEMORY_TYPE Memory
- )
-{
- CHAR16 *RetVal;
- RetVal = NULL;
-
- switch (Memory) {
- case EfiReservedMemoryType: StrnCatGrow(&RetVal, NULL, L"EfiReservedMemoryType", 0); break;
- case EfiLoaderCode: StrnCatGrow(&RetVal, NULL, L"EfiLoaderCode", 0); break;
- case EfiLoaderData: StrnCatGrow(&RetVal, NULL, L"EfiLoaderData", 0); break;
- case EfiBootServicesCode: StrnCatGrow(&RetVal, NULL, L"EfiBootServicesCode", 0); break;
- case EfiBootServicesData: StrnCatGrow(&RetVal, NULL, L"EfiBootServicesData", 0); break;
- case EfiRuntimeServicesCode: StrnCatGrow(&RetVal, NULL, L"EfiRuntimeServicesCode", 0); break;
- case EfiRuntimeServicesData: StrnCatGrow(&RetVal, NULL, L"EfiRuntimeServicesData", 0); break;
- case EfiConventionalMemory: StrnCatGrow(&RetVal, NULL, L"EfiConventionalMemory", 0); break;
- case EfiUnusableMemory: StrnCatGrow(&RetVal, NULL, L"EfiUnusableMemory", 0); break;
- case EfiACPIReclaimMemory: StrnCatGrow(&RetVal, NULL, L"EfiACPIReclaimMemory", 0); break;
- case EfiACPIMemoryNVS: StrnCatGrow(&RetVal, NULL, L"EfiACPIMemoryNVS", 0); break;
- case EfiMemoryMappedIO: StrnCatGrow(&RetVal, NULL, L"EfiMemoryMappedIO", 0); break;
- case EfiMemoryMappedIOPortSpace: StrnCatGrow(&RetVal, NULL, L"EfiMemoryMappedIOPortSpace", 0); break;
- case EfiPalCode: StrnCatGrow(&RetVal, NULL, L"EfiPalCode", 0); break;
- case EfiMaxMemoryType: StrnCatGrow(&RetVal, NULL, L"EfiMaxMemoryType", 0); break;
- default: ASSERT(FALSE);
- }
- return (RetVal);
-}
-
-/**
- Function to dump LoadedImage info from TheHandle.
-
- @param[in] TheHandle The handle to dump info from.
-
- @retval EFI_SUCCESS The info was dumped.
- @retval EFI_INVALID_PARAMETER The handle did not have LoadedImage
-**/
-EFI_STATUS
-EFIAPI
-DumpLoadedImageProtocolInfo (
- IN EFI_HANDLE TheHandle
- )
-{
- EFI_LOADED_IMAGE_PROTOCOL *Image;
- EFI_STATUS Status;
- CHAR16 *DevicePathText;
- CHAR16 *CodeTypeText;
- CHAR16 *DataTypeText;
- CHAR8 *PdbPointer;
-
- Image = NULL;
-
- Status = gBS->OpenProtocol(TheHandle, &gEfiLoadedImageProtocolGuid, (VOID**)&Image, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
- return (EFI_INVALID_PARAMETER);
- }
- DevicePathText = ConvertDevicePathToText(Image->FilePath, TRUE, TRUE);
- CodeTypeText = ConvertMemoryType(Image->ImageCodeType);
- DataTypeText = ConvertMemoryType(Image->ImageDataType);
- PdbPointer = (CHAR8*)PeCoffLoaderGetPdbPointer(Image->ImageBase);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_UNLOAD_VERBOSE), gShellDriver1HiiHandle,
- ConvertHandleToHandleIndex(TheHandle),
- TheHandle,
- Image,
- Image->ParentHandle,
- Image->SystemTable,
- Image->DeviceHandle,
- DevicePathText,
- PdbPointer,
- Image->ImageBase,
- Image->ImageSize,
- CodeTypeText,
- DataTypeText
- );
-
- SHELL_FREE_NON_NULL(DevicePathText);
- SHELL_FREE_NON_NULL(CodeTypeText);
- SHELL_FREE_NON_NULL(DataTypeText);
-
- return (EFI_SUCCESS);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-n", TypeFlag},
- {L"-v", TypeFlag},
- {L"-verbose", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'unload' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunUnload (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- EFI_HANDLE TheHandle;
- CONST CHAR16 *Param1;
- SHELL_PROMPT_RESPONSE *Resp;
- UINT64 Value;
-
- ShellStatus = SHELL_SUCCESS;
- Package = NULL;
- Resp = NULL;
- Value = 0;
- TheHandle = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) > 2){
- //
- // error for too many parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- if (Param1 != NULL) {
- Status = ShellConvertStringToUint64(Param1, &Value, TRUE, FALSE);
- TheHandle = ConvertHandleIndexToHandle((UINTN)Value);
- }
-
- if (EFI_ERROR(Status) || Param1 == NULL || TheHandle == NULL){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(TheHandle != NULL);
- if (ShellCommandLineGetFlag(Package, L"-v") || ShellCommandLineGetFlag(Package, L"-verbose")) {
- DumpLoadedImageProtocolInfo(TheHandle);
- }
-
- if (!ShellCommandLineGetFlag(Package, L"-n")) {
- Status = ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_UNLOAD_CONF), gShellDriver1HiiHandle, (UINTN)TheHandle);
- Status = ShellPromptForResponse(ShellPromptResponseTypeYesNo, NULL, (VOID**)&Resp);
- }
- if (ShellCommandLineGetFlag(Package, L"-n") || (Resp != NULL && *Resp == ShellPromptResponseYes)) {
- Status = gBS->UnloadImage(TheHandle);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HANDLE_RESULT), gShellDriver1HiiHandle, L"Unload", (UINTN)TheHandle, Status);
- }
- SHELL_FREE_NON_NULL(Resp);
- }
- }
- }
- if (ShellStatus == SHELL_SUCCESS) {
- if (Status == EFI_SECURITY_VIOLATION) {
- ShellStatus = SHELL_SECURITY_VIOLATION;
- } else if (Status == EFI_INVALID_PARAMETER) {
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (EFI_ERROR(Status)) {
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
-
- if (Package != NULL) {
- ShellCommandLineFreeVarList(Package);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c b/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c
deleted file mode 100644
index 6ae4933405..0000000000
--- a/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c
+++ /dev/null
@@ -1,1431 +0,0 @@
-/** @file
- Main file for bcfg shell Install1 function.
-
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellInstall1CommandsLib.h"
-#include <Guid/GlobalVariable.h>
-#include <Library/PrintLib.h>
-#include <Library/HandleParsingLib.h>
-#include <Library/DevicePathLib.h>
-
-typedef enum {
- BcfgTargetBootOrder = 0,
- BcfgTargetDriverOrder = 1,
- BcfgTargetMax = 2
-} BCFG_OPERATION_TARGET;
-
-typedef enum {
- BcfgTypeDump = 0,
- BcfgTypeAdd = 1,
- BcfgTypeAddp = 2,
- BcfgTypeAddh = 3,
- BcfgTypeRm = 4,
- BcfgTypeMv = 5,
- BcfgTypeOpt = 6,
- BcfgTypeMax = 7
-} BCFG_OPERATION_TYPE;
-
-typedef struct {
- BCFG_OPERATION_TARGET Target;
- BCFG_OPERATION_TYPE Type;
- UINT16 Number1;
- UINT16 Number2;
- UINTN HandleIndex;
- CHAR16 *FileName;
- CHAR16 *Description;
- UINT16 *Order;
- CONST CHAR16 *OptData;
-} BGFG_OPERATION;
-
-/**
- Get the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @return Actual number of entries in EFI_KEY_OPTION.Keys.
-**/
-#define KEY_OPTION_INPUT_KEY_COUNT(KeyOption) \
- (((KeyOption)->KeyData & EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK) >> LowBitSet32 (EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK))
-
-/**
- Update the optional data for a boot or driver option.
-
- If optional data exists it will be changed.
-
- @param[in] Index The boot or driver option index update.
- @param[in] DataSize The size in bytes of Data.
- @param[in] Data The buffer for the optioanl data.
- @param[in] Target The target of the operation.
-
- @retval EFI_SUCCESS The data was sucessfully updated.
- @retval other A error occured.
-**/
-EFI_STATUS
-EFIAPI
-UpdateOptionalData(
- UINT16 Index,
- UINTN DataSize,
- UINT8 *Data,
- IN CONST BCFG_OPERATION_TARGET Target
- )
-{
- EFI_STATUS Status;
- CHAR16 VariableName[12];
- UINTN OriginalSize;
- UINT8 *OriginalData;
- UINTN NewSize;
- UINT8 *NewData;
- UINTN OriginalOptionDataSize;
-
- UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", Index);
-
- OriginalSize = 0;
- OriginalData = NULL;
- NewData = NULL;
- NewSize = 0;
-
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &OriginalSize,
- OriginalData);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- OriginalData = AllocateZeroPool(OriginalSize);
- if (OriginalData == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &OriginalSize,
- OriginalData);
- }
-
- if (!EFI_ERROR(Status)) {
- //
- // Allocate new struct and discard old optional data.
- //
- ASSERT (OriginalData != NULL);
- OriginalOptionDataSize = sizeof(UINT32) + sizeof(UINT16) + StrSize(((CHAR16*)(OriginalData + sizeof(UINT32) + sizeof(UINT16))));
- OriginalOptionDataSize += (*(UINT16*)(OriginalData + sizeof(UINT32)));
- OriginalOptionDataSize -= OriginalSize;
- NewSize = OriginalSize - OriginalOptionDataSize + DataSize;
- NewData = AllocateCopyPool(NewSize, OriginalData);
- if (NewData == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- } else {
- CopyMem(NewData + OriginalSize - OriginalOptionDataSize, Data, DataSize);
- }
- }
-
- if (!EFI_ERROR(Status)) {
- //
- // put the data back under the variable
- //
- Status = gRT->SetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- NewSize,
- NewData);
- }
-
- SHELL_FREE_NON_NULL(OriginalData);
- SHELL_FREE_NON_NULL(NewData);
- return (Status);
-}
-
-/**
- This function will get a CRC for a boot option.
-
- @param[in, out] Crc The CRC value to return.
- @param[in] BootIndex The boot option index to CRC.
-
- @retval EFI_SUCCESS The CRC was sucessfully returned.
- @retval other A error occured.
-**/
-EFI_STATUS
-EFIAPI
-GetBootOptionCrc(
- UINT32 *Crc,
- UINT16 BootIndex
- )
-{
- CHAR16 VariableName[12];
- EFI_STATUS Status;
- UINT8 *Buffer;
- UINTN BufferSize;
-
- Buffer = NULL;
- BufferSize = 0;
-
- //
- // Get the data Buffer
- //
- UnicodeSPrint(VariableName, sizeof(VariableName), L"%Boot%04x", BootIndex);
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &BufferSize,
- NULL);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Buffer = AllocateZeroPool(BufferSize);
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &BufferSize,
- Buffer);
- }
-
- //
- // Get the CRC computed
- //
- if (!EFI_ERROR(Status)) {
- Status = gBS->CalculateCrc32 (Buffer, BufferSize, Crc);
- }
-
- SHELL_FREE_NON_NULL(Buffer);
- return EFI_SUCCESS;
-}
-
-/**
- This function will populate the device path protocol parameter based on TheHandle.
-
- @param[in] TheHandle Driver handle.
- @param[in, out] FilePath On a sucessful return the device path to the handle.
-
- @retval EFI_SUCCESS The device path was sucessfully returned.
- @retval other A error from gBS->HandleProtocol.
-
- @sa HandleProtocol
-**/
-EFI_STATUS
-EFIAPI
-GetDevicePathForDriverHandleInstall1 (
- IN EFI_HANDLE TheHandle,
- IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath
- )
-{
- EFI_STATUS Status;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
-
- Status = gBS->OpenProtocol (
- TheHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID**)&LoadedImage,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR (Status)) {
- Status = gBS->OpenProtocol (
- LoadedImage->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&ImageDevicePath,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (!EFI_ERROR (Status)) {
-// *DevPath = DuplicateDevicePath (ImageDevicePath);
-// *FilePath = DuplicateDevicePath (LoadedImage->FilePath);
- *FilePath = AppendDevicePath(ImageDevicePath,LoadedImage->FilePath);
- gBS->CloseProtocol(
- LoadedImage->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- gImageHandle,
- NULL);
- }
- gBS->CloseProtocol(
- TheHandle,
- &gEfiLoadedImageProtocolGuid,
- gImageHandle,
- NULL);
- }
- return (Status);
-}
-
-/**
- Function to add a option.
-
- @param[in] Position The position to add Target at.
- @param[in] File The file to make the target.
- @param[in] Desc The description text.
- @param[in] CurrentOrder The pointer to the current order of items.
- @param[in] OrderCount The number if items in CurrentOrder.
- @param[in] Target The info on the option to add.
- @param[in] UseHandle TRUE to use HandleNumber, FALSE to use File and Desc.
- @param[in] UsePath TRUE to convert to devicepath.
- @param[in] HandleNumber The handle number to add.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
-**/
-SHELL_STATUS
-EFIAPI
-BcfgAddInstall1(
- IN UINTN Position,
- IN CONST CHAR16 *File,
- IN CONST CHAR16 *Desc,
- IN CONST UINT16 *CurrentOrder,
- IN CONST UINTN OrderCount,
- IN CONST BCFG_OPERATION_TARGET Target,
- IN CONST BOOLEAN UseHandle,
- IN CONST BOOLEAN UsePath,
- IN CONST UINTN HandleNumber
- )
-{
- EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_DEVICE_PATH_PROTOCOL *FilePath;
- EFI_DEVICE_PATH_PROTOCOL *FileNode;
- CHAR16 *Str;
- UINT8 *TempByteBuffer;
- UINT8 *TempByteStart;
- EFI_SHELL_FILE_INFO *Arg;
- EFI_SHELL_FILE_INFO *FileList;
- CHAR16 OptionStr[40];
- UINTN DescSize, FilePathSize;
- BOOLEAN Found;
- UINTN TargetLocation;
- UINTN Index;
- EFI_HANDLE *Handles;
- EFI_HANDLE CurHandle;
- UINTN DriverBindingHandleCount;
- UINTN ParentControllerHandleCount;
- UINTN ChildControllerHandleCount;
- SHELL_STATUS ShellStatus;
- UINT16 *NewOrder;
-
- if (!UseHandle) {
- if (File == NULL || Desc == NULL) {
- return (SHELL_INVALID_PARAMETER);
- }
- } else {
- if (HandleNumber == 0) {
- return (SHELL_INVALID_PARAMETER);
- }
- }
-
- if (Position > OrderCount) {
- Position = OrderCount;
- }
-
- Str = NULL;
- FilePath = NULL;
- FileNode = NULL;
- FileList = NULL;
- Handles = NULL;
- ShellStatus = SHELL_SUCCESS;
- TargetLocation = 0xFFFF;
-
- if (UseHandle) {
- CurHandle = ConvertHandleIndexToHandle(HandleNumber);
- if (CurHandle == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, L"Handle Number");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (Target == BcfgTargetBootOrder) {
- //
- //Make sure that the handle should point to a real controller
- //
- Status = PARSE_HANDLE_DATABASE_UEFI_DRIVERS (
- CurHandle,
- &DriverBindingHandleCount,
- NULL);
-
- Status = PARSE_HANDLE_DATABASE_PARENTS (
- CurHandle,
- &ParentControllerHandleCount,
- NULL);
-
- Status = ParseHandleDatabaseForChildControllers (
- CurHandle,
- &ChildControllerHandleCount,
- NULL);
-
- if (DriverBindingHandleCount > 0
- || ParentControllerHandleCount > 0
- || ChildControllerHandleCount > 0) {
- FilePath = NULL;
- Status = gBS->HandleProtocol (
- CurHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&FilePath);
- }
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_HANDLE), gShellInstall1HiiHandle, HandleNumber);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- } else {
- //
- //Make sure that the handle should point to driver, not a controller.
- //
- Status = PARSE_HANDLE_DATABASE_UEFI_DRIVERS (
- CurHandle,
- &DriverBindingHandleCount,
- NULL);
-
- Status = PARSE_HANDLE_DATABASE_PARENTS (
- CurHandle,
- &ParentControllerHandleCount,
- NULL);
-
- Status = ParseHandleDatabaseForChildControllers (
- CurHandle,
- &ChildControllerHandleCount,
- NULL);
-
- Status = gBS->HandleProtocol (
- CurHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&FilePath);
-
- if (DriverBindingHandleCount > 0
- || ParentControllerHandleCount > 0
- || ChildControllerHandleCount > 0
- || !EFI_ERROR(Status) ) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, L"Handle Number");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Get the DevicePath from the loaded image information.
- //
- Status = GetDevicePathForDriverHandleInstall1(CurHandle, &FilePath);
- }
- }
- }
- } else {
- //
- // Get file info
- //
- ShellOpenFileMetaArg ((CHAR16*)File, EFI_FILE_MODE_READ, &FileList);
-
- if (FileList == NULL) {
- //
- // If filename matched nothing fail
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellInstall1HiiHandle, File);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (FileList->Link.ForwardLink != FileList->Link.BackLink) {
- //
- // If filename expanded to multiple names, fail
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE), gShellInstall1HiiHandle, File);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Arg = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link);
- if (EFI_ERROR(Arg->Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_OPEN), gShellInstall1HiiHandle, File, Arg->Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Build FilePath to the filename
- //
-
- //
- // get the device path
- //
- DevicePath = gEfiShellProtocol->GetDevicePathFromFilePath(Arg->FullName);
- if (DevicePath == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellInstall1HiiHandle, Arg->FullName);
- ShellStatus = SHELL_UNSUPPORTED;
- } else {
-/*
- if (UsePath) {
- DevPath = DevicePath;
- while (!IsDevicePathEnd(DevPath)) {
- if ((DevicePathType(DevPath) == MEDIA_DEVICE_PATH) &&
- (DevicePathSubType(DevPath) == MEDIA_HARDDRIVE_DP)) {
-
- //
- // If we find it use it instead
- //
- DevicePath = DevPath;
- break;
- }
- DevPath = NextDevicePathNode(DevPath);
- }
- //
- // append the file
- //
- for(StringWalker=Arg->FullName; *StringWalker != CHAR_NULL && *StringWalker != ':'; StringWalker++);
- FileNode = FileDevicePath(NULL, StringWalker+1);
- FilePath = AppendDevicePath(DevicePath, FileNode);
- FreePool(FileNode);
- } else {
-*/
- FilePath = DuplicateDevicePath(DevicePath);
-/*
- }
-*/
- FreePool(DevicePath);
- }
- }
- }
- }
-
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Find a free target ,a brute force implementation
- //
- Found = FALSE;
- for (TargetLocation=0; TargetLocation < 0xFFFF; TargetLocation++) {
- Found = TRUE;
- for (Index=0; Index < OrderCount; Index++) {
- if (CurrentOrder[Index] == TargetLocation) {
- Found = FALSE;
- break;
- }
- }
-
- if (Found) {
- break;
- }
- }
-
- if (TargetLocation == 0xFFFF) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET_NF), gShellInstall1HiiHandle);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET), gShellInstall1HiiHandle, TargetLocation);
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Add the option
- //
- DescSize = StrSize(Desc);
- FilePathSize = GetDevicePathSize (FilePath);
-
- TempByteBuffer = AllocateZeroPool(sizeof(UINT32) + sizeof(UINT16) + DescSize + FilePathSize);
- if (TempByteBuffer != NULL) {
- TempByteStart = TempByteBuffer;
- *((UINT32 *) TempByteBuffer) = LOAD_OPTION_ACTIVE; // Attributes
- TempByteBuffer += sizeof (UINT32);
-
- *((UINT16 *) TempByteBuffer) = (UINT16)FilePathSize; // FilePathListLength
- TempByteBuffer += sizeof (UINT16);
-
- CopyMem (TempByteBuffer, Desc, DescSize);
- TempByteBuffer += DescSize;
- ASSERT (FilePath != NULL);
- CopyMem (TempByteBuffer, FilePath, FilePathSize);
-
- UnicodeSPrint (OptionStr, sizeof(OptionStr), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", TargetLocation);
- Status = gRT->SetVariable (
- OptionStr,
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof(UINT32) + sizeof(UINT16) + DescSize + FilePathSize,
- TempByteStart
- );
-
- FreePool(TempByteStart);
- } else {
- Status = EFI_OUT_OF_RESOURCES;
- }
-
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellInstall1HiiHandle, OptionStr, Status);
- } else {
- NewOrder = AllocateZeroPool((OrderCount+1)*sizeof(NewOrder[0]));
- ASSERT(NewOrder != NULL);
- CopyMem(NewOrder, CurrentOrder, (OrderCount)*sizeof(NewOrder[0]));
-
- //
- // Insert target into order list
- //
- for (Index=OrderCount; Index > Position; Index--) {
- NewOrder[Index] = NewOrder[Index-1];
- }
-
- NewOrder[Position] = (UINT16) TargetLocation;
- Status = gRT->SetVariable (
- Target == BcfgTargetBootOrder?L"BootOrder":L"DriverOrder",
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- (OrderCount+1) * sizeof(UINT16),
- NewOrder
- );
-
- FreePool(NewOrder);
-
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellInstall1HiiHandle, Target == BcfgTargetBootOrder?L"BootOrder":L"DriverOrder", Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Print (L"bcfg: Add %s as %x\n", OptionStr, Position);
- }
- }
- }
-
-//
-//If always Free FilePath, will free devicepath in system when use "addh"
-//
- if (FilePath!=NULL && !UseHandle) {
- FreePool (FilePath);
- }
-
- if (Str != NULL) {
- FreePool(Str);
- }
-
- if (Handles != NULL) {
- FreePool (Handles);
- }
-
- if (FileList != NULL) {
- ShellCloseFileMetaArg (&FileList);
- }
-
- return (ShellStatus);
-}
-
-/**
- Funciton to remove an item.
-
- @param[in] Target The target item to move.
- @param[in] CurrentOrder The pointer to the current order of items.
- @param[in] OrderCount The number if items in CurrentOrder.
- @param[in] Location The current location of the Target.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
-**/
-SHELL_STATUS
-EFIAPI
-BcfgRemoveInstall1(
- IN CONST BCFG_OPERATION_TARGET Target,
- IN CONST UINT16 *CurrentOrder,
- IN CONST UINTN OrderCount,
- IN CONST UINT16 Location
- )
-{
- CHAR16 VariableName[12];
- UINT16 *NewOrder;
- EFI_STATUS Status;
- UINTN NewCount;
-
- UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", CurrentOrder[Location]);
- Status = gRT->SetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- 0,
- NULL);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellInstall1HiiHandle, VariableName, Status);
- return (SHELL_INVALID_PARAMETER);
- }
- NewOrder = AllocateZeroPool(OrderCount*sizeof(CurrentOrder[0]));
- if (NewOrder != NULL) {
- NewCount = OrderCount;
- CopyMem(NewOrder, CurrentOrder, OrderCount*sizeof(CurrentOrder[0]));
- CopyMem(NewOrder+Location, NewOrder+Location+1, (OrderCount - Location - 1)*sizeof(CurrentOrder[0]));
- NewCount--;
-
- Status = gRT->SetVariable(
- Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- NewCount*sizeof(NewOrder[0]),
- NewOrder);
- FreePool(NewOrder);
- } else {
- Status = EFI_OUT_OF_RESOURCES;
- }
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellInstall1HiiHandle, Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder", Status);
- return (SHELL_INVALID_PARAMETER);
- }
- return (SHELL_SUCCESS);
-}
-
-/**
- Funciton to move a item to another location.
-
- @param[in] Target The target item to move.
- @param[in] CurrentOrder The pointer to the current order of items.
- @param[in] OrderCount The number if items in CurrentOrder.
- @param[in] OldLocation The current location of the Target.
- @param[in] NewLocation The desired location of the Target.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
-**/
-SHELL_STATUS
-EFIAPI
-BcfgMoveInstall1(
- IN CONST BCFG_OPERATION_TARGET Target,
- IN CONST UINT16 *CurrentOrder,
- IN CONST UINTN OrderCount,
- IN CONST UINT16 OldLocation,
- IN CONST UINT16 NewLocation
- )
-{
- UINT16 *NewOrder;
- EFI_STATUS Status;
- UINT16 Temp;
-
- NewOrder = AllocateZeroPool(OrderCount*sizeof(CurrentOrder[0]));
- ASSERT(NewOrder != NULL);
-
- Temp = CurrentOrder[OldLocation];
- CopyMem(NewOrder, CurrentOrder, OrderCount*sizeof(CurrentOrder[0]));
- CopyMem(NewOrder+OldLocation, NewOrder+OldLocation+1, (OrderCount - OldLocation - 1)*sizeof(CurrentOrder[0]));
- CopyMem(NewOrder+NewLocation+1, NewOrder+NewLocation, (OrderCount - NewLocation - 1)*sizeof(CurrentOrder[0]));
- NewOrder[NewLocation] = Temp;
-
-
- Status = gRT->SetVariable(
- Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- OrderCount*sizeof(CurrentOrder[0]),
- NewOrder);
-
- FreePool(NewOrder);
-
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellInstall1HiiHandle, Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder", Status);
- return (SHELL_INVALID_PARAMETER);
- }
- return (SHELL_SUCCESS);
-}
-
-/**
- Function to add optional data to an option.
-
- @param[in] OptData The optional data to add.
- @param[in] CurrentOrder The pointer to the current order of items.
- @param[in] OrderCount The number if items in CurrentOrder.
- @param[in] Target The target of the operation.
-
- @retval SHELL_SUCCESS The operation was succesful.
-**/
-SHELL_STATUS
-EFIAPI
-BcfgAddOptInstall1(
- IN CONST CHAR16 *OptData,
- IN CONST UINT16 *CurrentOrder,
- IN CONST UINTN OrderCount,
- IN CONST BCFG_OPERATION_TARGET Target
- )
-{
- EFI_KEY_OPTION NewKeyOption;
- EFI_KEY_OPTION *KeyOptionBuffer;
- SHELL_STATUS ShellStatus;
- EFI_STATUS Status;
- UINT16 OptionIndex;
- UINT16 LoopCounter;
- UINT64 Intermediate;
- CONST CHAR16 *Temp;
- CONST CHAR16 *Walker;
- CHAR16 *FileName;
- CHAR16 *Temp2;
- CHAR16 *Data;
- UINT16 KeyIndex;
- CHAR16 VariableName[12];
-
- SHELL_FILE_HANDLE FileHandle;
-
- Status = EFI_SUCCESS;
- ShellStatus = SHELL_SUCCESS;
- Walker = OptData;
- FileName = NULL;
- Data = NULL;
- KeyOptionBuffer = NULL;
-
- ZeroMem(&NewKeyOption, sizeof(EFI_KEY_OPTION));
-
- while(Walker[0] == L' ') {
- Walker++;
- }
-
- //
- // Get the index of the variable we are changing.
- //
- Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
- if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL || ((UINT16)Intermediate) > ((UINT16)OrderCount)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, L"Option Index");
- ShellStatus = SHELL_INVALID_PARAMETER;
- return (ShellStatus);
- }
- OptionIndex = (UINT16)Intermediate;
-
- Temp = StrStr(Walker, L" ");
- if (Temp != NULL) {
- Walker = Temp;
- }
- while(Walker[0] == L' ') {
- Walker++;
- }
-
- //
- // determine whether we have file with data, quote delimited information, or a hot-key
- //
- if (Walker[0] == L'\"') {
- //
- // quoted filename or quoted information.
- //
- Temp = StrStr(Walker+1, L"\"");
- if (Temp == NULL || StrLen(Temp) != 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- FileName = StrnCatGrow(&FileName, NULL, Walker+1, 0);
- if (FileName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellInstall1HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- return (ShellStatus);
- }
- Temp2 = StrStr(FileName, L"\"");
- ASSERT(Temp2 != NULL);
- Temp2[0] = CHAR_NULL;
- Temp2++;
- if (StrLen(Temp2)>0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- if (EFI_ERROR(ShellFileExists(Walker))) {
- //
- // Not a file. must be misc information.
- //
- Data = FileName;
- FileName = NULL;
- } else {
- FileName = StrnCatGrow(&FileName, NULL, Walker, 0);
- }
- }
- } else {
- //
- // filename or hot key information.
- //
- if (StrStr(Walker, L" ") == NULL) {
- //
- // filename
- //
- if (EFI_ERROR(ShellFileExists(Walker))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellInstall1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- FileName = StrnCatGrow(&FileName, NULL, Walker, 0);
- }
- } else {
- if (Target != BcfgTargetBootOrder) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_BOOT_ONLY), gShellInstall1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Get hot key information
- //
- Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
- if (EFI_ERROR(Status) || (((UINT32)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- NewKeyOption.KeyData = (UINT32)Intermediate;
- Temp = StrStr(Walker, L" ");
- if (Temp != NULL) {
- Walker = Temp;
- }
- while(Walker[0] == L' ') {
- Walker++;
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Now we know how many EFI_INPUT_KEY structs we need to attach to the end of the EFI_KEY_OPTION struct.
- // Re-allocate with the added information.
- //
- KeyOptionBuffer = AllocateCopyPool(sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)), &NewKeyOption);
- if (KeyOptionBuffer == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellInstall1HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- }
- }
- for (LoopCounter = 0 ; ShellStatus == SHELL_SUCCESS && LoopCounter < KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption); LoopCounter++) {
- //
- // ScanCode
- //
- Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
- if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- ((EFI_INPUT_KEY*)(((UINT8*)KeyOptionBuffer) + sizeof(EFI_KEY_OPTION)))[LoopCounter].ScanCode = (UINT16)Intermediate;
- Temp = StrStr(Walker, L" ");
- if (Temp != NULL) {
- Walker = Temp;
- }
- while(Walker[0] == L' ') {
- Walker++;
- }
-
- //
- // UnicodeChar
- //
- Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
- if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, Walker);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- ((EFI_INPUT_KEY*)(((UINT8*)KeyOptionBuffer) + sizeof(EFI_KEY_OPTION)))[LoopCounter].UnicodeChar = (UINT16)Intermediate;
- Temp = StrStr(Walker, L" ");
- if (Temp != NULL) {
- Walker = Temp;
- }
- while(Walker[0] == L' ') {
- Walker++;
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // Now do the BootOption / BootOptionCrc
- //
- ASSERT (OptionIndex <= OrderCount);
- KeyOptionBuffer->BootOption = CurrentOrder[OptionIndex];
- Status = GetBootOptionCrc(&(KeyOptionBuffer->BootOptionCrc), KeyOptionBuffer->BootOption);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, L"Option Index");
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS) {
- for (Temp2 = NULL, KeyIndex = 0 ; KeyIndex < 0xFFFF ; KeyIndex++) {
- UnicodeSPrint(VariableName, sizeof(VariableName), L"Key%04x", KeyIndex);
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- (UINTN*)&Intermediate,
- NULL);
- if (Status == EFI_NOT_FOUND) {
- break;
- }
- }
- Status = gRT->SetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)),
- KeyOptionBuffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellInstall1HiiHandle, VariableName, Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- ASSERT(FileName == NULL && Data == NULL);
- }
- }
- }
-
- //
- // Shouldn't be possible to have have both. Neither is ok though.
- //
- ASSERT(FileName == NULL || Data == NULL);
-
- if (ShellStatus == SHELL_SUCCESS && (FileName != NULL || Data != NULL)) {
- if (FileName != NULL) {
- //
- // Open the file and populate the data buffer.
- //
- Status = ShellOpenFileByName(
- FileName,
- &FileHandle,
- EFI_FILE_MODE_READ,
- 0);
- if (!EFI_ERROR(Status)) {
- Status = ShellGetFileSize(FileHandle, &Intermediate);
- }
- Data = AllocateZeroPool((UINTN)Intermediate);
- if (Data == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellInstall1HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- }
- if (!EFI_ERROR(Status)) {
- Status = ShellReadFile(FileHandle, (UINTN *)&Intermediate, Data);
- }
- } else {
- Intermediate = StrSize(Data);
- }
-
- if (!EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS && Data != NULL) {
- Status = UpdateOptionalData(CurrentOrder[OptionIndex], (UINTN)Intermediate, (UINT8*)Data, Target);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellInstall1HiiHandle, VariableName, Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellInstall1HiiHandle, VariableName, Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
-
- SHELL_FREE_NON_NULL(Data);
- SHELL_FREE_NON_NULL(KeyOptionBuffer);
- SHELL_FREE_NON_NULL(FileName);
- return ShellStatus;
-}
-
-/**
- Function to dump the Bcfg information.
-
- @param[in] Op The operation.
- @param[in] OrderCount How many to dump.
- @param[in] CurrentOrder The pointer to the current order of items.
- @param[in] VerboseOutput TRUE for extra output. FALSE otherwise.
-
- @retval SHELL_SUCCESS The dump was successful.
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
-**/
-SHELL_STATUS
-EFIAPI
-BcfgDisplayDumpInstall1(
- IN CONST CHAR16 *Op,
- IN CONST UINTN OrderCount,
- IN CONST UINT16 *CurrentOrder,
- IN CONST BOOLEAN VerboseOutput
- )
-{
- EFI_STATUS Status;
- UINT8 *Buffer;
- UINTN BufferSize;
- CHAR16 VariableName[12];
- UINTN LoopVar;
- UINTN LoopVar2;
- CHAR16 *DevPathString;
- VOID *DevPath;
-
- if (OrderCount == 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE), gShellInstall1HiiHandle);
- return (SHELL_SUCCESS);
- }
-
- for (LoopVar = 0 ; LoopVar < OrderCount ; LoopVar++) {
- Buffer = NULL;
- BufferSize = 0;
- UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Op, CurrentOrder[LoopVar]);
-
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &BufferSize,
- Buffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Buffer = AllocateZeroPool(BufferSize);
- Status = gRT->GetVariable(
- VariableName,
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &BufferSize,
- Buffer);
- }
-
- if (EFI_ERROR(Status) || Buffer == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_READ_FAIL), gShellInstall1HiiHandle, VariableName, Status);
- return (SHELL_INVALID_PARAMETER);
- }
-
- if ((*(UINT16*)(Buffer+4)) != 0) {
- DevPath = AllocateZeroPool(*(UINT16*)(Buffer+4));
- CopyMem(DevPath, Buffer+6+StrSize((CHAR16*)(Buffer+6)), *(UINT16*)(Buffer+4));
- DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
- } else {
- DevPath = NULL;
- DevPathString = NULL;
- }
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_BCFG_LOAD_OPTIONS),
- gShellInstall1HiiHandle,
- LoopVar,
- VariableName,
- (CHAR16*)(Buffer+6),
- DevPathString,
- (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) <= BufferSize?L'N':L'Y');
- if (VerboseOutput) {
- for (LoopVar2 = (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6);LoopVar2<BufferSize;LoopVar2++){
- ShellPrintEx(
- -1,
- -1,
- NULL,
- L"%02x",
- Buffer[LoopVar2]);
- }
- ShellPrintEx(
- -1,
- -1,
- NULL,
- L"\r\n");
- }
-
- if (Buffer != NULL) {
- FreePool(Buffer);
- }
- if (DevPath != NULL) {
- FreePool(DevPath);
- }
- if (DevPathString != NULL) {
- FreePool(DevPathString);
- }
- }
- return (SHELL_SUCCESS);
-}
-
-/**
- Function to initialize the BCFG operation structure.
-
- @param[in] Struct The stuct to initialize.
-**/
-VOID
-EFIAPI
-InitBcfgStructInstall1(
- IN BGFG_OPERATION *Struct
- )
-{
- ASSERT(Struct != NULL);
- Struct->Target = BcfgTargetMax;
- Struct->Type = BcfgTypeMax;
- Struct->Number1 = 0;
- Struct->Number2 = 0;
- Struct->HandleIndex = 0;
- Struct->FileName = NULL;
- Struct->Description = NULL;
- Struct->Order = NULL;
- Struct->OptData = NULL;
-}
-
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-v", TypeFlag},
- {L"-opt", TypeMaxValue},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'bcfg' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunBcfgInstall (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN ParamNumber;
- CONST CHAR16 *CurrentParam;
- BGFG_OPERATION CurrentOperation;
- UINTN Length;
- UINT64 Intermediate;
-
- Length = 0;
- ProblemParam = NULL;
- Package = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- InitBcfgStructInstall1(&CurrentOperation);
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // Read in if we are doing -OPT
- //
- if (ShellCommandLineGetFlag(Package, L"-opt")) {
- CurrentOperation.OptData = ShellCommandLineGetValue(Package, L"-opt");
- if (CurrentOperation.OptData == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellInstall1HiiHandle, L"-opt");
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeOpt;
- }
-
- //
- // small block to read the target of the operation
- //
- if ((ShellCommandLineGetCount(Package) < 3 && CurrentOperation.Type != BcfgTypeOpt) ||
- (ShellCommandLineGetCount(Package) < 2 && CurrentOperation.Type == BcfgTypeOpt)
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellInstall1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"driver") == 0) {
- CurrentOperation.Target = BcfgTargetDriverOrder;
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"boot") == 0) {
- CurrentOperation.Target = BcfgTargetBootOrder;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_DRIVER_BOOT), gShellInstall1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
-
-
- //
- // Read in the boot or driver order environment variable (not needed for opt)
- //
- if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BcfgTargetMax) {
- Length = 0;
- Status = gRT->GetVariable(
- CurrentOperation.Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &Length,
- CurrentOperation.Order);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- CurrentOperation.Order = AllocateZeroPool(Length+(4*sizeof(CurrentOperation.Order[0])));
- Status = gRT->GetVariable(
- CurrentOperation.Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
- (EFI_GUID*)&gEfiGlobalVariableGuid,
- NULL,
- &Length,
- CurrentOperation.Order);
- }
- }
-
- //
- // large block to read the type of operation and verify parameter types for the info.
- //
- if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BcfgTargetMax) {
- for (ParamNumber = 2 ; ParamNumber < ShellCommandLineGetCount(Package) && ShellStatus == SHELL_SUCCESS; ParamNumber++) {
- CurrentParam = ShellCommandLineGetRawValue(Package, ParamNumber);
- if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"dump") == 0) {
- CurrentOperation.Type = BcfgTypeDump;
- } else if (ShellCommandLineGetFlag(Package, L"-v")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, L"-v (without dump)");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"add") == 0) {
- if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellInstall1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeAdd;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number1 = (UINT16)Intermediate;
- ASSERT(CurrentOperation.FileName == NULL);
- CurrentOperation.FileName = StrnCatGrow(&CurrentOperation.FileName , NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
- ASSERT(CurrentOperation.Description == NULL);
- CurrentOperation.Description = StrnCatGrow(&CurrentOperation.Description, NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
- }
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"addp") == 0) {
- if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellInstall1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeAddp;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number1 = (UINT16)Intermediate;
- ASSERT(CurrentOperation.FileName == NULL);
- CurrentOperation.FileName = StrnCatGrow(&CurrentOperation.FileName , NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
- ASSERT(CurrentOperation.Description == NULL);
- CurrentOperation.Description = StrnCatGrow(&CurrentOperation.Description, NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
- }
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"addh") == 0) {
- if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellInstall1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeAddh;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number1 = (UINT16)Intermediate;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.HandleIndex = (UINT16)Intermediate;
- ASSERT(CurrentOperation.Description == NULL);
- CurrentOperation.Description = StrnCatGrow(&CurrentOperation.Description, NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
- }
- }
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"rm") == 0) {
- if ((ParamNumber + 1) >= ShellCommandLineGetCount(Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellInstall1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeRm;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number1 = (UINT16)Intermediate;
- if (CurrentOperation.Number1 > (Length / sizeof(CurrentOperation.Order[0]))){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellInstall1HiiHandle, Length / sizeof(CurrentOperation.Order[0]));
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"mv") == 0) {
- if ((ParamNumber + 2) >= ShellCommandLineGetCount(Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellInstall1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentOperation.Type = BcfgTypeMv;
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number1 = (UINT16)Intermediate;
- if (CurrentOperation.Number1 > (Length / sizeof(CurrentOperation.Order[0]))){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellInstall1HiiHandle, Length / sizeof(CurrentOperation.Order[0]));
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
- if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
- CurrentOperation.Number2 = (UINT16)Intermediate;
- }
- if (CurrentOperation.Number2 == CurrentOperation.Number1
- ||CurrentOperation.Number1 > (Length / sizeof(CurrentOperation.Order[0]))
- ||CurrentOperation.Number2 > (Length / sizeof(CurrentOperation.Order[0]))
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellInstall1HiiHandle, Length / sizeof(CurrentOperation.Order[0]));
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, CurrentParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- }
- if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BcfgTargetMax && CurrentOperation.Type < BcfgTypeMax) {
- //
- // we have all the info. Do the work
- //
- switch (CurrentOperation.Type) {
- case BcfgTypeDump:
- ShellStatus = BcfgDisplayDumpInstall1(
- CurrentOperation.Target == BcfgTargetBootOrder?L"Boot":L"Driver",
- Length / sizeof(CurrentOperation.Order[0]),
- CurrentOperation.Order,
- ShellCommandLineGetFlag(Package, L"-v"));
- break;
- case BcfgTypeMv:
- ShellStatus = BcfgMoveInstall1(
- CurrentOperation.Target,
- CurrentOperation.Order,
- Length / sizeof(CurrentOperation.Order[0]),
- CurrentOperation.Number1,
- CurrentOperation.Number2);
- break;
- case BcfgTypeRm:
- ShellStatus = BcfgRemoveInstall1(
- CurrentOperation.Target,
- CurrentOperation.Order,
- Length / sizeof(CurrentOperation.Order[0]),
- CurrentOperation.Number1);
- break;
- case BcfgTypeAdd:
- case BcfgTypeAddp:
- case BcfgTypeAddh:
- ShellStatus = BcfgAddInstall1(
- CurrentOperation.Number1,
- CurrentOperation.FileName,
- CurrentOperation.Description==NULL?L"":CurrentOperation.Description,
- CurrentOperation.Order,
- Length / sizeof(CurrentOperation.Order[0]),
- CurrentOperation.Target,
- (BOOLEAN)(CurrentOperation.Type == BcfgTypeAddh),
- (BOOLEAN)(CurrentOperation.Type == BcfgTypeAddp),
- CurrentOperation.HandleIndex);
- break;
- case BcfgTypeOpt:
- ShellStatus = BcfgAddOptInstall1(
- CurrentOperation.OptData,
- CurrentOperation.Order,
- Length / sizeof(CurrentOperation.Order[0]),
- CurrentOperation.Target);
- break;
- default:
- ASSERT(FALSE);
- }
- }
- }
-
- if (Package != NULL) {
- ShellCommandLineFreeVarList (Package);
- }
- if (CurrentOperation.FileName != NULL) {
- FreePool(CurrentOperation.FileName);
- }
- if (CurrentOperation.Description != NULL) {
- FreePool(CurrentOperation.Description);
- }
- if (CurrentOperation.Order != NULL) {
- FreePool(CurrentOperation.Order);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c
deleted file mode 100644
index b7f0878b73..0000000000
--- a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
- Main file for NULL named library for install1 shell command functions.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellInstall1CommandsLib.h"
-
-STATIC CONST CHAR16 mFileName[] = L"ShellCommands";
-EFI_HANDLE gShellInstall1HiiHandle = NULL;
-
-/**
- Function to get the filename with help context if HII will not be used.
-
- @return The filename with help text in it.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandGetManFileNameInstall1 (
- VOID
- )
-{
- return (mFileName);
-}
-
-/**
- Constructor for the Shell Level 1 Commands library.
-
- Install the handlers for level 1 UEFI Shell 2.0 commands.
-
- @param ImageHandle the image handle of the process
- @param SystemTable the EFI System Table pointer
-
- @retval EFI_SUCCESS the shell command handlers were installed sucessfully
- @retval EFI_UNSUPPORTED the shell level required was not found.
-**/
-EFI_STATUS
-EFIAPI
-ShellInstall1CommandsLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- //
- // check our bit of the profiles mask
- //
- if ((PcdGet8(PcdShellProfileMask) & BIT2) == 0) {
- return (EFI_SUCCESS);
- }
-
- gShellInstall1HiiHandle = HiiAddPackages (&gShellInstall1HiiGuid, gImageHandle, UefiShellInstall1CommandsLibStrings, NULL);
- if (gShellInstall1HiiHandle == NULL) {
- return (EFI_DEVICE_ERROR);
- }
-
- //
- // install our shell command handlers that are always installed
- //
- ShellCommandRegisterCommandName(L"bcfg", ShellCommandRunBcfgInstall , ShellCommandGetManFileNameInstall1, 0, L"Install", FALSE, gShellInstall1HiiHandle, STRING_TOKEN(STR_GET_HELP_BCFG));
-
- return (EFI_SUCCESS);
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param ImageHandle The image handle of the process.
- @param SystemTable The EFI System Table pointer.
-**/
-EFI_STATUS
-EFIAPI
-ShellInstall1CommandsLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (gShellInstall1HiiHandle != NULL) {
- HiiRemovePackages(gShellInstall1HiiHandle);
- }
- return (EFI_SUCCESS);
-}
diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h
deleted file mode 100644
index 8b47a29a86..0000000000
--- a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/** @file
- Main file for NULL named library for install 1 shell command functions.
-
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_SHELL_INSTALL1_COMMANDS_LIB_H_
-#define _UEFI_SHELL_INSTALL1_COMMANDS_LIB_H_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/ShellLibHiiGuid.h>
-
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/DevicePath.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/UnicodeCollation.h>
-
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/ShellLib.h>
-#include <Library/SortLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HiiLib.h>
-#include <Library/FileHandleLib.h>
-
-extern EFI_HANDLE gShellInstall1HiiHandle;
-
-/**
- Function for 'bcfg' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunBcfgInstall (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-#endif
-
diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
deleted file mode 100644
index 5188a00384..0000000000
--- a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
+++ /dev/null
@@ -1,53 +0,0 @@
-## @file
-# Provides shell install1 functions
-#
-# Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellInstall1CommandsLib
- FILE_GUID = D250E364-51C6-49ed-AEBF-6D83F5130F74
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = ShellInstall1CommandsLibConstructor
- DESTRUCTOR = ShellInstall1CommandsLibDestructor
-
-[Sources.common]
- UefiShellInstall1CommandsLib.c
- UefiShellInstall1CommandsLib.h
- UefiShellInstall1CommandsLib.uni
- Bcfg.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- ShellCommandLib
- ShellLib
- UefiLib
- UefiRuntimeServicesTableLib
- UefiBootServicesTableLib
- SortLib
- PrintLib
-
-[Pcd]
- gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask # ALWAYS_CONSUMED
-
-[Guids]
- gShellInstall1HiiGuid
diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.uni b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.uni
deleted file mode 100644
index d4b030abb6..0000000000
--- a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/Exit.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/Exit.c
deleted file mode 100644
index 3a3c59fa03..0000000000
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/Exit.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/** @file
- Main file for exit shell level 1 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel1CommandsLib.h"
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"/b", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'exit' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunExit (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINT64 RetVal;
- CONST CHAR16 *Return;
-
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
-
- //
- // return the specified error code
- //
- Return = ShellCommandLineGetRawValue(Package, 1);
- if (Return != NULL) {
- Status = ShellConvertStringToUint64(Return, &RetVal, FALSE, FALSE);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, Return);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // If we are in a batch file and /b then pass TRUE otherwise false...
- //
- ShellCommandRegisterExit((BOOLEAN)(gEfiShellProtocol->BatchIsActive() && ShellCommandLineGetFlag(Package, L"/b")), RetVal);
-
- ShellStatus = SHELL_SUCCESS;
- }
- } else {
- // If we are in a batch file and /b then pass TRUE otherwise false...
- //
- ShellCommandRegisterExit((BOOLEAN)(gEfiShellProtocol->BatchIsActive() && ShellCommandLineGetFlag(Package, L"/b")), 0);
-
- ShellStatus = SHELL_SUCCESS;
- }
-
- ShellCommandLineFreeVarList (Package);
- }
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
deleted file mode 100644
index b01c69d3da..0000000000
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
+++ /dev/null
@@ -1,732 +0,0 @@
-/** @file
- Main file for endfor and for shell level 1 functions.
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel1CommandsLib.h"
-#include <Library/PrintLib.h>
-
-/**
- Determine if a valid string is a valid number for the 'for' command.
-
- @param[in] Number The pointer to the string representation of the number to test.
-
- @retval TRUE The number is valid.
- @retval FALSE The number is not valid.
-**/
-BOOLEAN
-EFIAPI
-ShellIsValidForNumber (
- IN CONST CHAR16 *Number
- )
-{
- if (Number == NULL || *Number == CHAR_NULL) {
- return (FALSE);
- }
-
- if (*Number == L'-') {
- Number++;
- }
-
- if (StrLen(Number) == 0) {
- return (FALSE);
- }
-
- if (StrLen(Number) >= 7) {
- if ((StrStr(Number, L" ") == NULL) || (((StrStr(Number, L" ") != NULL) && (StrStr(Number, L" ") - Number) >= 7))) {
- return (FALSE);
- }
- }
-
- if (!ShellIsDecimalDigitCharacter(*Number)) {
- return (FALSE);
- }
-
- return (TRUE);
-}
-
-/**
- Function for 'endfor' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEndFor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- BOOLEAN Found;
- SCRIPT_FILE *CurrentScriptFile;
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- if (!gEfiShellProtocol->BatchIsActive()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"EndFor");
- return (SHELL_UNSUPPORTED);
- }
-
- if (gEfiShellParametersProtocol->Argc > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle);
- return (SHELL_INVALID_PARAMETER);
- }
-
- Found = MoveToTag(GetPreviousNode, L"for", L"endfor", NULL, ShellCommandGetCurrentScriptFile(), FALSE, FALSE, FALSE);
-
- if (!Found) {
- CurrentScriptFile = ShellCommandGetCurrentScriptFile();
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"For",
- L"EndFor",
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- return (SHELL_NOT_FOUND);
- }
- return (SHELL_SUCCESS);
-}
-
-typedef struct {
- UINT32 Signature;
- INTN Current;
- INTN End;
- INTN Step;
- CHAR16 *ReplacementName;
- CHAR16 *CurrentValue;
- BOOLEAN RemoveSubstAlias;
- CHAR16 Set[1];
- } SHELL_FOR_INFO;
-#define SIZE_OF_SHELL_FOR_INFO OFFSET_OF (SHELL_FOR_INFO, Set)
-#define SHELL_FOR_INFO_SIGNATURE SIGNATURE_32 ('S', 'F', 'I', 's')
-
-/**
- Update the value of a given alias on the list. If the alias is not there then add it.
-
- @param[in] Alias The alias to test for.
- @param[in] CommandString The updated command string.
- @param[in, out] List The list to search.
-
- @retval EFI_SUCCESS The operation was completed successfully.
- @retval EFI_OUT_OF_RESOURCES There was not enough free memory.
-**/
-EFI_STATUS
-EFIAPI
-InternalUpdateAliasOnList(
- IN CONST CHAR16 *Alias,
- IN CONST CHAR16 *CommandString,
- IN OUT LIST_ENTRY *List
- )
-{
- ALIAS_LIST *Node;
- BOOLEAN Found;
-
- //
- // assert for NULL parameter
- //
- ASSERT(Alias != NULL);
-
- //
- // check for the Alias
- //
- for ( Node = (ALIAS_LIST *)GetFirstNode(List), Found = FALSE
- ; !IsNull(List, &Node->Link)
- ; Node = (ALIAS_LIST *)GetNextNode(List, &Node->Link)
- ){
- ASSERT(Node->CommandString != NULL);
- ASSERT(Node->Alias != NULL);
- if (StrCmp(Node->Alias, Alias)==0) {
- FreePool(Node->CommandString);
- Node->CommandString = NULL;
- Node->CommandString = StrnCatGrow(&Node->CommandString, NULL, CommandString, 0);
- Found = TRUE;
- break;
- }
- }
- if (!Found) {
- Node = AllocateZeroPool(sizeof(ALIAS_LIST));
- if (Node == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- ASSERT(Node->Alias == NULL);
- Node->Alias = StrnCatGrow(&Node->Alias, NULL, Alias, 0);
- ASSERT(Node->CommandString == NULL);
- Node->CommandString = StrnCatGrow(&Node->CommandString, NULL, CommandString, 0);
- InsertTailList(List, &Node->Link);
- }
- return (EFI_SUCCESS);
-}
-
-/**
- Find out if an alias is on the given list.
-
- @param[in] Alias The alias to test for.
- @param[in] List The list to search.
-
- @retval TRUE The alias is on the list.
- @retval FALSE The alias is not on the list.
-**/
-BOOLEAN
-EFIAPI
-InternalIsAliasOnList(
- IN CONST CHAR16 *Alias,
- IN CONST LIST_ENTRY *List
- )
-{
- ALIAS_LIST *Node;
-
- //
- // assert for NULL parameter
- //
- ASSERT(Alias != NULL);
-
- //
- // check for the Alias
- //
- for ( Node = (ALIAS_LIST *)GetFirstNode(List)
- ; !IsNull(List, &Node->Link)
- ; Node = (ALIAS_LIST *)GetNextNode(List, &Node->Link)
- ){
- ASSERT(Node->CommandString != NULL);
- ASSERT(Node->Alias != NULL);
- if (StrCmp(Node->Alias, Alias)==0) {
- return (TRUE);
- }
- }
- return (FALSE);
-}
-
-/**
- Remove an alias from the given list.
-
- @param[in] Alias The alias to remove.
- @param[in, out] List The list to search.
-**/
-BOOLEAN
-EFIAPI
-InternalRemoveAliasFromList(
- IN CONST CHAR16 *Alias,
- IN OUT LIST_ENTRY *List
- )
-{
- ALIAS_LIST *Node;
-
- //
- // assert for NULL parameter
- //
- ASSERT(Alias != NULL);
-
- //
- // check for the Alias
- //
- for ( Node = (ALIAS_LIST *)GetFirstNode(List)
- ; !IsNull(List, &Node->Link)
- ; Node = (ALIAS_LIST *)GetNextNode(List, &Node->Link)
- ){
- ASSERT(Node->CommandString != NULL);
- ASSERT(Node->Alias != NULL);
- if (StrCmp(Node->Alias, Alias)==0) {
- RemoveEntryList(&Node->Link);
- FreePool(Node->Alias);
- FreePool(Node->CommandString);
- FreePool(Node);
- return (TRUE);
- }
- }
- return (FALSE);
-}
-
-/**
- Function for 'for' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunFor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- SHELL_STATUS ShellStatus;
- SCRIPT_FILE *CurrentScriptFile;
- CHAR16 *ArgSet;
- CHAR16 *ArgSetWalker;
- UINTN ArgSize;
- UINTN LoopVar;
- SHELL_FOR_INFO *Info;
- CHAR16 *TempString;
- CHAR16 *TempSpot;
- BOOLEAN FirstPass;
- EFI_SHELL_FILE_INFO *Node;
- EFI_SHELL_FILE_INFO *FileList;
- UINTN NewSize;
-
- ArgSet = NULL;
- ArgSize = 0;
- ShellStatus = SHELL_SUCCESS;
- ArgSetWalker = NULL;
- TempString = NULL;
- FirstPass = FALSE;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- if (!gEfiShellProtocol->BatchIsActive()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"For");
- return (SHELL_UNSUPPORTED);
- }
-
- if (gEfiShellParametersProtocol->Argc < 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle);
- return (SHELL_INVALID_PARAMETER);
- }
-
- CurrentScriptFile = ShellCommandGetCurrentScriptFile();
- ASSERT(CurrentScriptFile != NULL);
-
- if (CurrentScriptFile->CurrentCommand->Data == NULL) {
- FirstPass = TRUE;
-
- //
- // Make sure that an End exists.
- //
- if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, TRUE, FALSE)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"EndFor",
- L"For",
- CurrentScriptFile->CurrentCommand!=NULL
- ?CurrentScriptFile->CurrentCommand->Line:0);
- return (SHELL_DEVICE_ERROR);
- }
-
- //
- // Process the line.
- //
- if (gEfiShellParametersProtocol->Argv[1][0] != L'%' || gEfiShellParametersProtocol->Argv[1][2] != CHAR_NULL
- ||!((gEfiShellParametersProtocol->Argv[1][1] >= L'a' && gEfiShellParametersProtocol->Argv[1][1] <= L'z')
- ||(gEfiShellParametersProtocol->Argv[1][1] >= L'A' && gEfiShellParametersProtocol->Argv[1][1] <= L'Z'))
- ) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_VAR), gShellLevel1HiiHandle, gEfiShellParametersProtocol->Argv[1]);
- return (SHELL_INVALID_PARAMETER);
- }
-
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- L"in",
- gEfiShellParametersProtocol->Argv[2]) == 0) {
- for (LoopVar = 0x3 ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {
- ASSERT((ArgSet == NULL && ArgSize == 0) || (ArgSet != NULL));
- if (ArgSet == NULL) {
- // ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
- } else {
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" \"", 0);
- }
- if (StrStr(gEfiShellParametersProtocol->Argv[LoopVar], L"*") != NULL
- ||StrStr(gEfiShellParametersProtocol->Argv[LoopVar], L"?") != NULL
- ||StrStr(gEfiShellParametersProtocol->Argv[LoopVar], L"[") != NULL
- ||StrStr(gEfiShellParametersProtocol->Argv[LoopVar], L"]") != NULL) {
- FileList = NULL;
- Status = ShellOpenFileMetaArg ((CHAR16*)gEfiShellParametersProtocol->Argv[LoopVar], EFI_FILE_MODE_READ, &FileList);
- if (EFI_ERROR(Status) || FileList == NULL || IsListEmpty(&FileList->Link)) {
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, gEfiShellParametersProtocol->Argv[LoopVar], 0);
- } else {
- for (Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link)
- ; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&FileList->Link, &Node->Link)
- ){
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" \"", 0);
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, Node->FullName, 0);
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
- }
- ShellCloseFileMetaArg(&FileList);
- }
- } else {
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, gEfiShellParametersProtocol->Argv[LoopVar], 0);
- }
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
- }
- if (ArgSet == NULL) {
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- } else {
- //
- // set up for an 'in' for loop
- //
- NewSize = StrSize(ArgSet);
- NewSize += sizeof(SHELL_FOR_INFO)+StrSize(gEfiShellParametersProtocol->Argv[1]);
- Info = AllocateZeroPool(NewSize);
- ASSERT(Info != NULL);
- Info->Signature = SHELL_FOR_INFO_SIGNATURE;
- CopyMem(Info->Set, ArgSet, StrSize(ArgSet));
- NewSize = StrSize(gEfiShellParametersProtocol->Argv[1]);
- CopyMem(Info->Set+(StrSize(ArgSet)/sizeof(Info->Set[0])), gEfiShellParametersProtocol->Argv[1], NewSize);
- Info->ReplacementName = Info->Set+StrSize(ArgSet)/sizeof(Info->Set[0]);
- Info->CurrentValue = (CHAR16*)Info->Set;
- Info->Step = 0;
- Info->Current = 0;
- Info->End = 0;
-
- if (InternalIsAliasOnList(Info->ReplacementName, &CurrentScriptFile->SubstList)) {
- Info->RemoveSubstAlias = FALSE;
- } else {
- Info->RemoveSubstAlias = TRUE;
- }
- CurrentScriptFile->CurrentCommand->Data = Info;
- }
- } else if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- L"run",
- gEfiShellParametersProtocol->Argv[2]) == 0) {
- for (LoopVar = 0x3 ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {
- ASSERT((ArgSet == NULL && ArgSize == 0) || (ArgSet != NULL));
- if (ArgSet == NULL) {
-// ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
- } else {
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" ", 0);
- }
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, gEfiShellParametersProtocol->Argv[LoopVar], 0);
-// ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" ", 0);
- }
- if (ArgSet == NULL) {
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- } else {
- //
- // set up for a 'run' for loop
- //
- Info = AllocateZeroPool(sizeof(SHELL_FOR_INFO)+StrSize(gEfiShellParametersProtocol->Argv[1]));
- ASSERT(Info != NULL);
- Info->Signature = SHELL_FOR_INFO_SIGNATURE;
- CopyMem(Info->Set, gEfiShellParametersProtocol->Argv[1], StrSize(gEfiShellParametersProtocol->Argv[1]));
- Info->ReplacementName = Info->Set;
- Info->CurrentValue = NULL;
- ArgSetWalker = ArgSet;
- if (ArgSetWalker[0] != L'(') {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
- gShellLevel1HiiHandle,
- ArgSet,
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- TempSpot = StrStr(ArgSetWalker, L")");
- if (TempSpot != NULL) {
- TempString = TempSpot+1;
- if (*(TempString) != CHAR_NULL) {
- while(TempString != NULL && *TempString == L' ') {
- TempString++;
- }
- if (StrLen(TempString) > 0) {
- TempSpot = NULL;
- }
- }
- }
- if (TempSpot == NULL) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
- gShellLevel1HiiHandle,
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- *TempSpot = CHAR_NULL;
- ArgSetWalker++;
- while (ArgSetWalker != NULL && ArgSetWalker[0] == L' ') {
- ArgSetWalker++;
- }
- if (!ShellIsValidForNumber(ArgSetWalker)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
- gShellLevel1HiiHandle,
- ArgSet,
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (ArgSetWalker[0] == L'-') {
- Info->Current = 0 - (INTN)ShellStrToUintn(ArgSetWalker+1);
- } else {
- Info->Current = (INTN)ShellStrToUintn(ArgSetWalker);
- }
- ArgSetWalker = StrStr(ArgSetWalker, L" ");
- while (ArgSetWalker != NULL && ArgSetWalker[0] == L' ') {
- ArgSetWalker++;
- }
- if (ArgSetWalker == NULL || *ArgSetWalker == CHAR_NULL || !ShellIsValidForNumber(ArgSetWalker)){
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
- gShellLevel1HiiHandle,
- ArgSet,
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (ArgSetWalker[0] == L'-') {
- Info->End = 0 - (INTN)ShellStrToUintn(ArgSetWalker+1);
- } else {
- Info->End = (INTN)ShellStrToUintn(ArgSetWalker);
- }
- if (Info->Current < Info->End) {
- Info->Step = 1;
- } else {
- Info->Step = -1;
- }
-
- ArgSetWalker = StrStr(ArgSetWalker, L" ");
- while (ArgSetWalker != NULL && ArgSetWalker[0] == L' ') {
- ArgSetWalker++;
- }
- if (ArgSetWalker != NULL && *ArgSetWalker != CHAR_NULL) {
- if (ArgSetWalker == NULL || *ArgSetWalker == CHAR_NULL || !ShellIsValidForNumber(ArgSetWalker)){
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
- gShellLevel1HiiHandle,
- ArgSet,
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (*ArgSetWalker == L')') {
- ASSERT(Info->Step == 1 || Info->Step == -1);
- } else {
- if (ArgSetWalker[0] == L'-') {
- Info->Step = 0 - (INTN)ShellStrToUintn(ArgSetWalker+1);
- } else {
- Info->Step = (INTN)ShellStrToUintn(ArgSetWalker);
- }
-
- if (StrStr(ArgSetWalker, L" ") != NULL) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
- gShellLevel1HiiHandle,
- ArgSet,
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- }
-
- }
- }
- }
- }
- }
- if (ShellStatus == SHELL_SUCCESS) {
- if (InternalIsAliasOnList(Info->ReplacementName, &CurrentScriptFile->SubstList)) {
- Info->RemoveSubstAlias = FALSE;
- } else {
- Info->RemoveSubstAlias = TRUE;
- }
- }
- if (CurrentScriptFile->CurrentCommand != NULL) {
- CurrentScriptFile->CurrentCommand->Data = Info;
- }
- }
- } else {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
- gShellLevel1HiiHandle,
- ArgSet,
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- } else {
- //
- // These need to be NULL since they are used to determine if this is the first pass later on...
- //
- ASSERT(ArgSetWalker == NULL);
- ASSERT(ArgSet == NULL);
- }
-
- if (CurrentScriptFile != NULL && CurrentScriptFile->CurrentCommand != NULL) {
- Info = (SHELL_FOR_INFO*)CurrentScriptFile->CurrentCommand->Data;
- if (CurrentScriptFile->CurrentCommand->Reset) {
- Info->CurrentValue = (CHAR16*)Info->Set;
- FirstPass = TRUE;
- CurrentScriptFile->CurrentCommand->Reset = FALSE;
- }
- } else {
- ShellStatus = SHELL_UNSUPPORTED;
- Info = NULL;
- }
- if (ShellStatus == SHELL_SUCCESS) {
- ASSERT(Info != NULL);
- if (Info->Step != 0) {
- //
- // only advance if not the first pass
- //
- if (!FirstPass) {
- //
- // sequence version of for loop...
- //
- Info->Current += Info->Step;
- }
-
- TempString = AllocateZeroPool(50*sizeof(CHAR16));
- UnicodeSPrint(TempString, 50*sizeof(CHAR16), L"%d", Info->Current);
- InternalUpdateAliasOnList(Info->ReplacementName, TempString, &CurrentScriptFile->SubstList);
- FreePool(TempString);
-
- if ((Info->Step > 0 && Info->Current > Info->End) || (Info->Step < 0 && Info->Current < Info->End)) {
- CurrentScriptFile->CurrentCommand->Data = NULL;
- //
- // find the matching endfor (we're done with the loop)
- //
- if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, FALSE, FALSE)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"EndFor",
- L"For",
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- if (Info->RemoveSubstAlias) {
- //
- // remove item from list
- //
- InternalRemoveAliasFromList(Info->ReplacementName, &CurrentScriptFile->SubstList);
- }
- FreePool(Info);
- }
- } else {
- //
- // Must be in 'in' version of for loop...
- //
- ASSERT(Info->Set != NULL);
- if (Info->CurrentValue != NULL && *Info->CurrentValue != CHAR_NULL) {
- if (Info->CurrentValue[0] == L' ') {
- Info->CurrentValue++;
- }
- if (Info->CurrentValue[0] == L'\"') {
- Info->CurrentValue++;
- }
- //
- // do the next one of the set
- //
- ASSERT(TempString == NULL);
- TempString = StrnCatGrow(&TempString, NULL, Info->CurrentValue, 0);
- if (TempString == NULL) {
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- } else {
- TempSpot = StrStr(TempString, L"\" \"");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- while (TempString[StrLen(TempString)-1] == L'\"') {
- TempString[StrLen(TempString)-1] = CHAR_NULL;
- }
- InternalUpdateAliasOnList(Info->ReplacementName, TempString, &CurrentScriptFile->SubstList);
- Info->CurrentValue += StrLen(TempString);
-
- if (Info->CurrentValue[0] == L'\"') {
- Info->CurrentValue++;
- }
- while (Info->CurrentValue[0] == L' ') {
- Info->CurrentValue++;
- }
- if (Info->CurrentValue[0] == L'\"') {
- Info->CurrentValue++;
- }
- FreePool(TempString);
- }
- } else {
- CurrentScriptFile->CurrentCommand->Data = NULL;
- //
- // find the matching endfor (we're done with the loop)
- //
- if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, FALSE, FALSE)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"EndFor",
- L"For",
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- if (Info->RemoveSubstAlias) {
- //
- // remove item from list
- //
- InternalRemoveAliasFromList(Info->ReplacementName, &CurrentScriptFile->SubstList);
- }
- FreePool(Info);
- }
- }
- }
- if (ArgSet != NULL) {
- FreePool(ArgSet);
- }
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c
deleted file mode 100644
index 4d48c7f1e9..0000000000
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/** @file
- Main file for goto shell level 1 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel1CommandsLib.h"
-
-/**
- Function for 'goto' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunGoto (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CHAR16 *CompareString;
- UINTN Size;
- SCRIPT_FILE *CurrentScriptFile;
-
- ShellStatus = SHELL_SUCCESS;
- CompareString = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- if (!gEfiShellProtocol->BatchIsActive()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"Goto");
- return (SHELL_UNSUPPORTED);
- }
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Size = 0;
- ASSERT((CompareString == NULL && Size == 0) || (CompareString != NULL));
- CompareString = StrnCatGrow(&CompareString, &Size, L":", 0);
- CompareString = StrnCatGrow(&CompareString, &Size, ShellCommandLineGetRawValue(Package, 1), 0);
- //
- // Check forwards and then backwards for a label...
- //
- if (!MoveToTag(GetNextNode, L"endfor", L"for", CompareString, ShellCommandGetCurrentScriptFile(), FALSE, FALSE, TRUE)) {
- CurrentScriptFile = ShellCommandGetCurrentScriptFile();
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- CompareString,
- L"Goto",
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_NOT_FOUND;
- }
- FreePool(CompareString);
- }
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
deleted file mode 100644
index 08927319d3..0000000000
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
+++ /dev/null
@@ -1,1104 +0,0 @@
-/** @file
- Main file for If and else shell level 1 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel1CommandsLib.h"
-#include <Library/PrintLib.h>
-#include <Library/PathLib.h>
-
-typedef enum {
- EndTagOr,
- EndTagAnd,
- EndTagThen,
- EndTagMax
-} END_TAG_TYPE;
-
-typedef enum {
- OperatorGreaterThan,
- OperatorLessThan,
- OperatorEqual,
- OperatorNotEqual,
- OperatorGreatorOrEqual,
- OperatorLessOrEqual,
- OperatorUnisgnedGreaterThan,
- OperatorUnsignedLessThan,
- OperatorUnsignedGreaterOrEqual,
- OperatorUnsignedLessOrEqual,
- OperatorMax
-} BIN_OPERATOR_TYPE;
-
-/**
- Extract the next fragment, if there is one.
-
- @param[in, out] Statement The current remaining statement.
- @param[in] Fragment The current fragment.
-
- @retval FALSE There is not another fragment.
- @retval TRUE There is another fragment.
-**/
-BOOLEAN
-EFIAPI
-IsNextFragment (
- IN OUT CONST CHAR16 **Statement,
- IN CONST CHAR16 *Fragment
- )
-{
- CHAR16 *Tester;
-
- Tester = NULL;
-
- Tester = StrnCatGrow(&Tester, NULL, *Statement, StrLen(Fragment));
- ASSERT(Tester != NULL);
- Tester[StrLen(Fragment)] = CHAR_NULL;
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)Fragment,
- Tester) == 0) {
- //
- // increment the string pointer to the end of what we found and then chop off spaces...
- //
- *Statement+=StrLen(Fragment);
- while (*Statement[0] == L' ') {
- (*Statement)++;
- }
- FreePool(Tester);
- return (TRUE);
- }
- FreePool(Tester);
- return (FALSE);
-}
-
-/**
- Determine if String represents a valid profile.
-
- @param[in] String The pointer to the string to test.
-
- @retval TRUE String is a valid profile.
- @retval FALSE String is not a valid profile.
-**/
-BOOLEAN
-EFIAPI
-IsValidProfile (
- IN CONST CHAR16 *String
- )
-{
- CONST CHAR16 *ProfilesString;
- CONST CHAR16 *TempLocation;
-
- ProfilesString = ShellGetEnvironmentVariable(L"profiles");
- ASSERT(ProfilesString != NULL);
- TempLocation = StrStr(ProfilesString, String);
- if ((TempLocation != NULL) && (*(TempLocation-1) == L';') && (*(TempLocation+StrLen(String)) == L';')) {
- return (TRUE);
- }
- return (FALSE);
-}
-
-/**
- Do a comparison between 2 things.
-
- @param[in] Compare1 The first item to compare.
- @param[in] Compare2 The second item to compare.
- @param[in] BinOp The type of comparison to perform.
- @param[in] CaseInsensitive TRUE to do non-case comparison, FALSE otherwise.
- @param[in] ForceStringCompare TRUE to force string comparison, FALSE otherwise.
-
- @return The result of the comparison.
-**/
-BOOLEAN
-EFIAPI
-TestOperation (
- IN CONST CHAR16 *Compare1,
- IN CONST CHAR16 *Compare2,
- IN CONST BIN_OPERATOR_TYPE BinOp,
- IN CONST BOOLEAN CaseInsensitive,
- IN CONST BOOLEAN ForceStringCompare
- )
-{
- INTN Cmp1;
- INTN Cmp2;
-
- //
- // "Compare1 BinOp Compare2"
- //
- switch (BinOp) {
- case OperatorUnisgnedGreaterThan:
- case OperatorGreaterThan:
- if (ForceStringCompare || !ShellIsHexOrDecimalNumber(Compare1, FALSE, FALSE) || !ShellIsHexOrDecimalNumber(Compare2, FALSE, FALSE)) {
- //
- // string compare
- //
- if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) > 0) || (StringCompare(&Compare1, &Compare2) > 0)) {
- return (TRUE);
- }
- } else {
- //
- // numeric compare
- //
- if (Compare1[0] == L'-') {
- Cmp1 = 0 - (INTN)ShellStrToUintn(Compare1+1);
- } else {
- Cmp1 = (INTN)ShellStrToUintn(Compare1);
- }
- if (Compare2[0] == L'-') {
- Cmp2 = 0 - (INTN)ShellStrToUintn(Compare2+1);
- } else {
- Cmp2 = (INTN)ShellStrToUintn(Compare2);
- }
- if (BinOp == OperatorGreaterThan) {
- if (Cmp1 > Cmp2) {
- return (TRUE);
- }
- } else {
- if ((UINTN)Cmp1 > (UINTN)Cmp2) {
- return (TRUE);
- }
- }
- }
- return (FALSE);
- break;
- case OperatorUnsignedLessThan:
- case OperatorLessThan:
- if (ForceStringCompare || !ShellIsHexOrDecimalNumber(Compare1, FALSE, FALSE) || !ShellIsHexOrDecimalNumber(Compare2, FALSE, FALSE)) {
- //
- // string compare
- //
- if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) < 0) || (StringCompare(&Compare1, &Compare2) < 0)) {
- return (TRUE);
- }
- } else {
- //
- // numeric compare
- //
- if (Compare1[0] == L'-') {
- Cmp1 = 0 - (INTN)ShellStrToUintn(Compare1+1);
- } else {
- Cmp1 = (INTN)ShellStrToUintn(Compare1);
- }
- if (Compare2[0] == L'-') {
- Cmp2 = 0 - (INTN)ShellStrToUintn(Compare2+1);
- } else {
- Cmp2 = (INTN)ShellStrToUintn(Compare2);
- }
- if (BinOp == OperatorLessThan) {
- if (Cmp1 < Cmp2) {
- return (TRUE);
- }
- } else {
- if ((UINTN)Cmp1 < (UINTN)Cmp2) {
- return (TRUE);
- }
- }
-
- }
- return (FALSE);
- break;
- case OperatorEqual:
- if (ForceStringCompare || !ShellIsHexOrDecimalNumber(Compare1, FALSE, FALSE) || !ShellIsHexOrDecimalNumber(Compare2, FALSE, FALSE)) {
- //
- // string compare
- //
- if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) == 0) || (StringCompare(&Compare1, &Compare2) == 0)) {
- return (TRUE);
- }
- } else {
- //
- // numeric compare
- //
- if (Compare1[0] == L'-') {
- Cmp1 = 0 - (INTN)ShellStrToUintn(Compare1+1);
- } else {
- Cmp1 = (INTN)ShellStrToUintn(Compare1);
- }
- if (Compare2[0] == L'-') {
- Cmp2 = 0 - (INTN)ShellStrToUintn(Compare2+1);
- } else {
- Cmp2 = (INTN)ShellStrToUintn(Compare2);
- }
- if (Cmp1 == Cmp2) {
- return (TRUE);
- }
- }
- return (FALSE);
- break;
- case OperatorNotEqual:
- if (ForceStringCompare || !ShellIsHexOrDecimalNumber(Compare1, FALSE, FALSE) || !ShellIsHexOrDecimalNumber(Compare2, FALSE, FALSE)) {
- //
- // string compare
- //
- if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) != 0) || (StringCompare(&Compare1, &Compare2) != 0)) {
- return (TRUE);
- }
- } else {
- //
- // numeric compare
- //
- if (Compare1[0] == L'-') {
- Cmp1 = 0 - (INTN)ShellStrToUintn(Compare1+1);
- } else {
- Cmp1 = (INTN)ShellStrToUintn(Compare1);
- }
- if (Compare2[0] == L'-') {
- Cmp2 = 0 - (INTN)ShellStrToUintn(Compare2+1);
- } else {
- Cmp2 = (INTN)ShellStrToUintn(Compare2);
- }
- if (Cmp1 != Cmp2) {
- return (TRUE);
- }
- }
- return (FALSE);
- break;
- case OperatorUnsignedGreaterOrEqual:
- case OperatorGreatorOrEqual:
- if (ForceStringCompare || !ShellIsHexOrDecimalNumber(Compare1, FALSE, FALSE) || !ShellIsHexOrDecimalNumber(Compare2, FALSE, FALSE)) {
- //
- // string compare
- //
- if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) >= 0) || (StringCompare(&Compare1, &Compare2) >= 0)) {
- return (TRUE);
- }
- } else {
- //
- // numeric compare
- //
- if (Compare1[0] == L'-') {
- Cmp1 = 0 - (INTN)ShellStrToUintn(Compare1+1);
- } else {
- Cmp1 = (INTN)ShellStrToUintn(Compare1);
- }
- if (Compare2[0] == L'-') {
- Cmp2 = 0 - (INTN)ShellStrToUintn(Compare2+1);
- } else {
- Cmp2 = (INTN)ShellStrToUintn(Compare2);
- }
- if (BinOp == OperatorGreatorOrEqual) {
- if (Cmp1 >= Cmp2) {
- return (TRUE);
- }
- } else {
- if ((UINTN)Cmp1 >= (UINTN)Cmp2) {
- return (TRUE);
- }
- }
- }
- return (FALSE);
- break;
- case OperatorLessOrEqual:
- case OperatorUnsignedLessOrEqual:
- if (ForceStringCompare || !ShellIsHexOrDecimalNumber(Compare1, FALSE, FALSE) || !ShellIsHexOrDecimalNumber(Compare2, FALSE, FALSE)) {
- //
- // string compare
- //
- if ((CaseInsensitive && StringNoCaseCompare(&Compare1, &Compare2) <= 0) || (StringCompare(&Compare1, &Compare2) <= 0)) {
- return (TRUE);
- }
- } else {
- //
- // numeric compare
- //
- if (Compare1[0] == L'-') {
- Cmp1 = 0 - (INTN)ShellStrToUintn(Compare1+1);
- } else {
- Cmp1 = (INTN)ShellStrToUintn(Compare1);
- }
- if (Compare2[0] == L'-') {
- Cmp2 = 0 - (INTN)ShellStrToUintn(Compare2+1);
- } else {
- Cmp2 = (INTN)ShellStrToUintn(Compare2);
- }
- if (BinOp == OperatorLessOrEqual) {
- if (Cmp1 <= Cmp2) {
- return (TRUE);
- }
- } else {
- if ((UINTN)Cmp1 <= (UINTN)Cmp2) {
- return (TRUE);
- }
- }
- }
- return (FALSE);
- break;
- default:
- ASSERT(FALSE);
- return (FALSE);
- }
-}
-
-/**
- Process an if statement and determine if its is valid or not.
-
- @param[in, out] PassingState Opon entry, the current state. Upon exit,
- the new state.
- @param[in] StartParameterNumber The number of the first parameter of
- this statement.
- @param[in] EndParameterNumber The number of the final parameter of
- this statement.
- @param[in] OperatorToUse The type of termination operator.
- @param[in] CaseInsensitive TRUE for case insensitive, FALSE otherwise.
- @param[in] ForceStringCompare TRUE for all string based, FALSE otherwise.
-
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-ProcessStatement (
- IN OUT BOOLEAN *PassingState,
- IN UINTN StartParameterNumber,
- IN UINTN EndParameterNumber,
- IN CONST END_TAG_TYPE OperatorToUse,
- IN CONST BOOLEAN CaseInsensitive,
- IN CONST BOOLEAN ForceStringCompare
- )
-{
- EFI_STATUS Status;
- BOOLEAN OperationResult;
- BOOLEAN NotPresent;
- CHAR16 *StatementWalker;
- BIN_OPERATOR_TYPE BinOp;
- CHAR16 *Compare1;
- CHAR16 *Compare2;
- CHAR16 HexString[20];
- CHAR16 *TempSpot;
-
- ASSERT((END_TAG_TYPE)OperatorToUse != EndTagThen);
-
- Status = EFI_SUCCESS;
- BinOp = OperatorMax;
- OperationResult = FALSE;
- StatementWalker = gEfiShellParametersProtocol->Argv[StartParameterNumber];
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"not")) {
- NotPresent = TRUE;
- StatementWalker = gEfiShellParametersProtocol->Argv[++StartParameterNumber];
- } else {
- NotPresent = FALSE;
- }
-
- //
- // now check for 'boolfunc' operators
- //
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"isint")) {
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"(") && StatementWalker[StrLen(StatementWalker)-1] == L')') {
- StatementWalker[StrLen(StatementWalker)-1] = CHAR_NULL;
- OperationResult = ShellIsHexOrDecimalNumber(StatementWalker, FALSE, FALSE);
- } else {
- Status = EFI_INVALID_PARAMETER;
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"isint");
- }
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"exists") || IsNextFragment((CONST CHAR16**)(&StatementWalker), L"exist")) {
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"(") && StatementWalker[StrLen(StatementWalker)-1] == L')') {
- StatementWalker[StrLen(StatementWalker)-1] = CHAR_NULL;
- //
- // is what remains a file in CWD???
- //
- OperationResult = (BOOLEAN)(ShellFileExists(StatementWalker)==EFI_SUCCESS);
- } else if (StatementWalker[0] == CHAR_NULL && StartParameterNumber+1 == EndParameterNumber) {
- OperationResult = (BOOLEAN)(ShellFileExists(gEfiShellParametersProtocol->Argv[++StartParameterNumber])==EFI_SUCCESS);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"exist(s)");
- Status = EFI_INVALID_PARAMETER;
- }
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"available")) {
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"(") && StatementWalker[StrLen(StatementWalker)-1] == L')') {
- StatementWalker[StrLen(StatementWalker)-1] = CHAR_NULL;
- //
- // is what remains a file in the CWD or path???
- //
- OperationResult = (BOOLEAN)(ShellIsFileInPath(StatementWalker)==EFI_SUCCESS);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"available");
- Status = EFI_INVALID_PARAMETER;
- }
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"profile")) {
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"(") && StatementWalker[StrLen(StatementWalker)-1] == L')') {
- //
- // Chop off that ')'
- //
- StatementWalker[StrLen(StatementWalker)-1] = CHAR_NULL;
- OperationResult = IsValidProfile(StatementWalker);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"profile");
- Status = EFI_INVALID_PARAMETER;
- }
- } else if (StartParameterNumber+1 >= EndParameterNumber) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, gEfiShellParametersProtocol->Argv[StartParameterNumber]);
- Status = EFI_INVALID_PARAMETER;
- } else {
- //
- // must be 'item binop item' style
- //
- Compare1 = NULL;
- Compare2 = NULL;
- BinOp = OperatorMax;
-
- //
- // get the first item
- //
- StatementWalker = gEfiShellParametersProtocol->Argv[StartParameterNumber];
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"efierror")) {
- TempSpot = StrStr(StatementWalker, L")");
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"(") && TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- if (ShellIsHexOrDecimalNumber(StatementWalker, FALSE, FALSE)) {
- UnicodeSPrint(HexString, sizeof(HexString), L"0x%x", ShellStrToUintn(StatementWalker)|MAX_BIT);
- ASSERT(Compare1 == NULL);
- Compare1 = StrnCatGrow(&Compare1, NULL, HexString, 0);
- StatementWalker += StrLen(StatementWalker) + 1;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"efierror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"efierror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"pierror")) {
- TempSpot = StrStr(StatementWalker, L")");
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"(") && TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- if (ShellIsHexOrDecimalNumber(StatementWalker, FALSE, FALSE)) {
- UnicodeSPrint(HexString, sizeof(HexString), L"0x%x", ShellStrToUintn(StatementWalker)|MAX_BIT|(MAX_BIT>>2));
- ASSERT(Compare1 == NULL);
- Compare1 = StrnCatGrow(&Compare1, NULL, HexString, 0);
- StatementWalker += StrLen(StatementWalker) + 1;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"pierror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"pierror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"oemerror")) {
- TempSpot = StrStr(StatementWalker, L")");
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"(") && TempSpot != NULL) {
- TempSpot = CHAR_NULL;
- if (ShellIsHexOrDecimalNumber(StatementWalker, FALSE, FALSE)) {
- UnicodeSPrint(HexString, sizeof(HexString), L"0x%x", ShellStrToUintn(StatementWalker)|MAX_BIT|(MAX_BIT>>1));
- ASSERT(Compare1 == NULL);
- Compare1 = StrnCatGrow(&Compare1, NULL, HexString, 0);
- StatementWalker += StrLen(StatementWalker) + 1;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"oemerror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"oemerror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else {
- ASSERT(Compare1 == NULL);
- if (EndParameterNumber - StartParameterNumber > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_STARTING), gShellLevel1HiiHandle, gEfiShellParametersProtocol->Argv[StartParameterNumber+2]);
- Status = EFI_INVALID_PARAMETER;
- } else {
- //
- // must be a raw string
- //
- Compare1 = StrnCatGrow(&Compare1, NULL, StatementWalker, 0);
- }
- }
-
- //
- // get the operator
- //
- ASSERT(StartParameterNumber+1<EndParameterNumber);
- StatementWalker = gEfiShellParametersProtocol->Argv[StartParameterNumber+1];
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"gt")) {
- BinOp = OperatorGreaterThan;
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"lt")) {
- BinOp = OperatorLessThan;
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"eq")) {
- BinOp = OperatorEqual;
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"ne")) {
- BinOp = OperatorNotEqual;
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"ge")) {
- BinOp = OperatorGreatorOrEqual;
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"le")) {
- BinOp = OperatorLessOrEqual;
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"==")) {
- BinOp = OperatorEqual;
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"ugt")) {
- BinOp = OperatorUnisgnedGreaterThan;
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"ult")) {
- BinOp = OperatorUnsignedLessThan;
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"uge")) {
- BinOp = OperatorUnsignedGreaterOrEqual;
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"ule")) {
- BinOp = OperatorUnsignedLessOrEqual;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_INVALID_BINOP), gShellLevel1HiiHandle, StatementWalker);
- Status = EFI_INVALID_PARAMETER;
- }
-
- //
- // get the second item
- //
- ASSERT(StartParameterNumber+2<=EndParameterNumber);
- StatementWalker = gEfiShellParametersProtocol->Argv[StartParameterNumber+2];
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"efierror")) {
- TempSpot = StrStr(StatementWalker, L")");
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"(") && TempSpot != NULL) {
- TempSpot = CHAR_NULL;
- if (ShellIsHexOrDecimalNumber(StatementWalker, FALSE, FALSE)) {
- UnicodeSPrint(HexString, sizeof(HexString), L"0x%x", ShellStrToUintn(StatementWalker)|MAX_BIT);
- ASSERT(Compare2 == NULL);
- Compare2 = StrnCatGrow(&Compare2, NULL, HexString, 0);
- StatementWalker += StrLen(StatementWalker) + 1;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"efierror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"efierror");
- Status = EFI_INVALID_PARAMETER;
- }
- //
- // can this be collapsed into the above?
- //
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"pierror")) {
- TempSpot = StrStr(StatementWalker, L")");
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"(") && TempSpot != NULL) {
- TempSpot = CHAR_NULL;
- if (ShellIsHexOrDecimalNumber(StatementWalker, FALSE, FALSE)) {
- UnicodeSPrint(HexString, sizeof(HexString), L"0x%x", ShellStrToUintn(StatementWalker)|MAX_BIT|(MAX_BIT>>2));
- ASSERT(Compare2 == NULL);
- Compare2 = StrnCatGrow(&Compare2, NULL, HexString, 0);
- StatementWalker += StrLen(StatementWalker) + 1;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"pierror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"pierror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"oemerror")) {
- TempSpot = StrStr(StatementWalker, L")");
- if (IsNextFragment((CONST CHAR16**)(&StatementWalker), L"(") && TempSpot != NULL) {
- TempSpot = CHAR_NULL;
- if (ShellIsHexOrDecimalNumber(StatementWalker, FALSE, FALSE)) {
- UnicodeSPrint(HexString, sizeof(HexString), L"0x%x", ShellStrToUintn(StatementWalker)|MAX_BIT|(MAX_BIT>>1));
- ASSERT(Compare2 == NULL);
- Compare2 = StrnCatGrow(&Compare2, NULL, HexString, 0);
- StatementWalker += StrLen(StatementWalker) + 1;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"oemerror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_IN), gShellLevel1HiiHandle, L"oemerror");
- Status = EFI_INVALID_PARAMETER;
- }
- } else {
- //
- // must be a raw string
- //
- ASSERT(Compare2 == NULL);
- Compare2 = StrnCatGrow(&Compare2, NULL, StatementWalker, 0);
- }
-
- if (Compare1 != NULL && Compare2 != NULL && BinOp != OperatorMax) {
- OperationResult = TestOperation(Compare1, Compare2, BinOp, CaseInsensitive, ForceStringCompare);
- }
-
- SHELL_FREE_NON_NULL(Compare1);
- SHELL_FREE_NON_NULL(Compare2);
- }
-
- //
- // done processing do result...
- //
-
- if (!EFI_ERROR(Status)) {
- if (NotPresent) {
- OperationResult = (BOOLEAN)(!OperationResult);
- }
- switch(OperatorToUse) {
- case EndTagOr:
- *PassingState = (BOOLEAN)(*PassingState || OperationResult);
- break;
- case EndTagAnd:
- *PassingState = (BOOLEAN)(*PassingState && OperationResult);
- break;
- case EndTagMax:
- *PassingState = (BOOLEAN)(OperationResult);
- break;
- default:
- ASSERT(FALSE);
- }
- }
- return (Status);
-}
-
-/**
- Break up the next part of the if statement (until the next 'and', 'or', or 'then').
-
- @param[in] ParameterNumber The current parameter number.
- @param[out] EndParameter Upon successful return, will point to the
- parameter to start the next iteration with.
- @param[out] EndTag Upon successful return, will point to the
- type that was found at the end of this statement.
-
- @retval TRUE A valid statement was found.
- @retval FALSE A valid statement was not found.
-**/
-BOOLEAN
-EFIAPI
-BuildNextStatement (
- IN UINTN ParameterNumber,
- OUT UINTN *EndParameter,
- OUT END_TAG_TYPE *EndTag
- )
-{
- CHAR16 *Buffer;
- UINTN BufferSize;
-
- *EndTag = EndTagMax;
-
- for(Buffer = NULL, BufferSize = 0
- ; ParameterNumber < gEfiShellParametersProtocol->Argc
- ; ParameterNumber++
- ) {
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- gEfiShellParametersProtocol->Argv[ParameterNumber],
- L"or") == 0) {
- *EndParameter = ParameterNumber - 1;
- *EndTag = EndTagOr;
- break;
- } else if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- gEfiShellParametersProtocol->Argv[ParameterNumber],
- L"and") == 0) {
- *EndParameter = ParameterNumber - 1;
- *EndTag = EndTagAnd;
- break;
- } else if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- gEfiShellParametersProtocol->Argv[ParameterNumber],
- L"then") == 0) {
- *EndParameter = ParameterNumber - 1;
- *EndTag = EndTagThen;
- break;
- }
- }
- if (*EndTag == EndTagMax) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-/**
- Move the script file pointer to a different place in the script file.
- This one is special since it handles the if/else/endif syntax.
-
- @param[in] ScriptFile The script file from GetCurrnetScriptFile().
-
- @retval TRUE The move target was found and the move was successful.
- @retval FALSE Something went wrong.
-**/
-BOOLEAN
-EFIAPI
-MoveToTagSpecial (
- IN SCRIPT_FILE *ScriptFile
- )
-{
- SCRIPT_COMMAND_LIST *CommandNode;
- BOOLEAN Found;
- UINTN TargetCount;
- CHAR16 *CommandName;
- CHAR16 *CommandWalker;
- CHAR16 *TempLocation;
-
- TargetCount = 1;
- Found = FALSE;
-
- if (ScriptFile == NULL) {
- return FALSE;
- }
-
- for (CommandNode = (SCRIPT_COMMAND_LIST *)GetNextNode(&ScriptFile->CommandList, &ScriptFile->CurrentCommand->Link), Found = FALSE
- ; !IsNull(&ScriptFile->CommandList, &CommandNode->Link) && !Found
- ; CommandNode = (SCRIPT_COMMAND_LIST *)GetNextNode(&ScriptFile->CommandList, &CommandNode->Link)
- ){
-
- //
- // get just the first part of the command line...
- //
- CommandName = NULL;
- CommandName = StrnCatGrow(&CommandName, NULL, CommandNode->Cl, 0);
- if (CommandName == NULL) {
- continue;
- }
- CommandWalker = CommandName;
- while (CommandWalker[0] == L' ') {
- CommandWalker++;
- }
- TempLocation = StrStr(CommandWalker, L" ");
-
- if (TempLocation != NULL) {
- *TempLocation = CHAR_NULL;
- }
-
- //
- // did we find a nested item ?
- //
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)CommandWalker,
- L"If") == 0) {
- TargetCount++;
- } else if (TargetCount == 1 && gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)CommandWalker,
- (CHAR16*)L"else") == 0) {
- //
- // else can only decrement the last part... not an nested if
- // hence the TargetCount compare added
- //
- TargetCount--;
- } else if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)CommandWalker,
- (CHAR16*)L"endif") == 0) {
- TargetCount--;
- }
- if (TargetCount == 0) {
- ScriptFile->CurrentCommand = (SCRIPT_COMMAND_LIST *)GetNextNode(&ScriptFile->CommandList, &CommandNode->Link);
- Found = TRUE;
- }
-
- //
- // Free the memory for this loop...
- //
- SHELL_FREE_NON_NULL(CommandName);
- }
- return (Found);
-}
-
-/**
- Deal with the result of the if operation.
-
- @param[in] Result The result of the if.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_NOT_FOUND The ending tag could not be found.
-**/
-EFI_STATUS
-EFIAPI
-PerformResultOperation (
- IN CONST BOOLEAN Result
- )
-{
- if (Result || MoveToTagSpecial(ShellCommandGetCurrentScriptFile())) {
- return (EFI_SUCCESS);
- }
- return (EFI_NOT_FOUND);
-}
-
-/**
- Function for 'if' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunIf (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- SHELL_STATUS ShellStatus;
- BOOLEAN CaseInsensitive;
- BOOLEAN ForceString;
- UINTN CurrentParameter;
- UINTN EndParameter;
- BOOLEAN CurrentValue;
- END_TAG_TYPE Ending;
- END_TAG_TYPE PreviousEnding;
- SCRIPT_FILE *CurrentScriptFile;
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- if (!gEfiShellProtocol->BatchIsActive()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"If");
- return (SHELL_UNSUPPORTED);
- }
-
- if (gEfiShellParametersProtocol->Argc < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle);
- return (SHELL_INVALID_PARAMETER);
- }
-
- //
- // Make sure that an End exists.
- //
- CurrentScriptFile = ShellCommandGetCurrentScriptFile();
- if (!MoveToTag(GetNextNode, L"endif", L"if", NULL, CurrentScriptFile, TRUE, TRUE, FALSE)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"EnfIf",
- L"If",
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- return (SHELL_DEVICE_ERROR);
- }
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- CurrentParameter = 1;
- EndParameter = 0;
-
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- gEfiShellParametersProtocol->Argv[1],
- L"/i") == 0 ||
- gUnicodeCollation->StriColl(
- gUnicodeCollation,
- gEfiShellParametersProtocol->Argv[2],
- L"/i") == 0 ||
- (gEfiShellParametersProtocol->Argc > 3 && gUnicodeCollation->StriColl(
- gUnicodeCollation,
- gEfiShellParametersProtocol->Argv[3],
- L"/i") == 0)) {
- CaseInsensitive = TRUE;
- CurrentParameter++;
- } else {
- CaseInsensitive = FALSE;
- }
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- gEfiShellParametersProtocol->Argv[1],
- L"/s") == 0 ||
- gUnicodeCollation->StriColl(
- gUnicodeCollation,
- gEfiShellParametersProtocol->Argv[2],
- L"/s") == 0 ||
- (gEfiShellParametersProtocol->Argc > 3 && gUnicodeCollation->StriColl(
- gUnicodeCollation,
- gEfiShellParametersProtocol->Argv[3],
- L"/s") == 0)) {
- ForceString = TRUE;
- CurrentParameter++;
- } else {
- ForceString = FALSE;
- }
-
- for ( ShellStatus = SHELL_SUCCESS, CurrentValue = FALSE, Ending = EndTagMax
- ; CurrentParameter < gEfiShellParametersProtocol->Argc && ShellStatus == SHELL_SUCCESS
- ; CurrentParameter++) {
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- gEfiShellParametersProtocol->Argv[CurrentParameter],
- L"then") == 0) {
- //
- // we are at the then
- //
- if (CurrentParameter+1 != gEfiShellParametersProtocol->Argc) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TEXT_AFTER_THEN), gShellLevel1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = PerformResultOperation(CurrentValue);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, gEfiShellParametersProtocol->Argv[CurrentParameter]);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- } else {
- PreviousEnding = Ending;
- //
- // build up the next statement for analysis
- //
- if (!BuildNextStatement(CurrentParameter, &EndParameter, &Ending)) {
- CurrentScriptFile = ShellCommandGetCurrentScriptFile();
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"Then",
- L"If",
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Analyze the statement
- //
- Status = ProcessStatement(&CurrentValue, CurrentParameter, EndParameter, PreviousEnding, CaseInsensitive, ForceString);
- if (EFI_ERROR(Status)) {
-// ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_STARTING), gShellLevel1HiiHandle, gEfiShellParametersProtocol->Argv[CurrentParameter]);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Optomize to get out of the loop early...
- //
- if ((Ending == EndTagOr && CurrentValue) || (Ending == EndTagAnd && !CurrentValue)) {
- Status = PerformResultOperation(CurrentValue);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, gEfiShellParametersProtocol->Argv[CurrentParameter]);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- break;
- }
- }
- }
- if (ShellStatus == SHELL_SUCCESS){
- CurrentParameter = EndParameter;
- //
- // Skip over the or or and parameter.
- //
- if (Ending == EndTagOr || Ending == EndTagAnd) {
- CurrentParameter++;
- }
- }
- }
- }
- return (ShellStatus);
-}
-
-/**
- Function for 'else' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunElse (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- SCRIPT_FILE *CurrentScriptFile;
- ASSERT_EFI_ERROR(CommandInit());
-
- if (gEfiShellParametersProtocol->Argc > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle);
- return (SHELL_INVALID_PARAMETER);
- }
-
- if (!gEfiShellProtocol->BatchIsActive()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"Else");
- return (SHELL_UNSUPPORTED);
- }
-
- CurrentScriptFile = ShellCommandGetCurrentScriptFile();
-
- if (!MoveToTag(GetPreviousNode, L"if", L"endif", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"If",
- L"Else",
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- return (SHELL_DEVICE_ERROR);
- }
- if (!MoveToTag(GetPreviousNode, L"if", L"else", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"If",
- L"Else",
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- return (SHELL_DEVICE_ERROR);
- }
-
- if (!MoveToTag(GetNextNode, L"endif", L"if", NULL, CurrentScriptFile, FALSE, FALSE, FALSE)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"EndIf",
- "Else",
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- return (SHELL_DEVICE_ERROR);
- }
-
- return (SHELL_SUCCESS);
-}
-
-/**
- Function for 'endif' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEndIf (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- SCRIPT_FILE *CurrentScriptFile;
- ASSERT_EFI_ERROR(CommandInit());
-
- if (gEfiShellParametersProtocol->Argc > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle);
- return (SHELL_INVALID_PARAMETER);
- }
-
- if (!gEfiShellProtocol->BatchIsActive()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"Endif");
- return (SHELL_UNSUPPORTED);
- }
-
- CurrentScriptFile = ShellCommandGetCurrentScriptFile();
- if (!MoveToTag(GetPreviousNode, L"if", L"endif", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"If",
- L"EndIf",
- CurrentScriptFile!=NULL
- && CurrentScriptFile->CurrentCommand!=NULL
- ? CurrentScriptFile->CurrentCommand->Line:0);
- return (SHELL_DEVICE_ERROR);
- }
-
- return (SHELL_SUCCESS);
-}
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/Shift.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/Shift.c
deleted file mode 100644
index 9abb4c31b1..0000000000
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/Shift.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file
- Main file for Shift shell level 1 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel1CommandsLib.h"
-
-/**
- Function for 'shift' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunShift (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- SCRIPT_FILE *CurrentScriptFile;
- UINTN LoopVar;
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- if (!gEfiShellProtocol->BatchIsActive()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"Shift");
- return (SHELL_UNSUPPORTED);
- }
-
- CurrentScriptFile = ShellCommandGetCurrentScriptFile();
- ASSERT(CurrentScriptFile != NULL);
-
- if (CurrentScriptFile->Argc < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle);
- return (SHELL_UNSUPPORTED);
- }
-
- for (LoopVar = 0 ; LoopVar < CurrentScriptFile->Argc ; LoopVar++) {
- if (LoopVar == 0) {
- SHELL_FREE_NON_NULL(CurrentScriptFile->Argv[LoopVar]);
- }
- if (LoopVar < CurrentScriptFile->Argc -1) {
- CurrentScriptFile->Argv[LoopVar] = CurrentScriptFile->Argv[LoopVar+1];
- } else {
- CurrentScriptFile->Argv[LoopVar] = NULL;
- }
- }
- CurrentScriptFile->Argc--;
- return (SHELL_SUCCESS);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/Stall.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/Stall.c
deleted file mode 100644
index 2270323190..0000000000
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/Stall.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/** @file
- Main file for stall shell level 1 function.
-
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel1CommandsLib.h"
-
-/**
- Function for 'stall' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunStall (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINT64 Intermediate;
-
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellConvertStringToUint64(ShellCommandLineGetRawValue(Package, 1), &Intermediate, FALSE, FALSE);
- if (EFI_ERROR(Status) || ((UINT64)(UINTN)(Intermediate)) != Intermediate) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel1HiiHandle, ShellCommandLineGetRawValue(Package, 1));
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = gBS->Stall((UINTN)Intermediate);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_STALL_FAILED), gShellLevel1HiiHandle, Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- }
- }
- ShellCommandLineFreeVarList (Package);
- }
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
deleted file mode 100644
index 6f67f49aea..0000000000
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/** @file
- Main file for NULL named library for level 1 shell command functions.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel1CommandsLib.h"
-
-STATIC CONST CHAR16 mFileName[] = L"ShellCommands";
-EFI_HANDLE gShellLevel1HiiHandle = NULL;
-
-/**
- Return the help text filename. Only used if no HII information found.
-
- @retval the filename.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandGetManFileNameLevel1 (
- VOID
- )
-{
- return (mFileName);
-}
-
-/**
- Constructor for the Shell Level 1 Commands library.
-
- Install the handlers for level 1 UEFI Shell 2.0 commands.
-
- @param ImageHandle the image handle of the process
- @param SystemTable the EFI System Table pointer
-
- @retval EFI_SUCCESS the shell command handlers were installed sucessfully
- @retval EFI_UNSUPPORTED the shell level required was not found.
-**/
-EFI_STATUS
-EFIAPI
-ShellLevel1CommandsLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- //
- // if shell level is less than 2 do nothing
- //
- if (PcdGet8(PcdShellSupportLevel) < 1) {
- return (EFI_SUCCESS);
- }
-
- gShellLevel1HiiHandle = HiiAddPackages (&gShellLevel1HiiGuid, gImageHandle, UefiShellLevel1CommandsLibStrings, NULL);
- if (gShellLevel1HiiHandle == NULL) {
- return (EFI_DEVICE_ERROR);
- }
-
- //
- // install our shell command handlers that are always installed
- //
- ShellCommandRegisterCommandName(L"stall", ShellCommandRunStall , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_STALL) ));
- ShellCommandRegisterCommandName(L"for", ShellCommandRunFor , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_FOR) ));
- ShellCommandRegisterCommandName(L"goto", ShellCommandRunGoto , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_GOTO) ));
- ShellCommandRegisterCommandName(L"if", ShellCommandRunIf , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_IF) ));
- ShellCommandRegisterCommandName(L"shift", ShellCommandRunShift , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_SHIFT) ));
- ShellCommandRegisterCommandName(L"exit", ShellCommandRunExit , ShellCommandGetManFileNameLevel1, 1, L"", TRUE , gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_EXIT) ));
- ShellCommandRegisterCommandName(L"else", ShellCommandRunElse , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_ELSE) ));
- ShellCommandRegisterCommandName(L"endif", ShellCommandRunEndIf , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_ENDIF) ));
- ShellCommandRegisterCommandName(L"endfor", ShellCommandRunEndFor , ShellCommandGetManFileNameLevel1, 1, L"", FALSE, gShellLevel1HiiHandle, (EFI_STRING_ID)(PcdGet8(PcdShellSupportLevel) < 3 ? 0 : STRING_TOKEN(STR_GET_HELP_ENDFOR)));
-
- return (EFI_SUCCESS);
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param ImageHandle The image handle of the process.
- @param SystemTable The EFI System Table pointer.
-**/
-EFI_STATUS
-EFIAPI
-ShellLevel1CommandsLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (gShellLevel1HiiHandle != NULL) {
- HiiRemovePackages(gShellLevel1HiiHandle);
- }
- return (EFI_SUCCESS);
-}
-
-/**
- Test a node to see if meets the criterion.
-
- It functions so that count starts at 1 and it increases or decreases when it
- hits the specified tags. when it hits zero the location has been found.
-
- DecrementerTag and IncrementerTag are used to get around for/endfor and
- similar paired types where the entire middle should be ignored.
-
- If label is used it will be used instead of the count.
-
- @param[in] Function The function to use to enumerate through the
- list. Normally GetNextNode or GetPreviousNode.
- @param[in] DecrementerTag The tag to decrement the count at.
- @param[in] IncrementerTag The tag to increment the count at.
- @param[in] Label A label to look for.
- @param[in, out] ScriptFile The pointer to the current script file structure.
- @param[in] MovePast TRUE makes function return 1 past the found
- location.
- @param[in] FindOnly TRUE to not change the ScriptFile.
- @param[in] CommandNode The pointer to the Node to test.
- @param[in, out] TargetCount The pointer to the current count.
-**/
-BOOLEAN
-EFIAPI
-TestNodeForMove (
- IN CONST LIST_MANIP_FUNC Function,
- IN CONST CHAR16 *DecrementerTag,
- IN CONST CHAR16 *IncrementerTag,
- IN CONST CHAR16 *Label OPTIONAL,
- IN OUT SCRIPT_FILE *ScriptFile,
- IN CONST BOOLEAN MovePast,
- IN CONST BOOLEAN FindOnly,
- IN CONST SCRIPT_COMMAND_LIST *CommandNode,
- IN OUT UINTN *TargetCount
- )
-{
- BOOLEAN Found;
- CHAR16 *CommandName;
- CHAR16 *CommandNameWalker;
- CHAR16 *TempLocation;
-
- Found = FALSE;
-
- //
- // get just the first part of the command line...
- //
- CommandName = NULL;
- CommandName = StrnCatGrow(&CommandName, NULL, CommandNode->Cl, 0);
- if (CommandName == NULL) {
- return (FALSE);
- }
-
- CommandNameWalker = CommandName;
- while(CommandNameWalker[0] == L' ') {
- CommandNameWalker++;
- }
- TempLocation = StrStr(CommandNameWalker, L" ");
-
- if (TempLocation != NULL) {
- *TempLocation = CHAR_NULL;
- }
-
- //
- // did we find a nested item ?
- //
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)CommandNameWalker,
- (CHAR16*)IncrementerTag) == 0) {
- (*TargetCount)++;
- } else if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)CommandNameWalker,
- (CHAR16*)DecrementerTag) == 0) {
- if (*TargetCount > 0) {
- (*TargetCount)--;
- }
- }
-
- //
- // did we find the matching one...
- //
- if (Label == NULL) {
- if (*TargetCount == 0) {
- Found = TRUE;
- if (!FindOnly) {
- if (MovePast) {
- ScriptFile->CurrentCommand = (SCRIPT_COMMAND_LIST *)(*Function)(&ScriptFile->CommandList, &CommandNode->Link);
- } else {
- ScriptFile->CurrentCommand = (SCRIPT_COMMAND_LIST *)CommandNode;
- }
- }
- }
- } else {
- if (gUnicodeCollation->StriColl(
- gUnicodeCollation,
- (CHAR16*)CommandNameWalker,
- (CHAR16*)Label) == 0
- && (*TargetCount) == 0) {
- Found = TRUE;
- if (!FindOnly) {
- //
- // we found the target label without loops
- //
- if (MovePast) {
- ScriptFile->CurrentCommand = (SCRIPT_COMMAND_LIST *)(*Function)(&ScriptFile->CommandList, &CommandNode->Link);
- } else {
- ScriptFile->CurrentCommand = (SCRIPT_COMMAND_LIST *)CommandNode;
- }
- }
- }
- }
-
- //
- // Free the memory for this loop...
- //
- FreePool(CommandName);
- return (Found);
-}
-
-/**
- Move the script pointer from 1 tag (line) to another.
-
- It functions so that count starts at 1 and it increases or decreases when it
- hits the specified tags. when it hits zero the location has been found.
-
- DecrementerTag and IncrementerTag are used to get around for/endfor and
- similar paired types where the entire middle should be ignored.
-
- If label is used it will be used instead of the count.
-
- @param[in] Function The function to use to enumerate through the
- list. Normally GetNextNode or GetPreviousNode.
- @param[in] DecrementerTag The tag to decrement the count at.
- @param[in] IncrementerTag The tag to increment the count at.
- @param[in] Label A label to look for.
- @param[in, out] ScriptFile The pointer to the current script file structure.
- @param[in] MovePast TRUE makes function return 1 past the found
- location.
- @param[in] FindOnly TRUE to not change the ScriptFile.
- @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
- searching.
-**/
-BOOLEAN
-EFIAPI
-MoveToTag (
- IN CONST LIST_MANIP_FUNC Function,
- IN CONST CHAR16 *DecrementerTag,
- IN CONST CHAR16 *IncrementerTag,
- IN CONST CHAR16 *Label OPTIONAL,
- IN OUT SCRIPT_FILE *ScriptFile,
- IN CONST BOOLEAN MovePast,
- IN CONST BOOLEAN FindOnly,
- IN CONST BOOLEAN WrapAroundScript
- )
-{
- SCRIPT_COMMAND_LIST *CommandNode;
- BOOLEAN Found;
- UINTN TargetCount;
-
- if (Label == NULL) {
- TargetCount = 1;
- } else {
- TargetCount = 0;
- }
-
- if (ScriptFile == NULL) {
- return FALSE;
- }
-
- for (CommandNode = (SCRIPT_COMMAND_LIST *)(*Function)(&ScriptFile->CommandList, &ScriptFile->CurrentCommand->Link), Found = FALSE
- ; !IsNull(&ScriptFile->CommandList, &CommandNode->Link)&& !Found
- ; CommandNode = (SCRIPT_COMMAND_LIST *)(*Function)(&ScriptFile->CommandList, &CommandNode->Link)
- ){
- Found = TestNodeForMove(
- Function,
- DecrementerTag,
- IncrementerTag,
- Label,
- ScriptFile,
- MovePast,
- FindOnly,
- CommandNode,
- &TargetCount);
- }
-
- if (WrapAroundScript && !Found) {
- for (CommandNode = (SCRIPT_COMMAND_LIST *)GetFirstNode(&ScriptFile->CommandList), Found = FALSE
- ; CommandNode != ScriptFile->CurrentCommand && !Found
- ; CommandNode = (SCRIPT_COMMAND_LIST *)(*Function)(&ScriptFile->CommandList, &CommandNode->Link)
- ){
- Found = TestNodeForMove(
- Function,
- DecrementerTag,
- IncrementerTag,
- Label,
- ScriptFile,
- MovePast,
- FindOnly,
- CommandNode,
- &TargetCount);
- }
- }
- return (Found);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
deleted file mode 100644
index c4ef536202..0000000000
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/** @file
- Main file for NULL named library for level 1 shell command functions.
-
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
-#define _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/ShellLibHiiGuid.h>
-
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/DevicePath.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/UnicodeCollation.h>
-
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/ShellLib.h>
-#include <Library/SortLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HiiLib.h>
-#include <Library/FileHandleLib.h>
-
-extern EFI_HANDLE gShellLevel1HiiHandle;
-
-/**
- Function for 'stall' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunStall (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'exit' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunExit (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'endif' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEndIf (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'for' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunFor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'endfor' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEndFor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'if' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunIf (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'goto' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunGoto (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'shift' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunShift (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Function for 'else' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunElse (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-///
-/// Function prototype for BOTH GetNextNode and GetPreviousNode...
-/// This is used to control the MoveToTag function direction...
-///
-typedef
-LIST_ENTRY *
-(EFIAPI *LIST_MANIP_FUNC)(
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- );
-
-/**
- Move the script pointer from 1 tag (line) to another.
-
- It functions so that count starts at 1 and it increases or decreases when it
- hits the specified tags. when it hits zero the location has been found.
-
- DecrementerTag and IncrementerTag are used to get around for/endfor and
- similar paired types where the entire middle should be ignored.
-
- If label is used it will be used instead of the count.
-
- @param[in] Function The function to use to enumerate through the
- list. Normally GetNextNode or GetPreviousNode.
- @param[in] DecrementerTag The tag to decrement the count at.
- @param[in] IncrementerTag The tag to increment the count at.
- @param[in] Label A label to look for.
- @param[in, out] ScriptFile The pointer to the current script file structure.
- @param[in] MovePast TRUE makes function return 1 past the found
- location.
- @param[in] FindOnly TRUE to not change the ScriptFile.
- @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
- searching.
-**/
-BOOLEAN
-EFIAPI
-MoveToTag (
- IN CONST LIST_MANIP_FUNC Function,
- IN CONST CHAR16 *DecrementerTag,
- IN CONST CHAR16 *IncrementerTag,
- IN CONST CHAR16 *Label OPTIONAL,
- IN OUT SCRIPT_FILE *ScriptFile,
- IN CONST BOOLEAN MovePast,
- IN CONST BOOLEAN FindOnly,
- IN CONST BOOLEAN WrapAroundScript
- );
-
-#endif
-
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
deleted file mode 100644
index 02b1627b4f..0000000000
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
+++ /dev/null
@@ -1,59 +0,0 @@
-## @file
-# Provides shell level 1 functions
-#
-# Copyright (c) 2009-2011, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellLevel1CommandsLib
- FILE_GUID = 50cb6037-1102-47af-b2dd-9944b6eb1abe
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = ShellLevel1CommandsLibConstructor
- DESTRUCTOR = ShellLevel1CommandsLibDestructor
-
-[Sources.common]
- UefiShellLevel1CommandsLib.c
- UefiShellLevel1CommandsLib.h
- UefiShellLevel1CommandsLib.uni
- Exit.c
- Goto.c
- If.c
- For.c
- Shift.c
- Stall.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- ShellCommandLib
- ShellLib
- UefiLib
- UefiRuntimeServicesTableLib
- UefiBootServicesTableLib
- SortLib
- PrintLib
- PathLib
-
-[Pcd.common]
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel # ALWAYS_CONSUMED
-
-[Guids]
- gShellLevel1HiiGuid
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.uni b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.uni
deleted file mode 100644
index 56bfaea92d..0000000000
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c
deleted file mode 100644
index c891ca6afa..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/** @file
- Main file for attrib shell level 2 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-STATIC CONST CHAR16 AllFiles[] = L"*";
-
-STATIC CONST SHELL_PARAM_ITEM AttribParamList[] = {
- {L"-a", TypeFlag},
- {L"+a", TypeFlag},
- {L"-s", TypeFlag},
- {L"+s", TypeFlag},
- {L"-h", TypeFlag},
- {L"+h", TypeFlag},
- {L"-r", TypeFlag},
- {L"+r", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'attrib' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunAttrib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- UINT64 FileAttributesToAdd;
- UINT64 FileAttributesToRemove;
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN ParamNumberCount;
- CONST CHAR16 *FileName;
- EFI_SHELL_FILE_INFO *ListOfFiles;
- EFI_SHELL_FILE_INFO *FileNode;
- EFI_FILE_INFO *FileInfo;
-
- ListOfFiles = NULL;
- ShellStatus = SHELL_SUCCESS;
- ProblemParam = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (AttribParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
-
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else {
- FileAttributesToAdd = 0;
- FileAttributesToRemove = 0;
-
- //
- // apply or remove each flag
- //
- if (ShellCommandLineGetFlag(Package, L"+a")) {
- FileAttributesToAdd |= EFI_FILE_ARCHIVE;
- }
- if (ShellCommandLineGetFlag(Package, L"-a")) {
- FileAttributesToRemove |= EFI_FILE_ARCHIVE;
- }
- if (ShellCommandLineGetFlag(Package, L"+s")) {
- FileAttributesToAdd |= EFI_FILE_SYSTEM;
- }
- if (ShellCommandLineGetFlag(Package, L"-s")) {
- FileAttributesToRemove |= EFI_FILE_SYSTEM;
- }
- if (ShellCommandLineGetFlag(Package, L"+h")) {
- FileAttributesToAdd |= EFI_FILE_HIDDEN;
- }
- if (ShellCommandLineGetFlag(Package, L"-h")) {
- FileAttributesToRemove |= EFI_FILE_HIDDEN;
- }
- if (ShellCommandLineGetFlag(Package, L"+r")) {
- FileAttributesToAdd |= EFI_FILE_READ_ONLY;
- }
- if (ShellCommandLineGetFlag(Package, L"-r")) {
- FileAttributesToRemove |= EFI_FILE_READ_ONLY;
- }
-
- if (FileAttributesToRemove == 0 && FileAttributesToAdd == 0) {
- //
- // Do display as we have no attributes to change
- //
- for ( ParamNumberCount = 1
- ;
- ; ParamNumberCount++
- ){
- FileName = ShellCommandLineGetRawValue(Package, ParamNumberCount);
- // if we dont have anything left, move on...
- if (FileName == NULL && ParamNumberCount == 1) {
- FileName = (CHAR16*)AllFiles;
- } else if (FileName == NULL) {
- break;
- }
- ASSERT(ListOfFiles == NULL);
- Status = ShellOpenFileMetaArg((CHAR16*)FileName, EFI_FILE_MODE_READ, &ListOfFiles);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, ParamNumberCount));
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- for (FileNode = (EFI_SHELL_FILE_INFO*)GetFirstNode(&ListOfFiles->Link)
- ; !IsNull(&ListOfFiles->Link, &FileNode->Link)
- ; FileNode = (EFI_SHELL_FILE_INFO*)GetNextNode(&ListOfFiles->Link, &FileNode->Link)
- ){
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_ATTRIB_OUTPUT_LINE),
- gShellLevel2HiiHandle,
- FileNode->Info->Attribute&EFI_FILE_DIRECTORY? L'D':L' ',
- FileNode->Info->Attribute&EFI_FILE_ARCHIVE? L'A':L' ',
- FileNode->Info->Attribute&EFI_FILE_SYSTEM? L'S':L' ',
- FileNode->Info->Attribute&EFI_FILE_HIDDEN? L'H':L' ',
- FileNode->Info->Attribute&EFI_FILE_READ_ONLY? L'R':L' ',
- FileNode->FileName
- );
- }
- Status = ShellCloseFileMetaArg(&ListOfFiles);
- ListOfFiles = NULL;
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_CLOSE_FAIL), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, ParamNumberCount));
- ShellStatus = SHELL_NOT_FOUND;
- }
- } // for loop for handling wildcard filenames
- } // for loop for printing out the info
- } else if ((FileAttributesToRemove & FileAttributesToAdd) != 0) {
- //
- // fail as we have conflcting params.
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // enumerate through all the files/directories and apply the attributes
- //
- for ( ParamNumberCount = 1
- ;
- ; ParamNumberCount++
- ){
- FileName = ShellCommandLineGetRawValue(Package, ParamNumberCount);
- // if we dont have anything left, move on...
- if (FileName == NULL) {
- //
- // make sure we are not failing on the first one we do... if yes that's an error...
- //
- if (ParamNumberCount == 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- break;
- }
-
- //
- // OpenFileByName / GetFileInfo / Change attributes / SetFileInfo / CloseFile / free memory
- // for each file or directory on the line.
- //
-
- //
- // Open the file(s)
- //
- ASSERT(ListOfFiles == NULL);
- Status = ShellOpenFileMetaArg((CHAR16*)FileName, EFI_FILE_MODE_READ, &ListOfFiles);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, ParamNumberCount));
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- for (FileNode = (EFI_SHELL_FILE_INFO*)GetFirstNode(&ListOfFiles->Link)
- ; !IsNull(&ListOfFiles->Link, &FileNode->Link)
- ; FileNode = (EFI_SHELL_FILE_INFO*)GetNextNode(&ListOfFiles->Link, &FileNode->Link)
- ){
- //
- // skip the directory traversing stuff...
- //
- if (StrCmp(FileNode->FileName, L".") == 0 || StrCmp(FileNode->FileName, L"..") == 0) {
- continue;
- }
-
- FileInfo = gEfiShellProtocol->GetFileInfo(FileNode->Handle);
-
- //
- // if we are removing Read-Only we need to do that alone
- //
- if ((FileAttributesToRemove & EFI_FILE_READ_ONLY) == EFI_FILE_READ_ONLY) {
- FileInfo->Attribute &= ~EFI_FILE_READ_ONLY;
- //
- // SetFileInfo
- //
- Status = ShellSetFileInfo(FileNode->Handle, FileInfo);
- if (EFI_ERROR(Status)) {;
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, ParamNumberCount));
- ShellStatus = SHELL_ACCESS_DENIED;
- }
- }
-
- //
- // change the attribute
- //
- FileInfo->Attribute &= ~FileAttributesToRemove;
- FileInfo->Attribute |= FileAttributesToAdd;
-
- //
- // SetFileInfo
- //
- Status = ShellSetFileInfo(FileNode->Handle, FileInfo);
- if (EFI_ERROR(Status)) {;
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, ParamNumberCount));
- ShellStatus = SHELL_ACCESS_DENIED;
- }
-
- SHELL_FREE_NON_NULL(FileInfo);
- }
- Status = ShellCloseFileMetaArg(&ListOfFiles);
- ListOfFiles = NULL;
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_CLOSE_FAIL), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, ParamNumberCount));
- ShellStatus = SHELL_NOT_FOUND;
- }
- } // for loop for handling wildcard filenames
- }
- }
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- //
- // return the status
- //
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
deleted file mode 100644
index 74beb093c4..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/** @file
- Main file for attrib shell level 2 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-/**
- Function for 'cd' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunCd (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CONST CHAR16 *Directory;
- CHAR16 *Path;
- CHAR16 *Drive;
- UINTN DriveSize;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- SHELL_FILE_HANDLE Handle;
- CONST CHAR16 *Param1;
- CHAR16 *Param1Copy;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- Drive = NULL;
- DriveSize = 0;
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- }
-
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // remember that param 0 is the command name
- // If there are 0 value parameters, then print the current directory
- // else If there are 2 value parameters, then print the error message
- // else If there is 1 value paramerer , then change the directory
- //
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- if (Param1 == NULL) {
- //
- // display the current directory
- //
- Directory = ShellGetCurrentDir(NULL);
- if (Directory != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CD_PRINT), gShellLevel2HiiHandle, Directory);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- }
- } else {
- Param1Copy = CatSPrint(NULL, L"%s", Param1, NULL);
- if (Param1Copy != NULL) {
- Param1Copy = PathCleanUpDirectories(Param1Copy);
- }
- if (Param1Copy != NULL) {
- if (StrCmp(Param1Copy, L".") == 0) {
- //
- // nothing to do... change to current directory
- //
- } else if (StrCmp(Param1Copy, L"..") == 0) {
- //
- // Change up one directory...
- //
- Directory = ShellGetCurrentDir(NULL);
- if (Directory == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- Drive = GetFullyQualifiedPath(Directory);
- PathRemoveLastItem(Drive);
- }
- if (ShellStatus == SHELL_SUCCESS && Drive != NULL) {
- //
- // change directory on current drive letter
- //
- Status = gEfiShellProtocol->SetCurDir(NULL, Drive);
- if (Status == EFI_NOT_FOUND) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CD_NF), gShellLevel2HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- } else if (StrCmp(Param1Copy, L"\\") == 0) {
- //
- // Move to root of current drive
- //
- Directory = ShellGetCurrentDir(NULL);
- if (Directory == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- Drive = GetFullyQualifiedPath(Directory);
- while (PathRemoveLastItem(Drive)) ;
- }
- if (ShellStatus == SHELL_SUCCESS && Drive != NULL) {
- //
- // change directory on current drive letter
- //
- Status = gEfiShellProtocol->SetCurDir(NULL, Drive);
- if (Status == EFI_NOT_FOUND) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CD_NF), gShellLevel2HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- } else if (StrStr(Param1Copy, L":") == NULL) {
- if (ShellGetCurrentDir(NULL) == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- ASSERT((Drive == NULL && DriveSize == 0) || (Drive != NULL));
- Drive = StrnCatGrow(&Drive, &DriveSize, ShellGetCurrentDir(NULL), 0);
- if (*Param1Copy == L'\\') {
- while (PathRemoveLastItem(Drive)) ;
- Drive = StrnCatGrow(&Drive, &DriveSize, Param1Copy+1, 0);
- } else {
- Drive = StrnCatGrow(&Drive, &DriveSize, Param1Copy, 0);
- }
- //
- // Verify that this is a valid directory
- //
- Status = gEfiShellProtocol->OpenFileByName(Drive, &Handle, EFI_FILE_MODE_READ);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, Drive);
- ShellStatus = SHELL_NOT_FOUND;
- } else if (EFI_ERROR(FileHandleIsDirectory(Handle))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, Drive);
- ShellStatus = SHELL_NOT_FOUND;
- }
- if (ShellStatus == SHELL_SUCCESS && Drive != NULL) {
- //
- // change directory on current drive letter
- //
- Status = gEfiShellProtocol->SetCurDir(NULL, Drive);
- if (Status == EFI_NOT_FOUND) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CD_NF), gShellLevel2HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- if (Handle != NULL) {
- gEfiShellProtocol->CloseFile(Handle);
- DEBUG_CODE(Handle = NULL;);
- }
- }
- } else {
- //
- // change directory on other drive letter
- //
- Drive = AllocateZeroPool(StrSize(Param1Copy));
- if (Drive == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellLevel2HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- } else {
- Drive = StrCpy(Drive, Param1Copy);
- Path = StrStr(Drive, L":");
- ASSERT(Path != NULL);
- if (*(Path+1) == CHAR_NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CD_NF), gShellLevel2HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- *(Path+1) = CHAR_NULL;
- if (Path == Drive + StrLen(Drive)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CD_NF), gShellLevel2HiiHandle);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- Status = gEfiShellProtocol->SetCurDir(Drive, Path+2);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CD_PRINT), gShellLevel2HiiHandle, ShellGetCurrentDir(Drive));
- }
- }
- if (Status == EFI_NOT_FOUND) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CD_NF), gShellLevel2HiiHandle);
- Status = SHELL_NOT_FOUND;
- } else if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, Param1Copy);
- Status = SHELL_NOT_FOUND;
- }
- }
- }
- }
- FreePool(Param1Copy);
- }
- }
-
- if (Drive != NULL) {
- FreePool(Drive);
- }
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- //
- // return the status
- //
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
deleted file mode 100644
index 00b51b4111..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
+++ /dev/null
@@ -1,661 +0,0 @@
-/** @file
- Main file for cp shell level 2 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-/**
- Function to take a list of files to copy and a destination location and do
- the verification and copying of those files to that location. This function
- will report any errors to the user and halt.
-
- @param[in] FileList A LIST_ENTRY* based list of files to move.
- @param[in] DestDir The destination location.
- @param[in] SilentMode TRUE to eliminate screen output.
- @param[in] RecursiveMode TRUE to copy directories.
- @param[in] Resp The response to the overwrite query (if always).
-
- @retval SHELL_SUCCESS the files were all moved.
- @retval SHELL_INVALID_PARAMETER a parameter was invalid
- @retval SHELL_SECURITY_VIOLATION a security violation ocurred
- @retval SHELL_WRITE_PROTECTED the destination was write protected
- @retval SHELL_OUT_OF_RESOURCES a memory allocation failed
-**/
-SHELL_STATUS
-EFIAPI
-ValidateAndCopyFiles(
- IN CONST EFI_SHELL_FILE_INFO *FileList,
- IN CONST CHAR16 *DestDir,
- IN BOOLEAN SilentMode,
- IN BOOLEAN RecursiveMode,
- IN VOID **Resp
- );
-
-/**
- Function to Copy one file to another location
-
- If the destination exists the user will be prompted and the result put into *resp
-
- @param[in] Source pointer to source file name
- @param[in] Dest pointer to destination file name
- @param[out] Resp pointer to response from question. Pass back on looped calling
- @param[in] SilentMode whether to run in quiet mode or not
-
- @retval SHELL_SUCCESS The source file was copied to the destination
-**/
-SHELL_STATUS
-EFIAPI
-CopySingleFile(
- IN CONST CHAR16 *Source,
- IN CONST CHAR16 *Dest,
- OUT VOID **Resp,
- IN BOOLEAN SilentMode
- )
-{
- VOID *Response;
- UINTN ReadSize;
- SHELL_FILE_HANDLE SourceHandle;
- SHELL_FILE_HANDLE DestHandle;
- EFI_STATUS Status;
- VOID *Buffer;
- CHAR16 *TempName;
- UINTN Size;
- EFI_SHELL_FILE_INFO *List;
- SHELL_STATUS ShellStatus;
-
-
- ASSERT(Resp != NULL);
-
- SourceHandle = NULL;
- DestHandle = NULL;
- Response = *Resp;
- List = NULL;
-
- ReadSize = PcdGet16(PcdShellFileOperationSize);
- // Why bother copying a file to itself
- if (StrCmp(Source, Dest) == 0) {
- return (SHELL_SUCCESS);
- }
-
- //
- // Open destination file without create
- //
- Status = ShellOpenFileByName(Dest, &DestHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
-
- //
- // close file
- //
- if (DestHandle != NULL) {
- ShellCloseFile(&DestHandle);
- DestHandle = NULL;
- }
-
- //
- // if the destination file existed check response and possibly prompt user
- //
- if (!EFI_ERROR(Status)) {
- if (Response == NULL && !SilentMode) {
- Status = ShellPromptForResponseHii(ShellPromptResponseTypeYesNoAllCancel, STRING_TOKEN (STR_GEN_DEST_EXIST_OVR), gShellLevel2HiiHandle, &Response);
- }
- //
- // possibly return based on response
- //
- if (!SilentMode) {
- switch (*(SHELL_PROMPT_RESPONSE*)Response) {
- case ShellPromptResponseNo:
- //
- // return success here so we dont stop the process
- //
- return (SHELL_SUCCESS);
- case ShellPromptResponseCancel:
- *Resp = Response;
- //
- // indicate to stop everything
- //
- return (SHELL_ABORTED);
- case ShellPromptResponseAll:
- *Resp = Response;
- case ShellPromptResponseYes:
- break;
- default:
- return SHELL_ABORTED;
- }
- }
- }
-
- if (ShellIsDirectory(Source) == EFI_SUCCESS) {
- Status = ShellCreateDirectory(Dest, &DestHandle);
- if (EFI_ERROR(Status)) {
- return (SHELL_ACCESS_DENIED);
- }
-
- //
- // Now copy all the files under the directory...
- //
- TempName = NULL;
- Size = 0;
- StrnCatGrow(&TempName, &Size, Source, 0);
- StrnCatGrow(&TempName, &Size, L"\\*", 0);
- ShellOpenFileMetaArg((CHAR16*)TempName, EFI_FILE_MODE_READ, &List);
- TempName = NULL;
- StrnCatGrow(&TempName, &Size, Dest, 0);
- StrnCatGrow(&TempName, &Size, L"\\", 0);
- ShellStatus = ValidateAndCopyFiles(List, TempName, SilentMode, TRUE, Resp);
- ShellCloseFileMetaArg(&List);
- FreePool(TempName);
- Size = 0;
- } else {
- //
- // open file with create enabled
- //
- Status = ShellOpenFileByName(Dest, &DestHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
- if (EFI_ERROR(Status)) {
- return (SHELL_ACCESS_DENIED);
- }
-
- //
- // open source file
- //
- Status = ShellOpenFileByName(Source, &SourceHandle, EFI_FILE_MODE_READ, 0);
- ASSERT_EFI_ERROR(Status);
-
- //
- // copy data between files
- //
- Buffer = AllocateZeroPool(ReadSize);
- ASSERT(Buffer != NULL);
- while (ReadSize == PcdGet16(PcdShellFileOperationSize) && !EFI_ERROR(Status)) {
- Status = ShellReadFile(SourceHandle, &ReadSize, Buffer);
- ASSERT_EFI_ERROR(Status);
- Status = ShellWriteFile(DestHandle, &ReadSize, Buffer);
- }
- }
-
- //
- // close files
- //
- if (DestHandle != NULL) {
- ShellCloseFile(&DestHandle);
- DestHandle = NULL;
- }
- if (SourceHandle != NULL) {
- ShellCloseFile(&SourceHandle);
- SourceHandle = NULL;
- }
-
- //
- // return
- //
- return (SHELL_SUCCESS);
-}
-
-/**
- function to take a list of files to copy and a destination location and do
- the verification and copying of those files to that location. This function
- will report any errors to the user and halt.
-
- The key is to have this function called ONLY once. this allows for the parameter
- verification to happen correctly.
-
- @param[in] FileList A LIST_ENTRY* based list of files to move.
- @param[in] DestDir The destination location.
- @param[in] SilentMode TRUE to eliminate screen output.
- @param[in] RecursiveMode TRUE to copy directories.
- @param[in] Resp The response to the overwrite query (if always).
-
- @retval SHELL_SUCCESS the files were all moved.
- @retval SHELL_INVALID_PARAMETER a parameter was invalid
- @retval SHELL_SECURITY_VIOLATION a security violation ocurred
- @retval SHELL_WRITE_PROTECTED the destination was write protected
- @retval SHELL_OUT_OF_RESOURCES a memory allocation failed
-**/
-SHELL_STATUS
-EFIAPI
-ValidateAndCopyFiles(
- IN CONST EFI_SHELL_FILE_INFO *FileList,
- IN CONST CHAR16 *DestDir,
- IN BOOLEAN SilentMode,
- IN BOOLEAN RecursiveMode,
- IN VOID **Resp
- )
-{
- CHAR16 *HiiOutput;
- CHAR16 *HiiResultOk;
- CONST EFI_SHELL_FILE_INFO *Node;
- SHELL_STATUS ShellStatus;
- CHAR16 *DestPath;
- VOID *Response;
- UINTN PathLen;
- CONST CHAR16 *Cwd;
- CONST CHAR16 *TempLocation;
- UINTN NewSize;
-
- if (Resp == NULL) {
- Response = NULL;
- } else {
- Response = *Resp;
- }
-
- DestPath = NULL;
- ShellStatus = SHELL_SUCCESS;
- PathLen = 0;
- Cwd = ShellGetCurrentDir(NULL);
-
- ASSERT(FileList != NULL);
- ASSERT(DestDir != NULL);
-
- //
- // We already verified that this was present.
- //
- ASSERT(Cwd != NULL);
-
- //
- // If we are trying to copy multiple files... make sure we got a directory for the target...
- //
- if (EFI_ERROR(ShellIsDirectory(DestDir)) && FileList->Link.ForwardLink != FileList->Link.BackLink) {
- //
- // Error for destination not a directory
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, DestDir);
- return (SHELL_INVALID_PARAMETER);
- }
- for (Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link)
- ; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&FileList->Link, &Node->Link)
- ){
- //
- // skip the directory traversing stuff...
- //
- if (StrCmp(Node->FileName, L".") == 0 || StrCmp(Node->FileName, L"..") == 0) {
- continue;
- }
-
- NewSize = StrSize(DestDir);
- NewSize += StrSize(Node->FullName);
- NewSize += StrSize(Cwd);
- if (NewSize > PathLen) {
- PathLen = NewSize;
- }
-
- //
- // Make sure got -r if required
- //
- if (!RecursiveMode && !EFI_ERROR(ShellIsDirectory(Node->FullName))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DIR_REQ), gShellLevel2HiiHandle);
- return (SHELL_INVALID_PARAMETER);
- }
-
- //
- // make sure got dest as dir if needed
- //
- if (!EFI_ERROR(ShellIsDirectory(Node->FullName)) && EFI_ERROR(ShellIsDirectory(DestDir))) {
- //
- // Error for destination not a directory
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, DestDir);
- return (SHELL_INVALID_PARAMETER);
- }
- }
-
- HiiOutput = HiiGetString (gShellLevel2HiiHandle, STRING_TOKEN (STR_CP_OUTPUT), NULL);
- HiiResultOk = HiiGetString (gShellLevel2HiiHandle, STRING_TOKEN (STR_GEN_RES_OK), NULL);
- DestPath = AllocateZeroPool(PathLen);
-
- if (DestPath == NULL || HiiOutput == NULL || HiiResultOk == NULL) {
- SHELL_FREE_NON_NULL(DestPath);
- SHELL_FREE_NON_NULL(HiiOutput);
- SHELL_FREE_NON_NULL(HiiResultOk);
- return (SHELL_OUT_OF_RESOURCES);
- }
-
- //
- // Go through the list of files to copy...
- //
- for (Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link)
- ; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&FileList->Link, &Node->Link)
- ){
- if (ShellGetExecutionBreakFlag()) {
- break;
- }
- ASSERT(Node->FileName != NULL);
- ASSERT(Node->FullName != NULL);
-
- //
- // skip the directory traversing stuff...
- //
- if (StrCmp(Node->FileName, L".") == 0 || StrCmp(Node->FileName, L"..") == 0) {
- continue;
- }
-
- if (FileList->Link.ForwardLink == FileList->Link.BackLink // 1 item
- && EFI_ERROR(ShellIsDirectory(DestDir)) // not an existing directory
- ) {
- if (StrStr(DestDir, L":") == NULL) {
- //
- // simple copy of a single file
- //
- StrCpy(DestPath, Cwd);
- if (DestPath[StrLen(DestPath)-1] != L'\\' && DestDir[0] != L'\\') {
- StrCat(DestPath, L"\\");
- } else if (DestPath[StrLen(DestPath)-1] == L'\\' && DestDir[0] == L'\\') {
- ((CHAR16*)DestPath)[StrLen(DestPath)-1] = CHAR_NULL;
- }
- StrCat(DestPath, DestDir);
- } else {
- StrCpy(DestPath, DestDir);
- }
- } else {
- //
- // we have multiple files or a directory in the DestDir
- //
-
- //
- // Check for leading slash
- //
- if (DestDir[0] == L'\\') {
- //
- // Copy to the root of CWD
- //
- StrCpy(DestPath, Cwd);
- while (PathRemoveLastItem(DestPath));
- StrCat(DestPath, DestDir+1);
- StrCat(DestPath, Node->FileName);
- } else if (StrStr(DestDir, L":") == NULL) {
- StrCpy(DestPath, Cwd);
- if (DestPath[StrLen(DestPath)-1] != L'\\' && DestDir[0] != L'\\') {
- StrCat(DestPath, L"\\");
- } else if (DestPath[StrLen(DestPath)-1] == L'\\' && DestDir[0] == L'\\') {
- ((CHAR16*)DestPath)[StrLen(DestPath)-1] = CHAR_NULL;
- }
- StrCat(DestPath, DestDir);
- if (DestDir[StrLen(DestDir)-1] != L'\\' && Node->FileName[0] != L'\\') {
- StrCat(DestPath, L"\\");
- } else if (DestDir[StrLen(DestDir)-1] == L'\\' && Node->FileName[0] == L'\\') {
- ((CHAR16*)DestPath)[StrLen(DestPath)-1] = CHAR_NULL;
- }
- StrCat(DestPath, Node->FileName);
-
- } else {
- StrCpy(DestPath, DestDir);
- if (DestDir[StrLen(DestDir)-1] != L'\\' && Node->FileName[0] != L'\\') {
- StrCat(DestPath, L"\\");
- } else if (DestDir[StrLen(DestDir)-1] == L'\\' && Node->FileName[0] == L'\\') {
- ((CHAR16*)DestDir)[StrLen(DestDir)-1] = CHAR_NULL;
- }
- StrCat(DestPath, Node->FileName);
- }
- }
-
- //
- // Make sure the path exists
- //
- if (EFI_ERROR(VerifyIntermediateDirectories(DestPath))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DIR_WNF), gShellLevel2HiiHandle);
- ShellStatus = SHELL_DEVICE_ERROR;
- break;
- }
-
- if ( !EFI_ERROR(ShellIsDirectory(Node->FullName))
- && !EFI_ERROR(ShellIsDirectory(DestPath))
- && StrniCmp(Node->FullName, DestPath, StrLen(DestPath)) == NULL
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_PARENT), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- break;
- }
- if (StringNoCaseCompare(&Node->FullName, &DestPath) == 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_SAME), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- break;
- }
-
- if ((TempLocation = StrniCmp(Node->FullName, DestPath, StrLen(Node->FullName))) == 0
- && (DestPath[StrLen(Node->FullName)] == CHAR_NULL || DestPath[StrLen(Node->FullName)] == L'\\')
- ) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_SAME), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- break;
- }
-
- PathCleanUpDirectories(DestPath);
-
- ShellPrintEx(-1, -1, HiiOutput, Node->FullName, DestPath);
-
- //
- // copy single file...
- //
- ShellStatus = CopySingleFile(Node->FullName, DestPath, &Response, SilentMode);
- if (ShellStatus != SHELL_SUCCESS) {
- break;
- }
- }
- if (ShellStatus == SHELL_SUCCESS && Resp == NULL) {
- ShellPrintEx(-1, -1, L"%s", HiiResultOk);
- }
-
- SHELL_FREE_NON_NULL(DestPath);
- SHELL_FREE_NON_NULL(HiiOutput);
- SHELL_FREE_NON_NULL(HiiResultOk);
- if (Resp == NULL) {
- SHELL_FREE_NON_NULL(Response);
- }
-
- return (ShellStatus);
-}
-
-/**
- Validate and if successful copy all the files from the list into
- destination directory.
-
- @param[in] FileList The list of files to copy.
- @param[in] DestDir The directory to copy files to.
- @param[in] SilentMode TRUE to eliminate screen output.
- @param[in] RecursiveMode TRUE to copy directories.
-
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
- @retval SHELL_SUCCESS The operation was successful.
-**/
-SHELL_STATUS
-EFIAPI
-ProcessValidateAndCopyFiles(
- IN EFI_SHELL_FILE_INFO *FileList,
- IN CONST CHAR16 *DestDir,
- IN BOOLEAN SilentMode,
- IN BOOLEAN RecursiveMode
- )
-{
- SHELL_STATUS ShellStatus;
- EFI_SHELL_FILE_INFO *List;
- EFI_STATUS Status;
- EFI_FILE_INFO *FileInfo;
-
- List = NULL;
-
- Status = ShellOpenFileMetaArg((CHAR16*)DestDir, EFI_FILE_MODE_READ, &List);
- if (List != NULL && List->Link.ForwardLink != List->Link.BackLink) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MARG_ERROR), gShellLevel2HiiHandle, DestDir);
- ShellStatus = SHELL_INVALID_PARAMETER;
- ShellCloseFileMetaArg(&List);
- } else if (List != NULL) {
- ASSERT(((EFI_SHELL_FILE_INFO *)List->Link.ForwardLink) != NULL);
- ASSERT(((EFI_SHELL_FILE_INFO *)List->Link.ForwardLink)->FullName != NULL);
- FileInfo = NULL;
- FileInfo = gEfiShellProtocol->GetFileInfo(((EFI_SHELL_FILE_INFO *)List->Link.ForwardLink)->Handle);
- ASSERT(FileInfo != NULL);
- if ((FileInfo->Attribute & EFI_FILE_READ_ONLY) == 0) {
- ShellStatus = ValidateAndCopyFiles(FileList, ((EFI_SHELL_FILE_INFO *)List->Link.ForwardLink)->FullName, SilentMode, RecursiveMode, NULL);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_ERROR), gShellLevel2HiiHandle);
- ShellStatus = SHELL_ACCESS_DENIED;
- }
- SHELL_FREE_NON_NULL(FileInfo);
- ShellCloseFileMetaArg(&List);
- } else {
- ShellStatus = ValidateAndCopyFiles(FileList, DestDir, SilentMode, RecursiveMode, NULL);
- }
-
- return (ShellStatus);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-r", TypeFlag},
- {L"-q", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'cp' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunCp (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN ParamCount;
- UINTN LoopCounter;
- EFI_SHELL_FILE_INFO *FileList;
- BOOLEAN SilentMode;
- BOOLEAN RecursiveMode;
- CONST CHAR16 *Cwd;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- ParamCount = 0;
- FileList = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
-
- //
- // Initialize SilentMode and RecursiveMode
- //
- if (gEfiShellProtocol->BatchIsActive()) {
- SilentMode = TRUE;
- } else {
- SilentMode = ShellCommandLineGetFlag(Package, L"-q");
- }
- RecursiveMode = ShellCommandLineGetFlag(Package, L"-r");
-
- switch (ParamCount = ShellCommandLineGetCount(Package)) {
- case 0:
- case 1:
- //
- // we have insufficient parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- break;
- case 2:
- //
- // must have valid CWD for single parameter...
- //
- Cwd = ShellGetCurrentDir(NULL);
- if (Cwd == NULL){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, 1), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
- if (FileList == NULL || IsListEmpty(&FileList->Link) || EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, 1));
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- ShellStatus = ProcessValidateAndCopyFiles(FileList, Cwd, SilentMode, RecursiveMode);
- }
- }
-
- break;
- default:
- //
- // Make a big list of all the files...
- //
- for (ParamCount--, LoopCounter = 1 ; LoopCounter < ParamCount && ShellStatus == SHELL_SUCCESS ; LoopCounter++) {
- if (ShellGetExecutionBreakFlag()) {
- break;
- }
- Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, LoopCounter), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
- if (EFI_ERROR(Status) || FileList == NULL || IsListEmpty(&FileList->Link)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, LoopCounter));
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- if (ShellStatus != SHELL_SUCCESS) {
- Status = ShellCloseFileMetaArg(&FileList);
- } else {
- //
- // now copy them all...
- //
- if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
- ShellStatus = ProcessValidateAndCopyFiles(FileList, PathCleanUpDirectories((CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount)), SilentMode, RecursiveMode);
- Status = ShellCloseFileMetaArg(&FileList);
- if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_FILE), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, ParamCount), ShellStatus|MAX_BIT);
- ShellStatus = SHELL_ACCESS_DENIED;
- }
- }
- }
- break;
- } // switch on parameter count
-
- if (FileList != NULL) {
- ShellCloseFileMetaArg(&FileList);
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- if (ShellGetExecutionBreakFlag()) {
- return (SHELL_ABORTED);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c
deleted file mode 100644
index 5edb9d7735..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/** @file
- Main file for attrib shell level 2 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-// This function was from from the BdsLib implementation in
-// IntelFrameworkModulePkg\Library\GenericBdsLib\BdsConnect.c
-// function name: BdsLibConnectAllEfi
-/**
- This function will connect all current system handles recursively. The
- connection will finish until every handle's child handle created if it have.
-
- @retval EFI_SUCCESS All handles and it's child handle have been
- connected
- @retval EFI_STATUS Return the status of gBS->LocateHandleBuffer().
-
-**/
-EFI_STATUS
-EFIAPI
-ConnectAllEfi (
- VOID
- )
-{
- EFI_STATUS Status;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- UINTN Index;
-
- Status = gBS->LocateHandleBuffer (
- AllHandles,
- NULL,
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- for (Index = 0; Index < HandleCount; Index++) {
- Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
- }
-
- if (HandleBuffer != NULL) {
- FreePool (HandleBuffer);
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- function to load a .EFI driver into memory and possible connect the driver.
-
- if FileName is NULL then ASSERT.
-
- @param[in] FileName FileName of the driver to load
- @param[in] Connect Whether to connect or not
-
- @retval EFI_SUCCESS the driver was loaded and if Connect was
- true then connect was attempted. Connection may
- have failed.
- @retval EFI_OUT_OF_RESOURCES there was insufficient memory
-**/
-EFI_STATUS
-EFIAPI
-LoadDriver(
- IN CONST CHAR16 *FileName,
- IN CONST BOOLEAN Connect
- )
-{
- EFI_HANDLE LoadedDriverHandle;
- EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *Node;
- EFI_DEVICE_PATH_PROTOCOL *FilePath;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedDriverImage;
-
- LoadedDriverImage = NULL;
- FilePath = NULL;
- Node = NULL;
- LoadedDriverHandle = NULL;
- Status = EFI_SUCCESS;
-
- ASSERT (FileName != NULL);
-
- //
- // Fix local copies of the protocol pointers
- //
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // Convert to DEVICE_PATH
- //
- FilePath = gEfiShellProtocol->GetDevicePathFromFilePath(FileName);
-
- if (FilePath == NULL) {
- ASSERT(FALSE);
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // Use LoadImage to get it into memory
- //
- Status = gBS->LoadImage(
- FALSE,
- gImageHandle,
- FilePath,
- NULL,
- 0,
- &LoadedDriverHandle);
-
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_NOT_IMAGE), gShellLevel2HiiHandle, FileName, Status);
- } else {
- //
- // Make sure it is a driver image
- //
- Status = gBS->HandleProtocol (LoadedDriverHandle, &gEfiLoadedImageProtocolGuid, (VOID *) &LoadedDriverImage);
-
- ASSERT (LoadedDriverImage != NULL);
-
- if ( EFI_ERROR(Status)
- || ( LoadedDriverImage->ImageCodeType != EfiBootServicesCode
- && LoadedDriverImage->ImageCodeType != EfiRuntimeServicesCode)
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_NOT_DRIVER), gShellLevel2HiiHandle, FileName);
-
- //
- // Exit and unload the non-driver image
- //
- gBS->Exit(LoadedDriverHandle, EFI_INVALID_PARAMETER, 0, NULL);
- Status = EFI_INVALID_PARAMETER;
- }
- }
-
- if (!EFI_ERROR(Status)) {
- //
- // Start the image
- //
- Status = gBS->StartImage(LoadedDriverHandle, NULL, NULL);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_ERROR), gShellLevel2HiiHandle, FileName, Status);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_LOADED), gShellLevel2HiiHandle, FileName, LoadedDriverImage->ImageBase, Status);
- }
- }
-
- if (!EFI_ERROR(Status) && Connect) {
- //
- // Connect it...
- //
- Status = ConnectAllEfi();
- }
-
- //
- // clean up memory...
- //
- if (FilePath != NULL) {
- FreePool(FilePath);
- }
-
- return (Status);
-}
-
-STATIC CONST SHELL_PARAM_ITEM LoadParamList[] = {
- {L"-nc", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'load' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunLoad (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN ParamCount;
- EFI_SHELL_FILE_INFO *ListHead;
- EFI_SHELL_FILE_INFO *Node;
-
- ListHead = NULL;
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (LoadParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // we didnt get a single file to load parameter
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- for ( ParamCount = 1
- ; ShellCommandLineGetRawValue(Package, ParamCount) != NULL
- ; ParamCount++
- ){
- Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount), EFI_FILE_MODE_READ, &ListHead);
- if (!EFI_ERROR(Status)) {
- for ( Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&ListHead->Link)
- ; !IsNull(&ListHead->Link, &Node->Link)
- ; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&ListHead->Link, &Node->Link)
- ){
- //
- // once we have an error preserve that value, but finish the loop.
- //
- if (EFI_ERROR(Status)) {
- LoadDriver(Node->FullName, (BOOLEAN)(ShellCommandLineGetFlag(Package, L"-nc")==FALSE));
- } else {
- Status = LoadDriver(Node->FullName, (BOOLEAN)(ShellCommandLineGetFlag(Package, L"-nc")==FALSE));
- }
- } // for loop for multi-open
- if (EFI_ERROR(Status)) {
- ShellCloseFileMetaArg(&ListHead);
- } else {
- Status = ShellCloseFileMetaArg(&ListHead);;
- }
- } else {
- //
- // no files found.
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, (CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount));
- ShellStatus = SHELL_NOT_FOUND;
- }
- } // for loop for params
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) {
- ShellStatus = SHELL_DEVICE_ERROR;
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
deleted file mode 100644
index 55267a467a..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/** @file
- Main file for ls shell level 2 function.
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-#include <Guid/FileSystemInfo.h>
-
-/**
- print out the list of files and directories from the LS command
-
- @param[in] Rec TRUE to automatically recurse into each found directory
- FALSE to only list the specified directory.
- @param[in] Attribs List of required Attribute for display.
- If 0 then all non-system and non-hidden files will be printed.
- @param[in] Sfo TRUE to use Standard Format Output, FALSE otherwise
- @param[in] Path String with starting path.
- @param[in] First TRUE for the original and FALSE for any recursion spawned instances.
- @param[in] Count The count of bits enabled in Attribs.
- @param[in] TimeZone The current time zone offset.
-
- @retval SHELL_SUCCESS the printing was sucessful.
-**/
-SHELL_STATUS
-EFIAPI
-PrintLsOutput(
- IN CONST BOOLEAN Rec,
- IN CONST UINT64 Attribs,
- IN CONST BOOLEAN Sfo,
- IN CONST CHAR16 *Path,
- IN CONST BOOLEAN First,
- IN CONST UINTN Count,
- IN CONST INT16 TimeZone
- )
-{
- EFI_STATUS Status;
- EFI_SHELL_FILE_INFO *ListHead;
- EFI_SHELL_FILE_INFO *Node;
- SHELL_STATUS ShellStatus;
- UINT64 FileCount;
- UINT64 DirCount;
- UINT64 FileSize;
- CHAR16 *DirectoryName;
- UINTN LongestPath;
- EFI_FILE_SYSTEM_INFO *SysInfo;
- UINTN SysInfoSize;
- SHELL_FILE_HANDLE ShellFileHandle;
- CHAR16 *CorrectedPath;
- EFI_FILE_PROTOCOL *EfiFpHandle;
-
- FileCount = 0;
- DirCount = 0;
- FileSize = 0;
- ListHead = NULL;
- ShellStatus = SHELL_SUCCESS;
- LongestPath = 0;
- CorrectedPath = NULL;
-
- CorrectedPath = StrnCatGrow(&CorrectedPath, NULL, Path, 0);
- if (CorrectedPath == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
-
- PathCleanUpDirectories(CorrectedPath);
-
- Status = ShellOpenFileMetaArg((CHAR16*)CorrectedPath, EFI_FILE_MODE_READ, &ListHead);
- if (EFI_ERROR(Status)) {
- SHELL_FREE_NON_NULL(CorrectedPath);
- if(Status == EFI_NOT_FOUND){
- return (SHELL_NOT_FOUND);
- }
- return (SHELL_DEVICE_ERROR);
- }
- if (ListHead == NULL || IsListEmpty(&ListHead->Link)) {
- SHELL_FREE_NON_NULL(CorrectedPath);
- //
- // On the first one only we expect to find something...
- // do we find the . and .. directories otherwise?
- //
- if (First) {
- return (SHELL_NOT_FOUND);
- }
- return (SHELL_SUCCESS);
- }
-
- if (Sfo && First) {
- //
- // Get the first valid handle (directories)
- //
- for ( Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&ListHead->Link)
- ; !IsNull(&ListHead->Link, &Node->Link) && Node->Handle == NULL
- ; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&ListHead->Link, &Node->Link)
- );
-
- if (Node->Handle == NULL) {
- DirectoryName = GetFullyQualifiedPath(((EFI_SHELL_FILE_INFO *)GetFirstNode(&ListHead->Link))->FullName);
-
- //
- // We need to open something up to get system information
- //
- Status = gEfiShellProtocol->OpenFileByName(
- DirectoryName,
- &ShellFileHandle,
- EFI_FILE_MODE_READ);
-
- ASSERT_EFI_ERROR(Status);
- FreePool(DirectoryName);
-
- //
- // Get the Volume Info from ShellFileHandle
- //
- SysInfo = NULL;
- SysInfoSize = 0;
- EfiFpHandle = ConvertShellHandleToEfiFileProtocol(ShellFileHandle);
- Status = EfiFpHandle->GetInfo(
- EfiFpHandle,
- &gEfiFileSystemInfoGuid,
- &SysInfoSize,
- SysInfo);
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- SysInfo = AllocateZeroPool(SysInfoSize);
- Status = EfiFpHandle->GetInfo(
- EfiFpHandle,
- &gEfiFileSystemInfoGuid,
- &SysInfoSize,
- SysInfo);
- }
-
- ASSERT_EFI_ERROR(Status);
-
- gEfiShellProtocol->CloseFile(ShellFileHandle);
- } else {
- //
- // Get the Volume Info from Node->Handle
- //
- SysInfo = NULL;
- SysInfoSize = 0;
- EfiFpHandle = ConvertShellHandleToEfiFileProtocol(Node->Handle);
- Status = EfiFpHandle->GetInfo(
- EfiFpHandle,
- &gEfiFileSystemInfoGuid,
- &SysInfoSize,
- SysInfo);
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- SysInfo = AllocateZeroPool(SysInfoSize);
- Status = EfiFpHandle->GetInfo(
- EfiFpHandle,
- &gEfiFileSystemInfoGuid,
- &SysInfoSize,
- SysInfo);
- }
-
- ASSERT_EFI_ERROR(Status);
- }
-
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_GEN_SFO_HEADER),
- gShellLevel2HiiHandle,
- L"ls");
- //
- // print VolumeInfo table
- //
- ASSERT(SysInfo != NULL);
- ShellPrintHiiEx (
- 0,
- gST->ConOut->Mode->CursorRow,
- NULL,
- STRING_TOKEN (STR_LS_SFO_VOLINFO),
- gShellLevel2HiiHandle,
- SysInfo->VolumeLabel,
- SysInfo->VolumeSize,
- SysInfo->ReadOnly?L"TRUE":L"FALSE",
- SysInfo->FreeSpace,
- SysInfo->BlockSize
- );
- if (SysInfo != NULL) {
- FreePool(SysInfo);
- }
- }
-
- if (!Sfo) {
- //
- // get directory name from path...
- //
- DirectoryName = GetFullyQualifiedPath(CorrectedPath);
-
- //
- // print header
- //
- ShellPrintHiiEx (
- 0,
- gST->ConOut->Mode->CursorRow,
- NULL,
- STRING_TOKEN (STR_LS_HEADER_LINE1),
- gShellLevel2HiiHandle,
- DirectoryName
- );
- FreePool(DirectoryName);
- }
- for ( Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&ListHead->Link)
- ; !IsNull(&ListHead->Link, &Node->Link)
- ; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&ListHead->Link, &Node->Link)
- ){
- ASSERT(Node != NULL);
- if (LongestPath < StrSize(Node->FullName)) {
- LongestPath = StrSize(Node->FullName);
- }
- ASSERT(Node->Info != NULL);
- ASSERT((Node->Info->Attribute & EFI_FILE_VALID_ATTR) == Node->Info->Attribute);
- if (Attribs == 0) {
- //
- // NOT system & NOT hidden
- //
- if ( (Node->Info->Attribute & EFI_FILE_SYSTEM)
- || (Node->Info->Attribute & EFI_FILE_HIDDEN)
- ){
- continue;
- }
- } else if (Attribs != EFI_FILE_VALID_ATTR) {
- if (Count == 1) {
- //
- // the bit must match
- //
- if ( (Node->Info->Attribute & Attribs) != Attribs) {
- continue;
- }
- } else {
- //
- // exact match on all bits
- //
- if ( (Node->Info->Attribute|EFI_FILE_ARCHIVE) != (Attribs|EFI_FILE_ARCHIVE)) {
- continue;
- }
- }
- }
-
- if (Sfo) {
- //
- // Print the FileInfo Table
- //
- ShellPrintHiiEx (
- 0,
- gST->ConOut->Mode->CursorRow,
- NULL,
- STRING_TOKEN (STR_LS_SFO_FILEINFO),
- gShellLevel2HiiHandle,
- Node->FullName,
- Node->Info->FileSize,
- Node->Info->PhysicalSize,
- (Node->Info->Attribute & EFI_FILE_ARCHIVE) != 0?L"a":L"",
- (Node->Info->Attribute & EFI_FILE_DIRECTORY) != 0?L"d":L"",
- (Node->Info->Attribute & EFI_FILE_HIDDEN) != 0?L"h":L"",
- (Node->Info->Attribute & EFI_FILE_READ_ONLY) != 0?L"r":L"",
- (Node->Info->Attribute & EFI_FILE_SYSTEM) != 0?L"s":L"",
- Node->Info->CreateTime.Hour,
- Node->Info->CreateTime.Minute,
- Node->Info->CreateTime.Second,
- Node->Info->CreateTime.Day,
- Node->Info->CreateTime.Month,
- Node->Info->CreateTime.Year,
- Node->Info->LastAccessTime.Hour,
- Node->Info->LastAccessTime.Minute,
- Node->Info->LastAccessTime.Second,
- Node->Info->LastAccessTime.Day,
- Node->Info->LastAccessTime.Month,
- Node->Info->LastAccessTime.Year,
- Node->Info->ModificationTime.Hour,
- Node->Info->ModificationTime.Minute,
- Node->Info->ModificationTime.Second,
- Node->Info->ModificationTime.Day,
- Node->Info->ModificationTime.Month,
- Node->Info->ModificationTime.Year
- );
- } else {
- //
- // print this one out...
- // first print the universal start, next print the type specific name format, last print the CRLF
- //
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_LS_LINE_START_ALL),
- gShellLevel2HiiHandle,
- &Node->Info->ModificationTime,
- (Node->Info->Attribute & EFI_FILE_DIRECTORY) != 0?L"<DIR>":L"",
- (Node->Info->Attribute & EFI_FILE_READ_ONLY) != 0?L'r':L' ',
- Node->Info->FileSize
- );
- if (Node->Info->Attribute & EFI_FILE_DIRECTORY) {
- DirCount++;
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_LS_LINE_END_DIR),
- gShellLevel2HiiHandle,
- Node->FileName
- );
- } else {
- FileCount++;
- FileSize += Node->Info->FileSize;
- if ( (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)L".nsh", (CHAR16*)&(Node->FileName[StrLen (Node->FileName) - 4])) == 0)
- || (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)L".efi", (CHAR16*)&(Node->FileName[StrLen (Node->FileName) - 4])) == 0)
- ){
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_LS_LINE_END_EXE),
- gShellLevel2HiiHandle,
- Node->FileName
- );
- } else {
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_LS_LINE_END_FILE),
- gShellLevel2HiiHandle,
- Node->FileName
- );
- }
- }
- }
- }
-
- if (!Sfo) {
- //
- // print footer
- //
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_LS_FOOTER_LINE),
- gShellLevel2HiiHandle,
- FileCount,
- FileSize,
- DirCount
- );
- }
-
- if (Rec){
- DirectoryName = AllocateZeroPool(LongestPath + 2*sizeof(CHAR16));
- if (DirectoryName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellLevel2HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- } else {
- for ( Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&ListHead->Link)
- ; !IsNull(&ListHead->Link, &Node->Link) && ShellStatus == SHELL_SUCCESS
- ; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&ListHead->Link, &Node->Link)
- ){
- if (ShellGetExecutionBreakFlag ()) {
- ShellStatus = SHELL_ABORTED;
- break;
- }
-
- //
- // recurse on any directory except the traversing ones...
- //
- if (((Node->Info->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY)
- && StrCmp(Node->FileName, L".") != 0
- && StrCmp(Node->FileName, L"..") != 0
- ){
- StrCpy(DirectoryName, Node->FullName);
- StrCat(DirectoryName, L"\\*");
- ShellStatus = PrintLsOutput(
- Rec,
- Attribs,
- Sfo,
- DirectoryName,
- FALSE,
- Count,
- TimeZone);
- }
- }
- FreePool(DirectoryName);
- }
- }
-
- FreePool(CorrectedPath);
- ShellCloseFileMetaArg(&ListHead);
- FreePool(ListHead);
- return (ShellStatus);
-}
-
-STATIC CONST SHELL_PARAM_ITEM LsParamList[] = {
- {L"-r", TypeFlag},
- {L"-a", TypeStart},
- {L"-sfo", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'ls' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunLs (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- CONST CHAR16 *Attribs;
- SHELL_STATUS ShellStatus;
- UINT64 RequiredAttributes;
- CONST CHAR16 *PathName;
- CONST CHAR16 *CurDir;
- UINTN Count;
- CHAR16 *FullPath;
- UINTN Size;
- EFI_TIME TheTime;
- BOOLEAN SfoMode;
-
- Size = 0;
- FullPath = NULL;
- ProblemParam = NULL;
- Attribs = NULL;
- ShellStatus = SHELL_SUCCESS;
- RequiredAttributes = 0;
- PathName = NULL;
- CurDir = NULL;
- Count = 0;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // Fix local copies of the protocol pointers
- //
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (LsParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
-
- if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // check for -a
- //
- if (ShellCommandLineGetFlag(Package, L"-a")) {
- for ( Attribs = ShellCommandLineGetValue(Package, L"-a")
- ; Attribs != NULL && *Attribs != CHAR_NULL && ShellStatus == SHELL_SUCCESS
- ; Attribs++
- ){
- switch (*Attribs) {
- case L'a':
- case L'A':
- RequiredAttributes |= EFI_FILE_ARCHIVE;
- Count++;
- continue;
- case L's':
- case L'S':
- RequiredAttributes |= EFI_FILE_SYSTEM;
- Count++;
- continue;
- case L'h':
- case L'H':
- RequiredAttributes |= EFI_FILE_HIDDEN;
- Count++;
- continue;
- case L'r':
- case L'R':
- RequiredAttributes |= EFI_FILE_READ_ONLY;
- Count++;
- continue;
- case L'd':
- case L'D':
- RequiredAttributes |= EFI_FILE_DIRECTORY;
- Count++;
- continue;
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ATTRIBUTE), gShellLevel2HiiHandle, ShellCommandLineGetValue(Package, L"-a"));
- ShellStatus = SHELL_INVALID_PARAMETER;
- break;
- } // switch
- } // for loop
- //
- // if nothing is specified all are specified
- //
- if (RequiredAttributes == 0) {
- RequiredAttributes = EFI_FILE_VALID_ATTR;
- }
- } // if -a present
- if (ShellStatus == SHELL_SUCCESS) {
- PathName = ShellCommandLineGetRawValue(Package, 1);
- if (PathName == NULL) {
- CurDir = gEfiShellProtocol->GetCurDir(NULL);
- if (CurDir == NULL) {
- ShellStatus = SHELL_NOT_FOUND;
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
- }
- }
- if (PathName != NULL) {
- if (StrStr(PathName, L":") == NULL && gEfiShellProtocol->GetCurDir(NULL) == NULL) {
- ShellStatus = SHELL_NOT_FOUND;
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
- } else {
- ASSERT((FullPath == NULL && Size == 0) || (FullPath != NULL));
- StrnCatGrow(&FullPath, &Size, PathName, 0);
- if (ShellIsDirectory(PathName) == EFI_SUCCESS) {
- StrnCatGrow(&FullPath, &Size, L"\\*", 0);
- }
- }
- } else {
- ASSERT(FullPath == NULL);
- StrnCatGrow(&FullPath, NULL, L"*", 0);
- }
- Status = gRT->GetTime(&TheTime, NULL);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"gRT->GetTime", Status);
- TheTime.TimeZone = EFI_UNSPECIFIED_TIMEZONE;
- }
-
- SfoMode = ShellCommandLineGetFlag(Package, L"-sfo");
- if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = PrintLsOutput(
- ShellCommandLineGetFlag(Package, L"-r"),
- RequiredAttributes,
- SfoMode,
- FullPath,
- TRUE,
- Count,
- (INT16)(TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:TheTime.TimeZone)
- );
- if (ShellStatus == SHELL_NOT_FOUND) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_FILES), gShellLevel2HiiHandle);
- } else if (ShellStatus == SHELL_INVALID_PARAMETER) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle);
- } else if (ShellStatus == SHELL_ABORTED) {
- //
- // Ignore aborting.
- //
- } else if (ShellStatus != SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle);
- }
- }
- }
- }
- }
-
- if (FullPath != NULL) {
- FreePool(FullPath);
- }
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
deleted file mode 100644
index c65583994e..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
+++ /dev/null
@@ -1,1279 +0,0 @@
-/** @file
- Main file for map shell level 2 command.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-#include <Protocol/SimpleFileSystem.h>
-#include <Protocol/BlockIo.h>
-#include <Library/DevicePathLib.h>
-#include <Library/HandleParsingLib.h>
-#include <Library/SortLib.h>
-
-/**
- Determine if a string has only numbers and letters.
-
- This is useful for such things as Map names which can only be letters and numbers.
-
- @param[in] String pointer to the string to analyze,
- @param[in] Len Number of characters to analyze.
-
- @retval TRUE String has only numbers and letters
- @retval FALSE String has at least one other character.
-**/
-BOOLEAN
-EFIAPI
-IsNumberLetterOnly(
- IN CONST CHAR16 *String,
- IN CONST UINTN Len
- )
-{
- UINTN Count;
- for (Count = 0 ; Count < Len && String != NULL && *String != CHAR_NULL ; String++,Count++) {
- if (! ((*String >= L'a' && *String <= L'z') ||
- (*String >= L'A' && *String <= L'Z') ||
- (*String >= L'0' && *String <= L'9'))
- ){
- return (FALSE);
- }
- }
- return (TRUE);
-}
-
-/**
- Do a search in the Target delimited list.
-
- @param[in] List The list to seatch in.
- @param[in] MetaTarget The item to search for. MetaMatching supported.
- @param[out] FullName Optional pointer to an allocated buffer containing
- the match.
- @param[in] Meta TRUE to use MetaMatching.
- @param[in] SkipTrailingNumbers TRUE to allow for numbers after the MetaTarget.
- @param[in] Target The single character that delimits list
- items (";" normally).
-**/
-BOOLEAN
-EFIAPI
-SearchList(
- IN CONST CHAR16 *List,
- IN CONST CHAR16 *MetaTarget,
- OUT CHAR16 **FullName OPTIONAL,
- IN CONST BOOLEAN Meta,
- IN CONST BOOLEAN SkipTrailingNumbers,
- IN CONST CHAR16 *Target
-
- )
-{
- CHAR16 *TempList;
- CONST CHAR16 *ListWalker;
- BOOLEAN Result;
- CHAR16 *TempSpot;
-
- for (ListWalker = List , TempList = NULL
- ; ListWalker != NULL && *ListWalker != CHAR_NULL
- ;
- ) {
- TempList = StrnCatGrow(&TempList, NULL, ListWalker, 0);
- ASSERT(TempList != NULL);
- TempSpot = StrStr(TempList, Target);
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
-
- while (SkipTrailingNumbers && (ShellIsDecimalDigitCharacter(TempList[StrLen(TempList)-1]) || TempList[StrLen(TempList)-1] == L':')) {
- TempList[StrLen(TempList)-1] = CHAR_NULL;
- }
-
- ListWalker = StrStr(ListWalker, Target);
- while(ListWalker != NULL && *ListWalker == *Target) {
- ListWalker++;
- }
- if (Meta) {
- Result = gUnicodeCollation->MetaiMatch(gUnicodeCollation, (CHAR16*)TempList, (CHAR16*)MetaTarget);
- } else {
- Result = (BOOLEAN)(StrCmp(TempList, MetaTarget)==0);
- }
- if (Result) {
- if (FullName != NULL) {
- *FullName = TempList;
- } else {
- FreePool(TempList);
- }
- return (TRUE);
- }
- FreePool(TempList);
- TempList = NULL;
- }
-
- return (FALSE);
-}
-
-/**
- Add mappings for any devices without one. Do not change any existing maps.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-UpdateMapping (
- VOID
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *HandleList;
- UINTN Count;
- EFI_DEVICE_PATH_PROTOCOL **DevicePathList;
- CHAR16 *NewDefaultName;
- CHAR16 *NewConsistName;
- EFI_DEVICE_PATH_PROTOCOL **ConsistMappingTable;
-
- HandleList = NULL;
- Status = EFI_SUCCESS;
-
- //
- // remove mappings that represent removed devices.
- //
-
- //
- // Find each handle with Simple File System
- //
- HandleList = GetHandleListByProtocol(&gEfiSimpleFileSystemProtocolGuid);
- if (HandleList != NULL) {
- //
- // Do a count of the handles
- //
- for (Count = 0 ; HandleList[Count] != NULL ; Count++);
-
- //
- // Get all Device Paths
- //
- DevicePathList = AllocateZeroPool(sizeof(EFI_DEVICE_PATH_PROTOCOL*) * Count);
- ASSERT(DevicePathList != NULL);
-
- for (Count = 0 ; HandleList[Count] != NULL ; Count++) {
- DevicePathList[Count] = DevicePathFromHandle(HandleList[Count]);
- }
-
- //
- // Sort all DevicePaths
- //
- PerformQuickSort(DevicePathList, Count, sizeof(EFI_DEVICE_PATH_PROTOCOL*), DevicePathCompare);
-
- ShellCommandConsistMappingInitialize(&ConsistMappingTable);
-
- //
- // Assign new Mappings to remainders
- //
- for (Count = 0 ; HandleList[Count] != NULL && !EFI_ERROR(Status); Count++) {
- //
- // Skip ones that already have
- //
- if (gEfiShellProtocol->GetMapFromDevicePath(&DevicePathList[Count]) != NULL) {
- continue;
- }
- //
- // Get default name
- //
- NewDefaultName = ShellCommandCreateNewMappingName(MappingTypeFileSystem);
- ASSERT(NewDefaultName != NULL);
-
- //
- // Call shell protocol SetMap function now...
- //
- Status = gEfiShellProtocol->SetMap(DevicePathList[Count], NewDefaultName);
-
- if (!EFI_ERROR(Status)) {
- //
- // Now do consistent name
- //
- NewConsistName = ShellCommandConsistMappingGenMappingName(DevicePathList[Count], ConsistMappingTable);
- if (NewConsistName != NULL) {
- Status = gEfiShellProtocol->SetMap(DevicePathList[Count], NewConsistName);
- FreePool(NewConsistName);
- }
- }
-
- FreePool(NewDefaultName);
- }
- ShellCommandConsistMappingUnInitialize(ConsistMappingTable);
- SHELL_FREE_NON_NULL(HandleList);
- SHELL_FREE_NON_NULL(DevicePathList);
-
- HandleList = NULL;
- } else {
- Count = (UINTN)-1;
- }
- //
- // Do it all over again for gEfiBlockIoProtocolGuid
- //
-
- return (Status);
-}
-
-/**
- Determine what type of device is represented and return it's string. The
- string is in allocated memory and must be callee freed. The HII is is listed below.
- The actual string cannot be determined.
-
- @param[in] DevicePath The device to analyze.
-
- @retval STR_MAP_MEDIA_UNKNOWN The media type is unknown.
- @retval STR_MAP_MEDIA_HARDDISK The media is a hard drive.
- @retval STR_MAP_MEDIA_CDROM The media is a CD ROM.
- @retval STR_MAP_MEDIA_FLOPPY The media is a floppy drive.
-**/
-CHAR16*
-EFIAPI
-GetDeviceMediaType (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- ACPI_HID_DEVICE_PATH *Acpi;
-
- //
- // Parse the device path:
- // Devicepath sub type mediatype
- // MEDIA_HANRDDRIVE_DP -> Hard Disk
- // MEDIA_CDROM_DP -> CD Rom
- // Acpi.HID = 0X0604 -> Floppy
- //
- if (NULL == DevicePath) {
- return HiiGetString(gShellLevel2HiiHandle, STRING_TOKEN(STR_MAP_MEDIA_UNKNOWN), NULL);
- }
-
- for (;!IsDevicePathEndType (DevicePath) ;DevicePath = NextDevicePathNode (DevicePath)) {
- if (DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) {
- switch (DevicePathSubType (DevicePath)) {
- case MEDIA_HARDDRIVE_DP:
- return HiiGetString(gShellLevel2HiiHandle, STRING_TOKEN(STR_MAP_MEDIA_HARDDISK), NULL);
- case MEDIA_CDROM_DP:
- return HiiGetString(gShellLevel2HiiHandle, STRING_TOKEN(STR_MAP_MEDIA_CDROM), NULL);
- }
- } else if (DevicePathType (DevicePath) == ACPI_DEVICE_PATH) {
- Acpi = (ACPI_HID_DEVICE_PATH *) DevicePath;
- if (EISA_ID_TO_NUM (Acpi->HID) == 0x0604) {
- return HiiGetString(gShellLevel2HiiHandle, STRING_TOKEN(STR_MAP_MEDIA_FLOPPY), NULL);
- }
- }
- }
-
- return HiiGetString(gShellLevel2HiiHandle, STRING_TOKEN(STR_MAP_MEDIA_UNKNOWN), NULL);
-}
-
-/**
- Function to detemine if a handle has removable storage.
-
- @param[in] DevicePath DevicePath to test.
-
- @retval TRUE The handle has removable storage.
- @retval FALSE The handle does not have removable storage.
-**/
-BOOLEAN
-EFIAPI
-IsRemoveableDevice (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- if (NULL == DevicePath) {
- return FALSE;
- }
-
- while (!IsDevicePathEndType (DevicePath)) {
- if (DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) {
- switch (DevicePathSubType (DevicePath)) {
- case MSG_USB_DP:
- case MSG_SCSI_DP:
- return TRUE;
- default:
- return FALSE;
- }
- }
- DevicePath = NextDevicePathNode (DevicePath);
- }
- return FALSE;
-}
-
-/**
- Function to detemine if a something on the map list matches.
-
- @param[in] MapList The pointer to the list to test.
- @param[in] Specific The pointer to a specific name to test for.
- @param[in] TypeString The pointer to the list of types.
- @param[in] Normal Always show normal mappings.
- @param[in] Consist Always show consistent mappings.
-
- @retval TRUE The map should be displayed.
- @retval FALSE The map should not be displayed.
-**/
-BOOLEAN
-EFIAPI
-MappingListHasType(
- IN CONST CHAR16 *MapList,
- IN CONST CHAR16 *Specific,
- IN CONST CHAR16 *TypeString,
- IN CONST BOOLEAN Normal,
- IN CONST BOOLEAN Consist
- )
-{
- CHAR16 *NewSpecific;
- //
- // specific has priority
- //
- if (Specific != NULL) {
- NewSpecific = AllocateZeroPool(StrSize(Specific) + sizeof(CHAR16));
- if (NewSpecific == NULL){
- return FALSE;
- }
- StrCpy(NewSpecific, Specific);
- if (NewSpecific[StrLen(NewSpecific)-1] != L':') {
- StrCat(NewSpecific, L":");
- }
-
- if (SearchList(MapList, NewSpecific, NULL, TRUE, FALSE, L";")) {
- FreePool(NewSpecific);
- return (TRUE);
- }
- FreePool(NewSpecific);
- }
- if ( Consist
- && (SearchList(MapList, L"HD*", NULL, TRUE, TRUE, L";")
- ||SearchList(MapList, L"CD*", NULL, TRUE, TRUE, L";")
- ||SearchList(MapList, L"F*", NULL, TRUE, TRUE, L";")
- ||SearchList(MapList, L"FP*", NULL, TRUE, TRUE, L";"))){
- return (TRUE);
- }
-
- if ( Normal
- && (SearchList(MapList, L"FS", NULL, FALSE, TRUE, L";")
- ||SearchList(MapList, L"BLK", NULL, FALSE, TRUE, L";"))){
- return (TRUE);
- }
-
- if (TypeString != NULL && SearchList(MapList, TypeString, NULL, TRUE, TRUE, L";")) {
- return (TRUE);
- }
- return (FALSE);
-}
-
-
-/**
- Display a single map line for device Handle if conditions are met.
-
- @param[in] Verbose TRUE to display (extra) verbose information.
- @param[in] Consist TRUE to display consistent mappings.
- @param[in] Normal TRUE to display normal (not consist) mappings.
- @param[in] TypeString pointer to string of filter types.
- @param[in] SFO TRUE to display output in Standard Output Format.
- @param[in] Specific pointer to string for specific map to display.
- @param[in] Handle The handle to display from.
-
- @retval EFI_SUCCESS The mapping was displayed.
-**/
-EFI_STATUS
-EFIAPI
-PerformSingleMappingDisplay(
- IN CONST BOOLEAN Verbose,
- IN CONST BOOLEAN Consist,
- IN CONST BOOLEAN Normal,
- IN CONST CHAR16 *TypeString,
- IN CONST BOOLEAN SFO,
- IN CONST CHAR16 *Specific OPTIONAL,
- IN CONST EFI_HANDLE Handle
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- EFI_DEVICE_PATH_PROTOCOL *DevPathCopy;
- CONST CHAR16 *MapList;
- CHAR16 *CurrentName;
- CHAR16 *MediaType;
- CHAR16 *DevPathString;
- CHAR16 *TempSpot;
- UINTN TempLen;
- BOOLEAN Removable;
- CONST CHAR16 *TempSpot2;
-
- DevPath = DevicePathFromHandle(Handle);
- DevPathCopy = DevPath;
- MapList = gEfiShellProtocol->GetMapFromDevicePath(&DevPathCopy);
- if (MapList == NULL) {
- return EFI_NOT_FOUND;
- }
-
- if (!MappingListHasType(MapList, Specific, TypeString, Normal, Consist)){
- return EFI_NOT_FOUND;
- }
-
- CurrentName = NULL;
- CurrentName = StrnCatGrow(&CurrentName, 0, MapList, 0);
- if (CurrentName == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- TempSpot = StrStr(CurrentName, L";");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
- if (!SFO) {
- TempLen = StrLen(CurrentName);
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_MAP_ENTRY),
- gShellLevel2HiiHandle,
- CurrentName,
- TempLen < StrLen(MapList)?MapList + TempLen+1:L"",
- DevPathString
- );
- if (Verbose) {
- //
- // also print handle, media type, removable (y/n), and current directory
- //
- MediaType = GetDeviceMediaType(DevPath);
- if ((TypeString != NULL &&MediaType != NULL && StrStr(TypeString, MediaType) != NULL) || TypeString == NULL) {
- Removable = IsRemoveableDevice(DevPath);
- TempSpot2 = ShellGetCurrentDir(CurrentName);
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_MAP_ENTRY_VERBOSE),
- gShellLevel2HiiHandle,
- ConvertHandleToHandleIndex(Handle),
- MediaType,
- Removable?L"Yes":L"No",
- TempSpot2
- );
- }
- FreePool(MediaType);
- }
- } else {
- TempLen = StrLen(CurrentName);
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_MAP_SFO_MAPPINGS),
- gShellLevel2HiiHandle,
- CurrentName,
- DevPathString,
- TempLen < StrLen(MapList)?MapList + TempLen+1:L""
- );
- }
- FreePool(DevPathString);
- FreePool(CurrentName);
- return EFI_SUCCESS;
-}
-
-/**
- Delete Specific from the list of maps for device Handle.
-
- @param[in] Specific The name to delete.
- @param[in] Handle The device to look on.
-
- @retval EFI_SUCCESS The delete was successful.
- @retval EFI_NOT_FOUND Name was not a map on Handle.
-**/
-EFI_STATUS
-EFIAPI
-PerformSingleMappingDelete(
- IN CONST CHAR16 *Specific,
- IN CONST EFI_HANDLE Handle
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- EFI_DEVICE_PATH_PROTOCOL *DevPathCopy;
- CONST CHAR16 *MapList;
- CHAR16 *CurrentName;
-
- DevPath = DevicePathFromHandle(Handle);
- DevPathCopy = DevPath;
- MapList = gEfiShellProtocol->GetMapFromDevicePath(&DevPathCopy);
- CurrentName = NULL;
-
- if (MapList == NULL) {
- return (EFI_NOT_FOUND);
- }
- //
- // if there is a specific and its not on the list...
- //
- if (!SearchList(MapList, Specific, &CurrentName, TRUE, FALSE, L";")) {
- return (EFI_NOT_FOUND);
- }
- return (gEfiShellProtocol->SetMap(NULL, CurrentName));
-}
-
-CONST CHAR16 Cd[] = L"cd*";
-CONST CHAR16 Hd[] = L"hd*";
-CONST CHAR16 Fp[] = L"fp*";
-CONST CHAR16 AnyF[] = L"F*";
-/**
- Function to display mapping information to the user.
-
- If Specific is specified then Consist and Normal will be ignored since information will
- be printed for the specific item only.
-
- @param[in] Verbose TRUE to display (extra) verbose information.
- @param[in] Consist TRUE to display consistent mappings.
- @param[in] Normal TRUE to display normal (not consist) mappings.
- @param[in] TypeString Pointer to string of filter types.
- @param[in] SFO TRUE to display output in Standard Output Format.
- @param[in] Specific Pointer to string for specific map to display.
- @param[in] Header TRUE to print the header block.
-
- @retval SHELL_SUCCESS The display was printed.
- @retval SHELL_INVALID_PARAMETER One of Consist or Normal must be TRUE if no Specific.
-
-**/
-SHELL_STATUS
-EFIAPI
-PerformMappingDisplay(
- IN CONST BOOLEAN Verbose,
- IN CONST BOOLEAN Consist,
- IN CONST BOOLEAN Normal,
- IN CONST CHAR16 *TypeString,
- IN CONST BOOLEAN SFO,
- IN CONST CHAR16 *Specific OPTIONAL,
- IN CONST BOOLEAN Header
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *HandleBuffer;
- UINTN BufferSize;
- UINTN LoopVar;
- CHAR16 *Test;
- BOOLEAN Found;
-
- if (!Consist && !Normal && Specific == NULL && TypeString == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle);
- return (SHELL_INVALID_PARAMETER);
- }
-
- if (TypeString != NULL) {
- Test = (CHAR16*)Cd;
- if (StrnCmp(TypeString, Test, StrLen(Test)-1) != 0) {
- Test = (CHAR16*)Hd;
- if (StrnCmp(TypeString, Test, StrLen(Test)-1) != 0) {
- Test = (CHAR16*)Fp;
- if (StrnCmp(TypeString, Test, StrLen(Test)-1) != 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, TypeString);
- return (SHELL_INVALID_PARAMETER);
- }
- } else if (Test == NULL) {
- Test = (CHAR16*)AnyF;
- }
- }
- } else {
- Test = NULL;
- }
-
- if (Header) {
- //
- // Print the header
- //
- if (!SFO) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MAP_HEADER), gShellLevel2HiiHandle);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_SFO_HEADER), gShellLevel2HiiHandle, L"map");
- }
- }
-
- BufferSize = 0;
- HandleBuffer = NULL;
-
- //
- // Look up all SimpleFileSystems in the platform
- //
- Status = gBS->LocateHandle(
- ByProtocol,
- &gEfiSimpleFileSystemProtocolGuid,
- NULL,
- &BufferSize,
- HandleBuffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- HandleBuffer = AllocateZeroPool(BufferSize);
- if (HandleBuffer == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- Status = gBS->LocateHandle(
- ByProtocol,
- &gEfiSimpleFileSystemProtocolGuid,
- NULL,
- &BufferSize,
- HandleBuffer);
- }
-
- //
- // Get the map name(s) for each one.
- //
- for ( LoopVar = 0, Found = FALSE
- ; LoopVar < (BufferSize / sizeof(EFI_HANDLE)) && HandleBuffer != NULL
- ; LoopVar ++
- ){
- Status = PerformSingleMappingDisplay(
- Verbose,
- Consist,
- Normal,
- Test,
- SFO,
- Specific,
- HandleBuffer[LoopVar]);
- if (!EFI_ERROR(Status)) {
- Found = TRUE;
- }
- }
-
- //
- // Look up all BlockIo in the platform
- //
- Status = gBS->LocateHandle(
- ByProtocol,
- &gEfiBlockIoProtocolGuid,
- NULL,
- &BufferSize,
- HandleBuffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- SHELL_FREE_NON_NULL(HandleBuffer);
- HandleBuffer = AllocateZeroPool(BufferSize);
- if (HandleBuffer == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- Status = gBS->LocateHandle(
- ByProtocol,
- &gEfiBlockIoProtocolGuid,
- NULL,
- &BufferSize,
- HandleBuffer);
- }
- if (!EFI_ERROR(Status) && HandleBuffer != NULL) {
- //
- // Get the map name(s) for each one.
- //
- for ( LoopVar = 0
- ; LoopVar < BufferSize / sizeof(EFI_HANDLE)
- ; LoopVar ++
- ){
- //
- // Skip any that were already done...
- //
- if (gBS->OpenProtocol(
- HandleBuffer[LoopVar],
- &gEfiSimpleFileSystemProtocolGuid,
- NULL,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL) == EFI_SUCCESS) {
- continue;
- }
- Status = PerformSingleMappingDisplay(
- Verbose,
- Consist,
- Normal,
- Test,
- SFO,
- Specific,
- HandleBuffer[LoopVar]);
- if (!EFI_ERROR(Status)) {
- Found = TRUE;
- }
- }
- FreePool(HandleBuffer);
- }
- if (!Found) {
- if (Specific != NULL) {
- ShellPrintHiiEx(gST->ConOut->Mode->CursorColumn, gST->ConOut->Mode->CursorRow-1, NULL, STRING_TOKEN (STR_MAP_NF), gShellLevel2HiiHandle, Specific);
- } else {
- ShellPrintHiiEx(gST->ConOut->Mode->CursorColumn, gST->ConOut->Mode->CursorRow-1, NULL, STRING_TOKEN (STR_CD_NF), gShellLevel2HiiHandle);
- }
- }
- return (SHELL_SUCCESS);
-}
-
-/**
- Perform a mapping display and parse for multiple types in the TypeString.
-
- @param[in] Verbose TRUE to use verbose output.
- @param[in] Consist TRUE to display consistent names.
- @param[in] Normal TRUE to display normal names.
- @param[in] TypeString An optional comma-delimited list of types.
- @param[in] SFO TRUE to display in SFO format. See Spec.
- @param[in] Specific An optional specific map name to display alone.
-
- @retval SHELL_INVALID_PARAMETER A parameter was invalid.
- @retval SHELL_SUCCESS The display was successful.
- @sa PerformMappingDisplay
-**/
-SHELL_STATUS
-EFIAPI
-PerformMappingDisplay2(
- IN CONST BOOLEAN Verbose,
- IN CONST BOOLEAN Consist,
- IN CONST BOOLEAN Normal,
- IN CONST CHAR16 *TypeString,
- IN CONST BOOLEAN SFO,
- IN CONST CHAR16 *Specific OPTIONAL
- )
-{
- CONST CHAR16 *TypeWalker;
- SHELL_STATUS ShellStatus;
- CHAR16 *Comma;
-
-
- if (TypeString == NULL) {
- return (PerformMappingDisplay(Verbose, Consist, Normal, NULL, SFO, Specific, TRUE));
- }
- ShellStatus = SHELL_SUCCESS;
- for (TypeWalker = TypeString ; TypeWalker != NULL && *TypeWalker != CHAR_NULL ;) {
- Comma = StrStr(TypeWalker, L",");
- if (Comma == NULL) {
- if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = PerformMappingDisplay(Verbose, Consist, Normal, TypeWalker, SFO, Specific, (BOOLEAN)(TypeWalker == TypeString));
- } else {
- PerformMappingDisplay(Verbose, Consist, Normal, TypeWalker, SFO, Specific, (BOOLEAN)(TypeWalker == TypeString));
- }
- break;
- } else {
- *Comma = CHAR_NULL;
- if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = PerformMappingDisplay(Verbose, Consist, Normal, TypeWalker, SFO, Specific, (BOOLEAN)(TypeWalker == TypeString));
- } else {
- PerformMappingDisplay(Verbose, Consist, Normal, TypeWalker, SFO, Specific, (BOOLEAN)(TypeWalker == TypeString));
- }
- *Comma = L',';
- TypeWalker = Comma + 1;
- }
- }
-
- return (ShellStatus);
-}
-
-/**
- Delete a specific map.
-
- @param[in] Specific The pointer to the name of the map to delete.
-
- @retval EFI_INVALID_PARAMETER Specific was NULL.
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_NOT_FOUND Specific could not be found.
-**/
-EFI_STATUS
-EFIAPI
-PerformMappingDelete(
- IN CONST CHAR16 *Specific
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *HandleBuffer;
- UINTN BufferSize;
- UINTN LoopVar;
- BOOLEAN Deleted;
-
- if (Specific == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- BufferSize = 0;
- HandleBuffer = NULL;
- Deleted = FALSE;
-
- //
- // Look up all SimpleFileSystems in the platform
- //
- Status = gBS->LocateHandle(
- ByProtocol,
- &gEfiDevicePathProtocolGuid,
- NULL,
- &BufferSize,
- HandleBuffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- HandleBuffer = AllocateZeroPool(BufferSize);
- if (HandleBuffer == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- Status = gBS->LocateHandle(
- ByProtocol,
- &gEfiDevicePathProtocolGuid,
- NULL,
- &BufferSize,
- HandleBuffer);
- }
- if (EFI_ERROR(Status)) {
- SHELL_FREE_NON_NULL(HandleBuffer);
- return (Status);
- }
-
- if (HandleBuffer != NULL) {
- //
- // Get the map name(s) for each one.
- //
- for ( LoopVar = 0
- ; LoopVar < BufferSize / sizeof(EFI_HANDLE)
- ; LoopVar ++
- ){
- if (PerformSingleMappingDelete(Specific,HandleBuffer[LoopVar]) == SHELL_SUCCESS) {
- Deleted = TRUE;
- }
- }
- }
- //
- // Look up all BlockIo in the platform
- //
- Status = gBS->LocateHandle(
- ByProtocol,
- &gEfiBlockIoProtocolGuid,
- NULL,
- &BufferSize,
- HandleBuffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- FreePool(HandleBuffer);
- HandleBuffer = AllocateZeroPool(BufferSize);
- if (HandleBuffer == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- Status = gBS->LocateHandle(
- ByProtocol,
- &gEfiBlockIoProtocolGuid,
- NULL,
- &BufferSize,
- HandleBuffer);
- }
- if (EFI_ERROR(Status)) {
- SHELL_FREE_NON_NULL(HandleBuffer);
- return (Status);
- }
-
- if (HandleBuffer != NULL) {
- //
- // Get the map name(s) for each one.
- //
- for ( LoopVar = 0
- ; LoopVar < BufferSize / sizeof(EFI_HANDLE)
- ; LoopVar ++
- ){
- //
- // Skip any that were already done...
- //
- if (gBS->OpenProtocol(
- HandleBuffer[LoopVar],
- &gEfiDevicePathProtocolGuid,
- NULL,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL) == EFI_SUCCESS) {
- continue;
- }
- if (PerformSingleMappingDelete(Specific,HandleBuffer[LoopVar]) == SHELL_SUCCESS) {
- Deleted = TRUE;
- }
- }
- }
- SHELL_FREE_NON_NULL(HandleBuffer);
- if (!Deleted) {
- return (EFI_NOT_FOUND);
- }
- return (EFI_SUCCESS);
-}
-
-/**
- function to add a mapping from mapping.
-
- This function will get the device path associated with the mapping and call SetMap.
-
- @param[in] Map The Map to add a mapping for
- @param[in] SName The name of the new mapping
-
- @retval SHELL_SUCCESS the mapping was added
- @retval SHELL_INVALID_PARAMETER the device path for Map could not be retrieved.
- @return Shell version of a return value from EfiShellProtocol->SetMap
-
-**/
-SHELL_STATUS
-EFIAPI
-AddMappingFromMapping(
- IN CONST CHAR16 *Map,
- IN CONST CHAR16 *SName
- )
-{
- CONST EFI_DEVICE_PATH_PROTOCOL *DevPath;
- EFI_STATUS Status;
- CHAR16 *NewSName;
-
- NewSName = AllocateZeroPool(StrSize(SName) + sizeof(CHAR16));
- if (NewSName == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- StrCpy(NewSName, SName);
- if (NewSName[StrLen(NewSName)-1] != L':') {
- StrCat(NewSName, L":");
- }
-
- if (!IsNumberLetterOnly(NewSName, StrLen(NewSName)-1)) {
- FreePool(NewSName);
- return (SHELL_INVALID_PARAMETER);
- }
-
- DevPath = gEfiShellProtocol->GetDevicePathFromMap(Map);
- if (DevPath == NULL) {
- FreePool(NewSName);
- return (SHELL_INVALID_PARAMETER);
- }
-
- Status = gEfiShellProtocol->SetMap(DevPath, NewSName);
- FreePool(NewSName);
- if (EFI_ERROR(Status)) {
- return (SHELL_DEVICE_ERROR);
- }
- return (SHELL_SUCCESS);
-}
-
-/**
- function to add a mapping from an EFI_HANDLE.
-
- This function will get the device path associated with the Handle and call SetMap.
-
- @param[in] Handle The handle to add a mapping for
- @param[in] SName The name of the new mapping
-
- @retval SHELL_SUCCESS the mapping was added
- @retval SHELL_INVALID_PARAMETER SName was not valid for a map name.
- @return Shell version of a return value from either
- gBS->OpenProtocol or EfiShellProtocol->SetMap
-
-**/
-SHELL_STATUS
-EFIAPI
-AddMappingFromHandle(
- IN CONST EFI_HANDLE Handle,
- IN CONST CHAR16 *SName
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- EFI_STATUS Status;
- CHAR16 *NewSName;
-
- NewSName = AllocateZeroPool(StrSize(SName) + sizeof(CHAR16));
- if (NewSName == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- StrCpy(NewSName, SName);
- if (NewSName[StrLen(NewSName)-1] != L':') {
- StrCat(NewSName, L":");
- }
-
- if (!IsNumberLetterOnly(NewSName, StrLen(NewSName)-1)) {
- FreePool(NewSName);
- return (SHELL_INVALID_PARAMETER);
- }
-
- Status = gBS->OpenProtocol(
- Handle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&DevPath,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR(Status)) {
- FreePool(NewSName);
- return (SHELL_DEVICE_ERROR);
- }
- Status = gEfiShellProtocol->SetMap(DevPath, NewSName);
- FreePool(NewSName);
- if (EFI_ERROR(Status)) {
- return (SHELL_DEVICE_ERROR);
- }
- return (SHELL_SUCCESS);
-}
-
-STATIC CONST SHELL_PARAM_ITEM MapParamList[] = {
- {L"-d", TypeValue},
- {L"-r", TypeFlag},
- {L"-v", TypeFlag},
- {L"-c", TypeFlag},
- {L"-f", TypeFlag},
- {L"-u", TypeFlag},
- {L"-t", TypeValue},
- {L"-sfo", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'map' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMap (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- CONST CHAR16 *SName;
- CONST CHAR16 *Mapping;
- EFI_HANDLE MapAsHandle;
- CONST EFI_DEVICE_PATH_PROTOCOL *DevPath;
- SHELL_STATUS ShellStatus;
- BOOLEAN SfoMode;
- BOOLEAN ConstMode;
- BOOLEAN NormlMode;
- CONST CHAR16 *Param1;
- CONST CHAR16 *TypeString;
- UINTN TempStringLength;
-
- ProblemParam = NULL;
- Mapping = NULL;
- SName = NULL;
- DevPath = NULL;
- ShellStatus = SHELL_SUCCESS;
- MapAsHandle = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (MapParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- SfoMode = ShellCommandLineGetFlag(Package, L"-sfo");
- ConstMode = ShellCommandLineGetFlag(Package, L"-c");
- NormlMode = ShellCommandLineGetFlag(Package, L"-f");
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 3) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Deleting a map name...
- //
- if (ShellCommandLineGetFlag(Package, L"-d")) {
- if ( ShellCommandLineGetFlag(Package, L"-r")
- || ShellCommandLineGetFlag(Package, L"-v")
- || ConstMode
- || NormlMode
- || ShellCommandLineGetFlag(Package, L"-u")
- || ShellCommandLineGetFlag(Package, L"-t")
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- SName = ShellCommandLineGetValue(Package, L"-d");
- if (SName != NULL) {
- Status = PerformMappingDelete(SName);
- if (EFI_ERROR(Status)) {
- switch (Status) {
- case EFI_ACCESS_DENIED:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel2HiiHandle);
- ShellStatus = SHELL_ACCESS_DENIED;
- break;
- case EFI_NOT_FOUND:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MAP_NF), gShellLevel2HiiHandle, SName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- break;
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, Status);
- ShellStatus = SHELL_UNSUPPORTED;
- }
- }
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- } else if ( ShellCommandLineGetFlag(Package, L"-r")
-// || ShellCommandLineGetFlag(Package, L"-v")
- || ConstMode
- || NormlMode
- || ShellCommandLineGetFlag(Package, L"-u")
- || ShellCommandLineGetFlag(Package, L"-t")
- ){
- if ( ShellCommandLineGetFlag(Package, L"-r")) {
- //
- // Do the reset
- //
- Status = ShellCommandCreateInitialMappingsAndPaths();
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, Status);
- ShellStatus = SHELL_UNSUPPORTED;
- }
- }
- if ( ShellStatus == SHELL_SUCCESS && ShellCommandLineGetFlag(Package, L"-u")) {
- //
- // Do the Update
- //
- Status = UpdateMapping();
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, Status);
- ShellStatus = SHELL_UNSUPPORTED;
- }
- }
- if (ShellStatus == SHELL_SUCCESS) {
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- TypeString = ShellCommandLineGetValue(Package, L"-t");
- if (!ConstMode
- &&!NormlMode
- &&TypeString == NULL
- ) {
- //
- // now do the display...
- //
- ShellStatus = PerformMappingDisplay(
- ShellCommandLineGetFlag(Package, L"-v"),
- TRUE,
- TRUE,
- NULL,
- SfoMode,
- Param1,
- TRUE
- );
- } else {
- //
- // now do the display...
- //
- ShellStatus = PerformMappingDisplay2(
- ShellCommandLineGetFlag(Package, L"-v"),
- ConstMode,
- NormlMode,
- TypeString,
- SfoMode,
- Param1
- );
- }
- }
- } else {
- //
- // adding or displaying (there were no flags)
- //
- SName = ShellCommandLineGetRawValue(Package, 1);
- Mapping = ShellCommandLineGetRawValue(Package, 2);
- if ( SName == NULL
- && Mapping == NULL
- ){
- //
- // display only since no flags
- //
- ShellStatus = PerformMappingDisplay(
- ShellCommandLineGetFlag(Package, L"-v"),
- TRUE,
- TRUE,
- NULL,
- SfoMode,
- NULL,
- TRUE
- );
- } else if ( SName == NULL
- || Mapping == NULL
- ){
- //
- // Display only the one specified
- //
- ShellStatus = PerformMappingDisplay(
- FALSE,
- FALSE,
- FALSE,
- NULL,
- SfoMode,
- SName, // note the variable here...
- TRUE
- );
- } else {
- if (ShellIsHexOrDecimalNumber(Mapping, TRUE, FALSE)) {
- MapAsHandle = ConvertHandleIndexToHandle(ShellStrToUintn(Mapping));
- } else {
- MapAsHandle = NULL;
- }
- if (MapAsHandle == NULL && Mapping[StrLen(Mapping)-1] != L':') {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, Mapping);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (MapAsHandle != NULL) {
- TempStringLength = StrLen(SName);
- if (!IsNumberLetterOnly(SName, TempStringLength-(SName[TempStringLength-1]==L':'?1:0))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, SName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ShellStatus = AddMappingFromHandle(MapAsHandle, SName);
- }
- } else {
- TempStringLength = StrLen(SName);
- if (!IsNumberLetterOnly(SName, TempStringLength-(SName[TempStringLength-1]==L':'?1:0))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, SName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ShellStatus = AddMappingFromMapping(Mapping, SName);
- }
- }
- if (ShellStatus != SHELL_SUCCESS) {
- switch (ShellStatus) {
- case SHELL_ACCESS_DENIED:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel2HiiHandle);
- break;
- case SHELL_INVALID_PARAMETER:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle);
- break;
- case SHELL_DEVICE_ERROR:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MAP_NOF), gShellLevel2HiiHandle, Mapping);
- break;
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, ShellStatus|MAX_BIT);
- }
- } else {
- //
- // now do the display...
- //
- ShellStatus = PerformMappingDisplay(
- FALSE,
- FALSE,
- FALSE,
- NULL,
- SfoMode,
- SName,
- TRUE
- );
- } // we were sucessful so do an output
- } // got a valid map target
- } // got 2 variables
- } // we are adding a mapping
- } // got valid parameters
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c
deleted file mode 100644
index 421bd55d6f..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/** @file
- Main file for attrib shell level 2 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-/**
- Function for 'mkdir' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMkDir (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- CONST CHAR16 *NewDirName;
- UINTN DirCreateCount;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_FILE_HANDLE FileHandle;
- SHELL_STATUS ShellStatus;
-
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
-
- //
- // create a set of directories
- //
- if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // we didnt get a single parameter
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- for ( DirCreateCount = 1
- ;
- ; DirCreateCount++
- ){
- //
- // loop through each directory specified
- //
-
- NewDirName = ShellCommandLineGetRawValue(Package, DirCreateCount);
- if (NewDirName == NULL) {
- break;
- }
- //
- // check if that already exists... if yes fail
- //
- FileHandle = NULL;
- Status = ShellOpenFileByName(NewDirName,
- &FileHandle,
- EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE,
- EFI_FILE_DIRECTORY
- );
- if (!EFI_ERROR(Status)) {
- ShellCloseFile(&FileHandle);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MKDIR_ALREADY), gShellLevel2HiiHandle, NewDirName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- break;
- } else {
- ASSERT(FileHandle == NULL);
- //
- // create the directory named NewDirName
- //
- Status = ShellCreateDirectory(NewDirName, &FileHandle);
- if (FileHandle != NULL) {
- gEfiShellProtocol->CloseFile(FileHandle);
- }
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MKDIR_CREATEFAIL), gShellLevel2HiiHandle, NewDirName);
- ShellStatus = SHELL_ACCESS_DENIED;
- break;
- }
- }
- }
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
deleted file mode 100644
index 541e782925..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
+++ /dev/null
@@ -1,570 +0,0 @@
-/** @file
- Main file for mv shell level 2 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-/**
- Function to validate that moving a specific file (FileName) to a specific
- location (DestPath) is valid.
-
- This function will verify that the destination is not a subdirectory of
- FullName, that the Current working Directory is not being moved, and that
- the directory is not read only.
-
- if the move is invalid this function will report the error to StdOut.
-
- @param FullName [in] The name of the file to move.
- @param Cwd [in] The current working directory
- @param DestPath [in] The target location to move to
- @param Attribute[in] The Attribute of the file
-
- @retval TRUE The move is valid
- @retval FALSE The move is not
-**/
-BOOLEAN
-EFIAPI
-IsValidMove(
- IN CONST CHAR16 *FullName,
- IN CONST CHAR16 *Cwd,
- IN CONST CHAR16 *DestPath,
- IN CONST UINT64 Attribute
- )
-{
- CHAR16 *Test;
- CHAR16 *Test1;
- CHAR16 *TestWalker;
- INTN Result;
- UINTN TempLen;
- if (Cwd != NULL && StrCmp(FullName, Cwd) == 0) {
- //
- // Invalid move
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MV_INV_CWD), gShellLevel2HiiHandle);
- return (FALSE);
- }
- Test = NULL;
- Test = StrnCatGrow(&Test, NULL, DestPath, 0);
- TestWalker = Test;
- ASSERT(TestWalker != NULL);
- while(*TestWalker == L'\\') {
- TestWalker++;
- }
- while(TestWalker != NULL && TestWalker[StrLen(TestWalker)-1] == L'\\') {
- TestWalker[StrLen(TestWalker)-1] = CHAR_NULL;
- }
- ASSERT(TestWalker != NULL);
- ASSERT(FullName != NULL);
- if (StrStr(FullName, TestWalker) != 0) {
- TempLen = StrLen(FullName);
- if (StrStr(FullName, TestWalker) != FullName // not the first items... (could below it)
- && TempLen <= (StrLen(TestWalker) + 1)
- && StrStr(FullName+StrLen(TestWalker) + 1, L"\\") == NULL) {
- //
- // Invalid move
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MV_INV_SUB), gShellLevel2HiiHandle);
- FreePool(Test);
- return (FALSE);
- }
- }
- FreePool(Test);
- if (StrStr(DestPath, FullName) != 0 && StrStr(DestPath, FullName) != DestPath) {
- //
- // Invalid move
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MV_INV_SUB), gShellLevel2HiiHandle);
- return (FALSE);
- }
- if ((Attribute & EFI_FILE_READ_ONLY) != 0) {
- //
- // invalid to move read only
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MV_INV_RO), gShellLevel2HiiHandle);
- return (FALSE);
- }
- Test = StrStr(FullName, L":");
- Test1 = StrStr(DestPath, L":");
- if (Test1 != NULL && Test != NULL) {
- *Test = CHAR_NULL;
- *Test1 = CHAR_NULL;
- Result = StringNoCaseCompare(&FullName, &DestPath);
- *Test = L':';
- *Test1 = L':';
- if (Result != 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MV_INV_FS), gShellLevel2HiiHandle);
- return (FALSE);
- }
- }
- return (TRUE);
-}
-
-/**
- Function to take a destination path that might contain wildcards and verify
- that there is only a single possible target (IE we cant have wildcards that
- have 2 possible destination).
-
- if the result is sucessful the caller must free *DestPathPointer.
-
- @param[in] DestDir The original path to the destination.
- @param[in, out] DestPathPointer A pointer to the callee allocated final path.
- @param[in] Cwd A pointer to the current working directory.
-
- @retval SHELL_INVALID_PARAMETER The DestDir could not be resolved to a location.
- @retval SHELL_INVALID_PARAMETER The DestDir could be resolved to more than 1 location.
- @retval SHELL_INVALID_PARAMETER Cwd is required and is NULL.
- @retval SHELL_SUCCESS The operation was sucessful.
-**/
-SHELL_STATUS
-EFIAPI
-GetDestinationLocation(
- IN CONST CHAR16 *DestDir,
- IN OUT CHAR16 **DestPathPointer,
- IN CONST CHAR16 *Cwd
- )
-{
- EFI_SHELL_FILE_INFO *DestList;
- EFI_SHELL_FILE_INFO *Node;
- EFI_STATUS Status;
- CHAR16 *DestPath;
- CHAR16 *TempLocation;
- UINTN NewSize;
-
- DestList = NULL;
- DestPath = NULL;
-
- if (StrStr(DestDir, L"\\") == DestDir) {
- if (Cwd == NULL) {
- return SHELL_INVALID_PARAMETER;
- }
- DestPath = AllocateZeroPool(StrSize(Cwd));
- if (DestPath == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- StrCpy(DestPath, Cwd);
- while (PathRemoveLastItem(DestPath)) ;
- *DestPathPointer = DestPath;
- return (SHELL_SUCCESS);
- }
- //
- // get the destination path
- //
- Status = ShellOpenFileMetaArg((CHAR16*)DestDir, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ|EFI_FILE_MODE_CREATE, &DestList);
- if (DestList == NULL || IsListEmpty(&DestList->Link)) {
- //
- // Not existing... must be renaming
- //
- if ((TempLocation = StrStr(DestDir, L":")) == NULL) {
- if (Cwd == NULL) {
- ShellCloseFileMetaArg(&DestList);
- return (SHELL_INVALID_PARAMETER);
- }
- NewSize = StrSize(Cwd);
- NewSize += StrSize(DestDir);
- DestPath = AllocateZeroPool(NewSize);
- if (DestPath == NULL) {
- ShellCloseFileMetaArg(&DestList);
- return (SHELL_OUT_OF_RESOURCES);
- }
- StrCpy(DestPath, Cwd);
- if (DestPath[StrLen(DestPath)-1] != L'\\' && DestDir[0] != L'\\') {
- StrCat(DestPath, L"\\");
- } else if (DestPath[StrLen(DestPath)-1] == L'\\' && DestDir[0] == L'\\') {
- ((CHAR16*)DestPath)[StrLen(DestPath)-1] = CHAR_NULL;
- }
- StrCat(DestPath, DestDir);
- } else {
- ASSERT(DestPath == NULL);
- DestPath = StrnCatGrow(&DestPath, NULL, DestDir, 0);
- if (DestPath == NULL) {
- ShellCloseFileMetaArg(&DestList);
- return (SHELL_OUT_OF_RESOURCES);
- }
- }
- } else {
- Node = (EFI_SHELL_FILE_INFO*)GetFirstNode(&DestList->Link);
- //
- // Make sure there is only 1 node in the list.
- //
- if (!IsNodeAtEnd(&DestList->Link, &Node->Link)) {
- ShellCloseFileMetaArg(&DestList);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MARG_ERROR), gShellLevel2HiiHandle, DestDir);
- return (SHELL_INVALID_PARAMETER);
- }
- if (ShellIsDirectory(Node->FullName)==EFI_SUCCESS) {
- DestPath = AllocateZeroPool(StrSize(Node->FullName)+sizeof(CHAR16));
- if (DestPath == NULL) {
- ShellCloseFileMetaArg(&DestList);
- return (SHELL_OUT_OF_RESOURCES);
- }
- StrCpy(DestPath, Node->FullName);
- StrCat(DestPath, L"\\");
- } else {
- //
- // cant move onto another file.
- //
- ShellCloseFileMetaArg(&DestList);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_ERROR), gShellLevel2HiiHandle, DestDir);
- return (SHELL_INVALID_PARAMETER);
- }
- }
-
- *DestPathPointer = DestPath;
- ShellCloseFileMetaArg(&DestList);
-
- return (SHELL_SUCCESS);
-}
-
-/**
- function to take a list of files to move and a destination location and do
- the verification and moving of those files to that location. This function
- will report any errors to the user and continue to move the rest of the files.
-
- @param[in] FileList A LIST_ENTRY* based list of files to move
- @param[out] Resp pointer to response from question. Pass back on looped calling
- @param[in] DestDir the destination location
-
- @retval SHELL_SUCCESS the files were all moved.
- @retval SHELL_INVALID_PARAMETER a parameter was invalid
- @retval SHELL_SECURITY_VIOLATION a security violation ocurred
- @retval SHELL_WRITE_PROTECTED the destination was write protected
- @retval SHELL_OUT_OF_RESOURCES a memory allocation failed
-**/
-SHELL_STATUS
-EFIAPI
-ValidateAndMoveFiles(
- IN CONST EFI_SHELL_FILE_INFO *FileList,
- OUT VOID **Resp,
- IN CONST CHAR16 *DestDir
- )
-{
- EFI_STATUS Status;
- CHAR16 *HiiOutput;
- CHAR16 *HiiResultOk;
- CHAR16 *DestPath;
- CONST CHAR16 *Cwd;
- SHELL_STATUS ShellStatus;
- CONST EFI_SHELL_FILE_INFO *Node;
- EFI_FILE_INFO *NewFileInfo;
- CHAR16 *TempLocation;
- UINTN NewSize;
- UINTN Length;
- VOID *Response;
- SHELL_FILE_HANDLE DestHandle;
-
- ASSERT(FileList != NULL);
- ASSERT(DestDir != NULL);
-
- DestPath = NULL;
- Cwd = ShellGetCurrentDir(NULL);
- Response = *Resp;
-
- //
- // Get and validate the destination location
- //
- ShellStatus = GetDestinationLocation(DestDir, &DestPath, Cwd);
- if (ShellStatus != SHELL_SUCCESS) {
- return (ShellStatus);
- }
- DestPath = PathCleanUpDirectories(DestPath);
-
- HiiOutput = HiiGetString (gShellLevel2HiiHandle, STRING_TOKEN (STR_MV_OUTPUT), NULL);
- HiiResultOk = HiiGetString (gShellLevel2HiiHandle, STRING_TOKEN (STR_GEN_RES_OK), NULL);
- ASSERT (DestPath != NULL);
- ASSERT (HiiResultOk != NULL);
- ASSERT (HiiOutput != NULL);
-// ASSERT (Cwd != NULL);
-
- //
- // Go through the list of files and directories to move...
- //
- for (Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link)
- ; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&FileList->Link, &Node->Link)
- ){
- if (ShellGetExecutionBreakFlag()) {
- break;
- }
- ASSERT(Node->FileName != NULL);
- ASSERT(Node->FullName != NULL);
-
- //
- // skip the directory traversing stuff...
- //
- if (StrCmp(Node->FileName, L".") == 0 || StrCmp(Node->FileName, L"..") == 0) {
- continue;
- }
-
- //
- // Validate that the move is valid
- //
- if (!IsValidMove(Node->FullName, Cwd, DestPath, Node->Info->Attribute)) {
- ShellStatus = SHELL_INVALID_PARAMETER;
- continue;
- }
-
- //
- // Chop off map info from "DestPath"
- //
- if ((TempLocation = StrStr(DestPath, L":")) != NULL) {
- CopyMem(DestPath, TempLocation+1, StrSize(TempLocation+1));
- }
-
- //
- // construct the new file info block
- //
- NewSize = StrSize(DestPath);
- NewSize += StrSize(Node->FileName) + SIZE_OF_EFI_FILE_INFO + sizeof(CHAR16);
- NewFileInfo = AllocateZeroPool(NewSize);
- if (NewFileInfo == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellLevel2HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- } else {
- CopyMem(NewFileInfo, Node->Info, SIZE_OF_EFI_FILE_INFO);
- if (DestPath[0] != L'\\') {
- StrCpy(NewFileInfo->FileName, L"\\");
- StrCat(NewFileInfo->FileName, DestPath);
- } else {
- StrCpy(NewFileInfo->FileName, DestPath);
- }
- Length = StrLen(NewFileInfo->FileName);
- if (Length > 0) {
- Length--;
- }
- if (NewFileInfo->FileName[Length] == L'\\') {
- if (Node->FileName[0] == L'\\') {
- //
- // Don't allow for double slashes. Eliminate one of them.
- //
- NewFileInfo->FileName[Length] = CHAR_NULL;
- }
- StrCat(NewFileInfo->FileName, Node->FileName);
- }
- NewFileInfo->Size = SIZE_OF_EFI_FILE_INFO + StrSize(NewFileInfo->FileName);
- ShellPrintEx(-1, -1, HiiOutput, Node->FullName, NewFileInfo->FileName);
-
- if (!EFI_ERROR(ShellFileExists(NewFileInfo->FileName))) {
- if (Response == NULL) {
- ShellPromptForResponseHii(ShellPromptResponseTypeYesNoAllCancel, STRING_TOKEN (STR_GEN_DEST_EXIST_OVR), gShellLevel2HiiHandle, &Response);
- }
- switch (*(SHELL_PROMPT_RESPONSE*)Response) {
- case ShellPromptResponseNo:
- FreePool(NewFileInfo);
- continue;
- case ShellPromptResponseCancel:
- *Resp = Response;
- //
- // indicate to stop everything
- //
- FreePool(NewFileInfo);
- FreePool(DestPath);
- FreePool(HiiOutput);
- FreePool(HiiResultOk);
- return (SHELL_ABORTED);
- case ShellPromptResponseAll:
- *Resp = Response;
- break;
- case ShellPromptResponseYes:
- FreePool(Response);
- break;
- default:
- FreePool(Response);
- FreePool(NewFileInfo);
- FreePool(DestPath);
- FreePool(HiiOutput);
- FreePool(HiiResultOk);
- return SHELL_ABORTED;
- }
- Status = ShellOpenFileByName(NewFileInfo->FileName, &DestHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
- ShellDeleteFile(&DestHandle);
- }
-
-
- //
- // Perform the move operation
- //
- Status = ShellSetFileInfo(Node->Handle, NewFileInfo);
-
- //
- // Free the info object we used...
- //
- FreePool(NewFileInfo);
-
- //
- // Check our result
- //
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel2HiiHandle, Status);
- //
- // move failed
- //
- switch(Status){
- default:
- ShellStatus = SHELL_INVALID_PARAMETER;
- case EFI_SECURITY_VIOLATION:
- ShellStatus = SHELL_SECURITY_VIOLATION;
- case EFI_WRITE_PROTECTED:
- ShellStatus = SHELL_WRITE_PROTECTED;
- case EFI_OUT_OF_RESOURCES:
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- case EFI_DEVICE_ERROR:
- ShellStatus = SHELL_DEVICE_ERROR;
- case EFI_ACCESS_DENIED:
- ShellStatus = SHELL_ACCESS_DENIED;
- } // switch
- } else {
- ShellPrintEx(-1, -1, L"%s", HiiResultOk);
- }
- }
- } // for loop
-
- FreePool(DestPath);
- FreePool(HiiOutput);
- FreePool(HiiResultOk);
- return (ShellStatus);
-}
-
-/**
- Function for 'mv' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMv (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN ParamCount;
- UINTN LoopCounter;
- EFI_SHELL_FILE_INFO *FileList;
- VOID *Response;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- ParamCount = 0;
- FileList = NULL;
- Response = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
-
- switch (ParamCount = ShellCommandLineGetCount(Package)) {
- case 0:
- case 1:
- //
- // we have insufficient parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- break;
- case 2:
- //
- // must have valid CWD for single parameter...
- //
- if (ShellGetCurrentDir(NULL) == NULL){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, 1), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
- if (FileList == NULL || IsListEmpty(&FileList->Link) || EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, 1));
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- //
- // ValidateAndMoveFiles will report errors to the screen itself
- //
- ShellStatus = ValidateAndMoveFiles(FileList, &Response, ShellGetCurrentDir(NULL));
- }
- }
-
- break;
- default:
- ///@todo make sure this works with error half way through and continues...
- for (ParamCount--, LoopCounter = 1 ; LoopCounter < ParamCount ; LoopCounter++) {
- if (ShellGetExecutionBreakFlag()) {
- break;
- }
- Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, LoopCounter), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
- if (FileList == NULL || IsListEmpty(&FileList->Link) || EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, LoopCounter));
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- //
- // ValidateAndMoveFiles will report errors to the screen itself
- // Only change ShellStatus if it's sucessful
- //
- if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = ValidateAndMoveFiles(FileList, &Response, ShellCommandLineGetRawValue(Package, ParamCount));
- } else {
- ValidateAndMoveFiles(FileList, &Response, ShellCommandLineGetRawValue(Package, ParamCount));
- }
- }
- if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
- Status = ShellCloseFileMetaArg(&FileList);
- if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) {
- ShellStatus = SHELL_ACCESS_DENIED;
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_FILE), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, 1), ShellStatus|MAX_BIT);
- }
- }
- }
- break;
- } // switch on parameter count
-
- if (FileList != NULL) {
- ShellCloseFileMetaArg(&FileList);
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- SHELL_FREE_NON_NULL(Response);
-
- if (ShellGetExecutionBreakFlag()) {
- return (SHELL_ABORTED);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c
deleted file mode 100644
index 4072b9469d..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/** @file
- Main file for Parse shell level 2 function.
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-/**
- Do the actual parsing of the file. the file should be SFO output from a
- shell command or a similar format.
-
- @param[in] FileName The filename to open.
- @param[in] TableName The name of the table to find.
- @param[in] ColumnIndex The column number to get.
- @param[in] TableNameInstance Which instance of the table to get (row).
- @param[in] ShellCommandInstance Which instance of the command to get.
-
- @retval SHELL_NOT_FOUND The requested instance was not found.
- @retval SHELL_SUCCESS The operation was successful.
-**/
-SHELL_STATUS
-EFIAPI
-PerformParsing(
- IN CONST CHAR16 *FileName,
- IN CONST CHAR16 *TableName,
- IN CONST UINTN ColumnIndex,
- IN CONST UINTN TableNameInstance,
- IN CONST UINTN ShellCommandInstance
- )
-{
- SHELL_FILE_HANDLE FileHandle;
- EFI_STATUS Status;
- BOOLEAN Ascii;
- UINTN LoopVariable;
- UINTN ColumnLoop;
- CHAR16 *TempLine;
- CHAR16 *ColumnPointer;
- SHELL_STATUS ShellStatus;
- CHAR16 *TempSpot;
-
- ASSERT(FileName != NULL);
- ASSERT(TableName != NULL);
-
- ShellStatus = SHELL_SUCCESS;
-
- Status = ShellOpenFileByName(FileName, &FileHandle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, FileName);
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- for (LoopVariable = 0 ; LoopVariable < ShellCommandInstance && !ShellFileHandleEof(FileHandle);) {
- TempLine = ShellFileHandleReturnLine(FileHandle, &Ascii);
- if (TempLine == NULL) {
- break;
- }
- if (StrStr(TempLine, L"ShellCommand, \"") == TempLine) {
- LoopVariable++;
- }
- SHELL_FREE_NON_NULL(TempLine);
- }
- if (LoopVariable == ShellCommandInstance) {
- LoopVariable = 0;
- while(1) {
- TempLine = ShellFileHandleReturnLine(FileHandle, &Ascii);
- if ( TempLine == NULL
- || *TempLine == CHAR_NULL
- || StrStr(TempLine, L"ShellCommand, \"") == TempLine
- ){
- SHELL_FREE_NON_NULL(TempLine);
- break;
- }
- if (StrStr(TempLine, TableName) == TempLine) {
- LoopVariable++;
- }
- if ( LoopVariable == TableNameInstance
- || (TableNameInstance == (UINTN)-1 && StrStr(TempLine, TableName) == TempLine)
- ){
- for (ColumnLoop = 1, ColumnPointer = TempLine; ColumnLoop < ColumnIndex && ColumnPointer != NULL && *ColumnPointer != CHAR_NULL; ColumnLoop++) {
- ColumnPointer = StrStr(ColumnPointer, L",");
- if (ColumnPointer != NULL && *ColumnPointer != CHAR_NULL){
- ColumnPointer++;
- }
- }
- if (ColumnLoop == ColumnIndex) {
- if (ColumnPointer == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"Column Index");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- TempSpot = StrStr(ColumnPointer, L",");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- while (ColumnPointer != NULL && *ColumnPointer != CHAR_NULL && ColumnPointer[0] == L' '){
- ColumnPointer++;
- }
- if (ColumnPointer != NULL && *ColumnPointer != CHAR_NULL && ColumnPointer[0] == L'\"'){
- ColumnPointer++;
- }
- if (ColumnPointer != NULL && *ColumnPointer != CHAR_NULL && ColumnPointer[StrLen(ColumnPointer)-1] == L'\"'){
- ColumnPointer[StrLen(ColumnPointer)-1] = CHAR_NULL;
- }
-
- ShellPrintEx(-1, -1, L"%s\r\n", ColumnPointer);
- }
- }
- }
- SHELL_FREE_NON_NULL(TempLine);
- }
- }
- }
- return (ShellStatus);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-i", TypeValue},
- {L"-s", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'parse' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunParse (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- CONST CHAR16 *FileName;
- CONST CHAR16 *TableName;
- CONST CHAR16 *ColumnString;
- SHELL_STATUS ShellStatus;
- UINTN ShellCommandInstance;
- UINTN TableNameInstance;
-
- ShellStatus = SHELL_SUCCESS;
- ProblemParam = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- if (ShellCommandLineGetCount(Package) < 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) > 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- FileName = ShellCommandLineGetRawValue(Package, 1);
- TableName = ShellCommandLineGetRawValue(Package, 2);
- ColumnString = ShellCommandLineGetRawValue(Package, 3);
-
- if (ShellCommandLineGetValue(Package, L"-i") == NULL) {
- TableNameInstance = (UINTN)-1;
- } else {
- TableNameInstance = ShellStrToUintn(ShellCommandLineGetValue(Package, L"-i"));
- }
- if (ShellCommandLineGetValue(Package, L"-s") == NULL) {
- ShellCommandInstance = 1;
- } else {
- ShellCommandInstance = ShellStrToUintn(ShellCommandLineGetValue(Package, L"-s"));
- }
-
- ShellStatus = PerformParsing(FileName, TableName, ShellStrToUintn(ColumnString), TableNameInstance, ShellCommandInstance);
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c
deleted file mode 100644
index ff9c9d6917..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/** @file
- Main file for attrib shell level 2 function.
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-STATIC CONST SHELL_PARAM_ITEM ResetParamList[] = {
- {L"-w", TypeValue},
- {L"-s", TypeValue},
- {L"-c", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'reset' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunReset (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CONST CHAR16 *String;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
-
- ShellStatus = SHELL_SUCCESS;
- ProblemParam = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ResetParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- return (SHELL_INVALID_PARAMETER);
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // check for warm reset flag, then shutdown reset flag, then cold (default) reset flag
- //
- if (ShellCommandLineGetFlag(Package, L"-w")) {
- if (ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-c")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- String = ShellCommandLineGetValue(Package, L"-w");
- if (String != NULL) {
- gRT->ResetSystem(EfiResetWarm, EFI_SUCCESS, StrSize(String), (VOID*)String);
- } else {
- gRT->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
- }
- }
- } else if (ShellCommandLineGetFlag(Package, L"-s")) {
- if (ShellCommandLineGetFlag(Package, L"-c")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- String = ShellCommandLineGetValue(Package, L"-s");
- DEBUG_CODE(ShellPrintEx(-1,-1,L"Reset with %s (%d bytes)", String, String!=NULL?StrSize(String):0););
- if (String != NULL) {
- gRT->ResetSystem(EfiResetShutdown, EFI_SUCCESS, StrSize(String), (VOID*)String);
- } else {
- gRT->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
- }
- }
- } else {
- //
- // this is default so dont worry about flag...
- //
- String = ShellCommandLineGetValue(Package, L"-c");
- if (String != NULL) {
- gRT->ResetSystem(EfiResetCold, EFI_SUCCESS, StrSize(String), (VOID*)String);
- } else {
- gRT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
- }
- }
- }
- }
-
- //
- // we should never get here... so the free and return are for formality more than use
- // as the ResetSystem function should not return...
- //
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- //
- // return the status
- //
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
deleted file mode 100644
index d167b36fb4..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/** @file
- Main file for attrib shell level 2 function.
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-q", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Determine if a directory has no files in it.
-
- @param[in] FileHandle The EFI_HANDLE to the directory.
-
- @retval TRUE The directory has no files (or directories).
- @retval FALSE The directory has at least 1 file or directory in it.
-**/
-BOOLEAN
-EFIAPI
-IsDirectoryEmpty (
- IN EFI_HANDLE FileHandle
- )
-{
- EFI_STATUS Status;
- EFI_FILE_INFO *FileInfo;
- BOOLEAN NoFile;
- BOOLEAN RetVal;
-
- RetVal = TRUE;
- NoFile = FALSE;
-
- for (Status = FileHandleFindFirstFile(FileHandle, &FileInfo)
- ; !NoFile
- ; Status = FileHandleFindNextFile(FileHandle, FileInfo, &NoFile)
- ){
- if (StrStr(FileInfo->FileName, L".") != FileInfo->FileName
- &&StrStr(FileInfo->FileName, L"..") != FileInfo->FileName) {
- RetVal = FALSE;
- }
- }
- return (RetVal);
-}
-
-/**
- Delete a node and all nodes under it (including sub directories).
-
- @param[in] Node The node to start deleting with.
- @param[in] Quiet TRUE to print no messages.
-
- @retval SHELL_SUCCESS The operation was successful.
- @retval SHELL_ACCESS_DENIED A file was read only.
- @retval SHELL_ABORTED The abort message was received.
- @retval SHELL_DEVICE_ERROR A device error occured reading this Node.
-**/
-SHELL_STATUS
-EFIAPI
-CascadeDelete(
- IN EFI_SHELL_FILE_INFO *Node,
- IN CONST BOOLEAN Quiet
- )
-{
- SHELL_STATUS ShellStatus;
- EFI_SHELL_FILE_INFO *List;
- EFI_SHELL_FILE_INFO *Node2;
- EFI_STATUS Status;
- SHELL_PROMPT_RESPONSE *Resp;
-
- Resp = NULL;
- ShellStatus = SHELL_SUCCESS;
- List = NULL;
- Status = EFI_SUCCESS;
-
- if ((Node->Info->Attribute & EFI_FILE_READ_ONLY) == EFI_FILE_READ_ONLY) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_RM_LOG_DETELE_RO), gShellLevel2HiiHandle, Node->FullName);
- return (SHELL_ACCESS_DENIED);
- }
-
- if ((Node->Info->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) {
- if (!IsDirectoryEmpty(Node->Handle)) {
- if (!Quiet) {
- Status = ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_RM_LOG_DELETE_CONF), gShellLevel2HiiHandle, Node->FullName);
- Status = ShellPromptForResponse(ShellPromptResponseTypeYesNo, NULL, (VOID**)&Resp);
- ASSERT_EFI_ERROR(Status);
- ASSERT(Resp != NULL);
- if (EFI_ERROR(Status) || *Resp != ShellPromptResponseYes) {
- SHELL_FREE_NON_NULL(Resp);
- return (SHELL_ABORTED);
- }
- SHELL_FREE_NON_NULL(Resp);
- }
- //
- // empty out the directory
- //
- Status = gEfiShellProtocol->FindFilesInDir(Node->Handle, &List);
- if (EFI_ERROR(Status)) {
- if (List!=NULL) {
- gEfiShellProtocol->FreeFileList(&List);
- }
- return (SHELL_DEVICE_ERROR);
- }
- for (Node2 = (EFI_SHELL_FILE_INFO *)GetFirstNode(&List->Link)
- ; !IsNull(&List->Link, &Node2->Link)
- ; Node2 = (EFI_SHELL_FILE_INFO *)GetNextNode(&List->Link, &Node2->Link)
- ){
- //
- // skip the directory traversing stuff...
- //
- if (StrCmp(Node2->FileName, L".") == 0 || StrCmp(Node2->FileName, L"..") == 0) {
- continue;
- }
- Node2->Status = gEfiShellProtocol->OpenFileByName (Node2->FullName, &Node2->Handle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE);
- ShellStatus = CascadeDelete(Node2, Quiet);
- if (ShellStatus != SHELL_SUCCESS) {
- if (List!=NULL) {
- gEfiShellProtocol->FreeFileList(&List);
- }
- return (ShellStatus);
- }
- }
- if (List!=NULL) {
- gEfiShellProtocol->FreeFileList(&List);
- }
- }
- }
-
- if (!(StrCmp(Node->FileName, L".") == 0 || StrCmp(Node->FileName, L"..") == 0)) {
- //
- // now delete the current node...
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_RM_LOG_DELETE), gShellLevel2HiiHandle, Node->FullName);
- Status = gEfiShellProtocol->DeleteFile(Node->Handle);
- Node->Handle = NULL;
- }
-
- //
- // We cant allow for the warning here! (Dont use EFI_ERROR Macro).
- //
- if (Status != EFI_SUCCESS){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_RM_LOG_DELETE_ERR), gShellLevel2HiiHandle, Status);
- return (SHELL_ACCESS_DENIED);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_RM_LOG_DELETE_COMP), gShellLevel2HiiHandle);
- return (SHELL_SUCCESS);
- }
-}
-
-/**
- Determins if a Node is a valid delete target. Will prevent deleting the root directory.
-
- @param[in] List RESERVED. Not used.
- @param[in] Node The node to analyze.
- @param[in] Package RESERVED. Not used.
-**/
-BOOLEAN
-EFIAPI
-IsValidDeleteTarget(
- IN CONST EFI_SHELL_FILE_INFO *List,
- IN CONST EFI_SHELL_FILE_INFO *Node,
- IN CONST LIST_ENTRY *Package
- )
-{
- CONST CHAR16 *TempLocation;
- BOOLEAN RetVal;
- CHAR16 *SearchString;
- CHAR16 *Pattern;
- UINTN Size;
-
- if (Node == NULL || Node->FullName == NULL) {
- return (FALSE);
- }
-
- TempLocation = StrStr(Node->FullName, L":");
- if (StrLen(TempLocation) <= 2) {
- //
- // Deleting the root directory is invalid.
- //
- return (FALSE);
- }
-
- TempLocation = ShellGetCurrentDir(NULL);
- if (TempLocation == NULL) {
- //
- // No working directory is specified so whatever is left is ok.
- //
- return (TRUE);
- }
-
- Pattern = NULL;
- SearchString = NULL;
- Size = 0;
- Pattern = StrnCatGrow(&Pattern , NULL, TempLocation , 0);
- SearchString = StrnCatGrow(&SearchString, &Size, Node->FullName, 0);
- if (!EFI_ERROR(ShellIsDirectory(SearchString))) {
- SearchString = StrnCatGrow(&SearchString, &Size, L"\\", 0);
- SearchString = StrnCatGrow(&SearchString, &Size, L"*", 0);
- }
-
- if (Pattern == NULL || SearchString == NULL) {
- RetVal = FALSE;
- } else {
- RetVal = TRUE;
- if (gUnicodeCollation->MetaiMatch(gUnicodeCollation, Pattern, SearchString)) {
- RetVal = FALSE;
- }
- }
-
- SHELL_FREE_NON_NULL(Pattern );
- SHELL_FREE_NON_NULL(SearchString);
-
- return (RetVal);
-}
-
-/**
- Function for 'rm' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunRm (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- CONST CHAR16 *Param;
- SHELL_STATUS ShellStatus;
- UINTN ParamCount;
- EFI_SHELL_FILE_INFO *FileList;
- EFI_SHELL_FILE_INFO *Node;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- ParamCount = 0;
- FileList = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // we insufficient parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // get a list with each file specified by parameters
- // if parameter is a directory then add all the files below it to the list
- //
- for ( ParamCount = 1, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ; Param != NULL
- ; ParamCount++, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ){
- Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
- if (EFI_ERROR(Status) || FileList == NULL || IsListEmpty(&FileList->Link)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, (CHAR16*)Param);
- ShellStatus = SHELL_NOT_FOUND;
- break;
- }
- }
-
- if (ShellStatus == SHELL_SUCCESS){
- //
- // loop through the list and make sure we are not aborting...
- //
- for ( Node = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link) && !ShellGetExecutionBreakFlag()
- ; Node = (EFI_SHELL_FILE_INFO*)GetNextNode(&FileList->Link, &Node->Link)
- ){
- //
- // skip the directory traversing stuff...
- //
- if (StrCmp(Node->FileName, L".") == 0 || StrCmp(Node->FileName, L"..") == 0) {
- continue;
- }
-
- //
- // do the deleting of nodes
- //
- if (EFI_ERROR(Node->Status)){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_RM_LOG_DELETE_ERR2), gShellLevel2HiiHandle, Node->Status);
- ShellStatus = SHELL_ACCESS_DENIED;
- break;
- }
- if (!IsValidDeleteTarget(FileList, Node, Package)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_RM_LOG_DELETE_ERR3), gShellLevel2HiiHandle, Node->FullName);
- ShellStatus = SHELL_INVALID_PARAMETER;
- break;
- }
-
- ShellStatus = CascadeDelete(Node, ShellCommandLineGetFlag(Package, L"-q"));
- }
- }
- //
- // Free the fileList
- //
- if (FileList != NULL) {
- Status = ShellCloseFileMetaArg(&FileList);
- }
- FileList = NULL;
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c
deleted file mode 100644
index a3452f0b62..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/** @file
- Main file for attrib shell level 2 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-/**
- Print out each environment variable registered with the Shell 2.0 GUID.
-
- If you spawn a pre 2.0 shell from the Shell 2.0 the environment variable may not carry through.
-
- @retval STATUS_SUCCESS the printout was sucessful
- @return any return code from GetNextVariableName except EFI_NOT_FOUND
-**/
-SHELL_STATUS
-EFIAPI
-PrintAllShellEnvVars(
- VOID
- )
-{
- CONST CHAR16 *Value;
- CONST CHAR16 *ConstEnvNameList;
-
- ConstEnvNameList = gEfiShellProtocol->GetEnv(NULL);
- if (ConstEnvNameList == NULL) {
- return (SHELL_SUCCESS);
- }
- while (*ConstEnvNameList != CHAR_NULL){
- Value = gEfiShellProtocol->GetEnv(ConstEnvNameList);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_DISP), gShellLevel2HiiHandle, ConstEnvNameList, Value);
- ConstEnvNameList += StrLen(ConstEnvNameList)+1;
- }
-
- return (SHELL_SUCCESS);
-}
-
-STATIC CONST SHELL_PARAM_ITEM SetParamList[] = {
- {L"-d", TypeValue},
- {L"-v", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'set' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunSet (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CONST CHAR16 *KeyName;
- CONST CHAR16 *Value;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // Make sure globals are good...
- //
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (SetParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- return (SHELL_INVALID_PARAMETER);
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 3) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetRawValue(Package, 1) != NULL && ShellCommandLineGetFlag(Package, L"-d")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-d")) {
- //
- // delete a environment variable
- //
- KeyName = ShellCommandLineGetValue(Package, L"-d");
- if (KeyName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"-d");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- Status = ShellSetEnvironmentVariable(KeyName, L"", ShellCommandLineGetFlag(Package, L"-v"));
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_ND), gShellLevel2HiiHandle, KeyName, Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- }
- } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // print out all current environment variables
- //
- return(PrintAllShellEnvVars());
- } else {
- //
- // we are either printing one or assigning one
- //
- KeyName = ShellCommandLineGetRawValue(Package, 1);
- Value = ShellCommandLineGetRawValue(Package, 2);
- if (KeyName != NULL && Value != NULL) {
- //
- // assigning one
- //
- Status = ShellSetEnvironmentVariable(KeyName, Value, ShellCommandLineGetFlag(Package, L"-v"));
- } else {
- if (KeyName != NULL) {
- //
- // print out value for this one only.
- //
- Value = ShellGetEnvironmentVariable(KeyName);
- if (Value == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_NF), gShellLevel2HiiHandle, KeyName);
- ShellStatus = SHELL_SUCCESS;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_DISP), gShellLevel2HiiHandle, KeyName, Value);
- ShellStatus = SHELL_SUCCESS;
- }
- } else {
- ASSERT(FALSE);
- }
- }
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
deleted file mode 100644
index dfe03fdd20..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
+++ /dev/null
@@ -1,865 +0,0 @@
-/** @file
- Main file for time, timezone, and date shell level 2 and shell level 3 functions.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-
-/**
- Determine if String is a valid representation for a time or date.
-
- @param[in] String The pointer to the string to test.
- @param[in] Char The delimeter character.
- @param[in] Min The minimum value allowed.
- @param[in] Max The maximum value allowed.
- @param[in] MinusOk Whether negative numbers are permitted.
-
- @retval TRUE String is a valid representation.
- @retval FALSE String is invalid.
-**/
-BOOLEAN
-EFIAPI
-InternalIsTimeLikeString (
- IN CONST CHAR16 *String,
- IN CONST CHAR16 Char,
- IN CONST UINTN Min,
- IN CONST UINTN Max,
- IN CONST BOOLEAN MinusOk
- )
-{
- UINTN Count;
- Count = 0;
-
- if (MinusOk) {
- //
- // A single minus is ok.
- //
- if (*String == L'-') {
- String++;
- }
- }
-
- //
- // the first char must be numeric.
- //
- if (!ShellIsDecimalDigitCharacter(*String)) {
- return (FALSE);
- }
- //
- // loop through the characters and use the lib function
- //
- for ( ; String != NULL && *String != CHAR_NULL ; String++){
- if (*String == Char) {
- Count++;
- if (Count > Max) {
- return (FALSE);
- }
- continue;
- }
- if (!ShellIsDecimalDigitCharacter(*String)) {
- return (FALSE);
- }
- }
- if (Count < Min) {
- return (FALSE);
- }
- return (TRUE);
-}
-
-/**
- Verify that the DateString is valid and if so set that as the current
- date.
-
- @param[in] DateString The pointer to a string representation of the date.
-
- @retval SHELL_INVALID_PARAMETER DateString was NULL.
- @retval SHELL_INVALID_PARAMETER DateString was mis-formatted.
- @retval SHELL_SUCCESS The operation was successful.
-**/
-SHELL_STATUS
-EFIAPI
-CheckAndSetDate (
- IN CONST CHAR16 *DateString
- )
-{
- EFI_TIME TheTime;
- EFI_STATUS Status;
- CHAR16 *DateStringCopy;
- CHAR16 *Walker;
- CHAR16 *Walker1;
-
- if (!InternalIsTimeLikeString(DateString, L'/', 2, 2, FALSE)) {
- return (SHELL_INVALID_PARAMETER);
- }
-
- Status = gRT->GetTime(&TheTime, NULL);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"gRT->GetTime", Status);
- return (SHELL_DEVICE_ERROR);
- }
-
- DateStringCopy = NULL;
- DateStringCopy = StrnCatGrow(&DateStringCopy, NULL, DateString, 0);
- if (DateStringCopy == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- Walker = DateStringCopy;
-
- TheTime.Month = 0xFF;
- TheTime.Day = 0xFF;
- TheTime.Year = 0xFFFF;
-
- Walker1 = StrStr(Walker, L"/");
- if (Walker1 != NULL && *Walker1 == L'/') {
- *Walker1 = CHAR_NULL;
- }
-
- TheTime.Month = (UINT8)ShellStrToUintn (Walker);
- if (Walker1 != NULL) {
- Walker = Walker1 + 1;
- }
- Walker1 = Walker!=NULL?StrStr(Walker, L"/"):NULL;
- if (Walker1 != NULL && *Walker1 == L'/') {
- *Walker1 = CHAR_NULL;
- }
- if (Walker != NULL && Walker[0] != CHAR_NULL) {
- TheTime.Day = (UINT8)ShellStrToUintn (Walker);
- if (Walker1 != NULL) {
- Walker = Walker1 + 1;
- }
- Walker1 = Walker!=NULL?StrStr(Walker, L"/"):NULL;
- if (Walker1 != NULL && *Walker1 == L'/') {
- *Walker1 = CHAR_NULL;
- }
- if (Walker != NULL && Walker[0] != CHAR_NULL) {
- TheTime.Year = (UINT16)ShellStrToUintn (Walker);
- }
- }
-
- if (TheTime.Year < 100) {
- if (TheTime.Year >= 98) {
- TheTime.Year = (UINT16)(1900 + TheTime.Year);
- } else {
- TheTime.Year = (UINT16)(2000 + TheTime.Year);
- }
- }
-
- Status = gRT->SetTime(&TheTime);
-
- if (!EFI_ERROR(Status)){
- return (SHELL_SUCCESS);
- }
- return (SHELL_INVALID_PARAMETER);
-}
-
-/**
- Function for 'date' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDate (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- EFI_TIME TheTime;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Param1;
-
- ShellStatus = SHELL_SUCCESS;
- ProblemParam = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (SfoParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // If there are 0 value parameters, then print the current date
- // else If there are any value paramerers, then print error
- //
- if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // get the current date
- //
- Status = gRT->GetTime(&TheTime, NULL);
- ASSERT_EFI_ERROR(Status);
-
- //
- // ShellPrintEx the date in SFO or regular format
- //
- if (ShellCommandLineGetFlag(Package, L"-sfo")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DATE_SFO_FORMAT), gShellLevel2HiiHandle, TheTime.Month, TheTime.Day, TheTime.Year);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DATE_FORMAT), gShellLevel2HiiHandle, TheTime.Month, TheTime.Day, TheTime.Year);
- }
- } else {
- if (PcdGet8(PcdShellSupportLevel) == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // perform level 3 operation here.
- //
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- if (Param1 == NULL) {
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ShellStatus = CheckAndSetDate(Param1);
- }
- if (ShellStatus != SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, Param1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- }
- }
- }
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- //
- // return the status
- //
- return (ShellStatus);
-}
-
-//
-// Note "-tz" is invalid for this (non-interactive) version of 'time'.
-//
-STATIC CONST SHELL_PARAM_ITEM TimeParamList2[] = {
- {L"-d", TypeValue},
- {NULL, TypeMax}
- };
-
-STATIC CONST SHELL_PARAM_ITEM TimeParamList3[] = {
- {L"-d", TypeValue},
- {L"-tz", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Verify that the TimeString is valid and if so set that as the current
- time.
-
- @param[in] TimeString The pointer to a string representation of the time.
- @param[in] Tz The value to set for TimeZone.
- @param[in] Daylight The value to set for Daylight.
-
- @retval SHELL_INVALID_PARAMETER TimeString was NULL.
- @retval SHELL_INVALID_PARAMETER TimeString was mis-formatted.
- @retval SHELL_SUCCESS The operation was successful.
-**/
-SHELL_STATUS
-EFIAPI
-CheckAndSetTime (
- IN CONST CHAR16 *TimeString,
- IN CONST INT16 Tz,
- IN CONST UINT8 Daylight
- )
-{
- EFI_TIME TheTime;
- EFI_STATUS Status;
- CHAR16 *TimeStringCopy;
- CHAR16 *Walker1;
- CHAR16 *Walker2;
-
- if (TimeString != NULL && !InternalIsTimeLikeString(TimeString, L':', 1, 2, FALSE)) {
- return (SHELL_INVALID_PARAMETER);
- }
- if (Daylight != 0xFF &&((Daylight & (EFI_TIME_IN_DAYLIGHT|EFI_TIME_ADJUST_DAYLIGHT)) != Daylight)) {
- return (SHELL_INVALID_PARAMETER);
- }
-
- Status = gRT->GetTime(&TheTime, NULL);
- ASSERT_EFI_ERROR(Status);
-
- if (TimeString != NULL) {
- TimeStringCopy = NULL;
- TimeStringCopy = StrnCatGrow(&TimeStringCopy, NULL, TimeString, 0);
- Walker1 = TimeStringCopy;
- TheTime.Hour = 0xFF;
- TheTime.Minute = 0xFF;
-
- Walker2 = Walker1!=NULL?StrStr(Walker1, L":"):NULL;
- if (Walker2 != NULL && *Walker2 == L':') {
- *Walker2 = CHAR_NULL;
- }
- TheTime.Hour = (UINT8)ShellStrToUintn (Walker1);
- if (Walker2 != NULL) {
- Walker1 = Walker2 + 1;
- }
- Walker2 = Walker1!=NULL?StrStr(Walker1, L":"):NULL;
- if (Walker2 != NULL && *Walker2 == L':') {
- *Walker2 = CHAR_NULL;
- }
- if (Walker1 != NULL && Walker1[0] != CHAR_NULL) {
- TheTime.Minute = (UINT8)ShellStrToUintn (Walker1);
- if (Walker2 != NULL) {
- Walker1 = Walker2 + 1;
- }
- if (Walker1 != NULL && Walker1[0] != CHAR_NULL) {
- TheTime.Second = (UINT8)ShellStrToUintn (Walker1);
- }
- }
- SHELL_FREE_NON_NULL(TimeStringCopy);
- }
-
-
- if ((Tz >= -1440 && Tz <= 1440)||(Tz == 0x7FF)) {
- TheTime.TimeZone = Tz;
- }
-
- if (Daylight != 0xFF) {
- TheTime.Daylight = Daylight;
- }
-
- Status = gRT->SetTime(&TheTime);
-
- if (!EFI_ERROR(Status)){
- return (SHELL_SUCCESS);
- }
-
- return (SHELL_INVALID_PARAMETER);
-}
-
-/**
- Function for 'time' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunTime (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *Message;
- EFI_TIME TheTime;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- INT16 Tz;
- UINT8 Daylight;
- CONST CHAR16 *TempLocation;
- UINTN TzMinutes;
-
- ShellStatus = SHELL_SUCCESS;
- ProblemParam = NULL;
-
- //
- // Initialize variables
- //
- Message = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- if (PcdGet8(PcdShellSupportLevel) == 2) {
- Status = ShellCommandLineParseEx (TimeParamList2, &Package, &ProblemParam, TRUE, TRUE);
- } else {
- ASSERT(PcdGet8(PcdShellSupportLevel) == 3);
- Status = ShellCommandLineParseEx (TimeParamList3, &Package, &ProblemParam, TRUE, TRUE);
- }
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- Status = gRT->GetTime(&TheTime, NULL);
- ASSERT_EFI_ERROR(Status);
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // If there are no parameters, then print the current time
- //
- if (ShellCommandLineGetRawValue(Package, 1) == NULL
- && !ShellCommandLineGetFlag(Package, L"-d")
- && !ShellCommandLineGetFlag(Package, L"-tz")) {
- //
- // ShellPrintEx the current time
- //
- if (TheTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE) {
- TzMinutes = 0;
- } else {
- TzMinutes = (ABS(TheTime.TimeZone)) % 60;
- }
-
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_TIME_FORMAT),
- gShellLevel2HiiHandle,
- TheTime.Hour,
- TheTime.Minute,
- TheTime.Second,
- TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?L" ":(TheTime.TimeZone > 0?L"-":L"+"),
- TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(ABS(TheTime.TimeZone)) / 60,
- TzMinutes
- );
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CRLF), gShellLevel2HiiHandle);
- } else if (ShellCommandLineGetFlag(Package, L"-d") && ShellCommandLineGetValue(Package, L"-d") == NULL) {
- if (TheTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE) {
- TzMinutes = 0;
- } else {
- TzMinutes = (ABS(TheTime.TimeZone)) % 60;
- }
-
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_TIME_FORMAT),
- gShellLevel2HiiHandle,
- TheTime.Hour,
- TheTime.Minute,
- TheTime.Second,
- TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?L" ":(TheTime.TimeZone > 0?L"-":L"+"),
- TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(ABS(TheTime.TimeZone)) / 60,
- TzMinutes
- );
- switch (TheTime.Daylight) {
- case 0:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TIME_DST0), gShellLevel2HiiHandle);
- break;
- case EFI_TIME_ADJUST_DAYLIGHT:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TIME_DST1), gShellLevel2HiiHandle);
- break;
- case EFI_TIME_IN_DAYLIGHT:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TIME_DST2), gShellLevel2HiiHandle);
- break;
- case EFI_TIME_IN_DAYLIGHT|EFI_TIME_ADJUST_DAYLIGHT:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TIME_DST3), gShellLevel2HiiHandle);
- break;
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_ERROR), gShellLevel2HiiHandle, L"gRT->GetTime", L"TheTime.Daylight", TheTime.Daylight);
- }
- } else {
- if (PcdGet8(PcdShellSupportLevel) == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // perform level 3 operation here.
- //
- if ((TempLocation = ShellCommandLineGetValue(Package, L"-tz")) != NULL) {
- if (TempLocation[0] == L'-') {
- Tz = (INT16)(0 - ShellStrToUintn(++TempLocation));
- } else {
- Tz = (INT16)ShellStrToUintn(TempLocation);
- }
- if (!(Tz >= -1440 && Tz <= 1440) && Tz != EFI_UNSPECIFIED_TIMEZONE) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"-tz");
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- } else {
- //
- // intentionally out of bounds value will prevent changing it...
- //
- Tz = 1441;
- }
- TempLocation = ShellCommandLineGetValue(Package, L"-d");
- if (TempLocation != NULL) {
- Daylight = (UINT8)ShellStrToUintn(TempLocation);
- if (Daylight != 0 && Daylight != 1 && Daylight != 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"-d");
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- } else {
- //
- // invalid = will not use
- //
- Daylight = 0xFF;
- }
- if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = CheckAndSetTime(ShellCommandLineGetRawValue(Package, 1), Tz, Daylight);
- if (ShellStatus != SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, 1));
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- }
- }
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- //
- // return the status
- //
- return (ShellStatus);
-}
-
-typedef struct {
- INT16 TimeZone;
- EFI_STRING_ID StringId;
-} TIME_ZONE_ITEM;
-
-STATIC CONST SHELL_PARAM_ITEM TimeZoneParamList2[] = {
- {L"-l", TypeFlag},
- {L"-f", TypeFlag},
- {NULL, TypeMax}
- };
-STATIC CONST SHELL_PARAM_ITEM TimeZoneParamList3[] = {
- {L"-l", TypeFlag},
- {L"-f", TypeFlag},
- {L"-s", TypeValue},
- {NULL, TypeMax}
- };
-
- STATIC CONST TIME_ZONE_ITEM TimeZoneList[] = {
- {720, STRING_TOKEN (STR_TIMEZONE_M12)},
- {660, STRING_TOKEN (STR_TIMEZONE_M11)},
- {600, STRING_TOKEN (STR_TIMEZONE_M10)},
- {540, STRING_TOKEN (STR_TIMEZONE_M9)},
- {480, STRING_TOKEN (STR_TIMEZONE_M8)},
- {420, STRING_TOKEN (STR_TIMEZONE_M7)},
- {360, STRING_TOKEN (STR_TIMEZONE_M6)},
- {300, STRING_TOKEN (STR_TIMEZONE_M5)},
- {270, STRING_TOKEN (STR_TIMEZONE_M430)},
- {240, STRING_TOKEN (STR_TIMEZONE_M4)},
- {210, STRING_TOKEN (STR_TIMEZONE_M330)},
- {180, STRING_TOKEN (STR_TIMEZONE_M3)},
- {120, STRING_TOKEN (STR_TIMEZONE_M2)},
- {60 , STRING_TOKEN (STR_TIMEZONE_M1)},
- {0 , STRING_TOKEN (STR_TIMEZONE_0)},
- {-60 , STRING_TOKEN (STR_TIMEZONE_P1)},
- {-120 , STRING_TOKEN (STR_TIMEZONE_P2)},
- {-180 , STRING_TOKEN (STR_TIMEZONE_P3)},
- {-210 , STRING_TOKEN (STR_TIMEZONE_P330)},
- {-240 , STRING_TOKEN (STR_TIMEZONE_P4)},
- {-270 , STRING_TOKEN (STR_TIMEZONE_P430)},
- {-300 , STRING_TOKEN (STR_TIMEZONE_P5)},
- {-330 , STRING_TOKEN (STR_TIMEZONE_P530)},
- {-345 , STRING_TOKEN (STR_TIMEZONE_P545)},
- {-360 , STRING_TOKEN (STR_TIMEZONE_P6)},
- {-390 , STRING_TOKEN (STR_TIMEZONE_P630)},
- {-420 , STRING_TOKEN (STR_TIMEZONE_P7)},
- {-480 , STRING_TOKEN (STR_TIMEZONE_P8)},
- {-540 , STRING_TOKEN (STR_TIMEZONE_P9)},
- {-570 , STRING_TOKEN (STR_TIMEZONE_P930)},
- {-600 , STRING_TOKEN (STR_TIMEZONE_P10)},
- {-660 , STRING_TOKEN (STR_TIMEZONE_P11)},
- {-720 , STRING_TOKEN (STR_TIMEZONE_P12)},
- {-780 , STRING_TOKEN (STR_TIMEZONE_P13)},
- {-840 , STRING_TOKEN (STR_TIMEZONE_P14)}
-};
-
-/**
- Verify that the TimeZoneString is valid and if so set that as the current
- timezone.
-
- @param[in] TimeZoneString The pointer to a string representation of the timezone.
-
- @retval SHELL_INVALID_PARAMETER TimeZoneString was NULL.
- @retval SHELL_INVALID_PARAMETER TimeZoneString was mis-formatted.
- @retval SHELL_SUCCESS The operation was successful.
-**/
-SHELL_STATUS
-EFIAPI
-CheckAndSetTimeZone (
- IN CONST CHAR16 *TimeZoneString
- )
-{
- EFI_TIME TheTime;
- EFI_STATUS Status;
- CHAR16 *TimeZoneCopy;
- CHAR16 *Walker;
- CHAR16 *Walker2;
- UINTN LoopVar;
-
- if (TimeZoneString == NULL) {
- return (SHELL_INVALID_PARAMETER);
- }
-
- if (TimeZoneString != NULL && !InternalIsTimeLikeString(TimeZoneString, L':', 1, 1, TRUE)) {
- return (SHELL_INVALID_PARAMETER);
- }
-
- Status = gRT->GetTime(&TheTime, NULL);
- if (EFI_ERROR(Status)) {
- return (SHELL_DEVICE_ERROR);
- }
-
- TimeZoneCopy = NULL;
- TimeZoneCopy = StrnCatGrow(&TimeZoneCopy, NULL, TimeZoneString, 0);
- if (TimeZoneCopy == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- Walker = TimeZoneCopy;
- Walker2 = StrStr(Walker, L":");
- if (Walker2 != NULL && *Walker2 == L':') {
- *Walker2 = CHAR_NULL;
- }
- if (*Walker == L'-') {
- TheTime.TimeZone = (INT16)((ShellStrToUintn (++Walker)) * 60);
- } else {
- TheTime.TimeZone = (INT16)((ShellStrToUintn (Walker)) * -60);
- }
- if (Walker2 != NULL) {
- Walker = Walker2 + 1;
- }
- if (Walker != NULL && Walker[0] != CHAR_NULL) {
- if (TheTime.TimeZone < 0) {
- TheTime.TimeZone = (INT16)(TheTime.TimeZone - (UINT8)ShellStrToUintn (Walker));
- } else {
- TheTime.TimeZone = (INT16)(TheTime.TimeZone + (UINT8)ShellStrToUintn (Walker));
- }
- }
-
- Status = EFI_INVALID_PARAMETER;
-
- for ( LoopVar = 0
- ; LoopVar < sizeof(TimeZoneList) / sizeof(TimeZoneList[0])
- ; LoopVar++
- ){
- if (TheTime.TimeZone == TimeZoneList[LoopVar].TimeZone) {
- Status = gRT->SetTime(&TheTime);
- break;
- }
- }
-
- FreePool(TimeZoneCopy);
-
- if (!EFI_ERROR(Status)){
- return (SHELL_SUCCESS);
- }
- return (SHELL_INVALID_PARAMETER);
-}
-
-
-/**
- Function for 'timezone' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunTimeZone (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- //
- // non interactive
- //
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINT8 LoopVar;
- EFI_TIME TheTime;
- BOOLEAN Found;
- UINTN TzMinutes;
-
- ShellStatus = SHELL_SUCCESS;
- ProblemParam = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- if (PcdGet8(PcdShellSupportLevel) == 2) {
- Status = ShellCommandLineParse (TimeZoneParamList2, &Package, &ProblemParam, TRUE);
- } else {
- ASSERT(PcdGet8(PcdShellSupportLevel) == 3);
- Status = ShellCommandLineParseEx (TimeZoneParamList3, &Package, &ProblemParam, TRUE, TRUE);
- }
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetCount(Package) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetFlag(Package, L"-s")) {
- if ((ShellCommandLineGetFlag(Package, L"-l")) || (ShellCommandLineGetFlag(Package, L"-f"))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"-l or -f");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(PcdGet8(PcdShellSupportLevel) == 3);
- if (ShellCommandLineGetValue(Package, L"-s") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"-s");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Set the time zone
- //
- ShellStatus = CheckAndSetTimeZone(ShellCommandLineGetValue(Package, L"-s"));
- if (ShellStatus != SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ShellCommandLineGetValue(Package, L"-s"));
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- }
- }
- } else if (ShellCommandLineGetFlag(Package, L"-l")) {
- //
- // Print a list of all time zones
- //
- for ( LoopVar = 0
- ; LoopVar < sizeof(TimeZoneList) / sizeof(TimeZoneList[0])
- ; LoopVar++
- ){
- ShellPrintHiiEx (-1, -1, NULL, TimeZoneList[LoopVar].StringId, gShellLevel2HiiHandle);
- }
- } else {
- //
- // Get Current Time Zone Info
- //
- Status = gRT->GetTime(&TheTime, NULL);
- ASSERT_EFI_ERROR(Status);
-
- if (TheTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE) {
- Found = FALSE;
- for ( LoopVar = 0
- ; LoopVar < sizeof(TimeZoneList) / sizeof(TimeZoneList[0])
- ; LoopVar++
- ){
- if (TheTime.TimeZone == TimeZoneList[LoopVar].TimeZone) {
- if (ShellCommandLineGetFlag(Package, L"-f")) {
- //
- // Print all info about current time zone
- //
- ShellPrintHiiEx (-1, -1, NULL, TimeZoneList[LoopVar].StringId, gShellLevel2HiiHandle);
- } else {
- //
- // Print basic info only
- //
- if (TheTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE) {
- TzMinutes = 0;
- } else {
- TzMinutes = (ABS(TheTime.TimeZone)) % 60;
- }
-
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_TIMEZONE_SIMPLE),
- gShellLevel2HiiHandle,
- TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(TheTime.TimeZone > 0?L"-":L"+"),
- TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(ABS(TheTime.TimeZone)) / 60,
- TzMinutes);
- }
- Found = TRUE;
- break;
- }
- }
- if (!Found) {
- //
- // Print basic info only
- //
- if (TheTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE) {
- TzMinutes = 0;
- } else {
- TzMinutes = (ABS(TheTime.TimeZone)) % 60;
- }
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_TIMEZONE_SIMPLE),
- gShellLevel2HiiHandle,
- TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(TheTime.TimeZone > 0?L"-":L"+"),
- TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(ABS(TheTime.TimeZone)) / 60,
- TzMinutes);
- if (ShellCommandLineGetFlag(Package, L"-f")) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN(STR_TIMEZONE_NI), gShellLevel2HiiHandle);
- }
- }
- } else {
- //
- // TimeZone was EFI_UNSPECIFIED_TIMEZONE (unknown) from GetTime()
- //
- }
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
deleted file mode 100644
index 52aaff021f..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/** @file
- Main file for NULL named library for level 2 shell command functions.
-
- these functions are:
- attrib,
- cd,
- cp,
- date*,
- time*,
- load,
- ls,
- map,
- mkdir,
- mv,
- parse,
- rm,
- reset,
- set,
- timezone*,
- vol
-
- * functions are non-interactive only
-
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-#include "UefiShellLevel2CommandsLib.h"
-
-CONST CHAR16 mFileName[] = L"ShellCommands";
-EFI_HANDLE gShellLevel2HiiHandle = NULL;
-
-/**
- Get the filename to get help text from if not using HII.
-
- @retval The filename.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandGetManFileNameLevel2 (
- VOID
- )
-{
- return (mFileName);
-}
-
-/**
- Constructor for the Shell Level 2 Commands library.
-
- Install the handlers for level 2 UEFI Shell 2.0 commands.
-
- @param ImageHandle the image handle of the process
- @param SystemTable the EFI System Table pointer
-
- @retval EFI_SUCCESS the shell command handlers were installed sucessfully
- @retval EFI_UNSUPPORTED the shell level required was not found.
-**/
-EFI_STATUS
-EFIAPI
-ShellLevel2CommandsLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- //
- // if shell level is less than 2 do nothing
- //
- if (PcdGet8(PcdShellSupportLevel) < 2) {
- return (EFI_SUCCESS);
- }
-
- gShellLevel2HiiHandle = HiiAddPackages (&gShellLevel2HiiGuid, gImageHandle, UefiShellLevel2CommandsLibStrings, NULL);
- if (gShellLevel2HiiHandle == NULL) {
- return (EFI_DEVICE_ERROR);
- }
-
- //
- // install our shell command handlers that are always installed
- //
- ShellCommandRegisterCommandName(L"attrib", ShellCommandRunAttrib , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_ATTRIB) );
- ShellCommandRegisterCommandName(L"cd", ShellCommandRunCd , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_CD) );
- ShellCommandRegisterCommandName(L"cp", ShellCommandRunCp , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_CP) );
- ShellCommandRegisterCommandName(L"load", ShellCommandRunLoad , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_LOAD) );
- ShellCommandRegisterCommandName(L"map", ShellCommandRunMap , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_MAP) );
- ShellCommandRegisterCommandName(L"mkdir", ShellCommandRunMkDir , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_MKDIR) );
- ShellCommandRegisterCommandName(L"mv", ShellCommandRunMv , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_MV) );
- ShellCommandRegisterCommandName(L"parse", ShellCommandRunParse , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_PARSE) );
- ShellCommandRegisterCommandName(L"reset", ShellCommandRunReset , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_RESET) );
- ShellCommandRegisterCommandName(L"set", ShellCommandRunSet , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_SET) );
- ShellCommandRegisterCommandName(L"ls", ShellCommandRunLs , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_LS) );
- ShellCommandRegisterCommandName(L"rm", ShellCommandRunRm , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_RM) );
- ShellCommandRegisterCommandName(L"vol", ShellCommandRunVol , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_VOL) );
-
- //
- // support for permenant (built in) aliases
- //
- ShellCommandRegisterAlias(L"rm", L"del");
- ShellCommandRegisterAlias(L"ls", L"dir");
- ShellCommandRegisterAlias(L"cp", L"copy");
- ShellCommandRegisterAlias(L"mkdir", L"md");
- ShellCommandRegisterAlias(L"cd ..", L"cd..");
- ShellCommandRegisterAlias(L"cd \\", L"cd\\");
- ShellCommandRegisterAlias(L"ren", L"mv");
- //
- // These are installed in level 2 or 3...
- //
- if (PcdGet8(PcdShellSupportLevel) == 2 || PcdGet8(PcdShellSupportLevel) == 3) {
- ShellCommandRegisterCommandName(L"date", ShellCommandRunDate , ShellCommandGetManFileNameLevel2, PcdGet8(PcdShellSupportLevel), L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_DATE) );
- ShellCommandRegisterCommandName(L"time", ShellCommandRunTime , ShellCommandGetManFileNameLevel2, PcdGet8(PcdShellSupportLevel), L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_TIME) );
- ShellCommandRegisterCommandName(L"timezone", ShellCommandRunTimeZone, ShellCommandGetManFileNameLevel2, PcdGet8(PcdShellSupportLevel), L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_TIMEZONE));
- } else {
- DEBUG_CODE_BEGIN();
- //
- // we want to be able to test these so install them under a different name in debug mode...
- //
- ShellCommandRegisterCommandName(L"l2date", ShellCommandRunDate , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_DATE) );
- ShellCommandRegisterCommandName(L"l2time", ShellCommandRunTime , ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_TIME) );
- ShellCommandRegisterCommandName(L"l2timezone", ShellCommandRunTimeZone, ShellCommandGetManFileNameLevel2, 2, L"", TRUE, gShellLevel2HiiHandle, STRING_TOKEN(STR_GET_HELP_TIMEZONE));
- DEBUG_CODE_END();
- }
-
- return (EFI_SUCCESS);
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param ImageHandle The image handle of the process.
- @param SystemTable The EFI System Table pointer.
-
- @retval EFI_SUCCESS Always returned.
-**/
-EFI_STATUS
-EFIAPI
-ShellLevel2CommandsLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (gShellLevel2HiiHandle != NULL) {
- HiiRemovePackages(gShellLevel2HiiHandle);
- }
- return (EFI_SUCCESS);
-}
-
-/**
- returns a fully qualified directory (contains a map drive at the begining)
- path from a unknown directory path.
-
- If Path is already fully qualified this will return a duplicat otherwise this
- will use get the current directory and use that to build the fully qualified
- version.
-
- if the return value is not NULL it must be caller freed.
-
- @param[in] Path The unknown Path Value
-
- @retval NULL A memory allocation failed
- @retval NULL A fully qualified path could not be discovered.
- @retval other An allocated pointer to a fuly qualified path.
-**/
-CHAR16*
-EFIAPI
-GetFullyQualifiedPath(
- IN CONST CHAR16* Path
- )
-{
- CHAR16 *PathToReturn;
- UINTN Size;
- CONST CHAR16 *CurDir;
-
- PathToReturn = NULL;
- Size = 0;
-
- ASSERT((PathToReturn == NULL && Size == 0) || (PathToReturn != NULL));
- //
- // convert a local path to an absolute path
- //
- if (StrStr(Path, L":") == NULL) {
- CurDir = gEfiShellProtocol->GetCurDir(NULL);
- StrnCatGrow(&PathToReturn, &Size, CurDir, 0);
- if (*Path == L'\\') {
- Path++;
- }
- }
- StrnCatGrow(&PathToReturn, &Size, Path, 0);
-
- PathCleanUpDirectories(PathToReturn);
-
- if (PathToReturn == NULL) {
- return NULL;
- }
-
- while (PathToReturn[StrLen(PathToReturn)-1] == L'*') {
- PathToReturn[StrLen(PathToReturn)-1] = CHAR_NULL;
- }
-
- return (PathToReturn);
-}
-
-/**
- Function to verify all intermediate directories in the path.
-
- @param[in] Path The pointer to the path to fix.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-VerifyIntermediateDirectories (
- IN CONST CHAR16 *Path
- )
-{
- EFI_STATUS Status;
- CHAR16 *PathCopy;
- CHAR16 *TempSpot;
- SHELL_FILE_HANDLE FileHandle;
-
- ASSERT(Path != NULL);
-
- Status = EFI_SUCCESS;
- PathCopy = NULL;
- PathCopy = StrnCatGrow(&PathCopy, NULL, Path, 0);
- FileHandle = NULL;
-
- if (PathCopy == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- for (TempSpot = &PathCopy[StrLen(PathCopy)-1] ; *TempSpot != CHAR_NULL && *TempSpot != L'\\' ; TempSpot = &PathCopy[StrLen(PathCopy)-1]){
- *TempSpot = CHAR_NULL;
- }
- if (*TempSpot == L'\\') {
- *TempSpot = CHAR_NULL;
- }
-
- if (PathCopy != NULL && *PathCopy != CHAR_NULL) {
- Status = VerifyIntermediateDirectories(PathCopy);
-
- if (PathCopy[StrLen(PathCopy)-1] != L':') {
- if (!EFI_ERROR(Status)) {
- Status = ShellOpenFileByName(PathCopy, &FileHandle, EFI_FILE_MODE_READ, 0);
- if (FileHandle != NULL) {
- ShellCloseFile(&FileHandle);
- }
- }
- }
- }
-
- SHELL_FREE_NON_NULL(PathCopy);
-
- return (Status);
-}
-
-/**
- Be lazy and borrow from baselib.
-
- @param[in] Char The character to convert to upper case.
-
- @return Char as an upper case character.
-**/
-CHAR16
-EFIAPI
-InternalCharToUpper (
- IN CONST CHAR16 Char
- );
-
-/**
- String comparison without regard to case for a limited number of characters.
-
- @param[in] Source The first item to compare.
- @param[in] Target The second item to compare.
- @param[in] Count How many characters to compare.
-
- @retval NULL Source and Target are identical strings without regard to case.
- @return The location in Source where there is a difference.
-**/
-CONST CHAR16*
-EFIAPI
-StrniCmp(
- IN CONST CHAR16 *Source,
- IN CONST CHAR16 *Target,
- IN CONST UINTN Count
- )
-{
- UINTN LoopCount;
- CHAR16 Char1;
- CHAR16 Char2;
-
- ASSERT(Source != NULL);
- ASSERT(Target != NULL);
-
- for (LoopCount = 0 ; LoopCount < Count ; LoopCount++) {
- Char1 = InternalCharToUpper(Source[LoopCount]);
- Char2 = InternalCharToUpper(Target[LoopCount]);
- if (Char1 != Char2) {
- return (&Source[LoopCount]);
- }
- }
- return (NULL);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h
deleted file mode 100644
index 8abf7e02a8..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h
+++ /dev/null
@@ -1,317 +0,0 @@
-/** @file
- Main file for NULL named library for level 2 shell command functions.
-
- these functions are:
- attrib, cd, cp, date*, time*, rm, reset,
- load, ls, map, mkdir, mv, parse, set, timezone*
-
-
- * functions are non-interactive only
-
-
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_
-#define _UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/ShellLibHiiGuid.h>
-
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/DevicePath.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/UnicodeCollation.h>
-
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/ShellLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HiiLib.h>
-#include <Library/SortLib.h>
-#include <Library/FileHandleLib.h>
-#include <Library/PathLib.h>
-
-extern CONST CHAR16 mFileName[];
-extern EFI_HANDLE gShellLevel2HiiHandle;
-
-/**
- Function for 'attrib' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunAttrib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'date' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunDate (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'time' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunTime (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'load' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunLoad (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'ls' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunLs (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'map' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMap (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'reset' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunReset (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'timezone' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunTimeZone (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'set' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunSet (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'mkdir' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMkDir (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'cd' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunCd (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'cp' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunCp (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'parse' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunParse (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'rm' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunRm (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'mv' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunMv (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- returns a fully qualified directory (contains a map drive at the begining)
- path from a unknown directory path.
-
- If Path is already fully qualified this will return a duplicat otherwise this
- will use get the current directory and use that to build the fully qualified
- version.
-
- if the return value is not NULL it must be caller freed.
-
- @param[in] Path The unknown Path Value
-
- @retval NULL A memory allocation failed
- @retval NULL a fully qualified path could not be discovered.
- @retval other pointer to a fuly qualified path.
-**/
-CHAR16*
-EFIAPI
-GetFullyQualifiedPath(
- IN CONST CHAR16* Path
- );
-
-/**
- Function to verify all intermediate directories in the path.
-
- @param[in] Path The pointer to the path to fix.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-VerifyIntermediateDirectories (
- IN CONST CHAR16 *Path
- );
-
-/**
- CaseInsensitive length limited string comparison.
-
- @param[in] Source Pointer to first string.
- @param[in] Target Pointer to second string.
- @param[in] Count Number of characters to compare.
-
- @retval 0 The strings are the same.
- @return non-zero if the strings are different.
-**/
-CONST CHAR16*
-EFIAPI
-StrniCmp(
- IN CONST CHAR16 *Source,
- IN CONST CHAR16 *Target,
- IN CONST UINTN Count
- );
-
-/**
- Function for 'Vol' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunVol (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-#endif
-
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
deleted file mode 100644
index 52844429ea..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
+++ /dev/null
@@ -1,85 +0,0 @@
-## @file
-# Provides shell level 2 functions
-#
-# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellLevel2CommandsLib
- FILE_GUID = CBF3931C-A2DF-40e5-B77E-CCA9555E9755
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = ShellLevel2CommandsLibConstructor
- DESTRUCTOR = ShellLevel2CommandsLibDestructor
-
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- UefiShellLevel2CommandsLib.c
- UefiShellLevel2CommandsLib.h
- UefiShellLevel2CommandsLib.uni
- TimeDate.c
- Load.c
- Ls.c
- Map.c
- Reset.c
- Set.c
- MkDir.c
- Cd.c
- Cp.c
- Parse.c
- Rm.c
- Mv.c
- Attrib.c
- Vol.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- ShellCommandLib
- ShellLib
- UefiLib
- UefiRuntimeServicesTableLib
- UefiBootServicesTableLib
- PcdLib
- HiiLib
- HandleParsingLib
- PathLib
- DevicePathLib
-
-[Protocols]
- gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED
- gEfiShellProtocolGuid # ALWAYS_CONSUMED
- gEfiShellParametersProtocolGuid # ALWAYS_CONSUMED
- gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED
- gEfiLoadedImageProtocolGuid # ALWAYS_CONSUMED
- gEfiSimpleFileSystemProtocolGuid # ALWAYS_CONSUMED
-
-[Pcd.common]
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize # ALWAYS_CONSUMED
-
-[Guids]
- gEfiFileSystemInfoGuid
- gEfiFileInfoGuid
- gShellLevel2HiiGuid \ No newline at end of file
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni
deleted file mode 100644
index eaaa05d65c..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c
deleted file mode 100644
index 9300d5ec35..0000000000
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/** @file
- Main file for vol shell level 2 function.
-
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel2CommandsLib.h"
-#include <Guid/FileSystemInfo.h>
-#include <Guid/FileSystemVolumeLabelInfo.h>
-
-/**
- Print the info or change the volume info.
-
- @param[in] Path String with starting path.
- @param[in] Delete TRUE to delete the volume label. FALSE otherwise.
- @param[in] Name New name to set to the volume label.
-
- @retval SHELL_SUCCESS The operation was sucessful.
-**/
-SHELL_STATUS
-EFIAPI
-HandleVol(
- IN CONST CHAR16 *Path,
- IN CONST BOOLEAN Delete,
- IN CONST CHAR16 *Name OPTIONAL
- )
-{
- EFI_STATUS Status;
- SHELL_STATUS ShellStatus;
- EFI_FILE_SYSTEM_INFO *SysInfo;
- UINTN SysInfoSize;
- SHELL_FILE_HANDLE ShellFileHandle;
- EFI_FILE_PROTOCOL *EfiFpHandle;
- UINTN Size1;
- UINTN Size2;
-
- ShellStatus = SHELL_SUCCESS;
-
- if (
- Name != NULL && (
- StrStr(Name, L"%") != NULL ||
- StrStr(Name, L"^") != NULL ||
- StrStr(Name, L"*") != NULL ||
- StrStr(Name, L"+") != NULL ||
- StrStr(Name, L"=") != NULL ||
- StrStr(Name, L"[") != NULL ||
- StrStr(Name, L"]") != NULL ||
- StrStr(Name, L"|") != NULL ||
- StrStr(Name, L":") != NULL ||
- StrStr(Name, L";") != NULL ||
- StrStr(Name, L"\"") != NULL ||
- StrStr(Name, L"<") != NULL ||
- StrStr(Name, L">") != NULL ||
- StrStr(Name, L"?") != NULL ||
- StrStr(Name, L"/") != NULL ||
- StrStr(Name, L" ") != NULL )
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, Name);
- return (SHELL_INVALID_PARAMETER);
- }
-
- Status = gEfiShellProtocol->OpenFileByName(
- Path,
- &ShellFileHandle,
- Name != NULL?EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE:EFI_FILE_MODE_READ);
-
- if (EFI_ERROR(Status) || ShellFileHandle == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, Path);
- return (SHELL_ACCESS_DENIED);
- }
-
- //
- // Get the Volume Info from ShellFileHandle
- //
- SysInfo = NULL;
- SysInfoSize = 0;
- EfiFpHandle = ConvertShellHandleToEfiFileProtocol(ShellFileHandle);
- Status = EfiFpHandle->GetInfo(
- EfiFpHandle,
- &gEfiFileSystemInfoGuid,
- &SysInfoSize,
- SysInfo);
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- SysInfo = AllocateZeroPool(SysInfoSize);
- Status = EfiFpHandle->GetInfo(
- EfiFpHandle,
- &gEfiFileSystemInfoGuid,
- &SysInfoSize,
- SysInfo);
- }
-
- ASSERT(SysInfo != NULL);
-
- if (Delete) {
- StrCpy ((CHAR16 *) SysInfo->VolumeLabel, L"");
- SysInfo->Size = SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize(SysInfo->VolumeLabel);
- Status = EfiFpHandle->SetInfo(
- EfiFpHandle,
- &gEfiFileSystemInfoGuid,
- (UINTN)SysInfo->Size,
- SysInfo);
- } else if (Name != NULL) {
- Size1 = StrSize(Name);
- Size2 = StrSize(SysInfo->VolumeLabel);
- if (Size1 > Size2) {
- SysInfo = ReallocatePool((UINTN)SysInfo->Size, (UINTN)SysInfo->Size + Size1 - Size2, SysInfo);
- if (SysInfo == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellLevel2HiiHandle);
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- }
- }
- if (SysInfo != NULL) {
- StrCpy ((CHAR16 *) SysInfo->VolumeLabel, Name);
- SysInfo->Size = SIZE_OF_EFI_FILE_SYSTEM_INFO + Size1;
- Status = EfiFpHandle->SetInfo(
- EfiFpHandle,
- &gEfiFileSystemInfoGuid,
- (UINTN)SysInfo->Size,
- SysInfo);
- }
- }
-
- FreePool(SysInfo);
-
- if (Delete || Name != NULL) {
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, Path);
- ShellStatus = SHELL_ACCESS_DENIED;
- }
- }
-
- SysInfoSize = 0;
- SysInfo = NULL;
-
- Status = EfiFpHandle->GetInfo(
- EfiFpHandle,
- &gEfiFileSystemInfoGuid,
- &SysInfoSize,
- SysInfo);
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- SysInfo = AllocateZeroPool(SysInfoSize);
- Status = EfiFpHandle->GetInfo(
- EfiFpHandle,
- &gEfiFileSystemInfoGuid,
- &SysInfoSize,
- SysInfo);
- }
-
- gEfiShellProtocol->CloseFile(ShellFileHandle);
-
- ASSERT(SysInfo != NULL);
-
- if (SysInfo != NULL) {
- //
- // print VolumeInfo table
- //
- ShellPrintHiiEx (
- 0,
- gST->ConOut->Mode->CursorRow,
- NULL,
- STRING_TOKEN (STR_VOL_VOLINFO),
- gShellLevel2HiiHandle,
- SysInfo->VolumeLabel,
- SysInfo->ReadOnly?L"r":L"rw",
- SysInfo->VolumeSize,
- SysInfo->FreeSpace,
- SysInfo->BlockSize
- );
- SHELL_FREE_NON_NULL(SysInfo);
- }
-
- return (ShellStatus);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-d", TypeFlag},
- {L"-n", TypeValue},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'Vol' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunVol (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *PathName;
- CONST CHAR16 *CurDir;
- BOOLEAN DeleteMode;
- CHAR16 *FullPath;
- CHAR16 *TempSpot;
- UINTN Length;
- CONST CHAR16 *NewName;
-
- Length = 0;
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- PathName = NULL;
- CurDir = NULL;
- FullPath = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // Fix local copies of the protocol pointers
- //
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
-
- if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- PathName = ShellCommandLineGetRawValue(Package, 1);
- if (PathName == NULL) {
- CurDir = gEfiShellProtocol->GetCurDir(NULL);
- if (CurDir == NULL) {
- ShellStatus = SHELL_NOT_FOUND;
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
- } else {
- PathName = CurDir;
- }
- }
- if (PathName != NULL) {
- TempSpot = StrStr(PathName, L":");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- TempSpot = StrStr(PathName, L"\\");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- StrnCatGrow(&FullPath, &Length, PathName, 0);
- StrnCatGrow(&FullPath, &Length, L":\\", 0);
- DeleteMode = ShellCommandLineGetFlag(Package, L"-d");
- NewName = ShellCommandLineGetValue(Package, L"-n");
- if (DeleteMode && ShellCommandLineGetFlag(Package, L"-n")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel2HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-n") && NewName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellLevel2HiiHandle, L"-n");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (NewName != NULL && StrLen(NewName) > 11) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"-n");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = HandleVol(
- FullPath,
- DeleteMode,
- NewName
- );
- }
- }
- }
- }
-
- SHELL_FREE_NON_NULL(FullPath);
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c
deleted file mode 100644
index 1428d37a64..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/** @file
- Main file for Alias shell level 3 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-/**
- Print out each alias registered with the Shell.
-
- @retval STATUS_SUCCESS the printout was sucessful
- @return any return code from GetNextVariableName except EFI_NOT_FOUND
-**/
-SHELL_STATUS
-EFIAPI
-PrintAllShellAlias(
- VOID
- )
-{
- CONST CHAR16 *ConstAllAliasList;
- CHAR16 *Alias;
- CONST CHAR16 *Command;
- CHAR16 *Walker;
- BOOLEAN Volatile;
-
- Volatile = FALSE;
-
- ConstAllAliasList = gEfiShellProtocol->GetAlias(NULL, NULL);
- if (ConstAllAliasList == NULL) {
- return (SHELL_SUCCESS);
- }
- Alias = AllocateZeroPool(StrSize(ConstAllAliasList));
- if (Alias == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- Walker = (CHAR16*)ConstAllAliasList;
-
- do {
- CopyMem(Alias, Walker, StrSize(Walker));
- Walker = StrStr(Alias, L";");
- if (Walker != NULL) {
- Walker[0] = CHAR_NULL;
- Walker = Walker + 1;
- }
- Command = gEfiShellProtocol->GetAlias(Alias, &Volatile);
- if (ShellCommandIsOnAliasList(Alias)) {
- Volatile = FALSE;
- }
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_ALIAS_OUTPUT), gShellLevel3HiiHandle, !Volatile?L' ':L'*', Alias, Command);
- } while (Walker != NULL && Walker[0] != CHAR_NULL);
-
- FreePool(Alias);
-
- return (SHELL_SUCCESS);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-v", TypeFlag},
- {L"-d", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'alias' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunAlias (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Param1;
- CONST CHAR16 *Param2;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- Param2 = ShellCommandLineGetRawValue(Package, 2);
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- if (ShellCommandLineGetCount(Package) == 1) {
- //
- // print out alias'
- //
- Status = PrintAllShellAlias();
- } else if (ShellCommandLineGetFlag(Package, L"-d")) {
- //
- // delete an alias
- //
- Status = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
- } else if (ShellCommandLineGetCount(Package) == 3) {
- //
- // must be adding an alias
- //
- Status = gEfiShellProtocol->SetAlias(Param2, Param1, FALSE, ShellCommandLineGetFlag(Package, L"-v"));
- if (EFI_ERROR(Status)) {
- if (Status == EFI_ACCESS_DENIED) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle);
- ShellStatus = SHELL_ACCESS_DENIED;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- }
- } else if (ShellCommandLineGetCount(Package) == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c
deleted file mode 100644
index dec24776ff..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/** @file
- Main file for attrib shell level 2 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-/**
- Function for 'cls' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunCls (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *Message;
- UINTN Background;
- UINTN ForeColor;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Param1;
-
- ShellStatus = SHELL_SUCCESS;
- ProblemParam = NULL;
- Background = 0;
-
- //
- // Initialize variables
- //
- Message = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else {
- //
- // If there are 0 value parameters, clear sceen
- //
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- if (Param1 == NULL) {
- //
- // clear screen
- //
- gST->ConOut->ClearScreen (gST->ConOut);
- } else if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (ShellStrToUintn(Param1) > 7 || StrLen(Param1) > 1 || !ShellIsDecimalDigitCharacter(*Param1)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, Param1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- switch (ShellStrToUintn(Param1)) {
- case 0:
- Background = EFI_BACKGROUND_BLACK;
- break;
- case 1:
- Background = EFI_BACKGROUND_BLUE;
- break;
- case 2:
- Background = EFI_BACKGROUND_GREEN;
- break;
- case 3:
- Background = EFI_BACKGROUND_CYAN;
- break;
- case 4:
- Background = EFI_BACKGROUND_RED;
- break;
- case 5:
- Background = EFI_BACKGROUND_MAGENTA;
- break;
- case 6:
- Background = EFI_BACKGROUND_BROWN;
- break;
- case 7:
- Background = EFI_BACKGROUND_LIGHTGRAY;
- break;
- }
- ForeColor = (~ShellStrToUintn(Param1)) & 0xF;
- Status = gST->ConOut->SetAttribute (gST->ConOut, ForeColor | Background);
- ASSERT_EFI_ERROR(Status);
- Status = gST->ConOut->ClearScreen (gST->ConOut);
- ASSERT_EFI_ERROR(Status);
- }
- }
- }
- }
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- //
- // return the status
- //
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c
deleted file mode 100644
index a34b2a9c84..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/** @file
- Main file for Echo shell level 3 function.
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-on", TypeFlag},
- {L"-off", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'echo' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEcho (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- SHELL_STATUS ShellStatus;
- UINTN ParamCount;
- CHAR16 *ProblemParam;
- UINTN Size;
- CHAR16 *PrintString;
-
- Size = 0;
- ProblemParam = NULL;
- PrintString = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParseEx (ParamList, &Package, &ProblemParam, TRUE, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- if (ShellCommandLineGetFlag(Package, L"-on")) {
- //
- // Turn it on
- //
- ShellCommandSetEchoState(TRUE);
- } else if (ShellCommandLineGetFlag(Package, L"-off")) {
- //
- // turn it off
- //
- ShellCommandSetEchoState(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // output its current state
- //
- if (ShellCommandGetEchoState()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_ECHO_ON), gShellLevel3HiiHandle);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_ECHO_OFF), gShellLevel3HiiHandle);
- }
- } else {
- //
- // print the line
- //
- for ( ParamCount = 1
- ; ShellCommandLineGetRawValue(Package, ParamCount) != NULL
- ; ParamCount++
- ) {
- StrnCatGrow(&PrintString, &Size, ShellCommandLineGetRawValue(Package, ParamCount), 0);
- if (ShellCommandLineGetRawValue(Package, ParamCount+1) != NULL) {
- StrnCatGrow(&PrintString, &Size, L" ", 0);
- }
- }
- ShellPrintEx(-1, -1, L"%s\r\n", PrintString);
- SHELL_FREE_NON_NULL(PrintString);
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c
deleted file mode 100644
index ce1eb1fcf0..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/** @file
- Main file for GetMtc shell level 3 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-/**
- Function for 'getmtc' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunGetMtc (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINT64 Mtc;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Get the monotonic counter count
- //
- Status = gBS->GetNextMonotonicCount(&Mtc);
- switch(Status) {
- case EFI_DEVICE_ERROR:
- ShellStatus = SHELL_DEVICE_ERROR;
- break;
- case EFI_SECURITY_VIOLATION:
- ShellStatus = SHELL_SECURITY_VIOLATION;
- break;
- default:
- if (EFI_ERROR(Status)) {
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- }
-
- //
- // print it...
- //
- if (ShellStatus == SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GET_MTC_OUTPUT), gShellLevel3HiiHandle, Mtc);
- }
- }
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c
deleted file mode 100644
index 1c643b0e57..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/** @file
- Main file for Help shell level 3 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-usage", TypeFlag},
- {L"-section", TypeMaxValue},
- {L"-verbose", TypeFlag},
- {L"-v", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'help' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunHelp (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CHAR16 *OutText;
- CONST COMMAND_LIST *CommandList;
- CONST COMMAND_LIST *Node;
- CHAR16 *CommandToGetHelpOn;
- CHAR16 *SectionToGetHelpOn;
- CHAR16 *HiiString;
- BOOLEAN Found;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- OutText = NULL;
- CommandToGetHelpOn = NULL;
- SectionToGetHelpOn = NULL;
- Found = FALSE;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // Check for conflicting parameters.
- //
- if (ShellCommandLineGetFlag(Package, L"-usage")
- &&ShellCommandLineGetFlag(Package, L"-section")
- &&(ShellCommandLineGetFlag(Package, L"-verbose") || ShellCommandLineGetFlag(Package, L"-v"))
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Get the command name we are getting help on
- //
- ASSERT(CommandToGetHelpOn == NULL);
- StrnCatGrow(&CommandToGetHelpOn, NULL, ShellCommandLineGetRawValue(Package, 1), 0);
- if (CommandToGetHelpOn == NULL && ShellCommandLineGetFlag(Package, L"-?")) {
- //
- // If we dont have a command and we got a simple -?
- // we are looking for help on help command.
- //
- StrnCatGrow(&CommandToGetHelpOn, NULL, L"help", 0);
- }
-
- if (CommandToGetHelpOn == NULL) {
- StrnCatGrow(&CommandToGetHelpOn, NULL, L"*", 0);
- ASSERT(SectionToGetHelpOn == NULL);
- StrnCatGrow(&SectionToGetHelpOn, NULL, L"NAME", 0);
- } else {
- ASSERT(SectionToGetHelpOn == NULL);
- //
- // Get the section name for the given command name
- //
- if (ShellCommandLineGetFlag(Package, L"-section")) {
- StrnCatGrow(&SectionToGetHelpOn, NULL, ShellCommandLineGetValue(Package, L"-section"), 0);
- } else if (ShellCommandLineGetFlag(Package, L"-usage")) {
- StrnCatGrow(&SectionToGetHelpOn, NULL, L"NAME,SYNOPSIS", 0);
- } else if (ShellCommandLineGetFlag(Package, L"-verbose") || ShellCommandLineGetFlag(Package, L"-v")) {
- } else {
- StrnCatGrow(&SectionToGetHelpOn, NULL, L"NAME", 0);
- }
- }
-
- if (gUnicodeCollation->StriColl(gUnicodeCollation, CommandToGetHelpOn, L"special") == 0) {
- //
- // we need info on the special characters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_SC_HEADER), gShellLevel3HiiHandle);
- HiiString = HiiGetString(gShellLevel3HiiHandle, STRING_TOKEN(STR_HELP_SC_DATA), NULL);
- ShellPrintEx(-1, -1, L"%s", HiiString);
- FreePool(HiiString);
- Found = TRUE;
- } else {
- CommandList = ShellCommandGetCommandList(TRUE);
- ASSERT(CommandList != NULL);
- for ( Node = (COMMAND_LIST*)GetFirstNode(&CommandList->Link)
- ; CommandList != NULL && !IsListEmpty(&CommandList->Link) && !IsNull(&CommandList->Link, &Node->Link)
- ; Node = (COMMAND_LIST*)GetNextNode(&CommandList->Link, &Node->Link)
- ){
- if ((gUnicodeCollation->MetaiMatch(gUnicodeCollation, Node->CommandString, CommandToGetHelpOn)) ||
- (gEfiShellProtocol->GetAlias(CommandToGetHelpOn, NULL) != NULL && (gUnicodeCollation->MetaiMatch(gUnicodeCollation, Node->CommandString, (CHAR16*)(gEfiShellProtocol->GetAlias(CommandToGetHelpOn, NULL)))))) {
- //
- // We have a command to look for help on.
- //
- Status = gEfiShellProtocol->GetHelpText(Node->CommandString, SectionToGetHelpOn, &OutText);
- if (EFI_ERROR(Status) || OutText == NULL) {
- if (Status == EFI_DEVICE_ERROR) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_INV), gShellLevel3HiiHandle, Node->CommandString);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_NF), gShellLevel3HiiHandle, Node->CommandString);
- }
- ShellStatus = SHELL_NOT_FOUND;
- } else {
- while (OutText[StrLen(OutText)-1] == L'\r' || OutText[StrLen(OutText)-1] == L'\n' || OutText[StrLen(OutText)-1] == L' ') {
- OutText[StrLen(OutText)-1] = CHAR_NULL;
- }
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_COMMAND), gShellLevel3HiiHandle, Node->CommandString, OutText);
- FreePool(OutText);
- OutText = NULL;
- Found = TRUE;
- }
- }
- }
- }
-
- if (!Found && ShellStatus == SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_NF), gShellLevel3HiiHandle, CommandToGetHelpOn);
- ShellStatus = SHELL_NOT_FOUND;
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
- }
- if (CommandToGetHelpOn != NULL) {
- FreePool(CommandToGetHelpOn);
- }
- if (SectionToGetHelpOn != NULL) {
- FreePool(SectionToGetHelpOn);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c
deleted file mode 100644
index bedd591c0d..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/** @file
- Main file for Pause shell level 3 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-q", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'pause' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunPause (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- SHELL_PROMPT_RESPONSE *Resp;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- if (!gEfiShellProtocol->BatchIsActive()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_SCRIPT_ONLY), gShellLevel3HiiHandle);
- return (SHELL_UNSUPPORTED);
- }
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (!ShellCommandLineGetFlag(Package, L"-q")) {
- Status = ShellPromptForResponseHii(ShellPromptResponseTypeQuitContinue, STRING_TOKEN (STR_PAUSE_PROMPT), gShellLevel3HiiHandle, (VOID**)&Resp);
- } else {
- Status = ShellPromptForResponse(ShellPromptResponseTypeQuitContinue, NULL, (VOID**)&Resp);
- }
-
- if (EFI_ERROR(Status) || Resp == NULL || *Resp == ShellPromptResponseQuit) {
- ShellCommandRegisterExit(TRUE, 0);
- ShellStatus = SHELL_ABORTED;
- }
-
- if (Resp != NULL) {
- FreePool(Resp);
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c
deleted file mode 100644
index 29f6be3931..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/** @file
- Main file for Touch shell level 3 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-/**
- Do the touch operation on a single handle.
-
- @param[in] Handle The handle to update the date/time on.
-
- @retval EFI_ACCESS_DENIED The file referenced by Handle is read only.
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-TouchFileByHandle (
- IN EFI_HANDLE Handle
- )
-{
- EFI_STATUS Status;
- EFI_FILE_INFO *FileInfo;
-
- FileInfo = gEfiShellProtocol->GetFileInfo(Handle);
- if ((FileInfo->Attribute & EFI_FILE_READ_ONLY) != 0){
- return (EFI_ACCESS_DENIED);
- }
- Status = gRT->GetTime(&FileInfo->ModificationTime, NULL);
- ASSERT_EFI_ERROR(Status);
- CopyMem(&FileInfo->LastAccessTime, &FileInfo->ModificationTime, sizeof(EFI_TIME));
-
- Status = gEfiShellProtocol->SetFileInfo(Handle, FileInfo);
-
- FreePool(FileInfo);
-
- return (Status);
-}
-
-/**
- Touch a given file and potantially recurse down if it was a directory.
-
- @param[in] Name The name of this file.
- @param[in] FS The name of the file system this file is on.
- @param[in] Handle The handle of this file already opened.
- @param[in] Rec TRUE to recurse if possible.
-
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-DoTouchByHandle (
- IN CONST CHAR16 *Name,
- IN CHAR16 *FS,
- IN SHELL_FILE_HANDLE Handle,
- IN BOOLEAN Rec
- )
-{
- EFI_STATUS Status;
- EFI_SHELL_FILE_INFO *FileList;
- EFI_SHELL_FILE_INFO *Walker;
- CHAR16 *TempSpot;
-
- Status = EFI_SUCCESS;
- FileList = NULL;
- Walker = NULL;
-
- if (FS == NULL) {
- FS = StrnCatGrow(&FS, NULL, Name, 0);
- if (FS != NULL) {
- TempSpot = StrStr(FS, L"\\");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- }
- }
- if (FS == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // do it
- //
- Status = TouchFileByHandle(Handle);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Name, Status);
- return (Status);
- }
-
- //
- // if it's a directory recurse...
- //
- if (FileHandleIsDirectory(Handle) == EFI_SUCCESS && Rec) {
- //
- // get each file under this directory
- //
- if (EFI_ERROR(gEfiShellProtocol->FindFilesInDir(Handle, &FileList))) {
- Status = EFI_INVALID_PARAMETER;
- }
-
- //
- // recurse on each
- //
- for (Walker = (EFI_SHELL_FILE_INFO *)GetFirstNode(&FileList->Link)
- ; FileList != NULL && !IsNull(&FileList->Link, &Walker->Link) && !EFI_ERROR(Status)
- ; Walker = (EFI_SHELL_FILE_INFO *)GetNextNode(&FileList->Link, &Walker->Link)
- ){
- if ( (StrCmp(Walker->FileName, L".") != 0)
- && (StrCmp(Walker->FileName, L"..") != 0)
- ){
- //
- // Open the file since we need that handle.
- //
- Status = gEfiShellProtocol->OpenFileByName (Walker->FullName, &Walker->Handle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Walker->FullName, Status);
- Status = EFI_ACCESS_DENIED;
- } else {
- Status = DoTouchByHandle(Walker->FullName, FS, Walker->Handle, TRUE);
- gEfiShellProtocol->CloseFile(Walker->Handle);
- Walker->Handle = NULL;
- }
- }
- }
-
- //
- // free stuff
- //
- if (FileList != NULL && EFI_ERROR(gEfiShellProtocol->FreeFileList(&FileList))) {
- Status = EFI_INVALID_PARAMETER;
- }
- }
-
- return (Status);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-r", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'touch' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunTouch (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- CONST CHAR16 *Param;
- SHELL_STATUS ShellStatus;
- UINTN ParamCount;
- EFI_SHELL_FILE_INFO *FileList;
- EFI_SHELL_FILE_INFO *Node;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- ParamCount = 0;
- FileList = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // we insufficient parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // get a list with each file specified by parameters
- // if parameter is a directory then add all the files below it to the list
- //
- for ( ParamCount = 1, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ; Param != NULL
- ; ParamCount++, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ){
- Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, &FileList);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, (CHAR16*)Param);
- ShellStatus = SHELL_NOT_FOUND;
- break;
- }
- //
- // make sure we completed the param parsing sucessfully...
- // Also make sure that any previous action was sucessful
- //
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // check that we have at least 1 file
- //
- if (FileList == NULL || IsListEmpty(&FileList->Link)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, Param);
- continue;
- } else {
- //
- // loop through the list and make sure we are not aborting...
- //
- for ( Node = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link) && !ShellGetExecutionBreakFlag()
- ; Node = (EFI_SHELL_FILE_INFO*)GetNextNode(&FileList->Link, &Node->Link)
- ){
- //
- // make sure the file opened ok
- //
- if (EFI_ERROR(Node->Status)){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Node->FileName, Node->Status);
- ShellStatus = SHELL_NOT_FOUND;
- continue;
- }
-
- Status = DoTouchByHandle(Node->FullName, NULL, Node->Handle, ShellCommandLineGetFlag(Package, L"-r"));
- if (EFI_ERROR(Status) && Status != EFI_ACCESS_DENIED) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Node->FileName, Status);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- }
- }
- //
- // Free the fileList
- //
- if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
- Status = ShellCloseFileMetaArg(&FileList);
- ASSERT_EFI_ERROR(Status);
- }
- FileList = NULL;
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- if (ShellGetExecutionBreakFlag()) {
- return (SHELL_ABORTED);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c
deleted file mode 100644
index 3e4ccb36e3..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/** @file
- Main file for Type shell level 3 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-/**
- Display a single file to StdOut.
-
- If both Ascii and UCS2 are FALSE attempt to discover the file type.
-
- @param[in] Handle The handle to the file to display.
- @param[in] Ascii TRUE to force ASCII, FALSE othewise.
- @param[in] UCS2 TRUE to force UCS2, FALSE othewise.
-
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-TypeFileByHandle (
- IN EFI_HANDLE Handle,
- BOOLEAN Ascii,
- BOOLEAN UCS2
- )
-{
- UINTN ReadSize;
- VOID *Buffer;
- EFI_STATUS Status;
- UINTN LoopVar;
- CHAR16 AsciiChar;
-
- ReadSize = PcdGet16(PcdShellFileOperationSize);
- Buffer = AllocateZeroPool(ReadSize);
- if (Buffer == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- Status = ShellSetFilePosition(Handle, 0);
- ASSERT_EFI_ERROR(Status);
-
- while (ReadSize == ((UINTN)PcdGet16(PcdShellFileOperationSize))){
- ZeroMem(Buffer, ReadSize);
- Status = ShellReadFile(Handle, &ReadSize, Buffer);
- if (EFI_ERROR(Status)){
- break;
- }
-
- if (!(Ascii|UCS2)){
- if (*(UINT16*)Buffer == gUnicodeFileTag) {
- UCS2 = TRUE;
- Buffer = ((UINT16*)Buffer) + 1;
- } else {
- Ascii = TRUE;
- }
- }
-
- //
- // We want to use plain Print function here! (no color support for files)
- //
- if (Ascii){
- for (LoopVar = 0 ; LoopVar < ReadSize ; LoopVar++) {
- AsciiChar = CHAR_NULL;
- AsciiChar = ((CHAR8*)Buffer)[LoopVar];
- if (AsciiChar == CHAR_NULL) {
- AsciiChar = '.';
- }
- Print(L"%c", AsciiChar);
- }
- } else {
- Print(L"%s", Buffer);
- }
- }
- Print(L"\r\n", Buffer);
- return (Status);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-a", TypeFlag},
- {L"-u", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'type' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunType (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- CONST CHAR16 *Param;
- SHELL_STATUS ShellStatus;
- UINTN ParamCount;
- EFI_SHELL_FILE_INFO *FileList;
- EFI_SHELL_FILE_INFO *Node;
- BOOLEAN AsciiMode;
- BOOLEAN UnicodeMode;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- ParamCount = 0;
- FileList = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- AsciiMode = ShellCommandLineGetFlag(Package, L"-a");
- UnicodeMode = ShellCommandLineGetFlag(Package, L"-u");
-
- if (AsciiMode && UnicodeMode) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"-a & -u");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // we insufficient parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // get a list with each file specified by parameters
- // if parameter is a directory then add all the files below it to the list
- //
- for ( ParamCount = 1, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ; Param != NULL
- ; ParamCount++, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ){
- Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ, &FileList);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, (CHAR16*)Param);
- ShellStatus = SHELL_NOT_FOUND;
- break;
- }
- //
- // make sure we completed the param parsing sucessfully...
- // Also make sure that any previous action was sucessful
- //
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // check that we have at least 1 file
- //
- if (FileList == NULL || IsListEmpty(&FileList->Link)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, Param);
- continue;
- } else {
- //
- // loop through the list and make sure we are not aborting...
- //
- for ( Node = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link) && !ShellGetExecutionBreakFlag()
- ; Node = (EFI_SHELL_FILE_INFO*)GetNextNode(&FileList->Link, &Node->Link)
- ){
- //
- // make sure the file opened ok
- //
- if (EFI_ERROR(Node->Status)){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Node->FileName, Node->Status);
- ShellStatus = SHELL_NOT_FOUND;
- continue;
- }
-
- //
- // make sure its not a directory
- //
- if (FileHandleIsDirectory(Node->Handle) == EFI_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_IS_DIR), gShellLevel3HiiHandle, Node->FileName);
- ShellStatus = SHELL_NOT_FOUND;
- continue;
- }
-
- //
- // do it
- //
- Status = TypeFileByHandle(Node->Handle, AsciiMode, UnicodeMode);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TYP_ERROR), gShellLevel3HiiHandle, Node->FileName, Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- ASSERT(ShellStatus == SHELL_SUCCESS);
- }
- }
- }
- //
- // Free the fileList
- //
- if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
- Status = ShellCloseFileMetaArg(&FileList);
- }
- ASSERT_EFI_ERROR(Status);
- FileList = NULL;
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- if (ShellGetExecutionBreakFlag()) {
- return (SHELL_ABORTED);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c
deleted file mode 100644
index e784872d63..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/** @file
- Main file for NULL named library for level 3 shell command functions.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-#include "UefiShellLevel3CommandsLib.h"
-
-CONST CHAR16 gShellLevel3FileName[] = L"ShellCommands";
-EFI_HANDLE gShellLevel3HiiHandle = NULL;
-
-/**
- return the filename to get help from is not using HII.
-
- @retval The filename.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandGetManFileNameLevel3 (
- VOID
- )
-{
- return (gShellLevel3FileName);
-}
-
-/**
- Constructor for the Shell Level 3 Commands library.
-
- Install the handlers for level 3 UEFI Shell 2.0 commands.
-
- @param ImageHandle the image handle of the process
- @param SystemTable the EFI System Table pointer
-
- @retval EFI_SUCCESS the shell command handlers were installed sucessfully
- @retval EFI_UNSUPPORTED the shell level required was not found.
-**/
-EFI_STATUS
-EFIAPI
-ShellLevel3CommandsLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- gShellLevel3HiiHandle = NULL;
- //
- // if shell level is less than 3 do nothing
- //
- if (PcdGet8(PcdShellSupportLevel) < 3) {
- return (EFI_SUCCESS);
- }
-
- gShellLevel3HiiHandle = HiiAddPackages (&gShellLevel3HiiGuid, gImageHandle, UefiShellLevel3CommandsLibStrings, NULL);
- if (gShellLevel3HiiHandle == NULL) {
- return (EFI_DEVICE_ERROR);
- }
- //
- // install our shell command handlers that are always installed
- //
- // Note: that Time, Timezone, and Date are part of level 2 library
- //
- ShellCommandRegisterCommandName(L"type", ShellCommandRunType , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_TYPE));
- ShellCommandRegisterCommandName(L"touch", ShellCommandRunTouch , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_TOUCH));
- ShellCommandRegisterCommandName(L"ver", ShellCommandRunVer , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_VER));
- ShellCommandRegisterCommandName(L"alias", ShellCommandRunAlias , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_ALIAS));
- ShellCommandRegisterCommandName(L"cls", ShellCommandRunCls , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_CLS));
- ShellCommandRegisterCommandName(L"echo", ShellCommandRunEcho , ShellCommandGetManFileNameLevel3, 3, L"", FALSE, gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_ECHO));
- ShellCommandRegisterCommandName(L"pause", ShellCommandRunPause , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_PAUSE));
- ShellCommandRegisterCommandName(L"getmtc", ShellCommandRunGetMtc , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_GETMTC));
- ShellCommandRegisterCommandName(L"help", ShellCommandRunHelp , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_HELP));
-
- return (EFI_SUCCESS);
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param ImageHandle The image handle of the process.
- @param SystemTable The EFI System Table pointer.
-**/
-EFI_STATUS
-EFIAPI
-ShellLevel3CommandsLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (gShellLevel3HiiHandle != NULL) {
- HiiRemovePackages(gShellLevel3HiiHandle);
- }
- return (EFI_SUCCESS);
-}
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h
deleted file mode 100644
index bd5b9bec9c..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/** @file
- header file for NULL named library for level 3 shell command functions.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_SHELL_LEVEL3_COMMANDS_LIB_H_
-#define _UEFI_SHELL_LEVEL3_COMMANDS_LIB_H_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/ShellLibHiiGuid.h>
-
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/DevicePath.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/UnicodeCollation.h>
-
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/ShellLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HiiLib.h>
-#include <Library/FileHandleLib.h>
-
-extern EFI_HANDLE gShellLevel3HiiHandle;
-
-/**
- Function for 'type' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunType (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'touch' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunTouch (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'ver' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunVer (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'alias' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunAlias (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'cls' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunCls (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'echo' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEcho (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'pause' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunPause (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'getmtc' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunGetMtc (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'help' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunHelp (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-#endif
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
deleted file mode 100644
index 936476d0d5..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
+++ /dev/null
@@ -1,69 +0,0 @@
-## @file
-# Provides shell level 3 functions
-# Note that the interactive versions of the time, date, and timezone functions are handled in the level 2 library.
-#
-# Copyright (c) 2009-2011, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellLevel3CommandsLib
- FILE_GUID = 71374B42-85D7-4753-AD17-AA84C3A0EB93
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = ShellLevel3CommandsLibConstructor
- DESTRUCTOR = ShellLevel3CommandsLibDestructor
-
-[Sources.common]
-# note that time, timezone, and date are part of the level 2 library
- Type.c
- Touch.c
- Ver.c
- UefiShellLevel3CommandsLib.uni
- UefiShellLevel3CommandsLib.c
- UefiShellLevel3CommandsLib.h
- Cls.c
- Alias.c
- Echo.c
- Pause.c
- GetMtc.c
- Help.c
-
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- ShellCommandLib
- ShellLib
- UefiLib
- UefiRuntimeServicesTableLib
- UefiBootServicesTableLib
- PcdLib
- HiiLib
- FileHandleLib
-
-[Guids]
- gEfiFileInfoGuid
- gShellLevel3HiiGuid
-
-[Pcd.common]
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel
- gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni
deleted file mode 100644
index a50aa28d26..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c
deleted file mode 100644
index e00f4c90f5..0000000000
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/** @file
- Main file for Ver shell level 3 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-s", TypeFlag},
- {L"-terse", TypeFlag},
- {L"-t", TypeFlag},
- {L"-_pa", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'ver' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunVer (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINT8 Level;
-
- Level = PcdGet8(PcdShellSupportLevel);
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
- //
- // we have too many parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (ShellCommandLineGetFlag(Package, L"-s")) {
- ShellPrintHiiEx (
- 0,
- gST->ConOut->Mode->CursorRow,
- NULL,
- STRING_TOKEN (STR_VER_OUTPUT_SIMPLE),
- gShellLevel3HiiHandle,
- gEfiShellProtocol->MajorVersion,
- gEfiShellProtocol->MinorVersion
- );
- } else {
- ShellPrintHiiEx (
- 0,
- gST->ConOut->Mode->CursorRow,
- NULL,
- STRING_TOKEN (STR_VER_OUTPUT_SHELL),
- gShellLevel3HiiHandle,
- SupportLevel[Level],
- gEfiShellProtocol->MajorVersion,
- gEfiShellProtocol->MinorVersion
- );
- if (!ShellCommandLineGetFlag(Package, L"-terse") && !ShellCommandLineGetFlag(Package, L"-t")){
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_VER_EXTRA_STRING),
- gShellLevel3HiiHandle
- );
-
-
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_VER_OUTPUT_UEFI),
- gShellLevel3HiiHandle,
- (gST->Hdr.Revision&0xffff0000)>>16,
- (gST->Hdr.Revision&0x0000ffff),
- gST->FirmwareVendor,
- gST->FirmwareRevision
- );
- }
- }
- //
- // implementation specific support for displaying processor architecture
- //
- if (ShellCommandLineGetFlag(Package, L"-_pa")) {
- ShellPrintEx(-1, -1, L"%d\r\n", sizeof(UINTN)==sizeof(UINT64)?64:32);
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
deleted file mode 100644
index a4cfde3e02..0000000000
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ /dev/null
@@ -1,4059 +0,0 @@
-/** @file
- Provides interface to shell functionality for shell commands and applications.
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLib.h"
-#include <ShellBase.h>
-#include <Library/SortLib.h>
-
-#define FIND_XXXXX_FILE_BUFFER_SIZE (SIZE_OF_EFI_FILE_INFO + MAX_FILE_NAME_LEN)
-
-//
-// globals...
-//
-SHELL_PARAM_ITEM EmptyParamList[] = {
- {NULL, TypeMax}
- };
-SHELL_PARAM_ITEM SfoParamList[] = {
- {L"-sfo", TypeFlag},
- {NULL, TypeMax}
- };
-EFI_SHELL_ENVIRONMENT2 *mEfiShellEnvironment2;
-EFI_SHELL_INTERFACE *mEfiShellInterface;
-EFI_SHELL_PROTOCOL *gEfiShellProtocol;
-EFI_SHELL_PARAMETERS_PROTOCOL *gEfiShellParametersProtocol;
-EFI_HANDLE mEfiShellEnvironment2Handle;
-FILE_HANDLE_FUNCTION_MAP FileFunctionMap;
-
-/**
- Check if a Unicode character is a hexadecimal character.
-
- This internal function checks if a Unicode character is a
- numeric character. The valid hexadecimal characters are
- L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a hexadecmial character.
- @retval FALSE If the Char is not a hexadecmial character.
-
-**/
-BOOLEAN
-EFIAPI
-ShellIsHexaDecimalDigitCharacter (
- IN CHAR16 Char
- )
-{
- return (BOOLEAN) ((Char >= L'0' && Char <= L'9') || (Char >= L'A' && Char <= L'F') || (Char >= L'a' && Char <= L'f'));
-}
-
-/**
- Check if a Unicode character is a decimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid characters are
- L'0' to L'9'.
-
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a hexadecmial character.
- @retval FALSE If the Char is not a hexadecmial character.
-
-**/
-BOOLEAN
-EFIAPI
-ShellIsDecimalDigitCharacter (
- IN CHAR16 Char
- )
-{
- return (BOOLEAN) (Char >= L'0' && Char <= L'9');
-}
-
-/**
- Helper function to find ShellEnvironment2 for constructor.
-
- @param[in] ImageHandle A copy of the calling image's handle.
-
- @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-ShellFindSE2 (
- IN EFI_HANDLE ImageHandle
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *Buffer;
- UINTN BufferSize;
- UINTN HandleIndex;
-
- BufferSize = 0;
- Buffer = NULL;
- Status = gBS->OpenProtocol(ImageHandle,
- &gEfiShellEnvironment2Guid,
- (VOID **)&mEfiShellEnvironment2,
- ImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- //
- // look for the mEfiShellEnvironment2 protocol at a higher level
- //
- if (EFI_ERROR (Status) || !(CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid))){
- //
- // figure out how big of a buffer we need.
- //
- Status = gBS->LocateHandle (ByProtocol,
- &gEfiShellEnvironment2Guid,
- NULL, // ignored for ByProtocol
- &BufferSize,
- Buffer
- );
- //
- // maybe it's not there???
- //
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Buffer = (EFI_HANDLE*)AllocateZeroPool(BufferSize);
- if (Buffer == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- Status = gBS->LocateHandle (ByProtocol,
- &gEfiShellEnvironment2Guid,
- NULL, // ignored for ByProtocol
- &BufferSize,
- Buffer
- );
- }
- if (!EFI_ERROR (Status) && Buffer != NULL) {
- //
- // now parse the list of returned handles
- //
- Status = EFI_NOT_FOUND;
- for (HandleIndex = 0; HandleIndex < (BufferSize/sizeof(Buffer[0])); HandleIndex++) {
- Status = gBS->OpenProtocol(Buffer[HandleIndex],
- &gEfiShellEnvironment2Guid,
- (VOID **)&mEfiShellEnvironment2,
- ImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid)) {
- mEfiShellEnvironment2Handle = Buffer[HandleIndex];
- Status = EFI_SUCCESS;
- break;
- }
- }
- }
- }
- if (Buffer != NULL) {
- FreePool (Buffer);
- }
- return (Status);
-}
-
-/**
- Function to do most of the work of the constructor. Allows for calling
- multiple times without complete re-initialization.
-
- @param[in] ImageHandle A copy of the ImageHandle.
- @param[in] SystemTable A pointer to the SystemTable for the application.
-
- @retval EFI_SUCCESS The operationw as successful.
-**/
-EFI_STATUS
-EFIAPI
-ShellLibConstructorWorker (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- //
- // UEFI 2.0 shell interfaces (used preferentially)
- //
- Status = gBS->OpenProtocol(
- ImageHandle,
- &gEfiShellProtocolGuid,
- (VOID **)&gEfiShellProtocol,
- ImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR(Status)) {
- //
- // Search for the shell protocol
- //
- Status = gBS->LocateProtocol(
- &gEfiShellProtocolGuid,
- NULL,
- (VOID **)&gEfiShellProtocol
- );
- if (EFI_ERROR(Status)) {
- gEfiShellProtocol = NULL;
- }
- }
- Status = gBS->OpenProtocol(
- ImageHandle,
- &gEfiShellParametersProtocolGuid,
- (VOID **)&gEfiShellParametersProtocol,
- ImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR(Status)) {
- gEfiShellParametersProtocol = NULL;
- }
-
- if (gEfiShellParametersProtocol == NULL || gEfiShellProtocol == NULL) {
- //
- // Moved to seperate function due to complexity
- //
- Status = ShellFindSE2(ImageHandle);
-
- if (EFI_ERROR(Status)) {
- DEBUG((DEBUG_ERROR, "Status: 0x%08x\r\n", Status));
- mEfiShellEnvironment2 = NULL;
- }
- Status = gBS->OpenProtocol(ImageHandle,
- &gEfiShellInterfaceGuid,
- (VOID **)&mEfiShellInterface,
- ImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR(Status)) {
- mEfiShellInterface = NULL;
- }
- }
-
- //
- // only success getting 2 of either the old or new, but no 1/2 and 1/2
- //
- if ((mEfiShellEnvironment2 != NULL && mEfiShellInterface != NULL) ||
- (gEfiShellProtocol != NULL && gEfiShellParametersProtocol != NULL) ) {
- if (gEfiShellProtocol != NULL) {
- FileFunctionMap.GetFileInfo = gEfiShellProtocol->GetFileInfo;
- FileFunctionMap.SetFileInfo = gEfiShellProtocol->SetFileInfo;
- FileFunctionMap.ReadFile = gEfiShellProtocol->ReadFile;
- FileFunctionMap.WriteFile = gEfiShellProtocol->WriteFile;
- FileFunctionMap.CloseFile = gEfiShellProtocol->CloseFile;
- FileFunctionMap.DeleteFile = gEfiShellProtocol->DeleteFile;
- FileFunctionMap.GetFilePosition = gEfiShellProtocol->GetFilePosition;
- FileFunctionMap.SetFilePosition = gEfiShellProtocol->SetFilePosition;
- FileFunctionMap.FlushFile = gEfiShellProtocol->FlushFile;
- FileFunctionMap.GetFileSize = gEfiShellProtocol->GetFileSize;
- } else {
- FileFunctionMap.GetFileInfo = (EFI_SHELL_GET_FILE_INFO)FileHandleGetInfo;
- FileFunctionMap.SetFileInfo = (EFI_SHELL_SET_FILE_INFO)FileHandleSetInfo;
- FileFunctionMap.ReadFile = (EFI_SHELL_READ_FILE)FileHandleRead;
- FileFunctionMap.WriteFile = (EFI_SHELL_WRITE_FILE)FileHandleWrite;
- FileFunctionMap.CloseFile = (EFI_SHELL_CLOSE_FILE)FileHandleClose;
- FileFunctionMap.DeleteFile = (EFI_SHELL_DELETE_FILE)FileHandleDelete;
- FileFunctionMap.GetFilePosition = (EFI_SHELL_GET_FILE_POSITION)FileHandleGetPosition;
- FileFunctionMap.SetFilePosition = (EFI_SHELL_SET_FILE_POSITION)FileHandleSetPosition;
- FileFunctionMap.FlushFile = (EFI_SHELL_FLUSH_FILE)FileHandleFlush;
- FileFunctionMap.GetFileSize = (EFI_SHELL_GET_FILE_SIZE)FileHandleGetSize;
- }
- return (EFI_SUCCESS);
- }
- return (EFI_NOT_FOUND);
-}
-/**
- Constructor for the Shell library.
-
- Initialize the library and determine if the underlying is a UEFI Shell 2.0 or an EFI shell.
-
- @param ImageHandle the image handle of the process
- @param SystemTable the EFI System Table pointer
-
- @retval EFI_SUCCESS the initialization was complete sucessfully
- @return others an error ocurred during initialization
-**/
-EFI_STATUS
-EFIAPI
-ShellLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- mEfiShellEnvironment2 = NULL;
- gEfiShellProtocol = NULL;
- gEfiShellParametersProtocol = NULL;
- mEfiShellInterface = NULL;
- mEfiShellEnvironment2Handle = NULL;
-
- //
- // verify that auto initialize is not set false
- //
- if (PcdGetBool(PcdShellLibAutoInitialize) == 0) {
- return (EFI_SUCCESS);
- }
-
- return (ShellLibConstructorWorker(ImageHandle, SystemTable));
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param[in] ImageHandle A copy of the ImageHandle.
- @param[in] SystemTable A pointer to the SystemTable for the application.
-
- @retval EFI_SUCCESS The operation was successful.
- @return An error from the CloseProtocol function.
-**/
-EFI_STATUS
-EFIAPI
-ShellLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (mEfiShellEnvironment2 != NULL) {
- gBS->CloseProtocol(mEfiShellEnvironment2Handle==NULL?ImageHandle:mEfiShellEnvironment2Handle,
- &gEfiShellEnvironment2Guid,
- ImageHandle,
- NULL);
- mEfiShellEnvironment2 = NULL;
- }
- if (mEfiShellInterface != NULL) {
- gBS->CloseProtocol(ImageHandle,
- &gEfiShellInterfaceGuid,
- ImageHandle,
- NULL);
- mEfiShellInterface = NULL;
- }
- if (gEfiShellProtocol != NULL) {
- gBS->CloseProtocol(ImageHandle,
- &gEfiShellProtocolGuid,
- ImageHandle,
- NULL);
- gEfiShellProtocol = NULL;
- }
- if (gEfiShellParametersProtocol != NULL) {
- gBS->CloseProtocol(ImageHandle,
- &gEfiShellParametersProtocolGuid,
- ImageHandle,
- NULL);
- gEfiShellParametersProtocol = NULL;
- }
- mEfiShellEnvironment2Handle = NULL;
-
- return (EFI_SUCCESS);
-}
-
-/**
- This function causes the shell library to initialize itself. If the shell library
- is already initialized it will de-initialize all the current protocol poitners and
- re-populate them again.
-
- When the library is used with PcdShellLibAutoInitialize set to true this function
- will return EFI_SUCCESS and perform no actions.
-
- This function is intended for internal access for shell commands only.
-
- @retval EFI_SUCCESS the initialization was complete sucessfully
-
-**/
-EFI_STATUS
-EFIAPI
-ShellInitialize (
- )
-{
- //
- // if auto initialize is not false then skip
- //
- if (PcdGetBool(PcdShellLibAutoInitialize) != 0) {
- return (EFI_SUCCESS);
- }
-
- //
- // deinit the current stuff
- //
- ASSERT_EFI_ERROR(ShellLibDestructor(gImageHandle, gST));
-
- //
- // init the new stuff
- //
- return (ShellLibConstructorWorker(gImageHandle, gST));
-}
-
-/**
- This function will retrieve the information about the file for the handle
- specified and store it in allocated pool memory.
-
- This function allocates a buffer to store the file's information. It is the
- caller's responsibility to free the buffer
-
- @param FileHandle The file handle of the file for which information is
- being requested.
-
- @retval NULL information could not be retrieved.
-
- @return the information about the file
-**/
-EFI_FILE_INFO*
-EFIAPI
-ShellGetFileInfo (
- IN SHELL_FILE_HANDLE FileHandle
- )
-{
- return (FileFunctionMap.GetFileInfo(FileHandle));
-}
-
-/**
- This function sets the information about the file for the opened handle
- specified.
-
- @param[in] FileHandle The file handle of the file for which information
- is being set.
-
- @param[in] FileInfo The information to set.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER A parameter was out of range or invalid.
- @retval EFI_UNSUPPORTED The FileHandle does not support FileInfo.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-ShellSetFileInfo (
- IN SHELL_FILE_HANDLE FileHandle,
- IN EFI_FILE_INFO *FileInfo
- )
-{
- return (FileFunctionMap.SetFileInfo(FileHandle, FileInfo));
-}
-
- /**
- This function will open a file or directory referenced by DevicePath.
-
- This function opens a file with the open mode according to the file path. The
- Attributes is valid only for EFI_FILE_MODE_CREATE.
-
- @param FilePath on input the device path to the file. On output
- the remaining device path.
- @param DeviceHandle pointer to the system device handle.
- @param FileHandle pointer to the file handle.
- @param OpenMode the mode to open the file with.
- @param Attributes the file's file attributes.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED Could not open the file path.
- @retval EFI_NOT_FOUND The specified file could not be found on the
- device or the file system could not be found on
- the device.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the
- medium is no longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the
- file.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-ShellOpenFileByDevicePath(
- IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,
- OUT EFI_HANDLE *DeviceHandle,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode,
- IN UINT64 Attributes
- )
-{
- CHAR16 *FileName;
- EFI_STATUS Status;
- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *EfiSimpleFileSystemProtocol;
- EFI_FILE_PROTOCOL *Handle1;
- EFI_FILE_PROTOCOL *Handle2;
- CHAR16 *FnafPathName;
- UINTN PathLen;
-
- if (FilePath == NULL || FileHandle == NULL || DeviceHandle == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // which shell interface should we use
- //
- if (gEfiShellProtocol != NULL) {
- //
- // use UEFI Shell 2.0 method.
- //
- FileName = gEfiShellProtocol->GetFilePathFromDevicePath(*FilePath);
- if (FileName == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- Status = ShellOpenFileByName(FileName, FileHandle, OpenMode, Attributes);
- FreePool(FileName);
- return (Status);
- }
-
-
- //
- // use old shell method.
- //
- Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid,
- FilePath,
- DeviceHandle);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- Status = gBS->OpenProtocol(*DeviceHandle,
- &gEfiSimpleFileSystemProtocolGuid,
- (VOID**)&EfiSimpleFileSystemProtocol,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- Status = EfiSimpleFileSystemProtocol->OpenVolume(EfiSimpleFileSystemProtocol, &Handle1);
- if (EFI_ERROR (Status)) {
- FileHandle = NULL;
- return Status;
- }
-
- //
- // go down directories one node at a time.
- //
- while (!IsDevicePathEnd (*FilePath)) {
- //
- // For file system access each node should be a file path component
- //
- if (DevicePathType (*FilePath) != MEDIA_DEVICE_PATH ||
- DevicePathSubType (*FilePath) != MEDIA_FILEPATH_DP
- ) {
- FileHandle = NULL;
- return (EFI_INVALID_PARAMETER);
- }
- //
- // Open this file path node
- //
- Handle2 = Handle1;
- Handle1 = NULL;
-
- //
- // File Name Alignment Fix (FNAF)
- // Handle2->Open may be incapable of handling a unaligned CHAR16 data.
- // The structure pointed to by FilePath may be not CHAR16 aligned.
- // This code copies the potentially unaligned PathName data from the
- // FilePath structure to the aligned FnafPathName for use in the
- // calls to Handl2->Open.
- //
-
- //
- // Determine length of PathName, in bytes.
- //
- PathLen = DevicePathNodeLength (*FilePath) - SIZE_OF_FILEPATH_DEVICE_PATH;
-
- //
- // Allocate memory for the aligned copy of the string Extra allocation is to allow for forced alignment
- // Copy bytes from possibly unaligned location to aligned location
- //
- FnafPathName = AllocateCopyPool(PathLen, (UINT8 *)((FILEPATH_DEVICE_PATH*)*FilePath)->PathName);
- if (FnafPathName == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Try to test opening an existing file
- //
- Status = Handle2->Open (
- Handle2,
- &Handle1,
- FnafPathName,
- OpenMode &~EFI_FILE_MODE_CREATE,
- 0
- );
-
- //
- // see if the error was that it needs to be created
- //
- if ((EFI_ERROR (Status)) && (OpenMode != (OpenMode &~EFI_FILE_MODE_CREATE))) {
- Status = Handle2->Open (
- Handle2,
- &Handle1,
- FnafPathName,
- OpenMode,
- Attributes
- );
- }
-
- //
- // Free the alignment buffer
- //
- FreePool(FnafPathName);
-
- //
- // Close the last node
- //
- Handle2->Close (Handle2);
-
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- //
- // Get the next node
- //
- *FilePath = NextDevicePathNode (*FilePath);
- }
-
- //
- // This is a weak spot since if the undefined SHELL_FILE_HANDLE format changes this must change also!
- //
- *FileHandle = (VOID*)Handle1;
- return (EFI_SUCCESS);
-}
-
-/**
- This function will open a file or directory referenced by filename.
-
- If return is EFI_SUCCESS, the Filehandle is the opened file's handle;
- otherwise, the Filehandle is NULL. The Attributes is valid only for
- EFI_FILE_MODE_CREATE.
-
- if FileName is NULL then ASSERT()
-
- @param FileName pointer to file name
- @param FileHandle pointer to the file handle.
- @param OpenMode the mode to open the file with.
- @param Attributes the file's file attributes.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED Could not open the file path.
- @retval EFI_NOT_FOUND The specified file could not be found on the
- device or the file system could not be found
- on the device.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the
- medium is no longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the
- file.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-ShellOpenFileByName(
- IN CONST CHAR16 *FileName,
- OUT SHELL_FILE_HANDLE *FileHandle,
- IN UINT64 OpenMode,
- IN UINT64 Attributes
- )
-{
- EFI_HANDLE DeviceHandle;
- EFI_DEVICE_PATH_PROTOCOL *FilePath;
- EFI_STATUS Status;
- EFI_FILE_INFO *FileInfo;
-
- //
- // ASSERT if FileName is NULL
- //
- ASSERT(FileName != NULL);
-
- if (FileName == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- if (gEfiShellProtocol != NULL) {
- if ((OpenMode & EFI_FILE_MODE_CREATE) == EFI_FILE_MODE_CREATE && (Attributes & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) {
- return ShellCreateDirectory(FileName, FileHandle);
- }
- //
- // Use UEFI Shell 2.0 method
- //
- Status = gEfiShellProtocol->OpenFileByName(FileName,
- FileHandle,
- OpenMode);
- if (StrCmp(FileName, L"NUL") != 0 && !EFI_ERROR(Status) && ((OpenMode & EFI_FILE_MODE_CREATE) != 0)){
- FileInfo = FileFunctionMap.GetFileInfo(*FileHandle);
- ASSERT(FileInfo != NULL);
- FileInfo->Attribute = Attributes;
- Status = FileFunctionMap.SetFileInfo(*FileHandle, FileInfo);
- FreePool(FileInfo);
- }
- return (Status);
- }
- //
- // Using EFI Shell version
- // this means convert name to path and call that function
- // since this will use EFI method again that will open it.
- //
- ASSERT(mEfiShellEnvironment2 != NULL);
- FilePath = mEfiShellEnvironment2->NameToPath ((CHAR16*)FileName);
- if (FilePath != NULL) {
- return (ShellOpenFileByDevicePath(&FilePath,
- &DeviceHandle,
- FileHandle,
- OpenMode,
- Attributes));
- }
- return (EFI_DEVICE_ERROR);
-}
-/**
- This function create a directory
-
- If return is EFI_SUCCESS, the Filehandle is the opened directory's handle;
- otherwise, the Filehandle is NULL. If the directory already existed, this
- function opens the existing directory.
-
- @param DirectoryName pointer to directory name
- @param FileHandle pointer to the file handle.
-
- @retval EFI_SUCCESS The information was set.
- @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED Could not open the file path.
- @retval EFI_NOT_FOUND The specified file could not be found on the
- device or the file system could not be found
- on the device.
- @retval EFI_NO_MEDIA The device has no medium.
- @retval EFI_MEDIA_CHANGED The device has a different medium in it or the
- medium is no longer supported.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened read only.
- @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the
- file.
- @retval EFI_VOLUME_FULL The volume is full.
- @sa ShellOpenFileByName
-**/
-EFI_STATUS
-EFIAPI
-ShellCreateDirectory(
- IN CONST CHAR16 *DirectoryName,
- OUT SHELL_FILE_HANDLE *FileHandle
- )
-{
- if (gEfiShellProtocol != NULL) {
- //
- // Use UEFI Shell 2.0 method
- //
- return (gEfiShellProtocol->CreateFile(DirectoryName,
- EFI_FILE_DIRECTORY,
- FileHandle
- ));
- } else {
- return (ShellOpenFileByName(DirectoryName,
- FileHandle,
- EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE,
- EFI_FILE_DIRECTORY
- ));
- }
-}
-
-/**
- This function reads information from an opened file.
-
- If FileHandle is not a directory, the function reads the requested number of
- bytes from the file at the file's current position and returns them in Buffer.
- If the read goes beyond the end of the file, the read length is truncated to the
- end of the file. The file's current position is increased by the number of bytes
- returned. If FileHandle is a directory, the function reads the directory entry
- at the file's current position and returns the entry in Buffer. If the Buffer
- is not large enough to hold the current directory entry, then
- EFI_BUFFER_TOO_SMALL is returned and the current file position is not updated.
- BufferSize is set to be the size of the buffer needed to read the entry. On
- success, the current position is updated to the next directory entry. If there
- are no more directory entries, the read returns a zero-length buffer.
- EFI_FILE_INFO is the structure returned as the directory entry.
-
- @param FileHandle the opened file handle
- @param BufferSize on input the size of buffer in bytes. on return
- the number of bytes written.
- @param Buffer the buffer to put read data into.
-
- @retval EFI_SUCCESS Data was read.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required
- size.
-
-**/
-EFI_STATUS
-EFIAPI
-ShellReadFile(
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
- )
-{
- return (FileFunctionMap.ReadFile(FileHandle, BufferSize, Buffer));
-}
-
-
-/**
- Write data to a file.
-
- This function writes the specified number of bytes to the file at the current
- file position. The current file position is advanced the actual number of bytes
- written, which is returned in BufferSize. Partial writes only occur when there
- has been a data error during the write attempt (such as "volume space full").
- The file is automatically grown to hold the data if required. Direct writes to
- opened directories are not supported.
-
- @param FileHandle The opened file for writing
- @param BufferSize on input the number of bytes in Buffer. On output
- the number of bytes written.
- @param Buffer the buffer containing data to write is stored.
-
- @retval EFI_SUCCESS Data was written.
- @retval EFI_UNSUPPORTED Writes to an open directory are not supported.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The device is write-protected.
- @retval EFI_ACCESS_DENIED The file was open for read only.
- @retval EFI_VOLUME_FULL The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-ShellWriteFile(
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT UINTN *BufferSize,
- IN VOID *Buffer
- )
-{
- return (FileFunctionMap.WriteFile(FileHandle, BufferSize, Buffer));
-}
-
-/**
- Close an open file handle.
-
- This function closes a specified file handle. All "dirty" cached file data is
- flushed to the device, and the file is closed. In all cases the handle is
- closed.
-
-@param FileHandle the file handle to close.
-
-@retval EFI_SUCCESS the file handle was closed sucessfully.
-**/
-EFI_STATUS
-EFIAPI
-ShellCloseFile (
- IN SHELL_FILE_HANDLE *FileHandle
- )
-{
- return (FileFunctionMap.CloseFile(*FileHandle));
-}
-
-/**
- Delete a file and close the handle
-
- This function closes and deletes a file. In all cases the file handle is closed.
- If the file cannot be deleted, the warning code EFI_WARN_DELETE_FAILURE is
- returned, but the handle is still closed.
-
- @param FileHandle the file handle to delete
-
- @retval EFI_SUCCESS the file was closed sucessfully
- @retval EFI_WARN_DELETE_FAILURE the handle was closed, but the file was not
- deleted
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-ShellDeleteFile (
- IN SHELL_FILE_HANDLE *FileHandle
- )
-{
- return (FileFunctionMap.DeleteFile(*FileHandle));
-}
-
-/**
- Set the current position in a file.
-
- This function sets the current file position for the handle to the position
- supplied. With the exception of seeking to position 0xFFFFFFFFFFFFFFFF, only
- absolute positioning is supported, and seeking past the end of the file is
- allowed (a subsequent write would grow the file). Seeking to position
- 0xFFFFFFFFFFFFFFFF causes the current position to be set to the end of the file.
- If FileHandle is a directory, the only position that may be set is zero. This
- has the effect of starting the read process of the directory entries over.
-
- @param FileHandle The file handle on which the position is being set
- @param Position Byte position from begining of file
-
- @retval EFI_SUCCESS Operation completed sucessfully.
- @retval EFI_UNSUPPORTED the seek request for non-zero is not valid on
- directories.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
-**/
-EFI_STATUS
-EFIAPI
-ShellSetFilePosition (
- IN SHELL_FILE_HANDLE FileHandle,
- IN UINT64 Position
- )
-{
- return (FileFunctionMap.SetFilePosition(FileHandle, Position));
-}
-
-/**
- Gets a file's current position
-
- This function retrieves the current file position for the file handle. For
- directories, the current file position has no meaning outside of the file
- system driver and as such the operation is not supported. An error is returned
- if FileHandle is a directory.
-
- @param FileHandle The open file handle on which to get the position.
- @param Position Byte position from begining of file.
-
- @retval EFI_SUCCESS the operation completed sucessfully.
- @retval INVALID_PARAMETER One of the parameters has an invalid value.
- @retval EFI_UNSUPPORTED the request is not valid on directories.
-**/
-EFI_STATUS
-EFIAPI
-ShellGetFilePosition (
- IN SHELL_FILE_HANDLE FileHandle,
- OUT UINT64 *Position
- )
-{
- return (FileFunctionMap.GetFilePosition(FileHandle, Position));
-}
-/**
- Flushes data on a file
-
- This function flushes all modified data associated with a file to a device.
-
- @param FileHandle The file handle on which to flush data
-
- @retval EFI_SUCCESS The data was flushed.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @retval EFI_WRITE_PROTECTED The file or medium is write protected.
- @retval EFI_ACCESS_DENIED The file was opened for read only.
-**/
-EFI_STATUS
-EFIAPI
-ShellFlushFile (
- IN SHELL_FILE_HANDLE FileHandle
- )
-{
- return (FileFunctionMap.FlushFile(FileHandle));
-}
-
-/** Retrieve first entry from a directory.
-
- This function takes an open directory handle and gets information from the
- first entry in the directory. A buffer is allocated to contain
- the information and a pointer to the buffer is returned in *Buffer. The
- caller can use ShellFindNextFile() to get subsequent directory entries.
-
- The buffer will be freed by ShellFindNextFile() when the last directory
- entry is read. Otherwise, the caller must free the buffer, using FreePool,
- when finished with it.
-
- @param[in] DirHandle The file handle of the directory to search.
- @param[out] Buffer The pointer to the buffer for the file's information.
-
- @retval EFI_SUCCESS Found the first file.
- @retval EFI_NOT_FOUND Cannot find the directory.
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
- @return Others status of ShellGetFileInfo, ShellSetFilePosition,
- or ShellReadFile
-**/
-EFI_STATUS
-EFIAPI
-ShellFindFirstFile (
- IN SHELL_FILE_HANDLE DirHandle,
- OUT EFI_FILE_INFO **Buffer
- )
-{
- //
- // pass to file handle lib
- //
- return (FileHandleFindFirstFile(DirHandle, Buffer));
-}
-/** Retrieve next entries from a directory.
-
- To use this function, the caller must first call the ShellFindFirstFile()
- function to get the first directory entry. Subsequent directory entries are
- retrieved by using the ShellFindNextFile() function. This function can
- be called several times to get each entry from the directory. If the call of
- ShellFindNextFile() retrieved the last directory entry, the next call of
- this function will set *NoFile to TRUE and free the buffer.
-
- @param[in] DirHandle The file handle of the directory.
- @param[out] Buffer The pointer to buffer for file's information.
- @param[out] NoFile The pointer to boolean when last file is found.
-
- @retval EFI_SUCCESS Found the next file, or reached last file
- @retval EFI_NO_MEDIA The device has no media.
- @retval EFI_DEVICE_ERROR The device reported an error.
- @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
-**/
-EFI_STATUS
-EFIAPI
-ShellFindNextFile(
- IN SHELL_FILE_HANDLE DirHandle,
- OUT EFI_FILE_INFO *Buffer,
- OUT BOOLEAN *NoFile
- )
-{
- //
- // pass to file handle lib
- //
- return (FileHandleFindNextFile(DirHandle, Buffer, NoFile));
-}
-/**
- Retrieve the size of a file.
-
- if FileHandle is NULL then ASSERT()
- if Size is NULL then ASSERT()
-
- This function extracts the file size info from the FileHandle's EFI_FILE_INFO
- data.
-
- @param FileHandle file handle from which size is retrieved
- @param Size pointer to size
-
- @retval EFI_SUCCESS operation was completed sucessfully
- @retval EFI_DEVICE_ERROR cannot access the file
-**/
-EFI_STATUS
-EFIAPI
-ShellGetFileSize (
- IN SHELL_FILE_HANDLE FileHandle,
- OUT UINT64 *Size
- )
-{
- return (FileFunctionMap.GetFileSize(FileHandle, Size));
-}
-/**
- Retrieves the status of the break execution flag
-
- this function is useful to check whether the application is being asked to halt by the shell.
-
- @retval TRUE the execution break is enabled
- @retval FALSE the execution break is not enabled
-**/
-BOOLEAN
-EFIAPI
-ShellGetExecutionBreakFlag(
- VOID
- )
-{
- //
- // Check for UEFI Shell 2.0 protocols
- //
- if (gEfiShellProtocol != NULL) {
-
- //
- // We are using UEFI Shell 2.0; see if the event has been triggered
- //
- if (gBS->CheckEvent(gEfiShellProtocol->ExecutionBreak) != EFI_SUCCESS) {
- return (FALSE);
- }
- return (TRUE);
- }
-
- //
- // using EFI Shell; call the function to check
- //
- if (mEfiShellEnvironment2 != NULL) {
- return (mEfiShellEnvironment2->GetExecutionBreak());
- }
-
- return (FALSE);
-}
-/**
- return the value of an environment variable
-
- this function gets the value of the environment variable set by the
- ShellSetEnvironmentVariable function
-
- @param EnvKey The key name of the environment variable.
-
- @retval NULL the named environment variable does not exist.
- @return != NULL pointer to the value of the environment variable
-**/
-CONST CHAR16*
-EFIAPI
-ShellGetEnvironmentVariable (
- IN CONST CHAR16 *EnvKey
- )
-{
- //
- // Check for UEFI Shell 2.0 protocols
- //
- if (gEfiShellProtocol != NULL) {
- return (gEfiShellProtocol->GetEnv(EnvKey));
- }
-
- //
- // Check for EFI shell
- //
- if (mEfiShellEnvironment2 != NULL) {
- return (mEfiShellEnvironment2->GetEnv((CHAR16*)EnvKey));
- }
-
- return NULL;
-}
-/**
- set the value of an environment variable
-
-This function changes the current value of the specified environment variable. If the
-environment variable exists and the Value is an empty string, then the environment
-variable is deleted. If the environment variable exists and the Value is not an empty
-string, then the value of the environment variable is changed. If the environment
-variable does not exist and the Value is an empty string, there is no action. If the
-environment variable does not exist and the Value is a non-empty string, then the
-environment variable is created and assigned the specified value.
-
- This is not supported pre-UEFI Shell 2.0.
-
- @param EnvKey The key name of the environment variable.
- @param EnvVal The Value of the environment variable
- @param Volatile Indicates whether the variable is non-volatile (FALSE) or volatile (TRUE).
-
- @retval EFI_SUCCESS the operation was completed sucessfully
- @retval EFI_UNSUPPORTED This operation is not allowed in pre UEFI 2.0 Shell environments
-**/
-EFI_STATUS
-EFIAPI
-ShellSetEnvironmentVariable (
- IN CONST CHAR16 *EnvKey,
- IN CONST CHAR16 *EnvVal,
- IN BOOLEAN Volatile
- )
-{
- //
- // Check for UEFI Shell 2.0 protocols
- //
- if (gEfiShellProtocol != NULL) {
- return (gEfiShellProtocol->SetEnv(EnvKey, EnvVal, Volatile));
- }
-
- //
- // This feature does not exist under EFI shell
- //
- return (EFI_UNSUPPORTED);
-}
-
-/**
- Cause the shell to parse and execute a command line.
-
- This function creates a nested instance of the shell and executes the specified
- command (CommandLine) with the specified environment (Environment). Upon return,
- the status code returned by the specified command is placed in StatusCode.
- If Environment is NULL, then the current environment is used and all changes made
- by the commands executed will be reflected in the current environment. If the
- Environment is non-NULL, then the changes made will be discarded.
- The CommandLine is executed from the current working directory on the current
- device.
-
- The EnvironmentVariables and Status parameters are ignored in a pre-UEFI Shell 2.0
- environment. The values pointed to by the parameters will be unchanged by the
- ShellExecute() function. The Output parameter has no effect in a
- UEFI Shell 2.0 environment.
-
- @param[in] ParentHandle The parent image starting the operation.
- @param[in] CommandLine The pointer to a NULL terminated command line.
- @param[in] Output True to display debug output. False to hide it.
- @param[in] EnvironmentVariables Optional pointer to array of environment variables
- in the form "x=y". If NULL, the current set is used.
- @param[out] Status The status of the run command line.
-
- @retval EFI_SUCCESS The operation completed sucessfully. Status
- contains the status code returned.
- @retval EFI_INVALID_PARAMETER A parameter contains an invalid value.
- @retval EFI_OUT_OF_RESOURCES Out of resources.
- @retval EFI_UNSUPPORTED The operation is not allowed.
-**/
-EFI_STATUS
-EFIAPI
-ShellExecute (
- IN EFI_HANDLE *ParentHandle,
- IN CHAR16 *CommandLine OPTIONAL,
- IN BOOLEAN Output OPTIONAL,
- IN CHAR16 **EnvironmentVariables OPTIONAL,
- OUT EFI_STATUS *Status OPTIONAL
- )
-{
- //
- // Check for UEFI Shell 2.0 protocols
- //
- if (gEfiShellProtocol != NULL) {
- //
- // Call UEFI Shell 2.0 version (not using Output parameter)
- //
- return (gEfiShellProtocol->Execute(ParentHandle,
- CommandLine,
- EnvironmentVariables,
- Status));
- }
-
- //
- // Check for EFI shell
- //
- if (mEfiShellEnvironment2 != NULL) {
- //
- // Call EFI Shell version (not using EnvironmentVariables or Status parameters)
- // Due to oddity in the EFI shell we want to dereference the ParentHandle here
- //
- return (mEfiShellEnvironment2->Execute(*ParentHandle,
- CommandLine,
- Output));
- }
-
- return (EFI_UNSUPPORTED);
-}
-/**
- Retreives the current directory path
-
- If the DeviceName is NULL, it returns the current device's current directory
- name. If the DeviceName is not NULL, it returns the current directory name
- on specified drive.
-
- @param DeviceName the name of the drive to get directory on
-
- @retval NULL the directory does not exist
- @return != NULL the directory
-**/
-CONST CHAR16*
-EFIAPI
-ShellGetCurrentDir (
- IN CHAR16 * CONST DeviceName OPTIONAL
- )
-{
- //
- // Check for UEFI Shell 2.0 protocols
- //
- if (gEfiShellProtocol != NULL) {
- return (gEfiShellProtocol->GetCurDir(DeviceName));
- }
-
- //
- // Check for EFI shell
- //
- if (mEfiShellEnvironment2 != NULL) {
- return (mEfiShellEnvironment2->CurDir(DeviceName));
- }
-
- return (NULL);
-}
-/**
- sets (enabled or disabled) the page break mode
-
- when page break mode is enabled the screen will stop scrolling
- and wait for operator input before scrolling a subsequent screen.
-
- @param CurrentState TRUE to enable and FALSE to disable
-**/
-VOID
-EFIAPI
-ShellSetPageBreakMode (
- IN BOOLEAN CurrentState
- )
-{
- //
- // check for enabling
- //
- if (CurrentState != 0x00) {
- //
- // check for UEFI Shell 2.0
- //
- if (gEfiShellProtocol != NULL) {
- //
- // Enable with UEFI 2.0 Shell
- //
- gEfiShellProtocol->EnablePageBreak();
- return;
- } else {
- //
- // Check for EFI shell
- //
- if (mEfiShellEnvironment2 != NULL) {
- //
- // Enable with EFI Shell
- //
- mEfiShellEnvironment2->EnablePageBreak (DEFAULT_INIT_ROW, DEFAULT_AUTO_LF);
- return;
- }
- }
- } else {
- //
- // check for UEFI Shell 2.0
- //
- if (gEfiShellProtocol != NULL) {
- //
- // Disable with UEFI 2.0 Shell
- //
- gEfiShellProtocol->DisablePageBreak();
- return;
- } else {
- //
- // Check for EFI shell
- //
- if (mEfiShellEnvironment2 != NULL) {
- //
- // Disable with EFI Shell
- //
- mEfiShellEnvironment2->DisablePageBreak ();
- return;
- }
- }
- }
-}
-
-///
-/// version of EFI_SHELL_FILE_INFO struct, except has no CONST pointers.
-/// This allows for the struct to be populated.
-///
-typedef struct {
- LIST_ENTRY Link;
- EFI_STATUS Status;
- CHAR16 *FullName;
- CHAR16 *FileName;
- SHELL_FILE_HANDLE Handle;
- EFI_FILE_INFO *Info;
-} EFI_SHELL_FILE_INFO_NO_CONST;
-
-/**
- Converts a EFI shell list of structures to the coresponding UEFI Shell 2.0 type of list.
-
- if OldStyleFileList is NULL then ASSERT()
-
- this function will convert a SHELL_FILE_ARG based list into a callee allocated
- EFI_SHELL_FILE_INFO based list. it is up to the caller to free the memory via
- the ShellCloseFileMetaArg function.
-
- @param[in] FileList the EFI shell list type
- @param[in, out] ListHead the list to add to
-
- @retval the resultant head of the double linked new format list;
-**/
-LIST_ENTRY*
-EFIAPI
-InternalShellConvertFileListType (
- IN LIST_ENTRY *FileList,
- IN OUT LIST_ENTRY *ListHead
- )
-{
- SHELL_FILE_ARG *OldInfo;
- LIST_ENTRY *Link;
- EFI_SHELL_FILE_INFO_NO_CONST *NewInfo;
-
- //
- // ASSERTs
- //
- ASSERT(FileList != NULL);
- ASSERT(ListHead != NULL);
-
- //
- // enumerate through each member of the old list and copy
- //
- for (Link = FileList->ForwardLink; Link != FileList; Link = Link->ForwardLink) {
- OldInfo = CR (Link, SHELL_FILE_ARG, Link, SHELL_FILE_ARG_SIGNATURE);
- ASSERT(OldInfo != NULL);
-
- //
- // Skip ones that failed to open...
- //
- if (OldInfo->Status != EFI_SUCCESS) {
- continue;
- }
-
- //
- // make sure the old list was valid
- //
- ASSERT(OldInfo->Info != NULL);
- ASSERT(OldInfo->FullName != NULL);
- ASSERT(OldInfo->FileName != NULL);
-
- //
- // allocate a new EFI_SHELL_FILE_INFO object
- //
- NewInfo = AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));
- if (NewInfo == NULL) {
- ShellCloseFileMetaArg((EFI_SHELL_FILE_INFO**)(&ListHead));
- ListHead = NULL;
- break;
- }
-
- //
- // copy the simple items
- //
- NewInfo->Handle = OldInfo->Handle;
- NewInfo->Status = OldInfo->Status;
-
- // old shell checks for 0 not NULL
- OldInfo->Handle = 0;
-
- //
- // allocate new space to copy strings and structure
- //
- NewInfo->FullName = AllocateZeroPool(StrSize(OldInfo->FullName));
- NewInfo->FileName = AllocateZeroPool(StrSize(OldInfo->FileName));
- NewInfo->Info = AllocateZeroPool((UINTN)OldInfo->Info->Size);
-
- //
- // make sure all the memory allocations were sucessful
- //
- if (NULL == NewInfo->FullName || NewInfo->FileName == NULL || NewInfo->Info == NULL) {
- ShellCloseFileMetaArg((EFI_SHELL_FILE_INFO**)(&ListHead));
- ListHead = NULL;
- break;
- }
-
- //
- // Copt the strings and structure
- //
- StrCpy(NewInfo->FullName, OldInfo->FullName);
- StrCpy(NewInfo->FileName, OldInfo->FileName);
- gBS->CopyMem (NewInfo->Info, OldInfo->Info, (UINTN)OldInfo->Info->Size);
-
- //
- // add that to the list
- //
- InsertTailList(ListHead, &NewInfo->Link);
- }
- return (ListHead);
-}
-/**
- Opens a group of files based on a path.
-
- This function uses the Arg to open all the matching files. Each matched
- file has a SHELL_FILE_ARG structure to record the file information. These
- structures are placed on the list ListHead. Users can get the SHELL_FILE_ARG
- structures from ListHead to access each file. This function supports wildcards
- and will process '?' and '*' as such. the list must be freed with a call to
- ShellCloseFileMetaArg().
-
- If you are NOT appending to an existing list *ListHead must be NULL. If
- *ListHead is NULL then it must be callee freed.
-
- @param Arg pointer to path string
- @param OpenMode mode to open files with
- @param ListHead head of linked list of results
-
- @retval EFI_SUCCESS the operation was sucessful and the list head
- contains the list of opened files
- @return != EFI_SUCCESS the operation failed
-
- @sa InternalShellConvertFileListType
-**/
-EFI_STATUS
-EFIAPI
-ShellOpenFileMetaArg (
- IN CHAR16 *Arg,
- IN UINT64 OpenMode,
- IN OUT EFI_SHELL_FILE_INFO **ListHead
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY mOldStyleFileList;
-
- //
- // ASSERT that Arg and ListHead are not NULL
- //
- ASSERT(Arg != NULL);
- ASSERT(ListHead != NULL);
-
- //
- // Check for UEFI Shell 2.0 protocols
- //
- if (gEfiShellProtocol != NULL) {
- if (*ListHead == NULL) {
- *ListHead = (EFI_SHELL_FILE_INFO*)AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));
- if (*ListHead == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- InitializeListHead(&((*ListHead)->Link));
- }
- Status = gEfiShellProtocol->OpenFileList(Arg,
- OpenMode,
- ListHead);
- if (EFI_ERROR(Status)) {
- gEfiShellProtocol->RemoveDupInFileList(ListHead);
- } else {
- Status = gEfiShellProtocol->RemoveDupInFileList(ListHead);
- }
- if (*ListHead != NULL && IsListEmpty(&(*ListHead)->Link)) {
- FreePool(*ListHead);
- *ListHead = NULL;
- return (EFI_NOT_FOUND);
- }
- return (Status);
- }
-
- //
- // Check for EFI shell
- //
- if (mEfiShellEnvironment2 != NULL) {
- //
- // make sure the list head is initialized
- //
- InitializeListHead(&mOldStyleFileList);
-
- //
- // Get the EFI Shell list of files
- //
- Status = mEfiShellEnvironment2->FileMetaArg(Arg, &mOldStyleFileList);
- if (EFI_ERROR(Status)) {
- *ListHead = NULL;
- return (Status);
- }
-
- if (*ListHead == NULL) {
- *ListHead = (EFI_SHELL_FILE_INFO *)AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));
- if (*ListHead == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- InitializeListHead(&((*ListHead)->Link));
- }
-
- //
- // Convert that to equivalent of UEFI Shell 2.0 structure
- //
- InternalShellConvertFileListType(&mOldStyleFileList, &(*ListHead)->Link);
-
- //
- // Free the EFI Shell version that was converted.
- //
- mEfiShellEnvironment2->FreeFileList(&mOldStyleFileList);
-
- if ((*ListHead)->Link.ForwardLink == (*ListHead)->Link.BackLink && (*ListHead)->Link.BackLink == &((*ListHead)->Link)) {
- FreePool(*ListHead);
- *ListHead = NULL;
- Status = EFI_NOT_FOUND;
- }
- return (Status);
- }
-
- return (EFI_UNSUPPORTED);
-}
-/**
- Free the linked list returned from ShellOpenFileMetaArg.
-
- if ListHead is NULL then ASSERT().
-
- @param ListHead the pointer to free.
-
- @retval EFI_SUCCESS the operation was sucessful.
-**/
-EFI_STATUS
-EFIAPI
-ShellCloseFileMetaArg (
- IN OUT EFI_SHELL_FILE_INFO **ListHead
- )
-{
- LIST_ENTRY *Node;
-
- //
- // ASSERT that ListHead is not NULL
- //
- ASSERT(ListHead != NULL);
-
- //
- // Check for UEFI Shell 2.0 protocols
- //
- if (gEfiShellProtocol != NULL) {
- return (gEfiShellProtocol->FreeFileList(ListHead));
- } else if (mEfiShellEnvironment2 != NULL) {
- //
- // Since this is EFI Shell version we need to free our internally made copy
- // of the list
- //
- for ( Node = GetFirstNode(&(*ListHead)->Link)
- ; *ListHead != NULL && !IsListEmpty(&(*ListHead)->Link)
- ; Node = GetFirstNode(&(*ListHead)->Link)) {
- RemoveEntryList(Node);
- ((EFI_FILE_PROTOCOL*)((EFI_SHELL_FILE_INFO_NO_CONST*)Node)->Handle)->Close(((EFI_SHELL_FILE_INFO_NO_CONST*)Node)->Handle);
- FreePool(((EFI_SHELL_FILE_INFO_NO_CONST*)Node)->FullName);
- FreePool(((EFI_SHELL_FILE_INFO_NO_CONST*)Node)->FileName);
- FreePool(((EFI_SHELL_FILE_INFO_NO_CONST*)Node)->Info);
- FreePool((EFI_SHELL_FILE_INFO_NO_CONST*)Node);
- }
- return EFI_SUCCESS;
- }
-
- return (EFI_UNSUPPORTED);
-}
-
-/**
- Find a file by searching the CWD and then the path.
-
- If FileName is NULL then ASSERT.
-
- If the return value is not NULL then the memory must be caller freed.
-
- @param FileName Filename string.
-
- @retval NULL the file was not found
- @return !NULL the full path to the file.
-**/
-CHAR16 *
-EFIAPI
-ShellFindFilePath (
- IN CONST CHAR16 *FileName
- )
-{
- CONST CHAR16 *Path;
- SHELL_FILE_HANDLE Handle;
- EFI_STATUS Status;
- CHAR16 *RetVal;
- CHAR16 *TestPath;
- CONST CHAR16 *Walker;
- UINTN Size;
- CHAR16 *TempChar;
-
- RetVal = NULL;
-
- //
- // First make sure its not an absolute path.
- //
- Status = ShellOpenFileByName(FileName, &Handle, EFI_FILE_MODE_READ, 0);
- if (!EFI_ERROR(Status)){
- if (FileHandleIsDirectory(Handle) != EFI_SUCCESS) {
- ASSERT(RetVal == NULL);
- RetVal = StrnCatGrow(&RetVal, NULL, FileName, 0);
- ShellCloseFile(&Handle);
- return (RetVal);
- } else {
- ShellCloseFile(&Handle);
- }
- }
-
- Path = ShellGetEnvironmentVariable(L"cwd");
- if (Path != NULL) {
- Size = StrSize(Path);
- Size += StrSize(FileName);
- TestPath = AllocateZeroPool(Size);
- if (TestPath == NULL) {
- return (NULL);
- }
- StrCpy(TestPath, Path);
- StrCat(TestPath, FileName);
- Status = ShellOpenFileByName(TestPath, &Handle, EFI_FILE_MODE_READ, 0);
- if (!EFI_ERROR(Status)){
- if (FileHandleIsDirectory(Handle) != EFI_SUCCESS) {
- ASSERT(RetVal == NULL);
- RetVal = StrnCatGrow(&RetVal, NULL, TestPath, 0);
- ShellCloseFile(&Handle);
- FreePool(TestPath);
- return (RetVal);
- } else {
- ShellCloseFile(&Handle);
- }
- }
- FreePool(TestPath);
- }
- Path = ShellGetEnvironmentVariable(L"path");
- if (Path != NULL) {
- Size = StrSize(Path)+sizeof(CHAR16);
- Size += StrSize(FileName);
- TestPath = AllocateZeroPool(Size);
- if (TestPath == NULL) {
- return (NULL);
- }
- Walker = (CHAR16*)Path;
- do {
- CopyMem(TestPath, Walker, StrSize(Walker));
- if (TestPath != NULL) {
- TempChar = StrStr(TestPath, L";");
- if (TempChar != NULL) {
- *TempChar = CHAR_NULL;
- }
- if (TestPath[StrLen(TestPath)-1] != L'\\') {
- StrCat(TestPath, L"\\");
- }
- if (FileName[0] == L'\\') {
- FileName++;
- }
- StrCat(TestPath, FileName);
- if (StrStr(Walker, L";") != NULL) {
- Walker = StrStr(Walker, L";") + 1;
- } else {
- Walker = NULL;
- }
- Status = ShellOpenFileByName(TestPath, &Handle, EFI_FILE_MODE_READ, 0);
- if (!EFI_ERROR(Status)){
- if (FileHandleIsDirectory(Handle) != EFI_SUCCESS) {
- ASSERT(RetVal == NULL);
- RetVal = StrnCatGrow(&RetVal, NULL, TestPath, 0);
- ShellCloseFile(&Handle);
- break;
- } else {
- ShellCloseFile(&Handle);
- }
- }
- }
- } while (Walker != NULL && Walker[0] != CHAR_NULL);
- FreePool(TestPath);
- }
- return (RetVal);
-}
-
-/**
- Find a file by searching the CWD and then the path with a variable set of file
- extensions. If the file is not found it will append each extension in the list
- in the order provided and return the first one that is successful.
-
- If FileName is NULL, then ASSERT.
- If FileExtension is NULL, then behavior is identical to ShellFindFilePath.
-
- If the return value is not NULL then the memory must be caller freed.
-
- @param[in] FileName Filename string.
- @param[in] FileExtension Semi-colon delimeted list of possible extensions.
-
- @retval NULL The file was not found.
- @retval !NULL The path to the file.
-**/
-CHAR16 *
-EFIAPI
-ShellFindFilePathEx (
- IN CONST CHAR16 *FileName,
- IN CONST CHAR16 *FileExtension
- )
-{
- CHAR16 *TestPath;
- CHAR16 *RetVal;
- CONST CHAR16 *ExtensionWalker;
- UINTN Size;
- CHAR16 *TempChar;
- CHAR16 *TempChar2;
-
- ASSERT(FileName != NULL);
- if (FileExtension == NULL) {
- return (ShellFindFilePath(FileName));
- }
- RetVal = ShellFindFilePath(FileName);
- if (RetVal != NULL) {
- return (RetVal);
- }
- Size = StrSize(FileName);
- Size += StrSize(FileExtension);
- TestPath = AllocateZeroPool(Size);
- if (TestPath == NULL) {
- return (NULL);
- }
- for (ExtensionWalker = FileExtension, TempChar2 = (CHAR16*)FileExtension; TempChar2 != NULL ; ExtensionWalker = TempChar2 + 1){
- StrCpy(TestPath, FileName);
- if (ExtensionWalker != NULL) {
- StrCat(TestPath, ExtensionWalker);
- }
- TempChar = StrStr(TestPath, L";");
- if (TempChar != NULL) {
- *TempChar = CHAR_NULL;
- }
- RetVal = ShellFindFilePath(TestPath);
- if (RetVal != NULL) {
- break;
- }
- ASSERT(ExtensionWalker != NULL);
- TempChar2 = StrStr(ExtensionWalker, L";");
- }
- FreePool(TestPath);
- return (RetVal);
-}
-
-typedef struct {
- LIST_ENTRY Link;
- CHAR16 *Name;
- SHELL_PARAM_TYPE Type;
- CHAR16 *Value;
- UINTN OriginalPosition;
-} SHELL_PARAM_PACKAGE;
-
-/**
- Checks the list of valid arguments and returns TRUE if the item was found. If the
- return value is TRUE then the type parameter is set also.
-
- if CheckList is NULL then ASSERT();
- if Name is NULL then ASSERT();
- if Type is NULL then ASSERT();
-
- @param Name pointer to Name of parameter found
- @param CheckList List to check against
- @param Type pointer to type of parameter if it was found
-
- @retval TRUE the Parameter was found. Type is valid.
- @retval FALSE the Parameter was not found. Type is not valid.
-**/
-BOOLEAN
-EFIAPI
-InternalIsOnCheckList (
- IN CONST CHAR16 *Name,
- IN CONST SHELL_PARAM_ITEM *CheckList,
- OUT SHELL_PARAM_TYPE *Type
- )
-{
- SHELL_PARAM_ITEM *TempListItem;
- CHAR16 *TempString;
-
- //
- // ASSERT that all 3 pointer parameters aren't NULL
- //
- ASSERT(CheckList != NULL);
- ASSERT(Type != NULL);
- ASSERT(Name != NULL);
-
- //
- // question mark and page break mode are always supported
- //
- if ((StrCmp(Name, L"-?") == 0) ||
- (StrCmp(Name, L"-b") == 0)
- ) {
- *Type = TypeFlag;
- return (TRUE);
- }
-
- //
- // Enumerate through the list
- //
- for (TempListItem = (SHELL_PARAM_ITEM*)CheckList ; TempListItem->Name != NULL ; TempListItem++) {
- //
- // If the Type is TypeStart only check the first characters of the passed in param
- // If it matches set the type and return TRUE
- //
- if (TempListItem->Type == TypeStart) {
- if (StrnCmp(Name, TempListItem->Name, StrLen(TempListItem->Name)) == 0) {
- *Type = TempListItem->Type;
- return (TRUE);
- }
- TempString = NULL;
- TempString = StrnCatGrow(&TempString, NULL, Name, StrLen(TempListItem->Name));
- if (TempString != NULL) {
- if (StringNoCaseCompare(&TempString, &TempListItem->Name) == 0) {
- *Type = TempListItem->Type;
- FreePool(TempString);
- return (TRUE);
- }
- FreePool(TempString);
- }
- } else if (StringNoCaseCompare(&Name, &TempListItem->Name) == 0) {
- *Type = TempListItem->Type;
- return (TRUE);
- }
- }
-
- return (FALSE);
-}
-/**
- Checks the string for indicators of "flag" status. this is a leading '/', '-', or '+'
-
- @param[in] Name pointer to Name of parameter found
- @param[in] AlwaysAllowNumbers TRUE to allow numbers, FALSE to not.
-
- @retval TRUE the Parameter is a flag.
- @retval FALSE the Parameter not a flag.
-**/
-BOOLEAN
-EFIAPI
-InternalIsFlag (
- IN CONST CHAR16 *Name,
- IN BOOLEAN AlwaysAllowNumbers
- )
-{
- //
- // ASSERT that Name isn't NULL
- //
- ASSERT(Name != NULL);
-
- //
- // If we accept numbers then dont return TRUE. (they will be values)
- //
- if (((Name[0] == L'-' || Name[0] == L'+') && ShellIsHexaDecimalDigitCharacter(Name[1])) && AlwaysAllowNumbers) {
- return (FALSE);
- }
-
- //
- // If the Name has a /, +, or - as the first character return TRUE
- //
- if ((Name[0] == L'/') ||
- (Name[0] == L'-') ||
- (Name[0] == L'+')
- ) {
- return (TRUE);
- }
- return (FALSE);
-}
-
-/**
- Checks the command line arguments passed against the list of valid ones.
-
- If no initialization is required, then return RETURN_SUCCESS.
-
- @param[in] CheckList pointer to list of parameters to check
- @param[out] CheckPackage pointer to pointer to list checked values
- @param[out] ProblemParam optional pointer to pointer to unicode string for
- the paramater that caused failure. If used then the
- caller is responsible for freeing the memory.
- @param[in] AutoPageBreak will automatically set PageBreakEnabled for "b" parameter
- @param[in] Argv pointer to array of parameters
- @param[in] Argc Count of parameters in Argv
- @param[in] AlwaysAllowNumbers TRUE to allow numbers always, FALSE otherwise.
-
- @retval EFI_SUCCESS The operation completed sucessfully.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed
- @retval EFI_INVALID_PARAMETER A parameter was invalid
- @retval EFI_VOLUME_CORRUPTED the command line was corrupt. an argument was
- duplicated. the duplicated command line argument
- was returned in ProblemParam if provided.
- @retval EFI_NOT_FOUND a argument required a value that was missing.
- the invalid command line argument was returned in
- ProblemParam if provided.
-**/
-EFI_STATUS
-EFIAPI
-InternalCommandLineParse (
- IN CONST SHELL_PARAM_ITEM *CheckList,
- OUT LIST_ENTRY **CheckPackage,
- OUT CHAR16 **ProblemParam OPTIONAL,
- IN BOOLEAN AutoPageBreak,
- IN CONST CHAR16 **Argv,
- IN UINTN Argc,
- IN BOOLEAN AlwaysAllowNumbers
- )
-{
- UINTN LoopCounter;
- SHELL_PARAM_TYPE CurrentItemType;
- SHELL_PARAM_PACKAGE *CurrentItemPackage;
- UINTN GetItemValue;
- UINTN ValueSize;
- UINTN Count;
- CONST CHAR16 *TempPointer;
-
- CurrentItemPackage = NULL;
- GetItemValue = 0;
- ValueSize = 0;
- Count = 0;
-
- //
- // If there is only 1 item we dont need to do anything
- //
- if (Argc < 1) {
- *CheckPackage = NULL;
- return (EFI_SUCCESS);
- }
-
- //
- // ASSERTs
- //
- ASSERT(CheckList != NULL);
- ASSERT(Argv != NULL);
-
- //
- // initialize the linked list
- //
- *CheckPackage = (LIST_ENTRY*)AllocateZeroPool(sizeof(LIST_ENTRY));
- if (*CheckPackage == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- InitializeListHead(*CheckPackage);
-
- //
- // loop through each of the arguments
- //
- for (LoopCounter = 0 ; LoopCounter < Argc ; ++LoopCounter) {
- if (Argv[LoopCounter] == NULL) {
- //
- // do nothing for NULL argv
- //
- } else if (InternalIsOnCheckList(Argv[LoopCounter], CheckList, &CurrentItemType)) {
- //
- // We might have leftover if last parameter didnt have optional value
- //
- if (GetItemValue != 0) {
- GetItemValue = 0;
- InsertHeadList(*CheckPackage, &CurrentItemPackage->Link);
- }
- //
- // this is a flag
- //
- CurrentItemPackage = AllocateZeroPool(sizeof(SHELL_PARAM_PACKAGE));
- if (CurrentItemPackage == NULL) {
- ShellCommandLineFreeVarList(*CheckPackage);
- *CheckPackage = NULL;
- return (EFI_OUT_OF_RESOURCES);
- }
- CurrentItemPackage->Name = AllocateZeroPool(StrSize(Argv[LoopCounter]));
- if (CurrentItemPackage->Name == NULL) {
- ShellCommandLineFreeVarList(*CheckPackage);
- *CheckPackage = NULL;
- return (EFI_OUT_OF_RESOURCES);
- }
- StrCpy(CurrentItemPackage->Name, Argv[LoopCounter]);
- CurrentItemPackage->Type = CurrentItemType;
- CurrentItemPackage->OriginalPosition = (UINTN)(-1);
- CurrentItemPackage->Value = NULL;
-
- //
- // Does this flag require a value
- //
- switch (CurrentItemPackage->Type) {
- //
- // possibly trigger the next loop(s) to populate the value of this item
- //
- case TypeValue:
- GetItemValue = 1;
- ValueSize = 0;
- break;
- case TypeDoubleValue:
- GetItemValue = 2;
- ValueSize = 0;
- break;
- case TypeMaxValue:
- GetItemValue = (UINTN)(-1);
- ValueSize = 0;
- break;
- default:
- //
- // this item has no value expected; we are done
- //
- InsertHeadList(*CheckPackage, &CurrentItemPackage->Link);
- ASSERT(GetItemValue == 0);
- break;
- }
- } else if (GetItemValue != 0 && !InternalIsFlag(Argv[LoopCounter], AlwaysAllowNumbers)) {
- ASSERT(CurrentItemPackage != NULL);
- //
- // get the item VALUE for a previous flag
- //
- if (StrStr(Argv[LoopCounter], L" ") == NULL) {
- CurrentItemPackage->Value = ReallocatePool(ValueSize, ValueSize + StrSize(Argv[LoopCounter]) + sizeof(CHAR16), CurrentItemPackage->Value);
- ASSERT(CurrentItemPackage->Value != NULL);
- if (ValueSize == 0) {
- StrCpy(CurrentItemPackage->Value, Argv[LoopCounter]);
- } else {
- StrCat(CurrentItemPackage->Value, L" ");
- StrCat(CurrentItemPackage->Value, Argv[LoopCounter]);
- }
- ValueSize += StrSize(Argv[LoopCounter]) + sizeof(CHAR16);
- } else {
- //
- // the parameter has spaces. must be quoted.
- //
- CurrentItemPackage->Value = ReallocatePool(ValueSize, ValueSize + StrSize(Argv[LoopCounter]) + sizeof(CHAR16) + sizeof(CHAR16) + sizeof(CHAR16), CurrentItemPackage->Value);
- ASSERT(CurrentItemPackage->Value != NULL);
- if (ValueSize == 0) {
- StrCpy(CurrentItemPackage->Value, L"\"");
- StrCat(CurrentItemPackage->Value, Argv[LoopCounter]);
- StrCat(CurrentItemPackage->Value, L"\"");
- } else {
- StrCat(CurrentItemPackage->Value, L" ");
- StrCat(CurrentItemPackage->Value, L"\"");
- StrCat(CurrentItemPackage->Value, Argv[LoopCounter]);
- StrCat(CurrentItemPackage->Value, L"\"");
- }
- ValueSize += StrSize(Argv[LoopCounter]) + sizeof(CHAR16);
- }
- GetItemValue--;
- if (GetItemValue == 0) {
- InsertHeadList(*CheckPackage, &CurrentItemPackage->Link);
- }
- } else if (!InternalIsFlag(Argv[LoopCounter], AlwaysAllowNumbers) ){ //|| ProblemParam == NULL) {
- //
- // add this one as a non-flag
- //
-
- TempPointer = Argv[LoopCounter];
- if ((*TempPointer == L'^' && *(TempPointer+1) == L'-')
- || (*TempPointer == L'^' && *(TempPointer+1) == L'/')
- || (*TempPointer == L'^' && *(TempPointer+1) == L'+')
- ){
- TempPointer++;
- }
- CurrentItemPackage = AllocateZeroPool(sizeof(SHELL_PARAM_PACKAGE));
- if (CurrentItemPackage == NULL) {
- ShellCommandLineFreeVarList(*CheckPackage);
- *CheckPackage = NULL;
- return (EFI_OUT_OF_RESOURCES);
- }
- CurrentItemPackage->Name = NULL;
- CurrentItemPackage->Type = TypePosition;
- CurrentItemPackage->Value = AllocateZeroPool(StrSize(TempPointer));
- if (CurrentItemPackage->Value == NULL) {
- ShellCommandLineFreeVarList(*CheckPackage);
- *CheckPackage = NULL;
- return (EFI_OUT_OF_RESOURCES);
- }
- StrCpy(CurrentItemPackage->Value, TempPointer);
- CurrentItemPackage->OriginalPosition = Count++;
- InsertHeadList(*CheckPackage, &CurrentItemPackage->Link);
- } else {
- //
- // this was a non-recognised flag... error!
- //
- if (ProblemParam != NULL) {
- *ProblemParam = AllocateZeroPool(StrSize(Argv[LoopCounter]));
- if (*ProblemParam != NULL) {
- StrCpy(*ProblemParam, Argv[LoopCounter]);
- }
- }
- ShellCommandLineFreeVarList(*CheckPackage);
- *CheckPackage = NULL;
- return (EFI_VOLUME_CORRUPTED);
- }
- }
- if (GetItemValue != 0) {
- GetItemValue = 0;
- InsertHeadList(*CheckPackage, &CurrentItemPackage->Link);
- }
- //
- // support for AutoPageBreak
- //
- if (AutoPageBreak && ShellCommandLineGetFlag(*CheckPackage, L"-b")) {
- ShellSetPageBreakMode(TRUE);
- }
- return (EFI_SUCCESS);
-}
-
-/**
- Checks the command line arguments passed against the list of valid ones.
- Optionally removes NULL values first.
-
- If no initialization is required, then return RETURN_SUCCESS.
-
- @param[in] CheckList The pointer to list of parameters to check.
- @param[out] CheckPackage The package of checked values.
- @param[out] ProblemParam Optional pointer to pointer to unicode string for
- the paramater that caused failure.
- @param[in] AutoPageBreak Will automatically set PageBreakEnabled.
- @param[in] AlwaysAllowNumbers Will never fail for number based flags.
-
- @retval EFI_SUCCESS The operation completed sucessfully.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
- @retval EFI_VOLUME_CORRUPTED The command line was corrupt.
- @retval EFI_DEVICE_ERROR The commands contained 2 opposing arguments. One
- of the command line arguments was returned in
- ProblemParam if provided.
- @retval EFI_NOT_FOUND A argument required a value that was missing.
- The invalid command line argument was returned in
- ProblemParam if provided.
-**/
-EFI_STATUS
-EFIAPI
-ShellCommandLineParseEx (
- IN CONST SHELL_PARAM_ITEM *CheckList,
- OUT LIST_ENTRY **CheckPackage,
- OUT CHAR16 **ProblemParam OPTIONAL,
- IN BOOLEAN AutoPageBreak,
- IN BOOLEAN AlwaysAllowNumbers
- )
-{
- //
- // ASSERT that CheckList and CheckPackage aren't NULL
- //
- ASSERT(CheckList != NULL);
- ASSERT(CheckPackage != NULL);
-
- //
- // Check for UEFI Shell 2.0 protocols
- //
- if (gEfiShellParametersProtocol != NULL) {
- return (InternalCommandLineParse(CheckList,
- CheckPackage,
- ProblemParam,
- AutoPageBreak,
- (CONST CHAR16**) gEfiShellParametersProtocol->Argv,
- gEfiShellParametersProtocol->Argc,
- AlwaysAllowNumbers));
- }
-
- //
- // ASSERT That EFI Shell is not required
- //
- ASSERT (mEfiShellInterface != NULL);
- return (InternalCommandLineParse(CheckList,
- CheckPackage,
- ProblemParam,
- AutoPageBreak,
- (CONST CHAR16**) mEfiShellInterface->Argv,
- mEfiShellInterface->Argc,
- AlwaysAllowNumbers));
-}
-
-/**
- Frees shell variable list that was returned from ShellCommandLineParse.
-
- This function will free all the memory that was used for the CheckPackage
- list of postprocessed shell arguments.
-
- this function has no return value.
-
- if CheckPackage is NULL, then return
-
- @param CheckPackage the list to de-allocate
- **/
-VOID
-EFIAPI
-ShellCommandLineFreeVarList (
- IN LIST_ENTRY *CheckPackage
- )
-{
- LIST_ENTRY *Node;
-
- //
- // check for CheckPackage == NULL
- //
- if (CheckPackage == NULL) {
- return;
- }
-
- //
- // for each node in the list
- //
- for ( Node = GetFirstNode(CheckPackage)
- ; !IsListEmpty(CheckPackage)
- ; Node = GetFirstNode(CheckPackage)
- ){
- //
- // Remove it from the list
- //
- RemoveEntryList(Node);
-
- //
- // if it has a name free the name
- //
- if (((SHELL_PARAM_PACKAGE*)Node)->Name != NULL) {
- FreePool(((SHELL_PARAM_PACKAGE*)Node)->Name);
- }
-
- //
- // if it has a value free the value
- //
- if (((SHELL_PARAM_PACKAGE*)Node)->Value != NULL) {
- FreePool(((SHELL_PARAM_PACKAGE*)Node)->Value);
- }
-
- //
- // free the node structure
- //
- FreePool((SHELL_PARAM_PACKAGE*)Node);
- }
- //
- // free the list head node
- //
- FreePool(CheckPackage);
-}
-/**
- Checks for presence of a flag parameter
-
- flag arguments are in the form of "-<Key>" or "/<Key>", but do not have a value following the key
-
- if CheckPackage is NULL then return FALSE.
- if KeyString is NULL then ASSERT()
-
- @param CheckPackage The package of parsed command line arguments
- @param KeyString the Key of the command line argument to check for
-
- @retval TRUE the flag is on the command line
- @retval FALSE the flag is not on the command line
- **/
-BOOLEAN
-EFIAPI
-ShellCommandLineGetFlag (
- IN CONST LIST_ENTRY * CONST CheckPackage,
- IN CONST CHAR16 * CONST KeyString
- )
-{
- LIST_ENTRY *Node;
- CHAR16 *TempString;
-
- //
- // return FALSE for no package or KeyString is NULL
- //
- if (CheckPackage == NULL || KeyString == NULL) {
- return (FALSE);
- }
-
- //
- // enumerate through the list of parametrs
- //
- for ( Node = GetFirstNode(CheckPackage)
- ; !IsNull (CheckPackage, Node)
- ; Node = GetNextNode(CheckPackage, Node)
- ){
- //
- // If the Name matches, return TRUE (and there may be NULL name)
- //
- if (((SHELL_PARAM_PACKAGE*)Node)->Name != NULL) {
- //
- // If Type is TypeStart then only compare the begining of the strings
- //
- if (((SHELL_PARAM_PACKAGE*)Node)->Type == TypeStart) {
- if (StrnCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name, StrLen(KeyString)) == 0) {
- return (TRUE);
- }
- TempString = NULL;
- TempString = StrnCatGrow(&TempString, NULL, KeyString, StrLen(((SHELL_PARAM_PACKAGE*)Node)->Name));
- if (TempString != NULL) {
- if (StringNoCaseCompare(&KeyString, &((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {
- FreePool(TempString);
- return (TRUE);
- }
- FreePool(TempString);
- }
- } else if (StringNoCaseCompare(&KeyString, &((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {
- return (TRUE);
- }
- }
- }
- return (FALSE);
-}
-/**
- Returns value from command line argument.
-
- Value parameters are in the form of "-<Key> value" or "/<Key> value".
-
- If CheckPackage is NULL, then return NULL.
-
- @param[in] CheckPackage The package of parsed command line arguments.
- @param[in] KeyString The Key of the command line argument to check for.
-
- @retval NULL The flag is not on the command line.
- @retval !=NULL The pointer to unicode string of the value.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandLineGetValue (
- IN CONST LIST_ENTRY *CheckPackage,
- IN CHAR16 *KeyString
- )
-{
- LIST_ENTRY *Node;
- CHAR16 *TempString;
-
- //
- // return NULL for no package or KeyString is NULL
- //
- if (CheckPackage == NULL || KeyString == NULL) {
- return (NULL);
- }
-
- //
- // enumerate through the list of parametrs
- //
- for ( Node = GetFirstNode(CheckPackage)
- ; !IsNull (CheckPackage, Node)
- ; Node = GetNextNode(CheckPackage, Node)
- ){
- //
- // If the Name matches, return TRUE (and there may be NULL name)
- //
- if (((SHELL_PARAM_PACKAGE*)Node)->Name != NULL) {
- //
- // If Type is TypeStart then only compare the begining of the strings
- //
- if (((SHELL_PARAM_PACKAGE*)Node)->Type == TypeStart) {
- if (StrnCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name, StrLen(KeyString)) == 0) {
- return (((SHELL_PARAM_PACKAGE*)Node)->Name + StrLen(KeyString));
- }
- TempString = NULL;
- TempString = StrnCatGrow(&TempString, NULL, KeyString, StrLen(((SHELL_PARAM_PACKAGE*)Node)->Name));
- if (TempString != NULL) {
- if (StringNoCaseCompare(&KeyString, &((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {
- FreePool(TempString);
- return (((SHELL_PARAM_PACKAGE*)Node)->Name + StrLen(KeyString));
- }
- FreePool(TempString);
- }
- } else if (StringNoCaseCompare(&KeyString, &((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {
- return (((SHELL_PARAM_PACKAGE*)Node)->Value);
- }
- }
- }
- return (NULL);
-}
-
-/**
- Returns raw value from command line argument.
-
- Raw value parameters are in the form of "value" in a specific position in the list.
-
- If CheckPackage is NULL, then return NULL.
-
- @param[in] CheckPackage The package of parsed command line arguments.
- @param[in] Position The position of the value.
-
- @retval NULL The flag is not on the command line.
- @retval !=NULL The pointer to unicode string of the value.
- **/
-CONST CHAR16*
-EFIAPI
-ShellCommandLineGetRawValue (
- IN CONST LIST_ENTRY * CONST CheckPackage,
- IN UINTN Position
- )
-{
- LIST_ENTRY *Node;
-
- //
- // check for CheckPackage == NULL
- //
- if (CheckPackage == NULL) {
- return (NULL);
- }
-
- //
- // enumerate through the list of parametrs
- //
- for ( Node = GetFirstNode(CheckPackage)
- ; !IsNull (CheckPackage, Node)
- ; Node = GetNextNode(CheckPackage, Node)
- ){
- //
- // If the position matches, return the value
- //
- if (((SHELL_PARAM_PACKAGE*)Node)->OriginalPosition == Position) {
- return (((SHELL_PARAM_PACKAGE*)Node)->Value);
- }
- }
- return (NULL);
-}
-
-/**
- returns the number of command line value parameters that were parsed.
-
- this will not include flags.
-
- @param[in] CheckPackage The package of parsed command line arguments.
-
- @retval (UINTN)-1 No parsing has ocurred
- @return other The number of value parameters found
-**/
-UINTN
-EFIAPI
-ShellCommandLineGetCount(
- IN CONST LIST_ENTRY *CheckPackage
- )
-{
- LIST_ENTRY *Node1;
- UINTN Count;
-
- if (CheckPackage == NULL) {
- return (0);
- }
- for ( Node1 = GetFirstNode(CheckPackage), Count = 0
- ; !IsNull (CheckPackage, Node1)
- ; Node1 = GetNextNode(CheckPackage, Node1)
- ){
- if (((SHELL_PARAM_PACKAGE*)Node1)->Name == NULL) {
- Count++;
- }
- }
- return (Count);
-}
-
-/**
- Determins if a parameter is duplicated.
-
- If Param is not NULL then it will point to a callee allocated string buffer
- with the parameter value if a duplicate is found.
-
- If CheckPackage is NULL, then ASSERT.
-
- @param[in] CheckPackage The package of parsed command line arguments.
- @param[out] Param Upon finding one, a pointer to the duplicated parameter.
-
- @retval EFI_SUCCESS No parameters were duplicated.
- @retval EFI_DEVICE_ERROR A duplicate was found.
- **/
-EFI_STATUS
-EFIAPI
-ShellCommandLineCheckDuplicate (
- IN CONST LIST_ENTRY *CheckPackage,
- OUT CHAR16 **Param
- )
-{
- LIST_ENTRY *Node1;
- LIST_ENTRY *Node2;
-
- ASSERT(CheckPackage != NULL);
-
- for ( Node1 = GetFirstNode(CheckPackage)
- ; !IsNull (CheckPackage, Node1)
- ; Node1 = GetNextNode(CheckPackage, Node1)
- ){
- for ( Node2 = GetNextNode(CheckPackage, Node1)
- ; !IsNull (CheckPackage, Node2)
- ; Node2 = GetNextNode(CheckPackage, Node2)
- ){
- if ((((SHELL_PARAM_PACKAGE*)Node1)->Name != NULL) && (((SHELL_PARAM_PACKAGE*)Node2)->Name != NULL) && StrCmp(((SHELL_PARAM_PACKAGE*)Node1)->Name, ((SHELL_PARAM_PACKAGE*)Node2)->Name) == 0) {
- if (Param != NULL) {
- *Param = NULL;
- *Param = StrnCatGrow(Param, NULL, ((SHELL_PARAM_PACKAGE*)Node1)->Name, 0);
- }
- return (EFI_DEVICE_ERROR);
- }
- }
- }
- return (EFI_SUCCESS);
-}
-
-/**
- This is a find and replace function. Upon successful return the NewString is a copy of
- SourceString with each instance of FindTarget replaced with ReplaceWith.
-
- If SourceString and NewString overlap the behavior is undefined.
-
- If the string would grow bigger than NewSize it will halt and return error.
-
- @param[in] SourceString The string with source buffer.
- @param[in, out] NewString The string with resultant buffer.
- @param[in] NewSize The size in bytes of NewString.
- @param[in] FindTarget The string to look for.
- @param[in] ReplaceWith The string to replace FindTarget with.
- @param[in] SkipPreCarrot If TRUE will skip a FindTarget that has a '^'
- immediately before it.
- @param[in] ParameterReplacing If TRUE will add "" around items with spaces.
-
- @retval EFI_INVALID_PARAMETER SourceString was NULL.
- @retval EFI_INVALID_PARAMETER NewString was NULL.
- @retval EFI_INVALID_PARAMETER FindTarget was NULL.
- @retval EFI_INVALID_PARAMETER ReplaceWith was NULL.
- @retval EFI_INVALID_PARAMETER FindTarget had length < 1.
- @retval EFI_INVALID_PARAMETER SourceString had length < 1.
- @retval EFI_BUFFER_TOO_SMALL NewSize was less than the minimum size to hold
- the new string (truncation occurred).
- @retval EFI_SUCCESS The string was successfully copied with replacement.
-**/
-EFI_STATUS
-EFIAPI
-ShellCopySearchAndReplace(
- IN CHAR16 CONST *SourceString,
- IN OUT CHAR16 *NewString,
- IN UINTN NewSize,
- IN CONST CHAR16 *FindTarget,
- IN CONST CHAR16 *ReplaceWith,
- IN CONST BOOLEAN SkipPreCarrot,
- IN CONST BOOLEAN ParameterReplacing
- )
-{
- UINTN Size;
- CHAR16 *Replace;
-
- if ( (SourceString == NULL)
- || (NewString == NULL)
- || (FindTarget == NULL)
- || (ReplaceWith == NULL)
- || (StrLen(FindTarget) < 1)
- || (StrLen(SourceString) < 1)
- ){
- return (EFI_INVALID_PARAMETER);
- }
- Replace = NULL;
- if (StrStr(ReplaceWith, L" ") == NULL || !ParameterReplacing) {
- Replace = StrnCatGrow(&Replace, NULL, ReplaceWith, 0);
- } else {
- Replace = AllocateZeroPool(StrSize(ReplaceWith) + 2*sizeof(CHAR16));
- if (Replace != NULL) {
- UnicodeSPrint(Replace, StrSize(ReplaceWith) + 2*sizeof(CHAR16), L"\"%s\"", ReplaceWith);
- }
- }
- if (Replace == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- NewString = SetMem16(NewString, NewSize, CHAR_NULL);
- while (*SourceString != CHAR_NULL) {
- //
- // if we find the FindTarget and either Skip == FALSE or Skip and we
- // dont have a carrot do a replace...
- //
- if (StrnCmp(SourceString, FindTarget, StrLen(FindTarget)) == 0
- && ((SkipPreCarrot && *(SourceString-1) != L'^') || !SkipPreCarrot)
- ){
- SourceString += StrLen(FindTarget);
- Size = StrSize(NewString);
- if ((Size + (StrLen(Replace)*sizeof(CHAR16))) > NewSize) {
- FreePool(Replace);
- return (EFI_BUFFER_TOO_SMALL);
- }
- StrCat(NewString, Replace);
- } else {
- Size = StrSize(NewString);
- if (Size + sizeof(CHAR16) > NewSize) {
- FreePool(Replace);
- return (EFI_BUFFER_TOO_SMALL);
- }
- StrnCat(NewString, SourceString, 1);
- SourceString++;
- }
- }
- FreePool(Replace);
- return (EFI_SUCCESS);
-}
-
-/**
- Internal worker function to output a string.
-
- This function will output a string to the correct StdOut.
-
- @param[in] String The string to print out.
-
- @retval EFI_SUCCESS The operation was sucessful.
- @retval !EFI_SUCCESS The operation failed.
-**/
-EFI_STATUS
-EFIAPI
-InternalPrintTo (
- IN CONST CHAR16 *String
- )
-{
- UINTN Size;
- Size = StrSize(String) - sizeof(CHAR16);
- if (Size == 0) {
- return (EFI_SUCCESS);
- }
- if (gEfiShellParametersProtocol != NULL) {
- return (gEfiShellProtocol->WriteFile(gEfiShellParametersProtocol->StdOut, &Size, (VOID*)String));
- }
- if (mEfiShellInterface != NULL) {
- if (mEfiShellInterface->RedirArgc == 0) {
- //
- // Divide in half for old shell. Must be string length not size.
- //
- Size /=2; // Divide in half only when no redirection.
- }
- return (mEfiShellInterface->StdOut->Write(mEfiShellInterface->StdOut, &Size, (VOID*)String));
- }
- ASSERT(FALSE);
- return (EFI_UNSUPPORTED);
-}
-
-/**
- Print at a specific location on the screen.
-
- This function will move the cursor to a given screen location and print the specified string
-
- If -1 is specified for either the Row or Col the current screen location for BOTH
- will be used.
-
- if either Row or Col is out of range for the current console, then ASSERT
- if Format is NULL, then ASSERT
-
- In addition to the standard %-based flags as supported by UefiLib Print() this supports
- the following additional flags:
- %N - Set output attribute to normal
- %H - Set output attribute to highlight
- %E - Set output attribute to error
- %B - Set output attribute to blue color
- %V - Set output attribute to green color
-
- Note: The background color is controlled by the shell command cls.
-
- @param[in] Col the column to print at
- @param[in] Row the row to print at
- @param[in] Format the format string
- @param[in] Marker the marker for the variable argument list
-
- @return EFI_SUCCESS The operation was successful.
- @return EFI_DEVICE_ERROR The console device reported an error.
-**/
-EFI_STATUS
-EFIAPI
-InternalShellPrintWorker(
- IN INT32 Col OPTIONAL,
- IN INT32 Row OPTIONAL,
- IN CONST CHAR16 *Format,
- IN VA_LIST Marker
- )
-{
- EFI_STATUS Status;
- CHAR16 *ResumeLocation;
- CHAR16 *FormatWalker;
- UINTN OriginalAttribute;
- CHAR16 *mPostReplaceFormat;
- CHAR16 *mPostReplaceFormat2;
-
- mPostReplaceFormat = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
- mPostReplaceFormat2 = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
-
- if (mPostReplaceFormat == NULL || mPostReplaceFormat2 == NULL) {
- SHELL_FREE_NON_NULL(mPostReplaceFormat);
- SHELL_FREE_NON_NULL(mPostReplaceFormat2);
- return (EFI_OUT_OF_RESOURCES);
- }
-
- Status = EFI_SUCCESS;
- OriginalAttribute = gST->ConOut->Mode->Attribute;
-
- //
- // Back and forth each time fixing up 1 of our flags...
- //
- Status = ShellCopySearchAndReplace(Format, mPostReplaceFormat, PcdGet16 (PcdShellPrintBufferSize), L"%N", L"%%N", FALSE, FALSE);
- ASSERT_EFI_ERROR(Status);
- Status = ShellCopySearchAndReplace(mPostReplaceFormat, mPostReplaceFormat2, PcdGet16 (PcdShellPrintBufferSize), L"%E", L"%%E", FALSE, FALSE);
- ASSERT_EFI_ERROR(Status);
- Status = ShellCopySearchAndReplace(mPostReplaceFormat2, mPostReplaceFormat, PcdGet16 (PcdShellPrintBufferSize), L"%H", L"%%H", FALSE, FALSE);
- ASSERT_EFI_ERROR(Status);
- Status = ShellCopySearchAndReplace(mPostReplaceFormat, mPostReplaceFormat2, PcdGet16 (PcdShellPrintBufferSize), L"%B", L"%%B", FALSE, FALSE);
- ASSERT_EFI_ERROR(Status);
- Status = ShellCopySearchAndReplace(mPostReplaceFormat2, mPostReplaceFormat, PcdGet16 (PcdShellPrintBufferSize), L"%V", L"%%V", FALSE, FALSE);
- ASSERT_EFI_ERROR(Status);
-
- //
- // Use the last buffer from replacing to print from...
- //
- UnicodeVSPrint (mPostReplaceFormat2, PcdGet16 (PcdShellPrintBufferSize), mPostReplaceFormat, Marker);
-
- if (Col != -1 && Row != -1) {
- Status = gST->ConOut->SetCursorPosition(gST->ConOut, Col, Row);
- }
-
- FormatWalker = mPostReplaceFormat2;
- while (*FormatWalker != CHAR_NULL) {
- //
- // Find the next attribute change request
- //
- ResumeLocation = StrStr(FormatWalker, L"%");
- if (ResumeLocation != NULL) {
- *ResumeLocation = CHAR_NULL;
- }
- //
- // print the current FormatWalker string
- //
- if (StrLen(FormatWalker)>0) {
- Status = InternalPrintTo(FormatWalker);
- if (EFI_ERROR(Status)) {
- break;
- }
- }
-
- //
- // update the attribute
- //
- if (ResumeLocation != NULL) {
- if (*(ResumeLocation-1) == L'^') {
- //
- // Move cursor back 1 position to overwrite the ^
- //
- gST->ConOut->SetCursorPosition(gST->ConOut, gST->ConOut->Mode->CursorColumn - 1, gST->ConOut->Mode->CursorRow);
-
- //
- // Print a simple '%' symbol
- //
- Status = InternalPrintTo(L"%");
- ResumeLocation = ResumeLocation - 1;
- } else {
- switch (*(ResumeLocation+1)) {
- case (L'N'):
- gST->ConOut->SetAttribute(gST->ConOut, OriginalAttribute);
- break;
- case (L'E'):
- gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_YELLOW, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
- break;
- case (L'H'):
- gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_WHITE, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
- break;
- case (L'B'):
- gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_BLUE, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
- break;
- case (L'V'):
- gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_GREEN, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
- break;
- default:
- //
- // Print a simple '%' symbol
- //
- Status = InternalPrintTo(L"%");
- if (EFI_ERROR(Status)) {
- break;
- }
- ResumeLocation = ResumeLocation - 1;
- break;
- }
- }
- } else {
- //
- // reset to normal now...
- //
- break;
- }
-
- //
- // update FormatWalker to Resume + 2 (skip the % and the indicator)
- //
- FormatWalker = ResumeLocation + 2;
- }
-
- gST->ConOut->SetAttribute(gST->ConOut, OriginalAttribute);
-
- SHELL_FREE_NON_NULL(mPostReplaceFormat);
- SHELL_FREE_NON_NULL(mPostReplaceFormat2);
- return (Status);
-}
-
-/**
- Print at a specific location on the screen.
-
- This function will move the cursor to a given screen location and print the specified string.
-
- If -1 is specified for either the Row or Col the current screen location for BOTH
- will be used.
-
- If either Row or Col is out of range for the current console, then ASSERT.
- If Format is NULL, then ASSERT.
-
- In addition to the standard %-based flags as supported by UefiLib Print() this supports
- the following additional flags:
- %N - Set output attribute to normal
- %H - Set output attribute to highlight
- %E - Set output attribute to error
- %B - Set output attribute to blue color
- %V - Set output attribute to green color
-
- Note: The background color is controlled by the shell command cls.
-
- @param[in] Col the column to print at
- @param[in] Row the row to print at
- @param[in] Format the format string
- @param[in] ... The variable argument list.
-
- @return EFI_SUCCESS The printing was successful.
- @return EFI_DEVICE_ERROR The console device reported an error.
-**/
-EFI_STATUS
-EFIAPI
-ShellPrintEx(
- IN INT32 Col OPTIONAL,
- IN INT32 Row OPTIONAL,
- IN CONST CHAR16 *Format,
- ...
- )
-{
- VA_LIST Marker;
- EFI_STATUS RetVal;
- if (Format == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
- VA_START (Marker, Format);
- RetVal = InternalShellPrintWorker(Col, Row, Format, Marker);
- VA_END(Marker);
- return(RetVal);
-}
-
-/**
- Print at a specific location on the screen.
-
- This function will move the cursor to a given screen location and print the specified string.
-
- If -1 is specified for either the Row or Col the current screen location for BOTH
- will be used.
-
- If either Row or Col is out of range for the current console, then ASSERT.
- If Format is NULL, then ASSERT.
-
- In addition to the standard %-based flags as supported by UefiLib Print() this supports
- the following additional flags:
- %N - Set output attribute to normal.
- %H - Set output attribute to highlight.
- %E - Set output attribute to error.
- %B - Set output attribute to blue color.
- %V - Set output attribute to green color.
-
- Note: The background color is controlled by the shell command cls.
-
- @param[in] Col The column to print at.
- @param[in] Row The row to print at.
- @param[in] Language The language of the string to retrieve. If this parameter
- is NULL, then the current platform language is used.
- @param[in] HiiFormatStringId The format string Id for getting from Hii.
- @param[in] HiiFormatHandle The format string Handle for getting from Hii.
- @param[in] ... The variable argument list.
-
- @return EFI_SUCCESS The printing was successful.
- @return EFI_DEVICE_ERROR The console device reported an error.
-**/
-EFI_STATUS
-EFIAPI
-ShellPrintHiiEx(
- IN INT32 Col OPTIONAL,
- IN INT32 Row OPTIONAL,
- IN CONST CHAR8 *Language OPTIONAL,
- IN CONST EFI_STRING_ID HiiFormatStringId,
- IN CONST EFI_HANDLE HiiFormatHandle,
- ...
- )
-{
- VA_LIST Marker;
- CHAR16 *HiiFormatString;
- EFI_STATUS RetVal;
-
- VA_START (Marker, HiiFormatHandle);
- HiiFormatString = HiiGetString(HiiFormatHandle, HiiFormatStringId, Language);
- ASSERT(HiiFormatString != NULL);
-
- RetVal = InternalShellPrintWorker(Col, Row, HiiFormatString, Marker);
-
- SHELL_FREE_NON_NULL(HiiFormatString);
- VA_END(Marker);
-
- return (RetVal);
-}
-
-/**
- Function to determine if a given filename represents a file or a directory.
-
- @param[in] DirName Path to directory to test.
-
- @retval EFI_SUCCESS The Path represents a directory
- @retval EFI_NOT_FOUND The Path does not represent a directory
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @return The path failed to open
-**/
-EFI_STATUS
-EFIAPI
-ShellIsDirectory(
- IN CONST CHAR16 *DirName
- )
-{
- EFI_STATUS Status;
- SHELL_FILE_HANDLE Handle;
- CHAR16 *TempLocation;
- CHAR16 *TempLocation2;
-
- ASSERT(DirName != NULL);
-
- Handle = NULL;
- TempLocation = NULL;
-
- Status = ShellOpenFileByName(DirName, &Handle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- //
- // try good logic first.
- //
- if (gEfiShellProtocol != NULL) {
- TempLocation = StrnCatGrow(&TempLocation, NULL, DirName, 0);
- if (TempLocation == NULL) {
- ShellCloseFile(&Handle);
- return (EFI_OUT_OF_RESOURCES);
- }
- TempLocation2 = StrStr(TempLocation, L":");
- if (TempLocation2 != NULL && StrLen(StrStr(TempLocation, L":")) == 2) {
- *(TempLocation2+1) = CHAR_NULL;
- }
- if (gEfiShellProtocol->GetDevicePathFromMap(TempLocation) != NULL) {
- FreePool(TempLocation);
- return (EFI_SUCCESS);
- }
- FreePool(TempLocation);
- } else {
- //
- // probably a map name?!?!!?
- //
- TempLocation = StrStr(DirName, L"\\");
- if (TempLocation != NULL && *(TempLocation+1) == CHAR_NULL) {
- return (EFI_SUCCESS);
- }
- }
- return (Status);
- }
-
- if (FileHandleIsDirectory(Handle) == EFI_SUCCESS) {
- ShellCloseFile(&Handle);
- return (EFI_SUCCESS);
- }
- ShellCloseFile(&Handle);
- return (EFI_NOT_FOUND);
-}
-
-/**
- Function to determine if a given filename represents a file.
-
- @param[in] Name Path to file to test.
-
- @retval EFI_SUCCESS The Path represents a file.
- @retval EFI_NOT_FOUND The Path does not represent a file.
- @retval other The path failed to open.
-**/
-EFI_STATUS
-EFIAPI
-ShellIsFile(
- IN CONST CHAR16 *Name
- )
-{
- EFI_STATUS Status;
- SHELL_FILE_HANDLE Handle;
-
- ASSERT(Name != NULL);
-
- Handle = NULL;
-
- Status = ShellOpenFileByName(Name, &Handle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- if (FileHandleIsDirectory(Handle) != EFI_SUCCESS) {
- ShellCloseFile(&Handle);
- return (EFI_SUCCESS);
- }
- ShellCloseFile(&Handle);
- return (EFI_NOT_FOUND);
-}
-
-/**
- Function to determine if a given filename represents a file.
-
- This will search the CWD and then the Path.
-
- If Name is NULL, then ASSERT.
-
- @param[in] Name Path to file to test.
-
- @retval EFI_SUCCESS The Path represents a file.
- @retval EFI_NOT_FOUND The Path does not represent a file.
- @retval other The path failed to open.
-**/
-EFI_STATUS
-EFIAPI
-ShellIsFileInPath(
- IN CONST CHAR16 *Name
- )
-{
- CHAR16 *NewName;
- EFI_STATUS Status;
-
- if (!EFI_ERROR(ShellIsFile(Name))) {
- return (EFI_SUCCESS);
- }
-
- NewName = ShellFindFilePath(Name);
- if (NewName == NULL) {
- return (EFI_NOT_FOUND);
- }
- Status = ShellIsFile(NewName);
- FreePool(NewName);
- return (Status);
-}
-
-/**
- Function to determine whether a string is decimal or hex representation of a number
- and return the number converted from the string.
-
- @param[in] String String representation of a number
-
- @return the number
- @retval (UINTN)(-1) An error ocurred.
-**/
-UINTN
-EFIAPI
-ShellStrToUintn(
- IN CONST CHAR16 *String
- )
-{
- UINT64 RetVal;
- BOOLEAN Hex;
-
- Hex = FALSE;
-
- if (!InternalShellIsHexOrDecimalNumber(String, Hex, TRUE)) {
- Hex = TRUE;
- }
-
- if (!EFI_ERROR(ShellConvertStringToUint64(String, &RetVal, Hex, TRUE))) {
- return ((UINTN)RetVal);
- }
- return ((UINTN)(-1));
-}
-
-/**
- Safely append with automatic string resizing given length of Destination and
- desired length of copy from Source.
-
- append the first D characters of Source to the end of Destination, where D is
- the lesser of Count and the StrLen() of Source. If appending those D characters
- will fit within Destination (whose Size is given as CurrentSize) and
- still leave room for a NULL terminator, then those characters are appended,
- starting at the original terminating NULL of Destination, and a new terminating
- NULL is appended.
-
- If appending D characters onto Destination will result in a overflow of the size
- given in CurrentSize the string will be grown such that the copy can be performed
- and CurrentSize will be updated to the new size.
-
- If Source is NULL, there is nothing to append, just return the current buffer in
- Destination.
-
- if Destination is NULL, then ASSERT()
- if Destination's current length (including NULL terminator) is already more then
- CurrentSize, then ASSERT()
-
- @param[in, out] Destination The String to append onto
- @param[in, out] CurrentSize on call the number of bytes in Destination. On
- return possibly the new size (still in bytes). if NULL
- then allocate whatever is needed.
- @param[in] Source The String to append from
- @param[in] Count Maximum number of characters to append. if 0 then
- all are appended.
-
- @return Destination return the resultant string.
-**/
-CHAR16*
-EFIAPI
-StrnCatGrow (
- IN OUT CHAR16 **Destination,
- IN OUT UINTN *CurrentSize,
- IN CONST CHAR16 *Source,
- IN UINTN Count
- )
-{
- UINTN DestinationStartSize;
- UINTN NewSize;
-
- //
- // ASSERTs
- //
- ASSERT(Destination != NULL);
-
- //
- // If there's nothing to do then just return Destination
- //
- if (Source == NULL) {
- return (*Destination);
- }
-
- //
- // allow for un-initialized pointers, based on size being 0
- //
- if (CurrentSize != NULL && *CurrentSize == 0) {
- *Destination = NULL;
- }
-
- //
- // allow for NULL pointers address as Destination
- //
- if (*Destination != NULL) {
- ASSERT(CurrentSize != 0);
- DestinationStartSize = StrSize(*Destination);
- ASSERT(DestinationStartSize <= *CurrentSize);
- } else {
- DestinationStartSize = 0;
-// ASSERT(*CurrentSize == 0);
- }
-
- //
- // Append all of Source?
- //
- if (Count == 0) {
- Count = StrLen(Source);
- }
-
- //
- // Test and grow if required
- //
- if (CurrentSize != NULL) {
- NewSize = *CurrentSize;
- while (NewSize < (DestinationStartSize + (Count*sizeof(CHAR16)))) {
- NewSize += 2 * Count * sizeof(CHAR16);
- }
- *Destination = ReallocatePool(*CurrentSize, NewSize, *Destination);
- *CurrentSize = NewSize;
- } else {
- *Destination = AllocateZeroPool((Count+1)*sizeof(CHAR16));
- }
-
- //
- // Now use standard StrnCat on a big enough buffer
- //
- if (*Destination == NULL) {
- return (NULL);
- }
- return StrnCat(*Destination, Source, Count);
-}
-
-/**
- Prompt the user and return the resultant answer to the requestor.
-
- This function will display the requested question on the shell prompt and then
- wait for an apropriate answer to be input from the console.
-
- if the SHELL_PROMPT_REQUEST_TYPE is SHELL_PROMPT_REQUEST_TYPE_YESNO, ShellPromptResponseTypeQuitContinue
- or SHELL_PROMPT_REQUEST_TYPE_YESNOCANCEL then *Response is of type SHELL_PROMPT_RESPONSE.
-
- if the SHELL_PROMPT_REQUEST_TYPE is ShellPromptResponseTypeFreeform then *Response is of type
- CHAR16*.
-
- In either case *Response must be callee freed if Response was not NULL;
-
- @param Type What type of question is asked. This is used to filter the input
- to prevent invalid answers to question.
- @param Prompt Pointer to string prompt to use to request input.
- @param Response Pointer to Response which will be populated upon return.
-
- @retval EFI_SUCCESS The operation was sucessful.
- @retval EFI_UNSUPPORTED The operation is not supported as requested.
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
- @return other The operation failed.
-**/
-EFI_STATUS
-EFIAPI
-ShellPromptForResponse (
- IN SHELL_PROMPT_REQUEST_TYPE Type,
- IN CHAR16 *Prompt OPTIONAL,
- IN OUT VOID **Response OPTIONAL
- )
-{
- EFI_STATUS Status;
- EFI_INPUT_KEY Key;
- UINTN EventIndex;
- SHELL_PROMPT_RESPONSE *Resp;
- UINTN Size;
- CHAR16 *Buffer;
-
- Status = EFI_UNSUPPORTED;
- Resp = NULL;
- Buffer = NULL;
- Size = 0;
- if (Type != ShellPromptResponseTypeFreeform) {
- Resp = (SHELL_PROMPT_RESPONSE*)AllocateZeroPool(sizeof(SHELL_PROMPT_RESPONSE));
- if (Resp == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- }
-
- switch(Type) {
- case ShellPromptResponseTypeQuitContinue:
- if (Prompt != NULL) {
- ShellPrintEx(-1, -1, L"%s", Prompt);
- }
- //
- // wait for valid response
- //
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
- ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
- if (Key.UnicodeChar == L'Q' || Key.UnicodeChar ==L'q') {
- *Resp = ShellPromptResponseQuit;
- } else {
- *Resp = ShellPromptResponseContinue;
- }
- break;
- case ShellPromptResponseTypeYesNoCancel:
- if (Prompt != NULL) {
- ShellPrintEx(-1, -1, L"%s", Prompt);
- }
- //
- // wait for valid response
- //
- *Resp = ShellPromptResponseMax;
- while (*Resp == ShellPromptResponseMax) {
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
- ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
- switch (Key.UnicodeChar) {
- case L'Y':
- case L'y':
- *Resp = ShellPromptResponseYes;
- break;
- case L'N':
- case L'n':
- *Resp = ShellPromptResponseNo;
- break;
- case L'C':
- case L'c':
- *Resp = ShellPromptResponseCancel;
- break;
- }
- }
- break; case ShellPromptResponseTypeYesNoAllCancel:
- if (Prompt != NULL) {
- ShellPrintEx(-1, -1, L"%s", Prompt);
- }
- //
- // wait for valid response
- //
- *Resp = ShellPromptResponseMax;
- while (*Resp == ShellPromptResponseMax) {
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
- ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
- switch (Key.UnicodeChar) {
- case L'Y':
- case L'y':
- *Resp = ShellPromptResponseYes;
- break;
- case L'N':
- case L'n':
- *Resp = ShellPromptResponseNo;
- break;
- case L'A':
- case L'a':
- *Resp = ShellPromptResponseAll;
- break;
- case L'C':
- case L'c':
- *Resp = ShellPromptResponseCancel;
- break;
- }
- }
- break;
- case ShellPromptResponseTypeEnterContinue:
- case ShellPromptResponseTypeAnyKeyContinue:
- if (Prompt != NULL) {
- ShellPrintEx(-1, -1, L"%s", Prompt);
- }
- //
- // wait for valid response
- //
- *Resp = ShellPromptResponseMax;
- while (*Resp == ShellPromptResponseMax) {
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- if (Type == ShellPromptResponseTypeEnterContinue) {
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
- ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
- if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
- *Resp = ShellPromptResponseContinue;
- break;
- }
- }
- if (Type == ShellPromptResponseTypeAnyKeyContinue) {
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
- *Resp = ShellPromptResponseContinue;
- break;
- }
- }
- break;
- case ShellPromptResponseTypeYesNo:
- if (Prompt != NULL) {
- ShellPrintEx(-1, -1, L"%s", Prompt);
- }
- //
- // wait for valid response
- //
- *Resp = ShellPromptResponseMax;
- while (*Resp == ShellPromptResponseMax) {
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
- ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
- switch (Key.UnicodeChar) {
- case L'Y':
- case L'y':
- *Resp = ShellPromptResponseYes;
- break;
- case L'N':
- case L'n':
- *Resp = ShellPromptResponseNo;
- break;
- }
- }
- break;
- case ShellPromptResponseTypeFreeform:
- if (Prompt != NULL) {
- ShellPrintEx(-1, -1, L"%s", Prompt);
- }
- while(1) {
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ASSERT_EFI_ERROR(Status);
- ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
- if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
- break;
- }
- ASSERT((Buffer == NULL && Size == 0) || (Buffer != NULL));
- StrnCatGrow(&Buffer, &Size, &Key.UnicodeChar, 1);
- }
- break;
- //
- // This is the location to add new prompt types.
- //
- default:
- ASSERT(FALSE);
- }
-
- if (Response != NULL) {
- if (Resp != NULL) {
- *Response = Resp;
- } else if (Buffer != NULL) {
- *Response = Buffer;
- }
- } else {
- if (Resp != NULL) {
- FreePool(Resp);
- }
- if (Buffer != NULL) {
- FreePool(Buffer);
- }
- }
-
- ShellPrintEx(-1, -1, L"\r\n");
- return (Status);
-}
-
-/**
- Prompt the user and return the resultant answer to the requestor.
-
- This function is the same as ShellPromptForResponse, except that the prompt is
- automatically pulled from HII.
-
- @param Type What type of question is asked. This is used to filter the input
- to prevent invalid answers to question.
- @param[in] HiiFormatStringId The format string Id for getting from Hii.
- @param[in] HiiFormatHandle The format string Handle for getting from Hii.
- @param Response Pointer to Response which will be populated upon return.
-
- @retval EFI_SUCCESS the operation was sucessful.
- @return other the operation failed.
-
- @sa ShellPromptForResponse
-**/
-EFI_STATUS
-EFIAPI
-ShellPromptForResponseHii (
- IN SHELL_PROMPT_REQUEST_TYPE Type,
- IN CONST EFI_STRING_ID HiiFormatStringId,
- IN CONST EFI_HANDLE HiiFormatHandle,
- IN OUT VOID **Response
- )
-{
- CHAR16 *Prompt;
- EFI_STATUS Status;
-
- Prompt = HiiGetString(HiiFormatHandle, HiiFormatStringId, NULL);
- Status = ShellPromptForResponse(Type, Prompt, Response);
- FreePool(Prompt);
- return (Status);
-}
-
-/**
- Function to determin if an entire string is a valid number.
-
- If Hex it must be preceeded with a 0x or has ForceHex, set TRUE.
-
- @param[in] String The string to evaluate.
- @param[in] ForceHex TRUE - always assume hex.
- @param[in] StopAtSpace TRUE to halt upon finding a space, FALSE to keep going.
-
- @retval TRUE It is all numeric (dec/hex) characters.
- @retval FALSE There is a non-numeric character.
-**/
-BOOLEAN
-EFIAPI
-InternalShellIsHexOrDecimalNumber (
- IN CONST CHAR16 *String,
- IN CONST BOOLEAN ForceHex,
- IN CONST BOOLEAN StopAtSpace
- )
-{
- BOOLEAN Hex;
-
- //
- // chop off a single negative sign
- //
- if (String != NULL && *String == L'-') {
- String++;
- }
-
- if (String == NULL) {
- return (FALSE);
- }
-
- //
- // chop leading zeroes
- //
- while(String != NULL && *String == L'0'){
- String++;
- }
- //
- // allow '0x' or '0X', but not 'x' or 'X'
- //
- if (String != NULL && (*String == L'x' || *String == L'X')) {
- if (*(String-1) != L'0') {
- //
- // we got an x without a preceeding 0
- //
- return (FALSE);
- }
- String++;
- Hex = TRUE;
- } else if (ForceHex) {
- Hex = TRUE;
- } else {
- Hex = FALSE;
- }
-
- //
- // loop through the remaining characters and use the lib function
- //
- for ( ; String != NULL && *String != CHAR_NULL && !(StopAtSpace && *String == L' ') ; String++){
- if (Hex) {
- if (!ShellIsHexaDecimalDigitCharacter(*String)) {
- return (FALSE);
- }
- } else {
- if (!ShellIsDecimalDigitCharacter(*String)) {
- return (FALSE);
- }
- }
- }
-
- return (TRUE);
-}
-
-/**
- Function to determine if a given filename exists.
-
- @param[in] Name Path to test.
-
- @retval EFI_SUCCESS The Path represents a file.
- @retval EFI_NOT_FOUND The Path does not represent a file.
- @retval other The path failed to open.
-**/
-EFI_STATUS
-EFIAPI
-ShellFileExists(
- IN CONST CHAR16 *Name
- )
-{
- EFI_STATUS Status;
- EFI_SHELL_FILE_INFO *List;
-
- ASSERT(Name != NULL);
-
- List = NULL;
- Status = ShellOpenFileMetaArg((CHAR16*)Name, EFI_FILE_MODE_READ, &List);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
-
- ShellCloseFileMetaArg(&List);
-
- return (EFI_SUCCESS);
-}
-
-/**
- Convert a Unicode character to upper case only if
- it maps to a valid small-case ASCII character.
-
- This internal function only deal with Unicode character
- which maps to a valid small-case ASCII character, i.e.
- L'a' to L'z'. For other Unicode character, the input character
- is returned directly.
-
- @param Char The character to convert.
-
- @retval LowerCharacter If the Char is with range L'a' to L'z'.
- @retval Unchanged Otherwise.
-
-**/
-CHAR16
-EFIAPI
-InternalShellCharToUpper (
- IN CHAR16 Char
- )
-{
- if (Char >= L'a' && Char <= L'z') {
- return (CHAR16) (Char - (L'a' - L'A'));
- }
-
- return Char;
-}
-
-/**
- Convert a Unicode character to numerical value.
-
- This internal function only deal with Unicode character
- which maps to a valid hexadecimal ASII character, i.e.
- L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other
- Unicode character, the value returned does not make sense.
-
- @param Char The character to convert.
-
- @return The numerical value converted.
-
-**/
-UINTN
-EFIAPI
-InternalShellHexCharToUintn (
- IN CHAR16 Char
- )
-{
- if (ShellIsDecimalDigitCharacter (Char)) {
- return Char - L'0';
- }
-
- return (UINTN) (10 + InternalShellCharToUpper (Char) - L'A');
-}
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
-
- This function returns a value of type UINTN by interpreting the contents
- of the Unicode string specified by String as a hexadecimal number.
- The format of the input Unicode string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
- If "x" appears in the input string, it must be prefixed with at least one 0.
- The function will ignore the pad space, which includes spaces or tab characters,
- before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or
- [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the
- first valid hexadecimal digit. Then, the function stops at the first character that is
- a not a valid hexadecimal character or NULL, whichever one comes first.
-
- If String has only pad spaces, then zero is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
- then zero is returned.
-
- @param[in] String A pointer to a Null-terminated Unicode string.
- @param[out] Value Upon a successful return the value of the conversion.
- @param[in] StopAtSpace FALSE to skip spaces.
-
- @retval EFI_SUCCESS The conversion was successful.
- @retval EFI_INVALID_PARAMETER A parameter was NULL or invalid.
- @retval EFI_DEVICE_ERROR An overflow occured.
-**/
-EFI_STATUS
-EFIAPI
-InternalShellStrHexToUint64 (
- IN CONST CHAR16 *String,
- OUT UINT64 *Value,
- IN CONST BOOLEAN StopAtSpace
- )
-{
- UINT64 Result;
-
- if (String == NULL || StrSize(String) == 0 || Value == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- if (InternalShellCharToUpper (*String) == L'X') {
- if (*(String - 1) != L'0') {
- return 0;
- }
- //
- // Skip the 'X'
- //
- String++;
- }
-
- Result = 0;
-
- //
- // Skip spaces if requested
- //
- while (StopAtSpace && *String == L' ') {
- String++;
- }
-
- while (ShellIsHexaDecimalDigitCharacter (*String)) {
- //
- // If the Hex Number represented by String overflows according
- // to the range defined by UINTN, then ASSERT().
- //
- if (!(Result <= (RShiftU64((((UINT64) ~0) - InternalShellHexCharToUintn (*String)), 4)))) {
-// if (!(Result <= ((((UINT64) ~0) - InternalShellHexCharToUintn (*String)) >> 4))) {
- return (EFI_DEVICE_ERROR);
- }
-
- Result = (LShiftU64(Result, 4));
- Result += InternalShellHexCharToUintn (*String);
- String++;
-
- //
- // stop at spaces if requested
- //
- if (StopAtSpace && *String == L' ') {
- break;
- }
- }
-
- *Value = Result;
- return (EFI_SUCCESS);
-}
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of
- type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the Unicode string specified by String as a decimal number. The format
- of the input Unicode string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The
- function will ignore the pad space, which includes spaces or
- tab characters, before [decimal digits]. The running zero in the
- beginning of [decimal digits] will be ignored. Then, the function
- stops at the first character that is a not a valid decimal character
- or a Null-terminator, whichever one comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits,
- then 0 is returned.
-
- @param[in] String A pointer to a Null-terminated Unicode string.
- @param[out] Value Upon a successful return the value of the conversion.
- @param[in] StopAtSpace FALSE to skip spaces.
-
- @retval EFI_SUCCESS The conversion was successful.
- @retval EFI_INVALID_PARAMETER A parameter was NULL or invalid.
- @retval EFI_DEVICE_ERROR An overflow occured.
-**/
-EFI_STATUS
-EFIAPI
-InternalShellStrDecimalToUint64 (
- IN CONST CHAR16 *String,
- OUT UINT64 *Value,
- IN CONST BOOLEAN StopAtSpace
- )
-{
- UINT64 Result;
-
- if (String == NULL || StrSize (String) == 0 || Value == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- Result = 0;
-
- //
- // Skip spaces if requested
- //
- while (StopAtSpace && *String == L' ') {
- String++;
- }
- while (ShellIsDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according
- // to the range defined by UINT64, then ASSERT().
- //
-
- if (!(Result <= (DivU64x32((((UINT64) ~0) - (*String - L'0')),10)))) {
- return (EFI_DEVICE_ERROR);
- }
-
- Result = MultU64x32(Result, 10) + (*String - L'0');
- String++;
-
- //
- // Stop at spaces if requested
- //
- if (StopAtSpace && *String == L' ') {
- break;
- }
- }
-
- *Value = Result;
-
- return (EFI_SUCCESS);
-}
-
-/**
- Function to verify and convert a string to its numerical value.
-
- If Hex it must be preceeded with a 0x, 0X, or has ForceHex set TRUE.
-
- @param[in] String The string to evaluate.
- @param[out] Value Upon a successful return the value of the conversion.
- @param[in] ForceHex TRUE - always assume hex.
- @param[in] StopAtSpace FALSE to skip spaces.
-
- @retval EFI_SUCCESS The conversion was successful.
- @retval EFI_INVALID_PARAMETER String contained an invalid character.
- @retval EFI_NOT_FOUND String was a number, but Value was NULL.
-**/
-EFI_STATUS
-EFIAPI
-ShellConvertStringToUint64(
- IN CONST CHAR16 *String,
- OUT UINT64 *Value,
- IN CONST BOOLEAN ForceHex,
- IN CONST BOOLEAN StopAtSpace
- )
-{
- UINT64 RetVal;
- CONST CHAR16 *Walker;
- EFI_STATUS Status;
- BOOLEAN Hex;
-
- Hex = ForceHex;
-
- if (!InternalShellIsHexOrDecimalNumber(String, Hex, StopAtSpace)) {
- if (!Hex) {
- Hex = TRUE;
- if (!InternalShellIsHexOrDecimalNumber(String, Hex, StopAtSpace)) {
- return (EFI_INVALID_PARAMETER);
- }
- } else {
- return (EFI_INVALID_PARAMETER);
- }
- }
-
- //
- // Chop off leading spaces
- //
- for (Walker = String; Walker != NULL && *Walker != CHAR_NULL && *Walker == L' '; Walker++);
-
- //
- // make sure we have something left that is numeric.
- //
- if (Walker == NULL || *Walker == CHAR_NULL || !InternalShellIsHexOrDecimalNumber(Walker, Hex, StopAtSpace)) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // do the conversion.
- //
- if (Hex || StrnCmp(Walker, L"0x", 2) == 0 || StrnCmp(Walker, L"0X", 2) == 0){
- Status = InternalShellStrHexToUint64(Walker, &RetVal, StopAtSpace);
- } else {
- Status = InternalShellStrDecimalToUint64(Walker, &RetVal, StopAtSpace);
- }
-
- if (Value == NULL && !EFI_ERROR(Status)) {
- return (EFI_NOT_FOUND);
- }
-
- if (Value != NULL) {
- *Value = RetVal;
- }
-
- return (Status);
-}
-
-/**
- Function to determin if an entire string is a valid number.
-
- If Hex it must be preceeded with a 0x or has ForceHex, set TRUE.
-
- @param[in] String The string to evaluate.
- @param[in] ForceHex TRUE - always assume hex.
- @param[in] StopAtSpace TRUE to halt upon finding a space, FALSE to keep going.
-
- @retval TRUE It is all numeric (dec/hex) characters.
- @retval FALSE There is a non-numeric character.
-**/
-BOOLEAN
-EFIAPI
-ShellIsHexOrDecimalNumber (
- IN CONST CHAR16 *String,
- IN CONST BOOLEAN ForceHex,
- IN CONST BOOLEAN StopAtSpace
- )
-{
- if (ShellConvertStringToUint64(String, NULL, ForceHex, StopAtSpace) == EFI_NOT_FOUND) {
- return (TRUE);
- }
- return (FALSE);
-}
-
-/**
- Function to read a single line from a SHELL_FILE_HANDLE. The \n is not included in the returned
- buffer. The returned buffer must be callee freed.
-
- If the position upon start is 0, then the Ascii Boolean will be set. This should be
- maintained and not changed for all operations with the same file.
-
- @param[in] Handle SHELL_FILE_HANDLE to read from.
- @param[in, out] Ascii Boolean value for indicating whether the file is
- Ascii (TRUE) or UCS2 (FALSE).
-
- @return The line of text from the file.
- @retval NULL There was not enough memory available.
-
- @sa ShellFileHandleReadLine
-**/
-CHAR16*
-EFIAPI
-ShellFileHandleReturnLine(
- IN SHELL_FILE_HANDLE Handle,
- IN OUT BOOLEAN *Ascii
- )
-{
- CHAR16 *RetVal;
- UINTN Size;
- EFI_STATUS Status;
-
- Size = 0;
- RetVal = NULL;
-
- Status = ShellFileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- RetVal = AllocateZeroPool(Size);
- if (RetVal == NULL) {
- return (NULL);
- }
- Status = ShellFileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);
-
- }
- if (EFI_ERROR(Status) && (RetVal != NULL)) {
- FreePool(RetVal);
- RetVal = NULL;
- }
- return (RetVal);
-}
-
-/**
- Function to read a single line (up to but not including the \n) from a SHELL_FILE_HANDLE.
-
- If the position upon start is 0, then the Ascii Boolean will be set. This should be
- maintained and not changed for all operations with the same file.
-
- @param[in] Handle SHELL_FILE_HANDLE to read from.
- @param[in, out] Buffer The pointer to buffer to read into.
- @param[in, out] Size The pointer to number of bytes in Buffer.
- @param[in] Truncate If the buffer is large enough, this has no effect.
- If the buffer is is too small and Truncate is TRUE,
- the line will be truncated.
- If the buffer is is too small and Truncate is FALSE,
- then no read will occur.
-
- @param[in, out] Ascii Boolean value for indicating whether the file is
- Ascii (TRUE) or UCS2 (FALSE).
-
- @retval EFI_SUCCESS The operation was successful. The line is stored in
- Buffer.
- @retval EFI_INVALID_PARAMETER Handle was NULL.
- @retval EFI_INVALID_PARAMETER Size was NULL.
- @retval EFI_BUFFER_TOO_SMALL Size was not large enough to store the line.
- Size was updated to the minimum space required.
-**/
-EFI_STATUS
-EFIAPI
-ShellFileHandleReadLine(
- IN SHELL_FILE_HANDLE Handle,
- IN OUT CHAR16 *Buffer,
- IN OUT UINTN *Size,
- IN BOOLEAN Truncate,
- IN OUT BOOLEAN *Ascii
- )
-{
- EFI_STATUS Status;
- CHAR16 CharBuffer;
- UINTN CharSize;
- UINTN CountSoFar;
- UINT64 OriginalFilePosition;
-
-
- if (Handle == NULL
- ||Size == NULL
- ){
- return (EFI_INVALID_PARAMETER);
- }
- if (Buffer == NULL) {
- ASSERT(*Size == 0);
- } else {
- *Buffer = CHAR_NULL;
- }
- gEfiShellProtocol->GetFilePosition(Handle, &OriginalFilePosition);
- if (OriginalFilePosition == 0) {
- CharSize = sizeof(CHAR16);
- Status = gEfiShellProtocol->ReadFile(Handle, &CharSize, &CharBuffer);
- ASSERT_EFI_ERROR(Status);
- if (CharBuffer == gUnicodeFileTag) {
- *Ascii = FALSE;
- } else {
- *Ascii = TRUE;
- gEfiShellProtocol->SetFilePosition(Handle, OriginalFilePosition);
- }
- }
-
- for (CountSoFar = 0;;CountSoFar++){
- CharBuffer = 0;
- if (*Ascii) {
- CharSize = sizeof(CHAR8);
- } else {
- CharSize = sizeof(CHAR16);
- }
- Status = gEfiShellProtocol->ReadFile(Handle, &CharSize, &CharBuffer);
- if ( EFI_ERROR(Status)
- || CharSize == 0
- || (CharBuffer == L'\n' && !(*Ascii))
- || (CharBuffer == '\n' && *Ascii)
- ){
- break;
- }
- //
- // if we have space save it...
- //
- if ((CountSoFar+1)*sizeof(CHAR16) < *Size){
- ASSERT(Buffer != NULL);
- ((CHAR16*)Buffer)[CountSoFar] = CharBuffer;
- ((CHAR16*)Buffer)[CountSoFar+1] = CHAR_NULL;
- }
- }
-
- //
- // if we ran out of space tell when...
- //
- if ((CountSoFar+1)*sizeof(CHAR16) > *Size){
- *Size = (CountSoFar+1)*sizeof(CHAR16);
- if (!Truncate) {
- gEfiShellProtocol->SetFilePosition(Handle, OriginalFilePosition);
- } else {
- DEBUG((DEBUG_WARN, "The line was truncated in ShellFileHandleReadLine"));
- }
- return (EFI_BUFFER_TOO_SMALL);
- }
- while(Buffer[StrLen(Buffer)-1] == L'\r') {
- Buffer[StrLen(Buffer)-1] = CHAR_NULL;
- }
-
- return (Status);
-}
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.h b/ShellPkg/Library/UefiShellLib/UefiShellLib.h
deleted file mode 100644
index 32f1c6596d..0000000000
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
- Provides interface to shell functionality for shell commands and applications.
-
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_SHELL_LIB_INTERNAL_H_
-#define _UEFI_SHELL_LIB_INTERNAL_H_
-
-#include <Uefi.h>
-
-#include <Guid/FileInfo.h>
-
-#include <Protocol/SimpleFileSystem.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/EfiShellInterface.h>
-#include <Protocol/EfiShellEnvironment2.h>
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/DevicePathLib.h>
-#include <Library/PcdLib.h>
-#include <Library/FileHandleLib.h>
-#include <Library/PrintLib.h>
-#include <Library/UefiLib.h>
-#include <Library/HiiLib.h>
-#include <Library/ShellLib.h>
-
-typedef struct {
- EFI_SHELL_GET_FILE_INFO GetFileInfo;
- EFI_SHELL_SET_FILE_INFO SetFileInfo;
- EFI_SHELL_READ_FILE ReadFile;
- EFI_SHELL_WRITE_FILE WriteFile;
- EFI_SHELL_CLOSE_FILE CloseFile;
- EFI_SHELL_DELETE_FILE DeleteFile;
- EFI_SHELL_GET_FILE_POSITION GetFilePosition;
- EFI_SHELL_SET_FILE_POSITION SetFilePosition;
- EFI_SHELL_FLUSH_FILE FlushFile;
- EFI_SHELL_GET_FILE_SIZE GetFileSize;
-} FILE_HANDLE_FUNCTION_MAP;
-
-/**
- Function to determin if an entire string is a valid number.
-
- If Hex it must be preceeded with a 0x or has ForceHex, set TRUE.
-
- @param[in] String The string to evaluate.
- @param[in] ForceHex TRUE - always assume hex.
- @param[in] StopAtSpace TRUE to halt upon finding a space, FALSE to keep going.
-
- @retval TRUE It is all numeric (dec/hex) characters.
- @retval FALSE There is a non-numeric character.
-**/
-BOOLEAN
-EFIAPI
-InternalShellIsHexOrDecimalNumber (
- IN CONST CHAR16 *String,
- IN CONST BOOLEAN ForceHex,
- IN CONST BOOLEAN StopAtSpace
- );
-
-#endif
-
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.inf b/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
deleted file mode 100644
index 18803bdcb8..0000000000
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
+++ /dev/null
@@ -1,69 +0,0 @@
-## @file
-# Provides interface to shell functionality for shell commands and applications.
-#
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellLib
- FILE_GUID = 449D0F00-2148-4a43-9836-F10B3980ECF5
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ShellLib|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = ShellLibConstructor
- DESTRUCTOR = ShellLibDestructor
-
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- UefiShellLib.c
- UefiShellLib.h
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- ShellPkg/ShellPkg.dec
-
-[LibraryClasses]
- UefiBootServicesTableLib
- MemoryAllocationLib
- DevicePathLib
- BaseLib
- BaseMemoryLib
- DebugLib
- FileHandleLib
- PrintLib
- UefiLib
- HiiLib
- SortLib
-
-[Protocols]
- gEfiSimpleFileSystemProtocolGuid # ALWAYS_CONSUMED
-
- # shell 2.0
- gEfiShellProtocolGuid # SOMETIMES_CONSUMED
- gEfiShellParametersProtocolGuid # SOMETIMES_CONSUMED
-
- # 'old' shell
- gEfiShellEnvironment2Guid # SOMETIMES_CONSUMED
- gEfiShellInterfaceGuid # SOMETIMES_CONSUMED
-
-[Guids]
- gEfiFileInfoGuid # ALWAYS_CONSUMED
- gEfiShellEnvironment2ExtGuid # ALWAYS_CONSUMED
-
-[Pcd.common]
- gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize # ALWAYS_CONSUMED
- gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize # ALWAYS_CONSUMED
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
deleted file mode 100644
index 32a4f7fb43..0000000000
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
+++ /dev/null
@@ -1,1762 +0,0 @@
-/** @file
- The implementation for ifcommand shell command.
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#include "UefiShellNetwork1CommandsLib.h"
-
-#define NIC_ITEM_CONFIG_SIZE (sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * MAX_IP4_CONFIG_IN_VARIABLE)
-#define EFI_IP4_TO_U32(EfiIpAddr) (*(IP4_ADDR*)((EfiIpAddr).Addr))
-
-BOOLEAN mIp4ConfigExist = FALSE;
-STATIC EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting = NULL;
-
-STATIC CONST UINTN SecondsToNanoSeconds = 10000000;
-STATIC CONST CHAR16 DhcpString[5] = L"DHCP";
-STATIC CONST CHAR16 StaticString[7] = L"STATIC";
-STATIC CONST CHAR16 PermanentString[10] = L"PERMANENT";
-
-typedef struct {
- LIST_ENTRY Link;
- EFI_HANDLE Handle;
- NIC_ADDR NicAddress;
- CHAR16 Name[IP4_NIC_NAME_LENGTH];
- BOOLEAN MediaPresentSupported;
- BOOLEAN MediaPresent;
- EFI_IP4_CONFIG_PROTOCOL *Ip4Config;
- NIC_IP4_CONFIG_INFO *ConfigInfo;
-} NIC_INFO;
-
-typedef struct {
- EFI_IP_ADDRESS DestIp;
- EFI_MAC_ADDRESS DestMac;
- EFI_IP_ADDRESS LocalIp;
- EFI_MAC_ADDRESS LocalMac;
- UINT8 MacLen;
- EFI_EVENT OnResolved;
- BOOLEAN Duplicate;
-} ARP_REQUEST;
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-c", TypeValue},
- {L"-l", TypeValue},
- {L"-s", TypeMaxValue},
- {NULL, TypeMax}
- };
-
-STATIC LIST_ENTRY NicInfoList;
-STATIC BOOLEAN ArpResolved;
-STATIC BOOLEAN mTimeout;
-
-/**
- Count the space delimited items in a string.
-
- @param[in] String A pointer to the string to count.
-
- @return The number of space-delimited items.
- @retval 0xFF an error occured.
-**/
-UINT8
-EFIAPI
-CountSubItems (
- IN CONST CHAR16 *String
- )
-{
- CONST CHAR16 *Walker;
- UINT8 Count;
-
- if (String == NULL || *String == CHAR_NULL) {
- return (0xFF);
- }
-
- for (Walker = String, Count = 0 ; Walker != NULL && *Walker != CHAR_NULL ; Walker = (StrStr(Walker, L" ")==NULL?NULL:StrStr(Walker, L" ")+1), Count++);
- return (Count);
-}
-
-/**
- Find the NIC_INFO by the specified nic name.
-
- @param[in] Name The pointer to the string containing the NIC name.
-
- @return The pointer to the NIC_INFO if there is a NIC_INFO named by Name.
- @retval NULL No NIC_INFO was found for Name.
-**/
-NIC_INFO*
-EFIAPI
-IfconfigFindNicByName (
- IN CONST CHAR16 *Name
- )
-{
- LIST_ENTRY *Entry;
- LIST_ENTRY *NextEntry;
- NIC_INFO *Info;
- CHAR16 *TempString;
-
- NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &NicInfoList) {
- Info = BASE_CR (Entry, NIC_INFO, Link);
- TempString = (CHAR16*)Info->Name;
-
- if (StringNoCaseCompare (&Name, &TempString) == 0) {
- return Info;
- }
- }
-
- return NULL;
-}
-
-/**
- Tests whether a child handle is a child device of the controller.
-
- @param[in] ControllerHandle A handle for a (parent) controller to test.
- @param[in] ChildHandle A child handle to test.
- @param[in] ProtocolGuid Supplies the protocol that the child controller
- opens on its parent controller.
-
- @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
- @retval EFI_UNSUPPORTED ChildHandle is not a child of the ControllerHandle.
-**/
-EFI_STATUS
-EFIAPI
-TestChildHandle (
- IN CONST EFI_HANDLE ControllerHandle,
- IN CONST EFI_HANDLE ChildHandle,
- IN CONST EFI_GUID *ProtocolGuid
- )
-{
- EFI_STATUS Status;
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;
- UINTN EntryCount;
- UINTN Index;
-
- ASSERT (ProtocolGuid != NULL);
-
- //
- // Retrieve the list of agents that are consuming the specific protocol
- // on ControllerHandle.
- //
- Status = gBS->OpenProtocolInformation (
- ControllerHandle,
- (EFI_GUID *) ProtocolGuid,
- &OpenInfoBuffer,
- &EntryCount
- );
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Inspect if ChildHandle is one of the agents.
- //
- Status = EFI_UNSUPPORTED;
- for (Index = 0; Index < EntryCount; Index++) {
- if ((OpenInfoBuffer[Index].ControllerHandle == ChildHandle) &&
- (OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
- Status = EFI_SUCCESS;
- break;
- }
- }
-
- FreePool (OpenInfoBuffer);
- return Status;
-}
-
-/**
- Get the child handle of the NIC handle.
-
- @param[in] Controller Routing information: GUID.
- @param[out] ChildHandle Returned child handle.
-
- @retval EFI_SUCCESS Successfully to get child handle.
-**/
-EFI_STATUS
-GetChildHandle (
- IN EFI_HANDLE Controller,
- OUT EFI_HANDLE *ChildHandle
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *Handles;
- UINTN HandleCount;
- UINTN Index;
- EFI_DEVICE_PATH_PROTOCOL *ChildDeviceDevicePath;
- VENDOR_DEVICE_PATH *VendorDeviceNode;
-
- //
- // Locate all EFI Hii Config Access protocols
- //
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiHiiConfigAccessProtocolGuid,
- NULL,
- &HandleCount,
- &Handles
- );
- if (EFI_ERROR (Status) || (HandleCount == 0)) {
- return Status;
- }
-
- Status = EFI_NOT_FOUND;
-
- for (Index = 0; Index < HandleCount; Index++) {
-
- Status = TestChildHandle (Controller, Handles[Index], &gEfiManagedNetworkServiceBindingProtocolGuid);
- if (!EFI_ERROR (Status)) {
- //
- // Get device path on the child handle
- //
- Status = gBS->HandleProtocol (
- Handles[Index],
- &gEfiDevicePathProtocolGuid,
- (VOID **) &ChildDeviceDevicePath
- );
-
- if (!EFI_ERROR (Status)) {
- while (!IsDevicePathEnd (ChildDeviceDevicePath)) {
- ChildDeviceDevicePath = NextDevicePathNode (ChildDeviceDevicePath);
- //
- // Parse one instance
- //
- if (ChildDeviceDevicePath->Type == HARDWARE_DEVICE_PATH &&
- ChildDeviceDevicePath->SubType == HW_VENDOR_DP) {
- VendorDeviceNode = (VENDOR_DEVICE_PATH *) ChildDeviceDevicePath;
- if (CompareMem (&VendorDeviceNode->Guid, &gEfiNicIp4ConfigVariableGuid, sizeof (EFI_GUID)) == 0) {
- //
- // Found item matched gEfiNicIp4ConfigVariableGuid
- //
- *ChildHandle = Handles[Index];
- FreePool (Handles);
- return EFI_SUCCESS;
- }
- }
- }
- }
- }
- }
-
- FreePool (Handles);
- return Status;
-}
-
-/**
- Append OFFSET/WIDTH/VALUE items at the beginning of string.
-
- @param[in, out] String The pointer to the string to append onto.
- @param[in] Offset Offset value.
- @param[in] Width Width value.
- @param[in] Block Point to data buffer.
-
- @return The count of unicode character that were appended.
-**/
-UINTN
-EFIAPI
-AppendOffsetWidthValue (
- IN OUT CHAR16 *String,
- IN UINTN Offset,
- IN UINTN Width,
- IN CONST UINT8 *Block
- )
-
-{
- CHAR16 *OriString;
-
- OriString = String;
-
- StrCpy (String, L"&OFFSET=");
- String += StrLen (L"&OFFSET=");
- String += UnicodeSPrint (String, 20, L"%x", Offset);
-
- StrCpy (String,L"&WIDTH=");
- String += StrLen (L"&WIDTH=");
- String += UnicodeSPrint (String, 20, L"%x", Width);
-
- if (Block != NULL) {
- StrCpy (String,L"&VALUE=");
- String += StrLen (L"&VALUE=");
- while ((Width--) != 0) {
- String += UnicodeSPrint (String, 20, L"%x", Block[Width]);
- }
- }
-
- return String - OriString;
-}
-
-/**
- Converts the unicode character of the string from uppercase to lowercase.
- This is a internal function.
-
- @param ConfigString String to be converted
-**/
-CHAR16*
-EFIAPI
-HiiToLower (
- IN CHAR16 *ConfigString
- )
-{
- CHAR16 *String;
- BOOLEAN Lower;
-
- //
- // Convert all hex digits in range [A-F] in the configuration header to [a-f]
- //
- for (String = ConfigString, Lower = FALSE; String != NULL && *String != L'\0'; String++) {
- if (*String == L'=') {
- Lower = TRUE;
- } else if (*String == L'&') {
- Lower = FALSE;
- } else if (Lower && *String >= L'A' && *String <= L'F') {
- *String = (CHAR16) (*String - L'A' + L'a');
- }
- }
-
- return (ConfigString);
-}
-
-
-/**
- Construct <ConfigHdr> using routing information GUID/NAME/PATH.
-
- @param[in] Guid Routing information: GUID.
- @param[in] Name Routing information: NAME.
- @param[in] DriverHandle Driver handle which contains the routing information: PATH.
-
- @retval NULL An error occured.
- @return The pointer to configHdr string.
-**/
-CHAR16 *
-EFIAPI
-ConstructConfigHdr (
- IN CONST EFI_GUID *Guid,
- IN CONST CHAR16 *Name,
- IN EFI_HANDLE DriverHandle
- )
-{
- EFI_STATUS Status;
- CHAR16 *ConfigHdr;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- CHAR16 *String;
- UINTN Index;
- UINT8 *Buffer;
- UINTN DevicePathLength;
- UINTN NameLength;
-
- //
- // Get the device path from handle installed EFI HII Config Access protocol
- //
- Status = gBS->HandleProtocol (
- DriverHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID **) &DevicePath
- );
- if (EFI_ERROR (Status)) {
- return NULL;
- }
-
- DevicePathLength = GetDevicePathSize (DevicePath);
- NameLength = StrLen (Name);
- ConfigHdr = AllocateZeroPool ((5 + sizeof (EFI_GUID) * 2 + 6 + NameLength * 4 + 6 + DevicePathLength * 2 + 1) * sizeof (CHAR16));
- if (ConfigHdr == NULL) {
- return NULL;
- }
-
- String = ConfigHdr;
- StrCpy (String, L"GUID=");
- String += StrLen (L"GUID=");
-
- //
- // Append Guid converted to <HexCh>32
- //
- for (Index = 0, Buffer = (UINT8 *)Guid; Index < sizeof (EFI_GUID); Index++) {
- String += UnicodeSPrint (String, 6, L"%02x", *Buffer++);
- }
-
- //
- // Append L"&NAME="
- //
- StrCpy (String, L"&NAME=");
- String += StrLen (L"&NAME=");
- for (Index = 0; Index < NameLength ; Index++) {
- String += UnicodeSPrint (String, 10, L"00%x", Name[Index]);
- }
-
- //
- // Append L"&PATH="
- //
- StrCpy (String, L"&PATH=");
- String += StrLen (L"&PATH=");
- for (Index = 0, Buffer = (UINT8 *) DevicePath; Index < DevicePathLength; Index++) {
- String += UnicodeSPrint (String, 6, L"%02x", *Buffer++);
- }
-
- return (HiiToLower(ConfigHdr));
-}
-
-/**
- Get network physical device NIC information.
-
- @param[in] Handle The network physical device handle.
- @param[out] NicAddr NIC information.
-
- @retval EFI_SUCCESS Get NIC information successfully.
-**/
-EFI_STATUS
-EFIAPI
-IfConfigGetNicMacInfo (
- IN EFI_HANDLE Handle,
- OUT NIC_ADDR *NicAddr
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE MnpHandle;
- EFI_SIMPLE_NETWORK_MODE SnpMode;
- EFI_MANAGED_NETWORK_PROTOCOL *Mnp;
-
- MnpHandle = NULL;
- Mnp = NULL;
-
- Status = NetLibCreateServiceChild (
- Handle,
- gImageHandle,
- &gEfiManagedNetworkServiceBindingProtocolGuid,
- &MnpHandle
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = gBS->HandleProtocol (
- MnpHandle,
- &gEfiManagedNetworkProtocolGuid,
- (VOID **) &Mnp
- );
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
-
- Status = Mnp->GetModeData (Mnp, NULL, &SnpMode);
- if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {
- goto ON_ERROR;
- }
-
- NicAddr->Type = (UINT16) SnpMode.IfType;
- NicAddr->Len = (UINT8) SnpMode.HwAddressSize;
- CopyMem (&NicAddr->MacAddr, &SnpMode.CurrentAddress, NicAddr->Len);
-
-ON_ERROR:
-
- NetLibDestroyServiceChild (
- Handle,
- gImageHandle,
- &gEfiManagedNetworkServiceBindingProtocolGuid,
- MnpHandle
- );
-
- return Status;
-
-}
-
-/**
- Get network physical device NIC information.
-
- @param[in] Handle The network physical device handle.
- @param[out] MediaPresentSupported
- Upon successful return, TRUE is media present
- is supported. FALSE otherwise.
- @param[out] MediaPresent Upon successful return, TRUE is media present
- is enabled. FALSE otherwise.
-
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-IfConfigGetNicMediaStatus (
- IN EFI_HANDLE Handle,
- OUT BOOLEAN *MediaPresentSupported,
- OUT BOOLEAN *MediaPresent
- )
-
-{
- EFI_STATUS Status;
- EFI_HANDLE MnpHandle;
- EFI_SIMPLE_NETWORK_MODE SnpMode;
- EFI_MANAGED_NETWORK_PROTOCOL *Mnp;
-
- MnpHandle = NULL;
- Mnp = NULL;
-
- Status = NetLibCreateServiceChild (
- Handle,
- gImageHandle,
- &gEfiManagedNetworkServiceBindingProtocolGuid,
- &MnpHandle
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = gBS->HandleProtocol (
- MnpHandle,
- &gEfiManagedNetworkProtocolGuid,
- (VOID **) &Mnp
- );
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
-
- Status = Mnp->GetModeData (Mnp, NULL, &SnpMode);
- if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {
- goto ON_ERROR;
- }
-
- *MediaPresentSupported = SnpMode.MediaPresentSupported;
- *MediaPresent = SnpMode.MediaPresent;
-
-ON_ERROR:
-
- NetLibDestroyServiceChild (
- Handle,
- gImageHandle,
- &gEfiManagedNetworkServiceBindingProtocolGuid,
- MnpHandle
- );
-
- return Status;
-
-}
-
-/**
- Get all Nic's information through HII service.
-
- @retval EFI_SUCCESS All the nic information is collected.
-**/
-EFI_STATUS
-EFIAPI
-IfconfigGetAllNicInfoByHii (
- VOID
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *Handles;
- UINTN HandleCount;
- CHAR16 *ConfigResp;
- CHAR16 *ConfigHdr;
- UINTN Index;
- CHAR16 *AccessProgress;
- CHAR16 *AccessResults;
- UINTN BufferSize;
- NIC_INFO *NicInfo;
- NIC_IP4_CONFIG_INFO *NicConfigRequest;
- NIC_IP4_CONFIG_INFO *NicConfig;
- CHAR16 *String;
- UINTN Length;
- UINTN Offset;
- EFI_HANDLE ChildHandle;
-
- AccessResults = NULL;
- ConfigHdr = NULL;
- ConfigResp = NULL;
- NicConfigRequest = NULL;
- NicInfo = NULL;
-
- InitializeListHead (&NicInfoList);
-
- //
- // Check if HII Config Routing protocol available.
- //
- Status = gBS->LocateProtocol (
- &gEfiHiiConfigRoutingProtocolGuid,
- NULL,
- (VOID**)&mHiiConfigRouting
- );
- if (EFI_ERROR (Status)) {
- return EFI_NOT_FOUND;
- }
-
- //
- // Locate all network device handles
- //
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiManagedNetworkServiceBindingProtocolGuid,
- NULL,
- &HandleCount,
- &Handles
- );
- if (EFI_ERROR (Status) || (HandleCount == 0)) {
- return EFI_NOT_FOUND;
- }
-
- for (Index = 0; Index < HandleCount; Index++) {
- Status = GetChildHandle (Handles[Index], &ChildHandle);
- if (EFI_ERROR (Status)) {
- //
- // If failed to get Child handle, try NIC controller handle for back-compatibility.
- //
- ChildHandle = Handles[Index];
- }
- //
- // Construct configuration request string header
- //
- ConfigHdr = ConstructConfigHdr (&gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE, ChildHandle);
- if (ConfigHdr != NULL) {
- Length = StrLen (ConfigHdr);
- } else {
- Length = 0;
- }
- ConfigResp = AllocateZeroPool ((Length + NIC_ITEM_CONFIG_SIZE * 2 + 100) * sizeof (CHAR16));
- if (ConfigResp == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto ON_ERROR;
- }
- if (ConfigHdr != NULL) {
- StrCpy (ConfigResp, ConfigHdr);
- }
-
- //
- // Append OFFSET/WIDTH pair
- //
- String = ConfigResp + Length;
- Offset = 0;
- AppendOffsetWidthValue (String, Offset, NIC_ITEM_CONFIG_SIZE, NULL);
-
- NicInfo = AllocateZeroPool (sizeof (NIC_INFO));
- if (NicInfo == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto ON_ERROR;
- }
- NicInfo->Handle = Handles[Index];
-
- //
- // Get network physical devcie MAC information
- //
- IfConfigGetNicMacInfo (Handles[Index], &NicInfo->NicAddress);
- if (NicInfo->NicAddress.Type == NET_IFTYPE_ETHERNET) {
- UnicodeSPrint (NicInfo->Name, IP4_NIC_NAME_LENGTH, L"eth%d", Index);
- } else {
- UnicodeSPrint (NicInfo->Name, IP4_NIC_NAME_LENGTH, L"unk%d", Index);
- }
-
- //
- // Get media status
- //
- IfConfigGetNicMediaStatus (Handles[Index], &NicInfo->MediaPresentSupported, &NicInfo->MediaPresent);
-
- NicConfigRequest = AllocateZeroPool (NIC_ITEM_CONFIG_SIZE);
- if (NicConfigRequest == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto ON_ERROR;
- }
-
- //
- // Get network parameters by HII service
- //
- Status = mHiiConfigRouting->ExtractConfig (
- mHiiConfigRouting,
- ConfigResp,
- &AccessProgress,
- &AccessResults
- );
- if (!EFI_ERROR (Status)) {
- BufferSize = NIC_ITEM_CONFIG_SIZE;
- Status = mHiiConfigRouting->ConfigToBlock (
- mHiiConfigRouting,
- AccessResults,
- (UINT8 *) NicConfigRequest,
- &BufferSize,
- &AccessProgress
- );
- if (!EFI_ERROR (Status)) {
- BufferSize = sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * NicConfigRequest->Ip4Info.RouteTableSize;
- NicConfig = AllocateZeroPool (BufferSize);
- if (NicConfig == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto ON_ERROR;
- }
- CopyMem (NicConfig, NicConfigRequest, BufferSize);
-
- //
- // If succeeds to get NIC configuration, fix up routetable pointer.
- //
- NicConfig->Ip4Info.RouteTable = (EFI_IP4_ROUTE_TABLE *) (&NicConfig->Ip4Info + 1);
- NicInfo->ConfigInfo = NicConfig;
-
- } else {
- NicInfo->ConfigInfo = NULL;
- }
-
- FreePool (AccessResults);
-
- } else {
- NicInfo->ConfigInfo = NULL;
- }
-
- //
- // Add the Nic's info to the global NicInfoList.
- //
- InsertTailList (&NicInfoList, &NicInfo->Link);
-
- FreePool (NicConfigRequest);
- FreePool (ConfigResp);
- FreePool (ConfigHdr);
- }
-
- FreePool (Handles);
-
- return EFI_SUCCESS;
-
-ON_ERROR:
- if (AccessResults != NULL) {
- FreePool (AccessResults);
- }
- if (NicConfigRequest != NULL) {
- FreePool (NicConfigRequest);
- }
- if (NicInfo != NULL) {
- FreePool (NicInfo);
- }
- if (ConfigResp != NULL) {
- FreePool (ConfigResp);
- }
- if (ConfigHdr != NULL) {
- FreePool (ConfigHdr);
- }
-
- FreePool (Handles);
-
- return Status;
-}
-
-/**
- Set the address for the specified nic by HII service.
-
- @param[in] NicInfo A pointer to the NIC_INFO of the Nic to be configured.
- @param[in] Config The command line arguments for the set operation.
-
- @retval EFI_SUCCESS The address set operation is done.
-**/
-SHELL_STATUS
-EFIAPI
-IfconfigSetNicAddrByHii (
- IN CONST NIC_INFO *NicInfo,
- IN CONST NIC_IP4_CONFIG_INFO *Config
- )
-{
- EFI_STATUS Status;
- SHELL_STATUS ShellStatus;
- NIC_IP4_CONFIG_INFO *NicConfig;
- CHAR16 *ConfigResp;
- CHAR16 *ConfigHdr;
- CHAR16 *AccessProgress;
- CHAR16 *AccessResults;
- CHAR16 *String;
- UINTN Length;
- UINTN Offset;
- EFI_HANDLE ChildHandle;
-
- AccessResults = NULL;
- ConfigHdr = NULL;
- ConfigResp = NULL;
- NicConfig = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- Status = GetChildHandle (NicInfo->Handle, &ChildHandle);
- if (EFI_ERROR (Status)) {
- //
- // If failed to get Child handle, try NIC controller handle for back-compatibility
- //
- ChildHandle = NicInfo->Handle;
- }
- //
- // Construct config request string header
- //
- ConfigHdr = ConstructConfigHdr (&gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE, ChildHandle);
- if (ConfigHdr != NULL) {
- Length = StrLen (ConfigHdr);
- } else {
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- goto ON_EXIT;
- }
- ConfigResp = AllocateZeroPool ((Length + NIC_ITEM_CONFIG_SIZE * 2 + 100) * sizeof (CHAR16));
- if (ConfigResp == NULL) {
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- goto ON_EXIT;
- }
- if (ConfigHdr != NULL) {
- StrCpy (ConfigResp, ConfigHdr);
- }
-
- NicConfig = AllocateZeroPool (NIC_ITEM_CONFIG_SIZE);
- if (NicConfig == NULL) {
- ShellStatus = SHELL_OUT_OF_RESOURCES;
- goto ON_EXIT;
- }
-
- if (Config != NULL) {
- CopyMem (NicConfig, Config, sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * Config->Ip4Info.RouteTableSize);
- }
-
- //
- // Append OFFSET/WIDTH pair
- //
- String = ConfigResp + Length;
- Offset = 0;
- AppendOffsetWidthValue (String, Offset, NIC_ITEM_CONFIG_SIZE, NULL);
-
- //
- // Call HII helper function to generate configuration string
- //
- Status = mHiiConfigRouting->BlockToConfig (
- mHiiConfigRouting,
- ConfigResp,
- (UINT8 *) NicConfig,
- NIC_ITEM_CONFIG_SIZE,
- &AccessResults,
- &AccessProgress
- );
- if (EFI_ERROR (Status)) {
- ShellStatus = SHELL_NOT_FOUND;
- goto ON_EXIT;
- }
-
- //
- // Set IP setting by HII servie
- //
- Status = mHiiConfigRouting->RouteConfig (
- mHiiConfigRouting,
- AccessResults,
- &AccessProgress
- );
- if (EFI_ERROR(Status)) {
- ShellStatus = SHELL_ACCESS_DENIED;
- }
-
-ON_EXIT:
- SHELL_FREE_NON_NULL(AccessResults);
- SHELL_FREE_NON_NULL(NicConfig);
- SHELL_FREE_NON_NULL(ConfigResp);
- SHELL_FREE_NON_NULL(ConfigHdr);
-
- return ShellStatus;
-}
-
-/**
- The callback function for the Arp address resolved event.
-
- @param[in] Event The event this function is registered to.
- @param[in] Context The context registered to the event.
-**/
-VOID
-EFIAPI
-IfconfigOnArpResolved (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- ARP_REQUEST *Request;
- UINT8 Index;
-
- Request = (ARP_REQUEST *) Context;
- ASSERT (Request != NULL);
-
- Request->Duplicate = FALSE;
-
- if (0 == CompareMem (&Request->LocalMac, &Request->DestMac, Request->MacLen)) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR),
- gShellNetwork1HiiHandle,
- L"Already Configured",
- (UINTN)Request->DestIp.v4.Addr[0],
- (UINTN)Request->DestIp.v4.Addr[1],
- (UINTN)Request->DestIp.v4.Addr[2],
- (UINTN)Request->DestIp.v4.Addr[3]
- );
- ArpResolved = TRUE;
- return;
- }
-
- for (Index = 0; Index < Request->MacLen; Index++) {
- if (Request->DestMac.Addr[Index] != 0) {
- Request->Duplicate = TRUE;
- }
- }
-
- if (Request->Duplicate) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_IFCONFIG_CONF_IP_ADDR),
- gShellNetwork1HiiHandle,
- (UINTN)Request->DestMac.Addr[0],
- (UINTN)Request->DestMac.Addr[1],
- (UINTN)Request->DestMac.Addr[2],
- (UINTN)Request->DestMac.Addr[3],
- (UINTN)Request->DestMac.Addr[4],
- (UINTN)Request->DestMac.Addr[5]
- );
- }
-
- ArpResolved = TRUE;
- return ;
-}
-
-/**
- Check whether the address to be configured conflicts with other hosts.
-
- @param[in] NicInfo The pointer to the NIC_INFO of the Nic to be configured.
- @param[in] IpAddr The IPv4 address to be configured to the Nic.
-
- @return TRUE Some other host already uses the IpAddr.
- @return FALSE The address is unused.
-**/
-BOOLEAN
-EFIAPI
-IfconfigIsIpDuplicate (
- IN NIC_INFO *NicInfo,
- IN IP4_ADDR IpAddr
- )
-{
- EFI_ARP_PROTOCOL *Arp;
- EFI_ARP_CONFIG_DATA ArpCfgData;
- EFI_HANDLE ArpHandle;
- ARP_REQUEST Request;
- EFI_STATUS Status;
-
- Arp = NULL;
- ArpHandle = NULL;
- ZeroMem (&Request, sizeof (ARP_REQUEST));
-
- Status = NetLibCreateServiceChild (
- NicInfo->Handle,
- gImageHandle,
- &gEfiArpServiceBindingProtocolGuid,
- &ArpHandle
- );
-
- if (EFI_ERROR (Status)) {
- return FALSE;
- }
-
- Status = gBS->OpenProtocol (
- ArpHandle,
- &gEfiArpProtocolGuid,
- (VOID**)&Arp,
- gImageHandle,
- ArpHandle,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
-
- if (EFI_ERROR (Status)) {
- goto ON_EXIT;
- }
-
- //
- // Set up the Arp requests
- //
- EFI_IP4_TO_U32 (Request.DestIp.v4) = IpAddr;
- EFI_IP4_TO_U32 (Request.LocalIp.v4) = 0xffffffff;
- Request.LocalMac = NicInfo->NicAddress.MacAddr;
- Request.MacLen = NicInfo->NicAddress.Len;
-
- Status = gBS->CreateEvent (
- EVT_NOTIFY_SIGNAL,
- TPL_CALLBACK,
- IfconfigOnArpResolved,
- (VOID *) &Request,
- &Request.OnResolved
- );
-
- if (EFI_ERROR (Status)) {
- goto ON_EXIT;
- }
-
- ArpCfgData.SwAddressType = 0x0800;
- ArpCfgData.SwAddressLength = 4;
- ArpCfgData.StationAddress = &Request.LocalIp;
- ArpCfgData.EntryTimeOut = 0;
- ArpCfgData.RetryCount = 3;
- ArpCfgData.RetryTimeOut = 0;
-
- Status = Arp->Configure (Arp, &ArpCfgData);
-
- if (EFI_ERROR (Status)) {
- goto ON_EXIT;
- }
-
- Status = Arp->Request (
- Arp,
- &Request.DestIp,
- Request.OnResolved,
- &Request.DestMac
- );
-
- if (EFI_ERROR (Status) && (Status != EFI_NOT_READY)) {
- goto ON_EXIT;
- }
-
- while (!ArpResolved) {
-
- }
-
-ON_EXIT:
- if (Request.OnResolved != NULL) {
- gBS->CloseEvent (Request.OnResolved);
- }
-
- NetLibDestroyServiceChild (
- NicInfo->Handle,
- gImageHandle,
- &gEfiArpServiceBindingProtocolGuid,
- ArpHandle
- );
-
- return Request.Duplicate;
-}
-
-/**
- The callback function for the timer event used to get map.
-
- @param[in] Event The event this function is registered to.
- @param[in] Context The context registered to the event.
-**/
-VOID
-EFIAPI
-TimeoutToGetMap (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- mTimeout = TRUE;
- return ;
-}
-
-/**
- Create an IP child, use it to start the auto configuration, then destroy it.
-
- @param[in] NicInfo The pointer to the NIC_INFO of the Nic to be configured.
-
- @retval EFI_SUCCESS The configuration is done.
-**/
-EFI_STATUS
-EFIAPI
-IfconfigStartIp4(
- IN NIC_INFO *NicInfo
- )
-{
- EFI_IP4_PROTOCOL *Ip4;
- EFI_HANDLE Ip4Handle;
- EFI_HANDLE TimerToGetMap;
- EFI_IP4_CONFIG_DATA Ip4ConfigData;
- EFI_IP4_MODE_DATA Ip4Mode;
- EFI_STATUS Status;
-
- //
- // Get the Ip4ServiceBinding Protocol
- //
- Ip4Handle = NULL;
- Ip4 = NULL;
- TimerToGetMap = NULL;
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_START_SET_ADDR), gShellNetwork1HiiHandle);
-
- Status = NetLibCreateServiceChild (
- NicInfo->Handle,
- gImageHandle,
- &gEfiIp4ServiceBindingProtocolGuid,
- &Ip4Handle
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = gBS->OpenProtocol (
- Ip4Handle,
- &gEfiIp4ProtocolGuid,
- (VOID **) &Ip4,
- NicInfo->Handle,
- gImageHandle,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
-
- if (EFI_ERROR (Status)) {
- goto ON_EXIT;
- }
-
- Ip4ConfigData.DefaultProtocol = EFI_IP_PROTO_ICMP;
- Ip4ConfigData.AcceptAnyProtocol = FALSE;
- Ip4ConfigData.AcceptIcmpErrors = FALSE;
- Ip4ConfigData.AcceptBroadcast = FALSE;
- Ip4ConfigData.AcceptPromiscuous = FALSE;
- Ip4ConfigData.UseDefaultAddress = TRUE;
- ZeroMem (&Ip4ConfigData.StationAddress, sizeof (EFI_IPv4_ADDRESS));
- ZeroMem (&Ip4ConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
- Ip4ConfigData.TypeOfService = 0;
- Ip4ConfigData.TimeToLive = 1;
- Ip4ConfigData.DoNotFragment = FALSE;
- Ip4ConfigData.RawData = FALSE;
- Ip4ConfigData.ReceiveTimeout = 0;
- Ip4ConfigData.TransmitTimeout = 0;
-
- Status = Ip4->Configure (Ip4, &Ip4ConfigData);
-
- if (Status == EFI_NO_MAPPING) {
- mTimeout = FALSE;
- Status = gBS->CreateEvent (
- EVT_NOTIFY_SIGNAL | EVT_TIMER,
- TPL_CALLBACK,
- TimeoutToGetMap,
- NULL,
- &TimerToGetMap
- );
-
- if (EFI_ERROR (Status)) {
- goto ON_EXIT;
- }
-
- Status = gBS->SetTimer (
- TimerToGetMap,
- TimerRelative,
- MultU64x32 (SecondsToNanoSeconds, 5)
- );
-
- if (EFI_ERROR (Status)) {
- goto ON_EXIT;
- }
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_WAIT_SET_DONE), gShellNetwork1HiiHandle);
-
- while (!mTimeout) {
- Ip4->Poll (Ip4);
-
- if (!EFI_ERROR (Ip4->GetModeData (Ip4, &Ip4Mode, NULL, NULL)) &&
- Ip4Mode.IsConfigured) {
- break;
- }
- }
- }
-
- Status = Ip4->GetModeData (Ip4, &Ip4Mode, NULL, NULL);
-
- if ((Status == EFI_SUCCESS) && Ip4Mode.IsConfigured) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR),
- gShellNetwork1HiiHandle,
- L"Default",
- (UINTN)Ip4Mode.ConfigData.StationAddress.Addr[0],
- (UINTN)Ip4Mode.ConfigData.StationAddress.Addr[1],
- (UINTN)Ip4Mode.ConfigData.StationAddress.Addr[2],
- (UINTN)Ip4Mode.ConfigData.StationAddress.Addr[3]
- );
- }
-
-ON_EXIT:
-
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_GET_DEF_ADDR_FAIL), gShellNetwork1HiiHandle);
- }
-
- if (TimerToGetMap != NULL) {
- gBS->SetTimer (TimerToGetMap, TimerCancel, 0);
- gBS->CloseEvent (TimerToGetMap);
- }
-
- NetLibDestroyServiceChild (
- NicInfo->Handle,
- gImageHandle,
- &gEfiIp4ServiceBindingProtocolGuid,
- Ip4Handle
- );
-
- return Status;
-}
-
-/**
- Set the address for the nic specified by the params.
-
- @param[in] Argc The count of the passed in Params.
- @param[in] Params The command line arguments for the set operation.
-
- @retval EFI_SUCCESS The address set operation is done.
- @return Some error occurs.
-**/
-SHELL_STATUS
-EFIAPI
-IfconfigSetNicAddr (
- IN UINTN Argc,
- IN CONST CHAR16 *Params
- )
-{
- NIC_IP4_CONFIG_INFO *Config;
- NIC_IP4_CONFIG_INFO *OldConfig;
- EFI_IP_ADDRESS Ip;
- EFI_IP_ADDRESS Mask;
- EFI_IP_ADDRESS Gateway;
- NIC_INFO *Info;
- BOOLEAN Permanent;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Walker;
- CHAR16 *Temp;
- CONST CHAR16 *DhcpTemp;
- CONST CHAR16 *StaticTemp;
- CONST CHAR16 *PermTemp;
- UINT32 NetworkBytes1;
- UINT32 NetworkBytes2;
- EFI_STATUS Status;
-
- Walker = Params;
- Temp = NULL;
- Temp = StrnCatGrow(&Temp, NULL, Walker, StrStr(Walker, L" ")-Walker);
- Info = IfconfigFindNicByName (Temp);
-
- if (Info == NULL) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_INTERFACE_NOT_FOUND), gShellNetwork1HiiHandle, Temp);
- return SHELL_NOT_FOUND;
- }
-
- Walker += StrLen(Temp) + 1;
- FreePool(Temp);
- Temp = NULL;
- Temp = StrnCatGrow(&Temp, NULL, Walker, StrStr(Walker, L" ")==NULL?0:StrStr(Walker, L" ")-Walker);
-
- Config = AllocateZeroPool (sizeof (NIC_IP4_CONFIG_INFO) + 2 * sizeof (EFI_IP4_ROUTE_TABLE));
- if (Config == NULL) {
- return SHELL_OUT_OF_RESOURCES;
- }
-
- Config->Ip4Info.RouteTable = (EFI_IP4_ROUTE_TABLE *) (Config + 1);
-
- OldConfig = Info->ConfigInfo;
- Permanent = FALSE;
- ShellStatus = SHELL_INVALID_PARAMETER;
-
- DhcpTemp = DhcpString;
- StaticTemp = StaticString;
-
- if (StringNoCaseCompare(&Temp, &DhcpTemp) == 0) {
- //
- // Validate the parameter for DHCP, two valid forms: eth0 DHCP and eth0 DHCP perment
- //
- if ((Argc != 2) && (Argc!= 3)) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellNetwork1HiiHandle, Temp);
- ASSERT(ShellStatus == SHELL_INVALID_PARAMETER);
- goto ON_EXIT;
- }
-
- if (Argc == 3) {
- Walker += StrLen(Temp) + 1;
- FreePool(Temp);
- Temp = NULL;
- Temp = StrnCatGrow(&Temp, NULL, Walker, 0);
-
- PermTemp = PermanentString;
- if (StringNoCaseCompare(&Temp, &PermTemp) != 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_GEN_PROBLEM_OP2), gShellNetwork1HiiHandle, Temp, PermanentString, L"Nothing");
- ASSERT(ShellStatus == SHELL_INVALID_PARAMETER);
- goto ON_EXIT;
- }
-
- Permanent = TRUE;
- }
-
- if ((OldConfig != NULL) && (OldConfig->Source == IP4_CONFIG_SOURCE_DHCP) &&
- (OldConfig->Perment == Permanent)) {
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_INTERFACE_CONFIGURED), gShellNetwork1HiiHandle, Info->Name);
- ShellStatus = SHELL_ALREADY_STARTED;
- goto ON_EXIT;
- }
-
- Config->Source = IP4_CONFIG_SOURCE_DHCP;
- } else if (StringNoCaseCompare(&Temp, &StaticTemp) == 0) {
- //
- // validate the parameter, two forms: eth0 static IP NETMASK GATEWAY and
- // eth0 static IP NETMASK GATEWAY perment
- //
- if ((Argc != 5) && (Argc != 6)) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellNetwork1HiiHandle, Temp);
- ASSERT(ShellStatus == SHELL_INVALID_PARAMETER);
- goto ON_EXIT;
- }
-
- Walker += StrLen(Temp) + 1;
- FreePool(Temp);
- Temp = NULL;
- Temp = StrnCatGrow(&Temp, NULL, Walker, StrStr(Walker, L" ")-Walker);
-
- if (EFI_ERROR (NetLibStrToIp4 (Temp, &Ip.v4))) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_INVALID_IP_STR), gShellNetwork1HiiHandle, Temp);
- ASSERT(ShellStatus == SHELL_INVALID_PARAMETER);
- goto ON_EXIT;
- }
-
- Walker += StrLen(Temp) + 1;
- FreePool(Temp);
- Temp = NULL;
- Temp = StrnCatGrow(&Temp, NULL, Walker, StrStr(Walker, L" ")-Walker);
- if (EFI_ERROR (NetLibStrToIp4 (Temp, &Mask.v4))) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_INVALID_IP_STR), gShellNetwork1HiiHandle, Temp);
- ASSERT(ShellStatus == SHELL_INVALID_PARAMETER);
- goto ON_EXIT;
- }
-
- Walker += StrLen(Temp) + 1;
- FreePool(Temp);
- Temp = NULL;
- if (Argc == 6) {
- Temp = StrnCatGrow(&Temp, NULL, Walker, StrStr(Walker, L" ")-Walker);
- } else {
- Temp = StrnCatGrow(&Temp, NULL, Walker, 0);
- }
- if (EFI_ERROR (NetLibStrToIp4 (Temp, &Gateway.v4))) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_INVALID_IP_STR), gShellNetwork1HiiHandle, Temp);
- ASSERT(ShellStatus == SHELL_INVALID_PARAMETER);
- goto ON_EXIT;
- }
-
- if (Argc == 6) {
- Walker += StrLen(Temp) + 1;
- FreePool(Temp);
- Temp = NULL;
- Temp = StrnCatGrow(&Temp, NULL, Walker, 0);
-
- PermTemp = PermanentString;
- if (StringNoCaseCompare(&Temp, &PermTemp) != 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_GEN_PROBLEM_OP2), gShellNetwork1HiiHandle, Temp, PermanentString, L"Nothing");
- ASSERT(ShellStatus == SHELL_INVALID_PARAMETER);
- goto ON_EXIT;
- }
-
- Permanent = TRUE;
- }
-
- NetworkBytes1 = NTOHL (Ip.Addr[0]);
- NetworkBytes2 = NTOHL (Mask.Addr[0]);
- if ((Ip.Addr[0] == 0) || (Mask.Addr[0] == 0) ||
- !NetIp4IsUnicast (NetworkBytes1, NetworkBytes2)) {
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_INVALID_ADDR_PAIR), gShellNetwork1HiiHandle);
- ASSERT(ShellStatus == SHELL_INVALID_PARAMETER);
- goto ON_EXIT;
- }
-
- NetworkBytes1 = NTOHL (Gateway.Addr[0]);
- if (!IP4_NET_EQUAL (Ip.Addr[0], Gateway.Addr[0], Mask.Addr[0]) ||
- !NetIp4IsUnicast (NetworkBytes1, NetworkBytes2)) {
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_INVALID_GATEWAY), gShellNetwork1HiiHandle);
- ASSERT(ShellStatus == SHELL_INVALID_PARAMETER);
- goto ON_EXIT;
- }
-
- //
- // Set the configuration up, two route table entries are added:
- // one for the direct connected network, and another for the
- // default gateway. Remember, some structure members are cleared
- // by AllocateZeroPool
- //
- Config->Source = IP4_CONFIG_SOURCE_STATIC;
- Config->Ip4Info.RouteTableSize = 2;
-
- CopyMem (&Config->Ip4Info.StationAddress, &Ip.v4, sizeof (EFI_IPv4_ADDRESS));
- CopyMem (&Config->Ip4Info.SubnetMask, &Mask.v4, sizeof (EFI_IPv4_ADDRESS));
-
- Ip.Addr[0] = Ip.Addr[0] & Mask.Addr[0];
-
- CopyMem (&Config->Ip4Info.RouteTable[0].SubnetAddress, &Ip.v4, sizeof (EFI_IPv4_ADDRESS));
- CopyMem (&Config->Ip4Info.RouteTable[0].SubnetMask, &Mask.v4, sizeof (EFI_IPv4_ADDRESS));
- CopyMem (&Config->Ip4Info.RouteTable[1].GatewayAddress, &Gateway.v4, sizeof (EFI_IPv4_ADDRESS));
- } else {
- // neither static or DHCP. error.
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_GEN_TOO_FEW), gShellNetwork1HiiHandle);
- ASSERT(ShellStatus == SHELL_INVALID_PARAMETER);
- goto ON_EXIT;
- }
-
- CopyMem (&Config->NicAddr, &Info->NicAddress, sizeof (NIC_ADDR));
- Config->Perment = Permanent;
-
- //
- // Use HII service to set NIC address
- //
- ShellStatus = IfconfigSetNicAddrByHii (Info, Config);
- if (ShellStatus != SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_SET_FAIL), gShellNetwork1HiiHandle, ShellStatus^MAX_BIT);
- goto ON_EXIT;
- }
-
- Status = IfconfigStartIp4 (Info);
- if (EFI_ERROR(Status)) {
- ShellStatus = SHELL_ACCESS_DENIED;
- }
-
- if (ShellStatus != SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_IP_CHILD_FAIL), gShellNetwork1HiiHandle, ShellStatus^MAX_BIT);
- }
-
-ON_EXIT:
- SHELL_FREE_NON_NULL(Config);
-
- return ShellStatus;
-}
-
-/**
- Show the address information for the nic specified.
-
- @param[in] Name A pointer to the string containg the nic's name, if NULL,
- all nics' information is shown.
-**/
-VOID
-EFIAPI
-IfconfigShowNicInfo (
- IN CONST CHAR16 *Name
- )
-{
- LIST_ENTRY *Entry;
- LIST_ENTRY *NextEntry;
- NIC_INFO *NicInfo;
- UINT32 Index;
- EFI_IP4_IPCONFIG_DATA *Ip4Config;
- EFI_IPv4_ADDRESS Gateway;
- CONST CHAR16 *TempString;
-
- NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &NicInfoList) {
- NicInfo = BASE_CR (Entry, NIC_INFO, Link);
-
- TempString = (CHAR16*)NicInfo->Name;
- if ((Name != NULL) && (StringNoCaseCompare (&Name, &TempString) != 0)) {
- continue;
- }
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_NIC_NAME), gShellNetwork1HiiHandle, NicInfo->Name);
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_IFCONFIG_SHOW_MAC_ADDR),
- gShellNetwork1HiiHandle,
- (UINTN)NicInfo->NicAddress.MacAddr.Addr[0],
- (UINTN)NicInfo->NicAddress.MacAddr.Addr[1],
- (UINTN)NicInfo->NicAddress.MacAddr.Addr[2],
- (UINTN)NicInfo->NicAddress.MacAddr.Addr[3],
- (UINTN)NicInfo->NicAddress.MacAddr.Addr[4],
- (UINTN)NicInfo->NicAddress.MacAddr.Addr[5]
- );
-
- Print (L" Media State: %s\n", NicInfo->MediaPresent ? L"Media present" : L"Media disconnected");
-
- if (NicInfo->ConfigInfo == NULL) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_NIC_NOT_CONFIGURED), gShellNetwork1HiiHandle);
- continue;
- }
-
- if (NicInfo->ConfigInfo->Source == IP4_CONFIG_SOURCE_DHCP) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_CONFIG_SOURCE), gShellNetwork1HiiHandle, L"DHCP");
- } else if (NicInfo->ConfigInfo->Source == IP4_CONFIG_SOURCE_STATIC) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_CONFIG_SOURCE), gShellNetwork1HiiHandle, L"STATIC");
- } else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_CONFIG_SOURCE), gShellNetwork1HiiHandle, L"Unknown");
- }
-
- ShellPrintHiiEx(-1, -1, NULL,
- STRING_TOKEN (STR_IFCONFIG_PERMENT_STATUS),
- gShellNetwork1HiiHandle,
- (NicInfo->ConfigInfo->Perment? L"TRUE":L"FALSE")
- );
-
- Ip4Config = &NicInfo->ConfigInfo->Ip4Info;
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR),
- gShellNetwork1HiiHandle,
- L"IP address",
- (UINTN)Ip4Config->StationAddress.Addr[0],
- (UINTN)Ip4Config->StationAddress.Addr[1],
- (UINTN)Ip4Config->StationAddress.Addr[2],
- (UINTN)Ip4Config->StationAddress.Addr[3]
- );
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR),
- gShellNetwork1HiiHandle,
- L"Mask",
- (UINTN)Ip4Config->SubnetMask.Addr[0],
- (UINTN)Ip4Config->SubnetMask.Addr[1],
- (UINTN)Ip4Config->SubnetMask.Addr[2],
- (UINTN)Ip4Config->SubnetMask.Addr[3]
- );
-
- ZeroMem (&Gateway, sizeof (EFI_IPv4_ADDRESS));
-
- for (Index = 0; Index < Ip4Config->RouteTableSize; Index++) {
- if ((CompareMem (&Ip4Config->RouteTable[Index].SubnetAddress, &mZeroIp4Addr, sizeof (EFI_IPv4_ADDRESS)) == 0) &&
- (CompareMem (&Ip4Config->RouteTable[Index].SubnetMask , &mZeroIp4Addr, sizeof (EFI_IPv4_ADDRESS)) == 0) ){
- CopyMem (&Gateway, &Ip4Config->RouteTable[Index].GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
- }
- }
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR),
- gShellNetwork1HiiHandle,
- L"Gateway",
- (UINTN)Gateway.Addr[0],
- (UINTN)Gateway.Addr[1],
- (UINTN)Gateway.Addr[2],
- (UINTN)Gateway.Addr[3]
- );
-
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_ROUTES_SIZE), gShellNetwork1HiiHandle, Ip4Config->RouteTableSize);
-
- for (Index = 0; Index < Ip4Config->RouteTableSize; Index++) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_ROUTES_ENTRY_INDEX), gShellNetwork1HiiHandle, Index);
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR),
- gShellNetwork1HiiHandle,
- L"Subnet",
- (UINTN)Ip4Config->RouteTable[Index].SubnetAddress.Addr[0],
- (UINTN)Ip4Config->RouteTable[Index].SubnetAddress.Addr[1],
- (UINTN)Ip4Config->RouteTable[Index].SubnetAddress.Addr[2],
- (UINTN)Ip4Config->RouteTable[Index].SubnetAddress.Addr[3]
- );
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR),
- gShellNetwork1HiiHandle,
- L"Netmask",
- (UINTN)Ip4Config->RouteTable[Index].SubnetMask.Addr[0],
- (UINTN)Ip4Config->RouteTable[Index].SubnetMask.Addr[1],
- (UINTN)Ip4Config->RouteTable[Index].SubnetMask.Addr[2],
- (UINTN)Ip4Config->RouteTable[Index].SubnetMask.Addr[3]
- );
-
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_IFCONFIG_SHOW_IP_ADDR),
- gShellNetwork1HiiHandle,
- L"Gateway",
- (UINTN)Ip4Config->RouteTable[Index].GatewayAddress.Addr[0],
- (UINTN)Ip4Config->RouteTable[Index].GatewayAddress.Addr[1],
- (UINTN)Ip4Config->RouteTable[Index].GatewayAddress.Addr[2],
- (UINTN)Ip4Config->RouteTable[Index].GatewayAddress.Addr[3]
- );
- }
- }
-
- return ;
-}
-
-/**
- Clear address configuration for the nic specified.
-
- @param[in] Name A pointer to the string containg the nic's name,
- if NULL, all nics address configurations are cleared.
-
- @retval EFI_SUCCESS The address configuration is cleared.
- @return Some error occurs.
-**/
-EFI_STATUS
-EFIAPI
-IfconfigClearNicAddr (
- IN CONST CHAR16 *Name
- )
-{
- LIST_ENTRY *Entry;
- LIST_ENTRY *NextEntry;
- NIC_INFO *Info;
- EFI_STATUS Status;
-
- NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &NicInfoList) {
- Info = BASE_CR (Entry, NIC_INFO, Link);
-
- if ((Name != NULL) && (StrCmp (Name, Info->Name) != 0)) {
- continue;
- }
-
-// if (Info->NicIp4Config == NULL) {
- Status = IfconfigSetNicAddrByHii (Info, NULL);
-// } else {
-// Status = Info->NicIp4Config->SetInfo (Info->NicIp4Config, NULL, TRUE);
-// }
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
-
- return EFI_SUCCESS;
-
-}
-
-/**
- Function for 'ifconfig' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunIfconfig (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- BOOLEAN ListOperation;
- BOOLEAN ClearOperation;
- BOOLEAN SetOperation;
- CONST CHAR16 *Item;
- LIST_ENTRY *Entry;
- NIC_INFO *Info;
-
- InitializeListHead (&NicInfoList);
- Status = EFI_INVALID_PARAMETER;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellNetwork1HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
-
- goto Done;
- }
-
- ClearOperation = ShellCommandLineGetFlag(Package, L"-c");
- ListOperation = ShellCommandLineGetFlag(Package, L"-l");
- SetOperation = ShellCommandLineGetFlag(Package, L"-s");
-
- if ((ClearOperation && ListOperation)
- ||(SetOperation && ListOperation)
- ||(ClearOperation && SetOperation)
- ) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellNetwork1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- } else if (!ClearOperation && !ListOperation && !SetOperation) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellNetwork1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
-
-
- Status = IfconfigGetAllNicInfoByHii ();
- if (EFI_ERROR (Status)) {
- if (mIp4ConfigExist) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_IFCONFIG_GET_NIC_FAIL), gShellNetwork1HiiHandle, Status);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellNetwork1HiiHandle, L"gEfiIp4ConfigProtocolGuid", &gEfiIp4ConfigProtocolGuid);
- }
-
- return SHELL_NOT_FOUND;
- }
-
- if (ListOperation) {
- Item = ShellCommandLineGetValue (Package, L"-l");
-
- if (Item != NULL && CountSubItems(Item) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellNetwork1HiiHandle, L"-l");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
-
- //
- // Show the configuration.
- //
- IfconfigShowNicInfo (Item);
- } else if (SetOperation) {
- Item = ShellCommandLineGetValue (Package, L"-s");
-
- //
- // The correct command line arguments for setting address are:
- // IfConfig -s eth0 DHCP [perment]
- // IfConfig -s eth0 static ip netmask gateway [perment]
- //
- if (Item == NULL || (CountSubItems(Item) < 2) || (CountSubItems(Item) > 6) || (CountSubItems(Item) == 4)) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellNetwork1HiiHandle, L"-s");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
-
- ShellStatus = IfconfigSetNicAddr (CountSubItems(Item), Item);
- } else if (ClearOperation) {
- Item = ShellCommandLineGetValue (Package, L"-c");
-
- if (Item != NULL && CountSubItems(Item) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellNetwork1HiiHandle, L"-c");
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
- }
-
- IfconfigClearNicAddr (Item);
- } else {
- ASSERT(FALSE);
- }
-
-Done:
- while (!IsListEmpty (&NicInfoList)) {
- Entry = NicInfoList.ForwardLink;
- Info = BASE_CR (Entry, NIC_INFO, Link);
-
- RemoveEntryList (Entry);
-
- if (Info->ConfigInfo != NULL) {
- FreePool (Info->ConfigInfo);
- }
-
- FreePool (Info);
- }
-
- if (Package != NULL) {
- ShellCommandLineFreeVarList(Package);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
deleted file mode 100644
index fd4aa8d81e..0000000000
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
+++ /dev/null
@@ -1,1579 +0,0 @@
-/** @file
- The implementation for Ping shell command.
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellNetwork1CommandsLib.h"
-
-#define PING_IP4_COPY_ADDRESS(Dest, Src) (CopyMem ((Dest), (Src), sizeof (EFI_IPv4_ADDRESS)))
-
-UINT64 CurrentTick = 0;
-
-//
-// Function templates to match the IPv4 and IPv6 commands that we use.
-//
-typedef
-EFI_STATUS
-(EFIAPI *PING_IPX_POLL)(
- IN VOID *This
- );
-
-typedef
-EFI_STATUS
-(EFIAPI *PING_IPX_TRANSMIT)(
- IN VOID *This,
- IN VOID *Token
- );
-
-typedef
-EFI_STATUS
-(EFIAPI *PING_IPX_RECEIVE)(
- IN VOID *This,
- IN VOID *Token
- );
-
-typedef
-EFI_STATUS
-(EFIAPI *PING_IPX_CANCEL)(
- IN VOID *This,
- IN VOID *Token OPTIONAL
- );
-
-///
-/// A set of pointers to either IPv6 or IPv4 functions.
-/// Unknown which one to the ping command.
-///
-typedef struct {
- PING_IPX_TRANSMIT Transmit;
- PING_IPX_RECEIVE Receive;
- PING_IPX_CANCEL Cancel;
- PING_IPX_POLL Poll;
-}PING_IPX_PROTOCOL;
-
-
-typedef union {
- VOID *RxData;
- VOID *TxData;
-} PING_PACKET;
-
-//
-// PING_IPX_COMPLETION_TOKEN
-// structures are used for both transmit and receive operations.
-// This version is IP-unaware.
-//
-typedef struct {
- EFI_EVENT Event;
- EFI_STATUS Status;
- PING_PACKET Packet;
-} PING_IPX_COMPLETION_TOKEN;
-
-#pragma pack(1)
-typedef struct _ICMPX_ECHO_REQUEST_REPLY {
- UINT8 Type;
- UINT8 Code;
- UINT16 Checksum;
- UINT16 Identifier;
- UINT16 SequenceNum;
- UINT64 TimeStamp;
- UINT8 Data[1];
-} ICMPX_ECHO_REQUEST_REPLY;
-#pragma pack()
-
-typedef struct _PING_ICMP_TX_INFO {
- LIST_ENTRY Link;
- UINT16 SequenceNum;
- UINT64 TimeStamp;
- PING_IPX_COMPLETION_TOKEN *Token;
-} PING_ICMPX_TX_INFO;
-
-#define DEFAULT_TIMEOUT 5000
-#define MAX_SEND_NUMBER 10000
-#define MAX_BUFFER_SIZE 32768
-#define DEFAULT_TIMER_PERIOD 358049
-#define ONE_SECOND 10000000
-#define PING_IP_CHOICE_IP4 1
-#define PING_IP_CHOICE_IP6 2
-#define DEFAULT_SEND_COUNT 10
-#define DEFAULT_BUFFER_SIZE 16
-#define ICMP_V4_ECHO_REQUEST 0x8
-#define ICMP_V4_ECHO_REPLY 0x0
-
-#define PING_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'i', 'n', 'g')
-typedef struct _PING_PRIVATE_DATA {
- UINT32 Signature;
- EFI_HANDLE NicHandle;
- EFI_HANDLE IpChildHandle;
- EFI_EVENT Timer;
-
- EFI_STATUS Status;
- LIST_ENTRY TxList;
- UINT16 RxCount;
- UINT16 TxCount;
- UINT64 RttSum;
- UINT64 RttMin;
- UINT64 RttMax;
- UINT32 SequenceNum;
-
- UINT32 SendNum;
- UINT32 BufferSize;
- UINT32 IpChoice;
-
- PING_IPX_PROTOCOL ProtocolPointers;
- VOID *IpProtocol;
- UINT8 SrcAddress[MAX(sizeof(EFI_IPv6_ADDRESS) , sizeof(EFI_IPv4_ADDRESS) )];
- UINT8 DstAddress[MAX(sizeof(EFI_IPv6_ADDRESS) , sizeof(EFI_IPv4_ADDRESS) )];
- PING_IPX_COMPLETION_TOKEN RxToken;
-} PING_PRIVATE_DATA;
-
-/**
- Calculate the internet checksum (see RFC 1071).
-
- @param[in] Packet Buffer which contains the data to be checksummed.
- @param[in] Length Length to be checksummed.
-
- @retval Checksum Returns the 16 bit ones complement of
- ones complement sum of 16 bit words
-**/
-UINT16
-EFIAPI
-NetChecksum (
- IN UINT8 *Buffer,
- IN UINT32 Length
- )
-{
- UINT32 Sum;
- UINT8 Odd;
- UINT16 *Packet;
-
- Packet = (UINT16 *) Buffer;
-
- Sum = 0;
- Odd = (UINT8) (Length & 1);
- Length >>= 1;
- while ((Length--) != 0) {
- Sum += *Packet++;
- }
-
- if (Odd != 0) {
- Sum += *(UINT8 *) Packet;
- }
-
- Sum = (Sum & 0xffff) + (Sum >> 16);
-
- //
- // in case above carried
- //
- Sum += Sum >> 16;
-
- return (UINT16) Sum;
-}
-
-/**
- Reads and returns the current value of register.
- In IA64, the register is the Interval Timer Vector (ITV).
- In X86(IA32/X64), the register is the Time Stamp Counter (TSC)
-
- @return The current value of the register.
-
-**/
-
-STATIC CONST SHELL_PARAM_ITEM PingParamList[] = {
- {
- L"-l",
- TypeValue
- },
- {
- L"-n",
- TypeValue
- },
- {
- L"-_s",
- TypeValue
- },
- {
- L"-_ip6",
- TypeFlag
- },
- {
- NULL,
- TypeMax
- },
-};
-
-//
-// Global Variables in Ping command.
-//
-STATIC CONST CHAR16 *mDstString;
-STATIC CONST CHAR16 *mSrcString;
-STATIC UINT64 mFrequency = 0;
-EFI_CPU_ARCH_PROTOCOL *gCpu = NULL;
-
-/**
- Read the current time.
-
- @retval the current tick value.
-**/
-UINT64
-EFIAPI
-ReadTime (
- VOID
- )
-{
- UINT64 TimerPeriod;
- EFI_STATUS Status;
-
- ASSERT (gCpu != NULL);
-
- Status = gCpu->GetTimerValue (gCpu, 0, &CurrentTick, &TimerPeriod);
- if (EFI_ERROR (Status)) {
- //
- // The WinntGetTimerValue will return EFI_UNSUPPORTED. Set the
- // TimerPeriod by ourselves.
- //
- CurrentTick += 1000000;
- }
-
- return CurrentTick;
-}
-
-
-/**
- Get and caculate the frequency in tick/ms.
- The result is saved in the globle variable mFrequency
-
- @retval EFI_SUCCESS Caculated the frequency successfully.
- @retval Others Failed to caculate the frequency.
-
-**/
-EFI_STATUS
-EFIAPI
-GetFrequency (
- VOID
- )
-{
- EFI_STATUS Status;
- UINT64 CurrentTick;
- UINT64 TimerPeriod;
-
- Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **) &gCpu);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = gCpu->GetTimerValue (gCpu, 0, &CurrentTick, &TimerPeriod);
-
- if (EFI_ERROR (Status)) {
- TimerPeriod = DEFAULT_TIMER_PERIOD;
- }
-
- //
- // The timer period is in femtosecond (1 femtosecond is 1e-15 second).
- // So 1e+12 is divided by timer period to produce the freq in tick/ms.
- //
- mFrequency = DivU64x64Remainder (1000000000000ULL, TimerPeriod, NULL);
-
- return EFI_SUCCESS;
-}
-
-/**
- Caculate a duration in ms.
-
- @param[in] Begin The start point of time.
- @param[in] End The end point of time.
-
- @return The duration in ms.
- @retval 0 The parameters were not valid.
-**/
-UINT64
-EFIAPI
-CalculateTick (
- IN UINT64 Begin,
- IN UINT64 End
- )
-{
- if (End <= Begin) {
- return (0);
- }
- return DivU64x64Remainder (End - Begin, mFrequency, NULL);
-}
-
-/**
- Destroy PING_ICMPX_TX_INFO, and recollect the memory.
-
- @param[in] TxInfo The pointer to PING_ICMPX_TX_INFO.
- @param[in] IpChoice Whether the token is IPv4 or IPv6
-**/
-VOID
-EFIAPI
-PingDestroyTxInfo (
- IN PING_ICMPX_TX_INFO *TxInfo,
- IN UINT32 IpChoice
- )
-{
- EFI_IP6_TRANSMIT_DATA *Ip6TxData;
- EFI_IP4_TRANSMIT_DATA *Ip4TxData;
- EFI_IP6_FRAGMENT_DATA *FragData;
- UINTN Index;
-
- if (TxInfo == NULL) {
- return;
- }
-
- if (TxInfo->Token != NULL) {
-
- if (TxInfo->Token->Event != NULL) {
- gBS->CloseEvent (TxInfo->Token->Event);
- }
-
- if (TxInfo->Token->Packet.TxData != NULL) {
- if (IpChoice == PING_IP_CHOICE_IP6) {
- Ip6TxData = TxInfo->Token->Packet.TxData;
-
- if (Ip6TxData->OverrideData != NULL) {
- FreePool (Ip6TxData->OverrideData);
- }
-
- if (Ip6TxData->ExtHdrs != NULL) {
- FreePool (Ip6TxData->ExtHdrs);
- }
-
- for (Index = 0; Index < Ip6TxData->FragmentCount; Index++) {
- FragData = Ip6TxData->FragmentTable[Index].FragmentBuffer;
- if (FragData != NULL) {
- FreePool (FragData);
- }
- }
- } else {
- Ip4TxData = TxInfo->Token->Packet.TxData;
-
- if (Ip4TxData->OverrideData != NULL) {
- FreePool (Ip4TxData->OverrideData);
- }
-
- for (Index = 0; Index < Ip4TxData->FragmentCount; Index++) {
- FragData = Ip4TxData->FragmentTable[Index].FragmentBuffer;
- if (FragData != NULL) {
- FreePool (FragData);
- }
- }
- }
- }
-
- FreePool (TxInfo->Token);
- }
-
- FreePool (TxInfo);
-}
-
-/**
- Match the request, and reply with SequenceNum/TimeStamp.
-
- @param[in] Private The pointer to PING_PRIVATE_DATA.
- @param[in] Packet The pointer to ICMPX_ECHO_REQUEST_REPLY.
-
- @retval EFI_SUCCESS The match is successful.
- @retval EFI_NOT_FOUND The reply can't be matched with any request.
-
-**/
-EFI_STATUS
-EFIAPI
-Ping6MatchEchoReply (
- IN PING_PRIVATE_DATA *Private,
- IN ICMPX_ECHO_REQUEST_REPLY *Packet
- )
-{
- PING_ICMPX_TX_INFO *TxInfo;
- LIST_ENTRY *Entry;
- LIST_ENTRY *NextEntry;
-
- NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->TxList) {
- TxInfo = BASE_CR (Entry, PING_ICMPX_TX_INFO, Link);
-
- if ((TxInfo->SequenceNum == Packet->SequenceNum) && (TxInfo->TimeStamp == Packet->TimeStamp)) {
- Private->RxCount++;
- RemoveEntryList (&TxInfo->Link);
- PingDestroyTxInfo (TxInfo, Private->IpChoice);
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-/**
- The original intention is to send a request.
- Currently, the application retransmits an icmp6 echo request packet
- per second in sendnumber times that is specified by the user.
- Because nothing can be done here, all things move to the timer rountine.
-
- @param[in] Event A EFI_EVENT type event.
- @param[in] Context The pointer to Context.
-
-**/
-VOID
-EFIAPI
-Ping6OnEchoRequestSent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
-}
-
-/**
- receive reply, match and print reply infomation.
-
- @param[in] Event A EFI_EVENT type event.
- @param[in] Context The pointer to context.
-
-**/
-VOID
-EFIAPI
-Ping6OnEchoReplyReceived (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- EFI_STATUS Status;
- PING_PRIVATE_DATA *Private;
- ICMPX_ECHO_REQUEST_REPLY *Reply;
- UINT32 PayLoad;
- UINT64 Rtt;
- CHAR8 Near;
-
- Private = (PING_PRIVATE_DATA *) Context;
-
- if (Private == NULL || Private->Status == EFI_ABORTED || Private->Signature != PING_PRIVATE_DATA_SIGNATURE) {
- return;
- }
-
- if (Private->RxToken.Packet.RxData == NULL) {
- return;
- }
-
- if (Private->IpChoice == PING_IP_CHOICE_IP6) {
- Reply = ((EFI_IP6_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->FragmentTable[0].FragmentBuffer;
- PayLoad = ((EFI_IP6_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->DataLength;
- if (((EFI_IP6_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->Header->NextHeader != IP6_ICMP) {
- goto ON_EXIT;
- }
- if (!IP6_IS_MULTICAST ((EFI_IPv6_ADDRESS*)&Private->DstAddress) &&
- !EFI_IP6_EQUAL (&((EFI_IP6_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->Header->SourceAddress, (EFI_IPv6_ADDRESS*)&Private->DstAddress)) {
- goto ON_EXIT;
- }
-
- if ((Reply->Type != ICMP_V6_ECHO_REPLY) || (Reply->Code != 0)) {
- goto ON_EXIT;
- }
- } else {
- Reply = ((EFI_IP4_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->FragmentTable[0].FragmentBuffer;
- PayLoad = ((EFI_IP4_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->DataLength;
- if (!IP4_IS_MULTICAST (EFI_IP4(*(EFI_IPv4_ADDRESS*)Private->DstAddress)) &&
- !EFI_IP4_EQUAL (&((EFI_IP4_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->Header->SourceAddress, (EFI_IPv4_ADDRESS*)&Private->DstAddress)) {
- goto ON_EXIT;
- }
-
- if ((Reply->Type != ICMP_V4_ECHO_REPLY) || (Reply->Code != 0)) {
- goto ON_EXIT;
- }
- }
-
-
- if (PayLoad != Private->BufferSize) {
- goto ON_EXIT;
- }
- //
- // Check whether the reply matches the sent request before.
- //
- Status = Ping6MatchEchoReply (Private, Reply);
- if (EFI_ERROR(Status)) {
- goto ON_EXIT;
- }
- //
- // Display statistics on this icmp6 echo reply packet.
- //
- Rtt = CalculateTick (Reply->TimeStamp, ReadTime ());
- if (Rtt != 0) {
- Near = (CHAR8) '=';
- } else {
- Near = (CHAR8) '<';
- }
-
- Private->RttSum += Rtt;
- Private->RttMin = Private->RttMin > Rtt ? Rtt : Private->RttMin;
- Private->RttMax = Private->RttMax < Rtt ? Rtt : Private->RttMax;
-
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_PING_REPLY_INFO),
- gShellNetwork1HiiHandle,
- PayLoad,
- mDstString,
- Reply->SequenceNum,
- Private->IpChoice == PING_IP_CHOICE_IP6?((EFI_IP6_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->Header->HopLimit:0,
- Near,
- Rtt
- );
-
-ON_EXIT:
-
- if (Private->RxCount < Private->SendNum) {
- //
- // Continue to receive icmp echo reply packets.
- //
- Private->RxToken.Status = EFI_ABORTED;
-
- Status = Private->ProtocolPointers.Receive (Private->IpProtocol, &Private->RxToken);
-
- if (EFI_ERROR (Status)) {
- Private->Status = EFI_ABORTED;
- }
- } else {
- //
- // All reply have already been received from the dest host.
- //
- Private->Status = EFI_SUCCESS;
- }
- //
- // Singal to recycle the each rxdata here, not at the end of process.
- //
- gBS->SignalEvent (Private->IpChoice == PING_IP_CHOICE_IP6?((EFI_IP6_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->RecycleSignal:((EFI_IP4_RECEIVE_DATA*)Private->RxToken.Packet.RxData)->RecycleSignal);
-}
-
-/**
- Create a PING_IPX_COMPLETION_TOKEN.
-
- @param[in] Private The pointer of PING_PRIVATE_DATA.
- @param[in] TimeStamp The TimeStamp of request.
- @param[in] SequenceNum The SequenceNum of request.
-
- @return The pointer of PING_IPX_COMPLETION_TOKEN.
-
-**/
-PING_IPX_COMPLETION_TOKEN *
-EFIAPI
-PingGenerateToken (
- IN PING_PRIVATE_DATA *Private,
- IN UINT64 TimeStamp,
- IN UINT16 SequenceNum
- )
-{
- EFI_STATUS Status;
- PING_IPX_COMPLETION_TOKEN *Token;
- VOID *TxData;
- ICMPX_ECHO_REQUEST_REPLY *Request;
- UINT16 HeadSum;
- UINT16 TempChecksum;
-
- Request = AllocateZeroPool (Private->BufferSize);
- if (Request == NULL) {
- return NULL;
- }
- TxData = AllocateZeroPool (Private->IpChoice==PING_IP_CHOICE_IP6?sizeof (EFI_IP6_TRANSMIT_DATA):sizeof (EFI_IP4_TRANSMIT_DATA));
- if (TxData == NULL) {
- FreePool (Request);
- return NULL;
- }
- Token = AllocateZeroPool (sizeof (PING_IPX_COMPLETION_TOKEN));
- if (Token == NULL) {
- FreePool (Request);
- FreePool (TxData);
- return NULL;
- }
-
- //
- // Assembly echo request packet.
- //
- Request->Type = (UINT8)(Private->IpChoice==PING_IP_CHOICE_IP6?ICMP_V6_ECHO_REQUEST:ICMP_V4_ECHO_REQUEST);
- Request->Code = 0;
- Request->SequenceNum = SequenceNum;
- Request->Identifier = 0;
- Request->Checksum = 0;
-
- //
- // Assembly token for transmit.
- //
- if (Private->IpChoice==PING_IP_CHOICE_IP6) {
- ((EFI_IP6_TRANSMIT_DATA*)TxData)->ExtHdrsLength = 0;
- ((EFI_IP6_TRANSMIT_DATA*)TxData)->ExtHdrs = NULL;
- ((EFI_IP6_TRANSMIT_DATA*)TxData)->OverrideData = 0;
- ((EFI_IP6_TRANSMIT_DATA*)TxData)->DataLength = Private->BufferSize;
- ((EFI_IP6_TRANSMIT_DATA*)TxData)->FragmentCount = 1;
- ((EFI_IP6_TRANSMIT_DATA*)TxData)->FragmentTable[0].FragmentBuffer = (VOID *) Request;
- ((EFI_IP6_TRANSMIT_DATA*)TxData)->FragmentTable[0].FragmentLength = Private->BufferSize;
- } else {
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->OptionsLength = 0;
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->OptionsBuffer = NULL;
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->OverrideData = 0;
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->TotalDataLength = Private->BufferSize;
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->FragmentCount = 1;
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->FragmentTable[0].FragmentBuffer = (VOID *) Request;
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->FragmentTable[0].FragmentLength = Private->BufferSize;
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->DestinationAddress.Addr[0] = Private->DstAddress[0];
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->DestinationAddress.Addr[1] = Private->DstAddress[1];
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->DestinationAddress.Addr[2] = Private->DstAddress[2];
- ((EFI_IP4_TRANSMIT_DATA*)TxData)->DestinationAddress.Addr[3] = Private->DstAddress[3];
-
- HeadSum = NetChecksum ((UINT8 *) Request, Private->BufferSize);
- Request->TimeStamp = TimeStamp;
- TempChecksum = NetChecksum ((UINT8 *) &Request->TimeStamp, sizeof (UINT64));
- Request->Checksum = (UINT16)(~NetAddChecksum (HeadSum, TempChecksum));
- }
-
-
- Token->Status = EFI_ABORTED;
- Token->Packet.TxData = TxData;
-
- Status = gBS->CreateEvent (
- EVT_NOTIFY_SIGNAL,
- TPL_CALLBACK,
- Ping6OnEchoRequestSent,
- Private,
- &Token->Event
- );
-
- if (EFI_ERROR (Status)) {
- FreePool (Request);
- FreePool (TxData);
- FreePool (Token);
- return NULL;
- }
-
- return Token;
-}
-
-/**
- Transmit the PING_IPX_COMPLETION_TOKEN.
-
- @param[in] Private The pointer of PING_PRIVATE_DATA.
-
- @retval EFI_SUCCESS Transmitted successfully.
- @retval EFI_OUT_OF_RESOURCES No memory is available on the platform.
- @retval others Transmitted unsuccessfully.
-
-**/
-EFI_STATUS
-EFIAPI
-PingSendEchoRequest (
- IN PING_PRIVATE_DATA *Private
- )
-{
- EFI_STATUS Status;
- PING_ICMPX_TX_INFO *TxInfo;
-
- TxInfo = AllocateZeroPool (sizeof (PING_ICMPX_TX_INFO));
-
- if (TxInfo == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- TxInfo->TimeStamp = ReadTime ();
- TxInfo->SequenceNum = (UINT16) (Private->TxCount + 1);
- TxInfo->Token = PingGenerateToken (
- Private,
- TxInfo->TimeStamp,
- TxInfo->SequenceNum
- );
-
- if (TxInfo->Token == NULL) {
- PingDestroyTxInfo (TxInfo, Private->IpChoice);
- return EFI_OUT_OF_RESOURCES;
- }
-
- ASSERT(Private->ProtocolPointers.Transmit != NULL);
- Status = Private->ProtocolPointers.Transmit (Private->IpProtocol, TxInfo->Token);
-
- if (EFI_ERROR (Status)) {
- PingDestroyTxInfo (TxInfo, Private->IpChoice);
- return Status;
- }
-
- InsertTailList (&Private->TxList, &TxInfo->Link);
- Private->TxCount++;
-
- return EFI_SUCCESS;
-}
-
-/**
- Place a completion token into the receive packet queue to receive the echo reply.
-
- @param[in] Private The pointer of PING_PRIVATE_DATA.
-
- @retval EFI_SUCCESS Put the token into the receive packet queue successfully.
- @retval others Put the token into the receive packet queue unsuccessfully.
-
-**/
-EFI_STATUS
-EFIAPI
-Ping6ReceiveEchoReply (
- IN PING_PRIVATE_DATA *Private
- )
-{
- EFI_STATUS Status;
-
- ZeroMem (&Private->RxToken, sizeof (PING_IPX_COMPLETION_TOKEN));
-
- Status = gBS->CreateEvent (
- EVT_NOTIFY_SIGNAL,
- TPL_CALLBACK,
- Ping6OnEchoReplyReceived,
- Private,
- &Private->RxToken.Event
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Private->RxToken.Status = EFI_NOT_READY;
-
- return (Private->ProtocolPointers.Receive (Private->IpProtocol, &Private->RxToken));
-}
-
-/**
- Remove the timeout request from the list.
-
- @param[in] Event A EFI_EVENT type event.
- @param[in] Context The pointer to Context.
-
-**/
-VOID
-EFIAPI
-Ping6OnTimerRoutine (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- EFI_STATUS Status;
- PING_PRIVATE_DATA *Private;
- PING_ICMPX_TX_INFO *TxInfo;
- LIST_ENTRY *Entry;
- LIST_ENTRY *NextEntry;
- UINT64 Time;
-
- Private = (PING_PRIVATE_DATA *) Context;
- if (Private->Signature != PING_PRIVATE_DATA_SIGNATURE) {
- Private->Status = EFI_NOT_FOUND;
- return;
- }
-
- //
- // Retransmit icmp6 echo request packets per second in sendnumber times.
- //
- if (Private->TxCount < Private->SendNum) {
-
- Status = PingSendEchoRequest (Private);
- if (Private->TxCount != 0){
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_SEND_REQUEST), gShellNetwork1HiiHandle, Private->TxCount + 1);
- }
- }
- }
- //
- // Check whether any icmp6 echo request in the list timeout.
- //
- NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->TxList) {
- TxInfo = BASE_CR (Entry, PING_ICMPX_TX_INFO, Link);
- Time = CalculateTick (TxInfo->TimeStamp, ReadTime ());
-
- //
- // Remove the timeout echo request from txlist.
- //
- if (Time > DEFAULT_TIMEOUT) {
-
- if (EFI_ERROR (TxInfo->Token->Status)) {
- Private->ProtocolPointers.Cancel (Private->IpProtocol, TxInfo->Token);
- }
- //
- // Remove the timeout icmp6 echo request from list.
- //
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_TIMEOUT), gShellNetwork1HiiHandle, TxInfo->SequenceNum);
-
- RemoveEntryList (&TxInfo->Link);
- PingDestroyTxInfo (TxInfo, Private->IpChoice);
-
- //
- // We dont need to wait for this some other time...
- //
- Private->RxCount++;
-
- if (IsListEmpty (&Private->TxList) && (Private->TxCount == Private->SendNum)) {
- //
- // All the left icmp6 echo request in the list timeout.
- //
- Private->Status = EFI_TIMEOUT;
- }
- }
- }
-}
-
-/**
- Determine if a IP4 address is Link Local.
-
- 169.254.1.0 through 169.254.254.255 is link local.
-
- @param[in] Address The address to test.
-
- @retval TRUE It is.
- @retval FALSE It is not.
-**/
-BOOLEAN
-EFIAPI
-PingNetIp4IsLinkLocalAddr (
- IN CONST EFI_IPv4_ADDRESS *Address
- )
-{
- return ((BOOLEAN)(Address->Addr[0] == 169 && Address->Addr[1] == 254 && Address->Addr[2] >= 1 && Address->Addr[2] <= 254));
-}
-
-/**
- Determine if a IP4 address is unspecified.
-
- @param[in] Address The address to test.
-
- @retval TRUE It is.
- @retval FALSE It is not.
-**/
-BOOLEAN
-EFIAPI
-PingNetIp4IsUnspecifiedAddr (
- IN CONST EFI_IPv4_ADDRESS *Address
- )
-{
- return ((BOOLEAN)((ReadUnaligned32 ((UINT32*)&Address->Addr[0])) == 0x00000000));
-}
-
-/**
- Create a valid IP instance.
-
- @param[in] Private The pointer of PING_PRIVATE_DATA.
-
- @retval EFI_SUCCESS Create a valid IPx instance successfully.
- @retval EFI_ABORTED Locate handle with ipx service binding protocol unsuccessfully.
- @retval EFI_INVALID_PARAMETER The source address is unspecified when the destination address is a link-local address.
- @retval EFI_OUT_OF_RESOURCES No memory is available on the platform.
- @retval EFI_NOT_FOUND The source address is not found.
-**/
-EFI_STATUS
-EFIAPI
-PingCreateIpInstance (
- IN PING_PRIVATE_DATA *Private
- )
-{
- EFI_STATUS Status;
- UINTN HandleIndex;
- UINTN HandleNum;
- EFI_HANDLE *HandleBuffer;
- EFI_SERVICE_BINDING_PROTOCOL *EfiSb;
- VOID *IpXCfg;
- EFI_IP6_CONFIG_DATA Ip6Config;
- EFI_IP4_CONFIG_DATA Ip4Config;
- VOID *IpXInterfaceInfo;
- UINTN IfInfoSize;
- EFI_IPv6_ADDRESS *Addr;
- UINTN AddrIndex;
-
- HandleBuffer = NULL;
- EfiSb = NULL;
- IpXInterfaceInfo = NULL;
- IfInfoSize = 0;
-
- //
- // Locate all the handles with ip6 service binding protocol.
- //
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- Private->IpChoice == PING_IP_CHOICE_IP6?&gEfiIp6ServiceBindingProtocolGuid:&gEfiIp4ServiceBindingProtocolGuid,
- NULL,
- &HandleNum,
- &HandleBuffer
- );
- if (EFI_ERROR (Status) || (HandleNum == 0) || (HandleBuffer == NULL)) {
- return EFI_ABORTED;
- }
- //
- // Source address is required when pinging a link-local address on multi-
- // interfaces host.
- //
- if (Private->IpChoice == PING_IP_CHOICE_IP6) {
- if (NetIp6IsLinkLocalAddr ((EFI_IPv6_ADDRESS*)&Private->DstAddress) &&
- NetIp6IsUnspecifiedAddr ((EFI_IPv6_ADDRESS*)&Private->SrcAddress) &&
- (HandleNum > 1)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellNetwork1HiiHandle, mSrcString);
- Status = EFI_INVALID_PARAMETER;
- goto ON_ERROR;
- }
- } else {
- ASSERT(Private->IpChoice == PING_IP_CHOICE_IP4);
- if (PingNetIp4IsLinkLocalAddr ((EFI_IPv4_ADDRESS*)&Private->DstAddress) &&
- PingNetIp4IsUnspecifiedAddr ((EFI_IPv4_ADDRESS*)&Private->SrcAddress) &&
- (HandleNum > 1)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellNetwork1HiiHandle, mSrcString);
- Status = EFI_INVALID_PARAMETER;
- goto ON_ERROR;
- }
- }
- //
- // For each ip6 protocol, check interface addresses list.
- //
- for (HandleIndex = 0; HandleIndex < HandleNum; HandleIndex++) {
-
- EfiSb = NULL;
- IpXInterfaceInfo = NULL;
- IfInfoSize = 0;
-
- Status = gBS->HandleProtocol (
- HandleBuffer[HandleIndex],
- Private->IpChoice == PING_IP_CHOICE_IP6?&gEfiIp6ServiceBindingProtocolGuid:&gEfiIp4ServiceBindingProtocolGuid,
- (VOID **) &EfiSb
- );
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
-
- if (Private->IpChoice == PING_IP_CHOICE_IP6?NetIp6IsUnspecifiedAddr ((EFI_IPv6_ADDRESS*)&Private->SrcAddress):PingNetIp4IsUnspecifiedAddr ((EFI_IPv4_ADDRESS*)&Private->SrcAddress)) {
- //
- // No need to match interface address.
- //
- break;
- } else {
- //
- // Ip6config protocol and ip6 service binding protocol are installed
- // on the same handle.
- //
- Status = gBS->HandleProtocol (
- HandleBuffer[HandleIndex],
- Private->IpChoice == PING_IP_CHOICE_IP6?&gEfiIp6ConfigProtocolGuid:&gEfiIp4ConfigProtocolGuid,
- (VOID **) &IpXCfg
- );
-
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
- //
- // Get the interface information size.
- //
- if (Private->IpChoice == PING_IP_CHOICE_IP6) {
- Status = ((EFI_IP6_CONFIG_PROTOCOL*)IpXCfg)->GetData (
- IpXCfg,
- Ip6ConfigDataTypeInterfaceInfo,
- &IfInfoSize,
- NULL
- );
- } else {
- Status = ((EFI_IP4_CONFIG_PROTOCOL*)IpXCfg)->GetData (
- IpXCfg,
- &IfInfoSize,
- NULL
- );
- }
-
- //
- // Skip the ones not in current use.
- //
- if (Status == EFI_NOT_STARTED) {
- continue;
- }
-
- if (Status != EFI_BUFFER_TOO_SMALL) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_GETDATA), gShellNetwork1HiiHandle, Status);
- goto ON_ERROR;
- }
-
- IpXInterfaceInfo = AllocateZeroPool (IfInfoSize);
-
- if (IpXInterfaceInfo == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto ON_ERROR;
- }
- //
- // Get the interface info.
- //
- if (Private->IpChoice == PING_IP_CHOICE_IP6) {
- Status = ((EFI_IP6_CONFIG_PROTOCOL*)IpXCfg)->GetData (
- IpXCfg,
- Ip6ConfigDataTypeInterfaceInfo,
- &IfInfoSize,
- IpXInterfaceInfo
- );
- } else {
- Status = ((EFI_IP4_CONFIG_PROTOCOL*)IpXCfg)->GetData (
- IpXCfg,
- &IfInfoSize,
- IpXInterfaceInfo
- );
- }
-
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_GETDATA), gShellNetwork1HiiHandle, Status);
- goto ON_ERROR;
- }
- //
- // Check whether the source address is one of the interface addresses.
- //
- if (Private->IpChoice == PING_IP_CHOICE_IP6) {
- for (AddrIndex = 0; AddrIndex < ((EFI_IP6_CONFIG_INTERFACE_INFO*)IpXInterfaceInfo)->AddressInfoCount; AddrIndex++) {
-
- Addr = &(((EFI_IP6_CONFIG_INTERFACE_INFO*)IpXInterfaceInfo)->AddressInfo[AddrIndex].Address);
- if (EFI_IP6_EQUAL (&Private->SrcAddress, Addr)) {
- //
- // Match a certain interface address.
- //
- break;
- }
- }
-
- if (AddrIndex < ((EFI_IP6_CONFIG_INTERFACE_INFO*)IpXInterfaceInfo)->AddressInfoCount) {
- //
- // Found a nic handle with right interface address.
- //
- break;
- }
- } else {
- //
- // IP4 address check
- //
- if (EFI_IP4_EQUAL (&Private->SrcAddress, &((EFI_IP4_IPCONFIG_DATA*)IpXInterfaceInfo)->StationAddress)) {
- //
- // Match a certain interface address.
- //
- break;
- }
- }
- }
-
- FreePool (IpXInterfaceInfo);
- IpXInterfaceInfo = NULL;
- }
- //
- // No exact interface address matched.
- //
-
- if (HandleIndex == HandleNum) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellNetwork1HiiHandle, mSrcString);
- Status = EFI_NOT_FOUND;
- goto ON_ERROR;
- }
-
- Private->NicHandle = HandleBuffer[HandleIndex];
-
- ASSERT (EfiSb != NULL);
- Status = EfiSb->CreateChild (EfiSb, &Private->IpChildHandle);
-
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
- if (Private->IpChoice == PING_IP_CHOICE_IP6) {
- Status = gBS->OpenProtocol (
- Private->IpChildHandle,
- &gEfiIp6ProtocolGuid,
- &Private->IpProtocol,
- gImageHandle,
- Private->IpChildHandle,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
-
-
- ZeroMem (&Ip6Config, sizeof (EFI_IP6_CONFIG_DATA));
-
- //
- // Configure the ip6 instance for icmp6 packet exchange.
- //
- Ip6Config.DefaultProtocol = 58;
- Ip6Config.AcceptAnyProtocol = FALSE;
- Ip6Config.AcceptIcmpErrors = TRUE;
- Ip6Config.AcceptPromiscuous = FALSE;
- Ip6Config.TrafficClass = 0;
- Ip6Config.HopLimit = 128;
- Ip6Config.FlowLabel = 0;
- Ip6Config.ReceiveTimeout = 0;
- Ip6Config.TransmitTimeout = 0;
-
- IP6_COPY_ADDRESS (&Ip6Config.StationAddress, &Private->SrcAddress);
- IP6_COPY_ADDRESS (&Ip6Config.DestinationAddress, &Private->DstAddress);
-
- Status = ((EFI_IP6_PROTOCOL*)(Private->IpProtocol))->Configure (Private->IpProtocol, &Ip6Config);
-
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_CONFIG), gShellNetwork1HiiHandle, Status);
- goto ON_ERROR;
- }
-
- Private->ProtocolPointers.Transmit = (PING_IPX_TRANSMIT )((EFI_IP6_PROTOCOL*)Private->IpProtocol)->Transmit;
- Private->ProtocolPointers.Receive = (PING_IPX_RECEIVE )((EFI_IP6_PROTOCOL*)Private->IpProtocol)->Receive;
- Private->ProtocolPointers.Cancel = (PING_IPX_CANCEL )((EFI_IP6_PROTOCOL*)Private->IpProtocol)->Cancel;
- Private->ProtocolPointers.Poll = (PING_IPX_POLL )((EFI_IP6_PROTOCOL*)Private->IpProtocol)->Poll;
- } else {
- Status = gBS->OpenProtocol (
- Private->IpChildHandle,
- &gEfiIp4ProtocolGuid,
- &Private->IpProtocol,
- gImageHandle,
- Private->IpChildHandle,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
-
-
- ZeroMem (&Ip4Config, sizeof (EFI_IP4_CONFIG_DATA));
-
- //
- // Configure the ip4 instance for icmp4 packet exchange.
- //
-// PING_IP4_COPY_ADDRESS (&Ip4Config.StationAddress, &Private->SrcAddress);
-// Ip4Config.SubnetMask.Addr[0] = 0xFF;
-// Ip4Config.SubnetMask.Addr[1] = 0xFF;
-// Ip4Config.SubnetMask.Addr[2] = 0xFF;
-// Ip4Config.SubnetMask.Addr[3] = 0x00;
- Ip4Config.DefaultProtocol = 1;
- Ip4Config.AcceptAnyProtocol = FALSE;
- Ip4Config.AcceptBroadcast = FALSE;
- Ip4Config.AcceptIcmpErrors = TRUE;
- Ip4Config.AcceptPromiscuous = FALSE;
- Ip4Config.DoNotFragment = FALSE;
- Ip4Config.RawData = FALSE;
- Ip4Config.ReceiveTimeout = 0;
- Ip4Config.TransmitTimeout = 0;
- Ip4Config.UseDefaultAddress = TRUE;
- Ip4Config.TimeToLive = 128;
- Ip4Config.TypeOfService = 0;
-
- Status = ((EFI_IP4_PROTOCOL*)(Private->IpProtocol))->Configure (Private->IpProtocol, &Ip4Config);
-
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_CONFIG), gShellNetwork1HiiHandle, Status);
- goto ON_ERROR;
- }
-
- Private->ProtocolPointers.Transmit = (PING_IPX_TRANSMIT )((EFI_IP4_PROTOCOL*)Private->IpProtocol)->Transmit;
- Private->ProtocolPointers.Receive = (PING_IPX_RECEIVE )((EFI_IP4_PROTOCOL*)Private->IpProtocol)->Receive;
- Private->ProtocolPointers.Cancel = (PING_IPX_CANCEL )((EFI_IP4_PROTOCOL*)Private->IpProtocol)->Cancel;
- Private->ProtocolPointers.Poll = (PING_IPX_POLL )((EFI_IP4_PROTOCOL*)Private->IpProtocol)->Poll;
- }
-
- if (HandleBuffer != NULL) {
- FreePool (HandleBuffer);
- }
-
- return EFI_SUCCESS;
-
-ON_ERROR:
- if (HandleBuffer != NULL) {
- FreePool (HandleBuffer);
- }
-
- if (IpXInterfaceInfo != NULL) {
- FreePool (IpXInterfaceInfo);
- }
-
- if ((EfiSb != NULL) && (Private->IpChildHandle != NULL)) {
- EfiSb->DestroyChild (EfiSb, Private->IpChildHandle);
- }
-
- return Status;
-}
-
-/**
- Destroy the IP instance.
-
- @param[in] Private The pointer of PING_PRIVATE_DATA.
-
-**/
-VOID
-EFIAPI
-Ping6DestroyIp6Instance (
- IN PING_PRIVATE_DATA *Private
- )
-{
- EFI_STATUS Status;
- EFI_SERVICE_BINDING_PROTOCOL *IpSb;
-
- gBS->CloseProtocol (
- Private->IpChildHandle,
- Private->IpChoice == PING_IP_CHOICE_IP6?&gEfiIp6ProtocolGuid:&gEfiIp4ProtocolGuid,
- gImageHandle,
- Private->IpChildHandle
- );
-
- Status = gBS->HandleProtocol (
- Private->NicHandle,
- Private->IpChoice == PING_IP_CHOICE_IP6?&gEfiIp6ServiceBindingProtocolGuid:&gEfiIp4ServiceBindingProtocolGuid,
- (VOID **) &IpSb
- );
-
- if (!EFI_ERROR(Status)) {
- IpSb->DestroyChild (IpSb, Private->IpChildHandle);
- }
-}
-
-/**
- The Ping Process.
-
- @param[in] SendNumber The send request count.
- @param[in] BufferSize The send buffer size.
- @param[in] SrcAddress The source address.
- @param[in] DstAddress The destination address.
- @param[in] IpChoice The choice between IPv4 and IPv6.
-
- @retval SHELL_SUCCESS The ping processed successfullly.
- @retval others The ping processed unsuccessfully.
-**/
-SHELL_STATUS
-EFIAPI
-ShellPing (
- IN UINT32 SendNumber,
- IN UINT32 BufferSize,
- IN EFI_IPv6_ADDRESS *SrcAddress,
- IN EFI_IPv6_ADDRESS *DstAddress,
- IN UINT32 IpChoice
- )
-{
- EFI_STATUS Status;
- PING_PRIVATE_DATA *Private;
- PING_ICMPX_TX_INFO *TxInfo;
- LIST_ENTRY *Entry;
- LIST_ENTRY *NextEntry;
- SHELL_STATUS ShellStatus;
-
- ShellStatus = SHELL_SUCCESS;
- Private = AllocateZeroPool (sizeof (PING_PRIVATE_DATA));
-
- if (Private == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
-
- Private->IpChoice = IpChoice;
- Private->Signature = PING_PRIVATE_DATA_SIGNATURE;
- Private->SendNum = SendNumber;
- Private->BufferSize = BufferSize;
- Private->RttMin = ~((UINT64 )(0x0));
- Private->Status = EFI_NOT_READY;
-
- CopyMem(&Private->SrcAddress, SrcAddress, sizeof(Private->SrcAddress));
- CopyMem(&Private->DstAddress, DstAddress, sizeof(Private->DstAddress));
-
- InitializeListHead (&Private->TxList);
-
- //
- // Open and configure a ip instance for us.
- //
- Status = PingCreateIpInstance (Private);
-
- if (EFI_ERROR (Status)) {
- ShellStatus = SHELL_ACCESS_DENIED;
- goto ON_EXIT;
- }
- //
- // Print the command line itself.
- //
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_START), gShellNetwork1HiiHandle, mDstString, Private->BufferSize);
- //
- // Create a ipv6 token to receive the first icmp6 echo reply packet.
- //
- Status = Ping6ReceiveEchoReply (Private);
-
- if (EFI_ERROR (Status)) {
- ShellStatus = SHELL_ACCESS_DENIED;
- goto ON_EXIT;
- }
- //
- // Create and start timer to send icmp6 echo request packet per second.
- //
- Status = gBS->CreateEvent (
- EVT_TIMER | EVT_NOTIFY_SIGNAL,
- TPL_CALLBACK,
- Ping6OnTimerRoutine,
- Private,
- &Private->Timer
- );
-
- if (EFI_ERROR (Status)) {
- ShellStatus = SHELL_ACCESS_DENIED;
- goto ON_EXIT;
- }
- //
- // Create a ipv6 token to send the first icmp6 echo request packet.
- //
- Status = PingSendEchoRequest (Private);
- //
- // EFI_NOT_READY for IPsec is enable and IKE is not established.
- //
- if (EFI_ERROR (Status) && (Status != EFI_NOT_READY)) {
- ShellStatus = SHELL_ACCESS_DENIED;
- if(Status == EFI_NOT_FOUND) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_NOSOURCE_INDO), gShellNetwork1HiiHandle, mDstString);
- } else if (Status == RETURN_NO_MAPPING) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_NOROUTE_FOUND), gShellNetwork1HiiHandle, mDstString, mSrcString);
- } else {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING_NETWORK_ERROR), gShellNetwork1HiiHandle, Status);
- }
-
- goto ON_EXIT;
- }
-
- Status = gBS->SetTimer (
- Private->Timer,
- TimerPeriodic,
- ONE_SECOND
- );
-
- if (EFI_ERROR (Status)) {
- ShellStatus = SHELL_ACCESS_DENIED;
- goto ON_EXIT;
- }
- //
- // Control the ping6 process by two factors:
- // 1. Hot key
- // 2. Private->Status
- // 2.1. success means all icmp6 echo request packets get reply packets.
- // 2.2. timeout means the last icmp6 echo reply request timeout to get reply.
- // 2.3. noready means ping6 process is on-the-go.
- //
- while (Private->Status == EFI_NOT_READY) {
- Status = Private->ProtocolPointers.Poll (Private->IpProtocol);
- if (ShellGetExecutionBreakFlag()) {
- Private->Status = EFI_ABORTED;
- goto ON_STAT;
- }
- }
-
-ON_STAT:
- //
- // Display the statistics in all.
- //
- gBS->SetTimer (Private->Timer, TimerCancel, 0);
-
- if (Private->TxCount != 0) {
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_PING_STAT),
- gShellNetwork1HiiHandle,
- Private->TxCount,
- Private->RxCount,
- (100 * (Private->TxCount - Private->RxCount)) / Private->TxCount,
- Private->RttSum
- );
- }
-
- if (Private->RxCount != 0) {
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_PING_RTT),
- gShellNetwork1HiiHandle,
- Private->RttMin,
- Private->RttMax,
- DivU64x64Remainder (Private->RttSum, Private->RxCount, NULL)
- );
- }
-
-ON_EXIT:
-
- if (Private != NULL) {
-
- NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->TxList) {
- TxInfo = BASE_CR (Entry, PING_ICMPX_TX_INFO, Link);
-
- if (Private->IpProtocol != NULL && Private->ProtocolPointers.Cancel != NULL) {
- Status = Private->ProtocolPointers.Cancel (Private->IpProtocol, TxInfo->Token);
- }
-
- RemoveEntryList (&TxInfo->Link);
- PingDestroyTxInfo (TxInfo, Private->IpChoice);
- }
-
- if (Private->Timer != NULL) {
- gBS->CloseEvent (Private->Timer);
- }
-
- if (Private->IpProtocol != NULL && Private->ProtocolPointers.Cancel != NULL) {
- Status = Private->ProtocolPointers.Cancel (Private->IpProtocol, &Private->RxToken);
- }
-
- if (Private->RxToken.Event != NULL) {
- gBS->CloseEvent (Private->RxToken.Event);
- }
-
- if (Private->IpChildHandle != NULL) {
- Ping6DestroyIp6Instance (Private);
- }
-
- FreePool (Private);
- }
-
- return ShellStatus;
-}
-
-/**
- Function for 'ping' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunPing (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- SHELL_STATUS ShellStatus;
- EFI_IPv6_ADDRESS DstAddress;
- EFI_IPv6_ADDRESS SrcAddress;
- UINT64 BufferSize;
- UINTN SendNumber;
- LIST_ENTRY *ParamPackage;
- CONST CHAR16 *ValueStr;
- UINTN NonOptionCount;
- UINT32 IpChoice;
-
- //
- // we use IPv6 buffers to hold items...
- // make sure this is enough space!
- //
- ASSERT(sizeof(EFI_IPv4_ADDRESS ) <= sizeof(EFI_IPv6_ADDRESS ));
- ASSERT(sizeof(EFI_IP4_COMPLETION_TOKEN) <= sizeof(EFI_IP6_COMPLETION_TOKEN ));
-
- IpChoice = PING_IP_CHOICE_IP4;
-
- ShellStatus = SHELL_SUCCESS;
-
- Status = ShellCommandLineParseEx (PingParamList, &ParamPackage, NULL, TRUE, FALSE);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellNetwork1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto ON_EXIT;
- }
-
- if (ShellCommandLineGetFlag (ParamPackage, L"-_ip6")) {
- IpChoice = PING_IP_CHOICE_IP6;
- }
-
- //
- // Parse the paramter of count number.
- //
- ValueStr = ShellCommandLineGetValue (ParamPackage, L"-n");
- if (ValueStr != NULL) {
- SendNumber = ShellStrToUintn (ValueStr);
-
- //
- // ShellStrToUintn will return 0 when input is 0 or an invalid input string.
- //
- if ((SendNumber == 0) || (SendNumber > MAX_SEND_NUMBER)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellNetwork1HiiHandle, ValueStr);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto ON_EXIT;
- }
- } else {
- SendNumber = DEFAULT_SEND_COUNT;
- }
- //
- // Parse the paramter of buffer size.
- //
- ValueStr = ShellCommandLineGetValue (ParamPackage, L"-l");
- if (ValueStr != NULL) {
- BufferSize = ShellStrToUintn (ValueStr);
-
- //
- // ShellStrToUintn will return 0 when input is 0 or an invalid input string.
- //
- if ((BufferSize < 16) || (BufferSize > MAX_BUFFER_SIZE)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellNetwork1HiiHandle, ValueStr);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto ON_EXIT;
- }
- } else {
- BufferSize = DEFAULT_BUFFER_SIZE;
- }
-
- ZeroMem (&SrcAddress, sizeof (EFI_IPv6_ADDRESS));
- ZeroMem (&DstAddress, sizeof (EFI_IPv6_ADDRESS));
-
- //
- // Parse the paramter of source ip address.
- //
- ValueStr = ShellCommandLineGetValue (ParamPackage, L"-_s");
- if (ValueStr != NULL) {
- mSrcString = ValueStr;
- if (IpChoice == PING_IP_CHOICE_IP6) {
- Status = NetLibStrToIp6 (ValueStr, &SrcAddress);
- } else {
- Status = NetLibStrToIp4 (ValueStr, (EFI_IPv4_ADDRESS*)&SrcAddress);
- }
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellNetwork1HiiHandle, ValueStr);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto ON_EXIT;
- }
- }
- //
- // Parse the paramter of destination ip address.
- //
- NonOptionCount = ShellCommandLineGetCount(ParamPackage);
- if (NonOptionCount < 2) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellNetwork1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto ON_EXIT;
- }
- if (NonOptionCount > 2) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellNetwork1HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto ON_EXIT;
- }
- ValueStr = ShellCommandLineGetRawValue (ParamPackage, 1);
- if (ValueStr != NULL) {
- mDstString = ValueStr;
- if (IpChoice == PING_IP_CHOICE_IP6) {
- Status = NetLibStrToIp6 (ValueStr, &DstAddress);
- } else {
- Status = NetLibStrToIp4 (ValueStr, (EFI_IPv4_ADDRESS*)&DstAddress);
- }
- if (EFI_ERROR (Status)) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellNetwork1HiiHandle, ValueStr);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto ON_EXIT;
- }
- }
- //
- // Get frequency to calculate the time from ticks.
- //
- Status = GetFrequency ();
-
- if (EFI_ERROR(Status)) {
- goto ON_EXIT;
- }
- //
- // Enter into ping process.
- //
- ShellStatus = ShellPing (
- (UINT32)SendNumber,
- (UINT32)BufferSize,
- &SrcAddress,
- &DstAddress,
- IpChoice
- );
-
-ON_EXIT:
- ShellCommandLineFreeVarList (ParamPackage);
- return ShellStatus;
-}
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.c
deleted file mode 100644
index 49849a6191..0000000000
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/** @file
- Main file for NULL named library for network1 shell command functions.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-#include "UefiShellNetwork1CommandsLib.h"
-
-CONST CHAR16 gShellNetwork1FileName[] = L"ShellCommands";
-EFI_HANDLE gShellNetwork1HiiHandle = NULL;
-
-/**
- return the file name of the help text file if not using HII.
-
- @return The string pointer to the file name.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandGetManFileNameNetwork1 (
- VOID
- )
-{
- return (gShellNetwork1FileName);
-}
-
-/**
- Constructor for the Shell Network1 Commands library.
-
- Install the handlers for Network1 UEFI Shell 2.0 profile commands.
-
- @param ImageHandle The image handle of the process.
- @param SystemTable The EFI System Table pointer.
-
- @retval EFI_SUCCESS The shell command handlers were installed sucessfully.
- @retval EFI_UNSUPPORTED The shell level required was not found.
-**/
-EFI_STATUS
-EFIAPI
-ShellNetwork1CommandsLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- gShellNetwork1HiiHandle = NULL;
-
- //
- // check our bit of the profiles mask
- //
- if ((PcdGet8(PcdShellProfileMask) & BIT3) == 0) {
- return (EFI_SUCCESS);
- }
-
- gShellNetwork1HiiHandle = HiiAddPackages (&gShellNetwork1HiiGuid, gImageHandle, UefiShellNetwork1CommandsLibStrings, NULL);
- if (gShellNetwork1HiiHandle == NULL) {
- return (EFI_DEVICE_ERROR);
- }
- //
- // install our shell command handlers
- //
- ShellCommandRegisterCommandName(L"ping", ShellCommandRunPing , ShellCommandGetManFileNameNetwork1, 0, L"network1", TRUE , gShellNetwork1HiiHandle, STRING_TOKEN(STR_GET_HELP_PING));
- ShellCommandRegisterCommandName(L"ifconfig",ShellCommandRunIfconfig , ShellCommandGetManFileNameNetwork1, 0, L"network1", TRUE , gShellNetwork1HiiHandle, STRING_TOKEN(STR_GET_HELP_IFCONFIG));
-
- return (EFI_SUCCESS);
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param ImageHandle The image handle of the process.
- @param SystemTable The EFI System Table pointer.
-**/
-EFI_STATUS
-EFIAPI
-ShellNetwork1CommandsLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (gShellNetwork1HiiHandle != NULL) {
- HiiRemovePackages(gShellNetwork1HiiHandle);
- }
- return (EFI_SUCCESS);
-}
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h
deleted file mode 100644
index 68a7c93c96..0000000000
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/** @file
- header file for NULL named library for network1 shell command functions.
-
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved. <BR>
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_SHELL_NETWORK1_COMMANDS_LIB_H_
-#define _UEFI_SHELL_NETWORK1_COMMANDS_LIB_H_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/ShellLibHiiGuid.h>
-
-#include <Protocol/Cpu.h>
-#include <Protocol/ServiceBinding.h>
-#include <Protocol/Ip6.h>
-#include <Protocol/Ip6Config.h>
-#include <Protocol/Ip4.h>
-#include <Protocol/Ip4Config.h>
-#include <Protocol/HiiConfigAccess.h>
-#include <Protocol/HiiConfigRouting.h>
-#include <Protocol/Arp.h>
-
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/ShellLib.h>
-#include <Library/SortLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HiiLib.h>
-#include <Library/NetLib.h>
-#include <Library/DevicePathLib.h>
-#include <Library/PrintLib.h>
-
-#include <Guid/NicIp4ConfigNvData.h>
-
-extern EFI_HANDLE gShellNetwork1HiiHandle;
-
-/**
- Function for 'ping' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunPing (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'ifconfig' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunIfconfig (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-#endif
-
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
deleted file mode 100644
index 4857a7e795..0000000000
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
+++ /dev/null
@@ -1,67 +0,0 @@
-## @file
-# Provides shell network1 functions
-#
-# Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellNetwork1CommandsLib
- FILE_GUID = 9A929F7E-3861-45ce-87AB-7371219AE255
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = ShellNetwork1CommandsLibConstructor
- DESTRUCTOR = ShellNetwork1CommandsLibDestructor
-
-[Sources.common]
- UefiShellNetwork1CommandsLib.uni
- UefiShellNetwork1CommandsLib.c
- UefiShellNetwork1CommandsLib.h
- Ping.c
- Ifconfig.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- ShellCommandLib
- ShellLib
- UefiLib
- UefiRuntimeServicesTableLib
- UefiBootServicesTableLib
- PcdLib
- HiiLib
- FileHandleLib
- NetLib
-
-[Pcd]
- gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask # ALWAYS_CONSUMED
-
-[Protocols]
- gEfiCpuArchProtocolGuid # ALWAYS_CONSUMED
- gEfiIp6ProtocolGuid # SOMETIMES_CONSUMED
- gEfiIp6ServiceBindingProtocolGuid # SOMETIMES_CONSUMED
- gEfiIp6ConfigProtocolGuid # SOMETIMES_CONSUMED
-
- gEfiIp6ProtocolGuid # SOMETIMES_CONSUMED
- gEfiIp6ServiceBindingProtocolGuid # SOMETIMES_CONSUMED
- gEfiIp6ConfigProtocolGuid # SOMETIMES_CONSUMED
-
-[Guids]
- gShellNetwork1HiiGuid \ No newline at end of file
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
deleted file mode 100644
index f2303dcf4e..0000000000
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.uni
+++ /dev/null
Binary files differ
diff --git a/ShellPkg/Library/UefiSortLib/UefiSortLib.c b/ShellPkg/Library/UefiSortLib/UefiSortLib.c
deleted file mode 100644
index 2aab9d2691..0000000000
--- a/ShellPkg/Library/UefiSortLib/UefiSortLib.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/** @file
- Library used for sorting routines.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DevicePath.h>
-
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/SortLib.h>
-#include <Library/DevicePathLib.h>
-
-STATIC EFI_UNICODE_COLLATION_PROTOCOL *mUnicodeCollation = NULL;
-
-
-/**
- Worker function for QuickSorting. This function is identical to PerformQuickSort,
- except that is uses the pre-allocated buffer so the in place sorting does not need to
- allocate and free buffers constantly.
-
- Each element must be equal sized.
-
- if BufferToSort is NULL, then ASSERT.
- if CompareFunction is NULL, then ASSERT.
- if Buffer is NULL, then ASSERT.
-
- if Count is < 2 then perform no action.
- if Size is < 1 then perform no action.
-
- @param[in, out] BufferToSort on call a Buffer of (possibly sorted) elements
- on return a buffer of sorted elements
- @param[in] Count the number of elements in the buffer to sort
- @param[in] ElementSize Size of an element in bytes
- @param[in] CompareFunction The function to call to perform the comparison
- of any 2 elements
- @param[in] Buffer Buffer of size ElementSize for use in swapping
-**/
-VOID
-EFIAPI
-QuickSortWorker (
- IN OUT VOID *BufferToSort,
- IN CONST UINTN Count,
- IN CONST UINTN ElementSize,
- IN SORT_COMPARE CompareFunction,
- IN VOID *Buffer
- )
-{
- VOID *Pivot;
- UINTN LoopCount;
- UINTN NextSwapLocation;
-
- ASSERT(BufferToSort != NULL);
- ASSERT(CompareFunction != NULL);
- ASSERT(Buffer != NULL);
-
- if ( Count < 2
- || ElementSize < 1
- ){
- return;
- }
-
- NextSwapLocation = 0;
-
- //
- // pick a pivot (we choose last element)
- //
- Pivot = ((UINT8*)BufferToSort+((Count-1)*ElementSize));
-
- //
- // Now get the pivot such that all on "left" are below it
- // and everything "right" are above it
- //
- for ( LoopCount = 0
- ; LoopCount < Count -1
- ; LoopCount++
- ){
- //
- // if the element is less than the pivot
- //
- if (CompareFunction((VOID*)((UINT8*)BufferToSort+((LoopCount)*ElementSize)),Pivot) <= 0){
- //
- // swap
- //
- CopyMem (Buffer, (UINT8*)BufferToSort+(NextSwapLocation*ElementSize), ElementSize);
- CopyMem ((UINT8*)BufferToSort+(NextSwapLocation*ElementSize), (UINT8*)BufferToSort+((LoopCount)*ElementSize), ElementSize);
- CopyMem ((UINT8*)BufferToSort+((LoopCount)*ElementSize), Buffer, ElementSize);
-
- //
- // increment NextSwapLocation
- //
- NextSwapLocation++;
- }
- }
- //
- // swap pivot to it's final position (NextSwapLocaiton)
- //
- CopyMem (Buffer, Pivot, ElementSize);
- CopyMem (Pivot, (UINT8*)BufferToSort+(NextSwapLocation*ElementSize), ElementSize);
- CopyMem ((UINT8*)BufferToSort+(NextSwapLocation*ElementSize), Buffer, ElementSize);
-
- //
- // Now recurse on 2 paritial lists. neither of these will have the 'pivot' element
- // IE list is sorted left half, pivot element, sorted right half...
- //
- if (NextSwapLocation >= 2) {
- QuickSortWorker(
- BufferToSort,
- NextSwapLocation,
- ElementSize,
- CompareFunction,
- Buffer);
- }
-
- if ((Count - NextSwapLocation - 1) >= 2) {
- QuickSortWorker(
- (UINT8 *)BufferToSort + (NextSwapLocation+1) * ElementSize,
- Count - NextSwapLocation - 1,
- ElementSize,
- CompareFunction,
- Buffer);
- }
-
- return;
-}
-/**
- Function to perform a Quick Sort alogrithm on a buffer of comparable elements.
-
- Each element must be equal sized.
-
- if BufferToSort is NULL, then ASSERT.
- if CompareFunction is NULL, then ASSERT.
-
- if Count is < 2 then perform no action.
- if Size is < 1 then perform no action.
-
- @param[in, out] BufferToSort on call a Buffer of (possibly sorted) elements
- on return a buffer of sorted elements
- @param[in] Count the number of elements in the buffer to sort
- @param[in] ElementSize Size of an element in bytes
- @param[in] CompareFunction The function to call to perform the comparison
- of any 2 elements
-**/
-VOID
-EFIAPI
-PerformQuickSort (
- IN OUT VOID *BufferToSort,
- IN CONST UINTN Count,
- IN CONST UINTN ElementSize,
- IN SORT_COMPARE CompareFunction
- )
-{
- VOID *Buffer;
-
- ASSERT(BufferToSort != NULL);
- ASSERT(CompareFunction != NULL);
-
- Buffer = AllocateZeroPool(ElementSize);
- ASSERT(Buffer != NULL);
-
- QuickSortWorker(
- BufferToSort,
- Count,
- ElementSize,
- CompareFunction,
- Buffer);
-
- FreePool(Buffer);
- return;
-}
-
-/**
- Function to compare 2 device paths for use in QuickSort.
-
- @param[in] Buffer1 pointer to Device Path poiner to compare
- @param[in] Buffer2 pointer to second DevicePath pointer to compare
-
- @retval 0 Buffer1 equal to Buffer2
- @return < 0 Buffer1 is less than Buffer2
- @return > 0 Buffer1 is greater than Buffer2
-**/
-INTN
-EFIAPI
-DevicePathCompare (
- IN CONST VOID *Buffer1,
- IN CONST VOID *Buffer2
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevicePath1;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath2;
- CHAR16 *TextPath1;
- CHAR16 *TextPath2;
- EFI_STATUS Status;
- INTN RetVal;
-
- DevicePath1 = *(EFI_DEVICE_PATH_PROTOCOL**)Buffer1;
- DevicePath2 = *(EFI_DEVICE_PATH_PROTOCOL**)Buffer2;
-
- if (DevicePath1 == NULL) {
- if (DevicePath2 == NULL) {
- return 0;
- }
-
- return -1;
- }
-
- if (DevicePath2 == NULL) {
- return 1;
- }
-
- if (mUnicodeCollation == NULL) {
- Status = gBS->LocateProtocol(
- &gEfiUnicodeCollation2ProtocolGuid,
- NULL,
- (VOID**)&mUnicodeCollation);
-
- ASSERT_EFI_ERROR(Status);
- }
-
- TextPath1 = ConvertDevicePathToText(
- DevicePath1,
- FALSE,
- FALSE);
-
- TextPath2 = ConvertDevicePathToText(
- DevicePath2,
- FALSE,
- FALSE);
-
- if (TextPath1 == NULL) {
- RetVal = -1;
- } else if (TextPath2 == NULL) {
- RetVal = 1;
- } else {
- RetVal = mUnicodeCollation->StriColl(
- mUnicodeCollation,
- TextPath1,
- TextPath2);
- }
-
- SHELL_FREE_NON_NULL(TextPath1);
- SHELL_FREE_NON_NULL(TextPath2);
-
- return (RetVal);
-}
-
-/**
- Function to compare 2 strings without regard to case of the characters.
-
- @param[in] Buffer1 Pointer to String to compare.
- @param[in] Buffer2 Pointer to second String to compare.
-
- @retval 0 Buffer1 equal to Buffer2.
- @return < 0 Buffer1 is less than Buffer2.
- @return > 0 Buffer1 is greater than Buffer2.
-**/
-INTN
-EFIAPI
-StringNoCaseCompare (
- IN CONST VOID *Buffer1,
- IN CONST VOID *Buffer2
- )
-{
- EFI_STATUS Status;
- if (mUnicodeCollation == NULL) {
- Status = gBS->LocateProtocol(
- &gEfiUnicodeCollation2ProtocolGuid,
- NULL,
- (VOID**)&mUnicodeCollation);
-
- ASSERT_EFI_ERROR(Status);
- }
-
- return (mUnicodeCollation->StriColl(
- mUnicodeCollation,
- *(CHAR16**)Buffer1,
- *(CHAR16**)Buffer2));
-}
-
-
-/**
- Function to compare 2 strings.
-
- @param[in] Buffer1 Pointer to String to compare (CHAR16**).
- @param[in] Buffer2 Pointer to second String to compare (CHAR16**).
-
- @retval 0 Buffer1 equal to Buffer2.
- @return < 0 Buffer1 is less than Buffer2.
- @return > 0 Buffer1 is greater than Buffer2.
-**/
-INTN
-EFIAPI
-StringCompare (
- IN CONST VOID *Buffer1,
- IN CONST VOID *Buffer2
- )
-{
- return (StrCmp(
- *(CHAR16**)Buffer1,
- *(CHAR16**)Buffer2));
-}
diff --git a/ShellPkg/Library/UefiSortLib/UefiSortLib.inf b/ShellPkg/Library/UefiSortLib/UefiSortLib.inf
deleted file mode 100644
index 21541d7ae1..0000000000
--- a/ShellPkg/Library/UefiSortLib/UefiSortLib.inf
+++ /dev/null
@@ -1,46 +0,0 @@
-## @file
-# Library used for sorting routines.
-#
-# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiSortLib
- FILE_GUID = 4264A823-45A3-42db-B92C-AA078555CBD3
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = SortLib|UEFI_APPLICATION UEFI_DRIVER UEFI_DRIVER
-
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- UefiSortLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- UefiBootServicesTableLib
- DevicePathLib
-
-[Protocols]
- gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED
- gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED
-
diff --git a/ShellPkg/Readme.txt b/ShellPkg/Readme.txt
deleted file mode 100644
index 77841c0a2a..0000000000
--- a/ShellPkg/Readme.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-============================================================================
- OVERVIEW
-============================================================================
-The UEFI 2.0 shell provides a standard pre-boot command line processor.
-It is similar to the EDK EFI Shell or a *nix command line parser.
-
-============================================================================
- HOW TO INCORPORATE THIS SHELL INTO NT32
-============================================================================
-The instructions below are included as a sample and template on how a
-developer may integrate this code into an existing platform:
-
-1. Add this shell build to the NT32 build:
- Add the shell.inf to the [components] section as it is in the ShellPkg.dsc.
-
-2. Update system PCDs to support this new module
- Update the PCD as follows using the Shell's PCD:
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
-
-3. Remove the old shell from the NT32 Firmware list
- Remove the FILE APPLICATION section for the old shell.
-
-4. Add this shell to the NT32 firmware list
- Add the Shell.INF to the end of the list of DXE modules.
-
-5. Build NT32
-
-
-============================================================================
diff --git a/ShellPkg/ShellPkg.dec b/ShellPkg/ShellPkg.dec
deleted file mode 100644
index 4a29f4afbc..0000000000
--- a/ShellPkg/ShellPkg.dec
+++ /dev/null
@@ -1,121 +0,0 @@
-## @file ShellPkg.dec
-#
-# This Package provides all definitions for EFI and UEFI Shell
-#
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available under
-# the terms and conditions of the BSD License which accompanies this distribution.
-# The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- DEC_SPECIFICATION = 0x00010005
- PACKAGE_NAME = ShellPkg
- PACKAGE_GUID = 9FB7587C-93F7-40a7-9C04-FD7BA94EE646
- PACKAGE_VERSION = 0.50
-
-[Includes]
- Include
-
-[LibraryClasses]
- ## @libraryclass Provides most Shell APIs. Only available for Shell applications
- ShellLib|Include/Library/ShellLib.h
-
- ## @libraryclass Provides shell internal support Only available for shell internal commands
- ShellCommandLib|Include/Library/ShellCommandLib.h
-
- ## @libraryclass provides EFI_FILE_HANDLE services used by Shell and ShellLib
- FileHandleLib|Include/Library/FileHandleLib.h
-
- ## @libraryclass Allows for a shell application to have a C style entry point
- ShellCEntryLib|Include/Library/ShellCEntryLib.h
-
- ## @libraryclass Provides sorting functions
- SortLib|Include/Library/SortLib.h
-
- ## @libraryclass Provides advanced parsing functions
- HandleParsingLib|Include/Library/HandleParsingLib.h
-
- ## @libraryclass Provides path manipulation functions
- PathLib|Include/Library/PathLib.h
-
-[Guids]
- gEfiShellEnvironment2ExtGuid = {0xd2c18636, 0x40e5, 0x4eb5, {0xa3, 0x1b, 0x36, 0x69, 0x5f, 0xd4, 0x2c, 0x87}}
- gEfiShellPkgTokenSpaceGuid = {0x171e9188, 0x31d3, 0x40f5, {0xb1, 0x0c, 0x53, 0x9b, 0x2d, 0xb9, 0x40, 0xcd}}
- gShellVariableGuid = {0x158def5a, 0xf656, 0x419c, {0xb0, 0x27, 0x7a, 0x31, 0x92, 0xc0, 0x79, 0xd2}}
- gShellMapGuid = {0x51271e13, 0x7de3, 0x43af, {0x8b, 0xc2, 0x71, 0xad, 0x3b, 0x82, 0x43, 0x25}}
- gShellAliasGuid = {0x0053d9d6, 0x2659, 0x4599, {0xa2, 0x6b, 0xef, 0x45, 0x36, 0xe6, 0x31, 0xa9}}
- gHandleParsingHiiGuid = {0xb8969637, 0x81de, 0x43af, {0xbc, 0x9a, 0x24, 0xd9, 0x89, 0x13, 0xf2, 0xf6}}
- gShellDebug1HiiGuid = {0x25f200aa, 0xd3cb, 0x470a, {0xbf, 0x51, 0xe7, 0xd1, 0x62, 0xd2, 0x2e, 0x6f}}
- gShellDriver1HiiGuid = {0xaf0b742, 0x63ec, 0x45bd, {0x8d, 0xb6, 0x71, 0xad, 0x7f, 0x2f, 0xe8, 0xe8}}
- gShellInstall1HiiGuid = {0x7d574d54, 0xd364, 0x4d4a, {0x95, 0xe3, 0x49, 0x45, 0xdb, 0x7a, 0xd3, 0xee}}
- gShellLevel1HiiGuid = {0xdec5daa4, 0x6781, 0x4820, {0x9c, 0x63, 0xa7, 0xb0, 0xe4, 0xf1, 0xdb, 0x31}}
- gShellLevel2HiiGuid = {0xf95a7ccc, 0x4c55, 0x4426, {0xa7, 0xb4, 0xdc, 0x89, 0x61, 0x95, 0xb, 0xae}}
- gShellLevel3HiiGuid = {0x4344558d, 0x4ef9, 0x4725, {0xb1, 0xe4, 0x33, 0x76, 0xe8, 0xd6, 0x97, 0x4f}}
- gShellNetwork1HiiGuid = {0xf3d301bb, 0xf4a5, 0x45a8, {0xb0, 0xb7, 0xfa, 0x99, 0x9c, 0x62, 0x37, 0xae}}
-
-[Protocols]
- gEfiShellProtocolGuid = {0x6302d008, 0x7f9b, 0x4f30, {0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e}}
- gEfiShellParametersProtocolGuid = {0x752f3136, 0x4e16, 0x4fdc, {0xa2, 0x2a, 0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca}}
- gEfiShellEnvironment2Guid = {0x47c7b221, 0xc42a, 0x11d2, {0x8e, 0x57, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}}
- gEfiShellInterfaceGuid = {0x47c7b223, 0xc42a, 0x11d2, {0x8e, 0x57, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}}
-
-[PcdsFeatureFlag]
- ## This flag is used to control whether the shell includes NT32 platform Guids
- # and thereby prevents dependancy on that Pkg
- gEfiShellPkgTokenSpaceGuid.PcdShellIncludeNtGuids|TRUE|BOOLEAN|0x0000000E
-
- ## This flag is used to control HII required by the shell
- gEfiShellPkgTokenSpaceGuid.PcdShellRequireHiiPlatform|TRUE|BOOLEAN|0x00000003
-
- ## This flag is used to control HII required by the shell
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportFrameworkHii|FALSE|BOOLEAN|0x00000004
-
- ## This flag forces the shell to present a user console. Allows for earlier debugging of platforms.
- gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole|FALSE|BOOLEAN|0x0000000F
-
-[PcdsFixedAtBuild]
- ## This flag is used to control initialization of the shell library
- # This should be FALSE for compiling the shell application itself only.
- gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|TRUE|BOOLEAN|0x00000005
-
- ## This is the max buffer for ShellLib, FileHandleLib, and internal Shell printings.
- gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize|16000|UINT16|0x0000000C
-
- ## This flag is used to control the commands available in the shell
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel|3|UINT8|0x00000001
-
- ## This flag is used to control the profiles available in the shell
- # don't forget to update the text file if you change this.
- # bit 0 = Drivers1
- # bit 1 = Debug1
- # bit 2 = Install1
- # bit 3 = Network1
- gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask|0xFF|UINT8|0x0000000D
-
- ## This is the character count for allocation for consistent mappings
- gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength|50|UINT8|0x00000009
-
- ## This determins how many bytes are read out of files at a time for file operations (type, copy, etc...)
- gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|1000|UINT16|0x0000000A
-
-[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
- ## This flag is used to control the protocols produced by the shell
- # If TRUE the shell will produce EFI_SHELL_ENVIRONMENT2 and EFI_SHELL_INTERFACE
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportOldProtocols|FALSE|BOOLEAN|0x00000002
-
- ## this flag determins whether Page Break (-b) defaults to on or off in the shell
- gEfiShellPkgTokenSpaceGuid.PcdShellPageBreakDefault|FALSE|BOOLEAN|0x00000006
-
- ## this flag determins whether insert mode for typing is default (FALSE means typeover)
- gEfiShellPkgTokenSpaceGuid.PcdShellInsertModeDefault|TRUE|BOOLEAN|0x00000007
-
- ## this flag determins the default number of screens kept for history log.
- # the spec defines 3 as the minimum
- gEfiShellPkgTokenSpaceGuid.PcdShellScreenLogCount|3|UINT8|0x00000008 \ No newline at end of file
diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
deleted file mode 100644
index a1414b0dd8..0000000000
--- a/ShellPkg/ShellPkg.dsc
+++ /dev/null
@@ -1,88 +0,0 @@
-## @file
-# Shell Package
-#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- PLATFORM_NAME = Shell
- PLATFORM_GUID = E1DC9BF8-7013-4c99-9437-795DAA45F3BD
- PLATFORM_VERSION = 0.50
- DSC_SPECIFICATION = 0x00010006
- OUTPUT_DIRECTORY = Build/Shell
- SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM
- BUILD_TARGETS = DEBUG|RELEASE
- SKUID_IDENTIFIER = DEFAULT
-
-[LibraryClasses.common]
- UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
- UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf
- DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
- DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
- BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
- HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
- NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-
- ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
- ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
- FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
- ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
- SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf
- HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
-
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- PathLib|ShellPkg/Library/BasePathLib/BasePathLib.inf
-
-[LibraryClasses.ARM]
- #
- # It is not possible to prevent the ARM compiler for generic intrinsic functions.
- # This library provides the instrinsic functions generate by a given compiler.
- # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
- #
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
-
-[PcdsFixedAtBuild]
- gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
- gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
- gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|16000
-!ifdef $(NO_SHELL_PROFILES)
- gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask|0x00
-!endif
-
-[Components]
- ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
- ShellPkg/Library/UefiShellLib/UefiShellLib.inf
- ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
- ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
- ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
-
- ShellPkg/Application/Shell/Shell.inf {
- <LibraryClasses>
- NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
-!ifndef $(NO_SHELL_PROFILES)
- NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
-!endif
- }
-